diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h deleted file mode 100644 index ff6c6b187f..0000000000 --- a/Marlin/Conditionals.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals.h - * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h - */ -#error "Old configurations? Please delete all #include lines from Configuration.h and Configuration_adv.h." diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h deleted file mode 100644 index a796e24667..0000000000 --- a/Marlin/Conditionals_LCD.h +++ /dev/null @@ -1,518 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals_LCD.h - * Conditionals that need to be set before Configuration_adv.h or pins.h - */ - -#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first -#define CONDITIONALS_LCD_H - -#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) - -#if ENABLED(CARTESIO_UI) - - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 90 - #define LCD_CONTRAST_MIN 60 - #define LCD_CONTRAST_MAX 140 - -#elif ENABLED(MAKRPANEL) - - #define U8GLIB_ST7565_64128N - -#elif ENABLED(ZONESTAR_LCD) - - #define REPRAPWORLD_KEYPAD - #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 - #define ADC_KEYPAD - #define ADC_KEY_NUM 8 - #define ULTIPANEL - - // this helps to implement ADC_KEYPAD menus - #define ENCODER_PULSES_PER_STEP 1 - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #define ENCODER_FEEDRATE_DEADZONE 2 - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(ANET_FULL_GRAPHICS_LCD) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif ENABLED(BQ_LCD_SMART_CONTROLLER) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) - #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. - - #if ENABLED(miniVIKI) - #define LCD_CONTRAST_MIN 75 - #define LCD_CONTRAST_MAX 115 - #define DEFAULT_LCD_CONTRAST 95 - #define U8GLIB_ST7565_64128N - #elif ENABLED(VIKI2) - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 140 - #define U8GLIB_ST7565_64128N - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define LCD_CONTRAST_MIN 90 - #define LCD_CONTRAST_MAX 130 - #define DEFAULT_LCD_CONTRAST 110 - #define U8GLIB_LM6059_AF - #define SD_DETECT_INVERTED - #endif - -#elif ENABLED(OLED_PANEL_TINYBOY2) - - #define U8GLIB_SSD1306 - #define ULTIPANEL - #define REVERSE_ENCODER_DIRECTION - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(RA_CONTROL_PANEL) - - #define LCD_I2C_TYPE_PCA8574 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL - -#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define DOGLCD - #define U8GLIB_ST7920 - #define ULTIPANEL - -#elif ENABLED(CR10_STOCKDISPLAY) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif - -#elif ENABLED(MKS_12864OLED) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SH1106 - -#elif ENABLED(MKS_12864OLED_SSD1306) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SSD1306 - -#elif ENABLED(MKS_MINI_12864) - - #define MINIPANEL - -#endif - -#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 17 -#endif - -#if ENABLED(ULTI_CONTROLLER) - #define U8GLIB_SSD1309 - #define REVERSE_ENCODER_DIRECTION - #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 254 - #define DEFAULT_LCD_CONTRAST 127 - #define ENCODER_PULSES_PER_STEP 2 - #define ENCODER_STEPS_PER_MENU_ITEM 2 -#endif - -// Generic support for SSD1306 / SSD1309 / SH1106 OLED based LCDs. -#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SSD1309) || ENABLED(U8GLIB_SH1106) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SSD1309 / SH1106 graphic Display Family) -#endif - -#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) - - #define ULTIMAKERCONTROLLER - -#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - -#endif - -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_CONTROLLER) - #define DOGLCD - #define U8GLIB_ST7920 - #define REPRAP_DISCOUNT_SMART_CONTROLLER -#endif - -#if ENABLED(ULTIMAKERCONTROLLER) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ - || ENABLED(G3D_PANEL) \ - || ENABLED(RIGIDBOT_PANEL) \ - || ENABLED(ULTI_CONTROLLER) - #define ULTIPANEL -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL - #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP) - #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 - #endif -#endif - -/** - * I2C PANELS - */ - -#if ENABLED(LCD_SAINSMART_I2C_1602) || ENABLED(LCD_SAINSMART_I2C_2004) - - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTRA_LCD - - #if ENABLED(LCD_SAINSMART_I2C_2004) - #define LCD_WIDTH 20 - #define LCD_HEIGHT 4 - #endif - -#elif ENABLED(LCD_I2C_PANELOLU2) - - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define ULTIPANEL - -#elif ENABLED(LCD_I2C_VIKI) - - /** - * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - * - * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) - * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. - * Note: The pause/stop/resume LCD button pin should be connected to the Arduino - * BTN_ENC pin (or set BTN_ENC to -1 if not used) - */ - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define ULTIPANEL - - #define ENCODER_FEEDRATE_DEADZONE 4 - - #define STD_ENCODER_PULSES_PER_STEP 1 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 2 - -#elif ENABLED(G3D_PANEL) - - #define STD_ENCODER_PULSES_PER_STEP 2 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - -#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - || ENABLED(OLED_PANEL_TINYBOY2) \ - || ENABLED(BQ_LCD_SMART_CONTROLLER) \ - || ENABLED(LCD_I2C_PANELOLU2) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif - -#ifndef STD_ENCODER_PULSES_PER_STEP - #define STD_ENCODER_PULSES_PER_STEP 5 -#endif -#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif -#ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP -#endif -#ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM -#endif -#ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 6 -#endif - -// Shift register panels -// --------------------- -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection - -#if ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define ULTIPANEL -#endif - -#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display - #ifndef LCD_WIDTH - #ifdef LCD_WIDTH_OVERRIDE - #define LCD_WIDTH LCD_WIDTH_OVERRIDE - #else - #define LCD_WIDTH 22 - #endif - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 5 - #endif -#endif - -#if ENABLED(NO_LCD_MENUS) - #undef ULTIPANEL -#endif - -#if ENABLED(ULTIPANEL) - #define NEWPANEL // Disable this if you actually have no click-encoder panel - #define ULTRA_LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 20 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 4 - #endif -#elif ENABLED(ULTRA_LCD) // no panel but just LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 16 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 2 - #endif -#endif - -#if ENABLED(DOGLCD) - /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */ - // \x00 intentionally skipped to avoid problems in strings - #define LCD_STR_REFRESH "\x01" - #define LCD_STR_FOLDER "\x02" - #define LCD_STR_ARROW_RIGHT "\x03" - #define LCD_STR_UPLEVEL "\x04" - #define LCD_STR_CLOCK "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_BEDTEMP "\x07" - #define LCD_STR_THERMOMETER "\x08" - #define LCD_STR_DEGREE "\x09" - - #define LCD_STR_SPECIAL_MAX '\x09' - // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin. - // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - - // Symbol characters - #define LCD_STR_FILAM_DIA "\xf8" - #define LCD_STR_FILAM_MUL "\xa4" -#else - // Custom characters defined in the first 8 characters of the LCD - #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_DEGREE_CHAR 0x01 - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_UPLEVEL_CHAR 0x03 - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_FEEDRATE_CHAR 0x06 - #define LCD_CLOCK_CHAR 0x07 - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ -#endif - -/** - * Default LCD contrast for dogm-like LCD displays - */ -#if ENABLED(DOGLCD) - - #define HAS_LCD_CONTRAST ( \ - ENABLED(MAKRPANEL) \ - || ENABLED(CARTESIO_UI) \ - || ENABLED(VIKI2) \ - || ENABLED(miniVIKI) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - ) - - #if HAS_LCD_CONTRAST - #ifndef LCD_CONTRAST_MIN - #define LCD_CONTRAST_MIN 0 - #endif - #ifndef LCD_CONTRAST_MAX - #define LCD_CONTRAST_MAX 63 - #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST 32 - #endif - #endif -#endif - -// Boot screens -#if DISABLED(ULTRA_LCD) - #undef SHOW_BOOTSCREEN -#elif !defined(BOOTSCREEN_TIMEOUT) - #define BOOTSCREEN_TIMEOUT 2500 -#endif - -#define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST)) - -/** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * E_MANUAL - Number of E steppers for LCD move options - * - */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 - #else - #define E_STEPPERS 1 - #endif - #if DISABLED(SWITCHING_NOZZLE) - #define HOTENDS E_STEPPERS - #endif - #define E_MANUAL EXTRUDERS -#elif ENABLED(MIXING_EXTRUDER) - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 -#else - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS -#endif - -// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE -#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE) - #undef DISABLE_INACTIVE_EXTRUDER -#endif - -// MK2 Multiplexer forces SINGLENOZZLE -#if ENABLED(MK2_MULTIPLEXER) - #define SINGLENOZZLE -#endif - -#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset - #undef HOTENDS - #define HOTENDS 1 - #undef TEMP_SENSOR_1_AS_REDUNDANT - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y -#endif - -#ifndef HOTENDS - #define HOTENDS EXTRUDERS -#endif - -#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) - -/** - * DISTINCT_E_FACTORS affects how some E factors are accessed - */ -#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define XYZE_N (XYZ + E_STEPPERS) - #define E_AXIS_N (E_AXIS + extruder) -#else - #undef DISTINCT_E_FACTORS - #define XYZE_N XYZE - #define E_AXIS_N E_AXIS -#endif - -/** - * The BLTouch Probe emulates a servo probe - * and uses "special" angles for its state. - */ -#if ENABLED(BLTOUCH) - #ifndef Z_PROBE_SERVO_NR - #define Z_PROBE_SERVO_NR 0 - #endif - #ifndef NUM_SERVOS - #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1) - #endif - #undef DEACTIVATE_SERVOS_AFTER_MOVE - #if NUM_SERVOS == 1 - #undef SERVO_DELAY - #define SERVO_DELAY { 50 } - #endif - #ifndef BLTOUCH_DELAY - #define BLTOUCH_DELAY 375 - #endif - #undef Z_SERVO_ANGLES - #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } - - #define BLTOUCH_DEPLOY 10 - #define BLTOUCH_STOW 90 - #define BLTOUCH_SELFTEST 120 - #define BLTOUCH_RESET 160 - #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING) - - // Always disable probe pin inverting for BLTouch - #undef Z_MIN_PROBE_ENDSTOP_INVERTING - #define Z_MIN_PROBE_ENDSTOP_INVERTING false - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #undef Z_MIN_ENDSTOP_INVERTING - #define Z_MIN_ENDSTOP_INVERTING Z_MIN_PROBE_ENDSTOP_INVERTING - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN) - #else - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE) - #endif -#endif - -/** - * Set a flag for a servo probe - */ -#define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) - -/** - * Set flags for enabled probes - */ -#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) -#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - -#if !HAS_BED_PROBE - // Clear probe pin settings when no probe is selected - #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PROBE_ENDSTOP -#elif ENABLED(Z_PROBE_ALLEN_KEY) - // Extra test for Allen Key Probe - #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST -#endif - -#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) - -#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) -#define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) -#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) - -#define USE_MARLINSERIAL !(defined(__AVR__) && defined(USBCON)) - -#endif // CONDITIONALS_LCD_H diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h deleted file mode 100644 index a0877283d1..0000000000 --- a/Marlin/Conditionals_post.h +++ /dev/null @@ -1,1382 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals_post.h - * Defines that depend on configuration but are not editable. - */ - -#ifndef CONDITIONALS_POST_H -#define CONDITIONALS_POST_H - -#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)) -#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA) -#define IS_CARTESIAN !IS_KINEMATIC - -/** - * Axis lengths and center - */ -#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS)) -#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) -#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS)) - -// Defined only if the sanity-check is bypassed -#ifndef X_BED_SIZE - #define X_BED_SIZE X_MAX_LENGTH -#endif -#ifndef Y_BED_SIZE - #define Y_BED_SIZE Y_MAX_LENGTH -#endif - -// Require 0,0 bed center for Delta and SCARA -#if IS_KINEMATIC - #define BED_CENTER_AT_0_0 -#endif - -// Define center values for future use -#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) -#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) - -/** - * Dual X Carriage - */ -#if ENABLED(DUAL_X_CARRIAGE) - #ifndef X1_MIN_POS - #define X1_MIN_POS X_MIN_POS - #endif - #ifndef X1_MAX_POS - #define X1_MAX_POS X_BED_SIZE - #endif -#endif - -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX)) -#define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX)) -#define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY)) -#define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ) -#if IS_CORE - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS - #endif - #if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY) - #define CORESIGN(n) (-(n)) - #else - #define CORESIGN(n) (n) - #endif -#endif - -/** - * No adjustable bed on non-cartesians - */ -#if IS_KINEMATIC - #undef LEVEL_BED_CORNERS -#endif - -/** - * SCARA cannot use SLOWDOWN and requires QUICKHOME - */ -#if IS_SCARA - #undef SLOWDOWN - #define QUICK_HOME -#endif - -/** - * Set the home position based on settings or manual overrides - */ -#ifdef MANUAL_X_HOME_POS - #define X_HOME_POS MANUAL_X_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define X_HOME_POS 0 - #else - #define X_HOME_POS ((X_BED_SIZE) * (X_HOME_DIR) * 0.5) - #endif -#else - #if ENABLED(DELTA) - #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) - #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Y_HOME_POS - #define Y_HOME_POS MANUAL_Y_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define Y_HOME_POS 0 - #else - #define Y_HOME_POS ((Y_BED_SIZE) * (Y_HOME_DIR) * 0.5) - #endif -#else - #if ENABLED(DELTA) - #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 0.5) - #else - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Z_HOME_POS - #define Z_HOME_POS MANUAL_Z_HOME_POS -#else - #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS) -#endif - -/** - * If DELTA_HEIGHT isn't defined use the old setting - */ -#if ENABLED(DELTA) && !defined(DELTA_HEIGHT) - #define DELTA_HEIGHT Z_HOME_POS -#endif - -/** - * Z Sled Probe requires Z_SAFE_HOMING - */ -#if ENABLED(Z_PROBE_SLED) - #define Z_SAFE_HOMING -#endif - -/** - * DELTA should ignore Z_SAFE_HOMING and SLOWDOWN - */ -#if ENABLED(DELTA) - #undef Z_SAFE_HOMING - #undef SLOWDOWN -#endif - -/** - * Safe Homing Options - */ -#if ENABLED(Z_SAFE_HOMING) - #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT X_CENTER - #endif - #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT Y_CENTER - #endif - #define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT - #define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT -#else - #define X_TILT_FULCRUM X_HOME_POS - #define Y_TILT_FULCRUM Y_HOME_POS -#endif - -/** - * Host keep alive - */ -#ifndef DEFAULT_KEEPALIVE_INTERVAL - #define DEFAULT_KEEPALIVE_INTERVAL 2 -#endif - -/** - * Provide a MAX_AUTORETRACT for older configs - */ -#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT) - #define MAX_AUTORETRACT 99 -#endif - -// MS1 MS2 Stepper Driver Microstepping mode table -#define MICROSTEP1 LOW,LOW -#if ENABLED(HEROIC_STEPPER_DRIVERS) - #define MICROSTEP128 LOW,HIGH -#else - #define MICROSTEP2 HIGH,LOW - #define MICROSTEP4 LOW,HIGH -#endif -#define MICROSTEP8 HIGH,HIGH -#define MICROSTEP16 HIGH,HIGH - -/** - * Override here because this is set in Configuration_adv.h - */ -#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #undef SD_DETECT_INVERTED -#endif - -/** - * Set defaults for missing (newer) options - */ -#ifndef DISABLE_INACTIVE_X - #define DISABLE_INACTIVE_X DISABLE_X -#endif -#ifndef DISABLE_INACTIVE_Y - #define DISABLE_INACTIVE_Y DISABLE_Y -#endif -#ifndef DISABLE_INACTIVE_Z - #define DISABLE_INACTIVE_Z DISABLE_Z -#endif -#ifndef DISABLE_INACTIVE_E - #define DISABLE_INACTIVE_E DISABLE_E -#endif - -// Power Signal Control Definitions -// By default use ATX definition -#ifndef POWER_SUPPLY - #define POWER_SUPPLY 1 -#endif -#if (POWER_SUPPLY == 1) // 1 = ATX - #define PS_ON_AWAKE LOW - #define PS_ON_ASLEEP HIGH -#elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W - #define PS_ON_AWAKE HIGH - #define PS_ON_ASLEEP LOW -#endif -#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON)) - -/** - * Temp Sensor defines - */ -#if TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 -#elif TEMP_SENSOR_0 == -3 - #define HEATER_0_USES_MAX6675 - #define MAX6675_IS_MAX31855 - #define MAX6675_TMIN -270 - #define MAX6675_TMAX 1800 -#elif TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 - #define MAX6675_TMIN 0 - #define MAX6675_TMAX 1024 -#elif TEMP_SENSOR_0 == -1 - #define HEATER_0_USES_AD595 -#elif TEMP_SENSOR_0 == 0 - #undef HEATER_0_MINTEMP - #undef HEATER_0_MAXTEMP -#elif TEMP_SENSOR_0 > 0 - #define THERMISTORHEATER_0 TEMP_SENSOR_0 - #define HEATER_0_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 -#elif TEMP_SENSOR_1 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1." -#elif TEMP_SENSOR_1 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_1." -#elif TEMP_SENSOR_1 == -1 - #define HEATER_1_USES_AD595 -#elif TEMP_SENSOR_1 == 0 - #undef HEATER_1_MINTEMP - #undef HEATER_1_MAXTEMP -#elif TEMP_SENSOR_1 > 0 - #define THERMISTORHEATER_1 TEMP_SENSOR_1 - #define HEATER_1_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_2 == -4 - #define HEATER_2_USES_AD8495 -#elif TEMP_SENSOR_2 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -1 - #define HEATER_2_USES_AD595 -#elif TEMP_SENSOR_2 == 0 - #undef HEATER_2_MINTEMP - #undef HEATER_2_MAXTEMP -#elif TEMP_SENSOR_2 > 0 - #define THERMISTORHEATER_2 TEMP_SENSOR_2 - #define HEATER_2_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_3 == -4 - #define HEATER_3_USES_AD8495 -#elif TEMP_SENSOR_3 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -1 - #define HEATER_3_USES_AD595 -#elif TEMP_SENSOR_3 == 0 - #undef HEATER_3_MINTEMP - #undef HEATER_3_MAXTEMP -#elif TEMP_SENSOR_3 > 0 - #define THERMISTORHEATER_3 TEMP_SENSOR_3 - #define HEATER_3_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_4 == -4 - #define HEATER_4_USES_AD8495 -#elif TEMP_SENSOR_4 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 -#elif TEMP_SENSOR_4 == 0 - #undef HEATER_4_MINTEMP - #undef HEATER_4_MAXTEMP -#elif TEMP_SENSOR_4 > 0 - #define THERMISTORHEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 -#elif TEMP_SENSOR_BED == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -1 - #define HEATER_BED_USES_AD595 -#elif TEMP_SENSOR_BED == 0 - #undef BED_MINTEMP - #undef BED_MAXTEMP -#elif TEMP_SENSOR_BED > 0 - #define THERMISTORBED TEMP_SENSOR_BED - #define HEATER_BED_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 -#elif TEMP_SENSOR_CHAMBER == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 -#elif TEMP_SENSOR_CHAMBER > 0 - #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR -#endif - -#define HOTEND_USES_THERMISTOR (ENABLED(HEATER_0_USES_THERMISTOR) || ENABLED(HEATER_1_USES_THERMISTOR) || ENABLED(HEATER_2_USES_THERMISTOR) || ENABLED(HEATER_3_USES_THERMISTOR) || ENABLED(HEATER_4_USES_THERMISTOR)) - -/** - * Default hotend offsets, if not defined - */ -#define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER))) -#if HOTENDS > 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif - #if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z) - #define HOTEND_OFFSET_Z { 0 } - #endif -#endif - -/** - * ARRAY_BY_EXTRUDERS based on EXTRUDERS - */ -#define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_ARGS__) -#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1) - -/** - * ARRAY_BY_HOTENDS based on HOTENDS - */ -#define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) - -/** - * Driver Timings - * NOTE: Driver timing order is longest-to-shortest duration. - * Preserve this ordering when adding new drivers. - */ -#ifndef MINIMUM_STEPPER_DIR_DELAY - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_DIR_DELAY 15000 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_DIR_DELAY 1500 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_DIR_DELAY 650 - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_DIR_DELAY 500 - #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_DIR_DELAY 200 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_DIR_DELAY 20 - #else - #define MINIMUM_STEPPER_DIR_DELAY 200 // Expect at least 10µS since one Stepper ISR must transpire - #endif -#endif - -#ifndef MINIMUM_STEPPER_PULSE - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_PULSE 30 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_PULSE 3 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_PULSE 2 - #elif HAS_DRIVER(A4988) || HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_PULSE 1 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_PULSE 0 - #else - #define MINIMUM_STEPPER_PULSE 1 - #endif -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if HAS_DRIVER(TB6560) - #define MAXIMUM_STEPPER_RATE 15000 - #elif HAS_DRIVER(LV8729) - #define MAXIMUM_STEPPER_RATE 130000 - #elif HAS_DRIVER(TB6600) - #define MAXIMUM_STEPPER_RATE 150000 - #elif HAS_DRIVER(DRV8825) - #define MAXIMUM_STEPPER_RATE 250000 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MAXIMUM_STEPPER_RATE 400000 - #elif HAS_DRIVER(A4988) - #define MAXIMUM_STEPPER_RATE 500000 - #else - #define MAXIMUM_STEPPER_RATE 500000 - #endif -#endif - -/** - * X_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(X_DUAL_ENDSTOPS) - #if X_HOME_DIR > 0 - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MAX_PIN - #else - #define X2_MAX_ENDSTOP_INVERTING false - #endif - #define X2_MIN_ENDSTOP_INVERTING false - #else - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MAX_PIN - #else - #define X2_MIN_ENDSTOP_INVERTING false - #endif - #define X2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the X2 endstop? -#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) - -/** - * Y_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Y_DUAL_ENDSTOPS) - #if Y_HOME_DIR > 0 - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MAX_PIN - #else - #define Y2_MAX_ENDSTOP_INVERTING false - #endif - #define Y2_MIN_ENDSTOP_INVERTING false - #else - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MAX_PIN - #else - #define Y2_MIN_ENDSTOP_INVERTING false - #endif - #define Y2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Y2 endstop or the bed probe? -#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) - -/** - * Z_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Z_DUAL_ENDSTOPS) - #if Z_HOME_DIR > 0 - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MAX_PIN - #else - #define Z2_MAX_ENDSTOP_INVERTING false - #endif - #define Z2_MIN_ENDSTOP_INVERTING false - #else - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MAX_PIN - #else - #define Z2_MIN_ENDSTOP_INVERTING false - #endif - #define Z2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Z2 endstop or the bed probe? -#define IS_Z2_OR_PROBE(A,M) ( \ - (ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) \ - || (ENABLED(Z_MIN_PROBE_ENDSTOP) && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) - -/** - * Set ENDSTOPPULLUPS for active endstop switches - */ -#if ENABLED(ENDSTOPPULLUPS) - #if ENABLED(USE_XMAX_PLUG) - #define ENDSTOPPULLUP_XMAX - #endif - #if ENABLED(USE_YMAX_PLUG) - #define ENDSTOPPULLUP_YMAX - #endif - #if ENABLED(USE_ZMAX_PLUG) - #define ENDSTOPPULLUP_ZMAX - #endif - #if ENABLED(USE_XMIN_PLUG) - #define ENDSTOPPULLUP_XMIN - #endif - #if ENABLED(USE_YMIN_PLUG) - #define ENDSTOPPULLUP_YMIN - #endif - #if ENABLED(USE_ZMIN_PLUG) - #define ENDSTOPPULLUP_ZMIN - #endif -#endif - -/** - * Shorthand for pin tests, used wherever needed - */ - -// Steppers -#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) -#define HAS_X_DIR (PIN_EXISTS(X_DIR)) -#define HAS_X_STEP (PIN_EXISTS(X_STEP)) -#define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) - -#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) -#define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) -#define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) -#define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1)) - -#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) -#define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) -#define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) -#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) - -#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) -#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) -#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) -#define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1)) - -#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) -#define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) -#define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) -#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) - -#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) -#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) -#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) -#define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1)) - -// Extruder steppers and solenoids -#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) -#define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) -#define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) -#define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) -#define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) - -#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) -#define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) -#define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) -#define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) -#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) - -#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) -#define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) -#define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) -#define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) -#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) - -#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) -#define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) -#define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) -#define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) -#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) - -#define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) -#define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) -#define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) -#define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) -#define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) - -// Trinamic Stepper Drivers -#define HAS_STEALTHCHOP (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) -#define HAS_STALLGUARD HAS_DRIVER(TMC2130) -#define AXIS_HAS_STEALTHCHOP(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2208) ) -#define AXIS_HAS_STALLGUARD(ST) AXIS_DRIVER_TYPE(ST, TMC2130) - -#if ENABLED(SENSORLESS_HOMING) - // Disable Z axis sensorless homing if a probe is used to home the Z axis - #if HOMING_Z_WITH_PROBE - #undef Z_HOMING_SENSITIVITY - #endif - #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_HOMING_SENSITIVITY)) - #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_HOMING_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_HOMING_SENSITIVITY)) -#endif - -// Endstops and bed probe -#define HAS_STOP_TEST(A,M) (PIN_EXISTS(A##_##M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_OR_PROBE(A,M)) -#define HAS_X_MIN HAS_STOP_TEST(X,MIN) -#define HAS_X_MAX HAS_STOP_TEST(X,MAX) -#define HAS_Y_MIN HAS_STOP_TEST(Y,MIN) -#define HAS_Y_MAX HAS_STOP_TEST(Y,MAX) -#define HAS_Z_MIN HAS_STOP_TEST(Z,MIN) -#define HAS_Z_MAX HAS_STOP_TEST(Z,MAX) -#define HAS_X2_MIN (PIN_EXISTS(X2_MIN)) -#define HAS_X2_MAX (PIN_EXISTS(X2_MAX)) -#define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN)) -#define HAS_Y2_MAX (PIN_EXISTS(Y2_MAX)) -#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) -#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) -#define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE)) - -// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) -#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) -#define HAS_TEMP_ADC_0 HAS_ADC_TEST(0) -#define HAS_TEMP_ADC_1 HAS_ADC_TEST(1) -#define HAS_TEMP_ADC_2 HAS_ADC_TEST(2) -#define HAS_TEMP_ADC_3 HAS_ADC_TEST(3) -#define HAS_TEMP_ADC_4 HAS_ADC_TEST(4) -#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) -#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) - -#define HAS_TEMP_HOTEND (HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675)) -#define HAS_TEMP_BED HAS_TEMP_ADC_BED -#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER - -// Heaters -#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) -#define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) -#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2)) -#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) -#define HAS_HEATER_4 (PIN_EXISTS(HEATER_4)) -#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) - -// 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) - -// PID heating -#if !HAS_HEATED_BED - #undef PIDTEMPBED -#endif -#define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)) -#define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) - -// Thermal protection -#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED)) -#define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) -#define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) - -// Auto fans -#define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) -#define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) -#define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) -#define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) -#define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) -#define HAS_AUTO_CHAMBER_FAN (PIN_EXISTS(CHAMBER_AUTO_FAN)) -#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_CHAMBER_FAN) -#define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_0 (E3_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_3_IS_1 (E3_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_2 (E3_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_0 (E4_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_0 (CHAMBER_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_1 (CHAMBER_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_2 (CHAMBER_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_3 (CHAMBER_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_4 (CHAMBER_AUTO_FAN_PIN == E4_AUTO_FAN_PIN) - -// Other fans -#define HAS_FAN0 (PIN_EXISTS(FAN)) -#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN) -#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN) -#define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) - -// Servos -#define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) -#define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) -#define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) -#define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) -#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0 && (HAS_SERVO_0 || HAS_SERVO_1 || HAS_SERVO_2 || HAS_SERVO_3)) - -#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR -1 -#endif - -// Sensors -#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) - -// User Interface -#define HAS_HOME (PIN_EXISTS(HOME)) -#define HAS_KILL (PIN_EXISTS(KILL)) -#define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) -#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH)) -#define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) -#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) - -// Digital control -#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS) -#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) -#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) - -#if !HAS_TEMP_SENSOR - #undef AUTO_REPORT_TEMPERATURES -#endif - -#define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS)) - -/** - * This setting is also used by M109 when trying to calculate - * a ballpark safe margin to prevent wait-forever situation. - */ -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif - -/** - * Helper Macros for heaters and extruder fan - */ -#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v) -#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v) - #if HOTENDS > 2 - #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v) - #if HOTENDS > 3 - #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v) - #if HOTENDS > 4 - #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#endif // HOTENDS > 1 -#if ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } -#else - #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) -#endif - -/** - * Heated bed requires settings - */ -#if HAS_HEATED_BED - #ifndef MAX_BED_POWER - #define MAX_BED_POWER 255 - #endif - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING false - #endif - #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) -#endif - -/** - * Up to 3 PWM fans - */ -#if HAS_FAN2 - #define FAN_COUNT 3 -#elif HAS_FAN1 - #define FAN_COUNT 2 -#elif HAS_FAN0 - #define FAN_COUNT 1 -#else - #define FAN_COUNT 0 -#endif - -#if HAS_FAN0 - #define WRITE_FAN(v) WRITE(FAN_PIN, v) - #define WRITE_FAN0(v) WRITE_FAN(v) -#endif -#if HAS_FAN1 - #define WRITE_FAN1(v) WRITE(FAN1_PIN, v) -#endif -#if HAS_FAN2 - #define WRITE_FAN2(v) WRITE(FAN2_PIN, v) -#endif -#define WRITE_FAN_N(n, v) WRITE_FAN##n(v) - -/** - * Part Cooling fan multipliexer - */ -#define HAS_FANMUX PIN_EXISTS(FANMUX0) - -/** - * MIN/MAX fan PWM scaling - */ -#ifndef FAN_MIN_PWM - #define FAN_MIN_PWM 0 -#endif -#ifndef FAN_MAX_PWM - #define FAN_MAX_PWM 255 -#endif -#if FAN_MIN_PWM < 0 || FAN_MIN_PWM > 255 - #error "FAN_MIN_PWM must be a value from 0 to 255." -#elif FAN_MAX_PWM < 0 || FAN_MAX_PWM > 255 - #error "FAN_MAX_PWM must be a value from 0 to 255." -#elif FAN_MIN_PWM > FAN_MAX_PWM - #error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM." -#endif - -/** - * Bed Probe dependencies - */ -#if HAS_BED_PROBE - #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN - #define ENDSTOPPULLUP_ZMIN_PROBE - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MIN - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MAX - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif - #ifndef XY_PROBE_SPEED - #ifdef HOMING_FEEDRATE_XY - #define XY_PROBE_SPEED HOMING_FEEDRATE_XY - #else - #define XY_PROBE_SPEED 4000 - #endif - #endif -#else - #undef X_PROBE_OFFSET_FROM_EXTRUDER - #undef Y_PROBE_OFFSET_FROM_EXTRUDER - #undef Z_PROBE_OFFSET_FROM_EXTRUDER - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 -#endif - -/** - * XYZ Bed Skew Correction - */ -#if ENABLED(SKEW_CORRECTION) - #define SKEW_FACTOR_MIN -1 - #define SKEW_FACTOR_MAX 1 - - #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) - #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) - #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) - - #ifndef XY_SKEW_FACTOR - constexpr float XY_SKEW_FACTOR = ( - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - 0.0 - #endif - ); - #endif - #ifndef XZ_SKEW_FACTOR - #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) - #define XZ_SIDE_AD XY_SIDE_AD - #endif - constexpr float XZ_SKEW_FACTOR = ( - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - 0.0 - #endif - ); - #endif - #ifndef YZ_SKEW_FACTOR - constexpr float YZ_SKEW_FACTOR = ( - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - 0.0 - #endif - ); - #endif -#endif // SKEW_CORRECTION - -/** - * Set granular options based on the specific type of leveling - */ -#define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA))) -#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)) -#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) -#define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID) -#define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL)) -#define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING)) -#define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY)) -#define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)) -#define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION)) -#define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) -#define HAS_UBL_AND_CURVES (ENABLED(AUTO_BED_LEVELING_UBL) && !PLANNER_LEVELING && (ENABLED(ARC_SUPPORT) || ENABLED(BEZIER_CURVE_SUPPORT))) -#define HAS_FEEDRATE_SCALING (ENABLED(SCARA_FEEDRATE_SCALING) || ENABLED(DELTA_FEEDRATE_SCALING)) - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #undef LCD_BED_LEVELING -#endif - -/** - * Heater & Fan Pausing - */ -#if FAN_COUNT == 0 - #undef PROBING_FANS_OFF -#endif -#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) -#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF)) - -#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH) - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 -#endif - -/** - * Only constrain Z on DELTA / SCARA machines - */ -#if IS_KINEMATIC - #undef MIN_SOFTWARE_ENDSTOP_X - #undef MIN_SOFTWARE_ENDSTOP_Y - #undef MAX_SOFTWARE_ENDSTOP_X - #undef MAX_SOFTWARE_ENDSTOP_Y -#endif - -/** - * 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 - -#if ENABLED(DELTA) - /** - * Delta radius/rod trimmers/angle trimmers - */ - #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 - MAX3(abs(X_PROBE_OFFSET_FROM_EXTRUDER), abs(Y_PROBE_OFFSET_FROM_EXTRUDER), abs(MIN_PROBE_EDGE))) - #else - #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS - #endif - #endif - #ifndef DELTA_ENDSTOP_ADJ - #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } - #endif - #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0} - #endif - #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} - #endif - #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #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) - -#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)) - -#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 ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) - #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!") - // so that may be added to SanityCheck.h in the future. - #define _MESH_MIN_X (X_MIN_BED + MESH_INSET) - #define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET) - #define _MESH_MAX_X (X_MAX_BED - (MESH_INSET)) - #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) - #else - // Boundaries for Cartesian probing based on set limits - #if ENABLED(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_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)) - #endif - #endif - - // These may be overridden in Configuration.h if a smaller area is desired - #ifndef MESH_MIN_X - #define MESH_MIN_X _MESH_MIN_X - #endif - #ifndef MESH_MIN_Y - #define MESH_MIN_Y _MESH_MIN_Y - #endif - #ifndef MESH_MAX_X - #define MESH_MAX_X _MESH_MAX_X - #endif - #ifndef MESH_MAX_Y - #define MESH_MAX_Y _MESH_MAX_Y - #endif - -#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT) - #if IS_KINEMATIC - #define SIN0 0.0 - #define SIN120 0.866025 - #define SIN240 -0.866025 - #define COS0 1.0 - #define COS120 -0.5 - #define COS240 -0.5 - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X (X_CENTER + (_PROBE_RADIUS) * COS0) - #endif - #ifndef PROBE_PT_1_Y - #define PROBE_PT_1_Y (Y_CENTER + (_PROBE_RADIUS) * SIN0) - #endif - #ifndef PROBE_PT_2_X - #define PROBE_PT_2_X (X_CENTER + (_PROBE_RADIUS) * COS120) - #endif - #ifndef PROBE_PT_2_Y - #define PROBE_PT_2_Y (Y_CENTER + (_PROBE_RADIUS) * SIN120) - #endif - #ifndef PROBE_PT_3_X - #define PROBE_PT_3_X (X_CENTER + (_PROBE_RADIUS) * COS240) - #endif - #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 ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(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 - -/** - * Buzzer/Speaker - */ -#if ENABLED(LCD_USE_I2C_BUZZER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 1000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 - #endif -#else - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 5000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 - #endif -#endif - -/** - * VIKI2, miniVIKI, AZSMZ_12864, and MKS_12864OLED_SSD1306 require DOGLCD_SCK and DOGLCD_MOSI to be defined. - */ -#if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) || ENABLED(MKS_12864OLED_SSD1306) - #ifndef DOGLCD_SCK - #define DOGLCD_SCK SCK_PIN - #endif - #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI MOSI_PIN - #endif -#endif - -/** - * Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES - */ -#ifndef Z_HOMING_HEIGHT - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_HOMING_HEIGHT 0 - #else - #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -#if PROBE_SELECTED - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT - #endif - #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT - #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #else - #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT - #endif - #ifndef Z_CLEARANCE_MULTI_PROBE - #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -// Updated G92 behavior shifts the workspace -#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS) -// The home offset also shifts the coordinate space -#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA)) -// Either offset yields extra calculations on all moves -#define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET) -// M206 doesn't apply to DELTA -#define HAS_M206_COMMAND (HAS_HOME_OFFSET && DISABLED(DELTA)) - -// LCD timeout to status screen default is 15s -#ifndef LCD_TIMEOUT_TO_STATUS - #define LCD_TIMEOUT_TO_STATUS 15000 -#endif - -// Shorthand -#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) - -// Add commands that need sub-codes to this list -#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY) - -// Parking Extruder -#if ENABLED(PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_GRAB_DISTANCE - #define PARKING_EXTRUDER_GRAB_DISTANCE 0 - #endif - #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH - #endif -#endif - -// Number of VFAT entries used. Each entry has 13 UTF-16 characters -#if ENABLED(SCROLL_LONG_FILENAMES) - #define MAX_VFAT_ENTRIES (5) -#else - #define MAX_VFAT_ENTRIES (2) -#endif - -// Set defaults for unspecified LED user colors -#if ENABLED(LED_CONTROL_MENU) - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 255 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 255 - #endif - #ifndef LED_USER_PRESET_WHITE - #define LED_USER_PRESET_WHITE 0 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #ifdef NEOPIXEL_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS - #else - #define LED_USER_PRESET_BRIGHTNESS 255 - #endif - #endif -#endif - -// Nozzle park -#if ENABLED(NOZZLE_PARK_FEATURE) && ENABLED(DELTA) - #undef NOZZLE_PARK_Z_FEEDRATE - #define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE -#endif - -#if ENABLED(SDCARD_SORT_ALPHA) - #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) -#endif - -#endif // CONDITIONALS_POST_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h deleted file mode 100644 index 3fa8c91a64..0000000000 --- a/Marlin/Configuration.h +++ /dev/null @@ -1,1944 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * 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 - * - */ -#ifndef CONFIGURATION_H -#define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 - -//=========================================================================== -//============================= 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 -// example_configurations/delta directory and customize for your machine. -// - -//=========================================================================== -//============================= SCARA Printer =============================== -//=========================================================================== -// For a SCARA printer start with the configuration files in -// example_configurations/SCARA and customize for your machine. -// - -// @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 "(eryone, thinker2560 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 *** - * - * 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. - */ - -// Enable to 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. -//#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. - * Serial port 0 is always used by the Arduino bootloader regardless of this setting. - * - * :[0, 1, 2, 3, 4, 5, 6, 7] - */ -#define SERIAL_PORT 0 - -/** - * 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 - -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setups -#ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMBO//BOARD_RAMPS_14_EFB -#endif - -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message -//#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) -//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" - -// @section extruder - -// This defines the number of extruders -// :[1, 2, 3, 4, 5] -#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 steppers - //#define E_MUX2_PIN 44 // Needed for 5 to 8 steppers -#endif - -// 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 of the nozzles -//#define SWITCHING_NOZZLE -#if ENABLED(SWITCHING_NOZZLE) - #define SWITCHING_NOZZLE_SERVO_NR 0 - #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 - //#define HOTEND_OFFSET_Z { 0.0, 0.0 } -#endif - -/** - * Two separate X-carriages with extruders that connect to a moving part - * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. - */ -//#define PARKING_EXTRUDER -#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 // Delay (ms) for magnetic field. No delay if 0 or not defined. - #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders - #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder - #define PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking - #define HOTEND_OFFSET_Z { 0.0, 1.3 } // Z-offsets of the two hotends. The first must be 0. -#endif - -/** - * "Mixing Extruder" - * - Adds a new code, M165, to set the current mix factors. - * - Extends the stepping routines to move multiple steppers in proportion to the mix. - * - Optional support for Repetier Firmware M163, M164, and virtual extruder. - * - This implementation supports only a single extruder. - * - Enable DIRECT_MIXING_IN_G1 for 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 -#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} // (in mm) for each extruder, offset of the hotend on the X axis -//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis - -// @section machine - -/** - * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN - * - * 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' } - */ -#define POWER_SUPPLY 0 - -#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 - - //#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 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) - * 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 - * 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 - * 20 : the PT100 circuit found in the Ultimainboard V2.x - * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 - * 66 : 4.7M High Temperature thermistor from Dyze Design - * 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) - * - * 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", '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'", '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", '66':"Dyze Design 4.7M 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" } - */ -#define TEMP_SENSOR_0 13 -#define TEMP_SENSOR_1 0 -#define TEMP_SENSOR_2 0 -#define TEMP_SENSOR_3 0 -#define TEMP_SENSOR_4 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 - -// Extruder temperature must be close to target for this long before M109 returns success -#define TEMP_RESIDENCY_TIME 10 // (seconds) -#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one -#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. - -// Bed temperature must be close to target for this long before M190 returns success -#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) -#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one -#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. - -// The minimal temperature defines the temperature below which the heater will not be enabled It is used -// to check that the wiring to the thermistor is not broken. -// Otherwise this would lead to the heater being powered on all the time. -#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 BED_MINTEMP 5 - -// When temperature exceeds max temp, your heater will be switched off. -// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! -// You should 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 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_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. - //#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 - - // Ultimaker - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 - - // 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 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 100.00 - #define DEFAULT_bedKi 5.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 - - // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. -#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 - -//=========================================================================== -//============================= 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 - -// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -#define X_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. -#define Y_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. -#define Z_MIN_ENDSTOP_INVERTING true//false // 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. -#define Z_MIN_PROBE_ENDSTOP_INVERTING true//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, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE TMC2208 -//#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 E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_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 Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - -//============================================================================= -//============================== 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]]]] - */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } //{ 80, 80, 400, 93 } - -/** - * Default Max Feed Rate (mm/s) - * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] - */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 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]]]] - */ -#define DEFAULT_MAX_ACCELERATION { 1500, 1500, 50, 1500 } - -/** - * Default Acceleration (change/s) change = mm/s - * Override with M204 - * - * M204 P Acceleration - * M204 R Retract Acceleration - * M204 T Travel Acceleration - */ -#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves - -/** - * 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. - */ -#define DEFAULT_XJERK 20.0 -#define DEFAULT_YJERK 20.0 -#define DEFAULT_ZJERK 0.4 -#define DEFAULT_EJERK 5.0 - -/** - * 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_ENDSTOP - * - * Enable this option for a probe connected to any pin except Z-Min. - * (By default Marlin assumes the Z-Max endstop pin.) - * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. - * - * - 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. - * - * WARNING: Setting the wrong pin may have unexpected and potentially - * disastrous consequences. Use with caution and do your homework. - * - */ -//#define Z_MIN_PROBE_ENDSTOP - -/** - * 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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) - //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - -#else -// power lose detect pin and super capacitor for save data - #define POWER_LOSS_RECOVER_SUPER_CAP 1 - -#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 DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors - -// 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. - -// -// For Z_PROBE_ALLEN_KEY see the Delta example configurations. -// - -/** - * 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 - * - * +-- BACK ---+ - * | | - * L | (+) P | R <-- probe (20,20) - * E | | I - * F | (-) N (+) | G <-- nozzle (10,10) - * T | | H - * | (-) | T - * | | - * O-- FRONT --+ - * (0,0) - */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 35 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0//10 // Y offset: -front +behind [the nozzle] -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) - -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.3 // Z offset: -below +above [the nozzle] //luojin -#else -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] //luojin - -#endif -// 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) - -// The number of probes to perform at each point. -// Set to 2 for a fast/slow probe, using the second probe result. -// Set to 3 or more for slow probes, averaging the results. -//#define MULTIPLE_PROBING 2 - -/** - * 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 Z_PROBE_OFFSET_FROM_EXTRUDER, 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 - -#if POWER_LOSS_RECOVER_SUPER_CAP -#define Z_CLEARANCE_BETWEEN_PROBES 0 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 0 // Z Clearance between multiple probes -#else -#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -#endif -//#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 - -// 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 true // 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 false - -// @section extruder - -// For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR true -#define INVERT_E1_DIR false -#define INVERT_E2_DIR false -#define INVERT_E3_DIR false -#define INVERT_E4_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 4 // (in 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 - -// The size of the print bed -#define X_BED_SIZE 300 -#define Y_BED_SIZE 300 - -// 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 400 - -/** - * 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 ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(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 false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. - #define FILAMENT_RUNOUT_SCRIPT "M600" -#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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) -#define AUTO_BED_LEVELING_BILINEAR -#endif -//#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 ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(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.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. - #endif - -#endif - -#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) - - // Set the number of grid points per dimension. - #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 - - #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 - -/** - * 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 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. - */ -//#define LCD_BED_LEVELING - -#if ENABLED(LCD_BED_LEVELING) - #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. - #define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment -#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_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). -#endif - -// Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z (4*60) - -// @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 -// -// The microcontroller can store settings in the EEPROM, e.g. max velocity... -// M500 - stores parameters in EEPROM -// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. -// -#define EEPROM_SETTINGS // Enable for M500 and M501 commands -//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. - -// -// 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_TEMP_HOTEND 180 -#define PREHEAT_1_TEMP_BED 70 -#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 - -#define PREHEAT_2_TEMP_HOTEND 240 -#define PREHEAT_2_TEMP_BED 110 -#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 } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (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 - - // Moves the nozzle to the initial position - #define NOZZLE_CLEAN_GOBACK -#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, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test - * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'kana':'Japanese', 'kana_utf8':'Japanese (UTF8)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'pt-br_utf8':'Portuguese (Brazilian UTF8)', 'pt_utf8':'Portuguese (UTF8)', 'ru':'Russian', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', '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 - -/** - * 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 - -/** - * 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 - -// -// 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 2 -//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 - -//============================================================================= -//======================== 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 - -// -// ULTIMAKER Controller. -// -//#define ULTIMAKERCONTROLLER - -// -// ULTIPANEL as seen on Thingiverse. -// -//#define ULTIPANEL -//#define NEWPANEL -// -// 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 - -//============================================================================= -//======================= 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 - -// -// 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 -// http://reprap.org/wiki/MKS_MINI_12864 -// -//#define MKS_MINI_12864 - -// -// 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 -// -//#define ANET_FULL_GRAPHICS_LCD // 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). - -// -// 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 - -// -// Silvergate GLCD controller -// http://github.com/android444/Silvergate -// -//#define SILVER_GATE_GLCD_CONTROLLER - -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - -//============================================================================= -//=============================== 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. -#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 - -// M240 Triggers a camera by emulating a Canon RC-1 Remote -// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ -//#define PHOTOGRAPH_PIN 23 - -// 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 - -/** - * 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 ENABLED(RGB_LED) || ENABLED(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 on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip - #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 -#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 ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(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. - */ - -#if ENABLED(BLTOUCH) - -#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. -// 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 } -#endif -// Servo deactivation -// -// With this option servos are powered only during movement, then turned off to prevent jitter. -//#define DEACTIVATE_SERVOS_AFTER_MOVE - -#endif // CONFIGURATION_H diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h deleted file mode 100644 index cb17959095..0000000000 --- a/Marlin/Configuration_adv.h +++ /dev/null @@ -1,1651 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Configuration_adv.h - * - * Advanced settings. - * Only change these if you know exactly what you're doing. - * Some of these settings can damage your printer if improperly set! - * - * Basic settings can be found in Configuration.h - * - */ -#ifndef CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 - -// @section temperature - -//=========================================================================== -//=============================Thermal Settings ============================ -//=========================================================================== - -// -// 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 - -#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 40 // Seconds - #define THERMAL_PROTECTION_HYSTERESIS 8 // Degrees Celsius - - /** - * 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 40 // 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 - -#if ENABLED(PIDTEMP) - // this adds an experimental additional term to the heating power, proportional to the extrusion speed. - // if Kc is chosen well, the additional required power due to increased melting should be compensated. - //#define PID_EXTRUSION_SCALING - #if ENABLED(PID_EXTRUSION_SCALING) - #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) - #define LPQ_MAX_LEN 50 - #endif -#endif - -/** - * Automatic Temperature: - * The hotend target temperature is calculated by all the buffered lines of gcode. - * The maximum buffered steps/sec of the extruder motor is called "se". - * Start autotemp mode with M109 S 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 in M114 -//#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 -#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 - -// @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 CHAMBER_AUTO_FAN_PIN -1 -#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 -#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - -/** - * 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 MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#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 - -//=========================================================================== -//============================ Mechanical Settings ========================== -//=========================================================================== - -// @section homing - -// If you want endstops to stay on (by default) even when not homing -// enable this option. Override at any time with M120, M121. -//#define ENDSTOPS_ALWAYS_ON_DEFAULT - -// @section extras - -//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. - -/** - * Dual 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 - -// Enable this for dual x-carriage printers. -// A dual x-carriage design has the advantage that the inactive extruder can be parked which -// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage -// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. -//#define DUAL_X_CARRIAGE -#if ENABLED(DUAL_X_CARRIAGE) - // Configuration for second X-carriage - // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; - // the second x-carriage always homes to the maximum endstop. - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage - #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed - #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position - #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. - - // There are a few selectable movement modes for dual x-carriages using M605 S - // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results - // as long as it supports dual x-carriages. (M605 S0) - // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so - // that additional slicer support is not required. (M605 S1) - // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all - // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at - // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) - - // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - - // Default x offset in duplication mode (typically set to half print bed width) - #define DEFAULT_DUPLICATION_X_OFFSET 100 - -#endif // DUAL_X_CARRIAGE - -// 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 { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) -//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially - -// 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 - -// @section machine - -#define AXIS_RELATIVE_MODES {false, false, false, false} - -// Allow duplication mode with a basic dual-nozzle extruder -//#define DUAL_NOZZLE_DUPLICATION_MODE - -// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. -#define INVERT_X_STEP_PIN false -#define INVERT_Y_STEP_PIN false -#define INVERT_Z_STEP_PIN false -#define INVERT_E_STEP_PIN false - -// Default stepper release if idle. Set to 0 to deactivate. -// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. -// Time can be set by M18 and M84. -#define DEFAULT_STEPPER_DEACTIVE_TIME 120 -#define DISABLE_INACTIVE_X true -#define DISABLE_INACTIVE_Y true -#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. -#define DISABLE_INACTIVE_E true - -#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate -#define DEFAULT_MINTRAVELFEEDRATE 0.0 - -//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated - -// @section lcd - -#if ENABLED(ULTIPANEL) - #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel - #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 - -// If defined the movements slow down when the look ahead buffer is only half full -#define SLOWDOWN - -// Frequency limit -// See nophead's blog for more info -// Not working O -//#define XY_FREQUENCY_LIMIT 15 - -// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end -// of the buffer and all stops. This should not be much greater than zero and should only be changed -// if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) - -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#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 - -// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. -#define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] - -/** - * @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, 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 - * 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 -// 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=========================== -//=========================================================================== - -#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value - -//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ -#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again - -// @section lcd - -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU - -// 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 ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#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 // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - -/** - * LED Control Menu - * Enable this feature to 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 // LED_CONTROL_MENU - -#if ENABLED(SDSUPPORT) - - // Some RAMPS and other boards don't detect when an SD card is inserted. You can work - // around this by connecting a push button or single throw switch to the pin defined - // as SD_DETECT_PIN in your board's pins definitions. - // This setting should be disabled unless you are using a push button, pulling the pin to ground. - // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). - #define SD_DETECT_INVERTED - - #define SD_FINISHED_STEPPERRELEASE true // 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 - - // Add an option in the menu to run all auto#.g files - //#define MENU_ADDAUTOSTART - - /** - * 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 - #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 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_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_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 - - /** - * This option allows you to abort SD printing when any endstop is triggered. - * This feature must be enabled with "M540 S1" or from the LCD menu. - * To have any effect, endstops must be enabled during SD printing. - */ - //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - - /** - * 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 - -#endif // SDSUPPORT - -/** - * 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 ENABLED(DOGLCD) - // 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 - - #if ENABLED(U8GLIB_ST7920) - /** - * 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. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - -#endif // DOGLCD - -// @section safety - -// The hardware watchdog should reset the microcontroller disabling all outputs, -// in case the firmware gets stuck and doesn't do temperature regulation. -#define USE_WATCHDOG - -#if ENABLED(USE_WATCHDOG) - // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. - // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. - // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. - //#define WATCHDOG_RESET_MANUAL -#endif - -// @section lcd - -/** - * Babystepping enables 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_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 BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping - #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen 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_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor -#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 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 - -#if ENABLED(MESH_BED_LEVELING) || ENABLED(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 - -// @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 N_ARC_CORRECTION 25 // Number of intertpolated 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.2 and G38.3 Probe Target -// Set MULTIPLE_PROBING if you want G38 to double touch -//#define G38_PROBE_TARGET -#if ENABLED(G38_PROBE_TARGET) - #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_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 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 - * 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_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 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 - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 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 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller -#else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer -#endif - -// @section serial - -// The ASCII buffer for serial input -#define MAX_CMD_SIZE 96 -#define BUFSIZE 4 - -// 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 - -#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 - -// @section extras - -/** - * 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 // ONLY PARTIALLY TESTED -#if ENABLED(FWRETRACT) - #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 RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZLIFT 0 // Default retract Z-lift - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) -#endif - -/** - * 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 - -/** - * 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 50 // (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. - - // 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) - - #define X_MAX_CURRENT 1000 // in mA - #define X_SENSE_RESISTOR 91 // in mOhms - #define X_MICROSTEPS 16 // number of microsteps - - #define X2_MAX_CURRENT 1000 - #define X2_SENSE_RESISTOR 91 - #define X2_MICROSTEPS 16 - - #define Y_MAX_CURRENT 1000 - #define Y_SENSE_RESISTOR 91 - #define Y_MICROSTEPS 16 - - #define Y2_MAX_CURRENT 1000 - #define Y2_SENSE_RESISTOR 91 - #define Y2_MICROSTEPS 16 - - #define Z_MAX_CURRENT 1000 - #define Z_SENSE_RESISTOR 91 - #define Z_MICROSTEPS 16 - - #define Z2_MAX_CURRENT 1000 - #define Z2_SENSE_RESISTOR 91 - #define Z2_MICROSTEPS 16 - - #define E0_MAX_CURRENT 1000 - #define E0_SENSE_RESISTOR 91 - #define E0_MICROSTEPS 16 - - #define E1_MAX_CURRENT 1000 - #define E1_SENSE_RESISTOR 91 - #define E1_MICROSTEPS 16 - - #define E2_MAX_CURRENT 1000 - #define E2_SENSE_RESISTOR 91 - #define E2_MICROSTEPS 16 - - #define E3_MAX_CURRENT 1000 - #define E3_SENSE_RESISTOR 91 - #define E3_MICROSTEPS 16 - - #define E4_MAX_CURRENT 1000 - #define E4_SENSE_RESISTOR 91 - #define E4_MICROSTEPS 16 - -#endif // TMC26X - -// @section tmc_smart - -/** - * To use TMC2130 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. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * - * 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. - * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). - */ -#if HAS_TRINAMIC - - #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 - #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current - #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 - - #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. - #define X_MICROSTEPS 16 // 0..256 - - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - - /** - * Use software SPI for TMC2130. - * 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 - - /** - * Use Trinamic's ultra quiet stepping mode. - * When disabled, Marlin will use spreadCycle stepping mode. - */ - #define STEALTHCHOP - - /** - * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, - * like overtemperature and short to ground. TMC2208 requires hardware serial. - * 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 S0/1 - 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 - - /** - * 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 needs to be enabled. - * 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 E0_HYBRID_THRESHOLD 30 - #define E1_HYBRID_THRESHOLD 30 - #define E2_HYBRID_THRESHOLD 30 - #define E3_HYBRID_THRESHOLD 30 - #define E4_HYBRID_THRESHOLD 30 - - /** - * Use stallGuard2 to sense an obstacle and trigger an endstop. - * You need to place a wire from the 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_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. - * Higher values make the system LESS sensitive. - * Lower value make the system MORE sensitive. - * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting - */ - //#define SENSORLESS_HOMING // TMC2130 only - - #if ENABLED(SENSORLESS_HOMING) - #define X_HOMING_SENSITIVITY 8 - #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 - #endif - - /** - * Enable M122 debugging command for TMC stepper drivers. - * M122 S0/1 will enable continous reporting. - */ - //#define TMC_DEBUG - - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - - /** - * 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/TMC2130Stepper - * https://github.com/teemuatlut/TMC2208Stepper - * - * Example: - * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ - * } - */ - #define TMC_ADV() { } - -#endif // TMC2130 || TMC2208 - -// @section L6470 - -/** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 - */ -#if HAS_DRIVER(L6470) - - #define X_MICROSTEPS 16 // number of microsteps - #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall - - #define X2_MICROSTEPS 16 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - - #define Y_MICROSTEPS 16 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - - #define Y2_MICROSTEPS 16 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - - #define Z_MICROSTEPS 16 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - - #define Z2_MICROSTEPS 16 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - - #define E0_MICROSTEPS 16 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - - #define E1_MICROSTEPS 16 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - - #define E2_MICROSTEPS 16 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - - #define E3_MICROSTEPS 16 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - - #define E4_MICROSTEPS 16 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - -#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 - -/** - * 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_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed - #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 // delay in milliseconds to allow the spindle/laser to come up to speed/power - #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction - - /** - * 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 - - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% -#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 - -/** - * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - */ -//#define PINS_DEBUGGING - -/** - * Auto-report temperatures with M155 S - */ -#define AUTO_REPORT_TEMPERATURES - -/** - * Include capabilities in M115 output - */ -#define EXTENDED_CAPABILITIES_REPORT - -/** - * 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 - -/** - * User-defined menu items that execute custom GCode - */ -//#define CUSTOM_USER_MENUS -#if ENABLED(CUSTOM_USER_MENUS) - #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 PLA" - #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) - - #define USER_DESC_3 "Preheat for ABS" - #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 - -/** - * Specify an action command to send to the host when the printer is killed. - * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. - * The host must be configured to handle the action command. - */ -//#define ACTION_ON_KILL "poweroff" - -/** - * Specify an action command to send to the host on pause and resume. - * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. - * The host must be configured to handle the action command. - */ -//#define ACTION_ON_PAUSE "pause" -//#define ACTION_ON_RESUME "resume" - -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - -/** - * 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/ - * - * Reilabuild 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 behaviour. - - #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 - -/** - * 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 - /** - * 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 behaviour is limited to Z axis only. -#endif - -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - -#endif // CONFIGURATION_ADV_H diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp deleted file mode 100644 index 8a3f951c8c..0000000000 --- a/Marlin/G26_Mesh_Validation_Tool.cpp +++ /dev/null @@ -1,920 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Marlin Firmware -- G26 - Mesh Validation Tool - */ - -#include "MarlinConfig.h" - -#if ENABLED(G26_MESH_VALIDATION) - - #include "Marlin.h" - #include "planner.h" - #include "stepper.h" - #include "temperature.h" - #include "ultralcd.h" - #include "parser.h" - #include "serial.h" - #include "bitmap_flags.h" - - #if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" - #elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" - #endif - - #define EXTRUSION_MULTIPLIER 1.0 - #define RETRACTION_MULTIPLIER 1.0 - #define PRIME_LENGTH 10.0 - #define OOZE_AMOUNT 0.3 - - #define INTERSECTION_CIRCLE_RADIUS 5 - #define CROSSHAIRS_SIZE 3 - - #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS - #error "CROSSHAIRS_SIZE must be less than INTERSECTION_CIRCLE_RADIUS." - #endif - - #define G26_OK false - #define G26_ERR true - - /** - * G26 Mesh Validation Tool - * - * G26 is a Mesh Validation Tool intended to provide support for the Marlin Unified Bed Leveling System. - * In order to fully utilize and benefit from the Marlin Unified Bed Leveling System an accurate Mesh must - * be defined. G29 is designed to allow the user to quickly validate the correctness of her Mesh. It will - * first heat the bed and nozzle. It will then print lines and circles along the Mesh Cell boundaries and - * the intersections of those lines (respectively). - * - * This action allows the user to immediately see where the Mesh is properly defined and where it needs to - * be edited. The command will generate the Mesh lines closest to the nozzle's starting position. Alternatively - * the user can specify the X and Y position of interest with command parameters. This allows the user to - * focus on a particular area of the Mesh where attention is needed. - * - * B # Bed Set the Bed Temperature. If not specified, a default of 60 C. will be assumed. - * - * C Current When searching for Mesh Intersection points to draw, use the current nozzle location - * as the base for any distance comparison. - * - * D Disable Disable the Unified Bed Leveling System. In the normal case the user is invoking this - * command to see how well a Mesh as been adjusted to match a print surface. In order to do - * this the Unified Bed Leveling System is turned on by the G26 command. The D parameter - * alters the command's normal behaviour and disables the Unified Bed Leveling System even if - * it is on. - * - * H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed. - * - * F # Filament Used to specify the diameter of the filament being used. If not specified - * 1.75mm filament is assumed. If you are not getting acceptable results by using the - * 'correct' numbers, you can scale this number up or down a little bit to change the amount - * of filament that is being extruded during the printing of the various lines on the bed. - * - * K Keep-On Keep the heaters turned on at the end of the command. - * - * L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used. - * - * O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This - * is over kill, but using this parameter will let you get the very first 'circle' perfect - * so you have a trophy to peel off of the bed and hang up to show how perfectly you have your - * Mesh calibrated. If not specified, a filament length of .3mm is assumed. - * - * P # Prime Prime the nozzle with specified length of filament. If this parameter is not - * given, no prime action will take place. If the parameter specifies an amount, that much - * will be purged before continuing. If no amount is specified the command will start - * purging filament until the user provides an LCD Click and then it will continue with - * printing the Mesh. You can carefully remove the spent filament with a needle nose - * pliers while holding the LCD Click wheel in a depressed state. If you do not have - * an LCD, you must specify a value if you use P. - * - * Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and - * un-retraction is at 1.2mm These numbers will be scaled by the specified amount - * - * R # Repeat Prints the number of patterns given as a parameter, starting at the current location. - * If a parameter isn't given, every point will be printed unless G26 is interrupted. - * This works the same way that the UBL G29 P4 R parameter works. - * - * NOTE: If you do not have an LCD, you -must- specify R. This is to ensure that you are - * aware that there's some risk associated with printing without the ability to abort in - * cases where mesh point Z value may be inaccurate. As above, if you do not include a - * parameter, every point will be printed. - * - * S # Nozzle Used to control the size of nozzle diameter. If not specified, a .4mm nozzle is assumed. - * - * U # Random Randomize the order that the circles are drawn on the bed. The search for the closest - * undrawn cicle is still done. But the distance to the location for each circle has a - * random number of the size specified added to it. Specifying S50 will give an interesting - * deviation from the normal behaviour on a 10 x 10 Mesh. - * - * X # X Coord. Specify the starting location of the drawing activity. - * - * Y # Y Coord. Specify the starting location of the drawing activity. - */ - - // External references - - extern Planner planner; - - // Private functions - - static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16]; - float g26_e_axis_feedrate = 0.025, - random_deviation = 0.0; - - static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched - // retracts/recovers won't result in a bad state. - - static float g26_extrusion_multiplier, - g26_retraction_multiplier, - g26_layer_height, - g26_prime_length, - g26_x_pos, g26_y_pos; - - static int16_t g26_bed_temp, - g26_hotend_temp; - - static int8_t g26_prime_flag; - - #if ENABLED(ULTIPANEL) - - /** - * If the LCD is clicked, cancel, wait for release, return true - */ - bool user_canceled() { - if (!is_lcd_clicked()) return false; // Return if the button isn't pressed - lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99); - #if ENABLED(ULTIPANEL) - lcd_quick_feedback(true); - #endif - wait_for_release(); - return true; - } - - bool exit_from_g26() { - lcd_setstatusPGM(PSTR("Leaving G26"), -1); - wait_for_release(); - return G26_ERR; - } - - #endif - - 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.max_feedrate_mm_s[Z_AXIS]/(3.0); // Base the feed rate off of the configured Z_AXIS 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); - 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 ? PLANNER_XY_FEEDRATE() / 10.0 : planner.max_feedrate_mm_s[E_AXIS] / 1.5; - - if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value); - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - destination[E_AXIS] += e_delta; - - G26_line_to_destination(feed_value); - set_destination_from_current(); - } - - FORCE_INLINE void move_to(const float where[XYZE], const float &de) { move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], de); } - - void retract_filament(const float where[XYZE]) { - if (!g26_retracted) { // Only retract if we are not already retracted! - g26_retracted = true; - move_to(where, -1.0 * g26_retraction_multiplier); - } - } - - void recover_filament(const float where[XYZE]) { - if (g26_retracted) { // Only un-retract if we are retracted. - move_to(where, 1.2 * g26_retraction_multiplier); - g26_retracted = false; - } - } - - /** - * Prime the nozzle if needed. Return true on error. - */ - inline bool prime_nozzle() { - - #if ENABLED(ULTIPANEL) - float Total_Prime = 0.0; - - if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged - - lcd_external_control = true; - lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99); - lcd_chirp(); - - set_destination_from_current(); - - recover_filament(destination); // Make sure G26 doesn't think the filament is retracted(). - - while (!is_lcd_clicked()) { - lcd_chirp(); - destination[E_AXIS] += 0.25; - #ifdef PREVENT_LENGTHY_EXTRUDE - Total_Prime += 0.25; - if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; - #endif - G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); - 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 - // to stop as quickly. So we put up with the less smooth - // action to give the user a more responsive 'Stop'. - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - wait_for_release(); - - lcd_setstatusPGM(PSTR("Done Priming"), 99); - lcd_quick_feedback(true); - lcd_external_control = false; - } - else - #endif - { - #if ENABLED(ULTRA_LCD) - lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99); - lcd_quick_feedback(true); - #endif - set_destination_from_current(); - destination[E_AXIS] += g26_prime_length; - G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); - set_destination_from_current(); - retract_filament(destination); - } - - return G26_OK; - } - - mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { - float closest = 99999.99; - mesh_index_pair return_val; - - return_val.x_index = return_val.y_index = -1; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (!is_bitmap_set(circle_flags, i, j)) { - const float mx = _GET_MESH_X(i), // We found a circle that needs to be printed - my = _GET_MESH_Y(j); - - // Get the distance to this intersection - float f = HYPOT(X - mx, Y - my); - - // It is possible that we are being called with the values - // to let us find the closest circle to the start position. - // But if this is not the case, add a small weighting to the - // distance calculation to help it choose a better place to continue. - f += HYPOT(g26_x_pos - mx, g26_y_pos - my) / 15.0; - - // Add in the specified amount of Random Noise to our search - if (random_deviation > 1.0) - f += random(0.0, random_deviation); - - if (f < closest) { - closest = f; // We found a closer location that is still - return_val.x_index = i; // un-printed --- save the data for it - return_val.y_index = j; - return_val.distance = closest; - } - } - } - } - bitmap_set(circle_flags, return_val.x_index, return_val.y_index); // Mark this location as done. - return return_val; - } - - /** - * print_line_from_here_to_there() takes two cartesian coordinates and draws a line from one - * to the other. But there are really three sets of coordinates involved. The first coordinate - * is the present location of the nozzle. We don't necessarily want to print from this location. - * We first need to move the nozzle to the start of line segment where we want to print. Once - * there, we can use the two coordinates supplied to draw the line. - * - * Note: Although we assume the first set of coordinates is the start of the line and the second - * set of coordinates is the end of the line, it does not always work out that way. This function - * optimizes the movement to minimize the travel distance before it can start printing. This saves - * a lot of time and eliminates a lot of nonsensical movement of the nozzle. However, it does - * cause a lot of very little short retracement of th nozzle when it draws the very first line - * segment of a 'circle'. The time this requires is very short and is easily saved by the other - * cases where the optimization comes into play. - */ - void print_line_from_here_to_there(const float &sx, const float &sy, const float &sz, const float &ex, const float &ey, const float &ez) { - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual line segment - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s), // We don't need to do a sqrt(), we can compare the distance^2 - // to save computation time - dx_e = current_position[X_AXIS] - ex, // find our distance from the end of the actual line segment - dy_e = current_position[Y_AXIS] - ey, - dist_end = HYPOT2(dx_e, dy_e), - - line_length = HYPOT(ex - sx, ey - sy); - - // If the end point of the line is closer to the nozzle, flip the direction, - // moving from the end to the start. On very small lines the optimization isn't worth it. - if (dist_end < dist_start && (INTERSECTION_CIRCLE_RADIUS) < ABS(line_length)) - return print_line_from_here_to_there(ex, ey, ez, sx, sy, sz); - - // Decide whether to retract & bump - - if (dist_start > 2.0) { - retract_filament(destination); - //todo: parameterize the bump height with a define - move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping - move_to(sx, sy, sz + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - move_to(sx, sy, sz, 0.0); // Get to the starting point with no extrusion / un-Z bump - - const float e_pos_delta = line_length * g26_e_axis_feedrate * g26_extrusion_multiplier; - - recover_filament(destination); - move_to(ex, ey, ez, e_pos_delta); // Get to the ending point with an appropriate amount of extrusion - } - - inline bool look_for_lines_to_connect() { - float sx, sy, ex, ey; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - #if ENABLED(ULTIPANEL) - if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation - #endif - - if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X. - // This is already a half circle because we are at the edge of the bed. - - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i + 1, j)) { // check if we can do a line to the left - if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) { - - // - // We found two circles that need a horizontal line to connect them - // Print it! - // - sx = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge - ex = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // left edge - - sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1); - sy = ey = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1); - ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1); - - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) { - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" Connecting with horizontal line (sx=", sx); - SERIAL_ECHOPAIR(", sy=", sy); - SERIAL_ECHOPAIR(") -> (ex=", ex); - SERIAL_ECHOPAIR(", ey=", ey); - SERIAL_CHAR(')'); - SERIAL_EOL(); - //debug_current_and_destination(PSTR("Connecting horizontal line.")); - } - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); - } - bitmap_set(horizontal_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if we skipped it - } - } - - if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y. - // This is already a half circle because we are at the edge of the bed. - - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i, j + 1)) { // check if we can do a line straight down - if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) { - // - // We found two circles that need a vertical line to connect them - // Print it! - // - sy = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge - ey = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // bottom edge - - sx = ex = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1); - sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1); - ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1); - - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) { - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" Connecting with vertical line (sx=", sx); - SERIAL_ECHOPAIR(", sy=", sy); - SERIAL_ECHOPAIR(") -> (ex=", ex); - SERIAL_ECHOPAIR(", ey=", ey); - SERIAL_CHAR(')'); - SERIAL_EOL(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - debug_current_and_destination(PSTR("Connecting vertical line.")); - #endif - } - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); - } - bitmap_set(vertical_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if skipped - } - } - } - } - } - } - return false; - } - - /** - * Turn on the bed and nozzle heat and - * wait for them to get up to temperature. - */ - inline bool turn_on_heaters() { - millis_t next = millis() + 5000UL; - #if HAS_HEATED_BED - #if ENABLED(ULTRA_LCD) - if (g26_bed_temp > 25) { - lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99); - lcd_quick_feedback(true); - #if ENABLED(ULTIPANEL) - lcd_external_control = true; - #endif - #endif - thermalManager.setTargetBed(g26_bed_temp); - while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) { - - #if ENABLED(ULTIPANEL) - if (is_lcd_clicked()) return exit_from_g26(); - #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); - } - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - #if ENABLED(ULTRA_LCD) - } - lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99); - lcd_quick_feedback(true); - #endif - #endif - - // Start heating the nozzle and wait for it to reach temperature. - thermalManager.setTargetHotend(g26_hotend_temp, 0); - while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { - - #if ENABLED(ULTIPANEL) - if (is_lcd_clicked()) return exit_from_g26(); - #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); - } - idle(); - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - #if ENABLED(ULTRA_LCD) - lcd_reset_status(); - lcd_quick_feedback(true); - #endif - - 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. - * - * Used to interactively edit the mesh by placing the - * nozzle in a problem area and doing a G29 P4 R command. - * - * Parameters: - * - * B Bed Temperature - * C Continue from the Closest mesh point - * D Disable leveling before starting - * F Filament diameter - * H Hotend Temperature - * K Keep heaters on when completed - * L Layer Height - * O Ooze extrusion length - * P Prime length - * Q Retraction multiplier - * R Repetitions (number of grid points) - * S Nozzle Size (diameter) in mm - * U Random deviation (50 if no value given) - * X X position - * Y Y position - */ - void gcode_G26() { - SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s)."); - - // Don't allow Mesh Validation without homing first, - // or if the parameter parsing did not go OK, abort - if (axis_unhomed_error()) return; - - g26_extrusion_multiplier = EXTRUSION_MULTIPLIER; - g26_retraction_multiplier = RETRACTION_MULTIPLIER; - g26_layer_height = MESH_TEST_LAYER_HEIGHT; - g26_prime_length = PRIME_LENGTH; - g26_bed_temp = MESH_TEST_BED_TEMP; - g26_hotend_temp = MESH_TEST_HOTEND_TEMP; - g26_prime_flag = 0; - - float g26_nozzle = MESH_TEST_NOZZLE_SIZE, - g26_filament_diameter = DEFAULT_NOMINAL_FILAMENT_DIA, - g26_ooze_amount = parser.linearval('O', OOZE_AMOUNT); - - bool g26_continue_with_closest = parser.boolval('C'), - g26_keep_heaters_on = parser.boolval('K'); - - if (parser.seenval('B')) { - g26_bed_temp = parser.value_celsius(); - if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) { - SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C)."); - return; - } - } - - if (parser.seenval('L')) { - g26_layer_height = parser.value_linear_units(); - if (!WITHIN(g26_layer_height, 0.0, 2.0)) { - SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible."); - return; - } - } - - if (parser.seen('Q')) { - if (parser.has_value()) { - g26_retraction_multiplier = parser.value_float(); - if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) { - SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible."); - return; - } - } - else { - SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified."); - return; - } - } - - if (parser.seenval('S')) { - g26_nozzle = parser.value_float(); - if (!WITHIN(g26_nozzle, 0.1, 1.0)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible."); - return; - } - } - - if (parser.seen('P')) { - if (!parser.has_value()) { - #if ENABLED(ULTIPANEL) - g26_prime_flag = -1; - #else - SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD."); - return; - #endif - } - else { - g26_prime_flag++; - g26_prime_length = parser.value_linear_units(); - if (!WITHIN(g26_prime_length, 0.0, 25.0)) { - SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible."); - return; - } - } - } - - if (parser.seenval('F')) { - g26_filament_diameter = parser.value_linear_units(); - if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) { - SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible."); - return; - } - } - g26_extrusion_multiplier *= sq(1.75) / sq(g26_filament_diameter); // If we aren't using 1.75mm filament, we need to - // scale up or down the length needed to get the - // same volume of filament - - g26_extrusion_multiplier *= g26_filament_diameter * sq(g26_nozzle) / sq(0.3); // Scale up by nozzle size - - if (parser.seenval('H')) { - g26_hotend_temp = parser.value_celsius(); - if (!WITHIN(g26_hotend_temp, 165, 280)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible."); - return; - } - } - - if (parser.seen('U')) { - randomSeed(millis()); - // This setting will persist for the next G26 - random_deviation = parser.has_value() ? parser.value_float() : 50.0; - } - - int16_t g26_repeats; - #if ENABLED(ULTIPANEL) - g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); - #else - if (!parser.seen('R')) { - SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD."); - return; - } - else - g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; - #endif - if (g26_repeats < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1."); - return; - } - - g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS]; - g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS]; - if (!position_is_reachable(g26_x_pos, g26_y_pos)) { - SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds."); - return; - } - - /** - * Wait until all parameters are verified before altering the state! - */ - set_bed_leveling_enabled(!parser.seen('D')); - - if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - set_current_from_destination(); - } - - if (turn_on_heaters() != G26_OK) goto LEAVE; - - current_position[E_AXIS] = 0.0; - sync_plan_position_e(); - - if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE; - - /** - * Bed is preheated - * - * Nozzle is at temperature - * - * Filament is primed! - * - * It's "Show Time" !!! - */ - - ZERO(circle_flags); - ZERO(horizontal_mesh_line_flags); - ZERO(vertical_mesh_line_flags); - - // Move nozzle to the specified height for the first layer - set_destination_from_current(); - destination[Z_AXIS] = g26_layer_height; - move_to(destination, 0.0); - move_to(destination, g26_ooze_amount); - - #if ENABLED(ULTIPANEL) - lcd_external_control = true; - #endif - - //debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern.")); - - #if DISABLED(ARC_SUPPORT) - - /** - * Pre-generate radius offset values at 30 degree intervals to reduce CPU load. - */ - #define A_INT 30 - #define _ANGS (360 / A_INT) - #define A_CNT (_ANGS / 2) - #define _IND(A) ((A + _ANGS * 8) % _ANGS) - #define _COS(A) (trig_table[_IND(A) % A_CNT] * (_IND(A) >= A_CNT ? -1 : 1)) - #define _SIN(A) (-_COS((A + A_CNT / 2) % _ANGS)) - #if A_CNT & 1 - #error "A_CNT must be a positive value. Please change A_INT." - #endif - float trig_table[A_CNT]; - for (uint8_t i = 0; i < A_CNT; i++) - trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * A_INT)); - - #endif // !ARC_SUPPORT - - mesh_index_pair location; - do { - location = g26_continue_with_closest - ? find_closest_circle_to_print(current_position[X_AXIS], current_position[Y_AXIS]) - : find_closest_circle_to_print(g26_x_pos, g26_y_pos); // Find the closest Mesh Intersection to where we are now. - - if (location.x_index >= 0 && location.y_index >= 0) { - const float circle_x = _GET_MESH_X(location.x_index), - circle_y = _GET_MESH_Y(location.y_index); - - // If this mesh location is outside the printable_radius, skip it. - if (!position_is_reachable(circle_x, circle_y)) continue; - - // Determine where to start and end the circle, - // which is always drawn counter-clockwise. - const uint8_t xi = location.x_index, yi = location.y_index; - const bool f = yi == 0, r = xi >= GRID_MAX_POINTS_X - 1, b = yi >= GRID_MAX_POINTS_Y - 1; - - #if ENABLED(ARC_SUPPORT) - - #define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2) - float sx = circle_x + INTERSECTION_CIRCLE_RADIUS, // default to full circle - ex = circle_x + INTERSECTION_CIRCLE_RADIUS, - sy = circle_y, ey = circle_y, - arc_length = ARC_LENGTH(4); - - // Figure out where to start and end the arc - we always print counterclockwise - if (xi == 0) { // left edge - sx = f ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = b ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - ey = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (r) { // right edge - sx = b ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = f ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - ey = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (f) { - sx = circle_x + INTERSECTION_CIRCLE_RADIUS; - ex = circle_x - INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - else if (b) { - sx = circle_x - INTERSECTION_CIRCLE_RADIUS; - ex = circle_x + INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - const float arc_offset[2] = { - circle_x - sx, - circle_y - sy - }; - - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual circle - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s); - const float endpoint[XYZE] = { - ex, ey, - g26_layer_height, - current_position[E_AXIS] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier) - }; - - if (dist_start > 2.0) { - retract_filament(destination); - //todo: parameterize the bump height with a define - move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping - move_to(sx, sy, g26_layer_height + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - 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; - plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc - feedrate_mm_s = save_feedrate; - set_destination_from_current(); - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - #else // !ARC_SUPPORT - - int8_t start_ind = -2, end_ind = 9; // Assume a full circle (from 5:00 to 5:00) - if (xi == 0) { // Left edge? Just right half. - start_ind = f ? 0 : -3; // 03:00 to 12:00 for front-left - end_ind = b ? 0 : 2; // 06:00 to 03:00 for back-left - } - else if (r) { // Right edge? Just left half. - start_ind = b ? 6 : 3; // 12:00 to 09:00 for front-right - end_ind = f ? 5 : 8; // 09:00 to 06:00 for back-right - } - else if (f) { // Front edge? Just back half. - start_ind = 0; // 03:00 - end_ind = 5; // 09:00 - } - else if (b) { // Back edge? Just front half. - start_ind = 6; // 09:00 - end_ind = 11; // 03:00 - } - - for (int8_t ind = start_ind; ind <= end_ind; ind++) { - - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - float rx = circle_x + _COS(ind), // For speed, these are now a lookup table entry - ry = circle_y + _SIN(ind), - xe = circle_x + _COS(ind + 1), - ye = circle_y + _SIN(ind + 1); - - #if IS_KINEMATIC - // Check to make sure this segment is entirely on the bed, skip if not. - if (!position_is_reachable(rx, ry) || !position_is_reachable(xe, ye)) continue; - #else // not, we need to skip - rx = constrain(rx, X_MIN_POS + 1, X_MAX_POS - 1); // This keeps us from bumping the endstops - ry = constrain(ry, Y_MIN_POS + 1, Y_MAX_POS - 1); - xe = constrain(xe, X_MIN_POS + 1, X_MAX_POS - 1); - ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1); - #endif - - print_line_from_here_to_there(rx, ry, g26_layer_height, xe, ye, g26_layer_height); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - #endif // !ARC_SUPPORT - - if (look_for_lines_to_connect()) goto LEAVE; - } - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - - } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); - - LEAVE: - lcd_setstatusPGM(PSTR("Leaving G26"), -1); - - retract_filament(destination); - destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; - - //debug_current_and_destination(PSTR("ready to do Z-Raise.")); - move_to(destination, 0); // Raise the nozzle - //debug_current_and_destination(PSTR("done doing Z-Raise.")); - - destination[X_AXIS] = g26_x_pos; // Move back to the starting position - destination[Y_AXIS] = g26_y_pos; - //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is - - move_to(destination, 0); // Move back to the starting position - //debug_current_and_destination(PSTR("done doing X/Y move.")); - - #if ENABLED(ULTIPANEL) - lcd_external_control = false; // Give back control of the LCD Panel! - #endif - - if (!g26_keep_heaters_on) { - #if HAS_HEATED_BED - thermalManager.setTargetBed(0); - #endif - thermalManager.setTargetHotend(0, 0); - } - } - -#endif // G26_MESH_VALIDATION diff --git a/Marlin/HAL.h b/Marlin/HAL.h deleted file mode 100644 index d5f79cd0f7..0000000000 --- a/Marlin/HAL.h +++ /dev/null @@ -1,337 +0,0 @@ -/* ************************************************************************** - - Marlin 3D Printer Firmware - Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - - Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - - 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 . -****************************************************************************/ - -/** - * Description: HAL for __AVR__ - */ - -#ifndef _HAL_AVR_H_ -#define _HAL_AVR_H_ - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "fastio.h" - -#include -#include -#include -#include -#include -#include -#include - -// -------------------------------------------------------------------------- -// Defines -// -------------------------------------------------------------------------- - -//#define analogInputToDigitalPin(IO) IO - -// Bracket code that shouldn't be interrupted -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli() - #define CRITICAL_SECTION_END SREG = _sreg -#endif - -#define ISRS_ENABLED() TEST(SREG, SREG_I) -#define ENABLE_ISRS() sei() -#define DISABLE_ISRS() cli() - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -typedef uint16_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFF - -typedef int8_t pin_t; - -#define HAL_SERVO_LIB Servo - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -//extern uint8_t MCUSR; - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -//void cli(void); - -//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; } - -// eeprom -//void eeprom_write_byte(unsigned char *pos, unsigned char value); -//unsigned char eeprom_read_byte(unsigned char *pos); - -// timers -#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz - -#define STEP_TIMER_NUM 1 -#define TEMP_TIMER_NUM 0 -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0) - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE -#define STEPPER_TIMER_PRESCALE 8 -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A) -#define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A) - -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - -FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - UNUSED(frequency); - switch (timer_num) { - case STEP_TIMER_NUM: - // waveform generation = 0100 = CTC - SET_WGM(1, CTC_OCRnA); - - // output mode = 00 (disconnected) - SET_COMA(1, NORMAL); - - // Set the timer pre-scaler - // Generally we use a divider of 8, resulting in a 2MHz timer - // frequency on a 16MHz MCU. If you are going to change this, be - // sure to regenerate speed_lookuptable.h with - // create_speed_lookuptable.py - SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler - - // Init Stepper ISR to 122 Hz for quick starting - // (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency - OCR1A = 0x4000; - TCNT1 = 0; - break; - - case TEMP_TIMER_NUM: - // Use timer0 for temperature measurement - // Interleave temperature interrupt with millies interrupt - OCR0B = 128; - break; - } -} - -#define TIMER_OCR_1 OCR1A -#define TIMER_COUNTER_1 TCNT1 - -#define TIMER_OCR_0 OCR0A -#define TIMER_COUNTER_0 TCNT0 - -#define _CAT(a, ...) a ## __VA_ARGS__ -#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare) -#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer) -#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer) - -/** - * On AVR there is no hardware prioritization and preemption of - * interrupts, so this emulates it. The UART has first priority - * (otherwise, characters will be lost due to UART overflow). - * Then: Stepper, Endstops, Temperature, and -finally- all others. - */ -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) - -/* 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) { \ - __asm__ __volatile__ ( \ - A("push r16") /* 2 Save R16 */ \ - A("in r16, __SREG__") /* 1 Get SREG */ \ - A("push r16") /* 2 Save SREG into stack */ \ - A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \ - A("push r16") /* 2 Save TIMSK0 into the stack */ \ - A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \ - A("sts %[timsk0], r16") /* 2 And set the new value */ \ - A("lds r16, %[timsk1]") /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \ - A("andi r16,~%[msk1]") /* 1 Disable the stepper ISR */ \ - A("sts %[timsk1], r16") /* 2 And set the new value */ \ - A("push r16") /* 2 Save TIMSK1 into stack */ \ - A("in r16, 0x3B") /* 1 Get RAMPZ register */ \ - A("push r16") /* 2 Save RAMPZ into stack */ \ - A("in r16, 0x3C") /* 1 Get EIND register */ \ - A("push r0") /* C runtime can modify all the following registers without restoring them */ \ - A("push r1") \ - A("push r18") \ - A("push r19") \ - A("push r20") \ - A("push r21") \ - A("push r22") \ - A("push r23") \ - A("push r24") \ - A("push r25") \ - A("push r26") \ - A("push r27") \ - A("push r30") \ - A("push r31") \ - A("clr r1") /* C runtime expects this register to be 0 */ \ - A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \ - A("pop r31") \ - A("pop r30") \ - A("pop r27") \ - A("pop r26") \ - A("pop r25") \ - A("pop r24") \ - A("pop r23") \ - A("pop r22") \ - A("pop r21") \ - A("pop r20") \ - A("pop r19") \ - A("pop r18") \ - A("pop r1") \ - A("pop r0") \ - A("out 0x3C, r16") /* 1 Restore EIND register */ \ - A("pop r16") /* 2 Get the original RAMPZ register value */ \ - A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \ - A("pop r16") /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \ - A("ori r16,%[msk1]") /* 1 Reenable the stepper ISR */ \ - A("cli") /* 1 Disable global interrupts - Reenabling Stepper ISR can reenter amd temperature can reenter, and we want that, if it happens, after this ISR has ended */ \ - A("sts %[timsk1], r16") /* 2 And restore the old value - This reenables the stepper ISR */ \ - A("pop r16") /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \ - A("sts %[timsk0], r16") /* 2 And restore the old value - This reenables the temperature ISR */ \ - A("pop r16") /* 2 Get the old SREG value */ \ - A("out __SREG__, r16") /* 1 And restore the SREG value */ \ - A("pop r16") /* 2 Restore R16 value */ \ - A("reti") /* 4 Return from interrupt */ \ - : \ - : [timsk0] "i" ((uint16_t)&TIMSK0), \ - [timsk1] "i" ((uint16_t)&TIMSK1), \ - [msk0] "M" ((uint8_t)(1< 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#else - #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#endif - -#define HAL_READ_ADC() ADC -#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) - -#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 HAL_SENSITIVE_PINS 0, 1 - -#endif // _HAL_AVR_H_ diff --git a/Marlin/I2CPositionEncoder.cpp b/Marlin/I2CPositionEncoder.cpp deleted file mode 100644 index 285ba0d66f..0000000000 --- a/Marlin/I2CPositionEncoder.cpp +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -//todo: add support for multiple encoders on a single axis -//todo: add z axis auto-leveling -//todo: consolidate some of the related M codes? -//todo: add endstop-replacement mode? -//todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; -//todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial - - -#include "MarlinConfig.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - - #include "Marlin.h" - #include "temperature.h" - #include "stepper.h" - #include "I2CPositionEncoder.h" - #include "parser.h" - - #include - - - void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) { - encoderAxis = axis; - i2cAddress = address; - - initialised++; - - SERIAL_ECHOPAIR("Setting up encoder on ", axis_codes[encoderAxis]); - SERIAL_ECHOLNPAIR(" axis, addr = ", address); - - position = get_position(); - } - - void I2CPositionEncoder::update() { - if (!initialised || !homed || !active) return; //check encoder is set up and active - - position = get_position(); - - //we don't want to stop things just because the encoder missed a message, - //so we only care about responses that indicate bad magnetic strength - - if (!passes_test(false)) { //check encoder data is good - lastErrorTime = millis(); - /* - if (trusted) { //commented out as part of the note below - trusted = false; - SERIAL_ECHOPGM("Fault detected on "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder. Disengaging error correction until module is trusted again."); - } - */ - return; - } - - if (!trusted) { - /** - * This is commented out because it introduces error and can cause bad print quality. - * - * This code is intended to manage situations where the encoder has reported bad magnetic strength. - * This indicates that the magnetic strip was too far away from the sensor to reliably track position. - * When this happens, this code resets the offset based on where the printer thinks it is. This has been - * shown to introduce errors in actual position which result in drifting prints and poor print quality. - * Perhaps a better method would be to disable correction on the axis with a problem, report it to the - * user via the status leds on the encoder module and prompt the user to re-home the axis at which point - * the encoder would be re-enabled. - */ - - /* - // If the magnetic strength has been good for a certain time, start trusting the module again - - if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) { - trusted = true; - - SERIAL_ECHOPGM("Untrusted encoder module on "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis has been fault-free for set duration, reinstating error correction."); - - //the encoder likely lost its place when the error occured, so we'll reset and use the printer's - //idea of where it the axis is to re-initialise - float position = planner.get_axis_position_mm(encoderAxis); - int32_t positionInTicks = position * get_ticks_unit(); - - //shift position from previous to current position - zeroOffset -= (positionInTicks - get_position()); - - #ifdef I2CPE_DEBUG - SERIAL_ECHOPGM("Current position is "); - SERIAL_ECHOLN(position); - - SERIAL_ECHOPGM("Position in encoder ticks is "); - SERIAL_ECHOLN(positionInTicks); - - SERIAL_ECHOPGM("New zero-offset of "); - SERIAL_ECHOLN(zeroOffset); - - SERIAL_ECHOPGM("New position reads as "); - SERIAL_ECHO(get_position()); - SERIAL_CHAR('('); - SERIAL_ECHO(mm_from_count(get_position())); - SERIAL_ECHOLNPGM(")"); - #endif - } - */ - return; - } - - lastPosition = position; - const millis_t positionTime = millis(); - - //only do error correction if setup and enabled - if (ec && ecMethod != I2CPE_ECM_NONE) { - - #ifdef I2CPE_EC_THRESH_PROPORTIONAL - const millis_t deltaTime = positionTime - lastPositionTime; - const uint32_t distance = ABS(position - lastPosition), - speed = distance / deltaTime; - const float threshold = constrain((speed / 50), 1, 50) * ecThreshold; - #else - const float threshold = get_error_correct_threshold(); - #endif - - //check error - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - float sum = 0, diffSum = 0; - - errIdx = (errIdx >= I2CPE_ERR_ARRAY_SIZE - 1) ? 0 : errIdx + 1; - err[errIdx] = get_axis_error_steps(false); - - LOOP_L_N(i, I2CPE_ERR_ARRAY_SIZE) { - sum += err[i]; - if (i) diffSum += ABS(err[i-1] - err[i]); - } - - const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); //calculate average for error - - #else - const int32_t error = get_axis_error_steps(false); - #endif - - //SERIAL_ECHOPGM("Axis error steps: "); - //SERIAL_ECHOLN(error); - - #ifdef I2CPE_ERR_THRESH_ABORT - if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.axis_steps_per_mm[encoderAxis]) { - //kill("Significant Error"); - SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!"); - SERIAL_ECHOLN(error); - safe_delay(5000); - } - #endif - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - if (errIdx == 0) { - // In order to correct for "error" but avoid correcting for noise and non-skips - // it must be > threshold and have a difference average of < 10 and be < 2000 steps - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis] && - diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && ABS(error) < 2000) { // Check for persistent error (skip) - errPrst[errPrstIdx++] = error; // Error must persist for I2CPE_ERR_PRST_ARRAY_SIZE error cycles. This also serves to improve the average accuracy - 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))); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis]); - SERIAL_ECHOLNPGM("mm; correcting!"); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(errorP); - errPrstIdx = 0; - } - } - else - errPrstIdx = 0; - } - #else - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis]) { - //SERIAL_ECHOLN(error); - //SERIAL_ECHOLN(position); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(error / 2); - } - #endif - - if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.axis_steps_per_mm[encoderAxis]) { - const millis_t ms = millis(); - if (ELAPSED(ms, nextErrorCountTime)) { - SERIAL_ECHOPAIR("Large error on ", axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis. error: ", (int)error); - SERIAL_ECHOLNPAIR("; diffSum: ", diffSum); - errorCount++; - nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS; - } - } - } - - lastPositionTime = positionTime; - } - - void I2CPositionEncoder::set_homed() { - if (active) { - reset(); // Reset module's offset to zero (so current position is homed / zero) - delay(10); - - zeroOffset = get_raw_count(); - homed++; - trusted++; - - #ifdef I2CPE_DEBUG - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis encoder homed, offset of ", zeroOffset); - SERIAL_ECHOLNPGM(" ticks."); - #endif - } - } - - bool I2CPositionEncoder::passes_test(const bool report) { - if (report) { - if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPGM(" axis "); - serialprintPGM(H == I2CPE_MAG_SIG_BAD ? PSTR("magnetic strip ") : PSTR("encoder ")); - switch (H) { - case I2CPE_MAG_SIG_GOOD: - case I2CPE_MAG_SIG_MID: - SERIAL_ECHOLNPGM("passes test; field strength "); - serialprintPGM(H == I2CPE_MAG_SIG_GOOD ? PSTR("good.\n") : PSTR("fair.\n")); - break; - default: - SERIAL_ECHOLNPGM("not detected!"); - } - } - return (H == I2CPE_MAG_SIG_GOOD || H == I2CPE_MAG_SIG_MID); - } - - float I2CPositionEncoder::get_axis_error_mm(const bool report) { - float target, actual, error; - - target = planner.get_axis_position_mm(encoderAxis); - actual = mm_from_count(position); - error = actual - target; - - if (ABS(error) > 10000) error = 0; // ? - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis target: ", target); - SERIAL_ECHOPAIR(", actual: ", actual); - SERIAL_ECHOLNPAIR(", error : ",error); - } - - return error; - } - - int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) { - if (!active) { - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder not active!"); - } - return 0; - } - - float stepperTicksPerUnit; - int32_t encoderTicks = position, encoderCountInStepperTicksScaled; - //int32_t stepperTicks = stepper.position(encoderAxis); - - // With a rotary encoder we're concerned with ticks/rev; whereas with a linear we're concerned with ticks/mm - stepperTicksPerUnit = (type == I2CPE_ENC_TYPE_ROTARY) ? stepperTicks : planner.axis_steps_per_mm[encoderAxis]; - - //convert both 'ticks' into same units / base - encoderCountInStepperTicksScaled = LROUND((stepperTicksPerUnit * encoderTicks) / encoderTicksPerUnit); - - int32_t target = stepper.position(encoderAxis), - error = (encoderCountInStepperTicksScaled - target); - - //suppress discontinuities (might be caused by bad I2C readings...?) - const bool suppressOutput = (ABS(error - errorPrev) > 100); - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis target: ", target); - SERIAL_ECHOPAIR(", actual: ", encoderCountInStepperTicksScaled); - SERIAL_ECHOLNPAIR(", error : ", error); - - if (suppressOutput) SERIAL_ECHOLNPGM("Discontinuity detected, suppressing error."); - } - - errorPrev = error; - - return (suppressOutput ? 0 : error); - } - - int32_t I2CPositionEncoder::get_raw_count() { - uint8_t index = 0; - i2cLong encoderCount; - - encoderCount.val = 0x00; - - if (Wire.requestFrom((int)i2cAddress, 3) != 3) { - //houston, we have a problem... - H = I2CPE_MAG_SIG_NF; - return 0; - } - - while (Wire.available()) - encoderCount.bval[index++] = (uint8_t)Wire.read(); - - //extract the magnetic strength - H = (B00000011 & (encoderCount.bval[2] >> 6)); - - //extract sign bit; sign = (encoderCount.bval[2] & B00100000); - //set all upper bits to the sign value to overwrite H - encoderCount.val = (encoderCount.bval[2] & B00100000) ? (encoderCount.val | 0xFFC00000) : (encoderCount.val & 0x003FFFFF); - - if (invert) encoderCount.val *= -1; - - return encoderCount.val; - } - - bool I2CPositionEncoder::test_axis() { - //only works on XYZ cartesian machines for the time being - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) return false; - - float startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; - - const float startPosition = soft_endstop_min[encoderAxis] + 10, - endPosition = soft_endstop_max[encoderAxis] - 10, - feedrate = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); - - ec = false; - - LOOP_NA(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.synchronize(); - - // if the module isn't currently trusted, wait until it is (or until it should be if things are working) - if (!trusted) { - int32_t startWaitingTime = millis(); - while (!trusted && millis() - startWaitingTime < I2CPE_TIME_TRUSTED) - safe_delay(500); - } - - 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.synchronize(); - } - - return trusted; - } - - void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { - if (type != I2CPE_ENC_TYPE_LINEAR) { - SERIAL_ECHOLNPGM("Steps per mm calibration is only available using linear encoders."); - return; - } - - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) { - SERIAL_ECHOLNPGM("Automatic steps / mm calibration not supported for this axis."); - return; - } - - float old_steps_mm, new_steps_mm, - startDistance, endDistance, - 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); - - bool oldec = ec; - ec = false; - - startDistance = 20; - endDistance = soft_endstop_max[encoderAxis] - 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); - } - - startCoord[encoderAxis] = startDistance; - endCoord[encoderAxis] = endDistance; - - planner.synchronize(); - - 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.synchronize(); - - delay(250); - startCount = get_position(); - - //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.synchronize(); - - //Read encoder distance - delay(250); - stopCount = get_position(); - - travelledDistance = mm_from_count(ABS(stopCount - startCount)); - - SERIAL_ECHOPAIR("Attempted to travel: ", travelDistance); - SERIAL_ECHOLNPGM("mm."); - - SERIAL_ECHOPAIR("Actually travelled: ", travelledDistance); - SERIAL_ECHOLNPGM("mm."); - - //Calculate new axis steps per unit - old_steps_mm = planner.axis_steps_per_mm[encoderAxis]; - new_steps_mm = (old_steps_mm * travelDistance) / travelledDistance; - - SERIAL_ECHOLNPAIR("Old steps per mm: ", old_steps_mm); - SERIAL_ECHOLNPAIR("New steps per mm: ", new_steps_mm); - - //Save new value - planner.axis_steps_per_mm[encoderAxis] = new_steps_mm; - - if (iter > 1) { - total += new_steps_mm; - - // swap start and end points so next loop runs from current position - float tempCoord = startCoord[encoderAxis]; - startCoord[encoderAxis] = endCoord[encoderAxis]; - endCoord[encoderAxis] = tempCoord; - } - } - - if (iter > 1) { - total /= (float)iter; - SERIAL_ECHOLNPAIR("Average steps per mm: ", total); - } - - ec = oldec; - - SERIAL_ECHOLNPGM("Calculated steps per mm has been set. Please save to EEPROM (M500) if you wish to keep these values."); - } - - void I2CPositionEncoder::reset() { - Wire.beginTransmission(i2cAddress); - Wire.write(I2CPE_RESET_COUNT); - Wire.endTransmission(); - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - ZERO(err); - #endif - } - - - bool I2CPositionEncodersMgr::I2CPE_anyaxis; - uint8_t I2CPositionEncodersMgr::I2CPE_addr, - I2CPositionEncodersMgr::I2CPE_idx; - I2CPositionEncoder I2CPositionEncodersMgr::encoders[I2CPE_ENCODER_CNT]; - - void I2CPositionEncodersMgr::init() { - Wire.begin(); - - #if I2CPE_ENCODER_CNT > 0 - uint8_t i = 0; - - encoders[i].init(I2CPE_ENC_1_ADDR, I2CPE_ENC_1_AXIS); - - #ifdef I2CPE_ENC_1_TYPE - encoders[i].set_type(I2CPE_ENC_1_TYPE); - #endif - #ifdef I2CPE_ENC_1_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_1_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_1_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_1_TICKS_REV); - #endif - #ifdef I2CPE_ENC_1_INVERT - encoders[i].set_inverted(I2CPE_ENC_1_INVERT); - #endif - #ifdef I2CPE_ENC_1_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_1_EC_METHOD); - #endif - #ifdef I2CPE_ENC_1_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_1_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_1_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 1 - i++; - - encoders[i].init(I2CPE_ENC_2_ADDR, I2CPE_ENC_2_AXIS); - - #ifdef I2CPE_ENC_2_TYPE - encoders[i].set_type(I2CPE_ENC_2_TYPE); - #endif - #ifdef I2CPE_ENC_2_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_2_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_2_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_2_TICKS_REV); - #endif - #ifdef I2CPE_ENC_2_INVERT - encoders[i].set_inverted(I2CPE_ENC_2_INVERT); - #endif - #ifdef I2CPE_ENC_2_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_2_EC_METHOD); - #endif - #ifdef I2CPE_ENC_2_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_2_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_2_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 2 - i++; - - encoders[i].init(I2CPE_ENC_3_ADDR, I2CPE_ENC_3_AXIS); - - #ifdef I2CPE_ENC_3_TYPE - encoders[i].set_type(I2CPE_ENC_3_TYPE); - #endif - #ifdef I2CPE_ENC_3_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_3_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_3_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_3_TICKS_REV); - #endif - #ifdef I2CPE_ENC_3_INVERT - encoders[i].set_inverted(I2CPE_ENC_3_INVERT); - #endif - #ifdef I2CPE_ENC_3_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_3_EC_METHOD); - #endif - #ifdef I2CPE_ENC_3_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_3_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_3_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 3 - i++; - - encoders[i].init(I2CPE_ENC_4_ADDR, I2CPE_ENC_4_AXIS); - - #ifdef I2CPE_ENC_4_TYPE - encoders[i].set_type(I2CPE_ENC_4_TYPE); - #endif - #ifdef I2CPE_ENC_4_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_4_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_4_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_4_TICKS_REV); - #endif - #ifdef I2CPE_ENC_4_INVERT - encoders[i].set_inverted(I2CPE_ENC_4_INVERT); - #endif - #ifdef I2CPE_ENC_4_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_4_EC_METHOD); - #endif - #ifdef I2CPE_ENC_4_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_4_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_4_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 4 - i++; - - encoders[i].init(I2CPE_ENC_5_ADDR, I2CPE_ENC_5_AXIS); - - #ifdef I2CPE_ENC_5_TYPE - encoders[i].set_type(I2CPE_ENC_5_TYPE); - #endif - #ifdef I2CPE_ENC_5_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_5_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_5_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_5_TICKS_REV); - #endif - #ifdef I2CPE_ENC_5_INVERT - encoders[i].set_inverted(I2CPE_ENC_5_INVERT); - #endif - #ifdef I2CPE_ENC_5_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_5_EC_METHOD); - #endif - #ifdef I2CPE_ENC_5_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_5_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_5_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - } - - void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units, const bool noOffset) { - CHECK_IDX(); - - if (units) - SERIAL_ECHOLN(noOffset ? encoders[idx].mm_from_count(encoders[idx].get_raw_count()) : encoders[idx].get_position_mm()); - else { - if (noOffset) { - const int32_t raw_count = encoders[idx].get_raw_count(); - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_CHAR(' '); - - for (uint8_t j = 31; j > 0; j--) - SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j))); - - SERIAL_ECHO((bool)(0x00000001 & raw_count)); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(raw_count); - } - else - SERIAL_ECHOLN(encoders[idx].get_position()); - } - } - - void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const uint8_t newaddr) { - // First check 'new' address is not in use - Wire.beginTransmission(newaddr); - if (!Wire.endTransmission()) { - SERIAL_ECHOPAIR("?There is already a device with that address on the I2C bus! (", newaddr); - SERIAL_ECHOLNPGM(")"); - return; - } - - // Now check that we can find the module on the oldaddr address - Wire.beginTransmission(oldaddr); - if (Wire.endTransmission()) { - SERIAL_ECHOPAIR("?No module detected at this address! (", oldaddr); - SERIAL_ECHOLNPGM(")"); - return; - } - - SERIAL_ECHOPAIR("Module found at ", oldaddr); - SERIAL_ECHOLNPAIR(", changing address to ", newaddr); - - // Change the modules address - Wire.beginTransmission(oldaddr); - Wire.write(I2CPE_SET_ADDR); - Wire.write(newaddr); - Wire.endTransmission(); - - SERIAL_ECHOLNPGM("Address changed, resetting and waiting for confirmation.."); - - // Wait for the module to reset (can probably be improved by polling address with a timeout). - safe_delay(I2CPE_REBOOT_TIME); - - // Look for the module at the new address. - Wire.beginTransmission(newaddr); - if (Wire.endTransmission()) { - SERIAL_ECHOLNPGM("Address change failed! Check encoder module."); - return; - } - - SERIAL_ECHOLNPGM("Address change successful!"); - - // Now, if this module is configured, find which encoder instance it's supposed to correspond to - // and enable it (it will likely have failed initialisation on power-up, before the address change). - const int8_t idx = idx_from_addr(newaddr); - if (idx >= 0 && !encoders[idx].get_active()) { - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again."); - encoders[idx].set_active(encoders[idx].passes_test(true)); - } - } - - void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) { - // First check there is a module - Wire.beginTransmission(address); - if (Wire.endTransmission()) { - SERIAL_ECHOPAIR("?No module detected at this address! (", address); - SERIAL_ECHOLNPGM(")"); - return; - } - - SERIAL_ECHOPAIR("Requesting version info from module at address ", address); - SERIAL_ECHOLNPGM(":"); - - Wire.beginTransmission(address); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_VERSION); - Wire.endTransmission(); - - // Read value - if (Wire.requestFrom((int)address, 32)) { - char c; - while (Wire.available() > 0 && (c = (char)Wire.read()) > 0) - SERIAL_ECHO(c); - SERIAL_EOL(); - } - - // Set module back to normal (distance) mode - Wire.beginTransmission(address); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_DISTANCE); - Wire.endTransmission(); - } - - int8_t I2CPositionEncodersMgr::parse() { - I2CPE_addr = 0; - - if (parser.seen('A')) { - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?A seen, but no address specified! [30-200]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_addr = parser.value_byte(); - if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 - SERIAL_PROTOCOLLNPGM("?Address out of range. [30-200]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_idx = idx_from_addr(I2CPE_addr); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPGM("?No device with this address!"); - return I2CPE_PARSE_ERR; - } - } - else if (parser.seenval('I')) { - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1); - SERIAL_PROTOCOLLNPGM("]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_idx = parser.value_byte(); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1); - SERIAL_ECHOLNPGM("]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_addr = encoders[I2CPE_idx].get_address(); - } - else - I2CPE_idx = 0xFF; - - I2CPE_anyaxis = parser.seen_axis(); - - return I2CPE_PARSE_OK; - }; - - /** - * M860: Report the position(s) of position encoder module(s). - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * O Include homed zero-offset in returned position. - * U Units in mm or raw step count. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M860() { - if (parse()) return; - - const bool hasU = parser.seen('U'), hasO = parser.seen('O'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_position(idx, hasU, hasO); - } - } - } - else - report_position(I2CPE_idx, hasU, hasO); - } - - /** - * M861: Report the status of position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M861() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_status(idx); - } - } - } - else - report_status(I2CPE_idx); - } - - /** - * M862: Perform an axis continuity test for position encoder - * modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M862() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) test_axis(idx); - } - } - } - else - test_axis(I2CPE_idx); - } - - /** - * M863: Perform steps-per-mm calibration for - * position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * P Number of rePeats/iterations. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M863() { - if (parse()) return; - - const uint8_t iterations = constrain(parser.byteval('P', 1), 1, 10); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations); - } - } - } - else - calibrate_steps_mm(I2CPE_idx, iterations); - } - - /** - * M864: Change position encoder module I2C address. - * - * A Module current/old I2C address. If not present, - * assumes default address (030). [30, 200]. - * S Module new I2C address. [30, 200]. - * - * If S is not specified: - * X Use I2CPE_PRESET_ADDR_X (030). - * Y Use I2CPE_PRESET_ADDR_Y (031). - * Z Use I2CPE_PRESET_ADDR_Z (032). - * E Use I2CPE_PRESET_ADDR_E (033). - */ - void I2CPositionEncodersMgr::M864() { - uint8_t newAddress; - - if (parse()) return; - - if (!I2CPE_addr) I2CPE_addr = I2CPE_PRESET_ADDR_X; - - if (parser.seen('S')) { - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?S seen, but no address specified! [30-200]"); - return; - }; - - newAddress = parser.value_byte(); - if (!WITHIN(newAddress, 30, 200)) { - SERIAL_PROTOCOLLNPGM("?New address out of range. [30-200]"); - return; - } - } - else if (!I2CPE_anyaxis) { - SERIAL_PROTOCOLLNPGM("?You must specify S or [XYZE]."); - return; - } - else { - if (parser.seen('X')) newAddress = I2CPE_PRESET_ADDR_X; - else if (parser.seen('Y')) newAddress = I2CPE_PRESET_ADDR_Y; - else if (parser.seen('Z')) newAddress = I2CPE_PRESET_ADDR_Z; - else if (parser.seen('E')) newAddress = I2CPE_PRESET_ADDR_E; - else return; - } - - SERIAL_ECHOPAIR("Changing module at address ", I2CPE_addr); - SERIAL_ECHOLNPAIR(" to address ", newAddress); - - change_module_address(I2CPE_addr, newAddress); - } - - /** - * M865: Check position encoder module firmware version. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A or I not specified: - * X Check X axis encoder, if present. - * Y Check Y axis encoder, if present. - * Z Check Z axis encoder, if present. - * E Check E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M865() { - if (parse()) return; - - if (!I2CPE_addr) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address()); - } - } - } - else - report_module_firmware(I2CPE_addr); - } - - /** - * M866: Report or reset position encoder module error - * count. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * R Reset error counter. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M866() { - if (parse()) return; - - const bool hasR = parser.seen('R'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (hasR) - reset_error_count(idx, AxisEnum(i)); - else - report_error_count(idx, AxisEnum(i)); - } - } - } - } - else if (hasR) - reset_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - else - report_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - } - - /** - * M867: Enable/disable or toggle error correction for position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * S<1|0> Enable/disable error correction. 1 enables, 0 disables. If not - * supplied, toggle. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M867() { - if (parse()) return; - - const int8_t onoff = parser.seenval('S') ? parser.value_int() : -1; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(idx, ena, AxisEnum(i)); - } - } - } - } - else { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(I2CPE_idx, ena, encoders[I2CPE_idx].get_axis()); - } - } - - /** - * M868: Report or set position encoder module error correction - * threshold. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * T New error correction threshold. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M868() { - if (parse()) return; - - const float newThreshold = parser.seenval('T') ? parser.value_float() : -9999; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (newThreshold != -9999) - set_ec_threshold(idx, newThreshold, encoders[idx].get_axis()); - else - get_ec_threshold(idx, encoders[idx].get_axis()); - } - } - } - } - else if (newThreshold != -9999) - set_ec_threshold(I2CPE_idx, newThreshold, encoders[I2CPE_idx].get_axis()); - else - get_ec_threshold(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - } - - /** - * M869: Report position encoder module error. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M869() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_error(idx); - } - } - } - else - report_error(I2CPE_idx); - } - -#endif // I2C_POSITION_ENCODERS diff --git a/Marlin/I2CPositionEncoder.h b/Marlin/I2CPositionEncoder.h deleted file mode 100644 index a0e8a6199a..0000000000 --- a/Marlin/I2CPositionEncoder.h +++ /dev/null @@ -1,342 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef I2CPOSENC_H -#define I2CPOSENC_H - -#include "MarlinConfig.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - - #include "enum.h" - #include "macros.h" - #include "types.h" - #include - - //=========== Advanced / Less-Common Encoder Configuration Settings ========== - - #define I2CPE_EC_THRESH_PROPORTIONAL // if enabled adjusts the error correction threshold - // proportional to the current speed of the axis allows - // for very small error margin at low speeds without - // stuttering due to reading latency at high speeds - - #define I2CPE_DEBUG // enable encoder-related debug serial echos - - #define I2CPE_REBOOT_TIME 5000 // time we wait for an encoder module to reboot - // after changing address. - - #define I2CPE_MAG_SIG_GOOD 0 - #define I2CPE_MAG_SIG_MID 1 - #define I2CPE_MAG_SIG_BAD 2 - #define I2CPE_MAG_SIG_NF 255 - - #define I2CPE_REQ_REPORT 0 - #define I2CPE_RESET_COUNT 1 - #define I2CPE_SET_ADDR 2 - #define I2CPE_SET_REPORT_MODE 3 - #define I2CPE_CLEAR_EEPROM 4 - - #define I2CPE_LED_PAR_MODE 10 - #define I2CPE_LED_PAR_BRT 11 - #define I2CPE_LED_PAR_RATE 14 - - #define I2CPE_REPORT_DISTANCE 0 - #define I2CPE_REPORT_STRENGTH 1 - #define I2CPE_REPORT_VERSION 2 - - // Default I2C addresses - #define I2CPE_PRESET_ADDR_X 30 - #define I2CPE_PRESET_ADDR_Y 31 - #define I2CPE_PRESET_ADDR_Z 32 - #define I2CPE_PRESET_ADDR_E 33 - - #define I2CPE_DEF_AXIS X_AXIS - #define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X - - // Error event counter; tracks how many times there is an error exceeding a certain threshold - #define I2CPE_ERR_CNT_THRESH 3.00 - #define I2CPE_ERR_CNT_DEBOUNCE_MS 2000 - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - #define I2CPE_ERR_ARRAY_SIZE 32 - #define I2CPE_ERR_PRST_ARRAY_SIZE 10 - #endif - - // Error Correction Methods - #define I2CPE_ECM_NONE 0 - #define I2CPE_ECM_MICROSTEP 1 - #define I2CPE_ECM_PLANNER 2 - #define I2CPE_ECM_STALLDETECT 3 - - // Encoder types - #define I2CPE_ENC_TYPE_ROTARY 0 - #define I2CPE_ENC_TYPE_LINEAR 1 - - // Parser - #define I2CPE_PARSE_ERR 1 - #define I2CPE_PARSE_OK 0 - - #define LOOP_PE(VAR) LOOP_L_N(VAR, I2CPE_ENCODER_CNT) - #define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0) - - typedef union { - volatile int32_t val = 0; - uint8_t bval[4]; - } i2cLong; - - class I2CPositionEncoder { - private: - AxisEnum encoderAxis = I2CPE_DEF_AXIS; - - uint8_t i2cAddress = I2CPE_DEF_ADDR, - ecMethod = I2CPE_DEF_EC_METHOD, - type = I2CPE_DEF_TYPE, - H = I2CPE_MAG_SIG_NF; // Magnetic field strength - - int encoderTicksPerUnit = I2CPE_DEF_ENC_TICKS_UNIT, - stepperTicks = I2CPE_DEF_TICKS_REV, - errorCount = 0, - errorPrev = 0; - - float ecThreshold = I2CPE_DEF_EC_THRESH; - - bool homed = false, - trusted = false, - initialised = false, - active = false, - invert = false, - ec = true; - - int32_t zeroOffset = 0, - lastPosition = 0, - position; - - millis_t lastPositionTime = 0, - nextErrorCountTime = 0, - lastErrorTime; - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - uint8_t errIdx = 0, errPrstIdx = 0; - int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }, - errPrst[I2CPE_ERR_PRST_ARRAY_SIZE] = { 0 }; - #endif - - public: - void init(const uint8_t address, const AxisEnum axis); - void reset(); - - void update(); - - void set_homed(); - - int32_t get_raw_count(); - - FORCE_INLINE float mm_from_count(const int32_t count) { - switch (type) { - default: return -1; - case I2CPE_ENC_TYPE_LINEAR: - return count / encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (count * stepperTicks) / (encoderTicksPerUnit * planner.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); } - FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; } - - int32_t get_axis_error_steps(const bool report); - float get_axis_error_mm(const bool report); - - void calibrate_steps_mm(const uint8_t iter); - - bool passes_test(const bool report); - - bool test_axis(void); - - FORCE_INLINE int get_error_count(void) { 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 void set_active(const bool a) { active = a; } - - FORCE_INLINE void set_inverted(const bool i) { invert = i; } - - FORCE_INLINE AxisEnum get_axis() { return encoderAxis; } - - FORCE_INLINE bool get_ec_enabled() { return ec; } - FORCE_INLINE void set_ec_enabled(const bool enabled) { ec = enabled; } - - FORCE_INLINE uint8_t get_ec_method() { return ecMethod; } - FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; } - - FORCE_INLINE float get_ec_threshold() { return ecThreshold; } - FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; } - - FORCE_INLINE int get_encoder_ticks_mm() { - switch (type) { - default: return 0; - case I2CPE_ENC_TYPE_LINEAR: - return encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (int)((encoderTicksPerUnit / stepperTicks) * planner.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE int get_ticks_unit() { return encoderTicksPerUnit; } - FORCE_INLINE void set_ticks_unit(const int ticks) { encoderTicksPerUnit = ticks; } - - FORCE_INLINE uint8_t get_type() { return type; } - FORCE_INLINE void set_type(const byte newType) { type = newType; } - - FORCE_INLINE int get_stepper_ticks() { return stepperTicks; } - FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; } - }; - - class I2CPositionEncodersMgr { - private: - static bool I2CPE_anyaxis; - static uint8_t I2CPE_addr, I2CPE_idx; - - public: - - static void init(void); - - // 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 homed(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) encoders[i].set_homed(); - } - - static void report_position(const int8_t idx, const bool units, const bool noOffset); - - static void report_status(const int8_t idx) { - CHECK_IDX(); - SERIAL_ECHOPAIR("Encoder ",idx); - SERIAL_ECHOPGM(": "); - encoders[idx].get_raw_count(); - encoders[idx].passes_test(true); - } - - static void report_error(const int8_t idx) { - CHECK_IDX(); - encoders[idx].get_axis_error_steps(true); - } - - static void test_axis(const int8_t idx) { - CHECK_IDX(); - encoders[idx].test_axis(); - } - - static void calibrate_steps_mm(const int8_t idx, const int iterations) { - CHECK_IDX(); - encoders[idx].calibrate_steps_mm(iterations); - } - - static void change_module_address(const uint8_t oldaddr, const uint8_t newaddr); - static void report_module_firmware(const uint8_t address); - - static void report_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]); - SERIAL_ECHOLNPAIR(" axis is ", encoders[idx].get_error_count()); - } - - static void reset_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_error_count(0); - SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]); - SERIAL_ECHOLNPGM(" axis has been reset."); - } - - static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_ec_enabled(enabled); - SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - SERIAL_ECHOPGM(" axis is "); - serialprintPGM(encoders[idx].get_ec_enabled() ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOLNPGM("abled."); - } - - static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_ec_threshold(newThreshold); - SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis set to ", newThreshold); - SERIAL_ECHOLNPGM("mm."); - } - - static void get_ec_threshold(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - const float threshold = encoders[idx].get_ec_threshold(); - SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis is ", threshold); - SERIAL_ECHOLNPGM("mm."); - } - - static int8_t idx_from_axis(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) return i; - return -1; - } - - static int8_t idx_from_addr(const uint8_t addr) { - LOOP_PE(i) - if (encoders[i].get_address() == addr) return i; - return -1; - } - - static int8_t parse(); - - static void M860(); - static void M861(); - static void M862(); - static void M863(); - static void M864(); - static void M865(); - static void M866(); - static void M867(); - static void M868(); - static void M869(); - - static I2CPositionEncoder encoders[I2CPE_ENCODER_CNT]; - }; - - extern I2CPositionEncodersMgr I2CPEM; - - FORCE_INLINE static void gcode_M860() { I2CPEM.M860(); } - FORCE_INLINE static void gcode_M861() { I2CPEM.M861(); } - FORCE_INLINE static void gcode_M862() { I2CPEM.M862(); } - FORCE_INLINE static void gcode_M863() { I2CPEM.M863(); } - FORCE_INLINE static void gcode_M864() { I2CPEM.M864(); } - FORCE_INLINE static void gcode_M865() { I2CPEM.M865(); } - FORCE_INLINE static void gcode_M866() { I2CPEM.M866(); } - FORCE_INLINE static void gcode_M867() { I2CPEM.M867(); } - FORCE_INLINE static void gcode_M868() { I2CPEM.M868(); } - FORCE_INLINE static void gcode_M869() { I2CPEM.M869(); } - -#endif //I2C_POSITION_ENCODERS -#endif //I2CPOSENC_H diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp deleted file mode 100644 index 9680908dc5..0000000000 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * M100 Free Memory Watcher - * - * This code watches the free memory block between the bottom of the heap and the top of the stack. - * This memory block is initialized and watched via the M100 command. - * - * M100 I Initializes the free memory block and prints vitals statistics about the area - * - * M100 F Identifies how much of the free memory block remains free and unused. It also - * detects and reports any corruption within the free memory block that may have - * happened due to errant firmware. - * - * M100 D Does a hex display of the free memory block along with a flag for any errant - * data that does not match the expected value. - * - * M100 C x Corrupts x locations within the free memory block. This is useful to check the - * correctness of the M100 F and M100 D commands. - * - * Also, there are two support functions that can be called from a developer's C code. - * - * uint16_t check_for_free_memory_corruption(const char * const ptr); - * void M100_dump_routine(const char * const title, const char *start, const char *end); - * - * Initial version by Roxy-3D - */ - -#include "MarlinConfig.h" - -#if ENABLED(M100_FREE_MEMORY_WATCHER) - -#define M100_FREE_MEMORY_DUMPER // Enable for the `M100 D` Dump sub-command -#define M100_FREE_MEMORY_CORRUPTOR // Enable for the `M100 C` Corrupt sub-command - -#include "Marlin.h" -#include "parser.h" -#include "hex_print_routines.h" - -#define TEST_BYTE ((char) 0xE5) - -extern char* __brkval; -extern size_t __heap_start, __heap_end, __flp; -extern char __bss_end; - -// -// Utility functions -// - -#define END_OF_HEAP() (__brkval ? __brkval : &__bss_end) -int check_for_free_memory_corruption(const char * const title); - -// Location of a variable on its stack frame. Returns a value above -// the stack (once the function returns to the caller). -char* top_of_stack() { - char x; - return &x + 1; // x is pulled on return; -} - -// Count the number of test bytes at the specified location. -int16_t count_test_bytes(const char * const ptr) { - for (uint16_t i = 0; i < 32000; i++) - if (((char) ptr[i]) != TEST_BYTE) - return i - 1; - - return -1; -} - -// -// M100 sub-commands -// - -#if ENABLED(M100_FREE_MEMORY_DUMPER) - /** - * M100 D - * Dump the free memory block from __brkval to the stack pointer. - * malloc() eats memory from the start of the block and the stack grows - * up from the bottom of the block. Solid test bytes indicate nothing has - * used that memory yet. There should not be anything but test bytes within - * the block. If so, it may indicate memory corruption due to a bad pointer. - * Unexpected bytes are flagged in the right column. - */ - void dump_free_memory(const char *ptr, const char *sp) { - // - // Start and end the dump on a nice 16 byte boundary - // (even though the values are not 16-byte aligned). - // - ptr = (char *)((uint16_t)ptr & 0xFFF0); // Align to 16-byte boundary - sp = (char *)((uint16_t)sp | 0x000F); // Align sp to the 15th byte (at or above sp) - - // Dump command main loop - while (ptr < sp) { - print_hex_word((uint16_t)ptr); // Print the address - SERIAL_CHAR(':'); - for (uint8_t i = 0; i < 16; i++) { // and 16 data bytes - if (i == 8) SERIAL_CHAR('-'); - print_hex_byte(ptr[i]); - SERIAL_CHAR(' '); - } - safe_delay(25); - SERIAL_CHAR('|'); // Point out non test bytes - for (uint8_t i = 0; i < 16; i++) { - char ccc = (char)ptr[i]; // cast to char before automatically casting to char on assignment, in case the compiler is broken - if (&ptr[i] >= (const char*)command_queue && &ptr[i] < (const char*)(command_queue + sizeof(command_queue))) { // Print out ASCII in the command buffer area - if (!WITHIN(ccc, ' ', 0x7E)) ccc = ' '; - } - else { // If not in the command buffer area, flag bytes that don't match the test byte - ccc = (ccc == TEST_BYTE) ? ' ' : '?'; - } - SERIAL_CHAR(ccc); - } - SERIAL_EOL(); - ptr += 16; - safe_delay(25); - idle(); - } - } - -void M100_dump_routine(const char * const title, const char *start, const char *end) { - SERIAL_ECHOLN(title); - // - // Round the start and end locations to produce full lines of output - // - start = (char*)((uint16_t) start & 0xFFF0); - end = (char*)((uint16_t) end | 0x000F); - dump_free_memory(start, end); -} - -#endif // M100_FREE_MEMORY_DUMPER - -/** - * M100 F - * Return the number of free bytes in the memory pool, - * with other vital statistics defining the pool. - */ -void free_memory_pool_report(char * const ptr, const int16_t size) { - int16_t max_cnt = -1, block_cnt = 0; - char *max_addr = NULL; - // Find the longest block of test bytes in the buffer - for (int16_t i = 0; i < size; i++) { - char *addr = ptr + i; - if (*addr == TEST_BYTE) { - const int16_t j = count_test_bytes(addr); - if (j > 8) { - SERIAL_ECHOPAIR("Found ", j); - SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr)); - if (j > max_cnt) { - max_cnt = j; - max_addr = addr; - } - i += j; - block_cnt++; - } - } - } - if (block_cnt > 1) { - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - SERIAL_ECHOPAIR("\nLargest free block is ", max_cnt); - SERIAL_ECHOLNPAIR(" bytes at ", hex_address(max_addr)); - } - SERIAL_ECHOLNPAIR("check_for_free_memory_corruption() = ", check_for_free_memory_corruption("M100 F ")); -} - -#if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - /** - * M100 C - * Corrupt locations in the free memory pool and report the corrupt addresses. - * This is useful to check the correctness of the M100 D and the M100 F commands. - */ - void corrupt_free_memory(char *ptr, const uint16_t size) { - ptr += 8; - const uint16_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack. - j = near_top / (size + 1); - - SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); - for (uint16_t i = 1; i <= size; i++) { - char * const addr = ptr + i * j; - *addr = i; - SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr)); - } - SERIAL_EOL(); - } -#endif // M100_FREE_MEMORY_CORRUPTOR - -/** - * M100 I - * Init memory for the M100 tests. (Automatically applied on the first M100.) - */ -void init_free_memory(char *ptr, int16_t size) { - SERIAL_ECHOLNPGM("Initializing free memory block.\n\n"); - - size -= 250; // -250 to avoid interrupt activity that's altered the stack. - if (size < 0) { - SERIAL_ECHOLNPGM("Unable to initialize.\n"); - return; - } - - ptr += 8; // move a few bytes away from the heap just because we don't want - // to be altering memory that close to it. - memset(ptr, TEST_BYTE, size); - - SERIAL_ECHO(size); - SERIAL_ECHOLNPGM(" bytes of memory initialized.\n"); - - for (int16_t i = 0; i < size; i++) { - if (ptr[i] != TEST_BYTE) { - SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i)); - SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i])); - SERIAL_EOL(); - } - } -} - -/** - * M100: Free Memory Check - */ -void gcode_M100() { - SERIAL_ECHOPAIR("\n__brkval : ", hex_address(__brkval)); - SERIAL_ECHOPAIR("\n__bss_end : ", hex_address(&__bss_end)); - - char *ptr = END_OF_HEAP(), *sp = top_of_stack(); - - SERIAL_ECHOPAIR("\nstart of free space : ", hex_address(ptr)); - SERIAL_ECHOLNPAIR("\nStack Pointer : ", hex_address(sp)); - - // Always init on the first invocation of M100 - static bool m100_not_initialized = true; - if (m100_not_initialized || parser.seen('I')) { - m100_not_initialized = false; - init_free_memory(ptr, sp - ptr); - } - - #if ENABLED(M100_FREE_MEMORY_DUMPER) - if (parser.seen('D')) - return dump_free_memory(ptr, sp); - #endif - - if (parser.seen('F')) - return free_memory_pool_report(ptr, sp - ptr); - - #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - - if (parser.seen('C')) - return corrupt_free_memory(ptr, parser.value_int()); - - #endif -} - -int check_for_free_memory_corruption(const char * const title) { - SERIAL_ECHO(title); - - char *ptr = END_OF_HEAP(), *sp = top_of_stack(); - int n = sp - ptr; - - SERIAL_ECHOPAIR("\nfmc() n=", n); - SERIAL_ECHOPAIR("\n&__brkval: ", hex_address(&__brkval)); - SERIAL_ECHOPAIR("=", hex_address(__brkval)); - SERIAL_ECHOPAIR("\n__bss_end: ", hex_address(&__bss_end)); - SERIAL_ECHOPAIR(" sp=", hex_address(sp)); - - if (sp < ptr) { - SERIAL_ECHOPGM(" sp < Heap "); - // SET_INPUT_PULLUP(63); // if the developer has a switch wired up to their controller board - // safe_delay(5); // this code can be enabled to pause the display as soon as the - // while ( READ(63)) // malfunction is detected. It is currently defaulting to a switch - // idle(); // being on pin-63 which is unassigend and available on most controller - // safe_delay(20); // boards. - // while ( !READ(63)) - // idle(); - safe_delay(20); - #ifdef M100_FREE_MEMORY_DUMPER - M100_dump_routine(" Memory corruption detected with sp 8) { - // SERIAL_ECHOPAIR("Found ", j); - // SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(ptr + i)); - i += j; - block_cnt++; - SERIAL_ECHOPAIR(" (", block_cnt); - SERIAL_ECHOPAIR(") found=", j); - SERIAL_ECHOPGM(" "); - } - } - } - SERIAL_ECHOPAIR(" block_found=", block_cnt); - - if (block_cnt != 1 || __brkval != 0x0000) - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - - if (block_cnt == 0) // Make sure the special case of no free blocks shows up as an - block_cnt = -1; // error to the calling code! - - SERIAL_ECHOPGM(" return="); - if (block_cnt == 1) { - SERIAL_CHAR('0'); // if the block_cnt is 1, nothing has broken up the free memory - SERIAL_EOL(); // area and it is appropriate to say 'no corruption'. - return 0; - } - SERIAL_ECHOLNPGM("true"); - return block_cnt; -} - -#endif // M100_FREE_MEMORY_WATCHER - - diff --git a/Marlin/Makefile b/Marlin/Makefile deleted file mode 100644 index 68fd055ab1..0000000000 --- a/Marlin/Makefile +++ /dev/null @@ -1,686 +0,0 @@ -# Marlin Firmware Arduino Project Makefile -# -# Makefile Based on: -# Arduino 0011 Makefile -# Arduino adaptation by mellis, eighthave, oli.keller -# Marlin adaption by Daid -# -# This has been tested with Arduino 0022. -# -# This makefile allows you to build sketches from the command line -# without the Arduino environment (or Java). -# -# Detailed instructions for using the makefile: -# -# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that -# contains the Arduino installation (for example, under Mac OS X, this -# might be /Applications/Arduino.app/Contents/Resources/Java). -# -# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename -# representing the USB or serial connection to your Arduino board -# (e.g. UPLOAD_PORT = /dev/tty.USB0). If the exact name of this file -# changes, you can use * as a wild card (e.g. UPLOAD_PORT = /dev/tty.usb*). -# -# 3. Set the line containing "MCU" to match your board's processor. -# Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth -# or Diecimila have the atmega168. If you're using a LilyPad Arduino, -# change F_CPU to 8000000. If you are using Gen7 electronics, you -# probably need to use 20000000. Either way, you must regenerate -# the speed lookup table with create_speed_lookuptable.py. -# -# 4. Type "make" and press enter to compile/verify your program. -# -# 5. Type "make upload", reset your Arduino board, and press enter to -# upload your program to the Arduino board. -# -# Note that all settings at the top of this file can be overriden from -# the command line with, for example, "make HARDWARE_MOTHERBOARD=71" -# -# To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino -# -# To compile and upload simply add "upload" to the end of the line... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino upload -# -# If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or -# start upload manually (using stk500) like so: -# -# avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \ -# -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0 -# -# Or, try disconnecting USB to power down and then reconnecting before running avrdude. -# - -# This defines the board to compile for (see boards.h for your board's ID) -HARDWARE_MOTHERBOARD ?= 11 - -# Arduino source install directory, and version number -# On most linuxes this will be /usr/share/arduino -ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino -ARDUINO_VERSION ?= 106 - -# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin) -AVR_TOOLS_PATH ?= - -#Programmer configuration -UPLOAD_RATE ?= 57600 -AVRDUDE_PROGRAMMER ?= arduino -# on most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1 -UPLOAD_PORT ?= /dev/ttyUSB0 - -#Directory used to build files in, contains all the build files, from object files to the final hex file -#on linux it is best to put an absolute path like /home/username/tmp . -BUILD_DIR ?= applet - -# This defines whether Liquid_TWI2 support will be built -LIQUID_TWI2 ?= 0 - -# this defines if Wire is needed -WIRE ?= 0 - -# this defines if U8GLIB is needed (may require RELOC_WORKAROUND) -U8GLIB ?= 1 - -# this defines whether to add a workaround for the avr-gcc relocation bug -# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround -RELOC_WORKAROUND ?= 1 - -############################################################################ -# Below here nothing should be changed... - -# Here the Arduino variant is selected by the board type -# HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ... -# MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ... - -ifeq ($(HARDWARE_MOTHERBOARD),0) - - # No motherboard selected - -# -# RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -# - -# MEGA/RAMPS up to 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),3) - -# RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),33) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),34) -# RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),35) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),36) -# RAMPS 1.3 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),38) - -# RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),43) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),44) -# RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),45) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),46) -# RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),48) - -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),143) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),144) -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),145) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),146) -# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),148) - -# -# RAMPS Derivatives - ATmega1280, ATmega2560 -# - -# 3Drag Controller -else ifeq ($(HARDWARE_MOTHERBOARD),77) -# Velleman K8200 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),78) -# Velleman K8400 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),79) -# 2PrintBeta BAM&DICE with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),401) -# 2PrintBeta BAM&DICE Due with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),402) -# MKS BASE v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),40) -# MKS v1.5 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),405) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),41) -# MKS GEN v1.3 or 1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),47) -# MKS GEN L -else ifeq ($(HARDWARE_MOTHERBOARD),53) -# zrib V2.0 control board (Chinese knock off RAMPS replica) -else ifeq ($(HARDWARE_MOTHERBOARD),504) -# Felix 2.0+ Electronics Board (RAMPS like) -else ifeq ($(HARDWARE_MOTHERBOARD),37) -# Invent-A-Part RigidBoard -else ifeq ($(HARDWARE_MOTHERBOARD),42) -# Invent-A-Part RigidBoard V2 -else ifeq ($(HARDWARE_MOTHERBOARD),52) -# Sainsmart 2-in-1 board -else ifeq ($(HARDWARE_MOTHERBOARD),49) -# Ultimaker -else ifeq ($(HARDWARE_MOTHERBOARD),7) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) -else ifeq ($(HARDWARE_MOTHERBOARD),71) -MCU ?= atmega1280 -# Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),67) -# Azteeg X3 Pro -else ifeq ($(HARDWARE_MOTHERBOARD),68) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) -else ifeq ($(HARDWARE_MOTHERBOARD),72) -# Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),80) -# bq ZUM Mega 3D -else ifeq ($(HARDWARE_MOTHERBOARD),503) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake -else ifeq ($(HARDWARE_MOTHERBOARD),431) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),343) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),443) -# Creality: Ender-4, CR-8 -else ifeq ($(HARDWARE_MOTHERBOARD),243) - -# -# Other ATmega1280, ATmega2560 -# - -# Cartesio CN Controls V11 -else ifeq ($(HARDWARE_MOTHERBOARD),111) -# Cartesio CN Controls V12 -else ifeq ($(HARDWARE_MOTHERBOARD),112) -# Cheaptronic v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),2) -# Cheaptronic v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Makerbot Mightyboard Revision E -else ifeq ($(HARDWARE_MOTHERBOARD),200) -# Megatronics -else ifeq ($(HARDWARE_MOTHERBOARD),70) -# Megatronics v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),701) -# Megatronics v3.0 -else ifeq ($(HARDWARE_MOTHERBOARD),703) -# Megatronics v3.1 -else ifeq ($(HARDWARE_MOTHERBOARD),704) -# Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),301) -# Mini-Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),302) -# Mini-Rambo 1.0a -else ifeq ($(HARDWARE_MOTHERBOARD),303) -# Einsy Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),304) -# Einsy Retro -else ifeq ($(HARDWARE_MOTHERBOARD),305) -# Elefu Ra Board (v3) -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Leapfrog -else ifeq ($(HARDWARE_MOTHERBOARD),999) -# Mega controller -else ifeq ($(HARDWARE_MOTHERBOARD),310) -# abee Scoovo X9H -else ifeq ($(HARDWARE_MOTHERBOARD),321) -# Geeetech GT2560 Rev. A -else ifeq ($(HARDWARE_MOTHERBOARD),74) -# Geeetech GT2560 Rev. A+ (with auto level probe) -else ifeq ($(HARDWARE_MOTHERBOARD),75) - -# -# ATmega1281, ATmega2561 -# - -else ifeq ($(HARDWARE_MOTHERBOARD),702) -MCU ?= atmega1281 -else ifeq ($(HARDWARE_MOTHERBOARD),25) -MCU ?= atmega1281 - -# -# Sanguinololu and Derivatives - ATmega644P, ATmega1284P -# - -# Sanguinololu < 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),6) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Sanguinololu 1.2 and above -else ifeq ($(HARDWARE_MOTHERBOARD),62) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi -else ifeq ($(HARDWARE_MOTHERBOARD),63) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi with ATmega1284 (MaKr3d version) -else ifeq ($(HARDWARE_MOTHERBOARD),66) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Creality3D board (for CR-10 etc) -else ifeq ($(HARDWARE_MOTHERBOARD),89) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Malyan M150 board -else ifeq ($(HARDWARE_MOTHERBOARD),92) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Tronxy X5S -else ifeq ($(HARDWARE_MOTHERBOARD),505) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# STB V1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),64) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Azteeg X1 -else ifeq ($(HARDWARE_MOTHERBOARD),65) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Anet 1.0 (Melzi clone) -else ifeq ($(HARDWARE_MOTHERBOARD),69) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p - -# -# Other ATmega644P, ATmega644, ATmega1284P -# - -# Gen3 Monolithic Electronics -else ifeq ($(HARDWARE_MOTHERBOARD),22) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen3+ -else ifeq ($(HARDWARE_MOTHERBOARD),9) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen6 -else ifeq ($(HARDWARE_MOTHERBOARD),5) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen6 deluxe -else ifeq ($(HARDWARE_MOTHERBOARD),51) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen7 custom (Alfons3 Version) -else ifeq ($(HARDWARE_MOTHERBOARD),10) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644 -F_CPU ?= 20000000 -# Gen7 v1.1, v1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),11) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 -# Gen7 v1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),12) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 -# Gen7 v1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),13) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega1284p -F_CPU ?= 20000000 -# Alpha OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),90) -HARDWARE_VARIANT ?= SanguinoA -MCU ?= atmega644 -# Final OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),91) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Sethi 3D_1 -else ifeq ($(HARDWARE_MOTHERBOARD),20) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p - -# -# Teensyduino - AT90USB1286, AT90USB1286P -# - -# Teensylu -else ifeq ($(HARDWARE_MOTHERBOARD),8) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Printrboard (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),81) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Printrboard Revision F (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),811) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Brainwave (AT90USB646) -else ifeq ($(HARDWARE_MOTHERBOARD),82) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb646 -# Brainwave Pro (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),83) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# SAV Mk-I (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),84) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make -else ifeq ($(HARDWARE_MOTHERBOARD),85) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# 5DPrint D8 Driver Board -else ifeq ($(HARDWARE_MOTHERBOARD),88) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 - -endif - -# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py -# if you are setting this to something other than 16MHz -# Set to 16Mhz if not yet set. -F_CPU ?= 16000000 - -# Set to arduino, ATmega2560 if not yet set. -HARDWARE_VARIANT ?= arduino -MCU ?= atmega2560 - -# Arduino contained the main source code for the Arduino -# Libraries, the "hardware variant" are for boards -# that derives from that, and their source are present in -# the main Marlin source directory - -TARGET = $(notdir $(CURDIR)) - -# VPATH tells make to look into these directory for source files, -# there is no need to specify explicit pathnames as long as the -# directory is added here - -VPATH = . -VPATH += $(BUILD_DIR) -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino - -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src -ifeq ($(LIQUID_TWI2), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2 -endif -ifeq ($(WIRE), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -endif -ifeq ($(NEOPIXEL), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel -endif -ifeq ($(U8GLIB), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility -endif - -ifeq ($(HARDWARE_VARIANT), arduino) -HARDWARE_SUB_VARIANT ?= mega -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT) -else -ifeq ($(HARDWARE_VARIANT), Sanguino) -VPATH += $(HARDWARE_DIR)/marlin/avr/variants/sanguino -else -HARDWARE_SUB_VARIANT ?= standard -VPATH += $(HARDWARE_DIR)/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT) -endif -endif -SRC = wiring.c \ - wiring_analog.c wiring_digital.c \ - wiring_pulse.c \ - wiring_shift.c WInterrupts.c hooks.c -ifeq ($(HARDWARE_VARIANT), Teensy) -SRC = wiring.c -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy -endif -CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp Tone.cpp -CXXSRC += $(wildcard *.cpp) -ifeq ($(NEOPIXEL), 1) -CXXSRC += Adafruit_NeoPixel.cpp -endif -ifeq ($(LIQUID_TWI2), 0) -CXXSRC += LiquidCrystal.cpp -else -SRC += twi.c -CXXSRC += Wire.cpp LiquidTWI2.cpp -endif - -ifeq ($(WIRE), 1) -SRC += twi.c -CXXSRC += Wire.cpp -endif - -ifeq ($(U8GLIB), 1) -SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_data.c -endif - -ifeq ($(RELOC_WORKAROUND), 1) -LD_PREFIX=-nodefaultlibs -LD_SUFFIX=-lm -lgcc -lc -lgcc -L$(ARDUINO_INSTALL_DIR)/hardware/tools/avr/avr/lib/avr6 -l$(MCU) -endif - -#Check for Arduino 1.0.0 or higher and use the correct source files for that version -ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true) -CXXSRC += main.cpp -else -SRC += pins_arduino.c main.c -endif - -FORMAT = ihex - -# Name of this Makefile (used for "make depend"). -MAKEFILE = Makefile - -# Debugging format. -# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. -# AVR (extended) COFF requires stabs, plus an avr-objcopy run. -DEBUG = stabs - -OPT = s - -DEFINES ?= - -# Program settings -CC = $(AVR_TOOLS_PATH)avr-gcc -CXX = $(AVR_TOOLS_PATH)avr-g++ -OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy -OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump -AR = $(AVR_TOOLS_PATH)avr-ar -SIZE = $(AVR_TOOLS_PATH)avr-size -NM = $(AVR_TOOLS_PATH)avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -MV = mv -f - -# Place -D or -U options here -CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -CXXDEFS = $(CDEFS) - -ifeq ($(HARDWARE_VARIANT), Teensy) -CDEFS += -DUSB_SERIAL -SRC += usb.c pins_teensy.c -CXXSRC += usb_api.cpp -endif - -# Add all the source directories as include directories too -CINCS = ${addprefix -I ,${VPATH}} -CXXINCS = ${addprefix -I ,${VPATH}} - -# Compiler flag to set the C/CPP Standard level. -CSTANDARD = -std=gnu99 -CXXSTANDARD = -std=gnu++11 -CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -w -fsigned-char -funsigned-bitfields -fpack-struct \ - -fshort-enums -ffunction-sections -fdata-sections -flto \ - -DARDUINO=$(ARDUINO_VERSION) -ifneq ($(HARDWARE_MOTHERBOARD),) -CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} -endif -#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics - -CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) $(CSTANDARD) -CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) $(CXXSTANDARD) -#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs -LDFLAGS = -lm - - -# Programming support using avrdude. Settings and variables. -AVRDUDE_PORT = $(UPLOAD_PORT) -AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i -ifeq ($(shell uname -s), Linux) -AVRDUDE_CONF = /etc/avrdude/avrdude.conf -else -AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf -endif -AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \ - -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \ - -b$(UPLOAD_RATE) - -# Define all object files. -OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}} -OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}} -OBJ += ${patsubst %.S, $(BUILD_DIR)/%.o, ${ASRC}} - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(CXXSRC:.cpp=.lst) $(SRC:.c=.lst) - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) -ALL_CXXFLAGS = -mmcu=$(MCU) $(CXXFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) - -# set V=1 (eg, "make V=1") to print the full commands etc. -ifneq ($V,1) - Pecho=@echo - P=@ -else - Pecho=@: - P= -endif - -# Default target. -all: sizeafter - -build: $(BUILD_DIR) elf hex - -# Creates the object directory -$(BUILD_DIR): - $P mkdir -p $(BUILD_DIR) - -elf: $(BUILD_DIR)/$(TARGET).elf -hex: $(BUILD_DIR)/$(TARGET).hex -eep: $(BUILD_DIR)/$(TARGET).eep -lss: $(BUILD_DIR)/$(TARGET).lss -sym: $(BUILD_DIR)/$(TARGET).sym - -# Program the device. -# Do not try to reset an Arduino if it's not one -upload: $(BUILD_DIR)/$(TARGET).hex -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty hup < $(UPLOAD_PORT); true -endif - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty -hup < $(UPLOAD_PORT); true -endif - - # Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex -ELFSIZE = $(SIZE) --mcu=$(MCU) -C $(BUILD_DIR)/$(TARGET).elf; \ - $(SIZE) $(BUILD_DIR)/$(TARGET).elf -sizebefore: - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi - -sizeafter: build - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ - --change-section-address .data-0x800000 \ - --change-section-address .bss-0x800000 \ - --change-section-address .noinit-0x800000 \ - --change-section-address .eeprom-0x810000 - - -coff: $(BUILD_DIR)/$(TARGET).elf - $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -extcoff: $(TARGET).elf - $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -.SUFFIXES: .elf .hex .eep .lss .sym -.PRECIOUS: .o - -.elf.hex: - $(Pecho) " COPY $@" - $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -.elf.eep: - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -.elf.lss: - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -.elf.sym: - $(NM) -n $< > $@ - - # Link: create ELF output file from library. -$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h - $(Pecho) " CXX $@" - $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) - -$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ - - -# Target: clean project. -clean: - $(Pecho) " RM $(BUILD_DIR)/*" - $P $(REMOVE) $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET).cof $(BUILD_DIR)/$(TARGET).elf \ - $(BUILD_DIR)/$(TARGET).map $(BUILD_DIR)/$(TARGET).sym $(BUILD_DIR)/$(TARGET).lss $(BUILD_DIR)/$(TARGET).cpp \ - $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d) - $(Pecho) " RMDIR $(BUILD_DIR)/" - $P rm -rf $(BUILD_DIR) - - -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter - -# Automaticaly include the dependency files created by gcc --include ${wildcard $(BUILD_DIR)/*.d} diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h deleted file mode 100644 index 1394c687a3..0000000000 --- a/Marlin/Marlin.h +++ /dev/null @@ -1,559 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifndef MARLIN_H -#define MARLIN_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "MarlinConfig.h" - -#ifdef DEBUG_GCODE_PARSER - #include "parser.h" -#endif - -#include "enum.h" -#include "types.h" -#include "fastio.h" -#include "utility.h" -#include "serial.h" - -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout - #endif -); - -void manage_inactivity(const bool ignore_stepper_queue=false); - -extern const char axis_codes[XYZE]; - -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - extern bool extruder_duplication_enabled; -#endif - -#if HAS_X2_ENABLE - #define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#elif HAS_X_ENABLE - #define enable_X() X_ENABLE_WRITE( X_ENABLE_ON) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#else - #define enable_X() NOOP - #define disable_X() NOOP -#endif - -#if HAS_Y2_ENABLE - #define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#elif HAS_Y_ENABLE - #define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#else - #define enable_Y() NOOP - #define disable_Y() NOOP -#endif - -#if HAS_Z2_ENABLE - #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#elif HAS_Z_ENABLE - #define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#else - #define enable_Z() NOOP - #define disable_Z() NOOP -#endif - -#if ENABLED(MIXING_EXTRUDER) - - /** - * Mixing steppers synchronize their enable (and direction) together - */ - #if MIXING_STEPPERS > 4 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 3 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 2 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } - #else - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } - #endif - #define enable_E1() NOOP - #define disable_E1() NOOP - #define enable_E2() NOOP - #define disable_E2() NOOP - #define enable_E3() NOOP - #define disable_E3() NOOP - #define enable_E4() NOOP - #define disable_E4() NOOP - -#else // !MIXING_EXTRUDER - - #if HAS_E0_ENABLE - #define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E0() NOOP - #define disable_E0() NOOP - #endif - - #if E_STEPPERS > 1 && HAS_E1_ENABLE - #define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E1() NOOP - #define disable_E1() NOOP - #endif - - #if E_STEPPERS > 2 && HAS_E2_ENABLE - #define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E2() NOOP - #define disable_E2() NOOP - #endif - - #if E_STEPPERS > 3 && HAS_E3_ENABLE - #define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E3() NOOP - #define disable_E3() NOOP - #endif - - #if E_STEPPERS > 4 && HAS_E4_ENABLE - #define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E4() NOOP - #define disable_E4() NOOP - #endif - -#endif // !MIXING_EXTRUDER - -#if ENABLED(G38_PROBE_TARGET) - extern bool G38_move, // flag to tell the interrupt handler that a G38 command is being run - G38_endstop_hit; // flag from the interrupt handler to indicate if the endstop went active -#endif - -void enable_all_steppers(); -void disable_e_stepper(const uint8_t e); -void disable_e_steppers(); -void disable_all_steppers(); - -void sync_plan_position(); -void sync_plan_position_e(); - -#if IS_KINEMATIC - void sync_plan_position_kinematic(); - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_kinematic() -#else - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position() -#endif - -void flush_and_request_resend(); -void ok_to_send(); - -void kill(const char*); - -void quickstop_stepper(); - -extern uint8_t marlin_debug_flags; -#define DEBUGGING(F) (marlin_debug_flags & (DEBUG_## F)) - -extern bool Running; -inline bool IsRunning() { return Running; } -inline bool IsStopped() { return !Running; } - -bool enqueue_and_echo_command(const char* cmd); // Add a single command to the end of the buffer. Return false on failure. -void enqueue_and_echo_commands_P(const char * const cmd); // Set one or more commands to be prioritized over the next Serial/SD command. -void clear_command_queue(); - -#if ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(POWER_LOSS_RECOVERY) - extern char command_queue[BUFSIZE][MAX_CMD_SIZE]; -#endif - -#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))) -#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW) -#if HAS_QUEUE_NOW - // Return only when commands are actually enqueued - void enqueue_and_echo_command_now(const char* cmd); - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const cmd); - #endif -#endif - -extern millis_t previous_move_ms; -inline void reset_stepper_timeout() { previous_move_ms = millis(); } - -/** - * Feedrate scaling and conversion - */ -extern float feedrate_mm_s; -extern int16_t feedrate_percentage; - -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) - -extern bool axis_relative_modes[XYZE]; - -extern uint8_t axis_homed, axis_known_position; - -constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); -FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; } -FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; } - -extern volatile bool wait_for_heatup; - -#if HAS_RESUME_CONTINUE - extern volatile bool wait_for_user; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - extern bool suspend_auto_report; -#endif - -extern float current_position[XYZE], destination[XYZE]; - -/** - * Workspace offsets - */ -#if HAS_WORKSPACE_OFFSET - #if HAS_HOME_OFFSET - extern float home_offset[XYZ]; - #endif - #if HAS_POSITION_SHIFT - extern float position_shift[XYZ]; - #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - extern float workspace_offset[XYZ]; - #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS] - #elif HAS_HOME_OFFSET - #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS] - #elif HAS_POSITION_SHIFT - #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS] - #endif - #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS)) - #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS)) -#else - #define NATIVE_TO_LOGICAL(POS, AXIS) (POS) - #define LOGICAL_TO_NATIVE(POS, AXIS) (POS) -#endif -#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) -#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) -#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) -#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS) -#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS) -#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) - -// Hotend Offsets -#if HOTENDS > 1 - extern float hotend_offset[XYZ][HOTENDS]; -#endif - -// Software Endstops -extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ]; - -#if HAS_SOFTWARE_ENDSTOPS - extern bool soft_endstops_enabled; - void clamp_to_software_endstops(float target[XYZ]); -#else - #define soft_endstops_enabled false - #define clamp_to_software_endstops(x) NOOP -#endif - -#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) - void update_software_endstops(const AxisEnum axis); -#endif - -#define MAX_COORDINATE_SYSTEMS 9 -#if ENABLED(CNC_COORDINATE_SYSTEMS) - extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; - bool select_coordinate_system(const int8_t _new); -#endif - -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false); - -void home_all_axes(); - -void report_current_position(); - -#if IS_KINEMATIC - extern float delta[ABC]; - void inverse_kinematics(const float raw[XYZ]); -#endif - -#if ENABLED(DELTA) - extern float delta_height, - delta_endstop_adj[ABC], - delta_radius, - delta_tower_angle_trim[ABC], - delta_tower[ABC][2], - delta_diagonal_rod, - delta_calibration_radius, - delta_diagonal_rod_2_tower[ABC], - delta_segments_per_second, - delta_clip_start_height; - - void recalc_delta_settings(); - float delta_safe_distance_from_top(); - - // Macro to obtain the Z position of an individual tower - #define DELTA_Z(V,T) V[Z_AXIS] + SQRT( \ - delta_diagonal_rod_2_tower[T] - HYPOT2( \ - delta_tower[T][X_AXIS] - V[X_AXIS], \ - delta_tower[T][Y_AXIS] - V[Y_AXIS] \ - ) \ - ) - - #define DELTA_IK(V) do { \ - delta[A_AXIS] = DELTA_Z(V, A_AXIS); \ - delta[B_AXIS] = DELTA_Z(V, B_AXIS); \ - delta[C_AXIS] = DELTA_Z(V, C_AXIS); \ - }while(0) - -#elif IS_SCARA - void forward_kinematics_SCARA(const float &a, const float &b); -#endif - -#if ENABLED(G26_MESH_VALIDATION) - extern bool g26_debug_flag; -#elif ENABLED(AUTO_BED_LEVELING_UBL) - constexpr bool g26_debug_flag = false; -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #define _GET_MESH_X(I) (bilinear_start[X_AXIS] + (I) * bilinear_grid_spacing[X_AXIS]) - #define _GET_MESH_Y(J) (bilinear_start[Y_AXIS] + (J) * bilinear_grid_spacing[Y_AXIS]) -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #define _GET_MESH_X(I) ubl.mesh_index_to_xpos(I) - #define _GET_MESH_Y(J) ubl.mesh_index_to_ypos(J) -#elif ENABLED(MESH_BED_LEVELING) - #define _GET_MESH_X(I) mbl.index_to_xpos[I] - #define _GET_MESH_Y(J) mbl.index_to_ypos[J] -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - extern int bilinear_grid_spacing[2], bilinear_start[2]; - extern float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - float bilinear_z_offset(const float raw[XYZ]); -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) - typedef float (*element_2d_fn)(const uint8_t, const uint8_t); - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn); -#endif - -#if HAS_LEVELING - bool leveling_is_valid(); - void set_bed_leveling_enabled(const bool enable=true); - void reset_bed_level(); -#endif - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - void set_z_fade_height(const float zfh, const bool do_report=true); -#endif - -#if HAS_BED_PROBE - extern float zprobe_zoffset; - bool set_probe_deployed(const bool deploy); - #ifdef Z_AFTER_PROBING - void move_z_after_probing(); - #endif - enum ProbePtRaise : unsigned char { - PROBE_PT_NONE, // No raise or stow after run_z_probe - PROBE_PT_STOW, // Do a complete stow after run_z_probe - 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); - #define DEPLOY_PROBE() set_probe_deployed(true) - #define STOW_PROBE() set_probe_deployed(false) -#else - #define DEPLOY_PROBE() - #define STOW_PROBE() -#endif - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - extern MarlinBusyState busy_state; - #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0) -#else - #define KEEPALIVE_STATE(n) NOOP -#endif - -#if FAN_COUNT > 0 - extern int16_t fanSpeeds[FAN_COUNT]; - #if ENABLED(EXTRA_FAN_SPEED) - extern int16_t old_fanSpeeds[FAN_COUNT], - new_fanSpeeds[FAN_COUNT]; - #endif - #if ENABLED(PROBING_FANS_OFF) - extern bool fans_paused; - extern int16_t paused_fanSpeeds[FAN_COUNT]; - #endif -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - extern int controllerFanSpeed; -#endif - -#if ENABLED(BARICUDA) - extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure; -#endif - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - extern bool filament_sensor; // Flag that filament sensor readings should control extrusion - extern float filament_width_nominal, // Theoretical filament diameter i.e., 3.00 or 1.75 - filament_width_meas; // Measured filament diameter - extern uint8_t meas_delay_cm; // Delay distance - extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement - filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - extern int8_t did_pause_print; - extern AdvancedPauseMenuResponse advanced_pause_menu_response; - extern float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; -#endif - -#if HAS_POWER_SWITCH - extern bool powersupply_on; - #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); powersupply_on = true; }while(0) - #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); powersupply_on = false; }while(0) -#endif - -// Handling multiple extruders pins -extern uint8_t active_extruder; - -#if ENABLED(MIXING_EXTRUDER) - extern float mixing_factor[MIXING_STEPPERS]; -#endif - -inline void set_current_from_destination() { COPY(current_position, destination); } -inline void set_destination_from_current() { COPY(destination, current_position); } -void prepare_move_to_destination(); - -/** - * 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_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); - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const float(&cart)[XYZE], const float(&offset)[2], const bool clockwise); -#endif - -#define HAS_AXIS_UNHOMED_ERR ( \ - ENABLED(Z_PROBE_ALLEN_KEY) \ - || ENABLED(Z_PROBE_SLED) \ - || HAS_PROBING_PROCEDURE \ - || HOTENDS > 1 \ - || ENABLED(NOZZLE_CLEAN_FEATURE) \ - || ENABLED(NOZZLE_PARK_FEATURE) \ - || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \ - || HAS_M206_COMMAND \ - ) || ENABLED(NO_MOTION_BEFORE_HOMING) - -#if HAS_AXIS_UNHOMED_ERR - bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true); -#endif - -/** - * position_is_reachable family of functions - */ - -#if IS_KINEMATIC // (DELTA or SCARA) - - #if IS_SCARA - extern const float L1, L2; - #endif - - // Return true if the given point is within the printable area - inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) { - #if ENABLED(DELTA) - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset); - #elif IS_SCARA - const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); - #endif - } - - #if HAS_BED_PROBE - // 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)) - && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); - } - #endif - -#else // CARTESIAN - - // Return true if the given position is within the machine bounds. - inline bool position_is_reachable(const float &rx, const float &ry) { - // Add 0.001 margin to deal with float imprecision - return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f) - && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f); - } - - #if HAS_BED_PROBE - /** - * Return whether the given position is within the bed, and whether the nozzle - * can reach the position required to put the probe at the given position. - * - * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the - * 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 - 0.001f, MAX_PROBE_X + 0.001f) - && WITHIN(ry, MIN_PROBE_Y - 0.001f, MAX_PROBE_Y + 0.001f); - } - #endif - -#endif // CARTESIAN - -#if !HAS_BED_PROBE - FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } -#endif - -#endif // MARLIN_H diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino deleted file mode 100644 index 1491c4efd5..0000000000 --- a/Marlin/Marlin.ino +++ /dev/null @@ -1,53 +0,0 @@ -/* -================================================================================ - - Marlin Firmware - - (c) 2011-2018 MarlinFirmware - Portions of Marlin are (c) by their respective authors. - All code complies with GPLv2 and/or GPLv3 - -================================================================================ - -Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware. - -To configure Marlin you must edit Configuration.h and Configuration_adv.h -located in the root 'Marlin' folder. Check the example_configurations folder to -see if there's a more suitable starting-point for your specific hardware. - -Before diving in, we recommend the following essential links: - -Marlin Firmware Official Website - - - http://marlinfw.org/ - The official Marlin Firmware website contains the most up-to-date - documentation. Contributions are always welcome! - -Configuration - - - https://www.youtube.com/watch?v=3gwWVFtdg-4 - A good 20-minute overview of Marlin configuration by Tom Sanladerer. - (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.) - Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin - - - http://marlinfw.org/docs/configuration/configuration.html - Marlin's configuration options are explained in more detail here. - -Getting Help - - - http://forums.reprap.org/list.php?415 - The Marlin Discussion Forum is a great place to get help from other Marlin - users who may have experienced similar issues to your own. - - - https://github.com/MarlinFirmware/Marlin/issues - With a free GitHub account you can provide us with feedback, bug reports, - and feature requests via the Marlin Issue Queue. - -Contributing - - - http://marlinfw.org/docs/development/contributing.html - If you'd like to contribute to Marlin, read this first! - - - http://marlinfw.org/docs/development/coding_standards.html - Before submitting code get to know the Coding Standards. -*/ diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h deleted file mode 100644 index e1988fe637..0000000000 --- a/Marlin/MarlinConfig.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef MARLIN_CONFIG_H -#define MARLIN_CONFIG_H - -#include "boards.h" -#include "macros.h" -#include "Version.h" -#include "Configuration.h" -#include "Conditionals_LCD.h" -#include "drivers.h" -#include "Configuration_adv.h" - -#if USE_MARLINSERIAL - #define HardwareSerial_h // trick to disable the standard HWserial -#endif - -#include "types.h" -#include "HAL.h" -#include "pins.h" -#include "Conditionals_post.h" -#include "SanityCheck.h" -#include "enum.h" -#include "language.h" -#include "utility.h" -#include "serial.h" - -#endif // MARLIN_CONFIG_H diff --git a/Marlin/MarlinSPI.h b/Marlin/MarlinSPI.h deleted file mode 100644 index 61e85fc63c..0000000000 --- a/Marlin/MarlinSPI.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __MARLIN_SPI_H__ -#define __MARLIN_SPI_H__ - -#include -#include "softspi.h" - -template -class SPI { - static SoftSPI softSPI; - public: - FORCE_INLINE static void init() { softSPI.begin(); } - FORCE_INLINE static void send(uint8_t data) { softSPI.send(data); } - FORCE_INLINE static uint8_t receive() { return softSPI.receive(); } -}; - - -// Hardware SPI -template<> -class SPI { - public: - FORCE_INLINE static void init() { - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT(MISO_PIN); - WRITE(MISO_PIN, HIGH); - } - FORCE_INLINE static uint8_t receive() { - SPDR = 0; - while (!TEST(SPSR, SPIF)) { /* nada */ } - return SPDR; - } - -}; - -#endif // __MARLIN_SPI_H__ diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp deleted file mode 100644 index 86d4c440ef..0000000000 --- a/Marlin/MarlinSerial.cpp +++ /dev/null @@ -1,740 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MarlinSerial.cpp - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 23 November 2006 by David A. Mellis - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - * Modified 10 June 2018 by Eduardo José Tagle (See #10991) - */ - -// Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.) - -#include "MarlinConfig.h" - -#if USE_MARLINSERIAL && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) - - #include "MarlinSerial.h" - #include "Marlin.h" - - struct ring_buffer_r { - unsigned char buffer[RX_BUFFER_SIZE]; - volatile ring_buffer_pos_t head, tail; - }; - - #if TX_BUFFER_SIZE > 0 - struct ring_buffer_t { - unsigned char buffer[TX_BUFFER_SIZE]; - volatile uint8_t head, tail; - }; - #endif - - #if UART_PRESENT(SERIAL_PORT) - ring_buffer_r rx_buffer = { { 0 }, 0, 0 }; - #if TX_BUFFER_SIZE > 0 - ring_buffer_t tx_buffer = { { 0 }, 0, 0 }; - #endif - static bool _written; - #endif - - #if ENABLED(SERIAL_XON_XOFF) - constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80, // XON / XOFF Character was sent - XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send - // XON / XOFF character definitions - constexpr uint8_t XON_CHAR = 17, XOFF_CHAR = 19; - uint8_t xon_xoff_state = XON_XOFF_CHAR_SENT | XON_CHAR; - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - uint8_t rx_dropped_bytes = 0; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - uint8_t rx_buffer_overruns = 0; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - uint8_t rx_framing_errors = 0; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - ring_buffer_pos_t rx_max_enqueued = 0; - #endif - - // A SW memory barrier, to ensure GCC does not overoptimize loops - #define sw_barrier() asm volatile("": : :"memory"); - - #if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" - #endif - - // "Atomically" read the RX head index value without disabling interrupts: - // This MUST be called with RX interrupts enabled, and CAN'T be called - // from the RX ISR itself! - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head() { - #if RX_BUFFER_SIZE > 256 - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because serial RX interrupts happen at a slower rate - // than successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - ring_buffer_pos_t vold, vnew = rx_buffer.head; - sw_barrier(); - do { - vold = vnew; - vnew = rx_buffer.head; - sw_barrier(); - } while (vold != vnew); - return vnew; - #else - // With an 8bit index, reads are always atomic. No need for special handling - return rx_buffer.head; - #endif - } - - #if RX_BUFFER_SIZE > 256 - static volatile bool rx_tail_value_not_stable = false; - static volatile uint16_t rx_tail_value_backup = 0; - #endif - - // Set RX tail index, taking into account the RX ISR could interrupt - // the write to this variable in the middle - So a backup strategy - // is used to ensure reads of the correct values. - // -Must NOT be called from the RX ISR - - FORCE_INLINE void atomic_set_rx_tail(ring_buffer_pos_t value) { - #if RX_BUFFER_SIZE > 256 - // Store the new value in the backup - rx_tail_value_backup = value; - sw_barrier(); - // Flag we are about to change the true value - rx_tail_value_not_stable = true; - sw_barrier(); - // Store the new value - rx_buffer.tail = value; - sw_barrier(); - // Signal the new value is completely stored into the value - rx_tail_value_not_stable = false; - sw_barrier(); - #else - rx_buffer.tail = value; - #endif - } - - // Get the RX tail index, taking into account the read could be - // interrupting in the middle of the update of that index value - // -Called from the RX ISR - - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail() { - #if RX_BUFFER_SIZE > 256 - // If the true index is being modified, return the backup value - if (rx_tail_value_not_stable) return rx_tail_value_backup; - #endif - // The true index is stable, return it - return rx_buffer.tail; - } - - // (called with RX interrupts disabled) - FORCE_INLINE void store_rxd_char() { - // Get the tail - Nothing can alter its value while this ISR is executing, but there's - // a chance that this ISR interrupted the main process while it was updating the index. - // The backup mechanism ensures the correct value is always returned. - const ring_buffer_pos_t t = atomic_read_rx_tail(); - - // Get the head pointer - This ISR is the only one that modifies its value, so it's safe to read here - ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // This must read the M_UCSRxA register before reading the received byte to detect error causes - #if ENABLED(SERIAL_STATS_DROPPED_RX) - if (TEST(M_UCSRxA, M_DORx) && !++rx_dropped_bytes) --rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - if (TEST(M_UCSRxA, M_DORx) && !++rx_buffer_overruns) --rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - if (TEST(M_UCSRxA, M_FEx) && !++rx_framing_errors) --rx_framing_errors; - #endif - - // Read the character from the USART - uint8_t c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - // Calculate count of bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Keep track of the maximum count of enqueued bytes - NOLESS(rx_max_enqueued, rx_count); - #endif - - #if ENABLED(SERIAL_XON_XOFF) - // If the last char that was sent was an XON - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) { - - // Bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // If over 12.5% of RX buffer capacity, send XOFF before running out of - // RX buffer space .. 325 bytes @ 250kbits/s needed to let the host react - // and stop sending bytes. This translates to 13mS propagation time. - if (rx_count >= (RX_BUFFER_SIZE) / 8) { - - // At this point, definitely no TX interrupt was executing, since the TX ISR can't be preempted. - // Don't enable the TX interrupt here as a means to trigger the XOFF char, because if it happens - // to be in the middle of trying to disable the RX interrupt in the main program, eventually the - // enabling of the TX interrupt could be undone. The ONLY reliable thing this can do to ensure - // the sending of the XOFF char is to send it HERE AND NOW. - - // About to send the XOFF char - xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; - - // Wait until the TX register becomes empty and send it - Here there could be a problem - // - While waiting for the TX register to empty, the RX register could receive a new - // character. This must also handle that situation! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); - } - - M_UDRx = XOFF_CHAR; - - // Clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - - // At this point there could be a race condition between the write() function - // and this sending of the XOFF char. This interrupt could happen between the - // wait to be empty TX buffer loop and the actual write of the character. Since - // the TX buffer is full because it's sending the XOFF char, the only way to be - // sure the write() function will succeed is to wait for the XOFF char to be - // completely sent. Since an extra character could be received during the wait - // it must also be handled! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); - } - - // At this point everything is ready. The write() function won't - // have any issues writing to the UART TX register if it needs to! - } - } - #endif // SERIAL_XON_XOFF - - // Store the new head value - The main loop will retry until the value is stable - rx_buffer.head = h; - } - - #if TX_BUFFER_SIZE > 0 - - // (called with TX irqs disabled) - FORCE_INLINE void _tx_udr_empty_irq(void) { - - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; - - #if ENABLED(SERIAL_XON_XOFF) - // If an XON char is pending to be sent, do it now - if (xon_xoff_state == XON_CHAR) { - - // Send the character - M_UDRx = XON_CHAR; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - - // Remember we sent it. - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - - // If nothing else to transmit, just disable TX interrupts. - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - - return; - } - #endif - - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - return; - } - - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (TX_BUFFER_SIZE - 1); - M_UDRx = c; - tx_buffer.tail = t; - - // Clear the TXC bit (by writing a one to its bit location). - // Ensures flush() won't return until the bytes are actually written/ - SBI(M_UCSRxA, M_TXCx); - - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - } - - #ifdef M_USARTx_UDRE_vect - ISR(M_USARTx_UDRE_vect) { _tx_udr_empty_irq(); } - #endif - - #endif // TX_BUFFER_SIZE - - #ifdef M_USARTx_RX_vect - ISR(M_USARTx_RX_vect) { store_rxd_char(); } - #endif - - // Public Methods - - void MarlinSerial::begin(const long baud) { - uint16_t baud_setting; - bool useU2X = true; - - #if F_CPU == 16000000UL && SERIAL_PORT == 0 - // Hard-coded exception for compatibility with the bootloader shipped - // with the Duemilanove and previous boards, and the firmware on the - // 8U2 on the Uno and Mega 2560. - if (baud == 57600) useU2X = false; - #endif - - if (useU2X) { - M_UCSRxA = _BV(M_U2Xx); - baud_setting = (F_CPU / 4 / baud - 1) / 2; - } - else { - M_UCSRxA = 0; - baud_setting = (F_CPU / 8 / baud - 1) / 2; - } - - // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) - M_UBRRxH = baud_setting >> 8; - M_UBRRxL = baud_setting; - - SBI(M_UCSRxB, M_RXENx); - SBI(M_UCSRxB, M_TXENx); - SBI(M_UCSRxB, M_RXCIEx); - #if TX_BUFFER_SIZE > 0 - CBI(M_UCSRxB, M_UDRIEx); - #endif - _written = false; - } - - void MarlinSerial::end() { - CBI(M_UCSRxB, M_RXENx); - CBI(M_UCSRxB, M_TXENx); - CBI(M_UCSRxB, M_RXCIEx); - CBI(M_UCSRxB, M_UDRIEx); - } - - int MarlinSerial::peek(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; - return h == t ? -1 : rx_buffer.buffer[t]; - } - - int MarlinSerial::read(void) { - 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 - ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - // Get the next char - const int v = rx_buffer.buffer[t]; - t = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); - - // Advance tail - Making sure the RX ISR will always get an stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(t); - - #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - // Get count of bytes in the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - if (rx_count < (RX_BUFFER_SIZE) / 10) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable them - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif - } - } - #endif - - return v; - } - - ring_buffer_pos_t MarlinSerial::available(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; - return (ring_buffer_pos_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1); - } - - void MarlinSerial::flush(void) { - - // Set the tail to the head: - // - Read the RX head index in a safe way. (See atomic_read_rx_head.) - // - Set the tail, making sure the RX ISR will always get a stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(atomic_read_rx_head()); - - #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable it. - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif - } - #endif - } - - #if TX_BUFFER_SIZE > 0 - void MarlinSerial::write(const uint8_t c) { - _written = true; - - // If the TX interrupts are disabled and the data register - // is empty, just write the byte to the data register and - // be done. This shortcut helps significantly improve the - // effective datarate at high (>500kbit/s) bitrates, where - // interrupt overhead becomes a slowdown. - // Yes, there is a race condition between the sending of the - // XOFF char at the RX ISR, but it is properly handled there - if (!TEST(M_UCSRxB, M_UDRIEx) && TEST(M_UCSRxA, M_UDREx)) { - M_UDRx = c; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - return; - } - - const uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1); - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Make room by polling if it is possible to transmit, and do so! - while (i == tx_buffer.tail) { - - // If we can transmit another byte, do it. - if (TEST(M_UCSRxA, M_UDREx)) _tx_udr_empty_irq(); - - // Make sure compiler rereads tx_buffer.tail - sw_barrier(); - } - } - else { - // Interrupts are enabled, just wait until there is space - while (i == tx_buffer.tail) { sw_barrier(); } - } - - // Store new char. head is always safe to move - tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - - // Enable TX ISR - Non atomic, but it will eventually enable TX ISR - SBI(M_UCSRxB, M_UDRIEx); - } - - void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Wait until everything was transmitted - We must do polling, as interrupts are disabled - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) { - - // If there is more space, send an extra character - if (TEST(M_UCSRxA, M_UDREx)) - _tx_udr_empty_irq(); - - sw_barrier(); - } - - } - else { - // Wait until everything was transmitted - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - } - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } - - #else // TX_BUFFER_SIZE == 0 - - void MarlinSerial::write(const uint8_t c) { - _written = true; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = c; - } - - void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // Wait until everything was transmitted - while (!TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } - #endif // TX_BUFFER_SIZE == 0 - - /** - * Imports from print.h - */ - - void MarlinSerial::print(char c, int base) { - print((long)c, base); - } - - void MarlinSerial::print(unsigned char b, int base) { - print((unsigned long)b, base); - } - - void MarlinSerial::print(int n, int base) { - print((long)n, base); - } - - void MarlinSerial::print(unsigned int n, int base) { - print((unsigned long)n, base); - } - - void MarlinSerial::print(long n, int base) { - if (base == 0) write(n); - else if (base == 10) { - if (n < 0) { print('-'); n = -n; } - printNumber(n, 10); - } - else - printNumber(n, base); - } - - void MarlinSerial::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); - } - - void MarlinSerial::print(double n, int digits) { - printFloat(n, digits); - } - - void MarlinSerial::println(void) { - print('\r'); - print('\n'); - } - - void MarlinSerial::println(const String& s) { - print(s); - println(); - } - - void MarlinSerial::println(const char c[]) { - print(c); - println(); - } - - void MarlinSerial::println(char c, int base) { - print(c, base); - println(); - } - - void MarlinSerial::println(unsigned char b, int base) { - print(b, base); - println(); - } - - void MarlinSerial::println(int n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(unsigned int n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(long n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(unsigned long n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(double n, int digits) { - print(n, digits); - println(); - } - - // Private Methods - - void MarlinSerial::printNumber(unsigned long n, uint8_t base) { - if (n) { - unsigned char buf[8 * sizeof(long)]; // Enough space for base 2 - int8_t i = 0; - while (n) { - buf[i++] = n % base; - n /= base; - } - while (i--) - print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10))); - } - else - print('0'); - } - - void MarlinSerial::printFloat(double number, uint8_t digits) { - // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) - rounding *= 0.1; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; - print(int_part); - - // Print the decimal point, but only if there are digits beyond - if (digits) { - print('.'); - // Extract digits from the remainder one at a time - while (digits--) { - remainder *= 10.0; - int toPrint = int(remainder); - print(toPrint); - remainder -= toPrint; - } - } - } - - // Preinstantiate - MarlinSerial customizedSerial; - -#endif // USE_MARLINSERIAL && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) - -// For AT90USB targets use the UART for BT interfacing -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) - HardwareSerial bluetoothSerial; -#endif diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h deleted file mode 100644 index d8bd5346c6..0000000000 --- a/Marlin/MarlinSerial.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MarlinSerial.h - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - */ - -#ifndef _MARLINSERIAL_H_ -#define _MARLINSERIAL_H_ - -#include "MarlinConfig.h" - -#ifndef SERIAL_PORT - #define SERIAL_PORT 0 -#endif - -// The presence of the UBRRH register is used to detect a UART. -#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ - (port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \ - (port == 3 && defined(UBRR3H))) - -// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor -// requires two levels of indirection to expand macro values properly) -#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) -#if SERIAL_PORT == 0 && (!defined(UBRR0H) || !defined(UDR0)) // use un-numbered registers if necessary - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix -#else - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix -#endif - -// Registers used by MarlinSerial class (expanded depending on selected serial port) -#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number -#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,B) -#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,) -#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,) -#define M_TXCx SERIAL_REGNAME(TXC,SERIAL_PORT,) -#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,) -#define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,) -#define M_FEx SERIAL_REGNAME(FE,SERIAL_PORT,) -#define M_DORx SERIAL_REGNAME(DOR,SERIAL_PORT,) -#define M_UPEx SERIAL_REGNAME(UPE,SERIAL_PORT,) -#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,) -#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,) -#define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H) -#define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L) -#define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,) -#define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect) -#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,) -#define M_USARTx_UDRE_vect SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect) - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 -#define BYTE 0 - -// Define constants and variables for buffering serial data. -// Use only 0 or powers of 2 greater than 1 -// : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...] -#ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 -#endif -// 256 is the max TX buffer limit due to uint8_t head and tail. -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 -#endif - -#if USE_MARLINSERIAL - - #if RX_BUFFER_SIZE > 256 - typedef uint16_t ring_buffer_pos_t; - #else - typedef uint8_t ring_buffer_pos_t; - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - extern uint8_t rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - extern uint8_t rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - extern uint8_t rx_framing_errors; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - extern ring_buffer_pos_t rx_max_enqueued; - #endif - - class MarlinSerial { - - 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 void write(const uint8_t c); - static void flushTX(void); - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - FORCE_INLINE static uint32_t dropped() { return rx_dropped_bytes; } - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - FORCE_INLINE static uint32_t buffer_overruns() { return rx_buffer_overruns; } - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - FORCE_INLINE static uint32_t framing_errors() { return rx_framing_errors; } - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return rx_max_enqueued; } - #endif - - FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } - FORCE_INLINE static void print(const char* str) { write(str); } - - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); - static void print(int, int = DEC); - static void print(unsigned int, int = DEC); - static void print(long, int = DEC); - static void print(unsigned long, int = DEC); - static void print(double, int = 2); - - static void println(const String& s); - static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); - static void println(int, int = DEC); - static void println(unsigned int, int = DEC); - static void println(long, int = DEC); - static void println(unsigned long, int = DEC); - static void println(double, int = 2); - static void println(void); - operator bool() { return true; } - - private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); - }; - - extern MarlinSerial customizedSerial; - -#endif // USE_MARLINSERIAL - -// Use the UART for Bluetooth in AT90USB configurations -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; -#endif - -#endif // _MARLINSERIAL_H_ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp deleted file mode 100644 index 89ee85ae54..0000000000 --- a/Marlin/Marlin_main.cpp +++ /dev/null @@ -1,14863 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -/** - * About Marlin - * - * This firmware is a mashup between Sprinter and grbl. - * - https://github.com/kliment/Sprinter - * - https://github.com/grbl/grbl - */ - -/** - * ----------------- - * G-Codes in Marlin - * ----------------- - * - * Helpful G-code references: - * - http://linuxcnc.org/handbook/gcode/g-code.html - * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes - * - * Help to document Marlin's G-codes online: - * - http://reprap.org/wiki/G-code - * - https://github.com/MarlinFirmware/MarlinDocumentation - * - * ----------------- - * - * "G" Codes - * - * G0 -> G1 - * G1 - Coordinated Movement X Y Z E - * G2 - CW ARC - * G3 - CCW ARC - * G4 - Dwell S or P - * G5 - Cubic B-spline with XYZE destination and IJPQ offsets - * G10 - Retract filament according to settings of M207 (Requires FWRETRACT) - * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT) - * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE) - * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES) - * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES) - * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES) - * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT) - * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT) - * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION) - * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE) - * G28 - Home one or more axes - * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling) - * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location) - * G31 - Dock sled (Z_PROBE_SLED only) - * G32 - Undock sled (Z_PROBE_SLED only) - * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION) - * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET) - * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL) - * G90 - Use Absolute Coordinates - * G91 - Use Relative Coordinates - * G92 - Set current position to coordinates given - * - * "M" Codes - * - * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) - * M1 -> M0 - * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise - * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise - * M5 - Turn laser/spindle off - * M17 - Enable/Power all stepper motors - * M18 - Disable all stepper motors; same as M84 - * M20 - List SD card. (Requires SDSUPPORT) - * M21 - Init SD card. (Requires SDSUPPORT) - * M22 - Release SD card. (Requires SDSUPPORT) - * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT) - * M24 - Start/resume SD print. (Requires SDSUPPORT) - * M25 - Pause SD print. (Requires SDSUPPORT) - * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT) - * M27 - Report SD print status. (Requires SDSUPPORT) - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT) - * M29 - Stop SD write. (Requires SDSUPPORT) - * M30 - Delete file from SD: "M30 /path/file.gco" - * M31 - Report time since last M109 or SD card start to serial. - * M32 - Select file and start SD print: "M32 [S] !/path/file.gco#". (Requires SDSUPPORT) - * Use P to run other files as sub-programs: "M32 P !filename#" - * The '#' is necessary when calling from within sd files, as it stops buffer prereading - * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT) - * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) - * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. - * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) - * M75 - Start the print job timer. - * M76 - Pause the print job timer. - * M77 - Stop the print job timer. - * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER) - * M80 - Turn on Power Supply. (Requires POWER_SUPPLY > 0) - * M81 - Turn off Power Supply. (Requires POWER_SUPPLY > 0) - * M82 - Set E codes absolute (default). - * M83 - Set E codes relative while in Absolute (G90) mode. - * M84 - Disable steppers until next move, or use S to specify an idle - * duration after which steppers should turn off. S0 disables the timeout. - * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) - * M92 - Set planner.axis_steps_per_mm for one or more axes. - * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER) - * M104 - Set extruder target temp. - * M105 - Report current temperatures. - * M106 - Set print fan speed. - * M107 - Print fan off. - * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER) - * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating - * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling - * 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. - * 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) - * M117 - Display a message on the controller screen. (Requires an LCD) - * M118 - Display a message in the host console. - * M119 - Report endstops status. - * M120 - Enable endstops detection. - * M121 - Disable endstops detection. - * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) - * M126 - Solenoid Air Valve Open. (Requires BARICUDA) - * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) - * M128 - EtoP Open. (Requires BARICUDA) - * M129 - EtoP Closed. (Requires BARICUDA) - * M140 - Set bed target temp. S - * M145 - Set heatup values for materials on the LCD. H B F for S (0=PLA, 1=ABS) - * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT) - * M150 - Set Status LED Color as R U B P. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, or PCA9632). - * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) - * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) - * M164 - Save the mix as a virtual extruder. (Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS) - * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. (Requires MIXING_EXTRUDER) - * M190 - Sxxx Wait for bed current temp to reach target temp. ** Waits only when heating! ** - * Rxxx Wait for bed current temp to reach target temp. ** Waits for heating or cooling. ** - * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) - * M201 - Set max acceleration in units/s^2 for print moves: "M201 X Y Z E" - * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X Y Z E" ** UNUSED IN MARLIN! ** - * M203 - Set maximum feedrate: "M203 X Y Z E" in units/sec. - * M204 - Set default acceleration in units/sec^2: P R T - * M205 - Set advanced settings. Current units apply: - S T minimum speeds - B - X, Y, Z, E - * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z. (Requires FWRETRACT) - * M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F. (Requires FWRETRACT) - * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT) - Every normal extrude-only move will be classified as retract depending on the direction. - * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS) - * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) - * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) - * M221 - Set Flow Percentage: "M221 S" - * M226 - Wait until a pin is in a given state: "M226 P S" - * M240 - Trigger a camera to take a photograph. (Requires CHDK or PHOTOGRAPH_PIN) - * M250 - Set LCD contrast: "M250 C" (0-63). (Requires LCD support) - * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS) - * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS) - * M280 - Set servo position absolute: "M280 P S". (Requires servos) - * M290 - Babystepping (Requires BABYSTEPPING) - * M300 - Play beep sound S P - * M301 - Set PID parameters P I and D. (Requires PIDTEMP) - * M302 - Allow cold extrudes, or set the minimum extrude S. (Requires PREVENT_COLD_EXTRUSION) - * M303 - PID relay autotune S sets the target temperature. Default 150C. (Requires PIDTEMP) - * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED) - * M350 - Set microstepping mode. (Requires digital microstepping pins.) - * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.) - * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN) - * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID) - * M381 - Disable all solenoids. (Requires EXT_SOLENOID) - * M400 - Finish all moves. - * M401 - Deploy and activate Z probe. (Requires a probe) - * M402 - Deactivate and stow Z probe. (Requires a probe) - * M404 - Display or set the Nominal Filament Width: "W". (Requires FILAMENT_WIDTH_SENSOR) - * M405 - Enable Filament Sensor flow control. "M405 D". (Requires FILAMENT_WIDTH_SENSOR) - * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) - * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) - * M410 - Quickstop. Abort all planned moves. - * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) - * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) - * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) - * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** - * M503 - Print the current settings (in memory): "M503 S". S0 specifies compact output. - * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) - * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) - * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) - * M665 - Set delta configurations: "M665 H L R S B X Y Z (Requires DELTA) - * M666 - Set/get endstop offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). - * M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) - * 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. - * M862 - Perform an axis continuity test for position encoder modules. - * M863 - Perform steps-per-mm calibration for position encoder modules. - * M864 - Change position encoder module I2C address. - * M865 - Check position encoder module firmware version. - * M866 - Report or reset position encoder module error count. - * M867 - Enable/disable or toggle error correction for position encoder modules. - * M868 - Report or set position encoder module error correction threshold. - * M869 - Report position encoder module error. - * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) - * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) - * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) - * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) - * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) - * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING) - * - * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) - * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) - * - * ************ Custom codes - This can change to suit future G-code regulations - * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT) - * M999 - Restart after being stopped by error - * - * "T" Codes - * - * T0-T3 - Select an extruder (tool) by index: "T F" - * - */ - -#include "Marlin.h" - -#include "ultralcd.h" -#include "planner.h" -#include "stepper.h" -#include "endstops.h" -#include "temperature.h" -#include "cardreader.h" -#include "configuration_store.h" -#include "language.h" -#include "pins_arduino.h" -#include "math.h" -#include "nozzle.h" -#include "printcounter.h" -#include "duration_t.h" -#include "types.h" -#include "parser.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "power_loss_recovery.h" - recovery_D recovery_detect_cap; -#endif - extern char lcd_status_message[]; -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -#if ABL_PLANAR - #include "vector_3.h" - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - #include "least_squares_fit.h" - #endif -#elif ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if ENABLED(BEZIER_CURVE_SUPPORT) - #include "planner_bezier.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #include "runout.h" -#endif - -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - #include "buzzer.h" -#endif - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if ENABLED(MAX7219_DEBUG) - #include "Max7219_Debug_LEDs.h" -#endif - -#if HAS_COLOR_LEDS - #include "leds.h" -#endif - -#if HAS_SERVOS - #include "servo.h" -#endif - -#if HAS_DIGIPOTSS - #include -#endif - -#if HAS_TRINAMIC - #include "tmc_util.h" -#endif - -#if ENABLED(DAC_STEPPER_CURRENT) - #include "stepper_dac.h" -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) - #include "twibus.h" -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - #include "I2CPositionEncoder.h" -#endif - -#if ENABLED(M100_FREE_MEMORY_WATCHER) - void gcode_M100(); - void M100_dump_routine(const char * const title, const char *start, const char *end); -#endif - -#if ENABLED(G26_MESH_VALIDATION) - bool g26_debug_flag; // =false - void gcode_G26(); -#endif - -#if ENABLED(SDSUPPORT) - CardReader card; -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) - TWIBus i2c; -#endif - -#if ENABLED(G38_PROBE_TARGET) - bool G38_move = false, - G38_endstop_hit = false; -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - int8_t active_coordinate_system = -1; // machine space - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; -#endif - -bool Running = true; - -uint8_t marlin_debug_flags = DEBUG_NONE; - -/** - * Cartesian Current Position - * Used to track the native machine position as moves are queued. - * Used by 'buffer_line_to_current_position' to do a move after changing it. - * Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'. - */ -float current_position[XYZE] = { 0 }; - -/** - * 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 'gcode_get_destination' or 'set_destination_from_current'. - */ -float destination[XYZE] = { 0 }; - -/** - * axis_homed - * Flags that each linear axis was homed. - * XYZ on cartesian, ABC on delta, ABZ on SCARA. - * - * axis_known_position - * Flags that the position is known in each linear axis. Set when homed. - * Cleared whenever a stepper powers off, potentially losing its position. - */ -uint8_t axis_homed, axis_known_position; // = 0 - -/** - * GCode line number handling. Hosts may opt to include line numbers when - * sending commands to Marlin, and lines will be checked for sequentiality. - * M110 N sets the current line number. - */ -static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; - -/** - * GCode Command Queue - * A simple ring buffer of BUFSIZE command strings. - * - * Commands are copied into this buffer by the command injectors - * (immediate, serial, sd card) and they are processed sequentially by - * the main loop. The process_next_command function parses the next - * command and hands off execution to individual handler functions. - */ -uint8_t commands_in_queue = 0, // Count of commands in the queue - cmd_queue_index_r = 0, // Ring buffer read (out) position - cmd_queue_index_w = 0; // Ring buffer write (in) position - -char command_queue[BUFSIZE][MAX_CMD_SIZE]; - -/** - * Next Injected Command pointer. NULL if no commands are being injected. - * Used by Marlin internally to ensure that commands initiated from within - * are enqueued ahead of any pending serial or sd card commands. - */ -static const char *injected_commands_P = NULL; - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - TempUnit input_temp_units = TEMPUNIT_C; -#endif - -/** - * Feed rates are often configured with mm/m - * but the planner and stepper like mm/s units. - */ -static const float homing_feedrate_mm_s[] PROGMEM = { - #if ENABLED(DELTA) - MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), - #else - MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), - #endif - MMM_TO_MMS(HOMING_FEEDRATE_Z), 0 -}; -FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } - -float feedrate_mm_s = MMM_TO_MMS(1500.0f); -static float saved_feedrate_mm_s; -int16_t feedrate_percentage = 100, saved_feedrate_percentage; - -// Initialized by settings.load() -bool axis_relative_modes[XYZE] = AXIS_RELATIVE_MODES; - -#if HAS_WORKSPACE_OFFSET - #if HAS_POSITION_SHIFT - // The distance that XYZ has been offset by G92. Reset by G28. - float position_shift[XYZ] = { 0 }; - #endif - #if HAS_HOME_OFFSET - // This offset is added to the configured home position. - // Set by M206, M428, or menu item. Saved to EEPROM. - float home_offset[XYZ] = { 0 }; - #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - // The above two are combined to save on computes - float workspace_offset[XYZ] = { 0 }; - #endif -#endif - -// Software Endstops are based on the configured limits. -float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, - soft_endstop_max[XYZ] = { X_MAX_BED, Y_MAX_BED, Z_MAX_POS }; -#if HAS_SOFTWARE_ENDSTOPS - bool soft_endstops_enabled = true; - #if IS_KINEMATIC - float soft_endstop_radius, soft_endstop_radius_2; - #endif -#endif - -#if FAN_COUNT > 0 - int16_t fanSpeeds[FAN_COUNT] = { 0 }; - #if ENABLED(EXTRA_FAN_SPEED) - int16_t old_fanSpeeds[FAN_COUNT], - new_fanSpeeds[FAN_COUNT]; - #endif - #if ENABLED(PROBING_FANS_OFF) - bool fans_paused; // = false; - int16_t paused_fanSpeeds[FAN_COUNT] = { 0 }; - #endif -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - int controllerFanSpeed; // = 0; -#endif - -// The active extruder (tool). Set with T command. -uint8_t active_extruder; // = 0; - -// Relative Mode. Enable with G91, disable with G90. -static bool relative_mode; // = false; - -// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop -volatile bool wait_for_heatup = true; - -// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop -#if HAS_RESUME_CONTINUE - volatile bool wait_for_user; // = false; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - bool suspend_auto_report; // = false -#endif - -const char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; - -// Number of characters read in the current line of serial input -static int serial_count; // = 0; - -// Inactivity shutdown -millis_t previous_move_ms; // = 0; -static millis_t max_inactive_time; // = 0; -static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL; - -// Buzzer - I2C on the LCD or a BEEPER_PIN -#if ENABLED(LCD_USE_I2C_BUZZER) - #define BUZZ(d,f) lcd_buzz(d, f) -#elif PIN_EXISTS(BEEPER) - Buzzer buzzer; - #define BUZZ(d,f) buzzer.tone(d, f) -#else - #define BUZZ(d,f) NOOP -#endif - -uint8_t target_extruder; - -#if HAS_BED_PROBE - float zprobe_zoffset; // Initialized by settings.load() -#endif - -#if HAS_ABL - float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); - #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s -#elif defined(XY_PROBE_SPEED) - #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_SPEED) -#else - #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #if ENABLED(DELTA) - #define ADJUST_DELTA(V) \ - if (planner.leveling_active) { \ - const float zadj = bilinear_z_offset(V); \ - delta[A_AXIS] += zadj; \ - delta[B_AXIS] += zadj; \ - delta[C_AXIS] += zadj; \ - } - #else - #define ADJUST_DELTA(V) if (planner.leveling_active) { delta[Z_AXIS] += bilinear_z_offset(V); } - #endif -#elif IS_KINEMATIC - #define ADJUST_DELTA(V) NOOP -#endif - -#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - const static char msg_wait_for_bed_heating[] PROGMEM = "Wait for bed heating...\n"; -#endif - -// Extruder offsets -#if HOTENDS > 1 - float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load() -#endif - -#if HAS_Z_SERVO_PROBE - const int z_servo_angle[2] = Z_SERVO_ANGLES; -#endif - -#if ENABLED(BARICUDA) - uint8_t baricuda_valve_pressure = 0, - baricuda_e_to_p_pressure = 0; -#endif - -#if HAS_POWER_SWITCH - bool powersupply_on = ( - #if ENABLED(PS_DEFAULT_OFF) - false - #else - true - #endif - ); - #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() - #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() - #endif -#endif - -#if ENABLED(DELTA) - - float delta[ABC]; - - // Initialized by settings.load() - float delta_height, - delta_endstop_adj[ABC] = { 0 }, - delta_radius, - delta_tower_angle_trim[ABC], - delta_tower[ABC][2], - delta_diagonal_rod, - delta_calibration_radius, - delta_diagonal_rod_2_tower[ABC], - delta_segments_per_second, - delta_clip_start_height = Z_MAX_POS; - - float delta_safe_distance_from_top(); - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - int bilinear_grid_spacing[2], bilinear_start[2]; - float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt[A] - #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X - #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y - #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] - #else - #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor[A] - #define ABL_BG_POINTS_X GRID_MAX_POINTS_X - #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y - #define ABL_BG_GRID(X,Y) z_values[X][Y] - #endif -#endif - -#if IS_SCARA - // Float constants for SCARA calculations - const float L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, - L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2, - L2_2 = sq(float(L2)); - - float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND, - delta[ABC]; -#endif - -float cartes[XYZ] = { 0 }; - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - bool filament_sensor; // = false; // M405 turns on filament sensor control. M406 turns it 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 -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - AdvancedPauseMenuResponse advanced_pause_menu_response; - float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; -#endif - -#if ENABLED(MIXING_EXTRUDER) - float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise >= 1.0. - #if MIXING_VIRTUAL_TOOLS > 1 - float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - #endif -#endif - -static bool send_ok[BUFSIZE]; - -#if HAS_SERVOS - Servo servo[NUM_SERVOS]; - #define MOVE_SERVO(I, P) servo[I].move(P) - #if HAS_Z_SERVO_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[1]) - #endif -#endif - -#ifdef CHDK - millis_t chdkHigh = 0; - bool chdkActive = false; -#endif - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - MarlinBusyState busy_state = NOT_BUSY; - static millis_t next_busy_signal_ms = 0; - uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL; -#else - #define host_keepalive() NOOP -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - I2CPositionEncodersMgr I2CPEM; -#endif - -#if ENABLED(CNC_WORKSPACE_PLANES) - static WorkspacePlane workspace_plane = PLANE_XY; -#endif - -FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float_near(p); } -FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte_near(p); } - -#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \ - static const PROGMEM type array##_P[XYZ] = { X_##CONFIG, Y_##CONFIG, Z_##CONFIG }; \ - static inline type array(const AxisEnum axis) { return pgm_read_any(&array##_P[axis]); } \ - typedef void __void_##CONFIG##__ - -XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); -XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); -XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); -XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); - -/** - * *************************************************************************** - * ******************************** FUNCTIONS ******************************** - * *************************************************************************** - */ - -void stop(); - -void get_available_commands(); -void process_next_command(); -void process_parsed_command(); - -void get_cartesian_from_steppers(); -void set_current_from_steppers_for_axis(const AxisEnum axis); - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const float (&cart)[XYZE], const float (&offset)[2], const bool clockwise); -#endif - -#if ENABLED(BEZIER_CURVE_SUPPORT) - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]); -#endif - -void report_current_position(); -void report_current_position_detail(); - -#if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) { - serialprintPGM(prefix); - SERIAL_CHAR('('); - SERIAL_ECHO(x); - SERIAL_ECHOPAIR(", ", y); - SERIAL_ECHOPAIR(", ", z); - SERIAL_CHAR(')'); - if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); - } - - void print_xyz(const char* prefix, const char* suffix, const float xyz[]) { - print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); - } - - #define DEBUG_POS(SUFFIX,VAR) do { \ - print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) -#endif - -/** - * sync_plan_position - * - * Set the planner/stepper positions directly from current_position with - * no kinematic translation. Used for homing axes and cartesian/core syncing. - */ -void sync_plan_position() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); - #endif - planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); -} -void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } - -#if IS_KINEMATIC - inline void sync_plan_position_kinematic() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_kinematic", current_position); - #endif - planner.set_position_mm_kinematic(current_position); - } -#endif - -#if ENABLED(SDSUPPORT) - #include "SdFatUtil.h" - int freeMemory() { return SdFatUtil::FreeRam(); } -#else -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} -#endif // !SDSUPPORT - -#if ENABLED(DIGIPOT_I2C) - extern void digipot_i2c_set_current(uint8_t channel, float current); - extern void digipot_i2c_init(); -#endif - -/** - * Inject the next "immediate" command, when possible, onto the front of the queue. - * Return true if any immediate commands remain to inject. - */ -static bool drain_injected_commands_P() { - if (injected_commands_P != NULL) { - size_t i = 0; - char c, cmd[30]; - strncpy_P(cmd, injected_commands_P, sizeof(cmd) - 1); - cmd[sizeof(cmd) - 1] = '\0'; - while ((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command - cmd[i] = '\0'; - if (enqueue_and_echo_command(cmd)) // success? - injected_commands_P = c ? injected_commands_P + i + 1 : NULL; // next command or done - } - return (injected_commands_P != NULL); // return whether any more remain -} - -/** - * Record one or many commands to run from program memory. - * Aborts the current queue, if any. - * Note: drain_injected_commands_P() must be called repeatedly to drain the commands afterwards - */ -void enqueue_and_echo_commands_P(const char * const pgcode) { - injected_commands_P = pgcode; - (void)drain_injected_commands_P(); // first command executed asap (when possible) -} - -/** - * Clear the Marlin command queue - */ -void clear_command_queue() { - cmd_queue_index_r = cmd_queue_index_w = commands_in_queue = 0; -} - -/** - * Once a new command is in the ring buffer, call this to commit it - */ -inline void _commit_command(bool say_ok) { - send_ok[cmd_queue_index_w] = say_ok; - if (++cmd_queue_index_w >= BUFSIZE) cmd_queue_index_w = 0; - commands_in_queue++; -} - -/** - * Copy a command from RAM into the main command buffer. - * Return true if the command was successfully added. - * Return false for a full buffer, or if the 'command' is a comment. - */ -inline bool _enqueuecommand(const char* cmd, bool say_ok=false) { - if (*cmd == ';' || commands_in_queue >= BUFSIZE) return false; - strcpy(command_queue[cmd_queue_index_w], cmd); - _commit_command(say_ok); - return true; -} - -/** - * Enqueue with Serial Echo - */ -bool enqueue_and_echo_command(const char* cmd) { - if (_enqueuecommand(cmd)) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_ENQUEUEING, cmd); - SERIAL_CHAR('"'); - SERIAL_EOL(); - return true; - } - return false; -} - -#if HAS_QUEUE_NOW - void enqueue_and_echo_command_now(const char* cmd) { - while (!enqueue_and_echo_command(cmd)) idle(); - } - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const pgcode) { - enqueue_and_echo_commands_P(pgcode); - while (drain_injected_commands_P()) idle(); - } - #endif -#endif - -void setup_killpin() { - #if HAS_KILL - SET_INPUT_PULLUP(KILL_PIN); - #endif -} - -void setup_powerhold() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); - #endif - #if HAS_POWER_SWITCH - #if ENABLED(PS_DEFAULT_OFF) - PSU_OFF(); - #else - PSU_ON(); - #endif - #endif -} - -void suicide() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, LOW); - #endif -} - -void servo_init() { - #if NUM_SERVOS >= 1 && HAS_SERVO_0 - servo[0].attach(SERVO0_PIN); - servo[0].detach(); // Just set up the pin. We don't have a position yet. Don't move to a random position. - #endif - #if NUM_SERVOS >= 2 && HAS_SERVO_1 - servo[1].attach(SERVO1_PIN); - servo[1].detach(); - #endif - #if NUM_SERVOS >= 3 && HAS_SERVO_2 - servo[2].attach(SERVO2_PIN); - servo[2].detach(); - #endif - #if NUM_SERVOS >= 4 && HAS_SERVO_3 - servo[3].attach(SERVO3_PIN); - servo[3].detach(); - #endif - - #if HAS_Z_SERVO_PROBE - /** - * Set position of Z Servo Endstop - * - * The servo might be deployed and positioned too low to stow - * when starting up the machine or rebooting the board. - * There's no way to know where the nozzle is positioned until - * homing has been done - no homing with z-probe without init! - * - */ - STOW_Z_SERVO(); - #endif -} - -/** - * Stepper Reset (RigidBoard, et.al.) - */ -#if HAS_STEPPER_RESET - void disableStepperDrivers() { - OUT_WRITE(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips - } - void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); } // set to input, which allows it to be pulled high by pullups -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - - void i2c_on_receive(int bytes) { // just echo all bytes received to serial - i2c.receive(bytes); - } - - void i2c_on_request() { // just send dummy data for now - i2c.reply("Hello World!\n"); - } - -#endif - -void gcode_line_error(const char* err, bool doFlush = true) { - SERIAL_ERROR_START(); - serialprintPGM(err); - SERIAL_ERRORLN(gcode_LastN); - //Serial.println(gcode_N); - if (doFlush) flush_and_request_resend(); - serial_count = 0; -} - -/** - * Get all commands waiting on the serial port and queue them. - * Exit when the buffer is full or when no more characters are - * left on the serial port. - */ -inline void get_serial_commands() { - static char serial_line_buffer[MAX_CMD_SIZE]; - static bool serial_comment_mode = false; - - // If the command buffer is empty for too long, - // send "wait" to indicate Marlin is still waiting. - #if NO_TIMEOUTS > 0 - static millis_t last_command_time = 0; - const millis_t ms = millis(); - if (commands_in_queue == 0 && !MYSERIAL0.available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { - SERIAL_ECHOLNPGM(MSG_WAIT); - last_command_time = ms; - } - #endif - - /** - * Loop while serial characters are incoming and the queue is not full - */ - int c; - while (commands_in_queue < BUFSIZE && (c = MYSERIAL0.read()) >= 0) { - - char serial_char = c; - - /** - * If the character ends the line - */ - if (serial_char == '\n' || serial_char == '\r') { - - serial_comment_mode = false; // end of line == end of comment - - // Skip empty lines and comments - if (!serial_count) { thermalManager.manage_heater(); continue; } - - serial_line_buffer[serial_count] = 0; // Terminate string - serial_count = 0; // Reset buffer - - char* command = serial_line_buffer; - - while (*command == ' ') command++; // Skip leading spaces - char *npos = (*command == 'N') ? command : NULL; // Require the N parameter to start the line - - if (npos) { - - bool M110 = strstr_P(command, PSTR("M110")) != NULL; - - if (M110) { - char* n2pos = strchr(command + 4, 'N'); - if (n2pos) npos = n2pos; - } - - gcode_N = strtol(npos + 1, NULL, 10); - - if (gcode_N != gcode_LastN + 1 && !M110) { - gcode_line_error(PSTR(MSG_ERR_LINE_NO)); - return; - } - - char *apos = strrchr(command, '*'); - if (apos) { - uint8_t checksum = 0, count = uint8_t(apos - command); - while (count) checksum ^= command[--count]; - if (strtol(apos + 1, NULL, 10) != checksum) { - gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH)); - return; - } - } - else { - gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); - return; - } - - gcode_LastN = gcode_N; - } - #if ENABLED(SDSUPPORT) - else if (card.saving) { - gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); - return; - } - #endif - - // Movement commands alert when stopped - if (IsStopped()) { - char* gpos = strchr(command, 'G'); - if (gpos) { - const int codenum = strtol(gpos + 1, NULL, 10); - switch (codenum) { - case 0: - case 1: - case 2: - case 3: - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - break; - } - } - } - - #if DISABLED(EMERGENCY_PARSER) - // Process critical commands early - if (strcmp(command, "M108") == 0) { - wait_for_heatup = false; - #if ENABLED(NEWPANEL) - wait_for_user = false; - #endif - } - if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M410") == 0) quickstop_stepper(); - #endif - - #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 - last_command_time = ms; - #endif - - // Add the command to the queue - _enqueuecommand(serial_line_buffer, true); - } - else if (serial_count >= MAX_CMD_SIZE - 1) { - // Keep fetching, but ignore normal characters beyond the max length - // The command will be injected when EOL is reached - } - else if (serial_char == '\\') { // Handle escapes - if ((c = MYSERIAL0.read()) >= 0 && !serial_comment_mode) // if we have one more character, copy it over - serial_line_buffer[serial_count++] = (char)c; - // otherwise do nothing - } - else { // it's not a newline, carriage return or escape char - if (serial_char == ';') serial_comment_mode = true; - if (!serial_comment_mode) serial_line_buffer[serial_count++] = serial_char; - } - - } // queue has space, serial has data -} - -#if ENABLED(SDSUPPORT) - - #if ENABLED(PRINTER_EVENT_LEDS) && HAS_RESUME_CONTINUE - static bool lights_off_after_print; // = false - #endif - - /** - * Get commands from the SD Card until the command buffer is full - * or until the end of the file is reached. The special character '#' - * can also interrupt buffering. - */ - inline void get_sdcard_commands() { - static bool stop_buffering = false, - sd_comment_mode = false; - - if (!card.sdprinting) return; - - /** - * '#' stops reading from SD to the buffer prematurely, so procedural - * macro calls are possible. If it occurs, stop_buffering is triggered - * and the buffer is run dry; this character _can_ occur in serial com - * due to checksums, however, no checksums are used in SD printing. - */ - - if (commands_in_queue == 0) stop_buffering = false; - - uint16_t sd_count = 0; - bool card_eof = card.eof(); - while (commands_in_queue < BUFSIZE && !card_eof && !stop_buffering) { - const int16_t n = card.get(); - char sd_char = (char)n; - card_eof = card.eof(); - if (card_eof || n == -1 - || sd_char == '\n' || sd_char == '\r' - || ((sd_char == '#' || sd_char == ':') && !sd_comment_mode) - ) { - if (card_eof) { - - card.printingHasFinished(); - - if (card.sdprinting) - sd_count = 0; // If a sub-file was printing, continue from call point - else { - SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); - #if ENABLED(PRINTER_EVENT_LEDS) - LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); - leds.set_green(); - #if HAS_RESUME_CONTINUE - lights_off_after_print = true; - enqueue_and_echo_commands_P(PSTR("M0 S" - #if ENABLED(NEWPANEL) - "1800" - #else - "60" - #endif - )); - #else - safe_delay(2000); - leds.set_off(); - #endif - #endif // PRINTER_EVENT_LEDS - } - } - else if (n == -1) { - char dat_tmp[96]; - SERIAL_ERROR_START(); - SERIAL_ECHOLNPGM(MSG_SD_ERR_READ); - sprintf_P(dat_tmp,PSTR("M21")); - enqueue_and_echo_command(dat_tmp); - } - if (sd_char == '#') stop_buffering = true; - - sd_comment_mode = false; // for new command - - // Skip empty lines and comments - if (!sd_count) { thermalManager.manage_heater(); continue; } - - command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string - sd_count = 0; // clear sd line buffer - - _commit_command(false); - } - else if (sd_count >= MAX_CMD_SIZE - 1) { - /** - * Keep fetching, but ignore normal characters beyond the max length - * The command will be injected when EOL is reached - */ - } - else { - if (sd_char == ';') sd_comment_mode = true; - if (!sd_comment_mode) command_queue[cmd_queue_index_w][sd_count++] = sd_char; - } - } - } - - #if ENABLED(POWER_LOSS_RECOVERY) - - inline bool drain_job_recovery_commands() { - static uint8_t job_recovery_commands_index = 0; // Resets on reboot - if (job_recovery_commands_count) { - if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) { - ++job_recovery_commands_index; - if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE; - } - return true; - } - return false; - } - - #endif - -#endif // SDSUPPORT - -/** - * Add to the circular command queue the next command from: - * - The command-injection queue (injected_commands_P) - * - The active serial input (usually USB) - * - Commands left in the queue after power-loss - * - The SD card file being actively printed - */ -void get_available_commands() { - - // Immediate commands block the other queues - if (drain_injected_commands_P()) return; - - get_serial_commands(); - - #if ENABLED(POWER_LOSS_RECOVERY) - // Commands for power-loss recovery take precedence - if (job_recovery_phase == JOB_RECOVERY_YES && drain_job_recovery_commands()) return; - #endif - - #if ENABLED(SDSUPPORT) - get_sdcard_commands(); - #endif -} - -/** - * Set target_extruder from the T parameter or the active_extruder - * - * Returns TRUE if the target is invalid - */ -bool get_target_extruder_from_command(const uint16_t code) { - if (parser.seenval('T')) { - const int8_t e = parser.value_byte(); - if (e >= EXTRUDERS) { - SERIAL_ECHO_START(); - SERIAL_CHAR('M'); - SERIAL_ECHO(code); - SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", e); - return true; - } - target_extruder = e; - } - else - target_extruder = active_extruder; - - return false; -} - -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - bool extruder_duplication_enabled = false; // Used in Dual X mode 2 -#endif - -#if ENABLED(DUAL_X_CARRIAGE) - - static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - - static float x_home_pos(const int extruder) { - if (extruder == 0) - return base_home_pos(X_AXIS); - else - /** - * In dual carriage mode the extruder offset provides an override of the - * second X-carriage position when homed - otherwise X2_HOME_POS is used. - * This allows soft recalibration of the second extruder home position - * without firmware reflash (through the M218 command). - */ - return hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS; - } - - static int x_home_dir(const int extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } - - static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1 - static bool active_extruder_parked = false; // used in mode 1 & 2 - static float raised_parked_position[XYZE]; // used in mode 1 - static millis_t delayed_move_time = 0; // used in mode 1 - static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 - static int16_t duplicate_extruder_temp_offset = 0; // used in mode 2 - -#endif // DUAL_X_CARRIAGE - -#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) || ENABLED(DELTA) - - /** - * Software endstops can be used to monitor the open end of - * an axis that has a hardware endstop on the other end. Or - * they can prevent axes from moving past endstops and grinding. - * - * To keep doing their job as the coordinate system changes, - * the software endstop positions must be refreshed to remain - * at the same positions relative to the machine. - */ - void update_software_endstops(const AxisEnum axis) { - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - workspace_offset[axis] = home_offset[axis] + position_shift[axis]; - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - if (axis == X_AXIS) { - - // In Dual X mode hotend_offset[X] is T1's home position - const float dual_max_x = MAX(hotend_offset[X_AXIS][1], X2_MAX_POS); - - if (active_extruder != 0) { - // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) - soft_endstop_min[X_AXIS] = X2_MIN_POS; - soft_endstop_max[X_AXIS] = dual_max_x; - } - else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - // In Duplication Mode, T0 can move as far left as X_MIN_POS - // but not so far to the right that T1 would move past the end - soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS); - soft_endstop_max[X_AXIS] = MIN(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset); - } - else { - // In other modes, T0 can move from X_MIN_POS to X_MAX_POS - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = base_max_pos(axis); - } - } - #elif ENABLED(DELTA) - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = axis == Z_AXIS ? delta_height : base_max_pos(axis); - #else - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = base_max_pos(axis); - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("For ", axis_codes[axis]); - #if HAS_HOME_OFFSET - SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]); - #endif - #if HAS_POSITION_SHIFT - SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]); - #endif - SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]); - SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]); - } - #endif - - #if ENABLED(DELTA) - switch (axis) { - #if HAS_SOFTWARE_ENDSTOPS - case X_AXIS: - case Y_AXIS: - // Get a minimum radius for clamping - soft_endstop_radius = MIN3(ABS(MAX(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]); - soft_endstop_radius_2 = sq(soft_endstop_radius); - break; - #endif - case Z_AXIS: - delta_clip_start_height = soft_endstop_max[axis] - delta_safe_distance_from_top(); - default: break; - } - #endif - } - -#endif // HAS_WORKSPACE_OFFSET || DUAL_X_CARRIAGE || DELTA - -#if HAS_M206_COMMAND - /** - * Change the home offset for an axis. - * Also refreshes the workspace offset. - */ - static void set_home_offset(const AxisEnum axis, const float v) { - home_offset[axis] = v; - update_software_endstops(axis); - } -#endif // HAS_M206_COMMAND - -/** - * Set an axis' current position to its home position (after homing). - * - * For Core and Cartesian robots this applies one-to-one when an - * individual axis has been homed. - * - * DELTA should wait until all homing is done before setting the XYZ - * current_position to home, because homing is a single operation. - * In the case where the axis positions are already known and previously - * homed, DELTA could home to X or Y individually by moving either one - * to the center. However, homing Z always homes XY and Z. - * - * SCARA should wait until all XY homing is done before setting the XY - * current_position to home, because neither X nor Y is at home until - * both are at home. Z can however be homed individually. - * - * Callers must sync the planner position after calling this! - */ -static void set_axis_is_at_home(const AxisEnum axis) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - SBI(axis_known_position, axis); - SBI(axis_homed, axis); - - #if HAS_POSITION_SHIFT - position_shift[axis] = 0; - update_software_endstops(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); - return; - } - #endif - - #if ENABLED(MORGAN_SCARA) - - /** - * Morgan SCARA homes XY at the same time - */ - if (axis == X_AXIS || axis == Y_AXIS) { - - float homeposition[XYZ] = { - base_home_pos(X_AXIS), - base_home_pos(Y_AXIS), - base_home_pos(Z_AXIS) - }; - - // SERIAL_ECHOPAIR("homeposition X:", homeposition[X_AXIS]); - // SERIAL_ECHOLNPAIR(" Y:", homeposition[Y_AXIS]); - - /** - * Get Home position SCARA arm angles using inverse kinematics, - * and calculate homing offset using forward kinematics - */ - inverse_kinematics(homeposition); - forward_kinematics_SCARA(delta[A_AXIS], delta[B_AXIS]); - - // SERIAL_ECHOPAIR("Cartesian X:", cartes[X_AXIS]); - // SERIAL_ECHOLNPAIR(" Y:", cartes[Y_AXIS]); - - current_position[axis] = cartes[axis]; - - /** - * SCARA home positions are based on configuration since the actual - * limits are determined by the inverse kinematic transform. - */ - soft_endstop_min[axis] = base_min_pos(axis); // + (cartes[axis] - base_home_pos(axis)); - soft_endstop_max[axis] = base_max_pos(axis); // + (cartes[axis] - base_home_pos(axis)); - } - else - #elif ENABLED(DELTA) - if (axis == Z_AXIS) - current_position[axis] = delta_height; - else - #endif - { - current_position[axis] = base_home_pos(axis); - } - - /** - * Z Probe Z Homing? Account for the probe's Z offset. - */ - #if HAS_BED_PROBE && Z_HOME_DIR < 0 - if (axis == Z_AXIS) { - #if HOMING_Z_WITH_PROBE - - current_position[Z_AXIS] -= zprobe_zoffset; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***"); - SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset); - } - #endif - - #elif ENABLED(DEBUG_LEVELING_FEATURE) - - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***"); - - #endif - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - #if HAS_HOME_OFFSET - SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]); - SERIAL_ECHOLNPAIR("] = ", home_offset[axis]); - #endif - DEBUG_POS("", current_position); - SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.homed(axis); - #endif -} - -/** - * Homing bump feedrate (mm/s) - */ -inline float 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 - static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; - uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); - if (hbd < 1) { - hbd = 10; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); - } - return homing_feedrate(axis) / hbd; -} - -/** - * Some planner shorthand inline functions - */ - -/** - * Move the planner to the current position from wherever it last moved - * (or from wherever it has been told it is located). - */ -inline void buffer_line_to_current_position() { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_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. - */ -inline 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); -} - -#if IS_KINEMATIC - /** - * Calculate delta, start a line, and set current_position to destination - */ - void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination); - #endif - - #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)); - #else - if ( current_position[X_AXIS] == destination[X_AXIS] - && current_position[Y_AXIS] == destination[Y_AXIS] - && current_position[Z_AXIS] == destination[Z_AXIS] - && current_position[E_AXIS] == destination[E_AXIS] - ) return; - - planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder); - #endif - - set_current_from_destination(); - } -#endif // IS_KINEMATIC - -/** - * Plan a move to (X, Y, Z) and set the current_position. - * The final current_position may not be the one that was requested - * Caution: 'destination' is modified by this function. - */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s/*=0.0*/) { - const float old_feedrate_mm_s = feedrate_mm_s; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, LOGICAL_X_POSITION(rx), LOGICAL_Y_POSITION(ry), LOGICAL_Z_POSITION(rz)); - #endif - - const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS); - - #if ENABLED(DELTA) - - if (!position_is_reachable(rx, ry)) return; - - feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - - set_destination_from_current(); // sync destination at the start - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination); - #endif - - // 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) - destination[Y_AXIS] = ry; - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); - #endif - return; - } - destination[Z_AXIS] = delta_clip_start_height; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); - #endif - } - - if (rz > current_position[Z_AXIS]) { // raising? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); - #endif - } - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - #endif - - if (rz < current_position[Z_AXIS]) { // lowering? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); - #endif - } - - #elif IS_SCARA - - if (!position_is_reachable(rx, ry)) return; - - set_destination_from_current(); - - // 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); - } - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S); - - // 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); - } - - #else - - // If Z needs to raise, do it before moving XY - if (current_position[Z_AXIS] < rz) { - feedrate_mm_s = z_feedrate; - current_position[Z_AXIS] = rz; - buffer_line_to_current_position(); - } - - feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; - buffer_line_to_current_position(); - - // If Z needs to lower, do it after moving XY - if (current_position[Z_AXIS] > rz) { - feedrate_mm_s = z_feedrate; - current_position[Z_AXIS] = rz; - buffer_line_to_current_position(); - } - - #endif - - planner.synchronize(); - - feedrate_mm_s = old_feedrate_mm_s; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to"); - #endif -} -void do_blocking_move_to_x(const float &rx, const float &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_z(const float &rz, const float &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*/) { - do_blocking_move_to(rx, ry, current_position[Z_AXIS], fr_mm_s); -} - -// -// Prepare to do endstop or probe moves -// with custom feedrates. -// -// - Save current feedrates -// - Reset the rate multiplier -// - Reset the command timeout -// - Enable the endstops (for endstop moves) -// -void setup_for_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); - #endif - saved_feedrate_mm_s = feedrate_mm_s; - saved_feedrate_percentage = feedrate_percentage; - feedrate_percentage = 100; -} - -void clean_up_after_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); - #endif - feedrate_mm_s = saved_feedrate_mm_s; - feedrate_percentage = saved_feedrate_percentage; -} - -#if HAS_AXIS_UNHOMED_ERR - - bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { - #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); - #else - const bool xx = x && !TEST(axis_homed, X_AXIS), - yy = y && !TEST(axis_homed, Y_AXIS), - zz = z && !TEST(axis_homed, Z_AXIS); - #endif - if (xx || yy || zz) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_ECHOPGM(MSG_X); - if (yy) SERIAL_ECHOPGM(MSG_Y); - if (zz) SERIAL_ECHOPGM(MSG_Z); - SERIAL_ECHOLNPGM(" " MSG_FIRST); - - #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); - #endif - return true; - } - return false; - } - -#endif // HAS_AXIS_UNHOMED_ERR - -#if ENABLED(Z_PROBE_SLED) - - #ifndef SLED_DOCKING_OFFSET - #define SLED_DOCKING_OFFSET 0 - #endif - - /** - * Method to dock/undock a sled designed by Charles Bell. - * - * stow[in] If false, move to MAX_X and engage the solenoid - * If true, move to MAX_X and release the solenoid - */ - static void dock_sled(bool stow) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("dock_sled(", stow); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // Dock sled a bit closer to ensure proper capturing - do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); - - #if HAS_SOLENOID_1 && DISABLED(EXT_SOLENOID) - WRITE(SOL1_PIN, !stow); // switch solenoid - #endif - } - -#elif ENABLED(Z_PROBE_ALLEN_KEY) - - FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s) { - do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); - } - - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE)); - #endif - } - -#endif // Z_PROBE_ALLEN_KEY - -#if ENABLED(PROBING_FANS_OFF) - - void fans_pause(const bool p) { - if (p != fans_paused) { - fans_paused = p; - if (p) - for (uint8_t x = 0; x < FAN_COUNT; x++) { - paused_fanSpeeds[x] = fanSpeeds[x]; - fanSpeeds[x] = 0; - } - else - for (uint8_t x = 0; x < FAN_COUNT; x++) - fanSpeeds[x] = paused_fanSpeeds[x]; - } - } - -#endif // PROBING_FANS_OFF - -#if HAS_BED_PROBE - - // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. - #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST) - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - #endif - - #if QUIET_PROBING - void probing_pause(const bool p) { - #if ENABLED(PROBING_HEATERS_OFF) - thermalManager.pause(p); - #endif - #if ENABLED(PROBING_FANS_OFF) - fans_pause(p); - #endif - if (p) safe_delay( - #if DELAY_BEFORE_PROBING > 25 - DELAY_BEFORE_PROBING - #else - 25 - #endif - ); - } - #endif // QUIET_PROBING - - #if ENABLED(BLTOUCH) - - void bltouch_command(int angle) { - MOVE_SERVO(Z_PROBE_SERVO_NR, angle); // Give the BL-Touch the command and wait - safe_delay(BLTOUCH_DELAY); - } - - bool set_bltouch_deployed(const bool deploy) { - if (deploy && TEST_BLTOUCH()) { // If BL-Touch says it's triggered - bltouch_command(BLTOUCH_RESET); // try to reset it. - bltouch_command(BLTOUCH_DEPLOY); // Also needs to deploy and stow to - bltouch_command(BLTOUCH_STOW); // clear the triggered condition. - safe_delay(1500); // Wait for internal self-test to complete. - // (Measured completion time was 0.65 seconds - // after reset, deploy, and stow sequence) - if (TEST_BLTOUCH()) { // If it still claims to be triggered... - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH); - stop(); // punt! - return true; - } - } - - bltouch_command(deploy ? BLTOUCH_DEPLOY : BLTOUCH_STOW); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("set_bltouch_deployed(", deploy); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - return false; - } - - #endif // BLTOUCH - - /** - * Raise Z to a minimum height to make room for a probe to move - */ - inline void do_probe_raise(const float z_raise) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("do_probe_raise(", z_raise); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - float z_dest = z_raise; - if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; - - NOMORE(z_dest, Z_MAX_POS); - - if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); - } - - // returns false for ok and true for failure - bool set_probe_deployed(const bool deploy) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("set_probe_deployed", current_position); - SERIAL_ECHOLNPAIR("deploy: ", deploy); - } - #endif - - if (endstops.z_probe_enabled == deploy) return false; - - // Make room for probe to deploy (or stow) - // Fix-mounted probe should only raise for deploy - #if ENABLED(FIX_MOUNTED_PROBE) - const bool deploy_stow_condition = deploy; - #else - constexpr bool deploy_stow_condition = true; - #endif - - // For beds that fall when Z is powered off only raise for trusted Z - #if ENABLED(UNKNOWN_Z_NO_RAISE) - const bool unknown_condition = TEST(axis_known_position, Z_AXIS); - #else - constexpr float unknown_condition = true; - #endif - - if (deploy_stow_condition && unknown_condition) - do_probe_raise(MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); - - #if ENABLED(Z_PROBE_SLED) || ENABLED(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)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED); - stop(); - return true; - } - #endif - - const float oldXpos = current_position[X_AXIS], - oldYpos = current_position[Y_AXIS]; - - #ifdef _TRIGGERED_WHEN_STOWED_TEST - - // If endstop is already false, the Z probe is deployed - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions. - // Would a goto be less ugly? - //while (!_TRIGGERED_WHEN_STOWED_TEST) idle(); // would offer the opportunity - // for a triggered when stowed manual probe. - - if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early - // otherwise an Allen-Key probe can't be stowed. - #endif - - #if ENABLED(SOLENOID_PROBE) - - #if HAS_SOLENOID_1 - WRITE(SOL1_PIN, deploy); - #endif - - #elif ENABLED(Z_PROBE_SLED) - - dock_sled(!deploy); - - #elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH) - - MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[deploy ? 0 : 1]); - - #elif ENABLED(Z_PROBE_ALLEN_KEY) - - deploy ? run_deploy_moves_script() : run_stow_moves_script(); - - #endif - - #ifdef _TRIGGERED_WHEN_STOWED_TEST - } // _TRIGGERED_WHEN_STOWED_TEST == deploy - - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed? - - if (IsRunning()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z-Probe failed"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - return true; - - } // _TRIGGERED_WHEN_STOWED_TEST == deploy - - #endif - - do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy - endstops.enable_z_probe(deploy); - return false; - } - - /** - * @brief Used by run_z_probe to do a single Z probe move. - * - * @param z Z destination - * @param fr_mm_s Feedrate in mm/s - * @return true to indicate an error - */ - static bool do_probe_move(const float z, const float fr_mm_s) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> do_probe_move", current_position); - #endif - - #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } - #endif - - // Deploy BLTouch at the start of any probe - #if ENABLED(BLTOUCH) - if (set_bltouch_deployed(true)) return true; - #endif - - #if QUIET_PROBING - probing_pause(true); - #endif - - // Move down until probe triggered - do_blocking_move_to_z(z, fr_mm_s); - - // Check to see if the probe was triggered - const bool probe_triggered = TEST(endstops.trigger_state(), - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - Z_MIN - #else - Z_MIN_PROBE - #endif - ); - - #if QUIET_PROBING - probing_pause(false); - #endif - - // Retract BLTouch immediately after a probe if it was triggered - #if ENABLED(BLTOUCH) - if (probe_triggered && set_bltouch_deployed(false)) return true; - #endif - - endstops.hit_on_purpose(); - - // Get Z where the steppers were interrupted - set_current_from_steppers_for_axis(Z_AXIS); - - // Tell the planner where we actually are - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position); - #endif - - return !probe_triggered; - } - - /** - * @details Used by probe_pt to do a single Z probe at the current position. - * Leaves current_position[Z_AXIS] at the height where the probe triggered. - * - * @return The raw Z position where the probe was triggered - */ - static float run_z_probe() { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position); - #endif - - // 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; - - // Double-probing does a fast probe followed by a slow probe - #if MULTIPLE_PROBING == 2 - - // Do a first probe at the fast speed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("FAST Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } - - float first_probe_z = current_position[Z_AXIS]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("1st Probe Z:", first_probe_z); - #endif - - // move up to make clearance for the probe - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - - #else - - // If the nozzle is well over the travel height then - // move down quickly before doing the slow probe - float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0; - if (zprobe_zoffset < 0) z -= zprobe_zoffset; - - if (current_position[Z_AXIS] > z) { - // If we don't make it to the z position (i.e. the probe triggered), move up to make clearance for the probe - if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - } - #endif - - #if MULTIPLE_PROBING > 2 - float probes_total = 0; - for (uint8_t p = MULTIPLE_PROBING + 1; --p;) { - #endif - - // move down slowly to find bed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("SLOW Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } - - #if MULTIPLE_PROBING > 2 - probes_total += current_position[Z_AXIS]; - if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - } - #endif - - #if MULTIPLE_PROBING > 2 - - // Return the average value of all probes - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); - - #elif MULTIPLE_PROBING == 2 - - const float z2 = current_position[Z_AXIS]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("2nd Probe Z:", z2); - SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - z2); - } - #endif - - // Return a weighted average of the fast and slow probes - const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2; - - #else - - // Return the single probe result - const float measured_z = current_position[Z_AXIS]; - - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); - #endif - - return measured_z; - } - - /** - * - Move to the given XY - * - Deploy the probe, if not already deployed - * - Probe the bed, get the Z position - * - Depending on the 'stow' flag - * - Stow the probe, or - * - 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*/) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx)); - SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry)); - SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none"); - SERIAL_ECHOPAIR(", ", int(verbose_level)); - SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle"); - SERIAL_ECHOLNPGM("_relative)"); - DEBUG_POS("", current_position); - } - #endif - - // TODO: Adapt for SCARA, where the offset rotates - 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); - } - else if (!position_is_reachable(nx, ny)) return NAN; // The given position is in terms of the nozzle - - const float nz = - #if ENABLED(DELTA) - // Move below clip height or xy move will be aborted by do_blocking_move_to - MIN(current_position[Z_AXIS], delta_clip_start_height) - #else - current_position[Z_AXIS] - #endif - ; - - const float old_feedrate_mm_s = feedrate_mm_s; - feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; - - // Move the probe to the starting XYZ - do_blocking_move_to(nx, ny, nz); - - float measured_z = NAN; - if (!DEPLOY_PROBE()) { - measured_z = run_z_probe() + zprobe_zoffset; - - const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; - if (big_raise || raise_after == PROBE_PT_RAISE) - do_blocking_move_to_z(current_position[Z_AXIS] + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - else if (raise_after == PROBE_PT_STOW) - if (STOW_PROBE()) measured_z = NAN; - } - - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Bed X: "); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL(); - } - - feedrate_mm_s = old_feedrate_mm_s; - - if (isnan(measured_z)) { - LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED); - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED); - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); - #endif - - return measured_z; - } - -#endif // HAS_BED_PROBE - -#if HAS_LEVELING - - bool leveling_is_valid() { - return - #if ENABLED(MESH_BED_LEVELING) - mbl.has_mesh() - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - !!bilinear_grid_spacing[X_AXIS] - #elif ENABLED(AUTO_BED_LEVELING_UBL) - ubl.mesh_is_valid() - #else // 3POINT, LINEAR - true - #endif - ; - } - - /** - * Turn bed leveling on or off, fixing the current - * position as-needed. - * - * Disable: Current position = physical position - * Enable: Current position = "unleveled" physical position - */ - void set_bed_leveling_enabled(const bool enable/*=true*/) { - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const bool can_change = (!enable || leveling_is_valid()); - #else - constexpr bool can_change = true; - #endif - - if (can_change && enable != planner.leveling_active) { - - planner.synchronize(); - - #if ENABLED(MESH_BED_LEVELING) - - if (!enable) - planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); - - const bool enabling = enable && leveling_is_valid(); - planner.leveling_active = enabling; - if (enabling) planner.unapply_leveling(current_position); - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - #if PLANNER_LEVELING - if (planner.leveling_active) { // leveling from on to off - // change unleveled current_position to physical current_position without moving steppers. - planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); - planner.leveling_active = false; // disable only AFTER calling apply_leveling - } - else { // leveling from off to on - planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored - // change physical current_position to unleveled current_position without moving steppers. - planner.unapply_leveling(current_position); - } - #else - // UBL equivalents for apply/unapply_leveling - #if ENABLED(SKEW_CORRECTION) - float pos[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - planner.skew(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS]); - #else - const float (&pos)[XYZE] = current_position; - #endif - if (planner.leveling_active) { - current_position[Z_AXIS] += ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - planner.leveling_active = false; - } - else { - planner.leveling_active = true; - current_position[Z_AXIS] -= ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - } - #endif - - #else // ABL - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Force bilinear_z_offset to re-calculate next time - const float reset[XYZ] = { -9999.999, -9999.999, 0 }; - (void)bilinear_z_offset(reset); - #endif - - // Enable or disable leveling compensation in the planner - planner.leveling_active = enable; - - if (!enable) - // When disabling just get the current position from the steppers. - // This will yield the smallest error when first converted back to steps. - set_current_from_steppers_for_axis( - #if ABL_PLANAR - ALL_AXES - #else - Z_AXIS - #endif - ); - else - // When enabling, remove compensation from the current position, - // so compensation will give the right stepper counts. - planner.unapply_leveling(current_position); - - SYNC_PLAN_POSITION_KINEMATIC(); - - #endif // ABL - } - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { - - if (planner.z_fade_height == zfh) return; - - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - - planner.set_z_fade_height(zfh); - - if (leveling_was_active) { - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - set_bed_leveling_enabled(true); - if (do_report && memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); - } - } - - #endif // LEVELING_FADE_HEIGHT - - /** - * Reset calibration results to zero. - */ - void reset_bed_level() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level"); - #endif - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif 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; - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); - #endif - } - -#endif // HAS_LEVELING - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) - - /** - * Enable to produce output in JSON format suitable - * for SCAD or JavaScript mesh visualizers. - * - * Visualize meshes in OpenSCAD using the included script. - * - * buildroot/shared/scripts/MarlinMesh.scad - */ - //#define SCAD_MESH_OUTPUT - - /** - * Print calibration results for plotting or manual frame adjustment. - */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn) { - #ifndef SCAD_MESH_OUTPUT - for (uint8_t x = 0; x < sx; x++) { - for (uint8_t i = 0; i < precision + 2 + (x < 10 ? 1 : 0); i++) - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL((int)x); - } - SERIAL_EOL(); - #endif - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLLNPGM("measured_z = ["); // open 2D array - #endif - for (uint8_t y = 0; y < sy; y++) { - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM(" ["); // open sub-array - #else - if (y < 10) SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL((int)y); - #endif - for (uint8_t x = 0; x < sx; x++) { - SERIAL_PROTOCOLCHAR(' '); - const float offset = fn(x, y); - if (!isnan(offset)) { - if (offset >= 0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(offset, precision); - } - else { - #ifdef SCAD_MESH_OUTPUT - for (uint8_t i = 3; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLPGM("NAN"); - #else - for (uint8_t i = 0; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(i ? '=' : ' '); - #endif - } - #ifdef SCAD_MESH_OUTPUT - if (x < sx - 1) SERIAL_PROTOCOLCHAR(','); - #endif - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLCHAR(']'); // close sub-array - if (y < sy - 1) SERIAL_PROTOCOLCHAR(','); - #endif - SERIAL_EOL(); - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM("];"); // close 2D array - #endif - SERIAL_EOL(); - } - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - /** - * Extrapolate a single point from its neighbors - */ - static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Extrapolate ["); - if (x < 10) SERIAL_CHAR(' '); - SERIAL_ECHO((int)x); - SERIAL_CHAR(xdir ? (xdir > 0 ? '+' : '-') : ' '); - SERIAL_CHAR(' '); - if (y < 10) SERIAL_CHAR(' '); - SERIAL_ECHO((int)y); - SERIAL_CHAR(ydir ? (ydir > 0 ? '+' : '-') : ' '); - SERIAL_CHAR(']'); - } - #endif - if (!isnan(z_values[x][y])) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" (done)"); - #endif - return; // Don't overwrite good values. - } - SERIAL_EOL(); - - // Get X neighbors, Y neighbors, and XY neighbors - const uint8_t x1 = x + xdir, y1 = y + ydir, x2 = x1 + xdir, y2 = y1 + ydir; - float a1 = z_values[x1][y ], a2 = z_values[x2][y ], - b1 = z_values[x ][y1], b2 = z_values[x ][y2], - c1 = z_values[x1][y1], c2 = z_values[x2][y2]; - - // Treat far unprobed points as zero, near as equal to far - if (isnan(a2)) a2 = 0.0; if (isnan(a1)) a1 = a2; - if (isnan(b2)) b2 = 0.0; if (isnan(b1)) b1 = b2; - if (isnan(c2)) c2 = 0.0; if (isnan(c1)) c1 = c2; - - const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2; - - // Take the average instead of the median - z_values[x][y] = (a + b + c) / 3.0; - - // Median is robust (ignores outliers). - // z_values[x][y] = (a < b) ? ((b < c) ? b : (c < a) ? a : c) - // : ((c < b) ? b : (a < c) ? a : c); - } - - //Enable this if your SCARA uses 180° of total area - //#define EXTRAPOLATE_FROM_EDGE - - #if ENABLED(EXTRAPOLATE_FROM_EDGE) - #if GRID_MAX_POINTS_X < GRID_MAX_POINTS_Y - #define HALF_IN_X - #elif GRID_MAX_POINTS_Y < GRID_MAX_POINTS_X - #define HALF_IN_Y - #endif - #endif - - /** - * Fill in the unprobed points (corners of circular print surface) - * using linear extrapolation, away from the center. - */ - static void extrapolate_unprobed_bed_level() { - #ifdef HALF_IN_X - constexpr uint8_t ctrx2 = 0, xlen = GRID_MAX_POINTS_X - 1; - #else - constexpr uint8_t ctrx1 = (GRID_MAX_POINTS_X - 1) / 2, // left-of-center - ctrx2 = (GRID_MAX_POINTS_X) / 2, // right-of-center - xlen = ctrx1; - #endif - - #ifdef HALF_IN_Y - constexpr uint8_t ctry2 = 0, ylen = GRID_MAX_POINTS_Y - 1; - #else - constexpr uint8_t ctry1 = (GRID_MAX_POINTS_Y - 1) / 2, // top-of-center - ctry2 = (GRID_MAX_POINTS_Y) / 2, // bottom-of-center - ylen = ctry1; - #endif - - for (uint8_t xo = 0; xo <= xlen; xo++) - for (uint8_t yo = 0; yo <= ylen; yo++) { - uint8_t x2 = ctrx2 + xo, y2 = ctry2 + yo; - #ifndef HALF_IN_X - const uint8_t x1 = ctrx1 - xo; - #endif - #ifndef HALF_IN_Y - const uint8_t y1 = ctry1 - yo; - #ifndef HALF_IN_X - extrapolate_one_point(x1, y1, +1, +1); // left-below + + - #endif - extrapolate_one_point(x2, y1, -1, +1); // right-below - + - #endif - #ifndef HALF_IN_X - extrapolate_one_point(x1, y2, +1, -1); // left-above + - - #endif - extrapolate_one_point(x2, y2, -1, -1); // right-above - - - } - - } - - static void print_bilinear_leveling_grid() { - SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - - #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) - #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) - float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; - int bilinear_grid_spacing_virt[2] = { 0 }; - float bilinear_grid_factor_virt[2] = { 0 }; - - static void print_bilinear_leveling_grid_virt() { - SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); - print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values_virt[ix][iy]; } - ); - } - - #define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I)) - float bed_level_virt_coord(const uint8_t x, const uint8_t y) { - uint8_t ep = 0, ip = 1; - if (!x || x == ABL_TEMP_POINTS_X - 1) { - if (x) { - ep = GRID_MAX_POINTS_X - 1; - ip = GRID_MAX_POINTS_X - 2; - } - if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2)) - return LINEAR_EXTRAPOLATION( - z_values[ep][y - 1], - z_values[ip][y - 1] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(ep + 1, y), - bed_level_virt_coord(ip + 1, y) - ); - } - if (!y || y == ABL_TEMP_POINTS_Y - 1) { - if (y) { - ep = GRID_MAX_POINTS_Y - 1; - ip = GRID_MAX_POINTS_Y - 2; - } - if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2)) - return LINEAR_EXTRAPOLATION( - z_values[x - 1][ep], - z_values[x - 1][ip] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(x, ep + 1), - bed_level_virt_coord(x, ip + 1) - ); - } - return z_values[x - 1][y - 1]; - } - - static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { - return ( - p[i-1] * -t * sq(1 - t) - + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) - + p[i+1] * t * (1 + 4 * t - 3 * sq(t)) - - p[i+2] * sq(t) * (1 - t) - ) * 0.5; - } - - static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) { - float row[4], column[4]; - for (uint8_t i = 0; i < 4; i++) { - for (uint8_t j = 0; j < 4; j++) { - column[j] = bed_level_virt_coord(i + x - 1, j + y - 1); - } - row[i] = bed_level_virt_cmr(column, 1, ty); - } - return bed_level_virt_cmr(row, 1, tx); - } - - void bed_level_virt_interpolate() { - bilinear_grid_spacing_virt[X_AXIS] = bilinear_grid_spacing[X_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_spacing_virt[Y_AXIS] = bilinear_grid_spacing[Y_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_factor_virt[X_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[X_AXIS]); - bilinear_grid_factor_virt[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[Y_AXIS]); - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) - for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { - if ((ty && y == GRID_MAX_POINTS_Y - 1) || (tx && x == GRID_MAX_POINTS_X - 1)) - continue; - z_values_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = - bed_level_virt_2cmr( - x + 1, - y + 1, - (float)tx / (BILINEAR_SUBDIVISIONS), - (float)ty / (BILINEAR_SUBDIVISIONS) - ); - } - } - #endif // ABL_BILINEAR_SUBDIVISION - - // Refresh after other values have been updated - void refresh_bed_level() { - bilinear_grid_factor[X_AXIS] = RECIPROCAL(bilinear_grid_spacing[X_AXIS]); - bilinear_grid_factor[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing[Y_AXIS]); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - -#endif // AUTO_BED_LEVELING_BILINEAR - -#if ENABLED(SENSORLESS_HOMING) - - /** - * Set sensorless homing if the axis has it, accounting for Core Kinematics. - */ - void sensorless_homing_per_axis(const AxisEnum axis, const bool enable=true) { - switch (axis) { - #if X_SENSORLESS - case X_AXIS: - tmc_sensorless_homing(stepperX, enable); - #if CORE_IS_XY && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #elif CORE_IS_XZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - tmc_sensorless_homing(stepperY, enable); - #if CORE_IS_XY && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - tmc_sensorless_homing(stepperZ, enable); - #if CORE_IS_XZ && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #endif - break; - #endif - default: break; - } - } - -#endif // SENSORLESS_HOMING - -/** - * Home an individual linear axis - */ -static void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> do_homing_move(", axis_codes[axis]); - SERIAL_ECHOPAIR(", ", distance); - SERIAL_ECHOPGM(", "); - if (fr_mm_s) - SERIAL_ECHO(fr_mm_s); - else { - SERIAL_ECHOPAIR("[", homing_feedrate(axis)); - SERIAL_CHAR(']'); - } - SERIAL_ECHOLNPGM(")"); - } - #endif - - #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } - #endif - - // Only do some things when moving towards an endstop - const int8_t axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - (axis == X_AXIS) ? x_home_dir(active_extruder) : - #endif - home_dir(axis); - const bool is_home_dir = (axis_home_dir > 0) == (distance > 0); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(true); - #endif - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis); - #endif - } - - // Tell the planner the axis is at 0 - current_position[axis] = 0; - - // Do the move, which is required to hit an endstop - #if IS_SCARA - SYNC_PLAN_POSITION_KINEMATIC(); - current_position[axis] = distance; - inverse_kinematics(current_position); - planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); - #else - sync_plan_position(); - current_position[axis] = distance; // Set delta/cartesian axes directly - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); - #endif - - planner.synchronize(); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(false); - #endif - - endstops.validate_homing_move(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis, false); - #endif - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("<<< do_homing_move(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif -} - -/** - * Home an individual "raw axis" to its endstop. - * This applies to XYZ on Cartesian and Core robots, and - * to the individual ABC steppers on DELTA and SCARA. - * - * At the end of the procedure the axis is marked as - * homed and the current position of that axis is updated. - * Kinematic robots should wait till all axes are homed - * before updating the current position. - */ - -static void homeaxis(const AxisEnum axis) { - - #if IS_SCARA - // Only Z homing (with probe) is permitted - if (axis != Z_AXIS) { BUZZ(100, 880); return; } - #else - #define CAN_HOME(A) \ - (axis == _AXIS(A) && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0))) - if (!CAN_HOME(X) && !CAN_HOME(Y) && !CAN_HOME(Z)) return; - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> homeaxis(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - const int axis_home_dir = ( - #if ENABLED(DUAL_X_CARRIAGE) - axis == X_AXIS ? x_home_dir(active_extruder) : - #endif - home_dir(axis) - ); - - // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && DEPLOY_PROBE()) return; - #endif - - // Set flags for X, Y, Z motor locking - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - switch (axis) { - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - case Z_AXIS: - #endif - stepper.set_homing_dual_axis(true); - default: break; - } - #endif - - // Fast move towards endstop until triggered - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:"); - #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - - do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif - - // When homing Z with probe respect probe clearance - const float bump = axis_home_dir * ( - #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS && (Z_HOME_BUMP_MM)) ? MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_HOME_BUMP_MM) : - #endif - home_bump_mm(axis) - ); - - // If a second homing move is configured... - if (bump) { - // Move away from the endstop by the axis HOME_BUMP_MM - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Move Away:"); - #endif - do_homing_move(axis, -bump - #if HOMING_Z_WITH_PROBE - , axis == Z_AXIS ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0.00 - #endif - ); - - // Slow move towards endstop until triggered - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:"); - #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif - } - - /** - * Home axes that have dual endstops... differently - */ - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - const bool pos_dir = axis_home_dir > 0; - #if ENABLED(X_DUAL_ENDSTOPS) - if (axis == X_AXIS) { - const float adj = ABS(endstops.x_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_x_lock(false); - stepper.set_x2_lock(false); - } - } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (axis == Y_AXIS) { - const float adj = ABS(endstops.y_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_y_lock(false); - stepper.set_y2_lock(false); - } - } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (axis == Z_AXIS) { - const float adj = ABS(endstops.z_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); - stepper.set_z2_lock(false); - } - } - #endif - stepper.set_homing_dual_axis(false); - #endif - - #if IS_SCARA - - set_axis_is_at_home(axis); - SYNC_PLAN_POSITION_KINEMATIC(); - - #elif ENABLED(DELTA) - - // Delta has already moved all three towers up in G28 - // so here it re-homes each tower in turn. - // Delta homing treats the axes as normal linear axes. - - // retrace by the amount specified in delta_endstop_adj + additional dist in order to have minimum steps - if (delta_endstop_adj[axis] * Z_HOME_DIR <= 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("delta_endstop_adj:"); - #endif - do_homing_move(axis, delta_endstop_adj[axis] - (MIN_STEPS_PER_SEGMENT + 1) * planner.steps_to_mm[axis] * Z_HOME_DIR); - } - - #else - - // For cartesian/core machines, - // set the axis to its home position - set_axis_is_at_home(axis); - sync_plan_position(); - - destination[axis] = current_position[axis]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); - #endif - - #endif - - // Put away the Z probe - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && STOW_PROBE()) return; - #endif - - // Clear retracted status if homing the Z axis - #if ENABLED(FWRETRACT) - if (axis == Z_AXIS) fwretract.hop_amount = 0.0; - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("<<< homeaxis(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif -} // homeaxis() - -#if ENABLED(MIXING_EXTRUDER) - - void normalize_mix() { - float mix_total = 0.0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += RECIPROCAL(mixing_factor[i]); - // Scale all values if they don't add up to ~1.0 - if (!NEAR(mix_total, 1.0)) { - SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling."); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= mix_total; - } - } - - #if ENABLED(DIRECT_MIXING_IN_G1) - // Get mixing parameters from the GCode - // The total "must" be 1.0 (but it will be normalized) - // If no mix factors are given, the old mix is preserved - void gcode_get_mix() { - const char* mixing_codes = "ABCDHI"; - byte mix_bits = 0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) { - if (parser.seenval(mixing_codes[i])) { - SBI(mix_bits, i); - float v = parser.value_float(); - NOLESS(v, 0.0); - mixing_factor[i] = RECIPROCAL(v); - } - } - // If any mixing factors were included, clear the rest - // If none were included, preserve the last mix - if (mix_bits) { - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - if (!TEST(mix_bits, i)) mixing_factor[i] = 0.0; - normalize_mix(); - } - } - #endif - -#endif - -/** - * *************************************************************************** - * ***************************** G-CODE HANDLING ***************************** - * *************************************************************************** - */ - -/** - * Set XYZE destination and feedrate from the current GCode command - * - * - Set destination from included axis codes - * - Set to current for missing axis codes - * - Set the feedrate, if included - */ -void gcode_get_destination() { - LOOP_XYZE(i) { - if (parser.seen(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); - } - else - destination[i] = current_position[i]; - } - - if (parser.linearval('F') > 0) - feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); - - #if ENABLED(PRINTCOUNTER) - if (!DEBUGGING(DRYRUN)) - print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); - #endif - - // Get ABCDHI mixing factors - #if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1) - gcode_get_mix(); - #endif -} - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - - /** - * Output a "busy" message at regular intervals - * while the machine is not accepting commands. - */ - void host_keepalive() { - const millis_t ms = millis(); - if (!suspend_auto_report && host_keepalive_interval && busy_state != NOT_BUSY) { - if (PENDING(ms, next_busy_signal_ms)) return; - switch (busy_state) { - case IN_HANDLER: - case IN_PROCESS: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PROCESSING); - break; - case PAUSED_FOR_USER: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_USER); - break; - case PAUSED_FOR_INPUT: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT); - break; - default: - break; - } - } - next_busy_signal_ms = ms + host_keepalive_interval * 1000UL; - } - -#endif // HOST_KEEPALIVE_FEATURE - - -/************************************************** - ***************** GCode Handlers ***************** - **************************************************/ - -#if ENABLED(NO_MOTION_BEFORE_HOMING) - #define G0_G1_CONDITION !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) -#else - #define G0_G1_CONDITION true -#endif - -/** - * G0, G1: Coordinated movement of X Y Z E axes - */ -inline void gcode_G0_G1( - #if IS_SCARA - bool fast_move=false - #endif -) { - if (IsRunning() && G0_G1_CONDITION) { - gcode_get_destination(); // For X Y Z E F - - #if ENABLED(FWRETRACT) - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - // When M209 Autoretract is enabled, convert E-only moves to firmware retract/prime moves - if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { - const float echange = destination[E_AXIS] - current_position[E_AXIS]; - // Is this a retract or prime move? - if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) { - current_position[E_AXIS] = destination[E_AXIS]; // Hide a G1-based retract/prime from calculations - sync_plan_position_e(); // AND from the planner - return fwretract.retract(echange < 0.0); // Firmware-based retract/prime (double-retract ignored) - } - } - } - #endif // FWRETRACT - - #if IS_SCARA - fast_move ? prepare_uninterpolated_move_to_destination() : prepare_move_to_destination(); - #else - prepare_move_to_destination(); - #endif - - #if ENABLED(NANODLP_Z_SYNC) - #if ENABLED(NANODLP_ALL_AXIS) - #define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message - #else - #define _MOVE_SYNC parser.seenval('Z') // Only for Z move - #endif - if (_MOVE_SYNC) { - planner.synchronize(); - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - } - #endif - } -} - -/** - * G2: Clockwise Arc - * G3: Counterclockwise Arc - * - * This command has two forms: IJ-form and R-form. - * - * - I specifies an X offset. J specifies a Y offset. - * At least one of the IJ parameters is required. - * X and Y can be omitted to do a complete circle. - * The given XY is not error-checked. The arc ends - * based on the angle of the destination. - * Mixing I or J with R will throw an error. - * - * - R specifies the radius. X or Y is required. - * Omitting both X and Y will throw an error. - * X or Y must differ from the current XY. - * Mixing R with I or J will throw an error. - * - * - P specifies the number of full circles to do - * before the specified arc move. - * - * Examples: - * - * G2 I10 ; CW circle centered at X+10 - * G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12 - */ -#if ENABLED(ARC_SUPPORT) - - inline void gcode_G2_G3(const bool clockwise) { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - - #if ENABLED(SF_ARC_FIX) - const bool relative_mode_backup = relative_mode; - relative_mode = true; - #endif - - gcode_get_destination(); - - #if ENABLED(SF_ARC_FIX) - relative_mode = relative_mode_backup; - #endif - - 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 - 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 / d, sy = dx / d, // 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 { - if (parser.seenval('I')) arc_offset[0] = parser.value_linear_units(); - if (parser.seenval('J')) arc_offset[1] = parser.value_linear_units(); - } - - if (arc_offset[0] || arc_offset[1]) { - - #if ENABLED(ARC_P_CIRCLES) - // P indicates number of circles to do - int8_t circles_to_do = parser.byteval('P'); - if (!WITHIN(circles_to_do, 0, 100)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } - while (circles_to_do--) - plan_arc(current_position, arc_offset, clockwise); - #endif - - // Send the arc to the planner - plan_arc(destination, arc_offset, clockwise); - } - else { - // Bad arguments - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } - } - } - -#endif // ARC_SUPPORT - -void dwell(millis_t time) { - time += millis(); - while (PENDING(millis(), time)) idle(); -} - -/** - * G4: Dwell S or P - */ -inline void gcode_G4() { - millis_t dwell_ms = 0; - - if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait - if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait - - planner.synchronize(); - #if ENABLED(NANODLP_Z_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL); - - dwell(dwell_ms); -} - -#if ENABLED(BEZIER_CURVE_SUPPORT) - - /** - * Parameters interpreted according to: - * http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G5-Cubic-Spline - * However I, J omission is not supported at this point; all - * parameters can be omitted and default to zero. - */ - - /** - * G5: Cubic B-spline - */ - inline void gcode_G5() { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - - #if ENABLED(CNC_WORKSPACE_PLANES) - if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_BAD_PLANE_MODE); - return; - } - #endif - - gcode_get_destination(); - - const float offset[] = { - parser.linearval('I'), - parser.linearval('J'), - parser.linearval('P'), - parser.linearval('Q') - }; - - plan_cubic_move(destination, offset); - } - } - -#endif // BEZIER_CURVE_SUPPORT - -#if ENABLED(FWRETRACT) - - /** - * G10 - Retract filament according to settings of M207 - */ - inline void gcode_G10() { - #if EXTRUDERS > 1 - const bool rs = parser.boolval('S'); - #endif - fwretract.retract(true - #if EXTRUDERS > 1 - , rs - #endif - ); - } - - /** - * G11 - Recover filament according to settings of M208 - */ - inline void gcode_G11() { fwretract.retract(false); } - -#endif // FWRETRACT - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - /** - * G12: Clean the nozzle - */ - inline void gcode_G12() { - // Don't allow nozzle cleaning without homing first - if (axis_unhomed_error()) return; - - const uint8_t pattern = parser.ushortval('P', 0), - strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), - objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); - const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); - - Nozzle::clean(pattern, strokes, radius, objects); - } -#endif - -#if ENABLED(CNC_WORKSPACE_PLANES) - - inline void report_workspace_plane() { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Workspace Plane "); - serialprintPGM( - workspace_plane == PLANE_YZ ? PSTR("YZ\n") : - workspace_plane == PLANE_ZX ? PSTR("ZX\n") : - PSTR("XY\n") - ); - } - - inline void set_workspace_plane(const WorkspacePlane plane) { - workspace_plane = plane; - if (DEBUGGING(INFO)) report_workspace_plane(); - } - - /** - * G17: Select Plane XY - * G18: Select Plane ZX - * G19: Select Plane YZ - */ - inline void gcode_G17() { set_workspace_plane(PLANE_XY); } - inline void gcode_G18() { set_workspace_plane(PLANE_ZX); } - inline void gcode_G19() { set_workspace_plane(PLANE_YZ); } - -#endif // CNC_WORKSPACE_PLANES - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - - /** - * Select a coordinate system and update the workspace offset. - * System index -1 is used to specify machine-native. - */ - bool select_coordinate_system(const int8_t _new) { - if (active_coordinate_system == _new) return false; - 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]); - 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; - update_software_endstops((AxisEnum)i); - } - } - return true; - } - - /** - * G53: Apply native workspace to the current move - * - * In CNC G-code G53 is a modifier. - * It precedes a movement command (or other modifiers) on the same line. - * This is the first command to use parser.chain() to make this possible. - * - * Marlin also uses G53 on a line by itself to go back to native space. - */ - inline void gcode_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; - } - } - - /** - * G54-G59.3: Select a new workspace - * - * A workspace is an XYZ offset to the machine native space. - * All workspaces default to 0,0,0 at start, or with EEPROM - * support they may be restored from a previous session. - * - * G92 is used to set the current workspace's offset. - */ - inline void gcode_G54_59(uint8_t subcode=0) { - const int8_t _space = parser.codenum - 54 + subcode; - if (select_coordinate_system(_space)) { - SERIAL_PROTOCOLLNPAIR("Select workspace ", _space); - report_current_position(); - } - } - FORCE_INLINE void gcode_G54() { gcode_G54_59(); } - FORCE_INLINE void gcode_G55() { gcode_G54_59(); } - FORCE_INLINE void gcode_G56() { gcode_G54_59(); } - FORCE_INLINE void gcode_G57() { gcode_G54_59(); } - FORCE_INLINE void gcode_G58() { gcode_G54_59(); } - FORCE_INLINE void gcode_G59() { gcode_G54_59(parser.subcode); } - -#endif - -#if ENABLED(INCH_MODE_SUPPORT) - /** - * G20: Set input mode to inches - */ - inline void gcode_G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } - - /** - * G21: Set input mode to millimeters - */ - inline void gcode_G21() { parser.set_input_linear_units(LINEARUNIT_MM); } -#endif - -#if ENABLED(NOZZLE_PARK_FEATURE) - /** - * G27: Park the nozzle - */ - inline void gcode_G27() { - // Don't allow nozzle parking without homing first - if (axis_unhomed_error()) return; - Nozzle::park(parser.ushortval('P')); - } -#endif // NOZZLE_PARK_FEATURE - -#if ENABLED(QUICK_HOME) - - static void quick_home_xy() { - - // Pretend the current position is 0,0 - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; - sync_plan_position(); - - const int x_axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - x_home_dir(active_extruder) - #else - home_dir(X_AXIS) - #endif - ; - - const float mlx = max_length(X_AXIS), - mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_s = MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS); - sensorless_homing_per_axis(Y_AXIS); - #endif - - do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s); - - endstops.validate_homing_move(); - - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS, false); - sensorless_homing_per_axis(Y_AXIS, false); - #endif - } - -#endif // QUICK_HOME - -#if ENABLED(DEBUG_LEVELING_FEATURE) - - void log_machine_info() { - SERIAL_ECHOPGM("Machine Type: "); - #if ENABLED(DELTA) - SERIAL_ECHOLNPGM("Delta"); - #elif IS_SCARA - SERIAL_ECHOLNPGM("SCARA"); - #elif IS_CORE - SERIAL_ECHOLNPGM("Core"); - #else - SERIAL_ECHOLNPGM("Cartesian"); - #endif - - SERIAL_ECHOPGM("Probe: "); - #if ENABLED(PROBE_MANUALLY) - SERIAL_ECHOLNPGM("PROBE_MANUALLY"); - #elif ENABLED(FIX_MOUNTED_PROBE) - SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE"); - #elif ENABLED(BLTOUCH) - SERIAL_ECHOLNPGM("BLTOUCH"); - #elif HAS_Z_SERVO_PROBE - SERIAL_ECHOLNPGM("SERVO PROBE"); - #elif ENABLED(Z_PROBE_SLED) - SERIAL_ECHOLNPGM("Z_PROBE_SLED"); - #elif ENABLED(Z_PROBE_ALLEN_KEY) - SERIAL_ECHOLNPGM("Z_PROBE_ALLEN_KEY"); - #else - SERIAL_ECHOLNPGM("NONE"); - #endif - - #if HAS_BED_PROBE - SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER); - SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER); - SERIAL_ECHOPAIR(" Z:", zprobe_zoffset); - #if X_PROBE_OFFSET_FROM_EXTRUDER > 0 - SERIAL_ECHOPGM(" (Right"); - #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0 - SERIAL_ECHOPGM(" (Left"); - #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0 - SERIAL_ECHOPGM(" (Middle"); - #else - SERIAL_ECHOPGM(" (Aligned With"); - #endif - #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Distal"); - #else - SERIAL_ECHOPGM("-Back"); - #endif - #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Proximal"); - #else - SERIAL_ECHOPGM("-Front"); - #endif - #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 - SERIAL_ECHOPGM("-Center"); - #endif - if (zprobe_zoffset < 0) - SERIAL_ECHOPGM(" & Below"); - else if (zprobe_zoffset > 0) - SERIAL_ECHOPGM(" & Above"); - else - SERIAL_ECHOPGM(" & Same Z as"); - SERIAL_ECHOLNPGM(" Nozzle)"); - #endif - - #if HAS_ABL - SERIAL_ECHOPGM("Auto Bed Leveling: "); - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - SERIAL_ECHOPGM("LINEAR"); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPGM("BILINEAR"); - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - SERIAL_ECHOPGM("3POINT"); - #elif ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL"); - #endif - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) - SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height); - #endif - #if ABL_PLANAR - const float diff[XYZ] = { - planner.get_axis_position_mm(X_AXIS) - current_position[X_AXIS], - planner.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS], - planner.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS] - }; - SERIAL_ECHOPGM("ABL Adjustment X"); - if (diff[X_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[X_AXIS]); - SERIAL_ECHOPGM(" Y"); - if (diff[Y_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Y_AXIS]); - SERIAL_ECHOPGM(" Z"); - if (diff[Z_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Z_AXIS]); - #else - #if ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPAIR("Bilinear Grid X", bilinear_start[X_AXIS]); - SERIAL_ECHOPAIR(" Y", bilinear_start[Y_AXIS]); - SERIAL_ECHOPAIR(" W", ABL_BG_SPACING(X_AXIS)); - SERIAL_ECHOLNPAIR(" H", ABL_BG_SPACING(Y_AXIS)); - SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bilinear_z_offset(current_position); - #endif - SERIAL_ECHO(ftostr43sign(rz, '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position[Z_AXIS]), '+')); - SERIAL_CHAR(')'); - } - #endif - #endif - } - else - SERIAL_ECHOLNPGM(" (disabled)"); - - SERIAL_EOL(); - - #elif ENABLED(MESH_BED_LEVELING) - - SERIAL_ECHOPGM("Mesh Bed Leveling"); - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS] - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , 1.0 - #endif - ), '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign( - mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], planner.fade_scaling_factor_for_z(current_position[Z_AXIS])), '+' - )); - SERIAL_CHAR(')'); - } - #endif - } - else - SERIAL_ECHOPGM(" (disabled)"); - - SERIAL_EOL(); - - #endif // MESH_BED_LEVELING - } - -#endif // DEBUG_LEVELING_FEATURE - -#if ENABLED(DELTA) - - #if ENABLED(SENSORLESS_HOMING) - inline void delta_sensorless_homing(const bool on=true) { - sensorless_homing_per_axis(A_AXIS, on); - sensorless_homing_per_axis(B_AXIS, on); - sensorless_homing_per_axis(C_AXIS, on); - } - #endif - - /** - * A delta can only safely home all axes at the same time - * This is like quick_home_xy() but for 3 towers. - */ - inline void home_delta() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); - #endif - // Init the current position of all carriages to 0,0,0 - ZERO(current_position); - sync_plan_position(); - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(); - #endif - - // Move all carriages together linearly until an endstop is hit. - current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10); - feedrate_mm_s = homing_feedrate(X_AXIS); - buffer_line_to_current_position(); - planner.synchronize(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(false); - #endif - - endstops.validate_homing_move(); - - // At least one carriage has reached the top. - // Now re-home each carriage separately. - homeaxis(A_AXIS); - homeaxis(B_AXIS); - homeaxis(C_AXIS); - - // Set all carriages to their home positions - // Do this here all at once for Delta, because - // XYZ isn't ABC. Applying this per-tower would - // give the impression that they are the same. - LOOP_XYZ(i) set_axis_is_at_home((AxisEnum)i); - - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); - #endif - } - -#endif // DELTA - -#ifdef Z_AFTER_PROBING - void move_z_after_probing() { - if (current_position[Z_AXIS] != Z_AFTER_PROBING) { - do_blocking_move_to_z(Z_AFTER_PROBING); - current_position[Z_AXIS] = Z_AFTER_PROBING; - } - } -#endif - -#if ENABLED(Z_SAFE_HOMING) - - inline void home_z_safely() { - - // Disallow Z homing if X or Y are unknown - if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { - LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_Z_HOMING); - return; - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Z_SAFE_HOMING >>>"); - #endif - - SYNC_PLAN_POSITION_KINEMATIC(); - - /** - * Move the Z probe (or just the nozzle) to the safe homing point - */ - destination[X_AXIS] = Z_SAFE_HOMING_X_POINT; - destination[Y_AXIS] = Z_SAFE_HOMING_Y_POINT; - 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; - #endif - - if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); - #endif - - // This causes the carriage on Dual X to unpark - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - - #if ENABLED(SENSORLESS_HOMING) - safe_delay(500); // Short delay needed to settle - #endif - - do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); - homeaxis(Z_AXIS); - } - else { - LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< Z_SAFE_HOMING"); - #endif - } - -#endif // Z_SAFE_HOMING - -#if ENABLED(PROBE_MANUALLY) - bool g29_in_progress = false; -#else - constexpr bool g29_in_progress = false; -#endif - -/** - * G28: Home all axes according to settings - * - * Parameters - * - * None Home to all axes with no parameters. - * With QUICK_HOME enabled XY will home together, then Z. - * - * O Home only if position is unknown - * - * Rn Raise by n mm/inches before homing - * - * Cartesian parameters - * - * X Home to the X endstop - * Y Home to the Y endstop - * Z Home to the Z endstop - * - */ -inline void gcode_G28(const bool always_home_all) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> G28"); - log_machine_info(); - } - #endif - - #if ENABLED(MARLIN_DEV_MODE) - if (parser.seen('S')) { - LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a); - SYNC_PLAN_POSITION_KINEMATIC(); - SERIAL_ECHOLNPGM("Simulated Homing"); - report_current_position(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); - #endif - return; - } - #endif - - if (all_axes_known() && parser.boolval('O')) { // home only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> homing not needed, skip"); - SERIAL_ECHOLNPGM("<<< G28"); - } - #endif - return; - } - - // Wait for planner moves to finish! - planner.synchronize(); - - // Cancel the active G29 session - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #endif - - // Disable the leveling matrix before homing - #if HAS_LEVELING - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - const bool leveling_was_active = planner.leveling_active; - #endif - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif - - #if ENABLED(BLTOUCH) - // Make sure any BLTouch error condition is cleared - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); - #endif - - // Always home with tool 0 active - #if HOTENDS > 1 - #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) - const uint8_t old_tool_index = active_extruder; - #endif - tool_change(0, 0, true); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - extruder_duplication_enabled = false; - #endif - - setup_for_endstop_or_probe_move(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)"); - #endif - endstops.enable(true); // Enable endstops for next homing move - - #if ENABLED(DELTA) - - home_delta(); - UNUSED(always_home_all); - - #else // NOT DELTA - - const bool homeX = always_home_all || parser.seen('X'), - homeY = always_home_all || parser.seen('Y'), - homeZ = always_home_all || parser.seen('Z'), - home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ); - - set_destination_from_current(); - - #if Z_HOME_DIR > 0 // If homing away from BED do Z first - - if (home_all || homeZ) homeaxis(Z_AXIS); - - #endif - - const float z_homing_height = ( - #if ENABLED(UNKNOWN_Z_NO_RAISE) - !TEST(axis_known_position, Z_AXIS) ? 0 : - #endif - (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) - ); - - if (z_homing_height && (home_all || homeX || homeY)) { - // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = z_homing_height; - if (destination[Z_AXIS] > current_position[Z_AXIS]) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) - SERIAL_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); - #endif - - do_blocking_move_to_z(destination[Z_AXIS]); - } - } - - #if ENABLED(QUICK_HOME) - - if (home_all || (homeX && homeY)) quick_home_xy(); - - #endif - - // Home Y (before X) - #if ENABLED(HOME_Y_BEFORE_X) - - if (home_all || homeY - #if ENABLED(CODEPENDENT_XY_HOMING) - || homeX - #endif - ) homeaxis(Y_AXIS); - - #endif - - // Home X - if (home_all || homeX - #if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X) - || homeY - #endif - ) { - - #if ENABLED(DUAL_X_CARRIAGE) - - // Always home the 2nd (right) extruder first - active_extruder = 1; - homeaxis(X_AXIS); - - // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position[X_AXIS]; - - // Home the 1st (left) extruder - active_extruder = 0; - homeaxis(X_AXIS); - - // Consider the active extruder to be parked - COPY(raised_parked_position, current_position); - delayed_move_time = 0; - active_extruder_parked = true; - - #else - - homeaxis(X_AXIS); - - #endif - } - - // Home Y (after X) - #if DISABLED(HOME_Y_BEFORE_X) - if (home_all || homeY) homeaxis(Y_AXIS); - #endif - - // Home Z last if homing towards the bed - #if Z_HOME_DIR < 0 - if (home_all || homeZ) { - #if ENABLED(Z_SAFE_HOMING) - home_z_safely(); - #else - homeaxis(Z_AXIS); - #endif - - #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - } // home_all || homeZ - #endif // Z_HOME_DIR < 0 - - SYNC_PLAN_POSITION_KINEMATIC(); - - #endif // !DELTA (gcode_G28) - - endstops.not_homing(); - - #if ENABLED(DELTA) && ENABLED(DELTA_HOME_TO_SAFE_ZONE) - // move to a height where we can use the full xy-area - do_blocking_move_to_z(delta_clip_start_height); - #endif - - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - set_bed_leveling_enabled(leveling_was_active); - #endif - - clean_up_after_endstop_or_probe_move(); - - // Restore the active tool after homing - #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) - #if ENABLED(PARKING_EXTRUDER) - #define NO_FETCH false // fetch the previous toolhead - #else - #define NO_FETCH true - #endif - tool_change(old_tool_index, 0, NO_FETCH); - #endif - - lcd_refresh(); - - report_current_position(); - - #if ENABLED(NANODLP_Z_SYNC) - #if ENABLED(NANODLP_ALL_AXIS) - #define _HOME_SYNC true // For any axis, output sync text. - #else - #define _HOME_SYNC (home_all || homeZ) // Only for Z-axis - #endif - if (_HOME_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); - #endif -} // G28 - -void home_all_axes() { gcode_G28(true); } - -#if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY) - - inline void _manual_goto_xy(const float &rx, const float &ry) { - - #ifdef MANUAL_PROBE_START_Z - #if MANUAL_PROBE_HEIGHT > 0 - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(MAX(0,MANUAL_PROBE_START_Z)); - #else - do_blocking_move_to(rx, ry, MAX(0,MANUAL_PROBE_START_Z)); - #endif - #elif MANUAL_PROBE_HEIGHT > 0 - const float prev_z = current_position[Z_AXIS]; - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(prev_z); - #else - do_blocking_move_to_xy(rx, ry); - #endif - - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; - - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - -#endif - -#if ENABLED(MESH_BED_LEVELING) - - // Save 130 bytes with non-duplication of PSTR - void echo_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); } - - /** - * G29: Mesh-based Z probe, probes a grid and produces a - * mesh to compensate for variable bed height - * - * Parameters With MESH_BED_LEVELING: - * - * S0 Produce a mesh report - * S1 Start probing mesh points - * S2 Probe the next mesh point - * S3 Xn Yn Zn.nn Manually modify a single point - * S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed. - * S5 Reset and disable mesh - * - * The S0 report the points as below - * - * +----> X-axis 1-n - * | - * | - * v Y-axis 1-n - * - */ - inline void gcode_G29() { - - static int mbl_probe_index = -1; - #if HAS_SOFTWARE_ENDSTOPS - static bool enable_soft_endstops; - #endif - - MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); - if (!WITHIN(state, 0, 5)) { - SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); - return; - } - - int8_t px, py; - - switch (state) { - case MeshReport: - if (leveling_is_valid()) { - SERIAL_PROTOCOLLNPAIR("State: ", planner.leveling_active ? MSG_ON : MSG_OFF); - mbl.report_mesh(); - } - else - SERIAL_PROTOCOLLNPGM("Mesh bed leveling has no data."); - break; - - case MeshStart: - mbl.reset(); - mbl_probe_index = 0; - if (!lcd_wait_for_move) { - enqueue_and_echo_commands_P(PSTR("G28\nG29 S2")); - return; - } - state = MeshNext; - - case MeshNext: - if (mbl_probe_index < 0) { - SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first."); - return; - } - // For each G29 S2... - if (mbl_probe_index == 0) { - #if HAS_SOFTWARE_ENDSTOPS - // For the initial G29 S2 save software endstop state - enable_soft_endstops = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - // Save Z for the previous mesh position - mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - } - // If there's another point to sample, move there with optional lift. - if (mbl_probe_index < GRID_MAX_POINTS) { - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - - mbl.zigzag(mbl_probe_index++, px, py); - _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); - } - else { - // One last "return to the bed" (as originally coded) at completion - current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT; - buffer_line_to_current_position(); - planner.synchronize(); - - // After recording the last point, activate home and activate - mbl_probe_index = -1; - SERIAL_PROTOCOLLNPGM("Mesh probing done."); - BUZZ(100, 659); - BUZZ(100, 698); - - home_all_axes(); - set_bed_leveling_enabled(true); - - #if ENABLED(MESH_G28_REST_ORIGIN) - current_position[Z_AXIS] = 0; - set_destination_from_current(); - buffer_line_to_destination(homing_feedrate(Z_AXIS)); - planner.synchronize(); - #endif - - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - break; - - case MeshSet: - if (parser.seenval('X')) { - px = parser.value_int() - 1; - if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) { - SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; - } - } - else { - SERIAL_CHAR('X'); echo_not_entered(); - return; - } - - if (parser.seenval('Y')) { - py = parser.value_int() - 1; - if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - return; - } - } - else { - SERIAL_CHAR('Y'); echo_not_entered(); - return; - } - - if (parser.seenval('Z')) - mbl.z_values[px][py] = parser.value_linear_units(); - else { - SERIAL_CHAR('Z'); echo_not_entered(); - return; - } - break; - - case MeshSetZOffset: - if (parser.seenval('Z')) - mbl.z_offset = parser.value_linear_units(); - else { - SERIAL_CHAR('Z'); echo_not_entered(); - return; - } - break; - - case MeshReset: - reset_bed_level(); - break; - - } // switch (state) - - if (state == MeshNext) { - SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS)); - SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS)); - } - - report_current_position(); - } - -#elif OLDSCHOOL_ABL - - #if ABL_GRID - #if ENABLED(PROBE_Y_FIRST) - #define PR_OUTER_VAR xCount - #define PR_OUTER_END abl_grid_points_x - #define PR_INNER_VAR yCount - #define PR_INNER_END abl_grid_points_y - #else - #define PR_OUTER_VAR yCount - #define PR_OUTER_END abl_grid_points_y - #define PR_INNER_VAR xCount - #define PR_INNER_END abl_grid_points_x - #endif - #endif - - /** - * G29: Detailed Z probe, probes the bed at 3 or more points. - * Will fail if the printer has not been homed with G28. - * - * Enhanced G29 Auto Bed Leveling Probe Routine - * - * O Auto-level only if needed - * - * D Dry-Run mode. Just evaluate the bed Topology - Don't apply - * or alter the bed level data. Useful to check the topology - * after a first run of G29. - * - * J Jettison current bed leveling data - * - * V Set the verbose level (0-4). Example: "G29 V3" - * - * Parameters With LINEAR leveling only: - * - * P Set the size of the grid that will be probed (P x P points). - * Example: "G29 P4" - * - * X Set the X size of the grid that will be probed (X x Y points). - * Example: "G29 X7 Y5" - * - * Y Set the Y size of the grid that will be probed (X x Y points). - * - * T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report. - * This is useful for manual bed leveling and finding flaws in the bed (to - * assist with part placement). - * Not supported by non-linear delta printer bed leveling. - * - * Parameters With LINEAR and BILINEAR leveling only: - * - * S Set the XY travel speed between probe points (in units/min) - * - * F Set the Front limit of the probing grid - * B Set the Back limit of the probing grid - * L Set the Left limit of the probing grid - * R Set the Right limit of the probing grid - * - * Parameters with DEBUG_LEVELING_FEATURE only: - * - * C Make a totally fake grid with no actual probing. - * For use in testing when no probing is possible. - * - * Parameters with BILINEAR leveling only: - * - * Z Supply an additional Z probe offset - * - * Extra parameters with PROBE_MANUALLY: - * - * To do manual probing simply repeat G29 until the procedure is complete. - * The first G29 accepts parameters. 'G29 Q' for status, 'G29 A' to abort. - * - * Q Query leveling and G29 state - * - * A Abort current leveling procedure - * - * Extra parameters with BILINEAR only: - * - * W Write a mesh point. (If G29 is idle.) - * I X index for mesh point - * J Y index for mesh point - * X X for mesh point, overrides I - * Y Y for mesh point, overrides J - * Z Z for mesh point. Otherwise, raw current Z. - * - * Without PROBE_MANUALLY: - * - * E By default G29 will engage the Z probe, test the bed, then disengage. - * Include "E" to engage/disengage the Z probe for each sample. - * There's no extra effect if you have a fixed Z probe. - * - */ - inline void gcode_G29() { - - #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY) - const bool seenQ = parser.seen('Q'); - #else - constexpr bool seenQ = false; - #endif - - // G29 Q is also available if debugging - #if ENABLED(DEBUG_LEVELING_FEATURE) - const uint8_t old_debug_flags = marlin_debug_flags; - if (seenQ) marlin_debug_flags |= DEBUG_LEVELING; - if (DEBUGGING(LEVELING)) { - DEBUG_POS(">>> G29", current_position); - log_machine_info(); - } - marlin_debug_flags = old_debug_flags; - #if DISABLED(PROBE_MANUALLY) - if (seenQ) return; - #endif - #endif - - #if ENABLED(PROBE_MANUALLY) - const bool seenA = parser.seen('A'); - #else - constexpr bool seenA = false; - #endif - - const bool no_action = seenA || seenQ, - faux = - #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) - parser.boolval('C') - #else - no_action - #endif - ; - - // Don't allow auto-leveling without homing first - if (axis_unhomed_error()) return; - - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> Auto-level not needed, skip"); - SERIAL_ECHOLNPGM("<<< G29"); - } - #endif - return; - } - - // Define local vars 'static' for manual probing, 'auto' otherwise - #if ENABLED(PROBE_MANUALLY) - #define ABL_VAR static - #else - #define ABL_VAR - #endif - - ABL_VAR int verbose_level; - ABL_VAR float xProbe, yProbe, measured_z; - ABL_VAR bool dryrun, abl_should_enable; - - #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_probe_index; - #endif - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY) - ABL_VAR bool enable_soft_endstops = true; - #endif - - #if ABL_GRID - - #if ENABLED(PROBE_MANUALLY) - ABL_VAR uint8_t PR_OUTER_VAR; - ABL_VAR int8_t PR_INNER_VAR; - #endif - - ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; - ABL_VAR float xGridSpacing = 0, yGridSpacing = 0; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; - ABL_VAR bool do_topography_map; - #else // Bilinear - uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; - #endif - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_points; - #elif ENABLED(PROBE_MANUALLY) // Bilinear - int16_t constexpr abl_points = GRID_MAX_POINTS; - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - ABL_VAR float zoffset; - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - - ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations - eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points - mean; - #endif - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - #if ENABLED(PROBE_MANUALLY) - int8_t constexpr abl_points = 3; // used to show total points - #endif - - // Probe at 3 arbitrary points - ABL_VAR vector_3 points[3] = { - 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) - }; - - #endif // AUTO_BED_LEVELING_3POINT - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - struct linear_fit_data lsf_results; - incremental_LSF_reset(&lsf_results); - #endif - - /** - * On the initial G29 fetch command parameters. - */ - if (!g29_in_progress) { - - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - - #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) - abl_probe_index = -1; - #endif - - abl_should_enable = planner.leveling_active; - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - const bool seen_w = parser.seen('W'); - if (seen_w) { - if (!leveling_is_valid()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("No bilinear grid"); - return; - } - - const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS]; - if (!WITHIN(rz, -10, 10)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad Z value"); - return; - } - - const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), - ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); - int8_t i = parser.byteval('I', -1), - j = parser.byteval('J', -1); - - if (!isnan(rx) && !isnan(ry)) { - // Get nearest i / j from rx / ry - i = (rx - bilinear_start[X_AXIS] + 0.5f * xGridSpacing) / xGridSpacing; - j = (ry - bilinear_start[Y_AXIS] + 0.5f * yGridSpacing) / yGridSpacing; - i = constrain(i, 0, GRID_MAX_POINTS_X - 1); - j = constrain(j, 0, GRID_MAX_POINTS_Y - 1); - } - if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) { - set_bed_leveling_enabled(false); - z_values[i][j] = rz; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - set_bed_leveling_enabled(abl_should_enable); - if (abl_should_enable) report_current_position(); - } - return; - } // parser.seen('W') - - #else - - constexpr bool seen_w = false; - - #endif - - // Jettison bed leveling data - if (!seen_w && parser.seen('J')) { - reset_bed_level(); - return; - } - - verbose_level = parser.intval('V'); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); - return; - } - - dryrun = parser.boolval('D') - #if ENABLED(PROBE_MANUALLY) - || no_action - #endif - ; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - do_topography_map = verbose_level > 2 || parser.boolval('T'); - - // X and Y specify points in each direction, overriding the default - // These values may be saved with the completed mesh - abl_grid_points_x = parser.intval('X', GRID_MAX_POINTS_X); - abl_grid_points_y = parser.intval('Y', GRID_MAX_POINTS_Y); - 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_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; - } - if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - return; - } - - abl_points = abl_grid_points_x * abl_grid_points_y; - mean = 0; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - zoffset = parser.linearval('Z'); - - #endif - - #if ABL_GRID - - xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); - - 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; - - if ( - #if IS_SCARA || ENABLED(DELTA) - !position_is_reachable_by_probe(left_probe_bed_position, 0) - || !position_is_reachable_by_probe(right_probe_bed_position, 0) - || !position_is_reachable_by_probe(0, front_probe_bed_position) - || !position_is_reachable_by_probe(0, back_probe_bed_position) - #else - !position_is_reachable_by_probe(left_probe_bed_position, front_probe_bed_position) - || !position_is_reachable_by_probe(right_probe_bed_position, back_probe_bed_position) - #endif - ) { - SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds."); - return; - } - - // probe at the points of a lattice grid - xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (abl_grid_points_x - 1); - yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (abl_grid_points_y - 1); - - #endif // ABL_GRID - - if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling"); - if (dryrun) SERIAL_PROTOCOLPGM(" (DRYRUN)"); - SERIAL_EOL(); - } - - planner.synchronize(); - - // Disable auto bed leveling during G29. - // Be formal so G29 can be done successively without G28. - if (!no_action) set_bed_leveling_enabled(false); - - #if HAS_BED_PROBE - // Deploy the probe. Probe will raise if needed. - if (DEPLOY_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - return; - } - #endif - - if (!faux) setup_for_endstop_or_probe_move(); - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - #if ENABLED(PROBE_MANUALLY) - if (!no_action) - #endif - if ( xGridSpacing != bilinear_grid_spacing[X_AXIS] - || yGridSpacing != bilinear_grid_spacing[Y_AXIS] - || left_probe_bed_position != bilinear_start[X_AXIS] - || front_probe_bed_position != bilinear_start[Y_AXIS] - ) { - // Reset grid to 0.0 or "not probed". (Also disables ABL) - reset_bed_level(); - - // Initialize a grid with the given dimensions - bilinear_grid_spacing[X_AXIS] = xGridSpacing; - bilinear_grid_spacing[Y_AXIS] = yGridSpacing; - bilinear_start[X_AXIS] = left_probe_bed_position; - bilinear_start[Y_AXIS] = front_probe_bed_position; - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_BILINEAR - - #if ENABLED(AUTO_BED_LEVELING_3POINT) - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); - #endif - - // Probe at 3 arbitrary points - points[0].z = points[1].z = points[2].z = 0; - - #endif // AUTO_BED_LEVELING_3POINT - - } // !g29_in_progress - - #if ENABLED(PROBE_MANUALLY) - - // For manual probing, get the next index to probe now. - // On the first probe this will be incremented to 0. - if (!no_action) { - ++abl_probe_index; - g29_in_progress = true; - } - - // Abort current G29 procedure, go back to idle state - if (seenA && g29_in_progress) { - SERIAL_PROTOCOLLNPGM("Manual G29 aborted"); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - set_bed_leveling_enabled(abl_should_enable); - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - - // Query G29 status - if (verbose_level || seenQ) { - SERIAL_PROTOCOLPGM("Manual G29 "); - if (g29_in_progress) { - SERIAL_PROTOCOLPAIR("point ", MIN(abl_probe_index + 1, abl_points)); - SERIAL_PROTOCOLLNPAIR(" of ", abl_points); - } - else - SERIAL_PROTOCOLLNPGM("idle"); - } - - if (no_action) return; - - if (abl_probe_index == 0) { - // For the initial G29 save software endstop state - #if HAS_SOFTWARE_ENDSTOPS - enable_soft_endstops = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT) - const uint16_t index = abl_probe_index - 1; - #endif - - // For G29 after adjusting Z. - // Save the previous Z before going to the next point - measured_z = current_position[Z_AXIS]; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[index] = measured_z; - eqnAMatrix[index + 0 * abl_points] = xProbe; - eqnAMatrix[index + 1 * abl_points] = yProbe; - eqnAMatrix[index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - points[index].z = measured_z; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - z_values[xCount][yCount] = measured_z + zoffset; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_PROTOCOLPAIR("Save X", xCount); - SERIAL_PROTOCOLPAIR(" Y", yCount); - SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset); - } - #endif - - #endif - } - - // - // If there's another point to sample, move there with optional lift. - // - - #if ABL_GRID - - // Skip any unreachable points - while (abl_probe_index < abl_points) { - - // Set xCount, yCount based on abl_probe_index, with zig-zag - PR_OUTER_VAR = abl_probe_index / PR_INNER_END; - PR_INNER_VAR = abl_probe_index - (PR_OUTER_VAR * PR_INNER_END); - - // Probe in reverse order for every other row/column - bool zig = (PR_OUTER_VAR & 1); // != ((PR_OUTER_END) & 1); - - if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR; - - const float xBase = xCount * xGridSpacing + left_probe_bed_position, - yBase = yCount * yGridSpacing + front_probe_bed_position; - - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = abl_probe_index; - #endif - - // Keep looping till a reachable point is found - if (position_is_reachable(xProbe, yProbe)) break; - ++abl_probe_index; - } - - // Is there a next point to move to? - if (abl_probe_index < abl_points) { - _manual_goto_xy(xProbe, yProbe); // Can be used here too! - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - return; - } - else { - - // Leveling done! Fall through to G29 finishing code below - - SERIAL_PROTOCOLLNPGM("Grid probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - } - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - if (abl_probe_index < abl_points) { - xProbe = points[abl_probe_index].x; - yProbe = points[abl_probe_index].y; - _manual_goto_xy(xProbe, yProbe); - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - return; - } - else { - - SERIAL_PROTOCOLLNPGM("3-point probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - - if (!dryrun) { - 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; - } - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - } - - #endif // AUTO_BED_LEVELING_3POINT - - #else // !PROBE_MANUALLY - { - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - measured_z = 0; - - #if ABL_GRID - - bool zig = PR_OUTER_END & 1; // Always end at RIGHT and BACK_PROBE_BED_POSITION - - measured_z = 0; - - // Outer loop is Y with PROBE_Y_FIRST disabled - for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { - - int8_t inStart, inStop, inInc; - - if (zig) { // away from origin - inStart = 0; - inStop = PR_INNER_END; - inInc = 1; - } - else { // towards origin - inStart = PR_INNER_END - 1; - inStop = -1; - inInc = -1; - } - - zig ^= true; // zag - - // Inner loop is Y with PROBE_Y_FIRST enabled - for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) { - - float xBase = left_probe_bed_position + xGridSpacing * xCount, - yBase = front_probe_bed_position + yGridSpacing * yCount; - - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = ++abl_probe_index; // 0... - #endif - - #if IS_KINEMATIC - // Avoid probing outside the round or hexagonal area - if (!position_is_reachable_by_probe(xProbe, yProbe)) continue; - #endif - - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); - - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; - } - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[abl_probe_index] = measured_z; - eqnAMatrix[abl_probe_index + 0 * abl_points] = xProbe; - eqnAMatrix[abl_probe_index + 1 * abl_points] = yProbe; - eqnAMatrix[abl_probe_index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - z_values[xCount][yCount] = measured_z + zoffset; - - #endif - - abl_should_enable = false; - idle(); - - } // inner - } // outer - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - - for (uint8_t i = 0; i < 3; ++i) { - // 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); - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; - } - points[i].z = measured_z; - } - - 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; - } - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_3POINT - - // Stow the probe. No raise for FIX_MOUNTED_PROBE. - if (STOW_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - measured_z = NAN; - } - } - #endif // !PROBE_MANUALLY - - // - // G29 Finishing Code - // - // Unless this is a dry run, auto bed leveling will - // definitely be enabled after this point. - // - // If code above wants to continue leveling, it should - // return or loop before this point. - // - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); - #endif - - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - #endif - - // Calculate leveling, print reports, correct the position - if (!isnan(measured_z)) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) extrapolate_unprobed_bed_level(); - print_bilinear_leveling_grid(); - - refresh_bed_level(); - - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - // For LINEAR leveling calculate matrix, print reports, correct the position - - /** - * solve the plane equation ax + by + d = z - * A is the matrix with rows [x y 1] for all the probed points - * B is the vector of the Z positions - * the normal vector to the plane is formed by the coefficients of the - * plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 - * so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z - */ - float plane_equation_coefficients[3]; - - finish_incremental_LSF(&lsf_results); - plane_equation_coefficients[0] = -lsf_results.A; // We should be able to eliminate the '-' on these three lines and down below - plane_equation_coefficients[1] = -lsf_results.B; // but that is not yet tested. - plane_equation_coefficients[2] = -lsf_results.D; - - mean /= abl_points; - - if (verbose_level) { - SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8); - SERIAL_PROTOCOLPGM(" b: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8); - SERIAL_PROTOCOLPGM(" d: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8); - SERIAL_EOL(); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mean of sampled points: "); - SERIAL_PROTOCOL_F(mean, 8); - SERIAL_EOL(); - } - } - - // Create the matrix but don't correct the position yet - if (!dryrun) - planner.bed_level_matrix = matrix_3x3::create_look_at( - vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1) // We can eliminate the '-' here and up above - ); - - // Show the Topography map if enabled - if (do_topography_map) { - - SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n" - " +--- BACK --+\n" - " | |\n" - " L | (+) | R\n" - " E | | I\n" - " F | (-) N (+) | G\n" - " T | | H\n" - " | (-) | T\n" - " | |\n" - " O-- FRONT --+\n" - " (0,0)"); - - float min_diff = 999; - - for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { - for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { - int ind = indexIntoAB[xx][yy]; - float diff = eqnBVector[ind] - mean, - x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - - NOMORE(min_diff, eqnBVector[ind] - z_tmp); - - if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment - else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - - if (verbose_level > 3) { - SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:"); - - for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { - for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { - int ind = indexIntoAB[xx][yy]; - float x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - - float diff = eqnBVector[ind] - z_tmp - min_diff; - if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); - // Include + for column alignment - else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - } - } //do_topography_map - - #endif // AUTO_BED_LEVELING_LINEAR - - #if ABL_PLANAR - - // For LINEAR and 3POINT leveling correct the current position - - if (verbose_level > 0) - planner.bed_level_matrix.debug(PSTR("\n\nBed Level Correction Matrix:")); - - if (!dryrun) { - // - // Correct the current XYZ position based on the tilted plane. - // - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 uncorrected XYZ", current_position); - #endif - - float converted[XYZ]; - COPY(converted, current_position); - - planner.leveling_active = true; - planner.unapply_leveling(converted); // use conversion machinery - 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)) - ) { - const float simple_z = current_position[Z_AXIS] - measured_z; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Z from Probe:", simple_z); - SERIAL_ECHOPAIR(" Matrix:", converted[Z_AXIS]); - SERIAL_ECHOLNPAIR(" Discrepancy:", simple_z - converted[Z_AXIS]); - } - #endif - converted[Z_AXIS] = simple_z; - } - - // The rotated XY and corrected Z are now current_position - COPY(current_position, converted); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position); - #endif - } - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("G29 uncorrected Z:", current_position[Z_AXIS]); - #endif - - // Unapply the offset because it is going to be immediately applied - // and cause compensation movement in Z - current_position[Z_AXIS] -= bilinear_z_offset(current_position); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]); - #endif - } - - #endif // ABL_PLANAR - - #ifdef Z_PROBE_END_SCRIPT - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); - #endif - planner.synchronize(); - enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT)); - #endif - - // Auto Bed Leveling is complete! Enable if possible. - planner.leveling_active = dryrun ? abl_should_enable : true; - } // !isnan(measured_z) - - // Restore state after probing - if (!faux) clean_up_after_endstop_or_probe_move(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G29"); - #endif - - KEEPALIVE_STATE(IN_HANDLER); - - if (planner.leveling_active) - SYNC_PLAN_POSITION_KINEMATIC(); - - #if HAS_BED_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - report_current_position(); - } - -#endif // OLDSCHOOL_ABL - -#if HAS_BED_PROBE - - /** - * G30: Do a single Z probe at the current XY - * - * Parameters: - * - * X Probe X position (default current X) - * Y Probe Y position (default current Y) - * E Engage the probe for each probe (default 1) - */ - inline void gcode_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); - - if (!position_is_reachable_by_probe(xpos, ypos)) return; - - // Disable leveling so the planner won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif - - setup_for_endstop_or_probe_move(); - - const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_pt(xpos, ypos, raise_after, parser.intval('V', 1)); - - if (!isnan(measured_z)) { - SERIAL_PROTOCOLPAIR_F("Bed X: ", xpos); - SERIAL_PROTOCOLPAIR_F(" Y: ", ypos); - SERIAL_PROTOCOLLNPAIR_F(" Z: ", measured_z); - } - - clean_up_after_endstop_or_probe_move(); - - #ifdef Z_AFTER_PROBING - if (raise_after == PROBE_PT_STOW) move_z_after_probing(); - #endif - - report_current_position(); - } - - #if ENABLED(Z_PROBE_SLED) - - /** - * G31: Deploy the Z probe - */ - inline void gcode_G31() { DEPLOY_PROBE(); } - - /** - * G32: Stow the Z probe - */ - inline void gcode_G32() { STOW_PROBE(); } - - #endif // Z_PROBE_SLED - -#endif // HAS_BED_PROBE - -#if ENABLED(DELTA_AUTO_CALIBRATION) - - constexpr uint8_t _7P_STEP = 1, // 7-point step - to change number of calibration points - _4P_STEP = _7P_STEP * 2, // 4-point step - NPP = _7P_STEP * 6; // number of calibration points on the radius - enum CalEnum : char { // the 7 main calibration points - add definitions if needed - CEN = 0, - __A = 1, - _AB = __A + _7P_STEP, - __B = _AB + _7P_STEP, - _BC = __B + _7P_STEP, - __C = _BC + _7P_STEP, - _CA = __C + _7P_STEP, - }; - - #define LOOP_CAL_PT(VAR, S, N) for (uint8_t VAR=S; VAR<=NPP; VAR+=N) - #define F_LOOP_CAL_PT(VAR, S, N) for (float VAR=S; VARCEN+0.9999; VAR-=N) - #define LOOP_CAL_ALL(VAR) LOOP_CAL_PT(VAR, CEN, 1) - #define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP) - #define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP) - - #if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - #define AC_CLEANUP() ac_cleanup(old_tool_index) - #else - #define AC_CLEANUP() ac_cleanup() - #endif - - float lcd_probe_pt(const float &rx, const float &ry); - - void ac_home() { - endstops.enable(true); - home_delta(); - endstops.not_homing(); - } - - void ac_setup(const bool reset_bed) { - #if HOTENDS > 1 - tool_change(0, 0, true); - #endif - - planner.synchronize(); - setup_for_endstop_or_probe_move(); - - #if HAS_LEVELING - if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid - #endif - } - - void ac_cleanup( - #if HOTENDS > 1 - const uint8_t old_tool_index - #endif - ) { - #if ENABLED(DELTA_HOME_TO_SAFE_ZONE) - do_blocking_move_to_z(delta_clip_start_height); - #endif - #if HAS_BED_PROBE - STOW_PROBE(); - #endif - clean_up_after_endstop_or_probe_move(); - #if HOTENDS > 1 - tool_change(old_tool_index, 0, true); - #endif - } - - void print_signed_float(const char * const prefix, const float &f) { - SERIAL_PROTOCOLPGM(" "); - serialprintPGM(prefix); - SERIAL_PROTOCOLCHAR(':'); - if (f >= 0) SERIAL_CHAR('+'); - SERIAL_PROTOCOL_F(f, 2); - } - - /** - * - Print the delta settings - */ - static void print_calibration_settings(const bool end_stops, const bool tower_angles) { - SERIAL_PROTOCOLPAIR(".Height:", delta_height); - if (end_stops) { - print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]); - print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]); - print_signed_float(PSTR("Ez"), delta_endstop_adj[C_AXIS]); - } - if (end_stops && tower_angles) { - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); - } - if (tower_angles) { - print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]); - print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]); - print_signed_float(PSTR("Tz"), delta_tower_angle_trim[C_AXIS]); - } - if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); - } - #if HAS_BED_PROBE - if (!end_stops && !tower_angles) { - SERIAL_PROTOCOL_SP(30); - print_signed_float(PSTR("Offset"), zprobe_zoffset); - } - #endif - SERIAL_EOL(); - } - - /** - * - Print the probe results - */ - static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { - SERIAL_PROTOCOLPGM(". "); - print_signed_float(PSTR("c"), z_pt[CEN]); - if (tower_points) { - print_signed_float(PSTR(" x"), z_pt[__A]); - print_signed_float(PSTR(" y"), z_pt[__B]); - print_signed_float(PSTR(" z"), z_pt[__C]); - } - if (tower_points && opposite_points) { - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); - } - if (opposite_points) { - print_signed_float(PSTR("yz"), z_pt[_BC]); - print_signed_float(PSTR("zx"), z_pt[_CA]); - print_signed_float(PSTR("xy"), z_pt[_AB]); - } - SERIAL_EOL(); - } - - /** - * - Calculate the standard deviation from the zero plane - */ - static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) { - if (!_0p_cal) { - float S2 = sq(z_pt[CEN]); - int16_t N = 1; - if (!_1p_cal) { // std dev from zero plane - LOOP_CAL_ACT(rad, _4p_cal, _4p_opp) { - S2 += sq(z_pt[rad]); - N++; - } - return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; - } - } - return 0.00001; - } - - /** - * - Probe a point - */ - static float calibration_probe(const float &nx, const float &ny, const bool stow, const bool set_up) { - #if HAS_BED_PROBE - return probe_pt(nx, ny, set_up ? PROBE_PT_BIG_RAISE : stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); - #else - UNUSED(stow); - UNUSED(set_up); - return lcd_probe_pt(nx, ny); - #endif - } - - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - static float probe_z_shift(const float center) { - STOW_PROBE(); - endstops.enable_z_probe(false); - float z_shift = lcd_probe_pt(0, 0) - center; - endstops.enable_z_probe(true); - return z_shift; - } - #endif - - /** - * - Probe a grid - */ - static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each, const bool set_up) { - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_calibration = probe_points >= 3, - _7p_no_intermediates = probe_points == 3, - _7p_1_intermediates = probe_points == 4, - _7p_2_intermediates = probe_points == 5, - _7p_4_intermediates = probe_points == 6, - _7p_6_intermediates = probe_points == 7, - _7p_8_intermediates = probe_points == 8, - _7p_11_intermediates = probe_points == 9, - _7p_14_intermediates = probe_points == 10, - _7p_intermed_points = probe_points >= 4, - _7p_6_center = probe_points >= 5 && probe_points <= 7, - _7p_9_center = probe_points >= 8; - - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0; - - if (!_0p_calibration) { - - if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center - z_pt[CEN] += calibration_probe(0, 0, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; - } - - 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; - I_LOOP_CAL_PT(rad, start, steps) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * 0.1; - z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; - } - z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); - } - - 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 - _7p_no_intermediates ? _7P_STEP : // 1r * 6 + 3c = 9 - _4P_STEP; // .5r * 6 + 1c = 4 - bool zig_zag = true; - F_LOOP_CAL_PT(rad, start, _7p_9_center ? steps * 3 : steps) { - const int8_t offset = _7p_9_center ? 2 : 0; - for (int8_t circle = 0; circle <= offset; circle++) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)), - interpol = fmod(rad, 1); - const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_temp)) return false; - // split probe point to neighbouring calibration points - z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); - z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); - } - zig_zag = !zig_zag; - } - if (_7p_intermed_points) - LOOP_CAL_RAD(rad) - z_pt[rad] /= _7P_STEP / steps; - - do_blocking_move_to_xy(0.0, 0.0); - } - } - return true; - } - - /** - * kinematics routines and auto tune matrix scaling parameters: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - formulae for approximative forward kinematics in the end-stop displacement matrix - * - definition of the matrix scaling parameters - */ - static void reverse_kinematics_probe_points(float z_pt[NPP + 1], float mm_at_pt_axis[NPP + 1][ABC]) { - float pos[XYZ] = { 0.0 }; - - LOOP_CAL_ALL(rad) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = (rad == CEN ? 0.0 : delta_calibration_radius); - pos[X_AXIS] = cos(a) * r; - pos[Y_AXIS] = sin(a) * r; - pos[Z_AXIS] = z_pt[rad]; - inverse_kinematics(pos); - LOOP_XYZ(axis) mm_at_pt_axis[rad][axis] = delta[axis]; - } - } - - 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 Z00(I, A) ZPP( 0, I, A) - #define Zp1(I, A) ZPP(+1, I, A) - #define Zm1(I, A) ZPP(-1, I, A) - #define Zp2(I, A) ZPP(+2, I, A) - #define Zm2(I, A) ZPP(-2, I, A) - - z_pt[CEN] = Z00(CEN, A_AXIS) + Z00(CEN, B_AXIS) + Z00(CEN, C_AXIS); - z_pt[__A] = Zp2(__A, A_AXIS) + Zm1(__A, B_AXIS) + Zm1(__A, C_AXIS); - z_pt[__B] = Zm1(__B, A_AXIS) + Zp2(__B, B_AXIS) + Zm1(__B, C_AXIS); - z_pt[__C] = Zm1(__C, A_AXIS) + Zm1(__C, B_AXIS) + Zp2(__C, C_AXIS); - z_pt[_BC] = Zm2(_BC, A_AXIS) + Zp1(_BC, B_AXIS) + Zp1(_BC, C_AXIS); - z_pt[_CA] = Zp1(_CA, A_AXIS) + Zm2(_CA, B_AXIS) + Zp1(_CA, C_AXIS); - z_pt[_AB] = Zp1(_AB, A_AXIS) + Zp1(_AB, B_AXIS) + Zm2(_AB, C_AXIS); - } - - static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], float delta_e[ABC], float delta_r, float delta_t[ABC]) { - const float z_center = z_pt[CEN]; - float diff_mm_at_pt_axis[NPP + 1][ABC], - new_mm_at_pt_axis[NPP + 1][ABC]; - - reverse_kinematics_probe_points(z_pt, diff_mm_at_pt_axis); - - delta_radius += delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += delta_t[axis]; - recalc_delta_settings(); - reverse_kinematics_probe_points(z_pt, new_mm_at_pt_axis); - - LOOP_XYZ(axis) LOOP_CAL_ALL(rad) diff_mm_at_pt_axis[rad][axis] -= new_mm_at_pt_axis[rad][axis] + delta_e[axis]; - forward_kinematics_probe_points(diff_mm_at_pt_axis, z_pt); - - LOOP_CAL_RAD(rad) z_pt[rad] -= z_pt[CEN] - z_center; - z_pt[CEN] = z_center; - - delta_radius -= delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= delta_t[axis]; - recalc_delta_settings(); - } - - static float auto_tune_h() { - const float r_quot = delta_calibration_radius / delta_radius; - float h_fac = 0.0; - - h_fac = r_quot / (2.0 / 3.0); - 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}; - - 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) - 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}; - - 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; - } - a_fac = diff / a_fac / 3.0; // 1/(3*delta_Z) - return a_fac; - } - - /** - * G33 - Delta '1-4-7-point' Auto-Calibration - * Calibrate height, z_offset, endstops, delta radius, and tower angles. - * - * Parameters: - * - * S Setup mode; disables probe protection - * - * Pn Number of probe points: - * P-1 Checks the z_offset with a center probe and paper test. - * P0 Normalizes calibration. - * P1 Calibrates height only with center probe. - * P2 Probe center and towers. Calibrate height, endstops and delta radius. - * P3 Probe all positions: center, towers and opposite towers. Calibrate all. - * P4-P10 Probe all positions at different intermediate locations and average them. - * - * T Don't calibrate tower angle corrections - * - * Cn.nn Calibration precision; when omitted calibrates to maximum precision - * - * Fn Force to run at least n iterations and take the best result - * - * Vn Verbose level: - * V0 Dry-run mode. Report settings and probe results. No calibration. - * V1 Report start and end settings only - * V2 Report settings at each iteration - * V3 Report settings and probe results - * - * E Engage the probe for each point - */ - inline void gcode_G33() { - - const bool set_up = - #if HAS_BED_PROBE - parser.seen('S'); - #else - false; - #endif - - const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); - if (!WITHIN(probe_points, -1, 10)) { - SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (-1 - 10)."); - return; - } - - const bool towers_set = !parser.seen('T'); - - const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0); - if (calibration_precision < 0) { - SERIAL_PROTOCOLLNPGM("?(C)alibration precision is implausible (>=0)."); - return; - } - - const int8_t force_iterations = parser.intval('F', 0); - if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0 - 30)."); - return; - } - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0 - 3)."); - return; - } - - const bool stow_after_each = parser.seen('E'); - - if (set_up) { - delta_height = 999.99; - delta_radius = DELTA_PRINTABLE_RADIUS; - ZERO(delta_endstop_adj); - ZERO(delta_tower_angle_trim); - recalc_delta_settings(); - } - - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_9_center = probe_points >= 8, - _tower_results = (_4p_calibration && towers_set) || probe_points >= 3, - _opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3, - _endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0, - _angle_results = probe_points >= 3 && towers_set; - 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_min = zero_std_dev, - zero_std_dev_old = zero_std_dev, - h_factor, - r_factor, - a_factor, - e_old[ABC] = { - delta_endstop_adj[A_AXIS], - delta_endstop_adj[B_AXIS], - delta_endstop_adj[C_AXIS] - }, - r_old = delta_radius, - h_old = delta_height, - a_old[ABC] = { - delta_tower_angle_trim[A_AXIS], - delta_tower_angle_trim[B_AXIS], - delta_tower_angle_trim[C_AXIS] - }; - - SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate"); - - if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable - LOOP_CAL_RAD(axis) { - const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), - r = delta_calibration_radius; - if (!position_is_reachable(cos(a) * r, sin(a) * r)) { - SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible."); - return; - } - } - } - - // Report settings - const char *checkingac = PSTR("Checking... AC"); - serialprintPGM(checkingac); - if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)"); - if (set_up) SERIAL_PROTOCOLPGM(" (SET-UP)"); - SERIAL_EOL(); - lcd_setstatusPGM(checkingac); - - print_calibration_settings(_endstop_results, _angle_results); - - ac_setup(!_0p_calibration && !_1p_calibration); - - if (!_0p_calibration) ac_home(); - - do { // start iterations - - float z_at_pt[NPP + 1] = { 0.0 }; - - test_precision = zero_std_dev_old != 999.0 ? (zero_std_dev + zero_std_dev_old) / 2 : zero_std_dev; - iterations++; - - // Probe the points - zero_std_dev_old = zero_std_dev; - if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) { - SERIAL_PROTOCOLLNPGM("Correct delta settings with M665 and M666"); - return AC_CLEANUP(); - } - zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); - - // Solve matrices - - if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { - - #if !HAS_BED_PROBE - test_precision = 0.00; // forced end - #endif - - if (zero_std_dev < zero_std_dev_min) { - // set roll-back point - COPY(e_old, delta_endstop_adj); - r_old = delta_radius; - h_old = delta_height; - COPY(a_old, delta_tower_angle_trim); - } - - float e_delta[ABC] = { 0.0 }, - r_delta = 0.0, - t_delta[ABC] = { 0.0 }; - - /** - * convergence matrices: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - 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 Z12(I) ZP(12, I) - #define Z4(I) ZP(4, I) - #define Z2(I) ZP(2, I) - #define Z1(I) ZP(1, I) - #define Z0(I) ZP(0, I) - - // calculate factors - const float cr_old = delta_calibration_radius; - if (_7p_9_center) delta_calibration_radius *= 0.9; - h_factor = auto_tune_h(); - r_factor = auto_tune_r(); - a_factor = auto_tune_a(); - delta_calibration_radius = cr_old; - - switch (probe_points) { - case -1: - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - zprobe_zoffset += probe_z_shift(z_at_pt[CEN]); - #endif - - case 0: - test_precision = 0.00; // forced end - break; - - case 1: - test_precision = 0.00; // forced end - LOOP_XYZ(axis) e_delta[axis] = +Z4(CEN); - break; - - case 2: - if (towers_set) { // see 4 point calibration (towers) matrix - e_delta[A_AXIS] = (+Z4(__A) -Z2(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z2(__A) +Z4(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z2(__A) -Z2(__B) +Z4(__C)) * h_factor +Z4(CEN); - r_delta = (+Z4(__A) +Z4(__B) +Z4(__C) -Z12(CEN)) * r_factor; - } - else { // see 4 point calibration (opposites) matrix - e_delta[A_AXIS] = (-Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (+Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (+Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z4(_BC) +Z4(_CA) +Z4(_AB) -Z12(CEN)) * r_factor; - } - break; - - default: // see 7 point calibration (towers & opposites) matrix - e_delta[A_AXIS] = (+Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z1(__A) -Z1(__B) +Z2(__C) +Z1(_BC) +Z1(_CA) -Z2(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z2(__A) +Z2(__B) +Z2(__C) +Z2(_BC) +Z2(_CA) +Z2(_AB) -Z12(CEN)) * r_factor; - - if (towers_set) { // see 7 point tower angle calibration (towers & opposites) matrix - t_delta[A_AXIS] = (+Z0(__A) -Z4(__B) +Z4(__C) +Z0(_BC) -Z4(_CA) +Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[B_AXIS] = (+Z4(__A) +Z0(__B) -Z4(__C) +Z4(_BC) +Z0(_CA) -Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[C_AXIS] = (-Z4(__A) +Z4(__B) +Z0(__C) -Z4(_BC) +Z4(_CA) +Z0(_AB) +Z0(CEN)) * a_factor; - } - break; - } - LOOP_XYZ(axis) delta_endstop_adj[axis] += e_delta[axis]; - delta_radius += r_delta; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += t_delta[axis]; - } - else if (zero_std_dev >= test_precision) { - // roll back - COPY(delta_endstop_adj, e_old); - delta_radius = r_old; - delta_height = h_old; - COPY(delta_tower_angle_trim, a_old); - } - - if (verbose_level != 0) { // !dry run - - // normalise angles to least squares - if (_angle_results) { - float a_sum = 0.0; - LOOP_XYZ(axis) a_sum += delta_tower_angle_trim[axis]; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0; - } - - // adjust delta_height and endstops by the max amount - const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]); - delta_height -= z_temp; - LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; - } - recalc_delta_settings(); - NOMORE(zero_std_dev_min, zero_std_dev); - - // print report - - if (verbose_level == 3) - print_calibration_results(z_at_pt, _tower_results, _opposite_results); - - if (verbose_level != 0) { // !dry run - if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations - SERIAL_PROTOCOLPGM("Calibration OK"); - SERIAL_PROTOCOL_SP(32); - #if HAS_BED_PROBE - if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration) - SERIAL_PROTOCOLPGM("rolling back."); - else - #endif - { - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev_min, 3); - } - SERIAL_EOL(); - 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)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); - lcd_setstatus(mess); - print_calibration_settings(_endstop_results, _angle_results); - serialprintPGM(save_message); - SERIAL_EOL(); - } - else { // !end iterations - char mess[15]; - if (iterations < 31) - sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations); - else - strcpy_P(mess, PSTR("No convergence")); - SERIAL_PROTOCOL(mess); - SERIAL_PROTOCOL_SP(32); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); - lcd_setstatus(mess); - if (verbose_level > 1) - print_calibration_settings(_endstop_results, _angle_results); - } - } - else { // dry run - const char *enddryrun = PSTR("End DRY-RUN"); - serialprintPGM(enddryrun); - SERIAL_PROTOCOL_SP(35); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); - - char mess[21]; - 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)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); - lcd_setstatus(mess); - } - ac_home(); - } - while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - - AC_CLEANUP(); - } - -#endif // DELTA_AUTO_CALIBRATION - -#if ENABLED(G38_PROBE_TARGET) - - static bool G38_run_probe() { - - bool G38_pass_fail = false; - - #if MULTIPLE_PROBING > 1 - // Get direction of move and retract - float retract_mm[XYZ]; - LOOP_XYZ(i) { - float dist = destination[i] - current_position[i]; - retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1); - } - #endif - - // Move until destination reached or target hit - planner.synchronize(); - endstops.enable(true); - G38_move = true; - G38_endstop_hit = false; - prepare_move_to_destination(); - planner.synchronize(); - G38_move = false; - - endstops.hit_on_purpose(); - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - - if (G38_endstop_hit) { - - G38_pass_fail = true; - - #if MULTIPLE_PROBING > 1 - // Move away by the retract distance - set_destination_from_current(); - LOOP_XYZ(i) destination[i] += retract_mm[i]; - endstops.enable(false); - prepare_move_to_destination(); - - feedrate_mm_s /= 4; - - // Bump the target more slowly - LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2; - - planner.synchronize(); - endstops.enable(true); - G38_move = true; - prepare_move_to_destination(); - planner.synchronize(); - G38_move = false; - - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - #endif - } - - endstops.hit_on_purpose(); - endstops.not_homing(); - return G38_pass_fail; - } - - /** - * G38.2 - probe toward workpiece, stop on contact, signal error if failure - * G38.3 - probe toward workpiece, stop on contact - * - * Like G28 except uses Z min probe for all axes - */ - inline void gcode_G38(bool is_38_2) { - // Get X Y Z E F - gcode_get_destination(); - - setup_for_endstop_or_probe_move(); - - // If any axis has enough movement, do the move - LOOP_XYZ(i) - if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { - if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i); - // If G38.2 fails throw an error - if (!G38_run_probe() && is_38_2) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Failed to reach target"); - } - break; - } - - clean_up_after_endstop_or_probe_move(); - } - -#endif // G38_PROBE_TARGET - -#if HAS_MESH - - /** - * G42: Move X & Y axes to mesh coordinates (I & J) - */ - inline void gcode_G42() { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - const bool hasI = parser.seenval('I'); - const int8_t ix = hasI ? parser.value_int() : 0; - const bool hasJ = parser.seenval('J'); - const int8_t iy = hasJ ? parser.value_int() : 0; - - if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { - SERIAL_ECHOLNPGM(MSG_ERR_MESH_XY); - return; - } - - 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); - - // SCARA kinematic has "safe" XY raw moves - #if IS_SCARA - prepare_uninterpolated_move_to_destination(); - #else - prepare_move_to_destination(); - #endif - } - } - -#endif // HAS_MESH - -/** - * G92: Set current position to given X Y Z E - */ -inline void gcode_G92() { - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - switch (parser.subcode) { - 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_software_endstops((AxisEnum)i); - } - } - #endif // Not SCARA - return; - } - #endif - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - #define IS_G92_0 (parser.subcode == 0) - #else - #define IS_G92_0 true - #endif - - bool didE = false; - #if IS_SCARA || !HAS_POSITION_SHIFT - bool didXYZ = false; - #else - constexpr bool didXYZ = false; - #endif - - if (IS_G92_0) LOOP_XYZE(i) { - if (parser.seenval(axis_codes[i])) { - const float l = parser.value_axis_units((AxisEnum)i), - v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i), - d = v - current_position[i]; - if (!NEAR_ZERO(d)) { - #if IS_SCARA || !HAS_POSITION_SHIFT - if (i == E_AXIS) didE = true; else didXYZ = true; - current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior - #elif HAS_POSITION_SHIFT - if (i == E_AXIS) { - didE = true; - current_position[E_AXIS] = v; // When using coordinate spaces, only E is set directly - } - else { - position_shift[i] += d; // Other axes simply offset the coordinate space - update_software_endstops((AxisEnum)i); - } - #endif - } - } - } - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Apply workspace offset to the active coordinate system - if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(coordinate_system[active_coordinate_system], position_shift); - #endif - - // Update planner/steppers only if the native coordinates changed - if (didXYZ) SYNC_PLAN_POSITION_KINEMATIC(); - else if (didE) sync_plan_position_e(); - - report_current_position(); -} - -#if HAS_RESUME_CONTINUE - - /** - * M0: Unconditional stop - Wait for user button press on LCD - * M1: Conditional stop - Wait for user button press on LCD - */ - inline void gcode_M0_M1() { - const char * const args = parser.string_arg; - - millis_t ms = 0; - bool hasP = false, hasS = false; - if (parser.seenval('P')) { - ms = parser.value_millis(); // milliseconds to wait - hasP = ms > 0; - } - if (parser.seenval('S')) { - ms = parser.value_millis_from_seconds(); // seconds to wait - hasS = ms > 0; - } - - const bool has_message = !hasP && !hasS && args && *args; - - planner.synchronize(); - - #if ENABLED(ULTIPANEL) - - if (has_message) - lcd_setstatus(args, true); - else { - LCD_MESSAGEPGM(MSG_USERWAIT); - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - dontExpireStatus(); - #endif - } - - #else - - if (has_message) { - SERIAL_ECHO_START(); - SERIAL_ECHOLN(args); - } - - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - - if (ms > 0) { - ms += millis(); // wait until this time for a click - while (PENDING(millis(), ms) && wait_for_user) idle(); - } - else - while (wait_for_user) idle(); - - - #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) - if (lights_off_after_print) { - leds.set_off(); - lights_off_after_print = false; - } - #endif - - lcd_reset_status(); - - wait_for_user = false; - KEEPALIVE_STATE(IN_HANDLER); - } - -#endif // HAS_RESUME_CONTINUE - -#if ENABLED(SPINDLE_LASER_ENABLE) - /** - * M3: Spindle Clockwise - * M4: Spindle Counter-clockwise - * - * S0 turns off spindle. - * - * If no speed PWM output is defined then M3/M4 just turns it on. - * - * At least 12.8KHz (50Hz * 256) is needed for spindle PWM. - * Hardware PWM is required. ISRs are too slow. - * - * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. - * No other settings give a PWM signal that goes from 0 to 5 volts. - * - * The system automatically sets WGM to Mode 1, so no special - * initialization is needed. - * - * WGM bits for timer 2 are automatically set by the system to - * Mode 1. This produces an acceptable 0 to 5 volt signal. - * No special initialization is needed. - * - * NOTE: A minimum PWM frequency of 50 Hz is needed. All prescaler - * factors for timers 2, 3, 4, and 5 are acceptable. - * - * SPINDLE_LASER_ENABLE_PIN needs an external pullup or it may power on - * the spindle/laser during power-up or when connecting to the host - * (usually goes through a reset which sets all I/O pins to tri-state) - * - * PWM duty cycle goes from 0 (off) to 255 (always on). - */ - - // Wait for spindle to come up to speed - inline void delay_for_power_up() { dwell(SPINDLE_LASER_POWERUP_DELAY); } - - // Wait for spindle to stop turning - inline void delay_for_power_down() { dwell(SPINDLE_LASER_POWERDOWN_DELAY); } - - /** - * ocr_val_mode() is used for debugging and to get the points needed to compute the RPM vs ocr_val line - * - * it accepts inputs of 0-255 - */ - - inline void ocr_val_mode() { - uint8_t spindle_laser_power = parser.value_byte(); - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) - if (SPINDLE_LASER_PWM_INVERT) spindle_laser_power = 255 - spindle_laser_power; - analogWrite(SPINDLE_LASER_PWM_PIN, spindle_laser_power); - } - - inline void gcode_M3_M4(bool is_M3) { - - planner.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle - #if SPINDLE_DIR_CHANGE - const bool rotation_dir = (is_M3 && !SPINDLE_INVERT_DIR || !is_M3 && SPINDLE_INVERT_DIR) ? HIGH : LOW; - if (SPINDLE_STOP_ON_DIR_CHANGE \ - && READ(SPINDLE_LASER_ENABLE_PIN) == SPINDLE_LASER_ENABLE_INVERT \ - && READ(SPINDLE_DIR_PIN) != rotation_dir - ) { - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off - delay_for_power_down(); - } - WRITE(SPINDLE_DIR_PIN, rotation_dir); - #endif - - /** - * Our final value for ocr_val is an unsigned 8 bit value between 0 and 255 which usually means uint8_t. - * Went to uint16_t because some of the uint8_t calculations would sometimes give 1000 0000 rather than 1111 1111. - * Then needed to AND the uint16_t result with 0x00FF to make sure we only wrote the byte of interest. - */ - #if ENABLED(SPINDLE_LASER_PWM) - if (parser.seen('O')) ocr_val_mode(); - else { - const float spindle_laser_power = parser.floatval('S'); - if (spindle_laser_power == 0) { - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte - delay_for_power_down(); - } - else { - int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle - NOMORE(ocr_val, 255); // limit to max the Atmel PWM will support - if (spindle_laser_power <= SPEED_POWER_MIN) - ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // minimum setting - if (spindle_laser_power >= SPEED_POWER_MAX) - ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // limit to max RPM - if (SPINDLE_LASER_PWM_INVERT) ocr_val = 255 - ocr_val; - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) - analogWrite(SPINDLE_LASER_PWM_PIN, ocr_val & 0xFF); // only write low byte - delay_for_power_up(); - } - } - #else - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) if spindle speed option not enabled - delay_for_power_up(); - #endif - } - - /** - * M5 turn off spindle - */ - inline void gcode_M5() { - planner.synchronize(); - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); - #if ENABLED(SPINDLE_LASER_PWM) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); - #endif - delay_for_power_down(); - } - -#endif // SPINDLE_LASER_ENABLE - -/** - * M17: Enable power on all stepper motors - */ -inline void gcode_M17() { - LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_all_steppers(); -} - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - void do_pause_e_move(const float &length, const float &fr) { - set_destination_from_current(); - destination[E_AXIS] += length / planner.e_factor[active_extruder]; - planner.buffer_line_kinematic(destination, fr, active_extruder); - set_current_from_destination(); - planner.synchronize(); - } - - static float resume_position[XYZE]; - int8_t did_pause_print = 0; - - #if HAS_BUZZER - static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { - static millis_t next_buzz = 0; - static int8_t runout_beep = 0; - - if (init) next_buzz = runout_beep = 0; - - const millis_t ms = millis(); - if (ELAPSED(ms, next_buzz)) { - if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to - next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500); - BUZZ(50, 880 - (runout_beep & 1) * 220); - runout_beep++; - } - } - } - #endif - - /** - * Ensure a safe temperature for extrusion - * - * - Fail if the TARGET temperature is too low - * - Display LCD placard with temperature status - * - Return when heating is done or aborted - * - * Returns 'true' if heating was completed, 'false' for abort - */ - static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT) { - - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - return false; - } - #endif - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode); - #else - UNUSED(mode); - #endif - - wait_for_heatup = true; // M108 will clear this - while (wait_for_heatup && thermalManager.wait_for_heating(active_extruder)) idle(); - const bool status = wait_for_heatup; - wait_for_heatup = false; - - return status; - } - - /** - * Load filament into the hotend - * - * - Fail if the a safe temperature was not reached - * - If pausing for confirmation, wait for a click or M108 - * - Show "wait for load" placard - * - Load and purge filament - * - Show "Purge more" / "Continue" menu - * - Return when "Continue" is selected - * - * Returns 'true' if load was completed, 'false' for abort - */ - static bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=0, const int8_t max_beep_count=0, - const bool show_lcd=false, const bool pause_for_user=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #endif - - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; - } - - if (pause_for_user) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "insert filament" - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode); - #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - idle(true); - } - KEEPALIVE_STATE(IN_HANDLER); - } - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "wait for load" message - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode); - #endif - - // Slow Load filament - if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); - - // Fast Load Filament - if (fast_load_length) { - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; - #endif - - do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - - #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE); - #endif - - wait_for_user = true; - for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) - do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); - wait_for_user = false; - - #else - - do { - if (purge_length > 0) { - // "Wait for filament purge" - #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode); - #endif - - // Extrude filament to get into hotend - do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); - } - - // Show "Purge More" / "Resume" menu and wait for reply - #if ENABLED(ULTIPANEL) - if (show_lcd) { - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = false; - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION, mode); - while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true); - KEEPALIVE_STATE(IN_HANDLER); - } - #endif - - // Keep looping if "Purge More" was selected - } while ( - #if ENABLED(ULTIPANEL) - show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE - #else - 0 - #endif - ); - - #endif - - return true; - } - - /** - * Unload filament from the hotend - * - * - Fail if the a safe temperature was not reached - * - Show "wait for unload" placard - * - Retract, pause, then unload filament - * - Disable E stepper (on most machines) - * - * Returns 'true' if unload was completed, 'false' for abort - */ - static bool unload_filament(const float &unload_length, const bool show_lcd=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; - } - - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #else - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode); - #endif - - // Retract filament - do_pause_e_move(-FILAMENT_UNLOAD_RETRACT_LENGTH, PAUSE_PARK_RETRACT_FEEDRATE); - - // Wait for filament to cool - safe_delay(FILAMENT_UNLOAD_DELAY); - - // Quickly purge - do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.max_feedrate_mm_s[E_AXIS]); - - // Unload filament - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; - #endif - - do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - - // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS) - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN - disable_e_stepper(active_extruder); - safe_delay(100); - #endif - - return true; - } - - /** - * Pause procedure - * - * - Abort if already paused - * - Send host action for pause, if configured - * - Abort if TARGET temperature is too low - * - Display "wait for start of filament change" (if a length was specified) - * - Initial retract, if current temperature is hot enough - * - Park the nozzle at the given position - * - Call unload_filament (if a length was specified) - * - * Returns 'true' if pause was completed, 'false' for abort - */ - static bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false) { - if (did_pause_print) return false; // already paused - - #ifdef ACTION_ON_PAUSE - SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); - #endif - - if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - LCD_MESSAGEPGM(MSG_M600_TOO_COLD); - #endif - - return false; // unable to reach safe temperature - } - - // Indicate that the printer is paused - ++did_pause_print; - - // Pause the print job and timer - #if ENABLED(SDSUPPORT) - if (card.sdprinting) { - card.pauseSDPrint(); - ++did_pause_print; // Indicate SD pause also - } - #endif - print_job_timer.pause(); - - // Save current position - COPY(resume_position, current_position); - - // Wait for synchronize steppers - planner.synchronize(); - - // Initial retract before move to filament change position - if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) - 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()) - Nozzle::park(2, park_point); - - // Unload the filament - if (unload_length) - unload_filament(unload_length, show_lcd); - - return true; - } - - /** - * - Show "Insert filament and press button to continue" - * - Wait for a click before returning - * - Heaters can time out, reheated before accepting a click - * - * Used by M125 and M600 - */ - static void wait_for_filament_reload(const int8_t max_beep_count=0) { - bool nozzle_timed_out = false; - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); - #endif - SERIAL_ECHO_START(); - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() - thermalManager.start_heater_idle_timer(e, nozzle_timeout); - - // Wait for filament insert by user and press button - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - - // If the nozzle has timed out, wait for the user to press the button to re-heat the nozzle, then - // re-heat the nozzle, re-show the insert screen, restart the idle timers, and start over - if (!nozzle_timed_out) - HOTEND_LOOP() - nozzle_timed_out |= thermalManager.is_heater_idle(e); - - if (nozzle_timed_out) { - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE); - #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_LCD); - #endif - - // Wait for LCD click or M108 - while (wait_for_user) idle(true); - - // Re-enable the heaters if they timed out - HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e); - - // Wait for the heaters to reach the target temperatures - ensure_safe_temperature(); - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); - #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_LCD); - #endif - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() - thermalManager.start_heater_idle_timer(e, nozzle_timeout); - - wait_for_user = true; // Wait for user to load filament - nozzle_timed_out = false; - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif - } - - idle(true); - } - KEEPALIVE_STATE(IN_HANDLER); - } - - /** - * Resume or Start print procedure - * - * - Abort if not paused - * - Reset heater idle timers - * - Load filament if specified, but only if: - * - a nozzle timed out, or - * - the nozzle is already heated. - * - Display "wait for print to resume" - * - Re-prime the nozzle... - * - FWRETRACT: Recover/prime from the prior G10. - * - !FWRETRACT: Retract by resume_position[E], if negative. - * Not sure how this logic comes into use. - * - Move the nozzle back to resume_position - * - Sync the planner E to resume_position[E] - * - Send host action for resume, if configured - * - Resume the current SD print job, if any - */ - static void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0) { - if (!did_pause_print) return; - - // Re-enable the heaters if they timed out - bool nozzle_timed_out = false; - HOTEND_LOOP() { - nozzle_timed_out |= thermalManager.is_heater_idle(e); - thermalManager.reset_heater_idle_timer(e); - } - - if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) { - // Load the new filament - load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out); - } - - #if ENABLED(ULTIPANEL) - // "Wait for print to resume" - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); - #endif - - // Intelligent resuming - #if ENABLED(FWRETRACT) - // If retracted before goto pause - if (fwretract.retracted[active_extruder]) - do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s); - #endif - - // If resume_position is negative - if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], 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); - - // Set Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); - - // Now all extrusion positions are resumed and ready to be confirmed - // Set extruder to saved position - planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS])); - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.reset(); - #endif - - #if ENABLED(ULTIPANEL) - // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - #ifdef ACTION_ON_RESUME - SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); - #endif - - --did_pause_print; - - #if ENABLED(SDSUPPORT) - if (did_pause_print) { - card.startFileprint(); - --did_pause_print; - } - #endif - } - -#endif // ADVANCED_PAUSE_FEATURE - -#if ENABLED(SDSUPPORT) - - /** - * M20: List SD card to serial output - */ - inline void gcode_M20() { - SERIAL_PROTOCOLLNPGM(MSG_BEGIN_FILE_LIST); - card.ls(); - SERIAL_PROTOCOLLNPGM(MSG_END_FILE_LIST); - } - - /** - * M21: Init SD Card - */ - inline void gcode_M21() { card.initsd(); } - - /** - * M22: Release SD Card - */ - inline void gcode_M22() { card.release(); } - - /** - * M23: Open a file - */ - inline void gcode_M23() { - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - // Simplify3D includes the size, so zero out all spaces (#7227) - for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; - card.openFile(parser.string_arg, true); - } - - /** - * M24: Start or Resume SD Print - */ - inline void gcode_M24() { - #if ENABLED(PARK_HEAD_ON_PAUSE) - resume_print(); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('S')) card.setIndex(parser.value_long()); - #endif - - card.startFileprint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('T')) - print_job_timer.resume(parser.value_long()); - else - #endif - print_job_timer.start(); - } - - /** - * M25: Pause SD Print - */ - inline void gcode_M25() { - card.pauseSDPrint(); - print_job_timer.pause(); - - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer - #endif - } - - /** - * M26: Set SD Card file index - */ - inline void gcode_M26() { - if (card.cardOK && parser.seenval('S')) - card.setIndex(parser.value_long()); - } - - /** - * M27: Get SD Card status - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - */ - inline void gcode_M27() { - if (parser.seen('C')) { - SERIAL_ECHOPGM("Current file: "); - card.printFilename(); - } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - else if (parser.seenval('S')) - card.set_auto_report_interval(parser.value_byte()); - #endif - - else - card.getStatus(); - } - - /** - * M28: Start SD Write - */ - inline void gcode_M28() { card.openFile(parser.string_arg, false); } - - /** - * M29: Stop SD Write - * Processed in write to file routine above - */ - inline void gcode_M29() { - // card.saving = false; - } - - /** - * M30 : Delete SD Card file - */ - inline void gcode_M30() { - if (card.cardOK) { - card.closefile(); - card.removeFile(parser.string_arg); - } - } - -#endif // SDSUPPORT - -/** - * M31: Get the time since the start of SD Print (or last M109) - */ -inline void gcode_M31() { - char buffer[21]; - duration_t elapsed = print_job_timer.duration(); - elapsed.toString(buffer); - lcd_setstatus(buffer); - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Print time: ", buffer); -} - -#if ENABLED(SDSUPPORT) - - /** - * M32: Select file and start SD Print - * - * Examples: - * - * M32 !PATH/TO/FILE.GCO# ; Start FILE.GCO - * M32 P !PATH/TO/FILE.GCO# ; Start FILE.GCO as a procedure - * M32 S60 !PATH/TO/FILE.GCO# ; Start FILE.GCO at byte 60 - * - */ - inline void gcode_M32() { - if (card.sdprinting) planner.synchronize(); - - if (card.cardOK) { - const bool call_procedure = parser.boolval('P'); - - card.openFile(parser.string_arg, true, call_procedure); - - if (parser.seenval('S')) card.setIndex(parser.value_long()); - - card.startFileprint(); - - // Procedure calls count as normal print time. - if (!call_procedure) print_job_timer.start(); - } - } - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - - /** - * M33: Get the long full path of a file or folder - * - * Parameters: - * Case-insensitive DOS-style path to a file or folder - * - * Example: - * M33 miscel~1/armchair/armcha~1.gco - * - * Output: - * /Miscellaneous/Armchair/Armchair.gcode - */ - inline void gcode_M33() { - card.printLongPath(parser.string_arg); - } - - #endif - - #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) - /** - * M34: Set SD Card Sorting Options - */ - inline void gcode_M34() { - if (parser.seen('S')) card.setSortOn(parser.value_bool()); - if (parser.seenval('F')) { - const int v = parser.value_long(); - card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0); - } - //if (parser.seen('R')) card.setSortReverse(parser.value_bool()); - } - #endif // SDCARD_SORT_ALPHA && SDSORT_GCODE - - /** - * M928: Start SD Write - */ - inline void gcode_M928() { - card.openLogFile(parser.string_arg); - } - -#endif // SDSUPPORT - -/** - * Sensitive pin test for M42, M226 - */ -static bool pin_is_protected(const pin_t pin) { - static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; - for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) - if (pin == (pin_t)pgm_read_byte(&sensitive_pins[i])) return true; - return false; -} - -inline void protected_pin_err() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN); -} - -/** - * M42: Change pin status via GCode - * - * P Pin number (LED if omitted) - * S Pin status from 0 - 255 - * I Flag to ignore Marlin's pin protection - */ -inline void gcode_M42() { - if (!parser.seenval('S')) return; - const byte pin_status = parser.value_byte(); - - const pin_t pin_number = parser.byteval('P', LED_PIN); - if (pin_number < 0) return; - - if (!parser.boolval('I') && pin_is_protected(pin_number)) return protected_pin_err(); - - pinMode(pin_number, OUTPUT); - digitalWrite(pin_number, pin_status); - analogWrite(pin_number, pin_status); - - #if FAN_COUNT > 0 - switch (pin_number) { - #if HAS_FAN0 - case FAN_PIN: fanSpeeds[0] = pin_status; break; - #endif - #if HAS_FAN1 - case FAN1_PIN: fanSpeeds[1] = pin_status; break; - #endif - #if HAS_FAN2 - case FAN2_PIN: fanSpeeds[2] = pin_status; break; - #endif - } - #endif -} - -#if ENABLED(PINS_DEBUGGING) - - #include "pinsDebug.h" - - inline void toggle_pins() { - const bool ignore_protection = parser.boolval('I'); - const int repeat = parser.intval('R', 1), - start = parser.intval('S'), - end = parser.intval('L', NUM_DIGITAL_PINS - 1), - wait = parser.intval('W', 500); - - for (uint8_t pin = start; pin <= end; pin++) { - //report_pin_state_extended(pin, ignore_protection, false); - - if (!ignore_protection && pin_is_protected(pin)) { - report_pin_state_extended(pin, ignore_protection, true, "Untouched "); - SERIAL_EOL(); - } - else { - 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) { - SET_OUTPUT(TEENSY_E2); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E2, LOW); safe_delay(wait); - WRITE(TEENSY_E2, HIGH); safe_delay(wait); - WRITE(TEENSY_E2, LOW); safe_delay(wait); - } - } - else if (pin == TEENSY_E3) { - SET_OUTPUT(TEENSY_E3); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E3, LOW); safe_delay(wait); - WRITE(TEENSY_E3, HIGH); safe_delay(wait); - WRITE(TEENSY_E3, LOW); safe_delay(wait); - } - } - else - #endif - { - pinMode(pin, OUTPUT); - for (int16_t j = 0; j < repeat; j++) { - digitalWrite(pin, 0); safe_delay(wait); - digitalWrite(pin, 1); safe_delay(wait); - digitalWrite(pin, 0); safe_delay(wait); - } - } - - } - SERIAL_EOL(); - } - SERIAL_ECHOLNPGM("Done."); - - } // toggle_pins - - inline void servo_probe_test() { - #if !(NUM_SERVOS > 0 && HAS_SERVO_0) - - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("SERVO not setup"); - - #elif !HAS_Z_SERVO_PROBE - - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z_PROBE_SERVO_NR not setup"); - - #else // HAS_Z_SERVO_PROBE - - const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR); - - SERIAL_PROTOCOLLNPGM("Servo probe test"); - SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index); - SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]); - SERIAL_PROTOCOLLNPAIR(". stow angle: ", z_servo_angle[1]); - - bool probe_inverting; - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - - #define PROBE_TEST_PIN Z_MIN_PIN - - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: "); - - #if Z_MIN_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); - #else - SERIAL_PROTOCOLLNPGM("false"); - #endif - - probe_inverting = Z_MIN_ENDSTOP_INVERTING; - - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - - #define PROBE_TEST_PIN Z_MIN_PROBE_PIN - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: "); - - #if Z_MIN_PROBE_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); - #else - SERIAL_PROTOCOLLNPGM("false"); - #endif - - probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING; - - #endif - - SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times"); - SET_INPUT_PULLUP(PROBE_TEST_PIN); - bool deploy_state, stow_state; - for (uint8_t i = 0; i < 4; i++) { - MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy - safe_delay(500); - deploy_state = READ(PROBE_TEST_PIN); - MOVE_SERVO(probe_index, z_servo_angle[1]); //stow - safe_delay(500); - stow_state = READ(PROBE_TEST_PIN); - } - if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards"); - - if (deploy_state != stow_state) { - SERIAL_PROTOCOLLNPGM("BLTouch clone detected"); - if (deploy_state) { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: HIGH (logic 1)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: LOW (logic 0)"); - } - else { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: LOW (logic 0)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: HIGH (logic 1)"); - } - #if ENABLED(BLTOUCH) - SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true."); - #endif - - } - else { // measure active signal length - MOVE_SERVO(probe_index, z_servo_angle[0]); // deploy - safe_delay(500); - SERIAL_PROTOCOLLNPGM("please trigger probe"); - uint16_t probe_counter = 0; - - // Allow 30 seconds max for operator to trigger probe - for (uint16_t j = 0; j < 500 * 30 && probe_counter == 0 ; j++) { - - safe_delay(2); - - if (0 == j % (500 * 1)) reset_stepper_timeout(); // Keep steppers powered - - if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered - - for (probe_counter = 1; probe_counter < 50 && deploy_state != READ(PROBE_TEST_PIN); ++probe_counter) - safe_delay(2); - - if (probe_counter == 50) - SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time - else if (probe_counter >= 2) - SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse - else - SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse - - MOVE_SERVO(probe_index, z_servo_angle[1]); //stow - - } // pulse detected - - } // for loop waiting for trigger - - if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected"); - - } // measure active signal length - - #endif - - } // servo_probe_test - - /** - * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report - * - * M43 - report name and state of pin(s) - * P Pin to read or watch. If omitted, reads all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 W - Watch pins -reporting changes- until reset, click, or M108. - * P Pin to read or watch. If omitted, read/watch all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 E - Enable / disable background endstop monitoring - * - Machine continues to operate - * - Reports changes to endstops - * - Toggles LED_PIN when an endstop changes - * - Can not reliably catch the 5mS pulse from BLTouch type probes - * - * M43 T - Toggle pin(s) and report which pin is being toggled - * S - Start Pin number. If not given, will default to 0 - * L - End Pin number. If not given, will default to last pin defined for this board - * I - Flag to ignore Marlin's pin protection. Use with caution!!!! - * R - Repeat pulses on each pin this number of times before continueing to next pin - * W - Wait time (in miliseconds) between pulses. If not given will default to 500 - * - * M43 S - Servo probe test - * P - Probe index (optional - defaults to 0 - */ - inline void gcode_M43() { - - if (parser.seen('T')) { // must be first or else its "S" and "E" parameters will execute endstop or servo test - toggle_pins(); - return; - } - - // Enable or disable endstop monitoring - if (parser.seen('E')) { - endstop_monitor_flag = parser.value_bool(); - SERIAL_PROTOCOLPGM("endstop monitor "); - serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis")); - SERIAL_PROTOCOLLNPGM("abled"); - return; - } - - if (parser.seen('S')) { - servo_probe_test(); - return; - } - - // Get the range of pins to test or watch - const pin_t first_pin = parser.byteval('P'), - last_pin = parser.seenval('P') ? first_pin : NUM_DIGITAL_PINS - 1; - - if (first_pin > last_pin) return; - - const bool ignore_protection = parser.boolval('I'); - - // Watch until click, M108, or reset - if (parser.boolval('W')) { - SERIAL_PROTOCOLLNPGM("Watching pins"); - byte pin_state[last_pin - first_pin + 1]; - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; - pinMode(pin, INPUT_PULLUP); - delay(1); - /* - if (IS_ANALOG(pin)) - pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...] - else - //*/ - pin_state[pin - first_pin] = digitalRead(pin); - } - - #if HAS_RESUME_CONTINUE - wait_for_user = true; - KEEPALIVE_STATE(PAUSED_FOR_USER); - #endif - - for (;;) { - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; - const byte val = - /* - IS_ANALOG(pin) - ? analogRead(pin - analogInputToDigitalPin(0)) : // int16_t val - : - //*/ - digitalRead(pin); - if (val != pin_state[pin - first_pin]) { - report_pin_state_extended(pin, ignore_protection, false); - pin_state[pin - first_pin] = val; - } - } - - #if HAS_RESUME_CONTINUE - if (!wait_for_user) { - KEEPALIVE_STATE(IN_HANDLER); - break; - } - #endif - - safe_delay(200); - } - return; - } - - // Report current state of selected pin(s) - for (pin_t pin = first_pin; pin <= last_pin; pin++) - report_pin_state_extended(pin, ignore_protection, true); - } - -#endif // PINS_DEBUGGING - -#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - - /** - * M48: Z probe repeatability measurement function. - * - * Usage: - * M48 - * P = Number of sampled points (4-50, default 10) - * X = Sample X position - * Y = Sample Y position - * V = Verbose level (0-4, default=1) - * E = Engage Z probe for each reading - * L = Number of legs of movement before probe - * S = Schizoid (Or Star if you prefer) - * - * This function requires the machine to be homed before invocation. - */ - inline void gcode_M48() { - - if (axis_unhomed_error()) return; - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); - return; - } - - if (verbose_level > 0) - SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability Test"); - - const int8_t n_samples = parser.byteval('P', 10); - if (!WITHIN(n_samples, 4, 50)) { - SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50)."); - return; - } - - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - 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); - - if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { - SERIAL_PROTOCOLLNPGM("? (X,Y) out of bounds."); - return; - } - - bool seen_L = parser.seen('L'); - uint8_t n_legs = seen_L ? parser.value_byte() : 0; - if (n_legs > 15) { - SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15)."); - return; - } - if (n_legs == 1) n_legs = 2; - - const bool schizoid_flag = parser.boolval('S'); - if (schizoid_flag && !seen_L) n_legs = 7; - - /** - * Now get everything to the specified probe point So we can safely do a - * probe to get us close to the bed. If the Z-Axis is far from the bed, - * we don't want to use that as a starting point for each probe. - */ - if (verbose_level > 2) - SERIAL_PROTOCOLLNPGM("Positioning the probe..."); - - // Disable bed level correction in M48 because we want the raw data when we probe - - #if HAS_LEVELING - const bool was_enabled = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - setup_for_endstop_or_probe_move(); - - 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); - bool probing_good = !isnan(t); - - if (probing_good) { - randomSeed(millis()); - - for (uint8_t n = 0; n < n_samples; n++) { - if (n_legs) { - const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - float angle = random(0.0, 360.0); - const float radius = random( - #if ENABLED(DELTA) - 0.1250000000 * (DELTA_PRINTABLE_RADIUS), - 0.3333333333 * (DELTA_PRINTABLE_RADIUS) - #else - 5.0, 0.125 * MIN(X_BED_SIZE, Y_BED_SIZE) - #endif - ); - - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Starting radius: ", radius); - SERIAL_ECHOPAIR(" angle: ", angle); - SERIAL_ECHOPGM(" Direction: "); - if (dir > 0) SERIAL_ECHOPGM("Counter-"); - SERIAL_ECHOLNPGM("Clockwise"); - } - - for (uint8_t l = 0; l < n_legs - 1; l++) { - float delta_angle; - - if (schizoid_flag) - // The points of a 5 point star are 72 degrees apart. We need to - // skip a point and go to the next one on the star. - delta_angle = dir * 2.0 * 72.0; - - else - // If we do this line, we are just trying to move further - // around the circle. - delta_angle = dir * (float) random(25, 45); - - angle += delta_angle; - - while (angle > 360.0) // We probably do not need to keep the angle between 0 and 2*PI, but the - angle -= 360.0; // Arduino documentation says the trig functions should not be given values - while (angle < 0.0) // outside of this range. It looks like they behave correctly with - angle += 360.0; // 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; - - #if DISABLED(DELTA) - X_current = constrain(X_current, X_MIN_POS, X_MAX_POS); - Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS); - #else - // If we have gone out too far, we can do a simple fix and scale the numbers - // back in closer to the origin. - while (!position_is_reachable_by_probe(X_current, Y_current)) { - X_current *= 0.8; - Y_current *= 0.8; - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Pulling point towards center:", X_current); - SERIAL_ECHOLNPAIR(", ", Y_current); - } - } - #endif - if (verbose_level > 3) { - SERIAL_PROTOCOLPGM("Going to:"); - SERIAL_ECHOPAIR(" X", X_current); - SERIAL_ECHOPAIR(" Y", Y_current); - SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]); - } - do_blocking_move_to_xy(X_current, Y_current); - } // n_legs loop - } // n_legs - - // Probe a single point - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after); - - // Break the loop if the probe fails - probing_good = !isnan(sample_set[n]); - if (!probing_good) break; - - /** - * Get the current mean for the data points we have so far - */ - float sum = 0.0; - for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; - mean = sum / (n + 1); - - NOMORE(min, sample_set[n]); - NOLESS(max, sample_set[n]); - - /** - * Now, use that mean to calculate the standard deviation for the - * data points we have so far - */ - sum = 0.0; - for (uint8_t j = 0; j <= n; j++) - sum += sq(sample_set[j] - mean); - - sigma = SQRT(sum / (n + 1)); - if (verbose_level > 0) { - if (verbose_level > 1) { - SERIAL_PROTOCOL(n + 1); - SERIAL_PROTOCOLPGM(" of "); - SERIAL_PROTOCOL((int)n_samples); - SERIAL_PROTOCOLPGM(": z: "); - SERIAL_PROTOCOL_F(sample_set[n], 3); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(" mean: "); - SERIAL_PROTOCOL_F(mean, 4); - SERIAL_PROTOCOLPGM(" sigma: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_PROTOCOLPGM(" min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" range: "); - SERIAL_PROTOCOL_F(max-min, 3); - } - SERIAL_EOL(); - } - } - - } // n_samples loop - } - - STOW_PROBE(); - - if (probing_good) { - SERIAL_PROTOCOLLNPGM("Finished!"); - - if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("Mean: "); - SERIAL_PROTOCOL_F(mean, 6); - SERIAL_PROTOCOLPGM(" Min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" Max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" Range: "); - SERIAL_PROTOCOL_F(max-min, 3); - SERIAL_EOL(); - } - - SERIAL_PROTOCOLPGM("Standard Deviation: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_EOL(); - SERIAL_EOL(); - } - - clean_up_after_endstop_or_probe_move(); - - // Re-enable bed level correction if it had been on - #if HAS_LEVELING - set_bed_leveling_enabled(was_enabled); - #endif - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - report_current_position(); - } - -#endif // Z_MIN_PROBE_REPEATABILITY_TEST - -#if ENABLED(G26_MESH_VALIDATION) - - inline void gcode_M49() { - g26_debug_flag ^= true; - SERIAL_PROTOCOLPGM("G26 Debug "); - serialprintPGM(g26_debug_flag ? PSTR("on.\n") : PSTR("off.\n")); - } - -#endif // G26_MESH_VALIDATION - -#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - /** - * M73: Set percentage complete (for display on LCD) - * - * Example: - * M73 P25 ; Set progress to 25% - * - * Notes: - * This has no effect during an SD print job - */ - inline void gcode_M73() { - if (!IS_SD_PRINTING && parser.seen('P')) { - progress_bar_percent = parser.value_byte(); - NOMORE(progress_bar_percent, 100); - } - } -#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY - -/** - * M75: Start print timer - */ -inline void gcode_M75() { print_job_timer.start(); } - -/** - * M76: Pause print timer - */ -inline void gcode_M76() { print_job_timer.pause(); } - -/** - * M77: Stop print timer - */ -inline void gcode_M77() { print_job_timer.stop(); } - -#if ENABLED(PRINTCOUNTER) - /** - * M78: Show print statistics - */ - inline void gcode_M78() { - // "M78 S78" will reset the statistics - if (parser.intval('S') == 78) - print_job_timer.initStats(); - else - print_job_timer.showStats(); - } -#endif - -/** - * M104: Set hot end temperature - */ -inline void gcode_M104() { - if (get_target_extruder_from_command(104)) return; - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(SINGLENOZZLE) - if (target_extruder != active_extruder) return; - #endif - - if (parser.seenval('S')) { - const int16_t temp = parser.value_celsius(); - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Stop the timer at the end of print. Start is managed by 'heat and wait' M109. - * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot - * standby mode, for instance in a dual extruder setup, without affecting - * the running print timer. - */ - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - lcd_reset_status(); - } - #endif - } - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif -} - -/** - * M105: Read hot end and bed temperature - */ -inline void gcode_M105() { - if (get_target_extruder_from_command(105)) return; - - #if HAS_TEMP_SENSOR - SERIAL_PROTOCOLPGM(MSG_OK); - thermalManager.print_heaterstates(); - #else // !HAS_TEMP_SENSOR - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS); - #endif - - SERIAL_EOL(); -} - -#if ENABLED(AUTO_REPORT_TEMPERATURES) - - /** - * M155: Set temperature auto-report interval. M155 S - */ - inline void gcode_M155() { - if (parser.seenval('S')) - thermalManager.set_auto_report_interval(parser.value_byte()); - } - -#endif // AUTO_REPORT_TEMPERATURES - -#if FAN_COUNT > 0 - - /** - * M106: Set Fan Speed - * - * S Speed between 0-255 - * P Fan index, if more than one fan - * - * With EXTRA_FAN_SPEED enabled: - * - * T Restore/Use/Set Temporary Speed: - * 1 = Restore previous speed after T2 - * 2 = Use temporary speed set with T3-255 - * 3-255 = Set the speed for use with T2 - */ - inline void gcode_M106() { - const uint8_t p = parser.byteval('P'); - if (p < FAN_COUNT) { - #if ENABLED(EXTRA_FAN_SPEED) - const int16_t t = parser.intval('T'); - if (t > 0) { - switch (t) { - case 1: - fanSpeeds[p] = old_fanSpeeds[p]; - break; - case 2: - old_fanSpeeds[p] = fanSpeeds[p]; - fanSpeeds[p] = new_fanSpeeds[p]; - break; - default: - new_fanSpeeds[p] = MIN(t, 255); - break; - } - return; - } - #endif // EXTRA_FAN_SPEED - const uint16_t s = parser.ushortval('S', 255); - fanSpeeds[p] = MIN(s, 255U); - } - } - - /** - * M107: Fan Off - */ - inline void gcode_M107() { - const uint16_t p = parser.ushortval('P'); - if (p < FAN_COUNT) fanSpeeds[p] = 0; - } - -#endif // FAN_COUNT > 0 - -#if DISABLED(EMERGENCY_PARSER) - - /** - * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. - */ - inline void gcode_M108() { wait_for_heatup = false; } - - - /** - * M112: Emergency Stop - */ - inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } - - - /** - * M410: Quickstop - Abort all planned moves - * - * This will stop the carriages mid-move, so most likely they - * will be out of sync with the stepper position after this. - */ - inline void gcode_M410() { quickstop_stepper(); } - -#endif - -/** - * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. - * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. - */ - -#ifndef MIN_COOLING_SLOPE_DEG - #define MIN_COOLING_SLOPE_DEG 1.50 -#endif -#ifndef MIN_COOLING_SLOPE_TIME - #define MIN_COOLING_SLOPE_TIME 60 -#endif - -inline void gcode_M109() { - - if (get_target_extruder_from_command(109)) return; - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(SINGLENOZZLE) - if (target_extruder != active_extruder) return; - #endif - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - const int16_t temp = parser.value_celsius(); - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Use half EXTRUDE_MINTEMP to allow nozzles to be put into hot - * standby mode, (e.g., in a dual extruder setup) without affecting - * the running print timer. - */ - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - lcd_reset_status(); - } - else - print_job_timer.start(); - #endif - - #if ENABLED(ULTRA_LCD) - const bool heating = thermalManager.isHeatingHotend(target_extruder); - if (heating || !no_wait_for_cooling) - #if HOTENDS > 1 - lcd_status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), target_extruder + 1); - #else - lcd_setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); - #endif - #endif - } - else return; - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif - - #if TEMP_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder)) - #endif - - float target_temp = -1, old_temp = 9999; - bool wants_to_cool = false; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = thermalManager.degHotend(target_extruder); - uint8_t old_blue = 0; - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != thermalManager.degTargetHotend(target_extruder)) { - wants_to_cool = thermalManager.isCoolingHotend(target_extruder); - target_temp = thermalManager.degTargetHotend(target_extruder); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting - next_temp_ms = now + 1000UL; - thermalManager.print_heaterstates(); - #if TEMP_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); - if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_PROTOCOLCHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - reset_stepper_timeout(); // Keep steppers powered - - const float temp = thermalManager.degHotend(target_extruder); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from violet to red as nozzle heats up - if (!wants_to_cool) { - const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0); - if (blue != old_blue) { - old_blue = blue; - leds.set_color( - MakeLEDColor(255, 0, blue, 0, pixels.getBrightness()) - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif - ); - } - } - #endif - - #if TEMP_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_WINDOW) residency_start_ms = now; - } - else if (temp_diff > TEMP_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif - - // Prevent a wait-forever situation if R is misused i.e. M109 R0 - if (wants_to_cool) { - // break after MIN_COOLING_SLOPE_TIME seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; - old_temp = temp; - } - } - - } while (wait_for_heatup && TEMP_CONDITIONS); - - if (wait_for_heatup) { - lcd_reset_status(); - #if ENABLED(PRINTER_EVENT_LEDS) - leds.set_white(); - #endif - } - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif -} - -#if HAS_HEATED_BED - - /** - * M140: Set bed temperature - */ - inline void gcode_M140() { - if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); - } - - #ifndef MIN_COOLING_SLOPE_DEG_BED - #define MIN_COOLING_SLOPE_DEG_BED 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME_BED - #define MIN_COOLING_SLOPE_TIME_BED 60 - #endif - - /** - * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating - * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling - */ - inline void gcode_M190() { - if (DEBUGGING(DRYRUN)) return; - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - thermalManager.setTargetBed(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if (parser.value_celsius() > BED_MINTEMP) - print_job_timer.start(); - #endif - } - else return; - - lcd_setstatusPGM(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); - - #if TEMP_BED_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed()) - #endif - - float target_temp = -1.0, old_temp = 9999.0; - bool wants_to_cool = false; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - target_extruder = active_extruder; // for print_heaterstates - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = thermalManager.degBed(); - uint8_t old_red = 127; - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != thermalManager.degTargetBed()) { - wants_to_cool = thermalManager.isCoolingBed(); - target_temp = thermalManager.degTargetBed(); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. - next_temp_ms = now + 1000UL; - thermalManager.print_heaterstates(); - #if TEMP_BED_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); - if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_PROTOCOLCHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - reset_stepper_timeout(); // Keep steppers powered - - const float temp = thermalManager.degBed(); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from blue to violet as bed heats up - if (!wants_to_cool) { - const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255); - if (red != old_red) { - old_red = red; - leds.set_color( - MakeLEDColor(red, 0, 255, 0, pixels.getBrightness()) - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif - ); - } - } - #endif - - #if TEMP_BED_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now; - } - else if (temp_diff > TEMP_BED_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif // TEMP_BED_RESIDENCY_TIME > 0 - - // Prevent a wait-forever situation if R is misused i.e. M190 R0 - if (wants_to_cool) { - // Break after MIN_COOLING_SLOPE_TIME_BED seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED; - old_temp = temp; - } - } - - } while (wait_for_heatup && TEMP_BED_CONDITIONS); - - if (wait_for_heatup) lcd_reset_status(); - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif - } - -#endif // HAS_HEATED_BED - -/** - * M110: Set Current Line Number - */ -inline void gcode_M110() { - if (parser.seenval('N')) gcode_LastN = parser.value_long(); -} - -/** - * M111: Set the debug level - */ -inline void gcode_M111() { - if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - - static const char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, - str_debug_2[] PROGMEM = MSG_DEBUG_INFO, - str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS, - str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN, - str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_32[] PROGMEM = MSG_DEBUG_LEVELING - #endif - ; - - static const char* const debug_strings[] PROGMEM = { - str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16 - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_32 - #endif - }; - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DEBUG_PREFIX); - if (marlin_debug_flags) { - uint8_t comma = 0; - for (uint8_t i = 0; i < COUNT(debug_strings); i++) { - if (TEST(marlin_debug_flags, i)) { - if (comma++) SERIAL_CHAR(','); - serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); - } - } - } - else { - SERIAL_ECHOPGM(MSG_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - SERIAL_ECHOPAIR("\nBuffer Overruns: ", customizedSerial.buffer_overruns()); - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - SERIAL_ECHOPAIR("\nFraming Errors: ", customizedSerial.framing_errors()); - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOPAIR("\nDropped bytes: ", customizedSerial.dropped()); - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOPAIR("\nMax RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif - #endif // !__AVR__ || !USBCON - } - SERIAL_EOL(); -} - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - - /** - * M113: Get or set Host Keepalive interval (0 to disable) - * - * S Optional. Set the keepalive interval. - */ - inline void gcode_M113() { - if (parser.seenval('S')) { - host_keepalive_interval = parser.value_byte(); - NOMORE(host_keepalive_interval, 60); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval); - } - } - -#endif - -#if ENABLED(BARICUDA) - - #if HAS_HEATER_1 - /** - * M126: Heater 1 valve open - */ - inline void gcode_M126() { baricuda_valve_pressure = parser.byteval('S', 255); } - /** - * M127: Heater 1 valve close - */ - inline void gcode_M127() { baricuda_valve_pressure = 0; } - #endif - - #if HAS_HEATER_2 - /** - * M128: Heater 2 valve open - */ - inline void gcode_M128() { baricuda_e_to_p_pressure = parser.byteval('S', 255); } - /** - * M129: Heater 2 valve close - */ - inline void gcode_M129() { baricuda_e_to_p_pressure = 0; } - #endif - -#endif // BARICUDA - -#if ENABLED(ULTIPANEL) - - /** - * M145: Set the heatup state for a material in the LCD menu - * - * S (0=PLA, 1=ABS) - * H - * B - * F - */ - inline void gcode_M145() { - const uint8_t material = (uint8_t)parser.intval('S'); - if (material >= COUNT(lcd_preheat_hotend_temp)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX); - } - else { - int v; - if (parser.seenval('H')) { - v = parser.value_int(); - lcd_preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); - } - if (parser.seenval('F')) { - v = parser.value_int(); - lcd_preheat_fan_speed[material] = constrain(v, 0, 255); - } - #if TEMP_SENSOR_BED != 0 - if (parser.seenval('B')) { - v = parser.value_int(); - lcd_preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); - } - #endif - } - } - -#endif // ULTIPANEL - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - /** - * M149: Set temperature units - */ - inline void gcode_M149() { - if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C); - else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K); - else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F); - } -#endif - -#if HAS_POWER_SWITCH - - /** - * M80 : Turn on the Power Supply - * M80 S : Report the current state and exit - */ - inline void gcode_M80() { - - // S: Report the current power supply state and exit - if (parser.seen('S')) { - serialprintPGM(powersupply_on ? PSTR("PS:1\n") : PSTR("PS:0\n")); - return; - } - - PSU_ON(); - - /** - * If you have a switch on suicide pin, this is useful - * if you want to start another print with suicide feature after - * a print without suicide... - */ - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); - #endif - - #if DISABLED(AUTO_POWER_CONTROL) - delay(100); // Wait for power to settle - restore_stepper_drivers(); - #endif - - #if ENABLED(ULTIPANEL) - lcd_reset_status(); - #endif - } - -#endif // HAS_POWER_SWITCH - -/** - * M81: Turn off Power, including Power Supply, if there is one. - * - * This code should ALWAYS be available for EMERGENCY SHUTDOWN! - */ -inline void gcode_M81() { - thermalManager.disable_all_heaters(); - planner.finish_and_disable(); - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #if ENABLED(PROBING_FANS_OFF) - fans_paused = false; - ZERO(paused_fanSpeeds); - #endif - #endif - - safe_delay(1000); // Wait 1 second before switching off - - #if HAS_SUICIDE - suicide(); - #elif HAS_POWER_SWITCH - PSU_OFF(); - #endif - - #if ENABLED(ULTIPANEL) - LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); - #endif -} - -/** - * M82: Set E codes absolute (default) - */ -inline void gcode_M82() { axis_relative_modes[E_AXIS] = false; } - -/** - * M83: Set E codes relative while in Absolute Coordinates (G90) mode - */ -inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; } - -/** - * M18, M84: Disable stepper motors - */ -inline void gcode_M18_M84() { - if (parser.seenval('S')) { - stepper_inactive_time = parser.value_millis_from_seconds(); - } - else { - bool all_axis = !(parser.seen('X') || parser.seen('Y') || parser.seen('Z') || parser.seen('E')); - if (all_axis) { - planner.finish_and_disable(); - } - else { - planner.synchronize(); - if (parser.seen('X')) disable_X(); - if (parser.seen('Y')) disable_Y(); - if (parser.seen('Z')) disable_Z(); - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN // Only disable on boards that have separate ENABLE_PINS - if (parser.seen('E')) disable_e_steppers(); - #endif - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; - #endif - } -} - -/** - * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default) - */ -inline void gcode_M85() { - if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds(); -} - -/** - * Multi-stepper support for M92, M201, M203 - */ -#if ENABLED(DISTINCT_E_FACTORS) - #define GET_TARGET_EXTRUDER(CMD) if (get_target_extruder_from_command(CMD)) return - #define TARGET_EXTRUDER target_extruder -#else - #define GET_TARGET_EXTRUDER(CMD) NOOP - #define TARGET_EXTRUDER 0 -#endif - -/** - * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E. - * (Follows the same syntax as G92) - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M92() { - - GET_TARGET_EXTRUDER(92); - - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) { - if (i == E_AXIS) { - const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); - if (value < 20) { - float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. - #if DISABLED(JUNCTION_DEVIATION) - planner.max_jerk[E_AXIS] *= factor; - #endif - planner.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor; - planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor; - } - planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value; - } - else { - planner.axis_steps_per_mm[i] = parser.value_per_axis_unit((AxisEnum)i); - } - } - } - planner.refresh_positioning(); -} - -/** - * Output the current position to serial - */ -void report_current_position() { - SERIAL_PROTOCOLPGM("X:"); - SERIAL_PROTOCOL(LOGICAL_X_POSITION(current_position[X_AXIS])); - SERIAL_PROTOCOLPGM(" Y:"); - SERIAL_PROTOCOL(LOGICAL_Y_POSITION(current_position[Y_AXIS])); - SERIAL_PROTOCOLPGM(" Z:"); - SERIAL_PROTOCOL(LOGICAL_Z_POSITION(current_position[Z_AXIS])); - SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL(current_position[E_AXIS]); - - stepper.report_positions(); - - #if IS_SCARA - SERIAL_PROTOCOLPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS)); - SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); - SERIAL_EOL(); - #endif -} - -#ifdef M114_DETAIL - - 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++) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); - SERIAL_CHAR(':'); - SERIAL_PROTOCOL(dtostrf(pos[i], 8, precision, str)); - } - SERIAL_EOL(); - } - - inline void report_xyz(const float pos[]) { report_xyze(pos, 3); } - - void report_current_position_detail() { - - SERIAL_PROTOCOLPGM("\nLogical:"); - const float logical[XYZ] = { - LOGICAL_X_POSITION(current_position[X_AXIS]), - LOGICAL_Y_POSITION(current_position[Y_AXIS]), - LOGICAL_Z_POSITION(current_position[Z_AXIS]) - }; - report_xyz(logical); - - SERIAL_PROTOCOLPGM("Raw: "); - report_xyz(current_position); - - float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - #if PLANNER_LEVELING - SERIAL_PROTOCOLPGM("Leveled:"); - planner.apply_leveling(leveled); - report_xyz(leveled); - - SERIAL_PROTOCOLPGM("UnLevel:"); - float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; - planner.unapply_leveling(unleveled); - report_xyz(unleveled); - #endif - - #if IS_KINEMATIC - #if IS_SCARA - SERIAL_PROTOCOLPGM("ScaraK: "); - #else - SERIAL_PROTOCOLPGM("DeltaK: "); - #endif - inverse_kinematics(leveled); // writes delta[] - report_xyz(delta); - #endif - - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Stepper:"); - LOOP_XYZE(i) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); - SERIAL_CHAR(':'); - SERIAL_PROTOCOL(stepper.position((AxisEnum)i)); - } - SERIAL_EOL(); - - #if IS_SCARA - const float deg[XYZ] = { - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - }; - SERIAL_PROTOCOLPGM("Degrees:"); - report_xyze(deg, 2); - #endif - - SERIAL_PROTOCOLPGM("FromStp:"); - get_cartesian_from_steppers(); // writes cartes[XYZ] (with forward kinematics) - const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], planner.get_axis_position_mm(E_AXIS) }; - report_xyze(from_steppers); - - const float diff[XYZE] = { - from_steppers[X_AXIS] - leveled[X_AXIS], - from_steppers[Y_AXIS] - leveled[Y_AXIS], - from_steppers[Z_AXIS] - leveled[Z_AXIS], - from_steppers[E_AXIS] - current_position[E_AXIS] - }; - SERIAL_PROTOCOLPGM("Differ: "); - report_xyze(diff); - } -#endif // M114_DETAIL - -/** - * M114: Report current position to host - */ -inline void gcode_M114() { - - #ifdef M114_DETAIL - if (parser.seen('D')) { - report_current_position_detail(); - return; - } - #endif - - planner.synchronize(); - report_current_position(); -} - -/** - * M115: Capabilities string - */ - -#if ENABLED(EXTENDED_CAPABILITIES_REPORT) - static void cap_line(const char * const name, bool ena=false) { - SERIAL_PROTOCOLPGM("Cap:"); - serialprintPGM(name); - SERIAL_PROTOCOLPGM(":"); - SERIAL_PROTOCOLLN(int(ena ? 1 : 0)); - } -#endif - -inline void gcode_M115() { - SERIAL_PROTOCOLLNPGM(MSG_M115_REPORT); - - #if ENABLED(EXTENDED_CAPABILITIES_REPORT) - - // SERIAL_XON_XOFF - cap_line(PSTR("SERIAL_XON_XOFF") - #if ENABLED(SERIAL_XON_XOFF) - , true - #endif - ); - - // EEPROM (M500, M501) - cap_line(PSTR("EEPROM") - #if ENABLED(EEPROM_SETTINGS) - , true - #endif - ); - - // Volumetric Extrusion (M200) - cap_line(PSTR("VOLUMETRIC") - #if DISABLED(NO_VOLUMETRICS) - , true - #endif - ); - - // AUTOREPORT_TEMP (M155) - cap_line(PSTR("AUTOREPORT_TEMP") - #if ENABLED(AUTO_REPORT_TEMPERATURES) - , true - #endif - ); - - // PROGRESS (M530 S L, M531 , M532 X L) - cap_line(PSTR("PROGRESS")); - - // Print Job timer M75, M76, M77 - cap_line(PSTR("PRINT_JOB"), true); - - // AUTOLEVEL (G29) - cap_line(PSTR("AUTOLEVEL") - #if HAS_AUTOLEVEL - , true - #endif - ); - - // Z_PROBE (G30) - cap_line(PSTR("Z_PROBE") - #if HAS_BED_PROBE - , true - #endif - ); - - // MESH_REPORT (M420 V) - cap_line(PSTR("LEVELING_DATA") - #if HAS_LEVELING - , true - #endif - ); - - // BUILD_PERCENT (M73) - cap_line(PSTR("BUILD_PERCENT") - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - , true - #endif - ); - - // SOFTWARE_POWER (M80, M81) - cap_line(PSTR("SOFTWARE_POWER") - #if HAS_POWER_SWITCH - , true - #endif - ); - - // CASE LIGHTS (M355) - cap_line(PSTR("TOGGLE_LIGHTS") - #if HAS_CASE_LIGHT - , true - #endif - ); - cap_line(PSTR("CASE_LIGHT_BRIGHTNESS") - #if HAS_CASE_LIGHT - , USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN) - #endif - ); - - // EMERGENCY_PARSER (M108, M112, M410) - cap_line(PSTR("EMERGENCY_PARSER") - #if ENABLED(EMERGENCY_PARSER) - , true - #endif - ); - - // AUTOREPORT_SD_STATUS (M27 extension) - cap_line(PSTR("AUTOREPORT_SD_STATUS") - #if ENABLED(AUTO_REPORT_SD_STATUS) - , true - #endif - ); - - // THERMAL_PROTECTION - cap_line(PSTR("THERMAL_PROTECTION") - #if ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(THERMAL_PROTECTION_BED) - , true - #endif - ); - - #endif // EXTENDED_CAPABILITIES_REPORT -} - -/** - * M117: Set LCD Status Message - */ -inline void gcode_M117() { - if (parser.string_arg[0]) - lcd_setstatus(parser.string_arg); - else - lcd_reset_status(); -} - -/** - * M118: Display a message in the host console. - * - * A1 Prepend '// ' for an action command, as in OctoPrint - * E1 Have the host 'echo:' the text - */ -inline void gcode_M118() { - bool hasE = false, hasA = false; - 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; - } - if (hasE) SERIAL_ECHO_START(); - if (hasA) SERIAL_ECHOPGM("// "); - SERIAL_ECHOLN(p); -} - -/** - * M119: Output endstop states to serial output - */ -inline void gcode_M119() { endstops.M119(); } - -/** - * M120: Enable endstops and set non-homing endstop state to "enabled" - */ -inline void gcode_M120() { endstops.enable_globally(true); } - -/** - * M121: Disable endstops and set non-homing endstop state to "disabled" - */ -inline void gcode_M121() { endstops.enable_globally(false); } - -#if ENABLED(PARK_HEAD_ON_PAUSE) - - /** - * M125: Store current position and move to filament change position. - * Called on pause (by M25) to prevent material leaking onto the - * object. On resume (M24) the head will be moved back and the - * print will resume. - * - * If Marlin is compiled without SD Card support, M125 can be - * used directly to pause the print and move to park position, - * resuming with a button click or M108. - * - * L = override retract length - * X = override X - * Y = override Y - * Z = override Z raise - */ - inline void gcode_M125() { - - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - point_t park_point = NOZZLE_PARK_POINT; - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) - park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); - park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); - #endif - - #if DISABLED(SDSUPPORT) - const bool job_running = print_job_timer.isRunning(); - #endif - - if (pause_print(retract, park_point)) { - #if DISABLED(SDSUPPORT) - // Wait for lcd click or M108 - wait_for_filament_reload(); - - // Return to print position and continue - resume_print(); - - if (job_running) print_job_timer.start(); - #endif - } - } - -#endif // PARK_HEAD_ON_PAUSE - -#if HAS_COLOR_LEDS - - /** - * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W - * and Brightness - Use P (for NEOPIXEL only) - * - * Always sets all 3 or 4 components. If a component is left out, set to 0. - * If brightness is left out, no value changed - * - * Examples: - * - * M150 R255 ; Turn LED red - * M150 R255 U127 ; Turn LED orange (PWM only) - * M150 ; Turn LED off - * M150 R U B ; Turn LED white - * M150 W ; Turn LED white using a white LED - * M150 P127 ; Set LED 50% brightness - * M150 P ; Set LED full brightness - */ - inline void gcode_M150() { - leds.set_color(MakeLEDColor( - parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness() - )); - } - -#endif // HAS_COLOR_LEDS - -#if DISABLED(NO_VOLUMETRICS) - - /** - * M200: Set filament diameter and set E axis units to cubic units - * - * T - Optional extruder number. Current extruder if omitted. - * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. - */ - inline void gcode_M200() { - - if (get_target_extruder_from_command(200)) return; - - if (parser.seen('D')) { - // setting any extruder filament size disables volumetric on the assumption that - // slicers either generate in extruder values as cubic mm or as as filament feeds - // for all extruders - if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0)) ) - planner.set_filament_size(target_extruder, parser.value_linear_units()); - } - planner.calculate_volumetric_multipliers(); - } - -#endif // !NO_VOLUMETRICS - -/** - * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M201() { - - GET_TARGET_EXTRUDER(201); - - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); - planner.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a); - } - } - // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) - planner.reset_acceleration_rates(); -} - -#if 0 // Not used for Sprinter/grbl gen6 - inline void gcode_M202() { - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = parser.value_axis_units((AxisEnum)i) * planner.axis_steps_per_mm[i]; - } - } -#endif - - -/** - * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M203() { - - GET_TARGET_EXTRUDER(203); - - LOOP_XYZE(i) - if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); - planner.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a); - } -} - -/** - * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) - * - * P = Printing moves - * R = Retract only (no X, Y, Z) moves - * T = Travel (non printing) moves - */ -inline void gcode_M204() { - bool report = true; - if (parser.seenval('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. - planner.travel_acceleration = planner.acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('P')) { - planner.acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('R')) { - planner.retract_acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('T')) { - planner.travel_acceleration = parser.value_linear_units(); - report = false; - } - if (report) { - SERIAL_ECHOPAIR("Acceleration: P", planner.acceleration); - SERIAL_ECHOPAIR(" R", planner.retract_acceleration); - SERIAL_ECHOLNPAIR(" T", planner.travel_acceleration); - } -} - -/** - * M205: Set Advanced Settings - * - * B = Min Segment Time (µs) - * S = Min Feed Rate (units/s) - * T = Min Travel Feed Rate (units/s) - * X = Max X Jerk (units/sec^2) - * Y = Max Y Jerk (units/sec^2) - * Z = Max Z Jerk (units/sec^2) - * E = Max E Jerk (units/sec^2) - * J = Junction Deviation (mm) (Requires JUNCTION_DEVIATION) - */ -inline void gcode_M205() { - if (parser.seen('B')) planner.min_segment_time_us = parser.value_ulong(); - if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units(); - if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units(); - #if ENABLED(JUNCTION_DEVIATION) - if (parser.seen('J')) { - const float junc_dev = parser.value_linear_units(); - if (WITHIN(junc_dev, 0.01f, 0.3f)) { - planner.junction_deviation_mm = junc_dev; - planner.recalculate_max_e_jerk(); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)"); - } - } - #else - if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units(); - if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units(); - if (parser.seen('Z')) { - planner.max_jerk[Z_AXIS] = parser.value_linear_units(); - #if HAS_MESH - if (planner.max_jerk[Z_AXIS] <= 0.1f) - SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); - #endif - } - if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); - #endif -} - -#if HAS_M206_COMMAND - - /** - * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y - * - * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665. - * *** M206 for SCARA will remain enabled in 1.1.x for compatibility. - * *** In the next 1.2 release, it will simply be disabled by default. - */ - inline void gcode_M206() { - LOOP_XYZ(i) - if (parser.seen(axis_codes[i])) - set_home_offset((AxisEnum)i, parser.value_linear_units()); - - #if ENABLED(MORGAN_SCARA) - if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta - if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi - #endif - - report_current_position(); - } - -#endif // HAS_M206_COMMAND - -#if ENABLED(DELTA) - /** - * M665: Set delta configurations - * - * H = delta height - * L = diagonal rod - * R = delta radius - * S = segments per second - * B = delta calibration radius - * X = Alpha (Tower 1) angle trim - * Y = Beta (Tower 2) angle trim - * Z = Gamma (Tower 3) angle trim - */ - inline void gcode_M665() { - if (parser.seen('H')) delta_height = parser.value_linear_units(); - if (parser.seen('L')) delta_diagonal_rod = parser.value_linear_units(); - if (parser.seen('R')) delta_radius = parser.value_linear_units(); - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - if (parser.seen('B')) delta_calibration_radius = parser.value_float(); - if (parser.seen('X')) delta_tower_angle_trim[A_AXIS] = parser.value_float(); - if (parser.seen('Y')) delta_tower_angle_trim[B_AXIS] = parser.value_float(); - if (parser.seen('Z')) delta_tower_angle_trim[C_AXIS] = parser.value_float(); - recalc_delta_settings(); - } - /** - * M666: Set delta endstop adjustment - */ - inline void gcode_M666() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> gcode_M666"); - } - #endif - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { - if (parser.value_linear_units() * Z_HOME_DIR <= 0) - delta_endstop_adj[i] = parser.value_linear_units(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("delta_endstop_adj[", axis_codes[i]); - SERIAL_ECHOLNPAIR("] = ", delta_endstop_adj[i]); - } - #endif - } - } - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("<<< gcode_M666"); - } - #endif - } - -#elif IS_SCARA - - /** - * M665: Set SCARA settings - * - * Parameters: - * - * S[segments-per-second] - Segments-per-second - * P[theta-psi-offset] - Theta-Psi offset, added to the shoulder (A/X) angle - * T[theta-offset] - Theta offset, added to the elbow (B/Y) angle - * - * A, P, and X are all aliases for the shoulder angle - * B, T, and Y are all aliases for the elbow angle - */ - inline void gcode_M665() { - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - - const bool hasA = parser.seen('A'), hasP = parser.seen('P'), hasX = parser.seen('X'); - const uint8_t sumAPX = hasA + hasP + hasX; - if (sumAPX == 1) - home_offset[A_AXIS] = parser.value_float(); - else if (sumAPX > 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of A, P, or X is allowed."); - return; - } - - const bool hasB = parser.seen('B'), hasT = parser.seen('T'), hasY = parser.seen('Y'); - const uint8_t sumBTY = hasB + hasT + hasY; - if (sumBTY == 1) - home_offset[B_AXIS] = parser.value_float(); - else if (sumBTY > 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of B, T, or Y is allowed."); - return; - } - } - -#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - /** - * M666: Set Dual Endstops offsets for X, Y, and/or Z. - * With no parameters report current offsets. - */ - inline void gcode_M666() { - bool report = true; - #if ENABLED(X_DUAL_ENDSTOPS) - if (parser.seenval('X')) { - endstops.x_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (parser.seenval('Y')) { - endstops.y_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (parser.seenval('Z')) { - endstops.z_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - if (report) { - SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj); - #endif - SERIAL_EOL(); - } - } - -#endif // X_DUAL_ENDSTOPS || Y_DUAL_ENDSTOPS || Z_DUAL_ENDSTOPS - -#if ENABLED(FWRETRACT) - - /** - * M207: Set firmware retraction values - * - * S[+units] retract_length - * W[+units] swap_retract_length (multi-extruder) - * F[units/min] retract_feedrate_mm_s - * Z[units] retract_zlift - */ - inline void gcode_M207() { - if (parser.seen('S')) fwretract.retract_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('Z')) fwretract.retract_zlift = parser.value_linear_units(); - if (parser.seen('W')) fwretract.swap_retract_length = parser.value_axis_units(E_AXIS); - } - - /** - * M208: Set firmware un-retraction values - * - * S[+units] retract_recover_length (in addition to M207 S*) - * W[+units] swap_retract_recover_length (multi-extruder) - * F[units/min] retract_recover_feedrate_mm_s - * R[units/min] swap_retract_recover_feedrate_mm_s - */ - inline void gcode_M208() { - if (parser.seen('S')) fwretract.retract_recover_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('R')) fwretract.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('W')) fwretract.swap_retract_recover_length = parser.value_axis_units(E_AXIS); - } - - /** - * M209: Enable automatic retract (M209 S1) - * For slicers that don't support G10/11, reversed extrude-only - * moves will be classified as retraction. - */ - inline void gcode_M209() { - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - if (parser.seen('S')) { - fwretract.autoretract_enabled = parser.value_bool(); - for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false; - } - } - } - -#endif // FWRETRACT - -/** - * M211: Enable, Disable, and/or Report software endstops - * - * Usage: M211 S1 to enable, M211 S0 to disable, M211 alone for report - */ -inline void gcode_M211() { - SERIAL_ECHO_START(); - #if HAS_SOFTWARE_ENDSTOPS - if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - serialprintPGM(soft_endstops_enabled ? PSTR(MSG_ON) : PSTR(MSG_OFF)); - #else - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - SERIAL_ECHOPGM(MSG_OFF); - #endif - SERIAL_ECHOPGM(MSG_SOFT_MIN); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop_min[X_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop_min[Y_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop_min[Z_AXIS])); - SERIAL_ECHOPGM(MSG_SOFT_MAX); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop_max[X_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop_max[Y_AXIS])); - SERIAL_ECHOLNPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop_max[Z_AXIS])); -} - -#if HOTENDS > 1 - - /** - * M218 - Set/get hotend offset (in linear units) - * - * T - * X - * Y - * Z - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE, and PARKING_EXTRUDER - */ - inline void gcode_M218() { - if (get_target_extruder_from_command(218) || target_extruder == 0) return; - - bool report = true; - if (parser.seenval('X')) { - hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - if (parser.seenval('Y')) { - hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - - #if HAS_HOTEND_OFFSET_Z - if (parser.seenval('Z')) { - hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - #endif - - if (report) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - HOTEND_LOOP() { - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][e]); - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][e]); - #if HAS_HOTEND_OFFSET_Z - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Z_AXIS][e]); - #endif - } - SERIAL_EOL(); - } - - #if ENABLED(DELTA) - if (target_extruder == active_extruder) - do_blocking_move_to_xy(current_position[X_AXIS], current_position[Y_AXIS], planner.max_feedrate_mm_s[X_AXIS]); - #endif - } - -#endif // HOTENDS > 1 - -/** - * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) - */ -inline void gcode_M220() { - if (parser.seenval('S')) feedrate_percentage = parser.value_int(); -} - -/** - * M221: Set extrusion percentage (M221 T0 S95) - */ -inline void gcode_M221() { - if (get_target_extruder_from_command(221)) return; - if (parser.seenval('S')) { - planner.flow_percentage[target_extruder] = parser.value_int(); - planner.refresh_e_factor(target_extruder); - } - else { - SERIAL_ECHO_START(); - SERIAL_CHAR('E'); - SERIAL_CHAR('0' + target_extruder); - SERIAL_ECHOPAIR(" Flow: ", planner.flow_percentage[target_extruder]); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } -} - -/** - * M226: Wait until the specified pin reaches the state required (M226 P S) - */ -inline void gcode_M226() { - if (parser.seen('P')) { - const int pin = parser.value_int(), pin_state = parser.intval('S', -1); - if (WITHIN(pin_state, -1, 1) && pin > -1) { - if (pin_is_protected(pin)) - protected_pin_err(); - else { - int target = LOW; - planner.synchronize(); - pinMode(pin, INPUT); - switch (pin_state) { - case 1: target = HIGH; break; - case 0: target = LOW; break; - case -1: target = !digitalRead(pin); break; - } - while (digitalRead(pin) != target) idle(); - } - } // pin_state -1 0 1 && pin > -1 - } // parser.seen('P') -} - -#if ENABLED(EXPERIMENTAL_I2CBUS) - - /** - * M260: Send data to a I2C slave device - * - * This is a PoC, the formating and arguments for the GCODE will - * change to be more compatible, the current proposal is: - * - * M260 A ; Sets the I2C slave address the data will be sent to - * - * M260 B - * M260 B - * M260 B - * - * M260 S1 ; Send the buffered data and reset the buffer - * M260 R1 ; Reset the buffer without sending data - * - */ - inline void gcode_M260() { - // Set the target address - if (parser.seen('A')) i2c.address(parser.value_byte()); - - // Add a new byte to the buffer - if (parser.seen('B')) i2c.addbyte(parser.value_byte()); - - // Flush the buffer to the bus - if (parser.seen('S')) i2c.send(); - - // Reset and rewind the buffer - else if (parser.seen('R')) i2c.reset(); - } - - /** - * M261: Request X bytes from I2C slave device - * - * Usage: M261 A B - */ - inline void gcode_M261() { - if (parser.seen('A')) i2c.address(parser.value_byte()); - - uint8_t bytes = parser.byteval('B', 1); - - if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) { - i2c.relay(bytes); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad i2c request"); - } - } - -#endif // EXPERIMENTAL_I2CBUS - -#if HAS_SERVOS - - /** - * M280: Get or set servo position. P [S] - */ - inline void gcode_M280() { - if (!parser.seen('P')) return; - const int servo_index = parser.value_int(); - if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) { - if (parser.seen('S')) - MOVE_SERVO(servo_index, parser.value_int()); - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOLNPAIR(": ", servo[servo_index].read()); - } - } - else { - SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); - } - } - -#endif // HAS_SERVOS - -#if ENABLED(BABYSTEPPING) - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - FORCE_INLINE void mod_zprobe_zoffset(const float &offs) { - zprobe_zoffset += offs; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); - } - #endif - - /** - * M290: Babystepping - */ - inline void gcode_M290() { - #if ENABLED(BABYSTEP_XY) - for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) - if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) { - const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2); - thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_zprobe_zoffset(offs); - #endif - } - #else - if (parser.seenval('Z') || parser.seenval('S')) { - const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2); - thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (!parser.seen('P') || parser.value_bool()) mod_zprobe_zoffset(offs); - #endif - } - #endif - } - -#endif // BABYSTEPPING - -#if HAS_BUZZER - - /** - * M300: Play beep sound S P - */ - inline void gcode_M300() { - uint16_t const frequency = parser.ushortval('S', 260); - uint16_t duration = parser.ushortval('P', 1000); - - // Limits the tone duration to 0-5 seconds. - NOMORE(duration, 5000); - - BUZZ(duration, frequency); - } - -#endif // HAS_BUZZER - -#if ENABLED(PIDTEMP) - - /** - * M301: Set PID parameters P I D (and optionally C, L) - * - * P[float] Kp term - * I[float] Ki term (unscaled) - * D[float] Kd term (unscaled) - * - * With PID_EXTRUSION_SCALING: - * - * C[float] Kc term - * L[int] LPQ length - */ - inline void gcode_M301() { - - // multi-extruder PID patch: M301 updates or prints a single extruder's PID values - // default behaviour (omitting E parameter) is to update for extruder 0 only - const uint8_t e = parser.byteval('E'); // extruder being updated - - if (e < HOTENDS) { // catch bad input value - if (parser.seen('P')) PID_PARAM(Kp, e) = parser.value_float(); - if (parser.seen('I')) PID_PARAM(Ki, e) = scalePID_i(parser.value_float()); - if (parser.seen('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float()); - #if ENABLED(PID_EXTRUSION_SCALING) - if (parser.seen('C')) PID_PARAM(Kc, e) = parser.value_float(); - if (parser.seen('L')) thermalManager.lpq_len = parser.value_float(); - NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN); - NOLESS(thermalManager.lpq_len, 0); - #endif - - thermalManager.updatePID(); - SERIAL_ECHO_START(); - #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))); - #if ENABLED(PID_EXTRUSION_SCALING) - //Kc does not have scaling applied above, or in resetting defaults - SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); - #endif - SERIAL_EOL(); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER); - } - } - -#endif // PIDTEMP - -#if ENABLED(PIDTEMPBED) - - inline void gcode_M304() { - if (parser.seen('P')) thermalManager.bedKp = parser.value_float(); - if (parser.seen('I')) thermalManager.bedKi = scalePID_i(parser.value_float()); - if (parser.seen('D')) thermalManager.bedKd = scalePID_d(parser.value_float()); - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" p:", thermalManager.bedKp); - SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.bedKi)); - SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.bedKd)); - } - -#endif // PIDTEMPBED - -#if defined(CHDK) || HAS_PHOTOGRAPH - - /** - * M240: Trigger a camera by emulating a Canon RC-1 - * See http://www.doc-diy.net/photo/rc-1_hacked/ - */ - inline void gcode_M240() { - #ifdef CHDK - - OUT_WRITE(CHDK, HIGH); - chdkHigh = millis(); - chdkActive = true; - - #elif HAS_PHOTOGRAPH - - const uint8_t NUM_PULSES = 16; - const float PULSE_LENGTH = 0.01524; - for (int i = 0; i < NUM_PULSES; i++) { - WRITE(PHOTOGRAPH_PIN, HIGH); - _delay_ms(PULSE_LENGTH); - WRITE(PHOTOGRAPH_PIN, LOW); - _delay_ms(PULSE_LENGTH); - } - delay(7.33); - for (int i = 0; i < NUM_PULSES; i++) { - WRITE(PHOTOGRAPH_PIN, HIGH); - _delay_ms(PULSE_LENGTH); - WRITE(PHOTOGRAPH_PIN, LOW); - _delay_ms(PULSE_LENGTH); - } - - #endif // !CHDK && HAS_PHOTOGRAPH - } - -#endif // CHDK || PHOTOGRAPH_PIN - -#if HAS_LCD_CONTRAST - - /** - * M250: Read and optionally set the LCD contrast - */ - inline void gcode_M250() { - if (parser.seen('C')) set_lcd_contrast(parser.value_int()); - SERIAL_PROTOCOLPGM("lcd contrast value: "); - SERIAL_PROTOCOL(lcd_contrast); - SERIAL_EOL(); - } - -#endif // HAS_LCD_CONTRAST - -#if ENABLED(PREVENT_COLD_EXTRUSION) - - /** - * M302: Allow cold extrudes, or set the minimum extrude temperature - * - * S sets the minimum extrude temperature - * P enables (1) or disables (0) cold extrusion - * - * Examples: - * - * M302 ; report current cold extrusion state - * M302 P0 ; enable cold extrusion checking - * M302 P1 ; disables cold extrusion checking - * M302 S0 ; always allow extrusion (disables checking) - * M302 S170 ; only allow extrusion above 170 - * M302 S170 P1 ; set min extrude temp to 170 but leave disabled - */ - inline void gcode_M302() { - const bool seen_S = parser.seen('S'); - if (seen_S) { - thermalManager.extrude_min_temp = parser.value_celsius(); - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); - } - - if (parser.seen('P')) - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); - else if (!seen_S) { - // Report current state - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis")); - SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp); - SERIAL_ECHOLNPGM("C)"); - } - } - -#endif // PREVENT_COLD_EXTRUSION - -/** - * M303: PID relay autotune - * - * S sets the target temperature. (default 150C / 70C) - * E (-1 for the bed) (default 0) - * C - * U with a non-zero value will apply the result to current settings - */ -inline void gcode_M303() { - #if HAS_PID_HEATING - const int e = parser.intval('E'), c = parser.intval('C', 5); - const bool u = parser.boolval('U'); - - int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150); - - if (WITHIN(e, 0, HOTENDS - 1)) - target_extruder = e; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - thermalManager.PID_autotune(temp, e, c, u); - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif - #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED); - #endif -} - -#if ENABLED(MORGAN_SCARA) - - bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) { - if (IsRunning()) { - forward_kinematics_SCARA(delta_a, delta_b); - destination[X_AXIS] = cartes[X_AXIS]; - destination[Y_AXIS] = cartes[Y_AXIS]; - destination[Z_AXIS] = current_position[Z_AXIS]; - prepare_move_to_destination(); - return true; - } - return false; - } - - /** - * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - */ - inline bool gcode_M360() { - SERIAL_ECHOLNPGM(" Cal: Theta 0"); - return SCARA_move_to_cal(0, 120); - } - - /** - * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - */ - inline bool gcode_M361() { - SERIAL_ECHOLNPGM(" Cal: Theta 90"); - return SCARA_move_to_cal(90, 130); - } - - /** - * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) - */ - inline bool gcode_M362() { - SERIAL_ECHOLNPGM(" Cal: Psi 0"); - return SCARA_move_to_cal(60, 180); - } - - /** - * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - */ - inline bool gcode_M363() { - SERIAL_ECHOLNPGM(" Cal: Psi 90"); - return SCARA_move_to_cal(50, 90); - } - - /** - * M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position) - */ - inline bool gcode_M364() { - SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90"); - return SCARA_move_to_cal(45, 135); - } - -#endif // SCARA - -#if ENABLED(EXT_SOLENOID) - - void enable_solenoid(const uint8_t num) { - switch (num) { - case 0: - OUT_WRITE(SOL0_PIN, HIGH); - break; - #if HAS_SOLENOID_1 && EXTRUDERS > 1 - case 1: - OUT_WRITE(SOL1_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_2 && EXTRUDERS > 2 - case 2: - OUT_WRITE(SOL2_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_3 && EXTRUDERS > 3 - case 3: - OUT_WRITE(SOL3_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_4 && EXTRUDERS > 4 - case 4: - OUT_WRITE(SOL4_PIN, HIGH); - break; - #endif - default: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID); - break; - } - } - - void enable_solenoid_on_active_extruder() { enable_solenoid(active_extruder); } - - void disable_all_solenoids() { - OUT_WRITE(SOL0_PIN, LOW); - #if HAS_SOLENOID_1 && EXTRUDERS > 1 - OUT_WRITE(SOL1_PIN, LOW); - #endif - #if HAS_SOLENOID_2 && EXTRUDERS > 2 - OUT_WRITE(SOL2_PIN, LOW); - #endif - #if HAS_SOLENOID_3 && EXTRUDERS > 3 - OUT_WRITE(SOL3_PIN, LOW); - #endif - #if HAS_SOLENOID_4 && EXTRUDERS > 4 - OUT_WRITE(SOL4_PIN, LOW); - #endif - } - - /** - * M380: Enable solenoid on the active extruder - */ - inline void gcode_M380() { enable_solenoid_on_active_extruder(); } - - /** - * M381: Disable all solenoids - */ - inline void gcode_M381() { disable_all_solenoids(); } - -#endif // EXT_SOLENOID - -/** - * M400: Finish all moves - */ -inline void gcode_M400() { planner.synchronize(); } - -#if HAS_BED_PROBE - - /** - * M401: Deploy and activate the Z probe - */ - inline void gcode_M401() { - DEPLOY_PROBE(); - report_current_position(); - } - - /** - * M402: Deactivate and stow the Z probe - */ - inline void gcode_M402() { - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - report_current_position(); - } - -#endif // HAS_BED_PROBE - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - /** - * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> - */ - inline void gcode_M404() { - if (parser.seen('W')) { - filament_width_nominal = parser.value_linear_units(); - planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5); - } - else { - SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); - SERIAL_PROTOCOLLN(filament_width_nominal); - } - } - - /** - * M405: Turn on filament sensor for control - */ - inline void gcode_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 (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; - } - - /** - * M406: Turn off filament sensor for control - */ - inline void gcode_M406() { - filament_sensor = false; - planner.calculate_volumetric_multipliers(); // Restore correct 'volumetric_multiplier' value - } - - /** - * M407: Get measured filament diameter on serial output - */ - inline void gcode_M407() { - SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); - SERIAL_PROTOCOLLN(filament_width_meas); - } - -#endif // FILAMENT_WIDTH_SENSOR - -void quickstop_stepper() { - planner.quick_stop(); - planner.synchronize(); - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); -} - - - -#if HAS_LEVELING - - //#define M420_C_USE_MEAN - - /** - * M420: Enable/Disable Bed Leveling and/or set the Z fade height. - * - * S[bool] Turns leveling on or off - * Z[height] Sets the Z fade height (0 or none to disable) - * V[bool] Verbose - Print the leveling grid - * - * With AUTO_BED_LEVELING_UBL only: - * - * L[index] Load UBL mesh from index (0 is default) - * T[map] 0:Human-readable 1:CSV 2:"LCD" 4:Compact - * - * With mesh-based leveling only: - * - * C Center mesh on the mean of the lowest and highest - */ - inline void gcode_M420() { - const bool seen_S = parser.seen('S'); - bool to_enable = seen_S ? parser.value_bool() : planner.leveling_active; - - // If disabling leveling do it right away - // (Don't disable for just M420 or M420 V) - if (seen_S && !to_enable) set_bed_leveling_enabled(false); - - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - // L to load a mesh from the EEPROM - if (parser.seen('L')) { - - set_bed_leveling_enabled(false); - - #if ENABLED(EEPROM_SETTINGS) - const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.storage_slot; - const int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(storage_slot); - ubl.storage_slot = storage_slot; - - #else - - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - - #endif - } - - // L or V display the map info - if (parser.seen('L') || parser.seen('V')) { - ubl.display_map(parser.byteval('T')); - SERIAL_ECHOPGM("Mesh is "); - if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPAIR("valid\nStorage slot: ", ubl.storage_slot); - } - - #endif // AUTO_BED_LEVELING_UBL - - #if HAS_MESH - - #if ENABLED(MESH_BED_LEVELING) - #define Z_VALUES(X,Y) mbl.z_values[X][Y] - #else - #define Z_VALUES(X,Y) z_values[X][Y] - #endif - - // Subtract the given value or the mean from all mesh values - if (leveling_is_valid() && parser.seen('C')) { - const float cval = parser.value_float(); - #if ENABLED(AUTO_BED_LEVELING_UBL) - - set_bed_leveling_enabled(false); - ubl.adjust_mesh_to_mean(true, cval); - - #else - - #if ENABLED(M420_C_USE_MEAN) - - // Get the sum and average of all mesh values - float mesh_sum = 0; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - mesh_sum += Z_VALUES(x, y); - const float zmean = mesh_sum / float(GRID_MAX_POINTS); - - #else - - // Find the low and high mesh values - float lo_val = 100, hi_val = -100; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { - const float z = Z_VALUES(x, y); - NOMORE(lo_val, z); - NOLESS(hi_val, z); - } - // Take the mean of the lowest and highest - const float zmean = (lo_val + hi_val) / 2.0 + cval; - - #endif - - // If not very close to 0, adjust the mesh - if (!NEAR_ZERO(zmean)) { - set_bed_leveling_enabled(false); - // Subtract the mean from all values - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - Z_VALUES(x, y) -= zmean; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - - #endif - } - - #endif // HAS_MESH - - // V to print the matrix or mesh - if (parser.seen('V')) { - #if ABL_PLANAR - planner.bed_level_matrix.debug(PSTR("Bed Level Correction Matrix:")); - #else - if (leveling_is_valid()) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - print_bilinear_leveling_grid(); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - #elif ENABLED(MESH_BED_LEVELING) - SERIAL_ECHOLNPGM("Mesh Bed Level data:"); - mbl.report_mesh(); - #endif - } - #endif - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seen('Z')) set_z_fade_height(parser.value_linear_units(), false); - #endif - - // Enable leveling if specified, or if previously active - set_bed_leveling_enabled(to_enable); - - // Error if leveling failed to enable or reenable - if (to_enable && !planner.leveling_active) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED); - } - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Bed Leveling ", planner.leveling_active ? MSG_ON : MSG_OFF); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Fade Height "); - if (planner.z_fade_height > 0.0) - SERIAL_ECHOLN(planner.z_fade_height); - else - SERIAL_ECHOLNPGM(MSG_OFF); - #endif - - // Report change in position - if (memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); - } - -#endif // HAS_LEVELING - -#if ENABLED(MESH_BED_LEVELING) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 X Y Z - * M421 X Y Q - * M421 I J Z - * M421 I J Q - */ - inline void gcode_M421() { - const bool hasX = parser.seen('X'), hasI = parser.seen('I'); - const int8_t ix = hasI ? parser.value_int() : hasX ? mbl.probe_index_x(parser.value_linear_units()) : -1; - const bool hasY = parser.seen('Y'), hasJ = parser.seen('J'); - const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(parser.value_linear_units()) : -1; - const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - - if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (ix < 0 || iy < 0) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else - mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); - } - -#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - */ - inline void gcode_M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (!hasI || !hasJ || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else { - z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - } - -#elif ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - * M421 I J N - * M421 C Z - * M421 C Q - */ - inline void gcode_M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, - hasC = parser.seen('C'), - hasN = parser.seen('N'), - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (hasC) { - const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL); - ix = location.x_index; - iy = location.y_index; - } - - if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else - ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); - } - -#endif // AUTO_BED_LEVELING_UBL - -#if HAS_M206_COMMAND - - /** - * M428: Set home_offset based on the distance between the - * current_position and the nearest "reference point." - * If an axis is past center its endstop position - * is the reference-point. Otherwise it uses 0. This allows - * the Z offset to be set near the bed when using a max endstop. - * - * M428 can't be used more than 2cm away from 0 or an endstop. - * - * Use M206 to set these values directly. - */ - inline void gcode_M428() { - if (axis_unhomed_error()) return; - - float diff[XYZ]; - LOOP_XYZ(i) { - diff[i] = base_home_pos((AxisEnum)i) - current_position[i]; - if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) - diff[i] = -current_position[i]; - if (!WITHIN(diff[i], -20, 20)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGEPGM("Err: Too far!"); - BUZZ(200, 40); - return; - } - } - - LOOP_XYZ(i) set_home_offset((AxisEnum)i, diff[i]); - report_current_position(); - LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); - BUZZ(100, 659); - BUZZ(100, 698); - } - -#endif // HAS_M206_COMMAND - -/** - * M500: Store settings in EEPROM - */ -inline void gcode_M500() { - (void)settings.save(); -} - -/** - * M501: Read settings from EEPROM - */ -inline void gcode_M501() { - (void)settings.load(); -} - -/** - * M502: Revert to default settings - */ -inline void gcode_M502() { - (void)settings.reset(); -} - -#if DISABLED(DISABLE_M503) - /** - * M503: print settings currently in memory - */ - inline void gcode_M503() { - (void)settings.report(parser.seen('S') && !parser.value_bool()); - } -#endif - -#if ENABLED(EEPROM_SETTINGS) - /** - * M504: Validate EEPROM Contents - */ - inline void gcode_M504() { - if (settings.validate()) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM OK"); - } - } -#endif - -#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - - /** - * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) - */ - inline void gcode_M540() { - if (parser.seen('S')) planner.abort_on_endstop_hit = parser.value_bool(); - } - -#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - -#if HAS_BED_PROBE - - inline void gcode_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_START(); - SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); - } - return; - } - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET); - SERIAL_ECHOLNPAIR(": ", zprobe_zoffset); - } - -#endif // HAS_BED_PROBE - -#if ENABLED(SKEW_CORRECTION_GCODE) - - /** - * M852: Get or set the machine skew factors. Reports current values with no arguments. - * - * S[xy_factor] - Alias for 'I' - * I[xy_factor] - New XY skew factor - * J[xz_factor] - New XZ skew factor - * K[yz_factor] - New YZ skew factor - */ - inline void gcode_M852() { - uint8_t ijk = 0, badval = 0, setval = 0; - - if (parser.seen('I') || parser.seen('S')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.xy_skew_factor != value) { - planner.xy_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - #if ENABLED(SKEW_CORRECTION_FOR_Z) - - if (parser.seen('J')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.xz_skew_factor != value) { - planner.xz_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - if (parser.seen('K')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.yz_skew_factor != value) { - planner.yz_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - #endif - - if (badval) - SERIAL_ECHOLNPGM(MSG_SKEW_MIN " " STRINGIFY(SKEW_FACTOR_MIN) " " MSG_SKEW_MAX " " STRINGIFY(SKEW_FACTOR_MAX)); - - // When skew is changed the current position changes - if (setval) { - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - report_current_position(); - } - - if (!ijk) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: "); - SERIAL_ECHO_F(planner.xy_skew_factor, 6); - SERIAL_EOL(); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPAIR(" XZ: ", planner.xz_skew_factor); - SERIAL_ECHOLNPAIR(" YZ: ", planner.yz_skew_factor); - #else - SERIAL_EOL(); - #endif - } - } - -#endif // SKEW_CORRECTION_GCODE - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * M600: Pause for filament change - * - * E[distance] - Retract the filament this far - * Z[distance] - Move the Z axis by this distance - * X[position] - Move to this X position, with Y - * Y[position] - Move to this Y position, with X - * U[distance] - Retract distance for removal (manual reload) - * L[distance] - Extrude distance for insertion (manual reload) - * B[count] - Number of times to beep, -1 for indefinite (if equipped with a buzzer) - * T[toolhead] - Select extruder for filament change - * - * Default values are used for omitted arguments. - */ - inline void gcode_M600() { - point_t park_point = NOZZLE_PARK_POINT; - - if (get_target_extruder_from_command(600)) return; - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder); - #endif - - #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) - // Don't allow filament change without homing first - if (axis_unhomed_error()) home_all_axes(); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) - park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); - park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); - #endif - - // Unload filament - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[active_extruder]); - - // Slow load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - - // Fast load filament - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : - filament_change_load_length[active_extruder]); - - const int beep_count = parser.intval('B', - #ifdef FILAMENT_CHANGE_ALERT_BEEPS - FILAMENT_CHANGE_ALERT_BEEPS - #else - -1 - #endif - ); - - const bool job_running = print_job_timer.isRunning(); - - if (pause_print(retract, park_point, unload_length, true)) { - wait_for_filament_reload(beep_count); - resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); - } - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Resume the print job timer if it was running - if (job_running) print_job_timer.start(); - } - - /** - * M603: Configure filament change - * - * T[toolhead] - Select extruder to configure, active extruder if not specified - * U[distance] - Retract distance for removal, for the specified extruder - * L[distance] - Extrude distance for insertion, for the specified extruder - * - */ - inline void gcode_M603() { - - if (get_target_extruder_from_command(603)) return; - - // Unload length - if (parser.seen('U')) { - filament_change_unload_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_unload_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - - // Load length - if (parser.seen('L')) { - filament_change_load_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_load_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - } - -#endif // ADVANCED_PAUSE_FEATURE - -#if ENABLED(MK2_MULTIPLEXER) - - inline void select_multiplexed_stepper(const uint8_t e) { - planner.synchronize(); - disable_e_steppers(); - WRITE(E_MUX0_PIN, TEST(e, 0) ? HIGH : LOW); - WRITE(E_MUX1_PIN, TEST(e, 1) ? HIGH : LOW); - WRITE(E_MUX2_PIN, TEST(e, 2) ? HIGH : LOW); - safe_delay(100); - } - -#endif // MK2_MULTIPLEXER - -#if ENABLED(DUAL_X_CARRIAGE) - - /** - * M605: Set dual x-carriage movement mode - * - * M605 S0: Full control mode. The slicer has full control over x-carriage movement - * M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement - * M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn - * units x-offset and an optional differential hotend temperature of - * mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate - * the first with a spacing of 100mm in the x direction and 2 degrees hotter. - * - * Note: the X axis should be homed after changing dual x-carriage mode. - */ - inline void gcode_M605() { - planner.synchronize(); - if (parser.seen('S')) dual_x_carriage_mode = (DualXMode)parser.value_byte(); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - case DXC_AUTO_PARK_MODE: - break; - case DXC_DUPLICATION_MODE: - if (parser.seen('X')) duplicate_extruder_x_offset = MAX(parser.value_linear_units(), X2_MIN_POS - x_home_pos(0)); - if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][0]); - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][0]); - SERIAL_CHAR(' '); - SERIAL_ECHO(duplicate_extruder_x_offset); - SERIAL_CHAR(','); - SERIAL_ECHOLN(hotend_offset[Y_AXIS][1]); - break; - default: - dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - break; - } - active_extruder_parked = false; - extruder_duplication_enabled = false; - delayed_move_time = 0; - } - -#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - - inline void gcode_M605() { - planner.synchronize(); - extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); - } - -#endif // DUAL_NOZZLE_DUPLICATION_MODE - -#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - - /** - * M701: Load filament - * - * T - Optional extruder number. Current extruder if omitted. - * Z - Move the Z axis by this distance - * L - Extrude distance for insertion (positive value) (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_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; - #endif - - if (get_target_extruder_from_command(701)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial "wait for load" message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // 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); - - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : filament_change_load_length[active_extruder]); - load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, - true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT); - - // 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); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - - /** - * M702: Unload filament - * - * T - Optional extruder number. If omitted, current extruder - * (or ALL extruders with FILAMENT_UNLOAD_ALL_EXTRUDERS). - * Z - Move the Z axis by this distance - * U - Retract distance for removal (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_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; - #endif - - if (get_target_extruder_from_command(702)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // 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); - - // Unload filament - #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (!parser.seenval('T')) { - HOTEND_LOOP() { - if (e != active_extruder) tool_change(e, 0, true); - unload_filament(-filament_change_unload_length[e], true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - } - else - #endif - { - // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[target_extruder]); - - unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - - // 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); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - -#endif // FILAMENT_LOAD_UNLOAD_GCODES - -#if ENABLED(MAX7219_GCODE) - /** - * M7219: Control the Max7219 LED matrix - * - * I - Initialize (clear) the matrix - * F - Fill the matrix (set all bits) - * P - Dump the LEDs[] array values - * C - Set a column to the 8-bit value V - * R - Set a row to the 8-bit value V - * X - X position of an LED to set or toggle - * Y - Y position of an LED to set or toggle - * V - The potentially 32-bit value or on/off state to set - * (for example: a chain of 4 Max7219 devices can have 32 bit - * rows or columns depending upon rotation) - */ - inline void gcode_M7219() { - if (parser.seen('I')) { - max7219.register_setup(); - max7219.clear(); - } - - if (parser.seen('F')) max7219.fill(); - - const uint32_t v = parser.ulongval('V'); - - if (parser.seenval('R')) { - const uint8_t r = parser.value_byte(); - max7219.set_row(r, v); - } - else if (parser.seenval('C')) { - const uint8_t c = parser.value_byte(); - max7219.set_column(c, v); - } - else if (parser.seenval('X') || parser.seenval('Y')) { - const uint8_t x = parser.byteval('X'), y = parser.byteval('Y'); - if (parser.seenval('V')) - max7219.led_set(x, y, parser.boolval('V')); - else - max7219.led_toggle(x, y); - } - else if (parser.seen('D')) { - const uint8_t line = parser.byteval('D') + (parser.byteval('U') << 3); - if (line < MAX7219_LINES) { - max7219.led_line[line] = v; - return max7219.refresh_line(line); - } - } - - if (parser.seen('P')) { - for (uint8_t r = 0; r < MAX7219_LINES; r++) { - SERIAL_ECHOPGM("led_line["); - if (r < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(r)); - SERIAL_ECHO("]="); - for (uint8_t b = 8; b--;) SERIAL_CHAR('0' + TEST(max7219.led_line[r], b)); - SERIAL_EOL(); - } - } - } -#endif // MAX7219_GCODE - -#if ENABLED(LIN_ADVANCE) - /** - * M900: Get or Set Linear Advance K-factor - * - * K Set advance K factor - */ - inline void gcode_M900() { - if (parser.seenval('K')) { - const float newK = parser.floatval('K'); - if (WITHIN(newK, 0, 10)) { - planner.synchronize(); - planner.extruder_advance_K = newK; - } - else - SERIAL_PROTOCOLLNPGM("?K value out of range (0-10)."); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Advance K=", planner.extruder_advance_K); - } - } -#endif // LIN_ADVANCE - -#if HAS_TRINAMIC - #if ENABLED(TMC_DEBUG) - inline void gcode_M122() { - if (parser.seen('S')) - tmc_set_report_status(parser.value_bool()); - else - tmc_report_all(); - } - #endif // TMC_DEBUG - - /** - * M906: Set motor current in milliamps using axis codes X, Y, Z, E - * Report driver currents when no axis specified - */ - inline void gcode_M906() { - #define TMC_SAY_CURRENT(Q) tmc_get_current(stepper##Q, TMC_##Q) - #define TMC_SET_CURRENT(Q) tmc_set_current(stepper##Q, value) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZE(i) if (uint16_t value = parser.intval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_IS_TMC(X) - if (index < 2) TMC_SET_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - if (!(index & 1)) TMC_SET_CURRENT(X2); - #endif - break; - case Y_AXIS: - #if AXIS_IS_TMC(Y) - if (index < 2) TMC_SET_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - if (!(index & 1)) TMC_SET_CURRENT(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_IS_TMC(Z) - if (index < 2) TMC_SET_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - if (!(index & 1)) TMC_SET_CURRENT(Z2); - #endif - break; - case E_AXIS: { - if (get_target_extruder_from_command(906)) return; - switch (target_extruder) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - } - } break; - } - } - - if (report) { - #if AXIS_IS_TMC(X) - TMC_SAY_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - TMC_SAY_CURRENT(X2); - #endif - #if AXIS_IS_TMC(Y) - TMC_SAY_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - TMC_SAY_CURRENT(Y2); - #endif - #if AXIS_IS_TMC(Z) - TMC_SAY_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - TMC_SAY_CURRENT(Z2); - #endif - #if AXIS_IS_TMC(E0) - TMC_SAY_CURRENT(E0); - #endif - #if AXIS_IS_TMC(E1) - TMC_SAY_CURRENT(E1); - #endif - #if AXIS_IS_TMC(E2) - TMC_SAY_CURRENT(E2); - #endif - #if AXIS_IS_TMC(E3) - TMC_SAY_CURRENT(E3); - #endif - #if AXIS_IS_TMC(E4) - TMC_SAY_CURRENT(E4); - #endif - } - } - - #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && PIN_EXISTS(ST##_SERIAL_RX))) - #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N)) - - /** - * M911: Report TMC stepper driver overtemperature pre-warn flag - * This flag is held by the library, persisting until cleared by M912 - */ - inline void gcode_M911() { - #if M91x_USE(X) - tmc_report_otpw(stepperX, TMC_X); - #endif - #if M91x_USE(X2) - tmc_report_otpw(stepperX2, TMC_X2); - #endif - #if M91x_USE(Y) - tmc_report_otpw(stepperY, TMC_Y); - #endif - #if M91x_USE(Y2) - tmc_report_otpw(stepperY2, TMC_Y2); - #endif - #if M91x_USE(Z) - tmc_report_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - tmc_report_otpw(stepperZ2, TMC_Z2); - #endif - #if M91x_USE_E(0) - tmc_report_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - tmc_report_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - tmc_report_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - tmc_report_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - tmc_report_otpw(stepperE4, TMC_E4); - #endif - } - - /** - * M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library - * Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, and E[index]. - * If no axes are given, clear all. - * - * Examples: - * M912 X ; clear X and X2 - * M912 X1 ; clear X1 only - * M912 X2 ; clear X2 only - * M912 X E ; clear X, X2, and all E - * M912 E1 ; clear E1 only - */ - inline void gcode_M912() { - const bool hasX = parser.seen(axis_codes[X_AXIS]), - hasY = parser.seen(axis_codes[Y_AXIS]), - hasZ = parser.seen(axis_codes[Z_AXIS]), - hasE = parser.seen(axis_codes[E_AXIS]), - hasNone = !hasX && !hasY && !hasZ && !hasE; - - #if M91x_USE(X) || M91x_USE(X2) - const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10); - #if M91x_USE(X) - if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X); - #endif - #if M91x_USE(X2) - if (hasNone || xval == 2 || (hasX && xval == 10)) tmc_clear_otpw(stepperX2, TMC_X2); - #endif - #endif - - #if M91x_USE(Y) || M91x_USE(Y2) - const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10); - #if M91x_USE(Y) - if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y); - #endif - #if M91x_USE(Y2) - if (hasNone || yval == 2 || (hasY && yval == 10)) tmc_clear_otpw(stepperY2, TMC_Y2); - #endif - #endif - - #if M91x_USE(Z) || M91x_USE(Z2) - const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10); - #if M91x_USE(Z) - if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - if (hasNone || zval == 2 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ2, TMC_Z2); - #endif - #endif - - #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) - const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10); - #if M91x_USE_E(0) - if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4); - #endif - #endif - } - - /** - * M913: Set HYBRID_THRESHOLD speed. - */ - #if ENABLED(HYBRID_THRESHOLD) - inline void gcode_M913() { - #define TMC_SAY_PWMTHRS(A,Q) tmc_get_pwmthrs(stepper##Q, TMC_##Q, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, value, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SAY_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_get_pwmthrs(stepperE##E, TMC_E##E, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) - #define TMC_SET_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_set_pwmthrs(stepperE##E, value, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZE(i) if (int32_t value = parser.longval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_HAS_STEALTHCHOP(X) - if (index < 2) TMC_SET_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); - #endif - break; - case Y_AXIS: - #if AXIS_HAS_STEALTHCHOP(Y) - if (index < 2) TMC_SET_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); - #endif - break; - case Z_AXIS: - #if AXIS_HAS_STEALTHCHOP(Z) - if (index < 2) TMC_SET_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2); - #endif - break; - case E_AXIS: { - if (get_target_extruder_from_command(913)) return; - switch (target_extruder) { - #if AXIS_HAS_STEALTHCHOP(E0) - case 0: TMC_SET_PWMTHRS_E(0); break; - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - case 1: TMC_SET_PWMTHRS_E(1); break; - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - case 2: TMC_SET_PWMTHRS_E(2); break; - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - case 3: TMC_SET_PWMTHRS_E(3); break; - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - case 4: TMC_SET_PWMTHRS_E(4); break; - #endif - } - } break; - } - } - - if (report) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SAY_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SAY_PWMTHRS(X,X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SAY_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SAY_PWMTHRS(Y,Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SAY_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SAY_PWMTHRS(Z,Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SAY_PWMTHRS_E(0); - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - TMC_SAY_PWMTHRS_E(1); - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - TMC_SAY_PWMTHRS_E(2); - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - TMC_SAY_PWMTHRS_E(3); - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - TMC_SAY_PWMTHRS_E(4); - #endif - } - } - #endif // HYBRID_THRESHOLD - - /** - * M914: Set SENSORLESS_HOMING sensitivity. - */ - #if ENABLED(SENSORLESS_HOMING) - inline void gcode_M914() { - #define TMC_SAY_SGT(Q) tmc_get_sgt(stepper##Q, TMC_##Q) - #define TMC_SET_SGT(Q) tmc_set_sgt(stepper##Q, value) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZ(i) if (parser.seen(axis_codes[i])) { - const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); - report = false; - switch (i) { - #if X_SENSORLESS - case X_AXIS: - #if AXIS_HAS_STALLGUARD(X) - if (index < 2) TMC_SET_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - if (!(index & 1)) TMC_SET_SGT(X2); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - #if AXIS_HAS_STALLGUARD(Y) - if (index < 2) TMC_SET_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - if (!(index & 1)) TMC_SET_SGT(Y2); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - #if AXIS_HAS_STALLGUARD(Z) - if (index < 2) TMC_SET_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - if (!(index & 1)) TMC_SET_SGT(Z2); - #endif - break; - #endif - } - } - - if (report) { - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - TMC_SAY_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - TMC_SAY_SGT(X2); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_HAS_STALLGUARD(Y) - TMC_SAY_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - TMC_SAY_SGT(Y2); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - TMC_SAY_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - TMC_SAY_SGT(Z2); - #endif - #endif - } - } - #endif // SENSORLESS_HOMING - - /** - * TMC Z axis calibration routine - */ - #if ENABLED(TMC_Z_CALIBRATION) - inline void gcode_M915() { - const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT, - _z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT; - - if (!TEST(axis_known_position, Z_AXIS)) { - SERIAL_ECHOLNPGM("\nPlease home Z axis first"); - return; - } - - #if AXIS_IS_TMC(Z) - const uint16_t Z_current_1 = stepperZ.getCurrent(); - stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - const uint16_t Z2_current_1 = stepperZ2.getCurrent(); - stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif - - SERIAL_ECHOPAIR("\nCalibration current: Z", _rms); - - soft_endstops_enabled = false; - - do_blocking_move_to_z(Z_MAX_POS+_z); - - #if AXIS_IS_TMC(Z) - stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif - - do_blocking_move_to_z(Z_MAX_POS); - soft_endstops_enabled = true; - - SERIAL_ECHOLNPGM("\nHoming Z due to lost steps"); - enqueue_and_echo_commands_P(PSTR("G28 Z")); - } - #endif - -#endif // HAS_TRINAMIC - -/** - * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S - */ -inline void gcode_M907() { - #if HAS_DIGIPOTSS - - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.digipot_current(i, parser.value_int()); - if (parser.seen('B')) stepper.digipot_current(4, parser.value_int()); - if (parser.seen('S')) for (uint8_t i = 0; i <= 4; i++) stepper.digipot_current(i, parser.value_int()); - - #elif HAS_MOTOR_CURRENT_PWM - - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - if (parser.seen('X')) stepper.digipot_current(0, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - if (parser.seen('Z')) stepper.digipot_current(1, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - if (parser.seen('E')) stepper.digipot_current(2, parser.value_int()); - #endif - - #endif - - #if ENABLED(DIGIPOT_I2C) - // this one uses actual amps in floating point - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float()); - // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...) - for (uint8_t i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (parser.seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, parser.value_float()); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - if (parser.seen('S')) { - const float dac_percent = parser.value_float(); - for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent); - } - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) dac_current_percent(i, parser.value_float()); - #endif -} - -#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - - /** - * M908: Control digital trimpot directly (M908 P S) - */ - inline void gcode_M908() { - #if HAS_DIGIPOTSS - stepper.digitalPotWrite( - parser.intval('P'), - parser.intval('S') - ); - #endif - #ifdef DAC_STEPPER_CURRENT - dac_current_raw( - parser.byteval('P', -1), - parser.ushortval('S', 0) - ); - #endif - } - - #if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF - - inline void gcode_M909() { dac_print_values(); } - - inline void gcode_M910() { dac_commit_eeprom(); } - - #endif - -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT - -#if HAS_MICROSTEPS - - // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - inline void gcode_M350() { - if (parser.seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, parser.value_byte()); - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte()); - if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte()); - stepper.microstep_readings(); - } - - /** - * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B - * S# determines MS1 or MS2, X# sets the pin high/low. - */ - inline void gcode_M351() { - if (parser.seenval('S')) switch (parser.value_byte()) { - case 1: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1); - if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1); - break; - case 2: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte()); - if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte()); - break; - } - stepper.microstep_readings(); - } - -#endif // HAS_MICROSTEPS - -#if HAS_CASE_LIGHT - - #ifndef INVERT_CASE_LIGHT - #define INVERT_CASE_LIGHT false - #endif - uint8_t case_light_brightness; // LCD routine wants INT - bool case_light_on; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - LEDColor case_light_color = - #ifdef CASE_LIGHT_NEOPIXEL_COLOR - CASE_LIGHT_NEOPIXEL_COLOR - #else - { 255, 255, 255, 255 } - #endif - ; - #endif - - void update_case_light() { - const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - - leds.set_color( - MakeLEDColor(case_light_color.r, case_light_color.g, case_light_color.b, case_light_color.w, n10ct), - false - ); - - #else // !CASE_LIGHT_USE_NEOPIXEL - - SET_OUTPUT(CASE_LIGHT_PIN); - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) - analogWrite(CASE_LIGHT_PIN, n10ct); - else { - const bool s = case_light_on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT; - WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW); - } - - #endif // !CASE_LIGHT_USE_NEOPIXEL - } -#endif // HAS_CASE_LIGHT - -/** - * M355: Turn case light on/off and set brightness - * - * P Set case light brightness (PWM pin required - ignored otherwise) - * - * S Set case light on/off - * - * When S turns on the light on a PWM pin then the current brightness level is used/restored - * - * M355 P200 S0 turns off the light & sets the brightness level - * M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin) - */ -inline void gcode_M355() { - #if HAS_CASE_LIGHT - uint8_t args = 0; - if (parser.seenval('P')) ++args, case_light_brightness = parser.value_byte(); - if (parser.seenval('S')) ++args, case_light_on = parser.value_bool(); - if (args) update_case_light(); - - // always report case light status - SERIAL_ECHO_START(); - if (!case_light_on) { - SERIAL_ECHOLNPGM("Case light: off"); - } - else { - if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on"); - else SERIAL_ECHOLNPAIR("Case light: ", (int)case_light_brightness); - } - - #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE); - #endif // HAS_CASE_LIGHT -} - -#if ENABLED(MIXING_EXTRUDER) - - /** - * M163: Set a single mix factor for a mixing extruder - * This is called "weight" by some systems. - * - * S[index] The channel index to set - * P[float] The mix value - * - */ - inline void gcode_M163() { - const int mix_index = parser.intval('S'); - if (mix_index < MIXING_STEPPERS) { - float mix_value = parser.floatval('P'); - NOLESS(mix_value, 0.0); - mixing_factor[mix_index] = RECIPROCAL(mix_value); - } - } - - #if MIXING_VIRTUAL_TOOLS > 1 - - /** - * M164: Store the current mix factors as a virtual tool. - * - * S[index] The virtual tool to store - * - */ - inline void gcode_M164() { - const int tool_index = parser.intval('S'); - if (tool_index < MIXING_VIRTUAL_TOOLS) { - normalize_mix(); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i]; - } - } - - #endif - - #if ENABLED(DIRECT_MIXING_IN_G1) - /** - * M165: Set multiple mix factors for a mixing extruder. - * Factors that are left out will be set to 0. - * All factors together must add up to 1.0. - * - * A[factor] Mix factor for extruder stepper 1 - * B[factor] Mix factor for extruder stepper 2 - * C[factor] Mix factor for extruder stepper 3 - * D[factor] Mix factor for extruder stepper 4 - * H[factor] Mix factor for extruder stepper 5 - * I[factor] Mix factor for extruder stepper 6 - * - */ - inline void gcode_M165() { gcode_get_mix(); } - #endif - -#endif // MIXING_EXTRUDER - -/** - * M999: Restart after being stopped - * - * Default behaviour is to flush the serial buffer and request - * a resend to the host starting on the last N line received. - * - * Sending "M999 S1" will resume printing without flushing the - * existing command buffer. - * - */ -inline void gcode_M999() { - Running = true; - lcd_reset_alert_level(); - - if (parser.boolval('S')) return; - - // gcode_LastN = Stopped_gcode_LastN; - flush_and_request_resend(); -} - -#if DO_SWITCH_EXTRUDER - #if EXTRUDERS > 3 - #define REQ_ANGLES 4 - #define _SERVO_NR (e < 2 ? SWITCHING_EXTRUDER_SERVO_NR : SWITCHING_EXTRUDER_E23_SERVO_NR) - #else - #define REQ_ANGLES 2 - #define _SERVO_NR SWITCHING_EXTRUDER_SERVO_NR - #endif - inline void move_extruder_servo(const uint8_t e) { - constexpr int16_t angles[] = SWITCHING_EXTRUDER_SERVO_ANGLES; - static_assert(COUNT(angles) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - planner.synchronize(); - #if EXTRUDERS & 1 - if (e < EXTRUDERS - 1) - #endif - { - MOVE_SERVO(_SERVO_NR, angles[e]); - safe_delay(500); - } - } -#endif // DO_SWITCH_EXTRUDER - -#if ENABLED(SWITCHING_NOZZLE) - inline void move_nozzle_servo(const uint8_t e) { - const int16_t angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; - planner.synchronize(); - MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, angles[e]); - safe_delay(500); - } -#endif - -inline void invalid_extruder_error(const uint8_t e) { - SERIAL_ECHO_START(); - SERIAL_CHAR('T'); - SERIAL_ECHO_F(e, DEC); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); -} - -#if ENABLED(PARKING_EXTRUDER) - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - #define PE_MAGNET_ON_STATE !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #else - #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #endif - - void pe_set_magnet(const uint8_t extruder_num, const uint8_t state) { - switch (extruder_num) { - case 1: OUT_WRITE(SOL1_PIN, state); break; - default: OUT_WRITE(SOL0_PIN, state); break; - } - #if PARKING_EXTRUDER_SOLENOIDS_DELAY > 0 - dwell(PARKING_EXTRUDER_SOLENOIDS_DELAY); - #endif - } - - inline void pe_activate_magnet(const uint8_t extruder_num) { pe_set_magnet(extruder_num, PE_MAGNET_ON_STATE); } - inline void pe_deactivate_magnet(const uint8_t extruder_num) { pe_set_magnet(extruder_num, !PE_MAGNET_ON_STATE); } - -#endif // PARKING_EXTRUDER - -#if HAS_FANMUX - - void fanmux_switch(const uint8_t e) { - WRITE(FANMUX0_PIN, TEST(e, 0) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX1) - WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX2) - WRITE(FANMUX2, TEST(e, 2) ? HIGH : LOW); - #endif - #endif - } - - FORCE_INLINE void fanmux_init(void) { - SET_OUTPUT(FANMUX0_PIN); - #if PIN_EXISTS(FANMUX1) - SET_OUTPUT(FANMUX1_PIN); - #if PIN_EXISTS(FANMUX2) - SET_OUTPUT(FANMUX2_PIN); - #endif - #endif - fanmux_switch(0); - } - -#endif // HAS_FANMUX - -/** - * Tool Change functions - */ - -#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - inline void mixing_tool_change(const uint8_t tmp_extruder) { - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(tmp_extruder); - - // T0-Tnnn: Switch virtual tool by changing the mix - for (uint8_t j = 0; j < MIXING_STEPPERS; j++) - mixing_factor[j] = mixing_virtual_tool_mix[tmp_extruder][j]; - } - -#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1 - -#if ENABLED(DUAL_X_CARRIAGE) - - inline void dualx_tool_change(const uint8_t tmp_extruder, bool &no_move) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; - case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; - case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; - } - } - #endif - - const float xhome = x_home_pos(active_extruder); - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE - && IsRunning() - && (delayed_move_time || current_position[X_AXIS] != xhome) - ) { - float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_z, soft_endstop_max[Z_AXIS]); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Raise to ", raised_z); - SERIAL_ECHOLNPAIR("MoveX to ", xhome); - SERIAL_ECHOLNPAIR("Lower to ", current_position[Z_AXIS]); - } - #endif - // Park old head: 1) raise 2) move to park position 3) lower - for (uint8_t i = 0; i < 3; i++) - planner.buffer_line( - i == 0 ? current_position[X_AXIS] : xhome, - current_position[Y_AXIS], - i == 2 ? current_position[Z_AXIS] : raised_z, - current_position[E_AXIS], - planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], - active_extruder - ); - planner.synchronize(); - } - - // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) - current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; - current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - - // Activate the new extruder ahead of calling set_axis_is_at_home! - active_extruder = tmp_extruder; - - // This function resets the max/min values - the current position may be overwritten below. - set_axis_is_at_home(X_AXIS); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); - #endif - - // Only when auto-parking are carriages safe to move - if (dual_x_carriage_mode != DXC_AUTO_PARK_MODE) no_move = true; - - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - // New current position is the position of the activated extruder - current_position[X_AXIS] = inactive_extruder_x_pos; - // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination[X_AXIS]; - break; - case DXC_AUTO_PARK_MODE: - // record raised toolhead position for use by unpark - COPY(raised_parked_position, current_position); - raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); - #endif - active_extruder_parked = true; - delayed_move_time = 0; - break; - case DXC_DUPLICATION_MODE: - // If the new extruder is the left one, set it "parked" - // This triggers the second extruder to move into the duplication position - active_extruder_parked = (active_extruder == 0); - current_position[X_AXIS] = active_extruder_parked ? inactive_extruder_x_pos : destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; - extruder_duplication_enabled = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos); - SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled"); - } - #endif - break; - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - DEBUG_POS("New extruder (parked)", current_position); - } - #endif - - // No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together? - } - -#endif // DUAL_X_CARRIAGE - -#if ENABLED(PARKING_EXTRUDER) - - inline void parking_extruder_tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - constexpr float z_raise = PARKING_EXTRUDER_SECURITY_RAISE; - - if (!no_move) { - - const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, - midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + hotend_offset[X_AXIS][active_extruder], - grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] - + (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); - /** - * Steps: - * 1. Raise Z-Axis to give enough clearance - * 2. Move to park position of old extruder - * 3. Disengage magnetic field, wait for delay - * 4. Move near new extruder - * 5. Engage magnetic field for new extruder - * 6. Move to parking incl. offset of new extruder - * 7. Lower Z-Axis - */ - - // STEP 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Starting Autopark"); - if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); - #endif - current_position[Z_AXIS] += z_raise; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - planner.synchronize(); - - // STEP 2 - current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(2) Park extruder ", active_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 3 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(3) Disengage magnet "); - #endif - pe_deactivate_magnet(active_extruder); - - // STEP 4 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); - #endif - current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 5 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(5) Engage magnetic field"); - #endif - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); //just save power for inverted magnets - #endif - pe_activate_magnet(tmp_extruder); - - // STEP 6 - current_position[X_AXIS] = grabpos + (tmp_extruder == 0 ? (+10) : (-10)); - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - current_position[X_AXIS] = grabpos; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(6) Unpark extruder ", tmp_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder); - planner.synchronize(); - - // Step 7 - current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(7) Move midway between hotends"); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Autopark done."); - #endif - } - else { // nomove == true - // Only engage magnetic field for new extruder - pe_activate_magnet(tmp_extruder); - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); // Just save power for inverted magnets - #endif - } - current_position[Z_AXIS] += hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Applying Z-offset", current_position); - #endif - } - -#endif // PARKING_EXTRUDER - -/** - * Perform a tool-change, which may result in moving the - * previous tool out of the way and the new tool into place. - */ -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - planner.synchronize(); - - #if HAS_LEVELING - // Set current position to the physical position - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - mixing_tool_change(tmp_extruder); - - #else // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 - - if (tmp_extruder >= EXTRUDERS) - return invalid_extruder_error(tmp_extruder); - - #if HOTENDS > 1 - - const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s; - - feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - - if (tmp_extruder != active_extruder) { - if (!no_move && axis_unhomed_error()) { - no_move = true; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange"); - #endif - } - - #if ENABLED(DUAL_X_CARRIAGE) - - #if HAS_SOFTWARE_ENDSTOPS - // Update the X software endstops early - active_extruder = tmp_extruder; - update_software_endstops(X_AXIS); - active_extruder = !tmp_extruder; - #endif - - // Don't move the new extruder out of bounds - if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS])) - no_move = true; - - if (!no_move) set_destination_from_current(); - dualx_tool_change(tmp_extruder, no_move); // Can modify no_move - - #else // !DUAL_X_CARRIAGE - - set_destination_from_current(); - #if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder - parking_extruder_tool_change(tmp_extruder, no_move); - #endif - - #if ENABLED(SWITCHING_NOZZLE) - // Always raise by at least 1 to avoid workpiece - const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1; - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - move_nozzle_servo(tmp_extruder); - #endif - - const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], - ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff); - SERIAL_ECHOPAIR(", ", ydiff); - SERIAL_ECHOLNPGM(" }"); - } - #endif - - // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xdiff; - current_position[Y_AXIS] += ydiff; - - // Set the new active extruder - active_extruder = tmp_extruder; - - #endif // !DUAL_X_CARRIAGE - - #if ENABLED(SWITCHING_NOZZLE) - // The newly-selected extruder Z is actually at... - current_position[Z_AXIS] -= zdiff; - #endif - - // Tell the planner the new "current position" - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DELTA) - //LOOP_XYZ(i) update_software_endstops(i); // or modify the constrain function - const bool safe_to_move = current_position[Z_AXIS] < delta_clip_start_height - 1; - #else - constexpr bool safe_to_move = true; - #endif - - // Raise, move, and lower again - if (safe_to_move && !no_move && IsRunning()) { - #if DISABLED(SWITCHING_NOZZLE) - // Do a small lift to avoid the workpiece in the move back (below) - current_position[Z_AXIS] += 1.0; - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); - #endif - // Move back to the original (or tweaked) position - do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - } - #if ENABLED(SWITCHING_NOZZLE) - else { - // Move back down. (Including when the new tool is higher.) - do_blocking_move_to_z(destination[Z_AXIS], planner.max_feedrate_mm_s[Z_AXIS]); - } - #endif - } // (tmp_extruder != active_extruder) - - planner.synchronize(); - - #if ENABLED(EXT_SOLENOID) && !ENABLED(PARKING_EXTRUDER) - disable_all_solenoids(); - enable_solenoid_on_active_extruder(); - #endif - - feedrate_mm_s = old_feedrate_mm_s; - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(DUAL_X_CARRIAGE) - update_software_endstops(X_AXIS); - #endif - - #else // HOTENDS <= 1 - - UNUSED(fr_mm_s); - UNUSED(no_move); - - #if ENABLED(MK2_MULTIPLEXER) - if (tmp_extruder >= E_STEPPERS) - return invalid_extruder_error(tmp_extruder); - - select_multiplexed_stepper(tmp_extruder); - #endif - - // Set the new active extruder - active_extruder = tmp_extruder; - - #endif // HOTENDS <= 1 - - #if DO_SWITCH_EXTRUDER - planner.synchronize(); - move_extruder_servo(active_extruder); - #endif - - #if HAS_FANMUX - fanmux_switch(active_extruder); - #endif - - #if HAS_LEVELING - // Restore leveling to re-establish the logical position - set_bed_leveling_enabled(leveling_was_active); - #endif - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, (int)active_extruder); - - #endif // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 -} - -/** - * T0-T3: Switch tool, usually switching extruders - * - * F[units/min] Set the movement feedrate - * S1 Don't move the tool in XY after change - */ -inline void gcode_T(const uint8_t tmp_extruder) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder); - SERIAL_CHAR(')'); - SERIAL_EOL(); - DEBUG_POS("BEFORE", current_position); - } - #endif - - #if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) - - tool_change(tmp_extruder); - - #elif HOTENDS > 1 - - tool_change( - tmp_extruder, - MMM_TO_MMS(parser.linearval('F')), - (tmp_extruder == active_extruder) || parser.boolval('S') - ); - - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - SERIAL_ECHOLNPGM("<<< gcode_T"); - } - #endif -} - -/** - * Process the parsed command and dispatch it to its handler - */ -void process_parsed_command() { - KEEPALIVE_STATE(IN_HANDLER); - - // Handle a known G, M, or T - switch (parser.command_letter) { - case 'G': switch (parser.codenum) { - - case 0: case 1: gcode_G0_G1( // G0: Fast Move, G1: Linear Move - #if IS_SCARA - parser.codenum == 0 - #endif - ); break; - - #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) - case 2: case 3: gcode_G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC - #endif - - case 4: gcode_G4(); break; // G4: Dwell - - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: gcode_G5(); break; // G5: Cubic B_spline - #endif - - #if ENABLED(FWRETRACT) - case 10: gcode_G10(); break; // G10: Retract - case 11: gcode_G11(); break; // G11: Prime - #endif - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 12: gcode_G12(); break; // G12: Clean Nozzle - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - case 17: gcode_G17(); break; // G17: Select Plane XY - case 18: gcode_G18(); break; // G18: Select Plane ZX - case 19: gcode_G19(); break; // G19: Select Plane YZ - #endif - - #if ENABLED(INCH_MODE_SUPPORT) - case 20: gcode_G20(); break; // G20: Inch Units - case 21: gcode_G21(); break; // G21: Millimeter Units - #endif - - #if ENABLED(G26_MESH_VALIDATION) - case 26: gcode_G26(); break; // G26: Mesh Validation Pattern - #endif - - #if ENABLED(NOZZLE_PARK_FEATURE) - case 27: gcode_G27(); break; // G27: Park Nozzle - #endif - - case 28: gcode_G28(false); break; // G28: Home one or more axes - - #if HAS_LEVELING - case 29: gcode_G29(); break; // G29: Detailed Z probe - #endif - - #if HAS_BED_PROBE - case 30: gcode_G30(); break; // G30: Single Z probe - #endif - - #if ENABLED(Z_PROBE_SLED) - case 31: gcode_G31(); break; // G31: Dock sled - case 32: gcode_G32(); break; // G32: Undock sled - #endif - - #if ENABLED(DELTA_AUTO_CALIBRATION) - case 33: gcode_G33(); break; // G33: Delta Auto-Calibration - #endif - - #if ENABLED(G38_PROBE_TARGET) - case 38: - if (parser.subcode == 2 || parser.subcode == 3) - gcode_G38(parser.subcode == 2); // G38.2, G38.3: Probe towards object - break; - #endif - - #if HAS_MESH - case 42: gcode_G42(); break; // G42: Move to mesh point - #endif - - case 90: relative_mode = false; break; // G90: Absolute coordinates - case 91: relative_mode = true; break; // G91: Relative coordinates - - case 92: gcode_G92(); break; // G92: Set Position - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G - #endif - - default: parser.unknown_command_error(); - } - break; - - case 'M': switch (parser.codenum) { - #if HAS_RESUME_CONTINUE - case 0: case 1: gcode_M0_M1(); break; // M0: Unconditional stop, M1: Conditional stop - #endif - - #if ENABLED(SPINDLE_LASER_ENABLE) - case 3: gcode_M3_M4(true); break; // M3: Laser/CW-Spindle Power - case 4: gcode_M3_M4(false); break; // M4: Laser/CCW-Spindle Power - case 5: gcode_M5(); break; // M5: Laser/Spindle OFF - #endif - - case 17: gcode_M17(); break; // M17: Enable all steppers - - #if ENABLED(SDSUPPORT) - case 20: gcode_M20(); break; // M20: List SD Card - case 21: gcode_M21(); break; // M21: Init SD Card - case 22: gcode_M22(); break; // M22: Release SD Card - case 23: gcode_M23(); break; // M23: Select File - case 24: gcode_M24(); break; // M24: Start SD Print - case 25: gcode_M25(); break; // M25: Pause SD Print - case 26: gcode_M26(); break; // M26: Set SD Index - case 27: gcode_M27(); break; // M27: Get SD Status - case 28: gcode_M28(); break; // M28: Start SD Write - case 29: gcode_M29(); break; // M29: Stop SD Write - case 30: gcode_M30(); break; // M30: Delete File - case 32: gcode_M32(); break; // M32: Select file, Start SD Print - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - case 33: gcode_M33(); break; // M33: Report longname path - #endif - #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) - case 34: gcode_M34(); break; // M34: Set SD card sorting options - #endif - case 928: gcode_M928(); break; // M928: Start SD write - #endif // SDSUPPORT - - case 31: gcode_M31(); break; // M31: Report print job elapsed time - - case 42: gcode_M42(); break; // M42: Change pin state - #if ENABLED(PINS_DEBUGGING) - case 43: gcode_M43(); break; // M43: Read/monitor pin and endstop states - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - case 48: gcode_M48(); break; // M48: Z probe repeatability test - #endif - #if ENABLED(G26_MESH_VALIDATION) - case 49: gcode_M49(); break; // M49: Toggle the G26 Debug Flag - #endif - - #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - case 73: gcode_M73(); break; // M73: Set Print Progress % - #endif - case 75: gcode_M75(); break; // M75: Start Print Job Timer - case 76: gcode_M76(); break; // M76: Pause Print Job Timer - case 77: gcode_M77(); break; // M77: Stop Print Job Timer - #if ENABLED(PRINTCOUNTER) - case 78: gcode_M78(); break; // M78: Report Print Statistics - #endif - - #if ENABLED(M100_FREE_MEMORY_WATCHER) - case 100: gcode_M100(); break; // M100: Free Memory Report - #endif - - case 104: gcode_M104(); break; // M104: Set Hotend Temperature - case 110: gcode_M110(); break; // M110: Set Current Line Number - case 111: gcode_M111(); break; // M111: Set Debug Flags - - #if DISABLED(EMERGENCY_PARSER) - case 108: gcode_M108(); break; // M108: Cancel Waiting - case 112: gcode_M112(); break; // M112: Emergency Stop - case 410: gcode_M410(); break; // M410: Quickstop. Abort all planned moves - #else - case 108: case 112: case 410: break; // Silently drop as handled by emergency parser - #endif - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - case 113: gcode_M113(); break; // M113: Set Host Keepalive Interval - #endif - - case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok") - - #if ENABLED(AUTO_REPORT_TEMPERATURES) - case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval - #endif - - case 109: gcode_M109(); break; // M109: Set Hotend Temperature. Wait for target. - - #if HAS_HEATED_BED - case 140: gcode_M140(); break; // M140: Set Bed Temperature - case 190: gcode_M190(); break; // M190: Set Bed Temperature. Wait for target. - #endif - - #if FAN_COUNT > 0 - case 106: gcode_M106(); break; // M106: Set Fan Speed - case 107: gcode_M107(); break; // M107: Fan Off - #endif - - #if ENABLED(PARK_HEAD_ON_PAUSE) - case 125: gcode_M125(); break; // M125: Park (for Filament Change) - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - case 126: gcode_M126(); break; // M126: Valve 1 Open - case 127: gcode_M127(); break; // M127: Valve 1 Closed - #endif - #if HAS_HEATER_2 - case 128: gcode_M128(); break; // M128: Valve 2 Open - case 129: gcode_M129(); break; // M129: Valve 2 Closed - #endif - #endif - - #if HAS_POWER_SWITCH - case 80: gcode_M80(); break; // M80: Turn on Power Supply - #endif - case 81: gcode_M81(); break; // M81: Turn off Power and Power Supply - - case 82: gcode_M82(); break; // M82: Disable Relative E-Axis - case 83: gcode_M83(); break; // M83: Set Relative E-Axis - case 18: case 84: gcode_M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout - case 85: gcode_M85(); break; // M85: Set inactivity stepper shutdown timeout - case 92: gcode_M92(); break; // M92: Set steps-per-unit - case 114: gcode_M114(); break; // M114: Report Current Position - case 115: gcode_M115(); break; // M115: Capabilities Report - case 117: gcode_M117(); break; // M117: Set LCD message text - case 118: gcode_M118(); break; // M118: Print a message in the host console - case 119: gcode_M119(); break; // M119: Report Endstop states - case 120: gcode_M120(); break; // M120: Enable Endstops - case 121: gcode_M121(); break; // M121: Disable Endstops - - #if ENABLED(ULTIPANEL) - case 145: gcode_M145(); break; // M145: Set material heatup parameters - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - case 149: gcode_M149(); break; // M149: Set Temperature Units, C F K - #endif - - #if HAS_COLOR_LEDS - case 150: gcode_M150(); break; // M150: Set Status LED Color - #endif - - #if ENABLED(MIXING_EXTRUDER) - case 163: gcode_M163(); break; // M163: Set Mixing Component - #if MIXING_VIRTUAL_TOOLS > 1 - case 164: gcode_M164(); break; // M164: Save Current Mix - #endif - #if ENABLED(DIRECT_MIXING_IN_G1) - case 165: gcode_M165(); break; // M165: Set Multiple Mixing Components - #endif - #endif - - #if DISABLED(NO_VOLUMETRICS) - case 200: gcode_M200(); break; // M200: Set Filament Diameter, Volumetric Extrusion - #endif - - case 201: gcode_M201(); break; // M201: Set Max Printing Acceleration (units/sec^2) - #if 0 - case 202: gcode_M202(); break; // M202: Not used for Sprinter/grbl gen6 - #endif - case 203: gcode_M203(); break; // M203: Set Max Feedrate (units/sec) - case 204: gcode_M204(); break; // M204: Set Acceleration - case 205: gcode_M205(); break; // M205: Set Advanced settings - - #if HAS_M206_COMMAND - case 206: gcode_M206(); break; // M206: Set Home Offsets - case 428: gcode_M428(); break; // M428: Set Home Offsets based on current position - #endif - - #if ENABLED(FWRETRACT) - case 207: gcode_M207(); break; // M207: Set Retract Length, Feedrate, Z lift - case 208: gcode_M208(); break; // M208: Set Additional Prime Length and Feedrate - case 209: - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) gcode_M209(); // M209: Turn Auto-Retract on/off - break; - #endif - - case 211: gcode_M211(); break; // M211: Enable/Disable/Report Software Endstops - - #if HOTENDS > 1 - case 218: gcode_M218(); break; // M218: Set Tool Offset - #endif - - case 220: gcode_M220(); break; // M220: Set Feedrate Percentage - case 221: gcode_M221(); break; // M221: Set Flow Percentage - case 226: gcode_M226(); break; // M226: Wait for Pin State - - #if defined(CHDK) || HAS_PHOTOGRAPH - case 240: gcode_M240(); break; // M240: Trigger Camera - #endif - - #if HAS_LCD_CONTRAST - case 250: gcode_M250(); break; // M250: Set LCD Contrast - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) - case 260: gcode_M260(); break; // M260: Send Data to i2c slave - case 261: gcode_M261(); break; // M261: Request Data from i2c slave - #endif - - #if HAS_SERVOS - case 280: gcode_M280(); break; // M280: Set Servo Position - #endif - - #if ENABLED(BABYSTEPPING) - case 290: gcode_M290(); break; // M290: Babystepping - #endif - - #if HAS_BUZZER - case 300: gcode_M300(); break; // M300: Add Tone/Buzz to Queue - #endif - - #if ENABLED(PIDTEMP) - case 301: gcode_M301(); break; // M301: Set Hotend PID parameters - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - case 302: gcode_M302(); break; // M302: Set Minimum Extrusion Temp - #endif - - case 303: gcode_M303(); break; // M303: PID Autotune - - #if ENABLED(PIDTEMPBED) - case 304: gcode_M304(); break; // M304: Set Bed PID parameters - #endif - - #if HAS_MICROSTEPS - case 350: gcode_M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - case 351: gcode_M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - #endif - - case 355: gcode_M355(); break; // M355: Set Case Light brightness - - #if ENABLED(MORGAN_SCARA) - case 360: if (gcode_M360()) return; break; // M360: SCARA Theta pos1 - case 361: if (gcode_M361()) return; break; // M361: SCARA Theta pos2 - case 362: if (gcode_M362()) return; break; // M362: SCARA Psi pos1 - case 363: if (gcode_M363()) return; break; // M363: SCARA Psi pos2 - case 364: if (gcode_M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) - #endif - - case 400: gcode_M400(); break; // M400: Synchronize. Wait for moves to finish. - - #if HAS_BED_PROBE - case 401: gcode_M401(); break; // M401: Deploy Probe - case 402: gcode_M402(); break; // M402: Stow Probe - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - case 404: gcode_M404(); break; // M404: Set/Report Nominal Filament Width - case 405: gcode_M405(); break; // M405: Enable Filament Width Sensor - case 406: gcode_M406(); break; // M406: Disable Filament Width Sensor - case 407: gcode_M407(); break; // M407: Report Measured Filament Width - #endif - - #if HAS_LEVELING - case 420: gcode_M420(); break; // M420: Set Bed Leveling Enabled / Fade - #endif - - #if HAS_MESH - case 421: gcode_M421(); break; // M421: Set a Mesh Z value - #endif - - case 500: gcode_M500(); break; // M500: Store Settings in EEPROM - case 501: gcode_M501(); break; // M501: Read Settings from EEPROM - case 502: gcode_M502(); break; // M502: Revert Settings to defaults - #if DISABLED(DISABLE_M503) - case 503: gcode_M503(); break; // M503: Report Settings (in SRAM) - #endif - #if ENABLED(EEPROM_SETTINGS) - case 504: gcode_M504(); break; // M504: Validate EEPROM - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - case 540: gcode_M540(); break; // M540: Set Abort on Endstop Hit for SD Printing - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case 600: gcode_M600(); break; // M600: Pause for Filament Change - case 603: gcode_M603(); break; // M603: Configure Filament Change - #endif - - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - case 605: gcode_M605(); break; // M605: Set Dual X Carriage movement mode - #endif - - #if ENABLED(DELTA) - case 665: gcode_M665(); break; // M665: Delta Configuration - #endif - #if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - case 666: gcode_M666(); break; // M666: DELTA/Dual Endstop Adjustment - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - case 701: gcode_M701(); break; // M701: Load Filament - case 702: gcode_M702(); break; // M702: Unload Filament - #endif - - #if ENABLED(MAX7219_GCODE) - case 7219: gcode_M7219(); break; // M7219: Set LEDs, columns, and rows - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M - #endif - - #if HAS_BED_PROBE - case 851: gcode_M851(); break; // M851: Set Z Probe Z Offset - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - case 852: gcode_M852(); break; // M852: Set Skew factors - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - case 860: gcode_M860(); break; // M860: Report encoder module position - case 861: gcode_M861(); break; // M861: Report encoder module status - case 862: gcode_M862(); break; // M862: Perform axis test - case 863: gcode_M863(); break; // M863: Calibrate steps/mm - case 864: gcode_M864(); break; // M864: Change module address - case 865: gcode_M865(); break; // M865: Check module firmware version - case 866: gcode_M866(); break; // M866: Report axis error count - case 867: gcode_M867(); break; // M867: Toggle error correction - case 868: gcode_M868(); break; // M868: Set error correction threshold - case 869: gcode_M869(); break; // M869: Report axis error - #endif - - #if ENABLED(LIN_ADVANCE) - case 900: gcode_M900(); break; // M900: Set Linear Advance K factor - #endif - - case 907: gcode_M907(); break; // M907: Set Digital Trimpot Motor Current using axis codes. - - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - case 908: gcode_M908(); break; // M908: Direct Control Digital Trimpot - #if ENABLED(DAC_STEPPER_CURRENT) - case 909: gcode_M909(); break; // M909: Print Digipot/DAC current value (As with Printrbot RevF) - case 910: gcode_M910(); break; // M910: Commit Digipot/DAC value to External EEPROM (As with Printrbot RevF) - #endif - #endif - - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) - #if ENABLED(TMC_DEBUG) - case 122: gcode_M122(); break; // M122: Debug TMC steppers - #endif - case 906: gcode_M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E - case 911: gcode_M911(); break; // M911: Report TMC prewarn triggered flags - case 912: gcode_M912(); break; // M911: Clear TMC prewarn triggered flags - #if ENABLED(HYBRID_THRESHOLD) - case 913: gcode_M913(); break; // M913: Set HYBRID_THRESHOLD speed. - #endif - #if ENABLED(SENSORLESS_HOMING) - case 914: gcode_M914(); break; // M914: Set SENSORLESS_HOMING sensitivity. - #endif - #if ENABLED(TMC_Z_CALIBRATION) - case 915: gcode_M915(); break; // M915: TMC Z axis calibration routine - #endif - #endif - - case 999: gcode_M999(); break; // M999: Restart after being Stopped - - default: parser.unknown_command_error(); - } - break; - - case 'T': gcode_T(parser.codenum); break; // T: Tool Select - - default: parser.unknown_command_error(); - } - - KEEPALIVE_STATE(NOT_BUSY); - ok_to_send(); -} - -void process_next_command() { - char * const current_command = command_queue[cmd_queue_index_r]; - - if (DEBUGGING(ECHO)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLN(current_command); - #if ENABLED(M100_FREE_MEMORY_WATCHER) - SERIAL_ECHOPAIR("slot:", cmd_queue_index_r); - M100_dump_routine(" Command Queue:", (const char*)command_queue, (const char*)(command_queue + sizeof(command_queue))); - #endif - } - - // Parse the next command in the queue - parser.parse(current_command); - process_parsed_command(); -} - -/** - * Send a "Resend: nnn" message to the host to - * indicate that a command needs to be re-sent. - */ -void flush_and_request_resend() { - //char command_queue[cmd_queue_index_r][100]="Resend:"; - SERIAL_FLUSH(); - SERIAL_PROTOCOLPGM(MSG_RESEND); - SERIAL_PROTOCOLLN(gcode_LastN + 1); - ok_to_send(); -} - -/** - * Send an "ok" message to the host, indicating - * that a command was successfully processed. - * - * If ADVANCED_OK is enabled also include: - * N Line number of the command, if any - * P Planner space remaining - * B Block queue space remaining - */ -void ok_to_send() { - if (!send_ok[cmd_queue_index_r]) return; - SERIAL_PROTOCOLPGM(MSG_OK); - #if ENABLED(ADVANCED_OK) - char* p = command_queue[cmd_queue_index_r]; - if (*p == 'N') { - SERIAL_PROTOCOL(' '); - SERIAL_ECHO(*p++); - while (NUMERIC_SIGNED(*p)) - SERIAL_ECHO(*p++); - } - SERIAL_PROTOCOLPGM(" P"); SERIAL_PROTOCOL(int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); - SERIAL_PROTOCOLPGM(" B"); SERIAL_PROTOCOL(BUFSIZE - commands_in_queue); - #endif - SERIAL_EOL(); -} - -#if HAS_SOFTWARE_ENDSTOPS - - /** - * Constrain the given coordinates to the software endstops. - * - * For DELTA/SCARA the XY constraint is based on the smallest - * radius within the set software endstops. - */ - void clamp_to_software_endstops(float target[XYZ]) { - if (!soft_endstops_enabled) return; - #if IS_KINEMATIC - const float dist_2 = HYPOT2(target[X_AXIS], target[Y_AXIS]); - if (dist_2 > soft_endstop_radius_2) { - const float ratio = soft_endstop_radius / SQRT(dist_2); // 200 / 300 = 0.66 - target[X_AXIS] *= ratio; - target[Y_AXIS] *= ratio; - } - #else - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]); - #endif - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]); - #endif - #endif - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]); - #endif - } - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - // Get the Z adjustment for non-linear bed leveling - float bilinear_z_offset(const float raw[XYZ]) { - - static float z1, d2, z3, d4, L, D, ratio_x, ratio_y, - last_x = -999.999, last_y = -999.999; - - // Whole units for the grid line indices. Constrained within bounds. - static int8_t gridx, gridy, nextx, nexty, - last_gridx = -99, last_gridy = -99; - - // XY relative to the probed area - const float rx = raw[X_AXIS] - bilinear_start[X_AXIS], - 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 - #else - // Just use the grid far edge - #define FAR_EDGE_OR_BOX 1 - #endif - - if (last_x != rx) { - last_x = rx; - ratio_x = rx * ABL_BG_FACTOR(X_AXIS); - const float gx = constrain(FLOOR(ratio_x), 0, ABL_BG_POINTS_X - FAR_EDGE_OR_BOX); - ratio_x -= gx; // Subtract whole to get the ratio within the grid box - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio_x, 0); // Never < 0.0. (> 1.0 is ok when nextx==gridx.) - #endif - - gridx = gx; - nextx = MIN(gridx + 1, ABL_BG_POINTS_X - 1); - } - - if (last_y != ry || last_gridx != gridx) { - - if (last_y != ry) { - last_y = ry; - ratio_y = ry * ABL_BG_FACTOR(Y_AXIS); - const float gy = constrain(FLOOR(ratio_y), 0, ABL_BG_POINTS_Y - FAR_EDGE_OR_BOX); - ratio_y -= gy; - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio_y, 0); // Never < 0.0. (> 1.0 is ok when nexty==gridy.) - #endif - - gridy = gy; - nexty = MIN(gridy + 1, ABL_BG_POINTS_Y - 1); - } - - if (last_gridx != gridx || last_gridy != gridy) { - last_gridx = gridx; - last_gridy = gridy; - // Z at the box corners - z1 = ABL_BG_GRID(gridx, gridy); // left-front - d2 = ABL_BG_GRID(gridx, nexty) - z1; // left-back (delta) - z3 = ABL_BG_GRID(nextx, gridy); // right-front - d4 = ABL_BG_GRID(nextx, nexty) - z3; // right-back (delta) - } - - // Bilinear interpolate. Needed since ry or gridx has changed. - L = z1 + d2 * ratio_y; // Linear interp. LF -> LB - const float R = z3 + d4 * ratio_y; // Linear interp. RF -> RB - - D = R - L; - } - - const float offset = L + ratio_x * D; // the offset almost always changes - - /* - static float last_offset = 0; - if (ABS(last_offset - offset) > 0.2) { - SERIAL_ECHOPGM("Sudden Shift at "); - SERIAL_ECHOPAIR("x=", rx); - SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[X_AXIS]); - SERIAL_ECHOLNPAIR(" -> gridx=", gridx); - SERIAL_ECHOPAIR(" y=", ry); - SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[Y_AXIS]); - SERIAL_ECHOLNPAIR(" -> gridy=", gridy); - SERIAL_ECHOPAIR(" ratio_x=", ratio_x); - SERIAL_ECHOLNPAIR(" ratio_y=", ratio_y); - SERIAL_ECHOPAIR(" z1=", z1); - SERIAL_ECHOPAIR(" z2=", z2); - SERIAL_ECHOPAIR(" z3=", z3); - SERIAL_ECHOLNPAIR(" z4=", z4); - SERIAL_ECHOPAIR(" L=", L); - SERIAL_ECHOPAIR(" R=", R); - SERIAL_ECHOLNPAIR(" offset=", offset); - } - last_offset = offset; - //*/ - - return offset; - } - -#endif // AUTO_BED_LEVELING_BILINEAR - -#if ENABLED(DELTA) - - /** - * Recalculate factors used for delta kinematics whenever - * settings have been changed (e.g., by M665). - */ - void recalc_delta_settings() { - const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER, - drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER; - delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); // front left tower - delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); - delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); // front right tower - delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); - delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); // back middle tower - delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); - delta_diagonal_rod_2_tower[A_AXIS] = sq(delta_diagonal_rod + drt[A_AXIS]); - delta_diagonal_rod_2_tower[B_AXIS] = sq(delta_diagonal_rod + drt[B_AXIS]); - delta_diagonal_rod_2_tower[C_AXIS] = sq(delta_diagonal_rod + drt[C_AXIS]); - update_software_endstops(Z_AXIS); - axis_homed = 0; - } - - /** - * Delta Inverse Kinematics - * - * Calculate the tower positions for a given machine - * position, storing the result in the delta[] array. - * - * This is an expensive calculation, requiring 3 square - * roots per segmented linear move, and strains the limits - * of a Mega2560 with a Graphical Display. - * - * Suggested optimizations include: - * - * - Disable the home_offset (M206) and/or position_shift (G92) - * features to remove up to 12 float additions. - */ - - #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]); \ - }while(0) - - void inverse_kinematics(const float raw[XYZ]) { - #if HOTENDS > 1 - // Delta hotend offsets must be applied in Cartesian space with no "spoofing" - const float pos[XYZ] = { - raw[X_AXIS] - hotend_offset[X_AXIS][active_extruder], - raw[Y_AXIS] - hotend_offset[Y_AXIS][active_extruder], - raw[Z_AXIS] - }; - DELTA_IK(pos); - //DELTA_DEBUG(pos); - #else - DELTA_IK(raw); - //DELTA_DEBUG(raw); - #endif - } - - /** - * Calculate the highest Z position where the - * effector has the full range of XY motion. - */ - float delta_safe_distance_from_top() { - float cartesian[XYZ] = { 0, 0, 0 }; - inverse_kinematics(cartesian); - const float centered_extent = delta[A_AXIS]; - cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; - inverse_kinematics(cartesian); - return ABS(centered_extent - delta[A_AXIS]); - } - - /** - * Delta Forward Kinematics - * - * See the Wikipedia article "Trilateration" - * https://en.wikipedia.org/wiki/Trilateration - * - * Establish a new coordinate system in the plane of the - * three carriage points. This system has its origin at - * tower1, with tower2 on the X axis. Tower3 is in the X-Y - * plane with a Z component of zero. - * We will define unit vectors in this coordinate system - * in our original coordinate system. Then when we calculate - * the Xnew, Ynew and Znew values, we can translate back into - * the original system by moving along those unit vectors - * by the corresponding values. - * - * Variable names matched to Marlin, c-version, and avoid the - * use of any vector library. - * - * by Andreas Hardtung 2016-06-07 - * based on a Java function from "Delta Robot Kinematics V3" - * by Steve Graves - * - * The result is stored in the cartes[] array. - */ - void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { - // Create a vector in old coordinates along x axis of new coordinate - const float p12[] = { - delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], - delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], - z2 - z1 - }, - - // Get the reciprocal of Magnitude of vector. - d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), - - // Create unit vector by multiplying by the inverse of the magnitude. - ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, - - // Get the vector from the origin of the new system to the third point. - p13[3] = { - delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], - delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], - z3 - z1 - }, - - // Use the dot product to find the component of this vector on the X axis. - i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2], - - // Create a vector along the x axis that represents the x component of p13. - iex[] = { ex[0] * i, ex[1] * i, ex[2] * i }; - - // Subtract the X component from the original vector leaving only Y. We use the - // variable that will be the unit vector after we scale it. - float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2] }; - - // The magnitude and the inverse of the magnitude of Y component - const float j2 = sq(ey[0]) + sq(ey[1]) + sq(ey[2]), inv_j = RSQRT(j2); - - // Convert to a unit vector - ey[0] *= inv_j; ey[1] *= inv_j; ey[2] *= inv_j; - - // The cross product of the unit x and y is the unit z - // float[] ez = vectorCrossProd(ex, ey); - const float ez[3] = { - ex[1] * ey[2] - ex[2] * ey[1], - ex[2] * ey[0] - ex[0] * ey[2], - ex[0] * ey[1] - ex[1] * ey[0] - }, - // We now have the d, i and j values defined in Wikipedia. - // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew - Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + d2) * inv_d * 0.5, - Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, - Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); - - // Start from the origin of the old coordinates and add vectors in the - // old coords that represent the Xnew, Ynew and Znew to find the point - // in the old system. - cartes[X_AXIS] = delta_tower[A_AXIS][X_AXIS] + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew; - cartes[Y_AXIS] = delta_tower[A_AXIS][Y_AXIS] + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew; - cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; - } - - void forward_kinematics_DELTA(const float (&point)[ABC]) { - forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]); - } - -#endif // DELTA - -/** - * Get the stepper positions in the cartes[] array. - * Forward kinematics are applied for DELTA and SCARA. - * - * The result is in the current coordinate space with - * leveling applied. The coordinates need to be run through - * unapply_leveling to obtain machine coordinates suitable - * for current_position, etc. - */ -void get_cartesian_from_steppers() { - #if ENABLED(DELTA) - forward_kinematics_DELTA( - planner.get_axis_position_mm(A_AXIS), - planner.get_axis_position_mm(B_AXIS), - planner.get_axis_position_mm(C_AXIS) - ); - #else - #if IS_SCARA - forward_kinematics_SCARA( - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - ); - #else - cartes[X_AXIS] = planner.get_axis_position_mm(X_AXIS); - cartes[Y_AXIS] = planner.get_axis_position_mm(Y_AXIS); - #endif - cartes[Z_AXIS] = planner.get_axis_position_mm(Z_AXIS); - #endif -} - -/** - * Set the current_position for an axis based on - * the stepper positions, removing any leveling that - * may have been applied. - * - * To prevent small shifts in axis position always call - * SYNC_PLAN_POSITION_KINEMATIC after updating axes with this. - * - * To keep hosts in sync, always call report_current_position - * after updating the current_position. - */ -void set_current_from_steppers_for_axis(const AxisEnum axis) { - get_cartesian_from_steppers(); - #if PLANNER_LEVELING - planner.unapply_leveling(cartes); - #endif - if (axis == ALL_AXES) - COPY(current_position, cartes); - else - current_position[axis] = cartes[axis]; -} - -#if IS_CARTESIAN -#if ENABLED(SEGMENT_LEVELED_MOVES) - - /** - * Prepare a segmented move on a CARTESIAN setup. - * - * This calls planner.buffer_line several times, adding - * 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) { - - 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_kinematic(destination, fr_mm_s, active_extruder); - return; - } - - // Remaining cartesian distances - const float zdiff = destination[Z_AXIS] - current_position[Z_AXIS], - ediff = destination[E_AXIS] - current_position[E_AXIS]; - - // Get the linear distance in XYZ - // If the move is very short, check the E move distance - // No E move either? Game over. - float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); - if (UNEAR_ZERO(cartesian_mm)) return; - - // The length divided by the segment size - // At least one segment is required - uint16_t segments = cartesian_mm / segment_size; - NOLESS(segments, 1); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments, - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }; - - // SERIAL_ECHOPAIR("mm=", cartesian_mm); - // SERIAL_ECHOLNPAIR(" segments=", segments); - // SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); - - // Get the raw current position as starting point - float raw[XYZE]; - COPY(raw, current_position); - - // Calculate and execute the segments - while (--segments) { - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - LOOP_XYZE(i) raw[i] += segment_distance[i]; - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder, cartesian_segment_mm)) - break; - } - - // Since segment_distance is only approximate, - // the final move must be to the exact destination. - planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder, cartesian_segment_mm); - } - -#elif ENABLED(MESH_BED_LEVELING) - - /** - * Prepare a mesh-leveled linear move in a Cartesian setup, - * splitting the move where it crosses mesh borders. - */ - void mesh_line_to_destination(const float fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF) { - // Get current and destination cells for this line - int cx1 = mbl.cell_index_x(current_position[X_AXIS]), - cy1 = mbl.cell_index_y(current_position[Y_AXIS]), - cx2 = mbl.cell_index_x(destination[X_AXIS]), - cy2 = mbl.cell_index_y(destination[Y_AXIS]); - NOMORE(cx1, GRID_MAX_POINTS_X - 2); - NOMORE(cy1, GRID_MAX_POINTS_Y - 2); - NOMORE(cx2, GRID_MAX_POINTS_X - 2); - NOMORE(cy2, GRID_MAX_POINTS_Y - 2); - - // 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(); - return; - } - - #define MBL_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - - float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { - // Split on the X grid line - CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = mbl.index_to_xpos[gcx]; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = MBL_SEGMENT_END(Y); - } - // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { - // Split on the Y grid line - CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = mbl.index_to_ypos[gcy]; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = MBL_SEGMENT_END(X); - } - else { - // Must already have been split on these border(s) - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); - return; - } - - destination[Z_AXIS] = MBL_SEGMENT_END(Z); - destination[E_AXIS] = MBL_SEGMENT_END(E); - - // Do the split and look for more borders - mesh_line_to_destination(fr_mm_s, x_splits, y_splits); - - // Restore destination from stack - COPY(destination, end); - mesh_line_to_destination(fr_mm_s, x_splits, y_splits); - } - -#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - #define CELL_INDEX(A,V) ((V - bilinear_start[_AXIS(A)]) * ABL_BG_FACTOR(_AXIS(A))) - - /** - * 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=0xFFFF, uint16_t y_splits=0xFFFF) { - // 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]), - cx2 = CELL_INDEX(X, destination[X_AXIS]), - cy2 = CELL_INDEX(Y, destination[Y_AXIS]); - cx1 = constrain(cx1, 0, ABL_BG_POINTS_X - 2); - cy1 = constrain(cy1, 0, ABL_BG_POINTS_Y - 2); - cx2 = constrain(cx2, 0, ABL_BG_POINTS_X - 2); - cy2 = constrain(cy2, 0, ABL_BG_POINTS_Y - 2); - - // 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(); - return; - } - - #define LINE_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - - float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { - // Split on the X grid line - CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = LINE_SEGMENT_END(Y); - } - // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { - // Split on the Y grid line - CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = LINE_SEGMENT_END(X); - } - else { - // Must already have been split on these border(s) - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); - return; - } - - destination[Z_AXIS] = LINE_SEGMENT_END(Z); - 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); - - // Restore destination from stack - COPY(destination, end); - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); - } - -#endif // AUTO_BED_LEVELING_BILINEAR -#endif // IS_CARTESIAN - -#if !UBL_SEGMENTED -#if IS_KINEMATIC - - #if IS_SCARA - /** - * Before raising this value, use M665 S[seg_per_sec] to decrease - * the number of segments-per-second. Default is 200. Some deltas - * do better with 160 or lower. It would be good to know how many - * segments-per-second are actually possible for SCARA on AVR. - * - * Longer segments result in less kinematic overhead - * but may produce jagged lines. Try 0.5mm, 1.0mm, and 2.0mm - * and compare the difference. - */ - #define SCARA_MIN_SEGMENT_LENGTH 0.5f - #endif - - /** - * Prepare a linear move in a DELTA or SCARA setup. - * - * This calls planner.buffer_line several times, adding - * small incremental moves for DELTA or SCARA. - * - * For Unified Bed Leveling (Delta or Segmented Cartesian) - * the ubl.prepare_segmented_line_to method replaces this. - */ - inline bool prepare_kinematic_move_to(const float (&rtarget)[XYZE]) { - - // Get the top feedrate of the move in the XY plane - const float _feedrate_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]; - - // If the move is only in Z/E don't split up the move - if (!xdiff && !ydiff) { - planner.buffer_line_kinematic(rtarget, _feedrate_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; - - // Remaining cartesian distances - const float zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], - ediff = rtarget[E_AXIS] - current_position[E_AXIS]; - - // Get the linear distance in XYZ - // If the move is very short, check the E move distance - // No E move either? Game over. - float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); - if (UNEAR_ZERO(cartesian_mm)) return true; - - // Minimum number of seconds to move the given distance - const float seconds = cartesian_mm / _feedrate_mm_s; - - // The number of segments-per-second times the duration - // gives the number of segments - uint16_t segments = delta_segments_per_second * seconds; - - // For SCARA enforce a minimum segment size - #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); - #endif - - // At least one segment is required - NOLESS(segments, 1); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }; - - #if !HAS_FEEDRATE_SCALING - const float cartesian_segment_mm = cartesian_mm * inv_segments; - #endif - - /* - SERIAL_ECHOPAIR("mm=", cartesian_mm); - SERIAL_ECHOPAIR(" seconds=", seconds); - SERIAL_ECHOPAIR(" segments=", segments); - #if !HAS_FEEDRATE_SCALING - SERIAL_ECHOPAIR(" segment_mm=", cartesian_segment_mm); - #endif - SERIAL_EOL(); - //*/ - - #if HAS_FEEDRATE_SCALING - // SCARA needs to scale the feed rate from mm/s to degrees/s - // i.e., Complete the angular vector in the given time. - const float segment_length = cartesian_mm * inv_segments, - inv_segment_length = 1.0f / segment_length, // 1/mm/segs - inverse_secs = inv_segment_length * _feedrate_mm_s; - - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - - /* - SERIAL_ECHOPGM("Scaled kinematic move: "); - SERIAL_ECHOPAIR(" segment_length (inv)=", segment_length); - SERIAL_ECHOPAIR(" (", inv_segment_length); - SERIAL_ECHOPAIR(") _feedrate_mm_s=", _feedrate_mm_s); - SERIAL_ECHOPAIR(" inverse_secs=", inverse_secs); - SERIAL_ECHOPAIR(" oldA=", oldA); - SERIAL_ECHOPAIR(" oldB=", oldB); - #if ENABLED(DELTA_FEEDRATE_SCALING) - SERIAL_ECHOPAIR(" oldC=", oldC); - #endif - SERIAL_EOL(); - safe_delay(5); - //*/ - #endif - - // Get the current position as starting point - float raw[XYZE]; - COPY(raw, current_position); - - // Calculate and execute the segments - while (--segments) { - - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - LOOP_XYZE(i) raw[i] += segment_distance[i]; - #if ENABLED(DELTA) && HOTENDS < 2 - DELTA_IK(raw); // Delta can inline its kinematics - #else - inverse_kinematics(raw); - #endif - - ADJUST_DELTA(raw); // Adjust Z if bed leveling is enabled - - #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. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOLNPAIR(" F", HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs * 60); - safe_delay(5); - //*/ - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOLNPAIR(" F", SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs * 60); - safe_delay(5); - //*/ - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #else - if (!planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm)) - break; - #endif - } - - // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING - inverse_kinematics(rtarget); - ADJUST_DELTA(rtarget); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); SERIAL_ECHOPAIR(" cdiff=", delta[C_AXIS] - oldC); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } - #else - planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm); - #endif - - return false; // caller will update current_position - } - -#else // !IS_KINEMATIC - - /** - * Prepare a linear move in a Cartesian setup. - * - * When a mesh-based leveling system is active, moves are segmented - * according to the configuration of the leveling system. - * - * Returns true if current_position[] was set to destination[] - */ - inline bool prepare_move_to_destination_cartesian() { - #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. - #elif ENABLED(SEGMENT_LEVELED_MOVES) - segmented_line_to_destination(MMS_SCALED(feedrate_mm_s)); - return false; // caller will update current_position - #else - /** - * For MBL and ABL-BILINEAR only segment moves when X or Y are involved. - * Otherwise fall through to do a direct single move. - */ - if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) { - #if ENABLED(MESH_BED_LEVELING) - mesh_line_to_destination(MMS_SCALED(feedrate_mm_s)); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s)); - #endif - return true; - } - #endif - } - #endif // HAS_MESH - - buffer_line_to_destination(MMS_SCALED(feedrate_mm_s)); - return false; // caller will update current_position - } - -#endif // !IS_KINEMATIC -#endif // !UBL_SEGMENTED - -#if ENABLED(DUAL_X_CARRIAGE) - - /** - * Unpark the carriage, if needed - */ - inline bool dual_x_carriage_unpark() { - if (active_extruder_parked) - switch (dual_x_carriage_mode) { - - case DXC_FULL_CONTROL_MODE: break; - - case DXC_AUTO_PARK_MODE: - if (current_position[E_AXIS] == destination[E_AXIS]) { - // This is a travel move (with no extrusion) - // Skip it, but keep track of the current position - // (so it can be used as the start of the next non-travel move) - if (delayed_move_time != 0xFFFFFFFFUL) { - set_current_from_destination(); - NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]); - delayed_move_time = millis(); - return true; - } - } - // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - for (uint8_t i = 0; i < 3; i++) - if (!planner.buffer_line( - i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS], - i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS], - i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS], - current_position[E_AXIS], - i == 1 ? PLANNER_XY_FEEDRATE() : planner.max_feedrate_mm_s[Z_AXIS], - active_extruder) - ) break; - delayed_move_time = 0; - active_extruder_parked = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked"); - #endif - break; - - case DXC_DUPLICATION_MODE: - if (active_extruder == 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Set planner X", inactive_extruder_x_pos); - SERIAL_ECHOLNPAIR(" ... Line to X", current_position[X_AXIS] + duplicate_extruder_x_offset); - } - #endif - // move duplicate extruder into correct duplication position. - planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - if (!planner.buffer_line( - current_position[X_AXIS] + duplicate_extruder_x_offset, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], - planner.max_feedrate_mm_s[X_AXIS], 1) - ) break; - planner.synchronize(); - SYNC_PLAN_POSITION_KINEMATIC(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Set extruder_duplication_enabled\nClear active_extruder_parked"); - #endif - } - else { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Active extruder not 0"); - #endif - } - break; - } - return false; - } - -#endif // DUAL_X_CARRIAGE - -/** - * Prepare a single move and get ready for the next one - * - * This may result in several calls to planner.buffer_line to - * do smaller moves for DELTA, SCARA, mesh moves, etc. - * - * Make sure current_position[E] and destination[E] are good - * before calling or cold/lengthy extrusion may get missed. - */ -void prepare_move_to_destination() { - clamp_to_software_endstops(destination); - - #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) - - if (!DEBUGGING(DRYRUN)) { - if (destination[E_AXIS] != current_position[E_AXIS]) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(active_extruder)) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif // PREVENT_LENGTHY_EXTRUDE - } - } - - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_unpark()) return; - #endif - - if ( - #if UBL_SEGMENTED - ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) - #elif IS_KINEMATIC - prepare_kinematic_move_to(destination) - #else - prepare_move_to_destination_cartesian() - #endif - ) return; - - set_current_from_destination(); -} - -#if ENABLED(ARC_SUPPORT) - - #if N_ARC_CORRECTION < 1 - #undef N_ARC_CORRECTION - #define N_ARC_CORRECTION 1 - #endif - - /** - * Plan an arc in 2 dimensions - * - * The arc is approximated by generating many small linear segments. - * The length of each segment is configured in MM_PER_ARC_SEGMENT (Default 1mm) - * Arcs should only be made relatively large (over 5mm), as larger arcs with - * larger segments will tend to be more efficient. Your slicer should have - * options for G2/G3 arc generation. In future these options may be GCode tunable. - */ - void plan_arc( - const float (&cart)[XYZE], // Destination position - const float (&offset)[2], // Center of rotation relative to current_position - const bool clockwise // Clockwise? - ) { - #if ENABLED(CNC_WORKSPACE_PLANES) - AxisEnum p_axis, q_axis, l_axis; - switch (workspace_plane) { - default: - case PLANE_XY: p_axis = X_AXIS; q_axis = Y_AXIS; l_axis = Z_AXIS; break; - case PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; - case PLANE_YZ: p_axis = Y_AXIS; q_axis = Z_AXIS; l_axis = X_AXIS; break; - } - #else - constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS, l_axis = Z_AXIS; - #endif - - // Radius vector from center to current location - float r_P = -offset[0], r_Q = -offset[1]; - - const float radius = HYPOT(r_P, r_Q), - center_P = current_position[p_axis] - r_P, - center_Q = current_position[q_axis] - r_Q, - rt_X = cart[p_axis] - center_P, - rt_Y = cart[q_axis] - center_Q, - linear_travel = cart[l_axis] - current_position[l_axis], - extruder_travel = cart[E_AXIS] - current_position[E_AXIS]; - - // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. - float angular_travel = ATAN2(r_P * rt_Y - r_Q * rt_X, r_P * rt_X + r_Q * rt_Y); - if (angular_travel < 0) angular_travel += RADIANS(360); - if (clockwise) angular_travel -= RADIANS(360); - - // Make a circle if the angular rotation is 0 and the target is current position - if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) - angular_travel = RADIANS(360); - - const float flat_mm = radius * angular_travel, - mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); - if (mm_of_travel < 0.001f) return; - - uint16_t segments = FLOOR(mm_of_travel / (MM_PER_ARC_SEGMENT)); - NOLESS(segments, 1); - - /** - * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector, - * and phi is the angle of rotation. Based on the solution approach by Jens Geisler. - * r_T = [cos(phi) -sin(phi); - * sin(phi) cos(phi)] * r ; - * - * For arc generation, the center of the circle is the axis of rotation and the radius vector is - * defined from the circle center to the initial position. Each line segment is formed by successive - * vector rotations. This requires only two cos() and sin() computations to form the rotation - * matrix for the duration of the entire arc. Error may accumulate from numerical round-off, since - * all double numbers are single precision on the Arduino. (True double precision will not have - * round off issues for CNC applications.) Single precision error can accumulate to be greater than - * tool precision in some cases. Therefore, arc path correction is implemented. - * - * Small angle approximation may be used to reduce computation overhead further. This approximation - * holds for everything, but very small circles and large MM_PER_ARC_SEGMENT values. In other words, - * theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large - * to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for - * numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an - * issue for CNC machines with the single precision Arduino calculations. - * - * This approximation also allows plan_arc to immediately insert a line segment into the planner - * without the initial overhead of computing cos() or sin(). By the time the arc needs to be applied - * a correction, the planner should have caught up to the lag caused by the initial plan_arc overhead. - * This is important when there are successive arc motions. - */ - // Vector rotation matrix values - float raw[XYZE]; - const float theta_per_segment = angular_travel / segments, - linear_per_segment = linear_travel / segments, - extruder_per_segment = extruder_travel / segments, - sin_T = theta_per_segment, - cos_T = 1 - 0.5f * sq(theta_per_segment); // Small angle approximation - - // Initialize the linear axis - raw[l_axis] = current_position[l_axis]; - - // Initialize the extruder axis - raw[E_AXIS] = current_position[E_AXIS]; - - const float fr_mm_s = MMS_SCALED(feedrate_mm_s); - - millis_t next_idle_ms = millis() + 200UL; - - #if HAS_FEEDRATE_SCALING - // SCARA needs to scale the feed rate from mm/s to degrees/s - const float inv_segment_length = 1.0f / (MM_PER_ARC_SEGMENT), - inverse_secs = inv_segment_length * fr_mm_s; - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - #endif - - #if N_ARC_CORRECTION > 1 - int8_t arc_recalc_count = N_ARC_CORRECTION; - #endif - - for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times - - thermalManager.manage_heater(); - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - #if N_ARC_CORRECTION > 1 - if (--arc_recalc_count) { - // Apply vector rotation matrix to previous r_P / 1 - const float r_new_Y = r_P * sin_T + r_Q * cos_T; - r_P = r_P * cos_T - r_Q * sin_T; - r_Q = r_new_Y; - } - else - #endif - { - #if N_ARC_CORRECTION > 1 - arc_recalc_count = N_ARC_CORRECTION; - #endif - - // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments. - // Compute exact location by applying transformation matrix from initial radius vector(=-offset). - // To reduce stuttering, the sin and cos could be computed at different times. - // For now, compute both at the same time. - const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); - r_P = -offset[0] * cos_Ti + offset[1] * sin_Ti; - r_Q = -offset[0] * sin_Ti - offset[1] * cos_Ti; - } - - // Update raw location - raw[p_axis] = center_P + r_P; - raw[q_axis] = center_Q + r_Q; - raw[l_axis] += linear_per_segment; - raw[E_AXIS] += extruder_per_segment; - - clamp_to_software_endstops(raw); - - #if HAS_FEEDRATE_SCALING - inverse_kinematics(raw); - ADJUST_DELTA(raw); - #endif - - #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. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder)) - break; - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) - break; - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; - planner.apply_leveling(pos); - if (!planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], raw[E_AXIS], fr_mm_s, active_extruder)) - break; - #else - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder)) - break; - #endif - } - - // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING - inverse_kinematics(cart); - ADJUST_DELTA(cart); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], cart[Z_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - planner.apply_leveling(pos); - planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], cart[E_AXIS], fr_mm_s, active_extruder); - #else - planner.buffer_line_kinematic(cart, fr_mm_s, active_extruder); - #endif - - COPY(current_position, cart); - } // plan_arc - -#endif // ARC_SUPPORT - -#if ENABLED(BEZIER_CURVE_SUPPORT) - - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]) { - cubic_b_spline(current_position, cart, offset, MMS_SCALED(feedrate_mm_s), active_extruder); - COPY(current_position, cart); - } - -#endif // BEZIER_CURVE_SUPPORT - -#if ENABLED(USE_CONTROLLER_FAN) - - void controllerFan() { - static millis_t lastMotorOn = 0, // Last time a motor was turned on - nextMotorCheck = 0; // Last time the state was checked - const millis_t ms = millis(); - if (ELAPSED(ms, nextMotorCheck)) { - nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.soft_pwm_amount_bed > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON - #endif - || E0_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 1 - || E1_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 2 - || E2_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 3 - || E3_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 4 - || E4_ENABLE_READ == E_ENABLE_ON - #endif - #endif - #endif - #endif - ) { - lastMotorOn = ms; //... set time to NOW so the fan will turn on - } - - // Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds - const uint8_t speed = (lastMotorOn && PENDING(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? CONTROLLERFAN_SPEED : 0; - controllerFanSpeed = speed; - - // allows digital or PWM fan output to be used (see M42 handling) - WRITE(CONTROLLER_FAN_PIN, speed); - analogWrite(CONTROLLER_FAN_PIN, speed); - } - } - -#endif // USE_CONTROLLER_FAN - -#if ENABLED(MORGAN_SCARA) - - /** - * Morgan SCARA Forward Kinematics. Results in cartes[]. - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ - void forward_kinematics_SCARA(const float &a, const float &b) { - - float a_sin = sin(RADIANS(a)) * L1, - a_cos = cos(RADIANS(a)) * L1, - b_sin = sin(RADIANS(b)) * L2, - b_cos = cos(RADIANS(b)) * L2; - - cartes[X_AXIS] = a_cos + b_cos + SCARA_OFFSET_X; //theta - cartes[Y_AXIS] = a_sin + b_sin + SCARA_OFFSET_Y; //theta+phi - - /* - SERIAL_ECHOPAIR("SCARA FK Angle a=", a); - SERIAL_ECHOPAIR(" b=", b); - SERIAL_ECHOPAIR(" a_sin=", a_sin); - SERIAL_ECHOPAIR(" a_cos=", a_cos); - SERIAL_ECHOPAIR(" b_sin=", b_sin); - SERIAL_ECHOLNPAIR(" b_cos=", b_cos); - SERIAL_ECHOPAIR(" cartes[X_AXIS]=", cartes[X_AXIS]); - SERIAL_ECHOLNPAIR(" cartes[Y_AXIS]=", cartes[Y_AXIS]); - //*/ - } - - /** - * Morgan SCARA Inverse Kinematics. Results in delta[]. - * - * See http://forums.reprap.org/read.php?185,283327 - * - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ - void inverse_kinematics(const float raw[XYZ]) { - - static float C2, S2, SK1, SK2, THETA, PSI; - - float sx = raw[X_AXIS] - SCARA_OFFSET_X, // Translate SCARA to standard X Y - sy = raw[Y_AXIS] - SCARA_OFFSET_Y; // With scaling factor. - - if (L1 == L2) - C2 = HYPOT2(sx, sy) / L1_2_2 - 1; - else - C2 = (HYPOT2(sx, sy) - (L1_2 + L2_2)) / (2.0 * L1 * L2); - - S2 = SQRT(1 - sq(C2)); - - // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End - SK1 = L1 + L2 * C2; - - // Rotated Arm2 gives the distance from Arm1 to Arm2 - SK2 = L2 * S2; - - // Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow - THETA = ATAN2(SK1, SK2) - ATAN2(sx, sy); - - // Angle of Arm2 - PSI = ATAN2(S2, C2); - - delta[A_AXIS] = DEGREES(THETA); // theta is support arm angle - delta[B_AXIS] = DEGREES(THETA + PSI); // equal to sub arm angle (inverted motor) - delta[C_AXIS] = raw[Z_AXIS]; - - /* - DEBUG_POS("SCARA IK", raw); - DEBUG_POS("SCARA IK", delta); - SERIAL_ECHOPAIR(" SCARA (x,y) ", sx); - SERIAL_ECHOPAIR(",", sy); - SERIAL_ECHOPAIR(" C2=", C2); - SERIAL_ECHOPAIR(" S2=", S2); - SERIAL_ECHOPAIR(" Theta=", THETA); - SERIAL_ECHOLNPAIR(" Phi=", PHI); - //*/ - } - -#endif // MORGAN_SCARA - -#if ENABLED(TEMP_STAT_LEDS) - - static bool red_led = false; - static millis_t next_status_led_update_ms = 0; - - void handle_status_leds(void) { - if (ELAPSED(millis(), next_status_led_update_ms)) { - next_status_led_update_ms += 500; // Update every 0.5s - float max_temp = 0.0; - #if HAS_HEATED_BED - max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed()); - #endif - HOTEND_LOOP() - max_temp = MAX3(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e)); - const bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led; - if (new_led != red_led) { - red_led = new_led; - #if PIN_EXISTS(STAT_LED_RED) - WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW); - #if PIN_EXISTS(STAT_LED_BLUE) - WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH); - #endif - #else - WRITE(STAT_LED_BLUE_PIN, new_led ? HIGH : LOW); - #endif - } - } - } - -#endif - -void enable_all_steppers() { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - enable_X(); - enable_Y(); - enable_Z(); - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); -} - -void disable_e_stepper(const uint8_t e) { - switch (e) { - case 0: disable_E0(); break; - case 1: disable_E1(); break; - case 2: disable_E2(); break; - case 3: disable_E3(); break; - case 4: disable_E4(); break; - } -} - -void disable_e_steppers() { - disable_E0(); - disable_E1(); - disable_E2(); - disable_E3(); - disable_E4(); -} - -void disable_all_steppers() { - disable_X(); - disable_Y(); - disable_Z(); - disable_e_steppers(); -} - -/** - * Manage several activities: - * - Check for Filament Runout - * - Keep the command buffer full - * - Check for maximum inactive time between commands - * - Check for maximum inactive time between stepper commands - * - Check if pin CHDK needs to go LOW - * - Check for KILL button held down - * - Check for HOME button held down - * - Check if cooling fan needs to be switched on - * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) - */ -void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.run(); - #endif - - if (commands_in_queue < BUFSIZE) get_available_commands(); - - const millis_t ms = millis(); - - if (max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time)) { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); - kill(PSTR(MSG_KILLED)); - } - - // Prevent steppers timing-out in the middle of M600 - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #define MOVE_AWAY_TEST !did_pause_print - #else - #define MOVE_AWAY_TEST true - #endif - - if (stepper_inactive_time) { - if (planner.has_blocks_queued()) - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered - else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, previous_move_ms + stepper_inactive_time)) { - #if ENABLED(DISABLE_INACTIVE_X) - disable_X(); - #endif - #if ENABLED(DISABLE_INACTIVE_Y) - disable_Y(); - #endif - #if ENABLED(DISABLE_INACTIVE_Z) - disable_Z(); - #endif - #if ENABLED(DISABLE_INACTIVE_E) - disable_e_steppers(); - #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; - #endif - } - } - - #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH - if (chdkActive && ELAPSED(ms, chdkHigh + CHDK_DELAY)) { - chdkActive = false; - WRITE(CHDK, LOW); - } - #endif - - #if HAS_KILL - - // Check if the kill button was pressed and wait just in case it was an accidental - // key kill key press - // ------------------------------------------------------------------------------- - static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; - if (!READ(KILL_PIN)) - killCount++; - else if (killCount > 0) - killCount--; - - // Exceeded threshold and we can confirm that it was not accidental - // KILL the machine - // ---------------------------------------------------------------- - if (killCount >= KILL_DELAY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_KILL_BUTTON); - kill(PSTR(MSG_KILLED)); - } - #endif - - #if HAS_HOME - // Check to see if we have to home, use poor man's debouncer - // --------------------------------------------------------- - static int homeDebounceCount = 0; // poor man's debouncing count - const int HOME_DEBOUNCE_DELAY = 2500; - if (!IS_SD_PRINTING && !READ(HOME_PIN)) { - if (!homeDebounceCount) { - enqueue_and_echo_commands_P(PSTR("G28")); - LCD_MESSAGEPGM(MSG_AUTO_HOME); - } - if (homeDebounceCount < HOME_DEBOUNCE_DELAY) - homeDebounceCount++; - else - homeDebounceCount = 0; - } - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - controllerFan(); // Check if fan should be turned on to cool stepper drivers down - #endif - - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.check(); - #endif - - #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP - && ELAPSED(ms, previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && !planner.has_blocks_queued() - ) { - #if ENABLED(SWITCHING_EXTRUDER) - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 1: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 2: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #if E_STEPPERS > 3 - case 3: oldstatus = E3_ENABLE_READ; enable_E3(); break; - #if E_STEPPERS > 4 - case 4: oldstatus = E4_ENABLE_READ; enable_E4(); break; - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #endif // !SWITCHING_EXTRUDER - - const float olde = current_position[E_AXIS]; - current_position[E_AXIS] += EXTRUDER_RUNOUT_EXTRUDE; - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder); - current_position[E_AXIS] = olde; - planner.set_e_position_mm(olde); - planner.synchronize(); - - #if ENABLED(SWITCHING_EXTRUDER) - switch (active_extruder) { - default: oldstatus = E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - switch (active_extruder) { - case 0: E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 1: E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 2: E2_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 3 - case 3: E3_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 4 - case 4: E4_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #endif // !SWITCHING_EXTRUDER - - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered - } - #endif // EXTRUDER_RUNOUT_PREVENT - - #if ENABLED(DUAL_X_CARRIAGE) - // handle delayed move timeout - if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) { - // travel moves have been received so enact them - delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - set_destination_from_current(); - prepare_move_to_destination(); - } - #endif - - #if ENABLED(TEMP_STAT_LEDS) - handle_status_leds(); - #endif - - #if ENABLED(MONITOR_DRIVER_STATUS) - monitor_tmc_driver(); - #endif - - planner.check_axes_activity(); -} - -/** - * Standard idle routine keeps the machine alive - */ -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - bool no_stepper_sleep/*=false*/ - #endif -) { - #if ENABLED(MAX7219_DEBUG) - max7219.idle_tasks(); - #endif - - lcd_update(); - - host_keepalive(); - - manage_inactivity( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - no_stepper_sleep - #endif - ); - - thermalManager.manage_heater(); - - #if ENABLED(PRINTCOUNTER) - print_job_timer.tick(); - #endif - - #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - buzzer.tick(); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - static millis_t i2cpem_next_update_ms; - if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { - I2CPEM.update(); - i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS; - } - #endif - - #if HAS_AUTO_REPORTING - if (!suspend_auto_report) { - #if ENABLED(AUTO_REPORT_TEMPERATURES) - thermalManager.auto_report_temperatures(); - #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); - #endif - } - #endif -} - -/** - * Kill all activity and lock the machine. - * After this the machine will need to be reset. - */ -void kill(const char* lcd_msg) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - - thermalManager.disable_all_heaters(); - disable_all_steppers(); - - #if ENABLED(ULTRA_LCD) - kill_screen(lcd_msg); - #else - UNUSED(lcd_msg); - #endif - - _delay_ms(600); // Wait a short time (allows messages to get out before shutting down. - cli(); // Stop interrupts - - _delay_ms(250); //Wait to ensure all interrupts routines stopped - thermalManager.disable_all_heaters(); //turn off heaters again - - #ifdef ACTION_ON_KILL - SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL); - #endif - - #if HAS_POWER_SWITCH - PSU_OFF(); - #endif - - suicide(); - while (1) { - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - } // Wait for reset -} - -/** - * Turn off heaters and stop the print in progress - * After a stop the machine may be resumed with M999 - */ -void stop() { - thermalManager.disable_all_heaters(); // 'unpause' taken care of in here - - #if ENABLED(PROBING_FANS_OFF) - if (fans_paused) fans_pause(false); // put things back the way they were - #endif - - if (IsRunning()) { - Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - safe_delay(350); // allow enough time for messages to get out before stopping - Running = false; - } -} - -/** - * Marlin entry-point: Set up before the program loop - * - Set up the kill pin, filament runout, power hold - * - Start the serial port - * - Print startup messages and diagnostics - * - Get EEPROM or default settings - * - Initialize managers for: - * • temperature - * • planner - * • watchdog - * • stepper - * • photo pin - * • servos - * • LCD controller - * • Digipot I2C - * • Z probe sled - * • status LEDs - */ -void setup() { - - #if ENABLED(MAX7219_DEBUG) - max7219.init(); - #endif - - #if ENABLED(DISABLE_JTAG) - // Disable JTAG on AT90USB chips to free up pins for IO - MCUCR = 0x80; - MCUCR = 0x80; - #endif - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.setup(); - #endif - - setup_killpin(); - - setup_powerhold(); - - #if HAS_STEPPER_RESET - disableStepperDrivers(); - #endif - - MYSERIAL0.begin(BAUDRATE); - SERIAL_PROTOCOLLNPGM("start"); - SERIAL_ECHO_START(); - - // Prepare communication for TMC drivers - #if HAS_DRIVER(TMC2130) - tmc_init_cs_pins(); - #endif - #if HAS_DRIVER(TMC2208) - tmc2208_serial_begin(); - #endif - - // Check startup - does nothing if bootloader sets MCUSR to 0 - byte mcu = MCUSR; - if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); - if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); - if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); - if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); - if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); - MCUSR = 0; - - SERIAL_ECHOPGM(MSG_MARLIN); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION); - 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_START(); - SERIAL_ECHOLNPGM("Compiled: " __DATE__); - #endif - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_FREE_MEMORY, freeMemory()); - SERIAL_ECHOLNPAIR(MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t)*BLOCK_BUFFER_SIZE); - - // Send "ok" after commands by default - for (int8_t i = 0; i < BUFSIZE; i++) send_ok[i] = true; - - // Load data from EEPROM if available (or use defaults) - // This also updates variables in the planner, elsewhere - (void)settings.load(); - - #if HAS_M206_COMMAND - // Initialize current position based on home_offset - COPY(current_position, home_offset); - #else - ZERO(current_position); - #endif - - // Vital to init stepper/planner equivalent for current_position - SYNC_PLAN_POSITION_KINEMATIC(); - - thermalManager.init(); // Initialize temperature loop - - print_job_timer.init(); // Initial setup of print job timer - - endstops.init(); // Init endstops and pullups - - stepper.init(); // Init stepper. This enables interrupts! - - servo_init(); // Initialize all servos, stow servo probe - - #if HAS_PHOTOGRAPH - OUT_WRITE(PHOTOGRAPH_PIN, LOW); - #endif - - #if HAS_CASE_LIGHT - case_light_on = CASE_LIGHT_DEFAULT_ON; - case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; - update_case_light(); - #endif - - #if ENABLED(SPINDLE_LASER_ENABLE) - OUT_WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // init spindle to off - #if SPINDLE_DIR_CHANGE - OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // init rotation to clockwise (M3) - #endif - #if ENABLED(SPINDLE_LASER_PWM) - SET_OUTPUT(SPINDLE_LASER_PWM_PIN); - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // set to lowest speed - #endif - #endif - - #if HAS_BED_PROBE - endstops.enable_z_probe(false); - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - SET_OUTPUT(CONTROLLER_FAN_PIN); //Set pin used for driver cooling fan - #endif - - #if HAS_STEPPER_RESET - enableStepperDrivers(); - #endif - - #if ENABLED(DIGIPOT_I2C) - digipot_i2c_init(); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - dac_init(); - #endif - - #if (ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) && HAS_SOLENOID_1 - OUT_WRITE(SOL1_PIN, LOW); // turn it off - #endif - - #if HAS_HOME - SET_INPUT_PULLUP(HOME_PIN); - #endif - - #if PIN_EXISTS(STAT_LED_RED) - OUT_WRITE(STAT_LED_RED_PIN, LOW); // turn it off - #endif - - #if PIN_EXISTS(STAT_LED_BLUE) - OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off - #endif - - #if HAS_COLOR_LEDS - leds.setup(); - #endif - - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - SET_OUTPUT(RGB_LED_R_PIN); - SET_OUTPUT(RGB_LED_G_PIN); - SET_OUTPUT(RGB_LED_B_PIN); - #if ENABLED(RGBW_LED) - SET_OUTPUT(RGB_LED_W_PIN); - #endif - #endif - - #if ENABLED(MK2_MULTIPLEXER) - SET_OUTPUT(E_MUX0_PIN); - SET_OUTPUT(E_MUX1_PIN); - SET_OUTPUT(E_MUX2_PIN); - #endif - - #if HAS_FANMUX - fanmux_init(); - #endif - - lcd_init(); - lcd_reset_status(); - - #if ENABLED(SHOW_BOOTSCREEN) - lcd_bootscreen(); - #endif - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. - for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (t == i) ? 1.0 : 0.0; - - // Remaining virtual tools are 100% filament 1 - #if MIXING_STEPPERS < MIXING_VIRTUAL_TOOLS - for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (i == 0) ? 1.0 : 0.0; - #endif - - // Initialize mixing to tool 0 color - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_factor[i] = mixing_virtual_tool_mix[0][i]; - #endif - - #if ENABLED(BLTOUCH) - // Make sure any BLTouch error condition is cleared - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.init(); - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - i2c.onReceive(i2c_on_receive); - i2c.onRequest(i2c_on_request); - #endif - - #if DO_SWITCH_EXTRUDER - move_extruder_servo(0); // Initialize extruder servo - #endif - - #if ENABLED(SWITCHING_NOZZLE) - move_nozzle_servo(0); // Initialize nozzle servo - #endif - - #if ENABLED(PARKING_EXTRUDER) - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(0); - pe_activate_magnet(1); - #else - pe_deactivate_magnet(0); - pe_deactivate_magnet(1); - #endif - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - check_print_job_recovery(); - #endif - - #if ENABLED(USE_WATCHDOG) - watchdog_init(); - #endif -#if POWER_LOSS_RECOVER_SUPER_CAP - ///////////// - pinMode(POWER_LOSS_DETECT_PIN, INPUT); - - if(recovery_detect_cap.recovery==3) - { - char tmp_d[96]; - lcd_recover_menu() ; - SERIAL_ECHOLN("resume 3"); - sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),recovery_detect_cap.Z_t,recovery_detect_cap.E_t,recovery_detect_cap.pos_t,recovery_detect_cap.T0_t,recovery_detect_cap.B_t); - SERIAL_ECHOLN(tmp_d); - sprintf_P(tmp_d,PSTR("%s,"),recovery_detect_cap.file_name); - SERIAL_ECHOLN(tmp_d); - - } - else - SERIAL_ECHOLN("resume 0"); - - -#endif -} - -/** - * The main Marlin program loop - * - * - Abort SD printing if flagged - * - Save or log commands to SD - * - Process available commands (if not saving) - * - Call heater manager - * - Call inactivity manager - * - Call endstop manager - * - Call LCD update - */ -void loop() { - - #if ENABLED(SDSUPPORT) - - card.checkautostart(); - - #if ENABLED(ULTIPANEL) - if (abort_sd_printing) { - abort_sd_printing = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - clear_command_queue(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - } - #endif - - #endif // SDSUPPORT - - if (commands_in_queue < BUFSIZE) get_available_commands(); - - if (commands_in_queue) { - - #if ENABLED(SDSUPPORT) - - if (card.saving) { - char* command = command_queue[cmd_queue_index_r]; - if (strstr_P(command, PSTR("M29"))) { - // M29 closes the file - card.closefile(); - SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); - - #if USE_MARLINSERIAL - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOLNPAIR("Dropped bytes: ", customizedSerial.dropped()); - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOLNPAIR("Max RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif - #endif - - ok_to_send(); - } - else { - // Write the string from the read buffer to SD - card.write_command(command); - if (card.logging) - process_next_command(); // The card is saving because it's logging - else - ok_to_send(); - } - } - else { - process_next_command(); - #if ENABLED(POWER_LOSS_RECOVERY) - if (card.cardOK && card.sdprinting) save_job_recovery_info(); - #endif - } - - #else - - process_next_command(); - - #endif // SDSUPPORT - - // The queue may be reset by a command handler or by code invoked by idle() within a handler - if (commands_in_queue) { - --commands_in_queue; - if (++cmd_queue_index_r >= BUFSIZE) cmd_queue_index_r = 0; - } - } -#if POWER_LOSS_RECOVER_SUPER_CAP - if((commands_in_queue==0)&&(recovery_detect_cap.recovery==1)) - { - ////////////////// - char dat_tmp[96]; - sprintf_P(dat_tmp,PSTR("M190 S%u"),recovery_detect_cap.B_t); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("M109 T0 S%u"),recovery_detect_cap.T0_t); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("G28 X")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("G28 Y")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - - sprintf_P(dat_tmp,PSTR("M106 S200")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - - SBI(axis_homed, Z_AXIS); - SBI(axis_known_position, Z_AXIS); - recovery_detect_cap.recovery=2; - } - if((commands_in_queue==0)&&(recovery_detect_cap.recovery==2)) - { - char dat_tmp[96]; - sprintf(dat_tmp,"M32 S%lu !%s",recovery_detect_cap.pos_t,recovery_detect_cap.file_name); - SERIAL_ECHOLN(dat_tmp); - - - //memset(print_dir,0,sizeof(print_dir)); - recovery_detect_cap.recovery=0; - settings.power_lose_save(); - enqueue_and_echo_command(dat_tmp); - SERIAL_ECHOLN(dat_tmp); - - } - - #endif - endstops.event_handler(); - idle(); -} diff --git a/Marlin/Max7219_Debug_LEDs.cpp b/Marlin/Max7219_Debug_LEDs.cpp deleted file mode 100644 index 2be4bfd4f1..0000000000 --- a/Marlin/Max7219_Debug_LEDs.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * send() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - */ - -#include "MarlinConfig.h" - -#if ENABLED(MAX7219_DEBUG) - -#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory - -#include "Max7219_Debug_LEDs.h" - -#include "planner.h" -#include "stepper.h" -#include "Marlin.h" -#include "delay.h" - -Max7219 max7219; - -uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; - -#define LINE_REG(Q) (max7219_reg_digit0 + ((Q) & 0x7)) -#if _ROT == 0 || _ROT == 270 - #define _LED_BIT(Q) (7 - ((Q) & 0x7)) - #define _LED_UNIT(Q) ((Q) & ~0x7) -#else - #define _LED_BIT(Q) ((Q) & 0x7) - #define _LED_UNIT(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) -#endif -#if _ROT < 180 - #define _LED_IND(P,Q) (_LED_UNIT(P) + (Q)) -#else - #define _LED_IND(P,Q) (_LED_UNIT(P) + (7 - ((Q) & 0x7))) -#endif -#if _ROT == 0 || _ROT == 180 - #define LED_IND(X,Y) _LED_IND(X,Y) - #define LED_BIT(X,Y) _LED_BIT(X) -#elif _ROT == 90 || _ROT == 270 - #define LED_IND(X,Y) _LED_IND(Y,X) - #define LED_BIT(X,Y) _LED_BIT(Y) -#endif -#define XOR_7219(X,Y) do{ led_line[LED_IND(X,Y)] ^= _BV(LED_BIT(X,Y)); }while(0) -#define SET_7219(X,Y) do{ led_line[LED_IND(X,Y)] |= _BV(LED_BIT(X,Y)); }while(0) -#define CLR_7219(X,Y) do{ led_line[LED_IND(X,Y)] &= ~_BV(LED_BIT(X,Y)); }while(0) -#define BIT_7219(X,Y) TEST(led_line[LED_IND(X,Y)], LED_BIT(X,Y)) - -#ifdef CPU_32_BIT - #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM - #undef CRITICAL_SECTION_START - #undef CRITICAL_SECTION_END - #define CRITICAL_SECTION_START NOOP - #define CRITICAL_SECTION_END NOOP -#else - #define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR) -#endif - -void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) { - #if ENABLED(MAX7219_ERRORS) - SERIAL_ECHOPGM("??? Max7219::"); - serialprintPGM(func); - SERIAL_CHAR('('); - SERIAL_ECHO(v1); - if (v2 > 0) SERIAL_ECHOPAIR(", ", v2); - SERIAL_CHAR(')'); - SERIAL_EOL(); - #else - UNUSED(func); UNUSED(v1); UNUSED(v2); - #endif -} - -/** - * Flip the lowest n_bytes of the supplied bits: - * flipped(x, 1) flips the low 8 bits of x. - * flipped(x, 2) flips the low 16 bits of x. - * flipped(x, 3) flips the low 24 bits of x. - * flipped(x, 4) flips the low 32 bits of x. - */ -inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { - uint32_t mask = 1, outbits = 0; - for (uint8_t b = 0; b < n_bytes * 8; b++) { - outbits <<= 1; - if (bits & mask) outbits |= 1; - mask <<= 1; - } - return outbits; -} - -void Max7219::noop() { - CRITICAL_SECTION_START; - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, LOW); - for (uint8_t i = 16; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); - SIG_DELAY(); - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); - SIG_DELAY(); - } - CRITICAL_SECTION_END; -} - -void Max7219::putbyte(uint8_t data) { - CRITICAL_SECTION_START; - for (uint8_t i = 8; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); // tick - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); // tock - SIG_DELAY(); - data <<= 1; - } - CRITICAL_SECTION_END; -} - -void Max7219::pulse_load() { - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, HIGH); - SIG_DELAY(); -} - -void Max7219::send(const uint8_t reg, const uint8_t data) { - SIG_DELAY(); - CRITICAL_SECTION_START; - SIG_DELAY(); - putbyte(reg); // specify register - SIG_DELAY(); - putbyte(data); // put data - CRITICAL_SECTION_END; -} - -// Send out a single native row of bits to all units -void Max7219::refresh_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - send(LINE_REG(line), led_line[(u << 3) | (line & 0x7)]); - pulse_load(); -} - -// Send out a single native row of bits to just one unit -void Max7219::refresh_unit_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - if (u == (line >> 3)) send(LINE_REG(line), led_line[line]); else noop(); - pulse_load(); -} - -void Max7219::set(const uint8_t line, const uint8_t bits) { - led_line[line] = bits; - refresh_line(line); -} - -#if ENABLED(MAX7219_NUMERIC) - - // Draw an integer with optional leading zeros and optional decimal point - void Max7219::print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false) { - constexpr uint8_t led_numeral[10] = { 0x7E, 0x60, 0x6D, 0x79, 0x63, 0x5B, 0x5F, 0x70, 0x7F, 0x7A }, - led_decimal = 0x80, led_minus = 0x01; - - bool blank = false, neg = value < 0; - if (neg) value *= -1; - while (size--) { - const bool minus = neg && blank; - if (minus) neg = false; - send( - max7219_reg_digit0 + start + size, - minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) - ); - pulse_load(); // tell the chips to load the clocked out data - value /= 10; - if (!value && !leadzero) blank = true; - dec = false; - } - } - - // Draw a float with a decimal point and optional digits - void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) { - if (pre_size) print(start, value, pre_size, leadzero, !!post_size); - if (post_size) { - const int16_t after = ABS(value) * (10 ^ post_size); - print(start + pre_size, after, post_size, true); - } - } - -#endif // MAX7219_NUMERIC - -// Modify a single LED bit and send the changed line -void Max7219::led_set(const uint8_t x, const uint8_t y, const bool on) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_set"), x, y); - if (BIT_7219(x, y) == on) return; - XOR_7219(x, y); - refresh_line(LED_IND(x, y)); -} - -void Max7219::led_on(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_on"), x, y); - led_set(x, y, true); -} - -void Max7219::led_off(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_off"), x, y); - led_set(x, y, false); -} - -void Max7219::led_toggle(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_toggle"), x, y); - led_set(x, y, !BIT_7219(x, y)); -} - -void Max7219::send_row(const uint8_t row) { - #if _ROT == 0 || _ROT == 180 - refresh_line(LED_IND(0, row)); - #else - UNUSED(row); - refresh(); - #endif -} - -void Max7219::send_column(const uint8_t col) { - #if _ROT == 90 || _ROT == 270 - refresh_line(LED_IND(col, 0)); - #else - UNUSED(col); - refresh(); - #endif -} - -void Max7219::clear() { - ZERO(led_line); - refresh(); -} - -void Max7219::fill() { - memset(led_line, 0xFF, sizeof(led_line)); - refresh(); -} - -void Max7219::clear_row(const uint8_t row) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("clear_row"), row); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) CLR_7219(x, row); - send_row(row); -} - -void Max7219::clear_column(const uint8_t col) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) CLR_7219(col, y); - send_column(col); -} - -/** - * Plot the low order bits of val to the specified row of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_row(const uint8_t row, const uint32_t val) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("set_row"), row); - uint32_t mask = _BV32(MAX7219_X_LEDS - 1); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) { - if (val & mask) SET_7219(x, row); else CLR_7219(x, row); - mask >>= 1; - } - send_row(row); -} - -/** - * Plot the low order bits of val to the specified column of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_column(const uint8_t col, const uint32_t val) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - uint32_t mask = _BV32(MAX7219_Y_LEDS - 1); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) { - if (val & mask) SET_7219(col, y); else CLR_7219(col, y); - mask >>= 1; - } - send_column(col); -} - -void Max7219::set_rows_16bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_16bits"), y, val); - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #else // at least 16 bits on each row - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_16bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 4) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 3, val); val >>= 8; - set_row(y + 2, val); val >>= 8; - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #elif MAX7219_X_LEDS == 16 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 1, val); val >>= 16; - set_row(y + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_32bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_columns_16bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_columns_16bits"), x, val); - set_column(x + 0, val); val >>= 8; - set_column(x + 1, val); - #else // at least 16 bits in each column - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_columns_16bits"), x, val); - set_column(x, val); - #endif -} - -void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 4) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 3, val); val >>= 8; - set_column(x + 2, val); val >>= 8; - set_column(x + 1, val); val >>= 8; - set_column(x + 0, val); - #elif MAX7219_Y_LEDS == 16 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 1, val); val >>= 16; - set_column(x + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_rows_32bits"), x, val); - set_column(x, val); - #endif -} - -// Initialize the Max7219 -void Max7219::register_setup() { - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_scanLimit, 0x07); - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_shutdown, 0x01); // not in shutdown mode - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_displayTest, 0x00); // no display test - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set - // range: 0x00 to 0x0F - pulse_load(); // tell the chips to load the clocked out data -} - -#ifdef MAX7219_INIT_TEST -#if MAX7219_INIT_TEST == 2 - - void Max7219::spiral(const bool on, const uint16_t del) { - constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; - int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { - led_set(px, py, on); - delay(del); - const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, MAX7219_X_LEDS-1) || !WITHIN(y, 0, MAX7219_Y_LEDS-1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; - px += way[dir]; py += way[dir + 1]; - } - } - -#else - - void Max7219::sweep(const int8_t dir, const uint16_t ms, const bool on) { - uint8_t x = dir > 0 ? 0 : MAX7219_X_LEDS-1; - for (uint8_t i = MAX7219_X_LEDS; i--; x += dir) { - set_column(x, on ? 0xFFFFFFFF : 0x00000000); - delay(ms); - } - } - -#endif -#endif // MAX7219_INIT_TEST - -void Max7219::init() { - SET_OUTPUT(MAX7219_DIN_PIN); - SET_OUTPUT(MAX7219_CLK_PIN); - OUT_WRITE(MAX7219_LOAD_PIN, HIGH); - delay(1); - - register_setup(); - - for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off - led_line[i] = 0x00; - send(max7219_reg_digit0 + i, 0); - pulse_load(); // tell the chips to load the clocked out data - } - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - spiral(true, 8); - delay(150); - spiral(false, 8); - #else - // Do an aesthetically-pleasing pattern to fully test the Max7219 module and LEDs. - // Light up and turn off columns, both forward and backward. - sweep(1, 20, true); - sweep(1, 20, false); - delay(150); - sweep(-1, 20, true); - sweep(-1, 20, false); - #endif - #endif -} - -/** - * This code demonstrates some simple debugging using a single 8x8 LED Matrix. If your feature could - * benefit from matrix display, add its code here. Very little processing is required, so the 7219 is - * ideal for debugging when realtime feedback is important but serial output can't be used. - */ - -// Apply changes to update a marker -void Max7219::mark16(const uint8_t y, const uint8_t v1, const uint8_t v2) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_off(v1 & 0x7, y + (v1 >= 8)); - led_on(v2 & 0x7, y + (v2 >= 8)); - #else - led_off(y, v1 & 0xF); // At least 16 LEDs down. Use a single column. - led_on(y, v2 & 0xF); - #endif - #else - led_off(v1 & 0xF, y); // At least 16 LEDs across. Use a single row. - led_on(v2 & 0xF, y); - #endif -} - -// Apply changes to update a tail-to-head range -void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0x7, y + (n >= 8)); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0x7, y + (n >= 8)); - #else // The Max7219 Y-Axis has at least 16 LED's. So use a single column - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(y, n & 0xF); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(y, n & 0xF); - #endif - #else // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0xF, y); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0xF, y); - #endif -} - -// Apply changes to update a quantity -void Max7219::quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) { - for (uint8_t i = MIN(nv, ov); i < MAX(nv, ov); i++) - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_set(i >> 1, y + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's - #else - led_set(y, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column - #endif - #else - led_set(i, y, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - #endif -} - -void Max7219::idle_tasks() { - #define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #if MAX7219_USE_HEAD || MAX7219_USE_TAIL - CRITICAL_SECTION_START; - #if MAX7219_USE_HEAD - const uint8_t head = planner.block_buffer_head; - #endif - #if MAX7219_USE_TAIL - const uint8_t tail = planner.block_buffer_tail; - #endif - CRITICAL_SECTION_END; - #endif - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - static uint8_t refresh_cnt; // = 0 - constexpr uint16_t refresh_limit = 5; - static millis_t next_blink = 0; - const millis_t ms = millis(); - const bool do_blink = ELAPSED(ms, next_blink); - #else - static uint16_t refresh_cnt; // = 0 - constexpr bool do_blink = true; - constexpr uint16_t refresh_limit = 50000; - #endif - - // Some Max7219 units are vulnerable to electrical noise, especially - // with long wires next to high current wires. If the display becomes - // corrupted, this will fix it within a couple seconds. - if (do_blink && ++refresh_cnt >= refresh_limit) { - refresh_cnt = 0; - register_setup(); - } - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - if (do_blink) { - led_toggle(MAX7219_X_LEDS - 1, MAX7219_Y_LEDS - 1); - next_blink = ms + 1000; - } - #endif - - #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL - - static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; - - if (last_head_cnt != head || last_tail_cnt != tail) { - range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head); - last_head_cnt = head; - last_tail_cnt = tail; - } - - #else - - #ifdef MAX7219_DEBUG_PLANNER_HEAD - static int16_t last_head_cnt = 0x1; - if (last_head_cnt != head) { - mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head); - last_head_cnt = head; - } - #endif - - #ifdef MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_tail_cnt = 0x1; - if (last_tail_cnt != tail) { - mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail); - last_tail_cnt = tail; - } - #endif - - #endif - - #ifdef MAX7219_DEBUG_PLANNER_QUEUE - static int16_t last_depth = 0; - const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF; - if (current_depth != last_depth) { - quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth); - last_depth = current_depth; - } - #endif -} - -#endif // MAX7219_DEBUG diff --git a/Marlin/Max7219_Debug_LEDs.h b/Marlin/Max7219_Debug_LEDs.h deleted file mode 100644 index 3523eef40f..0000000000 --- a/Marlin/Max7219_Debug_LEDs.h +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * max7219.init() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - * - * If you are using the Max7219 matrix for firmware debug purposes in time sensitive - * areas of the code, please be aware that the orientation (rotation) of the display can - * affect the speed. The Max7219 can update a single column fairly fast. It is much - * faster to do a Max7219_Set_Column() with a rotation of 90 or 270 degrees than to do - * a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees. - */ -#pragma once - -#ifndef MAX7219_ROTATE - #define MAX7219_ROTATE 0 -#endif -#define _ROT ((MAX7219_ROTATE + 360) % 360) - -#define MAX7219_LINES (8 * (MAX7219_NUMBER_UNITS)) - -#if _ROT == 0 || _ROT == 180 - #define MAX7219_Y_LEDS 8 - #define MAX7219_X_LEDS MAX7219_LINES -#elif _ROT == 90 || _ROT == 270 - #define MAX7219_X_LEDS 8 - #define MAX7219_Y_LEDS MAX7219_LINES -#else - #error "MAX7219_ROTATE must be a multiple of +/- 90°." -#endif - -// -// MAX7219 registers -// -#define max7219_reg_noop 0x00 -#define max7219_reg_digit0 0x01 -#define max7219_reg_digit1 0x02 -#define max7219_reg_digit2 0x03 -#define max7219_reg_digit3 0x04 -#define max7219_reg_digit4 0x05 -#define max7219_reg_digit5 0x06 -#define max7219_reg_digit6 0x07 -#define max7219_reg_digit7 0x08 - -#define max7219_reg_decodeMode 0x09 -#define max7219_reg_intensity 0x0A -#define max7219_reg_scanLimit 0x0B -#define max7219_reg_shutdown 0x0C -#define max7219_reg_displayTest 0x0F - -class Max7219 { -public: - static uint8_t led_line[MAX7219_LINES]; - - Max7219() { } - - static void init(); - static void register_setup(); - static void putbyte(uint8_t data); - static void pulse_load(); - - // Set a single register (e.g., a whole native row) - static void send(const uint8_t reg, const uint8_t data); - - // Refresh all units - inline static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } - - // Update a single native line on all units - static void refresh_line(const uint8_t line); - - // Update a single native line on just one unit - static void refresh_unit_line(const uint8_t line); - - // Set a single LED by XY coordinate - static void led_set(const uint8_t x, const uint8_t y, const bool on); - static void led_on(const uint8_t x, const uint8_t y); - static void led_off(const uint8_t x, const uint8_t y); - static void led_toggle(const uint8_t x, const uint8_t y); - - // Set all LEDs in a single column - static void set_column(const uint8_t col, const uint32_t val); - static void clear_column(const uint8_t col); - - // Set all LEDs in a single row - static void set_row(const uint8_t row, const uint32_t val); - static void clear_row(const uint8_t row); - - // 16 and 32 bit versions of Row and Column functions - // Multiple rows and columns will be used to display the value if - // the array of matrix LED's is too narrow to accomplish the goal - static void set_rows_16bits(const uint8_t y, uint32_t val); - static void set_rows_32bits(const uint8_t y, uint32_t val); - static void set_columns_16bits(const uint8_t x, uint32_t val); - static void set_columns_32bits(const uint8_t x, uint32_t val); - - // Quickly clear the whole matrix - static void clear(); - - // Quickly fill the whole matrix - static void fill(); - - // Apply custom code to update the matrix - static void idle_tasks(); - -private: - static void error(const char * const func, const int32_t v1, const int32_t v2=-1); - static void noop(); - static void set(const uint8_t line, const uint8_t bits); - static void send_row(const uint8_t row); - static void send_column(const uint8_t col); - static void mark16(const uint8_t y, const uint8_t v1, const uint8_t v2); - static void range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh); - static void quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv); - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - static void spiral(const bool on, const uint16_t del); - #else - static void sweep(const int8_t dir, const uint16_t ms, const bool on); - #endif - #endif -}; - -extern Max7219 max7219; diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h deleted file mode 100644 index 97416896b8..0000000000 --- a/Marlin/SanityCheck.h +++ /dev/null @@ -1,1654 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * SanityCheck.h - * - * Test configuration values for errors at compile-time. - */ - -#ifndef _SANITYCHECK_H_ -#define _SANITYCHECK_H_ - -/** - * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features. - */ -#if __cplusplus < 201103L - #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain." -#endif - -/** - * We try our best to include sanity checks for all changed configuration - * directives because users have a tendency to use outdated config files with - * the bleeding-edge source code, but sometimes this is not enough. This check - * forces a minimum config file revision. Otherwise Marlin will not build. - */ -#define HEXIFY(H) _CAT(0x,H) -#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION) - #error "You are using an old Configuration.h file, update it before building Marlin." -#endif - -#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION) - #error "You are using an old Configuration_adv.h file, update it before building Marlin." -#endif - -/** - * Warnings for old configurations - */ -#ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." -#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) - #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." -#elif WATCH_TEMP_PERIOD > 500 - #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." -#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) - #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." -#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) - #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." -#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE) - #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY." -#elif defined(X_HOME_RETRACT_MM) - #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration." -#elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." -#elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." -#elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." -#elif defined(SDSLOW) - #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." -#elif defined(SDEXTRASLOW) - #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." -#elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." -#elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." -#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) - #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." -#elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." -#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) - #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." -#elif defined(PID_PARAMS_PER_EXTRUDER) - #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." -#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) - #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." -#elif defined(SERVO_ENDSTOP_ANGLES) - #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." -#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) - #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." -#elif defined(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." -#elif defined(DEFAULT_XYJERK) - #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." -#elif defined(XY_TRAVEL_SPEED) - #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." -#elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." -#elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_FEATURE) - #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS) - #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_ADD) - #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_XY_FEEDRATE) - #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_FEEDRATE) - #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS) - #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_Z_ADD) - #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_XY_FEEDRATE) - #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_Z_FEEDRATE) - #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE) - #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) - #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) - #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) - #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." -#elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." -#elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." -#elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." -#elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." -#elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." -#elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." -#elif defined(ENDSTOPS_ONLY_FOR_HOMING) - #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." -#elif defined(HOMING_FEEDRATE) - #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." -#elif defined(MANUAL_HOME_POSITIONS) - #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." -#elif defined(PID_ADD_EXTRUSION_RATE) - #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." -#elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(MIN_Z_HEIGHT_FOR_HOMING) - #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." -#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) - #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) - #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(MANUAL_BED_LEVELING) - #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration." -#elif defined(MESH_HOME_SEARCH_Z) - #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif defined(MANUAL_PROBE_Z_RANGE) - #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif !defined(MIN_STEPS_PER_SEGMENT) - #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. -#elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." -#elif defined(PREVENT_DANGEROUS_EXTRUDE) - #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." -#elif defined(SCARA) - #error "SCARA is now MORGAN_SCARA. Please update your configuration." -#elif defined(ENABLE_AUTO_BED_LEVELING) - #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(AUTO_BED_LEVELING_FEATURE) - #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." -#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) - #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) - #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) - #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_G26_MESH_VALIDATION) - #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDIT_ENABLED) - #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDITING) - #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(BLTOUCH_HEATERS_OFF) - #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration." -#elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." -#elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." -#elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE) - #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_BL) - #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_RESET) - #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." -#elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) - #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." -#elif defined(min_software_endstops) || defined(max_software_endstops) - #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." -#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) - #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." -#elif defined(CONTROLLERFAN_PIN) - #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." -#elif defined(MIN_RETRACT) - #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." -#elif defined(ADVANCE) - #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." -#elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." -#elif defined(NEOPIXEL_RGBW_LED) - #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." -#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) - #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead." -#elif defined(UBL_MESH_INSET) - #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." -#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." -#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." -#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) - #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." -#elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) - #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." -#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) - #error "K1 is now PID_K1. Please update your configuration." -#elif defined(PROBE_DOUBLE_TOUCH) - #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." -#elif defined(ANET_KEYPAD_LCD) - #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." -#elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." -#elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) - #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." -#elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \ - || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \ - || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \ - || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \ - || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." -#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \ - || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." -#elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." -#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET) - #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h." -#elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." -#elif defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." -#elif defined(JUNCTION_ACCELERATION_FACTOR) - #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." -#elif defined(JUNCTION_ACCELERATION) - #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." -#elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." -#endif - -#define BOARD_MKS_13 -47 -#define BOARD_TRIGORILLA -343 -#if MB(MKS_13) - #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." -#elif MB(BOARD_TRIGORILLA) - #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration." -#endif - -/** - * Marlin release, version and default string - */ -#ifndef SHORT_BUILD_VERSION - #error "SHORT_BUILD_VERSION must be specified." -#elif !defined(DETAILED_BUILD_VERSION) - #error "BUILD_VERSION must be specified." -#elif !defined(STRING_DISTRIBUTION_DATE) - #error "STRING_DISTRIBUTION_DATE must be specified." -#elif !defined(PROTOCOL_VERSION) - #error "PROTOCOL_VERSION must be specified." -#elif !defined(MACHINE_NAME) - #error "MACHINE_NAME must be specified." -#elif !defined(SOURCE_CODE_URL) - #error "SOURCE_CODE_URL must be specified." -#elif !defined(DEFAULT_MACHINE_UUID) - #error "DEFAULT_MACHINE_UUID must be specified." -#elif !defined(WEBSITE_URL) - #error "WEBSITE_URL must be specified." -#endif - -/** - * Serial - */ -#if USE_MARLINSERIAL - #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 - #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." - #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) - #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." - #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) - #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." - #elif ENABLED(BLUETOOTH) - #error "BLUETOOTH is only supported with AT90USB." - #endif -#elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX) - #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." -#endif - -#if SERIAL_PORT > 7 - #error "Set SERIAL_PORT to the port on your board. Usually this is 0." -#endif - -/** - * Dual Stepper Drivers - */ -#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." -#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR) - #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." -#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR) - #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR) - #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." -#endif - -/** - * Validate that the bed size fits - */ -static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, - "Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE."); - -/** - * Granular software endstops (Marlin >= 1.1.7) - */ -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z." - #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X) && DISABLED(MIN_SOFTWARE_ENDSTOP_Y) - #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z." - #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X) && DISABLED(MAX_SOFTWARE_ENDSTOP_Y) - #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -/** - * Progress Bar - */ -#if ENABLED(LCD_PROGRESS_BAR) - #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY) - #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." - #elif DISABLED(ULTRA_LCD) - #error "LCD_PROGRESS_BAR requires a character LCD." - #elif ENABLED(DOGLCD) - #error "LCD_PROGRESS_BAR does not apply to graphical displays." - #elif ENABLED(FILAMENT_LCD_DISPLAY) - #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." - #endif -#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD) - #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD." -#endif - -/** - * Custom Boot and Status screens - */ -#if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) - #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE." -#endif - -/** - * SD File Sorting - */ -#if ENABLED(SDCARD_SORT_ALPHA) - #if SDSORT_LIMIT > 256 - #error "SDSORT_LIMIT must be 256 or smaller." - #elif SDSORT_LIMIT < 10 - #error "SDSORT_LIMIT should be greater than 9 to be useful." - #elif DISABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." - #elif ENABLED(SDSORT_CACHE_NAMES) - #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." - #endif - #endif - - #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #if SDSORT_CACHE_VFATS < 2 - #error "SDSORT_CACHE_VFATS must be 2 or greater!" - #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES - #undef SDSORT_CACHE_VFATS - #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES - #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!" - #endif - #endif -#endif - -/** - * I2C Position Encoders - */ -#if ENABLED(I2C_POSITION_ENCODERS) - #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY) - #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." - #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) - #error "I2CPE_ENCODER_CNT must be between 1 and 5." - #endif -#endif - -/** - * Babystepping - */ -#if ENABLED(BABYSTEPPING) - #if ENABLED(SCARA) - #error "BABYSTEPPING is not implemented for SCARA yet." - #elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY) - #error "BABYSTEPPING only implemented for Z axis on deltabots." - #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING) - #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" - #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE - #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(DOGLCD) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(BABYSTEP_ZPROBE_OFFSET) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." - #endif -#endif - -/** - * Filament Runout needs one or more pins and either SD Support or Auto print start detection - */ -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if !PIN_EXISTS(FIL_RUNOUT) - #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif NUM_RUNOUT_SENSORS > E_STEPPERS - #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." - #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." - #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); - #endif -#endif - -/** - * Advanced Pause - */ -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #if !HAS_RESUME_CONTINUE - #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER." - #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) - #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." - #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER) - #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." - #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." - #elif DISABLED(NOZZLE_PARK_FEATURE) - #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #endif -#endif - -/** - * Individual axis homing is useless for DELTAS - */ -#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." -#endif - -/** - * Options only for EXTRUDERS > 1 - */ -#if EXTRUDERS > 1 - - #if EXTRUDERS > 5 - #error "Marlin supports a maximum of 5 EXTRUDERS." - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." - #endif - - #if ENABLED(HEATERS_PARALLEL) - #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." - #endif - -#elif ENABLED(MK2_MULTIPLEXER) - #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS." -#elif ENABLED(SINGLENOZZLE) - #error "SINGLENOZZLE requires 2 or more EXTRUDERS." -#endif - -/** - * Sanity checking for the Průša MK2 Multiplexer - */ -#ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." -#endif - -/** - * A Dual Nozzle carriage with switching servo - */ -#if ENABLED(SWITCHING_NOZZLE) - #if ENABLED(DUAL_X_CARRIAGE) - #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible." - #elif ENABLED(SINGLENOZZLE) - #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible." - #elif EXTRUDERS != 2 - #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS." - #elif NUM_SERVOS < 1 - #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1." - #endif -#endif - -/** - * Single Stepper Dual Extruder with switching servo - */ -#if ENABLED(SWITCHING_EXTRUDER) && NUM_SERVOS < 1 - #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." -#endif - -/** - * Mixing Extruder requirements - */ -#if ENABLED(MIXING_EXTRUDER) - #if EXTRUDERS > 1 - #error "MIXING_EXTRUDER currently only supports one extruder." - #elif MIXING_STEPPERS < 2 - #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." - #elif ENABLED(FILAMENT_SENSOR) - #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both." - #elif ENABLED(SINGLENOZZLE) - #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." - #elif ENABLED(LIN_ADVANCE) - #error "MIXING_EXTRUDER is incompatible with LIN_ADVANCE." - #endif -#endif - -/** - * Linear Advance 1.5 - Check K value range - */ -#if ENABLED(LIN_ADVANCE) - static_assert( - WITHIN(LIN_ADVANCE_K, 0, 10), - "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)." - ); -#endif - -/** - * Parking Extruder requirements - */ -#if ENABLED(PARKING_EXTRUDER) - #if ENABLED(DUAL_X_CARRIAGE) - #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible." - #elif ENABLED(SINGLENOZZLE) - #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible." - #elif ENABLED(EXT_SOLENOID) - #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)" - #elif EXTRUDERS != 2 - #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS." - #elif !PIN_EXISTS(SOL0) || !PIN_EXISTS(SOL1) - #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN." - #elif !defined(PARKING_EXTRUDER_PARKING_X) - #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X." - #elif !defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_SECURITY_RAISE." - #elif PARKING_EXTRUDER_SECURITY_RAISE < 0 - #error "PARKING_EXTRUDER_SECURITY_RAISE must be 0 or higher." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH) - #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000) - #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)." - #endif -#endif - -/** - * Part-Cooling Fan Multiplexer requirements - */ -#if PIN_EXISTS(FANMUX1) - #if !HAS_FANMUX - #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set." - #endif -#elif PIN_EXISTS(FANMUX2) - #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set." -#endif - -/** - * Limited number of servos - */ -#if NUM_SERVOS > 4 - #error "The maximum number of SERVOS in Marlin is 4." -#endif - -/** - * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder - */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) - #error "Z_PROBE_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE." -#endif - -/** - * Required LCD language - */ -#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780) - #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." -#endif - -/** - * Bed Heating Options - PID vs Limit Switching - */ -#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING) - #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED." -#endif - -/** - * Kinematics - */ - -/** - * Allow only one kinematic type to be defined - */ -#if 1 < 0 \ - + ENABLED(DELTA) \ - + ENABLED(MORGAN_SCARA) \ - + ENABLED(MAKERARM_SCARA) \ - + ENABLED(COREXY) \ - + ENABLED(COREXZ) \ - + ENABLED(COREYZ) \ - + ENABLED(COREYX) \ - + ENABLED(COREZX) \ - + ENABLED(COREZY) - #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY." -#endif - -/** - * Delta requirements - */ -#if ENABLED(DELTA) - #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG) - #error "You probably want to use Max Endstops for DELTA!" - #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED - #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." - #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL)) - #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller." - #elif ABL_GRID - #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers." - #elif GRID_MAX_POINTS_X < 3 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher." - #endif - #endif -#endif - -/** - * Probes - */ - -/** - * Allow only one probe option to be defined - */ -#if 1 < 0 \ - + ENABLED(PROBE_MANUALLY) \ - + ENABLED(FIX_MOUNTED_PROBE) \ - + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) \ - + ENABLED(SOLENOID_PROBE) \ - + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) - #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." -#endif - -#if HAS_BED_PROBE - - /** - * Z_PROBE_SLED is incompatible with DELTA - */ - #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA) - #error "You cannot use Z_PROBE_SLED with DELTA." - #endif - - /** - * SOLENOID_PROBE requirements - */ - #if ENABLED(SOLENOID_PROBE) - #if ENABLED(EXT_SOLENOID) - #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." - #elif !HAS_SOLENOID_1 - #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." - #endif - #endif - - /** - * NUM_SERVOS is required for a Z servo probe - */ - #if HAS_Z_SERVO_PROBE - #ifndef NUM_SERVOS - #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)." - #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR >= NUM_SERVOS - #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS." - #endif - #endif - - /** - * Require pin options and pins to be defined - */ - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #error "Enable only one option: Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." - #elif DISABLED(USE_ZMIN_PLUG) - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled." - #elif !HAS_Z_MIN - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined." - #elif ENABLED(Z_MIN_PROBE_ENDSTOP_INVERTING) != ENABLED(Z_MIN_ENDSTOP_INVERTING) - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING." - #endif - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - #if !HAS_Z_MIN_PROBE_PIN - #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined." - #endif - #else - #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe." - #endif - - /** - * Make sure Z raise values are set - */ - #ifndef Z_CLEARANCE_DEPLOY_PROBE - #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration." - #elif !defined(Z_CLEARANCE_BETWEEN_PROBES) - #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration." - #elif Z_CLEARANCE_DEPLOY_PROBE < 0 - #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." - #elif Z_CLEARANCE_BETWEEN_PROBES < 0 - #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." - #endif - - #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2 - #error "MULTIPLE_PROBING must be >= 2." - #endif - - #if Z_PROBE_LOW_POINT > 0 - #error "Z_PROBE_LOW_POINT must be less than or equal to 0." - #endif - - static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - -#else - - /** - * Require some kind of probe for bed leveling and probe testing - */ - #if OLDSCHOOL_ABL && !PROBE_SELECTED - #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo." - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." - #endif - -#endif - -/** - * Allow only one bed leveling option to be defined - */ -#if 1 < 0 \ - + ENABLED(AUTO_BED_LEVELING_LINEAR) \ - + ENABLED(AUTO_BED_LEVELING_3POINT) \ - + ENABLED(AUTO_BED_LEVELING_BILINEAR) \ - + ENABLED(AUTO_BED_LEVELING_UBL) \ - + ENABLED(MESH_BED_LEVELING) - #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." -#endif - -/** - * Bed Leveling Requirements - */ - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(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) - - /** - * Unified Bed Leveling - */ - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - #if IS_SCARA - #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." - #elif DISABLED(EEPROM_SETTINGS) - #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." - #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) - #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) - #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." - #endif - -#elif OLDSCHOOL_ABL - - /** - * Auto Bed Leveling - */ - - /** - * Delta and SCARA have limited bed leveling options - */ - #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR) - #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 // AUTO_BED_LEVELING_3POINT - -#elif ENABLED(MESH_BED_LEVELING) - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - /** - * Mesh Bed Leveling - */ - - #if ENABLED(DELTA) - #error "MESH_BED_LEVELING is not compatible with DELTA printers." - #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9 - #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL." - #endif - -#endif - -#if HAS_MESH - static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); -#elif ENABLED(G26_MESH_VALIDATION) - #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." -#endif - -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD)) - #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." -#endif - -/** - * LCD_BED_LEVELING requirements - */ -#if ENABLED(LCD_BED_LEVELING) - #if DISABLED(ULTIPANEL) - #error "LCD_BED_LEVELING requires an LCD controller." - #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL) - #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." - #endif -#endif - -/** - * Homing - */ -#if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0 - #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0." -#endif - -#if ENABLED(CODEPENDENT_XY_HOMING) - #if ENABLED(QUICK_HOME) - #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING." - #elif IS_KINEMATIC - #error "CODEPENDENT_XY_HOMING requires a Cartesian setup." - #endif -#endif - -/** - * 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."); - #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."); - #endif -#endif // Z_SAFE_HOMING - -/** - * Make sure DISABLE_[XYZ] compatible with selected homing options - */ -#if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z) - #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING) - #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." - #endif -#endif // DISABLE_[XYZ] - -/** - * Filament Width Sensor - */ -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #if !HAS_FILAMENT_WIDTH_SENSOR - #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." - #elif ENABLED(NO_VOLUMETRICS) - #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled." - #endif -#endif - -/** - * ULTIPANEL encoder - */ -#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK) - #error "ULTIPANEL requires some kind of encoder." -#endif - -#if ENCODER_PULSES_PER_STEP < 0 - #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." -#endif - -/** - * SAV_3DGLCD display options - */ -#if ENABLED(SAV_3DGLCD) - #if DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106) - #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #elif ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) - #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #endif -#endif - -/** - * Allen Key - * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. - */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" -#endif - -/** - * Dual X Carriage requirements - */ -#if ENABLED(DUAL_X_CARRIAGE) - #if EXTRUDERS == 1 - #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." - #elif CORE_IS_XY || CORE_IS_XZ - #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX." - #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR - #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." - #elif !HAS_X_MAX - #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." - #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) - #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." - #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 - #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." - #endif -#endif // DUAL_X_CARRIAGE - -/** - * Make sure auto fan pins don't conflict with the fan pin - */ -#if HAS_AUTO_FAN - #if HAS_FAN0 - #if E0_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN." - #elif E1_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN." - #elif E2_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN." - #elif E3_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN." - #endif - #endif -#endif - -#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN - #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - #if !HAS_CONTROLLER_FAN - #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h." - #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #endif -#endif - -/** - * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. - */ -#if !HAS_HEATER_0 - #error "HEATER_0_PIN not defined for this board." -#elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) - #error "TEMP_0_PIN not defined for this board." -#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR))) - #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." -#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(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." -#endif - -// Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) - #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board." -#elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1 - #error "HEATER_1_PIN not defined for this board." -#endif - -#if HOTENDS > 1 - #if TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !PIN_EXISTS(TEMP_1) - #error "TEMP_1_PIN not defined for this board." - #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 == 0 - #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." - #elif !HAS_HEATER_2 - #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) - #error "TEMP_2_PIN not defined for this board." - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." - #elif !HAS_HEATER_3 - #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) - #error "TEMP_3_PIN not defined for this board." - #endif - #if HOTENDS > 4 - #if TEMP_SENSOR_4 == 0 - #error "TEMP_SENSOR_4 is required with 5 HOTENDS." - #elif !HAS_HEATER_4 - #error "HEATER_4_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_4) - #error "TEMP_4_PIN not defined for this board." - #endif - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS." - #endif - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS." - #endif - #elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS." - #endif -#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND." -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." -#endif - -/** - * Temperature status LEDs - */ -#if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE) - #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both." -#endif - -/** - * LED Control Menu - */ -#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS - #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9632, or NEOPIXEL_LED." -#endif - -/** - * Basic 2-nozzle duplication mode - */ -#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #if HOTENDS != 2 - #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends." - #elif ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE." - #elif ENABLED(SINGLENOZZLE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE." - #elif ENABLED(MIXING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER." - #endif -#endif - -/** - * Test Extruder Stepper Pins - */ -#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only - #if E_STEPPERS > 4 - #if !PIN_EXISTS(E4_STEP) || !PIN_EXISTS(E4_DIR) || !PIN_EXISTS(E4_ENABLE) - #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 3 - #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 2 - #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 1 - #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." - #endif - #endif -#endif -/** - * Endstop Tests - */ - -#define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG) && DISABLED(USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_))) -#define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z)) - -// At least 3 endstop plugs must be used -#if _AXIS_PLUG_UNUSED_TEST(X) - #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Y) - #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Z) - #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." -#endif - -// Delta and Cartesian use 3 homing endstops -#if !IS_SCARA - #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) - #error "Enable USE_XMIN_PLUG when homing X to MIN." - #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) - #error "Enable USE_XMAX_PLUG when homing X to MAX." - #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG) - #error "Enable USE_YMIN_PLUG when homing Y to MIN." - #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG) - #error "Enable USE_YMAX_PLUG when homing Y to MAX." - #endif -#endif -#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) - #error "Enable USE_ZMIN_PLUG when homing Z to MIN." -#elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) - #error "Enable USE_ZMAX_PLUG when homing Z to MAX." -#endif - -// Dual endstops requirements -#if ENABLED(X_DUAL_ENDSTOPS) - #if !X2_USE_ENDSTOP - #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS." - #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_." - #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_." - #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_." - #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_." - #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_." - #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_X2_MIN && !HAS_X2_MAX - #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "X_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - #if !Y2_USE_ENDSTOP - #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS." - #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_." - #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_." - #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_." - #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_." - #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_." - #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Y2_MIN && !HAS_Y2_MAX - #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Y_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - #if !Z2_USE_ENDSTOP - #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS." - #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_." - #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_." - #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_." - #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_." - #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_." - #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Z2_MIN && !HAS_Z2_MAX - #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Z_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif - -/** - * emergency-command parser - */ -#if ENABLED(EMERGENCY_PARSER) && !USE_MARLINSERIAL - #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." -#endif - -/** - * I2C bus - */ -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - #if I2C_SLAVE_ADDRESS < 8 - #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)" - #elif I2C_SLAVE_ADDRESS > 127 - #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)" - #endif -#endif - -/** - * G38 Probe Target - */ -#if ENABLED(G38_PROBE_TARGET) - #if !HAS_BED_PROBE - #error "G38_PROBE_TARGET requires a bed probe." - #elif !IS_CARTESIAN - #error "G38_PROBE_TARGET requires a Cartesian machine." - #endif -#endif - -/** - * RGB_LED Requirements - */ -#define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B)) -#if ENABLED(RGB_LED) - #if !_RGB_TEST - #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN." - #elif ENABLED(RGBW_LED) - #error "Please enable only one of RGB_LED and RGBW_LED." - #endif -#elif ENABLED(RGBW_LED) - #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W)) - #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN." - #endif -#elif ENABLED(NEOPIXEL_LED) - #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0) - #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS." - #endif -#elif ENABLED(PRINTER_EVENT_LEDS) && DISABLED(BLINKM) && DISABLED(PCA9632) && DISABLED(NEOPIXEL_LED) - #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED." -#endif - -/** - * Auto Fan check for PWM pins - */ -#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 - #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255." - #if HAS_AUTO_FAN_0 - static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_1 - static_assert(GET_TIMER(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_2 - static_assert(GET_TIMER(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_3 - static_assert(GET_TIMER(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF); - #endif -#endif - -/** - * Make sure only one display is enabled - * - * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER - * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER - * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER - * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER - * MKS_MINI_12864 => MINIPANEL - * miniVIKI => ULTIMAKERCONTROLLER - * VIKI2 => ULTIMAKERCONTROLLER - * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER - * PANEL_ONE => ULTIMAKERCONTROLLER - */ -#if 1 < 0 \ - + ( ENABLED(ULTIMAKERCONTROLLER) \ - && DISABLED(SAV_3DGLCD) \ - && DISABLED(miniVIKI) \ - && DISABLED(VIKI2) \ - && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - && DISABLED(PANEL_ONE) \ - && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ - && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ - && DISABLED(LCD_FOR_MELZI) \ - && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \ - + ENABLED(LCD_FOR_MELZI) \ - + ENABLED(MKS_12864OLED) \ - + ENABLED(MKS_12864OLED_SSD1306) \ - + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - + ENABLED(CARTESIO_UI) \ - + ENABLED(PANEL_ONE) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(G3D_PANEL) \ - + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ - + ENABLED(MKS_MINI_12864) \ - + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \ - + ENABLED(RIGIDBOT_PANEL) \ - + ENABLED(RA_CONTROL_PANEL) \ - + ENABLED(LCD_SAINSMART_I2C_1602) \ - + ENABLED(LCD_SAINSMART_I2C_2004) \ - + ENABLED(LCM1602) \ - + ENABLED(LCD_I2C_PANELOLU2) \ - + ENABLED(LCD_I2C_VIKI) \ - + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \ - + ENABLED(SAV_3DLCD) \ - + ENABLED(BQ_LCD_SMART_CONTROLLER) \ - + ENABLED(SAV_3DGLCD) \ - + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(ULTI_CONTROLLER) - #error "Please select no more than one LCD controller option." -#endif - -/** - * Check existing CS pins against enabled TMC SPI drivers. - */ -#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS) - #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS) - #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS) - #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS) - #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS) - #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS) - #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS) - #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS) - #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS) - #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS) - #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS) - #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h." -#endif - -/** - * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) - */ -#if HAS_DRIVER(TMC2208) && 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(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) ) - #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." -#endif - -#if ENABLED(SENSORLESS_HOMING) - // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop - // is necessary in order to reset the stallGuard indication between the initial movement of all three - // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of - // clearing the stallGuard activated status is found. - #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP) - #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." - #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_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 == 1 && (DISABLED(X_MAX_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 == -1 && (DISABLED(Y_MIN_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 == 1 && (DISABLED(Y_MAX_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 == -1 && (DISABLED(Z_MIN_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 == 1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX)) - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." - #elif ENABLED(ENDSTOP_NOISE_FILTER) - #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER." - #endif -#endif - -// Sensorless homing is required for both combined steppers in an H-bot -#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS - #error "CoreXY requires both X and Y to use sensorless homing if either does." -#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS - #error "CoreXZ requires both X and Z to use sensorless homing if either does." -#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS - #error "CoreYZ requires both Y and Z to use sensorless homing if either does." -#endif - -#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) - #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." -#endif -#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2) - #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis" -#endif - -#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD - #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers." -#endif -#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP - #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers." -#endif - -/** - * Digipot requirement - */ -#if ENABLED(DIGIPOT_MCP4018) - #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \ - || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1) - #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined." - #endif -#endif - -/** - * Require 4 or more elements in per-axis initializers - */ -constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT, - sanity_arr_2[] = DEFAULT_MAX_FEEDRATE, - sanity_arr_3[] = DEFAULT_MAX_ACCELERATION; -static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements."); -static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements."); -static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements."); - -/** - * Sanity checks for Spindle / Laser - */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46)) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif SPINDLE_LASER_POWERUP_DELAY < 1 - #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0." - #elif SPINDLE_LASER_POWERDOWN_DELAY < 1 - #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0." - #elif !defined(SPINDLE_LASER_PWM_INVERT) - #error "SPINDLE_LASER_PWM_INVERT missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." - #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop." - #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop." - #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin in use by Z_STEP." - #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE - -#if ENABLED(CNC_COORDINATE_SYSTEMS) && ENABLED(NO_WORKSPACE_OFFSETS) - #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS." -#endif - -#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) - #error "BLOCK_BUFFER_SIZE must be a power of 2." -#endif - -#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL) - #error "LED_CONTROL_MENU requires an LCD controller." -#endif - -#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED) - #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED." -#endif - -#if ENABLED(SKEW_CORRECTION) - #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)) - #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD." - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD)) - #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD." - #endif - #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD)) - #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD." - #endif - #endif -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) && !ENABLED(ULTIPANEL) - #error "POWER_LOSS_RECOVERY currently requires an LCD Controller." -#endif - -#endif // _SANITYCHECK_H_ diff --git a/Marlin/Sd2Card.cpp b/Marlin/Sd2Card.cpp deleted file mode 100644 index 118b83cd9d..0000000000 --- a/Marlin/Sd2Card.cpp +++ /dev/null @@ -1,716 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "Sd2Card.h" - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if DISABLED(SOFTWARE_SPI) - // functions for hardware SPI - - // make sure SPCR rate is in expected bits - #if (SPR0 != 0 || SPR1 != 1) - #error "unexpected SPCR bits" - #endif - /** - * Initialize hardware SPI - * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] - */ - static void spiInit(uint8_t spiRate) { - // See avr processor documentation - SPCR = _BV(SPE) | _BV(MSTR) | (spiRate >> 1); - SPSR = spiRate & 1 || spiRate == 6 ? 0 : _BV(SPI2X); - } - - /** SPI receive a byte */ - static uint8_t spiRec() { - SPDR = 0xFF; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - return SPDR; - } - - /** SPI read data - only one call so force inline */ - static inline __attribute__((always_inline)) - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte-- == 0) return; - SPDR = 0xFF; - for (uint16_t i = 0; i < nbyte; i++) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[i] = SPDR; - SPDR = 0xFF; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[nbyte] = SPDR; - } - - /** SPI send a byte */ - static void spiSend(uint8_t b) { - SPDR = b; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - - /** SPI send block - only one call so force inline */ - static inline __attribute__((always_inline)) - void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPDR = token; - for (uint16_t i = 0; i < 512; i += 2) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i]; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i + 1]; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - //------------------------------------------------------------------------------ -#else // SOFTWARE_SPI - //------------------------------------------------------------------------------ - - /** nop to tune soft SPI timing */ - #define nop asm volatile ("nop\n\t") - - /** Soft SPI receive byte */ - static uint8_t spiRec() { - uint8_t data = 0; - // no interrupts during byte receive - about 8 us - cli(); - // output pin high - like sending 0xFF - WRITE(SPI_MOSI_PIN, HIGH); - - for (uint8_t i = 0; i < 8; i++) { - WRITE(SPI_SCK_PIN, HIGH); - - // adjust so SCK is nice - nop; - nop; - - data <<= 1; - - if (READ(SPI_MISO_PIN)) data |= 1; - - WRITE(SPI_SCK_PIN, LOW); - } - // enable interrupts - sei(); - return data; - } - - /** Soft SPI read data */ - static void spiRead(uint8_t* buf, uint16_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) - buf[i] = spiRec(); - } - - /** Soft SPI send byte */ - static void spiSend(uint8_t data) { - // no interrupts during byte send - about 8 us - cli(); - for (uint8_t i = 0; i < 8; i++) { - WRITE(SPI_SCK_PIN, LOW); - - WRITE(SPI_MOSI_PIN, data & 0x80); - - data <<= 1; - - WRITE(SPI_SCK_PIN, HIGH); - } - // hold SCK high for a few ns - nop; - nop; - nop; - nop; - - WRITE(SPI_SCK_PIN, LOW); - // enable interrupts - sei(); - } - - /** Soft SPI send block */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { - spiSend(token); - for (uint16_t i = 0; i < 512; i++) - spiSend(buf[i]); - } -#endif // SOFTWARE_SPI - -// send command and return error code. Return zero for OK -uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { - // select card - chipSelectLow(); - - // wait up to 300 ms if busy - waitNotBusy(300); - - // send command - spiSend(cmd | 0x40); - - // send argument - for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); - - // send CRC - uint8_t crc = 0xFF; - if (cmd == CMD0) crc = 0x95; // correct crc for CMD0 with arg 0 - if (cmd == CMD8) crc = 0x87; // correct crc for CMD8 with arg 0x1AA - spiSend(crc); - - // skip stuff byte for stop read - if (cmd == CMD12) spiRec(); - - // wait for response - for (uint8_t i = 0; ((status_ = spiRec()) & 0x80) && i != 0xFF; i++) { /* Intentionally left empty */ } - return status_; -} - -/** - * Determine the size of an SD flash memory card. - * - * \return The number of 512 byte data blocks in the card - * or zero if an error occurs. - */ -uint32_t Sd2Card::cardSize() { - csd_t csd; - if (!readCSD(&csd)) return 0; - if (csd.v1.csd_ver == 0) { - uint8_t read_bl_len = csd.v1.read_bl_len; - uint16_t c_size = (csd.v1.c_size_high << 10) - | (csd.v1.c_size_mid << 2) | csd.v1.c_size_low; - uint8_t c_size_mult = (csd.v1.c_size_mult_high << 1) - | csd.v1.c_size_mult_low; - return (uint32_t)(c_size + 1) << (c_size_mult + read_bl_len - 7); - } - else if (csd.v2.csd_ver == 1) { - uint32_t c_size = ((uint32_t)csd.v2.c_size_high << 16) - | (csd.v2.c_size_mid << 8) | csd.v2.c_size_low; - return (c_size + 1) << 10; - } - else { - error(SD_CARD_ERROR_BAD_CSD); - return 0; - } -} - -void Sd2Card::chipSelectHigh() { - digitalWrite(chipSelectPin_, HIGH); -} - -void Sd2Card::chipSelectLow() { - #if DISABLED(SOFTWARE_SPI) - spiInit(spiRate_); - #endif // SOFTWARE_SPI - digitalWrite(chipSelectPin_, LOW); -} - -/** - * Erase a range of blocks. - * - * \param[in] firstBlock The address of the first block in the range. - * \param[in] lastBlock The address of the last block in the range. - * - * \note This function requests the SD card to do a flash erase for a - * range of blocks. The data on the card after an erase operation is - * either 0 or 1, depends on the card vendor. The card must support - * single block erase. - * - * \return true for success, false for failure. - */ -bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) { - csd_t csd; - if (!readCSD(&csd)) goto FAIL; - // check for single block erase - if (!csd.v1.erase_blk_en) { - // erase size mask - uint8_t m = (csd.v1.sector_size_high << 1) | csd.v1.sector_size_low; - if ((firstBlock & m) != 0 || ((lastBlock + 1) & m) != 0) { - // error card can't erase specified area - error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK); - goto FAIL; - } - } - if (type_ != SD_CARD_TYPE_SDHC) { - firstBlock <<= 9; - lastBlock <<= 9; - } - if (cardCommand(CMD32, firstBlock) - || cardCommand(CMD33, lastBlock) - || cardCommand(CMD38, 0)) { - error(SD_CARD_ERROR_ERASE); - goto FAIL; - } - if (!waitNotBusy(SD_ERASE_TIMEOUT)) { - error(SD_CARD_ERROR_ERASE_TIMEOUT); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Determine if card supports single block erase. - * - * \return true if single block erase is supported. - * false if single block erase is not supported. - */ -bool Sd2Card::eraseSingleBlockEnable() { - csd_t csd; - return readCSD(&csd) ? csd.v1.erase_blk_en : false; -} - -/** - * Initialize an SD flash memory card. - * - * \param[in] sckRateID SPI clock rate selector. See setSckRate(). - * \param[in] chipSelectPin SD chip select pin number. - * - * \return true for success, false for failure. - * The reason for failure can be determined by calling errorCode() and errorData(). - */ -bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { - errorCode_ = type_ = 0; - chipSelectPin_ = chipSelectPin; - // 16-bit init start time allows over a minute - uint16_t t0 = (uint16_t)millis(); - uint32_t arg; - - // If init takes more than 4s it could trigger - // watchdog leading to a reboot loop. - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - - // set pin modes - pinMode(chipSelectPin_, OUTPUT); - chipSelectHigh(); - SET_INPUT(SPI_MISO_PIN); - SET_OUTPUT(SPI_MOSI_PIN); - SET_OUTPUT(SPI_SCK_PIN); - - #if DISABLED(SOFTWARE_SPI) - // SS must be in output mode even it is not chip select - SET_OUTPUT(SS_PIN); - // set SS high - may be chip select for another SPI device - #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); - #endif // SET_SPI_SS_HIGH - // set SCK rate for initialization commands - spiRate_ = SPI_SD_INIT_RATE; - spiInit(spiRate_); - #endif // SOFTWARE_SPI - - // must supply min of 74 clock cycles with CS high. - for (uint8_t i = 0; i < 10; i++) spiSend(0xFF); - - // command to go idle in SPI mode - while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { - error(SD_CARD_ERROR_CMD0); - goto FAIL; - } - } - // check SD version - if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { - type(SD_CARD_TYPE_SD1); - } - else { - // only need last byte of r7 response - for (uint8_t i = 0; i < 4; i++) status_ = spiRec(); - if (status_ != 0xAA) { - error(SD_CARD_ERROR_CMD8); - goto FAIL; - } - type(SD_CARD_TYPE_SD2); - } - // initialize card and send host supports SDHC if SD2 - arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; - - while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { - // check for timeout - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { - error(SD_CARD_ERROR_ACMD41); - goto FAIL; - } - } - // if SD2 read OCR register to check for SDHC card - if (type() == SD_CARD_TYPE_SD2) { - if (cardCommand(CMD58, 0)) { - error(SD_CARD_ERROR_CMD58); - goto FAIL; - } - if ((spiRec() & 0xC0) == 0xC0) type(SD_CARD_TYPE_SDHC); - // discard rest of ocr - contains allowed voltage range - for (uint8_t i = 0; i < 3; i++) spiRec(); - } - chipSelectHigh(); - - #if DISABLED(SOFTWARE_SPI) - return setSckRate(sckRateID); - #else // SOFTWARE_SPI - UNUSED(sckRateID); - return true; - #endif // SOFTWARE_SPI - - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Read a 512 byte block from an SD card. - * - * \param[in] blockNumber Logical block to be read. - * \param[out] dst Pointer to the location that will receive the data. - * \return true for success, false for failure. - */ -bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - - #if ENABLED(SD_CHECK_AND_RETRY) - uint8_t retryCnt = 3; - for (;;) { - if (cardCommand(CMD17, blockNumber)) - error(SD_CARD_ERROR_CMD17); - else if (readData(dst, 512)) - return true; - - chipSelectHigh(); - if (!--retryCnt) break; - - cardCommand(CMD12, 0); // Try sending a stop command, ignore the result. - errorCode_ = 0; - } - return false; - #else - if (cardCommand(CMD17, blockNumber)) { - error(SD_CARD_ERROR_CMD17); - chipSelectHigh(); - return false; - } - else - return readData(dst, 512); - #endif -} - -/** - * Read one data block in a multiple block read sequence - * - * \param[in] dst Pointer to the location for the data to be read. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readData(uint8_t* dst) { - chipSelectLow(); - return readData(dst, 512); -} - -#if ENABLED(SD_CHECK_AND_RETRY) - static const uint16_t crctab[] PROGMEM = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 - }; - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); - } - return crc; - } -#endif // SD_CHECK_AND_RETRY - -bool Sd2Card::readData(uint8_t* dst, uint16_t count) { - // wait for start block token - uint16_t t0 = millis(); - while ((status_ = spiRec()) == 0XFF) { - if (((uint16_t)millis() - t0) > SD_READ_TIMEOUT) { - error(SD_CARD_ERROR_READ_TIMEOUT); - goto FAIL; - } - } - if (status_ != DATA_START_BLOCK) { - error(SD_CARD_ERROR_READ); - goto FAIL; - } - // transfer data - spiRead(dst, count); - -#if ENABLED(SD_CHECK_AND_RETRY) - { - uint16_t calcCrc = CRC_CCITT(dst, count); - uint16_t recvCrc = spiRec() << 8; - recvCrc |= spiRec(); - if (calcCrc != recvCrc) { - error(SD_CARD_ERROR_CRC); - goto FAIL; - } - } -#else - // discard CRC - spiRec(); - spiRec(); -#endif - chipSelectHigh(); - // Send an additional dummy byte, required by Toshiba Flash Air SD Card - spiSend(0XFF); - return true; - FAIL: - chipSelectHigh(); - // Send an additional dummy byte, required by Toshiba Flash Air SD Card - spiSend(0XFF); - return false; -} - -/** read CID or CSR register */ -bool Sd2Card::readRegister(uint8_t cmd, void* buf) { - uint8_t* dst = reinterpret_cast(buf); - if (cardCommand(cmd, 0)) { - error(SD_CARD_ERROR_READ_REG); - chipSelectHigh(); - return false; - } - return readData(dst, 16); -} - -/** - * Start a read multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * - * \note This function is used with readData() and readStop() for optimized - * multiple block reads. SPI chipSelect must be low for the entire sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStart(uint32_t blockNumber) { - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD18, blockNumber)) { - error(SD_CARD_ERROR_CMD18); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -/** - * End a read multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStop() { - chipSelectLow(); - if (cardCommand(CMD12, 0)) { - error(SD_CARD_ERROR_CMD12); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -/** - * Set the SPI clock rate. - * - * \param[in] sckRateID A value in the range [0, 6]. - * - * The SPI clock will be set to F_CPU/pow(2, 1 + sckRateID). The maximum - * SPI rate is F_CPU/2 for \a sckRateID = 0 and the minimum rate is F_CPU/128 - * for \a scsRateID = 6. - * - * \return The value one, true, is returned for success and the value zero, - * false, is returned for an invalid value of \a sckRateID. - */ -bool Sd2Card::setSckRate(uint8_t sckRateID) { - if (sckRateID > 6) { - error(SD_CARD_ERROR_SCK_RATE); - return false; - } - spiRate_ = sckRateID; - return true; -} - -// wait for card to go not busy -bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { - uint16_t t0 = millis(); - while (spiRec() != 0XFF) - if (((uint16_t)millis() - t0) >= timeoutMillis) return false; - - return true; -} - -/** - * Writes a 512 byte block to an SD card. - * - * \param[in] blockNumber Logical block to be written. - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD24, blockNumber)) { - error(SD_CARD_ERROR_CMD24); - goto FAIL; - } - if (!writeData(DATA_START_BLOCK, src)) goto FAIL; - - // wait for flash programming to complete - if (!waitNotBusy(SD_WRITE_TIMEOUT)) { - error(SD_CARD_ERROR_WRITE_TIMEOUT); - goto FAIL; - } - // response is r2 so get and check two bytes for nonzero - if (cardCommand(CMD13, 0) || spiRec()) { - error(SD_CARD_ERROR_WRITE_PROGRAMMING); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Write one data block in a multiple block write sequence - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeData(const uint8_t* src) { - chipSelectLow(); - // wait for previous write to finish - if (!waitNotBusy(SD_WRITE_TIMEOUT) || !writeData(WRITE_MULTIPLE_TOKEN, src)) { - error(SD_CARD_ERROR_WRITE_MULTIPLE); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -// send one block of data for write block or write multiple blocks -bool Sd2Card::writeData(uint8_t token, const uint8_t* src) { - spiSendBlock(token, src); - - spiSend(0xFF); // dummy crc - spiSend(0xFF); // dummy crc - - status_ = spiRec(); - if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { - error(SD_CARD_ERROR_WRITE); - chipSelectHigh(); - return false; - } - return true; -} - -/** - * Start a write multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * \param[in] eraseCount The number of blocks to be pre-erased. - * - * \note This function is used with writeData() and writeStop() - * for optimized multiple block writes. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStart(uint32_t blockNumber, uint32_t eraseCount) { - // send pre-erase count - if (cardAcmd(ACMD23, eraseCount)) { - error(SD_CARD_ERROR_ACMD23); - goto FAIL; - } - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD25, blockNumber)) { - error(SD_CARD_ERROR_CMD25); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * End a write multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStop() { - chipSelectLow(); - if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL; - spiSend(STOP_TRAN_TOKEN); - if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL; - chipSelectHigh(); - return true; - FAIL: - error(SD_CARD_ERROR_STOP_TRAN); - chipSelectHigh(); - return false; -} - -#endif // SDSUPPORT diff --git a/Marlin/Sd2Card.h b/Marlin/Sd2Card.h deleted file mode 100644 index e7fc03bf9e..0000000000 --- a/Marlin/Sd2Card.h +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief Sd2Card class for V2 SD/SDHC cards - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SD2CARD_H_ -#define _SD2CARD_H_ - -#include "SdFatConfig.h" -#include "SdInfo.h" - -// SPI speed is F_CPU/2^(1 + index), 0 <= index <= 6 -uint8_t const SPI_FULL_SPEED = 0, // Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). - SPI_HALF_SPEED = 1, // Set SCK rate to F_CPU/4. See Sd2Card::setSckRate(). - SPI_QUARTER_SPEED = 2, // Set SCK rate to F_CPU/8. See Sd2Card::setSckRate(). - SPI_EIGHTH_SPEED = 3, // Set SCK rate to F_CPU/16. See Sd2Card::setSckRate(). - SPI_SIXTEENTH_SPEED = 4; // Set SCK rate to F_CPU/32. See Sd2Card::setSckRate(). - -uint16_t const SD_INIT_TIMEOUT = 2000, // init timeout ms - SD_ERASE_TIMEOUT = 10000, // erase timeout ms - SD_READ_TIMEOUT = 300, // read timeout ms - SD_WRITE_TIMEOUT = 600; // write time out ms - -// SD card errors -uint8_t const SD_CARD_ERROR_CMD0 = 0X1, // timeout error for command CMD0 (initialize card in SPI mode) - SD_CARD_ERROR_CMD8 = 0X2, // CMD8 was not accepted - not a valid SD card - SD_CARD_ERROR_CMD12 = 0X3, // card returned an error response for CMD12 (write stop) - SD_CARD_ERROR_CMD17 = 0X4, // card returned an error response for CMD17 (read block) - SD_CARD_ERROR_CMD18 = 0X5, // card returned an error response for CMD18 (read multiple block) - SD_CARD_ERROR_CMD24 = 0X6, // card returned an error response for CMD24 (write block) - SD_CARD_ERROR_CMD25 = 0X7, // WRITE_MULTIPLE_BLOCKS command failed - SD_CARD_ERROR_CMD58 = 0X8, // card returned an error response for CMD58 (read OCR) - SD_CARD_ERROR_ACMD23 = 0X9, // SET_WR_BLK_ERASE_COUNT failed - SD_CARD_ERROR_ACMD41 = 0XA, // ACMD41 initialization process timeout - SD_CARD_ERROR_BAD_CSD = 0XB, // card returned a bad CSR version field - SD_CARD_ERROR_ERASE = 0XC, // erase block group command failed - SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD, // card not capable of single block erase - SD_CARD_ERROR_ERASE_TIMEOUT = 0XE, // Erase sequence timed out - SD_CARD_ERROR_READ = 0XF, // card returned an error token instead of read data - SD_CARD_ERROR_READ_REG = 0x10, // read CID or CSD failed - SD_CARD_ERROR_READ_TIMEOUT = 0x11, // timeout while waiting for start of read data - SD_CARD_ERROR_STOP_TRAN = 0x12, // card did not accept STOP_TRAN_TOKEN - SD_CARD_ERROR_WRITE = 0x13, // card returned an error token as a response to a write operation - SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0x14, // REMOVE - not used ... attempt to write protected block zero - SD_CARD_ERROR_WRITE_MULTIPLE = 0x15, // card did not go ready for a multiple block write - SD_CARD_ERROR_WRITE_PROGRAMMING = 0x16, // card returned an error to a CMD13 status check after a write - SD_CARD_ERROR_WRITE_TIMEOUT = 0x17, // timeout occurred during write programming - SD_CARD_ERROR_SCK_RATE = 0x18, // incorrect rate selected - SD_CARD_ERROR_INIT_NOT_CALLED = 0x19, // init() not called - SD_CARD_ERROR_CRC = 0x20; // crc check error - -// card types -uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 SD card - SD_CARD_TYPE_SD2 = 2, // Standard capacity V2 SD card - SD_CARD_TYPE_SDHC = 3; // High Capacity SD card - -/** - * define SOFTWARE_SPI to use bit-bang SPI - */ -#if MEGA_SOFT_SPI - #define SOFTWARE_SPI -#elif USE_SOFTWARE_SPI - #define SOFTWARE_SPI -#endif - -// SPI pin definitions - do not edit here - change in SdFatConfig.h -#if DISABLED(SOFTWARE_SPI) - // hardware pin defs - #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. - // The following three pins must not be redefined for hardware SPI. - #define SPI_MOSI_PIN MOSI_PIN - #define SPI_MISO_PIN MISO_PIN - #define SPI_SCK_PIN SCK_PIN -#else // SOFTWARE_SPI - #define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN // SPI chip select pin - #define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN // SPI Master Out Slave In pin - #define SPI_MISO_PIN SOFT_SPI_MISO_PIN // SPI Master In Slave Out pin - #define SPI_SCK_PIN SOFT_SPI_SCK_PIN // SPI Clock pin -#endif // SOFTWARE_SPI - -/** - * \class Sd2Card - * \brief Raw access to SD and SDHC flash memory cards. - */ -class Sd2Card { - public: - - Sd2Card() : errorCode_(SD_CARD_ERROR_INIT_NOT_CALLED), type_(0) {} - - uint32_t cardSize(); - bool erase(uint32_t firstBlock, uint32_t lastBlock); - bool eraseSingleBlockEnable(); - - /** - * Set SD error code. - * \param[in] code value for error code. - */ - void error(uint8_t code) {errorCode_ = code;} - - /** - * \return error code for last error. See Sd2Card.h for a list of error codes. - */ - int errorCode() const {return errorCode_;} - - /** \return error data for last error. */ - int errorData() const {return status_;} - - /** - * Initialize an SD flash memory card with default clock rate and chip - * select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin). - * - * \return true for success or false for failure. - */ - bool init(uint8_t sckRateID = SPI_FULL_SPEED, - pin_t chipSelectPin = SD_CHIP_SELECT_PIN); - bool readBlock(uint32_t block, uint8_t* dst); - - /** - * Read a card's CID register. The CID contains card identification - * information such as Manufacturer ID, Product name, Product serial - * number and Manufacturing date. - * - * \param[out] cid pointer to area for returned data. - * - * \return true for success or false for failure. - */ - bool readCID(cid_t* cid) { return readRegister(CMD10, cid); } - - /** - * Read a card's CSD register. The CSD contains Card-Specific Data that - * provides information regarding access to the card's contents. - * - * \param[out] csd pointer to area for returned data. - * - * \return true for success or false for failure. - */ - bool readCSD(csd_t* csd) { return readRegister(CMD9, csd); } - - bool readData(uint8_t* dst); - bool readStart(uint32_t blockNumber); - bool readStop(); - bool setSckRate(uint8_t sckRateID); - /** - * Return the card type: SD V1, SD V2 or SDHC - * \return 0 - SD V1, 1 - SD V2, or 3 - SDHC. - */ - int type() const {return type_;} - bool writeBlock(uint32_t blockNumber, const uint8_t* src); - bool writeData(const uint8_t* src); - bool writeStart(uint32_t blockNumber, uint32_t eraseCount); - bool writeStop(); - - private: - uint8_t chipSelectPin_, - errorCode_, - spiRate_, - status_, - type_; - - // private functions - uint8_t cardAcmd(uint8_t cmd, uint32_t arg) { - cardCommand(CMD55, 0); - return cardCommand(cmd, arg); - } - uint8_t cardCommand(uint8_t cmd, uint32_t arg); - - bool readData(uint8_t* dst, uint16_t count); - bool readRegister(uint8_t cmd, void* buf); - void chipSelectHigh(); - void chipSelectLow(); - void type(uint8_t value) { type_ = value; } - bool waitNotBusy(uint16_t timeoutMillis); - bool writeData(uint8_t token, const uint8_t* src); -}; - -#endif // _SD2CARD_H_ diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp deleted file mode 100644 index 3754fefb32..0000000000 --- a/Marlin/SdBaseFile.cpp +++ /dev/null @@ -1,1728 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdBaseFile.h" -#include "Marlin.h" - -SdBaseFile* SdBaseFile::cwd_ = 0; // Pointer to Current Working Directory - -// callback function for date/time -void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; - -// add a cluster to a file -bool SdBaseFile::addCluster() { - if (!vol_->allocContiguous(1, &curCluster_)) return false; - - // if first cluster of file link to directory entry - if (firstCluster_ == 0) { - firstCluster_ = curCluster_; - flags_ |= F_FILE_DIR_DIRTY; - } - return true; -} - -// Add a cluster to a directory file and zero the cluster. -// return with first block of cluster in the cache -bool SdBaseFile::addDirCluster() { - uint32_t block; - // max folder size - if (fileSize_ / sizeof(dir_t) >= 0xFFFF) return false; - - if (!addCluster()) return false; - if (!vol_->cacheFlush()) return false; - - block = vol_->clusterStartBlock(curCluster_); - - // set cache to first block of cluster - vol_->cacheSetBlockNumber(block, true); - - // zero first block of cluster - memset(vol_->cacheBuffer_.data, 0, 512); - - // zero rest of cluster - for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { - if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) return false; - } - // Increase directory file size by cluster size - fileSize_ += 512UL << vol_->clusterSizeShift_; - return true; -} - -// cache a file's directory entry -// return pointer to cached entry or null for failure -dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { - if (!vol_->cacheRawBlock(dirBlock_, action)) return NULL; - return vol_->cache()->dir + dirIndex_; -} - -/** - * Close a file and force cached data and directory information - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include no file is open or an I/O error. - */ -bool SdBaseFile::close() { - bool rtn = sync(); - type_ = FAT_FILE_TYPE_CLOSED; - return rtn; -} - -/** - * Check for contiguous file and return its raw block range. - * - * \param[out] bgnBlock the first block address for the file. - * \param[out] endBlock the last block address for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is not contiguous, file has zero length - * or an I/O error occurred. - */ -bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { - // error if no blocks - if (firstCluster_ == 0) return false; - - for (uint32_t c = firstCluster_; ; c++) { - uint32_t next; - if (!vol_->fatGet(c, &next)) return false; - - // check for contiguous - if (next != (c + 1)) { - // error if not end of chain - if (!vol_->isEOC(next)) return false; - *bgnBlock = vol_->clusterStartBlock(firstCluster_); - *endBlock = vol_->clusterStartBlock(c) - + vol_->blocksPerCluster_ - 1; - return true; - } - } - return false; -} - -/** - * Create and open a new contiguous file of a specified size. - * - * \note This function only supports short DOS 8.3 names. - * See open() for more information. - * - * \param[in] dirFile The directory where the file will be created. - * \param[in] path A path with a valid DOS 8.3 file name. - * \param[in] size The desired file size. - * - * \return true for success, false for failure. - * Reasons for failure include \a path contains - * an invalid DOS 8.3 file name, the FAT volume has not been initialized, - * a file is already open, the file already exists, the root - * directory is full or an I/O error. - * - */ -bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) { - uint32_t count; - // don't allow zero length file - if (size == 0) return false; - if (!open(dirFile, path, O_CREAT | O_EXCL | O_RDWR)) return false; - - // calculate number of clusters needed - count = ((size - 1) >> (vol_->clusterSizeShift_ + 9)) + 1; - - // allocate clusters - if (!vol_->allocContiguous(count, &firstCluster_)) { - remove(); - return false; - } - fileSize_ = size; - - // insure sync() will update dir entry - flags_ |= F_FILE_DIR_DIRTY; - - return sync(); -} - -/** - * Return a file's directory entry. - * - * \param[out] dir Location for return of the file's directory entry. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::dirEntry(dir_t* dir) { - dir_t* p; - // make sure fields on SD are correct - if (!sync()) return false; - - // read entry - p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // copy to caller's struct - memcpy(dir, p, sizeof(dir_t)); - return true; -} - -/** - * Format the name field of \a dir into the 13 byte array - * \a name in standard 8.3 short name format. - * - * \param[in] dir The directory structure containing the name. - * \param[out] name A 13 byte char array for the formatted name. - */ -void SdBaseFile::dirName(const dir_t& dir, char* name) { - uint8_t j = 0; - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) name[j++] = '.'; - name[j++] = dir.name[i]; - } - name[j] = 0; -} - -/** - * Test for the existence of a file in a directory - * - * \param[in] name Name of the file to be tested for. - * - * The calling instance must be an open directory file. - * - * dirFile.exists("TOFIND.TXT") searches for "TOFIND.TXT" in the directory - * dirFile. - * - * \return true if the file exists else false. - */ -bool SdBaseFile::exists(const char* name) { - SdBaseFile file; - return file.open(this, name, O_READ); -} - -/** - * Get a string from a file. - * - * fgets() reads bytes from a file into the array pointed to by \a str, until - * \a num - 1 bytes are read, or a delimiter is read and transferred to \a str, - * or end-of-file is encountered. The string is then terminated - * with a null byte. - * - * fgets() deletes CR, '\\r', from the string. This insures only a '\\n' - * terminates the string for Windows text files which use CRLF for newline. - * - * \param[out] str Pointer to the array where the string is stored. - * \param[in] num Maximum number of characters to be read - * (including the final null byte). Usually the length - * of the array \a str is used. - * \param[in] delim Optional set of delimiters. The default is "\n". - * - * \return For success fgets() returns the length of the string in \a str. - * If no data is read, fgets() returns zero for EOF or -1 if an error occurred. - **/ -int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { - char ch; - int16_t n = 0; - int16_t r = -1; - while ((n + 1) < num && (r = read(&ch, 1)) == 1) { - // delete CR - if (ch == '\r') continue; - str[n++] = ch; - if (!delim) { - if (ch == '\n') break; - } - else { - if (strchr(delim, ch)) break; - } - } - if (r < 0) { - // read error - return -1; - } - str[n] = '\0'; - return n; -} - -/** - * Get a file's name - * - * \param[out] name An array of 13 characters for the file's name. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::getFilename(char * const name) { - if (!isOpen()) return false; - - if (isRoot()) { - name[0] = '/'; - name[1] = '\0'; - return true; - } - // cache entry - dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // format name - dirName(*p, name); - return true; -} - -void SdBaseFile::getpos(filepos_t* pos) { - pos->position = curPosition_; - pos->cluster = curCluster_; -} - -/** - * List directory contents. - * - * \param[in] pr Print stream for list. - * - * \param[in] flags The inclusive OR of - * - * LS_DATE - %Print file modification date - * - * LS_SIZE - %Print file size. - * - * LS_R - Recursive list of subdirectories. - * - * \param[in] indent Amount of space before file name. Used for recursive - * list to indicate subdirectory level. - */ -void SdBaseFile::ls(uint8_t flags, uint8_t indent) { - rewind(); - int8_t status; - while ((status = lsPrintNext(flags, indent))) { - if (status > 1 && (flags & LS_R)) { - uint16_t index = curPosition() / 32 - 1; - SdBaseFile s; - if (s.open(this, index, O_READ)) s.ls(flags, indent + 2); - seekSet(32 * (index + 1)); - } - } -} - -// saves 32 bytes on stack for ls recursion -// return 0 - EOF, 1 - normal file, or 2 - directory -int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { - dir_t dir; - uint8_t w = 0; - - while (1) { - if (read(&dir, sizeof(dir)) != sizeof(dir)) return 0; - if (dir.name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entries for . and .. - if (dir.name[0] != DIR_NAME_DELETED && dir.name[0] != '.' - && DIR_IS_FILE_OR_SUBDIR(&dir)) break; - } - // indent for dir level - for (uint8_t i = 0; i < indent; i++) SERIAL_CHAR(' '); - - // print name - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) { - SERIAL_CHAR('.'); - w++; - } - SERIAL_CHAR(dir.name[i]); - w++; - } - if (DIR_IS_SUBDIR(&dir)) { - SERIAL_CHAR('/'); - w++; - } - if (flags & (LS_DATE | LS_SIZE)) { - while (w++ < 14) SERIAL_CHAR(' '); - } - // print modify date/time if requested - if (flags & LS_DATE) { - SERIAL_CHAR(' '); - printFatDate(dir.lastWriteDate); - SERIAL_CHAR(' '); - printFatTime(dir.lastWriteTime); - } - // print size if requested - if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) { - SERIAL_CHAR(' '); - SERIAL_ECHO(dir.fileSize); - } - SERIAL_EOL(); - return DIR_IS_FILE(&dir) ? 1 : 2; -} - -// Format directory name field from a 8.3 name string -bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { - uint8_t n = 7, // Max index until a dot is found - i = 11; - while (i) name[--i] = ' '; // Set whole FILENAME.EXT to spaces - while (*str && *str != '/') { // For each character, until nul or '/' - uint8_t c = *str++; // Get char and advance - if (c == '.') { // For a dot... - if (n == 10) return false; // Already moved the max index? fail! - n = 10; // Move the max index for full 8.3 name - i = 8; // Move up to the extension place - } - else { - // Fail for illegal characters - PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); - while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; - if (i > n || c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters - name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name - } - } - *ptr = str; // Set passed pointer to the end - return name[0] != ' '; // Return true if any name was set -} - -/** - * Make a new directory. - * - * \param[in] parent An open SdFat instance for the directory that will contain - * the new directory. - * - * \param[in] path A path with a valid 8.3 DOS name for the new directory. - * - * \param[in] pFlag Create missing parent directories if true. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a parent is not a - * directory, \a path is invalid or already exists in \a parent. - */ -bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile* sub = &dir1; - SdBaseFile* start = parent; - - if (!parent || isOpen()) return false; - - if (*path == '/') { - while (*path == '/') path++; - if (!parent->isRoot()) { - if (!dir2.openRoot(parent->vol_)) return false; - parent = &dir2; - } - } - while (1) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) { - if (!pFlag || !sub->mkdir(parent, dname)) - return false; - } - if (parent != start) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return mkdir(parent, dname); -} - -bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { - uint32_t block; - dir_t d; - dir_t* p; - - if (!parent->isDir()) return false; - - // create a normal file - if (!open(parent, dname, O_CREAT | O_EXCL | O_RDWR)) return false; - - // convert file to directory - flags_ = O_READ; - type_ = FAT_FILE_TYPE_SUBDIR; - - // allocate and zero first cluster - if (!addDirCluster()) return false; - - // force entry to SD - if (!sync()) return false; - - // cache entry - should already be in cache due to sync() call - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - - // change directory entry attribute - p->attributes = DIR_ATT_DIRECTORY; - - // make entry for '.' - memcpy(&d, p, sizeof(d)); - d.name[0] = '.'; - for (uint8_t i = 1; i < 11; i++) d.name[i] = ' '; - - // cache block for '.' and '..' - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - - // copy '.' to block - memcpy(&vol_->cache()->dir[0], &d, sizeof(d)); - - // make entry for '..' - d.name[1] = '.'; - if (parent->isRoot()) { - d.firstClusterLow = 0; - d.firstClusterHigh = 0; - } - else { - d.firstClusterLow = parent->firstCluster_ & 0xFFFF; - d.firstClusterHigh = parent->firstCluster_ >> 16; - } - // copy '..' to block - memcpy(&vol_->cache()->dir[1], &d, sizeof(d)); - - // write first block - return vol_->cacheFlush(); -} - -/** - * Open a file in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::open(const char* path, uint8_t oflag) { - return open(cwd_, path, oflag); -} - -/** - * Open a file or directory by name. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * O_READ - Open for reading. - * - * O_RDONLY - Same as O_READ. - * - * O_WRITE - Open for writing. - * - * O_WRONLY - Same as O_WRITE. - * - * O_RDWR - Open for reading and writing. - * - * O_APPEND - If set, the file offset shall be set to the end of the - * file prior to each write. - * - * O_AT_END - Set the initial position at the end of the file. - * - * O_CREAT - If the file exists, this flag has no effect except as noted - * under O_EXCL below. Otherwise, the file shall be created - * - * O_EXCL - If O_CREAT and O_EXCL are set, open() shall fail if the file exists. - * - * O_SYNC - Call sync() after each write. This flag should not be used with - * write(uint8_t), write_P(PGM_P), writeln_P(PGM_P), or the Arduino Print class. - * These functions do character at a time writes so sync() will be called - * after each byte. - * - * O_TRUNC - If the file exists and is a regular file, and the file is - * successfully opened and is not read only, its length shall be truncated to 0. - * - * WARNING: A given file must not be opened by more than one SdBaseFile object - * of file corruption may occur. - * - * \note Directory files must be opened read only. Write and truncation is - * not allowed for directory files. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a dirFile is not - * a directory, \a path is invalid, the file does not exist - * or can't be opened in the access mode specified by oflag. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile *parent = dirFile, *sub = &dir1; - - if (!dirFile || isOpen()) return false; - - if (*path == '/') { // Path starts with '/' - if (!dirFile->isRoot()) { // Is the passed dirFile the root? - if (!dir2.openRoot(dirFile->vol_)) return false; // Get the root in dir2, if possible - parent = &dir2; // Change 'parent' to point at the root dir - } - while (*path == '/') path++; // Skip all leading slashes - } - - for (;;) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) return false; - if (parent != dirFile) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return open(parent, dname, oflag); -} - -// open with filename in dname -bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { - bool emptyFound = false, fileFound = false; - uint8_t index; - dir_t* p; - - vol_ = dirFile->vol_; - - dirFile->rewind(); - // search for file - - while (dirFile->curPosition_ < dirFile->fileSize_) { - index = 0xF & (dirFile->curPosition_ >> 5); - p = dirFile->readDirCache(); - if (!p) return false; - - if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { - // remember first empty slot - if (!emptyFound) { - dirBlock_ = dirFile->vol_->cacheBlockNumber(); - dirIndex_ = index; - emptyFound = true; - } - // done if no entries follow - if (p->name[0] == DIR_NAME_FREE) break; - } - else if (!memcmp(dname, p->name, 11)) { - fileFound = true; - break; - } - } - if (fileFound) { - // don't open existing file if O_EXCL - if (oflag & O_EXCL) return false; - } - else { - // don't create unless O_CREAT and O_WRITE - if (!(oflag & O_CREAT) || !(oflag & O_WRITE)) return false; - if (emptyFound) { - index = dirIndex_; - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - } - else { - if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; - - // add and zero cluster for dirFile - first cluster is in cache for write - if (!dirFile->addDirCluster()) return false; - - // use first entry in cluster - p = dirFile->vol_->cache()->dir; - index = 0; - } - // initialize as empty file - memset(p, 0, sizeof(*p)); - memcpy(p->name, dname, 11); - - // set timestamps - if (dateTime_) { - // call user date/time function - dateTime_(&p->creationDate, &p->creationTime); - } - else { - // use default date/time - p->creationDate = FAT_DEFAULT_DATE; - p->creationTime = FAT_DEFAULT_TIME; - } - p->lastAccessDate = p->creationDate; - p->lastWriteDate = p->creationDate; - p->lastWriteTime = p->creationTime; - - // write entry to SD - if (!dirFile->vol_->cacheFlush()) return false; - } - // open entry in cache - return openCachedEntry(index, oflag); -} - -/** - * Open a file by index. - * - * \param[in] dirFile An open SdFat instance for the directory. - * - * \param[in] index The \a index of the directory entry for the file to be - * opened. The value for \a index is (directory file position)/32. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { - dir_t* p; - - vol_ = dirFile->vol_; - - // error if already open - if (isOpen() || !dirFile) return false; - - // don't open existing file if O_EXCL - user call error - if (oflag & O_EXCL) return false; - - // seek to location of entry - if (!dirFile->seekSet(32 * index)) return false; - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // error if empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_FREE || - p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - return false; - } - // open cached entry - return openCachedEntry(index & 0xF, oflag); -} - -// open a cached directory entry. Assumes vol_ is initialized -bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { - // location of entry in cache - dir_t* p = &vol_->cache()->dir[dirIndex]; - - // write or truncate is an error for a directory or read-only file - if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { - if (oflag & (O_WRITE | O_TRUNC)) goto FAIL; - } - // remember location of directory entry on SD - dirBlock_ = vol_->cacheBlockNumber(); - dirIndex_ = dirIndex; - - // copy first cluster number for directory fields - firstCluster_ = (uint32_t)p->firstClusterHigh << 16; - firstCluster_ |= p->firstClusterLow; - - // make sure it is a normal file or subdirectory - if (DIR_IS_FILE(p)) { - fileSize_ = p->fileSize; - type_ = FAT_FILE_TYPE_NORMAL; - } - else if (DIR_IS_SUBDIR(p)) { - if (!vol_->chainSize(firstCluster_, &fileSize_)) goto FAIL; - type_ = FAT_FILE_TYPE_SUBDIR; - } - else - goto FAIL; - - // save open flags for read/write - flags_ = oflag & F_OFLAG; - - // set to start of file - curCluster_ = 0; - curPosition_ = 0; - if ((oflag & O_TRUNC) && !truncate(0)) return false; - return oflag & O_AT_END ? seekEnd(0) : true; - - FAIL: - type_ = FAT_FILE_TYPE_CLOSED; - return false; -} - -/** - * Open the next file or subdirectory in a directory. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { - dir_t* p; - uint8_t index; - - if (!dirFile) return false; - - // error if already open - if (isOpen()) return false; - - vol_ = dirFile->vol_; - - while (1) { - index = 0xF & (dirFile->curPosition_ >> 5); - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // done if last entry - if (p->name[0] == DIR_NAME_FREE) return false; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - continue; - } - // must be file or dir - if (DIR_IS_FILE_OR_SUBDIR(p)) { - return openCachedEntry(index, oflag); - } - } - return false; -} - -#if 0 -/** - * Open a directory's parent directory. - * - * \param[in] dir Parent of this directory will be opened. Must not be root. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::openParent(SdBaseFile* dir) { - dir_t entry; - dir_t* p; - SdBaseFile file; - uint32_t c; - uint32_t cluster; - uint32_t lbn; - // error if already open or dir is root or dir is not a directory - if (isOpen() || !dir || dir->isRoot() || !dir->isDir()) return false; - vol_ = dir->vol_; - // position to '..' - if (!dir->seekSet(32)) return false; - // read '..' entry - if (dir->read(&entry, sizeof(entry)) != 32) return false; - // verify it is '..' - if (entry.name[0] != '.' || entry.name[1] != '.') return false; - // start cluster for '..' - cluster = entry.firstClusterLow; - cluster |= (uint32_t)entry.firstClusterHigh << 16; - if (cluster == 0) return openRoot(vol_); - // start block for '..' - lbn = vol_->clusterStartBlock(cluster); - // first block of parent dir - if (!vol_->cacheRawBlock(lbn, SdVolume::CACHE_FOR_READ)) return false; - - p = &vol_->cacheBuffer_.dir[1]; - // verify name for '../..' - if (p->name[0] != '.' || p->name[1] != '.') return false; - // '..' is pointer to first cluster of parent. open '../..' to find parent - if (p->firstClusterHigh == 0 && p->firstClusterLow == 0) { - if (!file.openRoot(dir->volume())) return false; - } - else if (!file.openCachedEntry(1, O_READ)) - return false; - - // search for parent in '../..' - do { - if (file.readDir(&entry, NULL) != 32) return false; - c = entry.firstClusterLow; - c |= (uint32_t)entry.firstClusterHigh << 16; - } while (c != cluster); - - // open parent - return open(&file, file.curPosition() / 32 - 1, O_READ); -} -#endif - -/** - * Open a volume's root directory. - * - * \param[in] vol The FAT volume containing the root directory to be opened. - * - * \return true for success, false for failure. - * Reasons for failure include the file is already open, the FAT volume has - * not been initialized or it a FAT12 volume. - */ -bool SdBaseFile::openRoot(SdVolume* vol) { - // error if file is already open - if (isOpen()) return false; - - if (vol->fatType() == 16 || (FAT12_SUPPORT && vol->fatType() == 12)) { - type_ = FAT_FILE_TYPE_ROOT_FIXED; - firstCluster_ = 0; - fileSize_ = 32 * vol->rootDirEntryCount(); - } - else if (vol->fatType() == 32) { - type_ = FAT_FILE_TYPE_ROOT32; - firstCluster_ = vol->rootDirStart(); - if (!vol->chainSize(firstCluster_, &fileSize_)) return false; - } - else // volume is not initialized, invalid, or FAT12 without support - return false; - - vol_ = vol; - // read only - flags_ = O_READ; - - // set to start of file - curCluster_ = curPosition_ = 0; - - // root has no directory entry - dirBlock_ = dirIndex_ = 0; - return true; -} - -/** - * Return the next available byte without consuming it. - * - * \return The byte if no error and not at eof else -1; - */ -int SdBaseFile::peek() { - filepos_t pos; - getpos(&pos); - int c = read(); - if (c >= 0) setpos(&pos); - return c; -} - -// print uint8_t with width 2 -static void print2u(const uint8_t v) { - if (v < 10) SERIAL_CHAR('0'); - SERIAL_ECHO_F(v, DEC); -} - -/** - * %Print a directory date field to Serial. - * - * Format is yyyy-mm-dd. - * - * \param[in] fatDate The date field from a directory entry. - */ - - -/** - * %Print a directory date field. - * - * Format is yyyy-mm-dd. - * - * \param[in] pr Print stream for output. - * \param[in] fatDate The date field from a directory entry. - */ -void SdBaseFile::printFatDate(uint16_t fatDate) { - SERIAL_ECHO(FAT_YEAR(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_MONTH(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_DAY(fatDate)); -} - - -/** - * %Print a directory time field. - * - * Format is hh:mm:ss. - * - * \param[in] pr Print stream for output. - * \param[in] fatTime The time field from a directory entry. - */ -void SdBaseFile::printFatTime(uint16_t fatTime) { - print2u(FAT_HOUR(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_MINUTE(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_SECOND(fatTime)); -} - -/** - * Print a file's name to Serial - * - * \return true for success, false for failure. - */ -bool SdBaseFile::printName() { - char name[FILENAME_LENGTH]; - if (!getFilename(name)) return false; - SERIAL_ECHO(name); - return true; -} - -/** - * Read the next byte from a file. - * - * \return For success read returns the next byte in the file as an int. - * If an error occurs or end of file is reached -1 is returned. - */ -int16_t SdBaseFile::read() { - uint8_t b; - return read(&b, 1) == 1 ? b : -1; -} - -/** - * Read data from a file starting at the current position. - * - * \param[out] buf Pointer to the location that will receive the data. - * - * \param[in] nbyte Maximum number of bytes to read. - * - * \return For success read() returns the number of bytes read. - * A value less than \a nbyte, including zero, will be returned - * if end of file is reached. - * If an error occurs, read() returns -1. Possible errors include - * read() called before a file has been opened, corrupt file system - * or an I/O error occurred. - */ -int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { - uint8_t* dst = reinterpret_cast(buf); - uint16_t offset, toRead; - uint32_t block; // raw device block number - - // error if not open or write only - if (!isOpen() || !(flags_ & O_READ)) return -1; - - // max bytes left in file - NOMORE(nbyte, fileSize_ - curPosition_); - - // amount left to read - toRead = nbyte; - while (toRead > 0) { - offset = curPosition_ & 0x1FF; // offset in block - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - block = vol_->rootDirStart() + (curPosition_ >> 9); - } - else { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - if (offset == 0 && blockOfCluster == 0) { - // start of new cluster - if (curPosition_ == 0) - curCluster_ = firstCluster_; // use first cluster in file - else if (!vol_->fatGet(curCluster_, &curCluster_)) // get next cluster from FAT - return -1; - } - block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - } - uint16_t n = toRead; - - // amount to be read from current block - NOMORE(n, 512 - offset); - - // no buffering needed if n == 512 - if (n == 512 && block != vol_->cacheBlockNumber()) { - if (!vol_->readBlock(block, dst)) return -1; - } - else { - // read block to cache and copy data to caller - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return -1; - uint8_t* src = vol_->cache()->data + offset; - memcpy(dst, src, n); - } - dst += n; - curPosition_ += n; - toRead -= n; - } - return nbyte; -} - -/** - * Read the next entry in a directory. - * - * \param[out] dir The dir_t struct that will receive the data. - * - * \return For success readDir() returns the number of bytes read. - * A value of zero will be returned if end of file is reached. - * If an error occurs, readDir() returns -1. Possible errors include - * readDir() called before a directory has been opened, this is not - * a directory file or an I/O error occurred. - */ -int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { - int16_t n; - // if not a directory file or miss-positioned return an error - if (!isDir() || (0x1F & curPosition_)) return -1; - - // If we have a longFilename buffer, mark it as invalid. - // If a long filename is found it will be filled automatically. - if (longFilename) longFilename[0] = '\0'; - - while (1) { - - n = read(dir, sizeof(dir_t)); - if (n != sizeof(dir_t)) return n ? -1 : 0; - - // last entry if DIR_NAME_FREE - if (dir->name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entry for . and .. - if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') { - if (longFilename) longFilename[0] = '\0'; // Invalidate erased file long name, if any - continue; - } - - // Fill the long filename if we have a long filename entry. - // Long filename entries are stored before the short filename. - if (longFilename && DIR_IS_LONG_NAME(dir)) { - vfat_t* VFAT = (vfat_t*)dir; - // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 - if (VFAT->firstClusterLow == 0) { - const uint8_t seq = VFAT->sequenceNumber & 0x1F; - if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { - // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table. - n = (seq - 1) * (FILENAME_LENGTH); - for (uint8_t i = 0; i < FILENAME_LENGTH; i++) - longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; - // If this VFAT entry is the last one, add a NUL terminator at the end of the string - if (VFAT->sequenceNumber & 0x40) longFilename[n + FILENAME_LENGTH] = '\0'; - } - } - } - // Return if normal file or subdirectory - if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; - } -} - - -// Read next directory entry into the cache -// Assumes file is correctly positioned -dir_t* SdBaseFile::readDirCache() { - uint8_t i; - // error if not directory - if (!isDir()) return 0; - - // index of entry in cache - i = (curPosition_ >> 5) & 0xF; - - // use read to locate and cache block - if (read() < 0) return 0; - - // advance to next entry - curPosition_ += 31; - - // return pointer to entry - return vol_->cache()->dir + i; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file read-only, is a directory, - * or an I/O error occurred. - */ -bool SdBaseFile::remove() { - dir_t* d; - // free any clusters - will fail if read-only or directory - if (!truncate(0)) return false; - - // cache directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // set this file closed - type_ = FAT_FILE_TYPE_CLOSED; - - // write entry to SD - return vol_->cacheFlush(); - return true; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \param[in] dirFile The directory that contains the file. - * \param[in] path Path for the file to be removed. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file is a directory, is read only, - * \a dirFile is not a directory, \a path is not found - * or an I/O error occurred. - */ -bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { - SdBaseFile file; - return file.open(dirFile, path, O_WRITE) ? file.remove() : false; -} - -/** - * Rename a file or subdirectory. - * - * \param[in] dirFile Directory for the new path. - * \param[in] newPath New path name for the file/directory. - * - * \return true for success, false for failure. - * Reasons for failure include \a dirFile is not open or is not a directory - * file, newPath is invalid or already exists, or an I/O error occurs. - */ -bool SdBaseFile::rename(SdBaseFile* dirFile, const char* newPath) { - dir_t entry; - uint32_t dirCluster = 0; - SdBaseFile file; - dir_t* d; - - // must be an open file or subdirectory - if (!(isFile() || isSubDir())) return false; - - // can't move file - if (vol_ != dirFile->vol_) return false; - - // sync() and cache directory entry - sync(); - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // save directory entry - memcpy(&entry, d, sizeof(entry)); - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // make directory entry for new path - if (isFile()) { - if (!file.open(dirFile, newPath, O_CREAT | O_EXCL | O_WRITE)) { - goto restore; - } - } - else { - // don't create missing path prefix components - if (!file.mkdir(dirFile, newPath, false)) { - goto restore; - } - // save cluster containing new dot dot - dirCluster = file.firstCluster_; - } - // change to new directory entry - dirBlock_ = file.dirBlock_; - dirIndex_ = file.dirIndex_; - - // mark closed to avoid possible destructor close call - file.type_ = FAT_FILE_TYPE_CLOSED; - - // cache new directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy all but name field to new directory entry - memcpy(&d->attributes, &entry.attributes, sizeof(entry) - sizeof(d->name)); - - // update dot dot if directory - if (dirCluster) { - // get new dot dot - uint32_t block = vol_->clusterStartBlock(dirCluster); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return false; - memcpy(&entry, &vol_->cache()->dir[1], sizeof(entry)); - - // free unused cluster - if (!vol_->freeChain(dirCluster)) return false; - - // store new dot dot - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - memcpy(&vol_->cache()->dir[1], &entry, sizeof(entry)); - } - return vol_->cacheFlush(); - -restore: - if ((d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE))) { - // restore entry - d->name[0] = entry.name[0]; - vol_->cacheFlush(); - } - return false; -} - -/** - * Remove a directory file. - * - * The directory file will be removed only if it is empty and is not the - * root directory. rmdir() follows DOS and Windows and ignores the - * read-only attribute for the directory. - * - * \note This function should not be used to delete the 8.3 version of a - * directory that has a long name. For example if a directory has the - * long name "New folder" you should not delete the 8.3 name "NEWFOL~1". - * - * \return true for success, false for failure. - * Reasons for failure include the file is not a directory, is the root - * directory, is not empty, or an I/O error occurred. - */ -bool SdBaseFile::rmdir() { - // must be open subdirectory - if (!isSubDir()) return false; - - rewind(); - - // make sure directory is empty - while (curPosition_ < fileSize_) { - dir_t* p = readDirCache(); - if (!p) return false; - // done if past last used entry - if (p->name[0] == DIR_NAME_FREE) break; - // skip empty slot, '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - // error not empty - if (DIR_IS_FILE_OR_SUBDIR(p)) return false; - } - // convert empty directory to normal file for remove - type_ = FAT_FILE_TYPE_NORMAL; - flags_ |= O_WRITE; - return remove(); -} - -/** - * Recursively delete a directory and all contained files. - * - * This is like the Unix/Linux 'rm -rf *' if called with the root directory - * hence the name. - * - * Warning - This will remove all contents of the directory including - * subdirectories. The directory will then be removed if it is not root. - * The read-only attribute for files will be ignored. - * - * \note This function should not be used to delete the 8.3 version of - * a directory that has a long name. See remove() and rmdir(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::rmRfStar() { - uint32_t index; - SdBaseFile f; - rewind(); - while (curPosition_ < fileSize_) { - // remember position - index = curPosition_ / 32; - - dir_t* p = readDirCache(); - if (!p) return false; - - // done if past last entry - if (p->name[0] == DIR_NAME_FREE) break; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - - // skip if part of long file name or volume label in root - if (!DIR_IS_FILE_OR_SUBDIR(p)) continue; - - if (!f.open(this, index, O_READ)) return false; - if (f.isSubDir()) { - // recursively delete - if (!f.rmRfStar()) return false; - } - else { - // ignore read-only - f.flags_ |= O_WRITE; - if (!f.remove()) return false; - } - // position to next entry if required - if (curPosition_ != (32 * (index + 1))) { - if (!seekSet(32 * (index + 1))) return false; - } - } - // don't try to delete root - if (!isRoot()) { - if (!rmdir()) return false; - } - return true; -} - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdBaseFile::SdBaseFile(const char* path, uint8_t oflag) { - type_ = FAT_FILE_TYPE_CLOSED; - writeError = false; - open(path, oflag); -} - -/** - * Sets a file's position. - * - * \param[in] pos The new position in bytes from the beginning of the file. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::seekSet(const uint32_t pos) { - uint32_t nCur, nNew; - // error if file not open or seek past end of file - if (!isOpen() || pos > fileSize_) return false; - - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - curPosition_ = pos; - return true; - } - if (pos == 0) { - curCluster_ = curPosition_ = 0; // set position to start of file - return true; - } - - // calculate cluster index for cur and new position - nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); - nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); - - if (nNew < nCur || curPosition_ == 0) - curCluster_ = firstCluster_; // must follow chain from first cluster - else - nNew -= nCur; // advance from curPosition - - while (nNew--) - if (!vol_->fatGet(curCluster_, &curCluster_)) return false; - - curPosition_ = pos; - return true; -} - -void SdBaseFile::setpos(filepos_t* pos) { - curPosition_ = pos->position; - curCluster_ = pos->cluster; -} - -/** - * The sync() call causes all modified data and directory fields - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include a call to sync() before a file has been - * opened or an I/O error. - */ -bool SdBaseFile::sync() { - // only allow open files and directories - if (!isOpen()) goto FAIL; - - if (flags_ & F_FILE_DIR_DIRTY) { - dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - // check for deleted by another open file object - if (!d || d->name[0] == DIR_NAME_DELETED) goto FAIL; - - // do not set filesize for dir files - if (!isDir()) d->fileSize = fileSize_; - - // update first cluster fields - d->firstClusterLow = firstCluster_ & 0xFFFF; - d->firstClusterHigh = firstCluster_ >> 16; - - // set modify time if user supplied a callback date/time function - if (dateTime_) { - dateTime_(&d->lastWriteDate, &d->lastWriteTime); - d->lastAccessDate = d->lastWriteDate; - } - // clear directory dirty - flags_ &= ~F_FILE_DIR_DIRTY; - } - return vol_->cacheFlush(); - - FAIL: - writeError = true; - return false; -} - -/** - * Copy a file's timestamps - * - * \param[in] file File to copy timestamps from. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(SdBaseFile* file) { - dir_t* d; - dir_t dir; - - // get timestamps - if (!file->dirEntry(&dir)) return false; - - // update directory fields - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy timestamps - d->lastAccessDate = dir.lastAccessDate; - d->creationDate = dir.creationDate; - d->creationTime = dir.creationTime; - d->creationTimeTenths = dir.creationTimeTenths; - d->lastWriteDate = dir.lastWriteDate; - d->lastWriteTime = dir.lastWriteTime; - - // write back entry - return vol_->cacheFlush(); -} - -/** - * Set a file's timestamps in its directory entry. - * - * \param[in] flags Values for \a flags are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * T_ACCESS - Set the file's last access date. - * - * T_CREATE - Set the file's creation date and time. - * - * T_WRITE - Set the file's last write/modification date and time. - * - * \param[in] year Valid range 1980 - 2107 inclusive. - * - * \param[in] month Valid range 1 - 12 inclusive. - * - * \param[in] day Valid range 1 - 31 inclusive. - * - * \param[in] hour Valid range 0 - 23 inclusive. - * - * \param[in] minute Valid range 0 - 59 inclusive. - * - * \param[in] second Valid range 0 - 59 inclusive - * - * \note It is possible to set an invalid date since there is no check for - * the number of days in a month. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, - uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { - uint16_t dirDate, dirTime; - dir_t* d; - - if (!isOpen() - || year < 1980 - || year > 2107 - || month < 1 - || month > 12 - || day < 1 - || day > 31 - || hour > 23 - || minute > 59 - || second > 59) { - return false; - } - // update directory entry - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - dirDate = FAT_DATE(year, month, day); - dirTime = FAT_TIME(hour, minute, second); - if (flags & T_ACCESS) { - d->lastAccessDate = dirDate; - } - if (flags & T_CREATE) { - d->creationDate = dirDate; - d->creationTime = dirTime; - // seems to be units of 1/100 second not 1/10 as Microsoft states - d->creationTimeTenths = second & 1 ? 100 : 0; - } - if (flags & T_WRITE) { - d->lastWriteDate = dirDate; - d->lastWriteTime = dirTime; - } - return vol_->cacheFlush(); -} - -/** - * Truncate a file to a specified length. The current file position - * will be maintained if it is less than or equal to \a length otherwise - * it will be set to end of file. - * - * \param[in] length The desired length for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is read only, file is a directory, - * \a length is greater than the current file size or an I/O error occurs. - */ -bool SdBaseFile::truncate(uint32_t length) { - uint32_t newPos; - // error if not a normal file or read-only - if (!isFile() || !(flags_ & O_WRITE)) return false; - - // error if length is greater than current size - if (length > fileSize_) return false; - - // fileSize and length are zero - nothing to do - if (fileSize_ == 0) return true; - - // remember position for seek after truncation - newPos = curPosition_ > length ? length : curPosition_; - - // position to last cluster in truncated file - if (!seekSet(length)) return false; - - if (length == 0) { - // free all clusters - if (!vol_->freeChain(firstCluster_)) return false; - firstCluster_ = 0; - } - else { - uint32_t toFree; - if (!vol_->fatGet(curCluster_, &toFree)) return false; - - if (!vol_->isEOC(toFree)) { - // free extra clusters - if (!vol_->freeChain(toFree)) return false; - - // current cluster is end of chain - if (!vol_->fatPutEOC(curCluster_)) return false; - } - } - fileSize_ = length; - - // need to update directory entry - flags_ |= F_FILE_DIR_DIRTY; - - if (!sync()) return false; - - // set file to correct position - return seekSet(newPos); -} - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { - // convert void* to uint8_t* - must be before goto statements - const uint8_t* src = reinterpret_cast(buf); - - // number of bytes left to write - must be before goto statements - uint16_t nToWrite = nbyte; - - // error if not a normal file or is read-only - if (!isFile() || !(flags_ & O_WRITE)) goto FAIL; - - // seek to end of file if append flag - if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { - if (!seekEnd()) goto FAIL; - } - - while (nToWrite > 0) { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - uint16_t blockOffset = curPosition_ & 0x1FF; - if (blockOfCluster == 0 && blockOffset == 0) { - // start of new cluster - if (curCluster_ == 0) { - if (firstCluster_ == 0) { - // allocate first cluster of file - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = firstCluster_; - } - } - else { - uint32_t next; - if (!vol_->fatGet(curCluster_, &next)) goto FAIL; - if (vol_->isEOC(next)) { - // add cluster if at end of chain - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = next; - } - } - } - // max space in block - uint16_t n = 512 - blockOffset; - - // lesser of space and amount to write - NOMORE(n, nToWrite); - - // block for data write - uint32_t block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - if (n == 512) { - // full block - don't need to use cache - if (vol_->cacheBlockNumber() == block) { - // invalidate cache if block is in cache - vol_->cacheSetBlockNumber(0xFFFFFFFF, false); - } - if (!vol_->writeBlock(block, src)) goto FAIL; - } - else { - if (blockOffset == 0 && curPosition_ >= fileSize_) { - // start of new block don't need to read into cache - if (!vol_->cacheFlush()) goto FAIL; - // set cache dirty and SD address of block - vol_->cacheSetBlockNumber(block, true); - } - else { - // rewrite part of block - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto FAIL; - } - uint8_t* dst = vol_->cache()->data + blockOffset; - memcpy(dst, src, n); - } - curPosition_ += n; - src += n; - nToWrite -= n; - } - if (curPosition_ > fileSize_) { - // update fileSize and insure sync will update dir entry - fileSize_ = curPosition_; - flags_ |= F_FILE_DIR_DIRTY; - } - else if (dateTime_ && nbyte) { - // insure sync will update modified date and time - flags_ |= F_FILE_DIR_DIRTY; - } - - if (flags_ & O_SYNC) { - if (!sync()) goto FAIL; - } - return nbyte; - - FAIL: - // return for write error - writeError = true; - return -1; -} - -#endif // SDSUPPORT diff --git a/Marlin/SdBaseFile.h b/Marlin/SdBaseFile.h deleted file mode 100644 index 12216bdc3c..0000000000 --- a/Marlin/SdBaseFile.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdBaseFile class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDBASEFILE_H_ -#define _SDBASEFILE_H_ - -#include "SdFatConfig.h" -#include "SdVolume.h" - -#include - -/** - * \struct filepos_t - * \brief internal type for istream - * do not use in user apps - */ -struct filepos_t { - uint32_t position; // stream byte position - uint32_t cluster; // cluster of position - filepos_t() : position(0), cluster(0) {} -}; - -// use the gnu style oflag in open() -uint8_t const O_READ = 0x01, // open() oflag for reading - O_RDONLY = O_READ, // open() oflag - same as O_IN - O_WRITE = 0x02, // open() oflag for write - O_WRONLY = O_WRITE, // open() oflag - same as O_WRITE - O_RDWR = (O_READ | O_WRITE), // open() oflag for reading and writing - O_ACCMODE = (O_READ | O_WRITE), // open() oflag mask for access modes - O_APPEND = 0x04, // The file offset shall be set to the end of the file prior to each write. - O_SYNC = 0x08, // Synchronous writes - call sync() after each write - O_TRUNC = 0x10, // Truncate the file to zero length - O_AT_END = 0x20, // Set the initial position at the end of the file - O_CREAT = 0x40, // Create the file if nonexistent - O_EXCL = 0x80; // If O_CREAT and O_EXCL are set, open() shall fail if the file exists - -// SdBaseFile class static and const definitions - -// flags for ls() -uint8_t const LS_DATE = 1, // ls() flag to print modify date - LS_SIZE = 2, // ls() flag to print file size - LS_R = 4; // ls() flag for recursive list of subdirectories - - -// flags for timestamp -uint8_t const T_ACCESS = 1, // Set the file's last access date - T_CREATE = 2, // Set the file's creation date and time - T_WRITE = 4; // Set the file's write date and time - -// values for type_ -uint8_t const FAT_FILE_TYPE_CLOSED = 0, // This file has not been opened. - FAT_FILE_TYPE_NORMAL = 1, // A normal file - FAT_FILE_TYPE_ROOT_FIXED = 2, // A FAT12 or FAT16 root directory - FAT_FILE_TYPE_ROOT32 = 3, // A FAT32 root directory - FAT_FILE_TYPE_SUBDIR = 4, // A subdirectory file - FAT_FILE_TYPE_MIN_DIR = FAT_FILE_TYPE_ROOT_FIXED; // Test value for directory type - -/** - * date field for FAT directory entry - * \param[in] year [1980,2107] - * \param[in] month [1,12] - * \param[in] day [1,31] - * - * \return Packed date for dir_t entry. - */ -static inline uint16_t FAT_DATE(uint16_t year, uint8_t month, uint8_t day) { return (year - 1980) << 9 | month << 5 | day; } - -/** - * year part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted year [1980,2107] - */ -static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9); } - -/** - * month part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted month [1,12] - */ -static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0XF; } - -/** - * day part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted day [1,31] - */ -static inline uint8_t FAT_DAY(uint16_t fatDate) { return fatDate & 0x1F; } - -/** - * time field for FAT directory entry - * \param[in] hour [0,23] - * \param[in] minute [0,59] - * \param[in] second [0,59] - * - * \return Packed time for dir_t entry. - */ -static inline uint16_t FAT_TIME(uint8_t hour, uint8_t minute, uint8_t second) { return hour << 11 | minute << 5 | second >> 1; } - -/** - * hour part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted hour [0,23] - */ -static inline uint8_t FAT_HOUR(uint16_t fatTime) { return fatTime >> 11; } - -/** - * minute part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted minute [0,59] - */ -static inline uint8_t FAT_MINUTE(uint16_t fatTime) { return (fatTime >> 5) & 0x3F; } - -/** - * second part of FAT directory time field - * Note second/2 is stored in packed time. - * - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted second [0,58] - */ -static inline uint8_t FAT_SECOND(uint16_t fatTime) { return 2 * (fatTime & 0x1F); } - -// Default date for file timestamps is 1 Jan 2000 -uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1; -// Default time for file timestamp is 1 am -uint16_t const FAT_DEFAULT_TIME = (1 << 11); - -/** - * \class SdBaseFile - * \brief Base class for SdFile with Print and C++ streams. - */ -class SdBaseFile { - public: - SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} - SdBaseFile(const char* path, uint8_t oflag); - ~SdBaseFile() { if (isOpen()) close(); } - - /** - * writeError is set to true if an error occurs during a write(). - * Set writeError to false before calling print() and/or write() and check - * for true after calls to print() and/or write(). - */ - bool writeError; - - // helpers for stream classes - - /** - * get position for streams - * \param[out] pos struct to receive position - */ - void getpos(filepos_t* pos); - - /** - * set position for streams - * \param[out] pos struct with value for new position - */ - void setpos(filepos_t* pos); - - bool close(); - bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); - bool createContiguous(SdBaseFile* dirFile, - const char* path, uint32_t size); - /** - * \return The current cluster number for a file or directory. - */ - uint32_t curCluster() const { return curCluster_; } - - /** - * \return The current position for a file or directory. - */ - uint32_t curPosition() const { return curPosition_; } - - /** - * \return Current working directory - */ - static SdBaseFile* cwd() { return cwd_; } - - /** - * Set the date/time callback function - * - * \param[in] dateTime The user's call back function. The callback - * function is of the form: - * - * \code - * void dateTime(uint16_t* date, uint16_t* time) { - * uint16_t year; - * uint8_t month, day, hour, minute, second; - * - * // User gets date and time from GPS or real-time clock here - * - * // return date using FAT_DATE macro to format fields - * *date = FAT_DATE(year, month, day); - * - * // return time using FAT_TIME macro to format fields - * *time = FAT_TIME(hour, minute, second); - * } - * \endcode - * - * Sets the function that is called when a file is created or when - * a file's directory entry is modified by sync(). All timestamps, - * access, creation, and modify, are set when a file is created. - * sync() maintains the last access date and last modify date/time. - * - * See the timestamp() function. - */ - static void dateTimeCallback( - void (*dateTime)(uint16_t* date, uint16_t* time)) { - dateTime_ = dateTime; - } - - /** - * Cancel the date/time callback function. - */ - static void dateTimeCallbackCancel() { dateTime_ = 0; } - bool dirEntry(dir_t* dir); - static void dirName(const dir_t& dir, char* name); - bool exists(const char* name); - int16_t fgets(char* str, int16_t num, char* delim = 0); - - /** - * \return The total number of bytes in a file or directory. - */ - uint32_t fileSize() const { return fileSize_; } - - /** - * \return The first cluster number for a file or directory. - */ - uint32_t firstCluster() const { return firstCluster_; } - - /** - * \return True if this is a directory else false. - */ - bool isDir() const { return type_ >= FAT_FILE_TYPE_MIN_DIR; } - - /** - * \return True if this is a normal file else false. - */ - bool isFile() const { return type_ == FAT_FILE_TYPE_NORMAL; } - - /** - * \return True if this is an open file/directory else false. - */ - bool isOpen() const { return type_ != FAT_FILE_TYPE_CLOSED; } - - /** - * \return True if this is a subdirectory else false. - */ - bool isSubDir() const { return type_ == FAT_FILE_TYPE_SUBDIR; } - - /** - * \return True if this is the root directory. - */ - bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - - bool getFilename(char * const name); - void ls(uint8_t flags = 0, uint8_t indent = 0); - - bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); - bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag); - bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag); - bool open(const char* path, uint8_t oflag = O_READ); - bool openNext(SdBaseFile* dirFile, uint8_t oflag); - bool openRoot(SdVolume* vol); - int peek(); - static void printFatDate(uint16_t fatDate); - static void printFatTime(uint16_t fatTime); - bool printName(); - int16_t read(); - int16_t read(void* buf, uint16_t nbyte); - int8_t readDir(dir_t* dir, char* longFilename); - static bool remove(SdBaseFile* dirFile, const char* path); - bool remove(); - - /** - * Set the file's current position to zero. - */ - void rewind() { seekSet(0); } - bool rename(SdBaseFile* dirFile, const char* newPath); - bool rmdir(); - bool rmRfStar(); - - /** - * Set the files position to current position + \a pos. See seekSet(). - * \param[in] offset The new position in bytes from the current position. - * \return true for success or false for failure. - */ - bool seekCur(const int32_t offset) { return seekSet(curPosition_ + offset); } - - /** - * Set the files position to end-of-file + \a offset. See seekSet(). - * \param[in] offset The new position in bytes from end-of-file. - * \return true for success or false for failure. - */ - bool seekEnd(const int32_t offset = 0) { return seekSet(fileSize_ + offset); } - bool seekSet(const uint32_t pos); - bool sync(); - bool timestamp(SdBaseFile* file); - bool timestamp(uint8_t flag, uint16_t year, uint8_t month, uint8_t day, - uint8_t hour, uint8_t minute, uint8_t second); - - /** - * Type of file. Use isFile() or isDir() instead of type() if possible. - * - * \return The file or directory type. - */ - uint8_t type() const { return type_; } - bool truncate(uint32_t size); - - /** - * \return SdVolume that contains this file. - */ - SdVolume* volume() const { return vol_; } - int16_t write(const void* buf, uint16_t nbyte); - - private: - friend class SdFat; // allow SdFat to set cwd_ - static SdBaseFile* cwd_; // global pointer to cwd dir - - // data time callback function - static void (*dateTime_)(uint16_t* date, uint16_t* time); - - // bits defined in flags_ - static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC), // should be 0x0F - F_FILE_DIR_DIRTY = 0x80; // sync of directory entry required - - // private data - uint8_t flags_; // See above for definition of flags_ bits - uint8_t fstate_; // error and eof indicator - uint8_t type_; // type of file see above for values - uint32_t curCluster_; // cluster for current file position - uint32_t curPosition_; // current file position in bytes from beginning - uint32_t dirBlock_; // block for this files directory entry - uint8_t dirIndex_; // index of directory entry in dirBlock - uint32_t fileSize_; // file size in bytes - uint32_t firstCluster_; // first cluster of file - SdVolume* vol_; // volume where file is located - - /** - * EXPERIMENTAL - Don't use! - */ - //bool openParent(SdBaseFile* dir); - - // private functions - bool addCluster(); - bool addDirCluster(); - dir_t* cacheDirEntry(uint8_t action); - int8_t lsPrintNext(uint8_t flags, uint8_t indent); - static bool make83Name(const char* str, uint8_t* name, const char** ptr); - bool mkdir(SdBaseFile* parent, const uint8_t dname[11]); - bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); - bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); - dir_t* readDirCache(); -}; - -#endif // _SDBASEFILE_H_ diff --git a/Marlin/SdFatConfig.h b/Marlin/SdFatConfig.h deleted file mode 100644 index cfa5e34d18..0000000000 --- a/Marlin/SdFatConfig.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * SdFatConfig.h - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#ifndef _SDFATCONFIG_H_ -#define _SDFATCONFIG_H_ - -#include "MarlinConfig.h" - -/** - * To use multiple SD cards set USE_MULTIPLE_CARDS nonzero. - * - * Using multiple cards costs 400 - 500 bytes of flash. - * - * Each card requires about 550 bytes of SRAM so use of a Mega is recommended. - */ -#define USE_MULTIPLE_CARDS 0 - -/** - * Call flush for endl if ENDL_CALLS_FLUSH is nonzero - * - * The standard for iostreams is to call flush. This is very costly for - * SdFat. Each call to flush causes 2048 bytes of I/O to the SD. - * - * SdFat has a single 512 byte buffer for SD I/O so it must write the current - * data block to the SD, read the directory block from the SD, update the - * directory entry, write the directory block to the SD and read the data - * block back into the buffer. - * - * The SD flash memory controller is not designed for this many rewrites - * so performance may be reduced by more than a factor of 100. - * - * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force - * all data to be written to the SD. - */ -#define ENDL_CALLS_FLUSH 0 - -/** - * Allow FAT12 volumes if FAT12_SUPPORT is nonzero. - * FAT12 has not been well tested. - */ -#define FAT12_SUPPORT 0 - -/** - * SPI init rate for SD initialization commands. Must be 5 (F_CPU/64) - * or 6 (F_CPU/128). - */ -#define SPI_SD_INIT_RATE 5 - -/** - * Set the SS pin high for hardware SPI. If SS is chip select for another SPI - * device this will disable that device during the SD init phase. - */ -#define SET_SPI_SS_HIGH 1 - -/** - * Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos. - * Pins used are SS 10, MOSI 11, MISO 12, and SCK 13. - * - * MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used - * on Mega Arduinos. Software SPI works well with GPS Shield V1.1 - * but many SD cards will fail with GPS Shield V1.0. - */ -#define MEGA_SOFT_SPI 0 - -// Set USE_SOFTWARE_SPI nonzero to ALWAYS use Software SPI. -#define USE_SOFTWARE_SPI 0 - -// Define software SPI pins so Mega can use unmodified 168/328 shields -#define SOFT_SPI_CS_PIN 10 // Software SPI chip select pin for the SD -#define SOFT_SPI_MOSI_PIN 11 // Software SPI Master Out Slave In pin -#define SOFT_SPI_MISO_PIN 12 // Software SPI Master In Slave Out pin -#define SOFT_SPI_SCK_PIN 13 // Software SPI Clock pin - -/** - * The __cxa_pure_virtual function is an error handler that is invoked when - * a pure virtual function is called. - */ -#define USE_CXA_PURE_VIRTUAL 1 - -/** - * Defines for 8.3 and long (vfat) filenames - */ - -#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry - -// Total bytes needed to store a single long filename -#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1) - -#endif // _SDFATCONFIG_H_ diff --git a/Marlin/SdFatStructs.h b/Marlin/SdFatStructs.h deleted file mode 100644 index 7257f3617a..0000000000 --- a/Marlin/SdFatStructs.h +++ /dev/null @@ -1,615 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief FAT file structures - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef SDFATSTRUCTS_H -#define SDFATSTRUCTS_H - -#define PACKED __attribute__((__packed__)) - -/** - * mostly from Microsoft document fatgen103.doc - * http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx - */ - -uint8_t const BOOTSIG0 = 0x55, // Value for byte 510 of boot block or MBR - BOOTSIG1 = 0xAA, // Value for byte 511 of boot block or MBR - EXTENDED_BOOT_SIG = 0x29; // Value for bootSignature field int FAT/FAT32 boot sector - -/** - * \struct partitionTable - * \brief MBR partition table entry - * - * A partition table entry for a MBR formatted storage device. - * The MBR partition table has four entries. - */ -struct partitionTable { - /** - * Boot Indicator . Indicates whether the volume is the active - * partition. Legal values include: 0x00. Do not use for booting. - * 0x80 Active partition. - */ - uint8_t boot; - /** - * Head part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t beginHead; - /** - * Sector part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned beginSector : 6; - /** High bits cylinder for first block in partition. */ - unsigned beginCylinderHigh : 2; - /** - * Combine beginCylinderLow with beginCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t beginCylinderLow; - /** - * Partition type. See defines that begin with PART_TYPE_ for - * some Microsoft partition types. - */ - uint8_t type; - /** - * head part of cylinder-head-sector address of the last sector in the - * partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t endHead; - /** - * Sector part of cylinder-head-sector address of the last sector in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned endSector : 6; - /** High bits of end cylinder */ - unsigned endCylinderHigh : 2; - /** - * Combine endCylinderLow with endCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t endCylinderLow; - - uint32_t firstSector; // Logical block address of the first block in the partition. - uint32_t totalSectors; // Length of the partition, in blocks. -} PACKED; - -typedef struct partitionTable part_t; // Type name for partitionTable - -/** - * \struct masterBootRecord - * - * \brief Master Boot Record - * - * The first block of a storage device that is formatted with a MBR. - */ -struct masterBootRecord { - uint8_t codeArea[440]; // Code Area for master boot program. - uint32_t diskSignature; // Optional Windows NT disk signature. May contain boot code. - uint16_t usuallyZero; // Usually zero but may be more boot code. - part_t part[4]; // Partition tables. - uint8_t mbrSig0; // First MBR signature byte. Must be 0x55 - uint8_t mbrSig1; // Second MBR signature byte. Must be 0xAA -} PACKED; -/** Type name for masterBootRecord */ -typedef struct masterBootRecord mbr_t; - -/** - * \struct fat_boot - * - * \brief Boot sector for a FAT12/FAT16 volume. - * - */ -struct fat_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. The value of this field is always 1. - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * For FAT12 and FAT16 volumes, this field contains the count of - * 32-byte directory entries in the root directory. For FAT32 volumes, - * this field must be set to 0. For FAT12 and FAT16 volumes, this - * value should always specify a count that when multiplied by 32 - * results in a multiple of bytesPerSector. FAT16 volumes should - * use the value 512. - */ - uint16_t rootDirEntryCount; - /** - * This field is the old 16-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then totalSectors32 - * must be nonzero. For FAT32 volumes, this field must be 0. For - * FAT12 and FAT16 volumes, this field contains the sector count, and - * totalSectors32 is 0 if the total sector count fits - * (is less than 0x10000). - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * Count of sectors occupied by one FAT on FAT12/FAT16 volumes. - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * This field is the new 32-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then - * totalSectors16 must be nonzero. - */ - uint32_t totalSectors32; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A field with a value of either FAT, FAT12 or FAT16, - * depending on the disk format. - */ - char fileSystemType[8]; - - uint8_t bootCode[448]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA -} PACKED; - -typedef struct fat_boot fat_boot_t; // Type name for FAT Boot Sector - -/** - * \struct fat32_boot - * - * \brief Boot sector for a FAT32 volume. - */ -struct fat32_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. Must not be zero - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0. - */ - uint16_t rootDirEntryCount; - /** - * For FAT32 volumes, this field must be 0. - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * Contains the total number of sectors in the FAT32 volume. - */ - uint32_t totalSectors32; - /** - * Count of sectors occupied by one FAT on FAT32 volumes. - */ - uint32_t sectorsPerFat32; - /** - * This field is only defined for FAT32 media and does not exist on - * FAT12 and FAT16 media. - * Bits 0-3 -- Zero-based number of active FAT. - * Only valid if mirroring is disabled. - * Bits 4-6 -- Reserved. - * Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs. - * -- 1 means only one FAT is active; it is the one referenced - * in bits 0-3. - * Bits 8-15 -- Reserved. - */ - uint16_t fat32Flags; - /** - * FAT32 version. High byte is major revision number. - * Low byte is minor revision number. Only 0.0 define. - */ - uint16_t fat32Version; - /** - * Cluster number of the first cluster of the root directory for FAT32. - * This usually 2 but not required to be 2. - */ - uint32_t fat32RootCluster; - /** - * Sector number of FSINFO structure in the reserved area of the - * FAT32 volume. Usually 1. - */ - uint16_t fat32FSInfo; - /** - * If nonzero, indicates the sector number in the reserved area - * of the volume of a copy of the boot record. Usually 6. - * No value other than 6 is recommended. - */ - uint16_t fat32BackBootBlock; - /** - * Reserved for future expansion. Code that formats FAT32 volumes - * should always set all of the bytes of this field to 0. - */ - uint8_t fat32Reserved[12]; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // Used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A text field with a value of FAT32. - */ - char fileSystemType[8]; - - uint8_t bootCode[420]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA - -} PACKED; - -typedef struct fat32_boot fat32_boot_t; // Type name for FAT32 Boot Sector - -uint32_t const FSINFO_LEAD_SIG = 0x41615252, // 'AaRR' Lead signature for a FSINFO sector - FSINFO_STRUCT_SIG = 0x61417272; // 'aArr' Struct signature for a FSINFO sector - -/** - * \struct fat32_fsinfo - * - * \brief FSINFO sector for a FAT32 volume. - * - */ -struct fat32_fsinfo { - uint32_t leadSignature; // must be 0x52, 0x52, 0x61, 0x41 'RRaA' - uint8_t reserved1[480]; // must be zero - uint32_t structSignature; // must be 0x72, 0x72, 0x41, 0x61 'rrAa' - /** - * Contains the last known free cluster count on the volume. - * If the value is 0xFFFFFFFF, then the free count is unknown - * and must be computed. Any other value can be used, but is - * not necessarily correct. It should be range checked at least - * to make sure it is <= volume cluster count. - */ - uint32_t freeCount; - /** - * This is a hint for the FAT driver. It indicates the cluster - * number at which the driver should start looking for free clusters. - * If the value is 0xFFFFFFFF, then there is no hint and the driver - * should start looking at cluster 2. - */ - uint32_t nextFree; - - uint8_t reserved2[12]; // must be zero - uint8_t tailSignature[4]; // must be 0x00, 0x00, 0x55, 0xAA -} PACKED; - -typedef struct fat32_fsinfo fat32_fsinfo_t; // Type name for FAT32 FSINFO Sector - -// End Of Chain values for FAT entries -uint16_t const FAT12EOC = 0xFFF, // FAT12 end of chain value used by Microsoft. - FAT12EOC_MIN = 0xFF8, // Minimum value for FAT12 EOC. Use to test for EOC. - FAT16EOC = 0xFFFF, // FAT16 end of chain value used by Microsoft. - FAT16EOC_MIN = 0xFFF8; // Minimum value for FAT16 EOC. Use to test for EOC. -uint32_t const FAT32EOC = 0x0FFFFFFF, // FAT32 end of chain value used by Microsoft. - FAT32EOC_MIN = 0x0FFFFFF8, // Minimum value for FAT32 EOC. Use to test for EOC. - FAT32MASK = 0x0FFFFFFF; // Mask a for FAT32 entry. Entries are 28 bits. - -/** - * \struct directoryEntry - * \brief FAT short directory entry - * - * Short means short 8.3 name, not the entry size. - * - * Date Format. A FAT directory entry date stamp is a 16-bit field that is - * basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the - * format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the - * 16-bit word): - * - * Bits 9-15: Count of years from 1980, valid value range 0-127 - * inclusive (1980-2107). - * - * Bits 5-8: Month of year, 1 = January, valid value range 1-12 inclusive. - * - * Bits 0-4: Day of month, valid value range 1-31 inclusive. - * - * Time Format. A FAT directory entry time stamp is a 16-bit field that has - * a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the - * 16-bit word, bit 15 is the MSB of the 16-bit word). - * - * Bits 11-15: Hours, valid value range 0-23 inclusive. - * - * Bits 5-10: Minutes, valid value range 0-59 inclusive. - * - * Bits 0-4: 2-second count, valid value range 0-29 inclusive (0 - 58 seconds). - * - * The valid time range is from Midnight 00:00:00 to 23:59:58. - */ -struct directoryEntry { - /** - * Short 8.3 name. - * - * The first eight bytes contain the file name with blank fill. - * The last three bytes contain the file extension with blank fill. - */ - uint8_t name[11]; - /** - * Entry attributes. - * - * The upper two bits of the attribute byte are reserved and should - * always be set to 0 when a file is created and never modified or - * looked at after that. See defines that begin with DIR_ATT_. - */ - uint8_t attributes; - /** - * Reserved for use by Windows NT. Set value to 0 when a file is - * created and never modify or look at it after that. - */ - uint8_t reservedNT; - /** - * The granularity of the seconds part of creationTime is 2 seconds - * so this field is a count of tenths of a second and it's valid - * value range is 0-199 inclusive. (WHG note - seems to be hundredths) - */ - uint8_t creationTimeTenths; - - uint16_t creationTime; // Time file was created. - uint16_t creationDate; // Date file was created. - - /** - * Last access date. Note that there is no last access time, only - * a date. This is the date of last read or write. In the case of - * a write, this should be set to the same date as lastWriteDate. - */ - uint16_t lastAccessDate; - /** - * High word of this entry's first cluster number (always 0 for a - * FAT12 or FAT16 volume). - */ - uint16_t firstClusterHigh; - - uint16_t lastWriteTime; // Time of last write. File creation is considered a write. - uint16_t lastWriteDate; // Date of last write. File creation is considered a write. - uint16_t firstClusterLow; // Low word of this entry's first cluster number. - uint32_t fileSize; // 32-bit unsigned holding this file's size in bytes. -} PACKED; - -/** - * \struct directoryVFATEntry - * \brief VFAT long filename directory entry - * - * directoryVFATEntries are found in the same list as normal directoryEntry. - * But have the attribute field set to DIR_ATT_LONG_NAME. - * - * Long filenames are saved in multiple directoryVFATEntries. - * Each entry containing 13 UTF-16 characters. - */ -struct directoryVFATEntry { - /** - * Sequence number. Consists of 2 parts: - * bit 6: indicates first long filename block for the next file - * bit 0-4: the position of this long filename block (first block is 1) - */ - uint8_t sequenceNumber; - - uint16_t name1[5]; // First set of UTF-16 characters - uint8_t attributes; // attributes (at the same location as in directoryEntry), always 0x0F - uint8_t reservedNT; // Reserved for use by Windows NT. Always 0. - uint8_t checksum; // Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. - uint16_t name2[6]; // Second set of UTF-16 characters - uint16_t firstClusterLow; // firstClusterLow is always zero for longFilenames - uint16_t name3[2]; // Third set of UTF-16 characters -} PACKED; - -// Definitions for directory entries -// -typedef struct directoryEntry dir_t; // Type name for directoryEntry -typedef struct directoryVFATEntry vfat_t; // Type name for directoryVFATEntry - -uint8_t const DIR_NAME_0xE5 = 0x05, // escape for name[0] = 0xE5 - DIR_NAME_DELETED = 0xE5, // name[0] value for entry that is free after being "deleted" - DIR_NAME_FREE = 0x00, // name[0] value for entry that is free and no allocated entries follow - DIR_ATT_READ_ONLY = 0x01, // file is read-only - DIR_ATT_HIDDEN = 0x02, // File should hidden in directory listings - DIR_ATT_SYSTEM = 0x04, // Entry is for a system file - DIR_ATT_VOLUME_ID = 0x08, // Directory entry contains the volume label - DIR_ATT_DIRECTORY = 0x10, // Entry is for a directory - DIR_ATT_ARCHIVE = 0x20, // Old DOS archive bit for backup support - DIR_ATT_LONG_NAME = 0x0F, // Test value for long name entry. Test is (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. - DIR_ATT_LONG_NAME_MASK = 0x3F, // Test mask for long name entry - DIR_ATT_DEFINED_BITS = 0x3F; // defined attribute bits - -/** - * Directory entry is part of a long name - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for part of a long name else false. - */ -static inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) { - return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME; -} - -/** Mask for file/subdirectory tests */ -uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY); - -/** - * Directory entry is for a file - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file else false. - */ -static inline uint8_t DIR_IS_FILE(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0; -} - -/** - * Directory entry is for a subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a subdirectory else false. - */ -static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY; -} - -/** - * Directory entry is for a file or subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file or subdirectory else false. - */ -static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; -} - -#endif // SDFATSTRUCTS_H diff --git a/Marlin/SdFatUtil.cpp b/Marlin/SdFatUtil.cpp deleted file mode 100644 index 2bd471bc67..0000000000 --- a/Marlin/SdFatUtil.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFatUtil.h" -#include "serial.h" - -/** - * Amount of free RAM - * \return The number of free bytes. - */ -#ifdef __arm__ -extern "C" char* sbrk(int incr); -int SdFatUtil::FreeRam() { - char top; - return &top - reinterpret_cast(sbrk(0)); -} -#else // __arm__ -extern char* __brkval; -extern char __bss_end; -/** - * Amount of free RAM - * \return The number of free bytes. - */ -int SdFatUtil::FreeRam() { - char top; - return __brkval ? &top - __brkval : &top - &__bss_end; -} -#endif // __arm - -/** - * %Print a string in flash memory. - * - * \param[in] pr Print object for output. - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::print_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) SERIAL_CHAR(c); -} - -/** - * %Print a string in flash memory followed by a CR/LF. - * - * \param[in] pr Print object for output. - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::println_P(PGM_P str) { print_P(str); SERIAL_EOL(); } - -/** - * %Print a string in flash memory to Serial. - * - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::SerialPrint_P(PGM_P str) { print_P(str); } - -/** - * %Print a string in flash memory to Serial followed by a CR/LF. - * - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::SerialPrintln_P(PGM_P str) { println_P(str); } - -#endif // SDSUPPORT diff --git a/Marlin/SdFatUtil.h b/Marlin/SdFatUtil.h deleted file mode 100644 index 793ba2f078..0000000000 --- a/Marlin/SdFatUtil.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDFATUTIL_H_ -#define _SDFATUTIL_H_ - -/** - * \file - * \brief Useful utility functions. - */ -/** Store and print a string in flash memory.*/ -#define PgmPrint(x) SerialPrint_P(PSTR(x)) -/** Store and print a string in flash memory followed by a CR/LF.*/ -#define PgmPrintln(x) SerialPrintln_P(PSTR(x)) - -namespace SdFatUtil { - int FreeRam(); - void print_P(PGM_P str); - void println_P(PGM_P str); - void SerialPrint_P(PGM_P str); - void SerialPrintln_P(PGM_P str); -} - -using namespace SdFatUtil; // NOLINT - -#endif // _SDFATUTIL_H_ diff --git a/Marlin/SdFile.cpp b/Marlin/SdFile.cpp deleted file mode 100644 index 45d18e01b3..0000000000 --- a/Marlin/SdFile.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFile.h" - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { } - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdFile::write(const void* buf, uint16_t nbyte) { return SdBaseFile::write(buf, nbyte); } - -/** - * Write a byte to a file. Required by the Arduino Print class. - * \param[in] b the byte to be written. - * Use writeError to check for errors. - */ -#if ARDUINO >= 100 - size_t SdFile::write(uint8_t b) { return SdBaseFile::write(&b, 1); } -#else - void SdFile::write(uint8_t b) { SdBaseFile::write(&b, 1); } -#endif - -/** - * Write a string to a file. Used by the Arduino Print class. - * \param[in] str Pointer to the string. - * Use writeError to check for errors. - */ -void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); } - -/** - * Write a PROGMEM string to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::write_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) write(c); -} - -/** - * Write a PROGMEM string followed by CR/LF to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::writeln_P(PGM_P str) { - write_P(str); - write_P(PSTR("\r\n")); -} - -#endif // SDSUPPORT diff --git a/Marlin/SdFile.h b/Marlin/SdFile.h deleted file mode 100644 index 36d6862d8d..0000000000 --- a/Marlin/SdFile.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdFile class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDFILE_H_ -#define _SDFILE_H_ - -#include "SdBaseFile.h" -#include - -/** - * \class SdFile - * \brief SdBaseFile with Print. - */ -class SdFile : public SdBaseFile, public Print { - public: - SdFile() {} - SdFile(const char* name, uint8_t oflag); - #if ARDUINO >= 100 - size_t write(uint8_t b); - #else - void write(uint8_t b); - #endif - - int16_t write(const void* buf, uint16_t nbyte); - void write(const char* str); - void write_P(PGM_P str); - void writeln_P(PGM_P str); -}; - -#endif // _SDFILE_H_ diff --git a/Marlin/SdInfo.h b/Marlin/SdInfo.h deleted file mode 100644 index 9fe121f168..0000000000 --- a/Marlin/SdInfo.h +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDINFO_H_ -#define _SDINFO_H_ - -#include - -// Based on the document: -// -// SD Specifications -// Part 1 -// Physical Layer -// Simplified Specification -// Version 3.01 -// May 18, 2010 -// -// http://www.sdcard.org/developers/tech/sdcard/pls/simplified_specs - -// SD card commands -uint8_t const CMD0 = 0x00, // GO_IDLE_STATE - init card in spi mode if CS low - CMD8 = 0x08, // SEND_IF_COND - verify SD Memory Card interface operating condition - CMD9 = 0x09, // SEND_CSD - read the Card Specific Data (CSD register) - CMD10 = 0x0A, // SEND_CID - read the card identification information (CID register) - CMD12 = 0x0C, // STOP_TRANSMISSION - end multiple block read sequence - CMD13 = 0x0D, // SEND_STATUS - read the card status register - CMD17 = 0x11, // READ_SINGLE_BLOCK - read a single data block from the card - CMD18 = 0x12, // READ_MULTIPLE_BLOCK - read a multiple data blocks from the card - CMD24 = 0x18, // WRITE_BLOCK - write a single data block to the card - CMD25 = 0x19, // WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION - CMD32 = 0x20, // ERASE_WR_BLK_START - sets the address of the first block to be erased - CMD33 = 0x21, // ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased*/ - CMD38 = 0x26, // ERASE - erase all previously selected blocks */ - CMD55 = 0x37, // APP_CMD - escape for application specific command */ - CMD58 = 0x3A, // READ_OCR - read the OCR register of a card */ - ACMD23 = 0x17, // SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing */ - ACMD41 = 0x29; // SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process */ - -/** status for card in the ready state */ -uint8_t const R1_READY_STATE = 0x00; -/** status for card in the idle state */ -uint8_t const R1_IDLE_STATE = 0x01; -/** status bit for illegal command */ -uint8_t const R1_ILLEGAL_COMMAND = 0x04; -/** start data token for read or write single block*/ -uint8_t const DATA_START_BLOCK = 0xFE; -/** stop token for write multiple blocks*/ -uint8_t const STOP_TRAN_TOKEN = 0xFD; -/** start data token for write multiple blocks*/ -uint8_t const WRITE_MULTIPLE_TOKEN = 0xFC; -/** mask for data response tokens after a write block operation */ -uint8_t const DATA_RES_MASK = 0x1F; -/** write data accepted token */ -uint8_t const DATA_RES_ACCEPTED = 0x05; - -/** Card IDentification (CID) register */ -typedef struct CID { - // byte 0 - /** Manufacturer ID */ - unsigned char mid; - // byte 1-2 - /** OEM/Application ID */ - char oid[2]; - // byte 3-7 - /** Product name */ - char pnm[5]; - // byte 8 - /** Product revision least significant digit */ - unsigned char prv_m : 4; - /** Product revision most significant digit */ - unsigned char prv_n : 4; - // byte 9-12 - /** Product serial number */ - uint32_t psn; - // byte 13 - /** Manufacturing date year low digit */ - unsigned char mdt_year_high : 4; - /** not used */ - unsigned char reserved : 4; - // byte 14 - /** Manufacturing date month */ - unsigned char mdt_month : 4; - /** Manufacturing date year low digit */ - unsigned char mdt_year_low : 4; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** CRC7 checksum */ - unsigned char crc : 7; -} cid_t; - -/** CSD for version 1.00 cards */ -typedef struct CSDV1 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - unsigned char taac; - // byte 2 - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - unsigned char c_size_high : 2; - unsigned char reserved2 : 2; - unsigned char dsr_imp : 1; - unsigned char read_blk_misalign : 1; - unsigned char write_blk_misalign : 1; - unsigned char read_bl_partial : 1; - // byte 7 - unsigned char c_size_mid; - // byte 8 - unsigned char vdd_r_curr_max : 3; - unsigned char vdd_r_curr_min : 3; - unsigned char c_size_low : 2; - // byte 9 - unsigned char c_size_mult_high : 2; - unsigned char vdd_w_cur_max : 3; - unsigned char vdd_w_curr_min : 3; - // byte 10 - unsigned char sector_size_high : 6; - unsigned char erase_blk_en : 1; - unsigned char c_size_mult_low : 1; - // byte 11 - unsigned char wp_grp_size : 7; - unsigned char sector_size_low : 1; - // byte 12 - unsigned char write_bl_len_high : 2; - unsigned char r2w_factor : 3; - unsigned char reserved3 : 2; - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved4 : 5; - unsigned char write_partial : 1; - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved5: 2; - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Indicates the file format on the card */ - unsigned char file_format_grp : 1; - // byte 15 - unsigned char always1 : 1; - unsigned char crc : 7; -} csd1_t; - -/** CSD for version 2.00 cards */ -typedef struct CSDV2 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - /** fixed to 0x0E */ - unsigned char taac; - // byte 2 - /** fixed to 0 */ - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - /** This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte */ - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - /** not used */ - unsigned char reserved2 : 4; - unsigned char dsr_imp : 1; - /** fixed to 0 */ - unsigned char read_blk_misalign : 1; - /** fixed to 0 */ - unsigned char write_blk_misalign : 1; - /** fixed to 0 - no partial read */ - unsigned char read_bl_partial : 1; - // byte 7 - /** not used */ - unsigned char reserved3 : 2; - /** high part of card size */ - unsigned char c_size_high : 6; - // byte 8 - /** middle part of card size */ - unsigned char c_size_mid; - // byte 9 - /** low part of card size */ - unsigned char c_size_low; - // byte 10 - /** sector size is fixed at 64 KB */ - unsigned char sector_size_high : 6; - /** fixed to 1 - erase single is supported */ - unsigned char erase_blk_en : 1; - /** not used */ - unsigned char reserved4 : 1; - // byte 11 - unsigned char wp_grp_size : 7; - /** sector size is fixed at 64 KB */ - unsigned char sector_size_low : 1; - // byte 12 - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_high : 2; - /** fixed value of 2 */ - unsigned char r2w_factor : 3; - /** not used */ - unsigned char reserved5 : 2; - /** fixed value of 0 - no write protect groups */ - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved6 : 5; - /** always zero - no partial block read*/ - unsigned char write_partial : 1; - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved7: 2; - /** Do not use always 0 */ - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Do not use always 0 */ - unsigned char file_format_grp : 1; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** checksum */ - unsigned char crc : 7; -} csd2_t; - -/** union of old and new style CSD register */ -union csd_t { - csd1_t v1; - csd2_t v2; -}; - -#endif // _SDINFO_H_ diff --git a/Marlin/SdVolume.cpp b/Marlin/SdVolume.cpp deleted file mode 100644 index df781cb6b6..0000000000 --- a/Marlin/SdVolume.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdVolume.h" - -#if !USE_MULTIPLE_CARDS - // raw block cache - uint32_t SdVolume::cacheBlockNumber_; // current block number - cache_t SdVolume::cacheBuffer_; // 512 byte cache for Sd2Card - Sd2Card* SdVolume::sdCard_; // pointer to SD card object - bool SdVolume::cacheDirty_; // cacheFlush() will write block if true - uint32_t SdVolume::cacheMirrorBlock_; // mirror block for second FAT -#endif // USE_MULTIPLE_CARDS - -// find a contiguous group of clusters -bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { - // start of group - uint32_t bgnCluster; - // end of group - uint32_t endCluster; - // last cluster of FAT - uint32_t fatEnd = clusterCount_ + 1; - - // flag to save place to start next search - bool setStart; - - // set search start cluster - if (*curCluster) { - // try to make file contiguous - bgnCluster = *curCluster + 1; - - // don't save new start location - setStart = false; - } - else { - // start at likely place for free cluster - bgnCluster = allocSearchStart_; - - // save next search start if one cluster - setStart = count == 1; - } - // end of group - endCluster = bgnCluster; - - // search the FAT for free clusters - for (uint32_t n = 0;; n++, endCluster++) { - // can't find space checked all clusters - if (n >= clusterCount_) return false; - - // past end - start from beginning of FAT - if (endCluster > fatEnd) { - bgnCluster = endCluster = 2; - } - uint32_t f; - if (!fatGet(endCluster, &f)) return false; - - if (f != 0) { - // cluster in use try next cluster as bgnCluster - bgnCluster = endCluster + 1; - } - else if ((endCluster - bgnCluster + 1) == count) { - // done - found space - break; - } - } - // mark end of chain - if (!fatPutEOC(endCluster)) return false; - - // link clusters - while (endCluster > bgnCluster) { - if (!fatPut(endCluster - 1, endCluster)) return false; - endCluster--; - } - if (*curCluster != 0) { - // connect chains - if (!fatPut(*curCluster, bgnCluster)) return false; - } - // return first cluster number to caller - *curCluster = bgnCluster; - - // remember possible next free cluster - if (setStart) allocSearchStart_ = bgnCluster + 1; - - return true; -} - -bool SdVolume::cacheFlush() { - if (cacheDirty_) { - if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) - return false; - - // mirror FAT tables - if (cacheMirrorBlock_) { - if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) - return false; - cacheMirrorBlock_ = 0; - } - cacheDirty_ = 0; - } - return true; -} - -bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { - if (cacheBlockNumber_ != blockNumber) { - if (!cacheFlush()) return false; - if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) return false; - cacheBlockNumber_ = blockNumber; - } - if (dirty) cacheDirty_ = true; - return true; -} - -// return the size in bytes of a cluster chain -bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { - uint32_t s = 0; - do { - if (!fatGet(cluster, &cluster)) return false; - s += 512UL << clusterSizeShift_; - } while (!isEOC(cluster)); - *size = s; - return true; -} - -// Fetch a FAT entry -bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { - uint32_t lba; - if (cluster > (clusterCount_ + 1)) return false; - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return false; - index &= 0x1FF; - uint16_t tmp = cacheBuffer_.data[index]; - index++; - if (index == 512) { - if (!cacheRawBlock(lba + 1, CACHE_FOR_READ)) return false; - index = 0; - } - tmp |= cacheBuffer_.data[index] << 8; - *value = cluster & 1 ? tmp >> 4 : tmp & 0xFFF; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (lba != cacheBlockNumber_ && !cacheRawBlock(lba, CACHE_FOR_READ)) - return false; - - *value = (fatType_ == 16) ? cacheBuffer_.fat16[cluster & 0xFF] : (cacheBuffer_.fat32[cluster & 0x7F] & FAT32MASK); - return true; -} - -// Store a FAT entry -bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { - uint32_t lba; - // error if reserved cluster - if (cluster < 2) return false; - - // error if not in FAT - if (cluster > (clusterCount_ + 1)) return false; - - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - index &= 0x1FF; - uint8_t tmp = value; - if (cluster & 1) { - tmp = (cacheBuffer_.data[index] & 0xF) | tmp << 4; - } - cacheBuffer_.data[index] = tmp; - index++; - if (index == 512) { - lba++; - index = 0; - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - } - tmp = value >> 4; - if (!(cluster & 1)) { - tmp = ((cacheBuffer_.data[index] & 0xF0)) | tmp >> 4; - } - cacheBuffer_.data[index] = tmp; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - - // store entry - if (fatType_ == 16) - cacheBuffer_.fat16[cluster & 0xFF] = value; - else - cacheBuffer_.fat32[cluster & 0x7F] = value; - - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - return true; -} - -// free a cluster chain -bool SdVolume::freeChain(uint32_t cluster) { - // clear free cluster location - allocSearchStart_ = 2; - - do { - uint32_t next; - if (!fatGet(cluster, &next)) return false; - - // free cluster - if (!fatPut(cluster, 0)) return false; - - cluster = next; - } while (!isEOC(cluster)); - - return true; -} - -/** Volume free space in clusters. - * - * \return Count of free clusters for success or -1 if an error occurs. - */ -int32_t SdVolume::freeClusterCount() { - uint32_t free = 0; - uint16_t n; - uint32_t todo = clusterCount_ + 2; - - if (fatType_ == 16) - n = 256; - else if (fatType_ == 32) - n = 128; - else // put FAT12 here - return -1; - - for (uint32_t lba = fatStartBlock_; todo; todo -= n, lba++) { - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return -1; - NOMORE(n, todo); - if (fatType_ == 16) { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat16[i] == 0) free++; - } - else { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat32[i] == 0) free++; - } - } - return free; -} - -/** Initialize a FAT volume. - * - * \param[in] dev The SD card where the volume is located. - * - * \param[in] part The partition to be used. Legal values for \a part are - * 1-4 to use the corresponding partition on a device formatted with - * a MBR, Master Boot Record, or zero if the device is formatted as - * a super floppy with the FAT boot sector in block zero. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding a valid - * FAT file system in the specified partition or an I/O error. - */ -bool SdVolume::init(Sd2Card* dev, uint8_t part) { - uint32_t totalBlocks, volumeStartBlock = 0; - fat32_boot_t* fbs; - - sdCard_ = dev; - fatType_ = 0; - allocSearchStart_ = 2; - cacheDirty_ = 0; // cacheFlush() will write block if true - cacheMirrorBlock_ = 0; - cacheBlockNumber_ = 0xFFFFFFFF; - - // if part == 0 assume super floppy with FAT boot sector in block zero - // if part > 0 assume mbr volume with partition table - if (part) { - if (part > 4) return false; - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - part_t* p = &cacheBuffer_.mbr.part[part - 1]; - if ((p->boot & 0x7F) != 0 || p->totalSectors < 100 || p->firstSector == 0) - return false; // not a valid partition - volumeStartBlock = p->firstSector; - } - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - fbs = &cacheBuffer_.fbs32; - if (fbs->bytesPerSector != 512 || - fbs->fatCount == 0 || - fbs->reservedSectorCount == 0 || - fbs->sectorsPerCluster == 0) { - // not valid FAT volume - return false; - } - fatCount_ = fbs->fatCount; - blocksPerCluster_ = fbs->sectorsPerCluster; - // determine shift that is same as multiply by blocksPerCluster_ - clusterSizeShift_ = 0; - while (blocksPerCluster_ != _BV(clusterSizeShift_)) { - // error if not power of 2 - if (clusterSizeShift_++ > 7) return false; - } - blocksPerFat_ = fbs->sectorsPerFat16 ? - fbs->sectorsPerFat16 : fbs->sectorsPerFat32; - - fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; - - // count for FAT16 zero for FAT32 - rootDirEntryCount_ = fbs->rootDirEntryCount; - - // directory start for FAT16 dataStart for FAT32 - rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; - - // data start for FAT16 and FAT32 - dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511) / 512); - - // total blocks for FAT16 or FAT32 - totalBlocks = fbs->totalSectors16 ? - fbs->totalSectors16 : fbs->totalSectors32; - - // total data blocks - clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); - - // divide by cluster size to get cluster count - clusterCount_ >>= clusterSizeShift_; - - // FAT type is determined by cluster count - if (clusterCount_ < 4085) { - fatType_ = 12; - if (!FAT12_SUPPORT) return false; - } - else if (clusterCount_ < 65525) - fatType_ = 16; - else { - rootDirStart_ = fbs->fat32RootCluster; - fatType_ = 32; - } - return true; -} - -#endif // SDSUPPORT diff --git a/Marlin/SdVolume.h b/Marlin/SdVolume.h deleted file mode 100644 index 7cde194ebe..0000000000 --- a/Marlin/SdVolume.h +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdVolume class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDVOLUME_H_ -#define _SDVOLUME_H_ - -#include "SdFatConfig.h" -#include "Sd2Card.h" -#include "SdFatStructs.h" - -//============================================================================== -// SdVolume class -/** - * \brief Cache for an SD data block - */ -union cache_t { - uint8_t data[512]; // Used to access cached file data blocks. - uint16_t fat16[256]; // Used to access cached FAT16 entries. - uint32_t fat32[128]; // Used to access cached FAT32 entries. - dir_t dir[16]; // Used to access cached directory entries. - mbr_t mbr; // Used to access a cached Master Boot Record. - fat_boot_t fbs; // Used to access to a cached FAT boot sector. - fat32_boot_t fbs32; // Used to access to a cached FAT32 boot sector. - fat32_fsinfo_t fsinfo; // Used to access to a cached FAT32 FSINFO sector. -}; - -/** - * \class SdVolume - * \brief Access FAT16 and FAT32 volumes on SD and SDHC cards. - */ -class SdVolume { - public: - // Create an instance of SdVolume - SdVolume() : fatType_(0) {} - /** - * Clear the cache and returns a pointer to the cache. Used by the WaveRP - * recorder to do raw write to the SD card. Not for normal apps. - * \return A pointer to the cache buffer or zero if an error occurs. - */ - cache_t* cacheClear() { - if (!cacheFlush()) return 0; - cacheBlockNumber_ = 0xFFFFFFFF; - return &cacheBuffer_; - } - - /** - * Initialize a FAT volume. Try partition one first then try super - * floppy format. - * - * \param[in] dev The Sd2Card where the volume is located. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding - * a valid FAT file system or an I/O error. - */ - bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0); } - bool init(Sd2Card* dev, uint8_t part); - - // inline functions that return volume info - uint8_t blocksPerCluster() const { return blocksPerCluster_; } //> \return The volume's cluster size in blocks. - uint32_t blocksPerFat() const { return blocksPerFat_; } //> \return The number of blocks in one FAT. - uint32_t clusterCount() const { return clusterCount_; } //> \return The total number of clusters in the volume. - uint8_t clusterSizeShift() const { return clusterSizeShift_; } //> \return The shift count required to multiply by blocksPerCluster. - uint32_t dataStartBlock() const { return dataStartBlock_; } //> \return The logical block number for the start of file data. - uint8_t fatCount() const { return fatCount_; } //> \return The number of FAT structures on the volume. - uint32_t fatStartBlock() const { return fatStartBlock_; } //> \return The logical block number for the start of the first FAT. - uint8_t fatType() const { return fatType_; } //> \return The FAT type of the volume. Values are 12, 16 or 32. - int32_t freeClusterCount(); - uint32_t rootDirEntryCount() const { return rootDirEntryCount_; } /** \return The number of entries in the root directory for FAT16 volumes. */ - - /** - * \return The logical block number for the start of the root directory - * on FAT16 volumes or the first cluster number on FAT32 volumes. - */ - uint32_t rootDirStart() const { return rootDirStart_; } - - /** - * Sd2Card object for this volume - * \return pointer to Sd2Card object. - */ - Sd2Card* sdCard() { return sdCard_; } - - /** - * Debug access to FAT table - * - * \param[in] n cluster number. - * \param[out] v value of entry - * \return true for success or false for failure - */ - bool dbgFat(uint32_t n, uint32_t* v) { return fatGet(n, v); } - - private: - // Allow SdBaseFile access to SdVolume private data. - friend class SdBaseFile; - - // value for dirty argument in cacheRawBlock to indicate read from cache - static bool const CACHE_FOR_READ = false; - // value for dirty argument in cacheRawBlock to indicate write to cache - static bool const CACHE_FOR_WRITE = true; - - #if USE_MULTIPLE_CARDS - cache_t cacheBuffer_; // 512 byte cache for device blocks - uint32_t cacheBlockNumber_; // Logical number of block in the cache - Sd2Card* sdCard_; // Sd2Card object for cache - bool cacheDirty_; // cacheFlush() will write block if true - uint32_t cacheMirrorBlock_; // block number for mirror FAT - #else - static cache_t cacheBuffer_; // 512 byte cache for device blocks - static uint32_t cacheBlockNumber_; // Logical number of block in the cache - static Sd2Card* sdCard_; // Sd2Card object for cache - static bool cacheDirty_; // cacheFlush() will write block if true - static uint32_t cacheMirrorBlock_; // block number for mirror FAT - #endif - - uint32_t allocSearchStart_; // start cluster for alloc search - uint8_t blocksPerCluster_; // cluster size in blocks - uint32_t blocksPerFat_; // FAT size in blocks - uint32_t clusterCount_; // clusters in one FAT - uint8_t clusterSizeShift_; // shift to convert cluster count to block count - uint32_t dataStartBlock_; // first data block number - uint8_t fatCount_; // number of FATs on volume - uint32_t fatStartBlock_; // start block for first FAT - uint8_t fatType_; // volume type (12, 16, OR 32) - uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir - uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 - - bool allocContiguous(uint32_t count, uint32_t* curCluster); - uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1); } - uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_); } - uint32_t blockNumber(uint32_t cluster, uint32_t position) const { return clusterStartBlock(cluster) + blockOfCluster(position); } - - cache_t* cache() { return &cacheBuffer_; } - uint32_t cacheBlockNumber() const { return cacheBlockNumber_; } - - #if USE_MULTIPLE_CARDS - bool cacheFlush(); - bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #else - static bool cacheFlush(); - static bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #endif - - // used by SdBaseFile write to assign cache to SD location - void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { - cacheDirty_ = dirty; - cacheBlockNumber_ = blockNumber; - } - void cacheSetDirty() { cacheDirty_ |= CACHE_FOR_WRITE; } - bool chainSize(uint32_t beginCluster, uint32_t* size); - bool fatGet(uint32_t cluster, uint32_t* value); - bool fatPut(uint32_t cluster, uint32_t value); - bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); } - bool freeChain(uint32_t cluster); - bool isEOC(uint32_t cluster) const { - if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; - if (fatType_ == 16) return cluster >= FAT16EOC_MIN; - return cluster >= FAT32EOC_MIN; - } - bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst); } - bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); } - - // Deprecated functions - #if ALLOW_DEPRECATED_FUNCTIONS - public: - /** - * \deprecated Use: bool SdVolume::init(Sd2Card* dev); - * \param[in] dev The SD card where the volume is located. - * \return true for success or false for failure. - */ - bool init(Sd2Card& dev) { return init(&dev); } - /** - * \deprecated Use: bool SdVolume::init(Sd2Card* dev, uint8_t vol); - * \param[in] dev The SD card where the volume is located. - * \param[in] part The partition to be used. - * \return true for success or false for failure. - */ - bool init(Sd2Card& dev, uint8_t part) { return init(&dev, part); } - #endif // ALLOW_DEPRECATED_FUNCTIONS -}; - -#endif // _SDVOLUME_H_ diff --git a/Marlin/Version.h b/Marlin/Version.h deleted file mode 100644 index 8d600b6a33..0000000000 --- a/Marlin/Version.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This file is the standard Marlin version identifier file, all fields can be - * overriden by the ones defined on _Version.h by using the Configuration.h - * directive USE_AUTOMATIC_VERSIONING. - */ - -#if ENABLED(USE_AUTOMATIC_VERSIONING) - - #include "_Version.h" - -#else - - /** - * Marlin release version identifier - */ - #define SHORT_BUILD_VERSION "1.1.9" - - /** - * Verbose version identifier which should contain a reference to the location - * from where the binary was downloaded or the source code was compiled. - */ - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" - - /** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ - #define STRING_DISTRIBUTION_DATE "2018-08-01" - - /** - * Required minimum Configuration.h and Configuration_adv.h file versions. - * - * You must increment this version number for every significant change such as, - * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on - * the configuration files. - */ - #define REQUIRED_CONFIGURATION_H_VERSION 010109 - #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010109 - - /** - * The protocol for communication to the host. Protocol indicates communication - * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. - * (Other behaviors are given by the firmware version and capabilities report.) - */ - #define PROTOCOL_VERSION "1.0" - - /** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ - #define MACHINE_NAME "3D Printer" - - /** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ - #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" - - /** - * Default generic printer UUID. - */ - #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" - - /** - * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. - */ - #define WEBSITE_URL "http://eryone.com" - -#endif // USE_AUTOMATIC_VERSIONING diff --git a/Marlin/bitmap_flags.h b/Marlin/bitmap_flags.h deleted file mode 100644 index 7f7d04f5dd..0000000000 --- a/Marlin/bitmap_flags.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef _BITMAP_FLAGS_H_ -#define _BITMAP_FLAGS_H_ - -#include "macros.h" - -/** - * These support functions allow the use of large bit arrays of flags that take very - * little RAM. Currently they are limited to being 16x16 in size. Changing the declaration - * to unsigned long will allow us to go to 32x32 if higher resolution meshes are needed - * in the future. - */ -FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); } -FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); } -FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } - -#endif // _BITMAP_FLAGS_H_ diff --git a/Marlin/blinkm.cpp b/Marlin/blinkm.cpp deleted file mode 100644 index 7eba6c0d92..0000000000 --- a/Marlin/blinkm.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * blinkm.cpp - Control a BlinkM over i2c - */ - -#include "MarlinConfig.h" - -#if ENABLED(BLINKM) - -#include "blinkm.h" -#include "leds.h" -#include - -void blinkm_set_led_color(const LEDColor &color) { - Wire.begin(); - Wire.beginTransmission(0x09); - Wire.write('o'); //to disable ongoing script, only needs to be used once - Wire.write('n'); - Wire.write(color.r); - Wire.write(color.g); - Wire.write(color.b); - Wire.endTransmission(); -} - -#endif // BLINKM diff --git a/Marlin/blinkm.h b/Marlin/blinkm.h deleted file mode 100644 index 20e84d9a95..0000000000 --- a/Marlin/blinkm.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * blinkm.h - Control a BlinkM over i2c - */ - -#ifndef _BLINKM_H_ -#define _BLINKM_H_ - -struct LEDColor; -typedef LEDColor LEDColor; - -void blinkm_set_led_color(const LEDColor &color); - -#endif // _BLINKM_H_ diff --git a/Marlin/boards.h b/Marlin/boards.h deleted file mode 100644 index 18912cedab..0000000000 --- a/Marlin/boards.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef BOARDS_H -#define BOARDS_H - -#define BOARD_UNKNOWN -1 - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 - -#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_PLUS_EFB 143 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_PLUS_EEB 144 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_PLUS_EFF 145 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_PLUS_EEF 146 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_PLUS_SF 148 // RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#define BOARD_3DRAG 77 // 3Drag Controller -#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller) -#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller) -#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers -#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers -#define BOARD_MKS_BASE 40 // MKS BASE v1.0 -#define BOARD_MKS_BASE_15 405 // MKS v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 41 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 47 // MKS GEN v1.3 or 1.4 -#define BOARD_MKS_GEN_L 53 // MKS GEN L -#define BOARD_ZRIB_V20 504 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 49 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 7 // Ultimaker -#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 67 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 80 // Rumba -#define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 431 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 343 // TriGorilla Anycubic version 1.3 based on RAMPS EFB -#define BOARD_TRIGORILLA_14 443 // TriGorilla Anycubic version 1.4 based on RAMPS EFB -#define BOARD_RAMPS_ENDER_4 243 // Creality: Ender-4, CR-8 - -// -// Other ATmega1280, ATmega2560 -// - -#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11 -#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12 -#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 -#define BOARD_CHEAPTRONIC_V2 21 // Cheaptronic v2.0 -#define BOARD_MIGHTYBOARD_REVE 200 // Makerbot Mightyboard Revision E -#define BOARD_MEGATRONICS 70 // Megatronics -#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0 -#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0 -#define BOARD_MEGATRONICS_31 704 // Megatronics v3.1 -#define BOARD_RAMBO 301 // Rambo -#define BOARD_MINIRAMBO 302 // Mini-Rambo -#define BOARD_MINIRAMBO_10A 303 // Mini-Rambo 1.0a -#define BOARD_EINSY_RAMBO 304 // Einsy Rambo -#define BOARD_EINSY_RETRO 305 // Einsy Retro -#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3) -#define BOARD_LEAPFROG 999 // Leapfrog -#define BOARD_MEGACONTROLLER 310 // Mega controller -#define BOARD_SCOOVO_X9H 321 // abee Scoovo X9H -#define BOARD_GT2560_REV_A 74 // Geeetech GT2560 Rev. A -#define BOARD_GT2560_REV_A_PLUS 75 // Geeetech GT2560 Rev. A+ (with auto level probe) - -// -// ATmega1281, ATmega2561 -// - -#define BOARD_MINITRONICS 702 // Minitronics v1.0/1.1 -#define BOARD_SILVER_GATE 25 // Silvergate v1.0 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2 -#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above -#define BOARD_MELZI 63 // Melzi -#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version) -#define BOARD_MELZI_CREALITY 89 // Melzi Creality3D board (for CR-10 etc) -#define BOARD_MELZI_MALYAN 92 // Melzi Malyan M150 board -#define BOARD_MELZI_TRONXY 505 // Tronxy X5S -#define BOARD_STB_11 64 // STB V1.1 -#define BOARD_AZTEEG_X1 65 // Azteeg X1 -#define BOARD_ANET_10 69 // Anet 1.0 (Melzi clone) - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics -#define BOARD_GEN3_PLUS 9 // Gen3+ -#define BOARD_GEN6 5 // Gen6 -#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe -#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" -#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2 -#define BOARD_GEN7_13 12 // Gen7 v1.3 -#define BOARD_GEN7_14 13 // Gen7 v1.4 -#define BOARD_OMCA_A 90 // Alpha OMCA board -#define BOARD_OMCA 91 // Final OMCA board -#define BOARD_SETHI 20 // Sethi 3D_1 - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#define BOARD_TEENSYLU 8 // Teensylu -#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286) -#define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286) -#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646) -#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) -#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286) -#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make -#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board - -#define MB(board) (defined(BOARD_##board) && MOTHERBOARD==BOARD_##board) - -#endif // __BOARDS_H diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h deleted file mode 100644 index d36447deb4..0000000000 --- a/Marlin/buzzer.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __BUZZER_H__ -#define __BUZZER_H__ - -#include "types.h" -#include "fastio.h" -#include "circularqueue.h" -#include "temperature.h" - -#include "MarlinConfig.h" - -#define TONE_QUEUE_LENGTH 4 - -/** - * @brief Tone structure - * @details Simple abstraction of a tone based on a duration and a frequency. - */ -struct tone_t { - uint16_t duration; - uint16_t frequency; -}; - -/** - * @brief Buzzer class - */ -class Buzzer { - private: - struct state_t { - tone_t tone; - uint32_t endtime; - } state; - - protected: - CircularQueue buffer; - - /** - * @brief Inverts the sate of a digital PIN - * @details This will invert the current state of an digital IO pin. - */ - void invert() { - TOGGLE(BEEPER_PIN); - } - - /** - * @brief Turn off a digital PIN - * @details Alias of digitalWrite(PIN, LOW) using FastIO - */ - void off() { - WRITE(BEEPER_PIN, LOW); - } - - /** - * @brief Turn on a digital PIN - * @details Alias of digitalWrite(PIN, HIGH) using FastIO - */ - void on() { - WRITE(BEEPER_PIN, HIGH); - } - - /** - * @brief Resets the state of the class - * @details Brings the class state to a known one. - */ - void reset() { - this->off(); - this->state.endtime = 0; - } - - public: - /** - * @brief Class constructor - */ - Buzzer() { - SET_OUTPUT(BEEPER_PIN); - this->reset(); - } - - /** - * @brief Add a tone to the queue - * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. - * - * @param duration Duration of the tone in milliseconds - * @param frequency Frequency of the tone in hertz - */ - void tone(const uint16_t &duration, const uint16_t &frequency=0) { - while (buffer.isFull()) { - this->tick(); - thermalManager.manage_heater(); - } - tone_t tone = { duration, frequency }; - this->buffer.enqueue(tone); - } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * playing the tones in the queue. - */ - virtual void tick() { - const millis_t now = millis(); - - if (!this->state.endtime) { - if (this->buffer.isEmpty()) return; - - this->state.tone = this->buffer.dequeue(); - this->state.endtime = now + this->state.tone.duration; - - if (this->state.tone.frequency > 0) { - #if ENABLED(SPEAKER) - CRITICAL_SECTION_START; - ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); - CRITICAL_SECTION_END; - #else - this->on(); - #endif - } - } - else if (ELAPSED(now, this->state.endtime)) this->reset(); - } -}; - -extern Buzzer buzzer; - -#endif diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp deleted file mode 100644 index 58146f1e4c..0000000000 --- a/Marlin/cardreader.cpp +++ /dev/null @@ -1,1001 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "cardreader.h" - -#include "ultralcd.h" -#include "stepper.h" -#include "language.h" -#include "printcounter.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP -#include "power_loss_recovery.h" -#endif - - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -CardReader::CardReader() { - #if ENABLED(SDCARD_SORT_ALPHA) - sort_count = 0; - #if ENABLED(SDSORT_GCODE) - sort_alpha = true; - sort_folders = FOLDER_SORTING; - //sort_reverse = false; - #endif - #endif - sdprinting = cardOK = saving = logging = false; - filesize = 0; - sdpos = 0; - file_subcall_ctr = 0; - - workDirDepth = 0; - ZERO(workDirParents); - - // Disable autostart until card is initialized - autostart_index = -1; - - //power to SD reader - #if SDPOWER > -1 - OUT_WRITE(SDPOWER, HIGH); - #endif -} - -char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters - char *pos = buffer; - for (uint8_t i = 0; i < 11; i++) { - if (p.name[i] == ' ') continue; - if (i == 8) *pos++ = '.'; - *pos++ = p.name[i]; - } - *pos++ = 0; - return buffer; -} - -/** - * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction: - * LS_Count - Add +1 to nrFiles for every file within the parent - * LS_GetFilename - Get the filename of the file indexed by nrFile_index - * LS_SerialPrint - Print the full path and size of each file to serial output - */ - -uint16_t nrFile_index; - -void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) { - dir_t p; - uint8_t cnt = 0; - - // Read the next entry from a directory - while (parent.readDir(&p, longFilename) > 0) { - - // If the entry is a directory and the action is LS_SerialPrint - if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { - - // Get the short name for the item, which we know is a folder - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, p); - - // Allocate enough stack space for the full path to a folder, trailing slash, and nul - const bool prepend_is_empty = (!prepend || prepend[0] == '\0'); - const int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1; - char path[len]; - - // Append the FOLDERNAME12/ to the passed string. - // It contains the full path to the "parent" argument. - // We now have the full path to the item in this folder. - strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty - strcat(path, dosFilename); // FILENAME_LENGTH-1 characters maximum - strcat(path, "/"); // 1 character - - // Serial.print(path); - - // Get a new directory object using the full path - // and dive recursively into it. - SdFile dir; - if (!dir.open(&parent, dosFilename, O_READ)) { - if (lsAction == LS_SerialPrint) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHOLN(dosFilename); - } - } - lsDive(path, dir); - // close() is done automatically by destructor of SdFile - } - else { - uint8_t pn0 = p.name[0]; - if (pn0 == DIR_NAME_FREE) break; - if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; - if (longFilename[0] == '.') continue; - - if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; - - filenameIsDir = DIR_IS_SUBDIR(&p); - - if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; - - switch (lsAction) { // 1 based file count - case LS_Count: - nrFiles++; - break; - - case LS_SerialPrint: - createFilename(filename, p); - if (prepend) SERIAL_PROTOCOL(prepend); - SERIAL_PROTOCOL(filename); - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLLN(p.fileSize); - break; - - case LS_GetFilename: - createFilename(filename, p); - if (match != NULL) { - if (strcasecmp(match, filename) == 0) return; - } - else if (cnt == nrFile_index) return; // 0 based index - cnt++; - break; - } - - } - } // while readDir -} - -void CardReader::ls() { - lsAction = LS_SerialPrint; - root.rewind(); - lsDive(NULL, root); -} - -#if ENABLED(LONG_FILENAME_HOST_SUPPORT) - - /** - * Get a long pretty path based on a DOS 8.3 path - */ - void CardReader::printLongPath(char *path) { - lsAction = LS_GetFilename; - - int i, pathLen = strlen(path); - - // SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path); - - // Zero out slashes to make segments - for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0'; - - SdFile diveDir = root; // start from the root for segment 1 - for (i = 0; i < pathLen;) { - - if (path[i] == '\0') i++; // move past a single nul - - char *segment = &path[i]; // The segment after most slashes - - // If a segment is empty (extra-slash) then exit - if (!*segment) break; - - // Go to the next segment - while (path[++i]) { } - - // SERIAL_ECHOPGM("Looking for segment: "); SERIAL_ECHOLN(segment); - - // Find the item, setting the long filename - diveDir.rewind(); - lsDive(NULL, diveDir, segment); - - // Print /LongNamePart to serial output - SERIAL_PROTOCOLCHAR('/'); - SERIAL_PROTOCOL(longFilename[0] ? longFilename : "???"); - - // If the filename was printed then that's it - if (!filenameIsDir) break; - - // SERIAL_ECHOPGM("Opening dir: "); SERIAL_ECHOLN(segment); - - // Open the sub-item as the new dive parent - SdFile dir; - if (!dir.open(&diveDir, segment, O_READ)) { - SERIAL_EOL(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHO(segment); - break; - } - - diveDir.close(); - diveDir = dir; - - } // while i SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); - SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); - kill(PSTR(MSG_KILLED)); - return; - } - - // Store current filename (based on workDirParents) and position - getAbsFilename(proc_filenames[file_subcall_ctr]); - filespos[file_subcall_ctr] = sdpos; - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", path); - SERIAL_ECHOPAIR("\" parent:\"", proc_filenames[file_subcall_ctr]); - SERIAL_ECHOLNPAIR("\" pos", sdpos); - file_subcall_ctr++; - } - else - doing = 1; - } - else if (subcall) { // Returning from a subcall? - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("END SUBROUTINE"); - } - else { // Opening fresh file - doing = 2; - file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure - } - - if (doing) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Now "); - serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); - SERIAL_ECHOLNPAIR(" file: ", path); - } - - stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, path, false); - if (!fname) return; - - if (read) { - if (file.open(curDir, fname, O_READ)) { - filesize = file.fileSize(); - sdpos = 0; -#if POWER_LOSS_RECOVER_SUPER_CAP - strcpy(recovery_detect_cap.file_name, fname); - SERIAL_ECHOLN(recovery_detect_cap.file_name); -#endif - SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); - SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize); - SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); - - getfilename(0, fname); - lcd_setstatus(longFilename[0] ? longFilename : fname); - //if (longFilename[0]) { - // SERIAL_PROTOCOLPAIR(MSG_SD_FILE_LONG_NAME, longFilename); - //} - } - else { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - } - else { //write - if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else { - saving = true; - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, path); - lcd_setstatus(fname); - } - } -} - -void CardReader::removeFile(const char * const name) { - if (!cardOK) return; - - stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, name, false); - if (!fname) return; - - if (file.remove(curDir, fname)) { - SERIAL_PROTOCOLPGM("File deleted:"); - SERIAL_PROTOCOLLN(fname); - sdpos = 0; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - else { - SERIAL_PROTOCOLPGM("Deletion failed, File: "); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLCHAR('.'); - } -} - -uint32_t CardReader::getStatus() { - uint32_t ret=0; - if (cardOK && sdprinting) { - SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); - SERIAL_PROTOCOL(sdpos); - SERIAL_PROTOCOLCHAR('/'); - SERIAL_PROTOCOLLN(filesize); - ret=sdpos; - } - else - SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING); - return ret; -} - -void CardReader::write_command(char *buf) { - char* begin = buf; - char* npos = NULL; - char* end = buf + strlen(buf) - 1; - - file.writeError = false; - if ((npos = strchr(buf, 'N')) != NULL) { - begin = strchr(npos, ' ') + 1; - end = strchr(npos, '*') - 1; - } - end[1] = '\r'; - end[2] = '\n'; - end[3] = '\0'; - file.write(begin); - if (file.writeError) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE); - } -} - -// -// Run the next autostart file. Called: -// - On boot after successful card init -// - After finishing the previous autostart file -// - From the LCD command to run the autostart file -// - -void CardReader::checkautostart() { - - if (autostart_index < 0 || sdprinting) return; - - if (!cardOK) initsd(); - - if (cardOK - #if ENABLED(POWER_LOSS_RECOVERY) - && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists - #endif - ) { - char autoname[10]; - sprintf_P(autoname, PSTR("auto%i.g"), int(autostart_index)); - dir_t p; - root.rewind(); - while (root.readDir(&p, NULL) > 0) { - for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); - if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { - openAndPrintFile(autoname); - autostart_index++; - return; - } - } - } - autostart_index = -1; -} - -void CardReader::beginautostart() { - autostart_index = 0; - setroot(); -} - -void CardReader::closefile(const bool store_location) { - file.sync(); - file.close(); - saving = logging = false; - - if (store_location) { - //future: store printer state, filename and position for continuing a stopped print - // so one can unplug the printer and continue printing the next day. - } -} - -/** - * Get the name of a file in the current directory by index - * with optional name to match. - */ -void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) { - #if ENABLED(SDSORT_CACHE_NAMES) - if (match != NULL) { - while (nr < sort_count) { - if (strcasecmp(match, sortshort[nr]) == 0) break; - nr++; - } - } - if (nr < sort_count) { - strcpy(filename, sortshort[nr]); - strcpy(longFilename, sortnames[nr]); - filenameIsDir = TEST(isDir[nr>>3], nr & 0x07); - return; - } - #endif // SDSORT_CACHE_NAMES - lsAction = LS_GetFilename; - nrFile_index = nr; - workDir.rewind(); - lsDive(NULL, workDir, match); -} - -uint16_t CardReader::getnrfilenames() { - lsAction = LS_Count; - nrFiles = 0; - workDir.rewind(); - lsDive(NULL, workDir); - //SERIAL_ECHOLN(nrFiles); - return nrFiles; -} - -/** - * Dive to the given file path, with optional echo. - * On exit set curDir and return the name part of the path. - * A NULL result indicates an unrecoverable error. - */ -const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo) { - SdFile myDir; - if (path[0] != '/') { curDir = &workDir; return path; } - - curDir = &root; - const char *dirname_start = &path[1]; - while (dirname_start) { - char * const dirname_end = strchr(dirname_start, '/'); - if (dirname_end <= dirname_start) break; - const uint8_t len = dirname_end - dirname_start; - char dosSubdirname[len + 1]; - strncpy(dosSubdirname, dirname_start, len); - dosSubdirname[len] = 0; - - if (echo) SERIAL_ECHOLN(dosSubdirname); - - if (!myDir.open(curDir, dosSubdirname, O_READ)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - return NULL; - } - curDir = &myDir; - dirname_start = dirname_end + 1; - } - return dirname_start; -} - -void CardReader::chdir(const char * relpath) { - SdFile newDir; - SdFile *parent = workDir.isOpen() ? &workDir : &root; - - if (newDir.open(parent, relpath, O_READ)) { - workDir = newDir; - if (workDirDepth < MAX_DIR_DEPTH) - workDirParents[workDirDepth++] = workDir; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); - SERIAL_ECHOLN(relpath); - } -} - -int8_t CardReader::updir() { - if (workDirDepth > 0) { // At least 1 dir has been saved - workDir = --workDirDepth ? workDirParents[workDirDepth - 1] : root; // Use parent, or root if none - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - return workDirDepth; -} - -void CardReader::setroot() { - /*if (!workDir.openRoot(&volume)) { - SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - }*/ - workDir = root; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif -} - -#if ENABLED(SDCARD_SORT_ALPHA) - - /** - * Get the name of a file in the current directory by sort-index - */ - void CardReader::getfilename_sorted(const uint16_t nr) { - getfilename( - #if ENABLED(SDSORT_GCODE) - sort_alpha && - #endif - (nr < sort_count) ? sort_order[nr] : nr - ); - } - - /** - * Read all the files and produce a sort key - * - * We can do this in 3 ways... - * - Minimal RAM: Read two filenames at a time sorting along... - * - Some RAM: Buffer the directory just for this sort - * - Most RAM: Buffer the directory and return filenames from RAM - */ - void CardReader::presort() { - - // Throw away old sort index - flush_presort(); - - // Sorting may be turned off - #if ENABLED(SDSORT_GCODE) - if (!sort_alpha) return; - #endif - - // If there are files, sort up to the limit - uint16_t fileCnt = getnrfilenames(); - if (fileCnt > 0) { - - // Never sort more than the max allowed - // If you use folders to organize, 20 may be enough - if (fileCnt > SDSORT_LIMIT) fileCnt = SDSORT_LIMIT; - - // Sort order is always needed. May be static or dynamic. - #if ENABLED(SDSORT_DYNAMIC_RAM) - sort_order = new uint8_t[fileCnt]; - #endif - - // Use RAM to store the entire directory during pre-sort. - // SDSORT_LIMIT should be set to prevent over-allocation. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortshort = new char*[fileCnt]; - sortnames = new char*[fileCnt]; - #endif - #elif ENABLED(SDSORT_USES_STACK) - char sortnames[fileCnt][SORTED_LONGNAME_MAXLEN]; - #endif - - // Folder sorting needs 1 bit per entry for flags. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - isDir = new uint8_t[(fileCnt + 7) >> 3]; - #elif ENABLED(SDSORT_USES_STACK) - uint8_t isDir[(fileCnt + 7) >> 3]; - #endif - #endif - - #else // !SDSORT_USES_RAM - - // By default re-read the names from SD for every compare - // retaining only two filenames at a time. This is very - // slow but is safest and uses minimal RAM. - char name1[LONG_FILENAME_LENGTH + 1]; - - #endif - - if (fileCnt > 1) { - - // Init sort order. - for (uint16_t i = 0; i < fileCnt; i++) { - sort_order[i] = i; - // If using RAM then read all filenames now. - #if ENABLED(SDSORT_USES_RAM) - getfilename(i); - #if ENABLED(SDSORT_DYNAMIC_RAM) - // Use dynamic method to copy long filename - sortnames[i] = strdup(longest_filename()); - #if ENABLED(SDSORT_CACHE_NAMES) - // When caching also store the short name, since - // we're replacing the getfilename() behavior. - sortshort[i] = strdup(filename); - #endif - #else - // Copy filenames into the static array - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[i], filename); - #endif - #endif - // char out[30]; - // sprintf_P(out, PSTR("---- %i %s %s"), i, filenameIsDir ? "D" : " ", sortnames[i]); - // SERIAL_ECHOLN(out); - #if HAS_FOLDER_SORTING - const uint16_t bit = i & 0x07, ind = i >> 3; - if (bit == 0) isDir[ind] = 0x00; - if (filenameIsDir) isDir[ind] |= _BV(bit); - #endif - #endif - } - - // Bubble Sort - for (uint16_t i = fileCnt; --i;) { - bool didSwap = false; - for (uint16_t j = 0; j < i; ++j) { - const uint16_t o1 = sort_order[j], o2 = sort_order[j + 1]; - - // Compare names from the array or just the two buffered names - #if ENABLED(SDSORT_USES_RAM) - #define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0) - #else - #define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) - #endif - - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_USES_RAM) - // Folder sorting needs an index and bit to test for folder-ness. - const uint8_t ind1 = o1 >> 3, bit1 = o1 & 0x07, - ind2 = o2 >> 3, bit2 = o2 & 0x07; - #define _SORT_CMP_DIR(fs) \ - (((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \ - ? _SORT_CMP_NODIR() \ - : (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0) - #else - #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) - #endif - #endif - - // The most economical method reads names as-needed - // throughout the loop. Slow if there are many. - #if DISABLED(SDSORT_USES_RAM) - getfilename(o1); - strcpy(name1, longest_filename()); // save (or getfilename below will trounce it) - #if HAS_FOLDER_SORTING - bool dir1 = filenameIsDir; - #endif - getfilename(o2); - char *name2 = longest_filename(); // use the string in-place - #endif // !SDSORT_USES_RAM - - // Sort the current pair according to settings. - if ( - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_GCODE) - sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_NODIR() - #else - _SORT_CMP_DIR(FOLDER_SORTING) - #endif - #else - _SORT_CMP_NODIR() - #endif - ) { - sort_order[j] = o2; - sort_order[j + 1] = o1; - didSwap = true; - } - } - if (!didSwap) break; - } - // Using RAM but not keeping names around - #if ENABLED(SDSORT_USES_RAM) && DISABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - for (uint16_t i = 0; i < fileCnt; ++i) free(sortnames[i]); - #if HAS_FOLDER_SORTING - free(isDir); - #endif - #endif - #endif - } - else { - sort_order[0] = 0; - #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) - getfilename(0); - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortnames = new char*[1]; - sortnames[0] = strdup(longest_filename()); // malloc - #if ENABLED(SDSORT_CACHE_NAMES) - sortshort = new char*[1]; - sortshort[0] = strdup(filename); // malloc - #endif - isDir = new uint8_t[1]; - #else - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[0], filename); - #endif - #endif - isDir[0] = filenameIsDir ? 0x01 : 0x00; - #endif - } - - sort_count = fileCnt; - } - } - - void CardReader::flush_presort() { - if (sort_count > 0) { - #if ENABLED(SDSORT_DYNAMIC_RAM) - delete sort_order; - #if ENABLED(SDSORT_CACHE_NAMES) - for (uint8_t i = 0; i < sort_count; ++i) { - free(sortshort[i]); // strdup - free(sortnames[i]); // strdup - } - delete sortshort; - delete sortnames; - #endif - #endif - sort_count = 0; - } - } - -#endif // SDCARD_SORT_ALPHA - -uint16_t CardReader::get_num_Files() { - return - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES - nrFiles // no need to access the SD card for filenames - #else - getnrfilenames() - #endif - ; -} - -void CardReader::printingHasFinished() { - planner.synchronize(); - file.close(); - enqueue_and_echo_commands_P(PSTR("G28 X")); - if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. - file_subcall_ctr--; - openFile(proc_filenames[file_subcall_ctr], true, true); - setIndex(filespos[file_subcall_ctr]); - startFileprint(); - } - else { - sdprinting = false; - - #if ENABLED(POWER_LOSS_RECOVERY) - removeJobRecoveryFile(); - #endif - - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); - #endif - print_job_timer.stop(); - if (print_job_timer.duration() > 60) - enqueue_and_echo_commands_P(PSTR("M31")); - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - progress_bar_percent = 0; - #endif - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - lcd_reselect_last_file(); - #endif - } -} - -#if ENABLED(AUTO_REPORT_SD_STATUS) - uint8_t CardReader::auto_report_sd_interval = 0; - millis_t CardReader::next_sd_report_ms; - - void CardReader::auto_report_sd_status() { - millis_t current_ms = millis(); - if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) { - next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval; - getStatus(); - } - } -#endif // AUTO_REPORT_SD_STATUS - -#if ENABLED(POWER_LOSS_RECOVERY) - - char job_recovery_file_name[4] = "bin"; - - void CardReader::openJobRecoveryFile(const bool read) { - if (!cardOK) return; - if (jobRecoveryFile.isOpen()) return; - if (!jobRecoveryFile.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else if (!read) - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); - } - - void CardReader::closeJobRecoveryFile() { jobRecoveryFile.close(); } - - bool CardReader::jobRecoverFileExists() { - const bool exists = jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); - if (exists) jobRecoveryFile.close(); - return exists; - } - - int16_t CardReader::saveJobRecoveryInfo() { - jobRecoveryFile.seekSet(0); - const int16_t ret = jobRecoveryFile.write(&job_recovery_info, sizeof(job_recovery_info)); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); - #endif - return ret; - } - - int16_t CardReader::loadJobRecoveryInfo() { - return jobRecoveryFile.read(&job_recovery_info, sizeof(job_recovery_info)); - } - - void CardReader::removeJobRecoveryFile() { - job_recovery_info.valid_head = job_recovery_info.valid_foot = job_recovery_commands_count = 0; - if (jobRecoverFileExists()) { - closefile(); - removeFile(job_recovery_file_name); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLPGM("Power-loss file delete"); - serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); - #endif - } - } - -#endif // POWER_LOSS_RECOVERY - -#endif // SDSUPPORT diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h deleted file mode 100644 index 8afc434e4d..0000000000 --- a/Marlin/cardreader.h +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _CARDREADER_H_ -#define _CARDREADER_H_ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#define SD_RESORT ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_DYNAMIC_RAM) - -#define MAX_DIR_DEPTH 10 // Maximum folder depth - -#include "SdFile.h" - -class CardReader { -public: - CardReader(); - - void initsd(); - void write_command(char *buf); - - void beginautostart(); - void checkautostart(); - - void openFile(char * const path, const bool read, const bool subcall=false); - void openLogFile(char * const path); - void removeFile(const char * const name); - void closefile(const bool store_location=false); - void release(); - void openAndPrintFile(const char *name); - void startFileprint(); - void stopSDPrint( - #if SD_RESORT - const bool re_sort=false - #endif - ); - uint32_t getStatus(); - void printingHasFinished(); - void printFilename(); - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - void printLongPath(char *path); - #endif - - void getfilename(uint16_t nr, const char* const match=NULL); - uint16_t getnrfilenames(); - - void getAbsFilename(char *t); - - void ls(); - void chdir(const char *relpath); - int8_t updir(); - void setroot(); - - const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo); - - uint16_t get_num_Files(); - - #if ENABLED(SDCARD_SORT_ALPHA) - void presort(); - void getfilename_sorted(const uint16_t nr); - #if ENABLED(SDSORT_GCODE) - FORCE_INLINE void setSortOn(bool b) { sort_alpha = b; presort(); } - FORCE_INLINE void setSortFolders(int i) { sort_folders = i; presort(); } - //FORCE_INLINE void setSortReverse(bool b) { sort_reverse = b; } - #endif - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - void openJobRecoveryFile(const bool read); - void closeJobRecoveryFile(); - bool jobRecoverFileExists(); - int16_t saveJobRecoveryInfo(); - int16_t loadJobRecoveryInfo(); - void removeJobRecoveryFile(); - #endif - - FORCE_INLINE void pauseSDPrint() { sdprinting = false; } - FORCE_INLINE bool isFileOpen() { return file.isOpen(); } - FORCE_INLINE bool eof() { return sdpos >= filesize; } - FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } - FORCE_INLINE void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - FORCE_INLINE uint32_t getIndex() { return sdpos; } - FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - void auto_report_sd_status(void); - FORCE_INLINE void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_sd_interval = v; - next_sd_report_ms = millis() + 1000UL * v; - } - #endif - - FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } - -public: - bool saving, logging, sdprinting, cardOK, filenameIsDir; - char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - int8_t autostart_index; - uint32_t filesize, sdpos; -private: - SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; - uint8_t workDirDepth; - - // Sort files and folders alphabetically. - #if ENABLED(SDCARD_SORT_ALPHA) - uint16_t sort_count; // Count of sorted items in the current directory - #if ENABLED(SDSORT_GCODE) - bool sort_alpha; // Flag to enable / disable the feature - int sort_folders; // Flag to enable / disable folder sorting - //bool sort_reverse; // Flag to enable / disable reverse sorting - #endif - - // By default the sort index is static - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *sort_order; - #else - uint8_t sort_order[SDSORT_LIMIT]; - #endif - - #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #define SORTED_LONGNAME_MAXLEN ((SDSORT_CACHE_VFATS) * (FILENAME_LENGTH) + 1) - #else - #define SORTED_LONGNAME_MAXLEN LONG_FILENAME_LENGTH - #endif - - // Cache filenames to speed up SD menus. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - char **sortshort, **sortnames; - #else - char sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; - #endif - #elif DISABLED(SDSORT_USES_STACK) - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; - #endif - - // Folder sorting uses an isDir array when caching items. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *isDir; - #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) - uint8_t isDir[(SDSORT_LIMIT+7)>>3]; - #endif - #endif - - #endif // SDSORT_USES_RAM - - #endif // SDCARD_SORT_ALPHA - - Sd2Card sd2card; - SdVolume volume; - SdFile file; - - #if ENABLED(POWER_LOSS_RECOVERY) - SdFile jobRecoveryFile; - #endif - - #define SD_PROCEDURE_DEPTH 1 - #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) - uint8_t file_subcall_ctr; - uint32_t filespos[SD_PROCEDURE_DEPTH]; - char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - //uint32_t filesize, sdpos; - - LsAction lsAction; //stored for recursion. - uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. - char* diveDirName; - void lsDive(const char *prepend, SdFile parent, const char * const match=NULL); - - #if ENABLED(SDCARD_SORT_ALPHA) - void flush_presort(); - #endif - - #if ENABLED(AUTO_REPORT_SD_STATUS) - static uint8_t auto_report_sd_interval; - static millis_t next_sd_report_ms; - #endif -}; - -#if PIN_EXISTS(SD_DETECT) - #if ENABLED(SD_DETECT_INVERTED) - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH) - #else - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW) - #endif -#else - // No card detect line? Assume the card is inserted. - #define IS_SD_INSERTED true -#endif - -extern CardReader card; - -#endif // SDSUPPORT - -#if ENABLED(SDSUPPORT) - #define IS_SD_PRINTING (card.sdprinting) - #define IS_SD_FILE_OPEN (card.isFileOpen()) -#else - #define IS_SD_PRINTING (false) - #define IS_SD_FILE_OPEN (false) -#endif - -#endif // _CARDREADER_H_ diff --git a/Marlin/circularqueue.h b/Marlin/circularqueue.h deleted file mode 100644 index 9aafb99aca..0000000000 --- a/Marlin/circularqueue.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __CIRCULARQUEUE_H__ -#define __CIRCULARQUEUE_H__ - -#include - -/** - * @brief Circular Queue class - * @details Implementation of the classic ring buffer data structure - */ -template -class CircularQueue { - private: - - /** - * @brief Buffer structure - * @details This structure consolidates all the overhead required to handle - * a circular queue such as the pointers and the buffer vector. - */ - struct buffer_t { - uint8_t head; - uint8_t tail; - uint8_t count; - uint8_t size; - T queue[N]; - } buffer; - - public: - /** - * @brief Class constructor - * @details This class requires two template parameters, T defines the type - * of item this queue will handle and N defines the maximum number of - * items that can be stored on the queue. - */ - CircularQueue() { - this->buffer.size = N; - this->buffer.count = this->buffer.head = this->buffer.tail = 0; - } - - /** - * @brief Removes and returns a item from the queue - * @details Removes the oldest item on the queue, pointed to by the - * buffer_t head field. The item is returned to the caller. - * @return type T item - */ - T dequeue() { - if (this->isEmpty()) return T(); - - uint8_t index = this->buffer.head; - - --this->buffer.count; - if (++this->buffer.head == this->buffer.size) - this->buffer.head = 0; - - return this->buffer.queue[index]; - } - - /** - * @brief Adds an item to the queue - * @details Adds an item to the queue on the location pointed by the buffer_t - * tail variable. Returns false if no queue space is available. - * @param item Item to be added to the queue - * @return true if the operation was successful - */ - bool enqueue(T const &item) { - if (this->isFull()) return false; - - this->buffer.queue[this->buffer.tail] = item; - - ++this->buffer.count; - if (++this->buffer.tail == this->buffer.size) - this->buffer.tail = 0; - - return true; - } - - /** - * @brief Checks if the queue has no items - * @details Returns true if there are no items on the queue, false otherwise. - * @return true if queue is empty - */ - bool isEmpty() { - return this->buffer.count == 0; - } - - /** - * @brief Checks if the queue is full - * @details Returns true if the queue is full, false otherwise. - * @return true if queue is full - */ - bool isFull() { - return this->buffer.count == this->buffer.size; - } - - /** - * @brief Gets the queue size - * @details Returns the maximum number of items a queue can have. - * @return the queue size - */ - uint8_t size() { - return this->buffer.size; - } - - /** - * @brief Gets the next item from the queue without removing it - * @details Returns the next item in the queue without removing it - * or updating the pointers. - * @return first item in the queue - */ - T peek() { - return this->buffer.queue[this->buffer.head]; - } - - /** - * @brief Gets the number of items on the queue - * @details Returns the current number of items stored on the queue. - * @return number of items in the queue - */ - uint8_t count() { - return this->buffer.count; - } -}; - -#endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp deleted file mode 100644 index c189b0df31..0000000000 --- a/Marlin/configuration_store.cpp +++ /dev/null @@ -1,2730 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * configuration_store.cpp - * - * Settings and EEPROM storage - * - * IMPORTANT: Whenever there are changes made to the variables stored in EEPROM - * in the functions below, also increment the version number. This makes sure that - * the default values are used whenever there is a change to the data, to prevent - * wrong data being written to the variables. - * - * ALSO: Variables in the Store and Retrieve sections must be in the same order. - * If a feature is disabled, some data must still be written that, when read, - * either sets a Sane Default, or results in No Change to the existing value. - * - */ - -// Change EEPROM version if the structure changes -#define EEPROM_VERSION "V55" -#define EEPROM_OFFSET 100 - -// Check the integrity of data offsets. -// Can be disabled for production build. -//#define DEBUG_EEPROM_READWRITE - -#include "configuration_store.h" -#include "Marlin.h" -#include "language.h" -#include "endstops.h" -#include "planner.h" -#include "temperature.h" -#include "ultralcd.h" -#include "stepper.h" -#include "parser.h" -#include "vector_3.h" -#include "power_loss_recovery.h" - -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "power_loss_recovery.h" -#endif -#if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if HAS_TRINAMIC - #include "stepper_indirection.h" - #include "tmc_util.h" - #define TMC_GET_PWMTHRS(A,Q) _tmc_thrs(stepper##Q.microsteps(), stepper##Q.TPWMTHRS(), planner.axis_steps_per_mm[_AXIS(A)]) -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - #define LPQ_LEN thermalManager.lpq_len -#endif - -#pragma pack(push, 1) // No padding between variables - -typedef struct PID { float Kp, Ki, Kd; } PID; -typedef struct PIDC { float Kp, Ki, Kd, Kc; } PIDC; - -/** - * Current EEPROM Layout - * - * Keep this data structure up to date so - * EEPROM size is known at compile time! - */ -typedef struct SettingsDataStruct { - char version[4]; // Vnn\0 - uint16_t crc; // Data Checksum - - // - // DISTINCT_E_FACTORS - // - uint8_t esteppers; // XYZE_N - XYZ - - uint32_t planner_max_acceleration_mm_per_s2[XYZE_N], // M201 XYZE planner.max_acceleration_mm_per_s2[XYZE_N] - planner_min_segment_time_us; // M205 B planner.min_segment_time_us - float planner_axis_steps_per_mm[XYZE_N], // M92 XYZE planner.axis_steps_per_mm[XYZE_N] - planner_max_feedrate_mm_s[XYZE_N], // M203 XYZE planner.max_feedrate_mm_s[XYZE_N] - planner_acceleration, // M204 P planner.acceleration - planner_retract_acceleration, // M204 R planner.retract_acceleration - planner_travel_acceleration, // M204 T planner.travel_acceleration - planner_min_feedrate_mm_s, // M205 S planner.min_feedrate_mm_s - planner_min_travel_feedrate_mm_s, // M205 T planner.min_travel_feedrate_mm_s - planner_max_jerk[XYZE], // M205 XYZE planner.max_jerk[XYZE] - planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm - - float home_offset[XYZ]; // M206 XYZ - - #if HOTENDS > 1 - float hotend_offset[XYZ][HOTENDS - 1]; // M218 XYZ - #endif - - // - // ENABLE_LEVELING_FADE_HEIGHT - // - float planner_z_fade_height; // M420 Zn planner.z_fade_height - - // - // MESH_BED_LEVELING - // - float mbl_z_offset; // mbl.z_offset - uint8_t mesh_num_x, mesh_num_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - #if ENABLED(MESH_BED_LEVELING) - float mbl_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // mbl.z_values - #else - float mbl_z_values[3][3]; - #endif - - // - // HAS_BED_PROBE - // - float zprobe_zoffset; // M851 Z - - // - // ABL_PLANAR - // - matrix_3x3 planner_bed_level_matrix; // planner.bed_level_matrix - - // - // AUTO_BED_LEVELING_BILINEAR - // - uint8_t grid_max_x, grid_max_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - int bilinear_grid_spacing[2], - bilinear_start[2]; // G29 L F - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // G29 - #else - float z_values[3][3]; - #endif - - // - // AUTO_BED_LEVELING_UBL - // - bool planner_leveling_active; // M420 S planner.leveling_active - int8_t ubl_storage_slot; // ubl.storage_slot - - // - // DELTA / [XYZ]_DUAL_ENDSTOPS - // - #if ENABLED(DELTA) - float delta_height, // M666 H - delta_endstop_adj[ABC], // M666 XYZ - delta_radius, // M665 R - delta_diagonal_rod, // M665 L - delta_segments_per_second, // M665 S - delta_calibration_radius, // M665 B - delta_tower_angle_trim[ABC]; // M665 XYZ - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - float x_endstop_adj, // M666 X - y_endstop_adj, // M666 Y - z_endstop_adj; // M666 Z - #endif - - // - // ULTIPANEL - // - int16_t lcd_preheat_hotend_temp[2], // M145 S0 H - lcd_preheat_bed_temp[2], // M145 S0 B - lcd_preheat_fan_speed[2]; // M145 S0 F - - // - // PIDTEMP - // - PIDC hotendPID[MAX_EXTRUDERS]; // M301 En PIDC / M303 En U - - int16_t lpq_len; // M301 L - - // - // PIDTEMPBED - // - PID bedPID; // M304 PID / M303 E-1 U - - // - // HAS_LCD_CONTRAST - // - int16_t lcd_contrast; // M250 C - - // - // FWRETRACT - // - bool autoretract_enabled; // M209 S - float retract_length, // M207 S - retract_feedrate_mm_s, // M207 F - retract_zlift, // M207 Z - retract_recover_length, // M208 S - retract_recover_feedrate_mm_s, // M208 F - swap_retract_length, // M207 W - swap_retract_recover_length, // M208 W - swap_retract_recover_feedrate_mm_s; // M208 R - - // - // !NO_VOLUMETRIC - // - bool parser_volumetric_enabled; // M200 D parser.volumetric_enabled - float planner_filament_size[MAX_EXTRUDERS]; // M200 T D planner.filament_size[] - - // - // HAS_TRINAMIC - // - #define TMC_AXES (MAX_EXTRUDERS + 6) - uint16_t tmc_stepper_current[TMC_AXES]; // M906 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - uint32_t tmc_hybrid_threshold[TMC_AXES]; // M913 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - int16_t tmc_sgt[XYZ]; // M914 X Y Z - - // - // LIN_ADVANCE - // - float planner_extruder_advance_K; // M900 K planner.extruder_advance_K - - // - // HAS_MOTOR_CURRENT_PWM - // - uint32_t motor_current_setting[XYZ]; // M907 X Z E - - // - // CNC_COORDINATE_SYSTEMS - // - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; // G54-G59.3 - - // - // SKEW_CORRECTION - // - float planner_xy_skew_factor, // M852 I planner.xy_skew_factor - planner_xz_skew_factor, // M852 J planner.xz_skew_factor - planner_yz_skew_factor; // M852 K planner.yz_skew_factor - - // - // ADVANCED_PAUSE_FEATURE - // - float filament_change_unload_length[MAX_EXTRUDERS], // M603 T U - filament_change_load_length[MAX_EXTRUDERS]; // M603 T L - -} SettingsData; - -#pragma pack(pop) - -MarlinSettings settings; - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - extern void refresh_bed_level(); -#endif - -uint16_t MarlinSettings::datasize() { return sizeof(SettingsData); } - -/** - * Post-process after Retrieve or Reset - */ - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float new_z_fade_height; -#endif - -void MarlinSettings::postprocess() { - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - // steps per s2 needs to be updated to agree with units per s2 - planner.reset_acceleration_rates(); - - // Make sure delta kinematics are updated before refreshing the - // planner position so the stepper counts will be set correctly. - #if ENABLED(DELTA) - recalc_delta_settings(); - #endif - - #if ENABLED(PIDTEMP) - thermalManager.updatePID(); - #endif - - #if DISABLED(NO_VOLUMETRICS) - planner.calculate_volumetric_multipliers(); - #else - for (uint8_t i = COUNT(planner.e_factor); i--;) - planner.refresh_e_factor(i); - #endif - - #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE) - // Software endstops depend on home_offset - LOOP_XYZ(i) update_software_endstops((AxisEnum)i); - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - set_z_fade_height(new_z_fade_height, false); // false = no report - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - refresh_bed_level(); - #endif - - #if HAS_MOTOR_CURRENT_PWM - stepper.refresh_motor_power(); - #endif - - #if ENABLED(FWRETRACT) - fwretract.refresh_autoretract(); - #endif - - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif - - // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm - // and init stepper.count[], planner.position[] with current_position - planner.refresh_positioning(); - - // Various factors can change the current position - if (memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); -} - -#if ENABLED(EEPROM_SETTINGS) - - #define DUMMY_PID_VALUE 3000.0f - #define EEPROM_START() int eeprom_index = EEPROM_OFFSET - #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR) - #define EEPROM_WRITE(VAR) write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_READ(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_READ_ALWAYS(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, true) - #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(ERR); eeprom_error = true; }while(0) - - #if ENABLED(DEBUG_EEPROM_READWRITE) - #define _FIELD_TEST(FIELD) \ - EEPROM_ASSERT( \ - eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ - "Field " STRINGIFY(FIELD) " mismatch." \ - ) - #else - #define _FIELD_TEST(FIELD) NOOP - #endif - - const char version[4] = EEPROM_VERSION; - - bool MarlinSettings::eeprom_error, MarlinSettings::validating; - - void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { - if (eeprom_error) { pos += size; return; } - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); - eeprom_error = true; - return; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - } - - void MarlinSettings::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool force/*=false*/) { - if (eeprom_error) { pos += size; return; } - do { - uint8_t c = eeprom_read_byte((unsigned char*)pos); - if (!validating || force) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - } - - bool MarlinSettings::size_error(const uint16_t size) { - if (size != datasize()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("EEPROM datasize error."); - return true; - } - return false; - } - - /** - * M500 - Store Configuration - */ - bool MarlinSettings::save() { - float dummy = 0; - char ver[4] = "ERR"; - - uint16_t working_crc = 0; - - EEPROM_START(); - - eeprom_error = false; - - EEPROM_WRITE(ver); // invalidate data first - EEPROM_SKIP(working_crc); // Skip the checksum slot - - working_crc = 0; // clear before first "real data" - - _FIELD_TEST(esteppers); - - const uint8_t esteppers = COUNT(planner.axis_steps_per_mm) - XYZ; - EEPROM_WRITE(esteppers); - - EEPROM_WRITE(planner.max_acceleration_mm_per_s2); - EEPROM_WRITE(planner.min_segment_time_us); - EEPROM_WRITE(planner.axis_steps_per_mm); - EEPROM_WRITE(planner.max_feedrate_mm_s); - EEPROM_WRITE(planner.acceleration); - EEPROM_WRITE(planner.retract_acceleration); - EEPROM_WRITE(planner.travel_acceleration); - EEPROM_WRITE(planner.min_feedrate_mm_s); - EEPROM_WRITE(planner.min_travel_feedrate_mm_s); - - #if ENABLED(JUNCTION_DEVIATION) - const float planner_max_jerk[] = { float(DEFAULT_XJERK), float(DEFAULT_YJERK), float(DEFAULT_ZJERK), float(DEFAULT_EJERK) }; - EEPROM_WRITE(planner_max_jerk); - EEPROM_WRITE(planner.junction_deviation_mm); - #else - EEPROM_WRITE(planner.max_jerk); - dummy = 0.02f; - EEPROM_WRITE(dummy); - #endif - - _FIELD_TEST(home_offset); - - #if !HAS_HOME_OFFSET - const float home_offset[XYZ] = { 0 }; - #endif - EEPROM_WRITE(home_offset); - - #if HOTENDS > 1 - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_WRITE(hotend_offset[i][e]); - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float zfh = planner.z_fade_height; - #else - const float zfh = 10.0; - #endif - EEPROM_WRITE(zfh); - - // - // Mesh Bed Leveling - // - - #if ENABLED(MESH_BED_LEVELING) - // Compile time test that sizeof(mbl.z_values) is as expected - static_assert( - sizeof(mbl.z_values) == GRID_MAX_POINTS * sizeof(mbl.z_values[0][0]), - "MBL Z array is the wrong size." - ); - const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(mbl.z_offset); - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - EEPROM_WRITE(mbl.z_values); - #else // For disabled MBL write a default mesh - dummy = 0; - const uint8_t mesh_num_x = 3, mesh_num_y = 3; - EEPROM_WRITE(dummy); // z_offset - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummy); - #endif // MESH_BED_LEVELING - - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - const float zprobe_zoffset = 0; - #endif - EEPROM_WRITE(zprobe_zoffset); - - // - // Planar Bed Leveling matrix - // - - #if ABL_PLANAR - EEPROM_WRITE(planner.bed_level_matrix); - #else - dummy = 0; - for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Bilinear Auto Bed Leveling - // - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Compile time test that sizeof(z_values) is as expected - static_assert( - sizeof(z_values) == GRID_MAX_POINTS * sizeof(z_values[0][0]), - "Bilinear Z array is the wrong size." - ); - const uint8_t grid_max_x = GRID_MAX_POINTS_X, grid_max_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(grid_max_x); // 1 byte - EEPROM_WRITE(grid_max_y); // 1 byte - EEPROM_WRITE(bilinear_grid_spacing); // 2 ints - EEPROM_WRITE(bilinear_start); // 2 ints - EEPROM_WRITE(z_values); // 9-256 floats - #else - // For disabled Bilinear Grid write an empty 3x3 grid - const uint8_t grid_max_x = 3, grid_max_y = 3; - const int bilinear_start[2] = { 0 }, bilinear_grid_spacing[2] = { 0 }; - dummy = 0; - EEPROM_WRITE(grid_max_x); - EEPROM_WRITE(grid_max_y); - EEPROM_WRITE(bilinear_grid_spacing); - EEPROM_WRITE(bilinear_start); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummy); - #endif // AUTO_BED_LEVELING_BILINEAR - - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_WRITE(planner.leveling_active); - EEPROM_WRITE(ubl.storage_slot); - #else - const bool ubl_active = false; - const int8_t storage_slot = -1; - EEPROM_WRITE(ubl_active); - EEPROM_WRITE(storage_slot); - #endif // AUTO_BED_LEVELING_UBL - - // 11 floats for DELTA / [XYZ]_DUAL_ENDSTOPS - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_WRITE(delta_height); // 1 float - EEPROM_WRITE(delta_endstop_adj); // 3 floats - EEPROM_WRITE(delta_radius); // 1 float - EEPROM_WRITE(delta_diagonal_rod); // 1 float - EEPROM_WRITE(delta_segments_per_second); // 1 float - EEPROM_WRITE(delta_calibration_radius); // 1 float - EEPROM_WRITE(delta_tower_angle_trim); // 3 floats - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - _FIELD_TEST(x_endstop_adj); - - // Write dual endstops in X, Y, Z order. Unused = 0.0 - dummy = 0; - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.x_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.y_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.z_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #endif - - _FIELD_TEST(lcd_preheat_hotend_temp); - - #if DISABLED(ULTIPANEL) - constexpr int16_t lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, - lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }, - lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; - #endif - - EEPROM_WRITE(lcd_preheat_hotend_temp); - EEPROM_WRITE(lcd_preheat_bed_temp); - EEPROM_WRITE(lcd_preheat_fan_speed); - - for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { - - #if ENABLED(PIDTEMP) - if (e < HOTENDS) { - EEPROM_WRITE(PID_PARAM(Kp, e)); - EEPROM_WRITE(PID_PARAM(Ki, e)); - EEPROM_WRITE(PID_PARAM(Kd, e)); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_WRITE(PID_PARAM(Kc, e)); - #else - dummy = 1.0f; // 1.0 = default kc - EEPROM_WRITE(dummy); - #endif - } - else - #endif // !PIDTEMP - { - dummy = DUMMY_PID_VALUE; // When read, will not change the existing value - EEPROM_WRITE(dummy); // Kp - dummy = 0; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc - } - - } // Hotends Loop - - _FIELD_TEST(lpq_len); - - #if DISABLED(PID_EXTRUSION_SCALING) - const int16_t LPQ_LEN = 20; - #endif - EEPROM_WRITE(LPQ_LEN); - - #if DISABLED(PIDTEMPBED) - dummy = DUMMY_PID_VALUE; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); - #else - EEPROM_WRITE(thermalManager.bedKp); - EEPROM_WRITE(thermalManager.bedKi); - EEPROM_WRITE(thermalManager.bedKd); - #endif - - _FIELD_TEST(lcd_contrast); - - #if !HAS_LCD_CONTRAST - const int16_t lcd_contrast = 32; - #endif - EEPROM_WRITE(lcd_contrast); - - #if DISABLED(FWRETRACT) - const bool autoretract_enabled = false; - const float autoretract_defaults[] = { 3, 45, 0, 0, 0, 13, 0, 8 }; - EEPROM_WRITE(autoretract_enabled); - EEPROM_WRITE(autoretract_defaults); - #else - EEPROM_WRITE(fwretract.autoretract_enabled); - EEPROM_WRITE(fwretract.retract_length); - EEPROM_WRITE(fwretract.retract_feedrate_mm_s); - EEPROM_WRITE(fwretract.retract_zlift); - EEPROM_WRITE(fwretract.retract_recover_length); - EEPROM_WRITE(fwretract.retract_recover_feedrate_mm_s); - EEPROM_WRITE(fwretract.swap_retract_length); - EEPROM_WRITE(fwretract.swap_retract_recover_length); - EEPROM_WRITE(fwretract.swap_retract_recover_feedrate_mm_s); - #endif - - // - // Volumetric & Filament Size - // - - _FIELD_TEST(parser_volumetric_enabled); - - #if DISABLED(NO_VOLUMETRICS) - - EEPROM_WRITE(parser.volumetric_enabled); - - // Save filament sizes - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(planner.filament_size)) dummy = planner.filament_size[q]; - EEPROM_WRITE(dummy); - } - - #else - - const bool volumetric_enabled = false; - dummy = DEFAULT_NOMINAL_FILAMENT_DIA; - EEPROM_WRITE(volumetric_enabled); - for (uint8_t q = MAX_EXTRUDERS; q--;) EEPROM_WRITE(dummy); - - #endif - - // - // Save TMC2130 or TMC2208 Configuration, and placeholder values - // - - _FIELD_TEST(tmc_stepper_current); - - uint16_t tmc_stepper_current[TMC_AXES] = { - #if HAS_TRINAMIC - #if AXIS_IS_TMC(X) - stepperX.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y) - stepperY.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z) - stepperZ.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(X2) - stepperX2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E0) - stepperE0.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E1) - stepperE1.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E2) - stepperE2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E3) - stepperE3.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E4) - stepperE4.getCurrent() - #else - 0 - #endif - #else - 0 - #endif - }; - EEPROM_WRITE(tmc_stepper_current); - - // - // Save TMC2130 or TMC2208 Hybrid Threshold, and placeholder values - // - - _FIELD_TEST(tmc_hybrid_threshold); - - uint32_t tmc_hybrid_threshold[TMC_AXES] = { - #if ENABLED(HYBRID_THRESHOLD) - #if AXIS_HAS_STEALTHCHOP(X) - TMC_GET_PWMTHRS(X, X), - #else - X_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_GET_PWMTHRS(Y, Y), - #else - Y_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_GET_PWMTHRS(Z, Z), - #else - Z_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_GET_PWMTHRS(X, X2), - #else - X2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_GET_PWMTHRS(Y, Y2), - #else - Y2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_GET_PWMTHRS(Z, Z2), - #else - Z2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_GET_PWMTHRS(E, E0), - #else - E0_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_GET_PWMTHRS(E, E1), - #else - E1_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_GET_PWMTHRS(E, E2), - #else - E2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_GET_PWMTHRS(E, E3), - #else - E3_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_GET_PWMTHRS(E, E4) - #else - E4_HYBRID_THRESHOLD - #endif - #else - 100, 100, 3, // X, Y, Z - 100, 100, 3, // X2, Y2, Z2 - 30, 30, 30, 30, 30 // E0, E1, E2, E3, E4 - #endif - }; - EEPROM_WRITE(tmc_hybrid_threshold); - - // - // TMC2130 Sensorless homing threshold - // - int16_t tmc_sgt[XYZ] = { - #if ENABLED(SENSORLESS_HOMING) - #if X_SENSORLESS - stepperX.sgt(), - #else - 0, - #endif - #if Y_SENSORLESS - stepperY.sgt(), - #else - 0, - #endif - #if Z_SENSORLESS - stepperZ.sgt() - #else - 0 - #endif - #else - 0 - #endif - }; - EEPROM_WRITE(tmc_sgt); - - // - // Linear Advance - // - - _FIELD_TEST(planner_extruder_advance_K); - - #if ENABLED(LIN_ADVANCE) - EEPROM_WRITE(planner.extruder_advance_K); - #else - dummy = 0; - EEPROM_WRITE(dummy); - #endif - - _FIELD_TEST(motor_current_setting); - - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]); - #else - const uint32_t dummyui32[XYZ] = { 0 }; - EEPROM_WRITE(dummyui32); - #endif - - // - // CNC Coordinate Systems - // - - _FIELD_TEST(coordinate_system); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - EEPROM_WRITE(coordinate_system); // 27 floats - #else - dummy = 0; - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Skew correction factors - // - - _FIELD_TEST(planner_xy_skew_factor); - - #if ENABLED(SKEW_CORRECTION) - EEPROM_WRITE(planner.xy_skew_factor); - EEPROM_WRITE(planner.xz_skew_factor); - EEPROM_WRITE(planner.yz_skew_factor); - #else - dummy = 0; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_unload_length)) dummy = filament_change_unload_length[q]; - EEPROM_WRITE(dummy); - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_load_length)) dummy = filament_change_load_length[q]; - EEPROM_WRITE(dummy); - } - #else - dummy = 0; - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Validate CRC and Data Size - // - if (!eeprom_error) { - const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET), - final_crc = working_crc; - - // Write the EEPROM header - eeprom_index = EEPROM_OFFSET; - - EEPROM_WRITE(version); - EEPROM_WRITE(final_crc); - - // Report storage size - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Settings Stored (", eeprom_size); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc); - SERIAL_ECHOLNPGM(")"); - #endif - - eeprom_error |= size_error(eeprom_size); - } -#if POWER_LOSS_RECOVER_SUPER_CAP - power_lose_save(); -#endif - // - // UBL Mesh - // - #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) - if (ubl.storage_slot >= 0) - store_mesh(ubl.storage_slot); - #endif - - return !eeprom_error; - } -#if POWER_LOSS_RECOVER_SUPER_CAP -#define EEPROM_OFFSET_POWEROFF 800 - - bool MarlinSettings::power_lose_save() { - - uint16_t working_crc = 0; - EEPROM_START(); - eeprom_index = EEPROM_OFFSET_POWEROFF; - - EEPROM_SKIP(working_crc); // Skip the checksum slot - working_crc = 0; - - EEPROM_WRITE(recovery_detect_cap); - - const uint16_t final_crc = working_crc; - const int eeprom_size = eeprom_index; - eeprom_index = EEPROM_OFFSET_POWEROFF; - EEPROM_WRITE(final_crc); - SERIAL_ECHOLN("save3"); - /* - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("poweroff Stored (", eeprom_size - EEPROM_OFFSET_POWEROFF); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc); - SERIAL_ECHOLNPGM(")"); - SERIAL_ECHOPAIR("write file name: ",P_file_name); -*/ - - } - - bool MarlinSettings::power_lose_load() { - uint16_t working_crc = 0; - uint16_t stored_crc; - EEPROM_START(); - eeprom_index = EEPROM_OFFSET_POWEROFF; - EEPROM_READ(stored_crc); - working_crc=0; - - EEPROM_READ(recovery_detect_cap); - - if (working_crc == stored_crc) { -//#if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("poweroff stored settings retrieved (", eeprom_index - EEPROM_OFFSET_POWEROFF); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc); - SERIAL_ECHOLNPGM(")"); - SERIAL_ECHOPAIR("read file name: ",recovery_detect_cap.file_name); -//#endif - } - else{ - SERIAL_ECHOPAIR(" \r\nbytes; crc error ", (uint32_t)working_crc); - SERIAL_ECHOPAIR(" \r\nbytes; crc error ", (uint32_t)stored_crc); - } - } - #endif - /** - * M501 - Retrieve Configuration - */ - bool MarlinSettings::_load() { - uint16_t working_crc = 0; - - EEPROM_START(); - - char stored_ver[4]; - EEPROM_READ_ALWAYS(stored_ver); - - uint16_t stored_crc; - EEPROM_READ_ALWAYS(stored_crc); - - // Version has to match or defaults are used - if (strncmp(version, stored_ver, 3) != 0) { - if (stored_ver[3] != '\0') { - stored_ver[0] = '?'; - stored_ver[1] = '\0'; - } - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("EEPROM version mismatch "); - SERIAL_ECHOPAIR("(EEPROM=", stored_ver); - SERIAL_ECHOLNPGM(" Marlin=" EEPROM_VERSION ")"); - #endif - eeprom_error = true; - reset(); - save(); - } - else { - float dummy = 0; - #if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT) || ENABLED(NO_VOLUMETRICS) - bool dummyb; - #endif - - working_crc = 0; // Init to 0. Accumulated by EEPROM_READ - - _FIELD_TEST(esteppers); - - // Number of esteppers may change - uint8_t esteppers; - EEPROM_READ_ALWAYS(esteppers); - - // - // Planner Motion - // - - // 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]; - EEPROM_READ(tmp1); // max_acceleration_mm_per_s2 - EEPROM_READ(planner.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) { - planner.max_acceleration_mm_per_s2[i] = i < XYZ + esteppers ? tmp1[i] : def1[i < COUNT(def1) ? i : COUNT(def1) - 1]; - planner.axis_steps_per_mm[i] = i < XYZ + esteppers ? tmp2[i] : def2[i < COUNT(def2) ? i : COUNT(def2) - 1]; - planner.max_feedrate_mm_s[i] = i < XYZ + esteppers ? tmp3[i] : def3[i < COUNT(def3) ? i : COUNT(def3) - 1]; - } - - EEPROM_READ(planner.acceleration); - EEPROM_READ(planner.retract_acceleration); - EEPROM_READ(planner.travel_acceleration); - EEPROM_READ(planner.min_feedrate_mm_s); - EEPROM_READ(planner.min_travel_feedrate_mm_s); - - #if ENABLED(JUNCTION_DEVIATION) - for (uint8_t q = 4; q--;) EEPROM_READ(dummy); - EEPROM_READ(planner.junction_deviation_mm); - #else - EEPROM_READ(planner.max_jerk); - EEPROM_READ(dummy); - #endif - - // - // Home Offset (M206) - // - - _FIELD_TEST(home_offset); - - #if !HAS_HOME_OFFSET - float home_offset[XYZ]; - #endif - EEPROM_READ(home_offset); - - // - // Hotend Offsets, if any - // - - #if HOTENDS > 1 - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_READ(hotend_offset[i][e]); - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - EEPROM_READ(new_z_fade_height); - #else - EEPROM_READ(dummy); - #endif - - // - // Mesh (Manual) Bed Leveling - // - - uint8_t mesh_num_x, mesh_num_y; - EEPROM_READ(dummy); - EEPROM_READ_ALWAYS(mesh_num_x); - EEPROM_READ_ALWAYS(mesh_num_y); - - #if ENABLED(MESH_BED_LEVELING) - if (!validating) mbl.z_offset = dummy; - if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) { - // EEPROM data fits the current mesh - EEPROM_READ(mbl.z_values); - } - else { - // EEPROM data is stale - if (!validating) mbl.reset(); - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - } - #else - // MBL is disabled - skip the stored data - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - #endif // MESH_BED_LEVELING - - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - float zprobe_zoffset; - #endif - EEPROM_READ(zprobe_zoffset); - - // - // Planar Bed Leveling matrix - // - - #if ABL_PLANAR - EEPROM_READ(planner.bed_level_matrix); - #else - for (uint8_t q = 9; q--;) EEPROM_READ(dummy); - #endif - - // - // Bilinear Auto Bed Leveling - // - - uint8_t grid_max_x, grid_max_y; - EEPROM_READ_ALWAYS(grid_max_x); // 1 byte - EEPROM_READ_ALWAYS(grid_max_y); // 1 byte - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) { - if (!validating) set_bed_leveling_enabled(false); - EEPROM_READ(bilinear_grid_spacing); // 2 ints - EEPROM_READ(bilinear_start); // 2 ints - EEPROM_READ(z_values); // 9 to 256 floats - } - else // EEPROM data is stale - #endif // AUTO_BED_LEVELING_BILINEAR - { - // Skip past disabled (or stale) Bilinear Grid data - int bgs[2], bs[2]; - EEPROM_READ(bgs); - EEPROM_READ(bs); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy); - } - - // - // Unified Bed Leveling active state - // - - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_READ(planner.leveling_active); - EEPROM_READ(ubl.storage_slot); - #else - uint8_t dummyui8; - EEPROM_READ(dummyb); - EEPROM_READ(dummyui8); - #endif // AUTO_BED_LEVELING_UBL - - // - // DELTA Geometry or Dual Endstops offsets - // - - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_READ(delta_height); // 1 float - EEPROM_READ(delta_endstop_adj); // 3 floats - EEPROM_READ(delta_radius); // 1 float - EEPROM_READ(delta_diagonal_rod); // 1 float - EEPROM_READ(delta_segments_per_second); // 1 float - EEPROM_READ(delta_calibration_radius); // 1 float - EEPROM_READ(delta_tower_angle_trim); // 3 floats - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - _FIELD_TEST(x_endstop_adj); - - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_READ(endstops.x_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_READ(endstops.y_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_READ(endstops.z_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - - #endif - - // - // LCD Preheat settings - // - - _FIELD_TEST(lcd_preheat_hotend_temp); - - #if DISABLED(ULTIPANEL) - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - #endif - EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats - EEPROM_READ(lcd_preheat_bed_temp); // 2 floats - EEPROM_READ(lcd_preheat_fan_speed); // 2 floats - - //EEPROM_ASSERT( - // WITHIN(lcd_preheat_fan_speed, 0, 255), - // "lcd_preheat_fan_speed out of range" - //); - - // - // Hotend PID - // - - #if ENABLED(PIDTEMP) - for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { - EEPROM_READ(dummy); // Kp - if (e < HOTENDS && dummy != DUMMY_PID_VALUE) { - // do not need to scale PID values as the values in EEPROM are already scaled - if (!validating) PID_PARAM(Kp, e) = dummy; - EEPROM_READ(PID_PARAM(Ki, e)); - EEPROM_READ(PID_PARAM(Kd, e)); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_READ(PID_PARAM(Kc, e)); - #else - EEPROM_READ(dummy); - #endif - } - else { - for (uint8_t q=3; q--;) EEPROM_READ(dummy); // Ki, Kd, Kc - } - } - #else // !PIDTEMP - // 4 x 4 = 16 slots for PID parameters - for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc - #endif // !PIDTEMP - - // - // PID Extrusion Scaling - // - - _FIELD_TEST(lpq_len); - - #if DISABLED(PID_EXTRUSION_SCALING) - int16_t LPQ_LEN; - #endif - EEPROM_READ(LPQ_LEN); - - // - // Heated Bed PID - // - - #if ENABLED(PIDTEMPBED) - EEPROM_READ(dummy); // bedKp - if (dummy != DUMMY_PID_VALUE) { - if (!validating) thermalManager.bedKp = dummy; - EEPROM_READ(thermalManager.bedKi); - EEPROM_READ(thermalManager.bedKd); - } - #else - for (uint8_t q=3; q--;) EEPROM_READ(dummy); // bedKp, bedKi, bedKd - #endif - - // - // LCD Contrast - // - - _FIELD_TEST(lcd_contrast); - - #if !HAS_LCD_CONTRAST - int16_t lcd_contrast; - #endif - EEPROM_READ(lcd_contrast); - - // - // Firmware Retraction - // - - #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - EEPROM_READ(fwretract.retract_length); - EEPROM_READ(fwretract.retract_feedrate_mm_s); - EEPROM_READ(fwretract.retract_zlift); - EEPROM_READ(fwretract.retract_recover_length); - EEPROM_READ(fwretract.retract_recover_feedrate_mm_s); - EEPROM_READ(fwretract.swap_retract_length); - EEPROM_READ(fwretract.swap_retract_recover_length); - EEPROM_READ(fwretract.swap_retract_recover_feedrate_mm_s); - #else - EEPROM_READ(dummyb); - for (uint8_t q=8; q--;) EEPROM_READ(dummy); - #endif - - // - // Volumetric & Filament Size - // - - _FIELD_TEST(parser_volumetric_enabled); - - #if DISABLED(NO_VOLUMETRICS) - - EEPROM_READ(parser.volumetric_enabled); - - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(planner.filament_size)) - planner.filament_size[q] = dummy; - } - - #else - - EEPROM_READ(dummyb); - for (uint8_t q=MAX_EXTRUDERS; q--;) EEPROM_READ(dummy); - - #endif - - if (!validating) reset_stepper_drivers(); - - // - // TMC2130 Stepper Settings - // - - _FIELD_TEST(tmc_stepper_current); - - #if HAS_TRINAMIC - - #define SET_CURR(Q) stepper##Q.setCurrent(currents[TMC_##Q] ? currents[TMC_##Q] : Q##_CURRENT, R_SENSE, HOLD_MULTIPLIER) - uint16_t currents[TMC_AXES]; - EEPROM_READ(currents); - if (!validating) { - #if AXIS_IS_TMC(X) - SET_CURR(X); - #endif - #if AXIS_IS_TMC(Y) - SET_CURR(Y); - #endif - #if AXIS_IS_TMC(Z) - SET_CURR(Z); - #endif - #if AXIS_IS_TMC(X2) - SET_CURR(X2); - #endif - #if AXIS_IS_TMC(Y2) - SET_CURR(Y2); - #endif - #if AXIS_IS_TMC(Z2) - SET_CURR(Z2); - #endif - #if AXIS_IS_TMC(E0) - SET_CURR(E0); - #endif - #if AXIS_IS_TMC(E1) - SET_CURR(E1); - #endif - #if AXIS_IS_TMC(E2) - SET_CURR(E2); - #endif - #if AXIS_IS_TMC(E3) - SET_CURR(E3); - #endif - #if AXIS_IS_TMC(E4) - SET_CURR(E4); - #endif - } - #else - uint16_t val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(val); - #endif - - #if ENABLED(HYBRID_THRESHOLD) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, tmc_hybrid_threshold[TMC_##Q], planner.axis_steps_per_mm[_AXIS(A)]) - uint32_t tmc_hybrid_threshold[TMC_AXES]; - EEPROM_READ(tmc_hybrid_threshold); - if (!validating) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SET_PWMTHRS(X, X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SET_PWMTHRS(Y, Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SET_PWMTHRS(Z, Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SET_PWMTHRS(X, X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SET_PWMTHRS(Y, Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SET_PWMTHRS(Z, Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SET_PWMTHRS(E, E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_SET_PWMTHRS(E, E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_SET_PWMTHRS(E, E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_SET_PWMTHRS(E, E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_SET_PWMTHRS(E, E4); - #endif - } - #else - uint32_t thrs_val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(thrs_val); - #endif - - /* - * TMC2130 Sensorless homing threshold. - * X and X2 use the same value - * Y and Y2 use the same value - * Z and Z2 use the same value - */ - int16_t tmc_sgt[XYZ]; - EEPROM_READ(tmc_sgt); - #if ENABLED(SENSORLESS_HOMING) - if (!validating) { - #ifdef X_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(X) - stepperX.sgt(tmc_sgt[0]); - #endif - #if AXIS_HAS_STALLGUARD(X2) - stepperX2.sgt(tmc_sgt[0]); - #endif - #endif - #ifdef Y_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Y) - stepperY.sgt(tmc_sgt[1]); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.sgt(tmc_sgt[1]); - #endif - #endif - #ifdef Z_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.sgt(tmc_sgt[2]); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.sgt(tmc_sgt[2]); - #endif - #endif - } - #endif - - // - // Linear Advance - // - - _FIELD_TEST(planner_extruder_advance_K); - - #if ENABLED(LIN_ADVANCE) - EEPROM_READ(planner.extruder_advance_K); - #else - EEPROM_READ(dummy); - #endif - - // - // Motor Current PWM - // - - _FIELD_TEST(motor_current_setting); - - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_READ(stepper.motor_current_setting[q]); - #else - uint32_t dummyui32[XYZ]; - EEPROM_READ(dummyui32); - #endif - - // - // CNC Coordinate System - // - - _FIELD_TEST(coordinate_system); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - if (!validating) (void)select_coordinate_system(-1); // Go back to machine space - EEPROM_READ(coordinate_system); // 27 floats - #else - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_READ(dummy); - #endif - - // - // Skew correction factors - // - - _FIELD_TEST(planner_xy_skew_factor); - - #if ENABLED(SKEW_CORRECTION_GCODE) - EEPROM_READ(planner.xy_skew_factor); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - EEPROM_READ(planner.xz_skew_factor); - EEPROM_READ(planner.yz_skew_factor); - #else - EEPROM_READ(dummy); - EEPROM_READ(dummy); - #endif - #else - for (uint8_t q = 3; q--;) EEPROM_READ(dummy); - #endif - - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_unload_length)) filament_change_unload_length[q] = dummy; - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_load_length)) filament_change_load_length[q] = dummy; - } - #else - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_READ(dummy); - #endif - - eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); - if (eeprom_error) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET))); - SERIAL_ECHOLNPAIR(" Size: ", datasize()); - - } - else if (working_crc != stored_crc) { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("EEPROM CRC mismatch - (stored) "); - SERIAL_ERROR(stored_crc); - SERIAL_ERRORPGM(" != "); - SERIAL_ERROR(working_crc); - SERIAL_ERRORLNPGM(" (calculated)!"); - #endif - } - else if (!validating) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHO(version); - SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET)); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc); - SERIAL_ECHOLNPGM(")"); - #endif - } - - if (!validating && !eeprom_error) postprocess(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (!validating) { - ubl.report_state(); - - if (!ubl.sanity_check()) { - SERIAL_EOL(); - #if ENABLED(EEPROM_CHITCHAT) - ubl.echo_name(); - SERIAL_ECHOLNPGM(" initialized.\n"); - #endif - } - else { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLPGM("?Can't enable "); - ubl.echo_name(); - SERIAL_PROTOCOLLNPGM("."); - #endif - ubl.reset(); - } - - if (ubl.storage_slot >= 0) { - load_mesh(ubl.storage_slot); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOPAIR("Mesh ", ubl.storage_slot); - SERIAL_ECHOLNPGM(" loaded from storage."); - #endif - } - else { - ubl.reset(); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOLNPGM("UBL System reset()"); - #endif - } - } - #endif - } - - #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) - if (!validating) report(); - #endif -#if POWER_LOSS_RECOVER_SUPER_CAP - (void)settings.power_lose_load(); -#endif - return !eeprom_error; - } - - bool MarlinSettings::validate() { - validating = true; - const bool success = _load(); - validating = false; - return success; - } - - bool MarlinSettings::load() { - if (validate()) return _load(); - reset(); - return true; - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - #if ENABLED(EEPROM_CHITCHAT) - void ubl_invalid_slot(const int s) { - SERIAL_PROTOCOLLNPGM("?Invalid slot."); - SERIAL_PROTOCOL(s); - SERIAL_PROTOCOLLNPGM(" mesh slots available."); - } - #endif - - uint16_t MarlinSettings::meshes_start_index() { - return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up - // or down a little bit without disrupting the mesh data - } - - uint16_t MarlinSettings::calc_num_meshes() { - return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values); - } - - int MarlinSettings::mesh_slot_offset(const int8_t slot) { - return meshes_end - (slot + 1) * sizeof(ubl.z_values); - } - - void MarlinSettings::store_mesh(const int8_t slot) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - const int16_t a = calc_num_meshes(); - if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - SERIAL_PROTOCOLPAIR("E2END=", E2END); - SERIAL_PROTOCOLPAIR(" meshes_end=", meshes_end); - SERIAL_PROTOCOLLNPAIR(" slot=", slot); - SERIAL_EOL(); - #endif - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); - - // Write crc to MAT along with other data, or just tack on to the beginning or end - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot); - #endif - - #else - - // Other mesh types - - #endif - } - - void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=NULL*/) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - const int16_t a = settings.calc_num_meshes(); - - if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - #endif - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; - read_data(pos, dest, sizeof(ubl.z_values), &crc); - - // Compare crc with crc from MAT, or read from end - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot); - #endif - - #else - - // Other mesh types - - #endif - } - - //void MarlinSettings::delete_mesh() { return; } - //void MarlinSettings::defrag_meshes() { return; } - - #endif // AUTO_BED_LEVELING_UBL - -#else // !EEPROM_SETTINGS - - bool MarlinSettings::save() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("EEPROM disabled"); - return false; - } - -#endif // !EEPROM_SETTINGS - -/** - * 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.axis_steps_per_mm[i] = pgm_read_float(&tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1]); - planner.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1]); - planner.max_acceleration_mm_per_s2[i] = pgm_read_dword_near(&tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1]); - } - - planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME; - planner.acceleration = DEFAULT_ACCELERATION; - planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; - planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; - planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; - planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; - - #if ENABLED(JUNCTION_DEVIATION) - planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); - #else - planner.max_jerk[X_AXIS] = DEFAULT_XJERK; - planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; - planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; - planner.max_jerk[E_AXIS] = DEFAULT_EJERK; - #endif - - #if HAS_HOME_OFFSET - ZERO(home_offset); - #endif - - #if HOTENDS > 1 - constexpr float tmp4[XYZ][HOTENDS] = { - HOTEND_OFFSET_X, - HOTEND_OFFSET_Y - #if HAS_HOTEND_OFFSET_Z - , HOTEND_OFFSET_Z - #else - , { 0 } - #endif - }; - static_assert( - tmp4[X_AXIS][0] == 0 && tmp4[Y_AXIS][0] == 0 && tmp4[Z_AXIS][0] == 0, - "Offsets for the first hotend must be 0.0." - ); - LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e]; - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - new_z_fade_height = 0.0; - #endif - - #if HAS_LEVELING - reset_bed_level(); - #endif - - #if HAS_BED_PROBE - zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; - #endif - - #if ENABLED(DELTA) - const float adj[ABC] = DELTA_ENDSTOP_ADJ, - dta[ABC] = DELTA_TOWER_ANGLE_TRIM; - delta_height = DELTA_HEIGHT; - COPY(delta_endstop_adj, adj); - delta_radius = DELTA_RADIUS; - delta_diagonal_rod = DELTA_DIAGONAL_ROD; - delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - delta_calibration_radius = DELTA_CALIBRATION_RADIUS; - COPY(delta_tower_angle_trim, dta); - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - #if ENABLED(X_DUAL_ENDSTOPS) - endstops.x_endstop_adj = ( - #ifdef X_DUAL_ENDSTOPS_ADJUSTMENT - X_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - endstops.y_endstop_adj = ( - #ifdef Y_DUAL_ENDSTOPS_ADJUSTMENT - Y_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - endstops.z_endstop_adj = ( - #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT - Z_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - - #endif - - #if ENABLED(ULTIPANEL) - lcd_preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; - lcd_preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; - lcd_preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; - lcd_preheat_bed_temp[1] = PREHEAT_2_TEMP_BED; - lcd_preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED; - lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED; - #endif - - #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - HOTEND_LOOP() - #endif - { - PID_PARAM(Kp, e) = float(DEFAULT_Kp); - PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki); - PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd); - #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = DEFAULT_Kc; - #endif - } - #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // default last-position-queue size - #endif - #endif // PIDTEMP - - #if ENABLED(PIDTEMPBED) - thermalManager.bedKp = DEFAULT_bedKp; - thermalManager.bedKi = scalePID_i(DEFAULT_bedKi); - thermalManager.bedKd = scalePID_d(DEFAULT_bedKd); - #endif - - #if HAS_LCD_CONTRAST - lcd_contrast = DEFAULT_LCD_CONTRAST; - #endif - - #if ENABLED(FWRETRACT) - fwretract.reset(); - #endif - - #if DISABLED(NO_VOLUMETRICS) - - parser.volumetric_enabled = - #if ENABLED(VOLUMETRIC_DEFAULT_ON) - true - #else - false - #endif - ; - for (uint8_t q = 0; q < COUNT(planner.filament_size); q++) - planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; - - #endif - - endstops.enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - - reset_stepper_drivers(); - - #if ENABLED(LIN_ADVANCE) - planner.extruder_advance_K = LIN_ADVANCE_K; - #endif - - #if HAS_MOTOR_CURRENT_PWM - uint32_t tmp_motor_current_setting[XYZ] = PWM_MOTOR_CURRENT; - for (uint8_t q = XYZ; q--;) - stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - planner.xy_skew_factor = XY_SKEW_FACTOR; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - planner.xz_skew_factor = XZ_SKEW_FACTOR; - planner.yz_skew_factor = YZ_SKEW_FACTOR; - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - filament_change_unload_length[e] = FILAMENT_CHANGE_UNLOAD_LENGTH; - filament_change_load_length[e] = FILAMENT_CHANGE_FAST_LOAD_LENGTH; - } - #endif - - postprocess(); - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); - #endif -} - -#if DISABLED(DISABLE_M503) - - #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START(); }while(0) - - #if HAS_TRINAMIC - void say_M906() { SERIAL_ECHOPGM(" M906"); } - #if ENABLED(HYBRID_THRESHOLD) - void say_M913() { SERIAL_ECHOPGM(" M913"); } - #endif - #if ENABLED(SENSORLESS_HOMING) - void say_M914() { SERIAL_ECHOPGM(" M914"); } - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - void say_M603() { SERIAL_ECHOPGM(" M603 "); } - #endif - - inline void say_units(const bool colon=false) { - serialprintPGM( - #if ENABLED(INCH_MODE_SUPPORT) - parser.linear_unit_factor != 1.0 ? PSTR(" (in)") : - #endif - PSTR(" (mm)") - ); - if (colon) SERIAL_ECHOLNPGM(":"); - } - - /** - * M503 - Report current settings in RAM - * - * Unless specifically disabled, M503 is available even without EEPROM - */ - void MarlinSettings::report(const bool forReplay) { - - /** - * Announce current units, in case inches are being displayed - */ - CONFIG_ECHO_START; - #if ENABLED(INCH_MODE_SUPPORT) - #define LINEAR_UNIT(N) (float(N) / parser.linear_unit_factor) - #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor)) - SERIAL_ECHOPGM(" G2"); - SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0'); - SERIAL_ECHOPGM(" ;"); - say_units(); - #else - #define LINEAR_UNIT(N) (N) - #define VOLUMETRIC_UNIT(N) (N) - SERIAL_ECHOPGM(" G21 ;"); - say_units(); - #endif - SERIAL_EOL(); - - #if ENABLED(ULTIPANEL) - - // Temperature units - for Ultipanel temperature options - - CONFIG_ECHO_START; - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - #define TEMP_UNIT(N) parser.to_temp_units(N) - SERIAL_ECHOPGM(" M149 "); - SERIAL_CHAR(parser.temp_units_code()); - SERIAL_ECHOPGM(" ; Units in "); - serialprintPGM(parser.temp_units_name()); - #else - #define TEMP_UNIT(N) (N) - SERIAL_ECHOLNPGM(" M149 C ; Units in Celsius"); - #endif - - #endif - - SERIAL_EOL(); - - #if DISABLED(NO_VOLUMETRICS) - - /** - * Volumetric extrusion M200 - */ - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Filament settings:"); - if (parser.volumetric_enabled) - SERIAL_EOL(); - else - SERIAL_ECHOLNPGM(" Disabled"); - } - - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 D", LINEAR_UNIT(planner.filament_size[0])); - SERIAL_EOL(); - #if EXTRUDERS > 1 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T1 D", LINEAR_UNIT(planner.filament_size[1])); - SERIAL_EOL(); - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T2 D", LINEAR_UNIT(planner.filament_size[2])); - SERIAL_EOL(); - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T3 D", LINEAR_UNIT(planner.filament_size[3])); - SERIAL_EOL(); - #if EXTRUDERS > 4 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T4 D", LINEAR_UNIT(planner.filament_size[4])); - SERIAL_EOL(); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - if (!parser.volumetric_enabled) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM(" M200 D0"); - } - - #endif // !NO_VOLUMETRICS - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Steps per unit:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.axis_steps_per_mm[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.axis_steps_per_mm[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.axis_steps_per_mm[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M92 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Maximum feedrates (units/s):"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M203 X", LINEAR_UNIT(planner.max_feedrate_mm_s[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_feedrate_mm_s[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_feedrate_mm_s[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M203 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Maximum Acceleration (units/s2):"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M201 X", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M201 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Acceleration (units/s2): P R T"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M204 P", LINEAR_UNIT(planner.acceleration)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(planner.retract_acceleration)); - SERIAL_ECHOLNPAIR(" T", LINEAR_UNIT(planner.travel_acceleration)); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Advanced: B S T"); - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPGM(" J"); - #else - SERIAL_ECHOPGM(" X Y Z"); - #endif - #if DISABLED(JUNCTION_DEVIATION) || ENABLED(LIN_ADVANCE) - SERIAL_ECHOPGM(" E"); - #endif - SERIAL_EOL(); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M205 B", LINEAR_UNIT(planner.min_segment_time_us)); - SERIAL_ECHOPAIR(" S", LINEAR_UNIT(planner.min_feedrate_mm_s)); - SERIAL_ECHOPAIR(" T", LINEAR_UNIT(planner.min_travel_feedrate_mm_s)); - - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPAIR(" J", LINEAR_UNIT(planner.junction_deviation_mm)); - #else - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS])); - SERIAL_ECHOPAIR(" E", LINEAR_UNIT(planner.max_jerk[E_AXIS])); - #endif - - SERIAL_EOL(); - - #if HAS_M206_COMMAND - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Home offset:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M206 X", LINEAR_UNIT(home_offset[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(home_offset[Y_AXIS])); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(home_offset[Z_AXIS])); - #endif - - #if HOTENDS > 1 - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hotend offsets:"); - } - CONFIG_ECHO_START; - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR(" M218 T", (int)e); - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(hotend_offset[X_AXIS][e])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e])); - #if HAS_HOTEND_OFFSET_Z - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e])); - #endif - SERIAL_EOL(); - } - #endif - - /** - * Bed Leveling - */ - #if HAS_LEVELING - - #if ENABLED(MESH_BED_LEVELING) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Mesh Bed Leveling:"); - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - CONFIG_ECHO_START; - ubl.echo_name(); - SERIAL_ECHOLNPGM(":"); - } - - #elif HAS_ABL - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Auto Bed Leveling:"); - } - - #endif - - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M420 S", planner.leveling_active ? 1 : 0); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.z_fade_height)); - #endif - SERIAL_EOL(); - - #if ENABLED(MESH_BED_LEVELING) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 S3 X", (int)px + 1); - SERIAL_ECHOPAIR(" Y", (int)py + 1); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(mbl.z_values[px][py]), 5); - SERIAL_EOL(); - } - } - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - SERIAL_EOL(); - ubl.report_state(); - SERIAL_ECHOLNPAIR("\nActive Mesh Slot: ", ubl.storage_slot); - SERIAL_ECHOPAIR("EEPROM can hold ", calc_num_meshes()); - SERIAL_ECHOLNPGM(" meshes.\n"); - } - - //ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large mesh's. A better (more terse) - // solution needs to be found. - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 W I", (int)px); - SERIAL_ECHOPAIR(" J", (int)py); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(z_values[px][py]), 5); - SERIAL_EOL(); - } - } - } - - #endif - - #endif // HAS_LEVELING - - #if ENABLED(DELTA) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Endstop adjustment:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS])); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS])); - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Delta settings: L R H S B XYZ"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M665 L", LINEAR_UNIT(delta_diagonal_rod)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius)); - SERIAL_ECHOPAIR(" H", LINEAR_UNIT(delta_height)); - SERIAL_ECHOPAIR(" S", delta_segments_per_second); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius)); - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS])); - SERIAL_EOL(); - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Endstop adjustment:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPGM(" M666"); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(endstops.x_endstop_adj)); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstops.y_endstop_adj)); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(endstops.z_endstop_adj)); - #endif - SERIAL_EOL(); - - #endif // [XYZ]_DUAL_ENDSTOPS - - #if ENABLED(ULTIPANEL) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Material heatup parameters:"); - } - for (uint8_t i = 0; i < COUNT(lcd_preheat_hotend_temp); i++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M145 S", (int)i); - SERIAL_ECHOPAIR(" H", TEMP_UNIT(lcd_preheat_hotend_temp[i])); - SERIAL_ECHOPAIR(" B", TEMP_UNIT(lcd_preheat_bed_temp[i])); - SERIAL_ECHOLNPAIR(" F", lcd_preheat_fan_speed[i]); - } - #endif // ULTIPANEL - - #if HAS_PID_HEATING - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("PID settings:"); - } - #if ENABLED(PIDTEMP) - #if HOTENDS > 1 - if (forReplay) { - HOTEND_LOOP() { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M301 E", e); - 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))); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); - if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); - #endif - SERIAL_EOL(); - } - } - else - #endif // HOTENDS > 1 - // !forReplay || HOTENDS == 1 - { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0 - SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); - SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0)); - SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); - #endif - SERIAL_EOL(); - } - #endif // PIDTEMP - - #if ENABLED(PIDTEMPBED) - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M304 P", thermalManager.bedKp); - SERIAL_ECHOPAIR(" I", unscalePID_i(thermalManager.bedKi)); - SERIAL_ECHOPAIR(" D", unscalePID_d(thermalManager.bedKd)); - SERIAL_EOL(); - #endif - - #endif // PIDTEMP || PIDTEMPBED - - #if HAS_LCD_CONTRAST - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("LCD Contrast:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M250 C", lcd_contrast); - #endif - - #if ENABLED(FWRETRACT) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Retract: S F Z"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M207 S", LINEAR_UNIT(fwretract.retract_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_length)); - SERIAL_ECHOPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_feedrate_mm_s))); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(fwretract.retract_zlift)); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Recover: S F"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M208 S", LINEAR_UNIT(fwretract.retract_recover_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_recover_length)); - SERIAL_ECHOLNPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_recover_feedrate_mm_s))); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M209 S", fwretract.autoretract_enabled ? 1 : 0); - - #endif // FWRETRACT - - /** - * Probe Offset - */ - #if HAS_BED_PROBE - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Z-Probe Offset"); - say_units(true); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M851 Z", LINEAR_UNIT(zprobe_zoffset)); - #endif - - /** - * Bed Skew Correction - */ - #if ENABLED(SKEW_CORRECTION_GCODE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Skew Factor: "); - } - CONFIG_ECHO_START; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPGM(" M852 I"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_ECHOPGM(" J"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6); - SERIAL_ECHOPGM(" K"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6); - SERIAL_EOL(); - #else - SERIAL_ECHOPGM(" M852 S"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_EOL(); - #endif - #endif - - #if HAS_TRINAMIC - - /** - * TMC2130 / TMC2208 stepper driver current - */ - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Stepper driver current:"); - } - CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M906(); - #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", stepperX.getCurrent()); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", stepperY.getCurrent()); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", stepperZ.getCurrent()); - #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M906(); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", stepperX2.getCurrent()); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", stepperY2.getCurrent()); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", stepperZ2.getCurrent()); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(E0) - say_M906(); - SERIAL_ECHOLNPAIR(" T0 E", stepperE0.getCurrent()); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M906(); - SERIAL_ECHOLNPAIR(" T1 E", stepperE1.getCurrent()); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M906(); - SERIAL_ECHOLNPAIR(" T2 E", stepperE2.getCurrent()); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M906(); - SERIAL_ECHOLNPAIR(" T3 E", stepperE3.getCurrent()); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M906(); - SERIAL_ECHOLNPAIR(" T4 E", stepperE4.getCurrent()); - #endif - SERIAL_EOL(); - - /** - * TMC2130 / TMC2208 / TRAMS Hybrid Threshold - */ - #if ENABLED(HYBRID_THRESHOLD) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hybrid Threshold:"); - } - CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M913(); - #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X)); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y)); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z)); - #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M913(); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X2)); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y2)); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z2)); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(E0) - say_M913(); - SERIAL_ECHOLNPAIR(" T0 E", TMC_GET_PWMTHRS(E, E0)); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M913(); - SERIAL_ECHOLNPAIR(" T1 E", TMC_GET_PWMTHRS(E, E1)); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M913(); - SERIAL_ECHOLNPAIR(" T2 E", TMC_GET_PWMTHRS(E, E2)); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M913(); - SERIAL_ECHOLNPAIR(" T3 E", TMC_GET_PWMTHRS(E, E3)); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M913(); - SERIAL_ECHOLNPAIR(" T4 E", TMC_GET_PWMTHRS(E, E4)); - #endif - SERIAL_EOL(); - #endif // HYBRID_THRESHOLD - - /** - * TMC2130 Sensorless homing thresholds - */ - #if ENABLED(SENSORLESS_HOMING) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Sensorless homing threshold:"); - } - CONFIG_ECHO_START; - #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS - say_M914(); - #if X_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX.sgt()); - #endif - #if Y_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY.sgt()); - #endif - #if Z_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ.sgt()); - #endif - SERIAL_EOL(); - #endif - - #define X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)) - #define Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)) - #define Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) - #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS - say_M914(); - SERIAL_ECHOPGM(" I1"); - #if X2_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX2.sgt()); - #endif - #if Y2_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY2.sgt()); - #endif - #if Z2_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ2.sgt()); - #endif - SERIAL_EOL(); - #endif - - #endif // SENSORLESS_HOMING - - #endif // HAS_TRINAMIC - - /** - * Linear Advance - */ - #if ENABLED(LIN_ADVANCE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Linear Advance:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K); - #endif - - #if HAS_MOTOR_CURRENT_PWM - CONFIG_ECHO_START; - if (!forReplay) { - SERIAL_ECHOLNPGM("Stepper motor currents:"); - CONFIG_ECHO_START; - } - SERIAL_ECHOPAIR(" M907 X", stepper.motor_current_setting[0]); - SERIAL_ECHOPAIR(" Z", stepper.motor_current_setting[1]); - SERIAL_ECHOPAIR(" E", stepper.motor_current_setting[2]); - SERIAL_EOL(); - #endif - - /** - * Advanced Pause filament load & unload lengths - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Filament load/unload lengths:"); - } - CONFIG_ECHO_START; - #if EXTRUDERS == 1 - say_M603(); - SERIAL_ECHOPAIR("L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - #else - say_M603(); - SERIAL_ECHOPAIR("T0 L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T1 L", LINEAR_UNIT(filament_change_load_length[1])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[1])); - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T2 L", LINEAR_UNIT(filament_change_load_length[2])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[2])); - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T3 L", LINEAR_UNIT(filament_change_load_length[3])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[3])); - #if EXTRUDERS > 4 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T4 L", LINEAR_UNIT(filament_change_load_length[4])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[4])); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS == 1 - #endif // ADVANCED_PAUSE_FEATURE - } - -#endif // !DISABLE_M503 diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h deleted file mode 100644 index c191c89f2f..0000000000 --- a/Marlin/configuration_store.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef CONFIGURATION_STORE_H -#define CONFIGURATION_STORE_H - -#include "MarlinConfig.h" - -class MarlinSettings { - public: - MarlinSettings() { } - - static uint16_t datasize(); - - static void reset(); - static bool save(); // Return 'true' if data was saved -#if POWER_LOSS_RECOVER_SUPER_CAP - static bool power_lose_save(); - static bool power_lose_load(); -#endif - FORCE_INLINE static bool init_eeprom() { - reset(); - #if ENABLED(EEPROM_SETTINGS) - const bool success = save(); - #if ENABLED(EEPROM_CHITCHAT) - if (success) report(); - #endif - return success; - #else - return true; - #endif - } - - #if ENABLED(EEPROM_SETTINGS) - static bool load(); // Return 'true' if data was loaded ok - static bool validate(); // Return 'true' if EEPROM data is ok - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static uint16_t meshes_start_index(); - FORCE_INLINE static uint16_t meshes_end_index() { return meshes_end; } - static uint16_t calc_num_meshes(); - static int mesh_slot_offset(const int8_t slot); - static void store_mesh(const int8_t slot); - static void load_mesh(const int8_t slot, void * const into=NULL); - - //static void delete_mesh(); // necessary if we have a MAT - //static void defrag_meshes(); // " - #endif - #else - FORCE_INLINE - static bool load() { reset(); report(); return true; } - #endif - - #if DISABLED(DISABLE_M503) - static void report(const bool forReplay=false); - #else - FORCE_INLINE - static void report(const bool forReplay=false) { UNUSED(forReplay); } - #endif - - private: - static void postprocess(); - - #if ENABLED(EEPROM_SETTINGS) - - static bool eeprom_error, validating; - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static constexpr uint16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom - - #endif - - static bool _load(); - static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc); - static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc, const bool force=false); - static bool size_error(const uint16_t size); - #endif -}; - -extern MarlinSettings settings; - -#endif // CONFIGURATION_STORE_H diff --git a/Marlin/dac_mcp4728.cpp b/Marlin/dac_mcp4728.cpp deleted file mode 100644 index 783f9fb5e0..0000000000 --- a/Marlin/dac_mcp4728.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * mcp4728.cpp - Arduino library for MicroChip MCP4728 I2C D/A converter - * - * For implementation details, please take a look at the datasheet: - * http://ww1.microchip.com/downloads/en/DeviceDoc/22187a.pdf - * - * For discussion and feedback, please go to: - * http://arduino.cc/forum/index.php/topic,51842.0.html - */ - -#include "MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - -#include "dac_mcp4728.h" -#include "enum.h" - -uint16_t mcp4728_values[XYZE]; - -/** - * Begin I2C, get current values (input register and eeprom) of mcp4728 - */ -void mcp4728_init() { - Wire.begin(); - Wire.requestFrom(int(DAC_DEV_ADDRESS), 24); - while (Wire.available()) { - char deviceID = Wire.read(), - hiByte = Wire.read(), - loByte = Wire.read(); - - if (!(deviceID & 0x08)) - mcp4728_values[(deviceID & 0x30) >> 4] = word((hiByte & 0x0F), loByte); - } -} - -/** - * Write input resister value to specified channel using fastwrite method. - * Channel : 0-3, Values : 0-4095 - */ -uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value) { - mcp4728_values[channel] = value; - return mcp4728_fastWrite(); -} - -/** - * Write all input resistor values to EEPROM using SequencialWrite method. - * This will update both input register and EEPROM value - * This will also write current Vref, PowerDown, Gain settings to EEPROM - */ -uint8_t mcp4728_eepromWrite() { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(SEQWRITE); - LOOP_XYZE(i) { - Wire.write(DAC_STEPPER_VREF << 7 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Write Voltage reference setting to all input regiters - */ -uint8_t mcp4728_setVref_all(uint8_t value) { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(VREFWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} -/** - * Write Gain setting to all input regiters - */ -uint8_t mcp4728_setGain_all(uint8_t value) { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(GAINWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} - -/** - * Return Input Register value - */ -uint16_t mcp4728_getValue(uint8_t channel) { return mcp4728_values[channel]; } - -/** - * Steph: Might be useful in the future - * Return Vout - * -uint16_t mcp4728_getVout(uint8_t channel) { - uint32_t vref = 2048, - vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; - if (vOut > defaultVDD) vOut = defaultVDD; - return vOut; -} -*/ - -/** - * Returns DAC values as a 0-100 percentage of drive strength - */ -uint8_t mcp4728_getDrvPct(uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); } - -/** - * Receives all Drive strengths as 0-100 percent values, updates - * DAC Values array and calls fastwrite to update the DAC. - */ -void mcp4728_setDrvPct(uint8_t pct[XYZE]) { - LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX); - mcp4728_fastWrite(); -} - -/** - * FastWrite input register values - All DAC ouput update. refer to DATASHEET 5.6.1 - * DAC Input and PowerDown bits update. - * No EEPROM update - */ -uint8_t mcp4728_fastWrite() { - Wire.beginTransmission(DAC_DEV_ADDRESS); - LOOP_XYZE(i) { - Wire.write(highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Common function for simple general commands - */ -uint8_t mcp4728_simpleCommand(byte simpleCommand) { - Wire.beginTransmission(GENERALCALL); - Wire.write(simpleCommand); - return Wire.endTransmission(); -} - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h deleted file mode 100644 index f8337316de..0000000000 --- a/Marlin/dac_mcp4728.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino library for MicroChip MCP4728 I2C D/A converter. - */ - -#ifndef DAC_MCP4728_H -#define DAC_MCP4728_H - -#include "MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) -#include "Wire.h" - -#define defaultVDD DAC_STEPPER_MAX //was 5000 but differs with internal Vref -#define BASE_ADDR 0x60 -#define RESET 0B00000110 -#define WAKE 0B00001001 -#define UPDATE 0B00001000 -#define MULTIWRITE 0B01000000 -#define SINGLEWRITE 0B01011000 -#define SEQWRITE 0B01010000 -#define VREFWRITE 0B10000000 -#define GAINWRITE 0B11000000 -#define POWERDOWNWRITE 0B10100000 -#define GENERALCALL 0B00000000 -#define GAINWRITE 0B11000000 - -// This is taken from the original lib, makes it easy to edit if needed -// DAC_OR_ADDRESS defined in pins_BOARD.h file -#define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS) - - -void mcp4728_init(); -uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value); -uint8_t mcp4728_eepromWrite(); -uint8_t mcp4728_setVref_all(uint8_t value); -uint8_t mcp4728_setGain_all(uint8_t value); -uint16_t mcp4728_getValue(uint8_t channel); -uint8_t mcp4728_fastWrite(); -uint8_t mcp4728_simpleCommand(byte simpleCommand); -uint8_t mcp4728_getDrvPct(uint8_t channel); -void mcp4728_setDrvPct(uint8_t pct[XYZE]); - -#endif -#endif // DAC_MCP4728_H diff --git a/Marlin/delay.h b/Marlin/delay.h deleted file mode 100644 index 5689b2b4c1..0000000000 --- a/Marlin/delay.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AVR busy wait delay Cycles routines: - * - * DELAY_CYCLES(count): Delay execution in cycles - * DELAY_NS(count): Delay execution in nanoseconds - * DELAY_US(count): Delay execution in microseconds - */ - -#ifndef MARLIN_DELAY_H -#define MARLIN_DELAY_H - -#define nop() __asm__ __volatile__("nop;\n\t":::) - -FORCE_INLINE static void __delay_4cycles(uint8_t cy) { - __asm__ __volatile__( - L("1") - A("dec %[cnt]") - A("nop") - A("brne 1b") - : [cnt] "+r"(cy) // output: +r means input+output - : // input: - : "cc" // clobbers: - ); -} - -/* ---------------- Delay in cycles */ -FORCE_INLINE static void DELAY_CYCLES(uint16_t x) { - - if (__builtin_constant_p(x)) { - #define MAXNOPS 4 - - if (x <= (MAXNOPS)) { - switch (x) { case 4: nop(); case 3: nop(); case 2: nop(); case 1: nop(); } - } - else { - const uint32_t rem = (x) % (MAXNOPS); - switch (rem) { case 3: nop(); case 2: nop(); case 1: nop(); } - if ((x = (x) / (MAXNOPS))) - __delay_4cycles(x); // if need more then 4 nop loop is more optimal - } - - #undef MAXNOPS - } - else - __delay_4cycles(x / 4); -} -#undef nop - -/* ---------------- Delay in nanoseconds */ -#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) / 1000L ) - -/* ---------------- Delay in microseconds */ -#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) ) - -#endif // MARLIN_DELAY_H diff --git a/Marlin/digipot_mcp4018.cpp b/Marlin/digipot_mcp4018.cpp deleted file mode 100644 index 5871fdb99c..0000000000 --- a/Marlin/digipot_mcp4018.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(DIGIPOT_I2C) && ENABLED(DIGIPOT_MCP4018) - -#include "enum.h" -#include "Stream.h" -#include "utility/twi.h" -#include //https://github.com/stawel/SlowSoftI2CMaster - -// Settings for the I2C based DIGIPOT (MCP4018) based on WT150 - -#define DIGIPOT_I2C_ADDRESS 0x2F - -#define DIGIPOT_A4988_Rsx 0.250 -#define DIGIPOT_A4988_Vrefmax 1.666 -#define DIGIPOT_A4988_MAX_VALUE 127 - -#define DIGIPOT_A4988_Itripmax(Vref) ((Vref)/(8.0*DIGIPOT_A4988_Rsx)) - -#define DIGIPOT_A4988_FACTOR ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax)) -#define DIGIPOT_A4988_MAX_CURRENT 2.0 - -static byte current_to_wiper(const float current) { - const int16_t value = ceil(float(DIGIPOT_A4988_FACTOR) * current); - return byte(constrain(value, 0, DIGIPOT_A4988_MAX_VALUE)); -} - -const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = { - DIGIPOTS_I2C_SDA_X - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , DIGIPOTS_I2C_SDA_Y - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , DIGIPOTS_I2C_SDA_Z - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , DIGIPOTS_I2C_SDA_E0 - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , DIGIPOTS_I2C_SDA_E1 - #endif - #endif - #endif - #endif -}; - -static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { - SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL } - #endif - #endif - #endif - #endif -}; - -static void i2c_send(const uint8_t channel, const byte v) { - if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) { - pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS) << 1) | I2C_WRITE); - pots[channel].i2c_write(v); - pots[channel].i2c_stop(); - } -} - -// This is for the MCP4018 I2C based digipot -void digipot_i2c_set_current(uint8_t channel, float current) { - i2c_send(channel, current_to_wiper(MIN(MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT)))); -} - -void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - - for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++) - pots[i].i2c_init(); - - // setup initial currents as defined in Configuration_adv.h - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C && DIGIPOT_MCP4018 diff --git a/Marlin/digipot_mcp4451.cpp b/Marlin/digipot_mcp4451.cpp deleted file mode 100644 index fed84b2645..0000000000 --- a/Marlin/digipot_mcp4451.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018) - -#include "Stream.h" -#include "utility/twi.h" -#include "Wire.h" - -// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro -#if MB(5DPRINT) - #define DIGIPOT_I2C_FACTOR 117.96 - #define DIGIPOT_I2C_MAX_CURRENT 1.736 -#else - #define DIGIPOT_I2C_FACTOR 106.7 - #define DIGIPOT_I2C_MAX_CURRENT 2.5 -#endif - -static byte current_to_wiper(const float current) { - return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current)))); -} - -static void i2c_send(const byte addr, const byte a, const byte b) { - Wire.beginTransmission(addr); - Wire.write(a); - Wire.write(b); - Wire.endTransmission(); -} - -// This is for the MCP4451 I2C based digipot -void digipot_i2c_set_current(uint8_t channel, float current) { - current = MIN((float) MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT); - // these addresses are specific to Azteeg X3 Pro, can be set to others, - // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 - byte addr = 0x2C; // channel 0-3 - if (channel >= 4) { - addr = 0x2E; // channel 4-7 - channel -= 4; - } - - // Initial setup - i2c_send(addr, 0x40, 0xFF); - i2c_send(addr, 0xA0, 0xFF); - - // Set actual wiper value - byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; - i2c_send(addr, addresses[channel], current_to_wiper(current)); -} - -void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - Wire.begin(); - // setup initial currents as defined in Configuration_adv.h - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h deleted file mode 100644 index 12e6499f93..0000000000 --- a/Marlin/dogm_bitmaps.h +++ /dev/null @@ -1,1217 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Standard Marlin Boot and Status Screen bitmaps - * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html - */ - -#include "MarlinConfig.h" - - -#if ENABLED(SHOW_BOOTSCREEN) - - //#define START_BMPHIGH // Costs 399 bytes more flash - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - #include "_Bootscreen.h" -#define CUSTOM_BOOTSCREEN_TIMEOUT 25000 - - #ifndef CUSTOM_BOOTSCREEN_TIMEOUT - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #endif - - #endif - - #if ENABLED(START_BMPHIGH) - - #define START_BMPWIDTH 112 - - const unsigned char start_bmp[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - #else - - #define START_BMPWIDTH 128//56 - - - const unsigned char start_bmp[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x03, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xC3, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0xE1, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x03, 0xF0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x07, 0xF8, 0x1F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0xF8, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x1F, 0xF0, 0x03, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3F, 0xE0, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x80, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x00, 0x20, 0x07, 0x83, 0xFF, 0x87, 0xFF, 0x10, 0x00, 0x81, 0xC0, 0x60, 0x0C, 0x7F, 0xF8, -0x7C, 0x00, 0x70, 0x0F, 0x87, 0xFF, 0xCF, 0xFF, 0x98, 0x01, 0x87, 0xF0, 0x70, 0x0C, 0xFF, 0xFC, -0x7C, 0x01, 0xFE, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x9C, 0x03, 0x8E, 0x38, 0x78, 0x0C, 0x00, 0x00, -0x7C, 0x07, 0xFC, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x8E, 0x07, 0x1C, 0x1C, 0x7C, 0x0C, 0x00, 0x00, -0x7C, 0x01, 0xF0, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x87, 0x0E, 0x18, 0x0C, 0x6E, 0x0C, 0x00, 0x00, -0x7C, 0x00, 0xE0, 0x0F, 0x83, 0xFF, 0x8F, 0xFF, 0x83, 0xFC, 0x30, 0x06, 0x66, 0x0C, 0x7F, 0xF8, -0x7C, 0x00, 0x00, 0x0F, 0x87, 0xFF, 0xCF, 0xFF, 0x01, 0xF8, 0x30, 0x06, 0x60, 0x0C, 0xFF, 0xFC, -0x7C, 0x00, 0x80, 0x0F, 0x80, 0x00, 0x0C, 0x03, 0x00, 0x60, 0x30, 0x06, 0x60, 0xCC, 0x00, 0x00, -0x7C, 0x01, 0xF0, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x18, 0x0C, 0x60, 0xEC, 0x00, 0x00, -0x7C, 0x03, 0xFC, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x1C, 0x1C, 0x60, 0x7C, 0x00, 0x00, -0x7C, 0x0F, 0xF8, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x0E, 0x38, 0x60, 0x3C, 0x00, 0x00, -0x7C, 0x03, 0xE0, 0x0F, 0x83, 0xFF, 0x8C, 0x01, 0x80, 0x60, 0x07, 0xF0, 0x60, 0x1C, 0x7F, 0xF8, -0x7E, 0x01, 0xC0, 0x0F, 0x87, 0xFF, 0xCC, 0x01, 0x80, 0x60, 0x01, 0xC0, 0x60, 0x0C, 0xFF, 0xFC, -0x7F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xC0, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xF0, 0x00, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3F, 0xFC, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0xFF, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x03, 0xFF, 0x9F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0x9F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x3F, 0x9F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x1F, 0x9F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - }; - - #endif - - #ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) - #endif - #ifndef START_BMPHEIGHT - #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) - #endif - - static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); - -#endif - -#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) - - // This file must define STATUS_SCREENWIDTH and status_screen[012]_bmp. - // It can also define STATUS_SCREEN_X, STATUS_SCREEN_{BED,FAN}_TEXT_X and - // STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations. - #include "_Statusscreen.h" - -#else // !CUSTOM_STATUS_SCREEN_IMAGE - - // Can also be overridden in Configuration.h - // If you can afford it, try the 3-frame fan animation! - #ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 - #endif - - #if HAS_HEATED_BED - - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 64)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 64)) - - #if HOTENDS == 0 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #else // !HAS_HEATED_BED - - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 96)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 96)) - - #if HOTENDS == 0 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #endif // !HAS_HEATED_BED - -#endif // !CUSTOM_STATUS_SCREEN_IMAGE - -#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - const unsigned char cw_bmp[] PROGMEM = { - B00000011,B11111000,B00000000, - B00001111,B11111110,B00000000, - B00011110,B00001111,B00000000, - B00111000,B00000111,B00000000, - B00111000,B00000011,B10000000, - B01110000,B00000011,B10000000, - B01110000,B00001111,B11100000, - B01110000,B00000111,B11000000, - B01110000,B00000011,B10000000, - B01110000,B00000001,B00000000, - B01110000,B00000000,B00000000, - B00111000,B00000000,B00000000, - B00111000,B00000111,B00000000, - B00011110,B00001111,B00000000, - B00001111,B11111110,B00000000, - B00000011,B11111000,B00000000 - }; - - const unsigned char ccw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B10000011,B11000000, - B00001110,B00000001,B11000000, - B00001110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00111110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00001000,B00000000,B11100000, - B00000000,B00000000,B11100000, - B00000000,B00000001,B11000000, - B00001110,B00000001,B11000000, - B00001111,B00000111,B10000000, - B00000111,B11111111,B00000000, - B00000001,B11111100,B00000000 - }; - - const unsigned char up_arrow_bmp[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00011111,B00000000, - B00111111,B10000000, - B01111111,B11000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000 - }; - - const unsigned char down_arrow_bmp[] PROGMEM = { - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B00111111,B10000000, - B00011111,B00000000, - B00001110,B00000000, - B00000100,B00000000 - }; - - const unsigned char offset_bedline_bmp[] PROGMEM = { - B11111111,B11111111,B11111111 - }; - - const unsigned char nozzle_bmp[] PROGMEM = { - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B01111111,B10000000, - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B00111111,B00000000, - B00011110,B00000000, - B00001100,B00000000 - }; - -#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - -#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) -#endif -#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT - #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) -#endif - -#ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 -#elif FAN_ANIM_FRAMES > 3 - #error "Only 3 fan animation frames currently supported." -#endif -#ifndef STATUS_SCREEN_X - #define STATUS_SCREEN_X 0 -#endif -#ifndef STATUS_SCREEN_Y - #define STATUS_SCREEN_Y 1 -#endif -#ifndef STATUS_BMP_BYTEWIDTH - #define STATUS_BMP_BYTEWIDTH ((STATUS_SCREENWIDTH + 7) / 8) -#endif -#ifndef STATUS_SCREENHEIGHT - #define STATUS_SCREENHEIGHT (sizeof(status_screen0_bmp) / (STATUS_BMP_BYTEWIDTH)) -#endif -#ifndef STATUS_SCREEN_HOTEND_TEXT_X - #define STATUS_SCREEN_HOTEND_TEXT_X(i) (5 + (i) * 25) -#endif -#ifndef STATUS_SCREEN_BED_TEXT_X - #define STATUS_SCREEN_BED_TEXT_X 81 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_X - #define STATUS_SCREEN_FAN_TEXT_X 104 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_Y - #define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) -#endif - -#define BMP_SIZE (STATUS_BMP_BYTEWIDTH) * (STATUS_SCREENHEIGHT) -static_assert(sizeof(status_screen0_bmp) == BMP_SIZE, "Status header (status_screen0_bmp) dimensions don't match data."); -#if FAN_ANIM_FRAMES > 1 - static_assert(sizeof(status_screen1_bmp) == BMP_SIZE, "Status header (status_screen1_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 2 - static_assert(sizeof(status_screen2_bmp) == BMP_SIZE, "Status header (status_screen2_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 3 - static_assert(sizeof(status_screen3_bmp) == BMP_SIZE, "Status header (status_screen3_bmp) dimensions don't match data."); - #endif - #endif -#endif diff --git a/Marlin/dogm_font_data_6x9_marlin.h b/Marlin/dogm_font_data_6x9_marlin.h deleted file mode 100644 index f298a6ac78..0000000000 --- a/Marlin/dogm_font_data_6x9_marlin.h +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1 - Copyright: Public domain font. Share and enjoy. - Capital A Height: 6, '1' Height: 6 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 6 descent=-2 - X Font ascent = 6 descent=-2 - Max Font ascent = 7 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = { - 0, 6, 9, 0, 254, 6, 1, 137, 2, 254, 32, 255, 254, 7, 254, 6, - 254, 0, 0, 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 128, 128, - 128, 0, 128, 3, 3, 3, 6, 1, 3, 160, 160, 160, 5, 7, 7, 6, - 0, 255, 80, 80, 248, 80, 248, 80, 80, 5, 9, 9, 6, 0, 254, 32, - 112, 168, 160, 112, 40, 168, 112, 32, 6, 8, 8, 6, 0, 255, 64, 168, - 72, 16, 32, 72, 84, 8, 5, 7, 7, 6, 0, 255, 96, 144, 144, 96, - 152, 144, 104, 1, 3, 3, 6, 2, 3, 128, 128, 128, 2, 7, 7, 6, - 2, 255, 64, 128, 128, 128, 128, 128, 64, 2, 7, 7, 6, 2, 255, 128, - 64, 64, 64, 64, 64, 128, 5, 5, 5, 6, 0, 0, 136, 80, 248, 80, - 136, 5, 5, 5, 6, 0, 0, 32, 32, 248, 32, 32, 2, 4, 4, 6, - 2, 254, 192, 64, 64, 128, 5, 1, 1, 6, 0, 2, 248, 2, 2, 2, - 6, 2, 0, 192, 192, 4, 6, 6, 6, 1, 0, 16, 16, 32, 64, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 144, 144, 144, 96, 3, 6, 6, - 6, 1, 0, 64, 192, 64, 64, 64, 224, 4, 6, 6, 6, 1, 0, 96, - 144, 16, 32, 64, 240, 4, 6, 6, 6, 1, 0, 240, 32, 96, 16, 16, - 224, 5, 6, 6, 6, 0, 0, 16, 48, 80, 144, 248, 16, 4, 6, 6, - 6, 1, 0, 240, 128, 224, 16, 16, 224, 4, 6, 6, 6, 1, 0, 96, - 128, 224, 144, 144, 96, 4, 6, 6, 6, 1, 0, 240, 16, 16, 32, 64, - 64, 4, 6, 6, 6, 1, 0, 96, 144, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 96, 144, 144, 112, 16, 96, 2, 5, 5, 6, 2, 0, 192, - 192, 0, 192, 192, 2, 7, 7, 6, 2, 254, 192, 192, 0, 192, 64, 64, - 128, 5, 5, 5, 6, 0, 0, 24, 96, 128, 96, 24, 5, 3, 3, 6, - 0, 1, 248, 0, 248, 5, 5, 5, 6, 0, 0, 192, 48, 8, 48, 192, - 4, 7, 7, 6, 1, 0, 96, 144, 16, 96, 64, 0, 64, 5, 6, 6, - 6, 0, 0, 112, 144, 168, 176, 128, 112, 5, 6, 6, 6, 0, 0, 32, - 80, 136, 248, 136, 136, 5, 6, 6, 6, 0, 0, 240, 136, 240, 136, 136, - 240, 4, 6, 6, 6, 1, 0, 96, 144, 128, 128, 144, 96, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 144, 144, 224, 4, 6, 6, 6, 1, 0, 240, - 128, 224, 128, 128, 240, 4, 6, 6, 6, 1, 0, 240, 128, 224, 128, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 128, 176, 144, 96, 4, 6, 6, - 6, 1, 0, 144, 144, 240, 144, 144, 144, 3, 6, 6, 6, 1, 0, 224, - 64, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, 56, 16, 16, 16, 144, - 96, 4, 6, 6, 6, 1, 0, 144, 160, 192, 160, 144, 144, 4, 6, 6, - 6, 1, 0, 128, 128, 128, 128, 128, 240, 5, 6, 6, 6, 0, 0, 136, - 216, 168, 168, 136, 136, 4, 6, 6, 6, 1, 0, 144, 208, 176, 144, 144, - 144, 5, 6, 6, 6, 0, 0, 112, 136, 136, 136, 136, 112, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 224, 128, 128, 4, 7, 7, 6, 1, 255, 96, - 144, 144, 208, 176, 96, 16, 4, 6, 6, 6, 1, 0, 224, 144, 144, 224, - 144, 144, 4, 6, 6, 6, 1, 0, 96, 144, 64, 32, 144, 96, 5, 6, - 6, 6, 0, 0, 248, 32, 32, 32, 32, 32, 4, 6, 6, 6, 1, 0, - 144, 144, 144, 144, 144, 96, 4, 6, 6, 6, 1, 0, 144, 144, 144, 240, - 96, 96, 5, 6, 6, 6, 0, 0, 136, 136, 168, 168, 216, 136, 5, 6, - 6, 6, 0, 0, 136, 80, 32, 32, 80, 136, 5, 6, 6, 6, 0, 0, - 136, 136, 80, 32, 32, 32, 4, 6, 6, 6, 1, 0, 240, 16, 32, 64, - 128, 240, 3, 6, 6, 6, 1, 0, 224, 128, 128, 128, 128, 224, 4, 6, - 6, 6, 1, 0, 128, 128, 64, 32, 16, 16, 3, 6, 6, 6, 1, 0, - 224, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 3, 32, 80, 136, 5, - 1, 1, 6, 0, 254, 248, 2, 2, 2, 6, 2, 4, 128, 64, 4, 4, - 4, 6, 1, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, 128, 128, - 224, 144, 144, 224, 4, 4, 4, 6, 1, 0, 112, 128, 128, 112, 4, 6, - 6, 6, 1, 0, 16, 16, 112, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 96, 176, 192, 112, 4, 6, 6, 6, 1, 0, 32, 80, 64, 224, 64, 64, - 4, 6, 6, 6, 1, 254, 96, 144, 144, 112, 16, 96, 4, 6, 6, 6, - 1, 0, 128, 128, 224, 144, 144, 144, 3, 6, 6, 6, 1, 0, 64, 0, - 192, 64, 64, 224, 3, 8, 8, 6, 1, 254, 32, 0, 96, 32, 32, 32, - 160, 64, 4, 6, 6, 6, 1, 0, 128, 128, 160, 192, 160, 144, 3, 6, - 6, 6, 1, 0, 192, 64, 64, 64, 64, 224, 5, 4, 4, 6, 0, 0, - 208, 168, 168, 136, 4, 4, 4, 6, 1, 0, 224, 144, 144, 144, 4, 4, - 4, 6, 1, 0, 96, 144, 144, 96, 4, 6, 6, 6, 1, 254, 224, 144, - 144, 224, 128, 128, 4, 6, 6, 6, 1, 254, 112, 144, 144, 112, 16, 16, - 4, 4, 4, 6, 1, 0, 160, 208, 128, 128, 4, 4, 4, 6, 1, 0, - 112, 192, 48, 224, 4, 6, 6, 6, 1, 0, 64, 64, 224, 64, 80, 32, - 4, 4, 4, 6, 1, 0, 144, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 144, 144, 96, 96, 5, 4, 4, 6, 0, 0, 136, 168, 168, 80, 4, 4, - 4, 6, 1, 0, 144, 96, 96, 144, 4, 6, 6, 6, 1, 254, 144, 144, - 144, 112, 144, 96, 4, 4, 4, 6, 1, 0, 240, 32, 64, 240, 3, 7, - 7, 6, 1, 0, 32, 64, 64, 128, 64, 64, 32, 1, 7, 7, 6, 2, - 255, 128, 128, 128, 128, 128, 128, 128, 3, 7, 7, 6, 1, 0, 128, 64, - 64, 32, 64, 64, 128, 4, 2, 2, 6, 1, 3, 80, 160, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, - 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 0, 128, 128, 128, 128, - 4, 6, 6, 6, 1, 255, 32, 112, 160, 160, 112, 32, 5, 7, 7, 6, - 0, 255, 48, 72, 64, 240, 64, 64, 248, 5, 5, 5, 6, 0, 0, 168, - 80, 136, 80, 168, 5, 6, 6, 6, 0, 0, 136, 80, 248, 32, 248, 32, - 1, 7, 7, 6, 2, 255, 128, 128, 128, 0, 128, 128, 128, 4, 7, 7, - 6, 1, 255, 112, 128, 96, 144, 96, 16, 224, 3, 1, 1, 6, 1, 5, - 160, 6, 7, 7, 6, 0, 0, 120, 132, 148, 164, 148, 132, 120, 3, 5, - 5, 6, 1, 1, 96, 160, 96, 0, 224, 5, 5, 5, 6, 0, 0, 40, - 80, 160, 80, 40, 4, 3, 3, 6, 1, 0, 240, 16, 16, 4, 1, 1, - 6, 1, 2, 240, 6, 7, 7, 6, 0, 0, 120, 132, 180, 164, 164, 132, - 120, 4, 1, 1, 6, 1, 5, 240, 4, 3, 3, 6, 1, 2, 96, 144, - 96, 5, 7, 7, 6, 0, 255, 32, 32, 248, 32, 32, 0, 248, 3, 5, - 5, 6, 1, 1, 64, 160, 32, 64, 224, 3, 5, 5, 6, 1, 1, 192, - 32, 64, 32, 192, 2, 2, 2, 6, 2, 4, 64, 128, 4, 5, 5, 6, - 1, 255, 144, 144, 176, 208, 128, 5, 6, 6, 6, 0, 0, 120, 232, 232, - 104, 40, 40, 1, 1, 1, 6, 2, 2, 128, 2, 2, 2, 6, 2, 254, - 64, 128, 3, 5, 5, 6, 1, 1, 64, 192, 64, 64, 224, 3, 5, 5, - 6, 1, 1, 64, 160, 64, 0, 224, 5, 5, 5, 6, 0, 0, 160, 80, - 40, 80, 160, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 112, 48, 120, - 16, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 104, 8, 16, 56, 5, - 8, 8, 6, 0, 255, 192, 32, 64, 48, 240, 48, 120, 16, 4, 7, 7, - 6, 1, 0, 32, 0, 32, 96, 128, 144, 96, 5, 7, 7, 6, 0, 0, - 64, 32, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 16, 32, 32, - 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 32, 80, 32, 80, 112, 136, - 136, 5, 7, 7, 6, 0, 0, 40, 80, 32, 80, 112, 136, 136, 5, 7, - 7, 6, 0, 0, 80, 0, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, - 0, 32, 80, 32, 80, 112, 136, 136, 5, 6, 6, 6, 0, 0, 120, 160, - 240, 160, 160, 184, 4, 8, 8, 6, 1, 254, 96, 144, 128, 128, 144, 96, - 32, 64, 4, 7, 7, 6, 1, 0, 64, 32, 240, 128, 224, 128, 240, 4, - 7, 7, 6, 1, 0, 32, 64, 240, 128, 224, 128, 240, 4, 7, 7, 6, - 1, 0, 32, 80, 240, 128, 224, 128, 240, 4, 7, 7, 6, 1, 0, 80, - 0, 240, 128, 224, 128, 240, 3, 7, 7, 6, 1, 0, 128, 64, 224, 64, - 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, 64, 224, 64, 64, 64, 224, - 3, 7, 7, 6, 1, 0, 64, 160, 224, 64, 64, 64, 224, 3, 7, 7, - 6, 1, 0, 160, 0, 224, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, - 112, 72, 232, 72, 72, 112, 4, 7, 7, 6, 1, 0, 80, 160, 144, 208, - 176, 144, 144, 4, 7, 7, 6, 1, 0, 64, 32, 96, 144, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 32, 64, 96, 144, 144, 144, 96, 4, 7, 7, - 6, 1, 0, 32, 80, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 80, 160, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 96, - 144, 144, 144, 96, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 4, - 8, 8, 6, 1, 255, 16, 112, 176, 176, 208, 208, 224, 128, 4, 7, 7, - 6, 1, 0, 64, 32, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 32, 64, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 144, - 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 144, 144, 144, 144, - 96, 5, 7, 7, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, 4, 6, - 6, 6, 1, 0, 128, 224, 144, 144, 224, 128, 4, 6, 6, 6, 1, 0, - 96, 144, 160, 160, 144, 160, 4, 7, 7, 6, 1, 0, 64, 32, 0, 112, - 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 112, 144, 144, 112, - 4, 7, 7, 6, 1, 0, 32, 80, 0, 112, 144, 144, 112, 4, 7, 7, - 6, 1, 0, 80, 160, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, - 80, 0, 112, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, 32, 112, - 144, 144, 112, 5, 4, 4, 6, 0, 0, 112, 168, 176, 120, 4, 6, 6, - 6, 1, 254, 112, 128, 128, 112, 32, 64, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 176, 192, 112, - 4, 6, 6, 6, 1, 0, 80, 0, 96, 176, 192, 112, 3, 7, 7, 6, - 1, 0, 128, 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, - 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 64, 160, 0, 192, - 64, 64, 224, 3, 6, 6, 6, 1, 0, 160, 0, 192, 64, 64, 224, 4, - 7, 7, 6, 1, 0, 48, 96, 16, 112, 144, 144, 96, 4, 7, 7, 6, - 1, 0, 80, 160, 0, 224, 144, 144, 144, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 80, 160, 0, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 80, 0, 96, 144, 144, 96, 5, 5, 5, 6, 0, 0, 32, - 0, 248, 0, 32, 4, 4, 4, 6, 1, 0, 112, 176, 208, 224, 4, 7, - 7, 6, 1, 0, 64, 32, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, - 0, 32, 64, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, - 0, 144, 144, 144, 112, 4, 6, 6, 6, 1, 0, 80, 0, 144, 144, 144, - 112, 4, 9, 9, 6, 1, 254, 32, 64, 0, 144, 144, 144, 112, 144, 96, - 4, 8, 8, 6, 1, 254, 128, 128, 224, 144, 144, 224, 128, 128, 4, 8, - 8, 6, 1, 254, 80, 0, 144, 144, 144, 112, 144, 96 -}; diff --git a/Marlin/dogm_font_data_HD44780_C.h b/Marlin/dogm_font_data_HD44780_C.h deleted file mode 100644 index 21d4aaabe2..0000000000 --- a/Marlin/dogm_font_data_HD44780_C.h +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_C v1.2 - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 8 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_C_5x7[2522] U8G_SECTION(".progmem.HD44780_C_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 34, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 7, 7, 6, 0, 0, 32, 112, 160, 160, 168, 112, 32, 3, 7, 7, - 6, 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, - 32, 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, - 128, 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, - 6, 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, - 112, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, - 136, 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, - 112, 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, - 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 3, 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, - 7, 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, - 0, 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, - 168, 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, - 5, 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, - 136, 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, - 8, 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, - 64, 64, 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, - 5, 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, - 5, 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, - 0, 0, 248, 16, 32, 64, 248, 5, 5, 5, 6, 0, 2, 184, 168, 168, - 168, 184, 5, 5, 5, 6, 0, 2, 184, 136, 184, 160, 184, 5, 5, 5, - 6, 0, 2, 184, 160, 184, 136, 184, 5, 6, 6, 6, 0, 1, 8, 40, - 72, 248, 64, 32, 5, 5, 5, 6, 0, 0, 56, 112, 224, 136, 240, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, - 7, 7, 6, 0, 0, 248, 136, 128, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 248, 136, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 80, - 0, 248, 128, 240, 128, 248, 5, 7, 7, 6, 0, 0, 168, 168, 168, 112, - 168, 168, 168, 5, 7, 7, 6, 0, 0, 240, 8, 8, 112, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 136, 136, 152, 168, 200, 136, 136, 5, 8, 8, - 6, 0, 0, 80, 32, 136, 152, 168, 168, 200, 136, 5, 7, 7, 6, 0, - 0, 120, 40, 40, 40, 40, 168, 72, 5, 7, 7, 6, 0, 0, 248, 136, - 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, 136, 80, 32, - 64, 128, 5, 7, 7, 6, 0, 0, 32, 112, 168, 168, 168, 112, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 120, 8, 8, 8, 5, 7, 7, 6, - 0, 0, 168, 168, 168, 168, 168, 168, 248, 5, 7, 7, 6, 0, 0, 192, - 64, 64, 112, 72, 72, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 200, - 168, 168, 200, 5, 7, 7, 6, 0, 0, 112, 136, 8, 56, 8, 136, 112, - 5, 7, 7, 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, - 6, 0, 0, 120, 136, 136, 120, 40, 72, 136, 5, 7, 7, 6, 0, 0, - 24, 96, 128, 240, 136, 136, 112, 4, 5, 5, 6, 0, 0, 224, 144, 224, - 144, 224, 5, 5, 5, 6, 0, 0, 248, 136, 128, 128, 128, 5, 7, 7, - 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 5, 5, 5, 6, 0, 0, - 168, 168, 112, 168, 168, 5, 5, 5, 6, 0, 0, 240, 8, 48, 8, 240, - 5, 5, 5, 6, 0, 0, 136, 152, 168, 200, 136, 5, 7, 7, 6, 0, - 0, 80, 32, 136, 152, 168, 200, 136, 4, 5, 5, 6, 0, 0, 144, 160, - 192, 160, 144, 5, 5, 5, 6, 0, 0, 248, 40, 40, 168, 72, 5, 5, - 5, 6, 0, 0, 136, 216, 168, 136, 136, 5, 5, 5, 6, 0, 0, 136, - 136, 248, 136, 136, 5, 5, 5, 6, 0, 0, 248, 136, 136, 136, 136, 5, - 5, 5, 6, 0, 0, 248, 32, 32, 32, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 120, 8, 8, 5, 5, 5, 6, 0, 0, 168, 168, 168, 168, 248, - 5, 5, 5, 6, 0, 0, 192, 64, 112, 72, 112, 5, 5, 5, 6, 0, - 0, 136, 136, 200, 168, 200, 4, 5, 5, 6, 0, 0, 128, 128, 224, 144, - 224, 5, 5, 5, 6, 0, 0, 112, 136, 56, 136, 112, 5, 5, 5, 6, - 0, 0, 144, 168, 232, 168, 144, 5, 5, 5, 6, 0, 0, 120, 136, 120, - 40, 72, 5, 5, 5, 6, 0, 1, 32, 72, 144, 72, 32, 5, 5, 5, - 6, 0, 1, 32, 144, 72, 144, 32, 5, 3, 3, 6, 0, 0, 72, 144, - 216, 5, 3, 3, 6, 0, 4, 216, 72, 144, 5, 7, 7, 6, 0, 0, - 144, 208, 176, 144, 56, 40, 56, 5, 7, 7, 6, 0, 0, 32, 0, 32, - 64, 128, 136, 112, 5, 7, 7, 6, 0, 0, 24, 32, 32, 112, 32, 32, - 192, 5, 7, 7, 6, 0, 0, 32, 80, 64, 240, 64, 64, 120, 1, 2, - 2, 6, 2, 0, 128, 128, 1, 4, 4, 6, 2, 0, 128, 128, 128, 128, - 3, 5, 5, 6, 1, 0, 160, 160, 160, 0, 224, 3, 5, 5, 6, 1, - 0, 160, 160, 160, 0, 160, 5, 7, 7, 6, 0, 0, 160, 0, 232, 16, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 216, 112, 32, 112, 216, 5, 7, - 7, 6, 0, 0, 160, 64, 168, 16, 32, 64, 128, 3, 6, 6, 6, 1, - 1, 224, 64, 64, 64, 64, 224, 5, 6, 6, 6, 0, 1, 248, 80, 80, - 80, 80, 248, 5, 7, 7, 6, 0, 0, 32, 112, 168, 32, 32, 32, 32, - 5, 7, 7, 6, 0, 0, 32, 32, 32, 32, 168, 112, 32, 5, 7, 7, - 6, 0, 0, 128, 144, 176, 248, 176, 144, 128, 5, 7, 7, 6, 0, 0, - 8, 72, 104, 248, 104, 72, 8, 5, 7, 7, 6, 0, 0, 128, 136, 168, - 248, 168, 136, 128, 5, 7, 7, 6, 0, 0, 128, 224, 136, 16, 32, 64, - 128, 2, 2, 2, 6, 2, 2, 192, 192, 5, 8, 8, 6, 0, 255, 120, - 40, 40, 40, 72, 136, 248, 136, 5, 8, 8, 6, 0, 255, 136, 136, 136, - 136, 136, 136, 248, 8, 5, 8, 8, 6, 0, 255, 168, 168, 168, 168, 168, - 168, 248, 8, 5, 6, 6, 6, 0, 255, 120, 40, 72, 136, 248, 136, 5, - 7, 7, 6, 0, 255, 32, 32, 112, 168, 168, 112, 32, 5, 6, 6, 6, - 0, 255, 136, 136, 136, 136, 248, 8, 5, 6, 6, 6, 0, 255, 168, 168, - 168, 168, 248, 8, 2, 2, 2, 6, 2, 6, 64, 128, 3, 1, 1, 6, - 1, 7, 160, 5, 2, 2, 6, 0, 6, 72, 176, 5, 8, 8, 6, 0, - 0, 16, 32, 0, 112, 136, 248, 128, 112, 5, 6, 6, 6, 0, 255, 112, - 128, 136, 112, 32, 96, 3, 7, 7, 6, 1, 0, 160, 0, 160, 160, 160, - 32, 192, 5, 6, 6, 6, 0, 1, 32, 112, 112, 112, 248, 32, 5, 5, - 5, 6, 0, 1, 80, 0, 136, 0, 80, 5, 5, 5, 6, 0, 1, 112, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, - 8, 5, 7, 7, 6, 0, 0, 136, 144, 184, 72, 184, 8, 56, 5, 7, - 7, 6, 0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, - 0, 192, 64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 136, - 248, 136, 248, 136, 248, 136, 4, 5, 5, 6, 0, 2, 192, 0, 48, 0, - 96, 5, 8, 8, 6, 0, 0, 64, 160, 224, 168, 8, 40, 120, 32, 5, - 8, 8, 6, 0, 0, 64, 112, 64, 120, 64, 112, 64, 224, 5, 8, 8, - 6, 0, 0, 32, 112, 32, 248, 32, 112, 32, 112, 5, 7, 7, 6, 0, - 0, 104, 0, 232, 0, 104, 16, 56, 5, 8, 8, 6, 0, 0, 16, 112, - 16, 240, 16, 112, 16, 56, 5, 7, 7, 6, 0, 1, 32, 112, 32, 248, - 32, 112, 32, 5, 8, 8, 6, 0, 0, 16, 144, 80, 48, 80, 144, 16, - 56, 5, 8, 8, 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 5, - 7, 7, 6, 0, 0, 120, 168, 168, 120, 40, 40, 40, 5, 8, 8, 6, - 0, 0, 248, 248, 248, 248, 248, 248, 248, 248 -}; diff --git a/Marlin/dogm_font_data_HD44780_J.h b/Marlin/dogm_font_data_HD44780_J.h deleted file mode 100644 index e4884c7cbc..0000000000 --- a/Marlin/dogm_font_data_HD44780_J.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_J - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h=10 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_J_5x7[2492] U8G_SECTION(".progmem.HD44780_J_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 34, 32, 255, 255, 8, 254, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 7, 7, 6, 0, 0, 136, 80, 248, 32, 248, 32, 32, 3, 7, 7, - 6, 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, - 32, 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, - 128, 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, - 6, 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, - 112, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, - 136, 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, - 112, 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, - 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 3, 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, - 7, 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, - 0, 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, - 168, 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, - 5, 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, - 136, 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, - 8, 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, - 64, 64, 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, - 5, 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, - 5, 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, - 0, 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, - 128, 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, - 128, 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 5, - 5, 6, 0, 1, 32, 16, 248, 16, 32, 5, 5, 5, 6, 0, 1, 32, - 64, 248, 64, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 3, 3, 3, 6, 0, 0, - 224, 160, 224, 3, 4, 4, 6, 2, 3, 224, 128, 128, 128, 3, 4, 4, - 6, 0, 0, 32, 32, 32, 224, 3, 3, 3, 6, 0, 0, 128, 64, 32, - 2, 2, 2, 6, 1, 2, 192, 192, 5, 6, 6, 6, 0, 0, 248, 8, - 248, 8, 16, 32, 5, 5, 5, 6, 0, 0, 248, 8, 48, 32, 64, 4, - 5, 5, 6, 0, 0, 16, 32, 96, 160, 32, 5, 5, 5, 6, 0, 0, - 32, 248, 136, 8, 48, 5, 4, 4, 6, 0, 0, 248, 32, 32, 248, 5, - 5, 5, 6, 0, 0, 16, 248, 48, 80, 144, 5, 5, 5, 6, 0, 0, - 64, 248, 72, 80, 64, 5, 4, 4, 6, 0, 0, 112, 16, 16, 248, 4, - 5, 5, 6, 0, 0, 240, 16, 240, 16, 240, 5, 4, 4, 6, 0, 0, - 168, 168, 8, 48, 5, 1, 1, 6, 0, 3, 248, 5, 7, 7, 6, 0, - 0, 248, 8, 40, 48, 32, 32, 64, 5, 7, 7, 6, 0, 0, 8, 16, - 32, 96, 160, 32, 32, 5, 7, 7, 6, 0, 0, 32, 248, 136, 136, 8, - 16, 32, 5, 6, 6, 6, 0, 0, 248, 32, 32, 32, 32, 248, 5, 7, - 7, 6, 0, 0, 16, 248, 16, 48, 80, 144, 16, 5, 7, 7, 6, 0, - 0, 64, 248, 72, 72, 72, 72, 144, 5, 7, 7, 6, 0, 0, 32, 248, - 32, 248, 32, 32, 32, 5, 6, 6, 6, 0, 0, 120, 72, 136, 8, 16, - 96, 5, 7, 7, 6, 0, 0, 64, 120, 144, 16, 16, 16, 32, 5, 6, - 6, 6, 0, 0, 248, 8, 8, 8, 8, 248, 5, 7, 7, 6, 0, 0, - 80, 248, 80, 80, 16, 32, 64, 5, 6, 6, 6, 0, 0, 192, 8, 200, - 8, 16, 224, 5, 6, 6, 6, 0, 0, 248, 8, 16, 32, 80, 136, 5, - 7, 7, 6, 0, 0, 64, 248, 72, 80, 64, 64, 56, 5, 6, 6, 6, - 0, 0, 136, 136, 72, 8, 16, 96, 5, 6, 6, 6, 0, 0, 120, 72, - 168, 24, 16, 96, 5, 7, 7, 6, 0, 0, 16, 224, 32, 248, 32, 32, - 64, 5, 6, 6, 6, 0, 0, 168, 168, 168, 8, 16, 32, 5, 7, 7, - 6, 0, 0, 112, 0, 248, 32, 32, 32, 64, 3, 7, 7, 6, 1, 0, - 128, 128, 128, 192, 160, 128, 128, 5, 7, 7, 6, 0, 0, 32, 32, 248, - 32, 32, 64, 128, 5, 6, 6, 6, 0, 0, 112, 0, 0, 0, 0, 248, - 5, 6, 6, 6, 0, 0, 248, 8, 80, 32, 80, 128, 5, 7, 7, 6, - 0, 0, 32, 248, 16, 32, 112, 168, 32, 3, 7, 7, 6, 1, 0, 32, - 32, 32, 32, 32, 64, 128, 5, 6, 6, 6, 0, 0, 32, 16, 136, 136, - 136, 136, 5, 7, 7, 6, 0, 0, 128, 128, 248, 128, 128, 128, 120, 5, - 6, 6, 6, 0, 0, 248, 8, 8, 8, 16, 96, 5, 5, 5, 6, 0, - 1, 64, 160, 16, 8, 8, 5, 7, 7, 6, 0, 0, 32, 248, 32, 32, - 168, 168, 32, 5, 6, 6, 6, 0, 0, 248, 8, 8, 80, 32, 16, 4, - 6, 6, 6, 1, 0, 224, 0, 224, 0, 224, 16, 5, 6, 6, 6, 0, - 0, 32, 64, 128, 136, 248, 8, 5, 6, 6, 6, 0, 0, 8, 8, 80, - 32, 80, 128, 5, 6, 6, 6, 0, 0, 248, 64, 248, 64, 64, 56, 5, - 7, 7, 6, 0, 0, 64, 64, 248, 72, 80, 64, 64, 5, 7, 7, 6, - 0, 0, 112, 16, 16, 16, 16, 16, 248, 5, 6, 6, 6, 0, 0, 248, - 8, 248, 8, 8, 248, 5, 7, 7, 6, 0, 0, 112, 0, 248, 8, 8, - 16, 32, 4, 7, 7, 6, 0, 0, 144, 144, 144, 144, 16, 32, 64, 5, - 6, 6, 6, 0, 0, 32, 160, 160, 168, 168, 176, 5, 7, 7, 6, 0, - 0, 128, 128, 128, 136, 144, 160, 192, 5, 6, 6, 6, 0, 0, 248, 136, - 136, 136, 136, 248, 5, 6, 6, 6, 0, 0, 248, 136, 136, 8, 16, 32, - 5, 6, 6, 6, 0, 0, 192, 0, 8, 8, 16, 224, 4, 3, 3, 6, - 0, 4, 32, 144, 64, 3, 3, 3, 6, 0, 4, 224, 160, 224, 5, 5, - 5, 6, 0, 1, 72, 168, 144, 144, 104, 5, 7, 7, 6, 0, 0, 80, - 0, 112, 8, 120, 136, 120, 4, 8, 8, 6, 1, 255, 96, 144, 144, 224, - 144, 144, 224, 128, 5, 5, 5, 6, 0, 0, 112, 128, 96, 136, 112, 5, - 6, 6, 6, 0, 255, 136, 136, 152, 232, 136, 128, 5, 5, 5, 6, 0, - 0, 120, 160, 144, 136, 112, 5, 7, 7, 6, 0, 254, 48, 72, 136, 136, - 240, 128, 128, 5, 8, 8, 6, 0, 254, 120, 136, 136, 136, 120, 8, 8, - 112, 5, 5, 5, 6, 0, 1, 56, 32, 32, 160, 64, 4, 3, 3, 6, - 0, 3, 16, 208, 16, 4, 8, 8, 6, 0, 255, 16, 0, 48, 16, 16, - 16, 144, 96, 3, 3, 3, 6, 0, 4, 160, 64, 160, 5, 7, 7, 6, - 0, 0, 32, 112, 160, 160, 168, 112, 32, 5, 7, 7, 6, 0, 0, 64, - 64, 224, 64, 224, 64, 120, 5, 7, 7, 6, 0, 0, 112, 0, 176, 200, - 136, 136, 136, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 136, 136, 112, - 5, 7, 7, 6, 0, 255, 176, 200, 136, 136, 240, 128, 128, 5, 7, 7, - 6, 0, 255, 104, 152, 136, 136, 120, 8, 8, 5, 6, 6, 6, 0, 0, - 112, 136, 248, 136, 136, 112, 5, 3, 3, 6, 0, 2, 88, 168, 208, 5, - 5, 5, 6, 0, 0, 112, 136, 136, 80, 216, 5, 7, 7, 6, 0, 0, - 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 248, 128, 64, - 32, 64, 128, 248, 5, 5, 5, 6, 0, 0, 248, 80, 80, 80, 152, 5, - 7, 7, 6, 0, 0, 248, 0, 136, 80, 32, 80, 136, 5, 7, 7, 6, - 0, 255, 136, 136, 136, 136, 120, 8, 112, 5, 6, 6, 6, 0, 0, 8, - 240, 32, 248, 32, 32, 5, 5, 5, 6, 0, 0, 248, 64, 120, 72, 136, - 5, 5, 5, 6, 0, 0, 248, 168, 248, 136, 136, 5, 5, 5, 6, 0, - 1, 32, 0, 248, 0, 32, 0, 0, 0, 6, 0, 0, 6, 10, 10, 6, - 0, 254, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252 -}; diff --git a/Marlin/dogm_font_data_HD44780_W.h b/Marlin/dogm_font_data_HD44780_W.h deleted file mode 100644 index 86b4bf4bff..0000000000 --- a/Marlin/dogm_font_data_HD44780_W.h +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_W - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_W_5x7[3034] U8G_SECTION(".progmem.HD44780_W_5x7") = { - 0, 6, 9, 0, 254, 7, 2, 79, 3, 222, 16, 255, 255, 8, 255, 7, - 255, 4, 7, 7, 6, 0, 0, 16, 48, 112, 240, 112, 48, 16, 4, 7, - 7, 6, 1, 0, 128, 192, 224, 240, 224, 192, 128, 5, 3, 3, 6, 0, - 4, 216, 72, 144, 5, 3, 3, 6, 0, 4, 216, 144, 72, 5, 7, 7, - 6, 0, 0, 32, 112, 248, 0, 32, 112, 248, 5, 7, 7, 6, 0, 0, - 248, 112, 32, 0, 248, 112, 32, 5, 5, 5, 6, 0, 1, 112, 248, 248, - 248, 112, 5, 7, 7, 6, 0, 0, 8, 8, 40, 72, 248, 64, 32, 5, - 7, 7, 6, 0, 0, 32, 112, 168, 32, 32, 32, 32, 5, 7, 7, 6, - 0, 0, 32, 32, 32, 32, 168, 112, 32, 5, 5, 5, 6, 0, 1, 32, - 64, 248, 64, 32, 5, 5, 5, 6, 0, 1, 32, 16, 248, 16, 32, 5, - 7, 7, 6, 0, 0, 16, 32, 64, 32, 16, 0, 248, 5, 7, 7, 6, - 0, 0, 64, 32, 16, 32, 64, 0, 248, 5, 5, 5, 6, 0, 1, 32, - 32, 112, 112, 248, 5, 5, 5, 6, 0, 0, 248, 112, 112, 32, 32, 0, - 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, - 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, 0, 0, - 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, 120, 160, - 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, 64, 152, - 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, 2, 3, - 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, 64, 128, - 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, 32, 64, - 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, 5, 6, - 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, 64, 128, - 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, 192, 5, - 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, - 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, 192, 64, - 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, 128, 128, - 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, 5, 7, - 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, 6, 0, - 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, 48, 64, - 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, 32, - 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, 112, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, 5, 6, - 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, 192, 0, - 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, 32, 16, - 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, 0, 128, - 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, 8, 16, - 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, 112, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, 7, 6, - 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, 0, 112, - 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, 136, 136, - 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 248, - 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, 7, 7, - 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, 16, 144, - 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, 5, 7, - 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, 6, 0, - 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, - 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, 7, 6, - 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, 0, 120, - 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, 32, 32, - 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 136, 112, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, 0, 0, - 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, 136, - 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, 64, 128, - 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, 5, 5, - 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, 0, 224, - 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, 136, 5, - 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, 5, 5, - 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 128, - 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, 128, 136, - 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, 5, 5, - 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, 0, 48, - 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, 136, 120, - 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, 136, 1, - 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, 8, 6, - 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, 0, 0, - 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, 64, 64, - 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, 168, 5, - 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, 0, 0, - 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, 240, 128, - 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, 5, 5, - 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, 112, 128, - 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, 72, 48, - 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, 6, 0, - 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, 168, 168, - 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, 6, 6, - 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, 248, 16, - 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, 64, 32, - 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, 7, 7, - 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 6, 6, 6, 0, 1, - 8, 40, 72, 248, 64, 32, 5, 7, 7, 6, 0, 0, 32, 80, 136, 136, - 136, 136, 248, 5, 7, 7, 6, 0, 0, 248, 136, 128, 240, 136, 136, 240, - 5, 8, 8, 6, 0, 255, 120, 40, 40, 40, 72, 136, 248, 136, 5, 7, - 7, 6, 0, 0, 168, 168, 168, 112, 168, 168, 168, 5, 7, 7, 6, 0, - 0, 240, 8, 8, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 136, 136, - 152, 168, 200, 136, 136, 5, 8, 8, 6, 0, 0, 80, 32, 136, 152, 168, - 168, 200, 136, 5, 7, 7, 6, 0, 0, 120, 40, 40, 40, 40, 168, 72, - 5, 7, 7, 6, 0, 0, 248, 136, 136, 136, 136, 136, 136, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 80, 32, 64, 128, 5, 8, 8, 6, 0, 255, - 136, 136, 136, 136, 136, 136, 248, 8, 5, 7, 7, 6, 0, 0, 136, 136, - 136, 120, 8, 8, 8, 5, 7, 7, 6, 0, 0, 168, 168, 168, 168, 168, - 168, 248, 5, 8, 8, 6, 0, 255, 168, 168, 168, 168, 168, 168, 248, 8, - 5, 7, 7, 6, 0, 0, 192, 64, 64, 112, 72, 72, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 200, 168, 168, 200, 5, 7, 7, 6, 0, 0, - 112, 136, 40, 80, 8, 136, 112, 5, 5, 5, 6, 0, 0, 64, 160, 144, - 144, 104, 5, 7, 7, 6, 0, 0, 32, 48, 40, 40, 32, 224, 224, 5, - 7, 7, 6, 0, 0, 248, 136, 128, 128, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 248, 80, 80, 80, 152, 5, 7, 7, 6, 0, 0, 248, 128, 64, - 32, 64, 128, 248, 5, 5, 5, 6, 0, 0, 120, 144, 144, 144, 96, 5, - 7, 7, 6, 0, 0, 48, 40, 56, 40, 200, 216, 24, 5, 6, 6, 6, - 0, 0, 8, 112, 160, 32, 32, 16, 5, 6, 6, 6, 0, 1, 32, 112, - 112, 112, 248, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, - 112, 5, 5, 5, 6, 0, 0, 112, 136, 136, 80, 216, 5, 7, 7, 6, - 0, 0, 48, 72, 32, 80, 136, 136, 112, 5, 3, 3, 6, 0, 2, 88, - 168, 208, 5, 6, 6, 6, 0, 0, 80, 248, 248, 248, 112, 32, 5, 5, - 5, 6, 0, 0, 112, 128, 96, 136, 112, 5, 7, 7, 6, 0, 0, 112, - 136, 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 216, 216, 216, 216, - 216, 216, 216, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 32, 112, 160, 160, 168, 112, 32, 5, 7, 7, - 6, 0, 0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, - 136, 112, 80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 248, 32, 248, - 32, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, - 8, 8, 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 5, 7, 7, - 6, 0, 0, 24, 32, 32, 112, 32, 32, 192, 5, 7, 7, 6, 0, 0, - 248, 136, 184, 184, 184, 136, 248, 5, 7, 7, 6, 0, 0, 112, 8, 120, - 136, 120, 0, 248, 5, 5, 5, 6, 0, 1, 40, 80, 160, 80, 40, 5, - 7, 7, 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, 6, - 0, 0, 120, 136, 136, 120, 40, 72, 136, 5, 7, 7, 6, 0, 0, 248, - 136, 168, 136, 152, 168, 248, 2, 3, 3, 6, 2, 4, 64, 128, 192, 4, - 5, 5, 6, 0, 3, 96, 144, 144, 144, 96, 5, 7, 7, 6, 0, 0, - 32, 32, 248, 32, 32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, - 64, 240, 3, 5, 5, 6, 0, 3, 224, 32, 224, 32, 224, 5, 8, 8, - 6, 0, 0, 224, 144, 224, 128, 144, 184, 144, 24, 5, 8, 8, 6, 0, - 255, 136, 136, 136, 136, 152, 232, 128, 128, 5, 7, 7, 6, 0, 0, 120, - 152, 152, 120, 24, 24, 24, 2, 2, 2, 6, 2, 2, 192, 192, 5, 5, - 5, 6, 0, 0, 80, 136, 168, 168, 80, 3, 5, 5, 6, 0, 3, 64, - 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 112, 0, - 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5, 7, 7, 6, - 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6, 0, 0, 136, - 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192, 64, 192, 72, - 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32, 64, 128, 136, - 112, 5, 8, 8, 6, 0, 0, 64, 32, 32, 80, 136, 248, 136, 136, 5, - 8, 8, 6, 0, 0, 16, 32, 32, 80, 136, 248, 136, 136, 5, 8, 8, - 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, 0, - 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, 80, - 0, 32, 80, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, 32, 80, 32, - 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96, 160, 184, 224, - 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136, 112, 32, 96, - 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128, 248, 5, 8, - 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5, 8, 8, 6, - 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7, 6, 0, 0, - 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0, 128, 64, 0, - 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, 0, 224, 64, - 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224, 64, 64, 64, - 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64, 224, 5, 7, - 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8, 8, 6, 0, - 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6, 0, 0, 64, - 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 112, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, 136, 136, 136, - 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136, 136, 112, 5, - 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 7, 7, 6, 0, 0, - 112, 32, 112, 168, 112, 32, 112, 5, 8, 8, 6, 0, 0, 64, 32, 136, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 136, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 136, 136, 136, 136, - 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136, 136, 136, 112, 5, - 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, 32, 5, 8, 8, - 6, 0, 0, 192, 64, 112, 72, 72, 112, 64, 224, 5, 7, 7, 6, 0, - 0, 48, 72, 72, 112, 72, 72, 176, 5, 8, 8, 6, 0, 0, 64, 32, - 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, - 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 8, 120, - 136, 120, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, 8, 120, 136, 120, - 5, 7, 7, 6, 0, 0, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, - 6, 0, 0, 32, 80, 32, 112, 8, 120, 136, 120, 5, 6, 6, 6, 0, - 0, 208, 40, 120, 160, 168, 80, 5, 6, 6, 6, 0, 255, 112, 128, 136, - 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, 128, - 112, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 128, 112, 5, - 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 3, 8, 8, 6, 1, 0, - 128, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, - 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 64, - 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 64, 192, 64, 64, - 224, 5, 7, 7, 6, 0, 0, 160, 64, 160, 16, 120, 136, 112, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 176, 200, 136, 136, 136, 5, 8, 8, 6, - 0, 0, 64, 32, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, - 16, 32, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, - 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 136, 136, - 112, 5, 5, 5, 6, 0, 1, 32, 0, 248, 0, 32, 5, 7, 7, 6, - 0, 0, 16, 32, 112, 168, 112, 32, 64, 5, 8, 8, 6, 0, 0, 64, - 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, 0, 16, 32, 0, - 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, 0, 32, 80, 0, 136, 136, - 136, 152, 104, 5, 7, 7, 6, 0, 0, 80, 0, 136, 136, 136, 152, 104, - 5, 9, 9, 6, 0, 255, 16, 32, 0, 136, 136, 136, 248, 8, 112, 4, - 7, 7, 6, 1, 0, 192, 64, 96, 80, 96, 64, 224, 5, 8, 8, 6, - 0, 255, 80, 0, 136, 136, 136, 248, 8, 112 -}; diff --git a/Marlin/dogm_font_data_ISO10646_1.h b/Marlin/dogm_font_data_ISO10646_1.h deleted file mode 100644 index 5e12ea86ff..0000000000 --- a/Marlin/dogm_font_data_ISO10646_1.h +++ /dev/null @@ -1,286 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646-1 - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include - -#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7) - - // - // Reduced font (only symbols 32 - 127) - About 1400 bytes smaller - // - const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = { - 0,6,9,0,254,7,1,146,3,33,32,127,255,7,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0}; - -#else - - // - // Extended (original) font (symbols 32 - 255) - // - const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 136, 136, 136, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168, - 168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240, - 136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, - 128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, - 16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, - 136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, - 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, - 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, - 0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, - 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, - 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, - 6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, - 224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, - 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, - 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, - 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, - 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, - 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, - 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, - 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, - 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, - 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, - 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, - 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, - 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, - 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, - 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, - 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, - 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, - 0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64, - 64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, - 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, - 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, - 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, - 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, - 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, - 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, - 6, 0, 2, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 5, 7, - 7, 6, 0, 0, 32, 112, 168, 160, 168, 112, 32, 5, 7, 7, 6, 0, - 0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, 136, 112, - 80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 32, 248, 32, 248, 32, - 1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, 8, 8, - 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 3, 1, 1, 6, 1, - 7, 160, 5, 7, 7, 6, 0, 0, 248, 136, 184, 184, 184, 136, 248, 5, - 7, 7, 6, 0, 1, 112, 8, 120, 136, 120, 0, 248, 5, 5, 5, 6, - 0, 1, 40, 80, 160, 80, 40, 5, 3, 3, 6, 0, 1, 248, 8, 8, - 2, 2, 2, 6, 2, 6, 64, 128, 5, 7, 7, 6, 0, 0, 248, 136, - 168, 136, 152, 168, 248, 5, 1, 1, 6, 0, 6, 248, 4, 4, 4, 6, - 0, 3, 96, 144, 144, 96, 5, 7, 7, 6, 0, 0, 32, 32, 248, 32, - 32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, 64, 240, 3, 5, - 5, 6, 0, 3, 224, 32, 224, 32, 224, 2, 2, 2, 6, 2, 6, 64, - 128, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 152, 232, 128, 128, 5, - 7, 7, 6, 0, 0, 120, 152, 152, 120, 24, 24, 24, 2, 2, 2, 6, - 2, 2, 192, 192, 2, 2, 2, 6, 2, 255, 64, 128, 3, 5, 5, 6, - 0, 3, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 1, 112, 136, 136, - 136, 112, 0, 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5, - 7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6, - 0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192, - 64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32, - 64, 128, 136, 112, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, - 136, 136, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 136, 136, - 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, - 0, 0, 80, 0, 112, 136, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, - 32, 80, 32, 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96, - 160, 184, 224, 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136, - 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128, - 248, 5, 8, 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5, - 8, 8, 6, 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7, - 6, 0, 0, 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0, - 128, 64, 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, - 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224, - 64, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64, - 224, 5, 7, 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6, - 0, 0, 64, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, - 16, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, - 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, - 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136, - 136, 112, 5, 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 8, 8, - 6, 0, 255, 16, 112, 168, 168, 168, 168, 112, 64, 5, 8, 8, 6, 0, - 0, 64, 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, - 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, - 32, 5, 9, 9, 6, 0, 255, 192, 64, 112, 72, 72, 112, 64, 64, 224, - 4, 8, 8, 6, 1, 255, 96, 144, 144, 160, 144, 144, 224, 128, 5, 8, - 8, 6, 0, 0, 64, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, - 0, 0, 16, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, - 32, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 104, 144, - 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 80, 0, 112, 8, - 120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 32, 112, 8, 120, 136, - 120, 5, 6, 6, 6, 0, 0, 208, 40, 120, 160, 168, 80, 5, 6, 6, - 6, 0, 255, 112, 128, 136, 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, - 32, 0, 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 16, 32, 0, - 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, - 248, 128, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, - 3, 8, 8, 6, 1, 0, 128, 64, 0, 64, 192, 64, 64, 224, 3, 8, - 8, 6, 1, 0, 32, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, - 1, 0, 64, 160, 0, 64, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, - 160, 0, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 160, 64, 160, - 16, 120, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 176, 200, 136, - 136, 136, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 136, 136, 112, - 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 136, 136, 112, 5, 8, - 8, 6, 0, 0, 32, 80, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, - 0, 0, 104, 144, 0, 112, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, - 80, 0, 112, 136, 136, 136, 112, 5, 5, 5, 6, 0, 1, 32, 0, 248, - 0, 32, 5, 7, 7, 6, 0, 255, 16, 112, 168, 168, 168, 112, 64, 5, - 8, 8, 6, 0, 0, 64, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, - 6, 0, 0, 16, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, - 0, 32, 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 80, - 0, 136, 136, 136, 152, 104, 5, 9, 9, 6, 0, 255, 16, 32, 0, 136, - 136, 136, 248, 8, 112, 4, 7, 7, 6, 1, 255, 192, 64, 96, 80, 96, - 64, 224, 5, 8, 8, 6, 0, 255, 80, 0, 136, 136, 136, 120, 8, 112 - }; - -#endif diff --git a/Marlin/dogm_font_data_ISO10646_1_PL.h b/Marlin/dogm_font_data_ISO10646_1_PL.h deleted file mode 100644 index 47b0bbb065..0000000000 --- a/Marlin/dogm_font_data_ISO10646_1_PL.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - Fontname: ISO10646-1-PL - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_1_PL_5x7[2732] U8G_FONT_SECTION(".progmem.ISO10646_1_PL_5x7") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,254,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,9,9,6,0, - 254,112,136,136,248,136,136,136,16,32,5,7,7,6,0,254, - 112,8,120,136,120,16,32,5,8,8,6,0,0,16,32,112, - 136,128,128,136,112,5,7,7,6,0,0,16,32,112,128,128, - 136,112,5,9,9,6,0,254,248,128,128,240,128,128,248,8, - 16,5,7,7,6,0,254,112,136,248,128,112,16,32,5,7, - 7,6,0,0,128,144,160,192,128,128,248,5,7,7,6,0, - 0,96,40,48,96,160,32,112,5,8,8,6,0,0,16,168, - 136,200,168,152,136,136,5,8,8,6,0,0,8,16,0,176, - 200,136,136,136,5,8,8,6,0,0,16,32,112,136,136,136, - 136,112,5,8,8,6,0,0,16,32,0,112,136,136,136,112, - 5,8,8,6,0,0,16,120,128,128,112,8,8,240,5,8, - 8,6,0,0,16,32,0,112,128,112,8,240,5,8,8,6, - 0,0,32,248,8,16,32,64,128,248,5,8,8,6,0,0, - 16,32,0,248,16,32,64,248,5,7,7,6,0,0,248,8, - 16,248,64,128,248,5,8,8,6,0,0,48,48,0,248,16, - 32,64,248,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,1,7,7, - 6,2,0,128,0,128,128,128,128,128,5,7,7,6,0,0, - 32,112,168,160,168,112,32,5,7,7,6,0,0,48,64,64, - 224,64,80,168,5,5,5,6,0,0,136,112,80,112,136,5, - 7,7,6,0,0,136,80,32,248,32,248,32,1,7,7,6, - 2,0,128,128,128,0,128,128,128,5,8,8,6,0,0,48, - 72,32,80,80,32,144,96,3,1,1,6,1,7,160,5,7, - 7,6,0,0,248,136,184,184,184,136,248,5,7,7,6,0, - 1,112,8,120,136,120,0,248,5,5,5,6,0,1,40,80, - 160,80,40,5,3,3,6,0,1,248,8,8,2,2,2,6, - 2,6,64,128,5,7,7,6,0,0,248,136,168,136,152,168, - 248,5,1,1,6,0,6,248,4,4,4,6,0,3,96,144, - 144,96,5,7,7,6,0,0,32,32,248,32,32,0,248,4, - 5,5,6,0,3,96,144,32,64,240,3,5,5,6,0,3, - 224,32,224,32,224,2,2,2,6,2,6,64,128,5,8,8, - 6,0,255,136,136,136,136,152,232,128,128,5,7,7,6,0, - 0,120,152,152,120,24,24,24,2,2,2,6,2,2,192,192, - 2,2,2,6,2,255,64,128,3,5,5,6,0,3,64,192, - 64,64,224,5,7,7,6,0,1,112,136,136,136,112,0,248, - 5,5,5,6,0,1,160,80,40,80,160,5,7,7,6,0, - 0,136,144,168,88,184,8,8,5,7,7,6,0,0,136,144, - 184,72,152,32,56,5,8,8,6,0,0,192,64,192,72,216, - 56,8,8,5,7,7,6,0,0,32,0,32,64,128,136,112, - 5,8,8,6,0,0,64,32,0,112,136,248,136,136,5,8, - 8,6,0,0,16,32,0,112,136,248,136,136,5,8,8,6, - 0,0,32,80,0,112,136,248,136,136,5,8,8,6,0,0, - 104,144,0,112,136,248,136,136,5,8,8,6,0,0,80,0, - 112,136,136,248,136,136,5,8,8,6,0,0,32,80,32,112, - 136,248,136,136,5,7,7,6,0,0,56,96,160,184,224,160, - 184,5,8,8,6,0,255,112,136,128,128,136,112,32,96,5, - 8,8,6,0,0,64,32,0,248,128,240,128,248,5,8,8, - 6,0,0,8,16,0,248,128,240,128,248,5,8,8,6,0, - 0,32,80,0,248,128,240,128,248,5,7,7,6,0,0,80, - 0,248,128,240,128,248,3,8,8,6,1,0,128,64,0,224, - 64,64,64,224,3,8,8,6,1,0,32,64,0,224,64,64, - 64,224,3,8,8,6,1,0,64,160,0,224,64,64,64,224, - 3,7,7,6,1,0,160,0,224,64,64,64,224,5,7,7, - 6,0,0,112,72,72,232,72,72,112,5,8,8,6,0,0, - 104,144,0,136,200,168,152,136,5,8,8,6,0,0,64,32, - 112,136,136,136,136,112,5,8,8,6,0,0,16,32,112,136, - 136,136,136,112,5,8,8,6,0,0,32,80,0,112,136,136, - 136,112,5,8,8,6,0,0,104,144,0,112,136,136,136,112, - 5,8,8,6,0,0,80,0,112,136,136,136,136,112,5,5, - 5,6,0,1,136,80,32,80,136,5,8,8,6,0,255,16, - 112,168,168,168,168,112,64,5,8,8,6,0,0,64,32,136, - 136,136,136,136,112,5,8,8,6,0,0,16,32,136,136,136, - 136,136,112,5,8,8,6,0,0,32,80,0,136,136,136,136, - 112,5,8,8,6,0,0,80,0,136,136,136,136,136,112,5, - 8,8,6,0,0,16,32,136,80,32,32,32,32,5,9,9, - 6,0,255,192,64,112,72,72,112,64,64,224,4,8,8,6, - 1,255,96,144,144,160,144,144,224,128,5,8,8,6,0,0, - 64,32,0,112,8,120,136,120,5,8,8,6,0,0,16,32, - 0,112,8,120,136,120,5,8,8,6,0,0,32,80,0,112, - 8,120,136,120,5,8,8,6,0,0,104,144,0,112,8,120, - 136,120,5,7,7,6,0,0,80,0,112,8,120,136,120,5, - 8,8,6,0,0,32,80,32,112,8,120,136,120,5,6,6, - 6,0,0,208,40,120,160,168,80,5,6,6,6,0,255,112, - 128,136,112,32,96,5,8,8,6,0,0,64,32,0,112,136, - 248,128,112,5,8,8,6,0,0,16,32,0,112,136,248,128, - 112,5,8,8,6,0,0,32,80,0,112,136,248,128,112,5, - 7,7,6,0,0,80,0,112,136,248,128,112,3,8,8,6, - 1,0,128,64,0,64,192,64,64,224,3,8,8,6,1,0, - 32,64,0,64,192,64,64,224,3,8,8,6,1,0,64,160, - 0,64,192,64,64,224,3,7,7,6,1,0,160,0,64,192, - 64,64,224,5,7,7,6,0,0,160,64,160,16,120,136,112, - 5,8,8,6,0,0,104,144,0,176,200,136,136,136,5,8, - 8,6,0,0,64,32,0,112,136,136,136,112,5,8,8,6, - 0,0,16,32,0,112,136,136,136,112,5,8,8,6,0,0, - 32,80,0,112,136,136,136,112,5,8,8,6,0,0,104,144, - 0,112,136,136,136,112,5,7,7,6,0,0,80,0,112,136, - 136,136,112,5,5,5,6,0,1,32,0,248,0,32,5,7, - 7,6,0,255,16,112,168,168,168,112,64,5,8,8,6,0, - 0,64,32,0,136,136,136,152,104,5,8,8,6,0,0,16, - 32,0,136,136,136,152,104,5,8,8,6,0,0,32,80,0, - 136,136,136,152,104,5,7,7,6,0,0,80,0,136,136,136, - 152,104,5,9,9,6,0,255,16,32,0,136,136,136,248,8, - 112,4,7,7,6,1,255,192,64,96,80,96,64,224,5,8, - 8,6,0,255,80,0,136,136,136,120,8,112}; diff --git a/Marlin/dogm_font_data_ISO10646_1_tr.h b/Marlin/dogm_font_data_ISO10646_1_tr.h deleted file mode 100644 index e32f59f958..0000000000 --- a/Marlin/dogm_font_data_ISO10646_1_tr.h +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/* - Fontname: ISO10646-1-tr - Copyright: public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_TR[2591] U8G_SECTION(".progmem.ISO10646_TR") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,7, - 7,6,0,0,32,112,168,160,168,112,32,5,7,7,6,0, - 0,48,64,64,224,64,80,168,5,5,5,6,0,0,136,112, - 80,112,136,5,7,7,6,0,0,136,80,32,248,32,248,32, - 1,7,7,6,2,0,128,128,128,0,128,128,128,5,8,8, - 6,0,0,48,72,32,80,80,32,144,96,3,1,1,6,1, - 7,160,5,7,7,6,0,0,248,136,184,184,184,136,248,5, - 7,7,6,0,1,112,8,120,136,120,0,248,5,5,5,6, - 0,1,40,80,160,80,40,5,3,3,6,0,1,248,8,8, - 2,2,2,6,2,6,64,128,5,7,7,6,0,0,248,136, - 168,136,152,168,248,5,1,1,6,0,6,248,4,4,4,6, - 0,3,96,144,144,96,5,7,7,6,0,0,32,32,248,32, - 32,0,248,4,5,5,6,0,3,96,144,32,64,240,3,5, - 5,6,0,3,224,32,224,32,224,2,2,2,6,2,6,64, - 128,5,8,8,6,0,255,136,136,136,136,152,232,128,128,5, - 7,7,6,0,0,120,152,152,120,24,24,24,2,2,2,6, - 2,2,192,192,2,2,2,6,2,255,64,128,3,5,5,6, - 0,3,64,192,64,64,224,5,7,7,6,0,1,112,136,136, - 136,112,0,248,5,5,5,6,0,1,160,80,40,80,160,5, - 7,7,6,0,0,136,144,168,88,184,8,8,5,7,7,6, - 0,0,136,144,184,72,152,32,56,5,8,8,6,0,0,192, - 64,192,72,216,56,8,8,5,7,7,6,0,0,32,0,32, - 64,128,136,112,5,8,8,6,0,0,64,32,0,112,136,248, - 136,136,5,8,8,6,0,0,16,32,0,112,136,248,136,136, - 5,8,8,6,0,0,32,80,0,112,136,248,136,136,5,8, - 8,6,0,0,104,144,0,112,136,248,136,136,5,8,8,6, - 0,0,80,0,112,136,136,248,136,136,5,8,8,6,0,0, - 32,80,32,112,136,248,136,136,5,7,7,6,0,0,56,96, - 160,184,224,160,184,5,8,8,6,0,255,112,136,128,128,136, - 112,32,96,5,8,8,6,0,0,64,32,0,248,128,240,128, - 248,5,8,8,6,0,0,8,16,0,248,128,240,128,248,5, - 8,8,6,0,0,32,80,0,248,128,240,128,248,5,7,7, - 6,0,0,80,0,248,128,240,128,248,3,8,8,6,1,0, - 128,64,0,224,64,64,64,224,3,8,8,6,1,0,32,64, - 0,224,64,64,64,224,3,8,8,6,1,0,64,160,0,224, - 64,64,64,224,3,7,7,6,1,0,160,0,224,64,64,64, - 224,5,9,9,6,0,255,80,32,112,136,128,184,136,136,112, - 5,8,8,6,0,0,104,144,0,136,200,168,152,136,5,8, - 8,6,0,0,64,32,112,136,136,136,136,112,5,8,8,6, - 0,0,16,32,112,136,136,136,136,112,5,8,8,6,0,0, - 32,80,0,112,136,136,136,112,5,8,8,6,0,0,104,144, - 0,112,136,136,136,112,5,8,8,6,0,0,80,0,112,136, - 136,136,136,112,5,5,5,6,0,1,136,80,32,80,136,5, - 8,8,6,0,255,16,112,168,168,168,168,112,64,5,8,8, - 6,0,0,64,32,136,136,136,136,136,112,5,8,8,6,0, - 0,16,32,136,136,136,136,136,112,5,8,8,6,0,0,32, - 80,0,136,136,136,136,112,5,8,8,6,0,0,80,0,136, - 136,136,136,136,112,1,7,7,6,2,0,128,0,128,128,128, - 128,128,5,9,9,6,0,255,120,128,128,112,8,8,240,32, - 96,4,8,8,6,1,255,96,144,144,160,144,144,224,128,5, - 8,8,6,0,0,64,32,0,112,8,120,136,120,5,8,8, - 6,0,0,16,32,0,112,8,120,136,120,5,8,8,6,0, - 0,32,80,0,112,8,120,136,120,5,8,8,6,0,0,104, - 144,0,112,8,120,136,120,5,7,7,6,0,0,80,0,112, - 8,120,136,120,5,8,8,6,0,0,32,80,32,112,8,120, - 136,120,5,6,6,6,0,0,208,40,120,160,168,80,5,7, - 7,6,0,255,112,128,128,136,112,32,96,5,8,8,6,0, - 0,64,32,0,112,136,248,128,112,5,8,8,6,0,0,16, - 32,0,112,136,248,128,112,5,8,8,6,0,0,32,80,0, - 112,136,248,128,112,5,7,7,6,0,0,80,0,112,136,248, - 128,112,3,8,8,6,1,0,128,64,0,64,192,64,64,224, - 3,8,8,6,1,0,32,64,0,64,192,64,64,224,3,8, - 8,6,1,0,64,160,0,64,192,64,64,224,3,7,7,6, - 1,0,160,0,64,192,64,64,224,5,8,8,6,0,255,80, - 32,112,136,136,120,8,112,5,8,8,6,0,0,104,144,0, - 176,200,136,136,136,5,8,8,6,0,0,64,32,0,112,136, - 136,136,112,5,8,8,6,0,0,16,32,0,112,136,136,136, - 112,5,8,8,6,0,0,32,80,0,112,136,136,136,112,5, - 8,8,6,0,0,104,144,0,112,136,136,136,112,5,7,7, - 6,0,0,80,0,112,136,136,136,112,5,5,5,6,0,1, - 32,0,248,0,32,5,7,7,6,0,255,16,112,168,168,168, - 112,64,5,8,8,6,0,0,64,32,0,136,136,136,152,104, - 5,8,8,6,0,0,16,32,0,136,136,136,152,104,5,8, - 8,6,0,0,32,80,0,136,136,136,152,104,5,7,7,6, - 0,0,80,0,136,136,136,152,104,1,5,5,6,2,0,128, - 128,128,128,128,5,7,7,6,0,255,112,128,112,8,240,32, - 96,5,8,8,6,0,255,80,0,136,136,136,120,8,112}; diff --git a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h deleted file mode 100644 index 75e779fd0f..0000000000 --- a/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_5_Cyrillic - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2560] U8G_SECTION(".progmem.ISO10646_5_Cyrillic_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 32, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, - 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, - 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, - 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, - 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, - 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, - 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, - 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, - 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, - 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, - 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, - 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, - 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, - 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, - 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, - 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, - 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, - 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, - 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, - 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, - 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, - 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, - 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, 6, - 0, 3, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, 8, 8, 6, 0, 0, - 64, 248, 128, 128, 240, 128, 128, 248, 5, 8, 8, 6, 0, 0, 80, 248, - 128, 128, 240, 128, 128, 248, 5, 7, 7, 6, 0, 0, 224, 64, 64, 112, - 72, 72, 112, 5, 8, 8, 6, 0, 0, 16, 32, 248, 136, 128, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 48, 72, 128, 224, 128, 72, 48, 5, 7, - 7, 6, 0, 0, 112, 136, 128, 112, 8, 136, 112, 3, 7, 7, 6, 1, - 0, 224, 64, 64, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 160, 0, - 224, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 160, 160, 160, 184, 168, 168, 184, - 5, 7, 7, 6, 0, 0, 160, 160, 160, 248, 168, 168, 184, 4, 7, 7, - 6, 0, 0, 224, 64, 112, 80, 80, 80, 80, 5, 8, 8, 6, 0, 0, - 16, 32, 136, 144, 160, 224, 144, 136, 5, 8, 8, 6, 0, 0, 64, 32, - 136, 152, 168, 200, 136, 136, 5, 9, 9, 6, 0, 255, 80, 32, 136, 136, - 136, 80, 32, 32, 32, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 136, - 136, 248, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, - 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 136, 136, 240, 5, 7, 7, - 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, 0, - 248, 136, 128, 128, 128, 128, 128, 5, 8, 8, 6, 0, 255, 120, 40, 40, - 40, 72, 136, 248, 136, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 168, 168, 168, 112, 168, 168, 168, 5, - 7, 7, 6, 0, 0, 240, 8, 8, 112, 8, 8, 240, 5, 7, 7, 6, - 0, 0, 136, 136, 152, 168, 200, 136, 136, 5, 8, 8, 6, 0, 0, 80, - 32, 136, 152, 168, 168, 200, 136, 5, 7, 7, 6, 0, 0, 136, 144, 160, - 192, 160, 144, 136, 5, 7, 7, 6, 0, 0, 120, 40, 40, 40, 40, 168, - 72, 5, 7, 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 112, 136, 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 136, - 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, - 7, 7, 6, 0, 0, 248, 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 80, 32, 64, 128, 5, 7, 7, 6, 0, 0, 32, - 112, 168, 168, 168, 112, 32, 5, 7, 7, 6, 0, 0, 136, 136, 80, 32, - 80, 136, 136, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 136, 136, 248, - 8, 5, 7, 7, 6, 0, 0, 136, 136, 136, 152, 104, 8, 8, 5, 7, - 7, 6, 0, 0, 168, 168, 168, 168, 168, 168, 248, 5, 8, 8, 6, 0, - 255, 168, 168, 168, 168, 168, 168, 248, 8, 5, 7, 7, 6, 0, 0, 192, - 64, 64, 112, 72, 72, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 200, - 168, 168, 200, 5, 7, 7, 6, 0, 0, 128, 128, 128, 240, 136, 136, 240, - 5, 7, 7, 6, 0, 0, 112, 136, 8, 56, 8, 136, 112, 5, 7, 7, - 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, 6, 0, 0, - 120, 136, 136, 120, 40, 72, 136, 5, 5, 5, 6, 0, 0, 112, 8, 120, - 136, 120, 5, 7, 7, 6, 0, 0, 24, 96, 128, 240, 136, 136, 112, 4, - 5, 5, 6, 0, 0, 224, 144, 224, 144, 224, 5, 5, 5, 6, 0, 0, - 248, 136, 128, 128, 128, 5, 6, 6, 6, 0, 255, 120, 40, 72, 136, 248, - 136, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 5, 5, 6, - 0, 0, 168, 168, 112, 168, 168, 5, 5, 5, 6, 0, 0, 240, 8, 48, - 8, 240, 5, 5, 5, 6, 0, 0, 136, 152, 168, 200, 136, 5, 7, 7, - 6, 0, 0, 80, 32, 136, 152, 168, 200, 136, 4, 5, 5, 6, 0, 0, - 144, 160, 192, 160, 144, 5, 5, 5, 6, 0, 0, 248, 40, 40, 168, 72, - 5, 5, 5, 6, 0, 0, 136, 216, 168, 136, 136, 5, 5, 5, 6, 0, - 0, 136, 136, 248, 136, 136, 5, 5, 5, 6, 0, 0, 112, 136, 136, 136, - 112, 5, 5, 5, 6, 0, 0, 248, 136, 136, 136, 136, 5, 6, 6, 6, - 0, 255, 240, 136, 136, 240, 128, 128, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 5, 5, 6, 0, 0, 248, 32, 32, 32, 32, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 6, 6, 6, 0, 0, - 32, 112, 168, 168, 112, 32, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, - 136, 5, 6, 6, 6, 0, 255, 136, 136, 136, 136, 248, 8, 5, 5, 5, - 6, 0, 0, 136, 136, 248, 8, 8, 5, 5, 5, 6, 0, 0, 168, 168, - 168, 168, 248, 5, 6, 6, 6, 0, 255, 168, 168, 168, 168, 248, 8, 5, - 5, 5, 6, 0, 0, 192, 64, 112, 72, 112, 5, 5, 5, 6, 0, 0, - 136, 136, 200, 168, 200, 3, 5, 5, 6, 1, 0, 128, 128, 192, 160, 192, - 5, 5, 5, 6, 0, 0, 112, 136, 56, 136, 112, 5, 5, 5, 6, 0, - 0, 144, 168, 232, 168, 144, 5, 5, 5, 6, 0, 0, 120, 136, 120, 40, - 72, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, 128, 112, 5, - 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 5, 9, 9, 6, - 0, 255, 64, 224, 64, 64, 120, 72, 72, 72, 16, 5, 8, 8, 6, 0, - 0, 16, 32, 0, 248, 136, 128, 128, 128, 5, 5, 5, 6, 0, 0, 112, - 136, 96, 136, 112, 5, 5, 5, 6, 0, 0, 112, 128, 112, 8, 240, 1, - 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 7, 7, 6, - 1, 0, 160, 0, 64, 64, 64, 64, 64, 3, 8, 8, 6, 1, 255, 32, - 0, 32, 32, 32, 32, 160, 64, 5, 5, 5, 6, 0, 0, 160, 160, 184, - 168, 184, 5, 5, 5, 6, 0, 0, 160, 160, 248, 168, 184, 5, 6, 6, - 6, 0, 0, 64, 224, 64, 120, 72, 72, 4, 8, 8, 6, 0, 0, 16, - 32, 0, 144, 160, 192, 160, 144, 5, 8, 8, 6, 0, 0, 64, 32, 0, - 136, 152, 168, 200, 136, 5, 9, 9, 6, 0, 255, 80, 32, 0, 136, 136, - 136, 120, 8, 112, 5, 6, 6, 6, 0, 255, 136, 136, 136, 136, 248, 32 -}; diff --git a/Marlin/dogm_font_data_ISO10646_CN.h b/Marlin/dogm_font_data_ISO10646_CN.h deleted file mode 100644 index 11fdb2240b..0000000000 --- a/Marlin/dogm_font_data_ISO10646_CN.h +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_CN - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w=11 h=11 x= 2 y=10 dx=12 dy= 0 ascent=10 len=22 - Font Bounding box w=12 h=11 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent =10 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_CN[4105] U8G_SECTION(".progmem.ISO10646_CN") = { - 0, 12, 11, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 10, 255, 7, - 255, 0, 0, 0, 6, 0, 10, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 0, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168, - 168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240, - 136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, - 128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, - 16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, - 136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, - 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, - 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, - 0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, - 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, - 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, - 6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 64, 128, 248, 3, 7, 7, 6, 0, 0, 224, 128, 128, 128, 128, 128, - 224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, - 0, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, - 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, - 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, - 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, - 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, - 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, - 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, - 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, - 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, - 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, - 6, 1, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, - 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, - 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, - 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, - 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, - 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, - 0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64, - 64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, - 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, - 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, - 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, - 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, - 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, - 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, - 6, 0, 3, 104, 144, 0, 0, 0, 6, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 11, 11, 22, 12, 0, 255, 255, - 224, 2, 0, 2, 0, 4, 0, 13, 0, 20, 128, 36, 64, 196, 32, 4, - 0, 4, 0, 4, 0, 11, 11, 22, 12, 0, 255, 249, 0, 138, 0, 171, - 224, 172, 64, 170, 64, 170, 64, 170, 64, 170, 128, 33, 0, 82, 128, 140, - 96, 11, 11, 22, 12, 0, 255, 36, 0, 36, 0, 63, 128, 68, 0, 132, - 0, 4, 0, 255, 224, 10, 0, 17, 0, 32, 128, 192, 96, 11, 11, 22, - 12, 0, 255, 36, 0, 36, 0, 63, 192, 68, 0, 4, 0, 255, 224, 9, - 0, 9, 0, 17, 32, 33, 32, 64, 224, 11, 11, 22, 12, 0, 255, 32, - 0, 61, 224, 81, 32, 145, 32, 17, 32, 255, 32, 17, 32, 41, 32, 37, - 224, 69, 32, 128, 0, 11, 11, 22, 12, 0, 255, 32, 128, 127, 192, 8, - 64, 255, 224, 17, 0, 32, 128, 95, 64, 128, 32, 63, 128, 0, 0, 127, - 192, 11, 11, 22, 12, 0, 255, 34, 64, 71, 224, 148, 128, 228, 128, 47, - 224, 68, 128, 244, 128, 7, 224, 52, 128, 196, 128, 7, 224, 11, 11, 22, - 12, 0, 255, 4, 128, 143, 224, 73, 0, 25, 0, 47, 192, 9, 0, 9, - 0, 47, 192, 73, 0, 137, 0, 15, 224, 11, 11, 22, 12, 0, 255, 16, - 0, 63, 128, 81, 0, 14, 0, 49, 128, 192, 96, 63, 128, 36, 128, 63, - 128, 36, 128, 63, 128, 11, 11, 22, 12, 0, 255, 34, 128, 250, 64, 7, - 224, 250, 128, 138, 128, 138, 128, 250, 128, 34, 128, 178, 128, 170, 160, 100, - 224, 11, 11, 22, 12, 0, 255, 34, 32, 71, 64, 146, 128, 239, 224, 34, - 0, 71, 192, 236, 64, 7, 192, 52, 64, 199, 192, 4, 64, 11, 11, 22, - 12, 0, 255, 8, 0, 15, 192, 8, 0, 8, 0, 255, 224, 8, 0, 14, - 0, 9, 128, 8, 64, 8, 0, 8, 0, 10, 11, 22, 12, 0, 255, 255, - 128, 0, 128, 0, 128, 128, 128, 128, 128, 255, 128, 128, 0, 128, 0, 128, - 64, 128, 64, 127, 192, 11, 11, 22, 12, 0, 255, 71, 192, 65, 0, 239, - 224, 65, 0, 69, 0, 105, 96, 201, 32, 77, 96, 73, 32, 79, 224, 200, - 32, 11, 11, 22, 12, 0, 255, 8, 0, 4, 0, 4, 0, 10, 0, 10, - 0, 10, 0, 17, 0, 17, 0, 32, 128, 64, 64, 128, 32, 11, 11, 22, - 12, 0, 255, 34, 64, 34, 0, 247, 224, 34, 0, 35, 224, 53, 32, 229, - 32, 37, 64, 40, 128, 41, 64, 114, 32, 11, 10, 20, 12, 0, 0, 68, - 64, 68, 64, 68, 64, 127, 192, 4, 0, 4, 0, 132, 32, 132, 32, 132, - 32, 255, 224, 11, 11, 22, 12, 0, 255, 4, 0, 0, 0, 127, 192, 4, - 0, 4, 0, 4, 0, 127, 192, 4, 0, 4, 0, 4, 0, 255, 224, 11, - 11, 22, 12, 0, 255, 255, 224, 17, 0, 1, 192, 254, 0, 72, 128, 37, - 0, 4, 0, 255, 224, 21, 0, 36, 128, 196, 96, 11, 11, 22, 12, 0, - 255, 17, 0, 127, 192, 68, 64, 127, 192, 68, 64, 127, 192, 4, 0, 255, - 224, 4, 0, 4, 0, 4, 0, 9, 11, 22, 12, 0, 255, 16, 0, 255, - 128, 128, 128, 128, 128, 255, 128, 128, 128, 128, 128, 255, 128, 128, 128, 128, - 128, 255, 128, 11, 11, 22, 12, 0, 255, 113, 0, 1, 0, 3, 224, 249, - 32, 33, 32, 65, 32, 81, 32, 137, 32, 250, 32, 2, 32, 4, 192, 11, - 11, 22, 12, 0, 255, 127, 192, 17, 0, 17, 0, 17, 0, 17, 0, 255, - 224, 17, 0, 17, 0, 33, 0, 33, 0, 65, 0, 11, 11, 22, 12, 0, - 255, 33, 0, 34, 0, 244, 64, 87, 224, 80, 32, 87, 192, 148, 64, 84, - 64, 36, 64, 87, 192, 148, 64, 11, 11, 22, 12, 0, 255, 17, 0, 10, - 0, 127, 192, 4, 0, 4, 0, 255, 224, 4, 0, 10, 0, 17, 0, 32, - 128, 192, 96, 10, 11, 22, 12, 0, 255, 95, 192, 0, 64, 132, 64, 132, - 64, 191, 64, 132, 64, 140, 64, 148, 64, 164, 64, 140, 64, 129, 192, 11, - 11, 22, 12, 0, 255, 36, 0, 39, 192, 36, 0, 36, 0, 255, 224, 0, - 0, 20, 64, 36, 128, 71, 0, 12, 0, 112, 0, 11, 11, 22, 12, 0, - 255, 36, 128, 4, 128, 15, 192, 228, 128, 36, 128, 63, 224, 36, 128, 36, - 128, 40, 128, 80, 0, 143, 224, 11, 11, 22, 12, 0, 255, 8, 0, 8, - 0, 255, 128, 136, 128, 136, 128, 255, 128, 136, 128, 136, 128, 255, 160, 136, - 32, 7, 224, 11, 11, 22, 12, 0, 255, 39, 128, 36, 128, 244, 128, 36, - 128, 116, 128, 108, 128, 164, 128, 36, 128, 36, 160, 40, 160, 48, 96, 10, - 11, 22, 12, 0, 255, 255, 192, 128, 64, 128, 64, 158, 64, 146, 64, 146, - 64, 158, 64, 128, 64, 128, 64, 255, 192, 128, 64, 11, 11, 22, 12, 0, - 255, 127, 192, 68, 0, 95, 192, 80, 64, 95, 192, 80, 64, 95, 192, 66, - 0, 74, 128, 82, 64, 166, 32, 11, 11, 22, 12, 0, 255, 4, 0, 7, - 224, 4, 0, 127, 192, 64, 64, 64, 64, 64, 64, 127, 192, 0, 0, 82, - 64, 137, 32, 11, 11, 22, 12, 0, 255, 71, 128, 36, 128, 4, 128, 4, - 128, 232, 96, 32, 0, 47, 192, 36, 64, 34, 128, 49, 0, 38, 192, 11, - 11, 22, 12, 0, 255, 127, 192, 74, 64, 127, 192, 4, 0, 255, 224, 4, - 0, 63, 128, 32, 128, 36, 128, 36, 128, 255, 224, 11, 11, 22, 12, 0, - 255, 34, 0, 79, 224, 72, 32, 79, 224, 200, 0, 79, 224, 74, 160, 90, - 160, 111, 224, 74, 160, 72, 96, 11, 11, 22, 12, 0, 255, 243, 192, 36, - 64, 42, 128, 241, 0, 34, 128, 101, 224, 114, 32, 165, 64, 32, 128, 35, - 0, 44, 0, 11, 11, 22, 12, 0, 255, 4, 0, 255, 224, 128, 32, 0, - 0, 255, 224, 4, 0, 36, 0, 39, 192, 36, 0, 84, 0, 143, 224, 11, - 11, 22, 12, 0, 255, 115, 224, 16, 128, 81, 0, 35, 224, 250, 32, 42, - 160, 34, 160, 34, 160, 32, 128, 33, 64, 98, 32, 11, 11, 22, 12, 0, - 255, 34, 0, 247, 128, 34, 128, 54, 128, 226, 160, 37, 160, 36, 96, 104, - 32, 0, 0, 82, 64, 137, 32, 11, 11, 22, 12, 0, 255, 115, 192, 66, - 0, 66, 0, 123, 224, 74, 64, 74, 64, 122, 64, 74, 64, 66, 64, 68, - 64, 136, 64, 11, 11, 22, 12, 0, 255, 8, 0, 255, 224, 8, 0, 31, - 192, 48, 64, 95, 192, 144, 64, 31, 192, 16, 64, 16, 64, 16, 192, 11, - 11, 22, 12, 0, 255, 2, 0, 127, 224, 66, 0, 66, 0, 95, 192, 66, - 0, 71, 0, 74, 128, 82, 64, 98, 32, 130, 0, 11, 11, 22, 12, 0, - 255, 243, 192, 150, 64, 145, 128, 166, 96, 161, 0, 151, 192, 145, 0, 149, - 0, 231, 224, 129, 0, 129, 0, 11, 11, 22, 12, 0, 255, 15, 128, 136, - 128, 79, 128, 8, 128, 143, 128, 64, 0, 31, 192, 53, 64, 85, 64, 149, - 64, 63, 224, 11, 11, 22, 12, 0, 255, 39, 224, 32, 128, 248, 128, 32, - 128, 32, 128, 56, 128, 224, 128, 32, 128, 32, 128, 32, 128, 97, 128, 11, - 11, 22, 12, 0, 255, 31, 224, 145, 0, 87, 192, 20, 64, 23, 192, 148, - 64, 87, 192, 17, 0, 85, 64, 153, 32, 35, 0, 11, 11, 22, 12, 0, - 255, 32, 128, 39, 224, 242, 64, 33, 128, 34, 64, 52, 32, 226, 64, 34, - 64, 34, 64, 34, 64, 100, 64, 11, 11, 22, 12, 0, 255, 65, 0, 65, - 0, 79, 224, 233, 32, 73, 32, 73, 32, 111, 224, 201, 32, 73, 32, 73, - 32, 207, 224, 11, 11, 22, 12, 0, 255, 33, 0, 241, 0, 79, 224, 169, - 32, 249, 32, 47, 224, 57, 32, 233, 32, 41, 32, 47, 224, 40, 32, 11, - 11, 22, 12, 0, 255, 143, 224, 73, 32, 9, 32, 203, 160, 73, 32, 79, - 224, 72, 32, 75, 160, 74, 160, 107, 160, 80, 224, 11, 11, 22, 12, 0, - 255, 127, 192, 4, 0, 68, 64, 36, 64, 36, 128, 4, 0, 255, 224, 4, - 0, 4, 0, 4, 0, 4, 0, 11, 11, 22, 12, 0, 255, 130, 0, 66, - 0, 31, 224, 194, 0, 95, 192, 82, 64, 95, 192, 71, 0, 74, 128, 82, - 64, 191, 224, 11, 11, 22, 12, 0, 255, 4, 0, 127, 224, 72, 128, 127, - 224, 72, 128, 79, 128, 64, 0, 95, 192, 72, 64, 71, 128, 152, 96, 11, - 11, 22, 12, 0, 255, 1, 0, 239, 224, 161, 0, 164, 64, 175, 224, 164, - 64, 175, 224, 169, 32, 233, 32, 2, 128, 12, 96, 11, 11, 22, 12, 0, - 255, 20, 192, 246, 160, 188, 96, 167, 128, 168, 128, 191, 224, 169, 32, 239, - 224, 9, 32, 15, 224, 9, 32, 11, 11, 22, 12, 0, 255, 127, 128, 64, - 128, 66, 128, 98, 128, 84, 128, 72, 128, 72, 128, 84, 160, 98, 160, 64, - 96, 128, 32, 11, 11, 22, 12, 0, 255, 4, 0, 127, 224, 64, 32, 127, - 224, 64, 0, 125, 224, 84, 32, 76, 160, 84, 96, 100, 160, 141, 96, 11, - 11, 22, 12, 0, 255, 130, 0, 95, 224, 4, 0, 8, 64, 159, 224, 64, - 32, 10, 128, 10, 128, 74, 160, 146, 160, 34, 96, 11, 11, 22, 12, 0, - 255, 65, 0, 79, 224, 232, 32, 66, 128, 68, 64, 104, 32, 199, 192, 65, - 0, 65, 0, 65, 0, 207, 224, 11, 11, 22, 12, 0, 255, 80, 32, 125, - 32, 145, 32, 255, 32, 17, 32, 125, 32, 85, 32, 85, 32, 84, 32, 92, - 32, 16, 224, 11, 11, 22, 12, 0, 255, 63, 128, 32, 128, 63, 128, 32, - 128, 255, 224, 72, 0, 123, 192, 73, 64, 121, 64, 72, 128, 251, 96, 11, - 11, 22, 12, 0, 255, 4, 0, 4, 0, 4, 0, 36, 128, 36, 64, 68, - 64, 68, 32, 132, 32, 4, 0, 4, 0, 28, 0, 11, 11, 22, 12, 0, - 255, 4, 0, 4, 0, 4, 0, 255, 224, 4, 0, 10, 0, 10, 0, 17, - 0, 17, 0, 32, 128, 192, 96, 9, 10, 20, 10, 0, 0, 136, 128, 73, - 0, 8, 0, 255, 128, 0, 128, 0, 128, 127, 128, 0, 128, 0, 128, 255, - 128, 11, 11, 22, 12, 0, 255, 33, 0, 18, 0, 255, 224, 0, 0, 120, - 128, 74, 128, 122, 128, 74, 128, 122, 128, 72, 128, 89, 128, 11, 11, 22, - 12, 0, 255, 39, 192, 0, 0, 0, 0, 239, 224, 33, 0, 34, 0, 36, - 64, 47, 224, 32, 32, 80, 0, 143, 224, 11, 11, 22, 12, 0, 255, 32, - 128, 39, 0, 249, 0, 33, 192, 119, 0, 33, 0, 249, 224, 39, 0, 113, - 32, 169, 32, 32, 224, 11, 11, 22, 12, 0, 255, 16, 64, 16, 64, 253, - 224, 16, 64, 56, 192, 53, 64, 82, 64, 148, 64, 16, 64, 16, 64, 16, - 192, 11, 11, 22, 12, 0, 255, 0, 64, 248, 64, 11, 224, 8, 64, 136, - 64, 82, 64, 81, 64, 33, 64, 80, 64, 72, 64, 137, 192, 10, 11, 22, - 12, 0, 255, 132, 0, 132, 64, 132, 128, 245, 0, 134, 0, 132, 0, 132, - 0, 148, 0, 164, 64, 196, 64, 131, 192, 11, 11, 22, 12, 0, 255, 17, - 32, 125, 0, 17, 0, 255, 224, 41, 0, 253, 64, 73, 64, 124, 128, 8, - 160, 253, 96, 10, 32, 11, 11, 22, 12, 0, 255, 23, 192, 36, 64, 36, - 64, 103, 192, 161, 0, 47, 224, 33, 0, 35, 128, 37, 64, 41, 32, 33, - 0, 11, 11, 22, 12, 0, 255, 8, 0, 255, 224, 16, 0, 39, 192, 32, - 128, 97, 0, 175, 224, 33, 0, 33, 0, 33, 0, 35, 0, 11, 11, 22, - 12, 0, 255, 36, 0, 47, 224, 180, 0, 164, 128, 164, 160, 170, 192, 42, - 128, 40, 128, 41, 64, 50, 64, 36, 32, 11, 11, 22, 12, 0, 255, 127, - 224, 128, 0, 63, 192, 32, 64, 63, 192, 16, 0, 31, 192, 16, 64, 40, - 128, 71, 0, 56, 224, 11, 11, 22, 12, 0, 255, 127, 224, 64, 0, 64, - 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 128, - 0, 11, 11, 22, 12, 0, 255, 255, 224, 4, 0, 127, 192, 68, 64, 127, - 192, 68, 64, 127, 192, 68, 0, 36, 0, 24, 0, 231, 224, 11, 11, 22, - 12, 0, 255, 17, 224, 253, 0, 69, 0, 41, 224, 253, 64, 17, 64, 125, - 64, 17, 64, 85, 64, 146, 64, 52, 64, 11, 11, 22, 12, 0, 255, 33, - 0, 95, 224, 64, 0, 207, 192, 64, 0, 79, 192, 64, 0, 79, 192, 72, - 64, 79, 192, 72, 64, 11, 11, 22, 12, 0, 255, 4, 0, 127, 192, 64, - 64, 127, 192, 64, 64, 127, 192, 64, 64, 127, 192, 4, 64, 82, 32, 191, - 160, 11, 11, 22, 12, 0, 255, 127, 192, 68, 64, 127, 192, 68, 64, 127, - 192, 4, 0, 27, 0, 224, 224, 17, 0, 17, 0, 97, 0, 11, 11, 22, - 12, 0, 255, 255, 224, 4, 0, 8, 0, 127, 224, 73, 32, 79, 32, 73, - 32, 79, 32, 73, 32, 73, 32, 127, 224, 11, 11, 22, 12, 0, 255, 253, - 224, 86, 64, 121, 64, 56, 128, 85, 64, 146, 32, 255, 224, 4, 0, 39, - 192, 36, 0, 255, 224, 11, 11, 22, 12, 0, 255, 251, 128, 82, 0, 123, - 224, 18, 64, 250, 64, 20, 64, 63, 128, 32, 128, 63, 128, 32, 128, 63, - 128, 11, 11, 22, 12, 0, 255, 31, 224, 32, 0, 39, 192, 100, 64, 167, - 192, 32, 0, 47, 224, 40, 32, 39, 192, 33, 0, 35, 0, 11, 11, 22, - 12, 0, 255, 243, 224, 130, 32, 130, 32, 250, 32, 130, 32, 130, 32, 138, - 32, 178, 32, 194, 224, 2, 0, 2, 0, 11, 11, 22, 12, 0, 255, 36, - 128, 70, 160, 149, 192, 228, 128, 39, 224, 68, 128, 245, 192, 6, 160, 52, - 128, 196, 128, 7, 224, 11, 11, 22, 12, 0, 255, 39, 192, 65, 0, 135, - 224, 224, 32, 34, 128, 69, 128, 242, 128, 15, 224, 48, 128, 193, 64, 2, - 32, 11, 11, 22, 12, 0, 255, 2, 0, 2, 0, 34, 0, 35, 192, 34, - 0, 34, 0, 34, 0, 34, 0, 34, 0, 34, 0, 255, 224, 9, 11, 22, - 12, 0, 255, 8, 0, 8, 0, 255, 128, 136, 128, 136, 128, 136, 128, 255, - 128, 136, 128, 136, 128, 136, 128, 255, 128, 11, 11, 22, 12, 0, 255, 33, - 0, 83, 160, 65, 0, 247, 224, 81, 0, 83, 192, 86, 64, 83, 192, 90, - 64, 83, 192, 66, 64, 11, 11, 22, 12, 0, 255, 127, 192, 4, 0, 4, - 0, 4, 0, 255, 224, 10, 0, 10, 0, 18, 0, 34, 32, 66, 32, 129, - 224, 11, 11, 22, 12, 0, 255, 17, 0, 33, 0, 47, 224, 97, 0, 163, - 128, 35, 128, 37, 64, 37, 64, 41, 32, 33, 0, 33, 0, 11, 11, 22, - 12, 0, 255, 247, 224, 148, 32, 244, 32, 151, 224, 148, 128, 244, 128, 151, - 224, 148, 128, 244, 160, 150, 96, 4, 32, 11, 11, 22, 12, 0, 255, 123, - 224, 148, 128, 4, 0, 127, 192, 4, 0, 255, 224, 1, 0, 255, 224, 33, - 0, 17, 0, 7, 0, 11, 11, 22, 12, 0, 255, 33, 0, 71, 192, 145, - 0, 47, 224, 96, 128, 175, 224, 32, 128, 36, 128, 34, 128, 32, 128, 35, - 128, 11, 11, 22, 12, 0, 255, 39, 192, 36, 64, 247, 192, 46, 224, 42, - 160, 62, 224, 225, 0, 47, 224, 35, 128, 37, 64, 105, 32, 11, 11, 22, - 12, 0, 255, 20, 0, 39, 224, 42, 0, 98, 0, 163, 192, 34, 0, 34, - 0, 35, 224, 34, 0, 34, 0, 34, 0 -}; diff --git a/Marlin/dogm_font_data_ISO10646_CZ.h b/Marlin/dogm_font_data_ISO10646_CZ.h deleted file mode 100644 index 671ad8ea2d..0000000000 --- a/Marlin/dogm_font_data_ISO10646_CZ.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - Fontname: ISO10646_CZ - Copyright: A. Hardtung, public domain - Modified for Czech accents by Petr Zahradnik, http://www.zahradniksebavi.cz - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_CZ[2832] U8G_SECTION(".progmem.ISO10646_CZ") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0, - 0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,8, - 16,248,128,128,240,128,248,3,8,8,6,1,0,32,64,224, - 64,64,64,64,224,5,8,8,6,0,0,16,32,112,136,136, - 136,136,112,5,8,8,6,0,0,16,32,136,136,136,136,136, - 112,5,8,8,6,0,0,16,32,136,136,80,32,32,32,5, - 8,8,6,0,0,16,32,0,112,8,120,136,120,5,8,8, - 6,0,0,16,32,0,112,136,248,128,112,2,8,8,6,2, - 0,64,128,0,128,128,128,128,128,5,8,8,6,0,0,16, - 32,0,112,136,136,136,112,5,8,8,6,0,0,16,32,0, - 136,136,136,152,104,5,9,9,6,0,255,16,32,0,136,136, - 136,120,8,112,5,8,8,6,0,0,80,32,112,136,128,128, - 136,112,5,8,8,6,0,0,80,32,0,112,128,128,136,112, - 5,8,8,6,0,0,80,32,240,136,136,136,136,240,6,8, - 8,6,0,0,4,20,24,112,144,144,144,112,5,8,8,6, - 0,0,80,32,248,128,128,240,128,248,5,8,8,6,0,0, - 80,32,0,112,136,248,128,112,5,8,8,6,0,0,80,32, - 136,200,168,152,136,136,5,8,8,6,0,0,80,32,0,176, - 200,136,136,136,5,8,8,6,0,0,80,32,240,136,240,160, - 144,136,5,8,8,6,0,0,80,32,0,176,200,128,128,128, - 5,8,8,6,0,0,80,32,120,128,128,112,8,240,5,8, - 8,6,0,0,80,32,0,112,128,112,8,240,5,8,8,6, - 0,0,80,32,248,32,32,32,32,32,6,8,8,6,0,0, - 4,68,72,224,64,64,64,48,5,8,8,6,0,0,32,80, - 168,136,136,136,136,112,5,8,8,6,0,0,32,80,32,136, - 136,136,152,104,5,8,8,6,0,0,80,32,248,8,48,64, - 128,248,5,8,8,6,0,0,80,32,0,248,16,32,64,248, - 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, - 0,0,1,7,7,6,2,0,128,0,128,128,128,128,128,5, - 7,7,6,0,0,32,112,168,160,168,112,32,5,7,7,6, - 0,0,48,64,64,224,64,80,168,5,5,5,6,0,0,136, - 112,80,112,136,5,7,7,6,0,0,136,80,32,248,32,248, - 32,1,7,7,6,2,0,128,128,128,0,128,128,128,5,8, - 8,6,0,0,48,72,32,80,80,32,144,96,3,1,1,6, - 1,7,160,5,7,7,6,0,0,248,136,184,184,184,136,248, - 5,7,7,6,0,1,112,8,120,136,120,0,248,5,5,5, - 6,0,1,40,80,160,80,40,5,3,3,6,0,1,248,8, - 8,2,2,2,6,2,6,64,128,5,7,7,6,0,0,248, - 136,168,136,152,168,248,5,1,1,6,0,6,248,4,4,4, - 6,0,3,96,144,144,96,5,7,7,6,0,0,32,32,248, - 32,32,0,248,4,5,5,6,0,3,96,144,32,64,240,3, - 5,5,6,0,3,224,32,224,32,224,2,2,2,6,2,6, - 64,128,5,8,8,6,0,255,136,136,136,136,152,232,128,128, - 5,7,7,6,0,0,120,152,152,120,24,24,24,2,2,2, - 6,2,2,192,192,2,2,2,6,2,255,64,128,3,5,5, - 6,0,3,64,192,64,64,224,5,7,7,6,0,1,112,136, - 136,136,112,0,248,5,5,5,6,0,1,160,80,40,80,160, - 5,7,7,6,0,0,136,144,168,88,184,8,8,5,7,7, - 6,0,0,136,144,184,72,152,32,56,5,8,8,6,0,0, - 192,64,192,72,216,56,8,8,5,7,7,6,0,0,32,0, - 32,64,128,136,112,5,8,8,6,0,0,64,32,0,112,136, - 248,136,136,5,8,8,6,0,0,16,32,0,112,136,248,136, - 136,5,8,8,6,0,0,32,80,0,112,136,248,136,136,5, - 8,8,6,0,0,104,144,0,112,136,248,136,136,5,8,8, - 6,0,0,80,0,112,136,136,248,136,136,5,8,8,6,0, - 0,32,80,32,112,136,248,136,136,5,7,7,6,0,0,56, - 96,160,184,224,160,184,5,8,8,6,0,255,112,136,128,128, - 136,112,32,96,5,8,8,6,0,0,64,32,0,248,128,240, - 128,248,5,8,8,6,0,0,8,16,0,248,128,240,128,248, - 5,8,8,6,0,0,32,80,0,248,128,240,128,248,5,7, - 7,6,0,0,80,0,248,128,240,128,248,3,8,8,6,1, - 0,128,64,0,224,64,64,64,224,3,8,8,6,1,0,32, - 64,0,224,64,64,64,224,3,8,8,6,1,0,64,160,0, - 224,64,64,64,224,3,7,7,6,1,0,160,0,224,64,64, - 64,224,5,9,9,6,0,255,80,32,112,136,128,184,136,136, - 112,5,8,8,6,0,0,104,144,0,136,200,168,152,136,5, - 8,8,6,0,0,64,32,112,136,136,136,136,112,5,8,8, - 6,0,0,16,32,112,136,136,136,136,112,5,8,8,6,0, - 0,32,80,0,112,136,136,136,112,5,8,8,6,0,0,104, - 144,0,112,136,136,136,112,5,8,8,6,0,0,80,0,112, - 136,136,136,136,112,5,5,5,6,0,1,136,80,32,80,136, - 5,8,8,6,0,255,16,112,168,168,168,168,112,64,5,8, - 8,6,0,0,64,32,136,136,136,136,136,112,5,8,8,6, - 0,0,16,32,136,136,136,136,136,112,5,8,8,6,0,0, - 32,80,0,136,136,136,136,112,5,8,8,6,0,0,80,0, - 136,136,136,136,136,112,1,7,7,6,2,0,128,0,128,128, - 128,128,128,5,9,9,6,0,255,120,128,128,112,8,8,240, - 32,96,4,8,8,6,1,255,96,144,144,160,144,144,224,128, - 5,8,8,6,0,0,64,32,0,112,8,120,136,120,5,8, - 8,6,0,0,16,32,0,112,8,120,136,120,5,8,8,6, - 0,0,32,80,0,112,8,120,136,120,5,8,8,6,0,0, - 104,144,0,112,8,120,136,120,5,7,7,6,0,0,80,0, - 112,8,120,136,120,5,8,8,6,0,0,32,80,32,112,8, - 120,136,120,5,6,6,6,0,0,208,40,120,160,168,80,5, - 7,7,6,0,255,112,128,128,136,112,32,96,5,8,8,6, - 0,0,64,32,0,112,136,248,128,112,5,8,8,6,0,0, - 16,32,0,112,136,248,128,112,5,8,8,6,0,0,32,80, - 0,112,136,248,128,112,5,7,7,6,0,0,80,0,112,136, - 248,128,112,3,8,8,6,1,0,128,64,0,64,192,64,64, - 224,3,8,8,6,1,0,32,64,0,64,192,64,64,224,3, - 8,8,6,1,0,64,160,0,64,192,64,64,224,3,7,7, - 6,1,0,160,0,64,192,64,64,224,5,8,8,6,0,255, - 80,32,112,136,136,120,8,112,5,8,8,6,0,0,104,144, - 0,176,200,136,136,136,5,8,8,6,0,0,64,32,0,112, - 136,136,136,112,5,8,8,6,0,0,16,32,0,112,136,136, - 136,112,5,8,8,6,0,0,32,80,0,112,136,136,136,112, - 5,8,8,6,0,0,104,144,0,112,136,136,136,112,5,7, - 7,6,0,0,80,0,112,136,136,136,112,5,5,5,6,0, - 1,32,0,248,0,32,5,7,7,6,0,255,16,112,168,168, - 168,112,64,5,8,8,6,0,0,64,32,0,136,136,136,152, - 104,5,8,8,6,0,0,16,32,0,136,136,136,152,104,5, - 8,8,6,0,0,32,80,0,136,136,136,152,104,5,7,7, - 6,0,0,80,0,136,136,136,152,104,1,5,5,6,2,0, - 128,128,128,128,128,5,7,7,6,0,255,112,128,112,8,240, - 32,96,5,8,8,6,0,255,80,0,136,136,136,120,8,112 - }; diff --git a/Marlin/dogm_font_data_ISO10646_Greek.h b/Marlin/dogm_font_data_ISO10646_Greek.h deleted file mode 100644 index efe44f3cc1..0000000000 --- a/Marlin/dogm_font_data_ISO10646_Greek.h +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/* - Fontname: ISO10646_4_Greek - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 6 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_Greek_5x7[2715] U8G_SECTION(".progmem.ISO10646_Greek_5x7") = { - 0,6,9,0,254,7,1,145,3,32,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, - 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, - 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, - 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, - 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, - 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, - 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, - 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, - 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, - 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, - 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, - 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, - 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, - 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, - 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, - 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, - 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, - 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, - 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, - 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, - 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, - 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, - 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, - 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1, - 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80, - 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64, - 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0, - 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128, - 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120, - 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0, - 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136, - 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136, - 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8, - 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6, - 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192, - 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168, - 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6, - 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136, - 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5, - 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0, - 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64, - 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5, - 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136, - 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6, - 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0, - 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64, - 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3, - 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6, - 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0, - 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, - 0,0,2,2,2,6,1,6,64,128,3,3,3,6,1,5, - 32,64,160,5,8,8,6,0,0,64,160,80,80,136,248,136, - 136,2,2,2,6,1,2,192,192,5,8,8,6,0,0,64, - 128,248,128,240,128,128,248,5,8,8,6,0,0,64,128,136, - 136,248,136,136,136,4,8,8,6,0,0,64,128,112,32,32, - 32,32,112,0,0,0,6,0,0,5,8,8,6,0,0,64, - 128,112,136,136,136,136,112,0,0,0,6,0,0,5,8,8, - 6,0,0,64,128,8,136,112,32,32,32,5,8,8,6,0, - 0,64,128,112,136,136,136,80,216,3,8,8,6,1,0,32, - 64,160,0,64,64,64,32,5,7,7,6,0,0,32,80,136, - 136,248,136,136,5,7,7,6,0,0,240,72,72,112,72,72, - 240,5,7,7,6,0,0,248,128,128,128,128,128,128,5,6, - 6,6,0,0,32,80,80,136,136,248,5,7,7,6,0,0, - 248,128,128,240,128,128,248,5,7,7,6,0,0,248,8,16, - 32,64,128,248,5,7,7,6,0,0,136,136,136,248,136,136, - 136,5,7,7,6,0,0,112,136,136,168,136,136,112,3,7, - 7,6,1,0,224,64,64,64,64,64,224,5,7,7,6,0, - 0,136,144,160,192,160,144,136,5,7,7,6,0,0,32,80, - 136,136,136,136,136,5,7,7,6,0,0,136,216,168,168,136, - 136,136,5,7,7,6,0,0,136,200,200,168,152,152,136,5, - 7,7,6,0,0,248,0,0,112,0,0,248,5,7,7,6, - 0,0,112,136,136,136,136,136,112,5,7,7,6,0,0,248, - 80,80,80,80,80,80,5,7,7,6,0,0,240,136,136,240, - 128,128,128,0,0,0,6,0,0,5,7,7,6,0,0,248, - 128,64,32,64,128,248,5,7,7,6,0,0,248,32,32,32, - 32,32,32,5,7,7,6,0,0,136,136,80,32,32,32,32, - 5,7,7,6,0,0,112,32,112,168,112,32,112,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 168,168,168,168,112,32,32,5,6,6,6,0,0,112,136,136, - 80,80,216,3,8,8,6,1,0,160,0,224,64,64,64,64, - 224,5,8,8,6,0,0,80,0,136,136,136,80,32,32,5, - 8,8,6,0,0,32,64,8,104,152,144,144,104,5,8,8, - 6,0,0,32,64,0,112,136,224,136,112,5,9,9,6,0, - 255,32,64,0,112,136,136,136,136,8,2,8,8,6,1,0, - 64,128,0,128,128,128,128,64,5,8,8,6,0,0,16,32, - 80,0,136,136,136,112,5,6,6,6,0,0,8,104,152,144, - 144,104,4,6,6,6,0,255,96,144,240,144,224,128,5,6, - 6,6,0,255,136,72,80,32,32,64,5,6,6,6,0,0, - 48,64,112,136,136,112,5,5,5,6,0,0,112,136,224,136, - 112,5,8,8,6,0,255,128,112,64,128,128,112,8,112,5, - 6,6,6,0,255,184,200,136,136,136,8,5,5,5,6,0, - 0,112,136,248,136,112,3,5,5,6,1,0,128,128,128,128, - 96,4,5,5,6,0,0,144,160,192,160,144,5,6,6,6, - 0,0,64,32,32,80,80,136,5,6,6,6,0,255,136,136, - 136,216,168,128,5,5,5,6,0,0,136,136,80,96,32,5, - 9,9,6,0,255,128,224,128,112,32,64,240,8,112,5,5, - 5,6,0,0,112,136,136,136,112,5,5,5,6,0,0,248, - 80,80,80,80,5,6,6,6,0,255,112,136,136,200,176,128, - 5,7,7,6,0,255,48,64,128,64,48,8,112,5,5,5, - 6,0,0,104,144,144,144,96,4,5,5,6,0,0,240,64, - 64,64,48,5,5,5,6,0,0,136,136,144,144,224,5,7, - 7,6,0,255,32,168,168,168,112,32,32,5,6,6,6,0, - 255,136,80,32,32,80,136,5,6,6,6,0,255,168,168,168, - 168,112,32,5,5,5,6,0,0,80,136,136,168,112,4,7, - 7,6,0,0,160,0,64,64,64,64,48,5,7,7,6,0, - 0,80,0,136,136,144,144,224,4,8,8,6,0,0,32,64, - 0,96,144,144,144,96,5,8,8,6,0,0,32,64,0,136, - 136,144,144,96,5,8,8,6,0,0,32,64,0,80,136,136, - 168,112,5,7,7,6,0,255,144,160,192,160,144,136,16,5, - 8,8,6,0,0,96,144,160,128,240,136,136,112,5,7,7, - 6,0,0,112,80,56,144,144,144,96,5,6,6,6,0,0, - 152,80,32,32,32,32,5,8,8,6,0,0,64,128,152,80, - 32,32,32,32,5,8,8,6,0,0,80,0,152,80,32,32, - 32,32,5,7,7,6,0,255,48,168,168,168,168,112,32,5, - 5,5,6,0,0,248,80,80,80,88,5,6,6,6,0,255, - 136,80,112,80,136,16,5,7,7,6,0,255,112,136,136,136, - 112,32,112,5,6,6,6,0,255,112,136,136,112,32,112,5, - 6,6,6,0,0,112,136,128,112,32,112,5,7,7,6,0, - 255,8,8,112,128,112,16,96,5,6,6,6,0,0,248,128, - 128,240,128,128,4,5,5,6,0,0,240,128,224,128,128,5, - 6,6,6,0,0,248,0,0,112,0,248,4,5,5,6,0, - 0,64,128,240,16,32,5,7,7,6,0,0,224,80,40,40, - 8,8,16,5,7,7,6,0,0,192,32,80,40,8,8,8, - 5,7,7,6,0,255,168,168,168,168,88,8,112,5,6,6, - 6,0,255,168,168,168,88,8,112,5,6,6,6,0,0,104, - 136,136,120,8,8,5,6,6,6,0,255,104,136,136,120,8, - 8,4,8,8,6,0,255,128,224,144,144,144,144,32,192,5, - 5,5,6,0,0,104,144,112,16,224,5,6,6,6,0,0, - 96,144,16,96,136,112,4,6,6,6,0,0,96,144,16,96, - 128,112,5,6,6,6,0,0,136,80,32,80,136,248,5,5, - 5,6,0,0,136,80,32,80,112,5,6,6,6,0,0,120, - 128,240,136,136,112,4,5,5,6,0,0,240,128,224,144,96, - 3,6,6,6,1,0,64,224,64,64,64,64,3,6,6,6, - 1,255,64,224,64,64,64,128,5,5,5,6,0,0,136,80, - 112,80,136,5,6,6,6,0,255,112,136,136,240,128,112,4, - 5,5,6,0,0,112,128,128,128,112,2,8,8,6,1,255, - 64,0,192,64,64,64,64,128,5,7,7,6,0,0,112,136, - 136,248,136,136,112,4,5,5,6,0,0,112,128,224,128,112, - 4,5,5,6,0,0,224,16,112,16,224,5,7,7,6,0, - 0,128,240,136,136,136,240,128,4,7,7,6,0,255,128,224, - 144,144,144,224,128,5,6,6,6,0,0,112,136,128,128,136, - 112,5,6,6,6,0,0,136,216,168,136,136,136,5,6,6, - 6,0,255,136,216,168,136,136,128,5,8,8,6,0,255,112, - 136,136,136,112,64,224,64,5,6,6,6,0,0,112,136,8, - 8,136,112,5,6,6,6,0,0,112,136,160,128,136,112,5, - 6,6,6,0,0,112,136,40,8,136,112}; diff --git a/Marlin/dogm_font_data_ISO10646_Kana.h b/Marlin/dogm_font_data_ISO10646_Kana.h deleted file mode 100644 index 69683740c3..0000000000 --- a/Marlin/dogm_font_data_ISO10646_Kana.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_Kana - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 8 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_Kana_5x7[2482] U8G_SECTION(".progmem.ISO10646_Kana_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 32, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, - 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, - 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, - 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, - 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, - 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, - 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, - 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, - 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, - 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, - 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, - 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, - 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, - 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, - 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, - 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, - 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, - 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, - 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, - 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, - 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, - 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, - 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, 6, - 0, 3, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, 3, 3, 6, 0, 1, - 248, 0, 248, 4, 4, 4, 6, 0, 0, 240, 16, 96, 64, 5, 6, 6, - 6, 0, 0, 248, 8, 40, 48, 32, 64, 3, 4, 4, 6, 1, 0, 32, - 64, 192, 64, 4, 6, 6, 6, 0, 0, 16, 32, 96, 160, 32, 32, 4, - 4, 4, 6, 0, 0, 32, 240, 144, 32, 5, 6, 6, 6, 0, 0, 32, - 248, 136, 8, 16, 32, 3, 4, 4, 6, 1, 0, 224, 64, 64, 224, 5, - 5, 5, 6, 0, 0, 248, 32, 32, 32, 248, 4, 4, 4, 6, 0, 0, - 32, 240, 96, 160, 5, 6, 6, 6, 0, 0, 16, 248, 48, 80, 144, 16, - 5, 6, 6, 6, 0, 0, 64, 248, 72, 72, 72, 144, 5, 8, 8, 6, - 0, 0, 40, 0, 64, 248, 72, 72, 72, 144, 5, 6, 6, 6, 0, 0, - 32, 248, 32, 248, 32, 32, 5, 8, 8, 6, 0, 0, 40, 0, 32, 248, - 32, 248, 32, 32, 4, 5, 5, 6, 0, 0, 112, 144, 16, 32, 192, 5, - 7, 7, 6, 0, 0, 40, 0, 112, 144, 16, 32, 192, 5, 6, 6, 6, - 0, 0, 64, 120, 144, 16, 16, 32, 5, 8, 8, 6, 0, 0, 40, 0, - 64, 120, 144, 16, 16, 32, 5, 5, 5, 6, 0, 0, 248, 8, 8, 8, - 248, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 8, 8, 248, 5, 6, - 6, 6, 0, 0, 80, 248, 80, 16, 32, 64, 5, 8, 8, 6, 0, 0, - 40, 0, 80, 248, 80, 16, 32, 64, 5, 5, 5, 6, 0, 0, 192, 8, - 200, 16, 224, 5, 7, 7, 6, 0, 0, 40, 0, 192, 8, 200, 16, 224, - 5, 5, 5, 6, 0, 0, 248, 16, 32, 80, 136, 5, 7, 7, 6, 0, - 0, 40, 0, 248, 16, 32, 80, 136, 5, 6, 6, 6, 0, 0, 64, 248, - 72, 80, 64, 56, 5, 8, 8, 6, 0, 0, 40, 0, 64, 248, 72, 80, - 64, 56, 5, 5, 5, 6, 0, 0, 136, 136, 72, 16, 96, 5, 7, 7, - 6, 0, 0, 40, 0, 136, 136, 72, 16, 96, 5, 5, 5, 6, 0, 0, - 120, 72, 168, 16, 96, 5, 7, 7, 6, 0, 0, 40, 0, 120, 72, 168, - 16, 96, 5, 6, 6, 6, 0, 0, 16, 224, 32, 248, 32, 64, 5, 8, - 8, 6, 0, 0, 40, 0, 16, 224, 32, 248, 32, 64, 5, 4, 4, 6, - 0, 0, 168, 168, 8, 48, 5, 5, 5, 6, 0, 0, 168, 168, 8, 16, - 32, 5, 7, 7, 6, 0, 0, 40, 0, 168, 168, 8, 16, 32, 5, 6, - 6, 6, 0, 0, 112, 0, 248, 32, 32, 64, 5, 8, 8, 6, 0, 0, - 40, 0, 112, 0, 248, 32, 32, 64, 3, 6, 6, 6, 1, 0, 128, 128, - 192, 160, 128, 128, 4, 8, 8, 6, 1, 0, 80, 0, 128, 128, 192, 160, - 128, 128, 5, 6, 6, 6, 0, 0, 32, 248, 32, 32, 64, 128, 5, 5, - 5, 6, 0, 0, 112, 0, 0, 0, 248, 5, 5, 5, 6, 0, 0, 248, - 8, 80, 32, 208, 5, 6, 6, 6, 0, 0, 32, 248, 16, 32, 112, 168, - 3, 6, 6, 6, 1, 0, 32, 32, 32, 32, 64, 128, 5, 5, 5, 6, - 0, 0, 16, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 40, 0, 16, - 136, 136, 136, 136, 5, 8, 8, 6, 0, 0, 24, 24, 0, 16, 136, 136, - 136, 136, 5, 6, 6, 6, 0, 0, 128, 128, 248, 128, 128, 120, 5, 7, - 7, 6, 0, 0, 40, 128, 128, 248, 128, 128, 120, 5, 7, 7, 6, 0, - 0, 24, 152, 128, 248, 128, 128, 120, 5, 5, 5, 6, 0, 0, 248, 8, - 8, 16, 96, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 8, 16, 96, - 5, 8, 8, 6, 0, 0, 24, 24, 0, 248, 8, 8, 16, 96, 5, 4, - 4, 6, 0, 1, 64, 160, 16, 8, 5, 6, 6, 6, 0, 1, 40, 0, - 64, 160, 16, 8, 5, 6, 6, 6, 0, 1, 24, 24, 64, 160, 16, 8, - 5, 6, 6, 6, 0, 0, 32, 248, 32, 168, 168, 32, 5, 8, 8, 6, - 0, 0, 40, 0, 32, 248, 32, 168, 168, 32, 5, 8, 8, 6, 0, 0, - 24, 24, 32, 248, 32, 168, 168, 32, 5, 5, 5, 6, 0, 0, 248, 8, - 80, 32, 16, 4, 5, 5, 6, 1, 0, 224, 0, 224, 0, 240, 5, 5, - 5, 6, 0, 0, 32, 64, 136, 248, 8, 5, 5, 5, 6, 0, 0, 8, - 40, 16, 40, 192, 5, 5, 5, 6, 0, 0, 248, 64, 248, 64, 56, 5, - 4, 4, 6, 0, 0, 64, 248, 80, 64, 5, 6, 6, 6, 0, 0, 64, - 248, 72, 80, 64, 64, 4, 4, 4, 6, 0, 0, 96, 32, 32, 240, 5, - 5, 5, 6, 0, 0, 112, 16, 16, 16, 248, 4, 5, 5, 6, 0, 0, - 240, 16, 240, 16, 240, 5, 5, 5, 6, 0, 0, 248, 8, 248, 8, 248, - 5, 6, 6, 6, 0, 0, 112, 0, 248, 8, 16, 32, 4, 6, 6, 6, - 0, 0, 144, 144, 144, 144, 16, 32, 5, 5, 5, 6, 0, 0, 32, 160, - 168, 168, 176, 4, 5, 5, 6, 0, 0, 128, 128, 144, 160, 192, 5, 5, - 5, 6, 0, 0, 248, 136, 136, 136, 248, 4, 4, 4, 6, 0, 0, 240, - 144, 16, 32, 5, 5, 5, 6, 0, 0, 248, 136, 8, 16, 32, 5, 6, - 6, 6, 0, 0, 16, 248, 80, 80, 248, 16, 5, 5, 5, 6, 0, 0, - 248, 8, 48, 32, 248, 5, 5, 5, 6, 0, 0, 248, 8, 248, 8, 48, - 5, 5, 5, 6, 0, 0, 192, 8, 8, 16, 224, 5, 8, 8, 6, 0, - 0, 40, 0, 32, 248, 136, 8, 16, 32, 4, 4, 4, 6, 0, 0, 64, - 240, 80, 160, 4, 4, 4, 6, 0, 0, 64, 240, 32, 64, 5, 7, 7, - 6, 0, 0, 40, 0, 248, 136, 8, 16, 96, 5, 8, 8, 6, 0, 0, - 40, 0, 16, 248, 80, 80, 248, 16, 5, 7, 7, 6, 0, 0, 40, 0, - 248, 8, 48, 32, 248, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 248, - 8, 48, 2, 2, 2, 6, 2, 2, 192, 192, 5, 1, 1, 6, 0, 2, - 248, 5, 4, 4, 6, 0, 1, 128, 96, 16, 8, 5, 5, 5, 6, 0, - 1, 40, 128, 96, 16, 8, 5, 6, 6, 6, 0, 0, 248, 8, 8, 8, - 8, 8 -}; diff --git a/Marlin/dogm_font_data_ISO10646_SK.h b/Marlin/dogm_font_data_ISO10646_SK.h deleted file mode 100644 index 7a460858d8..0000000000 --- a/Marlin/dogm_font_data_ISO10646_SK.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - Fontname: ISO10646_SK - Copyright: A. Hardtung, modified by Roman Moravcik - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0, - 0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80, - 0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248, - 128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64, - 64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136, - 112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5, - 8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8, - 6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0, - 0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80, - 0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112, - 136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128, - 128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112, - 5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8, - 8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6, - 0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0, - 0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80, - 32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240, - 136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144, - 144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128, - 248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5, - 8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8, - 6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0, - 0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80, - 32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240, - 136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200, - 128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8, - 240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5, - 8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8, - 6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0, - 0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80, - 32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0}; diff --git a/Marlin/dogm_font_data_Marlin_symbols.h b/Marlin/dogm_font_data_Marlin_symbols.h deleted file mode 100644 index ad9b983b20..0000000000 --- a/Marlin/dogm_font_data_Marlin_symbols.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: Marlin_symbols - Copyright: Created with Fony 1.4.7 - Capital A Height: 0, '1' Height: 0 - Calculated Max Values w= 5 h=10 x= 0 y= 3 dx= 6 dy= 0 ascent= 8 len=10 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 0 descent= 0 - X Font ascent = 0 descent= 0 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t Marlin_symbols[140] U8G_SECTION(".progmem.Marlin_symbols") = { - 0, 6, 9, 0, 254, 0, 0, 0, 0, 0, 1, 9, 0, 8, 254, 0, - 0, 5, 8, 8, 6, 0, 0, 64, 240, 200, 136, 136, 152, 120, 16, 5, - 8, 8, 6, 0, 0, 192, 248, 136, 136, 136, 136, 136, 248, 5, 5, 5, - 6, 0, 1, 32, 48, 248, 48, 32, 5, 8, 8, 6, 0, 0, 32, 112, - 248, 32, 32, 32, 32, 224, 5, 9, 9, 6, 0, 255, 32, 112, 168, 168, - 184, 136, 136, 112, 32, 5, 9, 9, 6, 0, 255, 224, 128, 192, 176, 168, - 40, 48, 40, 40, 5, 9, 9, 6, 0, 255, 248, 168, 136, 136, 136, 136, - 136, 168, 248, 5, 10, 10, 6, 0, 254, 32, 80, 80, 80, 80, 136, 168, - 168, 136, 112, 3, 3, 3, 6, 0, 3, 64, 160, 64 -}; diff --git a/Marlin/drivers.h b/Marlin/drivers.h deleted file mode 100644 index 3a8ff4a2a0..0000000000 --- a/Marlin/drivers.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifndef _DRIVERS_H_ -#define _DRIVERS_H_ - -#include "MarlinConfig.h" - -#define A4988 0x001 -#define DRV8825 0x002 -#define LV8729 0x003 -#define L6470 0x104 -#define TB6560 0x005 -#define TB6600 0x006 -#define TMC2100 0x007 -#define TMC2130 0x108 -#define TMC2130_STANDALONE 0x008 -#define TMC2208 0x109 -#define TMC2208_STANDALONE 0x009 -#define TMC26X 0x10A -#define TMC26X_STANDALONE 0x00A -#define TMC2660 0x10B -#define TMC2660_STANDALONE 0x00B - -#define _AXIS_DRIVER_TYPE(A,T) ( defined(A##_DRIVER_TYPE) && (A##_DRIVER_TYPE == T) ) - -#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T) -#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T) -#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T) -#define AXIS_DRIVER_TYPE_X2(T) (ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)) && _AXIS_DRIVER_TYPE(X2,T) -#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T)) -#define AXIS_DRIVER_TYPE_Z2(T) (ENABLED(Z_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z2,T)) -#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T)) -#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T)) -#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T)) -#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T)) -#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T)) - -#define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T) - -#define HAS_DRIVER(T) (AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) || \ - AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) || \ - AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || \ - AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) || \ - AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) || \ - AXIS_DRIVER_TYPE_E4(T) ) - -// Test for supported TMC drivers that require advanced configuration -// Does not match standalone configurations -#define HAS_TRINAMIC (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) - -#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE_##A(TMC2130) || \ - AXIS_DRIVER_TYPE_##A(TMC2208) ) - -#endif // _DRIVERS_H_ diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h deleted file mode 100644 index bcc3011bb6..0000000000 --- a/Marlin/duration_t.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __DURATION_T__ -#define __DURATION_T__ - -#include -#include - -struct duration_t { - /** - * @brief Duration is stored in seconds - */ - uint32_t value; - - /** - * @brief Constructor - */ - duration_t() - : duration_t(0) {}; - - /** - * @brief Constructor - * - * @param seconds The number of seconds - */ - duration_t(uint32_t const &seconds) { - this->value = seconds; - } - - /** - * @brief Equality comparison - * @details Overloads the equality comparison operator - * - * @param value The number of seconds to compare to - * @return True if both durations are equal - */ - bool operator==(const uint32_t &value) const { - return (this->value == value); - } - - /** - * @brief Inequality comparison - * @details Overloads the inequality comparison operator - * - * @param value The number of seconds to compare to - * @return False if both durations are equal - */ - bool operator!=(const uint32_t &value) const { - return ! this->operator==(value); - } - - /** - * @brief Formats the duration as years - * @return The number of years - */ - inline uint8_t year() const { - return this->day() / 365; - } - - /** - * @brief Formats the duration as days - * @return The number of days - */ - inline uint16_t day() const { - return this->hour() / 24; - } - - /** - * @brief Formats the duration as hours - * @return The number of hours - */ - inline uint32_t hour() const { - return this->minute() / 60; - } - - /** - * @brief Formats the duration as minutes - * @return The number of minutes - */ - inline uint32_t minute() const { - return this->second() / 60; - } - - /** - * @brief Formats the duration as seconds - * @return The number of seconds - */ - inline uint32_t second() const { - return this->value; - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "full" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 21 bytes - * - * Output examples: - * 123456789012345678901 (strlen) - * 135y 364d 23h 59m 59s - * 364d 23h 59m 59s - * 23h 59m 59s - * 59m 59s - * 59s - */ - void toString(char *buffer) const { - int y = this->year(), - d = this->day() % 365, - h = this->hour() % 24, - m = this->minute() % 60, - s = this->second() % 60; - - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); - else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); - else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); - else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); - else sprintf_P(buffer, PSTR("%is"), s); - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "digital" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 10 bytes - * - * Output examples: - * 123456789 (strlen) - * 99:59 - * 11d 12:33 - */ - uint8_t toDigital(char *buffer, bool with_days=false) const { - uint16_t h = uint16_t(this->hour()), - m = uint16_t(this->minute() % 60UL); - if (with_days) { - uint16_t d = this->day(); - sprintf_P(buffer, PSTR("%ud %02u:%02u"), d, h % 24, m); - return d >= 10 ? 9 : 8; - } - else if (h < 100) { - sprintf_P(buffer, PSTR("%02u:%02u"), h, m); - return 5; - } - else { - sprintf_P(buffer, PSTR("%u:%02u"), h, m); - return 6; - } - } -}; - -#endif // __DURATION_T__ diff --git a/Marlin/emergency_parser.cpp b/Marlin/emergency_parser.cpp deleted file mode 100644 index c1cab3a2c7..0000000000 --- a/Marlin/emergency_parser.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * emergency_parser.cpp - Intercept special commands directly in the serial stream - */ - -#include "MarlinConfig.h" - -#if ENABLED(EMERGENCY_PARSER) - -#include "emergency_parser.h" - -// Static data members -bool EmergencyParser::killed_by_M112; // = false -EmergencyParser::State EmergencyParser::state; // = EP_RESET - -// Global instance -EmergencyParser emergency_parser; - -#endif // EMERGENCY_PARSER diff --git a/Marlin/emergency_parser.h b/Marlin/emergency_parser.h deleted file mode 100644 index 73981cc38e..0000000000 --- a/Marlin/emergency_parser.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * emergency_parser.h - Intercept special commands directly in the serial stream - */ - -#ifndef _EMERGENCY_PARSER_H_ -#define _EMERGENCY_PARSER_H_ - -// External references -extern volatile bool wait_for_user, wait_for_heatup; -void quickstop_stepper(); - -class EmergencyParser { - -public: - - // Currently looking for: M108, M112, M410 - enum State : char { - EP_RESET, - EP_N, - EP_M, - EP_M1, - EP_M10, - EP_M108, - EP_M11, - EP_M112, - EP_M4, - EP_M41, - EP_M410, - EP_IGNORE // to '\n' - }; - - static bool killed_by_M112; - static State state; - - EmergencyParser() {} - - __attribute__((always_inline)) inline - static void update(const uint8_t c) { - - switch (state) { - case EP_RESET: - switch (c) { - case ' ': break; - case 'N': state = EP_N; break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_N: - switch (c) { - case '0': case '1': case '2': - case '3': case '4': case '5': - case '6': case '7': case '8': - case '9': case '-': case ' ': break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_M: - switch (c) { - case ' ': break; - case '1': state = EP_M1; break; - case '4': state = EP_M4; break; - default: state = EP_IGNORE; - } - break; - - case EP_M1: - switch (c) { - case '0': state = EP_M10; break; - case '1': state = EP_M11; break; - default: state = EP_IGNORE; - } - break; - - case EP_M10: - state = (c == '8') ? EP_M108 : EP_IGNORE; - break; - - case EP_M11: - state = (c == '2') ? EP_M112 : EP_IGNORE; - break; - - case EP_M4: - state = (c == '1') ? EP_M41 : EP_IGNORE; - break; - - case EP_M41: - state = (c == '0') ? EP_M410 : EP_IGNORE; - break; - - case EP_IGNORE: - if (c == '\n') state = EP_RESET; - break; - - default: - if (c == '\n') { - switch (state) { - case EP_M108: - wait_for_user = wait_for_heatup = false; - break; - case EP_M112: - killed_by_M112 = true; - break; - case EP_M410: - quickstop_stepper(); - break; - default: - break; - } - state = EP_RESET; - } - } - } - -}; - -extern EmergencyParser emergency_parser; - -#endif // _EMERGENCY_PARSER_H_ diff --git a/Marlin/endstop_interrupts.h b/Marlin/endstop_interrupts.h deleted file mode 100644 index 62c2ea8532..0000000000 --- a/Marlin/endstop_interrupts.h +++ /dev/null @@ -1,239 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate either an - * 'external interrupt' or a 'pin change interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#ifndef _ENDSTOP_INTERRUPTS_H_ -#define _ENDSTOP_INTERRUPTS_H_ - -#include "macros.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } - -/** - * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) - * - * These macros for the Arduino MEGA do not include the two connected pins on Port J (D13, D14). - * So we extend them here because these are the normal pins for Y_MIN and Y_MAX on RAMPS. - * There are more PCI-enabled processor pins on Port J, but they are not connected to Arduino MEGA. - */ -#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA) - #undef digitalPinToPCICR - #define digitalPinToPCICR(p) ( WITHIN(p, 10, 15) || \ - WITHIN(p, 50, 53) || \ - WITHIN(p, 62, 69) ? &PCICR : (uint8_t*)0 ) - #undef digitalPinToPCICRbit - #define digitalPinToPCICRbit(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \ - WITHIN(p, 14, 15) ? 1 : \ - WITHIN(p, 62, 69) ? 2 : \ - 0 ) - #undef digitalPinToPCMSK - #define digitalPinToPCMSK(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? &PCMSK0 : \ - WITHIN(p, 14, 15) ? &PCMSK1 : \ - WITHIN(p, 62, 69) ? &PCMSK2 : \ - (uint8_t *)0 ) - #undef digitalPinToPCMSKbit - #define digitalPinToPCMSKbit(p) ( WITHIN(p, 10, 13) ? ((p) - 6) : \ - (p) == 14 || (p) == 51 ? 2 : \ - (p) == 15 || (p) == 52 ? 1 : \ - (p) == 50 ? 3 : \ - (p) == 53 ? 0 : \ - WITHIN(p, 62, 69) ? ((p) - 62) : \ - 0 ) -#endif - - -// Install Pin change interrupt for a pin. Can be called multiple times. -void pciSetup(const int8_t pin) { - SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin - SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt - SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group -} - - -// Handlers for pin change interrupts -#ifdef PCINT0_vect - ISR(PCINT0_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT1_vect - ISR(PCINT1_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT2_vect - ISR(PCINT2_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT3_vect - ISR(PCINT3_vect) { endstop_ISR(); } -#endif - -void setup_endstop_interrupts( void ) { - - #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 - #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) != NULL, "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error - pciSetup(X_MAX_PIN); // assign it - #endif - #endif - - #if HAS_X_MIN - #if digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "Z2_MIN_PIN is not interrupt-capable"); - pciSetup(Z2_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); - #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) != NULL, "Z_MIN_PROBE_PIN is not interrupt-capable"); - pciSetup(Z_MIN_PROBE_PIN); - #endif - #endif - - // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI. -} - -#endif // _ENDSTOP_INTERRUPTS_H_ diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp deleted file mode 100644 index 9cca5f8839..0000000000 --- a/Marlin/endstops.cpp +++ /dev/null @@ -1,753 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * endstops.cpp - A singleton object to manage endstops - */ - -#include "Marlin.h" -#include "cardreader.h" -#include "endstops.h" -#include "temperature.h" -#include "stepper.h" -#include "ultralcd.h" - -#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - #include "endstop_interrupts.h" -#endif - -Endstops endstops; - -// public: - -bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() -volatile uint8_t Endstops::hit_state; - -Endstops::esbits_t Endstops::live_state = 0; - -#if ENABLED(ENDSTOP_NOISE_FILTER) - Endstops::esbits_t Endstops::validated_live_state; - uint8_t Endstops::endstop_poll_count; -#endif - -#if HAS_BED_PROBE - volatile bool Endstops::z_probe_enabled = false; -#endif - -// Initialized by settings.load() -#if ENABLED(X_DUAL_ENDSTOPS) - float Endstops::x_endstop_adj; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - float Endstops::y_endstop_adj; -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - float Endstops::z_endstop_adj; -#endif - -/** - * Class and Instance Methods - */ - -void Endstops::init() { - - #if HAS_X_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X_MIN_PIN); - #else - SET_INPUT(X_MIN_PIN); - #endif - #endif - - #if HAS_X2_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X2_MIN_PIN); - #else - SET_INPUT(X2_MIN_PIN); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y_MIN_PIN); - #else - SET_INPUT(Y_MIN_PIN); - #endif - #endif - - #if HAS_Y2_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y2_MIN_PIN); - #else - SET_INPUT(Y2_MIN_PIN); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - #if ENABLED(FIX_MOUNTED_PROBE) - SET_INPUT(Z_MIN_PIN); - #else - SET_INPUT_PULLUP(Z_MIN_PIN); - #endif - #else - SET_INPUT(Z_MIN_PIN); - #endif - #endif - - #if HAS_Z2_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - SET_INPUT_PULLUP(Z2_MIN_PIN); - #else - SET_INPUT(Z2_MIN_PIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X_MAX_PIN); - #else - SET_INPUT(X_MAX_PIN); - #endif - #endif - - #if HAS_X2_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X2_MAX_PIN); - #else - SET_INPUT(X2_MAX_PIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y_MAX_PIN); - #else - SET_INPUT(Y_MAX_PIN); - #endif - #endif - - #if HAS_Y2_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y2_MAX_PIN); - #else - SET_INPUT(Y2_MAX_PIN); - #endif - #endif - - #if HAS_Z_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z_MAX_PIN); - #else - SET_INPUT(Z_MAX_PIN); - #endif - #endif - - #if HAS_Z2_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z2_MAX_PIN); - #else - SET_INPUT(Z2_MAX_PIN); - #endif - #endif - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE) - SET_INPUT_PULLUP(Z_MIN_PROBE_PIN); - #else - SET_INPUT(Z_MIN_PROBE_PIN); - #endif - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - setup_endstop_interrupts(); - #endif - - // Enable endstops - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - -} // Endstops::init - -// Called at ~1KHz from Temperature ISR: Poll endstop state if required -void Endstops::poll() { - - #if ENABLED(PINS_DEBUGGING) - run_monitor(); // report changes in endstop status - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && ENABLED(ENDSTOP_NOISE_FILTER) - if (endstop_poll_count) update(); - #elif DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER) - update(); - #endif -} - -void Endstops::enable_globally(const bool onoff) { - enabled_globally = enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Enable / disable endstop checking -void Endstops::enable(const bool onoff) { - enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable -void Endstops::not_homing() { - enabled = enabled_globally; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -#if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - void Endstops::validate_homing_move() { - if (trigger_state()) hit_on_purpose(); - else kill(PSTR(MSG_ERR_HOMING_FAILED)); - } -#endif - -// Enable / disable endstop z-probe checking -#if HAS_BED_PROBE - void Endstops::enable_z_probe(const bool onoff) { - z_probe_enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif - } -#endif - -#if ENABLED(PINS_DEBUGGING) - void Endstops::run_monitor() { - if (!monitor_flag) return; - static uint8_t monitor_count = 16; // offset this check from the others - monitor_count += _BV(1); // 15 Hz - monitor_count &= 0x7F; - if (!monitor_count) monitor(); // report changes in endstop status - } -#endif - -void Endstops::event_handler() { - static uint8_t prev_hit_state; // = 0 - if (hit_state && hit_state != prev_hit_state) { - #if ENABLED(ULTRA_LCD) - char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; - #define _SET_STOP_CHAR(A,C) (chr## A = C) - #else - #define _SET_STOP_CHAR(A,C) ; - #endif - - #define _ENDSTOP_HIT_ECHO(A,C) do{ \ - SERIAL_ECHOPAIR(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); \ - _SET_STOP_CHAR(A,C); }while(0) - - #define _ENDSTOP_HIT_TEST(A,C) \ - if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \ - _ENDSTOP_HIT_ECHO(A,C) - - #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') - #define ENDSTOP_HIT_TEST_Y() _ENDSTOP_HIT_TEST(Y,'Y') - #define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z') - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); - ENDSTOP_HIT_TEST_X(); - ENDSTOP_HIT_TEST_Y(); - ENDSTOP_HIT_TEST_Z(); - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #define P_AXIS Z_AXIS - if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); - #endif - SERIAL_EOL(); - - #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) - if (planner.abort_on_endstop_hit) { - card.sdprinting = false; - card.closefile(); - quickstop_stepper(); - thermalManager.disable_all_heaters(); // switch off all heaters. - } - #endif - } - prev_hit_state = hit_state; -} // Endstops::report_state - -void Endstops::M119() { - SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); - #define ES_REPORT(AXIS) do{ \ - SERIAL_PROTOCOLPGM(MSG_##AXIS); \ - SERIAL_PROTOCOLLN(((READ(AXIS##_PIN)^AXIS##_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); \ - }while(0) - #if HAS_X_MIN - ES_REPORT(X_MIN); - #endif - #if HAS_X2_MIN - ES_REPORT(X2_MIN); - #endif - #if HAS_X_MAX - ES_REPORT(X_MAX); - #endif - #if HAS_X2_MAX - ES_REPORT(X2_MAX); - #endif - #if HAS_Y_MIN - ES_REPORT(Y_MIN); - #endif - #if HAS_Y2_MIN - ES_REPORT(Y2_MIN); - #endif - #if HAS_Y_MAX - ES_REPORT(Y_MAX); - #endif - #if HAS_Y2_MAX - ES_REPORT(Y2_MAX); - #endif - #if HAS_Z_MIN - ES_REPORT(Z_MIN); - #endif - #if HAS_Z2_MIN - ES_REPORT(Z2_MIN); - #endif - #if HAS_Z_MAX - ES_REPORT(Z_MAX); - #endif - #if HAS_Z2_MAX - ES_REPORT(Z2_MAX); - #endif - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - SERIAL_PROTOCOLPGM(MSG_Z_PROBE); - SERIAL_PROTOCOLLN(((READ(Z_MIN_PROBE_PIN)^Z_MIN_PROBE_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); - #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); - SERIAL_PROTOCOLLN(((READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); - #endif -} // Endstops::M119 - -// The following routines are called from an ISR context. It could be the temperature ISR, the -// endstop ISR or the Stepper ISR. - -#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX -#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN -#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING - -// Check endstops - Could be called from Temperature ISR! -void Endstops::update() { - - #if DISABLED(ENDSTOP_NOISE_FILTER) - if (!abort_enabled()) return; - #endif - - #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) - #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - // With Dual X, endstops are only checked in the homing direction for the active extruder - #if ENABLED(DUAL_X_CARRIAGE) - #define E0_ACTIVE stepper.movement_extruder() == 0 - #define X_MIN_TEST ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE)) - #define X_MAX_TEST ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE)) - #else - #define X_MIN_TEST true - #define X_MAX_TEST true - #endif - - // Use HEAD for core axes, AXIS for others - #if CORE_IS_XY || CORE_IS_XZ - #define X_AXIS_HEAD X_HEAD - #else - #define X_AXIS_HEAD X_AXIS - #endif - #if CORE_IS_XY || CORE_IS_YZ - #define Y_AXIS_HEAD Y_HEAD - #else - #define Y_AXIS_HEAD Y_AXIS - #endif - #if CORE_IS_XZ || CORE_IS_YZ - #define Z_AXIS_HEAD Z_HEAD - #else - #define Z_AXIS_HEAD Z_AXIS - #endif - - /** - * Check and update endstops - */ - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MIN); - #if HAS_X2_MIN - UPDATE_ENDSTOP_BIT(X2, MIN); - #else - COPY_LIVE_STATE(X_MIN, X2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MAX); - #if HAS_X2_MAX - UPDATE_ENDSTOP_BIT(X2, MAX); - #else - COPY_LIVE_STATE(X_MAX, X2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MAX); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MIN); - #if HAS_Y2_MIN - UPDATE_ENDSTOP_BIT(Y2, MIN); - #else - COPY_LIVE_STATE(Y_MIN, Y2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MAX); - #if HAS_Y2_MAX - UPDATE_ENDSTOP_BIT(Y2, MAX); - #else - COPY_LIVE_STATE(Y_MAX, Y2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MAX); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MIN); - #if HAS_Z2_MIN - UPDATE_ENDSTOP_BIT(Z2, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z2_MIN); - #endif - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - UPDATE_ENDSTOP_BIT(Z, MIN); - #elif Z_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(Z, MIN); - #endif - #endif - - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - #if HAS_Z_MAX - // Check both Z dual endstops - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MAX); - #if HAS_Z2_MAX - UPDATE_ENDSTOP_BIT(Z2, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z2_MAX); - #endif - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin isn't the bed probe it's the Z endstop - UPDATE_ENDSTOP_BIT(Z, MAX); - #endif - #endif - - #if ENABLED(ENDSTOP_NOISE_FILTER) - /** - * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise, - * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution - * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample - * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes - * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It - * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances - * still exist. The only way to reduce them further is to increase the number of samples. - * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay). - */ - static esbits_t old_live_state; - if (old_live_state != live_state) { - endstop_poll_count = 7; - old_live_state = live_state; - } - else if (endstop_poll_count && !--endstop_poll_count) - validated_live_state = live_state; - - if (!abort_enabled()) return; - - #endif - - // Test the current status of an endstop - #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) - - // Record endstop was hit - #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) - - // Call the endstop triggered routine for single endstops - #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \ - if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ - _ENDSTOP_HIT(AXIS, MINMAX); \ - planner.endstop_triggered(_AXIS(AXIS)); \ - } \ - }while(0) - - // Call the endstop triggered routine for dual endstops - #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \ - const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX)) << 1); \ - if (dual_hit) { \ - _ENDSTOP_HIT(AXIS1, MINMAX); \ - /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.homing_dual_axis || dual_hit == 0b11) \ - planner.endstop_triggered(_AXIS(AXIS1)); \ - } \ - }while(0) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) { - if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { - if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); } - else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); } - else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); } - G38_endstop_hit = true; - } - } - #endif - - // Now, we must signal, after validation, if an endstop limit is pressed or not - if (stepper.axis_is_moving(X_AXIS)) { - if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MIN); - #else - if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN); - #endif - #endif - } - else { // +direction - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MAX); - #else - if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Y_AXIS)) { - if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction - #if HAS_Y_MIN - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); - #else - PROCESS_ENDSTOP(Y, MIN); - #endif - #endif - } - else { // +direction - #if HAS_Y_MAX - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); - #else - PROCESS_ENDSTOP(Y, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Z_AXIS)) { - if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MIN); - #else - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #else - PROCESS_ENDSTOP(Z, MIN); - #endif - #endif - #endif - - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); - #endif - } - else { // Z +direction. Gantry up, bed down. - #if HAS_Z_MAX - #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin is not hijacked for the bed probe - // then it belongs to the Z endstop - PROCESS_ENDSTOP(Z, MAX); - #endif - #endif - } - } -} // Endstops::update() - -#if ENABLED(PINS_DEBUGGING) - - bool Endstops::monitor_flag = false; - - /** - * monitors endstops & Z probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - * - */ - void Endstops::monitor() { - - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - - #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); - #endif - #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); - #endif - #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); - #endif - #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); - #endif - #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); - #endif - #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); - #endif - #if HAS_X2_MIN - if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN); - #endif - #if HAS_X2_MAX - if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX); - #endif - #if HAS_Y2_MIN - if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN); - #endif - #if HAS_Y2_MAX - if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX); - #endif - #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); - #endif - #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - - if (endstop_change) { - #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", TEST(live_state_local, X_MIN)); - #endif - #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", TEST(live_state_local, X_MAX)); - #endif - #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", TEST(live_state_local, Y_MIN)); - #endif - #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", TEST(live_state_local, Y_MAX)); - #endif - #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", TEST(live_state_local, Z_MIN)); - #endif - #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", TEST(live_state_local, Z_MAX)); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", TEST(live_state_local, Z_MIN_PROBE)); - #endif - #if HAS_X2_MIN - if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(live_state_local, X2_MIN)); - #endif - #if HAS_X2_MAX - if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(live_state_local, X2_MAX)); - #endif - #if HAS_Y2_MIN - if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(live_state_local, Y2_MIN)); - #endif - #if HAS_Y2_MAX - if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(live_state_local, Y2_MAX)); - #endif - #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", TEST(live_state_local, Z2_MIN)); - #endif - #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", TEST(live_state_local, Z2_MAX)); - #endif - SERIAL_PROTOCOLPGM("\n\n"); - analogWrite(LED_PIN, local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } - -#endif // PINS_DEBUGGING diff --git a/Marlin/endstops.h b/Marlin/endstops.h deleted file mode 100644 index 2114e23e3a..0000000000 --- a/Marlin/endstops.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * endstops.h - manages endstops - */ - -#ifndef __ENDSTOPS_H__ -#define __ENDSTOPS_H__ - -#include "MarlinConfig.h" - -#define VALIDATE_HOMING_ENDSTOPS - -enum EndstopEnum : char { - X_MIN, - Y_MIN, - Z_MIN, - Z_MIN_PROBE, - X_MAX, - Y_MAX, - Z_MAX, - X2_MIN, - X2_MAX, - Y2_MIN, - Y2_MAX, - Z2_MIN, - Z2_MAX -}; - -class Endstops { - - public: - - static bool enabled, enabled_globally; - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - typedef uint16_t esbits_t; - #if ENABLED(X_DUAL_ENDSTOPS) - static float x_endstop_adj; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static float y_endstop_adj; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static float z_endstop_adj; - #endif - #else - typedef uint8_t esbits_t; - #endif - - private: - static esbits_t live_state; - static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index - - #if ENABLED(ENDSTOP_NOISE_FILTER) - static esbits_t validated_live_state; - static uint8_t endstop_poll_count; // Countdown from threshold for polling - #endif - - public: - Endstops() {}; - - /** - * Initialize the endstop pins - */ - static void init(); - - /** - * Are endstops or the probe set to abort the move? - */ - FORCE_INLINE static bool abort_enabled() { - return (enabled - #if HAS_BED_PROBE - || z_probe_enabled - #endif - ); - } - - /** - * Periodic call to poll endstops if required. Called from temperature ISR - */ - static void poll(); - - /** - * Update endstops bits from the pins. Apply filtering to get a verified state. - * If abort_enabled() and moving towards a triggered switch, abort the current move. - * Called from ISR contexts. - */ - static void update(); - - /** - * Get Endstop hit state. - */ - FORCE_INLINE static uint8_t trigger_state() { return hit_state; } - - /** - * Get current endstops state - */ - FORCE_INLINE static esbits_t state() { - return - #if ENABLED(ENDSTOP_NOISE_FILTER) - validated_live_state - #else - live_state - #endif - ; - } - - /** - * Report endstop hits to serial. Called from loop(). - */ - static void event_handler(); - - /** - * Report endstop positions in response to M119 - */ - static void M119(); - - // Enable / disable endstop checking globally - static void enable_globally(const bool onoff=true); - - // Enable / disable endstop checking - static void enable(const bool onoff=true); - - // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable - static void not_homing(); - - #if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - static void validate_homing_move(); - #else - FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } - #endif - - // Clear endstops (i.e., they were hit intentionally) to suppress the report - FORCE_INLINE static void hit_on_purpose() { hit_state = 0; } - - // Enable / disable endstop z-probe checking - #if HAS_BED_PROBE - static volatile bool z_probe_enabled; - static void enable_z_probe(const bool onoff=true); - #endif - - // Debugging of endstops - #if ENABLED(PINS_DEBUGGING) - static bool monitor_flag; - static void monitor(); - static void run_monitor(); - #endif -}; - -extern Endstops endstops; - -#endif // __ENDSTOPS_H__ diff --git a/Marlin/enum.h b/Marlin/enum.h deleted file mode 100644 index d525e8ee9b..0000000000 --- a/Marlin/enum.h +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __ENUM_H__ -#define __ENUM_H__ - -#include "MarlinConfig.h" - -/** - * Axis indices as enumerated constants - * - * - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space - * - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians - * - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics - */ -enum AxisEnum : unsigned char { - X_AXIS = 0, - A_AXIS = 0, - Y_AXIS = 1, - B_AXIS = 1, - Z_AXIS = 2, - C_AXIS = 2, - E_AXIS = 3, - X_HEAD = 4, - Y_HEAD = 5, - Z_HEAD = 6, - ALL_AXES = 0xFE, - NO_AXIS = 0xFF -}; - -#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. - * - */ - -/** - * Fast I/O Routines for AVR - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -#include - -#ifndef _FASTIO_ARDUINO_H_ -#define _FASTIO_ARDUINO_H_ - -#include - -#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) -#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)) -#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)) -#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)) -#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)) - -/** - * Include Ports and Functions - */ -#if AVR_ATmega328_FAMILY - #include "fastio_168.h" -#elif AVR_ATmega1284_FAMILY - #include "fastio_644.h" -#elif AVR_ATmega2560_FAMILY - #include "fastio_1280.h" -#elif AVR_AT90USB1286_FAMILY - #include "fastio_AT90USB.h" -#elif AVR_ATmega2561_FAMILY - #include "fastio_1281.h" -#else - #error "No FastIO definition for the selected AVR Board." -#endif - -#include "macros.h" - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN) - -#define _WRITE_NC(IO,V) do{ \ - if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ - else CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ -}while(0) - -#define _WRITE_C(IO,V) do{ \ - uint8_t port_bits = DIO ## IO ## _WPORT; /* Get a mask from the current port bits */ \ - if (V) port_bits = ~port_bits; /* For setting bits, invert the mask */ \ - DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \ -}while(0) - -#define _WRITE(IO,V) do{ if (&(DIO ## IO ## _RPORT) < (uint8_t*)0x100) _WRITE_NC(IO,V); else _WRITE_C(IO,V); }while(0) - -#define _TOGGLE(IO) (DIO ## IO ## _RPORT = _BV(DIO ## IO ## _PIN)) - -#define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) - -#define _GET_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_TIMER(IO) DIO ## IO ## _PWM - -#define READ(IO) _READ(IO) -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) - -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) - -#define GET_INPUT(IO) _GET_INPUT(IO) -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) -#define GET_TIMER(IO) _GET_TIMER(IO) - -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -/** - * Timer and Interrupt Control - */ - -// Waveform Generation Modes -enum WaveGenMode : char { - WGM_NORMAL, // 0 - WGM_PWM_PC_8, // 1 - WGM_PWM_PC_9, // 2 - WGM_PWM_PC_10, // 3 - WGM_CTC_OCRnA, // 4 COM OCnx - WGM_FAST_PWM_8, // 5 - WGM_FAST_PWM_9, // 6 - WGM_FAST_PWM_10, // 7 - WGM_PWM_PC_FC_ICRn, // 8 - WGM_PWM_PC_FC_OCRnA, // 9 COM OCnA - WGM_PWM_PC_ICRn, // 10 - WGM_PWM_PC_OCRnA, // 11 COM OCnA - WGM_CTC_ICRn, // 12 COM OCnx - WGM_reserved, // 13 - WGM_FAST_PWM_ICRn, // 14 COM OCnA - WGM_FAST_PWM_OCRnA // 15 COM OCnA -}; - -// Compare Modes -enum CompareMode : char { - COM_NORMAL, // 0 - COM_TOGGLE, // 1 Non-PWM: OCnx ... Both PWM (WGM 9,11,14,15): OCnA only ... else NORMAL - COM_CLEAR_SET, // 2 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down - COM_SET_CLEAR // 3 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down -}; - -// Clock Sources -enum ClockSource : char { - CS_NONE, // 0 - CS_PRESCALER_1, // 1 - CS_PRESCALER_8, // 2 - CS_PRESCALER_64, // 3 - CS_PRESCALER_256, // 4 - CS_PRESCALER_1024, // 5 - CS_EXT_FALLING, // 6 - CS_EXT_RISING // 7 -}; - -// Clock Sources (Timer 2 only) -enum ClockSource2 : char { - CS2_NONE, // 0 - CS2_PRESCALER_1, // 1 - CS2_PRESCALER_8, // 2 - CS2_PRESCALER_32, // 3 - CS2_PRESCALER_64, // 4 - CS2_PRESCALER_128, // 5 - CS2_PRESCALER_256, // 6 - CS2_PRESCALER_1024 // 7 -}; - -// Get interrupt bits in an orderly way -// Ex: cs = GET_CS(0); coma1 = GET_COM(A,1); -#define GET_WGM(T) (((TCCR##T##A >> WGM##T##0) & 0x3) | ((TCCR##T##B >> WGM##T##2 << 2) & 0xC)) -#define GET_CS(T) ((TCCR##T##B >> CS##T##0) & 0x7) -#define GET_COM(T,Q) ((TCCR##T##Q >> COM##T##Q##0) & 0x3) -#define GET_COMA(T) GET_COM(T,A) -#define GET_COMB(T) GET_COM(T,B) -#define GET_COMC(T) GET_COM(T,C) -#define GET_ICNC(T) (!!(TCCR##T##B & _BV(ICNC##T))) -#define GET_ICES(T) (!!(TCCR##T##B & _BV(ICES##T))) -#define GET_FOC(T,Q) (!!(TCCR##T##C & _BV(FOC##T##Q))) -#define GET_FOCA(T) GET_FOC(T,A) -#define GET_FOCB(T) GET_FOC(T,B) -#define GET_FOCC(T) GET_FOC(T,C) - -// Set Wave Generation Mode bits -// Ex: SET_WGM(5,CTC_ICRn); -#define _SET_WGM(T,V) do{ \ - TCCR##T##A = (TCCR##T##A & ~(0x3 << WGM##T##0)) | (( int(V) & 0x3) << WGM##T##0); \ - TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \ - }while(0) -#define SET_WGM(T,V) _SET_WGM(T,WGM_##V) - -// Set Clock Select bits -// Ex: SET_CS3(PRESCALER_64); -#define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0)) -#define _SET_CS0(V) _SET_CS(0,V) -#define _SET_CS1(V) _SET_CS(1,V) -#ifdef TCCR2 - #define _SET_CS2(V) (TCCR2 = (TCCR2 & ~(0x7 << CS20)) | (int(V) << CS20)) -#else - #define _SET_CS2(V) _SET_CS(2,V) -#endif -#define _SET_CS3(V) _SET_CS(3,V) -#define _SET_CS4(V) _SET_CS(4,V) -#define _SET_CS5(V) _SET_CS(5,V) -#define SET_CS0(V) _SET_CS0(CS_##V) -#define SET_CS1(V) _SET_CS1(CS_##V) -#ifdef TCCR2 - #define SET_CS2(V) _SET_CS2(CS2_##V) -#else - #define SET_CS2(V) _SET_CS2(CS_##V) -#endif -#define SET_CS3(V) _SET_CS3(CS_##V) -#define SET_CS4(V) _SET_CS4(CS_##V) -#define SET_CS5(V) _SET_CS5(CS_##V) -#define SET_CS(T,V) SET_CS##T(V) - -// Set Compare Mode bits -// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET); -#define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0)) -#define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V) -#define SET_COMA(T,V) SET_COM(T,A,V) -#define SET_COMB(T,V) SET_COM(T,B,V) -#define SET_COMC(T,V) SET_COM(T,C,V) -#define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0) - -// Set Noise Canceler bit -// Ex: SET_ICNC(2,1) -#define SET_ICNC(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICNC##T) : TCCR##T##B & ~_BV(ICNC##T)) - -// Set Input Capture Edge Select bit -// Ex: SET_ICES(5,0) -#define SET_ICES(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICES##T) : TCCR##T##B & ~_BV(ICES##T)) - -// Set Force Output Compare bit -// Ex: SET_FOC(3,A,1) -#define SET_FOC(T,Q,V) (TCCR##T##C = (V) ? TCCR##T##C | _BV(FOC##T##Q) : TCCR##T##C & ~_BV(FOC##T##Q)) -#define SET_FOCA(T,V) SET_FOC(T,A,V) -#define SET_FOCB(T,V) SET_FOC(T,B,V) -#define SET_FOCC(T,V) SET_FOC(T,C,V) - - -/** - * PWM availability macros - */ - -// Determine which harware PWMs are already in use -#if PIN_EXISTS(CONTROLLER_FAN) - #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) -#else - #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) -#endif - -#if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2) - #if PIN_EXISTS(FAN2) - #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN || p == FAN2_PIN) - #elif PIN_EXISTS(FAN1) - #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN) - #else - #define PWM_CHK_FAN_A(p) (p == FAN_PIN) - #endif -#else - #define PWM_CHK_FAN_A(p) false -#endif - -#if HAS_MOTOR_CURRENT_PWM - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z || p == MOTOR_CURRENT_PWM_XY) - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z) - #else - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E) - #endif -#else - #define PWM_CHK_MOTOR_CURRENT(p) false -#endif - -#ifdef NUM_SERVOS - #if AVR_ATmega2560_FAMILY - #define PWM_CHK_SERVO(p) (p == 5 || (NUM_SERVOS > 12 && p == 6) || (NUM_SERVOS > 24 && p == 46)) // PWMS 3A, 4A & 5A - #elif AVR_ATmega2561_FAMILY - #define PWM_CHK_SERVO(p) (p == 5) // PWM3A - #elif AVR_ATmega1284_FAMILY - #define PWM_CHK_SERVO(p) false - #elif AVR_AT90USB1286_FAMILY - #define PWM_CHK_SERVO(p) (p == 16) // PWM3A - #elif AVR_ATmega328_FAMILY - #define PWM_CHK_SERVO(p) false - #endif -#else - #define PWM_CHK_SERVO(p) false -#endif - -#if ENABLED(BARICUDA) - #if HAS_HEATER_1 && HAS_HEATER_2 - #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN || p == HEATER_2_PIN) - #elif HAS_HEATER_1 - #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN) - #endif -#else - #define PWM_CHK_HEATER(p) false -#endif - -#define PWM_CHK(p) (PWM_CHK_HEATER(p) || PWM_CHK_SERVO(p) || PWM_CHK_MOTOR_CURRENT(p)\ - || PWM_CHK_FAN_A(p) || PWM_CHK_FAN_B(p)) - -// define which hardware PWMs are available for the current CPU -// all timer 1 PWMS deleted from this list because they are never available -#if AVR_ATmega2560_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 10) || p == 13 || p == 44 || p == 45 || p == 46) -#elif AVR_ATmega2561_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 6) || p == 9) -#elif AVR_ATmega1284_FAMILY - #define PWM_PINS(p) (p == 3 || p == 4 || p == 14 || p == 15) -#elif AVR_AT90USB1286_FAMILY - #define PWM_PINS(p) (p == 0 || p == 1 || p == 14 || p == 15 || p == 16 || p == 24) -#elif AVR_ATmega328_FAMILY - #define PWM_PINS(p) (p == 3 || p == 5 || p == 6 || p == 11) -#else - #error "unknown CPU" -#endif - -// finally - the macro that tells us if a pin is an available hardware PWM -#define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p)) - -#endif // _FASTIO_ARDUINO_H_ diff --git a/Marlin/fastio_1280.h b/Marlin/fastio_1280.h deleted file mode 100644 index 09bac1fd11..0000000000 --- a/Marlin/fastio_1280.h +++ /dev/null @@ -1,1115 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 1280 and 2560 - * - * Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100 - * Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx - * 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 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx - */ - -#ifndef _FASTIO_1280 -#define _FASTIO_1280 - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO21 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO52 -#define MISO DIO50 -#define MOSI DIO51 -#define SS DIO53 - -// TWI (I2C) -#define SCL DIO21 -#define SDA DIO20 - -// Timers and PWM -#define OC0A DIO13 -#define OC0B DIO4 -#define OC1A DIO11 -#define OC1B DIO12 -#define OC2A DIO10 -#define OC2B DIO9 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 -#define OC4A DIO6 -#define OC4B DIO7 -#define OC4C DIO8 -#define OC5A DIO46 -#define OC5B DIO45 -#define OC5C DIO44 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM NULL - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM NULL - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINH3 -#define DIO6_RPORT PINH -#define DIO6_WPORT PORTH -#define DIO6_DDR DDRH -#define DIO6_PWM &OCR4AL - -#define DIO7_PIN PINH4 -#define DIO7_RPORT PINH -#define DIO7_WPORT PORTH -#define DIO7_DDR DDRH -#define DIO7_PWM &OCR4BL - -#define DIO8_PIN PINH5 -#define DIO8_RPORT PINH -#define DIO8_WPORT PORTH -#define DIO8_DDR DDRH -#define DIO8_PWM &OCR4CL - -#define DIO9_PIN PINH6 -#define DIO9_RPORT PINH -#define DIO9_WPORT PORTH -#define DIO9_DDR DDRH -#define DIO9_PWM &OCR2B - -#define DIO10_PIN PINB4 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM &OCR2A - -#define DIO11_PIN PINB5 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM NULL - -#define DIO12_PIN PINB6 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINB7 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM &OCR0A - -#define DIO14_PIN PINJ1 -#define DIO14_RPORT PINJ -#define DIO14_WPORT PORTJ -#define DIO14_DDR DDRJ -#define DIO14_PWM NULL - -#define DIO15_PIN PINJ0 -#define DIO15_RPORT PINJ -#define DIO15_WPORT PORTJ -#define DIO15_DDR DDRJ -#define DIO15_PWM NULL - -#define DIO16_PIN PINH1 -#define DIO16_RPORT PINH -#define DIO16_WPORT PORTH -#define DIO16_DDR DDRH -#define DIO16_PWM NULL - -#define DIO17_PIN PINH0 -#define DIO17_RPORT PINH -#define DIO17_WPORT PORTH -#define DIO17_DDR DDRH -#define DIO17_PWM NULL - -#define DIO18_PIN PIND3 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM NULL - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM NULL - -#define DIO20_PIN PIND1 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM NULL - -#define DIO21_PIN PIND0 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM NULL - -#define DIO22_PIN PINA0 -#define DIO22_RPORT PINA -#define DIO22_WPORT PORTA -#define DIO22_DDR DDRA -#define DIO22_PWM NULL - -#define DIO23_PIN PINA1 -#define DIO23_RPORT PINA -#define DIO23_WPORT PORTA -#define DIO23_DDR DDRA -#define DIO23_PWM NULL - -#define DIO24_PIN PINA2 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM NULL - -#define DIO25_PIN PINA3 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM NULL - -#define DIO26_PIN PINA4 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM NULL - -#define DIO27_PIN PINA5 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM NULL - -#define DIO28_PIN PINA6 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM NULL - -#define DIO29_PIN PINA7 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM NULL - -#define DIO30_PIN PINC7 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM NULL - -#define DIO31_PIN PINC6 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM NULL - -#define DIO32_PIN PINC5 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM NULL - -#define DIO33_PIN PINC4 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM NULL - -#define DIO34_PIN PINC3 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM NULL - -#define DIO35_PIN PINC2 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM NULL - -#define DIO36_PIN PINC1 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM NULL - -#define DIO37_PIN PINC0 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM NULL - -#define DIO38_PIN PIND7 -#define DIO38_RPORT PIND -#define DIO38_WPORT PORTD -#define DIO38_DDR DDRD -#define DIO38_PWM NULL - -#define DIO39_PIN PING2 -#define DIO39_RPORT PING -#define DIO39_WPORT PORTG -#define DIO39_DDR DDRG -#define DIO39_PWM NULL - -#define DIO40_PIN PING1 -#define DIO40_RPORT PING -#define DIO40_WPORT PORTG -#define DIO40_DDR DDRG -#define DIO40_PWM NULL - -#define DIO41_PIN PING0 -#define DIO41_RPORT PING -#define DIO41_WPORT PORTG -#define DIO41_DDR DDRG -#define DIO41_PWM NULL - -#define DIO42_PIN PINL7 -#define DIO42_RPORT PINL -#define DIO42_WPORT PORTL -#define DIO42_DDR DDRL -#define DIO42_PWM NULL - -#define DIO43_PIN PINL6 -#define DIO43_RPORT PINL -#define DIO43_WPORT PORTL -#define DIO43_DDR DDRL -#define DIO43_PWM NULL - -#define DIO44_PIN PINL5 -#define DIO44_RPORT PINL -#define DIO44_WPORT PORTL -#define DIO44_DDR DDRL -#define DIO44_PWM &OCR5CL - -#define DIO45_PIN PINL4 -#define DIO45_RPORT PINL -#define DIO45_WPORT PORTL -#define DIO45_DDR DDRL -#define DIO45_PWM &OCR5BL - -#define DIO46_PIN PINL3 -#define DIO46_RPORT PINL -#define DIO46_WPORT PORTL -#define DIO46_DDR DDRL -#define DIO46_PWM &OCR5AL - -#define DIO47_PIN PINL2 -#define DIO47_RPORT PINL -#define DIO47_WPORT PORTL -#define DIO47_DDR DDRL -#define DIO47_PWM NULL - -#define DIO48_PIN PINL1 -#define DIO48_RPORT PINL -#define DIO48_WPORT PORTL -#define DIO48_DDR DDRL -#define DIO48_PWM NULL - -#define DIO49_PIN PINL0 -#define DIO49_RPORT PINL -#define DIO49_WPORT PORTL -#define DIO49_DDR DDRL -#define DIO49_PWM NULL - -#define DIO50_PIN PINB3 -#define DIO50_RPORT PINB -#define DIO50_WPORT PORTB -#define DIO50_DDR DDRB -#define DIO50_PWM NULL - -#define DIO51_PIN PINB2 -#define DIO51_RPORT PINB -#define DIO51_WPORT PORTB -#define DIO51_DDR DDRB -#define DIO51_PWM NULL - -#define DIO52_PIN PINB1 -#define DIO52_RPORT PINB -#define DIO52_WPORT PORTB -#define DIO52_DDR DDRB -#define DIO52_PWM NULL - -#define DIO53_PIN PINB0 -#define DIO53_RPORT PINB -#define DIO53_WPORT PORTB -#define DIO53_DDR DDRB -#define DIO53_PWM NULL - -#define DIO54_PIN PINF0 -#define DIO54_RPORT PINF -#define DIO54_WPORT PORTF -#define DIO54_DDR DDRF -#define DIO54_PWM NULL - -#define DIO55_PIN PINF1 -#define DIO55_RPORT PINF -#define DIO55_WPORT PORTF -#define DIO55_DDR DDRF -#define DIO55_PWM NULL - -#define DIO56_PIN PINF2 -#define DIO56_RPORT PINF -#define DIO56_WPORT PORTF -#define DIO56_DDR DDRF -#define DIO56_PWM NULL - -#define DIO57_PIN PINF3 -#define DIO57_RPORT PINF -#define DIO57_WPORT PORTF -#define DIO57_DDR DDRF -#define DIO57_PWM NULL - -#define DIO58_PIN PINF4 -#define DIO58_RPORT PINF -#define DIO58_WPORT PORTF -#define DIO58_DDR DDRF -#define DIO58_PWM NULL - -#define DIO59_PIN PINF5 -#define DIO59_RPORT PINF -#define DIO59_WPORT PORTF -#define DIO59_DDR DDRF -#define DIO59_PWM NULL - -#define DIO60_PIN PINF6 -#define DIO60_RPORT PINF -#define DIO60_WPORT PORTF -#define DIO60_DDR DDRF -#define DIO60_PWM NULL - -#define DIO61_PIN PINF7 -#define DIO61_RPORT PINF -#define DIO61_WPORT PORTF -#define DIO61_DDR DDRF -#define DIO61_PWM NULL - -#define DIO62_PIN PINK0 -#define DIO62_RPORT PINK -#define DIO62_WPORT PORTK -#define DIO62_DDR DDRK -#define DIO62_PWM NULL - -#define DIO63_PIN PINK1 -#define DIO63_RPORT PINK -#define DIO63_WPORT PORTK -#define DIO63_DDR DDRK -#define DIO63_PWM NULL - -#define DIO64_PIN PINK2 -#define DIO64_RPORT PINK -#define DIO64_WPORT PORTK -#define DIO64_DDR DDRK -#define DIO64_PWM NULL - -#define DIO65_PIN PINK3 -#define DIO65_RPORT PINK -#define DIO65_WPORT PORTK -#define DIO65_DDR DDRK -#define DIO65_PWM NULL - -#define DIO66_PIN PINK4 -#define DIO66_RPORT PINK -#define DIO66_WPORT PORTK -#define DIO66_DDR DDRK -#define DIO66_PWM NULL - -#define DIO67_PIN PINK5 -#define DIO67_RPORT PINK -#define DIO67_WPORT PORTK -#define DIO67_DDR DDRK -#define DIO67_PWM NULL - -#define DIO68_PIN PINK6 -#define DIO68_RPORT PINK -#define DIO68_WPORT PORTK -#define DIO68_DDR DDRK -#define DIO68_PWM NULL - -#define DIO69_PIN PINK7 -#define DIO69_RPORT PINK -#define DIO69_WPORT PORTK -#define DIO69_DDR DDRK -#define DIO69_PWM NULL - -#define DIO70_PIN PING4 -#define DIO70_RPORT PING -#define DIO70_WPORT PORTG -#define DIO70_DDR DDRG -#define DIO70_PWM NULL - -#define DIO71_PIN PING3 -#define DIO71_RPORT PING -#define DIO71_WPORT PORTG -#define DIO71_DDR DDRG -#define DIO71_PWM NULL - -#define DIO72_PIN PINJ2 -#define DIO72_RPORT PINJ -#define DIO72_WPORT PORTJ -#define DIO72_DDR DDRJ -#define DIO72_PWM NULL - -#define DIO73_PIN PINJ3 -#define DIO73_RPORT PINJ -#define DIO73_WPORT PORTJ -#define DIO73_DDR DDRJ -#define DIO73_PWM NULL - -#define DIO74_PIN PINJ7 -#define DIO74_RPORT PINJ -#define DIO74_WPORT PORTJ -#define DIO74_DDR DDRJ -#define DIO74_PWM NULL - -#define DIO75_PIN PINJ4 -#define DIO75_RPORT PINJ -#define DIO75_WPORT PORTJ -#define DIO75_DDR DDRJ -#define DIO75_PWM NULL - -#define DIO76_PIN PINJ5 -#define DIO76_RPORT PINJ -#define DIO76_WPORT PORTJ -#define DIO76_DDR DDRJ -#define DIO76_PWM NULL - -#define DIO77_PIN PINJ6 -#define DIO77_RPORT PINJ -#define DIO77_WPORT PORTJ -#define DIO77_DDR DDRJ -#define DIO77_PWM NULL - -#define DIO78_PIN PINE2 -#define DIO78_RPORT PINE -#define DIO78_WPORT PORTE -#define DIO78_DDR DDRE -#define DIO78_PWM NULL - -#define DIO79_PIN PINE6 -#define DIO79_RPORT PINE -#define DIO79_WPORT PORTE -#define DIO79_DDR DDRE -#define DIO79_PWM NULL - -#define DIO80_PIN PINE7 -#define DIO80_RPORT PINE -#define DIO80_WPORT PORTE -#define DIO80_DDR DDRE -#define DIO80_PWM NULL - -#define DIO81_PIN PIND4 -#define DIO81_RPORT PIND -#define DIO81_WPORT PORTD -#define DIO81_DDR DDRD -#define DIO81_PWM NULL - -#define DIO82_PIN PIND5 -#define DIO82_RPORT PIND -#define DIO82_WPORT PORTD -#define DIO82_DDR DDRD -#define DIO82_PWM NULL - -#define DIO83_PIN PIND6 -#define DIO83_RPORT PIND -#define DIO83_WPORT PORTD -#define DIO83_DDR DDRD -#define DIO83_PWM NULL - -#define DIO84_PIN PINH2 -#define DIO84_RPORT PINH -#define DIO84_WPORT PORTH -#define DIO84_DDR DDRH -#define DIO84_PWM NULL - -#define DIO85_PIN PINH7 -#define DIO85_RPORT PINH -#define DIO85_WPORT PORTH -#define DIO85_DDR DDRH -#define DIO85_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM NULL -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM NULL -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM NULL -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM NULL -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM NULL -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM NULL -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM NULL - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM NULL -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM NULL -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM NULL -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM NULL -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM NULL -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM NULL -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM NULL -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM NULL - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM NULL -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM NULL -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM NULL -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM NULL -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM NULL -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B - -#undef PH0 -#define PH0_PIN PINH0 -#define PH0_RPORT PINH -#define PH0_WPORT PORTH -#define PH0_DDR DDRH -#define PH0_PWM NULL -#undef PH1 -#define PH1_PIN PINH1 -#define PH1_RPORT PINH -#define PH1_WPORT PORTH -#define PH1_DDR DDRH -#define PH1_PWM NULL -#undef PH2 -#define PH2_PIN PINH2 -#define PH2_RPORT PINH -#define PH2_WPORT PORTH -#define PH2_DDR DDRH -#define PH2_PWM NULL -#undef PH3 -#define PH3_PIN PINH3 -#define PH3_RPORT PINH -#define PH3_WPORT PORTH -#define PH3_DDR DDRH -#define PH3_PWM &OCR4AL -#undef PH4 -#define PH4_PIN PINH4 -#define PH4_RPORT PINH -#define PH4_WPORT PORTH -#define PH4_DDR DDRH -#define PH4_PWM &OCR4BL -#undef PH5 -#define PH5_PIN PINH5 -#define PH5_RPORT PINH -#define PH5_WPORT PORTH -#define PH5_DDR DDRH -#define PH5_PWM &OCR4CL -#undef PH6 -#define PH6_PIN PINH6 -#define PH6_RPORT PINH -#define PH6_WPORT PORTH -#define PH6_DDR DDRH -#define PH6_PWM &OCR2B -#undef PH7 -#define PH7_PIN PINH7 -#define PH7_RPORT PINH -#define PH7_WPORT PORTH -#define PH7_DDR DDRH -#define PH7_PWM NULL - -#undef PJ0 -#define PJ0_PIN PINJ0 -#define PJ0_RPORT PINJ -#define PJ0_WPORT PORTJ -#define PJ0_DDR DDRJ -#define PJ0_PWM NULL -#undef PJ1 -#define PJ1_PIN PINJ1 -#define PJ1_RPORT PINJ -#define PJ1_WPORT PORTJ -#define PJ1_DDR DDRJ -#define PJ1_PWM NULL -#undef PJ2 -#define PJ2_PIN PINJ2 -#define PJ2_RPORT PINJ -#define PJ2_WPORT PORTJ -#define PJ2_DDR DDRJ -#define PJ2_PWM NULL -#undef PJ3 -#define PJ3_PIN PINJ3 -#define PJ3_RPORT PINJ -#define PJ3_WPORT PORTJ -#define PJ3_DDR DDRJ -#define PJ3_PWM NULL -#undef PJ4 -#define PJ4_PIN PINJ4 -#define PJ4_RPORT PINJ -#define PJ4_WPORT PORTJ -#define PJ4_DDR DDRJ -#define PJ4_PWM NULL -#undef PJ5 -#define PJ5_PIN PINJ5 -#define PJ5_RPORT PINJ -#define PJ5_WPORT PORTJ -#define PJ5_DDR DDRJ -#define PJ5_PWM NULL -#undef PJ6 -#define PJ6_PIN PINJ6 -#define PJ6_RPORT PINJ -#define PJ6_WPORT PORTJ -#define PJ6_DDR DDRJ -#define PJ6_PWM NULL -#undef PJ7 -#define PJ7_PIN PINJ7 -#define PJ7_RPORT PINJ -#define PJ7_WPORT PORTJ -#define PJ7_DDR DDRJ -#define PJ7_PWM NULL - -#undef PK0 -#define PK0_PIN PINK0 -#define PK0_RPORT PINK -#define PK0_WPORT PORTK -#define PK0_DDR DDRK -#define PK0_PWM NULL -#undef PK1 -#define PK1_PIN PINK1 -#define PK1_RPORT PINK -#define PK1_WPORT PORTK -#define PK1_DDR DDRK -#define PK1_PWM NULL -#undef PK2 -#define PK2_PIN PINK2 -#define PK2_RPORT PINK -#define PK2_WPORT PORTK -#define PK2_DDR DDRK -#define PK2_PWM NULL -#undef PK3 -#define PK3_PIN PINK3 -#define PK3_RPORT PINK -#define PK3_WPORT PORTK -#define PK3_DDR DDRK -#define PK3_PWM NULL -#undef PK4 -#define PK4_PIN PINK4 -#define PK4_RPORT PINK -#define PK4_WPORT PORTK -#define PK4_DDR DDRK -#define PK4_PWM NULL -#undef PK5 -#define PK5_PIN PINK5 -#define PK5_RPORT PINK -#define PK5_WPORT PORTK -#define PK5_DDR DDRK -#define PK5_PWM NULL -#undef PK6 -#define PK6_PIN PINK6 -#define PK6_RPORT PINK -#define PK6_WPORT PORTK -#define PK6_DDR DDRK -#define PK6_PWM NULL -#undef PK7 -#define PK7_PIN PINK7 -#define PK7_RPORT PINK -#define PK7_WPORT PORTK -#define PK7_DDR DDRK -#define PK7_PWM NULL - -#undef PL0 -#define PL0_PIN PINL0 -#define PL0_RPORT PINL -#define PL0_WPORT PORTL -#define PL0_DDR DDRL -#define PL0_PWM NULL -#undef PL1 -#define PL1_PIN PINL1 -#define PL1_RPORT PINL -#define PL1_WPORT PORTL -#define PL1_DDR DDRL -#define PL1_PWM NULL -#undef PL2 -#define PL2_PIN PINL2 -#define PL2_RPORT PINL -#define PL2_WPORT PORTL -#define PL2_DDR DDRL -#define PL2_PWM NULL -#undef PL3 -#define PL3_PIN PINL3 -#define PL3_RPORT PINL -#define PL3_WPORT PORTL -#define PL3_DDR DDRL -#define PL3_PWM &OCR5AL -#undef PL4 -#define PL4_PIN PINL4 -#define PL4_RPORT PINL -#define PL4_WPORT PORTL -#define PL4_DDR DDRL -#define PL4_PWM &OCR5BL -#undef PL5 -#define PL5_PIN PINL5 -#define PL5_RPORT PINL -#define PL5_WPORT PORTL -#define PL5_DDR DDRL -#define PL5_PWM &OCR5CL -#undef PL6 -#define PL6_PIN PINL6 -#define PL6_RPORT PINL -#define PL6_WPORT PORTL -#define PL6_DDR DDRL -#define PL6_PWM NULL -#undef PL7 -#define PL7_PIN PINL7 -#define PL7_RPORT PINL -#define PL7_WPORT PORTL -#define PL7_DDR DDRL -#define PL7_PWM NULL - -#endif // _FASTIO_1280 diff --git a/Marlin/fastio_1281.h b/Marlin/fastio_1281.h deleted file mode 100644 index ab90a5ff9b..0000000000 --- a/Marlin/fastio_1281.h +++ /dev/null @@ -1,719 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 1281 and 2561 - * - * Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04 - * 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 - */ - -#ifndef _FASTIO_1281 -#define _FASTIO_1281 - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO46 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO10 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO16 - -// TWI (I2C) -#define SCL DIO17 -#define SDA DIO18 - -// Timers and PWM -#define OC0A DIO9 -#define OC0B DIO4 -#define OC1A DIO7 -#define OC1B DIO8 -#define OC2A DIO6 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM NULL - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM NULL - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINB4 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM &OCR2AL - -#define DIO7_PIN PINB5 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM &OCR1AL - -#define DIO8_PIN PINB6 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM &OCR1BL - -#define DIO9_PIN PINB7 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM &OCR0AL - -#define DIO10_PIN PINB1 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM NULL - -#define DIO11_PIN PINB2 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM NULL - -#define DIO12_PIN PINB3 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINE2 -#define DIO13_RPORT PINE -#define DIO13_WPORT PORTE -#define DIO13_DDR DDRE -#define DIO13_PWM NULL - -#define DIO14_PIN PINE6 -#define DIO14_RPORT PINE -#define DIO14_WPORT PORTE -#define DIO14_DDR DDRE -#define DIO14_PWM NULL - -#define DIO15_PIN PINE7 -#define DIO15_RPORT PINE -#define DIO15_WPORT PORTE -#define DIO15_DDR DDRE -#define DIO15_PWM NULL - -#define DIO16_PIN PINB0 -#define DIO16_RPORT PINB -#define DIO16_WPORT PORTB -#define DIO16_DDR DDRB -#define DIO16_PWM NULL - -#define DIO17_PIN PIND0 -#define DIO17_RPORT PIND -#define DIO17_WPORT PORTD -#define DIO17_DDR DDRD -#define DIO17_PWM NULL - -#define DIO18_PIN PIND1 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM NULL - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM NULL - -#define DIO20_PIN PIND3 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM NULL - -#define DIO21_PIN PIND4 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM NULL - -#define DIO22_PIN PIND5 -#define DIO22_RPORT PIND -#define DIO22_WPORT PORTD -#define DIO22_DDR DDRD -#define DIO22_PWM NULL - -#define DIO23_PIN PIND6 -#define DIO23_RPORT PIND -#define DIO23_WPORT PORTD -#define DIO23_DDR DDRD -#define DIO23_PWM NULL - -#define DIO24_PIN PIND7 -#define DIO24_RPORT PIND -#define DIO24_WPORT PORTD -#define DIO24_DDR DDRD -#define DIO24_PWM NULL - -#define DIO25_PIN PING0 -#define DIO25_RPORT PING -#define DIO25_WPORT PORTG -#define DIO25_DDR DDRG -#define DIO25_PWM NULL - -#define DIO26_PIN PING1 -#define DIO26_RPORT PING -#define DIO26_WPORT PORTG -#define DIO26_DDR DDRG -#define DIO26_PWM NULL - -#define DIO27_PIN PING2 -#define DIO27_RPORT PING -#define DIO27_WPORT PORTG -#define DIO27_DDR DDRG -#define DIO27_PWM NULL - -#define DIO28_PIN PING3 -#define DIO28_RPORT PING -#define DIO28_WPORT PORTG -#define DIO28_DDR DDRG -#define DIO28_PWM NULL - -#define DIO29_PIN PING4 -#define DIO29_RPORT PING -#define DIO29_WPORT PORTG -#define DIO29_DDR DDRG -#define DIO29_PWM NULL - -#define DIO30_PIN PINC0 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM NULL - -#define DIO31_PIN PINC1 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM NULL - -#define DIO32_PIN PINC2 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM NULL - -#define DIO33_PIN PINC3 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM NULL - -#define DIO34_PIN PINC4 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM NULL - -#define DIO35_PIN PINC5 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM NULL - -#define DIO36_PIN PINC6 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM NULL - -#define DIO37_PIN PINC7 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM NULL - -#define DIO38_PIN PINA0 -#define DIO38_RPORT PINA -#define DIO38_WPORT PORTA -#define DIO38_DDR DDRA -#define DIO38_PWM NULL - -#define DIO39_PIN PINA1 -#define DIO39_RPORT PINA -#define DIO39_WPORT PORTA -#define DIO39_DDR DDRA -#define DIO39_PWM NULL - -#define DIO40_PIN PINA2 -#define DIO40_RPORT PINA -#define DIO40_WPORT PORTA -#define DIO40_DDR DDRA -#define DIO40_PWM NULL - -#define DIO41_PIN PINA3 -#define DIO41_RPORT PINA -#define DIO41_WPORT PORTA -#define DIO41_DDR DDRA -#define DIO41_PWM NULL - -#define DIO42_PIN PINA4 -#define DIO42_RPORT PINA -#define DIO42_WPORT PORTA -#define DIO42_DDR DDRA -#define DIO42_PWM NULL - -#define DIO43_PIN PINA5 -#define DIO43_RPORT PINA -#define DIO43_WPORT PORTA -#define DIO43_DDR DDRA -#define DIO43_PWM NULL - -#define DIO44_PIN PINA6 -#define DIO44_RPORT PINA -#define DIO44_WPORT PORTA -#define DIO44_DDR DDRA -#define DIO44_PWM NULL - -#define DIO45_PIN PINA7 -#define DIO45_RPORT PINA -#define DIO45_WPORT PORTA -#define DIO45_DDR DDRA -#define DIO45_PWM NULL - -#define DIO46_PIN PINF0 -#define DIO46_RPORT PINF -#define DIO46_WPORT PORTF -#define DIO46_DDR DDRF -#define DIO46_PWM NULL - -#define DIO47_PIN PINF1 -#define DIO47_RPORT PINF -#define DIO47_WPORT PORTF -#define DIO47_DDR DDRF -#define DIO47_PWM NULL - -#define DIO48_PIN PINF2 -#define DIO48_RPORT PINF -#define DIO48_WPORT PORTF -#define DIO48_DDR DDRF -#define DIO48_PWM NULL - -#define DIO49_PIN PINF3 -#define DIO49_RPORT PINF -#define DIO49_WPORT PORTF -#define DIO49_DDR DDRF -#define DIO49_PWM NULL - -#define DIO50_PIN PINF4 -#define DIO50_RPORT PINF -#define DIO50_WPORT PORTF -#define DIO50_DDR DDRF -#define DIO50_PWM NULL - -#define DIO51_PIN PINF5 -#define DIO51_RPORT PINF -#define DIO51_WPORT PORTF -#define DIO51_DDR DDRF -#define DIO51_PWM NULL - -#define DIO52_PIN PINF6 -#define DIO52_RPORT PINF -#define DIO52_WPORT PORTF -#define DIO52_DDR DDRF -#define DIO52_PWM NULL - -#define DIO53_PIN PINF7 -#define DIO53_RPORT PINF -#define DIO53_WPORT PORTF -#define DIO53_DDR DDRF -#define DIO53_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM NULL -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM NULL -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM NULL -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM NULL -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM NULL -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM NULL -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM NULL - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM NULL -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM NULL -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM NULL -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM NULL -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM NULL -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM NULL -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM NULL -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM NULL - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM NULL -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM NULL -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM NULL -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM NULL -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM NULL -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B - -#endif // _FASTIO_1281 diff --git a/Marlin/fastio_168.h b/Marlin/fastio_168.h deleted file mode 100644 index e624654287..0000000000 --- a/Marlin/fastio_168.h +++ /dev/null @@ -1,361 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 168, 328, and 328P - * - * Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07 - * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 - */ - -#ifndef _FASTIO_168 -#define _FASTIO_168 - -#include "fastio.h" - -#define DEBUG_LED AIO5 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO13 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO10 - -// TWI (I2C) -#define SCL AIO5 -#define SDA AIO4 - -// Timers and PWM -#define OC0A DIO6 -#define OC0B DIO5 -#define OC1A DIO9 -#define OC1B DIO10 -#define OC2A DIO11 -#define OC2B DIO3 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_DDR DDRD -#define DIO0_PWM NULL - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_DDR DDRD -#define DIO1_PWM NULL - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_DDR DDRD -#define DIO2_PWM NULL - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_DDR DDRD -#define DIO3_PWM &OCR2B - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_DDR DDRD -#define DIO4_PWM NULL - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_DDR DDRD -#define DIO5_PWM &OCR0B - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_DDR DDRD -#define DIO6_PWM &OCR0A - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_DDR DDRD -#define DIO7_PWM NULL - -#define DIO8_PIN PINB0 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM NULL - -#define DIO9_PIN PINB1 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM NULL - -#define DIO10_PIN PINB2 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM NULL - -#define DIO11_PIN PINB3 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM &OCR2A - -#define DIO12_PIN PINB4 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINB5 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM NULL - -#define DIO14_PIN PINC0 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_DDR DDRC -#define DIO14_PWM NULL - -#define DIO15_PIN PINC1 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_DDR DDRC -#define DIO15_PWM NULL - -#define DIO16_PIN PINC2 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM NULL - -#define DIO17_PIN PINC3 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM NULL - -#define DIO18_PIN PINC4 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM NULL - -#define DIO19_PIN PINC5 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM NULL - -#define DIO20_PIN PINC6 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM NULL - -#define DIO21_PIN PINC7 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM &OCR2A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM NULL - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM NULL - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM &OCR2B - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM &OCR0B - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM &OCR0A - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#endif // _FASTIO_168 diff --git a/Marlin/fastio_644.h b/Marlin/fastio_644.h deleted file mode 100644 index 6a6e977f9e..0000000000 --- a/Marlin/fastio_644.h +++ /dev/null @@ -1,556 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 644, 644p, 644pa, and 1284p - * - * 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 - * Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0 - */ - -/** ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - */ - -#ifndef _FASTIO_644 -#define _FASTIO_644 - -#include "fastio.h" - -#define DEBUG_LED DIO0 - -// UART -#define RXD DIO8 -#define TXD DIO9 -#define RXD0 DIO8 -#define TXD0 DIO9 - -#define RXD1 DIO10 -#define TXD1 DIO11 - -// SPI -#define SCK DIO7 -#define MISO DIO6 -#define MOSI DIO5 -#define SS DIO4 - -// TWI (I2C) -#define SCL DIO16 -#define SDA DIO17 - -// Timers and PWM -#define OC0A DIO3 -#define OC0B DIO4 -#define OC1A DIO13 -#define OC1B DIO12 -#define OC2A DIO15 -#define OC2B DIO14 - -// Digital I/O - -#define DIO0_PIN PINB0 -#define DIO0_RPORT PINB -#define DIO0_WPORT PORTB -#define DIO0_DDR DDRB -#define DIO0_PWM NULL - -#define DIO1_PIN PINB1 -#define DIO1_RPORT PINB -#define DIO1_WPORT PORTB -#define DIO1_DDR DDRB -#define DIO1_PWM NULL - -#define DIO2_PIN PINB2 -#define DIO2_RPORT PINB -#define DIO2_WPORT PORTB -#define DIO2_DDR DDRB -#define DIO2_PWM NULL - -#define DIO3_PIN PINB3 -#define DIO3_RPORT PINB -#define DIO3_WPORT PORTB -#define DIO3_DDR DDRB -#define DIO3_PWM OCR0A - -#define DIO4_PIN PINB4 -#define DIO4_RPORT PINB -#define DIO4_WPORT PORTB -#define DIO4_DDR DDRB -#define DIO4_PWM OCR0B - -#define DIO5_PIN PINB5 -#define DIO5_RPORT PINB -#define DIO5_WPORT PORTB -#define DIO5_DDR DDRB -#define DIO5_PWM NULL - -#define DIO6_PIN PINB6 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM NULL - -#define DIO7_PIN PINB7 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM NULL - -#define DIO8_PIN PIND0 -#define DIO8_RPORT PIND -#define DIO8_WPORT PORTD -#define DIO8_DDR DDRD -#define DIO8_PWM NULL - -#define DIO9_PIN PIND1 -#define DIO9_RPORT PIND -#define DIO9_WPORT PORTD -#define DIO9_DDR DDRD -#define DIO9_PWM NULL - -#define DIO10_PIN PIND2 -#define DIO10_RPORT PIND -#define DIO10_WPORT PORTD -#define DIO10_DDR DDRD -#define DIO10_PWM NULL - -#define DIO11_PIN PIND3 -#define DIO11_RPORT PIND -#define DIO11_WPORT PORTD -#define DIO11_DDR DDRD -#define DIO11_PWM NULL - -#define DIO12_PIN PIND4 -#define DIO12_RPORT PIND -#define DIO12_WPORT PORTD -#define DIO12_DDR DDRD -#define DIO12_PWM OCR1B - -#define DIO13_PIN PIND5 -#define DIO13_RPORT PIND -#define DIO13_WPORT PORTD -#define DIO13_DDR DDRD -#define DIO13_PWM OCR1A - -#define DIO14_PIN PIND6 -#define DIO14_RPORT PIND -#define DIO14_WPORT PORTD -#define DIO14_DDR DDRD -#define DIO14_PWM OCR2B - -#define DIO15_PIN PIND7 -#define DIO15_RPORT PIND -#define DIO15_WPORT PORTD -#define DIO15_DDR DDRD -#define DIO15_PWM OCR2A - -#define DIO16_PIN PINC0 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM NULL - -#define DIO17_PIN PINC1 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM NULL - -#define DIO18_PIN PINC2 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM NULL - -#define DIO19_PIN PINC3 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM NULL - -#define DIO20_PIN PINC4 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM NULL - -#define DIO21_PIN PINC5 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM NULL - -#define DIO22_PIN PINC6 -#define DIO22_RPORT PINC -#define DIO22_WPORT PORTC -#define DIO22_DDR DDRC -#define DIO22_PWM NULL - -#define DIO23_PIN PINC7 -#define DIO23_RPORT PINC -#define DIO23_WPORT PORTC -#define DIO23_DDR DDRC -#define DIO23_PWM NULL - -#define DIO24_PIN PINA7 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM NULL - -#define DIO25_PIN PINA6 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM NULL - -#define DIO26_PIN PINA5 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM NULL - -#define DIO27_PIN PINA4 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM NULL - -#define DIO28_PIN PINA3 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM NULL - -#define DIO29_PIN PINA2 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM NULL - -#define DIO30_PIN PINA1 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_DDR DDRA -#define DIO30_PWM NULL - -#define DIO31_PIN PINA0 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_DDR DDRA -#define DIO31_PWM NULL - -#define AIO0_PIN PINA0 -#define AIO0_RPORT PINA -#define AIO0_WPORT PORTA -#define AIO0_DDR DDRA -#define AIO0_PWM NULL - -#define AIO1_PIN PINA1 -#define AIO1_RPORT PINA -#define AIO1_WPORT PORTA -#define AIO1_DDR DDRA -#define AIO1_PWM NULL - -#define AIO2_PIN PINA2 -#define AIO2_RPORT PINA -#define AIO2_WPORT PORTA -#define AIO2_DDR DDRA -#define AIO2_PWM NULL - -#define AIO3_PIN PINA3 -#define AIO3_RPORT PINA -#define AIO3_WPORT PORTA -#define AIO3_DDR DDRA -#define AIO3_PWM NULL - -#define AIO4_PIN PINA4 -#define AIO4_RPORT PINA -#define AIO4_WPORT PORTA -#define AIO4_DDR DDRA -#define AIO4_PWM NULL - -#define AIO5_PIN PINA5 -#define AIO5_RPORT PINA -#define AIO5_WPORT PORTA -#define AIO5_DDR DDRA -#define AIO5_PWM NULL - -#define AIO6_PIN PINA6 -#define AIO6_RPORT PINA -#define AIO6_WPORT PORTA -#define AIO6_DDR DDRA -#define AIO6_PWM NULL - -#define AIO7_PIN PINA7 -#define AIO7_RPORT PINA -#define AIO7_WPORT PORTA -#define AIO7_DDR DDRA -#define AIO7_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL - -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL - -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL - -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL - -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL - -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL - -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL - -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM OCR0A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM OCR0B - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM NULL - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM OCR2B - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM OCR2A - -#endif // _FASTIO_644 diff --git a/Marlin/fastio_AT90USB.h b/Marlin/fastio_AT90USB.h deleted file mode 100644 index aee9ddcddb..0000000000 --- a/Marlin/fastio_AT90USB.h +++ /dev/null @@ -1,701 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping (Teensy) for AT90USB646, 647, 1286, and 1287 - * - * Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 - * 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 - * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 - */ - -#ifndef _FASTIO_AT90USB -#define _FASTIO_AT90USB - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO31 /* led D5 red */ - -// SPI -#define SCK DIO21 // 9 -#define MISO DIO23 // 11 -#define MOSI DIO22 // 10 -#define SS DIO20 // 8 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_PWM NULL -#define DIO0_DDR DDRD - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_PWM NULL -#define DIO1_DDR DDRD - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_PWM NULL -#define DIO2_DDR DDRD - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_PWM NULL -#define DIO3_DDR DDRD - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_PWM NULL -#define DIO4_DDR DDRD - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_PWM NULL -#define DIO5_DDR DDRD - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_PWM NULL -#define DIO6_DDR DDRD - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_PWM NULL -#define DIO7_DDR DDRD - -#define DIO8_PIN PINE0 -#define DIO8_RPORT PINE -#define DIO8_WPORT PORTE -#define DIO8_PWM NULL -#define DIO8_DDR DDRE - -#define DIO9_PIN PINE1 -#define DIO9_RPORT PINE -#define DIO9_WPORT PORTE -#define DIO9_PWM NULL -#define DIO9_DDR DDRE - -#define DIO10_PIN PINC0 -#define DIO10_RPORT PINC -#define DIO10_WPORT PORTC -#define DIO10_PWM NULL -#define DIO10_DDR DDRC - -#define DIO11_PIN PINC1 -#define DIO11_RPORT PINC -#define DIO11_WPORT PORTC -#define DIO11_PWM NULL -#define DIO11_DDR DDRC - -#define DIO12_PIN PINC2 -#define DIO12_RPORT PINC -#define DIO12_WPORT PORTC -#define DIO12_PWM NULL -#define DIO12_DDR DDRC - -#define DIO13_PIN PINC3 -#define DIO13_RPORT PINC -#define DIO13_WPORT PORTC -#define DIO13_PWM NULL -#define DIO13_DDR DDRC - -#define DIO14_PIN PINC4 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_PWM NULL -#define DIO14_DDR DDRC - -#define DIO15_PIN PINC5 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_PWM NULL -#define DIO15_DDR DDRC - -#define DIO16_PIN PINC6 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_PWM NULL -#define DIO16_DDR DDRC - -#define DIO17_PIN PINC7 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_PWM NULL -#define DIO17_DDR DDRC - -#define DIO18_PIN PINE6 -#define DIO18_RPORT PINE -#define DIO18_WPORT PORTE -#define DIO18_PWM NULL -#define DIO18_DDR DDRE - -#define DIO19_PIN PINE7 -#define DIO19_RPORT PINE -#define DIO19_WPORT PORTE -#define DIO19_PWM NULL -#define DIO19_DDR DDRE - -#define DIO20_PIN PINB0 -#define DIO20_RPORT PINB -#define DIO20_WPORT PORTB -#define DIO20_PWM NULL -#define DIO20_DDR DDRB - -#define DIO21_PIN PINB1 -#define DIO21_RPORT PINB -#define DIO21_WPORT PORTB -#define DIO21_PWM NULL -#define DIO21_DDR DDRB - -#define DIO22_PIN PINB2 -#define DIO22_RPORT PINB -#define DIO22_WPORT PORTB -#define DIO22_PWM NULL -#define DIO22_DDR DDRB - -#define DIO23_PIN PINB3 -#define DIO23_RPORT PINB -#define DIO23_WPORT PORTB -#define DIO23_PWM NULL -#define DIO23_DDR DDRB - -#define DIO24_PIN PINB4 -#define DIO24_RPORT PINB -#define DIO24_WPORT PORTB -#define DIO24_PWM NULL -#define DIO24_DDR DDRB - -#define DIO25_PIN PINB5 -#define DIO25_RPORT PINB -#define DIO25_WPORT PORTB -#define DIO25_PWM NULL -#define DIO25_DDR DDRB - -#define DIO26_PIN PINB6 -#define DIO26_RPORT PINB -#define DIO26_WPORT PORTB -#define DIO26_PWM NULL -#define DIO26_DDR DDRB - -#define DIO27_PIN PINB7 -#define DIO27_RPORT PINB -#define DIO27_WPORT PORTB -#define DIO27_PWM NULL -#define DIO27_DDR DDRB - -#define DIO28_PIN PINA0 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_PWM NULL -#define DIO28_DDR DDRA - -#define DIO29_PIN PINA1 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_PWM NULL -#define DIO29_DDR DDRA - -#define DIO30_PIN PINA2 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_PWM NULL -#define DIO30_DDR DDRA - -#define DIO31_PIN PINA3 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_PWM NULL -#define DIO31_DDR DDRA - -#define DIO32_PIN PINA4 -#define DIO32_RPORT PINA -#define DIO32_WPORT PORTA -#define DIO32_PWM NULL -#define DIO32_DDR DDRA - -#define DIO33_PIN PINA5 -#define DIO33_RPORT PINA -#define DIO33_WPORT PORTA -#define DIO33_PWM NULL -#define DIO33_DDR DDRA - -#define DIO34_PIN PINA6 -#define DIO34_RPORT PINA -#define DIO34_WPORT PORTA -#define DIO34_PWM NULL -#define DIO34_DDR DDRA - -#define DIO35_PIN PINA7 -#define DIO35_RPORT PINA -#define DIO35_WPORT PORTA -#define DIO35_PWM NULL -#define DIO35_DDR DDRA - -#define DIO36_PIN PINE4 -#define DIO36_RPORT PINE -#define DIO36_WPORT PORTE -#define DIO36_PWM NULL -#define DIO36_DDR DDRE - -#define DIO37_PIN PINE5 -#define DIO37_RPORT PINE -#define DIO37_WPORT PORTE -#define DIO37_PWM NULL -#define DIO37_DDR DDRE - -#define DIO38_PIN PINF0 -#define DIO38_RPORT PINF -#define DIO38_WPORT PORTF -#define DIO38_PWM NULL -#define DIO38_DDR DDRF - -#define DIO39_PIN PINF1 -#define DIO39_RPORT PINF -#define DIO39_WPORT PORTF -#define DIO39_PWM NULL -#define DIO39_DDR DDRF - -#define DIO40_PIN PINF2 -#define DIO40_RPORT PINF -#define DIO40_WPORT PORTF -#define DIO40_PWM NULL -#define DIO40_DDR DDRF - -#define DIO41_PIN PINF3 -#define DIO41_RPORT PINF -#define DIO41_WPORT PORTF -#define DIO41_PWM NULL -#define DIO41_DDR DDRF - -#define DIO42_PIN PINF4 -#define DIO42_RPORT PINF -#define DIO42_WPORT PORTF -#define DIO42_PWM NULL -#define DIO42_DDR DDRF - -#define DIO43_PIN PINF5 -#define DIO43_RPORT PINF -#define DIO43_WPORT PORTF -#define DIO43_PWM NULL -#define DIO43_DDR DDRF - -#define DIO44_PIN PINF6 -#define DIO44_RPORT PINF -#define DIO44_WPORT PORTF -#define DIO44_PWM NULL -#define DIO44_DDR DDRF - -#define DIO45_PIN PINF7 -#define DIO45_RPORT PINF -#define DIO45_WPORT PORTF -#define DIO45_PWM NULL -#define DIO45_DDR DDRF - -#define AIO0_PIN PINF0 -#define AIO0_RPORT PINF -#define AIO0_WPORT PORTF -#define AIO0_PWM NULL -#define AIO0_DDR DDRF - -#define AIO1_PIN PINF1 -#define AIO1_RPORT PINF -#define AIO1_WPORT PORTF -#define AIO1_PWM NULL -#define AIO1_DDR DDRF - -#define AIO2_PIN PINF2 -#define AIO2_RPORT PINF -#define AIO2_WPORT PORTF -#define AIO2_PWM NULL -#define AIO2_DDR DDRF - -#define AIO3_PIN PINF3 -#define AIO3_RPORT PINF -#define AIO3_WPORT PORTF -#define AIO3_PWM NULL -#define AIO3_DDR DDRF - -#define AIO4_PIN PINF4 -#define AIO4_RPORT PINF -#define AIO4_WPORT PORTF -#define AIO4_PWM NULL -#define AIO4_DDR DDRF - -#define AIO5_PIN PINF5 -#define AIO5_RPORT PINF -#define AIO5_WPORT PORTF -#define AIO5_PWM NULL -#define AIO5_DDR DDRF - -#define AIO6_PIN PINF6 -#define AIO6_RPORT PINF -#define AIO6_WPORT PORTF -#define AIO6_PWM NULL -#define AIO6_DDR DDRF - -#define AIO7_PIN PINF7 -#define AIO7_RPORT PINF -#define AIO7_WPORT PORTF -#define AIO7_PWM NULL -#define AIO7_DDR DDRF - -//-- Begin not supported by Teensyduino -//-- don't use Arduino functions on these pins pinMode/digitalWrite/etc -#define DIO46_PIN PINE2 -#define DIO46_RPORT PINE -#define DIO46_WPORT PORTE -#define DIO46_PWM NULL -#define DIO46_DDR DDRE - -#define DIO47_PIN PINE3 -#define DIO47_RPORT PINE -#define DIO47_WPORT PORTE -#define DIO47_PWM NULL -#define DIO47_DDR DDRE - -#define TEENSY_E2 46 -#define TEENSY_E3 47 - -//-- end not supported by Teensyduino - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_PWM NULL -#define PA0_DDR DDRA -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_PWM NULL -#define PA1_DDR DDRA -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_PWM NULL -#define PA2_DDR DDRA -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_PWM NULL -#define PA3_DDR DDRA -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_PWM NULL -#define PA4_DDR DDRA -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_PWM NULL -#define PA5_DDR DDRA -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_PWM NULL -#define PA6_DDR DDRA -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_PWM NULL -#define PA7_DDR DDRA - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_PWM NULL -#define PB0_DDR DDRB -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_PWM NULL -#define PB1_DDR DDRB -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_PWM NULL -#define PB2_DDR DDRB -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_PWM NULL -#define PB3_DDR DDRB -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_PWM NULL -#define PB4_DDR DDRB -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_PWM NULL -#define PB5_DDR DDRB -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_PWM NULL -#define PB6_DDR DDRB -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_PWM NULL -#define PB7_DDR DDRB - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_PWM NULL -#define PC0_DDR DDRC -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_PWM NULL -#define PC1_DDR DDRC -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_PWM NULL -#define PC2_DDR DDRC -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_PWM NULL -#define PC3_DDR DDRC -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_PWM NULL -#define PC4_DDR DDRC -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_PWM NULL -#define PC5_DDR DDRC -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_PWM NULL -#define PC6_DDR DDRC -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_PWM NULL -#define PC7_DDR DDRC - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_PWM NULL -#define PD0_DDR DDRD -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_PWM NULL -#define PD1_DDR DDRD -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_PWM NULL -#define PD2_DDR DDRD -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_PWM NULL -#define PD3_DDR DDRD -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_PWM NULL -#define PD4_DDR DDRD -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_PWM NULL -#define PD5_DDR DDRD -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_PWM NULL -#define PD6_DDR DDRD -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_PWM NULL -#define PD7_DDR DDRD - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_PWM NULL -#define PE0_DDR DDRE -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_PWM NULL -#define PE1_DDR DDRE -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_PWM NULL -#define PE2_DDR DDRE -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_PWM NULL -#define PE3_DDR DDRE -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_PWM NULL -#define PE4_DDR DDRE -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_PWM NULL -#define PE5_DDR DDRE -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_PWM NULL -#define PE6_DDR DDRE -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_PWM NULL -#define PE7_DDR DDRE - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_PWM NULL -#define PF0_DDR DDRF -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_PWM NULL -#define PF1_DDR DDRF -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_PWM NULL -#define PF2_DDR DDRF -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_PWM NULL -#define PF3_DDR DDRF -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_PWM NULL -#define PF4_DDR DDRF -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_PWM NULL -#define PF5_DDR DDRF -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_PWM NULL -#define PF6_DDR DDRF -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_PWM NULL -#define PF7_DDR DDRF - - -/** - * some of the pin mapping functions of the Teensduino extension to the Arduino IDE - * do not function the same as the other Arduino extensions - */ - -//digitalPinToTimer(pin) function works like Arduino but Timers are not defined -#define TIMER0B 1 -#define TIMER1A 7 -#define TIMER1B 8 -#define TIMER1C 9 -#define TIMER2A 6 -#define TIMER2B 2 -#define TIMER3A 5 -#define TIMER3B 4 -#define TIMER3C 3 - -#endif // _FASTIO_AT90USB diff --git a/Marlin/fwretract.cpp b/Marlin/fwretract.cpp deleted file mode 100644 index 997e49a7f9..0000000000 --- a/Marlin/fwretract.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * fwretract.cpp - Implement firmware-based retraction - */ - -#include "MarlinConfig.h" - -#if ENABLED(FWRETRACT) - -#include "fwretract.h" -#include "Marlin.h" -#include "planner.h" -#include "stepper.h" - -FWRetract fwretract; // Single instance - this calls the constructor - -// private: - -#if EXTRUDERS > 1 - bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted -#endif - -// public: - -bool FWRetract::autoretract_enabled, // M209 S - Autoretract switch - FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted -float FWRetract::retract_length, // M207 S - G10 Retract length - FWRetract::retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - FWRetract::retract_zlift, // M207 Z - G10 Retract hop size - FWRetract::retract_recover_length, // M208 S - G11 Recover length - FWRetract::retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate - FWRetract::swap_retract_length, // M207 W - G10 Swap Retract length - FWRetract::swap_retract_recover_length, // M208 W - G11 Swap Recover length - FWRetract::swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate - FWRetract::hop_amount; - -void FWRetract::reset() { - autoretract_enabled = false; - retract_length = RETRACT_LENGTH; - retract_feedrate_mm_s = RETRACT_FEEDRATE; - retract_zlift = RETRACT_ZLIFT; - retract_recover_length = RETRACT_RECOVER_LENGTH; - retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; - swap_retract_length = RETRACT_LENGTH_SWAP; - swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP; - swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; - hop_amount = 0.0; - - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - retracted[i] = false; - #if EXTRUDERS > 1 - retracted_swap[i] = false; - #endif - } -} - -/** - * Retract or recover according to firmware settings - * - * This function handles retract/recover moves for G10 and G11, - * plus auto-retract moves sent from G0/G1 when E-only moves are done. - * - * To simplify the logic, doubled retract/recover moves are ignored. - * - * Note: Z lift is done transparently to the planner. Aborting - * a print between G10 and G11 may corrupt the Z position. - * - * Note: Auto-retract will apply the set Z hop in addition to any Z hop - * included in the G-code. Use M207 Z0 to to prevent double hop. - */ -void FWRetract::retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping /* =false */ - #endif -) { - - static float hop_amount = 0.0; // Total amount lifted, for use in recover - - // Prevent two retracts or recovers in a row - if (retracted[active_extruder] == retracting) return; - - // Prevent two swap-retract or recovers in a row - #if EXTRUDERS > 1 - // Allow G10 S1 only after G10 - if (swapping && retracted_swap[active_extruder] == retracting) return; - // G11 priority to recover the long retract if activated - if (!retracting) swapping = retracted_swap[active_extruder]; - #else - constexpr bool swapping = false; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR("retracting ", retracting); - SERIAL_ECHOLNPAIR("swapping ", swapping); - SERIAL_ECHOLNPAIR("active extruder ", active_extruder); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOPAIR("retracted[", i); - SERIAL_ECHOLNPAIR("] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOPAIR("retracted_swap[", i); - SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); - SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); - //*/ - - const float old_feedrate_mm_s = feedrate_mm_s, - renormalize = RECIPROCAL(planner.e_factor[active_extruder]), - base_retract = swapping ? swap_retract_length : retract_length, - old_z = current_position[Z_AXIS], - old_e = current_position[E_AXIS]; - - // The current position will be the destination for E and Z moves - set_destination_from_current(); - - if (retracting) { - // Retract by moving from a faux E position back to the current E position - feedrate_mm_s = retract_feedrate_mm_s; - destination[E_AXIS] -= base_retract * renormalize; - prepare_move_to_destination(); // set_current_to_destination - - // Is a Z hop set, and has the hop not yet been done? - if (retract_zlift > 0.01 && !hop_amount) { // Apply hop only once - hop_amount += retract_zlift; // Add to the hop total (again, only once) - destination[Z_AXIS] += retract_zlift; // Raise Z by the zlift (M207 Z) amount - feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Maximum Z feedrate - prepare_move_to_destination(); // Raise up, set_current_to_destination - } - } - else { - // If a hop was done and Z hasn't changed, undo the Z hop - if (hop_amount) { - current_position[Z_AXIS] += hop_amount; // Restore the actual Z position - SYNC_PLAN_POSITION_KINEMATIC(); // Unspoof the position planner - feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max - prepare_move_to_destination(); // Lower Z, set_current_to_destination - hop_amount = 0.0; // Clear the hop amount - } - - destination[E_AXIS] += (base_retract + (swapping ? swap_retract_recover_length : retract_recover_length)) * renormalize; - feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s; - prepare_move_to_destination(); // Recover E, set_current_to_destination - } - - feedrate_mm_s = old_feedrate_mm_s; // Restore original feedrate - current_position[Z_AXIS] = old_z; // Restore Z and E positions - current_position[E_AXIS] = old_e; - SYNC_PLAN_POSITION_KINEMATIC(); // As if the move never took place - - retracted[active_extruder] = retracting; // Active extruder now retracted / recovered - - // If swap retract/recover update the retracted_swap flag too - #if EXTRUDERS > 1 - if (swapping) retracted_swap[active_extruder] = retracting; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR("retracting ", retracting); - SERIAL_ECHOLNPAIR("swapping ", swapping); - SERIAL_ECHOLNPAIR("active_extruder ", active_extruder); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOPAIR("retracted[", i); - SERIAL_ECHOLNPAIR("] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOPAIR("retracted_swap[", i); - SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); - SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); - //*/ - -} - -#endif // FWRETRACT diff --git a/Marlin/fwretract.h b/Marlin/fwretract.h deleted file mode 100644 index d72f193eb4..0000000000 --- a/Marlin/fwretract.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * fwretract.h - Define firmware-based retraction interface - */ - -#ifndef FWRETRACT_H -#define FWRETRACT_H - -#include "MarlinConfig.h" - -class FWRetract { -public: - static bool autoretract_enabled, // M209 S - Autoretract switch - retracted[EXTRUDERS]; // Which extruders are currently retracted - #if EXTRUDERS > 1 - static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted - #endif - static float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zlift, // M207 Z - G10 Retract hop size - retract_recover_length, // 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_length, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate - hop_amount; - - FWRetract() { reset(); } - - static void reset(); - - static void refresh_autoretract() { - for (uint8_t i = 0; i < EXTRUDERS; i++) retracted[i] = false; - } - - static void enable_autoretract(const bool enable) { - autoretract_enabled = enable; - refresh_autoretract(); - } - - static void retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping = false - #endif - ); -}; - -extern FWRetract fwretract; - -#endif // FWRETRACT_H diff --git a/Marlin/hex_print_routines.cpp b/Marlin/hex_print_routines.cpp deleted file mode 100644 index e99a01afe4..0000000000 --- a/Marlin/hex_print_routines.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" -#include "parser.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER) - -#include "Marlin.h" -#include "hex_print_routines.h" - -static char _hex[7] = "0x0000"; - -char* hex_byte(const uint8_t b) { - _hex[4] = hex_nybble(b >> 4); - _hex[5] = hex_nybble(b); - return &_hex[4]; -} - -char* hex_word(const uint16_t w) { - _hex[2] = hex_nybble(w >> 12); - _hex[3] = hex_nybble(w >> 8); - _hex[4] = hex_nybble(w >> 4); - _hex[5] = hex_nybble(w); - return &_hex[2]; -} - -char* hex_address(const void * const w) { - (void)hex_word((uint16_t)w); - return _hex; -} - -void print_hex_nybble(const uint8_t n) { SERIAL_CHAR(hex_nybble(n)); } -void print_hex_byte(const uint8_t b) { SERIAL_ECHO(hex_byte(b)); } -void print_hex_word(const uint16_t w) { SERIAL_ECHO(hex_word(w)); } -void print_hex_address(const void * const w) { SERIAL_ECHO(hex_address(w)); } - -#endif // AUTO_BED_LEVELING_UBL || M100_FREE_MEMORY_WATCHER || DEBUG_GCODE_PARSER diff --git a/Marlin/hex_print_routines.h b/Marlin/hex_print_routines.h deleted file mode 100644 index 05f1e79914..0000000000 --- a/Marlin/hex_print_routines.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef HEX_PRINT_ROUTINES_H -#define HEX_PRINT_ROUTINES_H - -#include - -// -// Utility functions to create and print hex strings as nybble, byte, and word. -// - -inline char hex_nybble(const uint8_t n) { - return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10); -} -char* hex_byte(const uint8_t b); -char* hex_word(const uint16_t w); -char* hex_address(const void * const w); - -void print_hex_nybble(const uint8_t n); -void print_hex_byte(const uint8_t b); -void print_hex_word(const uint16_t w); -void print_hex_address(const void * const w); - -#endif // HEX_PRINT_ROUTINES_H diff --git a/Marlin/language.h b/Marlin/language.h deleted file mode 100644 index f16c7242ae..0000000000 --- a/Marlin/language.h +++ /dev/null @@ -1,334 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef LANGUAGE_H -#define LANGUAGE_H - -#include "MarlinConfig.h" - -#define _UxGT(a) a - -// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h -//#define SIMULATE_ROMFONT - -// Fallback if no language is set. DON'T CHANGE -#ifndef LCD_LANGUAGE - #define LCD_LANGUAGE en -#endif - -// For character-based LCD controllers (DISPLAY_CHARSET_HD44780) -#define JAPANESE 1 -#define WESTERN 2 -#define CYRILLIC 3 - -// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES -// -// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" -// ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS -// See also http://marlinfw.org/docs/development/lcd_language.html - -// Languages -// an Aragonese -// bg Bulgarian -// ca Catalan -// cn Chinese -// cz Czech -// cz_utf8 Czech (UTF8) -// de German -// el Greek -// el-gr Greek (Greece) -// en English -// es Spanish -// es_utf8 Spanish (UTF8) -// eu Basque-Euskera -// fi Finnish -// fr French -// fr_utf8 French (UTF8) -// gl Galician -// hr Croatian -// it Italian -// kana Japanese -// kana_utf8 Japanese (UTF8) -// nl Dutch -// pl Polish -// pt Portuguese -// pt-br Portuguese (Brazilian) -// pt-br_utf8 Portuguese (Brazilian) (UTF8) -// pt_utf8 Portuguese (UTF8) -// ru Russian -// sk Slovak (UTF8) -// tr Turkish -// uk Ukrainian -// zh_CN Chinese (Simplified) -// zh_TW Chinese (Taiwan) - -#ifdef DEFAULT_SOURCE_CODE_URL - #undef SOURCE_CODE_URL - #define SOURCE_CODE_URL DEFAULT_SOURCE_CODE_URL -#endif - -#ifdef CUSTOM_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MACHINE_NAME -#else - #ifdef DEFAULT_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME DEFAULT_MACHINE_NAME - #endif -#endif - -#ifndef MACHINE_UUID - #define MACHINE_UUID DEFAULT_MACHINE_UUID -#endif - -#ifdef DEFAULT_WEBSITE_URL - #undef WEBSITE_URL - #define WEBSITE_URL DEFAULT_WEBSITE_URL -#endif - -// Common LCD messages - - /* nothing here yet */ - -// Common serial messages -#define MSG_MARLIN "Marlin" - -// Serial Console Messages (do not translate those!) - -#define MSG_ENQUEUEING "enqueueing \"" -#define MSG_POWERUP "PowerUp" -#define MSG_EXTERNAL_RESET " External Reset" -#define MSG_BROWNOUT_RESET " Brown out Reset" -#define MSG_WATCHDOG_RESET " Watchdog Reset" -#define MSG_SOFTWARE_RESET " Software Reset" -#define MSG_AUTHOR " | Author: " -#define MSG_CONFIGURATION_VER " Last Updated: " -#define MSG_FREE_MEMORY " Free Memory: " -#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " -#define MSG_OK "ok" -#define MSG_WAIT "wait" -#define MSG_STATS "Stats: " -#define MSG_FILE_SAVED "Done saving file." -#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " -#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " -#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " -#define MSG_FILE_PRINTED "Done printing file" -#define MSG_BEGIN_FILE_LIST "Begin file list" -#define MSG_END_FILE_LIST "End file list" -#define MSG_INVALID_EXTRUDER "Invalid extruder" -#define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID -#define MSG_COUNT_X " Count X:" -#define MSG_COUNT_A " Count A:" -#define MSG_ERR_KILLED "Printer halted. kill() called!" -#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" -#define MSG_BUSY_PROCESSING "busy: processing" -#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user" -#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input" -#define MSG_Z_MOVE_COMP "Z_move_comp" -#define MSG_RESEND "Resend: " -#define MSG_UNKNOWN_COMMAND "Unknown command: \"" -#define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min: " -#define MSG_X_MAX "x_max: " -#define MSG_X2_MIN "x2_min: " -#define MSG_X2_MAX "x2_max: " -#define MSG_Y_MIN "y_min: " -#define MSG_Y_MAX "y_max: " -#define MSG_Y2_MIN "y2_min: " -#define MSG_Y2_MAX "y2_max: " -#define MSG_Z_MIN "z_min: " -#define MSG_Z_MAX "z_max: " -#define MSG_Z2_MIN "z2_min: " -#define MSG_Z2_MAX "z2_max: " -#define MSG_Z_PROBE "z_probe: " -#define MSG_PROBE_Z_OFFSET "Probe Z Offset" -#define MSG_SKEW_MIN "min_skew_factor: " -#define MSG_SKEW_MAX "max_skew_factor: " -#define MSG_FILAMENT_RUNOUT_SENSOR "filament: " -#define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" -#define MSG_ERR_M355_NONE "No case light" -#define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage" -#define MSG_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" -#define MSG_ERR_MESH_XY "Mesh point cannot be resolved" -#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters" -#define MSG_ERR_PROTECTED_PIN "Protected Pin" -#define MSG_ERR_M420_FAILED "Failed to enable Bed Leveling" -#define MSG_ERR_M428_TOO_FAR "Too far from reference point" -#define MSG_ERR_M303_DISABLED "PIDTEMP disabled" -#define MSG_M119_REPORT "Reporting endstop status" -#define MSG_ENDSTOP_HIT "TRIGGERED" -#define MSG_ENDSTOP_OPEN "open" -#define MSG_HOTEND_OFFSET "Hotend offsets:" -#define MSG_DUPLICATION_MODE "Duplication mode: " -#define MSG_SOFT_ENDSTOPS "Soft endstops: " -#define MSG_SOFT_MIN " Min: " -#define MSG_SOFT_MAX " Max: " - -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define MSG_SD_INIT_FAIL "SD init fail" -#define MSG_SD_VOL_INIT_FAIL "volume.init failed" -#define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" -#define MSG_SD_WORKDIR_FAIL "workDir open failed" -#define MSG_SD_OPEN_FILE_FAIL "open failed, File: " -#define MSG_SD_FILE_OPENED "File opened: " -#define MSG_SD_SIZE " Size: " -#define MSG_SD_FILE_SELECTED "File selected" -#define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" -#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_ERR_READ "SD read error" -#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " - -#define MSG_STEPPER_TOO_HIGH "Steprate too high: " -#define MSG_ENDSTOPS_HIT "endstops hit: " -#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" -#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_HOTEND_TOO_COLD "Hotend too cold" - -#define MSG_FILAMENT_CHANGE_HEAT "Press button (or M108) to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT "Insert filament and press button (or M108)" -#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" -#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" - -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -#define MSG_STOP_BLTOUCH "STOP called because of BLTouch error - restart with M999" -#define MSG_STOP_UNHOMED "STOP called because of unhomed error - restart with M999" -#define MSG_KILL_INACTIVE_TIME "KILL caused by too much inactive time - current command: " -#define MSG_KILL_BUTTON "KILL caused by KILL button/pin" - -// temperature.cpp strings -#define MSG_PID_AUTOTUNE "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" -#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" -#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" -#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" -#define MSG_BIAS " bias: " -#define MSG_D " d: " -#define MSG_T_MIN " min: " -#define MSG_T_MAX " max: " -#define MSG_KU " Ku: " -#define MSG_TU " Tu: " -#define MSG_CLASSIC_PID " Classic PID " -#define MSG_KP " Kp: " -#define MSG_KI " Ki: " -#define MSG_KD " Kd: " -#define MSG_AT " @:" -#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" -#define MSG_PID_DEBUG " PID_DEBUG " -#define MSG_PID_DEBUG_INPUT ": Input " -#define MSG_PID_DEBUG_OUTPUT " Output " -#define MSG_PID_DEBUG_PTERM " pTerm " -#define MSG_PID_DEBUG_ITERM " iTerm " -#define MSG_PID_DEBUG_DTERM " dTerm " -#define MSG_PID_DEBUG_CTERM " cTerm " -#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" - -#define MSG_HEATER_BED "bed" -#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: " -#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" -#define MSG_T_HEATING_FAILED "Heating failed" -#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" -#define MSG_T_MAXTEMP "MAXTEMP triggered" -#define MSG_T_MINTEMP "MINTEMP triggered" - -// Debug -#define MSG_DEBUG_PREFIX "DEBUG:" -#define MSG_DEBUG_OFF "off" -#define MSG_DEBUG_ECHO "ECHO" -#define MSG_DEBUG_INFO "INFO" -#define MSG_DEBUG_ERRORS "ERRORS" -#define MSG_DEBUG_DRYRUN "DRYRUN" -#define MSG_DEBUG_COMMUNICATION "COMMUNICATION" -#define MSG_DEBUG_LEVELING "LEVELING" - -// LCD Menu Messages - -#define LANGUAGE_INCL_(M) STRINGIFY_(language_##M.h) -#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) -#define INCLUDE_LANGUAGE LANGUAGE_INCL(LCD_LANGUAGE) - -// Never translate these strings -#define MSG_X "X" -#define MSG_Y "Y" -#define MSG_Z "Z" -#define MSG_E "E" -#if IS_KINEMATIC - #define MSG_A "A" - #define MSG_B "B" - #define MSG_C "C" -#else - #define MSG_A "X" - #define MSG_B "Y" - #define MSG_C "Z" -#endif -#define MSG_H1 "1" -#define MSG_H2 "2" -#define MSG_H3 "3" -#define MSG_H4 "4" -#define MSG_H5 "5" -#define MSG_N1 " 1" -#define MSG_N2 " 2" -#define MSG_N3 " 3" -#define MSG_N4 " 4" -#define MSG_N5 " 5" -#define MSG_E1 "E1" -#define MSG_E2 "E2" -#define MSG_E3 "E3" -#define MSG_E4 "E4" -#define MSG_E5 "E5" -#define MSG_MOVE_E1 "1" -#define MSG_MOVE_E2 "2" -#define MSG_MOVE_E3 "3" -#define MSG_MOVE_E4 "4" -#define MSG_MOVE_E5 "5" -#define MSG_DIAM_E1 " 1" -#define MSG_DIAM_E2 " 2" -#define MSG_DIAM_E3 " 3" -#define MSG_DIAM_E4 " 4" -#define MSG_DIAM_E5 " 5" - -#include INCLUDE_LANGUAGE - -#if DISABLED(SIMULATE_ROMFONT) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_1) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_5) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CN) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_TR) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_PL) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CZ) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_SK) - #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#endif - -#include "language_en.h" - -#endif // __LANGUAGE_H diff --git a/Marlin/language_an.h b/Marlin/language_an.h deleted file mode 100644 index 679ed1cf3f..0000000000 --- a/Marlin/language_an.h +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Aragonese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_AN_H -#define LANGUAGE_AN_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" parada.") -#define MSG_SD_INSERTED _UxGT("Tarcheta mesa") -#define MSG_SD_REMOVED _UxGT("Tarcheta sacada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu prencipal") -#define MSG_AUTOSTART _UxGT("Inicio automatico") -#define MSG_DISABLE_STEPPERS _UxGT("Amortar motors") -#define MSG_AUTO_HOME _UxGT("Levar a l'orichen") -#define MSG_AUTO_HOME_X _UxGT("Orichen X") -#define MSG_AUTO_HOME_Y _UxGT("Orichen Y") -#define MSG_AUTO_HOME_Z _UxGT("Orichen Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Orichen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Encetar (pretar)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Vinient punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelacion feita!") -#define MSG_SET_HOME_OFFSETS _UxGT("Achustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicau") -#define MSG_SET_ORIGIN _UxGT("Establir orichen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Base") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Base") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Enchegar Fuent") -#define MSG_SWITCH_PS_OFF _UxGT("Amortar Fuent") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover Eixes") -#define MSG_BED_LEVELING _UxGT("Nivelar base") -#define MSG_LEVEL_BED _UxGT("Nivelar base") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidat") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Base") -#define MSG_FAN_SPEED _UxGT("Ixoriador") -#define MSG_FLOW _UxGT("Fluxo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("On") -#define MSG_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("Trigar") -#define MSG_ACC _UxGT("Aceleracion") -#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("Vel. viache min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Trangos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A trangos/mm") - #define MSG_BSTEPS _UxGT("B trangos/mm") - #define MSG_CSTEPS _UxGT("C trangos/mm") -#else - #define MSG_ASTEPS _UxGT("X trangos/mm") - #define MSG_BSTEPS _UxGT("Y trangos/mm") - #define MSG_CSTEPS _UxGT("Z trangos/mm") -#endif -#define MSG_ESTEPS _UxGT("E trangos/mm") -#define MSG_E1STEPS _UxGT("E1 trangos/mm") -#define MSG_E2STEPS _UxGT("E2 trangos/mm") -#define MSG_E3STEPS _UxGT("E3 trangos/mm") -#define MSG_E4STEPS _UxGT("E4 trangos/mm") -#define MSG_E5STEPS _UxGT("E5 trangos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Alzar memoria") -#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") -#define MSG_REFRESH _UxGT("Tornar a cargar") -#define MSG_WATCH _UxGT("Informacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Achustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresion") -#define MSG_RESUME_PRINT _UxGT("Contin. impresion") -#define MSG_STOP_PRINT _UxGT("Detener Impresion") -#define MSG_CARD_MENU _UxGT("Menu de SD") -#define MSG_NO_CARD _UxGT("No i hai tarcheta") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Aguardand ordines") -#define MSG_PRINT_ABORTED _UxGT("Impres. cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Aturada d'emerch.") -#define MSG_STOPPED _UxGT("Aturada.") -#define MSG_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Devantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet F") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambear filamento") -#define MSG_INIT_SDCARD _UxGT("Encetan. tarcheta") -#define MSG_CNG_SDCARD _UxGT("Cambiar tarcheta") -#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_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_ENDSTOP_ABORT _UxGT("Cancelado - Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error: en calentar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Error: temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Error de temperatura") -#define MSG_ERR_MAXTEMP _UxGT("Error: Temp Maxima") -#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_HALTED _UxGT("IMPRESORA ATURADA") -#define MSG_PLEASE_RESET _UxGT("Per favor reinic.") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Calentando...") -#define MSG_BED_HEATING _UxGT("Calentando base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_INFO_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_PRINTER_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. Controlador") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baudios") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresion") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total d'imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresion mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total d'extrusion") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impresions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusion") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura menima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura maxima") -#define MSG_INFO_PSU _UxGT("Fuente de aliment") - -#define MSG_DRIVE_STRENGTH _UxGT("Fuerza d'o driver") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escri. DAC EEPROM") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguardand iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y prete lo boton") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambear") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pa continar...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o fil. cambear") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Aguardando a") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("expulsar filament") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Aguardando a") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("cargar filamento") -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Aguardando impre.") -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pa continar") - -#endif // LANGUAGE_AN_H diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h deleted file mode 100644 index 5920bac25f..0000000000 --- a/Marlin/language_bg.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Bulgarian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_BG_H -#define LANGUAGE_BG_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" Готов.") -#define MSG_SD_INSERTED _UxGT("Картата е поставена") -#define MSG_SD_REMOVED _UxGT("Картата е извадена") -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Изкл. двигатели") -#define MSG_AUTO_HOME _UxGT("Паркиране") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровка Z") -#define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") -#define MSG_SET_ORIGIN _UxGT("Изходна точка") -#define MSG_PREHEAT_1 _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_N _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Подгр. PLA Всички") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Подгр. PLA Легло") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Настройки PLA") -#define MSG_PREHEAT_2 _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_N _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Подгр. ABS Всички") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Подгр. ABS Легло") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Настройки ABS") -#define MSG_COOLDOWN _UxGT("Охлаждане") -#define MSG_SWITCH_PS_ON _UxGT("Вкл. захранване") -#define MSG_SWITCH_PS_OFF _UxGT("Изкл. захранване") -#define MSG_EXTRUDE _UxGT("Екструзия") -#define MSG_RETRACT _UxGT("Откат") -#define MSG_MOVE_AXIS _UxGT("Движение по ос") -#define MSG_BED_LEVELING _UxGT("Нивелиране") -#define MSG_LEVEL_BED _UxGT("Нивелиране") -#define MSG_MOVE_X _UxGT("Движение по X") -#define MSG_MOVE_Y _UxGT("Движение по Y") -#define MSG_MOVE_Z _UxGT("Движение по Z") -#define MSG_MOVE_E _UxGT("Екструдер") -#define MSG_MOVE_01MM _UxGT("Премести с 0.1mm") -#define MSG_MOVE_1MM _UxGT("Премести с 1mm") -#define MSG_MOVE_10MM _UxGT("Премести с 10mm") -#define MSG_SPEED _UxGT("Скорост") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE LCD_STR_THERMOMETER _UxGT(" Дюза") -#define MSG_BED LCD_STR_THERMOMETER _UxGT(" Легло") -#define MSG_FAN_SPEED _UxGT("Вентилатор") -#define MSG_FLOW _UxGT("Поток") -#define MSG_CONTROL _UxGT("Управление") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Минимум") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Максимум") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Фактор") -#define MSG_AUTOTEMP _UxGT("Авто-темп.") -#define MSG_ON _UxGT("Вкл. ") -#define MSG_OFF _UxGT("Изкл. ") -#define MSG_A_RETRACT _UxGT("A-откат") -#define MSG_A_TRAVEL _UxGT("A-travel") -#define MSG_STEPS_PER_MM _UxGT("Стъпки/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aстъпки/mm") - #define MSG_BSTEPS _UxGT("Bстъпки/mm") - #define MSG_CSTEPS _UxGT("Cстъпки/mm") -#else - #define MSG_ASTEPS _UxGT("Xстъпки/mm") - #define MSG_BSTEPS _UxGT("Yстъпки/mm") - #define MSG_CSTEPS _UxGT("Zстъпки/mm") -#endif -#define MSG_ESTEPS _UxGT("E стъпки/mm") -#define MSG_E1STEPS _UxGT("E1 стъпки/mm") -#define MSG_E2STEPS _UxGT("E2 стъпки/mm") -#define MSG_E3STEPS _UxGT("E3 стъпки/mm") -#define MSG_E4STEPS _UxGT("E4 стъпки/mm") -#define MSG_E5STEPS _UxGT("E5 стъпки/mm") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Нишка") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Диам. нишка") -#define MSG_CONTRAST _UxGT("LCD контраст") -#define MSG_STORE_EEPROM _UxGT("Запази в EPROM") -#define MSG_LOAD_EEPROM _UxGT("Зареди от EPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Фабрични настройки") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT("Обнови") -#define MSG_WATCH _UxGT("Преглед") -#define MSG_PREPARE _UxGT("Действия") -#define MSG_TUNE _UxGT("Настройка") -#define MSG_PAUSE_PRINT _UxGT("Пауза") -#define MSG_RESUME_PRINT _UxGT("Възобнови печата") -#define MSG_STOP_PRINT _UxGT("Спри печата") -#define MSG_CARD_MENU _UxGT("Меню карта") -#define MSG_NO_CARD _UxGT("Няма карта") -#define MSG_DWELL _UxGT("Почивка...") -#define MSG_USERWAIT _UxGT("Изчакване") -#define MSG_PRINT_ABORTED _UxGT("Печатът е прекъснат") -#define MSG_NO_MOVE _UxGT("Няма движение") -#define MSG_KILLED _UxGT("УБИТО.") -#define MSG_STOPPED _UxGT("СПРЯНО.") -#define MSG_CONTROL_RETRACT _UxGT("Откат mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Смяна Откат mm") -#define MSG_CONTROL_RETRACTF _UxGT("Откат V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Скок mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Възврат mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Смяна Възврат mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Възврат V") -#define MSG_AUTORETRACT _UxGT("Автоoткат") -#define MSG_FILAMENTCHANGE _UxGT("Смяна нишка") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD-Карта") -#define MSG_CNG_SDCARD _UxGT("Смяна SD-Карта") -#define MSG_ZPROBE_OUT _UxGT("Z-сондата е извадена") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Отстояние") -#define MSG_BABYSTEP_X _UxGT("Министъпка X") -#define MSG_BABYSTEP_Y _UxGT("Министъпка Y") -#define MSG_BABYSTEP_Z _UxGT("Министъпка Z") -#define MSG_ENDSTOP_ABORT _UxGT("Стоп Кр.Изключватели") -#define MSG_DELTA_CALIBRATE _UxGT("Делта Калибровка") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калибровка X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калибровка Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калибровка Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калибровка Център") - -#endif // LANGUAGE_BG_H diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h deleted file mode 100644 index 8c8af7c308..0000000000 --- a/Marlin/language_ca.h +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Catalan - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_CA_H -#define LANGUAGE_CA_H - -#define MAPPER_C2C3 // because of "ó" -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" preparada.") -#define MSG_SD_INSERTED _UxGT("Targeta detectada.") -#define MSG_SD_REMOVED _UxGT("Targeta extreta.") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") -#define MSG_MAIN _UxGT("Menú principal") -#define MSG_AUTOSTART _UxGT("Inici automatic") -#define MSG_DISABLE_STEPPERS _UxGT("Desactiva motors") -#define MSG_DEBUG_MENU _UxGT("Menu de depuracio") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra progres") -#define MSG_AUTO_HOME _UxGT("Ves a l'origen") -#define MSG_AUTO_HOME_X _UxGT("X a origen") -#define MSG_AUTO_HOME_Y _UxGT("Y a origen") -#define MSG_AUTO_HOME_Z _UxGT("Z a origen") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Premeu per iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Següent punt") -#define MSG_LEVEL_BED_DONE _UxGT("Anivellament fet!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajusta decalatge") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalatge aplicat") -#define MSG_SET_ORIGIN _UxGT("Estableix origen") -#define MSG_PREHEAT_1 _UxGT("Preescalfa PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Llit") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf.") -#define MSG_PREHEAT_2 _UxGT("Preescalfa ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Llit") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf.") -#define MSG_COOLDOWN _UxGT("Refreda") -#define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#define MSG_EXTRUDE _UxGT("Extrudeix") -#define MSG_RETRACT _UxGT("Retreu") -#define MSG_MOVE_AXIS _UxGT("Mou eixos") -#define MSG_BED_LEVELING _UxGT("Anivella llit") -#define MSG_LEVEL_BED _UxGT("Anivella llit") -#define MSG_MOVING _UxGT("Movent..") -#define MSG_FREE_XY _UxGT("XY lliures") -#define MSG_MOVE_X _UxGT("Mou X") -#define MSG_MOVE_Y _UxGT("Mou Y") -#define MSG_MOVE_Z _UxGT("Mou Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mou 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mou 1mm") -#define MSG_MOVE_10MM _UxGT("Mou 10mm") -#define MSG_SPEED _UxGT("Velocitat") -#define MSG_BED_Z _UxGT("Llit Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Llit") -#define MSG_FAN_SPEED _UxGT("Vel. Ventilador") -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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("Select") -#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("VViatge min") -#define MSG_AMAX _UxGT("Accel. max ") -#define MSG_A_RETRACT _UxGT("Accel. retracc") -#define MSG_A_TRAVEL _UxGT("Accel. Viatge") -#define MSG_STEPS_PER_MM _UxGT("Passos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassos/mm") - #define MSG_BSTEPS _UxGT("Bpassos/mm") - #define MSG_CSTEPS _UxGT("Cpassos/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassos/mm") - #define MSG_BSTEPS _UxGT("Ypassos/mm") - #define MSG_CSTEPS _UxGT("Zpassos/mm") -#endif -#define MSG_ESTEPS _UxGT("Epassos/mm") -#define MSG_E1STEPS _UxGT("E1passos/mm") -#define MSG_E2STEPS _UxGT("E2passos/mm") -#define MSG_E3STEPS _UxGT("E3passos/mm") -#define MSG_E4STEPS _UxGT("E4passos/mm") -#define MSG_E5STEPS _UxGT("E5passos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Moviment") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_CONTRAST _UxGT("Contrast de LCD") -#define MSG_STORE_EEPROM _UxGT("Desa memoria") -#define MSG_LOAD_EEPROM _UxGT("Carrega memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaura valors") -#define MSG_REFRESH _UxGT("Actualitza") -#define MSG_WATCH _UxGT("Pantalla Info.") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Ajusta") -#define MSG_PAUSE_PRINT _UxGT("Pausa impressio") -#define MSG_RESUME_PRINT _UxGT("Repren impressio") -#define MSG_STOP_PRINT _UxGT("Atura impressio.") -#define MSG_CARD_MENU _UxGT("Imprimeix de SD") -#define MSG_NO_CARD _UxGT("No hi ha targeta") -#define MSG_DWELL _UxGT("En repos...") -#define MSG_USERWAIT _UxGT("Esperant usuari..") -#define MSG_PRINT_ABORTED _UxGT("Imp. cancelada") -#define MSG_NO_MOVE _UxGT("Sense moviment.") -#define MSG_KILLED _UxGT("MATAT.") -#define MSG_STOPPED _UxGT("ATURADA.") -#define MSG_CONTROL_RETRACT _UxGT("Retreu mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retreure mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retreu V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Aixeca mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") -#define MSG_AUTORETRACT _UxGT("Auto retraccio") -#define MSG_FILAMENTCHANGE _UxGT("Canvia filament") -#define MSG_INIT_SDCARD _UxGT("Inicialitza SD") -#define MSG_CNG_SDCARD _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_ZPROBE_ZOFFSET _UxGT("Decalatge Z") -#define MSG_BABYSTEP_X _UxGT("Micropas X") -#define MSG_BABYSTEP_Y _UxGT("Micropas Y") -#define MSG_BABYSTEP_Z _UxGT("Micropas Z") -#define MSG_ENDSTOP_ABORT _UxGT("Cancel. Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error al escalfar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP REDUNDANT") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MAXIMA") -#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_HALTED _UxGT("IMPRESSORA PARADA") -#define MSG_PLEASE_RESET _UxGT("Reinicieu") -#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("Escalfant...") -#define MSG_BED_HEATING _UxGT("Escalfant llit...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibratge Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibra Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibra el centre") - -#define MSG_INFO_MENU _UxGT("Quant a la impr.") -#define MSG_INFO_PRINTER_MENU _UxGT("Info Impressora") -#define MSG_INFO_STATS_MENU _UxGT("Estadistiques") -#define MSG_INFO_BOARD_MENU _UxGT("Info placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Llum") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Temps imprimint") - #define MSG_INFO_PRINT_LONGEST _UxGT("Treball mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extrudit") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudit") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp. mínima") -#define MSG_INFO_MAX_TEMP _UxGT("Temp. màxima") -#define MSG_INFO_PSU _UxGT("Font alimentacio") - -#define MSG_DRIVE_STRENGTH _UxGT("Força motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Repren impressió") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar el canvi") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("treure filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Poseu filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i premeu el boto") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("per continuar...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premeu boto per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("escalfar nozzle.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant nozzle") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espereu...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperant carrega") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("reprendre") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Espereu...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Expulsant...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insereix i prem") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregant...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprenent...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CA_H diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h deleted file mode 100644 index f02a23acab..0000000000 --- a/Marlin/language_cn.h +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_CN_H -#define LANGUAGE_CN_H - -#define DISPLAY_CHARSET_ISO10646_CN -#define CHARSIZE 2 - -#define WELCOME_MSG "\xa4\xa5\xa6\xa7" -#define MSG_SD_INSERTED "\xa8\xa9\xaa\xab" -#define MSG_SD_REMOVED "\xa8\xa9\xac\xad" -#define MSG_MAIN "\xae\xaf\xb0" -#define MSG_AUTOSTART "\xb1\xb2\xb3\xb4" -#define MSG_DISABLE_STEPPERS "\xb5\xb6\xb7\xb8\xb9\xba" -#define MSG_AUTO_HOME "\xbb\xbc\xbd" -#define MSG_TMC_Z_CALIBRATION "Calibrate Z" -#define MSG_LEVEL_BED_HOMING "Homing XYZ" -#define MSG_LEVEL_BED_WAITING "Click to Begin" -#define MSG_LEVEL_BED_DONE "Leveling Done!" -#define MSG_SET_HOME_OFFSETS "\xbe\xbf\xbb\xbc\xbd\xc0\xc1" -#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" -#define MSG_SET_ORIGIN "\xbe\xbf\xbc\xbd" -#define MSG_PREHEAT_1 "\xc3\xc4 PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xc5\xc6" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xc4\xc7" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xbf" -#define MSG_PREHEAT_2 "\xc3\xc4 ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xc5\xc6" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xbe\xc6" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xbf" -#define MSG_COOLDOWN "\xc8\xc9" -#define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3" -#define MSG_SWITCH_PS_OFF "\xb9\xcb\xb5\xb6" -#define MSG_EXTRUDE "\xcc\xad" -#define MSG_RETRACT "\xbb\xcd" -#define MSG_MOVE_AXIS "\xc1\xb2\xce" -#define MSG_BED_LEVELING "\xcf\xe0\xc4\xc7" -#define MSG_LEVEL_BED "\xcf\xe0\xc4\xc7" -#define MSG_MOVE_X "\xc1\xb2 X" -#define MSG_MOVE_Y "\xc1\xb2 Y" -#define MSG_MOVE_Z "\xc1\xb2 Z" -#define MSG_MOVE_E "\xcc\xad\xba" -#define MSG_MOVE_01MM "\xc1\xb2 0.1mm" -#define MSG_MOVE_1MM "\xc1\xb2 1mm" -#define MSG_MOVE_10MM "\xc1\xb2 10mm" -#define MSG_SPEED "\xd1\xd2" -#define MSG_NOZZLE "\xd3\xd4" -#define MSG_BED "\xc4\xc7" -#define MSG_FAN_SPEED "\xd5\xd6\xd1\xd2" -#define MSG_FLOW "\xcc\xad\xd1\xd2" -#define MSG_CONTROL "\xd8\xd9" -#define MSG_MIN LCD_STR_THERMOMETER " \xda\xdb" -#define MSG_MAX LCD_STR_THERMOMETER " \xda\xdc" -#define MSG_FACTOR LCD_STR_THERMOMETER " \xdd\xde" -#define MSG_AUTOTEMP "\xb1\xb2\xd8\xc9" -#define MSG_ON "\xb3 " // intentional space to shift wide symbol to the left -#define MSG_OFF "\xb5 " // intentional space to shift wide symbol to the left -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_ACC "Accel" -#define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif -#define MSG_VE_JERK "Ve-jerk" -#define MSG_VMAX "Vmax " -#define MSG_VMIN "Vmin" -#define MSG_VTRAV_MIN "VTrav min" -#define MSG_AMAX "Amax " -#define MSG_A_RETRACT "A-retract" -#define MSG_A_TRAVEL "A-travel" -#define MSG_STEPS_PER_MM "Steps/mm" -#define MSG_ESTEPS "Esteps/mm" -#define MSG_E1STEPS "E1steps/mm" -#define MSG_E2STEPS "E2steps/mm" -#define MSG_E3STEPS "E3steps/mm" -#define MSG_E4STEPS "E4steps/mm" -#define MSG_E5STEPS "E5steps/mm" -#define MSG_TEMPERATURE "\xc9\xd2" -#define MSG_MOTION "\xdf\xb2" -#define MSG_FILAMENT "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" -#define MSG_FILAMENT_DIAM "Fil. Dia." -#define MSG_CONTRAST "LCD contrast" -#define MSG_STORE_EEPROM "Store memory" -#define MSG_LOAD_EEPROM "Load memory" -#define MSG_RESTORE_FAILSAFE "Restore failsafe" -#define MSG_REFRESH "Refresh" -#define MSG_WATCH "\xec\xed\xee\xef" -#define MSG_PREPARE "\xa4\xa5" -#define MSG_TUNE "\xcf\xf0" -#define MSG_PAUSE_PRINT "\xf1\xf2\xca\xf3" -#define MSG_RESUME_PRINT "\xf4\xf5\xca\xf3" -#define MSG_STOP_PRINT "\xf2\xf6\xca\xf3" -#define MSG_CARD_MENU "\xaf\xb0" -#define MSG_NO_CARD "\xf9\xa8" -#define MSG_DWELL "Sleep..." -#define MSG_USERWAIT "Wait for user..." -#define MSG_PRINT_ABORTED "Print aborted" -#define MSG_NO_MOVE "No move." -#define MSG_KILLED "KILLED. " -#define MSG_STOPPED "STOPPED. " -#define MSG_CONTROL_RETRACT "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" -#define MSG_CONTROL_RETRACTF "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER "UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" -#define MSG_AUTORETRACT "AutoRetr." -#define MSG_FILAMENTCHANGE "Change filament" -#define MSG_INIT_SDCARD "Init. SD card" -#define MSG_CNG_SDCARD "Change SD card" -#define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" -#define MSG_ZPROBE_ZOFFSET "Z Offset" -#define MSG_BABYSTEP_X "Babystep X" -#define MSG_BABYSTEP_Y "Babystep Y" -#define MSG_BABYSTEP_Z "Babystep Z" -#define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_HEATING_FAILED_LCD "Heating failed" -#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP "Err: MAXTEMP" -#define MSG_ERR_MINTEMP "Err: MINTEMP" -#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" -#define MSG_DELTA_CALIBRATE "Delta Calibration" -#define MSG_DELTA_CALIBRATE_X "Calibrate X" -#define MSG_DELTA_CALIBRATE_Y "Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z "Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" - -#endif // LANGUAGE_CN_H diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h deleted file mode 100644 index 950b58a172..0000000000 --- a/Marlin/language_cz.h +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Czech - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Petr Zahradnik, Computer Laboratory - * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz - * - */ -#ifndef LANGUAGE_CZ_H -#define LANGUAGE_CZ_H - -#define DISPLAY_CHARSET_ISO10646_1 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pripraven.") -#define MSG_BACK _UxGT("Zpet") -#define MSG_SD_INSERTED _UxGT("Karta vlozena") -#define MSG_SD_REMOVED _UxGT("Karta vyjmuta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znaku -#define MSG_MAIN _UxGT("Hlavni nabidka") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") -#define MSG_DEBUG_MENU _UxGT("Nabidka ladeni") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk.prubehu") -#define MSG_AUTO_HOME _UxGT("Domovska pozice") -#define MSG_AUTO_HOME_X _UxGT("Domu osa X") -#define MSG_AUTO_HOME_Y _UxGT("Domu osa Y") -#define MSG_AUTO_HOME_Z _UxGT("Domu osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Mereni podlozky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutim spustte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Dalsi bod") -#define MSG_LEVEL_BED_DONE _UxGT("Mereni hotovo!") -#define MSG_Z_FADE_HEIGHT _UxGT("Vyska srovnavani") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") -#define MSG_SET_ORIGIN _UxGT("Nastavit pocatek") -#define MSG_PREHEAT_1 _UxGT("Zahrat PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vse") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podloz") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahrat ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vse") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podloz") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Zchladit") -#define MSG_SWITCH_PS_ON _UxGT("Zapnout napajeni") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnout napajeni") -#define MSG_EXTRUDE _UxGT("Vytlacit (extr.)") -#define MSG_RETRACT _UxGT("Zatlacit (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunout osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnat podlozku") -#define MSG_LEVEL_BED _UxGT("Vyrovnat podlozku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnat rohy") -#define MSG_NEXT_CORNER _UxGT("Dalsi roh") -#define MSG_EDITING_STOPPED _UxGT("Konec uprav site") - -#define MSG_UBL_DOING_G29 _UxGT("Provadim G29") -#define MSG_UBL_UNHOMED _UxGT("Prejedte domu") -#define MSG_UBL_TOOLS _UxGT("UBL nastroje") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Manualni sit bodu") -#define MSG_UBL_BC_INSERT _UxGT("Vlozte kartu, zmerte") -#define MSG_UBL_BC_INSERT2 _UxGT("Zmerte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstrante a zmerte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Presoun na dalsi") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podlozky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Uprava site bodu") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastni sit") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit sit bodu") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec uprav site") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastni sit") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvorit sit") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Sit bodu PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Sit bodu ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studena sit bodu") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit vysku site") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Vyska") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat sit") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola site PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola site ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. site") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokracovat v siti") -#define MSG_UBL_MESH_LEVELING _UxGT("Sitove rovnani") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnani") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mrizkove rovnani") -#define MSG_UBL_MESH_LEVEL _UxGT("Srovnat podlozku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranni body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ site bodu") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovat sit") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovat do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovat do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Zaloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upravit sit dobu") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mrizky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Rucni hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytra hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplnit mrizku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrusit vsechno") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrusit posledni") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upravit vsechny") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upravit posledni") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uloziste siti") -#define MSG_UBL_STORAGE_SLOT _UxGT("Pametovy slot") -#define MSG_UBL_LOAD_MESH _UxGT("Nacist sit bodu") -#define MSG_UBL_SAVE_MESH _UxGT("Ulozit sit bodu") -#define MSG_MESH_LOADED _UxGT("Sit %i nactena") -#define MSG_NO_STORAGE _UxGT("Nedostatek mista") -#define MSG_MESH_SAVED _UxGT("Sit %i ulozena") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Ulozit UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnovit UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Konec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") - -#define MSG_LED_CONTROL _UxGT("LED Nastaveni") -#define MSG_LEDS _UxGT("Svetla") -#define MSG_LED_PRESETS _UxGT("Svetla Predvolby") -#define MSG_SET_LEDS_RED _UxGT("Cervena") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranzova") -#define MSG_SET_LEDS_YELLOW _UxGT("Zluta") -#define MSG_SET_LEDS_GREEN _UxGT("Zelena") -#define MSG_SET_LEDS_BLUE _UxGT("Modra") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialova") -#define MSG_SET_LEDS_WHITE _UxGT("Bila") -#define MSG_SET_LEDS_DEFAULT _UxGT("Vychozi") -#define MSG_CUSTOM_LEDS _UxGT("Vlastni svetla") -#define MSG_INTENSITY_R _UxGT("Cervena intenzita") -#define MSG_INTENSITY_G _UxGT("Zelena intezita") -#define MSG_INTENSITY_B _UxGT("Modra intenzita") -#define MSG_INTENSITY_W _UxGT("Bila intenzita") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastni prikazy") -#define MSG_MOVING _UxGT("Posouvani...") -#define MSG_FREE_XY _UxGT("Uvolnit XY") -#define MSG_MOVE_X _UxGT("Posunout X") -#define MSG_MOVE_Y _UxGT("Posunout Y") -#define MSG_MOVE_Z _UxGT("Posunout Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Posunout o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunout o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunout o 10mm") -#define MSG_SPEED _UxGT("Rychlost") -#define MSG_BED_Z _UxGT("Vyska podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podlozka") -#define MSG_FAN_SPEED _UxGT("Rychlost vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rychlost ex. vent.") -#define MSG_FLOW _UxGT("Prutok") -#define MSG_CONTROL _UxGT("Ovladani") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrat") -#define MSG_ACC _UxGT("Zrychl") -#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_VELOCITY _UxGT("Rychlost") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerace") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-prejezd") -#define MSG_STEPS_PER_MM _UxGT("Kroku/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroku/mm") - #define MSG_BSTEPS _UxGT("Bkroku/mm") - #define MSG_CSTEPS _UxGT("Ckroku/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroku/mm") - #define MSG_BSTEPS _UxGT("Ykroku/mm") - #define MSG_CSTEPS _UxGT("Zkroku/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekroku/mm") -#define MSG_E1STEPS _UxGT("E1kroku/mm") -#define MSG_E2STEPS _UxGT("E2kroku/mm") -#define MSG_E3STEPS _UxGT("E3kroku/mm") -#define MSG_E4STEPS _UxGT("E4kroku/mm") -#define MSG_E5STEPS _UxGT("E5kroku/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavest mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Ulozit nastaveni") -#define MSG_LOAD_EEPROM _UxGT("Nacist nastaveni") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnovit vychozi") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnovit") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Priprava tisku") -#define MSG_TUNE _UxGT("Doladeni tisku") -#define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") -#define MSG_RESUME_PRINT _UxGT("Obnovit tisk") -#define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_CARD_MENU _UxGT("Tisknout z SD") -#define MSG_NO_CARD _UxGT("Zadna SD karta") -#define MSG_DWELL _UxGT("Uspano...") -#define MSG_USERWAIT _UxGT("Cekani na uziv...") -#define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") -#define MSG_PRINT_ABORTED _UxGT("Tisk zrusen") -#define MSG_NO_MOVE _UxGT("Zadny pohyb.") -#define MSG_KILLED _UxGT("PRERUSENO. ") -#define MSG_STOPPED _UxGT("ZASTAVENO. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Vymena Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zvednuti Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vymenit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavest filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vse") - -#define MSG_INIT_SDCARD _UxGT("Nacist SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vymenit SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor zkoseni") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunout") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunout") -#define MSG_HOME _UxGT("Domu") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prvni") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") -#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("Chyba zahrivani") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNI SKOK") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKA TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NIZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NIZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TISK. ZASTAVENA") -#define MSG_PLEASE_RESET _UxGT("Provedte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Zahrivani...") -#define MSG_BED_HEATING _UxGT("Zahrivani podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovat Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovat Stred") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastaveni") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrace") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.vysku delty") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Vyska") -#define MSG_DELTA_RADIUS _UxGT("Polomer") -#define MSG_INFO_MENU _UxGT("O tiskarne") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tiskarne") -#define MSG_3POINT_LEVELING _UxGT("3-bodove rovnani") -#define MSG_LINEAR_LEVELING _UxGT("Linearni rovnani") -#define MSG_BILINEAR_LEVELING _UxGT("Bilinearni rovnani") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mrizkove rovnani") -#define MSG_INFO_STATS_MENU _UxGT("Statistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o desce") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudery") -#define MSG_INFO_BAUDRATE _UxGT("Rychlost") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvetleni") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas svetla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Pocet tisku") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokonceno") - #define MSG_INFO_PRINT_TIME _UxGT("Celkovy cas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelsi tisk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkem vytlaceno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tisky") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Cas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelsi") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlaceno") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Buzeni motoru") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Ulozit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENI FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTI FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOZNOSTI OBNOVENI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlacit vic") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkovani selhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studeny") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na zahajeni") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("vymeny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunuti") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vlozte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stisknete") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlacitko...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknete pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahrati trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na nahrati tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedeni") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyckejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlaceni") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokracovani") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Cekejte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysouvani...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vlozte, kliknete") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahrivani...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavadeni...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlacovani...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokracovani...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CZ_H diff --git a/Marlin/language_cz_utf8.h b/Marlin/language_cz_utf8.h deleted file mode 100644 index e76c947e48..0000000000 --- a/Marlin/language_cz_utf8.h +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Czech - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Petr Zahradnik, Computer Laboratory - * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz - * - */ -#ifndef LANGUAGE_CZ_UTF_H -#define LANGUAGE_CZ_UTF_H - -#define MAPPER_C3C4C5_CZ -#define DISPLAY_CHARSET_ISO10646_CZ -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" připraven.") -#define MSG_BACK _UxGT("Zpět") -#define MSG_SD_INSERTED _UxGT("Karta vložena") -#define MSG_SD_REMOVED _UxGT("Karta vyjmuta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znaku -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstopy") -#define MSG_MAIN _UxGT("Hlavní nabídka") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") -#define MSG_DEBUG_MENU _UxGT("Nabídka ladění") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. průběhu") -#define MSG_AUTO_HOME _UxGT("Domovská pozice") -#define MSG_AUTO_HOME_X _UxGT("Domů osa X") -#define MSG_AUTO_HOME_Y _UxGT("Domů osa Y") -#define MSG_AUTO_HOME_Z _UxGT("Domů osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Měření podložky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Další bod") -#define MSG_LEVEL_BED_DONE _UxGT("Měření hotovo!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška srovnávání") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") -#define MSG_SET_ORIGIN _UxGT("Nastavit počátek") -#define MSG_PREHEAT_1 _UxGT("Zahřát PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vše") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahřát ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vše") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Zchladit") -#define MSG_SWITCH_PS_ON _UxGT("Zapnout napájení") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnout napájení") -#define MSG_EXTRUDE _UxGT("Vytlačit (extr.)") -#define MSG_RETRACT _UxGT("Zatlačit (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunout osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_BED _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnat rohy") -#define MSG_NEXT_CORNER _UxGT("Další roh") -#define MSG_EDITING_STOPPED _UxGT("Konec úprav sítě") - -#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ů") -#define MSG_UBL_BC_INSERT _UxGT("Vložte kartu, změřte") -#define MSG_UBL_BC_INSERT2 _UxGT("Změřte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstraňte a změřte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Přesun na další") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sítě bodů") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastní síť") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit síť bodů") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec úprav sítě") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastní síť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvořit síť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Síť bodu PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Síť bodu ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená síť bodů") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit výšku sítě") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat síť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola sítě PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola sítě ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. sítě") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovat v síťi") -#define MSG_UBL_MESH_LEVELING _UxGT("Síťové rovnání") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnání") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mrizkove rovnání") -#define MSG_UBL_MESH_LEVEL _UxGT("Srovnat podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranní body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ sítě bodu") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovat síť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovat do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovat do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upravit síť bodů") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mřížky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ruční hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytrá hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplnit mřížku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušit všechno") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušit poslední") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upravit všechny") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upravit poslední") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uložiště sítí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Paměťový slot") -#define MSG_UBL_LOAD_MESH _UxGT("Načíst síť bodů") -#define MSG_UBL_SAVE_MESH _UxGT("Uložit síť bodů") -#define MSG_MESH_LOADED _UxGT("Síť %i načtena") -#define MSG_MESH_SAVED _UxGT("Síť %i uložena") -#define MSG_NO_STORAGE _UxGT("Nedostatek místa") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Uložit UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnovit UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Konec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně") - -#define MSG_LED_CONTROL _UxGT("LED Nastavení") -#define MSG_LEDS _UxGT("Světla") -#define MSG_LED_PRESETS _UxGT("Světla Předvolby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žlutá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Bílá") -#define MSG_SET_LEDS_DEFAULT _UxGT("Výchozí") -#define MSG_CUSTOM_LEDS _UxGT("Vlastní světla") -#define MSG_INTENSITY_R _UxGT("Červená intenzita") -#define MSG_INTENSITY_G _UxGT("Zelená intezita") -#define MSG_INTENSITY_B _UxGT("Modrá intenzita") -#define MSG_INTENSITY_W _UxGT("Bílá intenzita") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastní příkazy") -#define MSG_MOVING _UxGT("Posouvani...") -#define MSG_FREE_XY _UxGT("Uvolnit XY") -#define MSG_MOVE_X _UxGT("Posunout X") -#define MSG_MOVE_Y _UxGT("Posunout Y") -#define MSG_MOVE_Z _UxGT("Posunout Z") -#define MSG_MOVE_E _UxGT("Extrudér") -#define MSG_MOVE_01MM _UxGT("Posunout o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunout o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunout o 10mm") -#define MSG_SPEED _UxGT("Rychlost") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_FAN_SPEED _UxGT("Rychlost vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rychlost ex. vent.") -#define MSG_FLOW _UxGT("Průtok") -#define MSG_CONTROL _UxGT("Ovládaní") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrat") -#define MSG_ACC _UxGT("Zrychl") -#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_VELOCITY _UxGT("Rychlost") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerace") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-přejezd") -#define MSG_STEPS_PER_MM _UxGT("Kroků/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroků/mm") - #define MSG_BSTEPS _UxGT("Bkroků/mm") - #define MSG_CSTEPS _UxGT("Ckroků/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroků/mm") - #define MSG_BSTEPS _UxGT("Ykroků/mm") - #define MSG_CSTEPS _UxGT("Zkroků/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekroků/mm") -#define MSG_E1STEPS _UxGT("E1kroků/mm") -#define MSG_E2STEPS _UxGT("E2kroků/mm") -#define MSG_E3STEPS _UxGT("E3kroků/mm") -#define MSG_E4STEPS _UxGT("E4kroků/mm") -#define MSG_E5STEPS _UxGT("E5kroků/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavést mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Uložit nastavení") -#define MSG_LOAD_EEPROM _UxGT("Načíst nastavení") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnovit výchozí") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnovit") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Připrava tisku") -#define MSG_TUNE _UxGT("Doladění tisku") -#define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") -#define MSG_RESUME_PRINT _UxGT("Obnovit tisk") -#define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Obnova vypadku") -#define MSG_CARD_MENU _UxGT("Tisknout z SD") -#define MSG_NO_CARD _UxGT("Žádná SD karta") -#define MSG_DWELL _UxGT("Uspáno...") -#define MSG_USERWAIT _UxGT("Čekání na uživ...") -#define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") -#define MSG_PRINTING _UxGT("Tisknu...") -#define MSG_PRINT_ABORTED _UxGT("Tisk zrušen") -#define MSG_NO_MOVE _UxGT("Žádný pohyb.") -#define MSG_KILLED _UxGT("PŘERUSENO. ") -#define MSG_STOPPED _UxGT("ZASTAVENO. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výměna Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zvednuti Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vyměnit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavést filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vše") - -#define MSG_INIT_SDCARD _UxGT("Načíst SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vyměnit SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor zkosení") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunout") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunout") -#define MSG_HOME _UxGT("Domů") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("první") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") -#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("Chyba zahřívání") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba zahř. podl.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÍ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("PODL. TEPL. SKOK") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TISK. ZASTAVENA") -#define MSG_PLEASE_RESET _UxGT("Proveďte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Zahřívání...") -#define MSG_COOLING _UxGT("Chlazení") -#define MSG_BED_HEATING _UxGT("Zahřívání podl...") -#define MSG_BED_COOLING _UxGT("Chlazení podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovat Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovat Střed") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastavení") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrace") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Nast. Z-ofset") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Výška") -#define MSG_DELTA_RADIUS _UxGT("Poloměr") -#define MSG_INFO_MENU _UxGT("O tiskárně") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tiskárně") -#define MSG_3POINT_LEVELING _UxGT("3-bodové rovnání") -#define MSG_LINEAR_LEVELING _UxGT("Lineárni rovnání") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineární rovnání") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mřížkové rovnání") -#define MSG_INFO_STATS_MENU _UxGT("Statistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o desce") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rychlost") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvětlení") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas světla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tisků") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončeno") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší tisk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkem vytlačeno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tisky") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačeno") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Buzení motorů") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Uložit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽNOSTI OBNOVENÍ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačit víc") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkování selhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studený") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na zahájení") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výměny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunuti") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stiskněte") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlačítko...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahřátí trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na nahřátí tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedení") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyčkejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačení") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračování") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysouvání...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, klikněte") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahřívání...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádění...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačování...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračování...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CZ_UTF_H diff --git a/Marlin/language_da.h b/Marlin/language_da.h deleted file mode 100644 index e51f8d014a..0000000000 --- a/Marlin/language_da.h +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Danish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_DA_H -#define LANGUAGE_DA_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" er klar") -#define MSG_SD_INSERTED _UxGT("Kort isat") -#define MSG_SD_REMOVED _UxGT("Kort fjernet") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Slå alle steppere fra") -#define MSG_AUTO_HOME _UxGT("Auto Home") // G28 -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik når du er klar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Næste punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level er færdig!") -#define MSG_SET_HOME_OFFSETS _UxGT("Sæt forsk. af home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Forsk. er nu aktiv") -#define MSG_SET_ORIGIN _UxGT("Sæt origin") -#define MSG_PREHEAT_1 _UxGT("Forvarm PLA") -#define MSG_PREHEAT_1_N _UxGT("Forvarm PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Forvarm PLA Alle") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Forvarm PLA Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Forvarm PLA conf") -#define MSG_PREHEAT_2 _UxGT("Forvarm ABS") -#define MSG_PREHEAT_2_N _UxGT("Forvarm ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Forvarm ABS Alle") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Forvarm ABS Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Forvarm ABS conf") -#define MSG_COOLDOWN _UxGT("Afkøl") -#define MSG_SWITCH_PS_ON _UxGT("Slå strøm til") -#define MSG_SWITCH_PS_OFF _UxGT("Slå strøm fra") -#define MSG_EXTRUDE _UxGT("Extruder") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Flyt akser") -#define MSG_BED_LEVELING _UxGT("Juster bed") -#define MSG_LEVEL_BED _UxGT("Juster bed") -#define MSG_MOVE_X _UxGT("Flyt X") -#define MSG_MOVE_Y _UxGT("Flyt Y") -#define MSG_MOVE_Z _UxGT("Flyt Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Flyt 0.1mm") -#define MSG_MOVE_1MM _UxGT("Flyt 1mm") -#define MSG_MOVE_10MM _UxGT("Flyt 10mm") -#define MSG_SPEED _UxGT("Hastighed") -#define MSG_BED_Z _UxGT("Plade Z") -#define MSG_NOZZLE _UxGT("Dyse") - -#define MSG_BED _UxGT("Plade") -#define MSG_FAN_SPEED _UxGT("Blæser hastighed") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Kontrol") -#define MSG_MIN _UxGT(" \002 Min") -#define MSG_MAX _UxGT(" \002 Max") -#define MSG_FACTOR _UxGT(" \002 Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("Til ") -#define MSG_OFF _UxGT("Fra") -#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("Vælg") -#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-rejse") -#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_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bevægelse") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E i mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrast") -#define MSG_STORE_EEPROM _UxGT("Gem i EEPROM") -#define MSG_LOAD_EEPROM _UxGT("Hent fra EEPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Gendan failsafe") -#define MSG_REFRESH _UxGT("Genopfrisk") -#define MSG_WATCH _UxGT("Info skærm") -#define MSG_PREPARE _UxGT("Forbered") -#define MSG_TUNE _UxGT("Tune") -#define MSG_PAUSE_PRINT _UxGT("Pause printet") -#define MSG_RESUME_PRINT _UxGT("Forsæt printet") -#define MSG_STOP_PRINT _UxGT("Stop printet") -#define MSG_CARD_MENU _UxGT("Print fra SD") -#define MSG_NO_CARD _UxGT("Intet SD kort") -#define MSG_DWELL _UxGT("Dvale...") -#define MSG_USERWAIT _UxGT("Venter på bruger...") -#define MSG_PRINT_ABORTED _UxGT("Print annulleret") -#define MSG_NO_MOVE _UxGT("Ingen bevægelse.") -#define MSG_KILLED _UxGT("DRÆBT. ") -#define MSG_STOPPED _UxGT("STOPPET. ") -#define MSG_CONTROL_RETRACT _UxGT("Tilbagetræk mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Skift Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Tilbagetræk V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Skift UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Skift filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD card") -#define MSG_CNG_SDCARD _UxGT("Skift SD kort") -#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_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("Opvarmning fejlet") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Fejl: reserve temp") -#define MSG_THERMAL_RUNAWAY _UxGT("Temp løber løbsk") -#define MSG_ERR_MAXTEMP _UxGT("Fejl: Maks temp") -#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_HALTED _UxGT("PRINTER STOPPET") -#define MSG_PLEASE_RESET _UxGT("Reset Venligst") -#define MSG_SHORT_DAY _UxGT("d") // Kun et bogstav -#define MSG_SHORT_HOUR _UxGT("h") // Kun et bogstav -#define MSG_SHORT_MINUTE _UxGT("m") // Kun et bogstav -#define MSG_HEATING _UxGT("Opvarmer...") -#define MSG_BED_HEATING _UxGT("Opvarmer plade...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrering") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrerings Center") - -#define MSG_INFO_MENU _UxGT("Om Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Kort Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Ant. Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total print tid") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total Extruderet") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruderet") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Strømfors.") - -#define MSG_DRIVE_STRENGTH _UxGT("Driv Styrke") -#define MSG_DAC_PERCENT _UxGT("Driv %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Skriv") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Forsæt print") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent på start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("af filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("skift") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vent på") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament udskyd.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("og tryk på knap") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("for at fortsætte...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Vent på") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament indtag") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Vent på at print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("fortsætter") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent venligst...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Udskyder...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt og klik") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Indtager...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsætter...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_DA_H diff --git a/Marlin/language_de.h b/Marlin/language_de.h deleted file mode 100644 index 2a28c9145d..0000000000 --- a/Marlin/language_de.h +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * German - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_DE_H -#define LANGUAGE_DE_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("ÄäÖöÜüß²³") - -#define WELCOME_MSG MACHINE_NAME _UxGT(" bereit") -#define MSG_BACK _UxGT("Zurück") -#define MSG_SD_INSERTED _UxGT("SD-Karte erkannt") -#define MSG_SD_REMOVED _UxGT("SD-Karte entfernt") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopp") // Max length 8 characters -#define MSG_MAIN _UxGT("Hauptmenü") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren deaktivieren") // M84 -#define MSG_DEBUG_MENU _UxGT("Debug Menü") -#define MSG_PROGRESS_BAR_TEST _UxGT("Fortschrittsb. Test") -#define MSG_AUTO_HOME _UxGT("Home") // G28 -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriere Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klick für Start") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") -#define MSG_LEVEL_BED_DONE _UxGT("Fertig") -#define MSG_Z_FADE_HEIGHT _UxGT("Ausblendhöhe") -#define MSG_SET_HOME_OFFSETS _UxGT("Setze Homeversatz") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Homeversatz aktiv") -#define MSG_SET_ORIGIN _UxGT("Setze Nullpunkt") //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_1 _UxGT("Vorwärmen PLA") -#define MSG_PREHEAT_1_N _UxGT("Vorwärmen PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Vorw. PLA Alle") -#define MSG_PREHEAT_1_END _UxGT("Vorw. PLA Extr.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Vorw. PLA Bett") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Vorw. PLA Einst.") -#define MSG_PREHEAT_2 _UxGT("Vorwärmen ABS") -#define MSG_PREHEAT_2_N _UxGT("Vorwärmen ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Vorw. ABS Alle") -#define MSG_PREHEAT_2_END _UxGT("Vorw. ABS Extr.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Vorw. ABS Bett") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Vorw. ABS Einst.") -#define MSG_COOLDOWN _UxGT("Abkühlen") -#define MSG_SWITCH_PS_ON _UxGT("Netzteil ein") -#define MSG_SWITCH_PS_OFF _UxGT("Netzteil aus") -#define MSG_EXTRUDE _UxGT("Extrudieren") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Bewegen") -#define MSG_BED_LEVELING _UxGT("Bett Nivellierung") -#define MSG_LEVEL_BED _UxGT("Bett nivellieren") -#define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") -#define MSG_NEXT_CORNER _UxGT("Nächste Ecke") -#define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") -#define MSG_USER_MENU _UxGT("Benutzer Menü") -#define MSG_MOVING _UxGT("In Bewegung...") -#define MSG_FREE_XY _UxGT("Abstand XY") -#define MSG_MOVE_X _UxGT("X") -#define MSG_MOVE_Y _UxGT("Y") -#define MSG_MOVE_Z _UxGT("Z") -#define MSG_MOVE_E _UxGT("Extruder ") -#define MSG_MOVE_01MM _UxGT(" 0,1 mm") -#define MSG_MOVE_1MM _UxGT(" 1,0 mm") -#define MSG_MOVE_10MM _UxGT("10,0 mm") -#define MSG_SPEED _UxGT("Geschw.") -#define MSG_BED_Z _UxGT("Bett Z") -#define MSG_NOZZLE _UxGT("Düse") -#define MSG_BED _UxGT("Bett") -#define MSG_FAN_SPEED _UxGT("Lüfter") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra Lüfter") -#define MSG_FLOW _UxGT("Flussrate") -#define MSG_CONTROL _UxGT("Einstellungen") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Faktor") -#define MSG_AUTOTEMP _UxGT("AutoTemp") -#define MSG_ON _UxGT("Ein") -#define MSG_OFF _UxGT("Aus") -#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("Auswählen") -#define MSG_ACC _UxGT("A") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("V A Jerk") - #define MSG_VB_JERK _UxGT("V B Jerk") - #define MSG_VC_JERK _UxGT("V C Jerk") -#else - #define MSG_VA_JERK _UxGT("V X Jerk") - #define MSG_VB_JERK _UxGT("V Y Jerk") - #define MSG_VC_JERK _UxGT("V Z Jerk") -#endif -#define MSG_VE_JERK _UxGT("V E Jerk") -#define MSG_VELOCITY _UxGT("Geschwindigkeit") -#define MSG_VMAX _UxGT("V max ") // space by purpose -#define MSG_VMIN _UxGT("V min") -#define MSG_VTRAV_MIN _UxGT("V min Leerfahrt") -#define MSG_ACCELERATION _UxGT("Beschleunigung") -#define MSG_AMAX _UxGT("A max ") // space by purpose -#define MSG_A_RETRACT _UxGT("A Retract") -#define MSG_A_TRAVEL _UxGT("A Leerfahrt") -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A Steps/mm") - #define MSG_BSTEPS _UxGT("B Steps/mm") - #define MSG_CSTEPS _UxGT("C Steps/mm") -#else - #define MSG_ASTEPS _UxGT("X Steps/mm") - #define MSG_BSTEPS _UxGT("Y Steps/mm") - #define MSG_CSTEPS _UxGT("Z Steps/mm") -#endif -#define MSG_ESTEPS _UxGT("E Steps/mm") -#define MSG_E1STEPS _UxGT("E1 Steps/mm") -#define MSG_E2STEPS _UxGT("E2 Steps/mm") -#define MSG_E3STEPS _UxGT("E3 Steps/mm") -#define MSG_E4STEPS _UxGT("E4 Steps/mm") -#define MSG_E5STEPS _UxGT("E5 Steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bewegung") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("D Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Entladen mm") -#define MSG_FILAMENT_LOAD _UxGT("Laden mm") -#define MSG_ADVANCE_K _UxGT("Advance Faktor") -#define MSG_CONTRAST _UxGT("LCD Kontrast") -#define MSG_STORE_EEPROM _UxGT("Konfig. speichern") -#define MSG_LOAD_EEPROM _UxGT("Konfig. laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden") -#define MSG_INIT_EEPROM _UxGT("Werkseinstellungen") -#define MSG_REFRESH _UxGT("Aktualisieren") -#define MSG_WATCH _UxGT("Info") -#define MSG_PREPARE _UxGT("Vorbereitung") -#define MSG_TUNE _UxGT("Justierung") -#define MSG_PAUSE_PRINT _UxGT("SD-Druck Pause") -#define MSG_RESUME_PRINT _UxGT("SD-Druck Fortsetzung") -#define MSG_STOP_PRINT _UxGT("SD-Druck Abbruch") -#define MSG_CARD_MENU _UxGT("SD-Karte") -#define MSG_NO_CARD _UxGT("Keine SD-Karte") -#define MSG_DWELL _UxGT("Warten...") -#define MSG_USERWAIT _UxGT("Warte auf Nutzer") -#define MSG_PRINT_PAUSED _UxGT("Druck pausiert") -#define MSG_PRINT_ABORTED _UxGT("Druck abgebrochen") -#define MSG_NO_MOVE _UxGT("Motoren eingeschaltet") -#define MSG_KILLED _UxGT("ABGEBROCHEN") -#define MSG_STOPPED _UxGT("ANGEHALTEN") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Wechs. Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z-Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Wechs. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("Autom. Retract") -#define MSG_FILAMENTCHANGE _UxGT("Filament wechseln") -#define MSG_FILAMENTLOAD _UxGT("Filament laden") -#define MSG_FILAMENTUNLOAD _UxGT("Filament entladen") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Alles entladen") -#define MSG_INIT_SDCARD _UxGT("SD-Karte erkennen") // Manually initialize the SD-card via user interface -#define MSG_CNG_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" -#define MSG_ZPROBE_OUT _UxGT("Sensor ausserhalb") -#define MSG_SKEW_FACTOR _UxGT("Skew Faktor") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch ausfahren") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch 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_ZPROBE_ZOFFSET _UxGT("Z Versatz") -#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("Endstopp-Abbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN FEHLGESCHLAGEN") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMPERATURABWEICHUNG") -#define MSG_THERMAL_RUNAWAY LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("BETT") MSG_THERMAL_RUNAWAY -#define MSG_ERR_MAXTEMP LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") -#define MSG_ERR_MINTEMP LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") -#define MSG_ERR_MAXTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") -#define MSG_ERR_MINTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("DRUCKER STOPP") -#define MSG_PLEASE_RESET _UxGT("Bitte Resetten") -#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_BED_HEATING _UxGT("Bett heizt...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrieren") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriere X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriere Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriere Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriere Mitte") -#define MSG_DELTA_SETTINGS _UxGT("Delta Einst. anzeig.") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autom. Kalibrierung") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Höhe setzen") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#define MSG_DELTA_HEIGHT _UxGT("Höhe") -#define MSG_DELTA_RADIUS _UxGT("Radius") -#define MSG_INFO_MENU _UxGT("Über den Drucker") -#define MSG_INFO_PRINTER_MENU _UxGT("Drucker Info") -#define MSG_3POINT_LEVELING _UxGT("3-Punkt Nivellierung") -#define MSG_LINEAR_LEVELING _UxGT("Lineare Nivellierung") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineare Nivell.") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Netz Nivellierung") -#define MSG_INFO_STATS_MENU _UxGT("Drucker Statistik") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistoren") -#define MSG_INFO_EXTRUDERS _UxGT("Extruder") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protokoll") -#define MSG_CASE_LIGHT _UxGT("Beleuchtung") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Helligkeit") - -#define MSG_UBL_DOING_G29 _UxGT("G29 UBL läuft!") -#define MSG_UBL_UNHOMED _UxGT("Erst XYZ homen") -#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.") -#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") -#define MSG_UBL_BC_INSERT2 _UxGT("Messen") -#define MSG_UBL_BC_REMOVE _UxGT("Entfernen & messen") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Nächster Punkt...") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktivieren") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL deaktivieren") -#define MSG_UBL_SET_BED_TEMP _UxGT("Bett Temp.") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Netz bearbeiten") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Eigenes Netz bearb.") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Feineinstellung...") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Bearbeitung beendet") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Eigenes Netz erst.") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Netz erstellen") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Netz erstellen PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Netz erstellen ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netz Höhe einst.") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Netz validieren PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Netz validieren ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") -#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 Nivellierung") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Gitternetz Nivell.") -#define MSG_UBL_MESH_LEVEL _UxGT("Netz nivellieren") -#define MSG_UBL_SIDE_POINTS _UxGT("Eckpunkte") -#define MSG_UBL_MAP_TYPE _UxGT("Kartentyp") -#define MSG_UBL_OUTPUT_MAP _UxGT("Karte ausgeben") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Ausgabe für Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Ausgabe für CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Externe Sicherung") -#define MSG_UBL_INFO_UBL _UxGT("UBL Info ausgeben") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Netz bearbeiten") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Menge an Fill-in") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuelles Fill-in") -#define MSG_UBL_SMART_FILLIN _UxGT("Kluges Fill-in") -#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Netz") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Alles annullieren") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Nächstlieg. ann.") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Feineinstellung Alle") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Feineinst. Nächstl.") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Netz Speicherplatz") -#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#define MSG_UBL_LOAD_MESH _UxGT("Bett Netz laden") -#define MSG_UBL_SAVE_MESH _UxGT("Bett Netz speichern") -#define MSG_MESH_LOADED _UxGT("Netz %i geladen") -#define MSG_MESH_SAVED _UxGT("Netz %i gespeichert") -#define MSG_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_STOPPED _UxGT("Z-Versatz angehalten") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") - -#define MSG_LED_CONTROL _UxGT("LED Kontrolle") -#define MSG_LEDS _UxGT("Licht") -#define MSG_LED_PRESETS _UxGT("Licht Einstellungen") -#define MSG_SET_LEDS_RED _UxGT("Rot") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Gelb") -#define MSG_SET_LEDS_GREEN _UxGT("Grün") -#define MSG_SET_LEDS_BLUE _UxGT("Blau") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violett") -#define MSG_SET_LEDS_WHITE _UxGT("Weiß") -#define MSG_SET_LEDS_DEFAULT _UxGT("Standard") -#define MSG_CUSTOM_LEDS _UxGT("Benutzerdef.") -#define MSG_INTENSITY_R _UxGT("Intensität Rot") -#define MSG_INTENSITY_G _UxGT("Intensität Grün") -#define MSG_INTENSITY_B _UxGT("Intensität Blau") -#define MSG_INTENSITY_W _UxGT("Intensität Weiß") -#define MSG_LED_BRIGHTNESS _UxGT("Helligkeit") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Gesamte Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Beendete Drucke") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamte Druckzeit") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster Druckjob") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Gesamt Extrudiert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplett") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamt ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Netzteil") - -#define MSG_DRIVE_STRENGTH _UxGT("Motorströme") -#define MSG_DAC_PERCENT _UxGT("Treiber %") -#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") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("FILAMENT ENTLADEN") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("FORTS. OPTIONEN:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Mehr entleeren") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Drucke weiter") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Düse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Homing gescheitert") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing gescheitert") -#define MSG_M600_TOO_COLD _UxGT("M600: Zu kalt") -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Warte auf den") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("Start des") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("Filamentwechsels") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("Herausnahme") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("des Filaments...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filament einlegen") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("und Knopf") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("drücken...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Knopf drücken um") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Düse aufzuheizen.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Düse heizt auf...") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Bitte warten...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Laden des") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("Filaments") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Entleeren des") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("Filaments") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("Fortsetzung des") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("Druckes...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Bitte warten...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Auswerfen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laden und Klick") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heizen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Laden...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Entleeren...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsetzen...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_DE_H diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h deleted file mode 100644 index 775242bb8f..0000000000 --- a/Marlin/language_el-gr.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Greek (Greece) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EL_GR_H -#define LANGUAGE_EL_GR_H - -#define MAPPER_CECF -#define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _UxGT("Απενεργοποίηση βηματιστή") -#define MSG_AUTO_HOME _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο") -#define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") -#define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") -#define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ") -#define MSG_LEVEL_BED_WAITING _UxGT("Κάντε κλικ για να ξεκινήσετε") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") -#define MSG_LEVEL_BED_DONE _UxGT("Ολοκλήρωση επιπεδοποίησης!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" κλίνη") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" επιβεβαίωση") -#define MSG_COOLDOWN _UxGT("Μειωση θερμοκρασιας") -#define MSG_SWITCH_PS_ON _UxGT("Ενεργοποίηση") -#define MSG_SWITCH_PS_OFF _UxGT("Απενεργοποίηση") -#define MSG_EXTRUDE _UxGT("Εξώθηση") -#define MSG_RETRACT _UxGT("Ανάσυρση") -#define MSG_MOVE_AXIS _UxGT("Μετακίνηση άξονα") -#define MSG_BED_LEVELING _UxGT("Επιπεδοποίηση κλίνης") -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση κλίνης") -#define MSG_MOVE_X _UxGT("Μετακίνηση X") -#define MSG_MOVE_Y _UxGT("Μετακίνηση Y") -#define MSG_MOVE_Z _UxGT("Μετακίνηση Z") -#define MSG_MOVE_E _UxGT("Εξωθητήρας") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1 μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1 μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10 μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Κλίνη Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#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("Αυτομ. ρύθμιση θερμοκρασίας") -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") -#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_ACC _UxGT("Επιτάχυνση") -#define MSG_JERK _UxGT("Vαντίδραση") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") -#define MSG_VMAX _UxGT("Vμεγ ") -#define MSG_VMIN _UxGT("Vελαχ") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#define MSG_A_RETRACT _UxGT("Α-ανάσυρση") -#define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") -#define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif -#define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") -#define MSG_REFRESH _UxGT("Ανανέωση") -#define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") -#define MSG_PREPARE _UxGT("Προετοιμασία") -#define MSG_TUNE _UxGT("Συντονισμός") -#define MSG_PAUSE_PRINT _UxGT("Παύση εκτύπωσης") -#define MSG_RESUME_PRINT _UxGT("Συνέχιση εκτύπωσης") -#define MSG_STOP_PRINT _UxGT("Διακοπή εκτύπωσης") -#define MSG_CARD_MENU _UxGT("Εκτύπωση από SD") -#define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") -#define MSG_DWELL _UxGT("Αναστολή λειτουργίας…") -#define MSG_USERWAIT _UxGT("Αναμονή για χρήστη…") -#define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") -#define MSG_NO_MOVE _UxGT("Καμία κίνηση.") -#define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") -#define MSG_STOPPED _UxGT("ΔΙΑΚΟΠΗ. ") -#define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") -#define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") -#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("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός κλίνης") -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ματαίωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#define MSG_THERMAL_RUNAWAY _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ") -#define MSG_ERR_MAXTEMP _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ") -#define MSG_ERR_MINTEMP _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ") -#define MSG_ERR_MAXTEMP_BED _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") -#define MSG_ERR_MINTEMP_BED _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") -#define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _UxGT("Θέρμανση κλίνης…") -#define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Βαθμονόμηση Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Βαθμονόμηση κέντρου") - -#endif // LANGUAGE_EL_GR_H diff --git a/Marlin/language_el.h b/Marlin/language_el.h deleted file mode 100644 index b4fe4d37f0..0000000000 --- a/Marlin/language_el.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Greek - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EL_H -#define LANGUAGE_EL_H - -#define MAPPER_CECF -#define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _UxGT("Απενεργοποίηση Μοτέρ") -#define MSG_AUTO_HOME _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο") //SHORTEN -#define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") -#define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") -#define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED_WAITING _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει") //SHORTEN -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") -#define MSG_LEVEL_BED_DONE _UxGT("Ολοκλήρωση επιπεδοποίησης!") //SHORTEN -#define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") //SHORTEN -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") //SHORTEN -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_COOLDOWN _UxGT("Μειωση θερμοκρασιας") -#define MSG_SWITCH_PS_ON _UxGT("Ενεργοποίηση") -#define MSG_SWITCH_PS_OFF _UxGT("Απενεργοποίηση") -#define MSG_EXTRUDE _UxGT("Εξώθηση") -#define MSG_RETRACT _UxGT("Ανάσυρση") -#define MSG_MOVE_AXIS _UxGT("Μετακίνηση άξονα") -#define MSG_BED_LEVELING _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#define MSG_MOVE_X _UxGT("Μετακίνηση X") -#define MSG_MOVE_Y _UxGT("Μετακίνηση Y") -#define MSG_MOVE_Z _UxGT("Μετακίνηση Z") -#define MSG_MOVE_E _UxGT("Εξωθητήρας") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Επ. Εκτύπωσης Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#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("Αυτομ ρύθμιση θερ/σίας") //SHORTEN -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") -#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_ACC _UxGT("Επιτάχυνση") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") -#define MSG_VMAX _UxGT("V Μέγιστο") -#define MSG_VMIN _UxGT("V Ελάχιστο") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#define MSG_A_RETRACT _UxGT("Α-ανάσυρση") -#define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") -#define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif -#define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") //SHORTEN -#define MSG_REFRESH _UxGT("Ανανέωση") -#define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") -#define MSG_PREPARE _UxGT("Προετοιμασία") -#define MSG_TUNE _UxGT("Συντονισμός") -#define MSG_PAUSE_PRINT _UxGT("Παύση εκτύπωσης") -#define MSG_RESUME_PRINT _UxGT("Συνέχιση εκτύπωσης") -#define MSG_STOP_PRINT _UxGT("Διακοπή εκτύπωσης") -#define MSG_CARD_MENU _UxGT("Εκτύπωση από SD") -#define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") -#define MSG_DWELL _UxGT("Αναστολή λειτουργίας") -#define MSG_USERWAIT _UxGT("Αναμονή για χρήστη") -#define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") //SHORTEN -#define MSG_NO_MOVE _UxGT("Καμία κίνηση.") -#define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") -#define MSG_STOPPED _UxGT("ΔΙΑΚΟΠΗ. ") -#define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") //SHORTEN -#define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") -#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("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") //SHORTEN -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης") //SHORTEN -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") //SHORTEN -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ακύρωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#define MSG_THERMAL_RUNAWAY _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ") -#define MSG_ERR_MAXTEMP _UxGT("ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ") -#define MSG_ERR_MINTEMP _UxGT("ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ") //SHORTEN -#define MSG_ERR_MAXTEMP_BED _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_ERR_MINTEMP_BED _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_HALTED _UxGT("H εκτύπωση διακόπηκε") -#define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _UxGT("Θέρμανση ΕΠ. Εκτύπωσης") //SHORTEN -#define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Βαθμονόμηση Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Βαθμονόμηση κέντρου") - -#endif // LANGUAGE_EL_H diff --git a/Marlin/language_en.h b/Marlin/language_en.h deleted file mode 100644 index 577171b0df..0000000000 --- a/Marlin/language_en.h +++ /dev/null @@ -1,1075 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * English - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EN_H -#define LANGUAGE_EN_H - -#define en 1234 -#if LCD_LANGUAGE == en - #define NOT_EXTENDED_ISO10646_1_5X7 -#endif -#undef en - -#ifndef CHARSIZE - #define CHARSIZE 1 -#endif - -#ifndef WELCOME_MSG - #define WELCOME_MSG MACHINE_NAME _UxGT(" Ready.") -#endif -#ifndef MSG_BACK - #define MSG_BACK _UxGT("Back") -#endif -#ifndef MSG_SD_INSERTED - #define MSG_SD_INSERTED _UxGT("Card inserted") -#endif -#ifndef MSG_SD_REMOVED - #define MSG_SD_REMOVED _UxGT("Card removed") -#endif -#ifndef MSG_LCD_ENDSTOPS - #define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#endif -#ifndef MSG_LCD_SOFT_ENDSTOPS - #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstops") -#endif -#ifndef MSG_MAIN - #define MSG_MAIN _UxGT("Main") -#endif -#ifndef MSG_AUTOSTART - #define MSG_AUTOSTART _UxGT("Autostart") -#endif -#ifndef MSG_DISABLE_STEPPERS - #define MSG_DISABLE_STEPPERS _UxGT("Disable steppers") -#endif -#ifndef MSG_DEBUG_MENU - #define MSG_DEBUG_MENU _UxGT("Debug Menu") -#endif -#ifndef MSG_PROGRESS_BAR_TEST - #define MSG_PROGRESS_BAR_TEST _UxGT("Progress Bar Test") -#endif -#ifndef MSG_AUTO_HOME - #define MSG_AUTO_HOME _UxGT("Auto home") -#endif -#ifndef MSG_AUTO_HOME_X - #define MSG_AUTO_HOME_X _UxGT("Home X") -#endif -#ifndef MSG_AUTO_HOME_Y - #define MSG_AUTO_HOME_Y _UxGT("Home Y") -#endif -#ifndef MSG_AUTO_HOME_Z - #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#endif -#ifndef MSG_TMC_Z_CALIBRATION - #define MSG_TMC_Z_CALIBRATION _UxGT("Calibrate Z") -#endif -#ifndef MSG_LEVEL_BED_HOMING - #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#endif -#ifndef MSG_LEVEL_BED_WAITING - #define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") -#endif -#ifndef MSG_LEVEL_BED_NEXT_POINT - #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Next Point") -#endif -#ifndef MSG_LEVEL_BED_DONE - #define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") -#endif -#ifndef MSG_Z_FADE_HEIGHT - #define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#endif -#ifndef MSG_SET_HOME_OFFSETS - #define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#endif -#ifndef MSG_HOME_OFFSETS_APPLIED - #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#endif -#ifndef MSG_SET_ORIGIN - #define MSG_SET_ORIGIN _UxGT("Set origin") -#endif -#ifndef MSG_PREHEAT_1 - #define MSG_PREHEAT_1 _UxGT("Preheat PLA") -#endif -#ifndef MSG_PREHEAT_1_N - #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_1_ALL - #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_1_END - #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_1_BEDONLY - #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_1_SETTINGS - #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#endif -#ifndef MSG_PREHEAT_2 - #define MSG_PREHEAT_2 _UxGT("Preheat ABS") -#endif -#ifndef MSG_PREHEAT_2_N - #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_2_ALL - #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_2_END - #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_2_BEDONLY - #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_2_SETTINGS - #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#endif -#ifndef MSG_COOLDOWN - #define MSG_COOLDOWN _UxGT("Cooldown") -#endif -#ifndef MSG_SWITCH_PS_ON - #define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#endif -#ifndef MSG_SWITCH_PS_OFF - #define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#endif -#ifndef MSG_EXTRUDE - #define MSG_EXTRUDE _UxGT("Extrude") -#endif -#ifndef MSG_RETRACT - #define MSG_RETRACT _UxGT("Retract") -#endif -#ifndef MSG_MOVE_AXIS - #define MSG_MOVE_AXIS _UxGT("Move axis") -#endif -#ifndef MSG_BED_LEVELING - #define MSG_BED_LEVELING _UxGT("Bed Leveling") -#endif -#ifndef MSG_LEVEL_BED - #define MSG_LEVEL_BED _UxGT("Level bed") -#endif -#ifndef MSG_LEVEL_CORNERS - #define MSG_LEVEL_CORNERS _UxGT("Level corners") -#endif -#ifndef MSG_NEXT_CORNER - #define MSG_NEXT_CORNER _UxGT("Next corner") -#endif -#ifndef MSG_EDITING_STOPPED - #define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -#endif -#ifndef MSG_USER_MENU - #define MSG_USER_MENU _UxGT("Custom Commands") -#endif -#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 -#ifndef MSG_UBL_LEVEL_BED - #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_UBL_MANUAL_MESH - #define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") -#endif -#ifndef MSG_UBL_BC_INSERT - #define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#endif -#ifndef MSG_UBL_BC_INSERT2 - #define MSG_UBL_BC_INSERT2 _UxGT("Measure") -#endif -#ifndef MSG_UBL_BC_REMOVE - #define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -#endif -#ifndef MSG_UBL_MOVING_TO_NEXT - #define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#endif -#ifndef MSG_UBL_ACTIVATE_MESH - #define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL") -#endif -#ifndef MSG_UBL_DEACTIVATE_MESH - #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") -#endif -#ifndef MSG_UBL_SET_BED_TEMP - #define MSG_UBL_SET_BED_TEMP _UxGT("Bed Temp") -#endif -#ifndef MSG_UBL_CUSTOM_BED_TEMP - #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#endif -#ifndef MSG_UBL_SET_HOTEND_TEMP - #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp") -#endif -#ifndef MSG_UBL_CUSTOM_HOTEND_TEMP - #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#endif -#ifndef MSG_UBL_MESH_EDIT - #define MSG_UBL_MESH_EDIT _UxGT("Mesh Edit") -#endif -#ifndef MSG_UBL_EDIT_CUSTOM_MESH - #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -#endif -#ifndef MSG_UBL_FINE_TUNE_MESH - #define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#endif -#ifndef MSG_UBL_DONE_EDITING_MESH - #define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") -#endif -#ifndef MSG_UBL_BUILD_CUSTOM_MESH - #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#endif -#ifndef MSG_UBL_BUILD_MESH_MENU - #define MSG_UBL_BUILD_MESH_MENU _UxGT("Build Mesh") -#endif -#ifndef MSG_UBL_BUILD_PLA_MESH - #define MSG_UBL_BUILD_PLA_MESH _UxGT("Build PLA Mesh") -#endif -#ifndef MSG_UBL_BUILD_ABS_MESH - #define MSG_UBL_BUILD_ABS_MESH _UxGT("Build ABS Mesh") -#endif -#ifndef MSG_UBL_BUILD_COLD_MESH - #define MSG_UBL_BUILD_COLD_MESH _UxGT("Build Cold Mesh") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_ADJUST - #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Adjust Mesh Height") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_AMOUNT - #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#endif -#ifndef MSG_UBL_VALIDATE_MESH_MENU - #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validate Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_PLA_MESH - #define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Validate PLA Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_ABS_MESH - #define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Validate ABS Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_CUSTOM_MESH - #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#endif -#ifndef MSG_UBL_CONTINUE_MESH - #define MSG_UBL_CONTINUE_MESH _UxGT("Continue Bed Mesh") -#endif -#ifndef MSG_UBL_MESH_LEVELING - #define MSG_UBL_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_UBL_3POINT_MESH_LEVELING - #define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_UBL_GRID_MESH_LEVELING - #define MSG_UBL_GRID_MESH_LEVELING _UxGT("Grid Mesh Leveling") -#endif -#ifndef MSG_UBL_MESH_LEVEL - #define MSG_UBL_MESH_LEVEL _UxGT("Level Mesh") -#endif -#ifndef MSG_UBL_SIDE_POINTS - #define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#endif -#ifndef MSG_UBL_MAP_TYPE - #define MSG_UBL_MAP_TYPE _UxGT("Map Type") -#endif -#ifndef MSG_UBL_OUTPUT_MAP - #define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_HOST - #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_CSV - #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_BACKUP - #define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -#endif -#ifndef MSG_UBL_INFO_UBL - #define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#endif -#ifndef MSG_UBL_EDIT_MESH_MENU - #define MSG_UBL_EDIT_MESH_MENU _UxGT("Edit Mesh") -#endif -#ifndef MSG_UBL_FILLIN_AMOUNT - #define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -#endif -#ifndef MSG_UBL_MANUAL_FILLIN - #define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -#endif -#ifndef MSG_UBL_SMART_FILLIN - #define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -#endif -#ifndef MSG_UBL_FILLIN_MESH - #define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -#endif -#ifndef MSG_UBL_INVALIDATE_ALL - #define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -#endif -#ifndef MSG_UBL_INVALIDATE_CLOSEST - #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -#endif -#ifndef MSG_UBL_FINE_TUNE_ALL - #define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -#endif -#ifndef MSG_UBL_FINE_TUNE_CLOSEST - #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -#endif -#ifndef MSG_UBL_STORAGE_MESH_MENU - #define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -#endif -#ifndef MSG_UBL_STORAGE_SLOT - #define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#endif -#ifndef MSG_UBL_LOAD_MESH - #define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -#endif -#ifndef MSG_UBL_SAVE_MESH - #define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -#endif -#ifndef MSG_MESH_LOADED - #define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -#endif -#ifndef MSG_MESH_SAVED - #define MSG_MESH_SAVED _UxGT("Mesh %i saved") -#endif -#ifndef MSG_NO_STORAGE - #define MSG_NO_STORAGE _UxGT("No storage") -#endif -#ifndef MSG_UBL_SAVE_ERROR - #define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -#endif -#ifndef MSG_UBL_RESTORE_ERROR - #define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -#endif -#ifndef MSG_UBL_Z_OFFSET_STOPPED - #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -#endif -#ifndef MSG_UBL_STEP_BY_STEP_MENU - #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#endif - -#ifndef MSG_LED_CONTROL - #define MSG_LED_CONTROL _UxGT("LED Control") -#endif -#ifndef MSG_LEDS - #define MSG_LEDS _UxGT("Lights") -#endif -#ifndef MSG_LED_PRESETS - #define MSG_LED_PRESETS _UxGT("Light Presets") -#endif -#ifndef MSG_SET_LEDS_RED - #define MSG_SET_LEDS_RED _UxGT("Red") -#endif -#ifndef MSG_SET_LEDS_ORANGE - #define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#endif -#ifndef MSG_SET_LEDS_YELLOW - #define MSG_SET_LEDS_YELLOW _UxGT("Yellow") -#endif -#ifndef MSG_SET_LEDS_GREEN - #define MSG_SET_LEDS_GREEN _UxGT("Green") -#endif -#ifndef MSG_SET_LEDS_BLUE - #define MSG_SET_LEDS_BLUE _UxGT("Blue") -#endif -#ifndef MSG_SET_LEDS_INDIGO - #define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#endif -#ifndef MSG_SET_LEDS_VIOLET - #define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#endif -#ifndef MSG_SET_LEDS_WHITE - #define MSG_SET_LEDS_WHITE _UxGT("White") -#endif -#ifndef MSG_SET_LEDS_DEFAULT - #define MSG_SET_LEDS_DEFAULT _UxGT("Default") -#endif -#ifndef MSG_CUSTOM_LEDS - #define MSG_CUSTOM_LEDS _UxGT("Custom Lights") -#endif -#ifndef MSG_INTENSITY_R - #define MSG_INTENSITY_R _UxGT("Red Intensity") -#endif -#ifndef MSG_INTENSITY_G - #define MSG_INTENSITY_G _UxGT("Green Intensity") -#endif -#ifndef MSG_INTENSITY_B - #define MSG_INTENSITY_B _UxGT("Blue Intensity") -#endif -#ifndef MSG_INTENSITY_W - #define MSG_INTENSITY_W _UxGT("White Intensity") -#endif -#ifndef MSG_LED_BRIGHTNESS - #define MSG_LED_BRIGHTNESS _UxGT("Brightness") -#endif - -#ifndef MSG_MOVING - #define MSG_MOVING _UxGT("Moving...") -#endif -#ifndef MSG_FREE_XY - #define MSG_FREE_XY _UxGT("Free XY") -#endif -#ifndef MSG_MOVE_X - #define MSG_MOVE_X _UxGT("Move X") -#endif -#ifndef MSG_MOVE_Y - #define MSG_MOVE_Y _UxGT("Move Y") -#endif -#ifndef MSG_MOVE_Z - #define MSG_MOVE_Z _UxGT("Move Z") -#endif -#ifndef MSG_MOVE_E - #define MSG_MOVE_E _UxGT("Extruder") -#endif -#ifndef MSG_MOVE_01MM - #define MSG_MOVE_01MM _UxGT("Move 0.1mm") -#endif -#ifndef MSG_MOVE_1MM - #define MSG_MOVE_1MM _UxGT("Move 1mm") -#endif -#ifndef MSG_MOVE_10MM - #define MSG_MOVE_10MM _UxGT("Move 10mm") -#endif -#ifndef MSG_SPEED - #define MSG_SPEED _UxGT("Speed") -#endif -#ifndef MSG_BED_Z - #define MSG_BED_Z _UxGT("Bed Z") -#endif -#ifndef MSG_NOZZLE - #define MSG_NOZZLE _UxGT("Nozzle") -#endif -#ifndef MSG_BED - #define MSG_BED _UxGT("Bed") -#endif -#ifndef MSG_FAN_SPEED - #define MSG_FAN_SPEED _UxGT("Fan speed") -#endif -#ifndef MSG_EXTRA_FAN_SPEED - #define MSG_EXTRA_FAN_SPEED _UxGT("Extra fan speed") -#endif -#ifndef MSG_FLOW - #define MSG_FLOW _UxGT("Flow") -#endif -#ifndef MSG_CONTROL - #define MSG_CONTROL _UxGT("Control") -#endif -#ifndef MSG_MIN - #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#endif -#ifndef MSG_MAX - #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#endif -#ifndef MSG_FACTOR - #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#endif -#ifndef MSG_AUTOTEMP - #define MSG_AUTOTEMP _UxGT("Autotemp") -#endif -#ifndef MSG_ON - #define MSG_ON _UxGT("On ") -#endif -#ifndef MSG_OFF - #define MSG_OFF _UxGT("Off") -#endif -#ifndef MSG_PID_P - #define MSG_PID_P _UxGT("PID-P") -#endif -#ifndef MSG_PID_I - #define MSG_PID_I _UxGT("PID-I") -#endif -#ifndef MSG_PID_D - #define MSG_PID_D _UxGT("PID-D") -#endif -#ifndef MSG_PID_C - #define MSG_PID_C _UxGT("PID-C") -#endif -#ifndef MSG_SELECT - #define MSG_SELECT _UxGT("Select") -#endif -#ifndef MSG_ACC - #define MSG_ACC _UxGT("Accel") -#endif -#ifndef MSG_JERK - #define MSG_JERK _UxGT("Jerk") -#endif -#if IS_KINEMATIC - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Va-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vb-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vc-jerk") - #endif -#else - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Vx-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vy-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vz-jerk") - #endif -#endif -#ifndef MSG_VE_JERK - #define MSG_VE_JERK _UxGT("Ve-jerk") -#endif -#ifndef MSG_JUNCTION_DEVIATION - #define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#endif -#ifndef MSG_VELOCITY - #define MSG_VELOCITY _UxGT("Velocity") -#endif -#ifndef MSG_VMAX - #define MSG_VMAX _UxGT("Vmax ") -#endif -#ifndef MSG_VMIN - #define MSG_VMIN _UxGT("Vmin") -#endif -#ifndef MSG_VTRAV_MIN - #define MSG_VTRAV_MIN _UxGT("VTrav min") -#endif -#ifndef MSG_ACCELERATION - #define MSG_ACCELERATION _UxGT("Acceleration") -#endif -#ifndef MSG_AMAX - #define MSG_AMAX _UxGT("Amax ") -#endif -#ifndef MSG_A_RETRACT - #define MSG_A_RETRACT _UxGT("A-retract") -#endif -#ifndef MSG_A_TRAVEL - #define MSG_A_TRAVEL _UxGT("A-travel") -#endif -#ifndef MSG_STEPS_PER_MM - #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#endif -#if IS_KINEMATIC - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Asteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Csteps/mm") - #endif -#else - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Zsteps/mm") - #endif -#endif -#ifndef MSG_ESTEPS - #define MSG_ESTEPS _UxGT("Esteps/mm") -#endif -#ifndef MSG_E1STEPS - #define MSG_E1STEPS _UxGT("E1steps/mm") -#endif -#ifndef MSG_E2STEPS - #define MSG_E2STEPS _UxGT("E2steps/mm") -#endif -#ifndef MSG_E3STEPS - #define MSG_E3STEPS _UxGT("E3steps/mm") -#endif -#ifndef MSG_E4STEPS - #define MSG_E4STEPS _UxGT("E4steps/mm") -#endif -#ifndef MSG_E5STEPS - #define MSG_E5STEPS _UxGT("E5steps/mm") -#endif -#ifndef MSG_TEMPERATURE - #define MSG_TEMPERATURE _UxGT("Temperature") -#endif -#ifndef MSG_MOTION - #define MSG_MOTION _UxGT("Motion") -#endif -#ifndef MSG_FILAMENT - #define MSG_FILAMENT _UxGT("Filament") -#endif -#ifndef MSG_VOLUMETRIC_ENABLED - #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#endif -#ifndef MSG_FILAMENT_DIAM - #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#endif -#ifndef MSG_FILAMENT_UNLOAD - #define MSG_FILAMENT_UNLOAD _UxGT("Unload mm") -#endif -#ifndef MSG_FILAMENT_LOAD - #define MSG_FILAMENT_LOAD _UxGT("Load mm") -#endif -#ifndef MSG_ADVANCE_K - #define MSG_ADVANCE_K _UxGT("Advance K") -#endif -#ifndef MSG_CONTRAST - #define MSG_CONTRAST _UxGT("LCD contrast") -#endif -#ifndef MSG_STORE_EEPROM - #define MSG_STORE_EEPROM _UxGT("Store settings") -#endif -#ifndef MSG_LOAD_EEPROM - #define MSG_LOAD_EEPROM _UxGT("Load settings") -#endif -#ifndef MSG_RESTORE_FAILSAFE - #define MSG_RESTORE_FAILSAFE _UxGT("Restore failsafe") -#endif -#ifndef MSG_INIT_EEPROM - #define MSG_INIT_EEPROM _UxGT("Initialize EEPROM") -#endif -#ifndef MSG_REFRESH - #define MSG_REFRESH _UxGT("Refresh") -#endif -#ifndef MSG_WATCH - #define MSG_WATCH _UxGT("Info screen") -#endif -#ifndef MSG_PREPARE - #define MSG_PREPARE _UxGT("Prepare") -#endif -#ifndef MSG_TUNE - #define MSG_TUNE _UxGT("Tune") -#endif -#ifndef MSG_PAUSE_PRINT - #define MSG_PAUSE_PRINT _UxGT("Pause print") -#endif -#ifndef MSG_RESUME_PRINT - #define MSG_RESUME_PRINT _UxGT("Resume print") -#endif -#ifndef MSG_STOP_PRINT - #define MSG_STOP_PRINT _UxGT("Stop print") -#endif -#ifndef MSG_POWER_LOSS_RECOVERY - #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") -#endif -#ifndef MSG_CARD_MENU - #define MSG_CARD_MENU _UxGT("Print from SD") -#endif -#ifndef MSG_NO_CARD - #define MSG_NO_CARD _UxGT("No SD card") -#endif -#ifndef MSG_DWELL - #define MSG_DWELL _UxGT("Sleep...") -#endif -#ifndef MSG_USERWAIT - #define MSG_USERWAIT _UxGT("Click to resume...") -#endif -#ifndef MSG_PRINT_PAUSED - #define MSG_PRINT_PAUSED _UxGT("Print paused") -#endif -#ifndef MSG_PRINTING - #define MSG_PRINTING _UxGT("Printing...") -#endif -#ifndef MSG_PRINT_ABORTED - #define MSG_PRINT_ABORTED _UxGT("Print aborted") -#endif -#ifndef MSG_NO_MOVE - #define MSG_NO_MOVE _UxGT("No move.") -#endif -#ifndef MSG_KILLED - #define MSG_KILLED _UxGT("KILLED. ") -#endif -#ifndef MSG_STOPPED - #define MSG_STOPPED _UxGT("STOPPED. ") -#endif -#ifndef MSG_CONTROL_RETRACT - #define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#endif -#ifndef MSG_CONTROL_RETRACT_SWAP - #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#endif -#ifndef MSG_CONTROL_RETRACTF - #define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#endif -#ifndef MSG_CONTROL_RETRACT_ZLIFT - #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER - #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAP - #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVERF - #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAPF - #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#endif -#ifndef MSG_AUTORETRACT - #define MSG_AUTORETRACT _UxGT("AutoRetr.") -#endif -#ifndef MSG_FILAMENTCHANGE - #define MSG_FILAMENTCHANGE _UxGT("Change filament") -#endif -#ifndef MSG_FILAMENTLOAD - #define MSG_FILAMENTLOAD _UxGT("Load filament") -#endif -#ifndef MSG_FILAMENTUNLOAD - #define MSG_FILAMENTUNLOAD _UxGT("Unload filament") -#endif -#ifndef MSG_FILAMENTUNLOAD_ALL - #define MSG_FILAMENTUNLOAD_ALL _UxGT("Unload All") -#endif -#ifndef MSG_INIT_SDCARD - #define MSG_INIT_SDCARD _UxGT("Init. SD card") -#endif -#ifndef MSG_CNG_SDCARD - #define MSG_CNG_SDCARD _UxGT("Change SD card") -#endif -#ifndef MSG_ZPROBE_OUT - #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") -#endif -#ifndef MSG_SKEW_FACTOR - #define MSG_SKEW_FACTOR _UxGT("Skew Factor") -#endif -#ifndef MSG_BLTOUCH - #define MSG_BLTOUCH _UxGT("BLTouch") -#endif -#ifndef MSG_BLTOUCH_SELFTEST - #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#endif -#ifndef MSG_BLTOUCH_RESET - #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#endif -#ifndef MSG_BLTOUCH_DEPLOY - #define MSG_BLTOUCH_DEPLOY _UxGT("Deploy BLTouch") -#endif -#ifndef MSG_BLTOUCH_STOW - #define MSG_BLTOUCH_STOW _UxGT("Stow BLTouch") -#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") -#endif -#ifndef MSG_ZPROBE_ZOFFSET - #define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") -#endif -#ifndef MSG_BABYSTEP_X - #define MSG_BABYSTEP_X _UxGT("Babystep X") -#endif -#ifndef MSG_BABYSTEP_Y - #define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#endif -#ifndef MSG_BABYSTEP_Z - #define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#endif -#ifndef MSG_ENDSTOP_ABORT - #define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#endif -#ifndef MSG_HEATING_FAILED_LCD - #define MSG_HEATING_FAILED_LCD _UxGT("Heating failed") -#endif -#ifndef MSG_HEATING_FAILED_LCD_BED - #define MSG_HEATING_FAILED_LCD_BED _UxGT("Bed heating failed") -#endif -#ifndef MSG_ERR_REDUNDANT_TEMP - #define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#endif -#ifndef MSG_THERMAL_RUNAWAY - #define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#endif -#ifndef MSG_THERMAL_RUNAWAY_BED - #define MSG_THERMAL_RUNAWAY_BED _UxGT("BED THERMAL RUNAWAY") -#endif -#ifndef MSG_ERR_MAXTEMP - #define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#endif -#ifndef MSG_ERR_MINTEMP - #define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") -#endif -#ifndef MSG_ERR_MAXTEMP_BED - #define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") -#endif -#ifndef MSG_ERR_MINTEMP_BED - #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#endif -#ifndef MSG_ERR_Z_HOMING - #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#endif -#ifndef MSG_HALTED - #define MSG_HALTED _UxGT("PRINTER HALTED") -#endif -#ifndef MSG_PLEASE_RESET - #define MSG_PLEASE_RESET _UxGT("Please reset") -#endif -#ifndef MSG_SHORT_DAY - #define MSG_SHORT_DAY _UxGT("d") // One character only -#endif -#ifndef MSG_SHORT_HOUR - #define MSG_SHORT_HOUR _UxGT("h") // One character only -#endif -#ifndef MSG_SHORT_MINUTE - #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#endif -#ifndef MSG_HEATING - #define MSG_HEATING _UxGT("Heating...") -#endif -#ifndef MSG_COOLING - #define MSG_COOLING _UxGT("Cooling...") -#endif -#ifndef MSG_BED_HEATING - #define MSG_BED_HEATING _UxGT("Bed heating...") -#endif -#ifndef MSG_BED_COOLING - #define MSG_BED_COOLING _UxGT("Bed cooling...") -#endif -#ifndef MSG_DELTA_CALIBRATE - #define MSG_DELTA_CALIBRATE _UxGT("Delta Calibration") -#endif -#ifndef MSG_DELTA_CALIBRATE_X - #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrate X") -#endif -#ifndef MSG_DELTA_CALIBRATE_Y - #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrate Y") -#endif -#ifndef MSG_DELTA_CALIBRATE_Z - #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrate Z") -#endif -#ifndef MSG_DELTA_CALIBRATE_CENTER - #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center") -#endif -#ifndef MSG_DELTA_SETTINGS - #define MSG_DELTA_SETTINGS _UxGT("Delta Settings") -#endif -#ifndef MSG_DELTA_AUTO_CALIBRATE - #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibration") -#endif -#ifndef MSG_DELTA_HEIGHT_CALIBRATE - #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Set Delta Height") -#endif -#ifndef MSG_DELTA_Z_OFFSET_CALIBRATE - #define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Probe Z-offset") -#endif -#ifndef MSG_DELTA_DIAG_ROD - #define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#endif -#ifndef MSG_DELTA_HEIGHT - #define MSG_DELTA_HEIGHT _UxGT("Height") -#endif -#ifndef MSG_DELTA_RADIUS - #define MSG_DELTA_RADIUS _UxGT("Radius") -#endif -#ifndef MSG_INFO_MENU - #define MSG_INFO_MENU _UxGT("About Printer") -#endif -#ifndef MSG_INFO_PRINTER_MENU - #define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#endif -#ifndef MSG_3POINT_LEVELING - #define MSG_3POINT_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_LINEAR_LEVELING - #define MSG_LINEAR_LEVELING _UxGT("Linear Leveling") -#endif -#ifndef MSG_BILINEAR_LEVELING - #define MSG_BILINEAR_LEVELING _UxGT("Bilinear Leveling") -#endif -#ifndef MSG_UBL_LEVELING - #define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_MESH_LEVELING - #define MSG_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_INFO_STATS_MENU - #define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#endif -#ifndef MSG_INFO_BOARD_MENU - #define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#endif -#ifndef MSG_INFO_THERMISTOR_MENU - #define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#endif -#ifndef MSG_INFO_EXTRUDERS - #define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#endif -#ifndef MSG_INFO_BAUDRATE - #define MSG_INFO_BAUDRATE _UxGT("Baud") -#endif -#ifndef MSG_INFO_PROTOCOL - #define MSG_INFO_PROTOCOL _UxGT("Protocol") -#endif -#ifndef MSG_CASE_LIGHT - #define MSG_CASE_LIGHT _UxGT("Case light") -#endif -#ifndef MSG_CASE_LIGHT_BRIGHTNESS - #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Light BRIGHTNESS") -#endif -#if LCD_WIDTH >= 20 - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Print Count") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total print time") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest job time") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded total") - #endif -#else - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded") - #endif -#endif -#ifndef MSG_INFO_MIN_TEMP - #define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#endif -#ifndef MSG_INFO_MAX_TEMP - #define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#endif -#ifndef MSG_INFO_PSU - #define MSG_INFO_PSU _UxGT("PSU") -#endif -#ifndef MSG_DRIVE_STRENGTH - #define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") -#endif -#ifndef MSG_DAC_PERCENT - #define MSG_DAC_PERCENT _UxGT("Driver %") -#endif -#ifndef MSG_DAC_EEPROM_WRITE - #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_PAUSE - #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PRINT PAUSED") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_LOAD - #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("LOAD FILAMENT") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_UNLOAD - #define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("UNLOAD FILAMENT") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER - #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_PURGE - #define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME - #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continue") -#endif -#ifndef MSG_FILAMENT_CHANGE_NOZZLE - #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") -#endif -#ifndef MSG_ERR_HOMING_FAILED - #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") -#endif -#ifndef MSG_ERR_PROBING_FAILED - #define MSG_ERR_PROBING_FAILED _UxGT("Probing failed") -#endif -#ifndef MSG_M600_TOO_COLD - #define MSG_M600_TOO_COLD _UxGT("M600: Too cold") -#endif - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") - #endif - #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") - #endif - #ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEAT_1 - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEATING_1 - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") - #endif - #ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") - #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") - #endif -#else // LCD_HEIGHT < 4 - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...") - #endif - #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") - #endif - #ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEATING_1 - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...") - #endif - #ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") - #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") - #endif -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_EN_H diff --git a/Marlin/language_es.h b/Marlin/language_es.h deleted file mode 100644 index a4267af2b3..0000000000 --- a/Marlin/language_es.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Spanish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ES_H -#define LANGUAGE_ES_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_BACK _UxGT("Atras") -#define MSG_SD_INSERTED _UxGT("Tarjeta colocada") -#define MSG_SD_REMOVED _UxGT("Tarjeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Inicio automatico") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_DEBUG_MENU _UxGT("Menu depurar") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prueba barra avance") -#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_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelacion lista!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") -#define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#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_BEDONLY MSG_PREHEAT_1 _UxGT("Plataforma") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#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_BEDONLY MSG_PREHEAT_2 _UxGT("Plataforma") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("Config") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover ejes") -#define MSG_BED_LEVELING _UxGT("Nivelar plataforma") -#define MSG_LEVEL_BED _UxGT("Nivelar plataforma") -#define MSG_MOVING _UxGT("Moviendo...") -#define MSG_FREE_XY _UxGT("Libre XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidad") -#define MSG_BED_Z _UxGT("Plataforma Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Plataforma") -#define MSG_FAN_SPEED _UxGT("Ventilador") -#define MSG_FLOW _UxGT("Flujo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("Encender") -#define MSG_OFF _UxGT("Apagar") -#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("Seleccionar") -#define MSG_ACC _UxGT("Aceleracion") -#define MSG_JERK _UxGT("Jerk") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#elif IS_DELTA - #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("Vel. viaje min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("A pasos/deg") - #define MSG_BSTEPS _UxGT("B pasos/deg") - #define MSG_CSTEPS _UxGT("C pasos/mm") -#elif IS_DELTA - #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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#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("Informacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresion") -#define MSG_RESUME_PRINT _UxGT("Reanudar impresion") -#define MSG_STOP_PRINT _UxGT("Detener impresion") -#define MSG_CARD_MENU _UxGT("Menu de SD") -#define MSG_NO_CARD _UxGT("No hay tarjeta SD") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando ordenes") -#define MSG_PRINT_ABORTED _UxGT("Impresion cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Parada de emergencia") -#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") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") -#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_AUTORETRACT _UxGT("Retraccion Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CNG_SDCARD _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("inic.") -#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_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 Maxima") -#define MSG_ERR_MINTEMP _UxGT("Error: Temp Minima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max Plat") -#define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min Plat") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPRESORA PARADA") -#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_BED_HEATING _UxGT("Calentando Plat...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_AUTO_CALIBRATE _UxGT("Auto Calibracion") -#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_INFO_STATS_MENU _UxGT("Estadisticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. 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") - -#if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresion") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total de imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresion mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusion") -#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("Mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusion") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura minima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura maxima") -#define MSG_INFO_PSU _UxGT("Fuente de poder") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia driver") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSADA") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPC. REINICIO:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") - -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Boquilla: ") - -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el boton") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambiar") - #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("del fil. cambiar") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamento expulsado") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Cargar 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 boton 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") - -#endif // LANGUAGE_ES_H diff --git a/Marlin/language_es_utf8.h b/Marlin/language_es_utf8.h deleted file mode 100644 index a0c87452d9..0000000000 --- a/Marlin/language_es_utf8.h +++ /dev/null @@ -1,275 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Spanish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ES_UTF_H -#define LANGUAGE_ES_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_BACK _UxGT("Atrás") -#define MSG_SD_INSERTED _UxGT("Tarjeta colocada") -#define MSG_SD_REMOVED _UxGT("Tarjeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menú principal") -#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_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_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelación lista!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") -#define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#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_BEDONLY MSG_PREHEAT_1 _UxGT(" Cama") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#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_BEDONLY MSG_PREHEAT_2 _UxGT(" Cama") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Config") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#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_MOVING _UxGT("Moviendo...") -#define MSG_FREE_XY _UxGT("Libre XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidad") -#define MSG_BED_Z _UxGT("Cama Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Ventilador") -#define MSG_FLOW _UxGT("Flujo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("Encender") -#define MSG_OFF _UxGT("Apagar") -#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("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") -#define MSG_VMAX _UxGT("Vmax") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vel. viaje min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("A pasos/mm") - #define MSG_BSTEPS _UxGT("B pasos/mm") - #define MSG_CSTEPS _UxGT("Z pasos/mm") -#elif IS_DELTA - #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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#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_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#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_CARD_MENU _UxGT("Menú de SD") -#define MSG_NO_CARD _UxGT("No hay tarjeta SD") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando órdenes") -#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_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Interc. Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") -#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_AUTORETRACT _UxGT("Retracción Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CNG_SDCARD _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_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_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_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_BED_HEATING _UxGT("Calentando Cama...") -#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_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_INFO_STATS_MENU _UxGT("Estadísticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. 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") - -#if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo 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") -#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") -#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_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("IMPR. PAUSADA") -#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_NOZZLE _UxGT(" Boquilla: ") - -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el botón") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambiar") - #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("del fil. cambiar") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamento expulsado") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Cargar filamento") -#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("Extruir 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") - -#endif // LANGUAGE_ES_UTF_H diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h deleted file mode 100644 index 999855ef37..0000000000 --- a/Marlin/language_eu.h +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Basque-Euskera - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EU_H -#define LANGUAGE_EU_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prest.") -#define MSG_BACK _UxGT("Atzera") -#define MSG_SD_INSERTED _UxGT("Txartela sartuta") -#define MSG_SD_REMOVED _UxGT("Txartela kenduta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu nagusia") -#define MSG_AUTOSTART _UxGT("Auto hasiera") -#define MSG_DISABLE_STEPPERS _UxGT("Itzali motoreak") -#define MSG_DEBUG_MENU _UxGT("Arazketa Menua") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prog. Barra Proba") -#define MSG_AUTO_HOME _UxGT("Hasierara joan") -#define MSG_AUTO_HOME_X _UxGT("X jatorrira") -#define MSG_AUTO_HOME_Y _UxGT("Y jatorrira") -#define MSG_AUTO_HOME_Z _UxGT("Z jatorrira") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibratu Z") -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ hasieraratzen") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik egin hasteko") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Hurrengo Puntua") -#define MSG_LEVEL_BED_DONE _UxGT("Berdintzea eginda") -//#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#define MSG_SET_HOME_OFFSETS _UxGT("Etxe. offset eza.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsetak ezarrita") -#define MSG_SET_ORIGIN _UxGT("Hasiera ipini") -#define MSG_PREHEAT_1 _UxGT("Berotu PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Guztia") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Amaia") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") -#define MSG_PREHEAT_2 _UxGT("Berotu ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_1 _UxGT(" Guztia") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Amaia") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") -#define MSG_COOLDOWN _UxGT("Hoztu") -#define MSG_SWITCH_PS_ON _UxGT("Energia piztu") -#define MSG_SWITCH_PS_OFF _UxGT("Energia itzali") -#define MSG_EXTRUDE _UxGT("Estruitu") -#define MSG_RETRACT _UxGT("Atzera eragin") -#define MSG_MOVE_AXIS _UxGT("Ardatzak mugitu") -#define MSG_BED_LEVELING _UxGT("Ohe berdinketa") -#define MSG_LEVEL_BED _UxGT("Ohea berdindu") -#define MSG_LEVEL_CORNERS _UxGT("Ertzak berdindu") -#define MSG_NEXT_CORNER _UxGT("Hurrengo ertza") -//#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -//#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") -//#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#define MSG_UBL_BC_INSERT2 _UxGT("Neurtu") -//#define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -//#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktibatu") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL desaktibatu") -#define MSG_UBL_SET_BED_TEMP _UxGT("Ohearen tenperatura") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Mutur beroaren tenp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Sarea editatu") -//#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -//#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Sarea editatzea eginda") -//#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Sarea sortu") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("PLA sarea sortu") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("ABS sarea sortu") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Sare hotza sortu") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Sarearen altuera doitu") -//#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Sarea balioetsi") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("PLA sarea balioetsi") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("ABS sarea balioetsi") -//#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#define MSG_UBL_CONTINUE_MESH _UxGT("Ohe sarea balioetsi") -#define MSG_UBL_MESH_LEVELING _UxGT("Sare berdinketa") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Lauki-sare berdinketa") -#define MSG_UBL_MESH_LEVEL _UxGT("Sarea berdindu") -//#define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#define MSG_UBL_MAP_TYPE _UxGT("Mapa mota") -//#define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -//#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -//#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -//#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -//#define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Sarea editatu") -//#define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -//#define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -//#define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -//#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -//#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -//#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -//#define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -//#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -//#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -//#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -//#define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -//#define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -//#define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -//#define MSG_MESH_SAVED _UxGT("Mesh %i saved") -//#define MSG_NO_STORAGE _UxGT("No storage") -//#define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -//#define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -//#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -//#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#define MSG_LED_CONTROL _UxGT("LED ezarpenak") -#define MSG_LEDS _UxGT("Argiak") -#define MSG_LED_PRESETS _UxGT("Argi aurrehautaketak") -#define MSG_SET_LEDS_RED _UxGT("Gorria") -#define MSG_SET_LEDS_ORANGE _UxGT("Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Horia") -#define MSG_SET_LEDS_GREEN _UxGT("Berdea") -#define MSG_SET_LEDS_BLUE _UxGT("Urdina") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Bioleta") -#define MSG_SET_LEDS_WHITE _UxGT("Zuria") -#define MSG_SET_LEDS_DEFAULT _UxGT("Lehenetsia") -#define MSG_CUSTOM_LEDS _UxGT("Argi pertsonalizatuak") -#define MSG_INTENSITY_R _UxGT("Intentsitate gorria") -#define MSG_INTENSITY_G _UxGT("Intentsitate berdea") -#define MSG_INTENSITY_B _UxGT("Intentsitate urdina") -#define MSG_INTENSITY_W _UxGT("Intentsitate zuria") -#define MSG_LED_BRIGHTNESS _UxGT("Distira") -#define MSG_MOVING _UxGT("Mugitzen...") -#define MSG_FREE_XY _UxGT("Askatu XY") -#define MSG_MOVE_X _UxGT("Mugitu X") -#define MSG_MOVE_Y _UxGT("Mugitu Y") -#define MSG_MOVE_Z _UxGT("Mugitu Z") -#define MSG_MOVE_E _UxGT("Estrusorea") -#define MSG_MOVE_01MM _UxGT("Mugitu 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mugitu 1mm") -#define MSG_MOVE_10MM _UxGT("Mugitu 10mm") -#define MSG_SPEED _UxGT("Abiadura") -#define MSG_BED_Z _UxGT("Z Ohea") -#define MSG_NOZZLE _UxGT("Pita") -#define MSG_BED _UxGT("Ohea") -#define MSG_FAN_SPEED _UxGT("Haizagailu abiadura") -#define MSG_EXTRA_FAN_SPEED _UxGT("Haiz.gehig. abiadura") -#define MSG_FLOW _UxGT("Fluxua") -#define MSG_CONTROL _UxGT("Kontrola") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Auto tenperatura") -#define MSG_ON _UxGT("On ") -#define MSG_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("Aukeratu") -#define MSG_ACC _UxGT("Azelerazioa") -#define MSG_JERK _UxGT("Astindua") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-astindua") - #define MSG_VB_JERK _UxGT("Vb-astindua") - #define MSG_VC_JERK _UxGT("Vc-astindua") -#else - #define MSG_VA_JERK _UxGT("Vx-astindua") - #define MSG_VB_JERK _UxGT("Vy-astindua") - #define MSG_VC_JERK _UxGT("Vz-astindua") -#endif -#define MSG_VE_JERK _UxGT("Ve-astindua") -//#define MSG_VELOCITY _UxGT("Velocity") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VBidaia min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-bidaia") -#define MSG_STEPS_PER_MM _UxGT("Pausoak/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pausoak/mm") - #define MSG_BSTEPS _UxGT("B pausoak/mm") - #define MSG_CSTEPS _UxGT("C pausoak/mm") -#else - #define MSG_ASTEPS _UxGT("X pausoak/mm") - #define MSG_BSTEPS _UxGT("Y pausoak/mm") - #define MSG_CSTEPS _UxGT("Z pausoak/mm") -#endif -#define MSG_ESTEPS _UxGT("E pausoak/mm") -#define MSG_E1STEPS _UxGT("E1 pausoak/mm") -#define MSG_E2STEPS _UxGT("E2 pausoak/mm") -#define MSG_E3STEPS _UxGT("E3 pausoak/mm") -#define MSG_E4STEPS _UxGT("E4 pausoak/mm") -#define MSG_E5STEPS _UxGT("E5 pausoak/mm") -#define MSG_TEMPERATURE _UxGT("Tenperatura") -#define MSG_MOTION _UxGT("Mugimendua") -#define MSG_FILAMENT _UxGT("Harizpia") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E mm3-tan") -#define MSG_FILAMENT_DIAM _UxGT("Hariz. Dia.") -#define MSG_FILAMENT_UNLOAD _UxGT("Deskargatu mm") -#define MSG_FILAMENT_LOAD _UxGT("Kargatu mm") -#define MSG_ADVANCE_K _UxGT("K Aurrerapena") -#define MSG_CONTRAST _UxGT("LCD kontrastea") -#define MSG_STORE_EEPROM _UxGT("Gorde memoria") -#define MSG_LOAD_EEPROM _UxGT("Kargatu memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Larri. berriz.") -#define MSG_INIT_EEPROM _UxGT("EEPROM-a hasieratu") -#define MSG_REFRESH _UxGT("Berriz kargatu") -#define MSG_WATCH _UxGT("Pantaila info") -#define MSG_PREPARE _UxGT("Prestatu") -#define MSG_TUNE _UxGT("Doitu") -#define MSG_PAUSE_PRINT _UxGT("Pausatu inprimak.") -#define MSG_RESUME_PRINT _UxGT("Jarraitu inprima.") -#define MSG_STOP_PRINT _UxGT("Gelditu inprima.") -#define MSG_CARD_MENU _UxGT("SD-tik inprimatu") -#define MSG_NO_CARD _UxGT("Ez dago SD-rik") -#define MSG_DWELL _UxGT("Lo egin...") -#define MSG_USERWAIT _UxGT("Aginduak zain...") -#define MSG_PRINT_PAUSED _UxGT("Inprim. geldi.") -#define MSG_PRINT_ABORTED _UxGT("Inprim. deusezta.") -#define MSG_NO_MOVE _UxGT("Mugimendu gabe.") -#define MSG_KILLED _UxGT("AKABATUTA. ") -#define MSG_STOPPED _UxGT("GELDITUTA. ") -#define MSG_CONTROL_RETRACT _UxGT("Atzera egin mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Atzera mm") -#define MSG_CONTROL_RETRACTF _UxGT("Atzera egin V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Igo mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Atzera egin mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap Atzera mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Atzera egin V") -//#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("Atzera egin") -#define MSG_FILAMENTCHANGE _UxGT("Aldatu harizpia") -#define MSG_FILAMENTLOAD _UxGT("Harizpia kargatu") -#define MSG_FILAMENTUNLOAD _UxGT("Harizpia deskargatu") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Erabat deskargatu") -#define MSG_INIT_SDCARD _UxGT("Hasieratu SD-a") -#define MSG_CNG_SDCARD _UxGT("Aldatu txartela") -#define MSG_ZPROBE_OUT _UxGT("Z zunda kanpora") -#define MSG_SKEW_FACTOR _UxGT("Okertze faktorea") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch AutoProba") -#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_ZPROBE_ZOFFSET _UxGT("Z Konpentsatu") -#define MSG_BABYSTEP_X _UxGT("Mikro-urratsa X") -#define MSG_BABYSTEP_Y _UxGT("Mikro-urratsa Y") -#define MSG_BABYSTEP_Z _UxGT("Mikro-urratsa Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop deusezta.") -#define MSG_HEATING_FAILED_LCD _UxGT("Err: Beroketa") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: Tenperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("TENP. KONTROL EZA") -#define MSG_ERR_MAXTEMP _UxGT("Err: Tenp Maximoa") -#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_HALTED _UxGT("INPRIMA. GELDIRIK") -#define MSG_PLEASE_RESET _UxGT("Berrabia. Mesedez") -#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("Berotzen...") -#define MSG_BED_HEATING _UxGT("Ohea Berotzen...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibraketa") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibratu X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibratu Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibratu Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibratu Zentrua") -#define MSG_DELTA_SETTINGS _UxGT("Delta ezarpenak") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Kalibraketa") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Alt. Ezar.") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra diagonala") -#define MSG_DELTA_HEIGHT _UxGT("Altuera") -#define MSG_DELTA_RADIUS _UxGT("Erradioa") -#define MSG_INFO_MENU _UxGT("Inprimagailu Inf.") -#define MSG_INFO_PRINTER_MENU _UxGT("Inprimagailu Inf.") -#define MSG_3POINT_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_LINEAR_LEVELING _UxGT("Berdinketa lineala") -#define MSG_BILINEAR_LEVELING _UxGT("Berdinketa bilinearra") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Sare berdinketa") -#define MSG_INFO_STATS_MENU _UxGT("Inprima. estatis.") -#define MSG_INFO_BOARD_MENU _UxGT("Txartelaren Info.") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistoreak") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusoreak") -#define MSG_INFO_BAUDRATE _UxGT("Baudioak") -#define MSG_INFO_PROTOCOL _UxGT("Protokoloa") -#define MSG_CASE_LIGHT _UxGT("Kabina Argia") -//#define MSG_CASE_LIGHT_BRIGHTNESS -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Inprim. Zenbaketa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Inprim. denbora") - #define MSG_INFO_PRINT_LONGEST _UxGT("Imprimatze luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruituta guztira") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Inprimatze") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Guztira") - #define MSG_INFO_PRINT_LONGEST _UxGT("Luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estrusio") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Tenp. Minimoa") -#define MSG_INFO_MAX_TEMP _UxGT("Tenp. Maximoa") -#define MSG_INFO_PSU _UxGT("Elikadura-iturria") -#define MSG_DRIVE_STRENGTH _UxGT("Driver-aren potentzia") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Idatzi DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("HARIZPIA ALDATU") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("HARIZPIA KARGATU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("HARIZPIA DESKARGATU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ALDAKETA AUKERAK:") -//#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Inprima. jarraitu") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Pita: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Hasi. huts egin du") -#define MSG_ERR_PROBING_FAILED _UxGT("Neurketak huts egin du") -#define MSG_M600_TOO_COLD _UxGT("M600: hotzegi") -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 -// #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") -// #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") -// #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") -// #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") -// #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") -// #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") -// #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") -// #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") -// #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") -// #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") -// #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") -// #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") -// #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Mesedez, itxaron...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Deskargatzen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Sartu eta click egin") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Berotzen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Kargatzen...") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_EU_H diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h deleted file mode 100644 index 4e26bdb2b3..0000000000 --- a/Marlin/language_fi.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Finnish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FI_H -#define LANGUAGE_FI_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" valmis.") -#define MSG_SD_INSERTED _UxGT("Kortti asetettu") -#define MSG_SD_REMOVED _UxGT("Kortti poistettu") -#define MSG_MAIN _UxGT("Palaa") -#define MSG_AUTOSTART _UxGT("Automaatti") -#define MSG_DISABLE_STEPPERS _UxGT("Vapauta moottorit") -#define MSG_AUTO_HOME _UxGT("Aja referenssiin") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibroi Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") -#define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") -#define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#define MSG_SET_ORIGIN _UxGT("Aseta origo") -#define MSG_PREHEAT_1 _UxGT("Esilämmitä PLA") -#define MSG_PREHEAT_1_N _UxGT("Esilämmitä PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Esilä. PLA Kaikki") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Esilä. PLA Alusta") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Esilämm. PLA konf") -#define MSG_PREHEAT_2 _UxGT("Esilämmitä ABS") -#define MSG_PREHEAT_2_N _UxGT("Esilämmitä ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Esilä. ABS Kaikki") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Esilä. ABS Alusta") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Esilämm. ABS konf") -#define MSG_COOLDOWN _UxGT("Jäähdytä") -#define MSG_SWITCH_PS_ON _UxGT("Virta päälle") -#define MSG_SWITCH_PS_OFF _UxGT("Virta pois") -#define MSG_EXTRUDE _UxGT("Pursota") -#define MSG_RETRACT _UxGT("Vedä takaisin") -#define MSG_MOVE_AXIS _UxGT("Liikuta akseleita") -#define MSG_MOVE_X _UxGT("Liikuta X") -#define MSG_MOVE_Y _UxGT("Liikuta Y") -#define MSG_MOVE_Z _UxGT("Liikuta Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Liikuta 0.1mm") -#define MSG_MOVE_1MM _UxGT("Liikuta 1mm") -#define MSG_MOVE_10MM _UxGT("Liikuta 10mm") -#define MSG_SPEED _UxGT("Nopeus") -#define MSG_NOZZLE _UxGT("Suutin") -#define MSG_BED _UxGT("Alusta") -#define MSG_FAN_SPEED _UxGT("Tuul. nopeus") -#define MSG_FLOW _UxGT("Virtaus") -#define MSG_CONTROL _UxGT("Kontrolli") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Kerr") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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_ACC _UxGT("Kiihtyv") -#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("VLiike min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-peruuta") -#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_TEMPERATURE _UxGT("Lämpötila") -#define MSG_MOTION _UxGT("Liike") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrasti") -#define MSG_STORE_EEPROM _UxGT("Tallenna muistiin") -#define MSG_LOAD_EEPROM _UxGT("Lataa muistista") -#define MSG_RESTORE_FAILSAFE _UxGT("Palauta oletus") -#define MSG_REFRESH _UxGT("Päivitä") -#define MSG_WATCH _UxGT("Seuraa") -#define MSG_PREPARE _UxGT("Valmistele") -#define MSG_TUNE _UxGT("Säädä") -#define MSG_PAUSE_PRINT _UxGT("Keskeytä tulostus") -#define MSG_RESUME_PRINT _UxGT("Jatka tulostusta") -#define MSG_STOP_PRINT _UxGT("Pysäytä tulostus") -#define MSG_CARD_MENU _UxGT("Korttivalikko") -#define MSG_NO_CARD _UxGT("Ei korttia") -#define MSG_DWELL _UxGT("Nukkumassa...") -#define MSG_USERWAIT _UxGT("Odotet. valintaa") -#define MSG_PRINT_ABORTED _UxGT("Print aborted") -#define MSG_NO_MOVE _UxGT("Ei liiketta.") -#define MSG_KILLED _UxGT("KILLED. ") -#define MSG_STOPPED _UxGT("STOPPED. ") -#define MSG_CONTROL_RETRACT _UxGT("Vedä mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Va. Vedä mm") -#define MSG_CONTROL_RETRACTF _UxGT("Vedä V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Va. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoVeto.") -#define MSG_FILAMENTCHANGE _UxGT("Change filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD-Card") -#define MSG_CNG_SDCARD _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_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_DELTA_CALIBRATE _UxGT("Delta Kalibrointi") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibroi X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibroi Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibroi Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibroi Center") - -#endif // LANGUAGE_FI_H diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h deleted file mode 100644 index eda672f0da..0000000000 --- a/Marlin/language_fr.h +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * French - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FR_H -#define LANGUAGE_FR_H - -#define MAPPER_NON -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prete.") -#define MSG_BACK _UxGT("Retour") -#define MSG_SD_INSERTED _UxGT("Carte inseree") -#define MSG_SD_REMOVED _UxGT("Carte retiree") -#define MSG_LCD_ENDSTOPS _UxGT("Butees") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Demarrage auto") -#define MSG_DISABLE_STEPPERS _UxGT("Arreter moteurs") -#define MSG_DEBUG_MENU _UxGT("Menu debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") -#define MSG_AUTO_HOME _UxGT("Origine auto.") -#define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") -#define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") -#define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") -#define MSG_LEVEL_BED_DONE _UxGT("Mise a niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissee") -#define MSG_SET_HOME_OFFSETS _UxGT("Regl. decal. origine") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalages appliques") -#define MSG_SET_ORIGIN _UxGT("Regler origine") -#define MSG_PREHEAT_1 _UxGT("Prechauffage PLA") -#define MSG_PREHEAT_1_N _UxGT("Prechauff. PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Prech. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Prech. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Regl. prech. PLA") -#define MSG_PREHEAT_2 _UxGT("Prechauffage ABS") -#define MSG_PREHEAT_2_N _UxGT("Prechauff. ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Prech. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Prech. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Regl. prech. ABS") -#define MSG_COOLDOWN _UxGT("Refroidir") -#define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") -#define MSG_MOVE_AXIS _UxGT("Deplacer un axe") -#define MSG_BED_LEVELING _UxGT("Regl. Niv. lit") -#define MSG_LEVEL_BED _UxGT("Regl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") -#define MSG_EDITING_STOPPED _UxGT("Arret edit. maillage") -#define MSG_USER_MENU _UxGT("Commandes perso") - -#define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ d'abord") -#define MSG_UBL_TOOLS _UxGT("Outils UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifie") -#define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#define MSG_UBL_BC_INSERT _UxGT("Poser cale & mesurer") -#define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("Oter et mesurer lit") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desactiver l'UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temperature lit") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temperature buse") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editer maille") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Reglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Creer maille perso") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Creer maille") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Creer maille PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Creer maille ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Creer maille froide") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valider maille PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valider maille ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") -#define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau a 3 points") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau grille") -#define MSG_UBL_MESH_LEVEL _UxGT("Maille de niveau") -#define MSG_UBL_SIDE_POINTS _UxGT("Point lateral") -#define MSG_UBL_MAP_TYPE _UxGT("Type de carte") -#define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hote") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") -#define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") -#define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") -#define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus pres") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Reglage fin (tous)") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Reglage fin (proche)") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Stockage maille") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot memoire") -#define MSG_UBL_LOAD_MESH _UxGT("Charger maille") -#define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_NO_STORAGE _UxGT("Pas de memoire") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Enreg. UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ouvrir UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Decal. Z arrete") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas a pas") - -#define MSG_LED_CONTROL _UxGT("Controle LED") -#define MSG_LEDS _UxGT("Lumiere") -#define MSG_LED_PRESETS _UxGT("Preregl. LED.") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensite rouge") -#define MSG_INTENSITY_G _UxGT("Intensite vert") -#define MSG_INTENSITY_B _UxGT("Intensite bleu") -#define MSG_INTENSITY_W _UxGT("Intensite blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosite") - -#define MSG_MOVING _UxGT("Deplacement...") -#define MSG_FREE_XY _UxGT("Debloquer XY") -#define MSG_MOVE_X _UxGT("Depl. X") -#define MSG_MOVE_Y _UxGT("Depl. Y") -#define MSG_MOVE_Z _UxGT("Depl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") -#define MSG_MOVE_01MM _UxGT("Depl. 0.1mm") -#define MSG_MOVE_1MM _UxGT("Depl. 1mm") -#define MSG_MOVE_10MM _UxGT("Depl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") -#define MSG_BED_Z _UxGT("Lit Z") -#define MSG_NOZZLE _UxGT("Buse") -#define MSG_BED _UxGT("Lit") -#define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Controler") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") -#define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_ON _UxGT("Marche") -#define MSG_OFF _UxGT("Arret") -#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("Selectionner") -#define MSG_ACC _UxGT("Acceleration") -#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_VELOCITY _UxGT("Velocite") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V depl. min") -#define MSG_ACCELERATION _UxGT("Acceleration") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A Depl.") -#define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") -#define MSG_TEMPERATURE _UxGT("Temperature") -#define MSG_MOTION _UxGT("Mouvement") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Decharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EEPROM _UxGT("Sauver config") -#define MSG_LOAD_EEPROM _UxGT("Lire config") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurer defauts") -#define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") -#define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Surveiller") -#define MSG_PREPARE _UxGT("Preparer") -#define MSG_TUNE _UxGT("Regler") -#define MSG_PAUSE_PRINT _UxGT("Interrompre impr.") -#define MSG_RESUME_PRINT _UxGT("Reprendre impr.") -#define MSG_STOP_PRINT _UxGT("Arreter impr.") -#define MSG_CARD_MENU _UxGT("Impr. depuis SD") -#define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Repos...") -#define MSG_USERWAIT _UxGT("Atten. de l'util.") -#define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINT_ABORTED _UxGT("Impr. Annulee") -#define MSG_NO_MOVE _UxGT("Moteurs bloques.") -#define MSG_KILLED _UxGT("MORT.") -#define MSG_STOPPED _UxGT("STOPPE.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rapp. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Decharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Decharger tout") -#define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur ecart") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Deployer BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ranger BLTouch") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") -#define MSG_ZPROBE_ZOFFSET _UxGT("Decalage Z") -#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("Butee abandon") -#define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPR. STOPPEE") -#define MSG_PLEASE_RESET _UxGT("RaZ. SVP") -#define MSG_SHORT_DAY _UxGT("j") // 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("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Reglages Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") - -#define MSG_INFO_MENU _UxGT("Infos imprimante") -#define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau a 3 points") -#define MSG_LINEAR_LEVELING _UxGT("Niveau lineaire") -#define MSG_BILINEAR_LEVELING _UxGT("Niveau bilineaire") -#define MSG_UBL_LEVELING _UxGT("Niveau lit unifie") -#define MSG_MESH_LEVELING _UxGT("Niveau maillage") -#define MSG_INFO_STATS_MENU _UxGT("Stats. imprimante") -#define MSG_INFO_BOARD_MENU _UxGT("Infos carte") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocole") -#define MSG_CASE_LIGHT _UxGT("Lumiere caisson") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosite") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Nbre impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminees") - #define MSG_INFO_PRINT_TIME _UxGT("Tps impr. total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impr. la + longue") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total filament") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminees") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("+ long") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filament") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("Alimentation") -#define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger encore") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Demarrage") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("decharger filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer 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_HEATING_1 _UxGT("Buse en chauffe") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patientez...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer et clic") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_FR_H diff --git a/Marlin/language_fr_utf8.h b/Marlin/language_fr_utf8.h deleted file mode 100644 index 5d49c059b2..0000000000 --- a/Marlin/language_fr_utf8.h +++ /dev/null @@ -1,395 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * French - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FR_UTF_H -#define LANGUAGE_FR_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prête.") -#define MSG_BACK _UxGT("Retour") -#define MSG_SD_INSERTED _UxGT("Carte insérée") -#define MSG_SD_REMOVED _UxGT("Carte retirée") -#define MSG_LCD_ENDSTOPS _UxGT("Butées") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Demarrage auto") -#define MSG_DISABLE_STEPPERS _UxGT("Arrêter moteurs") -#define MSG_DEBUG_MENU _UxGT("Menu debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") -#define MSG_AUTO_HOME _UxGT("Origine auto.") -#define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") -#define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") -#define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") -#define MSG_LEVEL_BED_DONE _UxGT("Mise à niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissée") -#define MSG_SET_HOME_OFFSETS _UxGT("Régl. décal. origine") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Décalages appliqués") -#define MSG_SET_ORIGIN _UxGT("Régler origine") -#define MSG_PREHEAT_1 _UxGT("Préchauffage PLA") -#define MSG_PREHEAT_1_N _UxGT("Préchauff. PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Préch. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Régl. prech. PLA") -#define MSG_PREHEAT_2 _UxGT("Préchauffage ABS") -#define MSG_PREHEAT_2_N _UxGT("Préchauff. ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Préch. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Régl. prech. ABS") -#define MSG_COOLDOWN _UxGT("Refroidir") -#define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") -#define MSG_MOVE_AXIS _UxGT("Déplacer un axe") -#define MSG_BED_LEVELING _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_BED _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") -#define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage") -#define MSG_USER_MENU _UxGT("Commandes perso") - -#define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ d'abord") -#define MSG_UBL_TOOLS _UxGT("Outils UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") -#define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#define MSG_UBL_BC_INSERT _UxGT("Poser câle & mesurer") -#define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("ôter et mesurer lit") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Désactiver l'UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Température lit") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Température buse") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editer maille") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Réglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Créer maille perso") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Créer maille") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Créer maille PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Créer maille ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Créer maille froide") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valider maille PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valider maille ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") -#define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau à 3 points") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau grille") -#define MSG_UBL_MESH_LEVEL _UxGT("Maille de niveau") -#define MSG_UBL_SIDE_POINTS _UxGT("Point latéral") -#define MSG_UBL_MAP_TYPE _UxGT("Type de carte") -#define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hôte") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") -#define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") -#define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") -#define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus près") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Réglage fin (tous)") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Réglage fin (proche)") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Stockage maille") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot mémoire") -#define MSG_UBL_LOAD_MESH _UxGT("Charger maille") -#define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_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_STOPPED _UxGT("Décal. Z arrêté") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas") - -#define MSG_LED_CONTROL _UxGT("Contrôle LED") -#define MSG_LEDS _UxGT("Lumière") -#define MSG_LED_PRESETS _UxGT("Préregl. LED") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensité rouge") -#define MSG_INTENSITY_G _UxGT("Intensité vert") -#define MSG_INTENSITY_B _UxGT("Intensité bleu") -#define MSG_INTENSITY_W _UxGT("Intensité blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosité") - -#define MSG_MOVING _UxGT("Déplacement...") -#define MSG_FREE_XY _UxGT("Débloquer XY") -#define MSG_MOVE_X _UxGT("Dépl. X") -#define MSG_MOVE_Y _UxGT("Dépl. Y") -#define MSG_MOVE_Z _UxGT("Dépl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") -#define MSG_MOVE_01MM _UxGT("Dépl. 0.1mm") -#define MSG_MOVE_1MM _UxGT("Dépl. 1mm") -#define MSG_MOVE_10MM _UxGT("Dépl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") -#define MSG_BED_Z _UxGT("Lit Z") -#define MSG_NOZZLE _UxGT("Buse") -#define MSG_BED _UxGT("Lit") -#define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Contrôler") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") -#define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_ON _UxGT("Marche ") -#define MSG_OFF _UxGT("Arrêt") -#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("Sélectionner") -#define MSG_ACC _UxGT("Accélération") -#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_VELOCITY _UxGT("Vélocité") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V dépl. min") -#define MSG_ACCELERATION _UxGT("Accélération") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A dépl.") -#define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") -#define MSG_TEMPERATURE _UxGT("Température") -#define MSG_MOTION _UxGT("Mouvement") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Décharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EEPROM _UxGT("Sauver config") -#define MSG_LOAD_EEPROM _UxGT("Lire config") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurer défauts") -#define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") -#define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Surveiller") -#define MSG_PREPARE _UxGT("Préparer") -#define MSG_TUNE _UxGT("Régler") -#define MSG_PAUSE_PRINT _UxGT("Interrompre impr.") -#define MSG_RESUME_PRINT _UxGT("Reprendre impr.") -#define MSG_STOP_PRINT _UxGT("Arrêter impr.") -#define MSG_CARD_MENU _UxGT("Impr. depuis SD") -#define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Repos...") -#define MSG_USERWAIT _UxGT("Atten. de l'util.") -#define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINT_ABORTED _UxGT("Impr. Annulée") -#define MSG_NO_MOVE _UxGT("Moteurs bloqués.") -#define MSG_KILLED _UxGT("MORT.") -#define MSG_STOPPED _UxGT("STOPPÉ.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Décharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") -#define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur écart") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Déployer BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ranger BLTouch") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") -#define MSG_ZPROBE_ZOFFSET _UxGT("Décalage Z") -#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("Butée abandon") -#define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPR. STOPPÉE") -#define MSG_PLEASE_RESET _UxGT("RàZ. SVP") -#define MSG_SHORT_DAY _UxGT("j") // 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("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Réglages Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") - -#define MSG_INFO_MENU _UxGT("Infos imprimante") -#define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau à 3 points") -#define MSG_LINEAR_LEVELING _UxGT("Niveau linéaire") -#define MSG_BILINEAR_LEVELING _UxGT("Niveau bilinéaire") -#define MSG_UBL_LEVELING _UxGT("Niveau lit unifié") -#define MSG_MESH_LEVELING _UxGT("Niveau maillage") -#define MSG_INFO_STATS_MENU _UxGT("Stats. imprimante") -#define MSG_INFO_BOARD_MENU _UxGT("Infos carte") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocole") -#define MSG_CASE_LIGHT _UxGT("Lumière caisson") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosité") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Nbre impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Tps impr. total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impr. la + longue") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total filament") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("+ long") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filament") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("Alimentation") -#define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger encore") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Démarrage") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("décharger filament") - #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_HEATING_1 _UxGT("Buse en chauffe") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patientez...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer et clic") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_FR_UTF_H diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h deleted file mode 100644 index e0524d8df9..0000000000 --- a/Marlin/language_gl.h +++ /dev/null @@ -1,255 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Galician language (ISO "gl") - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_GL_H -#define LANGUAGE_GL_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_SD_INSERTED _UxGT("Tarxeta inserida") -#define MSG_SD_REMOVED _UxGT("Tarxeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("FinCarro") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autoarranque") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_AUTO_HOME _UxGT("Ir a orixe") -#define MSG_AUTO_HOME_X _UxGT("Ir orixe X") -#define MSG_AUTO_HOME_Y _UxGT("Ir orixe Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir orixe Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Ir orixes XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Prema pulsador") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Seguinte punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelado feito") -#define MSG_SET_HOME_OFFSETS _UxGT("Offsets na orixe") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets fixados") -#define MSG_SET_ORIGIN _UxGT("Fixar orixe") -#define MSG_PREHEAT_1 _UxGT("Prequentar PLA") -#define MSG_PREHEAT_1_N _UxGT("Prequentar PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Preque. PLA Todo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Preque. PLA Cama") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Preque. PLA conf") -#define MSG_PREHEAT_2 _UxGT("Prequentar ABS") -#define MSG_PREHEAT_2_N _UxGT("Prequentar ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Preque. ABS Todo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Preque. ABS Cama") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Preque. ABS conf") -#define MSG_COOLDOWN _UxGT("Arrefriar") -#define MSG_SWITCH_PS_ON _UxGT("Acender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover eixe") -#define MSG_BED_LEVELING _UxGT("Nivelar cama") -#define MSG_LEVEL_BED _UxGT("Nivelar cama") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Cama Z") -#define MSG_NOZZLE _UxGT("Bico") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Velocidade vent.") -#define MSG_FLOW _UxGT("Fluxo") -#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_ON _UxGT("On ") -#define MSG_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_STEPS_PER_MM _UxGT("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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movemento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. fil.") -#define MSG_CONTRAST _UxGT("Constraste LCD") -#define MSG_STORE_EEPROM _UxGT("Gardar en memo.") -#define MSG_LOAD_EEPROM _UxGT("Cargar de memo.") -#define MSG_RESTORE_FAILSAFE _UxGT("Cargar de firm.") -#define MSG_REFRESH _UxGT("Volver a cargar") -#define MSG_WATCH _UxGT("Monitorizacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Axustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impres.") -#define MSG_RESUME_PRINT _UxGT("Seguir impres.") -#define MSG_STOP_PRINT _UxGT("Deter impres.") -#define MSG_CARD_MENU _UxGT("Tarxeta SD") -#define MSG_NO_CARD _UxGT("Sen tarxeta SD") -#define MSG_DWELL _UxGT("En repouso...") -#define MSG_USERWAIT _UxGT("A espera...") -#define MSG_PRINT_ABORTED _UxGT("Impre. cancelada") -#define MSG_NO_MOVE _UxGT("Sen movemento.") -#define MSG_KILLED _UxGT("PROGRAMA MORTO") -#define MSG_STOPPED _UxGT("PROGRAMA PARADO") -#define MSG_CONTROL_RETRACT _UxGT("Retraccion mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Cambio retra. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraccion V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Alzar Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Recup. retra. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Cambio recup. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Recuperacion V") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamen.") -#define MSG_INIT_SDCARD _UxGT("Iniciando SD") -#define MSG_CNG_SDCARD _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_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") -#define MSG_BABYSTEP_Z _UxGT("Micropaso Z") -#define MSG_ENDSTOP_ABORT _UxGT("Erro fin carro") -#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_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_HEATING _UxGT("Quentando...") -#define MSG_BED_HEATING _UxGT("Quentando cama...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_INFO_MENU _UxGT("Acerca de...") -#define MSG_INFO_PRINTER_MENU _UxGT("Informacion") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Placa nai") -#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") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Total completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo impresion") - #define MSG_INFO_PRINT_LONGEST _UxGT("Traballo +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extruido") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo") - #define MSG_INFO_PRINT_LONGEST _UxGT("O +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruido") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Fonte alime.") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia motor") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Garda DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Segue traballo") - -#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") -#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...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_GL_H diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h deleted file mode 100644 index efdeae8b5b..0000000000 --- a/Marlin/language_hr.h +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Croatian (Hrvatski) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_HR_H -#define LANGUAGE_HR_H - -#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" spreman.") -#define MSG_SD_INSERTED _UxGT("SD kartica umetnuta") -#define MSG_SD_REMOVED _UxGT("SD kartica uklonjena") -#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") -#define MSG_AUTO_HOME_X _UxGT("Home-aj X") -#define MSG_AUTO_HOME_Y _UxGT("Home-aj Y") -#define MSG_AUTO_HOME_Z _UxGT("Home-aj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriraj Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home-aj XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klikni za početak") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sljedeća točka") -#define MSG_LEVEL_BED_DONE _UxGT("Niveliranje gotovo!") -#define MSG_SET_HOME_OFFSETS _UxGT("Postavi home offsete") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets postavljeni") -#define MSG_SET_ORIGIN _UxGT("Postavi ishodište") -#define MSG_PREHEAT_1 _UxGT("Predgrij PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Sve") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#define MSG_PREHEAT_2 _UxGT("Predgrij ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Sve") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#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_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_01MM _UxGT("Miči 0.1mm") -#define MSG_MOVE_1MM _UxGT("Miči 1mm") -#define MSG_MOVE_10MM _UxGT("Miči 10mm") -#define MSG_SPEED _UxGT("Brzina") -#define MSG_BED_Z _UxGT("Bed Z") -#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_ON _UxGT("On ") -#define MSG_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_TEMPERATURE _UxGT("Temperature") -#define MSG_MOTION _UxGT("Gibanje") -#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") -#define MSG_STORE_EEPROM _UxGT("Pohrani u memoriju") -#define MSG_LOAD_EEPROM _UxGT("Učitaj memoriju") -#define MSG_RESTORE_FAILSAFE _UxGT("Učitaj failsafe") -#define MSG_REFRESH _UxGT("Osvježi") -#define MSG_WATCH _UxGT("Info screen") -#define MSG_PREPARE _UxGT("Pripremi") -#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_CARD_MENU _UxGT("Printaj s SD kartice") -#define MSG_NO_CARD _UxGT("Nema SD kartice") -#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_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_ZLIFT _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_SDCARD _UxGT("Init. SD karticu") -#define MSG_CNG_SDCARD _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_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_HEATING _UxGT("Grijanje...") -#define MSG_BED_HEATING _UxGT("Grijanje Bed-a...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibracija") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriraj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriraj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriraj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriraj Središte") -#define MSG_INFO_MENU _UxGT("O printeru") -#define MSG_INFO_PRINTER_MENU _UxGT("Podaci o printeru") -#define MSG_INFO_STATS_MENU _UxGT("Statistika printera") -#define MSG_INFO_BOARD_MENU _UxGT("Podaci o elektronici") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Extruderi") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvjetljenje") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Broj printova") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno printanja") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudirano ukupno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Printovi") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži") - #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_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_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") -#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...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_HR_H diff --git a/Marlin/language_it.h b/Marlin/language_it.h deleted file mode 100644 index 306faa3313..0000000000 --- a/Marlin/language_it.h +++ /dev/null @@ -1,401 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Italian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_IT_H -#define LANGUAGE_IT_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") -#define MSG_BACK _UxGT("Indietro") -#define MSG_SD_INSERTED _UxGT("SD Card inserita") -#define MSG_SD_REMOVED _UxGT("SD Card rimossa") -#define MSG_LCD_ENDSTOPS _UxGT("Endstop") -#define MSG_MAIN _UxGT("Menu principale") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Disabilita Motori") -#define MSG_DEBUG_MENU _UxGT("Menu di debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra avanzamento") -#define MSG_AUTO_HOME _UxGT("Auto Home") -#define MSG_AUTO_HOME_X _UxGT("Home asse X") -#define MSG_AUTO_HOME_Y _UxGT("Home asse Y") -#define MSG_AUTO_HOME_Z _UxGT("Home asse Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home assi XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Premi per iniziare") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Punto successivo") -#define MSG_LEVEL_BED_DONE _UxGT("Livel. terminato!") -#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#define MSG_SET_HOME_OFFSETS _UxGT("Imp. offset home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset applicato") -#define MSG_SET_ORIGIN _UxGT("Imposta Origine") -#define MSG_PREHEAT_1 _UxGT("Preriscalda PLA") -#define MSG_PREHEAT_1_N _UxGT("Preris.PLA ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("Tutto") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1_N _UxGT("Ugello") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Piatto") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1_N _UxGT("conf") -#define MSG_PREHEAT_2 _UxGT("Preriscalda ABS") -#define MSG_PREHEAT_2_N _UxGT("Preris.ABS ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("Tutto") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2_N _UxGT("Ugello") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Piatto") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2_N _UxGT("conf") -#define MSG_COOLDOWN _UxGT("Raffredda") -#define MSG_SWITCH_PS_ON _UxGT("Accendi aliment.") -#define MSG_SWITCH_PS_OFF _UxGT("Spegni aliment.") -#define MSG_EXTRUDE _UxGT("Estrudi") -#define MSG_RETRACT _UxGT("Ritrai") -#define MSG_MOVE_AXIS _UxGT("Muovi Asse") -#define MSG_BED_LEVELING _UxGT("Livella piano") -#define MSG_LEVEL_BED _UxGT("Livella piano") -#define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") -#define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") -#define MSG_EDITING_STOPPED _UxGT("Modifica Mesh Fermata") -#define MSG_USER_MENU _UxGT("Comandi Utente") - -#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") -#define MSG_UBL_BC_INSERT _UxGT("Metti spessore & misura") -#define MSG_UBL_BC_INSERT2 _UxGT("Misura") -#define MSG_UBL_BC_REMOVE _UxGT("Rimuovi e misura piatto") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Spostamento sucessivo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Attiva UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Disattiva UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp Piatto") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp Ugello") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Modifica Mesh") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Modif Custom Mesh") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ritocca Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Crea Custom Mesh") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Crea Mesh") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Crea PLA Mesh") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Crea ABS Mesh") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Crea Cold Mesh") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Aggiusta Altezza Mesh") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Altezza") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valida Mesh") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valida PLA Mesh") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valida ABS Mesh") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valida Custom Mesh") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continua Mesh") -#define MSG_UBL_MESH_LEVELING _UxGT("Livell. Mesh") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Livell. 3 Punti") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Livell. Griglia Mesh") -#define MSG_UBL_MESH_LEVEL _UxGT("Livella Mesh") -#define MSG_UBL_SIDE_POINTS _UxGT("Punti laterali") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo di Mappa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Esporta Mappa") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Esporta per Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Esporta in CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Backup esterno") -#define MSG_UBL_INFO_UBL _UxGT("Esporta Info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifica Mesh") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Riempimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Riempimento Manuale") -#define MSG_UBL_SMART_FILLIN _UxGT("Riempimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Riempimento Mesh") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalida Tutto") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalida Punto Vicino") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ritocca All") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ritocca Punto Vicino") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Salvate") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot di memoria") -#define MSG_UBL_LOAD_MESH _UxGT("Carica Mesh Piatto") -#define MSG_UBL_SAVE_MESH _UxGT("Salva Mesh Piatto") -#define MSG_MESH_LOADED _UxGT("Mesh %i caricata") -#define MSG_MESH_SAVED _UxGT("Mesh %i salvata") -#define MSG_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_STOPPED _UxGT("Z-Offset Fermato") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo") - -#define MSG_LED_CONTROL _UxGT("Controllo LED") -#define MSG_LEDS _UxGT("Luci") -#define MSG_LED_PRESETS _UxGT("Preset luci") -#define MSG_SET_LEDS_RED _UxGT("Rosso") -#define MSG_SET_LEDS_ORANGE _UxGT("Arancione") -#define MSG_SET_LEDS_YELLOW _UxGT("Giallo") -#define MSG_SET_LEDS_GREEN _UxGT("Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Blu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indaco") -#define MSG_SET_LEDS_VIOLET _UxGT("Viola") -#define MSG_SET_LEDS_WHITE _UxGT("Bianco") -#define MSG_SET_LEDS_DEFAULT _UxGT("Predefinito") -#define MSG_CUSTOM_LEDS _UxGT("Luci personalizzate") -#define MSG_INTENSITY_R _UxGT("Intensita rosso") -#define MSG_INTENSITY_G _UxGT("Intensita verde") -#define MSG_INTENSITY_B _UxGT("Intensita blu") -#define MSG_INTENSITY_W _UxGT("Intensita bianco") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosita") - -#define MSG_MOVING _UxGT("In movimento...") -#define MSG_FREE_XY _UxGT("XY liberi") -#define MSG_MOVE_X _UxGT("Muovi X") -#define MSG_MOVE_Y _UxGT("Muovi Y") -#define MSG_MOVE_Z _UxGT("Muovi Z") -#define MSG_MOVE_E _UxGT("Estrusore") -#define MSG_MOVE_01MM _UxGT("Muovi di 0.1mm") -#define MSG_MOVE_1MM _UxGT("Muovi di 1mm") -#define MSG_MOVE_10MM _UxGT("Muovi di 10mm") -#define MSG_SPEED _UxGT("Velocità") -#define MSG_BED_Z _UxGT("piatto Z") -#define MSG_NOZZLE _UxGT("Ugello") -#define MSG_BED _UxGT("Piatto") -#define MSG_FAN_SPEED _UxGT("Velocita ventola") -#define MSG_EXTRA_FAN_SPEED _UxGT("Magg vel ventola") -#define MSG_FLOW _UxGT("Flusso") -#define MSG_CONTROL _UxGT("Controllo") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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("Seleziona") -#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_VELOCITY _UxGT("Velocità") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Accelerazione") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retract") -#define MSG_A_TRAVEL _UxGT("A-Spostamento") -#define MSG_STEPS_PER_MM _UxGT("Passi/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassi/mm") - #define MSG_BSTEPS _UxGT("Bpassi/mm") - #define MSG_CSTEPS _UxGT("Cpassi/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassi/mm") - #define MSG_BSTEPS _UxGT("Ypassi/mm") - #define MSG_CSTEPS _UxGT("Zpassi/mm") -#endif -#define MSG_ESTEPS _UxGT("Epassi/mm") -#define MSG_E1STEPS _UxGT("E1passi/mm") -#define MSG_E2STEPS _UxGT("E2passi/mm") -#define MSG_E3STEPS _UxGT("E3passi/mm") -#define MSG_E4STEPS _UxGT("E4passi/mm") -#define MSG_E5STEPS _UxGT("E5passi/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. filo") -#define MSG_FILAMENT_UNLOAD _UxGT("Rimuovi mm") -#define MSG_FILAMENT_LOAD _UxGT("Carica mm") -#define MSG_ADVANCE_K _UxGT("K Avanzamento") -#define MSG_CONTRAST _UxGT("Contrasto LCD") -#define MSG_STORE_EEPROM _UxGT("Salva in memoria") -#define MSG_LOAD_EEPROM _UxGT("Carica da memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") -#define MSG_INIT_EEPROM _UxGT("Inizializza EEPROM") -#define MSG_REFRESH _UxGT("Aggiorna") -#define MSG_WATCH _UxGT("Guarda") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Regola") -#define MSG_PAUSE_PRINT _UxGT("Pausa") -#define MSG_RESUME_PRINT _UxGT("Riprendi stampa") -#define MSG_STOP_PRINT _UxGT("Arresta stampa") -#define MSG_CARD_MENU _UxGT("Stampa da SD") -#define MSG_NO_CARD _UxGT("SD non presente") -#define MSG_DWELL _UxGT("Sospensione...") -#define MSG_USERWAIT _UxGT("Premi tasto..") -#define MSG_PRINT_PAUSED _UxGT("Stampa sospesa") -#define MSG_PRINT_ABORTED _UxGT("Stampa annullata") -#define MSG_NO_MOVE _UxGT("Nessun Movimento") -#define MSG_KILLED _UxGT("UCCISO. ") -#define MSG_STOPPED _UxGT("ARRESTATO. ") -#define MSG_CONTROL_RETRACT _UxGT("Ritrai mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Scamb. Ritrai mm") -#define MSG_CONTROL_RETRACTF _UxGT("Ritrai V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Salta mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Scamb. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRitrai") -#define MSG_FILAMENTCHANGE _UxGT("Cambia filamento") -#define MSG_FILAMENTLOAD _UxGT("Carica filamento") -#define MSG_FILAMENTUNLOAD _UxGT("Rimuovi filamento") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Rimuovi tutto") -#define MSG_INIT_SDCARD _UxGT("Iniz. SD-Card") -#define MSG_CNG_SDCARD _UxGT("Cambia SD-Card") -#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_SKEW_FACTOR _UxGT("Fattore distorsione") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Resetta BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Estendi BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ritrai BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prima") -#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("Finecorsa abort") -#define MSG_HEATING_FAILED_LCD _UxGT("Riscald. Fallito") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Risc. piatto fallito") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP RIDONDANTI") -#define MSG_THERMAL_RUNAWAY _UxGT("TEMP FUORI CONTROLLO") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MASSIMA") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP MASSIMA PIATTO") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP MINIMA PIATTO") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("STAMPANTE FERMATA") -#define MSG_PLEASE_RESET _UxGT("Riavviare prego") -#define MSG_SHORT_DAY _UxGT("g") // 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("Riscaldamento...") -#define MSG_COOLING _UxGT("Raffreddamento..") -#define MSG_BED_HEATING _UxGT("Risc. piatto...") -#define MSG_BED_COOLING _UxGT("Raffr. piatto...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibraz. Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibra Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibra Center") -#define MSG_DELTA_SETTINGS _UxGT("Impostaz. Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto calibrazione") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Imp. altezza Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Altezza") -#define MSG_DELTA_RADIUS _UxGT("Raggio") -#define MSG_INFO_MENU _UxGT("Riguardo stampante") -#define MSG_INFO_PRINTER_MENU _UxGT("Info. stampante") -#define MSG_3POINT_LEVELING _UxGT("Livel. a 3 punti") -#define MSG_LINEAR_LEVELING _UxGT("Livel. Lineare") -#define MSG_BILINEAR_LEVELING _UxGT("Livel. Biliniare") -#define MSG_UBL_LEVELING _UxGT("Livel. UBL") -#define MSG_MESH_LEVELING _UxGT("Livel. Mesh") -#define MSG_INFO_STATS_MENU _UxGT("Statistiche") -#define MSG_INFO_BOARD_MENU _UxGT("Info. scheda") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusori") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocollo") -#define MSG_CASE_LIGHT _UxGT("Luci Case") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosità Luci") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Contat. stampa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo totale") - #define MSG_INFO_PRINT_LONGEST _UxGT("Lavoro più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totale estruso") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Stampe") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Durata") - #define MSG_INFO_PRINT_LONGEST _UxGT("Più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruso") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Temp min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp max") -#define MSG_INFO_PSU _UxGT("Alimentatore") - -#define MSG_DRIVE_STRENGTH _UxGT("Potenza Drive") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#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") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("RIMUOVI FILAMENTO") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPZIONI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Libera di piu") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Riprendi stampa") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Ugello: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Home fallito") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing fallito") -#define MSG_M600_TOO_COLD _UxGT("M600:Troppo freddo") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere avvio") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del cambio") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("di filamento") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("l'espulsione") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci il") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("premi per cont") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premi per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("riscald ugello.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscald. ugello") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Attendere...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("il caricamento") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("lo spurgo") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("la ripresa") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("della stampa") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Espulsione...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci e premi") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Riscalda ugello") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscaldamento...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Caricamento...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Spurgo filamento") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ripresa...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_IT_H diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h deleted file mode 100644 index e75be4c210..0000000000 --- a/Marlin/language_kana.h +++ /dev/null @@ -1,340 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Japanese (Kana) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#ifndef LANGUAGE_KANA_H -#define LANGUAGE_KANA_H - -// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h -#define SIMULATE_ROMFONT -#define DISPLAY_CHARSET_ISO10646_KANA -#define CHARSIZE 2 - -// 片仮名表示定義 -#define WELCOME_MSG MACHINE_NAME " ready." -#define MSG_SD_INSERTED "\xb6\xb0\xc4\xde\xb6\xde\xbf\xb3\xc6\xad\xb3\xbb\xda\xcf\xbc\xc0" // "カードガソウニュウサレマシタ" ("Card inserted") -#define MSG_SD_REMOVED "\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "カードガアリマセン" ("Card removed") -#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters -#define MSG_MAIN "\xd2\xb2\xdd" // "メイン" ("Main") -#define MSG_AUTOSTART "\xbc\xde\xc4\xde\xb3\xb6\xb2\xbc" // "ジドウカイシ" ("Autostart") -#define MSG_DISABLE_STEPPERS "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "モーターデンゲン オフ" ("Disable steppers") -#define MSG_DEBUG_MENU "\xc3\xde\xca\xde\xaf\xb8\xde\xd2\xc6\xad\xb0" // "デバッグメニュー" ("Debug Menu") -#define MSG_PROGRESS_BAR_TEST "\xcc\xdf\xdb\xb8\xde\xda\xbd\xca\xde\xb0\x20\xc3\xbd\xc4" // "プログレスバー テスト" ("Progress Bar Test") -#define MSG_AUTO_HOME "\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "ゲンテンフッキ" ("Auto home") -#define MSG_AUTO_HOME_X "X\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Xジク ゲンテンフッキ" ("Home X") -#define MSG_AUTO_HOME_Y "Y\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Yジク ゲンテンフッキ" ("Home Y") -#define MSG_AUTO_HOME_Z "Z\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Zジク ゲンテンフッキ" ("Home Z") -#define MSG_TMC_Z_CALIBRATION "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") -#define MSG_LEVEL_BED_HOMING "\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xc1\xad\xb3" // "ゲンテンフッキチュウ" ("Homing XYZ") -#define MSG_LEVEL_BED_WAITING "\xda\xcd\xde\xd8\xdd\xb8\xde\xb6\xb2\xbc" // "レベリングカイシ" ("Click to Begin") -#define MSG_LEVEL_BED_NEXT_POINT "\xc2\xb7\xde\xc9\xbf\xb8\xc3\xb2\xc3\xdd\xcd" // "ツギノソクテイテンヘ" ("Next Point") -#define MSG_LEVEL_BED_DONE "\xda\xcd\xde\xd8\xdd\xb8\xde\xb6\xdd\xd8\xae\xb3" // "レベリングカンリョウ" ("Leveling Done!") -#define MSG_SET_HOME_OFFSETS "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2" // "キジュンオフセットセッテイ" ("Set home offsets") -#define MSG_HOME_OFFSETS_APPLIED "\xb5\xcc\xbe\xaf\xc4\xb6\xde\xc3\xb7\xd6\xb3\xbb\xda\xcf\xbc\xc0" // "オフセットガテキヨウサレマシタ" ("Offsets applied") -#define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "キジュンセット" ("Set origin") -#define MSG_PREHEAT_1 "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL "PLA \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "PLA スベテヨネツ" (" All") -#define MSG_PREHEAT_1_BEDONLY "PLA \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "PLA ベッドヨネツ" (" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") -#define MSG_PREHEAT_2 "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL "ABS \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "ABS スベテヨネツ" (" All") -#define MSG_PREHEAT_2_BEDONLY "ABS \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "ABS ベッドヨネツ" (" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") -#define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "カネツテイシ" ("Cooldown") -#define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xdd" // "デンゲン オン" ("Switch power on") -#define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "デンゲン オフ" ("Switch power off") -#define MSG_EXTRUDE "\xb5\xbc\xc0\xde\xbc" // "オシダシ" ("Extrude") -#define MSG_RETRACT "\xcb\xb7\xba\xd0\xbe\xaf\xc3\xb2" // "ヒキコミセッテイ" ("Retract") -#define MSG_MOVE_AXIS "\xbc\xde\xb8\xb2\xc4\xde\xb3" // "ジクイドウ" ("Move axis") -#define MSG_BED_LEVELING "\xcd\xde\xaf\xc4\xde\xda\xcd\xde\xd8\xdd\xb8\xde" // "ベッドレベリング" ("Bed Leveling") -#define MSG_LEVEL_BED "\xcd\xde\xaf\xc4\xde\xda\xcd\xde\xd8\xdd\xb8\xde" // "ベッドレベリング" ("Level bed") -#define MSG_MOVING "\xb2\xc4\xde\xb3\xc1\xad\xb3" // "イドウチュウ" ("Moving...") -#define MSG_FREE_XY "XY\xbc\xde\xb8\x20\xb6\xb2\xce\xb3" // "XYジク カイホウ" ("Free XY") -#define MSG_MOVE_X "X\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Xジク イドウ" ("Move X") -#define MSG_MOVE_Y "Y\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Yジク イドウ" ("Move Y") -#define MSG_MOVE_Z "Z\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Zジク イドウ" ("Move Z") -#define MSG_MOVE_E "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0" // "エクストルーダー" ("Extruder") -#define MSG_MOVE_01MM "0.1mm \xb2\xc4\xde\xb3" // "0.1mm イドウ" ("Move 0.1mm") -#define MSG_MOVE_1MM " 1mm \xb2\xc4\xde\xb3" // " 1mm イドウ" ("Move 1mm") -#define MSG_MOVE_10MM " 10mm \xb2\xc4\xde\xb3" // " 10mm イドウ" ("Move 10mm") -#define MSG_SPEED "\xbf\xb8\xc4\xde" // "ソクド" ("Speed") -#define MSG_BED_Z "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Bed Z") -#define MSG_NOZZLE "\xc9\xbd\xde\xd9" // "ノズル" ("Nozzle") -#define MSG_BED "\xcd\xde\xaf\xc4\xde" // "ベッド" ("Bed") -#define MSG_FAN_SPEED "\xcc\xa7\xdd\xbf\xb8\xc4\xde" // "ファンソクド" ("Fan speed") -#define MSG_FLOW "\xc4\xbc\xad\xc2\xd8\xae\xb3" // "トシュツリョウ" ("Flow") -#define MSG_CONTROL "\xbe\xb2\xb7\xde\xae" // "セイギョ" ("Control") -#define MSG_MIN LCD_STR_THERMOMETER " \xbb\xb2\xc3\xb2" // " サイテイ" (" Min") -#define MSG_MAX LCD_STR_THERMOMETER " \xbb\xb2\xba\xb3" // " サイコウ" (" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER " \xcc\xa7\xb8\xc0\xb0" // " ファクター" (" Fact") -#if LCD_WIDTH >= 20 - #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde\xbe\xb2\xb7\xde\xae" // "ジドウオンドセイギョ" ("Autotemp") -#else - #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp") -#endif -#define MSG_ON "\xb5\xdd " // "オン " ("On ") -#define MSG_OFF "\xb5\xcc " // "オフ " ("Off") -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select") -#define MSG_JERK "\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // ヤクド mm/s ("Jerk") -#if LCD_WIDTH >= 20 - #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Aジク ヤクド mm/s" ("Va-jerk") - #define MSG_VB_JERK "B\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Bジク ヤクド mm/s" ("Vb-jerk") - #define MSG_VC_JERK "C\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Cジク ヤクド mm/s" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Xジク ヤクド mm/s" ("Vx-jerk") - #define MSG_VB_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Yジク ヤクド mm/s" ("Vy-jerk") - #define MSG_VC_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk") - #endif - #define MSG_VE_JERK "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\x20\xd4\xb8\xc4\xde" // "エクストルーダー ヤクド" ("Ve-jerk") - #define MSG_VMAX "\xbb\xb2\xc0\xde\xb2\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "サイダイオクリソクド " ("Vmax ") - #define MSG_VMIN "\xbb\xb2\xbc\xae\xb3\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "サイショウオクリソクド" ("Vmin") - #define MSG_VTRAV_MIN "\xbb\xb2\xbc\xae\xb3\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "サイショウイドウソクド" ("VTrav min") - #define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ") -#else - #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\x20\xd4\xb8\xc4\xde" // "Aジク ヤクド" ("Va-jerk") - #define MSG_VB_JERK "B\x20\xd4\xb8\xc4\xde" // "Bジク ヤクド" ("Vb-jerk") - #define MSG_VC_JERK "C\x20\xd4\xb8\xc4\xde" // "Cジク ヤクド" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\x20\xd4\xb8\xc4\xde" // "Xジク ヤクド" ("Vx-jerk") - #define MSG_VB_JERK "Y\x20\xd4\xb8\xc4\xde" // "Yジク ヤクド" ("Vy-jerk") - #define MSG_VC_JERK "Z\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") - #endif - #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk") - #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ") - #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin") - #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min") - #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ") -#endif -#define MSG_A_RETRACT "\xcb\xb7\xba\xd0\xb6\xbf\xb8\xc4\xde" // "ヒキコミカソクド" ("A-retract") -#define MSG_A_TRAVEL "\xb2\xc4\xde\xb3\xb6\xbf\xb8\xc4\xde" // "イドウカソクド" ("A-travel") -#if LCD_WIDTH >= 20 - #define MSG_STEPS_PER_MM "Steps/mm" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps/mm" - #define MSG_BSTEPS "Bsteps/mm" - #define MSG_CSTEPS "Csteps/mm" - #else - #define MSG_ASTEPS "Xsteps/mm" - #define MSG_BSTEPS "Ysteps/mm" - #define MSG_CSTEPS "Zsteps/mm" - #endif - #define MSG_ESTEPS "Esteps/mm" - #define MSG_E1STEPS "E1steps/mm" - #define MSG_E2STEPS "E2steps/mm" - #define MSG_E3STEPS "E3steps/mm" - #define MSG_E4STEPS "E4steps/mm" - #define MSG_E5STEPS "E5steps/mm" -#else - #define MSG_STEPS_PER_MM "Steps" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps" - #define MSG_BSTEPS "Bsteps" - #define MSG_CSTEPS "Csteps" - #else - #define MSG_ASTEPS "Xsteps" - #define MSG_BSTEPS "Ysteps" - #define MSG_CSTEPS "Zsteps" - #endif - #define MSG_ESTEPS "Esteps" - #define MSG_E1STEPS "E1steps" - #define MSG_E2STEPS "E2steps" - #define MSG_E3STEPS "E3steps" - #define MSG_E4STEPS "E4steps" - #define MSG_E5STEPS "E5steps" -#endif -#define MSG_TEMPERATURE "\xb5\xdd\xc4\xde" // "オンド" ("Temperature") -#define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "ウゴキセッテイ" ("Motion") -#define MSG_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4" // "フィラメント" ("Filament") -#define MSG_VOLUMETRIC_ENABLED "E in mm3" -#if LCD_WIDTH >= 20 - #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xc1\xae\xaf\xb9\xb2" // "フィラメントチョッケイ" ("Fil. Dia.") -#else - #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.") -#endif -#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCDコントラスト" ("LCD contrast") -#define MSG_STORE_EEPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory") -#define MSG_LOAD_EEPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\xba\xd0" // "メモリカラヨミコミ" ("Load memory") -#define MSG_RESTORE_FAILSAFE "\xbe\xaf\xc3\xb2\xd8\xbe\xaf\xc4" // "セッテイリセット" ("Restore failsafe") -#define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "リフレッシュ" ("Refresh") -#define MSG_WATCH "\xbc\xde\xae\xb3\xce\xb3\xb6\xde\xd2\xdd" // "ジョウホウガメン" ("Info screen") -#define MSG_PREPARE "\xbc\xde\xad\xdd\xcb\xde\xbe\xaf\xc3\xb2" // "ジュンビセッテイ" ("Prepare") -#define MSG_TUNE "\xc1\xae\xb3\xbe\xb2" // "チョウセイ" ("Tune") -#define MSG_PAUSE_PRINT "\xb2\xc1\xbc\xde\xc3\xb2\xbc" // "イチジテイシ" ("Pause print") -#define MSG_RESUME_PRINT "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print") -#define MSG_STOP_PRINT "\xcc\xdf\xd8\xdd\xc4\xc3\xb2\xbc" // "プリントテイシ" ("Stop print") -#define MSG_CARD_MENU "SD\xb6\xb0\xc4\xde\xb6\xd7\xcc\xdf\xd8\xdd\xc4" // "SDカードカラプリント" ("Print from SD") -#define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "SDカードガアリマセン" ("No SD card") -#define MSG_DWELL "\xb7\xad\xb3\xbc" // "キュウシ" ("Sleep...") -#define MSG_USERWAIT "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("Wait for user...") -#define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xb6\xde\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "プリントガチュウシサレマシタ" ("Print aborted") -#define MSG_NO_MOVE "\xb3\xba\xde\xb7\xcf\xbe\xdd" // "ウゴキマセン" ("No move.") -#define MSG_KILLED "\xcb\xbc\xde\xae\xb3\xc3\xb2\xbc" // "ヒジョウテイシ" ("KILLED. ") -#define MSG_STOPPED "\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "テイシシマシタ" ("STOPPED. ") -#if LCD_WIDTH >= 20 - #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3 mm" // "ヒキコミリョウ mm" ("Retract mm") - #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S mm" // "ヒキコミリョウS mm" ("Swap Re.mm") - #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde mm/s" // "ヒキコミソクド mm/s" ("Retract V") - #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb mm" // "ノズルタイヒ mm" ("Hop mm") - #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3 mm" // "ホショウリョウ mm" ("UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S mm" // "ホショウリョウS mm" ("S UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde mm/s" // "ホショウソクド mm/s" ("UnRet V") -#else - #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm") - #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm") - #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V") - #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm") - #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V") -#endif -#define MSG_AUTORETRACT "\xbc\xde\xc4\xde\xb3\xcb\xb7\xba\xd0" // "ジドウヒキコミ" ("AutoRetr.") -#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("Change filament") -#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "SDカードサイヨミコミ" ("Init. SD card") -#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "SDカードコウカン" ("Change SD card") -#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde\x20\xcd\xde\xaf\xc4\xde\xb6\xde\xb2" // "Zプローブ ベッドガイ" ("Z probe out. bed") -#if LCD_WIDTH >= 20 - #define MSG_BLTOUCH_SELFTEST "BLTouch \xbc\xde\xba\xbc\xdd\xc0\xde\xdd" // "BLTouch ジコシンダン" ("BLTouch Self-Test") -#else - #define MSG_BLTOUCH_SELFTEST "BLTouch \xbe\xd9\xcc\xc3\xbd\xc4" // "BLTouch セルフテスト" ("BLTouch Self-Test") -#endif -#define MSG_BLTOUCH_RESET "BLTouch \xd8\xbe\xaf\xc4" // "BLTouch リセット" ("Reset BLTouch") -#define MSG_HOME "\xbb\xb7\xc6" // "サキニ" ("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#if LCD_WIDTH >= 20 - #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "ヲフッキサセテクダサイ" ("first") -#else - #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "ヲフッキサセヨ" ("first") -#endif -#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Z Offset") -#define MSG_BABYSTEP_X "X\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Xジク ビドウ" ("Babystep X") -#define MSG_BABYSTEP_Y "Y\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Yジク ビドウ" ("Babystep Y") -#define MSG_BABYSTEP_Z "Z\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Zジク ビドウ" ("Babystep Z") -#if LCD_WIDTH >= 20 - #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1\xb7\xc9\xb3" // "イドウゲンカイケンチキノウ" ("Endstop abort") -#else - #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort") -#endif -#define MSG_HEATING_FAILED_LCD "\xb6\xc8\xc2\xbc\xaf\xca\xdf\xb2" // "カネツシッパイ" ("Heating failed") -#if LCD_WIDTH >= 20 - #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0\xb0\xb7\xc9\xb3" // "エラー:ジョウチョウサーミスターキノウ" ("Err: REDUNDANT TEMP") -#else - #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP") -#endif -#define MSG_THERMAL_RUNAWAY "\xc8\xc2\xce\xde\xb3\xbf\xb3" // "ネツボウソウ" ("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP "\xb4\xd7\xb0:\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:サイコウオンチョウカ" ("Err: MAXTEMP") -#define MSG_ERR_MINTEMP "\xb4\xd7\xb0:\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:サイテイオンミマン" ("Err: MINTEMP") -#if LCD_WIDTH >= 20 - #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:ベッド サイコウオンチョウカ" ("Err: MAXTEMP BED") - #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:ベッド サイテイオンミマン" ("Err: MINTEMP BED") -#else - #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED") - #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED") -#endif -#define MSG_ERR_Z_HOMING MSG_HOME " " MSG_X MSG_Y " " MSG_FIRST // "サキニ XY ヲフッキサセテクダサイ" or "サキニ XY ヲフッキサセヨ" ("G28 Z Forbidden") -#define MSG_HALTED "\xcc\xdf\xd8\xdd\xc0\xb0\xca\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "プリンターハテイシシマシタ" ("PRINTER HALTED") -#define MSG_PLEASE_RESET "\xd8\xbe\xaf\xc4\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "リセットシテクダサイ" ("Please reset") -#define MSG_SHORT_DAY "d" // One character only -#define MSG_SHORT_HOUR "h" // One character only -#define MSG_SHORT_MINUTE "m" // One character only -#define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...") -#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating...") -#define MSG_DELTA_CALIBRATE "\xc3\xde\xd9\xc0\x20\xba\xb3\xbe\xb2" // "デルタ コウセイ" ("Delta Calibration") -#define MSG_DELTA_CALIBRATE_X "X\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Xジク コウセイ" ("Calibrate X") -#define MSG_DELTA_CALIBRATE_Y "Y\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Yジク コウセイ" ("Calibrate Y") -#define MSG_DELTA_CALIBRATE_Z "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") -#define MSG_DELTA_CALIBRATE_CENTER "\xc1\xad\xb3\xbc\xdd\x20\xba\xb3\xbe\xb2" // "チュウシン コウセイ" ("Calibrate Center") -#define MSG_INFO_MENU "\xba\xc9\xcc\xdf\xd8\xdd\xc0\xb0\xc6\xc2\xb2\xc3" // "コノプリンターニツイテ" ("About Printer") -#define MSG_INFO_PRINTER_MENU "\xcc\xdf\xd8\xdd\xc0\xb0\xbc\xde\xae\xb3\xce\xb3" // "プリンタージョウホウ" ("Printer Info") -#define MSG_INFO_STATS_MENU "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xae\xb3\xb7\xae\xb3" // "プリントジョウキョウ" ("Printer Stats") -#define MSG_INFO_BOARD_MENU "\xbe\xb2\xb7\xde\xae\xb9\xb2\xbc\xde\xae\xb3\xce\xb3" // "セイギョケイジョウホウ" ("Board Info") -#define MSG_INFO_THERMISTOR_MENU "\xbb\xb0\xd0\xbd\xc0\xb0" // "サーミスター" ("Thermistors") -#define MSG_INFO_EXTRUDERS "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\xbd\xb3" // "エクストルーダースウ" ("Extruders") -#define MSG_INFO_BAUDRATE "\xce\xde\xb0\xda\xb0\xc4" // "ボーレート" ("Baud") -#define MSG_INFO_PROTOCOL "\xcc\xdf\xdb\xc4\xba\xd9" // "プロトコル" ("Protocol") -#define MSG_CASE_LIGHT "\xb7\xae\xb3\xc0\xb2\xc5\xb2\xbc\xae\xb3\xd2\xb2" // "キョウタイナイショウメイ" ("Case light") -#define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3" // "プリントスウ" ("Print Count") -#define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed") -#define MSG_INFO_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd\xd9\xb2\xb9\xb2" // "プリントジカンルイケイ" ("Total print time") -#define MSG_INFO_PRINT_LONGEST "\xbb\xb2\xc1\xae\xb3\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "サイチョウプリントジカン" ("Longest job time") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbc\xd6\xb3\xd8\xae\xb3\xd9\xb2\xb9\xb2" // "フィラメントシヨウリョウルイケイ" ("Extruded total") -#else - #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xbc\xd6\xb3\xd8\xae\xb3" // "フィラメントソウシヨウリョウ" ("Extruded") -#endif -#define MSG_INFO_MIN_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xc3\xb2\xb5\xdd" // "セッテイサイテイオン" ("Min Temp") -#define MSG_INFO_MAX_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xba\xb3\xb5\xdd" // "セッテイサイコウオン" ("Max Temp") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd\xbc\xad\xcd\xde\xc2" // "デンゲンシュベツ" ("Power Supply") -#else - #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd" // "デンゲン" ("Power Supply") -#endif -#define MSG_DRIVE_STRENGTH "\xd3\xb0\xc0\xb0\xb8\xc4\xde\xb3\xd8\xae\xb8" // "モータークドウリョク" ("Drive Strength") -#if LCD_WIDTH >= 20 - #define MSG_DAC_PERCENT "DAC\xbc\xad\xc2\xd8\xae\xb8 %" // "DACシュツリョク %" ("Driver %") -#else - #define MSG_DAC_PERCENT "DAC\xbc\xad\xc2\xd8\xae\xb8" // "DACシュツリョク" ("Driver %") -#endif -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "メモリヘカクノウ" ("DAC EEPROM Write") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Wait for start") - #define MSG_FILAMENT_CHANGE_INIT_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("of the filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Wait for") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament unload") - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xa6\xbf\xb3\xc6\xad\xb3\xbc," // "フィラメントヲソウニュウシ," ("Insert filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 "\xb8\xd8\xaf\xb8\xbd\xd9\xc4\xbf\xde\xaf\xba\xb3\xbc\xcf\xbd" // "クリックスルトゾッコウシマス" ("and press button") - #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Wait for") - #define MSG_FILAMENT_CHANGE_LOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament load") - #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("to resume") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Please wait...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Ejecting...") - #if LCD_WIDTH >= 20 - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ソウニュウシ,クリックシテクダサイ" ("Insert and Click") - #else - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbe\xd6" // "ソウニュウシ,クリックセヨ" ("Insert and Click") - #endif - #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Loading...") - #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Resuming...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_KANA_H diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h deleted file mode 100644 index 050f3277a7..0000000000 --- a/Marlin/language_kana_utf8.h +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Japanese (Kana) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#ifndef LANGUAGE_KANA_UTF_H -#define LANGUAGE_KANA_UTF_H - -#define MAPPER_E382E383 -#define DISPLAY_CHARSET_ISO10646_KANA -#define CHARSIZE 3 - -// This just to show the potential benefit of unicode. -// This translation can be improved by using the full charset of unicode codeblock U+30A0 to U+30FF. - -// 片仮名表示定義 -#define WELCOME_MSG MACHINE_NAME _UxGT(" ready.") -#define MSG_SD_INSERTED _UxGT("カードガソウニュウサレマシタ") // "Card inserted" -#define MSG_SD_REMOVED _UxGT("カードガアリマセン") // "Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("エンドストップ") // "Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("メイン") // "Main" -#define MSG_AUTOSTART _UxGT("ジドウカイシ") // "Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("モーターデンゲン オフ") // "Disable steppers" -#define MSG_DEBUG_MENU _UxGT("デバッグメニュー") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("プログレスバー テスト") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("ゲンテンフッキ") // "Auto home" -#define MSG_AUTO_HOME_X _UxGT("Xジク ゲンテンフッキ") // "Home X" -#define MSG_AUTO_HOME_Y _UxGT("Yジク ゲンテンフッキ") // "Home Y" -#define MSG_AUTO_HOME_Z _UxGT("Zジク ゲンテンフッキ") // "Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("Zジク コウセイ") // "Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("ゲンテンフッキチュウ") // "Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("レベリングカイシ") // "Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("ツギノソクテイテンヘ") // "Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("レベリングカンリョウ") // "Leveling Done!" -#define MSG_SET_HOME_OFFSETS _UxGT("キジュンオフセットセッテイ") // "Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("オフセットガテキヨウサレマシタ") // "Offsets applied" -#define MSG_SET_ORIGIN _UxGT("キジュンセット") // "Set origin" -#define MSG_PREHEAT_1 _UxGT("PLA ヨネツ") // "Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("PLA スベテヨネツ") // " All" -#define MSG_PREHEAT_1_BEDONLY _UxGT("PLA ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("セッテイ") // " conf" -#define MSG_PREHEAT_2 _UxGT("ABS ヨネツ") // "Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL _UxGT("ABS スベテヨネツ") // " All" -#define MSG_PREHEAT_2_BEDONLY _UxGT("ABS ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("セッテイ") // " conf" -#define MSG_COOLDOWN _UxGT("カネツテイシ") // "Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("デンゲン オン") // "Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("デンゲン オフ") // "Switch power off" -#define MSG_EXTRUDE _UxGT("オシダシ") // "Extrude" -#define MSG_RETRACT _UxGT("ヒキコミセッテイ") // "Retract" -#define MSG_MOVE_AXIS _UxGT("ジクイドウ") // "Move axis" -#define MSG_BED_LEVELING _UxGT("ベッドレベリング") // "Bed leveling" -#define MSG_LEVEL_BED _UxGT("ベッドレベリング") // "Level bed" -#define MSG_MOVING _UxGT("イドウチュウ...") // "Moving..." -#define MSG_FREE_XY _UxGT("XYジク カイホウ") // "Free XY" -#define MSG_MOVE_X _UxGT("Xジク イドウ") // "Move X" -#define MSG_MOVE_Y _UxGT("Yジク イドウ") // "Move Y" -#define MSG_MOVE_Z _UxGT("Zジク イドウ") // "Move Z" -#define MSG_MOVE_E _UxGT("エクストルーダー") // "Extruder" -#define MSG_MOVE_01MM _UxGT("0.1mm イドウ") // "Move 0.1mm" -#define MSG_MOVE_1MM _UxGT(" 1mm イドウ") // "Move 1mm" -#define MSG_MOVE_10MM _UxGT(" 10mm イドウ") // "Move 10mm" -#define MSG_SPEED _UxGT("ソクド") // "Speed" -#define MSG_BED_Z _UxGT("Zオフセット") // "Bed Z" -#define MSG_NOZZLE _UxGT("ノズル") // "Nozzle" -#define MSG_BED _UxGT("ベッド") // "Bed" -#define MSG_FAN_SPEED _UxGT("ファンソクド") // "Fan speed" -#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_ON _UxGT("オン ") // "On " -#define MSG_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("センタク") // "Select" -#define MSG_ACC _UxGT("カソクド mm/s2") // "Accel" -#define MSG_JERK _UxGT("ヤクド mm/s") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Aジク ヤクド mm/s") // "Va-jerk" - #define MSG_VB_JERK _UxGT("Bジク ヤクド mm/s") // "Vb-jerk" - #define MSG_VC_JERK _UxGT("Cジク ヤクド mm/s") // "Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("Xジク ヤクド mm/s") // "Vx-jerk" - #define MSG_VB_JERK _UxGT("Yジク ヤクド mm/s") // "Vy-jerk" - #define MSG_VC_JERK _UxGT("Zジク ヤクド mm/s") // "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_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("サイダイカソクド ") // "Amax " -#define MSG_A_RETRACT _UxGT("ヒキコミカソクド") // "A-retract" -#define MSG_A_TRAVEL _UxGT("イドウカソクド") // "A-travel" -#define MSG_TEMPERATURE _UxGT("オンド") // "Temperature" -#define MSG_MOTION _UxGT("ウゴキセッテイ") // "Motion" -#define MSG_FILAMENT _UxGT("フィラメント") // "Filament" -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("フィラメントチョッケイ") // "Fil. Dia." -#define MSG_CONTRAST _UxGT("LCDコントラスト") // "LCD contrast" -#define MSG_STORE_EEPROM _UxGT("メモリヘカクノウ") // "Store memory" -#define MSG_LOAD_EEPROM _UxGT("メモリカラヨミコミ") // "Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("セッテイリセット") // "Restore failsafe" -#define MSG_REFRESH _UxGT("リフレッシュ") // "Refresh" -#define MSG_WATCH _UxGT("ジョウホウガメン") // "Info screen" -#define MSG_PREPARE _UxGT("ジュンビセッテイ") // "Prepare" -#define MSG_TUNE _UxGT("チョウセイ") // "Tune" -#define MSG_PAUSE_PRINT _UxGT("イチジテイシ") // "Pause print" -#define MSG_RESUME_PRINT _UxGT("プリントサイカイ") // "Resume print" -#define MSG_STOP_PRINT _UxGT("プリントテイシ") // "Stop print" -#define MSG_CARD_MENU _UxGT("SDカードカラプリント") // "Print from SD" -#define MSG_NO_CARD _UxGT("SDカードガアリマセン") // "No SD card" -#define MSG_DWELL _UxGT("キュウシ...") // "Sleep..." -#define MSG_USERWAIT _UxGT("シバラクオマチクダサイ...") // "Wait for user..." -#define MSG_PRINT_ABORTED _UxGT("プリントガチュウシサレマシタ") // "Print aborted" -#define MSG_NO_MOVE _UxGT("ウゴキマセン") // "No move." -#define MSG_KILLED _UxGT("ヒジョウテイシ") // "KILLED. " -#define MSG_STOPPED _UxGT("テイシシマシタ") // "STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("ヒキコミリョウ mm") // "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP _UxGT("ヒキコミリョウS mm") // "Swap Re.mm" -#define MSG_CONTROL_RETRACTF _UxGT("ヒキコミソクド mm/s") // "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("ノズルタイヒ mm") // "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("ホショウリョウ mm") // "UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("ホショウリョウS mm") // "S UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("ホショウソクド mm/s") // "UnRet V" -#define MSG_AUTORETRACT _UxGT("ジドウヒキコミ") // "AutoRetr." -#define MSG_FILAMENTCHANGE _UxGT("フィラメントコウカン") // "Change filament" -#define MSG_INIT_SDCARD _UxGT("SDカードサイヨミコミ") // "Init. SD card" -#define MSG_CNG_SDCARD _UxGT("SDカードコウカン") // "Change SD card" -#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_ZPROBE_ZOFFSET _UxGT("Zオフセット") // "Z Offset" -#define MSG_BABYSTEP_X _UxGT("Xジク ビドウ") // "Babystep X" -#define MSG_BABYSTEP_Y _UxGT("Yジク ビドウ") // "Babystep Y" -#define MSG_BABYSTEP_Z _UxGT("Zジク ビドウ") // "Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("イドウゲンカイケンチキノウ") // "Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("カネツシッパイ") // "Heating failed" -#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 // "G28 Z Forbidden" -#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("カネツチュウ...") // "Heating..." -#define MSG_BED_HEATING _UxGT("ベッド カネツチュウ...") // "Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("デルタ コウセイ") // "Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("Xジク コウセイ") // "Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("Yジク コウセイ") // "Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("Zジク コウセイ") // "Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("チュウシン コウセイ") // "Calibrate Center" -#define MSG_INFO_MENU _UxGT("コノプリンターニツイテ") // "About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("プリンタージョウホウ") // "Printer Info" -#define MSG_INFO_STATS_MENU _UxGT("プリントジョウキョウ") // "Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("セイギョケイジョウホウ") // "Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("サーミスター") // "Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("エクストルーダースウ") // "Extruders" -#define MSG_INFO_BAUDRATE _UxGT("ボーレート") // "Baud" -#define MSG_INFO_PROTOCOL _UxGT("プロトコル") // "Protocol" -#define MSG_CASE_LIGHT _UxGT("キョウタイナイショウメイ") // "Case light" -#define MSG_INFO_PRINT_COUNT _UxGT("プリントスウ ") // "Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("カンリョウスウ") // "Completed" -#define MSG_INFO_PRINT_TIME _UxGT("プリントジカンルイケイ") // "Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("サイチョウプリントジカン") // "Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("フィラメントシヨウリョウルイケイ") // "Extruded total" -#define MSG_INFO_MIN_TEMP _UxGT("セッテイサイテイオン") // "Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("セッテイサイコウオン") // "Max Temp" -#define MSG_INFO_PSU _UxGT("デンゲンシュベツ") // "Power Supply" -#define MSG_DRIVE_STRENGTH _UxGT("モータークドウリョク") // "Drive Strength" -#define MSG_DAC_PERCENT _UxGT("DACシュツリョク %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "DAC EEPROM Write" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("プリントサイカイ") // "Resume print" -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("コウカンヲカイシシマス") // "Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("シバラクオマチクダサイ") // "of the filament" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("フィラメントヌキダシチュウ") // "Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("シバラクオマチクダサイ") // "filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("フィラメントヲソウニュウシ,") // "Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("クリックスルトゾッコウシマス") // "and press button" -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("フィラメントソウテンチュウ") // "Wait for" -#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" - -#endif // LANGUAGE_KANA_UTF_H diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h deleted file mode 100644 index 128bceaf41..0000000000 --- a/Marlin/language_nl.h +++ /dev/null @@ -1,283 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Dutch - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_NL_H -#define LANGUAGE_NL_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gereed.") -#define MSG_BACK _UxGT("Terug") -#define MSG_SD_INSERTED _UxGT("Kaart ingestoken") -#define MSG_SD_REMOVED _UxGT("Kaart verwijderd") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Hoofdmenu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren uit") -#define MSG_DEBUG_MENU _UxGT("Debug Menu") //accepted English terms -#define MSG_PROGRESS_BAR_TEST _UxGT("Vooruitgang Test") -#define MSG_AUTO_HOME _UxGT("Auto home") -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibreer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik voor begin") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Volgende Plaats") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level kompl.") -#define MSG_SET_HOME_OFFSETS _UxGT("Zet home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("H offset toegep.") -#define MSG_SET_ORIGIN _UxGT("Nulpunt instellen") -#define MSG_PREHEAT_1 _UxGT("PLA voorverwarmen") -#define MSG_PREHEAT_1_N _UxGT("PLA voorverw. ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("aan") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Einde") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("PLA verw. conf") -#define MSG_PREHEAT_2 _UxGT("ABS voorverwarmen") -#define MSG_PREHEAT_2_N _UxGT("ABS voorverw. ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("aan") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Einde") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("ABS verw. conf") -#define MSG_COOLDOWN _UxGT("Afkoelen") -#define MSG_SWITCH_PS_ON _UxGT("Stroom aan") -#define MSG_SWITCH_PS_OFF _UxGT("Stroom uit") -#define MSG_EXTRUDE _UxGT("Extrude") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("As verplaatsen") -#define MSG_BED_LEVELING _UxGT("Bed Leveling") -#define MSG_LEVEL_BED _UxGT("Level bed") -#define MSG_MOVING _UxGT("Verplaatsen...") -#define MSG_FREE_XY _UxGT("Vrij XY") -#define MSG_MOVE_X _UxGT("Verplaats X") -#define MSG_MOVE_Y _UxGT("Verplaats Y") -#define MSG_MOVE_Z _UxGT("Verplaats Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Verplaats 0.1mm") -#define MSG_MOVE_1MM _UxGT("Verplaats 1mm") -#define MSG_MOVE_10MM _UxGT("Verplaats 10mm") -#define MSG_SPEED _UxGT("Snelheid") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Bed") -#define MSG_FAN_SPEED _UxGT("Fan snelheid") -#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_ON _UxGT("Aan ") -#define MSG_OFF _UxGT("Uit") -#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("Selecteer") -#define MSG_ACC _UxGT("Versn") -#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_TEMPERATURE _UxGT("Temperatuur") -#define MSG_MOTION _UxGT("Beweging") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_ADVANCE_K _UxGT("Advance K") //accepted english dutch -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD contrast") -#define MSG_STORE_EEPROM _UxGT("Geheugen opslaan") -#define MSG_LOAD_EEPROM _UxGT("Geheugen laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Noodstop reset") -#define MSG_REFRESH _UxGT("Ververs") -#define MSG_WATCH _UxGT("Info scherm") -#define MSG_PREPARE _UxGT("Voorbereiden") -#define MSG_TUNE _UxGT("Afstellen") -#define MSG_PAUSE_PRINT _UxGT("Print pauzeren") -#define MSG_RESUME_PRINT _UxGT("Print hervatten") -#define MSG_STOP_PRINT _UxGT("Print stoppen") -#define MSG_CARD_MENU _UxGT("Print van SD") -#define MSG_NO_CARD _UxGT("Geen SD kaart") -#define MSG_DWELL _UxGT("Slapen...") -#define MSG_USERWAIT _UxGT("Wachten...") -#define MSG_PRINT_ABORTED _UxGT("Print afgebroken") -#define MSG_NO_MOVE _UxGT("Geen beweging.") -#define MSG_KILLED _UxGT("Afgebroken. ") -#define MSG_STOPPED _UxGT("Gestopt. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") //accepted English term in Dutch -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ruil Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ruil UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet F") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Verv. Filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD kaart") -#define MSG_CNG_SDCARD _UxGT("Verv. SD Kaart") -#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_ZPROBE_ZOFFSET _UxGT("Z Offset") //accepted English term in Dutch -#define MSG_BABYSTEP_X _UxGT("Babystap X") -#define MSG_BABYSTEP_Y _UxGT("Babystap Y") -#define MSG_BABYSTEP_Z _UxGT("Babystap Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop afbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("Voorverw. fout") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Redun. temp fout") -#define MSG_THERMAL_RUNAWAY _UxGT("Therm. wegloop") -#define MSG_ERR_MAXTEMP _UxGT("Err: Max. temp") -#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_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 -#define MSG_SHORT_HOUR _UxGT("h") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Voorwarmen...") -#define MSG_BED_HEATING _UxGT("Bed voorverw...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Calibratie") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibreer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibreer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibreer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibreer Midden") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibratie") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Zet Delta Hoogte") - -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") //accepted English term in Dutch -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_MENU _UxGT("Over Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Case licht") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Printed Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Totaal Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Totale Printtijd") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste Printtijd") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totaal Extrudeert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Printtijd ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("PSU") //accepted English term in Dutch - -#define MSG_DRIVE_STRENGTH _UxGT("Motorstroom") -#define MSG_DAC_PERCENT _UxGT("Driver %") //accepted English term in Dutch -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC Opslaan") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Hervat print") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") //accepeted English term -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - // Up to 3 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filament te") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("verwisselen") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament uit") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("te laden") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozzle verw.") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Wacht a.u.b.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("om verder...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament te") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("laden") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("om verder") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("te gaan") -#else // LCD_HEIGHT < 4 - // Up to 2 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("start...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("uitladen...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Verwarmen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("inladen...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("printing...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_NL_H diff --git a/Marlin/language_pl-DOGM.h b/Marlin/language_pl-DOGM.h deleted file mode 100644 index 5839325726..0000000000 --- a/Marlin/language_pl-DOGM.h +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish for DOGM display - includes accented characters - */ - -#ifndef LANGUAGE_PL_DOGM_H -#define LANGUAGE_PL_DOGM_H -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") -#define MSG_SD_INSERTED _UxGT("Karta włożona") -#define MSG_SD_REMOVED _UxGT("Karta usunięta") -#define MSG_LCD_ENDSTOPS _UxGT("Kranców.") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu główne") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Wyłącz silniki") -#define MSG_AUTO_HOME _UxGT("Pozycja zerowa") -#define MSG_AUTO_HOME_X _UxGT("Zeruj X") -#define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") -#define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") -#define MSG_LEVEL_BED _UxGT("Poziom. stołu") -#define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Następny punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Wypoziomowano!") -#define MSG_USER_MENU _UxGT("Własne Polecenia") -#define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") -#define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stół PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. PLA") -#define MSG_PREHEAT_2 _UxGT("Rozgrzej ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stół ABS") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. ABS") -#define MSG_COOLDOWN _UxGT("Chłodzenie") -#define MSG_SWITCH_PS_ON _UxGT("Włącz zasilacz") -#define MSG_SWITCH_PS_OFF _UxGT("Wyłącz zasilacz") -#define MSG_EXTRUDE _UxGT("Ekstruzja") -#define MSG_RETRACT _UxGT("Wycofanie") -#define MSG_MOVE_AXIS _UxGT("Ruch osi") -#define MSG_BED_LEVELING _UxGT("Poziom. stołu") -#define MSG_MOVE_X _UxGT("Przesuń w X") -#define MSG_MOVE_Y _UxGT("Przesuń w Y") -#define MSG_MOVE_Z _UxGT("Przesuń w Z") -#define MSG_MOVE_E _UxGT("Ekstruzja (os E)") -#define MSG_MOVE_01MM _UxGT("Przesuń co .1mm") -#define MSG_MOVE_1MM _UxGT("Przesuń co 1mm") -#define MSG_MOVE_10MM _UxGT("Przesuń co 10mm") -#define MSG_SPEED _UxGT("Predkość") -#define MSG_BED_Z _UxGT("Stół Z") -#define MSG_NOZZLE _UxGT("Dysza") -#define MSG_BED _UxGT("Stół") -#define MSG_FAN_SPEED _UxGT("Obroty wiatraka") -#define MSG_FLOW _UxGT("Przepływ") -#define MSG_CONTROL _UxGT("Ustawienia") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnożnik") -#define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_ON _UxGT("Wł. ") -#define MSG_OFF _UxGT("Wył.") -#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("Select") -#define MSG_ACC _UxGT("Przyśpieszenie") -#define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif -#define MSG_VE_JERK _UxGT("Zryw Ve") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vskok min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax") -#define MSG_A_RETRACT _UxGT("A-wycofanie") -#define MSG_A_TRAVEL _UxGT("A-przesuń.") -#define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif -#define MSG_ESTEPS _UxGT("krokiE/mm") -#define MSG_E1STEPS _UxGT("krokiE1/mm") -#define MSG_E2STEPS _UxGT("krokiE2/mm") -#define MSG_E3STEPS _UxGT("krokiE3/mm") -#define MSG_E4STEPS _UxGT("krokiE4/mm") -#define MSG_E5STEPS _UxGT("krokiE5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Ruch") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") -#define MSG_FILAMENT_DIAM _UxGT("Śr. fil.") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Zapisz w pamięci") -#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamięci") -#define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") -#define MSG_REFRESH _UxGT("Odswież") -#define MSG_WATCH _UxGT("Ekran główny") -#define MSG_PREPARE _UxGT("Przygotuj") -#define MSG_TUNE _UxGT("Strojenie") -#define MSG_PAUSE_PRINT _UxGT("Pauza") -#define MSG_RESUME_PRINT _UxGT("Wznowienie") -#define MSG_STOP_PRINT _UxGT("Stop") -#define MSG_CARD_MENU _UxGT("Karta SD") -#define MSG_NO_CARD _UxGT("Brak karty") -#define MSG_DWELL _UxGT("Uśpij...") -#define MSG_USERWAIT _UxGT("Oczekiwanie...") -#define MSG_PRINT_ABORTED _UxGT("Druk przerwany") -#define MSG_NO_MOVE _UxGT("Brak ruchu") -#define MSG_KILLED _UxGT("Ubity. ") -#define MSG_STOPPED _UxGT("Zatrzymany. ") -#define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Skok Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") -#define MSG_AUTORETRACT _UxGT("Auto. wycofanie") -#define MSG_FILAMENTCHANGE _UxGT("Zmień filament") -#define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CNG_SDCARD _UxGT("Zmiana karty SD") -#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_ZPROBE_ZOFFSET _UxGT("Offset Z") -#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("Błąd krańcówki") -#define MSG_HEATING_FAILED_LCD _UxGT("Rozgrz. nieudane") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Błąd temperatury") -#define MSG_THERMAL_RUNAWAY _UxGT("Zanik temp.") -#define MSG_ERR_MAXTEMP _UxGT("Err max temp") -#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_HALTED _UxGT("Drukarka zatrzym.") -#define MSG_PLEASE_RESET _UxGT("Proszę zresetować") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("g") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Rozgrzewanie...") -#define MSG_BED_HEATING _UxGT("Rozgrzewanie stołu...") -#define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibruj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibruj środek") - -#define MSG_INFO_MENU _UxGT("O drukarce") -#define MSG_INFO_PRINTER_MENU _UxGT("Info drukarki") -#define MSG_INFO_STATS_MENU _UxGT("Statystyki") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistory") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstrudery") -#define MSG_INFO_BAUDRATE _UxGT("Predkość USB") -#define MSG_INFO_PROTOCOL _UxGT("Protokół") -#define MSG_CASE_LIGHT _UxGT("Oświetlenie") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Czas druku") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Razem") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Zasilacz") - -#define MSG_DRIVE_STRENGTH _UxGT("Siła silnika") -#define MSG_DAC_PERCENT _UxGT("Siła %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEŃ FILAMENT") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEŃ OPCJE:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznów drukowanie") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmianę filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjęcie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i naciśnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuować...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("włożenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Proszę czekać...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóż i naciśnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ładowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_PL_DOGM_H diff --git a/Marlin/language_pl-HD44780.h b/Marlin/language_pl-HD44780.h deleted file mode 100644 index 933b5b9e53..0000000000 --- a/Marlin/language_pl-HD44780.h +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish for HD44780 display - no accented characters - */ - -#ifndef LANGUAGE_PL_HD44780_H -#define LANGUAGE_PL_HD44780_H - -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") -#define MSG_SD_INSERTED _UxGT("Karta wlozona") -#define MSG_SD_REMOVED _UxGT("Karta usunieta") -#define MSG_LCD_ENDSTOPS _UxGT("Krancow.") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu glowne") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Wylacz silniki") -#define MSG_AUTO_HOME _UxGT("Pozycja zerowa") -#define MSG_AUTO_HOME_X _UxGT("Zeruj X") -#define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") -#define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") -#define MSG_LEVEL_BED _UxGT("Poziom. stolu") -#define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nastepny punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Wypoziomowano!") -#define MSG_USER_MENU _UxGT("Wlasne Polecenia") -#define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") -#define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stol PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. PLA") -#define MSG_PREHEAT_2 _UxGT("Rozgrzej ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stol ABS") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. ABS") -#define MSG_COOLDOWN _UxGT("Chlodzenie") -#define MSG_SWITCH_PS_ON _UxGT("Wlacz zasilacz") -#define MSG_SWITCH_PS_OFF _UxGT("Wylacz zasilacz") -#define MSG_EXTRUDE _UxGT("Ekstruzja") -#define MSG_RETRACT _UxGT("Wycofanie") -#define MSG_MOVE_AXIS _UxGT("Ruch osi") -#define MSG_BED_LEVELING _UxGT("Poziom. stolu") -#define MSG_MOVE_X _UxGT("Przesun w X") -#define MSG_MOVE_Y _UxGT("Przesun w Y") -#define MSG_MOVE_Z _UxGT("Przesun w Z") -#define MSG_MOVE_E _UxGT("Ekstruzja (os E)") -#define MSG_MOVE_01MM _UxGT("Przesun co .1mm") -#define MSG_MOVE_1MM _UxGT("Przesun co 1mm") -#define MSG_MOVE_10MM _UxGT("Przesun co 10mm") -#define MSG_SPEED _UxGT("Predkosc") -#define MSG_BED_Z _UxGT("Stol Z") -#define MSG_NOZZLE _UxGT("Dysza") -#define MSG_BED _UxGT("Stol") -#define MSG_FAN_SPEED _UxGT("Obroty wiatraka") -#define MSG_FLOW _UxGT("Przeplyw") -#define MSG_CONTROL _UxGT("Ustawienia") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnoznik") -#define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_ON _UxGT("Wl. ") -#define MSG_OFF _UxGT("Wyl.") -#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("Select") -#define MSG_ACC _UxGT("Przyspieszenie") -#define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif -#define MSG_VE_JERK _UxGT("Zryw Ve") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vskok min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax") -#define MSG_A_RETRACT _UxGT("A-wycofanie") -#define MSG_A_TRAVEL _UxGT("A-przesun.") -#define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif -#define MSG_ESTEPS _UxGT("krokiE/mm") -#define MSG_E1STEPS _UxGT("krokiE1/mm") -#define MSG_E2STEPS _UxGT("krokiE2/mm") -#define MSG_E3STEPS _UxGT("krokiE3/mm") -#define MSG_E4STEPS _UxGT("krokiE4/mm") -#define MSG_E5STEPS _UxGT("krokiE5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Ruch") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") -#define MSG_FILAMENT_DIAM _UxGT("Sr. fil.") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Zapisz w pamieci") -#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamieci") -#define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") -#define MSG_REFRESH _UxGT("Odswiez") -#define MSG_WATCH _UxGT("Ekran glowny") -#define MSG_PREPARE _UxGT("Przygotuj") -#define MSG_TUNE _UxGT("Strojenie") -#define MSG_PAUSE_PRINT _UxGT("Pauza") -#define MSG_RESUME_PRINT _UxGT("Wznowienie") -#define MSG_STOP_PRINT _UxGT("Stop") -#define MSG_CARD_MENU _UxGT("Karta SD") -#define MSG_NO_CARD _UxGT("Brak karty") -#define MSG_DWELL _UxGT("Uspij...") -#define MSG_USERWAIT _UxGT("Oczekiwanie...") -#define MSG_PRINT_ABORTED _UxGT("Druk przerwany") -#define MSG_NO_MOVE _UxGT("Brak ruchu") -#define MSG_KILLED _UxGT("Ubity. ") -#define MSG_STOPPED _UxGT("Zatrzymany. ") -#define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Skok Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") -#define MSG_AUTORETRACT _UxGT("Auto. wycofanie") -#define MSG_FILAMENTCHANGE _UxGT("Zmien filament") -#define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CNG_SDCARD _UxGT("Zmiana karty SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z za stolem") -#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("Offset Z") -#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("Blad krancowki") -#define MSG_HEATING_FAILED_LCD _UxGT("Rozgrz. nieudane") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Blad temperatury") -#define MSG_THERMAL_RUNAWAY _UxGT("Zanik temp.") -#define MSG_ERR_MAXTEMP _UxGT("Err max temp") -#define MSG_ERR_MINTEMP _UxGT("Err min temp") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err max temp stolu") -#define MSG_ERR_MINTEMP_BED _UxGT("Err min temp stolu") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("Drukarka zatrzym.") -#define MSG_PLEASE_RESET _UxGT("Prosze zresetowac") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("g") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Rozgrzewanie...") -#define MSG_BED_HEATING _UxGT("Rozgrzewanie stolu...") -#define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibruj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibruj srodek") - -#define MSG_INFO_MENU _UxGT("O drukarce") -#define MSG_INFO_PRINTER_MENU _UxGT("Info drukarki") -#define MSG_INFO_STATS_MENU _UxGT("Statystyki") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistory") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstrudery") -#define MSG_INFO_BAUDRATE _UxGT("Predkosc USB") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Oswietlenie") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukonczono") - #define MSG_INFO_PRINT_TIME _UxGT("Czas druku") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdl. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Uzyty fil.") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukonczono") - #define MSG_INFO_PRINT_TIME _UxGT("Razem") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdl. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Uzyty fil.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Zasilacz") - -#define MSG_DRIVE_STRENGTH _UxGT("Sila silnika") -#define MSG_DAC_PERCENT _UxGT("Sila %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEN FILAMENT") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEN OPCJE:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznow drukowanie") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmiane filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjecie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i nacisnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Prosze czekac...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmiane filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjecie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i nacisnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Prosze czekac...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_PL_HD44780_H diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h deleted file mode 100644 index 3bc792714b..0000000000 --- a/Marlin/language_pl.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PL_H -#define LANGUAGE_PL_H - -#define MAPPER_C3C4C5_PL -#define DISPLAY_CHARSET_ISO10646_PL - -/** - * One version with accented characters and one without - */ -#if ENABLED(DOGLCD) - #include "language_pl-DOGM.h" -#else - #include "language_pl-HD44780.h" -#endif - -#endif // LANGUAGE_PL_H diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h deleted file mode 100644 index 303ea1aaa6..0000000000 --- a/Marlin/language_pt-br.h +++ /dev/null @@ -1,382 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese (Brazil) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_BR_H -#define LANGUAGE_PT_BR_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") -#define MSG_SD_INSERTED _UxGT("Cartao inserido") -#define MSG_SD_REMOVED _UxGT("Cartao removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Proximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim da nivelacao!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteracao feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") -#define MSG_COOLDOWN _UxGT("Esfriar") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelacao Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Proximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edicao") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#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("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calcar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Proximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edicao") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevacao") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelacao da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelacao 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelacao Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informacao do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar proximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Proximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memoria") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensacao Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuracao da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrao") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") -#define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazao") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automatica") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") -#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("Selecionar") -#define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif -#define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif -#define MSG_ESTEPS _UxGT("E/mm") -#define MSG_E1STEPS _UxGT("E1/mm") -#define MSG_E2STEPS _UxGT("E2/mm") -#define MSG_E3STEPS _UxGT("E3/mm") -#define MSG_E4STEPS _UxGT("E4/mm") -#define MSG_E5STEPS _UxGT("E5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusao em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avancar K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuracao") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuracao") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualizacao") -#define MSG_WATCH _UxGT("Informacoes") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressao") -#define MSG_RESUME_PRINT _UxGT("Resumir impressao") -#define MSG_STOP_PRINT _UxGT("Parar impressao") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartao SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressao Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGENCIA") -#define MSG_STOPPED _UxGT("PAROU. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retracao Automatica") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") -#define MSG_BABYSTEP_X _UxGT("Passinho X") -#define MSG_BABYSTEP_Y _UxGT("Passinho Y") -#define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TERMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Maxima") -#define MSG_ERR_MINTEMP _UxGT("Erro:Temp Minima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Max") -#define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Min") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibrar 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("Configuracao Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibracao") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequencia Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressoes") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressao Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Forca do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressao") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Minima eh ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir a origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remocao de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botao") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botao") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusao") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressao") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif - -#endif // LANGUAGE_PT_BR_H diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h deleted file mode 100644 index 880b396ff3..0000000000 --- a/Marlin/language_pt-br_utf8.h +++ /dev/null @@ -1,384 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese (Brazil) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_BR_UTF_H -#define LANGUAGE_PT_BR_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") -#define MSG_SD_INSERTED _UxGT("Cartão inserido") -#define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim nivelação!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") -#define MSG_COOLDOWN _UxGT("Esfriar") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelação Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Próximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edição") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#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("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Próximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edição") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevação") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelação da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelação 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelação Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informação do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar próximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Próximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memória") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensação Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuração da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrão") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") -#define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazão") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") -#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("Selecionar") -#define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif -#define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif -#define MSG_ESTEPS _UxGT("E/mm") -#define MSG_E1STEPS _UxGT("E1/mm") -#define MSG_E2STEPS _UxGT("E2/mm") -#define MSG_E3STEPS _UxGT("E3/mm") -#define MSG_E4STEPS _UxGT("E4/mm") -#define MSG_E5STEPS _UxGT("E5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusão em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avançar K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuração") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuração") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualização") -#define MSG_WATCH _UxGT("Informações") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressão") -#define MSG_RESUME_PRINT _UxGT("Resumir impressão") -#define MSG_STOP_PRINT _UxGT("Parar impressão") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressão Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGÊNCIA") -#define MSG_STOPPED _UxGT("PAROU. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retração Automática") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") -#define MSG_BABYSTEP_X _UxGT("Passinho X") -#define MSG_BABYSTEP_Y _UxGT("Passinho Y") -#define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TÉRMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Máxima") -#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_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibrar 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("Configuração Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibração") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatísticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequência Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressões") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressão Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Força do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressão") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Mínima é ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir à origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botão") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botão") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusão") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressão") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif - -#endif // LANGUAGE_PT_BR_UTF_H diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h deleted file mode 100644 index 949381142d..0000000000 --- a/Marlin/language_pt.h +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_H -#define LANGUAGE_PT_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME " pronta." -#define MSG_SD_INSERTED "Cartao inserido" -#define MSG_SD_REMOVED "Cartao removido" -#define MSG_MAIN "Menu principal" -#define MSG_AUTOSTART "Autostart" -#define MSG_DISABLE_STEPPERS "Desactivar motores" -#define MSG_AUTO_HOME "Ir para origem" -#define MSG_AUTO_HOME_X "Ir para origem X" -#define MSG_AUTO_HOME_Y "Ir para origem Y" -#define MSG_AUTO_HOME_Z "Ir para origem Z" -#define MSG_TMC_Z_CALIBRATION "Calibrar Z" -#define MSG_LEVEL_BED_HOMING "Indo para origem" -#define MSG_LEVEL_BED_WAITING "Click para iniciar" -#define MSG_LEVEL_BED_NEXT_POINT "Proximo ponto" -#define MSG_LEVEL_BED_DONE "Pronto !" -#define MSG_SET_HOME_OFFSETS "Definir desvio" -#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" -#define MSG_SET_ORIGIN "Definir origem" -#define MSG_PREHEAT_1 "Pre-aquecer PLA" -#define MSG_PREHEAT_1_N "Pre-aquecer PLA" -#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_1_SETTINGS "Definicoes PLA" -#define MSG_PREHEAT_2 "Pre-aquecer ABS" -#define MSG_PREHEAT_2_N "Pre-aquecer ABS " -#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_2_SETTINGS "Definicoes ABS" -#define MSG_COOLDOWN "Arrefecer" -#define MSG_SWITCH_PS_ON "Ligar" -#define MSG_SWITCH_PS_OFF "Desligar" -#define MSG_EXTRUDE "Extrudir" -#define MSG_RETRACT "Retrair" -#define MSG_MOVE_AXIS "Mover eixo" -#define MSG_MOVE_X "Mover X" -#define MSG_MOVE_Y "Mover Y" -#define MSG_MOVE_Z "Mover Z" -#define MSG_MOVE_E "Mover Extrusor" -#define MSG_MOVE_01MM "Mover 0.1mm" -#define MSG_MOVE_1MM "Mover 1mm" -#define MSG_MOVE_10MM "Mover 10mm" -#define MSG_SPEED "Velocidade" -#define MSG_BED_Z "Base Z" -#define MSG_NOZZLE LCD_STR_THERMOMETER " Bico" -#define MSG_BED LCD_STR_THERMOMETER " Base" -#define MSG_FAN_SPEED "Vel. ventoinha" -#define MSG_FLOW "Fluxo" -#define MSG_CONTROL "Controlo" -#define MSG_MIN LCD_STR_THERMOMETER " Min" -#define MSG_MAX LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP "Temp. Automatica" -#define MSG_ON "On " -#define MSG_OFF "Off" -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_ACC "Acc" -#define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif -#define MSG_VE_JERK "Ve-jerk" -#define MSG_VMAX " Vmax " -#define MSG_VMIN "Vmin" -#define MSG_VTRAV_MIN "VTrav min" -#define MSG_AMAX "Amax " -#define MSG_A_RETRACT "A-retraccao" -#define MSG_A_TRAVEL "A-movimento" -#define MSG_STEPS_PER_MM "Passo/mm" -#if IS_KINEMATIC - #define MSG_ASTEPS "A passo/mm" - #define MSG_BSTEPS "B passo/mm" - #define MSG_CSTEPS "C passo/mm" -#else - #define MSG_ASTEPS "X passo/mm" - #define MSG_BSTEPS "Y passo/mm" - #define MSG_CSTEPS "Z passo/mm" -#endif -#define MSG_ESTEPS "E passo/mm" -#define MSG_E1STEPS "E1 passo/mm" -#define MSG_E2STEPS "E2 passo/mm" -#define MSG_E3STEPS "E3 passo/mm" -#define MSG_E4STEPS "E4 passo/mm" -#define MSG_E5STEPS "E5 passo/mm" -#define MSG_TEMPERATURE "Temperatura" -#define MSG_MOTION "Movimento" -#define MSG_FILAMENT "Filamento" -#define MSG_VOLUMETRIC_ENABLED "E em mm3" -#define MSG_FILAMENT_DIAM "Fil. Diam." -#define MSG_CONTRAST "Contraste" -#define MSG_STORE_EEPROM "Guardar na memoria" -#define MSG_LOAD_EEPROM "Carregar da memoria" -#define MSG_RESTORE_FAILSAFE "Rest. de emergen." -#define MSG_REFRESH LCD_STR_REFRESH " Recarregar" -#define MSG_WATCH "Monitorizar" -#define MSG_PREPARE "Preparar" -#define MSG_TUNE "Afinar" -#define MSG_PAUSE_PRINT "Pausar impressao" -#define MSG_RESUME_PRINT "Retomar impressao" -#define MSG_STOP_PRINT "Parar impressao" -#define MSG_CARD_MENU "Imprimir do SD" -#define MSG_NO_CARD "Sem cartao SD" -#define MSG_DWELL "Em espera..." -#define MSG_USERWAIT "A espera de ordem" -#define MSG_PRINT_ABORTED "Impressao cancelada" -#define MSG_NO_MOVE "Sem movimento" -#define MSG_KILLED "EMERGENCIA. " -#define MSG_STOPPED "PARADO. " -#define MSG_CONTROL_RETRACT " Retrair mm" -#define MSG_CONTROL_RETRACT_SWAP "Troca Retrair mm" -#define MSG_CONTROL_RETRACTF " Retrair V" -#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm" -#define MSG_CONTROL_RETRACT_RECOVER " DesRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP "Troca DesRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF " DesRet V" -#define MSG_AUTORETRACT " AutoRetr." -#define MSG_FILAMENTCHANGE "Trocar filamento" -#define MSG_INIT_SDCARD "Inici. cartao SD" -#define MSG_CNG_SDCARD "Trocar cartao SD" -#define MSG_ZPROBE_OUT "Sensor fora/base" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" -#define MSG_ZPROBE_ZOFFSET "Desvio Z" -#define MSG_BABYSTEP_X "Babystep X" -#define MSG_BABYSTEP_Y "Babystep Y" -#define MSG_BABYSTEP_Z "Babystep Z" -#define MSG_ENDSTOP_ABORT "Fim de curso" -#define MSG_HEATING_FAILED_LCD "Aquecimento falhou" -#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP "Err: T Maxima" -#define MSG_ERR_MINTEMP "Err: T Minima" -#define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima" -#define MSG_ERR_MINTEMP_BED "Err: T Base Minima" -#define MSG_HEATING "Aquecendo..." -#define MSG_BED_HEATING "Aquecendo base.." -#define MSG_DELTA_CALIBRATE "Calibracao Delta" -#define MSG_DELTA_CALIBRATE_X "Calibrar X" -#define MSG_DELTA_CALIBRATE_Y "Calibrar Y" -#define MSG_DELTA_CALIBRATE_Z "Calibrar Z" -#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" - -#define MSG_LCD_ENDSTOPS "Fim de curso" - -#endif // LANGUAGE_PT_H diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h deleted file mode 100644 index 0b0113c1d8..0000000000 --- a/Marlin/language_pt_utf8.h +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_UTF_H -#define LANGUAGE_PT_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronta.") -#define MSG_SD_INSERTED _UxGT("Cartão inserido") -#define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desactivar motores") -#define MSG_AUTO_HOME _UxGT("Ir para origem") -#define MSG_AUTO_HOME_X _UxGT("Ir para origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir para origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir para origem Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Click para iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Pronto !") -#define MSG_SET_HOME_OFFSETS _UxGT("Definir desvio") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets aplicados") -#define MSG_SET_ORIGIN _UxGT("Definir origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq. PLA Tudo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. PLA ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Definições PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq. ABS Tudo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. ABS ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Definições ABS") -#define MSG_COOLDOWN _UxGT("Arrefecer") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Bico") -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Base") -#define MSG_FAN_SPEED _UxGT("Vel. ventoinha") -#define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Controlo") -#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("Temp. Automática") -#define MSG_ON _UxGT("On ") -#define MSG_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_ACC _UxGT("Acc") -#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-retracção") -#define MSG_A_TRAVEL _UxGT("A-movimento") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A passo/mm") - #define MSG_BSTEPS _UxGT("B passo/mm") - #define MSG_CSTEPS _UxGT("C passo/mm") -#else - #define MSG_ASTEPS _UxGT("X passo/mm") - #define MSG_BSTEPS _UxGT("Y passo/mm") - #define MSG_CSTEPS _UxGT("Z passo/mm") -#endif -#define MSG_ESTEPS _UxGT("E passo/mm") -#define MSG_E1STEPS _UxGT("E1 passo/mm") -#define MSG_E2STEPS _UxGT("E2 passo/mm") -#define MSG_E3STEPS _UxGT("E3 passo/mm") -#define MSG_E4STEPS _UxGT("E4 passo/mm") -#define MSG_E5STEPS _UxGT("E5 passo/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Diam.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Guardar na memoria") -#define MSG_LOAD_EEPROM _UxGT("Carregar da memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emergen.") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Recarregar") -#define MSG_WATCH _UxGT("Monitorizar") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Afinar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressão") -#define MSG_RESUME_PRINT _UxGT("Retomar impressão") -#define MSG_STOP_PRINT _UxGT("Parar impressão") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("Em espera...") -#define MSG_USERWAIT _UxGT("Á espera de ordem") -#define MSG_PRINT_ABORTED _UxGT("Impressão cancelada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("EMERGÊNCIA. ") -#define MSG_STOPPED _UxGT("PARADO. ") -#define MSG_CONTROL_RETRACT _UxGT(" Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Troca Retrair mm") -#define MSG_CONTROL_RETRACTF _UxGT(" Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT(" Levantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT(" DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Troca DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT(" DesRet V") -#define MSG_AUTORETRACT _UxGT(" AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Trocar filamento") -#define MSG_INIT_SDCARD _UxGT("Inici. cartão SD") -#define MSG_CNG_SDCARD _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_ZPROBE_ZOFFSET _UxGT("Desvio Z") -#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("Fim de curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: T Máxima") -#define MSG_ERR_MINTEMP _UxGT("Err: T Mínima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: T Base Máxima") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: T Base Mínima") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibração 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_LCD_ENDSTOPS _UxGT("Fim de curso") - -#endif // LANGUAGE_PT_UTF_H diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h deleted file mode 100644 index 4a9fc53fe7..0000000000 --- a/Marlin/language_ru.h +++ /dev/null @@ -1,402 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Russian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_RU_H -#define LANGUAGE_RU_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" готов.") -#define MSG_BACK _UxGT("Назад") -#define MSG_SD_INSERTED _UxGT("Карта вставлена") -#define MSG_SD_REMOVED _UxGT("Карта извлечена") -#define MSG_LCD_ENDSTOPS _UxGT("Эндстопы") // Max length 8 characters -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Прогр. эндстопы") -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Выкл. двигатели") -#define MSG_DEBUG_MENU _UxGT("Меню отладки") -#define MSG_PROGRESS_BAR_TEST _UxGT("Тест индикатора") -#define MSG_AUTO_HOME _UxGT("Авто парковка") -#define MSG_AUTO_HOME_X _UxGT("Парковка X") -#define MSG_AUTO_HOME_Y _UxGT("Парковка Y") -#define MSG_AUTO_HOME_Z _UxGT("Парковка Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровать Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Нулевое положение") -#define MSG_LEVEL_BED_WAITING _UxGT("Нажмите чтобы начать") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Следующая точка") -#define MSG_LEVEL_BED_DONE _UxGT("Выравнивание готово!") -#define MSG_Z_FADE_HEIGHT _UxGT("Высота спада") -#define MSG_SET_HOME_OFFSETS _UxGT("Запомнить парковку") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции применены") -#define MSG_SET_ORIGIN _UxGT("Запомнить ноль") -#define MSG_PREHEAT_1 _UxGT("Преднагрев PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" всё") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" сопло") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" стол") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" настр.") -#define MSG_PREHEAT_2 _UxGT("Преднагрев ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" всё") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" сопло") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" стол") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" настр.") -#define MSG_COOLDOWN _UxGT("Охлаждение") -#define MSG_SWITCH_PS_ON _UxGT("Включить питание") -#define MSG_SWITCH_PS_OFF _UxGT("Выключить питание") -#define MSG_EXTRUDE _UxGT("Экструзия") -#define MSG_RETRACT _UxGT("Втягивание") -#define MSG_MOVE_AXIS _UxGT("Движение по осям") -#define MSG_BED_LEVELING _UxGT("Калибровка стола") -#define MSG_LEVEL_BED _UxGT("Калибровать стол") -#define MSG_LEVEL_CORNERS _UxGT("Выровнять углы") -#define MSG_NEXT_CORNER _UxGT("Следующий угол") -#define MSG_EDITING_STOPPED _UxGT("Ред. сетки завершено") -#define MSG_USER_MENU _UxGT("Свои комманды") -#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("Постр. сетку от руки") -#define MSG_UBL_BC_INSERT _UxGT("Пост. шимм и измер.") -#define MSG_UBL_BC_INSERT2 _UxGT("Измерение") -#define MSG_UBL_BC_REMOVE _UxGT("Удал. и измер. стол") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Двигаемся дальше") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Активировать UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Деактивировать UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Температура стола") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Температура сопла") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Редактор сеток") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Редакт. свою сетку") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Точная настр. сетки") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Ред. сетки завершено") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Построить свою сетку") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Построить сетку") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Построить сетку PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Построить сетку ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Построить хол. сетку") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Устан. высоту сетки") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Высота") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Проверить сетку") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Проверить сетку PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Проверить сетку ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Проверить свою сетку") -#define MSG_UBL_CONTINUE_MESH _UxGT("Продолжить сетку") -#define MSG_UBL_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Калибровка 3-х точек") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Калибровка растера") -#define MSG_UBL_MESH_LEVEL _UxGT("Выровнить сетку") -#define MSG_UBL_SIDE_POINTS _UxGT("Крайние точки") -#define MSG_UBL_MAP_TYPE _UxGT("Тип карты") -#define MSG_UBL_OUTPUT_MAP _UxGT("Вывести карту сетки") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Вывести на хост") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Вывести в CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Забекапить сетку") -#define MSG_UBL_INFO_UBL _UxGT("Вывод информации UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Редактировать сетку") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Кол-во заполнителя") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ручное заполнение") -#define MSG_UBL_SMART_FILLIN _UxGT("Умное заполнение") -#define MSG_UBL_FILLIN_MESH _UxGT("Заполнить сетку") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Аннулировать всё") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Аннулир. ближ. точку") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Точная настр. всего") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Настр. ближ. точки") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Хранилище сетей") -#define MSG_UBL_STORAGE_SLOT _UxGT("Слот памяти") -#define MSG_UBL_LOAD_MESH _UxGT("Загрузить сетку стола") -#define MSG_UBL_SAVE_MESH _UxGT("Сохранить сетку стола") -#define MSG_MESH_LOADED _UxGT("Сетка %i загружена") -#define MSG_MESH_SAVED _UxGT("Сетка %i сохранена") -#define MSG_NO_STORAGE _UxGT("Нет хранилища") -#define MSG_UBL_SAVE_ERROR _UxGT("Ошибка: Сохран. UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Ошибка: Восстан. UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Смещение Z останов.") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL") - -#define MSG_LED_CONTROL _UxGT("Настройки LED") -#define MSG_LEDS _UxGT("Подсветку") -#define MSG_LED_PRESETS _UxGT("Предустановки света") -#define MSG_SET_LEDS_RED _UxGT("Красный свет") -#define MSG_SET_LEDS_ORANGE _UxGT("Оранжевый свет") -#define MSG_SET_LEDS_YELLOW _UxGT("Жёлтый свет") -#define MSG_SET_LEDS_GREEN _UxGT("Зелёный свет") -#define MSG_SET_LEDS_BLUE _UxGT("Синий свет") -#define MSG_SET_LEDS_INDIGO _UxGT("Индиго свет") -#define MSG_SET_LEDS_VIOLET _UxGT("Фиолетовый свет") -#define MSG_SET_LEDS_WHITE _UxGT("Белый свет") -#define MSG_SET_LEDS_DEFAULT _UxGT("Свет по умолчанию") -#define MSG_CUSTOM_LEDS _UxGT("Свои настр. света") -#define MSG_INTENSITY_R _UxGT("Интенсивн. красного") -#define MSG_INTENSITY_G _UxGT("Интенсивн. зелёного") -#define MSG_INTENSITY_B _UxGT("Интенсивн. синего") -#define MSG_INTENSITY_W _UxGT("Интенсивн. белого") -#define MSG_LED_BRIGHTNESS _UxGT("Яркость") - -#define MSG_MOVING _UxGT("Движемся...") -#define MSG_FREE_XY _UxGT("Освобождаем XY") -#define MSG_MOVE_X _UxGT("Движение по X") -#define MSG_MOVE_Y _UxGT("Движение по Y") -#define MSG_MOVE_Z _UxGT("Движение по Z") -#define MSG_MOVE_E _UxGT("Экструдер") -#define MSG_MOVE_01MM _UxGT("Движение 0.1мм") -#define MSG_MOVE_1MM _UxGT("Движение 1мм") -#define MSG_MOVE_10MM _UxGT("Движение 10мм") -#define MSG_SPEED _UxGT("Скорость") -#define MSG_BED_Z _UxGT("Z стола") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _UxGT("Стол") -#define MSG_FAN_SPEED _UxGT("Кулер") -#define MSG_EXTRA_FAN_SPEED _UxGT("Кулер доп.") -#define MSG_FLOW _UxGT("Поток") -#define MSG_CONTROL _UxGT("Настройки") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Мин") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Фактор") -#define MSG_AUTOTEMP _UxGT("Автотемпература") -#define MSG_ON _UxGT("Вкл.") -#define MSG_OFF _UxGT("Выкл.") -#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("Выбор") -#define MSG_ACC _UxGT("Ускорение") -#define MSG_JERK _UxGT("Рывок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-рывок") - #define MSG_VB_JERK _UxGT("Vb-рывок") - #define MSG_VC_JERK _UxGT("Vc-рывок") -#else - #define MSG_VX_JERK _UxGT("Vx-рывок") - #define MSG_VY_JERK _UxGT("Vy-рывок") - #define MSG_VZ_JERK _UxGT("Vz-рывок") -#endif -#define MSG_VE_JERK _UxGT("Ve-рывок") -#define MSG_VELOCITY _UxGT("Быстрота") -#define MSG_VMAX _UxGT("Vмакс ") -#define MSG_VMIN _UxGT("Vмин") -#define MSG_VTRAV_MIN _UxGT("Vпутеш. мин") -#define MSG_ACCELERATION _UxGT("Ускорение") -#define MSG_AMAX _UxGT("Aмакс ") -#define MSG_A_RETRACT _UxGT("A-втягивание") -#define MSG_A_TRAVEL _UxGT("A-путеш.") -#define MSG_STEPS_PER_MM _UxGT("Шаг/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aшаг/мм") - #define MSG_BSTEPS _UxGT("Bшаг/мм") - #define MSG_CSTEPS _UxGT("Cшаг/мм") -#else - #define MSG_ASTEPS _UxGT("Xшаг/мм") - #define MSG_BSTEPS _UxGT("Yшаг/мм") - #define MSG_CSTEPS _UxGT("Zшаг/мм") -#endif -#define MSG_ESTEPS _UxGT("Eшаг/мм") -#define MSG_E1STEPS _UxGT("E1шаг/мм") -#define MSG_E2STEPS _UxGT("E2шаг/мм") -#define MSG_E3STEPS _UxGT("E3шаг/мм") -#define MSG_E4STEPS _UxGT("E4шаг/мм") -#define MSG_E5STEPS _UxGT("E5шаг/мм") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Филамент") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") -#define MSG_FILAMENT_DIAM _UxGT("Диаметр филамента") -#define MSG_FILAMENT_UNLOAD _UxGT("Загрузка мм") -#define MSG_FILAMENT_LOAD _UxGT("Выгрузка мм") -#define MSG_ADVANCE_K _UxGT("K продвижения") -#define MSG_CONTRAST _UxGT("Контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Сохранить настройки") -#define MSG_LOAD_EEPROM _UxGT("Загрузить настройки") -#define MSG_RESTORE_FAILSAFE _UxGT("Восстановить настр.") -#define MSG_INIT_EEPROM _UxGT("Инициализация EEPROM") -#define MSG_REFRESH _UxGT("Обновить") -#define MSG_WATCH _UxGT("Информационный экран") -#define MSG_PREPARE _UxGT("Подготовить") -#define MSG_TUNE _UxGT("Настроить") -#define MSG_PAUSE_PRINT _UxGT("Пауза печати") -#define MSG_RESUME_PRINT _UxGT("Продолжить печать") -#define MSG_STOP_PRINT _UxGT("Остановить печать") -#define MSG_CARD_MENU _UxGT("Печать с SD карты") -#define MSG_NO_CARD _UxGT("Нет SD карты") -#define MSG_DWELL _UxGT("Сон...") -#define MSG_USERWAIT _UxGT("Продолжить...") -#define MSG_PRINT_PAUSED _UxGT("Печать на паузе") -#define MSG_PRINTING _UxGT("Печать...") -#define MSG_PRINT_ABORTED _UxGT("Печать отменена") -#define MSG_NO_MOVE _UxGT("Нет движения.") -#define MSG_KILLED _UxGT("УБИТО. ") -#define MSG_STOPPED _UxGT("ОСТАНОВЛЕНО. ") -#define MSG_CONTROL_RETRACT _UxGT("Втягивание мм") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Втягивание смены мм") -#define MSG_CONTROL_RETRACTF _UxGT("Втягивание V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Втяг. прыжка мм") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Возврат мм") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Возврат смены мм") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Возврат V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Возврат смены V") -#define MSG_AUTORETRACT _UxGT("Авто Втягивание") -#define MSG_FILAMENTCHANGE _UxGT("Смена филамента") -#define MSG_FILAMENTLOAD _UxGT("Загрузка филамента") -#define MSG_FILAMENTUNLOAD _UxGT("Выгрузка филамента") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Выгрузить всё") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD карту") -#define MSG_CNG_SDCARD _UxGT("Сменить SD карту") -#define MSG_ZPROBE_OUT _UxGT("Z датчик вне стола") -#define MSG_SKEW_FACTOR _UxGT("Фактор наклона") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Тестирование BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Сброс BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Установка BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Набивка BLTouch") -#define MSG_HOME _UxGT("Паркуй") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("первый") -#define MSG_ZPROBE_ZOFFSET _UxGT("Смещение Z") -#define MSG_BABYSTEP_X _UxGT("Микрошаг X") -#define MSG_BABYSTEP_Y _UxGT("Микрошаг Y") -#define MSG_BABYSTEP_Z _UxGT("Микрошаг Z") -#define MSG_ENDSTOP_ABORT _UxGT("Сработал концевик") -#define MSG_HEATING_FAILED_LCD _UxGT("Разогрев не удался") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Разогр. стола не уд.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Ошибка: Избыточная Т") -#define MSG_THERMAL_RUNAWAY _UxGT("УБЕГАНИЕ ТЕПЛА") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("УБЕГАНИЕ ТЕПЛА СТОЛА") -#define MSG_ERR_MAXTEMP _UxGT("Ошибка: Т макс.") -#define MSG_ERR_MINTEMP _UxGT("Ошибка: Т мин.") -#define MSG_ERR_MAXTEMP_BED _UxGT("Ошибка: Т стола макс") -#define MSG_ERR_MINTEMP_BED _UxGT("Ошибка: Т стола мин.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("ПРИНТЕР ОСТАНОВЛЕН") -#define MSG_PLEASE_RESET _UxGT("Сделайте сброс") -#define MSG_SHORT_DAY _UxGT("д") // One character only -#define MSG_SHORT_HOUR _UxGT("ч") // One character only -#define MSG_SHORT_MINUTE _UxGT("м") // One character only -#define MSG_HEATING _UxGT("Нагрев...") -#define MSG_COOLING _UxGT("Охлаждение...") -#define MSG_BED_HEATING _UxGT("Нагрев стола...") -#define MSG_BED_COOLING _UxGT("Охлаждение стола...") -#define MSG_DELTA_CALIBRATE _UxGT("Калибровка Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калибровать X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калибровать Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калибровать Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калибровать центр") -#define MSG_DELTA_SETTINGS _UxGT("Настройки Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Авто калибровка") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Задать высоту Delta") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Задать Z-смещение") -#define MSG_DELTA_DIAG_ROD _UxGT("Диаг. стержень") -#define MSG_DELTA_HEIGHT _UxGT("Высота") -#define MSG_DELTA_RADIUS _UxGT("Радиус") -#define MSG_INFO_MENU _UxGT("О принтере") -#define MSG_INFO_PRINTER_MENU _UxGT("Инф. о принтере") -#define MSG_3POINT_LEVELING _UxGT("Калибровка 3-х точек") -#define MSG_LINEAR_LEVELING _UxGT("Линейная калибровка") -#define MSG_BILINEAR_LEVELING _UxGT("Билинейная калибр.") -#define MSG_UBL_LEVELING _UxGT("Калибровка UBL") -#define MSG_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_INFO_STATS_MENU _UxGT("Статистика принтера") -#define MSG_INFO_BOARD_MENU _UxGT("Информация о плате") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термисторы") -#define MSG_INFO_EXTRUDERS _UxGT("Экструдеры") -#define MSG_INFO_BAUDRATE _UxGT("Бод") -#define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Подсветка корпуса") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Яркость подсветки") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Счётчик печати") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") - #define MSG_INFO_PRINT_TIME _UxGT("Общее время печати") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее задание") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Длинна филамента") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Отпечатков") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") - #define MSG_INFO_PRINT_TIME _UxGT("Всего") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Выдавлено") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Мин. Т") -#define MSG_INFO_MAX_TEMP _UxGT("Макс. Т") -#define MSG_INFO_PSU _UxGT("Блок питания") -#define MSG_DRIVE_STRENGTH _UxGT("Сила привода") -#define MSG_DAC_PERCENT _UxGT("Привод %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запись DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ПЕЧАТЬ НА ПАУЗЕ") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ЗАГРУЗКА ФИЛАМЕНТА") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("ВЫГРУЗКА ФИЛАМЕНТА") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Выдавить ещё") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Возобновить печать") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Сопла: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Возврат не удался") -#define MSG_ERR_PROBING_FAILED _UxGT("Не удалось прощупать") -#define MSG_M600_TOO_COLD _UxGT("M600: Низкая Т") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("начала смены") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("выгрузки") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставьте пруток") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("и нажмите кнопку") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("для продолжения") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Нажмите кнопку для") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("нагрева сопла...") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев сопла") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Ждите...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("загрузки прутка") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("экструзии") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("возобновления") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("печати") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Выгрузка...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставь и нажми") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Загрузка...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Выдавливание...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Возобновление...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_RU_H diff --git a/Marlin/language_sk_utf8.h b/Marlin/language_sk_utf8.h deleted file mode 100644 index de3b2ba38b..0000000000 --- a/Marlin/language_sk_utf8.h +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Slovak - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Michal Holeš, Farma MaM - * http://www.facebook.com/farmamam - * - */ -#ifndef LANGUAGE_SK_UTF_H -#define LANGUAGE_SK_UTF_H - -#define MAPPER_C3C4C5_SK -#define DISPLAY_CHARSET_ISO10646_SK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pripravená.") -#define MSG_BACK _UxGT("Naspať") -#define MSG_SD_INSERTED _UxGT("Karta vložená") -#define MSG_SD_REMOVED _UxGT("Karta vybratá") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znakov -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft.endstopy") -#define MSG_MAIN _UxGT("Hlavná ponuka") -#define MSG_AUTOSTART _UxGT("Autoštart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolniť motory") -#define MSG_DEBUG_MENU _UxGT("Ponuka ladenia") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. priebehu") -#define MSG_AUTO_HOME _UxGT("Domovská pozícia") -#define MSG_AUTO_HOME_X _UxGT("Domov os X") -#define MSG_AUTO_HOME_Y _UxGT("Domov os Y") -#define MSG_AUTO_HOME_Z _UxGT("Domov os Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovať Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Meranie podložky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Ďalší bod") -#define MSG_LEVEL_BED_DONE _UxGT("Meranie hotové!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška merania") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastaviť offsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsety nastavené") -#define MSG_SET_ORIGIN _UxGT("Nastaviť začiatok") -#define MSG_PREHEAT_1 _UxGT("Zahriať PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" všetko") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahriať ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" všetko") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Schladiť") -#define MSG_SWITCH_PS_ON _UxGT("Zapnúť napájanie") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnúť napájanie") -#define MSG_EXTRUDE _UxGT("Vytlačiť (extr.)") -#define MSG_RETRACT _UxGT("Vytiahnuť (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunúť osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnať podložku") -#define MSG_LEVEL_BED _UxGT("Vyrovnať podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnať rohy") -#define MSG_NEXT_CORNER _UxGT("Ďalší roh") -#define MSG_EDITING_STOPPED _UxGT("Koniec úprav siete") - -#define MSG_UBL_DOING_G29 _UxGT("Vykonávam G29") -#define MSG_UBL_UNHOMED _UxGT("Prejdite domov") -#define MSG_UBL_TOOLS _UxGT("UBL nástroje") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") -#define MSG_UBL_BC_INSERT _UxGT("Vložte kartu, zmerajte") -#define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstráňte a zmerajte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Presun na ďalší") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovať UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovať UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sieťe bodov") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upraviť vlastnú sieť") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladiť sieť bodov") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Koniec úprav siete") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastná sieť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvoriť sieť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Sieť bodov PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Sieť bodov ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená sieť bodov") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upraviť výšku siete") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Skontrolovať sieť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola siete PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola siete ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. siete") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovať v sieti") -#define MSG_UBL_MESH_LEVELING _UxGT("Sieťové rovnanie") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnanie") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_UBL_MESH_LEVEL _UxGT("Vyrovnať podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranné body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ siete bodov") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovať sieť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovať do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovať do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upraviť sieť bodov") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mriežky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ručná hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Smart hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplniť mriežku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušiť všetko") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušiť posledný") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upraviť všetky") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upraviť posledný") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uložisko sietí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Pamaťový slot") -#define MSG_UBL_LOAD_MESH _UxGT("Načítať sieť bodov") -#define MSG_UBL_SAVE_MESH _UxGT("Uložiť sieť bodov") -#define MSG_MESH_LOADED _UxGT("Sieť %i načítaná") -#define MSG_MESH_SAVED _UxGT("Sieť %i uložená") -#define MSG_NO_STORAGE _UxGT("Nedostatok miesta") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Uložiť UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnoviť UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Koniec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") - -#define MSG_LED_CONTROL _UxGT("Nastavenie LED") -#define MSG_LEDS _UxGT("Svetlo") -#define MSG_LED_PRESETS _UxGT("Prednastavené farby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žltá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Biela") -#define MSG_SET_LEDS_DEFAULT _UxGT("Obnoviť nastavenie") -#define MSG_CUSTOM_LEDS _UxGT("Vlastná farba") -#define MSG_INTENSITY_R _UxGT("Inten. červenej") -#define MSG_INTENSITY_G _UxGT("Inten. zelenej") -#define MSG_INTENSITY_B _UxGT("Inten. modrej") -#define MSG_INTENSITY_W _UxGT("Inten. bielej") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastné príkazy") -#define MSG_MOVING _UxGT("Posun...") -#define MSG_FREE_XY _UxGT("Uvolniť XY") -#define MSG_MOVE_X _UxGT("Posunúť X") -#define MSG_MOVE_Y _UxGT("Posunúť Y") -#define MSG_MOVE_Z _UxGT("Posunúť Z") -#define MSG_MOVE_E _UxGT("Extrúder") -#define MSG_MOVE_01MM _UxGT("Posunúť o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunúť o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunúť o 10mm") -#define MSG_SPEED _UxGT("Rýchlosť") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_FAN_SPEED _UxGT("Rýchlosť vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rýchlosť ex. vent.") -#define MSG_FLOW _UxGT("Prietok") -#define MSG_CONTROL _UxGT("Ovládanie") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrať") -#define MSG_ACC _UxGT("Zrýchl") -#define MSG_JERK _UxGT("Skok") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-skok") - #define MSG_VB_JERK _UxGT("Vb-skok") - #define MSG_VC_JERK _UxGT("Vc-skok") -#else - #define MSG_VA_JERK _UxGT("Vx-skok") - #define MSG_VB_JERK _UxGT("Vy-skok") - #define MSG_VC_JERK _UxGT("Vz-skok") -#endif -#define MSG_VE_JERK _UxGT("Ve-skok") -#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#define MSG_VELOCITY _UxGT("Rýchlosť") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerácia") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-prejazd") -#define MSG_STEPS_PER_MM _UxGT("Krokov/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akrokov/mm") - #define MSG_BSTEPS _UxGT("Bkrokov/mm") - #define MSG_CSTEPS _UxGT("Ckrokov/mm") -#else - #define MSG_ASTEPS _UxGT("Xkrokov/mm") - #define MSG_BSTEPS _UxGT("Ykrokov/mm") - #define MSG_CSTEPS _UxGT("Zkrokov/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekrokov/mm") -#define MSG_E1STEPS _UxGT("E1krokov/mm") -#define MSG_E2STEPS _UxGT("E2krokov/mm") -#define MSG_E3STEPS _UxGT("E3krokov/mm") -#define MSG_E4STEPS _UxGT("E4krokov/mm") -#define MSG_E5STEPS _UxGT("E5kroků/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Priem.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunúť mm") -#define MSG_FILAMENT_LOAD _UxGT("Zaviesť mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Uložiť nastavenie") -#define MSG_LOAD_EEPROM _UxGT("Načítať nastaveníe") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnoviť nastavenie") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnoviť") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Príprava tlače") -#define MSG_TUNE _UxGT("Doladenie tlače") -#define MSG_PAUSE_PRINT _UxGT("Pozastaviť tlač") -#define MSG_RESUME_PRINT _UxGT("Obnoviť tlač") -#define MSG_STOP_PRINT _UxGT("Zastaviť tlač") -#define MSG_CARD_MENU _UxGT("Tlačiť z SD") -#define MSG_NO_CARD _UxGT("Žiadna SD karta") -#define MSG_DWELL _UxGT("Spím...") -#define MSG_USERWAIT _UxGT("Kliknutím pokrač.") -#define MSG_PRINT_PAUSED _UxGT("Tlač pozastavená") -#define MSG_PRINTING _UxGT("Tlačím...") -#define MSG_PRINT_ABORTED _UxGT("Tlač zrušená") -#define MSG_NO_MOVE _UxGT("Žiadny pohyb.") -#define MSG_KILLED _UxGT("PRERUŠENÉ. ") -#define MSG_STOPPED _UxGT("ZASTAVENÉ. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výmena Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovať V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zdvih Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vymeniť filament") -#define MSG_FILAMENTLOAD _UxGT("Zaviesť filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunúť filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunúť všetko") - -#define MSG_INIT_SDCARD _UxGT("Načítať SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vymeniť SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor skosenia") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunúť") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunúť") -#define MSG_HOME _UxGT("Najprv") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("domov") -#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 zastavil") -#define MSG_HEATING_FAILED_LCD _UxGT("Chyba ohrevu") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba ohrevu podl.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÝ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEPLOTNÝ SKOK PODL.") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TLAČ. ZASTAVENÁ") -#define MSG_PLEASE_RESET _UxGT("Spravte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Ohrev...") -#define MSG_COOLING _UxGT("Ochladzovanie...") -#define MSG_BED_HEATING _UxGT("Ohrev podl...") -#define MSG_BED_COOLING _UxGT("Ochladzovanie podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrácia") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovať X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovať Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovať Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovať Stred") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastavenia") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrácia") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Offset sondy Z") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Výška") -#define MSG_DELTA_RADIUS _UxGT("Polomer") -#define MSG_INFO_MENU _UxGT("O tlačiarni") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tlačiarni") -#define MSG_3POINT_LEVELING _UxGT("3-bodové rovnanie") -#define MSG_LINEAR_LEVELING _UxGT("Lineárne rovnanie") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineárne rovnanie") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_INFO_STATS_MENU _UxGT("Štatistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o doske") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rýchlosť") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvetlenie") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas svetla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tlačí") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončené") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia tlač") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkom vytlačené") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tlače") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačené") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Budenie motorov") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Uložiť do EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PAUZA TLAČE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENIE FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTIE FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽN. POKRAČ.:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačiť viacej") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnoviť tlač") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkovanie zlyhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrácia zlyhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Príliž studený") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na spustenie") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výmeny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čakejte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunutie") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stlačte") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlačidlo...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknite pre") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na teplotu tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedenie") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Čakajte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačenie") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračovanie") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tlače") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysúvanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, kliknite") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_SK_UTF_H diff --git a/Marlin/language_test.h b/Marlin/language_test.h deleted file mode 100644 index 8823bd5f11..0000000000 --- a/Marlin/language_test.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * TEST - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_TEST_H -#define LANGUAGE_TEST_H - -// Select ONE of the following Mappers. -// They decide what to do with a symbol in the area of [0x80:0xFF]. They take a symbol of this language file and make them point -// into an array with 128 cells, where they'll find the place of the symbol of the font in use. -// -// a.)For ASCII coded Language_xx.h files like (en) there are no occurrences of symbols above 0x7F so no mapper is needed. -// If such a symbol appears it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or -// "\xxx" symbols. All Symbols are only one byte long. -// b.) For Unicoded Language_xx.h files (currently ru, de and kana_utf8 ) the non ASCII [0x00-0x7F] symbols are represented by more than one byte. -// In the case of two bytes the first is pointing to a 'codepage' and the second to a place in the codepage. These codepages contain 64 symbols. -// So two of them can be mapped. For most of the European languages the necessary symbols are contained in the pages C2 and C3. Cyrillic uses D0 -// and D1. -// c.) For katakana (one of the Japanese symbol sets) Unicode uses 3 bytes. Here the second byte also points to a codepage and byte 3 to the symbol. -// I hope the pages E282 and E283 are sufficient to write katakana. -// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not -// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). - -//#define MAPPER_C2C3 // For most European languages when language file is in utf8 -//#define MAPPER_D0D1 // For Cyrillic -//#define MAPPER_E382E383 // For Katakana -//#define MAPPER_NON // For direct ascii codes. Fall back mapper - if no other is defined. - - -// Select the better font for full graphic displays. -//#define DISPLAY_CHARSET_ISO10646_1 -//#define DISPLAY_CHARSET_ISO10646_5 -//#define DISPLAY_CHARSET_ISO10646_GREEK -//#define DISPLAY_CHARSET_ISO10646_KANA - - - -// next 5 lines select variants in this file only -#define DISPLAYTEST -//#define WEST -//#define CYRIL -//#define KANA - - -// TESTSTRINGS - -#define STRG_ASCII_2 " !\"#$%&'()*+,-./" -#define STRG_ASCII_3 "0123456789:;<=>?" -#define STRG_ASCII_4 "@ABCDEFGHIJKLMNO" -#define STRG_ASCII_5 "PQRSTUVWXYZ[\]^_" -#define STRG_ASCII_6 "`abcdefghijklmno" -#define STRG_ASCII_7 "pqrstuvwxyz{|}~" - -#define STRG_C2_8 "" -#define STRG_C2_9 "" -#define STRG_C2_a " ¡¢£¤¥¦§¨©ª«¬­®¯" -#define STRG_C2_b "°±²³´µ¶·¸¹º»¼½¾¿" -#define STRG_C3_8 "ÈÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" -#define STRG_C3_9 "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" -#define STRG_C3_a "àáâãäåæçèéêëìíîï" -#define STRG_C3_b "ðñòóôõö÷øùúûüýþÿ" - -#define STRG_D0_8 "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ" -#define STRG_D0_9 "АБВГДЕЖЗИЙКЛМНОП" -#define STRG_D0_a "РСТУФХЦЧШЩЪЫЬЭЮЯ" -#define STRG_D0_b "абвгдежзийклмноп" -#define STRG_D1_8 "рстуфхцчшщъыьэюя" -#define STRG_D1_9 "ѐёђѓєѕіїјљњћќѝўџ" -#define STRG_D1_a "ѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯ" -#define STRG_D1_b "ѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿ" - -#define STRG_E382_8 "よめもゃやゅゆょよらりるれろゎわ" -#define STRG_E382_9 "ゐゑをんゔゕゖ゗゘゙゚゛ ゜ゝゞゟ" -#define STRG_E382_a "゠ァアィイゥウェエォオカガキギク" -#define STRG_E382_b "グケゲコゴサザシジスズセゼソゾタ" -#define STRG_E383_8 "トチヂッツヅテデトドナニヌネノハ" -#define STRG_E383_9 "バパヒビピフブプヘベペホボポマミ" -#define STRG_E383_a "ムメモャヤュユョヨラリルレロヮワ" -#define STRG_E383_b "ヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿ" - -#define STRG_OKTAL_0 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" -#define STRG_OKTAL_1 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define STRG_OKTAL_2 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" -#define STRG_OKTAL_3 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" -#define STRG_OKTAL_4 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" -#define STRG_OKTAL_5 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" -#define STRG_OKTAL_6 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" -#define STRG_OKTAL_7 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" -#define STRG_OKTAL_8 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" -#define STRG_OKTAL_9 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" -#define STRG_OKTAL_a "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" -#define STRG_OKTAL_b "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" -#define STRG_OKTAL_c "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" -#define STRG_OKTAL_d "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" -#define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" -#define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" - -#if ENABLED(DISPLAYTEST) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "Display test" - #define MSG_PREPARE STRG_OKTAL_b - #define MSG_CONTROL STRG_OKTAL_c -#endif - -#if ENABLED(WEST) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_C2_8 - #define MSG_AUTO_HOME STRG_C2_9 - #define MSG_SET_HOME_OFFSETS STRG_C2_a - #define MSG_PREHEAT_1 STRG_C2_b - #define MSG_PREHEAT_2 STRG_C3_8 - #define MSG_COOLDOWN STRG_C3_9 - #define MSG_SWITCH_PS_OFF STRG_C3_a - #define MSG_MOVE_AXIS STRG_C3_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(CYRIL) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_D0_8 - #define MSG_AUTO_HOME STRG_D0_9 - #define MSG_SET_HOME_OFFSETS STRG_D0_a - #define MSG_PREHEAT_1 STRG_D0_b - #define MSG_PREHEAT_2 STRG_D1_8 - #define MSG_COOLDOWN STRG_D1_9 - #define MSG_SWITCH_PS_OFF STRG_D1_a - #define MSG_MOVE_AXIS STRG_D1_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(KANA) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_E382_8 - #define MSG_AUTO_HOME STRG_E382_9 - #define MSG_SET_HOME_OFFSETS STRG_E382_a - #define MSG_PREHEAT_1 STRG_E382_b - #define MSG_PREHEAT_2 STRG_E383_8 - #define MSG_COOLDOWN STRG_E383_9 - #define MSG_SWITCH_PS_OFF STRG_E383_a - #define MSG_MOVE_AXIS STRG_E383_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f -#endif - -#endif // LANGUAGE_TEST_H diff --git a/Marlin/language_tr.h b/Marlin/language_tr.h deleted file mode 100644 index 6234d149ac..0000000000 --- a/Marlin/language_tr.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Turkish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_TR_H -#define LANGUAGE_TR_H - -#define MAPPER_C2C3_TR -#define DISPLAY_CHARSET_ISO10646_TR -#define CHARSIZE 2 - -#if DISABLED(DOGLCD) - #error "Turkish needs a graphical display." -#endif - -#define WELCOME_MSG MACHINE_NAME _UxGT(" hazır.") // hazır. -#define MSG_SD_INSERTED _UxGT("SD Yerleşti.") // SD Yerleşti. -#define MSG_SD_REMOVED _UxGT("SD Çıkarıldı.") // SD Çıkarıldı. -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters // Endstops -#define MSG_MAIN _UxGT("Ana") // Ana -#define MSG_BACK _UxGT("Geri") // Geri -#define MSG_AUTOSTART _UxGT("Otobaşlat") // Otobaşlat -#define MSG_DISABLE_STEPPERS _UxGT("Motorları Durdur") // Motorları Durdur -#define MSG_DEBUG_MENU _UxGT("Hata Ayıklama") // Hata Ayıklama -#define MSG_PROGRESS_BAR_TEST _UxGT("Durum Çubuğu Testi") // Durum Çubuğu Testi -#define MSG_AUTO_HOME _UxGT("Eksenleri Sıfırla") // Eksenleri Sıfırla -#define MSG_AUTO_HOME_X _UxGT("X Sıfırla") // X Sıfırla -#define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") // Y Sıfırla -#define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") // Z Sıfırla -#define MSG_TMC_Z_CALIBRATION _UxGT("Ayarla Z") // Ayarla Z -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") // XYZ Sıfırlanıyor -#define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") // Başlatmak için tıkla -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sıradaki Nokta") // Sıradaki Nokta -#define MSG_LEVEL_BED_DONE _UxGT("Seviyeleme Tamam!") // Seviyeleme Tamam! -#define MSG_SET_HOME_OFFSETS _UxGT("Offset Ayarla") // Offset Ayarla -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset Tamam") // Offset Tamam -#define MSG_SET_ORIGIN _UxGT("Sıfır Belirle") // Sıfır Belirle -#define MSG_PREHEAT_1 _UxGT("Ön Isınma PLA") // Ön Isınma PLA -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") // -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ayar") // Ayar -#define MSG_PREHEAT_2 _UxGT("Ön Isınma ABS") // Ön Isınma ABS -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") // -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ayar") // Ayar -#define MSG_COOLDOWN _UxGT("Soğut") // Soğut -#define MSG_SWITCH_PS_ON _UxGT("Gücü Aç") // Gücü Aç -#define MSG_SWITCH_PS_OFF _UxGT("Gücü Kapat") // Gücü Kapat -#define MSG_EXTRUDE _UxGT("Extrude") // Extrude -#define MSG_RETRACT _UxGT("Geri Çek") // Geri Çek -#define MSG_MOVE_AXIS _UxGT("Eksen Yönet") // Eksenleri Yönet -#define MSG_BED_LEVELING _UxGT("Tabla Seviyele") // Tabla Seviyele -#define MSG_LEVEL_BED _UxGT("Tabla Seviyele") // Tabla Seviyele -#define MSG_MOVING _UxGT("Konumlanıyor...") // Konumlanıyor... -#define MSG_FREE_XY _UxGT("Durdur XY") // Durdur XY -#define MSG_MOVE_X _UxGT("X") // X -#define MSG_MOVE_Y _UxGT("Y") // Y -#define MSG_MOVE_Z _UxGT("Z") // Z -#define MSG_MOVE_E _UxGT("Ekstruder") // Ekstruder -#define MSG_MOVE_01MM _UxGT("0.1mm") // 0.1mm -#define MSG_MOVE_1MM _UxGT("1mm") // 1mm -#define MSG_MOVE_10MM _UxGT("10mm") // 10mm -#define MSG_SPEED _UxGT("Hız") // Hız -#define MSG_BED_Z _UxGT("Z Mesafesi") // Z Mesafesi -#define MSG_NOZZLE _UxGT("Nozül") // Nozül -#define MSG_BED _UxGT("Tabla") // Tabla -#define MSG_FAN_SPEED _UxGT("Fan Hızı") // Fan Hızı -#define MSG_FLOW _UxGT("Akış") // Akış -#define MSG_CONTROL _UxGT("Kontrol") // Kontrol -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") // Min -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") // Max -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Çarpan") // Çarpan -#define MSG_AUTOTEMP _UxGT("Autotemp") // Autotemp -#define MSG_ON _UxGT("On ") // On -#define MSG_OFF _UxGT("Off") // Off -#define MSG_PID_P _UxGT("PID-P") // PID-P -#define MSG_PID_I _UxGT("PID-I") // PID-I -#define MSG_PID_D _UxGT("PID-D") // PID-D -#define MSG_PID_C _UxGT("PID-C") // PID-C -#define MSG_SELECT _UxGT("Seç") // Seç -#define MSG_ACC _UxGT("İvme") // İvme -#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") // Ve-Jerk -#define MSG_VMAX _UxGT("Vmax ") // Vmax -#define MSG_VMIN _UxGT("Vmin") // Vmin -#define MSG_VTRAV_MIN _UxGT("VTrav min") // Vtrav min -#define MSG_AMAX _UxGT("Amax ") // Amax -#define MSG_A_RETRACT _UxGT("A-retract") // A-retract -#define MSG_A_TRAVEL _UxGT("A-travel") // A-travel -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") // 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") // Esteps/mm -#define MSG_E1STEPS _UxGT("E1steps/mm") // E1steps/mm -#define MSG_E2STEPS _UxGT("E2steps/mm") // E2steps/mm -#define MSG_E3STEPS _UxGT("E3steps/mm") // E3steps/mm -#define MSG_E4STEPS _UxGT("E4steps/mm") // E4steps/mm -#define MSG_E5STEPS _UxGT("E5steps/mm") // E4steps/mm -#define MSG_TEMPERATURE _UxGT("Sıcaklık") // Sıcaklık -#define MSG_MOTION _UxGT("Hareket") // Hareket -#define MSG_FILAMENT _UxGT("Filaman") // Filaman -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") // E in mm3 -#define MSG_FILAMENT_DIAM _UxGT("Fil. Çap") // Fil. Çap -#define MSG_ADVANCE_K _UxGT("K İlerlet") // K İlerlet -#define MSG_CONTRAST _UxGT("LCD Kontrast") // LCD Kontrast -#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") // Hafızaya Al -#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") // Hafızadan Yükle -#define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") // Fabrika Ayarları -#define MSG_REFRESH _UxGT("Yenile") // Yenile -#define MSG_WATCH _UxGT("Bilgi Ekranı") // Bilgi Ekranı -#define MSG_PREPARE _UxGT("Hazırlık") // Hazırlık -#define MSG_TUNE _UxGT("Ayar") // Ayar -#define MSG_PAUSE_PRINT _UxGT("Duraklat") // Duraklat -#define MSG_RESUME_PRINT _UxGT("Sürdür") // Sürdür -#define MSG_STOP_PRINT _UxGT("Durdur") // Durdur -#define MSG_CARD_MENU _UxGT("SD den Yazdır") // SD den Yazdır -#define MSG_NO_CARD _UxGT("SD Kart Yok") // SD Kart Yok -#define MSG_DWELL _UxGT("Uyku...") // Uyku... -#define MSG_USERWAIT _UxGT("Operatör bekleniyor...") // Operatör bekleniyor... -#define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu") // Baskı Durduruldu -#define MSG_NO_MOVE _UxGT("İşlem yok.") // İşlem yok. -#define MSG_KILLED _UxGT("Kilitlendi. ") // Kilitlendi. -#define MSG_STOPPED _UxGT("Durdu. ") // Durdu. -#define MSG_CONTROL_RETRACT _UxGT("Geri Çek mm") // Geri Çek mm -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") // Swap Re.mm -#define MSG_CONTROL_RETRACTF _UxGT("Geri Çekme V") // Geri Çekme V -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") // Hop mm -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") // UnRet mm -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") // S UnRetmm -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") // UnRet V -#define MSG_AUTORETRACT _UxGT("AutoRetr.") // AutoRetr. -#define MSG_FILAMENTCHANGE _UxGT("Filaman Değiştir") // Filaman Değiştir -#define MSG_INIT_SDCARD _UxGT("Init. SD") // Init. SD -#define MSG_CNG_SDCARD _UxGT("SD Değiştir") // SD Değiştir -#define MSG_ZPROBE_OUT _UxGT("Z Prob Açık. Tabla") // Z Prob Açık. Tabla -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") // BLTouch Self-Test -#define MSG_BLTOUCH_RESET _UxGT("Sıfırla BLTouch") // Sıfırla BLTouch -#define MSG_HOME _UxGT("Sıfırla") // Sıfırla -#define MSG_FIRST _UxGT("önce") // Önce -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") // Z Offset -#define MSG_BABYSTEP_X _UxGT("Miniadım X") // Miniadım X -#define MSG_BABYSTEP_Y _UxGT("Miniadım Y") // Miniadım Y -#define MSG_BABYSTEP_Z _UxGT("Miniadım Z") // Miniadım Z -#define MSG_ENDSTOP_ABORT _UxGT("Endstop iptal") // Endstop iptal -#define MSG_HEATING_FAILED_LCD _UxGT("Isınma başarısız") // Isınma başarısız -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Hata: Geçersiz Sıcaklık") // Hata: Geçersiz Sıcaklık -#define MSG_THERMAL_RUNAWAY _UxGT("TERMAL PROBLEM") // TERMAL PROBLEM -#define MSG_ERR_MAXTEMP _UxGT("Hata: MAXSICAKLIK") // Hata: MAXSICAKLIK -#define MSG_ERR_MINTEMP _UxGT("Hata: MINSICAKLIK") // Hata: MINSICAKLIK -#define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAXSIC. TABLA") // Hata: MAXSIC. TABLA -#define MSG_ERR_MINTEMP_BED _UxGT("Hata: MINSIC. TABLA") // Hata: MINSIC. TABLA -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("YAZICI DURDURULDU") // YAZICI DURDURULDU -#define MSG_PLEASE_RESET _UxGT("Lütfen resetleyin") // Lütfen resetleyin -#define MSG_SHORT_DAY _UxGT("G") // One character only // G -#define MSG_SHORT_HOUR _UxGT("S") // One character only // S -#define MSG_SHORT_MINUTE _UxGT("D") // One character only // D -#define MSG_HEATING _UxGT("Isınıyor...") // Isınıyor... -#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") // Tabla Isınıyor... -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") // Delta Kalibrasyonu -#define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") // Ayarla X -#define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") // Ayarla Y -#define MSG_DELTA_CALIBRATE_Z _UxGT("Ayarla Z") // Ayarla Z -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Ayarla Merkez") // Ayarla Merkez -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Oto Kalibrasyon") // Oto Kalibrasyon -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Yük. Ayarla") // Delta Yük. Ayarla -#define MSG_INFO_MENU _UxGT("Yazıcı Hakkında") // Yazıcı Hakkında -#define MSG_INFO_PRINTER_MENU _UxGT("Yazıcı Bilgisi") // Yazıcı Bilgisi -#define MSG_INFO_STATS_MENU _UxGT("İstatistikler") // İstatistikler -#define MSG_INFO_BOARD_MENU _UxGT("Kontrolör Bilgisi") // Kontrol Bilgisi -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistörler") // Termistörler -#define MSG_INFO_EXTRUDERS _UxGT("Ekstruderler") // Ekstruderler -#define MSG_INFO_BAUDRATE _UxGT("İletişim Hızı") // İletişim Hızı -#define MSG_INFO_PROTOCOL _UxGT("Protokol") // Protokol -#define MSG_CASE_LIGHT _UxGT("Aydınlatmayı") // Aydınlatmayı Aç - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı Sayısı") // Baskı Sayısı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Toplam Baskı Süresi") // Toplam Baskı Süresi - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun Baskı Süresi") // En Uzun Baskı Süresi - #define MSG_INFO_PRINT_FILAMENT _UxGT("Toplam Filaman") // Toplam Filaman -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı") // Baskı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Süre") // Süre - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun") // En Uzun - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filaman") // Filaman -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Sıc.") // Min Sıcak. -#define MSG_INFO_MAX_TEMP _UxGT("Max Sıc.") // Max Sıcak. -#define MSG_INFO_PSU _UxGT("Güç Kaynağı") // Güç Kaynağı - -#define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") // Sürücü Gücü -#define MSG_DAC_PERCENT _UxGT("Sürücü %") // Sürücü % -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") // Seçenekler: -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül: - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Başlama bekleniyor") // Başlama bekleniyor - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamanın") // filamanın - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("değişimi") // değişimi - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamanın çıkması") // filamanın çıkması - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filamanı yükle") // Filamanı yükle - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("ve devam için") // ve devam için - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tuşa bas...") // tuşa bas... - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Nozülü Isıtmak için") // Nozülü Isıtmak için - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Butona Bas.") // Butona Bas. - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozül Isınıyor") // Nozül Isınıyor - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") // Lütfen Bekleyin... - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamanın yüklenmesi") // filamanın yüklenmesi - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının sürdürülmesini") // Baskının sürdürülmesini - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("bekle") // bekle -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Lütfen bekleyiniz...") // Lütfen bekleyiniz... - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") // Çıkartılıyor... - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") // Yükle ve bas - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") // Yüklüyor... - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") // Sürdürülüyor... -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_TR_H diff --git a/Marlin/language_uk.h b/Marlin/language_uk.h deleted file mode 100644 index ed71d1a6c5..0000000000 --- a/Marlin/language_uk.h +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ukrainian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_UK_H -#define LANGUAGE_UK_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" готовий.") -#define MSG_SD_INSERTED _UxGT("Картка вставлена") -#define MSG_SD_REMOVED _UxGT("Картка видалена") -#define MSG_LCD_ENDSTOPS _UxGT("Кінцевик") // Max length 8 characters -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Вимк. двигуни") -#define MSG_AUTO_HOME _UxGT("Авто паркування") -#define MSG_AUTO_HOME_X _UxGT("Паркування X") -#define MSG_AUTO_HOME_Y _UxGT("Паркування Y") -#define MSG_AUTO_HOME_Z _UxGT("Паркування Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калібрування Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Паркування XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Почати") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Слідуюча Точка") -#define MSG_LEVEL_BED_DONE _UxGT("Завершено!") -#define MSG_SET_HOME_OFFSETS _UxGT("Зберегти паркув.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Зміщення застос.") -#define MSG_SET_ORIGIN _UxGT("Встанов. початок") -#define MSG_PREHEAT_1 _UxGT("Нагрів PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Все") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Стіл") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" нал.") -#define MSG_PREHEAT_2 _UxGT("Нагрів ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Все") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Стіл") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" нал.") -#define MSG_COOLDOWN _UxGT("Охолодження") -#define MSG_SWITCH_PS_ON _UxGT("Увімкнути живлення") -#define MSG_SWITCH_PS_OFF _UxGT("Вимкнути живлення") -#define MSG_EXTRUDE _UxGT("Екструзія") -#define MSG_RETRACT _UxGT("Втягування") -#define MSG_MOVE_AXIS _UxGT("Рух по осям") -#define MSG_BED_LEVELING _UxGT("Нівелювання столу") -#define MSG_LEVEL_BED _UxGT("Нівелювання столу") -#define MSG_MOVE_X _UxGT("Рух по X") -#define MSG_MOVE_Y _UxGT("Рух по Y") -#define MSG_MOVE_Z _UxGT("Рух по Z") -#define MSG_MOVE_E _UxGT("Екструдер") -#define MSG_MOVE_01MM _UxGT("Рух по 0.1mm") -#define MSG_MOVE_1MM _UxGT("Рух по 1mm") -#define MSG_MOVE_10MM _UxGT("Рух по 10mm") -#define MSG_SPEED _UxGT("Швидкість") -#define MSG_BED_Z _UxGT("Z Столу") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _UxGT("Стіл") -#define MSG_FAN_SPEED _UxGT("Охолодж.") -#define MSG_FLOW _UxGT("Потік") -#define MSG_CONTROL _UxGT("Налаштування") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Мін") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Факт") -#define MSG_AUTOTEMP _UxGT("Автотемпер.") -#define MSG_ON _UxGT("Увімк.") -#define MSG_OFF _UxGT("Вимк. ") -#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("Вибрати") -#define MSG_ACC _UxGT("Приск.") -#define MSG_JERK _UxGT("Ривок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-ривок") - #define MSG_VB_JERK _UxGT("Vb-ривок") - #define MSG_VC_JERK _UxGT("Vc-ривок") -#else - #define MSG_VA_JERK _UxGT("Vx-ривок") - #define MSG_VB_JERK _UxGT("Vy-ривок") - #define MSG_VC_JERK _UxGT("Vz-ривок") -#endif -#define MSG_VE_JERK _UxGT("Ve-ривок") -#define MSG_VMAX _UxGT("Vмакс") -#define MSG_VMIN _UxGT("Vмін") -#define MSG_VTRAV_MIN _UxGT("Vруху мін") -#define MSG_AMAX _UxGT("Aмакс ") -#define MSG_A_RETRACT _UxGT("A-втягув.") -#define MSG_A_TRAVEL _UxGT("A-руху") -#define MSG_STEPS_PER_MM _UxGT("Кроків/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aкроків/мм") - #define MSG_BSTEPS _UxGT("Bкроків/мм") - #define MSG_CSTEPS _UxGT("Cкроків/мм") -#else - #define MSG_ASTEPS _UxGT("Xкроків/мм") - #define MSG_BSTEPS _UxGT("Yкроків/мм") - #define MSG_CSTEPS _UxGT("Zкроків/мм") -#endif -#define MSG_ESTEPS _UxGT("Eкроків/мм") -#define MSG_E1STEPS _UxGT("E1кроків/мм") -#define MSG_E2STEPS _UxGT("E2кроків/мм") -#define MSG_E3STEPS _UxGT("E3кроків/мм") -#define MSG_E4STEPS _UxGT("E4кроків/мм") -#define MSG_E5STEPS _UxGT("E5кроків/мм") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Рух") -#define MSG_FILAMENT _UxGT("Волокно") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") -#define MSG_FILAMENT_DIAM _UxGT("Діам. волок.") -#define MSG_CONTRAST _UxGT("контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Зберегти в ПЗП") -#define MSG_LOAD_EEPROM _UxGT("Зчитати з ПЗП") -#define MSG_RESTORE_FAILSAFE _UxGT("Відновити базові") -#define MSG_REFRESH _UxGT("Поновити") -#define MSG_WATCH _UxGT("Інформація") -#define MSG_PREPARE _UxGT("Підготувати") -#define MSG_TUNE _UxGT("Підлаштування") -#define MSG_PAUSE_PRINT _UxGT("Призупинити друк") -#define MSG_RESUME_PRINT _UxGT("Відновити друк") -#define MSG_STOP_PRINT _UxGT("Скасувати друк") -#define MSG_CARD_MENU _UxGT("Друкувати з SD") -#define MSG_NO_CARD _UxGT("Відсутня SD карт.") -#define MSG_DWELL _UxGT("Сплячка...") -#define MSG_USERWAIT _UxGT("Очікування дій...") -#define MSG_PRINT_ABORTED _UxGT("Друк скасовано") -#define MSG_NO_MOVE _UxGT("Немає руху.") -#define MSG_KILLED _UxGT("ПЕРЕРВАНО. ") -#define MSG_STOPPED _UxGT("ЗУПИНЕНО. ") -#define MSG_FILAMENTCHANGE _UxGT("Зміна волокна") -#define MSG_INIT_SDCARD _UxGT("Старт SD картки") -#define MSG_CNG_SDCARD _UxGT("Заміна SD карти") -#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_ZPROBE_ZOFFSET _UxGT("Зміщення Z") -#define MSG_BABYSTEP_X _UxGT("Мікрокрок X") -#define MSG_BABYSTEP_Y _UxGT("Мікрокрок Y") -#define MSG_BABYSTEP_Z _UxGT("Мікрокрок Z") -#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_HALTED _UxGT("ПРИНТЕР ЗУПИНЕНО") -#define MSG_PLEASE_RESET _UxGT("Перезавантажте") -#define MSG_SHORT_DAY _UxGT("д") // One character only -#define MSG_SHORT_HOUR _UxGT("г") // One character only -#define MSG_SHORT_MINUTE _UxGT("х") // One character only -#define MSG_HEATING _UxGT("Нагрівання...") -#define MSG_BED_HEATING _UxGT("Нагрівання столу...") -#define MSG_DELTA_CALIBRATE _UxGT("Калібр. Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калібрування X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калібрування Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калібрування Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калібр. Центру") - -#define MSG_INFO_MENU _UxGT("Про принтер") -#define MSG_INFO_PRINTER_MENU _UxGT("Інформація") -#define MSG_INFO_STATS_MENU _UxGT("Статистика") -#define MSG_INFO_BOARD_MENU _UxGT("Про плату") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термістори") -#define MSG_INFO_EXTRUDERS _UxGT("Екструдери") -#define MSG_INFO_BAUDRATE _UxGT("біт/с") -#define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Підсвітка") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("К-сть друків") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Завершено") - #define MSG_INFO_PRINT_TIME _UxGT("Весь час друку") - #define MSG_INFO_PRINT_LONGEST _UxGT("Найдовший час") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Екструдовано") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Друків") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Завершено") - #define MSG_INFO_PRINT_TIME _UxGT("Загалом") - #define MSG_INFO_PRINT_LONGEST _UxGT("Найдовший") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Ексдруд.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Мін Темп.") -#define MSG_INFO_MAX_TEMP _UxGT("Макс Темп.") -#define MSG_INFO_PSU _UxGT("Джерело жив.") - -#define MSG_DRIVE_STRENGTH _UxGT("Сила мотору") -#define MSG_DAC_PERCENT _UxGT("% мотору") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запис ЦАП на ПЗП") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Відновити друк") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("початок заміни") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("волокна") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("вивід волокна") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставте волокно") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("та натисніть для") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("продовження...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("ввід волокна") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("відновлення") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("друку") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Зачекайте...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Вивід...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставте і нат.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ввід...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Відновлення...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_UK_H diff --git a/Marlin/language_zh_CN.h b/Marlin/language_zh_CN.h deleted file mode 100644 index 824033c0b0..0000000000 --- a/Marlin/language_zh_CN.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Simplified Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ZH_CN_H -#define LANGUAGE_ZH_CN_H - -//#define zh_CN 1234 - -#define CHARSIZE 3 - -#define WELCOME_MSG MACHINE_NAME _UxGT("已就绪.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ -#define MSG_SD_INSERTED _UxGT("存储卡已插入") //"Card inserted" -#define MSG_SD_REMOVED _UxGT("存储卡被拔出") //"Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("挡块") //"Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("主菜单") //"Main" -#define MSG_AUTOSTART _UxGT("自动开始") //"Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("关闭步进电机") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("调试菜单") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("进度条测试") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("回原点") //"Auto home" -#define MSG_AUTO_HOME_X _UxGT("回X原位") //"Home X" -#define MSG_AUTO_HOME_Y _UxGT("回Y原位") //"Home Y" -#define MSG_AUTO_HOME_Z _UxGT("回Z原位") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校准Z") //"Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("平台调平XYZ归原位") //"Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("单击开始热床调平") //"Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("下个热床调平点") //"Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("完成热床调平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" -#define MSG_SET_HOME_OFFSETS _UxGT("设置原点偏移") //"Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已启用") //"Offsets applied" -#define MSG_SET_ORIGIN _UxGT("设置原点") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("预热PLA") //"Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 热床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 设置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("预热ABS") //"Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 热床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 设置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降温") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("电源打开") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("电源关闭") //"Switch power off" -#define MSG_EXTRUDE _UxGT("挤出") //"Extrude" -#define MSG_RETRACT _UxGT("回抽") //"Retract" -#define MSG_MOVE_AXIS _UxGT("移动轴") //"Move axis" -#define MSG_BED_LEVELING _UxGT("调平热床") //"Bed leveling" -#define MSG_LEVEL_BED _UxGT("调平热床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("调平边角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个边角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("网格编辑已停止") // "Mesh Editing Stopped" - -#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" - -#define MSG_UBL_BC_INSERT _UxGT("放置垫片并测量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("测量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除并测量热床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移动到下一个") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("关闭UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("设置热床温度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("热端温度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("网格编辑") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("编辑客户网格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("细调网格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成编辑网格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("创设客户网格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("创设网格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("创设PLA网格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("创设ABS网格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("创设冷网格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("调整网格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合计") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准网格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA网格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS网格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客户网格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("继续热床网格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子网格调平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("调平网格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("边点") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("图类型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("输出网格图") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("输出到主机") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("输出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("输出到备份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("输出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("编辑网格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合计") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聪明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充网格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作废所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作废最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("细调所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("细调最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("网格存储") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存储槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("装载热床网格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存热床网格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("网格 %i 已装载") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("网格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("没有存储") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("错误: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("错误: UBL还原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红饱和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿饱和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝饱和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白饱和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - -#define MSG_MOVE_X _UxGT("移动X") //"Move X" -#define MSG_MOVE_Y _UxGT("移动Y") //"Move Y" -#define MSG_MOVE_Z _UxGT("移动Z") //"Move Z" -#define MSG_MOVE_E _UxGT("挤出机") //"Extruder" -#define MSG_MOVE_01MM _UxGT("移动 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移动 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移动 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("热床Z") //"Bed Z" -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 喷嘴") //"Nozzle" 噴嘴 -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 热床") //"Bed" -#define MSG_FAN_SPEED _UxGT("风扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("额外风扇速率") // "Extra fan speed" -#define MSG_FLOW _UxGT("挤出速率") //"Flow" -#define MSG_CONTROL _UxGT("控制") //"Control" -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 因数") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自动控温") //"Autotemp" -#define MSG_ON _UxGT("开 ") //"On " -#define MSG_OFF _UxGT("关 ") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#define MSG_SELECT _UxGT("选择") //"Select" -#define MSG_ACC _UxGT("加速度") //"Accel" acceleration -#define MSG_JERK _UxGT("抖动速率") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A轴抖动速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B轴抖动速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C轴抖动速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X轴抖动速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y轴抖动速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z轴抖动速率") //"Vz-jerk" -#endif -#define MSG_VE_JERK _UxGT("挤出机抖动速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" -#define MSG_VMAX _UxGT("最大进料速率") //"Vmax " max_feedrate_mm_s -#define MSG_VMIN _UxGT("最小进料速率") //"Vmin" min_feedrate_mm_s -#define MSG_VTRAV_MIN _UxGT("最小移动速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" -#define MSG_AMAX _UxGT("最大打印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves -#define MSG_A_RETRACT _UxGT("收进加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts -#define MSG_A_TRAVEL _UxGT("非打印移动加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves -#define MSG_STEPS_PER_MM _UxGT("轴步数/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A轴步数/mm") //"Asteps/mm" - #define MSG_BSTEPS _UxGT("B轴步数/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C轴步数/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X轴步数/mm") //"Xsteps/mm" - #define MSG_BSTEPS _UxGT("Y轴步数/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z轴步数/mm") //"Zsteps/mm" -#endif -#define MSG_ESTEPS _UxGT("挤出机步数/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("挤出机1步数/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("挤出机2步数/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("挤出机3步数/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("挤出机4步数/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("挤出机5步数/mm") //"E5steps/mm" -#define MSG_TEMPERATURE _UxGT("温度") //"Temperature" -#define MSG_MOTION _UxGT("运动") //"Motion" -#define MSG_FILAMENT _UxGT("丝料测容") //"Filament" lcd_control_volumetric_menu -#define MSG_VOLUMETRIC_ENABLED _UxGT("测容积mm³") //"E in mm3" volumetric_enabled -#define MSG_FILAMENT_DIAM _UxGT("丝料直径") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸载 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装载 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" -#define MSG_CONTRAST _UxGT("LCD对比度") //"LCD contrast" -#define MSG_STORE_EEPROM _UxGT("保存设置") //"Store memory" -#define MSG_LOAD_EEPROM _UxGT("装载设置") //"Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("恢复安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化设置") // "Initialize EEPROM" -#define MSG_REFRESH _UxGT("刷新") //"Refresh" -#define MSG_WATCH _UxGT("信息屏") //"Info screen" -#define MSG_PREPARE _UxGT("准备") //"Prepare" -#define MSG_TUNE _UxGT("调整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暂停打印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢复打印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止打印") //"Stop print" -#define MSG_CARD_MENU _UxGT("从存储卡上打印") //"Print from SD" -#define MSG_NO_CARD _UxGT("无存储卡") //"No SD card" -#define MSG_DWELL _UxGT("休眠中 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("点击继续 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("暫停打印") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消打印") //"Print aborted" -#define MSG_NO_MOVE _UxGT("无移动") //"No move." -#define MSG_KILLED _UxGT("已杀掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回抽长度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("换手回抽长度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回抽速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回抽恢复长度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("换手回抽恢复长度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回抽恢复后进料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" -#define MSG_AUTORETRACT _UxGT("自动抽回") //"AutoRetr." autoretract_enabled, -#define MSG_FILAMENTCHANGE _UxGT("更换丝料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("装载丝料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸载丝料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸载全部") // "Unload All" -#define MSG_INIT_SDCARD _UxGT("初始化存储卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更换存储卡") //"Change SD card" -#define MSG_ZPROBE_OUT _UxGT("Z探针在热床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因数") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自检") // "BLTouch Self-Test" -#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_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" -#define MSG_BABYSTEP_Z _UxGT("微量调整Z轴") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("挡块终止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加热失败") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("错误:REDUNDANT TEMP") //"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_HEATING _UxGT("加热中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加热热床中...") //"Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("⊿校准") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校准X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校准Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校准Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校准中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿设置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自动校准") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("设置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半径") // "Radius" -#define MSG_INFO_MENU _UxGT("关于打印机") //"About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("打印机信息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("线性调平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("双线性调平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("统一热床调平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" -#define MSG_INFO_STATS_MENU _UxGT("打印机统计") //"Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("主板信息") //"Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("温度计") //"Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("挤出机") //"Extruders" -#define MSG_INFO_BAUDRATE _UxGT("波特率") //"Baud" -#define MSG_INFO_PROTOCOL _UxGT("协议") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外壳灯") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("灯亮度") // "Light BRIGHTNESS" - -#if LCD_WIDTH > 19 -#define MSG_INFO_PRINT_COUNT _UxGT("打印计数") //"Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成了") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("总打印时间") //"Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("最长工作时间") //"Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("总计挤出") //"Extruded total" -#else -#define MSG_INFO_PRINT_COUNT _UxGT("打印数") //"Prints" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("总共") //"Total" -#define MSG_INFO_PRINT_LONGEST _UxGT("最长") //"Longest" -#define MSG_INFO_PRINT_FILAMENT _UxGT("已挤出") //"Extruded" -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("最低温度") //"Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("最高温度") //"Max Temp" -#define MSG_INFO_PSU _UxGT("电源供应") //"Power Supply" -#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_HEADER_PAUSE _UxGT("打印已暂停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("装载丝料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸载丝料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢复选项:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢复打印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 喷嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("归原位失败") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探针探测失败") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太凉") // "M600: Too cold" - -#if LCD_HEIGHT >= 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待开始") //"Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("丝料") //"of the filament" -#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("变更") //"change" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下丝料") //"filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入丝料") //"Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("并按键") //"and press button" -#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("来继续 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按钮来") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加热喷嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热喷嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("请等待 ...") // "Please wait..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("进料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("丝料清除") // "filament purge" -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待打印") //"Wait for print" -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢复") //"to resume" - -#else // LCD_HEIGHT < 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("请等待 ...") //"Please wait..." -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入并单击") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热中 ...") // "Heating..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("装载中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢复中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_ZH_CN_H diff --git a/Marlin/language_zh_TW.h b/Marlin/language_zh_TW.h deleted file mode 100644 index b5a62a984e..0000000000 --- a/Marlin/language_zh_TW.h +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Traditional Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ZH_TW_H -#define LANGUAGE_ZH_TW_H - -#define CHARSIZE 3 - -#define WELCOME_MSG MACHINE_NAME _UxGT("已就緒.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ -#define MSG_SD_INSERTED _UxGT("記憶卡已插入") //"Card inserted" -#define MSG_SD_REMOVED _UxGT("記憶卡被拔出") //"Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("擋塊") //"Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("主選單") //"Main" -#define MSG_AUTOSTART _UxGT("自動開始") //"Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("關閉步進馬達") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("除錯選單") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("進度條測試") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("自動回原點") //"Auto home" -#define MSG_AUTO_HOME_X _UxGT("回X原點") //"Home X" -#define MSG_AUTO_HOME_Y _UxGT("回Y原點") //"Home Y" -#define MSG_AUTO_HOME_Z _UxGT("回Z原點") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校準Z") //"Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("平台調平XYZ歸原點") //"Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("單擊開始熱床調平") //"Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("下個熱床調平點") //"Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("完成熱床調平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" -#define MSG_SET_HOME_OFFSETS _UxGT("設置原點偏移") //"Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已啟用") //"Offsets applied" -#define MSG_SET_ORIGIN _UxGT("設置原點") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("預熱PLA") //"Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 熱床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 設置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("預熱ABS") //"Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 熱床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 設置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降溫") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("電源打開") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("電源關閉") //"Switch power off" -#define MSG_EXTRUDE _UxGT("擠出") //"Extrude" -#define MSG_RETRACT _UxGT("回縮") //"Retract" -#define MSG_MOVE_AXIS _UxGT("移動軸") //"Move axis" -#define MSG_BED_LEVELING _UxGT("調平熱床") //"Bed leveling" -#define MSG_LEVEL_BED _UxGT("調平熱床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("調平邊角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个邊角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("網格編輯已停止") // "Mesh Editing Stopped" - -#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" - -#define MSG_UBL_BC_INSERT _UxGT("放置墊片並測量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("測量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除並測量熱床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移動到下一個") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("關閉UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("設置熱床溫度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("熱端溫度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("網格編輯") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("編輯客戶網格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("細調網格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成編輯網格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("創設客戶網格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("創設網格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("創設PLA網格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("創設ABS網格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("創設冷網格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("調整網格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合計") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准網格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA網格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS網格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客戶網格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("繼續熱床網格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子網格調平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("調平網格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("邊點") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("圖類型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("輸出網格圖") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("輸出到主機") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("輸出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("輸出到備份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("輸出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("編輯網格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合計") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聰明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充網格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作廢所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作廢最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("細調所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("細調最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("網格存儲") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存儲槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("裝載熱床網格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存熱床網格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("網格 %i 已裝載") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("網格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("沒有存儲") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("錯誤: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("錯誤: UBL還原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红飽和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿飽和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝飽和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白飽和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - -#define MSG_MOVE_X _UxGT("移動X") //"Move X" -#define MSG_MOVE_Y _UxGT("移動Y") //"Move Y" -#define MSG_MOVE_Z _UxGT("移動Z") //"Move Z" -#define MSG_MOVE_E _UxGT("擠出機") //"Extruder" -#define MSG_MOVE_01MM _UxGT("移動 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移動 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移動 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("熱床Z") //"Bed Z" -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 噴嘴") //"Nozzle" 噴嘴 -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 熱床") //"Bed" -#define MSG_FAN_SPEED _UxGT("風扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("額外風扇速率") // "Extra fan speed" -#define MSG_FLOW _UxGT("擠出速率") //"Flow" -#define MSG_CONTROL _UxGT("控制") //"Control" -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 系數") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自動控溫") //"Autotemp" -#define MSG_ON _UxGT("開 ") //"On " -#define MSG_OFF _UxGT("關 ") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#define MSG_SELECT _UxGT("選擇") //"Select" -#define MSG_ACC _UxGT("加速度") //"Accel" acceleration -#define MSG_JERK _UxGT("抖動速率") //"Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A軸抖動速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B軸抖動速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C軸抖動速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X軸抖動速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y軸抖動速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z軸抖動速率") //"Vz-jerk" -#endif -#define MSG_VE_JERK _UxGT("擠出機抖動速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" -#define MSG_VMAX _UxGT("最大進料速率") //"Vmax " max_feedrate_mm_s -#define MSG_VMIN _UxGT("最小進料速率") //"Vmin" min_feedrate_mm_s -#define MSG_VTRAV_MIN _UxGT("最小移動速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" -#define MSG_AMAX _UxGT("最大列印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves -#define MSG_A_RETRACT _UxGT("回縮加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts -#define MSG_A_TRAVEL _UxGT("非列印移動加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves -#define MSG_STEPS_PER_MM _UxGT("軸步數/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A軸步數/mm") //"Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("B軸步數/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C軸步數/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X軸步數/mm") //"Xsteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("Y軸步數/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z軸步數/mm") //"Zsteps/mm" -#endif -#define MSG_ESTEPS _UxGT("擠出機步數/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("擠出機1步數/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("擠出機2步數/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("擠出機3步數/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("擠出機4步數/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("擠出機5步數/mm") //"E5steps/mm" -#define MSG_TEMPERATURE _UxGT("溫度") //"Temperature" -#define MSG_MOTION _UxGT("運作") //"Motion" -#define MSG_FILAMENT _UxGT("絲料測容") //"Filament" lcd_control_volumetric_menu -#define MSG_VOLUMETRIC_ENABLED _UxGT("測容積mm³") //"E in mm3" volumetric_enabled -#define MSG_FILAMENT_DIAM _UxGT("絲料直徑") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸載 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装載 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" -#define MSG_CONTRAST _UxGT("LCD對比度") //"LCD contrast" -#define MSG_STORE_EEPROM _UxGT("保存設置") //"Store memory" -#define MSG_LOAD_EEPROM _UxGT("載入設置") //"Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("恢復安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化設置") // "Initialize EEPROM" -#define MSG_REFRESH _UxGT("刷新") //"Refresh" -#define MSG_WATCH _UxGT("資訊界面") //"Info screen" -#define MSG_PREPARE _UxGT("準備") //"Prepare" -#define MSG_TUNE _UxGT("調整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暫停列印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢復列印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止列印") //"Stop print" -#define MSG_CARD_MENU _UxGT("從記憶卡上列印") //"Print from SD" -#define MSG_NO_CARD _UxGT("無記憶卡") //"No SD card" -#define MSG_DWELL _UxGT("休眠 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("點擊繼續 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("列印已暫停") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消列印") //"Print aborted" -#define MSG_NO_MOVE _UxGT("無移動") //"No move." -#define MSG_KILLED _UxGT("已砍掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回縮長度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("換手回抽長度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回縮速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回縮恢復長度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("換手回縮恢復長度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回縮恢復後進料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" -#define MSG_AUTORETRACT _UxGT("自動回縮") //"AutoRetr." autoretract_enabled, -#define MSG_FILAMENTCHANGE _UxGT("更換絲料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("裝載絲料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸載絲料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸載全部") // "Unload All" -#define MSG_INIT_SDCARD _UxGT("初始化記憶卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更換記憶卡") //"Change SD card" -#define MSG_ZPROBE_OUT _UxGT("Z探針在熱床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因數") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自檢") // "BLTouch Self-Test" -#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_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" -#define MSG_BABYSTEP_Z _UxGT("微量調整Z軸") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("擋塊終止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加熱失敗") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("錯誤:REDUNDANT TEMP") //"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_HEATING _UxGT("加熱中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加熱熱床中...") //"Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("⊿校準") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校準X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校準Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校準Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校準中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿設置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自動校準") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("設置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半徑") // "Radius" -#define MSG_INFO_MENU _UxGT("關於印表機") //"About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("印表機訊息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("線性調平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("雙線性調平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("統一熱床調平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" -#define MSG_INFO_STATS_MENU _UxGT("印表機統計") //"Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("主板訊息") //"Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("溫度計") //"Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("擠出機") //"Extruders" -#define MSG_INFO_BAUDRATE _UxGT("傳輸率") //"Baud" -#define MSG_INFO_PROTOCOL _UxGT("協議") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外殼燈") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("燈亮度") // "Light BRIGHTNESS" - -#if LCD_WIDTH > 19 -#define MSG_INFO_PRINT_COUNT _UxGT("列印計數") //"Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("已完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("總列印時間") //"Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("最長工作時間") //"Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("總計擠出") //"Extruded total" -#else -#define MSG_INFO_PRINT_COUNT _UxGT("列印數") //"Prints" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("總共") //"Total" -#define MSG_INFO_PRINT_LONGEST _UxGT("最長") //"Longest" -#define MSG_INFO_PRINT_FILAMENT _UxGT("已擠出") //"Extruded" -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("最低溫度") //"Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("最高溫度") //"Max Temp" -#define MSG_INFO_PSU _UxGT("電源供應") //"Power Supply" -#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_HEADER_PAUSE _UxGT("列印已暫停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("裝載絲料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸載絲料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢複選項:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢復列印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 噴嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("歸原位失敗") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探針探測失敗") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太涼") // "M600: Too cold" - -#if LCD_HEIGHT >= 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待開始") //"Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("絲料") //"of the filament" -#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("變更") //"change" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下絲料") //"filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入絲料") //"Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("並按鍵") //"and press button" -#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("繼續 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按鈕來") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加熱噴嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱噴嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("請等待 ...") // "Please wait..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("進料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("絲料清除") // "filament purge" -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待列印") //"Wait for print" -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢復") //"to resume" - -#else // LCD_HEIGHT < 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("請等待 ...") //"Please wait..." -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入並點擊") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱中 ...") // "Heating..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("載入中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢復中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_ZH_TW_H diff --git a/Marlin/least_squares_fit.cpp b/Marlin/least_squares_fit.cpp deleted file mode 100644 index 9e59804f09..0000000000 --- a/Marlin/least_squares_fit.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Least Squares Best Fit by Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. It also does not require all of - * coordinates to be present during the calculations. Each point can be - * probed and then discarded. - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR) - -#include "macros.h" -#include - -#include "least_squares_fit.h" - -int finish_incremental_LSF(struct linear_fit_data *lsf) { - - const float N = lsf->N; - - if (N == 0.0) - return 1; - - lsf->xbar /= N; - lsf->ybar /= N; - lsf->zbar /= N; - lsf->x2bar = lsf->x2bar / N - sq(lsf->xbar); - lsf->y2bar = lsf->y2bar / N - sq(lsf->ybar); - lsf->z2bar = lsf->z2bar / N - sq(lsf->zbar); - lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar; - lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar; - lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar; - const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar); - - if (ABS(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy)) - return 1; - - lsf->A = (lsf->yzbar * lsf->xybar - lsf->xzbar * lsf->y2bar) / DD; - lsf->B = (lsf->xzbar * lsf->xybar - lsf->yzbar * lsf->x2bar) / DD; - lsf->D = -(lsf->zbar + lsf->A * lsf->xbar + lsf->B * lsf->ybar); - return 0; -} - -#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR) diff --git a/Marlin/least_squares_fit.h b/Marlin/least_squares_fit.h deleted file mode 100644 index 68aa62b9c5..0000000000 --- a/Marlin/least_squares_fit.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Incremental Least Squares Best Fit By Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. And even better... the data - * fed into the algorithm does not need to all be present at the same time. - * A point can be probed and its values fed into the algorithm and then discarded. - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR) - -#include "Marlin.h" -#include "macros.h" -#include - -struct linear_fit_data { - float xbar, ybar, zbar, - x2bar, y2bar, z2bar, - xybar, xzbar, yzbar, - max_absx, max_absy, - A, B, D, N; -}; - -void inline 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) { - // weight each accumulator by factor w, including the "number" of samples - // (analagous 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; - lsf->N += w; - lsf->max_absx = MAX(ABS(w * x), lsf->max_absx); - lsf->max_absy = MAX(ABS(w * y), lsf->max_absy); -} - -void inline 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; - lsf->x2bar += sq(x); - lsf->y2bar += sq(y); - lsf->z2bar += sq(z); - lsf->xybar += x * y; - lsf->xzbar += x * z; - lsf->yzbar += y * z; - lsf->max_absx = MAX(ABS(x), lsf->max_absx); - lsf->max_absy = MAX(ABS(y), lsf->max_absy); - lsf->N += 1.0; -} - -int finish_incremental_LSF(struct linear_fit_data *); - -#endif - diff --git a/Marlin/leds.cpp b/Marlin/leds.cpp deleted file mode 100644 index df798acf8f..0000000000 --- a/Marlin/leds.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * leds.cpp - Marlin RGB LED general support - */ - -#include "MarlinConfig.h" - -#if HAS_COLOR_LEDS - -#include "leds.h" - -#if ENABLED(BLINKM) - #include "blinkm.h" -#endif - -#if ENABLED(PCA9632) - #include "pca9632.h" -#endif - -#if ENABLED(LED_COLOR_PRESETS) - const LEDColor LEDLights::defaultLEDColor = MakeLEDColor( - LED_USER_PRESET_RED, - LED_USER_PRESET_GREEN, - LED_USER_PRESET_BLUE, - LED_USER_PRESET_WHITE, - LED_USER_PRESET_BRIGHTNESS - ); -#endif - -#if ENABLED(LED_CONTROL_MENU) - LEDColor LEDLights::color; - bool LEDLights::lights_on; -#endif - -LEDLights leds; - -void LEDLights::setup() { - #if ENABLED(NEOPIXEL_LED) - setup_neopixel(); - #endif - #if ENABLED(LED_USER_PRESET_STARTUP) - set_default(); - #endif -} - -void LEDLights::set_color(const LEDColor &incol - #if ENABLED(NEOPIXEL_LED) - , bool isSequence/*=false*/ - #endif -) { - - #if ENABLED(NEOPIXEL_LED) - - const uint32_t neocolor = pixels.Color(incol.r, incol.g, incol.b, incol.w); - static uint16_t nextLed = 0; - - pixels.setBrightness(incol.i); - if (!isSequence) - set_neopixel_color(neocolor); - else { - pixels.setPixelColor(nextLed, neocolor); - pixels.show(); - if (++nextLed >= pixels.numPixels()) nextLed = 0; - return; - } - - #endif - - #if ENABLED(BLINKM) - - // This variant uses i2c to send the RGB components to the device. - blinkm_set_led_color(incol); - - #endif - - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - - // This variant uses 3-4 separate pins for the RGB(W) components. - // If the pins can do PWM then their intensity will be set. - WRITE(RGB_LED_R_PIN, incol.r ? HIGH : LOW); - WRITE(RGB_LED_G_PIN, incol.g ? HIGH : LOW); - WRITE(RGB_LED_B_PIN, incol.b ? HIGH : LOW); - analogWrite(RGB_LED_R_PIN, incol.r); - analogWrite(RGB_LED_G_PIN, incol.g); - analogWrite(RGB_LED_B_PIN, incol.b); - - #if ENABLED(RGBW_LED) - WRITE(RGB_LED_W_PIN, incol.w ? HIGH : LOW); - analogWrite(RGB_LED_W_PIN, incol.w); - #endif - - #endif - - #if ENABLED(PCA9632) - // Update I2C LED driver - pca9632_set_led_color(incol); - #endif - - #if ENABLED(LED_CONTROL_MENU) - // Don't update the color when OFF - lights_on = !incol.is_off(); - if (lights_on) color = incol; - #endif -} - -void LEDLights::set_white() { - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) - set_color(LEDColorWhite()); - #endif - #if ENABLED(NEOPIXEL_LED) - set_neopixel_color(pixels.Color(NEO_WHITE)); - #endif -} - -#if ENABLED(LED_CONTROL_MENU) - void LEDLights::toggle() { if (lights_on) set_off(); else update(); } -#endif - -#endif // HAS_COLOR_LEDS diff --git a/Marlin/leds.h b/Marlin/leds.h deleted file mode 100644 index f5e74b3caa..0000000000 --- a/Marlin/leds.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * leds.h - Marlin general RGB LED support - */ - -#ifndef __LEDS_H__ -#define __LEDS_H__ - -#include "MarlinConfig.h" - -#if ENABLED(NEOPIXEL_LED) - #include "neopixel.h" -#endif - -#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)) - -/** - * LEDcolor type for use with leds.set_color - */ -typedef struct LEDColor { - uint8_t r, g, b - #if HAS_WHITE_LED - , w - #if ENABLED(NEOPIXEL_LED) - , i - #endif - #endif - ; - LEDColor() : r(255), g(255), b(255) - #if HAS_WHITE_LED - , w(255) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - LEDColor(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - ) : r(r), g(g), b(b) - #if HAS_WHITE_LED - , w(w) - #if ENABLED(NEOPIXEL_LED) - , i(i) - #endif - #endif - {} - LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2]) - #if HAS_WHITE_LED - , w(rgbw[3]) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - LEDColor& operator=(const uint8_t (&rgbw)[4]) { - r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; - #if HAS_WHITE_LED - w = rgbw[3]; - #endif - return *this; - } - LEDColor& operator=(const LEDColor &right) { - if (this != &right) memcpy(this, &right, sizeof(LEDColor)); - return *this; - } - bool operator==(const LEDColor &right) { - if (this == &right) return true; - return 0 == memcmp(this, &right, sizeof(LEDColor)); - } - bool operator!=(const LEDColor &right) { return !operator==(right); } - bool is_off() const { - return 3 > r + g + b - #if HAS_WHITE_LED - + w - #endif - ; - } -} LEDColor; - -/** - * Color helpers and presets - */ -#if HAS_WHITE_LED - #define LEDColorWhite() LEDColor(0, 0, 0, 255) - #if ENABLED(NEOPIXEL_LED) - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I) - #else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W) - #endif -#else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B) - #define LEDColorWhite() LEDColor(255, 255, 255) -#endif -#define LEDColorOff() LEDColor( 0, 0, 0) -#define LEDColorRed() LEDColor(255, 0, 0) -#define LEDColorOrange() LEDColor(255, 80, 0) -#define LEDColorYellow() LEDColor(255, 255, 0) -#define LEDColorGreen() LEDColor( 0, 255, 0) -#define LEDColorBlue() LEDColor( 0, 0, 255) -#define LEDColorIndigo() LEDColor( 0, 255, 255) -#define LEDColorViolet() LEDColor(255, 0, 255) - -class LEDLights { -public: - LEDLights() {} // ctor - - static void setup(); // init() - - static void set_color(const LEDColor &color - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ); - - FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ) { - set_color(MakeLEDColor(r, g, b, w, i) - #if ENABLED(NEOPIXEL_LED) - , isSequence - #endif - ); - } - - static void set_white(); - FORCE_INLINE static void set_off() { set_color(LEDColorOff()); } - FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); } - - #if ENABLED(LED_COLOR_PRESETS) - static const LEDColor defaultLEDColor; - FORCE_INLINE static void set_default() { set_color(defaultLEDColor); } - FORCE_INLINE static void set_red() { set_color(LEDColorRed()); } - FORCE_INLINE static void set_orange() { set_color(LEDColorOrange()); } - FORCE_INLINE static void set_yellow() { set_color(LEDColorYellow()); } - FORCE_INLINE static void set_blue() { set_color(LEDColorBlue()); } - FORCE_INLINE static void set_indigo() { set_color(LEDColorIndigo()); } - FORCE_INLINE static void set_violet() { set_color(LEDColorViolet()); } - #endif - - #if ENABLED(LED_CONTROL_MENU) - static LEDColor color; // last non-off color - static bool lights_on; // the last set color was "on" - static void toggle(); // swap "off" with color - FORCE_INLINE static void update() { set_color(color); } - #endif -}; - -extern LEDLights leds; - -#endif // __LEDS_H__ diff --git a/Marlin/macros.h b/Marlin/macros.h deleted file mode 100644 index 9479788aa2..0000000000 --- a/Marlin/macros.h +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef MACROS_H -#define MACROS_H - -#define NUM_AXIS 4 -#define ABCE 4 -#define XYZE 4 -#define ABC 3 -#define XYZ 3 - -// For use in macros that take a single axis letter -#define _AXIS(A) (A##_AXIS) - -#define _XMIN_ 100 -#define _YMIN_ 200 -#define _ZMIN_ 300 -#define _XMAX_ 101 -#define _YMAX_ 201 -#define _ZMAX_ 301 - -#define FORCE_INLINE __attribute__((always_inline)) inline -#define _UNUSED __attribute__((unused)) -#define _O0 __attribute__((optimize("O0"))) -#define _Os __attribute__((optimize("Os"))) -#define _O1 __attribute__((optimize("O1"))) -#define _O2 __attribute__((optimize("O2"))) -#define _O3 __attribute__((optimize("O3"))) - -// Clock speed factors -#define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 -#define INT0_PRESCALER 8 - -// Nanoseconds per cycle -#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) - -// Remove compiler warning on an unused variable -#define UNUSED(x) (void) (x) - -// Macros to make a string from a macro -#define STRINGIFY_(M) #M -#define STRINGIFY(M) STRINGIFY_(M) - -#define A(CODE) " " CODE "\n\t" -#define L(CODE) CODE ":\n\t" - -// Macros for bit masks -#undef _BV -#define _BV(b) (1 << (b)) -#define TEST(n,b) !!((n)&_BV(b)) -#define SBI(n,b) (n |= _BV(b)) -#define CBI(n,b) (n &= ~_BV(b)) -#define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) - -#define _BV32(b) (1UL << (b)) -#define TEST32(n,b) !!((n)&_BV32(b)) -#define SBI32(n,b) (n |= _BV32(b)) -#define CBI32(n,b) (n &= ~_BV32(b)) - -// Macro to check that a number if a power if 2 -#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) - -// Macros for maths shortcuts -#undef M_PI -#define M_PI 3.14159265358979323846f -#define RADIANS(d) ((d)*M_PI/180.0f) -#define DEGREES(r) ((r)*180.0f/M_PI) -#define HYPOT2(x,y) (sq(x)+sq(y)) - -#define CIRCLE_AREA(R) (M_PI * sq(float(R))) -#define CIRCLE_CIRC(R) (2 * M_PI * (float(R))) - -#define SIGN(a) ((a>0)-(a<0)) -#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) - -// Macros to contrain values -#define NOLESS(v,n) do{ if (v < n) v = n; }while(0) -#define NOMORE(v,n) do{ if (v > n) v = n; }while(0) -#define LIMIT(v,n1,n2) do{ if (v < n1) v = n1; else if (v > n2) v = n2; }while(0) - -// Macros to support option testing -#define _CAT(a, ...) a ## __VA_ARGS__ -#define SWITCH_ENABLED_false 0 -#define SWITCH_ENABLED_true 1 -#define SWITCH_ENABLED_0 0 -#define SWITCH_ENABLED_1 1 -#define SWITCH_ENABLED_0x0 0 -#define SWITCH_ENABLED_0x1 1 -#define SWITCH_ENABLED_ 1 -#define ENABLED(b) _CAT(SWITCH_ENABLED_, b) -#define DISABLED(b) !ENABLED(b) - -#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H)) -#define NUMERIC(a) WITHIN(a, '0', '9') -#define DECIMAL(a) (NUMERIC(a) || a == '.') -#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') -#define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') -#define COUNT(a) (sizeof(a)/sizeof(*a)) -#define ZERO(a) memset(a,0,sizeof(a)) -#define COPY(a,b) memcpy(a,b,MIN(sizeof(a),sizeof(b))) - -// 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_N(N, ...) ARRAY_ ##N(__VA_ARGS__) -#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__) - -// Macros for adding -#define INC_0 1 -#define INC_1 2 -#define INC_2 3 -#define INC_3 4 -#define INC_4 5 -#define INC_5 6 -#define INC_6 7 -#define INC_7 8 -#define INC_8 9 -#define INCREMENT_(n) INC_ ##n -#define INCREMENT(n) INCREMENT_(n) - -// Macros for subtracting -#define DEC_1 0 -#define DEC_2 1 -#define DEC_3 2 -#define DEC_4 3 -#define DEC_5 4 -#define DEC_6 5 -#define DEC_7 6 -#define DEC_8 7 -#define DEC_9 8 -#define DECREMENT_(n) DEC_ ##n -#define DECREMENT(n) DECREMENT_(n) - -#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0) - -#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) -#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) - -#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) -#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) - -#define NOOP do{} while(0) - -#define CEILING(x,y) (((x) + (y) - 1) / (y)) - -// Avoid double evaluation of arguments on MIN/MAX/ABS -#undef MIN -#undef MAX -#undef ABS -#ifdef __cplusplus - - // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; - } - template static inline constexpr auto MAX(const L lhs, const R rhs) -> decltype(lhs + rhs){ - return lhs > rhs ? lhs : rhs; - } - template static inline constexpr const T ABS(const T v) { - return v >= 0 ? v : -v; - } -#else - - // Using GCC extensions, but Travis GCC version does not like it and gives - // "error: statement-expressions are not allowed outside functions nor in template-argument lists" - #define MIN(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a < _b ? _a : _b;}) - - #define MAX(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a > _b ? _a : _b;}) - - #define ABS(a) \ - ({__typeof__(a) _a = (a); \ - _a >= 0 ? _a : -_a;}) - -#endif - -#define MIN3(a, b, c) MIN(MIN(a, b), c) -#define MIN4(a, b, c, d) MIN(MIN3(a, b, c), d) -#define MIN5(a, b, c, d, e) MIN(MIN4(a, b, c, d), e) -#define MAX3(a, b, c) MAX(MAX(a, b), c) -#define MAX4(a, b, c, d) MAX(MAX3(a, b, c), d) -#define MAX5(a, b, c, d, e) MAX(MAX4(a, b, c, d), e) - -#define UNEAR_ZERO(x) ((x) < 0.000001f) -#define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f) -#define NEAR(x,y) NEAR_ZERO((x)-(y)) - -#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0f : 1.0f / (x)) -#define FIXFLOAT(f) (f + (f < 0.0f ? -0.00005f : 0.00005f)) - -// -// Maths macros that can be overridden by HAL -// -#define ATAN2(y, x) atan2f(y, x) -#define POW(x, y) powf(x, y) -#define SQRT(x) sqrtf(x) -#define RSQRT(x) (1 / sqrtf(x)) -#define CEIL(x) ceilf(x) -#define FLOOR(x) floorf(x) -#define LROUND(x) lroundf(x) -#define FMOD(x, y) fmodf(x, y) -#define HYPOT(x,y) SQRT(HYPOT2(x,y)) - -#endif // MACROS_H diff --git a/Marlin/malyanlcd.cpp b/Marlin/malyanlcd.cpp deleted file mode 100644 index 74a5b611d8..0000000000 --- a/Marlin/malyanlcd.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * malyanlcd.cpp - * - * LCD implementation for Malyan's LCD, a separate ESP8266 MCU running - * on Serial1 for the M200 board. This module outputs a pseudo-gcode - * wrapped in curly braces which the LCD implementation translates into - * actual G-code commands. - * - * Added to Marlin for Mini/Malyan M200 - * Unknown commands as of Jan 2018: {H:} - * Not currently implemented: - * {E:} when sent by LCD. Meaning unknown. - * - * Notes for connecting to boards that are not Malyan: - * The LCD is 3.3v, so if powering from a RAMPS 1.4 board or - * other 5v/12v board, use a buck converter to power the LCD and - * the 3.3v side of a logic level shifter. Aux1 on the RAMPS board - * has Serial1 and 12v, making it perfect for this. - * Copyright (c) 2017 Jason Nelson (xC0000005) - */ - -#include "MarlinConfig.h" - -#if ENABLED(MALYAN_LCD) - -#if ENABLED(SDSUPPORT) - #include "cardreader.h" - #include "SdFatConfig.h" -#else - #define LONG_FILENAME_LENGTH 0 -#endif - -#include "temperature.h" -#include "planner.h" -#include "stepper.h" -#include "duration_t.h" -#include "printcounter.h" -#include "parser.h" -#include "configuration_store.h" - -#include "Marlin.h" - -#if USE_MARLINSERIAL - // Make an exception to use HardwareSerial too - #undef HardwareSerial_h - #include - #define USB_STATUS true -#else - #define USB_STATUS Serial -#endif - -// On the Malyan M200, this will be Serial1. On a RAMPS board, -// it might not be. -#define LCD_SERIAL Serial1 - -// This is based on longest sys command + a filename, plus some buffer -// in case we encounter some data we don't recognize -// There is no evidence a line will ever be this long, but better safe than sorry -#define MAX_CURLY_COMMAND (32 + LONG_FILENAME_LENGTH) * 2 - -// Track incoming command bytes from the LCD -int inbound_count; - -// For sending print completion messages -bool last_printing_status = false; - -// Everything written needs the high bit set. -void write_to_lcd_P(const char * const message) { - char encoded_message[MAX_CURLY_COMMAND]; - uint8_t message_length = MIN(strlen_P(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = pgm_read_byte(&message[i]) | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -void write_to_lcd(const char * const message) { - char encoded_message[MAX_CURLY_COMMAND]; - const uint8_t message_length = MIN(strlen(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = message[i] | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -/** - * Process an LCD 'C' command. - * These are currently all temperature commands - * {C:T0190} - * Set temp for hotend to 190 - * {C:P050} - * Set temp for bed to 50 - * - * {C:S09} set feedrate to 90 %. - * {C:S12} set feedrate to 120 %. - * - * the command portion begins after the : - */ -void process_lcd_c_command(const char* command) { - switch (command[0]) { - case 'C': { - int raw_feedrate = atoi(command + 1); - feedrate_percentage = raw_feedrate * 10; - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - } break; - case 'T': { - thermalManager.setTargetHotend(atoi(command + 1), 0); - } break; - case 'P': { - thermalManager.setTargetBed(atoi(command + 1)); - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command); - return; - } -} - -/** - * Process an LCD 'B' command. - * {B:0} results in: {T0:008/195}{T1:000/000}{TP:000/000}{TQ:000C}{TT:000000} - * T0/T1 are hot end temperatures, TP is bed, TQ is percent, and TT is probably - * time remaining (HH:MM:SS). The UI can't handle displaying a second hotend, - * but the stock firmware always sends it, and it's always zero. - */ -void process_lcd_eb_command(const char* command) { - char elapsed_buffer[10]; - duration_t elapsed; - switch (command[0]) { - case '0': { - elapsed = print_job_timer.duration(); - sprintf_P(elapsed_buffer, PSTR("%02u%02u%02u"), uint16_t(elapsed.hour()), uint16_t(elapsed.minute()) % 60UL, elapsed.second()); - - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, - PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}{TQ:%03i}{TT:%s}"), - thermalManager.degHotend(0), - thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - thermalManager.degBed(), - thermalManager.degTargetBed(), - #else - 0, 0, - #endif - #if ENABLED(SDSUPPORT) - card.percentDone(), - #else - 0, - #endif - elapsed_buffer); - write_to_lcd(message_buffer); - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN E/B COMMAND", command); - return; - } -} - -/** - * Process an LCD 'J' command. - * These are currently all movement commands. - * The command portion begins after the : - * Move X Axis - * - * {J:E}{J:X-200}{J:E} - * {J:E}{J:X+200}{J:E} - * X, Y, Z, A (extruder) - */ -void process_lcd_j_command(const char* command) { - static bool steppers_enabled = false; - char axis = command[0]; - - switch (axis) { - case 'E': - // enable or disable steppers - // switch to relative - enqueue_and_echo_commands_now_P(PSTR("G91")); - enqueue_and_echo_commands_now_P(steppers_enabled ? PSTR("M18") : PSTR("M17")); - steppers_enabled = !steppers_enabled; - break; - case 'A': - axis = 'E'; - // fallthru - case 'Y': - case 'Z': - case 'X': { - // G0 - // The M200 class UI seems to send movement in .1mm values. - char cmd[20]; - sprintf_P(cmd, PSTR("G1 %c%03.1f"), axis, atof(command + 1) / 10.0); - enqueue_and_echo_command_now(cmd); - } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); - return; - } -} - -/** - * Process an LCD 'P' command, related to homing and printing. - * Cancel: - * {P:X} - * - * Home all axes: - * {P:H} - * - * Print a file: - * {P:000} - * The File number is specified as a three digit value. - * Printer responds with: - * {PRINTFILE:Mini_SNES_Bottom.gcode} - * {SYS:BUILD}echo:Now fresh file: Mini_SNES_Bottom.gcode - * File opened: Mini_SNES_Bottom.gcode Size: 5805813 - * File selected - * {SYS:BUILD} - * T:-2526.8 E:0 - * T:-2533.0 E:0 - * T:-2537.4 E:0 - * Note only the curly brace stuff matters. - */ -void process_lcd_p_command(const char* command) { - - switch (command[0]) { - case 'X': - #if ENABLED(SDSUPPORT) - // cancel print - write_to_lcd_P(PSTR("{SYS:CANCELING}")); - last_printing_status = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - clear_command_queue(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - wait_for_heatup = false; - write_to_lcd_P(PSTR("{SYS:STARTED}")); - #endif - break; - case 'H': - // Home all axis - enqueue_and_echo_commands_now_P(PSTR("G28")); - break; - default: { - #if ENABLED(SDSUPPORT) - // Print file 000 - a three digit number indicating which - // file to print in the SD card. If it's a directory, - // then switch to the directory. - - // Find the name of the file to print. - // It's needed to echo the PRINTFILE option. - // The {S:L} command should've ensured the SD card was mounted. - card.getfilename(atoi(command)); - - // There may be a difference in how V1 and V2 LCDs handle subdirectory - // prints. Investigate more. This matches the V1 motion controller actions - // but the V2 LCD switches to "print" mode on {SYS:DIR} response. - if (card.filenameIsDir) { - card.chdir(card.filename); - write_to_lcd_P(PSTR("{SYS:DIR}")); - } - else { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - write_to_lcd_P(PSTR("{SYS:BUILD}")); - card.openAndPrintFile(card.filename); - } - #endif - } break; // default - } // switch -} - -/** - * Handle an lcd 'S' command - * {S:I} - Temperature request - * {T0:999/000}{T1:000/000}{TP:004/000} - * - * {S:L} - File Listing request - * Printer Response: - * {FILE:buttons.gcode} - * {FILE:update.bin} - * {FILE:nupdate.bin} - * {FILE:fcupdate.flg} - * {SYS:OK} - */ -void process_lcd_s_command(const char* command) { - switch (command[0]) { - case 'I': { - // temperature information - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}"), - thermalManager.degHotend(0), thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - thermalManager.degBed(), thermalManager.degTargetBed() - #else - 0, 0 - #endif - ); - write_to_lcd(message_buffer); - } break; - - case 'H': - // Home all axis - enqueue_and_echo_command("G28"); - break; - - case 'L': { - #if ENABLED(SDSUPPORT) - if (!card.cardOK) card.initsd(); - - // A more efficient way to do this would be to - // implement a callback in the ls_SerialPrint code, but - // that requires changes to the core cardreader class that - // would not benefit the majority of users. Since one can't - // select a file for printing during a print, there's - // little reason not to do it this way. - char message_buffer[MAX_CURLY_COMMAND]; - uint16_t file_count = card.get_num_Files(); - for (uint16_t i = 0; i < file_count; i++) { - card.getfilename(i); - sprintf_P(message_buffer, card.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - } - - write_to_lcd_P(PSTR("{SYS:OK}")); - #endif - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN S COMMAND", command); - return; - } -} - -/** - * Receive a curly brace command and translate to G-code. - * Currently {E:0} is not handled. Its function is unknown, - * but it occurs during the temp window after a sys build. - */ -void process_lcd_command(const char* command) { - const char *current = command; - - current++; // skip the leading {. The trailing one is already gone. - byte command_code = *current++; - if (*current != ':') { - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND FORMAT", command); - return; - } - - current++; // skip the : - - switch (command_code) { - case 'S': - process_lcd_s_command(current); - break; - case 'J': - process_lcd_j_command(current); - break; - case 'P': - process_lcd_p_command(current); - break; - case 'C': - process_lcd_c_command(current); - break; - case 'B': - case 'E': - process_lcd_eb_command(current); - break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND", command); - return; - } -} - -/** - * UC means connected. - * UD means disconnected - * The stock firmware considers USB initialized as "connected." - */ -void update_usb_status(const bool forceUpdate) { - static bool last_usb_connected_status = false; - // This is mildly different than stock, which - // appears to use the usb discovery status. - // This is more logical. - if (last_usb_connected_status != USB_STATUS || forceUpdate) { - last_usb_connected_status = USB_STATUS; - write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n")); - } -} - -/** - * - from printer on startup: - * {SYS:STARTED}{VER:29}{SYS:STARTED}{R:UD} - * The optimize attribute fixes a register Compile - * error for amtel. - */ -void _O2 lcd_update() { - static char inbound_buffer[MAX_CURLY_COMMAND]; - - // First report USB status. - update_usb_status(false); - - // now drain commands... - while (LCD_SERIAL.available()) { - const byte b = (byte)LCD_SERIAL.read() & 0x7F; - inbound_buffer[inbound_count++] = b; - if (b == '}' || inbound_count == sizeof(inbound_buffer) - 1) { - inbound_buffer[inbound_count - 1] = '\0'; - process_lcd_command(inbound_buffer); - inbound_count = 0; - inbound_buffer[0] = 0; - } - } - - #if ENABLED(SDSUPPORT) - // The way last printing status works is simple: - // The UI needs to see at least one TQ which is not 100% - // and then when the print is complete, one which is. - static uint8_t last_percent_done = 100; - - // If there was a print in progress, we need to emit the final - // print status as {TQ:100}. Reset last percent done so a new print will - // issue a percent of 0. - const uint8_t percent_done = card.sdprinting ? card.percentDone() : last_printing_status ? 100 : 0; - if (percent_done != last_percent_done) { - char message_buffer[10]; - sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); - write_to_lcd(message_buffer); - last_percent_done = percent_done; - last_printing_status = card.sdprinting; - } - #endif -} - -/** - * The Malyan LCD actually runs as a separate MCU on Serial 1. - * This code's job is to siphon the weird curly-brace commands from - * it and translate into gcode, which then gets injected into - * the command queue where possible. - */ -void lcd_init() { - inbound_count = 0; - LCD_SERIAL.begin(500000); - - // Signal init - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - - // send a version that says "unsupported" - write_to_lcd_P(PSTR("{VER:99}\r\n")); - - // No idea why it does this twice. - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - update_usb_status(true); -} - -/** - * Set an alert. - */ -void lcd_setalertstatusPGM(const char* message) { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{E:%s}"), message); - write_to_lcd(message_buffer); -} - -#endif // MALYAN_LCD diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp deleted file mode 100644 index cc2ee6ac45..0000000000 --- a/Marlin/mesh_bed_leveling.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(MESH_BED_LEVELING) - - #include "mesh_bed_leveling.h" - #include "Marlin.h" - #include "serial.h" - - mesh_bed_leveling mbl; - - float mesh_bed_leveling::z_offset, - mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X], - mesh_bed_leveling::index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling::mesh_bed_leveling() { - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; ++i) - index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; ++i) - index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST); - reset(); - } - - void mesh_bed_leveling::reset() { - z_offset = 0; - ZERO(z_values); - } - - void mesh_bed_leveling::report_mesh() { - SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); - SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5); - SERIAL_PROTOCOLLNPGM("\nMeasured points:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - -#endif // MESH_BED_LEVELING diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h deleted file mode 100644 index cb95ad733f..0000000000 --- a/Marlin/mesh_bed_leveling.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _MESH_BED_LEVELING_H_ -#define _MESH_BED_LEVELING_H_ - -#include "MarlinConfig.h" - -enum MeshLevelingState : char { - MeshReport, - MeshStart, - MeshNext, - MeshSet, - MeshSetZOffset, - MeshReset -}; - -#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)) - -class mesh_bed_leveling { -public: - static float z_offset, - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - index_to_xpos[GRID_MAX_POINTS_X], - index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling(); - - static void report_mesh(); - - static void reset(); - - FORCE_INLINE static bool has_mesh() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (z_values[x][y]) return true; - return false; - } - - static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { - px = index % (GRID_MAX_POINTS_X); - py = index / (GRID_MAX_POINTS_X); - if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag - } - - static void set_zigzag_z(const int8_t index, const float &z) { - int8_t px, py; - zigzag(index, px, py); - set_z(px, py, z); - } - - static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (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)); - 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)); - 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)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - const float delta_z = (z2 - z1) / (a2 - a1), - delta_a = a0 - a1; - return z1 + delta_a * delta_z; - } - - static float get_z(const float &x0, const float &y0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , const float &factor - #endif - ) { - const int8_t cx = cell_index_x(x0), cy = cell_index_y(y0); - const float z1 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy], index_to_xpos[cx + 1], z_values[cx + 1][cy]), - z2 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy + 1], index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]), - z0 = calc_z0(y0, index_to_ypos[cy], z1, index_to_ypos[cy + 1], z2); - - return z_offset + z0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * factor - #endif - ; - } -}; - -extern mesh_bed_leveling mbl; - -#endif // _MESH_BED_LEVELING_H_ diff --git a/Marlin/neopixel.cpp b/Marlin/neopixel.cpp deleted file mode 100644 index 8daca3badf..0000000000 --- a/Marlin/neopixel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * neopixel.cpp - */ - -#include "MarlinConfig.h" - -#if ENABLED(NEOPIXEL_LED) - -#include "neopixel.h" - -#if ENABLED(NEOPIXEL_STARTUP_TEST) - #include "utility.h" -#endif - -Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); - -void set_neopixel_color(const uint32_t color) { - for (uint16_t i = 0; i < pixels.numPixels(); ++i) - pixels.setPixelColor(i, color); - pixels.show(); -} - -void setup_neopixel() { - SET_OUTPUT(NEOPIXEL_PIN); - pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range - pixels.begin(); - pixels.show(); // initialize to all off - - #if ENABLED(NEOPIXEL_STARTUP_TEST) - safe_delay(1000); - set_neopixel_color(pixels.Color(255, 0, 0, 0)); // red - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 255, 0, 0)); // green - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 0, 255, 0)); // blue - safe_delay(1000); - #endif - set_neopixel_color(pixels.Color(NEO_WHITE)); // white -} - -#endif // NEOPIXEL_LED - diff --git a/Marlin/neopixel.h b/Marlin/neopixel.h deleted file mode 100644 index b7ed45c827..0000000000 --- a/Marlin/neopixel.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * neopixel.h - */ - -#include "MarlinConfig.h" - -#define NEOPIXEL_IS_RGB (NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR) -#define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB - -#if NEOPIXEL_IS_RGB - #define NEO_WHITE 255, 255, 255, 0 -#else - #define NEO_WHITE 0, 0, 0, 255 -#endif - -#include -#include - -void setup_neopixel(); -void set_neopixel_color(const uint32_t color); - -extern Adafruit_NeoPixel pixels; diff --git a/Marlin/nozzle.cpp b/Marlin/nozzle.cpp deleted file mode 100644 index 8bff692e44..0000000000 --- a/Marlin/nozzle.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) - -#include "nozzle.h" - -#include "Marlin.h" -#include "point_t.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - */ - void Nozzle::stroke(const point_t &start, const point_t &end, const uint8_t &strokes) { - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - // Move to the starting point - do_blocking_move_to(start.x, start.y, start.z); - - // Start the stroke pattern - for (uint8_t i = 0; i < (strokes >> 1); i++) { - do_blocking_move_to_xy(end.x, end.y); - do_blocking_move_to_xy(start.x, start.y); - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of triangles to do - */ - void Nozzle::zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) { - const float diffx = end.x - start.x, diffy = end.y - start.y; - if (!diffx || !diffy) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - do_blocking_move_to(start.x, start.y, start.z); - - const uint8_t zigs = objects << 1; - const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe? - const float P = (horiz ? diffx : diffy) / zigs; // Period of each zig / zag - const point_t *side; - for (uint8_t j = 0; j < strokes; j++) { - for (int8_t i = 0; i < zigs; i++) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - for (int8_t i = zigs; i >= 0; i--) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start point_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - void Nozzle::circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) { - if (strokes == 0) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - do_blocking_move_to(start.x, start.y, start.z); - - for (uint8_t s = 0; s < strokes; s++) - for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++) - do_blocking_move_to_xy( - middle.x + sin((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius, - middle.y + cos((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius - ); - - // Let's be safe - do_blocking_move_to_xy(start.x, start.y); - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects/*=0*/) { - switch (pattern) { - case 1: - zigzag(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes, objects); - break; - - case 2: - circle(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_CIRCLE_MIDDLE, strokes, radius); - break; - - default: - stroke(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes); - } - } - -#endif // NOZZLE_CLEAN_FEATURE - -#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; - const float fr_z = NOZZLE_PARK_Z_FEEDRATE; - - switch (z_action) { - case 1: // Go to Z-park height - do_blocking_move_to_z(park.z, fr_z); - break; - - case 2: // Raise by Z-park height - do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z); - break; - - default: // Raise to at least the Z-park height - do_blocking_move_to_z(MAX(park.z, current_position[Z_AXIS]), fr_z); - } - - do_blocking_move_to_xy(park.x, park.y, fr_xy); - } - -#endif // NOZZLE_PARK_FEATURE - -#endif // NOZZLE_CLEAN_FEATURE || NOZZLE_PARK_FEATURE diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h deleted file mode 100644 index e564081e52..0000000000 --- a/Marlin/nozzle.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __NOZZLE_H__ -#define __NOZZLE_H__ - -#include "Marlin.h" -#include "point_t.h" - -/** - * @brief Nozzle class - * - * @todo: Do not ignore the end.z value and allow XYZ movements - */ -class Nozzle { - private: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - */ - static void stroke(const point_t &start, const point_t &end, const uint8_t &strokes) _Os; - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of objects to create - */ - static void zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start point_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - static void circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - public: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects=0) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - #if ENABLED(NOZZLE_PARK_FEATURE) - - static void park(const uint8_t &z_action, const point_t &park=NOZZLE_PARK_POINT) _Os; - - #endif -}; - -#endif // __NOZZLE_H__ diff --git a/Marlin/parser.cpp b/Marlin/parser.cpp deleted file mode 100644 index 178583cad0..0000000000 --- a/Marlin/parser.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * parser.cpp - Parser for a GCode line, providing a parameter interface. - */ - -#include "parser.h" - -#include "Marlin.h" -#include "language.h" - -// Must be declared for allocation and to satisfy the linker -// Zero values need no initialization. - -bool GCodeParser::volumetric_enabled; - -#if ENABLED(INCH_MODE_SUPPORT) - float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor; -#endif - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - TempUnit GCodeParser::input_temp_units; -#endif - -char *GCodeParser::command_ptr, - *GCodeParser::string_arg, - *GCodeParser::value_ptr; -char GCodeParser::command_letter; -int GCodeParser::codenum; -#if USE_GCODE_SUBCODES - uint8_t GCodeParser::subcode; -#endif - -#if ENABLED(FASTER_GCODE_PARSER) - // Optimized Parameters - uint32_t GCodeParser::codebits; // found bits - uint8_t GCodeParser::param[26]; // parameter offsets from command_ptr -#else - char *GCodeParser::command_args; // start of parameters -#endif - -// Create a global instance of the GCode parser singleton -GCodeParser parser; - -/** - * Clear all code-seen (and value pointers) - * - * Since each param is set/cleared on seen codes, - * this may be optimized by commenting out ZERO(param) - */ -void GCodeParser::reset() { - string_arg = NULL; // No whole line argument - command_letter = '?'; // No command letter - codenum = 0; // No command code - #if USE_GCODE_SUBCODES - subcode = 0; // No command sub-code - #endif - #if ENABLED(FASTER_GCODE_PARSER) - codebits = 0; // No codes yet - //ZERO(param); // No parameters (should be safe to comment out this line) - #endif -} - -// Populate all fields by parsing a single line of GCode -// 58 bytes of SRAM are used to speed up seen/value -void GCodeParser::parse(char *p) { - - reset(); // No codes to report - - // Skip spaces - while (*p == ' ') ++p; - - // Skip N[-0-9] if included in the command line - if (*p == 'N' && NUMERIC_SIGNED(p[1])) { - #if ENABLED(FASTER_GCODE_PARSER) - //set('N', p + 1); // (optional) Set the 'N' parameter value - #endif - p += 2; // skip N[-0-9] - while (NUMERIC(*p)) ++p; // skip [0-9]* - while (*p == ' ') ++p; // skip [ ]* - } - - // *p now points to the current command, which should be G, M, or T - command_ptr = p; - - // Get the command letter, which must be G, M, or T - const char letter = *p++; - - // Nullify asterisk and trailing whitespace - char *starpos = strchr(p, '*'); - if (starpos) { - --starpos; // * - while (*starpos == ' ') --starpos; // spaces... - starpos[1] = '\0'; - } - - // Bail if the letter is not G, M, or T - switch (letter) { case 'G': case 'M': case 'T': break; default: return; } - - // Skip spaces to get the numeric part - while (*p == ' ') p++; - - // Bail if there's no command code number - if (!NUMERIC(*p)) return; - - // Save the command letter at this point - // A '?' signifies an unknown command - command_letter = letter; - - // Get the code number - integer digits only - codenum = 0; - do { - codenum *= 10, codenum += *p++ - '0'; - } while (NUMERIC(*p)); - - // Allow for decimal point in command - #if USE_GCODE_SUBCODES - if (*p == '.') { - p++; - while (NUMERIC(*p)) - subcode *= 10, subcode += *p++ - '0'; - } - #endif - - // Skip all spaces to get to the first argument, or nul - while (*p == ' ') p++; - - // The command parameters (if any) start here, for sure! - - #if DISABLED(FASTER_GCODE_PARSER) - command_args = p; // Scan for parameters in seen() - #endif - - // Only use string_arg for these M codes - if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; } - - #if ENABLED(DEBUG_GCODE_PARSER) - const bool debug = codenum == 800; - #endif - - /** - * Find all parameters, set flags and pointers for fast parsing - * - * Most codes ignore 'string_arg', but those that want a string will get the right pointer. - * The following loop assigns the first "parameter" having no numeric value to 'string_arg'. - * This allows M0/M1 with expire time to work: "M0 S5 You Win!" - * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' - */ - string_arg = NULL; - while (const char code = *p++) { // Get the next parameter. A NUL ends the loop - - // Special handling for M32 [P] !/path/to/file.g# - // The path must be the last parameter - if (code == '!' && letter == 'M' && codenum == 32) { - string_arg = p; // Name starts after '!' - char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering) - if (lb) *lb = '\0'; // Safe to mark the end of the filename - return; - } - - // Arguments MUST be uppercase for fast GCode parsing - #if ENABLED(FASTER_GCODE_PARSER) - #define PARAM_TEST WITHIN(code, 'A', 'Z') - #else - #define PARAM_TEST true - #endif - - if (PARAM_TEST) { - - while (*p == ' ') p++; // Skip spaces between parameters & values - - const bool has_num = valid_float(p); - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) { - SERIAL_ECHOPAIR("Got letter ", code); - SERIAL_ECHOPAIR(" at index ", (int)(p - command_ptr - 1)); - if (has_num) SERIAL_ECHOPGM(" (has_num)"); - } - #endif - - if (!has_num && !string_arg) { // No value? First time, keep as string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_EOL(); - #endif - - #if ENABLED(FASTER_GCODE_PARSER) - set(code, has_num ? p : NULL); // Set parameter exists and pointer (NULL for no number) - #endif - } - else if (!string_arg) { // Not A-Z? First time, keep as the string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - if (!WITHIN(*p, 'A', 'Z')) { // Another parameter right away? - while (*p && DECIMAL_SIGNED(*p)) p++; // Skip over the value section of a parameter - while (*p == ' ') p++; // Skip over all spaces - } - } -} - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - - // Parse the next parameter as a new command - bool GCodeParser::chain() { - #if ENABLED(FASTER_GCODE_PARSER) - char *next_command = command_ptr; - if (next_command) { - while (*next_command && *next_command != ' ') ++next_command; - while (*next_command == ' ') ++next_command; - if (!*next_command) next_command = NULL; - } - #else - const char *next_command = command_args; - #endif - if (next_command) parse(next_command); - return !!next_command; - } - -#endif // CNC_COORDINATE_SYSTEMS - -void GCodeParser::unknown_command_error() { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_UNKNOWN_COMMAND, command_ptr); - SERIAL_CHAR('"'); - SERIAL_EOL(); -} - -#if ENABLED(DEBUG_GCODE_PARSER) - - void GCodeParser::debug() { - SERIAL_ECHOPAIR("Command: ", command_ptr); - SERIAL_ECHOPAIR(" (", command_letter); - SERIAL_ECHO(codenum); - SERIAL_ECHOLNPGM(")"); - #if ENABLED(FASTER_GCODE_PARSER) - SERIAL_ECHOPGM(" args: \""); - for (char c = 'A'; c <= 'Z'; ++c) - if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); } - #else - SERIAL_ECHOPAIR(" args: \"", command_args); - #endif - SERIAL_CHAR('"'); - if (string_arg) { - SERIAL_ECHOPGM(" string: \""); - SERIAL_ECHO(string_arg); - SERIAL_CHAR('"'); - } - SERIAL_ECHOPGM("\n\n"); - for (char c = 'A'; c <= 'Z'; ++c) { - if (seen(c)) { - SERIAL_ECHOPAIR("Code '", c); SERIAL_ECHOPGM("':"); - if (has_value()) { - SERIAL_ECHOPAIR("\n float: ", value_float()); - SERIAL_ECHOPAIR("\n long: ", value_long()); - SERIAL_ECHOPAIR("\n ulong: ", value_ulong()); - SERIAL_ECHOPAIR("\n millis: ", value_millis()); - SERIAL_ECHOPAIR("\n sec-ms: ", value_millis_from_seconds()); - SERIAL_ECHOPAIR("\n int: ", value_int()); - SERIAL_ECHOPAIR("\n ushort: ", value_ushort()); - SERIAL_ECHOPAIR("\n byte: ", (int)value_byte()); - SERIAL_ECHOPAIR("\n bool: ", (int)value_bool()); - SERIAL_ECHOPAIR("\n linear: ", value_linear_units()); - SERIAL_ECHOPAIR("\n celsius: ", value_celsius()); - } - else - SERIAL_ECHOPGM(" (no value)"); - SERIAL_ECHOPGM("\n\n"); - } - } - } - -#endif // DEBUG_GCODE_PARSER diff --git a/Marlin/parser.h b/Marlin/parser.h deleted file mode 100644 index 6a86ad373e..0000000000 --- a/Marlin/parser.h +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * parser.h - Parser for a GCode line, providing a parameter interface. - * Codes like M149 control the way the GCode parser behaves, - * so settings for these codes are located in this class. - */ - -#ifndef _PARSER_H_ -#define _PARSER_H_ - -#include "enum.h" -#include "types.h" -#include "MarlinConfig.h" - -//#define DEBUG_GCODE_PARSER -#if ENABLED(DEBUG_GCODE_PARSER) - #include "hex_print_routines.h" - #include "serial.h" -#endif - -#define strtof strtod - -/** - * GCode parser - * - * - Parse a single gcode line for its letter, code, subcode, and parameters - * - FASTER_GCODE_PARSER: - * - Flags existing params (1 bit each) - * - Stores value offsets (1 byte each) - * - Provide accessors for parameters: - * - Parameter exists - * - Parameter has value - * - Parameter value in different units and types - */ -class GCodeParser { - -private: - static char *value_ptr; // Set by seen, used to fetch the value - - #if ENABLED(FASTER_GCODE_PARSER) - static uint32_t codebits; // Parameters pre-scanned - static uint8_t param[26]; // For A-Z, offsets into command args - #else - static char *command_args; // Args start here, for slow scan - #endif - -public: - - // Global states for GCode-level units features - - static bool volumetric_enabled; - - #if ENABLED(INCH_MODE_SUPPORT) - static float linear_unit_factor, volumetric_unit_factor; - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static TempUnit input_temp_units; - #endif - - // Command line state - static char *command_ptr, // The command, so it can be echoed - *string_arg; // string of command line - - static char command_letter; // G, M, or T - static int codenum; // 123 - #if USE_GCODE_SUBCODES - static uint8_t subcode; // .1 - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - static void debug(); - #endif - - GCodeParser() { - #if ENABLED(INCH_MODE_SUPPORT) - set_input_linear_units(LINEARUNIT_MM); - #endif - } - - // Reset is done before parsing - static void reset(); - - #define LETTER_BIT(N) ((N) - 'A') - - FORCE_INLINE static bool valid_signless(const char * const p) { - return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9] - } - - FORCE_INLINE static bool valid_float(const char * const p) { - return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9] - } - - #if ENABLED(FASTER_GCODE_PARSER) - - FORCE_INLINE static bool valid_int(const char * const p) { - return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9] - } - - // Set the flag and pointer for a parameter - static void set(const char c, char * const ptr) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return; // Only A-Z - SBI32(codebits, ind); // parameter exists - param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0 - #if ENABLED(DEBUG_GCODE_PARSER) - if (codenum == 800) { - SERIAL_ECHOPAIR("Set bit ", (int)ind); - SERIAL_ECHOPAIR(" of codebits (", hex_address((void*)(codebits >> 16))); - print_hex_word((uint16_t)(codebits & 0xFFFF)); - SERIAL_ECHOLNPAIR(") | param = ", (int)param[ind]); - } - #endif - } - - // Code seen bit was set. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static bool seen(const char c) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return false; // Only A-Z - const bool b = TEST32(codebits, ind); - if (b) { - #if ENABLED(DEBUG_GCODE_PARSER) - if (codenum == 800) { - SERIAL_CHAR('\''); SERIAL_CHAR(c); SERIAL_ECHOLNPGM("' is seen"); - } - #endif - char * const ptr = command_ptr + param[ind]; - value_ptr = param[ind] && valid_float(ptr) ? ptr : (char*)NULL; - } - return b; - } - - static bool seen_any() { return !!codebits; } - - #define SEEN_TEST(L) TEST32(codebits, LETTER_BIT(L)) - - #else // !FASTER_GCODE_PARSER - - // Code is found in the string. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static bool seen(const char c) { - char *p = strchr(command_args, c); - const bool b = !!p; - if (b) value_ptr = valid_float(&p[1]) ? &p[1] : (char*)NULL; - return b; - } - - static bool seen_any() { return *command_args == '\0'; } - - #define SEEN_TEST(L) !!strchr(command_args, L) - - #endif // !FASTER_GCODE_PARSER - - // Seen any axis parameter - static bool seen_axis() { - return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E'); - } - - // Populate all fields by parsing a single line of GCode - // This uses 54 bytes of SRAM to speed up seen/value - static void parse(char * p); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Parse the next parameter as a new command - static bool chain(); - #endif - - // The code value pointer was set - FORCE_INLINE static bool has_value() { return value_ptr != NULL; } - - // Seen a parameter with a value - inline static bool seenval(const char c) { return seen(c) && has_value(); } - - // Float removes 'E' to prevent scientific notation interpretation - inline static float value_float() { - if (value_ptr) { - char *e = value_ptr; - for (;;) { - const char c = *e; - if (c == '\0' || c == ' ') break; - if (c == 'E' || c == 'e') { - *e = '\0'; - const float ret = strtof(value_ptr, NULL); - *e = c; - return ret; - } - ++e; - } - return strtof(value_ptr, NULL); - } - return 0; - } - - // Code value as a long or ulong - inline static int32_t value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; } - inline static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; } - - // Code value for use as time - FORCE_INLINE static millis_t value_millis() { return value_ulong(); } - FORCE_INLINE static millis_t value_millis_from_seconds() { return value_float() * 1000UL; } - - // Reduce to fewer bits - FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); } - FORCE_INLINE static uint16_t value_ushort() { return (uint16_t)value_long(); } - inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } - - // Bool is true with no value or non-zero - inline static bool value_bool() { return !has_value() || !!value_byte(); } - - // Units modes: Inches, Fahrenheit, Kelvin - - #if ENABLED(INCH_MODE_SUPPORT) - - inline static void set_input_linear_units(const LinearUnit units) { - switch (units) { - case LINEARUNIT_INCH: - linear_unit_factor = 25.4; - break; - case LINEARUNIT_MM: - default: - linear_unit_factor = 1.0; - break; - } - volumetric_unit_factor = POW(linear_unit_factor, 3.0); - } - - inline static float axis_unit_factor(const AxisEnum axis) { - return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); - } - - inline static float value_linear_units() { return value_float() * linear_unit_factor; } - inline static float value_axis_units(const AxisEnum axis) { return value_float() * axis_unit_factor(axis); } - inline static float value_per_axis_unit(const AxisEnum axis) { return value_float() / axis_unit_factor(axis); } - - #else - - FORCE_INLINE static float value_linear_units() { return value_float(); } - FORCE_INLINE static float value_axis_units(const AxisEnum a) { UNUSED(a); return value_float(); } - FORCE_INLINE static float value_per_axis_unit(const AxisEnum a) { UNUSED(a); return value_float(); } - - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - - inline static void set_input_temp_units(TempUnit units) { input_temp_units = units; } - - #if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503) - - FORCE_INLINE static char temp_units_code() { - return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; - } - FORCE_INLINE static const char* temp_units_name() { - return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius"); - } - inline static float to_temp_units(const float &f) { - switch (input_temp_units) { - case TEMPUNIT_F: - return f * 0.5555555556 + 32.0; - case TEMPUNIT_K: - return f + 273.15; - case TEMPUNIT_C: - default: - return f; - } - } - - #endif // ULTIPANEL && !DISABLE_M503 - - inline static float value_celsius() { - const float f = value_float(); - switch (input_temp_units) { - case TEMPUNIT_F: - return (f - 32.0) * 0.5555555556; - case TEMPUNIT_K: - return f - 273.15; - case TEMPUNIT_C: - default: - return f; - } - } - - inline static float value_celsius_diff() { - switch (input_temp_units) { - case TEMPUNIT_F: - return value_float() * 0.5555555556; - case TEMPUNIT_C: - case TEMPUNIT_K: - default: - return value_float(); - } - } - - #else // !TEMPERATURE_UNITS_SUPPORT - - FORCE_INLINE static float value_celsius() { return value_float(); } - FORCE_INLINE static float value_celsius_diff() { return value_float(); } - - #endif // !TEMPERATURE_UNITS_SUPPORT - - FORCE_INLINE static float value_feedrate() { return value_linear_units(); } - - void unknown_command_error(); - - // Provide simple value accessors with default option - FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - FORCE_INLINE static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - FORCE_INLINE static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - FORCE_INLINE static float linearval(const char c, const float dval=0.0) { return seenval(c) ? value_linear_units() : dval; } - FORCE_INLINE static float celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius() : dval; } - -}; - -extern GCodeParser parser; - -#endif // _PARSER_H_ diff --git a/Marlin/pca9632.cpp b/Marlin/pca9632.cpp deleted file mode 100644 index 4c339f4604..0000000000 --- a/Marlin/pca9632.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -#include "MarlinConfig.h" - -#if ENABLED(PCA9632) - -#include "pca9632.h" -#include "leds.h" -#include - -#define PCA9632_MODE1_VALUE 0b00000001 //(ALLCALL) -#define PCA9632_MODE2_VALUE 0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM) -#define PCA9632_LEDOUT_VALUE 0b00101010 - -/* Register addresses */ -#define PCA9632_MODE1 0x00 -#define PCA9632_MODE2 0x01 -#define PCA9632_PWM0 0x02 -#define PCA9632_PWM1 0x03 -#define PCA9632_PWM2 0x04 -#define PCA9632_PWM3 0x05 -#define PCA9632_GRPPWM 0x06 -#define PCA9632_GRPFREQ 0x07 -#define PCA9632_LEDOUT 0x08 -#define PCA9632_SUBADR1 0x09 -#define PCA9632_SUBADR2 0x0A -#define PCA9632_SUBADR3 0x0B -#define PCA9632_ALLCALLADDR 0x0C - -#define PCA9632_NO_AUTOINC 0x00 -#define PCA9632_AUTO_ALL 0x80 -#define PCA9632_AUTO_IND 0xA0 -#define PCA9632_AUTOGLO 0xC0 -#define PCA9632_AUTOGI 0xE0 - -// Red LED0 -// Green LED1 -// Blue LED2 -#define PCA9632_RED 0x00 -#define PCA9632_GRN 0x02 -#define PCA9632_BLU 0x04 - -#define LED_OFF 0x00 -#define LED_ON 0x01 -#define LED_PWM 0x02 - -#define PCA9632_ADDRESS 0b01100000 - -byte PCA_init = 0; - -static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte value) { - Wire.beginTransmission(addr); - Wire.write(regadd); - Wire.write(value); - Wire.endTransmission(); -} - -static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte value1, const byte value2, const byte value3) { - Wire.beginTransmission(addr); - Wire.write(PCA9632_AUTO_IND | regadd); - Wire.write(value1); - Wire.write(value2); - Wire.write(value3); - Wire.endTransmission(); -} - -#if 0 - static byte PCA9632_ReadRegister(const byte addr, const byte regadd) { - Wire.beginTransmission(addr); - Wire.write(regadd); - const byte value = Wire.read(); - Wire.endTransmission(); - return value; - } -#endif - -void pca9632_set_led_color(const LEDColor &color) { - Wire.begin(); - if (!PCA_init) { - PCA_init = 1; - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); - } - - const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0) - | (color.g ? LED_PWM << PCA9632_GRN : 0) - | (color.b ? LED_PWM << PCA9632_BLU : 0); - - PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); -} - -#endif // PCA9632 diff --git a/Marlin/pca9632.h b/Marlin/pca9632.h deleted file mode 100644 index 4d98267beb..0000000000 --- a/Marlin/pca9632.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -#ifndef __PCA9632_H__ -#define __PCA9632_H__ - -struct LEDColor; -typedef LEDColor LEDColor; - -void pca9632_set_led_color(const LEDColor &color); - -#endif // __PCA9632_H__ diff --git a/Marlin/pins.h b/Marlin/pins.h deleted file mode 100644 index 355fa7319f..0000000000 --- a/Marlin/pins.h +++ /dev/null @@ -1,833 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Include pins definitions - * - * Pins numbering schemes: - * - * - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR) - * The FastIO headers map digital pins to their ports and functions. - * - * - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN) - * These numbers are the same in any pin mapping. - */ - -#ifndef __PINS_H__ -#define __PINS_H__ - -#if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) - #define IS_RAMPS_EFB -#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_PLUS_EEB) - #define IS_RAMPS_EEB -#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_PLUS_EFF) - #define IS_RAMPS_EFF -#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_PLUS_EEF) - #define IS_RAMPS_EEF -#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) || MB(RAMPS_PLUS_SF) - #define IS_RAMPS_SF -#endif - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#if MB(RAMPS_OLD) - #include "pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_SF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_SF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_SF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#elif MB(3DRAG) - #include "pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(K8200) - #include "pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(K8400) - #include "pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(BAM_DICE) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(BAM_DICE_DUE) - #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE) - #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_15) - #include "pins_MKS_BASE_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_HEROIC) - #include "pins_MKS_BASE_HEROIC.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_13) - #include "pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_L) - #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ZRIB_V20) - #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) -#elif MB(FELIX2) - #include "pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD) - #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD_V2) - #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(SAINSMART_2IN1) - #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER) - #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER_OLD) - #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(AZTEEG_X3) - #include "pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 -#elif MB(AZTEEG_X3_PRO) - #include "pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 -#elif MB(ULTIMAIN_2) - #include "pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(RUMBA) - #include "pins_RUMBA.h" // ATmega2560 env:megaatmega2560 -#elif MB(BQ_ZUM_MEGA_3D) - #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 -#elif MB(MAKEBOARD_MINI) - #include "pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_13) - #include "pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_14) - #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_ENDER_4) - #include "pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 - -// -// Other ATmega1280, ATmega2560 -// - -#elif MB(CNCONTROLS_11) - #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CNCONTROLS_12) - #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MIGHTYBOARD_REVE) - #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CHEAPTRONIC) - #include "pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 -#elif MB(CHEAPTRONIC_V2) - #include "pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS) - #include "pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_2) - #include "pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31) - #include "pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMBO) - #include "pins_RAMBO.h" // ATmega2560 env:rambo -#elif MB(MINIRAMBO) || MB(MINIRAMBO_10A) - #include "pins_MINIRAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RAMBO) - #include "pins_EINSY_RAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RETRO) - #include "pins_EINSY_RETRO.h" // ATmega2560 env:rambo -#elif MB(ELEFU_3) - #include "pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(LEAPFROG) - #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MEGACONTROLLER) - #include "pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 -#elif MB(SCOOVO_X9H) - #include "pins_SCOOVO_X9H.h" // ATmega2560 env:rambo -#elif MB(GT2560_REV_A) - #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(GT2560_REV_A_PLUS) - #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 - -// -// ATmega1281, ATmega2561 -// - -#elif MB(MINITRONICS) - #include "pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 -#elif MB(SILVER_GATE) - #include "pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#elif MB(SANGUINOLOLU_11) - #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(SANGUINOLOLU_12) - #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI) - #include "pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MAKR3D) - #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_CREALITY) - #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MALYAN) - #include "pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_TRONXY) - #include "pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(STB_11) - #include "pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(AZTEEG_X1) - #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#elif MB(GEN3_MONOLITHIC) - #include "pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p -#elif MB(GEN3_PLUS) - #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6) - #include "pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6_DELUXE) - #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_CUSTOM) - #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_12) - #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_13) - #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_14) - #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(OMCA_A) - #include "pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p -#elif MB(OMCA) - #include "pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p -#elif MB(ANET_10) - #include "pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p -#elif MB(SETHI) - #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#elif MB(TEENSYLU) - #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90USB1286_CDC -#elif MB(PRINTRBOARD) - #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90USB1286_DFU -#elif MB(PRINTRBOARD_REVF) - #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90USB1286_DFU -#elif MB(BRAINWAVE) - #include "pins_BRAINWAVE.h" // AT90USB646 env:at90USB1286_CDC -#elif MB(BRAINWAVE_PRO) - #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90USB1286_CDC -#elif MB(SAV_MKI) - #include "pins_SAV_MKI.h" // AT90USB1286 env:at90USB1286_CDC -#elif MB(TEENSY2) - #include "pins_TEENSY2.h" // AT90USB1286 env:teensy20 -#elif MB(5DPRINT) - #include "pins_5DPRINT.h" // AT90USB1286 ?env:at90USB1286_DFU - -#else - #error "Unknown MOTHERBOARD value set in Configuration.h" -#endif - -// Define certain undefined pins -#ifndef X_MS1_PIN - #define X_MS1_PIN -1 -#endif -#ifndef X_MS2_PIN - #define X_MS2_PIN -1 -#endif -#ifndef Y_MS1_PIN - #define Y_MS1_PIN -1 -#endif -#ifndef Y_MS2_PIN - #define Y_MS2_PIN -1 -#endif -#ifndef Z_MS1_PIN - #define Z_MS1_PIN -1 -#endif -#ifndef Z_MS2_PIN - #define Z_MS2_PIN -1 -#endif -#ifndef Z_MS3_PIN - #define Z_MS3_PIN -1 -#endif -#ifndef E0_MS1_PIN - #define E0_MS1_PIN -1 -#endif -#ifndef E0_MS2_PIN - #define E0_MS2_PIN -1 -#endif -#ifndef E1_MS1_PIN - #define E1_MS1_PIN -1 -#endif -#ifndef E1_MS2_PIN - #define E1_MS2_PIN -1 -#endif -#ifndef E2_MS1_PIN - #define E2_MS1_PIN -1 -#endif -#ifndef E2_MS2_PIN - #define E2_MS2_PIN -1 -#endif -#ifndef E3_MS1_PIN - #define E3_MS1_PIN -1 -#endif -#ifndef E3_MS2_PIN - #define E3_MS2_PIN -1 -#endif -#ifndef E3_MS3_PIN - #define E3_MS3_PIN -1 -#endif -#ifndef E4_MS1_PIN - #define E4_MS1_PIN -1 -#endif -#ifndef E4_MS2_PIN - #define E4_MS2_PIN -1 -#endif -#ifndef E4_MS3_PIN - #define E4_MS3_PIN -1 -#endif - -#ifndef E0_STEP_PIN - #define E0_STEP_PIN -1 -#endif -#ifndef E0_DIR_PIN - #define E0_DIR_PIN -1 -#endif -#ifndef E0_ENABLE_PIN - #define E0_ENABLE_PIN -1 -#endif -#ifndef E1_STEP_PIN - #define E1_STEP_PIN -1 -#endif -#ifndef E1_DIR_PIN - #define E1_DIR_PIN -1 -#endif -#ifndef E1_ENABLE_PIN - #define E1_ENABLE_PIN -1 -#endif -#ifndef E2_STEP_PIN - #define E2_STEP_PIN -1 -#endif -#ifndef E2_DIR_PIN - #define E2_DIR_PIN -1 -#endif -#ifndef E2_ENABLE_PIN - #define E2_ENABLE_PIN -1 -#endif -#ifndef E3_STEP_PIN - #define E3_STEP_PIN -1 -#endif -#ifndef E3_DIR_PIN - #define E3_DIR_PIN -1 -#endif -#ifndef E3_ENABLE_PIN - #define E3_ENABLE_PIN -1 -#endif -#ifndef E4_STEP_PIN - #define E4_STEP_PIN -1 -#endif -#ifndef E4_DIR_PIN - #define E4_DIR_PIN -1 -#endif -#ifndef E4_ENABLE_PIN - #define E4_ENABLE_PIN -1 -#endif - -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif -#ifndef E4_CS_PIN - #define E4_CS_PIN -1 -#endif - -#ifndef FAN_PIN - #define FAN_PIN -1 -#endif -#ifndef FAN1_PIN - #define FAN1_PIN -1 -#endif -#ifndef FAN2_PIN - #define FAN2_PIN -1 -#endif -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN -1 -#endif - -#ifndef FANMUX0_PIN - #define FANMUX0_PIN -1 -#endif -#ifndef FANMUX1_PIN - #define FANMUX1_PIN -1 -#endif -#ifndef FANMUX2_PIN - #define FANMUX2_PIN -1 -#endif - -#ifndef HEATER_0_PIN - #define HEATER_0_PIN -1 -#endif -#ifndef HEATER_1_PIN - #define HEATER_1_PIN -1 -#endif -#ifndef HEATER_2_PIN - #define HEATER_2_PIN -1 -#endif -#ifndef HEATER_3_PIN - #define HEATER_3_PIN -1 -#endif -#ifndef HEATER_4_PIN - #define HEATER_4_PIN -1 -#endif -#ifndef HEATER_BED_PIN - #define HEATER_BED_PIN -1 -#endif - -#ifndef TEMP_0_PIN - #define TEMP_0_PIN -1 -#endif -#ifndef TEMP_1_PIN - #define TEMP_1_PIN -1 -#endif -#ifndef TEMP_2_PIN - #define TEMP_2_PIN -1 -#endif -#ifndef TEMP_3_PIN - #define TEMP_3_PIN -1 -#endif -#ifndef TEMP_4_PIN - #define TEMP_4_PIN -1 -#endif -#ifndef TEMP_BED_PIN - #define TEMP_BED_PIN -1 -#endif - -#ifndef SD_DETECT_PIN - #define SD_DETECT_PIN -1 -#endif -#ifndef SDPOWER - #define SDPOWER -1 -#endif -#ifndef SDSS - #define SDSS -1 -#endif -#ifndef LED_PIN - #define LED_PIN -1 -#endif -#ifndef PS_ON_PIN - #define PS_ON_PIN -1 -#endif -#ifndef KILL_PIN - #define KILL_PIN -1 -#endif -#ifndef SUICIDE_PIN - #define SUICIDE_PIN -1 -#endif - -#ifndef MAX_EXTRUDERS - #define MAX_EXTRUDERS 5 -#endif - -// -// Assign auto fan pins if needed -// -#ifndef E0_AUTO_FAN_PIN - #ifdef ORIG_E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN - #else - #define E0_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E1_AUTO_FAN_PIN - #ifdef ORIG_E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN - #else - #define E1_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E2_AUTO_FAN_PIN - #ifdef ORIG_E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN - #else - #define E2_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E3_AUTO_FAN_PIN - #ifdef ORIG_E3_AUTO_FAN_PIN - #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN - #else - #define E3_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E4_AUTO_FAN_PIN - #ifdef ORIG_E4_AUTO_FAN_PIN - #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN - #else - #define E4_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef CHAMBER_AUTO_FAN_PIN - #ifdef ORIG_CHAMBER_AUTO_FAN_PIN - #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN - #else - #define CHAMBER_AUTO_FAN_PIN -1 - #endif -#endif - -// List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those! -#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN, -#define _E1_PINS -#define _E2_PINS -#define _E3_PINS -#define _E4_PINS - -#if ENABLED(SWITCHING_EXTRUDER) - // Tools 0 and 1 use E0 - #if EXTRUDERS > 2 // Tools 2 and 3 use E1 - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if EXTRUDERS > 4 // Tools 4 and 5 use E2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #endif - #endif -#elif EXTRUDERS > 1 - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if EXTRUDERS > 2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #if EXTRUDERS > 3 - #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN, - #if EXTRUDERS > 4 - #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN, - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 -#endif // EXTRUDERS > 1 - -// Marlin needs to account for pins that equal -1 -#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p)) - -#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), -#define _H1_PINS -#define _H2_PINS -#define _H3_PINS -#define _H4_PINS - -#if HOTENDS > 1 - #undef _H1_PINS - #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN), - #if HOTENDS > 2 - #undef _H2_PINS - #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN), - #if HOTENDS > 3 - #undef _H3_PINS - #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN), - #if HOTENDS > 4 - #undef _H4_PINS - #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN), - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#elif ENABLED(MIXING_EXTRUDER) - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if MIXING_STEPPERS > 2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #if MIXING_STEPPERS > 3 - #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN, - #if MIXING_STEPPERS > 4 - #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN, - #endif // MIXING_STEPPERS > 4 - #endif // MIXING_STEPPERS > 3 - #endif // MIXING_STEPPERS > 2 -#endif // MIXING_STEPPERS > 1 - -#define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN), - -// -// Assign endstop pins for boards with only 3 connectors -// -#ifdef X_STOP_PIN - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_STOP_PIN - #define X_MAX_PIN -1 - #else - #define X_MIN_PIN -1 - #define X_MAX_PIN X_STOP_PIN - #endif -#endif - -#ifdef Y_STOP_PIN - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_STOP_PIN - #define Y_MAX_PIN -1 - #else - #define Y_MIN_PIN -1 - #define Y_MAX_PIN Y_STOP_PIN - #endif -#endif - -#ifdef Z_STOP_PIN - #if Z_HOME_DIR < 0 - #define Z_MIN_PIN Z_STOP_PIN - #define Z_MAX_PIN -1 - #else - #define Z_MIN_PIN -1 - #define Z_MAX_PIN Z_STOP_PIN - #endif -#endif - -// -// Disable unused endstop / probe pins -// -#if DISABLED(Z_MIN_PROBE_ENDSTOP) - #undef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN -1 -#endif - -#if DISABLED(USE_XMAX_PLUG) - #undef X_MAX_PIN - #define X_MAX_PIN -1 -#endif - -#if DISABLED(USE_YMAX_PLUG) - #undef Y_MAX_PIN - #define Y_MAX_PIN -1 -#endif - -#if DISABLED(USE_ZMAX_PLUG) - #undef Z_MAX_PIN - #define Z_MAX_PIN -1 -#endif - -#if DISABLED(USE_XMIN_PLUG) - #undef X_MIN_PIN - #define X_MIN_PIN -1 -#endif - -#if DISABLED(USE_YMIN_PLUG) - #undef Y_MIN_PIN - #define Y_MIN_PIN -1 -#endif - -#if DISABLED(USE_ZMIN_PLUG) - #undef Z_MIN_PIN - #define Z_MIN_PIN -1 -#endif - -#ifndef LCD_PINS_D4 - #define LCD_PINS_D4 -1 -#endif -#ifndef LCD_PINS_D5 - #define LCD_PINS_D5 -1 -#endif -#ifndef LCD_PINS_D6 - #define LCD_PINS_D6 -1 -#endif -#ifndef LCD_PINS_D7 - #define LCD_PINS_D7 -1 -#endif - -// -// Dual X-carriage, Dual Y, Dual Z support -// - -#define _X2_PINS -#define _Y2_PINS -#define _Z2_PINS - -#define __EPIN(p,q) E##p##_##q##_PIN -#define _EPIN(p,q) __EPIN(p,q) - -// The X2 axis, if any, should be the next open extruder port -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS) - #ifndef X2_STEP_PIN - #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) - #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) - #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) - #ifndef X2_CS_PIN - #define X2_CS_PIN _EPIN(E_STEPPERS, CS) - #endif - #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE) - #error "No E stepper plug left for X2!" - #endif - #endif - #undef _X2_PINS - #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, - #ifdef X2_CS_PIN - #define _X2_PINS __X2_PINS X2_CS_PIN, - #else - #define _X2_PINS __X2_PINS - #endif - #define Y2_E_INDEX INCREMENT(E_STEPPERS) -#else - #define Y2_E_INDEX E_STEPPERS -#endif - -// The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #ifndef Y2_STEP_PIN - #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) - #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) - #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) - #ifndef Y2_CS_PIN - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif - #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE) - #error "No E stepper plug left for Y2!" - #endif - #endif - #undef _Y2_PINS - #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, - #ifdef Y2_CS_PIN - #define _Y2_PINS __Y2_PINS Y2_CS_PIN, - #else - #define _Y2_PINS __Y2_PINS - #endif - #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) -#else - #define Z2_E_INDEX Y2_E_INDEX -#endif - -// The Z2 axis, if any, should be the next open extruder port -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #ifndef Z2_STEP_PIN - #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) - #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) - #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) - #ifndef Z2_CS_PIN - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif - #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE) - #error "No E stepper plug left for Z2!" - #endif - #endif - #undef _Z2_PINS - #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, - #ifdef Z2_CS_PIN - #define _Z2_PINS __Z2_PINS Z2_CS_PIN, - #else - #define _Z2_PINS __Z2_PINS - #endif -#endif - -#define SENSITIVE_PINS { 0, 1, \ - X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \ - Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \ - Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MS1_PIN, Z_MS2_PIN, Z_MS3_PIN, Z_CS_PIN, Z_MIN_PROBE_PIN, \ - PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \ - _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \ - _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \ - _X2_PINS _Y2_PINS _Z2_PINS \ - } - -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) - #define AVR_SCK_PIN 13 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 10 -#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) - #define AVR_SCK_PIN 7 - #define AVR_MISO_PIN 6 - #define AVR_MOSI_PIN 5 - #define AVR_SS_PIN 4 -#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - #define AVR_SCK_PIN 52 - #define AVR_MISO_PIN 50 - #define AVR_MOSI_PIN 51 - #define AVR_SS_PIN 53 -#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) - #define AVR_SCK_PIN 21 - #define AVR_MISO_PIN 23 - #define AVR_MOSI_PIN 22 - #define AVR_SS_PIN 20 -#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - #define AVR_SCK_PIN 10 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 16 -#endif - -#ifndef SCK_PIN - #define SCK_PIN AVR_SCK_PIN -#endif -#ifndef MISO_PIN - #define MISO_PIN AVR_MISO_PIN -#endif -#ifndef MOSI_PIN - #define MOSI_PIN AVR_MOSI_PIN -#endif -#ifndef SS_PIN - #define SS_PIN AVR_SS_PIN -#endif - -#endif // __PINS_H__ diff --git a/Marlin/pinsDebug.h b/Marlin/pinsDebug.h deleted file mode 100644 index 24d058b4f2..0000000000 --- a/Marlin/pinsDebug.h +++ /dev/null @@ -1,586 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -bool endstop_monitor_flag = false; - -#define NAME_FORMAT "%-35s" // one place to specify the format of all the sources of names - // "-" left justify, "28" minimum width of name, pad with blanks - -#if AVR_ATmega1284_FAMILY - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0)) -#else - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) -#endif - -/** - * This routine minimizes RAM usage by creating a FLASH resident array to - * store the pin names, pin numbers and analog/digital flag. - * - * Creating the array in FLASH is a two pass process. The first pass puts the - * name strings into FLASH. The second pass actually creates the array. - * - * Both passes use the same pin list. The list contains two macro names. The - * actual macro definitions are changed depending on which pass is being done. - * - */ - -// first pass - put the name strings into FLASH - -#define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const char ENTRY_NAME[] PROGMEM = { PIN_NAME }; -#define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) - -#include "pinsDebug_list.h" -#line 51 - -// manually add pins that have names that are macros which don't play well with these macros -#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY) - static const char RXD_NAME[] PROGMEM = { "RXD" }; - static const char TXD_NAME[] PROGMEM = { "TXD" }; -#endif - -///////////////////////////////////////////////////////////////////////////// - -// second pass - create the array - -#undef _ADD_PIN_2 -#undef _ADD_PIN -#undef REPORT_NAME_DIGITAL -#undef REPORT_NAME_ANALOG - -#define _ADD_PIN_2(ENTRY_NAME, NAME, IS_DIGITAL) { ENTRY_NAME, NAME, IS_DIGITAL }, -#define _ADD_PIN(NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2(entry_NAME_##COUNTER, NAME, IS_DIGITAL) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) - -typedef struct { - const char * const name; - pin_t pin; - bool is_digital; -} PinInfo; - -const PinInfo pin_array[] PROGMEM = { - - /** - * [pin name] [pin number] [is digital or analog] 1 = digital, 0 = analog - * Each entry takes up 6 bytes in FLASH: - * 2 byte pointer to location of the name string - * 2 bytes containing the pin number - * analog pin numbers were convereted to digital when the array was created - * 2 bytes containing the digital/analog bool flag - */ - - // manually add pins ... - #if SERIAL_PORT == 0 - #if AVR_ATmega2560_FAMILY - { RXD_NAME, 0, true }, - { TXD_NAME, 1, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME, 8, true }, - { TXD_NAME, 9, true }, - #endif - #endif - - #include "pinsDebug_list.h" - #line 102 - -}; - -#define AVR_ATmega2560_FAMILY_PLUS_70 (MB(BQ_ZUM_MEGA_3D) || MB(MIGHTYBOARD_REVE) || MB(MINIRAMBO) || MB(SCOOVO_X9H)) - -#if AVR_AT90USB1286_FAMILY - // Working with Teensyduino extension so need to re-define some things - #include "pinsDebug_Teensyduino.h" - // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs - // portModeRegister takes a different argument - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p) - #define get_pinMode(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin)) -#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70 - #include "pinsDebug_plus_70.h" - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p) - bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } -#else - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort(p) - bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } -#endif - -#if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of - #undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it - #define NUM_DIGITAL_PINS 32 // set to digital only + digital/analog -#endif - -#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), V); SERIAL_ECHO(buffer); }while(0) -#define PWM_CASE(N,Z) \ - case TIMER##N##Z: \ - if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \ - PWM_PRINT(OCR##N##Z); \ - return true; \ - } else return false - -/** - * Print a pin's PWM status. - * Return true if it's currently a PWM pin. - */ -static bool pwm_status(uint8_t pin) { - char buffer[20]; // for the sprintf statements - - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - PWM_CASE(0, A); - #endif - #endif - PWM_CASE(0, B); - #endif - - #if defined(TCCR1A) && defined(COM1A1) - PWM_CASE(1, A); - PWM_CASE(1, B); - #if defined(COM1C1) && defined(TIMER1C) - PWM_CASE(1, C); - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - PWM_CASE(2, A); - PWM_CASE(2, B); - #endif - - #if defined(TCCR3A) && defined(COM3A1) - PWM_CASE(3, A); - PWM_CASE(3, B); - #ifdef COM3C1 - PWM_CASE(3, C); - #endif - #endif - - #ifdef TCCR4A - PWM_CASE(4, A); - PWM_CASE(4, B); - PWM_CASE(4, C); - #endif - - #if defined(TCCR5A) && defined(COM5A1) - PWM_CASE(5, A); - PWM_CASE(5, B); - PWM_CASE(5, C); - #endif - - case NOT_ON_TIMER: - default: - return false; - } - SERIAL_PROTOCOL_SP(2); -} // pwm_status - - -const volatile uint8_t* const PWM_other[][3] PROGMEM = { - { &TCCR0A, &TCCR0B, &TIMSK0 }, - { &TCCR1A, &TCCR1B, &TIMSK1 }, - #if defined(TCCR2A) && defined(COM2A1) - { &TCCR2A, &TCCR2B, &TIMSK2 }, - #endif - #if defined(TCCR3A) && defined(COM3A1) - { &TCCR3A, &TCCR3B, &TIMSK3 }, - #endif - #ifdef TCCR4A - { &TCCR4A, &TCCR4B, &TIMSK4 }, - #endif - #if defined(TCCR5A) && defined(COM5A1) - { &TCCR5A, &TCCR5B, &TIMSK5 }, - #endif -}; - - -const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { - - #ifdef TIMER0A - { &OCR0A, &OCR0B, 0 }, - #else - { 0, &OCR0B, 0 }, - #endif - - #if defined(COM1C1) && defined(TIMER1C) - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, (const uint8_t*)&OCR1C }, - #else - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, 0 }, - #endif - - #if defined(TCCR2A) && defined(COM2A1) - { &OCR2A, &OCR2B, 0 }, - #endif - - #if defined(TCCR3A) && defined(COM3A1) - #ifdef COM3C1 - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, (const uint8_t*)&OCR3C }, - #else - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, 0 }, - #endif - #endif - - #ifdef TCCR4A - { (const uint8_t*)&OCR4A, (const uint8_t*)&OCR4B, (const uint8_t*)&OCR4C }, - #endif - - #if defined(TCCR5A) && defined(COM5A1) - { (const uint8_t*)&OCR5A, (const uint8_t*)&OCR5B, (const uint8_t*)&OCR5C }, - #endif -}; - - -#define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) -#define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) -#define TIMSK(T) pgm_read_word(&PWM_other[T][2]) -#define CS_0 0 -#define CS_1 1 -#define CS_2 2 -#define WGM_0 0 -#define WGM_1 1 -#define WGM_2 3 -#define WGM_3 4 -#define TOIE 0 - -#define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L]) - -static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); } -static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); } -static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); } - -#if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY - static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); } -#endif - -void com_print(uint8_t N, uint8_t Z) { - const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); - SERIAL_PROTOCOLPGM(" COM"); - SERIAL_PROTOCOLCHAR(N + '0'); - switch (Z) { - case 'A': - SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); - break; - case 'B': - SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); - break; - case 'C': - SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); - break; - } -} - -void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout - char buffer[20]; // for the sprintf statements - const uint8_t *TCCRB = (uint8_t*)TCCR_B(T), - *TCCRA = (uint8_t*)TCCR_A(T); - uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); - if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); - - SERIAL_PROTOCOLPGM(" TIMER"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLCHAR(L); - SERIAL_PROTOCOL_SP(3); - - if (N == 3) { - const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL8); - } - else { - const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL16); - } - SERIAL_PROTOCOLPAIR(" WGM: ", WGM); - com_print(T,L); - SERIAL_PROTOCOLPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); - - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("A: ", *TCCRA); - - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("B: ", *TCCRB); - - const uint8_t *TMSK = (uint8_t*)TIMSK(T); - SERIAL_PROTOCOLPGM(" TIMSK"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR(": ", *TMSK); - - const uint8_t OCIE = L - 'A' + 1; - if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); } - else { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); } - if (TEST(*TMSK, OCIE)) err_is_interrupt(); - if (TEST(*TMSK, TOIE)) err_prob_interrupt(); -} - -static void pwm_details(uint8_t pin) { - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - case TIMER0A: timer_prefix(0, 'A', 3); break; - #endif - #endif - case TIMER0B: timer_prefix(0, 'B', 3); break; - #endif - - #if defined(TCCR1A) && defined(COM1A1) - case TIMER1A: timer_prefix(1, 'A', 4); break; - case TIMER1B: timer_prefix(1, 'B', 4); break; - #if defined(COM1C1) && defined(TIMER1C) - case TIMER1C: timer_prefix(1, 'C', 4); break; - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - case TIMER2A: timer_prefix(2, 'A', 3); break; - case TIMER2B: timer_prefix(2, 'B', 3); break; - #endif - - #if defined(TCCR3A) && defined(COM3A1) - case TIMER3A: timer_prefix(3, 'A', 4); break; - case TIMER3B: timer_prefix(3, 'B', 4); break; - #ifdef COM3C1 - case TIMER3C: timer_prefix(3, 'C', 4); break; - #endif - #endif - - #ifdef TCCR4A - case TIMER4A: timer_prefix(4, 'A', 4); break; - case TIMER4B: timer_prefix(4, 'B', 4); break; - case TIMER4C: timer_prefix(4, 'C', 4); break; - #endif - - #if defined(TCCR5A) && defined(COM5A1) - case TIMER5A: timer_prefix(5, 'A', 4); break; - case TIMER5B: timer_prefix(5, 'B', 4); break; - case TIMER5C: timer_prefix(5, 'C', 4); break; - #endif - - case NOT_ON_TIMER: break; - - } - SERIAL_PROTOCOLPGM(" "); - - // on pins that have two PWMs, print info on second PWM - #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY - // looking for port B7 - PWMs 0A and 1C - if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) { - #if !AVR_AT90USB1286_FAMILY - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER1C"); - print_is_also_tied(); - timer_prefix(1, 'C', 4); - #else - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER0A"); - print_is_also_tied(); - timer_prefix(0, 'A', 3); - #endif - } - #endif -} // pwm_details - -#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs - int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed - const uint8_t port = digitalPinToPort_DEBUG(pin); - return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask_DEBUG(pin)) ? HIGH : LOW; - } -#endif - -void print_port(int8_t pin) { // print port number - #ifdef digitalPinToPort_DEBUG - uint8_t x; - SERIAL_PROTOCOLPGM(" Port: "); - #if AVR_AT90USB1286_FAMILY - x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64; - #else - x = digitalPinToPort_DEBUG(pin) + 64; - #endif - SERIAL_CHAR(x); - - #if AVR_AT90USB1286_FAMILY - if (pin == 46) - x = '2'; - else if (pin == 47) - x = '3'; - else { - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - } - #else - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - #endif - SERIAL_CHAR(x); - #else - SERIAL_PROTOCOL_SP(10); - #endif -} - -static void print_input_or_output(const bool isout) { - serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input = ")); -} - -// pretty report with PWM info -inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = false, const char *start_string = "") { - uint8_t temp_char; - char *name_mem_pointer, buffer[30]; // for the sprintf statements - bool found = false, multi_name_pin = false; - for (uint8_t x = 0; x < COUNT(pin_array); x++) { // scan entire array and report all instances of this pin - if (pgm_read_byte(&pin_array[x].pin) == pin) { - if (found) multi_name_pin = true; - found = true; - if (!multi_name_pin) { // report digitial and analog pin number only on the first time through - sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin); // digital pin number - SERIAL_ECHO(buffer); - print_port(pin); - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number - SERIAL_ECHO(buffer); - } - else SERIAL_ECHO_SP(8); // add padding if not an analog pin - } - else { - SERIAL_CHAR('.'); - SERIAL_ECHO_SP(26 + strlen(start_string)); // add padding if not the first instance found - } - name_mem_pointer = (char*)pgm_read_word(&pin_array[x].name); - for (uint8_t y = 0; y < 28; y++) { // always print pin name - temp_char = pgm_read_byte(name_mem_pointer + y); - if (temp_char != 0) - SERIAL_CHAR(temp_char); - else { - for (uint8_t i = 0; i < 28 - y; i++) SERIAL_CHAR(' '); - break; - } - } - if (extended) { - if (pin_is_protected(pin) && !ignore) - SERIAL_ECHOPGM("protected "); - else { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - if (pin == 46) { - print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); - } - else if (pin == 47) { - print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); - } - } - else - #endif - { - if (!(pgm_read_byte(&pin_array[x].is_digital))) { - sprintf_P(buffer, PSTR("Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0))); - SERIAL_ECHO(buffer); - } - else { - - if (!get_pinMode(pin)) { - //pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this - // because this could interfere with inductive/capacitive - // sensors (high impedance voltage divider) and with PT100 amplifier - print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - else if (pwm_status(pin)) { - // do nothing - } - else { - print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - } - if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report - } - } - } - SERIAL_EOL(); - } // end of IF - } // end of for loop - - if (!found) { - sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin); - SERIAL_ECHO(buffer); - print_port(pin); - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number - SERIAL_ECHO(buffer); - } - else - SERIAL_ECHO_SP(8); // add padding if not an analog pin - SERIAL_ECHOPGM(""); - if (extended) { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - SERIAL_PROTOCOL_SP(12); - if (pin == 46) { - print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); - } - else { - print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); - } - } - else - #endif - { - if (get_pinMode(pin)) { - SERIAL_PROTOCOL_SP(12); - print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - else { - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0))); - SERIAL_ECHO(buffer); - SERIAL_ECHOPGM(" "); - } - else - SERIAL_ECHO_SP(12); // add padding if not an analog pin - - print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin - if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report - } - } - SERIAL_EOL(); - } -} diff --git a/Marlin/pinsDebug_Teensyduino.h b/Marlin/pinsDebug_Teensyduino.h deleted file mode 100644 index 3e08bbbc66..0000000000 --- a/Marlin/pinsDebug_Teensyduino.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -// -// some of the pin mapping functions of the Teensduino extension to the Arduino IDE -// do not function the same as the other Arduino extensions -// - -#ifndef __PINSDEBUG_TEENSYDUINO_H__ -#define __PINSDEBUG_TEENSYDUINO_H__ - -#undef NUM_DIGITAL_PINS -#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48 - -// "digitalPinToPort" function just returns the pin number so need to create our own. -// Can't use the name "digitalPinToPort" for our own because it interferes with the -// FAST_PWM_FAN function if we do - -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 - -const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = { - PD, // 0 - PD0 - INT0 - PWM - PD, // 1 - PD1 - INT1 - PWM - PD, // 2 - PD2 - INT2 - RX - PD, // 3 - PD3 - INT3 - TX - PD, // 4 - PD4 - PD, // 5 - PD5 - PD, // 6 - PD6 - PD, // 7 - PD7 - PE, // 8 - PE0 - PE, // 9 - PE1 - PC, // 10 - PC0 - PC, // 11 - PC1 - PC, // 12 - PC2 - PC, // 13 - PC3 - PC, // 14 - PC4 - PWM - PC, // 15 - PC5 - PWM - PC, // 16 - PC6 - PWM - PC, // 17 - PC7 - PE, // 18 - PE6 - INT6 - PE, // 19 - PE7 - INT7 - PB, // 20 - PB0 - PB, // 21 - PB1 - PB, // 22 - PB2 - PB, // 23 - PB3 - PB, // 24 - PB4 - PWM - PB, // 25 - PB5 - PWM - PB, // 26 - PB6 - PWM - PB, // 27 - PB7 - PWM - PA, // 28 - PA0 - PA, // 29 - PA1 - PA, // 30 - PA2 - PA, // 31 - PA3 - PA, // 32 - PA4 - PA, // 33 - PA5 - PA, // 34 - PA6 - PA, // 35 - PA7 - PE, // 36 - PE4 - INT4 - PE, // 37 - PE5 - INT5 - PF, // 38 - PF0 - A0 - PF, // 39 - PF1 - A1 - PF, // 40 - PF2 - A2 - PF, // 41 - PF3 - A3 - PF, // 42 - PF4 - A4 - PF, // 43 - PF5 - A5 - PF, // 44 - PF6 - A6 - PF, // 45 - PF7 - A7 - PE, // 46 - PE2 (not defined in teensyduino) - PE, // 47 - PE3 (not defined in teensyduino) -}; - -#define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) ) - -// digitalPinToBitMask(pin) is OK - -#define digitalRead_mod(p) digitalRead(p) // Teensyduino's version of digitalRead doesn't - // disable the PWMs so we can use it as is - -// portModeRegister(pin) is OK - -#endif // __PINSDEBUG_TEENSYDUINO_H__ diff --git a/Marlin/pinsDebug_list.h b/Marlin/pinsDebug_list.h deleted file mode 100644 index e19858d528..0000000000 --- a/Marlin/pinsDebug_list.h +++ /dev/null @@ -1,1021 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Please update this list when adding new pins to Marlin. -// The order doesn't matter. -// Following this pattern is a must. -// If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. - -// Pin lists 1.1.x and 2.0.x synchronized 2018-02-17 - -#line 31 // set __LINE__ to a known value for both passes - -// -// Analog Pin Assignments -// - -#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) -#endif -#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A1) -#endif -#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A2) -#endif -#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A3) -#endif -#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A4) -#endif -#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) -#endif -#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) -#endif -#if !defined(ARDUINO_ARCH_SAM) //TC1 & TC2 are macros in the SAM tool chain - #if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC1) - #endif - #if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC2) - #endif -#endif -#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) -#endif -#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) -#endif -#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) -#endif -#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) -#endif -#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) -#endif -#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) -#endif -#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) -#endif -#if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) -#endif - -// -// Digital Pin Assignments -// - -#if defined(__FD) && __FD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FD) -#endif -#if defined(__FS) && __FS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FS) -#endif -#if defined(__GD) && __GD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GD) -#endif -#if defined(__GS) && __GS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GS) -#endif -#if PIN_EXISTS(AVR_MISO) - REPORT_NAME_DIGITAL(__LINE__, AVR_MISO_PIN) -#endif -#if PIN_EXISTS(AVR_MOSI) - REPORT_NAME_DIGITAL(__LINE__, AVR_MOSI_PIN) -#endif -#if PIN_EXISTS(AVR_SCK) - REPORT_NAME_DIGITAL(__LINE__, AVR_SCK_PIN) -#endif -#if PIN_EXISTS(ALARM) - REPORT_NAME_DIGITAL(__LINE__, ALARM_PIN) -#endif -#if PIN_EXISTS(AVR_SS) - REPORT_NAME_DIGITAL(__LINE__, AVR_SS_PIN) -#endif -#if PIN_EXISTS(BEEPER) - REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN) -#endif -#if defined(BTN_BACK) && BTN_BACK >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_BACK) -#endif -#if defined(BTN_CENTER) && BTN_CENTER >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER) -#endif -#if defined(BTN_DOWN) && BTN_DOWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN) -#endif -#if defined(BTN_DWN) && BTN_DWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DWN) -#endif -#if defined(BTN_EN1) && BTN_EN1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN1) -#endif -#if defined(BTN_EN2) && BTN_EN2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) -#endif -#if defined(BTN_ENC) && BTN_ENC >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) -#endif -#if defined(BTN_HOME) && BTN_HOME >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_HOME) -#endif -#if defined(BTN_LEFT) && BTN_LEFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT) -#endif -#if defined(BTN_LFT) && BTN_LFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LFT) -#endif -#if defined(BTN_RIGHT) && BTN_RIGHT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT) -#endif -#if defined(BTN_RT) && BTN_RT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RT) -#endif -#if defined(BTN_UP) && BTN_UP >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_UP) -#endif -#if PIN_EXISTS(CASE_LIGHT) - REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN) -#endif -#if PIN_EXISTS(CHAMBER_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, CHAMBER_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(CONTROLLER_FAN) - REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN) -#endif -#if PIN_EXISTS(CUTOFF_RESET) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_RESET_PIN) -#endif -#if PIN_EXISTS(CUTOFF_TEST) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN) -#endif -#if defined(D57) && D57 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D57) -#endif -#if defined(D58) && D58 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D58) -#endif -#if PIN_EXISTS(DAC_DISABLE) - REPORT_NAME_DIGITAL(__LINE__, DAC_DISABLE_PIN) -#endif -#if defined(DAC0_SYNC) && DAC0_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC0_SYNC) -#endif -#if defined(DAC1_SYNC) && DAC1_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC1_SYNC) -#endif -#if PIN_EXISTS(DEBUG) - REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN) -#endif -#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL) -#endif -#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0) -#endif -#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1) -#endif -#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X) -#endif -#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y) -#endif -#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z) -#endif -#if PIN_EXISTS(DIGIPOTSS) - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN) -#endif -#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0) -#endif -#if defined(DOGLCD_CS) && DOGLCD_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS) -#endif -#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI) -#endif -#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK) -#endif -#if defined(TMC_SW_MISO) && TMC_SW_MISO >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO) -#endif -#if defined(TMC_SW_MOSI) && TMC_SW_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI) -#endif -#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) -#endif -#if PIN_EXISTS(E_MUX0) - REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN) -#endif -#if PIN_EXISTS(E_MUX1) - REPORT_NAME_DIGITAL(__LINE__, E_MUX1_PIN) -#endif -#if PIN_EXISTS(E_MUX2) - REPORT_NAME_DIGITAL(__LINE__, E_MUX2_PIN) -#endif -#if PIN_EXISTS(E_STOP) - REPORT_NAME_DIGITAL(__LINE__, E_STOP_PIN) -#endif -#if PIN_EXISTS(E0_ATT) - REPORT_NAME_DIGITAL(__LINE__, E0_ATT_PIN) -#endif -#if PIN_EXISTS(E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E0_CS) - REPORT_NAME_DIGITAL(__LINE__, E0_CS_PIN) -#endif -#if PIN_EXISTS(E0_DIR) - REPORT_NAME_DIGITAL(__LINE__, E0_DIR_PIN) -#endif -#if PIN_EXISTS(E0_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E0_ENABLE_PIN) -#endif -#if PIN_EXISTS(E0_MS1) - REPORT_NAME_DIGITAL(__LINE__, E0_MS1_PIN) -#endif -#if PIN_EXISTS(E0_MS2) - REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN) -#endif -#if PIN_EXISTS(E0_STEP) - REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN) -#endif -#if PIN_EXISTS(E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E1_CS) - REPORT_NAME_DIGITAL(__LINE__, E1_CS_PIN) -#endif -#if PIN_EXISTS(E1_DIR) - REPORT_NAME_DIGITAL(__LINE__, E1_DIR_PIN) -#endif -#if PIN_EXISTS(E1_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E1_ENABLE_PIN) -#endif -#if PIN_EXISTS(E1_MS1) - REPORT_NAME_DIGITAL(__LINE__, E1_MS1_PIN) -#endif -#if PIN_EXISTS(E1_MS2) - REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN) -#endif -#if PIN_EXISTS(E1_STEP) - REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN) -#endif -#if PIN_EXISTS(E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E2_CS) - REPORT_NAME_DIGITAL(__LINE__, E2_CS_PIN) -#endif -#if PIN_EXISTS(E2_DIR) - REPORT_NAME_DIGITAL(__LINE__, E2_DIR_PIN) -#endif -#if PIN_EXISTS(E2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E2_ENABLE_PIN) -#endif -#if PIN_EXISTS(E2_MS1) - REPORT_NAME_DIGITAL(__LINE__, E2_MS1_PIN) -#endif -#if PIN_EXISTS(E2_MS2) - REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN) -#endif -#if PIN_EXISTS(E2_STEP) - REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN) -#endif -#if PIN_EXISTS(E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E3_CS) - REPORT_NAME_DIGITAL(__LINE__, E3_CS_PIN) -#endif -#if PIN_EXISTS(E3_DIR) - REPORT_NAME_DIGITAL(__LINE__, E3_DIR_PIN) -#endif -#if PIN_EXISTS(E3_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E3_ENABLE_PIN) -#endif -#if PIN_EXISTS(E3_MS1) - REPORT_NAME_DIGITAL(__LINE__, E3_MS1_PIN) -#endif -#if PIN_EXISTS(E3_MS2) - REPORT_NAME_DIGITAL(__LINE__, E3_MS2_PIN) -#endif -#if PIN_EXISTS(E3_MS3) - REPORT_NAME_DIGITAL(__LINE__, E3_MS3_PIN) -#endif -#if PIN_EXISTS(E3_STEP) - REPORT_NAME_DIGITAL(__LINE__, E3_STEP_PIN) -#endif -#if PIN_EXISTS(E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E4_CS) - REPORT_NAME_DIGITAL(__LINE__, E4_CS_PIN) -#endif -#if PIN_EXISTS(E4_DIR) - REPORT_NAME_DIGITAL(__LINE__, E4_DIR_PIN) -#endif -#if PIN_EXISTS(E4_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E4_ENABLE_PIN) -#endif -#if PIN_EXISTS(E4_MS1) - REPORT_NAME_DIGITAL(__LINE__, E4_MS1_PIN) -#endif -#if PIN_EXISTS(E4_MS2) - REPORT_NAME_DIGITAL(__LINE__, E4_MS2_PIN) -#endif -#if PIN_EXISTS(E4_MS3) - REPORT_NAME_DIGITAL(__LINE__, E4_MS3_PIN) -#endif -#if PIN_EXISTS(E4_STEP) - REPORT_NAME_DIGITAL(__LINE__, E4_STEP_PIN) -#endif -#if defined(ENET_CRS) && ENET_CRS >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) -#endif -#if defined(ENET_MDIO) && ENET_MDIO >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO) -#endif -#if defined(ENET_MOC) && ENET_MOC >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MOC) -#endif -#if defined(ENET_RX_ER) && ENET_RX_ER >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER) -#endif -#if defined(ENET_RXD0) && ENET_RXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0) -#endif -#if defined(ENET_RXD1) && ENET_RXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1) -#endif -#if defined(ENET_TX_EN) && ENET_TX_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN) -#endif -#if defined(ENET_TXD0) && ENET_TXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0) -#endif -#if defined(ENET_TXD1) && ENET_TXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1) -#endif -#if PIN_EXISTS(EXP_VOLTAGE_LEVEL) - REPORT_NAME_DIGITAL(__LINE__, EXP_VOLTAGE_LEVEL_PIN) -#endif - -#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO) -#endif -#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO) -#endif -#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO) -#endif -#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO) -#endif -#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO) -#endif -#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24) -#endif -#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2) -#endif -#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0) -#endif -#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1) -#endif -#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3) -#endif -#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN) -#endif -#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN) -#endif -#if PIN_EXISTS(FAN) - REPORT_NAME_DIGITAL(__LINE__, FAN_PIN) -#endif -#if PIN_EXISTS(FAN1) - REPORT_NAME_DIGITAL(__LINE__, FAN1_PIN) -#endif -#if PIN_EXISTS(FAN2) - REPORT_NAME_DIGITAL(__LINE__, FAN2_PIN) -#endif -#if PIN_EXISTS(FAN3) - REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN) -#endif -#if PIN_EXISTS(HEATER_0) - REPORT_NAME_DIGITAL(__LINE__, HEATER_0_PIN) -#endif -#if PIN_EXISTS(HEATER_1) - REPORT_NAME_DIGITAL(__LINE__, HEATER_1_PIN) -#endif -#if PIN_EXISTS(HEATER_2) - REPORT_NAME_DIGITAL(__LINE__, HEATER_2_PIN) -#endif -#if PIN_EXISTS(HEATER_3) - REPORT_NAME_DIGITAL(__LINE__, HEATER_3_PIN) -#endif -#if PIN_EXISTS(HEATER_4) - REPORT_NAME_DIGITAL(__LINE__, HEATER_4_PIN) -#endif -#if PIN_EXISTS(HEATER_5) - REPORT_NAME_DIGITAL(__LINE__, HEATER_5_PIN) -#endif -#if PIN_EXISTS(HEATER_6) - REPORT_NAME_DIGITAL(__LINE__, HEATER_6_PIN) -#endif -#if PIN_EXISTS(HEATER_7) - REPORT_NAME_DIGITAL(__LINE__, HEATER_7_PIN) -#endif -#if PIN_EXISTS(HEATER_BED) - REPORT_NAME_DIGITAL(__LINE__, HEATER_BED_PIN) -#endif -#if PIN_EXISTS(HOME) - REPORT_NAME_DIGITAL(__LINE__, HOME_PIN) -#endif -#if PIN_EXISTS(I2C_SCL) - REPORT_NAME_DIGITAL(__LINE__, I2C_SCL_PIN) -#endif -#if PIN_EXISTS(I2C_SDA) - REPORT_NAME_DIGITAL(__LINE__, I2C_SDA_PIN) -#endif -#if PIN_EXISTS(KILL) - REPORT_NAME_DIGITAL(__LINE__, KILL_PIN) -#endif -#if PIN_EXISTS(LCD_BACKLIGHT) - REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN) -#endif -#if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4) -#endif -#if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5) -#endif -#if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6) -#endif -#if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7) -#endif -#if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE) -#endif -#if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS) -#endif -#if defined(LCD_SDSS) && LCD_SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS) -#endif -#if PIN_EXISTS(LED_GREEN) - REPORT_NAME_DIGITAL(__LINE__, LED_GREEN_PIN) -#endif -#if PIN_EXISTS(LED) - REPORT_NAME_DIGITAL(__LINE__, LED_PIN) -#endif -#if PIN_EXISTS(LED_RED) - REPORT_NAME_DIGITAL(__LINE__, LED_RED_PIN) -#endif -#if PIN_EXISTS(MAX) - REPORT_NAME_DIGITAL(__LINE__, MAX_PIN) -#endif -#if PIN_EXISTS(MAX6675_DO) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_DO_PIN) -#endif -#if PIN_EXISTS(MAX6675_SCK) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN) -#endif -#if defined(MAX6675_SS) && MAX6675_SS >= 0 - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS) -#endif -// #if defined(MISO) && MISO >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MISO) -// #endif -#if PIN_EXISTS(MISO) - REPORT_NAME_DIGITAL(__LINE__, MISO_PIN) -#endif -#if PIN_EXISTS(MOSFET_A) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN) -#endif -#if PIN_EXISTS(MOSFET_B) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_B_PIN) -#endif -#if PIN_EXISTS(MOSFET_C) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_C_PIN) -#endif -#if PIN_EXISTS(MOSFET_D) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN) -#endif -// #if defined(MOSI) && MOSI >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MOSI) -// #endif -#if PIN_EXISTS(MOSI) - REPORT_NAME_DIGITAL(__LINE__, MOSI_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_E_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_XY_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Z_PIN) -#endif -#if PIN_EXISTS(MOTOR_FAULT) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_FAULT_PIN) -#endif -#if PIN_EXISTS(ORIG_E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(PHOTOGRAPH) - REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN) -#endif -#if PIN_EXISTS(PS_ON) - REPORT_NAME_DIGITAL(__LINE__, PS_ON_PIN) -#endif -#if PIN_EXISTS(PWM_1) - REPORT_NAME_DIGITAL(__LINE__, PWM_1_PIN) -#endif -#if PIN_EXISTS(PWM_2) - REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN) -#endif -#if defined(REF_CLK) && REF_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, REF_CLK) -#endif -#if PIN_EXISTS(RAMPS_D10) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D10_PIN) -#endif -#if PIN_EXISTS(RAMPS_D8) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D8_PIN) -#endif -#if PIN_EXISTS(RAMPS_D9) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D9_PIN) -#endif -#if PIN_EXISTS(RGB_LED_R) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_R_PIN) -#endif -#if PIN_EXISTS(RGB_LED_G) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_G_PIN) -#endif -#if PIN_EXISTS(RGB_LED_B) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_B_PIN) -#endif -#if PIN_EXISTS(RGB_LED_W) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_W_PIN) -#endif -#if PIN_EXISTS(RX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, RX_ENABLE_PIN) -#endif -#if PIN_EXISTS(SAFETY_TRIGGERED) - REPORT_NAME_DIGITAL(__LINE__, SAFETY_TRIGGERED_PIN) -#endif -// #if defined(SCK) && SCK >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCK) -// #endif -#if PIN_EXISTS(SCK) - REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) -#endif -// #if defined(SCL) && SCL >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCL) -// #endif -#if PIN_EXISTS(SD_DETECT) - REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) -#endif -// #if defined(SDA) && SDA >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SDA) -// #endif -#if defined(SDPOWER) && SDPOWER >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDPOWER) -#endif -#if defined(SDSS) && SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDSS) -#endif -#if defined(SERVO0) && SERVO0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SERVO0) -#endif -#if PIN_EXISTS(SERVO0) - REPORT_NAME_DIGITAL(__LINE__, SERVO0_PIN) -#endif -#if PIN_EXISTS(SERVO1) - REPORT_NAME_DIGITAL(__LINE__, SERVO1_PIN) -#endif -#if PIN_EXISTS(SERVO2) - REPORT_NAME_DIGITAL(__LINE__, SERVO2_PIN) -#endif -#if PIN_EXISTS(SERVO3) - REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN) -#endif -#if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK) -#endif -#if defined(SHIFT_EN) && SHIFT_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN) -#endif -#if defined(SHIFT_LD) && SHIFT_LD >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD) -#endif -#if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT) -#endif -#if PIN_EXISTS(SLED) - REPORT_NAME_DIGITAL(__LINE__, SLED_PIN) -#endif -#if PIN_EXISTS(SLEEP_WAKE) - REPORT_NAME_DIGITAL(__LINE__, SLEEP_WAKE_PIN) -#endif -#if PIN_EXISTS(SOL0) - REPORT_NAME_DIGITAL(__LINE__, SOL0_PIN) -#endif -#if PIN_EXISTS(SOL1) - REPORT_NAME_DIGITAL(__LINE__, SOL1_PIN) -#endif -#if PIN_EXISTS(SOL2) - REPORT_NAME_DIGITAL(__LINE__, SOL2_PIN) -#endif -#if PIN_EXISTS(SOL3) - REPORT_NAME_DIGITAL(__LINE__, SOL3_PIN) -#endif -#if PIN_EXISTS(SOL4) - REPORT_NAME_DIGITAL(__LINE__, SOL4_PIN) -#endif -#if defined(SPARE_IO) && SPARE_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPARE_IO) -#endif -#if defined(SPI_CHAN_DAC) && SPI_CHAN_DAC >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_DAC) -#endif -#if defined(SPI_CHAN_EEPROM1) && SPI_CHAN_EEPROM1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_EEPROM1) -#endif -#if defined(SPI_EEPROM) && SPI_EEPROM >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM) -#endif -#if defined(SPI_EEPROM1_CS) && SPI_EEPROM1_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM1_CS) -#endif -#if defined(SPI_EEPROM2_CS) && SPI_EEPROM2_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM2_CS) -#endif -#if defined(SPI_FLASH_CS) && SPI_FLASH_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_FLASH_CS) -#endif -#if PIN_EXISTS(SPINDLE_DIR) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_DIR_PIN) -#endif -#if PIN_EXISTS(SPINDLE_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_ENABLE_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_ENABLE_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_PWM) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_PWM_PIN) -#endif -#if PIN_EXISTS(SR_CLK) - REPORT_NAME_DIGITAL(__LINE__, SR_CLK_PIN) -#endif -#if PIN_EXISTS(SR_DATA) - REPORT_NAME_DIGITAL(__LINE__, SR_DATA_PIN) -#endif -#if PIN_EXISTS(SR_STROBE) - REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN) -#endif -#if PIN_EXISTS(SS) - REPORT_NAME_DIGITAL(__LINE__, SS_PIN) -#endif -#if PIN_EXISTS(STAT_LED_BLUE) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) -#endif -#if defined(STAT_LED_RED_LED) && STAT_LED_RED_LED >= 0 - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED) -#endif -#if PIN_EXISTS(STAT_LED_RED) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_PIN) -#endif -#if PIN_EXISTS(STEPPER_RESET) - REPORT_NAME_DIGITAL(__LINE__, STEPPER_RESET_PIN) -#endif -#if PIN_EXISTS(SUICIDE) - REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN) -#endif -#if defined(THERMO_CS1) && THERMO_CS1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1) -#endif -#if defined(THERMO_CS2) && THERMO_CS2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2) -#endif -#if PIN_EXISTS(THERMO_DO) - REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN) -#endif -#if PIN_EXISTS(THERMO_SCK) - REPORT_NAME_DIGITAL(__LINE__, THERMO_SCK_PIN) -#endif -#if PIN_EXISTS(TLC_BLANK) - REPORT_NAME_DIGITAL(__LINE__, TLC_BLANK_PIN) -#endif -#if PIN_EXISTS(TLC_CLOCK) - REPORT_NAME_DIGITAL(__LINE__, TLC_CLOCK_PIN) -#endif -#if PIN_EXISTS(TLC_DATA) - REPORT_NAME_DIGITAL(__LINE__, TLC_DATA_PIN) -#endif -#if PIN_EXISTS(TLC_XLAT) - REPORT_NAME_DIGITAL(__LINE__, TLC_XLAT_PIN) -#endif -#if PIN_EXISTS(TOOL_0) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PIN) -#endif -#if PIN_EXISTS(TOOL_0_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_1) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PIN) -#endif -#if PIN_EXISTS(TOOL_1_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_2) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PIN) -#endif -#if PIN_EXISTS(TOOL_2_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_3) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PIN) -#endif -#if PIN_EXISTS(TOOL_3_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_PWM_PIN) -#endif -#if PIN_EXISTS(TX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN) -#endif -#if defined(UI1) && UI1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI1) -#endif -#if defined(UI2) && UI2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI2) -#endif -#if defined(UNUSED_PWM) && UNUSED_PWM >= 0 - REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM) -#endif -#if PIN_EXISTS(X_ATT) - REPORT_NAME_DIGITAL(__LINE__, X_ATT_PIN) -#endif -#if PIN_EXISTS(X_CS) - REPORT_NAME_DIGITAL(__LINE__, X_CS_PIN) -#endif -#if PIN_EXISTS(X_DIR) - REPORT_NAME_DIGITAL(__LINE__, X_DIR_PIN) -#endif -#if PIN_EXISTS(X_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X_ENABLE_PIN) -#endif -#if PIN_EXISTS(X_MAX) - REPORT_NAME_DIGITAL(__LINE__, X_MAX_PIN) -#endif -#if PIN_EXISTS(X_MIN) - REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN) -#endif -#if PIN_EXISTS(X_MS1) - REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN) -#endif -#if PIN_EXISTS(X_MS2) - REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN) -#endif -#if PIN_EXISTS(X_STEP) - REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN) -#endif -#if PIN_EXISTS(X_STOP) - REPORT_NAME_DIGITAL(__LINE__, X_STOP_PIN) -#endif -#if PIN_EXISTS(X2_DIR) - REPORT_NAME_DIGITAL(__LINE__, X2_DIR_PIN) -#endif -#if PIN_EXISTS(X2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) -#endif -#if PIN_EXISTS(X2_STEP) - REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN) -#endif -#if PIN_EXISTS(Y_ATT) - REPORT_NAME_DIGITAL(__LINE__, Y_ATT_PIN) -#endif -#if PIN_EXISTS(Y_CS) - REPORT_NAME_DIGITAL(__LINE__, Y_CS_PIN) -#endif -#if PIN_EXISTS(Y_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y_DIR_PIN) -#endif -#if PIN_EXISTS(Y_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y_MAX) - REPORT_NAME_DIGITAL(__LINE__, Y_MAX_PIN) -#endif -#if PIN_EXISTS(Y_MIN) - REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN) -#endif -#if PIN_EXISTS(Y_MS1) - REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN) -#endif -#if PIN_EXISTS(Y_MS2) - REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN) -#endif -#if PIN_EXISTS(Y_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN) -#endif -#if PIN_EXISTS(Y_STOP) - REPORT_NAME_DIGITAL(__LINE__, Y_STOP_PIN) -#endif -#if PIN_EXISTS(Y2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y2_DIR_PIN) -#endif -#if PIN_EXISTS(Y2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN) -#endif -#if PIN_EXISTS(Z_ATT) - REPORT_NAME_DIGITAL(__LINE__, Z_ATT_PIN) -#endif -#if PIN_EXISTS(Z_CS) - REPORT_NAME_DIGITAL(__LINE__, Z_CS_PIN) -#endif -#if PIN_EXISTS(Z_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z_DIR_PIN) -#endif -#if PIN_EXISTS(Z_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z_MAX) - REPORT_NAME_DIGITAL(__LINE__, Z_MAX_PIN) -#endif -#if PIN_EXISTS(Z_MIN) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN) -#endif -#if PIN_EXISTS(Z_MIN_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) -#endif -#if PIN_EXISTS(Z_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN) -#endif -#if PIN_EXISTS(Z_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) -#endif -#if PIN_EXISTS(Z_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_PROBE_PIN) -#endif -#if PIN_EXISTS(Z_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) -#endif -#if PIN_EXISTS(Z_STOP) - REPORT_NAME_DIGITAL(__LINE__, Z_STOP_PIN) -#endif -#if PIN_EXISTS(Z2_CS) - REPORT_NAME_DIGITAL(__LINE__, Z2_CS_PIN) -#endif -#if PIN_EXISTS(Z2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z2_DIR_PIN) -#endif -#if PIN_EXISTS(Z2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z2_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN) -#endif -#if PIN_EXISTS(Z2_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS2_PIN) -#endif -#if PIN_EXISTS(Z2_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS3_PIN) -#endif -#if PIN_EXISTS(Z2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z2_STEP_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D6) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D9) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D9_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN) -#endif diff --git a/Marlin/pinsDebug_plus_70.h b/Marlin/pinsDebug_plus_70.h deleted file mode 100644 index c18c595ec9..0000000000 --- a/Marlin/pinsDebug_plus_70.h +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * structurs for 2560 family boards that use morre than 70 pins - */ - -#ifndef __PINSDEBUG_PLUS_70_H__ -#define __PINSDEBUG_PLUS_70_H__ - -#undef NUM_DIGITAL_PINS -#if MB(BQ_ZUM_MEGA_3D) - #define NUM_DIGITAL_PINS 85 -#elif MB(MIGHTYBOARD_REVE) - #define NUM_DIGITAL_PINS 80 -#elif MB(MINIRAMBO) - #define NUM_DIGITAL_PINS 85 -#elif MB(SCOOVO_X9H) - #define NUM_DIGITAL_PINS 85 -#endif - -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 -#define PG 7 -#define PH 8 -#define PJ 10 -#define PK 11 -#define PL 12 - -const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { - // PORTLIST - // ------------------------------------------- - PE , // PE 0 ** 0 ** USART0_RX - PE , // PE 1 ** 1 ** USART0_TX - PE , // PE 4 ** 2 ** PWM2 - PE , // PE 5 ** 3 ** PWM3 - PG , // PG 5 ** 4 ** PWM4 - PE , // PE 3 ** 5 ** PWM5 - PH , // PH 3 ** 6 ** PWM6 - PH , // PH 4 ** 7 ** PWM7 - PH , // PH 5 ** 8 ** PWM8 - PH , // PH 6 ** 9 ** PWM9 - PB , // PB 4 ** 10 ** PWM10 - PB , // PB 5 ** 11 ** PWM11 - PB , // PB 6 ** 12 ** PWM12 - PB , // PB 7 ** 13 ** PWM13 - PJ , // PJ 1 ** 14 ** USART3_TX - PJ , // PJ 0 ** 15 ** USART3_RX - PH , // PH 1 ** 16 ** USART2_TX - PH , // PH 0 ** 17 ** USART2_RX - PD , // PD 3 ** 18 ** USART1_TX - PD , // PD 2 ** 19 ** USART1_RX - PD , // PD 1 ** 20 ** I2C_SDA - PD , // PD 0 ** 21 ** I2C_SCL - PA , // PA 0 ** 22 ** D22 - PA , // PA 1 ** 23 ** D23 - PA , // PA 2 ** 24 ** D24 - PA , // PA 3 ** 25 ** D25 - PA , // PA 4 ** 26 ** D26 - PA , // PA 5 ** 27 ** D27 - PA , // PA 6 ** 28 ** D28 - PA , // PA 7 ** 29 ** D29 - PC , // PC 7 ** 30 ** D30 - PC , // PC 6 ** 31 ** D31 - PC , // PC 5 ** 32 ** D32 - PC , // PC 4 ** 33 ** D33 - PC , // PC 3 ** 34 ** D34 - PC , // PC 2 ** 35 ** D35 - PC , // PC 1 ** 36 ** D36 - PC , // PC 0 ** 37 ** D37 - PD , // PD 7 ** 38 ** D38 - PG , // PG 2 ** 39 ** D39 - PG , // PG 1 ** 40 ** D40 - PG , // PG 0 ** 41 ** D41 - PL , // PL 7 ** 42 ** D42 - PL , // PL 6 ** 43 ** D43 - PL , // PL 5 ** 44 ** D44 - PL , // PL 4 ** 45 ** D45 - PL , // PL 3 ** 46 ** D46 - PL , // PL 2 ** 47 ** D47 - PL , // PL 1 ** 48 ** D48 - PL , // PL 0 ** 49 ** D49 - PB , // PB 3 ** 50 ** SPI_MISO - PB , // PB 2 ** 51 ** SPI_MOSI - PB , // PB 1 ** 52 ** SPI_SCK - PB , // PB 0 ** 53 ** SPI_SS - PF , // PF 0 ** 54 ** A0 - PF , // PF 1 ** 55 ** A1 - PF , // PF 2 ** 56 ** A2 - PF , // PF 3 ** 57 ** A3 - PF , // PF 4 ** 58 ** A4 - PF , // PF 5 ** 59 ** A5 - PF , // PF 6 ** 60 ** A6 - PF , // PF 7 ** 61 ** A7 - PK , // PK 0 ** 62 ** A8 - PK , // PK 1 ** 63 ** A9 - PK , // PK 2 ** 64 ** A10 - PK , // PK 3 ** 65 ** A11 - PK , // PK 4 ** 66 ** A12 - PK , // PK 5 ** 67 ** A13 - PK , // PK 6 ** 68 ** A14 - PK , // PK 7 ** 69 ** A15 - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** - PE , // PE 7 ** 80 ** - PD , // PD 4 ** 81 ** - PD , // PD 5 ** 82 ** - PD , // PD 6 ** 83 ** - PH , // PH 2 ** 84 ** - PH , // PH 7 ** 85 ** -}; - -#define digitalPinToPort_plus_70(P) ( pgm_read_byte( digital_pin_to_port_PGM_plus_70 + (P) ) ) - -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { - // PIN IN PORT - // ------------------------------------------- - _BV( 0 ) , // PE 0 ** 0 ** USART0_RX - _BV( 1 ) , // PE 1 ** 1 ** USART0_TX - _BV( 4 ) , // PE 4 ** 2 ** PWM2 - _BV( 5 ) , // PE 5 ** 3 ** PWM3 - _BV( 5 ) , // PG 5 ** 4 ** PWM4 - _BV( 3 ) , // PE 3 ** 5 ** PWM5 - _BV( 3 ) , // PH 3 ** 6 ** PWM6 - _BV( 4 ) , // PH 4 ** 7 ** PWM7 - _BV( 5 ) , // PH 5 ** 8 ** PWM8 - _BV( 6 ) , // PH 6 ** 9 ** PWM9 - _BV( 4 ) , // PB 4 ** 10 ** PWM10 - _BV( 5 ) , // PB 5 ** 11 ** PWM11 - _BV( 6 ) , // PB 6 ** 12 ** PWM12 - _BV( 7 ) , // PB 7 ** 13 ** PWM13 - _BV( 1 ) , // PJ 1 ** 14 ** USART3_TX - _BV( 0 ) , // PJ 0 ** 15 ** USART3_RX - _BV( 1 ) , // PH 1 ** 16 ** USART2_TX - _BV( 0 ) , // PH 0 ** 17 ** USART2_RX - _BV( 3 ) , // PD 3 ** 18 ** USART1_TX - _BV( 2 ) , // PD 2 ** 19 ** USART1_RX - _BV( 1 ) , // PD 1 ** 20 ** I2C_SDA - _BV( 0 ) , // PD 0 ** 21 ** I2C_SCL - _BV( 0 ) , // PA 0 ** 22 ** D22 - _BV( 1 ) , // PA 1 ** 23 ** D23 - _BV( 2 ) , // PA 2 ** 24 ** D24 - _BV( 3 ) , // PA 3 ** 25 ** D25 - _BV( 4 ) , // PA 4 ** 26 ** D26 - _BV( 5 ) , // PA 5 ** 27 ** D27 - _BV( 6 ) , // PA 6 ** 28 ** D28 - _BV( 7 ) , // PA 7 ** 29 ** D29 - _BV( 7 ) , // PC 7 ** 30 ** D30 - _BV( 6 ) , // PC 6 ** 31 ** D31 - _BV( 5 ) , // PC 5 ** 32 ** D32 - _BV( 4 ) , // PC 4 ** 33 ** D33 - _BV( 3 ) , // PC 3 ** 34 ** D34 - _BV( 2 ) , // PC 2 ** 35 ** D35 - _BV( 1 ) , // PC 1 ** 36 ** D36 - _BV( 0 ) , // PC 0 ** 37 ** D37 - _BV( 7 ) , // PD 7 ** 38 ** D38 - _BV( 2 ) , // PG 2 ** 39 ** D39 - _BV( 1 ) , // PG 1 ** 40 ** D40 - _BV( 0 ) , // PG 0 ** 41 ** D41 - _BV( 7 ) , // PL 7 ** 42 ** D42 - _BV( 6 ) , // PL 6 ** 43 ** D43 - _BV( 5 ) , // PL 5 ** 44 ** D44 - _BV( 4 ) , // PL 4 ** 45 ** D45 - _BV( 3 ) , // PL 3 ** 46 ** D46 - _BV( 2 ) , // PL 2 ** 47 ** D47 - _BV( 1 ) , // PL 1 ** 48 ** D48 - _BV( 0 ) , // PL 0 ** 49 ** D49 - _BV( 3 ) , // PB 3 ** 50 ** SPI_MISO - _BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI - _BV( 1 ) , // PB 1 ** 52 ** SPI_SCK - _BV( 0 ) , // PB 0 ** 53 ** SPI_SS - _BV( 0 ) , // PF 0 ** 54 ** A0 - _BV( 1 ) , // PF 1 ** 55 ** A1 - _BV( 2 ) , // PF 2 ** 56 ** A2 - _BV( 3 ) , // PF 3 ** 57 ** A3 - _BV( 4 ) , // PF 4 ** 58 ** A4 - _BV( 5 ) , // PF 5 ** 59 ** A5 - _BV( 6 ) , // PF 6 ** 60 ** A6 - _BV( 7 ) , // PF 7 ** 61 ** A7 - _BV( 0 ) , // PK 0 ** 62 ** A8 - _BV( 1 ) , // PK 1 ** 63 ** A9 - _BV( 2 ) , // PK 2 ** 64 ** A10 - _BV( 3 ) , // PK 3 ** 65 ** A11 - _BV( 4 ) , // PK 4 ** 66 ** A12 - _BV( 5 ) , // PK 5 ** 67 ** A13 - _BV( 6 ) , // PK 6 ** 68 ** A14 - _BV( 7 ) , // PK 7 ** 69 ** A15 - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** - _BV( 7 ) , // PE 7 ** 80 ** - _BV( 4 ) , // PD 4 ** 81 ** - _BV( 5 ) , // PD 5 ** 82 ** - _BV( 6 ) , // PD 6 ** 83 ** - _BV( 2 ) , // PH 2 ** 84 ** - _BV( 7 ) , // PH 7 ** 85 ** -}; - -#define digitalPinToBitMask_plus_70(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM_plus_70 + (P) ) ) - - -const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { - // TIMERS - // ------------------------------------------- - NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX - NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX - TIMER3B , // PE 4 ** 2 ** PWM2 - TIMER3C , // PE 5 ** 3 ** PWM3 - TIMER0B , // PG 5 ** 4 ** PWM4 - TIMER3A , // PE 3 ** 5 ** PWM5 - TIMER4A , // PH 3 ** 6 ** PWM6 - TIMER4B , // PH 4 ** 7 ** PWM7 - TIMER4C , // PH 5 ** 8 ** PWM8 - TIMER2B , // PH 6 ** 9 ** PWM9 - TIMER2A , // PB 4 ** 10 ** PWM10 - TIMER1A , // PB 5 ** 11 ** PWM11 - TIMER1B , // PB 6 ** 12 ** PWM12 - TIMER0A , // PB 7 ** 13 ** PWM13 - NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX - NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX - NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX - NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX - NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX - NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX - NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA - NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL - NOT_ON_TIMER , // PA 0 ** 22 ** D22 - NOT_ON_TIMER , // PA 1 ** 23 ** D23 - NOT_ON_TIMER , // PA 2 ** 24 ** D24 - NOT_ON_TIMER , // PA 3 ** 25 ** D25 - NOT_ON_TIMER , // PA 4 ** 26 ** D26 - NOT_ON_TIMER , // PA 5 ** 27 ** D27 - NOT_ON_TIMER , // PA 6 ** 28 ** D28 - NOT_ON_TIMER , // PA 7 ** 29 ** D29 - NOT_ON_TIMER , // PC 7 ** 30 ** D30 - NOT_ON_TIMER , // PC 6 ** 31 ** D31 - NOT_ON_TIMER , // PC 5 ** 32 ** D32 - NOT_ON_TIMER , // PC 4 ** 33 ** D33 - NOT_ON_TIMER , // PC 3 ** 34 ** D34 - NOT_ON_TIMER , // PC 2 ** 35 ** D35 - NOT_ON_TIMER , // PC 1 ** 36 ** D36 - NOT_ON_TIMER , // PC 0 ** 37 ** D37 - NOT_ON_TIMER , // PD 7 ** 38 ** D38 - NOT_ON_TIMER , // PG 2 ** 39 ** D39 - NOT_ON_TIMER , // PG 1 ** 40 ** D40 - NOT_ON_TIMER , // PG 0 ** 41 ** D41 - NOT_ON_TIMER , // PL 7 ** 42 ** D42 - NOT_ON_TIMER , // PL 6 ** 43 ** D43 - TIMER5C , // PL 5 ** 44 ** D44 - TIMER5B , // PL 4 ** 45 ** D45 - TIMER5A , // PL 3 ** 46 ** D46 - NOT_ON_TIMER , // PL 2 ** 47 ** D47 - NOT_ON_TIMER , // PL 1 ** 48 ** D48 - NOT_ON_TIMER , // PL 0 ** 49 ** D49 - NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO - NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI - NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK - NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS - NOT_ON_TIMER , // PF 0 ** 54 ** A0 - NOT_ON_TIMER , // PF 1 ** 55 ** A1 - NOT_ON_TIMER , // PF 2 ** 56 ** A2 - NOT_ON_TIMER , // PF 3 ** 57 ** A3 - NOT_ON_TIMER , // PF 4 ** 58 ** A4 - NOT_ON_TIMER , // PF 5 ** 59 ** A5 - NOT_ON_TIMER , // PF 6 ** 60 ** A6 - NOT_ON_TIMER , // PF 7 ** 61 ** A7 - NOT_ON_TIMER , // PK 0 ** 62 ** A8 - NOT_ON_TIMER , // PK 1 ** 63 ** A9 - NOT_ON_TIMER , // PK 2 ** 64 ** A10 - NOT_ON_TIMER , // PK 3 ** 65 ** A11 - NOT_ON_TIMER , // PK 4 ** 66 ** A12 - NOT_ON_TIMER , // PK 5 ** 67 ** A13 - NOT_ON_TIMER , // PK 6 ** 68 ** A14 - NOT_ON_TIMER , // PK 7 ** 69 ** A15 - NOT_ON_TIMER , // PG 4 ** 70 ** - NOT_ON_TIMER , // PG 3 ** 71 ** - NOT_ON_TIMER , // PJ 2 ** 72 ** - NOT_ON_TIMER , // PJ 3 ** 73 ** - NOT_ON_TIMER , // PJ 7 ** 74 ** - NOT_ON_TIMER , // PJ 4 ** 75 ** - NOT_ON_TIMER , // PJ 5 ** 76 ** - NOT_ON_TIMER , // PJ 6 ** 77 ** - NOT_ON_TIMER , // PE 2 ** 78 ** - NOT_ON_TIMER , // PE 6 ** 79 ** -}; - -#define digitalPinToTimer_plus_70(P) ( pgm_read_byte( digital_pin_to_timer_PGM_plus_70 + (P) ) ) - -/** - * Interrupts that are not implemented - * - * INT6 E6 79 - * INT7 E7 80 - * PCINT11 J2 72 - * PCINT12 J3 73 - * PCINT13 J4 75 - * PCINT14 J5 76 - * PCINT15 J6 77 - */ - - -#endif // __PINSDEBUG_PLUS_70_H__ diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h deleted file mode 100644 index 61cdb56c1d..0000000000 --- a/Marlin/pins_3DRAG.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "3Drag" -#endif - -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "3Drag" -#endif - -#ifndef DEFAULT_SOURCE_CODE_URL - #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" -#endif - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 9 -#define RAMPS_D9_PIN 8 -#define MOSFET_D_PIN 12 - -#define CASE_LIGHT_PIN -1 // MUST BE HARDWARE PWM but one is not available on expansion header - -#include "pins_RAMPS.h" - -// -// Limit Switches -// -#undef Z_MAX_PIN -#define Z_MAX_PIN -1 - -// -// Steppers -// -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 63 - -// -// Heaters / Fans -// -#define HEATER_2_PIN 6 - -// -// Misc. Functions -// -#undef SDSS -#define SDSS 25 - -#undef SD_DETECT_PIN -#define SD_DETECT_PIN 53 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - #undef BEEPER_PIN - #define BEEPER_PIN -1 - - #undef LCD_PINS_RS - #undef LCD_PINS_ENABLE - #undef LCD_PINS_D4 - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 37 - #define LCD_PINS_D5 35 - #define LCD_PINS_D6 33 - #define LCD_PINS_D7 31 - - // Buttons - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #define BTN_EN1 16 - #define BTN_EN2 17 - #define BTN_ENC 23 - -#else - - #define BEEPER_PIN 33 - -#endif // ULTRA_LCD && NEWPANEL - -/** - * M3/M4/M5 - Spindle/Laser Control - * - * If you want to control the speed of your spindle then you'll have - * have to sacrifce the Extruder and pull some signals off the Z stepper - * driver socket. - * - * The following assumes: - * - the Z stepper driver socket is empty - * - the extruder driver socket has a driver board plugged into it - * - the Z stepper wires are attached the the extruder connector - * - * If you want to keep the extruder AND don't have a LCD display then - * you can still control the power on/off and spindle direction. - * - * Where to get spindle signals - * - * stepper signal socket name socket name - * ------- - * SPINDLE_LASER_ENABLE_PIN /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_DIR_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor - */ -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not good with 3DRAG -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !EXTRUDERS - #undef E0_DIR_PIN - #undef E0_ENABLE_PIN - #undef E0_STEP_PIN - #undef Z_DIR_PIN - #undef Z_ENABLE_PIN - #undef Z_STEP_PIN - #define Z_DIR_PIN 28 - #define Z_ENABLE_PIN 24 - #define Z_STEP_PIN 26 - #define SPINDLE_LASER_PWM_PIN 46 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 62 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 48 - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // use expansion header if no LCD in use - #define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup/pulldown! - #define SPINDLE_DIR_PIN 17 - #endif -#endif diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h deleted file mode 100644 index 415cc23bce..0000000000 --- a/Marlin/pins_5DPRINT.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * 5DPrint D8 Driver board pin assignments - * - * https://bitbucket.org/makible/5dprint-d8-controller-board - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Makibox" -#define BOARD_NAME "5DPrint D8" - -// -// Servos -// -#define SERVO0_PIN 41 -#define SERVO1_PIN 42 -#define SERVO2_PIN 43 -#define SERVO3_PIN 44 - -// -// Limit Switches -// -#define X_STOP_PIN 37 // E5 -#define Y_STOP_PIN 36 // E4 -#define Z_STOP_PIN 19 // E7 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 17 // C7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 13 // C3 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 12 // C2 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 11 // C1 - -// -// Digital Microstepping -// -#define X_MS1_PIN 25 // B5 -#define X_MS2_PIN 26 // B6 -#define Y_MS1_PIN 9 // E1 -#define Y_MS2_PIN 8 // E0 -#define Z_MS1_PIN 7 // D7 -#define Z_MS2_PIN 6 // D6 -#define E0_MS1_PIN 5 // D5 -#define E0_MS2_PIN 4 // D4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 -#define HEATER_BED_PIN 14 // C4 - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -//DIGIPOTS slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for DIGIPOT 0x2C (0x58 <- 0x2C << 1) diff --git a/Marlin/pins_ANET_10.h b/Marlin/pins_ANET_10.h deleted file mode 100644 index a8cbd5f29c..0000000000 --- a/Marlin/pins_ANET_10.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Anet V1.0 board pin assignments - */ - -/** - * Rev B 16 JUN 2017 - * - * 1) no longer uses Sanguino files to define some of the pins - * 2) added pointers to useable Arduino IDE extensions - * - */ - -/** - * The standard Arduino IDE extension (board manager) for this board - * is located at https://github.com/SkyNet3D/anet-board. - * - * Installation instructions are on that page. - * - * After copying the files to the appropriate location, restart Arduino and - * you'll see "Anet V1.0" and "Anet V1.0 (Optiboot)" in the boards list. - * - * "Anet V1.0" uses the bootloader that was installed on the board when - * it shipped from the factory. - * - * "Anet V1.0 (Optiboot)" frees up another 3K of FLASH. You'll need to burn - * a new bootloader to the board to be able to automatically download a - * compiled image. - * - */ - -/** - * Another usable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -/** - * To burn a new bootloader: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select the board and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Additional info: - * - * Anet Schematics - https://github.com/ralf-e/ANET-3D-Board-V1.0 - * Wiring RRDFG Smart Controller - http://www.thingiverse.com/thing:2103748 - * SkyNet3D Anet software development - https://github.com/SkyNet3D/Marlin/ - * Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/ - * - * Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community. - */ - -#ifndef __AVR_ATmega1284P__ - #error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected in the 'Tools -> Boards' menu and ATmega1284P selected in 'Tools -> Processor' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Anet" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 -#define X_ENABLE_PIN 14 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 -#define Y_ENABLE_PIN 14 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 -#define Z_ENABLE_PIN 26 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 -#define E0_ENABLE_PIN 14 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) -#define HEATER_BED_PIN 12 // (bed) - -#ifndef FAN_PIN - #define FAN_PIN 4 -#endif - -// -// Misc. Functions -// -#define SDSS 31 -#define LED_PIN -1 - -/** - * LCD / Controller - * - * Only the following displays are supported: - * ZONESTAR_LCD - * ANET_FULL_GRAPHICS_LCD - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - */ - -#if ENABLED(ULTRA_LCD) - #define LCD_SDSS 28 - #if ENABLED(ADC_KEYPAD) - #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 - #define ADC_KEYPAD_PIN 1 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD) - // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics - // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb - // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #define SERVO0_PIN 29 // free for BLTouch/3D-Touch - #define BEEPER_PIN 17 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 28 - #define LCD_PINS_D4 30 - #define BTN_EN1 11 - #define BTN_EN2 10 - #define BTN_ENC 16 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(63) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - #endif -#else - #define SERVO0_PIN 27 -#endif - -/** - * ==================================================================== - * =============== Alternative RepRapDiscount Wiring ================== - * ==================================================================== - * - * An alternative wiring scheme for the RepRapDiscount Full Graphics Display is - * published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748. - * - * Using that adapter requires changing the pin definition as follows: - * #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - * #define BEEPER_PIN 28 - * #define LCD_PINS_RS 30 - * #define LCD_PINS_ENABLE 29 - * #define LCD_PINS_D4 17 - * - * The BLTouch pin becomes LCD:3 - */ - -/** - * ==================================================================== - * ===================== LCD PINOUTS ================================== - * ==================================================================== - * - * Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring - * physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | http://www.thingiverse - * pin pin functions | | | | .com/thing:2103748 - *------------------------------------------------------------------------------------------------------------------------ - * ANET-J3.1 8 *** | N/A | J3_TX *** | | - * ANET-J3.2 9 *** | N/A | J3_RX *** | | - * ANET-J3.3 6 MISO | N/A | MISO *** | EXP2.1 MISO | EXP2.1 MISO - * ANET-J3.4 +5V | N/A | +5V | | - * ANET-J3.5 7 SCK | N/A | SCK *** | EXP2.2 SCK | EXP2.2 SCK - * ANET-J3.6 5 MOSI | N/A | MOSI *** | EXP2.6 MOSI | EXP2.6 MOSI - * ANET-J3.7 !RESET | N/A | button | EXP2.8 panel button | EXP2.8 panel button - * ANET-J3.8 GND | N/A | GND | EXP2.9 GND | EXP2.9 GND - * ANET-J3.9 4 Don't use | N/A | N/C | | - * ANET-J3.10 +3.3V | N/A | +3.3V *** | | - * | | | | - * | | | | - * ANET-LCD.1 GND | GND | GND | EXP1.9 GND | EXP1.9 GND - * ANET-LCD.2 +5V | +5V | +5V | EXP1.10 +5V | EXP1.10 +5V - * ANET-LCD.3 27 A4 | N/C * | LCD_PINS_RS | EXP1.4 LCD_PINS_RS | EXP2.4 SDSS or N/C * - * ANET-LCD.4 10 | LCD_PINS_D4 | BTN_EN2 | EXP2.3 BTN_EN2 | EXP2.3 BTN_EN2 - * ANET-LCD.5 28 A3 | LCD_PINS_RS | LCD_PINS_ENABLE | EXP1.3 LCD_PINS_ENABLE | EXP1.1 BEEPER_PIN - * ANET-LCD.6 11 | LCD_PINS_D5 | BTN_EN1 | EXP2.5 BTN_EN1 | EXP2.5 BTN_EN1 - * ANET-LCD.7 29 A2 | LCD_PINS_ENABLE | N/C * | EXP2.4 SDSS or N/C * | EXP1.3 LCD_PINS_ENABLE - * ANET-LCD.8 16 SCL | LCD_PINS_D6 | BTN_ENC | EXP1.2 BTN_ENC | EXP1.2 BTN_ENC - * ANET-LCD.9 30 A1 | ADC_KEYPAD_PIN ** | LCD_PINS_D4 | EXP1.5 LCD_PINS_D4 | EXP1.4 LCD_PINS_RS - * ANET-LCD.10 17 SDA | LCD_PINS_D7 | BEEPER_PIN | EXP1.1 BEEPER_PIN | EXP1.5 LCD_PINS_D4 - * - * N/C * - if not connected to the LCD can be used for BLTouch servo input - * ** - analog pin -WITHOUT a pullup - * *** - only connected to something if the Bluetooth module is populated - */ - -/** - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * physical pin function - * EXP1.1 BEEPER - * EXP1.2 BTN_ENC - * EXP1.3 LCD_PINS_ENABLE - * EXP1.4 LCD_PINS_RS - * EXP1.5 LCD_PINS_D4 - * EXP1.6 LCD_PINS_D5 (not used) - * EXP1.7 LCD_PINS_D6 (not used) - * EXP1.8 LCD_PINS_D7 (not used) - * EXP1.9 GND - * EXP1.10 VCC - * - * - * EXP2.1 MISO - * EXP2.2 SCK - * EXP2.3 BTN_EN2 - * EXP2.4 SDSS - * EXP2.5 BTN_EN1 - * EXP2.6 MOSI - * EXP2.7 SD_DETECT_PIN - * EXP2.8 button - * EXP2.9 GND - * EXP2.10 NC - */ diff --git a/Marlin/pins_AZTEEG_X1.h b/Marlin/pins_AZTEEG_X1.h deleted file mode 100644 index 17290d1108..0000000000 --- a/Marlin/pins_AZTEEG_X1.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Azteeg X1 pin assignments - */ - -#define BOARD_NAME "Azteeg X1" - -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h deleted file mode 100644 index 0abc9b87d6..0000000000 --- a/Marlin/pins_AZTEEG_X3.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 6 // Define before RAMPS pins include -#endif -#define BOARD_NAME "Azteeg X3" - -#include "pins_RAMPS_13.h" - -// -// Servos -// -#undef SERVO0_PIN -#undef SERVO1_PIN -#define SERVO0_PIN 44 // SERVO1 port -#define SERVO1_PIN 55 // SERVO2 port - -// -// LCD / Controller -// -#undef STAT_LED_RED_PIN -#undef STAT_LED_BLUE_PIN - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef BTN_ENC - #define DOGLCD_A0 31 - #define DOGLCD_CS 32 - #define BTN_ENC 12 - - #define STAT_LED_RED_PIN 64 - #define STAT_LED_BLUE_PIN 63 - -#else - - #define STAT_LED_RED_PIN 6 - #define STAT_LED_BLUE_PIN 11 - -#endif - -// -// Misc -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN - #undef STAT_LED_RED_PIN -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3 board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) - #undef SDA // use EXP3 header - #undef SCL - #if SERVO0_PIN == 7 - #undef SERVO0_PIN - #define SERVO0_PIN 11 - #endif - #define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 21 -#endif diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h deleted file mode 100644 index fa17120651..0000000000 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ /dev/null @@ -1,177 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AZTEEG_X3_PRO (Arduino Mega) pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 5 || E_STEPPERS > 5 - #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Azteeg X3 Pro" - -// -// RAMPS pins overrides -// -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 44 -#endif - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif - -#include "pins_RAMPS.h" - -// DIGIPOT slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT 0x2C (0x58 <- 0x2C << 1) -#define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT 0x2E (0x5C <- 0x2E << 1) - -// -// Servos -// -// Tested this pin with bed leveling on a Delta with 1 servo. -// Physical wire attachment on EXT1: GND, 5V, D47. -// -#undef SERVO0_PIN -#define SERVO0_PIN 47 - -// -// Limit Switches -// -// Swap the MIN and MAX endstop pins because the X3 Pro comes with only -// MIN endstop pin headers soldered onto the board. -// -#if ENABLED(DELTA) - #undef X_MIN_PIN - #undef X_MAX_PIN - #undef Y_MIN_PIN - #undef Y_MAX_PIN - #undef Z_MIN_PIN - #undef Z_MAX_PIN - - #define X_MIN_PIN 2 - #define X_MAX_PIN 3 - #define Y_MIN_PIN 15 - #define Y_MAX_PIN 14 - #define Z_MIN_PIN 19 - #define Z_MAX_PIN 18 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 18 -#endif - -// -// Steppers -// -#define E2_STEP_PIN 23 -#define E2_DIR_PIN 25 -#define E2_ENABLE_PIN 40 - -#define E3_STEP_PIN 27 -#define E3_DIR_PIN 29 -#define E3_ENABLE_PIN 41 - -#define E4_STEP_PIN 43 -#define E4_DIR_PIN 37 -#define E4_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_2_PIN 12 // Analog Input -#define TEMP_3_PIN 11 // Analog Input -#define TEMP_4_PIN 10 // Analog Input -#define TC1 4 // Analog Input (Thermo couple on Azteeg X3Pro) -#define TC2 5 // Analog Input (Thermo couple on Azteeg X3Pro) - -// -// Heaters / Fans -// -#define HEATER_2_PIN 16 -#define HEATER_3_PIN 17 -#define HEATER_4_PIN 4 -#define HEATER_5_PIN 5 -#define HEATER_6_PIN 6 -#define HEATER_7_PIN 11 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable) -#endif - -// Fans/Water Pump to cool the hotend cool side. -#define ORIG_E0_AUTO_FAN_PIN 5 -#define ORIG_E1_AUTO_FAN_PIN 5 -#define ORIG_E2_AUTO_FAN_PIN 5 -#define ORIG_E3_AUTO_FAN_PIN 5 - -// -// LCD / Controller -// -#undef BEEPER_PIN -#define BEEPER_PIN 33 - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 49 // For easy adapter board - #undef BEEPER_PIN - #define BEEPER_PIN 12 // 33 isn't physically available to the LCD display -#else - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 -#endif - -// -// Misc. Functions -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN - #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it - #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3pro board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) // EXP2 header - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #undef BTN_EN2 - #define BTN_EN2 31 // need 7 for the spindle speed PWM - #endif - #define SPINDLE_LASER_PWM_PIN 7 // must have a hardware PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 21 -#endif - diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h deleted file mode 100644 index d763392c5d..0000000000 --- a/Marlin/pins_BAM_DICE_DUE.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * BAM&DICE Due (Arduino Mega) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "2PrintBeta Due" - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 66 // Pin should have a pullup/pulldown! -#define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - -#include "pins_RAMPS.h" - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#define TEMP_0_PIN 9 // Analog Input -#define TEMP_1_PIN 11 // Analog Input diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h deleted file mode 100644 index f80379eda2..0000000000 --- a/Marlin/pins_BQ_ZUM_MEGA_3D.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * bq ZUM Mega 3D board definition - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "ZUM Mega 3D" - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 10 -#define RAMPS_D9_PIN 12 -#define RAMPS_D10_PIN 9 -#define MOSFET_D_PIN 7 - -// -// Auto fans -// -#define ORIG_E0_AUTO_FAN_PIN 11 -#define ORIG_E1_AUTO_FAN_PIN 6 -#define ORIG_E2_AUTO_FAN_PIN 6 -#define ORIG_E3_AUTO_FAN_PIN 6 - -// -// Misc. Functions -// -#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 42 - -#include "pins_RAMPS_13.h" - -// -// Limit Switches -// -#undef X_MAX_PIN -#define X_MAX_PIN 79 // 2 - -// -// Z Probe (when not Z_MIN_PIN) -// -#undef Z_MIN_PROBE_PIN -#define Z_MIN_PROBE_PIN 19 // IND_S_5V - -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 77 // 62 - -// -// Steppers -// -#define DIGIPOTSS_PIN 22 -#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } - -// -// Temperature Sensors -// -#undef TEMP_1_PIN -#define TEMP_1_PIN 14 // Analog Input (15) - -#undef TEMP_BED_PIN -#define TEMP_BED_PIN 15 // Analog Input (14) - -// -// Misc. Functions -// -#undef PS_ON_PIN // 12 -#define PS_ON_PIN 81 // External Power Supply - - -// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team -// decided to ship the printer only with the probe and no additional Z-min -// endstop and the instruction manual advises the user to connect the probe to -// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work. -#ifdef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PIN - #undef Z_MAX_PIN - #define Z_MIN_PIN 19 // IND_S_5V - #define Z_MAX_PIN 18 // Z-MIN Label -#endif - - -// -// This pin is used by the official Hephestos 2 heated bed upgrade kit -// -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef HEATER_BED_PIN - #define HEATER_BED_PIN 8 -#endif diff --git a/Marlin/pins_BRAINWAVE.h b/Marlin/pins_BRAINWAVE.h deleted file mode 100644 index a43c6be95c..0000000000 --- a/Marlin/pins_BRAINWAVE.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Brainwave 1.0 pin assignments (AT90USB646) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointer to a currently available Arduino IDE extension that will - * allow this board to use the latest Marlin software - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB - * This is the only known IDE extension that is compatible with the pin definitions - * in this file, Adrduino 1.6.12 and the latest mainstream Marlin software. - * - * "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share - * the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such - * that PWM1A, PWM1B & PWM1C can't be used. - * - * Installation: - * - * 1. In the Arduino IDE, under Files -> Preferences paste the following URL - * https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json - * 2. Under Tools -> Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB - * and then click on "Install" - * 3. Select "AT90USB646_TEENSYPP" from the 'Tools -> Boards' menu. - */ - -/** - * To burn the bootloader that comes with Marlin_AT90USB: - * - * 1. Connect your programmer to the board. - * 2. In Arduino IDE select "AT90USB646_TEENSYPP" and then select the programmer. - * 3. In Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB646__ - #error "Oops! Make sure you have 'AT90USB646_TEENSYPP' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Brainwave" - -// -// Limit Switches -// -#define X_STOP_PIN 35 // A7 -#define Y_STOP_PIN 34 // A6 -#define Z_STOP_PIN 33 // A5 - -// -// Steppers -// -#define X_STEP_PIN 3 // D3 -#define X_DIR_PIN 5 // D5 -#define X_ENABLE_PIN 4 // D4 -#define X_ATT_PIN 2 // D2 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 9 // E1 -#define Y_ENABLE_PIN 8 // E0 -#define Y_ATT_PIN 6 // D6 - -#define Z_STEP_PIN 11 // C1 -#define Z_DIR_PIN 13 // C3 -#define Z_ENABLE_PIN 12 // C2 -#define Z_ATT_PIN 10 // C0 - -#define E0_STEP_PIN 15 // C5 -#define E0_DIR_PIN 17 // C7 -#define E0_ENABLE_PIN 16 // C6 -#define E0_ATT_PIN 14 // C4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input -#define TEMP_BED_PIN 6 // F6 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 32 // A4 Extruder -#define HEATER_BED_PIN 18 // E6 Bed - -#ifndef FAN_PIN - #define FAN_PIN 31 // A3 Fan -#endif - -// -// Misc. Functions -// -#define LED_PIN 19 // E7 diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h deleted file mode 100644 index 49c8ab6b59..0000000000 --- a/Marlin/pins_BRAINWAVE_PRO.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Brainwave Pro pin assignments (AT90USB1286) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointers to currently available Arduino IDE extensions that will - * allow this board to use the latest Marlin software - * - * - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Brainwave Pro" - -// -// Limit Switches -// -#define X_STOP_PIN 45 // F7 -#define Y_STOP_PIN 12 // C2 -#define Z_STOP_PIN 36 // E4 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 11 // C1 -#endif - -// -// Steppers -// -#define X_STEP_PIN 9 // E1 -#define X_DIR_PIN 8 // E0 -#define X_ENABLE_PIN 23 // B3 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 6 // D6 -#define Y_ENABLE_PIN 20 // B0 - -#define Z_STEP_PIN 5 // D5 -#define Z_DIR_PIN 4 // D4 -#define Z_ENABLE_PIN 37 // E5 - -#define E0_STEP_PIN 47 // E3 -#define E0_DIR_PIN 46 // E2 -#define E0_ENABLE_PIN 25 // B5 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // F2 Analog Input -#define TEMP_1_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 27 // B7 -#define HEATER_BED_PIN 26 // B6 Bed -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 Fan, PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define SD_DETECT_PIN 24 // B4 -#define LED_PIN 13 // C3 diff --git a/Marlin/pins_CHEAPTRONIC.h b/Marlin/pins_CHEAPTRONIC.h deleted file mode 100644 index e8f2c5f67e..0000000000 --- a/Marlin/pins_CHEAPTRONIC.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Cheaptronic v1.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Cheaptronic v1.0" -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 2 -#define Z_STOP_PIN 5 - -// -// Steppers -// -#define X_STEP_PIN 14 -#define X_DIR_PIN 15 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 35 -#define Y_DIR_PIN 36 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 41 -#define Z_ENABLE_PIN 37 - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 25 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 // Analog Input -#define TEMP_1_PIN 14 // Analog Input -#define TEMP_BED_PIN 13 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 19 // EXTRUDER 1 -#define HEATER_1_PIN 23 // EXTRUDER 2 -#define HEATER_BED_PIN 22 - -// -// LCD / Controller -// -// Cheaptronic v1.0 doesn't support LCD -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 - -// Cheaptronic v1.0 doesn't support keypad -#define BTN_EN1 -1 -#define BTN_EN2 -1 -#define BTN_ENC -1 diff --git a/Marlin/pins_CHEAPTRONICv2.h b/Marlin/pins_CHEAPTRONICv2.h deleted file mode 100644 index eea57d23ec..0000000000 --- a/Marlin/pins_CHEAPTRONICv2.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Cheaptronic v2.0 pin assignments - * Built and sold by Michal Dyntar - RRO - * www.reprapobchod.cz - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Cheaptronic v2.0" - -// -// Limit Switches -// -#define X_MIN_PIN 30 -#define X_MAX_PIN 31 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 33 -#define Z_MIN_PIN 34 -#define Z_MAX_PIN 35 - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 22 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 25 -#define E1_ENABLE_PIN 27 - -#define E2_STEP_PIN 29 -#define E2_DIR_PIN 28 -#define E2_ENABLE_PIN 39 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 -#define TEMP_1_PIN 13 -#define TEMP_2_PIN 14 -#define TEMP_3_PIN 11 // should be used for chamber temperature control -#define TEMP_BED_PIN 12 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 6 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 9 -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif -#define FAN2_PIN 58 // additional fan or light control output - -// -// Other board specific pins -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 37 // board input labeled as F-DET -#endif -#define Z_MIN_PROBE_PIN 36 // additional external board input labeled as E-SENS (should be used for Z-probe) -#define LED_PIN 13 -#define SPINDLE_ENABLE_PIN 4 // additional PWM pin 1 at JP1 connector - should be used for laser control too -#define EXT_2 5 // additional PWM pin 2 at JP1 connector -#define EXT_3 2 // additional PWM pin 3 at JP1 connector -#define PS_ON_PIN 45 -#define KILL_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // shared with TEMP_3 analog input -#endif - -// -// LCD -// -#define LCD_PINS_RS 19 -#define LCD_PINS_ENABLE 42 -#define LCD_PINS_D4 18 -#define LCD_PINS_D5 38 -#define LCD_PINS_D6 41 -#define LCD_PINS_D7 40 - -// -// SD CARD, ROTARY ENCODER, BEEPER -// -#define SDPOWER -1 -#define SDSS 53 -#define SD_DETECT_PIN 49 -#define BEEPER_PIN 44 -#define BTN_EN1 11 -#define BTN_EN2 12 -#define BTN_ENC 43 diff --git a/Marlin/pins_CNCONTROLS_11.h b/Marlin/pins_CNCONTROLS_11.h deleted file mode 100644 index 0a32d04a18..0000000000 --- a/Marlin/pins_CNCONTROLS_11.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * CartesioV11 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. -#endif - -#define BOARD_NAME "CN Controls V11" - -// -// Limit Switches -// -#define X_STOP_PIN 43 -#define Y_STOP_PIN 45 -#define Z_STOP_PIN 42 - -// -// Steppers -// -#define X_STEP_PIN 34 -#define X_DIR_PIN 36 -#define X_ENABLE_PIN 35 - -#define Y_STEP_PIN 37 -#define Y_DIR_PIN 39 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 41 - -#define E0_STEP_PIN 29 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 3 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 15 -#define E2_DIR_PIN 14 -#define E2_ENABLE_PIN 16 - -#define E3_STEP_PIN 44 -#define E3_DIR_PIN 49 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 3 // Analog Input. 3 for tool2 -> 2 for chambertemp -#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 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 5 -#define HEATER_1_PIN 58 -#define HEATER_2_PIN 64 -#define HEATER_3_PIN 46 -#define HEATER_BED_PIN 2 - -#ifndef FAN_PIN - //#define FAN_PIN 7 // common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 13 - -// Tools - -//#define TOOL_0_PIN 4 -//#define TOOL_1_PIN 59 -//#define TOOL_2_PIN 8 -//#define TOOL_3_PIN 30 -//#define TOOL_PWM_PIN 7 // common PWM pin for all tools - -// Common I/O - -//#define FIL_RUNOUT_PIN -1 -//#define PWM_1_PIN 11 -//#define PWM_2_PIN 10 -//#define SPARE_IO 12 - -// -// LCD / Controller -// -#define BEEPER_PIN 6 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 26 -#define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 -#define DOGLCD_SCK -1 - -#define BTN_EN1 23 -#define BTN_EN2 25 -#define BTN_ENC 27 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 19 -#define SHIFT_LD 18 -#define SHIFT_CLK 17 - -//#define UI1 31 -//#define UI2 22 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 31 diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h deleted file mode 100644 index f073b19c96..0000000000 --- a/Marlin/pins_CNCONTROLS_12.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * CartesioV12 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. -#endif - -#define BOARD_NAME "CN Controls V12" - -// -// Limit Switches -// -#define X_STOP_PIN 19 -#define Y_STOP_PIN 22 -#define Z_STOP_PIN 23 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 26 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 30 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 31 -#define Z_DIR_PIN 33 -#define Z_ENABLE_PIN 32 - -#define E0_STEP_PIN 57 -#define E0_DIR_PIN 55 -#define E0_ENABLE_PIN 58 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 46 -#define E2_DIR_PIN 66 -#define E2_ENABLE_PIN 44 - -#define E3_STEP_PIN 45 -#define E3_DIR_PIN 69 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 9 // Analog Input. 9 for tool2 -> 13 for chambertemp -#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 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 11 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 3 -#define HEATER_BED_PIN 24 - -#ifndef FAN_PIN - #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 15 - -// Tools - -//#define TOOL_0_PIN 56 -//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder -//#define TOOL_1_PIN 59 -//#define TOOL_1_PWM_PIN 8 // lights at dual extruder -//#define TOOL_2_PIN 4 -//#define TOOL_2_PWM_PIN 5 -//#define TOOL_3_PIN 14 -//#define TOOL_3_PWM_PIN 2 - -// Common I/O - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 18 -#endif -//#define PWM_1_PIN 12 -//#define PWM_2_PIN 13 -//#define SPARE_IO 17 - -// -// LCD / Controller -// -#define BEEPER_PIN 16 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 39 -#define DOGLCD_CS 35 -#define DOGLCD_MOSI 48 -#define DOGLCD_SCK 49 -#define LCD_SCREEN_ROT_180 - -// The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 42 -#define SHIFT_LD 41 -#define SHIFT_CLK 40 - -//#define UI1 43 -//#define UI2 37 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN diff --git a/Marlin/pins_EINSY_RAMBO.h b/Marlin/pins_EINSY_RAMBO.h deleted file mode 100644 index e3f67059fa..0000000000 --- a/Marlin/pins_EINSY_RAMBO.h +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Einsy-Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Einsy Rambo" - -// -// TMC2130 Configuration_adv defaults for EinsyRambo -// -#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRambo." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_STOP_PIN 12 - #define Y_STOP_PIN 11 - #define Z_STOP_PIN 10 - -#else - - #define X_STOP_PIN X_DIAG_PIN - #define Y_STOP_PIN Y_DIAG_PIN - - #if ENABLED(BLTOUCH) - #define Z_STOP_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_STOP_PIN 10 - #endif - -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif - -#ifndef FAN1_PIN - #define FAN1_PIN 6 -#endif - -// -// Misc. Functions -// -#define SDSS 77 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 32 - - #if ENABLED(NEWPANEL) - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 61 - #define BTN_EN2 59 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 61 - #define LCD_PINS_D4 59 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - #define SD_DETECT_PIN 15 - - #endif // NEWPANEL -#endif // ULTRA_LCD diff --git a/Marlin/pins_EINSY_RETRO.h b/Marlin/pins_EINSY_RETRO.h deleted file mode 100644 index a100d9329e..0000000000 --- a/Marlin/pins_EINSY_RETRO.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Einsy-Retro pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Einsy Retro" - -// -// TMC2130 Configuration_adv defaults for EinsyRetro -// -#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_MIN_PIN 12 - #define Y_MIN_PIN 11 - #define Z_MIN_PIN 10 - #define X_MAX_PIN 81 - #define Y_MAX_PIN 57 - -#else - - #if X_HOME_DIR == -1 - #define X_MIN_PIN X_DIAG_PIN - #define X_MAX_PIN 81 - #else - #define X_MIN_PIN 12 - #define X_MAX_PIN X_DIAG_PIN - #endif - - #if Y_HOME_DIR == -1 - #define Y_MIN_PIN Y_DIAG_PIN - #define Y_MAX_PIN 57 - #else - #define Y_MIN_PIN 11 - #define Y_MAX_PIN Y_DIAG_PIN - #endif - - #if ENABLED(BLTOUCH) - #define Z_MIN_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_MIN_PIN 10 - #endif - -#endif - -#define Z_MAX_PIN 7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 32 - - #if ENABLED(NEWPANEL) - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 18 - #define BTN_EN2 19 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 - #define LCD_PINS_D4 19 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - #define SD_DETECT_PIN 15 - - #endif // NEWPANEL -#endif // ULTRA_LCD diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h deleted file mode 100644 index 79a4bce712..0000000000 --- a/Marlin/pins_ELEFU_3.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Elefu RA Board Pin Assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Elefu Ra v3" - -// -// Limit Switches -// -#define X_MIN_PIN 35 -#define X_MAX_PIN 34 -#define Y_MIN_PIN 33 -#define Y_MAX_PIN 32 -#define Z_MIN_PIN 31 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 49 -#define X_DIR_PIN 13 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 11 -#define Y_DIR_PIN 9 -#define Y_ENABLE_PIN 12 - -#define Z_STEP_PIN 7 -#define Z_DIR_PIN 6 -#define Z_ENABLE_PIN 8 - -#define E0_STEP_PIN 40 -#define E0_DIR_PIN 41 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 18 -#define E1_DIR_PIN 19 -#define E1_ENABLE_PIN 38 - -#define E2_STEP_PIN 43 -#define E2_DIR_PIN 47 -#define E2_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 3 // Analog Input -#define TEMP_1_PIN 2 // Analog Input -#define TEMP_2_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 45 // 12V PWM1 -#define HEATER_1_PIN 46 // 12V PWM2 -#define HEATER_2_PIN 17 // 12V PWM3 -#define HEATER_BED_PIN 44 // DOUBLE 12V PWM - -#ifndef FAN_PIN - #define FAN_PIN 16 // 5V PWM -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 10 // Set to -1 if using a manual switch on the PWRSW Connector -#define SLEEP_WAKE_PIN 26 // This feature still needs work -#define PHOTOGRAPH_PIN 29 - -// -// LCD / Controller -// -#define BEEPER_PIN 36 - -#if ENABLED(RA_CONTROL_PANEL) - - #define SDSS 53 - #define SD_DETECT_PIN 28 - - #define BTN_EN1 14 - #define BTN_EN2 39 - #define BTN_ENC 15 - -#endif // RA_CONTROL_PANEL - -#if ENABLED(RA_DISCO) - // variables for which pins the TLC5947 is using - #define TLC_CLOCK_PIN 25 - #define TLC_BLANK_PIN 23 - #define TLC_XLAT_PIN 22 - #define TLC_DATA_PIN 24 - - // We also need to define pin to port number mapping for the 2560 to match the pins listed above. - // If you change the TLC pins, update this as well per the 2560 datasheet! This currently only works with the RA Board. - #define TLC_CLOCK_BIT 3 - #define TLC_CLOCK_PORT &PORTA - - #define TLC_BLANK_BIT 1 - #define TLC_BLANK_PORT &PORTA - - #define TLC_DATA_BIT 2 - #define TLC_DATA_PORT &PORTA - - #define TLC_XLAT_BIT 0 - #define TLC_XLAT_PORT &PORTA - - // Change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful - // Leave it at at least 1 if you have enabled RA_LIGHTING - // The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module. - #define NUM_TLCS 2 - - // These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. - // Modify them according to your specific situation. - // NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs. - #define TRANS_ARRAY { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8 } // forward - //#define TRANS_ARRAY { 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15 } // backward -#endif // RA_DISCO diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h deleted file mode 100644 index 5d6765c840..0000000000 --- a/Marlin/pins_FELIX2.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Felix 2.0+" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#include "pins_RAMPS.h" - -// -// Misc. Functions -// -#undef SDPOWER -#define SDPOWER 1 - -#define PS_ON_PIN 12 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define SD_DETECT_PIN 6 - -#endif // NEWPANEL && ULTRA_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not valid with this board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN diff --git a/Marlin/pins_GEN3_MONOLITHIC.h b/Marlin/pins_GEN3_MONOLITHIC.h deleted file mode 100644 index 5d64e94290..0000000000 --- a/Marlin/pins_GEN3_MONOLITHIC.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen3 Monolithic Electronics pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644P__ - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen3 Monolithic" -#define DEBUG_PIN 0 - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 // actually uses Y_enable_pin - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 // shared with X_enable_pin - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 12 -#define E0_DIR_PIN 17 -#define E0_ENABLE_PIN 3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 16 - -// -// Misc. Functions -// -#define PS_ON_PIN 14 // Alex, does this work on the card? - -// Alex extras from Gen3+ diff --git a/Marlin/pins_GEN3_PLUS.h b/Marlin/pins_GEN3_PLUS.h deleted file mode 100644 index 85c47305b3..0000000000 --- a/Marlin/pins_GEN3_PLUS.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen3+ pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen3+" - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 17 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 13 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 5 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 12 -#define HEATER_BED_PIN 16 - -// -// Misc. Functions -// -#define SDSS 4 -#define PS_ON_PIN 14 diff --git a/Marlin/pins_GEN6.h b/Marlin/pins_GEN6.h deleted file mode 100644 index 1c5e2069ae..0000000000 --- a/Marlin/pins_GEN6.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen6 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Gen6" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 4 // Edited @ EJE Electronics 20100715 -#define E0_DIR_PIN 2 // Edited @ EJE Electronics 20100715 -#define E0_ENABLE_PIN 3 // Added @ EJE Electronics 20100715 - -// -// Temperature Sensor -// -#define TEMP_0_PIN 5 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 14 // changed @ rkoeppl 20110410 - -#if !MB(GEN6) - #define HEATER_BED_PIN 1 // changed @ rkoeppl 20110410 - #define TEMP_BED_PIN 0 // Analog Input -#endif - -// -// Misc. Functions -// -#define SDSS 17 -#define DEBUG_PIN 0 -#define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin/pins_GEN6_DELUXE.h b/Marlin/pins_GEN6_DELUXE.h deleted file mode 100644 index 5834068667..0000000000 --- a/Marlin/pins_GEN6_DELUXE.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen6 Deluxe pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#define BOARD_NAME "Gen6 Deluxe" - -#include "pins_GEN6.h" diff --git a/Marlin/pins_GEN7_12.h b/Marlin/pins_GEN7_12.h deleted file mode 100644 index 1afaae9abc..0000000000 --- a/Marlin/pins_GEN7_12.h +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.1, v1.2, v1.3 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Gen7 v1.1 / 1.2" -#endif - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 7 -#define Y_MIN_PIN 5 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 -#define Y_MAX_PIN 2 -#define X_MAX_PIN 6 - - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 0 -#endif - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#if !defined(FAN_PIN) && GEN7_VERSION < 13 // Gen7 v1.3 removed the fan pin - #define FAN_PIN 31 -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -#if GEN7_VERSION < 13 - #define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM -#endif - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! -#define SPINDLE_DIR_PIN 11 -#if GEN7_VERSION < 13 - #define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM -#endif diff --git a/Marlin/pins_GEN7_13.h b/Marlin/pins_GEN7_13.h deleted file mode 100644 index 749a6c3389..0000000000 --- a/Marlin/pins_GEN7_13.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.3 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#define BOARD_NAME "Gen7 v1.3" - -#define GEN7_VERSION 13 // v1.3 -#include "pins_GEN7_12.h" diff --git a/Marlin/pins_GEN7_14.h b/Marlin/pins_GEN7_14.h deleted file mode 100644 index dedd227ca0..0000000000 --- a/Marlin/pins_GEN7_14.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.4 pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen7 v1.4" - -#define GEN7_VERSION 14 // v1.4 - -// -// Limit switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 29 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 27 -#define Y_DIR_PIN 26 -#define Y_ENABLE_PIN 25 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 25 - -#define E0_STEP_PIN 19 -#define E0_DIR_PIN 18 -#define E0_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -// -// Misc. Functions -// -#define PS_ON_PIN 15 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM - -// A pin for debugging -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 21 diff --git a/Marlin/pins_GEN7_CUSTOM.h b/Marlin/pins_GEN7_CUSTOM.h deleted file mode 100644 index fdfb6b5fa1..0000000000 --- a/Marlin/pins_GEN7_CUSTOM.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 Alfons3 board pin assignments - * - * These Pins are assigned for the modified GEN7 Board from Alfons3. - * Please review the pins and adjust them for your needs. - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen7 Custom" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 // different from standard GEN7 -#define X_DIR_PIN 20 // different from standard GEN7 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 // (bed) - -// -// Misc. Functions -// -#define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support -#define PS_ON_PIN 19 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM - -// A pin for debugging -#define DEBUG_PIN -1 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -// 4bit LCD Support -#define LCD_PINS_RS 18 -#define LCD_PINS_ENABLE 17 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 15 -#define LCD_PINS_D6 13 -#define LCD_PINS_D7 14 - -// Buttons are directly attached -#define BTN_EN1 11 -#define BTN_EN2 10 -#define BTN_ENC 12 - -// RS485 pins -//#define TX_ENABLE_PIN 12 -//#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin/pins_GT2560_REV_A.h b/Marlin/pins_GT2560_REV_A.h deleted file mode 100644 index 63f166ab32..0000000000 --- a/Marlin/pins_GT2560_REV_A.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Geeetech GT2560 Revision A board pin assignments, based on the work of - * George Robles (https://georges3dprinters.com) and - * Richard Smith - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "GT2560 Rev.A" -#endif -#define DEFAULT_MACHINE_NAME "Prusa i3 Pro B" - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 -#define TEMP_1_PIN 9 -#define TEMP_BED_PIN 10 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDPOWER -1 -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing -#define KILL_PIN -1 - -#if ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 5 - #define DOGLCD_CS 21 - #define BTN_EN1 40 - #define BTN_EN2 42 - #else - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - #define BTN_EN1 42 - #define BTN_EN2 40 - #endif - - #define BTN_ENC 19 - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin/pins_GT2560_REV_A_PLUS.h b/Marlin/pins_GT2560_REV_A_PLUS.h deleted file mode 100644 index 99399e34ba..0000000000 --- a/Marlin/pins_GT2560_REV_A_PLUS.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Geeetech GT2560 Revision A+ board pin assignments - */ - -#define BOARD_NAME "GT2560 Rev.A+" - -#include "pins_GT2560_REV_A.h" - -#if ENABLED(BLTOUCH) - #define SERVO0_PIN 11 -#else - #define SERVO0_PIN 32 -#endif diff --git a/Marlin/pins_K8200.h b/Marlin/pins_K8200.h deleted file mode 100644 index cc3e731172..0000000000 --- a/Marlin/pins_K8200.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * K8200 Arduino Mega with RAMPS v1.3 pin assignments - * Identical to 3DRAG - */ - -#define BOARD_NAME "Velleman K8200" -#define DEFAULT_MACHINE_NAME "K8200" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" - -#include "pins_3DRAG.h" diff --git a/Marlin/pins_K8400.h b/Marlin/pins_K8400.h deleted file mode 100644 index 3e2cd4b212..0000000000 --- a/Marlin/pins_K8400.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Velleman K8400 (Vertex) - * 3DRAG clone - * - * K8400 has some minor differences over a normal 3Drag: - * - No X/Y max endstops - * - Second extruder step pin has moved - * - No power supply control - * - Second heater has moved pin - */ - -#define BOARD_NAME "K8400" -#define DEFAULT_MACHINE_NAME "Vertex" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/birkett/Vertex-K8400-Firmware" - -#include "pins_3DRAG.h" - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 - -#undef X_MIN_PIN -#undef X_MAX_PIN -#undef Y_MIN_PIN -#undef Y_MAX_PIN - -// -// Steppers -// -#undef E1_STEP_PIN -#define E1_STEP_PIN 32 - -// -// Heaters / Fans -// -#undef HEATER_1_PIN -#define HEATER_1_PIN 11 - -// -// Misc. Functions -// -#undef PS_ON_PIN -#undef KILL_PIN -#undef SD_DETECT_PIN - -#if Z_STEP_PIN == 26 - #undef Z_STEP_PIN - #define Z_STEP_PIN 32 -#endif diff --git a/Marlin/pins_LEAPFROG.h b/Marlin/pins_LEAPFROG.h deleted file mode 100644 index 9a31520e8a..0000000000 --- a/Marlin/pins_LEAPFROG.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Leapfrog Driver board pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Leapfrog" - -// -// Limit Switches -// -#define X_MIN_PIN 47 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 48 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 49 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 28 -#define X_DIR_PIN 63 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 14 // A6 -#define Y_DIR_PIN 15 // A0 -#define Y_ENABLE_PIN 39 - -#define Z_STEP_PIN 31 // A2 -#define Z_DIR_PIN 32 // A6 -#define Z_ENABLE_PIN 30 // A1 - -#define E0_STEP_PIN 34 // 34 -#define E0_DIR_PIN 35 // 35 -#define E0_ENABLE_PIN 33 // 33 - -#define E1_STEP_PIN 37 // 37 -#define E1_DIR_PIN 40 // 40 -#define E1_ENABLE_PIN 36 // 36 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input (D27) -#define TEMP_1_PIN 15 // Analog Input (1) -#define TEMP_BED_PIN 14 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 // 12 -#define HEATER_2_PIN 11 // 13 -#define HEATER_BED_PIN 10 // 14/15 - -#define FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 11 -#define LED_PIN 13 -#define SOL1_PIN 16 -#define SOL2_PIN 17 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin/pins_MAKEBOARD_MINI.h b/Marlin/pins_MAKEBOARD_MINI.h deleted file mode 100644 index 5dcf1e2180..0000000000 --- a/Marlin/pins_MAKEBOARD_MINI.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "pins_RAMPS.h" - -#undef BOARD_NAME -#define BOARD_NAME "MAKEBOARD_MINI" - -// -// Only 3 Limit Switch plugs on Micromake C1 -// -#undef X_MIN_PIN -#undef Y_MIN_PIN -#undef Z_MIN_PIN -#undef X_MAX_PIN -#undef Y_MAX_PIN -#undef Z_MAX_PIN -#define X_STOP_PIN 2 -#define Y_STOP_PIN 15 -#define Z_STOP_PIN 19 diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h deleted file mode 100644 index 709dc413be..0000000000 --- a/Marlin/pins_MEGACONTROLLER.h +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mega controller pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Mega Controller" - -// -// Servos -// -#define SERVO0_PIN 30 -#define SERVO1_PIN 31 -#define SERVO2_PIN 32 -#define SERVO3_PIN 33 - -// -// Limit Switches -// -#define X_MIN_PIN 43 -#define X_MAX_PIN 42 -#define Y_MIN_PIN 38 -#define Y_MAX_PIN 41 -#define Z_MIN_PIN 40 -#define Z_MAX_PIN 37 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 37 -#endif - -// -// Steppers -// -#define X_STEP_PIN 62 // A8 -#define X_DIR_PIN 63 // A9 -#define X_ENABLE_PIN 61 // A7 - -#define Y_STEP_PIN 65 // A11 -#define Y_DIR_PIN 66 // A12 -#define Y_ENABLE_PIN 64 // A10 - -#define Z_STEP_PIN 68 // A14 -#define Z_DIR_PIN 69 // A15 -#define Z_ENABLE_PIN 67 // A13 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 24 -#define E0_ENABLE_PIN 22 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 27 -#define E1_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 0 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input -#else - #define TEMP_1_PIN 2 // Analog Input -#endif - -#define TEMP_2_PIN 3 // Analog Input - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 6 // Analog Input -#else - #define TEMP_BED_PIN 1 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 29 -#define HEATER_1_PIN 34 -#define HEATER_BED_PIN 28 - -#ifndef FAN_PIN - #define FAN_PIN 39 -#endif -#define FAN1_PIN 35 -#define FAN2_PIN 36 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN FAN2_PIN -#endif - -#define FAN_SOFT_PWM - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#if ENABLED(MINIPANEL) - - #define BEEPER_PIN 46 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 47 - #define DOGLCD_CS 45 - #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 - - #define KILL_PIN 12 - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 48 - #define BTN_EN2 11 - #define BTN_ENC 10 - - #define SD_DETECT_PIN 49 - -#endif // MINIPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 7 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 8 diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h deleted file mode 100644 index 8b608eff88..0000000000 --- a/Marlin/pins_MEGATRONICS.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Megatronics" -// -// Limit Switches -// -#define X_MIN_PIN 41 -#define X_MAX_PIN 37 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 60 // A6 -#define Y_DIR_PIN 61 // A7 -#define Y_ENABLE_PIN 22 - -#define Z_STEP_PIN 54 // A0 -#define Z_DIR_PIN 55 // A1 -#define Z_ENABLE_PIN 56 // A2 - -#define E0_STEP_PIN 31 -#define E0_DIR_PIN 32 -#define E0_ENABLE_PIN 38 - -#define E1_STEP_PIN 34 -#define E1_DIR_PIN 36 -#define E1_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 8 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 // IO pin. Buffer needed -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#define BEEPER_PIN 33 - -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - // Buttons directly attached using AUX-2 - #define BTN_EN1 59 - #define BTN_EN2 64 - #define BTN_ENC 43 - - #define SD_DETECT_PIN -1 // RAMPS doesn't use this - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h deleted file mode 100644 index 9bd8b4506d..0000000000 --- a/Marlin/pins_MEGATRONICS_2.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics v2.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Megatronics v2.0" -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 4 // A6 -#define Y_DIR_PIN 54 // A0 -#define Y_ENABLE_PIN 5 - -#define Z_STEP_PIN 56 // A2 -#define Z_DIR_PIN 60 // A6 -#define Z_ENABLE_PIN 55 // A1 - -#define E0_STEP_PIN 35 -#define E0_DIR_PIN 36 -#define E0_ENABLE_PIN 34 - -#define E1_STEP_PIN 29 -#define E1_DIR_PIN 39 -#define E1_ENABLE_PIN 28 - -#define E2_STEP_PIN 23 // ? schematic says 24 -#define E2_DIR_PIN 24 // ? schematic says 23 -#define E2_ENABLE_PIN 22 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 8 // Analog Input -#else - #define TEMP_1_PIN 15 // Analog Input -#endif - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#define BEEPER_PIN 64 - -#define LCD_PINS_RS 14 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 30 -#define LCD_PINS_D5 31 -#define LCD_PINS_D6 32 -#define LCD_PINS_D7 33 - -// Buttons are directly attached using keypad -#define BTN_EN1 61 -#define BTN_EN2 59 -#define BTN_ENC 43 - -// Buttons that are attached using shift register of reprapworld keypad v1.1 -#define SHIFT_CLK 63 -#define SHIFT_LD 42 -#define SHIFT_OUT 17 -#define SHIFT_EN 17 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h deleted file mode 100644 index 119c63a585..0000000000 --- a/Marlin/pins_MEGATRONICS_3.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics v3.0 / v3.1 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if MB(MEGATRONICS_31) - #define BOARD_NAME "Megatronics v3.1" -#else - #define BOARD_NAME "Megatronics v3.0" -#endif - -// -// Servos -// -#define SERVO0_PIN 46 // AUX3-6 -#define SERVO1_PIN 47 // AUX3-5 -#define SERVO2_PIN 48 // AUX3-4 -#define SERVO3_PIN 49 // AUX3-3 - -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 58 -#define X_DIR_PIN 57 -#define X_ENABLE_PIN 59 - -#define Y_STEP_PIN 5 -#define Y_DIR_PIN 17 -#define Y_ENABLE_PIN 4 - -#define Z_STEP_PIN 16 -#define Z_DIR_PIN 11 -#define Z_ENABLE_PIN 3 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 29 - -#define E1_STEP_PIN 25 -#define E1_DIR_PIN 24 -#define E1_ENABLE_PIN 26 - -#define E2_STEP_PIN 22 -#define E2_DIR_PIN 60 -#define E2_ENABLE_PIN 23 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 11 // Analog Input -#else - #define TEMP_0_PIN 15 // Analog Input -#endif -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 10 // Analog Input -#else - #define TEMP_1_PIN 13 // Analog Input -#endif -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 9 // Analog Input -#else - #define TEMP_2_PIN 12 // Analog Input -#endif -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif -#define FAN1_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 45 // Try the keypad connector - -// -// LCD / Controller -// -#define BEEPER_PIN 61 - -#define BTN_EN1 44 -#define BTN_EN2 45 -#define BTN_ENC 33 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 56 // CS chip select / SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #define SD_DETECT_PIN 35 - -#else - - #define LCD_PINS_RS 32 - #define LCD_PINS_ENABLE 31 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 30 - #define LCD_PINS_D6 39 - #define LCD_PINS_D7 15 - - #define SHIFT_CLK 43 - #define SHIFT_LD 35 - #define SHIFT_OUT 34 - #define SHIFT_EN 44 - - #if MB(MEGATRONICS_31) - #define SD_DETECT_PIN 56 - #endif - -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 43 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 42 -#elif EXTRUDERS <= 2 - // Hijack the last extruder so that we can get the PWM signal off the Y breakout - // Move Y to the E2 plug. This makes dual Y steppers harder - #undef Y_ENABLE_PIN // 4 - #undef Y_STEP_PIN // 5 - #undef Y_DIR_PIN // 17 - #undef E2_ENABLE_PIN // 23 - #undef E2_STEP_PIN // 22 - #undef E2_DIR_PIN // 60 - #define Y_ENABLE_PIN 23 - #define Y_STEP_PIN 22 - #define Y_DIR_PIN 60 - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 5 -#endif diff --git a/Marlin/pins_MELZI.h b/Marlin/pins_MELZI.h deleted file mode 100644 index 79042f61dc..0000000000 --- a/Marlin/pins_MELZI.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi pin assignments - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Melzi" -#endif - -#define IS_MELZI -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/pins_MELZI_CREALITY.h b/Marlin/pins_MELZI_CREALITY.h deleted file mode 100644 index 8bfd3b860a..0000000000 --- a/Marlin/pins_MELZI_CREALITY.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi (Creality) pin assignments - * - * The Creality board needs a bootloader installed before Marlin can be uploaded. - * If you don't have a chip programmer you can use a spare Arduino plus a few - * electronic components to write the bootloader. - * - * See http://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/ - */ - -#define BOARD_NAME "Melzi (Creality)" - -#include "pins_MELZI.h" - -// For the stock CR-10 use the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -// option for the display in Configuration.h - -#undef LCD_SDSS -#undef LED_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef FIL_RUNOUT_PIN - -#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) -#define LCD_PINS_RS 28 // ST9720 CS -#define LCD_PINS_ENABLE 17 // ST9720 DAT -#define LCD_PINS_D4 30 // ST9720 CLK -#define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND - -// Alter timing for graphical display -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) -#endif - -#if ENABLED(MINIPANEL) - #undef DOGLCD_CS - #define DOGLCD_CS LCD_PINS_RS -#endif - -/** - PIN: 0 Port: B0 E0_DIR_PIN protected - PIN: 1 Port: B1 E0_STEP_PIN protected - PIN: 2 Port: B2 Z_DIR_PIN protected - PIN: 3 Port: B3 Z_STEP_PIN protected - PIN: 4 Port: B4 AVR_SS_PIN protected - . FAN_PIN protected - . SS_PIN protected - PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 - . MOSI_PIN Output = 1 - PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . MISO_PIN Input = 0 - PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SCK_PIN Output = 0 - PIN: 8 Port: D0 RXD Input = 1 - PIN: 9 Port: D1 TXD Input = 0 - PIN: 10 Port: D2 BTN_EN2 Input = 1 - PIN: 11 Port: D3 BTN_EN1 Input = 1 - PIN: 12 Port: D4 HEATER_BED_PIN protected - PIN: 13 Port: D5 HEATER_0_PIN protected - PIN: 14 Port: D6 E0_ENABLE_PIN protected - . X_ENABLE_PIN protected - . Y_ENABLE_PIN protected - PIN: 15 Port: D7 X_STEP_PIN protected - PIN: 16 Port: C0 BTN_ENC Input = 1 - . SCL Input = 1 - PIN: 17 Port: C1 LCD_PINS_ENABLE Output = 0 - . SDA Output = 0 - PIN: 18 Port: C2 X_MIN_PIN protected - . X_STOP_PIN protected - PIN: 19 Port: C3 Y_MIN_PIN protected - . Y_STOP_PIN protected - PIN: 20 Port: C4 Z_MIN_PIN protected - . Z_STOP_PIN protected - PIN: 21 Port: C5 X_DIR_PIN protected - PIN: 22 Port: C6 Y_STEP_PIN protected - PIN: 23 Port: C7 Y_DIR_PIN protected - PIN: 24 Port: A7 TEMP_0_PIN protected - PIN: 25 Port: A6 TEMP_BED_PIN protected - PIN: 26 Port: A5 Z_ENABLE_PIN protected - PIN: 27 Port: A4 BEEPER_PIN Output = 0 - PIN: 28 Port: A3 LCD_PINS_RS Output = 0 - PIN: 29 Port: A2 Input = 0 - PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 - PIN: 31 Port: A0 SDSS Output = 1 -*/ diff --git a/Marlin/pins_MELZI_MAKR3D.h b/Marlin/pins_MELZI_MAKR3D.h deleted file mode 100644 index 1b20d2ae09..0000000000 --- a/Marlin/pins_MELZI_MAKR3D.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi with ATmega1284 (MaKr3d version) pin assignments - */ - -#define BOARD_NAME "Melzi (ATmega1284)" -#include "pins_MELZI.h" diff --git a/Marlin/pins_MELZI_MALYAN.h b/Marlin/pins_MELZI_MALYAN.h deleted file mode 100644 index a81526f065..0000000000 --- a/Marlin/pins_MELZI_MALYAN.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi (Malyan M150) pin assignments - */ - -#define BOARD_NAME "Melzi (Malyan)" -#include "pins_MELZI.h" - -#undef LCD_SDSS -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC - -#define LCD_PINS_RS 17 // ST9720 CS -#define LCD_PINS_ENABLE 16 // ST9720 DAT -#define LCD_PINS_D4 11 // ST9720 CLK -#define BTN_EN1 30 -#define BTN_EN2 29 -#define BTN_ENC 28 - -// Alter timing for graphical display -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin/pins_MELZI_TRONXY.h b/Marlin/pins_MELZI_TRONXY.h deleted file mode 100644 index 0da7934302..0000000000 --- a/Marlin/pins_MELZI_TRONXY.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi pin assignments - */ - -#define BOARD_NAME "Melzi (Tronxy)" -#include "pins_MELZI.h" - -#undef Z_ENABLE_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC -#undef LCD_SDSS - -#define Z_ENABLE_PIN 14 -#define LCD_PINS_RS 30 -#define LCD_PINS_ENABLE 28 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 17 -#define LCD_PINS_D6 27 -#define LCD_PINS_D7 29 -#define BTN_EN1 10 -#define BTN_EN2 11 -#define BTN_ENC 26 - -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) -#endif diff --git a/Marlin/pins_MIGHTYBOARD_REVE.h b/Marlin/pins_MIGHTYBOARD_REVE.h deleted file mode 100644 index 989533d53e..0000000000 --- a/Marlin/pins_MIGHTYBOARD_REVE.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mightyboard Rev.E pin assignments - */ - -/** - * - * This is a starting-point to support the Makerbot Replicator series of 3D printers. - * It's not functional because Marlin has limited support for some features. - * Marlin will need the following augmentations before it will be supportable: - * - * - Support for two or more MAX6675 thermocouples - * - Support for multiple i2c buses to control the MCP4018 digital pots - * - Support for one additional unidirectional SPI bus, to read the thermocouples - * - Support for an RGB LED that may work differently from BLINKM - * - * The MCP4018 requires separate I2C buses because it has a fixed address (0x2F << 1 = 0x5E) - * The thermocouples share the same SCK and DO pins, with their own CS pins. - * The controller interface port connects to a 3-wire shift-register display controller - * - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - * - * Corrected pin assignment for MOSFET_B_PIN pin. Changed it from 9 to 11. The port - * number (B5) agrees with the schematic but B5 is assigned to logical pin 11. - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "MB Replicator" -#define BOARD_NAME "Mightyboard" - -// -// Servos -// -#define SERVO0_PIN 36 // C1 (1280-EX1) -#define SERVO1_PIN 37 // C0 (1280-EX2) -#define SERVO2_PIN 40 // G1 (1280-EX3) -#define SERVO3_PIN 41 // G0 (1280-EX4) - -// -// Limit Switches -// -#define X_MIN_PIN 49 // L0 -#define X_MAX_PIN 48 // L1 -#define Y_MIN_PIN 47 // L2 -#define Y_MAX_PIN 46 // L3 -#define Z_MIN_PIN 43 // L6 -#define Z_MAX_PIN 42 // L7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 42 -#endif - -// -// Steppers -// -#define X_STEP_PIN 55 // F1 -#define X_DIR_PIN 54 // F0 -#define X_ENABLE_PIN 56 // F2 - -#define Y_STEP_PIN 59 // F5 -#define Y_DIR_PIN 58 // F4 -#define Y_ENABLE_PIN 60 // F6 - -#define Z_STEP_PIN 63 // K1 -#define Z_DIR_PIN 62 // K0 -#define Z_ENABLE_PIN 64 // K2 - -#define E0_STEP_PIN 25 // A3 -#define E0_DIR_PIN 24 // A2 -#define E0_ENABLE_PIN 26 // A4 - -#define E1_STEP_PIN 29 // A7 -#define E1_DIR_PIN 28 // A6 -#define E1_ENABLE_PIN 39 // G2 - -// -// I2C Digipots - MCP4018 -// Address 5E (2F << 1) -// Set from 0 - 127 with stop bit. -// (Ex. 3F << 1 | 1) -// -#define DIGIPOTS_I2C_SCL 76 // J5 -#define DIGIPOTS_I2C_SDA_X 57 // F3 -#define DIGIPOTS_I2C_SDA_Y 61 // F7 -#define DIGIPOTS_I2C_SDA_Z 65 // K3 -#define DIGIPOTS_I2C_SDA_E0 27 // A5 -#define DIGIPOTS_I2C_SDA_E1 77 // J6 -#define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) - -// -// Temperature Sensors -// -#define TEMP_BED_PIN 15 // K7 - 69 / ADC15 - 15 - -// SPI for Max6675 or Max31855 Thermocouple -// Uses a separate SPI bus -// -// 3 E5 DO (SO) -// 5 E3 CS1 -// 2 E4 CS2 -// 78 E2 SCK -// -#define THERMO_SCK_PIN 78 // E2 -#define THERMO_DO_PIN 3 // E5 -#define THERMO_CS1 5 // E3 -#define THERMO_CS2 2 // E4 - -#define MAX6675_SS THERMO_CS1 -#define MAX6675_SCK_PIN THERMO_SCK_PIN -#define MAX6675_DO_PIN THERMO_DO_PIN -// -// Augmentation for auto-assigning plugs -// -// Two thermocouple connectors allows for either -// 2 extruders or 1 extruder and a heated bed. -// With no heated bed, an additional 24V fan is possible. -// -#define MOSFET_A_PIN 6 // H3 -#define MOSFET_B_PIN 11 // B5 - Rev A of this file had this pin assigned to 9 -#define MOSFET_C_PIN 45 // L4 -#define MOSFET_D_PIN 44 // L5 - -#if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_EEB - #else - #define IS_EEF - #endif -#elif TEMP_SENSOR_BED - #define IS_EFB -#else - #define IS_EFF -#endif - -// -// Heaters / Fans (24V) -// -#define HEATER_0_PIN MOSFET_A_PIN - -#if ENABLED(IS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN MOSFET_C_PIN -#elif ENABLED(IS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN MOSFET_B_PIN -#elif ENABLED(IS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN -#elif ENABLED(IS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN MOSFET_C_PIN -#endif - -#ifndef FAN_PIN - #if ENABLED(IS_EFB) || ENABLED(IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN MOSFET_B_PIN - #elif ENABLED(IS_EEF) || ENABLED(IS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN MOSFET_C_PIN - #else - #define FAN_PIN MOSFET_D_PIN - #endif -#endif - -// -// Extruder Auto Fan Pins -// -#define ORIG_E0_AUTO_FAN_PIN 7 // H4 -#define ORIG_E1_AUTO_FAN_PIN 12 // B6 - -// -// Misc. Functions -// -#define LED_PIN 13 // B7 -#define CUTOFF_RESET_PIN 16 // H1 -#define CUTOFF_TEST_PIN 17 // H0 -#define CASE_LIGHT_PIN 44 // L5 MUST BE HARDWARE PWM - -// -// LCD / Controller -// -#ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - - #define LCD_PINS_RS 33 // C4: LCD-STROBE - #define LCD_PINS_ENABLE 72 // J2: LEFT - #define LCD_PINS_D4 35 // C2: LCD-CLK - #define LCD_PINS_D5 32 // C5: RLED - #define LCD_PINS_D6 34 // C3: LCD-DATA - #define LCD_PINS_D7 31 // C6: GLED - - #define BTN_EN2 75 // J4, UP - #define BTN_EN1 73 // J3, DOWN - //STOP button connected as KILL_PIN - #define KILL_PIN 14 // J1, RIGHT - //KILL - not connected - - #define BEEPER_PIN 8 // H5, SD_WP - - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER - - //on board leds - #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2) - #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3) - -#else - // Replicator uses a 3-wire SR controller with HD44780 - // For now, pretend it's the SAV - // - - #define SAV_3DLCD - #define SR_DATA_PIN 34 // C3 - #define SR_CLK_PIN 35 // C2 - #define SR_STROBE_PIN 33 // C4 - - #define BTN_UP 75 // J4 - #define BTN_DOWN 73 // J3 - #define BTN_LEFT 72 // J2 - #define BTN_RIGHT 14 // J1 - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER - - #define BEEPER_PIN 4 // G5 - - #define STAT_LED_RED_PIN 32 // C5 - #define STAT_LED_BLUE_PIN 31 // C6 (Actually green) - -#endif - -// -// SD Card -// -#define SDSS 53 // B0 -#define SD_DETECT_PIN 9 // H6 - -#define MAX_PIN THERMO_SCK_PIN - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 66 // K4 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 8 // H5 MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 67 // K5 - - -// Check if all pins are defined in mega/pins_arduino.h -#include -static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h" - "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below"); - -/* in [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h -change: -#define NUM_DIGITAL_PINS 70 -to: -#define NUM_DIGITAL_PINS 80 - -to digital_pin_to_port_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_port_PGM[] = { -.... - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** -}; - -to digital_pin_to_bit_mask_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { -.... - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** -}; - -to digital_pin_to_timer_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { -.... - NOT_ON_TIMER , // PG 4 ** 70 ** - NOT_ON_TIMER , // PG 3 ** 71 ** - NOT_ON_TIMER , // PJ 2 ** 72 ** - NOT_ON_TIMER , // PJ 3 ** 73 ** - NOT_ON_TIMER , // PJ 7 ** 74 ** - NOT_ON_TIMER , // PJ 4 ** 75 ** - NOT_ON_TIMER , // PJ 5 ** 76 ** - NOT_ON_TIMER , // PJ 6 ** 77 ** - NOT_ON_TIMER , // PE 2 ** 78 ** - NOT_ON_TIMER , // PE 6 ** 79 ** -}; -*/ diff --git a/Marlin/pins_MINIRAMBO.h b/Marlin/pins_MINIRAMBO.h deleted file mode 100644 index 89335ea8d4..0000000000 --- a/Marlin/pins_MINIRAMBO.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mini-Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#if MB(MINIRAMBO_10A) - #define BOARD_NAME "Mini Rambo 1.0a" -#else - #define BOARD_NAME "Mini Rambo" -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 30 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 24 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 23 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 23 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 - -#define MOTOR_CURRENT_PWM_XY_PIN 46 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 44 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_1_PIN 7 -#if !MB(MINIRAMBO_10A) - #define HEATER_2_PIN 6 -#endif -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#if !MB(MINIRAMBO_10A) - #define CASE_LIGHT_PIN 9 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#if !MB(MINIRAMBO_10A) - #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 -#endif - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #if !MB(MINIRAMBO_10A) - #define KILL_PIN 32 - #endif - - #if ENABLED(NEWPANEL) - - #if MB(MINIRAMBO_10A) - - #define BEEPER_PIN 78 - - #define BTN_EN1 80 - #define BTN_EN2 73 - #define BTN_ENC 21 - - #define LCD_PINS_RS 38 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 15 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 31 - - #define SD_DETECT_PIN 72 - - #else // !MINIRAMBO_10A - - // AUX-4 - #define BEEPER_PIN 84 - - // AUX-2 - #define BTN_EN1 14 - #define BTN_EN2 72 - #define BTN_ENC 9 - - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 - #define LCD_PINS_D4 19 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - - #define SD_DETECT_PIN 15 - - #endif // !MINIRAMBO_10A - - #endif // NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h deleted file mode 100644 index f5fdac21d2..0000000000 --- a/Marlin/pins_MINITRONICS.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Minitronics v1.0/1.1 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for M3, M4 & M5 spindle control commands - * - */ - -#ifndef __AVR_ATmega1281__ - #error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Minitronics v1.0 / v1.1" -// -// Limit Switches -// -#define X_MIN_PIN 5 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 2 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 6 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 48 -#define X_DIR_PIN 47 -#define X_ENABLE_PIN 49 - -#define Y_STEP_PIN 39 // A6 -#define Y_DIR_PIN 40 // A0 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 42 // A2 -#define Z_DIR_PIN 43 // A6 -#define Z_ENABLE_PIN 41 // A1 - -#define E0_STEP_PIN 45 -#define E0_DIR_PIN 44 -#define E0_ENABLE_PIN 27 - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 35 -#define E1_ENABLE_PIN 37 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input -#define TEMP_1_PIN 6 // Analog Input -#define TEMP_BED_PIN 6 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 7 // EXTRUDER 1 -#define HEATER_1_PIN 8 // EXTRUDER 2 -#define HEATER_BED_PIN 3 // BED - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif - -// -// Misc. Functions -// -#define SDSS 16 -#define LED_PIN 46 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 15 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 11 // SID (MOSI) - #define LCD_PINS_D4 10 // SCK (CLK) clock - - #define BTN_EN1 18 - #define BTN_EN2 17 - #define BTN_ENC 25 - - #define SD_DETECT_PIN 30 - -#else - - #define LCD_PINS_RS -1 - #define LCD_PINS_ENABLE -1 - - // Buttons are directly attached using keypad - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 - - #define SD_DETECT_PIN -1 // Minitronics doesn't use this -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) // assumes we're only doing CNC work (no 3D printing) - #undef HEATER_BED_PIN - #undef TEMP_BED_PIN // need to free up some pins but also need to - #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin - #undef TEMP_1_PIN // requires the presence of certain pins or else it - #define HEATER_BED_PIN 4 // won't compile - #define TEMP_BED_PIN 50 - #define TEMP_0_PIN 51 - #define SPINDLE_LASER_ENABLE_PIN 52 // using A6 because it already has a pullup - #define SPINDLE_LASER_PWM_PIN 3 // WARNING - LED & resistor pull up to +12/+24V stepper voltage - #define SPINDLE_DIR_PIN 53 -#endif diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h deleted file mode 100644 index 65c78e1486..0000000000 --- a/Marlin/pins_MKS_BASE.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments - * - * Rev B - Override pin definitions for CASE_LIGHT and M3/M4/M5 spindle control - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS BASE 1.0" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#define CASE_LIGHT_PIN 2 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 15 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -#include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_BASE_15.h b/Marlin/pins_MKS_BASE_15.h deleted file mode 100644 index e9f7050a1b..0000000000 --- a/Marlin/pins_MKS_BASE_15.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE v1.5 with A4982 stepper drivers and digital micro-stepping - */ - -#include "pins_MKS_BASE.h" - -/** - * Microstepping pins - */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 / SERVO2_PIN -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 / SERVO1_PIN -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 / SERVO3_PIN diff --git a/Marlin/pins_MKS_BASE_HEROIC.h b/Marlin/pins_MKS_BASE_HEROIC.h deleted file mode 100644 index 84f7280dfa..0000000000 --- a/Marlin/pins_MKS_BASE_HEROIC.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE with Heroic HR4982 stepper drivers - */ - -#include "pins_MKS_BASE_15.h" - -/** - * Some new boards use HR4982 (Heroic) instead of the A4982 (Allegro) stepper drivers. - * Most the functionality is similar, the HR variant obviously doesn't work with diode - * smoothers (no fast decay). And the Heroic has a 128 µStepping mode where the A4982 - * is doing quarter steps (MS1=0, MS2=1). - */ -#define HEROIC_STEPPER_DRIVERS diff --git a/Marlin/pins_MKS_GEN_13.h b/Marlin/pins_MKS_GEN_13.h deleted file mode 100644 index e0e916b878..0000000000 --- a/Marlin/pins_MKS_GEN_13.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 adjusted pin assignments - * - * MKS GEN v1.3 (Extruder, Fan, Bed) - * MKS GEN v1.3 (Extruder, Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Extruder, Fan, Bed) - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS GEN >= v1.3" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// PSU / SERVO -// -// If POWER_SUPPLY is specified, always hijack Servo 3 -// -#if POWER_SUPPLY > 0 - #define SERVO3_PIN -1 - #define PS_ON_PIN 4 -#endif - -#include "pins_RAMPS.h" - -// -// LCD / Controller -// -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - /** - * VIKI2 Has two groups of wires with... - * - * +Vin + Input supply, requires 120ma for LCD and mSD card - * GND Ground Pin - * MOSI Data input for LCD and SD - * MISO Data output for SD - * SCK Clock for LCD and SD - * AO Reg. Sel for LCD - * LCS Chip Select for LCD - * SDCS Chip Select for SD - * SDCD Card Detect pin for SD - * ENCA Encoder output A - * ENCB Encoder output B - * ENCBTN Encoder button switch - * - * BTN Panel mounted button switch - * BUZZER Piezo buzzer - * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered) - * RED-LED Red LED ring pin (3 to 5v, mosfet buffered) - * - * This configuration uses the following arrangement: - * - * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK - * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS - * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI - * D27 = A0 D29 = LCS D49 = SDCD RST = --- - * GND = GND 5V = 5V GND = --- D41 = --- - */ - - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef SD_DETECT_PIN - #undef BEEPER_PIN - #undef KILL_PIN - - // - // VIKI2 12-wire lead - // - - // orange/white SDCD - #define SD_DETECT_PIN 49 - - // white ENCA - #define BTN_EN1 35 - - // green ENCB - #define BTN_EN2 37 - - // purple ENCBTN - #define BTN_ENC 31 - - // brown A0 - #define DOGLCD_A0 27 - - // green/white LCS - #define DOGLCD_CS 29 - - // 50 gray MISO - // 51 yellow MOSI - // 52 orange SCK - - // blue SDCS - //#define SDSS 53 - - // - // VIKI2 4-wire lead - // - - // blue BTN - #define KILL_PIN 23 - - // green BUZZER - #define BEEPER_PIN 25 - - // yellow RED-LED - #define STAT_LED_RED_PIN 16 - - // white BLUE-LED - #define STAT_LED_BLUE_PIN 17 - -#endif diff --git a/Marlin/pins_MKS_GEN_L.h b/Marlin/pins_MKS_GEN_L.h deleted file mode 100644 index 59c5bcf481..0000000000 --- a/Marlin/pins_MKS_GEN_L.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS GEN L – Arduino Mega2560 with RAMPS v1.4 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS GEN L" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// CS Pins wired to avoid conflict with the LCD -// See https://www.thingiverse.com/asset:66604 -// - -#ifndef X_CS_PIN - #define X_CS_PIN 59 -#endif - -#ifndef Y_CS_PIN - #define Y_CS_PIN 63 -#endif - -#include "pins_RAMPS.h" diff --git a/Marlin/pins_OMCA.h b/Marlin/pins_OMCA.h deleted file mode 100644 index 6ee6fabe6b..0000000000 --- a/Marlin/pins_OMCA.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Open Motion controller with enable based extruders (Final!) - * - * ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - * REF http://sanguino.cc/hardware - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. (Final OMCA board)" -#endif - -#define BOARD_NAME "Final OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 25 -#define X_ENABLE_PIN 10 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 27 -#define Y_ENABLE_PIN 10 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 10 - -#define E0_STEP_PIN 24 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 10 - -#define E1_STEP_PIN -1 // 21 -#define E1_DIR_PIN -1 // 20 -#define E1_ENABLE_PIN -1 // 19 - -#define E2_STEP_PIN -1 // 21 -#define E2_DIR_PIN -1 // 20 -#define E2_ENABLE_PIN -1 // 18 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 // DONE PWM on RIGHT connector -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 14 // PWM on MIDDLE connector -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -#define I2C_SCL_PIN 16 -#define I2C_SDA_PIN 17 - -// future proofing -#define __FS 20 -#define __FD 19 -#define __GS 18 -#define __GD 13 - -#define UNUSED_PWM 14 // PWM on LEFT connector diff --git a/Marlin/pins_OMCA_A.h b/Marlin/pins_OMCA_A.h deleted file mode 100644 index 777c80b22f..0000000000 --- a/Marlin/pins_OMCA_A.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Open Motion controller with enable based extruders (Alpha!) - * - * ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644__ - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Alpha OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 -#define X_DIR_PIN 20 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN -1 // 19 -#define E1_DIR_PIN -1 // 18 -#define E1_ENABLE_PIN 24 - -#define E2_STEP_PIN -1 // 17 -#define E2_DIR_PIN -1 // 16 -#define E2_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (D27) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h deleted file mode 100644 index 42632d174a..0000000000 --- a/Marlin/pins_PRINTRBOARD.h +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Printrboard" - -// Disable JTAG pins so they can be used for the Extrudrboard -#define DISABLE_JTAG - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 20 // B0 SS -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_1_PIN 44 // F6 -#define HEATER_2_PIN 45 // F7 -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 26 // B6 SDCS -#define FILWIDTH_PIN 2 // Analog Input - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 8 // E0 JP11-10 - - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #undef SDSS - #define SDSS 43 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 3 // D3 RX1 JP2-7 - #define BTN_EN2 2 // D2 TX1 JP2-5 - #define BTN_ENC 41 // F3 JP2-4 - #undef SDSS - #define SDSS 38 // F0 B-THERM connector - use SD card on Panelolu2 - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif // ULTRA_LCD && NEWPANEL diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h deleted file mode 100644 index 8239a91586..0000000000 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - https://www.pjrc.com/teensy/teensyduino.html - * Installation - https://www.pjrc.com/teensy/td_download.html - * - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Note: With Teensyduino extension, the Arduino IDE will report 130048 bytes of program storage space available, - * but there is actually only 122880 bytes due to the larger DFU bootloader shipped by default on all Printrboard RevF. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular and easiest option. - */ - -/** - * To burn the bootloader that comes with Printrboard HID extension: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef USBCON - #error "USBCON should be defined by the platform for this board." -#endif - -#define BOARD_NAME "Printrboard Rev.F" -// Disable JTAG pins so EXP1 pins work correctly -// (Its pins are used for the Extrudrboard and filament sensor, for example). -#define DISABLE_JTAG - -/** - * Note that REV F6 of the Printrboard stole the A HOTEND pin and - * reassigned it to a second fan for the extruder heater. It's - * recommended that you swap the A and B outputs on the Extrudrboard - * so EXTRUDERS=2 will still work on F6, using B for E1/HEATER_1/TEMP_1. - * See https://printrbot.zendesk.com/hc/en-us/articles/115003072346 - * - * If you have REV F6 you probably also want to set E0_AUTO_FAN_PIN - * to PRINTRBOARD_F6_HEATER_FAN_PIN (44). - * - * Define NO_EXTRUDRBOARD if you don't have an EXTRUDRBOARD and wish to - * reassign different functions to EXP1. - * - * Define NO_EXTRUDRBOARD_OUTPUT_SWAP if you have a REV F5 or lower and - * want to use EXTRUDRBOARD A for E1 and EXTRUDRBOARD B for E2. - */ -//#define NO_EXTRUDRBOARD -//#define NO_EXTRUDRBOARD_OUTPUT_SWAP - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 24 // B4 PWM2A -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define E1_STEP_PIN 25 // B5 - #define E1_DIR_PIN 37 // E5 - #define E1_ENABLE_PIN 42 // F4 - - #define E2_STEP_PIN 2 // D2 - #define E2_DIR_PIN 3 // D3 - #define E2_ENABLE_PIN 43 // F5 -#else - #define E1_STEP_PIN 2 // D2 - #define E1_DIR_PIN 3 // D3 - #define E1_ENABLE_PIN 43 // F5 - - #define E2_STEP_PIN 25 // B5 - #define E2_DIR_PIN 37 // E5 - #define E2_ENABLE_PIN 42 // F4 -#endif -#endif // NO_EXTRUDRBOARD - -// Enable control of stepper motor currents with the I2C based MCP4728 DAC used on Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Set default drive strength percents if not already defined - X, Y, Z, E axis -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 70, 50, 70 } -#endif - -// Number of channels available for DAC -#define DAC_STEPPER_ORDER { 3, 2, 1, 0 } - -#define DAC_STEPPER_SENSE 0.11 -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 3520 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 1x = 2.048V -#define DAC_STEPPER_GAIN 0 -#define DAC_OR_ADDRESS 0x00 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input (Extruder) -#define TEMP_BED_PIN 0 // Analog Input (Bed) - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define TEMP_1_PIN 2 // Analog Input (Extrudrboard A THERM) - #define TEMP_2_PIN 3 // Analog Input (Extrudrboard B THERM) -#else - #define TEMP_1_PIN 3 // Analog Input (Extrudrboard B THERM) - #define TEMP_2_PIN 2 // Analog Input (Extrudrboard A THERM) -#endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define HEATER_1_PIN 44 // F6 - Extrudrboard A HOTEND - #define HEATER_2_PIN 45 // F7 - Extrudrboard B HOTEND -#else - #define HEATER_1_PIN 45 // F7 - Extrudrboard B HOTEND - #define HEATER_2_PIN 44 // F6 - Extrudrboard A HOTEND -#endif -#endif - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// LCD / Controller -// -//#define USE_INTERNAL_SD - -#if ENABLED(ULTRA_LCD) - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - - #define BEEPER_PIN 8 // E0 JP11-10 - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #define SDSS 3 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(MINIPANEL) - - #if DISABLED(USE_INTERNAL_SD) - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define SDSS 11 // 36 C1 EXP2-13 EXP2-07 - #define SD_DETECT_PIN 9 // 34 E1 EXP2-11 EXP2-04 - #endif - - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define DOGLCD_A0 4 // 29 D4 EXP2-05 EXP1-04 - #define DOGLCD_CS 5 // 30 D5 EXP2-06 EXP1-05 - #define BTN_ENC 6 // 31 D6 EXP2-07 EXP1-09 - #define BEEPER_PIN 7 // 32 D7 EXP2-08 EXP1-10 - #define KILL_PIN 8 // 33 E0 EXP2-10 EXP2-03 - #define BTN_EN1 10 // 35 C0 EXP2-12 EXP2-06 - #define BTN_EN2 12 // 37 C2 EXP2-14 EXP2-08 - //#define LCD_BACKLIGHT_PIN 43 // 56 F5 EXP1-12 Not Implemented - //#define SCK 21 // 11 B1 ICSP-04 EXP2-09 - //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 - //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 - - // increase delays - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(313) - #endif - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif - -// -// Misc. Functions -// -// PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. -#ifndef SDSS - #define SDSS 20 // 10 B0 -#endif - -/** - * This is EXP1-2, which is also the TEMP_A_PIN for the Extrudrboard. - * If using w/ Extrudrboard, cut off pin 2 on the Extrudrboard male - * connector to ensure this is disconnected from the A THERM pullups. - * You probably want to set EXTRUDERS=2 and swap the Extrudrboard outputs, - * which will let you use Channel B on the Extrudrboard as E1. - */ -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 2 // Analog Input -#endif diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h deleted file mode 100644 index 8c817642fe..0000000000 --- a/Marlin/pins_RAMBO.h +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * IMPORTANT NOTE: - * Rambo users should be sure to compile Marlin using either the RAMBo - * board type if using the Arduino IDE - available via the link below - or - * the 'rambo' environment if using platformio, by specifying '-e rambo' on - * the command line or by changing the value of the 'env_default' variable to - * 'rambo' in the supplied platformio.ini. - * - * If you don't compile using the proper board type, the RAMBo's extended - * pins will likely be unavailable and accessories/addons may not work. - * - * Instructions for installing the Arduino RAMBo board type for the - * Arduino IDE are available at: - * http://reprap.org/wiki/Rambo_firmware - */ - -/** - * Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Rambo" - -#define POWER_LOSS_DETECT_PIN 44 -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MAX_PIN 30 - -#if ENABLED(BLTOUCH) - #define Z_MIN_PIN 30 -#elif ENABLED(FIX_MOUNTED_PROBE) - #define Z_MIN_PIN 24 -#else - - #define Z_MIN_PIN 10 -#endif - - -// -// Servos -// -#define SERVO0_PIN 23/* X_MAX_PIN//22 // Motor header MX1*/ -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS { 4,5,3,0,1 } // X Y Z E0 E1 digipot channels to stepper driver mapping -#ifndef DIGIPOT_MOTOR_CURRENT - #define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 6 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 -#define FAN2_PIN 2 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 -#define CASE_LIGHT_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 31 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 32 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 84 // 84 in MK2 Firmware - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 80 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 70 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 72 - #define LCD_PINS_D5 73 - #define LCD_PINS_D6 74 - #define LCD_PINS_D7 75 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 - // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the - // beeper/buzzer is connected to pin 33; however, the pin used in the - // diagram is actually pin 44, so this is correct. - - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 85 - #define BTN_EN2 84 - #define BTN_ENC 83 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 - - #else // !VIKI2 && !miniVIKI - - #define BEEPER_PIN 79 - - // AUX-2 - #define BTN_EN1 76 - #define BTN_EN2 77 - #define BTN_ENC 78 - - #define SD_DETECT_PIN 81 - - #endif // !VIKI2 && !miniVIKI - - #else // !NEWPANEL - old style panel with shift register - - // No Beeper added - #define BEEPER_PIN 33 - - // buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - - #define LCD_PINS_RS 75 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h deleted file mode 100644 index 20d1cba520..0000000000 --- a/Marlin/pins_RAMPS.h +++ /dev/null @@ -1,572 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4" -#endif - -// -// Servos -// -#ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI -#else - #define SERVO0_PIN 11 -#endif -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 -#ifndef SERVO3_PIN - #define SERVO3_PIN 4 -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -/** - * Default pins for TMC software SPI - */ -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif - -#if HAS_DRIVER(TMC2208) - /** - * TMC2208 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - /** - * Software serial - */ - - #define X_SERIAL_TX_PIN 40 - #define X_SERIAL_RX_PIN 63 - #define X2_SERIAL_TX_PIN -1 - #define X2_SERIAL_RX_PIN -1 - - #define Y_SERIAL_TX_PIN 59 - #define Y_SERIAL_RX_PIN 64 - #define Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 - - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 - #define Z2_SERIAL_TX_PIN -1 - #define Z2_SERIAL_RX_PIN -1 - - #define E0_SERIAL_TX_PIN 44 - #define E0_SERIAL_RX_PIN 66 - #define E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif -#ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN 8 -#endif -#ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN 9 -#endif -#ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN 10 -#endif - -#define HEATER_0_PIN RAMPS_D10_PIN - -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN RAMPS_D9_PIN -#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN RAMPS_D8_PIN -#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") - #define HEATER_BED_PIN RAMPS_D8_PIN - #if HOTENDS == 1 - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif - -#ifndef FAN_PIN - #if ENABLED(IS_RAMPS_EFB) || ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #elif ENABLED(IS_RAMPS_EEF) || ENABLED(IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN - #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define FAN_PIN 4 // IO pin. Buffer needed - #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #endif -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif - -// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENABLE_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ - && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first - #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 5 - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ - && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN -#endif - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -#if ENABLED(ULTRA_LCD) - - // - // LCD Display output pins - // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - - #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) - - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - - #else - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 25 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 37 - #endif - - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - - #else - - #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #endif - - #define LCD_PINS_D7 29 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - #endif - - #endif - - #if DISABLED(NEWPANEL) - // Buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - - #endif - - // - // LCD Display input pins - // - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 - #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #endif - - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS SDSS - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - #define BTN_ENC -1 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - - #elif ENABLED(VIKI2) || ENABLED(miniVIKI) - - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN 33 - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - #define KILL_PIN 31 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 - - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 - - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BEEPER_PIN 37 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD_PIN 12 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons are directly attached using AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #endif - - #endif - #endif // NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h deleted file mode 100644 index effce90706..0000000000 --- a/Marlin/pins_RAMPS_13.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.3 pin assignments - * - * Applies to the following boards: - * - * RAMPS_13_EFB (Extruder, Fan, Bed) - * RAMPS_13_EEB (Extruder, Extruder, Bed) - * RAMPS_13_EFF (Extruder, Fan, Fan) - * RAMPS_13_EEF (Extruder, Extruder, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.3" -#endif - -#define IS_RAMPS_13 -#include "pins_RAMPS.h" diff --git a/Marlin/pins_RAMPS_ENDER_4.h b/Marlin/pins_RAMPS_ENDER_4.h deleted file mode 100644 index a14ace25ba..0000000000 --- a/Marlin/pins_RAMPS_ENDER_4.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "Ender-4 supports only 1 hotend / E-stepper. Comment out this line to continue." -#endif - -#define BOARD_NAME "Ender-4" - -#include "pins_RAMPS.h" diff --git a/Marlin/pins_RAMPS_OLD.h b/Marlin/pins_RAMPS_OLD.h deleted file mode 100644 index da047e2b0a..0000000000 --- a/Marlin/pins_RAMPS_OLD.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.0, v1.1, v1.2 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "MEGA/RAMPS <1.2" - -// Uncomment the following line for RAMPS v1.0 -//#define RAMPS_V_1_0 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 16 -#define Y_MAX_PIN 17 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 38 -#define Y_DIR_PIN 40 -#define Y_ENABLE_PIN 36 - -#define Z_STEP_PIN 44 -#define Z_DIR_PIN 46 -#define Z_ENABLE_PIN 42 - -#define E0_STEP_PIN 32 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#if ENABLED(RAMPS_V_1_0) - #define HEATER_0_PIN 12 - #define HEATER_BED_PIN -1 - #ifndef FAN_PIN - #define FAN_PIN 11 - #endif -#else // RAMPS_V_1_1 or RAMPS_V_1_2 - #define HEATER_0_PIN 10 - #define HEATER_BED_PIN 8 - #ifndef FAN_PIN - #define FAN_PIN 9 - #endif -#endif - -// -// Misc. Functions -// -#define SDPOWER 48 -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // MUST BE HARDWARE PWM - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 43 diff --git a/Marlin/pins_RAMPS_PLUS.h b/Marlin/pins_RAMPS_PLUS.h deleted file mode 100644 index 77e0e140c0..0000000000 --- a/Marlin/pins_RAMPS_PLUS.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments - * The differences to the RAMPS v1.4 are: - * - Swap heater E0 with E1 - * - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10. - * - Change pins 16->42, 17->44 and 29->53 used for display. - * - * Applies to the following boards: - * - * RAMPS_PLUS_EFB (Extruder, Fan, Bed) - * RAMPS_PLUS_EEB (Extruder, Extruder, Bed) - * RAMPS_PLUS_EFF (Extruder, Fan, Fan) - * RAMPS_PLUS_EEF (Extruder, Extruder, Fan) - * RAMPS_PLUS_SF (Spindle, Controller Fan) - * - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4 Plus" -#endif - -#define RAMPS_D8_PIN 10 -#define RAMPS_D10_PIN 8 - -#include "pins_RAMPS.h" - -// -// Steppers - Swap E0 / E1 on 3DYMY -// -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN - -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#undef X_CS_PIN -#undef Y_CS_PIN -#undef Z_CS_PIN -#undef E0_CS_PIN -#undef E1_CS_PIN - -#if ENABLED(ULTRA_LCD) && DISABLED(REPRAPWORLD_GRAPHICAL_LCD) && (DISABLED(NEWPANEL) || DISABLED(PANEL_ONE)) && DISABLED(CR10_STOCKDISPLAY) - #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #undef LCD_PINS_RS - #define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42 - #undef LCD_PINS_ENABLE - #define LCD_PINS_ENABLE 44 // 3DYMY boards pin 17 -> 44 - #endif - #undef LCD_PINS_D7 - #define LCD_PINS_D7 53 // 3DYMY boards pin 29 -> 53 -#endif diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h deleted file mode 100644 index e985963505..0000000000 --- a/Marlin/pins_RIGIDBOARD.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments - */ - -#define BOARD_NAME "RigidBoard" - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops -#endif - -// -// MOSFET changes -// -#define RAMPS_D10_PIN 9 // EXTRUDER 1 -#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN - -#include "pins_RAMPS.h" - -// -// Steppers -// -// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3 -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#define STEPPER_RESET_PIN 41 // Stepper drivers have a reset on RigidBot - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#undef TEMP_BED_PIN -#define TEMP_0_PIN 14 // Analog Input -#define TEMP_1_PIN 13 // Analog Input -#define TEMP_BED_PIN 15 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#undef HEATER_BED_PIN -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 8 // Same as RAMPS_13_EEF -#endif - -// -// Misc. Functions -// -#undef PS_ON_PIN -#define PS_ON_PIN -1 - -// -// LCD / Controller -// -// LCD Panel options for the RigidBoard -#if ENABLED(RIGIDBOT_PANEL) - - #undef BEEPER_PIN - #define BEEPER_PIN -1 - - // Direction buttons - #define BTN_UP 37 - #define BTN_DWN 35 - #define BTN_LFT 33 - #define BTN_RT 32 - - // 'R' button - #undef BTN_ENC - #define BTN_ENC 31 - - // Disable encoder - #undef BTN_EN1 - #define BTN_EN1 -1 - #undef BTN_EN2 - #define BTN_EN2 -1 - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - -#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - - #undef KILL_PIN - #define KILL_PIN 32 - -#endif diff --git a/Marlin/pins_RIGIDBOARD_V2.h b/Marlin/pins_RIGIDBOARD_V2.h deleted file mode 100644 index 2075892ab8..0000000000 --- a/Marlin/pins_RIGIDBOARD_V2.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#include "pins_RIGIDBOARD.h" - -#undef BOARD_NAME -#define BOARD_NAME "RigidBoard V2" - -// -// Steppers -// - -// I2C based DAC like on the Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Channels available for DAC, For Rigidboard there are 4 -#define DAC_STEPPER_ORDER { 0, 1, 2, 3 } - -#define DAC_STEPPER_SENSE 0.05 // sense resistors on rigidboard stepper chips are .05 value -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 4096 // was 5000 but max allowable value is actually 4096 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 2x = 4.096V -#define DAC_STEPPER_GAIN 1 // value of 1 here sets gain of 2 -#define DAC_DISABLE_PIN 42 // set low to enable DAC -#define DAC_OR_ADDRESS 0x01 - -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis -#endif diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h deleted file mode 100644 index 160dae55b8..0000000000 --- a/Marlin/pins_RUMBA.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RUMBA pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." -#endif - -#define DEFAULT_MACHINE_NAME "Rumba" -#define BOARD_NAME "Rumba" - -// -// Servos -// -#define SERVO0_PIN 5 - -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 36 -#define Y_MIN_PIN 35 -#define Y_MAX_PIN 34 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 22 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 25 -#define E1_ENABLE_PIN 27 - -#define E2_STEP_PIN 29 -#define E2_DIR_PIN 28 -#define E2_ENABLE_PIN 39 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 6 // Analog Input (connector *K1* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input (connector *K2* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) -#endif - -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 7 // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_BED is defined as thermocouple) -#else - #define TEMP_2_PIN 13 // Analog Input (default connector for thermistor *T2* on rumba board is used) -#endif - -// 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) - -#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) -#else - #define TEMP_BED_PIN 11 // Analog Input (default connector for thermistor *THB* on rumba board is used) -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 8 -#define HEATER_BED_PIN 9 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#define FAN1_PIN 8 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 45 -#define KILL_PIN 46 -#define CASE_LIGHT_PIN 45 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#ifndef SPINDLE_LASER_PWM_PIN - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM. Pin 4 interrupts OC0* and OC1* always in use? -#endif -#ifndef SPINDLE_LASER_ENABLE_PIN - #define SPINDLE_LASER_ENABLE_PIN 14 // Pin should have a pullup! -#endif -#ifndef SPINDLE_DIR_PIN - #define SPINDLE_DIR_PIN 15 -#endif - -// -// LCD / Controller -// -#define SD_DETECT_PIN 49 -#define BEEPER_PIN 44 -#define LCD_PINS_D7 40 -#define BTN_EN1 11 -#define BTN_EN2 12 -#define BTN_ENC 43 - -#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 38 // Set as output on init - #define LCD_PINS_RS 41 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 19 - #define DOGLCD_MOSI 42 - #define DOGLCD_SCK 18 - #define DOGLCD_A0 LCD_PINS_DC -#else - #define LCD_PINS_RS 19 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 18 - #define LCD_PINS_D5 38 - #define LCD_PINS_D6 41 -#endif diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h deleted file mode 100644 index 53d1a3e95b..0000000000 --- a/Marlin/pins_SAINSMART_2IN1.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sainsmart 2-in-1 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Sainsmart" - -// -// Heaters / Fans -// -#define RAMPS_D10_PIN 9 // E -#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat - // RAMPS_D8_PIN 8 // B -#define MOSFET_D_PIN 10 // F / E - -#include "pins_RAMPS.h" diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h deleted file mode 100644 index 0d9af5b5a8..0000000000 --- a/Marlin/pins_SANGUINOLOLU_11.h +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sanguinololu board pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu <1.2" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) - -#if ENABLED(SANGUINOLOLU_V_1_2) - - #define HEATER_BED_PIN 12 // (bed) - #define X_ENABLE_PIN 14 - #define Y_ENABLE_PIN 14 - #define Z_ENABLE_PIN 26 - #define E0_ENABLE_PIN 14 - - #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2) - #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan - #endif - -#else - - #define HEATER_BED_PIN 14 // (bed) - #define X_ENABLE_PIN -1 - #define Y_ENABLE_PIN -1 - #define Z_ENABLE_PIN -1 - #define E0_ENABLE_PIN -1 - -#endif - -#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI)) - #define FAN_PIN 4 // Works for Panelolu2 too -#endif - -// -// Misc. Functions -// - -/** - * In some versions of the Sanguino libraries the pin - * definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi). - * If you encounter issues with these pins, upgrade your - * Sanguino libraries! See #368. - */ -//#define SDSS 24 -#define SDSS 31 - -#if ENABLED(IS_MELZI) - #define LED_PIN 27 -#elif MB(STB_11) - #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED -#endif - -#if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available -#endif - -/** - * Sanguinololu 1.4 AUX pins: - * - * PWM TX1 RX1 SDA SCL - * 12V 5V D12 D11 D10 D17 D16 - * GND GND D31 D30 D29 D28 D27 - * A4 A3 A2 A1 A0 - */ - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #if ENABLED(DOGLCD) - - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 - - #if ENABLED(IS_MELZI) - #define LCD_PINS_RS 30 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 29 // SID (MOSI) - #define LCD_PINS_D4 17 // SCK (CLK) clock - // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with - // Marlin so this can be used for BEEPER_PIN. You can use this pin - // with M42 instead of BEEPER_PIN. - #define BEEPER_PIN 27 - #else // Sanguinololu >=1.3 - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - #endif - - #else // DOGM SPI LCD Support - - #define DOGLCD_A0 30 - #define LCD_CONTRAST 1 - - #if ENABLED(MAKRPANEL) - - #define BEEPER_PIN 29 - #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN 28 // PA3 - - #elif ENABLED(IS_MELZI) - - #define BEEPER_PIN 27 - #define DOGLCD_CS 28 - - #else // !MAKRPANEL - - #define DOGLCD_CS 29 - - #endif - - #endif - - // Uncomment screen orientation - #define LCD_SCREEN_ROT_0 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #else // !DOGLCD - - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - - #endif // !DOGLCD - - #define BTN_EN1 11 - #define BTN_EN2 10 - - #if ENABLED(LCD_I2C_PANELOLU2) - - #if ENABLED(IS_MELZI) - #define BTN_ENC 29 - #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi - #else - #define BTN_ENC 30 - #endif - - #elif ENABLED(LCD_FOR_MELZI) - - #define LCD_PINS_RS 17 - #define LCD_PINS_ENABLE 16 - #define LCD_PINS_D4 11 - #define BTN_ENC 28 - #define BTN_EN1 29 - #define BTN_EN2 30 - - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(188) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) - #endif - - #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards - - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define ADC_KEYPAD_PIN 1 - - // Not used - #define BTN_EN1 -1 - #define BTN_EN2 -1 - - #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD - - #define BTN_ENC 16 - #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi - - #endif - - #define SD_DETECT_PIN -1 - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - - #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 11 - - #elif !MB(MELZI) // use X stepper motor socket - - /** - * To control the spindle speed and have an LCD you must sacrifice - * the Extruder and pull some signals off the X stepper driver socket. - * - * The following assumes: - * - The X stepper driver socket is empty - * - The extruder driver socket has a driver board plugged into it - * - The X stepper wires are attached the the extruder connector - */ - - /** - * Where to get the spindle signals - * - * spindle signal socket name socket name - * ------- - * /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_LASER_ENABLE_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor. - */ - #undef X_DIR_PIN - #undef X_ENABLE_PIN - #undef X_STEP_PIN - #define X_DIR_PIN 0 - #define X_ENABLE_PIN 14 - #define X_STEP_PIN 1 - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup! - #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin - #endif -#endif // SPINDLE_LASER_ENABLE diff --git a/Marlin/pins_SANGUINOLOLU_12.h b/Marlin/pins_SANGUINOLOLU_12.h deleted file mode 100644 index f648dce085..0000000000 --- a/Marlin/pins_SANGUINOLOLU_12.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sanguinololu V1.2 pin assignments - * - * Applies to the following boards: - * - * AZTEEG_X1 - * MELZI - * MELZI_CREALITY - * MELZI_MAKR3D - * SANGUINOLOLU_12 - * STB_11 - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu 1.2" -#endif - -#define SANGUINOLOLU_V_1_2 -#include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_SAV_MKI.h b/Marlin/pins_SAV_MKI.h deleted file mode 100644 index 8945594495..0000000000 --- a/Marlin/pins_SAV_MKI.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "SAV MkI" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" -#define BOARD_NAME "SAV MkI" - -// -// Servos -// -#define SERVO0_PIN 39 // F1 In teensy's pin definition for pinMode (in servo.cpp) - -// -// Limit Switches -// -#define X_STOP_PIN 25 // B5 -#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 For inductive sensor. -//#define E_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - Bed - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -// Extension header pin mapping -// ---------------------------- -// SCL (I2C)-D0 A0 (An), IO -// SDA (I2C)-D1 A1 (An), IO -// RX1-D2 A2 (An), IO -// TX1-D3 A3 (An), IO -// PWM-D24 A4 (An), IO -// 5V GND -// 12V GND -#define EXT_AUX_SCL_D0 0 // D0 PWM0B -#define EXT_AUX_SDA_D1 1 // D1 -#define EXT_AUX_RX1_D2 2 // D2 -#define EXT_AUX_TX1_D3 3 // D3 -#define EXT_AUX_PWM_D24 24 // B4 PWM2A -#define EXT_AUX_A0 0 // F0 Analog Input -#define EXT_AUX_A0_IO 38 // F0 Digital IO -#define EXT_AUX_A1 1 // F1 Analog Input -#define EXT_AUX_A1_IO 39 // F1 Digital IO -#define EXT_AUX_A2 2 // F2 Analog Input -#define EXT_AUX_A2_IO 40 // F2 Digital IO -#define EXT_AUX_A3 3 // F3 Analog Input -#define EXT_AUX_A3_IO 41 // F3 Digital IO -#define EXT_AUX_A4 4 // F4 Analog Input -#define EXT_AUX_A4_IO 42 // F4 Digital IO - -// -// LCD / Controller -// -#define BEEPER_PIN -1 -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 - -#if ENABLED(SAV_3DLCD) - // For LCD SHIFT register LCD - #define SR_DATA_PIN EXT_AUX_SDA_D1 - #define SR_CLK_PIN EXT_AUX_SCL_D0 -#endif - -#if ENABLED(SAV_3DLCD) || ENABLED(SAV_3DGLCD) - - #define BTN_EN1 EXT_AUX_A1_IO - #define BTN_EN2 EXT_AUX_A0_IO - #define BTN_ENC EXT_AUX_PWM_D24 - - #define KILL_PIN EXT_AUX_A2_IO - #define HOME_PIN EXT_AUX_A4_IO - -#else // Use the expansion header for spindle control - - // - // M3/M4/M5 - Spindle/Laser Control - // - #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A - #define SPINDLE_LASER_ENABLE_PIN 39 // F1 Pin should have a pullup! - #define SPINDLE_DIR_PIN 40 // F2 - - #define CASE_LIGHT_PIN 0 // D0 PWM0B - -#endif diff --git a/Marlin/pins_SCOOVO_X9H.h b/Marlin/pins_SCOOVO_X9H.h deleted file mode 100644 index ea6685def4..0000000000 --- a/Marlin/pins_SCOOVO_X9H.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/************************************************ - * Rambo pin assignments MODIFIED FOR Scoovo X9H - ************************************************/ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Scoovo X9H" - -// -// Servos -// -#define SERVO0_PIN 22 // Motor header MX1 -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_BED_PIN 7 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 -#define FAN2_PIN 2 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// LCD / Controller -// -#define LCD_PINS_RS 70 // Ext2_5 -#define LCD_PINS_ENABLE 71 // Ext2_7 -#define LCD_PINS_D4 72 // Ext2_9 ? -#define LCD_PINS_D5 73 // Ext2_11 ? -#define LCD_PINS_D6 74 // Ext2_13 -#define LCD_PINS_D7 75 // Ext2_15 ? -#define BEEPER_PIN -1 - -#define BTN_HOME 80 // Ext_16 -#define BTN_CENTER 81 // Ext_14 -#define BTN_ENC BTN_CENTER -#define BTN_RIGHT 82 // Ext_12 -#define BTN_LEFT 83 // Ext_10 -#define BTN_UP 84 // Ext2_8 -#define BTN_DOWN 85 // Ext2_6 - -#define HOME_PIN BTN_HOME - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 -#endif // VIKI2/miniVIKI diff --git a/Marlin/pins_SETHI.h b/Marlin/pins_SETHI.h deleted file mode 100644 index 801560e5e3..0000000000 --- a/Marlin/pins_SETHI.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sethi 3D_1 pin assignments - www.sethi3d.com.br - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * this assumes that this board uses the Sanguino pin map - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sethi 3D' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Sethi 3D_1" - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 2 -#define Y_STOP_PIN 0 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #if GEN7_VERSION >= 13 - // Gen7 v1.3 removed the fan pin - #define FAN_PIN -1 - #else - #define FAN_PIN 31 - #endif -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -// our pin for debugging. -#define DEBUG_PIN 0 - -// our RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 diff --git a/Marlin/pins_SILVER_GATE.h b/Marlin/pins_SILVER_GATE.h deleted file mode 100644 index 005c4c6eca..0000000000 --- a/Marlin/pins_SILVER_GATE.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#if !defined(__AVR_ATmega1281__) && !defined(__AVR_ATmega2561__) - #error Oops! Make sure you have 'Silvergate' selected from the 'Tools -> Boards' menu. -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Silver Gate" -#endif - -#define X_STEP_PIN 43 -#define X_DIR_PIN 44 -#define X_ENABLE_PIN 42 -#define X_MIN_PIN 31 -#define X_MAX_PIN 34 - -#define Y_STEP_PIN 40 -#define Y_DIR_PIN 41 -#define Y_ENABLE_PIN 39 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 35 - -#define Z_STEP_PIN 13 -#define Z_DIR_PIN 38 -#define Z_ENABLE_PIN 14 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 36 - -#define E0_STEP_PIN 27 -#define E0_DIR_PIN 37 -#define E0_ENABLE_PIN 45 - -#define SDSS 16 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 34 // X_MAX unless overridden -#endif - -#ifndef FAN_PIN - #define FAN_PIN 5 -#endif - -#define HEATER_0_PIN 7 - -#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN -#define CONTROLLER_FAN_PIN 2 - -#define TEMP_0_PIN 7 // Analog Input - -#define HEATER_BED_PIN 8 -#define TEMP_BED_PIN 6 - -#if ENABLED(DOGLCD) - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 - #define LCD_PINS_RS 30 - #define LCD_PINS_ENABLE 20 - #define LCD_PINS_D4 25 - #define BEEPER_PIN 29 - #define BTN_EN1 19 - #define BTN_EN2 22 - #define BTN_ENC 24 - #define LCD_BACKLIGHT_PIN 6 - #if ENABLED(SILVER_GATE_GLCD_CONTROLLER) - #define KILL_PIN 21 - #define HOME_PIN 28 - #endif - #endif -#endif - -#define SD_DETECT_PIN 15 - -#define STAT_LED_RED_PIN 23 -#define STAT_LED_BLUE_PIN 26 -#define CASE_LIGHT_PIN 51 diff --git a/Marlin/pins_STB_11.h b/Marlin/pins_STB_11.h deleted file mode 100644 index de769fcb68..0000000000 --- a/Marlin/pins_STB_11.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * STB V1.1 pin assignments - */ - -#define BOARD_NAME "STB V1.1" -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/pins_TEENSY2.h b/Marlin/pins_TEENSY2.h deleted file mode 100644 index 736be6f73e..0000000000 --- a/Marlin/pins_TEENSY2.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Teensy++ 2.0 Breadboard pin assignments (AT90USB1286) - * Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! - * http://www.pjrc.com/teensy/teensyduino.html - * See http://reprap.org/wiki/Printrboard for more info - * - * CLI build: HARDWARE_MOTHERBOARD=84 make - * - * DaveX plan for Teensylu/printrboard-type pinouts for a TeensyBreadboard: - * (ref teensylu & sprinter) - * - * USB - * GND GND |-----#####-----| +5V ATX +5SB - * ATX PS_ON PWM 27 |b7 ##### b6| 26 PWM* Stepper Enable - * PWM 0 |d0 b5| 25 PWM* - * PWM 1 |d1 b4| 24 PWM - * X_MIN 2 |d2 b3| 23 MISO_PIN - * Y_MIN 3 |d3 b2| 22 MOSI_PIN - * Z_MIN 4 |d4 * * b1| 21 SCK_PIN - * 5 |d5 e e b0| 20 SDSS - * LED 6 |d6 5 4 e7| 19 - * 7 |d7 e6| 18 - * LCD RS 8 |e0 | GND - * LCD EN 9 |e1 a4 a0 R| AREF - * LCD D4 10 |c0 a5 a1 f0| 38 A0 ENC_1 - * LCD D5 11 |c1 a6 a2 f1| 39 A1 ENC_2 - * LCD D6 12 |c2 a7 a3 f2| 40 A2 ENC_CLK - * LCD D6 13 |c3 f3| 41 A3 - * Bed Heat PWM 14 |c4 V G R f4| 42 A4 - * Extruder Heat PWM 15 |c5 c n S f5| 43 A5 - * Fan PWM 16 |c6 c d T f6| 44 A6 Bed TC - * 17 |c7 * * * f7| 45 A7 Extruder TC * 4.7k * +5 - * ----------------- - * - * Interior E4: 36, INT4 - * Interior E5: 37, INT5 - * Interior PA0-7: 28-35 -- Printrboard and Teensylu use these pins for step & direction: - * T++ PA Signal Marlin - * - * Z STEP 32 a4 a0 28 X STEP - * Z DIR 33 a5 a1 29 X DIR - * E STEP 34 a6 a2 30 Y STEP - * E DIR 35 a7 a3 31 Y DIR - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Teensy++2.0" - -// -// Limit Switches -// -#define X_STOP_PIN 2 // D2 -#define Y_STOP_PIN 3 // D3 -#define Z_STOP_PIN 4 // D4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 Marlin -#define X_DIR_PIN 29 // A1 Marlin -#define X_ENABLE_PIN 26 // B6 - -#define Y_STEP_PIN 30 // A2 Marlin -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 26 // B6 Shared w/x - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 26 // B6 Shared w/x - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 26 // B6 Shared w/x - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A Fan -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define LED_PIN 6 // D6 -#define PS_ON_PIN 27 // B7 -#define CASE_LIGHT_PIN 1 // D1 PWM2B MUST BE HARDWARE PWM - -// -// LCD / Controller -// -#if ENABLED(ULTIPANEL) - #define LCD_PINS_RS 8 // E0 - #define LCD_PINS_ENABLE 9 // E1 - #define LCD_PINS_D4 10 // C0 - #define LCD_PINS_D5 11 // C1 - #define LCD_PINS_D6 12 // C2 - #define LCD_PINS_D7 13 // C3 - #define BTN_EN1 38 // F0 - #define BTN_EN2 39 // F1 - #define BTN_ENC 40 // F2 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // D5 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 7 // D7 diff --git a/Marlin/pins_TEENSYLU.h b/Marlin/pins_TEENSYLU.h deleted file mode 100644 index e733b98287..0000000000 --- a/Marlin/pins_TEENSYLU.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. All have been used with Arduino 1.6.12 - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * This is basically Teensyduino but with a bootloader that can handle image sizes - * larger than 64K. - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - - /** - * SILKSCREEN ERROR - * - * The silkscreen for the endstops do NOT match the schematic. The silkscreen SHOULD - * read (from left to right) X-STOP, Y-STOP, Z-STOP & E-STOP. The silkscreen actually - * reads E-STOP, X-STOP, Y-STOP & Z-STOP. - * - * The pin assignments in this file match the silkscreen. - */ - -#if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1286P__) - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Teensylu" - -// -// Limit Switch definitions that match the SCHEMATIC -// -//#define X_STOP_PIN 25 // B5 -//#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -//#define E_STOP_PIN 36 // E4 - - -// -// Limit Switch definitions that match the SILKSCREEN -// -#define X_STOP_PIN 26 // B6 -#define Y_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 -//#define E_STOP_PIN 25 // B5 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (Extruder) -#define TEMP_BED_PIN 6 // Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 JP31-6 -#define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define BEEPER_PIN -1 - - #if ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 3 // D3 IO-8 - #define BTN_EN2 2 // D2 IO-10 - #define BTN_ENC 41 // F3 IO-7 - #define SDSS 38 // F0 IO-13 use SD card on Panelolu2 - #endif - - #define SD_DETECT_PIN -1 - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 24 // B4 IO-3 PWM2A - MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 39 // F1 IO-11 - Pin should have a pullup! -#define SPINDLE_DIR_PIN 40 // F2 IO-9 diff --git a/Marlin/pins_TRIGORILLA_13.h b/Marlin/pins_TRIGORILLA_13.h deleted file mode 100644 index 0907eaf286..0000000000 --- a/Marlin/pins_TRIGORILLA_13.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.3 for Anycubic - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.3" -#endif - -#define IS_RAMPS_EFB -#define RAMPS_D9_PIN 44 -#define FAN2_PIN 9 -#define ORIG_E0_AUTO_FAN_PIN 9 - -#include "pins_RAMPS_13.h" - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#undef E1_CS_PIN diff --git a/Marlin/pins_TRIGORILLA_14.h b/Marlin/pins_TRIGORILLA_14.h deleted file mode 100644 index 70b0a930a9..0000000000 --- a/Marlin/pins_TRIGORILLA_14.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 for Anycubic - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.4" -#endif - -#define IS_RAMPS_EFB - -#define FAN2_PIN 44 -#define ORIG_E0_AUTO_FAN_PIN 44 - -#include "pins_RAMPS.h" diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h deleted file mode 100644 index ea7a8325c0..0000000000 --- a/Marlin/pins_ULTIMAIN_2.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultiboard v2.0 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker 2.x" - -// -// Limit Switches -// -#define X_STOP_PIN 22 -#define Y_STOP_PIN 26 -#define Z_STOP_PIN 29 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 32 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 36 -#define Z_ENABLE_PIN 34 - -#define E0_STEP_PIN 42 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -#define MOTOR_CURRENT_PWM_XY_PIN 44 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 46 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 39 -#define LED_PIN 8 -#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered -#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. - -// -// LCD / Controller -// -#define BEEPER_PIN 18 - -#define LCD_PINS_RS 20 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 14 -#define LCD_PINS_D5 21 -#define LCD_PINS_D6 5 -#define LCD_PINS_D7 6 - -// Buttons are directly attached -#define BTN_EN1 40 -#define BTN_EN2 41 -#define BTN_ENC 19 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) // use the LED_PIN for spindle speed control or case light - #undef LED_PIN - #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_LASER_PWM_PIN 8 // MUST BE HARDWARE PWM -#else - #undef LED_PIN - #define CASE_LIGHT_PIN 8 -#endif diff --git a/Marlin/pins_ULTIMAKER.h b/Marlin/pins_ULTIMAKER.h deleted file mode 100644 index 23941a1624..0000000000 --- a/Marlin/pins_ULTIMAKER.h +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultimaker pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker" - -// -// Servos -// -#define SERVO0_PIN 11 - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // PIN that has to be turned on right after start, to keep power flowing. -#define CASE_LIGHT_PIN 8 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // buttons are directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // buttons are attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header diff --git a/Marlin/pins_ULTIMAKER_OLD.h b/Marlin/pins_ULTIMAKER_OLD.h deleted file mode 100644 index c07f2d0e75..0000000000 --- a/Marlin/pins_ULTIMAKER_OLD.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultimaker pin assignments (Old electronics) - */ - - /** - * Rev B 3 JAN 2017 - * - * Details on pin definitions for M3, M4 & M5 spindle control commands and for - * the CASE_LIGHT_PIN are at the end of this file. - * - * This started out as an attempt to add pin definitions for M3, M4 & M5 spindle - * control commands but quickly turned into a head scratcher as the sources for - * the revisions provided inconsistent information. - * - * As best I can determine: - * 1.5.3 boards should use the pins_ULTIMAKER.h file which means the BOARD_NAME - * define in this file should say 1.5.3 rather than 1.5.4 - * This file is meant for 1.1 - 1.3 boards. - * The endstops for the 1.0 boards use different definitions than on the 1.1 - 1.3 - * boards. - * - * I've added sections that have the 1.0 and 1.5.3 + endstop definitions so you can - * easily switch if needed. I've also copied over the 1.5.3 + LCD definitions. - * - * To be 100% sure of the board you have: - * 1. In Configuration_adv.h enable "PINS_DEBUGGING" - * 2. Compile & uploade - * 3. Enter the command "M43 W1 I1". This command will report that pin nmumber and - * name of any pin that changes state. - * 4. Using a 1k (approximately) resistor pull the endstops and some of the LCD pins - * to ground and see what is reported. - * 5. If the reported pin doesn't match the file then try a different board revision - * and repeat steps 2 - 5 - */ - -#define board_rev_1_1_TO_1_3 -//#define board_rev_1_0 -//#define board_rev_1_5 - - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker <1.5.4" - -// -// Limit Switches -// -#if ENABLED(board_rev_1_1_TO_1_3) - #define X_MIN_PIN 15 // SW1 - #define X_MAX_PIN 14 // SW2 - #define Y_MIN_PIN 17 // SW3 - #define Y_MAX_PIN 16 // SW4 - #define Z_MIN_PIN 19 // SW5 - #define Z_MAX_PIN 18 // SW6 -#endif - -#if ENABLED(board_rev_1_0) - #define X_MIN_PIN 13 // SW1 - #define X_MAX_PIN 12 // SW2 - #define Y_MIN_PIN 11 // SW3 - #define Y_MAX_PIN 10 // SW4 - #define Z_MIN_PIN 9 // SW5 - #define Z_MAX_PIN 8 // SW6 -#endif - -#if ENABLED(board_rev_1_5) - #define X_MIN_PIN 22 - #define X_MAX_PIN 24 - #define Y_MIN_PIN 26 - #define Y_MAX_PIN 28 - #define Z_MIN_PIN 30 - #define Z_MAX_PIN 32 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN Z_MAX_PIN -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN -1 // 49 -#define E1_DIR_PIN -1 // 47 -#define E1_ENABLE_PIN -1 // 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 1 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -//#define HEATER_1_PIN 3 // used for case light Rev A said "1" -#define HEATER_BED_PIN 4 - -// -// LCD / Controller -// -#if ENABLED(board_rev_1_0) || ENABLED(board_rev_1_1_TO_1_3) - #define LCD_PINS_RS 24 - #define LCD_PINS_ENABLE 22 - #define LCD_PINS_D4 36 - #define LCD_PINS_D5 34 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 30 -#elif ENABLED(board_rev_1_5) && ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // buttons are directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // buttons are attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD - -// -// case light - see spindle section for more info on available hardware PWMs -// -#if !PIN_EXISTS(CASE_LIGHT) && ENABLED(board_rev_1_5) - #define CASE_LIGHT_PIN 7 // use PWM - MUST BE HARDWARE PWM -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) - - #if ENABLED(board_rev_1_0) // use the last three SW positions - - #undef Z_MIN_PROBE_PIN - #undef X_MIN_PIN // SW1 - #undef X_MAX_PIN // SW2 - #undef Y_MIN_PIN // SW3 - #undef Y_MAX_PIN // SW4 - #undef Z_MIN_PIN // SW5 - #undef Z_MAX_PIN // SW6 - - #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM - #define Y_STOP_PIN 12 // SW2 - #define Z_STOP_PIN 11 // SW3 - - #define SPINDLE_DIR_PIN 10 // SW4 - #define SPINDLE_LASER_PWM_PIN 9 // SW5 MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // SW6 Pin should have a pullup! - - #elif ENABLED(board_rev_1_5) // use the same pins - but now they are on a different connector - - #define SPINDLE_DIR_PIN 10 // EXP3-6 (silkscreen says 10) - #define SPINDLE_LASER_PWM_PIN 9 // EXP3-7 (silkscreen says 9) MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // EXP3-8 (silkscreen says 8) Pin should have a pullup! - - #elif ENABLED(board_rev_1_1_TO_1_3) - - /** - * Only four hardware PWMs physically connected to anything on these boards: - * - * HEATER_0_PIN 2 silkscreen varies - usually "PWM 1" or "HEATER1" - * HEATER_1_PIN 3 silkscreen varies - usually "PWM 2" or "HEATER2" - * HEATER_BED_PIN 4 silkscreen varies - usually "PWM 3" or "HEATED BED" - * E0_DIR_PIN 45 - * - * If one of the heaters is used then special precautions will usually be needed. - * They have an LED and resistor pullup to +24V which could damage 3.3V-5V ICs. - */ - #if EXTRUDERS == 1 // Move E0 stepper module to the spare and get signals from E0 - #undef E0_STEP_PIN - #undef E0_DIR_PIN - #undef E0_ENABLE_PIN - #define E0_STEP_PIN 49 - #define E0_DIR_PIN 47 - #define E0_ENABLE_PIN 48 - #define SPINDLE_DIR_PIN 43 - #define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup! - #elif TEMP_SENSOR_BED == 0 // Can't use E0 so see if HEATER_BED_PIN is available - #undef HEATER_BED_PIN - #define SPINDLE_DIR_PIN 38 // Probably pin 4 on 10 pin connector closest to the E0 socket - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - Special precautions usually needed. - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup! (Probably pin 6 on the 10-pin - // connector closest to the E0 socket) - #endif - #endif -#endif - -/** - * Where to get the spindle signals on the E0 socket - * - * spindle signal socket name socket name - * ------- - * SPINDLE_LASER_ENABLE_PIN /ENABLE *| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_DIR_PIN STEP O| |O VDD - * SPINDLE_LASER_PWM_PIN DIR O| |O GND - * ------- - * * - pin closest to MS1, MS2 & MS3 jumpers on the board - * - * Note: Socket names vary from vendor to vendor. - */ diff --git a/Marlin/pins_ZRIB_V20.h b/Marlin/pins_ZRIB_V20.h deleted file mode 100644 index 94a083dd40..0000000000 --- a/Marlin/pins_ZRIB_V20.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * ZRIB V2.0 pin assignments - */ - -#define ZRIB_V20_D6_PIN 6 -#define ZRIB_V20_D9_PIN 9 -#define RAMPS_D9_PIN ZRIB_V20_D6_PIN -#define ORIG_E0_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E1_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E2_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E3_AUTO_FAN_PIN ZRIB_V20_D9_PIN - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // Analog Input -#endif - -#include "pins_MKS_GEN_13.h" diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp deleted file mode 100644 index 515ddc33a3..0000000000 --- a/Marlin/planner.cpp +++ /dev/null @@ -1,2625 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner.cpp - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * The ring buffer implementation gleaned from the wiring_serial library by David A. Mellis. - * - * - * Reasoning behind the mathematics in this module (in the key of 'Mathematica'): - * - * s == speed, a == acceleration, t == time, d == distance - * - * Basic definitions: - * Speed[s_, a_, t_] := s + (a*t) - * Travel[s_, a_, t_] := Integrate[Speed[s, a, t], t] - * - * Distance to reach a specific speed with a constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, d, t] - * d -> (m^2 - s^2)/(2 a) --> estimate_acceleration_distance() - * - * Speed after a given distance of travel with constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, m, t] - * m -> Sqrt[2 a d + s^2] - * - * DestinationSpeed[s_, a_, d_] := Sqrt[2 a d + s^2] - * - * When to start braking (di) to reach a specified destination speed (s2) after accelerating - * from initial speed s1 without ever stopping at a plateau: - * Solve[{DestinationSpeed[s1, a, di] == DestinationSpeed[s2, a, d - di]}, di] - * di -> (2 a d - s1^2 + s2^2)/(4 a) --> intersection_distance() - * - * IntersectionDistance[s1_, s2_, a_, d_] := (2 a d - s1^2 + s2^2)/(4 a) - * - * -- - * - * The fast inverse function needed for Bézier interpolation for AVR - * was designed, written and tested by Eduardo José Tagle on April/2018 - */ - -#include "planner.h" -#include "stepper.h" -#include "temperature.h" -#include "ultralcd.h" -#include "language.h" -#include "parser.h" - -#include "Marlin.h" - -#if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.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 - -Planner planner; - - // public: - -/** - * A ring buffer of moves described in steps - */ -block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; -volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed - Planner::block_buffer_nonbusy, // Index of the first non-busy block - Planner::block_buffer_planned, // Index of the optimally planned block - Planner::block_buffer_tail; // Index of the busy block, if any -uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks -uint8_t Planner::delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - -uint32_t Planner::max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - Planner::max_acceleration_steps_per_s2[XYZE_N], // (steps/s^2) Derived from mm_per_s2 - Planner::min_segment_time_us; // (µs) M205 B - -float Planner::max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - Planner::axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - Planner::steps_to_mm[XYZE_N], // (mm) Millimeters per step - Planner::min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - Planner::acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. - Planner::retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes - Planner::travel_acceleration, // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. - Planner::min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate - -#if ENABLED(JUNCTION_DEVIATION) - float Planner::junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - float Planner::max_e_jerk; - #endif - #endif -#else - float Planner::max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. -#endif - -#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - bool Planner::abort_on_endstop_hit = false; -#endif - -#if ENABLED(DISTINCT_E_FACTORS) - uint8_t Planner::last_extruder = 0; // Respond to extruder change - #define _EINDEX (E_AXIS + active_extruder) -#else - #define _EINDEX E_AXIS -#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 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 - Planner::volumetric_area_nominal = CIRCLE_AREA(float(DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5f), // Nominal cross-sectional area - Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner -#endif - -#if HAS_LEVELING - bool Planner::leveling_active = false; // Flag that auto bed leveling is enabled - #if ABL_PLANAR - matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float Planner::z_fade_height, // Initialized by settings.load() - Planner::inverse_z_fade_height, - Planner::last_fade_z; - #endif -#else - constexpr bool Planner::leveling_active; -#endif - -#if ENABLED(SKEW_CORRECTION) - #if ENABLED(SKEW_CORRECTION_GCODE) - float Planner::xy_skew_factor; - #else - constexpr float Planner::xy_skew_factor; - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) && ENABLED(SKEW_CORRECTION_GCODE) - float Planner::xz_skew_factor, Planner::yz_skew_factor; - #else - constexpr float Planner::xz_skew_factor, Planner::yz_skew_factor; - #endif -#endif - -#if ENABLED(AUTOTEMP) - float Planner::autotemp_max = 250, - Planner::autotemp_min = 210, - Planner::autotemp_factor = 0.1f; - bool Planner::autotemp_enabled = false; -#endif - -// private: - -int32_t Planner::position[NUM_AXIS] = { 0 }; - -uint32_t Planner::cutoff_long; - -float Planner::previous_speed[NUM_AXIS], - Planner::previous_nominal_speed_sqr; - -#if ENABLED(DISABLE_INACTIVE_EXTRUDER) - uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; -#endif - -#ifdef XY_FREQUENCY_LIMIT - // Old direction bits. Used for speed calculations - unsigned char Planner::old_direction_bits = 0; - // Segment times (in µs). Used for speed calculations - uint32_t Planner::axis_segment_time_us[2][3] = { { MAX_FREQ_TIME_US + 1, 0, 0 }, { MAX_FREQ_TIME_US + 1, 0, 0 } }; -#endif - -#if ENABLED(LIN_ADVANCE) - float Planner::extruder_advance_K; // Initialized by settings.load() -#endif - -#if HAS_POSITION_FLOAT - float Planner::position_float[XYZE]; // Needed for accurate maths. Steps cannot be used! -#endif - -#if ENABLED(ULTRA_LCD) - volatile uint32_t Planner::block_buffer_runtime_us = 0; -#endif - -/** - * Class and Instance Methods - */ - -Planner::Planner() { init(); } - -void Planner::init() { - ZERO(position); - #if HAS_POSITION_FLOAT - ZERO(position_float); - #endif - ZERO(previous_speed); - previous_nominal_speed_sqr = 0; - #if ABL_PLANAR - bed_level_matrix.set_to_identity(); - #endif - clear_block_buffer(); - delay_before_delivering = 0; -} - -#if ENABLED(S_CURVE_ACCELERATION) - - /** - * This routine returns 0x1000000 / d, getting the inverse as fast as possible. - * A fast-converging iterative Newton-Raphson method can reach full precision in - * just 1 iteration, and takes 211 cycles (worst case; the mean case is less, up - * to 30 cycles for small divisors), instead of the 500 cycles a normal division - * would take. - * - * Inspired by the following page: - * https://stackoverflow.com/questions/27801397/newton-raphson-division-with-big-integers - * - * Suppose we want to calculate floor(2 ^ k / B) where B is a positive integer - * Then, B must be <= 2^k, otherwise, the quotient is 0. - * - * The Newton - Raphson iteration for x = B / 2 ^ k yields: - * q[n + 1] = q[n] * (2 - q[n] * B / 2 ^ k) - * - * This can be rearranged to: - * q[n + 1] = q[n] * (2 ^ (k + 1) - q[n] * B) >> k - * - * Each iteration requires only integer multiplications and bit shifts. - * It doesn't necessarily converge to floor(2 ^ k / B) but in the worst case - * it eventually alternates between floor(2 ^ k / B) and ceil(2 ^ k / B). - * So it checks for this case and extracts floor(2 ^ k / B). - * - * A simple but important optimization for this approach is to truncate - * multiplications (i.e., calculate only the higher bits of the product) in the - * early iterations of the Newton - Raphson method. This is done so the results - * of the early iterations are far from the quotient. Then it doesn't matter if - * they are done inaccurately. - * It's important to pick a good starting value for x. Knowing how many - * digits the divisor has, it can be estimated: - * - * 2^k / x = 2 ^ log2(2^k / x) - * 2^k / x = 2 ^(log2(2^k)-log2(x)) - * 2^k / x = 2 ^(k*log2(2)-log2(x)) - * 2^k / x = 2 ^ (k-log2(x)) - * 2^k / x >= 2 ^ (k-floor(log2(x))) - * floor(log2(x)) is simply the index of the most significant bit set. - * - * If this estimation can be improved even further the number of iterations can be - * reduced a lot, saving valuable execution time. - * The paper "Software Integer Division" by Thomas L.Rodeheffer, Microsoft - * Research, Silicon Valley,August 26, 2008, available at - * https://www.microsoft.com/en-us/research/wp-content/uploads/2008/08/tr-2008-141.pdf - * suggests, for its integer division algorithm, using a table to supply the first - * 8 bits of precision, then, due to the quadratic convergence nature of the - * Newton-Raphon iteration, just 2 iterations should be enough to get maximum - * precision of the division. - * By precomputing values of inverses for small denominator values, just one - * Newton-Raphson iteration is enough to reach full precision. - * This code uses the top 9 bits of the denominator as index. - * - * The AVR assembly function implements this C code using the data below: - * - * // For small divisors, it is best to directly retrieve the results - * if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - * - * // Compute initial estimation of 0x1000000/x - - * // Get most significant bit set on divider - * uint8_t idx = 0; - * uint32_t nr = d; - * if (!(nr & 0xFF0000)) { - * nr <<= 8; idx += 8; - * if (!(nr & 0xFF0000)) { nr <<= 8; idx += 8; } - * } - * if (!(nr & 0xF00000)) { nr <<= 4; idx += 4; } - * if (!(nr & 0xC00000)) { nr <<= 2; idx += 2; } - * if (!(nr & 0x800000)) { nr <<= 1; idx += 1; } - * - * // Isolate top 9 bits of the denominator, to be used as index into the initial estimation table - * uint32_t tidx = nr >> 15, // top 9 bits. bit8 is always set - * ie = inv_tab[tidx & 0xFF] + 256, // Get the table value. bit9 is always set - * x = idx <= 8 ? (ie >> (8 - idx)) : (ie << (idx - 8)); // Position the estimation at the proper place - * - * x = uint32_t((x * uint64_t(_BV(25) - x * d)) >> 24); // Refine estimation by newton-raphson. 1 iteration is enough - * const uint32_t r = _BV(24) - x * d; // Estimate remainder - * if (r >= d) x++; // Check whether to adjust result - * return uint32_t(x); // x holds the proper estimation - * - */ - static uint32_t get_period_inverse(uint32_t d) { - - static const uint8_t inv_tab[256] PROGMEM = { - 255,253,252,250,248,246,244,242,240,238,236,234,233,231,229,227, - 225,224,222,220,218,217,215,213,212,210,208,207,205,203,202,200, - 199,197,195,194,192,191,189,188,186,185,183,182,180,179,178,176, - 175,173,172,170,169,168,166,165,164,162,161,160,158,157,156,154, - 153,152,151,149,148,147,146,144,143,142,141,139,138,137,136,135, - 134,132,131,130,129,128,127,126,125,123,122,121,120,119,118,117, - 116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101, - 100,99,98,97,96,95,94,93,92,91,90,89,88,88,87,86, - 85,84,83,82,81,80,80,79,78,77,76,75,74,74,73,72, - 71,70,70,69,68,67,66,66,65,64,63,62,62,61,60,59, - 59,58,57,56,56,55,54,53,53,52,51,50,50,49,48,48, - 47,46,46,45,44,43,43,42,41,41,40,39,39,38,37,37, - 36,35,35,34,33,33,32,32,31,30,30,29,28,28,27,27, - 26,25,25,24,24,23,22,22,21,21,20,19,19,18,18,17, - 17,16,15,15,14,14,13,13,12,12,11,10,10,9,9,8, - 8,7,7,6,6,5,5,4,4,3,3,2,2,1,0,0 - }; - - // For small denominators, it is cheaper to directly store the result. - // For bigger ones, just ONE Newton-Raphson iteration is enough to get - // maximum precision we need - static const uint32_t small_inv_tab[111] PROGMEM = { - 16777216,16777216,8388608,5592405,4194304,3355443,2796202,2396745,2097152,1864135,1677721,1525201,1398101,1290555,1198372,1118481, - 1048576,986895,932067,883011,838860,798915,762600,729444,699050,671088,645277,621378,599186,578524,559240,541200, - 524288,508400,493447,479349,466033,453438,441505,430185,419430,409200,399457,390167,381300,372827,364722,356962, - 349525,342392,335544,328965,322638,316551,310689,305040,299593,294337,289262,284359,279620,275036,270600,266305, - 262144,258111,254200,250406,246723,243148,239674,236298,233016,229824,226719,223696,220752,217885,215092,212369, - 209715,207126,204600,202135,199728,197379,195083,192841,190650,188508,186413,184365,182361,180400,178481,176602, - 174762,172960,171196,169466,167772,166111,164482,162885,161319,159783,158275,156796,155344,153919,152520 - }; - - // For small divisors, it is best to directly retrieve the results - if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - - register uint8_t r8 = d & 0xFF, - r9 = (d >> 8) & 0xFF, - r10 = (d >> 16) & 0xFF, - r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18; - register const uint8_t* ptab = inv_tab; - - __asm__ __volatile__( - // %8:%7:%6 = interval - // r31:r30: MUST be those registers, and they must point to the inv_tab - - A("clr %13") // %13 = 0 - - // Now we must compute - // result = 0xFFFFFF / d - // %8:%7:%6 = interval - // %16:%15:%14 = nr - // %13 = 0 - - // A plain division of 24x24 bits should take 388 cycles to complete. We will - // use Newton-Raphson for the calculation, and will strive to get way less cycles - // for the same result - Using C division, it takes 500cycles to complete . - - A("clr %3") // idx = 0 - A("mov %14,%6") - A("mov %15,%7") - A("mov %16,%8") // nr = interval - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") - A("mov %15,%14") // nr <<= 8, %14 not needed - A("subi %3,-8") // idx += 8 - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") // nr <<= 8, %14 not needed - A("clr %15") // We clear %14 - A("subi %3,-8") // idx += 8 - - // here %16 != 0 and %16:%15 contains at least 9 MSBits, or both %16:%15 are 0 - L("2") - A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? - A("brcc 3f") // No, skip this - A("swap %15") // Swap nibbles - A("swap %16") // Swap nibbles. Low nibble is 0 - A("mov %14, %15") - A("andi %14,0x0F") // Isolate low nibble - A("andi %15,0xF0") // Keep proper nibble in %15 - A("or %16, %14") // %16:%15 <<= 4 - A("subi %3,-4") // idx += 4 - - L("3") - A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? - A("brcc 4f") // No, skip this - A("add %15,%15") - A("adc %16,%16") - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 2 - A("subi %3,-2") // idx += 2 - - L("4") - A("cpi %16,0x80") // (nr & 0x800000) == 0 ? - A("brcc 5f") // No, skip this - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 1 - A("inc %3") // idx += 1 - - // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure - // we have at least 9 MSBits available to enter the initial estimation table - L("5") - A("add %15,%15") - A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) - A("add r30,%16") // Only use top 8 bits - A("adc r31,%13") // r31:r30 = inv_tab + (tidx) - A("lpm %14, Z") // %14 = inv_tab[tidx] - A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 - - // We must scale the approximation to the proper place - A("clr %16") // %16 will always be 0 here - A("subi %3,8") // idx == 8 ? - A("breq 6f") // yes, no need to scale - A("brcs 7f") // If C=1, means idx < 8, result was negative! - - // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8] - A("sbrs %3,0") // shift by 1bit position? - A("rjmp 8f") // No - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("8") - A("sbrs %3,1") // shift by 2bit position? - A("rjmp 9f") // No - A("add %14,%14") - A("adc %15,%15") - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("9") - A("sbrs %3,2") // shift by 4bits position? - A("rjmp 16f") // No - A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 - A("swap %14") // Swap nibbles - A("mov %12,%14") - A("andi %12,0x0F") // isolate low nibble - A("andi %14,0xF0") // and clear it - A("or %15,%12") // %15:%16 <<= 4 - L("16") - A("sbrs %3,3") // shift by 8bits position? - A("rjmp 6f") // No, we are done - A("mov %16,%15") - A("mov %15,%14") - A("clr %14") - A("jmp 6f") - - // idx < 8, now %3 = idx - 8. Get the count of bits - L("7") - A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] - A("sbrs %3,0") // shift by 1 bit position ? - A("rjmp 10f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("10") - A("sbrs %3,1") // shift by 2 bit position ? - A("rjmp 11f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("11") - A("sbrs %3,2") // shift by 4 bit position ? - A("rjmp 12f") // No, skip it - A("swap %15") // Swap nibbles - A("andi %14, 0xF0") // Lose the lowest nibble - A("swap %14") // Swap nibbles. Upper nibble is 0 - A("or %14,%15") // Pass nibble from upper byte - A("andi %15, 0x0F") // And get rid of that nibble - L("12") - A("sbrs %3,3") // shift by 8 bit position ? - A("rjmp 6f") // No, skip it - A("mov %14,%15") - A("clr %15") - L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d - - // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration - // of Newton-Raphson. As it has a quadratic convergence, 1 iteration is enough - // to get more than 18bits of precision (the initial table lookup gives 9 bits of - // precision to start from). 18bits of precision is all what is needed here for result - - // %8:%7:%6 = d = interval - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %13 = 0 - // %3:%2:%1:%0 = working accumulator - - // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive - A("clr %0") - A("clr %1") - A("clr %2") - A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 - A("mul %6,%14") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%14") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%14") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%15") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%15") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%15") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%16") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%16") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = (1<<25) - x*d [169] - - // We need to multiply that result by x, and we are only interested in the top 24bits of that multiply - - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %3:%2:%1:%0 = (1<<25) - x*d = acc - // %13 = 0 - - // result = %11:%10:%9:%5:%4 - A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) - A("mov %4,r1") - A("clr %5") - A("clr %9") - A("clr %10") - A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 - A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) - A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 - - A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) - A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 - A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 - - A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 - A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 - A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 - - A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 - A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 - A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) - A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 - - // At this point, %11:%10:%9 contains the new estimation of x. - - // Finally, we must correct the result. Estimate remainder as - // (1<<24) - x*d - // %11:%10:%9 = x - // %8:%7:%6 = d = interval" "\n\t" - A("ldi %3,1") - A("clr %2") - A("clr %1") - A("clr %0") // %3:%2:%1:%0 = 0x1000000 - A("mul %6,%9") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%9") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%9") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%10") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%10") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%10") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%11") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%11") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = r = (1<<24) - x*d - // %8:%7:%6 = d = interval - - // Perform the final correction - A("sub %0,%6") - A("sbc %1,%7") - A("sbc %2,%8") // r -= d - A("brcs 14f") // if ( r >= d) - - // %11:%10:%9 = x - A("ldi %3,1") - A("add %9,%3") - A("adc %10,%13") - A("adc %11,%13") // x++ - L("14") - - // Estimation is done. %11:%10:%9 = x - A("clr __zero_reg__") // Make C runtime happy - // [211 cycles total] - : "=r" (r2), - "=r" (r3), - "=r" (r4), - "=d" (r5), - "=r" (r6), - "=r" (r7), - "+r" (r8), - "+r" (r9), - "+r" (r10), - "=d" (r11), - "=r" (r12), - "=r" (r13), - "=d" (r14), - "=d" (r15), - "=d" (r16), - "=d" (r17), - "=d" (r18), - "+z" (ptab) - : - : "r0", "r1", "cc" - ); - - // Return the result - return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16); - } - -#endif // S_CURVE_ACCELERATION - -#define MINIMAL_STEP_RATE 120 - -/** - * Calculate trapezoid parameters, multiplying the entry- and exit-speeds - * by the provided factors. - ** - * ############ VERY IMPORTANT ############ - * NOTE that the PRECONDITION to call this function is that the block is - * NOT BUSY and it is marked as RECALCULATE. That WARRANTIES the Stepper ISR - * is not and will not use the block while we modify it, so it is safe to - * alter its values. - */ -void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { - - uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), - final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) - - // Limit minimal step rate (Otherwise the timer will overflow.) - NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); - NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate = initial_rate; - #endif - - const int32_t accel = block->acceleration_steps_per_s2; - - // Steps required for acceleration, deceleration to/from nominal rate - uint32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), - decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); - // Steps between acceleration and deceleration, if any - int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; - - // Does accelerate_steps + decelerate_steps exceed step_event_count? - // Then we can't possibly reach the nominal rate, there will be no cruising. - // Use intersection_distance() to calculate accel / braking time in order to - // reach the final_rate exactly at the end of this block. - if (plateau_steps < 0) { - const float accelerate_steps_float = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); - accelerate_steps = MIN(uint32_t(MAX(accelerate_steps_float, 0)), block->step_event_count); - plateau_steps = 0; - - #if ENABLED(S_CURVE_ACCELERATION) - // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); - #endif - } - #if ENABLED(S_CURVE_ACCELERATION) - else // We have some plateau time, so the cruise rate will be the nominal rate - cruise_rate = block->nominal_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Jerk controlled speed requires to express speed versus time, NOT steps - uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), - deceleration_time = ((float)(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE); - - // And to offload calculations from the ISR, we also calculate the inverse of those times here - uint32_t acceleration_time_inverse = get_period_inverse(acceleration_time); - uint32_t deceleration_time_inverse = get_period_inverse(deceleration_time); - #endif - - // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = accelerate_steps + plateau_steps; - block->initial_rate = initial_rate; - #if ENABLED(S_CURVE_ACCELERATION) - block->acceleration_time = acceleration_time; - block->deceleration_time = deceleration_time; - block->acceleration_time_inverse = acceleration_time_inverse; - block->deceleration_time_inverse = deceleration_time_inverse; - block->cruise_rate = cruise_rate; - #endif - block->final_rate = final_rate; -} - -/* PLANNER SPEED DEFINITION - +--------+ <- current->nominal_speed - / \ - current->entry_speed -> + \ - | + <- next->entry_speed (aka exit speed) - +-------------+ - time --> - - Recalculates the motion plan according to the following basic guidelines: - - 1. Go over every feasible block sequentially in reverse order and calculate the junction speeds - (i.e. current->entry_speed) such that: - a. No junction speed exceeds the pre-computed maximum junction speed limit or nominal speeds of - neighboring blocks. - b. A block entry speed cannot exceed one reverse-computed from its exit speed (next->entry_speed) - with a maximum allowable deceleration over the block travel distance. - c. The last (or newest appended) block is planned from a complete stop (an exit speed of zero). - 2. Go over every block in chronological (forward) order and dial down junction speed values if - a. The exit speed exceeds the one forward-computed from its entry speed with the maximum allowable - acceleration over the block travel distance. - - When these stages are complete, the planner will have maximized the velocity profiles throughout the all - of the planner blocks, where every block is operating at its maximum allowable acceleration limits. In - other words, for all of the blocks in the planner, the plan is optimal and no further speed improvements - are possible. If a new block is added to the buffer, the plan is recomputed according to the said - guidelines for a new optimal plan. - - To increase computational efficiency of these guidelines, a set of planner block pointers have been - created to indicate stop-compute points for when the planner guidelines cannot logically make any further - changes or improvements to the plan when in normal operation and new blocks are streamed and added to the - planner buffer. For example, if a subset of sequential blocks in the planner have been planned and are - bracketed by junction velocities at their maximums (or by the first planner block as well), no new block - added to the planner buffer will alter the velocity profiles within them. So we no longer have to compute - them. Or, if a set of sequential blocks from the first block in the planner (or a optimal stop-compute - point) are all accelerating, they are all optimal and can not be altered by a new block added to the - planner buffer, as this will only further increase the plan speed to chronological blocks until a maximum - junction velocity is reached. However, if the operational conditions of the plan changes from infrequently - used feed holds or feedrate overrides, the stop-compute pointers will be reset and the entire plan is - recomputed as stated in the general guidelines. - - Planner buffer index mapping: - - block_buffer_tail: Points to the beginning of the planner buffer. First to be executed or being executed. - - block_buffer_head: Points to the buffer block after the last block in the buffer. Used to indicate whether - the buffer is full or empty. As described for standard ring buffers, this block is always empty. - - block_buffer_planned: Points to the first buffer block after the last optimally planned block for normal - streaming operating conditions. Use for planning optimizations by avoiding recomputing parts of the - planner buffer that don't change with the addition of a new block, as describe above. In addition, - this block can never be less than block_buffer_tail and will always be pushed forward and maintain - this requirement when encountered by the Planner::discard_current_block() routine during a cycle. - - NOTE: Since the planner only computes on what's in the planner buffer, some motions with lots of short - line segments, like G2/3 arcs or complex curves, may seem to move slow. This is because there simply isn't - enough combined distance traveled in the entire buffer to accelerate up to the nominal speed and then - decelerate to a complete stop at the end of the buffer, as stated by the guidelines. If this happens and - becomes an annoyance, there are a few simple solutions: (1) Maximize the machine acceleration. The planner - will be able to compute higher velocity profiles within the same combined distance. (2) Maximize line - motion(s) distance per block to a desired tolerance. The more combined distance the planner has to use, - the faster it can go. (3) Maximize the planner buffer size. This also will increase the combined distance - for the planner to compute over. It also increases the number of computations the planner has to perform - to compute an optimal plan, so select carefully. -*/ - -// The kernel called by recalculate() when scanning the plan from last to first entry. -void Planner::reverse_pass_kernel(block_t* const current, const block_t * const next) { - if (current) { - // If entry speed is already at the maximum entry speed, and there was no change of speed - // in the next block, there is no need to recheck. Block is cruising and there is no need to - // compute anything for this block, - // If not, block entry speed needs to be recalculated to ensure maximum possible planned speed. - const float max_entry_speed_sqr = current->max_entry_speed_sqr; - - // Compute maximum entry speed decelerating over the current block from its exit speed. - // If not at the maximum entry speed, or the previous block entry speed changed - if (current->entry_speed_sqr != max_entry_speed_sqr || (next && TEST(next->flag, BLOCK_BIT_RECALCULATE))) { - - // If nominal length true, max junction speed is guaranteed to be reached. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - - const float new_entry_speed_sqr = TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) - ? max_entry_speed_sqr - : MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(float(MINIMUM_PLANNER_SPEED)), current->millimeters)); - if (current->entry_speed_sqr != new_entry_speed_sqr) { - - // Need to recalculate the block speed - Mark it now, so the stepper - // ISR does not consume the block before being recalculated - SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block may have - // become BUSY just before being marked RECALCULATE, so check for that! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks). And don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY so this is ahead of the Stepper ISR: - // Just Set the new entry speed. - current->entry_speed_sqr = new_entry_speed_sqr; - } - } - } - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the reverse pass. - */ -void Planner::reverse_pass() { - // Initialize block index to the last block in the planner buffer. - uint8_t block_index = prev_block_index(block_buffer_head); - - // Read the index of the last buffer planned block. - // The ISR may change it so get a stable local copy. - uint8_t planned_block_index = block_buffer_planned; - - // If there was a race condition and block_buffer_planned was incremented - // or was pointing at the head (queue empty) break loop now and avoid - // planning already consumed blocks - if (planned_block_index == block_buffer_head) return; - - // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last - // block in buffer. Cease planning when the last optimal planned or tail pointer is reached. - // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan. - const block_t *next = NULL; - while (block_index != planned_block_index) { - - // Perform the reverse pass - block_t *current = &block_buffer[block_index]; - - // Only consider non sync blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { - reverse_pass_kernel(current, next); - next = current; - } - - // Advance to the next - block_index = prev_block_index(block_index); - - // The ISR could advance the block_buffer_planned while we were doing the reverse pass. - // We must try to avoid using an already consumed block as the last one - So follow - // changes to the pointer and make sure to limit the loop to the currently busy block - while (planned_block_index != block_buffer_planned) { - - // If we reached the busy block or an already processed block, break the loop now - if (block_index == planned_block_index) return; - - // Advance the pointer, following the busy block - planned_block_index = next_block_index(planned_block_index); - } - } -} - -// The kernel called by recalculate() when scanning the plan from first to last entry. -void Planner::forward_pass_kernel(const block_t* const previous, block_t* const current, const uint8_t block_index) { - if (previous) { - // If the previous block is an acceleration block, too short to complete the full speed - // change, adjust the entry speed accordingly. Entry speeds have already been reset, - // maximized, and reverse-planned. If nominal length is set, max junction speed is - // guaranteed to be reached. No need to recheck. - if (!TEST(previous->flag, BLOCK_BIT_NOMINAL_LENGTH) && - previous->entry_speed_sqr < current->entry_speed_sqr) { - - // Compute the maximum allowable speed - const float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - - // If true, current block is full-acceleration and we can move the planned pointer forward. - if (new_entry_speed_sqr < current->entry_speed_sqr) { - - // Mark we need to recompute the trapezoidal shape, and do it now, - // so the stepper ISR does not consume the block before being recalculated - SBI(current->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)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks and don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY, we won the race against the Stepper ISR: - - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. - - // Set optimal plan pointer. - block_buffer_planned = block_index; - } - } - } - - // Any block set at its maximum entry speed also creates an optimal plan up to this - // point in the buffer. When the plan is bracketed by either the beginning of the - // buffer and a maximum entry speed or two maximum entry speeds, every block in between - // cannot logically be further improved. Hence, we don't have to recompute them anymore. - if (current->entry_speed_sqr == current->max_entry_speed_sqr) - block_buffer_planned = block_index; - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the forward pass. - */ -void Planner::forward_pass() { - - // Forward Pass: Forward plan the acceleration curve from the planned pointer onward. - // Also scans for optimal plan breakpoints and appropriately updates the planned pointer. - - // Begin at buffer planned pointer. Note that block_buffer_planned can be modified - // by the stepper ISR, so read it ONCE. It it guaranteed that block_buffer_planned - // will never lead head, so the loop is safe to execute. Also note that the forward - // pass will never modify the values at the tail. - uint8_t block_index = block_buffer_planned; - - block_t *current; - const block_t * previous = NULL; - while (block_index != block_buffer_head) { - - // Perform the forward pass - current = &block_buffer[block_index]; - - // Skip SYNC blocks - if (!TEST(current->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; - } - // Advance to the previous - block_index = next_block_index(block_index); - } -} - -/** - * Recalculate the trapezoid speed profiles for all blocks in the plan - * according to the entry_factor for each junction. Must be called by - * recalculate() after updating the blocks. - */ -void Planner::recalculate_trapezoids() { - // The tail may be changed by the ISR so get a local copy. - uint8_t block_index = block_buffer_tail, - head_block_index = block_buffer_head; - // Since there could be a sync block in the head of the queue, and the - // next loop must not recalculate the head block (as it needs to be - // specially handled), scan backwards to the first non-SYNC block. - while (head_block_index != block_index) { - - // Go back (head always point to the first free block) - const uint8_t prev_index = prev_block_index(head_block_index); - - // Get the pointer to the block - block_t *prev = &block_buffer[prev_index]; - - // If not dealing with a sync block, we are done. The last block is not a SYNC block - if (!TEST(prev->flag, BLOCK_BIT_SYNC_POSITION)) break; - - // Examine the previous block. This and all following are SYNC blocks - head_block_index = prev_index; - } - - // Go from the tail (currently executed block) to the first block, without including it) - block_t *current = NULL, *next = NULL; - float current_entry_speed = 0.0, next_entry_speed = 0.0; - while (block_index != head_block_index) { - - next = &block_buffer[block_index]; - - // Skip sync blocks - if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { - next_entry_speed = SQRT(next->entry_speed_sqr); - - if (current) { - // Recalculate if current block entry or exit junction speed has changed. - if (TEST(current->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); - - // 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)) { - // 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), - nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(current, 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 * axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->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); - } - } - - current = next; - current_entry_speed = next_entry_speed; - } - - block_index = next_block_index(block_index); - } - - // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated. - if (next) { - - // Mark the next(last) block as RECALCULATE, to prevent the Stepper ISR running it. - // As the last block is always recalculated here, there is a chance the block isn't - // marked as RECALCULATE yet. That's the reason for the following line. - SBI(next->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)) { - // Block is not BUSY, we won the race against the Stepper ISR: - - const float next_nominal_speed = SQRT(next->nominal_speed_sqr), - nomr = 1.0f / next_nominal_speed; - calculate_trapezoid_for_block(next, next_entry_speed * nomr, float(MINIMUM_PLANNER_SPEED) * nomr); - #if ENABLED(LIN_ADVANCE) - if (next->use_advance_lead) { - const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - next->max_adv_steps = next_nominal_speed * comp; - next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; - } - #endif - } - - // Reset next only to ensure its trapezoid is computed - The stepper is free to use - // the block from now on. - CBI(next->flag, BLOCK_BIT_RECALCULATE); - } -} - -void Planner::recalculate() { - // Initialize block index to the last block in the planner buffer. - const uint8_t block_index = prev_block_index(block_buffer_head); - // If there is just one block, no planning can be done. Avoid it! - if (block_index != block_buffer_planned) { - reverse_pass(); - forward_pass(); - } - recalculate_trapezoids(); -} - -#if ENABLED(AUTOTEMP) - - void Planner::getHighESpeed() { - static float oldt = 0; - - if (!autotemp_enabled) return; - if (thermalManager.degTargetHotend(0) + 2 < autotemp_min) return; // probably temperature set to zero. - - float high = 0.0; - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t* block = &block_buffer[b]; - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) { - const float se = (float)block->steps[E_AXIS] / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; - NOLESS(high, se); - } - } - - float t = autotemp_min + high * autotemp_factor; - t = constrain(t, autotemp_min, autotemp_max); - if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); - oldt = t; - thermalManager.setTargetHotend(t, 0); - } - -#endif // AUTOTEMP - -/** - * Maintain fans, paste extruder pressure, - */ -void Planner::check_axes_activity() { - unsigned char axis_active[NUM_AXIS] = { 0 }, - tail_fan_speed[FAN_COUNT]; - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - uint8_t tail_valve_pressure; - #endif - #if HAS_HEATER_2 - uint8_t tail_e_to_p_pressure; - #endif - #endif - - if (has_blocks_queued()) { - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) - tail_fan_speed[i] = block_buffer[block_buffer_tail].fan_speed[i]; - #endif - - block_t* block; - - #if ENABLED(BARICUDA) - block = &block_buffer[block_buffer_tail]; - #if HAS_HEATER_1 - tail_valve_pressure = block->valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = block->e_to_p_pressure; - #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]++; - } - } - else { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) tail_fan_speed[i] = fanSpeeds[i]; - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - tail_valve_pressure = baricuda_valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - #endif - } - - #if ENABLED(DISABLE_X) - if (!axis_active[X_AXIS]) disable_X(); - #endif - #if ENABLED(DISABLE_Y) - if (!axis_active[Y_AXIS]) disable_Y(); - #endif - #if ENABLED(DISABLE_Z) - if (!axis_active[Z_AXIS]) disable_Z(); - #endif - #if ENABLED(DISABLE_E) - if (!axis_active[E_AXIS]) disable_e_steppers(); - #endif - - #if FAN_COUNT > 0 - - #if FAN_KICKSTART_TIME > 0 - - static millis_t fan_kick_end[FAN_COUNT] = { 0 }; - - #define KICKSTART_FAN(f) \ - if (tail_fan_speed[f]) { \ - millis_t ms = millis(); \ - if (fan_kick_end[f] == 0) { \ - fan_kick_end[f] = ms + FAN_KICKSTART_TIME; \ - tail_fan_speed[f] = 255; \ - } else if (PENDING(ms, fan_kick_end[f])) \ - tail_fan_speed[f] = 255; \ - } else fan_kick_end[f] = 0 - - #if HAS_FAN0 - KICKSTART_FAN(0); - #endif - #if HAS_FAN1 - KICKSTART_FAN(1); - #endif - #if HAS_FAN2 - KICKSTART_FAN(2); - #endif - - #endif // FAN_KICKSTART_TIME > 0 - - #if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255 - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : 0) - #else - #define CALC_FAN_SPEED(f) tail_fan_speed[f] - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - thermalManager.soft_pwm_amount_fan[0] = CALC_FAN_SPEED(0); - #endif - #if HAS_FAN1 - thermalManager.soft_pwm_amount_fan[1] = CALC_FAN_SPEED(1); - #endif - #if HAS_FAN2 - thermalManager.soft_pwm_amount_fan[2] = CALC_FAN_SPEED(2); - #endif - #else - #if HAS_FAN0 - analogWrite(FAN_PIN, CALC_FAN_SPEED(0)); - #endif - #if HAS_FAN1 - analogWrite(FAN1_PIN, CALC_FAN_SPEED(1)); - #endif - #if HAS_FAN2 - analogWrite(FAN2_PIN, CALC_FAN_SPEED(2)); - #endif - #endif - - #endif // FAN_COUNT > 0 - - #if ENABLED(AUTOTEMP) - getHighESpeed(); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - analogWrite(HEATER_1_PIN, tail_valve_pressure); - #endif - #if HAS_HEATER_2 - analogWrite(HEATER_2_PIN, tail_e_to_p_pressure); - #endif - #endif -} - -#if DISABLED(NO_VOLUMETRICS) - - /** - * Get a volumetric multiplier from a filament diameter. - * This is the reciprocal of the circular cross-section area. - * Return 1.0 with volumetric off or a diameter of 0.0. - */ - inline float calculate_volumetric_multiplier(const float &diameter) { - return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5) : 1.0; - } - - /** - * Convert the filament sizes into volumetric multipliers. - * The multiplier converts a given E value into a length. - */ - void Planner::calculate_volumetric_multipliers() { - for (uint8_t i = 0; i < COUNT(filament_size); i++) { - volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); - refresh_e_factor(i); - } - } - -#endif // !NO_VOLUMETRICS - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Convert the ratio value given by the filament width sensor - * 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) { - // 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 - - refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); - } -#endif - -#if PLANNER_LEVELING || HAS_UBL_AND_CURVES - /** - * rx, ry, rz - Cartesian positions in mm - * Leveled XYZ on completion - */ - void Planner::apply_leveling(float &rx, float &ry, float &rz) { - - #if ENABLED(SKEW_CORRECTION) - skew(rx, ry, rz); - #endif - - if (!leveling_active) return; - - #if ABL_PLANAR - - float dx = rx - (X_TILT_FULCRUM), - dy = ry - (Y_TILT_FULCRUM); - - apply_rotation_xyz(bed_level_matrix, dx, dy, rz); - - rx = dx + X_TILT_FULCRUM; - ry = dy + Y_TILT_FULCRUM; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(rz); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const float raw[XYZ] = { rx, ry, 0 }; - #endif - - rz += ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(rx, ry - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(rx, ry) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - -#endif - -#if PLANNER_LEVELING - - void Planner::unapply_leveling(float raw[XYZ]) { - - if (leveling_active) { - - #if ABL_PLANAR - - matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); - - float dx = raw[X_AXIS] - (X_TILT_FULCRUM), - dy = raw[Y_AXIS] - (Y_TILT_FULCRUM); - - apply_rotation_xyz(inverse, dx, dy, raw[Z_AXIS]); - - raw[X_AXIS] = dx + X_TILT_FULCRUM; - raw[Y_AXIS] = dy + Y_TILT_FULCRUM; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw[Z_AXIS]); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - raw[Z_AXIS] -= ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw[X_AXIS], raw[Y_AXIS] - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw[X_AXIS], raw[Y_AXIS]) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - - #if ENABLED(SKEW_CORRECTION) - unskew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); - #endif - } - -#endif // PLANNER_LEVELING - -void Planner::quick_stop() { - - // Remove all the queued blocks. Note that this function is NOT - // called from the Stepper ISR, so we must consider tail as readonly! - // that is why we set head to tail - But there is a race condition that - // must be handled: The tail could change between the read and the assignment - // so this must be enclosed in a critical section - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // Drop all queue entries - block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail; - - // Restart the block delay for the first movement - As the queue was - // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - - #if ENABLED(ULTRA_LCD) - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif - - // Make sure to drop any attempt of queuing moves for at least 1 second - cleaning_buffer_counter = 1000; - - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // And stop the stepper ISR - stepper.quick_stop(); -} - -void Planner::endstop_triggered(const AxisEnum axis) { - // Record stepper position and discard the current block - stepper.endstop_triggered(axis); -} - -float Planner::triggered_position_mm(const AxisEnum axis) { - return stepper.triggered_position(axis) * steps_to_mm[axis]; -} - -void Planner::finish_and_disable() { - while (has_blocks_queued() || cleaning_buffer_counter) idle(); - disable_all_steppers(); -} - -/** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ -float Planner::get_axis_position_mm(const AxisEnum axis) { - float axis_steps; - #if IS_CORE - // Requesting one of the "core" axes? - if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) { - - // Protect the access to the position. - 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) - ); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - else - axis_steps = stepper.position(axis); - #else - axis_steps = stepper.position(axis); - #endif - return axis_steps * steps_to_mm[axis]; -} - -/** - * Block until all buffered steps are executed / cleaned - */ -void Planner::synchronize() { while (has_blocks_queued() || cleaning_buffer_counter) idle(); } - -/** - * Planner::_buffer_steps - * - * Add a new linear movement to the planner queue (in terms of steps). - * - * target - target position in steps units - * 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 - */ -bool Planner::_buffer_steps(const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters -) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Fill the block with the specified movement - if (!_populate_block(block, false, target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - )) { - // Movement was not queued, probably because it was too short. - // Simply accept that as movement queued and done - return true; - } - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - // Move buffer head - block_buffer_head = next_buffer_head; - - // Recalculate and optimize trapezoidal speed profiles - recalculate(); - - // Movement successfully queued! - return true; -} - -/** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * - * Returns true is movement is acceptable, false otherwise - */ -bool Planner::_populate_block(block_t * const block, bool split_move, - const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float 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]; - - /* <-- 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)"); - //*/ - - #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (de) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(extruder)) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(de * e_factor[extruder]) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif // PREVENT_LENGTHY_EXTRUDE - } - #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE - - // Compute direction bit-mask for this block - uint8_t dm = 0; - #if CORE_IS_XY - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_HEAD); // ...and Y - if (dc < 0) SBI(dm, Z_AXIS); - if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction - #elif CORE_IS_XZ - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #elif CORE_IS_YZ - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_HEAD); // Save the real Extruder (head) direction in Y Axis - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction - if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #else - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_AXIS); - #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; - - // Clear all flags, including the "busy" bit - block->flag = 0x00; - - // Set direction bits - block->direction_bits = dm; - - // Number of steps for each axis - // See http://www.corexy.com/theory.html - #if CORE_IS_XY - block->steps[A_AXIS] = ABS(da + db); - block->steps[B_AXIS] = ABS(da - db); - block->steps[Z_AXIS] = ABS(dc); - #elif CORE_IS_XZ - block->steps[A_AXIS] = ABS(da + dc); - block->steps[Y_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(da - dc); - #elif CORE_IS_YZ - block->steps[X_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db + dc); - block->steps[C_AXIS] = ABS(db - dc); - #elif IS_SCARA - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[Z_AXIS] = ABS(dc); - #else - // default non-h-bot planning - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(dc); - #endif - - block->steps[E_AXIS] = esteps; - block->step_event_count = MAX4(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps); - - // Bail if this is a zero-length block - if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; - - // For a mixing extruder, get a magnified esteps for each - #if ENABLED(MIXING_EXTRUDER) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - block->mix_steps[i] = mixing_factor[i] * ( - #if ENABLED(LIN_ADVANCE) - esteps - #else - block->step_event_count - #endif - ); - #endif - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fanSpeeds[i]; - #endif - - #if ENABLED(BARICUDA) - block->valve_pressure = baricuda_valve_pressure; - block->e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - - block->active_extruder = extruder; - - #if ENABLED(AUTO_POWER_CONTROL) - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) - powerManager.power_on(); - #endif - - // Enable active axes - #if CORE_IS_XY - if (block->steps[A_AXIS] || block->steps[B_AXIS]) { - enable_X(); - enable_Y(); - } - #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); - #endif - #elif CORE_IS_XZ - if (block->steps[A_AXIS] || block->steps[C_AXIS]) { - enable_X(); - enable_Z(); - } - if (block->steps[Y_AXIS]) enable_Y(); - #elif CORE_IS_YZ - if (block->steps[B_AXIS] || block->steps[C_AXIS]) { - enable_Y(); - enable_Z(); - } - if (block->steps[X_AXIS]) enable_X(); - #else - if (block->steps[X_AXIS]) enable_X(); - if (block->steps[Y_AXIS]) enable_Y(); - #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); - #endif - #endif - - // Enable extruder(s) - if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - - #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(); - - 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: - #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); - #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 ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_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); - #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); - #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); - #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); - enable_E4(); - g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; - break; - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #else - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); - #endif - } - - if (esteps) - NOLESS(fr_mm_s, min_feedrate_mm_s); - else - NOLESS(fr_mm_s, min_travel_feedrate_mm_s); - - /** - * This part of the code calculates the total length of the movement. - * For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS. - * But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS - * and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y. - * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. - * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. - */ - #if IS_CORE - float delta_mm[Z_HEAD + 1]; - #if CORE_IS_XY - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS]; - delta_mm[A_AXIS] = (da + db) * steps_to_mm[A_AXIS]; - delta_mm[B_AXIS] = CORESIGN(da - db) * steps_to_mm[B_AXIS]; - #elif CORE_IS_XZ - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[A_AXIS] = (da + dc) * steps_to_mm[A_AXIS]; - delta_mm[C_AXIS] = CORESIGN(da - dc) * steps_to_mm[C_AXIS]; - #elif CORE_IS_YZ - delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[B_AXIS] = (db + dc) * steps_to_mm[B_AXIS]; - delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; - #endif - #else - float delta_mm[ABCE]; - delta_mm[A_AXIS] = da * steps_to_mm[A_AXIS]; - 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]; - - 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]); - } - else if (!millimeters) { - block->millimeters = SQRT( - #if CORE_IS_XY - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS]) - #elif CORE_IS_XZ - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) - #elif CORE_IS_YZ - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) - #else - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) - #endif - ); - } - else - block->millimeters = millimeters; - - const float inverse_millimeters = 1.0f / block->millimeters; // Inverse millimeters to remove multiple divides - - // Calculate inverse time for this move. No divide by zero due to previous checks. - // Example: At 120mm/s a 60mm move takes 0.5s. So this will give 2.0. - float inverse_secs = fr_mm_s * inverse_millimeters; - - // Get the number of non busy movements in queue (non busy means that they can be altered) - const uint8_t moves_queued = nonbusy_movesplanned(); - - // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill - #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) - // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); - #endif - - #if ENABLED(SLOWDOWN) - if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) { - if (segment_time_us < min_segment_time_us) { - // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - const uint32_t nst = segment_time_us + LROUND(2 * (min_segment_time_us - segment_time_us) / moves_queued); - inverse_secs = 1000000.0f / nst; - #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) - segment_time_us = nst; - #endif - } - } - #endif - - #if ENABLED(ULTRA_LCD) - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us += segment_time_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 - 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? - } - } - } - #endif - - // Calculate and limit speed in mm/sec for each axis - float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed - LOOP_XYZE(i) { - const float cs = ABS((current_speed[i] = delta_mm[i] * inverse_secs)); - #if ENABLED(DISTINCT_E_FACTORS) - if (i == E_AXIS) i += extruder; - #endif - if (cs > max_feedrate_mm_s[i]) NOMORE(speed_factor, max_feedrate_mm_s[i] / cs); - } - - // Max segment time in µs. - #ifdef XY_FREQUENCY_LIMIT - - // Check and limit the xy direction change frequency - const unsigned char direction_change = block->direction_bits ^ old_direction_bits; - old_direction_bits = block->direction_bits; - segment_time_us = LROUND((float)segment_time_us / speed_factor); - - uint32_t xs0 = axis_segment_time_us[X_AXIS][0], - xs1 = axis_segment_time_us[X_AXIS][1], - xs2 = axis_segment_time_us[X_AXIS][2], - ys0 = axis_segment_time_us[Y_AXIS][0], - ys1 = axis_segment_time_us[Y_AXIS][1], - ys2 = axis_segment_time_us[Y_AXIS][2]; - - if (TEST(direction_change, X_AXIS)) { - xs2 = axis_segment_time_us[X_AXIS][2] = xs1; - xs1 = axis_segment_time_us[X_AXIS][1] = xs0; - xs0 = 0; - } - xs0 = axis_segment_time_us[X_AXIS][0] = xs0 + segment_time_us; - - if (TEST(direction_change, Y_AXIS)) { - ys2 = axis_segment_time_us[Y_AXIS][2] = axis_segment_time_us[Y_AXIS][1]; - ys1 = axis_segment_time_us[Y_AXIS][1] = axis_segment_time_us[Y_AXIS][0]; - ys0 = 0; - } - ys0 = axis_segment_time_us[Y_AXIS][0] = ys0 + segment_time_us; - - const uint32_t max_x_segment_time = MAX3(xs0, xs1, xs2), - max_y_segment_time = MAX3(ys0, ys1, ys2), - min_xy_segment_time = MIN(max_x_segment_time, max_y_segment_time); - if (min_xy_segment_time < MAX_FREQ_TIME_US) { - const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US); - NOMORE(speed_factor, low_sf); - } - #endif // XY_FREQUENCY_LIMIT - - // Correct the speed - if (speed_factor < 1.0f) { - LOOP_XYZE(i) current_speed[i] *= speed_factor; - block->nominal_rate *= speed_factor; - block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); - } - - // Compute and limit the acceleration rate for the trapezoid generator. - const float steps_per_mm = block->step_event_count * inverse_millimeters; - uint32_t accel; - if (!block->steps[A_AXIS] && !block->steps[B_AXIS] && !block->steps[C_AXIS]) { - // convert to: acceleration steps/sec^2 - accel = CEIL(retract_acceleration * steps_per_mm); - #if ENABLED(LIN_ADVANCE) - block->use_advance_lead = false; - #endif - } - else { - #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const uint32_t comp = max_acceleration_steps_per_s2[AXIS+INDX] * block->step_event_count; \ - if (accel * block->steps[AXIS] > comp) accel = comp / block->steps[AXIS]; \ - } \ - }while(0) - - #define LIMIT_ACCEL_FLOAT(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const float comp = (float)max_acceleration_steps_per_s2[AXIS+INDX] * (float)block->step_event_count; \ - if ((float)accel * (float)block->steps[AXIS] > comp) accel = comp / (float)block->steps[AXIS]; \ - } \ - }while(0) - - // Start with print or travel acceleration - accel = CEIL((esteps ? acceleration : travel_acceleration) * steps_per_mm); - - #if ENABLED(LIN_ADVANCE) - - #if ENABLED(JUNCTION_DEVIATION) - #if ENABLED(DISTINCT_E_FACTORS) - #define MAX_E_JERK max_e_jerk[extruder] - #else - #define MAX_E_JERK max_e_jerk - #endif - #else - #define MAX_E_JERK max_jerk[E_AXIS] - #endif - - /** - * - * Use LIN_ADVANCE for blocks if all these are true: - * - * esteps : This is a print move, because we checked for A, B, C steps before. - * - * extruder_advance_K : There is an advance factor set. - * - * de > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves) - */ - block->use_advance_lead = esteps - && extruder_advance_K - && de > 0; - - if (block->use_advance_lead) { - block->e_D_ratio = (target_float[E_AXIS] - position_float[E_AXIS]) / - #if IS_KINEMATIC - block->millimeters - #else - SQRT(sq(target_float[X_AXIS] - position_float[X_AXIS]) - + sq(target_float[Y_AXIS] - position_float[Y_AXIS]) - + sq(target_float[Z_AXIS] - position_float[Z_AXIS])) - #endif - ; - - // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance! - // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. - if (block->e_D_ratio > 3.0f) - block->use_advance_lead = false; - else { - const uint32_t max_accel_steps_per_s2 = MAX_E_JERK / (extruder_advance_K * block->e_D_ratio) * steps_per_mm; - #if ENABLED(LA_DEBUG) - if (accel > max_accel_steps_per_s2) SERIAL_ECHOLNPGM("Acceleration limited."); - #endif - NOMORE(accel, max_accel_steps_per_s2); - } - } - #endif - - #if ENABLED(DISTINCT_E_FACTORS) - #define ACCEL_IDX extruder - #else - #define ACCEL_IDX 0 - #endif - - // Limit acceleration per axis - if (block->step_event_count <= cutoff_long) { - LIMIT_ACCEL_LONG(A_AXIS, 0); - LIMIT_ACCEL_LONG(B_AXIS, 0); - LIMIT_ACCEL_LONG(C_AXIS, 0); - LIMIT_ACCEL_LONG(E_AXIS, ACCEL_IDX); - } - else { - LIMIT_ACCEL_FLOAT(A_AXIS, 0); - LIMIT_ACCEL_FLOAT(B_AXIS, 0); - LIMIT_ACCEL_FLOAT(C_AXIS, 0); - LIMIT_ACCEL_FLOAT(E_AXIS, ACCEL_IDX); - } - } - block->acceleration_steps_per_s2 = accel; - block->acceleration = accel / steps_per_mm; - #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (4096.0f * 4096.0f / (STEPPER_TIMER_RATE))); - #endif - #if ENABLED(LIN_ADVANCE) - if (block->use_advance_lead) { - block->advance_speed = (STEPPER_TIMER_RATE) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]); - #if ENABLED(LA_DEBUG) - if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) - SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); - if (block->advance_speed < 200) - SERIAL_ECHOLNPGM("eISR running at > 10kHz."); - #endif - } - #endif - - float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 - - #if ENABLED(JUNCTION_DEVIATION) - - /** - * Compute maximum allowable entry speed at junction by centripetal acceleration approximation. - * Let a circle be tangent to both previous and current path line segments, where the junction - * deviation is defined as the distance from the junction to the closest edge of the circle, - * colinear with the circle center. The circular segment joining the two paths represents the - * path of centripetal acceleration. Solve for max velocity based on max acceleration about the - * radius of the circle, defined indirectly by junction deviation. This may be also viewed as - * path width or max_jerk in the previous Grbl version. This approach does not actually deviate - * from path, but used as a robust way to compute cornering speeds, as it takes into account the - * nonlinearities of both the junction angle and junction velocity. - * - * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path - * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact - * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here - * is exactly the same. Instead of motioning all the way to junction point, the machine will - * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform - * a continuous mode path, but ARM-based microcontrollers most certainly do. - * - * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be - * changed dynamically during operation nor can the line move geometry. This must be kept in - * memory in the event of a feedrate override changing the nominal speeds of blocks, which can - * change the overall maximum entry speed conditions of all blocks. - * - * ####### - * https://github.com/MarlinFirmware/Marlin/issues/10341#issuecomment-388191754 - * - * hoffbaked: on May 10 2018 tuned and improved the GRBL algorithm for Marlin: - Okay! It seems to be working good. I somewhat arbitrarily cut it off at 1mm - on then on anything with less sides than an octagon. With this, and the - reverse pass actually recalculating things, a corner acceleration value - of 1000 junction deviation of .05 are pretty reasonable. If the cycles - can be spared, a better acos could be used. For all I know, it may be - already calculated in a different place. */ - - // Unit vector of previous path line segment - static float previous_unit_vec[XYZE]; - - float unit_vec[] = { - delta_mm[A_AXIS] * inverse_millimeters, - delta_mm[B_AXIS] * inverse_millimeters, - delta_mm[C_AXIS] * inverse_millimeters, - delta_mm[E_AXIS] * inverse_millimeters - }; - - // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Compute cosine of angle between previous and current path. (prev_unit_vec is negative) - // NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity. - float junction_cos_theta = -previous_unit_vec[X_AXIS] * unit_vec[X_AXIS] - -previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS] - -previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS] - -previous_unit_vec[E_AXIS] * unit_vec[E_AXIS] - ; - - // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). - if (junction_cos_theta > 0.999999f) { - // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); - } - else { - NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. - - // Convert delta vector to unit vector - float junction_unit_vec[XYZE] = { - unit_vec[X_AXIS] - previous_unit_vec[X_AXIS], - unit_vec[Y_AXIS] - previous_unit_vec[Y_AXIS], - unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS], - unit_vec[E_AXIS] - previous_unit_vec[E_AXIS] - }; - normalize_junction_vector(junction_unit_vec); - - const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), - sin_theta_d2 = SQRT(0.5f * (1.0f - junction_cos_theta)); // Trig half angle identity. Always positive. - - vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0f - sin_theta_d2); - if (block->millimeters < 1) { - - // Fast acos approximation, minus the error bar to be safe - const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18f; - - // If angle is greater than 135 degrees (octagon), find speed for approximate arc - if (junction_theta > RADIANS(135)) { - const float limit_sqr = block->millimeters / (RADIANS(180) - junction_theta) * junction_acceleration; - NOMORE(vmax_junction_sqr, limit_sqr); - } - } - } - - // Get the lowest speed - vmax_junction_sqr = MIN3(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); - } - else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0; - - COPY(previous_unit_vec, unit_vec); - - #else // Classic Jerk Limiting - - /** - * Adapted from Průša MKS firmware - * https://github.com/prusa3d/Prusa-Firmware - */ - const float nominal_speed = SQRT(block->nominal_speed_sqr); - - // Exit speed limited by a jerk to full halt of a previous last segment - static float previous_safe_speed; - - // Start with a safe speed (from which the machine may halt to stop immediately). - float safe_speed = nominal_speed; - - uint8_t limited = 0; - LOOP_XYZE(i) { - const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis - maxj = max_jerk[i]; // mj : The max jerk setting for this axis - if (jerk > maxj) { // cs > mj : New current speed too fast? - if (limited) { // limited already? - const float mjerk = nominal_speed * maxj; // ns*mj - if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs - } - else { - safe_speed *= maxj / jerk; // Initial limit: ns*mj/cs - ++limited; // Initially limited - } - } - } - - float vmax_junction; - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Estimate a maximum velocity allowed at a joint of two successive segments. - // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, - // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. - - // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. - float v_factor = 1; - limited = 0; - - // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. - // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. - const float previous_nominal_speed = SQRT(previous_nominal_speed_sqr); - vmax_junction = MIN(nominal_speed, previous_nominal_speed); - - // Now limit the jerk in all axes. - const float smaller_speed_factor = vmax_junction / previous_nominal_speed; - LOOP_XYZE(axis) { - // Limit an axis. We have to differentiate: coasting, reversal of an axis, full stop. - float v_exit = previous_speed[axis] * smaller_speed_factor, - v_entry = current_speed[axis]; - if (limited) { - v_exit *= v_factor; - v_entry *= v_factor; - } - - // Calculate jerk depending on whether the axis is coasting in the same direction or reversing. - const float jerk = (v_exit > v_entry) - ? // coasting axis reversal - ( (v_entry > 0 || v_exit < 0) ? (v_exit - v_entry) : MAX(v_exit, -v_entry) ) - : // v_exit <= v_entry coasting axis reversal - ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : MAX(-v_exit, v_entry) ); - - if (jerk > max_jerk[axis]) { - v_factor *= max_jerk[axis] / jerk; - ++limited; - } - } - if (limited) vmax_junction *= v_factor; - // Now the transition velocity is known, which maximizes the shared exit / entry velocity while - // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. - const float vmax_junction_threshold = vmax_junction * 0.99f; - if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) - vmax_junction = safe_speed; - } - else - vmax_junction = safe_speed; - - previous_safe_speed = safe_speed; - vmax_junction_sqr = sq(vmax_junction); - - #endif // Classic Jerk Limiting - - // Max entry speed of this block equals the max exit speed of the previous block. - block->max_entry_speed_sqr = vmax_junction_sqr; - - // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); - - // If we are trying to add a split block, start with the - // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : MIN(vmax_junction_sqr, v_allowable_sqr); - - // Initialize planner efficiency flags - // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag |= block->nominal_speed_sqr <= v_allowable_sqr ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE; - - // Update previous path unit_vector and nominal speed - COPY(previous_speed, current_speed); - previous_nominal_speed_sqr = block->nominal_speed_sqr; - - // Update the position - static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!"); - COPY(position, target); - #if HAS_POSITION_FLOAT - COPY(position_float, target_float); - #endif - - // Movement was accepted - return true; -} // _populate_block() - -/** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ -void Planner::buffer_sync_block() { - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Clear block - memset(block, 0, sizeof(block_t)); - - block->flag = BLOCK_FLAG_SYNC_POSITION; - - block->position[A_AXIS] = position[A_AXIS]; - block->position[B_AXIS] = position[B_AXIS]; - block->position[C_AXIS] = position[C_AXIS]; - block->position[E_AXIS] = position[E_AXIS]; - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - block_buffer_head = next_buffer_head; - - stepper.wake_up(); -} // buffer_sync_block() - -/** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ -bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - - // When changing extruders recalculate steps corresponding to the E position - #if ENABLED(DISTINCT_E_FACTORS) - if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) { - position[E_AXIS] = LROUND(position[E_AXIS] * axis_steps_per_mm[E_AXIS_N] * steps_to_mm[E_AXIS + last_extruder]); - last_extruder = extruder; - } - #endif - - // The target position of the tool in absolute steps - // Calculate target position in absolute steps - const int32_t target[ABCE] = { - LROUND(a * axis_steps_per_mm[A_AXIS]), - LROUND(b * axis_steps_per_mm[B_AXIS]), - LROUND(c * axis_steps_per_mm[C_AXIS]), - LROUND(e * axis_steps_per_mm[E_AXIS_N]) - }; - - #if HAS_POSITION_FLOAT - const float target_float[XYZE] = { a, b, c, e }; - #endif - - // DRYRUN prevents E moves from taking place - if (DEBUGGING(DRYRUN)) { - position[E_AXIS] = target[E_AXIS]; - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = e; - #endif - } - - /* <-- add a slash to enable - SERIAL_ECHOPAIR(" buffer_segment FR:", fr_mm_s); - #if IS_KINEMATIC - SERIAL_ECHOPAIR(" A:", a); - SERIAL_ECHOPAIR(" (", position[A_AXIS]); - SERIAL_ECHOPAIR("->", target[A_AXIS]); - SERIAL_ECHOPAIR(") B:", b); - #else - SERIAL_ECHOPAIR(" X:", a); - SERIAL_ECHOPAIR(" (", position[X_AXIS]); - SERIAL_ECHOPAIR("->", target[X_AXIS]); - SERIAL_ECHOPAIR(") Y:", b); - #endif - SERIAL_ECHOPAIR(" (", position[Y_AXIS]); - SERIAL_ECHOPAIR("->", target[Y_AXIS]); - #if ENABLED(DELTA) - SERIAL_ECHOPAIR(") C:", c); - #else - SERIAL_ECHOPAIR(") Z:", c); - #endif - SERIAL_ECHOPAIR(" (", position[Z_AXIS]); - SERIAL_ECHOPAIR("->", target[Z_AXIS]); - SERIAL_ECHOPAIR(") E:", e); - SERIAL_ECHOPAIR(" (", position[E_AXIS]); - SERIAL_ECHOPAIR("->", target[E_AXIS]); - SERIAL_ECHOLNPGM(")"); - //*/ - - // Queue the movement - if ( - !_buffer_steps(target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - ) - ) return false; - - stepper.wake_up(); - return true; -} // buffer_segment() - -/** - * Directly set the planner XYZ position (and stepper positions) - * converting mm (or angles for SCARA) into steps. - * - * On CORE machines stepper ABC will be translated from the given XYZ. - */ - -void Planner::_set_position_mm(const float &a, const float &b, const float &c, const float &e) { - #if ENABLED(DISTINCT_E_FACTORS) - last_extruder = active_extruder; - #endif - position[A_AXIS] = LROUND(a * axis_steps_per_mm[A_AXIS]); - position[B_AXIS] = LROUND(b * axis_steps_per_mm[B_AXIS]); - position[C_AXIS] = LROUND(axis_steps_per_mm[C_AXIS] * (c + ( - #if !IS_KINEMATIC && ENABLED(AUTO_BED_LEVELING_UBL) - leveling_active ? ubl.get_z_correction(a, b) : - #endif - 0 - ))); - position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); - #if HAS_POSITION_FLOAT - position_float[A_AXIS] = a; - position_float[B_AXIS] = b; - position_float[C_AXIS] = c; - position_float[E_AXIS] = e; - #endif - if (has_blocks_queued()) { - //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. - //ZERO(previous_speed); - buffer_sync_block(); - } - else - stepper.set_position(position[A_AXIS], position[B_AXIS], position[C_AXIS], position[E_AXIS]); -} - -void Planner::set_position_mm_kinematic(const float (&cart)[XYZE]) { - #if PLANNER_LEVELING - float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - apply_leveling(raw); - #else - const float (&raw)[XYZE] = cart; - #endif - #if IS_KINEMATIC - inverse_kinematics(raw); - _set_position_mm(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS]); - #else - _set_position_mm(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS]); - #endif -} - -/** - * Setters for planner position (also setting stepper position). - */ -void Planner::set_position_mm(const AxisEnum axis, const float &v) { - #if ENABLED(DISTINCT_E_FACTORS) - const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0); - last_extruder = active_extruder; - #else - const uint8_t axis_index = axis; - #endif - position[axis] = LROUND(axis_steps_per_mm[axis_index] * (v + ( - #if ENABLED(AUTO_BED_LEVELING_UBL) - axis == Z_AXIS && leveling_active ? ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]) : - #endif - 0) - )); - #if HAS_POSITION_FLOAT - position_float[axis] = v; - #endif - if (has_blocks_queued()) - buffer_sync_block(); - else - stepper.set_position(axis, position[axis]); -} - -// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 -void Planner::reset_acceleration_rates() { - #if ENABLED(DISTINCT_E_FACTORS) - #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder) - #else - #define AXIS_CONDITION true - #endif - uint32_t highest_rate = 1; - LOOP_XYZE_N(i) { - max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; - if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); - } - cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - recalculate_max_e_jerk(); - #endif -} - -// Recalculate position, steps_to_mm if axis_steps_per_mm changes! -void Planner::refresh_positioning() { - LOOP_XYZE_N(i) steps_to_mm[i] = 1.0f / axis_steps_per_mm[i]; - set_position_mm_kinematic(current_position); - reset_acceleration_rates(); -} - -#if ENABLED(AUTOTEMP) - - void Planner::autotemp_M104_M109() { - if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float(); - if (parser.seen('S')) autotemp_min = parser.value_celsius(); - if (parser.seen('B')) autotemp_max = parser.value_celsius(); - } - -#endif diff --git a/Marlin/planner.h b/Marlin/planner.h deleted file mode 100644 index fd06be588c..0000000000 --- a/Marlin/planner.h +++ /dev/null @@ -1,835 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner.h - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - */ - -#ifndef PLANNER_H -#define PLANNER_H - -#include "types.h" -#include "enum.h" -#include "Marlin.h" - -#if ABL_PLANAR - #include "vector_3.h" -#endif - -enum BlockFlagBit : char { - // Recalculate trapezoids on entry junction. For optimization. - BLOCK_BIT_RECALCULATE, - - // Nominal speed always reached. - // i.e., The segment is long enough, so the nominal speed is reachable if accelerating - // from a safe speed (in consideration of jerking from zero speed). - BLOCK_BIT_NOMINAL_LENGTH, - - // The block is segment 2+ of a longer move - BLOCK_BIT_CONTINUED, - - // Sync the stepper counts from the block - BLOCK_BIT_SYNC_POSITION -}; - -enum BlockFlag : char { - BLOCK_FLAG_RECALCULATE = _BV(BLOCK_BIT_RECALCULATE), - BLOCK_FLAG_NOMINAL_LENGTH = _BV(BLOCK_BIT_NOMINAL_LENGTH), - BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED), - BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION) -}; - -/** - * struct block_t - * - * A single entry in the planner buffer. - * Tracks linear movement over multiple axes. - * - * The "nominal" values are as-specified by gcode, and - * may never actually be reached due to acceleration limits. - */ -typedef struct { - - volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! - - // Fields used by the motion planner to manage acceleration - float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 - entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 - max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 - millimeters, // The total travel of this block in mm - acceleration; // acceleration mm/sec^2 - - union { - // Data used by all move blocks - struct { - // Fields used by the Bresenham algorithm for tracing the line - uint32_t steps[NUM_AXIS]; // Step count along each axis - }; - // Data used by all sync blocks - struct { - int32_t position[NUM_AXIS]; // New position to force when this sync block is executed - }; - }; - uint32_t step_event_count; // The number of step events required to complete this block - - uint8_t active_extruder; // The extruder to move (if E move) - - #if ENABLED(MIXING_EXTRUDER) - uint32_t mix_steps[MIXING_STEPPERS]; // Scaled steps[E_AXIS] for the mixing steppers - #endif - - // Settings for the trapezoid generator - uint32_t accelerate_until, // The index of the step event on which to stop acceleration - decelerate_after; // The index of the step event on which to start decelerating - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase - acceleration_time, // Acceleration time and deceleration time in STEP timer counts - deceleration_time, - acceleration_time_inverse, // Inverse of acceleration and deceleration periods, expressed as integer. Scale depends on CPU being used - deceleration_time_inverse; - #else - uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation - #endif - - uint8_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) - - // Advance extrusion - #if ENABLED(LIN_ADVANCE) - bool use_advance_lead; - uint16_t advance_speed, // STEP timer value for extruder speed offset ISR - max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!) - final_adv_steps; // advance steps due to exit speed - float e_D_ratio; - #endif - - uint32_t nominal_rate, // The nominal step rate for this block in step_events/sec - initial_rate, // The jerk-adjusted step rate at start of block - final_rate, // The minimal rate at exit - acceleration_steps_per_s2; // acceleration steps/sec^2 - - #if FAN_COUNT > 0 - uint16_t fan_speed[FAN_COUNT]; - #endif - - #if ENABLED(BARICUDA) - uint8_t valve_pressure, e_to_p_pressure; - #endif - - uint32_t segment_time_us; - -} block_t; - -#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || HAS_FEEDRATE_SCALING) - -#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) - -class Planner { - public: - - /** - * The move buffer, calculated in stepper steps - * - * block_buffer is a ring buffer... - * - * head,tail : indexes for write,read - * head==tail : the buffer is empty - * head!=tail : blocks are in the buffer - * head==(tail-1)%size : the buffer is full - * - * Writer of head is Planner::buffer_segment(). - * Reader of tail is Stepper::isr(). Always consider tail busy / read-only - */ - static block_t block_buffer[BLOCK_BUFFER_SIZE]; - static volatile uint8_t block_buffer_head, // Index of the next block to be pushed - block_buffer_nonbusy, // Index of the first non busy block - block_buffer_planned, // Index of the optimally planned block - block_buffer_tail; // Index of the busy block, if any - static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks - static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - - - #if ENABLED(DISTINCT_E_FACTORS) - 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 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 - volumetric_area_nominal, // Nominal cross-sectional area - volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner - // May be auto-adjusted by a filament width sensor - #endif - - static uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - max_acceleration_steps_per_s2[XYZE_N], // (steps/s^2) Derived from mm_per_s2 - min_segment_time_us; // (µs) M205 B - static float max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - steps_to_mm[XYZE_N], // (mm) Millimeters per step - min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - 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_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate - - #if ENABLED(JUNCTION_DEVIATION) - static float junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - static float max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - static float max_e_jerk; - #endif - #endif - #else - static float max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif - - #if HAS_LEVELING - static bool leveling_active; // Flag that bed leveling is enabled - #if ABL_PLANAR - static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float z_fade_height, inverse_z_fade_height; - #endif - #else - static constexpr bool leveling_active = false; - #endif - - #if ENABLED(LIN_ADVANCE) - static float extruder_advance_K; - #endif - - #if HAS_POSITION_FLOAT - static float position_float[XYZE]; - #endif - - #if ENABLED(SKEW_CORRECTION) - #if ENABLED(SKEW_CORRECTION_GCODE) - static float xy_skew_factor; - #else - static constexpr float xy_skew_factor = XY_SKEW_FACTOR; - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #if ENABLED(SKEW_CORRECTION_GCODE) - static float xz_skew_factor, yz_skew_factor; - #else - static constexpr float xz_skew_factor = XZ_SKEW_FACTOR, yz_skew_factor = YZ_SKEW_FACTOR; - #endif - #else - static constexpr float xz_skew_factor = 0, yz_skew_factor = 0; - #endif - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - static bool abort_on_endstop_hit; - #endif - - private: - - /** - * The current position of the tool in absolute steps - * Recalculated if any axis_steps_per_mm are changed by gcode - */ - static int32_t position[NUM_AXIS]; - - /** - * Speed of previous path line segment - */ - static float previous_speed[NUM_AXIS]; - - /** - * Nominal speed of previous path line segment (mm/s)^2 - */ - static float previous_nominal_speed_sqr; - - /** - * Limit where 64bit math is necessary for acceleration calculation - */ - static uint32_t cutoff_long; - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float last_fade_z; - #endif - - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) - /** - * Counters to manage disabling inactive extruders - */ - static uint8_t g_uc_extruder_last_move[EXTRUDERS]; - #endif // DISABLE_INACTIVE_EXTRUDER - - #ifdef XY_FREQUENCY_LIMIT - // Used for the frequency limit - #define MAX_FREQ_TIME_US (uint32_t)(1000000.0 / XY_FREQUENCY_LIMIT) - // Old direction bits. Used for speed calculations - static unsigned char old_direction_bits; - // Segment times (in µs). Used for speed calculations - static uint32_t axis_segment_time_us[2][3]; - #endif - - #if ENABLED(ULTRA_LCD) - volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs - #endif - - public: - - /** - * Instance Methods - */ - - Planner(); - - void init(); - - /** - * Static (class) Methods - */ - - 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 - ); - } - - // Manage fans, paste pressure, etc. - static void check_axes_activity(); - - // Update multipliers based on new diameter measurements - static void calculate_volumetric_multipliers(); - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - void calculate_volumetric_for_width_sensor(const int8_t encoded_ratio); - #endif - - #if DISABLED(NO_VOLUMETRICS) - - FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) { - filament_size[e] = v; - // make sure all extruders have some sane value for the filament size - for (uint8_t i = 0; i < COUNT(filament_size); i++) - if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; - } - - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - /** - * Get the Z leveling fade factor based on the given Z height, - * re-calculating only when needed. - * - * Returns 1.0 if planner.z_fade_height is 0.0. - * Returns 0.0 if Z is past the specified 'Fade Height'. - */ - inline static 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; - } - return 1; - } - - FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } - - FORCE_INLINE static void set_z_fade_height(const float &zfh) { - z_fade_height = zfh > 0 ? zfh : 0; - inverse_z_fade_height = RECIPROCAL(z_fade_height); - force_fade_recalc(); - } - - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { - return !z_fade_height || rz < z_fade_height; - } - - #else - - FORCE_INLINE static float fade_scaling_factor_for_z(const float &rz) { - UNUSED(rz); - return 1; - } - - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { UNUSED(rz); return true; } - - #endif - - #if ENABLED(SKEW_CORRECTION) - - FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) { - const float sx = cx - cy * xy_skew_factor - cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)), - sy = cy - cz * yz_skew_factor; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - - FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) { - const float sx = cx + cy * xy_skew_factor + cz * xz_skew_factor, - sy = cy + cz * yz_skew_factor; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - - #endif // SKEW_CORRECTION - - #if PLANNER_LEVELING || HAS_UBL_AND_CURVES - /** - * Apply leveling to transform a cartesian position - * as it will be given to the planner and steppers. - */ - static void apply_leveling(float &rx, float &ry, float &rz); - FORCE_INLINE static void apply_leveling(float (&raw)[XYZ]) { apply_leveling(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - #endif - - #if PLANNER_LEVELING - #define ARG_X float rx - #define ARG_Y float ry - #define ARG_Z float rz - static void unapply_leveling(float raw[XYZ]); - #else - #define ARG_X const float &rx - #define ARG_Y const float &ry - #define ARG_Z const float &rz - #endif - - // Number of moves currently in the planner including the busy block, if any - FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } - - // Number of nonbusy moves currently in the planner - FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } - - // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } - - // Check if movement queue is full - FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } - - // Get count of movement slots free - FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); } - - /** - * Planner::get_next_free_block - * - * - Get the next head indices (passed by reference) - * - Wait for the number of spaces to open up in the planner - * - Return the first head block - */ - FORCE_INLINE static block_t* get_next_free_block(uint8_t &next_buffer_head, const uint8_t count=1) { - - // Wait until there are enough slots free - while (moves_free() < count) { idle(); } - - // Return the first available block - next_buffer_head = next_block_index(block_buffer_head); - return &block_buffer[block_buffer_head]; - } - - /** - * Planner::_buffer_steps - * - * Add a new linear movement to the buffer (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true if movement was buffered, false otherwise - */ - static bool _buffer_steps(const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true is movement is acceptable, false otherwise - */ - static bool _populate_block(block_t * const block, bool split_move, - const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ - static void buffer_sync_block(); - - /** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - static bool buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0); - - static void _set_position_mm(const float &a, const float &b, const float &c, const float &e); - - /** - * Add a new linear movement to the buffer. - * The target is NOT translated to delta/scara - * - * Leveling will be applied to input on cartesians. - * Kinematic machines should call buffer_line_kinematic (for leveled moves). - * (Cartesians may also call buffer_line_kinematic.) - * - * rx,ry,rz,e - target position in mm or degrees - * fr_mm_s - (target) speed of the move (mm/s) - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - FORCE_INLINE static bool buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0) { - #if PLANNER_LEVELING && IS_CARTESIAN - apply_leveling(rx, ry, rz); - #endif - return buffer_segment(rx, ry, rz, e, fr_mm_s, extruder, millimeters); - } - - /** - * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * - * cart - x,y,z,e CARTESIAN target in mm - * fr_mm_s - (target) speed of the move (mm/s) - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - FORCE_INLINE static bool buffer_line_kinematic(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0) { - #if PLANNER_LEVELING - float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - apply_leveling(raw); - #else - const float (&raw)[XYZE] = cart; - #endif - #if IS_KINEMATIC - inverse_kinematics(raw); - return buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder, millimeters); - #else - return buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder, millimeters); - #endif - } - - /** - * Set the planner.position and individual stepper positions. - * Used by G92, G28, G29, and other procedures. - * - * Multiplies by axis_steps_per_mm[] and does necessary conversion - * for COREXY / COREXZ / COREYZ to set the corresponding stepper positions. - * - * Clears previous speed values. - */ - FORCE_INLINE static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) { - #if PLANNER_LEVELING && IS_CARTESIAN - apply_leveling(rx, ry, rz); - #endif - _set_position_mm(rx, ry, rz, e); - } - static void set_position_mm_kinematic(const float (&cart)[XYZE]); - static void set_position_mm(const AxisEnum axis, const float &v); - FORCE_INLINE static void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); } - FORCE_INLINE static void set_e_position_mm(const float &e) { set_position_mm(E_AXIS, e); } - - /** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ - static float get_axis_position_mm(const AxisEnum axis); - - // SCARA AB axes are in degrees, not mm - #if IS_SCARA - 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) - static void quick_stop(); - - // Called when an endstop is triggered. Causes the machine to stop inmediately - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in mm (not core-savvy) - static float triggered_position_mm(const AxisEnum axis); - - // Block until all buffered steps are executed / cleaned - static void synchronize(); - - // Wait for moves to finish and disable all steppers - static void finish_and_disable(); - - // Periodic tick to handle cleaning timeouts - // Called from the Temperature ISR at ~1kHz - static void tick() { - if (cleaning_buffer_counter) { - --cleaning_buffer_counter; - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - if (!cleaning_buffer_counter) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); - #endif - } - } - - /** - * Does the buffer have any blocks queued? - */ - FORCE_INLINE static bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); } - - /** - * The current block. NULL if the buffer is empty. - * This also marks the block as busy. - * WARNING: Called from Stepper ISR context! - */ - static block_t* get_current_block() { - - // Get the number of moves in the planner queue so far - const uint8_t nr_moves = movesplanned(); - - // If there are any moves queued ... - if (nr_moves) { - - // If there is still delay of delivery of blocks running, decrement it - if (delay_before_delivering) { - --delay_before_delivering; - // If the number of movements queued is less than 3, and there is still time - // to wait, do not deliver anything - if (nr_moves < 3 && delay_before_delivering) return NULL; - delay_before_delivering = 0; - } - - // If we are here, there is no excuse to deliver the block - block_t * const block = &block_buffer[block_buffer_tail]; - - // No trapezoid calculated? Don't execute yet. - if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return NULL; - - #if ENABLED(ULTRA_LCD) - block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. - #endif - - // As this block is busy, advance the nonbusy block pointer - block_buffer_nonbusy = next_block_index(block_buffer_tail); - - // Push block_buffer_planned pointer, if encountered. - if (block_buffer_tail == block_buffer_planned) - block_buffer_planned = block_buffer_nonbusy; - - // Return the block - return block; - } - - // The queue became empty - #if ENABLED(ULTRA_LCD) - clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. - #endif - - return NULL; - } - - /** - * "Discard" the block and "release" the memory. - * Called when the current block is no longer needed. - * NB: There MUST be a current block to call this function!! - */ - FORCE_INLINE static void discard_current_block() { - if (has_blocks_queued()) - block_buffer_tail = next_block_index(block_buffer_tail); - } - - #if ENABLED(ULTRA_LCD) - - static uint16_t block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - millis_t bbru = block_buffer_runtime_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // To translate µs to ms a division by 1000 would be required. - // We introduce 2.4% error here by dividing by 1024. - // Doesn't matter because block_buffer_runtime_us is already too small an estimation. - bbru >>= 10; - // limit to about a minute. - NOMORE(bbru, 0xFFFFul); - return bbru; - } - - static void clear_block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us = 0; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - #endif - - #if ENABLED(AUTOTEMP) - static float autotemp_min, autotemp_max, autotemp_factor; - static bool autotemp_enabled; - static void getHighESpeed(); - static void autotemp_M104_M109(); - #endif - - #if ENABLED(JUNCTION_DEVIATION) - FORCE_INLINE static void recalculate_max_e_jerk() { - #define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5))) - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - for (uint8_t i = 0; i < EXTRUDERS; i++) - max_e_jerk[i] = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS + i]); - #else - max_e_jerk = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS]); - #endif - #endif - } - #endif - - private: - - /** - * Get the index of the next / previous block in the ring buffer - */ - static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } - static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } - - /** - * Calculate the distance (not time) it takes to accelerate - * from initial_rate to target_rate using the given acceleration: - */ - static float estimate_acceleration_distance(const float &initial_rate, const float &target_rate, const float &accel) { - if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 - return (sq(target_rate) - sq(initial_rate)) / (accel * 2); - } - - /** - * Return the point at which you must start braking (at the rate of -'accel') if - * you start at 'initial_rate', accelerate (until reaching the point), and want to end at - * 'final_rate' after traveling 'distance'. - * - * This is used to compute the intersection point between acceleration and deceleration - * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed) - */ - static float intersection_distance(const float &initial_rate, const float &final_rate, const float &accel, const float &distance) { - if (accel == 0) return 0; // accel was 0, set intersection distance to 0 - return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4); - } - - /** - * Calculate the maximum allowable speed squared at this point, in order - * to reach 'target_velocity_sqr' using 'acceleration' within a given - * 'distance'. - */ - static float max_allowable_speed_sqr(const float &accel, const float &target_velocity_sqr, const float &distance) { - return target_velocity_sqr - 2 * accel * distance; - } - - #if ENABLED(S_CURVE_ACCELERATION) - /** - * Calculate the speed reached given initial speed, acceleration and distance - */ - static float final_speed(const float &initial_velocity, const float &accel, const float &distance) { - return SQRT(sq(initial_velocity) + 2 * accel * distance); - } - #endif - - static void calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor); - - static void reverse_pass_kernel(block_t* const current, const block_t * const next); - static void forward_pass_kernel(const block_t * const previous, block_t* const current, uint8_t block_index); - - static void reverse_pass(); - static void forward_pass(); - - static void recalculate_trapezoids(); - - static void recalculate(); - - #if ENABLED(JUNCTION_DEVIATION) - - FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) { - float magnitude_sq = 0; - LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]); - const float inv_magnitude = RSQRT(magnitude_sq); - LOOP_XYZE(idx) vector[idx] *= inv_magnitude; - } - - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) { - float limit_value = max_value; - LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero - NOMORE(limit_value, ABS(max_acceleration_mm_per_s2[idx] / unit_vec[idx])); - return limit_value; - } - - #endif // JUNCTION_DEVIATION -}; - -#define PLANNER_XY_FEEDRATE() (MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) - -extern Planner planner; - -#endif // PLANNER_H diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp deleted file mode 100644 index fdb4bab86b..0000000000 --- a/Marlin/planner_bezier.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner_bezier.cpp - * - * Compute and buffer movement commands for bezier curves - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(BEZIER_CURVE_SUPPORT) - -#include "planner.h" -#include "language.h" -#include "temperature.h" -#include "Marlin.h" - -// See the meaning in the documentation of cubic_b_spline(). -#define MIN_STEP 0.002f -#define MAX_STEP 0.1f -#define SIGMA 0.1f - -// Compute the linear interpolation between two real numbers. -inline static float interp(float a, float b, float t) { return (1.0f - t) * a + t * b; } - -/** - * Compute a Bézier curve using the De Casteljau's algorithm (see - * https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm), which is - * easy to code and has good numerical stability (very important, - * since Arudino works with limited precision real numbers). - */ -inline static float eval_bezier(float a, float b, float c, float d, float t) { - float iab = interp(a, b, t); - float ibc = interp(b, c, t); - float icd = interp(c, d, t); - float iabc = interp(iab, ibc, t); - float ibcd = interp(ibc, icd, t); - float iabcd = interp(iabc, ibcd, t); - return iabcd; -} - -/** - * We approximate Euclidean distance with the sum of the coordinates - * offset (so-called "norm 1"), which is quicker to compute. - */ -inline static float dist1(float x1, float y1, float x2, float y2) { return ABS(x1 - x2) + ABS(y1 - y2); } - -/** - * The algorithm for computing the step is loosely based on the one in Kig - * (See https://sources.debian.net/src/kig/4:15.08.3-1/misc/kigpainter.cpp/#L759) - * However, we do not use the stack. - * - * The algorithm goes as it follows: the parameters t runs from 0.0 to - * 1.0 describing the curve, which is evaluated by eval_bezier(). At - * each iteration we have to choose a step, i.e., the increment of the - * t variable. By default the step of the previous iteration is taken, - * and then it is enlarged or reduced depending on how straight the - * curve locally is. The step is always clamped between MIN_STEP/2 and - * 2*MAX_STEP. MAX_STEP is taken at the first iteration. - * - * For some t, the step value is considered acceptable if the curve in - * the interval [t, t+step] is sufficiently straight, i.e., - * sufficiently close to linear interpolation. In practice the - * following test is performed: the distance between eval_bezier(..., - * t+step/2) is evaluated and compared with 0.5*(eval_bezier(..., - * t)+eval_bezier(..., t+step)). If it is smaller than SIGMA, then the - * step value is considered acceptable, otherwise it is not. The code - * seeks to find the larger step value which is considered acceptable. - * - * At every iteration the recorded step value is considered and then - * iteratively halved until it becomes acceptable. If it was already - * acceptable in the beginning (i.e., no halving were done), then - * maybe it was necessary to enlarge it; then it is iteratively - * doubled while it remains acceptable. The last acceptable value - * found is taken, provided that it is between MIN_STEP and MAX_STEP - * and does not bring t over 1.0. - * - * Caveat: this algorithm is not perfect, since it can happen that a - * step is considered acceptable even when the curve is not linear at - * all in the interval [t, t+step] (but its mid point coincides "by - * chance" with the midpoint according to the parametrization). This - * kind of glitches can be eliminated with proper first derivative - * estimates; however, given the improbability of such configurations, - * 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) { - // 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]; - bez_target[Y_AXIS] = position[Y_AXIS]; - float step = MAX_STEP; - - millis_t next_idle_ms = millis() + 200UL; - - while (t < 1) { - - thermalManager.manage_heater(); - millis_t now = millis(); - if (ELAPSED(now, next_idle_ms)) { - next_idle_ms = now + 200UL; - idle(); - } - - // First try to reduce the step in order to make it sufficiently - // close to a linear interpolation. - bool did_reduce = false; - float new_t = t + step; - NOMORE(new_t, 1); - float new_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], new_t), - new_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], new_t); - for (;;) { - if (new_t - t < (MIN_STEP)) break; - const float candidate_t = 0.5f * (t + new_t), - candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + new_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + new_pos1); - if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - did_reduce = true; - } - - // If we did not reduce the step, maybe we should enlarge it. - if (!did_reduce) for (;;) { - if (new_t - t > MAX_STEP) break; - const float candidate_t = t + 2 * (new_t - t); - if (candidate_t >= 1) break; - const float candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + candidate_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + candidate_pos1); - if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - } - - // Check some postcondition; they are disabled in the actual - // Marlin build, but if you test the same code on a computer you - // may want to check they are respect. - /* - assert(new_t <= 1.0); - if (new_t < 1.0) { - assert(new_t - t >= (MIN_STEP) / 2.0); - assert(new_t - t <= (MAX_STEP) * 2.0); - } - */ - - step = new_t - t; - t = new_t; - - // Compute and send new position - bez_target[X_AXIS] = new_pos0; - bez_target[Y_AXIS] = new_pos1; - // FIXME. The following two are wrong, since the parameter t is - // not linear in the distance. - bez_target[Z_AXIS] = interp(position[Z_AXIS], target[Z_AXIS], t); - bez_target[E_AXIS] = interp(position[E_AXIS], target[E_AXIS], t); - clamp_to_software_endstops(bez_target); - - #if HAS_UBL_AND_CURVES - float pos[XYZ] = { bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS] }; - planner.apply_leveling(pos); - if (!planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], bez_target[E_AXIS], fr_mm_s, active_extruder)) - break; - #else - if (!planner.buffer_line_kinematic(bez_target, fr_mm_s, extruder)) - break; - #endif - } -} - -#endif // BEZIER_CURVE_SUPPORT diff --git a/Marlin/planner_bezier.h b/Marlin/planner_bezier.h deleted file mode 100644 index d17e7c80a0..0000000000 --- a/Marlin/planner_bezier.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner_bezier.h - * - * Compute and buffer movement commands for bezier curves - * - */ - -#ifndef PLANNER_BEZIER_H -#define PLANNER_BEZIER_H - -#include "Marlin.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 - ); - -#endif // PLANNER_BEZIER_H diff --git a/Marlin/point_t.h b/Marlin/point_t.h deleted file mode 100644 index 37ade7eba7..0000000000 --- a/Marlin/point_t.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __POINT_T__ -#define __POINT_T__ - -/** - * @brief Cartesian Point - * @details Represents a three dimensional point on Cartesian coordinate system, - * using an additional fourth dimension for the extrusion length. - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ -struct point_t { - float x, y, z; - - /** - * @brief Three dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ - point_t(const float x, const float y, const float z) : x(x), y(y), z(z) {} - - /** - * @brief Two dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - */ - point_t(const float x, const float y) : point_t(x, y, NAN) {} - -}; - -#endif // __POINT_T__ diff --git a/Marlin/power.cpp b/Marlin/power.cpp deleted file mode 100644 index 2f4708b075..0000000000 --- a/Marlin/power.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power.cpp - power control - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - -#include "power.h" -#include "temperature.h" -#include "stepper_indirection.h" - -Power powerManager; - -millis_t Power::lastPowerOn; - -bool Power::is_power_needed() { - #if ENABLED(AUTO_POWER_FANS) - for (uint8_t i = 0; i < FAN_COUNT; i++) if (fanSpeeds[i] > 0) return true; - #endif - - #if ENABLED(AUTO_POWER_E_FANS) - HOTEND_LOOP() if (thermalManager.autofan_speed[e] > 0) return true; - #endif - - #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLER_FAN && ENABLED(USE_CONTROLLER_FAN) - if (controllerFanSpeed > 0) return true; - #endif - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.soft_pwm_amount_bed > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON - #endif - || E0_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 1 - || E1_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 2 - || E2_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 3 - || E3_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 4 - || E4_ENABLE_READ == E_ENABLE_ON - #endif - #endif - #endif - #endif - ) return true; - - HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) return true; - #endif - - return false; -} - -void Power::check() { - static millis_t nextPowerCheck = 0; - millis_t ms = millis(); - if (ELAPSED(ms, nextPowerCheck)) { - nextPowerCheck = ms + 2500UL; - if (is_power_needed()) - power_on(); - else if (!lastPowerOn || ELAPSED(ms, lastPowerOn + (POWER_TIMEOUT) * 1000UL)) - power_off(); - } -} - -void Power::power_on() { - lastPowerOn = millis(); - if (!powersupply_on) { - PSU_PIN_ON(); - - #if HAS_TRINAMIC - delay(100); // Wait for power to settle - restore_stepper_drivers(); - #endif - } -} - -void Power::power_off() { - if (powersupply_on) PSU_PIN_OFF(); -} - -#endif // AUTO_POWER_CONTROL diff --git a/Marlin/power.h b/Marlin/power.h deleted file mode 100644 index a5c7dba793..0000000000 --- a/Marlin/power.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power.h - power control - */ - -#ifndef POWER_H -#define POWER_H - -#include "types.h" - -class Power { - public: - static void check(); - static void power_on(); - static void power_off(); - private: - static millis_t lastPowerOn; - static bool is_power_needed(); -}; - -extern Power powerManager; - -#endif // POWER_H diff --git a/Marlin/power_loss_recovery.cpp b/Marlin/power_loss_recovery.cpp deleted file mode 100644 index 80b1af169c..0000000000 --- a/Marlin/power_loss_recovery.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power_loss_recovery.cpp - Resume an SD print after power-loss - */ - -#include "MarlinConfig.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - -#include "power_loss_recovery.h" - -#include "cardreader.h" -#include "planner.h" -#include "printcounter.h" -#include "serial.h" -#include "temperature.h" -#include "ultralcd.h" - -// Recovery data -job_recovery_info_t job_recovery_info; -JobRecoveryPhase job_recovery_phase = JOB_RECOVERY_IDLE; -uint8_t job_recovery_commands_count; //=0 -char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; -// Extern -extern uint8_t active_extruder, commands_in_queue, cmd_queue_index_r; - - -#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - void debug_print_job_recovery(const bool recovery) { - SERIAL_PROTOCOLLNPGM("---- Job Recovery Info ----"); - SERIAL_PROTOCOLPAIR("valid_head:", int(job_recovery_info.valid_head)); - SERIAL_PROTOCOLLNPAIR(" valid_foot:", int(job_recovery_info.valid_foot)); - if (job_recovery_info.valid_head) { - if (job_recovery_info.valid_head == job_recovery_info.valid_foot) { - SERIAL_PROTOCOLPGM("current_position: "); - LOOP_XYZE(i) { - SERIAL_PROTOCOL(job_recovery_info.current_position[i]); - if (i < E_AXIS) SERIAL_CHAR(','); - } - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("feedrate: ", job_recovery_info.feedrate); - - #if HOTENDS > 1 - SERIAL_PROTOCOLLNPAIR("active_hotend: ", int(job_recovery_info.active_hotend)); - #endif - - SERIAL_PROTOCOLPGM("target_temperature: "); - HOTEND_LOOP() { - SERIAL_PROTOCOL(job_recovery_info.target_temperature[e]); - if (e < HOTENDS - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - - #if HAS_HEATED_BED - SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed); - #endif - - #if FAN_COUNT - SERIAL_PROTOCOLPGM("fanSpeeds: "); - for (int8_t i = 0; i < FAN_COUNT; i++) { - SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]); - if (i < FAN_COUNT - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - #endif - - #if HAS_LEVELING - SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling)); - SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade)); - #endif - SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", int(job_recovery_info.cmd_queue_index_r)); - SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", int(job_recovery_info.commands_in_queue)); - if (recovery) - for (uint8_t i = 0; i < job_recovery_commands_count; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_commands[i]); - else - for (uint8_t i = 0; i < job_recovery_info.commands_in_queue; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_info.command_queue[i]); - SERIAL_PROTOCOLLNPAIR("sd_filename: ", job_recovery_info.sd_filename); - SERIAL_PROTOCOLLNPAIR("sdpos: ", job_recovery_info.sdpos); - SERIAL_PROTOCOLLNPAIR("print_job_elapsed: ", job_recovery_info.print_job_elapsed); - } - else - SERIAL_PROTOCOLLNPGM("INVALID DATA"); - } - SERIAL_PROTOCOLLNPGM("---------------------------"); - } -#endif // DEBUG_POWER_LOSS_RECOVERY - -/** - * Check for Print Job Recovery during setup() - * - * If a saved state exists, populate job_recovery_commands with - * commands to restore the machine state and continue the file. - */ -void check_print_job_recovery() { - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - ZERO(job_recovery_commands); - - if (!card.cardOK) card.initsd(); - - if (card.cardOK) { - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPAIR("Init job recovery info. Size: ", int(sizeof(job_recovery_info))); - #endif - - if (card.jobRecoverFileExists()) { - card.openJobRecoveryFile(true); - card.loadJobRecoveryInfo(); - card.closeJobRecoveryFile(); - //card.removeJobRecoveryFile(); - - if (job_recovery_info.valid_head && job_recovery_info.valid_head == job_recovery_info.valid_foot) { - - uint8_t ind = 0; - - #if HAS_LEVELING - strcpy_P(job_recovery_commands[ind++], PSTR("M420 S0 Z0")); // Leveling off before G92 or G28 - #endif - - strcpy_P(job_recovery_commands[ind++], PSTR("G92.0 Z0")); // Ensure Z is equal to 0 - strcpy_P(job_recovery_commands[ind++], PSTR("G1 Z2")); // Raise Z by 2mm (we hope!) - strcpy_P(job_recovery_commands[ind++], PSTR("G28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" // Home X and Y for Cartesian - #endif - )); - - char str_1[16], str_2[16]; - - #if HAS_LEVELING - if (job_recovery_info.fade || job_recovery_info.leveling) { - // Restore leveling state before G92 sets Z - // This ensures the steppers correspond to the native Z - dtostrf(job_recovery_info.fade, 1, 1, str_1); - sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), str_1); - } - #endif - - dtostrf(job_recovery_info.current_position[Z_AXIS] + 2, 1, 3, str_1); - dtostrf(job_recovery_info.current_position[E_AXIS] - #if ENABLED(SAVE_EACH_CMD_MODE) - - 5 - #endif - , 1, 3, str_2 - ); - sprintf_P(job_recovery_commands[ind++], PSTR("G92.0 Z%s E%s"), str_1, str_2); // Current Z + 2 and E - - uint8_t r = job_recovery_info.cmd_queue_index_r, c = job_recovery_info.commands_in_queue; - while (c--) { - strcpy(job_recovery_commands[ind++], job_recovery_info.command_queue[r]); - r = (r + 1) % BUFSIZE; - } - - if (job_recovery_info.sd_filename[0] == '/') job_recovery_info.sd_filename[0] = ' '; - sprintf_P(job_recovery_commands[ind++], PSTR("M23 %s"), job_recovery_info.sd_filename); - sprintf_P(job_recovery_commands[ind++], PSTR("M24 S%ld T%ld"), job_recovery_info.sdpos, job_recovery_info.print_job_elapsed); - - job_recovery_commands_count = ind; - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - debug_print_job_recovery(true); - #endif - } - else { - if (job_recovery_info.valid_head != job_recovery_info.valid_foot) - LCD_ALERTMESSAGEPGM("INVALID DATA"); - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - } - } - } -} - -/** - * Save the current machine state to the power-loss recovery file - */ -void save_job_recovery_info() { - #if SAVE_INFO_INTERVAL_MS > 0 - static millis_t next_save_ms; // = 0; // Init on reset - millis_t ms = millis(); - #endif - if ( - // Save on every command - #if ENABLED(SAVE_EACH_CMD_MODE) - true - #else - // Save if power loss pin is triggered - #if PIN_EXISTS(POWER_LOSS) - READ(POWER_LOSS_PIN) == POWER_LOSS_STATE || - #endif - // Save if interval is elapsed - #if SAVE_INFO_INTERVAL_MS > 0 - ELAPSED(ms, next_save_ms) || - #endif - // Save on every new Z height - (current_position[Z_AXIS] > 0 && current_position[Z_AXIS] > job_recovery_info.current_position[Z_AXIS]) - #endif - ) { - #if SAVE_INFO_INTERVAL_MS > 0 - next_save_ms = ms + SAVE_INFO_INTERVAL_MS; - #endif - - // Head and foot will match if valid data was saved - if (!++job_recovery_info.valid_head) ++job_recovery_info.valid_head; // non-zero in sequence - job_recovery_info.valid_foot = job_recovery_info.valid_head; - - // Machine state - COPY(job_recovery_info.current_position, current_position); - job_recovery_info.feedrate = feedrate_mm_s; - - #if HOTENDS > 1 - job_recovery_info.active_hotend = active_extruder; - #endif - - COPY(job_recovery_info.target_temperature, thermalManager.target_temperature); - - #if HAS_HEATED_BED - job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed; - #endif - - #if FAN_COUNT - COPY(job_recovery_info.fanSpeeds, fanSpeeds); - #endif - - #if HAS_LEVELING - job_recovery_info.leveling = planner.leveling_active; - job_recovery_info.fade = ( - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.z_fade_height - #else - 0 - #endif - ); - #endif - - // Commands in the queue - job_recovery_info.cmd_queue_index_r = cmd_queue_index_r; - job_recovery_info.commands_in_queue = commands_in_queue; - COPY(job_recovery_info.command_queue, command_queue); - - // Elapsed print job time - job_recovery_info.print_job_elapsed = print_job_timer.duration(); - - // SD file position - card.getAbsFilename(job_recovery_info.sd_filename); - job_recovery_info.sdpos = card.getIndex(); - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPGM("Saving..."); - debug_print_job_recovery(false); - #endif - - card.openJobRecoveryFile(false); - (void)card.saveJobRecoveryInfo(); - - // If power-loss pin was triggered, write just once then kill - #if PIN_EXISTS(POWER_LOSS) - if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(MSG_POWER_LOSS_RECOVERY); - #endif - } -} - -#endif // POWER_LOSS_RECOVERY diff --git a/Marlin/power_loss_recovery.h b/Marlin/power_loss_recovery.h deleted file mode 100644 index 70c3718b70..0000000000 --- a/Marlin/power_loss_recovery.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power_loss_recovery.h - Resume an SD print after power-loss - */ - -#ifndef _POWER_LOSS_RECOVERY_H_ -#define _POWER_LOSS_RECOVERY_H_ - -#include "cardreader.h" -#include "types.h" -#include "MarlinConfig.h" - -#define SAVE_INFO_INTERVAL_MS 0 -//#define SAVE_EACH_CMD_MODE -//#define DEBUG_POWER_LOSS_RECOVERY - - -typedef struct -{ - char file_name[14]; - unsigned int Z_t; - unsigned int T0_t; - unsigned int B_t; - uint32_t pos_t; - uint32_t E_t; - char recovery;//=0 idle,=1~2 recoverying,=3 power down - -} recovery_D; - -extern recovery_D recovery_detect_cap; - - - - -typedef struct { - uint8_t valid_head; - - // Machine state - float current_position[NUM_AXIS], feedrate; - - #if HOTENDS > 1 - uint8_t active_hotend; - #endif - - int16_t target_temperature[HOTENDS]; - - #if HAS_HEATED_BED - int16_t target_temperature_bed; - #endif - - #if FAN_COUNT - int16_t fanSpeeds[FAN_COUNT]; - #endif - - #if HAS_LEVELING - bool leveling; - float fade; - #endif - - // Command queue - uint8_t cmd_queue_index_r, commands_in_queue; - char command_queue[BUFSIZE][MAX_CMD_SIZE]; - - // SD Filename and position - char sd_filename[MAXPATHNAMELENGTH]; - uint32_t sdpos; - - // Job elapsed time - millis_t print_job_elapsed; - - uint8_t valid_foot; -} job_recovery_info_t; - -extern job_recovery_info_t job_recovery_info; - -enum JobRecoveryPhase : unsigned char { - JOB_RECOVERY_IDLE, - JOB_RECOVERY_MAYBE, - JOB_RECOVERY_YES, - JOB_RECOVERY_DONE -}; -extern JobRecoveryPhase job_recovery_phase; - -#if HAS_LEVELING - #define APPEND_CMD_COUNT 9 -#else - #define APPEND_CMD_COUNT 7 -#endif - -extern char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; -extern uint8_t job_recovery_commands_count; - -void check_print_job_recovery(); -void save_job_recovery_info(); - -#endif // _POWER_LOSS_RECOVERY_H_ diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp deleted file mode 100644 index d1de7d1754..0000000000 --- a/Marlin/printcounter.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if DISABLED(PRINTCOUNTER) - -#include "stopwatch.h" -Stopwatch print_job_timer; // Global Print Job Timer instance - -#else // PRINTCOUNTER - -#include "printcounter.h" -#include "duration_t.h" -#include "Marlin.h" - -PrintCounter print_job_timer; // Global Print Job Timer instance - -#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - // round up address to next page boundary (assuming 32 byte pages) - #define STATS_EEPROM_ADDRESS 0x40 -#else - #define STATS_EEPROM_ADDRESS 0x32 -#endif - -const PrintCounter::promdress PrintCounter::address = STATS_EEPROM_ADDRESS; - -const uint16_t PrintCounter::updateInterval = 10; -const uint16_t PrintCounter::saveInterval = 3600; -printStatistics PrintCounter::data; -millis_t PrintCounter::lastDuration; -bool PrintCounter::loaded = false; - -millis_t PrintCounter::deltaDuration() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("deltaDuration")); - #endif - - millis_t tmp = lastDuration; - lastDuration = duration(); - return lastDuration - tmp; -} - -void PrintCounter::incFilamentUsed(float const &amount) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("incFilamentUsed")); - #endif - - // Refuses to update data if object is not loaded - if (!isLoaded()) return; - - data.filamentUsed += amount; // mm -} - -void PrintCounter::initStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("initStats")); - #endif - - loaded = true; - data = { 0, 0, 0, 0, 0.0 }; - - saveStats(); - eeprom_write_byte((uint8_t*)address, 0x16); -} - -void PrintCounter::loadStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("loadStats")); - #endif - - // Checks if the EEPROM block is initialized - if (eeprom_read_byte((uint8_t*)address) != 0x16) initStats(); - else eeprom_read_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); - - loaded = true; -} - -void PrintCounter::saveStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("saveStats")); - #endif - - // Refuses to save data if object is not loaded - if (!isLoaded()) return; - - // Saves the struct to EEPROM - eeprom_update_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); -} - -void PrintCounter::showStats() { - char buffer[21]; - - SERIAL_PROTOCOLPGM(MSG_STATS); - - SERIAL_ECHOPGM("Prints: "); - SERIAL_ECHO(data.totalPrints); - - SERIAL_ECHOPGM(", Finished: "); - SERIAL_ECHO(data.finishedPrints); - - SERIAL_ECHOPGM(", Failed: "); // Note: Removes 1 from failures with an active counter - SERIAL_ECHO(data.totalPrints - data.finishedPrints - - ((isRunning() || isPaused()) ? 1 : 0)); - - SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); - - duration_t elapsed = data.printTime; - elapsed.toString(buffer); - - SERIAL_ECHOPGM("Total time: "); - SERIAL_ECHO(buffer); - - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.printTime); - SERIAL_CHAR(')'); - #endif - - elapsed = data.longestPrint; - elapsed.toString(buffer); - - SERIAL_ECHOPGM(", Longest job: "); - SERIAL_ECHO(buffer); - - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.longestPrint); - SERIAL_CHAR(')'); - #endif - - SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); - - SERIAL_ECHOPGM("Filament used: "); - SERIAL_ECHO(data.filamentUsed / 1000); - SERIAL_CHAR('m'); - - SERIAL_EOL(); -} - -void PrintCounter::tick() { - if (!isRunning()) return; - - static uint32_t update_last = millis(), - eeprom_last = millis(); - - millis_t now = millis(); - - // Trying to get the amount of calculations down to the bare min - const static uint16_t i = updateInterval * 1000; - - if (now - update_last >= i) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("tick")); - #endif - - data.printTime += deltaDuration(); - update_last = now; - } - - // Trying to get the amount of calculations down to the bare min - const static millis_t j = saveInterval * 1000; - if (now - eeprom_last >= j) { - eeprom_last = now; - saveStats(); - } -} - -// @Override -bool PrintCounter::start() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("start")); - #endif - - bool paused = isPaused(); - - if (super::start()) { - if (!paused) { - data.totalPrints++; - lastDuration = 0; - } - return true; - } - - return false; -} - -// @Override -bool PrintCounter::stop() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - if (super::stop()) { - data.finishedPrints++; - data.printTime += deltaDuration(); - - if (duration() > data.longestPrint) - data.longestPrint = duration(); - - saveStats(); - return true; - } - else return false; -} - -// @Override -void PrintCounter::reset() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - super::reset(); - lastDuration = 0; -} - -#if ENABLED(DEBUG_PRINTCOUNTER) - - void PrintCounter::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("PrintCounter::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } -#endif - -#endif // PRINTCOUNTER diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h deleted file mode 100644 index 848d9715b8..0000000000 --- a/Marlin/printcounter.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef PRINTCOUNTER_H -#define PRINTCOUNTER_H - -// Print debug messages with M111 S2 -//#define DEBUG_PRINTCOUNTER - -#include "macros.h" -#include "language.h" -#include "stopwatch.h" -#include - -struct printStatistics { // 16 bytes - //const uint8_t magic; // Magic header, it will always be 0x16 - uint16_t totalPrints; // Number of prints - uint16_t finishedPrints; // Number of complete prints - uint32_t printTime; // Accumulated printing time - uint32_t longestPrint; // Longest successful print job - float filamentUsed; // Accumulated filament consumed in mm -}; - -class PrintCounter: public Stopwatch { - private: - typedef Stopwatch super; - - #if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - typedef uint32_t promdress; - #else - typedef uint16_t promdress; - #endif - - static printStatistics data; - - /** - * @brief EEPROM address - * @details Defines the start offset address where the data is stored. - */ - static const promdress address; - - /** - * @brief Interval in seconds between counter updates - * @details This const value defines what will be the time between each - * accumulator update. This is different from the EEPROM save interval. - * - * @note The max value for this option is 60(s), otherwise integer - * overflow will happen. - */ - static const uint16_t updateInterval; - - /** - * @brief Interval in seconds between EEPROM saves - * @details This const value defines what will be the time between each - * EEPROM save cycle, the development team recommends to set this value - * no lower than 3600 secs (1 hour). - */ - static const uint16_t saveInterval; - - /** - * @brief Timestamp of the last call to deltaDuration() - * @details Store the timestamp of the last deltaDuration(), this is - * required due to the updateInterval cycle. - */ - static millis_t lastDuration; - - /** - * @brief Stats were loaded from EEPROM - * @details If set to true it indicates if the statistical data was already - * loaded from the EEPROM. - */ - static bool loaded; - - protected: - /** - * @brief dT since the last call - * @details Return the elapsed time in seconds since the last call, this is - * used internally for print statistics accounting is not intended to be a - * user callable function. - */ - static millis_t deltaDuration(); - - public: - - /** - * @brief Initialize the print counter - */ - static inline void init() { - super::init(); - loadStats(); - } - - /** - * @brief Check if Print Statistics has been loaded - * @details Return true if the statistical data has been loaded. - * @return bool - */ - FORCE_INLINE static bool isLoaded() { return loaded; } - - /** - * @brief Increment the total filament used - * @details The total filament used counter will be incremented by "amount". - * - * @param amount The amount of filament used in mm - */ - static void incFilamentUsed(float const &amount); - - /** - * @brief Reset the Print Statistics - * @details Reset the statistics to zero and saves them to EEPROM creating - * also the magic header. - */ - static void initStats(); - - /** - * @brief Load the Print Statistics - * @details Load the statistics from EEPROM - */ - static void loadStats(); - - /** - * @brief Save the Print Statistics - * @details Save the statistics to EEPROM - */ - static void saveStats(); - - /** - * @brief Serial output the Print Statistics - * @details This function may change in the future, for now it directly - * prints the statistical data to serial. - */ - static void showStats(); - - /** - * @brief Return the currently loaded statistics - * @details Return the raw data, in the same structure used internally - */ - static printStatistics getStats() { return data; } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * periodically save the statistical data to EEPROM and do time keeping. - */ - static void tick(); - - /** - * The following functions are being overridden - */ - static bool start(); - static bool stop(); - static void reset(); - - #if ENABLED(DEBUG_PRINTCOUNTER) - - /** - * @brief Print a debug message - * @details Print a simple debug message - */ - static void debug(const char func[]); - - #endif -}; - -// Global Print Job Timer instance -#if ENABLED(PRINTCOUNTER) - extern PrintCounter print_job_timer; -#else - extern Stopwatch print_job_timer; -#endif - -#endif // PRINTCOUNTER_H diff --git a/Marlin/runout.cpp b/Marlin/runout.cpp deleted file mode 100644 index 44ca694df1..0000000000 --- a/Marlin/runout.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * runout.cpp - Runout sensor support - */ - -#include "MarlinConfig.h" - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - -#include "runout.h" - -FilamentRunoutSensor runout; - -bool FilamentRunoutSensor::filament_ran_out; // = false -uint8_t FilamentRunoutSensor::runout_count; // = 0 - -void FilamentRunoutSensor::setup() { - - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) - #endif - - INIT_RUNOUT_PIN(FIL_RUNOUT_PIN); - #if NUM_RUNOUT_SENSORS > 1 - INIT_RUNOUT_PIN(FIL_RUNOUT2_PIN); - #if NUM_RUNOUT_SENSORS > 2 - INIT_RUNOUT_PIN(FIL_RUNOUT3_PIN); - #if NUM_RUNOUT_SENSORS > 3 - INIT_RUNOUT_PIN(FIL_RUNOUT4_PIN); - #if NUM_RUNOUT_SENSORS > 4 - INIT_RUNOUT_PIN(FIL_RUNOUT5_PIN); - #endif - #endif - #endif - #endif -} - -#endif // FILAMENT_RUNOUT_SENSOR diff --git a/Marlin/runout.h b/Marlin/runout.h deleted file mode 100644 index c4c88b6c15..0000000000 --- a/Marlin/runout.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * runout.h - Runout sensor support - */ - -#ifndef _RUNOUT_H_ -#define _RUNOUT_H_ - -#include "cardreader.h" -#include "printcounter.h" -#include "stepper.h" -#include "Marlin.h" - -#include "MarlinConfig.h" - -#define FIL_RUNOUT_THRESHOLD 5 - -class FilamentRunoutSensor { - public: - FilamentRunoutSensor() {} - - static void setup(); - - FORCE_INLINE static void reset() { runout_count = 0; filament_ran_out = false; } - - FORCE_INLINE static void run() { - if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) { - filament_ran_out = true; - enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); - planner.synchronize(); - } - } - private: - static bool filament_ran_out; - static uint8_t runout_count; - - FORCE_INLINE static bool check() { - #if NUM_RUNOUT_SENSORS < 2 - // A single sensor applying to all extruders - const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; - #else - // Read the sensor for the active extruder - bool is_out; - switch (active_extruder) { - case 0: is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; break; - case 1: is_out = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 2 - case 2: is_out = READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 3 - case 3: is_out = READ(FIL_RUNOUT4_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 4 - case 4: is_out = READ(FIL_RUNOUT5_PIN) == FIL_RUNOUT_INVERTING; break; - #endif - #endif - #endif - } - #endif - return (is_out ? ++runout_count : (runout_count = 0)) > FIL_RUNOUT_THRESHOLD; - } -}; - -extern FilamentRunoutSensor runout; - -#endif // _RUNOUT_H_ diff --git a/Marlin/serial.cpp b/Marlin/serial.cpp deleted file mode 100644 index 8b6a1c2b49..0000000000 --- a/Marlin/serial.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "serial.h" - -const char errormagic[] PROGMEM = "Error:"; -const char echomagic[] PROGMEM = "echo:"; - -void serial_echopair_PGM(const char* s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } -void serial_echopair_PGM(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } - -void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } diff --git a/Marlin/serial.h b/Marlin/serial.h deleted file mode 100644 index 139f99c110..0000000000 --- a/Marlin/serial.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __SERIAL_H__ -#define __SERIAL_H__ - -#include "MarlinConfig.h" - -#if USE_MARLINSERIAL - #include "MarlinSerial.h" - #define MYSERIAL0 customizedSerial -#else - #include - #if ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; - #define MYSERIAL0 bluetoothSerial - #else - #define MYSERIAL0 Serial - #endif // BLUETOOTH -#endif - -extern const char echomagic[] PROGMEM; -extern const char errormagic[] PROGMEM; - -#define SERIAL_CHAR(x) ((void)MYSERIAL0.write(x)) -#define SERIAL_EOL() SERIAL_CHAR('\n') - -#define SERIAL_PRINT(x,b) MYSERIAL0.print(x,b) -#define SERIAL_PRINTLN(x,b) MYSERIAL0.println(x,b) -#define SERIAL_PRINTF(args...) MYSERIAL0.printf(args) - -#define SERIAL_FLUSH() MYSERIAL0.flush() -#if TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX() MYSERIAL0.flushTX() -#endif - -#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) -#define SERIAL_PROTOCOL(x) MYSERIAL0.print(x) -#define SERIAL_PROTOCOL_F(x,y) MYSERIAL0.print(x,y) -#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) -#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL0.print(x); SERIAL_EOL(); }while(0) -#define SERIAL_PROTOCOLLNPGM(x) serialprintPGM(PSTR(x "\n")) -#define SERIAL_PROTOCOLPAIR(name, value) serial_echopair_PGM(PSTR(name),(value)) -#define SERIAL_PROTOCOLLNPAIR(name, value) do{ SERIAL_PROTOCOLPAIR(name, value); SERIAL_EOL(); }while(0) - -#define SERIAL_ECHO_START() serialprintPGM(echomagic) -#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) -#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHOPAIR(pre,value) SERIAL_PROTOCOLPAIR(pre, value) -#define SERIAL_ECHOLNPAIR(pre,value) SERIAL_PROTOCOLLNPAIR(pre, value) -#define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y) - -#define SERIAL_ERROR_START() serialprintPGM(errormagic) -#define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) -#define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) - -// These macros compensate for float imprecision -#define SERIAL_PROTOCOLPAIR_F(pre, value) SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value)) -#define SERIAL_PROTOCOLLNPAIR_F(pre, value) SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value)) - -// -// Functions for serial printing from PROGMEM. (Saves loads of SRAM.) -// -FORCE_INLINE void serialprintPGM(const char* str) { - while (char ch = pgm_read_byte(str++)) SERIAL_CHAR(ch); -} - -void serial_echopair_PGM(const char* s_P, const char *v); -void serial_echopair_PGM(const char* s_P, char v); -void serial_echopair_PGM(const char* s_P, int v); -void serial_echopair_PGM(const char* s_P, long v); -void serial_echopair_PGM(const char* s_P, float v); -void serial_echopair_PGM(const char* s_P, double v); -void serial_echopair_PGM(const char* s_P, unsigned int v); -void serial_echopair_PGM(const char* s_P, unsigned long v); -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint16_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } - -void serial_spaces(uint8_t count); -#define SERIAL_ECHO_SP(C) serial_spaces(C) -#define SERIAL_ERROR_SP(C) serial_spaces(C) -#define SERIAL_PROTOCOL_SP(C) serial_spaces(C) - -#endif // __SERIAL_H__ diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp deleted file mode 100644 index e1d11573ab..0000000000 --- a/Marlin/servo.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - */ - -/** - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin) - Attach a servo motor to an i/o pin. - * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds - * Default min is 544, max is 2400 - * - * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) - * writeMicroseconds() - Set the servo pulse width in microseconds. - * move(pin, angle) - Sequence of attach(pin), write(angle), delay(SERVO_DELAY). - * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after SERVO_DELAY. - * read() - Get the last-written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Get the last-written servo pulse width in microseconds. - * attached() - Return true if a servo is attached. - * detach() - Stop an attached servo from pulsing its i/o pin. - * - */ -#include "MarlinConfig.h" - -#if HAS_SERVOS - -#include -#include - -#include "servo.h" -#include "utility.h" - -#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009 -#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds - -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays // 12 August 2009 - -//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER)) - -static ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures -static volatile int8_t Channel[_Nbr_16timers ]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) - -uint8_t ServoCount = 0; // the total number of attached servos - - -// convenience macros -#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo -#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // returns the index of the servo on this timer -#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // macro to access servo index by timer and channel -#define SERVO(_timer,_channel) (servo_info[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel - -#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 - -/************ static functions common to all instances ***********************/ - -static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { - if (Channel[timer] < 0) - *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer - else { - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - } - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - *OCRnA = *TCNTn + SERVO(timer, Channel[timer]).ticks; - if (SERVO(timer, Channel[timer]).Pin.isActive) // check if activated - digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high - } - else { - // finished all channels so wait for the refresh period to expire before starting over - if (((unsigned)*TCNTn) + 4 < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - *OCRnA = (unsigned int)usToTicks(REFRESH_INTERVAL); - else - *OCRnA = *TCNTn + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - } -} - -#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform - - // Interrupt handlers for Arduino - #if ENABLED(_useTimer1) - SIGNAL (TIMER1_COMPA_vect) { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - - #if ENABLED(_useTimer3) - SIGNAL (TIMER3_COMPA_vect) { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - - #if ENABLED(_useTimer4) - SIGNAL (TIMER4_COMPA_vect) { handle_interrupts(_timer4, &TCNT4, &OCR4A); } - #endif - - #if ENABLED(_useTimer5) - SIGNAL (TIMER5_COMPA_vect) { handle_interrupts(_timer5, &TCNT5, &OCR5A); } - #endif - -#else // WIRING - - // Interrupt handlers for Wiring - #if ENABLED(_useTimer1) - void Timer1Service() { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - #if ENABLED(_useTimer3) - void Timer3Service() { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - -#endif // WIRING - - -static void initISR(timer16_Sequence_t timer) { - #if ENABLED(_useTimer1) - if (timer == _timer1) { - 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__) - SBI(TIFR, OCF1A); // clear any pending interrupts; - SBI(TIMSK, OCIE1A); // enable the output compare interrupt - #else - // here if not ATmega8 or ATmega128 - SBI(TIFR1, OCF1A); // clear any pending interrupts; - SBI(TIMSK1, OCIE1A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service); - #endif - } - #endif - - #if ENABLED(_useTimer3) - if (timer == _timer3) { - TCCR3A = 0; // normal counting mode - TCCR3B = _BV(CS31); // set prescaler of 8 - TCNT3 = 0; // clear the timer count - #ifdef __AVR_ATmega128__ - SBI(TIFR, OCF3A); // clear any pending interrupts; - SBI(ETIMSK, OCIE3A); // enable the output compare interrupt - #else - SBI(TIFR3, OCF3A); // clear any pending interrupts; - SBI(TIMSK3, OCIE3A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only - #endif - } - #endif - - #if ENABLED(_useTimer4) - if (timer == _timer4) { - TCCR4A = 0; // normal counting mode - TCCR4B = _BV(CS41); // set prescaler of 8 - TCNT4 = 0; // clear the timer count - TIFR4 = _BV(OCF4A); // clear any pending interrupts; - TIMSK4 = _BV(OCIE4A); // enable the output compare interrupt - } - #endif - - #if ENABLED(_useTimer5) - if (timer == _timer5) { - TCCR5A = 0; // normal counting mode - TCCR5B = _BV(CS51); // set prescaler of 8 - TCNT5 = 0; // clear the timer count - TIFR5 = _BV(OCF5A); // clear any pending interrupts; - TIMSK5 = _BV(OCIE5A); // enable the output compare interrupt - } - #endif -} - -static void finISR(timer16_Sequence_t timer) { - // Disable use of the given timer - #ifdef WIRING - if (timer == _timer1) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK1 - #else - TIMSK - #endif - , OCIE1A); // disable timer 1 output compare interrupt - timerDetach(TIMER1OUTCOMPAREA_INT); - } - else if (timer == _timer3) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK3 - #else - ETIMSK - #endif - , OCIE3A); // disable the timer3 output compare A interrupt - timerDetach(TIMER3OUTCOMPAREA_INT); - } - #else // !WIRING - // For arduino - in future: call here to a currently undefined function to reset the timer - UNUSED(timer); - #endif -} - -static bool isTimerActive(timer16_Sequence_t timer) { - // returns true if any servo is active on this timer - for (uint8_t channel = 0; channel < SERVOS_PER_TIMER; channel++) { - if (SERVO(timer, channel).Pin.isActive) - return true; - } - return false; -} - -/****************** end of static functions ******************************/ - -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 - } - else - this->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 pin, const int min, const int max) { - - if (this->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 - - // 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; - - // 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 - - return this->servoIndex; -} - -void Servo::detach() { - servo_info[this->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); -} - -void Servo::writeMicroseconds(int value) { - // calculate and store the values for the given channel - byte channel = this->servoIndex; - if (channel < MAX_SERVOS) { // ensure channel is valid - // ensure pulse width is valid - value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION); - value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 - - CRITICAL_SECTION_START; - servo_info[channel].ticks = value; - CRITICAL_SECTION_END; - } -} - -// return the value as degrees -int Servo::read() { return map(this->readMicroseconds() + 1, SERVO_MIN(), SERVO_MAX(), 0, 180); } - -int Servo::readMicroseconds() { - return (this->servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[this->servoIndex].ticks) + TRIM_DURATION; -} - -bool Servo::attached() { return servo_info[this->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 ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); - #endif - } -} - -#endif // HAS_SERVOS diff --git a/Marlin/servo.h b/Marlin/servo.h deleted file mode 100644 index 16496461e4..0000000000 --- a/Marlin/servo.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * The sequence used to seize timers is defined in timers.h - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin ) - Attaches a servo motor to an i/o pin. - * attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds - * default min is 544, max is 2400 - * - * write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) - * writeMicroseconds() - Sets the servo pulse width in microseconds - * read() - Gets the last written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) - * attached() - Returns true if there is a servo attached. - * detach() - Stops an attached servos from pulsing its i/o pin. - * move(angle) - Sequence of attach(0), write(angle), - * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. - */ - -#ifndef SERVO_H -#define SERVO_H - -#include - -/** - * Defines for 16 bit timers used with Servo library - * - * If _useTimerX is defined then TimerX is a 16 bit timer on the current board - * timer16_Sequence_t enumerates the sequence that the timers should be allocated - * _Nbr_16timers indicates how many 16 bit timers are available. - * - */ - -// Say which 16 bit timers can be used and in what order -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - //#define _useTimer1 // Timer 1 is used by the stepper ISR - #define _useTimer3 - #define _useTimer4 - #if !HAS_MOTOR_CURRENT_PWM - #define _useTimer5 // Timer 5 is used for motor current PWM and can't be used for servos. - #endif -#elif defined(__AVR_ATmega32U4__) - #define _useTimer3 -#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) - #define _useTimer3 -#elif defined(__AVR_ATmega128__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega2561__) - #define _useTimer3 -#else - // everything else -#endif - -typedef enum { - #if ENABLED(_useTimer1) - _timer1, - #endif - #if ENABLED(_useTimer3) - _timer3, - #endif - #if ENABLED(_useTimer4) - _timer4, - #endif - #if ENABLED(_useTimer5) - _timer5, - #endif - _Nbr_16timers -} timer16_Sequence_t; - -#define Servo_VERSION 2 // software version of this library - -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds - -#define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer -#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER) - -#define INVALID_SERVO 255 // flag indicating an invalid servo index - -typedef struct { - uint8_t nbr : 6 ; // a pin number from 0 to 63 - uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false -} ServoPin_t; - -typedef struct { - ServoPin_t Pin; - unsigned int ticks; -} ServoInfo_t; - -class Servo { - public: - Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - int8_t attach(const int pin, const int min, const int max); // as above but also sets min and max values for writes. - void detach(); - void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - void writeMicroseconds(int value); // write pulse width in microseconds - void move(const int value); // attach the servo, then move to value - // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach - int read(); // returns current pulse width as an angle between 0 and 180 degrees - int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) - bool attached(); // return true if this servo is attached, otherwise false - - private: - uint8_t servoIndex; // index into the channel data for this servo - int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH - int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH -}; - -#endif // SERVO_H diff --git a/Marlin/softspi.h b/Marlin/softspi.h deleted file mode 100644 index c9fbea01b4..0000000000 --- a/Marlin/softspi.h +++ /dev/null @@ -1,769 +0,0 @@ -//https://github.com/niteris/ArduinoSoftSpi - -#include -#ifdef __arm__ -#ifdef CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - return *portInputRegister(pin); -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value) { - if (value) { - *portSetRegister(pin) = 1; - } else { - *portClearRegister(pin) = 1; - } -} -#else // CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin){ - return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value){ - if (value) - g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else - g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; -} -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -inline void fastDigitalToggle(uint8_t pin) { - fastDigitalWrite(pin, !fastDigitalRead(pin)); - } -//------------------------------------------------------------------------------ -inline void fastPinMode(uint8_t pin, bool mode) {pinMode(pin, mode);} -#else // __arm__ -#include -#include -//------------------------------------------------------------------------------ -/** - * @class pin_map_t - * @brief struct for mapping digital pins - */ -struct pin_map_t { - volatile uint8_t* ddr; /**< address of DDR for this pin */ - volatile uint8_t* pin; /**< address of PIN for this pin */ - volatile uint8_t* port; /**< address of PORT for this pin */ - uint8_t bit; /**< bit number for this pin */ -}; -//------------------------------------------------------------------------------ -#if defined(__AVR_ATmega168__)\ -||defined(__AVR_ATmega168P__)\ -||defined(__AVR_ATmega328P__) -// 168 and 328 Arduinos -const static pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRB, &PINB, &PORTB, 0}, // B0 8 - {&DDRB, &PINB, &PORTB, 1}, // B1 9 - {&DDRB, &PINB, &PORTB, 2}, // B2 10 - {&DDRB, &PINB, &PORTB, 3}, // B3 11 - {&DDRB, &PINB, &PORTB, 4}, // B4 12 - {&DDRB, &PINB, &PORTB, 5}, // B5 13 - {&DDRC, &PINC, &PORTC, 0}, // C0 14 - {&DDRC, &PINC, &PORTC, 1}, // C1 15 - {&DDRC, &PINC, &PORTC, 2}, // C2 16 - {&DDRC, &PINC, &PORTC, 3}, // C3 17 - {&DDRC, &PINC, &PORTC, 4}, // C4 18 - {&DDRC, &PINC, &PORTC, 5} // C5 19 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1280__)\ -|| defined(__AVR_ATmega2560__) -// Mega -static const pin_map_t pinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 4}, // E4 2 - {&DDRE, &PINE, &PORTE, 5}, // E5 3 - {&DDRG, &PING, &PORTG, 5}, // G5 4 - {&DDRE, &PINE, &PORTE, 3}, // E3 5 - {&DDRH, &PINH, &PORTH, 3}, // H3 6 - {&DDRH, &PINH, &PORTH, 4}, // H4 7 - {&DDRH, &PINH, &PORTH, 5}, // H5 8 - {&DDRH, &PINH, &PORTH, 6}, // H6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 - {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 - {&DDRH, &PINH, &PORTH, 1}, // H1 16 - {&DDRH, &PINH, &PORTH, 0}, // H0 17 - {&DDRD, &PIND, &PORTD, 3}, // D3 18 - {&DDRD, &PIND, &PORTD, 2}, // D2 19 - {&DDRD, &PIND, &PORTD, 1}, // D1 20 - {&DDRD, &PIND, &PORTD, 0}, // D0 21 - {&DDRA, &PINA, &PORTA, 0}, // A0 22 - {&DDRA, &PINA, &PORTA, 1}, // A1 23 - {&DDRA, &PINA, &PORTA, 2}, // A2 24 - {&DDRA, &PINA, &PORTA, 3}, // A3 25 - {&DDRA, &PINA, &PORTA, 4}, // A4 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRA, &PINA, &PORTA, 6}, // A6 28 - {&DDRA, &PINA, &PORTA, 7}, // A7 29 - {&DDRC, &PINC, &PORTC, 7}, // C7 30 - {&DDRC, &PINC, &PORTC, 6}, // C6 31 - {&DDRC, &PINC, &PORTC, 5}, // C5 32 - {&DDRC, &PINC, &PORTC, 4}, // C4 33 - {&DDRC, &PINC, &PORTC, 3}, // C3 34 - {&DDRC, &PINC, &PORTC, 2}, // C2 35 - {&DDRC, &PINC, &PORTC, 1}, // C1 36 - {&DDRC, &PINC, &PORTC, 0}, // C0 37 - {&DDRD, &PIND, &PORTD, 7}, // D7 38 - {&DDRG, &PING, &PORTG, 2}, // G2 39 - {&DDRG, &PING, &PORTG, 1}, // G1 40 - {&DDRG, &PING, &PORTG, 0}, // G0 41 - {&DDRL, &PINL, &PORTL, 7}, // L7 42 - {&DDRL, &PINL, &PORTL, 6}, // L6 43 - {&DDRL, &PINL, &PORTL, 5}, // L5 44 - {&DDRL, &PINL, &PORTL, 4}, // L4 45 - {&DDRL, &PINL, &PORTL, 3}, // L3 46 - {&DDRL, &PINL, &PORTL, 2}, // L2 47 - {&DDRL, &PINL, &PORTL, 1}, // L1 48 - {&DDRL, &PINL, &PORTL, 0}, // L0 49 - {&DDRB, &PINB, &PORTB, 3}, // B3 50 - {&DDRB, &PINB, &PORTB, 2}, // B2 51 - {&DDRB, &PINB, &PORTB, 1}, // B1 52 - {&DDRB, &PINB, &PORTB, 0}, // B0 53 - {&DDRF, &PINF, &PORTF, 0}, // F0 54 - {&DDRF, &PINF, &PORTF, 1}, // F1 55 - {&DDRF, &PINF, &PORTF, 2}, // F2 56 - {&DDRF, &PINF, &PORTF, 3}, // F3 57 - {&DDRF, &PINF, &PORTF, 4}, // F4 58 - {&DDRF, &PINF, &PORTF, 5}, // F5 59 - {&DDRF, &PINF, &PORTF, 6}, // F6 60 - {&DDRF, &PINF, &PORTF, 7}, // F7 61 - {&DDRK, &PINK, &PORTK, 0}, // K0 62 - {&DDRK, &PINK, &PORTK, 1}, // K1 63 - {&DDRK, &PINK, &PORTK, 2}, // K2 64 - {&DDRK, &PINK, &PORTK, 3}, // K3 65 - {&DDRK, &PINK, &PORTK, 4}, // K4 66 - {&DDRK, &PINK, &PORTK, 5}, // K5 67 - {&DDRK, &PINK, &PORTK, 6}, // K6 68 - {&DDRK, &PINK, &PORTK, 7}, // K7 69 - -//pins_MIGHTYBOARD_REVE.h - {&DDRG, &PING, &PORTG, 4}, // G4 70 - {&DDRG, &PING, &PORTG, 3}, // G3 71 - {&DDRJ, &PINJ, &PORTJ, 2}, // J2 72 - {&DDRJ, &PINJ, &PORTJ, 3}, // J3 73 - {&DDRJ, &PINJ, &PORTJ, 7}, // J7 74 - {&DDRJ, &PINJ, &PORTJ, 4}, // J4 75 - {&DDRJ, &PINJ, &PORTJ, 5}, // J5 76 - {&DDRJ, &PINJ, &PORTJ, 6}, // J6 77 - {&DDRE, &PINE, &PORTE, 2}, // E2 78 - {&DDRE, &PINE, &PORTE, 6} // E6 79 - -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1284P__)\ -|| defined(__AVR_ATmega1284__)\ -|| defined(__AVR_ATmega644P__)\ -|| defined(__AVR_ATmega644__)\ -|| defined(__AVR_ATmega64__)\ -|| defined(__AVR_ATmega32__)\ -|| defined(__AVR_ATmega324__)\ -|| defined(__AVR_ATmega16__) - -#if defined(VARIANT_MIGHTY) -// Mighty Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 0}, // A0 24 - {&DDRA, &PINA, &PORTA, 1}, // A1 25 - {&DDRA, &PINA, &PORTA, 2}, // A2 26 - {&DDRA, &PINA, &PORTA, 3}, // A3 27 - {&DDRA, &PINA, &PORTA, 4}, // A4 28 - {&DDRA, &PINA, &PORTA, 5}, // A5 29 - {&DDRA, &PINA, &PORTA, 6}, // A6 30 - {&DDRA, &PINA, &PORTA, 7} // A7 31 -}; -#elif defined(VARIANT_BOBUINO) -// Bobuino Layout -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRB, &PINB, &PORTB, 0}, // B0 4 - {&DDRB, &PINB, &PORTB, 1}, // B1 5 - {&DDRB, &PINB, &PORTB, 2}, // B2 6 - {&DDRB, &PINB, &PORTB, 3}, // B3 7 - {&DDRD, &PIND, &PORTD, 5}, // D5 8 - {&DDRD, &PIND, &PORTD, 6}, // D6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRA, &PINA, &PORTA, 7}, // A7 14 - {&DDRA, &PINA, &PORTA, 6}, // A6 15 - {&DDRA, &PINA, &PORTA, 5}, // A5 16 - {&DDRA, &PINA, &PORTA, 4}, // A4 17 - {&DDRA, &PINA, &PORTA, 3}, // A3 18 - {&DDRA, &PINA, &PORTA, 2}, // A2 19 - {&DDRA, &PINA, &PORTA, 1}, // A1 20 - {&DDRA, &PINA, &PORTA, 0}, // A0 21 - {&DDRC, &PINC, &PORTC, 0}, // C0 22 - {&DDRC, &PINC, &PORTC, 1}, // C1 23 - {&DDRC, &PINC, &PORTC, 2}, // C2 24 - {&DDRC, &PINC, &PORTC, 3}, // C3 25 - {&DDRC, &PINC, &PORTC, 4}, // C4 26 - {&DDRC, &PINC, &PORTC, 5}, // C5 27 - {&DDRC, &PINC, &PORTC, 6}, // C6 28 - {&DDRC, &PINC, &PORTC, 7}, // C7 29 - {&DDRD, &PIND, &PORTD, 4}, // D4 30 - {&DDRD, &PIND, &PORTD, 7} // D7 31 -}; -#elif defined(VARIANT_STANDARD) -// Standard Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 7}, // A7 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRA, &PINA, &PORTA, 5}, // A5 26 - {&DDRA, &PINA, &PORTA, 4}, // A4 27 - {&DDRA, &PINA, &PORTA, 3}, // A3 28 - {&DDRA, &PINA, &PORTA, 2}, // A2 29 - {&DDRA, &PINA, &PORTA, 1}, // A1 30 - {&DDRA, &PINA, &PORTA, 0} // A0 31 -}; -#else // VARIANT_MIGHTY -#error Undefined variant 1284, 644, 324, 64, 32 -#endif // VARIANT_MIGHTY -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega32U4__) -#ifdef CORE_TEENSY -// Teensy 2.0 -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 7}, // B7 4 - {&DDRD, &PIND, &PORTD, 0}, // D0 5 - {&DDRD, &PIND, &PORTD, 1}, // D1 6 - {&DDRD, &PIND, &PORTD, 2}, // D2 7 - {&DDRD, &PIND, &PORTD, 3}, // D3 8 - {&DDRC, &PINC, &PORTC, 6}, // C6 9 - {&DDRC, &PINC, &PORTC, 7}, // C7 10 - {&DDRD, &PIND, &PORTD, 6}, // D6 11 - {&DDRD, &PIND, &PORTD, 7}, // D7 12 - {&DDRB, &PINB, &PORTB, 4}, // B4 13 - {&DDRB, &PINB, &PORTB, 5}, // B5 14 - {&DDRB, &PINB, &PORTB, 6}, // B6 15 - {&DDRF, &PINF, &PORTF, 7}, // F7 16 - {&DDRF, &PINF, &PORTF, 6}, // F6 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 4}, // F4 19 - {&DDRF, &PINF, &PORTF, 1}, // F1 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRD, &PIND, &PORTD, 4}, // D4 22 - {&DDRD, &PIND, &PORTD, 5}, // D5 23 - {&DDRE, &PINE, &PORTE, 6} // E6 24 -}; -//------------------------------------------------------------------------------ -#else // CORE_TEENSY -// Leonardo -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 2}, // D2 0 - {&DDRD, &PIND, &PORTD, 3}, // D3 1 - {&DDRD, &PIND, &PORTD, 1}, // D1 2 - {&DDRD, &PIND, &PORTD, 0}, // D0 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRC, &PINC, &PORTC, 6}, // C6 5 - {&DDRD, &PIND, &PORTD, 7}, // D7 6 - {&DDRE, &PINE, &PORTE, 6}, // E6 7 - {&DDRB, &PINB, &PORTB, 4}, // B4 8 - {&DDRB, &PINB, &PORTB, 5}, // B5 9 - {&DDRB, &PINB, &PORTB, 6}, // B6 10 - {&DDRB, &PINB, &PORTB, 7}, // B7 11 - {&DDRD, &PIND, &PORTD, 6}, // D6 12 - {&DDRC, &PINC, &PORTC, 7}, // C7 13 - {&DDRB, &PINB, &PORTB, 3}, // B3 14 - {&DDRB, &PINB, &PORTB, 1}, // B1 15 - {&DDRB, &PINB, &PORTB, 2}, // B2 16 - {&DDRB, &PINB, &PORTB, 0}, // B0 17 - {&DDRF, &PINF, &PORTF, 7}, // F7 18 - {&DDRF, &PINF, &PORTF, 6}, // F6 19 - {&DDRF, &PINF, &PORTF, 5}, // F5 20 - {&DDRF, &PINF, &PORTF, 4}, // F4 21 - {&DDRF, &PINF, &PORTF, 1}, // F1 22 - {&DDRF, &PINF, &PORTF, 0}, // F0 23 - {&DDRD, &PIND, &PORTD, 4}, // D4 24 - {&DDRD, &PIND, &PORTD, 7}, // D7 25 - {&DDRB, &PINB, &PORTB, 4}, // B4 26 - {&DDRB, &PINB, &PORTB, 5}, // B5 27 - {&DDRB, &PINB, &PORTB, 6}, // B6 28 - {&DDRD, &PIND, &PORTD, 6} // D6 29 -}; -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -#elif defined(__AVR_AT90USB646__)\ -|| defined(__AVR_AT90USB1286__) -// Teensy++ 1.0 & 2.0 -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRE, &PINE, &PORTE, 0}, // E0 8 - {&DDRE, &PINE, &PORTE, 1}, // E1 9 - {&DDRC, &PINC, &PORTC, 0}, // C0 10 - {&DDRC, &PINC, &PORTC, 1}, // C1 11 - {&DDRC, &PINC, &PORTC, 2}, // C2 12 - {&DDRC, &PINC, &PORTC, 3}, // C3 13 - {&DDRC, &PINC, &PORTC, 4}, // C4 14 - {&DDRC, &PINC, &PORTC, 5}, // C5 15 - {&DDRC, &PINC, &PORTC, 6}, // C6 16 - {&DDRC, &PINC, &PORTC, 7}, // C7 17 - {&DDRE, &PINE, &PORTE, 6}, // E6 18 - {&DDRE, &PINE, &PORTE, 7}, // E7 19 - {&DDRB, &PINB, &PORTB, 0}, // B0 20 - {&DDRB, &PINB, &PORTB, 1}, // B1 21 - {&DDRB, &PINB, &PORTB, 2}, // B2 22 - {&DDRB, &PINB, &PORTB, 3}, // B3 23 - {&DDRB, &PINB, &PORTB, 4}, // B4 24 - {&DDRB, &PINB, &PORTB, 5}, // B5 25 - {&DDRB, &PINB, &PORTB, 6}, // B6 26 - {&DDRB, &PINB, &PORTB, 7}, // B7 27 - {&DDRA, &PINA, &PORTA, 0}, // A0 28 - {&DDRA, &PINA, &PORTA, 1}, // A1 29 - {&DDRA, &PINA, &PORTA, 2}, // A2 30 - {&DDRA, &PINA, &PORTA, 3}, // A3 31 - {&DDRA, &PINA, &PORTA, 4}, // A4 32 - {&DDRA, &PINA, &PORTA, 5}, // A5 33 - {&DDRA, &PINA, &PORTA, 6}, // A6 34 - {&DDRA, &PINA, &PORTA, 7}, // A7 35 - {&DDRE, &PINE, &PORTE, 4}, // E4 36 - {&DDRE, &PINE, &PORTE, 5}, // E5 37 - {&DDRF, &PINF, &PORTF, 0}, // F0 38 - {&DDRF, &PINF, &PORTF, 1}, // F1 39 - {&DDRF, &PINF, &PORTF, 2}, // F2 40 - {&DDRF, &PINF, &PORTF, 3}, // F3 41 - {&DDRF, &PINF, &PORTF, 4}, // F4 42 - {&DDRF, &PINF, &PORTF, 5}, // F5 43 - {&DDRF, &PINF, &PORTF, 6}, // F6 44 - {&DDRF, &PINF, &PORTF, 7} // F7 45 -}; -//------------------------------------------------------------------------------ -#else // CPU type -#error unknown CPU type -#endif // CPU type -//------------------------------------------------------------------------------ -/** count of pins */ -static const uint8_t digitalPinCount = sizeof(pinMap)/sizeof(pin_map_t); -//============================================================================== -/** generate bad pin number error */ -void badPinNumber(void) - __attribute__((error("Pin number is too large or not a constant"))); -//------------------------------------------------------------------------------ -/** Check for valid pin number - * @param[in] pin Number of pin to be checked. - */ -static inline __attribute__((always_inline)) -void badPinCheck(uint8_t pin) { - if (!__builtin_constant_p(pin) || pin >= digitalPinCount) { - badPinNumber(); - } -} -//------------------------------------------------------------------------------ -/** fast write helper - * @param[in] address I/O register address - * @param[in] bit bit number to write - * @param[in] level value for bit - */ -static inline __attribute__((always_inline)) -void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) { - uint8_t oldSREG; - if (address > (uint8_t*)0x5F) { - oldSREG = SREG; - cli(); - } - if (level) { - *address |= 1 << bit; - } else { - *address &= ~(1 << bit); - } - if (address > (uint8_t*)0x5F) { - SREG = oldSREG; - } -} -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - badPinCheck(pin); - return (*pinMap[pin].pin >> pinMap[pin].bit) & 1; -} -//------------------------------------------------------------------------------ -/** toggle a pin - * @param[in] pin Arduino pin number - * - * If the pin is in output mode toggle the pin level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ -static inline __attribute__((always_inline)) -void fastDigitalToggle(uint8_t pin) { - badPinCheck(pin); - if (pinMap[pin].pin > (uint8_t*)0x5F) { - // must write bit to high address port - *pinMap[pin].pin = 1 << pinMap[pin].bit; - } else { - // will compile to sbi and PIN register will not be read. - *pinMap[pin].pin |= 1 << pinMap[pin].bit; - } -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool level) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, level); -} -//------------------------------------------------------------------------------ -/** set pin mode - * @param[in] pin Arduino pin number - * @param[in] mode if true set output mode else input mode - * - * fastPinMode does not enable or disable the 20K pullup for input mode. - */ -static inline __attribute__((always_inline)) -void fastPinMode(uint8_t pin, bool mode) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].ddr, pinMap[pin].bit, mode); -} - -#endif // __arm__ -//------------------------------------------------------------------------------ -/** set pin configuration - * @param[in] pin Arduino pin number - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ -static inline __attribute__((always_inline)) -void fastPinConfig(uint8_t pin, bool mode, bool level) { - fastPinMode(pin, mode); - fastDigitalWrite(pin, level); -} -//============================================================================== -/** - * @class DigitalPin - * @brief Fast digital port I/O - */ -template -class DigitalPin { - public: - //---------------------------------------------------------------------------- - /** Constructor */ - DigitalPin() {} - //---------------------------------------------------------------------------- - /** Constructor - * @param[in] pinMode if true set output mode else input mode. - */ - explicit DigitalPin(bool pinMode) { - mode(pinMode); - } - //---------------------------------------------------------------------------- - /** Constructor - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - DigitalPin(bool mode, bool level) { - config(mode, level); - } - //---------------------------------------------------------------------------- - /** Asignment operator - * @param[in] value If true set the pin's level high else set the - * pin's level low. - * - * @return This DigitalPin instance. - */ - inline DigitalPin & operator = (bool value) __attribute__((always_inline)) { - write(value); - return *this; - } - //---------------------------------------------------------------------------- - /** Parenthesis operator - * @return Pin's level - */ - inline operator bool () const __attribute__((always_inline)) { - return read(); - } - //---------------------------------------------------------------------------- - /** set pin configuration - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - inline __attribute__((always_inline)) - void config(bool mode, bool level) { - fastPinConfig(PinNumber, mode, level); - } - //---------------------------------------------------------------------------- - /** - * Set pin level high if output mode or enable 20K pullup if input mode. - */ - inline __attribute__((always_inline)) - void high() {write(true);} - //---------------------------------------------------------------------------- - /** - * Set pin level low if output mode or disable 20K pullup if input mode. - */ - inline __attribute__((always_inline)) - void low() {write(false);} - //---------------------------------------------------------------------------- - /** - * Set pin mode - * @param[in] pinMode if true set output mode else input mode. - * - * mode() does not enable or disable the 20K pullup for input mode. - */ - inline __attribute__((always_inline)) - void mode(bool pinMode) { - fastPinMode(PinNumber, pinMode); - } - //---------------------------------------------------------------------------- - /** @return Pin's level */ - inline __attribute__((always_inline)) - bool read() const { - return fastDigitalRead(PinNumber); - } - //---------------------------------------------------------------------------- - /** toggle a pin - * - * If the pin is in output mode toggle the pin's level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ - inline __attribute__((always_inline)) - void toggle() { - fastDigitalToggle(PinNumber); - } - //---------------------------------------------------------------------------- - /** Write the pin's level. - * @param[in] value If true set the pin's level high else set the - * pin's level low. - */ - inline __attribute__((always_inline)) - void write(bool value) { - fastDigitalWrite(PinNumber, value); - } -}; - -//------------------------------------------------------------------------------ -/** Nop for timing. */ -#define nop asm volatile ("nop\n\t") -//------------------------------------------------------------------------------ -/** Pin Mode for MISO is input.*/ -const bool MISO_MODE = false; -/** Pullups disabled for MISO are disabled. */ -const bool MISO_LEVEL = false; -/** Pin Mode for MOSI is output.*/ -const bool MOSI_MODE = true; -/** Pin Mode for SCK is output. */ -const bool SCK_MODE = true; -//------------------------------------------------------------------------------ -/** - * @class SoftSPI - * @brief Fast software SPI. - */ -template -class SoftSPI { - public: - //---------------------------------------------------------------------------- - /** Initialize SoftSPI pins. */ - void begin() { - fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL); - fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode)); - fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode)); - } - //---------------------------------------------------------------------------- - /** Soft SPI receive byte. - * @return Data byte received. - */ - inline __attribute__((always_inline)) - uint8_t receive() { - uint8_t data = 0; - receiveBit(7, &data); - receiveBit(6, &data); - receiveBit(5, &data); - receiveBit(4, &data); - receiveBit(3, &data); - receiveBit(2, &data); - receiveBit(1, &data); - receiveBit(0, &data); - return data; - } - //---------------------------------------------------------------------------- - /** Soft SPI send byte. - * @param[in] data Data byte to send. - */ - inline __attribute__((always_inline)) - void send(uint8_t data) { - sendBit(7, data); - sendBit(6, data); - sendBit(5, data); - sendBit(4, data); - sendBit(3, data); - sendBit(2, data); - sendBit(1, data); - sendBit(0, data); - } - //---------------------------------------------------------------------------- - /** Soft SPI transfer byte. - * @param[in] txData Data byte to send. - * @return Data byte received. - */ - inline __attribute__((always_inline)) - uint8_t transfer(uint8_t txData) { - uint8_t rxData = 0; - transferBit(7, &rxData, txData); - transferBit(6, &rxData, txData); - transferBit(5, &rxData, txData); - transferBit(4, &rxData, txData); - transferBit(3, &rxData, txData); - transferBit(2, &rxData, txData); - transferBit(1, &rxData, txData); - transferBit(0, &rxData, txData); - return rxData; - } - - private: - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - bool MODE_CPHA(uint8_t mode) {return (mode & 1) != 0;} - inline __attribute__((always_inline)) - bool MODE_CPOL(uint8_t mode) {return (mode & 2) != 0;} - inline __attribute__((always_inline)) - void receiveBit(uint8_t bit, uint8_t* data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - nop; - nop; - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *data |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void sendBit(uint8_t bit, uint8_t data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, data & (1 << bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - nop; - nop; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, txData & (1 << bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *rxData |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- -}; - - diff --git a/Marlin/speed_lookuptable.h b/Marlin/speed_lookuptable.h deleted file mode 100644 index 72e96e0f86..0000000000 --- a/Marlin/speed_lookuptable.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef SPEED_LOOKUPTABLE_H -#define SPEED_LOOKUPTABLE_H - -#include "MarlinConfig.h" - -#if F_CPU == 16000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, - { 961, 105}, { 856, 85}, { 771, 69}, { 702, 58}, { 644, 49}, { 595, 42}, { 553, 37}, { 516, 32}, - { 484, 28}, { 456, 25}, { 431, 23}, { 408, 20}, { 388, 19}, { 369, 16}, { 353, 16}, { 337, 14}, - { 323, 13}, { 310, 11}, { 299, 11}, { 288, 11}, { 277, 9}, { 268, 9}, { 259, 8}, { 251, 8}, - { 243, 8}, { 235, 7}, { 228, 6}, { 222, 6}, { 216, 6}, { 210, 6}, { 204, 5}, { 199, 5}, - { 194, 5}, { 189, 4}, { 185, 4}, { 181, 4}, { 177, 4}, { 173, 4}, { 169, 4}, { 165, 3}, - { 162, 3}, { 159, 4}, { 155, 3}, { 152, 3}, { 149, 2}, { 147, 3}, { 144, 3}, { 141, 2}, - { 139, 3}, { 136, 2}, { 134, 2}, { 132, 3}, { 129, 2}, { 127, 2}, { 125, 2}, { 123, 2}, - { 121, 2}, { 119, 1}, { 118, 2}, { 116, 2}, { 114, 1}, { 113, 2}, { 111, 2}, { 109, 1}, - { 108, 2}, { 106, 1}, { 105, 2}, { 103, 1}, { 102, 1}, { 101, 1}, { 100, 2}, { 98, 1}, - { 97, 1}, { 96, 1}, { 95, 2}, { 93, 1}, { 92, 1}, { 91, 1}, { 90, 1}, { 89, 1}, - { 88, 1}, { 87, 1}, { 86, 1}, { 85, 1}, { 84, 1}, { 83, 0}, { 83, 1}, { 82, 1}, - { 81, 1}, { 80, 1}, { 79, 1}, { 78, 0}, { 78, 1}, { 77, 1}, { 76, 1}, { 75, 0}, - { 75, 1}, { 74, 1}, { 73, 1}, { 72, 0}, { 72, 1}, { 71, 1}, { 70, 0}, { 70, 1}, - { 69, 0}, { 69, 1}, { 68, 1}, { 67, 0}, { 67, 1}, { 66, 0}, { 66, 1}, { 65, 0}, - { 65, 1}, { 64, 1}, { 63, 0}, { 63, 1}, { 62, 0}, { 62, 1}, { 61, 0}, { 61, 1}, - { 60, 0}, { 60, 0}, { 60, 1}, { 59, 0}, { 59, 1}, { 58, 0}, { 58, 1}, { 57, 0}, - { 57, 1}, { 56, 0}, { 56, 0}, { 56, 1}, { 55, 0}, { 55, 1}, { 54, 0}, { 54, 0}, - { 54, 1}, { 53, 0}, { 53, 0}, { 53, 1}, { 52, 0}, { 52, 0}, { 52, 1}, { 51, 0}, - { 51, 0}, { 51, 1}, { 50, 0}, { 50, 0}, { 50, 1}, { 49, 0}, { 49, 0}, { 49, 1}, - { 48, 0}, { 48, 0}, { 48, 1}, { 47, 0}, { 47, 0}, { 47, 0}, { 47, 1}, { 46, 0}, - { 46, 0}, { 46, 1}, { 45, 0}, { 45, 0}, { 45, 0}, { 45, 1}, { 44, 0}, { 44, 0}, - { 44, 0}, { 44, 1}, { 43, 0}, { 43, 0}, { 43, 0}, { 43, 1}, { 42, 0}, { 42, 0}, - { 42, 0}, { 42, 1}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 1}, { 40, 0}, - { 40, 0}, { 40, 0}, { 40, 0}, { 40, 1}, { 39, 0}, { 39, 0}, { 39, 0}, { 39, 0}, - { 39, 1}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 1}, { 37, 0}, { 37, 0}, - { 37, 0}, { 37, 0}, { 37, 0}, { 37, 1}, { 36, 0}, { 36, 0}, { 36, 0}, { 36, 0}, - { 36, 1}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 1}, - { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 1}, { 33, 0}, { 33, 0}, - { 33, 0}, { 33, 0}, { 33, 0}, { 33, 0}, { 33, 1}, { 32, 0}, { 32, 0}, { 32, 0}, - { 32, 0}, { 32, 0}, { 32, 0}, { 32, 0}, { 32, 1}, { 31, 0}, { 31, 0}, { 31, 0}, - { 31, 0}, { 31, 0}, { 31, 0}, { 31, 1}, { 30, 0}, { 30, 0}, { 30, 0}, { 30, 0} - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - { 62500, 12500}, { 50000, 8334}, { 41666, 5952}, { 35714, 4464}, { 31250, 3473}, { 27777, 2777}, { 25000, 2273}, { 22727, 1894}, - { 20833, 1603}, { 19230, 1373}, { 17857, 1191}, { 16666, 1041}, { 15625, 920}, { 14705, 817}, { 13888, 731}, { 13157, 657}, - { 12500, 596}, { 11904, 541}, { 11363, 494}, { 10869, 453}, { 10416, 416}, { 10000, 385}, { 9615, 356}, { 9259, 331}, - { 8928, 308}, { 8620, 287}, { 8333, 269}, { 8064, 252}, { 7812, 237}, { 7575, 223}, { 7352, 210}, { 7142, 198}, - { 6944, 188}, { 6756, 178}, { 6578, 168}, { 6410, 160}, { 6250, 153}, { 6097, 145}, { 5952, 139}, { 5813, 132}, - { 5681, 126}, { 5555, 121}, { 5434, 115}, { 5319, 111}, { 5208, 106}, { 5102, 102}, { 5000, 99}, { 4901, 94}, - { 4807, 91}, { 4716, 87}, { 4629, 84}, { 4545, 81}, { 4464, 79}, { 4385, 75}, { 4310, 73}, { 4237, 71}, - { 4166, 68}, { 4098, 66}, { 4032, 64}, { 3968, 62}, { 3906, 60}, { 3846, 59}, { 3787, 56}, { 3731, 55}, - { 3676, 53}, { 3623, 52}, { 3571, 50}, { 3521, 49}, { 3472, 48}, { 3424, 46}, { 3378, 45}, { 3333, 44}, - { 3289, 43}, { 3246, 41}, { 3205, 41}, { 3164, 39}, { 3125, 39}, { 3086, 38}, { 3048, 36}, { 3012, 36}, - { 2976, 35}, { 2941, 35}, { 2906, 33}, { 2873, 33}, { 2840, 32}, { 2808, 31}, { 2777, 30}, { 2747, 30}, - { 2717, 29}, { 2688, 29}, { 2659, 28}, { 2631, 27}, { 2604, 27}, { 2577, 26}, { 2551, 26}, { 2525, 25}, - { 2500, 25}, { 2475, 25}, { 2450, 23}, { 2427, 24}, { 2403, 23}, { 2380, 22}, { 2358, 22}, { 2336, 22}, - { 2314, 21}, { 2293, 21}, { 2272, 20}, { 2252, 20}, { 2232, 20}, { 2212, 20}, { 2192, 19}, { 2173, 18}, - { 2155, 19}, { 2136, 18}, { 2118, 18}, { 2100, 17}, { 2083, 17}, { 2066, 17}, { 2049, 17}, { 2032, 16}, - { 2016, 16}, { 2000, 16}, { 1984, 16}, { 1968, 15}, { 1953, 16}, { 1937, 14}, { 1923, 15}, { 1908, 15}, - { 1893, 14}, { 1879, 14}, { 1865, 14}, { 1851, 13}, { 1838, 14}, { 1824, 13}, { 1811, 13}, { 1798, 13}, - { 1785, 12}, { 1773, 13}, { 1760, 12}, { 1748, 12}, { 1736, 12}, { 1724, 12}, { 1712, 12}, { 1700, 11}, - { 1689, 12}, { 1677, 11}, { 1666, 11}, { 1655, 11}, { 1644, 11}, { 1633, 10}, { 1623, 11}, { 1612, 10}, - { 1602, 10}, { 1592, 10}, { 1582, 10}, { 1572, 10}, { 1562, 10}, { 1552, 9}, { 1543, 10}, { 1533, 9}, - { 1524, 9}, { 1515, 9}, { 1506, 9}, { 1497, 9}, { 1488, 9}, { 1479, 9}, { 1470, 9}, { 1461, 8}, - { 1453, 8}, { 1445, 9}, { 1436, 8}, { 1428, 8}, { 1420, 8}, { 1412, 8}, { 1404, 8}, { 1396, 8}, - { 1388, 7}, { 1381, 8}, { 1373, 7}, { 1366, 8}, { 1358, 7}, { 1351, 7}, { 1344, 8}, { 1336, 7}, - { 1329, 7}, { 1322, 7}, { 1315, 7}, { 1308, 6}, { 1302, 7}, { 1295, 7}, { 1288, 6}, { 1282, 7}, - { 1275, 6}, { 1269, 7}, { 1262, 6}, { 1256, 6}, { 1250, 7}, { 1243, 6}, { 1237, 6}, { 1231, 6}, - { 1225, 6}, { 1219, 6}, { 1213, 6}, { 1207, 6}, { 1201, 5}, { 1196, 6}, { 1190, 6}, { 1184, 5}, - { 1179, 6}, { 1173, 5}, { 1168, 6}, { 1162, 5}, { 1157, 5}, { 1152, 6}, { 1146, 5}, { 1141, 5}, - { 1136, 5}, { 1131, 5}, { 1126, 5}, { 1121, 5}, { 1116, 5}, { 1111, 5}, { 1106, 5}, { 1101, 5}, - { 1096, 5}, { 1091, 5}, { 1086, 4}, { 1082, 5}, { 1077, 5}, { 1072, 4}, { 1068, 5}, { 1063, 4}, - { 1059, 5}, { 1054, 4}, { 1050, 4}, { 1046, 5}, { 1041, 4}, { 1037, 4}, { 1033, 5}, { 1028, 4}, - { 1024, 4}, { 1020, 4}, { 1016, 4}, { 1012, 4}, { 1008, 4}, { 1004, 4}, { 1000, 4}, { 996, 4}, - { 992, 4}, { 988, 4}, { 984, 4}, { 980, 4}, { 976, 4}, { 972, 4}, { 968, 3}, { 965, 3} - }; - -#elif F_CPU == 20000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - {62500, 54055}, {8445, 3917}, {4528, 1434}, {3094, 745}, {2349, 456}, {1893, 307}, {1586, 222}, {1364, 167}, - {1197, 131}, {1066, 105}, {961, 86}, {875, 72}, {803, 61}, {742, 53}, {689, 45}, {644, 40}, - {604, 35}, {569, 32}, {537, 28}, {509, 25}, {484, 23}, {461, 21}, {440, 19}, {421, 17}, - {404, 16}, {388, 15}, {373, 14}, {359, 13}, {346, 12}, {334, 11}, {323, 10}, {313, 10}, - {303, 9}, {294, 9}, {285, 8}, {277, 7}, {270, 8}, {262, 7}, {255, 6}, {249, 6}, - {243, 6}, {237, 6}, {231, 5}, {226, 5}, {221, 5}, {216, 5}, {211, 4}, {207, 5}, - {202, 4}, {198, 4}, {194, 4}, {190, 3}, {187, 4}, {183, 3}, {180, 3}, {177, 4}, - {173, 3}, {170, 3}, {167, 2}, {165, 3}, {162, 3}, {159, 2}, {157, 3}, {154, 2}, - {152, 3}, {149, 2}, {147, 2}, {145, 2}, {143, 2}, {141, 2}, {139, 2}, {137, 2}, - {135, 2}, {133, 2}, {131, 2}, {129, 1}, {128, 2}, {126, 2}, {124, 1}, {123, 2}, - {121, 1}, {120, 2}, {118, 1}, {117, 1}, {116, 2}, {114, 1}, {113, 1}, {112, 2}, - {110, 1}, {109, 1}, {108, 1}, {107, 2}, {105, 1}, {104, 1}, {103, 1}, {102, 1}, - {101, 1}, {100, 1}, {99, 1}, {98, 1}, {97, 1}, {96, 1}, {95, 1}, {94, 1}, - {93, 1}, {92, 1}, {91, 0}, {91, 1}, {90, 1}, {89, 1}, {88, 1}, {87, 0}, - {87, 1}, {86, 1}, {85, 1}, {84, 0}, {84, 1}, {83, 1}, {82, 1}, {81, 0}, - {81, 1}, {80, 1}, {79, 0}, {79, 1}, {78, 0}, {78, 1}, {77, 1}, {76, 0}, - {76, 1}, {75, 0}, {75, 1}, {74, 1}, {73, 0}, {73, 1}, {72, 0}, {72, 1}, - {71, 0}, {71, 1}, {70, 0}, {70, 1}, {69, 0}, {69, 1}, {68, 0}, {68, 1}, - {67, 0}, {67, 1}, {66, 0}, {66, 1}, {65, 0}, {65, 0}, {65, 1}, {64, 0}, - {64, 1}, {63, 0}, {63, 1}, {62, 0}, {62, 0}, {62, 1}, {61, 0}, {61, 1}, - {60, 0}, {60, 0}, {60, 1}, {59, 0}, {59, 0}, {59, 1}, {58, 0}, {58, 0}, - {58, 1}, {57, 0}, {57, 0}, {57, 1}, {56, 0}, {56, 0}, {56, 1}, {55, 0}, - {55, 0}, {55, 1}, {54, 0}, {54, 0}, {54, 1}, {53, 0}, {53, 0}, {53, 0}, - {53, 1}, {52, 0}, {52, 0}, {52, 1}, {51, 0}, {51, 0}, {51, 0}, {51, 1}, - {50, 0}, {50, 0}, {50, 0}, {50, 1}, {49, 0}, {49, 0}, {49, 0}, {49, 1}, - {48, 0}, {48, 0}, {48, 0}, {48, 1}, {47, 0}, {47, 0}, {47, 0}, {47, 1}, - {46, 0}, {46, 0}, {46, 0}, {46, 0}, {46, 1}, {45, 0}, {45, 0}, {45, 0}, - {45, 1}, {44, 0}, {44, 0}, {44, 0}, {44, 0}, {44, 1}, {43, 0}, {43, 0}, - {43, 0}, {43, 0}, {43, 1}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, - {42, 1}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 1}, {40, 0}, - {40, 0}, {40, 0}, {40, 0}, {40, 1}, {39, 0}, {39, 0}, {39, 0}, {39, 0}, - {39, 0}, {39, 0}, {39, 1}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - {62500, 10417}, {52083, 7441}, {44642, 5580}, {39062, 4340}, {34722, 3472}, {31250, 2841}, {28409, 2368}, {26041, 2003}, - {24038, 1717}, {22321, 1488}, {20833, 1302}, {19531, 1149}, {18382, 1021}, {17361, 914}, {16447, 822}, {15625, 745}, - {14880, 676}, {14204, 618}, {13586, 566}, {13020, 520}, {12500, 481}, {12019, 445}, {11574, 414}, {11160, 385}, - {10775, 359}, {10416, 336}, {10080, 315}, {9765, 296}, {9469, 278}, {9191, 263}, {8928, 248}, {8680, 235}, - {8445, 222}, {8223, 211}, {8012, 200}, {7812, 191}, {7621, 181}, {7440, 173}, {7267, 165}, {7102, 158}, - {6944, 151}, {6793, 145}, {6648, 138}, {6510, 133}, {6377, 127}, {6250, 123}, {6127, 118}, {6009, 113}, - {5896, 109}, {5787, 106}, {5681, 101}, {5580, 98}, {5482, 95}, {5387, 91}, {5296, 88}, {5208, 86}, - {5122, 82}, {5040, 80}, {4960, 78}, {4882, 75}, {4807, 73}, {4734, 70}, {4664, 69}, {4595, 67}, - {4528, 64}, {4464, 63}, {4401, 61}, {4340, 60}, {4280, 58}, {4222, 56}, {4166, 55}, {4111, 53}, - {4058, 52}, {4006, 51}, {3955, 49}, {3906, 48}, {3858, 48}, {3810, 45}, {3765, 45}, {3720, 44}, - {3676, 43}, {3633, 42}, {3591, 40}, {3551, 40}, {3511, 39}, {3472, 38}, {3434, 38}, {3396, 36}, - {3360, 36}, {3324, 35}, {3289, 34}, {3255, 34}, {3221, 33}, {3188, 32}, {3156, 31}, {3125, 31}, - {3094, 31}, {3063, 30}, {3033, 29}, {3004, 28}, {2976, 28}, {2948, 28}, {2920, 27}, {2893, 27}, - {2866, 26}, {2840, 25}, {2815, 25}, {2790, 25}, {2765, 24}, {2741, 24}, {2717, 24}, {2693, 23}, - {2670, 22}, {2648, 22}, {2626, 22}, {2604, 22}, {2582, 21}, {2561, 21}, {2540, 20}, {2520, 20}, - {2500, 20}, {2480, 20}, {2460, 19}, {2441, 19}, {2422, 19}, {2403, 18}, {2385, 18}, {2367, 18}, - {2349, 17}, {2332, 18}, {2314, 17}, {2297, 16}, {2281, 17}, {2264, 16}, {2248, 16}, {2232, 16}, - {2216, 16}, {2200, 15}, {2185, 15}, {2170, 15}, {2155, 15}, {2140, 15}, {2125, 14}, {2111, 14}, - {2097, 14}, {2083, 14}, {2069, 14}, {2055, 13}, {2042, 13}, {2029, 13}, {2016, 13}, {2003, 13}, - {1990, 13}, {1977, 12}, {1965, 12}, {1953, 13}, {1940, 11}, {1929, 12}, {1917, 12}, {1905, 12}, - {1893, 11}, {1882, 11}, {1871, 11}, {1860, 11}, {1849, 11}, {1838, 11}, {1827, 11}, {1816, 10}, - {1806, 11}, {1795, 10}, {1785, 10}, {1775, 10}, {1765, 10}, {1755, 10}, {1745, 9}, {1736, 10}, - {1726, 9}, {1717, 10}, {1707, 9}, {1698, 9}, {1689, 9}, {1680, 9}, {1671, 9}, {1662, 9}, - {1653, 9}, {1644, 8}, {1636, 9}, {1627, 8}, {1619, 9}, {1610, 8}, {1602, 8}, {1594, 8}, - {1586, 8}, {1578, 8}, {1570, 8}, {1562, 8}, {1554, 7}, {1547, 8}, {1539, 8}, {1531, 7}, - {1524, 8}, {1516, 7}, {1509, 7}, {1502, 7}, {1495, 7}, {1488, 7}, {1481, 7}, {1474, 7}, - {1467, 7}, {1460, 7}, {1453, 7}, {1446, 6}, {1440, 7}, {1433, 7}, {1426, 6}, {1420, 6}, - {1414, 7}, {1407, 6}, {1401, 6}, {1395, 7}, {1388, 6}, {1382, 6}, {1376, 6}, {1370, 6}, - {1364, 6}, {1358, 6}, {1352, 6}, {1346, 5}, {1341, 6}, {1335, 6}, {1329, 5}, {1324, 6}, - {1318, 5}, {1313, 6}, {1307, 5}, {1302, 6}, {1296, 5}, {1291, 5}, {1286, 6}, {1280, 5}, - {1275, 5}, {1270, 5}, {1265, 5}, {1260, 5}, {1255, 5}, {1250, 5}, {1245, 5}, {1240, 5}, - {1235, 5}, {1230, 5}, {1225, 5}, {1220, 5}, {1215, 4}, {1211, 5}, {1206, 5}, {1201, 5}, - }; - -#endif - -#endif // SPEED_LOOKUPTABLE_H diff --git a/Marlin/status_screen_DOGM.h b/Marlin/status_screen_DOGM.h deleted file mode 100644 index 98678807be..0000000000 --- a/Marlin/status_screen_DOGM.h +++ /dev/null @@ -1,493 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * status_screen_DOGM.h - * - * Standard Status Screen for Graphical Display - */ - -#ifndef _STATUS_SCREEN_DOGM_H_ -#define _STATUS_SCREEN_DOGM_H_ - -FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t x, const uint8_t y) { - const char * const str = itostr3(temp); - u8g.setPrintPos(x - (str[0] != ' ' ? 0 : str[1] != ' ' ? 1 : 2) * DOG_CHAR_WIDTH / 2, y); - lcd_print(str); - lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); -} - -#ifndef HEAT_INDICATOR_X - #define HEAT_INDICATOR_X 8 -#endif - -FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, const bool blink) { - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif - - #if HAS_HEATED_BED - const bool isBed = heater < 0; - #else - constexpr bool isBed = false; - #endif - - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : - #endif - thermalManager.is_heater_idle(heater) - ); - - if (blink || !is_idle) - #endif - _draw_centered_temp(0.5f + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degTargetBed() : - #endif - thermalManager.degTargetHotend(heater) - ), x, 7 - ); - } - - if (PAGE_CONTAINS(21, 28)) { - _draw_centered_temp(0.5f + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degBed() : - #endif - thermalManager.degHotend(heater) - ), x, 28 - ); - - if (PAGE_CONTAINS(17, 20)) { - const uint8_t h = isBed ? 7 : HEAT_INDICATOR_X, - y = isBed ? 18 : 17; - if ( - #if HAS_HEATED_BED - isBed ? thermalManager.isHeatingBed() : - #endif - thermalManager.isHeatingHotend(heater) - ) { - u8g.setColorIndex(0); // white on black - u8g.drawBox(x + h, y, 2, 2); - u8g.setColorIndex(1); // black on white - } - else - u8g.drawBox(x + h, y, 2, 2); - } - } -} - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - if (blink) - lcd_print(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_print(c <= '.' ? c : '?'); - else { - #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_printPGM(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_print(value); - } - } -} - -inline void lcd_implementation_status_message(const bool blink) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_print_utf(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - u8g.print(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_print_utf(stat, LCD_WIDTH); - } - else { - // The remaining string does not completely fill the screen - lcd_print_utf(stat, LCD_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - u8g.print('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - u8g.print('.'); - if (--chars) // Print a second copy of the message - lcd_print_utf(lcd_status_message, LCD_WIDTH - (rlen + 2)); - } - } - if (last_blink != blink) { - last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_print_utf(lcd_status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - u8g.print(' '); - ++slen; - } - #endif -} - -static void lcd_implementation_status_screen() { - - const bool blink = lcd_blink(); - - #if FAN_ANIM_FRAMES > 2 - static bool old_blink; - static uint8_t fan_frame; - if (old_blink != blink) { - old_blink = blink; - if (!fanSpeeds[0] || ++fan_frame >= FAN_ANIM_FRAMES) fan_frame = 0; - } - #endif - - // Status Menu Font - lcd_setFont(FONT_STATUSMENU); - - // - // Fan Animation - // - // Draws the whole heading image as a B/W bitmap rather than - // drawing the elements separately. - // This was done as an optimization, as it was slower to draw - // multiple parts compared to a single bitmap. - // - // The bitmap: - // - May be offset in X - // - Includes all nozzle(s), bed(s), and the fan. - // - // TODO: - // - // - Only draw the whole header on the first - // entry to the status screen. Nozzle, bed, and - // fan outline bits don't change. - // - if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { - - u8g.drawBitmapP( - STATUS_SCREEN_X, STATUS_SCREEN_Y, - (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, - #if HAS_FAN0 - #if FAN_ANIM_FRAMES > 2 - fan_frame == 1 ? status_screen1_bmp : - fan_frame == 2 ? status_screen2_bmp : - #if FAN_ANIM_FRAMES > 3 - fan_frame == 3 ? status_screen3_bmp : - #endif - #else - blink && fanSpeeds[0] ? status_screen1_bmp : - #endif - #endif - status_screen0_bmp - ); - - } - - // - // Temperature Graphics and Info - // - - if (PAGE_UNDER(28)) { - // Extruders - HOTEND_LOOP() _draw_heater_status(STATUS_SCREEN_HOTEND_TEXT_X(e), e, blink); - - // Heated bed - #if HOTENDS < 4 && HAS_HEATED_BED - _draw_heater_status(STATUS_SCREEN_BED_TEXT_X, -1, blink); - #endif - - #if HAS_FAN0 - if (PAGE_CONTAINS(STATUS_SCREEN_FAN_TEXT_Y - 7, STATUS_SCREEN_FAN_TEXT_Y)) { - // Fan - const int16_t per = ((fanSpeeds[0] + 1) * 100) / 256; - if (per) { - u8g.setPrintPos(STATUS_SCREEN_FAN_TEXT_X, STATUS_SCREEN_FAN_TEXT_Y); - lcd_print(itostr3(per)); - u8g.print('%'); - } - } - #endif - } - - #if ENABLED(SDSUPPORT) - // - // SD Card Symbol - // - if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) { - // Upper box - u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47) - // Right edge - u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5); // 44-48 (or 43-47) - // Bottom hollow box - u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4); // 49-52 (or 48-51) - // Corner pixel - u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION)); // 43 (or 42) - } - #endif // SDSUPPORT - - #if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - // - // Progress bar frame - // - #define PROGRESS_BAR_X 54 - #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - - if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51) - u8g.drawFrame( - PROGRESS_BAR_X, 49, - PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) - ); - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - - if (progress_bar_percent > 1) { - - // - // Progress bar solid part - // - - if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) - u8g.drawBox( - PROGRESS_BAR_X + 1, 50, - (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION) - ); - - // - // SD Percent Complete - // - - #if ENABLED(DOGM_SD_PERCENT) - if (PAGE_CONTAINS(41, 48)) { - // Percent complete - u8g.setPrintPos(55, 48); - u8g.print(itostr3(progress_bar_percent)); - u8g.print('%'); - } - #endif - } - - // - // Elapsed Time - // - - #if DISABLED(DOGM_SD_PERCENT) - #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (DOG_CHAR_WIDTH / 2)) - #else - #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * DOG_CHAR_WIDTH) - #endif - - if (PAGE_CONTAINS(41, 48)) { - char buffer[10]; - duration_t elapsed = print_job_timer.duration(); - bool has_days = (elapsed.value >= 60*60*24L); - uint8_t len = elapsed.toDigital(buffer, has_days); - u8g.setPrintPos(SD_DURATION_X, 48); - lcd_print(buffer); - } - - #endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - - // - // XYZ Coordinates - // - - #define XYZ_BASELINE (30 + INFO_FONT_HEIGHT) - - #define X_LABEL_POS 3 - #define X_VALUE_POS 11 - #define XYZ_SPACING 40 - - #if ENABLED(XYZ_HOLLOW_FRAME) - #define XYZ_FRAME_TOP 29 - #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 3 - #else - #define XYZ_FRAME_TOP 30 - #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 1 - #endif - - static char xstring[5], ystring[5], zstring[7]; - #if ENABLED(FILAMENT_LCD_DISPLAY) - static char wstring[5], mstring[4]; - #endif - - // At the first page, regenerate the XYZ strings - if (page.page == 0) { - 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]))); - #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filament_width_meas)); - strcpy(mstring, itostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); - #endif - } - - if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { - - #if ENABLED(XYZ_HOLLOW_FRAME) - u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39 - #else - u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37 - #endif - - if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_HEIGHT - 1), XYZ_BASELINE)) { - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(0); // white on black - #endif - - u8g.setPrintPos(0 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_X)); - u8g.setPrintPos(0 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(X_AXIS, xstring, blink); - - u8g.setPrintPos(1 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_Y)); - u8g.setPrintPos(1 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(Y_AXIS, ystring, blink); - - u8g.setPrintPos(2 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_Z)); - u8g.setPrintPos(2 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(Z_AXIS, zstring, blink); - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(1); // black on white - #endif - } - } - - // - // Feedrate - // - - if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49)) { - lcd_setFont(FONT_MENU); - u8g.setPrintPos(3, 50); - lcd_print(LCD_STR_FEEDRATE[0]); - - lcd_setFont(FONT_STATUSMENU); - u8g.setPrintPos(12, 50); - lcd_print(itostr3(feedrate_percentage)); - u8g.print('%'); - - // - // Filament sensor display if SD is disabled - // - #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) - u8g.setPrintPos(56, 50); - lcd_print(wstring); - u8g.setPrintPos(102, 50); - lcd_print(mstring); - u8g.print('%'); - lcd_setFont(FONT_MENU); - u8g.setPrintPos(47, 50); - lcd_print(LCD_STR_FILAM_DIA); - u8g.setPrintPos(93, 50); - lcd_print(LCD_STR_FILAM_MUL); - #endif - } - - // - // Status line - // - - #define STATUS_BASELINE (55 + INFO_FONT_HEIGHT) - - if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_HEIGHT - 1), STATUS_BASELINE)) { - u8g.setPrintPos(0, STATUS_BASELINE); - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { //Display both Status message line and Filament display on the last line - lcd_implementation_status_message(blink); - } - else { - lcd_printPGM(PSTR(LCD_STR_FILAM_DIA)); - u8g.print(':'); - lcd_print(wstring); - lcd_printPGM(PSTR(" " LCD_STR_FILAM_MUL)); - u8g.print(':'); - lcd_print(mstring); - u8g.print('%'); - } - #else - lcd_implementation_status_message(blink); - #endif - } -} - -#endif // _STATUS_SCREEN_DOGM_H_ diff --git a/Marlin/status_screen_lite_ST7920.h b/Marlin/status_screen_lite_ST7920.h deleted file mode 100644 index 8bf1b4176c..0000000000 --- a/Marlin/status_screen_lite_ST7920.h +++ /dev/null @@ -1,972 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -/** - * Implementation of a Status Screen for the RepRapDiscount - * Full Graphics Smart Controller using native ST7920 commands - * instead of U8Glib. - * - * This alternative Status Screen makes use of the built-in character - * generation capabilities of the ST7920 to update the Status Screen - * with less SPI traffic and CPU use. In particular: - * - * - The fan and bed animations are handled using custom characters - * that are stored in CGRAM. This allows for the animation to be - * updated by writing a single character to the text-buffer (DDRAM). - * - * - All the information in the Status Screen is text that is written - * to DDRAM, so the work of generating the bitmaps is offloaded to - * the ST7920 rather than being render by U8Glib on the MCU. - * - * - The graphics buffer (GDRAM) is only used for static graphics - * elements (nozzle and feedrate bitmaps) and for the progress - * bar, so updates are sporadic. - */ - -#include "status_screen_lite_ST7920_class.h" - -#include "duration_t.h" - -#define BUFFER_WIDTH 256 -#define BUFFER_HEIGHT 32 - -#define DDRAM_LINE_1 0x00 -#define DDRAM_LINE_2 0x10 -#define DDRAM_LINE_3 0x08 -#define DDRAM_LINE_4 0x18 - -ST7920_Lite_Status_Screen::st7920_state_t ST7920_Lite_Status_Screen::current_bits; - -void ST7920_Lite_Status_Screen::cmd(const uint8_t cmd) { - if (!current_bits.synced || !current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = true; - sync_cmd(); - } - write_byte(cmd); -} - -void ST7920_Lite_Status_Screen::begin_data() { - if (!current_bits.synced || current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = false; - sync_dat(); - } -} - -void ST7920_Lite_Status_Screen::write_str(const char *str) { - while (*str) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str(const char *str, uint8_t len) { - while (*str && len--) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str_P(const char * const str) { - const char *p_str = (const char *)str; - while (char c = pgm_read_byte_near(p_str++)) write_byte(c); -} - -void ST7920_Lite_Status_Screen::write_str(progmem_str str) { - write_str_P((const char*)str); -} - -void ST7920_Lite_Status_Screen::write_number(const int16_t value, const uint8_t digits/*=3*/) { - char str[7]; - const char *fmt; - switch (digits) { - case 6: fmt = PSTR("%6d"); break; - case 5: fmt = PSTR("%5d"); break; - case 4: fmt = PSTR("%4d"); break; - case 3: fmt = PSTR("%3d"); break; - case 2: fmt = PSTR("%2d"); break; - case 1: fmt = PSTR("%1d"); break; - } - sprintf_P(str, fmt, value); - write_str(str); -} - -void ST7920_Lite_Status_Screen::display_status(const bool display_on, const bool cursor_on, const bool blink_on) { - extended_function_set(false); - cmd(0b00001000 | - (display_on ? 0b0100 : 0) | - (cursor_on ? 0b0010 : 0) | - (blink_on ? 0b0001 : 0) - ); -} - -// Sets the extended and graphics bits simultaneously, regardless of -// the current state. This is a helper function for extended_function_set() -// and graphics() -void ST7920_Lite_Status_Screen::_extended_function_set(const bool extended, const bool graphics) { - cmd( 0b00100000 | - (extended ? 0b00000100 : 0) | - (graphics ? 0b00000010 : 0) - ); - current_bits.extended = extended; - current_bits.graphics = graphics; -} - -void ST7920_Lite_Status_Screen::extended_function_set(const bool extended) { - if (extended != current_bits.extended) - _extended_function_set(extended, current_bits.graphics); -} - -void ST7920_Lite_Status_Screen::graphics(const bool graphics) { - if (graphics != current_bits.graphics) - _extended_function_set(current_bits.extended, graphics); -} - -void ST7920_Lite_Status_Screen::entry_mode_select(const bool ac_increase, const bool shift) { - extended_function_set(false); - cmd(0b00000100 | - (ac_increase ? 0b00000010 : 0) | - (shift ? 0b00000001 : 0) - ); -} - -// Sets the sa bit regardless of the current state. This is a helper -// function for scroll_or_addr_select() -void ST7920_Lite_Status_Screen::_scroll_or_addr_select(const bool sa) { - extended_function_set(true); - cmd(0b00100010 | - (sa ? 0b000001 : 0) - ); - current_bits.sa = sa; -} - -void ST7920_Lite_Status_Screen::scroll_or_addr_select(const bool sa) { - if (sa != current_bits.sa) - _scroll_or_addr_select(sa); -} - -void ST7920_Lite_Status_Screen::set_ddram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b10000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_cgram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b01000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_gdram_address(const uint8_t x, const uint8_t y) { - extended_function_set(true); - cmd(0b10000000 | (y & 0b01111111)); - cmd(0b10000000 | (x & 0b00001111)); -} - -void ST7920_Lite_Status_Screen::clear() { - extended_function_set(false); - cmd(0x00000001); - delay(15); //delay for CGRAM clear -} - -void ST7920_Lite_Status_Screen::home() { - extended_function_set(false); - cmd(0x00000010); -} - -/* This fills the entire text buffer with spaces */ -void ST7920_Lite_Status_Screen::clear_ddram() { - set_ddram_address(DDRAM_LINE_1); - begin_data(); - for (uint8_t i = 64; i--;) write_byte(' '); -} - -/* This fills the entire graphics buffer with zeros */ -void ST7920_Lite_Status_Screen::clear_gdram() { - for (uint8_t y = 0; y < BUFFER_HEIGHT; y++) { - set_gdram_address(0, y); - begin_data(); - for (uint8_t i = (BUFFER_WIDTH) / 16; i--;) write_word(0); - } -} - -void ST7920_Lite_Status_Screen::load_cgram_icon(const uint16_t addr, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - set_cgram_address(addr); - begin_data(); - for (uint8_t i = 16; i--;) - write_word(pgm_read_word_near(p_word++)); -} - -/** - * Draw an icon in GDRAM. Position specified in DDRAM - * coordinates. i.e., X from 1 to 8, Y from 1 to 4. - */ -void ST7920_Lite_Status_Screen::draw_gdram_icon(uint8_t x, uint8_t y, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - if (y > 2) { // Handle display folding - y -= 2; - x += 8; - } - --x; - --y; - for (int i = 0; i < 16; i++) { - set_gdram_address(x, i + y * 16); - begin_data(); - write_word(pgm_read_word_near(p_word++)); - } -} - -/************************** ICON DEFINITIONS *************************************/ - -#define CGRAM_ICON_1_ADDR 0x00 -#define CGRAM_ICON_2_ADDR 0x10 -#define CGRAM_ICON_3_ADDR 0x20 -#define CGRAM_ICON_4_ADDR 0x30 - -#define CGRAM_ICON_1_WORD 0x00 -#define CGRAM_ICON_2_WORD 0x02 -#define CGRAM_ICON_3_WORD 0x04 -#define CGRAM_ICON_4_WORD 0x06 - -const uint8_t degree_symbol_y_top = 1; -PROGMEM const uint8_t degree_symbol[] = { - 0b00110000, - 0b01001000, - 0b01001000, - 0b00110000, -}; - -const uint16_t nozzle_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000111111110000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000011111100000, - 0b0000001111000000, - 0b0000000110000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t bed_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0111111111111110, - 0b0111111111111110, - 0b0110000000000110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110001111000110, - 0b0100001111000010, - 0b0100000110000010, - 0b0101100000011010, - 0b0101110110111010, - 0b0101100000011010, - 0b0100000110000010, - 0b0100001111000010, - 0b0110001111000110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110010000100110, - 0b0100111001110010, - 0b0101111001111010, - 0b0100110000110010, - 0b0100000110000010, - 0b0100110000110010, - 0b0101111001111010, - 0b0100111001110010, - 0b0110010000100110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t feedrate_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0111111011111000, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011111000, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000000000000, - 0b0000000000000000 -}; - -/************************** MAIN SCREEN *************************************/ - -// The ST7920 does not have a degree character, but we -// can fake it by writing it to GDRAM. -// This function takes as an argument character positions -// i.e x is [1-16], while the y position is [1-4] -void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, bool draw) { - const uint8_t *p_bytes = degree_symbol; - if (y > 2) { - // Handle display folding - y -= 2; - x += 16; - } - x -= 1; - y -= 1; - const bool oddChar = x & 1; - const uint8_t x_word = x >> 1; - const uint8_t y_top = degree_symbol_y_top; - const uint8_t y_bot = y_top + sizeof(degree_symbol)/sizeof(degree_symbol[0]); - for (uint8_t i = y_top; i < y_bot; i++) { - uint8_t byte = pgm_read_byte_near(p_bytes++); - set_gdram_address(x_word,i+y*16); - begin_data(); - if (draw) { - write_byte(oddChar ? 0x00 : byte); - write_byte(oddChar ? byte : 0x00); - } - else - write_word(0x0000); - } -} - -void ST7920_Lite_Status_Screen::draw_static_elements() { - scroll_or_addr_select(0); - - // Load the animated bed and fan icons - load_cgram_icon(CGRAM_ICON_1_ADDR, heat1_icon); - load_cgram_icon(CGRAM_ICON_2_ADDR, heat2_icon); - load_cgram_icon(CGRAM_ICON_3_ADDR, fan1_icon); - load_cgram_icon(CGRAM_ICON_4_ADDR, fan2_icon); - - // Draw the static icons in GDRAM - draw_gdram_icon(1, 1, nozzle_icon); - #if EXTRUDERS == 2 - draw_gdram_icon(1,2,nozzle_icon); - draw_gdram_icon(1,3,bed_icon); - #else - draw_gdram_icon(1,2,bed_icon); - #endif - draw_gdram_icon(6,2,feedrate_icon); - - // Draw the initial fan icon - draw_fan_icon(false); -} - -/** - * Although this is undocumented, the ST7920 allows the character - * data buffer (DDRAM) to be used in conjunction with the graphics - * bitmap buffer (CGRAM). The contents of the graphics buffer is - * XORed with the data from the character generator. This allows - * us to make the progess bar out of graphical data (the bar) and - * text data (the percentage). - */ -void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) { - #if EXTRUDERS == 1 - // If we have only one extruder, draw a long progress bar on the third line - const uint8_t top = 1, // Top in pixels - bottom = 13, // Bottom in pixels - left = 12, // Left edge, in 16-bit words - width = 4; // Width of progress bar, in 16-bit words - #else - const uint8_t top = 16 + 1, - bottom = 16 + 13, - left = 5, - width = 3; - #endif - const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent? - - // Draw the progress bar as a bitmap in CGRAM - for (uint8_t y = top; y <= bottom; y++) { - set_gdram_address(left, y); - begin_data(); - for (uint8_t x = 0; x < width; x++) { - uint16_t gfx_word = 0x0000; - if ((x + 1) * char_pcnt <= value) - gfx_word = 0xFFFF; // Draw completely filled bytes - else if ((x * char_pcnt) < value) - gfx_word = int(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes - - // Draw the frame around the progress bar - if (y == top || y == bottom) - gfx_word = 0xFFFF; // Draw top/bottom border - else if (x == width - 1) - gfx_word |= 0x0001; // Draw right border - else if (x == 0) - gfx_word |= 0x8000; // Draw left border - write_word(gfx_word); - } - } - - // Draw the percentage as text in DDRAM - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_3 + 4); - begin_data(); - write_byte(' '); - #else - set_ddram_address(DDRAM_LINE_2 + left); - begin_data(); - #endif - - // Draw centered - if (value > 9) { - write_number(value, 4); - write_str(F("% ")); - } - else { - write_number(value, 3); - write_str(F("% ")); - } -} - -void ST7920_Lite_Status_Screen::draw_fan_icon(const bool whichIcon) { - set_ddram_address(DDRAM_LINE_1 + 5); - begin_data(); - write_word(whichIcon ? CGRAM_ICON_3_WORD : CGRAM_ICON_4_WORD); -} - -void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool heating) { - set_ddram_address( - #if EXTRUDERS == 1 - DDRAM_LINE_2 - #else - DDRAM_LINE_3 - #endif - ); - begin_data(); - if (heating) - write_word(whichIcon ? CGRAM_ICON_1_WORD : CGRAM_ICON_2_WORD); - else { - write_byte(' '); - write_byte(' '); - } -} - -#define FAR(a,b) (((a > b) ? (a-b) : (b-a)) > 2) - -static struct { - bool E1_show_target : 1; - bool E2_show_target : 1; - #if HAS_HEATED_BED - bool bed_show_target : 1; - #endif -} display_state = { - true, true - #if HAS_HEATED_BED - , true - #endif -}; - -void ST7920_Lite_Status_Screen::draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange) { - switch (line) { - case 1: set_ddram_address(DDRAM_LINE_1 + 1); break; - case 2: set_ddram_address(DDRAM_LINE_2 + 1); break; - case 3: set_ddram_address(DDRAM_LINE_3 + 1); break; - case 4: set_ddram_address(DDRAM_LINE_3 + 1); break; - } - begin_data(); - write_number(temp); - - if (showTarget) { - write_str(F("\x1A")); - write_number(target); - }; - - if (targetStateChange) { - if (!showTarget) write_str(F(" ")); - draw_degree_symbol(6, line, !showTarget); - draw_degree_symbol(10, line, showTarget); - } -} - -void ST7920_Lite_Status_Screen::draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(1, temp, target, show_target, display_state.E1_show_target != show_target || forceUpdate); - display_state.E1_show_target = show_target; -} - -void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(2, temp, target, show_target, display_state.E2_show_target != show_target || forceUpdate); - display_state.E2_show_target = show_target; -} - -#if HAS_HEATED_BED - void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(2 - #if EXTRUDERS > 1 - + 1 - #endif - , temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate - ); - display_state.bed_show_target = show_target; - } -#endif - -void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) { - set_ddram_address(DDRAM_LINE_1 + 6); - begin_data(); - write_number(value, 3); - write_byte('%'); -} - -void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) { - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_3); - #else - set_ddram_address(DDRAM_LINE_3 + 5); - #endif - char str[7]; - str[elapsed.toDigital(str)] = ' '; - begin_data(); - write_str(str, 6); -} - -void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint8_t percentage) { - // We only have enough room for the feedrate when - // we have one extruder - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_2 + 6); - begin_data(); - write_number(percentage, 3); - write_byte('%'); - #endif -} - -void ST7920_Lite_Status_Screen::draw_status_message(const char *str) { - set_ddram_address(DDRAM_LINE_4); - begin_data(); - const uint8_t lcd_len = 16; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - - uint8_t slen = utf8_strlen(str); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= lcd_len) { - - // The string isn't scrolling and may not fill the screen - write_str(str); - - // Fill the rest with spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = str + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= lcd_len) { - // The remaining string fills the screen - Print it - write_str(stat, lcd_len); - } - else { - // The remaining string does not completely fill the screen - write_str(stat); // The string leaves space - uint8_t chars = lcd_len - rlen; // Amount of space left in characters - - write_byte('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - write_byte('.'); - if (--chars) - write_str(str, chars); // Print a second copy of the message - } - } - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(str[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - #else - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(str); - - // Just print the string to the LCD - write_str(str, lcd_len); - - // Fill the rest with spaces if there are missing spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } - #endif -} - -void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, const float z, bool position_known) { - char str[7]; - set_ddram_address(DDRAM_LINE_4); - begin_data(); - - // If position is unknown, flash the labels. - const unsigned char alt_label = position_known ? 0 : (lcd_blink() ? ' ' : 0); - - dtostrf(x, -4, 0, str); - write_byte(alt_label ? alt_label : 'X'); - write_str(str, 4); - - dtostrf(y, -4, 0, str); - write_byte(alt_label ? alt_label : 'Y'); - write_str(str, 4); - - dtostrf(z, -5, 1, str); - write_byte(alt_label ? alt_label : 'Z'); - write_str(str, 5); -} - -bool ST7920_Lite_Status_Screen::indicators_changed() { - // We only add the target temperatures to the checksum - // because the actual temps fluctuate so by updating - // them only during blinks we gain a bit of stability. - const bool blink = lcd_blink(); - const uint8_t feedrate_perc = feedrate_percentage; - const uint8_t fan_speed = ((fanSpeeds[0] + 1) * 100) / 256; - const int16_t extruder_1_target = thermalManager.degTargetHotend(0); - #if EXTRUDERS == 2 - const int16_t extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_target = thermalManager.degTargetBed(); - #endif - static uint16_t last_checksum = 0; - const uint16_t checksum = blink ^ feedrate_perc ^ fan_speed ^ extruder_1_target - #if EXTRUDERS == 2 - ^ extruder_2_target - #endif - #if HAS_HEATED_BED - ^ bed_target - #endif - ; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { - if (forceUpdate || indicators_changed()) { - const bool blink = lcd_blink(); - const duration_t elapsed = print_job_timer.duration(); - const uint8_t feedrate_perc = feedrate_percentage; - const uint8_t fan_speed = ((fanSpeeds[0] + 1) * 100) / 256; - const int16_t extruder_1_temp = thermalManager.degHotend(0), - extruder_1_target = thermalManager.degTargetHotend(0); - #if EXTRUDERS == 2 - const int16_t extruder_2_temp = thermalManager.degHotend(1), - extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_temp = thermalManager.degBed(), - bed_target = thermalManager.degTargetBed(); - #endif - - draw_extruder_1_temp(extruder_1_temp, extruder_1_target, forceUpdate); - #if EXTRUDERS == 2 - draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate); - #endif - #if HAS_HEATED_BED - draw_bed_temp(bed_temp, bed_target, forceUpdate); - #endif - draw_fan_speed(fan_speed); - draw_print_time(elapsed); - draw_feedrate_percentage(feedrate_perc); - - // Update the fan and bed animations - if (fan_speed > 0) draw_fan_icon(blink); - #if HAS_HEATED_BED - if (bed_target > 0) - draw_heat_icon(blink, true); - else - draw_heat_icon(false, false); - #endif - } -} - -bool ST7920_Lite_Status_Screen::position_changed() { - const float x_pos = current_position[X_AXIS], - y_pos = current_position[Y_AXIS], - z_pos = current_position[Z_AXIS]; - const uint8_t checksum = uint8_t(x_pos) ^ uint8_t(y_pos) ^ uint8_t(z_pos); - - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -bool ST7920_Lite_Status_Screen::status_changed() { - uint8_t checksum = 0; - for (const char *p = lcd_status_message; *p; p++) checksum ^= *p; - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -bool ST7920_Lite_Status_Screen::blink_changed() { - static uint8_t last_blink = 0; - const bool blink = lcd_blink(); - if (last_blink == blink) return false; - last_blink = blink; - return true; -} - -#ifndef STATUS_EXPIRE_SECONDS - #define STATUS_EXPIRE_SECONDS 20 -#endif - -void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { - - #if STATUS_EXPIRE_SECONDS - static uint8_t countdown = 0; - #endif - - /** - * There is only enough room in the display for either the - * status message or the position, not both, so we choose - * one or another. Whenever the status message changes, - * we show it for a number of consecutive seconds, but - * then go back to showing the position as soon as the - * head moves, i.e: - * - * countdown > 1 -- Show status - * countdown = 1 -- Show status, until movement - * countdown = 0 -- Show position - * - * If STATUS_EXPIRE_SECONDS is zero, the position display - * will be disabled and only the status will be shown. - */ - if (forceUpdate || status_changed()) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif - #if STATUS_EXPIRE_SECONDS - countdown = lcd_status_message[0] ? STATUS_EXPIRE_SECONDS : 0; - #endif - draw_status_message(lcd_status_message); - blink_changed(); // Clear changed flag - } - #if !STATUS_EXPIRE_SECONDS - #if ENABLED(STATUS_MESSAGE_SCROLLING) - else - draw_status_message(lcd_status_message); - #endif - #else - else if (countdown > 1 && blink_changed()) { - countdown--; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif - } - else if (countdown > 0 && blink_changed()) { - if (position_changed()) { - countdown--; - forceUpdate = true; - } - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif - } - if (countdown == 0 && (forceUpdate || position_changed() || - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - 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() - #endif - ); - } - #endif -} - -void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) || ENABLED(SDSUPPORT) - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; //=0 - #endif - - #if ENABLED(SDSUPPORT) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING) progress_bar_percent = card.percentDone(); - #endif - - // Since the progress bar involves writing - // quite a few bytes to GDRAM, only do this - // when an update is actually necessary. - - static uint8_t last_progress = 0; - if (!forceUpdate && last_progress == progress_bar_percent) return; - last_progress = progress_bar_percent; - - draw_progress_bar(progress_bar_percent); - - #else - - UNUSED(forceUpdate); - - #endif // LCD_SET_PROGRESS_MANUALLY || SDSUPPORT -} - -void ST7920_Lite_Status_Screen::update(const bool forceUpdate) { - cs(); - update_indicators(forceUpdate); - update_status_or_position(forceUpdate); - update_progress(forceUpdate); - ncs(); -} - -void ST7920_Lite_Status_Screen::reset_state_from_unknown() { - _extended_function_set(true, true); // Do it twice as only one bit - _extended_function_set(true, true); // get set at a time. - _scroll_or_addr_select(false); -} - -void ST7920_Lite_Status_Screen::on_entry() { - cs(); - reset_state_from_unknown(); - clear(); - clear_gdram(); - draw_static_elements(); - update(true); - ncs(); -} - -void ST7920_Lite_Status_Screen::on_exit() { - cs(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -// This is called prior to the KILL screen to -// clear the screen so we don't end up with a -// garbled display. -void ST7920_Lite_Status_Screen::clear_text_buffer() { - cs(); - reset_state_from_unknown(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -static void lcd_implementation_status_screen() { - ST7920_Lite_Status_Screen::update(false); -} - -/** - * In order to properly update the lite Status Screen, - * we must know when we have entered and left the - * Status Screen. Since the ultralcd code is not - * set up for doing this, we call this function before - * each update indicating whether the current screen - * is the Status Screen. - * - * This function keeps track of whether we have left or - * entered the Status Screen and calls the on_entry() - * and on_exit() methods for cleanup. - */ -static void lcd_in_status(const bool inStatus) { - static bool lastInStatus = false; - if (lastInStatus == inStatus) return; - if ((lastInStatus = inStatus)) - ST7920_Lite_Status_Screen::on_entry(); - else - ST7920_Lite_Status_Screen::on_exit(); -} diff --git a/Marlin/status_screen_lite_ST7920_class.h b/Marlin/status_screen_lite_ST7920_class.h deleted file mode 100644 index 289723479a..0000000000 --- a/Marlin/status_screen_lite_ST7920_class.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -#ifndef STATUS_SCREEN_LITE_ST7920_CLASS_H -#define STATUS_SCREEN_LITE_ST7920_CLASS_H - -#include "macros.h" -#include "duration_t.h" - -typedef const __FlashStringHelper *progmem_str; - -class ST7920_Lite_Status_Screen { - private: - static struct st7920_state_t { - uint8_t synced : 1; // Whether a sync has been sent - uint8_t cmd : 1; // Whether the sync was cmd or data - uint8_t extended : 1; - uint8_t graphics : 1; - uint8_t sa : 1; - } current_bits; - - static void cs(); - static void ncs(); - static void sync_cmd(); - static void sync_dat(); - static void write_byte(const uint8_t w); - - FORCE_INLINE static void write_word(const uint16_t w) { - write_byte((w >> 8) & 0xFF); - write_byte((w >> 0) & 0xFF); - } - - static void cmd(const uint8_t cmd); - static void begin_data(); - - static void write_str(const char *str); - static void write_str(const char *str, const uint8_t len); - static void write_str_P(const char * const str); - static void write_str(progmem_str str); - static void write_number(const int16_t value, const uint8_t digits=3); - - static void _extended_function_set(const bool extended, const bool graphics); - static void _scroll_or_addr_select(const bool sa); - static void reset_state_from_unknown(); - - static void home(); - static void display_status(const bool display_on, const bool cursor_on, const bool blink_on); - static void extended_function_set(const bool extended); - static void graphics(const bool graphics); - static void entry_mode_select(const bool ac_increase, const bool shift); - static void scroll_or_addr_select(const bool sa); - static void set_ddram_address(const uint8_t addr); - static void set_cgram_address(const uint8_t addr); - static void set_gdram_address(const uint8_t x, const uint8_t y); - - static void clear(); - static void clear_ddram(); - static void clear_gdram(); - - static void load_cgram_icon(const uint16_t addr, const void *data); - static void draw_gdram_icon(uint8_t x, uint8_t y, const void *data); - - static uint8_t string_checksum(const char *str); - - protected: - static void draw_degree_symbol(uint8_t x, uint8_t y, bool draw); - static void draw_static_elements(); - static void draw_progress_bar(const uint8_t value); - static void draw_fan_icon(const bool whichIcon); - static void draw_heat_icon(const bool whichIcon, const bool heating); - static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange); - static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_fan_speed(const uint8_t value); - static void draw_print_time(const duration_t &elapsed); - static void draw_feedrate_percentage(const uint8_t percentage); - static void draw_status_message(const char *str); - static void draw_position(const float x, const float y, const float z, bool position_known = true); - - static bool indicators_changed(); - static bool position_changed(); - static bool blink_changed(); - static bool status_changed(); - - static void update_indicators(const bool forceUpdate); - static void update_position(const bool forceUpdate, bool resetChecksum); - static void update_status_or_position(bool forceUpdate); - static void update_progress(const bool forceUpdate); - - public: - static void update(const bool forceUpdate); - static void on_entry(); - static void on_exit(); - static void clear_text_buffer(); -}; - -#endif // STATUS_SCREEN_LITE_ST7920_CLASS_H diff --git a/Marlin/status_screen_lite_ST7920_spi.h b/Marlin/status_screen_lite_ST7920_spi.h deleted file mode 100644 index 9c59068f46..0000000000 --- a/Marlin/status_screen_lite_ST7920_spi.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -#include "status_screen_lite_ST7920_class.h" - -void ST7920_Lite_Status_Screen::cs() { - ST7920_CS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::ncs() { - ST7920_NCS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::sync_cmd() { - ST7920_SET_CMD(); -} - -void ST7920_Lite_Status_Screen::sync_dat() { - ST7920_SET_DAT(); -} - -void ST7920_Lite_Status_Screen::write_byte(const uint8_t data) { - ST7920_WRITE_BYTE(data); -} diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp deleted file mode 100644 index 2df0199e36..0000000000 --- a/Marlin/stepper.cpp +++ /dev/null @@ -1,2533 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper.cpp - A singleton object to execute motion plans using stepper motors - * Marlin Firmware - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -/** - * Timer calculations informed by the 'RepRap cartesian firmware' by Zack Smith - * and Philipp Tiefenbacher. - */ - -/** - * __________________________ - * /| |\ _________________ ^ - * / | | \ /| |\ | - * / | | \ / | | \ s - * / | | | | | \ p - * / | | | | | \ e - * +-----+------------------------+---+--+---------------+----+ e - * | BLOCK 1 | BLOCK 2 | d - * - * time -----> - * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. - */ - -/** - * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and - * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html - */ - -/** - * Jerk controlled movements planner added Apr 2018 by Eduardo José Tagle. - * Equations based on Synthethos TinyG2 sources, but the fixed-point - * implementation is new, as we are running the ISR with a variable period. - * Also implemented the Bézier velocity curve evaluation in ARM assembler, - * to avoid impacting ISR speed. - */ - -#include "Marlin.h" -#include "stepper.h" -#include "endstops.h" -#include "planner.h" -#include "temperature.h" -#include "ultralcd.h" -#include "language.h" -#include "cardreader.h" -#include "speed_lookuptable.h" -#include "delay.h" - -#if HAS_DIGIPOTSS - #include -#endif - -Stepper stepper; // Singleton - -// public: - -#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::homing_dual_axis = false; -#endif - -#if HAS_MOTOR_CURRENT_PWM - uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load() -#endif - -// private: - -block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced - -uint8_t Stepper::last_direction_bits = 0, - Stepper::axis_did_move; - -bool Stepper::abort_current_block; - -#if DISABLED(MIXING_EXTRUDER) - uint8_t Stepper::last_moved_extruder = 0xFF; -#endif - -#if ENABLED(X_DUAL_ENDSTOPS) - bool Stepper::locked_X_motor = false, Stepper::locked_X2_motor = false; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - bool Stepper::locked_Y_motor = false, Stepper::locked_Y2_motor = false; -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false; -#endif - -uint32_t Stepper::acceleration_time, Stepper::deceleration_time; -uint8_t Stepper::steps_per_isr; - -#if DISABLED(ADAPTIVE_STEP_SMOOTHING) - constexpr -#endif - uint8_t Stepper::oversampling_factor; - -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::step_event_count; // The total event count for the current block - -#if ENABLED(MIXING_EXTRUDER) - int32_t Stepper::delta_error_m[MIXING_STEPPERS]; - uint32_t Stepper::advance_dividend_m[MIXING_STEPPERS], - Stepper::advance_divisor_m; -#else - int8_t Stepper::active_extruder; // Active extruder -#endif - -#if ENABLED(S_CURVE_ACCELERATION) - int32_t __attribute__((used)) Stepper::bezier_A __asm__("bezier_A"); // A coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_B __asm__("bezier_B"); // B coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_C __asm__("bezier_C"); // C coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_F __asm__("bezier_F"); // F coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_AV __asm__("bezier_AV"); // AV coefficient in Bézier speed curve with alias for assembler - bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative - bool Stepper::bezier_2nd_half; // =false If Bézier curve has been initialized or not -#endif - -uint32_t Stepper::nextMainISR = 0; - -#if ENABLED(LIN_ADVANCE) - - constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF; - uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER, - Stepper::LA_isr_rate = LA_ADV_NEVER; - uint16_t Stepper::LA_current_adv_steps = 0, - Stepper::LA_final_adv_steps, - Stepper::LA_max_adv_steps; - - int8_t Stepper::LA_steps = 0; - - bool Stepper::LA_use_advance_lead; - -#endif // LIN_ADVANCE - -int32_t Stepper::ticks_nominal = -1; -#if DISABLED(S_CURVE_ACCELERATION) - uint32_t Stepper::acc_step_rate; // needed for deceleration start point -#endif - -volatile int32_t Stepper::endstops_trigsteps[XYZ]; - -volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 }; -int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 }; - -#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ - if (homing_dual_axis) { \ - if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - else { \ - if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - } -#endif - -#if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0) - #if ENABLED(X_DUAL_ENDSTOPS) - #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) - #else - #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0) - #endif -#elif ENABLED(DUAL_X_CARRIAGE) - #define X_APPLY_DIR(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_DIR_WRITE(v); \ - X2_DIR_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ - } - #define X_APPLY_STEP(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_STEP_WRITE(v); \ - X2_STEP_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ - } -#else - #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) - #define X_APPLY_STEP(v,Q) X_STEP_WRITE(v) -#endif - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0) - #if ENABLED(Y_DUAL_ENDSTOPS) - #define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v) - #else - #define Y_APPLY_STEP(v,Q) do{ Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }while(0) - #endif -#else - #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v) - #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) -#endif - -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0) - #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v) - #else - #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }while(0) - #endif -#else - #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) - #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) -#endif - -#if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(active_extruder, v) -#endif - -// intRes = longIn1 * longIn2 >> 24 -// uses: -// A[tmp] to store 0 -// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result. -// note that the lower two bytes and the upper byte of the 48bit result are not calculated. -// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones. -// B A are bits 24-39 and are the returned value -// C B A is longIn1 -// D C B A is longIn2 -// -static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { - register uint8_t tmp1; - register uint8_t tmp2; - register uint16_t intRes; - __asm__ __volatile__( - A("clr %[tmp1]") - A("mul %A[longIn1], %B[longIn2]") - A("mov %[tmp2], r1") - A("mul %B[longIn1], %C[longIn2]") - A("movw %A[intRes], r0") - A("mul %C[longIn1], %C[longIn2]") - A("add %B[intRes], r0") - A("mul %C[longIn1], %B[longIn2]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %A[longIn1], %C[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %B[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %C[longIn1], %A[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %A[longIn2]") - A("add %[tmp2], r1") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("lsr %[tmp2]") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("mul %D[longIn2], %A[longIn1]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %D[longIn2], %B[longIn1]") - A("add %B[intRes], r0") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp1] "=&r" (tmp1), - [tmp2] "=&r" (tmp2) - : [longIn1] "d" (longIn1), - [longIn2] "d" (longIn2) - : "cc" - ); - return intRes; -} - -void Stepper::wake_up() { - // TCNT1 = 0; - ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -/** - * Set the stepper direction of each axis - * - * COREXY: X_AXIS=A_AXIS and Y_AXIS=B_AXIS - * COREXZ: X_AXIS=A_AXIS and Z_AXIS=C_AXIS - * COREYZ: Y_AXIS=B_AXIS and Z_AXIS=C_AXIS - */ -void Stepper::set_directions() { - - #define SET_STEP_DIR(A) \ - if (motor_direction(_AXIS(A))) { \ - A##_APPLY_DIR(INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = -1; \ - } \ - else { \ - A##_APPLY_DIR(!INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = 1; \ - } - - #if HAS_X_DIR - SET_STEP_DIR(X); // A - #endif - #if HAS_Y_DIR - SET_STEP_DIR(Y); // B - #endif - #if HAS_Z_DIR - SET_STEP_DIR(Z); // C - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - if (motor_direction(E_AXIS)) { - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - count_direction[E_AXIS] = -1; - } - else { - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - count_direction[E_AXIS] = 1; - } - #else - if (motor_direction(E_AXIS)) { - REV_E_DIR(active_extruder); - count_direction[E_AXIS] = -1; - } - else { - NORM_E_DIR(active_extruder); - count_direction[E_AXIS] = 1; - } - #endif - #endif // !LIN_ADVANCE - - // A small delay may be needed after changing direction - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); - #endif -} - - - -#if ENABLED(S_CURVE_ACCELERATION) - /** - * This uses a quintic (fifth-degree) Bézier polynomial for the velocity curve, giving - * a "linear pop" velocity curve; with pop being the sixth derivative of position: - * velocity - 1st, acceleration - 2nd, jerk - 3rd, snap - 4th, crackle - 5th, pop - 6th - * - * The Bézier curve takes the form: - * - * V(t) = P_0 * B_0(t) + P_1 * B_1(t) + P_2 * B_2(t) + P_3 * B_3(t) + P_4 * B_4(t) + P_5 * B_5(t) - * - * Where 0 <= t <= 1, and V(t) is the velocity. P_0 through P_5 are the control points, and B_0(t) - * through B_5(t) are the Bernstein basis as follows: - * - * B_0(t) = (1-t)^5 = -t^5 + 5t^4 - 10t^3 + 10t^2 - 5t + 1 - * B_1(t) = 5(1-t)^4 * t = 5t^5 - 20t^4 + 30t^3 - 20t^2 + 5t - * B_2(t) = 10(1-t)^3 * t^2 = -10t^5 + 30t^4 - 30t^3 + 10t^2 - * B_3(t) = 10(1-t)^2 * t^3 = 10t^5 - 20t^4 + 10t^3 - * B_4(t) = 5(1-t) * t^4 = -5t^5 + 5t^4 - * B_5(t) = t^5 = t^5 - * ^ ^ ^ ^ ^ ^ - * | | | | | | - * A B C D E F - * - * Unfortunately, we cannot use forward-differencing to calculate each position through - * the curve, as Marlin uses variable timer periods. So, we require a formula of the form: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + D*t^2 + E*t + F - * - * Looking at the above B_0(t) through B_5(t) expanded forms, if we take the coefficients of t^5 - * through t of the Bézier form of V(t), we can determine that: - * - * A = -P_0 + 5*P_1 - 10*P_2 + 10*P_3 - 5*P_4 + P_5 - * B = 5*P_0 - 20*P_1 + 30*P_2 - 20*P_3 + 5*P_4 - * C = -10*P_0 + 30*P_1 - 30*P_2 + 10*P_3 - * D = 10*P_0 - 20*P_1 + 10*P_2 - * E = - 5*P_0 + 5*P_1 - * F = P_0 - * - * Now, since we will (currently) *always* want the initial acceleration and jerk values to be 0, - * We set P_i = P_0 = P_1 = P_2 (initial velocity), and P_t = P_3 = P_4 = P_5 (target velocity), - * which, after simplification, resolves to: - * - * A = - 6*P_i + 6*P_t = 6*(P_t - P_i) - * B = 15*P_i - 15*P_t = 15*(P_i - P_t) - * C = -10*P_i + 10*P_t = 10*(P_t - P_i) - * D = 0 - * E = 0 - * F = P_i - * - * As the t is evaluated in non uniform steps here, there is no other way rather than evaluating - * the Bézier curve at each point: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + F [0 <= t <= 1] - * - * Floating point arithmetic execution time cost is prohibitive, so we will transform the math to - * use fixed point values to be able to evaluate it in realtime. Assuming a maximum of 250000 steps - * per second (driver pulses should at least be 2µS hi/2µS lo), and allocating 2 bits to avoid - * overflows on the evaluation of the Bézier curve, means we can use - * - * t: unsigned Q0.32 (0 <= t < 1) |range 0 to 0xFFFFFFFF unsigned - * A: signed Q24.7 , |range = +/- 250000 * 6 * 128 = +/- 192000000 = 0x0B71B000 | 28 bits + sign - * B: signed Q24.7 , |range = +/- 250000 *15 * 128 = +/- 480000000 = 0x1C9C3800 | 29 bits + sign - * C: signed Q24.7 , |range = +/- 250000 *10 * 128 = +/- 320000000 = 0x1312D000 | 29 bits + sign - * F: signed Q24.7 , |range = +/- 250000 * 128 = 32000000 = 0x01E84800 | 25 bits + sign - * - * The trapezoid generator state contains the following information, that we will use to create and evaluate - * the Bézier curve: - * - * blk->step_event_count [TS] = The total count of steps for this movement. (=distance) - * blk->initial_rate [VI] = The initial steps per second (=velocity) - * blk->final_rate [VF] = The ending steps per second (=velocity) - * and the count of events completed (step_events_completed) [CS] (=distance until now) - * - * Note the abbreviations we use in the following formulae are between []s - * - * For Any 32bit CPU: - * - * At the start of each trapezoid, calculate the coefficients A,B,C,F and Advance [AV], as follows: - * - * A = 6*128*(VF - VI) = 768*(VF - VI) - * B = 15*128*(VI - VF) = 1920*(VI - VF) - * C = 10*128*(VF - VI) = 1280*(VF - VI) - * F = 128*VI = 128*VI - * AV = (1<<32)/TS ~= 0xFFFFFFFF / TS (To use ARM UDIV, that is 32 bits) (this is computed at the planner, to offload expensive calculations from the ISR) - * - * And for each point, evaluate the curve with the following sequence: - * - * void lsrs(uint32_t& d, uint32_t s, int cnt) { - * d = s >> cnt; - * } - * void lsls(uint32_t& d, uint32_t s, int cnt) { - * d = s << cnt; - * } - * void lsrs(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) >> cnt; - * } - * void lsls(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) << cnt; - * } - * void umull(uint32_t& rlo, uint32_t& rhi, uint32_t op1, uint32_t op2) { - * uint64_t res = uint64_t(op1) * op2; - * rlo = uint32_t(res & 0xFFFFFFFF); - * rhi = uint32_t((res >> 32) & 0xFFFFFFFF); - * } - * void smlal(int32_t& rlo, int32_t& rhi, int32_t op1, int32_t op2) { - * int64_t mul = int64_t(op1) * op2; - * int64_t s = int64_t(uint32_t(rlo) | ((uint64_t(uint32_t(rhi)) << 32U))); - * mul += s; - * rlo = int32_t(mul & 0xFFFFFFFF); - * rhi = int32_t((mul >> 32) & 0xFFFFFFFF); - * } - * int32_t _eval_bezier_curve_arm(uint32_t curr_step) { - * register uint32_t flo = 0; - * register uint32_t fhi = bezier_AV * curr_step; - * register uint32_t t = fhi; - * register int32_t alo = bezier_F; - * register int32_t ahi = 0; - * register int32_t A = bezier_A; - * register int32_t B = bezier_B; - * register int32_t C = bezier_C; - * - * lsrs(ahi, alo, 1); // a = F << 31 - * lsls(alo, alo, 31); // - * umull(flo, fhi, fhi, t); // f *= t - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, C); // a+=(f>>33)*C - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, B); // a+=(f>>33)*B - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // f>>=33; - * smlal(alo, ahi, flo, A); // a+=(f>>33)*A; - * lsrs(alo, ahi, 6); // a>>=38 - * - * return alo; - * } - * - * This is rewritten in ARM assembly for optimal performance (43 cycles to execute). - * - * For AVR, the precision of coefficients is scaled so the Bézier curve can be evaluated in real-time: - * Let's reduce precision as much as possible. After some experimentation we found that: - * - * Assume t and AV with 24 bits is enough - * A = 6*(VF - VI) - * B = 15*(VI - VF) - * C = 10*(VF - VI) - * F = VI - * AV = (1<<24)/TS (this is computed at the planner, to offload expensive calculations from the ISR) - * - * Instead of storing sign for each coefficient, we will store its absolute value, - * and flag the sign of the A coefficient, so we can save to store the sign bit. - * It always holds that sign(A) = - sign(B) = sign(C) - * - * So, the resulting range of the coefficients are: - * - * t: unsigned (0 <= t < 1) |range 0 to 0xFFFFFF unsigned - * A: signed Q24 , range = 250000 * 6 = 1500000 = 0x16E360 | 21 bits - * B: signed Q24 , range = 250000 *15 = 3750000 = 0x393870 | 22 bits - * C: signed Q24 , range = 250000 *10 = 2500000 = 0x1312D0 | 21 bits - * F: signed Q24 , range = 250000 = 250000 = 0x0ED090 | 20 bits - * - * And for each curve, estimate its coefficients with: - * - * void _calc_bezier_curve_coeffs(int32_t v0, int32_t v1, uint32_t av) { - * // Calculate the Bézier coefficients - * if (v1 < v0) { - * A_negative = true; - * bezier_A = 6 * (v0 - v1); - * bezier_B = 15 * (v0 - v1); - * bezier_C = 10 * (v0 - v1); - * } - * else { - * A_negative = false; - * bezier_A = 6 * (v1 - v0); - * bezier_B = 15 * (v1 - v0); - * bezier_C = 10 * (v1 - v0); - * } - * bezier_F = v0; - * } - * - * And for each point, evaluate the curve with the following sequence: - * - * // unsigned multiplication of 24 bits x 24bits, return upper 16 bits - * void umul24x24to16hi(uint16_t& r, uint24_t op1, uint24_t op2) { - * r = (uint64_t(op1) * op2) >> 8; - * } - * // unsigned multiplication of 16 bits x 16bits, return upper 16 bits - * void umul16x16to16hi(uint16_t& r, uint16_t op1, uint16_t op2) { - * r = (uint32_t(op1) * op2) >> 16; - * } - * // unsigned multiplication of 16 bits x 24bits, return upper 24 bits - * void umul16x24to24hi(uint24_t& r, uint16_t op1, uint24_t op2) { - * r = uint24_t((uint64_t(op1) * op2) >> 16); - * } - * - * int32_t _eval_bezier_curve(uint32_t curr_step) { - * // To save computing, the first step is always the initial speed - * if (!curr_step) - * return bezier_F; - * - * uint16_t t; - * umul24x24to16hi(t, bezier_AV, curr_step); // t: Range 0 - 1^16 = 16 bits - * uint16_t f = t; - * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) - * uint24_t acc = bezier_F; // Range 20 bits (unsigned) - * if (A_negative) { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc -= v; - * } - * else { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc += v; - * } - * return acc; - * } - * These functions are translated to assembler for optimal performance. - * Coefficient calculation takes 70 cycles. Bezier point evaluation takes 150 cycles. - */ - - // For AVR we use assembly to maximize speed - void Stepper::_calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av) { - - // Store advance - bezier_AV = av; - - // Calculate the rest of the coefficients - register uint8_t r2 = v0 & 0xFF; - register uint8_t r3 = (v0 >> 8) & 0xFF; - register uint8_t r12 = (v0 >> 16) & 0xFF; - register uint8_t r5 = v1 & 0xFF; - register uint8_t r6 = (v1 >> 8) & 0xFF; - register uint8_t r7 = (v1 >> 16) & 0xFF; - register uint8_t r4,r8,r9,r10,r11; - - __asm__ __volatile__( - /* Calculate the Bézier coefficients */ - /* %10:%1:%0 = v0*/ - /* %5:%4:%3 = v1*/ - /* %7:%6:%10 = temporary*/ - /* %9 = val (must be high register!)*/ - /* %10 (must be high register!)*/ - - /* Store initial velocity*/ - A("sts bezier_F, %0") - A("sts bezier_F+1, %1") - A("sts bezier_F+2, %10") /* bezier_F = %10:%1:%0 = v0 */ - - /* Get delta speed */ - A("ldi %2,-1") /* %2 = 0xFF, means A_negative = true */ - A("clr %8") /* %8 = 0 */ - A("sub %0,%3") - A("sbc %1,%4") - A("sbc %10,%5") /* v0 -= v1, C=1 if result is negative */ - A("brcc 1f") /* branch if result is positive (C=0), that means v0 >= v1 */ - - /* Result was negative, get the absolute value*/ - A("com %10") - A("com %1") - A("neg %0") - A("sbc %1,%2") - A("sbc %10,%2") /* %10:%1:%0 +1 -> %10:%1:%0 = -(v0 - v1) = (v1 - v0) */ - A("clr %2") /* %2 = 0, means A_negative = false */ - - /* Store negative flag*/ - L("1") - A("sts A_negative, %2") /* Store negative flag */ - - /* Compute coefficients A,B and C [20 cycles worst case]*/ - A("ldi %9,6") /* %9 = 6 */ - A("mul %0,%9") /* r1:r0 = 6*LO(v0-v1) */ - A("sts bezier_A, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:r0 = 6*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 6*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 6*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 6*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 6*HI(v0-v1) << 16 */ - A("sts bezier_A+1, %6") - A("sts bezier_A+2, %7") /* bezier_A = %7:%6:?? = 6*(v0-v1) [35 cycles worst] */ - - A("ldi %9,15") /* %9 = 15 */ - A("mul %0,%9") /* r1:r0 = 5*LO(v0-v1) */ - A("sts bezier_B, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 5*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 5*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 5*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 5*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 5*HI(v0-v1) << 16 */ - A("sts bezier_B+1, %6") - A("sts bezier_B+2, %7") /* bezier_B = %7:%6:?? = 5*(v0-v1) [50 cycles worst] */ - - A("ldi %9,10") /* %9 = 10 */ - A("mul %0,%9") /* r1:r0 = 10*LO(v0-v1) */ - A("sts bezier_C, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 10*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 10*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 10*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 10*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 10*HI(v0-v1) << 16 */ - A("sts bezier_C+1, %6") - " sts bezier_C+2, %7" /* bezier_C = %7:%6:?? = 10*(v0-v1) [65 cycles worst] */ - : "+r" (r2), - "+d" (r3), - "=r" (r4), - "+r" (r5), - "+r" (r6), - "+r" (r7), - "=r" (r8), - "=r" (r9), - "=r" (r10), - "=d" (r11), - "+r" (r12) - : - : "r0", "r1", "cc", "memory" - ); - } - - FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) { - - // If dealing with the first step, save expensive computing and return the initial speed - if (!curr_step) - return bezier_F; - - register uint8_t r0 = 0; /* Zero register */ - register uint8_t r2 = (curr_step) & 0xFF; - register uint8_t r3 = (curr_step >> 8) & 0xFF; - register uint8_t r4 = (curr_step >> 16) & 0xFF; - register uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */ - - __asm__ __volatile( - /* umul24x24to16hi(t, bezier_AV, curr_step); t: Range 0 - 1^16 = 16 bits*/ - A("lds %9,bezier_AV") /* %9 = LO(AV)*/ - A("mul %9,%2") /* r1:r0 = LO(bezier_AV)*LO(curr_step)*/ - A("mov %7,r1") /* %7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("clr %8") /* %8:%7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("lds %10,bezier_AV+1") /* %10 = MI(AV)*/ - A("mul %10,%2") /* r1:r0 = MI(bezier_AV)*LO(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += MI(bezier_AV)*LO(curr_step)*/ - A("lds r1,bezier_AV+2") /* r11 = HI(AV)*/ - A("mul r1,%2") /* r1:r0 = HI(bezier_AV)*LO(curr_step)*/ - A("add %8,r0") /* %8:%7 += HI(bezier_AV)*LO(curr_step) << 8*/ - A("mul %9,%3") /* r1:r0 = LO(bezier_AV)*MI(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += LO(bezier_AV)*MI(curr_step)*/ - A("mul %10,%3") /* r1:r0 = MI(bezier_AV)*MI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*MI(curr_step) << 8*/ - A("mul %9,%4") /* r1:r0 = LO(bezier_AV)*HI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*HI(curr_step) << 8*/ - /* %8:%7 = t*/ - - /* uint16_t f = t;*/ - A("mov %5,%7") /* %6:%5 = f*/ - A("mov %6,%8") - /* %6:%5 = f*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits (unsigned) [17] */ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %9,r1") /* store MIL(LO(f) * LO(t)) in %9, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %9,r0") /* %9 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %9,r0") /* %9 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t)) */ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 = */ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - /* [15 +17*2] = [49]*/ - - /* %4:%3:%2 will be acc from now on*/ - - /* uint24_t acc = bezier_F; / Range 20 bits (unsigned)*/ - A("clr %9") /* "decimal place we get for free"*/ - A("lds %2,bezier_F") - A("lds %3,bezier_F+1") - A("lds %4,bezier_F+2") /* %4:%3:%2 = acc*/ - - /* if (A_negative) {*/ - A("lds r0,A_negative") - A("or r0,%0") /* Is flag signalling negative? */ - A("brne 3f") /* If yes, Skip next instruction if A was negative*/ - A("rjmp 1f") /* Otherwise, jump */ - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29] */ - /* acc -= v; */ - L("3") - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc -= v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 16*/ - A("jmp 2f") /* Done!*/ - - L("1") - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc -= v;*/ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 16*/ - L("2") - " clr __zero_reg__" /* C runtime expects r1 = __zero_reg__ = 0 */ - : "+r"(r0), - "+r"(r1), - "+r"(r2), - "+r"(r3), - "+r"(r4), - "+r"(r5), - "+r"(r6), - "+r"(r7), - "+r"(r8), - "+r"(r9), - "+r"(r10), - "+r"(r11) - : - :"cc","r0","r1" - ); - return (r2 | (uint16_t(r3) << 8)) | (uint32_t(r4) << 16); - } - -#endif // S_CURVE_ACCELERATION - -/** - * Stepper Driver Interrupt - * - * Directly pulses the stepper motors at high frequency. - */ - -HAL_STEP_TIMER_ISR { - HAL_timer_isr_prologue(STEP_TIMER_NUM); - - Stepper::isr(); - - HAL_timer_isr_epilogue(STEP_TIMER_NUM); -} - -#define STEP_MULTIPLY(A,B) MultiU24X32toH16(A, B) - -void Stepper::isr() { - DISABLE_ISRS(); - // Program timer compare for the maximum period, so it does NOT - // flag an interrupt while this ISR is running - So changes from small - // periods to big periods are respected and the timer does not reset to 0 - HAL_timer_set_compare(STEP_TIMER_NUM, HAL_TIMER_TYPE_MAX); - - // Count of ticks for the next ISR - hal_timer_t next_isr_ticks = 0; - - // Limit the amount of iterations - uint8_t max_loops = 10; - - // We need this variable here to be able to use it in the following loop - hal_timer_t min_ticks; - do { - // Enable ISRs to reduce USART processing latency - ENABLE_ISRS(); - - // Run main stepping pulse phase ISR if we have to - if (!nextMainISR) Stepper::stepper_pulse_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // Run linear advance stepper ISR if we have to - if (!nextAdvanceISR) nextAdvanceISR = Stepper::advance_isr(); - #endif - - // ^== Time critical. NOTHING besides pulse generation should be above here!!! - - // Run main stepping block processing ISR if we have to - if (!nextMainISR) nextMainISR = Stepper::stepper_block_phase_isr(); - - uint32_t interval = - #if ENABLED(LIN_ADVANCE) - MIN(nextAdvanceISR, nextMainISR) // Nearest time interval - #else - nextMainISR // Remaining stepper ISR time - #endif - ; - - // Limit the value to the maximum possible value of the timer - NOMORE(interval, HAL_TIMER_TYPE_MAX); - - // Compute the time remaining for the main isr - nextMainISR -= interval; - - #if ENABLED(LIN_ADVANCE) - // Compute the time remaining for the advance isr - if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval; - #endif - - /** - * This needs to avoid a race-condition caused by interleaving - * of interrupts required by both the LA and Stepper algorithms. - * - * Assume the following tick times for stepper pulses: - * Stepper ISR (S): 1 1000 2000 3000 4000 - * Linear Adv. (E): 10 1010 2010 3010 4010 - * - * The current algorithm tries to interleave them, giving: - * 1:S 10:E 1000:S 1010:E 2000:S 2010:E 3000:S 3010:E 4000:S 4010:E - * - * Ideal timing would yield these delta periods: - * 1:S 9:E 990:S 10:E 990:S 10:E 990:S 10:E 990:S 10:E - * - * But, since each event must fire an ISR with a minimum duration, the - * minimum delta might be 900, so deltas under 900 get rounded up: - * 900:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E - * - * It works, but divides the speed of all motors by half, leading to a sudden - * reduction to 1/2 speed! Such jumps in speed lead to lost steps (not even - * accounting for double/quad stepping, which makes it even worse). - */ - - // Compute the tick count for the next ISR - next_isr_ticks += interval; - - /** - * The following section must be done with global interrupts disabled. - * We want nothing to interrupt it, as that could mess the calculations - * we do for the next value to program in the period register of the - * stepper timer and lead to skipped ISRs (if the value we happen to program - * is less than the current count due to something preempting between the - * read and the write of the new period value). - */ - DISABLE_ISRS(); - - /** - * Get the current tick value + margin - * Assuming at least 6µs between calls to this ISR... - * On AVR the ISR epilogue+prologue is estimated at 100 instructions - Give 8µs as margin - * On ARM the ISR epilogue+prologue is estimated at 20 instructions - Give 1µs as margin - */ - min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t((STEPPER_TIMER_TICKS_PER_US) * 8); - - /** - * NB: If for some reason the stepper monopolizes the MPU, eventually the - * timer will wrap around (and so will 'next_isr_ticks'). So, limit the - * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse - * timing, since the MCU isn't fast enough. - */ - if (!--max_loops) next_isr_ticks = min_ticks; - - // Advance pulses if not enough time to wait for the next ISR - } while (next_isr_ticks < min_ticks); - - // Now 'next_isr_ticks' contains the period to the next Stepper ISR - And we are - // sure that the time has not arrived yet - Warrantied by the scheduler - - // Set the next ISR to fire at the proper time - HAL_timer_set_compare(STEP_TIMER_NUM, hal_timer_t(next_isr_ticks)); - - // Don't forget to finally reenable interrupts - ENABLE_ISRS(); -} - -/** - * This phase of the ISR should ONLY create the pulses for the steppers. - * This prevents jitter caused by the interval between the start of the - * interrupt and the start of the pulses. DON'T add any logic ahead of the - * call to this method that might cause variation in the timing. The aim - * is to keep pulse timing as regular as possible. - */ -void Stepper::stepper_pulse_phase_isr() { - - // If we must abort the current block, do so! - if (abort_current_block) { - abort_current_block = false; - if (current_block) { - axis_did_move = 0; - current_block = NULL; - planner.discard_current_block(); - } - } - - // If there is no current block, do nothing - if (!current_block) return; - - // Count of pending loops and events for this iteration - const uint32_t pending_events = step_event_count - step_events_completed; - uint8_t events_to_do = MIN(pending_events, steps_per_isr); - - // Just update the value we will get at the end of the loop - step_events_completed += events_to_do; - - // 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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Take multiple steps per interrupt (For high speed moves) - do { - - #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP - #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN - - // Start an active pulse, if Bresenham says so, and update position - #define PULSE_START(AXIS) do{ \ - delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); \ - count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ - } \ - }while(0) - - // Stop an active pulse, if any, and adjust error term - #define PULSE_STOP(AXIS) do { \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - delta_error[_AXIS(AXIS)] -= advance_divisor; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0); \ - } \ - }while(0) - - // Pulse start - #if HAS_X_STEP - PULSE_START(X); - #endif - #if HAS_Y_STEP - PULSE_START(Y); - #endif - #if HAS_Z_STEP - PULSE_START(Z); - #endif - - // Pulse E/Mixing extruders - #if ENABLED(LIN_ADVANCE) - // Tick the E axis, correct error term and update position - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - - // Don't step E here - But remember the number of steps to perform - motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; - } - #else // !LIN_ADVANCE - use linear interpolation for E also - #if ENABLED(MIXING_EXTRUDER) - - // Tick the E axis - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - } - - // Tick the counters used for this mix in proper proportion - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - - #else // !MIXING_EXTRUDER - PULSE_START(E); - #endif - #endif // !LIN_ADVANCE - - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - // Pulse stop - #if HAS_X_STEP - PULSE_STOP(X); - #endif - #if HAS_Y_STEP - PULSE_STOP(Y); - #endif - #if HAS_Z_STEP - PULSE_STOP(Z); - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } - #else // !MIXING_EXTRUDER - PULSE_STOP(E); - #endif - #endif // !LIN_ADVANCE - - // Decrement the count of pending pulses to do - --events_to_do; - - // For minimum pulse time wait after stopping pulses also - if (events_to_do) { - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - - } while (events_to_do); -} - -// This is the last half of the stepper interrupt: This one processes and -// properly schedules blocks from the planner. This is executed after creating -// the step pulses, so it is not time critical, as pulses are already done. - -uint32_t Stepper::stepper_block_phase_isr() { - - // If no queued movements, just wait 1ms for the next move - uint32_t interval = (STEPPER_TIMER_RATE / 1000); - - // If there is a current block - if (current_block) { - - // If current block is finished, reset pointer - if (step_events_completed >= step_event_count) { - axis_did_move = 0; - current_block = NULL; - planner.discard_current_block(); - } - else { - // Step events not completed yet... - - // Are we in acceleration phase ? - if (step_events_completed <= accelerate_until) { // Calculate new timer value - - #if ENABLED(S_CURVE_ACCELERATION) - // Get the next speed to use (Jerk limited!) - uint32_t acc_step_rate = - acceleration_time < current_block->acceleration_time - ? _eval_bezier_curve(acceleration_time) - : current_block->cruise_rate; - #else - acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; - NOMORE(acc_step_rate, current_block->nominal_rate); - #endif - - // acc_step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(acc_step_rate, oversampling_factor, &steps_per_isr); - acceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Wake up eISR on first acceleration loop and fire ISR if final adv_rate is reached - if (step_events_completed == steps_per_isr || (LA_steps && LA_isr_rate != current_block->advance_speed)) { - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - } - else { - LA_isr_rate = LA_ADV_NEVER; - if (LA_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - // Are we in Deceleration phase ? - else if (step_events_completed > decelerate_after) { - uint32_t step_rate; - - #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... - if (!bezier_2nd_half) { - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); - bezier_2nd_half = true; - // The first point starts at cruise rate. Just save evaluation of the Bézier curve - step_rate = current_block->cruise_rate; - } - else { - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - } - #else - - // Using the old trapezoidal control - step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? - step_rate = acc_step_rate - step_rate; - NOLESS(step_rate, current_block->final_rate); - } - else - step_rate = current_block->final_rate; - #endif - - // step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(step_rate, oversampling_factor, &steps_per_isr); - deceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - if (step_events_completed <= decelerate_after + steps_per_isr || - (LA_steps && LA_isr_rate != current_block->advance_speed) - ) { - nextAdvanceISR = 0; // Wake up eISR on first deceleration loop - LA_isr_rate = current_block->advance_speed; - } - } - else { - LA_isr_rate = LA_ADV_NEVER; - if (LA_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - // We must be in cruise phase otherwise - else { - - #if ENABLED(LIN_ADVANCE) - // If there are any esteps, fire the next advance_isr "now" - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - #endif - - // Calculate the ticks_nominal for this nominal speed, if not done yet - if (ticks_nominal < 0) { - // step_rate to timer interval and loops for the nominal speed - ticks_nominal = calc_timer_interval(current_block->nominal_rate, oversampling_factor, &steps_per_isr); - } - - // The timer interval is just the nominal value for the nominal speed - interval = ticks_nominal; - } - } - } - - // If there is no current block at this point, attempt to pop one from the buffer - // and prepare its movement - if (!current_block) { - - // Anything in the buffer? - if ((current_block = planner.get_current_block())) { - - // Sync block? Sync the stepper counts and return - while (TEST(current_block->flag, BLOCK_BIT_SYNC_POSITION)) { - _set_position( - current_block->position[A_AXIS], current_block->position[B_AXIS], - current_block->position[C_AXIS], current_block->position[E_AXIS] - ); - planner.discard_current_block(); - - // Try to get a new block - if (!(current_block = planner.get_current_block())) - return interval; // No more queued movements! - } - - // Flag all moving axes for proper endstop handling - - #if IS_CORE - // Define conditions for checking endstops - #define S_(N) current_block->steps[CORE_AXIS_##N] - #define D_(N) TEST(current_block->direction_bits, CORE_AXIS_##N) - #endif - - #if CORE_IS_XY || CORE_IS_XZ - /** - * Head direction in -X axis for CoreXY and CoreXZ bots. - * - * If steps differ, both axes are moving. - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) - * If DeltaA == DeltaB, the movement is only in the 1st axis (X) - */ - #if ENABLED(COREXY) || ENABLED(COREXZ) - #define X_CMP == - #else - #define X_CMP != - #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) - #else - #define X_MOVE_TEST !!current_block->steps[A_AXIS] - #endif - - #if CORE_IS_XY || CORE_IS_YZ - /** - * Head direction in -Y axis for CoreXY / CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) - */ - #if ENABLED(COREYX) || ENABLED(COREYZ) - #define Y_CMP == - #else - #define Y_CMP != - #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) - #else - #define Y_MOVE_TEST !!current_block->steps[B_AXIS] - #endif - - #if CORE_IS_XZ || CORE_IS_YZ - /** - * Head direction in -Z axis for CoreXZ or CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) - */ - #if ENABLED(COREZX) || ENABLED(COREZY) - #define Z_CMP == - #else - #define Z_CMP != - #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) - #else - #define Z_MOVE_TEST !!current_block->steps[C_AXIS] - #endif - - uint8_t axis_bits = 0; - if (X_MOVE_TEST) SBI(axis_bits, A_AXIS); - if (Y_MOVE_TEST) SBI(axis_bits, B_AXIS); - if (Z_MOVE_TEST) SBI(axis_bits, C_AXIS); - //if (!!current_block->steps[E_AXIS]) SBI(axis_bits, E_AXIS); - //if (!!current_block->steps[A_AXIS]) SBI(axis_bits, X_HEAD); - //if (!!current_block->steps[B_AXIS]) SBI(axis_bits, Y_HEAD); - //if (!!current_block->steps[C_AXIS]) SBI(axis_bits, Z_HEAD); - axis_did_move = axis_bits; - - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; - - uint8_t oversampling = 0; // Assume we won't use it - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - // At this point, we must decide if we can use Stepper movement axis smoothing. - uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) - while (max_rate < MIN_STEP_ISR_FREQUENCY) { - max_rate <<= 1; - if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; - ++oversampling; - } - oversampling_factor = oversampling; - #endif - - // Based on the oversampling factor, do the calculations - step_event_count = current_block->step_event_count << oversampling; - - // Initialize Bresenham delta errors to 1/2 - delta_error[X_AXIS] = delta_error[Y_AXIS] = delta_error[Z_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); - - // Calculate Bresenham dividends - advance_dividend[X_AXIS] = current_block->steps[X_AXIS] << 1; - advance_dividend[Y_AXIS] = current_block->steps[Y_AXIS] << 1; - advance_dividend[Z_AXIS] = current_block->steps[Z_AXIS] << 1; - advance_dividend[E_AXIS] = current_block->steps[E_AXIS] << 1; - - // Calculate Bresenham divisor - advance_divisor = step_event_count << 1; - - // No step events completed so far - step_events_completed = 0; - - // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling; - decelerate_after = current_block->decelerate_after << oversampling; - - #if ENABLED(MIXING_EXTRUDER) - const uint32_t e_steps = ( - #if ENABLED(LIN_ADVANCE) - current_block->steps[E_AXIS] - #else - step_event_count - #endif - ); - MIXING_STEPPERS_LOOP(i) { - delta_error_m[i] = -int32_t(e_steps); - advance_dividend_m[i] = current_block->mix_steps[i] << 1; - } - advance_divisor_m = e_steps << 1; - #else - active_extruder = current_block->active_extruder; - #endif - - // Initialize the trapezoid generator from the current block. - #if ENABLED(LIN_ADVANCE) - #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 - // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - if (active_extruder != last_moved_extruder) LA_current_adv_steps = 0; - #endif - - if ((LA_use_advance_lead = current_block->use_advance_lead)) { - LA_final_adv_steps = current_block->final_adv_steps; - LA_max_adv_steps = current_block->max_adv_steps; - } - #endif - - if (current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || active_extruder != last_moved_extruder - #endif - ) { - last_direction_bits = current_block->direction_bits; - #if DISABLED(MIXING_EXTRUDER) - last_moved_extruder = active_extruder; - #endif - set_directions(); - } - - // At this point, we must ensure the movement about to execute isn't - // trying to force the head against a limit switch. If using interrupt- - // driven change detection, and already against a limit then no call to - // the endstop_triggered method will be done and the movement will be - // done against the endstop. So, check the limits here: If the movement - // is against the limits, the block will be marked as to be killed, and - // on the next call to this ISR, will be discarded. - endstops.update(); - - #if ENABLED(Z_LATE_ENABLE) - // If delayed Z enable, enable it now. This option will severely interfere with - // timing between pulses when chaining motion between blocks, and it could lead - // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! - if (current_block->steps[Z_AXIS]) enable_Z(); - #endif - - // Mark the time_nominal as not calculated yet - ticks_nominal = -1; - - #if DISABLED(S_CURVE_ACCELERATION) - // Set as deceleration point the initial rate of the block - acc_step_rate = current_block->initial_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->initial_rate, current_block->cruise_rate, current_block->acceleration_time_inverse); - // We haven't started the 2nd half of the trapezoid - bezier_2nd_half = false; - #endif - - // Calculate the initial timer interval - interval = calc_timer_interval(current_block->initial_rate, oversampling_factor, &steps_per_isr); - } - } - - // Return the interval to wait - return interval; -} - -#if ENABLED(LIN_ADVANCE) - - // Timer interrupt for E. LA_steps is set in the main routine - uint32_t Stepper::advance_isr() { - uint32_t interval; - - if (LA_use_advance_lead) { - if (step_events_completed > decelerate_after && LA_current_adv_steps > LA_final_adv_steps) { - LA_steps--; - LA_current_adv_steps--; - interval = LA_isr_rate; - } - else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { - //step_events_completed <= (uint32_t)accelerate_until) { - LA_steps++; - LA_current_adv_steps++; - interval = LA_isr_rate; - } - else - interval = LA_isr_rate = LA_ADV_NEVER; - } - else - interval = LA_ADV_NEVER; - - #if ENABLED(MIXING_EXTRUDER) - if (LA_steps >= 0) - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - else - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - #else - if (LA_steps >= 0) - NORM_E_DIR(active_extruder); - else - REV_E_DIR(active_extruder); - #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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Step E stepper if we have steps - while (LA_steps) { - - // Set the STEP pulse ON - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - #else - E_STEP_WRITE(active_extruder, !INVERT_E_STEP_PIN); - #endif - - // Enforce a minimum duration for STEP pulse ON - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - LA_steps < 0 ? ++LA_steps : --LA_steps; - - // Set the STEP pulse OFF - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } - #else - E_STEP_WRITE(active_extruder, INVERT_E_STEP_PIN); - #endif - - // For minimum pulse time wait before looping - // Just wait for the requested pulse duration - if (LA_steps) { - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - } // LA_steps - - return interval; - } -#endif // LIN_ADVANCE - -// Check if the given block is busy or not - Must not be called from ISR contexts -// The current_block could change in the middle of the read by an Stepper ISR, so -// we must explicitly prevent that! -bool Stepper::is_block_busy(const block_t* const block) { - #define sw_barrier() asm volatile("": : :"memory"); - - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because stepper ISRs happen at a slower rate than - // successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - block_t* vold, *vnew = current_block; - sw_barrier(); - do { - vold = vnew; - vnew = current_block; - sw_barrier(); - } while (vold != vnew); - - // Return if the block is busy or not - return block == vnew; -} - -void Stepper::init() { - - // Init Digipot Motor Current - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - digipot_init(); - #endif - - // Init Microstepping Pins - #if HAS_MICROSTEPS - microstep_init(); - #endif - - // Init Dir Pins - #if HAS_X_DIR - X_DIR_INIT; - #endif - #if HAS_X2_DIR - X2_DIR_INIT; - #endif - #if HAS_Y_DIR - Y_DIR_INIT; - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR - Y2_DIR_INIT; - #endif - #endif - #if HAS_Z_DIR - Z_DIR_INIT; - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_DIR - Z2_DIR_INIT; - #endif - #endif - #if HAS_E0_DIR - E0_DIR_INIT; - #endif - #if HAS_E1_DIR - E1_DIR_INIT; - #endif - #if HAS_E2_DIR - E2_DIR_INIT; - #endif - #if HAS_E3_DIR - E3_DIR_INIT; - #endif - #if HAS_E4_DIR - E4_DIR_INIT; - #endif - - // Init Enable Pins - steppers default to disabled. - #if HAS_X_ENABLE - X_ENABLE_INIT; - if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); - #if (ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)) && HAS_X2_ENABLE - X2_ENABLE_INIT; - if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Y_ENABLE - Y_ENABLE_INIT; - if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE - Y2_ENABLE_INIT; - if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Z_ENABLE - Z_ENABLE_INIT; - if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_ENABLE - Z2_ENABLE_INIT; - if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_E0_ENABLE - E0_ENABLE_INIT; - if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); - #endif - #if HAS_E1_ENABLE - E1_ENABLE_INIT; - if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); - #endif - #if HAS_E2_ENABLE - E2_ENABLE_INIT; - if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); - #endif - #if HAS_E3_ENABLE - E3_ENABLE_INIT; - if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); - #endif - #if HAS_E4_ENABLE - E4_ENABLE_INIT; - if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); - #endif - - #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT - #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) - #define _DISABLE(AXIS) disable_## AXIS() - - #define AXIS_INIT(AXIS, PIN) \ - _STEP_INIT(AXIS); \ - _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \ - _DISABLE(AXIS) - - #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E) - - // Init Step Pins - #if HAS_X_STEP - #if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE) - X2_STEP_INIT; - X2_STEP_WRITE(INVERT_X_STEP_PIN); - #endif - AXIS_INIT(X, X); - #endif - - #if HAS_Y_STEP - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - Y2_STEP_INIT; - Y2_STEP_WRITE(INVERT_Y_STEP_PIN); - #endif - AXIS_INIT(Y, Y); - #endif - - #if HAS_Z_STEP - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - Z2_STEP_INIT; - Z2_STEP_WRITE(INVERT_Z_STEP_PIN); - #endif - AXIS_INIT(Z, Z); - #endif - - #if E_STEPPERS > 0 && HAS_E0_STEP - E_AXIS_INIT(0); - #endif - #if E_STEPPERS > 1 && HAS_E1_STEP - E_AXIS_INIT(1); - #endif - #if E_STEPPERS > 2 && HAS_E2_STEP - E_AXIS_INIT(2); - #endif - #if E_STEPPERS > 3 && HAS_E3_STEP - E_AXIS_INIT(3); - #endif - #if E_STEPPERS > 4 && HAS_E4_STEP - E_AXIS_INIT(4); - #endif - - // Init Stepper ISR to 122 Hz for quick starting - HAL_timer_start(STEP_TIMER_NUM, 122); // OCR1A = 0x4000 - - ENABLE_STEPPER_DRIVER_INTERRUPT(); - - endstops.enable(true); // Start with endstops active. After homing they can be disabled - sei(); - - set_directions(); // Init directions to last_direction_bits = 0 -} - -/** - * Set the stepper positions directly in steps - * - * The input is based on the typical per-axis XYZ steps. - * For CORE machines XYZ needs to be translated to ABC. - * - * This allows get_axis_position_mm to correctly - * derive the current XYZ position later on. - */ -void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - #if CORE_IS_XY - // corexy positioning - // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html - count_position[A_AXIS] = a + b; - count_position[B_AXIS] = CORESIGN(a - b); - count_position[Z_AXIS] = c; - #elif CORE_IS_XZ - // corexz planning - count_position[A_AXIS] = a + c; - count_position[Y_AXIS] = b; - count_position[C_AXIS] = CORESIGN(a - c); - #elif CORE_IS_YZ - // coreyz planning - count_position[X_AXIS] = a; - count_position[B_AXIS] = b + c; - count_position[C_AXIS] = CORESIGN(b - c); - #else - // default non-h-bot planning - count_position[X_AXIS] = a; - count_position[Y_AXIS] = b; - count_position[Z_AXIS] = c; - #endif - count_position[E_AXIS] = e; -} - -/** - * Get a stepper's position in steps. - */ -int32_t Stepper::position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = count_position[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - return v; -} - -// Signal endstops were triggered - This function can be called from -// an ISR context (Temperature, Stepper or limits ISR), so we must -// be very careful here. If the interrupt being preempted was the -// Stepper ISR (this CAN happen with the endstop limits ISR) then -// when the stepper ISR resumes, we must be very sure that the movement -// is properly cancelled -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 - - // Discard the rest of the move if there is a current block - quick_stop(); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -int32_t Stepper::triggered_position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = endstops_trigsteps[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - return v; -} - -void Stepper::report_positions() { - - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - 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(); - - #if CORE_IS_XY || CORE_IS_XZ || IS_DELTA || IS_SCARA - SERIAL_PROTOCOLPGM(MSG_COUNT_A); - #else - SERIAL_PROTOCOLPGM(MSG_COUNT_X); - #endif - SERIAL_PROTOCOL(xpos); - - #if CORE_IS_XY || CORE_IS_YZ || IS_DELTA || IS_SCARA - SERIAL_PROTOCOLPGM(" B:"); - #else - SERIAL_PROTOCOLPGM(" Y:"); - #endif - SERIAL_PROTOCOL(ypos); - - #if CORE_IS_XZ || CORE_IS_YZ || IS_DELTA - SERIAL_PROTOCOLPGM(" C:"); - #else - SERIAL_PROTOCOLPGM(" Z:"); - #endif - SERIAL_PROTOCOL(zpos); - - SERIAL_EOL(); -} - -#if ENABLED(BABYSTEPPING) - - #if MINIMUM_STEPPER_PULSE - #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) - #else - #define STEP_PULSE_CYCLES 0 - #endif - - #if ENABLED(DELTA) - #define CYCLES_EATEN_BABYSTEP (2 * 15) - #else - #define CYCLES_EATEN_BABYSTEP 0 - #endif - #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) - - #define _ENABLE(AXIS) enable_## AXIS() - #define _READ_DIR(AXIS) AXIS ##_DIR_READ - #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR - #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) - - #if EXTRA_CYCLES_BABYSTEP > 20 - #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM) - #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - #else - #define _SAVE_START NOOP - #if EXTRA_CYCLES_BABYSTEP > 0 - #define _PULSE_WAIT DELAY_NS(EXTRA_CYCLES_BABYSTEP * NANOSECONDS_PER_CYCLE) - #elif STEP_PULSE_CYCLES > 0 - #define _PULSE_WAIT NOOP - #elif ENABLED(DELTA) - #define _PULSE_WAIT DELAY_US(2); - #else - #define _PULSE_WAIT DELAY_US(4); - #endif - #endif - - #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ - const uint8_t old_dir = _READ_DIR(AXIS); \ - _ENABLE(AXIS); \ - _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); \ - _SAVE_START; \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ - _APPLY_DIR(AXIS, old_dir); \ - } - - // MUST ONLY BE CALLED BY AN ISR, - // No other ISR should ever interrupt this! - void Stepper::babystep(const AxisEnum axis, const bool direction) { - cli(); - - switch (axis) { - - #if ENABLED(BABYSTEP_XY) - - case X_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction); - #elif CORE_IS_XZ - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Z, false, direction); - #else - BABYSTEP_AXIS(X, false, direction); - #endif - break; - - case Y_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0)); - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, false, direction); - BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0)); - #else - BABYSTEP_AXIS(Y, false, direction); - #endif - break; - - #endif - - case Z_AXIS: { - - #if CORE_IS_XZ - BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); - - #else // DELTA - - const bool z_direction = direction ^ BABYSTEP_INVERT_Z; - - enable_X(); - enable_Y(); - enable_Z(); - - const uint8_t old_x_dir_pin = X_DIR_READ, - old_y_dir_pin = Y_DIR_READ, - old_z_dir_pin = Z_DIR_READ; - - X_DIR_WRITE(INVERT_X_DIR ^ z_direction); - 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); - #endif - - _SAVE_START; - - X_STEP_WRITE(!INVERT_X_STEP_PIN); - Y_STEP_WRITE(!INVERT_Y_STEP_PIN); - Z_STEP_WRITE(!INVERT_Z_STEP_PIN); - - _PULSE_WAIT; - - X_STEP_WRITE(INVERT_X_STEP_PIN); - Y_STEP_WRITE(INVERT_Y_STEP_PIN); - Z_STEP_WRITE(INVERT_Z_STEP_PIN); - - // Restore direction bits - X_DIR_WRITE(old_x_dir_pin); - Y_DIR_WRITE(old_y_dir_pin); - Z_DIR_WRITE(old_z_dir_pin); - - #endif - - } break; - - default: break; - } - sei(); - } - -#endif // BABYSTEPPING - -/** - * Software-controlled Stepper Motor Current - */ - -#if HAS_DIGIPOTSS - - // From Arduino DigitalPotControl example - void Stepper::digitalPotWrite(const int16_t address, const int16_t value) { - WRITE(DIGIPOTSS_PIN, LOW); // Take the SS pin low to select the chip - SPI.transfer(address); // Send the address and value via SPI - SPI.transfer(value); - WRITE(DIGIPOTSS_PIN, HIGH); // Take the SS pin high to de-select the chip - //delay(10); - } - -#endif // HAS_DIGIPOTSS - -#if HAS_MOTOR_CURRENT_PWM - - void Stepper::refresh_motor_power() { - for (uint8_t i = 0; i < COUNT(motor_current_setting); ++i) { - switch (i) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - case 0: - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - case 2: - #endif - digipot_current(i, motor_current_setting[i]); - default: break; - } - } - } - -#endif // HAS_MOTOR_CURRENT_PWM - -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - - void Stepper::digipot_current(const uint8_t driver, const int current) { - - #if HAS_DIGIPOTSS - - const uint8_t digipot_ch[] = DIGIPOT_CHANNELS; - digitalPotWrite(digipot_ch[driver], current); - - #elif HAS_MOTOR_CURRENT_PWM - - if (WITHIN(driver, 0, 2)) - motor_current_setting[driver] = current; // update motor_current_setting - - #define _WRITE_CURRENT_PWM(P) analogWrite(MOTOR_CURRENT_PWM_## P ##_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)) - switch (driver) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - case 0: _WRITE_CURRENT_PWM(XY); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: _WRITE_CURRENT_PWM(Z); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - case 2: _WRITE_CURRENT_PWM(E); break; - #endif - } - #endif - } - - void Stepper::digipot_init() { - - #if HAS_DIGIPOTSS - - static const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT; - - SPI.begin(); - SET_OUTPUT(DIGIPOTSS_PIN); - - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) { - //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]); - digipot_current(i, digipot_motor_current[i]); - } - - #elif HAS_MOTOR_CURRENT_PWM - - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); - #endif - - refresh_motor_power(); - - // Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) - SET_CS5(PRESCALER_1); - - #endif - } - -#endif - -#if HAS_MICROSTEPS - - /** - * Software-controlled Microstepping - */ - - void Stepper::microstep_init() { - SET_OUTPUT(X_MS1_PIN); - SET_OUTPUT(X_MS2_PIN); - #if HAS_Y_MICROSTEPS - SET_OUTPUT(Y_MS1_PIN); - SET_OUTPUT(Y_MS2_PIN); - #endif - #if HAS_Z_MICROSTEPS - SET_OUTPUT(Z_MS1_PIN); - SET_OUTPUT(Z_MS2_PIN); - #endif - #if HAS_E0_MICROSTEPS - SET_OUTPUT(E0_MS1_PIN); - SET_OUTPUT(E0_MS2_PIN); - #endif - #if HAS_E1_MICROSTEPS - SET_OUTPUT(E1_MS1_PIN); - SET_OUTPUT(E1_MS2_PIN); - #endif - #if HAS_E2_MICROSTEPS - SET_OUTPUT(E2_MS1_PIN); - SET_OUTPUT(E2_MS2_PIN); - #endif - #if HAS_E3_MICROSTEPS - SET_OUTPUT(E3_MS1_PIN); - SET_OUTPUT(E3_MS2_PIN); - #endif - #if HAS_E4_MICROSTEPS - SET_OUTPUT(E4_MS1_PIN); - SET_OUTPUT(E4_MS2_PIN); - #endif - static const uint8_t microstep_modes[] = MICROSTEP_MODES; - for (uint16_t i = 0; i < COUNT(microstep_modes); i++) - microstep_mode(i, microstep_modes[i]); - } - - void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2) { - if (ms1 >= 0) switch (driver) { - case 0: WRITE(X_MS1_PIN, ms1); break; - #if HAS_Y_MICROSTEPS - case 1: WRITE(Y_MS1_PIN, ms1); break; - #endif - #if HAS_Z_MICROSTEPS - case 2: WRITE(Z_MS1_PIN, ms1); break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS1_PIN, ms1); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS1_PIN, ms1); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS1_PIN, ms1); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS1_PIN, ms1); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS1_PIN, ms1); break; - #endif - } - if (ms2 >= 0) switch (driver) { - case 0: WRITE(X_MS2_PIN, ms2); break; - #if HAS_Y_MICROSTEPS - case 1: WRITE(Y_MS2_PIN, ms2); break; - #endif - #if HAS_Z_MICROSTEPS - case 2: WRITE(Z_MS2_PIN, ms2); break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS2_PIN, ms2); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS2_PIN, ms2); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS2_PIN, ms2); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS2_PIN, ms2); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS2_PIN, ms2); break; - #endif - } - } - - void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) { - switch (stepping_mode) { - case 1: microstep_ms(driver, MICROSTEP1); break; - #if ENABLED(HEROIC_STEPPER_DRIVERS) - case 128: microstep_ms(driver, MICROSTEP128); break; - #else - case 2: microstep_ms(driver, MICROSTEP2); break; - case 4: microstep_ms(driver, MICROSTEP4); break; - #endif - case 8: microstep_ms(driver, MICROSTEP8); break; - case 16: microstep_ms(driver, MICROSTEP16); break; - default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break; - } - } - - void Stepper::microstep_readings() { - SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); - SERIAL_PROTOCOLPGM("X: "); - SERIAL_PROTOCOL(READ(X_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(X_MS2_PIN)); - #if HAS_Y_MICROSTEPS - SERIAL_PROTOCOLPGM("Y: "); - SERIAL_PROTOCOL(READ(Y_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(Y_MS2_PIN)); - #endif - #if HAS_Z_MICROSTEPS - SERIAL_PROTOCOLPGM("Z: "); - SERIAL_PROTOCOL(READ(Z_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(Z_MS2_PIN)); - #endif - #if HAS_E0_MICROSTEPS - SERIAL_PROTOCOLPGM("E0: "); - SERIAL_PROTOCOL(READ(E0_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E0_MS2_PIN)); - #endif - #if HAS_E1_MICROSTEPS - SERIAL_PROTOCOLPGM("E1: "); - SERIAL_PROTOCOL(READ(E1_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E1_MS2_PIN)); - #endif - #if HAS_E2_MICROSTEPS - SERIAL_PROTOCOLPGM("E2: "); - SERIAL_PROTOCOL(READ(E2_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E2_MS2_PIN)); - #endif - #if HAS_E3_MICROSTEPS - SERIAL_PROTOCOLPGM("E3: "); - SERIAL_PROTOCOL(READ(E3_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E3_MS2_PIN)); - #endif - #if HAS_E4_MICROSTEPS - SERIAL_PROTOCOLPGM("E4: "); - SERIAL_PROTOCOL(READ(E4_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E4_MS2_PIN)); - #endif - } - -#endif // HAS_MICROSTEPS diff --git a/Marlin/stepper.h b/Marlin/stepper.h deleted file mode 100644 index 2ac9c7756a..0000000000 --- a/Marlin/stepper.h +++ /dev/null @@ -1,527 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors - * Derived from Grbl - * - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -#ifndef STEPPER_H -#define STEPPER_H - -#include "MarlinConfig.h" - -// Disable multiple steps per ISR -//#define DISABLE_MULTI_STEPPING - -// -// Estimate the amount of time the Stepper ISR will take to execute -// - -#ifndef MINIMUM_STEPPER_PULSE - #define MINIMUM_STEPPER_PULSE 0UL -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if MINIMUM_STEPPER_PULSE - #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (unsigned long)(MINIMUM_STEPPER_PULSE))) - #else - #define MAXIMUM_STEPPER_RATE 500000UL - #endif -#endif - -// The base ISR takes 752 cycles -#define ISR_BASE_CYCLES 752UL - -// Linear advance base time is 32 cycles -#if ENABLED(LIN_ADVANCE) - #define ISR_LA_BASE_CYCLES 32UL -#else - #define ISR_LA_BASE_CYCLES 0UL -#endif - -// S curve interpolation adds 160 cycles -#if ENABLED(S_CURVE_ACCELERATION) - #define ISR_S_CURVE_CYCLES 160UL -#else - #define ISR_S_CURVE_CYCLES 0UL -#endif - -// Stepper Loop base cycles -#define ISR_LOOP_BASE_CYCLES 32UL - -// To start the step pulse, in the worst case takes -#define ISR_START_STEPPER_CYCLES 57UL - -// And each stepper (start + stop pulse) takes in worst case -#define ISR_STEPPER_CYCLES 88UL - -// Add time for each stepper -#ifdef HAS_X_STEP - #define ISR_START_X_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_X_STEPPER_CYCLES 0UL - #define ISR_X_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Y_STEP - #define ISR_START_Y_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Y_STEPPER_CYCLES 0UL - #define ISR_Y_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Z_STEP - #define ISR_START_Z_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Z_STEPPER_CYCLES 0UL - #define ISR_Z_STEPPER_CYCLES 0UL -#endif - -// E is always interpolated, even for mixing extruders -#define ISR_START_E_STEPPER_CYCLES ISR_START_STEPPER_CYCLES -#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES - -// If linear advance is disabled, then the loop also handles them -#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) - #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES)) - #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) -#else - #define ISR_START_MIXING_STEPPER_CYCLES 0UL - #define ISR_MIXING_STEPPER_CYCLES 0UL -#endif - -// Calculate the minimum time to start all stepper pulses in the ISR loop -#define MIN_ISR_START_LOOP_CYCLES (ISR_START_X_STEPPER_CYCLES + ISR_START_Y_STEPPER_CYCLES + ISR_START_Z_STEPPER_CYCLES + ISR_START_E_STEPPER_CYCLES + ISR_START_MIXING_STEPPER_CYCLES) - -// And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES) - -// Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate -#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((unsigned long)((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) -#if MINIMUM_STEPPER_PULSE - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((unsigned long)(MINIMUM_STEPPER_PULSE)) -#else - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL) -#endif - -// Calculate the minimum ticks of the PULSE timer that must elapse with the step pulse enabled -// 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 -#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (unsigned long)(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (unsigned long)(PULSE_TIMER_PRESCALE))) - -// Calculate the extra ticks of the PULSE timer between step pulses -#define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS)) - -// But the user could be enforcing a minimum time, so the loop time is -#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES)) - -// If linear advance is enabled, then it is handled separately -#if ENABLED(LIN_ADVANCE) - - // Estimate the minimum LA loop time - #if ENABLED(MIXING_EXTRUDER) - #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) - #else - #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES - #endif - - // And the real loop time - #define ISR_LA_LOOP_CYCLES MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES) - -#else - #define ISR_LA_LOOP_CYCLES 0UL -#endif - -// Now estimate the total ISR execution time in cycles given a step per ISR multiplier -#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES) * (R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R)) - -// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz) -#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128)) -#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64)) -#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32)) -#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16)) -#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8)) -#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4)) -#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2)) -#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1)) - -// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz) -#define MIN_STEP_ISR_FREQUENCY MAX_STEP_ISR_FREQUENCY_1X - -// -// Stepper class definition -// - -#include "planner.h" -#include "speed_lookuptable.h" -#include "stepper_indirection.h" -#include "language.h" -#include "types.h" - -// intRes = intIn1 * intIn2 >> 16 -// uses: -// r26 to store 0 -// r27 to store the byte 1 of the 24 bit result -static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { - register uint8_t tmp; - register uint16_t intRes; - __asm__ __volatile__ ( - A("clr %[tmp]") - A("mul %[charIn1], %B[intIn2]") - A("movw %A[intRes], r0") - A("mul %[charIn1], %A[intIn2]") - A("add %A[intRes], r1") - A("adc %B[intRes], %[tmp]") - A("lsr r0") - A("adc %A[intRes], %[tmp]") - A("adc %B[intRes], %[tmp]") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp] "=&r" (tmp) - : [charIn1] "d" (charIn1), - [intIn2] "d" (intIn2) - : "cc" - ); - return intRes; -} - -class Stepper { - - public: - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - static bool homing_dual_axis; - #endif - - #if HAS_MOTOR_CURRENT_PWM - #ifndef PWM_MOTOR_CURRENT - #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT - #endif - static uint32_t motor_current_setting[3]; - #endif - - private: - - static block_t* current_block; // A pointer to the block currently being traced - - static uint8_t last_direction_bits, // The next stepping-bits to be output - axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner - - static bool abort_current_block; // Signals to the stepper that current block should be aborted - - #if DISABLED(MIXING_EXTRUDER) - static uint8_t last_moved_extruder; // Last-moved extruder, as set when the last movement was fetched from planner - #endif - - #if ENABLED(X_DUAL_ENDSTOPS) - static bool locked_X_motor, locked_X2_motor; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static bool locked_Y_motor, locked_Y2_motor; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static bool locked_Z_motor, locked_Z2_motor; - #endif - - static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks - static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis - #else - static constexpr uint8_t oversampling_factor = 0; - #endif - - // Delta error variables for the Bresenham line tracer - static int32_t delta_error[XYZE]; - static uint32_t advance_dividend[XYZE], - advance_divisor, - step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating - step_event_count; // The total event count for the current block - - // Mixing extruder mix delta_errors for bresenham tracing - #if ENABLED(MIXING_EXTRUDER) - static int32_t delta_error_m[MIXING_STEPPERS]; - static uint32_t advance_dividend_m[MIXING_STEPPERS], - advance_divisor_m; - #define MIXING_STEPPERS_LOOP(VAR) \ - for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) - #else - static int8_t active_extruder; // Active extruder - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - static int32_t bezier_A, // A coefficient in Bézier speed curve - bezier_B, // B coefficient in Bézier speed curve - bezier_C; // C coefficient in Bézier speed curve - static uint32_t bezier_F, // F coefficient in Bézier speed curve - bezier_AV; // AV coefficient in Bézier speed curve - static bool A_negative, // If A coefficient was negative - bezier_2nd_half; // If Bézier curve has been initialized or not - #endif - - static uint32_t nextMainISR; // time remaining for the next Step ISR - #if ENABLED(LIN_ADVANCE) - static uint32_t nextAdvanceISR, LA_isr_rate; - static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early". - static int8_t LA_steps; - static bool LA_use_advance_lead; - #endif // LIN_ADVANCE - - static int32_t ticks_nominal; - #if DISABLED(S_CURVE_ACCELERATION) - static uint32_t acc_step_rate; // needed for deceleration start point - #endif - - static volatile int32_t endstops_trigsteps[XYZ]; - - // - // Positions of stepper motors, in step units - // - static volatile int32_t count_position[NUM_AXIS]; - - // - // Current direction of stepper motors (+1 or -1) - // - static int8_t count_direction[NUM_AXIS]; - - public: - - // - // Constructor / initializer - // - Stepper() { }; - - // Initialize stepper hardware - static void init(); - - // Interrupt Service Routines - - // The ISR scheduler - static void isr(); - - // The stepper pulse phase ISR - static void stepper_pulse_phase_isr(); - - // The stepper block processing phase ISR - static uint32_t stepper_block_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // The Linear advance stepper ISR - static uint32_t advance_isr(); - #endif - - // Check if the given block is busy or not - Must not be called from ISR contexts - static bool is_block_busy(const block_t* const block); - - // Get the position of a stepper, in steps - static int32_t position(const AxisEnum axis); - - // Report the positions of the steppers, in steps - static void report_positions(); - - // The stepper subsystem goes to sleep when it runs out of things to execute. Call this - // to notify the subsystem that it is time to go to work. - static void wake_up(); - - // Quickly stop all steppers - FORCE_INLINE static void quick_stop() { abort_current_block = true; } - - // The direction of a single motor - FORCE_INLINE static bool motor_direction(const AxisEnum axis) { return TEST(last_direction_bits, axis); } - - // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same. - FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } - - // The extruder associated to the last movement - FORCE_INLINE static uint8_t movement_extruder() { - return - #if ENABLED(MIXING_EXTRUDER) - 0 - #else - last_moved_extruder - #endif - ; - } - - // Handle a triggered endstop - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in steps - static int32_t triggered_position(const AxisEnum axis); - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digitalPotWrite(const int16_t address, const int16_t value); - static void digipot_current(const uint8_t driver, const int16_t current); - #endif - - #if HAS_MICROSTEPS - static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2); - static void microstep_mode(const uint8_t driver, const uint8_t stepping); - static void microstep_readings(); - #endif - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_homing_dual_axis(const bool state) { homing_dual_axis = state; } - #endif - #if ENABLED(X_DUAL_ENDSTOPS) - FORCE_INLINE static void set_x_lock(const bool state) { locked_X_motor = state; } - FORCE_INLINE static void set_x2_lock(const bool state) { locked_X2_motor = state; } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - FORCE_INLINE static void set_y_lock(const bool state) { locked_Y_motor = state; } - FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; } - FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } - #endif - - #if ENABLED(BABYSTEPPING) - static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention - #endif - - #if HAS_MOTOR_CURRENT_PWM - static void refresh_motor_power(); - #endif - - // Set the current position in steps - inline static void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - planner.synchronize(); - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - _set_position(a, b, c, e); - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - inline static void set_position(const AxisEnum a, const int32_t &v) { - planner.synchronize(); - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - count_position[a] = v; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - private: - - // Set the current position in steps - static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e); - - // Set direction bits for all steppers - static void set_directions(); - - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { - uint32_t timer; - - // Scale the frequency, as requested by the caller - step_rate <<= scale; - - uint8_t multistep = 1; - #if DISABLED(DISABLE_MULTI_STEPPING) - - // The stepping frequency limits for each multistepping rate - static const uint32_t limit[] PROGMEM = { - ( MAX_STEP_ISR_FREQUENCY_1X ), - ( MAX_STEP_ISR_FREQUENCY_2X >> 1), - ( MAX_STEP_ISR_FREQUENCY_4X >> 2), - ( MAX_STEP_ISR_FREQUENCY_8X >> 3), - ( MAX_STEP_ISR_FREQUENCY_16X >> 4), - ( MAX_STEP_ISR_FREQUENCY_32X >> 5), - ( MAX_STEP_ISR_FREQUENCY_64X >> 6), - (MAX_STEP_ISR_FREQUENCY_128X >> 7) - }; - - // Select the proper multistepping - uint8_t idx = 0; - while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) { - step_rate >>= 1; - multistep <<= 1; - ++idx; - }; - #else - NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X)); - #endif - *loops = multistep; - - constexpr uint32_t min_step_rate = F_CPU / 500000U; - NOLESS(step_rate, min_step_rate); - step_rate -= min_step_rate; // Correct for minimal speed - if (step_rate >= (8 * 256)) { // higher step rate - const uint8_t tmp_step_rate = (step_rate & 0x00FF); - const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0], - gain = (uint16_t)pgm_read_word_near(table_address + 2); - timer = MultiU16X8toH16(tmp_step_rate, gain); - timer = (uint16_t)pgm_read_word_near(table_address) - timer; - } - else { // lower step rates - uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0]; - table_address += ((step_rate) >> 1) & 0xFFFC; - timer = (uint16_t)pgm_read_word_near(table_address) - - (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3); - } - // (there is no need to limit the timer value here. All limits have been - // applied above, and AVR is able to keep up at 30khz Stepping ISR rate) - - return timer; - } - - #if ENABLED(S_CURVE_ACCELERATION) - static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); - static int32_t _eval_bezier_curve(const uint32_t curr_step); - #endif - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digipot_init(); - #endif - - #if HAS_MICROSTEPS - static void microstep_init(); - #endif - -}; - -extern Stepper stepper; - -#endif // STEPPER_H diff --git a/Marlin/stepper_dac.cpp b/Marlin/stepper_dac.cpp deleted file mode 100644 index d5f713fedb..0000000000 --- a/Marlin/stepper_dac.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - stepper_dac.cpp - To set stepper current via DAC - - Part of Marlin - - Copyright (c) 2016 MarlinFirmware - - Marlin 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. - - Marlin 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 Marlin. If not, see . -*/ - -#include "Marlin.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - - #include "stepper_dac.h" - - bool dac_present = false; - const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER; - uint8_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT; - - int dac_init() { - #if PIN_EXISTS(DAC_DISABLE) - OUT_WRITE(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC - #endif - - mcp4728_init(); - - if (mcp4728_simpleCommand(RESET)) return -1; - - dac_present = true; - - mcp4728_setVref_all(DAC_STEPPER_VREF); - mcp4728_setGain_all(DAC_STEPPER_GAIN); - - if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) { - mcp4728_setDrvPct(dac_channel_pct); - mcp4728_eepromWrite(); - } - - return 0; - } - - void dac_current_percent(uint8_t channel, float val) { - if (!dac_present) return; - - NOMORE(val, 100); - - mcp4728_analogWrite(dac_order[channel], val * 0.01 * (DAC_STEPPER_MAX)); - mcp4728_simpleCommand(UPDATE); - } - - void dac_current_raw(uint8_t channel, uint16_t val) { - if (!dac_present) return; - - NOMORE(val, DAC_STEPPER_MAX); - - mcp4728_analogWrite(dac_order[channel], val); - mcp4728_simpleCommand(UPDATE); - } - - static float dac_perc(int8_t n) { return 100.0f * 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)); } - - uint8_t dac_current_get_percent(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } - void dac_current_set_percents(const uint8_t pct[XYZE]) { - LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; - mcp4728_setDrvPct(dac_channel_pct); - } - - void dac_print_values() { - if (!dac_present) return; - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Stepper current values in % (Amps):"); - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" X:", dac_perc(X_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(X_AXIS)); - SERIAL_ECHOPAIR(") Y:", dac_perc(Y_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(Y_AXIS)); - SERIAL_ECHOPAIR(") Z:", dac_perc(Z_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(Z_AXIS)); - SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(E_AXIS)); - SERIAL_ECHOLNPGM(")"); - } - - void dac_commit_eeprom() { - if (!dac_present) return; - mcp4728_eepromWrite(); - } - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin/stepper_dac.h b/Marlin/stepper_dac.h deleted file mode 100644 index cf56050e72..0000000000 --- a/Marlin/stepper_dac.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - stepper_dac.h - To set stepper current via DAC - - Part of Marlin - - Copyright (c) 2016 MarlinFirmware - - Marlin 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. - - Marlin 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 Marlin. If not, see . -*/ - -#ifndef STEPPER_DAC_H -#define STEPPER_DAC_H - -#include "dac_mcp4728.h" - -int dac_init(); -void dac_current_percent(uint8_t channel, float val); -void dac_current_raw(uint8_t channel, uint16_t val); -void dac_print_values(); -void dac_commit_eeprom(); -uint8_t dac_current_get_percent(const AxisEnum axis); -void dac_current_set_percents(const uint8_t pct[XYZE]); - -#endif // STEPPER_DAC_H diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp deleted file mode 100644 index 6c3ec5b2da..0000000000 --- a/Marlin/stepper_indirection.cpp +++ /dev/null @@ -1,672 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper_indirection.cpp - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Part of Marlin - * - * Copyright (c) 2015 Dominik Wenger - */ - -#include "stepper_indirection.h" - -#include "MarlinConfig.h" - -// -// TMC26X Driver objects and inits -// -#if HAS_DRIVER(TMC26X) - #include - #include - - #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(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 - - #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(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 - } -#endif // TMC26X - -// -// TMC2130 Driver objects and inits -// -#if HAS_DRIVER(TMC2130) - - #include - #include - #include "planner.h" - #include "enum.h" - - #if TMC2130STEPPER_VERSION < 0x020201 - #error "Update TMC2130Stepper library to 2.2.1 or newer." - #endif - - #if ENABLED(TMC_USE_SW_SPI) - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) - #else - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN) - #endif - - // Stepper objects of TMC2130 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2130) - _TMC2130_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - _TMC2130_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - _TMC2130_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - _TMC2130_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - _TMC2130_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - _TMC2130_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - _TMC2130_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - _TMC2130_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - _TMC2130_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - _TMC2130_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - _TMC2130_DEFINE(E4); - #endif - - // Use internal reference voltage for current calculations. This is the default. - // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) - // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/ - void tmc2130_init(TMC2130Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { - #if DISABLED(STEALTHCHOP) || DISABLED(HYBRID_THRESHOLD) - UNUSED(thrs); - UNUSED(spmm); - #endif - st.begin(); - st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.blank_time(24); - st.off_time(5); // Only enables the driver if used with stealthChop - st.interpolate(INTERPOLATE); - st.power_down_delay(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); - #if ENABLED(STEALTHCHOP) - st.stealth_freq(1); // f_pwm = 2/683 f_clk - st.stealth_autoscale(1); - st.stealth_gradient(5); - st.stealth_amplitude(255); - st.stealthChop(1); - #if ENABLED(HYBRID_THRESHOLD) - st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm)); - #endif - #endif - st.GSTAT(); // Clear GSTAT - } - - #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - - void tmc2130_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2130) - _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - - #if ENABLED(SENSORLESS_HOMING) - #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); - #if X_SENSORLESS - #if AXIS_DRIVER_TYPE(X, TMC2130) - stepperX.sgt(X_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - stepperX2.sgt(X_HOMING_SENSITIVITY); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_DRIVER_TYPE(Y, TMC2130) - stepperY.sgt(Y_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - stepperY2.sgt(Y_HOMING_SENSITIVITY); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_DRIVER_TYPE(Z, TMC2130) - stepperZ.sgt(Z_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - stepperZ2.sgt(Z_HOMING_SENSITIVITY); - #endif - #endif - #endif - } -#endif // TMC2130 - -// -// TMC2208 Driver objects and inits -// -#if HAS_DRIVER(TMC2208) - - #undef HardwareSerial_h // undo Marlin trickery - #include - #include - #include - #include "planner.h" - - #if TMC2208STEPPER_VERSION < 0x000101 - #error "Update TMC2208Stepper library to 0.1.1 or newer." - #endif - - #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL) - #define _TMC2208_DEFINE_SOFTWARE(ST) TMC2208Stepper stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_SERIAL_RX_PIN > -1) - - // Stepper objects of TMC2208 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(X); - #else - _TMC2208_DEFINE_SOFTWARE(X); - #endif - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(X2); - #else - _TMC2208_DEFINE_SOFTWARE(X2); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Y); - #else - _TMC2208_DEFINE_SOFTWARE(Y); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Y2); - #else - _TMC2208_DEFINE_SOFTWARE(Y2); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Z); - #else - _TMC2208_DEFINE_SOFTWARE(Z); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Z2); - #else - _TMC2208_DEFINE_SOFTWARE(Z2); - #endif - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E0); - #else - _TMC2208_DEFINE_SOFTWARE(E0); - #endif - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E1); - #else - _TMC2208_DEFINE_SOFTWARE(E1); - #endif - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E2); - #else - _TMC2208_DEFINE_SOFTWARE(E2); - #endif - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E3); - #else - _TMC2208_DEFINE_SOFTWARE(E3); - #endif - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E4); - #else - _TMC2208_DEFINE_SOFTWARE(E4); - #endif - #endif - - void tmc2208_serial_begin() { - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(115200); - #else - stepperX.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(115200); - #else - stepperX2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(115200); - #else - stepperY.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(115200); - #else - stepperY2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(115200); - #else - stepperZ.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(115200); - #else - stepperZ2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(115200); - #else - stepperE0.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(115200); - #else - stepperE1.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(115200); - #else - stepperE2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(115200); - #else - stepperE3.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(115200); - #else - stepperE4.beginSerial(115200); - #endif - #endif - } - - // Use internal reference voltage for current calculations. This is the default. - // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) - void tmc2208_init(TMC2208Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { - st.pdn_disable(true); // Use UART - st.mstep_reg_select(true); // Select microsteps with UART - st.I_scale_analog(false); - st.rms_current(mA, HOLD_MULTIPLIER, R_SENSE); - st.microsteps(microsteps); - st.blank_time(24); - st.toff(5); - st.intpol(INTERPOLATE); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); - #if ENABLED(STEALTHCHOP) - st.pwm_lim(12); - st.pwm_reg(8); - st.pwm_autograd(1); - st.pwm_autoscale(1); - st.pwm_freq(1); - st.pwm_grad(14); - st.pwm_ofs(36); - st.en_spreadCycle(false); - #if ENABLED(HYBRID_THRESHOLD) - st.TPWMTHRS(12650000UL*microsteps/(256*thrs*spmm)); - #else - UNUSED(thrs); - UNUSED(spmm); - #endif - #else - st.en_spreadCycle(true); - #endif - st.GSTAT(0b111); // Clear - delay(200); - } - - #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - - void tmc2208_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2208) - _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - } -#endif // TMC2208 - -void restore_stepper_drivers() { - #if AXIS_IS_TMC(X) - stepperX.push(); - #endif - #if AXIS_IS_TMC(X2) - stepperX2.push(); - #endif - #if AXIS_IS_TMC(Y) - stepperY.push(); - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.push(); - #endif - #if AXIS_IS_TMC(Z) - stepperZ.push(); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.push(); - #endif - #if AXIS_IS_TMC(E0) - stepperE0.push(); - #endif - #if AXIS_IS_TMC(E1) - stepperE1.push(); - #endif - #if AXIS_IS_TMC(E2) - stepperE2.push(); - #endif - #if AXIS_IS_TMC(E3) - stepperE3.push(); - #endif - #if AXIS_IS_TMC(E4) - stepperE4.push(); - #endif -} - -void reset_stepper_drivers() { - #if HAS_DRIVER(TMC26X) - tmc26x_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2130) - delay(100); - tmc2130_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2208) - delay(100); - tmc2208_init_to_defaults(); - #endif - #ifdef TMC_ADV - TMC_ADV() - #endif - #if HAS_DRIVER(L6470) - L6470_init_to_defaults(); - #endif -} - -// -// L6470 Driver objects and inits -// -#if HAS_DRIVER(L6470) - - #include - #include - - #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_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(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 - - #define _L6470_INIT(A) do{ \ - stepper##A.init(); \ - stepper##A.softFree(); \ - stepper##A.setMicroSteps(A##_MICROSTEPS); \ - stepper##A.setOverCurrent(A##_OVERCURRENT); \ - stepper##A.setStallCurrent(A##_STALLCURRENT); \ - }while(0) - - void L6470_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, L6470) - _L6470_INIT(X); - #endif - #if AXIS_DRIVER_TYPE(X2, L6470) - _L6470_INIT(X2); - #endif - #if AXIS_DRIVER_TYPE(Y, L6470) - _L6470_INIT(Y); - #endif - #if AXIS_DRIVER_TYPE(Y2, L6470) - _L6470_INIT(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z, L6470) - _L6470_INIT(Z); - #endif - #if AXIS_DRIVER_TYPE(Z2, L6470) - _L6470_INIT(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, L6470) - _L6470_INIT(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, L6470) - _L6470_INIT(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, L6470) - _L6470_INIT(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, L6470) - _L6470_INIT(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, L6470) - _L6470_INIT(E4); - #endif - } - -#endif // L6470 diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h deleted file mode 100644 index 54a17c51e1..0000000000 --- a/Marlin/stepper_indirection.h +++ /dev/null @@ -1,499 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper_indirection.h - stepper motor driver indirection macros - * to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation - * Part of Marlin - * - * Copyright (c) 2015 Dominik Wenger - * - * Marlin 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. - * - * Marlin 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 Marlin. If not, see . - */ - -#ifndef STEPPER_INDIRECTION_H -#define STEPPER_INDIRECTION_H - -#include "MarlinConfig.h" - -// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if HAS_DRIVER(TMC26X) - #include - #include - void tmc26x_init_to_defaults(); -#endif - -#if HAS_DRIVER(TMC2130) - #include - void tmc2130_init_to_defaults(); -#endif - -#if HAS_DRIVER(TMC2208) - #include - void tmc2208_serial_begin(); - void tmc2208_init_to_defaults(); -#endif - -// L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) - #include - #include - void L6470_init_to_defaults(); -#endif - -void restore_stepper_drivers(); // Called by PSU_ON -void reset_stepper_drivers(); // Called by settings.load / settings.reset - -// X Stepper -#if AXIS_DRIVER_TYPE(X, L6470) - extern L6470 stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) do{ if (STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree(); }while(0) - #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) - #define X_DIR_INIT NOOP - #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) - #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(X, TMC2130) - extern TMC2130Stepper stepperX; - #elif AXIS_DRIVER_TYPE(X, TMC2208) - extern TMC2208Stepper stepperX; - #endif - #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) -#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) -#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) do{ if (STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree(); }while(0) - #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) - #define Y_DIR_INIT NOOP - #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) - #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(Y, TMC2130) - extern TMC2130Stepper stepperY; - #elif AXIS_DRIVER_TYPE(Y, TMC2208) - extern TMC2208Stepper stepperY; - #endif - #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) -#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) -#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) do{ if (STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree(); }while(0) - #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) - #define Z_DIR_INIT NOOP - #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) - #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(Z, TMC2130) - extern TMC2130Stepper stepperZ; - #elif AXIS_DRIVER_TYPE(Z, TMC2208) - extern TMC2208Stepper stepperZ; - #endif - #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) -#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) -#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) do{ if (STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree(); }while(0) - #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) - #define X2_DIR_INIT NOOP - #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) - #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(X2, TMC2130) - extern TMC2130Stepper stepperX2; - #elif AXIS_DRIVER_TYPE(X2, TMC2208) - extern TMC2208Stepper stepperX2; - #endif - #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) - #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) - #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) do{ if (STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree(); }while(0) - #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) - #define Y2_DIR_INIT NOOP - #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) - #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - extern TMC2130Stepper stepperY2; - #elif AXIS_DRIVER_TYPE(Y2, TMC2208) - extern TMC2208Stepper stepperY2; - #endif - #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) - #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) - #define Y2_STEP_READ READ(Y2_STEP_PIN) -#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) do{ if (STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree(); }while(0) - #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) - #define Z2_DIR_INIT NOOP - #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) - #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - extern TMC2130Stepper stepperZ2; - #elif AXIS_DRIVER_TYPE(Z2, TMC2208) - extern TMC2208Stepper stepperZ2; - #endif - #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) - #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) - #define Z2_STEP_READ READ(Z2_STEP_PIN) -#endif - -// E0 Stepper -#if AXIS_DRIVER_TYPE(E0, L6470) - extern L6470 stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) do{ if (STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree(); }while(0) - #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) - #define E0_DIR_INIT NOOP - #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) - #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E0, TMC2130) - extern TMC2130Stepper stepperE0; - #elif AXIS_DRIVER_TYPE(E0, TMC2208) - extern TMC2208Stepper stepperE0; - #endif - #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) -#define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree(); }while(0) - #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) - #define E1_DIR_INIT NOOP - #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) - #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E1, TMC2130) - extern TMC2130Stepper stepperE1; - #elif AXIS_DRIVER_TYPE(E1, TMC2208) - extern TMC2208Stepper stepperE1; - #endif - #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) -#define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree(); }while(0) - #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) - #define E2_DIR_INIT NOOP - #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) - #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E2, TMC2130) - extern TMC2130Stepper stepperE2; - #elif AXIS_DRIVER_TYPE(E2, TMC2208) - extern TMC2208Stepper stepperE2; - #endif - #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) -#define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree(); }while(0) - #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) - #define E3_DIR_INIT NOOP - #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) - #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E3, TMC2130) - extern TMC2130Stepper stepperE3; - #elif AXIS_DRIVER_TYPE(E3, TMC2208) - extern TMC2208Stepper stepperE3; - #endif - #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) -#define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0) - #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) - #define E4_DIR_INIT NOOP - #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE) - #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E4, TMC2130) - extern TMC2130Stepper stepperE4; - #elif AXIS_DRIVER_TYPE(E4, TMC2208) - extern TMC2208Stepper stepperE4; - #endif - #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) -#define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) -#define E4_STEP_READ READ(E4_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 > 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(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 > 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) -#elif E_STEPPERS > 1 - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { E0_STEP_WRITE(V); E1_STEP_WRITE(V); } else if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else 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 (extruder_duplication_enabled) { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); } else if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_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 -#else - #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) -#endif - -#endif // STEPPER_INDIRECTION_H diff --git a/Marlin/stopwatch.cpp b/Marlin/stopwatch.cpp deleted file mode 100644 index e5bc015904..0000000000 --- a/Marlin/stopwatch.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "stopwatch.h" - -#include "Marlin.h" - -Stopwatch::State Stopwatch::state; -millis_t Stopwatch::accumulator; -millis_t Stopwatch::startTimestamp; -millis_t Stopwatch::stopTimestamp; - -bool Stopwatch::stop() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("stop")); - #endif - - if (isRunning() || isPaused()) { - state = STOPPED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::pause() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("pause")); - #endif - - if (isRunning()) { - state = PAUSED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::start() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("start")); - #endif - - if (!isRunning()) { - if (isPaused()) accumulator = duration(); - else reset(); - - state = RUNNING; - startTimestamp = millis(); - return true; - } - else return false; -} - -void Stopwatch::resume(const millis_t duration) { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("resume")); - #endif - - reset(); - if ((accumulator = duration)) state = RUNNING; -} - -void Stopwatch::reset() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("reset")); - #endif - - state = STOPPED; - startTimestamp = 0; - stopTimestamp = 0; - accumulator = 0; -} - -millis_t Stopwatch::duration() { - return ((isRunning() ? millis() : stopTimestamp) - - startTimestamp) / 1000UL + accumulator; -} - -#if ENABLED(DEBUG_STOPWATCH) - - void Stopwatch::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("Stopwatch::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } - -#endif diff --git a/Marlin/stopwatch.h b/Marlin/stopwatch.h deleted file mode 100644 index f5e04bbde8..0000000000 --- a/Marlin/stopwatch.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef STOPWATCH_H -#define STOPWATCH_H - -// Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) -//#define DEBUG_STOPWATCH - -#include "macros.h" -#include "types.h" - -/** - * @brief Stopwatch class - * @details This class acts as a timer proving stopwatch functionality including - * the ability to pause the running time counter. - */ -class Stopwatch { - private: - enum State : char { - STOPPED, - RUNNING, - PAUSED - }; - - static Stopwatch::State state; - static millis_t accumulator; - static millis_t startTimestamp; - static millis_t stopTimestamp; - - public: - /** - * @brief Initialize the stopwatch - */ - FORCE_INLINE static void init() { reset(); } - - /** - * @brief Stop the stopwatch - * @details Stop the running timer. Silently ignore the request if - * no timer is running. - * @return true on success - */ - static bool stop(); - - /** - * @brief Pause the stopwatch - * @details Pause the running timer, it will silently ignore the request if - * no timer is running. - * @return true on success - */ - static bool pause(); - - /** - * @brief Start the stopwatch - * @details Start the timer, it will silently ignore the request if the - * timer is already running. - * @return true on success - */ - static bool start(); - - /** - * @brief Resume the stopwatch - * @details Resume a timer from a given duration - */ - static void resume(const millis_t duration); - - /** - * @brief Reset the stopwatch - * @details Reset all settings to their default values. - */ - static void reset(); - - /** - * @brief Check if the timer is running - * @details Return true if the timer is currently running, false otherwise. - * @return true if stopwatch is running - */ - FORCE_INLINE static bool isRunning() { return state == RUNNING; } - - /** - * @brief Check if the timer is paused - * @details Return true if the timer is currently paused, false otherwise. - * @return true if stopwatch is paused - */ - FORCE_INLINE static bool isPaused() { return state == PAUSED; } - - /** - * @brief Get the running time - * @details Return the total number of seconds the timer has been running. - * @return the delta since starting the stopwatch - */ - static millis_t duration(); - - #ifdef DEBUG_STOPWATCH - - /** - * @brief Print a debug message - * @details Print a simple debug message "Stopwatch::function" - */ - static void debug(const char func[]); - - #endif -}; - -#endif // STOPWATCH_H diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp deleted file mode 100644 index 233397b3b8..0000000000 --- a/Marlin/temperature.cpp +++ /dev/null @@ -1,2451 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * temperature.cpp - temperature control - */ - -#include "Marlin.h" -#include "temperature.h" -#include "thermistortables.h" -#include "ultralcd.h" -#include "planner.h" -#include "language.h" -#include "printcounter.h" -#include "delay.h" -#include "endstops.h" -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "configuration_store.h" - #include "Buzzer.h" - #include "printcounter.h" - #include "power_loss_recovery.h" - extern Buzzer buzzer; - extern MarlinSettings settings; -#endif - -#if ENABLED(HEATER_0_USES_MAX6675) - #include "MarlinSPI.h" -#endif - -#if ENABLED(BABYSTEPPING) - #include "stepper.h" -#endif - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" -#endif - -#if HOTEND_USES_THERMISTOR - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; - static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; - #else - static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE); - static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN); - #endif -#endif - -Temperature thermalManager; - -/** - * Macros to include the heater id in temp errors. The compiler's dead-code - * elimination should (hopefully) optimize out the unused strings. - */ -#if HAS_HEATED_BED - #define TEMP_ERR_PSTR(MSG, E) \ - (E) == -1 ? PSTR(MSG ## _BED) : \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#else - #define TEMP_ERR_PSTR(MSG, E) \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#endif - -// public: - -float Temperature::current_temperature[HOTENDS] = { 0.0 }; -int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 }, - Temperature::target_temperature[HOTENDS] = { 0 }; - -#if ENABLED(AUTO_POWER_E_FANS) - int16_t Temperature::autofan_speed[HOTENDS] = { 0 }; -#endif - -#if HAS_HEATED_BED - float Temperature::current_temperature_bed = 0.0; - int16_t Temperature::current_temperature_bed_raw = 0, - Temperature::target_temperature_bed = 0; - uint8_t Temperature::soft_pwm_amount_bed; - #ifdef BED_MINTEMP - int16_t Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; - #endif - #ifdef BED_MAXTEMP - int16_t Temperature::bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; - #endif - #if WATCH_THE_BED - uint16_t Temperature::watch_target_bed_temp = 0; - millis_t Temperature::watch_bed_next_ms = 0; - #endif - #if ENABLED(PIDTEMPBED) - float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd, // Initialized by settings.load() - Temperature::temp_iState_bed = { 0 }, - Temperature::temp_dState_bed = { 0 }, - Temperature::pTerm_bed, - Temperature::iTerm_bed, - Temperature::dTerm_bed, - Temperature::pid_error_bed; - #else - millis_t Temperature::next_bed_check_ms; - #endif - uint16_t Temperature::raw_temp_bed_value = 0; - #if HEATER_IDLE_HANDLER - millis_t Temperature::bed_idle_timeout_ms = 0; - bool Temperature::bed_idle_timeout_exceeded = false; - #endif -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - float Temperature::current_temperature_chamber = 0.0; - int16_t Temperature::current_temperature_chamber_raw = 0; - uint16_t Temperature::raw_temp_chamber_value = 0; -#endif - -// Initialized by settings.load() -#if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - float Temperature::Kp[HOTENDS], Temperature::Ki[HOTENDS], Temperature::Kd[HOTENDS]; - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::Kc[HOTENDS]; - #endif - #else - float Temperature::Kp, Temperature::Ki, Temperature::Kd; - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::Kc; - #endif - #endif -#endif - -#if ENABLED(BABYSTEPPING) - volatile int Temperature::babystepsTodo[XYZ] = { 0 }; -#endif - -#if WATCH_HOTENDS - uint16_t Temperature::watch_target_temp[HOTENDS] = { 0 }; - millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 }; -#endif - -#if ENABLED(PREVENT_COLD_EXTRUSION) - bool Temperature::allow_cold_extrude = false; - int16_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - uint16_t Temperature::redundant_temperature_raw = 0; - float Temperature::redundant_temperature = 0.0; -#endif - -volatile bool Temperature::temp_meas_ready = false; - -#if ENABLED(PIDTEMP) - float Temperature::temp_iState[HOTENDS] = { 0 }, - Temperature::temp_dState[HOTENDS] = { 0 }, - Temperature::pTerm[HOTENDS], - Temperature::iTerm[HOTENDS], - Temperature::dTerm[HOTENDS]; - - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::cTerm[HOTENDS]; - long Temperature::last_e_position; - long Temperature::lpq[LPQ_MAX_LEN]; - int Temperature::lpq_ptr = 0; - #endif - - float Temperature::pid_error[HOTENDS]; - bool Temperature::pid_reset[HOTENDS]; -#endif - -uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 }; - -// Init min and max temp with extreme values to prevent false errors during startup -int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP, HEATER_4_RAW_LO_TEMP), - Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP, HEATER_4_RAW_HI_TEMP), - Temperature::minttemp[HOTENDS] = { 0 }, - Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); - -#ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; -#endif - -#ifdef MILLISECONDS_PREHEAT_TIME - 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 - -uint8_t Temperature::soft_pwm_amount[HOTENDS]; - -#if ENABLED(FAN_SOFT_PWM) - uint8_t Temperature::soft_pwm_amount_fan[FAN_COUNT], - 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 - -#if HEATER_IDLE_HANDLER - millis_t Temperature::heater_idle_timeout_ms[HOTENDS] = { 0 }; - bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false }; -#endif - -#if ENABLED(ADC_KEYPAD) - uint32_t Temperature::current_ADCKey_raw = 0; - uint8_t Temperature::ADCKey_count = 0; -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - int16_t Temperature::lpq_len; // Initialized in configuration_store -#endif - -#if HAS_PID_HEATING - - /** - * PID Autotuning (M303) - * - * Alternately heat and cool the nozzle, observing its behavior to - * determine the best PID values to achieve a stable temperature. - */ - void Temperature::PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { - float current = 0.0; - int cycles = 0; - bool heating = true; - - millis_t next_temp_ms = millis(), t1 = next_temp_ms, t2 = next_temp_ms; - long t_high = 0, t_low = 0; - - long bias, d; - float Ku, Tu, - workKp = 0, workKi = 0, workKd = 0, - max = 0, min = 10000; - - #if HAS_PID_FOR_BOTH - #define GHV(B,H) (hotend < 0 ? (B) : (H)) - #define SHV(S,B,H) if (hotend < 0) S##_bed = B; else S [hotend] = H; - #elif ENABLED(PIDTEMPBED) - #define GHV(B,H) B - #define SHV(S,B,H) (S##_bed = B) - #else - #define GHV(B,H) H - #define SHV(S,B,H) (S [hotend] = H) - #endif - - #if WATCH_THE_BED || WATCH_HOTENDS - #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) - #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) - #define GTV(B,H) (hotend < 0 ? (B) : (H)) - #elif HAS_TP_BED - #define GTV(B,H) (B) - #else - #define GTV(B,H) (H) - #endif - const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); - const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); - millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL; - float next_watch_temp = 0.0; - bool heated = false; - #endif - - #if HAS_AUTO_FAN - next_auto_fan_check_ms = next_temp_ms + 2500UL; - #endif - - #if ENABLED(PIDTEMP) - #define _TOP_HOTEND HOTENDS - 1 - #else - #define _TOP_HOTEND -1 - #endif - #if ENABLED(PIDTEMPBED) - #define _BOT_HOTEND -1 - #else - #define _BOT_HOTEND 0 - #endif - - if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); - return; - } - - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); - - disable_all_heaters(); // switch off all heaters. - - SHV(soft_pwm_amount, bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); - - wait_for_heatup = true; // Can be interrupted with M108 - - // PID Tuning loop - while (wait_for_heatup) { - - const millis_t ms = millis(); - - if (temp_meas_ready) { // temp sample ready - updateTemperaturesFromRawValues(); - - // Get the current temperature and constrain it - current = GHV(current_temperature_bed, current_temperature[hotend]); - NOLESS(max, current); - NOMORE(min, current); - - #if HAS_AUTO_FAN - if (ELAPSED(ms, next_auto_fan_check_ms)) { - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - if (heating && current > target) { - if (ELAPSED(ms, t2 + 5000UL)) { - heating = false; - SHV(soft_pwm_amount, (bias - d) >> 1, (bias - d) >> 1); - t1 = ms; - t_high = t1 - t2; - max = target; - } - } - - if (!heating && current < target) { - if (ELAPSED(ms, t1 + 5000UL)) { - heating = true; - t2 = ms; - t_low = t2 - t1; - if (cycles > 0) { - const long max_pow = GHV(MAX_BED_POWER, PID_MAX); - bias += (d * (t_high - t_low)) / (t_low + t_high); - bias = constrain(bias, 20, max_pow - 20); - d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - - SERIAL_PROTOCOLPAIR(MSG_BIAS, bias); - SERIAL_PROTOCOLPAIR(MSG_D, d); - SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); - SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); - if (cycles > 2) { - Ku = (4.0f * d) / (M_PI * (max - min) * 0.5f); - Tu = ((float)(t_low + t_high) * 0.001f); - SERIAL_PROTOCOLPAIR(MSG_KU, Ku); - SERIAL_PROTOCOLPAIR(MSG_TU, Tu); - workKp = 0.6f * Ku; - workKi = 2 * workKp / Tu; - workKd = workKp * Tu * 0.125f; - SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_PROTOCOLPAIR(MSG_KP, workKp); - SERIAL_PROTOCOLPAIR(MSG_KI, workKi); - SERIAL_PROTOCOLLNPAIR(MSG_KD, workKd); - /** - workKp = 0.33*Ku; - workKi = workKp/Tu; - workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" Some overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", workKp); - SERIAL_PROTOCOLPAIR(" Ki: ", workKi); - SERIAL_PROTOCOLPAIR(" Kd: ", workKd); - workKp = 0.2*Ku; - workKi = 2*workKp/Tu; - workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" No overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", workKp); - SERIAL_PROTOCOLPAIR(" Ki: ", workKi); - SERIAL_PROTOCOLPAIR(" Kd: ", workKd); - */ - } - } - SHV(soft_pwm_amount, (bias + d) >> 1, (bias + d) >> 1); - cycles++; - min = target; - } - } - } - - // Did the temperature overshoot very far? - #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 20 - #endif - if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH); - break; - } - - // Report heater states every 2 seconds - if (ELAPSED(ms, next_temp_ms)) { - #if HAS_TEMP_SENSOR - print_heaterstates(); - SERIAL_EOL(); - #endif - next_temp_ms = ms + 2000UL; - - // Make sure heating is actually working - #if WATCH_THE_BED || WATCH_HOTENDS - if ( - #if WATCH_THE_BED && WATCH_HOTENDS - true - #elif WATCH_HOTENDS - hotend >= 0 - #else - hotend < 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 - 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 - } - else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(hotend, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, hotend)); - } - else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(hotend, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, hotend)); - } - #endif - } // every 2 seconds - - // Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle - #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE - #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L - #endif - if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT); - break; - } - - if (cycles > ncycles) { - SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); - - #if HAS_PID_FOR_BOTH - const char* estring = GHV("bed", ""); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); SERIAL_EOL(); - #elif ENABLED(PIDTEMP) - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd); SERIAL_EOL(); - #else - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd); SERIAL_EOL(); - #endif - - #define _SET_BED_PID() do { \ - bedKp = workKp; \ - bedKi = scalePID_i(workKi); \ - bedKd = scalePID_d(workKd); \ - }while(0) - - #define _SET_EXTRUDER_PID() do { \ - PID_PARAM(Kp, hotend) = workKp; \ - PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ - PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ - updatePID(); }while(0) - - // Use the result? (As with "M303 U1") - if (set_result) { - #if HAS_PID_FOR_BOTH - if (hotend < 0) - _SET_BED_PID(); - else - _SET_EXTRUDER_PID(); - #elif ENABLED(PIDTEMP) - _SET_EXTRUDER_PID(); - #else - _SET_BED_PID(); - #endif - } - return; - } - lcd_update(); - } - disable_all_heaters(); - } - -#endif // HAS_PID_HEATING - -/** - * Class and Instance Methods - */ - -Temperature::Temperature() { } - -int Temperature::getHeaterPower(const int heater) { - return ( - #if HAS_HEATED_BED - heater < 0 ? soft_pwm_amount_bed : - #endif - soft_pwm_amount[heater] - ); -} - -#if HAS_AUTO_FAN - - void Temperature::checkExtruderAutoFans() { - static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN }; - static const uint8_t fanBit[] PROGMEM = { - 0, - AUTO_1_IS_0 ? 0 : 1, - AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 : 2, - AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3, - AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4, - AUTO_CHAMBER_IS_0 ? 0 : AUTO_CHAMBER_IS_1 ? 1 : AUTO_CHAMBER_IS_2 ? 2 : AUTO_CHAMBER_IS_3 ? 3 : AUTO_CHAMBER_IS_4 ? 4 : 5 - }; - uint8_t fanState = 0; - - HOTEND_LOOP() - if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[e])); - - #if HAS_TEMP_CHAMBER - if (current_temperature_chamber > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[5])); - #endif - - uint8_t fanDone = 0; - for (uint8_t f = 0; f < COUNT(fanPin); f++) { - const pin_t pin = - #ifdef ARDUINO - pgm_read_byte(&fanPin[f]) - #else - fanPin[f] - #endif - ; - const uint8_t bit = pgm_read_byte(&fanBit[f]); - if (pin >= 0 && !TEST(fanDone, bit)) { - uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0; - #if ENABLED(AUTO_POWER_E_FANS) - autofan_speed[f] = newFanSpeed; - #endif - // this idiom allows both digital and PWM fan outputs (see M42 handling). - digitalWrite(pin, newFanSpeed); - analogWrite(pin, newFanSpeed); - SBI(fanDone, bit); - } - } - } - -#endif // HAS_AUTO_FAN - -// -// Temperature Error Handlers -// -void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) { - if (IsRunning()) { - SERIAL_ERROR_START(); - serialprintPGM(serial_msg); - SERIAL_ERRORPGM(MSG_STOPPED_HEATER); - if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED); - } - #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE) - static bool killed = false; - if (!killed) { - Running = false; - killed = true; - kill(lcd_msg); - } - else - disable_all_heaters(); // paranoia - #endif -} - -void Temperature::max_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, e)); -} - -void Temperature::min_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, e)); -} - -float Temperature::get_pid_output(const int8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #define _HOTEND_TEST true - #else - #define _HOTEND_TEST e == active_extruder - #endif - float pid_output; - #if ENABLED(PIDTEMP) - #if DISABLED(PID_OPENLOOP) - pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; - dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + float(PID_K1) * dTerm[HOTEND_INDEX]; - temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; - #if HEATER_IDLE_HANDLER - if (heater_idle_timeout_exceeded[HOTEND_INDEX]) { - pid_output = 0; - pid_reset[HOTEND_INDEX] = true; - } - else - #endif - if (pid_error[HOTEND_INDEX] > PID_FUNCTIONAL_RANGE) { - pid_output = BANG_MAX; - pid_reset[HOTEND_INDEX] = true; - } - else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0 - #if HEATER_IDLE_HANDLER - || heater_idle_timeout_exceeded[HOTEND_INDEX] - #endif - ) { - pid_output = 0; - pid_reset[HOTEND_INDEX] = true; - } - else { - if (pid_reset[HOTEND_INDEX]) { - temp_iState[HOTEND_INDEX] = 0.0; - pid_reset[HOTEND_INDEX] = false; - } - pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX]; - temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX]; - iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX]; - - pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX]; - - #if ENABLED(PID_EXTRUSION_SCALING) - cTerm[HOTEND_INDEX] = 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; - cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); - pid_output += cTerm[HOTEND_INDEX]; - } - #endif // PID_EXTRUSION_SCALING - - if (pid_output > PID_MAX) { - if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration - pid_output = PID_MAX; - } - else if (pid_output < 0) { - if (pid_error[HOTEND_INDEX] < 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration - pid_output = 0; - } - } - #else - pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX); - #endif // PID_OPENLOOP - - #if ENABLED(PID_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_PID_DEBUG, HOTEND_INDEX); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_OUTPUT, pid_output); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]); - #endif - SERIAL_EOL(); - #endif // PID_DEBUG - - #else /* PID off */ - #if HEATER_IDLE_HANDLER - if (heater_idle_timeout_exceeded[HOTEND_INDEX]) - pid_output = 0; - else - #endif - pid_output = (current_temperature[HOTEND_INDEX] < target_temperature[HOTEND_INDEX]) ? PID_MAX : 0; - #endif - - return pid_output; -} - -#if ENABLED(PIDTEMPBED) - float Temperature::get_pid_output_bed() { - float pid_output; - #if DISABLED(PID_OPENLOOP) - pid_error_bed = target_temperature_bed - current_temperature_bed; - pTerm_bed = bedKp * pid_error_bed; - temp_iState_bed += pid_error_bed; - iTerm_bed = bedKi * temp_iState_bed; - - dTerm_bed = PID_K2 * bedKd * (current_temperature_bed - temp_dState_bed) + PID_K1 * dTerm_bed; - temp_dState_bed = current_temperature_bed; - - pid_output = pTerm_bed + iTerm_bed - dTerm_bed; - if (pid_output > MAX_BED_POWER) { - if (pid_error_bed > 0) temp_iState_bed -= pid_error_bed; // conditional un-integration - pid_output = MAX_BED_POWER; - } - else if (pid_output < 0) { - if (pid_error_bed < 0) temp_iState_bed -= pid_error_bed; // conditional un-integration - pid_output = 0; - } - #else - pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER); - #endif // PID_OPENLOOP - - #if ENABLED(PID_BED_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(" PID_BED_DEBUG "); - SERIAL_ECHOPGM(": Input "); - SERIAL_ECHO(current_temperature_bed); - SERIAL_ECHOPGM(" Output "); - SERIAL_ECHO(pid_output); - SERIAL_ECHOPGM(" pTerm "); - SERIAL_ECHO(pTerm_bed); - SERIAL_ECHOPGM(" iTerm "); - SERIAL_ECHO(iTerm_bed); - SERIAL_ECHOPGM(" dTerm "); - SERIAL_ECHOLN(dTerm_bed); - #endif // PID_BED_DEBUG - - return pid_output; - } -#endif // PIDTEMPBED - -/** - * Manage heating activities for extruder hot-ends and a heated bed - * - Acquire updated temperature readings - * - Also resets the watchdog timer - * - Invoke thermal runaway protection - * - Manage extruder auto-fan - * - Apply filament width to the extrusion rate (may move) - * - Update the heated bed PID output value - */ -void Temperature::manage_heater() { - - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - static bool last_pause_state; - #endif - - #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(PSTR(MSG_KILLED)); - #endif - - if (!temp_meas_ready) return; - - updateTemperaturesFromRawValues(); // also resets the watchdog - - #if ENABLED(HEATER_0_USES_MAX6675) - if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); - if (current_temperature[0] < MAX(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0); - #endif - - #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER - millis_t ms = millis(); - #endif - - HOTEND_LOOP() { - - #if HEATER_IDLE_HANDLER - if (!heater_idle_timeout_exceeded[e] && heater_idle_timeout_ms[e] && ELAPSED(ms, heater_idle_timeout_ms[e])) - heater_idle_timeout_exceeded[e] = true; - #endif - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - // Check for thermal runaway - thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); - #endif - - soft_pwm_amount[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)get_pid_output(e) >> 1 : 0; - - #if WATCH_HOTENDS - // Make sure temperature is increasing - if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) { // Time to check this extruder? - if (degHotend(e) < watch_target_temp[e]) // Failed to increase enough? - _temp_error(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_heater(e); - } - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - // Make sure measured temperatures are close together - if (ABS(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) - _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); - #endif - - } // HOTEND_LOOP - - #if HAS_AUTO_FAN - if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Filament Width Sensor dynamically sets the volumetric multiplier - * based on a delayed measurement of the filament diameter. - */ - 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 - meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - planner.calculate_volumetric_for_width_sensor(measurement_delay[meas_shift_index]); - } - #endif // FILAMENT_WIDTH_SENSOR - - #if HAS_HEATED_BED - - #if WATCH_THE_BED - // Make sure temperature is increasing - if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) { // Time to check the bed? - if (degBed() < watch_target_bed_temp) // Failed to increase enough? - _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, -1)); - else // Start again if the target is still far off - start_watching_bed(); - } - #endif // WATCH_THE_BED - - #if DISABLED(PIDTEMPBED) - if (PENDING(ms, next_bed_check_ms) - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - && paused == last_pause_state - #endif - ) return; - next_bed_check_ms = ms + BED_CHECK_INTERVAL; - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - last_pause_state = paused; - #endif - #endif - - #if HEATER_IDLE_HANDLER - if (!bed_idle_timeout_exceeded && bed_idle_timeout_ms && ELAPSED(ms, bed_idle_timeout_ms)) - bed_idle_timeout_exceeded = true; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); - #endif - - #if HEATER_IDLE_HANDLER - if (bed_idle_timeout_exceeded) { - soft_pwm_amount_bed = 0; - #if DISABLED(PIDTEMPBED) - WRITE_HEATER_BED(LOW); - #endif - } - else - #endif - { - #if ENABLED(PIDTEMPBED) - soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; - #else - // Check if temperature is within the correct band - if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) { - #if ENABLED(BED_LIMIT_SWITCHING) - if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS) - soft_pwm_amount_bed = 0; - else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS)) - soft_pwm_amount_bed = MAX_BED_POWER >> 1; - #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - soft_pwm_amount_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; - #endif - } - else { - soft_pwm_amount_bed = 0; - WRITE_HEATER_BED(LOW); - } - #endif - } - #endif // HAS_HEATED_BED -} - -#define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) -#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) - -/** - * Bisect search for the range of the 'raw' value, then interpolate - * proportionally between the under and over values. - */ -#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ - uint8_t l = 0, r = LEN, m; \ - for (;;) { \ - m = (l + r) >> 1; \ - if (m == l || m == r) return (short)pgm_read_word(&TBL[LEN-1][1]); \ - short v00 = pgm_read_word(&TBL[m-1][0]), \ - v10 = pgm_read_word(&TBL[m-0][0]); \ - if (raw < v00) r = m; \ - else if (raw > v10) l = m; \ - else { \ - const short v01 = (short)pgm_read_word(&TBL[m-1][1]), \ - v11 = (short)pgm_read_word(&TBL[m-0][1]); \ - return v01 + (raw - v00) * float(v11 - v01) / float(v10 - v00); \ - } \ - } \ -}while(0) - -// Derived from RepRap FiveD extruder::getTemperature() -// For hot end temperature measurement. -float Temperature::analog2temp(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_ERROR((int)e); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM); - kill(PSTR(MSG_KILLED)); - return 0.0; - } - - switch (e) { - case 0: - #if 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_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_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_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_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_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 HAS_HEATED_BED - // Derived from RepRap FiveD extruder::getTemperature() - // For bed temperature measurement. - float Temperature::analog2tempBed(const int raw) { - #if ENABLED(HEATER_BED_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - // Derived from RepRap FiveD extruder::getTemperature() - // For chamber temperature measurement. - float Temperature::analog2tempChamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_TEMP_CHAMBER - -/** - * Get the raw values into the actual temperatures. - * The raw values are created in interrupt context, - * and this function is called from normal context - * as it would block the stepper routine. - */ -void Temperature::updateTemperaturesFromRawValues() { - #if ENABLED(HEATER_0_USES_MAX6675) - current_temperature_raw[0] = read_max6675(); - #endif - HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); - #if HAS_HEATED_BED - current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); - #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw); - #endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog2widthFil(); - #endif - - #if ENABLED(USE_WATCHDOG) - // Reset the watchdog after we know we have a temperature measurement. - watchdog_reset(); - #endif - - temp_meas_ready = false; -} - - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - // Convert raw Filament Width to millimeters - float Temperature::analog2widthFil() { - return current_raw_filwidth * 5.0f * (1.0f / 16383.0); - } - - /** - * 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 ENABLED(HEATER_0_USES_MAX6675) - #ifndef MAX6675_SCK_PIN - #define MAX6675_SCK_PIN SCK_PIN - #endif - #ifndef MAX6675_DO_PIN - #define MAX6675_DO_PIN MISO_PIN - #endif - SPI max6675_spi; -#endif - -/** - * Initialize the temperature manager - * The manager is implemented by periodic calls to manage_heater() - */ -void Temperature::init() { - - #if MB(RUMBA) && ( \ - ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595) || ENABLED(HEATER_4_USES_AD595) || ENABLED(HEATER_BED_USES_AD595) || ENABLED(HEATER_CHAMBER_USES_AD595) \ - || ENABLED(HEATER_0_USES_AD8495) || ENABLED(HEATER_1_USES_AD8495) || ENABLED(HEATER_2_USES_AD8495) || ENABLED(HEATER_3_USES_AD8495) || ENABLED(HEATER_4_USES_AD8495) || ENABLED(HEATER_BED_USES_AD8495) || ENABLED(HEATER_CHAMBER_USES_AD8495)) - // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector - MCUCR = _BV(JTD); - MCUCR = _BV(JTD); - #endif - - // Finish init of mult hotend arrays - HOTEND_LOOP() maxttemp[e] = maxttemp[0]; - - #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - - #if HAS_HEATER_0 - SET_OUTPUT(HEATER_0_PIN); - #endif - #if HAS_HEATER_1 - SET_OUTPUT(HEATER_1_PIN); - #endif - #if HAS_HEATER_2 - SET_OUTPUT(HEATER_2_PIN); - #endif - #if HAS_HEATER_3 - SET_OUTPUT(HEATER_3_PIN); - #endif - #if HAS_HEATER_4 - SET_OUTPUT(HEATER_3_PIN); - #endif - #if HAS_HEATED_BED - SET_OUTPUT(HEATER_BED_PIN); - #endif - - #if HAS_FAN0 - SET_OUTPUT(FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if HAS_FAN1 - SET_OUTPUT(FAN1_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if HAS_FAN2 - SET_OUTPUT(FAN2_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if ENABLED(HEATER_0_USES_MAX6675) - - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - - max6675_spi.init(); - - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS, HIGH); - - #endif // HEATER_0_USES_MAX6675 - - HAL_adc_init(); - - #if HAS_TEMP_ADC_0 - HAL_ANALOG_SELECT(TEMP_0_PIN); - #endif - #if HAS_TEMP_ADC_1 - HAL_ANALOG_SELECT(TEMP_1_PIN); - #endif - #if HAS_TEMP_ADC_2 - HAL_ANALOG_SELECT(TEMP_2_PIN); - #endif - #if HAS_TEMP_ADC_3 - HAL_ANALOG_SELECT(TEMP_3_PIN); - #endif - #if HAS_TEMP_ADC_4 - HAL_ANALOG_SELECT(TEMP_4_PIN); - #endif - #if HAS_HEATED_BED - HAL_ANALOG_SELECT(TEMP_BED_PIN); - #endif - #if HAS_TEMP_CHAMBER - HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - HAL_ANALOG_SELECT(FILWIDTH_PIN); - #endif - - HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); - ENABLE_TEMPERATURE_INTERRUPT(); - - #if HAS_AUTO_FAN_0 - #if E0_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E0_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E0_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E0_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_1 && !AUTO_1_IS_0 - #if E1_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E1_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E1_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E1_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_2 && !AUTO_2_IS_0 && !AUTO_2_IS_1 - #if E2_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E2_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E2_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E2_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_3 && !AUTO_3_IS_0 && !AUTO_3_IS_1 && !AUTO_3_IS_2 - #if E3_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E3_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E3_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E3_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_4 && !AUTO_4_IS_0 && !AUTO_4_IS_1 && !AUTO_4_IS_2 && !AUTO_4_IS_3 - #if E4_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E4_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E4_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E4_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_0 && !AUTO_CHAMBER_IS_1 && !AUTO_CHAMBER_IS_2 && !AUTO_CHAMBER_IS_3 && ! AUTO_CHAMBER_IS_4 - #if CHAMBER_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(CHAMBER_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #endif - #endif - - // Wait for temperature measurement to settle - delay(250); - - #define TEMP_MIN_ROUTINE(NR) \ - minttemp[NR] = HEATER_ ##NR## _MINTEMP; \ - while (analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \ - if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ - minttemp_raw[NR] += OVERSAMPLENR; \ - else \ - minttemp_raw[NR] -= OVERSAMPLENR; \ - } - #define TEMP_MAX_ROUTINE(NR) \ - maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \ - while (analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \ - if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ - maxttemp_raw[NR] -= OVERSAMPLENR; \ - else \ - maxttemp_raw[NR] += OVERSAMPLENR; \ - } - - #ifdef HEATER_0_MINTEMP - TEMP_MIN_ROUTINE(0); - #endif - #ifdef HEATER_0_MAXTEMP - TEMP_MAX_ROUTINE(0); - #endif - #if HOTENDS > 1 - #ifdef HEATER_1_MINTEMP - TEMP_MIN_ROUTINE(1); - #endif - #ifdef HEATER_1_MAXTEMP - TEMP_MAX_ROUTINE(1); - #endif - #if HOTENDS > 2 - #ifdef HEATER_2_MINTEMP - TEMP_MIN_ROUTINE(2); - #endif - #ifdef HEATER_2_MAXTEMP - TEMP_MAX_ROUTINE(2); - #endif - #if HOTENDS > 3 - #ifdef HEATER_3_MINTEMP - TEMP_MIN_ROUTINE(3); - #endif - #ifdef HEATER_3_MAXTEMP - TEMP_MAX_ROUTINE(3); - #endif - #if HOTENDS > 4 - #ifdef HEATER_4_MINTEMP - TEMP_MIN_ROUTINE(4); - #endif - #ifdef HEATER_4_MAXTEMP - TEMP_MAX_ROUTINE(4); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - #ifdef BED_MINTEMP - while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { - #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP - bed_minttemp_raw += OVERSAMPLENR; - #else - bed_minttemp_raw -= OVERSAMPLENR; - #endif - } - #endif // BED_MINTEMP - #ifdef BED_MAXTEMP - while (analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { - #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP - bed_maxttemp_raw -= OVERSAMPLENR; - #else - bed_maxttemp_raw += OVERSAMPLENR; - #endif - } - #endif // BED_MAXTEMP - #endif // HAS_HEATED_BED - - #if ENABLED(PROBING_HEATERS_OFF) - paused = false; - #endif -} - -#if ENABLED(FAST_PWM_FAN) - - void Temperature::setPwmFrequency(const pin_t pin, int val) { - val &= 0x07; - switch (digitalPinToTimer(pin)) { - #ifdef TCCR0A - #if !AVR_AT90USB1286_FAMILY - case TIMER0A: - #endif - case TIMER0B: //_SET_CS(0, val); - break; - #endif - #ifdef TCCR1A - case TIMER1A: case TIMER1B: //_SET_CS(1, val); - break; - #endif - #if defined(TCCR2) || defined(TCCR2A) - #ifdef TCCR2 - case TIMER2: - #endif - #ifdef TCCR2A - case TIMER2A: case TIMER2B: - #endif - _SET_CS(2, val); break; - #endif - #ifdef TCCR3A - case TIMER3A: case TIMER3B: case TIMER3C: _SET_CS(3, val); break; - #endif - #ifdef TCCR4A - case TIMER4A: case TIMER4B: case TIMER4C: _SET_CS(4, val); break; - #endif - #ifdef TCCR5A - case TIMER5A: case TIMER5B: case TIMER5C: _SET_CS(5, val); break; - #endif - } - } - -#endif // FAST_PWM_FAN - -#if WATCH_HOTENDS - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M104, M109) - */ - void Temperature::start_watching_heater(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { - watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE; - watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; - } - else - watch_heater_next_ms[HOTEND_INDEX] = 0; - } -#endif - -#if WATCH_THE_BED - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M140, M190) - */ - void Temperature::start_watching_bed() { - if (degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { - watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE; - watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL; - } - else - watch_bed_next_ms = 0; - } -#endif - -#if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - Temperature::TRState Temperature::thermal_runaway_state_machine[HOTENDS] = { TRInactive }; - millis_t Temperature::thermal_runaway_timer[HOTENDS] = { 0 }; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - Temperature::TRState Temperature::thermal_runaway_bed_state_machine = TRInactive; - millis_t Temperature::thermal_runaway_bed_timer; - #endif - - void Temperature::thermal_runaway_protection(Temperature::TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) { - - static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; - - /** - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: "); - if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHO(heater_id); - SERIAL_ECHOPAIR(" ; State:", *state); - SERIAL_ECHOPAIR(" ; Timer:", *timer); - SERIAL_ECHOPAIR(" ; Temperature:", current); - SERIAL_ECHOPAIR(" ; Target Temp:", target); - if (heater_id >= 0) - SERIAL_ECHOPAIR(" ; Idle Timeout:", heater_idle_timeout_exceeded[heater_id]); - else - SERIAL_ECHOPAIR(" ; Idle Timeout:", bed_idle_timeout_exceeded); - SERIAL_EOL(); - */ - - const int heater_index = heater_id >= 0 ? heater_id : HOTENDS; - - #if HEATER_IDLE_HANDLER - // If the heater idle timeout expires, restart - if ((heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) - #if HAS_HEATED_BED - || (heater_id < 0 && bed_idle_timeout_exceeded) - #endif - ) { - *state = TRInactive; - tr_target_temperature[heater_index] = 0; - } - else - #endif - { - // If the target temperature changes, restart - if (tr_target_temperature[heater_index] != target) { - tr_target_temperature[heater_index] = target; - *state = target > 0 ? TRFirstHeating : TRInactive; - } - } - - switch (*state) { - // Inactive state waits for a target temperature to be set - case TRInactive: break; - // When first heating, wait for the temperature to be reached then go to Stable state - case TRFirstHeating: - if (current < tr_target_temperature[heater_index]) break; - *state = TRStable; - // While the temperature is stable watch for a bad temperature - case TRStable: - if (current >= tr_target_temperature[heater_index] - hysteresis_degc) { - *timer = millis() + period_seconds * 1000UL; - break; - } - else if (PENDING(millis(), *timer)) break; - *state = TRRunaway; - case TRRunaway: - _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater_id)); - } - } - -#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED - -void Temperature::disable_all_heaters() { - - #if ENABLED(AUTOTEMP) - planner.autotemp_enabled = false; - #endif - - HOTEND_LOOP() setTargetHotend(0, e); - - #if HAS_HEATED_BED - setTargetBed(0); - #endif - - // Unpause and reset everything - #if ENABLED(PROBING_HEATERS_OFF) - pause(false); - #endif - - // If all heaters go down then for sure our print job has stopped - print_job_timer.stop(); - - #define DISABLE_HEATER(NR) { \ - setTargetHotend(0, NR); \ - soft_pwm_amount[NR] = 0; \ - WRITE_HEATER_ ##NR (LOW); \ - } - - #if HAS_TEMP_HOTEND - DISABLE_HEATER(0); - #if HOTENDS > 1 - DISABLE_HEATER(1); - #if HOTENDS > 2 - DISABLE_HEATER(2); - #if HOTENDS > 3 - DISABLE_HEATER(3); - #if HOTENDS > 4 - DISABLE_HEATER(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif - - #if HAS_HEATED_BED - target_temperature_bed = 0; - soft_pwm_amount_bed = 0; - #if HAS_HEATED_BED - WRITE_HEATER_BED(LOW); - #endif - #endif -} - -#if ENABLED(PROBING_HEATERS_OFF) - - void Temperature::pause(const bool p) { - if (p != paused) { - paused = p; - if (p) { - HOTEND_LOOP() start_heater_idle_timer(e, 0); // timeout immediately - #if HAS_HEATED_BED - start_bed_idle_timer(0); // timeout immediately - #endif - } - else { - HOTEND_LOOP() reset_heater_idle_timer(e); - #if HAS_HEATED_BED - reset_bed_idle_timer(); - #endif - } - } - } - -#endif // PROBING_HEATERS_OFF - -#if ENABLED(HEATER_0_USES_MAX6675) - - #define MAX6675_HEAT_INTERVAL 250u - - #if ENABLED(MAX6675_IS_MAX31855) - uint32_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 7 - #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS (_BV(SPR1)) // clock ÷ 64 - #else - uint16_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 4 - #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS (_BV(SPR0)) // clock ÷ 16 - #endif - - int Temperature::read_max6675() { - - static millis_t next_max6675_ms = 0; - - millis_t ms = millis(); - - if (PENDING(ms, next_max6675_ms)) return (int)max6675_temp; - - next_max6675_ms = ms + MAX6675_HEAT_INTERVAL; - - CBI( - #ifdef PRR - PRR - #elif defined(PRR0) - PRR0 - #endif - , PRSPI); - SPCR = _BV(MSTR) | _BV(SPE) | MAX6675_SPEED_BITS; - - WRITE(MAX6675_SS, 0); // enable TT_MAX6675 - - DELAY_NS(100); // Ensure 100ns delay - - // Read a big-endian temperature value - max6675_temp = 0; - for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= max6675_spi.receive(); - if (i > 0) max6675_temp <<= 8; // shift left if not the last byte - } - - WRITE(MAX6675_SS, 1); // disable TT_MAX6675 - - if (max6675_temp & MAX6675_ERROR_MASK) { - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("Temp measurement error! "); - #if MAX6675_ERROR_MASK == 7 - SERIAL_ERRORPGM("MAX31855 "); - if (max6675_temp & 1) - SERIAL_ERRORLNPGM("Open Circuit"); - else if (max6675_temp & 2) - SERIAL_ERRORLNPGM("Short to GND"); - else if (max6675_temp & 4) - SERIAL_ERRORLNPGM("Short to VCC"); - #else - SERIAL_ERRORLNPGM("MAX6675"); - #endif - max6675_temp = MAX6675_TMAX * 4; // thermocouple open - } - else - max6675_temp >>= MAX6675_DISCARD_BITS; - #if ENABLED(MAX6675_IS_MAX31855) - // Support negative temperature - if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; - #endif - - return (int)max6675_temp; - } - -#endif // HEATER_0_USES_MAX6675 - -/** - * Get raw temperatures - */ -void Temperature::set_current_temp_raw() { - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) - current_temperature_raw[0] = raw_temp_value[0]; - #endif - #if HAS_TEMP_ADC_1 - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - redundant_temperature_raw = raw_temp_value[1]; - #else - current_temperature_raw[1] = raw_temp_value[1]; - #endif - #if HAS_TEMP_ADC_2 - current_temperature_raw[2] = raw_temp_value[2]; - #if HAS_TEMP_ADC_3 - current_temperature_raw[3] = raw_temp_value[3]; - #if HAS_TEMP_ADC_4 - current_temperature_raw[4] = raw_temp_value[4]; - #endif - #endif - #endif - #endif - - #if HAS_HEATED_BED - current_temperature_bed_raw = raw_temp_bed_value; - #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber_raw = raw_temp_chamber_value; - #endif - temp_meas_ready = true; -} - -#if ENABLED(PINS_DEBUGGING) - /** - * monitors endstops & Z probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - * - */ - void endstop_monitor() { - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); - #endif - #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); - #endif - #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); - #endif - #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); - #endif - #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); - #endif - #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); - #endif - #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); - #endif - #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - - if (endstop_change) { - #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(live_state_local, X_MIN)); - #endif - #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(live_state_local, X_MAX)); - #endif - #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(live_state_local, Y_MIN)); - #endif - #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(live_state_local, Y_MAX)); - #endif - #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(live_state_local, Z_MIN)); - #endif - #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(live_state_local, Z_MAX)); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(live_state_local, Z_MIN_PROBE)); - #endif - #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(live_state_local, Z2_MIN)); - #endif - #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(live_state_local, Z2_MAX)); - #endif - SERIAL_PROTOCOLPGM("\n\n"); - analogWrite(LED_PIN, local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } -#endif // PINS_DEBUGGING - -void Temperature::readings_ready() { - // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); - - // 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 - #endif - - ZERO(raw_temp_value); - - #if HAS_HEATED_BED - raw_temp_bed_value = 0; - #endif - - #if HAS_TEMP_CHAMBER - raw_temp_chamber_value = 0; - #endif - - #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) - - int constexpr temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - , TEMPDIR(1) - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; - - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; - const bool heater_on = 0 < - #if ENABLED(PIDTEMP) - soft_pwm_amount[e] - #else - target_temperature[e] - #endif - ; - if (rawtemp > maxttemp_raw[e] * tdir && heater_on) max_temp_error(e); - if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error(e); - } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; - #endif - } - - #if HAS_HEATED_BED - #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP - #define GEBED <= - #else - #define GEBED >= - #endif - const bool bed_on = 0 < - #if ENABLED(PIDTEMPBED) - soft_pwm_amount_bed - #else - target_temperature_bed - #endif - ; - if (current_temperature_bed_raw GEBED bed_maxttemp_raw && bed_on) max_temp_error(-1); - if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); - #endif -} - -/** - * Timer 0 is shared with millies so don't change the prescaler. - * - * This ISR uses the compare method so it runs at the base - * frequency (16 MHz / 64 / 256 = 976.5625 Hz), but at the TCNT0 set - * in OCR0B above (128 or halfway between OVFs). - * - * - Manage PWM to all the heaters and fan - * - Prepare or Measure one of the raw ADC sensor values - * - Check new temperature values for MIN/MAX errors (kill on error) - * - Step the babysteps value for each axis towards 0 - * - For PINS_DEBUGGING, monitor and report endstop pins - * - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged - * - Call planner.tick to count down its "ignore" time - */ -HAL_TEMP_TIMER_ISR { - HAL_timer_isr_prologue(TEMP_TIMER_NUM); - - Temperature::isr(); - - HAL_timer_isr_epilogue(TEMP_TIMER_NUM); -} - -void Temperature::isr() { - - static int8_t temp_count = -1; - static ADCSensorState adc_sensor_state = StartupDelay; - static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); - // avoid multiple loads of pwm_count - uint8_t pwm_count_tmp = pwm_count; - #if ENABLED(ADC_KEYPAD) - static unsigned int raw_ADCKey_value = 0; - #endif - -#if POWER_LOSS_RECOVER_SUPER_CAP - char tmp_d[32]; - static char test=0; - if((digitalRead(POWER_LOSS_DETECT_PIN)==0)&&(recovery_detect_cap.file_name[0])&&(recovery_detect_cap.recovery==0)&&(print_job_timer.isRunning()==true))// power off - { - // SERIAL_ECHOLN("Down0"); - // enquecommand("M929"); - recovery_detect_cap.T0_t=thermalManager.degTargetHotend(0)+0.5; - recovery_detect_cap.B_t=thermalManager.degTargetBed()+0.5; - //////////// - thermalManager.disable_all_heaters(); - disable_all_steppers(); - ////////////// - recovery_detect_cap.Z_t=LOGICAL_Z_POSITION(current_position[Z_AXIS])*10; - recovery_detect_cap.E_t=current_position[E_AXIS]; - recovery_detect_cap.pos_t=card.getStatus(); - recovery_detect_cap.recovery=3; - // sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),Z_t,E_t,pos_t,T0_t,B_t); - // SERIAL_ECHOLN(tmp_d); - - //settings.save(); - settings.power_lose_save(); - SERIAL_ECHOLN("save ok"); - // settings.load(); - - sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),recovery_detect_cap.Z_t,recovery_detect_cap.E_t,recovery_detect_cap.pos_t,recovery_detect_cap.T0_t,recovery_detect_cap.B_t); - SERIAL_ECHOLN(tmp_d); - sprintf_P(tmp_d,PSTR("%s, save end--------"),recovery_detect_cap.file_name); - SERIAL_ECHOLN(tmp_d); -#if ENABLED(USE_WATCHDOG) - while(1); -#endif - } -#endif - - - - // Static members for each heater - #if ENABLED(SLOW_PWM_HEATERS) - static uint8_t slow_pwm_count = 0; - #define ISR_STATICS(n) \ - static uint8_t soft_pwm_count_ ## n, \ - state_heater_ ## n = 0, \ - state_timer_heater_ ## n = 0 - #else - #define ISR_STATICS(n) static uint8_t soft_pwm_count_ ## n = 0 - #endif - - // Statics per heater - ISR_STATICS(0); - #if HOTENDS > 1 - ISR_STATICS(1); - #if HOTENDS > 2 - ISR_STATICS(2); - #if HOTENDS > 3 - ISR_STATICS(3); - #if HOTENDS > 4 - ISR_STATICS(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - ISR_STATICS(BED); - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static unsigned long raw_filwidth_value = 0; - #endif - - #if DISABLED(SLOW_PWM_HEATERS) - constexpr uint8_t pwm_mask = - #if ENABLED(SOFT_PWM_DITHER) - _BV(SOFT_PWM_SCALE) - 1 - #else - 0 - #endif - ; - - /** - * Standard PWM modulation - */ - if (pwm_count_tmp >= 127) { - pwm_count_tmp -= 127; - soft_pwm_count_0 = (soft_pwm_count_0 & pwm_mask) + soft_pwm_amount[0]; - WRITE_HEATER_0(soft_pwm_count_0 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 1 - soft_pwm_count_1 = (soft_pwm_count_1 & pwm_mask) + soft_pwm_amount[1]; - WRITE_HEATER_1(soft_pwm_count_1 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 2 - soft_pwm_count_2 = (soft_pwm_count_2 & pwm_mask) + soft_pwm_amount[2]; - WRITE_HEATER_2(soft_pwm_count_2 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 3 - soft_pwm_count_3 = (soft_pwm_count_3 & pwm_mask) + soft_pwm_amount[3]; - WRITE_HEATER_3(soft_pwm_count_3 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 4 - soft_pwm_count_4 = (soft_pwm_count_4 & pwm_mask) + soft_pwm_amount[4]; - WRITE_HEATER_4(soft_pwm_count_4 > pwm_mask ? HIGH : LOW); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - soft_pwm_count_BED = (soft_pwm_count_BED & pwm_mask) + soft_pwm_amount_bed; - WRITE_HEATER_BED(soft_pwm_count_BED > pwm_mask ? HIGH : LOW); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask) + (soft_pwm_amount_fan[0] >> 1); - WRITE_FAN(soft_pwm_count_fan[0] > pwm_mask ? HIGH : LOW); - #endif - #if HAS_FAN1 - soft_pwm_count_fan[1] = (soft_pwm_count_fan[1] & pwm_mask) + (soft_pwm_amount_fan[1] >> 1); - WRITE_FAN1(soft_pwm_count_fan[1] > pwm_mask ? HIGH : LOW); - #endif - #if HAS_FAN2 - soft_pwm_count_fan[2] = (soft_pwm_count_fan[2] & pwm_mask) + (soft_pwm_amount_fan[2] >> 1); - WRITE_FAN2(soft_pwm_count_fan[2] > pwm_mask ? HIGH : LOW); - #endif - #endif - } - else { - if (soft_pwm_count_0 <= pwm_count_tmp) WRITE_HEATER_0(LOW); - #if HOTENDS > 1 - if (soft_pwm_count_1 <= pwm_count_tmp) WRITE_HEATER_1(LOW); - #if HOTENDS > 2 - if (soft_pwm_count_2 <= pwm_count_tmp) WRITE_HEATER_2(LOW); - #if HOTENDS > 3 - if (soft_pwm_count_3 <= pwm_count_tmp) WRITE_HEATER_3(LOW); - #if HOTENDS > 4 - if (soft_pwm_count_4 <= pwm_count_tmp) WRITE_HEATER_4(LOW); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - if (soft_pwm_count_BED <= pwm_count_tmp) WRITE_HEATER_BED(LOW); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(LOW); - #endif - #endif - } - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - #else // SLOW_PWM_HEATERS - - /** - * SLOW PWM HEATERS - * - * For relay-driven heaters - */ - #ifndef MIN_STATE_TIME - #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds - #endif - - // Macros for Slow PWM timer logic - #define _SLOW_PWM_ROUTINE(NR, src) \ - soft_pwm_count_ ##NR = src; \ - if (soft_pwm_count_ ##NR > 0) { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 1; \ - WRITE_HEATER_ ##NR(1); \ - } \ - } \ - else { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 0; \ - WRITE_HEATER_ ##NR(0); \ - } \ - } - #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n]) - - #define PWM_OFF_ROUTINE(NR) \ - if (soft_pwm_count_ ##NR < slow_pwm_count) { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 0; \ - WRITE_HEATER_ ##NR (0); \ - } \ - } - - if (slow_pwm_count == 0) { - - SLOW_PWM_ROUTINE(0); - #if HOTENDS > 1 - SLOW_PWM_ROUTINE(1); - #if HOTENDS > 2 - SLOW_PWM_ROUTINE(2); - #if HOTENDS > 3 - SLOW_PWM_ROUTINE(3); - #if HOTENDS > 4 - SLOW_PWM_ROUTINE(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - _SLOW_PWM_ROUTINE(BED, soft_pwm_amount_bed); // BED - #endif - - } // slow_pwm_count == 0 - - PWM_OFF_ROUTINE(0); - #if HOTENDS > 1 - PWM_OFF_ROUTINE(1); - #if HOTENDS > 2 - PWM_OFF_ROUTINE(2); - #if HOTENDS > 3 - PWM_OFF_ROUTINE(3); - #if HOTENDS > 4 - PWM_OFF_ROUTINE(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - PWM_OFF_ROUTINE(BED); // BED - #endif - - #if ENABLED(FAN_SOFT_PWM) - if (pwm_count_tmp >= 127) { - pwm_count_tmp = 0; - #if HAS_FAN0 - soft_pwm_count_fan[0] = soft_pwm_amount_fan[0] >> 1; - WRITE_FAN(soft_pwm_count_fan[0] > 0 ? HIGH : LOW); - #endif - #if HAS_FAN1 - soft_pwm_count_fan[1] = soft_pwm_amount_fan[1] >> 1; - WRITE_FAN1(soft_pwm_count_fan[1] > 0 ? HIGH : LOW); - #endif - #if HAS_FAN2 - soft_pwm_count_fan[2] = soft_pwm_amount_fan[2] >> 1; - WRITE_FAN2(soft_pwm_count_fan[2] > 0 ? HIGH : LOW); - #endif - } - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(LOW); - #endif - #endif // FAN_SOFT_PWM - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - // increment slow_pwm_count only every 64th pwm_count, - // i.e. yielding a PWM frequency of 16/128 Hz (8s). - if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) { - slow_pwm_count++; - slow_pwm_count &= 0x7F; - - if (state_timer_heater_0 > 0) state_timer_heater_0--; - #if HOTENDS > 1 - if (state_timer_heater_1 > 0) state_timer_heater_1--; - #if HOTENDS > 2 - if (state_timer_heater_2 > 0) state_timer_heater_2--; - #if HOTENDS > 3 - if (state_timer_heater_3 > 0) state_timer_heater_3--; - #if HOTENDS > 4 - if (state_timer_heater_4 > 0) state_timer_heater_4--; - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - if (state_timer_heater_BED > 0) state_timer_heater_BED--; - #endif - } // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0 - - #endif // SLOW_PWM_HEATERS - - // - // Update lcd buttons 488 times per second - // - static bool do_buttons; - if ((do_buttons ^= true)) lcd_buttons_update(); - - /** - * One sensor is sampled on every other call of the ISR. - * Each sensor is read 16 (OVERSAMPLENR) times, taking the average. - * - * On each Prepare pass, ADC is started for a sensor pin. - * On the next pass, the ADC value is read and accumulated. - * - * This gives each ADC 0.9765ms to charge up. - */ - #define ACCUMULATE_ADC(var) do{ \ - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else var += HAL_READ_ADC(); \ - }while(0) - - ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; - - switch (adc_sensor_state) { - - case SensorsReady: { - // All sensors have been read. Stay in this state for a few - // ISRs to save on calls to temp update/checking code below. - constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; - static uint8_t delay_count = 0; - if (extra_loops > 0) { - if (delay_count == 0) delay_count = extra_loops; // Init this delay - if (--delay_count) // While delaying... - next_sensor_state = SensorsReady; // retain this state (else, next state will be 0) - break; - } - else { - adc_sensor_state = StartSampling; // Fall-through to start sampling - next_sensor_state = (ADCSensorState)(int(StartSampling) + 1); - } - } - - case StartSampling: // Start of sampling loops. Do updates/checks. - if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - temp_count = 0; - readings_ready(); - } - break; - - #if HAS_TEMP_ADC_0 - case PrepareTemp_0: - HAL_START_ADC(TEMP_0_PIN); - break; - case MeasureTemp_0: - ACCUMULATE_ADC(raw_temp_value[0]); - break; - #endif - - #if HAS_HEATED_BED - case PrepareTemp_BED: - HAL_START_ADC(TEMP_BED_PIN); - break; - case MeasureTemp_BED: - ACCUMULATE_ADC(raw_temp_bed_value); - break; - #endif - - #if HAS_TEMP_CHAMBER - case PrepareTemp_CHAMBER: - HAL_START_ADC(TEMP_CHAMBER_PIN); - break; - case MeasureTemp_CHAMBER: - ACCUMULATE_ADC(raw_temp_chamber_value); - break; - #endif - - #if HAS_TEMP_ADC_1 - case PrepareTemp_1: - HAL_START_ADC(TEMP_1_PIN); - break; - case MeasureTemp_1: - ACCUMULATE_ADC(raw_temp_value[1]); - break; - #endif - - #if HAS_TEMP_ADC_2 - case PrepareTemp_2: - HAL_START_ADC(TEMP_2_PIN); - break; - case MeasureTemp_2: - ACCUMULATE_ADC(raw_temp_value[2]); - break; - #endif - - #if HAS_TEMP_ADC_3 - case PrepareTemp_3: - HAL_START_ADC(TEMP_3_PIN); - break; - case MeasureTemp_3: - ACCUMULATE_ADC(raw_temp_value[3]); - break; - #endif - - #if HAS_TEMP_ADC_4 - case PrepareTemp_4: - HAL_START_ADC(TEMP_4_PIN); - break; - case MeasureTemp_4: - ACCUMULATE_ADC(raw_temp_value[4]); - break; - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - 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 += ((unsigned long)HAL_READ_ADC() << 7); // Add new ADC reading, scaled by 128 - } - break; - #endif - - #if ENABLED(ADC_KEYPAD) - 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 - else if (ADCKey_count < 16) { - raw_ADCKey_value = HAL_READ_ADC(); - if (raw_ADCKey_value > 900) { - //ADC Key release - ADCKey_count = 0; - current_ADCKey_raw = 0; - } - else { - current_ADCKey_raw += raw_ADCKey_value; - ADCKey_count++; - } - } - break; - #endif // ADC_KEYPAD - - case StartupDelay: break; - - } // switch(adc_sensor_state) - - // Go to the next state - adc_sensor_state = next_sensor_state; - - // - // Additional ~1KHz Tasks - // - - #if ENABLED(BABYSTEPPING) - LOOP_XYZ(axis) { - const int curTodo = babystepsTodo[axis]; // get rid of volatile for performance - if (curTodo) { - stepper.babystep((AxisEnum)axis, curTodo > 0); - if (curTodo > 0) babystepsTodo[axis]--; - else babystepsTodo[axis]++; - } - } - #endif // BABYSTEPPING - - // Poll endstops state, if required - endstops.poll(); - - // Periodically call the planner timer - planner.tick(); -} - -#if HAS_TEMP_SENSOR - - void print_heater_state(const float &c, const float &t, - #if ENABLED(SHOW_TEMP_ADC_VALUES) - const float r, - #endif - const int8_t e=-3 - ) { - #if !(HAS_HEATED_BED && HAS_TEMP_HOTEND && HAS_TEMP_CHAMBER) && HOTENDS <= 1 - UNUSED(e); - #endif - - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLCHAR( - #if HAS_TEMP_CHAMBER && HAS_HEATED_BED && HAS_TEMP_HOTEND - e == -2 ? 'C' : e == -1 ? 'B' : 'T' - #elif HAS_HEATED_BED && HAS_TEMP_HOTEND - e == -1 ? 'B' : 'T' - #elif HAS_TEMP_HOTEND - 'T' - #else - 'B' - #endif - ); - #if HOTENDS > 1 - if (e >= 0) SERIAL_PROTOCOLCHAR('0' + e); - #endif - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL(c); - SERIAL_PROTOCOLPAIR(" /" , t); - #if ENABLED(SHOW_TEMP_ADC_VALUES) - SERIAL_PROTOCOLPAIR(" (", r / OVERSAMPLENR); - SERIAL_PROTOCOLCHAR(')'); - #endif - delay(2); - } - - extern uint8_t target_extruder; - - void Temperature::print_heaterstates() { - #if HAS_TEMP_HOTEND - print_heater_state(degHotend(target_extruder), degTargetHotend(target_extruder) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(target_extruder) - #endif - ); - #endif - #if HAS_HEATED_BED - print_heater_state(degBed(), degTargetBed() - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawBedTemp() - #endif - , -1 // BED - ); - #endif - #if HAS_TEMP_CHAMBER - print_heater_state(degChamber(), 0 - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawChamberTemp() - #endif - , -2 // CHAMBER - ); - #endif - #if HOTENDS > 1 - HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(e) - #endif - , e - ); - #endif - SERIAL_PROTOCOLPGM(" @:"); - SERIAL_PROTOCOL(getHeaterPower(target_extruder)); - #if HAS_HEATED_BED - SERIAL_PROTOCOLPGM(" B@:"); - SERIAL_PROTOCOL(getHeaterPower(-1)); - #endif - #if HOTENDS > 1 - HOTEND_LOOP() { - SERIAL_PROTOCOLPAIR(" @", e); - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL(getHeaterPower(e)); - } - #endif - } - - #if ENABLED(AUTO_REPORT_TEMPERATURES) - - uint8_t Temperature::auto_report_temp_interval; - millis_t Temperature::next_temp_report_ms; - - void Temperature::auto_report_temperatures() { - if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) { - next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; - print_heaterstates(); - SERIAL_EOL(); - } - } - - #endif // AUTO_REPORT_TEMPERATURES - -#endif // HAS_TEMP_SENSOR diff --git a/Marlin/temperature.h b/Marlin/temperature.h deleted file mode 100644 index cc6df0bdf7..0000000000 --- a/Marlin/temperature.h +++ /dev/null @@ -1,655 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * temperature.h - temperature controller - */ - -#ifndef TEMPERATURE_H -#define TEMPERATURE_H - -#include "thermistortables.h" - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - #include "stepper.h" -#endif - -#ifndef SOFT_PWM_SCALE - #define SOFT_PWM_SCALE 0 -#endif - -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - -#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) - -#if HOTENDS == 1 - #define HOTEND_INDEX 0 -#else - #define HOTEND_INDEX e -#endif - -/** - * States for ADC reading in the ISR - */ -enum ADCSensorState : char { - StartSampling, - #if HAS_TEMP_ADC_0 - PrepareTemp_0, - MeasureTemp_0, - #endif - #if HAS_TEMP_ADC_1 - PrepareTemp_1, - MeasureTemp_1, - #endif - #if HAS_TEMP_ADC_2 - PrepareTemp_2, - MeasureTemp_2, - #endif - #if HAS_TEMP_ADC_3 - PrepareTemp_3, - MeasureTemp_3, - #endif - #if HAS_TEMP_ADC_4 - PrepareTemp_4, - MeasureTemp_4, - #endif - #if HAS_HEATED_BED - PrepareTemp_BED, - MeasureTemp_BED, - #endif - #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - Prepare_FILWIDTH, - Measure_FILWIDTH, - #endif - #if ENABLED(ADC_KEYPAD) - 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 -}; - -// Minimum number of Temperature::ISR loops between sensor readings. -// Multiplied by 16 (OVERSAMPLENR) to obtain the total time to -// get all oversampled sensor readings -#define MIN_ADC_ISR_LOOPS 10 - -#define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) - -#if HAS_PID_HEATING - #define PID_K2 (1.0f-PID_K1) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0f / 256.0f)) - - // Apply the scale factors to the PID values - #define scalePID_i(i) ( (i) * float(PID_dT) ) - #define unscalePID_i(i) ( (i) / float(PID_dT) ) - #define scalePID_d(d) ( (d) / float(PID_dT) ) - #define unscalePID_d(d) ( (d) * float(PID_dT) ) -#endif - -class Temperature { - - public: - - static float current_temperature[HOTENDS]; - static int16_t current_temperature_raw[HOTENDS], - target_temperature[HOTENDS]; - static uint8_t soft_pwm_amount[HOTENDS]; - - #if ENABLED(AUTO_POWER_E_FANS) - static int16_t autofan_speed[HOTENDS]; - #endif - - #if ENABLED(FAN_SOFT_PWM) - static uint8_t soft_pwm_amount_fan[FAN_COUNT], - soft_pwm_count_fan[FAN_COUNT]; - #endif - - #if ENABLED(PIDTEMP) - - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - - static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; - #if ENABLED(PID_EXTRUSION_SCALING) - static float Kc[HOTENDS]; - #endif - #define PID_PARAM(param, h) Temperature::param[h] - - #else - - static float Kp, Ki, Kd; - #if ENABLED(PID_EXTRUSION_SCALING) - static float Kc; - #endif - #define PID_PARAM(param, h) Temperature::param - - #endif // PID_PARAMS_PER_HOTEND - - #endif - - #if HAS_HEATED_BED - static float current_temperature_bed; - static int16_t current_temperature_bed_raw, target_temperature_bed; - static uint8_t soft_pwm_amount_bed; - #if ENABLED(PIDTEMPBED) - static float bedKp, bedKi, bedKd; - #endif - #endif - - #if ENABLED(BABYSTEPPING) - static volatile int babystepsTodo[3]; - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - static bool allow_cold_extrude; - static int16_t extrude_min_temp; - FORCE_INLINE static bool tooCold(const int16_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp; } - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degHotend(HOTEND_INDEX)); - } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degTargetHotend(HOTEND_INDEX)); - } - #else - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - #endif - - FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } - - private: - - static volatile bool temp_meas_ready; - static uint16_t raw_temp_value[MAX_EXTRUDERS]; - - #if WATCH_HOTENDS - static uint16_t watch_target_temp[HOTENDS]; - static millis_t watch_heater_next_ms[HOTENDS]; - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static uint16_t redundant_temperature_raw; - static float redundant_temperature; - #endif - - #if ENABLED(PIDTEMP) - static float temp_iState[HOTENDS], - temp_dState[HOTENDS], - pTerm[HOTENDS], - iTerm[HOTENDS], - dTerm[HOTENDS]; - - #if ENABLED(PID_EXTRUSION_SCALING) - static float cTerm[HOTENDS]; - static long last_e_position; - static long lpq[LPQ_MAX_LEN]; - static int lpq_ptr; - #endif - - static float pid_error[HOTENDS]; - static bool pid_reset[HOTENDS]; - #endif - - // Init min and max temp with extreme values to prevent false errors during startup - static int16_t minttemp_raw[HOTENDS], - maxttemp_raw[HOTENDS], - minttemp[HOTENDS], - maxttemp[HOTENDS]; - - #if HAS_HEATED_BED - static uint16_t raw_temp_bed_value; - #if WATCH_THE_BED - static uint16_t watch_target_bed_temp; - static millis_t watch_bed_next_ms; - #endif - #if ENABLED(PIDTEMPBED) - static float temp_iState_bed, - temp_dState_bed, - pTerm_bed, - iTerm_bed, - dTerm_bed, - pid_error_bed; - #else - static millis_t next_bed_check_ms; - #endif - #if HEATER_IDLE_HANDLER - static millis_t bed_idle_timeout_ms; - static bool bed_idle_timeout_exceeded; - #endif - #ifdef BED_MINTEMP - static int16_t bed_minttemp_raw; - #endif - #ifdef BED_MAXTEMP - static int16_t bed_maxttemp_raw; - #endif - #endif - - #if HAS_TEMP_CHAMBER - static uint16_t raw_temp_chamber_value; - static float current_temperature_chamber; - static int16_t current_temperature_chamber_raw; - #endif - - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - static uint8_t consecutive_low_temperature_error[HOTENDS]; - #endif - - #ifdef MILLISECONDS_PREHEAT_TIME - 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 - - #if HEATER_IDLE_HANDLER - static millis_t heater_idle_timeout_ms[HOTENDS]; - static bool heater_idle_timeout_exceeded[HOTENDS]; - #endif - - public: - #if ENABLED(ADC_KEYPAD) - static uint32_t current_ADCKey_raw; - static uint8_t ADCKey_count; - #endif - - #if ENABLED(PID_EXTRUSION_SCALING) - static int16_t lpq_len; - #endif - - /** - * Instance Methods - */ - - Temperature(); - - void init(); - - /** - * Static (class) methods - */ - static float analog2temp(const int raw, const uint8_t e); - - #if HAS_HEATED_BED - static float analog2tempBed(const int raw); - #endif - #if HAS_TEMP_CHAMBER - static float analog2tempChamber(const int raw); - #endif - - /** - * Called from the Temperature ISR - */ - static void readings_ready(); - static void isr(); - - /** - * Call periodically to manage heaters - */ - static void manage_heater() _O2; // Added _O2 to work around a compiler error - - /** - * Preheating hotends - */ - #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); - } - static void start_preheat_time(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; - } - static void reset_preheat_time(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - preheat_end_time[HOTEND_INDEX] = 0; - } - #else - #define is_preheating(n) (false) - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float analog2widthFil(); // 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) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return current_temperature[HOTEND_INDEX]; - } - - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return current_temperature_raw[HOTEND_INDEX]; - } - #endif - - FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX]; - } - - #if WATCH_HOTENDS - static void start_watching_heater(const uint8_t e = 0); - #endif - - static void setTargetHotend(const int16_t celsius, const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - #ifdef MILLISECONDS_PREHEAT_TIME - if (celsius == 0) - reset_preheat_time(HOTEND_INDEX); - else if (target_temperature[HOTEND_INDEX] == 0) - start_preheat_time(HOTEND_INDEX); - #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - target_temperature[HOTEND_INDEX] = celsius; - #if WATCH_HOTENDS - start_watching_heater(HOTEND_INDEX); - #endif - } - - FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] > current_temperature[HOTEND_INDEX]; - } - - FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] < current_temperature[HOTEND_INDEX]; - } - - #if HAS_HEATED_BED - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawBedTemp() { return current_temperature_bed_raw; } - #endif - FORCE_INLINE static float degBed() { return current_temperature_bed; } - FORCE_INLINE static int16_t degTargetBed() { return target_temperature_bed; } - FORCE_INLINE static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } - FORCE_INLINE static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } - - static void setTargetBed(const int16_t celsius) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - target_temperature_bed = - #ifdef BED_MAXTEMP - MIN(celsius, BED_MAXTEMP) - #else - celsius - #endif - ; - #if WATCH_THE_BED - start_watching_bed(); - #endif - } - - #if WATCH_THE_BED - static void start_watching_bed(); - #endif - #endif - - #if HAS_TEMP_CHAMBER - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawChamberTemp() { return current_temperature_chamber_raw; } - #endif - FORCE_INLINE static float degChamber() { return current_temperature_chamber; } - #endif - - FORCE_INLINE static bool wait_for_heating(const uint8_t e) { - return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; - } - - /** - * The software PWM power for a heater - */ - static int getHeaterPower(const int heater); - - /** - * Switch off all heaters, set all target temperatures to 0 - */ - static void disable_all_heaters(); - - /** - * Perform auto-tuning for hotend or bed in response to M303 - */ - #if HAS_PID_HEATING - static void PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result=false); - - /** - * Update the temp manager when PID values change - */ - #if ENABLED(PIDTEMP) - FORCE_INLINE static void updatePID() { - #if ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - } - #endif - - #endif - - #if ENABLED(BABYSTEPPING) - - static void babystep_axis(const AxisEnum axis, const int16_t distance) { - if (TEST(axis_known_position, axis)) { - #if IS_CORE - #if ENABLED(BABYSTEP_XY) - switch (axis) { - case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ - babystepsTodo[CORE_AXIS_1] += distance * 2; - babystepsTodo[CORE_AXIS_2] += distance * 2; - break; - case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ - babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); - babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); - break; - case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ - babystepsTodo[NORMAL_AXIS] += distance; - break; - } - #elif CORE_IS_XZ || CORE_IS_YZ - // Only Z stepping needs to be handled here - babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); - babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); - #else - babystepsTodo[Z_AXIS] += distance; - #endif - #else - babystepsTodo[axis] += distance; - #endif - } - } - - #endif // BABYSTEPPING - - #if ENABLED(PROBING_HEATERS_OFF) - static void pause(const bool p); - FORCE_INLINE static bool is_paused() { return paused; } - #endif - - #if HEATER_IDLE_HANDLER - - static void start_heater_idle_timer(const uint8_t e, const millis_t timeout_ms) { - #if HOTENDS == 1 - UNUSED(e); - #endif - heater_idle_timeout_ms[HOTEND_INDEX] = millis() + timeout_ms; - heater_idle_timeout_exceeded[HOTEND_INDEX] = false; - } - - static void reset_heater_idle_timer(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - heater_idle_timeout_ms[HOTEND_INDEX] = 0; - heater_idle_timeout_exceeded[HOTEND_INDEX] = false; - #if WATCH_HOTENDS - start_watching_heater(HOTEND_INDEX); - #endif - } - - FORCE_INLINE static bool is_heater_idle(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return heater_idle_timeout_exceeded[HOTEND_INDEX]; - } - - #if HAS_HEATED_BED - static void start_bed_idle_timer(const millis_t timeout_ms) { - bed_idle_timeout_ms = millis() + timeout_ms; - bed_idle_timeout_exceeded = false; - } - - static void reset_bed_idle_timer() { - bed_idle_timeout_ms = 0; - bed_idle_timeout_exceeded = false; - #if WATCH_THE_BED - start_watching_bed(); - #endif - } - - FORCE_INLINE static bool is_bed_idle() { return bed_idle_timeout_exceeded; } - #endif - - #endif // HEATER_IDLE_HANDLER - - #if HAS_TEMP_SENSOR - static void print_heaterstates(); - #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); - FORCE_INLINE void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_temp_interval = v; - next_temp_report_ms = millis() + 1000UL * v; - } - #endif - #endif - - private: - - #if ENABLED(FAST_PWM_FAN) - static void setPwmFrequency(const pin_t pin, int val); - #endif - - static void set_current_temp_raw(); - - static void updateTemperaturesFromRawValues(); - - #if ENABLED(HEATER_0_USES_MAX6675) - static int read_max6675(); - #endif - - static void checkExtruderAutoFans(); - - static float get_pid_output(const int8_t e); - - #if ENABLED(PIDTEMPBED) - static float get_pid_output_bed(); - #endif - - static void _temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg); - static void min_temp_error(const int8_t e); - static void max_temp_error(const int8_t e); - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED - - enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; - - static void thermal_runaway_protection(TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - static TRState thermal_runaway_state_machine[HOTENDS]; - static millis_t thermal_runaway_timer[HOTENDS]; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - static TRState thermal_runaway_bed_state_machine; - static millis_t thermal_runaway_bed_timer; - #endif - - #endif // THERMAL_PROTECTION - -}; - -extern Temperature thermalManager; - -#endif // TEMPERATURE_H diff --git a/Marlin/thermistornames.h b/Marlin/thermistornames.h deleted file mode 100644 index c26a1fe91c..0000000000 --- a/Marlin/thermistornames.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#undef THERMISTOR_NAME - -// Thermcouples -#if THERMISTOR_ID == -4 - #define THERMISTOR_NAME "AD8495" -#elif THERMISTOR_ID == -3 - #define THERMISTOR_NAME "MAX31855" -#elif THERMISTOR_ID == -2 - #define THERMISTOR_NAME "MAX6675" -#elif THERMISTOR_ID == -1 - #define THERMISTOR_NAME "AD595" - -// Standard thermistors -#elif THERMISTOR_ID == 1 - #define THERMISTOR_NAME "EPCOS 100K" -#elif THERMISTOR_ID == 2 - #define THERMISTOR_NAME "ATC 204GT-2" -#elif THERMISTOR_ID == 3 - #define THERMISTOR_NAME "Mendel-parts" -#elif THERMISTOR_ID == 4 - #define THERMISTOR_NAME "Generic 10K" -#elif THERMISTOR_ID == 5 - #define THERMISTOR_NAME "ATC 104GT-2" -#elif THERMISTOR_ID == 6 - #define THERMISTOR_NAME "EPCOS (alt)" -#elif THERMISTOR_ID == 7 - #define THERMISTOR_NAME "Honeywell 104LAG" -#elif THERMISTOR_ID == 71 - #define THERMISTOR_NAME "Honeywell 104LAF" -#elif THERMISTOR_ID == 8 - #define THERMISTOR_NAME "E3104FHT" -#elif THERMISTOR_ID == 9 - #define THERMISTOR_NAME "GE AL03006" -#elif THERMISTOR_ID == 10 - #define THERMISTOR_NAME "RS 198-961" -#elif THERMISTOR_ID == 11 - #define THERMISTOR_NAME "1% beta 3950" -#elif THERMISTOR_ID == 12 - #define THERMISTOR_NAME "Unknown" -#elif THERMISTOR_ID == 13 - #define THERMISTOR_NAME "Hisens" -#elif THERMISTOR_ID == 20 - #define THERMISTOR_NAME "PT100 UltiMB" -#elif THERMISTOR_ID == 60 - #define THERMISTOR_NAME "Makers Tool" -#elif THERMISTOR_ID == 70 - #define THERMISTOR_NAME "Hephestos 2" -#elif THERMISTOR_ID == 75 - #define THERMISTOR_NAME "MGB18" - -// Modified thermistors -#elif THERMISTOR_ID == 51 - #define THERMISTOR_NAME "EPCOS 1K" -#elif THERMISTOR_ID == 52 - #define THERMISTOR_NAME "ATC204GT-2 1K" -#elif THERMISTOR_ID == 55 - #define THERMISTOR_NAME "ATC104GT-2 1K" -#elif THERMISTOR_ID == 1047 - #define THERMISTOR_NAME "PT1000 4K7" -#elif THERMISTOR_ID == 1010 - #define THERMISTOR_NAME "PT1000 1K" -#elif THERMISTOR_ID == 147 - #define THERMISTOR_NAME "PT100 4K7" -#elif THERMISTOR_ID == 110 - #define THERMISTOR_NAME "PT100 1K" - -// High Temperature thermistors -#elif THERMISTOR_ID == 66 - #define THERMISTOR_NAME "Dyze 4.7M" - -// Dummies for dev testing -#elif THERMISTOR_ID == 998 - #define THERMISTOR_NAME "Dummy 1" -#elif THERMISTOR_ID == 999 - #define THERMISTOR_NAME "Dummy 2" - -#endif // THERMISTOR_ID diff --git a/Marlin/thermistortable_1.h b/Marlin/thermistortable_1.h deleted file mode 100644 index ea887952f5..0000000000 --- a/Marlin/thermistortable_1.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor -const short temptable_1[][2] PROGMEM = { - { OV( 23), 300 }, - { OV( 25), 295 }, - { OV( 27), 290 }, - { OV( 28), 285 }, - { OV( 31), 280 }, - { OV( 33), 275 }, - { OV( 35), 270 }, - { OV( 38), 265 }, - { OV( 41), 260 }, - { OV( 44), 255 }, - { OV( 48), 250 }, - { OV( 52), 245 }, - { OV( 56), 240 }, - { OV( 61), 235 }, - { OV( 66), 230 }, - { OV( 71), 225 }, - { OV( 78), 220 }, - { OV( 84), 215 }, - { OV( 92), 210 }, - { OV( 100), 205 }, - { OV( 109), 200 }, - { OV( 120), 195 }, - { OV( 131), 190 }, - { OV( 143), 185 }, - { OV( 156), 180 }, - { OV( 171), 175 }, - { OV( 187), 170 }, - { OV( 205), 165 }, - { OV( 224), 160 }, - { OV( 245), 155 }, - { OV( 268), 150 }, - { OV( 293), 145 }, - { OV( 320), 140 }, - { OV( 348), 135 }, - { OV( 379), 130 }, - { OV( 411), 125 }, - { OV( 445), 120 }, - { OV( 480), 115 }, - { OV( 516), 110 }, - { OV( 553), 105 }, - { OV( 591), 100 }, - { OV( 628), 95 }, - { OV( 665), 90 }, - { OV( 702), 85 }, - { OV( 737), 80 }, - { OV( 770), 75 }, - { OV( 801), 70 }, - { OV( 830), 65 }, - { OV( 857), 60 }, - { OV( 881), 55 }, - { OV( 903), 50 }, - { OV( 922), 45 }, - { OV( 939), 40 }, - { OV( 954), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin/thermistortable_10.h b/Marlin/thermistortable_10.h deleted file mode 100644 index b54425fff8..0000000000 --- a/Marlin/thermistortable_10.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, RS thermistor 198-961 -const short temptable_10[][2] PROGMEM = { - { OV( 1), 929 }, - { OV( 36), 299 }, - { OV( 71), 246 }, - { OV( 106), 217 }, - { OV( 141), 198 }, - { OV( 176), 184 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 154 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 91 }, - { OV( 701), 86 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin/thermistortable_1010.h b/Marlin/thermistortable_1010.h deleted file mode 100644 index 79a557954e..0000000000 --- a/Marlin/thermistortable_1010.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt1000 with 1k0 pullup -const short temptable_1010[][2] PROGMEM = { - PtLine( 0, 1000, 1000) - PtLine( 25, 1000, 1000) - PtLine( 50, 1000, 1000) - PtLine( 75, 1000, 1000) - PtLine(100, 1000, 1000) - PtLine(125, 1000, 1000) - PtLine(150, 1000, 1000) - PtLine(175, 1000, 1000) - PtLine(200, 1000, 1000) - PtLine(225, 1000, 1000) - PtLine(250, 1000, 1000) - PtLine(275, 1000, 1000) - PtLine(300, 1000, 1000) -}; diff --git a/Marlin/thermistortable_1047.h b/Marlin/thermistortable_1047.h deleted file mode 100644 index 01997abc3a..0000000000 --- a/Marlin/thermistortable_1047.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt1000 with 4k7 pullup -const short temptable_1047[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 1000, 4700) - PtLine( 50, 1000, 4700) - PtLine(100, 1000, 4700) - PtLine(150, 1000, 4700) - PtLine(200, 1000, 4700) - PtLine(250, 1000, 4700) - PtLine(300, 1000, 4700) -}; diff --git a/Marlin/thermistortable_11.h b/Marlin/thermistortable_11.h deleted file mode 100644 index eb8030697f..0000000000 --- a/Marlin/thermistortable_11.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, QU-BD silicone bed QWG-104F-3950 thermistor -const short temptable_11[][2] PROGMEM = { - { OV( 1), 938 }, - { OV( 31), 314 }, - { OV( 41), 290 }, - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 111), 215 }, - { OV( 121), 209 }, - { OV( 131), 204 }, - { OV( 141), 199 }, - { OV( 151), 195 }, - { OV( 161), 190 }, - { OV( 171), 187 }, - { OV( 181), 183 }, - { OV( 191), 179 }, - { OV( 201), 176 }, - { OV( 221), 170 }, - { OV( 241), 165 }, - { OV( 261), 160 }, - { OV( 281), 155 }, - { OV( 301), 150 }, - { OV( 331), 144 }, - { OV( 361), 139 }, - { OV( 391), 133 }, - { OV( 421), 128 }, - { OV( 451), 123 }, - { OV( 491), 117 }, - { OV( 531), 111 }, - { OV( 571), 105 }, - { OV( 611), 100 }, - { OV( 641), 95 }, - { OV( 681), 90 }, - { OV( 711), 85 }, - { OV( 751), 79 }, - { OV( 791), 72 }, - { OV( 811), 69 }, - { OV( 831), 65 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 901), 51 }, - { OV( 921), 45 }, - { OV( 941), 39 }, - { OV( 971), 28 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1021), -27 } -}; diff --git a/Marlin/thermistortable_110.h b/Marlin/thermistortable_110.h deleted file mode 100644 index 7a4c80df71..0000000000 --- a/Marlin/thermistortable_110.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt100 with 1k0 pullup -const short temptable_110[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 1000) - PtLine( 50, 100, 1000) - PtLine(100, 100, 1000) - PtLine(150, 100, 1000) - PtLine(200, 100, 1000) - PtLine(250, 100, 1000) - PtLine(300, 100, 1000) -}; diff --git a/Marlin/thermistortable_12.h b/Marlin/thermistortable_12.h deleted file mode 100644 index c05ba4077b..0000000000 --- a/Marlin/thermistortable_12.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4700 K, 4.7 kOhm pull-up, (personal calibration for Makibox hot bed) -const short temptable_12[][2] PROGMEM = { - { OV( 35), 180 }, // top rating 180C - { OV( 211), 140 }, - { OV( 233), 135 }, - { OV( 261), 130 }, - { OV( 290), 125 }, - { OV( 328), 120 }, - { OV( 362), 115 }, - { OV( 406), 110 }, - { OV( 446), 105 }, - { OV( 496), 100 }, - { OV( 539), 95 }, - { OV( 585), 90 }, - { OV( 629), 85 }, - { OV( 675), 80 }, - { OV( 718), 75 }, - { OV( 758), 70 }, - { OV( 793), 65 }, - { OV( 822), 60 }, - { OV( 841), 55 }, - { OV( 875), 50 }, - { OV( 899), 45 }, - { OV( 926), 40 }, - { OV( 946), 35 }, - { OV( 962), 30 }, - { OV( 977), 25 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1010), 0 }, - { OV(1023), -40 } -}; diff --git a/Marlin/thermistortable_13.h b/Marlin/thermistortable_13.h deleted file mode 100644 index b0bfd8aa62..0000000000 --- a/Marlin/thermistortable_13.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, Hisens thermistor -const short temptable_13[][2] PROGMEM = { - { OV( 20.04), 300 }, - { OV( 23.19), 290 }, - { OV( 26.71), 280 }, - { OV( 31.23), 270 }, - { OV( 36.52), 260 }, - { OV( 42.75), 250 }, - { OV( 50.68), 240 }, - { OV( 60.22), 230 }, - { OV( 72.03), 220 }, - { OV( 86.84), 210 }, - { OV(102.79), 200 }, - { OV(124.46), 190 }, - { OV(151.02), 180 }, - { OV(182.86), 170 }, - { OV(220.72), 160 }, - { OV(316.96), 140 }, - { OV(447.17), 120 }, - { OV(590.61), 100 }, - { OV(737.31), 80 }, - { OV(857.77), 60 }, - { OV(939.52), 40 }, - { OV(986.03), 20 }, - { OV(1008.7), 0 } -}; diff --git a/Marlin/thermistortable_147.h b/Marlin/thermistortable_147.h deleted file mode 100644 index 7e4a3b6fb6..0000000000 --- a/Marlin/thermistortable_147.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt100 with 4k7 pullup -const short temptable_147[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 4700) - PtLine( 50, 100, 4700) - PtLine(100, 100, 4700) - PtLine(150, 100, 4700) - PtLine(200, 100, 4700) - PtLine(250, 100, 4700) - PtLine(300, 100, 4700) -}; diff --git a/Marlin/thermistortable_15.h b/Marlin/thermistortable_15.h deleted file mode 100644 index 8e207cdca4..0000000000 --- a/Marlin/thermistortable_15.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - // 100k bed thermistor in JGAurora A5. Calibrated by Sam Pinches 21st Jan 2018 using cheap k-type thermocouple inserted into heater block, using TM-902C meter. -const short temptable_15[][2] PROGMEM = { - { OV( 31), 275 }, - { OV( 33), 270 }, - { OV( 35), 260 }, - { OV( 38), 253 }, - { OV( 41), 248 }, - { OV( 48), 239 }, - { OV( 56), 232 }, - { OV( 66), 222 }, - { OV( 78), 212 }, - { OV( 93), 206 }, - { OV( 106), 199 }, - { OV( 118), 191 }, - { OV( 130), 186 }, - { OV( 158), 176 }, - { OV( 187), 167 }, - { OV( 224), 158 }, - { OV( 270), 148 }, - { OV( 321), 137 }, - { OV( 379), 127 }, - { OV( 446), 117 }, - { OV( 518), 106 }, - { OV( 593), 96 }, - { OV( 668), 86 }, - { OV( 739), 76 }, - { OV( 767), 72 }, - { OV( 830), 62 }, - { OV( 902), 48 }, - { OV( 926), 45 }, - { OV( 955), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin/thermistortable_2.h b/Marlin/thermistortable_2.h deleted file mode 100644 index e747b2ffad..0000000000 --- a/Marlin/thermistortable_2.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// -// R25 = 200 kOhm, beta25 = 4338 K, 4.7 kOhm pull-up, ATC Semitec 204GT-2 -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// -const short temptable_2[][2] PROGMEM = { - { OV( 1), 848 }, - { OV( 30), 300 }, // top rating 300C - { OV( 34), 290 }, - { OV( 39), 280 }, - { OV( 46), 270 }, - { OV( 53), 260 }, - { OV( 63), 250 }, - { OV( 74), 240 }, - { OV( 87), 230 }, - { OV( 104), 220 }, - { OV( 124), 210 }, - { OV( 148), 200 }, - { OV( 176), 190 }, - { OV( 211), 180 }, - { OV( 252), 170 }, - { OV( 301), 160 }, - { OV( 357), 150 }, - { OV( 420), 140 }, - { OV( 489), 130 }, - { OV( 562), 120 }, - { OV( 636), 110 }, - { OV( 708), 100 }, - { OV( 775), 90 }, - { OV( 835), 80 }, - { OV( 884), 70 }, - { OV( 924), 60 }, - { OV( 955), 50 }, - { OV( 977), 40 }, - { OV( 993), 30 }, - { OV(1004), 20 }, - { OV(1012), 10 }, - { OV(1016), 0 } -}; diff --git a/Marlin/thermistortable_20.h b/Marlin/thermistortable_20.h deleted file mode 100644 index 1cd9480c80..0000000000 --- a/Marlin/thermistortable_20.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// PT100 with INA826 amp on Ultimaker v2.0 electronics -// The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. -// This does not match the normal thermistor behaviour so we need to set the following defines -#if THERMISTORHEATER_0 == 20 - #define HEATER_0_RAW_HI_TEMP 16383 - #define HEATER_0_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_1 == 20 - #define HEATER_1_RAW_HI_TEMP 16383 - #define HEATER_1_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_2 == 20 - #define HEATER_2_RAW_HI_TEMP 16383 - #define HEATER_2_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_3 == 20 - #define HEATER_3_RAW_HI_TEMP 16383 - #define HEATER_3_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_4 == 20 - #define HEATER_4_RAW_HI_TEMP 16383 - #define HEATER_4_RAW_LO_TEMP 0 -#endif -#if THERMISTORBED == 20 - #define HEATER_BED_RAW_HI_TEMP 16383 - #define HEATER_BED_RAW_LO_TEMP 0 -#endif -#if THERMISTORCHAMBER == 20 - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 -#endif -const short temptable_20[][2] PROGMEM = { - { OV( 0), 0 }, - { OV(227), 1 }, - { OV(236), 10 }, - { OV(245), 20 }, - { OV(253), 30 }, - { OV(262), 40 }, - { OV(270), 50 }, - { OV(279), 60 }, - { OV(287), 70 }, - { OV(295), 80 }, - { OV(304), 90 }, - { OV(312), 100 }, - { OV(320), 110 }, - { OV(329), 120 }, - { OV(337), 130 }, - { OV(345), 140 }, - { OV(353), 150 }, - { OV(361), 160 }, - { OV(369), 170 }, - { OV(377), 180 }, - { OV(385), 190 }, - { OV(393), 200 }, - { OV(401), 210 }, - { OV(409), 220 }, - { OV(417), 230 }, - { OV(424), 240 }, - { OV(432), 250 }, - { OV(440), 260 }, - { OV(447), 270 }, - { OV(455), 280 }, - { OV(463), 290 }, - { OV(470), 300 }, - { OV(478), 310 }, - { OV(485), 320 }, - { OV(493), 330 }, - { OV(500), 340 }, - { OV(507), 350 }, - { OV(515), 360 }, - { OV(522), 370 }, - { OV(529), 380 }, - { OV(537), 390 }, - { OV(544), 400 }, - { OV(614), 500 }, - { OV(681), 600 }, - { OV(744), 700 }, - { OV(805), 800 }, - { OV(862), 900 }, - { OV(917), 1000 }, - { OV(968), 1100 } -}; diff --git a/Marlin/thermistortable_3.h b/Marlin/thermistortable_3.h deleted file mode 100644 index a82a9b6ff9..0000000000 --- a/Marlin/thermistortable_3.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4120 K, 4.7 kOhm pull-up, mendel-parts -const short temptable_3[][2] PROGMEM = { - { OV( 1), 864 }, - { OV( 21), 300 }, - { OV( 25), 290 }, - { OV( 29), 280 }, - { OV( 33), 270 }, - { OV( 39), 260 }, - { OV( 46), 250 }, - { OV( 54), 240 }, - { OV( 64), 230 }, - { OV( 75), 220 }, - { OV( 90), 210 }, - { OV( 107), 200 }, - { OV( 128), 190 }, - { OV( 154), 180 }, - { OV( 184), 170 }, - { OV( 221), 160 }, - { OV( 265), 150 }, - { OV( 316), 140 }, - { OV( 375), 130 }, - { OV( 441), 120 }, - { OV( 513), 110 }, - { OV( 588), 100 }, - { OV( 734), 80 }, - { OV( 856), 60 }, - { OV( 938), 40 }, - { OV( 986), 20 }, - { OV(1008), 0 }, - { OV(1018), -20 } -}; diff --git a/Marlin/thermistortable_4.h b/Marlin/thermistortable_4.h deleted file mode 100644 index 6c3ea61709..0000000000 --- a/Marlin/thermistortable_4.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 10 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, Generic 10k thermistor -const short temptable_4[][2] PROGMEM = { - { OV( 1), 430 }, - { OV( 54), 137 }, - { OV( 107), 107 }, - { OV( 160), 91 }, - { OV( 213), 80 }, - { OV( 266), 71 }, - { OV( 319), 64 }, - { OV( 372), 57 }, - { OV( 425), 51 }, - { OV( 478), 46 }, - { OV( 531), 41 }, - { OV( 584), 35 }, - { OV( 637), 30 }, - { OV( 690), 25 }, - { OV( 743), 20 }, - { OV( 796), 14 }, - { OV( 849), 7 }, - { OV( 902), 0 }, - { OV( 955), -11 }, - { OV(1008), -35 } -}; diff --git a/Marlin/thermistortable_5.h b/Marlin/thermistortable_5.h deleted file mode 100644 index 7f654b1e63..0000000000 --- a/Marlin/thermistortable_5.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4267 K, 4.7 kOhm pull-up -// 100k ParCan thermistor (104GT-2) -// ATC Semitec 104GT-2 (Used in ParCan) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -const short temptable_5[][2] PROGMEM = { - { OV( 1), 713 }, - { OV( 17), 300 }, // top rating 300C - { OV( 20), 290 }, - { OV( 23), 280 }, - { OV( 27), 270 }, - { OV( 31), 260 }, - { OV( 37), 250 }, - { OV( 43), 240 }, - { OV( 51), 230 }, - { OV( 61), 220 }, - { OV( 73), 210 }, - { OV( 87), 200 }, - { OV( 106), 190 }, - { OV( 128), 180 }, - { OV( 155), 170 }, - { OV( 189), 160 }, - { OV( 230), 150 }, - { OV( 278), 140 }, - { OV( 336), 130 }, - { OV( 402), 120 }, - { OV( 476), 110 }, - { OV( 554), 100 }, - { OV( 635), 90 }, - { OV( 713), 80 }, - { OV( 784), 70 }, - { OV( 846), 60 }, - { OV( 897), 50 }, - { OV( 937), 40 }, - { OV( 966), 30 }, - { OV( 986), 20 }, - { OV(1000), 10 }, - { OV(1010), 0 } -}; diff --git a/Marlin/thermistortable_501.h b/Marlin/thermistortable_501.h deleted file mode 100644 index 512ac0d8d8..0000000000 --- a/Marlin/thermistortable_501.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// 100k Zonestar thermistor. Adjusted By Hally -const short temptable_501[][2] PROGMEM = { - {OV( 1), 713}, - {OV( 14), 300}, // Top rating 300C - {OV( 16), 290}, - {OV( 19), 280}, - {OV( 23), 270}, - {OV( 27), 260}, - {OV( 32), 250}, - {OV( 30), 240}, - {OV( 47), 230}, - {OV( 57), 220}, - {OV( 68), 210}, - {OV( 84), 200}, - {OV( 100), 190}, - {OV( 128), 180}, - {OV( 155), 170}, - {OV( 189), 160}, - {OV( 230), 150}, - {OV( 278), 140}, - {OV( 336), 130}, - {OV( 402), 120}, - {OV( 476), 110}, - {OV( 554), 100}, - {OV( 635), 90}, - {OV( 713), 80}, - {OV( 784), 70}, - {OV( 846), 60}, - {OV( 897), 50}, - {OV( 937), 40}, - {OV( 966), 30}, - {OV( 986), 20}, - {OV(1000), 10}, - {OV(1010), 0} -}; diff --git a/Marlin/thermistortable_51.h b/Marlin/thermistortable_51.h deleted file mode 100644 index 0746c70558..0000000000 --- a/Marlin/thermistortable_51.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 1 kOhm pull-up, -// 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: Twice the resolution and better linearity from 150C to 200C -const short temptable_51[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 190), 250 }, // top rating 250C - { OV( 203), 245 }, - { OV( 217), 240 }, - { OV( 232), 235 }, - { OV( 248), 230 }, - { OV( 265), 225 }, - { OV( 283), 220 }, - { OV( 302), 215 }, - { OV( 322), 210 }, - { OV( 344), 205 }, - { OV( 366), 200 }, - { OV( 390), 195 }, - { OV( 415), 190 }, - { OV( 440), 185 }, - { OV( 467), 180 }, - { OV( 494), 175 }, - { OV( 522), 170 }, - { OV( 551), 165 }, - { OV( 580), 160 }, - { OV( 609), 155 }, - { OV( 638), 150 }, - { OV( 666), 145 }, - { OV( 695), 140 }, - { OV( 722), 135 }, - { OV( 749), 130 }, - { OV( 775), 125 }, - { OV( 800), 120 }, - { OV( 823), 115 }, - { OV( 845), 110 }, - { OV( 865), 105 }, - { OV( 884), 100 }, - { OV( 901), 95 }, - { OV( 917), 90 }, - { OV( 932), 85 }, - { OV( 944), 80 }, - { OV( 956), 75 }, - { OV( 966), 70 }, - { OV( 975), 65 }, - { OV( 982), 60 }, - { OV( 989), 55 }, - { OV( 995), 50 }, - { OV(1000), 45 }, - { OV(1004), 40 }, - { OV(1007), 35 }, - { OV(1010), 30 }, - { OV(1013), 25 }, - { OV(1015), 20 }, - { OV(1017), 15 }, - { OV(1018), 10 }, - { OV(1019), 5 }, - { OV(1020), 0 }, - { OV(1021), -5 } -}; diff --git a/Marlin/thermistortable_52.h b/Marlin/thermistortable_52.h deleted file mode 100644 index 63b53e1a70..0000000000 --- a/Marlin/thermistortable_52.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 200 kOhm, beta25 = 4338 K, 1 kOhm pull-up, -// 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_52[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 125), 300 }, // top rating 300C - { OV( 142), 290 }, - { OV( 162), 280 }, - { OV( 185), 270 }, - { OV( 211), 260 }, - { OV( 240), 250 }, - { OV( 274), 240 }, - { OV( 312), 230 }, - { OV( 355), 220 }, - { OV( 401), 210 }, - { OV( 452), 200 }, - { OV( 506), 190 }, - { OV( 563), 180 }, - { OV( 620), 170 }, - { OV( 677), 160 }, - { OV( 732), 150 }, - { OV( 783), 140 }, - { OV( 830), 130 }, - { OV( 871), 120 }, - { OV( 906), 110 }, - { OV( 935), 100 }, - { OV( 958), 90 }, - { OV( 976), 80 }, - { OV( 990), 70 }, - { OV(1000), 60 }, - { OV(1008), 50 }, - { OV(1013), 40 }, - { OV(1017), 30 }, - { OV(1019), 20 }, - { OV(1021), 10 }, - { OV(1022), 0 } -}; diff --git a/Marlin/thermistortable_55.h b/Marlin/thermistortable_55.h deleted file mode 100644 index aa6677febe..0000000000 --- a/Marlin/thermistortable_55.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4267 K, 1 kOhm pull-up, -// 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_55[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 76), 300 }, - { OV( 87), 290 }, - { OV( 100), 280 }, - { OV( 114), 270 }, - { OV( 131), 260 }, - { OV( 152), 250 }, - { OV( 175), 240 }, - { OV( 202), 230 }, - { OV( 234), 220 }, - { OV( 271), 210 }, - { OV( 312), 200 }, - { OV( 359), 190 }, - { OV( 411), 180 }, - { OV( 467), 170 }, - { OV( 527), 160 }, - { OV( 590), 150 }, - { OV( 652), 140 }, - { OV( 713), 130 }, - { OV( 770), 120 }, - { OV( 822), 110 }, - { OV( 867), 100 }, - { OV( 905), 90 }, - { OV( 936), 80 }, - { OV( 961), 70 }, - { OV( 979), 60 }, - { OV( 993), 50 }, - { OV(1003), 40 }, - { OV(1010), 30 }, - { OV(1015), 20 }, - { OV(1018), 10 }, - { OV(1020), 0 } -}; diff --git a/Marlin/thermistortable_6.h b/Marlin/thermistortable_6.h deleted file mode 100644 index bb97267ba9..0000000000 --- a/Marlin/thermistortable_6.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 8.2 kOhm pull-up, 100k Epcos (?) thermistor -const short temptable_6[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 28), 250 }, // top rating 250C - { OV( 31), 245 }, - { OV( 35), 240 }, - { OV( 39), 235 }, - { OV( 42), 230 }, - { OV( 44), 225 }, - { OV( 49), 220 }, - { OV( 53), 215 }, - { OV( 62), 210 }, - { OV( 71), 205 }, // fitted graphically - { OV( 78), 200 }, // fitted graphically - { OV( 94), 190 }, - { OV( 102), 185 }, - { OV( 116), 170 }, - { OV( 143), 160 }, - { OV( 183), 150 }, - { OV( 223), 140 }, - { OV( 270), 130 }, - { OV( 318), 120 }, - { OV( 383), 110 }, - { OV( 413), 105 }, - { OV( 439), 100 }, - { OV( 484), 95 }, - { OV( 513), 90 }, - { OV( 607), 80 }, - { OV( 664), 70 }, - { OV( 781), 60 }, - { OV( 810), 55 }, - { OV( 849), 50 }, - { OV( 914), 45 }, - { OV( 914), 40 }, - { OV( 935), 35 }, - { OV( 954), 30 }, - { OV( 970), 25 }, - { OV( 978), 22 }, - { OV(1008), 3 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin/thermistortable_60.h b/Marlin/thermistortable_60.h deleted file mode 100644 index ab92406f46..0000000000 --- a/Marlin/thermistortable_60.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, -// Maker's Tool Works Kapton Bed Thermistor -// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 -// r0: 100000 -// t0: 25 -// r1: 0 (parallel with rTherm) -// r2: 4700 (series with rTherm) -// beta: 3950 -// min adc: 1 at 0.0048828125 V -// max adc: 1023 at 4.9951171875 V -const short temptable_60[][2] PROGMEM = { - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 131), 204 }, - { OV( 161), 190 }, - { OV( 191), 179 }, - { OV( 231), 167 }, - { OV( 271), 157 }, - { OV( 311), 148 }, - { OV( 351), 140 }, - { OV( 381), 135 }, - { OV( 411), 130 }, - { OV( 441), 125 }, - { OV( 451), 123 }, - { OV( 461), 122 }, - { OV( 471), 120 }, - { OV( 481), 119 }, - { OV( 491), 117 }, - { OV( 501), 116 }, - { OV( 511), 114 }, - { OV( 521), 113 }, - { OV( 531), 111 }, - { OV( 541), 110 }, - { OV( 551), 108 }, - { OV( 561), 107 }, - { OV( 571), 105 }, - { OV( 581), 104 }, - { OV( 591), 102 }, - { OV( 601), 101 }, - { OV( 611), 100 }, - { OV( 621), 98 }, - { OV( 631), 97 }, - { OV( 641), 95 }, - { OV( 651), 94 }, - { OV( 661), 92 }, - { OV( 671), 91 }, - { OV( 681), 90 }, - { OV( 691), 88 }, - { OV( 701), 87 }, - { OV( 711), 85 }, - { OV( 721), 84 }, - { OV( 731), 82 }, - { OV( 741), 81 }, - { OV( 751), 79 }, - { OV( 761), 77 }, - { OV( 771), 76 }, - { OV( 781), 74 }, - { OV( 791), 72 }, - { OV( 801), 71 }, - { OV( 811), 69 }, - { OV( 821), 67 }, - { OV( 831), 65 }, - { OV( 841), 63 }, - { OV( 851), 62 }, - { OV( 861), 60 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 891), 53 }, - { OV( 901), 51 }, - { OV( 911), 48 }, - { OV( 921), 45 }, - { OV( 931), 42 }, - { OV( 941), 39 }, - { OV( 951), 36 }, - { OV( 961), 32 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1008), 0 } -}; diff --git a/Marlin/thermistortable_66.h b/Marlin/thermistortable_66.h deleted file mode 100644 index 7fb9a2d20c..0000000000 --- a/Marlin/thermistortable_66.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor -const short temptable_66[][2] PROGMEM = { - { OV( 17.5), 850 }, - { OV( 17.9), 500 }, - { OV( 21.7), 480 }, - { OV( 26.6), 460 }, - { OV( 33.1), 440 }, - { OV( 41.0), 420 }, - { OV( 52.3), 400 }, - { OV( 67.7), 380 }, - { OV( 86.5), 360 }, - { OV( 112.0), 340 }, - { OV( 147.2), 320 }, - { OV( 194.0), 300 }, - { OV( 254.3), 280 }, - { OV( 330.2), 260 }, - { OV( 427.9), 240 }, - { OV( 533.4), 220 }, - { OV( 646.5), 200 }, - { OV( 754.4), 180 }, - { OV( 844.3), 160 }, - { OV( 911.7), 140 }, - { OV( 958.6), 120 }, - { OV( 988.8), 100 }, - { OV(1006.6), 80 }, - { OV(1015.8), 60 }, - { OV(1021.3), 30 }, - { OV(1023) - 1, 25}, - { OV( 1023), 20} -}; diff --git a/Marlin/thermistortable_7.h b/Marlin/thermistortable_7.h deleted file mode 100644 index 025c53ce97..0000000000 --- a/Marlin/thermistortable_7.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAG-J01 -const short temptable_7[][2] PROGMEM = { - { OV( 1), 941 }, - { OV( 19), 362 }, - { OV( 37), 299 }, // top rating 300C - { OV( 55), 266 }, - { OV( 73), 245 }, - { OV( 91), 229 }, - { OV( 109), 216 }, - { OV( 127), 206 }, - { OV( 145), 197 }, - { OV( 163), 190 }, - { OV( 181), 183 }, - { OV( 199), 177 }, - { OV( 217), 171 }, - { OV( 235), 166 }, - { OV( 253), 162 }, - { OV( 271), 157 }, - { OV( 289), 153 }, - { OV( 307), 149 }, - { OV( 325), 146 }, - { OV( 343), 142 }, - { OV( 361), 139 }, - { OV( 379), 135 }, - { OV( 397), 132 }, - { OV( 415), 129 }, - { OV( 433), 126 }, - { OV( 451), 123 }, - { OV( 469), 121 }, - { OV( 487), 118 }, - { OV( 505), 115 }, - { OV( 523), 112 }, - { OV( 541), 110 }, - { OV( 559), 107 }, - { OV( 577), 105 }, - { OV( 595), 102 }, - { OV( 613), 99 }, - { OV( 631), 97 }, - { OV( 649), 94 }, - { OV( 667), 92 }, - { OV( 685), 89 }, - { OV( 703), 86 }, - { OV( 721), 84 }, - { OV( 739), 81 }, - { OV( 757), 78 }, - { OV( 775), 75 }, - { OV( 793), 72 }, - { OV( 811), 69 }, - { OV( 829), 66 }, - { OV( 847), 62 }, - { OV( 865), 59 }, - { OV( 883), 55 }, - { OV( 901), 51 }, - { OV( 919), 46 }, - { OV( 937), 41 }, - { OV( 955), 35 }, - { OV( 973), 27 }, - { OV( 991), 17 }, - { OV(1009), 1 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin/thermistortable_70.h b/Marlin/thermistortable_70.h deleted file mode 100644 index 2f9434e300..0000000000 --- a/Marlin/thermistortable_70.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Stock BQ Hephestos 2 100k thermistor. -// Created on 29/12/2017 with an ambient temperature of 20C. -// ANENG AN8009 DMM with a K-type probe used for measurements. - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, bqh2 stock thermistor -const short temptable_70[][2] PROGMEM = { - { OV( 18), 270 }, - { OV( 27), 248 }, - { OV( 34), 234 }, - { OV( 45), 220 }, - { OV( 61), 205 }, - { OV( 86), 188 }, - { OV( 123), 172 }, - { OV( 420), 110 }, - { OV( 590), 90 }, - { OV( 845), 56 }, - { OV( 970), 25 }, - { OV( 986), 20 }, - { OV( 994), 15 }, - { OV(1000), 10 }, - { OV(1005), 5 }, - { OV(1009), 0 } // safety -}; diff --git a/Marlin/thermistortable_71.h b/Marlin/thermistortable_71.h deleted file mode 100644 index f28a4ceabb..0000000000 --- a/Marlin/thermistortable_71.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAF-J01 -// R0 = 100000 Ohm -// T0 = 25 °C -// Beta = 3974 -// R1 = 0 Ohm -// R2 = 4700 Ohm -const short temptable_71[][2] PROGMEM = { - { OV( 35), 300 }, - { OV( 51), 269 }, - { OV( 59), 258 }, - { OV( 64), 252 }, - { OV( 71), 244 }, - { OV( 81), 235 }, - { OV( 87), 230 }, - { OV( 92), 226 }, - { OV( 102), 219 }, - { OV( 110), 214 }, - { OV( 115), 211 }, - { OV( 126), 205 }, - { OV( 128), 204 }, - { OV( 130), 203 }, - { OV( 132), 202 }, - { OV( 134), 201 }, - { OV( 136), 200 }, - { OV( 147), 195 }, - { OV( 154), 192 }, - { OV( 159), 190 }, - { OV( 164), 188 }, - { OV( 172), 185 }, - { OV( 175), 184 }, - { OV( 178), 183 }, - { OV( 181), 182 }, - { OV( 184), 181 }, - { OV( 187), 180 }, - { OV( 190), 179 }, - { OV( 193), 178 }, - { OV( 196), 177 }, - { OV( 199), 176 }, - { OV( 202), 175 }, - { OV( 205), 174 }, - { OV( 208), 173 }, - { OV( 215), 171 }, - { OV( 237), 165 }, - { OV( 256), 160 }, - { OV( 300), 150 }, - { OV( 351), 140 }, - { OV( 470), 120 }, - { OV( 504), 115 }, - { OV( 538), 110 }, - { OV( 745), 80 }, - { OV( 770), 76 }, - { OV( 806), 70 }, - { OV( 829), 66 }, - { OV( 860), 60 }, - { OV( 879), 56 }, - { OV( 888), 54 }, - { OV( 905), 50 }, - { OV( 924), 45 }, - { OV( 940), 40 }, - { OV( 955), 35 }, - { OV( 972), 28 }, - { OV( 974), 27 }, - { OV( 976), 26 }, - { OV( 978), 25 }, - { OV( 980), 24 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1006), 5 }, - { OV(1010), 0 } -}; diff --git a/Marlin/thermistortable_75.h b/Marlin/thermistortable_75.h deleted file mode 100644 index dda764949f..0000000000 --- a/Marlin/thermistortable_75.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, -// Generic Silicon Heat Pad with NTC 100K thermistor -// -// Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor It is used for various -// wattage and voltage heat pads. This table is correct if this part is used. It has been -// optimized to provide good granularity around the 60 C. and 110 C. which corrisponds to bed temperatures -// for PLA and ABS. If you are printing higher temperature filament such as nylon you can uncomment -// the higher earlier entries in the table to give better accuracy. But for speed reasons, if these -// temperatures are not going to be used, it is better to leave them commented out. - -const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor - { OV( 111.06), 200 }, // v=0.542 r=571.747 res=0.501 degC/count -// { OV( 174.87), 175 }, // v=0.854 r=967.950 res=0.311 degC/count These values are valid. But they serve no -// { OV( 191.64), 170 }, // v=0.936 r=1082.139 res=0.284 degC/count purpose. It is better to delete them so -// { OV( 209.99), 165 }, // v=1.025 r=1212.472 res=0.260 degC/count the search is quicker and get to the meaningful -// { OV( 230.02), 160 }, // v=1.123 r=1361.590 res=0.239 degC/count part of the table sooner. -// { OV( 251.80), 155 }, // v=1.230 r=1532.621 res=0.220 degC/count - { OV( 275.43), 150 }, // v=1.345 r=1729.283 res=0.203 degC/count -// { OV( 300.92), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun - { 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/thermistortable_8.h b/Marlin/thermistortable_8.h deleted file mode 100644 index 3ef78da0c5..0000000000 --- a/Marlin/thermistortable_8.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 10 kOhm pull-up, NTCS0603E3104FHT -const short temptable_8[][2] PROGMEM = { - { OV( 1), 704 }, - { OV( 54), 216 }, - { OV( 107), 175 }, - { OV( 160), 152 }, - { OV( 213), 137 }, - { OV( 266), 125 }, - { OV( 319), 115 }, - { OV( 372), 106 }, - { OV( 425), 99 }, - { OV( 478), 91 }, - { OV( 531), 85 }, - { OV( 584), 78 }, - { OV( 637), 71 }, - { OV( 690), 65 }, - { OV( 743), 58 }, - { OV( 796), 50 }, - { OV( 849), 42 }, - { OV( 902), 31 }, - { OV( 955), 17 }, - { OV(1008), 0 } -}; diff --git a/Marlin/thermistortable_9.h b/Marlin/thermistortable_9.h deleted file mode 100644 index e9ef924d1f..0000000000 --- a/Marlin/thermistortable_9.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, GE Sensing AL03006-58.2K-97-G1 -const short temptable_9[][2] PROGMEM = { - { OV( 1), 936 }, - { OV( 36), 300 }, - { OV( 71), 246 }, - { OV( 106), 218 }, - { OV( 141), 199 }, - { OV( 176), 185 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 155 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 92 }, - { OV( 701), 87 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin/thermistortable_998.h b/Marlin/thermistortable_998.h deleted file mode 100644 index 66becc7029..0000000000 --- a/Marlin/thermistortable_998.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// User-defined table 1 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_998_VALUE - #define DUMMY_THERMISTOR_998_VALUE 25 -#endif - -const short temptable_998[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_998_VALUE }, - { OV(1023), DUMMY_THERMISTOR_998_VALUE } -}; diff --git a/Marlin/thermistortable_999.h b/Marlin/thermistortable_999.h deleted file mode 100644 index ea45952f60..0000000000 --- a/Marlin/thermistortable_999.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// User-defined table 2 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_999_VALUE - #define DUMMY_THERMISTOR_999_VALUE 25 -#endif - -const short temptable_999[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_999_VALUE }, - { OV(1023), DUMMY_THERMISTOR_999_VALUE } -}; diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h deleted file mode 100644 index a65d3eb501..0000000000 --- a/Marlin/thermistortables.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef THERMISTORTABLES_H_ -#define THERMISTORTABLES_H_ - -#include "Marlin.h" -#include "macros.h" - -#define OVERSAMPLENR 16 -#define OV(N) int16_t((N)*(OVERSAMPLENR)) - -#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n || THERMISTORCHAMBER == n) - -// Pt1000 and Pt100 handling -// -// Rt=R0*(1+a*T+b*T*T) [for T>0] -// a=3.9083E-3, b=-5.775E-7 -#define PtA 3.9083E-3 -#define PtB -5.775E-7 -#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T))) -#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1)) -#define PtLine(T,R0,Rup) { OV(PtAdVal(T,R0,Rup)), T }, - -#if ANY_THERMISTOR_IS(1) // 100k bed thermistor - #include "thermistortable_1.h" -#endif -#if ANY_THERMISTOR_IS(2) // 200k bed thermistor - #include "thermistortable_2.h" -#endif -#if ANY_THERMISTOR_IS(3) // mendel-parts - #include "thermistortable_3.h" -#endif -#if ANY_THERMISTOR_IS(4) // 10k thermistor - #include "thermistortable_4.h" -#endif -#if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2) - #include "thermistortable_5.h" -#endif -#if ANY_THERMISTOR_IS(501) // 100k Zonestar thermistor - #include "thermistortable_501.h" -#endif -#if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor - #include "thermistortable_6.h" -#endif -#if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01 - #include "thermistortable_7.h" -#endif -#if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01 - #include "thermistortable_71.h" -#endif -#if ANY_THERMISTOR_IS(8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) - #include "thermistortable_8.h" -#endif -#if ANY_THERMISTOR_IS(9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) - #include "thermistortable_9.h" -#endif -#if ANY_THERMISTOR_IS(10) // 100k RS thermistor 198-961 (4.7k pullup) - #include "thermistortable_10.h" -#endif -#if ANY_THERMISTOR_IS(11) // QU-BD silicone bed QWG-104F-3950 thermistor - #include "thermistortable_11.h" -#endif -#if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1% - #include "thermistortable_13.h" -#endif -#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration - #include "thermistortable_15.h" -#endif -#if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics - #include "thermistortable_20.h" -#endif -#if ANY_THERMISTOR_IS(51) // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_51.h" -#endif -#if ANY_THERMISTOR_IS(52) // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_52.h" -#endif -#if ANY_THERMISTOR_IS(55) // 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_55.h" -#endif -#if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor - #include "thermistortable_60.h" -#endif -#if ANY_THERMISTOR_IS(66) // DyzeDesign 500°C Thermistor - #include "thermistortable_66.h" -#endif -#if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) - #include "thermistortable_12.h" -#endif -#if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor - #include "thermistortable_70.h" -#endif -#if ANY_THERMISTOR_IS(75) // Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor - #include "thermistortable_75.h" -#endif -#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup - #include "thermistortable_110.h" -#endif -#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup - #include "thermistortable_147.h" -#endif -#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup - #include "thermistortable_1010.h" -#endif -#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup - #include "thermistortable_1047.h" -#endif -#if ANY_THERMISTOR_IS(998) // User-defined table 1 - #include "thermistortable_998.h" -#endif -#if ANY_THERMISTOR_IS(999) // User-defined table 2 - #include "thermistortable_999.h" -#endif - -#define _TT_NAME(_N) temptable_ ## _N -#define TT_NAME(_N) _TT_NAME(_N) - -#if THERMISTORHEATER_0 - #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0) - #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) -#elif defined(HEATER_0_USES_THERMISTOR) - #error "No heater 0 thermistor table specified" -#else - #define HEATER_0_TEMPTABLE NULL - #define HEATER_0_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_1 - #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1) - #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) -#elif defined(HEATER_1_USES_THERMISTOR) - #error "No heater 1 thermistor table specified" -#else - #define HEATER_1_TEMPTABLE NULL - #define HEATER_1_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_2 - #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2) - #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) -#elif defined(HEATER_2_USES_THERMISTOR) - #error "No heater 2 thermistor table specified" -#else - #define HEATER_2_TEMPTABLE NULL - #define HEATER_2_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_3 - #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3) - #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) -#elif defined(HEATER_3_USES_THERMISTOR) - #error "No heater 3 thermistor table specified" -#else - #define HEATER_3_TEMPTABLE NULL - #define HEATER_3_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_4 - #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4) - #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) -#elif defined(HEATER_4_USES_THERMISTOR) - #error "No heater 4 thermistor table specified" -#else - #define HEATER_4_TEMPTABLE NULL - #define HEATER_4_TEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORBED - #define BEDTEMPTABLE TT_NAME(THERMISTORBED) - #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) - #error "No bed thermistor table specified" -#else - #define BEDTEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORCHAMBER - #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER) - #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) - #error "No chamber thermistor table specified" -#else - #define CHAMBERTEMPTABLE_LEN 0 -#endif - -// The SCAN_THERMISTOR_TABLE macro needs alteration? -static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && BEDTEMPTABLE_LEN < 256 && CHAMBERTEMPTABLE_LEN < 256, - "Temperature conversion tables over 255 entries need special consideration." -); - -// Set the high and low raw values for the heaters -// For thermistors the highest temperature results in the lowest ADC value -// For thermocouples the highest temperature results in the highest ADC value -#ifndef HEATER_0_RAW_HI_TEMP - #ifdef HEATER_0_USES_THERMISTOR - #define HEATER_0_RAW_HI_TEMP 0 - #define HEATER_0_RAW_LO_TEMP 16383 - #else - #define HEATER_0_RAW_HI_TEMP 16383 - #define HEATER_0_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_1_RAW_HI_TEMP - #ifdef HEATER_1_USES_THERMISTOR - #define HEATER_1_RAW_HI_TEMP 0 - #define HEATER_1_RAW_LO_TEMP 16383 - #else - #define HEATER_1_RAW_HI_TEMP 16383 - #define HEATER_1_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_2_RAW_HI_TEMP - #ifdef HEATER_2_USES_THERMISTOR - #define HEATER_2_RAW_HI_TEMP 0 - #define HEATER_2_RAW_LO_TEMP 16383 - #else - #define HEATER_2_RAW_HI_TEMP 16383 - #define HEATER_2_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_3_RAW_HI_TEMP - #ifdef HEATER_3_USES_THERMISTOR - #define HEATER_3_RAW_HI_TEMP 0 - #define HEATER_3_RAW_LO_TEMP 16383 - #else - #define HEATER_3_RAW_HI_TEMP 16383 - #define HEATER_3_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_4_RAW_HI_TEMP - #ifdef HEATER_4_USES_THERMISTOR - #define HEATER_4_RAW_HI_TEMP 0 - #define HEATER_4_RAW_LO_TEMP 16383 - #else - #define HEATER_4_RAW_HI_TEMP 16383 - #define HEATER_4_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_BED_RAW_HI_TEMP - #ifdef HEATER_BED_USES_THERMISTOR - #define HEATER_BED_RAW_HI_TEMP 0 - #define HEATER_BED_RAW_LO_TEMP 16383 - #else - #define HEATER_BED_RAW_HI_TEMP 16383 - #define HEATER_BED_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_CHAMBER_RAW_HI_TEMP - #ifdef HEATER_CHAMBER_USES_THERMISTOR - #define HEATER_CHAMBER_RAW_HI_TEMP 0 - #define HEATER_CHAMBER_RAW_LO_TEMP 16383 - #else - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 - #endif -#endif - -#endif // THERMISTORTABLES_H_ diff --git a/Marlin/tmc_util.cpp b/Marlin/tmc_util.cpp deleted file mode 100644 index 2e9ba5575c..0000000000 --- a/Marlin/tmc_util.cpp +++ /dev/null @@ -1,631 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "tmc_util.h" -#include "Marlin.h" -#include "printcounter.h" -#include "duration_t.h" -#include "stepper_indirection.h" - -#if ENABLED(TMC_DEBUG) - #include "planner.h" -#endif - -bool report_tmc_status = false; - -/** - * Check for over temperature or short to ground error flags. - * Report and log warning of overtemperature condition. - * Reduce driver current in a persistent otpw condition. - * Keep track of otpw counter so we don't reduce current on a single instance, - * and so we don't repeatedly report warning before the condition is cleared. - */ -#if ENABLED(MONITOR_DRIVER_STATUS) - struct TMC_driver_data { - uint32_t drv_status; - bool is_otpw; - bool is_ot; - bool is_error; - }; - #if HAS_DRIVER(TMC2130) - static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); } - static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response & 0xF; } - static TMC_driver_data get_driver_data(TMC2130Stepper &st) { - constexpr uint32_t OTPW_bm = 0x4000000UL; - constexpr uint8_t OTPW_bp = 26; - constexpr uint32_t OT_bm = 0x2000000UL; - constexpr uint8_t OT_bp = 25; - constexpr uint8_t DRIVER_ERROR_bm = 0x2UL; - constexpr uint8_t DRIVER_ERROR_bp = 1; - TMC_driver_data data; - data.drv_status = st.DRV_STATUS(); - data.is_otpw = (data.drv_status & OTPW_bm) >> OTPW_bp; - data.is_ot = (data.drv_status & OT_bm) >> OT_bp; - data.is_error = (st.status_response & DRIVER_ERROR_bm) >> DRIVER_ERROR_bp; - return data; - } - #endif - #if HAS_DRIVER(TMC2208) - static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } - static uint8_t get_status_response(TMC2208Stepper &st) { - uint32_t drv_status = st.DRV_STATUS(); - uint8_t gstat = st.GSTAT(); - uint8_t response = 0; - response |= (drv_status >> (31-3)) & 0b1000; - response |= gstat & 0b11; - return response; - } - static TMC_driver_data get_driver_data(TMC2208Stepper &st) { - constexpr uint32_t OTPW_bm = 0b1ul; - constexpr uint8_t OTPW_bp = 0; - constexpr uint32_t OT_bm = 0b10ul; - constexpr uint8_t OT_bp = 1; - TMC_driver_data data; - data.drv_status = st.DRV_STATUS(); - data.is_otpw = (data.drv_status & OTPW_bm) >> OTPW_bp; - data.is_ot = (data.drv_status & OT_bm) >> OT_bp; - data.is_error = st.drv_err(); - return data; - } - #endif - - template - void monitor_tmc_driver(TMC &st, const TMC_AxisEnum axis, uint8_t &otpw_cnt) { - TMC_driver_data data = get_driver_data(st); - - #if ENABLED(STOP_ON_ERROR) - if (data.is_error) { - SERIAL_EOL(); - _tmc_say_axis(axis); - SERIAL_ECHOLNPGM(" driver error detected:"); - if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature"); - if (st.s2ga()) SERIAL_ECHOLNPGM("short to ground (coil A)"); - if (st.s2gb()) SERIAL_ECHOLNPGM("short to ground (coil B)"); - #if ENABLED(TMC_DEBUG) - tmc_report_all(); - #endif - kill(PSTR("Driver error")); - } - #endif - - // Report if a warning was triggered - if (data.is_otpw && otpw_cnt == 0) { - char timestamp[10]; - duration_t elapsed = print_job_timer.duration(); - const bool has_days = (elapsed.value > 60*60*24L); - (void)elapsed.toDigital(timestamp, has_days); - SERIAL_EOL(); - SERIAL_ECHO(timestamp); - SERIAL_ECHOPGM(": "); - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" driver overtemperature warning! ("); - SERIAL_ECHO(st.getCurrent()); - SERIAL_ECHOLNPGM("mA)"); - } - #if CURRENT_STEP_DOWN > 0 - // Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings - if (data.is_otpw && st.isEnabled() && otpw_cnt > 4) { - st.setCurrent(st.getCurrent() - CURRENT_STEP_DOWN, R_SENSE, HOLD_MULTIPLIER); - #if ENABLED(REPORT_CURRENT_CHANGE) - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" current decreased to ", st.getCurrent()); - #endif - } - #endif - - if (data.is_otpw) { - otpw_cnt++; - st.flag_otpw = true; - } - else if (otpw_cnt > 0) otpw_cnt = 0; - - if (report_tmc_status) { - const uint32_t pwm_scale = get_pwm_scale(st); - _tmc_say_axis(axis); - SERIAL_ECHOPAIR(":", pwm_scale); - SERIAL_ECHOPGM(" |0b"); SERIAL_PRINT(get_status_response(st), BIN); - SERIAL_ECHOPGM("| "); - if (data.is_error) SERIAL_CHAR('E'); - else if (data.is_ot) SERIAL_CHAR('O'); - else if (data.is_otpw) SERIAL_CHAR('W'); - else if (otpw_cnt > 0) SERIAL_PRINT(otpw_cnt, DEC); - else if (st.flag_otpw) SERIAL_CHAR('F'); - SERIAL_CHAR('\t'); - } - } - - #define HAS_HW_COMMS(ST) AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && defined(ST##_HARDWARE_SERIAL)) - - void monitor_tmc_driver() { - static millis_t next_cOT = 0; - if (ELAPSED(millis(), next_cOT)) { - next_cOT = millis() + 500; - #if HAS_HW_COMMS(X) - static uint8_t x_otpw_cnt = 0; - monitor_tmc_driver(stepperX, TMC_X, x_otpw_cnt); - #endif - #if HAS_HW_COMMS(Y) - static uint8_t y_otpw_cnt = 0; - monitor_tmc_driver(stepperY, TMC_Y, y_otpw_cnt); - #endif - #if HAS_HW_COMMS(Z) - static uint8_t z_otpw_cnt = 0; - monitor_tmc_driver(stepperZ, TMC_Z, z_otpw_cnt); - #endif - #if HAS_HW_COMMS(X2) - static uint8_t x2_otpw_cnt = 0; - monitor_tmc_driver(stepperX2, TMC_X, x2_otpw_cnt); - #endif - #if HAS_HW_COMMS(Y2) - static uint8_t y2_otpw_cnt = 0; - monitor_tmc_driver(stepperY2, TMC_Y, y2_otpw_cnt); - #endif - #if HAS_HW_COMMS(Z2) - static uint8_t z2_otpw_cnt = 0; - monitor_tmc_driver(stepperZ2, TMC_Z, z2_otpw_cnt); - #endif - #if HAS_HW_COMMS(E0) - static uint8_t e0_otpw_cnt = 0; - monitor_tmc_driver(stepperE0, TMC_E0, e0_otpw_cnt); - #endif - #if HAS_HW_COMMS(E1) - static uint8_t e1_otpw_cnt = 0; - monitor_tmc_driver(stepperE1, TMC_E1, e1_otpw_cnt); - #endif - #if HAS_HW_COMMS(E2) - static uint8_t e2_otpw_cnt = 0; - monitor_tmc_driver(stepperE2, TMC_E2, e2_otpw_cnt); - #endif - #if HAS_HW_COMMS(E3) - static uint8_t e3_otpw_cnt = 0; - monitor_tmc_driver(stepperE3, TMC_E3, e3_otpw_cnt); - #endif - #if HAS_HW_COMMS(E4) - static uint8_t e4_otpw_cnt = 0; - monitor_tmc_driver(stepperE4, TMC_E4, e4_otpw_cnt); - #endif - - if (report_tmc_status) SERIAL_EOL(); - } - } - -#endif // MONITOR_DRIVER_STATUS - -void _tmc_say_axis(const TMC_AxisEnum axis) { - static const char ext_X[] PROGMEM = "X", ext_Y[] PROGMEM = "Y", ext_Z[] PROGMEM = "Z", - ext_X2[] PROGMEM = "X2", ext_Y2[] PROGMEM = "Y2", ext_Z2[] PROGMEM = "Z2", - ext_E0[] PROGMEM = "E0", ext_E1[] PROGMEM = "E1", - ext_E2[] PROGMEM = "E2", ext_E3[] PROGMEM = "E3", - ext_E4[] PROGMEM = "E4"; - static const char* const tmc_axes[] PROGMEM = { ext_X, ext_Y, ext_Z, ext_X2, ext_Y2, ext_Z2, ext_E0, ext_E1, ext_E2, ext_E3, ext_E4 }; - serialprintPGM((char*)pgm_read_ptr(&tmc_axes[axis])); -} - -void _tmc_say_current(const TMC_AxisEnum axis, const uint16_t curr) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" driver current: ", curr); -} -void _tmc_say_otpw(const TMC_AxisEnum axis, const bool otpw) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" temperature prewarn triggered: "); - serialprintPGM(otpw ? PSTR("true") : PSTR("false")); - SERIAL_EOL(); -} -void _tmc_say_otpw_cleared(const TMC_AxisEnum axis) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPGM(" prewarn flag cleared"); -} -void _tmc_say_pwmthrs(const TMC_AxisEnum axis, const uint32_t thrs) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" stealthChop max speed: ", thrs); -} -void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" homing sensitivity: "); - SERIAL_PRINTLN(sgt, DEC); -} - -#if ENABLED(TMC_DEBUG) - - enum TMC_debug_enum : char { - TMC_CODES, - TMC_ENABLED, - TMC_CURRENT, - TMC_RMS_CURRENT, - TMC_MAX_CURRENT, - TMC_IRUN, - TMC_IHOLD, - TMC_CS_ACTUAL, - TMC_PWM_SCALE, - TMC_VSENSE, - TMC_STEALTHCHOP, - TMC_MICROSTEPS, - TMC_TSTEP, - TMC_TPWMTHRS, - TMC_TPWMTHRS_MMS, - TMC_OTPW, - TMC_OTPW_TRIGGERED, - TMC_TOFF, - TMC_TBL, - TMC_HEND, - TMC_HSTRT, - TMC_SGT - }; - enum TMC_drv_status_enum : char { - TMC_DRV_CODES, - TMC_STST, - TMC_OLB, - TMC_OLA, - TMC_S2GB, - TMC_S2GA, - TMC_DRV_OTPW, - TMC_OT, - TMC_STALLGUARD, - TMC_DRV_CS_ACTUAL, - TMC_FSACTIVE, - TMC_SG_RESULT, - TMC_DRV_STATUS_HEX, - TMC_T157, - TMC_T150, - TMC_T143, - TMC_T120, - TMC_STEALTH, - TMC_S2VSB, - TMC_S2VSA - }; - static void drv_status_print_hex(const TMC_AxisEnum axis, const uint32_t drv_status) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" = 0x"); - for (int B = 24; B >= 8; B -= 8){ - SERIAL_PRINT((drv_status >> (B + 4)) & 0xF, HEX); - SERIAL_PRINT((drv_status >> B) & 0xF, HEX); - SERIAL_CHAR(':'); - } - SERIAL_PRINT((drv_status >> 4) & 0xF, HEX); - SERIAL_PRINT((drv_status) & 0xF, HEX); - SERIAL_EOL(); - } - - #if HAS_DRIVER(TMC2130) - static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; - case TMC_TSTEP: SERIAL_ECHO(st.TSTEP()); break; - case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; - case TMC_STEALTHCHOP: serialprintPGM(st.stealthChop() ? PSTR("true") : PSTR("false")); break; - default: break; - } - } - static void tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('X'); break; - case TMC_SG_RESULT: SERIAL_PRINT(st.sg_result(), DEC); break; - case TMC_FSACTIVE: if (st.fsactive()) SERIAL_CHAR('X'); break; - default: break; - } - } - #endif - - #if HAS_DRIVER(TMC2208) - static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; } - case TMC_PWM_SCALE: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; - case TMC_STEALTHCHOP: serialprintPGM(st.stealth() ? PSTR("true") : PSTR("false")); break; - case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('X'); break; - case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('X'); break; - default: break; - } - } - static void tmc_parse_drv_status(TMC2208Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_T157: if (st.t157()) SERIAL_CHAR('X'); break; - case TMC_T150: if (st.t150()) SERIAL_CHAR('X'); break; - case TMC_T143: if (st.t143()) SERIAL_CHAR('X'); break; - case TMC_T120: if (st.t120()) SERIAL_CHAR('X'); break; - default: break; - } - } - #endif - - template - static void tmc_status(TMC &st, const TMC_AxisEnum axis, const TMC_debug_enum i, const float spmm) { - SERIAL_ECHO('\t'); - switch (i) { - case TMC_CODES: _tmc_say_axis(axis); break; - case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; - case TMC_CURRENT: SERIAL_ECHO(st.getCurrent()); break; - case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break; - case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; - case TMC_IRUN: - SERIAL_PRINT(st.irun(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_IHOLD: - SERIAL_PRINT(st.ihold(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_CS_ACTUAL: - SERIAL_PRINT(st.cs_actual(), DEC); - SERIAL_ECHOPGM("/31"); - break; - - case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); break; - - case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; - case TMC_TPWMTHRS: { - uint32_t tpwmthrs_val = st.TPWMTHRS(); - SERIAL_ECHO(tpwmthrs_val); - } - break; - case TMC_TPWMTHRS_MMS: { - uint32_t tpwmthrs_val = st.TPWMTHRS(); - if (tpwmthrs_val) - SERIAL_ECHO(12650000UL * st.microsteps() / (256 * tpwmthrs_val * spmm)); - else - SERIAL_CHAR('-'); - } - break; - case TMC_OTPW: serialprintPGM(st.otpw() ? PSTR("true") : PSTR("false")); break; - case TMC_OTPW_TRIGGERED: serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false")); break; - case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; - case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; - case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; - case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; - default: tmc_status(st, i); break; - } - } - - template - static void tmc_parse_drv_status(TMC &st, const TMC_AxisEnum axis, const TMC_drv_status_enum i) { - SERIAL_CHAR('\t'); - switch (i) { - case TMC_DRV_CODES: _tmc_say_axis(axis); break; - case TMC_STST: if (st.stst()) SERIAL_CHAR('X'); break; - case TMC_OLB: if (st.olb()) SERIAL_CHAR('X'); break; - case TMC_OLA: if (st.ola()) SERIAL_CHAR('X'); break; - case TMC_S2GB: if (st.s2gb()) SERIAL_CHAR('X'); break; - case TMC_S2GA: if (st.s2ga()) SERIAL_CHAR('X'); break; - case TMC_DRV_OTPW: if (st.otpw()) SERIAL_CHAR('X'); break; - case TMC_OT: if (st.ot()) SERIAL_CHAR('X'); break; - case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; - case TMC_DRV_STATUS_HEX:drv_status_print_hex(axis, st.DRV_STATUS()); break; - default: tmc_parse_drv_status(st, i); break; - } - } - - static void tmc_debug_loop(const TMC_debug_enum i) { - #if AXIS_IS_TMC(X) - tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_IS_TMC(X2) - tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]); - #endif - - #if AXIS_IS_TMC(Y) - tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_IS_TMC(Y2) - tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]); - #endif - - #if AXIS_IS_TMC(Z) - tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_IS_TMC(Z2) - tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]); - #endif - - #if AXIS_IS_TMC(E0) - tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_IS_TMC(E1) - tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 1 - #endif - ]); - #endif - #if AXIS_IS_TMC(E2) - tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 2 - #endif - ]); - #endif - #if AXIS_IS_TMC(E3) - tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 3 - #endif - ]); - #endif - #if AXIS_IS_TMC(E4) - tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 4 - #endif - ]); - #endif - - SERIAL_EOL(); - } - - static void drv_status_loop(const TMC_drv_status_enum i) { - #if AXIS_IS_TMC(X) - tmc_parse_drv_status(stepperX, TMC_X, i); - #endif - #if AXIS_IS_TMC(X2) - tmc_parse_drv_status(stepperX2, TMC_X2, i); - #endif - - #if AXIS_IS_TMC(Y) - tmc_parse_drv_status(stepperY, TMC_Y, i); - #endif - #if AXIS_IS_TMC(Y2) - tmc_parse_drv_status(stepperY2, TMC_Y2, i); - #endif - - #if AXIS_IS_TMC(Z) - tmc_parse_drv_status(stepperZ, TMC_Z, i); - #endif - #if AXIS_IS_TMC(Z2) - tmc_parse_drv_status(stepperZ2, TMC_Z2, i); - #endif - - #if AXIS_IS_TMC(E0) - tmc_parse_drv_status(stepperE0, TMC_E0, i); - #endif - #if AXIS_IS_TMC(E1) - tmc_parse_drv_status(stepperE1, TMC_E1, i); - #endif - #if AXIS_IS_TMC(E2) - tmc_parse_drv_status(stepperE2, TMC_E2, i); - #endif - #if AXIS_IS_TMC(E3) - tmc_parse_drv_status(stepperE3, TMC_E3, i); - #endif - #if AXIS_IS_TMC(E4) - tmc_parse_drv_status(stepperE4, TMC_E4, i); - #endif - - SERIAL_EOL(); - } - - /** - * M122 report functions - */ - void tmc_set_report_status(const bool status) { - if ((report_tmc_status = status)) - SERIAL_ECHOLNPGM("axis:pwm_scale |status_response|"); - } - - void tmc_report_all() { - #define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM); }while(0) - #define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM); }while(0) - TMC_REPORT("\t", TMC_CODES); - TMC_REPORT("Enabled\t", TMC_ENABLED); - TMC_REPORT("Set current", TMC_CURRENT); - TMC_REPORT("RMS current", TMC_RMS_CURRENT); - TMC_REPORT("MAX current", TMC_MAX_CURRENT); - TMC_REPORT("Run current", TMC_IRUN); - TMC_REPORT("Hold current", TMC_IHOLD); - TMC_REPORT("CS actual\t", TMC_CS_ACTUAL); - TMC_REPORT("PWM scale\t", TMC_PWM_SCALE); - TMC_REPORT("vsense\t", TMC_VSENSE); - TMC_REPORT("stealthChop", TMC_STEALTHCHOP); - TMC_REPORT("msteps\t", TMC_MICROSTEPS); - TMC_REPORT("tstep\t", TMC_TSTEP); - TMC_REPORT("pwm\nthreshold\t", TMC_TPWMTHRS); - TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS); - TMC_REPORT("OT prewarn", TMC_OTPW); - TMC_REPORT("OT prewarn has\n" - "been triggered", TMC_OTPW_TRIGGERED); - TMC_REPORT("off time\t", TMC_TOFF); - TMC_REPORT("blank time", TMC_TBL); - TMC_REPORT("hysteresis\n-end\t", TMC_HEND); - TMC_REPORT("-start\t", TMC_HSTRT); - TMC_REPORT("Stallguard thrs", TMC_SGT); - - DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); - #if HAS_DRIVER(TMC2130) - DRV_REPORT("stallguard\t", TMC_STALLGUARD); - DRV_REPORT("sg_result\t", TMC_SG_RESULT); - DRV_REPORT("fsactive\t", TMC_FSACTIVE); - #endif - DRV_REPORT("stst\t", TMC_STST); - DRV_REPORT("olb\t", TMC_OLB); - DRV_REPORT("ola\t", TMC_OLA); - DRV_REPORT("s2gb\t", TMC_S2GB); - DRV_REPORT("s2ga\t", TMC_S2GA); - DRV_REPORT("otpw\t", TMC_DRV_OTPW); - DRV_REPORT("ot\t", TMC_OT); - #if HAS_DRIVER(TMC2208) - DRV_REPORT("157C\t", TMC_T157); - DRV_REPORT("150C\t", TMC_T150); - DRV_REPORT("143C\t", TMC_T143); - DRV_REPORT("120C\t", TMC_T120); - DRV_REPORT("s2vsa\t", TMC_S2VSA); - DRV_REPORT("s2vsb\t", TMC_S2VSB); - #endif - DRV_REPORT("Driver registers:", TMC_DRV_STATUS_HEX); - SERIAL_EOL(); - } - -#endif // TMC_DEBUG - -#if ENABLED(SENSORLESS_HOMING) - - void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable/*=true*/) { - st.coolstep_min_speed(enable ? 1024UL * 1024UL - 1UL : 0); - #if ENABLED(STEALTHCHOP) - st.stealthChop(!enable); - #endif - st.diag1_stall(enable ? 1 : 0); - } - -#endif // SENSORLESS_HOMING - -#if HAS_DRIVER(TMC2130) - #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) - void tmc_init_cs_pins() { - #if AXIS_DRIVER_TYPE(X, TMC2130) - SET_CS_PIN(X); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - SET_CS_PIN(Y); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - SET_CS_PIN(Z); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - SET_CS_PIN(X2); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - SET_CS_PIN(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - SET_CS_PIN(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - SET_CS_PIN(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - SET_CS_PIN(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - SET_CS_PIN(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - SET_CS_PIN(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - SET_CS_PIN(E4); - #endif - } -#endif // TMC2130 - -#endif // HAS_TRINAMIC diff --git a/Marlin/tmc_util.h b/Marlin/tmc_util.h deleted file mode 100644 index 7efe67a502..0000000000 --- a/Marlin/tmc_util.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _TMC_UTIL_H_ -#define _TMC_UTIL_H_ - -#include "MarlinConfig.h" - -#if HAS_DRIVER(TMC2130) - #include -#endif - -#if HAS_DRIVER(TMC2208) - #include -#endif - -extern bool report_tmc_status; - -enum TMC_AxisEnum : char { TMC_X, TMC_Y, TMC_Z, TMC_X2, TMC_Y2, TMC_Z2, TMC_E0, TMC_E1, TMC_E2, TMC_E3, TMC_E4 }; - -constexpr uint32_t _tmc_thrs(const uint16_t msteps, const int32_t thrs, const uint32_t spmm) { - return 12650000UL * msteps / (256 * thrs * spmm); -} - -void _tmc_say_axis(const TMC_AxisEnum axis); -void _tmc_say_current(const TMC_AxisEnum axis, const uint16_t curr); -void _tmc_say_otpw(const TMC_AxisEnum axis, const bool otpw); -void _tmc_say_otpw_cleared(const TMC_AxisEnum axis); -void _tmc_say_pwmthrs(const TMC_AxisEnum axis, const uint32_t thrs); -void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt); - -template -void tmc_get_current(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_current(axis, st.getCurrent()); -} -template -void tmc_set_current(TMC &st, const int mA) { - st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); -} -template -void tmc_report_otpw(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_otpw(axis, st.getOTPW()); -} -template -void tmc_clear_otpw(TMC &st, const TMC_AxisEnum axis) { - st.clear_otpw(); - _tmc_say_otpw_cleared(axis); -} -template -void tmc_get_pwmthrs(TMC &st, const TMC_AxisEnum axis, const uint16_t spmm) { - _tmc_say_pwmthrs(axis, _tmc_thrs(st.microsteps(), st.TPWMTHRS(), spmm)); -} -template -void tmc_set_pwmthrs(TMC &st, const int32_t thrs, const uint32_t spmm) { - st.TPWMTHRS(_tmc_thrs(st.microsteps(), thrs, spmm)); -} -template -void tmc_get_sgt(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_sgt(axis, st.sgt()); -} -template -void tmc_set_sgt(TMC &st, const int8_t sgt_val) { - st.sgt(sgt_val); -} - -void monitor_tmc_driver(); - -#if ENABLED(TMC_DEBUG) - void tmc_set_report_status(const bool status); - void tmc_report_all(); -#endif - -/** - * TMC2130 specific sensorless homing using stallGuard2. - * stallGuard2 only works when in spreadCycle mode. - * spreadCycle and stealthChop are mutually exclusive. - * - * Defined here because of limitations with templates and headers. - */ -#if ENABLED(SENSORLESS_HOMING) - void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable=true); -#endif - -#if HAS_DRIVER(TMC2130) - void tmc_init_cs_pins(); -#endif - -#endif // _TMC_UTIL_H_ diff --git a/Marlin/twibus.cpp b/Marlin/twibus.cpp deleted file mode 100644 index 777d151e4f..0000000000 --- a/Marlin/twibus.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(EXPERIMENTAL_I2CBUS) - -#include "twibus.h" -#include -#include "Marlin.h" - -TWIBus::TWIBus() { - #if I2C_SLAVE_ADDRESS == 0 - Wire.begin(); // No address joins the BUS as the master - #else - Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave - #endif - this->reset(); -} - -void TWIBus::reset() { - this->buffer_s = 0; - this->buffer[0] = 0x00; -} - -void TWIBus::address(const uint8_t adr) { - if (!WITHIN(adr, 8, 127)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Bad I2C address (8-127)"); - } - - this->addr = adr; - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("address"), adr); - #endif -} - -void TWIBus::addbyte(const char c) { - if (this->buffer_s >= COUNT(this->buffer)) return; - this->buffer[this->buffer_s++] = c; - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbyte"), c); - #endif -} - -void TWIBus::addbytes(char src[], uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbytes"), bytes); - #endif - while (bytes--) this->addbyte(*src++); -} - -void TWIBus::addstring(char str[]) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addstring"), str); - #endif - while (char c = *str++) this->addbyte(c); -} - -void TWIBus::send() { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("send"), this->addr); - #endif - - Wire.beginTransmission(this->addr); - Wire.write(this->buffer, this->buffer_s); - Wire.endTransmission(); - - this->reset(); -} - -// static -void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) { - SERIAL_ECHO_START(); - serialprintPGM(prefix); - SERIAL_ECHOPAIR(": from:", adr); - SERIAL_ECHOPAIR(" bytes:", bytes); - SERIAL_ECHOPGM (" data:"); -} - -// static -void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) { - echoprefix(bytes, prefix, adr); - while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read()); - SERIAL_EOL(); -} - -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]); - SERIAL_EOL(); -} - -bool TWIBus::request(const uint8_t bytes) { - if (!this->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 ENABLED(DEBUG_TWIBUS) - debug("request fail", this->addr); - #endif - return false; - } - - return true; -} - -void TWIBus::relay(const uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("relay"), bytes); - #endif - - if (this->request(bytes)) - echodata(bytes, PSTR("i2c-reply"), this->addr); -} - -uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { - this->reset(); - uint8_t count = 0; - while (count < bytes && Wire.available()) - dst[count++] = Wire.read(); - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("capture"), count); - #endif - - return count; -} - -// static -void TWIBus::flush() { - while (Wire.available()) Wire.read(); -} - -#if I2C_SLAVE_ADDRESS > 0 - - void TWIBus::receive(uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("receive"), bytes); - #endif - echodata(bytes, PSTR("i2c-receive"), 0); - } - - void TWIBus::reply(char str[]/*=NULL*/) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("reply"), str); - #endif - - if (str) { - this->reset(); - this->addstring(str); - } - - Wire.write(this->buffer, this->buffer_s); - - this->reset(); - } - -#endif - -#if ENABLED(DEBUG_TWIBUS) - - // static - void TWIBus::prefix(const char func[]) { - SERIAL_ECHOPGM("TWIBus::"); - serialprintPGM(func); - SERIAL_ECHOPGM(": "); - } - void TWIBus::debug(const char func[], uint32_t adr) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(adr); } - } - void TWIBus::debug(const char func[], char c) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(c); } - } - void TWIBus::debug(const char func[], char str[]) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(str); } - } - -#endif - -#endif // EXPERIMENTAL_I2CBUS diff --git a/Marlin/twibus.h b/Marlin/twibus.h deleted file mode 100644 index 03763972a7..0000000000 --- a/Marlin/twibus.h +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef TWIBUS_H -#define TWIBUS_H - -#include "macros.h" - -#include - -// Print debug messages with M111 S2 (Uses 236 bytes of PROGMEM) -//#define DEBUG_TWIBUS - -typedef void (*twiReceiveFunc_t)(int bytes); -typedef void (*twiRequestFunc_t)(); - -#define TWIBUS_BUFFER_SIZE 32 - -/** - * TWIBUS class - * - * This class implements a wrapper around the two wire (I2C) bus, allowing - * Marlin to send and request data from any slave device on the bus. - * - * The two main consumers of this class are M260 and M261. M260 provides a way - * to send an I2C packet to a device (no repeated starts) by caching up to 32 - * bytes in a buffer and then sending the buffer. - * M261 requests data from a device. The received data is relayed to serial out - * for the host to interpret. - * - * For more information see - * - http://marlinfw.org/docs/gcode/M260.html - * - http://marlinfw.org/docs/gcode/M261.html - * - */ -class TWIBus { - private: - /** - * @brief Number of bytes on buffer - * @description Number of bytes in the buffer waiting to be flushed to the bus - */ - uint8_t buffer_s = 0; - - /** - * @brief Internal buffer - * @details A fixed buffer. TWI commands can be no longer than this. - */ - char buffer[TWIBUS_BUFFER_SIZE]; - - - public: - /** - * @brief Target device address - * @description The target device address. Persists until changed. - */ - uint8_t addr = 0; - - /** - * @brief Class constructor - * @details Initialize the TWI bus and clear the buffer - */ - TWIBus(); - - /** - * @brief Reset the buffer - * @details Set the buffer to a known-empty state - */ - void reset(); - - /** - * @brief Send the buffer data to the bus - * @details Flush the buffer to the target address - */ - void send(); - - /** - * @brief Add one byte to the buffer - * @details Add a byte to the end of the buffer. - * Silently fails if the buffer is full. - * - * @param c a data byte - */ - void addbyte(const char c); - - /** - * @brief Add some bytes to the buffer - * @details Add bytes to the end of the buffer. - * Concatenates at the buffer size. - * - * @param src source data address - * @param bytes the number of bytes to add - */ - void addbytes(char src[], uint8_t bytes); - - /** - * @brief Add a null-terminated string to the buffer - * @details Add bytes to the end of the buffer up to a nul. - * Concatenates at the buffer size. - * - * @param str source string address - */ - void addstring(char str[]); - - /** - * @brief Set the target slave address - * @details The target slave address for sending the full packet - * - * @param adr 7-bit integer address - */ - void address(const uint8_t adr); - - /** - * @brief Prefix for echo to serial - * @details Echo a label, length, address, and "data:" - * - * @param bytes the number of bytes to request - */ - static void echoprefix(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data on the bus to serial - * @details Echo some number of bytes from the bus - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - static void echodata(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data in the buffer to serial - * @details Echo the entire buffer to serial - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void echobuffer(const char prefix[], uint8_t adr); - - /** - * @brief Request data from the slave device and wait. - * @details Request a number of bytes from a slave device. - * Wait for the data to arrive, and return true - * on success. - * - * @param bytes the number of bytes to request - * @return status of the request: true=success, false=fail - */ - bool request(const uint8_t bytes); - - /** - * @brief Capture data from the bus into the buffer. - * @details Capture data after a request has succeeded. - * - * @param bytes the number of bytes to request - * @return the number of bytes captured to the buffer - */ - uint8_t capture(char *dst, const uint8_t bytes); - - /** - * @brief Flush the i2c bus. - * @details Get all bytes on the bus and throw them away. - */ - static void flush(); - - /** - * @brief Request data from the slave device, echo to serial. - * @details Request a number of bytes from a slave device and output - * the returned data to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void relay(const uint8_t bytes); - - #if I2C_SLAVE_ADDRESS > 0 - - /** - * @brief Register a slave receive handler - * @details Set a handler to receive data addressed to us - * - * @param handler A function to handle receiving bytes - */ - inline void onReceive(const twiReceiveFunc_t handler) { Wire.onReceive(handler); } - - /** - * @brief Register a slave request handler - * @details Set a handler to send data requested from us - * - * @param handler A function to handle receiving bytes - */ - inline void onRequest(const twiRequestFunc_t handler) { Wire.onRequest(handler); } - - /** - * @brief Default handler to receive - * @details Receive bytes sent to our slave address - * and simply echo them to serial. - */ - void receive(uint8_t bytes); - - /** - * @brief Send a reply to the bus - * @details Send the buffer and clear it. - * If a string is passed, write it into the buffer first. - */ - void reply(char str[]=NULL); - inline void reply(const char str[]) { this->reply((char*)str); } - - #endif - - #if ENABLED(DEBUG_TWIBUS) - - /** - * @brief Prints a debug message - * @details Prints a simple debug message "TWIBus::function: value" - */ - static void prefix(const char func[]); - static void debug(const char func[], uint32_t adr); - static void debug(const char func[], char c); - static void debug(const char func[], char adr[]); - static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); } - - #endif -}; - -#endif // TWIBUS_H diff --git a/Marlin/types.h b/Marlin/types.h deleted file mode 100644 index 8d4a0bd04c..0000000000 --- a/Marlin/types.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __TYPES_H__ -#define __TYPES_H__ - -#include - -typedef unsigned long millis_t; - -typedef struct { - int8_t x_index, y_index; - float distance; // When populated, the distance from the search location -} mesh_index_pair; - -#endif diff --git a/Marlin/ubl.cpp b/Marlin/ubl.cpp deleted file mode 100644 index df9c212bbf..0000000000 --- a/Marlin/ubl.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "Marlin.h" - #include "ubl.h" - #include "hex_print_routines.h" - #include "temperature.h" - #include "planner.h" - #include "math.h" - - unified_bed_leveling ubl; - - uint8_t ubl_cnt = 0; - - void unified_bed_leveling::echo_name() { SERIAL_PROTOCOLPGM("Unified Bed Leveling"); } - - void unified_bed_leveling::report_current_mesh() { - if (!leveling_is_valid()) return; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(" G29 I999"); - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - 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); - SERIAL_ECHOPAIR(" J", y); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(z_values[x][y], 2); - SERIAL_EOL(); - } - } - - void unified_bed_leveling::report_state() { - echo_name(); - SERIAL_PROTOCOLPGM(" System v" UBL_VERSION " "); - if (!planner.leveling_active) SERIAL_PROTOCOLPGM("in"); - SERIAL_PROTOCOLLNPGM("active."); - safe_delay(50); - } - - #if ENABLED(UBL_DEVEL_DEBUGGING) - - static void debug_echo_axis(const AxisEnum axis) { - if (current_position[axis] == destination[axis]) - SERIAL_ECHOPGM("-------------"); - else - SERIAL_ECHO_F(destination[X_AXIS], 6); - } - - void debug_current_and_destination(const char *title) { - - // if the title message starts with a '!' it is so important, we are going to - // ignore the status of the g26_debug_flag - if (*title != '!' && !g26_debug_flag) return; - - const float de = destination[E_AXIS] - current_position[E_AXIS]; - - if (de == 0.0) return; // Printing moves only - - const float dx = destination[X_AXIS] - current_position[X_AXIS], - dy = destination[Y_AXIS] - current_position[Y_AXIS], - xy_dist = HYPOT(dx, dy); - - if (xy_dist == 0.0) return; - - SERIAL_ECHOPGM(" fpmm="); - const float fpmm = de / xy_dist; - SERIAL_ECHO_F(fpmm, 6); - - SERIAL_ECHOPGM(" current=( "); - SERIAL_ECHO_F(current_position[X_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Y_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Z_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[E_AXIS], 6); - SERIAL_ECHOPGM(" ) destination=( "); - debug_echo_axis(X_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Y_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Z_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(E_AXIS); - SERIAL_ECHOPGM(" ) "); - SERIAL_ECHO(title); - SERIAL_EOL(); - - } - - #endif // UBL_DEVEL_DEBUGGING - - int8_t unified_bed_leveling::storage_slot; - - 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]; - - #if ENABLED(ULTIPANEL) - bool unified_bed_leveling::lcd_map_control = false; - #endif - - volatile int unified_bed_leveling::encoder_diff; - - unified_bed_leveling::unified_bed_leveling() { - ubl_cnt++; // Debug counter to ensure we only have one UBL object present in memory. We can eliminate this (and all references to ubl_cnt) very soon. - reset(); - } - - void unified_bed_leveling::reset() { - 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 (was_enabled) report_current_position(); - } - - void unified_bed_leveling::invalidate() { - set_bed_leveling_enabled(false); - set_all_mesh_points_to_value(NAN); - } - - void unified_bed_leveling::set_all_mesh_points_to_value(const float value) { - 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] = value; - } - } - } - - static void serial_echo_xy(const uint8_t sp, const int16_t x, const int16_t y) { - SERIAL_ECHO_SP(sp); - SERIAL_CHAR('('); - if (x < 100) { SERIAL_CHAR(' '); if (x < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(x); - SERIAL_CHAR(','); - if (y < 100) { SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(y); - SERIAL_CHAR(')'); - safe_delay(5); - } - - static void serial_echo_column_labels(const uint8_t sp) { - SERIAL_ECHO_SP(7); - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - if (i < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(i); - SERIAL_ECHO_SP(sp); - } - safe_delay(10); - } - - /** - * Produce one of these mesh maps: - * 0: Human-readable - * 1: CSV format for spreadsheet import - * 2: TODO: Display on Graphical LCD - * 4: Compact Human-Readable - */ - void unified_bed_leveling::display_map(const int map_type) { - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = true; - #endif - - constexpr uint8_t eachsp = 1 + 6 + 1, // [-3.567] - twixt = eachsp * (GRID_MAX_POINTS_X) - 9 * 2; // Leading 4sp, Coordinates 9sp each - - const bool human = !(map_type & 0x3), csv = map_type == 1, lcd = map_type == 2, comp = map_type & 0x4; - - SERIAL_ECHOPGM("\nBed Topography Report"); - if (human) { - SERIAL_ECHOPGM(":\n\n"); - serial_echo_xy(4, MESH_MIN_X, MESH_MAX_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MAX_Y); - SERIAL_EOL(); - serial_echo_column_labels(eachsp - 2); - } - else { - SERIAL_ECHOPGM(" for "); - serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); - } - - const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), - current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); - - if (!lcd) SERIAL_EOL(); - for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { - - // Row Label (J index) - if (human) { - if (j < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(j); - SERIAL_ECHOPGM(" |"); - } - - // Row Values (I indexes) - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - - // Opening Brace or Space - const bool is_current = i == current_xi && j == current_yi; - if (human) SERIAL_CHAR(is_current ? '[' : ' '); - - // Z Value at current I, J - const float f = z_values[i][j]; - if (lcd) { - // TODO: Display on Graphical LCD - } - else if (isnan(f)) - serialprintPGM(human ? PSTR(" . ") : PSTR("NAN")); - else if (human || csv) { - if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Space for positive ('-' for negative) - SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits - } - idle(); - if (csv && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR('\t'); - - // Closing Brace or Space - if (human) SERIAL_CHAR(is_current ? ']' : ' '); - - #if TX_BUFFER_SIZE > 0 - SERIAL_FLUSHTX(); - #endif - safe_delay(5); - } - if (!lcd) SERIAL_EOL(); - - // A blank line between rows (unless compact) - if (j && human && !comp) SERIAL_ECHOLNPGM(" |"); - } - - if (human) { - serial_echo_column_labels(eachsp - 2); - SERIAL_EOL(); - serial_echo_xy(4, MESH_MIN_X, MESH_MIN_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MIN_Y); - SERIAL_EOL(); - SERIAL_EOL(); - } - - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = false; - #endif - } - - bool unified_bed_leveling::sanity_check() { - uint8_t error_flag = 0; - - if (settings.calc_num_meshes() < 1) { - SERIAL_PROTOCOLLNPGM("?Mesh too big for EEPROM."); - error_flag++; - } - - return !!error_flag; - } - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin/ubl.h b/Marlin/ubl.h deleted file mode 100644 index 03380af452..0000000000 --- a/Marlin/ubl.h +++ /dev/null @@ -1,370 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef UNIFIED_BED_LEVELING_H -#define UNIFIED_BED_LEVELING_H - -#include "MarlinConfig.h" - -//#define UBL_DEVEL_DEBUGGING - -#include "Marlin.h" -#include "planner.h" -#include "math.h" -#include "configuration_store.h" - -#define UBL_VERSION "1.01" -#define UBL_OK false -#define UBL_ERR true - -#define USE_NOZZLE_AS_REFERENCE 0 -#define USE_PROBE_AS_REFERENCE 1 - -// ubl_motion.cpp - -#if ENABLED(UBL_DEVEL_DEBUGGING) - void debug_current_and_destination(const char * const title); -#else - FORCE_INLINE void debug_current_and_destination(const char * const title) { UNUSED(title); } -#endif - -// ubl_G29.cpp - -enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; - -// External references - -char *ftostr43sign(const float&, char); - -extern uint8_t ubl_cnt; - -/////////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(ULTRA_LCD) - void lcd_quick_feedback(const bool clear_buttons); -#endif - -#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)) - -class unified_bed_leveling { - private: - - static int g29_verbose_level, - g29_phase_value, - g29_repetition_cnt, - g29_storage_slot, - g29_map_type; - static bool g29_c_flag, g29_x_flag, g29_y_flag; - static float g29_x_pos, g29_y_pos, - g29_card_thickness, - g29_constant; - - #if HAS_BED_PROBE - static int g29_grid_size; - #endif - - #if ENABLED(NEWPANEL) - static void move_z_with_encoder(const float &multiplier); - static float measure_point_with_encoder(); - static float measure_business_card_thickness(float in_height); - static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool) _O0; - static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) _O0; - #endif - - static bool g29_parameter_parsing() _O0; - static void shift_mesh_height(); - static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest) _O0; - static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); - static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); - static void g29_what_command(); - static void g29_eeprom_dump(); - static void g29_compare_current_mesh_to_stored_mesh(); - static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static void smart_fill_mesh(); - - public: - - static void echo_name(); - static void report_current_mesh(); - static void report_state(); - static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); - static void display_map(const int) _O0; - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]) _O0; - static mesh_index_pair find_furthest_invalid_mesh_point() _O0; - static void reset(); - static void invalidate(); - static void set_all_mesh_points_to_value(const float value); - static void adjust_mesh_to_mean(const bool cflag, const float value); - static bool sanity_check(); - - static void G29() _O0; // O0 for no optimization - static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560 - - 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) - }; - - #if ENABLED(ULTIPANEL) - static bool lcd_map_control; - #endif - - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. - - 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)); - 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)); - 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 - // that is OK because something else should be keeping that from - // 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.5f) * (1.0f / (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.5f) * (1.0f / (MESH_Y_DIST)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - /** - * z2 --| - * z0 | | - * | | + (z2-z1) - * z1 | | | - * ---+-------------+--------+-- --| - * a1 a0 a2 - * |<---delta_a---------->| - * - * calc_z0 is the basis for all the Mesh Based correction. It is used to - * find the expected Z Height at a position between two known Z-Height locations. - * - * It is fairly expensive with its 4 floating point additions and 2 floating point - * multiplications. - */ - FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); - } - - /** - * z_correction_for_x_on_horizontal_mesh_line is an optimization for - * the case where the printer is making a vertical line that only crosses horizontal mesh lines. - */ - inline static float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1_i") : PSTR("yi") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0); - SERIAL_ECHOPAIR(",x1_i=", x1_i); - SERIAL_ECHOPAIR(",yi=", yi); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - // - // See comments above for z_correction_for_x_on_horizontal_mesh_line - // - inline static float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0); - SERIAL_ECHOPAIR(", xi=", xi); - SERIAL_ECHOPAIR(", y1_i=", y1_i); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - /** - * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first - * does a linear interpolation along both of the bounding X-Mesh-Lines to find the - * Z-Height at both ends. Then it does a linear interpolation of these heights based - * on the Y position within the cell. - */ - static float get_z_correction(const float &rx0, const float &ry0) { - const int8_t cx = get_cell_index_x(rx0), - cy = get_cell_index_y(ry0); // return values are clamped - - /** - * Check if the requested location is off the mesh. If so, and - * UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned. - */ - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - if (!WITHIN(rx0, MESH_MIN_X, MESH_MAX_X) || !WITHIN(ry0, MESH_MIN_Y, MESH_MAX_Y)) - return UBL_Z_RAISE_WHEN_OFF_MESH; - #endif - - const float z1 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][cy], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]); - - const float z2 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]); - - float z0 = calc_z0(ry0, - mesh_index_to_ypos(cy), z1, - mesh_index_to_ypos(cy + 1), z2); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR(" raw get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(z0, 6); - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPGM(" >>>---> "); - SERIAL_ECHO_F(z0, 6); - SERIAL_EOL(); - } - #endif - - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - } - return z0; - } - - FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { - return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); - } - - FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { - return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); - } - - #if UBL_SEGMENTED - static bool prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate); - #else - static void line_to_destination_cartesian(const float &fr, const uint8_t e); - #endif - - inline static bool mesh_is_valid() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) return false; - return true; - } - -}; // class unified_bed_leveling - -extern unified_bed_leveling ubl; - -FORCE_INLINE void gcode_G29() { ubl.G29(); } - -#endif // UNIFIED_BED_LEVELING_H diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp deleted file mode 100644 index c401fa6962..0000000000 --- a/Marlin/ubl_G29.cpp +++ /dev/null @@ -1,1820 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - //#define UBL_DEVEL_DEBUGGING - - #include "ubl.h" - #include "Marlin.h" - #include "hex_print_routines.h" - #include "configuration_store.h" - #include "ultralcd.h" - #include "stepper.h" - #include "planner.h" - #include "parser.h" - #include "serial.h" - #include "bitmap_flags.h" - - #include - #include "least_squares_fit.h" - - #define UBL_G29_P31 - - extern float destination[XYZE], current_position[XYZE]; - - #if ENABLED(NEWPANEL) - void lcd_return_to_status(); - void _lcd_ubl_output_map_lcd(); - #endif - - #define SIZE_OF_LITTLE_RAISE 1 - #define BIG_RAISE_NOT_NEEDED 0 - - int unified_bed_leveling::g29_verbose_level, - unified_bed_leveling::g29_phase_value, - unified_bed_leveling::g29_repetition_cnt, - unified_bed_leveling::g29_storage_slot = 0, - unified_bed_leveling::g29_map_type; - bool unified_bed_leveling::g29_c_flag, - unified_bed_leveling::g29_x_flag, - unified_bed_leveling::g29_y_flag; - float unified_bed_leveling::g29_x_pos, - unified_bed_leveling::g29_y_pos, - unified_bed_leveling::g29_card_thickness = 0, - unified_bed_leveling::g29_constant = 0; - - #if HAS_BED_PROBE - int unified_bed_leveling::g29_grid_size; - #endif - - /** - * G29: Unified Bed Leveling by Roxy - * - * Parameters understood by this leveling system: - * - * A Activate Activate the Unified Bed Leveling system. - * - * B # Business Use the 'Business Card' mode of the Manual Probe subsystem with P2. - * Note: A non-compressible Spark Gap feeler gauge is recommended over a business card. - * In this mode of G29 P2, a business or index card is used as a shim that the nozzle can - * grab onto as it is lowered. In principle, the nozzle-bed distance is the same when the - * same resistance is felt in the shim. You can omit the numerical value on first invocation - * of G29 P2 B to measure shim thickness. Subsequent use of 'B' will apply the previously- - * measured thickness by default. - * - * C Continue G29 P1 C continues the generation of a partially-constructed Mesh without invalidating - * previous measurements. - * - * C G29 P2 C tells the Manual Probe subsystem to not use the current nozzle - * location in its search for the closest unmeasured Mesh Point. Instead, attempt to - * start at one end of the uprobed points and Continue sequentially. - * - * G29 P3 C specifies the Constant for the fill. Otherwise, uses a "reasonable" value. - * - * C Current G29 Z C uses the Current location (instead of bed center or nearest edge). - * - * D Disable Disable the Unified Bed Leveling system. - * - * E Stow_probe Stow the probe after each sampled point. - * - * F # Fade Fade the amount of Mesh Based Compensation over a specified height. At the - * specified height, no correction is applied and natural printer kenimatics take over. If no - * number is specified for the command, 10mm is assumed to be reasonable. - * - * H # Height With P2, 'H' specifies the Height to raise the nozzle after each manual probe of the bed. - * If omitted, the nozzle will raise by Z_CLEARANCE_BETWEEN_PROBES. - * - * H # Offset With P4, 'H' specifies the Offset above the mesh height to place the nozzle. - * If omitted, Z_CLEARANCE_BETWEEN_PROBES will be used. - * - * I # Invalidate Invalidate the specified number of Mesh Points near the given 'X' 'Y'. If X or Y are omitted, - * the nozzle location is used. If no 'I' value is given, only the point nearest to the location - * is invalidated. Use 'T' to produce a map afterward. This command is useful to invalidate a - * portion of the Mesh so it can be adjusted using other UBL tools. When attempting to invalidate - * an isolated bad mesh point, the 'T' option shows the nozzle position in the Mesh with (#). You - * can move the nozzle around and use this feature to select the center of the area (or cell) to - * invalidate. - * - * J # Grid Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side. - * Not specifying a grid size will invoke the 3-Point leveling function. - * - * K # Kompare Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This - * command literally performs a diff between two Meshes. - * - * L Load Load Mesh from the previously activated location in the EEPROM. - * - * L # Load Load Mesh from the specified location in the EEPROM. Set this location as activated - * for subsequent Load and Store operations. - * - * The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will - * start off being initialized with a G29 P0 or a G29 P1. Further refinement of the Mesh happens with - * each additional Phase that processes it. - * - * P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System. This reverts the - * 3D Printer to the same state it was in before the Unified Bed Leveling Compensation - * was turned on. Setting the entire Mesh to Zero is a special case that allows - * a subsequent G or T leveling operation for backward compatibility. - * - * P1 Phase 1 Invalidate entire Mesh and continue with automatic generation of the Mesh data using - * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. For delta - * printers only the areas where the probe and nozzle can both reach will be automatically probed. - * - * Unreachable points will be handled in Phase 2 and Phase 3. - * - * Use 'C' to leave the previous mesh intact and automatically probe needed points. This allows you - * to invalidate parts of the Mesh but still use Automatic Probing. - * - * The 'X' and 'Y' parameters prioritize where to try and measure points. If omitted, the current - * probe position is used. - * - * Use 'T' (Topology) to generate a report of mesh generation. - * - * P1 will suspend Mesh generation if the controller button is held down. Note that you may need - * to press and hold the switch for several seconds if moves are underway. - * - * P2 Phase 2 Probe unreachable points. - * - * Use 'H' to set the height between Mesh points. If omitted, Z_CLEARANCE_BETWEEN_PROBES is used. - * Smaller values will be quicker. Move the nozzle down till it barely touches the bed. Make sure the - * nozzle is clean and unobstructed. Use caution and move slowly. This can damage your printer! - * (Uses SIZE_OF_LITTLE_RAISE mm if the nozzle is moving less than BIG_RAISE_NOT_NEEDED mm.) - * - * The 'H' value can be negative if the Mesh dips in a large area. Press and hold the - * controller button to terminate the current Phase 2 command. You can then re-issue "G29 P 2" - * with an 'H' parameter more suitable for the area you're manually probing. Note that the command - * tries to start in a corner of the bed where movement will be predictable. Override the distance - * calculation location with the X and Y parameters. You can print a Mesh Map (G29 T) to see where - * the mesh is invalidated and where the nozzle needs to move to complete the command. Use 'C' to - * indicate that the search should be based on the current position. - * - * The 'B' parameter for this command is described above. It places the manual probe subsystem into - * Business Card mode where the thickness of a business card is measured and then used to accurately - * set the nozzle height in all manual probing for the duration of the command. A Business card can - * be used, but you'll get better results with a flexible Shim that doesn't compress. This makes it - * easier to produce similar amounts of force and get more accurate measurements. Google if you're - * not sure how to use a shim. - * - * The 'T' (Map) parameter helps track Mesh building progress. - * - * NOTE: P2 requires an LCD controller! - * - * P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths to - * go down: - * - * - If a 'C' constant is specified, the closest invalid mesh points to the nozzle will be filled, - * and a repeat count can then also be specified with 'R'. - * - * - Leaving out 'C' invokes Smart Fill, which scans the mesh from the edges inward looking for - * invalid mesh points. Adjacent points are used to determine the bed slope. If the bed is sloped - * upward from the invalid point, it takes the value of the nearest point. If sloped downward, it's - * replaced by a value that puts all three points in a line. This version of G29 P3 is a quick, easy - * and (usually) safe way to populate unprobed mesh regions before continuing to G26 Mesh Validation - * Pattern. Note that this populates the mesh with unverified values. Pay attention and use caution. - * - * P4 Phase 4 Fine tune the Mesh. The Delta Mesh Compensation System assumes the existence of - * an LCD Panel. It is possible to fine tune the mesh without an LCD Panel using - * G42 and M421. See the UBL documentation for further details. - * - * Phase 4 is meant to be used with G26 Mesh Validation to fine tune the mesh by direct editing - * of Mesh Points. Raise and lower points to fine tune the mesh until it gives consistently reliable - * adhesion. - * - * P4 moves to the closest Mesh Point (and/or the given X Y), raises the nozzle above the mesh height - * by the given 'H' offset (or default 0), and waits while the controller is used to adjust the nozzle - * height. On click the displayed height is saved in the mesh. - * - * Start Phase 4 at a specific location with X and Y. Adjust a specific number of Mesh Points with - * the 'R' (Repeat) parameter. (If 'R' is left out, the whole matrix is assumed.) This command can be - * terminated early (e.g., after editing the area of interest) by pressing and holding the encoder button. - * - * The general form is G29 P4 [R points] [X position] [Y position] - * - * The H [offset] parameter is useful if a shim is used to fine-tune the mesh. For a 0.4mm shim the - * command would be G29 P4 H0.4. The nozzle is moved to the shim height, you adjust height to the shim, - * and on click the height minus the shim thickness will be saved in the mesh. - * - * !!Use with caution, as a very poor mesh could cause the nozzle to crash into the bed!! - * - * NOTE: P4 is not available unless you have LCD support enabled! - * - * P5 Phase 5 Find Mean Mesh Height and Standard Deviation. Typically, it is easier to use and - * work with the Mesh if it is Mean Adjusted. You can specify a C parameter to - * Correct the Mesh to a 0.00 Mean Height. Adding a C parameter will automatically - * execute a G29 P6 C . - * - * P6 Phase 6 Shift Mesh height. The entire Mesh's height is adjusted by the height specified - * with the C parameter. Being able to adjust the height of a Mesh is useful tool. It - * can be used to compensate for poorly calibrated Z-Probes and other errors. Ideally, - * you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring - * 0.000 at the Z Home location. - * - * Q Test Load specified Test Pattern to assist in checking correct operation of system. This - * command is not anticipated to be of much value to the typical user. It is intended - * for developers to help them verify correct operation of the Unified Bed Leveling System. - * - * R # Repeat Repeat this command the specified number of times. If no number is specified the - * command will be repeated GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y times. - * - * S Store Store the current Mesh in the Activated area of the EEPROM. It will also store the - * current state of the Unified Bed Leveling system in the EEPROM. - * - * S # Store Store the current Mesh at the specified location in EEPROM. Activate this location - * for subsequent Load and Store operations. Valid storage slot numbers begin at 0 and - * extend to a limit related to the available EEPROM storage. - * - * S -1 Store Print the current Mesh as G-code that can be used to restore the mesh anytime. - * - * T Topology Display the Mesh Map Topology. - * 'T' can be used alone (e.g., G29 T) or in combination with most of the other commands. - * This option works with all Phase commands (e.g., G29 P4 R 5 T X 50 Y100 C -.1 O) - * This parameter can also specify a Map Type. T0 (the default) is user-readable. T1 can - * is suitable to paste into a spreadsheet for a 3D graph of the mesh. - * - * U Unlevel Perform a probe of the outer perimeter to assist in physically leveling unlevel beds. - * Only used for G29 P1 T U. This speeds up the probing of the edge of the bed. Useful - * when the entire bed doesn't need to be probed because it will be adjusted. - * - * V # Verbosity Set the verbosity level (0-4) for extra details. (Default 0) - * - * W What? Display valuable Unified Bed Leveling System data. - * - * X # X Location for this command - * - * Y # Y Location for this command - * - * - * Release Notes: - * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all - * kinds of problems. Enabling EEPROM Storage is required. - * - * When you do a G28 and G29 P1 to automatically build your first mesh, you are going to notice that - * UBL probes points increasingly further from the starting location. (The starting location defaults - * to the center of the bed.) In contrast, ABL and MBL follow a zigzag pattern. The spiral pattern is - * 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 - * 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 - * the mesh just right. To prevent this valuable data from being destroyed as the EEPROM structure - * evolves, UBL stores all mesh data at the end of EEPROM. - * - * UBL is founded on Edward Patel's Mesh Bed Leveling code. A big 'Thanks!' to him and the creators of - * 3-Point and Grid Based leveling. Combining their contributions we now have the functionality and - * features of all three systems combined. - */ - - void unified_bed_leveling::G29() { - - if (g29_parameter_parsing()) return; // Abort on parameter error - - const int8_t p_val = parser.intval('P', -1); - const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'); - - // Check for commands that require the printer to be homed - if (may_move) { - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - if (axis_unhomed_error()) home_all_axes(); - } - - // Invalidate Mesh Points. This command is a little bit asymmetrical because - // it directly specifies the repetition count and does not use the 'R' parameter. - if (parser.seen('I')) { - uint8_t cnt = 0; - g29_repetition_cnt = parser.has_value() ? parser.value_int() : 1; - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(NAN); - } - else { - while (g29_repetition_cnt--) { - if (cnt > 20) { cnt = 0; idle(); } - const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); - if (location.x_index < 0) { - // No more REACHABLE mesh points to invalidate, so we ASSUME the user - // meant to invalidate the ENTIRE mesh, which cannot be done with - // find_closest_mesh_point loop which only returns REACHABLE points. - set_all_mesh_points_to_value(NAN); - SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n"); - break; // No more invalid Mesh Points to populate - } - z_values[location.x_index][location.y_index] = NAN; - cnt++; - } - } - SERIAL_PROTOCOLLNPGM("Locations invalidated.\n"); - } - - if (parser.seen('Q')) { - const int test_pattern = parser.has_value() ? parser.value_int() : -99; - if (!WITHIN(test_pattern, -1, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid test_pattern value. (-1 to 2)\n"); - return; - } - SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n"); - switch (test_pattern) { - case -1: - g29_eeprom_dump(); - break; - case 0: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. - const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x, - p2 = 0.5f * (GRID_MAX_POINTS_Y) - y; - z_values[x][y] += 2.0f * HYPOT(p1, p2); - } - } - break; - case 1: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised - z_values[x][x] += 9.999f; - z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick - } - break; - case 2: - // Allow the user to specify the height because 10mm is a little extreme in some cases. - for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in - for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed - z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f; - break; - } - } - - #if HAS_BED_PROBE - - if (parser.seen('J')) { - if (g29_grid_size) { // if not 0 it is a normal n x n grid being probed - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(false /* false says to do normal grid probing */ ); - restore_ubl_active_state_and_leave(); - } - else { // grid_size == 0 : A 3-Point leveling has been requested - - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ ); - restore_ubl_active_state_and_leave(); - } - do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); - report_current_position(); - } - - #endif // HAS_BED_PROBE - - if (parser.seen('P')) { - if (WITHIN(g29_phase_value, 0, 1) && storage_slot == -1) { - storage_slot = 0; - SERIAL_PROTOCOLLNPGM("Default storage slot 0 selected."); - } - - switch (g29_phase_value) { - case 0: - // - // Zero Mesh Data - // - reset(); - SERIAL_PROTOCOLLNPGM("Mesh zeroed."); - break; - - #if HAS_BED_PROBE - - case 1: - // - // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe - // - if (!parser.seen('C')) { - invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated. Probing mesh."); - } - if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPAIR("Probing Mesh Points Closest to (", g29_x_pos); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL(g29_y_pos); - SERIAL_PROTOCOLLNPGM(").\n"); - } - probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, - parser.seen('T'), parser.seen('E'), parser.seen('U')); - - report_current_position(); - break; - - #endif // HAS_BED_PROBE - - case 2: { - #if ENABLED(NEWPANEL) - // - // Manually Probe Mesh in areas that can't be reached by the probe - // - SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations."); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - - if (parser.seen('C') && !g29_x_flag && !g29_y_flag) { - /** - * Use a good default location for the path. - * The flipped > and < operators in these comparisons is intentional. - * It should cause the probed points to follow a nice path on Cartesian printers. - * It may make sense to have Delta printers default to the center of the bed. - * Until that is decided, this can be forced with the X and Y parameters. - */ - #if IS_KINEMATIC - 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; - #endif - } - - if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); - if (ABS(g29_card_thickness) > 1.5f) { - SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement."); - return; - } - } - - if (!position_is_reachable(g29_x_pos, g29_y_pos)) { - SERIAL_PROTOCOLLNPGM("XY outside printable radius."); - return; - } - - const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES); - manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T')); - - SERIAL_PROTOCOLLNPGM("G29 P2 finished."); - - report_current_position(); - - #else - - SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present."); - return; - - #endif - } break; - - case 3: { - /** - * Populate invalid mesh areas. Proceed with caution. - * Two choices are available: - * - Specify a constant with the 'C' parameter. - * - Allow 'G29 P3' to choose a 'reasonable' constant. - */ - - if (g29_c_flag) { - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(g29_constant); - } - else { - while (g29_repetition_cnt--) { // this only populates reachable mesh points near - const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); - if (location.x_index < 0) { - // No more REACHABLE INVALID mesh points to populate, so we ASSUME - // user meant to populate ALL INVALID mesh points to value - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) - z_values[x][y] = g29_constant; - break; // No more invalid Mesh Points to populate - } - z_values[location.x_index][location.y_index] = g29_constant; - } - } - } - else { - const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 - #if ENABLED(UBL_G29_P31) - case 1: { - - // P3.1 use least squares fit to fill missing mesh values - // P3.10 zero weighting for distance, all grid points equal, best fit tilted plane - // P3.11 10X weighting for nearest grid points versus farthest grid points - // P3.12 100X distance weighting - // P3.13 1000X distance weighting, approaches simple average of nearest points - - const float weight_power = (cvf - 3.10f) * 100.0f, // 3.12345 -> 2.345 - weight_factor = weight_power ? POW(10.0f, weight_power) : 0; - smart_fill_wlsf(weight_factor); - } - break; - #endif - case 0: // P3 or P3.0 - default: // and anything P3.x that's not P3.1 - smart_fill_mesh(); // Do a 'Smart' fill using nearby known values - break; - } - } - break; - } - - case 4: // Fine Tune (i.e., Edit) the Mesh - #if ENABLED(NEWPANEL) - fine_tune_mesh(g29_x_pos, g29_y_pos, parser.seen('T')); - #else - SERIAL_PROTOCOLLNPGM("?P4 is only available when an LCD is present."); - return; - #endif - break; - - case 5: adjust_mesh_to_mean(g29_c_flag, g29_constant); break; - - case 6: shift_mesh_height(); break; - } - } - - // - // Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - // good to have the extra information. Soon... we prune this to just a few items - // - if (parser.seen('W')) g29_what_command(); - - // - // When we are fully debugged, this may go away. But there are some valid - // use cases for the users. So we can wait and see what to do with it. - // - - if (parser.seen('K')) // Kompare Current Mesh Data to Specified Stored Mesh - g29_compare_current_mesh_to_stored_mesh(); - - // - // Load a Mesh from the EEPROM - // - - if (parser.seen('L')) { // Load Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_PROTOCOLLNPGM("Done."); - } - - // - // Store a Mesh in the EEPROM - // - - if (parser.seen('S')) { // Store (or Save) Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - if (g29_storage_slot == -1) // Special case, the user wants to 'Export' the mesh to the - return report_current_mesh(); // host program to be saved on the user's computer - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - goto LEAVE; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - goto LEAVE; - } - - settings.store_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_PROTOCOLLNPGM("Done."); - } - - if (parser.seen('T')) - display_map(g29_map_type); - - LEAVE: - - #if ENABLED(NEWPANEL) - lcd_reset_alert_level(); - lcd_quick_feedback(true); - lcd_reset_status(); - lcd_external_control = false; - #endif - - return; - } - - void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) { - float sum = 0; - int n = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - sum += z_values[x][y]; - n++; - } - - const float mean = sum / n; - - // - // Sum the squares of difference from mean - // - float sum_of_diff_squared = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - sum_of_diff_squared += sq(z_values[x][y] - mean); - - SERIAL_ECHOLNPAIR("# of samples: ", n); - SERIAL_ECHOPGM("Mean Mesh Height: "); - SERIAL_ECHO_F(mean, 6); - SERIAL_EOL(); - - const float sigma = SQRT(sum_of_diff_squared / (n + 1)); - SERIAL_ECHOPGM("Standard Deviation: "); - SERIAL_ECHO_F(sigma, 6); - SERIAL_EOL(); - - if (cflag) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - z_values[x][y] -= mean + value; - } - - void unified_bed_leveling::shift_mesh_height() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - z_values[x][y] += g29_constant; - } - - #if ENABLED(NEWPANEL) - - typedef void (*clickFunc_t)(); - - bool click_and_hold(const clickFunc_t func=NULL) { - if (is_lcd_clicked()) { - lcd_quick_feedback(false); // Do NOT clear button status! If cleared, the code - // code can not look for a 'click and hold' - const millis_t nxt = millis() + 1500UL; - while (is_lcd_clicked()) { // Loop while the encoder is pressed. Uses hardware flag! - idle(); // idle, of course - if (ELAPSED(millis(), nxt)) { // After 1.5 seconds - lcd_quick_feedback(true); - if (func) (*func)(); - wait_for_release(); - safe_delay(50); // Debounce the Encoder wheel - return true; - } - } - } - safe_delay(15); - return false; - } - - #endif // NEWPANEL - - #if HAS_BED_PROBE - /** - * Probe all invalidated locations of the mesh that can be reached by the probe. - * This attempts to fill in locations closest to the nozzle's start location first. - */ - void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { - mesh_index_pair location; - - #if ENABLED(NEWPANEL) - lcd_external_control = true; - #endif - - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe - DEPLOY_PROBE(); - - uint16_t count = GRID_MAX_POINTS; - - do { - if (do_ubl_mesh_map) display_map(g29_map_type); - - #if ENABLED(NEWPANEL) - if (is_lcd_clicked()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n"); - lcd_quick_feedback(false); - STOW_PROBE(); - while (is_lcd_clicked()) idle(); - lcd_external_control = false; - restore_ubl_active_state_and_leave(); - lcd_quick_feedback(true); - safe_delay(50); // Debounce the Encoder wheel - return; - } - #endif - - if (do_furthest) - location = find_furthest_invalid_mesh_point(); - else - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL); - - 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); - - const float measured_z = probe_pt(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; - } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && --count); - - STOW_PROBE(); - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - 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) - ); - } - - - #endif // HAS_BED_PROBE - - #if ENABLED(NEWPANEL) - - void unified_bed_leveling::move_z_with_encoder(const float &multiplier) { - wait_for_release(); - while (!is_lcd_clicked()) { - idle(); - reset_stepper_timeout(); // Keep steppers powered - if (encoder_diff) { - do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) * multiplier); - encoder_diff = 0; - } - } - } - - float unified_bed_leveling::measure_point_with_encoder() { - KEEPALIVE_STATE(PAUSED_FOR_USER); - move_z_with_encoder(0.01f); - KEEPALIVE_STATE(IN_HANDLER); - return current_position[Z_AXIS]; - } - - static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); } - - float unified_bed_leveling::measure_business_card_thickness(float in_height) { - lcd_external_control = true; - save_ubl_active_state_and_disable(); // Disable bed level correction for probing - - do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); - //, MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) * 0.5f); - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Place shim under nozzle"); - LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); - lcd_return_to_status(); - echo_and_take_a_measurement(); - - const float z1 = measure_point_with_encoder(); - do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE); - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Remove shim"); - LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE); - echo_and_take_a_measurement(); - - const float z2 = measure_point_with_encoder(); - - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES); - - const float thickness = ABS(z1 - z2); - - if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPGM("Business Card is "); - SERIAL_PROTOCOL_F(thickness, 4); - SERIAL_PROTOCOLLNPGM("mm thick."); - } - - lcd_external_control = false; - - restore_ubl_active_state_and_leave(); - - return thickness; - } - - void abort_manual_probe_remaining_mesh() { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - lcd_quick_feedback(true); - ubl.restore_ubl_active_state_and_leave(); - } - - void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { - - lcd_external_control = true; - - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_clearance); - - lcd_return_to_status(); - - mesh_index_pair location; - do { - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_NOZZLE_AS_REFERENCE, NULL); - // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. - if (location.x_index < 0 && location.y_index < 0) continue; - - const float xProbe = mesh_index_to_xpos(location.x_index), - yProbe = mesh_index_to_ypos(location.y_index); - - if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) - - LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT); - - do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_z(z_clearance); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - lcd_external_control = true; - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2)); - - const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step - //const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click - - move_z_with_encoder(z_step); - - if (click_and_hold()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - restore_ubl_active_state_and_leave(); - return; - } - - z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick; - if (g29_verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mesh Point Measured at: "); - SERIAL_PROTOCOL_F(z_values[location.x_index][location.y_index], 6); - SERIAL_EOL(); - } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && location.y_index >= 0); - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - restore_ubl_active_state_and_leave(); - KEEPALIVE_STATE(IN_HANDLER); - do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE); - } - #endif // NEWPANEL - - bool unified_bed_leveling::g29_parameter_parsing() { - bool err_flag = false; - - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_DOING_G29); - lcd_quick_feedback(true); - #endif - - g29_constant = 0; - g29_repetition_cnt = 0; - - g29_x_flag = parser.seenval('X'); - g29_x_pos = g29_x_flag ? parser.value_float() : current_position[X_AXIS]; - g29_y_flag = parser.seenval('Y'); - g29_y_pos = g29_y_flag ? parser.value_float() : current_position[Y_AXIS]; - - if (parser.seen('R')) { - g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS; - NOMORE(g29_repetition_cnt, GRID_MAX_POINTS); - if (g29_repetition_cnt < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epetition count invalid (1+).\n"); - return UBL_ERR; - } - } - - g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; - if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).\n"); - err_flag = true; - } - - if (parser.seen('P')) { - const int pv = parser.value_int(); - #if !HAS_BED_PROBE - if (pv == 1) { - SERIAL_PROTOCOLLNPGM("G29 P1 requires a probe.\n"); - err_flag = true; - } - else - #endif - { - g29_phase_value = pv; - if (!WITHIN(g29_phase_value, 0, 6)) { - SERIAL_PROTOCOLLNPGM("?(P)hase value invalid (0-6).\n"); - err_flag = true; - } - } - } - - if (parser.seen('J')) { - #if HAS_BED_PROBE - g29_grid_size = parser.has_value() ? parser.value_int() : 0; - if (g29_grid_size && !WITHIN(g29_grid_size, 2, 9)) { - SERIAL_PROTOCOLLNPGM("?Invalid grid size (J) specified (2-9).\n"); - err_flag = true; - } - #else - SERIAL_PROTOCOLLNPGM("G29 J action requires a probe.\n"); - err_flag = true; - #endif - } - - if (g29_x_flag != g29_y_flag) { - SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n"); - err_flag = true; - } - - // If X or Y are not valid, use center of the bed values - if (!WITHIN(g29_x_pos, X_MIN_BED, X_MAX_BED)) g29_x_pos = X_CENTER; - if (!WITHIN(g29_y_pos, Y_MIN_BED, Y_MAX_BED)) g29_y_pos = Y_CENTER; - - if (err_flag) return UBL_ERR; - - /** - * Activate or deactivate UBL - * Note: UBL's G29 restores the state set here when done. - * Leveling is being enabled here with old data, possibly - * none. Error handling should disable for safety... - */ - if (parser.seen('A')) { - if (parser.seen('D')) { - SERIAL_PROTOCOLLNPGM("?Can't activate and deactivate at the same time.\n"); - return UBL_ERR; - } - set_bed_leveling_enabled(true); - report_state(); - } - else if (parser.seen('D')) { - set_bed_leveling_enabled(false); - report_state(); - } - - // Set global 'C' flag and its value - if ((g29_c_flag = parser.seen('C'))) - g29_constant = parser.value_float(); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seenval('F')) { - const float fh = parser.value_float(); - if (!WITHIN(fh, 0, 100)) { - SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); - return UBL_ERR; - } - set_z_fade_height(fh); - } - #endif - - g29_map_type = parser.intval('T'); - if (!WITHIN(g29_map_type, 0, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid map type.\n"); - return UBL_ERR; - } - return UBL_OK; - } - - static uint8_t ubl_state_at_invocation = 0; - - #ifdef UBL_DEVEL_DEBUGGING - static uint8_t ubl_state_recursion_chk = 0; - #endif - - void unified_bed_leveling::save_ubl_active_state_and_disable() { - #ifdef UBL_DEVEL_DEBUGGING - ubl_state_recursion_chk++; - if (ubl_state_recursion_chk != 1) { - SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR); - lcd_quick_feedback(true); - #endif - return; - } - #endif - ubl_state_at_invocation = planner.leveling_active; - set_bed_leveling_enabled(false); - } - - void unified_bed_leveling::restore_ubl_active_state_and_leave() { - #ifdef UBL_DEVEL_DEBUGGING - if (--ubl_state_recursion_chk) { - SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR); - lcd_quick_feedback(true); - #endif - return; - } - #endif - set_bed_leveling_enabled(ubl_state_at_invocation); - } - - /** - * Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - * good to have the extra information. Soon... we prune this to just a few items - */ - void unified_bed_leveling::g29_what_command() { - report_state(); - - if (storage_slot == -1) - SERIAL_PROTOCOLPGM("No Mesh Loaded."); - else { - SERIAL_PROTOCOLPAIR("Mesh ", storage_slot); - SERIAL_PROTOCOLPGM(" Loaded."); - } - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_PROTOCOLPGM("planner.z_fade_height : "); - SERIAL_PROTOCOL_F(planner.z_fade_height, 4); - SERIAL_EOL(); - #endif - - adjust_mesh_to_mean(g29_c_flag, g29_constant); - - #if HAS_BED_PROBE - SERIAL_PROTOCOLPGM("zprobe_zoffset: "); - SERIAL_PROTOCOL_F(zprobe_zoffset, 7); - SERIAL_EOL(); - #endif - - SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); - SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); - safe_delay(50); - - SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - #if HAS_KILL - SERIAL_PROTOCOLPAIR("Kill pin on :", KILL_PIN); - SERIAL_PROTOCOLLNPAIR(" state:", READ(KILL_PIN)); - #endif - SERIAL_EOL(); - safe_delay(50); - - #ifdef UBL_DEVEL_DEBUGGING - SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index())); - SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index())); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); - SERIAL_EOL(); - safe_delay(25); - - SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes()); - SERIAL_PROTOCOLLNPGM(" meshes.\n"); - safe_delay(25); - #endif // UBL_DEVEL_DEBUGGING - - if (!sanity_check()) { - echo_name(); - SERIAL_PROTOCOLLNPGM(" sanity checks passed."); - } - } - - /** - * When we are fully debugged, the EEPROM dump command will get deleted also. But - * right now, it is good to have the extra information. Soon... we prune this. - */ - void unified_bed_leveling::g29_eeprom_dump() { - unsigned char cccc; - unsigned int kkkk; // Needs to be of unspecfied size to compile clean on all platforms - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM Dump:"); - for (uint16_t i = 0; i <= E2END; i += 16) { - if (!(i & 0x3)) idle(); - print_hex_word(i); - SERIAL_ECHOPGM(": "); - for (uint16_t j = 0; j < 16; j++) { - kkkk = i + j; - eeprom_read_block(&cccc, (const void *)kkkk, sizeof(unsigned char)); - print_hex_byte(cccc); - SERIAL_ECHO(' '); - } - SERIAL_EOL(); - } - SERIAL_EOL(); - } - - /** - * When we are fully debugged, this may go away. But there are some valid - * use cases for the users. So we can wait and see what to do with it. - */ - void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?Storage slot # required."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - g29_storage_slot = parser.value_int(); - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - settings.load_mesh(g29_storage_slot, &tmp_z_values); - - SERIAL_PROTOCOLPAIR("Subtracting mesh in slot ", g29_storage_slot); - SERIAL_PROTOCOLLNPGM(" from current mesh."); - - 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] -= tmp_z_values[x][y]; - } - - mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { - - bool found_a_NAN = false, found_a_real = false; - - mesh_index_pair out_mesh; - out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.99f; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if (isnan(z_values[i][j])) { // Check to see if this location holds an invalid mesh point - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); - - if (!position_is_reachable_by_probe(mx, my)) // make sure the probe can get to the mesh point - continue; - - found_a_NAN = true; - - int8_t closest_x = -1, closest_y = -1; - float d1, d2 = 99999.9f; - for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { - for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { - if (!isnan(z_values[k][l])) { - found_a_real = true; - - // Add in a random weighting factor that scrambles the probing of the - // last half of the mesh (when every unprobed mesh point is one index - // from a probed location). - - d1 = HYPOT(i - k, j - l) + (1.0f / ((millis() % 47) + 13)); - - if (d1 < d2) { // found a closer distance from invalid mesh point at (i,j) to defined mesh point at (k,l) - d2 = d1; // found a closer location with - closest_x = i; // an assigned mesh point value - closest_y = j; - } - } - } - } - - // - // At this point d2 should have the closest defined mesh point to invalid mesh point (i,j) - // - - if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) { - out_mesh.distance = d2; // found an invalid location with a greater distance - out_mesh.x_index = closest_x; // to a defined mesh point - out_mesh.y_index = closest_y; - } - } - } // for j - } // for i - - if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing - out_mesh.x_index = GRID_MAX_POINTS_X / 2; - out_mesh.y_index = GRID_MAX_POINTS_Y / 2; - out_mesh.distance = 1; - } - return out_mesh; - } - - mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &rx, const float &ry, const bool probe_as_reference, uint16_t bits[16]) { - mesh_index_pair out_mesh; - out_mesh.x_index = out_mesh.y_index = -1; - 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); - - float best_so_far = 99999.99f; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if ( (type == INVALID && isnan(z_values[i][j])) // Check to see if this location holds the right thing - || (type == REAL && !isnan(z_values[i][j])) - || (type == SET_IN_BITMAP && is_bitmap_set(bits, i, j)) - ) { - // We only get here if we found a Mesh Point of the specified type - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); - - // If using the probe as the reference there are some unreachable locations. - // Also for round beds, there are grid points outside the bed the nozzle can't reach. - // Prune them from the list and ignore them till the next Phase (manual nozzle probing). - - if (probe_as_reference ? !position_is_reachable_by_probe(mx, my) : !position_is_reachable(mx, my)) - continue; - - // Reachable. Check if it's the best_so_far location to the nozzle. - - float distance = HYPOT(px - mx, py - my); - - // factor in the distance from the current location for the normal case - // so the nozzle isn't running all over the bed. - distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1f; - if (distance < best_so_far) { - best_so_far = distance; // We found a closer location with - out_mesh.x_index = i; // the specified type of mesh value. - out_mesh.y_index = j; - out_mesh.distance = best_so_far; - } - } - } // for j - } // for i - - return out_mesh; - } - - #if ENABLED(NEWPANEL) - - void abort_fine_tune() { - lcd_return_to_status(); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - LCD_MESSAGEPGM(MSG_EDITING_STOPPED); - lcd_quick_feedback(true); - } - - void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { - if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified - g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; - if (!WITHIN(h_offset, 0, 10)) { - SERIAL_PROTOCOLLNPGM("Offset out of bounds. (0 to 10mm)\n"); - return; - } - #endif - - mesh_index_pair location; - - if (!position_is_reachable(rx, ry)) { - SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius."); - return; - } - - save_ubl_active_state_and_disable(); - - LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - lcd_external_control = true; // Take over control of the LCD encoder - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif - - uint16_t not_done[16]; - memset(not_done, 0xFF, sizeof(not_done)); - do { - location = find_closest_mesh_point_of_type(SET_IN_BITMAP, rx, ry, USE_NOZZLE_AS_REFERENCE, not_done); - - if (location.x_index < 0) break; // Stop when there are no more reachable points - - bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so a new - // location is used on the next loop - - const float rawx = mesh_index_to_xpos(location.x_index), - rawy = mesh_index_to_ypos(location.y_index); - - if (!position_is_reachable(rawx, rawy)) break; // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable - - do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point - - lcd_refresh(); - - float new_z = z_values[location.x_index][location.y_index]; - if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place - - lcd_mesh_edit_setup(new_z); - - do { - new_z = lcd_mesh_edit(); - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited - #endif - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (!is_lcd_clicked()); - - if (!lcd_map_control) lcd_return_to_status(); // Just editing a single point? Return to status - - if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing - - z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value - - safe_delay(20); // No switch noise - lcd_refresh(); - - } while (location.x_index >= 0 && --g29_repetition_cnt > 0); - - FINE_TUNE_EXIT: - - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - - if (do_ubl_mesh_map) display_map(g29_map_type); - restore_ubl_active_state_and_leave(); - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); - - LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); - SERIAL_ECHOLNPGM("Done Editing Mesh"); - - if (lcd_map_control) - lcd_goto_screen(_lcd_ubl_output_map_lcd); - else - lcd_return_to_status(); - } - - #endif // NEWPANEL - - /** - * 'Smart Fill': Scan from the outward edges of the mesh towards the center. - * If an invalid location is found, use the next two points (if valid) to - * calculate a 'reasonable' value for the unprobed mesh point. - */ - - bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - const int8_t x1 = x + xdir, x2 = x1 + xdir, - y1 = y + ydir, y2 = y1 + ydir; - // A NAN next to a pair of real values? - if (isnan(z_values[x][y]) && !isnan(z_values[x1][y1]) && !isnan(z_values[x2][y2])) { - if (z_values[x1][y1] < z_values[x2][y2]) // Angled downward? - z_values[x][y] = z_values[x1][y1]; // Use nearest (maybe a little too high.) - else - z_values[x][y] = 2.0f * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... - return true; - } - return false; - } - - typedef struct { uint8_t sx, ex, sy, ey; bool yfirst; } smart_fill_info; - - void unified_bed_leveling::smart_fill_mesh() { - static const smart_fill_info - info0 PROGMEM = { 0, GRID_MAX_POINTS_X, 0, GRID_MAX_POINTS_Y - 2, false }, // Bottom of the mesh looking up - info1 PROGMEM = { 0, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - 1, 0, false }, // Top of the mesh looking down - info2 PROGMEM = { 0, GRID_MAX_POINTS_X - 2, 0, GRID_MAX_POINTS_Y, true }, // Left side of the mesh looking right - info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left - static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 }; - - for (uint8_t i = 0; i < COUNT(info); ++i) { - const smart_fill_info *f = (smart_fill_info*)pgm_read_ptr(&info[i]); - const int8_t sx = pgm_read_byte(&f->sx), sy = pgm_read_byte(&f->sy), - ex = pgm_read_byte(&f->ex), ey = pgm_read_byte(&f->ey); - if (pgm_read_byte(&f->yfirst)) { - const int8_t dir = ex > sx ? 1 : -1; - for (uint8_t y = sy; y != ey; ++y) - for (uint8_t x = sx; x != ex; x += dir) - if (smart_fill_one(x, y, dir, 0)) break; - } - else { - const int8_t dir = ey > sy ? 1 : -1; - for (uint8_t x = sx; x != ex; ++x) - for (uint8_t y = sy; y != ey; y += dir) - if (smart_fill_one(x, y, 0, dir)) break; - } - } - } - - #if HAS_BED_PROBE - - #include "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); - - bool abort_flag = false; - - float measured_z; - - const float dx = float(x_max - x_min) / (g29_grid_size - 1), - dy = float(y_max - y_min) / (g29_grid_size - 1); - - 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) { - measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_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; - 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); - } - - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level); - //z2 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_2_X, PROBE_PT_2_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); - } - } - - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level); - //z3 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_3_X, PROBE_PT_3_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); - } - } - - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag) { - SERIAL_ECHOPGM("?Error probing point. Aborting operation.\n"); - return; - } - } - else { // !do_3_pt_leveling - - bool zig_zag = false; - for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - const float rx = float(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); - - if (!abort_flag) { - measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling - - abort_flag = isnan(measured_z); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(rx, 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(ry, 7); - SERIAL_ECHOPGM(") logical: "); - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7); - SERIAL_ECHOPGM(") measured: "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_ECHOPGM(" correction: "); - SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7); - } - #endif - - measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM(" final >>>---> "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_EOL(); - } - #endif - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, rx, ry, measured_z); - } - } - - zig_zag ^= true; - } - } - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag || finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOPGM("Could not complete LSF!"); - return; - } - - vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); - - if (g29_verbose_level > 2) { - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); - SERIAL_ECHOLNPGM("]"); - } - - matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - float x_tmp = mesh_index_to_xpos(i), - y_tmp = mesh_index_to_ypos(j), - z_tmp = z_values[i][j]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("before rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); - SERIAL_ECHOPGM("] ---> "); - safe_delay(20); - } - #endif - - apply_rotation_xyz(rotation, x_tmp, y_tmp, z_tmp); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("after rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); - SERIAL_ECHOLNPGM("]"); - safe_delay(55); - } - #endif - - z_values[i][j] = z_tmp - lsf_results.D; - } - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - rotation.debug(PSTR("rotation matrix:\n")); - SERIAL_ECHOPGM("LSF Results A="); - SERIAL_PROTOCOL_F(lsf_results.A, 7); - SERIAL_ECHOPGM(" B="); - SERIAL_PROTOCOL_F(lsf_results.B, 7); - SERIAL_ECHOPGM(" D="); - SERIAL_PROTOCOL_F(lsf_results.D, 7); - SERIAL_EOL(); - safe_delay(55); - - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); - SERIAL_ECHOPGM("]\n"); - SERIAL_EOL(); - - /** - * The following code can be used to check the validity of the mesh tilting algorithm. - * When a 3-Point Mesh Tilt is done, the same algorithm is used as the grid based tilting. - * The only difference is just 3 points are used in the calculations. That fact guarantees - * each probed point should have an exact match when a get_z_correction() for that location - * 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; - SERIAL_ECHOPGM("D from 1st point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); - d = t + normal.z * z2; - SERIAL_EOL(); - SERIAL_ECHOPGM("D from 2nd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); - d = t + normal.z * z3; - SERIAL_ECHOPGM("D from 3rd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); - SERIAL_EOL(); - - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0; - SERIAL_ECHOPGM("D from home location with Z=0 : "); - SERIAL_ECHO_F(d, 6); - SERIAL_EOL(); - - 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; - SERIAL_ECHOPGM("D from home location using mesh value for Z: "); - SERIAL_ECHO_F(d, 6); - - SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT); - SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT ); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); - SERIAL_EOL(); - #endif - } // DEBUGGING(LEVELING) - #endif - - } - - #endif // HAS_BED_PROBE - - #if ENABLED(UBL_G29_P31) - void unified_bed_leveling::smart_fill_wlsf(const float &weight_factor) { - - // For each undefined mesh point, compute a distance-weighted least squares fit - // from all the originally populated mesh points, weighted toward the point - // being extrapolated so that nearby points will have greater influence on - // the point being extrapolated. Then extrapolate the mesh point from WLSF. - - static_assert(GRID_MAX_POINTS_Y <= 16, "GRID_MAX_POINTS_Y too big"); - uint16_t bitmap[GRID_MAX_POINTS_X] = { 0 }; - struct linear_fit_data lsf_results; - - SERIAL_ECHOPGM("Extrapolating mesh..."); - - const float weight_scaled = weight_factor * MAX(MESH_X_DIST, MESH_Y_DIST); - - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) - if (!isnan(z_values[jx][jy])) - SBI(bitmap[jx], jy); - - for (uint8_t ix = 0; ix < GRID_MAX_POINTS_X; ix++) { - const float px = mesh_index_to_xpos(ix); - for (uint8_t iy = 0; iy < GRID_MAX_POINTS_Y; iy++) { - const float py = mesh_index_to_ypos(iy); - if (isnan(z_values[ix][iy])) { - // undefined mesh point at (px,py), compute weighted LSF from original valid mesh points. - incremental_LSF_reset(&lsf_results); - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) { - const float rx = mesh_index_to_xpos(jx); - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) { - if (TEST(bitmap[jx], jy)) { - const float ry = mesh_index_to_ypos(jy), - rz = z_values[jx][jy], - w = 1 + weight_scaled / HYPOT((rx - px), (ry - py)); - incremental_WLSF(&lsf_results, rx, ry, rz, w); - } - } - } - if (finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOLNPGM("Insufficient data"); - return; - } - const float ez = -lsf_results.D - lsf_results.A * px - lsf_results.B * py; - z_values[ix][iy] = ez; - idle(); // housekeeping - } - } - } - - SERIAL_ECHOLNPGM("done"); - } - #endif // UBL_G29_P31 - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin/ubl_motion.cpp b/Marlin/ubl_motion.cpp deleted file mode 100644 index 5272e20795..0000000000 --- a/Marlin/ubl_motion.cpp +++ /dev/null @@ -1,580 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "Marlin.h" - #include "ubl.h" - #include "planner.h" - #include "stepper.h" - #include - #include - - #if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this - inline void set_current_from_destination() { COPY(current_position, destination); } - #else - extern void set_current_from_destination(); - #endif - - #if !UBL_SEGMENTED - - void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, 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 - * just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave - */ - #if ENABLED(SKEW_CORRECTION) - // For skew correction just adjust the destination point and we're done - float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] }, - end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] }; - planner.skew(start[X_AXIS], start[Y_AXIS], start[Z_AXIS]); - planner.skew(end[X_AXIS], end[Y_AXIS], end[Z_AXIS]); - #else - const float (&start)[XYZE] = current_position, - (&end)[XYZE] = destination; - #endif - - const int cell_start_xi = get_cell_index_x(start[X_AXIS]), - cell_start_yi = get_cell_index_y(start[Y_AXIS]), - cell_dest_xi = get_cell_index_x(end[X_AXIS]), - cell_dest_yi = get_cell_index_y(end[Y_AXIS]); - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]); - SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]); - SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]); - SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()")); - } - - // A move within the same cell needs no splitting - if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { - - // For a move off the bed, use a constant Z raise - if (!WITHIN(cell_dest_xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cell_dest_yi, 0, GRID_MAX_POINTS_Y - 1)) { - - // Note: There is no Z Correction in this case. We are off the grid and don't know what - // a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH - // value, that will be used instead of a calculated (Bi-Linear interpolation) correction. - - const float z_raise = 0.0 - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - + 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); - set_current_from_destination(); - - if (g26_debug_flag) - debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination_cartesian()")); - - 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)); - - 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 ]), - z2 = z_values[cell_dest_xi ][cell_dest_yi + 1] + xratio * - (z_values[cell_dest_xi + 1][cell_dest_yi + 1] - z_values[cell_dest_xi][cell_dest_yi + 1]); - - 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)), - 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); - - if (g26_debug_flag) - debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination_cartesian()")); - - set_current_from_destination(); - return; - } - - /** - * Past this point the move is known to cross one or more mesh lines. Check for the most common - * case - crossing only one X or Y line - after details are worked out to reduce computation. - */ - - const float dx = end[X_AXIS] - start[X_AXIS], - dy = end[Y_AXIS] - start[Y_AXIS]; - - const int left_flag = dx < 0.0 ? 1 : 0, - down_flag = dy < 0.0 ? 1 : 0; - - const float adx = left_flag ? -dx : dx, - ady = down_flag ? -dy : dy; - - const int dxi = cell_start_xi == cell_dest_xi ? 0 : left_flag ? -1 : 1, - dyi = cell_start_yi == cell_dest_yi ? 0 : down_flag ? -1 : 1; - - /** - * Compute the extruder scaling factor for each partial move, checking for - * zero-length moves that would result in an infinite scaling factor. - * A float divide is required for this, but then it just multiplies. - * Also select a scaling factor based on the larger of the X and Y - * components. The larger of the two is used to preserve precision. - */ - - const bool use_x_dist = adx > ady; - - float on_axis_distance = use_x_dist ? dx : dy, - e_position = end[E_AXIS] - start[E_AXIS], - z_position = end[Z_AXIS] - start[Z_AXIS]; - - const float e_normalized_dist = e_position / on_axis_distance, - z_normalized_dist = z_position / on_axis_distance; - - int current_xi = cell_start_xi, - current_yi = cell_start_yi; - - const float m = dy / dx, - c = start[Y_AXIS] - m * start[X_AXIS]; - - const bool inf_normalized_flag = (isinf(e_normalized_dist) != 0), - inf_m_flag = (isinf(m) != 0); - - /** - * Handle vertical lines that stay within one column. - * These need not be perfectly vertical. - */ - if (dxi == 0) { // Vertical line? - current_yi += down_flag; // Line going down? Just go to the bottom. - while (current_yi != cell_dest_yi + down_flag) { - current_yi += dyi; - const float next_mesh_line_y = mesh_index_to_ypos(current_yi); - - /** - * Skip the calculations for an infinite slope. - * For others the next X is the same so this can continue. - * Calculate X at the next Y mesh line. - */ - const float rx = inf_m_flag ? start[X_AXIS] : (next_mesh_line_y - c) / m; - - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - const float ry = mesh_index_to_ypos(current_yi); - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading down, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (ry != start[Y_AXIS]) { - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder); - } //else printf("FIRST MOVE PRUNED "); - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("vertical move done in ubl.line_to_destination_cartesian()")); - - // At the final destination? Usually not, but when on a Y Mesh Line it's completed. - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - return; - } - - /** - * Handle horizontal lines that stay within one row. - * These need not be perfectly horizontal. - */ - if (dyi == 0) { // Horizontal line? - current_xi += left_flag; // Heading left? Just go to the left edge of the cell for the first move. - while (current_xi != cell_dest_xi + left_flag) { - current_xi += dxi; - const float next_mesh_line_x = mesh_index_to_xpos(current_xi), - ry = m * next_mesh_line_x + c; // Calculate Y at the next X mesh line - - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - const float rx = mesh_index_to_xpos(current_xi); - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading left, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (rx != start[X_AXIS]) { - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder)) - break; - } //else printf("FIRST MOVE PRUNED "); - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("horizontal move done in ubl.line_to_destination_cartesian()")); - - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - return; - } - - /** - * - * Handle the generic case of a line crossing both X and Y Mesh lines. - * - */ - - int xi_cnt = cell_start_xi - cell_dest_xi, - yi_cnt = cell_start_yi - cell_dest_yi; - - if (xi_cnt < 0) xi_cnt = -xi_cnt; - if (yi_cnt < 0) yi_cnt = -yi_cnt; - - current_xi += left_flag; - current_yi += down_flag; - - while (xi_cnt || yi_cnt) { - - const float next_mesh_line_x = mesh_index_to_xpos(current_xi + dxi), - next_mesh_line_y = mesh_index_to_ypos(current_yi + dyi), - ry = m * next_mesh_line_x + c, // Calculate Y at the next X mesh line - rx = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line - // (No need to worry about m being zero. - // If that was the case, it was already detected - // as a vertical line move above.) - - if (left_flag == (rx > next_mesh_line_x)) { // Check if we hit the Y line first - // Yes! Crossing a Y Mesh Line next - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi - left_flag, current_yi + dyi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : next_mesh_line_y - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - 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)) - break; - current_yi += dyi; - yi_cnt--; - } - else { - // Yes! Crossing a X Mesh Line next - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi + dxi, current_yi - down_flag) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? next_mesh_line_x - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder)) - break; - current_xi += dxi; - xi_cnt--; - } - - if (xi_cnt < 0 || yi_cnt < 0) break; // Too far! Exit the loop and go to FINAL_MOVE - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("generic move done in ubl.line_to_destination_cartesian()")); - - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - } - - #else // UBL_SEGMENTED - - #if IS_SCARA // scale the feed rate from mm/s to degrees/s - static float scara_feed_factor, scara_oldA, scara_oldB; - #endif - - // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic, - // so we call buffer_segment directly here. Per-segmented leveling and kinematics performed first. - - inline void _O2 ubl_buffer_segment_raw(const float (&in_raw)[XYZE], const float &fr) { - - #if ENABLED(SKEW_CORRECTION) - float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS] }; - planner.skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); - #else - const float (&raw)[XYZE] = in_raw; - #endif - - #if ENABLED(DELTA) // apply delta inverse_kinematics - - DELTA_IK(raw); - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder); - - #elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw) - - inverse_kinematics(raw); // this writes delta[ABC] from raw[XYZE] - // should move the feedrate scaling to scara inverse_kinematics - - const float adiff = ABS(delta[A_AXIS] - scara_oldA), - bdiff = ABS(delta[B_AXIS] - scara_oldB); - scara_oldA = delta[A_AXIS]; - scara_oldB = delta[B_AXIS]; - float s_feedrate = MAX(adiff, bdiff) * scara_feed_factor; - - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], s_feedrate, active_extruder); - - #else // CARTESIAN - - planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_AXIS], fr, active_extruder); - - #endif - } - - #if IS_SCARA - #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm - #elif ENABLED(DELTA) - #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND) - #else // CARTESIAN - #ifdef LEVELED_SEGMENT_LENGTH - #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH - #else - #define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation) - #endif - #endif - - /** - * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics. - * This calls planner.buffer_segment multiple times for small incremental moves. - * 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) { - - if (!position_is_reachable(rtarget[X_AXIS], rtarget[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] - }; - - 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 = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = lroundf(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) - #else - uint16_t segments = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length - #endif - - NOLESS(segments, 1U); // must have at least one segment - const float inv_segments = 1.0f / segments; // divide once, multiply thereafter - - #if IS_SCARA // scale the feed rate from mm/s to degrees/s - scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate; - scara_oldA = planner.get_axis_position_degrees(A_AXIS); - scara_oldB = planner.get_axis_position_degrees(B_AXIS); - #endif - - const float diff[XYZE] = { - total[X_AXIS] * inv_segments, - total[Y_AXIS] * inv_segments, - total[Z_AXIS] * inv_segments, - total[E_AXIS] * inv_segments - }; - - // Note that E segment distance could vary slightly as z mesh height - // changes for each segment, but small enough to ignore. - - float raw[XYZE] = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - 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 - while (--segments) { - LOOP_XYZE(i) raw[i] += diff[i]; - ubl_buffer_segment_raw(raw, feedrate); - } - ubl_buffer_segment_raw(rtarget, feedrate); - return false; // moved but did not set_current_from_destination(); - } - - // 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]); - #endif - - // increment to first segment destination - LOOP_XYZE(i) raw[i] += diff[i]; - - for (;;) { // for each mesh cell encountered during the move - - // Compute mesh cell invariants that remain constant for all segments within cell. - // Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter) - // the bilinear interpolation from the adjacent cell within the mesh will still work. - // Inner loop will exit each time (because out of cell bounds) but will come back - // 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)); - - cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); - cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); - - const float x0 = mesh_index_to_xpos(cell_xi), // 64 byte table lookup avoids mul+add - y0 = mesh_index_to_ypos(cell_yi); - - float z_x0y0 = z_values[cell_xi ][cell_yi ], // z at lower left corner - z_x1y0 = z_values[cell_xi+1][cell_yi ], // z at upper left corner - z_x0y1 = z_values[cell_xi ][cell_yi+1], // z at lower right corner - z_x1y1 = z_values[cell_xi+1][cell_yi+1]; // z at upper right corner - - if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A) - if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points - if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell, - if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points - - 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) - - 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_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) - - // As subsequent segments step through this cell, the z_cxy0 intercept will change - // and the z_cxym slope will change, both as a function of cx within the cell, and - // 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 - - for (;;) { // for all segments within this mesh cell - - if (--segments == 0) // if this is last segment, use rtarget for exact - COPY(raw, rtarget); - - const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * fade_scaling_factor // apply fade factor to interpolated mesh height - #endif - ; - - const float z = raw[Z_AXIS]; - raw[Z_AXIS] += z_cxcy; - ubl_buffer_segment_raw(raw, feedrate); - raw[Z_AXIS] = z; - - if (segments == 0) // done with last segment - return false; // did not set_current_from_destination() - - LOOP_XYZE(i) raw[i] += diff[i]; - - cx += diff[X_AXIS]; - cy += diff[Y_AXIS]; - - if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) // done within this cell, break to next - break; - - // Next segment still within same mesh cell, adjust the per-segment - // slope and intercept to compute next z height. - - z_cxy0 += z_sxy0; // adjust z_cxy0 by per-segment z_sxy0 - z_cxym += z_sxym; // adjust z_cxym by per-segment z_sxym - - } // segment loop - } // cell loop - - return false; // caller will update current_position - } - - #endif // UBL_SEGMENTED - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp deleted file mode 100644 index 52149d7d07..0000000000 --- a/Marlin/ultralcd.cpp +++ /dev/null @@ -1,5800 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(ULTRA_LCD) - -#include "ultralcd.h" -#include "Marlin.h" -#include "language.h" -#include "cardreader.h" -#include "temperature.h" -#include "planner.h" -#include "stepper.h" -#include "configuration_store.h" -#include "utility.h" -#include "parser.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP -#include "power_loss_recovery.h" - -#endif -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - #include "buzzer.h" -#endif - -#include "printcounter.h" - -#if ENABLED(PRINTCOUNTER) - #include "duration_t.h" -#endif - -#if ENABLED(BLTOUCH) - #include "endstops.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#elif HAS_ABL - #include "planner.h" -#elif ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(STATUS_MESSAGE_SCROLLING) - #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) - #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH - #else - #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) - #endif - uint8_t status_scroll_offset = 0; -#else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) -#endif - -char lcd_status_message[MAX_MESSAGE_LENGTH + 1]; -uint8_t lcd_status_update_delay = 1, // First update one loop delayed - lcd_status_message_level; // Higher level blocks lower level - -#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - millis_t previous_lcd_status_ms = 0; -#endif - -#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) - uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash; -#endif - -#if ENABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; -#endif - -#if ENABLED(DOGLCD) - #include "ultralcd_impl_DOGM.h" - #include - bool drawing_screen, first_page; // = false -#else - #include "ultralcd_impl_HD44780.h" - constexpr bool first_page = true; -#endif - -// The main status screen -void lcd_status_screen(); - -millis_t next_lcd_update_ms; - -uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) -uint16_t max_display_update_time = 0; - -#if ENABLED(ULTIPANEL) - - #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \ - inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type (*pget)(), void (*pset)(_type), ...) { \ - UNUSED(pstr2); UNUSED(pset); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(pget())); \ - } \ - typedef void _name##_void - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj); - #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) DRAW_BOOL_SETTING(sel, row, pstr, data) - #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) DRAW_BOOL_SETTING(sel, row, pstr, data) - #define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) - - #ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 - #endif - - bool no_reentry = false; - constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION); - - // Initialized by settings.load() - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool lcd_external_control; // = false - #endif - - #if ENABLED(BABYSTEPPING) - long babysteps_done = 0; - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - static void lcd_babystep_zoffset(); - #else - static void lcd_babystep_z(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes - uint8_t driverPercent[XYZE]; - #endif - - //////////////////////////////////////////// - ///////////////// Menu Tree //////////////// - //////////////////////////////////////////// - - void lcd_main_menu(); - void lcd_tune_menu(); - void lcd_prepare_menu(); - void lcd_move_menu(); - void lcd_control_menu(); - void lcd_control_temperature_menu(); - void lcd_control_motion_menu(); - - #if DISABLED(SLIM_LCD_MENUS) - void lcd_control_temperature_preheat_material1_settings_menu(); - void lcd_control_temperature_preheat_material2_settings_menu(); - #endif - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_control_filament_menu(); - #endif - - #if ENABLED(LCD_INFO_MENU) - #if ENABLED(PRINTCOUNTER) - void lcd_info_stats_menu(); - #endif - void lcd_info_thermistors_menu(); - void lcd_info_board_menu(); - void lcd_info_menu(); - #endif // LCD_INFO_MENU - - #if ENABLED(LED_CONTROL_MENU) - #include "leds.h" - void lcd_led_menu(); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu(); - #else - void lcd_temp_menu_e0_filament_change(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - void dac_driver_commit(); - void dac_driver_getValues(); - void lcd_dac_menu(); - void lcd_dac_write_eeprom(); - #endif - - #if ENABLED(FWRETRACT) - void lcd_control_retract_menu(); - #endif - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - void lcd_delta_calibrate_menu(); - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float new_z_fade_height; - void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); } - #endif - - //////////////////////////////////////////// - //////////// Menu System Actions /////////// - //////////////////////////////////////////// - - #define menu_action_back(dummy) _menu_action_back() - void _menu_action_back(); - void menu_action_submenu(screenFunc_t data); - void menu_action_gcode(const char* pgcode); - void menu_action_function(menuAction_t data); - - #define DECLARE_MENU_EDIT_TYPE(_type, _name) \ - bool _menu_edit_ ## _name(); \ - void menu_edit_ ## _name(); \ - void menu_edit_callback_ ## _name(); \ - void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \ - typedef void _name##_void - - DECLARE_MENU_EDIT_TYPE(int16_t, int3); - DECLARE_MENU_EDIT_TYPE(uint8_t, int8); - DECLARE_MENU_EDIT_TYPE(float, float3); - DECLARE_MENU_EDIT_TYPE(float, float52); - DECLARE_MENU_EDIT_TYPE(float, float43); - DECLARE_MENU_EDIT_TYPE(float, float5); - DECLARE_MENU_EDIT_TYPE(float, float51); - DECLARE_MENU_EDIT_TYPE(float, float52sign); - DECLARE_MENU_EDIT_TYPE(float, float62); - DECLARE_MENU_EDIT_TYPE(uint32_t, long5); - - void menu_action_setting_edit_bool(const char* pstr, bool* ptr); - void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc); - - #if ENABLED(SDSUPPORT) - void lcd_sdcard_menu(); - void menu_action_sdfile(CardReader& theCard); - void menu_action_sddirectory(CardReader& theCard); - #endif - - //////////////////////////////////////////// - //////////// Menu System Macros //////////// - //////////////////////////////////////////// - - /** - * MENU_ITEM generates draw & handler code for a menu item, potentially calling: - * - * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) - * menu_action_[type](arg3...) - * - * Examples: - * MENU_ITEM(back, MSG_WATCH, 0 [dummy parameter] ) - * or - * MENU_BACK(MSG_WATCH) - * lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH)) - * menu_action_back() - * - * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * menu_action_function(lcd_sdcard_pause) - * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - */ - #define _MENU_ITEM_PART_1(TYPE, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && lcd_clicked) { \ - lcd_clicked = false - - #define _MENU_ITEM_PART_2(TYPE, PLABEL, ...) \ - menu_action_ ## TYPE(__VA_ARGS__); \ - if (screen_changed) return; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define MENU_ITEM_P(TYPE, PLABEL, ...) do { \ - _skipStatic = false; \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - _MENU_ITEM_PART_2(TYPE, PLABEL, ## __VA_ARGS__); \ - }while(0) - - #define MENU_ITEM(TYPE, LABEL, ...) MENU_ITEM_P(TYPE, PSTR(LABEL), ## __VA_ARGS__) - - #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) - - // Used to print static text with no visible cursor. - // Parameters: label [, bool center [, bool invert [, char *value] ] ] - #define STATIC_ITEM_P(LABEL, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - - bool encoderRateMultiplierEnabled; - #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F) - - //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value - - /** - * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item - */ - #define MENU_MULTIPLIER_ITEM(TYPE, LABEL, ...) do { \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - encoderRateMultiplierEnabled = true; \ - lastEncoderMovementMillis = 0; \ - _MENU_ITEM_PART_2(TYPE, PSTR(LABEL), ## __VA_ARGS__); \ - }while(0) - - #else // !ENCODER_RATE_MULTIPLIER - #define ENCODER_RATE_MULTIPLY(F) NOOP - #endif // !ENCODER_RATE_MULTIPLIER - - #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) - #define MENU_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #else // !ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #endif // !ENCODER_RATE_MULTIPLIER - - #define SCREEN_OR_MENU_LOOP() \ - int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ - for (int8_t _lcdLineNr = 0; _lcdLineNr < menu_bottom; _lcdLineNr++, _menuLineNr++) { \ - _thisItemNr = 0 - - /** - * START_SCREEN Opening code for a screen having only static items. - * Do simplified scrolling of the entire screen. - * - * START_MENU Opening code for a screen with menu items. - * Scroll as-needed to keep the selected line in view. - */ - #define START_SCREEN() \ - scroll_screen(menu_bottom, false); \ - bool _skipStatic = false; \ - SCREEN_OR_MENU_LOOP() - - #define START_MENU() \ - scroll_screen(1, true); \ - bool _skipStatic = true; \ - SCREEN_OR_MENU_LOOP() - - #define END_SCREEN() \ - } \ - screen_items = _thisItemNr - - #define END_MENU() \ - } \ - screen_items = _thisItemNr; \ - UNUSED(_skipStatic) - - //////////////////////////////////////////// - ///////////// Global Variables ///////////// - //////////////////////////////////////////// - - /** - * REVERSE_MENU_DIRECTION - * - * To reverse the menu direction we need a general way to reverse - * the direction of the encoder everywhere. So encoderDirection is - * added to allow the encoder to go the other way. - * - * This behavior is limited to scrolling Menus and SD card listings, - * and is disabled in other contexts. - */ - #if ENABLED(REVERSE_MENU_DIRECTION) - int8_t encoderDirection = 1; - #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) - #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) - #else - #define ENCODER_DIRECTION_NORMAL() ; - #define ENCODER_DIRECTION_MENUS() ; - #endif - - // Encoder Movement - volatile int8_t encoderDiff; // Updated in lcd_buttons_update, added to encoderPosition every LCD update - uint32_t encoderPosition; - millis_t lastEncoderMovementMillis = 0; - - // Button States - bool lcd_clicked, wait_for_unclick; - volatile uint8_t buttons; - millis_t next_button_update_ms; - #if ENABLED(REPRAPWORLD_KEYPAD) - volatile uint8_t buttons_reprapworld_keypad; - #endif - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - volatile uint8_t slow_buttons; - #endif - - // Menu System Navigation - screenFunc_t currentScreen = lcd_status_screen; - int8_t encoderTopLine; - typedef struct { - screenFunc_t menu_function; - uint32_t encoder_position; - } menuPosition; - menuPosition screen_history[6]; - uint8_t screen_history_depth = 0; - bool screen_changed, defer_return_to_status; - - // Value Editing - const char *editLabel; - void *editValue; - int32_t minEditValue, maxEditValue; - screenFunc_t callbackFunc; - bool liveEdit; - - // Manual Moves - const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE; - millis_t manual_move_start_time = 0; - int8_t manual_move_axis = (int8_t)NO_AXIS; - #if EXTRUDERS > 1 - int8_t manual_move_e_index = 0; - #else - #define manual_move_e_index 0 - #endif - - #if IS_KINEMATIC - bool processing_manual_move = false; - float manual_move_offset = 0; - #else - constexpr bool processing_manual_move = false; - #endif - - #if PIN_EXISTS(SD_DETECT) - uint8_t lcd_sd_status; - #endif - - #if ENABLED(PIDTEMP) - float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits - #endif - - inline bool use_click() { - const bool click = lcd_clicked; - lcd_clicked = false; - return click; - } - - /** - * General function to go directly to a screen - */ - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { - if (currentScreen != screen) { - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - new_z_fade_height = planner.z_fade_height; - #endif - - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) - static millis_t doubleclick_expire_ms = 0; - // Going to lcd_main_menu from status screen? Remember first click time. - // Going back to status screen within a very short time? Go to Z babystepping. - if (screen == lcd_main_menu) { - if (currentScreen == lcd_status_screen) - doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; - } - else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms) && (planner.movesplanned() || IS_SD_PRINTING)) - screen = - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - lcd_babystep_zoffset - #else - lcd_babystep_z - #endif - ; - #endif - - currentScreen = screen; - encoderPosition = encoder; - if (screen == lcd_status_screen) { - defer_return_to_status = false; - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.lcd_map_control = false; - #endif - screen_history_depth = 0; - } - lcd_implementation_clear(); - // Re-initialize custom characters that may be re-used - #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL) - if (!ubl.lcd_map_control) { - lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) - screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU - #endif - ); - } - #elif ENABLED(LCD_PROGRESS_BAR) - lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); - #endif - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - } - } - - /** - * Show "Moving..." till moves are done, then revert to previous display. - */ - static const char moving[] PROGMEM = MSG_MOVING; - static const char *sync_message = moving; - - // - // Display the synchronize screen until moves are - // finished, and don't return to the caller until - // done. ** This blocks the command queue! ** - // - void _lcd_synchronize() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); - if (no_reentry) return; - // Make this the current handler till all moves are done - no_reentry = true; - const screenFunc_t old_screen = currentScreen; - lcd_goto_screen(_lcd_synchronize); - planner.synchronize(); // idle() is called until moves complete - no_reentry = false; - lcd_goto_screen(old_screen); - } - - // Display the synchronize screen with a custom message - // ** This blocks the command queue! ** - void lcd_synchronize(const char * const msg=NULL) { - sync_message = msg ? msg : moving; - _lcd_synchronize(); - } - - void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } - - void lcd_save_previous_screen() { - if (screen_history_depth < COUNT(screen_history)) { - screen_history[screen_history_depth].menu_function = currentScreen; - screen_history[screen_history_depth].encoder_position = encoderPosition; - ++screen_history_depth; - } - } - - void lcd_goto_previous_menu() { - if (screen_history_depth > 0) { - --screen_history_depth; - lcd_goto_screen( - screen_history[screen_history_depth].menu_function, - screen_history[screen_history_depth].encoder_position - ); - } - else - lcd_return_to_status(); - } - - void lcd_goto_previous_menu_no_defer() { - defer_return_to_status = false; - lcd_goto_previous_menu(); - } - - /** - * Scrolling for menus and other line-based screens - * - * encoderLine is the position based on the encoder - * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM - * screen_items is the total number of items in the menu (after one call) - */ - int8_t encoderLine, screen_items; - void scroll_screen(const uint8_t limit, const bool is_menu) { - ENCODER_DIRECTION_MENUS(); - ENCODER_RATE_MULTIPLY(false); - if (encoderPosition > 0x8000) encoderPosition = 0; - if (first_page) { - encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); - screen_changed = false; - } - if (screen_items > 0 && encoderLine >= screen_items - limit) { - encoderLine = MAX(0, screen_items - limit); - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); - } - if (is_menu) { - NOMORE(encoderTopLine, encoderLine); - if (encoderLine >= encoderTopLine + menu_bottom) - encoderTopLine = encoderLine - menu_bottom + 1; - } - else - encoderTopLine = encoderLine; - } - -#endif // ULTIPANEL - -#if POWER_LOSS_RECOVER_SUPER_CAP -void lcd_recover_ok(void) -{ - char tmp_n[64]; - recovery_detect_cap.recovery=0; - lcd_goto_screen(lcd_status_screen); - SERIAL_ECHOLN(recovery_detect_cap.file_name); - recovery_detect_cap.recovery=1; - sprintf_P(tmp_n,PSTR("G92 Z%u.%u"),recovery_detect_cap.Z_t/10,recovery_detect_cap.Z_t%10); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - sprintf_P(tmp_n,PSTR("G92 E%u"),recovery_detect_cap.E_t); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - sprintf_P(tmp_n,PSTR("M104 S%u"),recovery_detect_cap.T0_t); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); -} -void lcd_cover_cancel(void) -{ - char tmp_n[32]; - recovery_detect_cap.recovery=0; - recovery_detect_cap.file_name[0]=0; - sprintf_P(tmp_n,PSTR("M500")); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - lcd_goto_screen(lcd_status_screen); - - -} - -void lcd_recovery(void) -{ - START_MENU(); - MENU_ITEM(submenu, "Resume Print ?", lcd_recovery); - MENU_ITEM(submenu, "YES ", lcd_recover_ok); - MENU_ITEM(submenu, "NO ", lcd_cover_cancel); - END_MENU(); - -} - - -void lcd_recover_menu(void) -{ - lcd_goto_screen(lcd_recovery); - -} -#endif - -/** - * - * "Info Screen" - * - * This is very display-dependent, so the lcd implementation draws this. - */ - -void lcd_status_screen() { - - #if ENABLED(ULTIPANEL) - ENCODER_DIRECTION_NORMAL(); - ENCODER_RATE_MULTIPLY(false); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING) - progress_bar_percent = card.percentDone(); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - - // - // HD44780 implements the following message blinking and - // message expiration because Status Line and Progress Bar - // share the same line on the display. - // - - millis_t ms = millis(); - - // If the message will blink rather than expire... - #if DISABLED(PROGRESS_MSG_ONCE) - if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) - progress_bar_ms = ms; - #endif - - #if PROGRESS_MSG_EXPIRE > 0 - - // Handle message expire - if (expire_status_ms > 0) { - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - - // Expire the message if a job is active and the bar has ticks - if (progress_bar_percent > 2 && !print_job_timer.isPaused()) { - if (ELAPSED(ms, expire_status_ms)) { - lcd_status_message[0] = '\0'; - expire_status_ms = 0; - } - } - else { - // Defer message expiration before bar appears - // and during any pause (not just SD) - expire_status_ms += LCD_UPDATE_INTERVAL; - } - } - - #endif // PROGRESS_MSG_EXPIRE - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(ULTIPANEL) - - if (use_click()) { - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); // get status message to show up for a while - #endif - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) - CHARSET_MENU - #endif - ); - lcd_goto_screen(lcd_main_menu); - return; - } - - #if ENABLED(ULTIPANEL_FEEDMULTIPLY) - const int16_t new_frm = feedrate_percentage + (int32_t)encoderPosition; - // Dead zone at 100% feedrate - if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) { - feedrate_percentage = 100; - encoderPosition = 0; - } - else if (feedrate_percentage == 100) { - if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) { - feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); - encoderPosition = 0; - } - else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) { - feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; - encoderPosition = 0; - } - } - else { - feedrate_percentage = new_frm; - encoderPosition = 0; - } - #endif // ULTIPANEL_FEEDMULTIPLY - - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - - #endif // ULTIPANEL - - lcd_implementation_status_screen(); -} - -/** - * Reset the status message - */ -void lcd_reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; - const char *msg; - if (print_job_timer.isPaused()) - msg = paused; - #if ENABLED(SDSUPPORT) - else if (card.sdprinting) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); -} - -/** - * - * draw the kill screen - * - */ -void kill_screen(const char* lcd_msg) { - lcd_init(); - lcd_setalertstatusPGM(lcd_msg); - lcd_kill_screen(); -} - -/** - * - * Audio feedback for controller clicks - * - */ -void lcd_buzz(const long duration, const uint16_t freq) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(duration, freq); - #else - UNUSED(duration); UNUSED(freq); - #endif -} - -void lcd_quick_feedback(const bool clear_buttons) { - - #if ENABLED(ULTIPANEL) - lcd_refresh(); - if (clear_buttons) buttons = 0; - next_button_update_ms = millis() + 500; - #else - UNUSED(clear_buttons); - #endif - - // Buzz and wait. The delay is needed for buttons to settle! - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - - #if ENABLED(ULTIPANEL) - #if ENABLED(LCD_USE_I2C_BUZZER) - delay(10); - #elif PIN_EXISTS(BEEPER) - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #endif - #endif -} - -#if ENABLED(ULTIPANEL) - - void lcd_completion_feedback(const bool good/*=true*/) { - if (good) { - lcd_buzz(100, 659); - lcd_buzz(100, 698); - } - else lcd_buzz(20, 440); - } - - inline void line_to_current_z() { - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder); - } - - inline void line_to_z(const float &z) { - current_position[Z_AXIS] = z; - line_to_current_z(); - } - - #if ENABLED(SDSUPPORT) - - void lcd_sdcard_pause() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); - #endif - lcd_reset_status(); - } - - void lcd_sdcard_resume() { - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M24")); - #else - card.startFileprint(); - print_job_timer.start(); - #endif - lcd_reset_status(); - } - - bool abort_sd_printing; // =false - - void lcd_sdcard_stop() { - wait_for_heatup = wait_for_user = false; - abort_sd_printing = true; - lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); - lcd_return_to_status(); - } - - #endif // SDSUPPORT - - #if ENABLED(POWER_LOSS_RECOVERY) - - static void lcd_power_loss_recovery_resume() { - char cmd[20]; - - // Return to status now - lcd_return_to_status(); - - // Turn leveling off and home - enqueue_and_echo_commands_P(PSTR("M420 S0\nG28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" - #endif - )); - - #if HAS_HEATED_BED - const int16_t bt = job_recovery_info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - enqueue_and_echo_command(cmd); - } - #endif - - // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = job_recovery_info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); - enqueue_and_echo_command(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - enqueue_and_echo_command(cmd); - } - } - - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), job_recovery_info.active_hotend); - enqueue_and_echo_command(cmd); - #endif - - // Restore print cooling fan speeds - for (uint8_t i = 0; i < FAN_COUNT; i++) { - int16_t f = job_recovery_info.fanSpeeds[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - enqueue_and_echo_command(cmd); - } - } - - // Start draining the job recovery command queue - job_recovery_phase = JOB_RECOVERY_YES; - } - - static void lcd_power_loss_recovery_cancel() { - card.removeJobRecoveryFile(); - card.autostart_index = 0; - lcd_return_to_status(); - } - - static void lcd_job_recovery_menu() { - defer_return_to_status = true; - START_MENU(); - STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); - END_MENU(); - } - - #endif // POWER_LOSS_RECOVERY - - #if ENABLED(MENU_ITEM_CASE_LIGHT) - - extern uint8_t case_light_brightness; - extern bool case_light_on; - extern void update_case_light(); - - void case_light_menu() { - START_MENU(); - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - END_MENU(); - } - #endif // MENU_ITEM_CASE_LIGHT - - #if ENABLED(BLTOUCH) - - /** - * - * "BLTouch" submenu - * - */ - static void bltouch_menu() { - START_MENU(); - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); - MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); - END_MENU(); - } - - #endif // BLTOUCH - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - - static void progress_bar_test() { - static int8_t bar_percent = 0; - if (use_click()) { - lcd_goto_previous_menu(); - lcd_set_custom_characters(CHARSET_MENU); - return; - } - bar_percent += (int8_t)encoderPosition; - bar_percent = constrain(bar_percent, 0, 100); - encoderPosition = 0; - lcd_implementation_drawmenu_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); - lcd.setCursor((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); - lcd.print(itostr3(bar_percent)); lcd.write('%'); - lcd.setCursor(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent); - } - - void _progress_bar_test() { - lcd_goto_screen(progress_bar_test); - lcd_set_custom_characters(); - } - - #endif // LCD_PROGRESS_BAR_TEST - - #if HAS_DEBUG_MENU - - void lcd_debug_menu() { - START_MENU(); - - MENU_BACK(MSG_MAIN); // ^ Main - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test); - #endif - - END_MENU(); - } - - #endif // HAS_DEBUG_MENU - - #if ENABLED(CUSTOM_USER_MENUS) - - #ifdef USER_SCRIPT_DONE - #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE - #else - #define _DONE_SCRIPT "" - #endif - - void _lcd_user_gcode(const char * const cmd) { - enqueue_and_echo_commands_P(cmd); - #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) - lcd_completion_feedback(); - #endif - #if ENABLED(USER_SCRIPT_RETURN) - lcd_return_to_status(); - #endif - } - - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); } - #endif - - void _lcd_user_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1); - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2); - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3); - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4); - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5); - #endif - END_MENU(); - } - - #endif - - /** - * - * "Main" menu - * - */ - - void lcd_main_menu() { - START_MENU(); - MENU_BACK(MSG_WATCH); - - #if ENABLED(CUSTOM_USER_MENUS) - MENU_ITEM(submenu, MSG_USER_MENU, _lcd_user_menu); - #endif - - // - // Debug Menu when certain options are enabled - // - #if HAS_DEBUG_MENU - MENU_ITEM(submenu, MSG_DEBUG_MENU, lcd_debug_menu); - #endif - - // - // Set Case light on/off/brightness - // - #if ENABLED(MENU_ITEM_CASE_LIGHT) - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) { - MENU_ITEM(submenu, MSG_CASE_LIGHT, case_light_menu); - } - else - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - #endif - - if (planner.movesplanned() || IS_SD_PRINTING) - MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); - else - MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); - - MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); - - #if ENABLED(SDSUPPORT) - if (card.cardOK) { - if (card.isFileOpen()) { - if (card.sdprinting) - MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); - else - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); - } - else { - MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user - #endif - } - } - else { - MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface - #endif - } - #endif // SDSUPPORT - - #if ENABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); - #endif - - #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu); - #endif - - END_MENU(); - } - - /** - * - * "Tune" submenu items - * - */ - - #if HAS_M206_COMMAND - /** - * Set the home offset based on the current_position - */ - void lcd_set_home_offsets() { - // M428 Command - enqueue_and_echo_commands_P(PSTR("M428")); - lcd_return_to_status(); - } - #endif - - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - void _lcd_zoffset_overlay_gfx(const float zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } - - #if ENABLED(OVERLAY_GFX_REVERSE) - const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp; - #else - const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp; - #endif - - #if ENABLED(USE_BIG_EDIT_FONT) - const int left = 0, right = 45, nozzle = 95; - #else - const int left = 5, right = 90, nozzle = 60; - #endif - - // Draw a representation of the nozzle - if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); - if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); - - // Draw cw/ccw indicator and up/down arrows. - if (PAGE_CONTAINS(47, 62)) { - u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down); - u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up); - u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp); - u8g.drawBitmapP(left + 20, 49 - dir, 2, 13, down_arrow_bmp); - } - } - - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - - #if ENABLED(BABYSTEPPING) - - void _lcd_babystep(const AxisEnum axis, const char* msg) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - thermalManager.babystep_axis(axis, babystep_increment); - babysteps_done += babystep_increment; - } - if (lcdDrawUpdate) - lcd_implementation_drawedit(msg, ftostr43sign(planner.steps_to_mm[axis] * babysteps_done)); - } - - #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); } - void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; defer_return_to_status = true; } - void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; } - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - - void lcd_babystep_zoffset() { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - defer_return_to_status = true; - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; - - const float new_zoffset = zprobe_zoffset + planner.steps_to_mm[Z_AXIS] * babystep_increment; - if (WITHIN(new_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - thermalManager.babystep_axis(Z_AXIS, babystep_increment); - zprobe_zoffset = new_zoffset; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - } - if (lcdDrawUpdate) { - lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(zprobe_zoffset); - #endif - } - } - - #else // !BABYSTEP_ZPROBE_OFFSET - - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); } - void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; } - - #endif // !BABYSTEP_ZPROBE_OFFSET - - #endif // BABYSTEPPING - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places. So we keep a - // separate value that doesn't lose precision. - static int16_t ubl_encoderPosition = 0; - - static void _lcd_mesh_fine_tune(const char* msg) { - defer_return_to_status = true; - if (ubl.encoder_diff) { - ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; - ubl.encoder_diff = 0; - - mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; - mesh_edit_value = mesh_edit_accumulator; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - - const int32_t rounded = (int32_t)(mesh_edit_value * 1000); - mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; - } - - if (lcdDrawUpdate) { - lcd_implementation_drawedit(msg, ftostr43sign(mesh_edit_value)); - #if ENABLED(MESH_EDIT_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(mesh_edit_value); - #endif - } - } - - void _lcd_mesh_edit_NOP() { - defer_return_to_status = true; - } - - float lcd_mesh_edit() { - lcd_goto_screen(_lcd_mesh_edit_NOP); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - _lcd_mesh_fine_tune(PSTR("Mesh Editor")); - return mesh_edit_value; - } - - void lcd_mesh_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_mesh_edit_NOP); - } - - void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); - } - - float lcd_z_offset_edit() { - lcd_goto_screen(_lcd_z_offset_edit); - return mesh_edit_value; - } - - void lcd_z_offset_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_z_offset_edit); - } - - #endif // AUTO_BED_LEVELING_UBL - - - /** - * Watch temperature callbacks - */ - #if HAS_TEMP_HOTEND - #if WATCH_HOTENDS - #define _WATCH_FUNC(N) thermalManager.start_watching_heater(N) - #else - #define _WATCH_FUNC(N) NOOP - #endif - void watch_temp_callback_E0() { _WATCH_FUNC(0); } - #if HOTENDS > 1 - void watch_temp_callback_E1() { _WATCH_FUNC(1); } - #if HOTENDS > 2 - void watch_temp_callback_E2() { _WATCH_FUNC(2); } - #if HOTENDS > 3 - void watch_temp_callback_E3() { _WATCH_FUNC(3); } - #if HOTENDS > 4 - void watch_temp_callback_E4() { _WATCH_FUNC(4); } - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HAS_TEMP_HOTEND - - void watch_temp_callback_bed() { - #if WATCH_THE_BED - thermalManager.start_watching_bed(); - #endif - } - - // First Fan Speed title in "Tune" and "Control>Temperature" menus - #if FAN_COUNT > 0 && HAS_FAN0 - #if FAN_COUNT > 1 - #define FAN_SPEED_1_SUFFIX " 1" - #else - #define FAN_SPEED_1_SUFFIX "" - #endif - #endif - - // Refresh the E factor after changing flow - inline void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } - #if EXTRUDERS > 1 - inline void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } - inline void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); } - #if EXTRUDERS > 2 - inline void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); } - #if EXTRUDERS > 3 - inline void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); } - #if EXTRUDERS > 4 - inline void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); } - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - /** - * - * "Tune" submenu - * - */ - void lcd_tune_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - - // - // Speed: - // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); - - // - // Manual bed leveling, Bed Z: - // - #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - // - // Leveling Fade Height - // - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(SLIM_LCD_MENUS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fanSpeeds[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fanSpeeds[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 2", &new_fanSpeeds[1], 3, 255); - #endif - #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 3", &new_fanSpeeds[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Flow: - // Flow [1-5]: - // - #if EXTRUDERS == 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - #else // EXTRUDERS > 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3); - #if EXTRUDERS > 4 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - // - // Babystep X: - // Babystep Y: - // Babystep Z: - // - #if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_XY) - MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); - MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); - #endif - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #else - MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); - #endif - #endif - - // - // Change filament - // - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - #endif - - END_MENU(); - } - - /** - * - * "Driver current control" submenu items - * - */ - #if ENABLED(DAC_STEPPER_CURRENT) - - void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); } - - void dac_driver_commit() { dac_current_set_percents(driverPercent); } - - void dac_driver_eeprom_write() { dac_commit_eeprom(); } - - void lcd_dac_menu() { - dac_driver_getValues(); - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_E " " MSG_DAC_PERCENT, &driverPercent[E_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_driver_eeprom_write); - END_MENU(); - } - - #endif // DAC_STEPPER_CURRENT - - #if HAS_MOTOR_CURRENT_PWM - - void lcd_pwm_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_X MSG_Y, &stepper.motor_current_setting[0], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_Z, &stepper.motor_current_setting[1], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_E, &stepper.motor_current_setting[2], 100, 2000, Stepper::refresh_motor_power); - #endif - END_MENU(); - } - - #endif // HAS_MOTOR_CURRENT_PWM - - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - - /** - * - * "Prepare" submenu items - * - */ - void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const int16_t fan) { - if (temph > 0) thermalManager.setTargetHotend(MIN(heater_maxtemp[endnum], temph), endnum); - #if HAS_HEATED_BED - if (tempb >= 0) thermalManager.setTargetBed(tempb); - #else - UNUSED(tempb); - #endif - #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; - #else - fanSpeeds[0] = fan; - #endif - #else - UNUSED(fan); - #endif - lcd_return_to_status(); - } - - #if HAS_TEMP_HOTEND - void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #endif - - #if HOTENDS > 1 - void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 2 - void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 3 - void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 4 - void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - - void lcd_preheat_m1_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m1_e0(); - #else - lcd_preheat_m1_e0_only(); - #endif - } - void lcd_preheat_m2_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m2_e0(); - #else - lcd_preheat_m2_e0_only(); - #endif - } - - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - - #if HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_preheat_m1_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); - #endif - END_MENU(); - } - - void lcd_preheat_m2_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); - #endif - END_MENU(); - } - - #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_cooldown() { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - thermalManager.disable_all_heaters(); - lcd_return_to_status(); - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * If the queue is full, the command will fail, so we have to loop - * with idle() to make sure the command has been enqueued. - */ - void lcd_enqueue_command(char * const cmd) { - no_reentry = true; - enqueue_and_echo_command_now(cmd); - no_reentry = false; - } - - void lcd_enqueue_commands_P(const char * const cmd) { - no_reentry = true; - enqueue_and_echo_commands_now_P(cmd); - no_reentry = false; - } - - #endif - - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - - void lcd_autostart_sd() { card.beginautostart(); } - - #endif - - #if ENABLED(EEPROM_SETTINGS) - static void lcd_store_settings() { lcd_completion_feedback(settings.save()); } - static void lcd_load_settings() { lcd_completion_feedback(settings.load()); } - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - - /** - * Level corners, starting in the front-left corner. - */ - static int8_t bed_corner; - void _lcd_goto_next_corner() { - line_to_z(4.0); - switch (bed_corner) { - case 0: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; - break; - case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 3: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: - current_position[X_AXIS] = X_CENTER; - current_position[Y_AXIS] = Y_CENTER; - break; - #endif - } - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); - line_to_z(0.0); - if (++bed_corner > 3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - ) bed_corner = 0; - } - - void _lcd_corner_submenu() { - START_MENU(); - MENU_ITEM(function, - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - , _lcd_goto_next_corner); - MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); - END_MENU(); - } - - void _lcd_level_bed_corners() { - defer_return_to_status = true; - lcd_goto_screen(_lcd_corner_submenu); - bed_corner = 0; - _lcd_goto_next_corner(); - } - - #endif // LEVEL_BED_CORNERS - - #if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - - /** - * - * "Prepare" > "Level Bed" handlers - * - */ - - static uint8_t manual_probe_index; - - // LCD probed points are from defaults - constexpr uint8_t total_probe_points = ( - #if ENABLED(AUTO_BED_LEVELING_3POINT) - 3 - #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) - GRID_MAX_POINTS - #endif - ); - - bool lcd_wait_for_move; - - // - // Bed leveling is done. Wait for G29 to complete. - // A flag is used so that this can release control - // and allow the command queue to be processed. - // - // When G29 finishes the last move: - // - Raise Z to the "manual probe height" - // - Don't return until done. - // - // ** This blocks the command queue! ** - // - void _lcd_level_bed_done() { - if (!lcd_wait_for_move) { - #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) - // Display "Done" screen and wait for moves to complete - line_to_z(MANUAL_PROBE_HEIGHT); - lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE)); - #endif - lcd_goto_previous_menu_no_defer(); - lcd_completion_feedback(); - } - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - - void _lcd_level_goto_next_point(); - - /** - * Step 7: Get the Z coordinate, click goes to the next point or exits - */ - void _lcd_level_bed_get_z() { - ENCODER_DIRECTION_NORMAL(); - - if (use_click()) { - - // - // Save the current Z position and move - // - - // If done... - if (++manual_probe_index >= total_probe_points) { - // - // The last G29 records the point and enables bed leveling - // - lcd_wait_for_move = true; - lcd_goto_screen(_lcd_level_bed_done); - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(PSTR("G29 S2")); - #elif ENABLED(PROBE_MANUALLY) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - else - _lcd_level_goto_next_point(); - - return; - } - - // - // Encoder knob or keypad buttons adjust the Z position - // - if (encoderPosition) { - const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP); - line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - encoderPosition = 0; - } - - // - // Draw on first display, then only on Z change - // - if (lcdDrawUpdate) { - const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); - } - } - - /** - * Step 6: Display "Next point: 1 / 9" while waiting for move to finish - */ - void _lcd_level_bed_moving() { - if (lcdDrawUpdate) { - char msg[10]; - sprintf_P(msg, PSTR("%i / %u"), (int)(manual_probe_index + 1), total_probe_points); - lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); - } - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (!lcd_wait_for_move) lcd_goto_screen(_lcd_level_bed_get_z); - } - - /** - * Step 5: Initiate a move to the next point - */ - void _lcd_level_goto_next_point() { - lcd_goto_screen(_lcd_level_bed_moving); - - // G29 Records Z, moves, and signals when it pauses - lcd_wait_for_move = true; - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); - #elif ENABLED(PROBE_MANUALLY) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - - /** - * Step 4: Display "Click to Begin", wait for click - * Move to the first probe position - */ - void _lcd_level_bed_homing_done() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); - if (use_click()) { - manual_probe_index = 0; - _lcd_level_goto_next_point(); - } - } - - /** - * Step 3: Display "Homing XYZ" - Wait for homing to finish - */ - void _lcd_level_bed_homing() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL); - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); - } - - #if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; - #endif - - /** - * Step 2: Continue Bed Leveling... - */ - void _lcd_level_bed_continue() { - defer_return_to_status = true; - axis_homed = 0; - lcd_goto_screen(_lcd_level_bed_homing); - enqueue_and_echo_commands_P(PSTR("G28")); - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - void _lcd_ubl_level_bed(); - - static int16_t ubl_storage_slot = 0, - custom_hotend_temp = 190, - side_points = 3, - ubl_fillin_amount = 5, - ubl_height_amount = 1, - n_edit_pts = 1, - x_plot = 0, - y_plot = 0; - - #if HAS_HEATED_BED - static int16_t custom_bed_temp = 50; - #endif - - /** - * UBL Build Custom Mesh Command - */ - void _lcd_ubl_build_custom_mesh() { - char UBL_LCD_GCODE[20]; - enqueue_and_echo_commands_P(PSTR("G28")); - #if HAS_HEATED_BED - sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - #endif - sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - enqueue_and_echo_commands_P(PSTR("G29 P1")); - } - - /** - * UBL Custom Mesh submenu - * - * << Build Mesh - * Hotend Temp: --- - * Bed Temp: --- - * Build Custom Mesh - */ - void _lcd_ubl_custom_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 15)); - #endif - MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); - END_MENU(); - } - - /** - * UBL Adjust Mesh Height Command - */ - void _lcd_ubl_adjust_height_cmd() { - char UBL_LCD_GCODE[16]; - const int ind = ubl_height_amount > 0 ? 9 : 10; - strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); - sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount)); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Adjust Mesh Height submenu - * - * << Edit Mesh - * Height Amount: --- - * Adjust Mesh Height - * << Info Screen - */ - void _lcd_ubl_height_adjust_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_EDIT_MESH_MENU); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Edit Mesh submenu - * - * << UBL Tools - * Fine Tune All - * Fine Tune Closest - * - Adjust Mesh Height >> - * << Info Screen - */ - void _lcd_ubl_edit_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); - MENU_ITEM(submenu, MSG_UBL_MESH_HEIGHT_ADJUST, _lcd_ubl_height_adjust_menu); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Validate Custom Mesh Command - */ - void _lcd_ubl_validate_custom_mesh() { - char UBL_LCD_GCODE[24]; - const int temp = - #if HAS_HEATED_BED - custom_bed_temp - #else - 0 - #endif - ; - sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_commands_P(PSTR("G28")); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Validate Mesh submenu - * - * << UBL Tools - * PLA Mesh Validation - * ABS Mesh Validation - * Validate Custom Mesh - * << Info Screen - */ - void _lcd_ubl_validate_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #else - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #endif - MENU_ITEM(function, MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Grid Leveling Command - */ - void _lcd_ubl_grid_level_cmd() { - char UBL_LCD_GCODE[10]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Grid Leveling submenu - * - * << UBL Tools - * Side points: --- - * Level Mesh - */ - void _lcd_ubl_grid_level() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM_EDIT(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); - MENU_ITEM(function, MSG_UBL_MESH_LEVEL, _lcd_ubl_grid_level_cmd); - END_MENU(); - } - - /** - * UBL Mesh Leveling submenu - * - * << UBL Tools - * 3-Point Mesh Leveling - * - Grid Mesh Leveling >> - * << Info Screen - */ - void _lcd_ubl_mesh_leveling() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); - MENU_ITEM(submenu, MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Fill-in Amount Mesh Command - */ - void _lcd_ubl_fillin_amount_cmd() { - char UBL_LCD_GCODE[16]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Fill-in Mesh submenu - * - * << Build Mesh - * Fill-in Amount: --- - * Fill-in Mesh - * Smart Fill-in - * Manual Fill-in - * << Info Screen - */ - void _lcd_ubl_fillin_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - MENU_ITEM(gcode, MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - MENU_ITEM(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - void _lcd_ubl_invalidate() { - ubl.invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated."); - } - - /** - * UBL Build Mesh submenu - * - * << UBL Tools - * Build PLA Mesh - * Build ABS Mesh - * - Build Custom Mesh >> - * Build Cold Mesh - * - Fill-in Mesh >> - * Continue Bed Mesh - * Invalidate All - * Invalidate Closest - * << Info Screen - */ - void _lcd_ubl_build_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - #else - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - #endif - MENU_ITEM(submenu, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - MENU_ITEM(gcode, MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(submenu, MSG_UBL_FILLIN_MESH, _lcd_ubl_fillin_menu); - MENU_ITEM(gcode, MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); - MENU_ITEM(function, MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - MENU_ITEM(gcode, MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Load Mesh Command - */ - void _lcd_ubl_load_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Save Mesh Command - */ - void _lcd_ubl_save_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Mesh Storage submenu - * - * << Unified Bed Leveling - * Memory Slot: --- - * Load Bed Mesh - * Save Bed Mesh - */ - void _lcd_ubl_storage_mesh() { - int16_t a = settings.calc_num_meshes(); - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - if (!WITHIN(ubl_storage_slot, 0, a - 1)) { - STATIC_ITEM(MSG_NO_STORAGE); - } - else { - MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); - MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); - MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - } - END_MENU(); - } - - /** - * UBL LCD "radar" map homing - */ - void _lcd_ubl_output_map_lcd(); - - void _lcd_ubl_map_homing() { - defer_return_to_status = true; - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING)); - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) { - ubl.lcd_map_control = true; // Return to the map screen - lcd_goto_screen(_lcd_ubl_output_map_lcd); - } - } - - /** - * UBL LCD "radar" map point editing - */ - 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); - snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL LCD Map Movement - */ - void ubl_map_move_to_xy() { - current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); - current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder); - } - - /** - * UBL LCD "radar" map - */ - void set_current_from_steppers_for_axis(const AxisEnum axis); - - void _lcd_do_nothing() {} - void _lcd_hard_stop() { - const screenFunc_t old_screen = currentScreen; - currentScreen = _lcd_do_nothing; - planner.quick_stop(); - currentScreen = old_screen; - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); - } - - void _lcd_ubl_output_map_lcd() { - static int16_t step_scaler = 0; - - if (use_click()) return _lcd_ubl_map_lcd_edit_cmd(); - ENCODER_DIRECTION_NORMAL(); - - if (encoderPosition) { - step_scaler += (int32_t)encoderPosition; - x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); - if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - - // Encoder to the right (++) - if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; } - if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0; - - // Encoder to the left (--) - if (x_plot <= GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1)) { x_plot = GRID_MAX_POINTS_X - 1; y_plot--; } - if (y_plot <= GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1)) y_plot = GRID_MAX_POINTS_Y - 1; - - // Prevent underrun/overrun of plot numbers - x_plot = constrain(x_plot, GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1), GRID_MAX_POINTS_X + 1); - y_plot = constrain(y_plot, GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1), GRID_MAX_POINTS_Y + 1); - - // Determine number of points to edit - #if IS_KINEMATIC - n_edit_pts = 9; //TODO: Delta accessible edit points - #else - const bool xc = WITHIN(x_plot, 1, GRID_MAX_POINTS_X - 2), - yc = WITHIN(y_plot, 1, GRID_MAX_POINTS_Y - 2); - n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners - #endif - - if (lcdDrawUpdate) { - lcd_implementation_ubl_plot(x_plot, y_plot); - - if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. - _lcd_hard_stop(); - - ubl_map_move_to_xy(); // Move to new location - } - } - - /** - * UBL Homing before LCD map - */ - void _lcd_ubl_output_map_lcd_cmd() { - if (!all_axes_known()) { - axis_homed = 0; - enqueue_and_echo_commands_P(PSTR("G28")); - } - lcd_goto_screen(_lcd_ubl_map_homing); - } - - /** - * UBL Output map submenu - * - * << Unified Bed Leveling - * Output for Host - * Output for CSV - * Off Printer Backup - * Output Mesh Map - */ - void _lcd_ubl_output_map() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); - MENU_ITEM(function, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); - END_MENU(); - } - - /** - * UBL Tools submenu - * - * << Unified Bed Leveling - * - Build Mesh >> - * - Validate Mesh >> - * - Edit Mesh >> - * - Mesh Leveling >> - */ - void _lcd_ubl_tools_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(submenu, MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); - MENU_ITEM(submenu, MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(submenu, MSG_UBL_EDIT_MESH_MENU, _lcd_ubl_edit_mesh); - MENU_ITEM(submenu, MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); - END_MENU(); - } - - /** - * UBL Step-By-Step submenu - * - * << Unified Bed Leveling - * 1 Build Cold Mesh - * 2 Smart Fill-in - * - 3 Validate Mesh >> - * 4 Fine Tune All - * - 5 Validate Mesh >> - * 6 Fine Tune All - * 7 Save Bed Mesh - */ - void _lcd_ubl_step_by_step() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(gcode, "2 " MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - END_MENU(); - } - - /** - * UBL System submenu - * - * << Prepare - * - Manually Build Mesh >> - * - Activate UBL >> - * - Deactivate UBL >> - * - Step-By-Step UBL >> - * - Mesh Storage >> - * - Output Map >> - * - UBL Tools >> - * - Output UBL Info >> - */ - - void _lcd_ubl_level_bed() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); - MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); - MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); - MENU_ITEM(function, MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); - MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); - MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); - MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); - MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - END_MENU(); - } - - #endif // AUTO_BED_LEVELING_UBL - - - #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } - #endif - - #if ENABLED(LCD_BED_LEVELING) - - /** - * Step 1: Bed Level entry-point - * - * << Prepare - * Auto Home (if homing needed) - * Leveling On/Off (if data exists, and homed) - * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) - * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) - * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) - * Level Bed > - * Level Corners > (if homed) - * Load Settings (Req: EEPROM_SETTINGS) - * Save Settings (Req: EEPROM_SETTINGS) - */ - void lcd_bed_leveling() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - const bool is_homed = all_axes_known(); - - // Auto Home if not using manual probing - #if DISABLED(PROBE_MANUALLY) && DISABLED(MESH_BED_LEVELING) - if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #endif - - // Level Bed - #if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) - // Manual leveling uses a guided procedure - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); - #else - // Automatic leveling can just run the G-code - MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); - #endif - - // Homed and leveling is valid? Then leveling can be toggled. - if (is_homed && leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - - // Z Fade Height - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // MBL Z Offset - // - #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - #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); - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - // Move to the next corner for leveling - if (all_axes_homed()) MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - #endif // LCD_BED_LEVELING - - /** - * - * "Prepare" submenu - * - */ - - void lcd_prepare_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - - // - // Move Axis - // - #if ENABLED(DELTA) - if (all_axes_homed()) - #endif - MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); - - // - // Auto Home - // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); - #endif - - // - // TMC Z Calibration - // - #if ENABLED(TMC_Z_CALIBRATION) - MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); - #endif - - // - // Level Bed - // - #if ENABLED(AUTO_BED_LEVELING_UBL) - - MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); - - #elif ENABLED(LCD_BED_LEVELING) - - #if ENABLED(PROBE_MANUALLY) - if (!g29_in_progress) - #endif - MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling); - - #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) - - #if DISABLED(PROBE_MANUALLY) - MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); - #endif - if (leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - #endif - - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - if (all_axes_homed()) - MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if HAS_M206_COMMAND && DISABLED(SLIM_LCD_MENUS) - // - // Set Home Offsets - // - MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); - #endif - - // - // Disable Steppers - // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); - - // - // Change filament - // - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!IS_SD_FILE_OPEN) { - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - } - #endif // ADVANCED_PAUSE_FEATURE - - #if HAS_TEMP_HOTEND - - // - // Cooldown - // - bool has_heat = false; - HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; } - #if HAS_HEATED_BED - if (thermalManager.target_temperature_bed) has_heat = true; - #endif - if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); - - // - // Preheat for Material 1 and 2 - // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED - MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - - #endif // HAS_TEMP_HOTEND - - // - // BLTouch Self-Test and Reset - // - #if ENABLED(BLTOUCH) - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - if (!endstops.z_probe_enabled && TEST_BLTOUCH()) - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - #endif - - // - // Switch power on/off - // - #if HAS_POWER_SWITCH - if (powersupply_on) - MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); - else - MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); - #endif - - // - // Autostart - // - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); - #endif - - // - // Delta Calibration - // - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); - #endif - - END_MENU(); - } - - float move_menu_scale; - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void lcd_move_z(); - - void _man_probe_pt(const float &rx, const float &ry) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_xy(rx, ry); - - lcd_synchronize(); - move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - lcd_goto_screen(lcd_move_z); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_AUTO_CALIBRATION) - - float lcd_probe_pt(const float &rx, const float &ry) { - _man_probe_pt(rx, ry); - KEEPALIVE_STATE(PAUSED_FOR_USER); - defer_return_to_status = true; - wait_for_user = true; - while (wait_for_user) idle(); - KEEPALIVE_STATE(IN_HANDLER); - lcd_goto_previous_menu_no_defer(); - return current_position[Z_AXIS]; - } - - #endif // DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_CALIBRATION_MENU) - - void _lcd_calibrate_homing() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - if (all_axes_homed()) - lcd_goto_previous_menu(); - } - - void _lcd_delta_calibrate_home() { - enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_screen(_lcd_calibrate_homing); - } - - void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } - void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); } - void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); } - void _goto_center() { _man_probe_pt(0,0); } - - #endif // DELTA_CALIBRATION_MENU - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void _recalc_delta_settings() { - #if HAS_LEVELING - reset_bed_level(); // After changing kinematics bed-level data is no longer valid - #endif - recalc_delta_settings(); - } - - void lcd_delta_settings() { - START_MENU(); - MENU_BACK(MSG_DELTA_CALIBRATE); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); - END_MENU(); - } - - void lcd_delta_calibrate_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); - MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1")); - MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1")); - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - #endif - MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); - #if ENABLED(DELTA_CALIBRATION_MENU) - MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center); - } - #endif - END_MENU(); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - /** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send immediately - */ - inline void manage_manual_move() { - - if (processing_manual_move) return; - - if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { - - #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; - #endif - - // Set movement on a single axis - set_destination_from_current(); - destination[manual_move_axis] += manual_move_offset; - - // Reset for the next move - manual_move_offset = 0; - manual_move_axis = (int8_t)NO_AXIS; - - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // 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() - processing_manual_move = false; - - feedrate_mm_s = old_feedrate; - #if EXTRUDERS > 1 - active_extruder = old_extruder; - #endif - - #else - - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); - manual_move_axis = (int8_t)NO_AXIS; - - #endif - } - } - - /** - * Set a flag that lcd_update() should start a move - * to "current_position" after a short delay. - */ - inline void manual_move_to_current(AxisEnum axis - #if E_MANUAL > 1 - , const int8_t eindex=-1 - #endif - ) { - #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1 - #if E_MANUAL > 1 - if (axis == E_AXIS) - #endif - manual_move_e_index = eindex >= 0 ? eindex : active_extruder; - #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - manual_move_axis = (int8_t)axis; - } - - /** - * - * "Prepare" > "Move Axis" submenu - * - */ - - void _lcd_move_xyz(const char* name, AxisEnum axis) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition && !processing_manual_move) { - - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop_min[X_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop_max[X_AXIS]; - #endif - break; - case Y_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop_min[Y_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop_max[Y_AXIS]; - #endif - break; - case Z_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop_min[Z_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop_max[Z_AXIS]; - #endif - default: break; - } - #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS - - // Delta limits XY based on the current offset from center - // This assumes the center is 0,0 - #if ENABLED(DELTA) - if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis - min = -max; - } - #endif - - // Get the new position - const float diff = float((int32_t)encoderPosition) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(manual_move_offset, min - current_position[axis]); - else - NOMORE(manual_move_offset, max - current_position[axis]); - #else - current_position[axis] += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(current_position[axis], min); - else - NOMORE(current_position[axis], max); - #endif - - manual_move_to_current(axis); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - if (lcdDrawUpdate) { - const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis] - #if IS_KINEMATIC - + manual_move_offset - #endif - , axis); - lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); - } - } - 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); } - void _lcd_move_e( - #if E_MANUAL > 1 - const int8_t eindex=-1 - #endif - ) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - if (!processing_manual_move) { - const float diff = float((int32_t)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 - #endif - ); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - } - if (lcdDrawUpdate) { - 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; - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - } - #endif // E_MANUAL > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] - #if IS_KINEMATIC - + manual_move_offset - #endif - )); - } - } - - void lcd_move_e() { _lcd_move_e(); } - #if E_MANUAL > 1 - void lcd_move_e0() { _lcd_move_e(0); } - void lcd_move_e1() { _lcd_move_e(1); } - #if E_MANUAL > 2 - void lcd_move_e2() { _lcd_move_e(2); } - #if E_MANUAL > 3 - void lcd_move_e3() { _lcd_move_e(3); } - #if E_MANUAL > 4 - void lcd_move_e4() { _lcd_move_e(4); } - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Prepare" > "Move Xmm" > "Move XYZ" submenu - * - */ - - screenFunc_t _manual_move_func_ptr; - - void _goto_manual_move(const float scale) { - defer_return_to_status = true; - move_menu_scale = scale; - lcd_goto_screen(_manual_move_func_ptr); - } - void lcd_move_menu_10mm() { _goto_manual_move(10); } - void lcd_move_menu_1mm() { _goto_manual_move( 1); } - void lcd_move_menu_01mm() { _goto_manual_move( 0.1f); } - - void _lcd_move_distance_menu(const AxisEnum axis, const screenFunc_t func) { - _manual_move_func_ptr = func; - 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; - default: - STATIC_ITEM(MSG_MOVE_E, true, true); break; - } - } - MENU_BACK(MSG_MOVE_AXIS); - MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); - END_MENU(); - } - void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); } - void lcd_move_get_y_amount() { _lcd_move_distance_menu(Y_AXIS, lcd_move_y); } - void lcd_move_get_z_amount() { _lcd_move_distance_menu(Z_AXIS, lcd_move_z); } - void lcd_move_get_e_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e); } - #if E_MANUAL > 1 - void lcd_move_get_e0_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e0); } - void lcd_move_get_e1_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e1); } - #if E_MANUAL > 2 - void lcd_move_get_e2_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e2); } - #if E_MANUAL > 3 - void lcd_move_get_e3_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e3); } - #if E_MANUAL > 4 - void lcd_move_get_e4_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e4); } - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Prepare" > "Move Axis" submenu - * - */ - - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - #define _MOVE_XYZ_ALLOWED (all_axes_homed()) - #else - #define _MOVE_XYZ_ALLOWED true - #endif - - #if ENABLED(DELTA) - #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height) - void lcd_lower_z_to_clip_height() { - line_to_z(delta_clip_start_height); - lcd_synchronize(); - } - #else - #define _MOVE_XY_ALLOWED true - #endif - - void lcd_move_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); - #endif - - if (_MOVE_XYZ_ALLOWED) { - if (_MOVE_XY_ALLOWED) { - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount); - } - #if ENABLED(DELTA) - else - MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height); - #endif - - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount); - } - else - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - #if EXTRUDERS == 4 - switch (active_extruder) { - case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; - case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; - case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; - case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; - } - #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - } - #else - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - #endif - - #elif ENABLED(DUAL_X_CARRIAGE) - - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - - #endif - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(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); - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - #endif - - END_MENU(); - } - - /** - * - * "Control" submenu - * - */ - - #if HAS_LCD_CONTRAST - void lcd_callback_set_contrast() { set_lcd_contrast(lcd_contrast); } - #endif - - static void lcd_factory_settings() { - settings.reset(); - lcd_completion_feedback(); - } - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - - static void lcd_init_eeprom() { - lcd_completion_feedback(settings.init_eeprom()); - lcd_goto_previous_menu(); - } - - static void lcd_init_eeprom_confirm() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom); - END_MENU(); - } - - #endif - - void lcd_control_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); - MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu); - #elif ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif - - #if HAS_LCD_CONTRAST - MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true); - #endif - #if ENABLED(FWRETRACT) - MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu); - #endif - #if ENABLED(DAC_STEPPER_CURRENT) - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_dac_menu); - #endif - #if HAS_MOTOR_CURRENT_PWM - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_pwm_menu); - #endif - - #if ENABLED(BLTOUCH) - MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); - #endif - - END_MENU(); - } - - /** - * - * "Temperature" submenu - * - */ - - #if ENABLED(PID_AUTOTUNE_MENU) - - #if ENABLED(PIDTEMP) - int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); - #endif - - #if ENABLED(PIDTEMPBED) - int16_t autotune_temp_bed = 70; - #endif - - void _lcd_autotune(int16_t e) { - char cmd[30]; - sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, - #if HAS_PID_FOR_BOTH - e < 0 ? autotune_temp_bed : autotune_temp[e] - #elif ENABLED(PIDTEMPBED) - autotune_temp_bed - #else - autotune_temp[e] - #endif - ); - lcd_enqueue_command(cmd); - } - - #endif // PID_AUTOTUNE_MENU - - #if ENABLED(PIDTEMP) - - // Helpers for editing PID Ki & Kd values - // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); - } - void copy_and_scalePID_d(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); - } - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } - - #if ENABLED(PID_AUTOTUNE_MENU) - #define DEFINE_PIDTEMP_FUNCS(N) \ - _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } typedef void _pid_##N##_void - #else - #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N) typedef void _pid_##N##_void - #endif - - DEFINE_PIDTEMP_FUNCS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - #if HOTENDS > 1 - DEFINE_PIDTEMP_FUNCS(1); - #if HOTENDS > 2 - DEFINE_PIDTEMP_FUNCS(2); - #if HOTENDS > 3 - DEFINE_PIDTEMP_FUNCS(3); - #if HOTENDS > 4 - DEFINE_PIDTEMP_FUNCS(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // PID_PARAMS_PER_HOTEND - - #endif // PIDTEMP - - /** - * - * "Control" > "Temperature" submenu - * - */ - void lcd_control_temperature_menu() { - START_MENU(); - - // - // ^ Control - // - MENU_BACK(MSG_CONTROL); - - // - // Nozzle: - // Nozzle [1-5]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fanSpeeds[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fanSpeeds[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 2", &new_fanSpeeds[1], 3, 255); - #endif - #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 3", &new_fanSpeeds[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Autotemp, Min, Max, Fact - // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND - MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); - #endif - - // - // PID-P, PID-I, PID-D, PID-C, PID Autotune - // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 - // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 - // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 - // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 - // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 - // - #if ENABLED(PIDTEMP) - - #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ - raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ - raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ - MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) - - #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ - MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) - #else - #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_MENU_ITEMS(ELABEL, eindex); \ - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) - #else - #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - PID_MENU_ITEMS(" " MSG_E1, 0); - PID_MENU_ITEMS(" " MSG_E2, 1); - #if HOTENDS > 2 - PID_MENU_ITEMS(" " MSG_E3, 2); - #if HOTENDS > 3 - PID_MENU_ITEMS(" " MSG_E4, 3); - #if HOTENDS > 4 - PID_MENU_ITEMS(" " MSG_E5, 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - PID_MENU_ITEMS("", 0); - #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - - #endif // PIDTEMP - - #if DISABLED(SLIM_LCD_MENUS) - // - // Preheat Material 1 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_material1_settings_menu); - - // - // Preheat Material 2 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_material2_settings_menu); - #endif - - END_MENU(); - } - - #if DISABLED(SLIM_LCD_MENUS) - - void _lcd_control_temperature_preheat_settings_menu(const uint8_t material) { - #if HOTENDS > 4 - #define MINTEMP_ALL MIN5(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) - #define MAXTEMP_ALL MAX5(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) - #elif HOTENDS > 3 - #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) - #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) - #elif HOTENDS > 2 - #define MINTEMP_ALL MIN3(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) - #define MAXTEMP_ALL MAX3(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) - #elif HOTENDS > 1 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) - #else - #define MINTEMP_ALL HEATER_0_MINTEMP - #define MAXTEMP_ALL HEATER_0_MAXTEMP - #endif - START_MENU(); - MENU_BACK(MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255); - #if HAS_TEMP_HOTEND - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); - #endif - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - /** - * - * "Temperature" > "Preheat Material 1 conf" submenu - * - */ - void lcd_control_temperature_preheat_material1_settings_menu() { _lcd_control_temperature_preheat_settings_menu(0); } - - /** - * - * "Temperature" > "Preheat Material 2 conf" submenu - * - */ - void lcd_control_temperature_preheat_material2_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); } - - void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } - void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } - void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } - #if E_STEPPERS > 2 - void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } - #if E_STEPPERS > 3 - void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } - #if E_STEPPERS > 4 - void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - void _planner_refresh_positioning() { planner.refresh_positioning(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - _planner_refresh_positioning(); - else - planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.axis_steps_per_mm[E_AXIS + e]; - } - void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } - void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } - #if E_STEPPERS > 2 - void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } - #if E_STEPPERS > 3 - void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } - #if E_STEPPERS > 4 - void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - // M203 / M205 Velocity options - void lcd_control_motion_velocity_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - // M203 Max Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_A, &planner.max_feedrate_mm_s[A_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_B, &planner.max_feedrate_mm_s[B_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_C, &planner.max_feedrate_mm_s[C_AXIS], 1, 999); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.max_feedrate_mm_s[E_AXIS + 1], 1, 999); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 2], 1, 999); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E4, &planner.max_feedrate_mm_s[E_AXIS + 3], 1, 999); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E5, &planner.max_feedrate_mm_s[E_AXIS + 4], 1, 999); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - #endif - - // M205 S Min Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999); - - // M205 T Min Travel Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999); - - END_MENU(); - } - - // M201 / M204 Accelerations - void lcd_control_motion_acceleration_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - // M204 P Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); - - // M204 R Retract Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); - - // M204 T Travel Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - - // M201 settings - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_A, &planner.max_acceleration_mm_per_s2[A_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_B, &planner.max_acceleration_mm_per_s2[B_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_C, &planner.max_acceleration_mm_per_s2[C_AXIS], 10, 99000, _reset_acceleration_rates); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E5, &planner.max_acceleration_mm_per_s2[E_AXIS + 4], 100, 99000, _reset_e4_acceleration_rate); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); - #endif - - END_MENU(); - } - - // M205 Jerk - void lcd_control_motion_jerk_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - #if ENABLED(JUNCTION_DEVIATION) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990); - #if ENABLED(DELTA) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990); - #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); - #endif - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); - #endif - - END_MENU(); - } - - // M92 Steps-per-mm - void lcd_control_motion_steps_per_mm_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ASTEPS, &planner.axis_steps_per_mm[A_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_BSTEPS, &planner.axis_steps_per_mm[B_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_CSTEPS, &planner.axis_steps_per_mm[C_AXIS], 5, 9999, _planner_refresh_positioning); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); - #endif - - END_MENU(); - } - - #endif // !SLIM_LCD_MENUS - - /** - * - * "Control" > "Motion" submenu - * - */ - - void lcd_control_motion_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - - #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); - #endif - - #if DISABLED(SLIM_LCD_MENUS) - - // M203 / M205 - Feedrate items - MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu); - - // M201 - Acceleration items - MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu); - - // M205 - Max Jerk - MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu); - - // M92 - Steps Per mm - MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu); - - #endif // !SLIM_LCD_MENUS - - // M540 S - Abort on endstop hit when SD printing - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); - #endif - - END_MENU(); - } - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - /** - * - * "Control" > "Filament" submenu - * - */ - void lcd_control_filament_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - - #if ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif - - #if DISABLED(NO_VOLUMETRICS) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); - - if (parser.volumetric_enabled) { - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - const float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &filament_change_unload_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &filament_change_unload_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &filament_change_unload_length[2], 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &filament_change_unload_length[3], 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &filament_change_unload_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &filament_change_load_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &filament_change_load_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &filament_change_load_length[2], 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &filament_change_load_length[3], 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &filament_change_load_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - END_MENU(); - } - #endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE - - /** - * - * "Control" > "Retract" submenu - * - */ - #if ENABLED(FWRETRACT) - - void lcd_control_retract_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.retract_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.swap_retract_length, 0, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.retract_feedrate_mm_s, 1, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.retract_recover_length, -100, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.swap_retract_recover_length, -100, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.retract_recover_feedrate_mm_s, 1, 999); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.swap_retract_recover_feedrate_mm_s, 1, 999); - #endif - END_MENU(); - } - - #endif // FWRETRACT - - #if ENABLED(SDSUPPORT) - - #if !PIN_EXISTS(SD_DETECT) - void lcd_sd_refresh() { - card.initsd(); - encoderTopLine = 0; - } - #endif - - void lcd_sd_updir() { - encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; - encoderTopLine = 0; - screen_changed = true; - lcd_refresh(); - } - - /** - * - * "Print from SD" submenu - * - */ - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - uint32_t last_sdfile_encoderPosition = 0xFFFF; - - void lcd_reselect_last_file() { - if (last_sdfile_encoderPosition == 0xFFFF) return; - #if ENABLED(DOGLCD) - // Some of this is a hack to force the screen update to work. - // TODO: Fix the real issue that causes this! - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - _lcd_synchronize(); - safe_delay(50); - _lcd_synchronize(); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - drawing_screen = screen_changed = true; - #endif - - lcd_goto_screen(lcd_sdcard_menu, last_sdfile_encoderPosition); - defer_return_to_status = true; - last_sdfile_encoderPosition = 0xFFFF; - - #if ENABLED(DOGLCD) - lcd_update(); - #endif - } - #endif - - void lcd_sdcard_menu() { - ENCODER_DIRECTION_MENUS(); - - const uint16_t fileCnt = card.get_num_Files(); - - START_MENU(); - MENU_BACK(MSG_MAIN); - card.getWorkDirName(); - - if (card.filename[0] == '/') { - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); - #endif - } - else { - MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); - } - - for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuLineNr == _thisItemNr) { - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; - - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename(nr); - #endif - - if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card); - else - MENU_ITEM(sdfile, MSG_CARD_MENU, card); - } - else { - MENU_ITEM_DUMMY(); - } - } - END_MENU(); - } - - #endif // SDSUPPORT - - #if ENABLED(LCD_INFO_MENU) - - #if ENABLED(PRINTCOUNTER) - /** - * - * About Printer > Statistics submenu - * - */ - void lcd_info_stats_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - - char buffer[21]; - printStatistics stats = print_job_timer.getStats(); - - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - - duration_t elapsed = stats.printTime; - elapsed.toString(buffer); - - 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 - - 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 - END_SCREEN(); - } - #endif // PRINTCOUNTER - - /** - * - * About Printer > Thermistors - * - */ - void lcd_info_thermistors_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - 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 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); - #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); - #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); - #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); - #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); - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Board Info - * - */ - void lcd_info_board_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - START_SCREEN(); - STATIC_ITEM(BOARD_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 - #if POWER_SUPPLY == 0 - STATIC_ITEM(MSG_INFO_PSU ": Generic", true); - #elif POWER_SUPPLY == 1 - STATIC_ITEM(MSG_INFO_PSU ": ATX", true); // Power Supply: ATX - #elif POWER_SUPPLY == 2 - STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Printer Info - * - */ - void lcd_info_printer_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - 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(); - } - - /** - * - * "About Printer" submenu - * - */ - void lcd_info_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu); // Printer Info > - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info > - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors > - #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics > - #endif - END_MENU(); - } - #endif // LCD_INFO_MENU - - /** - * - * LED Menu - * - */ - - #if ENABLED(LED_CONTROL_MENU) - - #if ENABLED(LED_COLOR_PRESETS) - - void lcd_led_presets_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, true, true); - #endif - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); - MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); - MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); - MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); - MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); - MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); - MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); - MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); - END_MENU(); - } - #endif // LED_COLOR_PRESETS - - void lcd_led_custom_menu() { - START_MENU(); - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); - #if ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); - #endif - #endif - END_MENU(); - } - - void lcd_led_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - bool led_on = leds.lights_on; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); - MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); - #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); - #endif - MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu); - END_MENU(); - } - - #endif // LED_CONTROL_MENU - - /** - * - * Filament Change Feature Screens - * - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * - * "Change Filament" > "Change/Unload/Load Filament" submenu - * - */ - static AdvancedPauseMode _change_filament_temp_mode; - static int8_t _change_filament_temp_extruder; - - static const char* _change_filament_temp_command() { - switch (_change_filament_temp_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR("M701 T%d"); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); - case ADVANCED_PAUSE_MODE_PAUSE_PRINT: - default: - return PSTR("M600 B0 T%d"); - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _change_filament_temp(const uint8_t index) { - char cmd[11]; - sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); - thermalManager.setTargetHotend(index == 1 ? PREHEAT_1_TEMP_HOTEND : PREHEAT_2_TEMP_HOTEND, _change_filament_temp_extruder); - lcd_enqueue_command(cmd); - } - void _lcd_change_filament_temp_1_menu() { _change_filament_temp(1); } - void _lcd_change_filament_temp_2_menu() { _change_filament_temp(2); } - - static const char* change_filament_header(const AdvancedPauseMode mode) { - switch (mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENTLOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENTUNLOAD); - default: break; - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _lcd_temp_menu_filament_op(const AdvancedPauseMode 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); - MENU_BACK(MSG_FILAMENTCHANGE); - MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu); - END_MENU(); - } - void lcd_temp_menu_e0_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } - void lcd_temp_menu_e0_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } - void lcd_temp_menu_e0_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } - #if E_STEPPERS > 1 - void lcd_temp_menu_e1_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); } - void lcd_temp_menu_e1_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); } - void lcd_temp_menu_e1_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); } - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - void lcd_unload_filament_all_temp_menu() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); } - #endif - #if E_STEPPERS > 2 - void lcd_temp_menu_e2_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); } - void lcd_temp_menu_e2_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); } - void lcd_temp_menu_e2_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); } - #if E_STEPPERS > 3 - void lcd_temp_menu_e3_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); } - void lcd_temp_menu_e3_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); } - void lcd_temp_menu_e3_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); } - #if E_STEPPERS > 4 - void lcd_temp_menu_e4_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); } - void lcd_temp_menu_e4_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); } - void lcd_temp_menu_e4_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - - /** - * - * "Change Filament" submenu - * - */ - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - // Change filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_change); - else - MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_change); - else - MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_change); - else - MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_change); - else - MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!planner.movesplanned() && !IS_SD_FILE_OPEN) { - // Load filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_load); - else - MENU_ITEM_P(gcode, msg1, PSTR("M701 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_load); - else - MENU_ITEM_P(gcode, msg2, PSTR("M701 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_load); - else - MENU_ITEM_P(gcode, msg3, PSTR("M701 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_load); - else - MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - // Unload filament - #if E_STEPPERS == 1 - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, lcd_temp_menu_e0_filament_unload); - #else - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (thermalManager.targetHotEnoughToExtrude(0) - #if E_STEPPERS > 1 - && thermalManager.targetHotEnoughToExtrude(1) - #if E_STEPPERS > 2 - && thermalManager.targetHotEnoughToExtrude(2) - #if E_STEPPERS > 3 - && thermalManager.targetHotEnoughToExtrude(3) - #if E_STEPPERS > 4 - && thermalManager.targetHotEnoughToExtrude(4) - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - ) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, lcd_unload_filament_all_temp_menu); - #endif - if (thermalManager.targetHotEnoughToExtrude(0)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, lcd_temp_menu_e0_filament_unload); - if (thermalManager.targetHotEnoughToExtrude(1)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, lcd_temp_menu_e1_filament_unload); - #if E_STEPPERS > 2 - if (thermalManager.targetHotEnoughToExtrude(2)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, lcd_temp_menu_e2_filament_unload); - #if E_STEPPERS > 3 - if (thermalManager.targetHotEnoughToExtrude(3)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, lcd_temp_menu_e3_filament_unload); - #if E_STEPPERS > 4 - if (thermalManager.targetHotEnoughToExtrude(4)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, lcd_temp_menu_e4_filament_unload); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - } - #endif - - END_MENU(); - } - #endif - - static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; - static uint8_t hotend_status_extruder = 0; - - static const char* advanced_pause_header() { - switch (advanced_pause_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); - default: break; - } - return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); - } - - // Portions from STATIC_ITEM... - #define HOTEND_STATUS_ITEM() do { \ - if (_menuLineNr == _thisItemNr) { \ - if (lcdDrawUpdate) { \ - lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ - lcd_implementation_hotend_status(_lcdLineNr, hotend_status_extruder); \ - } \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } \ - ++_thisItemNr; \ - }while(0) - - void lcd_advanced_pause_resume_print() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; - } - - void lcd_advanced_pause_extrude_more() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; - } - - void lcd_advanced_pause_option_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); - #endif - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_advanced_pause_resume_print); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); - END_MENU(); - } - - void lcd_advanced_pause_init_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); - #ifdef MSG_FILAMENT_CHANGE_INIT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); - #define __FC_LINES_A 3 - #else - #define __FC_LINES_A 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INIT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); - #define _FC_LINES_A (__FC_LINES_A + 1) - #else - #define _FC_LINES_A __FC_LINES_A - #endif - #if LCD_HEIGHT > _FC_LINES_A + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_unload_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); - #define __FC_LINES_B 3 - #else - #define __FC_LINES_B 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); - #define _FC_LINES_B (__FC_LINES_B + 1) - #else - #define _FC_LINES_B __FC_LINES_B - #endif - #if LCD_HEIGHT > _FC_LINES_B + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_wait_for_nozzles_to_heat() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); - #ifdef MSG_FILAMENT_CHANGE_HEATING_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); - #define _FC_LINES_C 3 - #else - #define _FC_LINES_C 2 - #endif - #if LCD_HEIGHT > _FC_LINES_C + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_heat_nozzle() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); - #define _FC_LINES_D 3 - #else - #define _FC_LINES_D 2 - #endif - #if LCD_HEIGHT > _FC_LINES_D + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_insert_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); - #define __FC_LINES_E 3 - #else - #define __FC_LINES_E 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INSERT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); - #define _FC_LINES_E (__FC_LINES_E + 1) - #else - #define _FC_LINES_E __FC_LINES_E - #endif - #if LCD_HEIGHT > _FC_LINES_E + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_load_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); - #ifdef MSG_FILAMENT_CHANGE_LOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); - #define __FC_LINES_F 3 - #else - #define __FC_LINES_F 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_LOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); - #define _FC_LINES_F (__FC_LINES_F + 1) - #else - #define _FC_LINES_F __FC_LINES_F - #endif - #if LCD_HEIGHT > _FC_LINES_F + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_purge_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - void lcd_advanced_pause_continuous_purge_menu() { - START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - STATIC_ITEM(MSG_USERWAIT); - END_SCREEN(); - } - #endif - - void lcd_advanced_pause_resume_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); - #ifdef MSG_FILAMENT_CHANGE_RESUME_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); - #endif - #ifdef MSG_FILAMENT_CHANGE_RESUME_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); - #endif - END_SCREEN(); - } - - FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) { - switch (message) { - case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message; - case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message; - case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message; - case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message; - case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message; - case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message; - case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle; - case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat; - case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; - return lcd_advanced_pause_option_menu; - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE: return lcd_advanced_pause_continuous_purge_menu; - #endif - case ADVANCED_PAUSE_MESSAGE_STATUS: - default: break; - } - return NULL; - } - - void lcd_advanced_pause_show_message( - const AdvancedPauseMessage message, - const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/, - const uint8_t extruder/*=active_extruder*/ - ) { - advanced_pause_mode = mode; - hotend_status_extruder = extruder; - const screenFunc_t next_screen = ap_message_screen(message); - if (next_screen) { - defer_return_to_status = true; - lcd_goto_screen(next_screen); - } - else - lcd_return_to_status(); - } - - #endif // ADVANCED_PAUSE_FEATURE - - /** - * - * Functions for editing single values - * - * The "DEFINE_MENU_EDIT_TYPE" macro generates the functions needed to edit a numerical value. - * - * For example, DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1) expands into these functions: - * - * bool _menu_edit_int3(); - * void menu_edit_int3(); // edit int16_t (interactively) - * void menu_edit_callback_int3(); // edit int16_t (interactively) with callback on completion - * void _menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_callback_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback - * - * You can then use one of the menu macros to present the edit interface: - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * - * This expands into a more primitive menu item: - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - * ...which calls: - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - */ - #define DEFINE_MENU_EDIT_TYPE(_type, _name, _strFunc, _scale) \ - bool _menu_edit_ ## _name() { \ - ENCODER_DIRECTION_NORMAL(); \ - if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ - if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale))); \ - if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ - _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale); \ - if (editValue != NULL) *((_type*)editValue) = value; \ - if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ - if (lcd_clicked) lcd_goto_previous_menu(); \ - } \ - return use_click(); \ - } \ - void menu_edit_ ## _name() { _menu_edit_ ## _name(); } \ - void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \ - lcd_save_previous_screen(); \ - lcd_refresh(); \ - \ - editLabel = pstr; \ - editValue = ptr; \ - minEditValue = minValue * _scale; \ - maxEditValue = maxValue * _scale - minEditValue; \ - encoderPosition = (*ptr) * _scale - minEditValue; \ - } \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \ - _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentScreen = menu_edit_ ## _name; \ - callbackFunc = callback; \ - liveEdit = live; \ - } \ - FORCE_INLINE void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \ - menu_action_setting_edit_callback_ ## _name(pstr, ptr, minValue, maxValue); \ - } \ - typedef void _name##_void - - DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); - DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); - DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); - DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); - DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); - DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); - DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); - DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); - - /** - * - * Handlers for Keypad input - * - */ - #if ENABLED(ADC_KEYPAD) - - inline bool handle_adc_keypad() { - #define ADC_MIN_KEY_DELAY 100 - if (buttons_reprapworld_keypad) { - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - if (encoderDirection == -1) { // side effect which signals we are inside a menu - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(true); } - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(true); } - } - else { - if (buttons_reprapworld_keypad & (EN_REPRAPWORLD_KEYPAD_DOWN|EN_REPRAPWORLD_KEYPAD_UP|EN_REPRAPWORLD_KEYPAD_RIGHT)) { - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition += ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) encoderPosition = 0; - } - } - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLNPAIR("buttons_reprapworld_keypad = ", (uint32_t)buttons_reprapworld_keypad); - SERIAL_PROTOCOLLNPAIR("encoderPosition = ", (uint32_t)encoderPosition); - #endif - next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; - return true; - } - - return false; - } - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - encoderPosition = dir; - switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); - default: break; - } - } - void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); } - void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); } - void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); } - void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); } - void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } - void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } - void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait - void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); } - - inline void handle_reprapworld_keypad() { - - static uint8_t keypad_debounce = 0; - - if (!REPRAPWORLD_KEYPAD_PRESSED) { - if (keypad_debounce > 0) keypad_debounce--; - } - else if (!keypad_debounce) { - keypad_debounce = 2; - - if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu(); - - #if DISABLED(DELTA) && Z_HOME_DIR == -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - - if (all_axes_homed()) { - #if ENABLED(DELTA) || Z_HOME_DIR != -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); - if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); - if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); - } - else { - if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); - } - } - } - - #endif // REPRAPWORLD_KEYPAD - - /** - * - * Menu actions - * - */ - void _menu_action_back() { lcd_goto_previous_menu(); } - void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } - void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } - void menu_action_function(screenFunc_t func) { (*func)(); } - - #if ENABLED(SDSUPPORT) - - void menu_action_sdfile(CardReader& theCard) { - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use - #endif - card.openAndPrintFile(theCard.filename); -#if POWER_LOSS_RECOVER_SUPER_CAP - strcpy(recovery_detect_cap.file_name, theCard.filename); - SERIAL_ECHOLN(theCard.filename); - recovery_detect_cap.recovery=0; -#endif - lcd_return_to_status(); - lcd_reset_status(); - } - - void menu_action_sddirectory(CardReader& theCard) { - card.chdir(theCard.filename); - encoderTopLine = 0; - encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - lcd_refresh(); - } - - #endif // SDSUPPORT - - void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); } - void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) { - menu_action_setting_edit_bool(pstr, ptr); - (*callback)(); - } - -#endif // ULTIPANEL - -void lcd_init() { - - lcd_implementation_init(); - - #if ENABLED(NEWPANEL) - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - - #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - SET_INPUT_PULLUP(SHIFT_OUT); - #endif - - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - - #else // !NEWPANEL - - #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register - SET_OUTPUT(SR_DATA_PIN); - SET_OUTPUT(SR_CLK_PIN); - #elif defined(SHIFT_CLK) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - OUT_WRITE(SHIFT_EN, LOW); - SET_INPUT_PULLUP(SHIFT_OUT); - #endif // SR_LCD_2W_NL - - #endif // !NEWPANEL - - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - SET_INPUT_PULLUP(SD_DETECT_PIN); - lcd_sd_status = 2; // UNKNOWN - #endif - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = 0; - #endif - - lcd_buttons_update(); - - #if ENABLED(ULTIPANEL) - encoderDiff = 0; - #endif -} - -int16_t utf8_strlen(const char* s) { - int16_t i = 0, j = 0; - while (s[i]) { - if (START_OF_UTF8_CHAR(s[i])) j++; - i++; - } - return j; -} - -int16_t utf8_strlen_P(const char* s) { - int16_t j = 0; - while (pgm_read_byte(s)) { - if (START_OF_UTF8_CHAR(pgm_read_byte(s))) j++; - s++; - } - return j; -} - -bool lcd_blink() { - static uint8_t blink = 0; - static millis_t next_blink_ms = 0; - millis_t ms = millis(); - if (ELAPSED(ms, next_blink_ms)) { - blink ^= 0xFF; - next_blink_ms = ms + 1000 - (LCD_UPDATE_INTERVAL) / 2; - } - return blink != 0; -} - -/** - * Update the LCD, read encoder buttons, etc. - * - Read button states - * - Check the SD Card slot state - * - Act on RepRap World keypad input - * - Update the encoder position - * - Apply acceleration to the encoder position - * - Set lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NOW on controller events - * - Reset the Info Screen timeout if there's any input - * - Update status indicators, if any - * - * Run the current LCD menu handler callback function: - * - Call the handler only if lcdDrawUpdate != LCDVIEW_NONE - * - Before calling the handler, LCDVIEW_CALL_NO_REDRAW => LCDVIEW_NONE - * - Call the menu handler. Menu handlers should do the following: - * - If a value changes, set lcdDrawUpdate to LCDVIEW_REDRAW_NOW and draw the value - * (Encoder events automatically set lcdDrawUpdate for you.) - * - if (lcdDrawUpdate) { redraw } - * - Before exiting the handler set lcdDrawUpdate to: - * - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT. - * - LCDVIEW_REDRAW_NOW to draw now (including remaining stripes). - * - LCDVIEW_CALL_REDRAW_NEXT to draw now and get LCDVIEW_REDRAW_NOW on the next loop. - * - LCDVIEW_CALL_NO_REDRAW to draw now and get LCDVIEW_NONE on the next loop. - * - NOTE: For graphical displays menu handlers may be called 2 or more times per loop, - * so don't change lcdDrawUpdate without considering this. - * - * After the menu handler callback runs (or not): - * - Clear the LCD if lcdDrawUpdate == LCDVIEW_CLEAR_CALL_REDRAW - * - Update lcdDrawUpdate for the next loop (i.e., move one state down, usually) - * - * No worries. This function is only called from the main thread. - */ -void lcd_update() { - - #if ENABLED(ULTIPANEL) - static millis_t return_to_status_ms = 0; - - // Handle any queued Move Axis motion - manage_manual_move(); - - // Update button states for LCD_CLICKED, etc. - // After state changes the next button update - // may be delayed 300-500ms. - lcd_buttons_update(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - // Don't run the debouncer if UBL owns the display - #define UBL_CONDITION !lcd_external_control - #else - #define UBL_CONDITION true - #endif - - // If the action button is pressed... - if (UBL_CONDITION && LCD_CLICKED) { - if (!wait_for_unclick) { // 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 - lcd_quick_feedback(true); // Always make a click sound - } - } - else wait_for_unclick = false; - - #if BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED) { - lcd_quick_feedback(true); - lcd_goto_previous_menu(); - } - #endif - - #endif // ULTIPANEL - - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - - const uint8_t sd_status = (uint8_t)IS_SD_INSERTED; - if (sd_status != lcd_sd_status && lcd_detected()) { - - uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! - lcd_sd_status = sd_status; - - if (sd_status) { - safe_delay(500); // Some boards need a delay to get settled - card.initsd(); - if (old_sd_status == 2) - card.beginautostart(); // Initial boot - else - LCD_MESSAGEPGM(MSG_SD_INSERTED); - } - else { - card.release(); - if (old_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED); - } - - lcd_refresh(); - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) - currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU - #endif - ); - } - - #endif // SDSUPPORT && SD_DETECT_PIN - - #if ENABLED(POWER_LOSS_RECOVERY) - if (job_recovery_commands_count && job_recovery_phase == JOB_RECOVERY_IDLE) { - lcd_goto_screen(lcd_job_recovery_menu); - job_recovery_phase = JOB_RECOVERY_MAYBE; // Waiting for a response - } - #endif - - const millis_t ms = millis(); - if (ELAPSED(ms, next_lcd_update_ms) - #if ENABLED(DOGLCD) - || drawing_screen - #endif - ) { - - next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - lcd_implementation_update_indicators(); - #endif - - #if ENABLED(ULTIPANEL) - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context - #endif - - #if ENABLED(ADC_KEYPAD) - - if (handle_adc_keypad()) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - handle_reprapworld_keypad(); - - #endif - - const bool encoderPastThreshold = (ABS(encoderDiff) >= ENCODER_PULSES_PER_STEP); - if (encoderPastThreshold || lcd_clicked) { - if (encoderPastThreshold) { - int32_t encoderMultiplier = 1; - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - - if (encoderRateMultiplierEnabled) { - int32_t encoderMovementSteps = ABS(encoderDiff) / ENCODER_PULSES_PER_STEP; - - if (lastEncoderMovementMillis) { - // Note that the rate is always calculated between two passes through the - // loop and that the abs of the encoderDiff value is tracked. - float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000; - - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; - - #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate); - SERIAL_ECHOPAIR(" Multiplier: ", encoderMultiplier); - SERIAL_ECHOPAIR(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); - SERIAL_ECHOPAIR(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); - SERIAL_EOL(); - #endif // ENCODER_RATE_MULTIPLIER_DEBUG - } - - lastEncoderMovementMillis = ms; - } // encoderRateMultiplierEnabled - #endif // ENCODER_RATE_MULTIPLIER - - encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; - encoderDiff = 0; - } - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - #endif // ULTIPANEL - - // We arrive here every ~100ms when idling often enough. - // Instead of tracking the changes simply redraw the Info Screen ~1 time a second. - if ( - #if ENABLED(ULTIPANEL) - currentScreen == lcd_status_screen && - #endif - !lcd_status_update_delay-- - ) { - lcd_status_update_delay = 9 - #if ENABLED(DOGLCD) - + 3 - #endif - ; - max_display_update_time--; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - - #if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) - // If scrolling of long file names is enabled and we are in the sd card menu, - // cause a refresh to occur until all the text has scrolled into view. - if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { - lcd_status_update_delay = 6; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - filename_scroll_pos++; - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - } - #endif - - // then we want to use 1/2 of the time only. - uint16_t bbr2 = planner.block_buffer_runtime() >> 1; - - #if ENABLED(DOGLCD) - #define IS_DRAWING drawing_screen - #else - #define IS_DRAWING false - #endif - - if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { - - // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { - case LCDVIEW_CALL_NO_REDRAW: - lcdDrawUpdate = LCDVIEW_NONE; - break; - case LCDVIEW_CLEAR_CALL_REDRAW: - case LCDVIEW_CALL_REDRAW_NEXT: - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT - case LCDVIEW_NONE: - break; - } // switch - - #if ENABLED(ADC_KEYPAD) - buttons_reprapworld_keypad = 0; - #endif - - #if ENABLED(ULTIPANEL) - #define CURRENTSCREEN() (*currentScreen)() - #else - #define CURRENTSCREEN() lcd_status_screen() - #endif - - #if ENABLED(DOGLCD) - #if ENABLED(LIGHTWEIGHT_UI) - #if ENABLED(ULTIPANEL) - const bool in_status = currentScreen == lcd_status_screen; - #else - constexpr bool in_status = true; - #endif - const bool do_u8g_loop = !in_status; - lcd_in_status(in_status); - if (in_status) lcd_status_screen(); - #else - constexpr bool do_u8g_loop = true; - #endif - if (do_u8g_loop) { - if (!drawing_screen) { // If not already drawing pages - u8g.firstPage(); // Start the first page - drawing_screen = first_page = true; // Flag as drawing pages - } - lcd_setFont(FONT_MENU); // Setup font for every page draw - u8g.setColorIndex(1); // And reset the color - CURRENTSCREEN(); // Draw and process the current screen - first_page = false; - - // The screen handler can clear drawing_screen for an action that changes the screen. - // If still drawing and there's another page, update max-time and return now. - // The nextPage will already be set up on the next call. - if (drawing_screen && (drawing_screen = u8g.nextPage())) { - NOLESS(max_display_update_time, millis() - ms); - return; - } - } - #else - CURRENTSCREEN(); - #endif - - #if ENABLED(ULTIPANEL) - lcd_clicked = false; - #endif - - // Keeping track of the longest time for an individual LCD update. - // Used to do screen throttling when the planner starts to fill up. - NOLESS(max_display_update_time, millis() - ms); - } - - #if ENABLED(ULTIPANEL) - - // Return to Status Screen after a timeout - if (currentScreen == lcd_status_screen || defer_return_to_status) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; -#if POWER_LOSS_RECOVER_SUPER_CAP - else if (ELAPSED(ms, return_to_status_ms)&&(recovery_detect_cap.recovery!=3)) -#else - else if (ELAPSED(ms, return_to_status_ms)) -#endif - lcd_return_to_status(); - - #endif // ULTIPANEL - - // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { - case LCDVIEW_CLEAR_CALL_REDRAW: - lcd_implementation_clear(); break; - case LCDVIEW_REDRAW_NOW: - lcdDrawUpdate = LCDVIEW_NONE; - case LCDVIEW_NONE: - case LCDVIEW_CALL_REDRAW_NEXT: - case LCDVIEW_CALL_NO_REDRAW: - default: break; - } // switch - - } // ELAPSED(ms, next_lcd_update_ms) -} - -void lcd_finishstatus(const bool persist=false) { - - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) - UNUSED(persist); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - progress_bar_ms = millis(); - #if PROGRESS_MSG_EXPIRE > 0 - expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; - #endif - #endif - lcd_refresh(); - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); //get status message to show up for a while - #endif - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif -} - -#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - void dontExpireStatus() { expire_status_ms = 0; } -#endif - -bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } - -void lcd_setstatus(const char * const message, const bool persist) { - if (lcd_status_message_level > 0) return; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(*pend)) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(persist); -} - -void lcd_setstatusPGM(const char * const message, int8_t level) { - if (level < 0) level = lcd_status_message_level = 0; - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen_P(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy_P(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(level > 0); -} - -void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - va_list args; - va_start(args, fmt); - vsnprintf_P(lcd_status_message, MAX_MESSAGE_LENGTH, fmt, args); - va_end(args); - lcd_finishstatus(level > 0); -} - -void lcd_setalertstatusPGM(const char * const message) { - lcd_setstatusPGM(message, 1); - #if ENABLED(ULTIPANEL) - lcd_return_to_status(); - #endif -} - -void lcd_reset_alert_level() { lcd_status_message_level = 0; } - -#if HAS_LCD_CONTRAST - - void set_lcd_contrast(const int16_t value) { - lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(lcd_contrast); - } - -#endif - -#if ENABLED(ULTIPANEL) - - /** - * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) - * These values are independent of which pins are used for EN_A and EN_B indications - * The rotary encoder part is also independent to the chipset used for the LCD - */ - #if defined(EN_A) && defined(EN_B) - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 - #endif - - #define GET_SHIFT_BUTTON_STATES(DST) \ - uint8_t new_##DST = 0; \ - WRITE(SHIFT_LD, LOW); \ - WRITE(SHIFT_LD, HIGH); \ - for (int8_t i = 0; i < 8; i++) { \ - new_##DST >>= 1; \ - if (READ(SHIFT_OUT)) SBI(new_##DST, 7); \ - WRITE(SHIFT_CLK, HIGH); \ - WRITE(SHIFT_CLK, LOW); \ - } \ - DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 - - - /** - * Read encoder buttons from the hardware registers - * Warning: This function is called from interrupt context! - */ - void lcd_buttons_update() { - static uint8_t lastEncoderBits; - const millis_t now = millis(); - if (ELAPSED(now, next_button_update_ms)) { - - #if ENABLED(NEWPANEL) - uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif - - // - // Directional buttons - // - #if LCD_HAS_DIRECTIONAL_BUTTONS - - #if ENABLED(REVERSE_MENU_DIRECTION) - #define _ENCODER_UD_STEPS (ENCODER_STEPS_PER_MENU_ITEM * encoderDirection) - #else - #define _ENCODER_UD_STEPS ENCODER_STEPS_PER_MENU_ITEM - #endif - #if ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_UD_STEPS _ENCODER_UD_STEPS - #define ENCODER_LR_PULSES ENCODER_PULSES_PER_STEP - #else - #define ENCODER_UD_STEPS -(_ENCODER_UD_STEPS) - #define ENCODER_LR_PULSES -(ENCODER_PULSES_PER_STEP) - #endif - - if (false) { - // for the else-ifs below - } - #if BUTTON_EXISTS(UP) - else if (BUTTON_PRESSED(UP)) { - encoderDiff = -(ENCODER_UD_STEPS); - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(DWN) - else if (BUTTON_PRESSED(DWN)) { - encoderDiff = ENCODER_UD_STEPS; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(LFT) - else if (BUTTON_PRESSED(LFT)) { - encoderDiff = -(ENCODER_LR_PULSES); - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(RT) - else if (BUTTON_PRESSED(RT)) { - encoderDiff = ENCODER_LR_PULSES; - next_button_update_ms = now + 300; - } - #endif - - #endif // LCD_HAS_DIRECTIONAL_BUTTONS - - buttons = newbutton; - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - buttons |= slow_buttons; - #endif - - #if ENABLED(ADC_KEYPAD) - - uint8_t newbutton_reprapworld_keypad = 0; - buttons = 0; - if (buttons_reprapworld_keypad == 0) { - newbutton_reprapworld_keypad = get_ADC_keyValue(); - if (WITHIN(newbutton_reprapworld_keypad, 1, 8)) - buttons_reprapworld_keypad = _BV(newbutton_reprapworld_keypad - 1); - } - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - GET_SHIFT_BUTTON_STATES(buttons_reprapworld_keypad); - - #endif - - #else // !NEWPANEL - - GET_SHIFT_BUTTON_STATES(buttons); - - #endif - - } // next_button_update_ms - - // Manage encoder rotation - #if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff -= encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff += encoderDirection) - #elif ENABLED(REVERSE_MENU_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff += encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff -= encoderDirection) - #elif ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff--) - #define ENCODER_DIFF_CCW (encoderDiff++) - #else - #define ENCODER_DIFF_CW (encoderDiff++) - #define ENCODER_DIFF_CCW (encoderDiff--) - #endif - #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; } - - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case encrot0: ENCODER_SPIN(encrot3, encrot1); break; - case encrot1: ENCODER_SPIN(encrot0, encrot2); break; - case encrot2: ENCODER_SPIN(encrot1, encrot3); break; - case encrot3: ENCODER_SPIN(encrot2, encrot0); break; - } - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (lcd_external_control) { - ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. - encoderDiff = 0; // Hide the encoder event from the current screen handler. - } - #endif - lastEncoderBits = enc; - } - } - - #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE) - bool lcd_detected() { return lcd.LcdDetected() == 1; } - #else - bool lcd_detected() { return true; } - #endif - - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp() { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #endif - } - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked() { return LCD_CLICKED; } - void wait_for_release() { - while (is_lcd_clicked()) safe_delay(50); - safe_delay(50); - } - #endif - -#endif // ULTIPANEL - -#if ENABLED(ADC_KEYPAD) - - typedef struct { - uint16_t ADCKeyValueMin, ADCKeyValueMax; - uint8_t ADCKeyNo; - } _stADCKeypadTable_; - - static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { - // VALUE_MIN, VALUE_MAX, KEY - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 }, // F1 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 }, // F2 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 }, // F3 - { 300, 500, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 }, // LEFT - { 1900, 2200, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 }, // RIGHT - { 570, 870, BLEN_REPRAPWORLD_KEYPAD_UP + 1 }, // UP - { 2670, 2870, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 }, // DOWN - { 1150, 1450, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, // ENTER - }; - - uint8_t get_ADC_keyValue(void) { - if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw >> 2; - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLN(currentkpADCValue); - #endif - thermalManager.current_ADCKey_raw = 0; - thermalManager.ADCKey_count = 0; - if (currentkpADCValue < 4000) - for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { - const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), - hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); - if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); - } - } - return 0; - } -#endif - -#endif // ULTRA_LCD diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h deleted file mode 100644 index 772c98fe3d..0000000000 --- a/Marlin/ultralcd.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULTRALCD_H -#define ULTRALCD_H - -#include "MarlinConfig.h" - -#if ENABLED(ULTRA_LCD) || ENABLED(MALYAN_LCD) - void lcd_init(); - bool lcd_detected(); - void lcd_update(); - void lcd_setalertstatusPGM(const char* message); -#else - inline void lcd_init() {} - inline bool lcd_detected() { return true; } - inline void lcd_update() {} - inline void lcd_setalertstatusPGM(const char* message) { UNUSED(message); } -#endif - -#if ENABLED(ULTRA_LCD) - - #include "Marlin.h" - - int16_t utf8_strlen(const char* s); - int16_t utf8_strlen_P(const char* s); - bool lcd_hasstatus(); - void lcd_setstatus(const char* message, const bool persist=false); - void lcd_setstatusPGM(const char* message, const int8_t level=0); - void lcd_setalertstatusPGM(const char* message); - void lcd_reset_alert_level(); - void lcd_reset_status(); - void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...); - void lcd_kill_screen(); - void kill_screen(const char* lcd_msg); -#if POWER_LOSS_RECOVER_SUPER_CAP - void lcd_recover_menu(void) ; -#endif - extern uint8_t lcdDrawUpdate; - inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } - - #if HAS_BUZZER - void lcd_buzz(const long duration, const uint16_t freq); - #endif - - void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual - - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - void dontExpireStatus(); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - extern uint8_t progress_bar_percent; - #endif - - #if ENABLED(ADC_KEYPAD) - uint8_t get_ADC_keyValue(); - #endif - - #if ENABLED(DOGLCD) - extern int16_t lcd_contrast; - void set_lcd_contrast(const int16_t value); - #endif - - #if ENABLED(SHOW_BOOTSCREEN) - void lcd_bootscreen(); - #endif - - #define LCD_UPDATE_INTERVAL 100 - #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - - #if ENABLED(ULTIPANEL) // LCD with a click-wheel input - - extern bool defer_return_to_status; - - // Function pointer to menu functions. - typedef void (*screenFunc_t)(); - typedef void (*menuAction_t)(); - - extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - extern bool lcd_external_control; - #else - constexpr bool lcd_external_control = false; - #endif - - #if ENABLED(LCD_BED_LEVELING) - extern bool lcd_wait_for_move; - #else - constexpr bool lcd_wait_for_move = false; - #endif - - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); - - void lcd_completion_feedback(const bool good=true); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - extern uint8_t active_extruder; - void lcd_advanced_pause_show_message(const AdvancedPauseMessage message, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT, - const uint8_t extruder=active_extruder); - #endif - - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp(); - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) - void lcd_mesh_edit_setup(const float &initial); - float lcd_mesh_edit(); - void lcd_z_offset_edit_setup(const float &initial); - float lcd_z_offset_edit(); - #endif - - #endif - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - extern millis_t previous_lcd_status_ms; - #endif - - bool lcd_blink(); - - #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL - - #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values - - #define BLEN_REPRAPWORLD_KEYPAD_F3 0 - #define BLEN_REPRAPWORLD_KEYPAD_F2 1 - #define BLEN_REPRAPWORLD_KEYPAD_F1 2 - #define BLEN_REPRAPWORLD_KEYPAD_DOWN 3 - #define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4 - #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5 - #define BLEN_REPRAPWORLD_KEYPAD_UP 6 - #define BLEN_REPRAPWORLD_KEYPAD_LEFT 7 - - #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3)) - #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2)) - #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1)) - #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN)) - #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT)) - #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE)) - #define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP)) - #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT)) - - #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3) - #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2) - #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) - #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) - #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) - #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) - - #if ENABLED(ADC_KEYPAD) - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_F1 - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_MIDDLE - #else - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_MIDDLE - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_F1 - #endif - #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) - #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) - - #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ - EN_REPRAPWORLD_KEYPAD_F3 | \ - EN_REPRAPWORLD_KEYPAD_F2 | \ - EN_REPRAPWORLD_KEYPAD_F1 | \ - EN_REPRAPWORLD_KEYPAD_DOWN | \ - EN_REPRAPWORLD_KEYPAD_RIGHT | \ - EN_REPRAPWORLD_KEYPAD_MIDDLE | \ - EN_REPRAPWORLD_KEYPAD_UP | \ - EN_REPRAPWORLD_KEYPAD_LEFT) \ - ) - - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked(); - void wait_for_release(); - #endif - -#else // MALYAN_LCD or no LCD - - constexpr bool lcd_wait_for_move = false; - - inline void lcd_refresh() {} - inline bool lcd_hasstatus() { return false; } - inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } - inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } - inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); } - inline void lcd_reset_alert_level() {} - inline void lcd_reset_status() {} - -#endif // ULTRA_LCD - -#if ENABLED(ULTIPANEL) - - #if ENABLED(NEWPANEL) // Uses digital switches, not a shift register - - // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) - #define BLEN_A 0 - #define BLEN_B 1 - - #define EN_A _BV(BLEN_A) - #define EN_B _BV(BLEN_B) - - #if BUTTON_EXISTS(ENC) - #define BLEN_C 2 - #define EN_C _BV(BLEN_C) - #endif - - #if BUTTON_EXISTS(BACK) - #define BLEN_D 3 - #define EN_D _BV(BLEN_D) - #define LCD_BACK_CLICKED (buttons & EN_D) - #endif - - #endif // NEWPANEL - - extern volatile uint8_t buttons; // The last-checked buttons in a bit array. - void lcd_buttons_update(); - -#else - - inline void lcd_buttons_update() {} - -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #ifdef EN_C - #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) - #else - #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU - #endif -#elif defined(EN_C) - #define LCD_CLICKED (buttons & EN_C) -#else - #define LCD_CLICKED false -#endif - -#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) -#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x)) - -#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - void lcd_reselect_last_file(); -#endif - -#if ENABLED(ULTIPANEL) && ENABLED(SDSUPPORT) - extern bool abort_sd_printing; -#else - constexpr bool abort_sd_printing = false; -#endif - -#endif // ULTRALCD_H diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h deleted file mode 100644 index 2858878bc2..0000000000 --- a/Marlin/ultralcd_impl_DOGM.h +++ /dev/null @@ -1,723 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * ultralcd_impl_DOGM.h - * - * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin - * Demonstrator: http://www.reprap.org/wiki/STB_Electronics - * 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 - */ - -/** - * Implementation of the LCD display routines for a DOGM128 graphic display. - * These are common LCD 128x64 pixel graphic displays. - */ - -#ifndef ULTRALCD_IMPL_DOGM_H -#define ULTRALCD_IMPL_DOGM_H - -#include "MarlinConfig.h" - -#include - -#include "ultralcd.h" -#include "dogm_bitmaps.h" -#include "utility.h" -#include "duration_t.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -// Only Western languages support big / small fonts -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT -#endif - -#if ENABLED(U8GLIB_ST7920) - #include "ultralcd_st7920_u8glib_rrd.h" -#endif - -#if ENABLED(U8GLIB_ST7565_64128N) - #include "ultralcd_st7565_u8glib_VIKI.h" -#endif - -#if ENABLED(USE_SMALL_INFOFONT) - #include "dogm_font_data_6x9_marlin.h" - #define FONT_STATUSMENU_NAME u8g_font_6x9 - #define INFO_FONT_HEIGHT 7 -#else - #define FONT_STATUSMENU_NAME FONT_MENU_NAME - #define INFO_FONT_HEIGHT 8 -#endif - -#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#define FONT_SPECIAL_NAME Marlin_symbols - -#if DISABLED(SIMULATE_ROMFONT) - #if ENABLED(DISPLAY_CHARSET_ISO10646_1) - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_PL) - #include "dogm_font_data_ISO10646_1_PL.h" - #define FONT_MENU_NAME ISO10646_1_PL_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_5) - #include "dogm_font_data_ISO10646_5_Cyrillic.h" - #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA) - #include "dogm_font_data_ISO10646_Kana.h" - #define FONT_MENU_NAME ISO10646_Kana_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) - #include "dogm_font_data_ISO10646_Greek.h" - #define FONT_MENU_NAME ISO10646_Greek_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_CN) - #include "dogm_font_data_ISO10646_CN.h" - #define FONT_MENU_NAME ISO10646_CN - #define TALL_FONT_CORRECTION 1 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_TR) - #include "dogm_font_data_ISO10646_1_tr.h" - #define FONT_MENU_NAME ISO10646_TR - #elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ) - #include "dogm_font_data_ISO10646_CZ.h" - #define FONT_MENU_NAME ISO10646_CZ - #elif ENABLED(DISPLAY_CHARSET_ISO10646_SK) - #include "dogm_font_data_ISO10646_SK.h" - #define FONT_MENU_NAME ISO10646_SK - #else // fall-back - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #endif -#else // SIMULATE_ROMFONT - #if DISPLAY_CHARSET_HD44780 == JAPANESE - #include "dogm_font_data_HD44780_J.h" - #define FONT_MENU_NAME HD44780_J_5x7 - #elif DISPLAY_CHARSET_HD44780 == WESTERN - #include "dogm_font_data_HD44780_W.h" - #define FONT_MENU_NAME HD44780_W_5x7 - #elif DISPLAY_CHARSET_HD44780 == CYRILLIC - #include "dogm_font_data_HD44780_C.h" - #define FONT_MENU_NAME HD44780_C_5x7 - #else // fall-back - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #endif -#endif // SIMULATE_ROMFONT - -//#define FONT_STATUSMENU_NAME FONT_MENU_NAME - -#define FONT_STATUSMENU 1 -#define FONT_SPECIAL 2 -#define FONT_MENU_EDIT 3 -#define FONT_MENU 4 - -// DOGM parameters (size in pixels) -#define DOG_CHAR_WIDTH 6 -#define DOG_CHAR_HEIGHT 12 -#if ENABLED(USE_BIG_EDIT_FONT) - #define FONT_MENU_EDIT_NAME u8g_font_9x18 - #define DOG_CHAR_WIDTH_EDIT 9 - #define DOG_CHAR_HEIGHT_EDIT 18 -#else - #define FONT_MENU_EDIT_NAME FONT_MENU_NAME - #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH - #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT -#endif - -#ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 -#endif - -#define START_COL 0 - -// LCD selection -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS); // 2 stripes - // U8GLIB_ST7920_128X64 u8g(LCD_PINS_RS); // 8 stripes -#elif ENABLED(U8GLIB_ST7920) - //U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 2 stripes - // No 4 stripe device available from u8glib. - //U8GLIB_ST7920_128X64_1X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 8 stripes - U8GLIB_ST7920_128X64_RRD u8g(0); // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT -#elif ENABLED(CARTESIO_UI) - // The CartesioUI display - #if DOGLCD_MOSI != -1 && DOGLCD_SCK != -1 - // using SW-SPI - //U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes - #else - //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes - #endif -#elif ENABLED(U8GLIB_LM6059_AF) - // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_LM6059_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, and Viki 2.0, ST7565 controller as well - // U8GLIB_ST7565_64128n_2x_VIKI u8g(0); // using SW-SPI DOGLCD_MOSI != -1 && DOGLCD_SCK - U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI - //U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes HWSPI -#elif ENABLED(MKS_12864OLED_SSD1306) - // MKS 128x64 (SSD1306) OLED I2C LCD - U8GLIB_SSD1306_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SSD1306_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes - U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(MKS_12864OLED) - // MKS 128x64 (SH1106) OLED I2C LCD - U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SH1106_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes - U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - U8GLIB_SSD1309_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); -#elif ENABLED(MINIPANEL) - // The MINIPanel display - //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes -#else - // for regular DOGM128 display with HW-SPI - //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 4 stripes -#endif - -#ifndef LCD_PIXEL_WIDTH - #define LCD_PIXEL_WIDTH 128 -#endif -#ifndef LCD_PIXEL_HEIGHT - #define LCD_PIXEL_HEIGHT 64 -#endif - -#include "utf_mapper.h" - -int16_t lcd_contrast; // Initialized by settings.load() -static char currentfont = 0; - -// The current graphical page being rendered -u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p; - -// For selective rendering within a Y range -#define PAGE_UNDER(yb) (u8g.getU8g()->current_page.y0 <= (yb)) -#define PAGE_CONTAINS(ya, yb) (PAGE_UNDER(yb) && u8g.getU8g()->current_page.y1 >= (ya)) - -static void lcd_setFont(const char font_nr) { - switch (font_nr) { - case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; - case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; - case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; - case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; - break; - } -} - -void lcd_print(const char c) { - if (WITHIN(c, 1, LCD_STR_SPECIAL_MAX)) { - u8g.setFont(FONT_SPECIAL_NAME); - u8g.print(c); - lcd_setFont(currentfont); - } - else charset_mapper(c); -} - -char lcd_print_and_count(const char c) { - if (WITHIN(c, 1, LCD_STR_SPECIAL_MAX)) { - u8g.setFont(FONT_SPECIAL_NAME); - u8g.print(c); - lcd_setFont(currentfont); - return 1; - } - else return charset_mapper(c); -} - -/** - * Core LCD printing functions - * On DOGM all strings go through a filter for utf - * But only use lcd_print_utf and lcd_printPGM_utf for translated text - */ -void lcd_print(const char *str) { while (*str) lcd_print(*str++); } -void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd_print(c), ++str; } - -void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = *str)) n -= charset_mapper(c), ++str; -} - -void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str; -} - -#if ENABLED(SHOW_BOOTSCREEN) - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - void lcd_custom_bootscreen() { - constexpr u8g_uint_t left = (LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2, - top = (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2; - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - constexpr u8g_uint_t right = left + CUSTOM_BOOTSCREEN_BMPWIDTH, - bottom = top + CUSTOM_BOOTSCREEN_BMPHEIGHT; - #endif - u8g.firstPage(); - do { - u8g.drawBitmapP( - left, top, - CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp - ); - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - u8g.setColorIndex(1); - if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); - if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); - #endif - } while (u8g.nextPage()); - safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); - } - - #endif // SHOW_CUSTOM_BOOTSCREEN - - void lcd_bootscreen() { - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - lcd_custom_bootscreen(); - #endif - - constexpr uint8_t offy = - #if ENABLED(START_BMPHIGH) - (LCD_PIXEL_HEIGHT - (START_BMPHEIGHT)) / 2 - #else - 0 - //DOG_CHAR_HEIGHT - #endif - ; - - const uint8_t width = u8g.getWidth(), height = u8g.getHeight(), - offx = (width - (START_BMPWIDTH)) / 2; - - u8g.firstPage(); - do { - u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); - lcd_setFont(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - const uint8_t txt1X = width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH); - u8g.drawStr(txt1X, (height + DOG_CHAR_HEIGHT) / 2, STRING_SPLASH_LINE1); - #else - const uint8_t txt1X = (width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2, - txt2X = (width - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2; - u8g.drawStr(txt1X, height - (DOG_CHAR_HEIGHT) * 3 / 3, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, height - (DOG_CHAR_HEIGHT) * 1 / 6, STRING_SPLASH_LINE2); - #endif - } while (u8g.nextPage()); - safe_delay(BOOTSCREEN_TIMEOUT); - } - -#endif // SHOW_BOOTSCREEN - -#if ENABLED(LIGHTWEIGHT_UI) - #include "status_screen_lite_ST7920.h" -#else - #include "status_screen_DOGM.h" -#endif - -// Initialize or re-initialize the LCD -static void lcd_implementation_init() { - - #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - #endif - - #if !defined(LCD_RESET_PIN) && (ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)) - #define LCD_RESET_PIN LCD_PINS_RS - #endif - - #if PIN_EXISTS(LCD_RESET) - OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset - _delay_ms(5); - OUT_WRITE(LCD_RESET_PIN, HIGH); - _delay_ms(5); // delay to allow the display to initalize - #endif - - #if PIN_EXISTS(LCD_RESET) - u8g.begin(); - #endif - - #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel - u8g.setContrast(lcd_contrast); - #endif - - #if ENABLED(LCD_SCREEN_ROT_90) - u8g.setRot90(); // Rotate screen by 90° - #elif ENABLED(LCD_SCREEN_ROT_180) - u8g.setRot180(); // Rotate screen by 180° - #elif ENABLED(LCD_SCREEN_ROT_270) - u8g.setRot270(); // Rotate screen by 270° - #endif -} - -// The kill screen is displayed for unrecoverable conditions -void lcd_kill_screen() { - #if ENABLED(LIGHTWEIGHT_UI) - ST7920_Lite_Status_Screen::clear_text_buffer(); - #endif - const uint8_t h4 = u8g.getHeight() / 4; - u8g.firstPage(); - do { - lcd_setFont(FONT_MENU); - u8g.setPrintPos(0, h4 * 1); - lcd_print_utf(lcd_status_message); - u8g.setPrintPos(0, h4 * 2); - lcd_printPGM_utf(PSTR(MSG_HALTED)); - u8g.setPrintPos(0, h4 * 3); - lcd_printPGM_utf(PSTR(MSG_PLEASE_RESET)); - } while (u8g.nextPage()); -} - -void lcd_implementation_clear() { } // Automatically cleared by Picture Loop - -#if ENABLED(ULTIPANEL) - - uint8_t row_y1, row_y2; - uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - - u8g.setPrintPos(LCD_PIXEL_WIDTH - 11 * (DOG_CHAR_WIDTH), row_y2); - lcd_print('E'); - lcd_print((char)('1' + extruder)); - lcd_print(' '); - lcd_print(itostr3(thermalManager.degHotend(extruder))); - lcd_print('/'); - - if (lcd_blink() || !thermalManager.is_heater_idle(extruder)) - lcd_print(itostr3(thermalManager.degTargetHotend(extruder))); - } - - #endif // ADVANCED_PAUSE_FEATURE - - // Set the colors for a menu item based on whether it is selected - static void lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - - if (isSelected) { - #if ENABLED(MENU_HOLLOW_FRAME) - u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH); - u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH); - #else - u8g.setColorIndex(1); // black on white - u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, row_height - 1); - u8g.setColorIndex(0); // white on black - #endif - } - #if DISABLED(MENU_HOLLOW_FRAME) - else { - u8g.setColorIndex(1); // unmarked text is black on white - } - #endif - u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), row_y2); - } - - // Draw a static line of text in the same idiom as a menu item - static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char* valstr=NULL) { - - lcd_implementation_mark_as_selected(row, invert); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - char c; - int8_t n = LCD_WIDTH - (START_COL); - - if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { u8g.print(' '); n--; } - } - while (n > 0 && (c = pgm_read_byte(pstr))) { - n -= lcd_print_and_count(c); - pstr++; - } - if (valstr) while (n > 0 && (c = *valstr)) { - n -= lcd_print_and_count(c); - valstr++; - } - while (n-- > 0) u8g.print(' '); - } - - // Draw a generic menu item - static void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, const char* pstr, const char pre_char, const char post_char) { - UNUSED(pre_char); - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - uint8_t n = LCD_WIDTH - (START_COL) - 2; - while (char c = pgm_read_byte(pstr)) { - n -= lcd_print_and_count(c); - pstr++; - } - while (n--) u8g.print(' '); - u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), row_y2); - lcd_print(post_char); - u8g.print(' '); - } - - // Macros for specific types of menu items - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) - #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) - #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - - // Draw a menu item with an editable value - static void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, const char* pstr, const char* const data, const bool pgm) { - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); - uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen; - - while (char c = pgm_read_byte(pstr)) { - n -= lcd_print_and_count(c); - pstr++; - } - u8g.print(':'); - while (n--) u8g.print(' '); - u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, row_y2); - if (pgm) lcd_printPGM(data); else lcd_print((char*)data); - } - - // Macros for edit items - #define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false) - #define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true) - - #define DRAWMENU_SETTING_EDIT_GENERIC(_src) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, _src) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - - void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) { - const uint8_t labellen = utf8_strlen_P(pstr), - vallen = utf8_strlen(value); - - uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1; - - #if ENABLED(USE_BIG_EDIT_FONT) - constexpr uint8_t lcd_width_edit = (LCD_PIXEL_WIDTH) / (DOG_CHAR_WIDTH_EDIT); - - uint8_t lcd_width, char_width; - if (labellen <= lcd_width_edit - 1) { - if (labellen + vallen + 2 >= lcd_width_edit) rows = 2; - lcd_width = lcd_width_edit + 1; - char_width = DOG_CHAR_WIDTH_EDIT; - lcd_setFont(FONT_MENU_EDIT); - } - else { - lcd_width = LCD_WIDTH - (START_COL); - char_width = DOG_CHAR_WIDTH; - lcd_setFont(FONT_MENU); - } - #else - constexpr uint8_t lcd_width = LCD_WIDTH - (START_COL), - char_width = DOG_CHAR_WIDTH; - #endif - - // Center either one or two rows - const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3 - uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2; - - bool onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline); - if (onpage) { - u8g.setPrintPos(0, baseline); - lcd_printPGM_utf(pstr); - } - - if (value != NULL) { - u8g.print(':'); - if (rows == 2) { - baseline += segmentHeight; - onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline); - } - if (onpage) { - u8g.setPrintPos(((lcd_width - 1) - (vallen + 1)) * char_width, baseline); // Right-justified, leaving padded by spaces - u8g.print(' '); // overwrite char if value gets shorter - lcd_print(value); - } - } - } - - #if ENABLED(SDSUPPORT) - - static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, CardReader& theCard, const bool isDir) { - UNUSED(pstr); - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - constexpr uint8_t maxlen = LCD_WIDTH - (START_COL) - 1; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (isSelected) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge - #endif - } - - if (isDir) lcd_print(LCD_STR_FOLDER[0]); - - char c; - uint8_t n = maxlen; - while (n && (c = *outstr)) { - n -= lcd_print_and_count(c); - ++outstr; - } - while (n) { --n; u8g.print(' '); } - } - - #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, false) - #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, true) - - #endif // SDSUPPORT - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * UBL LCD "radar" map data - */ - #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now, - #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here - #define MAP_MAX_PIXELS_X 53 - #define MAP_MAX_PIXELS_Y 49 - - void lcd_implementation_ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { - // Scale the box pixels appropriately - uint8_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), - y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X), - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y), - - x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2, - y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2; - - // Clear the Mesh Map - - if (PAGE_CONTAINS(y_offset - 2, y_offset + y_map_pixels + 4)) { - u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box - u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4); - if (PAGE_CONTAINS(y_offset, y_offset + y_map_pixels)) { - u8g.setColorIndex(0); // Now actually clear the mesh map box - u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels); - } - } - - // Display Mesh Point Locations - - u8g.setColorIndex(1); - const uint8_t sx = x_offset + pixels_per_x_mesh_pnt / 2; - uint8_t y = y_offset + pixels_per_y_mesh_pnt / 2; - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) - if (PAGE_CONTAINS(y, y)) - for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) - u8g.drawBox(x, y, 1, 1); - - // Fill in the Specified Mesh Point - - uint8_t inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to - // invert the Y to get it to plot in the right location. - - const uint8_t by = y_offset + inverted_y * pixels_per_y_mesh_pnt; - if (PAGE_CONTAINS(by, by + pixels_per_y_mesh_pnt)) - u8g.drawBox( - x_offset + x_plot * pixels_per_x_mesh_pnt, by, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt - ); - - // Put Relevant Text on Display - - // Show X and Y positions at top of screen - u8g.setColorIndex(1); - if (PAGE_UNDER(7)) { - u8g.setPrintPos(5, 7); - lcd_print("X:"); - lcd_print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); - u8g.setPrintPos(74, 7); - lcd_print("Y:"); - lcd_print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); - } - - // Print plot position - if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - u8g.setPrintPos(5, LCD_PIXEL_HEIGHT); - lcd_print('('); - u8g.print(x_plot); - lcd_print(','); - u8g.print(y_plot); - lcd_print(')'); - - // Show the location value - u8g.setPrintPos(74, LCD_PIXEL_HEIGHT); - lcd_print("Z:"); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_print(ftostr43sign(ubl.z_values[x_plot][y_plot])); - else - lcd_printPGM(PSTR(" -----")); - } - - } - - #endif // AUTO_BED_LEVELING_UBL - -#endif // ULTIPANEL - -#endif // __ULTRALCD_IMPL_DOGM_H diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h deleted file mode 100644 index d229a8378b..0000000000 --- a/Marlin/ultralcd_impl_HD44780.h +++ /dev/null @@ -1,1635 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULTRALCD_IMPL_HD44780_H -#define ULTRALCD_IMPL_HD44780_H - -/** - * Implementation of the LCD display routines for a Hitachi HD44780 display. - * These are the most common LCD character displays. - */ - -#include "utility.h" -#include "duration_t.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" - - #if ENABLED(ULTIPANEL) - #define ULTRA_X_PIXELS_PER_CHAR 5 - #define ULTRA_Y_PIXELS_PER_CHAR 8 - #define ULTRA_COLUMNS_FOR_MESH_MAP 7 - #define ULTRA_ROWS_FOR_MESH_MAP 4 - - #define N_USER_CHARS 8 - - #define TOP_LEFT _BV(0) - #define TOP_RIGHT _BV(1) - #define LOWER_LEFT _BV(2) - #define LOWER_RIGHT _BV(3) - #endif -#endif - -extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. - -//////////////////////////////////// -// Setup button and encode mappings for each panel (into 'buttons' variable -// -// This is just to map common functions (across different panels) onto the same -// macro name. The mapping is independent of whether the button is directly connected or -// via a shift/i2c register. - -#if ENABLED(ULTIPANEL) - - // - // Setup other button mappings of each panel - // - #if ENABLED(LCD_I2C_VIKI) - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) - - #undef LCD_CLICKED - #if BUTTON_EXISTS(ENC) - // the pause/stop/restart button is connected to BTN_ENC when used - #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name - #define LCD_CLICKED (buttons & (B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop. - #else - #define LCD_CLICKED (buttons & (B_MI|B_RI)) - #endif - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later - - #undef LCD_CLICKED - #define LCD_CLICKED (buttons & B_MI) - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #endif - - #elif DISABLED(NEWPANEL) // old style ULTIPANEL - // Shift register bits correspond to buttons: - #define BL_LE 7 // Left - #define BL_UP 6 // Up - #define BL_MI 5 // Middle - #define BL_DW 4 // Down - #define BL_RI 3 // Right - #define BL_ST 2 // Red Button - #define B_LE (_BV(BL_LE)) - #define B_UP (_BV(BL_UP)) - #define B_MI (_BV(BL_MI)) - #define B_DW (_BV(BL_DW)) - #define B_RI (_BV(BL_RI)) - #define B_ST (_BV(BL_ST)) - #define LCD_CLICKED (buttons & (B_MI|B_ST)) - #endif - -#endif // ULTIPANEL - -//////////////////////////////////// -// Create LCD class instance and chipset-specific information -#if ENABLED(LCD_I2C_TYPE_PCF8575) - // note: these are register mapped pins on the PCF8575 controller not Arduino pins - #define LCD_I2C_PIN_BL 3 - #define LCD_I2C_PIN_EN 2 - #define LCD_I2C_PIN_RW 1 - #define LCD_I2C_PIN_RS 0 - #define LCD_I2C_PIN_D4 4 - #define LCD_I2C_PIN_D5 5 - #define LCD_I2C_PIN_D6 6 - #define LCD_I2C_PIN_D7 7 - - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_I2C_PIN_EN, LCD_I2C_PIN_RW, LCD_I2C_PIN_RS, LCD_I2C_PIN_D4, LCD_I2C_PIN_D5, LCD_I2C_PIN_D6, LCD_I2C_PIN_D7); - -#elif ENABLED(LCD_I2C_TYPE_MCP23017) - //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators()) - #define LED_A 0x04 //100 - #define LED_B 0x02 //010 - #define LED_C 0x01 //001 - - #define LCD_HAS_STATUS_INDICATORS - - #include - #include - #define LCD_CLASS LiquidTWI2 - #if ENABLED(DETECT_DEVICE) - LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); - #else - LCD_CLASS lcd(LCD_I2C_ADDRESS); - #endif - -#elif ENABLED(LCD_I2C_TYPE_MCP23008) - #include - #include - #define LCD_CLASS LiquidTWI2 - #if ENABLED(DETECT_DEVICE) - LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); - #else - LCD_CLASS lcd(LCD_I2C_ADDRESS); - #endif - -#elif ENABLED(LCD_I2C_TYPE_PCA8574) - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT); - -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection -#elif ENABLED(SR_LCD_2W_NL) - extern "C" void __cxa_pure_virtual() { while (1); } - #include - #include - #define LCD_CLASS LiquidCrystal_SR - #if PIN_EXISTS(SR_STROBE) - LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN, SR_STROBE_PIN); - #else - LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN); - #endif -#elif ENABLED(LCM1602) - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); -#else - // Standard directly connected LCD implementations - #include - #define LCD_CLASS LiquidCrystal - LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 -#endif - -#include "utf_mapper.h" - -#if ENABLED(LCD_PROGRESS_BAR) - static millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle - #if PROGRESS_MSG_EXPIRE > 0 - static millis_t expire_status_ms = 0; // millis at which to expire the status message - #endif - #define LCD_STR_PROGRESS "\x03\x04\x05" -#endif - -#if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void lcd_implementation_update_indicators(); -#endif - -static void createChar_P(const char c, const byte * const ptr) { - byte temp[8]; - for (uint8_t i = 0; i < 8; i++) - temp[i] = pgm_read_byte(&ptr[i]); - lcd.createChar(c, temp); -} - -#define CHARSET_MENU 0 -#define CHARSET_INFO 1 -#define CHARSET_BOOT 2 - -static void lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) - const uint8_t screen_charset=CHARSET_INFO - #endif -) { - // CHARSET_BOOT - #if ENABLED(SHOW_BOOTSCREEN) - const static PROGMEM byte corner[4][8] = { { - B00000, - B00000, - B00000, - B00000, - B00001, - B00010, - B00100, - B00100 - }, { - B00000, - B00000, - B00000, - B11100, - B11100, - B01100, - B00100, - B00100 - }, { - B00100, - B00010, - B00001, - B00000, - B00000, - B00000, - B00000, - B00000 - }, { - B00100, - B01000, - B10000, - B00000, - B00000, - B00000, - B00000, - B00000 - } }; - #endif // SHOW_BOOTSCREEN - - // CHARSET_INFO - const static PROGMEM byte bedTemp[8] = { - B00000, - B11111, - B10101, - B10001, - B10101, - B11111, - B00000, - B00000 - }; - - const static PROGMEM byte degree[8] = { - B01100, - B10010, - B10010, - B01100, - B00000, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte thermometer[8] = { - B00100, - B01010, - B01010, - B01010, - B01010, - B10001, - B10001, - B01110 - }; - - const static PROGMEM byte uplevel[8] = { - B00100, - B01110, - B11111, - B00100, - B11100, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte feedrate[8] = { - B11100, - B10000, - B11000, - B10111, - B00101, - B00110, - B00101, - B00000 - }; - - const static PROGMEM byte clock[8] = { - B00000, - B01110, - B10011, - B10101, - B10001, - B01110, - B00000, - B00000 - }; - - #if ENABLED(LCD_PROGRESS_BAR) - - // CHARSET_INFO - const static PROGMEM byte progress[3][8] = { { - B00000, - B10000, - B10000, - B10000, - B10000, - B10000, - B10000, - B00000 - }, { - B00000, - B10100, - B10100, - B10100, - B10100, - B10100, - B10100, - B00000 - }, { - B00000, - B10101, - B10101, - B10101, - B10101, - B10101, - B10101, - B00000 - } }; - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(SDSUPPORT) - - // CHARSET_MENU - const static PROGMEM byte refresh[8] = { - B00000, - B00110, - B11001, - B11000, - B00011, - B10011, - B01100, - B00000, - }; - const static PROGMEM byte folder[8] = { - B00000, - B11100, - B11111, - B10001, - B10001, - B11111, - B00000, - B00000 - }; - - #endif // SDSUPPORT - - #if ENABLED(SHOW_BOOTSCREEN) - // Set boot screen corner characters - if (screen_charset == CHARSET_BOOT) { - for (uint8_t i = 4; i--;) - createChar_P(i, corner[i]); - } - else - #endif - { // Info Screen uses 5 special characters - createChar_P(LCD_BEDTEMP_CHAR, bedTemp); - createChar_P(LCD_DEGREE_CHAR, degree); - createChar_P(LCD_STR_THERMOMETER[0], thermometer); - createChar_P(LCD_FEEDRATE_CHAR, feedrate); - createChar_P(LCD_CLOCK_CHAR, clock); - - #if ENABLED(LCD_PROGRESS_BAR) - if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen - for (int16_t i = 3; i--;) - createChar_P(LCD_STR_PROGRESS[i], progress[i]); - } - else - #endif - { - createChar_P(LCD_UPLEVEL_CHAR, uplevel); - #if ENABLED(SDSUPPORT) - // SD Card sub-menu special characters - createChar_P(LCD_STR_REFRESH[0], refresh); - createChar_P(LCD_STR_FOLDER[0], folder); - #endif - } - } -} - -static void lcd_implementation_init( - #if ENABLED(LCD_PROGRESS_BAR) - const uint8_t screen_charset=CHARSET_INFO - #endif -) { - - #if ENABLED(LCD_I2C_TYPE_PCF8575) - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #ifdef LCD_I2C_PIN_BL - lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE); - lcd.setBacklight(HIGH); - #endif - - #elif ENABLED(LCD_I2C_TYPE_MCP23017) - lcd.setMCPType(LTI_TYPE_MCP23017); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - lcd_implementation_update_indicators(); - - #elif ENABLED(LCD_I2C_TYPE_MCP23008) - lcd.setMCPType(LTI_TYPE_MCP23008); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - - #elif ENABLED(LCD_I2C_TYPE_PCA8574) - lcd.init(); - lcd.backlight(); - - #else - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #endif - - lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) - screen_charset - #endif - ); - - lcd.clear(); -} - -void lcd_implementation_clear() { lcd.clear(); } -void lcd_print(const char c) { charset_mapper(c); } -void lcd_print(const char *str) { while (*str) lcd.print(*str++); } -void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd.print(c), ++str; } - -void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = *str)) n -= charset_mapper(c), ++str; -} - -void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str; -} - -#if ENABLED(SHOW_BOOTSCREEN) - - void lcd_erase_line(const int16_t line) { - lcd.setCursor(0, line); - for (uint8_t i = LCD_WIDTH + 1; --i;) - lcd.write(' '); - } - - // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line - void lcd_scroll(const int16_t col, const int16_t line, const char* const text, const int16_t len, const int16_t time) { - uint8_t slen = utf8_strlen_P(text); - if (slen < len) { - // Fits into, - lcd.setCursor(col, line); - lcd_printPGM_utf(text, len); - while (slen < len) { - lcd.write(' '); - ++slen; - } - safe_delay(time); - } - else { - const char* p = text; - int dly = time / MAX(slen, 1); - for (uint8_t i = 0; i <= slen; i++) { - - // Go to the correct place - lcd.setCursor(col, line); - - // Print the text - lcd_printPGM_utf(p, len); - - // Fill with spaces - uint8_t ix = slen - i; - while (ix < len) { - lcd.write(' '); - ++ix; - } - - // Delay - safe_delay(dly); - - // Advance to the next UTF8 valid position - p++; - while (!START_OF_UTF8_CHAR(pgm_read_byte(p))) p++; - } - } - } - - static void logo_lines(const char* const extra) { - int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; - lcd.setCursor(indent, 0); lcd.print('\x00'); lcd_printPGM(PSTR( "------" )); lcd.write('\x01'); - lcd.setCursor(indent, 1); lcd_printPGM(PSTR("|Marlin|")); lcd_printPGM(extra); - lcd.setCursor(indent, 2); lcd.write('\x02'); lcd_printPGM(PSTR( "------" )); lcd.write('\x03'); - } - - void lcd_bootscreen() { - lcd_set_custom_characters(CHARSET_BOOT); - lcd.clear(); - - #define LCD_EXTRA_SPACE (LCD_WIDTH-8) - - #define CENTER_OR_SCROLL(STRING,DELAY) \ - lcd_erase_line(3); \ - if (strlen(STRING) <= LCD_WIDTH) { \ - lcd.setCursor((LCD_WIDTH - utf8_strlen_P(PSTR(STRING))) / 2, 3); \ - lcd_printPGM_utf(PSTR(STRING)); \ - safe_delay(DELAY); \ - } \ - else { \ - 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 >= 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); - #endif - } - #elif defined(STRING_SPLASH_LINE2) - // - // Show splash line 2 only, alongside the logo if possible - // - if (LCD_EXTRA_SPACE >= 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 - // - logo_lines(PSTR("")); - safe_delay(2000); - #endif - - lcd.clear(); - safe_delay(100); - lcd_set_custom_characters(); - lcd.clear(); - } - -#endif // SHOW_BOOTSCREEN - -void lcd_kill_screen() { - lcd.setCursor(0, 0); - lcd_print_utf(lcd_status_message); - #if LCD_HEIGHT < 4 - lcd.setCursor(0, 2); - #else - lcd.setCursor(0, 2); - lcd_printPGM_utf(PSTR(MSG_HALTED)); - lcd.setCursor(0, 3); - #endif - lcd_printPGM_utf(PSTR(MSG_PLEASE_RESET)); -} - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - lcd_print('X' + uint8_t(axis)); - if (blink) - lcd.print(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_print(c <= '.' ? c : '?'); - else { - #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_printPGM(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd.print(value); - } - } -} - -FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, const bool blink) { - #if HAS_HEATED_BED - const bool isBed = heater < 0; - const float t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), - t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); - #else - const float t1 = thermalManager.degHotend(heater), t2 = thermalManager.degTargetHotend(heater); - #endif - - if (prefix >= 0) lcd.print(prefix); - - lcd.print(itostr3(t1 + 0.5)); - lcd.write('/'); - - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #else - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : - #endif - thermalManager.is_heater_idle(heater) - ); - - if (!blink && is_idle) { - lcd.write(' '); - if (t2 >= 10) lcd.write(' '); - if (t2 >= 100) lcd.write(' '); - } - else - #endif - lcd.print(itostr3left(t2 + 0.5)); - - if (prefix >= 0) { - lcd.print((char)LCD_DEGREE_CHAR); - lcd.write(' '); - if (t2 < 10) lcd.write(' '); - } -} - -#if ENABLED(LCD_PROGRESS_BAR) - - inline void lcd_draw_progress_bar(const uint8_t percent) { - const int16_t tix = (int16_t)(percent * (LCD_WIDTH) * 3) / 100, - cel = tix / 3, - rem = tix % 3; - uint8_t i = LCD_WIDTH; - char msg[LCD_WIDTH + 1], b = ' '; - msg[LCD_WIDTH] = '\0'; - while (i--) { - if (i == cel - 1) - b = LCD_STR_PROGRESS[2]; - else if (i == cel && rem != 0) - b = LCD_STR_PROGRESS[rem - 1]; - msg[i] = b; - } - lcd.print(msg); - } - -#endif // LCD_PROGRESS_BAR - -/** -Possible status screens: -16x2 |000/000 B000/000| - |0123456789012345| - -16x4 |000/000 B000/000| - |SD100% Z 000.00| - |F100% T--:--| - |0123456789012345| - -20x2 |T000/000D B000/000D | - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |X 000 Y 000 Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |T000/000D Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| -*/ -static void lcd_implementation_status_screen() { - const bool blink = lcd_blink(); - - // - // Line 1 - // - - lcd.setCursor(0, 0); - - #if LCD_WIDTH < 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, -1, blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - - lcd.setCursor(8, 0); - #if HOTENDS > 1 - lcd.print((char)LCD_STR_THERMOMETER[0]); - _draw_heater_status(1, -1, blink); - #else - lcd.print((char)LCD_BEDTEMP_CHAR); - _draw_heater_status(-1, -1, blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #else // LCD_WIDTH >= 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - lcd.setCursor(10, 0); - #if HOTENDS > 1 - _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); - #else - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #endif // LCD_WIDTH >= 20 - - // - // Line 2 - // - - #if LCD_HEIGHT > 2 - - #if LCD_WIDTH < 20 - - #if ENABLED(SDSUPPORT) - lcd.setCursor(0, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) - lcd.print(itostr3(card.percentDone())); - else - lcd_printPGM(PSTR("---")); - lcd.write('%'); - #endif // SDSUPPORT - - #else // LCD_WIDTH >= 20 - - lcd.setCursor(0, 1); - - // If the first line has two extruder temps, - // show more temperatures on the next line - - #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) - - #if HOTENDS > 2 - _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); - lcd.setCursor(10, 1); - #endif - - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - - #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); - - lcd.write(' '); - - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); - - #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - #endif // LCD_WIDTH >= 20 - - lcd.setCursor(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); - - #if HAS_LEVELING && !HAS_HEATED_BED - lcd.write(planner.leveling_active || blink ? '_' : ' '); - #endif - - #endif // LCD_HEIGHT > 2 - - // - // Line 3 - // - - #if LCD_HEIGHT > 3 - - lcd.setCursor(0, 2); - lcd.print((char)LCD_FEEDRATE_CHAR); - lcd.print(itostr3(feedrate_percentage)); - lcd.write('%'); - - #if LCD_WIDTH >= 20 && ENABLED(SDSUPPORT) - - lcd.setCursor(7, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) - lcd.print(itostr3(card.percentDone())); - else - lcd_printPGM(PSTR("---")); - lcd.write('%'); - - #endif // LCD_WIDTH >= 20 && SDSUPPORT - - char buffer[10]; - duration_t elapsed = print_job_timer.duration(); - uint8_t len = elapsed.toDigital(buffer); - - lcd.setCursor(LCD_WIDTH - len - 1, 2); - lcd.print((char)LCD_CLOCK_CHAR); - lcd_print(buffer); - - #endif // LCD_HEIGHT > 3 - - // - // Last Line - // Status Message (which may be a Progress Bar or Filament display) - // - - lcd.setCursor(0, LCD_HEIGHT - 1); - - #if ENABLED(LCD_PROGRESS_BAR) - - // Draw the progress bar if the message has shown long enough - // or if there is no message set. - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) - return lcd_draw_progress_bar(progress_bar_percent); - - #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - - // Show Filament Diameter and Volumetric Multiplier % - // After allowing lcd_status_message to show for 5 seconds - if (ELAPSED(millis(), previous_lcd_status_ms + 5000UL)) { - lcd_printPGM(PSTR("Dia ")); - lcd.print(ftostr12ns(filament_width_meas)); - lcd_printPGM(PSTR(" V")); - lcd.print(itostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); - lcd.write('%'); - return; - } - - #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_print_utf(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_print_utf(stat, LCD_WIDTH); - } - else { - - // The remaining string does not completely fill the screen - lcd_print_utf(stat, LCD_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - lcd.write('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - lcd.write('.'); - if (--chars) - lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message - } - } - if (last_blink != blink) { - last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_print_utf(lcd_status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } - #endif -} - -#if ENABLED(ULTIPANEL) - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { - if (row < LCD_HEIGHT) { - lcd.setCursor(LCD_WIDTH - 9, row); - _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], lcd_blink()); - } - } - - #endif // ADVANCED_PAUSE_FEATURE - - static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL) { - UNUSED(invert); - char c; - int8_t n = LCD_WIDTH; - lcd.setCursor(0, row); - if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd.write(' '); n--; } - } - while (n > 0 && (c = pgm_read_byte(pstr))) { - n -= charset_mapper(c); - pstr++; - } - if (valstr) while (n > 0 && (c = *valstr)) { - n -= charset_mapper(c); - valstr++; - } - while (n-- > 0) lcd.write(' '); - } - - static void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char post_char) { - char c; - uint8_t n = LCD_WIDTH - 2; - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - while (n--) lcd.write(' '); - lcd.print(post_char); - } - - static void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { - char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen(data); - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - lcd.write(':'); - while (n--) lcd.write(' '); - lcd_print(data); - } - static void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { - char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen_P(data); - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - lcd.write(':'); - while (n--) lcd.write(' '); - lcd_printPGM(data); - } - - #define DRAWMENU_SETTING_EDIT_GENERIC(_src) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', _src) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - - void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) { - lcd.setCursor(1, 1); - lcd_printPGM_utf(pstr); - if (value != NULL) { - lcd.write(':'); - const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + utf8_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit - lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), valrow); // Right-justified, padded by spaces - lcd.write(' '); // overwrite char if value gets shorter - lcd_print(value); - } - } - - #if ENABLED(SDSUPPORT) - - static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, CardReader& theCard, const uint8_t concat, const char post_char) { - UNUSED(pstr); - lcd.setCursor(0, row); - lcd.print(sel ? '>' : ' '); - - uint8_t n = LCD_WIDTH - concat; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (sel) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - n); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[n] = '\0'; // cutoff at screen edge - #endif - } - - char c; - while (n && (c = *outstr)) { - n -= charset_mapper(c); - ++outstr; - } - while (n) { --n; lcd.write(' '); } - - lcd.print(post_char); - } - - static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, ' '); - } - - static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); - } - - #endif // SDSUPPORT - - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR) - #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) - #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - - extern millis_t next_button_update_ms; - - static uint8_t lcd_implementation_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 - uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; - #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 - return slow_bits; - #endif // LCD_I2C_TYPE_MCP23017 - } - - #endif // LCD_HAS_SLOW_BUTTONS - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - - static void lcd_implementation_update_indicators() { - // Set the LEDS - referred to as backlights by the LiquidTWI2 library - static uint8_t ledsprev = 0; - uint8_t leds = 0; - - if (thermalManager.degTargetBed() > 0) leds |= LED_A; - - if (thermalManager.degTargetHotend(0) > 0) leds |= LED_B; - - #if FAN_COUNT > 0 - if (0 - #if HAS_FAN0 - || fanSpeeds[0] - #endif - #if HAS_FAN1 - || fanSpeeds[1] - #endif - #if HAS_FAN2 - || fanSpeeds[2] - #endif - ) leds |= LED_C; - #endif // FAN_COUNT > 0 - - #if HOTENDS > 1 - if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C; - #endif - - if (leds != ledsprev) { - lcd.setBacklight(leds); - ledsprev = leds; - } - } - - #endif // LCD_HAS_STATUS_INDICATORS - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - Possible map screens: - - 16x2 |X000.00 Y000.00| - |(00,00) Z00.000| - - 20x2 | X:000.00 Y:000.00 | - | (00,00) Z:00.000 | - - 16x4 |+-------+(00,00)| - || |X000.00| - || |Y000.00| - |+-------+Z00.000| - - 20x4 | +-------+ (00,00) | - | | | X:000.00| - | | | Y:000.00| - | +-------+ Z:00.000| - */ - - typedef struct { - uint8_t custom_char_bits[ULTRA_Y_PIXELS_PER_CHAR]; - } custom_char; - - typedef struct { - uint8_t column, row; - uint8_t y_pixel_offset, x_pixel_offset; - uint8_t x_pixel_mask; - } coordinate; - - void add_edges_to_custom_char(custom_char * const custom, coordinate * const ul, coordinate * const lr, coordinate * const brc, const uint8_t cell_location); - FORCE_INLINE static void clear_custom_char(custom_char * const cc) { ZERO(cc->custom_char_bits); } - - /* - // This debug routine should be deleted by anybody that sees it. It doesn't belong here - // But I'm leaving it for now until we know the 20x4 Radar Map is working right. - // We may need it again if any funny lines show up on the mesh points. - void dump_custom_char(char *title, custom_char *c) { - SERIAL_PROTOCOLLN(title); - for (uint8_t j = 0; j < 8; j++) { - for (uint8_t i = 7; i >= 0; i--) - SERIAL_PROTOCOLCHAR(TEST(c->custom_char_bits[j], i) ? '1' : '0'); - SERIAL_EOL(); - } - SERIAL_EOL(); - } - //*/ - - coordinate pixel_location(int16_t x, int16_t y) { - coordinate ret_val; - int16_t xp, yp, r, c; - - x++; y++; // +1 because lines on the left and top - - c = x / (ULTRA_X_PIXELS_PER_CHAR); - r = y / (ULTRA_Y_PIXELS_PER_CHAR); - - ret_val.column = c; - ret_val.row = r; - - xp = x - c * (ULTRA_X_PIXELS_PER_CHAR); // get the pixel offsets into the character cell - xp = ULTRA_X_PIXELS_PER_CHAR - 1 - xp; // column within relevant character cell (0 on the right) - yp = y - r * (ULTRA_Y_PIXELS_PER_CHAR); - - ret_val.x_pixel_mask = _BV(xp); - ret_val.x_pixel_offset = xp; - ret_val.y_pixel_offset = yp; - return ret_val; - } - - inline coordinate pixel_location(const uint8_t x, const uint8_t y) { return pixel_location((int16_t)x, (int16_t)y); } - - void lcd_implementation_ubl_plot(const uint8_t x, const uint8_t inverted_y) { - - #if LCD_WIDTH >= 20 - #define _LCD_W_POS 12 - #define _PLOT_X 1 - #define _MAP_X 3 - #define _LABEL(C,X,Y) lcd.setCursor(X, Y); lcd.print(C) - #define _XLABEL(X,Y) _LABEL("X:",X,Y) - #define _YLABEL(X,Y) _LABEL("Y:",X,Y) - #define _ZLABEL(X,Y) _LABEL("Z:",X,Y) - #else - #define _LCD_W_POS 8 - #define _PLOT_X 0 - #define _MAP_X 1 - #define _LABEL(X,Y,C) lcd.setCursor(X, Y); lcd.write(C) - #define _XLABEL(X,Y) _LABEL('X',X,Y) - #define _YLABEL(X,Y) _LABEL('Y',X,Y) - #define _ZLABEL(X,Y) _LABEL('Z',X,Y) - #endif - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Show X and Y positions - */ - _XLABEL(_PLOT_X, 0); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); - - _YLABEL(_LCD_W_POS, 0); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); - - lcd.setCursor(_PLOT_X, 0); - - #else // 16x4 or 20x4 display - - coordinate upper_left, lower_right, bottom_right_corner; - custom_char new_char; - uint8_t i, j, k, l, m, n, n_rows, n_cols, y, - bottom_line, right_edge, - x_map_pixels, y_map_pixels, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt, - suppress_x_offset = 0, suppress_y_offset = 0; - - y = GRID_MAX_POINTS_Y - inverted_y - 1; - - upper_left.column = 0; - upper_left.row = 0; - lower_right.column = 0; - lower_right.row = 0; - - lcd_implementation_clear(); - - x_map_pixels = (ULTRA_X_PIXELS_PER_CHAR) * (ULTRA_COLUMNS_FOR_MESH_MAP) - 2; // minus 2 because we are drawing a box around the map - y_map_pixels = (ULTRA_Y_PIXELS_PER_CHAR) * (ULTRA_ROWS_FOR_MESH_MAP) - 2; - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X); - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y); - - if (pixels_per_x_mesh_pnt >= ULTRA_X_PIXELS_PER_CHAR) { // There are only 2 custom characters available, so the X - pixels_per_x_mesh_pnt = ULTRA_X_PIXELS_PER_CHAR; // size of the mesh point needs to fit within them independent - suppress_x_offset = 1; // of where the starting pixel is located. - } - - if (pixels_per_y_mesh_pnt >= ULTRA_Y_PIXELS_PER_CHAR) { // There are only 2 custom characters available, so the Y - pixels_per_y_mesh_pnt = ULTRA_Y_PIXELS_PER_CHAR; // size of the mesh point needs to fit within them independent - suppress_y_offset = 1; // of where the starting pixel is located. - } - - x_map_pixels = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X); // now we have the right number of pixels to make both - y_map_pixels = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y); // directions fit nicely - - right_edge = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X) + 1; // find location of right edge within the character cell - bottom_line= pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 1; // find location of bottome line within the character cell - - n_rows = bottom_line / (ULTRA_Y_PIXELS_PER_CHAR) + 1; - n_cols = right_edge / (ULTRA_X_PIXELS_PER_CHAR) + 1; - - for (i = 0; i < n_cols; i++) { - lcd.setCursor(i, 0); - lcd.print((char)0x00); // top line of the box - - lcd.setCursor(i, n_rows - 1); - lcd.write(0x01); // bottom line of the box - } - - for (j = 0; j < n_rows; j++) { - lcd.setCursor(0, j); - lcd.write(0x02); // Left edge of the box - lcd.setCursor(n_cols - 1, j); - lcd.write(0x03); // right edge of the box - } - - /** - * If the entire 4th row is not in use, do not put vertical bars all the way down to the bottom of the display - */ - - k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2; - l = (ULTRA_Y_PIXELS_PER_CHAR) * n_rows; - if (l > k && l - k >= (ULTRA_Y_PIXELS_PER_CHAR) / 2) { - lcd.setCursor(0, n_rows - 1); // left edge of the box - lcd.write(' '); - lcd.setCursor(n_cols - 1, n_rows - 1); // right edge of the box - lcd.write(' '); - } - - clear_custom_char(&new_char); - new_char.custom_char_bits[0] = 0b11111U; // char #0 is used for the top line of the box - lcd.createChar(0, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - k = (GRID_MAX_POINTS_Y) * pixels_per_y_mesh_pnt + 1; // row of pixels for the bottom box line - l = k % (ULTRA_Y_PIXELS_PER_CHAR); // row within relevant character cell - new_char.custom_char_bits[l] = 0b11111U; // char #1 is used for the bottom line of the box - lcd.createChar(1, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - for (j = 0; j < ULTRA_Y_PIXELS_PER_CHAR; j++) - new_char.custom_char_bits[j] = 0b10000U; // char #2 is used for the left edge of the box - lcd.createChar(2, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - m = (GRID_MAX_POINTS_X) * pixels_per_x_mesh_pnt + 1; // Column of pixels for the right box line - n = m % (ULTRA_X_PIXELS_PER_CHAR); // Column within relevant character cell - i = ULTRA_X_PIXELS_PER_CHAR - 1 - n; // Column within relevant character cell (0 on the right) - for (j = 0; j < ULTRA_Y_PIXELS_PER_CHAR; j++) - new_char.custom_char_bits[j] = (uint8_t)_BV(i); // Char #3 is used for the right edge of the box - lcd.createChar(3, (uint8_t*)&new_char); - - i = x * pixels_per_x_mesh_pnt - suppress_x_offset; - j = y * pixels_per_y_mesh_pnt - suppress_y_offset; - upper_left = pixel_location(i, j); - - k = (x + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset; - l = (y + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset; - lower_right = pixel_location(k, l); - - bottom_right_corner = pixel_location(x_map_pixels, y_map_pixels); - - /** - * First, handle the simple case where everything is within a single character cell. - * If part of the Mesh Plot is outside of this character cell, we will follow up - * and deal with that next. - */ - - //dump_custom_char("at entry:", &new_char); - - clear_custom_char(&new_char); - const uint8_t ypix = MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, ULTRA_Y_PIXELS_PER_CHAR); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = upper_left.x_pixel_mask; - for (k = 0; k < pixels_per_x_mesh_pnt; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - //dump_custom_char("after loops:", &new_char); - - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, TOP_LEFT); - //dump_custom_char("after add edges", &new_char); - lcd.createChar(4, (uint8_t*)&new_char); - - lcd.setCursor(upper_left.column, upper_left.row); - lcd.write(0x04); - //dump_custom_char("after lcd update:", &new_char); - - /** - * Next, check for two side by side character cells being used to display the Mesh Point - * If found... do the right hand character cell next. - */ - if (upper_left.column == lower_right.column - 1) { - l = upper_left.x_pixel_offset; - clear_custom_char(&new_char); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = _BV(ULTRA_X_PIXELS_PER_CHAR - 1); // Fill in the left side of the right character cell - for (k = 0; k < pixels_per_x_mesh_pnt - 1 - l; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, TOP_RIGHT); - - lcd.createChar(5, (uint8_t *) &new_char); - - lcd.setCursor(lower_right.column, upper_left.row); - lcd.write(0x05); - } - - /** - * Next, check for two character cells stacked on top of each other being used to display the Mesh Point - */ - if (upper_left.row == lower_right.row - 1) { - l = ULTRA_Y_PIXELS_PER_CHAR - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - i = upper_left.x_pixel_mask; - for (m = 0; m < pixels_per_x_mesh_pnt; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - if (!(i >>= 1)) break; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, LOWER_LEFT); - lcd.createChar(6, (uint8_t *) &new_char); - - lcd.setCursor(upper_left.column, lower_right.row); - lcd.write(0x06); - } - - /** - * Next, check for four character cells being used to display the Mesh Point. If that is - * what is here, we work to fill in the character cell that is down one and to the right one - * from the upper_left character cell. - */ - - if (upper_left.column == lower_right.column - 1 && upper_left.row == lower_right.row - 1) { - l = ULTRA_Y_PIXELS_PER_CHAR - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - l = upper_left.x_pixel_offset; - i = _BV(ULTRA_X_PIXELS_PER_CHAR - 1); // Fill in the left side of the right character cell - for (m = 0; m < pixels_per_x_mesh_pnt - 1 - l; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, LOWER_RIGHT); - lcd.createChar(7, (uint8_t*)&new_char); - - lcd.setCursor(lower_right.column, lower_right.row); - lcd.write(0x07); - } - - #endif - - /** - * Print plot position - */ - lcd.setCursor(_LCD_W_POS, 0); - lcd.write('('); - lcd.print(x); - lcd.write(','); - lcd.print(inverted_y); - lcd.write(')'); - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Print Z values - */ - _ZLABEL(_LCD_W_POS, 1); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd.print(ftostr43sign(ubl.z_values[x][inverted_y])); - else - lcd_printPGM(PSTR(" -----")); - - #else // 16x4 or 20x4 display - - /** - * Show all values at right of screen - */ - _XLABEL(_LCD_W_POS, 1); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); - _YLABEL(_LCD_W_POS, 2); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); - - /** - * Show the location value - */ - _ZLABEL(_LCD_W_POS, 3); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd.print(ftostr43sign(ubl.z_values[x][inverted_y])); - else - lcd_printPGM(PSTR(" -----")); - - #endif // LCD_HEIGHT > 3 - } - - void add_edges_to_custom_char(custom_char * const custom, coordinate * const ul, coordinate * const lr, coordinate * const brc, uint8_t cell_location) { - uint8_t i, k; - int16_t n_rows = lr->row - ul->row + 1, - n_cols = lr->column - ul->column + 1; - - /** - * Check if Top line of box needs to be filled in - */ - if (ul->row == 0 && ((cell_location & TOP_LEFT) || (cell_location & TOP_RIGHT))) { // Only fill in the top line for the top character cells - - if (n_cols == 1) { - if (ul->column != brc->column) - custom->custom_char_bits[0] = 0xFF; // Single column in middle - else - for (i = brc->x_pixel_offset; i < ULTRA_X_PIXELS_PER_CHAR; i++) // Single column on right side - SBI(custom->custom_char_bits[0], i); - } - else if ((cell_location & TOP_LEFT) || lr->column != brc->column) // Multiple column in the middle or with right cell in middle - custom->custom_char_bits[0] = 0xFF; - else - for (i = brc->x_pixel_offset; i < ULTRA_X_PIXELS_PER_CHAR; i++) - SBI(custom->custom_char_bits[0], i); - } - - /** - * Check if left line of box needs to be filled in - */ - if ((cell_location & TOP_LEFT) || (cell_location & LOWER_LEFT)) { - if (ul->column == 0) { // Left column of characters on LCD Display - k = ul->row == brc->row ? brc->y_pixel_offset : ULTRA_Y_PIXELS_PER_CHAR; // If it isn't the last row... do the full character cell - for (i = 0; i < k; i++) - SBI(custom->custom_char_bits[i], ULTRA_X_PIXELS_PER_CHAR - 1); - } - } - - /** - * Check if bottom line of box needs to be filled in - */ - - // Single row of mesh plot cells - if (n_rows == 1 /* && (cell_location == TOP_LEFT || cell_location == TOP_RIGHT) */ && ul->row == brc->row) { - if (n_cols == 1) // Single row, single column case - k = ul->column == brc->column ? brc->x_pixel_mask : 0x01; - else if (cell_location & TOP_RIGHT) // Single row, multiple column case - k = lr->column == brc->column ? brc->x_pixel_mask : 0x01; - else // Single row, left of multiple columns - k = 0x01; - while (k < _BV(ULTRA_X_PIXELS_PER_CHAR)) { - custom->custom_char_bits[brc->y_pixel_offset] |= k; - k <<= 1; - } - } - - // Double row of characters on LCD Display - // And this is a bottom custom character - if (n_rows == 2 && (cell_location == LOWER_LEFT || cell_location == LOWER_RIGHT) && lr->row == brc->row) { - if (n_cols == 1) // Double row, single column case - k = ul->column == brc->column ? brc->x_pixel_mask : 0x01; - else if (cell_location & LOWER_RIGHT) // Double row, multiple column case - k = lr->column == brc->column ? brc->x_pixel_mask : 0x01; - else // Double row, left of multiple columns - k = 0x01; - while (k < _BV(ULTRA_X_PIXELS_PER_CHAR)) { - custom->custom_char_bits[brc->y_pixel_offset] |= k; - k <<= 1; - } - } - - /** - * Check if right line of box needs to be filled in - */ - // Nothing to do if the lower right part of the mesh pnt isn't in the same column as the box line - if (lr->column == brc->column) { - // This mesh point is in the same character cell as the right box line - if (ul->column == brc->column || (cell_location & TOP_RIGHT) || (cell_location & LOWER_RIGHT)) { - // If not the last row... do the full character cell - k = ul->row == brc->row ? brc->y_pixel_offset : ULTRA_Y_PIXELS_PER_CHAR; - for (i = 0; i < k; i++) custom->custom_char_bits[i] |= brc->x_pixel_mask; - } - } - } - - #endif // AUTO_BED_LEVELING_UBL - -#endif // ULTIPANEL - -#endif // ULTRALCD_IMPL_HD44780_H diff --git a/Marlin/ultralcd_st7565_u8glib_VIKI.h b/Marlin/ultralcd_st7565_u8glib_VIKI.h deleted file mode 100644 index adb48ea6b2..0000000000 --- a/Marlin/ultralcd_st7565_u8glib_VIKI.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef ULCDST7565_H -#define ULCDST7565_H - -#include -#include "delay.h" - -#define ST7565_CLK_PIN DOGLCD_SCK -#define ST7565_DAT_PIN DOGLCD_MOSI -#define ST7565_CS_PIN DOGLCD_CS -#define ST7565_A0_PIN DOGLCD_A0 - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 -#define PAGE_HEIGHT 8 - -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - -// If you want you can define your own set of delays in Configuration.h -//#define ST7565_DELAY_1 DELAY_NS(0) -//#define ST7565_DELAY_2 DELAY_NS(0) -//#define ST7565_DELAY_3 DELAY_NS(0) - -/* -#define ST7565_DELAY_1 u8g_10MicroDelay() -#define ST7565_DELAY_2 u8g_10MicroDelay() -#define ST7565_DELAY_3 u8g_10MicroDelay() -*/ - -#if F_CPU >= 20000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(188) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(250) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif F_CPU == 16000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7565_u8glib_VIKI.h'" -#endif - -#ifndef ST7565_DELAY_1 - #define ST7565_DELAY_1 CPU_ST7565_DELAY_1 -#endif -#ifndef ST7565_DELAY_2 - #define ST7565_DELAY_2 CPU_ST7565_DELAY_2 -#endif -#ifndef ST7565_DELAY_3 - #define ST7565_DELAY_3 CPU_ST7565_DELAY_3 -#endif - -// On Viki2 the LCD and the SD card share a single SPI -#define HARDWARE_SPI ((DOGLCD_SCK == SCK_PIN) && (DOGLCD_MOSI == MOSI_PIN)) - -#if HARDWARE_SPI // using the hardware SPI - - #define ST7565_WRITE_BYTE(a) { SPDR = a; while (!TEST(SPSR, SPIF)); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {SPDR = *ptr++; while (!TEST(SPSR, SPIF));} U8G_DELAY(); } - -#else // !HARDWARE_SPI - - #define ST7565_SND_BIT \ - WRITE(ST7565_CLK_PIN, LOW); ST7565_DELAY_1; \ - WRITE(ST7565_DAT_PIN, val & 0x80); ST7565_DELAY_2; \ - WRITE(ST7565_CLK_PIN, HIGH); ST7565_DELAY_3; \ - WRITE(ST7565_CLK_PIN, LOW);\ - val <<= 1 - - static void ST7565_SWSPI_SND_8BIT(uint8_t val) { - ST7565_SND_BIT; // 1 - ST7565_SND_BIT; // 2 - ST7565_SND_BIT; // 3 - ST7565_SND_BIT; // 4 - ST7565_SND_BIT; // 5 - ST7565_SND_BIT; // 6 - ST7565_SND_BIT; // 7 - ST7565_SND_BIT; // 8 - } - - #define ST7565_WRITE_BYTE(a) { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) { ST7565_SWSPI_SND_8BIT(*ptr++); } U8G_DELAY(); } - -#endif // !HARDWARE_SPI - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() u8g_10MicroDelay() -#endif - -#define ST7565_CS() do{ WRITE(ST7565_CS_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NCS() WRITE(ST7565_CS_PIN, LOW) -#define ST7565_A0() do{ WRITE(ST7565_A0_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NA0() WRITE(ST7565_A0_PIN, LOW) - -#define ST7565_ADC_REVERSE(N) ST7565_WRITE_BYTE(0xA0 | ((N) & 0x1)) -#define ST7565_BIAS_MODE(N) ST7565_WRITE_BYTE(0xA2 | ((N) & 0x1)) -#define ST7565_ALL_PIX(N) ST7565_WRITE_BYTE(0xA4 | ((N) & 0x1)) -#define ST7565_INVERTED(N) ST7565_WRITE_BYTE(0xA6 | ((N) & 0x1)) -#define ST7565_ON(N) ST7565_WRITE_BYTE(0xAE | ((N) & 0x1)) -#define ST7565_OUT_MODE(N) ST7565_WRITE_BYTE(0xC0 | ((N) & 0x1) << 3) -#define ST7565_POWER_CONTROL(N) ST7565_WRITE_BYTE(0x28 | (N)) -#define ST7565_V0_RATIO(N) ST7565_WRITE_BYTE(0x10 | ((N) & 0x7)) // Specific to Displaytech 64128N? (ST7565 is 0x20 | N) -#define ST7565_CONTRAST(N) do{ ST7565_WRITE_BYTE(0x81); ST7565_WRITE_BYTE(N); }while(0) - -#define ST7565_COLUMN_ADR(N) do{ ST7565_WRITE_BYTE(0x10 | (((N) >> 4) & 0xF)); ST7565_WRITE_BYTE((N) & 0xF); }while(0) -#define ST7565_PAGE_ADR(N) ST7565_WRITE_BYTE(0xB0 | (N)) -#define ST7565_START_LINE(N) ST7565_WRITE_BYTE(0x40 | (N)) -#define ST7565_SLEEP_MODE() ST7565_WRITE_BYTE(0xAC) -#define ST7565_NOOP() ST7565_WRITE_BYTE(0xE3) - -uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - - case U8G_DEV_MSG_INIT: { - - OUT_WRITE(ST7565_CS_PIN, LOW); - OUT_WRITE(ST7565_DAT_PIN, LOW); - OUT_WRITE(ST7565_CLK_PIN, LOW); - - #if HARDWARE_SPI - OUT_WRITE(SDSS, 1); // must be set to an output first or else will never go into master mode - SPCR = 0x50; // enable SPI in master mode at fast speed - SPSR = 1; // kick it up to 2x speed mode - #endif - - OUT_WRITE(ST7565_A0_PIN, LOW); - - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - - ST7565_BIAS_MODE(0); // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet) - ST7565_ADC_REVERSE(0); // Normal (not flipped) ADC Select (according to Displaytech 64128N datasheet) - - ST7565_OUT_MODE(1); // common output mode: set scan direction normal operation/SHL Select; 0x0C0 --> SHL = 0; normal; 0x0C8 --> SHL = 1 - ST7565_START_LINE(0); // Display start line for Displaytech 64128N - - ST7565_POWER_CONTROL(0x4); // power control: turn on Booster - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_POWER_CONTROL(0x6); // power control: turn on Booster, Voltage Regulator - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_POWER_CONTROL(0x7); // power control: turn on Booster, Voltage Regulator, Voltage Follower - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_V0_RATIO(0); // Set V0 Voltage Resistor ratio. Setting for controlling brightness of Displaytech 64128N - - ST7565_INVERTED(0); // display normal, bit val 0: LCD pixel off. - - ST7565_CONTRAST(0x1E); // Contrast value. Setting for controlling contrast of Displaytech 64128N - - ST7565_ON(1); // display on - - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(1); // display all points; ST7565 - U8G_ESC_DLY(100); // delay 100 ms - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(0); // normal display - ST7565_CS(); // chip select off - } // end of sequence - break; - - case U8G_DEV_MSG_STOP: break; - - case U8G_DEV_MSG_PAGE_NEXT: { - u8g_pb_t *pb = (u8g_pb_t*)(dev->dev_mem); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0 - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page + 1); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf) + pb->width); - ST7565_CS(); // chip select off - } - break; - - case U8G_DEV_MSG_CONTRAST: - ST7565_NCS(); - ST7565_NA0(); // instruction mode - ST7565_CONTRAST((*(uint8_t*)arg) >> 2); - ST7565_CS(); // chip select off - return 1; - - case U8G_DEV_MSG_SLEEP_ON: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_SLEEP_MODE(); // static indicator off - //ST7565_WRITE_BYTE(0x00); // indicator register set (not sure if this is required) - ST7565_ON(0); // display off - ST7565_ALL_PIX(1); // all points on - ST7565_CS(); // chip select off - return 1; - - case U8G_DEV_MSG_SLEEP_OFF: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_ALL_PIX(0); // all points off - ST7565_ON(1); // display on - U8G_ESC_DLY(50); // delay 50 ms - ST7565_CS(); // chip select off - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[LCD_PIXEL_WIDTH * 2] U8G_NOCOMMON; -u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = {{16, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf}; -u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = {u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn}; - -class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB { - public: - U8GLIB_ST7565_64128n_2x_VIKI(uint8_t dummy) - : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi) - { } - U8GLIB_ST7565_64128n_2x_VIKI(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi) - { } -}; - -#pragma GCC reset_options - -#endif // ULCDST7565_H diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h deleted file mode 100644 index db6224e478..0000000000 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULCDST7920_H -#define ULCDST7920_H - -#include -#include "delay.h" - -#define ST7920_CLK_PIN LCD_PINS_D4 -#define ST7920_DAT_PIN LCD_PINS_ENABLE -#define ST7920_CS_PIN LCD_PINS_RS - -//#define PAGE_HEIGHT 8 //128 byte framebuffer -#define PAGE_HEIGHT 16 //256 byte framebuffer -//#define PAGE_HEIGHT 32 //512 byte framebuffer - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 - -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - -// If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) - -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'" -#endif - -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 -#endif - -#define ST7920_SND_BIT \ - WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ - WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \ - WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ - val <<= 1 - -static void ST7920_SWSPI_SND_8BIT(uint8_t val) { - ST7920_SND_BIT; // 1 - ST7920_SND_BIT; // 2 - ST7920_SND_BIT; // 3 - ST7920_SND_BIT; // 4 - ST7920_SND_BIT; // 5 - ST7920_SND_BIT; // 6 - ST7920_SND_BIT; // 7 - ST7920_SND_BIT; // 8 -} - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() u8g_10MicroDelay() -#endif - -#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } -#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } -#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } -#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(); } - -uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - uint8_t i, y; - switch (msg) { - case U8G_DEV_MSG_INIT: { - OUT_WRITE(ST7920_CS_PIN, LOW); - OUT_WRITE(ST7920_DAT_PIN, LOW); - OUT_WRITE(ST7920_CLK_PIN, HIGH); - - ST7920_CS(); - u8g_Delay(120); //initial delay for boot up - ST7920_SET_CMD(); - ST7920_WRITE_BYTE(0x20); //non-extended mode - ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off - ST7920_WRITE_BYTE(0x01); //clear DDRAM ram - u8g_Delay(15); //delay for DDRAM clear - ST7920_WRITE_BYTE(0x24); //extended mode - ST7920_WRITE_BYTE(0x26); //extended mode + GDRAM active - for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM - ST7920_WRITE_BYTE(0x80 | y); //set y - ST7920_WRITE_BYTE(0x80); //set x = 0 - ST7920_SET_DAT(); - for (i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) //2x width clears both segments - ST7920_WRITE_BYTE(0); - ST7920_SET_CMD(); - } - ST7920_WRITE_BYTE(0x0C); //display on, cursor+blink off - ST7920_NCS(); - } - break; - - case U8G_DEV_MSG_STOP: break; - - case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t* ptr; - u8g_pb_t* pb = (u8g_pb_t*)(dev->dev_mem); - y = pb->p.page_y0; - ptr = (uint8_t*)pb->buf; - - ST7920_CS(); - for (i = 0; i < PAGE_HEIGHT; i ++) { - ST7920_SET_CMD(); - if (y < 32) { - ST7920_WRITE_BYTE(0x80 | y); //y - ST7920_WRITE_BYTE(0x80); //x=0 - } - else { - ST7920_WRITE_BYTE(0x80 | (y - 32)); //y - ST7920_WRITE_BYTE(0x80 | 8); //x=64 - } - ST7920_SET_DAT(); - ST7920_WRITE_BYTES(ptr, (LCD_PIXEL_WIDTH) / 8); //ptr is incremented inside of macro - y++; - } - ST7920_NCS(); - } - break; - } - #if PAGE_HEIGHT == 8 - return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg); - #elif PAGE_HEIGHT == 16 - return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg); - #else - return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg); - #endif -} - -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}; - -class U8GLIB_ST7920_128X64_RRD : public U8GLIB { - public: - U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } -}; - -#if ENABLED(LIGHTWEIGHT_UI) - // We have to include the code for the lightweight UI here - // as it relies on macros that are only defined in this file. - #include "status_screen_lite_ST7920_spi.h" -#endif - -#pragma GCC reset_options - -#endif // ULCDST7920_H diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h deleted file mode 100644 index aacf2f11d5..0000000000 --- a/Marlin/utf_mapper.h +++ /dev/null @@ -1,671 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef UTF_MAPPER_H -#define UTF_MAPPER_H - -#include "language.h" - -#if ENABLED(DOGLCD) - #define HARDWARE_CHAR_OUT(C) u8g.print((char)(C)) -#else - #define HARDWARE_CHAR_OUT(C) lcd.write((char)(C)) -#endif - -#if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD) - #if ENABLED(DISPLAY_CHARSET_ISO10646_1) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_5) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_TR) - #define MAPPER_ONE_TO_ONE - #endif -#else // SIMULATE_ROMFONT || !DOGLCD - #if DISPLAY_CHARSET_HD44780 == JAPANESE - #if ENABLED(MAPPER_C2C3) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols - 0x20,0x3F,0xEC,0xED,0x3F,0x5C,0x7C,0x3F,0x22,0x63,0x61,0x7F,0x3F,0x3F,0x52,0xB0, // c2a - //' ' ¢ £ ­ l " c a « R - 0xDF,0x3F,0x32,0x33,0x27,0xE4,0xF1,0xA5,0x2C,0x31,0xDF,0x7E,0x3F,0x3F,0x3F,0x3F, // c2b but relatively bad for letters. - // ° 2 3 ` N p . , 1 ° » - 0x3F,0x3F,0x3F,0x3F,0xE1,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, // c38 - // ä - 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0xEF,0x78,0x3F,0x3F,0x3F,0x3F,0xF5,0x3F,0x3F,0xE2, // c39 missing characters display as '?' - // ö x ü ß - 0x3F,0x3F,0x3F,0x3F,0xE1,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, // c3a - // ä - 0x3F,0xEE,0x3F,0x3F,0x3F,0x3F,0xEF,0xFD,0x3F,0x3F,0x3F,0x3F,0xF5,0x3F,0x3F,0x3F // c3b - // n ö ÷ ü - }; - #elif ENABLED(MAPPER_E382E383) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 0x3D,0xB1,0xB1,0xA8,0xB2,0xA9,0xB3,0xAA,0xB4,0xAB,0xB5,0xB6,0xB6,0xB7,0xB7,0xB8, // e382a Please test and correct - // = ア ア ィ イ ゥ ウ ェ エ ォ オ ガ ガ キ キ ク - 0xB8,0xB9,0xB9,0xBA,0xBA,0xBB,0xBB,0xBC,0xBC,0xBD,0xBD,0xBE,0xBE,0xBF,0xBF,0xC0, // e382b - // ク ケ ケ コ コ サ サ シ シ ス ス セ セ ソ ソ タ - 0xC0,0xC1,0xC1,0xC2,0xC2,0xC2,0xC3,0xC3,0xC4,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA, // e3838 - // タ チ チ ッ ッ ッ テ テ ト ト ナ ニ ヌ ネ ノ ハ - 0xCA,0xCA,0xCB,0xCB,0xCB,0xCC,0xCC,0xCC,0xCD,0xCD,0xCD,0xCE,0xCE,0xCE,0xCF,0xD0, // e3839 - // ハ ハ ヒ ヒ ヒ フ フ フ ヘ ヘ ヘ ホ ホ ホ マ ミ - 0xD1,0xD2,0xD3,0xD4,0xD4,0xD5,0xD5,0xAE,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDC, // e383a - // ム メ モ ャ ャ ユ ユ ョ ヨ ラ リ ル レ ロ ワ ワ - 0xEC,0xA7,0xA6,0xDD,0xCC,0x3F,0x3F,0x3F,0x3F,0x3F,0xA6,0xA5,0xB0,0xA4,0xA4,0x3F // e383b - // ヰ ヱ ヲ ン フ ? ? ? ? ? ヲ ・ ー ヽ ヽ ? - }; - #elif ENABLED(MAPPER_D0D1) - #error "Cyrillic on a JAPANESE display makes no sense. There are no matching symbols." - #endif - - #elif DISPLAY_CHARSET_HD44780 == WESTERN - #if ENABLED(MAPPER_C2C3) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete. - 0x20,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0x22,0xA9,0xAA,0xAB,0x3F,0x3F,0xAE,0x3F, // c2a ¡¢£¤¥¦§¨©ª«¬­®¯ - //' ' ¡ ¢ £ ¤ ¥ ¦ § " © ª « ? ? ® ? - 0xB0,0xB1,0xB2,0xB3,0x27,0xB5,0xB6,0xB7,0x2C,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, // c2b °±²³´µ¶·¸¹º»¼½¾¿ - // ° ± ³ ² ? µ ¶ · , ¹ º » ¼ ½ ¾ ¿ - 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, // c38 ÀÁÃÄÅÆÇÈÉÊËÌÍÎÏ - // À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï - 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, // c39 ÐÑÓÔÕÖ×ØÙÚÛÜÝÞß - // Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß - 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, // c3a àáãäåæçèéêëìíîï - // à á â ã ä å æ ç è é ê ë ì í î ï - 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF // c3b ðñóôõö÷øùúûüýþÿ - // ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ - }; - #elif ENABLED(MAPPER_D0D1) - #define MAPPER_D0D1_MOD - const PROGMEM uint8_t utf_recode[] = - {//0 1 2 3 4 5 6 7 8 9 a b c d e f - 0x41,0x80,0x42,0x92,0x81,0x45,0x82,0x83,0x84,0x85,0x4B,0x86,0x4D,0x48,0x4F,0x87, // d0a - // A Б B Г Д E Ж З И Й K Л M H O П - 0x50,0x43,0x54,0x88,0xD8,0x58,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x62,0x8F,0xAC,0xAD, // d0b - // P C T У Ф X Ч ч Ш Щ Ъ Ы b Э Ю Я - 0x61,0x36,0x42,0x92,0x81,0x65,0x82,0xB3,0x84,0x85,0x6B,0x86,0x4D,0x48,0x6F,0x87, // d18 - // a 6 B Г Д e Ж ³ И Й k Л M H o П - 0x70,0x63,0x54,0x79,0xD8,0x78,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x62,0x8F,0xAC,0xAD // d19 - // p c T y Ф x Ч ч Ш Щ Ъ Ы b Э Ю Я - }; - #elif ENABLED(MAPPER_E382E383) - #error "Katakana on a WESTERN display makes no sense. There are no matching symbols." - #endif - - #elif DISPLAY_CHARSET_HD44780 == CYRILLIC - #if ENABLED(MAPPER_D0D1) - #define MAPPER_D0D1_MOD - // it is a Russian alphabet translation - // except 0401 --> 0xA2 = Ё, 0451 --> 0xB5 = ё - const PROGMEM uint8_t utf_recode[] = - { 0x41,0xA0,0x42,0xA1,0xE0,0x45,0xA3,0xA4, // unicode U+0400 to U+047f - // A Б->Ё B Г Д E Ж З // 0 Ѐ Ё Ђ Ѓ Є Ѕ І Ї - 0xA5,0xA6,0x4B,0xA7,0x4D,0x48,0x4F,0xA8, // Ј Љ Њ Ћ Ќ Ѝ Ў Џ - // И Й K Л M H O П // 1 А Б В Г Д Е Ж З - 0x50,0x43,0x54,0xA9,0xAA,0x58,0xE1,0xAB, // И Й К Л М Н О П - // P C T У Ф X Ч ч // 2 Р С Т У Ф Х Г Ч - 0xAC,0xE2,0xAD,0xAE,0x62,0xAF,0xB0,0xB1, // Ш Щ Ъ Ы Ь Э Ю Я - // Ш Щ Ъ Ы b Э Ю Я // 3 а б в г д е ж з - 0x61,0xB2,0xB3,0xB4,0xE3,0x65,0xB6,0xB7, // и й к л м н о п - // a б->ё в г д e ж з // 4 р с т у ф х ц ч - 0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0x6F,0xBE, // ш щ ъ ы ь э ю я - // и й к л м н o п // 5 ѐ ё ђ ѓ є ѕ і ї - 0x70,0x63,0xBF,0x79,0xE4,0x78,0xE5,0xC0, // ј љ њ ћ ќ ѝ ў џ - // p c т y ф x ц ч // 6 Ѡ ѡ Ѣ ѣ Ѥ ѥ Ѧ ѧ - 0xC1,0xE6,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7 // Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ - // ш щ ъ ы ь э ю я // 7 Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ - }; // ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ - #elif ENABLED(MAPPER_C2C3) - #error "Western languages on a CYRILLIC display makes no sense. There are no matching symbols." - #elif ENABLED(MAPPER_E382E383) - #error "Katakana on a CYRILLIC display makes no sense. There are no matching symbols." - #endif - #else - #error "Something went wrong in the setting of DISPLAY_CHARSET_HD44780" - #endif // DISPLAY_CHARSET_HD44780 -#endif // SIMULATE_ROMFONT - -#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) - -#if ENABLED(MAPPER_C2C3) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_c2 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d >= 0xC0u && !seen_c2) { - utf_hi_char = d - 0xC2u; - seen_c2 = true; - return 0; - } - else if (seen_c2) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_c2 = false; - return 1; - } - -#elif ENABLED(MAPPER_C2C3_TR) - - // the C2C3-mapper extended for the 6 altered symbols from C4 and C5 range. - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_c2 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d >= 0xC0u && !seen_c2) { - utf_hi_char = d - 0xC2u; - seen_c2 = true; - return 0; - } - else if (seen_c4) { - switch(d) { - case 0x9Eu: d = 0xD0u; break; - case 0x9Fu: d = 0xF0u; break; - case 0xB0u: d = 0xDDu; break; - case 0xB1u: d = 0xFDu; break; - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x9Eu: d = 0xDEu; break; - case 0x9Fu: d = 0xFEu; break; - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c2) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_c2 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_CECF) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_ce = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xC0 && !seen_ce) { - utf_hi_char = d - 0xCE; - seen_ce = true; - return 0; - } - else if (seen_ce) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_ce = false; - return 1; - } - -#elif ENABLED(MAPPER_CECF) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_ce = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xC0 && !seen_ce) { - utf_hi_char = d - 0xCE; - seen_ce = true; - return 0; - } - else if (seen_ce) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_ce = false; - return 1; - } - -#elif ENABLED(MAPPER_D0D1_MOD) - - char charset_mapper(const char c) { - // it is a Russian alphabet translation - // except 0401 --> 0xA2 = Ё, 0451 --> 0xB5 = ё - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_d5 = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xD0 && !seen_d5) { - utf_hi_char = d - 0xD0; - seen_d5 = true; - return 0; - } - else if (seen_d5) { - d &= 0x3F; - if (!utf_hi_char && d == 1) { - HARDWARE_CHAR_OUT(0xA2); // Ё - } - else if (utf_hi_char == 1 && d == 0x11) { - HARDWARE_CHAR_OUT(0xB5); // ё - } - else { - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10)); - } - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_d5 = false; - return 1; - } - -#elif ENABLED(MAPPER_D0D1) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_d5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d >= 0xD0u && !seen_d5) { - utf_hi_char = d - 0xD0u; - seen_d5 = true; - return 0; - } - else if (seen_d5) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0xA0u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_d5 = false; - return 1; - } - -#elif ENABLED(MAPPER_E382E383) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_e3 = false, - seen_82_83 = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d == 0xE3 && !seen_e3) { - seen_e3 = true; - return 0; // eat 0xE3 - } - else if (d >= 0x82 && seen_e3 && !seen_82_83) { - utf_hi_char = d - 0x82; - seen_82_83 = true; - return 0; - } - else if (seen_e3 && seen_82_83) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else - HARDWARE_CHAR_OUT('?'); - } - else - HARDWARE_CHAR_OUT(c); - - seen_e3 = false; - seen_82_83 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_PL) - - /** - * Ą C4 84 = 80 - * ą C4 85 = 81 - * Ć C4 86 = 82 - * ć C4 87 = 83 - * Ę C4 98 = 84 - * ę C4 99 = 85 - * Ł C5 81 = 86 - * ł C5 82 = 87 - * Ń C5 83 = 88 - * ń C5 84 = 89 - * Ó C3 93 = 8A - * ó C3 B3 = 8B - * Ś C5 9A = 8C - * ś C5 9B = 8D - * Ź C5 B9 = 8E - * ź C5 BA = 8F - * Ż C5 BB = 90 - * ż C5 BC = 91 - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x84u ... 0x87u: d -= 4; break; //Ą - ć - case 0x98u ... 0x99u: d -= 20; break; //Ę i ę - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x81u ... 0x84u: d += 5; break; //Ł - ń - case 0x9Au ... 0x9Bu: d -= 0x0Eu; break; //Ś i ś - case 0xB9u ... 0xBCu: d -= 0x2Bu; break; //Ź - ż - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x93u: d = 0x8Au; break; //Ó - case 0xB3u: d = 0x8Bu; break; //ó - d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_CZ) - - /** - * Á C3 81 = 80 - * É C3 89 = 81 - * Í C3 8D = 82 - * Ó C3 93 = 83 - * Ú C3 9A = 84 - * Ý C3 9D = 85 - * á C3 A1 = 86 - * é C3 A9 = 87 - * í C3 AD = 88 - * ó C3 B3 = 89 - * ú C3 BA = 8A - * ý C3 BD = 8B - * Č C4 8C = 8C - * č C4 8D = 8D - * Ď C4 8E = 8E - * ď C4 8F = 8F - * Ě C4 9A = 90 - * ě C4 9B = 91 - * Ň C5 87 = 92 - * ň C5 88 = 93 - * Ř C5 98 = 94 - * ř C5 99 = 95 - * Š C5 A0 = 96 - * š C5 A1 = 97 - * Ť C5 A4 = 98 - * ť C5 A5 = 99 - * Ů C5 AE = 9A - * ů C5 AF = 9B - * Ž C5 BD = 9C - * ž C5 BE = 9D - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x8Cu ... 0x8Fu: break; // ČčĎď Mapping 1:1 - case 0x9Au ... 0x9Bu: d -= 10; break; // Ěě - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x87u ... 0x88u: d += 0x0Bu; break; // Ňň - case 0x98u ... 0x99u: d -= 0x04u; break; // Řř - case 0xA0u ... 0xA1u: d -= 0x0Au; break; // Šš - case 0xA4u ... 0xA5u: d -= 0x0Cu; break; // Ťť - case 0xAEu ... 0xAFu: d -= 0x14u; break; // Ůů - case 0xBDu ... 0xBEu: d -= 0x21u; break; // Žž - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x81u: d = 0x80u; break; // Á - case 0x89u: d = 0x81u; break; // É - case 0x8Du: d = 0x82u; break; // Í - case 0x93u: d = 0x83u; break; // Ó - case 0x9Au: d = 0x84u; break; // Ú - case 0x9Du: d = 0x85u; break; // Ý - case 0xA1u: d = 0x86u; break; // á - case 0xA9u: d = 0x87u; break; // é - case 0xADu: d = 0x88u; break; // í - case 0xB3u: d = 0x89u; break; // ó - case 0xBAu: d = 0x8Au; break; // ú - case 0xBDu: d = 0x8Bu; break; // ý - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_SK) - - /** - * Á C3 81 = 80 - * Ä C3 84 = 81 - * É C3 89 = 82 - * Í C3 8D = 83 - * Ó C3 93 = 84 - * Ô C3 94 = 85 - * Ú C3 9A = 86 - * Ý C3 9D = 87 - * á C3 A1 = 88 - * ä C3 A4 = 89 - * é C3 A9 = 8A - * í C3 AD = 8B - * ó C3 B3 = 8C - * ô C3 B4 = 8D - * ú C3 BA = 8E - * ý C3 BD = 8F - * Č C4 8C = 90 - * č C4 8D = 91 - * Ď C4 8E = 92 - * ď C4 8F = 93 - * Ĺ C4 B9 = 94 - * ĺ C4 BA = 95 - * Ľ C4 BD = 96 - * ľ C4 BE = 97 - * Ň C5 87 = 98 - * ň C5 88 = 99 - * Ŕ C5 94 = 9A - * ŕ C5 95 = 9B - * Š C5 A0 = 9C - * š C5 A1 = 9D - * Ť C5 A4 = 9E - * ť C5 A5 = 9F - * Ž C5 BD = A0 - * ž C5 BE = A1 - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x8Cu ... 0x8Fu: d += 0x04u; break; // ČčĎď - case 0xB9u ... 0xBAu: d -= 0x25u; break; // Ĺĺ - case 0xBDu ... 0xBEu: d -= 0x27u; break; // Ľľ - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x87u ... 0x88u: d += 0x11u; break; // Ňň - case 0x94u ... 0x95u: d += 0x06u; break; // Ŕŕ - case 0xA0u ... 0xA1u: d -= 0x04u; break; // Šš - case 0xA4u ... 0xA5u: d -= 0x06u; break; // Ťť - case 0xBDu ... 0xBEu: d -= 0x1Du; break; // Žž - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x81u: d = 0x80u; break; // Á - case 0x84u: d = 0x81u; break; // Ä - case 0x89u: d = 0x82u; break; // É - case 0x8Du: d = 0x83u; break; // Í - case 0x93u: d = 0x84u; break; // Ó - case 0x94u: d = 0x85u; break; // Ô - case 0x9Au: d = 0x86u; break; // Ú - case 0x9Du: d = 0x87u; break; // Ý - case 0xA1u: d = 0x88u; break; // á - case 0xA4u: d = 0x89u; break; // ä - case 0xA9u: d = 0x8Au; break; // é - case 0xADu: d = 0x8Bu; break; // í - case 0xB3u: d = 0x8Cu; break; // ó - case 0xB4u: d = 0x8Du; break; // ô - case 0xBAu: d = 0x8Eu; break; // ú - case 0xBDu: d = 0x8Fu; break; // ý - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#else - - #define MAPPER_NON - - #undef PRINTABLE - #define PRINTABLE(C) true - - char charset_mapper(const char c) { - HARDWARE_CHAR_OUT(c); - return 1; - } - -#endif // code mappers - -#endif // UTF_MAPPER_H diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp deleted file mode 100644 index 88a0503d5e..0000000000 --- a/Marlin/utility.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "Marlin.h" -#include "utility.h" -#include "temperature.h" - -void safe_delay(millis_t ms) { - while (ms > 50) { - ms -= 50; - delay(50); - thermalManager.manage_heater(); - } - delay(ms); - thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made -} - -#if ENABLED(EEPROM_SETTINGS) - - void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { - uint8_t *ptr = (uint8_t *)data; - while (cnt--) { - *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8)); - for (uint8_t i = 0; i < 8; i++) - *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (*crc << 1)); - } - } - -#endif // EEPROM_SETTINGS - -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) - - char conv[8] = { 0 }; - - #define DIGIT(n) ('0' + (n)) - #define DIGIMOD(n, f) DIGIT((n)/(f) % 10) - #define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ') - #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-')) - - // Convert unsigned int to string 123 format - char* i8tostr3(const uint8_t i) { - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[4]; - } - - // Convert signed int to rj string with 123 or -12 format - char* itostr3(int i) { - conv[4] = MINUSOR(i, RJDIGIT(i, 100)); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[4]; - } - - // Convert unsigned int to lj string with 123 format - char* itostr3left(const int i) { - char *str = &conv[6]; - *str = DIGIMOD(i, 1); - if (i >= 10) { - *(--str) = DIGIMOD(i, 10); - if (i >= 100) - *(--str) = DIGIMOD(i, 100); - } - return str; - } - - // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format - char* itostr4sign(const int i) { - const bool neg = i < 0; - const int ii = neg ? -i : i; - if (i >= 1000) { - conv[3] = DIGIMOD(ii, 1000); - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else if (ii >= 100) { - conv[3] = neg ? '-' : ' '; - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[3] = ' '; - conv[4] = ' '; - if (ii >= 10) { - conv[4] = neg ? '-' : ' '; - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[5] = neg ? '-' : ' '; - } - } - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; - } - - // Convert unsigned float to string with 1.23 format - char* ftostr12ns(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[3]; - } - - // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, DIGIMOD(i, 10000)); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - #if ENABLED(LCD_DECIMAL_SMALL_XY) - - // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format - char* ftostr4sign(const float &f) { - const int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - if (!WITHIN(i, -99, 999)) return itostr4sign((int)f); - const bool neg = i < 0; - const int ii = neg ? -i : i; - conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' '); - conv[4] = DIGIMOD(ii, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; - } - - #endif // LCD_DECIMAL_SMALL_XY - - // Convert float to fixed-length string with +123.4 / -123.4 format - char* ftostr41sign(const float &f) { - int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format - char* ftostr43sign(const float &f, char plus/*=' '*/) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; - conv[1] = i ? MINUSOR(i, plus) : ' '; - conv[2] = DIGIMOD(i, 1000); - conv[3] = '.'; - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - // Convert unsigned float to rj string with 12345 format - char* ftostr5rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[2]; - } - - // Convert signed float to string with +1234.5 format - char* ftostr51sign(const float &f) { - long i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert signed float to string with +123.45 format - char* ftostr52sign(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert unsigned float to string with 1234.56 format omitting trailing zeros - char* ftostr62rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[0] = RJDIGIT(i, 100000); - conv[1] = RJDIGIT(i, 10000); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert signed float to space-padded string with -_23.4_ format - char* ftostr52sp(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - uint8_t dig; - conv[1] = MINUSOR(i, RJDIGIT(i, 10000)); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); - - if ((dig = i % 10)) { // second digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIT(dig); - } - else { - if ((dig = (i / 10) % 10)) { // first digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIT(dig); - } - else // nothing after decimal point - conv[4] = conv[5] = ' '; - conv[6] = ' '; - } - return &conv[1]; - } - -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) diff --git a/Marlin/utility.h b/Marlin/utility.h deleted file mode 100644 index 991d66289a..0000000000 --- a/Marlin/utility.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __UTILITY_H__ -#define __UTILITY_H__ - -#include "types.h" - -void safe_delay(millis_t ms); - -#if ENABLED(EEPROM_SETTINGS) - void crc16(uint16_t *crc, const void * const data, uint16_t cnt); -#endif - -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) - - // Convert uint8_t to string with 123 format - char* i8tostr3(const uint8_t x); - - // Convert signed int to rj string with 123 or -12 format - char* itostr3(const int x); - - // Convert unsigned int to lj string with 123 format - char* itostr3left(const int xx); - - // Convert signed int to rj string with _123, -123, _-12, or __-1 format - char* itostr4sign(const int x); - - // Convert unsigned float to string with 1.23 format - char* ftostr12ns(const float &x); - - // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &x); - - // Convert float to fixed-length string with +123.4 / -123.4 format - char* ftostr41sign(const float &x); - - // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format - char* ftostr43sign(const float &x, char plus=' '); - - // Convert unsigned float to rj string with 12345 format - char* ftostr5rj(const float &x); - - // Convert signed float to string with +1234.5 format - char* ftostr51sign(const float &x); - - // Convert signed float to space-padded string with -_23.4_ format - char* ftostr52sp(const float &x); - - // Convert signed float to string with +123.45 format - char* ftostr52sign(const float &x); - - // Convert unsigned float to string with 1234.56 format omitting trailing zeros - char* ftostr62rj(const float &x); - - // Convert float to rj string with 123 or -12 format - FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5f : 0.5f))); } - - #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); - #else - // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format - FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5f : 0.5f))); } - #endif - -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) - -#endif // __UTILITY_H__ diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp deleted file mode 100644 index e5afd9e831..0000000000 --- a/Marlin/vector_3.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - vector_3.cpp - Vector library for bed leveling - Copyright (c) 2012 Lars Brubaker. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "MarlinConfig.h" - -#if ABL_PLANAR || (HAS_BED_PROBE && ENABLED(AUTO_BED_LEVELING_UBL)) - -#include "vector_3.h" -#include "serial.h" -#include - -vector_3::vector_3() : x(0), y(0), z(0) { } - -vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { } - -vector_3 vector_3::cross(vector_3 left, vector_3 right) { - return vector_3(left.y * right.z - left.z * right.y, - left.z * right.x - left.x * right.z, - left.x * right.y - left.y * right.x); -} - -vector_3 vector_3::operator+(vector_3 v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } -vector_3 vector_3::operator-(vector_3 v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } - -vector_3 vector_3::get_normal() { - vector_3 normalized = vector_3(x, y, z); - normalized.normalize(); - return normalized; -} - -float vector_3::get_length() { return SQRT(sq(x) + sq(y) + sq(z)); } - -void vector_3::normalize() { - const float inv_length = RSQRT(sq(x) + sq(y) + sq(z)); - x *= inv_length; - y *= inv_length; - z *= inv_length; -} - -void vector_3::apply_rotation(matrix_3x3 matrix) { - const float resultX = x * matrix.matrix[3 * 0 + 0] + y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0], - resultY = x * matrix.matrix[3 * 0 + 1] + y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1], - resultZ = x * matrix.matrix[3 * 0 + 2] + y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2]; - x = resultX; - y = resultY; - z = resultZ; -} - -void vector_3::debug(const char * const title) { - serialprintPGM(title); - SERIAL_PROTOCOLPGM(" x: "); - SERIAL_PROTOCOL_F(x, 6); - SERIAL_PROTOCOLPGM(" y: "); - SERIAL_PROTOCOL_F(y, 6); - SERIAL_PROTOCOLPGM(" z: "); - SERIAL_PROTOCOL_F(z, 6); - SERIAL_EOL(); -} - -void apply_rotation_xyz(matrix_3x3 matrix, float &x, float &y, float &z) { - vector_3 vector = vector_3(x, y, z); - vector.apply_rotation(matrix); - x = vector.x; - y = vector.y; - z = vector.z; -} - -matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) { - //row_0.debug(PSTR("row_0")); - //row_1.debug(PSTR("row_1")); - //row_2.debug(PSTR("row_2")); - matrix_3x3 new_matrix; - new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z; - new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z; - new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z; - //new_matrix.debug(PSTR("new_matrix")); - return new_matrix; -} - -void matrix_3x3::set_to_identity() { - matrix[0] = 1; matrix[1] = 0; matrix[2] = 0; - matrix[3] = 0; matrix[4] = 1; matrix[5] = 0; - matrix[6] = 0; matrix[7] = 0; matrix[8] = 1; -} - -matrix_3x3 matrix_3x3::create_look_at(vector_3 target) { - vector_3 z_row = target.get_normal(); - vector_3 x_row = vector_3(1, 0, -target.x / target.z).get_normal(); - vector_3 y_row = vector_3::cross(z_row, x_row).get_normal(); - - // x_row.debug(PSTR("x_row")); - // y_row.debug(PSTR("y_row")); - // z_row.debug(PSTR("z_row")); - - // create the matrix already correctly transposed - matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); - - // rot.debug(PSTR("rot")); - return rot; -} - -matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { - matrix_3x3 new_matrix; - new_matrix.matrix[0] = original.matrix[0]; new_matrix.matrix[1] = original.matrix[3]; new_matrix.matrix[2] = original.matrix[6]; - new_matrix.matrix[3] = original.matrix[1]; new_matrix.matrix[4] = original.matrix[4]; new_matrix.matrix[5] = original.matrix[7]; - new_matrix.matrix[6] = original.matrix[2]; new_matrix.matrix[7] = original.matrix[5]; new_matrix.matrix[8] = original.matrix[8]; - return new_matrix; -} - -void matrix_3x3::debug(const char * const title) { - if (title != NULL) { - serialprintPGM(title); - SERIAL_EOL(); - } - uint8_t count = 0; - for (uint8_t i = 0; i < 3; i++) { - for (uint8_t j = 0; j < 3; j++) { - if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(matrix[count], 6); - SERIAL_PROTOCOLCHAR(' '); - count++; - } - SERIAL_EOL(); - } -} - -#endif // HAS_ABL diff --git a/Marlin/vector_3.h b/Marlin/vector_3.h deleted file mode 100644 index a92660018f..0000000000 --- a/Marlin/vector_3.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - vector_3.cpp - Vector library for bed leveling - Copyright (c) 2012 Lars Brubaker. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef VECTOR_3_H -#define VECTOR_3_H - -class matrix_3x3; - -struct vector_3 { - float x, y, z; - - vector_3(); - vector_3(float x, float y, float z); - - static vector_3 cross(vector_3 a, vector_3 b); - - vector_3 operator+(vector_3 v); - vector_3 operator-(vector_3 v); - void normalize(); - float get_length(); - vector_3 get_normal(); - - void debug(const char * const title); - - void apply_rotation(matrix_3x3 matrix); -}; - -struct matrix_3x3 { - float matrix[9]; - - static matrix_3x3 create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2); - static matrix_3x3 create_look_at(vector_3 target); - static matrix_3x3 transpose(matrix_3x3 original); - - void set_to_identity(); - - void debug(const char * const title); -}; - - -void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z); - -#endif // VECTOR_3_H diff --git a/Marlin/watchdog.cpp b/Marlin/watchdog.cpp deleted file mode 100644 index 135a050fff..0000000000 --- a/Marlin/watchdog.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "Marlin.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s. -void watchdog_init() { - #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S) - #define WDTO_NS WDTO_8S - #else - #define WDTO_NS WDTO_4S - #endif - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - // Take care, as this requires the correct order of operation, with interrupts disabled. - // See the datasheet of any AVR chip for details. - wdt_reset(); - cli(); - _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); - _WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5 - // So worked for up to WDTO_2S - sei(); - wdt_reset(); - #else - wdt_enable(WDTO_NS); // The function handles the upper bit correct. - #endif - //delay(10000); // test it! -} - -//=========================================================================== -//=================================== ISR =================================== -//=========================================================================== - -// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled. -#if ENABLED(WATCHDOG_RESET_MANUAL) - ISR(WDT_vect) { - sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Watchdog barked, please turn off the printer."); - kill(PSTR("ERR:Watchdog")); //kill blocks //up to 16 characters so it fits on a 16x2 display - while (1); //wait for user or serial reset - } -#endif // WATCHDOG_RESET_MANUAL - -#endif // USE_WATCHDOG diff --git a/Marlin/watchdog.h b/Marlin/watchdog.h deleted file mode 100644 index 2c04b58972..0000000000 --- a/Marlin/watchdog.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef WATCHDOG_H -#define WATCHDOG_H - -#include "Marlin.h" -#include - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void watchdog_reset() { wdt_reset(); } - -#endif diff --git a/Marlin_Chinese.zip b/Marlin_Chinese.zip deleted file mode 100644 index 6c3e91a77f..0000000000 Binary files a/Marlin_Chinese.zip and /dev/null differ diff --git a/Marlin_thinkerV2/Marlin/Conditionals.h b/Marlin_thinkerV2/Marlin/Conditionals.h deleted file mode 100644 index ff6c6b187f..0000000000 --- a/Marlin_thinkerV2/Marlin/Conditionals.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals.h - * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h - */ -#error "Old configurations? Please delete all #include lines from Configuration.h and Configuration_adv.h." diff --git a/Marlin_thinkerV2/Marlin/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin/Conditionals_LCD.h deleted file mode 100644 index a796e24667..0000000000 --- a/Marlin_thinkerV2/Marlin/Conditionals_LCD.h +++ /dev/null @@ -1,518 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals_LCD.h - * Conditionals that need to be set before Configuration_adv.h or pins.h - */ - -#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first -#define CONDITIONALS_LCD_H - -#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) - -#if ENABLED(CARTESIO_UI) - - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 90 - #define LCD_CONTRAST_MIN 60 - #define LCD_CONTRAST_MAX 140 - -#elif ENABLED(MAKRPANEL) - - #define U8GLIB_ST7565_64128N - -#elif ENABLED(ZONESTAR_LCD) - - #define REPRAPWORLD_KEYPAD - #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 - #define ADC_KEYPAD - #define ADC_KEY_NUM 8 - #define ULTIPANEL - - // this helps to implement ADC_KEYPAD menus - #define ENCODER_PULSES_PER_STEP 1 - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #define ENCODER_FEEDRATE_DEADZONE 2 - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(ANET_FULL_GRAPHICS_LCD) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif ENABLED(BQ_LCD_SMART_CONTROLLER) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -#elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) - #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. - - #if ENABLED(miniVIKI) - #define LCD_CONTRAST_MIN 75 - #define LCD_CONTRAST_MAX 115 - #define DEFAULT_LCD_CONTRAST 95 - #define U8GLIB_ST7565_64128N - #elif ENABLED(VIKI2) - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 140 - #define U8GLIB_ST7565_64128N - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define LCD_CONTRAST_MIN 90 - #define LCD_CONTRAST_MAX 130 - #define DEFAULT_LCD_CONTRAST 110 - #define U8GLIB_LM6059_AF - #define SD_DETECT_INVERTED - #endif - -#elif ENABLED(OLED_PANEL_TINYBOY2) - - #define U8GLIB_SSD1306 - #define ULTIPANEL - #define REVERSE_ENCODER_DIRECTION - #define REVERSE_MENU_DIRECTION - -#elif ENABLED(RA_CONTROL_PANEL) - - #define LCD_I2C_TYPE_PCA8574 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL - -#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define DOGLCD - #define U8GLIB_ST7920 - #define ULTIPANEL - -#elif ENABLED(CR10_STOCKDISPLAY) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif - -#elif ENABLED(MKS_12864OLED) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SH1106 - -#elif ENABLED(MKS_12864OLED_SSD1306) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SSD1306 - -#elif ENABLED(MKS_MINI_12864) - - #define MINIPANEL - -#endif - -#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) - #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 17 -#endif - -#if ENABLED(ULTI_CONTROLLER) - #define U8GLIB_SSD1309 - #define REVERSE_ENCODER_DIRECTION - #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 254 - #define DEFAULT_LCD_CONTRAST 127 - #define ENCODER_PULSES_PER_STEP 2 - #define ENCODER_STEPS_PER_MENU_ITEM 2 -#endif - -// Generic support for SSD1306 / SSD1309 / SH1106 OLED based LCDs. -#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SSD1309) || ENABLED(U8GLIB_SH1106) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SSD1309 / SH1106 graphic Display Family) -#endif - -#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) - - #define ULTIMAKERCONTROLLER - -#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) - - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - -#endif - -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_CONTROLLER) - #define DOGLCD - #define U8GLIB_ST7920 - #define REPRAP_DISCOUNT_SMART_CONTROLLER -#endif - -#if ENABLED(ULTIMAKERCONTROLLER) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ - || ENABLED(G3D_PANEL) \ - || ENABLED(RIGIDBOT_PANEL) \ - || ENABLED(ULTI_CONTROLLER) - #define ULTIPANEL -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL - #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP) - #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 - #endif -#endif - -/** - * I2C PANELS - */ - -#if ENABLED(LCD_SAINSMART_I2C_1602) || ENABLED(LCD_SAINSMART_I2C_2004) - - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTRA_LCD - - #if ENABLED(LCD_SAINSMART_I2C_2004) - #define LCD_WIDTH 20 - #define LCD_HEIGHT 4 - #endif - -#elif ENABLED(LCD_I2C_PANELOLU2) - - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define ULTIPANEL - -#elif ENABLED(LCD_I2C_VIKI) - - /** - * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - * - * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) - * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. - * Note: The pause/stop/resume LCD button pin should be connected to the Arduino - * BTN_ENC pin (or set BTN_ENC to -1 if not used) - */ - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define ULTIPANEL - - #define ENCODER_FEEDRATE_DEADZONE 4 - - #define STD_ENCODER_PULSES_PER_STEP 1 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 2 - -#elif ENABLED(G3D_PANEL) - - #define STD_ENCODER_PULSES_PER_STEP 2 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - -#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - || ENABLED(OLED_PANEL_TINYBOY2) \ - || ENABLED(BQ_LCD_SMART_CONTROLLER) \ - || ENABLED(LCD_I2C_PANELOLU2) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif - -#ifndef STD_ENCODER_PULSES_PER_STEP - #define STD_ENCODER_PULSES_PER_STEP 5 -#endif -#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#endif -#ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP -#endif -#ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM -#endif -#ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 6 -#endif - -// Shift register panels -// --------------------- -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection - -#if ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define ULTIPANEL -#endif - -#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display - #ifndef LCD_WIDTH - #ifdef LCD_WIDTH_OVERRIDE - #define LCD_WIDTH LCD_WIDTH_OVERRIDE - #else - #define LCD_WIDTH 22 - #endif - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 5 - #endif -#endif - -#if ENABLED(NO_LCD_MENUS) - #undef ULTIPANEL -#endif - -#if ENABLED(ULTIPANEL) - #define NEWPANEL // Disable this if you actually have no click-encoder panel - #define ULTRA_LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 20 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 4 - #endif -#elif ENABLED(ULTRA_LCD) // no panel but just LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 16 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 2 - #endif -#endif - -#if ENABLED(DOGLCD) - /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */ - // \x00 intentionally skipped to avoid problems in strings - #define LCD_STR_REFRESH "\x01" - #define LCD_STR_FOLDER "\x02" - #define LCD_STR_ARROW_RIGHT "\x03" - #define LCD_STR_UPLEVEL "\x04" - #define LCD_STR_CLOCK "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_BEDTEMP "\x07" - #define LCD_STR_THERMOMETER "\x08" - #define LCD_STR_DEGREE "\x09" - - #define LCD_STR_SPECIAL_MAX '\x09' - // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin. - // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - - // Symbol characters - #define LCD_STR_FILAM_DIA "\xf8" - #define LCD_STR_FILAM_MUL "\xa4" -#else - // Custom characters defined in the first 8 characters of the LCD - #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_DEGREE_CHAR 0x01 - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_UPLEVEL_CHAR 0x03 - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_FEEDRATE_CHAR 0x06 - #define LCD_CLOCK_CHAR 0x07 - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ -#endif - -/** - * Default LCD contrast for dogm-like LCD displays - */ -#if ENABLED(DOGLCD) - - #define HAS_LCD_CONTRAST ( \ - ENABLED(MAKRPANEL) \ - || ENABLED(CARTESIO_UI) \ - || ENABLED(VIKI2) \ - || ENABLED(miniVIKI) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - ) - - #if HAS_LCD_CONTRAST - #ifndef LCD_CONTRAST_MIN - #define LCD_CONTRAST_MIN 0 - #endif - #ifndef LCD_CONTRAST_MAX - #define LCD_CONTRAST_MAX 63 - #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST 32 - #endif - #endif -#endif - -// Boot screens -#if DISABLED(ULTRA_LCD) - #undef SHOW_BOOTSCREEN -#elif !defined(BOOTSCREEN_TIMEOUT) - #define BOOTSCREEN_TIMEOUT 2500 -#endif - -#define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST)) - -/** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * E_MANUAL - Number of E steppers for LCD move options - * - */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 - #else - #define E_STEPPERS 1 - #endif - #if DISABLED(SWITCHING_NOZZLE) - #define HOTENDS E_STEPPERS - #endif - #define E_MANUAL EXTRUDERS -#elif ENABLED(MIXING_EXTRUDER) - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 -#else - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS -#endif - -// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE -#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE) - #undef DISABLE_INACTIVE_EXTRUDER -#endif - -// MK2 Multiplexer forces SINGLENOZZLE -#if ENABLED(MK2_MULTIPLEXER) - #define SINGLENOZZLE -#endif - -#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset - #undef HOTENDS - #define HOTENDS 1 - #undef TEMP_SENSOR_1_AS_REDUNDANT - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y -#endif - -#ifndef HOTENDS - #define HOTENDS EXTRUDERS -#endif - -#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) - -/** - * DISTINCT_E_FACTORS affects how some E factors are accessed - */ -#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define XYZE_N (XYZ + E_STEPPERS) - #define E_AXIS_N (E_AXIS + extruder) -#else - #undef DISTINCT_E_FACTORS - #define XYZE_N XYZE - #define E_AXIS_N E_AXIS -#endif - -/** - * The BLTouch Probe emulates a servo probe - * and uses "special" angles for its state. - */ -#if ENABLED(BLTOUCH) - #ifndef Z_PROBE_SERVO_NR - #define Z_PROBE_SERVO_NR 0 - #endif - #ifndef NUM_SERVOS - #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1) - #endif - #undef DEACTIVATE_SERVOS_AFTER_MOVE - #if NUM_SERVOS == 1 - #undef SERVO_DELAY - #define SERVO_DELAY { 50 } - #endif - #ifndef BLTOUCH_DELAY - #define BLTOUCH_DELAY 375 - #endif - #undef Z_SERVO_ANGLES - #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } - - #define BLTOUCH_DEPLOY 10 - #define BLTOUCH_STOW 90 - #define BLTOUCH_SELFTEST 120 - #define BLTOUCH_RESET 160 - #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING) - - // Always disable probe pin inverting for BLTouch - #undef Z_MIN_PROBE_ENDSTOP_INVERTING - #define Z_MIN_PROBE_ENDSTOP_INVERTING false - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #undef Z_MIN_ENDSTOP_INVERTING - #define Z_MIN_ENDSTOP_INVERTING Z_MIN_PROBE_ENDSTOP_INVERTING - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN) - #else - #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE) - #endif -#endif - -/** - * Set a flag for a servo probe - */ -#define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) - -/** - * Set flags for enabled probes - */ -#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) -#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - -#if !HAS_BED_PROBE - // Clear probe pin settings when no probe is selected - #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PROBE_ENDSTOP -#elif ENABLED(Z_PROBE_ALLEN_KEY) - // Extra test for Allen Key Probe - #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST -#endif - -#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) - -#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) -#define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) -#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) - -#define USE_MARLINSERIAL !(defined(__AVR__) && defined(USBCON)) - -#endif // CONDITIONALS_LCD_H diff --git a/Marlin_thinkerV2/Marlin/Conditionals_post.h b/Marlin_thinkerV2/Marlin/Conditionals_post.h deleted file mode 100644 index a0877283d1..0000000000 --- a/Marlin_thinkerV2/Marlin/Conditionals_post.h +++ /dev/null @@ -1,1382 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Conditionals_post.h - * Defines that depend on configuration but are not editable. - */ - -#ifndef CONDITIONALS_POST_H -#define CONDITIONALS_POST_H - -#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA)) -#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA) -#define IS_CARTESIAN !IS_KINEMATIC - -/** - * Axis lengths and center - */ -#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS)) -#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) -#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS)) - -// Defined only if the sanity-check is bypassed -#ifndef X_BED_SIZE - #define X_BED_SIZE X_MAX_LENGTH -#endif -#ifndef Y_BED_SIZE - #define Y_BED_SIZE Y_MAX_LENGTH -#endif - -// Require 0,0 bed center for Delta and SCARA -#if IS_KINEMATIC - #define BED_CENTER_AT_0_0 -#endif - -// Define center values for future use -#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) -#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) - -/** - * Dual X Carriage - */ -#if ENABLED(DUAL_X_CARRIAGE) - #ifndef X1_MIN_POS - #define X1_MIN_POS X_MIN_POS - #endif - #ifndef X1_MAX_POS - #define X1_MAX_POS X_BED_SIZE - #endif -#endif - -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#define CORE_IS_XY (ENABLED(COREXY) || ENABLED(COREYX)) -#define CORE_IS_XZ (ENABLED(COREXZ) || ENABLED(COREZX)) -#define CORE_IS_YZ (ENABLED(COREYZ) || ENABLED(COREZY)) -#define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ) -#if IS_CORE - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS - #endif - #if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY) - #define CORESIGN(n) (-(n)) - #else - #define CORESIGN(n) (n) - #endif -#endif - -/** - * No adjustable bed on non-cartesians - */ -#if IS_KINEMATIC - #undef LEVEL_BED_CORNERS -#endif - -/** - * SCARA cannot use SLOWDOWN and requires QUICKHOME - */ -#if IS_SCARA - #undef SLOWDOWN - #define QUICK_HOME -#endif - -/** - * Set the home position based on settings or manual overrides - */ -#ifdef MANUAL_X_HOME_POS - #define X_HOME_POS MANUAL_X_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define X_HOME_POS 0 - #else - #define X_HOME_POS ((X_BED_SIZE) * (X_HOME_DIR) * 0.5) - #endif -#else - #if ENABLED(DELTA) - #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) - #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Y_HOME_POS - #define Y_HOME_POS MANUAL_Y_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define Y_HOME_POS 0 - #else - #define Y_HOME_POS ((Y_BED_SIZE) * (Y_HOME_DIR) * 0.5) - #endif -#else - #if ENABLED(DELTA) - #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 0.5) - #else - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Z_HOME_POS - #define Z_HOME_POS MANUAL_Z_HOME_POS -#else - #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS) -#endif - -/** - * If DELTA_HEIGHT isn't defined use the old setting - */ -#if ENABLED(DELTA) && !defined(DELTA_HEIGHT) - #define DELTA_HEIGHT Z_HOME_POS -#endif - -/** - * Z Sled Probe requires Z_SAFE_HOMING - */ -#if ENABLED(Z_PROBE_SLED) - #define Z_SAFE_HOMING -#endif - -/** - * DELTA should ignore Z_SAFE_HOMING and SLOWDOWN - */ -#if ENABLED(DELTA) - #undef Z_SAFE_HOMING - #undef SLOWDOWN -#endif - -/** - * Safe Homing Options - */ -#if ENABLED(Z_SAFE_HOMING) - #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT X_CENTER - #endif - #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT Y_CENTER - #endif - #define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT - #define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT -#else - #define X_TILT_FULCRUM X_HOME_POS - #define Y_TILT_FULCRUM Y_HOME_POS -#endif - -/** - * Host keep alive - */ -#ifndef DEFAULT_KEEPALIVE_INTERVAL - #define DEFAULT_KEEPALIVE_INTERVAL 2 -#endif - -/** - * Provide a MAX_AUTORETRACT for older configs - */ -#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT) - #define MAX_AUTORETRACT 99 -#endif - -// MS1 MS2 Stepper Driver Microstepping mode table -#define MICROSTEP1 LOW,LOW -#if ENABLED(HEROIC_STEPPER_DRIVERS) - #define MICROSTEP128 LOW,HIGH -#else - #define MICROSTEP2 HIGH,LOW - #define MICROSTEP4 LOW,HIGH -#endif -#define MICROSTEP8 HIGH,HIGH -#define MICROSTEP16 HIGH,HIGH - -/** - * Override here because this is set in Configuration_adv.h - */ -#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #undef SD_DETECT_INVERTED -#endif - -/** - * Set defaults for missing (newer) options - */ -#ifndef DISABLE_INACTIVE_X - #define DISABLE_INACTIVE_X DISABLE_X -#endif -#ifndef DISABLE_INACTIVE_Y - #define DISABLE_INACTIVE_Y DISABLE_Y -#endif -#ifndef DISABLE_INACTIVE_Z - #define DISABLE_INACTIVE_Z DISABLE_Z -#endif -#ifndef DISABLE_INACTIVE_E - #define DISABLE_INACTIVE_E DISABLE_E -#endif - -// Power Signal Control Definitions -// By default use ATX definition -#ifndef POWER_SUPPLY - #define POWER_SUPPLY 1 -#endif -#if (POWER_SUPPLY == 1) // 1 = ATX - #define PS_ON_AWAKE LOW - #define PS_ON_ASLEEP HIGH -#elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W - #define PS_ON_AWAKE HIGH - #define PS_ON_ASLEEP LOW -#endif -#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON)) - -/** - * Temp Sensor defines - */ -#if TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 -#elif TEMP_SENSOR_0 == -3 - #define HEATER_0_USES_MAX6675 - #define MAX6675_IS_MAX31855 - #define MAX6675_TMIN -270 - #define MAX6675_TMAX 1800 -#elif TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 - #define MAX6675_TMIN 0 - #define MAX6675_TMAX 1024 -#elif TEMP_SENSOR_0 == -1 - #define HEATER_0_USES_AD595 -#elif TEMP_SENSOR_0 == 0 - #undef HEATER_0_MINTEMP - #undef HEATER_0_MAXTEMP -#elif TEMP_SENSOR_0 > 0 - #define THERMISTORHEATER_0 TEMP_SENSOR_0 - #define HEATER_0_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 -#elif TEMP_SENSOR_1 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1." -#elif TEMP_SENSOR_1 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_1." -#elif TEMP_SENSOR_1 == -1 - #define HEATER_1_USES_AD595 -#elif TEMP_SENSOR_1 == 0 - #undef HEATER_1_MINTEMP - #undef HEATER_1_MAXTEMP -#elif TEMP_SENSOR_1 > 0 - #define THERMISTORHEATER_1 TEMP_SENSOR_1 - #define HEATER_1_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_2 == -4 - #define HEATER_2_USES_AD8495 -#elif TEMP_SENSOR_2 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -1 - #define HEATER_2_USES_AD595 -#elif TEMP_SENSOR_2 == 0 - #undef HEATER_2_MINTEMP - #undef HEATER_2_MAXTEMP -#elif TEMP_SENSOR_2 > 0 - #define THERMISTORHEATER_2 TEMP_SENSOR_2 - #define HEATER_2_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_3 == -4 - #define HEATER_3_USES_AD8495 -#elif TEMP_SENSOR_3 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -1 - #define HEATER_3_USES_AD595 -#elif TEMP_SENSOR_3 == 0 - #undef HEATER_3_MINTEMP - #undef HEATER_3_MAXTEMP -#elif TEMP_SENSOR_3 > 0 - #define THERMISTORHEATER_3 TEMP_SENSOR_3 - #define HEATER_3_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_4 == -4 - #define HEATER_4_USES_AD8495 -#elif TEMP_SENSOR_4 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 -#elif TEMP_SENSOR_4 == 0 - #undef HEATER_4_MINTEMP - #undef HEATER_4_MAXTEMP -#elif TEMP_SENSOR_4 > 0 - #define THERMISTORHEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 -#elif TEMP_SENSOR_BED == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -1 - #define HEATER_BED_USES_AD595 -#elif TEMP_SENSOR_BED == 0 - #undef BED_MINTEMP - #undef BED_MAXTEMP -#elif TEMP_SENSOR_BED > 0 - #define THERMISTORBED TEMP_SENSOR_BED - #define HEATER_BED_USES_THERMISTOR -#endif - -#if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 -#elif TEMP_SENSOR_CHAMBER == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 -#elif TEMP_SENSOR_CHAMBER > 0 - #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR -#endif - -#define HOTEND_USES_THERMISTOR (ENABLED(HEATER_0_USES_THERMISTOR) || ENABLED(HEATER_1_USES_THERMISTOR) || ENABLED(HEATER_2_USES_THERMISTOR) || ENABLED(HEATER_3_USES_THERMISTOR) || ENABLED(HEATER_4_USES_THERMISTOR)) - -/** - * Default hotend offsets, if not defined - */ -#define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER))) -#if HOTENDS > 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif - #if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z) - #define HOTEND_OFFSET_Z { 0 } - #endif -#endif - -/** - * ARRAY_BY_EXTRUDERS based on EXTRUDERS - */ -#define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_ARGS__) -#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1) - -/** - * ARRAY_BY_HOTENDS based on HOTENDS - */ -#define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) - -/** - * Driver Timings - * NOTE: Driver timing order is longest-to-shortest duration. - * Preserve this ordering when adding new drivers. - */ -#ifndef MINIMUM_STEPPER_DIR_DELAY - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_DIR_DELAY 15000 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_DIR_DELAY 1500 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_DIR_DELAY 650 - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_DIR_DELAY 500 - #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_DIR_DELAY 200 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_DIR_DELAY 20 - #else - #define MINIMUM_STEPPER_DIR_DELAY 200 // Expect at least 10µS since one Stepper ISR must transpire - #endif -#endif - -#ifndef MINIMUM_STEPPER_PULSE - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_PULSE 30 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_PULSE 3 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_PULSE 2 - #elif HAS_DRIVER(A4988) || HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_PULSE 1 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MINIMUM_STEPPER_PULSE 0 - #else - #define MINIMUM_STEPPER_PULSE 1 - #endif -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if HAS_DRIVER(TB6560) - #define MAXIMUM_STEPPER_RATE 15000 - #elif HAS_DRIVER(LV8729) - #define MAXIMUM_STEPPER_RATE 130000 - #elif HAS_DRIVER(TB6600) - #define MAXIMUM_STEPPER_RATE 150000 - #elif HAS_DRIVER(DRV8825) - #define MAXIMUM_STEPPER_RATE 250000 - #elif HAS_TRINAMIC || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) - #define MAXIMUM_STEPPER_RATE 400000 - #elif HAS_DRIVER(A4988) - #define MAXIMUM_STEPPER_RATE 500000 - #else - #define MAXIMUM_STEPPER_RATE 500000 - #endif -#endif - -/** - * X_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(X_DUAL_ENDSTOPS) - #if X_HOME_DIR > 0 - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MAX_PIN - #else - #define X2_MAX_ENDSTOP_INVERTING false - #endif - #define X2_MIN_ENDSTOP_INVERTING false - #else - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MAX_PIN - #else - #define X2_MIN_ENDSTOP_INVERTING false - #endif - #define X2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the X2 endstop? -#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) - -/** - * Y_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Y_DUAL_ENDSTOPS) - #if Y_HOME_DIR > 0 - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MAX_PIN - #else - #define Y2_MAX_ENDSTOP_INVERTING false - #endif - #define Y2_MIN_ENDSTOP_INVERTING false - #else - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MAX_PIN - #else - #define Y2_MIN_ENDSTOP_INVERTING false - #endif - #define Y2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Y2 endstop or the bed probe? -#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) - -/** - * Z_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Z_DUAL_ENDSTOPS) - #if Z_HOME_DIR > 0 - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MAX_PIN - #else - #define Z2_MAX_ENDSTOP_INVERTING false - #endif - #define Z2_MIN_ENDSTOP_INVERTING false - #else - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MAX_PIN - #else - #define Z2_MIN_ENDSTOP_INVERTING false - #endif - #define Z2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Z2 endstop or the bed probe? -#define IS_Z2_OR_PROBE(A,M) ( \ - (ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) \ - || (ENABLED(Z_MIN_PROBE_ENDSTOP) && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) - -/** - * Set ENDSTOPPULLUPS for active endstop switches - */ -#if ENABLED(ENDSTOPPULLUPS) - #if ENABLED(USE_XMAX_PLUG) - #define ENDSTOPPULLUP_XMAX - #endif - #if ENABLED(USE_YMAX_PLUG) - #define ENDSTOPPULLUP_YMAX - #endif - #if ENABLED(USE_ZMAX_PLUG) - #define ENDSTOPPULLUP_ZMAX - #endif - #if ENABLED(USE_XMIN_PLUG) - #define ENDSTOPPULLUP_XMIN - #endif - #if ENABLED(USE_YMIN_PLUG) - #define ENDSTOPPULLUP_YMIN - #endif - #if ENABLED(USE_ZMIN_PLUG) - #define ENDSTOPPULLUP_ZMIN - #endif -#endif - -/** - * Shorthand for pin tests, used wherever needed - */ - -// Steppers -#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) -#define HAS_X_DIR (PIN_EXISTS(X_DIR)) -#define HAS_X_STEP (PIN_EXISTS(X_STEP)) -#define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) - -#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) -#define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) -#define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) -#define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1)) - -#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) -#define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) -#define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) -#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) - -#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) -#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) -#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) -#define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1)) - -#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) -#define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) -#define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) -#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) - -#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) -#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) -#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) -#define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1)) - -// Extruder steppers and solenoids -#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) -#define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) -#define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) -#define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) -#define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) - -#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) -#define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) -#define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) -#define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) -#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) - -#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) -#define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) -#define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) -#define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) -#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) - -#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) -#define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) -#define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) -#define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) -#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) - -#define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) -#define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) -#define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) -#define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) -#define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) - -// Trinamic Stepper Drivers -#define HAS_STEALTHCHOP (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) -#define HAS_STALLGUARD HAS_DRIVER(TMC2130) -#define AXIS_HAS_STEALTHCHOP(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2208) ) -#define AXIS_HAS_STALLGUARD(ST) AXIS_DRIVER_TYPE(ST, TMC2130) - -#if ENABLED(SENSORLESS_HOMING) - // Disable Z axis sensorless homing if a probe is used to home the Z axis - #if HOMING_Z_WITH_PROBE - #undef Z_HOMING_SENSITIVITY - #endif - #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_HOMING_SENSITIVITY)) - #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_HOMING_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_HOMING_SENSITIVITY)) -#endif - -// Endstops and bed probe -#define HAS_STOP_TEST(A,M) (PIN_EXISTS(A##_##M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_OR_PROBE(A,M)) -#define HAS_X_MIN HAS_STOP_TEST(X,MIN) -#define HAS_X_MAX HAS_STOP_TEST(X,MAX) -#define HAS_Y_MIN HAS_STOP_TEST(Y,MIN) -#define HAS_Y_MAX HAS_STOP_TEST(Y,MAX) -#define HAS_Z_MIN HAS_STOP_TEST(Z,MIN) -#define HAS_Z_MAX HAS_STOP_TEST(Z,MAX) -#define HAS_X2_MIN (PIN_EXISTS(X2_MIN)) -#define HAS_X2_MAX (PIN_EXISTS(X2_MAX)) -#define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN)) -#define HAS_Y2_MAX (PIN_EXISTS(Y2_MAX)) -#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) -#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) -#define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE)) - -// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) -#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) -#define HAS_TEMP_ADC_0 HAS_ADC_TEST(0) -#define HAS_TEMP_ADC_1 HAS_ADC_TEST(1) -#define HAS_TEMP_ADC_2 HAS_ADC_TEST(2) -#define HAS_TEMP_ADC_3 HAS_ADC_TEST(3) -#define HAS_TEMP_ADC_4 HAS_ADC_TEST(4) -#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) -#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) - -#define HAS_TEMP_HOTEND (HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675)) -#define HAS_TEMP_BED HAS_TEMP_ADC_BED -#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER - -// Heaters -#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) -#define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) -#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2)) -#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) -#define HAS_HEATER_4 (PIN_EXISTS(HEATER_4)) -#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) - -// 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) - -// PID heating -#if !HAS_HEATED_BED - #undef PIDTEMPBED -#endif -#define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)) -#define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) - -// Thermal protection -#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED)) -#define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) -#define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) - -// Auto fans -#define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) -#define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) -#define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) -#define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) -#define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) -#define HAS_AUTO_CHAMBER_FAN (PIN_EXISTS(CHAMBER_AUTO_FAN)) -#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_CHAMBER_FAN) -#define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_0 (E3_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_3_IS_1 (E3_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_3_IS_2 (E3_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_0 (E4_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_0 (CHAMBER_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_1 (CHAMBER_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_2 (CHAMBER_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_3 (CHAMBER_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) -#define AUTO_CHAMBER_IS_4 (CHAMBER_AUTO_FAN_PIN == E4_AUTO_FAN_PIN) - -// Other fans -#define HAS_FAN0 (PIN_EXISTS(FAN)) -#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN) -#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN) -#define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) - -// Servos -#define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) -#define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) -#define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) -#define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) -#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0 && (HAS_SERVO_0 || HAS_SERVO_1 || HAS_SERVO_2 || HAS_SERVO_3)) - -#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR -1 -#endif - -// Sensors -#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) - -// User Interface -#define HAS_HOME (PIN_EXISTS(HOME)) -#define HAS_KILL (PIN_EXISTS(KILL)) -#define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) -#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH)) -#define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) -#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) - -// Digital control -#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS) -#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) -#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) - -#if !HAS_TEMP_SENSOR - #undef AUTO_REPORT_TEMPERATURES -#endif - -#define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS)) - -/** - * This setting is also used by M109 when trying to calculate - * a ballpark safe margin to prevent wait-forever situation. - */ -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif - -/** - * Helper Macros for heaters and extruder fan - */ -#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v) -#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v) - #if HOTENDS > 2 - #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v) - #if HOTENDS > 3 - #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v) - #if HOTENDS > 4 - #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#endif // HOTENDS > 1 -#if ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } -#else - #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) -#endif - -/** - * Heated bed requires settings - */ -#if HAS_HEATED_BED - #ifndef MAX_BED_POWER - #define MAX_BED_POWER 255 - #endif - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING false - #endif - #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) -#endif - -/** - * Up to 3 PWM fans - */ -#if HAS_FAN2 - #define FAN_COUNT 3 -#elif HAS_FAN1 - #define FAN_COUNT 2 -#elif HAS_FAN0 - #define FAN_COUNT 1 -#else - #define FAN_COUNT 0 -#endif - -#if HAS_FAN0 - #define WRITE_FAN(v) WRITE(FAN_PIN, v) - #define WRITE_FAN0(v) WRITE_FAN(v) -#endif -#if HAS_FAN1 - #define WRITE_FAN1(v) WRITE(FAN1_PIN, v) -#endif -#if HAS_FAN2 - #define WRITE_FAN2(v) WRITE(FAN2_PIN, v) -#endif -#define WRITE_FAN_N(n, v) WRITE_FAN##n(v) - -/** - * Part Cooling fan multipliexer - */ -#define HAS_FANMUX PIN_EXISTS(FANMUX0) - -/** - * MIN/MAX fan PWM scaling - */ -#ifndef FAN_MIN_PWM - #define FAN_MIN_PWM 0 -#endif -#ifndef FAN_MAX_PWM - #define FAN_MAX_PWM 255 -#endif -#if FAN_MIN_PWM < 0 || FAN_MIN_PWM > 255 - #error "FAN_MIN_PWM must be a value from 0 to 255." -#elif FAN_MAX_PWM < 0 || FAN_MAX_PWM > 255 - #error "FAN_MAX_PWM must be a value from 0 to 255." -#elif FAN_MIN_PWM > FAN_MAX_PWM - #error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM." -#endif - -/** - * Bed Probe dependencies - */ -#if HAS_BED_PROBE - #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN - #define ENDSTOPPULLUP_ZMIN_PROBE - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MIN - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MAX - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif - #ifndef XY_PROBE_SPEED - #ifdef HOMING_FEEDRATE_XY - #define XY_PROBE_SPEED HOMING_FEEDRATE_XY - #else - #define XY_PROBE_SPEED 4000 - #endif - #endif -#else - #undef X_PROBE_OFFSET_FROM_EXTRUDER - #undef Y_PROBE_OFFSET_FROM_EXTRUDER - #undef Z_PROBE_OFFSET_FROM_EXTRUDER - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 -#endif - -/** - * XYZ Bed Skew Correction - */ -#if ENABLED(SKEW_CORRECTION) - #define SKEW_FACTOR_MIN -1 - #define SKEW_FACTOR_MAX 1 - - #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) - #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) - #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) - - #ifndef XY_SKEW_FACTOR - constexpr float XY_SKEW_FACTOR = ( - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - 0.0 - #endif - ); - #endif - #ifndef XZ_SKEW_FACTOR - #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) - #define XZ_SIDE_AD XY_SIDE_AD - #endif - constexpr float XZ_SKEW_FACTOR = ( - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - 0.0 - #endif - ); - #endif - #ifndef YZ_SKEW_FACTOR - constexpr float YZ_SKEW_FACTOR = ( - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - 0.0 - #endif - ); - #endif -#endif // SKEW_CORRECTION - -/** - * Set granular options based on the specific type of leveling - */ -#define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA))) -#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)) -#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) -#define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID) -#define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL)) -#define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING)) -#define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY)) -#define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)) -#define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION)) -#define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) -#define HAS_UBL_AND_CURVES (ENABLED(AUTO_BED_LEVELING_UBL) && !PLANNER_LEVELING && (ENABLED(ARC_SUPPORT) || ENABLED(BEZIER_CURVE_SUPPORT))) -#define HAS_FEEDRATE_SCALING (ENABLED(SCARA_FEEDRATE_SCALING) || ENABLED(DELTA_FEEDRATE_SCALING)) - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #undef LCD_BED_LEVELING -#endif - -/** - * Heater & Fan Pausing - */ -#if FAN_COUNT == 0 - #undef PROBING_FANS_OFF -#endif -#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) -#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF)) - -#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH) - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 -#endif - -/** - * Only constrain Z on DELTA / SCARA machines - */ -#if IS_KINEMATIC - #undef MIN_SOFTWARE_ENDSTOP_X - #undef MIN_SOFTWARE_ENDSTOP_Y - #undef MAX_SOFTWARE_ENDSTOP_X - #undef MAX_SOFTWARE_ENDSTOP_Y -#endif - -/** - * 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 - -#if ENABLED(DELTA) - /** - * Delta radius/rod trimmers/angle trimmers - */ - #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 - MAX3(abs(X_PROBE_OFFSET_FROM_EXTRUDER), abs(Y_PROBE_OFFSET_FROM_EXTRUDER), abs(MIN_PROBE_EDGE))) - #else - #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS - #endif - #endif - #ifndef DELTA_ENDSTOP_ADJ - #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } - #endif - #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0} - #endif - #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} - #endif - #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #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) - -#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)) - -#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 ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) - #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!") - // so that may be added to SanityCheck.h in the future. - #define _MESH_MIN_X (X_MIN_BED + MESH_INSET) - #define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET) - #define _MESH_MAX_X (X_MAX_BED - (MESH_INSET)) - #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) - #else - // Boundaries for Cartesian probing based on set limits - #if ENABLED(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_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)) - #endif - #endif - - // These may be overridden in Configuration.h if a smaller area is desired - #ifndef MESH_MIN_X - #define MESH_MIN_X _MESH_MIN_X - #endif - #ifndef MESH_MIN_Y - #define MESH_MIN_Y _MESH_MIN_Y - #endif - #ifndef MESH_MAX_X - #define MESH_MAX_X _MESH_MAX_X - #endif - #ifndef MESH_MAX_Y - #define MESH_MAX_Y _MESH_MAX_Y - #endif - -#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT) - #if IS_KINEMATIC - #define SIN0 0.0 - #define SIN120 0.866025 - #define SIN240 -0.866025 - #define COS0 1.0 - #define COS120 -0.5 - #define COS240 -0.5 - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X (X_CENTER + (_PROBE_RADIUS) * COS0) - #endif - #ifndef PROBE_PT_1_Y - #define PROBE_PT_1_Y (Y_CENTER + (_PROBE_RADIUS) * SIN0) - #endif - #ifndef PROBE_PT_2_X - #define PROBE_PT_2_X (X_CENTER + (_PROBE_RADIUS) * COS120) - #endif - #ifndef PROBE_PT_2_Y - #define PROBE_PT_2_Y (Y_CENTER + (_PROBE_RADIUS) * SIN120) - #endif - #ifndef PROBE_PT_3_X - #define PROBE_PT_3_X (X_CENTER + (_PROBE_RADIUS) * COS240) - #endif - #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 ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(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 - -/** - * Buzzer/Speaker - */ -#if ENABLED(LCD_USE_I2C_BUZZER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 1000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 - #endif -#else - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 5000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 - #endif -#endif - -/** - * VIKI2, miniVIKI, AZSMZ_12864, and MKS_12864OLED_SSD1306 require DOGLCD_SCK and DOGLCD_MOSI to be defined. - */ -#if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) || ENABLED(MKS_12864OLED_SSD1306) - #ifndef DOGLCD_SCK - #define DOGLCD_SCK SCK_PIN - #endif - #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI MOSI_PIN - #endif -#endif - -/** - * Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES - */ -#ifndef Z_HOMING_HEIGHT - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_HOMING_HEIGHT 0 - #else - #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -#if PROBE_SELECTED - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT - #endif - #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT - #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #else - #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT - #endif - #ifndef Z_CLEARANCE_MULTI_PROBE - #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -// Updated G92 behavior shifts the workspace -#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS) -// The home offset also shifts the coordinate space -#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA)) -// Either offset yields extra calculations on all moves -#define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET) -// M206 doesn't apply to DELTA -#define HAS_M206_COMMAND (HAS_HOME_OFFSET && DISABLED(DELTA)) - -// LCD timeout to status screen default is 15s -#ifndef LCD_TIMEOUT_TO_STATUS - #define LCD_TIMEOUT_TO_STATUS 15000 -#endif - -// Shorthand -#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) - -// Add commands that need sub-codes to this list -#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY) - -// Parking Extruder -#if ENABLED(PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_GRAB_DISTANCE - #define PARKING_EXTRUDER_GRAB_DISTANCE 0 - #endif - #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH - #endif -#endif - -// Number of VFAT entries used. Each entry has 13 UTF-16 characters -#if ENABLED(SCROLL_LONG_FILENAMES) - #define MAX_VFAT_ENTRIES (5) -#else - #define MAX_VFAT_ENTRIES (2) -#endif - -// Set defaults for unspecified LED user colors -#if ENABLED(LED_CONTROL_MENU) - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 255 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 255 - #endif - #ifndef LED_USER_PRESET_WHITE - #define LED_USER_PRESET_WHITE 0 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #ifdef NEOPIXEL_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS - #else - #define LED_USER_PRESET_BRIGHTNESS 255 - #endif - #endif -#endif - -// Nozzle park -#if ENABLED(NOZZLE_PARK_FEATURE) && ENABLED(DELTA) - #undef NOZZLE_PARK_Z_FEEDRATE - #define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE -#endif - -#if ENABLED(SDCARD_SORT_ALPHA) - #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) -#endif - -#endif // CONDITIONALS_POST_H diff --git a/Marlin_thinkerV2/Marlin/Configuration.h b/Marlin_thinkerV2/Marlin/Configuration.h deleted file mode 100644 index b9287448fe..0000000000 --- a/Marlin_thinkerV2/Marlin/Configuration.h +++ /dev/null @@ -1,1944 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * 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 - * - */ -#ifndef CONFIGURATION_H -#define CONFIGURATION_H -#define CONFIGURATION_H_VERSION 010109 - -//=========================================================================== -//============================= 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 -// example_configurations/delta directory and customize for your machine. -// - -//=========================================================================== -//============================= SCARA Printer =============================== -//=========================================================================== -// For a SCARA printer start with the configuration files in -// example_configurations/SCARA and customize for your machine. -// - -// @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 "(eryone, thinker2560 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 *** - * - * 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. - */ - -// Enable to 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. -//#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. - * Serial port 0 is always used by the Arduino bootloader regardless of this setting. - * - * :[0, 1, 2, 3, 4, 5, 6, 7] - */ -#define SERIAL_PORT 0 - -/** - * 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 - -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setups -#ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMBO//BOARD_RAMPS_14_EFB -#endif - -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message -//#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) -//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" - -// @section extruder - -// This defines the number of extruders -// :[1, 2, 3, 4, 5] -#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 steppers - //#define E_MUX2_PIN 44 // Needed for 5 to 8 steppers -#endif - -// 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 of the nozzles -//#define SWITCHING_NOZZLE -#if ENABLED(SWITCHING_NOZZLE) - #define SWITCHING_NOZZLE_SERVO_NR 0 - #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 - //#define HOTEND_OFFSET_Z { 0.0, 0.0 } -#endif - -/** - * Two separate X-carriages with extruders that connect to a moving part - * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. - */ -//#define PARKING_EXTRUDER -#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 // Delay (ms) for magnetic field. No delay if 0 or not defined. - #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders - #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder - #define PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking - #define HOTEND_OFFSET_Z { 0.0, 1.3 } // Z-offsets of the two hotends. The first must be 0. -#endif - -/** - * "Mixing Extruder" - * - Adds a new code, M165, to set the current mix factors. - * - Extends the stepping routines to move multiple steppers in proportion to the mix. - * - Optional support for Repetier Firmware M163, M164, and virtual extruder. - * - This implementation supports only a single extruder. - * - Enable DIRECT_MIXING_IN_G1 for 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 -#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} // (in mm) for each extruder, offset of the hotend on the X axis -//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis - -// @section machine - -/** - * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN - * - * 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' } - */ -#define POWER_SUPPLY 0 - -#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 - - //#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 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) - * 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 - * 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 - * 20 : the PT100 circuit found in the Ultimainboard V2.x - * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 - * 66 : 4.7M High Temperature thermistor from Dyze Design - * 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) - * - * 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", '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'", '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", '66':"Dyze Design 4.7M 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" } - */ -#define TEMP_SENSOR_0 13 -#define TEMP_SENSOR_1 0 -#define TEMP_SENSOR_2 0 -#define TEMP_SENSOR_3 0 -#define TEMP_SENSOR_4 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 - -// Extruder temperature must be close to target for this long before M109 returns success -#define TEMP_RESIDENCY_TIME 10 // (seconds) -#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one -#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. - -// Bed temperature must be close to target for this long before M190 returns success -#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) -#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one -#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. - -// The minimal temperature defines the temperature below which the heater will not be enabled It is used -// to check that the wiring to the thermistor is not broken. -// Otherwise this would lead to the heater being powered on all the time. -#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 BED_MINTEMP 5 - -// When temperature exceeds max temp, your heater will be switched off. -// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! -// You should 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 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_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. - //#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 - - // Ultimaker - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 - - // 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 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 100.00 - #define DEFAULT_bedKi 5.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 - - // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. -#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 - -//=========================================================================== -//============================= 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 - -// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -#define X_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. -#define Y_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. -#define Z_MIN_ENDSTOP_INVERTING true//false // 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. -#define Z_MIN_PROBE_ENDSTOP_INVERTING true//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, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE - * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] - */ -//#define X_DRIVER_TYPE TMC2208 -//#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 E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_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 Filter - * - * Enable this option if endstops falsely trigger due to noise. - * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing - * will end up at a slightly different position on each G28. This will also - * reduce accuracy of some bed probes. - * For mechanical switches, the better approach to reduce noise is to install - * a 100 nanofarads ceramic capacitor in parallel with the switch, making it - * essentially noise-proof without sacrificing accuracy. - * This option also increases MCU load when endstops or the probe are enabled. - * So this is not recommended. USE AT YOUR OWN RISK. - * (This feature is not required for common micro-switches mounted on PCBs - * based on the Makerbot design, since they already include the 100nF capacitor.) - */ -//#define ENDSTOP_NOISE_FILTER - -//============================================================================= -//============================== 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]]]] - */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } //{ 80, 80, 400, 93 } - -/** - * Default Max Feed Rate (mm/s) - * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] - */ -#define DEFAULT_MAX_FEEDRATE { 200, 200, 10, 100 } - -/** - * 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]]]] - */ -#define DEFAULT_MAX_ACCELERATION { 1250, 1250, 50, 1250 } - -/** - * Default Acceleration (change/s) change = mm/s - * Override with M204 - * - * M204 P Acceleration - * M204 R Retract Acceleration - * M204 T Travel Acceleration - */ -#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves - -/** - * 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. - */ -#define DEFAULT_XJERK 10.0 -#define DEFAULT_YJERK 10.0 -#define DEFAULT_ZJERK 0.4 -#define DEFAULT_EJERK 5.0 - -/** - * 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_ENDSTOP - * - * Enable this option for a probe connected to any pin except Z-Min. - * (By default Marlin assumes the Z-Max endstop pin.) - * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. - * - * - 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. - * - * WARNING: Setting the wrong pin may have unexpected and potentially - * disastrous consequences. Use with caution and do your homework. - * - */ -//#define Z_MIN_PROBE_ENDSTOP - -/** - * 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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) - //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - -#else -// power lose detect pin and super capacitor for save data -// #define POWER_LOSS_RECOVER_SUPER_CAP 1 - -#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 DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors - -// 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. - -// -// For Z_PROBE_ALLEN_KEY see the Delta example configurations. -// - -/** - * 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 - * - * +-- BACK ---+ - * | | - * L | (+) P | R <-- probe (20,20) - * E | | I - * F | (-) N (+) | G <-- nozzle (10,10) - * T | | H - * | (-) | T - * | | - * O-- FRONT --+ - * (0,0) - */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 35 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0//10 // Y offset: -front +behind [the nozzle] -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) - -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.3 // Z offset: -below +above [the nozzle] //luojin -#else -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] //luojin - -#endif -// 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) - -// The number of probes to perform at each point. -// Set to 2 for a fast/slow probe, using the second probe result. -// Set to 3 or more for slow probes, averaging the results. -//#define MULTIPLE_PROBING 2 - -/** - * 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 Z_PROBE_OFFSET_FROM_EXTRUDER, 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 - -#if POWER_LOSS_RECOVER_SUPER_CAP -#define Z_CLEARANCE_BETWEEN_PROBES 0 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 0 // Z Clearance between multiple probes -#else -#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -#endif -//#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 - -// 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 true // 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 false - -// @section extruder - -// For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR true -#define INVERT_E1_DIR false -#define INVERT_E2_DIR false -#define INVERT_E3_DIR false -#define INVERT_E4_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 4 // (in 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 - -// The size of the print bed -#define X_BED_SIZE 300 -#define Y_BED_SIZE 300 - -// 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 400 - -/** - * 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 ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(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 false // set to true to invert the logic of the sensor. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. - #define FILAMENT_RUNOUT_SCRIPT "M600" -#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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) -#define AUTO_BED_LEVELING_BILINEAR -#endif -//#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 ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(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.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. - #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. - #endif - -#endif - -#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) - - // Set the number of grid points per dimension. - #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 - - #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 - -/** - * 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 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. - */ -//#define LCD_BED_LEVELING - -#if ENABLED(LCD_BED_LEVELING) - #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. - #define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment -#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_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). -#endif - -// Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z (4*60) - -// @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 -// -// The microcontroller can store settings in the EEPROM, e.g. max velocity... -// M500 - stores parameters in EEPROM -// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). -// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. -// -#define EEPROM_SETTINGS // Enable for M500 and M501 commands -//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. - -// -// 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_TEMP_HOTEND 180 -#define PREHEAT_1_TEMP_BED 70 -#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 - -#define PREHEAT_2_TEMP_HOTEND 240 -#define PREHEAT_2_TEMP_BED 110 -#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 } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) - #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (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 - - // Moves the nozzle to the initial position - #define NOZZLE_CLEAN_GOBACK -#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, cn, cz, cz_utf8, de, el, el-gr, es, es_utf8, - * eu, fi, fr, fr_utf8, gl, hr, it, kana, kana_utf8, nl, pl, pt, - * pt_utf8, pt-br, pt-br_utf8, ru, sk_utf8, tr, uk, zh_CN, zh_TW, test - * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cn':'Chinese', 'cz':'Czech', 'cz_utf8':'Czech (UTF8)', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'es_utf8':'Spanish (UTF8)', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'fr_utf8':'French (UTF8)', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'kana':'Japanese', 'kana_utf8':'Japanese (UTF8)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'pt-br_utf8':'Portuguese (Brazilian UTF8)', 'pt_utf8':'Portuguese (UTF8)', 'ru':'Russian', 'sk_utf8':'Slovak (UTF8)', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Taiwan)', '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 - -/** - * 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 - -/** - * 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 - -// -// 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 2 -//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 - -//============================================================================= -//======================== 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 - -// -// ULTIMAKER Controller. -// -//#define ULTIMAKERCONTROLLER - -// -// ULTIPANEL as seen on Thingiverse. -// -//#define ULTIPANEL -//#define NEWPANEL -// -// 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 - -//============================================================================= -//======================= 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 - -// -// 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 -// http://reprap.org/wiki/MKS_MINI_12864 -// -//#define MKS_MINI_12864 - -// -// 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 -// -//#define ANET_FULL_GRAPHICS_LCD // 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). - -// -// 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 - -// -// Silvergate GLCD controller -// http://github.com/android444/Silvergate -// -//#define SILVER_GATE_GLCD_CONTROLLER - -//============================================================================= -//============================ Other Controllers ============================ -//============================================================================= - -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// This requires SDSUPPORT to be enabled -// -//#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// - -// -// 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 - -//============================================================================= -//=============================== 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. -#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 - -// M240 Triggers a camera by emulating a Canon RC-1 Remote -// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ -//#define PHOTOGRAPH_PIN 23 - -// 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 - -/** - * 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 ENABLED(RGB_LED) || ENABLED(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 on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip - #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 -#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 ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(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. - */ - -#if ENABLED(BLTOUCH) - -#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. -// 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 } -#endif -// Servo deactivation -// -// With this option servos are powered only during movement, then turned off to prevent jitter. -//#define DEACTIVATE_SERVOS_AFTER_MOVE - -#endif // CONFIGURATION_H diff --git a/Marlin_thinkerV2/Marlin/Configuration_adv.h b/Marlin_thinkerV2/Marlin/Configuration_adv.h deleted file mode 100644 index 09bbe150a1..0000000000 --- a/Marlin_thinkerV2/Marlin/Configuration_adv.h +++ /dev/null @@ -1,1651 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Configuration_adv.h - * - * Advanced settings. - * Only change these if you know exactly what you're doing. - * Some of these settings can damage your printer if improperly set! - * - * Basic settings can be found in Configuration.h - * - */ -#ifndef CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H -#define CONFIGURATION_ADV_H_VERSION 010109 - -// @section temperature - -//=========================================================================== -//=============================Thermal Settings ============================ -//=========================================================================== - -// -// 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 - -#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 40 // Seconds - #define THERMAL_PROTECTION_HYSTERESIS 8 // Degrees Celsius - - /** - * 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 40 // 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 - -#if ENABLED(PIDTEMP) - // this adds an experimental additional term to the heating power, proportional to the extrusion speed. - // if Kc is chosen well, the additional required power due to increased melting should be compensated. - //#define PID_EXTRUSION_SCALING - #if ENABLED(PID_EXTRUSION_SCALING) - #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) - #define LPQ_MAX_LEN 50 - #endif -#endif - -/** - * Automatic Temperature: - * The hotend target temperature is calculated by all the buffered lines of gcode. - * The maximum buffered steps/sec of the extruder motor is called "se". - * Start autotemp mode with M109 S 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 in M114 -//#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 -#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 - -// @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 CHAMBER_AUTO_FAN_PIN -1 -#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 -#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - -/** - * 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 MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu - //#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 - -//=========================================================================== -//============================ Mechanical Settings ========================== -//=========================================================================== - -// @section homing - -// If you want endstops to stay on (by default) even when not homing -// enable this option. Override at any time with M120, M121. -//#define ENDSTOPS_ALWAYS_ON_DEFAULT - -// @section extras - -//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. - -/** - * Dual 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 - -// Enable this for dual x-carriage printers. -// A dual x-carriage design has the advantage that the inactive extruder can be parked which -// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage -// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. -//#define DUAL_X_CARRIAGE -#if ENABLED(DUAL_X_CARRIAGE) - // Configuration for second X-carriage - // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; - // the second x-carriage always homes to the maximum endstop. - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage - #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed - #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position - #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. - - // There are a few selectable movement modes for dual x-carriages using M605 S - // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results - // as long as it supports dual x-carriages. (M605 S0) - // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so - // that additional slicer support is not required. (M605 S1) - // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all - // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at - // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) - - // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - - // Default x offset in duplication mode (typically set to half print bed width) - #define DEFAULT_DUPLICATION_X_OFFSET 100 - -#endif // DUAL_X_CARRIAGE - -// 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 { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) -//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially - -// 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 - -// @section machine - -#define AXIS_RELATIVE_MODES {false, false, false, false} - -// Allow duplication mode with a basic dual-nozzle extruder -//#define DUAL_NOZZLE_DUPLICATION_MODE - -// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. -#define INVERT_X_STEP_PIN false -#define INVERT_Y_STEP_PIN false -#define INVERT_Z_STEP_PIN false -#define INVERT_E_STEP_PIN false - -// Default stepper release if idle. Set to 0 to deactivate. -// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. -// Time can be set by M18 and M84. -#define DEFAULT_STEPPER_DEACTIVE_TIME 120 -#define DISABLE_INACTIVE_X true -#define DISABLE_INACTIVE_Y true -#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. -#define DISABLE_INACTIVE_E true - -#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate -#define DEFAULT_MINTRAVELFEEDRATE 0.0 - -//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated - -// @section lcd - -#if ENABLED(ULTIPANEL) - #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel - #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 - -// If defined the movements slow down when the look ahead buffer is only half full -#define SLOWDOWN - -// Frequency limit -// See nophead's blog for more info -// Not working O -//#define XY_FREQUENCY_LIMIT 15 - -// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end -// of the buffer and all stops. This should not be much greater than zero and should only be changed -// if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) - -// -// Use Junction Deviation instead of traditional Jerk Limiting -// -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#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 - -// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. -#define MICROSTEP_MODES { 16, 16, 16, 16, 16 } // [1,2,4,8,16] - -/** - * @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, 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 - * 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 -// 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=========================== -//=========================================================================== - -#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value - -//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ -#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again - -// @section lcd - -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU - -// 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 ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - //#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 // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - -/** - * LED Control Menu - * Enable this feature to 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 // LED_CONTROL_MENU - -#if ENABLED(SDSUPPORT) - - // Some RAMPS and other boards don't detect when an SD card is inserted. You can work - // around this by connecting a push button or single throw switch to the pin defined - // as SD_DETECT_PIN in your board's pins definitions. - // This setting should be disabled unless you are using a push button, pulling the pin to ground. - // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). - #define SD_DETECT_INVERTED - - #define SD_FINISHED_STEPPERRELEASE true // 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 - - // Add an option in the menu to run all auto#.g files - //#define MENU_ADDAUTOSTART - - /** - * 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 - #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 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_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_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 - - /** - * This option allows you to abort SD printing when any endstop is triggered. - * This feature must be enabled with "M540 S1" or from the LCD menu. - * To have any effect, endstops must be enabled during SD printing. - */ - //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - - /** - * 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 - -#endif // SDSUPPORT - -/** - * 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 ENABLED(DOGLCD) - // 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 - - #if ENABLED(U8GLIB_ST7920) - /** - * 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. - */ - //#define LIGHTWEIGHT_UI - #if ENABLED(LIGHTWEIGHT_UI) - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - -#endif // DOGLCD - -// @section safety - -// The hardware watchdog should reset the microcontroller disabling all outputs, -// in case the firmware gets stuck and doesn't do temperature regulation. -#define USE_WATCHDOG - -#if ENABLED(USE_WATCHDOG) - // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. - // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. - // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. - //#define WATCHDOG_RESET_MANUAL -#endif - -// @section lcd - -/** - * Babystepping enables 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_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 BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping - #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen 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_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor -#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 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 - -#if ENABLED(MESH_BED_LEVELING) || ENABLED(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 - -// @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 N_ARC_CORRECTION 25 // Number of intertpolated 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.2 and G38.3 Probe Target -// Set MULTIPLE_PROBING if you want G38 to double touch -//#define G38_PROBE_TARGET -#if ENABLED(G38_PROBE_TARGET) - #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_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 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 - * 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_DIR_DELAY 650 - -/** - * Minimum stepper driver pulse width (in µs) - * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers - * 1 : Minimum for A4988 stepper drivers - * 1 : Minimum for LV8729 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 - * 150000 : Maximum for TB6600 stepper driver - * 130000 : Maximum for LV8729 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 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller -#else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer -#endif - -// @section serial - -// The ASCII buffer for serial input -#define MAX_CMD_SIZE 96 -#define BUFSIZE 4 - -// 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 - -#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 - -// @section extras - -/** - * 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 // ONLY PARTIALLY TESTED -#if ENABLED(FWRETRACT) - #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 RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZLIFT 0 // Default retract Z-lift - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) -#endif - -/** - * 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 - -/** - * 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 50 // (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. - - // 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) - - #define X_MAX_CURRENT 1000 // in mA - #define X_SENSE_RESISTOR 91 // in mOhms - #define X_MICROSTEPS 16 // number of microsteps - - #define X2_MAX_CURRENT 1000 - #define X2_SENSE_RESISTOR 91 - #define X2_MICROSTEPS 16 - - #define Y_MAX_CURRENT 1000 - #define Y_SENSE_RESISTOR 91 - #define Y_MICROSTEPS 16 - - #define Y2_MAX_CURRENT 1000 - #define Y2_SENSE_RESISTOR 91 - #define Y2_MICROSTEPS 16 - - #define Z_MAX_CURRENT 1000 - #define Z_SENSE_RESISTOR 91 - #define Z_MICROSTEPS 16 - - #define Z2_MAX_CURRENT 1000 - #define Z2_SENSE_RESISTOR 91 - #define Z2_MICROSTEPS 16 - - #define E0_MAX_CURRENT 1000 - #define E0_SENSE_RESISTOR 91 - #define E0_MICROSTEPS 16 - - #define E1_MAX_CURRENT 1000 - #define E1_SENSE_RESISTOR 91 - #define E1_MICROSTEPS 16 - - #define E2_MAX_CURRENT 1000 - #define E2_SENSE_RESISTOR 91 - #define E2_MICROSTEPS 16 - - #define E3_MAX_CURRENT 1000 - #define E3_SENSE_RESISTOR 91 - #define E3_MICROSTEPS 16 - - #define E4_MAX_CURRENT 1000 - #define E4_SENSE_RESISTOR 91 - #define E4_MICROSTEPS 16 - -#endif // TMC26X - -// @section tmc_smart - -/** - * To use TMC2130 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. - * - * You'll also need the TMC2130Stepper Arduino library - * (https://github.com/teemuatlut/TMC2130Stepper). - * - * 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. - * - * You'll also need the TMC2208Stepper Arduino library - * (https://github.com/teemuatlut/TMC2208Stepper). - */ -#if HAS_TRINAMIC - - #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 - #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current - #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 - - #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. - #define X_MICROSTEPS 16 // 0..256 - - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - - /** - * Use software SPI for TMC2130. - * 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 - - /** - * Use Trinamic's ultra quiet stepping mode. - * When disabled, Marlin will use spreadCycle stepping mode. - */ - #define STEALTHCHOP - - /** - * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, - * like overtemperature and short to ground. TMC2208 requires hardware serial. - * 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 S0/1 - 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 - - /** - * 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 needs to be enabled. - * 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 E0_HYBRID_THRESHOLD 30 - #define E1_HYBRID_THRESHOLD 30 - #define E2_HYBRID_THRESHOLD 30 - #define E3_HYBRID_THRESHOLD 30 - #define E4_HYBRID_THRESHOLD 30 - - /** - * Use stallGuard2 to sense an obstacle and trigger an endstop. - * You need to place a wire from the 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_HOMING_SENSITIVITY is used for tuning the trigger sensitivity. - * Higher values make the system LESS sensitive. - * Lower value make the system MORE sensitive. - * Too low values can lead to false positives, while too high values will collide the axis without triggering. - * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. - * M914 X/Y/Z to live tune the setting - */ - //#define SENSORLESS_HOMING // TMC2130 only - - #if ENABLED(SENSORLESS_HOMING) - #define X_HOMING_SENSITIVITY 8 - #define Y_HOMING_SENSITIVITY 8 - #define Z_HOMING_SENSITIVITY 8 - #endif - - /** - * Enable M122 debugging command for TMC stepper drivers. - * M122 S0/1 will enable continous reporting. - */ - //#define TMC_DEBUG - - /** - * M915 Z Axis Calibration - * - * - Adjust Z stepper current, - * - Drive the Z axis to its physical maximum, and - * - Home Z to account for the lost steps. - * - * Use M915 Snn to specify the current. - * Use M925 Znn to add extra Z height to Z_MAX_POS. - */ - //#define TMC_Z_CALIBRATION - #if ENABLED(TMC_Z_CALIBRATION) - #define CALIBRATION_CURRENT 250 - #define CALIBRATION_EXTRA_HEIGHT 10 - #endif - - /** - * 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/TMC2130Stepper - * https://github.com/teemuatlut/TMC2208Stepper - * - * Example: - * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ - * } - */ - #define TMC_ADV() { } - -#endif // TMC2130 || TMC2208 - -// @section L6470 - -/** - * L6470 Stepper Driver options - * - * The Arduino-L6470 library is required for this stepper driver. - * https://github.com/ameyer/Arduino-L6470 - */ -#if HAS_DRIVER(L6470) - - #define X_MICROSTEPS 16 // number of microsteps - #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off - #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall - - #define X2_MICROSTEPS 16 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - - #define Y_MICROSTEPS 16 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - - #define Y2_MICROSTEPS 16 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - - #define Z_MICROSTEPS 16 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - - #define Z2_MICROSTEPS 16 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - - #define E0_MICROSTEPS 16 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - - #define E1_MICROSTEPS 16 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - - #define E2_MICROSTEPS 16 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - - #define E3_MICROSTEPS 16 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - - #define E4_MICROSTEPS 16 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - -#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 - -/** - * 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_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed - #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 // delay in milliseconds to allow the spindle/laser to come up to speed/power - #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction - - /** - * 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 - - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% -#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 - -/** - * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - */ -//#define PINS_DEBUGGING - -/** - * Auto-report temperatures with M155 S - */ -#define AUTO_REPORT_TEMPERATURES - -/** - * Include capabilities in M115 output - */ -#define EXTENDED_CAPABILITIES_REPORT - -/** - * 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 - -/** - * User-defined menu items that execute custom GCode - */ -//#define CUSTOM_USER_MENUS -#if ENABLED(CUSTOM_USER_MENUS) - #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 PLA" - #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) - - #define USER_DESC_3 "Preheat for ABS" - #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 - -/** - * Specify an action command to send to the host when the printer is killed. - * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. - * The host must be configured to handle the action command. - */ -//#define ACTION_ON_KILL "poweroff" - -/** - * Specify an action command to send to the host on pause and resume. - * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. - * The host must be configured to handle the action command. - */ -//#define ACTION_ON_PAUSE "pause" -//#define ACTION_ON_RESUME "resume" - -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - -/** - * 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/ - * - * Reilabuild 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 behaviour. - - #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 - -/** - * 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 - /** - * 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 behaviour is limited to Z axis only. -#endif - -// Enable Marlin dev mode which adds some special commands -//#define MARLIN_DEV_MODE - -#endif // CONFIGURATION_ADV_H diff --git a/Marlin_thinkerV2/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin_thinkerV2/Marlin/G26_Mesh_Validation_Tool.cpp deleted file mode 100644 index 8a3f951c8c..0000000000 --- a/Marlin_thinkerV2/Marlin/G26_Mesh_Validation_Tool.cpp +++ /dev/null @@ -1,920 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Marlin Firmware -- G26 - Mesh Validation Tool - */ - -#include "MarlinConfig.h" - -#if ENABLED(G26_MESH_VALIDATION) - - #include "Marlin.h" - #include "planner.h" - #include "stepper.h" - #include "temperature.h" - #include "ultralcd.h" - #include "parser.h" - #include "serial.h" - #include "bitmap_flags.h" - - #if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" - #elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" - #endif - - #define EXTRUSION_MULTIPLIER 1.0 - #define RETRACTION_MULTIPLIER 1.0 - #define PRIME_LENGTH 10.0 - #define OOZE_AMOUNT 0.3 - - #define INTERSECTION_CIRCLE_RADIUS 5 - #define CROSSHAIRS_SIZE 3 - - #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS - #error "CROSSHAIRS_SIZE must be less than INTERSECTION_CIRCLE_RADIUS." - #endif - - #define G26_OK false - #define G26_ERR true - - /** - * G26 Mesh Validation Tool - * - * G26 is a Mesh Validation Tool intended to provide support for the Marlin Unified Bed Leveling System. - * In order to fully utilize and benefit from the Marlin Unified Bed Leveling System an accurate Mesh must - * be defined. G29 is designed to allow the user to quickly validate the correctness of her Mesh. It will - * first heat the bed and nozzle. It will then print lines and circles along the Mesh Cell boundaries and - * the intersections of those lines (respectively). - * - * This action allows the user to immediately see where the Mesh is properly defined and where it needs to - * be edited. The command will generate the Mesh lines closest to the nozzle's starting position. Alternatively - * the user can specify the X and Y position of interest with command parameters. This allows the user to - * focus on a particular area of the Mesh where attention is needed. - * - * B # Bed Set the Bed Temperature. If not specified, a default of 60 C. will be assumed. - * - * C Current When searching for Mesh Intersection points to draw, use the current nozzle location - * as the base for any distance comparison. - * - * D Disable Disable the Unified Bed Leveling System. In the normal case the user is invoking this - * command to see how well a Mesh as been adjusted to match a print surface. In order to do - * this the Unified Bed Leveling System is turned on by the G26 command. The D parameter - * alters the command's normal behaviour and disables the Unified Bed Leveling System even if - * it is on. - * - * H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed. - * - * F # Filament Used to specify the diameter of the filament being used. If not specified - * 1.75mm filament is assumed. If you are not getting acceptable results by using the - * 'correct' numbers, you can scale this number up or down a little bit to change the amount - * of filament that is being extruded during the printing of the various lines on the bed. - * - * K Keep-On Keep the heaters turned on at the end of the command. - * - * L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used. - * - * O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This - * is over kill, but using this parameter will let you get the very first 'circle' perfect - * so you have a trophy to peel off of the bed and hang up to show how perfectly you have your - * Mesh calibrated. If not specified, a filament length of .3mm is assumed. - * - * P # Prime Prime the nozzle with specified length of filament. If this parameter is not - * given, no prime action will take place. If the parameter specifies an amount, that much - * will be purged before continuing. If no amount is specified the command will start - * purging filament until the user provides an LCD Click and then it will continue with - * printing the Mesh. You can carefully remove the spent filament with a needle nose - * pliers while holding the LCD Click wheel in a depressed state. If you do not have - * an LCD, you must specify a value if you use P. - * - * Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and - * un-retraction is at 1.2mm These numbers will be scaled by the specified amount - * - * R # Repeat Prints the number of patterns given as a parameter, starting at the current location. - * If a parameter isn't given, every point will be printed unless G26 is interrupted. - * This works the same way that the UBL G29 P4 R parameter works. - * - * NOTE: If you do not have an LCD, you -must- specify R. This is to ensure that you are - * aware that there's some risk associated with printing without the ability to abort in - * cases where mesh point Z value may be inaccurate. As above, if you do not include a - * parameter, every point will be printed. - * - * S # Nozzle Used to control the size of nozzle diameter. If not specified, a .4mm nozzle is assumed. - * - * U # Random Randomize the order that the circles are drawn on the bed. The search for the closest - * undrawn cicle is still done. But the distance to the location for each circle has a - * random number of the size specified added to it. Specifying S50 will give an interesting - * deviation from the normal behaviour on a 10 x 10 Mesh. - * - * X # X Coord. Specify the starting location of the drawing activity. - * - * Y # Y Coord. Specify the starting location of the drawing activity. - */ - - // External references - - extern Planner planner; - - // Private functions - - static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16]; - float g26_e_axis_feedrate = 0.025, - random_deviation = 0.0; - - static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched - // retracts/recovers won't result in a bad state. - - static float g26_extrusion_multiplier, - g26_retraction_multiplier, - g26_layer_height, - g26_prime_length, - g26_x_pos, g26_y_pos; - - static int16_t g26_bed_temp, - g26_hotend_temp; - - static int8_t g26_prime_flag; - - #if ENABLED(ULTIPANEL) - - /** - * If the LCD is clicked, cancel, wait for release, return true - */ - bool user_canceled() { - if (!is_lcd_clicked()) return false; // Return if the button isn't pressed - lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99); - #if ENABLED(ULTIPANEL) - lcd_quick_feedback(true); - #endif - wait_for_release(); - return true; - } - - bool exit_from_g26() { - lcd_setstatusPGM(PSTR("Leaving G26"), -1); - wait_for_release(); - return G26_ERR; - } - - #endif - - 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.max_feedrate_mm_s[Z_AXIS]/(3.0); // Base the feed rate off of the configured Z_AXIS 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); - 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 ? PLANNER_XY_FEEDRATE() / 10.0 : planner.max_feedrate_mm_s[E_AXIS] / 1.5; - - if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value); - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - destination[E_AXIS] += e_delta; - - G26_line_to_destination(feed_value); - set_destination_from_current(); - } - - FORCE_INLINE void move_to(const float where[XYZE], const float &de) { move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], de); } - - void retract_filament(const float where[XYZE]) { - if (!g26_retracted) { // Only retract if we are not already retracted! - g26_retracted = true; - move_to(where, -1.0 * g26_retraction_multiplier); - } - } - - void recover_filament(const float where[XYZE]) { - if (g26_retracted) { // Only un-retract if we are retracted. - move_to(where, 1.2 * g26_retraction_multiplier); - g26_retracted = false; - } - } - - /** - * Prime the nozzle if needed. Return true on error. - */ - inline bool prime_nozzle() { - - #if ENABLED(ULTIPANEL) - float Total_Prime = 0.0; - - if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged - - lcd_external_control = true; - lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99); - lcd_chirp(); - - set_destination_from_current(); - - recover_filament(destination); // Make sure G26 doesn't think the filament is retracted(). - - while (!is_lcd_clicked()) { - lcd_chirp(); - destination[E_AXIS] += 0.25; - #ifdef PREVENT_LENGTHY_EXTRUDE - Total_Prime += 0.25; - if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; - #endif - G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); - 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 - // to stop as quickly. So we put up with the less smooth - // action to give the user a more responsive 'Stop'. - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - wait_for_release(); - - lcd_setstatusPGM(PSTR("Done Priming"), 99); - lcd_quick_feedback(true); - lcd_external_control = false; - } - else - #endif - { - #if ENABLED(ULTRA_LCD) - lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99); - lcd_quick_feedback(true); - #endif - set_destination_from_current(); - destination[E_AXIS] += g26_prime_length; - G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0); - set_destination_from_current(); - retract_filament(destination); - } - - return G26_OK; - } - - mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { - float closest = 99999.99; - mesh_index_pair return_val; - - return_val.x_index = return_val.y_index = -1; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (!is_bitmap_set(circle_flags, i, j)) { - const float mx = _GET_MESH_X(i), // We found a circle that needs to be printed - my = _GET_MESH_Y(j); - - // Get the distance to this intersection - float f = HYPOT(X - mx, Y - my); - - // It is possible that we are being called with the values - // to let us find the closest circle to the start position. - // But if this is not the case, add a small weighting to the - // distance calculation to help it choose a better place to continue. - f += HYPOT(g26_x_pos - mx, g26_y_pos - my) / 15.0; - - // Add in the specified amount of Random Noise to our search - if (random_deviation > 1.0) - f += random(0.0, random_deviation); - - if (f < closest) { - closest = f; // We found a closer location that is still - return_val.x_index = i; // un-printed --- save the data for it - return_val.y_index = j; - return_val.distance = closest; - } - } - } - } - bitmap_set(circle_flags, return_val.x_index, return_val.y_index); // Mark this location as done. - return return_val; - } - - /** - * print_line_from_here_to_there() takes two cartesian coordinates and draws a line from one - * to the other. But there are really three sets of coordinates involved. The first coordinate - * is the present location of the nozzle. We don't necessarily want to print from this location. - * We first need to move the nozzle to the start of line segment where we want to print. Once - * there, we can use the two coordinates supplied to draw the line. - * - * Note: Although we assume the first set of coordinates is the start of the line and the second - * set of coordinates is the end of the line, it does not always work out that way. This function - * optimizes the movement to minimize the travel distance before it can start printing. This saves - * a lot of time and eliminates a lot of nonsensical movement of the nozzle. However, it does - * cause a lot of very little short retracement of th nozzle when it draws the very first line - * segment of a 'circle'. The time this requires is very short and is easily saved by the other - * cases where the optimization comes into play. - */ - void print_line_from_here_to_there(const float &sx, const float &sy, const float &sz, const float &ex, const float &ey, const float &ez) { - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual line segment - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s), // We don't need to do a sqrt(), we can compare the distance^2 - // to save computation time - dx_e = current_position[X_AXIS] - ex, // find our distance from the end of the actual line segment - dy_e = current_position[Y_AXIS] - ey, - dist_end = HYPOT2(dx_e, dy_e), - - line_length = HYPOT(ex - sx, ey - sy); - - // If the end point of the line is closer to the nozzle, flip the direction, - // moving from the end to the start. On very small lines the optimization isn't worth it. - if (dist_end < dist_start && (INTERSECTION_CIRCLE_RADIUS) < ABS(line_length)) - return print_line_from_here_to_there(ex, ey, ez, sx, sy, sz); - - // Decide whether to retract & bump - - if (dist_start > 2.0) { - retract_filament(destination); - //todo: parameterize the bump height with a define - move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping - move_to(sx, sy, sz + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - move_to(sx, sy, sz, 0.0); // Get to the starting point with no extrusion / un-Z bump - - const float e_pos_delta = line_length * g26_e_axis_feedrate * g26_extrusion_multiplier; - - recover_filament(destination); - move_to(ex, ey, ez, e_pos_delta); // Get to the ending point with an appropriate amount of extrusion - } - - inline bool look_for_lines_to_connect() { - float sx, sy, ex, ey; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - #if ENABLED(ULTIPANEL) - if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation - #endif - - if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X. - // This is already a half circle because we are at the edge of the bed. - - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i + 1, j)) { // check if we can do a line to the left - if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) { - - // - // We found two circles that need a horizontal line to connect them - // Print it! - // - sx = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge - ex = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // left edge - - sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1); - sy = ey = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1); - ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1); - - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) { - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" Connecting with horizontal line (sx=", sx); - SERIAL_ECHOPAIR(", sy=", sy); - SERIAL_ECHOPAIR(") -> (ex=", ex); - SERIAL_ECHOPAIR(", ey=", ey); - SERIAL_CHAR(')'); - SERIAL_EOL(); - //debug_current_and_destination(PSTR("Connecting horizontal line.")); - } - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); - } - bitmap_set(horizontal_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if we skipped it - } - } - - if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y. - // This is already a half circle because we are at the edge of the bed. - - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i, j + 1)) { // check if we can do a line straight down - if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) { - // - // We found two circles that need a vertical line to connect them - // Print it! - // - sy = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge - ey = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // bottom edge - - sx = ex = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1); - sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1); - ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1); - - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) { - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" Connecting with vertical line (sx=", sx); - SERIAL_ECHOPAIR(", sy=", sy); - SERIAL_ECHOPAIR(") -> (ex=", ex); - SERIAL_ECHOPAIR(", ey=", ey); - SERIAL_CHAR(')'); - SERIAL_EOL(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - debug_current_and_destination(PSTR("Connecting vertical line.")); - #endif - } - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); - } - bitmap_set(vertical_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if skipped - } - } - } - } - } - } - return false; - } - - /** - * Turn on the bed and nozzle heat and - * wait for them to get up to temperature. - */ - inline bool turn_on_heaters() { - millis_t next = millis() + 5000UL; - #if HAS_HEATED_BED - #if ENABLED(ULTRA_LCD) - if (g26_bed_temp > 25) { - lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99); - lcd_quick_feedback(true); - #if ENABLED(ULTIPANEL) - lcd_external_control = true; - #endif - #endif - thermalManager.setTargetBed(g26_bed_temp); - while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) { - - #if ENABLED(ULTIPANEL) - if (is_lcd_clicked()) return exit_from_g26(); - #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); - } - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - #if ENABLED(ULTRA_LCD) - } - lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99); - lcd_quick_feedback(true); - #endif - #endif - - // Start heating the nozzle and wait for it to reach temperature. - thermalManager.setTargetHotend(g26_hotend_temp, 0); - while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { - - #if ENABLED(ULTIPANEL) - if (is_lcd_clicked()) return exit_from_g26(); - #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); - } - idle(); - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - #if ENABLED(ULTRA_LCD) - lcd_reset_status(); - lcd_quick_feedback(true); - #endif - - 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. - * - * Used to interactively edit the mesh by placing the - * nozzle in a problem area and doing a G29 P4 R command. - * - * Parameters: - * - * B Bed Temperature - * C Continue from the Closest mesh point - * D Disable leveling before starting - * F Filament diameter - * H Hotend Temperature - * K Keep heaters on when completed - * L Layer Height - * O Ooze extrusion length - * P Prime length - * Q Retraction multiplier - * R Repetitions (number of grid points) - * S Nozzle Size (diameter) in mm - * U Random deviation (50 if no value given) - * X X position - * Y Y position - */ - void gcode_G26() { - SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s)."); - - // Don't allow Mesh Validation without homing first, - // or if the parameter parsing did not go OK, abort - if (axis_unhomed_error()) return; - - g26_extrusion_multiplier = EXTRUSION_MULTIPLIER; - g26_retraction_multiplier = RETRACTION_MULTIPLIER; - g26_layer_height = MESH_TEST_LAYER_HEIGHT; - g26_prime_length = PRIME_LENGTH; - g26_bed_temp = MESH_TEST_BED_TEMP; - g26_hotend_temp = MESH_TEST_HOTEND_TEMP; - g26_prime_flag = 0; - - float g26_nozzle = MESH_TEST_NOZZLE_SIZE, - g26_filament_diameter = DEFAULT_NOMINAL_FILAMENT_DIA, - g26_ooze_amount = parser.linearval('O', OOZE_AMOUNT); - - bool g26_continue_with_closest = parser.boolval('C'), - g26_keep_heaters_on = parser.boolval('K'); - - if (parser.seenval('B')) { - g26_bed_temp = parser.value_celsius(); - if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) { - SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C)."); - return; - } - } - - if (parser.seenval('L')) { - g26_layer_height = parser.value_linear_units(); - if (!WITHIN(g26_layer_height, 0.0, 2.0)) { - SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible."); - return; - } - } - - if (parser.seen('Q')) { - if (parser.has_value()) { - g26_retraction_multiplier = parser.value_float(); - if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) { - SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible."); - return; - } - } - else { - SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified."); - return; - } - } - - if (parser.seenval('S')) { - g26_nozzle = parser.value_float(); - if (!WITHIN(g26_nozzle, 0.1, 1.0)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible."); - return; - } - } - - if (parser.seen('P')) { - if (!parser.has_value()) { - #if ENABLED(ULTIPANEL) - g26_prime_flag = -1; - #else - SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD."); - return; - #endif - } - else { - g26_prime_flag++; - g26_prime_length = parser.value_linear_units(); - if (!WITHIN(g26_prime_length, 0.0, 25.0)) { - SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible."); - return; - } - } - } - - if (parser.seenval('F')) { - g26_filament_diameter = parser.value_linear_units(); - if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) { - SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible."); - return; - } - } - g26_extrusion_multiplier *= sq(1.75) / sq(g26_filament_diameter); // If we aren't using 1.75mm filament, we need to - // scale up or down the length needed to get the - // same volume of filament - - g26_extrusion_multiplier *= g26_filament_diameter * sq(g26_nozzle) / sq(0.3); // Scale up by nozzle size - - if (parser.seenval('H')) { - g26_hotend_temp = parser.value_celsius(); - if (!WITHIN(g26_hotend_temp, 165, 280)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible."); - return; - } - } - - if (parser.seen('U')) { - randomSeed(millis()); - // This setting will persist for the next G26 - random_deviation = parser.has_value() ? parser.value_float() : 50.0; - } - - int16_t g26_repeats; - #if ENABLED(ULTIPANEL) - g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); - #else - if (!parser.seen('R')) { - SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD."); - return; - } - else - g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; - #endif - if (g26_repeats < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1."); - return; - } - - g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS]; - g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS]; - if (!position_is_reachable(g26_x_pos, g26_y_pos)) { - SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds."); - return; - } - - /** - * Wait until all parameters are verified before altering the state! - */ - set_bed_leveling_enabled(!parser.seen('D')); - - if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - set_current_from_destination(); - } - - if (turn_on_heaters() != G26_OK) goto LEAVE; - - current_position[E_AXIS] = 0.0; - sync_plan_position_e(); - - if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE; - - /** - * Bed is preheated - * - * Nozzle is at temperature - * - * Filament is primed! - * - * It's "Show Time" !!! - */ - - ZERO(circle_flags); - ZERO(horizontal_mesh_line_flags); - ZERO(vertical_mesh_line_flags); - - // Move nozzle to the specified height for the first layer - set_destination_from_current(); - destination[Z_AXIS] = g26_layer_height; - move_to(destination, 0.0); - move_to(destination, g26_ooze_amount); - - #if ENABLED(ULTIPANEL) - lcd_external_control = true; - #endif - - //debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern.")); - - #if DISABLED(ARC_SUPPORT) - - /** - * Pre-generate radius offset values at 30 degree intervals to reduce CPU load. - */ - #define A_INT 30 - #define _ANGS (360 / A_INT) - #define A_CNT (_ANGS / 2) - #define _IND(A) ((A + _ANGS * 8) % _ANGS) - #define _COS(A) (trig_table[_IND(A) % A_CNT] * (_IND(A) >= A_CNT ? -1 : 1)) - #define _SIN(A) (-_COS((A + A_CNT / 2) % _ANGS)) - #if A_CNT & 1 - #error "A_CNT must be a positive value. Please change A_INT." - #endif - float trig_table[A_CNT]; - for (uint8_t i = 0; i < A_CNT; i++) - trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * A_INT)); - - #endif // !ARC_SUPPORT - - mesh_index_pair location; - do { - location = g26_continue_with_closest - ? find_closest_circle_to_print(current_position[X_AXIS], current_position[Y_AXIS]) - : find_closest_circle_to_print(g26_x_pos, g26_y_pos); // Find the closest Mesh Intersection to where we are now. - - if (location.x_index >= 0 && location.y_index >= 0) { - const float circle_x = _GET_MESH_X(location.x_index), - circle_y = _GET_MESH_Y(location.y_index); - - // If this mesh location is outside the printable_radius, skip it. - if (!position_is_reachable(circle_x, circle_y)) continue; - - // Determine where to start and end the circle, - // which is always drawn counter-clockwise. - const uint8_t xi = location.x_index, yi = location.y_index; - const bool f = yi == 0, r = xi >= GRID_MAX_POINTS_X - 1, b = yi >= GRID_MAX_POINTS_Y - 1; - - #if ENABLED(ARC_SUPPORT) - - #define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2) - float sx = circle_x + INTERSECTION_CIRCLE_RADIUS, // default to full circle - ex = circle_x + INTERSECTION_CIRCLE_RADIUS, - sy = circle_y, ey = circle_y, - arc_length = ARC_LENGTH(4); - - // Figure out where to start and end the arc - we always print counterclockwise - if (xi == 0) { // left edge - sx = f ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = b ? circle_x + INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - ey = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (r) { // right edge - sx = b ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - ex = f ? circle_x - INTERSECTION_CIRCLE_RADIUS : circle_x; - sy = b ? circle_y : circle_y + INTERSECTION_CIRCLE_RADIUS; - ey = f ? circle_y : circle_y - INTERSECTION_CIRCLE_RADIUS; - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (f) { - sx = circle_x + INTERSECTION_CIRCLE_RADIUS; - ex = circle_x - INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - else if (b) { - sx = circle_x - INTERSECTION_CIRCLE_RADIUS; - ex = circle_x + INTERSECTION_CIRCLE_RADIUS; - sy = ey = circle_y; - arc_length = ARC_LENGTH(2); - } - const float arc_offset[2] = { - circle_x - sx, - circle_y - sy - }; - - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual circle - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s); - const float endpoint[XYZE] = { - ex, ey, - g26_layer_height, - current_position[E_AXIS] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier) - }; - - if (dist_start > 2.0) { - retract_filament(destination); - //todo: parameterize the bump height with a define - move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping - move_to(sx, sy, g26_layer_height + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - 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; - plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc - feedrate_mm_s = save_feedrate; - set_destination_from_current(); - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - #else // !ARC_SUPPORT - - int8_t start_ind = -2, end_ind = 9; // Assume a full circle (from 5:00 to 5:00) - if (xi == 0) { // Left edge? Just right half. - start_ind = f ? 0 : -3; // 03:00 to 12:00 for front-left - end_ind = b ? 0 : 2; // 06:00 to 03:00 for back-left - } - else if (r) { // Right edge? Just left half. - start_ind = b ? 6 : 3; // 12:00 to 09:00 for front-right - end_ind = f ? 5 : 8; // 09:00 to 06:00 for back-right - } - else if (f) { // Front edge? Just back half. - start_ind = 0; // 03:00 - end_ind = 5; // 09:00 - } - else if (b) { // Back edge? Just front half. - start_ind = 6; // 09:00 - end_ind = 11; // 03:00 - } - - for (int8_t ind = start_ind; ind <= end_ind; ind++) { - - #if ENABLED(ULTIPANEL) - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - float rx = circle_x + _COS(ind), // For speed, these are now a lookup table entry - ry = circle_y + _SIN(ind), - xe = circle_x + _COS(ind + 1), - ye = circle_y + _SIN(ind + 1); - - #if IS_KINEMATIC - // Check to make sure this segment is entirely on the bed, skip if not. - if (!position_is_reachable(rx, ry) || !position_is_reachable(xe, ye)) continue; - #else // not, we need to skip - rx = constrain(rx, X_MIN_POS + 1, X_MAX_POS - 1); // This keeps us from bumping the endstops - ry = constrain(ry, Y_MIN_POS + 1, Y_MAX_POS - 1); - xe = constrain(xe, X_MIN_POS + 1, X_MAX_POS - 1); - ye = constrain(ye, Y_MIN_POS + 1, Y_MAX_POS - 1); - #endif - - print_line_from_here_to_there(rx, ry, g26_layer_height, xe, ye, g26_layer_height); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - #endif // !ARC_SUPPORT - - if (look_for_lines_to_connect()) goto LEAVE; - } - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - - } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); - - LEAVE: - lcd_setstatusPGM(PSTR("Leaving G26"), -1); - - retract_filament(destination); - destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; - - //debug_current_and_destination(PSTR("ready to do Z-Raise.")); - move_to(destination, 0); // Raise the nozzle - //debug_current_and_destination(PSTR("done doing Z-Raise.")); - - destination[X_AXIS] = g26_x_pos; // Move back to the starting position - destination[Y_AXIS] = g26_y_pos; - //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is - - move_to(destination, 0); // Move back to the starting position - //debug_current_and_destination(PSTR("done doing X/Y move.")); - - #if ENABLED(ULTIPANEL) - lcd_external_control = false; // Give back control of the LCD Panel! - #endif - - if (!g26_keep_heaters_on) { - #if HAS_HEATED_BED - thermalManager.setTargetBed(0); - #endif - thermalManager.setTargetHotend(0, 0); - } - } - -#endif // G26_MESH_VALIDATION diff --git a/Marlin_thinkerV2/Marlin/HAL.h b/Marlin_thinkerV2/Marlin/HAL.h deleted file mode 100644 index d5f79cd0f7..0000000000 --- a/Marlin_thinkerV2/Marlin/HAL.h +++ /dev/null @@ -1,337 +0,0 @@ -/* ************************************************************************** - - Marlin 3D Printer Firmware - Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - - Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - - 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 . -****************************************************************************/ - -/** - * Description: HAL for __AVR__ - */ - -#ifndef _HAL_AVR_H_ -#define _HAL_AVR_H_ - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "fastio.h" - -#include -#include -#include -#include -#include -#include -#include - -// -------------------------------------------------------------------------- -// Defines -// -------------------------------------------------------------------------- - -//#define analogInputToDigitalPin(IO) IO - -// Bracket code that shouldn't be interrupted -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli() - #define CRITICAL_SECTION_END SREG = _sreg -#endif - -#define ISRS_ENABLED() TEST(SREG, SREG_I) -#define ENABLE_ISRS() sei() -#define DISABLE_ISRS() cli() - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -typedef uint16_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFF - -typedef int8_t pin_t; - -#define HAL_SERVO_LIB Servo - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -//extern uint8_t MCUSR; - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -//void cli(void); - -//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; } - -// eeprom -//void eeprom_write_byte(unsigned char *pos, unsigned char value); -//unsigned char eeprom_read_byte(unsigned char *pos); - -// timers -#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz - -#define STEP_TIMER_NUM 1 -#define TEMP_TIMER_NUM 0 -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0) - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE -#define STEPPER_TIMER_PRESCALE 8 -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A) -#define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A) - -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - -FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - UNUSED(frequency); - switch (timer_num) { - case STEP_TIMER_NUM: - // waveform generation = 0100 = CTC - SET_WGM(1, CTC_OCRnA); - - // output mode = 00 (disconnected) - SET_COMA(1, NORMAL); - - // Set the timer pre-scaler - // Generally we use a divider of 8, resulting in a 2MHz timer - // frequency on a 16MHz MCU. If you are going to change this, be - // sure to regenerate speed_lookuptable.h with - // create_speed_lookuptable.py - SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler - - // Init Stepper ISR to 122 Hz for quick starting - // (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency - OCR1A = 0x4000; - TCNT1 = 0; - break; - - case TEMP_TIMER_NUM: - // Use timer0 for temperature measurement - // Interleave temperature interrupt with millies interrupt - OCR0B = 128; - break; - } -} - -#define TIMER_OCR_1 OCR1A -#define TIMER_COUNTER_1 TCNT1 - -#define TIMER_OCR_0 OCR0A -#define TIMER_COUNTER_0 TCNT0 - -#define _CAT(a, ...) a ## __VA_ARGS__ -#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare) -#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer) -#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer) - -/** - * On AVR there is no hardware prioritization and preemption of - * interrupts, so this emulates it. The UART has first priority - * (otherwise, characters will be lost due to UART overflow). - * Then: Stepper, Endstops, Temperature, and -finally- all others. - */ -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) - -/* 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) { \ - __asm__ __volatile__ ( \ - A("push r16") /* 2 Save R16 */ \ - A("in r16, __SREG__") /* 1 Get SREG */ \ - A("push r16") /* 2 Save SREG into stack */ \ - A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \ - A("push r16") /* 2 Save TIMSK0 into the stack */ \ - A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \ - A("sts %[timsk0], r16") /* 2 And set the new value */ \ - A("lds r16, %[timsk1]") /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \ - A("andi r16,~%[msk1]") /* 1 Disable the stepper ISR */ \ - A("sts %[timsk1], r16") /* 2 And set the new value */ \ - A("push r16") /* 2 Save TIMSK1 into stack */ \ - A("in r16, 0x3B") /* 1 Get RAMPZ register */ \ - A("push r16") /* 2 Save RAMPZ into stack */ \ - A("in r16, 0x3C") /* 1 Get EIND register */ \ - A("push r0") /* C runtime can modify all the following registers without restoring them */ \ - A("push r1") \ - A("push r18") \ - A("push r19") \ - A("push r20") \ - A("push r21") \ - A("push r22") \ - A("push r23") \ - A("push r24") \ - A("push r25") \ - A("push r26") \ - A("push r27") \ - A("push r30") \ - A("push r31") \ - A("clr r1") /* C runtime expects this register to be 0 */ \ - A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \ - A("pop r31") \ - A("pop r30") \ - A("pop r27") \ - A("pop r26") \ - A("pop r25") \ - A("pop r24") \ - A("pop r23") \ - A("pop r22") \ - A("pop r21") \ - A("pop r20") \ - A("pop r19") \ - A("pop r18") \ - A("pop r1") \ - A("pop r0") \ - A("out 0x3C, r16") /* 1 Restore EIND register */ \ - A("pop r16") /* 2 Get the original RAMPZ register value */ \ - A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \ - A("pop r16") /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \ - A("ori r16,%[msk1]") /* 1 Reenable the stepper ISR */ \ - A("cli") /* 1 Disable global interrupts - Reenabling Stepper ISR can reenter amd temperature can reenter, and we want that, if it happens, after this ISR has ended */ \ - A("sts %[timsk1], r16") /* 2 And restore the old value - This reenables the stepper ISR */ \ - A("pop r16") /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \ - A("sts %[timsk0], r16") /* 2 And restore the old value - This reenables the temperature ISR */ \ - A("pop r16") /* 2 Get the old SREG value */ \ - A("out __SREG__, r16") /* 1 And restore the SREG value */ \ - A("pop r16") /* 2 Restore R16 value */ \ - A("reti") /* 4 Return from interrupt */ \ - : \ - : [timsk0] "i" ((uint16_t)&TIMSK0), \ - [timsk1] "i" ((uint16_t)&TIMSK1), \ - [msk0] "M" ((uint8_t)(1< 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#else - #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#endif - -#define HAL_READ_ADC() ADC -#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) - -#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 HAL_SENSITIVE_PINS 0, 1 - -#endif // _HAL_AVR_H_ diff --git a/Marlin_thinkerV2/Marlin/I2CPositionEncoder.cpp b/Marlin_thinkerV2/Marlin/I2CPositionEncoder.cpp deleted file mode 100644 index 285ba0d66f..0000000000 --- a/Marlin_thinkerV2/Marlin/I2CPositionEncoder.cpp +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -//todo: add support for multiple encoders on a single axis -//todo: add z axis auto-leveling -//todo: consolidate some of the related M codes? -//todo: add endstop-replacement mode? -//todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; -//todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial - - -#include "MarlinConfig.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - - #include "Marlin.h" - #include "temperature.h" - #include "stepper.h" - #include "I2CPositionEncoder.h" - #include "parser.h" - - #include - - - void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) { - encoderAxis = axis; - i2cAddress = address; - - initialised++; - - SERIAL_ECHOPAIR("Setting up encoder on ", axis_codes[encoderAxis]); - SERIAL_ECHOLNPAIR(" axis, addr = ", address); - - position = get_position(); - } - - void I2CPositionEncoder::update() { - if (!initialised || !homed || !active) return; //check encoder is set up and active - - position = get_position(); - - //we don't want to stop things just because the encoder missed a message, - //so we only care about responses that indicate bad magnetic strength - - if (!passes_test(false)) { //check encoder data is good - lastErrorTime = millis(); - /* - if (trusted) { //commented out as part of the note below - trusted = false; - SERIAL_ECHOPGM("Fault detected on "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder. Disengaging error correction until module is trusted again."); - } - */ - return; - } - - if (!trusted) { - /** - * This is commented out because it introduces error and can cause bad print quality. - * - * This code is intended to manage situations where the encoder has reported bad magnetic strength. - * This indicates that the magnetic strip was too far away from the sensor to reliably track position. - * When this happens, this code resets the offset based on where the printer thinks it is. This has been - * shown to introduce errors in actual position which result in drifting prints and poor print quality. - * Perhaps a better method would be to disable correction on the axis with a problem, report it to the - * user via the status leds on the encoder module and prompt the user to re-home the axis at which point - * the encoder would be re-enabled. - */ - - /* - // If the magnetic strength has been good for a certain time, start trusting the module again - - if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) { - trusted = true; - - SERIAL_ECHOPGM("Untrusted encoder module on "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis has been fault-free for set duration, reinstating error correction."); - - //the encoder likely lost its place when the error occured, so we'll reset and use the printer's - //idea of where it the axis is to re-initialise - float position = planner.get_axis_position_mm(encoderAxis); - int32_t positionInTicks = position * get_ticks_unit(); - - //shift position from previous to current position - zeroOffset -= (positionInTicks - get_position()); - - #ifdef I2CPE_DEBUG - SERIAL_ECHOPGM("Current position is "); - SERIAL_ECHOLN(position); - - SERIAL_ECHOPGM("Position in encoder ticks is "); - SERIAL_ECHOLN(positionInTicks); - - SERIAL_ECHOPGM("New zero-offset of "); - SERIAL_ECHOLN(zeroOffset); - - SERIAL_ECHOPGM("New position reads as "); - SERIAL_ECHO(get_position()); - SERIAL_CHAR('('); - SERIAL_ECHO(mm_from_count(get_position())); - SERIAL_ECHOLNPGM(")"); - #endif - } - */ - return; - } - - lastPosition = position; - const millis_t positionTime = millis(); - - //only do error correction if setup and enabled - if (ec && ecMethod != I2CPE_ECM_NONE) { - - #ifdef I2CPE_EC_THRESH_PROPORTIONAL - const millis_t deltaTime = positionTime - lastPositionTime; - const uint32_t distance = ABS(position - lastPosition), - speed = distance / deltaTime; - const float threshold = constrain((speed / 50), 1, 50) * ecThreshold; - #else - const float threshold = get_error_correct_threshold(); - #endif - - //check error - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - float sum = 0, diffSum = 0; - - errIdx = (errIdx >= I2CPE_ERR_ARRAY_SIZE - 1) ? 0 : errIdx + 1; - err[errIdx] = get_axis_error_steps(false); - - LOOP_L_N(i, I2CPE_ERR_ARRAY_SIZE) { - sum += err[i]; - if (i) diffSum += ABS(err[i-1] - err[i]); - } - - const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); //calculate average for error - - #else - const int32_t error = get_axis_error_steps(false); - #endif - - //SERIAL_ECHOPGM("Axis error steps: "); - //SERIAL_ECHOLN(error); - - #ifdef I2CPE_ERR_THRESH_ABORT - if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.axis_steps_per_mm[encoderAxis]) { - //kill("Significant Error"); - SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!"); - SERIAL_ECHOLN(error); - safe_delay(5000); - } - #endif - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - if (errIdx == 0) { - // In order to correct for "error" but avoid correcting for noise and non-skips - // it must be > threshold and have a difference average of < 10 and be < 2000 steps - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis] && - diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && ABS(error) < 2000) { // Check for persistent error (skip) - errPrst[errPrstIdx++] = error; // Error must persist for I2CPE_ERR_PRST_ARRAY_SIZE error cycles. This also serves to improve the average accuracy - 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))); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis]); - SERIAL_ECHOLNPGM("mm; correcting!"); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(errorP); - errPrstIdx = 0; - } - } - else - errPrstIdx = 0; - } - #else - if (ABS(error) > threshold * planner.axis_steps_per_mm[encoderAxis]) { - //SERIAL_ECHOLN(error); - //SERIAL_ECHOLN(position); - thermalManager.babystepsTodo[encoderAxis] = -LROUND(error / 2); - } - #endif - - if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.axis_steps_per_mm[encoderAxis]) { - const millis_t ms = millis(); - if (ELAPSED(ms, nextErrorCountTime)) { - SERIAL_ECHOPAIR("Large error on ", axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis. error: ", (int)error); - SERIAL_ECHOLNPAIR("; diffSum: ", diffSum); - errorCount++; - nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS; - } - } - } - - lastPositionTime = positionTime; - } - - void I2CPositionEncoder::set_homed() { - if (active) { - reset(); // Reset module's offset to zero (so current position is homed / zero) - delay(10); - - zeroOffset = get_raw_count(); - homed++; - trusted++; - - #ifdef I2CPE_DEBUG - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis encoder homed, offset of ", zeroOffset); - SERIAL_ECHOLNPGM(" ticks."); - #endif - } - } - - bool I2CPositionEncoder::passes_test(const bool report) { - if (report) { - if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. "); - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPGM(" axis "); - serialprintPGM(H == I2CPE_MAG_SIG_BAD ? PSTR("magnetic strip ") : PSTR("encoder ")); - switch (H) { - case I2CPE_MAG_SIG_GOOD: - case I2CPE_MAG_SIG_MID: - SERIAL_ECHOLNPGM("passes test; field strength "); - serialprintPGM(H == I2CPE_MAG_SIG_GOOD ? PSTR("good.\n") : PSTR("fair.\n")); - break; - default: - SERIAL_ECHOLNPGM("not detected!"); - } - } - return (H == I2CPE_MAG_SIG_GOOD || H == I2CPE_MAG_SIG_MID); - } - - float I2CPositionEncoder::get_axis_error_mm(const bool report) { - float target, actual, error; - - target = planner.get_axis_position_mm(encoderAxis); - actual = mm_from_count(position); - error = actual - target; - - if (ABS(error) > 10000) error = 0; // ? - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis target: ", target); - SERIAL_ECHOPAIR(", actual: ", actual); - SERIAL_ECHOLNPAIR(", error : ",error); - } - - return error; - } - - int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) { - if (!active) { - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder not active!"); - } - return 0; - } - - float stepperTicksPerUnit; - int32_t encoderTicks = position, encoderCountInStepperTicksScaled; - //int32_t stepperTicks = stepper.position(encoderAxis); - - // With a rotary encoder we're concerned with ticks/rev; whereas with a linear we're concerned with ticks/mm - stepperTicksPerUnit = (type == I2CPE_ENC_TYPE_ROTARY) ? stepperTicks : planner.axis_steps_per_mm[encoderAxis]; - - //convert both 'ticks' into same units / base - encoderCountInStepperTicksScaled = LROUND((stepperTicksPerUnit * encoderTicks) / encoderTicksPerUnit); - - int32_t target = stepper.position(encoderAxis), - error = (encoderCountInStepperTicksScaled - target); - - //suppress discontinuities (might be caused by bad I2C readings...?) - const bool suppressOutput = (ABS(error - errorPrev) > 100); - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOPAIR(" axis target: ", target); - SERIAL_ECHOPAIR(", actual: ", encoderCountInStepperTicksScaled); - SERIAL_ECHOLNPAIR(", error : ", error); - - if (suppressOutput) SERIAL_ECHOLNPGM("Discontinuity detected, suppressing error."); - } - - errorPrev = error; - - return (suppressOutput ? 0 : error); - } - - int32_t I2CPositionEncoder::get_raw_count() { - uint8_t index = 0; - i2cLong encoderCount; - - encoderCount.val = 0x00; - - if (Wire.requestFrom((int)i2cAddress, 3) != 3) { - //houston, we have a problem... - H = I2CPE_MAG_SIG_NF; - return 0; - } - - while (Wire.available()) - encoderCount.bval[index++] = (uint8_t)Wire.read(); - - //extract the magnetic strength - H = (B00000011 & (encoderCount.bval[2] >> 6)); - - //extract sign bit; sign = (encoderCount.bval[2] & B00100000); - //set all upper bits to the sign value to overwrite H - encoderCount.val = (encoderCount.bval[2] & B00100000) ? (encoderCount.val | 0xFFC00000) : (encoderCount.val & 0x003FFFFF); - - if (invert) encoderCount.val *= -1; - - return encoderCount.val; - } - - bool I2CPositionEncoder::test_axis() { - //only works on XYZ cartesian machines for the time being - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) return false; - - float startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; - - const float startPosition = soft_endstop_min[encoderAxis] + 10, - endPosition = soft_endstop_max[encoderAxis] - 10, - feedrate = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); - - ec = false; - - LOOP_NA(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.synchronize(); - - // if the module isn't currently trusted, wait until it is (or until it should be if things are working) - if (!trusted) { - int32_t startWaitingTime = millis(); - while (!trusted && millis() - startWaitingTime < I2CPE_TIME_TRUSTED) - safe_delay(500); - } - - 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.synchronize(); - } - - return trusted; - } - - void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { - if (type != I2CPE_ENC_TYPE_LINEAR) { - SERIAL_ECHOLNPGM("Steps per mm calibration is only available using linear encoders."); - return; - } - - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) { - SERIAL_ECHOLNPGM("Automatic steps / mm calibration not supported for this axis."); - return; - } - - float old_steps_mm, new_steps_mm, - startDistance, endDistance, - 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); - - bool oldec = ec; - ec = false; - - startDistance = 20; - endDistance = soft_endstop_max[encoderAxis] - 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); - } - - startCoord[encoderAxis] = startDistance; - endCoord[encoderAxis] = endDistance; - - planner.synchronize(); - - 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.synchronize(); - - delay(250); - startCount = get_position(); - - //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.synchronize(); - - //Read encoder distance - delay(250); - stopCount = get_position(); - - travelledDistance = mm_from_count(ABS(stopCount - startCount)); - - SERIAL_ECHOPAIR("Attempted to travel: ", travelDistance); - SERIAL_ECHOLNPGM("mm."); - - SERIAL_ECHOPAIR("Actually travelled: ", travelledDistance); - SERIAL_ECHOLNPGM("mm."); - - //Calculate new axis steps per unit - old_steps_mm = planner.axis_steps_per_mm[encoderAxis]; - new_steps_mm = (old_steps_mm * travelDistance) / travelledDistance; - - SERIAL_ECHOLNPAIR("Old steps per mm: ", old_steps_mm); - SERIAL_ECHOLNPAIR("New steps per mm: ", new_steps_mm); - - //Save new value - planner.axis_steps_per_mm[encoderAxis] = new_steps_mm; - - if (iter > 1) { - total += new_steps_mm; - - // swap start and end points so next loop runs from current position - float tempCoord = startCoord[encoderAxis]; - startCoord[encoderAxis] = endCoord[encoderAxis]; - endCoord[encoderAxis] = tempCoord; - } - } - - if (iter > 1) { - total /= (float)iter; - SERIAL_ECHOLNPAIR("Average steps per mm: ", total); - } - - ec = oldec; - - SERIAL_ECHOLNPGM("Calculated steps per mm has been set. Please save to EEPROM (M500) if you wish to keep these values."); - } - - void I2CPositionEncoder::reset() { - Wire.beginTransmission(i2cAddress); - Wire.write(I2CPE_RESET_COUNT); - Wire.endTransmission(); - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - ZERO(err); - #endif - } - - - bool I2CPositionEncodersMgr::I2CPE_anyaxis; - uint8_t I2CPositionEncodersMgr::I2CPE_addr, - I2CPositionEncodersMgr::I2CPE_idx; - I2CPositionEncoder I2CPositionEncodersMgr::encoders[I2CPE_ENCODER_CNT]; - - void I2CPositionEncodersMgr::init() { - Wire.begin(); - - #if I2CPE_ENCODER_CNT > 0 - uint8_t i = 0; - - encoders[i].init(I2CPE_ENC_1_ADDR, I2CPE_ENC_1_AXIS); - - #ifdef I2CPE_ENC_1_TYPE - encoders[i].set_type(I2CPE_ENC_1_TYPE); - #endif - #ifdef I2CPE_ENC_1_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_1_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_1_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_1_TICKS_REV); - #endif - #ifdef I2CPE_ENC_1_INVERT - encoders[i].set_inverted(I2CPE_ENC_1_INVERT); - #endif - #ifdef I2CPE_ENC_1_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_1_EC_METHOD); - #endif - #ifdef I2CPE_ENC_1_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_1_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_1_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 1 - i++; - - encoders[i].init(I2CPE_ENC_2_ADDR, I2CPE_ENC_2_AXIS); - - #ifdef I2CPE_ENC_2_TYPE - encoders[i].set_type(I2CPE_ENC_2_TYPE); - #endif - #ifdef I2CPE_ENC_2_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_2_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_2_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_2_TICKS_REV); - #endif - #ifdef I2CPE_ENC_2_INVERT - encoders[i].set_inverted(I2CPE_ENC_2_INVERT); - #endif - #ifdef I2CPE_ENC_2_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_2_EC_METHOD); - #endif - #ifdef I2CPE_ENC_2_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_2_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_2_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 2 - i++; - - encoders[i].init(I2CPE_ENC_3_ADDR, I2CPE_ENC_3_AXIS); - - #ifdef I2CPE_ENC_3_TYPE - encoders[i].set_type(I2CPE_ENC_3_TYPE); - #endif - #ifdef I2CPE_ENC_3_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_3_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_3_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_3_TICKS_REV); - #endif - #ifdef I2CPE_ENC_3_INVERT - encoders[i].set_inverted(I2CPE_ENC_3_INVERT); - #endif - #ifdef I2CPE_ENC_3_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_3_EC_METHOD); - #endif - #ifdef I2CPE_ENC_3_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_3_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_3_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 3 - i++; - - encoders[i].init(I2CPE_ENC_4_ADDR, I2CPE_ENC_4_AXIS); - - #ifdef I2CPE_ENC_4_TYPE - encoders[i].set_type(I2CPE_ENC_4_TYPE); - #endif - #ifdef I2CPE_ENC_4_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_4_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_4_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_4_TICKS_REV); - #endif - #ifdef I2CPE_ENC_4_INVERT - encoders[i].set_inverted(I2CPE_ENC_4_INVERT); - #endif - #ifdef I2CPE_ENC_4_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_4_EC_METHOD); - #endif - #ifdef I2CPE_ENC_4_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_4_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_4_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 4 - i++; - - encoders[i].init(I2CPE_ENC_5_ADDR, I2CPE_ENC_5_AXIS); - - #ifdef I2CPE_ENC_5_TYPE - encoders[i].set_type(I2CPE_ENC_5_TYPE); - #endif - #ifdef I2CPE_ENC_5_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_5_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_5_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_5_TICKS_REV); - #endif - #ifdef I2CPE_ENC_5_INVERT - encoders[i].set_inverted(I2CPE_ENC_5_INVERT); - #endif - #ifdef I2CPE_ENC_5_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_5_EC_METHOD); - #endif - #ifdef I2CPE_ENC_5_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_5_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_5_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - } - - void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units, const bool noOffset) { - CHECK_IDX(); - - if (units) - SERIAL_ECHOLN(noOffset ? encoders[idx].mm_from_count(encoders[idx].get_raw_count()) : encoders[idx].get_position_mm()); - else { - if (noOffset) { - const int32_t raw_count = encoders[idx].get_raw_count(); - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_CHAR(' '); - - for (uint8_t j = 31; j > 0; j--) - SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j))); - - SERIAL_ECHO((bool)(0x00000001 & raw_count)); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(raw_count); - } - else - SERIAL_ECHOLN(encoders[idx].get_position()); - } - } - - void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const uint8_t newaddr) { - // First check 'new' address is not in use - Wire.beginTransmission(newaddr); - if (!Wire.endTransmission()) { - SERIAL_ECHOPAIR("?There is already a device with that address on the I2C bus! (", newaddr); - SERIAL_ECHOLNPGM(")"); - return; - } - - // Now check that we can find the module on the oldaddr address - Wire.beginTransmission(oldaddr); - if (Wire.endTransmission()) { - SERIAL_ECHOPAIR("?No module detected at this address! (", oldaddr); - SERIAL_ECHOLNPGM(")"); - return; - } - - SERIAL_ECHOPAIR("Module found at ", oldaddr); - SERIAL_ECHOLNPAIR(", changing address to ", newaddr); - - // Change the modules address - Wire.beginTransmission(oldaddr); - Wire.write(I2CPE_SET_ADDR); - Wire.write(newaddr); - Wire.endTransmission(); - - SERIAL_ECHOLNPGM("Address changed, resetting and waiting for confirmation.."); - - // Wait for the module to reset (can probably be improved by polling address with a timeout). - safe_delay(I2CPE_REBOOT_TIME); - - // Look for the module at the new address. - Wire.beginTransmission(newaddr); - if (Wire.endTransmission()) { - SERIAL_ECHOLNPGM("Address change failed! Check encoder module."); - return; - } - - SERIAL_ECHOLNPGM("Address change successful!"); - - // Now, if this module is configured, find which encoder instance it's supposed to correspond to - // and enable it (it will likely have failed initialisation on power-up, before the address change). - const int8_t idx = idx_from_addr(newaddr); - if (idx >= 0 && !encoders[idx].get_active()) { - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again."); - encoders[idx].set_active(encoders[idx].passes_test(true)); - } - } - - void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) { - // First check there is a module - Wire.beginTransmission(address); - if (Wire.endTransmission()) { - SERIAL_ECHOPAIR("?No module detected at this address! (", address); - SERIAL_ECHOLNPGM(")"); - return; - } - - SERIAL_ECHOPAIR("Requesting version info from module at address ", address); - SERIAL_ECHOLNPGM(":"); - - Wire.beginTransmission(address); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_VERSION); - Wire.endTransmission(); - - // Read value - if (Wire.requestFrom((int)address, 32)) { - char c; - while (Wire.available() > 0 && (c = (char)Wire.read()) > 0) - SERIAL_ECHO(c); - SERIAL_EOL(); - } - - // Set module back to normal (distance) mode - Wire.beginTransmission(address); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_DISTANCE); - Wire.endTransmission(); - } - - int8_t I2CPositionEncodersMgr::parse() { - I2CPE_addr = 0; - - if (parser.seen('A')) { - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?A seen, but no address specified! [30-200]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_addr = parser.value_byte(); - if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 - SERIAL_PROTOCOLLNPGM("?Address out of range. [30-200]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_idx = idx_from_addr(I2CPE_addr); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPGM("?No device with this address!"); - return I2CPE_PARSE_ERR; - } - } - else if (parser.seenval('I')) { - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1); - SERIAL_PROTOCOLLNPGM("]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_idx = parser.value_byte(); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1); - SERIAL_ECHOLNPGM("]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_addr = encoders[I2CPE_idx].get_address(); - } - else - I2CPE_idx = 0xFF; - - I2CPE_anyaxis = parser.seen_axis(); - - return I2CPE_PARSE_OK; - }; - - /** - * M860: Report the position(s) of position encoder module(s). - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * O Include homed zero-offset in returned position. - * U Units in mm or raw step count. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M860() { - if (parse()) return; - - const bool hasU = parser.seen('U'), hasO = parser.seen('O'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_position(idx, hasU, hasO); - } - } - } - else - report_position(I2CPE_idx, hasU, hasO); - } - - /** - * M861: Report the status of position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M861() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_status(idx); - } - } - } - else - report_status(I2CPE_idx); - } - - /** - * M862: Perform an axis continuity test for position encoder - * modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M862() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) test_axis(idx); - } - } - } - else - test_axis(I2CPE_idx); - } - - /** - * M863: Perform steps-per-mm calibration for - * position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * P Number of rePeats/iterations. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ - void I2CPositionEncodersMgr::M863() { - if (parse()) return; - - const uint8_t iterations = constrain(parser.byteval('P', 1), 1, 10); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations); - } - } - } - else - calibrate_steps_mm(I2CPE_idx, iterations); - } - - /** - * M864: Change position encoder module I2C address. - * - * A Module current/old I2C address. If not present, - * assumes default address (030). [30, 200]. - * S Module new I2C address. [30, 200]. - * - * If S is not specified: - * X Use I2CPE_PRESET_ADDR_X (030). - * Y Use I2CPE_PRESET_ADDR_Y (031). - * Z Use I2CPE_PRESET_ADDR_Z (032). - * E Use I2CPE_PRESET_ADDR_E (033). - */ - void I2CPositionEncodersMgr::M864() { - uint8_t newAddress; - - if (parse()) return; - - if (!I2CPE_addr) I2CPE_addr = I2CPE_PRESET_ADDR_X; - - if (parser.seen('S')) { - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?S seen, but no address specified! [30-200]"); - return; - }; - - newAddress = parser.value_byte(); - if (!WITHIN(newAddress, 30, 200)) { - SERIAL_PROTOCOLLNPGM("?New address out of range. [30-200]"); - return; - } - } - else if (!I2CPE_anyaxis) { - SERIAL_PROTOCOLLNPGM("?You must specify S or [XYZE]."); - return; - } - else { - if (parser.seen('X')) newAddress = I2CPE_PRESET_ADDR_X; - else if (parser.seen('Y')) newAddress = I2CPE_PRESET_ADDR_Y; - else if (parser.seen('Z')) newAddress = I2CPE_PRESET_ADDR_Z; - else if (parser.seen('E')) newAddress = I2CPE_PRESET_ADDR_E; - else return; - } - - SERIAL_ECHOPAIR("Changing module at address ", I2CPE_addr); - SERIAL_ECHOLNPAIR(" to address ", newAddress); - - change_module_address(I2CPE_addr, newAddress); - } - - /** - * M865: Check position encoder module firmware version. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A or I not specified: - * X Check X axis encoder, if present. - * Y Check Y axis encoder, if present. - * Z Check Z axis encoder, if present. - * E Check E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M865() { - if (parse()) return; - - if (!I2CPE_addr) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address()); - } - } - } - else - report_module_firmware(I2CPE_addr); - } - - /** - * M866: Report or reset position encoder module error - * count. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * R Reset error counter. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M866() { - if (parse()) return; - - const bool hasR = parser.seen('R'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (hasR) - reset_error_count(idx, AxisEnum(i)); - else - report_error_count(idx, AxisEnum(i)); - } - } - } - } - else if (hasR) - reset_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - else - report_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - } - - /** - * M867: Enable/disable or toggle error correction for position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * S<1|0> Enable/disable error correction. 1 enables, 0 disables. If not - * supplied, toggle. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M867() { - if (parse()) return; - - const int8_t onoff = parser.seenval('S') ? parser.value_int() : -1; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(idx, ena, AxisEnum(i)); - } - } - } - } - else { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(I2CPE_idx, ena, encoders[I2CPE_idx].get_axis()); - } - } - - /** - * M868: Report or set position encoder module error correction - * threshold. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * T New error correction threshold. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M868() { - if (parse()) return; - - const float newThreshold = parser.seenval('T') ? parser.value_float() : -9999; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (newThreshold != -9999) - set_ec_threshold(idx, newThreshold, encoders[idx].get_axis()); - else - get_ec_threshold(idx, encoders[idx].get_axis()); - } - } - } - } - else if (newThreshold != -9999) - set_ec_threshold(I2CPE_idx, newThreshold, encoders[I2CPE_idx].get_axis()); - else - get_ec_threshold(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - } - - /** - * M869: Report position encoder module error. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ - void I2CPositionEncodersMgr::M869() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_error(idx); - } - } - } - else - report_error(I2CPE_idx); - } - -#endif // I2C_POSITION_ENCODERS diff --git a/Marlin_thinkerV2/Marlin/I2CPositionEncoder.h b/Marlin_thinkerV2/Marlin/I2CPositionEncoder.h deleted file mode 100644 index a0e8a6199a..0000000000 --- a/Marlin_thinkerV2/Marlin/I2CPositionEncoder.h +++ /dev/null @@ -1,342 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef I2CPOSENC_H -#define I2CPOSENC_H - -#include "MarlinConfig.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - - #include "enum.h" - #include "macros.h" - #include "types.h" - #include - - //=========== Advanced / Less-Common Encoder Configuration Settings ========== - - #define I2CPE_EC_THRESH_PROPORTIONAL // if enabled adjusts the error correction threshold - // proportional to the current speed of the axis allows - // for very small error margin at low speeds without - // stuttering due to reading latency at high speeds - - #define I2CPE_DEBUG // enable encoder-related debug serial echos - - #define I2CPE_REBOOT_TIME 5000 // time we wait for an encoder module to reboot - // after changing address. - - #define I2CPE_MAG_SIG_GOOD 0 - #define I2CPE_MAG_SIG_MID 1 - #define I2CPE_MAG_SIG_BAD 2 - #define I2CPE_MAG_SIG_NF 255 - - #define I2CPE_REQ_REPORT 0 - #define I2CPE_RESET_COUNT 1 - #define I2CPE_SET_ADDR 2 - #define I2CPE_SET_REPORT_MODE 3 - #define I2CPE_CLEAR_EEPROM 4 - - #define I2CPE_LED_PAR_MODE 10 - #define I2CPE_LED_PAR_BRT 11 - #define I2CPE_LED_PAR_RATE 14 - - #define I2CPE_REPORT_DISTANCE 0 - #define I2CPE_REPORT_STRENGTH 1 - #define I2CPE_REPORT_VERSION 2 - - // Default I2C addresses - #define I2CPE_PRESET_ADDR_X 30 - #define I2CPE_PRESET_ADDR_Y 31 - #define I2CPE_PRESET_ADDR_Z 32 - #define I2CPE_PRESET_ADDR_E 33 - - #define I2CPE_DEF_AXIS X_AXIS - #define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X - - // Error event counter; tracks how many times there is an error exceeding a certain threshold - #define I2CPE_ERR_CNT_THRESH 3.00 - #define I2CPE_ERR_CNT_DEBOUNCE_MS 2000 - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - #define I2CPE_ERR_ARRAY_SIZE 32 - #define I2CPE_ERR_PRST_ARRAY_SIZE 10 - #endif - - // Error Correction Methods - #define I2CPE_ECM_NONE 0 - #define I2CPE_ECM_MICROSTEP 1 - #define I2CPE_ECM_PLANNER 2 - #define I2CPE_ECM_STALLDETECT 3 - - // Encoder types - #define I2CPE_ENC_TYPE_ROTARY 0 - #define I2CPE_ENC_TYPE_LINEAR 1 - - // Parser - #define I2CPE_PARSE_ERR 1 - #define I2CPE_PARSE_OK 0 - - #define LOOP_PE(VAR) LOOP_L_N(VAR, I2CPE_ENCODER_CNT) - #define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0) - - typedef union { - volatile int32_t val = 0; - uint8_t bval[4]; - } i2cLong; - - class I2CPositionEncoder { - private: - AxisEnum encoderAxis = I2CPE_DEF_AXIS; - - uint8_t i2cAddress = I2CPE_DEF_ADDR, - ecMethod = I2CPE_DEF_EC_METHOD, - type = I2CPE_DEF_TYPE, - H = I2CPE_MAG_SIG_NF; // Magnetic field strength - - int encoderTicksPerUnit = I2CPE_DEF_ENC_TICKS_UNIT, - stepperTicks = I2CPE_DEF_TICKS_REV, - errorCount = 0, - errorPrev = 0; - - float ecThreshold = I2CPE_DEF_EC_THRESH; - - bool homed = false, - trusted = false, - initialised = false, - active = false, - invert = false, - ec = true; - - int32_t zeroOffset = 0, - lastPosition = 0, - position; - - millis_t lastPositionTime = 0, - nextErrorCountTime = 0, - lastErrorTime; - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - uint8_t errIdx = 0, errPrstIdx = 0; - int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }, - errPrst[I2CPE_ERR_PRST_ARRAY_SIZE] = { 0 }; - #endif - - public: - void init(const uint8_t address, const AxisEnum axis); - void reset(); - - void update(); - - void set_homed(); - - int32_t get_raw_count(); - - FORCE_INLINE float mm_from_count(const int32_t count) { - switch (type) { - default: return -1; - case I2CPE_ENC_TYPE_LINEAR: - return count / encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (count * stepperTicks) / (encoderTicksPerUnit * planner.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); } - FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; } - - int32_t get_axis_error_steps(const bool report); - float get_axis_error_mm(const bool report); - - void calibrate_steps_mm(const uint8_t iter); - - bool passes_test(const bool report); - - bool test_axis(void); - - FORCE_INLINE int get_error_count(void) { 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 void set_active(const bool a) { active = a; } - - FORCE_INLINE void set_inverted(const bool i) { invert = i; } - - FORCE_INLINE AxisEnum get_axis() { return encoderAxis; } - - FORCE_INLINE bool get_ec_enabled() { return ec; } - FORCE_INLINE void set_ec_enabled(const bool enabled) { ec = enabled; } - - FORCE_INLINE uint8_t get_ec_method() { return ecMethod; } - FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; } - - FORCE_INLINE float get_ec_threshold() { return ecThreshold; } - FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; } - - FORCE_INLINE int get_encoder_ticks_mm() { - switch (type) { - default: return 0; - case I2CPE_ENC_TYPE_LINEAR: - return encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (int)((encoderTicksPerUnit / stepperTicks) * planner.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE int get_ticks_unit() { return encoderTicksPerUnit; } - FORCE_INLINE void set_ticks_unit(const int ticks) { encoderTicksPerUnit = ticks; } - - FORCE_INLINE uint8_t get_type() { return type; } - FORCE_INLINE void set_type(const byte newType) { type = newType; } - - FORCE_INLINE int get_stepper_ticks() { return stepperTicks; } - FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; } - }; - - class I2CPositionEncodersMgr { - private: - static bool I2CPE_anyaxis; - static uint8_t I2CPE_addr, I2CPE_idx; - - public: - - static void init(void); - - // 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 homed(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) encoders[i].set_homed(); - } - - static void report_position(const int8_t idx, const bool units, const bool noOffset); - - static void report_status(const int8_t idx) { - CHECK_IDX(); - SERIAL_ECHOPAIR("Encoder ",idx); - SERIAL_ECHOPGM(": "); - encoders[idx].get_raw_count(); - encoders[idx].passes_test(true); - } - - static void report_error(const int8_t idx) { - CHECK_IDX(); - encoders[idx].get_axis_error_steps(true); - } - - static void test_axis(const int8_t idx) { - CHECK_IDX(); - encoders[idx].test_axis(); - } - - static void calibrate_steps_mm(const int8_t idx, const int iterations) { - CHECK_IDX(); - encoders[idx].calibrate_steps_mm(iterations); - } - - static void change_module_address(const uint8_t oldaddr, const uint8_t newaddr); - static void report_module_firmware(const uint8_t address); - - static void report_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]); - SERIAL_ECHOLNPAIR(" axis is ", encoders[idx].get_error_count()); - } - - static void reset_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_error_count(0); - SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]); - SERIAL_ECHOLNPGM(" axis has been reset."); - } - - static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_ec_enabled(enabled); - SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - SERIAL_ECHOPGM(" axis is "); - serialprintPGM(encoders[idx].get_ec_enabled() ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOLNPGM("abled."); - } - - static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_ec_threshold(newThreshold); - SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis set to ", newThreshold); - SERIAL_ECHOLNPGM("mm."); - } - - static void get_ec_threshold(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - const float threshold = encoders[idx].get_ec_threshold(); - SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis is ", threshold); - SERIAL_ECHOLNPGM("mm."); - } - - static int8_t idx_from_axis(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) return i; - return -1; - } - - static int8_t idx_from_addr(const uint8_t addr) { - LOOP_PE(i) - if (encoders[i].get_address() == addr) return i; - return -1; - } - - static int8_t parse(); - - static void M860(); - static void M861(); - static void M862(); - static void M863(); - static void M864(); - static void M865(); - static void M866(); - static void M867(); - static void M868(); - static void M869(); - - static I2CPositionEncoder encoders[I2CPE_ENCODER_CNT]; - }; - - extern I2CPositionEncodersMgr I2CPEM; - - FORCE_INLINE static void gcode_M860() { I2CPEM.M860(); } - FORCE_INLINE static void gcode_M861() { I2CPEM.M861(); } - FORCE_INLINE static void gcode_M862() { I2CPEM.M862(); } - FORCE_INLINE static void gcode_M863() { I2CPEM.M863(); } - FORCE_INLINE static void gcode_M864() { I2CPEM.M864(); } - FORCE_INLINE static void gcode_M865() { I2CPEM.M865(); } - FORCE_INLINE static void gcode_M866() { I2CPEM.M866(); } - FORCE_INLINE static void gcode_M867() { I2CPEM.M867(); } - FORCE_INLINE static void gcode_M868() { I2CPEM.M868(); } - FORCE_INLINE static void gcode_M869() { I2CPEM.M869(); } - -#endif //I2C_POSITION_ENCODERS -#endif //I2CPOSENC_H diff --git a/Marlin_thinkerV2/Marlin/M100_Free_Mem_Chk.cpp b/Marlin_thinkerV2/Marlin/M100_Free_Mem_Chk.cpp deleted file mode 100644 index 9680908dc5..0000000000 --- a/Marlin_thinkerV2/Marlin/M100_Free_Mem_Chk.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * M100 Free Memory Watcher - * - * This code watches the free memory block between the bottom of the heap and the top of the stack. - * This memory block is initialized and watched via the M100 command. - * - * M100 I Initializes the free memory block and prints vitals statistics about the area - * - * M100 F Identifies how much of the free memory block remains free and unused. It also - * detects and reports any corruption within the free memory block that may have - * happened due to errant firmware. - * - * M100 D Does a hex display of the free memory block along with a flag for any errant - * data that does not match the expected value. - * - * M100 C x Corrupts x locations within the free memory block. This is useful to check the - * correctness of the M100 F and M100 D commands. - * - * Also, there are two support functions that can be called from a developer's C code. - * - * uint16_t check_for_free_memory_corruption(const char * const ptr); - * void M100_dump_routine(const char * const title, const char *start, const char *end); - * - * Initial version by Roxy-3D - */ - -#include "MarlinConfig.h" - -#if ENABLED(M100_FREE_MEMORY_WATCHER) - -#define M100_FREE_MEMORY_DUMPER // Enable for the `M100 D` Dump sub-command -#define M100_FREE_MEMORY_CORRUPTOR // Enable for the `M100 C` Corrupt sub-command - -#include "Marlin.h" -#include "parser.h" -#include "hex_print_routines.h" - -#define TEST_BYTE ((char) 0xE5) - -extern char* __brkval; -extern size_t __heap_start, __heap_end, __flp; -extern char __bss_end; - -// -// Utility functions -// - -#define END_OF_HEAP() (__brkval ? __brkval : &__bss_end) -int check_for_free_memory_corruption(const char * const title); - -// Location of a variable on its stack frame. Returns a value above -// the stack (once the function returns to the caller). -char* top_of_stack() { - char x; - return &x + 1; // x is pulled on return; -} - -// Count the number of test bytes at the specified location. -int16_t count_test_bytes(const char * const ptr) { - for (uint16_t i = 0; i < 32000; i++) - if (((char) ptr[i]) != TEST_BYTE) - return i - 1; - - return -1; -} - -// -// M100 sub-commands -// - -#if ENABLED(M100_FREE_MEMORY_DUMPER) - /** - * M100 D - * Dump the free memory block from __brkval to the stack pointer. - * malloc() eats memory from the start of the block and the stack grows - * up from the bottom of the block. Solid test bytes indicate nothing has - * used that memory yet. There should not be anything but test bytes within - * the block. If so, it may indicate memory corruption due to a bad pointer. - * Unexpected bytes are flagged in the right column. - */ - void dump_free_memory(const char *ptr, const char *sp) { - // - // Start and end the dump on a nice 16 byte boundary - // (even though the values are not 16-byte aligned). - // - ptr = (char *)((uint16_t)ptr & 0xFFF0); // Align to 16-byte boundary - sp = (char *)((uint16_t)sp | 0x000F); // Align sp to the 15th byte (at or above sp) - - // Dump command main loop - while (ptr < sp) { - print_hex_word((uint16_t)ptr); // Print the address - SERIAL_CHAR(':'); - for (uint8_t i = 0; i < 16; i++) { // and 16 data bytes - if (i == 8) SERIAL_CHAR('-'); - print_hex_byte(ptr[i]); - SERIAL_CHAR(' '); - } - safe_delay(25); - SERIAL_CHAR('|'); // Point out non test bytes - for (uint8_t i = 0; i < 16; i++) { - char ccc = (char)ptr[i]; // cast to char before automatically casting to char on assignment, in case the compiler is broken - if (&ptr[i] >= (const char*)command_queue && &ptr[i] < (const char*)(command_queue + sizeof(command_queue))) { // Print out ASCII in the command buffer area - if (!WITHIN(ccc, ' ', 0x7E)) ccc = ' '; - } - else { // If not in the command buffer area, flag bytes that don't match the test byte - ccc = (ccc == TEST_BYTE) ? ' ' : '?'; - } - SERIAL_CHAR(ccc); - } - SERIAL_EOL(); - ptr += 16; - safe_delay(25); - idle(); - } - } - -void M100_dump_routine(const char * const title, const char *start, const char *end) { - SERIAL_ECHOLN(title); - // - // Round the start and end locations to produce full lines of output - // - start = (char*)((uint16_t) start & 0xFFF0); - end = (char*)((uint16_t) end | 0x000F); - dump_free_memory(start, end); -} - -#endif // M100_FREE_MEMORY_DUMPER - -/** - * M100 F - * Return the number of free bytes in the memory pool, - * with other vital statistics defining the pool. - */ -void free_memory_pool_report(char * const ptr, const int16_t size) { - int16_t max_cnt = -1, block_cnt = 0; - char *max_addr = NULL; - // Find the longest block of test bytes in the buffer - for (int16_t i = 0; i < size; i++) { - char *addr = ptr + i; - if (*addr == TEST_BYTE) { - const int16_t j = count_test_bytes(addr); - if (j > 8) { - SERIAL_ECHOPAIR("Found ", j); - SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr)); - if (j > max_cnt) { - max_cnt = j; - max_addr = addr; - } - i += j; - block_cnt++; - } - } - } - if (block_cnt > 1) { - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - SERIAL_ECHOPAIR("\nLargest free block is ", max_cnt); - SERIAL_ECHOLNPAIR(" bytes at ", hex_address(max_addr)); - } - SERIAL_ECHOLNPAIR("check_for_free_memory_corruption() = ", check_for_free_memory_corruption("M100 F ")); -} - -#if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - /** - * M100 C - * Corrupt locations in the free memory pool and report the corrupt addresses. - * This is useful to check the correctness of the M100 D and the M100 F commands. - */ - void corrupt_free_memory(char *ptr, const uint16_t size) { - ptr += 8; - const uint16_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack. - j = near_top / (size + 1); - - SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); - for (uint16_t i = 1; i <= size; i++) { - char * const addr = ptr + i * j; - *addr = i; - SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr)); - } - SERIAL_EOL(); - } -#endif // M100_FREE_MEMORY_CORRUPTOR - -/** - * M100 I - * Init memory for the M100 tests. (Automatically applied on the first M100.) - */ -void init_free_memory(char *ptr, int16_t size) { - SERIAL_ECHOLNPGM("Initializing free memory block.\n\n"); - - size -= 250; // -250 to avoid interrupt activity that's altered the stack. - if (size < 0) { - SERIAL_ECHOLNPGM("Unable to initialize.\n"); - return; - } - - ptr += 8; // move a few bytes away from the heap just because we don't want - // to be altering memory that close to it. - memset(ptr, TEST_BYTE, size); - - SERIAL_ECHO(size); - SERIAL_ECHOLNPGM(" bytes of memory initialized.\n"); - - for (int16_t i = 0; i < size; i++) { - if (ptr[i] != TEST_BYTE) { - SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i)); - SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i])); - SERIAL_EOL(); - } - } -} - -/** - * M100: Free Memory Check - */ -void gcode_M100() { - SERIAL_ECHOPAIR("\n__brkval : ", hex_address(__brkval)); - SERIAL_ECHOPAIR("\n__bss_end : ", hex_address(&__bss_end)); - - char *ptr = END_OF_HEAP(), *sp = top_of_stack(); - - SERIAL_ECHOPAIR("\nstart of free space : ", hex_address(ptr)); - SERIAL_ECHOLNPAIR("\nStack Pointer : ", hex_address(sp)); - - // Always init on the first invocation of M100 - static bool m100_not_initialized = true; - if (m100_not_initialized || parser.seen('I')) { - m100_not_initialized = false; - init_free_memory(ptr, sp - ptr); - } - - #if ENABLED(M100_FREE_MEMORY_DUMPER) - if (parser.seen('D')) - return dump_free_memory(ptr, sp); - #endif - - if (parser.seen('F')) - return free_memory_pool_report(ptr, sp - ptr); - - #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - - if (parser.seen('C')) - return corrupt_free_memory(ptr, parser.value_int()); - - #endif -} - -int check_for_free_memory_corruption(const char * const title) { - SERIAL_ECHO(title); - - char *ptr = END_OF_HEAP(), *sp = top_of_stack(); - int n = sp - ptr; - - SERIAL_ECHOPAIR("\nfmc() n=", n); - SERIAL_ECHOPAIR("\n&__brkval: ", hex_address(&__brkval)); - SERIAL_ECHOPAIR("=", hex_address(__brkval)); - SERIAL_ECHOPAIR("\n__bss_end: ", hex_address(&__bss_end)); - SERIAL_ECHOPAIR(" sp=", hex_address(sp)); - - if (sp < ptr) { - SERIAL_ECHOPGM(" sp < Heap "); - // SET_INPUT_PULLUP(63); // if the developer has a switch wired up to their controller board - // safe_delay(5); // this code can be enabled to pause the display as soon as the - // while ( READ(63)) // malfunction is detected. It is currently defaulting to a switch - // idle(); // being on pin-63 which is unassigend and available on most controller - // safe_delay(20); // boards. - // while ( !READ(63)) - // idle(); - safe_delay(20); - #ifdef M100_FREE_MEMORY_DUMPER - M100_dump_routine(" Memory corruption detected with sp 8) { - // SERIAL_ECHOPAIR("Found ", j); - // SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(ptr + i)); - i += j; - block_cnt++; - SERIAL_ECHOPAIR(" (", block_cnt); - SERIAL_ECHOPAIR(") found=", j); - SERIAL_ECHOPGM(" "); - } - } - } - SERIAL_ECHOPAIR(" block_found=", block_cnt); - - if (block_cnt != 1 || __brkval != 0x0000) - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - - if (block_cnt == 0) // Make sure the special case of no free blocks shows up as an - block_cnt = -1; // error to the calling code! - - SERIAL_ECHOPGM(" return="); - if (block_cnt == 1) { - SERIAL_CHAR('0'); // if the block_cnt is 1, nothing has broken up the free memory - SERIAL_EOL(); // area and it is appropriate to say 'no corruption'. - return 0; - } - SERIAL_ECHOLNPGM("true"); - return block_cnt; -} - -#endif // M100_FREE_MEMORY_WATCHER - - diff --git a/Marlin_thinkerV2/Marlin/Makefile b/Marlin_thinkerV2/Marlin/Makefile deleted file mode 100644 index 68fd055ab1..0000000000 --- a/Marlin_thinkerV2/Marlin/Makefile +++ /dev/null @@ -1,686 +0,0 @@ -# Marlin Firmware Arduino Project Makefile -# -# Makefile Based on: -# Arduino 0011 Makefile -# Arduino adaptation by mellis, eighthave, oli.keller -# Marlin adaption by Daid -# -# This has been tested with Arduino 0022. -# -# This makefile allows you to build sketches from the command line -# without the Arduino environment (or Java). -# -# Detailed instructions for using the makefile: -# -# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that -# contains the Arduino installation (for example, under Mac OS X, this -# might be /Applications/Arduino.app/Contents/Resources/Java). -# -# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename -# representing the USB or serial connection to your Arduino board -# (e.g. UPLOAD_PORT = /dev/tty.USB0). If the exact name of this file -# changes, you can use * as a wild card (e.g. UPLOAD_PORT = /dev/tty.usb*). -# -# 3. Set the line containing "MCU" to match your board's processor. -# Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth -# or Diecimila have the atmega168. If you're using a LilyPad Arduino, -# change F_CPU to 8000000. If you are using Gen7 electronics, you -# probably need to use 20000000. Either way, you must regenerate -# the speed lookup table with create_speed_lookuptable.py. -# -# 4. Type "make" and press enter to compile/verify your program. -# -# 5. Type "make upload", reset your Arduino board, and press enter to -# upload your program to the Arduino board. -# -# Note that all settings at the top of this file can be overriden from -# the command line with, for example, "make HARDWARE_MOTHERBOARD=71" -# -# To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino -# -# To compile and upload simply add "upload" to the end of the line... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino upload -# -# If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or -# start upload manually (using stk500) like so: -# -# avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \ -# -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0 -# -# Or, try disconnecting USB to power down and then reconnecting before running avrdude. -# - -# This defines the board to compile for (see boards.h for your board's ID) -HARDWARE_MOTHERBOARD ?= 11 - -# Arduino source install directory, and version number -# On most linuxes this will be /usr/share/arduino -ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino -ARDUINO_VERSION ?= 106 - -# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin) -AVR_TOOLS_PATH ?= - -#Programmer configuration -UPLOAD_RATE ?= 57600 -AVRDUDE_PROGRAMMER ?= arduino -# on most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1 -UPLOAD_PORT ?= /dev/ttyUSB0 - -#Directory used to build files in, contains all the build files, from object files to the final hex file -#on linux it is best to put an absolute path like /home/username/tmp . -BUILD_DIR ?= applet - -# This defines whether Liquid_TWI2 support will be built -LIQUID_TWI2 ?= 0 - -# this defines if Wire is needed -WIRE ?= 0 - -# this defines if U8GLIB is needed (may require RELOC_WORKAROUND) -U8GLIB ?= 1 - -# this defines whether to add a workaround for the avr-gcc relocation bug -# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround -RELOC_WORKAROUND ?= 1 - -############################################################################ -# Below here nothing should be changed... - -# Here the Arduino variant is selected by the board type -# HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ... -# MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ... - -ifeq ($(HARDWARE_MOTHERBOARD),0) - - # No motherboard selected - -# -# RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -# - -# MEGA/RAMPS up to 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),3) - -# RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),33) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),34) -# RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),35) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),36) -# RAMPS 1.3 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),38) - -# RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),43) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),44) -# RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),45) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),46) -# RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),48) - -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),143) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),144) -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),145) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),146) -# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),148) - -# -# RAMPS Derivatives - ATmega1280, ATmega2560 -# - -# 3Drag Controller -else ifeq ($(HARDWARE_MOTHERBOARD),77) -# Velleman K8200 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),78) -# Velleman K8400 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),79) -# 2PrintBeta BAM&DICE with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),401) -# 2PrintBeta BAM&DICE Due with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),402) -# MKS BASE v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),40) -# MKS v1.5 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),405) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),41) -# MKS GEN v1.3 or 1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),47) -# MKS GEN L -else ifeq ($(HARDWARE_MOTHERBOARD),53) -# zrib V2.0 control board (Chinese knock off RAMPS replica) -else ifeq ($(HARDWARE_MOTHERBOARD),504) -# Felix 2.0+ Electronics Board (RAMPS like) -else ifeq ($(HARDWARE_MOTHERBOARD),37) -# Invent-A-Part RigidBoard -else ifeq ($(HARDWARE_MOTHERBOARD),42) -# Invent-A-Part RigidBoard V2 -else ifeq ($(HARDWARE_MOTHERBOARD),52) -# Sainsmart 2-in-1 board -else ifeq ($(HARDWARE_MOTHERBOARD),49) -# Ultimaker -else ifeq ($(HARDWARE_MOTHERBOARD),7) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) -else ifeq ($(HARDWARE_MOTHERBOARD),71) -MCU ?= atmega1280 -# Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),67) -# Azteeg X3 Pro -else ifeq ($(HARDWARE_MOTHERBOARD),68) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) -else ifeq ($(HARDWARE_MOTHERBOARD),72) -# Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),80) -# bq ZUM Mega 3D -else ifeq ($(HARDWARE_MOTHERBOARD),503) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake -else ifeq ($(HARDWARE_MOTHERBOARD),431) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),343) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),443) -# Creality: Ender-4, CR-8 -else ifeq ($(HARDWARE_MOTHERBOARD),243) - -# -# Other ATmega1280, ATmega2560 -# - -# Cartesio CN Controls V11 -else ifeq ($(HARDWARE_MOTHERBOARD),111) -# Cartesio CN Controls V12 -else ifeq ($(HARDWARE_MOTHERBOARD),112) -# Cheaptronic v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),2) -# Cheaptronic v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Makerbot Mightyboard Revision E -else ifeq ($(HARDWARE_MOTHERBOARD),200) -# Megatronics -else ifeq ($(HARDWARE_MOTHERBOARD),70) -# Megatronics v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),701) -# Megatronics v3.0 -else ifeq ($(HARDWARE_MOTHERBOARD),703) -# Megatronics v3.1 -else ifeq ($(HARDWARE_MOTHERBOARD),704) -# Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),301) -# Mini-Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),302) -# Mini-Rambo 1.0a -else ifeq ($(HARDWARE_MOTHERBOARD),303) -# Einsy Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),304) -# Einsy Retro -else ifeq ($(HARDWARE_MOTHERBOARD),305) -# Elefu Ra Board (v3) -else ifeq ($(HARDWARE_MOTHERBOARD),21) -# Leapfrog -else ifeq ($(HARDWARE_MOTHERBOARD),999) -# Mega controller -else ifeq ($(HARDWARE_MOTHERBOARD),310) -# abee Scoovo X9H -else ifeq ($(HARDWARE_MOTHERBOARD),321) -# Geeetech GT2560 Rev. A -else ifeq ($(HARDWARE_MOTHERBOARD),74) -# Geeetech GT2560 Rev. A+ (with auto level probe) -else ifeq ($(HARDWARE_MOTHERBOARD),75) - -# -# ATmega1281, ATmega2561 -# - -else ifeq ($(HARDWARE_MOTHERBOARD),702) -MCU ?= atmega1281 -else ifeq ($(HARDWARE_MOTHERBOARD),25) -MCU ?= atmega1281 - -# -# Sanguinololu and Derivatives - ATmega644P, ATmega1284P -# - -# Sanguinololu < 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),6) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Sanguinololu 1.2 and above -else ifeq ($(HARDWARE_MOTHERBOARD),62) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi -else ifeq ($(HARDWARE_MOTHERBOARD),63) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Melzi with ATmega1284 (MaKr3d version) -else ifeq ($(HARDWARE_MOTHERBOARD),66) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Creality3D board (for CR-10 etc) -else ifeq ($(HARDWARE_MOTHERBOARD),89) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Melzi Malyan M150 board -else ifeq ($(HARDWARE_MOTHERBOARD),92) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Tronxy X5S -else ifeq ($(HARDWARE_MOTHERBOARD),505) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# STB V1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),64) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Azteeg X1 -else ifeq ($(HARDWARE_MOTHERBOARD),65) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p -# Anet 1.0 (Melzi clone) -else ifeq ($(HARDWARE_MOTHERBOARD),69) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p - -# -# Other ATmega644P, ATmega644, ATmega1284P -# - -# Gen3 Monolithic Electronics -else ifeq ($(HARDWARE_MOTHERBOARD),22) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen3+ -else ifeq ($(HARDWARE_MOTHERBOARD),9) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Gen6 -else ifeq ($(HARDWARE_MOTHERBOARD),5) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen6 deluxe -else ifeq ($(HARDWARE_MOTHERBOARD),51) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p -# Gen7 custom (Alfons3 Version) -else ifeq ($(HARDWARE_MOTHERBOARD),10) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644 -F_CPU ?= 20000000 -# Gen7 v1.1, v1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),11) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 -# Gen7 v1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),12) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 -# Gen7 v1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),13) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega1284p -F_CPU ?= 20000000 -# Alpha OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),90) -HARDWARE_VARIANT ?= SanguinoA -MCU ?= atmega644 -# Final OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),91) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p -# Sethi 3D_1 -else ifeq ($(HARDWARE_MOTHERBOARD),20) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p - -# -# Teensyduino - AT90USB1286, AT90USB1286P -# - -# Teensylu -else ifeq ($(HARDWARE_MOTHERBOARD),8) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Printrboard (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),81) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Printrboard Revision F (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),811) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Brainwave (AT90USB646) -else ifeq ($(HARDWARE_MOTHERBOARD),82) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb646 -# Brainwave Pro (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),83) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# SAV Mk-I (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),84) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make -else ifeq ($(HARDWARE_MOTHERBOARD),85) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 -# 5DPrint D8 Driver Board -else ifeq ($(HARDWARE_MOTHERBOARD),88) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 - -endif - -# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py -# if you are setting this to something other than 16MHz -# Set to 16Mhz if not yet set. -F_CPU ?= 16000000 - -# Set to arduino, ATmega2560 if not yet set. -HARDWARE_VARIANT ?= arduino -MCU ?= atmega2560 - -# Arduino contained the main source code for the Arduino -# Libraries, the "hardware variant" are for boards -# that derives from that, and their source are present in -# the main Marlin source directory - -TARGET = $(notdir $(CURDIR)) - -# VPATH tells make to look into these directory for source files, -# there is no need to specify explicit pathnames as long as the -# directory is added here - -VPATH = . -VPATH += $(BUILD_DIR) -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino - -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src -ifeq ($(LIQUID_TWI2), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2 -endif -ifeq ($(WIRE), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -endif -ifeq ($(NEOPIXEL), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel -endif -ifeq ($(U8GLIB), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility -endif - -ifeq ($(HARDWARE_VARIANT), arduino) -HARDWARE_SUB_VARIANT ?= mega -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT) -else -ifeq ($(HARDWARE_VARIANT), Sanguino) -VPATH += $(HARDWARE_DIR)/marlin/avr/variants/sanguino -else -HARDWARE_SUB_VARIANT ?= standard -VPATH += $(HARDWARE_DIR)/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT) -endif -endif -SRC = wiring.c \ - wiring_analog.c wiring_digital.c \ - wiring_pulse.c \ - wiring_shift.c WInterrupts.c hooks.c -ifeq ($(HARDWARE_VARIANT), Teensy) -SRC = wiring.c -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy -endif -CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp Tone.cpp -CXXSRC += $(wildcard *.cpp) -ifeq ($(NEOPIXEL), 1) -CXXSRC += Adafruit_NeoPixel.cpp -endif -ifeq ($(LIQUID_TWI2), 0) -CXXSRC += LiquidCrystal.cpp -else -SRC += twi.c -CXXSRC += Wire.cpp LiquidTWI2.cpp -endif - -ifeq ($(WIRE), 1) -SRC += twi.c -CXXSRC += Wire.cpp -endif - -ifeq ($(U8GLIB), 1) -SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_data.c -endif - -ifeq ($(RELOC_WORKAROUND), 1) -LD_PREFIX=-nodefaultlibs -LD_SUFFIX=-lm -lgcc -lc -lgcc -L$(ARDUINO_INSTALL_DIR)/hardware/tools/avr/avr/lib/avr6 -l$(MCU) -endif - -#Check for Arduino 1.0.0 or higher and use the correct source files for that version -ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true) -CXXSRC += main.cpp -else -SRC += pins_arduino.c main.c -endif - -FORMAT = ihex - -# Name of this Makefile (used for "make depend"). -MAKEFILE = Makefile - -# Debugging format. -# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. -# AVR (extended) COFF requires stabs, plus an avr-objcopy run. -DEBUG = stabs - -OPT = s - -DEFINES ?= - -# Program settings -CC = $(AVR_TOOLS_PATH)avr-gcc -CXX = $(AVR_TOOLS_PATH)avr-g++ -OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy -OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump -AR = $(AVR_TOOLS_PATH)avr-ar -SIZE = $(AVR_TOOLS_PATH)avr-size -NM = $(AVR_TOOLS_PATH)avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -MV = mv -f - -# Place -D or -U options here -CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -CXXDEFS = $(CDEFS) - -ifeq ($(HARDWARE_VARIANT), Teensy) -CDEFS += -DUSB_SERIAL -SRC += usb.c pins_teensy.c -CXXSRC += usb_api.cpp -endif - -# Add all the source directories as include directories too -CINCS = ${addprefix -I ,${VPATH}} -CXXINCS = ${addprefix -I ,${VPATH}} - -# Compiler flag to set the C/CPP Standard level. -CSTANDARD = -std=gnu99 -CXXSTANDARD = -std=gnu++11 -CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -w -fsigned-char -funsigned-bitfields -fpack-struct \ - -fshort-enums -ffunction-sections -fdata-sections -flto \ - -DARDUINO=$(ARDUINO_VERSION) -ifneq ($(HARDWARE_MOTHERBOARD),) -CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} -endif -#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics - -CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) $(CSTANDARD) -CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) $(CXXSTANDARD) -#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs -LDFLAGS = -lm - - -# Programming support using avrdude. Settings and variables. -AVRDUDE_PORT = $(UPLOAD_PORT) -AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i -ifeq ($(shell uname -s), Linux) -AVRDUDE_CONF = /etc/avrdude/avrdude.conf -else -AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf -endif -AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \ - -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \ - -b$(UPLOAD_RATE) - -# Define all object files. -OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}} -OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}} -OBJ += ${patsubst %.S, $(BUILD_DIR)/%.o, ${ASRC}} - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(CXXSRC:.cpp=.lst) $(SRC:.c=.lst) - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) -ALL_CXXFLAGS = -mmcu=$(MCU) $(CXXFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) - -# set V=1 (eg, "make V=1") to print the full commands etc. -ifneq ($V,1) - Pecho=@echo - P=@ -else - Pecho=@: - P= -endif - -# Default target. -all: sizeafter - -build: $(BUILD_DIR) elf hex - -# Creates the object directory -$(BUILD_DIR): - $P mkdir -p $(BUILD_DIR) - -elf: $(BUILD_DIR)/$(TARGET).elf -hex: $(BUILD_DIR)/$(TARGET).hex -eep: $(BUILD_DIR)/$(TARGET).eep -lss: $(BUILD_DIR)/$(TARGET).lss -sym: $(BUILD_DIR)/$(TARGET).sym - -# Program the device. -# Do not try to reset an Arduino if it's not one -upload: $(BUILD_DIR)/$(TARGET).hex -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty hup < $(UPLOAD_PORT); true -endif - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty -hup < $(UPLOAD_PORT); true -endif - - # Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex -ELFSIZE = $(SIZE) --mcu=$(MCU) -C $(BUILD_DIR)/$(TARGET).elf; \ - $(SIZE) $(BUILD_DIR)/$(TARGET).elf -sizebefore: - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi - -sizeafter: build - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ - --change-section-address .data-0x800000 \ - --change-section-address .bss-0x800000 \ - --change-section-address .noinit-0x800000 \ - --change-section-address .eeprom-0x810000 - - -coff: $(BUILD_DIR)/$(TARGET).elf - $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -extcoff: $(TARGET).elf - $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -.SUFFIXES: .elf .hex .eep .lss .sym -.PRECIOUS: .o - -.elf.hex: - $(Pecho) " COPY $@" - $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -.elf.eep: - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -.elf.lss: - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -.elf.sym: - $(NM) -n $< > $@ - - # Link: create ELF output file from library. -$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h - $(Pecho) " CXX $@" - $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) - -$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ - - -# Target: clean project. -clean: - $(Pecho) " RM $(BUILD_DIR)/*" - $P $(REMOVE) $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET).cof $(BUILD_DIR)/$(TARGET).elf \ - $(BUILD_DIR)/$(TARGET).map $(BUILD_DIR)/$(TARGET).sym $(BUILD_DIR)/$(TARGET).lss $(BUILD_DIR)/$(TARGET).cpp \ - $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d) - $(Pecho) " RMDIR $(BUILD_DIR)/" - $P rm -rf $(BUILD_DIR) - - -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter - -# Automaticaly include the dependency files created by gcc --include ${wildcard $(BUILD_DIR)/*.d} diff --git a/Marlin_thinkerV2/Marlin/Marlin.h b/Marlin_thinkerV2/Marlin/Marlin.h deleted file mode 100644 index 1394c687a3..0000000000 --- a/Marlin_thinkerV2/Marlin/Marlin.h +++ /dev/null @@ -1,559 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifndef MARLIN_H -#define MARLIN_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "MarlinConfig.h" - -#ifdef DEBUG_GCODE_PARSER - #include "parser.h" -#endif - -#include "enum.h" -#include "types.h" -#include "fastio.h" -#include "utility.h" -#include "serial.h" - -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout - #endif -); - -void manage_inactivity(const bool ignore_stepper_queue=false); - -extern const char axis_codes[XYZE]; - -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - extern bool extruder_duplication_enabled; -#endif - -#if HAS_X2_ENABLE - #define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#elif HAS_X_ENABLE - #define enable_X() X_ENABLE_WRITE( X_ENABLE_ON) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#else - #define enable_X() NOOP - #define disable_X() NOOP -#endif - -#if HAS_Y2_ENABLE - #define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#elif HAS_Y_ENABLE - #define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#else - #define enable_Y() NOOP - #define disable_Y() NOOP -#endif - -#if HAS_Z2_ENABLE - #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#elif HAS_Z_ENABLE - #define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#else - #define enable_Z() NOOP - #define disable_Z() NOOP -#endif - -#if ENABLED(MIXING_EXTRUDER) - - /** - * Mixing steppers synchronize their enable (and direction) together - */ - #if MIXING_STEPPERS > 4 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 3 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 2 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } - #else - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } - #endif - #define enable_E1() NOOP - #define disable_E1() NOOP - #define enable_E2() NOOP - #define disable_E2() NOOP - #define enable_E3() NOOP - #define disable_E3() NOOP - #define enable_E4() NOOP - #define disable_E4() NOOP - -#else // !MIXING_EXTRUDER - - #if HAS_E0_ENABLE - #define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E0() NOOP - #define disable_E0() NOOP - #endif - - #if E_STEPPERS > 1 && HAS_E1_ENABLE - #define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E1() NOOP - #define disable_E1() NOOP - #endif - - #if E_STEPPERS > 2 && HAS_E2_ENABLE - #define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E2() NOOP - #define disable_E2() NOOP - #endif - - #if E_STEPPERS > 3 && HAS_E3_ENABLE - #define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E3() NOOP - #define disable_E3() NOOP - #endif - - #if E_STEPPERS > 4 && HAS_E4_ENABLE - #define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E4() NOOP - #define disable_E4() NOOP - #endif - -#endif // !MIXING_EXTRUDER - -#if ENABLED(G38_PROBE_TARGET) - extern bool G38_move, // flag to tell the interrupt handler that a G38 command is being run - G38_endstop_hit; // flag from the interrupt handler to indicate if the endstop went active -#endif - -void enable_all_steppers(); -void disable_e_stepper(const uint8_t e); -void disable_e_steppers(); -void disable_all_steppers(); - -void sync_plan_position(); -void sync_plan_position_e(); - -#if IS_KINEMATIC - void sync_plan_position_kinematic(); - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_kinematic() -#else - #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position() -#endif - -void flush_and_request_resend(); -void ok_to_send(); - -void kill(const char*); - -void quickstop_stepper(); - -extern uint8_t marlin_debug_flags; -#define DEBUGGING(F) (marlin_debug_flags & (DEBUG_## F)) - -extern bool Running; -inline bool IsRunning() { return Running; } -inline bool IsStopped() { return !Running; } - -bool enqueue_and_echo_command(const char* cmd); // Add a single command to the end of the buffer. Return false on failure. -void enqueue_and_echo_commands_P(const char * const cmd); // Set one or more commands to be prioritized over the next Serial/SD command. -void clear_command_queue(); - -#if ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(POWER_LOSS_RECOVERY) - extern char command_queue[BUFSIZE][MAX_CMD_SIZE]; -#endif - -#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))) -#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW) -#if HAS_QUEUE_NOW - // Return only when commands are actually enqueued - void enqueue_and_echo_command_now(const char* cmd); - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const cmd); - #endif -#endif - -extern millis_t previous_move_ms; -inline void reset_stepper_timeout() { previous_move_ms = millis(); } - -/** - * Feedrate scaling and conversion - */ -extern float feedrate_mm_s; -extern int16_t feedrate_percentage; - -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) - -extern bool axis_relative_modes[XYZE]; - -extern uint8_t axis_homed, axis_known_position; - -constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); -FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; } -FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; } - -extern volatile bool wait_for_heatup; - -#if HAS_RESUME_CONTINUE - extern volatile bool wait_for_user; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - extern bool suspend_auto_report; -#endif - -extern float current_position[XYZE], destination[XYZE]; - -/** - * Workspace offsets - */ -#if HAS_WORKSPACE_OFFSET - #if HAS_HOME_OFFSET - extern float home_offset[XYZ]; - #endif - #if HAS_POSITION_SHIFT - extern float position_shift[XYZ]; - #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - extern float workspace_offset[XYZ]; - #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS] - #elif HAS_HOME_OFFSET - #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS] - #elif HAS_POSITION_SHIFT - #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS] - #endif - #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS)) - #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS)) -#else - #define NATIVE_TO_LOGICAL(POS, AXIS) (POS) - #define LOGICAL_TO_NATIVE(POS, AXIS) (POS) -#endif -#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) -#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) -#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) -#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS) -#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS) -#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) - -// Hotend Offsets -#if HOTENDS > 1 - extern float hotend_offset[XYZ][HOTENDS]; -#endif - -// Software Endstops -extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ]; - -#if HAS_SOFTWARE_ENDSTOPS - extern bool soft_endstops_enabled; - void clamp_to_software_endstops(float target[XYZ]); -#else - #define soft_endstops_enabled false - #define clamp_to_software_endstops(x) NOOP -#endif - -#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) - void update_software_endstops(const AxisEnum axis); -#endif - -#define MAX_COORDINATE_SYSTEMS 9 -#if ENABLED(CNC_COORDINATE_SYSTEMS) - extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; - bool select_coordinate_system(const int8_t _new); -#endif - -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s=0.0, bool no_move=false); - -void home_all_axes(); - -void report_current_position(); - -#if IS_KINEMATIC - extern float delta[ABC]; - void inverse_kinematics(const float raw[XYZ]); -#endif - -#if ENABLED(DELTA) - extern float delta_height, - delta_endstop_adj[ABC], - delta_radius, - delta_tower_angle_trim[ABC], - delta_tower[ABC][2], - delta_diagonal_rod, - delta_calibration_radius, - delta_diagonal_rod_2_tower[ABC], - delta_segments_per_second, - delta_clip_start_height; - - void recalc_delta_settings(); - float delta_safe_distance_from_top(); - - // Macro to obtain the Z position of an individual tower - #define DELTA_Z(V,T) V[Z_AXIS] + SQRT( \ - delta_diagonal_rod_2_tower[T] - HYPOT2( \ - delta_tower[T][X_AXIS] - V[X_AXIS], \ - delta_tower[T][Y_AXIS] - V[Y_AXIS] \ - ) \ - ) - - #define DELTA_IK(V) do { \ - delta[A_AXIS] = DELTA_Z(V, A_AXIS); \ - delta[B_AXIS] = DELTA_Z(V, B_AXIS); \ - delta[C_AXIS] = DELTA_Z(V, C_AXIS); \ - }while(0) - -#elif IS_SCARA - void forward_kinematics_SCARA(const float &a, const float &b); -#endif - -#if ENABLED(G26_MESH_VALIDATION) - extern bool g26_debug_flag; -#elif ENABLED(AUTO_BED_LEVELING_UBL) - constexpr bool g26_debug_flag = false; -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #define _GET_MESH_X(I) (bilinear_start[X_AXIS] + (I) * bilinear_grid_spacing[X_AXIS]) - #define _GET_MESH_Y(J) (bilinear_start[Y_AXIS] + (J) * bilinear_grid_spacing[Y_AXIS]) -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #define _GET_MESH_X(I) ubl.mesh_index_to_xpos(I) - #define _GET_MESH_Y(J) ubl.mesh_index_to_ypos(J) -#elif ENABLED(MESH_BED_LEVELING) - #define _GET_MESH_X(I) mbl.index_to_xpos[I] - #define _GET_MESH_Y(J) mbl.index_to_ypos[J] -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - extern int bilinear_grid_spacing[2], bilinear_start[2]; - extern float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - float bilinear_z_offset(const float raw[XYZ]); -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) - typedef float (*element_2d_fn)(const uint8_t, const uint8_t); - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn); -#endif - -#if HAS_LEVELING - bool leveling_is_valid(); - void set_bed_leveling_enabled(const bool enable=true); - void reset_bed_level(); -#endif - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - void set_z_fade_height(const float zfh, const bool do_report=true); -#endif - -#if HAS_BED_PROBE - extern float zprobe_zoffset; - bool set_probe_deployed(const bool deploy); - #ifdef Z_AFTER_PROBING - void move_z_after_probing(); - #endif - enum ProbePtRaise : unsigned char { - PROBE_PT_NONE, // No raise or stow after run_z_probe - PROBE_PT_STOW, // Do a complete stow after run_z_probe - 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); - #define DEPLOY_PROBE() set_probe_deployed(true) - #define STOW_PROBE() set_probe_deployed(false) -#else - #define DEPLOY_PROBE() - #define STOW_PROBE() -#endif - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - extern MarlinBusyState busy_state; - #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0) -#else - #define KEEPALIVE_STATE(n) NOOP -#endif - -#if FAN_COUNT > 0 - extern int16_t fanSpeeds[FAN_COUNT]; - #if ENABLED(EXTRA_FAN_SPEED) - extern int16_t old_fanSpeeds[FAN_COUNT], - new_fanSpeeds[FAN_COUNT]; - #endif - #if ENABLED(PROBING_FANS_OFF) - extern bool fans_paused; - extern int16_t paused_fanSpeeds[FAN_COUNT]; - #endif -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - extern int controllerFanSpeed; -#endif - -#if ENABLED(BARICUDA) - extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure; -#endif - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - extern bool filament_sensor; // Flag that filament sensor readings should control extrusion - extern float filament_width_nominal, // Theoretical filament diameter i.e., 3.00 or 1.75 - filament_width_meas; // Measured filament diameter - extern uint8_t meas_delay_cm; // Delay distance - extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement - filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - extern int8_t did_pause_print; - extern AdvancedPauseMenuResponse advanced_pause_menu_response; - extern float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; -#endif - -#if HAS_POWER_SWITCH - extern bool powersupply_on; - #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE); powersupply_on = true; }while(0) - #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP); powersupply_on = false; }while(0) -#endif - -// Handling multiple extruders pins -extern uint8_t active_extruder; - -#if ENABLED(MIXING_EXTRUDER) - extern float mixing_factor[MIXING_STEPPERS]; -#endif - -inline void set_current_from_destination() { COPY(current_position, destination); } -inline void set_destination_from_current() { COPY(destination, current_position); } -void prepare_move_to_destination(); - -/** - * 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_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); - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const float(&cart)[XYZE], const float(&offset)[2], const bool clockwise); -#endif - -#define HAS_AXIS_UNHOMED_ERR ( \ - ENABLED(Z_PROBE_ALLEN_KEY) \ - || ENABLED(Z_PROBE_SLED) \ - || HAS_PROBING_PROCEDURE \ - || HOTENDS > 1 \ - || ENABLED(NOZZLE_CLEAN_FEATURE) \ - || ENABLED(NOZZLE_PARK_FEATURE) \ - || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \ - || HAS_M206_COMMAND \ - ) || ENABLED(NO_MOTION_BEFORE_HOMING) - -#if HAS_AXIS_UNHOMED_ERR - bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true); -#endif - -/** - * position_is_reachable family of functions - */ - -#if IS_KINEMATIC // (DELTA or SCARA) - - #if IS_SCARA - extern const float L1, L2; - #endif - - // Return true if the given point is within the printable area - inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) { - #if ENABLED(DELTA) - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset); - #elif IS_SCARA - const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); - #endif - } - - #if HAS_BED_PROBE - // 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)) - && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); - } - #endif - -#else // CARTESIAN - - // Return true if the given position is within the machine bounds. - inline bool position_is_reachable(const float &rx, const float &ry) { - // Add 0.001 margin to deal with float imprecision - return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f) - && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f); - } - - #if HAS_BED_PROBE - /** - * Return whether the given position is within the bed, and whether the nozzle - * can reach the position required to put the probe at the given position. - * - * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the - * 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 - 0.001f, MAX_PROBE_X + 0.001f) - && WITHIN(ry, MIN_PROBE_Y - 0.001f, MAX_PROBE_Y + 0.001f); - } - #endif - -#endif // CARTESIAN - -#if !HAS_BED_PROBE - FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } -#endif - -#endif // MARLIN_H diff --git a/Marlin_thinkerV2/Marlin/Marlin.ino b/Marlin_thinkerV2/Marlin/Marlin.ino deleted file mode 100644 index 1491c4efd5..0000000000 --- a/Marlin_thinkerV2/Marlin/Marlin.ino +++ /dev/null @@ -1,53 +0,0 @@ -/* -================================================================================ - - Marlin Firmware - - (c) 2011-2018 MarlinFirmware - Portions of Marlin are (c) by their respective authors. - All code complies with GPLv2 and/or GPLv3 - -================================================================================ - -Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware. - -To configure Marlin you must edit Configuration.h and Configuration_adv.h -located in the root 'Marlin' folder. Check the example_configurations folder to -see if there's a more suitable starting-point for your specific hardware. - -Before diving in, we recommend the following essential links: - -Marlin Firmware Official Website - - - http://marlinfw.org/ - The official Marlin Firmware website contains the most up-to-date - documentation. Contributions are always welcome! - -Configuration - - - https://www.youtube.com/watch?v=3gwWVFtdg-4 - A good 20-minute overview of Marlin configuration by Tom Sanladerer. - (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.) - Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin - - - http://marlinfw.org/docs/configuration/configuration.html - Marlin's configuration options are explained in more detail here. - -Getting Help - - - http://forums.reprap.org/list.php?415 - The Marlin Discussion Forum is a great place to get help from other Marlin - users who may have experienced similar issues to your own. - - - https://github.com/MarlinFirmware/Marlin/issues - With a free GitHub account you can provide us with feedback, bug reports, - and feature requests via the Marlin Issue Queue. - -Contributing - - - http://marlinfw.org/docs/development/contributing.html - If you'd like to contribute to Marlin, read this first! - - - http://marlinfw.org/docs/development/coding_standards.html - Before submitting code get to know the Coding Standards. -*/ diff --git a/Marlin_thinkerV2/Marlin/MarlinConfig.h b/Marlin_thinkerV2/Marlin/MarlinConfig.h deleted file mode 100644 index e1988fe637..0000000000 --- a/Marlin_thinkerV2/Marlin/MarlinConfig.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef MARLIN_CONFIG_H -#define MARLIN_CONFIG_H - -#include "boards.h" -#include "macros.h" -#include "Version.h" -#include "Configuration.h" -#include "Conditionals_LCD.h" -#include "drivers.h" -#include "Configuration_adv.h" - -#if USE_MARLINSERIAL - #define HardwareSerial_h // trick to disable the standard HWserial -#endif - -#include "types.h" -#include "HAL.h" -#include "pins.h" -#include "Conditionals_post.h" -#include "SanityCheck.h" -#include "enum.h" -#include "language.h" -#include "utility.h" -#include "serial.h" - -#endif // MARLIN_CONFIG_H diff --git a/Marlin_thinkerV2/Marlin/MarlinSPI.h b/Marlin_thinkerV2/Marlin/MarlinSPI.h deleted file mode 100644 index 61e85fc63c..0000000000 --- a/Marlin_thinkerV2/Marlin/MarlinSPI.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __MARLIN_SPI_H__ -#define __MARLIN_SPI_H__ - -#include -#include "softspi.h" - -template -class SPI { - static SoftSPI softSPI; - public: - FORCE_INLINE static void init() { softSPI.begin(); } - FORCE_INLINE static void send(uint8_t data) { softSPI.send(data); } - FORCE_INLINE static uint8_t receive() { return softSPI.receive(); } -}; - - -// Hardware SPI -template<> -class SPI { - public: - FORCE_INLINE static void init() { - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT(MISO_PIN); - WRITE(MISO_PIN, HIGH); - } - FORCE_INLINE static uint8_t receive() { - SPDR = 0; - while (!TEST(SPSR, SPIF)) { /* nada */ } - return SPDR; - } - -}; - -#endif // __MARLIN_SPI_H__ diff --git a/Marlin_thinkerV2/Marlin/MarlinSerial.cpp b/Marlin_thinkerV2/Marlin/MarlinSerial.cpp deleted file mode 100644 index 86d4c440ef..0000000000 --- a/Marlin_thinkerV2/Marlin/MarlinSerial.cpp +++ /dev/null @@ -1,740 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MarlinSerial.cpp - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 23 November 2006 by David A. Mellis - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - * Modified 10 June 2018 by Eduardo José Tagle (See #10991) - */ - -// Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.) - -#include "MarlinConfig.h" - -#if USE_MARLINSERIAL && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) - - #include "MarlinSerial.h" - #include "Marlin.h" - - struct ring_buffer_r { - unsigned char buffer[RX_BUFFER_SIZE]; - volatile ring_buffer_pos_t head, tail; - }; - - #if TX_BUFFER_SIZE > 0 - struct ring_buffer_t { - unsigned char buffer[TX_BUFFER_SIZE]; - volatile uint8_t head, tail; - }; - #endif - - #if UART_PRESENT(SERIAL_PORT) - ring_buffer_r rx_buffer = { { 0 }, 0, 0 }; - #if TX_BUFFER_SIZE > 0 - ring_buffer_t tx_buffer = { { 0 }, 0, 0 }; - #endif - static bool _written; - #endif - - #if ENABLED(SERIAL_XON_XOFF) - constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80, // XON / XOFF Character was sent - XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send - // XON / XOFF character definitions - constexpr uint8_t XON_CHAR = 17, XOFF_CHAR = 19; - uint8_t xon_xoff_state = XON_XOFF_CHAR_SENT | XON_CHAR; - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - uint8_t rx_dropped_bytes = 0; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - uint8_t rx_buffer_overruns = 0; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - uint8_t rx_framing_errors = 0; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - ring_buffer_pos_t rx_max_enqueued = 0; - #endif - - // A SW memory barrier, to ensure GCC does not overoptimize loops - #define sw_barrier() asm volatile("": : :"memory"); - - #if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" - #endif - - // "Atomically" read the RX head index value without disabling interrupts: - // This MUST be called with RX interrupts enabled, and CAN'T be called - // from the RX ISR itself! - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head() { - #if RX_BUFFER_SIZE > 256 - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because serial RX interrupts happen at a slower rate - // than successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - ring_buffer_pos_t vold, vnew = rx_buffer.head; - sw_barrier(); - do { - vold = vnew; - vnew = rx_buffer.head; - sw_barrier(); - } while (vold != vnew); - return vnew; - #else - // With an 8bit index, reads are always atomic. No need for special handling - return rx_buffer.head; - #endif - } - - #if RX_BUFFER_SIZE > 256 - static volatile bool rx_tail_value_not_stable = false; - static volatile uint16_t rx_tail_value_backup = 0; - #endif - - // Set RX tail index, taking into account the RX ISR could interrupt - // the write to this variable in the middle - So a backup strategy - // is used to ensure reads of the correct values. - // -Must NOT be called from the RX ISR - - FORCE_INLINE void atomic_set_rx_tail(ring_buffer_pos_t value) { - #if RX_BUFFER_SIZE > 256 - // Store the new value in the backup - rx_tail_value_backup = value; - sw_barrier(); - // Flag we are about to change the true value - rx_tail_value_not_stable = true; - sw_barrier(); - // Store the new value - rx_buffer.tail = value; - sw_barrier(); - // Signal the new value is completely stored into the value - rx_tail_value_not_stable = false; - sw_barrier(); - #else - rx_buffer.tail = value; - #endif - } - - // Get the RX tail index, taking into account the read could be - // interrupting in the middle of the update of that index value - // -Called from the RX ISR - - FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail() { - #if RX_BUFFER_SIZE > 256 - // If the true index is being modified, return the backup value - if (rx_tail_value_not_stable) return rx_tail_value_backup; - #endif - // The true index is stable, return it - return rx_buffer.tail; - } - - // (called with RX interrupts disabled) - FORCE_INLINE void store_rxd_char() { - // Get the tail - Nothing can alter its value while this ISR is executing, but there's - // a chance that this ISR interrupted the main process while it was updating the index. - // The backup mechanism ensures the correct value is always returned. - const ring_buffer_pos_t t = atomic_read_rx_tail(); - - // Get the head pointer - This ISR is the only one that modifies its value, so it's safe to read here - ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // This must read the M_UCSRxA register before reading the received byte to detect error causes - #if ENABLED(SERIAL_STATS_DROPPED_RX) - if (TEST(M_UCSRxA, M_DORx) && !++rx_dropped_bytes) --rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - if (TEST(M_UCSRxA, M_DORx) && !++rx_buffer_overruns) --rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - if (TEST(M_UCSRxA, M_FEx) && !++rx_framing_errors) --rx_framing_errors; - #endif - - // Read the character from the USART - uint8_t c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - // Calculate count of bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Keep track of the maximum count of enqueued bytes - NOLESS(rx_max_enqueued, rx_count); - #endif - - #if ENABLED(SERIAL_XON_XOFF) - // If the last char that was sent was an XON - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) { - - // Bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // If over 12.5% of RX buffer capacity, send XOFF before running out of - // RX buffer space .. 325 bytes @ 250kbits/s needed to let the host react - // and stop sending bytes. This translates to 13mS propagation time. - if (rx_count >= (RX_BUFFER_SIZE) / 8) { - - // At this point, definitely no TX interrupt was executing, since the TX ISR can't be preempted. - // Don't enable the TX interrupt here as a means to trigger the XOFF char, because if it happens - // to be in the middle of trying to disable the RX interrupt in the main program, eventually the - // enabling of the TX interrupt could be undone. The ONLY reliable thing this can do to ensure - // the sending of the XOFF char is to send it HERE AND NOW. - - // About to send the XOFF char - xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; - - // Wait until the TX register becomes empty and send it - Here there could be a problem - // - While waiting for the TX register to empty, the RX register could receive a new - // character. This must also handle that situation! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); - } - - M_UDRx = XOFF_CHAR; - - // Clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - - // At this point there could be a race condition between the write() function - // and this sending of the XOFF char. This interrupt could happen between the - // wait to be empty TX buffer loop and the actual write of the character. Since - // the TX buffer is full because it's sending the XOFF char, the only way to be - // sure the write() function will succeed is to wait for the XOFF char to be - // completely sent. Since an extra character could be received during the wait - // it must also be handled! - while (!TEST(M_UCSRxA, M_UDREx)) { - - if (TEST(M_UCSRxA,M_RXCx)) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - - // Read the character from the USART - c = M_UDRx; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(c); - #endif - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - #if ENABLED(SERIAL_STATS_DROPPED_RX) - else if (!++rx_dropped_bytes) --rx_dropped_bytes; - #endif - } - sw_barrier(); - } - - // At this point everything is ready. The write() function won't - // have any issues writing to the UART TX register if it needs to! - } - } - #endif // SERIAL_XON_XOFF - - // Store the new head value - The main loop will retry until the value is stable - rx_buffer.head = h; - } - - #if TX_BUFFER_SIZE > 0 - - // (called with TX irqs disabled) - FORCE_INLINE void _tx_udr_empty_irq(void) { - - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; - - #if ENABLED(SERIAL_XON_XOFF) - // If an XON char is pending to be sent, do it now - if (xon_xoff_state == XON_CHAR) { - - // Send the character - M_UDRx = XON_CHAR; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - - // Remember we sent it. - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - - // If nothing else to transmit, just disable TX interrupts. - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - - return; - } - #endif - - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - return; - } - - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (TX_BUFFER_SIZE - 1); - M_UDRx = c; - tx_buffer.tail = t; - - // Clear the TXC bit (by writing a one to its bit location). - // Ensures flush() won't return until the bytes are actually written/ - SBI(M_UCSRxA, M_TXCx); - - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) CBI(M_UCSRxB, M_UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - } - - #ifdef M_USARTx_UDRE_vect - ISR(M_USARTx_UDRE_vect) { _tx_udr_empty_irq(); } - #endif - - #endif // TX_BUFFER_SIZE - - #ifdef M_USARTx_RX_vect - ISR(M_USARTx_RX_vect) { store_rxd_char(); } - #endif - - // Public Methods - - void MarlinSerial::begin(const long baud) { - uint16_t baud_setting; - bool useU2X = true; - - #if F_CPU == 16000000UL && SERIAL_PORT == 0 - // Hard-coded exception for compatibility with the bootloader shipped - // with the Duemilanove and previous boards, and the firmware on the - // 8U2 on the Uno and Mega 2560. - if (baud == 57600) useU2X = false; - #endif - - if (useU2X) { - M_UCSRxA = _BV(M_U2Xx); - baud_setting = (F_CPU / 4 / baud - 1) / 2; - } - else { - M_UCSRxA = 0; - baud_setting = (F_CPU / 8 / baud - 1) / 2; - } - - // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) - M_UBRRxH = baud_setting >> 8; - M_UBRRxL = baud_setting; - - SBI(M_UCSRxB, M_RXENx); - SBI(M_UCSRxB, M_TXENx); - SBI(M_UCSRxB, M_RXCIEx); - #if TX_BUFFER_SIZE > 0 - CBI(M_UCSRxB, M_UDRIEx); - #endif - _written = false; - } - - void MarlinSerial::end() { - CBI(M_UCSRxB, M_RXENx); - CBI(M_UCSRxB, M_TXENx); - CBI(M_UCSRxB, M_RXCIEx); - CBI(M_UCSRxB, M_UDRIEx); - } - - int MarlinSerial::peek(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; - return h == t ? -1 : rx_buffer.buffer[t]; - } - - int MarlinSerial::read(void) { - 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 - ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - // Get the next char - const int v = rx_buffer.buffer[t]; - t = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); - - // Advance tail - Making sure the RX ISR will always get an stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(t); - - #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - // Get count of bytes in the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); - if (rx_count < (RX_BUFFER_SIZE) / 10) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable them - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif - } - } - #endif - - return v; - } - - ring_buffer_pos_t MarlinSerial::available(void) { - const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; - return (ring_buffer_pos_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1); - } - - void MarlinSerial::flush(void) { - - // Set the tail to the head: - // - Read the RX head index in a safe way. (See atomic_read_rx_head.) - // - Set the tail, making sure the RX ISR will always get a stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(atomic_read_rx_head()); - - #if ENABLED(SERIAL_XON_XOFF) - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - #if TX_BUFFER_SIZE > 0 - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable it. - SBI(M_UCSRxB, M_UDRIEx); - #else - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = XON_CHAR; - #endif - } - #endif - } - - #if TX_BUFFER_SIZE > 0 - void MarlinSerial::write(const uint8_t c) { - _written = true; - - // If the TX interrupts are disabled and the data register - // is empty, just write the byte to the data register and - // be done. This shortcut helps significantly improve the - // effective datarate at high (>500kbit/s) bitrates, where - // interrupt overhead becomes a slowdown. - // Yes, there is a race condition between the sending of the - // XOFF char at the RX ISR, but it is properly handled there - if (!TEST(M_UCSRxB, M_UDRIEx) && TEST(M_UCSRxA, M_UDREx)) { - M_UDRx = c; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - SBI(M_UCSRxA, M_TXCx); - return; - } - - const uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1); - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Make room by polling if it is possible to transmit, and do so! - while (i == tx_buffer.tail) { - - // If we can transmit another byte, do it. - if (TEST(M_UCSRxA, M_UDREx)) _tx_udr_empty_irq(); - - // Make sure compiler rereads tx_buffer.tail - sw_barrier(); - } - } - else { - // Interrupts are enabled, just wait until there is space - while (i == tx_buffer.tail) { sw_barrier(); } - } - - // Store new char. head is always safe to move - tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - - // Enable TX ISR - Non atomic, but it will eventually enable TX ISR - SBI(M_UCSRxB, M_UDRIEx); - } - - void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Wait until everything was transmitted - We must do polling, as interrupts are disabled - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) { - - // If there is more space, send an extra character - if (TEST(M_UCSRxA, M_UDREx)) - _tx_udr_empty_irq(); - - sw_barrier(); - } - - } - else { - // Wait until everything was transmitted - while (tx_buffer.head != tx_buffer.tail || !TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - } - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } - - #else // TX_BUFFER_SIZE == 0 - - void MarlinSerial::write(const uint8_t c) { - _written = true; - while (!TEST(M_UCSRxA, M_UDREx)) sw_barrier(); - M_UDRx = c; - } - - void MarlinSerial::flushTX(void) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // Wait until everything was transmitted - while (!TEST(M_UCSRxA, M_TXCx)) sw_barrier(); - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } - #endif // TX_BUFFER_SIZE == 0 - - /** - * Imports from print.h - */ - - void MarlinSerial::print(char c, int base) { - print((long)c, base); - } - - void MarlinSerial::print(unsigned char b, int base) { - print((unsigned long)b, base); - } - - void MarlinSerial::print(int n, int base) { - print((long)n, base); - } - - void MarlinSerial::print(unsigned int n, int base) { - print((unsigned long)n, base); - } - - void MarlinSerial::print(long n, int base) { - if (base == 0) write(n); - else if (base == 10) { - if (n < 0) { print('-'); n = -n; } - printNumber(n, 10); - } - else - printNumber(n, base); - } - - void MarlinSerial::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); - } - - void MarlinSerial::print(double n, int digits) { - printFloat(n, digits); - } - - void MarlinSerial::println(void) { - print('\r'); - print('\n'); - } - - void MarlinSerial::println(const String& s) { - print(s); - println(); - } - - void MarlinSerial::println(const char c[]) { - print(c); - println(); - } - - void MarlinSerial::println(char c, int base) { - print(c, base); - println(); - } - - void MarlinSerial::println(unsigned char b, int base) { - print(b, base); - println(); - } - - void MarlinSerial::println(int n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(unsigned int n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(long n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(unsigned long n, int base) { - print(n, base); - println(); - } - - void MarlinSerial::println(double n, int digits) { - print(n, digits); - println(); - } - - // Private Methods - - void MarlinSerial::printNumber(unsigned long n, uint8_t base) { - if (n) { - unsigned char buf[8 * sizeof(long)]; // Enough space for base 2 - int8_t i = 0; - while (n) { - buf[i++] = n % base; - n /= base; - } - while (i--) - print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10))); - } - else - print('0'); - } - - void MarlinSerial::printFloat(double number, uint8_t digits) { - // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) - rounding *= 0.1; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; - print(int_part); - - // Print the decimal point, but only if there are digits beyond - if (digits) { - print('.'); - // Extract digits from the remainder one at a time - while (digits--) { - remainder *= 10.0; - int toPrint = int(remainder); - print(toPrint); - remainder -= toPrint; - } - } - } - - // Preinstantiate - MarlinSerial customizedSerial; - -#endif // USE_MARLINSERIAL && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) - -// For AT90USB targets use the UART for BT interfacing -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) - HardwareSerial bluetoothSerial; -#endif diff --git a/Marlin_thinkerV2/Marlin/MarlinSerial.h b/Marlin_thinkerV2/Marlin/MarlinSerial.h deleted file mode 100644 index d8bd5346c6..0000000000 --- a/Marlin_thinkerV2/Marlin/MarlinSerial.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MarlinSerial.h - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - */ - -#ifndef _MARLINSERIAL_H_ -#define _MARLINSERIAL_H_ - -#include "MarlinConfig.h" - -#ifndef SERIAL_PORT - #define SERIAL_PORT 0 -#endif - -// The presence of the UBRRH register is used to detect a UART. -#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ - (port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \ - (port == 3 && defined(UBRR3H))) - -// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor -// requires two levels of indirection to expand macro values properly) -#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) -#if SERIAL_PORT == 0 && (!defined(UBRR0H) || !defined(UDR0)) // use un-numbered registers if necessary - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix -#else - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix -#endif - -// Registers used by MarlinSerial class (expanded depending on selected serial port) -#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number -#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,B) -#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,) -#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,) -#define M_TXCx SERIAL_REGNAME(TXC,SERIAL_PORT,) -#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,) -#define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,) -#define M_FEx SERIAL_REGNAME(FE,SERIAL_PORT,) -#define M_DORx SERIAL_REGNAME(DOR,SERIAL_PORT,) -#define M_UPEx SERIAL_REGNAME(UPE,SERIAL_PORT,) -#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,) -#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,) -#define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H) -#define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L) -#define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,) -#define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect) -#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,) -#define M_USARTx_UDRE_vect SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect) - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 -#define BYTE 0 - -// Define constants and variables for buffering serial data. -// Use only 0 or powers of 2 greater than 1 -// : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...] -#ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 -#endif -// 256 is the max TX buffer limit due to uint8_t head and tail. -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 -#endif - -#if USE_MARLINSERIAL - - #if RX_BUFFER_SIZE > 256 - typedef uint16_t ring_buffer_pos_t; - #else - typedef uint8_t ring_buffer_pos_t; - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - extern uint8_t rx_dropped_bytes; - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - extern uint8_t rx_buffer_overruns; - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - extern uint8_t rx_framing_errors; - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - extern ring_buffer_pos_t rx_max_enqueued; - #endif - - class MarlinSerial { - - 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 void write(const uint8_t c); - static void flushTX(void); - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - FORCE_INLINE static uint32_t dropped() { return rx_dropped_bytes; } - #endif - - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - FORCE_INLINE static uint32_t buffer_overruns() { return rx_buffer_overruns; } - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - FORCE_INLINE static uint32_t framing_errors() { return rx_framing_errors; } - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return rx_max_enqueued; } - #endif - - FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } - FORCE_INLINE static void print(const char* str) { write(str); } - - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); - static void print(int, int = DEC); - static void print(unsigned int, int = DEC); - static void print(long, int = DEC); - static void print(unsigned long, int = DEC); - static void print(double, int = 2); - - static void println(const String& s); - static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); - static void println(int, int = DEC); - static void println(unsigned int, int = DEC); - static void println(long, int = DEC); - static void println(unsigned long, int = DEC); - static void println(double, int = 2); - static void println(void); - operator bool() { return true; } - - private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); - }; - - extern MarlinSerial customizedSerial; - -#endif // USE_MARLINSERIAL - -// Use the UART for Bluetooth in AT90USB configurations -#if !USE_MARLINSERIAL && ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; -#endif - -#endif // _MARLINSERIAL_H_ diff --git a/Marlin_thinkerV2/Marlin/Marlin_main.cpp b/Marlin_thinkerV2/Marlin/Marlin_main.cpp deleted file mode 100644 index a9f2051e0e..0000000000 --- a/Marlin_thinkerV2/Marlin/Marlin_main.cpp +++ /dev/null @@ -1,15140 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -/** - * About Marlin - * - * This firmware is a mashup between Sprinter and grbl. - * - https://github.com/kliment/Sprinter - * - https://github.com/grbl/grbl - */ - -/** - * ----------------- - * G-Codes in Marlin - * ----------------- - * - * Helpful G-code references: - * - http://linuxcnc.org/handbook/gcode/g-code.html - * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes - * - * Help to document Marlin's G-codes online: - * - http://reprap.org/wiki/G-code - * - https://github.com/MarlinFirmware/MarlinDocumentation - * - * ----------------- - * - * "G" Codes - * - * G0 -> G1 - * G1 - Coordinated Movement X Y Z E - * G2 - CW ARC - * G3 - CCW ARC - * G4 - Dwell S or P - * G5 - Cubic B-spline with XYZE destination and IJPQ offsets - * G10 - Retract filament according to settings of M207 (Requires FWRETRACT) - * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT) - * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE) - * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES) - * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES) - * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES) - * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT) - * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT) - * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION) - * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE) - * G28 - Home one or more axes - * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling) - * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location) - * G31 - Dock sled (Z_PROBE_SLED only) - * G32 - Undock sled (Z_PROBE_SLED only) - * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION) - * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET) - * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL) - * G90 - Use Absolute Coordinates - * G91 - Use Relative Coordinates - * G92 - Set current position to coordinates given - * - * "M" Codes - * - * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) - * M1 -> M0 - * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise - * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise - * M5 - Turn laser/spindle off - * M17 - Enable/Power all stepper motors - * M18 - Disable all stepper motors; same as M84 - * M20 - List SD card. (Requires SDSUPPORT) - * M21 - Init SD card. (Requires SDSUPPORT) - * M22 - Release SD card. (Requires SDSUPPORT) - * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT) - * M24 - Start/resume SD print. (Requires SDSUPPORT) - * M25 - Pause SD print. (Requires SDSUPPORT) - * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT) - * M27 - Report SD print status. (Requires SDSUPPORT) - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT) - * M29 - Stop SD write. (Requires SDSUPPORT) - * M30 - Delete file from SD: "M30 /path/file.gco" - * M31 - Report time since last M109 or SD card start to serial. - * M32 - Select file and start SD print: "M32 [S] !/path/file.gco#". (Requires SDSUPPORT) - * Use P to run other files as sub-programs: "M32 P !filename#" - * The '#' is necessary when calling from within sd files, as it stops buffer prereading - * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT) - * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) - * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. - * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) - * M75 - Start the print job timer. - * M76 - Pause the print job timer. - * M77 - Stop the print job timer. - * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER) - * M80 - Turn on Power Supply. (Requires POWER_SUPPLY > 0) - * M81 - Turn off Power Supply. (Requires POWER_SUPPLY > 0) - * M82 - Set E codes absolute (default). - * M83 - Set E codes relative while in Absolute (G90) mode. - * M84 - Disable steppers until next move, or use S to specify an idle - * duration after which steppers should turn off. S0 disables the timeout. - * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) - * M92 - Set planner.axis_steps_per_mm for one or more axes. - * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER) - * M104 - Set extruder target temp. - * M105 - Report current temperatures. - * M106 - Set print fan speed. - * M107 - Print fan off. - * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER) - * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating - * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling - * 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. - * 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) - * M117 - Display a message on the controller screen. (Requires an LCD) - * M118 - Display a message in the host console. - * M119 - Report endstops status. - * M120 - Enable endstops detection. - * M121 - Disable endstops detection. - * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) - * M126 - Solenoid Air Valve Open. (Requires BARICUDA) - * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) - * M128 - EtoP Open. (Requires BARICUDA) - * M129 - EtoP Closed. (Requires BARICUDA) - * M140 - Set bed target temp. S - * M145 - Set heatup values for materials on the LCD. H B F for S (0=PLA, 1=ABS) - * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT) - * M150 - Set Status LED Color as R U B P. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, or PCA9632). - * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) - * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) - * M164 - Save the mix as a virtual extruder. (Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS) - * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. (Requires MIXING_EXTRUDER) - * M190 - Sxxx Wait for bed current temp to reach target temp. ** Waits only when heating! ** - * Rxxx Wait for bed current temp to reach target temp. ** Waits for heating or cooling. ** - * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) - * M201 - Set max acceleration in units/s^2 for print moves: "M201 X Y Z E" - * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X Y Z E" ** UNUSED IN MARLIN! ** - * M203 - Set maximum feedrate: "M203 X Y Z E" in units/sec. - * M204 - Set default acceleration in units/sec^2: P R T - * M205 - Set advanced settings. Current units apply: - S T minimum speeds - B - X, Y, Z, E - * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z. (Requires FWRETRACT) - * M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F. (Requires FWRETRACT) - * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT) - Every normal extrude-only move will be classified as retract depending on the direction. - * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS) - * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) - * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) - * M221 - Set Flow Percentage: "M221 S" - * M226 - Wait until a pin is in a given state: "M226 P S" - * M240 - Trigger a camera to take a photograph. (Requires CHDK or PHOTOGRAPH_PIN) - * M250 - Set LCD contrast: "M250 C" (0-63). (Requires LCD support) - * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS) - * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS) - * M280 - Set servo position absolute: "M280 P S". (Requires servos) - * M290 - Babystepping (Requires BABYSTEPPING) - * M300 - Play beep sound S P - * M301 - Set PID parameters P I and D. (Requires PIDTEMP) - * M302 - Allow cold extrudes, or set the minimum extrude S. (Requires PREVENT_COLD_EXTRUSION) - * M303 - PID relay autotune S sets the target temperature. Default 150C. (Requires PIDTEMP) - * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED) - * M350 - Set microstepping mode. (Requires digital microstepping pins.) - * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.) - * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN) - * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID) - * M381 - Disable all solenoids. (Requires EXT_SOLENOID) - * M400 - Finish all moves. - * M401 - Deploy and activate Z probe. (Requires a probe) - * M402 - Deactivate and stow Z probe. (Requires a probe) - * M404 - Display or set the Nominal Filament Width: "W". (Requires FILAMENT_WIDTH_SENSOR) - * M405 - Enable Filament Sensor flow control. "M405 D". (Requires FILAMENT_WIDTH_SENSOR) - * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) - * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) - * M410 - Quickstop. Abort all planned moves. - * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) - * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) - * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) - * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** - * M503 - Print the current settings (in memory): "M503 S". S0 specifies compact output. - * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) - * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) - * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) - * M665 - Set delta configurations: "M665 H L R S B X Y Z (Requires DELTA) - * M666 - Set/get endstop offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). - * M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) - * 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. - * M862 - Perform an axis continuity test for position encoder modules. - * M863 - Perform steps-per-mm calibration for position encoder modules. - * M864 - Change position encoder module I2C address. - * M865 - Check position encoder module firmware version. - * M866 - Report or reset position encoder module error count. - * M867 - Enable/disable or toggle error correction for position encoder modules. - * M868 - Report or set position encoder module error correction threshold. - * M869 - Report position encoder module error. - * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) - * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) - * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) - * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) - * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660) - * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) - * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING) - * - * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) - * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) - * - * ************ Custom codes - This can change to suit future G-code regulations - * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT) - * M999 - Restart after being stopped by error - * - * "T" Codes - * - * T0-T3 - Select an extruder (tool) by index: "T F" - * - */ - -#include "Marlin.h" - -#include "ultralcd.h" -#include "planner.h" -#include "stepper.h" -#include "endstops.h" -#include "temperature.h" -#include "cardreader.h" -#include "configuration_store.h" -#include "language.h" -#include "pins_arduino.h" -#include "math.h" -#include "nozzle.h" -#include "printcounter.h" -#include "duration_t.h" -#include "types.h" -#include "parser.h" -#include "delay.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "power_loss_recovery.h" - recovery_D recovery_detect_cap; -#endif - extern char lcd_status_message[]; -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -#if ABL_PLANAR - #include "vector_3.h" - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - #include "least_squares_fit.h" - #endif -#elif ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if ENABLED(BEZIER_CURVE_SUPPORT) - #include "planner_bezier.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #include "runout.h" -#endif - -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - #include "buzzer.h" -#endif - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if ENABLED(MAX7219_DEBUG) - #include "Max7219_Debug_LEDs.h" -#endif - -#if HAS_COLOR_LEDS - #include "leds.h" -#endif - -#if HAS_SERVOS - #include "servo.h" -#endif - -#if HAS_DIGIPOTSS - #include -#endif - -#if HAS_TRINAMIC - #include "tmc_util.h" -#endif - -#if ENABLED(DAC_STEPPER_CURRENT) - #include "stepper_dac.h" -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) - #include "twibus.h" -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - #include "I2CPositionEncoder.h" -#endif - -#if ENABLED(M100_FREE_MEMORY_WATCHER) - void gcode_M100(); - void M100_dump_routine(const char * const title, const char *start, const char *end); -#endif - -#if ENABLED(G26_MESH_VALIDATION) - bool g26_debug_flag; // =false - void gcode_G26(); -#endif - -#if ENABLED(SDSUPPORT) - CardReader card; -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) - TWIBus i2c; -#endif - -#if ENABLED(G38_PROBE_TARGET) - bool G38_move = false, - G38_endstop_hit = false; -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - int8_t active_coordinate_system = -1; // machine space - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; -#endif - -bool Running = true; - -uint8_t marlin_debug_flags = DEBUG_NONE; - -/** - * Cartesian Current Position - * Used to track the native machine position as moves are queued. - * Used by 'buffer_line_to_current_position' to do a move after changing it. - * Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'. - */ -float current_position[XYZE] = { 0 }; - -/** - * 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 'gcode_get_destination' or 'set_destination_from_current'. - */ -float destination[XYZE] = { 0 }; - -/** - * axis_homed - * Flags that each linear axis was homed. - * XYZ on cartesian, ABC on delta, ABZ on SCARA. - * - * axis_known_position - * Flags that the position is known in each linear axis. Set when homed. - * Cleared whenever a stepper powers off, potentially losing its position. - */ -uint8_t axis_homed, axis_known_position; // = 0 - -/** - * GCode line number handling. Hosts may opt to include line numbers when - * sending commands to Marlin, and lines will be checked for sequentiality. - * M110 N sets the current line number. - */ -static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; - -/** - * GCode Command Queue - * A simple ring buffer of BUFSIZE command strings. - * - * Commands are copied into this buffer by the command injectors - * (immediate, serial, sd card) and they are processed sequentially by - * the main loop. The process_next_command function parses the next - * command and hands off execution to individual handler functions. - */ -uint8_t commands_in_queue = 0, // Count of commands in the queue - cmd_queue_index_r = 0, // Ring buffer read (out) position - cmd_queue_index_w = 0; // Ring buffer write (in) position - -char command_queue[BUFSIZE][MAX_CMD_SIZE]; - -/** - * Next Injected Command pointer. NULL if no commands are being injected. - * Used by Marlin internally to ensure that commands initiated from within - * are enqueued ahead of any pending serial or sd card commands. - */ -static const char *injected_commands_P = NULL; - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - TempUnit input_temp_units = TEMPUNIT_C; -#endif - -/** - * Feed rates are often configured with mm/m - * but the planner and stepper like mm/s units. - */ -static const float homing_feedrate_mm_s[] PROGMEM = { - #if ENABLED(DELTA) - MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), - #else - MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), - #endif - MMM_TO_MMS(HOMING_FEEDRATE_Z), 0 -}; -FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } - -float feedrate_mm_s = MMM_TO_MMS(1500.0f); -static float saved_feedrate_mm_s; -int16_t feedrate_percentage = 100, saved_feedrate_percentage; - -// Initialized by settings.load() -bool axis_relative_modes[XYZE] = AXIS_RELATIVE_MODES; - -#if HAS_WORKSPACE_OFFSET - #if HAS_POSITION_SHIFT - // The distance that XYZ has been offset by G92. Reset by G28. - float position_shift[XYZ] = { 0 }; - #endif - #if HAS_HOME_OFFSET - // This offset is added to the configured home position. - // Set by M206, M428, or menu item. Saved to EEPROM. - float home_offset[XYZ] = { 0 }; - #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - // The above two are combined to save on computes - float workspace_offset[XYZ] = { 0 }; - #endif -#endif - -// Software Endstops are based on the configured limits. -float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, - soft_endstop_max[XYZ] = { X_MAX_BED, Y_MAX_BED, Z_MAX_POS }; -#if HAS_SOFTWARE_ENDSTOPS - bool soft_endstops_enabled = true; - #if IS_KINEMATIC - float soft_endstop_radius, soft_endstop_radius_2; - #endif -#endif - -#if FAN_COUNT > 0 - int16_t fanSpeeds[FAN_COUNT] = { 0 }; - #if ENABLED(EXTRA_FAN_SPEED) - int16_t old_fanSpeeds[FAN_COUNT], - new_fanSpeeds[FAN_COUNT]; - #endif - #if ENABLED(PROBING_FANS_OFF) - bool fans_paused; // = false; - int16_t paused_fanSpeeds[FAN_COUNT] = { 0 }; - #endif -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - int controllerFanSpeed; // = 0; -#endif - -// The active extruder (tool). Set with T command. -uint8_t active_extruder; // = 0; - -// Relative Mode. Enable with G91, disable with G90. -static bool relative_mode; // = false; - -// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop -volatile bool wait_for_heatup = true; - -// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop -#if HAS_RESUME_CONTINUE - volatile bool wait_for_user; // = false; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - bool suspend_auto_report; // = false -#endif - -const char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; - -// Number of characters read in the current line of serial input -static int serial_count; // = 0; - -// Inactivity shutdown -millis_t previous_move_ms; // = 0; -static millis_t max_inactive_time; // = 0; -static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL; - -// Buzzer - I2C on the LCD or a BEEPER_PIN -#if ENABLED(LCD_USE_I2C_BUZZER) - #define BUZZ(d,f) lcd_buzz(d, f) -#elif PIN_EXISTS(BEEPER) - Buzzer buzzer; - #define BUZZ(d,f) buzzer.tone(d, f) -#else - #define BUZZ(d,f) NOOP -#endif - -uint8_t target_extruder; - -#if HAS_BED_PROBE - float zprobe_zoffset; // Initialized by settings.load() -#endif - -#if HAS_ABL - float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); - #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s -#elif defined(XY_PROBE_SPEED) - #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_SPEED) -#else - #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #if ENABLED(DELTA) - #define ADJUST_DELTA(V) \ - if (planner.leveling_active) { \ - const float zadj = bilinear_z_offset(V); \ - delta[A_AXIS] += zadj; \ - delta[B_AXIS] += zadj; \ - delta[C_AXIS] += zadj; \ - } - #else - #define ADJUST_DELTA(V) if (planner.leveling_active) { delta[Z_AXIS] += bilinear_z_offset(V); } - #endif -#elif IS_KINEMATIC - #define ADJUST_DELTA(V) NOOP -#endif - -#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - const static char msg_wait_for_bed_heating[] PROGMEM = "Wait for bed heating...\n"; -#endif - -// Extruder offsets -#if HOTENDS > 1 - float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load() -#endif - -#if HAS_Z_SERVO_PROBE - const int z_servo_angle[2] = Z_SERVO_ANGLES; -#endif - -#if ENABLED(BARICUDA) - uint8_t baricuda_valve_pressure = 0, - baricuda_e_to_p_pressure = 0; -#endif - -#if HAS_POWER_SWITCH - bool powersupply_on = ( - #if ENABLED(PS_DEFAULT_OFF) - false - #else - true - #endif - ); - #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() - #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() - #endif -#endif - -#if ENABLED(DELTA) - - float delta[ABC]; - - // Initialized by settings.load() - float delta_height, - delta_endstop_adj[ABC] = { 0 }, - delta_radius, - delta_tower_angle_trim[ABC], - delta_tower[ABC][2], - delta_diagonal_rod, - delta_calibration_radius, - delta_diagonal_rod_2_tower[ABC], - delta_segments_per_second, - delta_clip_start_height = Z_MAX_POS; - - float delta_safe_distance_from_top(); - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - int bilinear_grid_spacing[2], bilinear_start[2]; - float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt[A] - #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X - #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y - #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] - #else - #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] - #define ABL_BG_FACTOR(A) bilinear_grid_factor[A] - #define ABL_BG_POINTS_X GRID_MAX_POINTS_X - #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y - #define ABL_BG_GRID(X,Y) z_values[X][Y] - #endif -#endif - -#if IS_SCARA - // Float constants for SCARA calculations - const float L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, - L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2, - L2_2 = sq(float(L2)); - - float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND, - delta[ABC]; -#endif - -float cartes[XYZ] = { 0 }; - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - bool filament_sensor; // = false; // M405 turns on filament sensor control. M406 turns it 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 -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - AdvancedPauseMenuResponse advanced_pause_menu_response; - float filament_change_unload_length[EXTRUDERS], - filament_change_load_length[EXTRUDERS]; -#endif - -#if ENABLED(MIXING_EXTRUDER) - float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise >= 1.0. - #if MIXING_VIRTUAL_TOOLS > 1 - float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - #endif -#endif - -static bool send_ok[BUFSIZE]; - -#if HAS_SERVOS - Servo servo[NUM_SERVOS]; - #define MOVE_SERVO(I, P) servo[I].move(P) - #if HAS_Z_SERVO_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[1]) - #endif -#endif - -#ifdef CHDK - millis_t chdkHigh = 0; - bool chdkActive = false; -#endif - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - MarlinBusyState busy_state = NOT_BUSY; - static millis_t next_busy_signal_ms = 0; - uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL; -#else - #define host_keepalive() NOOP -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - I2CPositionEncodersMgr I2CPEM; -#endif - -#if ENABLED(CNC_WORKSPACE_PLANES) - static WorkspacePlane workspace_plane = PLANE_XY; -#endif - -FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float_near(p); } -FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte_near(p); } - -#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \ - static const PROGMEM type array##_P[XYZ] = { X_##CONFIG, Y_##CONFIG, Z_##CONFIG }; \ - static inline type array(const AxisEnum axis) { return pgm_read_any(&array##_P[axis]); } \ - typedef void __void_##CONFIG##__ - -XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); -XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); -XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); -XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); -XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); - -/** - * *************************************************************************** - * ******************************** FUNCTIONS ******************************** - * *************************************************************************** - */ - -void stop(); - -void get_available_commands(); -void process_next_command(); -void process_parsed_command(); - -void get_cartesian_from_steppers(); -void set_current_from_steppers_for_axis(const AxisEnum axis); - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const float (&cart)[XYZE], const float (&offset)[2], const bool clockwise); -#endif - -#if ENABLED(BEZIER_CURVE_SUPPORT) - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]); -#endif - -void report_current_position(); -void report_current_position_detail(); - -#if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) { - serialprintPGM(prefix); - SERIAL_CHAR('('); - SERIAL_ECHO(x); - SERIAL_ECHOPAIR(", ", y); - SERIAL_ECHOPAIR(", ", z); - SERIAL_CHAR(')'); - if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); - } - - void print_xyz(const char* prefix, const char* suffix, const float xyz[]) { - print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); - } - - #define DEBUG_POS(SUFFIX,VAR) do { \ - print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) -#endif - -/** - * sync_plan_position - * - * Set the planner/stepper positions directly from current_position with - * no kinematic translation. Used for homing axes and cartesian/core syncing. - */ -void sync_plan_position() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); - #endif - planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); -} -void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } - -#if IS_KINEMATIC - inline void sync_plan_position_kinematic() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_kinematic", current_position); - #endif - planner.set_position_mm_kinematic(current_position); - } -#endif - -#if ENABLED(SDSUPPORT) - #include "SdFatUtil.h" - int freeMemory() { return SdFatUtil::FreeRam(); } -#else -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} -#endif // !SDSUPPORT - -#if ENABLED(DIGIPOT_I2C) - extern void digipot_i2c_set_current(uint8_t channel, float current); - extern void digipot_i2c_init(); -#endif - -/** - * Inject the next "immediate" command, when possible, onto the front of the queue. - * Return true if any immediate commands remain to inject. - */ -static bool drain_injected_commands_P() { - if (injected_commands_P != NULL) { - size_t i = 0; - char c, cmd[30]; - strncpy_P(cmd, injected_commands_P, sizeof(cmd) - 1); - cmd[sizeof(cmd) - 1] = '\0'; - while ((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command - cmd[i] = '\0'; - if (enqueue_and_echo_command(cmd)) // success? - injected_commands_P = c ? injected_commands_P + i + 1 : NULL; // next command or done - } - return (injected_commands_P != NULL); // return whether any more remain -} - -/** - * Record one or many commands to run from program memory. - * Aborts the current queue, if any. - * Note: drain_injected_commands_P() must be called repeatedly to drain the commands afterwards - */ -void enqueue_and_echo_commands_P(const char * const pgcode) { - injected_commands_P = pgcode; - (void)drain_injected_commands_P(); // first command executed asap (when possible) -} - -/** - * Clear the Marlin command queue - */ -void clear_command_queue() { - cmd_queue_index_r = cmd_queue_index_w = commands_in_queue = 0; -} - -/** - * Once a new command is in the ring buffer, call this to commit it - */ -inline void _commit_command(bool say_ok) { - send_ok[cmd_queue_index_w] = say_ok; - if (++cmd_queue_index_w >= BUFSIZE) cmd_queue_index_w = 0; - commands_in_queue++; -} - -/** - * Copy a command from RAM into the main command buffer. - * Return true if the command was successfully added. - * Return false for a full buffer, or if the 'command' is a comment. - */ -inline bool _enqueuecommand(const char* cmd, bool say_ok=false) { - if (*cmd == ';' || commands_in_queue >= BUFSIZE) return false; - strcpy(command_queue[cmd_queue_index_w], cmd); - _commit_command(say_ok); - return true; -} - -/** - * Enqueue with Serial Echo - */ -bool enqueue_and_echo_command(const char* cmd) { - if (_enqueuecommand(cmd)) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_ENQUEUEING, cmd); - SERIAL_CHAR('"'); - SERIAL_EOL(); - return true; - } - return false; -} - -#if HAS_QUEUE_NOW - void enqueue_and_echo_command_now(const char* cmd) { - while (!enqueue_and_echo_command(cmd)) idle(); - } - #if HAS_LCD_QUEUE_NOW - void enqueue_and_echo_commands_now_P(const char * const pgcode) { - enqueue_and_echo_commands_P(pgcode); - while (drain_injected_commands_P()) idle(); - } - #endif -#endif - -void setup_killpin() { - #if HAS_KILL - SET_INPUT_PULLUP(KILL_PIN); - #endif -} - -void setup_powerhold() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); - #endif - #if HAS_POWER_SWITCH - #if ENABLED(PS_DEFAULT_OFF) - PSU_OFF(); - #else - PSU_ON(); - #endif - #endif -} - -void suicide() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, LOW); - #endif -} - -void servo_init() { - #if NUM_SERVOS >= 1 && HAS_SERVO_0 - servo[0].attach(SERVO0_PIN); - servo[0].detach(); // Just set up the pin. We don't have a position yet. Don't move to a random position. - #endif - #if NUM_SERVOS >= 2 && HAS_SERVO_1 - servo[1].attach(SERVO1_PIN); - servo[1].detach(); - #endif - #if NUM_SERVOS >= 3 && HAS_SERVO_2 - servo[2].attach(SERVO2_PIN); - servo[2].detach(); - #endif - #if NUM_SERVOS >= 4 && HAS_SERVO_3 - servo[3].attach(SERVO3_PIN); - servo[3].detach(); - #endif - - #if HAS_Z_SERVO_PROBE - /** - * Set position of Z Servo Endstop - * - * The servo might be deployed and positioned too low to stow - * when starting up the machine or rebooting the board. - * There's no way to know where the nozzle is positioned until - * homing has been done - no homing with z-probe without init! - * - */ - STOW_Z_SERVO(); - #endif -} - -/** - * Stepper Reset (RigidBoard, et.al.) - */ -#if HAS_STEPPER_RESET - void disableStepperDrivers() { - OUT_WRITE(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips - } - void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); } // set to input, which allows it to be pulled high by pullups -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - - void i2c_on_receive(int bytes) { // just echo all bytes received to serial - i2c.receive(bytes); - } - - void i2c_on_request() { // just send dummy data for now - i2c.reply("Hello World!\n"); - } - -#endif - -void gcode_line_error(const char* err, bool doFlush = true) { - SERIAL_ERROR_START(); - serialprintPGM(err); - SERIAL_ERRORLN(gcode_LastN); - //Serial.println(gcode_N); - if (doFlush) flush_and_request_resend(); - serial_count = 0; -} - -/** - * Get all commands waiting on the serial port and queue them. - * Exit when the buffer is full or when no more characters are - * left on the serial port. - */ -inline void get_serial_commands() { - static char serial_line_buffer[MAX_CMD_SIZE]; - static bool serial_comment_mode = false; - - // If the command buffer is empty for too long, - // send "wait" to indicate Marlin is still waiting. - #if NO_TIMEOUTS > 0 - static millis_t last_command_time = 0; - const millis_t ms = millis(); - if (commands_in_queue == 0 && !MYSERIAL0.available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { - SERIAL_ECHOLNPGM(MSG_WAIT); - last_command_time = ms; - } - #endif - - /** - * Loop while serial characters are incoming and the queue is not full - */ - int c; - while (commands_in_queue < BUFSIZE && (c = MYSERIAL0.read()) >= 0) { - - char serial_char = c; - - /** - * If the character ends the line - */ - if (serial_char == '\n' || serial_char == '\r') { - - serial_comment_mode = false; // end of line == end of comment - - // Skip empty lines and comments - if (!serial_count) { thermalManager.manage_heater(); continue; } - - serial_line_buffer[serial_count] = 0; // Terminate string - serial_count = 0; // Reset buffer - - char* command = serial_line_buffer; - - while (*command == ' ') command++; // Skip leading spaces - char *npos = (*command == 'N') ? command : NULL; // Require the N parameter to start the line - - if (npos) { - - bool M110 = strstr_P(command, PSTR("M110")) != NULL; - - if (M110) { - char* n2pos = strchr(command + 4, 'N'); - if (n2pos) npos = n2pos; - } - - gcode_N = strtol(npos + 1, NULL, 10); - - if (gcode_N != gcode_LastN + 1 && !M110) { - gcode_line_error(PSTR(MSG_ERR_LINE_NO)); - return; - } - - char *apos = strrchr(command, '*'); - if (apos) { - uint8_t checksum = 0, count = uint8_t(apos - command); - while (count) checksum ^= command[--count]; - if (strtol(apos + 1, NULL, 10) != checksum) { - gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH)); - return; - } - } - else { - gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); - return; - } - - gcode_LastN = gcode_N; - } - #if ENABLED(SDSUPPORT) - else if (card.saving) { - gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); - return; - } - #endif - - // Movement commands alert when stopped - if (IsStopped()) { - char* gpos = strchr(command, 'G'); - if (gpos) { - const int codenum = strtol(gpos + 1, NULL, 10); - switch (codenum) { - case 0: - case 1: - case 2: - case 3: - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - break; - } - } - } - - #if DISABLED(EMERGENCY_PARSER) - // Process critical commands early - if (strcmp(command, "M108") == 0) { - wait_for_heatup = false; - #if ENABLED(NEWPANEL) - wait_for_user = false; - #endif - } - if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M410") == 0) quickstop_stepper(); - #endif - - #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 - last_command_time = ms; - #endif - - // Add the command to the queue - _enqueuecommand(serial_line_buffer, true); - } - else if (serial_count >= MAX_CMD_SIZE - 1) { - // Keep fetching, but ignore normal characters beyond the max length - // The command will be injected when EOL is reached - } - else if (serial_char == '\\') { // Handle escapes - if ((c = MYSERIAL0.read()) >= 0 && !serial_comment_mode) // if we have one more character, copy it over - serial_line_buffer[serial_count++] = (char)c; - // otherwise do nothing - } - else { // it's not a newline, carriage return or escape char - if (serial_char == ';') serial_comment_mode = true; - if (!serial_comment_mode) serial_line_buffer[serial_count++] = serial_char; - } - - } // queue has space, serial has data -} - -#if ENABLED(SDSUPPORT) - - #if ENABLED(PRINTER_EVENT_LEDS) && HAS_RESUME_CONTINUE - static bool lights_off_after_print; // = false - #endif - - /** - * Get commands from the SD Card until the command buffer is full - * or until the end of the file is reached. The special character '#' - * can also interrupt buffering. - */ - inline void get_sdcard_commands() { - static bool stop_buffering = false, - sd_comment_mode = false; - - if (!card.sdprinting) return; - - /** - * '#' stops reading from SD to the buffer prematurely, so procedural - * macro calls are possible. If it occurs, stop_buffering is triggered - * and the buffer is run dry; this character _can_ occur in serial com - * due to checksums, however, no checksums are used in SD printing. - */ - - if (commands_in_queue == 0) stop_buffering = false; - - uint16_t sd_count = 0; - bool card_eof = card.eof(); - while (commands_in_queue < BUFSIZE && !card_eof && !stop_buffering) { - const int16_t n = card.get(); - char sd_char = (char)n; - card_eof = card.eof(); - if (card_eof || n == -1 - || sd_char == '\n' || sd_char == '\r' - || ((sd_char == '#' || sd_char == ':') && !sd_comment_mode) - ) { - if (card_eof) { - - card.printingHasFinished(); - - if (card.sdprinting) - sd_count = 0; // If a sub-file was printing, continue from call point - else { - SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); - - #if ENABLED(PRINTER_EVENT_LEDS) - LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); - leds.set_green(); - #if HAS_RESUME_CONTINUE - lights_off_after_print = true; - enqueue_and_echo_commands_P(PSTR("M0 S" - #if ENABLED(NEWPANEL) - "1800" - #else - "60" - #endif - )); - #else - safe_delay(2000); - leds.set_off(); - #endif - #endif // PRINTER_EVENT_LEDS - } - } - else if (n == -1) { - char dat_tmp[96]; - SERIAL_ERROR_START(); - SERIAL_ECHOLNPGM(MSG_SD_ERR_READ); - sprintf_P(dat_tmp,PSTR("M21")); - enqueue_and_echo_command(dat_tmp); - } - if (sd_char == '#') stop_buffering = true; - - sd_comment_mode = false; // for new command - - // Skip empty lines and comments - if (!sd_count) { thermalManager.manage_heater(); continue; } - - command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string - sd_count = 0; // clear sd line buffer - - _commit_command(false); - } - else if (sd_count >= MAX_CMD_SIZE - 1) { - /** - * Keep fetching, but ignore normal characters beyond the max length - * The command will be injected when EOL is reached - */ - } - else { - if (sd_char == ';') sd_comment_mode = true; - if (!sd_comment_mode) command_queue[cmd_queue_index_w][sd_count++] = sd_char; - } - } - } - - #if ENABLED(POWER_LOSS_RECOVERY) - - inline bool drain_job_recovery_commands() { - static uint8_t job_recovery_commands_index = 0; // Resets on reboot - if (job_recovery_commands_count) { - if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) { - ++job_recovery_commands_index; - if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE; - } - return true; - } - return false; - } - - #endif - -#endif // SDSUPPORT - -/** - * Add to the circular command queue the next command from: - * - The command-injection queue (injected_commands_P) - * - The active serial input (usually USB) - * - Commands left in the queue after power-loss - * - The SD card file being actively printed - */ -void get_available_commands() { - - // Immediate commands block the other queues - if (drain_injected_commands_P()) return; - - get_serial_commands(); - - #if ENABLED(POWER_LOSS_RECOVERY) - // Commands for power-loss recovery take precedence - if (job_recovery_phase == JOB_RECOVERY_YES && drain_job_recovery_commands()) return; - #endif - - #if ENABLED(SDSUPPORT) - get_sdcard_commands(); - #endif -} - -/** - * Set target_extruder from the T parameter or the active_extruder - * - * Returns TRUE if the target is invalid - */ -bool get_target_extruder_from_command(const uint16_t code) { - if (parser.seenval('T')) { - const int8_t e = parser.value_byte(); - if (e >= EXTRUDERS) { - SERIAL_ECHO_START(); - SERIAL_CHAR('M'); - SERIAL_ECHO(code); - SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", e); - return true; - } - target_extruder = e; - } - else - target_extruder = active_extruder; - - return false; -} - -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - bool extruder_duplication_enabled = false; // Used in Dual X mode 2 -#endif - -#if ENABLED(DUAL_X_CARRIAGE) - - static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - - static float x_home_pos(const int extruder) { - if (extruder == 0) - return base_home_pos(X_AXIS); - else - /** - * In dual carriage mode the extruder offset provides an override of the - * second X-carriage position when homed - otherwise X2_HOME_POS is used. - * This allows soft recalibration of the second extruder home position - * without firmware reflash (through the M218 command). - */ - return hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS; - } - - static int x_home_dir(const int extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } - - static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1 - static bool active_extruder_parked = false; // used in mode 1 & 2 - static float raised_parked_position[XYZE]; // used in mode 1 - static millis_t delayed_move_time = 0; // used in mode 1 - static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 - static int16_t duplicate_extruder_temp_offset = 0; // used in mode 2 - -#endif // DUAL_X_CARRIAGE - -#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE) || ENABLED(DELTA) - - /** - * Software endstops can be used to monitor the open end of - * an axis that has a hardware endstop on the other end. Or - * they can prevent axes from moving past endstops and grinding. - * - * To keep doing their job as the coordinate system changes, - * the software endstop positions must be refreshed to remain - * at the same positions relative to the machine. - */ - void update_software_endstops(const AxisEnum axis) { - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - workspace_offset[axis] = home_offset[axis] + position_shift[axis]; - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - if (axis == X_AXIS) { - - // In Dual X mode hotend_offset[X] is T1's home position - const float dual_max_x = MAX(hotend_offset[X_AXIS][1], X2_MAX_POS); - - if (active_extruder != 0) { - // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) - soft_endstop_min[X_AXIS] = X2_MIN_POS; - soft_endstop_max[X_AXIS] = dual_max_x; - } - else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - // In Duplication Mode, T0 can move as far left as X_MIN_POS - // but not so far to the right that T1 would move past the end - soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS); - soft_endstop_max[X_AXIS] = MIN(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset); - } - else { - // In other modes, T0 can move from X_MIN_POS to X_MAX_POS - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = base_max_pos(axis); - } - } - #elif ENABLED(DELTA) - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = axis == Z_AXIS ? delta_height : base_max_pos(axis); - #else - soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = base_max_pos(axis); - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("For ", axis_codes[axis]); - #if HAS_HOME_OFFSET - SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]); - #endif - #if HAS_POSITION_SHIFT - SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]); - #endif - SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]); - SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]); - } - #endif - - #if ENABLED(DELTA) - switch (axis) { - #if HAS_SOFTWARE_ENDSTOPS - case X_AXIS: - case Y_AXIS: - // Get a minimum radius for clamping - soft_endstop_radius = MIN3(ABS(MAX(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]); - soft_endstop_radius_2 = sq(soft_endstop_radius); - break; - #endif - case Z_AXIS: - delta_clip_start_height = soft_endstop_max[axis] - delta_safe_distance_from_top(); - default: break; - } - #endif - } - -#endif // HAS_WORKSPACE_OFFSET || DUAL_X_CARRIAGE || DELTA - -#if HAS_M206_COMMAND - /** - * Change the home offset for an axis. - * Also refreshes the workspace offset. - */ - static void set_home_offset(const AxisEnum axis, const float v) { - home_offset[axis] = v; - update_software_endstops(axis); - } -#endif // HAS_M206_COMMAND - -/** - * Set an axis' current position to its home position (after homing). - * - * For Core and Cartesian robots this applies one-to-one when an - * individual axis has been homed. - * - * DELTA should wait until all homing is done before setting the XYZ - * current_position to home, because homing is a single operation. - * In the case where the axis positions are already known and previously - * homed, DELTA could home to X or Y individually by moving either one - * to the center. However, homing Z always homes XY and Z. - * - * SCARA should wait until all XY homing is done before setting the XY - * current_position to home, because neither X nor Y is at home until - * both are at home. Z can however be homed individually. - * - * Callers must sync the planner position after calling this! - */ -static void set_axis_is_at_home(const AxisEnum axis) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - SBI(axis_known_position, axis); - SBI(axis_homed, axis); - - #if HAS_POSITION_SHIFT - position_shift[axis] = 0; - update_software_endstops(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); - return; - } - #endif - - #if ENABLED(MORGAN_SCARA) - - /** - * Morgan SCARA homes XY at the same time - */ - if (axis == X_AXIS || axis == Y_AXIS) { - - float homeposition[XYZ] = { - base_home_pos(X_AXIS), - base_home_pos(Y_AXIS), - base_home_pos(Z_AXIS) - }; - - // SERIAL_ECHOPAIR("homeposition X:", homeposition[X_AXIS]); - // SERIAL_ECHOLNPAIR(" Y:", homeposition[Y_AXIS]); - - /** - * Get Home position SCARA arm angles using inverse kinematics, - * and calculate homing offset using forward kinematics - */ - inverse_kinematics(homeposition); - forward_kinematics_SCARA(delta[A_AXIS], delta[B_AXIS]); - - // SERIAL_ECHOPAIR("Cartesian X:", cartes[X_AXIS]); - // SERIAL_ECHOLNPAIR(" Y:", cartes[Y_AXIS]); - - current_position[axis] = cartes[axis]; - - /** - * SCARA home positions are based on configuration since the actual - * limits are determined by the inverse kinematic transform. - */ - soft_endstop_min[axis] = base_min_pos(axis); // + (cartes[axis] - base_home_pos(axis)); - soft_endstop_max[axis] = base_max_pos(axis); // + (cartes[axis] - base_home_pos(axis)); - } - else - #elif ENABLED(DELTA) - if (axis == Z_AXIS) - current_position[axis] = delta_height; - else - #endif - { - current_position[axis] = base_home_pos(axis); - } - - /** - * Z Probe Z Homing? Account for the probe's Z offset. - */ - #if HAS_BED_PROBE && Z_HOME_DIR < 0 - if (axis == Z_AXIS) { - #if HOMING_Z_WITH_PROBE - - current_position[Z_AXIS] -= zprobe_zoffset; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***"); - SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset); - } - #endif - - #elif ENABLED(DEBUG_LEVELING_FEATURE) - - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***"); - - #endif - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - #if HAS_HOME_OFFSET - SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]); - SERIAL_ECHOLNPAIR("] = ", home_offset[axis]); - #endif - DEBUG_POS("", current_position); - SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.homed(axis); - #endif -} - -/** - * Homing bump feedrate (mm/s) - */ -inline float 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 - static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; - uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); - if (hbd < 1) { - hbd = 10; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); - } - return homing_feedrate(axis) / hbd; -} - -/** - * Some planner shorthand inline functions - */ - -/** - * Move the planner to the current position from wherever it last moved - * (or from wherever it has been told it is located). - */ -inline void buffer_line_to_current_position() { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_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. - */ -inline 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); -} - -#if IS_KINEMATIC - /** - * Calculate delta, start a line, and set current_position to destination - */ - void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination); - #endif - - #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)); - #else - if ( current_position[X_AXIS] == destination[X_AXIS] - && current_position[Y_AXIS] == destination[Y_AXIS] - && current_position[Z_AXIS] == destination[Z_AXIS] - && current_position[E_AXIS] == destination[E_AXIS] - ) return; - - planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder); - #endif - - set_current_from_destination(); - } -#endif // IS_KINEMATIC - -/** - * Plan a move to (X, Y, Z) and set the current_position. - * The final current_position may not be the one that was requested - * Caution: 'destination' is modified by this function. - */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s/*=0.0*/) { - const float old_feedrate_mm_s = feedrate_mm_s; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, LOGICAL_X_POSITION(rx), LOGICAL_Y_POSITION(ry), LOGICAL_Z_POSITION(rz)); - #endif - - const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS); - - #if ENABLED(DELTA) - - if (!position_is_reachable(rx, ry)) return; - - feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - - set_destination_from_current(); // sync destination at the start - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination); - #endif - - // 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) - destination[Y_AXIS] = ry; - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); - #endif - return; - } - destination[Z_AXIS] = delta_clip_start_height; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); - #endif - } - - if (rz > current_position[Z_AXIS]) { // raising? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); - #endif - } - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_move_to_destination(); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - #endif - - if (rz < current_position[Z_AXIS]) { // lowering? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); - #endif - } - - #elif IS_SCARA - - if (!position_is_reachable(rx, ry)) return; - - set_destination_from_current(); - - // 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); - } - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S); - - // 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); - } - - #else - - // If Z needs to raise, do it before moving XY - if (current_position[Z_AXIS] < rz) { - feedrate_mm_s = z_feedrate; - current_position[Z_AXIS] = rz; - buffer_line_to_current_position(); - } - - feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; - buffer_line_to_current_position(); - - // If Z needs to lower, do it after moving XY - if (current_position[Z_AXIS] > rz) { - feedrate_mm_s = z_feedrate; - current_position[Z_AXIS] = rz; - buffer_line_to_current_position(); - } - - #endif - - planner.synchronize(); - - feedrate_mm_s = old_feedrate_mm_s; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to"); - #endif -} -void do_blocking_move_to_x(const float &rx, const float &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_z(const float &rz, const float &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*/) { - do_blocking_move_to(rx, ry, current_position[Z_AXIS], fr_mm_s); -} - -// -// Prepare to do endstop or probe moves -// with custom feedrates. -// -// - Save current feedrates -// - Reset the rate multiplier -// - Reset the command timeout -// - Enable the endstops (for endstop moves) -// -void setup_for_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); - #endif - saved_feedrate_mm_s = feedrate_mm_s; - saved_feedrate_percentage = feedrate_percentage; - feedrate_percentage = 100; -} - -void clean_up_after_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); - #endif - feedrate_mm_s = saved_feedrate_mm_s; - feedrate_percentage = saved_feedrate_percentage; -} - -#if HAS_AXIS_UNHOMED_ERR - - bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { - #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); - #else - const bool xx = x && !TEST(axis_homed, X_AXIS), - yy = y && !TEST(axis_homed, Y_AXIS), - zz = z && !TEST(axis_homed, Z_AXIS); - #endif - if (xx || yy || zz) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_ECHOPGM(MSG_X); - if (yy) SERIAL_ECHOPGM(MSG_Y); - if (zz) SERIAL_ECHOPGM(MSG_Z); - SERIAL_ECHOLNPGM(" " MSG_FIRST); - - #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); - #endif - return true; - } - return false; - } - -#endif // HAS_AXIS_UNHOMED_ERR - -#if ENABLED(Z_PROBE_SLED) - - #ifndef SLED_DOCKING_OFFSET - #define SLED_DOCKING_OFFSET 0 - #endif - - /** - * Method to dock/undock a sled designed by Charles Bell. - * - * stow[in] If false, move to MAX_X and engage the solenoid - * If true, move to MAX_X and release the solenoid - */ - static void dock_sled(bool stow) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("dock_sled(", stow); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // Dock sled a bit closer to ensure proper capturing - do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); - - #if HAS_SOLENOID_1 && DISABLED(EXT_SOLENOID) - WRITE(SOL1_PIN, !stow); // switch solenoid - #endif - } - -#elif ENABLED(Z_PROBE_ALLEN_KEY) - - FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s) { - do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); - } - - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - 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 - #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 }; - do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE)); - #endif - } - -#endif // Z_PROBE_ALLEN_KEY - -#if ENABLED(PROBING_FANS_OFF) - - void fans_pause(const bool p) { - if (p != fans_paused) { - fans_paused = p; - if (p) - for (uint8_t x = 0; x < FAN_COUNT; x++) { - paused_fanSpeeds[x] = fanSpeeds[x]; - fanSpeeds[x] = 0; - } - else - for (uint8_t x = 0; x < FAN_COUNT; x++) - fanSpeeds[x] = paused_fanSpeeds[x]; - } - } - -#endif // PROBING_FANS_OFF - -#if HAS_BED_PROBE - - // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. - #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST) - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - #endif - - #if QUIET_PROBING - void probing_pause(const bool p) { - #if ENABLED(PROBING_HEATERS_OFF) - thermalManager.pause(p); - #endif - #if ENABLED(PROBING_FANS_OFF) - fans_pause(p); - #endif - if (p) safe_delay( - #if DELAY_BEFORE_PROBING > 25 - DELAY_BEFORE_PROBING - #else - 25 - #endif - ); - } - #endif // QUIET_PROBING - - #if ENABLED(BLTOUCH) - - void bltouch_command(int angle) { - MOVE_SERVO(Z_PROBE_SERVO_NR, angle); // Give the BL-Touch the command and wait - safe_delay(BLTOUCH_DELAY); - } - - bool set_bltouch_deployed(const bool deploy) { - if (deploy && TEST_BLTOUCH()) { // If BL-Touch says it's triggered - bltouch_command(BLTOUCH_RESET); // try to reset it. - bltouch_command(BLTOUCH_DEPLOY); // Also needs to deploy and stow to - bltouch_command(BLTOUCH_STOW); // clear the triggered condition. - safe_delay(1500); // Wait for internal self-test to complete. - // (Measured completion time was 0.65 seconds - // after reset, deploy, and stow sequence) - if (TEST_BLTOUCH()) { // If it still claims to be triggered... - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH); - stop(); // punt! - return true; - } - } - - bltouch_command(deploy ? BLTOUCH_DEPLOY : BLTOUCH_STOW); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("set_bltouch_deployed(", deploy); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - return false; - } - - #endif // BLTOUCH - - /** - * Raise Z to a minimum height to make room for a probe to move - */ - inline void do_probe_raise(const float z_raise) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("do_probe_raise(", z_raise); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - float z_dest = z_raise; - if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; - - NOMORE(z_dest, Z_MAX_POS); - - if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); - } - - // returns false for ok and true for failure - bool set_probe_deployed(const bool deploy) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("set_probe_deployed", current_position); - SERIAL_ECHOLNPAIR("deploy: ", deploy); - } - #endif - - if (endstops.z_probe_enabled == deploy) return false; - - // Make room for probe to deploy (or stow) - // Fix-mounted probe should only raise for deploy - #if ENABLED(FIX_MOUNTED_PROBE) - const bool deploy_stow_condition = deploy; - #else - constexpr bool deploy_stow_condition = true; - #endif - - // For beds that fall when Z is powered off only raise for trusted Z - #if ENABLED(UNKNOWN_Z_NO_RAISE) - const bool unknown_condition = TEST(axis_known_position, Z_AXIS); - #else - constexpr float unknown_condition = true; - #endif - - if (deploy_stow_condition && unknown_condition) - do_probe_raise(MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); - - #if ENABLED(Z_PROBE_SLED) || ENABLED(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)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED); - stop(); - return true; - } - #endif - - const float oldXpos = current_position[X_AXIS], - oldYpos = current_position[Y_AXIS]; - - #ifdef _TRIGGERED_WHEN_STOWED_TEST - - // If endstop is already false, the Z probe is deployed - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions. - // Would a goto be less ugly? - //while (!_TRIGGERED_WHEN_STOWED_TEST) idle(); // would offer the opportunity - // for a triggered when stowed manual probe. - - if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early - // otherwise an Allen-Key probe can't be stowed. - #endif - - #if ENABLED(SOLENOID_PROBE) - - #if HAS_SOLENOID_1 - WRITE(SOL1_PIN, deploy); - #endif - - #elif ENABLED(Z_PROBE_SLED) - - dock_sled(!deploy); - - #elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH) - - MOVE_SERVO(Z_PROBE_SERVO_NR, z_servo_angle[deploy ? 0 : 1]); - - #elif ENABLED(Z_PROBE_ALLEN_KEY) - - deploy ? run_deploy_moves_script() : run_stow_moves_script(); - - #endif - - #ifdef _TRIGGERED_WHEN_STOWED_TEST - } // _TRIGGERED_WHEN_STOWED_TEST == deploy - - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed? - - if (IsRunning()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z-Probe failed"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - return true; - - } // _TRIGGERED_WHEN_STOWED_TEST == deploy - - #endif - - do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy - endstops.enable_z_probe(deploy); - return false; - } - - /** - * @brief Used by run_z_probe to do a single Z probe move. - * - * @param z Z destination - * @param fr_mm_s Feedrate in mm/s - * @return true to indicate an error - */ - static bool do_probe_move(const float z, const float fr_mm_s) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> do_probe_move", current_position); - #endif - - #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } - #endif - - // Deploy BLTouch at the start of any probe - #if ENABLED(BLTOUCH) - if (set_bltouch_deployed(true)) return true; - #endif - - #if QUIET_PROBING - probing_pause(true); - #endif - - // Move down until probe triggered - do_blocking_move_to_z(z, fr_mm_s); - - // Check to see if the probe was triggered - const bool probe_triggered = TEST(endstops.trigger_state(), - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - Z_MIN - #else - Z_MIN_PROBE - #endif - ); - - #if QUIET_PROBING - probing_pause(false); - #endif - - // Retract BLTouch immediately after a probe if it was triggered - #if ENABLED(BLTOUCH) - if (probe_triggered && set_bltouch_deployed(false)) return true; - #endif - - endstops.hit_on_purpose(); - - // Get Z where the steppers were interrupted - set_current_from_steppers_for_axis(Z_AXIS); - - // Tell the planner where we actually are - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position); - #endif - - return !probe_triggered; - } - - /** - * @details Used by probe_pt to do a single Z probe at the current position. - * Leaves current_position[Z_AXIS] at the height where the probe triggered. - * - * @return The raw Z position where the probe was triggered - */ - static float run_z_probe() { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position); - #endif - - // 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; - - // Double-probing does a fast probe followed by a slow probe - #if MULTIPLE_PROBING == 2 - - // Do a first probe at the fast speed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("FAST Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } - - float first_probe_z = current_position[Z_AXIS]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("1st Probe Z:", first_probe_z); - #endif - - // move up to make clearance for the probe - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - - #else - - // If the nozzle is well over the travel height then - // move down quickly before doing the slow probe - float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0; - if (zprobe_zoffset < 0) z -= zprobe_zoffset; - - if (current_position[Z_AXIS] > z) { - // If we don't make it to the z position (i.e. the probe triggered), move up to make clearance for the probe - if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - } - #endif - - #if MULTIPLE_PROBING > 2 - float probes_total = 0; - for (uint8_t p = MULTIPLE_PROBING + 1; --p;) { - #endif - - // move down slowly to find bed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("SLOW Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - #endif - return NAN; - } - - #if MULTIPLE_PROBING > 2 - probes_total += current_position[Z_AXIS]; - if (p > 1) do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - } - #endif - - #if MULTIPLE_PROBING > 2 - - // Return the average value of all probes - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); - - #elif MULTIPLE_PROBING == 2 - - const float z2 = current_position[Z_AXIS]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("2nd Probe Z:", z2); - SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - z2); - } - #endif - - // Return a weighted average of the fast and slow probes - const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2; - - #else - - // Return the single probe result - const float measured_z = current_position[Z_AXIS]; - - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); - #endif - - return measured_z; - } - - /** - * - Move to the given XY - * - Deploy the probe, if not already deployed - * - Probe the bed, get the Z position - * - Depending on the 'stow' flag - * - Stow the probe, or - * - 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*/) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> probe_pt(", LOGICAL_X_POSITION(rx)); - SERIAL_ECHOPAIR(", ", LOGICAL_Y_POSITION(ry)); - SERIAL_ECHOPAIR(", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none"); - SERIAL_ECHOPAIR(", ", int(verbose_level)); - SERIAL_ECHOPAIR(", ", probe_relative ? "probe" : "nozzle"); - SERIAL_ECHOLNPGM("_relative)"); - DEBUG_POS("", current_position); - } - #endif - - // TODO: Adapt for SCARA, where the offset rotates - 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); - } - else if (!position_is_reachable(nx, ny)) return NAN; // The given position is in terms of the nozzle - - const float nz = - #if ENABLED(DELTA) - // Move below clip height or xy move will be aborted by do_blocking_move_to - MIN(current_position[Z_AXIS], delta_clip_start_height) - #else - current_position[Z_AXIS] - #endif - ; - - const float old_feedrate_mm_s = feedrate_mm_s; - feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; - - // Move the probe to the starting XYZ - do_blocking_move_to(nx, ny, nz); - - float measured_z = NAN; - if (!DEPLOY_PROBE()) { - measured_z = run_z_probe() + zprobe_zoffset; - - const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; - if (big_raise || raise_after == PROBE_PT_RAISE) - do_blocking_move_to_z(current_position[Z_AXIS] + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - else if (raise_after == PROBE_PT_STOW) - if (STOW_PROBE()) measured_z = NAN; - } - - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Bed X: "); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL(); - } - - feedrate_mm_s = old_feedrate_mm_s; - - if (isnan(measured_z)) { - LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED); - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED); - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); - #endif - - return measured_z; - } - -#endif // HAS_BED_PROBE - -#if HAS_LEVELING - - bool leveling_is_valid() { - return - #if ENABLED(MESH_BED_LEVELING) - mbl.has_mesh() - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - !!bilinear_grid_spacing[X_AXIS] - #elif ENABLED(AUTO_BED_LEVELING_UBL) - ubl.mesh_is_valid() - #else // 3POINT, LINEAR - true - #endif - ; - } - - /** - * Turn bed leveling on or off, fixing the current - * position as-needed. - * - * Disable: Current position = physical position - * Enable: Current position = "unleveled" physical position - */ - void set_bed_leveling_enabled(const bool enable/*=true*/) { - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const bool can_change = (!enable || leveling_is_valid()); - #else - constexpr bool can_change = true; - #endif - - if (can_change && enable != planner.leveling_active) { - - planner.synchronize(); - - #if ENABLED(MESH_BED_LEVELING) - - if (!enable) - planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); - - const bool enabling = enable && leveling_is_valid(); - planner.leveling_active = enabling; - if (enabling) planner.unapply_leveling(current_position); - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - #if PLANNER_LEVELING - if (planner.leveling_active) { // leveling from on to off - // change unleveled current_position to physical current_position without moving steppers. - planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); - planner.leveling_active = false; // disable only AFTER calling apply_leveling - } - else { // leveling from off to on - planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored - // change physical current_position to unleveled current_position without moving steppers. - planner.unapply_leveling(current_position); - } - #else - // UBL equivalents for apply/unapply_leveling - #if ENABLED(SKEW_CORRECTION) - float pos[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - planner.skew(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS]); - #else - const float (&pos)[XYZE] = current_position; - #endif - if (planner.leveling_active) { - current_position[Z_AXIS] += ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - planner.leveling_active = false; - } - else { - planner.leveling_active = true; - current_position[Z_AXIS] -= ubl.get_z_correction(pos[X_AXIS], pos[Y_AXIS]); - } - #endif - - #else // ABL - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Force bilinear_z_offset to re-calculate next time - const float reset[XYZ] = { -9999.999, -9999.999, 0 }; - (void)bilinear_z_offset(reset); - #endif - - // Enable or disable leveling compensation in the planner - planner.leveling_active = enable; - - if (!enable) - // When disabling just get the current position from the steppers. - // This will yield the smallest error when first converted back to steps. - set_current_from_steppers_for_axis( - #if ABL_PLANAR - ALL_AXES - #else - Z_AXIS - #endif - ); - else - // When enabling, remove compensation from the current position, - // so compensation will give the right stepper counts. - planner.unapply_leveling(current_position); - - SYNC_PLAN_POSITION_KINEMATIC(); - - #endif // ABL - } - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { - - if (planner.z_fade_height == zfh) return; - - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - - planner.set_z_fade_height(zfh); - - if (leveling_was_active) { - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - set_bed_leveling_enabled(true); - if (do_report && memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); - } - } - - #endif // LEVELING_FADE_HEIGHT - - /** - * Reset calibration results to zero. - */ - void reset_bed_level() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level"); - #endif - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif 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; - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); - #endif - } - -#endif // HAS_LEVELING - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) - - /** - * Enable to produce output in JSON format suitable - * for SCAD or JavaScript mesh visualizers. - * - * Visualize meshes in OpenSCAD using the included script. - * - * buildroot/shared/scripts/MarlinMesh.scad - */ - //#define SCAD_MESH_OUTPUT - - /** - * Print calibration results for plotting or manual frame adjustment. - */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const element_2d_fn fn) { - #ifndef SCAD_MESH_OUTPUT - for (uint8_t x = 0; x < sx; x++) { - for (uint8_t i = 0; i < precision + 2 + (x < 10 ? 1 : 0); i++) - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL((int)x); - } - SERIAL_EOL(); - #endif - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLLNPGM("measured_z = ["); // open 2D array - #endif - for (uint8_t y = 0; y < sy; y++) { - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM(" ["); // open sub-array - #else - if (y < 10) SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL((int)y); - #endif - for (uint8_t x = 0; x < sx; x++) { - SERIAL_PROTOCOLCHAR(' '); - const float offset = fn(x, y); - if (!isnan(offset)) { - if (offset >= 0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(offset, precision); - } - else { - #ifdef SCAD_MESH_OUTPUT - for (uint8_t i = 3; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLPGM("NAN"); - #else - for (uint8_t i = 0; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(i ? '=' : ' '); - #endif - } - #ifdef SCAD_MESH_OUTPUT - if (x < sx - 1) SERIAL_PROTOCOLCHAR(','); - #endif - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLCHAR(']'); // close sub-array - if (y < sy - 1) SERIAL_PROTOCOLCHAR(','); - #endif - SERIAL_EOL(); - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM("];"); // close 2D array - #endif - SERIAL_EOL(); - } - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - /** - * Extrapolate a single point from its neighbors - */ - static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Extrapolate ["); - if (x < 10) SERIAL_CHAR(' '); - SERIAL_ECHO((int)x); - SERIAL_CHAR(xdir ? (xdir > 0 ? '+' : '-') : ' '); - SERIAL_CHAR(' '); - if (y < 10) SERIAL_CHAR(' '); - SERIAL_ECHO((int)y); - SERIAL_CHAR(ydir ? (ydir > 0 ? '+' : '-') : ' '); - SERIAL_CHAR(']'); - } - #endif - if (!isnan(z_values[x][y])) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" (done)"); - #endif - return; // Don't overwrite good values. - } - SERIAL_EOL(); - - // Get X neighbors, Y neighbors, and XY neighbors - const uint8_t x1 = x + xdir, y1 = y + ydir, x2 = x1 + xdir, y2 = y1 + ydir; - float a1 = z_values[x1][y ], a2 = z_values[x2][y ], - b1 = z_values[x ][y1], b2 = z_values[x ][y2], - c1 = z_values[x1][y1], c2 = z_values[x2][y2]; - - // Treat far unprobed points as zero, near as equal to far - if (isnan(a2)) a2 = 0.0; if (isnan(a1)) a1 = a2; - if (isnan(b2)) b2 = 0.0; if (isnan(b1)) b1 = b2; - if (isnan(c2)) c2 = 0.0; if (isnan(c1)) c1 = c2; - - const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2; - - // Take the average instead of the median - z_values[x][y] = (a + b + c) / 3.0; - - // Median is robust (ignores outliers). - // z_values[x][y] = (a < b) ? ((b < c) ? b : (c < a) ? a : c) - // : ((c < b) ? b : (a < c) ? a : c); - } - - //Enable this if your SCARA uses 180° of total area - //#define EXTRAPOLATE_FROM_EDGE - - #if ENABLED(EXTRAPOLATE_FROM_EDGE) - #if GRID_MAX_POINTS_X < GRID_MAX_POINTS_Y - #define HALF_IN_X - #elif GRID_MAX_POINTS_Y < GRID_MAX_POINTS_X - #define HALF_IN_Y - #endif - #endif - - /** - * Fill in the unprobed points (corners of circular print surface) - * using linear extrapolation, away from the center. - */ - static void extrapolate_unprobed_bed_level() { - #ifdef HALF_IN_X - constexpr uint8_t ctrx2 = 0, xlen = GRID_MAX_POINTS_X - 1; - #else - constexpr uint8_t ctrx1 = (GRID_MAX_POINTS_X - 1) / 2, // left-of-center - ctrx2 = (GRID_MAX_POINTS_X) / 2, // right-of-center - xlen = ctrx1; - #endif - - #ifdef HALF_IN_Y - constexpr uint8_t ctry2 = 0, ylen = GRID_MAX_POINTS_Y - 1; - #else - constexpr uint8_t ctry1 = (GRID_MAX_POINTS_Y - 1) / 2, // top-of-center - ctry2 = (GRID_MAX_POINTS_Y) / 2, // bottom-of-center - ylen = ctry1; - #endif - - for (uint8_t xo = 0; xo <= xlen; xo++) - for (uint8_t yo = 0; yo <= ylen; yo++) { - uint8_t x2 = ctrx2 + xo, y2 = ctry2 + yo; - #ifndef HALF_IN_X - const uint8_t x1 = ctrx1 - xo; - #endif - #ifndef HALF_IN_Y - const uint8_t y1 = ctry1 - yo; - #ifndef HALF_IN_X - extrapolate_one_point(x1, y1, +1, +1); // left-below + + - #endif - extrapolate_one_point(x2, y1, -1, +1); // right-below - + - #endif - #ifndef HALF_IN_X - extrapolate_one_point(x1, y2, +1, -1); // left-above + - - #endif - extrapolate_one_point(x2, y2, -1, -1); // right-above - - - } - - } - - static void print_bilinear_leveling_grid() { - SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - - #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) - #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) - float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; - int bilinear_grid_spacing_virt[2] = { 0 }; - float bilinear_grid_factor_virt[2] = { 0 }; - - static void print_bilinear_leveling_grid_virt() { - SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); - print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values_virt[ix][iy]; } - ); - } - - #define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I)) - float bed_level_virt_coord(const uint8_t x, const uint8_t y) { - uint8_t ep = 0, ip = 1; - if (!x || x == ABL_TEMP_POINTS_X - 1) { - if (x) { - ep = GRID_MAX_POINTS_X - 1; - ip = GRID_MAX_POINTS_X - 2; - } - if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2)) - return LINEAR_EXTRAPOLATION( - z_values[ep][y - 1], - z_values[ip][y - 1] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(ep + 1, y), - bed_level_virt_coord(ip + 1, y) - ); - } - if (!y || y == ABL_TEMP_POINTS_Y - 1) { - if (y) { - ep = GRID_MAX_POINTS_Y - 1; - ip = GRID_MAX_POINTS_Y - 2; - } - if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2)) - return LINEAR_EXTRAPOLATION( - z_values[x - 1][ep], - z_values[x - 1][ip] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(x, ep + 1), - bed_level_virt_coord(x, ip + 1) - ); - } - return z_values[x - 1][y - 1]; - } - - static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { - return ( - p[i-1] * -t * sq(1 - t) - + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) - + p[i+1] * t * (1 + 4 * t - 3 * sq(t)) - - p[i+2] * sq(t) * (1 - t) - ) * 0.5; - } - - static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) { - float row[4], column[4]; - for (uint8_t i = 0; i < 4; i++) { - for (uint8_t j = 0; j < 4; j++) { - column[j] = bed_level_virt_coord(i + x - 1, j + y - 1); - } - row[i] = bed_level_virt_cmr(column, 1, ty); - } - return bed_level_virt_cmr(row, 1, tx); - } - - void bed_level_virt_interpolate() { - bilinear_grid_spacing_virt[X_AXIS] = bilinear_grid_spacing[X_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_spacing_virt[Y_AXIS] = bilinear_grid_spacing[Y_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_factor_virt[X_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[X_AXIS]); - bilinear_grid_factor_virt[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[Y_AXIS]); - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) - for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { - if ((ty && y == GRID_MAX_POINTS_Y - 1) || (tx && x == GRID_MAX_POINTS_X - 1)) - continue; - z_values_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = - bed_level_virt_2cmr( - x + 1, - y + 1, - (float)tx / (BILINEAR_SUBDIVISIONS), - (float)ty / (BILINEAR_SUBDIVISIONS) - ); - } - } - #endif // ABL_BILINEAR_SUBDIVISION - - // Refresh after other values have been updated - void refresh_bed_level() { - bilinear_grid_factor[X_AXIS] = RECIPROCAL(bilinear_grid_spacing[X_AXIS]); - bilinear_grid_factor[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing[Y_AXIS]); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - -#endif // AUTO_BED_LEVELING_BILINEAR - -#if ENABLED(SENSORLESS_HOMING) - - /** - * Set sensorless homing if the axis has it, accounting for Core Kinematics. - */ - void sensorless_homing_per_axis(const AxisEnum axis, const bool enable=true) { - switch (axis) { - #if X_SENSORLESS - case X_AXIS: - tmc_sensorless_homing(stepperX, enable); - #if CORE_IS_XY && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #elif CORE_IS_XZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - tmc_sensorless_homing(stepperY, enable); - #if CORE_IS_XY && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Z_SENSORLESS - tmc_sensorless_homing(stepperZ, enable); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - tmc_sensorless_homing(stepperZ, enable); - #if CORE_IS_XZ && X_SENSORLESS - tmc_sensorless_homing(stepperX, enable); - #elif CORE_IS_YZ && Y_SENSORLESS - tmc_sensorless_homing(stepperY, enable); - #endif - break; - #endif - default: break; - } - } - -#endif // SENSORLESS_HOMING - -/** - * Home an individual linear axis - */ -static void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> do_homing_move(", axis_codes[axis]); - SERIAL_ECHOPAIR(", ", distance); - SERIAL_ECHOPGM(", "); - if (fr_mm_s) - SERIAL_ECHO(fr_mm_s); - else { - SERIAL_ECHOPAIR("[", homing_feedrate(axis)); - SERIAL_CHAR(']'); - } - SERIAL_ECHOLNPGM(")"); - } - #endif - - #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); - } - #endif - - // Only do some things when moving towards an endstop - const int8_t axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - (axis == X_AXIS) ? x_home_dir(active_extruder) : - #endif - home_dir(axis); - const bool is_home_dir = (axis_home_dir > 0) == (distance > 0); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(true); - #endif - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis); - #endif - } - - // Tell the planner the axis is at 0 - current_position[axis] = 0; - - // Do the move, which is required to hit an endstop - #if IS_SCARA - SYNC_PLAN_POSITION_KINEMATIC(); - current_position[axis] = distance; - inverse_kinematics(current_position); - planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); - #else - sync_plan_position(); - current_position[axis] = distance; // Set delta/cartesian axes directly - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); - #endif - - planner.synchronize(); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(false); - #endif - - endstops.validate_homing_move(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(axis, false); - #endif - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("<<< do_homing_move(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif -} - -/** - * Home an individual "raw axis" to its endstop. - * This applies to XYZ on Cartesian and Core robots, and - * to the individual ABC steppers on DELTA and SCARA. - * - * At the end of the procedure the axis is marked as - * homed and the current position of that axis is updated. - * Kinematic robots should wait till all axes are homed - * before updating the current position. - */ - -static void homeaxis(const AxisEnum axis) { - - #if IS_SCARA - // Only Z homing (with probe) is permitted - if (axis != Z_AXIS) { BUZZ(100, 880); return; } - #else - #define CAN_HOME(A) \ - (axis == _AXIS(A) && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0))) - if (!CAN_HOME(X) && !CAN_HOME(Y) && !CAN_HOME(Z)) return; - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> homeaxis(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - const int axis_home_dir = ( - #if ENABLED(DUAL_X_CARRIAGE) - axis == X_AXIS ? x_home_dir(active_extruder) : - #endif - home_dir(axis) - ); - - // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && DEPLOY_PROBE()) return; - #endif - - // Set flags for X, Y, Z motor locking - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - switch (axis) { - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - case Z_AXIS: - #endif - stepper.set_homing_dual_axis(true); - default: break; - } - #endif - - // Fast move towards endstop until triggered - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:"); - #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - - do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif - - // When homing Z with probe respect probe clearance - const float bump = axis_home_dir * ( - #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS && (Z_HOME_BUMP_MM)) ? MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_HOME_BUMP_MM) : - #endif - home_bump_mm(axis) - ); - - // If a second homing move is configured... - if (bump) { - // Move away from the endstop by the axis HOME_BUMP_MM - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Move Away:"); - #endif - do_homing_move(axis, -bump - #if HOMING_Z_WITH_PROBE - , axis == Z_AXIS ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0.00 - #endif - ); - - // Slow move towards endstop until triggered - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:"); - #endif - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be deployed every time - if (axis == Z_AXIS && set_bltouch_deployed(true)) return; - #endif - - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - // BLTOUCH needs to be stowed after trigger to rearm itself - if (axis == Z_AXIS) set_bltouch_deployed(false); - #endif - } - - /** - * Home axes that have dual endstops... differently - */ - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - const bool pos_dir = axis_home_dir > 0; - #if ENABLED(X_DUAL_ENDSTOPS) - if (axis == X_AXIS) { - const float adj = ABS(endstops.x_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_x_lock(false); - stepper.set_x2_lock(false); - } - } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (axis == Y_AXIS) { - const float adj = ABS(endstops.y_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_y_lock(false); - stepper.set_y2_lock(false); - } - } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (axis == Z_AXIS) { - const float adj = ABS(endstops.z_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); - stepper.set_z2_lock(false); - } - } - #endif - stepper.set_homing_dual_axis(false); - #endif - - #if IS_SCARA - - set_axis_is_at_home(axis); - SYNC_PLAN_POSITION_KINEMATIC(); - - #elif ENABLED(DELTA) - - // Delta has already moved all three towers up in G28 - // so here it re-homes each tower in turn. - // Delta homing treats the axes as normal linear axes. - - // retrace by the amount specified in delta_endstop_adj + additional dist in order to have minimum steps - if (delta_endstop_adj[axis] * Z_HOME_DIR <= 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("delta_endstop_adj:"); - #endif - do_homing_move(axis, delta_endstop_adj[axis] - (MIN_STEPS_PER_SEGMENT + 1) * planner.steps_to_mm[axis] * Z_HOME_DIR); - } - - #else - - // For cartesian/core machines, - // set the axis to its home position - set_axis_is_at_home(axis); - sync_plan_position(); - - destination[axis] = current_position[axis]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); - #endif - - #endif - - // Put away the Z probe - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && STOW_PROBE()) return; - #endif - - // Clear retracted status if homing the Z axis - #if ENABLED(FWRETRACT) - if (axis == Z_AXIS) fwretract.hop_amount = 0.0; - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("<<< homeaxis(", axis_codes[axis]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif -} // homeaxis() - -#if ENABLED(MIXING_EXTRUDER) - - void normalize_mix() { - float mix_total = 0.0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += RECIPROCAL(mixing_factor[i]); - // Scale all values if they don't add up to ~1.0 - if (!NEAR(mix_total, 1.0)) { - SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling."); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= mix_total; - } - } - - #if ENABLED(DIRECT_MIXING_IN_G1) - // Get mixing parameters from the GCode - // The total "must" be 1.0 (but it will be normalized) - // If no mix factors are given, the old mix is preserved - void gcode_get_mix() { - const char* mixing_codes = "ABCDHI"; - byte mix_bits = 0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) { - if (parser.seenval(mixing_codes[i])) { - SBI(mix_bits, i); - float v = parser.value_float(); - NOLESS(v, 0.0); - mixing_factor[i] = RECIPROCAL(v); - } - } - // If any mixing factors were included, clear the rest - // If none were included, preserve the last mix - if (mix_bits) { - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - if (!TEST(mix_bits, i)) mixing_factor[i] = 0.0; - normalize_mix(); - } - } - #endif - -#endif - -/** - * *************************************************************************** - * ***************************** G-CODE HANDLING ***************************** - * *************************************************************************** - */ - -/** - * Set XYZE destination and feedrate from the current GCode command - * - * - Set destination from included axis codes - * - Set to current for missing axis codes - * - Set the feedrate, if included - */ -void gcode_get_destination() { - LOOP_XYZE(i) { - if (parser.seen(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); - } - else - destination[i] = current_position[i]; - } - - if (parser.linearval('F') > 0) - feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); - - #if ENABLED(PRINTCOUNTER) - if (!DEBUGGING(DRYRUN)) - print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); - #endif - - // Get ABCDHI mixing factors - #if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1) - gcode_get_mix(); - #endif -} - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - - /** - * Output a "busy" message at regular intervals - * while the machine is not accepting commands. - */ - void host_keepalive() { - const millis_t ms = millis(); - if (!suspend_auto_report && host_keepalive_interval && busy_state != NOT_BUSY) { - if (PENDING(ms, next_busy_signal_ms)) return; - switch (busy_state) { - case IN_HANDLER: - case IN_PROCESS: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PROCESSING); - break; - case PAUSED_FOR_USER: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_USER); - break; - case PAUSED_FOR_INPUT: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT); - break; - default: - break; - } - } - next_busy_signal_ms = ms + host_keepalive_interval * 1000UL; - } - -#endif // HOST_KEEPALIVE_FEATURE - - -/************************************************** - ***************** GCode Handlers ***************** - **************************************************/ - -#if ENABLED(NO_MOTION_BEFORE_HOMING) - #define G0_G1_CONDITION !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) -#else - #define G0_G1_CONDITION true -#endif - -/** - * G0, G1: Coordinated movement of X Y Z E axes - */ -inline void gcode_G0_G1( - #if IS_SCARA - bool fast_move=false - #endif -) { - if (IsRunning() && G0_G1_CONDITION) { - gcode_get_destination(); // For X Y Z E F - - #if ENABLED(FWRETRACT) - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - // When M209 Autoretract is enabled, convert E-only moves to firmware retract/prime moves - if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { - const float echange = destination[E_AXIS] - current_position[E_AXIS]; - // Is this a retract or prime move? - if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) { - current_position[E_AXIS] = destination[E_AXIS]; // Hide a G1-based retract/prime from calculations - sync_plan_position_e(); // AND from the planner - return fwretract.retract(echange < 0.0); // Firmware-based retract/prime (double-retract ignored) - } - } - } - #endif // FWRETRACT - - #if IS_SCARA - fast_move ? prepare_uninterpolated_move_to_destination() : prepare_move_to_destination(); - #else - prepare_move_to_destination(); - #endif - - #if ENABLED(NANODLP_Z_SYNC) - #if ENABLED(NANODLP_ALL_AXIS) - #define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message - #else - #define _MOVE_SYNC parser.seenval('Z') // Only for Z move - #endif - if (_MOVE_SYNC) { - planner.synchronize(); - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - } - #endif - } -} - -/** - * G2: Clockwise Arc - * G3: Counterclockwise Arc - * - * This command has two forms: IJ-form and R-form. - * - * - I specifies an X offset. J specifies a Y offset. - * At least one of the IJ parameters is required. - * X and Y can be omitted to do a complete circle. - * The given XY is not error-checked. The arc ends - * based on the angle of the destination. - * Mixing I or J with R will throw an error. - * - * - R specifies the radius. X or Y is required. - * Omitting both X and Y will throw an error. - * X or Y must differ from the current XY. - * Mixing R with I or J will throw an error. - * - * - P specifies the number of full circles to do - * before the specified arc move. - * - * Examples: - * - * G2 I10 ; CW circle centered at X+10 - * G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12 - */ -#if ENABLED(ARC_SUPPORT) - - inline void gcode_G2_G3(const bool clockwise) { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - - #if ENABLED(SF_ARC_FIX) - const bool relative_mode_backup = relative_mode; - relative_mode = true; - #endif - - gcode_get_destination(); - - #if ENABLED(SF_ARC_FIX) - relative_mode = relative_mode_backup; - #endif - - 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 - 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 / d, sy = dx / d, // 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 { - if (parser.seenval('I')) arc_offset[0] = parser.value_linear_units(); - if (parser.seenval('J')) arc_offset[1] = parser.value_linear_units(); - } - - if (arc_offset[0] || arc_offset[1]) { - - #if ENABLED(ARC_P_CIRCLES) - // P indicates number of circles to do - int8_t circles_to_do = parser.byteval('P'); - if (!WITHIN(circles_to_do, 0, 100)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } - while (circles_to_do--) - plan_arc(current_position, arc_offset, clockwise); - #endif - - // Send the arc to the planner - plan_arc(destination, arc_offset, clockwise); - } - else { - // Bad arguments - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } - } - } - -#endif // ARC_SUPPORT - -void dwell(millis_t time) { - time += millis(); - while (PENDING(millis(), time)) idle(); -} - -/** - * G4: Dwell S or P - */ -inline void gcode_G4() { - millis_t dwell_ms = 0; - - if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait - if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait - - planner.synchronize(); - #if ENABLED(NANODLP_Z_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL); - - dwell(dwell_ms); -} - -#if ENABLED(BEZIER_CURVE_SUPPORT) - - /** - * Parameters interpreted according to: - * http://linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G5-Cubic-Spline - * However I, J omission is not supported at this point; all - * parameters can be omitted and default to zero. - */ - - /** - * G5: Cubic B-spline - */ - inline void gcode_G5() { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - - #if ENABLED(CNC_WORKSPACE_PLANES) - if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_BAD_PLANE_MODE); - return; - } - #endif - - gcode_get_destination(); - - const float offset[] = { - parser.linearval('I'), - parser.linearval('J'), - parser.linearval('P'), - parser.linearval('Q') - }; - - plan_cubic_move(destination, offset); - } - } - -#endif // BEZIER_CURVE_SUPPORT - -#if ENABLED(FWRETRACT) - - /** - * G10 - Retract filament according to settings of M207 - */ - inline void gcode_G10() { - #if EXTRUDERS > 1 - const bool rs = parser.boolval('S'); - #endif - fwretract.retract(true - #if EXTRUDERS > 1 - , rs - #endif - ); - } - - /** - * G11 - Recover filament according to settings of M208 - */ - inline void gcode_G11() { fwretract.retract(false); } - -#endif // FWRETRACT - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - /** - * G12: Clean the nozzle - */ - inline void gcode_G12() { - // Don't allow nozzle cleaning without homing first - if (axis_unhomed_error()) return; - - const uint8_t pattern = parser.ushortval('P', 0), - strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), - objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); - const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); - - Nozzle::clean(pattern, strokes, radius, objects); - } -#endif - -#if ENABLED(CNC_WORKSPACE_PLANES) - - inline void report_workspace_plane() { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Workspace Plane "); - serialprintPGM( - workspace_plane == PLANE_YZ ? PSTR("YZ\n") : - workspace_plane == PLANE_ZX ? PSTR("ZX\n") : - PSTR("XY\n") - ); - } - - inline void set_workspace_plane(const WorkspacePlane plane) { - workspace_plane = plane; - if (DEBUGGING(INFO)) report_workspace_plane(); - } - - /** - * G17: Select Plane XY - * G18: Select Plane ZX - * G19: Select Plane YZ - */ - inline void gcode_G17() { set_workspace_plane(PLANE_XY); } - inline void gcode_G18() { set_workspace_plane(PLANE_ZX); } - inline void gcode_G19() { set_workspace_plane(PLANE_YZ); } - -#endif // CNC_WORKSPACE_PLANES - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - - /** - * Select a coordinate system and update the workspace offset. - * System index -1 is used to specify machine-native. - */ - bool select_coordinate_system(const int8_t _new) { - if (active_coordinate_system == _new) return false; - 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]); - 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; - update_software_endstops((AxisEnum)i); - } - } - return true; - } - - /** - * G53: Apply native workspace to the current move - * - * In CNC G-code G53 is a modifier. - * It precedes a movement command (or other modifiers) on the same line. - * This is the first command to use parser.chain() to make this possible. - * - * Marlin also uses G53 on a line by itself to go back to native space. - */ - inline void gcode_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; - } - } - - /** - * G54-G59.3: Select a new workspace - * - * A workspace is an XYZ offset to the machine native space. - * All workspaces default to 0,0,0 at start, or with EEPROM - * support they may be restored from a previous session. - * - * G92 is used to set the current workspace's offset. - */ - inline void gcode_G54_59(uint8_t subcode=0) { - const int8_t _space = parser.codenum - 54 + subcode; - if (select_coordinate_system(_space)) { - SERIAL_PROTOCOLLNPAIR("Select workspace ", _space); - report_current_position(); - } - } - FORCE_INLINE void gcode_G54() { gcode_G54_59(); } - FORCE_INLINE void gcode_G55() { gcode_G54_59(); } - FORCE_INLINE void gcode_G56() { gcode_G54_59(); } - FORCE_INLINE void gcode_G57() { gcode_G54_59(); } - FORCE_INLINE void gcode_G58() { gcode_G54_59(); } - FORCE_INLINE void gcode_G59() { gcode_G54_59(parser.subcode); } - -#endif - -#if ENABLED(INCH_MODE_SUPPORT) - /** - * G20: Set input mode to inches - */ - inline void gcode_G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } - - /** - * G21: Set input mode to millimeters - */ - inline void gcode_G21() { parser.set_input_linear_units(LINEARUNIT_MM); } -#endif - -#if ENABLED(NOZZLE_PARK_FEATURE) - /** - * G27: Park the nozzle - */ - inline void gcode_G27() { - // Don't allow nozzle parking without homing first - if (axis_unhomed_error()) return; - Nozzle::park(parser.ushortval('P')); - } -#endif // NOZZLE_PARK_FEATURE - -#if ENABLED(QUICK_HOME) - - static void quick_home_xy() { - - // Pretend the current position is 0,0 - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; - sync_plan_position(); - - const int x_axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - x_home_dir(active_extruder) - #else - home_dir(X_AXIS) - #endif - ; - - const float mlx = max_length(X_AXIS), - mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_s = MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS); - sensorless_homing_per_axis(Y_AXIS); - #endif - - do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s); - - endstops.validate_homing_move(); - - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; - - #if ENABLED(SENSORLESS_HOMING) - sensorless_homing_per_axis(X_AXIS, false); - sensorless_homing_per_axis(Y_AXIS, false); - #endif - } - -#endif // QUICK_HOME - -#if ENABLED(DEBUG_LEVELING_FEATURE) - - void log_machine_info() { - SERIAL_ECHOPGM("Machine Type: "); - #if ENABLED(DELTA) - SERIAL_ECHOLNPGM("Delta"); - #elif IS_SCARA - SERIAL_ECHOLNPGM("SCARA"); - #elif IS_CORE - SERIAL_ECHOLNPGM("Core"); - #else - SERIAL_ECHOLNPGM("Cartesian"); - #endif - - SERIAL_ECHOPGM("Probe: "); - #if ENABLED(PROBE_MANUALLY) - SERIAL_ECHOLNPGM("PROBE_MANUALLY"); - #elif ENABLED(FIX_MOUNTED_PROBE) - SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE"); - #elif ENABLED(BLTOUCH) - SERIAL_ECHOLNPGM("BLTOUCH"); - #elif HAS_Z_SERVO_PROBE - SERIAL_ECHOLNPGM("SERVO PROBE"); - #elif ENABLED(Z_PROBE_SLED) - SERIAL_ECHOLNPGM("Z_PROBE_SLED"); - #elif ENABLED(Z_PROBE_ALLEN_KEY) - SERIAL_ECHOLNPGM("Z_PROBE_ALLEN_KEY"); - #else - SERIAL_ECHOLNPGM("NONE"); - #endif - - #if HAS_BED_PROBE - SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER); - SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER); - SERIAL_ECHOPAIR(" Z:", zprobe_zoffset); - #if X_PROBE_OFFSET_FROM_EXTRUDER > 0 - SERIAL_ECHOPGM(" (Right"); - #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0 - SERIAL_ECHOPGM(" (Left"); - #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0 - SERIAL_ECHOPGM(" (Middle"); - #else - SERIAL_ECHOPGM(" (Aligned With"); - #endif - #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Distal"); - #else - SERIAL_ECHOPGM("-Back"); - #endif - #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 - #if IS_SCARA - SERIAL_ECHOPGM("-Proximal"); - #else - SERIAL_ECHOPGM("-Front"); - #endif - #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 - SERIAL_ECHOPGM("-Center"); - #endif - if (zprobe_zoffset < 0) - SERIAL_ECHOPGM(" & Below"); - else if (zprobe_zoffset > 0) - SERIAL_ECHOPGM(" & Above"); - else - SERIAL_ECHOPGM(" & Same Z as"); - SERIAL_ECHOLNPGM(" Nozzle)"); - #endif - - #if HAS_ABL - SERIAL_ECHOPGM("Auto Bed Leveling: "); - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - SERIAL_ECHOPGM("LINEAR"); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPGM("BILINEAR"); - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - SERIAL_ECHOPGM("3POINT"); - #elif ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL"); - #endif - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) - SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height); - #endif - #if ABL_PLANAR - const float diff[XYZ] = { - planner.get_axis_position_mm(X_AXIS) - current_position[X_AXIS], - planner.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS], - planner.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS] - }; - SERIAL_ECHOPGM("ABL Adjustment X"); - if (diff[X_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[X_AXIS]); - SERIAL_ECHOPGM(" Y"); - if (diff[Y_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Y_AXIS]); - SERIAL_ECHOPGM(" Z"); - if (diff[Z_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Z_AXIS]); - #else - #if ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPAIR("Bilinear Grid X", bilinear_start[X_AXIS]); - SERIAL_ECHOPAIR(" Y", bilinear_start[Y_AXIS]); - SERIAL_ECHOPAIR(" W", ABL_BG_SPACING(X_AXIS)); - SERIAL_ECHOLNPAIR(" H", ABL_BG_SPACING(Y_AXIS)); - SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bilinear_z_offset(current_position); - #endif - SERIAL_ECHO(ftostr43sign(rz, '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position[Z_AXIS]), '+')); - SERIAL_CHAR(')'); - } - #endif - #endif - } - else - SERIAL_ECHOLNPGM(" (disabled)"); - - SERIAL_EOL(); - - #elif ENABLED(MESH_BED_LEVELING) - - SERIAL_ECHOPGM("Mesh Bed Leveling"); - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS] - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , 1.0 - #endif - ), '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign( - mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS], planner.fade_scaling_factor_for_z(current_position[Z_AXIS])), '+' - )); - SERIAL_CHAR(')'); - } - #endif - } - else - SERIAL_ECHOPGM(" (disabled)"); - - SERIAL_EOL(); - - #endif // MESH_BED_LEVELING - } - -#endif // DEBUG_LEVELING_FEATURE - -#if ENABLED(DELTA) - - #if ENABLED(SENSORLESS_HOMING) - inline void delta_sensorless_homing(const bool on=true) { - sensorless_homing_per_axis(A_AXIS, on); - sensorless_homing_per_axis(B_AXIS, on); - sensorless_homing_per_axis(C_AXIS, on); - } - #endif - - /** - * A delta can only safely home all axes at the same time - * This is like quick_home_xy() but for 3 towers. - */ - inline void home_delta() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); - #endif - // Init the current position of all carriages to 0,0,0 - ZERO(current_position); - sync_plan_position(); - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(); - #endif - - // Move all carriages together linearly until an endstop is hit. - current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10); - feedrate_mm_s = homing_feedrate(X_AXIS); - buffer_line_to_current_position(); - planner.synchronize(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - delta_sensorless_homing(false); - #endif - - endstops.validate_homing_move(); - - // At least one carriage has reached the top. - // Now re-home each carriage separately. - homeaxis(A_AXIS); - homeaxis(B_AXIS); - homeaxis(C_AXIS); - - // Set all carriages to their home positions - // Do this here all at once for Delta, because - // XYZ isn't ABC. Applying this per-tower would - // give the impression that they are the same. - LOOP_XYZ(i) set_axis_is_at_home((AxisEnum)i); - - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); - #endif - } - -#endif // DELTA - -#ifdef Z_AFTER_PROBING - void move_z_after_probing() { - if (current_position[Z_AXIS] != Z_AFTER_PROBING) { - do_blocking_move_to_z(Z_AFTER_PROBING); - current_position[Z_AXIS] = Z_AFTER_PROBING; - } - } -#endif - -#if ENABLED(Z_SAFE_HOMING) - - inline void home_z_safely() { - - // Disallow Z homing if X or Y are unknown - if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { - LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_Z_HOMING); - return; - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Z_SAFE_HOMING >>>"); - #endif - - SYNC_PLAN_POSITION_KINEMATIC(); - - /** - * Move the Z probe (or just the nozzle) to the safe homing point - */ - destination[X_AXIS] = Z_SAFE_HOMING_X_POINT; - destination[Y_AXIS] = Z_SAFE_HOMING_Y_POINT; - 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; - #endif - - if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); - #endif - - // This causes the carriage on Dual X to unpark - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - - #if ENABLED(SENSORLESS_HOMING) - safe_delay(500); // Short delay needed to settle - #endif - - do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); - homeaxis(Z_AXIS); - } - else { - LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< Z_SAFE_HOMING"); - #endif - } - -#endif // Z_SAFE_HOMING - -#if ENABLED(PROBE_MANUALLY) - bool g29_in_progress = false; -#else - constexpr bool g29_in_progress = false; -#endif - -/** - * G28: Home all axes according to settings - * - * Parameters - * - * None Home to all axes with no parameters. - * With QUICK_HOME enabled XY will home together, then Z. - * - * O Home only if position is unknown - * - * Rn Raise by n mm/inches before homing - * - * Cartesian parameters - * - * X Home to the X endstop - * Y Home to the Y endstop - * Z Home to the Z endstop - * - */ -inline void gcode_G28(const bool always_home_all) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> G28"); - log_machine_info(); - } - #endif - - #if ENABLED(MARLIN_DEV_MODE) - if (parser.seen('S')) { - LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a); - SYNC_PLAN_POSITION_KINEMATIC(); - SERIAL_ECHOLNPGM("Simulated Homing"); - report_current_position(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); - #endif - return; - } - #endif - - if (all_axes_known() && parser.boolval('O')) { // home only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> homing not needed, skip"); - SERIAL_ECHOLNPGM("<<< G28"); - } - #endif - return; - } - - // Wait for planner moves to finish! - planner.synchronize(); - - // Cancel the active G29 session - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #endif - - // Disable the leveling matrix before homing - #if HAS_LEVELING - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - const bool leveling_was_active = planner.leveling_active; - #endif - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif - - #if ENABLED(BLTOUCH) - // Make sure any BLTouch error condition is cleared - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); - #endif - - // Always home with tool 0 active - #if HOTENDS > 1 - #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) - const uint8_t old_tool_index = active_extruder; - #endif - tool_change(0, 0, true); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - extruder_duplication_enabled = false; - #endif - - setup_for_endstop_or_probe_move(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)"); - #endif - endstops.enable(true); // Enable endstops for next homing move - - #if ENABLED(DELTA) - - home_delta(); - UNUSED(always_home_all); - - #else // NOT DELTA - - const bool homeX = always_home_all || parser.seen('X'), - homeY = always_home_all || parser.seen('Y'), - homeZ = always_home_all || parser.seen('Z'), - home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ); - - set_destination_from_current(); - - #if Z_HOME_DIR > 0 // If homing away from BED do Z first - - if (home_all || homeZ) homeaxis(Z_AXIS); - - #endif - - const float z_homing_height = ( - #if ENABLED(UNKNOWN_Z_NO_RAISE) - !TEST(axis_known_position, Z_AXIS) ? 0 : - #endif - (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) - ); - - if (z_homing_height && (home_all || homeX || homeY)) { - // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = z_homing_height; - if (destination[Z_AXIS] > current_position[Z_AXIS]) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) - SERIAL_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); - #endif - - do_blocking_move_to_z(destination[Z_AXIS]); - } - } - - #if ENABLED(QUICK_HOME) - - if (home_all || (homeX && homeY)) quick_home_xy(); - - #endif - - // Home Y (before X) - #if ENABLED(HOME_Y_BEFORE_X) - - if (home_all || homeY - #if ENABLED(CODEPENDENT_XY_HOMING) - || homeX - #endif - ) homeaxis(Y_AXIS); - - #endif - - // Home X - if (home_all || homeX - #if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X) - || homeY - #endif - ) { - - #if ENABLED(DUAL_X_CARRIAGE) - - // Always home the 2nd (right) extruder first - active_extruder = 1; - homeaxis(X_AXIS); - - // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position[X_AXIS]; - - // Home the 1st (left) extruder - active_extruder = 0; - homeaxis(X_AXIS); - - // Consider the active extruder to be parked - COPY(raised_parked_position, current_position); - delayed_move_time = 0; - active_extruder_parked = true; - - #else - - homeaxis(X_AXIS); - - #endif - } - - // Home Y (after X) - #if DISABLED(HOME_Y_BEFORE_X) - if (home_all || homeY) homeaxis(Y_AXIS); - #endif - - // Home Z last if homing towards the bed - #if Z_HOME_DIR < 0 - if (home_all || homeZ) { - #if ENABLED(Z_SAFE_HOMING) - home_z_safely(); - #else - homeaxis(Z_AXIS); - #endif - - #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - } // home_all || homeZ - #endif // Z_HOME_DIR < 0 - - SYNC_PLAN_POSITION_KINEMATIC(); - - #endif // !DELTA (gcode_G28) - - endstops.not_homing(); - - #if ENABLED(DELTA) && ENABLED(DELTA_HOME_TO_SAFE_ZONE) - // move to a height where we can use the full xy-area - do_blocking_move_to_z(delta_clip_start_height); - #endif - - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - set_bed_leveling_enabled(leveling_was_active); - #endif - - clean_up_after_endstop_or_probe_move(); - - // Restore the active tool after homing - #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) - #if ENABLED(PARKING_EXTRUDER) - #define NO_FETCH false // fetch the previous toolhead - #else - #define NO_FETCH true - #endif - tool_change(old_tool_index, 0, NO_FETCH); - #endif - - lcd_refresh(); - - report_current_position(); - - #if ENABLED(NANODLP_Z_SYNC) - #if ENABLED(NANODLP_ALL_AXIS) - #define _HOME_SYNC true // For any axis, output sync text. - #else - #define _HOME_SYNC (home_all || homeZ) // Only for Z-axis - #endif - if (_HOME_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); - #endif -} // G28 - -void home_all_axes() { gcode_G28(true); } - -#if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY) - - inline void _manual_goto_xy(const float &rx, const float &ry) { - - #ifdef MANUAL_PROBE_START_Z - #if MANUAL_PROBE_HEIGHT > 0 - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(MAX(0,MANUAL_PROBE_START_Z)); - #else - do_blocking_move_to(rx, ry, MAX(0,MANUAL_PROBE_START_Z)); - #endif - #elif MANUAL_PROBE_HEIGHT > 0 - const float prev_z = current_position[Z_AXIS]; - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(prev_z); - #else - do_blocking_move_to_xy(rx, ry); - #endif - - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; - - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - -#endif - -#if ENABLED(MESH_BED_LEVELING) - - // Save 130 bytes with non-duplication of PSTR - void echo_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); } - - /** - * G29: Mesh-based Z probe, probes a grid and produces a - * mesh to compensate for variable bed height - * - * Parameters With MESH_BED_LEVELING: - * - * S0 Produce a mesh report - * S1 Start probing mesh points - * S2 Probe the next mesh point - * S3 Xn Yn Zn.nn Manually modify a single point - * S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed. - * S5 Reset and disable mesh - * - * The S0 report the points as below - * - * +----> X-axis 1-n - * | - * | - * v Y-axis 1-n - * - */ - inline void gcode_G29() { - - static int mbl_probe_index = -1; - #if HAS_SOFTWARE_ENDSTOPS - static bool enable_soft_endstops; - #endif - - MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); - if (!WITHIN(state, 0, 5)) { - SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); - return; - } - - int8_t px, py; - - switch (state) { - case MeshReport: - if (leveling_is_valid()) { - SERIAL_PROTOCOLLNPAIR("State: ", planner.leveling_active ? MSG_ON : MSG_OFF); - mbl.report_mesh(); - } - else - SERIAL_PROTOCOLLNPGM("Mesh bed leveling has no data."); - break; - - case MeshStart: - mbl.reset(); - mbl_probe_index = 0; - if (!lcd_wait_for_move) { - enqueue_and_echo_commands_P(PSTR("G28\nG29 S2")); - return; - } - state = MeshNext; - - case MeshNext: - if (mbl_probe_index < 0) { - SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first."); - return; - } - // For each G29 S2... - if (mbl_probe_index == 0) { - #if HAS_SOFTWARE_ENDSTOPS - // For the initial G29 S2 save software endstop state - enable_soft_endstops = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - // Save Z for the previous mesh position - mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - } - // If there's another point to sample, move there with optional lift. - if (mbl_probe_index < GRID_MAX_POINTS) { - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - - mbl.zigzag(mbl_probe_index++, px, py); - _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); - } - else { - // One last "return to the bed" (as originally coded) at completion - current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT; - buffer_line_to_current_position(); - planner.synchronize(); - - // After recording the last point, activate home and activate - mbl_probe_index = -1; - SERIAL_PROTOCOLLNPGM("Mesh probing done."); - BUZZ(100, 659); - BUZZ(100, 698); - - home_all_axes(); - set_bed_leveling_enabled(true); - - #if ENABLED(MESH_G28_REST_ORIGIN) - current_position[Z_AXIS] = 0; - set_destination_from_current(); - buffer_line_to_destination(homing_feedrate(Z_AXIS)); - planner.synchronize(); - #endif - - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - break; - - case MeshSet: - if (parser.seenval('X')) { - px = parser.value_int() - 1; - if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) { - SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; - } - } - else { - SERIAL_CHAR('X'); echo_not_entered(); - return; - } - - if (parser.seenval('Y')) { - py = parser.value_int() - 1; - if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - return; - } - } - else { - SERIAL_CHAR('Y'); echo_not_entered(); - return; - } - - if (parser.seenval('Z')) - mbl.z_values[px][py] = parser.value_linear_units(); - else { - SERIAL_CHAR('Z'); echo_not_entered(); - return; - } - break; - - case MeshSetZOffset: - if (parser.seenval('Z')) - mbl.z_offset = parser.value_linear_units(); - else { - SERIAL_CHAR('Z'); echo_not_entered(); - return; - } - break; - - case MeshReset: - reset_bed_level(); - break; - - } // switch (state) - - if (state == MeshNext) { - SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS)); - SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS)); - } - - report_current_position(); - } - -#elif OLDSCHOOL_ABL - - #if ABL_GRID - #if ENABLED(PROBE_Y_FIRST) - #define PR_OUTER_VAR xCount - #define PR_OUTER_END abl_grid_points_x - #define PR_INNER_VAR yCount - #define PR_INNER_END abl_grid_points_y - #else - #define PR_OUTER_VAR yCount - #define PR_OUTER_END abl_grid_points_y - #define PR_INNER_VAR xCount - #define PR_INNER_END abl_grid_points_x - #endif - #endif - - /** - * G29: Detailed Z probe, probes the bed at 3 or more points. - * Will fail if the printer has not been homed with G28. - * - * Enhanced G29 Auto Bed Leveling Probe Routine - * - * O Auto-level only if needed - * - * D Dry-Run mode. Just evaluate the bed Topology - Don't apply - * or alter the bed level data. Useful to check the topology - * after a first run of G29. - * - * J Jettison current bed leveling data - * - * V Set the verbose level (0-4). Example: "G29 V3" - * - * Parameters With LINEAR leveling only: - * - * P Set the size of the grid that will be probed (P x P points). - * Example: "G29 P4" - * - * X Set the X size of the grid that will be probed (X x Y points). - * Example: "G29 X7 Y5" - * - * Y Set the Y size of the grid that will be probed (X x Y points). - * - * T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report. - * This is useful for manual bed leveling and finding flaws in the bed (to - * assist with part placement). - * Not supported by non-linear delta printer bed leveling. - * - * Parameters With LINEAR and BILINEAR leveling only: - * - * S Set the XY travel speed between probe points (in units/min) - * - * F Set the Front limit of the probing grid - * B Set the Back limit of the probing grid - * L Set the Left limit of the probing grid - * R Set the Right limit of the probing grid - * - * Parameters with DEBUG_LEVELING_FEATURE only: - * - * C Make a totally fake grid with no actual probing. - * For use in testing when no probing is possible. - * - * Parameters with BILINEAR leveling only: - * - * Z Supply an additional Z probe offset - * - * Extra parameters with PROBE_MANUALLY: - * - * To do manual probing simply repeat G29 until the procedure is complete. - * The first G29 accepts parameters. 'G29 Q' for status, 'G29 A' to abort. - * - * Q Query leveling and G29 state - * - * A Abort current leveling procedure - * - * Extra parameters with BILINEAR only: - * - * W Write a mesh point. (If G29 is idle.) - * I X index for mesh point - * J Y index for mesh point - * X X for mesh point, overrides I - * Y Y for mesh point, overrides J - * Z Z for mesh point. Otherwise, raw current Z. - * - * Without PROBE_MANUALLY: - * - * E By default G29 will engage the Z probe, test the bed, then disengage. - * Include "E" to engage/disengage the Z probe for each sample. - * There's no extra effect if you have a fixed Z probe. - * - */ - inline void gcode_G29() { - - #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY) - const bool seenQ = parser.seen('Q'); - #else - constexpr bool seenQ = false; - #endif - - // G29 Q is also available if debugging - #if ENABLED(DEBUG_LEVELING_FEATURE) - const uint8_t old_debug_flags = marlin_debug_flags; - if (seenQ) marlin_debug_flags |= DEBUG_LEVELING; - if (DEBUGGING(LEVELING)) { - DEBUG_POS(">>> G29", current_position); - log_machine_info(); - } - marlin_debug_flags = old_debug_flags; - #if DISABLED(PROBE_MANUALLY) - if (seenQ) return; - #endif - #endif - - #if ENABLED(PROBE_MANUALLY) - const bool seenA = parser.seen('A'); - #else - constexpr bool seenA = false; - #endif - - const bool no_action = seenA || seenQ, - faux = - #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) - parser.boolval('C') - #else - no_action - #endif - ; - - // Don't allow auto-leveling without homing first - if (axis_unhomed_error()) return; - - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> Auto-level not needed, skip"); - SERIAL_ECHOLNPGM("<<< G29"); - } - #endif - return; - } - - // Define local vars 'static' for manual probing, 'auto' otherwise - #if ENABLED(PROBE_MANUALLY) - #define ABL_VAR static - #else - #define ABL_VAR - #endif - - ABL_VAR int verbose_level; - ABL_VAR float xProbe, yProbe, measured_z; - ABL_VAR bool dryrun, abl_should_enable; - - #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_probe_index; - #endif - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY) - ABL_VAR bool enable_soft_endstops = true; - #endif - - #if ABL_GRID - - #if ENABLED(PROBE_MANUALLY) - ABL_VAR uint8_t PR_OUTER_VAR; - ABL_VAR int8_t PR_INNER_VAR; - #endif - - ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; - ABL_VAR float xGridSpacing = 0, yGridSpacing = 0; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; - ABL_VAR bool do_topography_map; - #else // Bilinear - uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; - #endif - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int16_t abl_points; - #elif ENABLED(PROBE_MANUALLY) // Bilinear - int16_t constexpr abl_points = GRID_MAX_POINTS; - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - ABL_VAR float zoffset; - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - - ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations - eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points - mean; - #endif - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - #if ENABLED(PROBE_MANUALLY) - int8_t constexpr abl_points = 3; // used to show total points - #endif - - // Probe at 3 arbitrary points - ABL_VAR vector_3 points[3] = { - 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) - }; - - #endif // AUTO_BED_LEVELING_3POINT - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - struct linear_fit_data lsf_results; - incremental_LSF_reset(&lsf_results); - #endif - - /** - * On the initial G29 fetch command parameters. - */ - if (!g29_in_progress) { - - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - - #if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR) - abl_probe_index = -1; - #endif - - abl_should_enable = planner.leveling_active; - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - const bool seen_w = parser.seen('W'); - if (seen_w) { - if (!leveling_is_valid()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("No bilinear grid"); - return; - } - - const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS]; - if (!WITHIN(rz, -10, 10)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad Z value"); - return; - } - - const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), - ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); - int8_t i = parser.byteval('I', -1), - j = parser.byteval('J', -1); - - if (!isnan(rx) && !isnan(ry)) { - // Get nearest i / j from rx / ry - i = (rx - bilinear_start[X_AXIS] + 0.5f * xGridSpacing) / xGridSpacing; - j = (ry - bilinear_start[Y_AXIS] + 0.5f * yGridSpacing) / yGridSpacing; - i = constrain(i, 0, GRID_MAX_POINTS_X - 1); - j = constrain(j, 0, GRID_MAX_POINTS_Y - 1); - } - if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) { - set_bed_leveling_enabled(false); - z_values[i][j] = rz; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - set_bed_leveling_enabled(abl_should_enable); - if (abl_should_enable) report_current_position(); - } - return; - } // parser.seen('W') - - #else - - constexpr bool seen_w = false; - - #endif - - // Jettison bed leveling data - if (!seen_w && parser.seen('J')) { - reset_bed_level(); - return; - } - - verbose_level = parser.intval('V'); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); - return; - } - - dryrun = parser.boolval('D') - #if ENABLED(PROBE_MANUALLY) - || no_action - #endif - ; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - do_topography_map = verbose_level > 2 || parser.boolval('T'); - - // X and Y specify points in each direction, overriding the default - // These values may be saved with the completed mesh - abl_grid_points_x = parser.intval('X', GRID_MAX_POINTS_X); - abl_grid_points_y = parser.intval('Y', GRID_MAX_POINTS_Y); - 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_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - return; - } - if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - return; - } - - abl_points = abl_grid_points_x * abl_grid_points_y; - mean = 0; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - zoffset = parser.linearval('Z'); - - #endif - - #if ABL_GRID - - xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); - - 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; - - if ( - #if IS_SCARA || ENABLED(DELTA) - !position_is_reachable_by_probe(left_probe_bed_position, 0) - || !position_is_reachable_by_probe(right_probe_bed_position, 0) - || !position_is_reachable_by_probe(0, front_probe_bed_position) - || !position_is_reachable_by_probe(0, back_probe_bed_position) - #else - !position_is_reachable_by_probe(left_probe_bed_position, front_probe_bed_position) - || !position_is_reachable_by_probe(right_probe_bed_position, back_probe_bed_position) - #endif - ) { - SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds."); - return; - } - - // probe at the points of a lattice grid - xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (abl_grid_points_x - 1); - yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (abl_grid_points_y - 1); - - #endif // ABL_GRID - - if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling"); - if (dryrun) SERIAL_PROTOCOLPGM(" (DRYRUN)"); - SERIAL_EOL(); - } - - planner.synchronize(); - - // Disable auto bed leveling during G29. - // Be formal so G29 can be done successively without G28. - if (!no_action) set_bed_leveling_enabled(false); - - #if HAS_BED_PROBE - // Deploy the probe. Probe will raise if needed. - if (DEPLOY_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - return; - } - #endif - - if (!faux) setup_for_endstop_or_probe_move(); - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - #if ENABLED(PROBE_MANUALLY) - if (!no_action) - #endif - if ( xGridSpacing != bilinear_grid_spacing[X_AXIS] - || yGridSpacing != bilinear_grid_spacing[Y_AXIS] - || left_probe_bed_position != bilinear_start[X_AXIS] - || front_probe_bed_position != bilinear_start[Y_AXIS] - ) { - // Reset grid to 0.0 or "not probed". (Also disables ABL) - reset_bed_level(); - - // Initialize a grid with the given dimensions - bilinear_grid_spacing[X_AXIS] = xGridSpacing; - bilinear_grid_spacing[Y_AXIS] = yGridSpacing; - bilinear_start[X_AXIS] = left_probe_bed_position; - bilinear_start[Y_AXIS] = front_probe_bed_position; - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_BILINEAR - - #if ENABLED(AUTO_BED_LEVELING_3POINT) - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); - #endif - - // Probe at 3 arbitrary points - points[0].z = points[1].z = points[2].z = 0; - - #endif // AUTO_BED_LEVELING_3POINT - - } // !g29_in_progress - - #if ENABLED(PROBE_MANUALLY) - - // For manual probing, get the next index to probe now. - // On the first probe this will be incremented to 0. - if (!no_action) { - ++abl_probe_index; - g29_in_progress = true; - } - - // Abort current G29 procedure, go back to idle state - if (seenA && g29_in_progress) { - SERIAL_PROTOCOLLNPGM("Manual G29 aborted"); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - set_bed_leveling_enabled(abl_should_enable); - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - } - - // Query G29 status - if (verbose_level || seenQ) { - SERIAL_PROTOCOLPGM("Manual G29 "); - if (g29_in_progress) { - SERIAL_PROTOCOLPAIR("point ", MIN(abl_probe_index + 1, abl_points)); - SERIAL_PROTOCOLLNPAIR(" of ", abl_points); - } - else - SERIAL_PROTOCOLLNPGM("idle"); - } - - if (no_action) return; - - if (abl_probe_index == 0) { - // For the initial G29 save software endstop state - #if HAS_SOFTWARE_ENDSTOPS - enable_soft_endstops = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT) - const uint16_t index = abl_probe_index - 1; - #endif - - // For G29 after adjusting Z. - // Save the previous Z before going to the next point - measured_z = current_position[Z_AXIS]; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[index] = measured_z; - eqnAMatrix[index + 0 * abl_points] = xProbe; - eqnAMatrix[index + 1 * abl_points] = yProbe; - eqnAMatrix[index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - points[index].z = measured_z; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - z_values[xCount][yCount] = measured_z + zoffset; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_PROTOCOLPAIR("Save X", xCount); - SERIAL_PROTOCOLPAIR(" Y", yCount); - SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset); - } - #endif - - #endif - } - - // - // If there's another point to sample, move there with optional lift. - // - - #if ABL_GRID - - // Skip any unreachable points - while (abl_probe_index < abl_points) { - - // Set xCount, yCount based on abl_probe_index, with zig-zag - PR_OUTER_VAR = abl_probe_index / PR_INNER_END; - PR_INNER_VAR = abl_probe_index - (PR_OUTER_VAR * PR_INNER_END); - - // Probe in reverse order for every other row/column - bool zig = (PR_OUTER_VAR & 1); // != ((PR_OUTER_END) & 1); - - if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR; - - const float xBase = xCount * xGridSpacing + left_probe_bed_position, - yBase = yCount * yGridSpacing + front_probe_bed_position; - - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = abl_probe_index; - #endif - - // Keep looping till a reachable point is found - if (position_is_reachable(xProbe, yProbe)) break; - ++abl_probe_index; - } - - // Is there a next point to move to? - if (abl_probe_index < abl_points) { - _manual_goto_xy(xProbe, yProbe); // Can be used here too! - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - return; - } - else { - - // Leveling done! Fall through to G29 finishing code below - - SERIAL_PROTOCOLLNPGM("Grid probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - } - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - if (abl_probe_index < abl_points) { - xProbe = points[abl_probe_index].x; - yProbe = points[abl_probe_index].y; - _manual_goto_xy(xProbe, yProbe); - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - return; - } - else { - - SERIAL_PROTOCOLLNPGM("3-point probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = enable_soft_endstops; - #endif - - if (!dryrun) { - 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; - } - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - } - - #endif // AUTO_BED_LEVELING_3POINT - - #else // !PROBE_MANUALLY - { - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - measured_z = 0; - - #if ABL_GRID - - bool zig = PR_OUTER_END & 1; // Always end at RIGHT and BACK_PROBE_BED_POSITION - - measured_z = 0; - - // Outer loop is Y with PROBE_Y_FIRST disabled - for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { - - int8_t inStart, inStop, inInc; - - if (zig) { // away from origin - inStart = 0; - inStop = PR_INNER_END; - inInc = 1; - } - else { // towards origin - inStart = PR_INNER_END - 1; - inStop = -1; - inInc = -1; - } - - zig ^= true; // zag - - // Inner loop is Y with PROBE_Y_FIRST enabled - for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) { - - float xBase = left_probe_bed_position + xGridSpacing * xCount, - yBase = front_probe_bed_position + yGridSpacing * yCount; - - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = ++abl_probe_index; // 0... - #endif - - #if IS_KINEMATIC - // Avoid probing outside the round or hexagonal area - if (!position_is_reachable_by_probe(xProbe, yProbe)) continue; - #endif - - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); - - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; - } - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[abl_probe_index] = measured_z; - eqnAMatrix[abl_probe_index + 0 * abl_points] = xProbe; - eqnAMatrix[abl_probe_index + 1 * abl_points] = yProbe; - eqnAMatrix[abl_probe_index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - z_values[xCount][yCount] = measured_z + zoffset; - - #endif - - abl_should_enable = false; - idle(); - - } // inner - } // outer - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - - for (uint8_t i = 0; i < 3; ++i) { - // 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); - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; - } - points[i].z = measured_z; - } - - 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; - } - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_3POINT - - // Stow the probe. No raise for FIX_MOUNTED_PROBE. - if (STOW_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - measured_z = NAN; - } - } - #endif // !PROBE_MANUALLY - - // - // G29 Finishing Code - // - // Unless this is a dry run, auto bed leveling will - // definitely be enabled after this point. - // - // If code above wants to continue leveling, it should - // return or loop before this point. - // - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); - #endif - - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; - #endif - #endif - - // Calculate leveling, print reports, correct the position - if (!isnan(measured_z)) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) extrapolate_unprobed_bed_level(); - print_bilinear_leveling_grid(); - - refresh_bed_level(); - - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - // For LINEAR leveling calculate matrix, print reports, correct the position - - /** - * solve the plane equation ax + by + d = z - * A is the matrix with rows [x y 1] for all the probed points - * B is the vector of the Z positions - * the normal vector to the plane is formed by the coefficients of the - * plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 - * so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z - */ - float plane_equation_coefficients[3]; - - finish_incremental_LSF(&lsf_results); - plane_equation_coefficients[0] = -lsf_results.A; // We should be able to eliminate the '-' on these three lines and down below - plane_equation_coefficients[1] = -lsf_results.B; // but that is not yet tested. - plane_equation_coefficients[2] = -lsf_results.D; - - mean /= abl_points; - - if (verbose_level) { - SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8); - SERIAL_PROTOCOLPGM(" b: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8); - SERIAL_PROTOCOLPGM(" d: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8); - SERIAL_EOL(); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mean of sampled points: "); - SERIAL_PROTOCOL_F(mean, 8); - SERIAL_EOL(); - } - } - - // Create the matrix but don't correct the position yet - if (!dryrun) - planner.bed_level_matrix = matrix_3x3::create_look_at( - vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1) // We can eliminate the '-' here and up above - ); - - // Show the Topography map if enabled - if (do_topography_map) { - - SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n" - " +--- BACK --+\n" - " | |\n" - " L | (+) | R\n" - " E | | I\n" - " F | (-) N (+) | G\n" - " T | | H\n" - " | (-) | T\n" - " | |\n" - " O-- FRONT --+\n" - " (0,0)"); - - float min_diff = 999; - - for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { - for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { - int ind = indexIntoAB[xx][yy]; - float diff = eqnBVector[ind] - mean, - x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - - NOMORE(min_diff, eqnBVector[ind] - z_tmp); - - if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment - else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - - if (verbose_level > 3) { - SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:"); - - for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { - for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { - int ind = indexIntoAB[xx][yy]; - float x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - - float diff = eqnBVector[ind] - z_tmp - min_diff; - if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); - // Include + for column alignment - else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - } - } //do_topography_map - - #endif // AUTO_BED_LEVELING_LINEAR - - #if ABL_PLANAR - - // For LINEAR and 3POINT leveling correct the current position - - if (verbose_level > 0) - planner.bed_level_matrix.debug(PSTR("\n\nBed Level Correction Matrix:")); - - if (!dryrun) { - // - // Correct the current XYZ position based on the tilted plane. - // - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 uncorrected XYZ", current_position); - #endif - - float converted[XYZ]; - COPY(converted, current_position); - - planner.leveling_active = true; - planner.unapply_leveling(converted); // use conversion machinery - 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)) - ) { - const float simple_z = current_position[Z_AXIS] - measured_z; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Z from Probe:", simple_z); - SERIAL_ECHOPAIR(" Matrix:", converted[Z_AXIS]); - SERIAL_ECHOLNPAIR(" Discrepancy:", simple_z - converted[Z_AXIS]); - } - #endif - converted[Z_AXIS] = simple_z; - } - - // The rotated XY and corrected Z are now current_position - COPY(current_position, converted); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position); - #endif - } - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("G29 uncorrected Z:", current_position[Z_AXIS]); - #endif - - // Unapply the offset because it is going to be immediately applied - // and cause compensation movement in Z - current_position[Z_AXIS] -= bilinear_z_offset(current_position); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]); - #endif - } - - #endif // ABL_PLANAR - - #ifdef Z_PROBE_END_SCRIPT - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); - #endif - planner.synchronize(); - enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT)); - #endif - - // Auto Bed Leveling is complete! Enable if possible. - planner.leveling_active = dryrun ? abl_should_enable : true; - } // !isnan(measured_z) - - // Restore state after probing - if (!faux) clean_up_after_endstop_or_probe_move(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G29"); - #endif - - KEEPALIVE_STATE(IN_HANDLER); - - if (planner.leveling_active) - SYNC_PLAN_POSITION_KINEMATIC(); - - #if HAS_BED_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - report_current_position(); - } - -#endif // OLDSCHOOL_ABL - -#if HAS_BED_PROBE - - /** - * G30: Do a single Z probe at the current XY - * - * Parameters: - * - * X Probe X position (default current X) - * Y Probe Y position (default current Y) - * E Engage the probe for each probe (default 1) - */ - inline void gcode_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); - - if (!position_is_reachable_by_probe(xpos, ypos)) return; - - // Disable leveling so the planner won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif - - setup_for_endstop_or_probe_move(); - - const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_pt(xpos, ypos, raise_after, parser.intval('V', 1)); - - if (!isnan(measured_z)) { - SERIAL_PROTOCOLPAIR_F("Bed X: ", xpos); - SERIAL_PROTOCOLPAIR_F(" Y: ", ypos); - SERIAL_PROTOCOLLNPAIR_F(" Z: ", measured_z); - } - - clean_up_after_endstop_or_probe_move(); - - #ifdef Z_AFTER_PROBING - if (raise_after == PROBE_PT_STOW) move_z_after_probing(); - #endif - - report_current_position(); - } - - #if ENABLED(Z_PROBE_SLED) - - /** - * G31: Deploy the Z probe - */ - inline void gcode_G31() { DEPLOY_PROBE(); } - - /** - * G32: Stow the Z probe - */ - inline void gcode_G32() { STOW_PROBE(); } - - #endif // Z_PROBE_SLED - -#endif // HAS_BED_PROBE - -#if ENABLED(DELTA_AUTO_CALIBRATION) - - constexpr uint8_t _7P_STEP = 1, // 7-point step - to change number of calibration points - _4P_STEP = _7P_STEP * 2, // 4-point step - NPP = _7P_STEP * 6; // number of calibration points on the radius - enum CalEnum : char { // the 7 main calibration points - add definitions if needed - CEN = 0, - __A = 1, - _AB = __A + _7P_STEP, - __B = _AB + _7P_STEP, - _BC = __B + _7P_STEP, - __C = _BC + _7P_STEP, - _CA = __C + _7P_STEP, - }; - - #define LOOP_CAL_PT(VAR, S, N) for (uint8_t VAR=S; VAR<=NPP; VAR+=N) - #define F_LOOP_CAL_PT(VAR, S, N) for (float VAR=S; VARCEN+0.9999; VAR-=N) - #define LOOP_CAL_ALL(VAR) LOOP_CAL_PT(VAR, CEN, 1) - #define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP) - #define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP) - - #if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - #define AC_CLEANUP() ac_cleanup(old_tool_index) - #else - #define AC_CLEANUP() ac_cleanup() - #endif - - float lcd_probe_pt(const float &rx, const float &ry); - - void ac_home() { - endstops.enable(true); - home_delta(); - endstops.not_homing(); - } - - void ac_setup(const bool reset_bed) { - #if HOTENDS > 1 - tool_change(0, 0, true); - #endif - - planner.synchronize(); - setup_for_endstop_or_probe_move(); - - #if HAS_LEVELING - if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid - #endif - } - - void ac_cleanup( - #if HOTENDS > 1 - const uint8_t old_tool_index - #endif - ) { - #if ENABLED(DELTA_HOME_TO_SAFE_ZONE) - do_blocking_move_to_z(delta_clip_start_height); - #endif - #if HAS_BED_PROBE - STOW_PROBE(); - #endif - clean_up_after_endstop_or_probe_move(); - #if HOTENDS > 1 - tool_change(old_tool_index, 0, true); - #endif - } - - void print_signed_float(const char * const prefix, const float &f) { - SERIAL_PROTOCOLPGM(" "); - serialprintPGM(prefix); - SERIAL_PROTOCOLCHAR(':'); - if (f >= 0) SERIAL_CHAR('+'); - SERIAL_PROTOCOL_F(f, 2); - } - - /** - * - Print the delta settings - */ - static void print_calibration_settings(const bool end_stops, const bool tower_angles) { - SERIAL_PROTOCOLPAIR(".Height:", delta_height); - if (end_stops) { - print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]); - print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]); - print_signed_float(PSTR("Ez"), delta_endstop_adj[C_AXIS]); - } - if (end_stops && tower_angles) { - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); - } - if (tower_angles) { - print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]); - print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]); - print_signed_float(PSTR("Tz"), delta_tower_angle_trim[C_AXIS]); - } - if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); - } - #if HAS_BED_PROBE - if (!end_stops && !tower_angles) { - SERIAL_PROTOCOL_SP(30); - print_signed_float(PSTR("Offset"), zprobe_zoffset); - } - #endif - SERIAL_EOL(); - } - - /** - * - Print the probe results - */ - static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { - SERIAL_PROTOCOLPGM(". "); - print_signed_float(PSTR("c"), z_pt[CEN]); - if (tower_points) { - print_signed_float(PSTR(" x"), z_pt[__A]); - print_signed_float(PSTR(" y"), z_pt[__B]); - print_signed_float(PSTR(" z"), z_pt[__C]); - } - if (tower_points && opposite_points) { - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); - } - if (opposite_points) { - print_signed_float(PSTR("yz"), z_pt[_BC]); - print_signed_float(PSTR("zx"), z_pt[_CA]); - print_signed_float(PSTR("xy"), z_pt[_AB]); - } - SERIAL_EOL(); - } - - /** - * - Calculate the standard deviation from the zero plane - */ - static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) { - if (!_0p_cal) { - float S2 = sq(z_pt[CEN]); - int16_t N = 1; - if (!_1p_cal) { // std dev from zero plane - LOOP_CAL_ACT(rad, _4p_cal, _4p_opp) { - S2 += sq(z_pt[rad]); - N++; - } - return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; - } - } - return 0.00001; - } - - /** - * - Probe a point - */ - static float calibration_probe(const float &nx, const float &ny, const bool stow, const bool set_up) { - #if HAS_BED_PROBE - return probe_pt(nx, ny, set_up ? PROBE_PT_BIG_RAISE : stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); - #else - UNUSED(stow); - UNUSED(set_up); - return lcd_probe_pt(nx, ny); - #endif - } - - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - static float probe_z_shift(const float center) { - STOW_PROBE(); - endstops.enable_z_probe(false); - float z_shift = lcd_probe_pt(0, 0) - center; - endstops.enable_z_probe(true); - return z_shift; - } - #endif - - /** - * - Probe a grid - */ - static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each, const bool set_up) { - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_calibration = probe_points >= 3, - _7p_no_intermediates = probe_points == 3, - _7p_1_intermediates = probe_points == 4, - _7p_2_intermediates = probe_points == 5, - _7p_4_intermediates = probe_points == 6, - _7p_6_intermediates = probe_points == 7, - _7p_8_intermediates = probe_points == 8, - _7p_11_intermediates = probe_points == 9, - _7p_14_intermediates = probe_points == 10, - _7p_intermed_points = probe_points >= 4, - _7p_6_center = probe_points >= 5 && probe_points <= 7, - _7p_9_center = probe_points >= 8; - - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0; - - if (!_0p_calibration) { - - if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center - z_pt[CEN] += calibration_probe(0, 0, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; - } - - 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; - I_LOOP_CAL_PT(rad, start, steps) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * 0.1; - z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_pt[CEN])) return false; - } - z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); - } - - 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 - _7p_no_intermediates ? _7P_STEP : // 1r * 6 + 3c = 9 - _4P_STEP; // .5r * 6 + 1c = 4 - bool zig_zag = true; - F_LOOP_CAL_PT(rad, start, _7p_9_center ? steps * 3 : steps) { - const int8_t offset = _7p_9_center ? 2 : 0; - for (int8_t circle = 0; circle <= offset; circle++) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * (1 - 0.1 * (zig_zag ? offset - circle : circle)), - interpol = fmod(rad, 1); - const float z_temp = calibration_probe(cos(a) * r, sin(a) * r, stow_after_each, set_up); - if (isnan(z_temp)) return false; - // split probe point to neighbouring calibration points - z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); - z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); - } - zig_zag = !zig_zag; - } - if (_7p_intermed_points) - LOOP_CAL_RAD(rad) - z_pt[rad] /= _7P_STEP / steps; - - do_blocking_move_to_xy(0.0, 0.0); - } - } - return true; - } - - /** - * kinematics routines and auto tune matrix scaling parameters: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - formulae for approximative forward kinematics in the end-stop displacement matrix - * - definition of the matrix scaling parameters - */ - static void reverse_kinematics_probe_points(float z_pt[NPP + 1], float mm_at_pt_axis[NPP + 1][ABC]) { - float pos[XYZ] = { 0.0 }; - - LOOP_CAL_ALL(rad) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = (rad == CEN ? 0.0 : delta_calibration_radius); - pos[X_AXIS] = cos(a) * r; - pos[Y_AXIS] = sin(a) * r; - pos[Z_AXIS] = z_pt[rad]; - inverse_kinematics(pos); - LOOP_XYZ(axis) mm_at_pt_axis[rad][axis] = delta[axis]; - } - } - - 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 Z00(I, A) ZPP( 0, I, A) - #define Zp1(I, A) ZPP(+1, I, A) - #define Zm1(I, A) ZPP(-1, I, A) - #define Zp2(I, A) ZPP(+2, I, A) - #define Zm2(I, A) ZPP(-2, I, A) - - z_pt[CEN] = Z00(CEN, A_AXIS) + Z00(CEN, B_AXIS) + Z00(CEN, C_AXIS); - z_pt[__A] = Zp2(__A, A_AXIS) + Zm1(__A, B_AXIS) + Zm1(__A, C_AXIS); - z_pt[__B] = Zm1(__B, A_AXIS) + Zp2(__B, B_AXIS) + Zm1(__B, C_AXIS); - z_pt[__C] = Zm1(__C, A_AXIS) + Zm1(__C, B_AXIS) + Zp2(__C, C_AXIS); - z_pt[_BC] = Zm2(_BC, A_AXIS) + Zp1(_BC, B_AXIS) + Zp1(_BC, C_AXIS); - z_pt[_CA] = Zp1(_CA, A_AXIS) + Zm2(_CA, B_AXIS) + Zp1(_CA, C_AXIS); - z_pt[_AB] = Zp1(_AB, A_AXIS) + Zp1(_AB, B_AXIS) + Zm2(_AB, C_AXIS); - } - - static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], float delta_e[ABC], float delta_r, float delta_t[ABC]) { - const float z_center = z_pt[CEN]; - float diff_mm_at_pt_axis[NPP + 1][ABC], - new_mm_at_pt_axis[NPP + 1][ABC]; - - reverse_kinematics_probe_points(z_pt, diff_mm_at_pt_axis); - - delta_radius += delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += delta_t[axis]; - recalc_delta_settings(); - reverse_kinematics_probe_points(z_pt, new_mm_at_pt_axis); - - LOOP_XYZ(axis) LOOP_CAL_ALL(rad) diff_mm_at_pt_axis[rad][axis] -= new_mm_at_pt_axis[rad][axis] + delta_e[axis]; - forward_kinematics_probe_points(diff_mm_at_pt_axis, z_pt); - - LOOP_CAL_RAD(rad) z_pt[rad] -= z_pt[CEN] - z_center; - z_pt[CEN] = z_center; - - delta_radius -= delta_r; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= delta_t[axis]; - recalc_delta_settings(); - } - - static float auto_tune_h() { - const float r_quot = delta_calibration_radius / delta_radius; - float h_fac = 0.0; - - h_fac = r_quot / (2.0 / 3.0); - 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}; - - 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) - 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}; - - 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; - } - a_fac = diff / a_fac / 3.0; // 1/(3*delta_Z) - return a_fac; - } - - /** - * G33 - Delta '1-4-7-point' Auto-Calibration - * Calibrate height, z_offset, endstops, delta radius, and tower angles. - * - * Parameters: - * - * S Setup mode; disables probe protection - * - * Pn Number of probe points: - * P-1 Checks the z_offset with a center probe and paper test. - * P0 Normalizes calibration. - * P1 Calibrates height only with center probe. - * P2 Probe center and towers. Calibrate height, endstops and delta radius. - * P3 Probe all positions: center, towers and opposite towers. Calibrate all. - * P4-P10 Probe all positions at different intermediate locations and average them. - * - * T Don't calibrate tower angle corrections - * - * Cn.nn Calibration precision; when omitted calibrates to maximum precision - * - * Fn Force to run at least n iterations and take the best result - * - * Vn Verbose level: - * V0 Dry-run mode. Report settings and probe results. No calibration. - * V1 Report start and end settings only - * V2 Report settings at each iteration - * V3 Report settings and probe results - * - * E Engage the probe for each point - */ - inline void gcode_G33() { - - const bool set_up = - #if HAS_BED_PROBE - parser.seen('S'); - #else - false; - #endif - - const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); - if (!WITHIN(probe_points, -1, 10)) { - SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (-1 - 10)."); - return; - } - - const bool towers_set = !parser.seen('T'); - - const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0); - if (calibration_precision < 0) { - SERIAL_PROTOCOLLNPGM("?(C)alibration precision is implausible (>=0)."); - return; - } - - const int8_t force_iterations = parser.intval('F', 0); - if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0 - 30)."); - return; - } - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0 - 3)."); - return; - } - - const bool stow_after_each = parser.seen('E'); - - if (set_up) { - delta_height = 999.99; - delta_radius = DELTA_PRINTABLE_RADIUS; - ZERO(delta_endstop_adj); - ZERO(delta_tower_angle_trim); - recalc_delta_settings(); - } - - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_9_center = probe_points >= 8, - _tower_results = (_4p_calibration && towers_set) || probe_points >= 3, - _opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3, - _endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0, - _angle_results = probe_points >= 3 && towers_set; - 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_min = zero_std_dev, - zero_std_dev_old = zero_std_dev, - h_factor, - r_factor, - a_factor, - e_old[ABC] = { - delta_endstop_adj[A_AXIS], - delta_endstop_adj[B_AXIS], - delta_endstop_adj[C_AXIS] - }, - r_old = delta_radius, - h_old = delta_height, - a_old[ABC] = { - delta_tower_angle_trim[A_AXIS], - delta_tower_angle_trim[B_AXIS], - delta_tower_angle_trim[C_AXIS] - }; - - SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate"); - - if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable - LOOP_CAL_RAD(axis) { - const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), - r = delta_calibration_radius; - if (!position_is_reachable(cos(a) * r, sin(a) * r)) { - SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible."); - return; - } - } - } - - // Report settings - const char *checkingac = PSTR("Checking... AC"); - serialprintPGM(checkingac); - if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)"); - if (set_up) SERIAL_PROTOCOLPGM(" (SET-UP)"); - SERIAL_EOL(); - lcd_setstatusPGM(checkingac); - - print_calibration_settings(_endstop_results, _angle_results); - - ac_setup(!_0p_calibration && !_1p_calibration); - - if (!_0p_calibration) ac_home(); - - do { // start iterations - - float z_at_pt[NPP + 1] = { 0.0 }; - - test_precision = zero_std_dev_old != 999.0 ? (zero_std_dev + zero_std_dev_old) / 2 : zero_std_dev; - iterations++; - - // Probe the points - zero_std_dev_old = zero_std_dev; - if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) { - SERIAL_PROTOCOLLNPGM("Correct delta settings with M665 and M666"); - return AC_CLEANUP(); - } - zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); - - // Solve matrices - - if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { - - #if !HAS_BED_PROBE - test_precision = 0.00; // forced end - #endif - - if (zero_std_dev < zero_std_dev_min) { - // set roll-back point - COPY(e_old, delta_endstop_adj); - r_old = delta_radius; - h_old = delta_height; - COPY(a_old, delta_tower_angle_trim); - } - - float e_delta[ABC] = { 0.0 }, - r_delta = 0.0, - t_delta[ABC] = { 0.0 }; - - /** - * convergence matrices: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - 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 Z12(I) ZP(12, I) - #define Z4(I) ZP(4, I) - #define Z2(I) ZP(2, I) - #define Z1(I) ZP(1, I) - #define Z0(I) ZP(0, I) - - // calculate factors - const float cr_old = delta_calibration_radius; - if (_7p_9_center) delta_calibration_radius *= 0.9; - h_factor = auto_tune_h(); - r_factor = auto_tune_r(); - a_factor = auto_tune_a(); - delta_calibration_radius = cr_old; - - switch (probe_points) { - case -1: - #if HAS_BED_PROBE && ENABLED(ULTIPANEL) - zprobe_zoffset += probe_z_shift(z_at_pt[CEN]); - #endif - - case 0: - test_precision = 0.00; // forced end - break; - - case 1: - test_precision = 0.00; // forced end - LOOP_XYZ(axis) e_delta[axis] = +Z4(CEN); - break; - - case 2: - if (towers_set) { // see 4 point calibration (towers) matrix - e_delta[A_AXIS] = (+Z4(__A) -Z2(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z2(__A) +Z4(__B) -Z2(__C)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z2(__A) -Z2(__B) +Z4(__C)) * h_factor +Z4(CEN); - r_delta = (+Z4(__A) +Z4(__B) +Z4(__C) -Z12(CEN)) * r_factor; - } - else { // see 4 point calibration (opposites) matrix - e_delta[A_AXIS] = (-Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (+Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (+Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z4(_BC) +Z4(_CA) +Z4(_AB) -Z12(CEN)) * r_factor; - } - break; - - default: // see 7 point calibration (towers & opposites) matrix - e_delta[A_AXIS] = (+Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[B_AXIS] = (-Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor +Z4(CEN); - e_delta[C_AXIS] = (-Z1(__A) -Z1(__B) +Z2(__C) +Z1(_BC) +Z1(_CA) -Z2(_AB)) * h_factor +Z4(CEN); - r_delta = (+Z2(__A) +Z2(__B) +Z2(__C) +Z2(_BC) +Z2(_CA) +Z2(_AB) -Z12(CEN)) * r_factor; - - if (towers_set) { // see 7 point tower angle calibration (towers & opposites) matrix - t_delta[A_AXIS] = (+Z0(__A) -Z4(__B) +Z4(__C) +Z0(_BC) -Z4(_CA) +Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[B_AXIS] = (+Z4(__A) +Z0(__B) -Z4(__C) +Z4(_BC) +Z0(_CA) -Z4(_AB) +Z0(CEN)) * a_factor; - t_delta[C_AXIS] = (-Z4(__A) +Z4(__B) +Z0(__C) -Z4(_BC) +Z4(_CA) +Z0(_AB) +Z0(CEN)) * a_factor; - } - break; - } - LOOP_XYZ(axis) delta_endstop_adj[axis] += e_delta[axis]; - delta_radius += r_delta; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += t_delta[axis]; - } - else if (zero_std_dev >= test_precision) { - // roll back - COPY(delta_endstop_adj, e_old); - delta_radius = r_old; - delta_height = h_old; - COPY(delta_tower_angle_trim, a_old); - } - - if (verbose_level != 0) { // !dry run - - // normalise angles to least squares - if (_angle_results) { - float a_sum = 0.0; - LOOP_XYZ(axis) a_sum += delta_tower_angle_trim[axis]; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0; - } - - // adjust delta_height and endstops by the max amount - const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]); - delta_height -= z_temp; - LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; - } - recalc_delta_settings(); - NOMORE(zero_std_dev_min, zero_std_dev); - - // print report - - if (verbose_level == 3) - print_calibration_results(z_at_pt, _tower_results, _opposite_results); - - if (verbose_level != 0) { // !dry run - if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations - SERIAL_PROTOCOLPGM("Calibration OK"); - SERIAL_PROTOCOL_SP(32); - #if HAS_BED_PROBE - if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration) - SERIAL_PROTOCOLPGM("rolling back."); - else - #endif - { - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev_min, 3); - } - SERIAL_EOL(); - 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)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); - lcd_setstatus(mess); - print_calibration_settings(_endstop_results, _angle_results); - serialprintPGM(save_message); - SERIAL_EOL(); - } - else { // !end iterations - char mess[15]; - if (iterations < 31) - sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations); - else - strcpy_P(mess, PSTR("No convergence")); - SERIAL_PROTOCOL(mess); - SERIAL_PROTOCOL_SP(32); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); - lcd_setstatus(mess); - if (verbose_level > 1) - print_calibration_settings(_endstop_results, _angle_results); - } - } - else { // dry run - const char *enddryrun = PSTR("End DRY-RUN"); - serialprintPGM(enddryrun); - SERIAL_PROTOCOL_SP(35); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); - - char mess[21]; - 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)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); - lcd_setstatus(mess); - } - ac_home(); - } - while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - - AC_CLEANUP(); - } - -#endif // DELTA_AUTO_CALIBRATION - -#if ENABLED(G38_PROBE_TARGET) - - static bool G38_run_probe() { - - bool G38_pass_fail = false; - - #if MULTIPLE_PROBING > 1 - // Get direction of move and retract - float retract_mm[XYZ]; - LOOP_XYZ(i) { - float dist = destination[i] - current_position[i]; - retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1); - } - #endif - - // Move until destination reached or target hit - planner.synchronize(); - endstops.enable(true); - G38_move = true; - G38_endstop_hit = false; - prepare_move_to_destination(); - planner.synchronize(); - G38_move = false; - - endstops.hit_on_purpose(); - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - - if (G38_endstop_hit) { - - G38_pass_fail = true; - - #if MULTIPLE_PROBING > 1 - // Move away by the retract distance - set_destination_from_current(); - LOOP_XYZ(i) destination[i] += retract_mm[i]; - endstops.enable(false); - prepare_move_to_destination(); - - feedrate_mm_s /= 4; - - // Bump the target more slowly - LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2; - - planner.synchronize(); - endstops.enable(true); - G38_move = true; - prepare_move_to_destination(); - planner.synchronize(); - G38_move = false; - - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - #endif - } - - endstops.hit_on_purpose(); - endstops.not_homing(); - return G38_pass_fail; - } - - /** - * G38.2 - probe toward workpiece, stop on contact, signal error if failure - * G38.3 - probe toward workpiece, stop on contact - * - * Like G28 except uses Z min probe for all axes - */ - inline void gcode_G38(bool is_38_2) { - // Get X Y Z E F - gcode_get_destination(); - - setup_for_endstop_or_probe_move(); - - // If any axis has enough movement, do the move - LOOP_XYZ(i) - if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { - if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i); - // If G38.2 fails throw an error - if (!G38_run_probe() && is_38_2) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Failed to reach target"); - } - break; - } - - clean_up_after_endstop_or_probe_move(); - } - -#endif // G38_PROBE_TARGET - -#if HAS_MESH - - /** - * G42: Move X & Y axes to mesh coordinates (I & J) - */ - inline void gcode_G42() { - #if ENABLED(NO_MOTION_BEFORE_HOMING) - if (axis_unhomed_error()) return; - #endif - - if (IsRunning()) { - const bool hasI = parser.seenval('I'); - const int8_t ix = hasI ? parser.value_int() : 0; - const bool hasJ = parser.seenval('J'); - const int8_t iy = hasJ ? parser.value_int() : 0; - - if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { - SERIAL_ECHOLNPGM(MSG_ERR_MESH_XY); - return; - } - - 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); - - // SCARA kinematic has "safe" XY raw moves - #if IS_SCARA - prepare_uninterpolated_move_to_destination(); - #else - prepare_move_to_destination(); - #endif - } - } - -#endif // HAS_MESH - -/** - * G92: Set current position to given X Y Z E - */ -inline void gcode_G92() { - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - switch (parser.subcode) { - 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_software_endstops((AxisEnum)i); - } - } - #endif // Not SCARA - return; - } - #endif - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - #define IS_G92_0 (parser.subcode == 0) - #else - #define IS_G92_0 true - #endif - - bool didE = false; - #if IS_SCARA || !HAS_POSITION_SHIFT - bool didXYZ = false; - #else - constexpr bool didXYZ = false; - #endif - - if (IS_G92_0) LOOP_XYZE(i) { - if (parser.seenval(axis_codes[i])) { - const float l = parser.value_axis_units((AxisEnum)i), - v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i), - d = v - current_position[i]; - if (!NEAR_ZERO(d)) { - #if IS_SCARA || !HAS_POSITION_SHIFT - if (i == E_AXIS) didE = true; else didXYZ = true; - current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior - #elif HAS_POSITION_SHIFT - if (i == E_AXIS) { - didE = true; - current_position[E_AXIS] = v; // When using coordinate spaces, only E is set directly - } - else { - position_shift[i] += d; // Other axes simply offset the coordinate space - update_software_endstops((AxisEnum)i); - } - #endif - } - } - } - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Apply workspace offset to the active coordinate system - if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(coordinate_system[active_coordinate_system], position_shift); - #endif - - // Update planner/steppers only if the native coordinates changed - if (didXYZ) SYNC_PLAN_POSITION_KINEMATIC(); - else if (didE) sync_plan_position_e(); - - report_current_position(); -} - -#if HAS_RESUME_CONTINUE - - /** - * M0: Unconditional stop - Wait for user button press on LCD - * M1: Conditional stop - Wait for user button press on LCD - */ - inline void gcode_M0_M1() { - const char * const args = parser.string_arg; - - millis_t ms = 0; - bool hasP = false, hasS = false; - if (parser.seenval('P')) { - ms = parser.value_millis(); // milliseconds to wait - hasP = ms > 0; - } - if (parser.seenval('S')) { - ms = parser.value_millis_from_seconds(); // seconds to wait - hasS = ms > 0; - } - - const bool has_message = !hasP && !hasS && args && *args; - - planner.synchronize(); - - #if ENABLED(ULTIPANEL) - - if (has_message) - lcd_setstatus(args, true); - else { - LCD_MESSAGEPGM(MSG_USERWAIT); - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - dontExpireStatus(); - #endif - } - - #else - - if (has_message) { - SERIAL_ECHO_START(); - SERIAL_ECHOLN(args); - } - - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - - if (ms > 0) { - ms += millis(); // wait until this time for a click - while (PENDING(millis(), ms) && wait_for_user) idle(); - } - else - while (wait_for_user) idle(); - - - #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) - if (lights_off_after_print) { - leds.set_off(); - lights_off_after_print = false; - } - #endif - - lcd_reset_status(); - - wait_for_user = false; - KEEPALIVE_STATE(IN_HANDLER); - } - -#endif // HAS_RESUME_CONTINUE - -#if ENABLED(SPINDLE_LASER_ENABLE) - /** - * M3: Spindle Clockwise - * M4: Spindle Counter-clockwise - * - * S0 turns off spindle. - * - * If no speed PWM output is defined then M3/M4 just turns it on. - * - * At least 12.8KHz (50Hz * 256) is needed for spindle PWM. - * Hardware PWM is required. ISRs are too slow. - * - * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. - * No other settings give a PWM signal that goes from 0 to 5 volts. - * - * The system automatically sets WGM to Mode 1, so no special - * initialization is needed. - * - * WGM bits for timer 2 are automatically set by the system to - * Mode 1. This produces an acceptable 0 to 5 volt signal. - * No special initialization is needed. - * - * NOTE: A minimum PWM frequency of 50 Hz is needed. All prescaler - * factors for timers 2, 3, 4, and 5 are acceptable. - * - * SPINDLE_LASER_ENABLE_PIN needs an external pullup or it may power on - * the spindle/laser during power-up or when connecting to the host - * (usually goes through a reset which sets all I/O pins to tri-state) - * - * PWM duty cycle goes from 0 (off) to 255 (always on). - */ - - // Wait for spindle to come up to speed - inline void delay_for_power_up() { dwell(SPINDLE_LASER_POWERUP_DELAY); } - - // Wait for spindle to stop turning - inline void delay_for_power_down() { dwell(SPINDLE_LASER_POWERDOWN_DELAY); } - - /** - * ocr_val_mode() is used for debugging and to get the points needed to compute the RPM vs ocr_val line - * - * it accepts inputs of 0-255 - */ - - inline void ocr_val_mode() { - uint8_t spindle_laser_power = parser.value_byte(); - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) - if (SPINDLE_LASER_PWM_INVERT) spindle_laser_power = 255 - spindle_laser_power; - analogWrite(SPINDLE_LASER_PWM_PIN, spindle_laser_power); - } - - inline void gcode_M3_M4(bool is_M3) { - - planner.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle - #if SPINDLE_DIR_CHANGE - const bool rotation_dir = (is_M3 && !SPINDLE_INVERT_DIR || !is_M3 && SPINDLE_INVERT_DIR) ? HIGH : LOW; - if (SPINDLE_STOP_ON_DIR_CHANGE \ - && READ(SPINDLE_LASER_ENABLE_PIN) == SPINDLE_LASER_ENABLE_INVERT \ - && READ(SPINDLE_DIR_PIN) != rotation_dir - ) { - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off - delay_for_power_down(); - } - WRITE(SPINDLE_DIR_PIN, rotation_dir); - #endif - - /** - * Our final value for ocr_val is an unsigned 8 bit value between 0 and 255 which usually means uint8_t. - * Went to uint16_t because some of the uint8_t calculations would sometimes give 1000 0000 rather than 1111 1111. - * Then needed to AND the uint16_t result with 0x00FF to make sure we only wrote the byte of interest. - */ - #if ENABLED(SPINDLE_LASER_PWM) - if (parser.seen('O')) ocr_val_mode(); - else { - const float spindle_laser_power = parser.floatval('S'); - if (spindle_laser_power == 0) { - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte - delay_for_power_down(); - } - else { - int16_t ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // convert RPM to PWM duty cycle - NOMORE(ocr_val, 255); // limit to max the Atmel PWM will support - if (spindle_laser_power <= SPEED_POWER_MIN) - ocr_val = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // minimum setting - if (spindle_laser_power >= SPEED_POWER_MAX) - ocr_val = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * (1.0f / (SPEED_POWER_SLOPE)); // limit to max RPM - if (SPINDLE_LASER_PWM_INVERT) ocr_val = 255 - ocr_val; - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) - analogWrite(SPINDLE_LASER_PWM_PIN, ocr_val & 0xFF); // only write low byte - delay_for_power_up(); - } - } - #else - WRITE(SPINDLE_LASER_ENABLE_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) if spindle speed option not enabled - delay_for_power_up(); - #endif - } - - /** - * M5 turn off spindle - */ - inline void gcode_M5() { - planner.synchronize(); - WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); - #if ENABLED(SPINDLE_LASER_PWM) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); - #endif - delay_for_power_down(); - } - -#endif // SPINDLE_LASER_ENABLE - -/** - * M17: Enable power on all stepper motors - */ -inline void gcode_M17() { - LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_all_steppers(); -} - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - void do_pause_e_move(const float &length, const float &fr) { - set_destination_from_current(); - destination[E_AXIS] += length / planner.e_factor[active_extruder]; - planner.buffer_line_kinematic(destination, fr, active_extruder); - set_current_from_destination(); - planner.synchronize(); - } - - static float resume_position[XYZE]; - int8_t did_pause_print = 0; - - #if HAS_BUZZER - static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { - static millis_t next_buzz = 0; - static int8_t runout_beep = 0; - - if (init) next_buzz = runout_beep = 0; - - const millis_t ms = millis(); - if (ELAPSED(ms, next_buzz)) { - if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to - next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500); - BUZZ(50, 880 - (runout_beep & 1) * 220); - runout_beep++; - } - } - } - #endif - - /** - * Ensure a safe temperature for extrusion - * - * - Fail if the TARGET temperature is too low - * - Display LCD placard with temperature status - * - Return when heating is done or aborted - * - * Returns 'true' if heating was completed, 'false' for abort - */ - static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT) { - - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - return false; - } - #endif - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode); - #else - UNUSED(mode); - #endif - - wait_for_heatup = true; // M108 will clear this - while (wait_for_heatup && thermalManager.wait_for_heating(active_extruder)) idle(); - const bool status = wait_for_heatup; - wait_for_heatup = false; - - return status; - } - - /** - * Load filament into the hotend - * - * - Fail if the a safe temperature was not reached - * - If pausing for confirmation, wait for a click or M108 - * - Show "wait for load" placard - * - Load and purge filament - * - Show "Purge more" / "Continue" menu - * - Return when "Continue" is selected - * - * Returns 'true' if load was completed, 'false' for abort - */ - static bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=0, const int8_t max_beep_count=0, - const bool show_lcd=false, const bool pause_for_user=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #endif - - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; - } - - if (pause_for_user) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "insert filament" - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode); - #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - idle(true); - } - KEEPALIVE_STATE(IN_HANDLER); - } - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show "wait for load" message - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode); - #endif - - // Slow Load filament - if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); - - // Fast Load Filament - if (fast_load_length) { - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; - #endif - - do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - - #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE); - #endif - - wait_for_user = true; - for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) - do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); - wait_for_user = false; - - #else - - do { - if (purge_length > 0) { - // "Wait for filament purge" - #if ENABLED(ULTIPANEL) - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode); - #endif - - // Extrude filament to get into hotend - do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); - } - - // Show "Purge More" / "Resume" menu and wait for reply - #if ENABLED(ULTIPANEL) - if (show_lcd) { - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = false; - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION, mode); - while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true); - KEEPALIVE_STATE(IN_HANDLER); - } - #endif - - // Keep looping if "Purge More" was selected - } while ( - #if ENABLED(ULTIPANEL) - show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE - #else - 0 - #endif - ); - - #endif - - return true; - } - - /** - * Unload filament from the hotend - * - * - Fail if the a safe temperature was not reached - * - Show "wait for unload" placard - * - Retract, pause, then unload filament - * - Disable E stepper (on most machines) - * - * Returns 'true' if unload was completed, 'false' for abort - */ - static bool unload_filament(const float &unload_length, const bool show_lcd=false, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT - ) { - if (!ensure_safe_temperature(mode)) { - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - return false; - } - - #if DISABLED(ULTIPANEL) - UNUSED(show_lcd); - #else - if (show_lcd) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode); - #endif - - // Retract filament - do_pause_e_move(-FILAMENT_UNLOAD_RETRACT_LENGTH, PAUSE_PARK_RETRACT_FEEDRATE); - - // Wait for filament to cool - safe_delay(FILAMENT_UNLOAD_DELAY); - - // Quickly purge - do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.max_feedrate_mm_s[E_AXIS]); - - // Unload filament - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.retract_acceleration; - planner.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; - #endif - - do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.retract_acceleration = saved_acceleration; - #endif - - // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS) - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN - disable_e_stepper(active_extruder); - safe_delay(100); - #endif - - return true; - } - - /** - * Pause procedure - * - * - Abort if already paused - * - Send host action for pause, if configured - * - Abort if TARGET temperature is too low - * - Display "wait for start of filament change" (if a length was specified) - * - Initial retract, if current temperature is hot enough - * - Park the nozzle at the given position - * - Call unload_filament (if a length was specified) - * - * Returns 'true' if pause was completed, 'false' for abort - */ - static bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false) { - if (did_pause_print) return false; // already paused - - #ifdef ACTION_ON_PAUSE - SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); - #endif - - if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); - - #if ENABLED(ULTIPANEL) - if (show_lcd) // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - LCD_MESSAGEPGM(MSG_M600_TOO_COLD); - #endif - - return false; // unable to reach safe temperature - } - - // Indicate that the printer is paused - ++did_pause_print; - - // Pause the print job and timer - #if ENABLED(SDSUPPORT) - if (card.sdprinting) { - card.pauseSDPrint(); - ++did_pause_print; // Indicate SD pause also - } - #endif - print_job_timer.pause(); - - // Save current position - COPY(resume_position, current_position); - - // Wait for synchronize steppers - planner.synchronize(); - - // Initial retract before move to filament change position - if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) - 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()) - Nozzle::park(2, park_point); - - // Unload the filament - if (unload_length) - unload_filament(unload_length, show_lcd); - - return true; - } - - /** - * - Show "Insert filament and press button to continue" - * - Wait for a click before returning - * - Heaters can time out, reheated before accepting a click - * - * Used by M125 and M600 - */ - static void wait_for_filament_reload(const int8_t max_beep_count=0) { - bool nozzle_timed_out = false; - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); - #endif - SERIAL_ECHO_START(); - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() - thermalManager.start_heater_idle_timer(e, nozzle_timeout); - - // Wait for filament insert by user and press button - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - - // If the nozzle has timed out, wait for the user to press the button to re-heat the nozzle, then - // re-heat the nozzle, re-show the insert screen, restart the idle timers, and start over - if (!nozzle_timed_out) - HOTEND_LOOP() - nozzle_timed_out |= thermalManager.is_heater_idle(e); - - if (nozzle_timed_out) { - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE); - #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_HEAT_LCD); - #endif - - // Wait for LCD click or M108 - while (wait_for_user) idle(true); - - // Re-enable the heaters if they timed out - HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e); - - // Wait for the heaters to reach the target temperatures - ensure_safe_temperature(); - - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); - #endif - SERIAL_ECHO_START(); - #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT); - #elif ENABLED(EMERGENCY_PARSER) - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108); - #else - SERIAL_ERRORLNPGM(MSG_FILAMENT_CHANGE_INSERT_LCD); - #endif - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() - thermalManager.start_heater_idle_timer(e, nozzle_timeout); - - wait_for_user = true; // Wait for user to load filament - nozzle_timed_out = false; - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif - } - - idle(true); - } - KEEPALIVE_STATE(IN_HANDLER); - } - - /** - * Resume or Start print procedure - * - * - Abort if not paused - * - Reset heater idle timers - * - Load filament if specified, but only if: - * - a nozzle timed out, or - * - the nozzle is already heated. - * - Display "wait for print to resume" - * - Re-prime the nozzle... - * - FWRETRACT: Recover/prime from the prior G10. - * - !FWRETRACT: Retract by resume_position[E], if negative. - * Not sure how this logic comes into use. - * - Move the nozzle back to resume_position - * - Sync the planner E to resume_position[E] - * - Send host action for resume, if configured - * - Resume the current SD print job, if any - */ - static void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0) { - if (!did_pause_print) return; - - // Re-enable the heaters if they timed out - bool nozzle_timed_out = false; - HOTEND_LOOP() { - nozzle_timed_out |= thermalManager.is_heater_idle(e); - thermalManager.reset_heater_idle_timer(e); - } - - if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) { - // Load the new filament - load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out); - } - - #if ENABLED(ULTIPANEL) - // "Wait for print to resume" - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); - #endif - - // Intelligent resuming - #if ENABLED(FWRETRACT) - // If retracted before goto pause - if (fwretract.retracted[active_extruder]) - do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s); - #endif - - // If resume_position is negative - if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], 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); - - // Set Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); - - // Now all extrusion positions are resumed and ready to be confirmed - // Set extruder to saved position - planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS])); - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.reset(); - #endif - - #if ENABLED(ULTIPANEL) - // Show status screen - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - - #ifdef ACTION_ON_RESUME - SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); - #endif - - --did_pause_print; - - #if ENABLED(SDSUPPORT) - if (did_pause_print) { - card.startFileprint(); - --did_pause_print; - } - #endif - } - -#endif // ADVANCED_PAUSE_FEATURE - -#if ENABLED(SDSUPPORT) - - /** - * M20: List SD card to serial output - */ - inline void gcode_M20() { - SERIAL_PROTOCOLLNPGM(MSG_BEGIN_FILE_LIST); - card.ls(); - SERIAL_PROTOCOLLNPGM(MSG_END_FILE_LIST); - } - - /** - * M21: Init SD Card - */ - inline void gcode_M21() { card.initsd(); } - - /** - * M22: Release SD Card - */ - inline void gcode_M22() { card.release(); } - - /** - * M23: Open a file - */ - inline void gcode_M23() { - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - // Simplify3D includes the size, so zero out all spaces (#7227) - for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; - card.openFile(parser.string_arg, true); - } - - /** - * M24: Start or Resume SD Print - */ - inline void gcode_M24() { - #if ENABLED(PARK_HEAD_ON_PAUSE) - resume_print(); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('S')) card.setIndex(parser.value_long()); - #endif - - card.startFileprint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('T')) - print_job_timer.resume(parser.value_long()); - else - #endif - print_job_timer.start(); - } - - /** - * M25: Pause SD Print - */ - inline void gcode_M25() { - card.pauseSDPrint(); - print_job_timer.pause(); - - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer - #endif - } - - /** - * M26: Set SD Card file index - */ - inline void gcode_M26() { - if (card.cardOK && parser.seenval('S')) - card.setIndex(parser.value_long()); - } - - /** - * M27: Get SD Card status - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - */ - inline void gcode_M27() { - if (parser.seen('C')) { - SERIAL_ECHOPGM("Current file: "); - card.printFilename(); - } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - else if (parser.seenval('S')) - card.set_auto_report_interval(parser.value_byte()); - #endif - - else - card.getStatus(1); - } - - /** - * M28: Start SD Write - */ - inline void gcode_M28() { card.openFile(parser.string_arg, false); } - - /** - * M29: Stop SD Write - * Processed in write to file routine above - */ - inline void gcode_M29() { - // card.saving = false; - } - - /** - * M30 : Delete SD Card file - */ - inline void gcode_M30() { - if (card.cardOK) { - card.closefile(); - card.removeFile(parser.string_arg); - } - } - -#endif // SDSUPPORT - -/** - * M31: Get the time since the start of SD Print (or last M109) - */ -inline void gcode_M31() { - char buffer[21]; - duration_t elapsed = print_job_timer.duration(); - elapsed.toString(buffer); - lcd_setstatus(buffer); - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Print time: ", buffer); -} - -#if ENABLED(SDSUPPORT) - - /** - * M32: Select file and start SD Print - * - * Examples: - * - * M32 !PATH/TO/FILE.GCO# ; Start FILE.GCO - * M32 P !PATH/TO/FILE.GCO# ; Start FILE.GCO as a procedure - * M32 S60 !PATH/TO/FILE.GCO# ; Start FILE.GCO at byte 60 - * - */ - inline void gcode_M32() { - if (card.sdprinting) planner.synchronize(); - - if (card.cardOK) { - const bool call_procedure = parser.boolval('P'); - - card.openFile(parser.string_arg, true, call_procedure); - - if (parser.seenval('S')) card.setIndex(parser.value_long()); - - card.startFileprint(); - - // Procedure calls count as normal print time. - if (!call_procedure) print_job_timer.start(); - } - } - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - - /** - * M33: Get the long full path of a file or folder - * - * Parameters: - * Case-insensitive DOS-style path to a file or folder - * - * Example: - * M33 miscel~1/armchair/armcha~1.gco - * - * Output: - * /Miscellaneous/Armchair/Armchair.gcode - */ - inline void gcode_M33() { - card.printLongPath(parser.string_arg); - } - - #endif - - #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) - /** - * M34: Set SD Card Sorting Options - */ - inline void gcode_M34() { - if (parser.seen('S')) card.setSortOn(parser.value_bool()); - if (parser.seenval('F')) { - const int v = parser.value_long(); - card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0); - } - //if (parser.seen('R')) card.setSortReverse(parser.value_bool()); - } - #endif // SDCARD_SORT_ALPHA && SDSORT_GCODE - - /** - * M928: Start SD Write - */ - inline void gcode_M928() { - card.openLogFile(parser.string_arg); - } - -#endif // SDSUPPORT - -/** - * Sensitive pin test for M42, M226 - */ -static bool pin_is_protected(const pin_t pin) { - static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; - for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) - if (pin == (pin_t)pgm_read_byte(&sensitive_pins[i])) return true; - return false; -} - -inline void protected_pin_err() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN); -} - -/** - * M42: Change pin status via GCode - * - * P Pin number (LED if omitted) - * S Pin status from 0 - 255 - * I Flag to ignore Marlin's pin protection - */ -inline void gcode_M42() { - if (!parser.seenval('S')) return; - const byte pin_status = parser.value_byte(); - - const pin_t pin_number = parser.byteval('P', LED_PIN); - if (pin_number < 0) return; - - if (!parser.boolval('I') && pin_is_protected(pin_number)) return protected_pin_err(); - - pinMode(pin_number, OUTPUT); - digitalWrite(pin_number, pin_status); - analogWrite(pin_number, pin_status); - - #if FAN_COUNT > 0 - switch (pin_number) { - #if HAS_FAN0 - case FAN_PIN: fanSpeeds[0] = pin_status; break; - #endif - #if HAS_FAN1 - case FAN1_PIN: fanSpeeds[1] = pin_status; break; - #endif - #if HAS_FAN2 - case FAN2_PIN: fanSpeeds[2] = pin_status; break; - #endif - } - #endif -} - -#if ENABLED(PINS_DEBUGGING) - - #include "pinsDebug.h" - - inline void toggle_pins() { - const bool ignore_protection = parser.boolval('I'); - const int repeat = parser.intval('R', 1), - start = parser.intval('S'), - end = parser.intval('L', NUM_DIGITAL_PINS - 1), - wait = parser.intval('W', 500); - - for (uint8_t pin = start; pin <= end; pin++) { - //report_pin_state_extended(pin, ignore_protection, false); - - if (!ignore_protection && pin_is_protected(pin)) { - report_pin_state_extended(pin, ignore_protection, true, "Untouched "); - SERIAL_EOL(); - } - else { - 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) { - SET_OUTPUT(TEENSY_E2); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E2, LOW); safe_delay(wait); - WRITE(TEENSY_E2, HIGH); safe_delay(wait); - WRITE(TEENSY_E2, LOW); safe_delay(wait); - } - } - else if (pin == TEENSY_E3) { - SET_OUTPUT(TEENSY_E3); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E3, LOW); safe_delay(wait); - WRITE(TEENSY_E3, HIGH); safe_delay(wait); - WRITE(TEENSY_E3, LOW); safe_delay(wait); - } - } - else - #endif - { - pinMode(pin, OUTPUT); - for (int16_t j = 0; j < repeat; j++) { - digitalWrite(pin, 0); safe_delay(wait); - digitalWrite(pin, 1); safe_delay(wait); - digitalWrite(pin, 0); safe_delay(wait); - } - } - - } - SERIAL_EOL(); - } - SERIAL_ECHOLNPGM("Done."); - - } // toggle_pins - - inline void servo_probe_test() { - #if !(NUM_SERVOS > 0 && HAS_SERVO_0) - - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("SERVO not setup"); - - #elif !HAS_Z_SERVO_PROBE - - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z_PROBE_SERVO_NR not setup"); - - #else // HAS_Z_SERVO_PROBE - - const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR); - - SERIAL_PROTOCOLLNPGM("Servo probe test"); - SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index); - SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]); - SERIAL_PROTOCOLLNPAIR(". stow angle: ", z_servo_angle[1]); - - bool probe_inverting; - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - - #define PROBE_TEST_PIN Z_MIN_PIN - - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: "); - - #if Z_MIN_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); - #else - SERIAL_PROTOCOLLNPGM("false"); - #endif - - probe_inverting = Z_MIN_ENDSTOP_INVERTING; - - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - - #define PROBE_TEST_PIN Z_MIN_PROBE_PIN - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: "); - - #if Z_MIN_PROBE_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); - #else - SERIAL_PROTOCOLLNPGM("false"); - #endif - - probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING; - - #endif - - SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times"); - SET_INPUT_PULLUP(PROBE_TEST_PIN); - bool deploy_state, stow_state; - for (uint8_t i = 0; i < 4; i++) { - MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy - safe_delay(500); - deploy_state = READ(PROBE_TEST_PIN); - MOVE_SERVO(probe_index, z_servo_angle[1]); //stow - safe_delay(500); - stow_state = READ(PROBE_TEST_PIN); - } - if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards"); - - if (deploy_state != stow_state) { - SERIAL_PROTOCOLLNPGM("BLTouch clone detected"); - if (deploy_state) { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: HIGH (logic 1)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: LOW (logic 0)"); - } - else { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: LOW (logic 0)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: HIGH (logic 1)"); - } - #if ENABLED(BLTOUCH) - SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true."); - #endif - - } - else { // measure active signal length - MOVE_SERVO(probe_index, z_servo_angle[0]); // deploy - safe_delay(500); - SERIAL_PROTOCOLLNPGM("please trigger probe"); - uint16_t probe_counter = 0; - - // Allow 30 seconds max for operator to trigger probe - for (uint16_t j = 0; j < 500 * 30 && probe_counter == 0 ; j++) { - - safe_delay(2); - - if (0 == j % (500 * 1)) reset_stepper_timeout(); // Keep steppers powered - - if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered - - for (probe_counter = 1; probe_counter < 50 && deploy_state != READ(PROBE_TEST_PIN); ++probe_counter) - safe_delay(2); - - if (probe_counter == 50) - SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time - else if (probe_counter >= 2) - SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse - else - SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse - - MOVE_SERVO(probe_index, z_servo_angle[1]); //stow - - } // pulse detected - - } // for loop waiting for trigger - - if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected"); - - } // measure active signal length - - #endif - - } // servo_probe_test - - /** - * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report - * - * M43 - report name and state of pin(s) - * P Pin to read or watch. If omitted, reads all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 W - Watch pins -reporting changes- until reset, click, or M108. - * P Pin to read or watch. If omitted, read/watch all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 E - Enable / disable background endstop monitoring - * - Machine continues to operate - * - Reports changes to endstops - * - Toggles LED_PIN when an endstop changes - * - Can not reliably catch the 5mS pulse from BLTouch type probes - * - * M43 T - Toggle pin(s) and report which pin is being toggled - * S - Start Pin number. If not given, will default to 0 - * L - End Pin number. If not given, will default to last pin defined for this board - * I - Flag to ignore Marlin's pin protection. Use with caution!!!! - * R - Repeat pulses on each pin this number of times before continueing to next pin - * W - Wait time (in miliseconds) between pulses. If not given will default to 500 - * - * M43 S - Servo probe test - * P - Probe index (optional - defaults to 0 - */ - inline void gcode_M43() { - - if (parser.seen('T')) { // must be first or else its "S" and "E" parameters will execute endstop or servo test - toggle_pins(); - return; - } - - // Enable or disable endstop monitoring - if (parser.seen('E')) { - endstop_monitor_flag = parser.value_bool(); - SERIAL_PROTOCOLPGM("endstop monitor "); - serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis")); - SERIAL_PROTOCOLLNPGM("abled"); - return; - } - - if (parser.seen('S')) { - servo_probe_test(); - return; - } - - // Get the range of pins to test or watch - const pin_t first_pin = parser.byteval('P'), - last_pin = parser.seenval('P') ? first_pin : NUM_DIGITAL_PINS - 1; - - if (first_pin > last_pin) return; - - const bool ignore_protection = parser.boolval('I'); - - // Watch until click, M108, or reset - if (parser.boolval('W')) { - SERIAL_PROTOCOLLNPGM("Watching pins"); - byte pin_state[last_pin - first_pin + 1]; - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; - pinMode(pin, INPUT_PULLUP); - delay(1); - /* - if (IS_ANALOG(pin)) - pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...] - else - //*/ - pin_state[pin - first_pin] = digitalRead(pin); - } - - #if HAS_RESUME_CONTINUE - wait_for_user = true; - KEEPALIVE_STATE(PAUSED_FOR_USER); - #endif - - for (;;) { - for (pin_t pin = first_pin; pin <= last_pin; pin++) { - if (!ignore_protection && pin_is_protected(pin)) continue; - const byte val = - /* - IS_ANALOG(pin) - ? analogRead(pin - analogInputToDigitalPin(0)) : // int16_t val - : - //*/ - digitalRead(pin); - if (val != pin_state[pin - first_pin]) { - report_pin_state_extended(pin, ignore_protection, false); - pin_state[pin - first_pin] = val; - } - } - - #if HAS_RESUME_CONTINUE - if (!wait_for_user) { - KEEPALIVE_STATE(IN_HANDLER); - break; - } - #endif - - safe_delay(200); - } - return; - } - - // Report current state of selected pin(s) - for (pin_t pin = first_pin; pin <= last_pin; pin++) - report_pin_state_extended(pin, ignore_protection, true); - } - -#endif // PINS_DEBUGGING - -#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - - /** - * M48: Z probe repeatability measurement function. - * - * Usage: - * M48 - * P = Number of sampled points (4-50, default 10) - * X = Sample X position - * Y = Sample Y position - * V = Verbose level (0-4, default=1) - * E = Engage Z probe for each reading - * L = Number of legs of movement before probe - * S = Schizoid (Or Star if you prefer) - * - * This function requires the machine to be homed before invocation. - */ - inline void gcode_M48() { - - if (axis_unhomed_error()) return; - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); - return; - } - - if (verbose_level > 0) - SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability Test"); - - const int8_t n_samples = parser.byteval('P', 10); - if (!WITHIN(n_samples, 4, 50)) { - SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50)."); - return; - } - - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - 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); - - if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { - SERIAL_PROTOCOLLNPGM("? (X,Y) out of bounds."); - return; - } - - bool seen_L = parser.seen('L'); - uint8_t n_legs = seen_L ? parser.value_byte() : 0; - if (n_legs > 15) { - SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15)."); - return; - } - if (n_legs == 1) n_legs = 2; - - const bool schizoid_flag = parser.boolval('S'); - if (schizoid_flag && !seen_L) n_legs = 7; - - /** - * Now get everything to the specified probe point So we can safely do a - * probe to get us close to the bed. If the Z-Axis is far from the bed, - * we don't want to use that as a starting point for each probe. - */ - if (verbose_level > 2) - SERIAL_PROTOCOLLNPGM("Positioning the probe..."); - - // Disable bed level correction in M48 because we want the raw data when we probe - - #if HAS_LEVELING - const bool was_enabled = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - setup_for_endstop_or_probe_move(); - - 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); - bool probing_good = !isnan(t); - - if (probing_good) { - randomSeed(millis()); - - for (uint8_t n = 0; n < n_samples; n++) { - if (n_legs) { - const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - float angle = random(0.0, 360.0); - const float radius = random( - #if ENABLED(DELTA) - 0.1250000000 * (DELTA_PRINTABLE_RADIUS), - 0.3333333333 * (DELTA_PRINTABLE_RADIUS) - #else - 5.0, 0.125 * MIN(X_BED_SIZE, Y_BED_SIZE) - #endif - ); - - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Starting radius: ", radius); - SERIAL_ECHOPAIR(" angle: ", angle); - SERIAL_ECHOPGM(" Direction: "); - if (dir > 0) SERIAL_ECHOPGM("Counter-"); - SERIAL_ECHOLNPGM("Clockwise"); - } - - for (uint8_t l = 0; l < n_legs - 1; l++) { - float delta_angle; - - if (schizoid_flag) - // The points of a 5 point star are 72 degrees apart. We need to - // skip a point and go to the next one on the star. - delta_angle = dir * 2.0 * 72.0; - - else - // If we do this line, we are just trying to move further - // around the circle. - delta_angle = dir * (float) random(25, 45); - - angle += delta_angle; - - while (angle > 360.0) // We probably do not need to keep the angle between 0 and 2*PI, but the - angle -= 360.0; // Arduino documentation says the trig functions should not be given values - while (angle < 0.0) // outside of this range. It looks like they behave correctly with - angle += 360.0; // 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; - - #if DISABLED(DELTA) - X_current = constrain(X_current, X_MIN_POS, X_MAX_POS); - Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS); - #else - // If we have gone out too far, we can do a simple fix and scale the numbers - // back in closer to the origin. - while (!position_is_reachable_by_probe(X_current, Y_current)) { - X_current *= 0.8; - Y_current *= 0.8; - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Pulling point towards center:", X_current); - SERIAL_ECHOLNPAIR(", ", Y_current); - } - } - #endif - if (verbose_level > 3) { - SERIAL_PROTOCOLPGM("Going to:"); - SERIAL_ECHOPAIR(" X", X_current); - SERIAL_ECHOPAIR(" Y", Y_current); - SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]); - } - do_blocking_move_to_xy(X_current, Y_current); - } // n_legs loop - } // n_legs - - // Probe a single point - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after); - - // Break the loop if the probe fails - probing_good = !isnan(sample_set[n]); - if (!probing_good) break; - - /** - * Get the current mean for the data points we have so far - */ - float sum = 0.0; - for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; - mean = sum / (n + 1); - - NOMORE(min, sample_set[n]); - NOLESS(max, sample_set[n]); - - /** - * Now, use that mean to calculate the standard deviation for the - * data points we have so far - */ - sum = 0.0; - for (uint8_t j = 0; j <= n; j++) - sum += sq(sample_set[j] - mean); - - sigma = SQRT(sum / (n + 1)); - if (verbose_level > 0) { - if (verbose_level > 1) { - SERIAL_PROTOCOL(n + 1); - SERIAL_PROTOCOLPGM(" of "); - SERIAL_PROTOCOL((int)n_samples); - SERIAL_PROTOCOLPGM(": z: "); - SERIAL_PROTOCOL_F(sample_set[n], 3); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(" mean: "); - SERIAL_PROTOCOL_F(mean, 4); - SERIAL_PROTOCOLPGM(" sigma: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_PROTOCOLPGM(" min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" range: "); - SERIAL_PROTOCOL_F(max-min, 3); - } - SERIAL_EOL(); - } - } - - } // n_samples loop - } - - STOW_PROBE(); - - if (probing_good) { - SERIAL_PROTOCOLLNPGM("Finished!"); - - if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("Mean: "); - SERIAL_PROTOCOL_F(mean, 6); - SERIAL_PROTOCOLPGM(" Min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" Max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" Range: "); - SERIAL_PROTOCOL_F(max-min, 3); - SERIAL_EOL(); - } - - SERIAL_PROTOCOLPGM("Standard Deviation: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_EOL(); - SERIAL_EOL(); - } - - clean_up_after_endstop_or_probe_move(); - - // Re-enable bed level correction if it had been on - #if HAS_LEVELING - set_bed_leveling_enabled(was_enabled); - #endif - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - report_current_position(); - } - -#endif // Z_MIN_PROBE_REPEATABILITY_TEST - -#if ENABLED(G26_MESH_VALIDATION) - - inline void gcode_M49() { - g26_debug_flag ^= true; - SERIAL_PROTOCOLPGM("G26 Debug "); - serialprintPGM(g26_debug_flag ? PSTR("on.\n") : PSTR("off.\n")); - } - -#endif // G26_MESH_VALIDATION - -#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - /** - * M73: Set percentage complete (for display on LCD) - * - * Example: - * M73 P25 ; Set progress to 25% - * - * Notes: - * This has no effect during an SD print job - */ - inline void gcode_M73() { - if (!IS_SD_PRINTING && parser.seen('P')) { - progress_bar_percent = parser.value_byte(); - NOMORE(progress_bar_percent, 100); - } - } -#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY - -/** - * M75: Start print timer - */ -inline void gcode_M75() { print_job_timer.start(); } - -/** - * M76: Pause print timer - */ -inline void gcode_M76() { print_job_timer.pause(); } - -/** - * M77: Stop print timer - */ -inline void gcode_M77() { print_job_timer.stop(); } - -#if ENABLED(PRINTCOUNTER) - /** - * M78: Show print statistics - */ - inline void gcode_M78() { - // "M78 S78" will reset the statistics - if (parser.intval('S') == 78) - print_job_timer.initStats(); - else - print_job_timer.showStats(); - } -#endif - -/** - * M104: Set hot end temperature - */ -inline void gcode_M104() { - if (get_target_extruder_from_command(104)) return; - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(SINGLENOZZLE) - if (target_extruder != active_extruder) return; - #endif - - if (parser.seenval('S')) { - const int16_t temp = parser.value_celsius(); - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Stop the timer at the end of print. Start is managed by 'heat and wait' M109. - * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot - * standby mode, for instance in a dual extruder setup, without affecting - * the running print timer. - */ - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - lcd_reset_status(); - } - #endif - } - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif -} - -/** - * M105: Read hot end and bed temperature - */ -inline void gcode_M105() { - if (get_target_extruder_from_command(105)) return; - - #if HAS_TEMP_SENSOR - SERIAL_PROTOCOLPGM(MSG_OK); - thermalManager.print_heaterstates(); - #else // !HAS_TEMP_SENSOR - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS); - #endif - - SERIAL_EOL(); -} - -#if ENABLED(AUTO_REPORT_TEMPERATURES) - - /** - * M155: Set temperature auto-report interval. M155 S - */ - inline void gcode_M155() { - if (parser.seenval('S')) - thermalManager.set_auto_report_interval(parser.value_byte()); - } - -#endif // AUTO_REPORT_TEMPERATURES - -#if FAN_COUNT > 0 - - /** - * M106: Set Fan Speed - * - * S Speed between 0-255 - * P Fan index, if more than one fan - * - * With EXTRA_FAN_SPEED enabled: - * - * T Restore/Use/Set Temporary Speed: - * 1 = Restore previous speed after T2 - * 2 = Use temporary speed set with T3-255 - * 3-255 = Set the speed for use with T2 - */ - inline void gcode_M106() { - const uint8_t p = parser.byteval('P'); - if (p < FAN_COUNT) { - #if ENABLED(EXTRA_FAN_SPEED) - const int16_t t = parser.intval('T'); - if (t > 0) { - switch (t) { - case 1: - fanSpeeds[p] = old_fanSpeeds[p]; - break; - case 2: - old_fanSpeeds[p] = fanSpeeds[p]; - fanSpeeds[p] = new_fanSpeeds[p]; - break; - default: - new_fanSpeeds[p] = MIN(t, 255); - break; - } - return; - } - #endif // EXTRA_FAN_SPEED - const uint16_t s = parser.ushortval('S', 255); - fanSpeeds[p] = MIN(s, 255U); - } - } - - /** - * M107: Fan Off - */ - inline void gcode_M107() { - const uint16_t p = parser.ushortval('P'); - if (p < FAN_COUNT) fanSpeeds[p] = 0; - } - -#endif // FAN_COUNT > 0 - -#if DISABLED(EMERGENCY_PARSER) - - /** - * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. - */ - inline void gcode_M108() { wait_for_heatup = false; } - - - /** - * M112: Emergency Stop - */ - inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } - - - /** - * M410: Quickstop - Abort all planned moves - * - * This will stop the carriages mid-move, so most likely they - * will be out of sync with the stepper position after this. - */ - inline void gcode_M410() { quickstop_stepper(); } - -#endif - -/** - * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. - * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. - */ - -#ifndef MIN_COOLING_SLOPE_DEG - #define MIN_COOLING_SLOPE_DEG 1.50 -#endif -#ifndef MIN_COOLING_SLOPE_TIME - #define MIN_COOLING_SLOPE_TIME 60 -#endif -inline void delay_mcu(int ms) -{ - unsigned int i=0; - DELAY_US(ms*100); - - return; - ms= 100000; - while(ms--) - { - i=2000000; // - while(i--) ; - } - -} -//M1090 for mainboard hardware test -inline void gcode_M1090() { - int kk[8]; - int s_old[8]; - int nn=0; - int i=0; - OUT_WRITE(X_STEP_PIN,0); - OUT_WRITE(X_DIR_PIN,0); - - OUT_WRITE(X_ENABLE_PIN,0); - OUT_WRITE(Y_ENABLE_PIN,0); - OUT_WRITE(Z_ENABLE_PIN,0); - OUT_WRITE(E0_ENABLE_PIN,0); - OUT_WRITE(E1_ENABLE_PIN,0); - - memset(kk,0,sizeof(kk)); - memset(s_old,0,sizeof(s_old)); - ///////////////////////////////////// x motor - nn=0; - i=0; - while(READ(Y_MIN_PIN)==0&&nn<20000) - { - //OUT_WRITE(X_DIR_PIN,1); - OUT_WRITE(Y_DIR_PIN,0); - - OUT_WRITE(Y_STEP_PIN,1); - delay_mcu(10); - OUT_WRITE(Y_STEP_PIN,0); - delay_mcu(10); - nn++; - - - } - nn=0; - SERIAL_ERRORLNPGM("gcode_M1090_0"); - while(1) - { - - OUT_WRITE(X_STEP_PIN,0); - delay_mcu(10); - OUT_WRITE(X_STEP_PIN,1); - delay_mcu(10); - if(READ(X_MIN_PIN)==0) - { - - OUT_WRITE(X_DIR_PIN,0); - if(s_old[i]==1) - { - s_old[i]=0; - kk[i]++; - - watchdog_reset(); - } - } - else if(s_old[i]==0) - s_old[i]=1; - - if(READ(Y_MIN_PIN)==0) - { - - OUT_WRITE(X_DIR_PIN,1); - if(s_old[i+1]==1) - { - s_old[i+1]=0; - kk[i+1]++; - - watchdog_reset(); - } - - } - else if(s_old[i+1]==0) - s_old[i+1]=1; - - nn++; - if(nn>10000&&READ(Y_MIN_PIN)&&READ(X_MIN_PIN)) - { - nn=0; - break; - - } - - } - ///////////////////////////// - SERIAL_ERRORLNPGM("gcode_M1090 y"); - ///////////////////////////////////// y motor - nn=0; - i++; - - while(READ(Z_MIN_PIN)==0&&nn<20000) - { - //OUT_WRITE(X_DIR_PIN,1); - OUT_WRITE(Z_DIR_PIN,0); - - OUT_WRITE(Z_STEP_PIN,1); - delay_mcu(10); - OUT_WRITE(Z_STEP_PIN,0); - delay_mcu(10); - nn++; - - - } - nn=0; - - while(1) - { - - OUT_WRITE(Y_STEP_PIN,0); - delay_mcu(10); - OUT_WRITE(Y_STEP_PIN,1); - delay_mcu(10); - if(READ(Y_MIN_PIN)==0) - { - - OUT_WRITE(Y_DIR_PIN,0); - if(s_old[i]==1) - { - s_old[i]=0; - kk[i]++; - } - } - else if(s_old[i]==0) - s_old[i]=1; - - if(READ(Z_MIN_PIN)==0) - { - - OUT_WRITE(Y_DIR_PIN,1); - if(s_old[i+1]==1) - { - s_old[i+1]=0; - kk[i+1]++; - } - - } - else if(s_old[i+1]==0) - s_old[i+1]=1; - - nn++; - if(nn>10000&&READ(Y_MIN_PIN)&&READ(Z_MIN_PIN)) - { - nn=0; - break; - - } - - } - ///////////////////////////// - ///////////////////////////////////// Z motor - nn=0; - i++; - - while(1) - { - - OUT_WRITE(Z_STEP_PIN,0); - delay_mcu(10); - OUT_WRITE(Z_STEP_PIN,1); - delay_mcu(10); - if(READ(Z_MIN_PIN)==0) - { - - OUT_WRITE(Z_DIR_PIN,0); - if(s_old[i]==1) - { - s_old[i]=0; - kk[i]++; - } - } - else if(s_old[i]==0) - s_old[i]=1; - - if(READ(FIL_RUNOUT_PIN)==0) - { - - OUT_WRITE(Z_DIR_PIN,1); - if(s_old[i+1]==1) - { - s_old[i+1]=0; - kk[i+1]++; - } - - } - else if(s_old[i+1]==0) - s_old[i+1]=1; - - nn++; - if(nn>10000&&READ(FIL_RUNOUT_PIN)&&READ(Z_MIN_PIN)) - { - nn=0; - break; - - } - - } - ///////////////////////////// - - ///////////////////////////////////// e motor - nn=0; - i++; - - OUT_WRITE(E0_DIR_PIN,1); - OUT_WRITE(E1_DIR_PIN,1); - while(1) - { - - OUT_WRITE(E0_STEP_PIN,0); - OUT_WRITE(E1_STEP_PIN,0); - delay_mcu(10); - OUT_WRITE(E0_STEP_PIN,1); - OUT_WRITE(E1_STEP_PIN,1); - delay_mcu(10); - - nn++; - if(nn>5000) - { - nn=0; - break; - - } - - } - nn=0; - OUT_WRITE(E0_DIR_PIN,0); - OUT_WRITE(E1_DIR_PIN,0); - while(1) - { - - OUT_WRITE(E0_STEP_PIN,0); - OUT_WRITE(E1_STEP_PIN,0); - delay_mcu(10); - OUT_WRITE(E0_STEP_PIN,1); - OUT_WRITE(E1_STEP_PIN,1); - delay_mcu(10); - - nn++; - if(nn>5000) - { - nn=0; - break; - - } - - } - ///////////////////////////// - - if(kk[0]>2&&kk[1]>2&&kk[2]>2) - { - // OUT_WRITE(HEATER_BED_PIN,0); - // OUT_WRITE(HEATER_0_PIN,1); - OUT_WRITE(HEATER_1_PIN,1); - enqueue_and_echo_command("M104 T0 S129"); - enqueue_and_echo_command("M190 S50"); - - } - - //safe_delay(5000); -} - -inline void gcode_M109() { - - if (get_target_extruder_from_command(109)) return; - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(SINGLENOZZLE) - if (target_extruder != active_extruder) return; - #endif - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - const int16_t temp = parser.value_celsius(); - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Use half EXTRUDE_MINTEMP to allow nozzles to be put into hot - * standby mode, (e.g., in a dual extruder setup) without affecting - * the running print timer. - */ - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - lcd_reset_status(); - } - else - print_job_timer.start(); - #endif - - #if ENABLED(ULTRA_LCD) - const bool heating = thermalManager.isHeatingHotend(target_extruder); - if (heating || !no_wait_for_cooling) - #if HOTENDS > 1 - lcd_status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), target_extruder + 1); - #else - lcd_setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); - #endif - #endif - } - else return; - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif - - #if TEMP_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder)) - #endif - - float target_temp = -1, old_temp = 9999; - bool wants_to_cool = false; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = thermalManager.degHotend(target_extruder); - uint8_t old_blue = 0; - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != thermalManager.degTargetHotend(target_extruder)) { - wants_to_cool = thermalManager.isCoolingHotend(target_extruder); - target_temp = thermalManager.degTargetHotend(target_extruder); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting - next_temp_ms = now + 1000UL; - thermalManager.print_heaterstates(); - #if TEMP_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); - if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_PROTOCOLCHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - reset_stepper_timeout(); // Keep steppers powered - - const float temp = thermalManager.degHotend(target_extruder); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from violet to red as nozzle heats up - if (!wants_to_cool) { - const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0); - if (blue != old_blue) { - old_blue = blue; - leds.set_color( - MakeLEDColor(255, 0, blue, 0, pixels.getBrightness()) - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif - ); - } - } - #endif - - #if TEMP_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_WINDOW) residency_start_ms = now; - } - else if (temp_diff > TEMP_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif - - // Prevent a wait-forever situation if R is misused i.e. M109 R0 - if (wants_to_cool) { - // break after MIN_COOLING_SLOPE_TIME seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; - old_temp = temp; - } - } - - } while (wait_for_heatup && TEMP_CONDITIONS); - - if (wait_for_heatup) { - lcd_reset_status(); - #if ENABLED(PRINTER_EVENT_LEDS) - leds.set_white(); - #endif - } - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif -} - -#if HAS_HEATED_BED - - /** - * M140: Set bed temperature - */ - inline void gcode_M140() { - if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); - } - - #ifndef MIN_COOLING_SLOPE_DEG_BED - #define MIN_COOLING_SLOPE_DEG_BED 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME_BED - #define MIN_COOLING_SLOPE_TIME_BED 60 - #endif - - /** - * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating - * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling - */ - inline void gcode_M190() { - if (DEBUGGING(DRYRUN)) return; - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - thermalManager.setTargetBed(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if (parser.value_celsius() > BED_MINTEMP) - print_job_timer.start(); - #endif - } - else return; - - lcd_setstatusPGM(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); - - #if TEMP_BED_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed()) - #endif - - float target_temp = -1.0, old_temp = 9999.0; - bool wants_to_cool = false; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - target_extruder = active_extruder; // for print_heaterstates - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = thermalManager.degBed(); - uint8_t old_red = 127; - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != thermalManager.degTargetBed()) { - wants_to_cool = thermalManager.isCoolingBed(); - target_temp = thermalManager.degTargetBed(); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. - next_temp_ms = now + 1000UL; - thermalManager.print_heaterstates(); - #if TEMP_BED_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); - if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_PROTOCOLCHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - reset_stepper_timeout(); // Keep steppers powered - - const float temp = thermalManager.degBed(); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from blue to violet as bed heats up - if (!wants_to_cool) { - const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255); - if (red != old_red) { - old_red = red; - leds.set_color( - MakeLEDColor(red, 0, 255, 0, pixels.getBrightness()) - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif - ); - } - } - #endif - - #if TEMP_BED_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now; - } - else if (temp_diff > TEMP_BED_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif // TEMP_BED_RESIDENCY_TIME > 0 - - // Prevent a wait-forever situation if R is misused i.e. M190 R0 - if (wants_to_cool) { - // Break after MIN_COOLING_SLOPE_TIME_BED seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED; - old_temp = temp; - } - } - - } while (wait_for_heatup && TEMP_BED_CONDITIONS); - - if (wait_for_heatup) lcd_reset_status(); - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif - } - -#endif // HAS_HEATED_BED - -/** - * M110: Set Current Line Number - */ -inline void gcode_M110() { - if (parser.seenval('N')) gcode_LastN = parser.value_long(); -} - -/** - * M111: Set the debug level - */ -inline void gcode_M111() { - if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - - static const char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, - str_debug_2[] PROGMEM = MSG_DEBUG_INFO, - str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS, - str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN, - str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_32[] PROGMEM = MSG_DEBUG_LEVELING - #endif - ; - - static const char* const debug_strings[] PROGMEM = { - str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16 - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_32 - #endif - }; - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DEBUG_PREFIX); - if (marlin_debug_flags) { - uint8_t comma = 0; - for (uint8_t i = 0; i < COUNT(debug_strings); i++) { - if (TEST(marlin_debug_flags, i)) { - if (comma++) SERIAL_CHAR(','); - serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); - } - } - } - else { - SERIAL_ECHOPGM(MSG_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - SERIAL_ECHOPAIR("\nBuffer Overruns: ", customizedSerial.buffer_overruns()); - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - SERIAL_ECHOPAIR("\nFraming Errors: ", customizedSerial.framing_errors()); - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOPAIR("\nDropped bytes: ", customizedSerial.dropped()); - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOPAIR("\nMax RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif - #endif // !__AVR__ || !USBCON - } - SERIAL_EOL(); -} - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - - /** - * M113: Get or set Host Keepalive interval (0 to disable) - * - * S Optional. Set the keepalive interval. - */ - inline void gcode_M113() { - if (parser.seenval('S')) { - host_keepalive_interval = parser.value_byte(); - NOMORE(host_keepalive_interval, 60); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval); - } - } - -#endif - -#if ENABLED(BARICUDA) - - #if HAS_HEATER_1 - /** - * M126: Heater 1 valve open - */ - inline void gcode_M126() { baricuda_valve_pressure = parser.byteval('S', 255); } - /** - * M127: Heater 1 valve close - */ - inline void gcode_M127() { baricuda_valve_pressure = 0; } - #endif - - #if HAS_HEATER_2 - /** - * M128: Heater 2 valve open - */ - inline void gcode_M128() { baricuda_e_to_p_pressure = parser.byteval('S', 255); } - /** - * M129: Heater 2 valve close - */ - inline void gcode_M129() { baricuda_e_to_p_pressure = 0; } - #endif - -#endif // BARICUDA - -#if ENABLED(ULTIPANEL) - - /** - * M145: Set the heatup state for a material in the LCD menu - * - * S (0=PLA, 1=ABS) - * H - * B - * F - */ - inline void gcode_M145() { - const uint8_t material = (uint8_t)parser.intval('S'); - if (material >= COUNT(lcd_preheat_hotend_temp)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX); - } - else { - int v; - if (parser.seenval('H')) { - v = parser.value_int(); - lcd_preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); - } - if (parser.seenval('F')) { - v = parser.value_int(); - lcd_preheat_fan_speed[material] = constrain(v, 0, 255); - } - #if TEMP_SENSOR_BED != 0 - if (parser.seenval('B')) { - v = parser.value_int(); - lcd_preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); - } - #endif - } - } - -#endif // ULTIPANEL - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - /** - * M149: Set temperature units - */ - inline void gcode_M149() { - if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C); - else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K); - else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F); - } -#endif - -#if HAS_POWER_SWITCH - - /** - * M80 : Turn on the Power Supply - * M80 S : Report the current state and exit - */ - inline void gcode_M80() { - - // S: Report the current power supply state and exit - if (parser.seen('S')) { - serialprintPGM(powersupply_on ? PSTR("PS:1\n") : PSTR("PS:0\n")); - return; - } - - PSU_ON(); - - /** - * If you have a switch on suicide pin, this is useful - * if you want to start another print with suicide feature after - * a print without suicide... - */ - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); - #endif - - #if DISABLED(AUTO_POWER_CONTROL) - delay(100); // Wait for power to settle - restore_stepper_drivers(); - #endif - - #if ENABLED(ULTIPANEL) - lcd_reset_status(); - #endif - } - -#endif // HAS_POWER_SWITCH - -/** - * M81: Turn off Power, including Power Supply, if there is one. - * - * This code should ALWAYS be available for EMERGENCY SHUTDOWN! - */ -inline void gcode_M81() { - thermalManager.disable_all_heaters(); - planner.finish_and_disable(); - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #if ENABLED(PROBING_FANS_OFF) - fans_paused = false; - ZERO(paused_fanSpeeds); - #endif - #endif - - safe_delay(1000); // Wait 1 second before switching off - - #if HAS_SUICIDE - suicide(); - #elif HAS_POWER_SWITCH - PSU_OFF(); - #endif - - #if ENABLED(ULTIPANEL) - LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); - #endif -} - -/** - * M82: Set E codes absolute (default) - */ -inline void gcode_M82() { axis_relative_modes[E_AXIS] = false; } - -/** - * M83: Set E codes relative while in Absolute Coordinates (G90) mode - */ -inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; } - -/** - * M18, M84: Disable stepper motors - */ -inline void gcode_M18_M84() { - if (parser.seenval('S')) { - stepper_inactive_time = parser.value_millis_from_seconds(); - } - else { - bool all_axis = !(parser.seen('X') || parser.seen('Y') || parser.seen('Z') || parser.seen('E')); - if (all_axis) { - planner.finish_and_disable(); - } - else { - planner.synchronize(); - if (parser.seen('X')) disable_X(); - if (parser.seen('Y')) disable_Y(); - if (parser.seen('Z')) disable_Z(); - #if E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN // Only disable on boards that have separate ENABLE_PINS - if (parser.seen('E')) disable_e_steppers(); - #endif - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; - #endif - } -} - -/** - * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default) - */ -inline void gcode_M85() { - if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds(); -} - -/** - * Multi-stepper support for M92, M201, M203 - */ -#if ENABLED(DISTINCT_E_FACTORS) - #define GET_TARGET_EXTRUDER(CMD) if (get_target_extruder_from_command(CMD)) return - #define TARGET_EXTRUDER target_extruder -#else - #define GET_TARGET_EXTRUDER(CMD) NOOP - #define TARGET_EXTRUDER 0 -#endif - -/** - * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E. - * (Follows the same syntax as G92) - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M92() { - - GET_TARGET_EXTRUDER(92); - - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) { - if (i == E_AXIS) { - const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); - if (value < 20) { - float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. - #if DISABLED(JUNCTION_DEVIATION) - planner.max_jerk[E_AXIS] *= factor; - #endif - planner.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor; - planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor; - } - planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value; - } - else { - planner.axis_steps_per_mm[i] = parser.value_per_axis_unit((AxisEnum)i); - } - } - } - planner.refresh_positioning(); -} - -/** - * Output the current position to serial - */ -void report_current_position() { - SERIAL_PROTOCOLPGM("X:"); - SERIAL_PROTOCOL(LOGICAL_X_POSITION(current_position[X_AXIS])); - SERIAL_PROTOCOLPGM(" Y:"); - SERIAL_PROTOCOL(LOGICAL_Y_POSITION(current_position[Y_AXIS])); - SERIAL_PROTOCOLPGM(" Z:"); - SERIAL_PROTOCOL(LOGICAL_Z_POSITION(current_position[Z_AXIS])); - SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL(current_position[E_AXIS]); - - stepper.report_positions(); - - #if IS_SCARA - SERIAL_PROTOCOLPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS)); - SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); - SERIAL_EOL(); - #endif -} - -#ifdef M114_DETAIL - - 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++) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); - SERIAL_CHAR(':'); - SERIAL_PROTOCOL(dtostrf(pos[i], 8, precision, str)); - } - SERIAL_EOL(); - } - - inline void report_xyz(const float pos[]) { report_xyze(pos, 3); } - - void report_current_position_detail() { - - SERIAL_PROTOCOLPGM("\nLogical:"); - const float logical[XYZ] = { - LOGICAL_X_POSITION(current_position[X_AXIS]), - LOGICAL_Y_POSITION(current_position[Y_AXIS]), - LOGICAL_Z_POSITION(current_position[Z_AXIS]) - }; - report_xyz(logical); - - SERIAL_PROTOCOLPGM("Raw: "); - report_xyz(current_position); - - float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - #if PLANNER_LEVELING - SERIAL_PROTOCOLPGM("Leveled:"); - planner.apply_leveling(leveled); - report_xyz(leveled); - - SERIAL_PROTOCOLPGM("UnLevel:"); - float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; - planner.unapply_leveling(unleveled); - report_xyz(unleveled); - #endif - - #if IS_KINEMATIC - #if IS_SCARA - SERIAL_PROTOCOLPGM("ScaraK: "); - #else - SERIAL_PROTOCOLPGM("DeltaK: "); - #endif - inverse_kinematics(leveled); // writes delta[] - report_xyz(delta); - #endif - - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Stepper:"); - LOOP_XYZE(i) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); - SERIAL_CHAR(':'); - SERIAL_PROTOCOL(stepper.position((AxisEnum)i)); - } - SERIAL_EOL(); - - #if IS_SCARA - const float deg[XYZ] = { - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - }; - SERIAL_PROTOCOLPGM("Degrees:"); - report_xyze(deg, 2); - #endif - - SERIAL_PROTOCOLPGM("FromStp:"); - get_cartesian_from_steppers(); // writes cartes[XYZ] (with forward kinematics) - const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], planner.get_axis_position_mm(E_AXIS) }; - report_xyze(from_steppers); - - const float diff[XYZE] = { - from_steppers[X_AXIS] - leveled[X_AXIS], - from_steppers[Y_AXIS] - leveled[Y_AXIS], - from_steppers[Z_AXIS] - leveled[Z_AXIS], - from_steppers[E_AXIS] - current_position[E_AXIS] - }; - SERIAL_PROTOCOLPGM("Differ: "); - report_xyze(diff); - } -#endif // M114_DETAIL - -/** - * M114: Report current position to host - */ -inline void gcode_M114() { - - #ifdef M114_DETAIL - if (parser.seen('D')) { - report_current_position_detail(); - return; - } - #endif - - planner.synchronize(); - report_current_position(); -} - -/** - * M115: Capabilities string - */ - -#if ENABLED(EXTENDED_CAPABILITIES_REPORT) - static void cap_line(const char * const name, bool ena=false) { - SERIAL_PROTOCOLPGM("Cap:"); - serialprintPGM(name); - SERIAL_PROTOCOLPGM(":"); - SERIAL_PROTOCOLLN(int(ena ? 1 : 0)); - } -#endif - -inline void gcode_M115() { - SERIAL_PROTOCOLLNPGM(MSG_M115_REPORT); - - #if ENABLED(EXTENDED_CAPABILITIES_REPORT) - - // SERIAL_XON_XOFF - cap_line(PSTR("SERIAL_XON_XOFF") - #if ENABLED(SERIAL_XON_XOFF) - , true - #endif - ); - - // EEPROM (M500, M501) - cap_line(PSTR("EEPROM") - #if ENABLED(EEPROM_SETTINGS) - , true - #endif - ); - - // Volumetric Extrusion (M200) - cap_line(PSTR("VOLUMETRIC") - #if DISABLED(NO_VOLUMETRICS) - , true - #endif - ); - - // AUTOREPORT_TEMP (M155) - cap_line(PSTR("AUTOREPORT_TEMP") - #if ENABLED(AUTO_REPORT_TEMPERATURES) - , true - #endif - ); - - // PROGRESS (M530 S L, M531 , M532 X L) - cap_line(PSTR("PROGRESS")); - - // Print Job timer M75, M76, M77 - cap_line(PSTR("PRINT_JOB"), true); - - // AUTOLEVEL (G29) - cap_line(PSTR("AUTOLEVEL") - #if HAS_AUTOLEVEL - , true - #endif - ); - - // Z_PROBE (G30) - cap_line(PSTR("Z_PROBE") - #if HAS_BED_PROBE - , true - #endif - ); - - // MESH_REPORT (M420 V) - cap_line(PSTR("LEVELING_DATA") - #if HAS_LEVELING - , true - #endif - ); - - // BUILD_PERCENT (M73) - cap_line(PSTR("BUILD_PERCENT") - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - , true - #endif - ); - - // SOFTWARE_POWER (M80, M81) - cap_line(PSTR("SOFTWARE_POWER") - #if HAS_POWER_SWITCH - , true - #endif - ); - - // CASE LIGHTS (M355) - cap_line(PSTR("TOGGLE_LIGHTS") - #if HAS_CASE_LIGHT - , true - #endif - ); - cap_line(PSTR("CASE_LIGHT_BRIGHTNESS") - #if HAS_CASE_LIGHT - , USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN) - #endif - ); - - // EMERGENCY_PARSER (M108, M112, M410) - cap_line(PSTR("EMERGENCY_PARSER") - #if ENABLED(EMERGENCY_PARSER) - , true - #endif - ); - - // AUTOREPORT_SD_STATUS (M27 extension) - cap_line(PSTR("AUTOREPORT_SD_STATUS") - #if ENABLED(AUTO_REPORT_SD_STATUS) - , true - #endif - ); - - // THERMAL_PROTECTION - cap_line(PSTR("THERMAL_PROTECTION") - #if ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(THERMAL_PROTECTION_BED) - , true - #endif - ); - - #endif // EXTENDED_CAPABILITIES_REPORT -} - -/** - * M117: Set LCD Status Message - */ -inline void gcode_M117() { - if (parser.string_arg[0]) - lcd_setstatus(parser.string_arg); - else - lcd_reset_status(); -} - -/** - * M118: Display a message in the host console. - * - * A1 Prepend '// ' for an action command, as in OctoPrint - * E1 Have the host 'echo:' the text - */ -inline void gcode_M118() { - bool hasE = false, hasA = false; - 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; - } - if (hasE) SERIAL_ECHO_START(); - if (hasA) SERIAL_ECHOPGM("// "); - SERIAL_ECHOLN(p); -} - -/** - * M119: Output endstop states to serial output - */ -inline void gcode_M119() { endstops.M119(); } - -/** - * M120: Enable endstops and set non-homing endstop state to "enabled" - */ -inline void gcode_M120() { endstops.enable_globally(true); } - -/** - * M121: Disable endstops and set non-homing endstop state to "disabled" - */ -inline void gcode_M121() { endstops.enable_globally(false); } - -#if ENABLED(PARK_HEAD_ON_PAUSE) - - /** - * M125: Store current position and move to filament change position. - * Called on pause (by M25) to prevent material leaking onto the - * object. On resume (M24) the head will be moved back and the - * print will resume. - * - * If Marlin is compiled without SD Card support, M125 can be - * used directly to pause the print and move to park position, - * resuming with a button click or M108. - * - * L = override retract length - * X = override X - * Y = override Y - * Z = override Z raise - */ - inline void gcode_M125() { - - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - point_t park_point = NOZZLE_PARK_POINT; - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) - park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); - park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); - #endif - - #if DISABLED(SDSUPPORT) - const bool job_running = print_job_timer.isRunning(); - #endif - - if (pause_print(retract, park_point)) { - #if DISABLED(SDSUPPORT) - // Wait for lcd click or M108 - wait_for_filament_reload(); - - // Return to print position and continue - resume_print(); - - if (job_running) print_job_timer.start(); - #endif - } - } - -#endif // PARK_HEAD_ON_PAUSE - -#if HAS_COLOR_LEDS - - /** - * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W - * and Brightness - Use P (for NEOPIXEL only) - * - * Always sets all 3 or 4 components. If a component is left out, set to 0. - * If brightness is left out, no value changed - * - * Examples: - * - * M150 R255 ; Turn LED red - * M150 R255 U127 ; Turn LED orange (PWM only) - * M150 ; Turn LED off - * M150 R U B ; Turn LED white - * M150 W ; Turn LED white using a white LED - * M150 P127 ; Set LED 50% brightness - * M150 P ; Set LED full brightness - */ - inline void gcode_M150() { - leds.set_color(MakeLEDColor( - parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness() - )); - } - -#endif // HAS_COLOR_LEDS - -#if DISABLED(NO_VOLUMETRICS) - - /** - * M200: Set filament diameter and set E axis units to cubic units - * - * T - Optional extruder number. Current extruder if omitted. - * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. - */ - inline void gcode_M200() { - - if (get_target_extruder_from_command(200)) return; - - if (parser.seen('D')) { - // setting any extruder filament size disables volumetric on the assumption that - // slicers either generate in extruder values as cubic mm or as as filament feeds - // for all extruders - if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0)) ) - planner.set_filament_size(target_extruder, parser.value_linear_units()); - } - planner.calculate_volumetric_multipliers(); - } - -#endif // !NO_VOLUMETRICS - -/** - * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M201() { - - GET_TARGET_EXTRUDER(201); - - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); - planner.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a); - } - } - // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) - planner.reset_acceleration_rates(); -} - -#if 0 // Not used for Sprinter/grbl gen6 - inline void gcode_M202() { - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = parser.value_axis_units((AxisEnum)i) * planner.axis_steps_per_mm[i]; - } - } -#endif - - -/** - * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec - * - * With multiple extruders use T to specify which one. - */ -inline void gcode_M203() { - - GET_TARGET_EXTRUDER(203); - - LOOP_XYZE(i) - if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); - planner.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a); - } -} - -/** - * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) - * - * P = Printing moves - * R = Retract only (no X, Y, Z) moves - * T = Travel (non printing) moves - */ -inline void gcode_M204() { - bool report = true; - if (parser.seenval('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. - planner.travel_acceleration = planner.acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('P')) { - planner.acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('R')) { - planner.retract_acceleration = parser.value_linear_units(); - report = false; - } - if (parser.seenval('T')) { - planner.travel_acceleration = parser.value_linear_units(); - report = false; - } - if (report) { - SERIAL_ECHOPAIR("Acceleration: P", planner.acceleration); - SERIAL_ECHOPAIR(" R", planner.retract_acceleration); - SERIAL_ECHOLNPAIR(" T", planner.travel_acceleration); - } -} - -/** - * M205: Set Advanced Settings - * - * B = Min Segment Time (µs) - * S = Min Feed Rate (units/s) - * T = Min Travel Feed Rate (units/s) - * X = Max X Jerk (units/sec^2) - * Y = Max Y Jerk (units/sec^2) - * Z = Max Z Jerk (units/sec^2) - * E = Max E Jerk (units/sec^2) - * J = Junction Deviation (mm) (Requires JUNCTION_DEVIATION) - */ -inline void gcode_M205() { - if (parser.seen('B')) planner.min_segment_time_us = parser.value_ulong(); - if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units(); - if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units(); - #if ENABLED(JUNCTION_DEVIATION) - if (parser.seen('J')) { - const float junc_dev = parser.value_linear_units(); - if (WITHIN(junc_dev, 0.01f, 0.3f)) { - planner.junction_deviation_mm = junc_dev; - planner.recalculate_max_e_jerk(); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)"); - } - } - #else - if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units(); - if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units(); - if (parser.seen('Z')) { - planner.max_jerk[Z_AXIS] = parser.value_linear_units(); - #if HAS_MESH - if (planner.max_jerk[Z_AXIS] <= 0.1f) - SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); - #endif - } - if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); - #endif -} - -#if HAS_M206_COMMAND - - /** - * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y - * - * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665. - * *** M206 for SCARA will remain enabled in 1.1.x for compatibility. - * *** In the next 1.2 release, it will simply be disabled by default. - */ - inline void gcode_M206() { - LOOP_XYZ(i) - if (parser.seen(axis_codes[i])) - set_home_offset((AxisEnum)i, parser.value_linear_units()); - - #if ENABLED(MORGAN_SCARA) - if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta - if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi - #endif - - report_current_position(); - } - -#endif // HAS_M206_COMMAND - -#if ENABLED(DELTA) - /** - * M665: Set delta configurations - * - * H = delta height - * L = diagonal rod - * R = delta radius - * S = segments per second - * B = delta calibration radius - * X = Alpha (Tower 1) angle trim - * Y = Beta (Tower 2) angle trim - * Z = Gamma (Tower 3) angle trim - */ - inline void gcode_M665() { - if (parser.seen('H')) delta_height = parser.value_linear_units(); - if (parser.seen('L')) delta_diagonal_rod = parser.value_linear_units(); - if (parser.seen('R')) delta_radius = parser.value_linear_units(); - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - if (parser.seen('B')) delta_calibration_radius = parser.value_float(); - if (parser.seen('X')) delta_tower_angle_trim[A_AXIS] = parser.value_float(); - if (parser.seen('Y')) delta_tower_angle_trim[B_AXIS] = parser.value_float(); - if (parser.seen('Z')) delta_tower_angle_trim[C_AXIS] = parser.value_float(); - recalc_delta_settings(); - } - /** - * M666: Set delta endstop adjustment - */ - inline void gcode_M666() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> gcode_M666"); - } - #endif - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { - if (parser.value_linear_units() * Z_HOME_DIR <= 0) - delta_endstop_adj[i] = parser.value_linear_units(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("delta_endstop_adj[", axis_codes[i]); - SERIAL_ECHOLNPAIR("] = ", delta_endstop_adj[i]); - } - #endif - } - } - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("<<< gcode_M666"); - } - #endif - } - -#elif IS_SCARA - - /** - * M665: Set SCARA settings - * - * Parameters: - * - * S[segments-per-second] - Segments-per-second - * P[theta-psi-offset] - Theta-Psi offset, added to the shoulder (A/X) angle - * T[theta-offset] - Theta offset, added to the elbow (B/Y) angle - * - * A, P, and X are all aliases for the shoulder angle - * B, T, and Y are all aliases for the elbow angle - */ - inline void gcode_M665() { - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - - const bool hasA = parser.seen('A'), hasP = parser.seen('P'), hasX = parser.seen('X'); - const uint8_t sumAPX = hasA + hasP + hasX; - if (sumAPX == 1) - home_offset[A_AXIS] = parser.value_float(); - else if (sumAPX > 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of A, P, or X is allowed."); - return; - } - - const bool hasB = parser.seen('B'), hasT = parser.seen('T'), hasY = parser.seen('Y'); - const uint8_t sumBTY = hasB + hasT + hasY; - if (sumBTY == 1) - home_offset[B_AXIS] = parser.value_float(); - else if (sumBTY > 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of B, T, or Y is allowed."); - return; - } - } - -#elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - /** - * M666: Set Dual Endstops offsets for X, Y, and/or Z. - * With no parameters report current offsets. - */ - inline void gcode_M666() { - bool report = true; - #if ENABLED(X_DUAL_ENDSTOPS) - if (parser.seenval('X')) { - endstops.x_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (parser.seenval('Y')) { - endstops.y_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (parser.seenval('Z')) { - endstops.z_endstop_adj = parser.value_linear_units(); - report = false; - } - #endif - if (report) { - SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj); - #endif - SERIAL_EOL(); - } - } - -#endif // X_DUAL_ENDSTOPS || Y_DUAL_ENDSTOPS || Z_DUAL_ENDSTOPS - -#if ENABLED(FWRETRACT) - - /** - * M207: Set firmware retraction values - * - * S[+units] retract_length - * W[+units] swap_retract_length (multi-extruder) - * F[units/min] retract_feedrate_mm_s - * Z[units] retract_zlift - */ - inline void gcode_M207() { - if (parser.seen('S')) fwretract.retract_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('Z')) fwretract.retract_zlift = parser.value_linear_units(); - if (parser.seen('W')) fwretract.swap_retract_length = parser.value_axis_units(E_AXIS); - } - - /** - * M208: Set firmware un-retraction values - * - * S[+units] retract_recover_length (in addition to M207 S*) - * W[+units] swap_retract_recover_length (multi-extruder) - * F[units/min] retract_recover_feedrate_mm_s - * R[units/min] swap_retract_recover_feedrate_mm_s - */ - inline void gcode_M208() { - if (parser.seen('S')) fwretract.retract_recover_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('R')) fwretract.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('W')) fwretract.swap_retract_recover_length = parser.value_axis_units(E_AXIS); - } - - /** - * M209: Enable automatic retract (M209 S1) - * For slicers that don't support G10/11, reversed extrude-only - * moves will be classified as retraction. - */ - inline void gcode_M209() { - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - if (parser.seen('S')) { - fwretract.autoretract_enabled = parser.value_bool(); - for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false; - } - } - } - -#endif // FWRETRACT - -/** - * M211: Enable, Disable, and/or Report software endstops - * - * Usage: M211 S1 to enable, M211 S0 to disable, M211 alone for report - */ -inline void gcode_M211() { - SERIAL_ECHO_START(); - #if HAS_SOFTWARE_ENDSTOPS - if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - serialprintPGM(soft_endstops_enabled ? PSTR(MSG_ON) : PSTR(MSG_OFF)); - #else - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - SERIAL_ECHOPGM(MSG_OFF); - #endif - SERIAL_ECHOPGM(MSG_SOFT_MIN); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop_min[X_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop_min[Y_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop_min[Z_AXIS])); - SERIAL_ECHOPGM(MSG_SOFT_MAX); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop_max[X_AXIS])); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop_max[Y_AXIS])); - SERIAL_ECHOLNPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop_max[Z_AXIS])); -} - -#if HOTENDS > 1 - - /** - * M218 - Set/get hotend offset (in linear units) - * - * T - * X - * Y - * Z - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE, and PARKING_EXTRUDER - */ - inline void gcode_M218() { - if (get_target_extruder_from_command(218) || target_extruder == 0) return; - - bool report = true; - if (parser.seenval('X')) { - hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - if (parser.seenval('Y')) { - hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - - #if HAS_HOTEND_OFFSET_Z - if (parser.seenval('Z')) { - hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); - report = false; - } - #endif - - if (report) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - HOTEND_LOOP() { - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][e]); - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][e]); - #if HAS_HOTEND_OFFSET_Z - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Z_AXIS][e]); - #endif - } - SERIAL_EOL(); - } - - #if ENABLED(DELTA) - if (target_extruder == active_extruder) - do_blocking_move_to_xy(current_position[X_AXIS], current_position[Y_AXIS], planner.max_feedrate_mm_s[X_AXIS]); - #endif - } - -#endif // HOTENDS > 1 - -/** - * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) - */ -inline void gcode_M220() { - if (parser.seenval('S')) feedrate_percentage = parser.value_int(); -} - -/** - * M221: Set extrusion percentage (M221 T0 S95) - */ -inline void gcode_M221() { - if (get_target_extruder_from_command(221)) return; - if (parser.seenval('S')) { - planner.flow_percentage[target_extruder] = parser.value_int(); - planner.refresh_e_factor(target_extruder); - } - else { - SERIAL_ECHO_START(); - SERIAL_CHAR('E'); - SERIAL_CHAR('0' + target_extruder); - SERIAL_ECHOPAIR(" Flow: ", planner.flow_percentage[target_extruder]); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } -} - -/** - * M226: Wait until the specified pin reaches the state required (M226 P S) - */ -inline void gcode_M226() { - if (parser.seen('P')) { - const int pin = parser.value_int(), pin_state = parser.intval('S', -1); - if (WITHIN(pin_state, -1, 1) && pin > -1) { - if (pin_is_protected(pin)) - protected_pin_err(); - else { - int target = LOW; - planner.synchronize(); - pinMode(pin, INPUT); - switch (pin_state) { - case 1: target = HIGH; break; - case 0: target = LOW; break; - case -1: target = !digitalRead(pin); break; - } - while (digitalRead(pin) != target) idle(); - } - } // pin_state -1 0 1 && pin > -1 - } // parser.seen('P') -} - -#if ENABLED(EXPERIMENTAL_I2CBUS) - - /** - * M260: Send data to a I2C slave device - * - * This is a PoC, the formating and arguments for the GCODE will - * change to be more compatible, the current proposal is: - * - * M260 A ; Sets the I2C slave address the data will be sent to - * - * M260 B - * M260 B - * M260 B - * - * M260 S1 ; Send the buffered data and reset the buffer - * M260 R1 ; Reset the buffer without sending data - * - */ - inline void gcode_M260() { - // Set the target address - if (parser.seen('A')) i2c.address(parser.value_byte()); - - // Add a new byte to the buffer - if (parser.seen('B')) i2c.addbyte(parser.value_byte()); - - // Flush the buffer to the bus - if (parser.seen('S')) i2c.send(); - - // Reset and rewind the buffer - else if (parser.seen('R')) i2c.reset(); - } - - /** - * M261: Request X bytes from I2C slave device - * - * Usage: M261 A B - */ - inline void gcode_M261() { - if (parser.seen('A')) i2c.address(parser.value_byte()); - - uint8_t bytes = parser.byteval('B', 1); - - if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) { - i2c.relay(bytes); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad i2c request"); - } - } - -#endif // EXPERIMENTAL_I2CBUS - -#if HAS_SERVOS - - /** - * M280: Get or set servo position. P [S] - */ - inline void gcode_M280() { - if (!parser.seen('P')) return; - const int servo_index = parser.value_int(); - if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) { - if (parser.seen('S')) - MOVE_SERVO(servo_index, parser.value_int()); - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOLNPAIR(": ", servo[servo_index].read()); - } - } - else { - SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); - } - } - -#endif // HAS_SERVOS - -#if ENABLED(BABYSTEPPING) - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - FORCE_INLINE void mod_zprobe_zoffset(const float &offs) { - zprobe_zoffset += offs; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); - } - #endif - - /** - * M290: Babystepping - */ - inline void gcode_M290() { - #if ENABLED(BABYSTEP_XY) - for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) - if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) { - const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2); - thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_zprobe_zoffset(offs); - #endif - } - #else - if (parser.seenval('Z') || parser.seenval('S')) { - const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2); - thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (!parser.seen('P') || parser.value_bool()) mod_zprobe_zoffset(offs); - #endif - } - #endif - } - -#endif // BABYSTEPPING - -#if HAS_BUZZER - - /** - * M300: Play beep sound S P - */ - inline void gcode_M300() { - uint16_t const frequency = parser.ushortval('S', 260); - uint16_t duration = parser.ushortval('P', 1000); - - // Limits the tone duration to 0-5 seconds. - NOMORE(duration, 5000); - - BUZZ(duration, frequency); - } - -#endif // HAS_BUZZER - -#if ENABLED(PIDTEMP) - - /** - * M301: Set PID parameters P I D (and optionally C, L) - * - * P[float] Kp term - * I[float] Ki term (unscaled) - * D[float] Kd term (unscaled) - * - * With PID_EXTRUSION_SCALING: - * - * C[float] Kc term - * L[int] LPQ length - */ - inline void gcode_M301() { - - // multi-extruder PID patch: M301 updates or prints a single extruder's PID values - // default behaviour (omitting E parameter) is to update for extruder 0 only - const uint8_t e = parser.byteval('E'); // extruder being updated - - if (e < HOTENDS) { // catch bad input value - if (parser.seen('P')) PID_PARAM(Kp, e) = parser.value_float(); - if (parser.seen('I')) PID_PARAM(Ki, e) = scalePID_i(parser.value_float()); - if (parser.seen('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float()); - #if ENABLED(PID_EXTRUSION_SCALING) - if (parser.seen('C')) PID_PARAM(Kc, e) = parser.value_float(); - if (parser.seen('L')) thermalManager.lpq_len = parser.value_float(); - NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN); - NOLESS(thermalManager.lpq_len, 0); - #endif - - thermalManager.updatePID(); - SERIAL_ECHO_START(); - #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))); - #if ENABLED(PID_EXTRUSION_SCALING) - //Kc does not have scaling applied above, or in resetting defaults - SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); - #endif - SERIAL_EOL(); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER); - } - } - -#endif // PIDTEMP - -#if ENABLED(PIDTEMPBED) - - inline void gcode_M304() { - if (parser.seen('P')) thermalManager.bedKp = parser.value_float(); - if (parser.seen('I')) thermalManager.bedKi = scalePID_i(parser.value_float()); - if (parser.seen('D')) thermalManager.bedKd = scalePID_d(parser.value_float()); - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" p:", thermalManager.bedKp); - SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.bedKi)); - SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.bedKd)); - } - -#endif // PIDTEMPBED - -#if defined(CHDK) || HAS_PHOTOGRAPH - - /** - * M240: Trigger a camera by emulating a Canon RC-1 - * See http://www.doc-diy.net/photo/rc-1_hacked/ - */ - inline void gcode_M240() { - #ifdef CHDK - - OUT_WRITE(CHDK, HIGH); - chdkHigh = millis(); - chdkActive = true; - - #elif HAS_PHOTOGRAPH - - const uint8_t NUM_PULSES = 16; - const float PULSE_LENGTH = 0.01524; - for (int i = 0; i < NUM_PULSES; i++) { - WRITE(PHOTOGRAPH_PIN, HIGH); - _delay_ms(PULSE_LENGTH); - WRITE(PHOTOGRAPH_PIN, LOW); - _delay_ms(PULSE_LENGTH); - } - delay(7.33); - for (int i = 0; i < NUM_PULSES; i++) { - WRITE(PHOTOGRAPH_PIN, HIGH); - _delay_ms(PULSE_LENGTH); - WRITE(PHOTOGRAPH_PIN, LOW); - _delay_ms(PULSE_LENGTH); - } - - #endif // !CHDK && HAS_PHOTOGRAPH - } - -#endif // CHDK || PHOTOGRAPH_PIN - -#if HAS_LCD_CONTRAST - - /** - * M250: Read and optionally set the LCD contrast - */ - inline void gcode_M250() { - if (parser.seen('C')) set_lcd_contrast(parser.value_int()); - SERIAL_PROTOCOLPGM("lcd contrast value: "); - SERIAL_PROTOCOL(lcd_contrast); - SERIAL_EOL(); - } - -#endif // HAS_LCD_CONTRAST - -#if ENABLED(PREVENT_COLD_EXTRUSION) - - /** - * M302: Allow cold extrudes, or set the minimum extrude temperature - * - * S sets the minimum extrude temperature - * P enables (1) or disables (0) cold extrusion - * - * Examples: - * - * M302 ; report current cold extrusion state - * M302 P0 ; enable cold extrusion checking - * M302 P1 ; disables cold extrusion checking - * M302 S0 ; always allow extrusion (disables checking) - * M302 S170 ; only allow extrusion above 170 - * M302 S170 P1 ; set min extrude temp to 170 but leave disabled - */ - inline void gcode_M302() { - const bool seen_S = parser.seen('S'); - if (seen_S) { - thermalManager.extrude_min_temp = parser.value_celsius(); - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); - } - - if (parser.seen('P')) - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); - else if (!seen_S) { - // Report current state - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis")); - SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp); - SERIAL_ECHOLNPGM("C)"); - } - } - -#endif // PREVENT_COLD_EXTRUSION - -/** - * M303: PID relay autotune - * - * S sets the target temperature. (default 150C / 70C) - * E (-1 for the bed) (default 0) - * C - * U with a non-zero value will apply the result to current settings - */ -inline void gcode_M303() { - #if HAS_PID_HEATING - const int e = parser.intval('E'), c = parser.intval('C', 5); - const bool u = parser.boolval('U'); - - int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150); - - if (WITHIN(e, 0, HOTENDS - 1)) - target_extruder = e; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - thermalManager.PID_autotune(temp, e, c, u); - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); - #endif - #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED); - #endif -} - -#if ENABLED(MORGAN_SCARA) - - bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) { - if (IsRunning()) { - forward_kinematics_SCARA(delta_a, delta_b); - destination[X_AXIS] = cartes[X_AXIS]; - destination[Y_AXIS] = cartes[Y_AXIS]; - destination[Z_AXIS] = current_position[Z_AXIS]; - prepare_move_to_destination(); - return true; - } - return false; - } - - /** - * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - */ - inline bool gcode_M360() { - SERIAL_ECHOLNPGM(" Cal: Theta 0"); - return SCARA_move_to_cal(0, 120); - } - - /** - * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - */ - inline bool gcode_M361() { - SERIAL_ECHOLNPGM(" Cal: Theta 90"); - return SCARA_move_to_cal(90, 130); - } - - /** - * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) - */ - inline bool gcode_M362() { - SERIAL_ECHOLNPGM(" Cal: Psi 0"); - return SCARA_move_to_cal(60, 180); - } - - /** - * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - */ - inline bool gcode_M363() { - SERIAL_ECHOLNPGM(" Cal: Psi 90"); - return SCARA_move_to_cal(50, 90); - } - - /** - * M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position) - */ - inline bool gcode_M364() { - SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90"); - return SCARA_move_to_cal(45, 135); - } - -#endif // SCARA - -#if ENABLED(EXT_SOLENOID) - - void enable_solenoid(const uint8_t num) { - switch (num) { - case 0: - OUT_WRITE(SOL0_PIN, HIGH); - break; - #if HAS_SOLENOID_1 && EXTRUDERS > 1 - case 1: - OUT_WRITE(SOL1_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_2 && EXTRUDERS > 2 - case 2: - OUT_WRITE(SOL2_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_3 && EXTRUDERS > 3 - case 3: - OUT_WRITE(SOL3_PIN, HIGH); - break; - #endif - #if HAS_SOLENOID_4 && EXTRUDERS > 4 - case 4: - OUT_WRITE(SOL4_PIN, HIGH); - break; - #endif - default: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID); - break; - } - } - - void enable_solenoid_on_active_extruder() { enable_solenoid(active_extruder); } - - void disable_all_solenoids() { - OUT_WRITE(SOL0_PIN, LOW); - #if HAS_SOLENOID_1 && EXTRUDERS > 1 - OUT_WRITE(SOL1_PIN, LOW); - #endif - #if HAS_SOLENOID_2 && EXTRUDERS > 2 - OUT_WRITE(SOL2_PIN, LOW); - #endif - #if HAS_SOLENOID_3 && EXTRUDERS > 3 - OUT_WRITE(SOL3_PIN, LOW); - #endif - #if HAS_SOLENOID_4 && EXTRUDERS > 4 - OUT_WRITE(SOL4_PIN, LOW); - #endif - } - - /** - * M380: Enable solenoid on the active extruder - */ - inline void gcode_M380() { enable_solenoid_on_active_extruder(); } - - /** - * M381: Disable all solenoids - */ - inline void gcode_M381() { disable_all_solenoids(); } - -#endif // EXT_SOLENOID - -/** - * M400: Finish all moves - */ -inline void gcode_M400() { planner.synchronize(); } - -#if HAS_BED_PROBE - - /** - * M401: Deploy and activate the Z probe - */ - inline void gcode_M401() { - DEPLOY_PROBE(); - report_current_position(); - } - - /** - * M402: Deactivate and stow the Z probe - */ - inline void gcode_M402() { - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - report_current_position(); - } - -#endif // HAS_BED_PROBE - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - /** - * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> - */ - inline void gcode_M404() { - if (parser.seen('W')) { - filament_width_nominal = parser.value_linear_units(); - planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5); - } - else { - SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); - SERIAL_PROTOCOLLN(filament_width_nominal); - } - } - - /** - * M405: Turn on filament sensor for control - */ - inline void gcode_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 (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; - } - - /** - * M406: Turn off filament sensor for control - */ - inline void gcode_M406() { - filament_sensor = false; - planner.calculate_volumetric_multipliers(); // Restore correct 'volumetric_multiplier' value - } - - /** - * M407: Get measured filament diameter on serial output - */ - inline void gcode_M407() { - SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); - SERIAL_PROTOCOLLN(filament_width_meas); - } - -#endif // FILAMENT_WIDTH_SENSOR - -void quickstop_stepper() { - planner.quick_stop(); - planner.synchronize(); - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); -} - - - -#if HAS_LEVELING - - //#define M420_C_USE_MEAN - - /** - * M420: Enable/Disable Bed Leveling and/or set the Z fade height. - * - * S[bool] Turns leveling on or off - * Z[height] Sets the Z fade height (0 or none to disable) - * V[bool] Verbose - Print the leveling grid - * - * With AUTO_BED_LEVELING_UBL only: - * - * L[index] Load UBL mesh from index (0 is default) - * T[map] 0:Human-readable 1:CSV 2:"LCD" 4:Compact - * - * With mesh-based leveling only: - * - * C Center mesh on the mean of the lowest and highest - */ - inline void gcode_M420() { - const bool seen_S = parser.seen('S'); - bool to_enable = seen_S ? parser.value_bool() : planner.leveling_active; - - // If disabling leveling do it right away - // (Don't disable for just M420 or M420 V) - if (seen_S && !to_enable) set_bed_leveling_enabled(false); - - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - // L to load a mesh from the EEPROM - if (parser.seen('L')) { - - set_bed_leveling_enabled(false); - - #if ENABLED(EEPROM_SETTINGS) - const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.storage_slot; - const int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(storage_slot); - ubl.storage_slot = storage_slot; - - #else - - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - - #endif - } - - // L or V display the map info - if (parser.seen('L') || parser.seen('V')) { - ubl.display_map(parser.byteval('T')); - SERIAL_ECHOPGM("Mesh is "); - if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPAIR("valid\nStorage slot: ", ubl.storage_slot); - } - - #endif // AUTO_BED_LEVELING_UBL - - #if HAS_MESH - - #if ENABLED(MESH_BED_LEVELING) - #define Z_VALUES(X,Y) mbl.z_values[X][Y] - #else - #define Z_VALUES(X,Y) z_values[X][Y] - #endif - - // Subtract the given value or the mean from all mesh values - if (leveling_is_valid() && parser.seen('C')) { - const float cval = parser.value_float(); - #if ENABLED(AUTO_BED_LEVELING_UBL) - - set_bed_leveling_enabled(false); - ubl.adjust_mesh_to_mean(true, cval); - - #else - - #if ENABLED(M420_C_USE_MEAN) - - // Get the sum and average of all mesh values - float mesh_sum = 0; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - mesh_sum += Z_VALUES(x, y); - const float zmean = mesh_sum / float(GRID_MAX_POINTS); - - #else - - // Find the low and high mesh values - float lo_val = 100, hi_val = -100; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { - const float z = Z_VALUES(x, y); - NOMORE(lo_val, z); - NOLESS(hi_val, z); - } - // Take the mean of the lowest and highest - const float zmean = (lo_val + hi_val) / 2.0 + cval; - - #endif - - // If not very close to 0, adjust the mesh - if (!NEAR_ZERO(zmean)) { - set_bed_leveling_enabled(false); - // Subtract the mean from all values - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - Z_VALUES(x, y) -= zmean; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - - #endif - } - - #endif // HAS_MESH - - // V to print the matrix or mesh - if (parser.seen('V')) { - #if ABL_PLANAR - planner.bed_level_matrix.debug(PSTR("Bed Level Correction Matrix:")); - #else - if (leveling_is_valid()) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - print_bilinear_leveling_grid(); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - #elif ENABLED(MESH_BED_LEVELING) - SERIAL_ECHOLNPGM("Mesh Bed Level data:"); - mbl.report_mesh(); - #endif - } - #endif - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seen('Z')) set_z_fade_height(parser.value_linear_units(), false); - #endif - - // Enable leveling if specified, or if previously active - set_bed_leveling_enabled(to_enable); - - // Error if leveling failed to enable or reenable - if (to_enable && !planner.leveling_active) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED); - } - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Bed Leveling ", planner.leveling_active ? MSG_ON : MSG_OFF); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Fade Height "); - if (planner.z_fade_height > 0.0) - SERIAL_ECHOLN(planner.z_fade_height); - else - SERIAL_ECHOLNPGM(MSG_OFF); - #endif - - // Report change in position - if (memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); - } - -#endif // HAS_LEVELING - -#if ENABLED(MESH_BED_LEVELING) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 X Y Z - * M421 X Y Q - * M421 I J Z - * M421 I J Q - */ - inline void gcode_M421() { - const bool hasX = parser.seen('X'), hasI = parser.seen('I'); - const int8_t ix = hasI ? parser.value_int() : hasX ? mbl.probe_index_x(parser.value_linear_units()) : -1; - const bool hasY = parser.seen('Y'), hasJ = parser.seen('J'); - const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(parser.value_linear_units()) : -1; - const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - - if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (ix < 0 || iy < 0) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else - mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); - } - -#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - */ - inline void gcode_M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (!hasI || !hasJ || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else { - z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - } - -#elif ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - * M421 I J N - * M421 C Z - * M421 C Q - */ - inline void gcode_M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, - hasC = parser.seen('C'), - hasN = parser.seen('N'), - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (hasC) { - const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL); - ix = location.x_index; - iy = location.y_index; - } - - if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } - else - ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); - } - -#endif // AUTO_BED_LEVELING_UBL - -#if HAS_M206_COMMAND - - /** - * M428: Set home_offset based on the distance between the - * current_position and the nearest "reference point." - * If an axis is past center its endstop position - * is the reference-point. Otherwise it uses 0. This allows - * the Z offset to be set near the bed when using a max endstop. - * - * M428 can't be used more than 2cm away from 0 or an endstop. - * - * Use M206 to set these values directly. - */ - inline void gcode_M428() { - if (axis_unhomed_error()) return; - - float diff[XYZ]; - LOOP_XYZ(i) { - diff[i] = base_home_pos((AxisEnum)i) - current_position[i]; - if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) - diff[i] = -current_position[i]; - if (!WITHIN(diff[i], -20, 20)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGEPGM("Err: Too far!"); - BUZZ(200, 40); - return; - } - } - - LOOP_XYZ(i) set_home_offset((AxisEnum)i, diff[i]); - report_current_position(); - LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); - BUZZ(100, 659); - BUZZ(100, 698); - } - -#endif // HAS_M206_COMMAND - -/** - * M500: Store settings in EEPROM - */ -inline void gcode_M500() { - (void)settings.save(); -} - -/** - * M501: Read settings from EEPROM - */ -inline void gcode_M501() { - (void)settings.load(); -} - -/** - * M502: Revert to default settings - */ -inline void gcode_M502() { - (void)settings.reset(); -} - -#if DISABLED(DISABLE_M503) - /** - * M503: print settings currently in memory - */ - inline void gcode_M503() { - (void)settings.report(parser.seen('S') && !parser.value_bool()); - } -#endif - -#if ENABLED(EEPROM_SETTINGS) - /** - * M504: Validate EEPROM Contents - */ - inline void gcode_M504() { - if (settings.validate()) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM OK"); - } - } -#endif - -#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - - /** - * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) - */ - inline void gcode_M540() { - if (parser.seen('S')) planner.abort_on_endstop_hit = parser.value_bool(); - } - -#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - -#if HAS_BED_PROBE - - inline void gcode_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_START(); - SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); - } - return; - } - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET); - SERIAL_ECHOLNPAIR(": ", zprobe_zoffset); - } - -#endif // HAS_BED_PROBE - -#if ENABLED(SKEW_CORRECTION_GCODE) - - /** - * M852: Get or set the machine skew factors. Reports current values with no arguments. - * - * S[xy_factor] - Alias for 'I' - * I[xy_factor] - New XY skew factor - * J[xz_factor] - New XZ skew factor - * K[yz_factor] - New YZ skew factor - */ - inline void gcode_M852() { - uint8_t ijk = 0, badval = 0, setval = 0; - - if (parser.seen('I') || parser.seen('S')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.xy_skew_factor != value) { - planner.xy_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - #if ENABLED(SKEW_CORRECTION_FOR_Z) - - if (parser.seen('J')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.xz_skew_factor != value) { - planner.xz_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - if (parser.seen('K')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.yz_skew_factor != value) { - planner.yz_skew_factor = value; - ++setval; - } - } - else - ++badval; - } - - #endif - - if (badval) - SERIAL_ECHOLNPGM(MSG_SKEW_MIN " " STRINGIFY(SKEW_FACTOR_MIN) " " MSG_SKEW_MAX " " STRINGIFY(SKEW_FACTOR_MAX)); - - // When skew is changed the current position changes - if (setval) { - set_current_from_steppers_for_axis(ALL_AXES); - SYNC_PLAN_POSITION_KINEMATIC(); - report_current_position(); - } - - if (!ijk) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: "); - SERIAL_ECHO_F(planner.xy_skew_factor, 6); - SERIAL_EOL(); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPAIR(" XZ: ", planner.xz_skew_factor); - SERIAL_ECHOLNPAIR(" YZ: ", planner.yz_skew_factor); - #else - SERIAL_EOL(); - #endif - } - } - -#endif // SKEW_CORRECTION_GCODE - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * M600: Pause for filament change - * - * E[distance] - Retract the filament this far - * Z[distance] - Move the Z axis by this distance - * X[position] - Move to this X position, with Y - * Y[position] - Move to this Y position, with X - * U[distance] - Retract distance for removal (manual reload) - * L[distance] - Extrude distance for insertion (manual reload) - * B[count] - Number of times to beep, -1 for indefinite (if equipped with a buzzer) - * T[toolhead] - Select extruder for filament change - * - * Default values are used for omitted arguments. - */ - inline void gcode_M600() { - point_t park_point = NOZZLE_PARK_POINT; - - if (get_target_extruder_from_command(600)) return; - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder); - #endif - - #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) - // Don't allow filament change without homing first - if (axis_unhomed_error()) home_all_axes(); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - - #if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA) - park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0); - park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); - #endif - - // Unload filament - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[active_extruder]); - - // Slow load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - - // Fast load filament - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : - filament_change_load_length[active_extruder]); - - const int beep_count = parser.intval('B', - #ifdef FILAMENT_CHANGE_ALERT_BEEPS - FILAMENT_CHANGE_ALERT_BEEPS - #else - -1 - #endif - ); - - const bool job_running = print_job_timer.isRunning(); - - if (pause_print(retract, park_point, unload_length, true)) { - wait_for_filament_reload(beep_count); - resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); - } - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Resume the print job timer if it was running - if (job_running) print_job_timer.start(); - } - - /** - * M603: Configure filament change - * - * T[toolhead] - Select extruder to configure, active extruder if not specified - * U[distance] - Retract distance for removal, for the specified extruder - * L[distance] - Extrude distance for insertion, for the specified extruder - * - */ - inline void gcode_M603() { - - if (get_target_extruder_from_command(603)) return; - - // Unload length - if (parser.seen('U')) { - filament_change_unload_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_unload_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - - // Load length - if (parser.seen('L')) { - filament_change_load_length[target_extruder] = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(filament_change_load_length[target_extruder], EXTRUDE_MAXLENGTH); - #endif - } - } - -#endif // ADVANCED_PAUSE_FEATURE - -#if ENABLED(MK2_MULTIPLEXER) - - inline void select_multiplexed_stepper(const uint8_t e) { - planner.synchronize(); - disable_e_steppers(); - WRITE(E_MUX0_PIN, TEST(e, 0) ? HIGH : LOW); - WRITE(E_MUX1_PIN, TEST(e, 1) ? HIGH : LOW); - WRITE(E_MUX2_PIN, TEST(e, 2) ? HIGH : LOW); - safe_delay(100); - } - -#endif // MK2_MULTIPLEXER - -#if ENABLED(DUAL_X_CARRIAGE) - - /** - * M605: Set dual x-carriage movement mode - * - * M605 S0: Full control mode. The slicer has full control over x-carriage movement - * M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement - * M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn - * units x-offset and an optional differential hotend temperature of - * mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate - * the first with a spacing of 100mm in the x direction and 2 degrees hotter. - * - * Note: the X axis should be homed after changing dual x-carriage mode. - */ - inline void gcode_M605() { - planner.synchronize(); - if (parser.seen('S')) dual_x_carriage_mode = (DualXMode)parser.value_byte(); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - case DXC_AUTO_PARK_MODE: - break; - case DXC_DUPLICATION_MODE: - if (parser.seen('X')) duplicate_extruder_x_offset = MAX(parser.value_linear_units(), X2_MIN_POS - x_home_pos(0)); - if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][0]); - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][0]); - SERIAL_CHAR(' '); - SERIAL_ECHO(duplicate_extruder_x_offset); - SERIAL_CHAR(','); - SERIAL_ECHOLN(hotend_offset[Y_AXIS][1]); - break; - default: - dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - break; - } - active_extruder_parked = false; - extruder_duplication_enabled = false; - delayed_move_time = 0; - } - -#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - - inline void gcode_M605() { - planner.synchronize(); - extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); - } - -#endif // DUAL_NOZZLE_DUPLICATION_MODE - -#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - - /** - * M701: Load filament - * - * T - Optional extruder number. Current extruder if omitted. - * Z - Move the Z axis by this distance - * L - Extrude distance for insertion (positive value) (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_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; - #endif - - if (get_target_extruder_from_command(701)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial "wait for load" message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // 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); - - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : filament_change_load_length[active_extruder]); - load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, - true, thermalManager.wait_for_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT); - - // 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); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - - /** - * M702: Unload filament - * - * T - Optional extruder number. If omitted, current extruder - * (or ALL extruders with FILAMENT_UNLOAD_ALL_EXTRUDERS). - * Z - Move the Z axis by this distance - * U - Retract distance for removal (manual reload) - * - * Default values are used for omitted arguments. - */ - inline void gcode_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; - #endif - - if (get_target_extruder_from_command(702)) return; - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial message - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, 0, true); - #endif - - // 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); - - // Unload filament - #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (!parser.seenval('T')) { - HOTEND_LOOP() { - if (e != active_extruder) tool_change(e, 0, true); - unload_filament(-filament_change_unload_length[e], true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - } - else - #endif - { - // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - filament_change_unload_length[target_extruder]); - - unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } - - // 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); - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, 0, true); - #endif - - // Show status screen - #if ENABLED(ULTIPANEL) - lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); - #endif - } - -#endif // FILAMENT_LOAD_UNLOAD_GCODES - -#if ENABLED(MAX7219_GCODE) - /** - * M7219: Control the Max7219 LED matrix - * - * I - Initialize (clear) the matrix - * F - Fill the matrix (set all bits) - * P - Dump the LEDs[] array values - * C - Set a column to the 8-bit value V - * R - Set a row to the 8-bit value V - * X - X position of an LED to set or toggle - * Y - Y position of an LED to set or toggle - * V - The potentially 32-bit value or on/off state to set - * (for example: a chain of 4 Max7219 devices can have 32 bit - * rows or columns depending upon rotation) - */ - inline void gcode_M7219() { - if (parser.seen('I')) { - max7219.register_setup(); - max7219.clear(); - } - - if (parser.seen('F')) max7219.fill(); - - const uint32_t v = parser.ulongval('V'); - - if (parser.seenval('R')) { - const uint8_t r = parser.value_byte(); - max7219.set_row(r, v); - } - else if (parser.seenval('C')) { - const uint8_t c = parser.value_byte(); - max7219.set_column(c, v); - } - else if (parser.seenval('X') || parser.seenval('Y')) { - const uint8_t x = parser.byteval('X'), y = parser.byteval('Y'); - if (parser.seenval('V')) - max7219.led_set(x, y, parser.boolval('V')); - else - max7219.led_toggle(x, y); - } - else if (parser.seen('D')) { - const uint8_t line = parser.byteval('D') + (parser.byteval('U') << 3); - if (line < MAX7219_LINES) { - max7219.led_line[line] = v; - return max7219.refresh_line(line); - } - } - - if (parser.seen('P')) { - for (uint8_t r = 0; r < MAX7219_LINES; r++) { - SERIAL_ECHOPGM("led_line["); - if (r < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(r)); - SERIAL_ECHO("]="); - for (uint8_t b = 8; b--;) SERIAL_CHAR('0' + TEST(max7219.led_line[r], b)); - SERIAL_EOL(); - } - } - } -#endif // MAX7219_GCODE - -#if ENABLED(LIN_ADVANCE) - /** - * M900: Get or Set Linear Advance K-factor - * - * K Set advance K factor - */ - inline void gcode_M900() { - if (parser.seenval('K')) { - const float newK = parser.floatval('K'); - if (WITHIN(newK, 0, 10)) { - planner.synchronize(); - planner.extruder_advance_K = newK; - } - else - SERIAL_PROTOCOLLNPGM("?K value out of range (0-10)."); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Advance K=", planner.extruder_advance_K); - } - } -#endif // LIN_ADVANCE - -#if HAS_TRINAMIC - #if ENABLED(TMC_DEBUG) - inline void gcode_M122() { - if (parser.seen('S')) - tmc_set_report_status(parser.value_bool()); - else - tmc_report_all(); - } - #endif // TMC_DEBUG - - /** - * M906: Set motor current in milliamps using axis codes X, Y, Z, E - * Report driver currents when no axis specified - */ - inline void gcode_M906() { - #define TMC_SAY_CURRENT(Q) tmc_get_current(stepper##Q, TMC_##Q) - #define TMC_SET_CURRENT(Q) tmc_set_current(stepper##Q, value) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZE(i) if (uint16_t value = parser.intval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_IS_TMC(X) - if (index < 2) TMC_SET_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - if (!(index & 1)) TMC_SET_CURRENT(X2); - #endif - break; - case Y_AXIS: - #if AXIS_IS_TMC(Y) - if (index < 2) TMC_SET_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - if (!(index & 1)) TMC_SET_CURRENT(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_IS_TMC(Z) - if (index < 2) TMC_SET_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - if (!(index & 1)) TMC_SET_CURRENT(Z2); - #endif - break; - case E_AXIS: { - if (get_target_extruder_from_command(906)) return; - switch (target_extruder) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - } - } break; - } - } - - if (report) { - #if AXIS_IS_TMC(X) - TMC_SAY_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - TMC_SAY_CURRENT(X2); - #endif - #if AXIS_IS_TMC(Y) - TMC_SAY_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - TMC_SAY_CURRENT(Y2); - #endif - #if AXIS_IS_TMC(Z) - TMC_SAY_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - TMC_SAY_CURRENT(Z2); - #endif - #if AXIS_IS_TMC(E0) - TMC_SAY_CURRENT(E0); - #endif - #if AXIS_IS_TMC(E1) - TMC_SAY_CURRENT(E1); - #endif - #if AXIS_IS_TMC(E2) - TMC_SAY_CURRENT(E2); - #endif - #if AXIS_IS_TMC(E3) - TMC_SAY_CURRENT(E3); - #endif - #if AXIS_IS_TMC(E4) - TMC_SAY_CURRENT(E4); - #endif - } - } - - #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && PIN_EXISTS(ST##_SERIAL_RX))) - #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N)) - - /** - * M911: Report TMC stepper driver overtemperature pre-warn flag - * This flag is held by the library, persisting until cleared by M912 - */ - inline void gcode_M911() { - #if M91x_USE(X) - tmc_report_otpw(stepperX, TMC_X); - #endif - #if M91x_USE(X2) - tmc_report_otpw(stepperX2, TMC_X2); - #endif - #if M91x_USE(Y) - tmc_report_otpw(stepperY, TMC_Y); - #endif - #if M91x_USE(Y2) - tmc_report_otpw(stepperY2, TMC_Y2); - #endif - #if M91x_USE(Z) - tmc_report_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - tmc_report_otpw(stepperZ2, TMC_Z2); - #endif - #if M91x_USE_E(0) - tmc_report_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - tmc_report_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - tmc_report_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - tmc_report_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - tmc_report_otpw(stepperE4, TMC_E4); - #endif - } - - /** - * M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library - * Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, and E[index]. - * If no axes are given, clear all. - * - * Examples: - * M912 X ; clear X and X2 - * M912 X1 ; clear X1 only - * M912 X2 ; clear X2 only - * M912 X E ; clear X, X2, and all E - * M912 E1 ; clear E1 only - */ - inline void gcode_M912() { - const bool hasX = parser.seen(axis_codes[X_AXIS]), - hasY = parser.seen(axis_codes[Y_AXIS]), - hasZ = parser.seen(axis_codes[Z_AXIS]), - hasE = parser.seen(axis_codes[E_AXIS]), - hasNone = !hasX && !hasY && !hasZ && !hasE; - - #if M91x_USE(X) || M91x_USE(X2) - const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10); - #if M91x_USE(X) - if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X); - #endif - #if M91x_USE(X2) - if (hasNone || xval == 2 || (hasX && xval == 10)) tmc_clear_otpw(stepperX2, TMC_X2); - #endif - #endif - - #if M91x_USE(Y) || M91x_USE(Y2) - const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10); - #if M91x_USE(Y) - if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y); - #endif - #if M91x_USE(Y2) - if (hasNone || yval == 2 || (hasY && yval == 10)) tmc_clear_otpw(stepperY2, TMC_Y2); - #endif - #endif - - #if M91x_USE(Z) || M91x_USE(Z2) - const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10); - #if M91x_USE(Z) - if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z); - #endif - #if M91x_USE(Z2) - if (hasNone || zval == 2 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ2, TMC_Z2); - #endif - #endif - - #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) - const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10); - #if M91x_USE_E(0) - if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0); - #endif - #if M91x_USE_E(1) - if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1); - #endif - #if M91x_USE_E(2) - if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2); - #endif - #if M91x_USE_E(3) - if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3); - #endif - #if M91x_USE_E(4) - if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4); - #endif - #endif - } - - /** - * M913: Set HYBRID_THRESHOLD speed. - */ - #if ENABLED(HYBRID_THRESHOLD) - inline void gcode_M913() { - #define TMC_SAY_PWMTHRS(A,Q) tmc_get_pwmthrs(stepper##Q, TMC_##Q, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, value, planner.axis_steps_per_mm[_AXIS(A)]) - #define TMC_SAY_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_get_pwmthrs(stepperE##E, TMC_E##E, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) - #define TMC_SET_PWMTHRS_E(E) do{ const uint8_t extruder = E; tmc_set_pwmthrs(stepperE##E, value, planner.axis_steps_per_mm[E_AXIS_N]); }while(0) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZE(i) if (int32_t value = parser.longval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_HAS_STEALTHCHOP(X) - if (index < 2) TMC_SET_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); - #endif - break; - case Y_AXIS: - #if AXIS_HAS_STEALTHCHOP(Y) - if (index < 2) TMC_SET_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); - #endif - break; - case Z_AXIS: - #if AXIS_HAS_STEALTHCHOP(Z) - if (index < 2) TMC_SET_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2); - #endif - break; - case E_AXIS: { - if (get_target_extruder_from_command(913)) return; - switch (target_extruder) { - #if AXIS_HAS_STEALTHCHOP(E0) - case 0: TMC_SET_PWMTHRS_E(0); break; - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - case 1: TMC_SET_PWMTHRS_E(1); break; - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - case 2: TMC_SET_PWMTHRS_E(2); break; - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - case 3: TMC_SET_PWMTHRS_E(3); break; - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - case 4: TMC_SET_PWMTHRS_E(4); break; - #endif - } - } break; - } - } - - if (report) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SAY_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SAY_PWMTHRS(X,X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SAY_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SAY_PWMTHRS(Y,Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SAY_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SAY_PWMTHRS(Z,Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SAY_PWMTHRS_E(0); - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - TMC_SAY_PWMTHRS_E(1); - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - TMC_SAY_PWMTHRS_E(2); - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - TMC_SAY_PWMTHRS_E(3); - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - TMC_SAY_PWMTHRS_E(4); - #endif - } - } - #endif // HYBRID_THRESHOLD - - /** - * M914: Set SENSORLESS_HOMING sensitivity. - */ - #if ENABLED(SENSORLESS_HOMING) - inline void gcode_M914() { - #define TMC_SAY_SGT(Q) tmc_get_sgt(stepper##Q, TMC_##Q) - #define TMC_SET_SGT(Q) tmc_set_sgt(stepper##Q, value) - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZ(i) if (parser.seen(axis_codes[i])) { - const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); - report = false; - switch (i) { - #if X_SENSORLESS - case X_AXIS: - #if AXIS_HAS_STALLGUARD(X) - if (index < 2) TMC_SET_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - if (!(index & 1)) TMC_SET_SGT(X2); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - #if AXIS_HAS_STALLGUARD(Y) - if (index < 2) TMC_SET_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - if (!(index & 1)) TMC_SET_SGT(Y2); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - #if AXIS_HAS_STALLGUARD(Z) - if (index < 2) TMC_SET_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - if (!(index & 1)) TMC_SET_SGT(Z2); - #endif - break; - #endif - } - } - - if (report) { - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - TMC_SAY_SGT(X); - #endif - #if AXIS_HAS_STALLGUARD(X2) - TMC_SAY_SGT(X2); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_HAS_STALLGUARD(Y) - TMC_SAY_SGT(Y); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - TMC_SAY_SGT(Y2); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - TMC_SAY_SGT(Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - TMC_SAY_SGT(Z2); - #endif - #endif - } - } - #endif // SENSORLESS_HOMING - - /** - * TMC Z axis calibration routine - */ - #if ENABLED(TMC_Z_CALIBRATION) - inline void gcode_M915() { - const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT, - _z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT; - - if (!TEST(axis_known_position, Z_AXIS)) { - SERIAL_ECHOLNPGM("\nPlease home Z axis first"); - return; - } - - #if AXIS_IS_TMC(Z) - const uint16_t Z_current_1 = stepperZ.getCurrent(); - stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - const uint16_t Z2_current_1 = stepperZ2.getCurrent(); - stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); - #endif - - SERIAL_ECHOPAIR("\nCalibration current: Z", _rms); - - soft_endstops_enabled = false; - - do_blocking_move_to_z(Z_MAX_POS+_z); - - #if AXIS_IS_TMC(Z) - stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER); - #endif - - do_blocking_move_to_z(Z_MAX_POS); - soft_endstops_enabled = true; - - SERIAL_ECHOLNPGM("\nHoming Z due to lost steps"); - enqueue_and_echo_commands_P(PSTR("G28 Z")); - } - #endif - -#endif // HAS_TRINAMIC - -/** - * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S - */ -inline void gcode_M907() { - #if HAS_DIGIPOTSS - - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.digipot_current(i, parser.value_int()); - if (parser.seen('B')) stepper.digipot_current(4, parser.value_int()); - if (parser.seen('S')) for (uint8_t i = 0; i <= 4; i++) stepper.digipot_current(i, parser.value_int()); - - #elif HAS_MOTOR_CURRENT_PWM - - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - if (parser.seen('X')) stepper.digipot_current(0, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - if (parser.seen('Z')) stepper.digipot_current(1, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - if (parser.seen('E')) stepper.digipot_current(2, parser.value_int()); - #endif - - #endif - - #if ENABLED(DIGIPOT_I2C) - // this one uses actual amps in floating point - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float()); - // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...) - for (uint8_t i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (parser.seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, parser.value_float()); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - if (parser.seen('S')) { - const float dac_percent = parser.value_float(); - for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent); - } - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) dac_current_percent(i, parser.value_float()); - #endif -} - -#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - - /** - * M908: Control digital trimpot directly (M908 P S) - */ - inline void gcode_M908() { - #if HAS_DIGIPOTSS - stepper.digitalPotWrite( - parser.intval('P'), - parser.intval('S') - ); - #endif - #ifdef DAC_STEPPER_CURRENT - dac_current_raw( - parser.byteval('P', -1), - parser.ushortval('S', 0) - ); - #endif - } - - #if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF - - inline void gcode_M909() { dac_print_values(); } - - inline void gcode_M910() { dac_commit_eeprom(); } - - #endif - -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT - -#if HAS_MICROSTEPS - - // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - inline void gcode_M350() { - if (parser.seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, parser.value_byte()); - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte()); - if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte()); - stepper.microstep_readings(); - } - - /** - * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B - * S# determines MS1 or MS2, X# sets the pin high/low. - */ - inline void gcode_M351() { - if (parser.seenval('S')) switch (parser.value_byte()) { - case 1: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1); - if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1); - break; - case 2: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte()); - if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte()); - break; - } - stepper.microstep_readings(); - } - -#endif // HAS_MICROSTEPS - -#if HAS_CASE_LIGHT - - #ifndef INVERT_CASE_LIGHT - #define INVERT_CASE_LIGHT false - #endif - uint8_t case_light_brightness; // LCD routine wants INT - bool case_light_on; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - LEDColor case_light_color = - #ifdef CASE_LIGHT_NEOPIXEL_COLOR - CASE_LIGHT_NEOPIXEL_COLOR - #else - { 255, 255, 255, 255 } - #endif - ; - #endif - - void update_case_light() { - const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - - leds.set_color( - MakeLEDColor(case_light_color.r, case_light_color.g, case_light_color.b, case_light_color.w, n10ct), - false - ); - - #else // !CASE_LIGHT_USE_NEOPIXEL - - SET_OUTPUT(CASE_LIGHT_PIN); - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) - analogWrite(CASE_LIGHT_PIN, n10ct); - else { - const bool s = case_light_on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT; - WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW); - } - - #endif // !CASE_LIGHT_USE_NEOPIXEL - } -#endif // HAS_CASE_LIGHT - -/** - * M355: Turn case light on/off and set brightness - * - * P Set case light brightness (PWM pin required - ignored otherwise) - * - * S Set case light on/off - * - * When S turns on the light on a PWM pin then the current brightness level is used/restored - * - * M355 P200 S0 turns off the light & sets the brightness level - * M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin) - */ -inline void gcode_M355() { - #if HAS_CASE_LIGHT - uint8_t args = 0; - if (parser.seenval('P')) ++args, case_light_brightness = parser.value_byte(); - if (parser.seenval('S')) ++args, case_light_on = parser.value_bool(); - if (args) update_case_light(); - - // always report case light status - SERIAL_ECHO_START(); - if (!case_light_on) { - SERIAL_ECHOLNPGM("Case light: off"); - } - else { - if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on"); - else SERIAL_ECHOLNPAIR("Case light: ", (int)case_light_brightness); - } - - #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE); - #endif // HAS_CASE_LIGHT -} - -#if ENABLED(MIXING_EXTRUDER) - - /** - * M163: Set a single mix factor for a mixing extruder - * This is called "weight" by some systems. - * - * S[index] The channel index to set - * P[float] The mix value - * - */ - inline void gcode_M163() { - const int mix_index = parser.intval('S'); - if (mix_index < MIXING_STEPPERS) { - float mix_value = parser.floatval('P'); - NOLESS(mix_value, 0.0); - mixing_factor[mix_index] = RECIPROCAL(mix_value); - } - } - - #if MIXING_VIRTUAL_TOOLS > 1 - - /** - * M164: Store the current mix factors as a virtual tool. - * - * S[index] The virtual tool to store - * - */ - inline void gcode_M164() { - const int tool_index = parser.intval('S'); - if (tool_index < MIXING_VIRTUAL_TOOLS) { - normalize_mix(); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i]; - } - } - - #endif - - #if ENABLED(DIRECT_MIXING_IN_G1) - /** - * M165: Set multiple mix factors for a mixing extruder. - * Factors that are left out will be set to 0. - * All factors together must add up to 1.0. - * - * A[factor] Mix factor for extruder stepper 1 - * B[factor] Mix factor for extruder stepper 2 - * C[factor] Mix factor for extruder stepper 3 - * D[factor] Mix factor for extruder stepper 4 - * H[factor] Mix factor for extruder stepper 5 - * I[factor] Mix factor for extruder stepper 6 - * - */ - inline void gcode_M165() { gcode_get_mix(); } - #endif - -#endif // MIXING_EXTRUDER - -/** - * M999: Restart after being stopped - * - * Default behaviour is to flush the serial buffer and request - * a resend to the host starting on the last N line received. - * - * Sending "M999 S1" will resume printing without flushing the - * existing command buffer. - * - */ -inline void gcode_M999() { - Running = true; - lcd_reset_alert_level(); - - if (parser.boolval('S')) return; - - // gcode_LastN = Stopped_gcode_LastN; - flush_and_request_resend(); -} - -#if DO_SWITCH_EXTRUDER - #if EXTRUDERS > 3 - #define REQ_ANGLES 4 - #define _SERVO_NR (e < 2 ? SWITCHING_EXTRUDER_SERVO_NR : SWITCHING_EXTRUDER_E23_SERVO_NR) - #else - #define REQ_ANGLES 2 - #define _SERVO_NR SWITCHING_EXTRUDER_SERVO_NR - #endif - inline void move_extruder_servo(const uint8_t e) { - constexpr int16_t angles[] = SWITCHING_EXTRUDER_SERVO_ANGLES; - static_assert(COUNT(angles) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - planner.synchronize(); - #if EXTRUDERS & 1 - if (e < EXTRUDERS - 1) - #endif - { - MOVE_SERVO(_SERVO_NR, angles[e]); - safe_delay(500); - } - } -#endif // DO_SWITCH_EXTRUDER - -#if ENABLED(SWITCHING_NOZZLE) - inline void move_nozzle_servo(const uint8_t e) { - const int16_t angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; - planner.synchronize(); - MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, angles[e]); - safe_delay(500); - } -#endif - -inline void invalid_extruder_error(const uint8_t e) { - SERIAL_ECHO_START(); - SERIAL_CHAR('T'); - SERIAL_ECHO_F(e, DEC); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); -} - -#if ENABLED(PARKING_EXTRUDER) - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - #define PE_MAGNET_ON_STATE !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #else - #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #endif - - void pe_set_magnet(const uint8_t extruder_num, const uint8_t state) { - switch (extruder_num) { - case 1: OUT_WRITE(SOL1_PIN, state); break; - default: OUT_WRITE(SOL0_PIN, state); break; - } - #if PARKING_EXTRUDER_SOLENOIDS_DELAY > 0 - dwell(PARKING_EXTRUDER_SOLENOIDS_DELAY); - #endif - } - - inline void pe_activate_magnet(const uint8_t extruder_num) { pe_set_magnet(extruder_num, PE_MAGNET_ON_STATE); } - inline void pe_deactivate_magnet(const uint8_t extruder_num) { pe_set_magnet(extruder_num, !PE_MAGNET_ON_STATE); } - -#endif // PARKING_EXTRUDER - -#if HAS_FANMUX - - void fanmux_switch(const uint8_t e) { - WRITE(FANMUX0_PIN, TEST(e, 0) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX1) - WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX2) - WRITE(FANMUX2, TEST(e, 2) ? HIGH : LOW); - #endif - #endif - } - - FORCE_INLINE void fanmux_init(void) { - SET_OUTPUT(FANMUX0_PIN); - #if PIN_EXISTS(FANMUX1) - SET_OUTPUT(FANMUX1_PIN); - #if PIN_EXISTS(FANMUX2) - SET_OUTPUT(FANMUX2_PIN); - #endif - #endif - fanmux_switch(0); - } - -#endif // HAS_FANMUX - -/** - * Tool Change functions - */ - -#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - inline void mixing_tool_change(const uint8_t tmp_extruder) { - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(tmp_extruder); - - // T0-Tnnn: Switch virtual tool by changing the mix - for (uint8_t j = 0; j < MIXING_STEPPERS; j++) - mixing_factor[j] = mixing_virtual_tool_mix[tmp_extruder][j]; - } - -#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1 - -#if ENABLED(DUAL_X_CARRIAGE) - - inline void dualx_tool_change(const uint8_t tmp_extruder, bool &no_move) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; - case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; - case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; - } - } - #endif - - const float xhome = x_home_pos(active_extruder); - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE - && IsRunning() - && (delayed_move_time || current_position[X_AXIS] != xhome) - ) { - float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_z, soft_endstop_max[Z_AXIS]); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Raise to ", raised_z); - SERIAL_ECHOLNPAIR("MoveX to ", xhome); - SERIAL_ECHOLNPAIR("Lower to ", current_position[Z_AXIS]); - } - #endif - // Park old head: 1) raise 2) move to park position 3) lower - for (uint8_t i = 0; i < 3; i++) - planner.buffer_line( - i == 0 ? current_position[X_AXIS] : xhome, - current_position[Y_AXIS], - i == 2 ? current_position[Z_AXIS] : raised_z, - current_position[E_AXIS], - planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], - active_extruder - ); - planner.synchronize(); - } - - // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) - current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; - current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - - // Activate the new extruder ahead of calling set_axis_is_at_home! - active_extruder = tmp_extruder; - - // This function resets the max/min values - the current position may be overwritten below. - set_axis_is_at_home(X_AXIS); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); - #endif - - // Only when auto-parking are carriages safe to move - if (dual_x_carriage_mode != DXC_AUTO_PARK_MODE) no_move = true; - - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - // New current position is the position of the activated extruder - current_position[X_AXIS] = inactive_extruder_x_pos; - // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination[X_AXIS]; - break; - case DXC_AUTO_PARK_MODE: - // record raised toolhead position for use by unpark - COPY(raised_parked_position, current_position); - raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - #if ENABLED(MAX_SOFTWARE_ENDSTOPS) - NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); - #endif - active_extruder_parked = true; - delayed_move_time = 0; - break; - case DXC_DUPLICATION_MODE: - // If the new extruder is the left one, set it "parked" - // This triggers the second extruder to move into the duplication position - active_extruder_parked = (active_extruder == 0); - current_position[X_AXIS] = active_extruder_parked ? inactive_extruder_x_pos : destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; - extruder_duplication_enabled = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos); - SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled"); - } - #endif - break; - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - DEBUG_POS("New extruder (parked)", current_position); - } - #endif - - // No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together? - } - -#endif // DUAL_X_CARRIAGE - -#if ENABLED(PARKING_EXTRUDER) - - inline void parking_extruder_tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - constexpr float z_raise = PARKING_EXTRUDER_SECURITY_RAISE; - - if (!no_move) { - - const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, - midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + hotend_offset[X_AXIS][active_extruder], - grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] - + (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); - /** - * Steps: - * 1. Raise Z-Axis to give enough clearance - * 2. Move to park position of old extruder - * 3. Disengage magnetic field, wait for delay - * 4. Move near new extruder - * 5. Engage magnetic field for new extruder - * 6. Move to parking incl. offset of new extruder - * 7. Lower Z-Axis - */ - - // STEP 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Starting Autopark"); - if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position); - #endif - current_position[Z_AXIS] += z_raise; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(1) Raise Z-Axis "); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving to Raised Z-Position", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - planner.synchronize(); - - // STEP 2 - current_position[X_AXIS] = parkingposx[active_extruder] + hotend_offset[X_AXIS][active_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(2) Park extruder ", active_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving ParkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 3 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(3) Disengage magnet "); - #endif - pe_deactivate_magnet(active_extruder); - - // STEP 4 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(4) Move to position near new extruder"); - #endif - current_position[X_AXIS] += (active_extruder == 0 ? 10 : -10); // move 10mm away from parked extruder - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Moving away from parked extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - // STEP 5 - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(5) Engage magnetic field"); - #endif - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); //just save power for inverted magnets - #endif - pe_activate_magnet(tmp_extruder); - - // STEP 6 - current_position[X_AXIS] = grabpos + (tmp_extruder == 0 ? (+10) : (-10)); - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - current_position[X_AXIS] = grabpos; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPAIR("(6) Unpark extruder ", tmp_extruder); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move UnparkPos", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS]/2, active_extruder); - planner.synchronize(); - - // Step 7 - current_position[X_AXIS] = midpos - hotend_offset[X_AXIS][tmp_extruder]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("(7) Move midway between hotends"); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move midway to new extruder", current_position); - #endif - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - SERIAL_ECHOLNPGM("Autopark done."); - #endif - } - else { // nomove == true - // Only engage magnetic field for new extruder - pe_activate_magnet(tmp_extruder); - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(active_extruder); // Just save power for inverted magnets - #endif - } - current_position[Z_AXIS] += hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Applying Z-offset", current_position); - #endif - } - -#endif // PARKING_EXTRUDER - -/** - * Perform a tool-change, which may result in moving the - * previous tool out of the way and the new tool into place. - */ -void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - planner.synchronize(); - - #if HAS_LEVELING - // Set current position to the physical position - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - mixing_tool_change(tmp_extruder); - - #else // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 - - if (tmp_extruder >= EXTRUDERS) - return invalid_extruder_error(tmp_extruder); - - #if HOTENDS > 1 - - const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s; - - feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; - - if (tmp_extruder != active_extruder) { - if (!no_move && axis_unhomed_error()) { - no_move = true; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange"); - #endif - } - - #if ENABLED(DUAL_X_CARRIAGE) - - #if HAS_SOFTWARE_ENDSTOPS - // Update the X software endstops early - active_extruder = tmp_extruder; - update_software_endstops(X_AXIS); - active_extruder = !tmp_extruder; - #endif - - // Don't move the new extruder out of bounds - if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS])) - no_move = true; - - if (!no_move) set_destination_from_current(); - dualx_tool_change(tmp_extruder, no_move); // Can modify no_move - - #else // !DUAL_X_CARRIAGE - - set_destination_from_current(); - #if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder - parking_extruder_tool_change(tmp_extruder, no_move); - #endif - - #if ENABLED(SWITCHING_NOZZLE) - // Always raise by at least 1 to avoid workpiece - const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1; - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - move_nozzle_servo(tmp_extruder); - #endif - - const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], - ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff); - SERIAL_ECHOPAIR(", ", ydiff); - SERIAL_ECHOLNPGM(" }"); - } - #endif - - // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xdiff; - current_position[Y_AXIS] += ydiff; - - // Set the new active extruder - active_extruder = tmp_extruder; - - #endif // !DUAL_X_CARRIAGE - - #if ENABLED(SWITCHING_NOZZLE) - // The newly-selected extruder Z is actually at... - current_position[Z_AXIS] -= zdiff; - #endif - - // Tell the planner the new "current position" - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DELTA) - //LOOP_XYZ(i) update_software_endstops(i); // or modify the constrain function - const bool safe_to_move = current_position[Z_AXIS] < delta_clip_start_height - 1; - #else - constexpr bool safe_to_move = true; - #endif - - // Raise, move, and lower again - if (safe_to_move && !no_move && IsRunning()) { - #if DISABLED(SWITCHING_NOZZLE) - // Do a small lift to avoid the workpiece in the move back (below) - current_position[Z_AXIS] += 1.0; - planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); - #endif - // Move back to the original (or tweaked) position - do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - } - #if ENABLED(SWITCHING_NOZZLE) - else { - // Move back down. (Including when the new tool is higher.) - do_blocking_move_to_z(destination[Z_AXIS], planner.max_feedrate_mm_s[Z_AXIS]); - } - #endif - } // (tmp_extruder != active_extruder) - - planner.synchronize(); - - #if ENABLED(EXT_SOLENOID) && !ENABLED(PARKING_EXTRUDER) - disable_all_solenoids(); - enable_solenoid_on_active_extruder(); - #endif - - feedrate_mm_s = old_feedrate_mm_s; - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(DUAL_X_CARRIAGE) - update_software_endstops(X_AXIS); - #endif - - #else // HOTENDS <= 1 - - UNUSED(fr_mm_s); - UNUSED(no_move); - - #if ENABLED(MK2_MULTIPLEXER) - if (tmp_extruder >= E_STEPPERS) - return invalid_extruder_error(tmp_extruder); - - select_multiplexed_stepper(tmp_extruder); - #endif - - // Set the new active extruder - active_extruder = tmp_extruder; - - #endif // HOTENDS <= 1 - - #if DO_SWITCH_EXTRUDER - planner.synchronize(); - move_extruder_servo(active_extruder); - #endif - - #if HAS_FANMUX - fanmux_switch(active_extruder); - #endif - - #if HAS_LEVELING - // Restore leveling to re-establish the logical position - set_bed_leveling_enabled(leveling_was_active); - #endif - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, (int)active_extruder); - - #endif // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 -} - -/** - * T0-T3: Switch tool, usually switching extruders - * - * F[units/min] Set the movement feedrate - * S1 Don't move the tool in XY after change - */ -inline void gcode_T(const uint8_t tmp_extruder) { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder); - SERIAL_CHAR(')'); - SERIAL_EOL(); - DEBUG_POS("BEFORE", current_position); - } - #endif - - #if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) - - tool_change(tmp_extruder); - - #elif HOTENDS > 1 - - tool_change( - tmp_extruder, - MMM_TO_MMS(parser.linearval('F')), - (tmp_extruder == active_extruder) || parser.boolval('S') - ); - - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - SERIAL_ECHOLNPGM("<<< gcode_T"); - } - #endif -} - -/** - * Process the parsed command and dispatch it to its handler - */ -void process_parsed_command() { - KEEPALIVE_STATE(IN_HANDLER); - - // Handle a known G, M, or T - switch (parser.command_letter) { - case 'G': switch (parser.codenum) { - - case 0: case 1: gcode_G0_G1( // G0: Fast Move, G1: Linear Move - #if IS_SCARA - parser.codenum == 0 - #endif - ); break; - - #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) - case 2: case 3: gcode_G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC - #endif - - case 4: gcode_G4(); break; // G4: Dwell - - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: gcode_G5(); break; // G5: Cubic B_spline - #endif - - #if ENABLED(FWRETRACT) - case 10: gcode_G10(); break; // G10: Retract - case 11: gcode_G11(); break; // G11: Prime - #endif - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 12: gcode_G12(); break; // G12: Clean Nozzle - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - case 17: gcode_G17(); break; // G17: Select Plane XY - case 18: gcode_G18(); break; // G18: Select Plane ZX - case 19: gcode_G19(); break; // G19: Select Plane YZ - #endif - - #if ENABLED(INCH_MODE_SUPPORT) - case 20: gcode_G20(); break; // G20: Inch Units - case 21: gcode_G21(); break; // G21: Millimeter Units - #endif - - #if ENABLED(G26_MESH_VALIDATION) - case 26: gcode_G26(); break; // G26: Mesh Validation Pattern - #endif - - #if ENABLED(NOZZLE_PARK_FEATURE) - case 27: gcode_G27(); break; // G27: Park Nozzle - #endif - - case 28: gcode_G28(false); break; // G28: Home one or more axes - - #if HAS_LEVELING - case 29: gcode_G29(); break; // G29: Detailed Z probe - #endif - - #if HAS_BED_PROBE - case 30: gcode_G30(); break; // G30: Single Z probe - #endif - - #if ENABLED(Z_PROBE_SLED) - case 31: gcode_G31(); break; // G31: Dock sled - case 32: gcode_G32(); break; // G32: Undock sled - #endif - - #if ENABLED(DELTA_AUTO_CALIBRATION) - case 33: gcode_G33(); break; // G33: Delta Auto-Calibration - #endif - - #if ENABLED(G38_PROBE_TARGET) - case 38: - if (parser.subcode == 2 || parser.subcode == 3) - gcode_G38(parser.subcode == 2); // G38.2, G38.3: Probe towards object - break; - #endif - - #if HAS_MESH - case 42: gcode_G42(); break; // G42: Move to mesh point - #endif - - case 90: relative_mode = false; break; // G90: Absolute coordinates - case 91: relative_mode = true; break; // G91: Relative coordinates - - case 92: gcode_G92(); break; // G92: Set Position - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G - #endif - - default: parser.unknown_command_error(); - } - break; - - case 'M': switch (parser.codenum) { - #if HAS_RESUME_CONTINUE - case 0: case 1: gcode_M0_M1(); break; // M0: Unconditional stop, M1: Conditional stop - #endif - - #if ENABLED(SPINDLE_LASER_ENABLE) - case 3: gcode_M3_M4(true); break; // M3: Laser/CW-Spindle Power - case 4: gcode_M3_M4(false); break; // M4: Laser/CCW-Spindle Power - case 5: gcode_M5(); break; // M5: Laser/Spindle OFF - #endif - - case 17: gcode_M17(); break; // M17: Enable all steppers - - #if ENABLED(SDSUPPORT) - case 20: gcode_M20(); break; // M20: List SD Card - case 21: gcode_M21(); break; // M21: Init SD Card - case 22: gcode_M22(); break; // M22: Release SD Card - case 23: gcode_M23(); break; // M23: Select File - case 24: gcode_M24(); break; // M24: Start SD Print - case 25: gcode_M25(); break; // M25: Pause SD Print - case 26: gcode_M26(); break; // M26: Set SD Index - case 27: gcode_M27(); break; // M27: Get SD Status - case 28: gcode_M28(); break; // M28: Start SD Write - case 29: gcode_M29(); break; // M29: Stop SD Write - case 30: gcode_M30(); break; // M30: Delete File - case 32: gcode_M32(); break; // M32: Select file, Start SD Print - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - case 33: gcode_M33(); break; // M33: Report longname path - #endif - #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) - case 34: gcode_M34(); break; // M34: Set SD card sorting options - #endif - case 928: gcode_M928(); break; // M928: Start SD write - #endif // SDSUPPORT - - case 31: gcode_M31(); break; // M31: Report print job elapsed time - - case 42: gcode_M42(); break; // M42: Change pin state - #if ENABLED(PINS_DEBUGGING) - case 43: gcode_M43(); break; // M43: Read/monitor pin and endstop states - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - case 48: gcode_M48(); break; // M48: Z probe repeatability test - #endif - #if ENABLED(G26_MESH_VALIDATION) - case 49: gcode_M49(); break; // M49: Toggle the G26 Debug Flag - #endif - - #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - case 73: gcode_M73(); break; // M73: Set Print Progress % - #endif - case 75: gcode_M75(); break; // M75: Start Print Job Timer - case 76: gcode_M76(); break; // M76: Pause Print Job Timer - case 77: gcode_M77(); break; // M77: Stop Print Job Timer - #if ENABLED(PRINTCOUNTER) - case 78: gcode_M78(); break; // M78: Report Print Statistics - #endif - - #if ENABLED(M100_FREE_MEMORY_WATCHER) - case 100: gcode_M100(); break; // M100: Free Memory Report - #endif - - case 104: gcode_M104(); break; // M104: Set Hotend Temperature - case 110: gcode_M110(); break; // M110: Set Current Line Number - case 111: gcode_M111(); break; // M111: Set Debug Flags - - #if DISABLED(EMERGENCY_PARSER) - case 108: gcode_M108(); break; // M108: Cancel Waiting - case 112: gcode_M112(); break; // M112: Emergency Stop - case 410: gcode_M410(); break; // M410: Quickstop. Abort all planned moves - #else - case 108: case 112: case 410: break; // Silently drop as handled by emergency parser - #endif - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - case 113: gcode_M113(); break; // M113: Set Host Keepalive Interval - #endif - - case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok") - - #if ENABLED(AUTO_REPORT_TEMPERATURES) - case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval - #endif - - case 109: gcode_M109(); break; // M109: Set Hotend Temperature. Wait for target. - case 1090: gcode_M1090(); break; // M109: Set Hotend Temperature. Wait for target. - - #if HAS_HEATED_BED - case 140: gcode_M140(); break; // M140: Set Bed Temperature - case 190: gcode_M190(); break; // M190: Set Bed Temperature. Wait for target. - #endif - - #if FAN_COUNT > 0 - case 106: gcode_M106(); break; // M106: Set Fan Speed - case 107: gcode_M107(); break; // M107: Fan Off - #endif - - #if ENABLED(PARK_HEAD_ON_PAUSE) - case 125: gcode_M125(); break; // M125: Park (for Filament Change) - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - case 126: gcode_M126(); break; // M126: Valve 1 Open - case 127: gcode_M127(); break; // M127: Valve 1 Closed - #endif - #if HAS_HEATER_2 - case 128: gcode_M128(); break; // M128: Valve 2 Open - case 129: gcode_M129(); break; // M129: Valve 2 Closed - #endif - #endif - - #if HAS_POWER_SWITCH - case 80: gcode_M80(); break; // M80: Turn on Power Supply - #endif - case 81: gcode_M81(); break; // M81: Turn off Power and Power Supply - - case 82: gcode_M82(); break; // M82: Disable Relative E-Axis - case 83: gcode_M83(); break; // M83: Set Relative E-Axis - case 18: case 84: gcode_M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout - case 85: gcode_M85(); break; // M85: Set inactivity stepper shutdown timeout - case 92: gcode_M92(); break; // M92: Set steps-per-unit - case 114: gcode_M114(); break; // M114: Report Current Position - case 115: gcode_M115(); break; // M115: Capabilities Report - case 117: gcode_M117(); break; // M117: Set LCD message text - case 118: gcode_M118(); break; // M118: Print a message in the host console - case 119: gcode_M119(); break; // M119: Report Endstop states - case 120: gcode_M120(); break; // M120: Enable Endstops - case 121: gcode_M121(); break; // M121: Disable Endstops - - #if ENABLED(ULTIPANEL) - case 145: gcode_M145(); break; // M145: Set material heatup parameters - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - case 149: gcode_M149(); break; // M149: Set Temperature Units, C F K - #endif - - #if HAS_COLOR_LEDS - case 150: gcode_M150(); break; // M150: Set Status LED Color - #endif - - #if ENABLED(MIXING_EXTRUDER) - case 163: gcode_M163(); break; // M163: Set Mixing Component - #if MIXING_VIRTUAL_TOOLS > 1 - case 164: gcode_M164(); break; // M164: Save Current Mix - #endif - #if ENABLED(DIRECT_MIXING_IN_G1) - case 165: gcode_M165(); break; // M165: Set Multiple Mixing Components - #endif - #endif - - #if DISABLED(NO_VOLUMETRICS) - case 200: gcode_M200(); break; // M200: Set Filament Diameter, Volumetric Extrusion - #endif - - case 201: gcode_M201(); break; // M201: Set Max Printing Acceleration (units/sec^2) - #if 0 - case 202: gcode_M202(); break; // M202: Not used for Sprinter/grbl gen6 - #endif - case 203: gcode_M203(); break; // M203: Set Max Feedrate (units/sec) - case 204: gcode_M204(); break; // M204: Set Acceleration - case 205: gcode_M205(); break; // M205: Set Advanced settings - - #if HAS_M206_COMMAND - case 206: gcode_M206(); break; // M206: Set Home Offsets - case 428: gcode_M428(); break; // M428: Set Home Offsets based on current position - #endif - - #if ENABLED(FWRETRACT) - case 207: gcode_M207(); break; // M207: Set Retract Length, Feedrate, Z lift - case 208: gcode_M208(); break; // M208: Set Additional Prime Length and Feedrate - case 209: - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) gcode_M209(); // M209: Turn Auto-Retract on/off - break; - #endif - - case 211: gcode_M211(); break; // M211: Enable/Disable/Report Software Endstops - - #if HOTENDS > 1 - case 218: gcode_M218(); break; // M218: Set Tool Offset - #endif - - case 220: gcode_M220(); break; // M220: Set Feedrate Percentage - case 221: gcode_M221(); break; // M221: Set Flow Percentage - case 226: gcode_M226(); break; // M226: Wait for Pin State - - #if defined(CHDK) || HAS_PHOTOGRAPH - case 240: gcode_M240(); break; // M240: Trigger Camera - #endif - - #if HAS_LCD_CONTRAST - case 250: gcode_M250(); break; // M250: Set LCD Contrast - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) - case 260: gcode_M260(); break; // M260: Send Data to i2c slave - case 261: gcode_M261(); break; // M261: Request Data from i2c slave - #endif - - #if HAS_SERVOS - case 280: gcode_M280(); break; // M280: Set Servo Position - #endif - - #if ENABLED(BABYSTEPPING) - case 290: gcode_M290(); break; // M290: Babystepping - #endif - - #if HAS_BUZZER - case 300: gcode_M300(); break; // M300: Add Tone/Buzz to Queue - #endif - - #if ENABLED(PIDTEMP) - case 301: gcode_M301(); break; // M301: Set Hotend PID parameters - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - case 302: gcode_M302(); break; // M302: Set Minimum Extrusion Temp - #endif - - case 303: gcode_M303(); break; // M303: PID Autotune - - #if ENABLED(PIDTEMPBED) - case 304: gcode_M304(); break; // M304: Set Bed PID parameters - #endif - - #if HAS_MICROSTEPS - case 350: gcode_M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - case 351: gcode_M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - #endif - - case 355: gcode_M355(); break; // M355: Set Case Light brightness - - #if ENABLED(MORGAN_SCARA) - case 360: if (gcode_M360()) return; break; // M360: SCARA Theta pos1 - case 361: if (gcode_M361()) return; break; // M361: SCARA Theta pos2 - case 362: if (gcode_M362()) return; break; // M362: SCARA Psi pos1 - case 363: if (gcode_M363()) return; break; // M363: SCARA Psi pos2 - case 364: if (gcode_M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) - #endif - - case 400: gcode_M400(); break; // M400: Synchronize. Wait for moves to finish. - - #if HAS_BED_PROBE - case 401: gcode_M401(); break; // M401: Deploy Probe - case 402: gcode_M402(); break; // M402: Stow Probe - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - case 404: gcode_M404(); break; // M404: Set/Report Nominal Filament Width - case 405: gcode_M405(); break; // M405: Enable Filament Width Sensor - case 406: gcode_M406(); break; // M406: Disable Filament Width Sensor - case 407: gcode_M407(); break; // M407: Report Measured Filament Width - #endif - - #if HAS_LEVELING - case 420: gcode_M420(); break; // M420: Set Bed Leveling Enabled / Fade - #endif - - #if HAS_MESH - case 421: gcode_M421(); break; // M421: Set a Mesh Z value - #endif - - case 500: gcode_M500(); break; // M500: Store Settings in EEPROM - case 501: gcode_M501(); break; // M501: Read Settings from EEPROM - case 502: gcode_M502(); break; // M502: Revert Settings to defaults - #if DISABLED(DISABLE_M503) - case 503: gcode_M503(); break; // M503: Report Settings (in SRAM) - #endif - #if ENABLED(EEPROM_SETTINGS) - case 504: gcode_M504(); break; // M504: Validate EEPROM - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - case 540: gcode_M540(); break; // M540: Set Abort on Endstop Hit for SD Printing - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case 600: gcode_M600(); break; // M600: Pause for Filament Change - case 603: gcode_M603(); break; // M603: Configure Filament Change - #endif - - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - case 605: gcode_M605(); break; // M605: Set Dual X Carriage movement mode - #endif - - #if ENABLED(DELTA) - case 665: gcode_M665(); break; // M665: Delta Configuration - #endif - #if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - case 666: gcode_M666(); break; // M666: DELTA/Dual Endstop Adjustment - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - case 701: gcode_M701(); break; // M701: Load Filament - case 702: gcode_M702(); break; // M702: Unload Filament - #endif - - #if ENABLED(MAX7219_GCODE) - case 7219: gcode_M7219(); break; // M7219: Set LEDs, columns, and rows - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M - #endif - - #if HAS_BED_PROBE - case 851: gcode_M851(); break; // M851: Set Z Probe Z Offset - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - case 852: gcode_M852(); break; // M852: Set Skew factors - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - case 860: gcode_M860(); break; // M860: Report encoder module position - case 861: gcode_M861(); break; // M861: Report encoder module status - case 862: gcode_M862(); break; // M862: Perform axis test - case 863: gcode_M863(); break; // M863: Calibrate steps/mm - case 864: gcode_M864(); break; // M864: Change module address - case 865: gcode_M865(); break; // M865: Check module firmware version - case 866: gcode_M866(); break; // M866: Report axis error count - case 867: gcode_M867(); break; // M867: Toggle error correction - case 868: gcode_M868(); break; // M868: Set error correction threshold - case 869: gcode_M869(); break; // M869: Report axis error - #endif - - #if ENABLED(LIN_ADVANCE) - case 900: gcode_M900(); break; // M900: Set Linear Advance K factor - #endif - - case 907: gcode_M907(); break; // M907: Set Digital Trimpot Motor Current using axis codes. - - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - case 908: gcode_M908(); break; // M908: Direct Control Digital Trimpot - #if ENABLED(DAC_STEPPER_CURRENT) - case 909: gcode_M909(); break; // M909: Print Digipot/DAC current value (As with Printrbot RevF) - case 910: gcode_M910(); break; // M910: Commit Digipot/DAC value to External EEPROM (As with Printrbot RevF) - #endif - #endif - - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) - #if ENABLED(TMC_DEBUG) - case 122: gcode_M122(); break; // M122: Debug TMC steppers - #endif - case 906: gcode_M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E - case 911: gcode_M911(); break; // M911: Report TMC prewarn triggered flags - case 912: gcode_M912(); break; // M911: Clear TMC prewarn triggered flags - #if ENABLED(HYBRID_THRESHOLD) - case 913: gcode_M913(); break; // M913: Set HYBRID_THRESHOLD speed. - #endif - #if ENABLED(SENSORLESS_HOMING) - case 914: gcode_M914(); break; // M914: Set SENSORLESS_HOMING sensitivity. - #endif - #if ENABLED(TMC_Z_CALIBRATION) - case 915: gcode_M915(); break; // M915: TMC Z axis calibration routine - #endif - #endif - - case 999: gcode_M999(); break; // M999: Restart after being Stopped - - default: parser.unknown_command_error(); - } - break; - - case 'T': gcode_T(parser.codenum); break; // T: Tool Select - - default: parser.unknown_command_error(); - } - - KEEPALIVE_STATE(NOT_BUSY); - ok_to_send(); -} - -void process_next_command() { - char * const current_command = command_queue[cmd_queue_index_r]; - - if (DEBUGGING(ECHO)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLN(current_command); - #if ENABLED(M100_FREE_MEMORY_WATCHER) - SERIAL_ECHOPAIR("slot:", cmd_queue_index_r); - M100_dump_routine(" Command Queue:", (const char*)command_queue, (const char*)(command_queue + sizeof(command_queue))); - #endif - } - - // Parse the next command in the queue - parser.parse(current_command); - process_parsed_command(); -} - -/** - * Send a "Resend: nnn" message to the host to - * indicate that a command needs to be re-sent. - */ -void flush_and_request_resend() { - //char command_queue[cmd_queue_index_r][100]="Resend:"; - SERIAL_FLUSH(); - SERIAL_PROTOCOLPGM(MSG_RESEND); - SERIAL_PROTOCOLLN(gcode_LastN + 1); - ok_to_send(); -} - -/** - * Send an "ok" message to the host, indicating - * that a command was successfully processed. - * - * If ADVANCED_OK is enabled also include: - * N Line number of the command, if any - * P Planner space remaining - * B Block queue space remaining - */ -void ok_to_send() { - if (!send_ok[cmd_queue_index_r]) return; - SERIAL_PROTOCOLPGM(MSG_OK); - #if ENABLED(ADVANCED_OK) - char* p = command_queue[cmd_queue_index_r]; - if (*p == 'N') { - SERIAL_PROTOCOL(' '); - SERIAL_ECHO(*p++); - while (NUMERIC_SIGNED(*p)) - SERIAL_ECHO(*p++); - } - SERIAL_PROTOCOLPGM(" P"); SERIAL_PROTOCOL(int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); - SERIAL_PROTOCOLPGM(" B"); SERIAL_PROTOCOL(BUFSIZE - commands_in_queue); - #endif - SERIAL_EOL(); -} - -#if HAS_SOFTWARE_ENDSTOPS - - /** - * Constrain the given coordinates to the software endstops. - * - * For DELTA/SCARA the XY constraint is based on the smallest - * radius within the set software endstops. - */ - void clamp_to_software_endstops(float target[XYZ]) { - if (!soft_endstops_enabled) return; - #if IS_KINEMATIC - const float dist_2 = HYPOT2(target[X_AXIS], target[Y_AXIS]); - if (dist_2 > soft_endstop_radius_2) { - const float ratio = soft_endstop_radius / SQRT(dist_2); // 200 / 300 = 0.66 - target[X_AXIS] *= ratio; - target[Y_AXIS] *= ratio; - } - #else - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]); - #endif - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]); - #endif - #endif - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]); - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]); - #endif - } - -#endif - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - // Get the Z adjustment for non-linear bed leveling - float bilinear_z_offset(const float raw[XYZ]) { - - static float z1, d2, z3, d4, L, D, ratio_x, ratio_y, - last_x = -999.999, last_y = -999.999; - - // Whole units for the grid line indices. Constrained within bounds. - static int8_t gridx, gridy, nextx, nexty, - last_gridx = -99, last_gridy = -99; - - // XY relative to the probed area - const float rx = raw[X_AXIS] - bilinear_start[X_AXIS], - 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 - #else - // Just use the grid far edge - #define FAR_EDGE_OR_BOX 1 - #endif - - if (last_x != rx) { - last_x = rx; - ratio_x = rx * ABL_BG_FACTOR(X_AXIS); - const float gx = constrain(FLOOR(ratio_x), 0, ABL_BG_POINTS_X - FAR_EDGE_OR_BOX); - ratio_x -= gx; // Subtract whole to get the ratio within the grid box - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio_x, 0); // Never < 0.0. (> 1.0 is ok when nextx==gridx.) - #endif - - gridx = gx; - nextx = MIN(gridx + 1, ABL_BG_POINTS_X - 1); - } - - if (last_y != ry || last_gridx != gridx) { - - if (last_y != ry) { - last_y = ry; - ratio_y = ry * ABL_BG_FACTOR(Y_AXIS); - const float gy = constrain(FLOOR(ratio_y), 0, ABL_BG_POINTS_Y - FAR_EDGE_OR_BOX); - ratio_y -= gy; - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio_y, 0); // Never < 0.0. (> 1.0 is ok when nexty==gridy.) - #endif - - gridy = gy; - nexty = MIN(gridy + 1, ABL_BG_POINTS_Y - 1); - } - - if (last_gridx != gridx || last_gridy != gridy) { - last_gridx = gridx; - last_gridy = gridy; - // Z at the box corners - z1 = ABL_BG_GRID(gridx, gridy); // left-front - d2 = ABL_BG_GRID(gridx, nexty) - z1; // left-back (delta) - z3 = ABL_BG_GRID(nextx, gridy); // right-front - d4 = ABL_BG_GRID(nextx, nexty) - z3; // right-back (delta) - } - - // Bilinear interpolate. Needed since ry or gridx has changed. - L = z1 + d2 * ratio_y; // Linear interp. LF -> LB - const float R = z3 + d4 * ratio_y; // Linear interp. RF -> RB - - D = R - L; - } - - const float offset = L + ratio_x * D; // the offset almost always changes - - /* - static float last_offset = 0; - if (ABS(last_offset - offset) > 0.2) { - SERIAL_ECHOPGM("Sudden Shift at "); - SERIAL_ECHOPAIR("x=", rx); - SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[X_AXIS]); - SERIAL_ECHOLNPAIR(" -> gridx=", gridx); - SERIAL_ECHOPAIR(" y=", ry); - SERIAL_ECHOPAIR(" / ", bilinear_grid_spacing[Y_AXIS]); - SERIAL_ECHOLNPAIR(" -> gridy=", gridy); - SERIAL_ECHOPAIR(" ratio_x=", ratio_x); - SERIAL_ECHOLNPAIR(" ratio_y=", ratio_y); - SERIAL_ECHOPAIR(" z1=", z1); - SERIAL_ECHOPAIR(" z2=", z2); - SERIAL_ECHOPAIR(" z3=", z3); - SERIAL_ECHOLNPAIR(" z4=", z4); - SERIAL_ECHOPAIR(" L=", L); - SERIAL_ECHOPAIR(" R=", R); - SERIAL_ECHOLNPAIR(" offset=", offset); - } - last_offset = offset; - //*/ - - return offset; - } - -#endif // AUTO_BED_LEVELING_BILINEAR - -#if ENABLED(DELTA) - - /** - * Recalculate factors used for delta kinematics whenever - * settings have been changed (e.g., by M665). - */ - void recalc_delta_settings() { - const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER, - drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER; - delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); // front left tower - delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); - delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); // front right tower - delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); - delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); // back middle tower - delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); - delta_diagonal_rod_2_tower[A_AXIS] = sq(delta_diagonal_rod + drt[A_AXIS]); - delta_diagonal_rod_2_tower[B_AXIS] = sq(delta_diagonal_rod + drt[B_AXIS]); - delta_diagonal_rod_2_tower[C_AXIS] = sq(delta_diagonal_rod + drt[C_AXIS]); - update_software_endstops(Z_AXIS); - axis_homed = 0; - } - - /** - * Delta Inverse Kinematics - * - * Calculate the tower positions for a given machine - * position, storing the result in the delta[] array. - * - * This is an expensive calculation, requiring 3 square - * roots per segmented linear move, and strains the limits - * of a Mega2560 with a Graphical Display. - * - * Suggested optimizations include: - * - * - Disable the home_offset (M206) and/or position_shift (G92) - * features to remove up to 12 float additions. - */ - - #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]); \ - }while(0) - - void inverse_kinematics(const float raw[XYZ]) { - #if HOTENDS > 1 - // Delta hotend offsets must be applied in Cartesian space with no "spoofing" - const float pos[XYZ] = { - raw[X_AXIS] - hotend_offset[X_AXIS][active_extruder], - raw[Y_AXIS] - hotend_offset[Y_AXIS][active_extruder], - raw[Z_AXIS] - }; - DELTA_IK(pos); - //DELTA_DEBUG(pos); - #else - DELTA_IK(raw); - //DELTA_DEBUG(raw); - #endif - } - - /** - * Calculate the highest Z position where the - * effector has the full range of XY motion. - */ - float delta_safe_distance_from_top() { - float cartesian[XYZ] = { 0, 0, 0 }; - inverse_kinematics(cartesian); - const float centered_extent = delta[A_AXIS]; - cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; - inverse_kinematics(cartesian); - return ABS(centered_extent - delta[A_AXIS]); - } - - /** - * Delta Forward Kinematics - * - * See the Wikipedia article "Trilateration" - * https://en.wikipedia.org/wiki/Trilateration - * - * Establish a new coordinate system in the plane of the - * three carriage points. This system has its origin at - * tower1, with tower2 on the X axis. Tower3 is in the X-Y - * plane with a Z component of zero. - * We will define unit vectors in this coordinate system - * in our original coordinate system. Then when we calculate - * the Xnew, Ynew and Znew values, we can translate back into - * the original system by moving along those unit vectors - * by the corresponding values. - * - * Variable names matched to Marlin, c-version, and avoid the - * use of any vector library. - * - * by Andreas Hardtung 2016-06-07 - * based on a Java function from "Delta Robot Kinematics V3" - * by Steve Graves - * - * The result is stored in the cartes[] array. - */ - void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { - // Create a vector in old coordinates along x axis of new coordinate - const float p12[] = { - delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], - delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], - z2 - z1 - }, - - // Get the reciprocal of Magnitude of vector. - d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), - - // Create unit vector by multiplying by the inverse of the magnitude. - ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, - - // Get the vector from the origin of the new system to the third point. - p13[3] = { - delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], - delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], - z3 - z1 - }, - - // Use the dot product to find the component of this vector on the X axis. - i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2], - - // Create a vector along the x axis that represents the x component of p13. - iex[] = { ex[0] * i, ex[1] * i, ex[2] * i }; - - // Subtract the X component from the original vector leaving only Y. We use the - // variable that will be the unit vector after we scale it. - float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2] }; - - // The magnitude and the inverse of the magnitude of Y component - const float j2 = sq(ey[0]) + sq(ey[1]) + sq(ey[2]), inv_j = RSQRT(j2); - - // Convert to a unit vector - ey[0] *= inv_j; ey[1] *= inv_j; ey[2] *= inv_j; - - // The cross product of the unit x and y is the unit z - // float[] ez = vectorCrossProd(ex, ey); - const float ez[3] = { - ex[1] * ey[2] - ex[2] * ey[1], - ex[2] * ey[0] - ex[0] * ey[2], - ex[0] * ey[1] - ex[1] * ey[0] - }, - // We now have the d, i and j values defined in Wikipedia. - // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew - Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + d2) * inv_d * 0.5, - Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, - Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); - - // Start from the origin of the old coordinates and add vectors in the - // old coords that represent the Xnew, Ynew and Znew to find the point - // in the old system. - cartes[X_AXIS] = delta_tower[A_AXIS][X_AXIS] + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew; - cartes[Y_AXIS] = delta_tower[A_AXIS][Y_AXIS] + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew; - cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew; - } - - void forward_kinematics_DELTA(const float (&point)[ABC]) { - forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]); - } - -#endif // DELTA - -/** - * Get the stepper positions in the cartes[] array. - * Forward kinematics are applied for DELTA and SCARA. - * - * The result is in the current coordinate space with - * leveling applied. The coordinates need to be run through - * unapply_leveling to obtain machine coordinates suitable - * for current_position, etc. - */ -void get_cartesian_from_steppers() { - #if ENABLED(DELTA) - forward_kinematics_DELTA( - planner.get_axis_position_mm(A_AXIS), - planner.get_axis_position_mm(B_AXIS), - planner.get_axis_position_mm(C_AXIS) - ); - #else - #if IS_SCARA - forward_kinematics_SCARA( - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - ); - #else - cartes[X_AXIS] = planner.get_axis_position_mm(X_AXIS); - cartes[Y_AXIS] = planner.get_axis_position_mm(Y_AXIS); - #endif - cartes[Z_AXIS] = planner.get_axis_position_mm(Z_AXIS); - #endif -} - -/** - * Set the current_position for an axis based on - * the stepper positions, removing any leveling that - * may have been applied. - * - * To prevent small shifts in axis position always call - * SYNC_PLAN_POSITION_KINEMATIC after updating axes with this. - * - * To keep hosts in sync, always call report_current_position - * after updating the current_position. - */ -void set_current_from_steppers_for_axis(const AxisEnum axis) { - get_cartesian_from_steppers(); - #if PLANNER_LEVELING - planner.unapply_leveling(cartes); - #endif - if (axis == ALL_AXES) - COPY(current_position, cartes); - else - current_position[axis] = cartes[axis]; -} - -#if IS_CARTESIAN -#if ENABLED(SEGMENT_LEVELED_MOVES) - - /** - * Prepare a segmented move on a CARTESIAN setup. - * - * This calls planner.buffer_line several times, adding - * 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) { - - 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_kinematic(destination, fr_mm_s, active_extruder); - return; - } - - // Remaining cartesian distances - const float zdiff = destination[Z_AXIS] - current_position[Z_AXIS], - ediff = destination[E_AXIS] - current_position[E_AXIS]; - - // Get the linear distance in XYZ - // If the move is very short, check the E move distance - // No E move either? Game over. - float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); - if (UNEAR_ZERO(cartesian_mm)) return; - - // The length divided by the segment size - // At least one segment is required - uint16_t segments = cartesian_mm / segment_size; - NOLESS(segments, 1); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments, - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }; - - // SERIAL_ECHOPAIR("mm=", cartesian_mm); - // SERIAL_ECHOLNPAIR(" segments=", segments); - // SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); - - // Get the raw current position as starting point - float raw[XYZE]; - COPY(raw, current_position); - - // Calculate and execute the segments - while (--segments) { - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - LOOP_XYZE(i) raw[i] += segment_distance[i]; - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder, cartesian_segment_mm)) - break; - } - - // Since segment_distance is only approximate, - // the final move must be to the exact destination. - planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder, cartesian_segment_mm); - } - -#elif ENABLED(MESH_BED_LEVELING) - - /** - * Prepare a mesh-leveled linear move in a Cartesian setup, - * splitting the move where it crosses mesh borders. - */ - void mesh_line_to_destination(const float fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF) { - // Get current and destination cells for this line - int cx1 = mbl.cell_index_x(current_position[X_AXIS]), - cy1 = mbl.cell_index_y(current_position[Y_AXIS]), - cx2 = mbl.cell_index_x(destination[X_AXIS]), - cy2 = mbl.cell_index_y(destination[Y_AXIS]); - NOMORE(cx1, GRID_MAX_POINTS_X - 2); - NOMORE(cy1, GRID_MAX_POINTS_Y - 2); - NOMORE(cx2, GRID_MAX_POINTS_X - 2); - NOMORE(cy2, GRID_MAX_POINTS_Y - 2); - - // 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(); - return; - } - - #define MBL_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - - float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { - // Split on the X grid line - CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = mbl.index_to_xpos[gcx]; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = MBL_SEGMENT_END(Y); - } - // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { - // Split on the Y grid line - CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = mbl.index_to_ypos[gcy]; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = MBL_SEGMENT_END(X); - } - else { - // Must already have been split on these border(s) - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); - return; - } - - destination[Z_AXIS] = MBL_SEGMENT_END(Z); - destination[E_AXIS] = MBL_SEGMENT_END(E); - - // Do the split and look for more borders - mesh_line_to_destination(fr_mm_s, x_splits, y_splits); - - // Restore destination from stack - COPY(destination, end); - mesh_line_to_destination(fr_mm_s, x_splits, y_splits); - } - -#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - #define CELL_INDEX(A,V) ((V - bilinear_start[_AXIS(A)]) * ABL_BG_FACTOR(_AXIS(A))) - - /** - * 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=0xFFFF, uint16_t y_splits=0xFFFF) { - // 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]), - cx2 = CELL_INDEX(X, destination[X_AXIS]), - cy2 = CELL_INDEX(Y, destination[Y_AXIS]); - cx1 = constrain(cx1, 0, ABL_BG_POINTS_X - 2); - cy1 = constrain(cy1, 0, ABL_BG_POINTS_Y - 2); - cx2 = constrain(cx2, 0, ABL_BG_POINTS_X - 2); - cy2 = constrain(cy2, 0, ABL_BG_POINTS_Y - 2); - - // 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(); - return; - } - - #define LINE_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) - - float normalized_dist, end[XYZE]; - const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2); - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { - // Split on the X grid line - CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = LINE_SEGMENT_END(Y); - } - // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { - // Split on the Y grid line - CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = LINE_SEGMENT_END(X); - } - else { - // Must already have been split on these border(s) - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); - return; - } - - destination[Z_AXIS] = LINE_SEGMENT_END(Z); - 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); - - // Restore destination from stack - COPY(destination, end); - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); - } - -#endif // AUTO_BED_LEVELING_BILINEAR -#endif // IS_CARTESIAN - -#if !UBL_SEGMENTED -#if IS_KINEMATIC - - #if IS_SCARA - /** - * Before raising this value, use M665 S[seg_per_sec] to decrease - * the number of segments-per-second. Default is 200. Some deltas - * do better with 160 or lower. It would be good to know how many - * segments-per-second are actually possible for SCARA on AVR. - * - * Longer segments result in less kinematic overhead - * but may produce jagged lines. Try 0.5mm, 1.0mm, and 2.0mm - * and compare the difference. - */ - #define SCARA_MIN_SEGMENT_LENGTH 0.5f - #endif - - /** - * Prepare a linear move in a DELTA or SCARA setup. - * - * This calls planner.buffer_line several times, adding - * small incremental moves for DELTA or SCARA. - * - * For Unified Bed Leveling (Delta or Segmented Cartesian) - * the ubl.prepare_segmented_line_to method replaces this. - */ - inline bool prepare_kinematic_move_to(const float (&rtarget)[XYZE]) { - - // Get the top feedrate of the move in the XY plane - const float _feedrate_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]; - - // If the move is only in Z/E don't split up the move - if (!xdiff && !ydiff) { - planner.buffer_line_kinematic(rtarget, _feedrate_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; - - // Remaining cartesian distances - const float zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], - ediff = rtarget[E_AXIS] - current_position[E_AXIS]; - - // Get the linear distance in XYZ - // If the move is very short, check the E move distance - // No E move either? Game over. - float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); - if (UNEAR_ZERO(cartesian_mm)) return true; - - // Minimum number of seconds to move the given distance - const float seconds = cartesian_mm / _feedrate_mm_s; - - // The number of segments-per-second times the duration - // gives the number of segments - uint16_t segments = delta_segments_per_second * seconds; - - // For SCARA enforce a minimum segment size - #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); - #endif - - // At least one segment is required - NOLESS(segments, 1); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }; - - #if !HAS_FEEDRATE_SCALING - const float cartesian_segment_mm = cartesian_mm * inv_segments; - #endif - - /* - SERIAL_ECHOPAIR("mm=", cartesian_mm); - SERIAL_ECHOPAIR(" seconds=", seconds); - SERIAL_ECHOPAIR(" segments=", segments); - #if !HAS_FEEDRATE_SCALING - SERIAL_ECHOPAIR(" segment_mm=", cartesian_segment_mm); - #endif - SERIAL_EOL(); - //*/ - - #if HAS_FEEDRATE_SCALING - // SCARA needs to scale the feed rate from mm/s to degrees/s - // i.e., Complete the angular vector in the given time. - const float segment_length = cartesian_mm * inv_segments, - inv_segment_length = 1.0f / segment_length, // 1/mm/segs - inverse_secs = inv_segment_length * _feedrate_mm_s; - - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - - /* - SERIAL_ECHOPGM("Scaled kinematic move: "); - SERIAL_ECHOPAIR(" segment_length (inv)=", segment_length); - SERIAL_ECHOPAIR(" (", inv_segment_length); - SERIAL_ECHOPAIR(") _feedrate_mm_s=", _feedrate_mm_s); - SERIAL_ECHOPAIR(" inverse_secs=", inverse_secs); - SERIAL_ECHOPAIR(" oldA=", oldA); - SERIAL_ECHOPAIR(" oldB=", oldB); - #if ENABLED(DELTA_FEEDRATE_SCALING) - SERIAL_ECHOPAIR(" oldC=", oldC); - #endif - SERIAL_EOL(); - safe_delay(5); - //*/ - #endif - - // Get the current position as starting point - float raw[XYZE]; - COPY(raw, current_position); - - // Calculate and execute the segments - while (--segments) { - - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - LOOP_XYZE(i) raw[i] += segment_distance[i]; - #if ENABLED(DELTA) && HOTENDS < 2 - DELTA_IK(raw); // Delta can inline its kinematics - #else - inverse_kinematics(raw); - #endif - - ADJUST_DELTA(raw); // Adjust Z if bed leveling is enabled - - #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. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOLNPAIR(" F", HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs * 60); - safe_delay(5); - //*/ - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) - break; - /* - SERIAL_ECHO(segments); - SERIAL_ECHOPAIR(": X=", raw[X_AXIS]); SERIAL_ECHOPAIR(" Y=", raw[Y_AXIS]); - SERIAL_ECHOPAIR(" A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOLNPAIR(" F", SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs * 60); - safe_delay(5); - //*/ - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #else - if (!planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm)) - break; - #endif - } - - // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING - inverse_kinematics(rtarget); - ADJUST_DELTA(rtarget); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) { - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], rtarget[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - /* - SERIAL_ECHOPAIR("final: A=", delta[A_AXIS]); SERIAL_ECHOPAIR(" B=", delta[B_AXIS]); SERIAL_ECHOPAIR(" C=", delta[C_AXIS]); - SERIAL_ECHOPAIR(" adiff=", delta[A_AXIS] - oldA); SERIAL_ECHOPAIR(" bdiff=", delta[B_AXIS] - oldB); SERIAL_ECHOPAIR(" cdiff=", delta[C_AXIS] - oldC); - SERIAL_ECHOLNPAIR(" F", SQRT(diff2) * inverse_secs * 60); - SERIAL_EOL(); - safe_delay(5); - //*/ - } - #else - planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm); - #endif - - return false; // caller will update current_position - } - -#else // !IS_KINEMATIC - - /** - * Prepare a linear move in a Cartesian setup. - * - * When a mesh-based leveling system is active, moves are segmented - * according to the configuration of the leveling system. - * - * Returns true if current_position[] was set to destination[] - */ - inline bool prepare_move_to_destination_cartesian() { - #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. - #elif ENABLED(SEGMENT_LEVELED_MOVES) - segmented_line_to_destination(MMS_SCALED(feedrate_mm_s)); - return false; // caller will update current_position - #else - /** - * For MBL and ABL-BILINEAR only segment moves when X or Y are involved. - * Otherwise fall through to do a direct single move. - */ - if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) { - #if ENABLED(MESH_BED_LEVELING) - mesh_line_to_destination(MMS_SCALED(feedrate_mm_s)); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s)); - #endif - return true; - } - #endif - } - #endif // HAS_MESH - - buffer_line_to_destination(MMS_SCALED(feedrate_mm_s)); - return false; // caller will update current_position - } - -#endif // !IS_KINEMATIC -#endif // !UBL_SEGMENTED - -#if ENABLED(DUAL_X_CARRIAGE) - - /** - * Unpark the carriage, if needed - */ - inline bool dual_x_carriage_unpark() { - if (active_extruder_parked) - switch (dual_x_carriage_mode) { - - case DXC_FULL_CONTROL_MODE: break; - - case DXC_AUTO_PARK_MODE: - if (current_position[E_AXIS] == destination[E_AXIS]) { - // This is a travel move (with no extrusion) - // Skip it, but keep track of the current position - // (so it can be used as the start of the next non-travel move) - if (delayed_move_time != 0xFFFFFFFFUL) { - set_current_from_destination(); - NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]); - delayed_move_time = millis(); - return true; - } - } - // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - for (uint8_t i = 0; i < 3; i++) - if (!planner.buffer_line( - i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS], - i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS], - i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS], - current_position[E_AXIS], - i == 1 ? PLANNER_XY_FEEDRATE() : planner.max_feedrate_mm_s[Z_AXIS], - active_extruder) - ) break; - delayed_move_time = 0; - active_extruder_parked = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked"); - #endif - break; - - case DXC_DUPLICATION_MODE: - if (active_extruder == 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Set planner X", inactive_extruder_x_pos); - SERIAL_ECHOLNPAIR(" ... Line to X", current_position[X_AXIS] + duplicate_extruder_x_offset); - } - #endif - // move duplicate extruder into correct duplication position. - planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - if (!planner.buffer_line( - current_position[X_AXIS] + duplicate_extruder_x_offset, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], - planner.max_feedrate_mm_s[X_AXIS], 1) - ) break; - planner.synchronize(); - SYNC_PLAN_POSITION_KINEMATIC(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Set extruder_duplication_enabled\nClear active_extruder_parked"); - #endif - } - else { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Active extruder not 0"); - #endif - } - break; - } - return false; - } - -#endif // DUAL_X_CARRIAGE - -/** - * Prepare a single move and get ready for the next one - * - * This may result in several calls to planner.buffer_line to - * do smaller moves for DELTA, SCARA, mesh moves, etc. - * - * Make sure current_position[E] and destination[E] are good - * before calling or cold/lengthy extrusion may get missed. - */ -void prepare_move_to_destination() { - clamp_to_software_endstops(destination); - - #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) - - if (!DEBUGGING(DRYRUN)) { - if (destination[E_AXIS] != current_position[E_AXIS]) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(active_extruder)) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif // PREVENT_LENGTHY_EXTRUDE - } - } - - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_unpark()) return; - #endif - - if ( - #if UBL_SEGMENTED - ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) - #elif IS_KINEMATIC - prepare_kinematic_move_to(destination) - #else - prepare_move_to_destination_cartesian() - #endif - ) return; - - set_current_from_destination(); -} - -#if ENABLED(ARC_SUPPORT) - - #if N_ARC_CORRECTION < 1 - #undef N_ARC_CORRECTION - #define N_ARC_CORRECTION 1 - #endif - - /** - * Plan an arc in 2 dimensions - * - * The arc is approximated by generating many small linear segments. - * The length of each segment is configured in MM_PER_ARC_SEGMENT (Default 1mm) - * Arcs should only be made relatively large (over 5mm), as larger arcs with - * larger segments will tend to be more efficient. Your slicer should have - * options for G2/G3 arc generation. In future these options may be GCode tunable. - */ - void plan_arc( - const float (&cart)[XYZE], // Destination position - const float (&offset)[2], // Center of rotation relative to current_position - const bool clockwise // Clockwise? - ) { - #if ENABLED(CNC_WORKSPACE_PLANES) - AxisEnum p_axis, q_axis, l_axis; - switch (workspace_plane) { - default: - case PLANE_XY: p_axis = X_AXIS; q_axis = Y_AXIS; l_axis = Z_AXIS; break; - case PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; - case PLANE_YZ: p_axis = Y_AXIS; q_axis = Z_AXIS; l_axis = X_AXIS; break; - } - #else - constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS, l_axis = Z_AXIS; - #endif - - // Radius vector from center to current location - float r_P = -offset[0], r_Q = -offset[1]; - - const float radius = HYPOT(r_P, r_Q), - center_P = current_position[p_axis] - r_P, - center_Q = current_position[q_axis] - r_Q, - rt_X = cart[p_axis] - center_P, - rt_Y = cart[q_axis] - center_Q, - linear_travel = cart[l_axis] - current_position[l_axis], - extruder_travel = cart[E_AXIS] - current_position[E_AXIS]; - - // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. - float angular_travel = ATAN2(r_P * rt_Y - r_Q * rt_X, r_P * rt_X + r_Q * rt_Y); - if (angular_travel < 0) angular_travel += RADIANS(360); - if (clockwise) angular_travel -= RADIANS(360); - - // Make a circle if the angular rotation is 0 and the target is current position - if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) - angular_travel = RADIANS(360); - - const float flat_mm = radius * angular_travel, - mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); - if (mm_of_travel < 0.001f) return; - - uint16_t segments = FLOOR(mm_of_travel / (MM_PER_ARC_SEGMENT)); - NOLESS(segments, 1); - - /** - * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector, - * and phi is the angle of rotation. Based on the solution approach by Jens Geisler. - * r_T = [cos(phi) -sin(phi); - * sin(phi) cos(phi)] * r ; - * - * For arc generation, the center of the circle is the axis of rotation and the radius vector is - * defined from the circle center to the initial position. Each line segment is formed by successive - * vector rotations. This requires only two cos() and sin() computations to form the rotation - * matrix for the duration of the entire arc. Error may accumulate from numerical round-off, since - * all double numbers are single precision on the Arduino. (True double precision will not have - * round off issues for CNC applications.) Single precision error can accumulate to be greater than - * tool precision in some cases. Therefore, arc path correction is implemented. - * - * Small angle approximation may be used to reduce computation overhead further. This approximation - * holds for everything, but very small circles and large MM_PER_ARC_SEGMENT values. In other words, - * theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large - * to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for - * numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an - * issue for CNC machines with the single precision Arduino calculations. - * - * This approximation also allows plan_arc to immediately insert a line segment into the planner - * without the initial overhead of computing cos() or sin(). By the time the arc needs to be applied - * a correction, the planner should have caught up to the lag caused by the initial plan_arc overhead. - * This is important when there are successive arc motions. - */ - // Vector rotation matrix values - float raw[XYZE]; - const float theta_per_segment = angular_travel / segments, - linear_per_segment = linear_travel / segments, - extruder_per_segment = extruder_travel / segments, - sin_T = theta_per_segment, - cos_T = 1 - 0.5f * sq(theta_per_segment); // Small angle approximation - - // Initialize the linear axis - raw[l_axis] = current_position[l_axis]; - - // Initialize the extruder axis - raw[E_AXIS] = current_position[E_AXIS]; - - const float fr_mm_s = MMS_SCALED(feedrate_mm_s); - - millis_t next_idle_ms = millis() + 200UL; - - #if HAS_FEEDRATE_SCALING - // SCARA needs to scale the feed rate from mm/s to degrees/s - const float inv_segment_length = 1.0f / (MM_PER_ARC_SEGMENT), - inverse_secs = inv_segment_length * fr_mm_s; - float oldA = planner.position_float[A_AXIS], - oldB = planner.position_float[B_AXIS] - #if ENABLED(DELTA_FEEDRATE_SCALING) - , oldC = planner.position_float[C_AXIS] - #endif - ; - #endif - - #if N_ARC_CORRECTION > 1 - int8_t arc_recalc_count = N_ARC_CORRECTION; - #endif - - for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times - - thermalManager.manage_heater(); - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - #if N_ARC_CORRECTION > 1 - if (--arc_recalc_count) { - // Apply vector rotation matrix to previous r_P / 1 - const float r_new_Y = r_P * sin_T + r_Q * cos_T; - r_P = r_P * cos_T - r_Q * sin_T; - r_Q = r_new_Y; - } - else - #endif - { - #if N_ARC_CORRECTION > 1 - arc_recalc_count = N_ARC_CORRECTION; - #endif - - // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments. - // Compute exact location by applying transformation matrix from initial radius vector(=-offset). - // To reduce stuttering, the sin and cos could be computed at different times. - // For now, compute both at the same time. - const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); - r_P = -offset[0] * cos_Ti + offset[1] * sin_Ti; - r_Q = -offset[0] * sin_Ti - offset[1] * cos_Ti; - } - - // Update raw location - raw[p_axis] = center_P + r_P; - raw[q_axis] = center_Q + r_Q; - raw[l_axis] += linear_per_segment; - raw[E_AXIS] += extruder_per_segment; - - clamp_to_software_endstops(raw); - - #if HAS_FEEDRATE_SCALING - inverse_kinematics(raw); - ADJUST_DELTA(raw); - #endif - - #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. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder)) - break; - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; - #elif ENABLED(DELTA_FEEDRATE_SCALING) - // For DELTA scale the feed rate from Effector mm/s to Carriage mm/s - // i.e., Complete the linear vector in the given time. - if (!planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], SQRT(sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC)) * inverse_secs, active_extruder)) - break; - oldA = delta[A_AXIS]; oldB = delta[B_AXIS]; oldC = delta[C_AXIS]; - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; - planner.apply_leveling(pos); - if (!planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], raw[E_AXIS], fr_mm_s, active_extruder)) - break; - #else - if (!planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder)) - break; - #endif - } - - // Ensure last segment arrives at target location. - #if HAS_FEEDRATE_SCALING - inverse_kinematics(cart); - ADJUST_DELTA(cart); - #endif - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float diff2 = HYPOT2(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], cart[Z_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - #elif ENABLED(DELTA_FEEDRATE_SCALING) - const float diff2 = sq(delta[A_AXIS] - oldA) + sq(delta[B_AXIS] - oldB) + sq(delta[C_AXIS] - oldC); - if (diff2) - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], SQRT(diff2) * inverse_secs, active_extruder); - #elif HAS_UBL_AND_CURVES - float pos[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - planner.apply_leveling(pos); - planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], cart[E_AXIS], fr_mm_s, active_extruder); - #else - planner.buffer_line_kinematic(cart, fr_mm_s, active_extruder); - #endif - - COPY(current_position, cart); - } // plan_arc - -#endif // ARC_SUPPORT - -#if ENABLED(BEZIER_CURVE_SUPPORT) - - void plan_cubic_move(const float (&cart)[XYZE], const float (&offset)[4]) { - cubic_b_spline(current_position, cart, offset, MMS_SCALED(feedrate_mm_s), active_extruder); - COPY(current_position, cart); - } - -#endif // BEZIER_CURVE_SUPPORT - -#if ENABLED(USE_CONTROLLER_FAN) - - void controllerFan() { - static millis_t lastMotorOn = 0, // Last time a motor was turned on - nextMotorCheck = 0; // Last time the state was checked - const millis_t ms = millis(); - if (ELAPSED(ms, nextMotorCheck)) { - nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.soft_pwm_amount_bed > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON - #endif - || E0_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 1 - || E1_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 2 - || E2_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 3 - || E3_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 4 - || E4_ENABLE_READ == E_ENABLE_ON - #endif - #endif - #endif - #endif - ) { - lastMotorOn = ms; //... set time to NOW so the fan will turn on - } - - // Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds - const uint8_t speed = (lastMotorOn && PENDING(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? CONTROLLERFAN_SPEED : 0; - controllerFanSpeed = speed; - - // allows digital or PWM fan output to be used (see M42 handling) - WRITE(CONTROLLER_FAN_PIN, speed); - analogWrite(CONTROLLER_FAN_PIN, speed); - } - } - -#endif // USE_CONTROLLER_FAN - -#if ENABLED(MORGAN_SCARA) - - /** - * Morgan SCARA Forward Kinematics. Results in cartes[]. - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ - void forward_kinematics_SCARA(const float &a, const float &b) { - - float a_sin = sin(RADIANS(a)) * L1, - a_cos = cos(RADIANS(a)) * L1, - b_sin = sin(RADIANS(b)) * L2, - b_cos = cos(RADIANS(b)) * L2; - - cartes[X_AXIS] = a_cos + b_cos + SCARA_OFFSET_X; //theta - cartes[Y_AXIS] = a_sin + b_sin + SCARA_OFFSET_Y; //theta+phi - - /* - SERIAL_ECHOPAIR("SCARA FK Angle a=", a); - SERIAL_ECHOPAIR(" b=", b); - SERIAL_ECHOPAIR(" a_sin=", a_sin); - SERIAL_ECHOPAIR(" a_cos=", a_cos); - SERIAL_ECHOPAIR(" b_sin=", b_sin); - SERIAL_ECHOLNPAIR(" b_cos=", b_cos); - SERIAL_ECHOPAIR(" cartes[X_AXIS]=", cartes[X_AXIS]); - SERIAL_ECHOLNPAIR(" cartes[Y_AXIS]=", cartes[Y_AXIS]); - //*/ - } - - /** - * Morgan SCARA Inverse Kinematics. Results in delta[]. - * - * See http://forums.reprap.org/read.php?185,283327 - * - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ - void inverse_kinematics(const float raw[XYZ]) { - - static float C2, S2, SK1, SK2, THETA, PSI; - - float sx = raw[X_AXIS] - SCARA_OFFSET_X, // Translate SCARA to standard X Y - sy = raw[Y_AXIS] - SCARA_OFFSET_Y; // With scaling factor. - - if (L1 == L2) - C2 = HYPOT2(sx, sy) / L1_2_2 - 1; - else - C2 = (HYPOT2(sx, sy) - (L1_2 + L2_2)) / (2.0 * L1 * L2); - - S2 = SQRT(1 - sq(C2)); - - // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End - SK1 = L1 + L2 * C2; - - // Rotated Arm2 gives the distance from Arm1 to Arm2 - SK2 = L2 * S2; - - // Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow - THETA = ATAN2(SK1, SK2) - ATAN2(sx, sy); - - // Angle of Arm2 - PSI = ATAN2(S2, C2); - - delta[A_AXIS] = DEGREES(THETA); // theta is support arm angle - delta[B_AXIS] = DEGREES(THETA + PSI); // equal to sub arm angle (inverted motor) - delta[C_AXIS] = raw[Z_AXIS]; - - /* - DEBUG_POS("SCARA IK", raw); - DEBUG_POS("SCARA IK", delta); - SERIAL_ECHOPAIR(" SCARA (x,y) ", sx); - SERIAL_ECHOPAIR(",", sy); - SERIAL_ECHOPAIR(" C2=", C2); - SERIAL_ECHOPAIR(" S2=", S2); - SERIAL_ECHOPAIR(" Theta=", THETA); - SERIAL_ECHOLNPAIR(" Phi=", PHI); - //*/ - } - -#endif // MORGAN_SCARA - -#if ENABLED(TEMP_STAT_LEDS) - - static bool red_led = false; - static millis_t next_status_led_update_ms = 0; - - void handle_status_leds(void) { - if (ELAPSED(millis(), next_status_led_update_ms)) { - next_status_led_update_ms += 500; // Update every 0.5s - float max_temp = 0.0; - #if HAS_HEATED_BED - max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed()); - #endif - HOTEND_LOOP() - max_temp = MAX3(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e)); - const bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led; - if (new_led != red_led) { - red_led = new_led; - #if PIN_EXISTS(STAT_LED_RED) - WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW); - #if PIN_EXISTS(STAT_LED_BLUE) - WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH); - #endif - #else - WRITE(STAT_LED_BLUE_PIN, new_led ? HIGH : LOW); - #endif - } - } - } - -#endif - -void enable_all_steppers() { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - enable_X(); - enable_Y(); - enable_Z(); - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); -} - -void disable_e_stepper(const uint8_t e) { - switch (e) { - case 0: disable_E0(); break; - case 1: disable_E1(); break; - case 2: disable_E2(); break; - case 3: disable_E3(); break; - case 4: disable_E4(); break; - } -} - -void disable_e_steppers() { - disable_E0(); - disable_E1(); - disable_E2(); - disable_E3(); - disable_E4(); -} - -void disable_all_steppers() { - disable_X(); - disable_Y(); - disable_Z(); - disable_e_steppers(); -} - -/** - * Manage several activities: - * - Check for Filament Runout - * - Keep the command buffer full - * - Check for maximum inactive time between commands - * - Check for maximum inactive time between stepper commands - * - Check if pin CHDK needs to go LOW - * - Check for KILL button held down - * - Check for HOME button held down - * - Check if cooling fan needs to be switched on - * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) - */ -void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.run(); - #endif - - if (commands_in_queue < BUFSIZE) get_available_commands(); - - const millis_t ms = millis(); - - if (max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time)) { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); - kill(PSTR(MSG_KILLED)); - } - - // Prevent steppers timing-out in the middle of M600 - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #define MOVE_AWAY_TEST !did_pause_print - #else - #define MOVE_AWAY_TEST true - #endif - - if (stepper_inactive_time) { - if (planner.has_blocks_queued()) - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered - else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, previous_move_ms + stepper_inactive_time)) { - #if ENABLED(DISABLE_INACTIVE_X) - disable_X(); - #endif - #if ENABLED(DISABLE_INACTIVE_Y) - disable_Y(); - #endif - #if ENABLED(DISABLE_INACTIVE_Z) - disable_Z(); - #endif - #if ENABLED(DISABLE_INACTIVE_E) - disable_e_steppers(); - #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD - if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; - #endif - } - } - - #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH - if (chdkActive && ELAPSED(ms, chdkHigh + CHDK_DELAY)) { - chdkActive = false; - WRITE(CHDK, LOW); - } - #endif - - #if HAS_KILL - - // Check if the kill button was pressed and wait just in case it was an accidental - // key kill key press - // ------------------------------------------------------------------------------- - static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; - if (!READ(KILL_PIN)) - killCount++; - else if (killCount > 0) - killCount--; - - // Exceeded threshold and we can confirm that it was not accidental - // KILL the machine - // ---------------------------------------------------------------- - if (killCount >= KILL_DELAY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_KILL_BUTTON); - kill(PSTR(MSG_KILLED)); - } - #endif - - #if HAS_HOME - // Check to see if we have to home, use poor man's debouncer - // --------------------------------------------------------- - static int homeDebounceCount = 0; // poor man's debouncing count - const int HOME_DEBOUNCE_DELAY = 2500; - if (!IS_SD_PRINTING && !READ(HOME_PIN)) { - if (!homeDebounceCount) { - enqueue_and_echo_commands_P(PSTR("G28")); - LCD_MESSAGEPGM(MSG_AUTO_HOME); - } - if (homeDebounceCount < HOME_DEBOUNCE_DELAY) - homeDebounceCount++; - else - homeDebounceCount = 0; - } - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - controllerFan(); // Check if fan should be turned on to cool stepper drivers down - #endif - - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.check(); - #endif - - #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP - && ELAPSED(ms, previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && !planner.has_blocks_queued() - ) { - #if ENABLED(SWITCHING_EXTRUDER) - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 1: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 2: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #if E_STEPPERS > 3 - case 3: oldstatus = E3_ENABLE_READ; enable_E3(); break; - #if E_STEPPERS > 4 - case 4: oldstatus = E4_ENABLE_READ; enable_E4(); break; - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #endif // !SWITCHING_EXTRUDER - - const float olde = current_position[E_AXIS]; - current_position[E_AXIS] += EXTRUDER_RUNOUT_EXTRUDE; - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder); - current_position[E_AXIS] = olde; - planner.set_e_position_mm(olde); - planner.synchronize(); - - #if ENABLED(SWITCHING_EXTRUDER) - switch (active_extruder) { - default: oldstatus = E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 4: oldstatus = E2_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - switch (active_extruder) { - case 0: E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 1: E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 2: E2_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 3 - case 3: E3_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 4 - case 4: E4_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #endif // !SWITCHING_EXTRUDER - - previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered - } - #endif // EXTRUDER_RUNOUT_PREVENT - - #if ENABLED(DUAL_X_CARRIAGE) - // handle delayed move timeout - if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) { - // travel moves have been received so enact them - delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - set_destination_from_current(); - prepare_move_to_destination(); - } - #endif - - #if ENABLED(TEMP_STAT_LEDS) - handle_status_leds(); - #endif - - #if ENABLED(MONITOR_DRIVER_STATUS) - monitor_tmc_driver(); - #endif - - planner.check_axes_activity(); -} - -/** - * Standard idle routine keeps the machine alive - */ -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - bool no_stepper_sleep/*=false*/ - #endif -) { - #if ENABLED(MAX7219_DEBUG) - max7219.idle_tasks(); - #endif - - lcd_update(); - - host_keepalive(); - - manage_inactivity( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - no_stepper_sleep - #endif - ); - - thermalManager.manage_heater(); - - #if ENABLED(PRINTCOUNTER) - print_job_timer.tick(); - #endif - - #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - buzzer.tick(); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - static millis_t i2cpem_next_update_ms; - if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { - I2CPEM.update(); - i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS; - } - #endif - - #if HAS_AUTO_REPORTING - if (!suspend_auto_report) { - #if ENABLED(AUTO_REPORT_TEMPERATURES) - thermalManager.auto_report_temperatures(); - #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); - #endif - } - #endif -} - -/** - * Kill all activity and lock the machine. - * After this the machine will need to be reset. - */ -void kill(const char* lcd_msg) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - - thermalManager.disable_all_heaters(); - disable_all_steppers(); - - #if ENABLED(ULTRA_LCD) - kill_screen(lcd_msg); - #else - UNUSED(lcd_msg); - #endif - - _delay_ms(600); // Wait a short time (allows messages to get out before shutting down. - cli(); // Stop interrupts - - _delay_ms(250); //Wait to ensure all interrupts routines stopped - thermalManager.disable_all_heaters(); //turn off heaters again - - #ifdef ACTION_ON_KILL - SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL); - #endif - - #if HAS_POWER_SWITCH - PSU_OFF(); - #endif - - suicide(); - while (1) { - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - } // Wait for reset -} - -/** - * Turn off heaters and stop the print in progress - * After a stop the machine may be resumed with M999 - */ -void stop() { - thermalManager.disable_all_heaters(); // 'unpause' taken care of in here - - #if ENABLED(PROBING_FANS_OFF) - if (fans_paused) fans_pause(false); // put things back the way they were - #endif - - if (IsRunning()) { - Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - safe_delay(350); // allow enough time for messages to get out before stopping - Running = false; - } -} - -/** - * Marlin entry-point: Set up before the program loop - * - Set up the kill pin, filament runout, power hold - * - Start the serial port - * - Print startup messages and diagnostics - * - Get EEPROM or default settings - * - Initialize managers for: - * • temperature - * • planner - * • watchdog - * • stepper - * • photo pin - * • servos - * • LCD controller - * • Digipot I2C - * • Z probe sled - * • status LEDs - */ -void setup() { - - #if ENABLED(MAX7219_DEBUG) - max7219.init(); - #endif - - #if ENABLED(DISABLE_JTAG) - // Disable JTAG on AT90USB chips to free up pins for IO - MCUCR = 0x80; - MCUCR = 0x80; - #endif - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - runout.setup(); - #endif - - setup_killpin(); - - setup_powerhold(); - - #if HAS_STEPPER_RESET - disableStepperDrivers(); - #endif - - MYSERIAL0.begin(BAUDRATE); - SERIAL_PROTOCOLLNPGM("start"); - SERIAL_ECHO_START(); - - // Prepare communication for TMC drivers - #if HAS_DRIVER(TMC2130) - tmc_init_cs_pins(); - #endif - #if HAS_DRIVER(TMC2208) - tmc2208_serial_begin(); - #endif - - // Check startup - does nothing if bootloader sets MCUSR to 0 - byte mcu = MCUSR; - if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); - if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); - if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); - if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); - if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); - MCUSR = 0; - - SERIAL_ECHOPGM(MSG_MARLIN); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION); - 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_START(); - SERIAL_ECHOLNPGM("Compiled: " __DATE__); - #endif - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_FREE_MEMORY, freeMemory()); - SERIAL_ECHOLNPAIR(MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t)*BLOCK_BUFFER_SIZE); - - // Send "ok" after commands by default - for (int8_t i = 0; i < BUFSIZE; i++) send_ok[i] = true; - - // Load data from EEPROM if available (or use defaults) - // This also updates variables in the planner, elsewhere - (void)settings.load(); - - #if HAS_M206_COMMAND - // Initialize current position based on home_offset - COPY(current_position, home_offset); - #else - ZERO(current_position); - #endif - - // Vital to init stepper/planner equivalent for current_position - SYNC_PLAN_POSITION_KINEMATIC(); - - thermalManager.init(); // Initialize temperature loop - - print_job_timer.init(); // Initial setup of print job timer - - endstops.init(); // Init endstops and pullups - - stepper.init(); // Init stepper. This enables interrupts! - - servo_init(); // Initialize all servos, stow servo probe - - #if HAS_PHOTOGRAPH - OUT_WRITE(PHOTOGRAPH_PIN, LOW); - #endif - - #if HAS_CASE_LIGHT - case_light_on = CASE_LIGHT_DEFAULT_ON; - case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; - update_case_light(); - #endif - - #if ENABLED(SPINDLE_LASER_ENABLE) - OUT_WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // init spindle to off - #if SPINDLE_DIR_CHANGE - OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // init rotation to clockwise (M3) - #endif - #if ENABLED(SPINDLE_LASER_PWM) - SET_OUTPUT(SPINDLE_LASER_PWM_PIN); - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // set to lowest speed - #endif - #endif - - #if HAS_BED_PROBE - endstops.enable_z_probe(false); - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - SET_OUTPUT(CONTROLLER_FAN_PIN); //Set pin used for driver cooling fan - #endif - - #if HAS_STEPPER_RESET - enableStepperDrivers(); - #endif - - #if ENABLED(DIGIPOT_I2C) - digipot_i2c_init(); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - dac_init(); - #endif - - #if (ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) && HAS_SOLENOID_1 - OUT_WRITE(SOL1_PIN, LOW); // turn it off - #endif - - #if HAS_HOME - SET_INPUT_PULLUP(HOME_PIN); - #endif - - #if PIN_EXISTS(STAT_LED_RED) - OUT_WRITE(STAT_LED_RED_PIN, LOW); // turn it off - #endif - - #if PIN_EXISTS(STAT_LED_BLUE) - OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off - #endif - - #if HAS_COLOR_LEDS - leds.setup(); - #endif - - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - SET_OUTPUT(RGB_LED_R_PIN); - SET_OUTPUT(RGB_LED_G_PIN); - SET_OUTPUT(RGB_LED_B_PIN); - #if ENABLED(RGBW_LED) - SET_OUTPUT(RGB_LED_W_PIN); - #endif - #endif - - #if ENABLED(MK2_MULTIPLEXER) - SET_OUTPUT(E_MUX0_PIN); - SET_OUTPUT(E_MUX1_PIN); - SET_OUTPUT(E_MUX2_PIN); - #endif - - #if HAS_FANMUX - fanmux_init(); - #endif - - lcd_init(); - lcd_reset_status(); - - #if ENABLED(SHOW_BOOTSCREEN) - lcd_bootscreen(); - #endif - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. - for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (t == i) ? 1.0 : 0.0; - - // Remaining virtual tools are 100% filament 1 - #if MIXING_STEPPERS < MIXING_VIRTUAL_TOOLS - for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (i == 0) ? 1.0 : 0.0; - #endif - - // Initialize mixing to tool 0 color - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_factor[i] = mixing_virtual_tool_mix[0][i]; - #endif - - #if ENABLED(BLTOUCH) - // Make sure any BLTouch error condition is cleared - bltouch_command(BLTOUCH_RESET); - set_bltouch_deployed(false); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.init(); - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - i2c.onReceive(i2c_on_receive); - i2c.onRequest(i2c_on_request); - #endif - - #if DO_SWITCH_EXTRUDER - move_extruder_servo(0); // Initialize extruder servo - #endif - - #if ENABLED(SWITCHING_NOZZLE) - move_nozzle_servo(0); // Initialize nozzle servo - #endif - - #if ENABLED(PARKING_EXTRUDER) - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_magnet(0); - pe_activate_magnet(1); - #else - pe_deactivate_magnet(0); - pe_deactivate_magnet(1); - #endif - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - check_print_job_recovery(); - #endif - - #if ENABLED(USE_WATCHDOG) - watchdog_init(); - #endif -#if POWER_LOSS_RECOVER_SUPER_CAP - ///////////// - pinMode(POWER_LOSS_DETECT_PIN, INPUT); - - if(recovery_detect_cap.recovery==3) - { - char tmp_d[96]; - lcd_recover_menu() ; - SERIAL_ECHOLN("resume 3"); - sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),recovery_detect_cap.Z_t,recovery_detect_cap.E_t,recovery_detect_cap.pos_t,recovery_detect_cap.T0_t,recovery_detect_cap.B_t); - SERIAL_ECHOLN(tmp_d); - sprintf_P(tmp_d,PSTR("%s,"),recovery_detect_cap.file_name); - SERIAL_ECHOLN(tmp_d); - - } - else - SERIAL_ECHOLN("resume 0"); - - -#endif -} - -/** - * The main Marlin program loop - * - * - Abort SD printing if flagged - * - Save or log commands to SD - * - Process available commands (if not saving) - * - Call heater manager - * - Call inactivity manager - * - Call endstop manager - * - Call LCD update - */ -void loop() { - - #if ENABLED(SDSUPPORT) - - card.checkautostart(); - - #if ENABLED(ULTIPANEL) - if (abort_sd_printing) { - abort_sd_printing = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - clear_command_queue(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - } - #endif - - #endif // SDSUPPORT - - if (commands_in_queue < BUFSIZE) get_available_commands(); - - - if (commands_in_queue) { - - #if ENABLED(SDSUPPORT) - - if (card.saving) { - char* command = command_queue[cmd_queue_index_r]; - if (strstr_P(command, PSTR("M29"))) { - // M29 closes the file - card.closefile(); - SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); - - #if USE_MARLINSERIAL - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOLNPAIR("Dropped bytes: ", customizedSerial.dropped()); - #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOLNPAIR("Max RX Queue Size: ", customizedSerial.rxMaxEnqueued()); - #endif - #endif - - ok_to_send(); - } - else { - // Write the string from the read buffer to SD - card.write_command(command); - if (card.logging) - process_next_command(); // The card is saving because it's logging - else - ok_to_send(); - } - } - else { - process_next_command(); - #if ENABLED(POWER_LOSS_RECOVERY) - if (card.cardOK && card.sdprinting) save_job_recovery_info(); - #endif - } - - #else - - process_next_command(); - - #endif // SDSUPPORT - - // The queue may be reset by a command handler or by code invoked by idle() within a handler - if (commands_in_queue) { - --commands_in_queue; - if (++cmd_queue_index_r >= BUFSIZE) cmd_queue_index_r = 0; - } - } -#if POWER_LOSS_RECOVER_SUPER_CAP - if((commands_in_queue==0)&&(recovery_detect_cap.recovery==1)) - { - ////////////////// - char dat_tmp[96]; - sprintf_P(dat_tmp,PSTR("M190 S%u"),recovery_detect_cap.B_t); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("M109 T0 S%u"),recovery_detect_cap.T0_t); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("G28 X")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - sprintf_P(dat_tmp,PSTR("G28 Y")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - - sprintf_P(dat_tmp,PSTR("M106 S200")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - - SBI(axis_homed, Z_AXIS); - SBI(axis_known_position, Z_AXIS); - recovery_detect_cap.recovery=2; - } - if((commands_in_queue==0)&&(recovery_detect_cap.recovery==2)) - { - char dat_tmp[96]; - sprintf(dat_tmp,"M32 S%lu !%s",recovery_detect_cap.pos_t,recovery_detect_cap.file_name); - SERIAL_ECHOLN(dat_tmp); - - - //memset(print_dir,0,sizeof(print_dir)); - recovery_detect_cap.recovery=0; - settings.power_lose_save(); - enqueue_and_echo_command(dat_tmp); - SERIAL_ECHOLN(dat_tmp); - sprintf_P(dat_tmp,PSTR("M106 S200")); - SERIAL_ECHOLN(dat_tmp); - enqueue_and_echo_command(dat_tmp); - } - - #endif - endstops.event_handler(); - idle(); -} diff --git a/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.cpp b/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.cpp deleted file mode 100644 index 2be4bfd4f1..0000000000 --- a/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * send() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - */ - -#include "MarlinConfig.h" - -#if ENABLED(MAX7219_DEBUG) - -#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory - -#include "Max7219_Debug_LEDs.h" - -#include "planner.h" -#include "stepper.h" -#include "Marlin.h" -#include "delay.h" - -Max7219 max7219; - -uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; - -#define LINE_REG(Q) (max7219_reg_digit0 + ((Q) & 0x7)) -#if _ROT == 0 || _ROT == 270 - #define _LED_BIT(Q) (7 - ((Q) & 0x7)) - #define _LED_UNIT(Q) ((Q) & ~0x7) -#else - #define _LED_BIT(Q) ((Q) & 0x7) - #define _LED_UNIT(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) -#endif -#if _ROT < 180 - #define _LED_IND(P,Q) (_LED_UNIT(P) + (Q)) -#else - #define _LED_IND(P,Q) (_LED_UNIT(P) + (7 - ((Q) & 0x7))) -#endif -#if _ROT == 0 || _ROT == 180 - #define LED_IND(X,Y) _LED_IND(X,Y) - #define LED_BIT(X,Y) _LED_BIT(X) -#elif _ROT == 90 || _ROT == 270 - #define LED_IND(X,Y) _LED_IND(Y,X) - #define LED_BIT(X,Y) _LED_BIT(Y) -#endif -#define XOR_7219(X,Y) do{ led_line[LED_IND(X,Y)] ^= _BV(LED_BIT(X,Y)); }while(0) -#define SET_7219(X,Y) do{ led_line[LED_IND(X,Y)] |= _BV(LED_BIT(X,Y)); }while(0) -#define CLR_7219(X,Y) do{ led_line[LED_IND(X,Y)] &= ~_BV(LED_BIT(X,Y)); }while(0) -#define BIT_7219(X,Y) TEST(led_line[LED_IND(X,Y)], LED_BIT(X,Y)) - -#ifdef CPU_32_BIT - #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM - #undef CRITICAL_SECTION_START - #undef CRITICAL_SECTION_END - #define CRITICAL_SECTION_START NOOP - #define CRITICAL_SECTION_END NOOP -#else - #define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR) -#endif - -void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) { - #if ENABLED(MAX7219_ERRORS) - SERIAL_ECHOPGM("??? Max7219::"); - serialprintPGM(func); - SERIAL_CHAR('('); - SERIAL_ECHO(v1); - if (v2 > 0) SERIAL_ECHOPAIR(", ", v2); - SERIAL_CHAR(')'); - SERIAL_EOL(); - #else - UNUSED(func); UNUSED(v1); UNUSED(v2); - #endif -} - -/** - * Flip the lowest n_bytes of the supplied bits: - * flipped(x, 1) flips the low 8 bits of x. - * flipped(x, 2) flips the low 16 bits of x. - * flipped(x, 3) flips the low 24 bits of x. - * flipped(x, 4) flips the low 32 bits of x. - */ -inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { - uint32_t mask = 1, outbits = 0; - for (uint8_t b = 0; b < n_bytes * 8; b++) { - outbits <<= 1; - if (bits & mask) outbits |= 1; - mask <<= 1; - } - return outbits; -} - -void Max7219::noop() { - CRITICAL_SECTION_START; - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, LOW); - for (uint8_t i = 16; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); - SIG_DELAY(); - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); - SIG_DELAY(); - } - CRITICAL_SECTION_END; -} - -void Max7219::putbyte(uint8_t data) { - CRITICAL_SECTION_START; - for (uint8_t i = 8; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); // tick - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); // tock - SIG_DELAY(); - data <<= 1; - } - CRITICAL_SECTION_END; -} - -void Max7219::pulse_load() { - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, HIGH); - SIG_DELAY(); -} - -void Max7219::send(const uint8_t reg, const uint8_t data) { - SIG_DELAY(); - CRITICAL_SECTION_START; - SIG_DELAY(); - putbyte(reg); // specify register - SIG_DELAY(); - putbyte(data); // put data - CRITICAL_SECTION_END; -} - -// Send out a single native row of bits to all units -void Max7219::refresh_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - send(LINE_REG(line), led_line[(u << 3) | (line & 0x7)]); - pulse_load(); -} - -// Send out a single native row of bits to just one unit -void Max7219::refresh_unit_line(const uint8_t line) { - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - if (u == (line >> 3)) send(LINE_REG(line), led_line[line]); else noop(); - pulse_load(); -} - -void Max7219::set(const uint8_t line, const uint8_t bits) { - led_line[line] = bits; - refresh_line(line); -} - -#if ENABLED(MAX7219_NUMERIC) - - // Draw an integer with optional leading zeros and optional decimal point - void Max7219::print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false) { - constexpr uint8_t led_numeral[10] = { 0x7E, 0x60, 0x6D, 0x79, 0x63, 0x5B, 0x5F, 0x70, 0x7F, 0x7A }, - led_decimal = 0x80, led_minus = 0x01; - - bool blank = false, neg = value < 0; - if (neg) value *= -1; - while (size--) { - const bool minus = neg && blank; - if (minus) neg = false; - send( - max7219_reg_digit0 + start + size, - minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) - ); - pulse_load(); // tell the chips to load the clocked out data - value /= 10; - if (!value && !leadzero) blank = true; - dec = false; - } - } - - // Draw a float with a decimal point and optional digits - void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) { - if (pre_size) print(start, value, pre_size, leadzero, !!post_size); - if (post_size) { - const int16_t after = ABS(value) * (10 ^ post_size); - print(start + pre_size, after, post_size, true); - } - } - -#endif // MAX7219_NUMERIC - -// Modify a single LED bit and send the changed line -void Max7219::led_set(const uint8_t x, const uint8_t y, const bool on) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_set"), x, y); - if (BIT_7219(x, y) == on) return; - XOR_7219(x, y); - refresh_line(LED_IND(x, y)); -} - -void Max7219::led_on(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_on"), x, y); - led_set(x, y, true); -} - -void Max7219::led_off(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_off"), x, y); - led_set(x, y, false); -} - -void Max7219::led_toggle(const uint8_t x, const uint8_t y) { - if (x > MAX7219_X_LEDS - 1 || y > MAX7219_Y_LEDS - 1) return error(PSTR("led_toggle"), x, y); - led_set(x, y, !BIT_7219(x, y)); -} - -void Max7219::send_row(const uint8_t row) { - #if _ROT == 0 || _ROT == 180 - refresh_line(LED_IND(0, row)); - #else - UNUSED(row); - refresh(); - #endif -} - -void Max7219::send_column(const uint8_t col) { - #if _ROT == 90 || _ROT == 270 - refresh_line(LED_IND(col, 0)); - #else - UNUSED(col); - refresh(); - #endif -} - -void Max7219::clear() { - ZERO(led_line); - refresh(); -} - -void Max7219::fill() { - memset(led_line, 0xFF, sizeof(led_line)); - refresh(); -} - -void Max7219::clear_row(const uint8_t row) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("clear_row"), row); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) CLR_7219(x, row); - send_row(row); -} - -void Max7219::clear_column(const uint8_t col) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) CLR_7219(col, y); - send_column(col); -} - -/** - * Plot the low order bits of val to the specified row of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_row(const uint8_t row, const uint32_t val) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("set_row"), row); - uint32_t mask = _BV32(MAX7219_X_LEDS - 1); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) { - if (val & mask) SET_7219(x, row); else CLR_7219(x, row); - mask >>= 1; - } - send_row(row); -} - -/** - * Plot the low order bits of val to the specified column of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_column(const uint8_t col, const uint32_t val) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - uint32_t mask = _BV32(MAX7219_Y_LEDS - 1); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) { - if (val & mask) SET_7219(col, y); else CLR_7219(col, y); - mask >>= 1; - } - send_column(col); -} - -void Max7219::set_rows_16bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_16bits"), y, val); - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #else // at least 16 bits on each row - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_16bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 4) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 3, val); val >>= 8; - set_row(y + 2, val); val >>= 8; - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #elif MAX7219_X_LEDS == 16 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 1, val); val >>= 16; - set_row(y + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_32bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_columns_16bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_columns_16bits"), x, val); - set_column(x + 0, val); val >>= 8; - set_column(x + 1, val); - #else // at least 16 bits in each column - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_columns_16bits"), x, val); - set_column(x, val); - #endif -} - -void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 4) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 3, val); val >>= 8; - set_column(x + 2, val); val >>= 8; - set_column(x + 1, val); val >>= 8; - set_column(x + 0, val); - #elif MAX7219_Y_LEDS == 16 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 1, val); val >>= 16; - set_column(x + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_rows_32bits"), x, val); - set_column(x, val); - #endif -} - -// Initialize the Max7219 -void Max7219::register_setup() { - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_scanLimit, 0x07); - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_shutdown, 0x01); // not in shutdown mode - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_displayTest, 0x00); // no display test - pulse_load(); // tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set - // range: 0x00 to 0x0F - pulse_load(); // tell the chips to load the clocked out data -} - -#ifdef MAX7219_INIT_TEST -#if MAX7219_INIT_TEST == 2 - - void Max7219::spiral(const bool on, const uint16_t del) { - constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; - int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { - led_set(px, py, on); - delay(del); - const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, MAX7219_X_LEDS-1) || !WITHIN(y, 0, MAX7219_Y_LEDS-1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; - px += way[dir]; py += way[dir + 1]; - } - } - -#else - - void Max7219::sweep(const int8_t dir, const uint16_t ms, const bool on) { - uint8_t x = dir > 0 ? 0 : MAX7219_X_LEDS-1; - for (uint8_t i = MAX7219_X_LEDS; i--; x += dir) { - set_column(x, on ? 0xFFFFFFFF : 0x00000000); - delay(ms); - } - } - -#endif -#endif // MAX7219_INIT_TEST - -void Max7219::init() { - SET_OUTPUT(MAX7219_DIN_PIN); - SET_OUTPUT(MAX7219_CLK_PIN); - OUT_WRITE(MAX7219_LOAD_PIN, HIGH); - delay(1); - - register_setup(); - - for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off - led_line[i] = 0x00; - send(max7219_reg_digit0 + i, 0); - pulse_load(); // tell the chips to load the clocked out data - } - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - spiral(true, 8); - delay(150); - spiral(false, 8); - #else - // Do an aesthetically-pleasing pattern to fully test the Max7219 module and LEDs. - // Light up and turn off columns, both forward and backward. - sweep(1, 20, true); - sweep(1, 20, false); - delay(150); - sweep(-1, 20, true); - sweep(-1, 20, false); - #endif - #endif -} - -/** - * This code demonstrates some simple debugging using a single 8x8 LED Matrix. If your feature could - * benefit from matrix display, add its code here. Very little processing is required, so the 7219 is - * ideal for debugging when realtime feedback is important but serial output can't be used. - */ - -// Apply changes to update a marker -void Max7219::mark16(const uint8_t y, const uint8_t v1, const uint8_t v2) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_off(v1 & 0x7, y + (v1 >= 8)); - led_on(v2 & 0x7, y + (v2 >= 8)); - #else - led_off(y, v1 & 0xF); // At least 16 LEDs down. Use a single column. - led_on(y, v2 & 0xF); - #endif - #else - led_off(v1 & 0xF, y); // At least 16 LEDs across. Use a single row. - led_on(v2 & 0xF, y); - #endif -} - -// Apply changes to update a tail-to-head range -void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh) { - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0x7, y + (n >= 8)); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0x7, y + (n >= 8)); - #else // The Max7219 Y-Axis has at least 16 LED's. So use a single column - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(y, n & 0xF); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(y, n & 0xF); - #endif - #else // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0xF, y); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0xF, y); - #endif -} - -// Apply changes to update a quantity -void Max7219::quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) { - for (uint8_t i = MIN(nv, ov); i < MAX(nv, ov); i++) - #if MAX7219_X_LEDS == 8 - #if MAX7219_Y_LEDS == 8 - led_set(i >> 1, y + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's - #else - led_set(y, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column - #endif - #else - led_set(i, y, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's - #endif -} - -void Max7219::idle_tasks() { - #define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #if MAX7219_USE_HEAD || MAX7219_USE_TAIL - CRITICAL_SECTION_START; - #if MAX7219_USE_HEAD - const uint8_t head = planner.block_buffer_head; - #endif - #if MAX7219_USE_TAIL - const uint8_t tail = planner.block_buffer_tail; - #endif - CRITICAL_SECTION_END; - #endif - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - static uint8_t refresh_cnt; // = 0 - constexpr uint16_t refresh_limit = 5; - static millis_t next_blink = 0; - const millis_t ms = millis(); - const bool do_blink = ELAPSED(ms, next_blink); - #else - static uint16_t refresh_cnt; // = 0 - constexpr bool do_blink = true; - constexpr uint16_t refresh_limit = 50000; - #endif - - // Some Max7219 units are vulnerable to electrical noise, especially - // with long wires next to high current wires. If the display becomes - // corrupted, this will fix it within a couple seconds. - if (do_blink && ++refresh_cnt >= refresh_limit) { - refresh_cnt = 0; - register_setup(); - } - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - if (do_blink) { - led_toggle(MAX7219_X_LEDS - 1, MAX7219_Y_LEDS - 1); - next_blink = ms + 1000; - } - #endif - - #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL - - static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; - - if (last_head_cnt != head || last_tail_cnt != tail) { - range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head); - last_head_cnt = head; - last_tail_cnt = tail; - } - - #else - - #ifdef MAX7219_DEBUG_PLANNER_HEAD - static int16_t last_head_cnt = 0x1; - if (last_head_cnt != head) { - mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head); - last_head_cnt = head; - } - #endif - - #ifdef MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_tail_cnt = 0x1; - if (last_tail_cnt != tail) { - mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail); - last_tail_cnt = tail; - } - #endif - - #endif - - #ifdef MAX7219_DEBUG_PLANNER_QUEUE - static int16_t last_depth = 0; - const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF; - if (current_depth != last_depth) { - quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth); - last_depth = current_depth; - } - #endif -} - -#endif // MAX7219_DEBUG diff --git a/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.h b/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.h deleted file mode 100644 index 3523eef40f..0000000000 --- a/Marlin_thinkerV2/Marlin/Max7219_Debug_LEDs.h +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * max7219.init() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - * - * If you are using the Max7219 matrix for firmware debug purposes in time sensitive - * areas of the code, please be aware that the orientation (rotation) of the display can - * affect the speed. The Max7219 can update a single column fairly fast. It is much - * faster to do a Max7219_Set_Column() with a rotation of 90 or 270 degrees than to do - * a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees. - */ -#pragma once - -#ifndef MAX7219_ROTATE - #define MAX7219_ROTATE 0 -#endif -#define _ROT ((MAX7219_ROTATE + 360) % 360) - -#define MAX7219_LINES (8 * (MAX7219_NUMBER_UNITS)) - -#if _ROT == 0 || _ROT == 180 - #define MAX7219_Y_LEDS 8 - #define MAX7219_X_LEDS MAX7219_LINES -#elif _ROT == 90 || _ROT == 270 - #define MAX7219_X_LEDS 8 - #define MAX7219_Y_LEDS MAX7219_LINES -#else - #error "MAX7219_ROTATE must be a multiple of +/- 90°." -#endif - -// -// MAX7219 registers -// -#define max7219_reg_noop 0x00 -#define max7219_reg_digit0 0x01 -#define max7219_reg_digit1 0x02 -#define max7219_reg_digit2 0x03 -#define max7219_reg_digit3 0x04 -#define max7219_reg_digit4 0x05 -#define max7219_reg_digit5 0x06 -#define max7219_reg_digit6 0x07 -#define max7219_reg_digit7 0x08 - -#define max7219_reg_decodeMode 0x09 -#define max7219_reg_intensity 0x0A -#define max7219_reg_scanLimit 0x0B -#define max7219_reg_shutdown 0x0C -#define max7219_reg_displayTest 0x0F - -class Max7219 { -public: - static uint8_t led_line[MAX7219_LINES]; - - Max7219() { } - - static void init(); - static void register_setup(); - static void putbyte(uint8_t data); - static void pulse_load(); - - // Set a single register (e.g., a whole native row) - static void send(const uint8_t reg, const uint8_t data); - - // Refresh all units - inline static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } - - // Update a single native line on all units - static void refresh_line(const uint8_t line); - - // Update a single native line on just one unit - static void refresh_unit_line(const uint8_t line); - - // Set a single LED by XY coordinate - static void led_set(const uint8_t x, const uint8_t y, const bool on); - static void led_on(const uint8_t x, const uint8_t y); - static void led_off(const uint8_t x, const uint8_t y); - static void led_toggle(const uint8_t x, const uint8_t y); - - // Set all LEDs in a single column - static void set_column(const uint8_t col, const uint32_t val); - static void clear_column(const uint8_t col); - - // Set all LEDs in a single row - static void set_row(const uint8_t row, const uint32_t val); - static void clear_row(const uint8_t row); - - // 16 and 32 bit versions of Row and Column functions - // Multiple rows and columns will be used to display the value if - // the array of matrix LED's is too narrow to accomplish the goal - static void set_rows_16bits(const uint8_t y, uint32_t val); - static void set_rows_32bits(const uint8_t y, uint32_t val); - static void set_columns_16bits(const uint8_t x, uint32_t val); - static void set_columns_32bits(const uint8_t x, uint32_t val); - - // Quickly clear the whole matrix - static void clear(); - - // Quickly fill the whole matrix - static void fill(); - - // Apply custom code to update the matrix - static void idle_tasks(); - -private: - static void error(const char * const func, const int32_t v1, const int32_t v2=-1); - static void noop(); - static void set(const uint8_t line, const uint8_t bits); - static void send_row(const uint8_t row); - static void send_column(const uint8_t col); - static void mark16(const uint8_t y, const uint8_t v1, const uint8_t v2); - static void range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh); - static void quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv); - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - static void spiral(const bool on, const uint16_t del); - #else - static void sweep(const int8_t dir, const uint16_t ms, const bool on); - #endif - #endif -}; - -extern Max7219 max7219; diff --git a/Marlin_thinkerV2/Marlin/SanityCheck.h b/Marlin_thinkerV2/Marlin/SanityCheck.h deleted file mode 100644 index 97416896b8..0000000000 --- a/Marlin_thinkerV2/Marlin/SanityCheck.h +++ /dev/null @@ -1,1654 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * SanityCheck.h - * - * Test configuration values for errors at compile-time. - */ - -#ifndef _SANITYCHECK_H_ -#define _SANITYCHECK_H_ - -/** - * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features. - */ -#if __cplusplus < 201103L - #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain." -#endif - -/** - * We try our best to include sanity checks for all changed configuration - * directives because users have a tendency to use outdated config files with - * the bleeding-edge source code, but sometimes this is not enough. This check - * forces a minimum config file revision. Otherwise Marlin will not build. - */ -#define HEXIFY(H) _CAT(0x,H) -#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION) - #error "You are using an old Configuration.h file, update it before building Marlin." -#endif - -#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION) - #error "You are using an old Configuration_adv.h file, update it before building Marlin." -#endif - -/** - * Warnings for old configurations - */ -#ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." -#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) - #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." -#elif WATCH_TEMP_PERIOD > 500 - #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." -#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) - #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." -#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) - #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." -#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE) - #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY." -#elif defined(X_HOME_RETRACT_MM) - #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration." -#elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." -#elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." -#elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." -#elif defined(SDSLOW) - #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." -#elif defined(SDEXTRASLOW) - #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." -#elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." -#elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." -#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) - #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." -#elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." -#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) - #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." -#elif defined(PID_PARAMS_PER_EXTRUDER) - #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." -#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) - #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." -#elif defined(SERVO_ENDSTOP_ANGLES) - #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." -#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) - #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." -#elif defined(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." -#elif defined(DEFAULT_XYJERK) - #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." -#elif defined(XY_TRAVEL_SPEED) - #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." -#elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." -#elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_FEATURE) - #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS) - #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_ADD) - #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_XY_FEEDRATE) - #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_FEEDRATE) - #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS) - #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_Z_ADD) - #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_XY_FEEDRATE) - #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_Z_FEEDRATE) - #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE) - #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) - #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) - #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) - #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." -#elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." -#elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." -#elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." -#elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." -#elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." -#elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." -#elif defined(ENDSTOPS_ONLY_FOR_HOMING) - #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." -#elif defined(HOMING_FEEDRATE) - #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." -#elif defined(MANUAL_HOME_POSITIONS) - #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." -#elif defined(PID_ADD_EXTRUSION_RATE) - #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." -#elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(MIN_Z_HEIGHT_FOR_HOMING) - #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." -#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) - #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) - #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(MANUAL_BED_LEVELING) - #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration." -#elif defined(MESH_HOME_SEARCH_Z) - #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif defined(MANUAL_PROBE_Z_RANGE) - #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif !defined(MIN_STEPS_PER_SEGMENT) - #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. -#elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." -#elif defined(PREVENT_DANGEROUS_EXTRUDE) - #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." -#elif defined(SCARA) - #error "SCARA is now MORGAN_SCARA. Please update your configuration." -#elif defined(ENABLE_AUTO_BED_LEVELING) - #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(AUTO_BED_LEVELING_FEATURE) - #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." -#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) - #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) - #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) - #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_G26_MESH_VALIDATION) - #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDIT_ENABLED) - #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDITING) - #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(BLTOUCH_HEATERS_OFF) - #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration." -#elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." -#elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." -#elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE) - #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_BL) - #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_RESET) - #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." -#elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) - #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." -#elif defined(min_software_endstops) || defined(max_software_endstops) - #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." -#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) - #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." -#elif defined(CONTROLLERFAN_PIN) - #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." -#elif defined(MIN_RETRACT) - #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." -#elif defined(ADVANCE) - #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." -#elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." -#elif defined(NEOPIXEL_RGBW_LED) - #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." -#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) - #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead." -#elif defined(UBL_MESH_INSET) - #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." -#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." -#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." -#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) - #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." -#elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) - #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." -#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) - #error "K1 is now PID_K1. Please update your configuration." -#elif defined(PROBE_DOUBLE_TOUCH) - #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." -#elif defined(ANET_KEYPAD_LCD) - #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." -#elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." -#elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) - #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." -#elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \ - || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \ - || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \ - || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \ - || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." -#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \ - || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." -#elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." -#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET) - #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h." -#elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." -#elif defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." -#elif defined(JUNCTION_ACCELERATION_FACTOR) - #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." -#elif defined(JUNCTION_ACCELERATION) - #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." -#elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." -#endif - -#define BOARD_MKS_13 -47 -#define BOARD_TRIGORILLA -343 -#if MB(MKS_13) - #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." -#elif MB(BOARD_TRIGORILLA) - #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration." -#endif - -/** - * Marlin release, version and default string - */ -#ifndef SHORT_BUILD_VERSION - #error "SHORT_BUILD_VERSION must be specified." -#elif !defined(DETAILED_BUILD_VERSION) - #error "BUILD_VERSION must be specified." -#elif !defined(STRING_DISTRIBUTION_DATE) - #error "STRING_DISTRIBUTION_DATE must be specified." -#elif !defined(PROTOCOL_VERSION) - #error "PROTOCOL_VERSION must be specified." -#elif !defined(MACHINE_NAME) - #error "MACHINE_NAME must be specified." -#elif !defined(SOURCE_CODE_URL) - #error "SOURCE_CODE_URL must be specified." -#elif !defined(DEFAULT_MACHINE_UUID) - #error "DEFAULT_MACHINE_UUID must be specified." -#elif !defined(WEBSITE_URL) - #error "WEBSITE_URL must be specified." -#endif - -/** - * Serial - */ -#if USE_MARLINSERIAL - #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 - #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." - #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) - #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." - #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) - #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." - #elif ENABLED(BLUETOOTH) - #error "BLUETOOTH is only supported with AT90USB." - #endif -#elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX) - #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." -#endif - -#if SERIAL_PORT > 7 - #error "Set SERIAL_PORT to the port on your board. Usually this is 0." -#endif - -/** - * Dual Stepper Drivers - */ -#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." -#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR) - #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." -#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR) - #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR) - #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." -#endif - -/** - * Validate that the bed size fits - */ -static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, - "Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE."); - -/** - * Granular software endstops (Marlin >= 1.1.7) - */ -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z." - #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X) && DISABLED(MIN_SOFTWARE_ENDSTOP_Y) - #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z." - #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X) && DISABLED(MAX_SOFTWARE_ENDSTOP_Y) - #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -/** - * Progress Bar - */ -#if ENABLED(LCD_PROGRESS_BAR) - #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY) - #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." - #elif DISABLED(ULTRA_LCD) - #error "LCD_PROGRESS_BAR requires a character LCD." - #elif ENABLED(DOGLCD) - #error "LCD_PROGRESS_BAR does not apply to graphical displays." - #elif ENABLED(FILAMENT_LCD_DISPLAY) - #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." - #endif -#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD) - #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD." -#endif - -/** - * Custom Boot and Status screens - */ -#if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) - #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE." -#endif - -/** - * SD File Sorting - */ -#if ENABLED(SDCARD_SORT_ALPHA) - #if SDSORT_LIMIT > 256 - #error "SDSORT_LIMIT must be 256 or smaller." - #elif SDSORT_LIMIT < 10 - #error "SDSORT_LIMIT should be greater than 9 to be useful." - #elif DISABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." - #elif ENABLED(SDSORT_CACHE_NAMES) - #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." - #endif - #endif - - #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #if SDSORT_CACHE_VFATS < 2 - #error "SDSORT_CACHE_VFATS must be 2 or greater!" - #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES - #undef SDSORT_CACHE_VFATS - #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES - #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!" - #endif - #endif -#endif - -/** - * I2C Position Encoders - */ -#if ENABLED(I2C_POSITION_ENCODERS) - #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY) - #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." - #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) - #error "I2CPE_ENCODER_CNT must be between 1 and 5." - #endif -#endif - -/** - * Babystepping - */ -#if ENABLED(BABYSTEPPING) - #if ENABLED(SCARA) - #error "BABYSTEPPING is not implemented for SCARA yet." - #elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY) - #error "BABYSTEPPING only implemented for Z axis on deltabots." - #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING) - #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" - #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE - #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(DOGLCD) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(BABYSTEP_ZPROBE_OFFSET) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." - #endif -#endif - -/** - * Filament Runout needs one or more pins and either SD Support or Auto print start detection - */ -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if !PIN_EXISTS(FIL_RUNOUT) - #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif NUM_RUNOUT_SENSORS > E_STEPPERS - #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." - #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." - #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); - #endif -#endif - -/** - * Advanced Pause - */ -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #if !HAS_RESUME_CONTINUE - #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER." - #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) - #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." - #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER) - #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." - #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." - #elif DISABLED(NOZZLE_PARK_FEATURE) - #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #endif -#endif - -/** - * Individual axis homing is useless for DELTAS - */ -#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." -#endif - -/** - * Options only for EXTRUDERS > 1 - */ -#if EXTRUDERS > 1 - - #if EXTRUDERS > 5 - #error "Marlin supports a maximum of 5 EXTRUDERS." - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." - #endif - - #if ENABLED(HEATERS_PARALLEL) - #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." - #endif - -#elif ENABLED(MK2_MULTIPLEXER) - #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS." -#elif ENABLED(SINGLENOZZLE) - #error "SINGLENOZZLE requires 2 or more EXTRUDERS." -#endif - -/** - * Sanity checking for the Průša MK2 Multiplexer - */ -#ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." -#endif - -/** - * A Dual Nozzle carriage with switching servo - */ -#if ENABLED(SWITCHING_NOZZLE) - #if ENABLED(DUAL_X_CARRIAGE) - #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible." - #elif ENABLED(SINGLENOZZLE) - #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible." - #elif EXTRUDERS != 2 - #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS." - #elif NUM_SERVOS < 1 - #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1." - #endif -#endif - -/** - * Single Stepper Dual Extruder with switching servo - */ -#if ENABLED(SWITCHING_EXTRUDER) && NUM_SERVOS < 1 - #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." -#endif - -/** - * Mixing Extruder requirements - */ -#if ENABLED(MIXING_EXTRUDER) - #if EXTRUDERS > 1 - #error "MIXING_EXTRUDER currently only supports one extruder." - #elif MIXING_STEPPERS < 2 - #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." - #elif ENABLED(FILAMENT_SENSOR) - #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both." - #elif ENABLED(SINGLENOZZLE) - #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." - #elif ENABLED(LIN_ADVANCE) - #error "MIXING_EXTRUDER is incompatible with LIN_ADVANCE." - #endif -#endif - -/** - * Linear Advance 1.5 - Check K value range - */ -#if ENABLED(LIN_ADVANCE) - static_assert( - WITHIN(LIN_ADVANCE_K, 0, 10), - "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)." - ); -#endif - -/** - * Parking Extruder requirements - */ -#if ENABLED(PARKING_EXTRUDER) - #if ENABLED(DUAL_X_CARRIAGE) - #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible." - #elif ENABLED(SINGLENOZZLE) - #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible." - #elif ENABLED(EXT_SOLENOID) - #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)" - #elif EXTRUDERS != 2 - #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS." - #elif !PIN_EXISTS(SOL0) || !PIN_EXISTS(SOL1) - #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN." - #elif !defined(PARKING_EXTRUDER_PARKING_X) - #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X." - #elif !defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_SECURITY_RAISE." - #elif PARKING_EXTRUDER_SECURITY_RAISE < 0 - #error "PARKING_EXTRUDER_SECURITY_RAISE must be 0 or higher." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH) - #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000) - #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)." - #endif -#endif - -/** - * Part-Cooling Fan Multiplexer requirements - */ -#if PIN_EXISTS(FANMUX1) - #if !HAS_FANMUX - #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set." - #endif -#elif PIN_EXISTS(FANMUX2) - #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set." -#endif - -/** - * Limited number of servos - */ -#if NUM_SERVOS > 4 - #error "The maximum number of SERVOS in Marlin is 4." -#endif - -/** - * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder - */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) - #error "Z_PROBE_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE." -#endif - -/** - * Required LCD language - */ -#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780) - #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." -#endif - -/** - * Bed Heating Options - PID vs Limit Switching - */ -#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING) - #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED." -#endif - -/** - * Kinematics - */ - -/** - * Allow only one kinematic type to be defined - */ -#if 1 < 0 \ - + ENABLED(DELTA) \ - + ENABLED(MORGAN_SCARA) \ - + ENABLED(MAKERARM_SCARA) \ - + ENABLED(COREXY) \ - + ENABLED(COREXZ) \ - + ENABLED(COREYZ) \ - + ENABLED(COREYX) \ - + ENABLED(COREZX) \ - + ENABLED(COREZY) - #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY." -#endif - -/** - * Delta requirements - */ -#if ENABLED(DELTA) - #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG) - #error "You probably want to use Max Endstops for DELTA!" - #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED - #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." - #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL)) - #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller." - #elif ABL_GRID - #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers." - #elif GRID_MAX_POINTS_X < 3 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher." - #endif - #endif -#endif - -/** - * Probes - */ - -/** - * Allow only one probe option to be defined - */ -#if 1 < 0 \ - + ENABLED(PROBE_MANUALLY) \ - + ENABLED(FIX_MOUNTED_PROBE) \ - + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) \ - + ENABLED(SOLENOID_PROBE) \ - + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) - #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." -#endif - -#if HAS_BED_PROBE - - /** - * Z_PROBE_SLED is incompatible with DELTA - */ - #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA) - #error "You cannot use Z_PROBE_SLED with DELTA." - #endif - - /** - * SOLENOID_PROBE requirements - */ - #if ENABLED(SOLENOID_PROBE) - #if ENABLED(EXT_SOLENOID) - #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." - #elif !HAS_SOLENOID_1 - #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." - #endif - #endif - - /** - * NUM_SERVOS is required for a Z servo probe - */ - #if HAS_Z_SERVO_PROBE - #ifndef NUM_SERVOS - #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)." - #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR >= NUM_SERVOS - #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS." - #endif - #endif - - /** - * Require pin options and pins to be defined - */ - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #error "Enable only one option: Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." - #elif DISABLED(USE_ZMIN_PLUG) - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled." - #elif !HAS_Z_MIN - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined." - #elif ENABLED(Z_MIN_PROBE_ENDSTOP_INVERTING) != ENABLED(Z_MIN_ENDSTOP_INVERTING) - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING." - #endif - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - #if !HAS_Z_MIN_PROBE_PIN - #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined." - #endif - #else - #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe." - #endif - - /** - * Make sure Z raise values are set - */ - #ifndef Z_CLEARANCE_DEPLOY_PROBE - #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration." - #elif !defined(Z_CLEARANCE_BETWEEN_PROBES) - #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration." - #elif Z_CLEARANCE_DEPLOY_PROBE < 0 - #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." - #elif Z_CLEARANCE_BETWEEN_PROBES < 0 - #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." - #endif - - #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2 - #error "MULTIPLE_PROBING must be >= 2." - #endif - - #if Z_PROBE_LOW_POINT > 0 - #error "Z_PROBE_LOW_POINT must be less than or equal to 0." - #endif - - static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - -#else - - /** - * Require some kind of probe for bed leveling and probe testing - */ - #if OLDSCHOOL_ABL && !PROBE_SELECTED - #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo." - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." - #endif - -#endif - -/** - * Allow only one bed leveling option to be defined - */ -#if 1 < 0 \ - + ENABLED(AUTO_BED_LEVELING_LINEAR) \ - + ENABLED(AUTO_BED_LEVELING_3POINT) \ - + ENABLED(AUTO_BED_LEVELING_BILINEAR) \ - + ENABLED(AUTO_BED_LEVELING_UBL) \ - + ENABLED(MESH_BED_LEVELING) - #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." -#endif - -/** - * Bed Leveling Requirements - */ - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(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) - - /** - * Unified Bed Leveling - */ - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - #if IS_SCARA - #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." - #elif DISABLED(EEPROM_SETTINGS) - #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." - #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) - #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) - #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." - #endif - -#elif OLDSCHOOL_ABL - - /** - * Auto Bed Leveling - */ - - /** - * Delta and SCARA have limited bed leveling options - */ - #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR) - #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 // AUTO_BED_LEVELING_3POINT - -#elif ENABLED(MESH_BED_LEVELING) - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - /** - * Mesh Bed Leveling - */ - - #if ENABLED(DELTA) - #error "MESH_BED_LEVELING is not compatible with DELTA printers." - #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9 - #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL." - #endif - -#endif - -#if HAS_MESH - static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); -#elif ENABLED(G26_MESH_VALIDATION) - #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." -#endif - -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD)) - #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." -#endif - -/** - * LCD_BED_LEVELING requirements - */ -#if ENABLED(LCD_BED_LEVELING) - #if DISABLED(ULTIPANEL) - #error "LCD_BED_LEVELING requires an LCD controller." - #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL) - #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." - #endif -#endif - -/** - * Homing - */ -#if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0 - #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0." -#endif - -#if ENABLED(CODEPENDENT_XY_HOMING) - #if ENABLED(QUICK_HOME) - #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING." - #elif IS_KINEMATIC - #error "CODEPENDENT_XY_HOMING requires a Cartesian setup." - #endif -#endif - -/** - * 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."); - #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."); - #endif -#endif // Z_SAFE_HOMING - -/** - * Make sure DISABLE_[XYZ] compatible with selected homing options - */ -#if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z) - #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING) - #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." - #endif -#endif // DISABLE_[XYZ] - -/** - * Filament Width Sensor - */ -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #if !HAS_FILAMENT_WIDTH_SENSOR - #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." - #elif ENABLED(NO_VOLUMETRICS) - #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled." - #endif -#endif - -/** - * ULTIPANEL encoder - */ -#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK) - #error "ULTIPANEL requires some kind of encoder." -#endif - -#if ENCODER_PULSES_PER_STEP < 0 - #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." -#endif - -/** - * SAV_3DGLCD display options - */ -#if ENABLED(SAV_3DGLCD) - #if DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106) - #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #elif ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) - #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #endif -#endif - -/** - * Allen Key - * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. - */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" -#endif - -/** - * Dual X Carriage requirements - */ -#if ENABLED(DUAL_X_CARRIAGE) - #if EXTRUDERS == 1 - #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." - #elif CORE_IS_XY || CORE_IS_XZ - #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX." - #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR - #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." - #elif !HAS_X_MAX - #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." - #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) - #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." - #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 - #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." - #endif -#endif // DUAL_X_CARRIAGE - -/** - * Make sure auto fan pins don't conflict with the fan pin - */ -#if HAS_AUTO_FAN - #if HAS_FAN0 - #if E0_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN." - #elif E1_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN." - #elif E2_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN." - #elif E3_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN." - #endif - #endif -#endif - -#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN - #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - #if !HAS_CONTROLLER_FAN - #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h." - #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #endif -#endif - -/** - * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. - */ -#if !HAS_HEATER_0 - #error "HEATER_0_PIN not defined for this board." -#elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) - #error "TEMP_0_PIN not defined for this board." -#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR))) - #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." -#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(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." -#endif - -// Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) - #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board." -#elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1 - #error "HEATER_1_PIN not defined for this board." -#endif - -#if HOTENDS > 1 - #if TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !PIN_EXISTS(TEMP_1) - #error "TEMP_1_PIN not defined for this board." - #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 == 0 - #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." - #elif !HAS_HEATER_2 - #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) - #error "TEMP_2_PIN not defined for this board." - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." - #elif !HAS_HEATER_3 - #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) - #error "TEMP_3_PIN not defined for this board." - #endif - #if HOTENDS > 4 - #if TEMP_SENSOR_4 == 0 - #error "TEMP_SENSOR_4 is required with 5 HOTENDS." - #elif !HAS_HEATER_4 - #error "HEATER_4_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_4) - #error "TEMP_4_PIN not defined for this board." - #endif - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS." - #endif - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS." - #endif - #elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS." - #endif -#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND." -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." -#endif - -/** - * Temperature status LEDs - */ -#if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE) - #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both." -#endif - -/** - * LED Control Menu - */ -#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS - #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9632, or NEOPIXEL_LED." -#endif - -/** - * Basic 2-nozzle duplication mode - */ -#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #if HOTENDS != 2 - #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends." - #elif ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE." - #elif ENABLED(SINGLENOZZLE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE." - #elif ENABLED(MIXING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER." - #endif -#endif - -/** - * Test Extruder Stepper Pins - */ -#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only - #if E_STEPPERS > 4 - #if !PIN_EXISTS(E4_STEP) || !PIN_EXISTS(E4_DIR) || !PIN_EXISTS(E4_ENABLE) - #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 3 - #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 2 - #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." - #endif - #elif E_STEPPERS > 1 - #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." - #endif - #endif -#endif -/** - * Endstop Tests - */ - -#define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG) && DISABLED(USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_))) -#define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z)) - -// At least 3 endstop plugs must be used -#if _AXIS_PLUG_UNUSED_TEST(X) - #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Y) - #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Z) - #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." -#endif - -// Delta and Cartesian use 3 homing endstops -#if !IS_SCARA - #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) - #error "Enable USE_XMIN_PLUG when homing X to MIN." - #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) - #error "Enable USE_XMAX_PLUG when homing X to MAX." - #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG) - #error "Enable USE_YMIN_PLUG when homing Y to MIN." - #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG) - #error "Enable USE_YMAX_PLUG when homing Y to MAX." - #endif -#endif -#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) - #error "Enable USE_ZMIN_PLUG when homing Z to MIN." -#elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) - #error "Enable USE_ZMAX_PLUG when homing Z to MAX." -#endif - -// Dual endstops requirements -#if ENABLED(X_DUAL_ENDSTOPS) - #if !X2_USE_ENDSTOP - #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS." - #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_." - #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_." - #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_." - #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_." - #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_." - #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_X2_MIN && !HAS_X2_MAX - #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "X_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - #if !Y2_USE_ENDSTOP - #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS." - #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_." - #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_." - #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_." - #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_." - #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_." - #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Y2_MIN && !HAS_Y2_MAX - #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Y_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - #if !Z2_USE_ENDSTOP - #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS." - #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_." - #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_." - #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_." - #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_." - #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_." - #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Z2_MIN && !HAS_Z2_MAX - #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Z_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif - -/** - * emergency-command parser - */ -#if ENABLED(EMERGENCY_PARSER) && !USE_MARLINSERIAL - #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." -#endif - -/** - * I2C bus - */ -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - #if I2C_SLAVE_ADDRESS < 8 - #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)" - #elif I2C_SLAVE_ADDRESS > 127 - #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)" - #endif -#endif - -/** - * G38 Probe Target - */ -#if ENABLED(G38_PROBE_TARGET) - #if !HAS_BED_PROBE - #error "G38_PROBE_TARGET requires a bed probe." - #elif !IS_CARTESIAN - #error "G38_PROBE_TARGET requires a Cartesian machine." - #endif -#endif - -/** - * RGB_LED Requirements - */ -#define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B)) -#if ENABLED(RGB_LED) - #if !_RGB_TEST - #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN." - #elif ENABLED(RGBW_LED) - #error "Please enable only one of RGB_LED and RGBW_LED." - #endif -#elif ENABLED(RGBW_LED) - #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W)) - #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN." - #endif -#elif ENABLED(NEOPIXEL_LED) - #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0) - #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS." - #endif -#elif ENABLED(PRINTER_EVENT_LEDS) && DISABLED(BLINKM) && DISABLED(PCA9632) && DISABLED(NEOPIXEL_LED) - #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED." -#endif - -/** - * Auto Fan check for PWM pins - */ -#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 - #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255." - #if HAS_AUTO_FAN_0 - static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_1 - static_assert(GET_TIMER(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_2 - static_assert(GET_TIMER(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_3 - static_assert(GET_TIMER(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF); - #endif -#endif - -/** - * Make sure only one display is enabled - * - * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER - * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER - * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER - * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER - * MKS_MINI_12864 => MINIPANEL - * miniVIKI => ULTIMAKERCONTROLLER - * VIKI2 => ULTIMAKERCONTROLLER - * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER - * PANEL_ONE => ULTIMAKERCONTROLLER - */ -#if 1 < 0 \ - + ( ENABLED(ULTIMAKERCONTROLLER) \ - && DISABLED(SAV_3DGLCD) \ - && DISABLED(miniVIKI) \ - && DISABLED(VIKI2) \ - && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - && DISABLED(PANEL_ONE) \ - && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ - && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \ - && DISABLED(LCD_FOR_MELZI) \ - && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \ - + ENABLED(LCD_FOR_MELZI) \ - + ENABLED(MKS_12864OLED) \ - + ENABLED(MKS_12864OLED_SSD1306) \ - + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - + ENABLED(CARTESIO_UI) \ - + ENABLED(PANEL_ONE) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(G3D_PANEL) \ - + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ - + ENABLED(MKS_MINI_12864) \ - + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \ - + ENABLED(RIGIDBOT_PANEL) \ - + ENABLED(RA_CONTROL_PANEL) \ - + ENABLED(LCD_SAINSMART_I2C_1602) \ - + ENABLED(LCD_SAINSMART_I2C_2004) \ - + ENABLED(LCM1602) \ - + ENABLED(LCD_I2C_PANELOLU2) \ - + ENABLED(LCD_I2C_VIKI) \ - + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \ - + ENABLED(SAV_3DLCD) \ - + ENABLED(BQ_LCD_SMART_CONTROLLER) \ - + ENABLED(SAV_3DGLCD) \ - + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(ULTI_CONTROLLER) - #error "Please select no more than one LCD controller option." -#endif - -/** - * Check existing CS pins against enabled TMC SPI drivers. - */ -#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS) - #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS) - #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS) - #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS) - #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS) - #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS) - #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS) - #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS) - #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS) - #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS) - #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h." -#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS) - #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h." -#endif - -/** - * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) - */ -#if HAS_DRIVER(TMC2208) && 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(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) ) - #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." -#endif - -#if ENABLED(SENSORLESS_HOMING) - // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop - // is necessary in order to reset the stallGuard indication between the initial movement of all three - // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of - // clearing the stallGuard activated status is found. - #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP) - #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." - #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_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 == 1 && (DISABLED(X_MAX_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 == -1 && (DISABLED(Y_MIN_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 == 1 && (DISABLED(Y_MAX_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 == -1 && (DISABLED(Z_MIN_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 == 1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX)) - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." - #elif ENABLED(ENDSTOP_NOISE_FILTER) - #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER." - #endif -#endif - -// Sensorless homing is required for both combined steppers in an H-bot -#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS - #error "CoreXY requires both X and Y to use sensorless homing if either does." -#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS - #error "CoreXZ requires both X and Z to use sensorless homing if either does." -#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS - #error "CoreYZ requires both Y and Z to use sensorless homing if either does." -#endif - -#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP) - #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD." -#endif -#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2) - #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis" -#endif - -#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD - #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers." -#endif -#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP - #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers." -#endif - -/** - * Digipot requirement - */ -#if ENABLED(DIGIPOT_MCP4018) - #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \ - || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1) - #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined." - #endif -#endif - -/** - * Require 4 or more elements in per-axis initializers - */ -constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT, - sanity_arr_2[] = DEFAULT_MAX_FEEDRATE, - sanity_arr_3[] = DEFAULT_MAX_ACCELERATION; -static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires 4 (or more) elements."); -static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements."); -static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements."); -static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements."); - -/** - * Sanity checks for Spindle / Laser - */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46)) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif SPINDLE_LASER_POWERUP_DELAY < 1 - #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0." - #elif SPINDLE_LASER_POWERDOWN_DELAY < 1 - #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0." - #elif !defined(SPINDLE_LASER_PWM_INVERT) - #error "SPINDLE_LASER_PWM_INVERT missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." - #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop." - #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop." - #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin in use by Z_STEP." - #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE - -#if ENABLED(CNC_COORDINATE_SYSTEMS) && ENABLED(NO_WORKSPACE_OFFSETS) - #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS." -#endif - -#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) - #error "BLOCK_BUFFER_SIZE must be a power of 2." -#endif - -#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL) - #error "LED_CONTROL_MENU requires an LCD controller." -#endif - -#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED) - #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED." -#endif - -#if ENABLED(SKEW_CORRECTION) - #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)) - #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD." - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD)) - #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD." - #endif - #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD)) - #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD." - #endif - #endif -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) && !ENABLED(ULTIPANEL) - #error "POWER_LOSS_RECOVERY currently requires an LCD Controller." -#endif - -#endif // _SANITYCHECK_H_ diff --git a/Marlin_thinkerV2/Marlin/Sd2Card.cpp b/Marlin_thinkerV2/Marlin/Sd2Card.cpp deleted file mode 100644 index 118b83cd9d..0000000000 --- a/Marlin_thinkerV2/Marlin/Sd2Card.cpp +++ /dev/null @@ -1,716 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "Sd2Card.h" - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if DISABLED(SOFTWARE_SPI) - // functions for hardware SPI - - // make sure SPCR rate is in expected bits - #if (SPR0 != 0 || SPR1 != 1) - #error "unexpected SPCR bits" - #endif - /** - * Initialize hardware SPI - * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] - */ - static void spiInit(uint8_t spiRate) { - // See avr processor documentation - SPCR = _BV(SPE) | _BV(MSTR) | (spiRate >> 1); - SPSR = spiRate & 1 || spiRate == 6 ? 0 : _BV(SPI2X); - } - - /** SPI receive a byte */ - static uint8_t spiRec() { - SPDR = 0xFF; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - return SPDR; - } - - /** SPI read data - only one call so force inline */ - static inline __attribute__((always_inline)) - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte-- == 0) return; - SPDR = 0xFF; - for (uint16_t i = 0; i < nbyte; i++) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[i] = SPDR; - SPDR = 0xFF; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[nbyte] = SPDR; - } - - /** SPI send a byte */ - static void spiSend(uint8_t b) { - SPDR = b; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - - /** SPI send block - only one call so force inline */ - static inline __attribute__((always_inline)) - void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPDR = token; - for (uint16_t i = 0; i < 512; i += 2) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i]; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i + 1]; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - //------------------------------------------------------------------------------ -#else // SOFTWARE_SPI - //------------------------------------------------------------------------------ - - /** nop to tune soft SPI timing */ - #define nop asm volatile ("nop\n\t") - - /** Soft SPI receive byte */ - static uint8_t spiRec() { - uint8_t data = 0; - // no interrupts during byte receive - about 8 us - cli(); - // output pin high - like sending 0xFF - WRITE(SPI_MOSI_PIN, HIGH); - - for (uint8_t i = 0; i < 8; i++) { - WRITE(SPI_SCK_PIN, HIGH); - - // adjust so SCK is nice - nop; - nop; - - data <<= 1; - - if (READ(SPI_MISO_PIN)) data |= 1; - - WRITE(SPI_SCK_PIN, LOW); - } - // enable interrupts - sei(); - return data; - } - - /** Soft SPI read data */ - static void spiRead(uint8_t* buf, uint16_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) - buf[i] = spiRec(); - } - - /** Soft SPI send byte */ - static void spiSend(uint8_t data) { - // no interrupts during byte send - about 8 us - cli(); - for (uint8_t i = 0; i < 8; i++) { - WRITE(SPI_SCK_PIN, LOW); - - WRITE(SPI_MOSI_PIN, data & 0x80); - - data <<= 1; - - WRITE(SPI_SCK_PIN, HIGH); - } - // hold SCK high for a few ns - nop; - nop; - nop; - nop; - - WRITE(SPI_SCK_PIN, LOW); - // enable interrupts - sei(); - } - - /** Soft SPI send block */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { - spiSend(token); - for (uint16_t i = 0; i < 512; i++) - spiSend(buf[i]); - } -#endif // SOFTWARE_SPI - -// send command and return error code. Return zero for OK -uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { - // select card - chipSelectLow(); - - // wait up to 300 ms if busy - waitNotBusy(300); - - // send command - spiSend(cmd | 0x40); - - // send argument - for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); - - // send CRC - uint8_t crc = 0xFF; - if (cmd == CMD0) crc = 0x95; // correct crc for CMD0 with arg 0 - if (cmd == CMD8) crc = 0x87; // correct crc for CMD8 with arg 0x1AA - spiSend(crc); - - // skip stuff byte for stop read - if (cmd == CMD12) spiRec(); - - // wait for response - for (uint8_t i = 0; ((status_ = spiRec()) & 0x80) && i != 0xFF; i++) { /* Intentionally left empty */ } - return status_; -} - -/** - * Determine the size of an SD flash memory card. - * - * \return The number of 512 byte data blocks in the card - * or zero if an error occurs. - */ -uint32_t Sd2Card::cardSize() { - csd_t csd; - if (!readCSD(&csd)) return 0; - if (csd.v1.csd_ver == 0) { - uint8_t read_bl_len = csd.v1.read_bl_len; - uint16_t c_size = (csd.v1.c_size_high << 10) - | (csd.v1.c_size_mid << 2) | csd.v1.c_size_low; - uint8_t c_size_mult = (csd.v1.c_size_mult_high << 1) - | csd.v1.c_size_mult_low; - return (uint32_t)(c_size + 1) << (c_size_mult + read_bl_len - 7); - } - else if (csd.v2.csd_ver == 1) { - uint32_t c_size = ((uint32_t)csd.v2.c_size_high << 16) - | (csd.v2.c_size_mid << 8) | csd.v2.c_size_low; - return (c_size + 1) << 10; - } - else { - error(SD_CARD_ERROR_BAD_CSD); - return 0; - } -} - -void Sd2Card::chipSelectHigh() { - digitalWrite(chipSelectPin_, HIGH); -} - -void Sd2Card::chipSelectLow() { - #if DISABLED(SOFTWARE_SPI) - spiInit(spiRate_); - #endif // SOFTWARE_SPI - digitalWrite(chipSelectPin_, LOW); -} - -/** - * Erase a range of blocks. - * - * \param[in] firstBlock The address of the first block in the range. - * \param[in] lastBlock The address of the last block in the range. - * - * \note This function requests the SD card to do a flash erase for a - * range of blocks. The data on the card after an erase operation is - * either 0 or 1, depends on the card vendor. The card must support - * single block erase. - * - * \return true for success, false for failure. - */ -bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) { - csd_t csd; - if (!readCSD(&csd)) goto FAIL; - // check for single block erase - if (!csd.v1.erase_blk_en) { - // erase size mask - uint8_t m = (csd.v1.sector_size_high << 1) | csd.v1.sector_size_low; - if ((firstBlock & m) != 0 || ((lastBlock + 1) & m) != 0) { - // error card can't erase specified area - error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK); - goto FAIL; - } - } - if (type_ != SD_CARD_TYPE_SDHC) { - firstBlock <<= 9; - lastBlock <<= 9; - } - if (cardCommand(CMD32, firstBlock) - || cardCommand(CMD33, lastBlock) - || cardCommand(CMD38, 0)) { - error(SD_CARD_ERROR_ERASE); - goto FAIL; - } - if (!waitNotBusy(SD_ERASE_TIMEOUT)) { - error(SD_CARD_ERROR_ERASE_TIMEOUT); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Determine if card supports single block erase. - * - * \return true if single block erase is supported. - * false if single block erase is not supported. - */ -bool Sd2Card::eraseSingleBlockEnable() { - csd_t csd; - return readCSD(&csd) ? csd.v1.erase_blk_en : false; -} - -/** - * Initialize an SD flash memory card. - * - * \param[in] sckRateID SPI clock rate selector. See setSckRate(). - * \param[in] chipSelectPin SD chip select pin number. - * - * \return true for success, false for failure. - * The reason for failure can be determined by calling errorCode() and errorData(). - */ -bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { - errorCode_ = type_ = 0; - chipSelectPin_ = chipSelectPin; - // 16-bit init start time allows over a minute - uint16_t t0 = (uint16_t)millis(); - uint32_t arg; - - // If init takes more than 4s it could trigger - // watchdog leading to a reboot loop. - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - - // set pin modes - pinMode(chipSelectPin_, OUTPUT); - chipSelectHigh(); - SET_INPUT(SPI_MISO_PIN); - SET_OUTPUT(SPI_MOSI_PIN); - SET_OUTPUT(SPI_SCK_PIN); - - #if DISABLED(SOFTWARE_SPI) - // SS must be in output mode even it is not chip select - SET_OUTPUT(SS_PIN); - // set SS high - may be chip select for another SPI device - #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); - #endif // SET_SPI_SS_HIGH - // set SCK rate for initialization commands - spiRate_ = SPI_SD_INIT_RATE; - spiInit(spiRate_); - #endif // SOFTWARE_SPI - - // must supply min of 74 clock cycles with CS high. - for (uint8_t i = 0; i < 10; i++) spiSend(0xFF); - - // command to go idle in SPI mode - while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { - error(SD_CARD_ERROR_CMD0); - goto FAIL; - } - } - // check SD version - if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { - type(SD_CARD_TYPE_SD1); - } - else { - // only need last byte of r7 response - for (uint8_t i = 0; i < 4; i++) status_ = spiRec(); - if (status_ != 0xAA) { - error(SD_CARD_ERROR_CMD8); - goto FAIL; - } - type(SD_CARD_TYPE_SD2); - } - // initialize card and send host supports SDHC if SD2 - arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; - - while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { - // check for timeout - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { - error(SD_CARD_ERROR_ACMD41); - goto FAIL; - } - } - // if SD2 read OCR register to check for SDHC card - if (type() == SD_CARD_TYPE_SD2) { - if (cardCommand(CMD58, 0)) { - error(SD_CARD_ERROR_CMD58); - goto FAIL; - } - if ((spiRec() & 0xC0) == 0xC0) type(SD_CARD_TYPE_SDHC); - // discard rest of ocr - contains allowed voltage range - for (uint8_t i = 0; i < 3; i++) spiRec(); - } - chipSelectHigh(); - - #if DISABLED(SOFTWARE_SPI) - return setSckRate(sckRateID); - #else // SOFTWARE_SPI - UNUSED(sckRateID); - return true; - #endif // SOFTWARE_SPI - - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Read a 512 byte block from an SD card. - * - * \param[in] blockNumber Logical block to be read. - * \param[out] dst Pointer to the location that will receive the data. - * \return true for success, false for failure. - */ -bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - - #if ENABLED(SD_CHECK_AND_RETRY) - uint8_t retryCnt = 3; - for (;;) { - if (cardCommand(CMD17, blockNumber)) - error(SD_CARD_ERROR_CMD17); - else if (readData(dst, 512)) - return true; - - chipSelectHigh(); - if (!--retryCnt) break; - - cardCommand(CMD12, 0); // Try sending a stop command, ignore the result. - errorCode_ = 0; - } - return false; - #else - if (cardCommand(CMD17, blockNumber)) { - error(SD_CARD_ERROR_CMD17); - chipSelectHigh(); - return false; - } - else - return readData(dst, 512); - #endif -} - -/** - * Read one data block in a multiple block read sequence - * - * \param[in] dst Pointer to the location for the data to be read. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readData(uint8_t* dst) { - chipSelectLow(); - return readData(dst, 512); -} - -#if ENABLED(SD_CHECK_AND_RETRY) - static const uint16_t crctab[] PROGMEM = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 - }; - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); - } - return crc; - } -#endif // SD_CHECK_AND_RETRY - -bool Sd2Card::readData(uint8_t* dst, uint16_t count) { - // wait for start block token - uint16_t t0 = millis(); - while ((status_ = spiRec()) == 0XFF) { - if (((uint16_t)millis() - t0) > SD_READ_TIMEOUT) { - error(SD_CARD_ERROR_READ_TIMEOUT); - goto FAIL; - } - } - if (status_ != DATA_START_BLOCK) { - error(SD_CARD_ERROR_READ); - goto FAIL; - } - // transfer data - spiRead(dst, count); - -#if ENABLED(SD_CHECK_AND_RETRY) - { - uint16_t calcCrc = CRC_CCITT(dst, count); - uint16_t recvCrc = spiRec() << 8; - recvCrc |= spiRec(); - if (calcCrc != recvCrc) { - error(SD_CARD_ERROR_CRC); - goto FAIL; - } - } -#else - // discard CRC - spiRec(); - spiRec(); -#endif - chipSelectHigh(); - // Send an additional dummy byte, required by Toshiba Flash Air SD Card - spiSend(0XFF); - return true; - FAIL: - chipSelectHigh(); - // Send an additional dummy byte, required by Toshiba Flash Air SD Card - spiSend(0XFF); - return false; -} - -/** read CID or CSR register */ -bool Sd2Card::readRegister(uint8_t cmd, void* buf) { - uint8_t* dst = reinterpret_cast(buf); - if (cardCommand(cmd, 0)) { - error(SD_CARD_ERROR_READ_REG); - chipSelectHigh(); - return false; - } - return readData(dst, 16); -} - -/** - * Start a read multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * - * \note This function is used with readData() and readStop() for optimized - * multiple block reads. SPI chipSelect must be low for the entire sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStart(uint32_t blockNumber) { - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD18, blockNumber)) { - error(SD_CARD_ERROR_CMD18); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -/** - * End a read multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStop() { - chipSelectLow(); - if (cardCommand(CMD12, 0)) { - error(SD_CARD_ERROR_CMD12); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -/** - * Set the SPI clock rate. - * - * \param[in] sckRateID A value in the range [0, 6]. - * - * The SPI clock will be set to F_CPU/pow(2, 1 + sckRateID). The maximum - * SPI rate is F_CPU/2 for \a sckRateID = 0 and the minimum rate is F_CPU/128 - * for \a scsRateID = 6. - * - * \return The value one, true, is returned for success and the value zero, - * false, is returned for an invalid value of \a sckRateID. - */ -bool Sd2Card::setSckRate(uint8_t sckRateID) { - if (sckRateID > 6) { - error(SD_CARD_ERROR_SCK_RATE); - return false; - } - spiRate_ = sckRateID; - return true; -} - -// wait for card to go not busy -bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { - uint16_t t0 = millis(); - while (spiRec() != 0XFF) - if (((uint16_t)millis() - t0) >= timeoutMillis) return false; - - return true; -} - -/** - * Writes a 512 byte block to an SD card. - * - * \param[in] blockNumber Logical block to be written. - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD24, blockNumber)) { - error(SD_CARD_ERROR_CMD24); - goto FAIL; - } - if (!writeData(DATA_START_BLOCK, src)) goto FAIL; - - // wait for flash programming to complete - if (!waitNotBusy(SD_WRITE_TIMEOUT)) { - error(SD_CARD_ERROR_WRITE_TIMEOUT); - goto FAIL; - } - // response is r2 so get and check two bytes for nonzero - if (cardCommand(CMD13, 0) || spiRec()) { - error(SD_CARD_ERROR_WRITE_PROGRAMMING); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * Write one data block in a multiple block write sequence - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeData(const uint8_t* src) { - chipSelectLow(); - // wait for previous write to finish - if (!waitNotBusy(SD_WRITE_TIMEOUT) || !writeData(WRITE_MULTIPLE_TOKEN, src)) { - error(SD_CARD_ERROR_WRITE_MULTIPLE); - chipSelectHigh(); - return false; - } - chipSelectHigh(); - return true; -} - -// send one block of data for write block or write multiple blocks -bool Sd2Card::writeData(uint8_t token, const uint8_t* src) { - spiSendBlock(token, src); - - spiSend(0xFF); // dummy crc - spiSend(0xFF); // dummy crc - - status_ = spiRec(); - if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { - error(SD_CARD_ERROR_WRITE); - chipSelectHigh(); - return false; - } - return true; -} - -/** - * Start a write multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * \param[in] eraseCount The number of blocks to be pre-erased. - * - * \note This function is used with writeData() and writeStop() - * for optimized multiple block writes. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStart(uint32_t blockNumber, uint32_t eraseCount) { - // send pre-erase count - if (cardAcmd(ACMD23, eraseCount)) { - error(SD_CARD_ERROR_ACMD23); - goto FAIL; - } - // use address if not SDHC card - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - if (cardCommand(CMD25, blockNumber)) { - error(SD_CARD_ERROR_CMD25); - goto FAIL; - } - chipSelectHigh(); - return true; - FAIL: - chipSelectHigh(); - return false; -} - -/** - * End a write multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStop() { - chipSelectLow(); - if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL; - spiSend(STOP_TRAN_TOKEN); - if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL; - chipSelectHigh(); - return true; - FAIL: - error(SD_CARD_ERROR_STOP_TRAN); - chipSelectHigh(); - return false; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/Sd2Card.h b/Marlin_thinkerV2/Marlin/Sd2Card.h deleted file mode 100644 index e7fc03bf9e..0000000000 --- a/Marlin_thinkerV2/Marlin/Sd2Card.h +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief Sd2Card class for V2 SD/SDHC cards - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SD2CARD_H_ -#define _SD2CARD_H_ - -#include "SdFatConfig.h" -#include "SdInfo.h" - -// SPI speed is F_CPU/2^(1 + index), 0 <= index <= 6 -uint8_t const SPI_FULL_SPEED = 0, // Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). - SPI_HALF_SPEED = 1, // Set SCK rate to F_CPU/4. See Sd2Card::setSckRate(). - SPI_QUARTER_SPEED = 2, // Set SCK rate to F_CPU/8. See Sd2Card::setSckRate(). - SPI_EIGHTH_SPEED = 3, // Set SCK rate to F_CPU/16. See Sd2Card::setSckRate(). - SPI_SIXTEENTH_SPEED = 4; // Set SCK rate to F_CPU/32. See Sd2Card::setSckRate(). - -uint16_t const SD_INIT_TIMEOUT = 2000, // init timeout ms - SD_ERASE_TIMEOUT = 10000, // erase timeout ms - SD_READ_TIMEOUT = 300, // read timeout ms - SD_WRITE_TIMEOUT = 600; // write time out ms - -// SD card errors -uint8_t const SD_CARD_ERROR_CMD0 = 0X1, // timeout error for command CMD0 (initialize card in SPI mode) - SD_CARD_ERROR_CMD8 = 0X2, // CMD8 was not accepted - not a valid SD card - SD_CARD_ERROR_CMD12 = 0X3, // card returned an error response for CMD12 (write stop) - SD_CARD_ERROR_CMD17 = 0X4, // card returned an error response for CMD17 (read block) - SD_CARD_ERROR_CMD18 = 0X5, // card returned an error response for CMD18 (read multiple block) - SD_CARD_ERROR_CMD24 = 0X6, // card returned an error response for CMD24 (write block) - SD_CARD_ERROR_CMD25 = 0X7, // WRITE_MULTIPLE_BLOCKS command failed - SD_CARD_ERROR_CMD58 = 0X8, // card returned an error response for CMD58 (read OCR) - SD_CARD_ERROR_ACMD23 = 0X9, // SET_WR_BLK_ERASE_COUNT failed - SD_CARD_ERROR_ACMD41 = 0XA, // ACMD41 initialization process timeout - SD_CARD_ERROR_BAD_CSD = 0XB, // card returned a bad CSR version field - SD_CARD_ERROR_ERASE = 0XC, // erase block group command failed - SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD, // card not capable of single block erase - SD_CARD_ERROR_ERASE_TIMEOUT = 0XE, // Erase sequence timed out - SD_CARD_ERROR_READ = 0XF, // card returned an error token instead of read data - SD_CARD_ERROR_READ_REG = 0x10, // read CID or CSD failed - SD_CARD_ERROR_READ_TIMEOUT = 0x11, // timeout while waiting for start of read data - SD_CARD_ERROR_STOP_TRAN = 0x12, // card did not accept STOP_TRAN_TOKEN - SD_CARD_ERROR_WRITE = 0x13, // card returned an error token as a response to a write operation - SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0x14, // REMOVE - not used ... attempt to write protected block zero - SD_CARD_ERROR_WRITE_MULTIPLE = 0x15, // card did not go ready for a multiple block write - SD_CARD_ERROR_WRITE_PROGRAMMING = 0x16, // card returned an error to a CMD13 status check after a write - SD_CARD_ERROR_WRITE_TIMEOUT = 0x17, // timeout occurred during write programming - SD_CARD_ERROR_SCK_RATE = 0x18, // incorrect rate selected - SD_CARD_ERROR_INIT_NOT_CALLED = 0x19, // init() not called - SD_CARD_ERROR_CRC = 0x20; // crc check error - -// card types -uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 SD card - SD_CARD_TYPE_SD2 = 2, // Standard capacity V2 SD card - SD_CARD_TYPE_SDHC = 3; // High Capacity SD card - -/** - * define SOFTWARE_SPI to use bit-bang SPI - */ -#if MEGA_SOFT_SPI - #define SOFTWARE_SPI -#elif USE_SOFTWARE_SPI - #define SOFTWARE_SPI -#endif - -// SPI pin definitions - do not edit here - change in SdFatConfig.h -#if DISABLED(SOFTWARE_SPI) - // hardware pin defs - #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. - // The following three pins must not be redefined for hardware SPI. - #define SPI_MOSI_PIN MOSI_PIN - #define SPI_MISO_PIN MISO_PIN - #define SPI_SCK_PIN SCK_PIN -#else // SOFTWARE_SPI - #define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN // SPI chip select pin - #define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN // SPI Master Out Slave In pin - #define SPI_MISO_PIN SOFT_SPI_MISO_PIN // SPI Master In Slave Out pin - #define SPI_SCK_PIN SOFT_SPI_SCK_PIN // SPI Clock pin -#endif // SOFTWARE_SPI - -/** - * \class Sd2Card - * \brief Raw access to SD and SDHC flash memory cards. - */ -class Sd2Card { - public: - - Sd2Card() : errorCode_(SD_CARD_ERROR_INIT_NOT_CALLED), type_(0) {} - - uint32_t cardSize(); - bool erase(uint32_t firstBlock, uint32_t lastBlock); - bool eraseSingleBlockEnable(); - - /** - * Set SD error code. - * \param[in] code value for error code. - */ - void error(uint8_t code) {errorCode_ = code;} - - /** - * \return error code for last error. See Sd2Card.h for a list of error codes. - */ - int errorCode() const {return errorCode_;} - - /** \return error data for last error. */ - int errorData() const {return status_;} - - /** - * Initialize an SD flash memory card with default clock rate and chip - * select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin). - * - * \return true for success or false for failure. - */ - bool init(uint8_t sckRateID = SPI_FULL_SPEED, - pin_t chipSelectPin = SD_CHIP_SELECT_PIN); - bool readBlock(uint32_t block, uint8_t* dst); - - /** - * Read a card's CID register. The CID contains card identification - * information such as Manufacturer ID, Product name, Product serial - * number and Manufacturing date. - * - * \param[out] cid pointer to area for returned data. - * - * \return true for success or false for failure. - */ - bool readCID(cid_t* cid) { return readRegister(CMD10, cid); } - - /** - * Read a card's CSD register. The CSD contains Card-Specific Data that - * provides information regarding access to the card's contents. - * - * \param[out] csd pointer to area for returned data. - * - * \return true for success or false for failure. - */ - bool readCSD(csd_t* csd) { return readRegister(CMD9, csd); } - - bool readData(uint8_t* dst); - bool readStart(uint32_t blockNumber); - bool readStop(); - bool setSckRate(uint8_t sckRateID); - /** - * Return the card type: SD V1, SD V2 or SDHC - * \return 0 - SD V1, 1 - SD V2, or 3 - SDHC. - */ - int type() const {return type_;} - bool writeBlock(uint32_t blockNumber, const uint8_t* src); - bool writeData(const uint8_t* src); - bool writeStart(uint32_t blockNumber, uint32_t eraseCount); - bool writeStop(); - - private: - uint8_t chipSelectPin_, - errorCode_, - spiRate_, - status_, - type_; - - // private functions - uint8_t cardAcmd(uint8_t cmd, uint32_t arg) { - cardCommand(CMD55, 0); - return cardCommand(cmd, arg); - } - uint8_t cardCommand(uint8_t cmd, uint32_t arg); - - bool readData(uint8_t* dst, uint16_t count); - bool readRegister(uint8_t cmd, void* buf); - void chipSelectHigh(); - void chipSelectLow(); - void type(uint8_t value) { type_ = value; } - bool waitNotBusy(uint16_t timeoutMillis); - bool writeData(uint8_t token, const uint8_t* src); -}; - -#endif // _SD2CARD_H_ diff --git a/Marlin_thinkerV2/Marlin/SdBaseFile.cpp b/Marlin_thinkerV2/Marlin/SdBaseFile.cpp deleted file mode 100644 index 3754fefb32..0000000000 --- a/Marlin_thinkerV2/Marlin/SdBaseFile.cpp +++ /dev/null @@ -1,1728 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdBaseFile.h" -#include "Marlin.h" - -SdBaseFile* SdBaseFile::cwd_ = 0; // Pointer to Current Working Directory - -// callback function for date/time -void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; - -// add a cluster to a file -bool SdBaseFile::addCluster() { - if (!vol_->allocContiguous(1, &curCluster_)) return false; - - // if first cluster of file link to directory entry - if (firstCluster_ == 0) { - firstCluster_ = curCluster_; - flags_ |= F_FILE_DIR_DIRTY; - } - return true; -} - -// Add a cluster to a directory file and zero the cluster. -// return with first block of cluster in the cache -bool SdBaseFile::addDirCluster() { - uint32_t block; - // max folder size - if (fileSize_ / sizeof(dir_t) >= 0xFFFF) return false; - - if (!addCluster()) return false; - if (!vol_->cacheFlush()) return false; - - block = vol_->clusterStartBlock(curCluster_); - - // set cache to first block of cluster - vol_->cacheSetBlockNumber(block, true); - - // zero first block of cluster - memset(vol_->cacheBuffer_.data, 0, 512); - - // zero rest of cluster - for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { - if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) return false; - } - // Increase directory file size by cluster size - fileSize_ += 512UL << vol_->clusterSizeShift_; - return true; -} - -// cache a file's directory entry -// return pointer to cached entry or null for failure -dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { - if (!vol_->cacheRawBlock(dirBlock_, action)) return NULL; - return vol_->cache()->dir + dirIndex_; -} - -/** - * Close a file and force cached data and directory information - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include no file is open or an I/O error. - */ -bool SdBaseFile::close() { - bool rtn = sync(); - type_ = FAT_FILE_TYPE_CLOSED; - return rtn; -} - -/** - * Check for contiguous file and return its raw block range. - * - * \param[out] bgnBlock the first block address for the file. - * \param[out] endBlock the last block address for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is not contiguous, file has zero length - * or an I/O error occurred. - */ -bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { - // error if no blocks - if (firstCluster_ == 0) return false; - - for (uint32_t c = firstCluster_; ; c++) { - uint32_t next; - if (!vol_->fatGet(c, &next)) return false; - - // check for contiguous - if (next != (c + 1)) { - // error if not end of chain - if (!vol_->isEOC(next)) return false; - *bgnBlock = vol_->clusterStartBlock(firstCluster_); - *endBlock = vol_->clusterStartBlock(c) - + vol_->blocksPerCluster_ - 1; - return true; - } - } - return false; -} - -/** - * Create and open a new contiguous file of a specified size. - * - * \note This function only supports short DOS 8.3 names. - * See open() for more information. - * - * \param[in] dirFile The directory where the file will be created. - * \param[in] path A path with a valid DOS 8.3 file name. - * \param[in] size The desired file size. - * - * \return true for success, false for failure. - * Reasons for failure include \a path contains - * an invalid DOS 8.3 file name, the FAT volume has not been initialized, - * a file is already open, the file already exists, the root - * directory is full or an I/O error. - * - */ -bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) { - uint32_t count; - // don't allow zero length file - if (size == 0) return false; - if (!open(dirFile, path, O_CREAT | O_EXCL | O_RDWR)) return false; - - // calculate number of clusters needed - count = ((size - 1) >> (vol_->clusterSizeShift_ + 9)) + 1; - - // allocate clusters - if (!vol_->allocContiguous(count, &firstCluster_)) { - remove(); - return false; - } - fileSize_ = size; - - // insure sync() will update dir entry - flags_ |= F_FILE_DIR_DIRTY; - - return sync(); -} - -/** - * Return a file's directory entry. - * - * \param[out] dir Location for return of the file's directory entry. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::dirEntry(dir_t* dir) { - dir_t* p; - // make sure fields on SD are correct - if (!sync()) return false; - - // read entry - p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // copy to caller's struct - memcpy(dir, p, sizeof(dir_t)); - return true; -} - -/** - * Format the name field of \a dir into the 13 byte array - * \a name in standard 8.3 short name format. - * - * \param[in] dir The directory structure containing the name. - * \param[out] name A 13 byte char array for the formatted name. - */ -void SdBaseFile::dirName(const dir_t& dir, char* name) { - uint8_t j = 0; - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) name[j++] = '.'; - name[j++] = dir.name[i]; - } - name[j] = 0; -} - -/** - * Test for the existence of a file in a directory - * - * \param[in] name Name of the file to be tested for. - * - * The calling instance must be an open directory file. - * - * dirFile.exists("TOFIND.TXT") searches for "TOFIND.TXT" in the directory - * dirFile. - * - * \return true if the file exists else false. - */ -bool SdBaseFile::exists(const char* name) { - SdBaseFile file; - return file.open(this, name, O_READ); -} - -/** - * Get a string from a file. - * - * fgets() reads bytes from a file into the array pointed to by \a str, until - * \a num - 1 bytes are read, or a delimiter is read and transferred to \a str, - * or end-of-file is encountered. The string is then terminated - * with a null byte. - * - * fgets() deletes CR, '\\r', from the string. This insures only a '\\n' - * terminates the string for Windows text files which use CRLF for newline. - * - * \param[out] str Pointer to the array where the string is stored. - * \param[in] num Maximum number of characters to be read - * (including the final null byte). Usually the length - * of the array \a str is used. - * \param[in] delim Optional set of delimiters. The default is "\n". - * - * \return For success fgets() returns the length of the string in \a str. - * If no data is read, fgets() returns zero for EOF or -1 if an error occurred. - **/ -int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { - char ch; - int16_t n = 0; - int16_t r = -1; - while ((n + 1) < num && (r = read(&ch, 1)) == 1) { - // delete CR - if (ch == '\r') continue; - str[n++] = ch; - if (!delim) { - if (ch == '\n') break; - } - else { - if (strchr(delim, ch)) break; - } - } - if (r < 0) { - // read error - return -1; - } - str[n] = '\0'; - return n; -} - -/** - * Get a file's name - * - * \param[out] name An array of 13 characters for the file's name. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::getFilename(char * const name) { - if (!isOpen()) return false; - - if (isRoot()) { - name[0] = '/'; - name[1] = '\0'; - return true; - } - // cache entry - dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // format name - dirName(*p, name); - return true; -} - -void SdBaseFile::getpos(filepos_t* pos) { - pos->position = curPosition_; - pos->cluster = curCluster_; -} - -/** - * List directory contents. - * - * \param[in] pr Print stream for list. - * - * \param[in] flags The inclusive OR of - * - * LS_DATE - %Print file modification date - * - * LS_SIZE - %Print file size. - * - * LS_R - Recursive list of subdirectories. - * - * \param[in] indent Amount of space before file name. Used for recursive - * list to indicate subdirectory level. - */ -void SdBaseFile::ls(uint8_t flags, uint8_t indent) { - rewind(); - int8_t status; - while ((status = lsPrintNext(flags, indent))) { - if (status > 1 && (flags & LS_R)) { - uint16_t index = curPosition() / 32 - 1; - SdBaseFile s; - if (s.open(this, index, O_READ)) s.ls(flags, indent + 2); - seekSet(32 * (index + 1)); - } - } -} - -// saves 32 bytes on stack for ls recursion -// return 0 - EOF, 1 - normal file, or 2 - directory -int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { - dir_t dir; - uint8_t w = 0; - - while (1) { - if (read(&dir, sizeof(dir)) != sizeof(dir)) return 0; - if (dir.name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entries for . and .. - if (dir.name[0] != DIR_NAME_DELETED && dir.name[0] != '.' - && DIR_IS_FILE_OR_SUBDIR(&dir)) break; - } - // indent for dir level - for (uint8_t i = 0; i < indent; i++) SERIAL_CHAR(' '); - - // print name - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) { - SERIAL_CHAR('.'); - w++; - } - SERIAL_CHAR(dir.name[i]); - w++; - } - if (DIR_IS_SUBDIR(&dir)) { - SERIAL_CHAR('/'); - w++; - } - if (flags & (LS_DATE | LS_SIZE)) { - while (w++ < 14) SERIAL_CHAR(' '); - } - // print modify date/time if requested - if (flags & LS_DATE) { - SERIAL_CHAR(' '); - printFatDate(dir.lastWriteDate); - SERIAL_CHAR(' '); - printFatTime(dir.lastWriteTime); - } - // print size if requested - if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) { - SERIAL_CHAR(' '); - SERIAL_ECHO(dir.fileSize); - } - SERIAL_EOL(); - return DIR_IS_FILE(&dir) ? 1 : 2; -} - -// Format directory name field from a 8.3 name string -bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { - uint8_t n = 7, // Max index until a dot is found - i = 11; - while (i) name[--i] = ' '; // Set whole FILENAME.EXT to spaces - while (*str && *str != '/') { // For each character, until nul or '/' - uint8_t c = *str++; // Get char and advance - if (c == '.') { // For a dot... - if (n == 10) return false; // Already moved the max index? fail! - n = 10; // Move the max index for full 8.3 name - i = 8; // Move up to the extension place - } - else { - // Fail for illegal characters - PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); - while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; - if (i > n || c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters - name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name - } - } - *ptr = str; // Set passed pointer to the end - return name[0] != ' '; // Return true if any name was set -} - -/** - * Make a new directory. - * - * \param[in] parent An open SdFat instance for the directory that will contain - * the new directory. - * - * \param[in] path A path with a valid 8.3 DOS name for the new directory. - * - * \param[in] pFlag Create missing parent directories if true. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a parent is not a - * directory, \a path is invalid or already exists in \a parent. - */ -bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile* sub = &dir1; - SdBaseFile* start = parent; - - if (!parent || isOpen()) return false; - - if (*path == '/') { - while (*path == '/') path++; - if (!parent->isRoot()) { - if (!dir2.openRoot(parent->vol_)) return false; - parent = &dir2; - } - } - while (1) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) { - if (!pFlag || !sub->mkdir(parent, dname)) - return false; - } - if (parent != start) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return mkdir(parent, dname); -} - -bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { - uint32_t block; - dir_t d; - dir_t* p; - - if (!parent->isDir()) return false; - - // create a normal file - if (!open(parent, dname, O_CREAT | O_EXCL | O_RDWR)) return false; - - // convert file to directory - flags_ = O_READ; - type_ = FAT_FILE_TYPE_SUBDIR; - - // allocate and zero first cluster - if (!addDirCluster()) return false; - - // force entry to SD - if (!sync()) return false; - - // cache entry - should already be in cache due to sync() call - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - - // change directory entry attribute - p->attributes = DIR_ATT_DIRECTORY; - - // make entry for '.' - memcpy(&d, p, sizeof(d)); - d.name[0] = '.'; - for (uint8_t i = 1; i < 11; i++) d.name[i] = ' '; - - // cache block for '.' and '..' - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - - // copy '.' to block - memcpy(&vol_->cache()->dir[0], &d, sizeof(d)); - - // make entry for '..' - d.name[1] = '.'; - if (parent->isRoot()) { - d.firstClusterLow = 0; - d.firstClusterHigh = 0; - } - else { - d.firstClusterLow = parent->firstCluster_ & 0xFFFF; - d.firstClusterHigh = parent->firstCluster_ >> 16; - } - // copy '..' to block - memcpy(&vol_->cache()->dir[1], &d, sizeof(d)); - - // write first block - return vol_->cacheFlush(); -} - -/** - * Open a file in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::open(const char* path, uint8_t oflag) { - return open(cwd_, path, oflag); -} - -/** - * Open a file or directory by name. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * O_READ - Open for reading. - * - * O_RDONLY - Same as O_READ. - * - * O_WRITE - Open for writing. - * - * O_WRONLY - Same as O_WRITE. - * - * O_RDWR - Open for reading and writing. - * - * O_APPEND - If set, the file offset shall be set to the end of the - * file prior to each write. - * - * O_AT_END - Set the initial position at the end of the file. - * - * O_CREAT - If the file exists, this flag has no effect except as noted - * under O_EXCL below. Otherwise, the file shall be created - * - * O_EXCL - If O_CREAT and O_EXCL are set, open() shall fail if the file exists. - * - * O_SYNC - Call sync() after each write. This flag should not be used with - * write(uint8_t), write_P(PGM_P), writeln_P(PGM_P), or the Arduino Print class. - * These functions do character at a time writes so sync() will be called - * after each byte. - * - * O_TRUNC - If the file exists and is a regular file, and the file is - * successfully opened and is not read only, its length shall be truncated to 0. - * - * WARNING: A given file must not be opened by more than one SdBaseFile object - * of file corruption may occur. - * - * \note Directory files must be opened read only. Write and truncation is - * not allowed for directory files. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a dirFile is not - * a directory, \a path is invalid, the file does not exist - * or can't be opened in the access mode specified by oflag. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile *parent = dirFile, *sub = &dir1; - - if (!dirFile || isOpen()) return false; - - if (*path == '/') { // Path starts with '/' - if (!dirFile->isRoot()) { // Is the passed dirFile the root? - if (!dir2.openRoot(dirFile->vol_)) return false; // Get the root in dir2, if possible - parent = &dir2; // Change 'parent' to point at the root dir - } - while (*path == '/') path++; // Skip all leading slashes - } - - for (;;) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) return false; - if (parent != dirFile) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return open(parent, dname, oflag); -} - -// open with filename in dname -bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { - bool emptyFound = false, fileFound = false; - uint8_t index; - dir_t* p; - - vol_ = dirFile->vol_; - - dirFile->rewind(); - // search for file - - while (dirFile->curPosition_ < dirFile->fileSize_) { - index = 0xF & (dirFile->curPosition_ >> 5); - p = dirFile->readDirCache(); - if (!p) return false; - - if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { - // remember first empty slot - if (!emptyFound) { - dirBlock_ = dirFile->vol_->cacheBlockNumber(); - dirIndex_ = index; - emptyFound = true; - } - // done if no entries follow - if (p->name[0] == DIR_NAME_FREE) break; - } - else if (!memcmp(dname, p->name, 11)) { - fileFound = true; - break; - } - } - if (fileFound) { - // don't open existing file if O_EXCL - if (oflag & O_EXCL) return false; - } - else { - // don't create unless O_CREAT and O_WRITE - if (!(oflag & O_CREAT) || !(oflag & O_WRITE)) return false; - if (emptyFound) { - index = dirIndex_; - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - } - else { - if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; - - // add and zero cluster for dirFile - first cluster is in cache for write - if (!dirFile->addDirCluster()) return false; - - // use first entry in cluster - p = dirFile->vol_->cache()->dir; - index = 0; - } - // initialize as empty file - memset(p, 0, sizeof(*p)); - memcpy(p->name, dname, 11); - - // set timestamps - if (dateTime_) { - // call user date/time function - dateTime_(&p->creationDate, &p->creationTime); - } - else { - // use default date/time - p->creationDate = FAT_DEFAULT_DATE; - p->creationTime = FAT_DEFAULT_TIME; - } - p->lastAccessDate = p->creationDate; - p->lastWriteDate = p->creationDate; - p->lastWriteTime = p->creationTime; - - // write entry to SD - if (!dirFile->vol_->cacheFlush()) return false; - } - // open entry in cache - return openCachedEntry(index, oflag); -} - -/** - * Open a file by index. - * - * \param[in] dirFile An open SdFat instance for the directory. - * - * \param[in] index The \a index of the directory entry for the file to be - * opened. The value for \a index is (directory file position)/32. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { - dir_t* p; - - vol_ = dirFile->vol_; - - // error if already open - if (isOpen() || !dirFile) return false; - - // don't open existing file if O_EXCL - user call error - if (oflag & O_EXCL) return false; - - // seek to location of entry - if (!dirFile->seekSet(32 * index)) return false; - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // error if empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_FREE || - p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - return false; - } - // open cached entry - return openCachedEntry(index & 0xF, oflag); -} - -// open a cached directory entry. Assumes vol_ is initialized -bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { - // location of entry in cache - dir_t* p = &vol_->cache()->dir[dirIndex]; - - // write or truncate is an error for a directory or read-only file - if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { - if (oflag & (O_WRITE | O_TRUNC)) goto FAIL; - } - // remember location of directory entry on SD - dirBlock_ = vol_->cacheBlockNumber(); - dirIndex_ = dirIndex; - - // copy first cluster number for directory fields - firstCluster_ = (uint32_t)p->firstClusterHigh << 16; - firstCluster_ |= p->firstClusterLow; - - // make sure it is a normal file or subdirectory - if (DIR_IS_FILE(p)) { - fileSize_ = p->fileSize; - type_ = FAT_FILE_TYPE_NORMAL; - } - else if (DIR_IS_SUBDIR(p)) { - if (!vol_->chainSize(firstCluster_, &fileSize_)) goto FAIL; - type_ = FAT_FILE_TYPE_SUBDIR; - } - else - goto FAIL; - - // save open flags for read/write - flags_ = oflag & F_OFLAG; - - // set to start of file - curCluster_ = 0; - curPosition_ = 0; - if ((oflag & O_TRUNC) && !truncate(0)) return false; - return oflag & O_AT_END ? seekEnd(0) : true; - - FAIL: - type_ = FAT_FILE_TYPE_CLOSED; - return false; -} - -/** - * Open the next file or subdirectory in a directory. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { - dir_t* p; - uint8_t index; - - if (!dirFile) return false; - - // error if already open - if (isOpen()) return false; - - vol_ = dirFile->vol_; - - while (1) { - index = 0xF & (dirFile->curPosition_ >> 5); - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // done if last entry - if (p->name[0] == DIR_NAME_FREE) return false; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - continue; - } - // must be file or dir - if (DIR_IS_FILE_OR_SUBDIR(p)) { - return openCachedEntry(index, oflag); - } - } - return false; -} - -#if 0 -/** - * Open a directory's parent directory. - * - * \param[in] dir Parent of this directory will be opened. Must not be root. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::openParent(SdBaseFile* dir) { - dir_t entry; - dir_t* p; - SdBaseFile file; - uint32_t c; - uint32_t cluster; - uint32_t lbn; - // error if already open or dir is root or dir is not a directory - if (isOpen() || !dir || dir->isRoot() || !dir->isDir()) return false; - vol_ = dir->vol_; - // position to '..' - if (!dir->seekSet(32)) return false; - // read '..' entry - if (dir->read(&entry, sizeof(entry)) != 32) return false; - // verify it is '..' - if (entry.name[0] != '.' || entry.name[1] != '.') return false; - // start cluster for '..' - cluster = entry.firstClusterLow; - cluster |= (uint32_t)entry.firstClusterHigh << 16; - if (cluster == 0) return openRoot(vol_); - // start block for '..' - lbn = vol_->clusterStartBlock(cluster); - // first block of parent dir - if (!vol_->cacheRawBlock(lbn, SdVolume::CACHE_FOR_READ)) return false; - - p = &vol_->cacheBuffer_.dir[1]; - // verify name for '../..' - if (p->name[0] != '.' || p->name[1] != '.') return false; - // '..' is pointer to first cluster of parent. open '../..' to find parent - if (p->firstClusterHigh == 0 && p->firstClusterLow == 0) { - if (!file.openRoot(dir->volume())) return false; - } - else if (!file.openCachedEntry(1, O_READ)) - return false; - - // search for parent in '../..' - do { - if (file.readDir(&entry, NULL) != 32) return false; - c = entry.firstClusterLow; - c |= (uint32_t)entry.firstClusterHigh << 16; - } while (c != cluster); - - // open parent - return open(&file, file.curPosition() / 32 - 1, O_READ); -} -#endif - -/** - * Open a volume's root directory. - * - * \param[in] vol The FAT volume containing the root directory to be opened. - * - * \return true for success, false for failure. - * Reasons for failure include the file is already open, the FAT volume has - * not been initialized or it a FAT12 volume. - */ -bool SdBaseFile::openRoot(SdVolume* vol) { - // error if file is already open - if (isOpen()) return false; - - if (vol->fatType() == 16 || (FAT12_SUPPORT && vol->fatType() == 12)) { - type_ = FAT_FILE_TYPE_ROOT_FIXED; - firstCluster_ = 0; - fileSize_ = 32 * vol->rootDirEntryCount(); - } - else if (vol->fatType() == 32) { - type_ = FAT_FILE_TYPE_ROOT32; - firstCluster_ = vol->rootDirStart(); - if (!vol->chainSize(firstCluster_, &fileSize_)) return false; - } - else // volume is not initialized, invalid, or FAT12 without support - return false; - - vol_ = vol; - // read only - flags_ = O_READ; - - // set to start of file - curCluster_ = curPosition_ = 0; - - // root has no directory entry - dirBlock_ = dirIndex_ = 0; - return true; -} - -/** - * Return the next available byte without consuming it. - * - * \return The byte if no error and not at eof else -1; - */ -int SdBaseFile::peek() { - filepos_t pos; - getpos(&pos); - int c = read(); - if (c >= 0) setpos(&pos); - return c; -} - -// print uint8_t with width 2 -static void print2u(const uint8_t v) { - if (v < 10) SERIAL_CHAR('0'); - SERIAL_ECHO_F(v, DEC); -} - -/** - * %Print a directory date field to Serial. - * - * Format is yyyy-mm-dd. - * - * \param[in] fatDate The date field from a directory entry. - */ - - -/** - * %Print a directory date field. - * - * Format is yyyy-mm-dd. - * - * \param[in] pr Print stream for output. - * \param[in] fatDate The date field from a directory entry. - */ -void SdBaseFile::printFatDate(uint16_t fatDate) { - SERIAL_ECHO(FAT_YEAR(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_MONTH(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_DAY(fatDate)); -} - - -/** - * %Print a directory time field. - * - * Format is hh:mm:ss. - * - * \param[in] pr Print stream for output. - * \param[in] fatTime The time field from a directory entry. - */ -void SdBaseFile::printFatTime(uint16_t fatTime) { - print2u(FAT_HOUR(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_MINUTE(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_SECOND(fatTime)); -} - -/** - * Print a file's name to Serial - * - * \return true for success, false for failure. - */ -bool SdBaseFile::printName() { - char name[FILENAME_LENGTH]; - if (!getFilename(name)) return false; - SERIAL_ECHO(name); - return true; -} - -/** - * Read the next byte from a file. - * - * \return For success read returns the next byte in the file as an int. - * If an error occurs or end of file is reached -1 is returned. - */ -int16_t SdBaseFile::read() { - uint8_t b; - return read(&b, 1) == 1 ? b : -1; -} - -/** - * Read data from a file starting at the current position. - * - * \param[out] buf Pointer to the location that will receive the data. - * - * \param[in] nbyte Maximum number of bytes to read. - * - * \return For success read() returns the number of bytes read. - * A value less than \a nbyte, including zero, will be returned - * if end of file is reached. - * If an error occurs, read() returns -1. Possible errors include - * read() called before a file has been opened, corrupt file system - * or an I/O error occurred. - */ -int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { - uint8_t* dst = reinterpret_cast(buf); - uint16_t offset, toRead; - uint32_t block; // raw device block number - - // error if not open or write only - if (!isOpen() || !(flags_ & O_READ)) return -1; - - // max bytes left in file - NOMORE(nbyte, fileSize_ - curPosition_); - - // amount left to read - toRead = nbyte; - while (toRead > 0) { - offset = curPosition_ & 0x1FF; // offset in block - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - block = vol_->rootDirStart() + (curPosition_ >> 9); - } - else { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - if (offset == 0 && blockOfCluster == 0) { - // start of new cluster - if (curPosition_ == 0) - curCluster_ = firstCluster_; // use first cluster in file - else if (!vol_->fatGet(curCluster_, &curCluster_)) // get next cluster from FAT - return -1; - } - block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - } - uint16_t n = toRead; - - // amount to be read from current block - NOMORE(n, 512 - offset); - - // no buffering needed if n == 512 - if (n == 512 && block != vol_->cacheBlockNumber()) { - if (!vol_->readBlock(block, dst)) return -1; - } - else { - // read block to cache and copy data to caller - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return -1; - uint8_t* src = vol_->cache()->data + offset; - memcpy(dst, src, n); - } - dst += n; - curPosition_ += n; - toRead -= n; - } - return nbyte; -} - -/** - * Read the next entry in a directory. - * - * \param[out] dir The dir_t struct that will receive the data. - * - * \return For success readDir() returns the number of bytes read. - * A value of zero will be returned if end of file is reached. - * If an error occurs, readDir() returns -1. Possible errors include - * readDir() called before a directory has been opened, this is not - * a directory file or an I/O error occurred. - */ -int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { - int16_t n; - // if not a directory file or miss-positioned return an error - if (!isDir() || (0x1F & curPosition_)) return -1; - - // If we have a longFilename buffer, mark it as invalid. - // If a long filename is found it will be filled automatically. - if (longFilename) longFilename[0] = '\0'; - - while (1) { - - n = read(dir, sizeof(dir_t)); - if (n != sizeof(dir_t)) return n ? -1 : 0; - - // last entry if DIR_NAME_FREE - if (dir->name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entry for . and .. - if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') { - if (longFilename) longFilename[0] = '\0'; // Invalidate erased file long name, if any - continue; - } - - // Fill the long filename if we have a long filename entry. - // Long filename entries are stored before the short filename. - if (longFilename && DIR_IS_LONG_NAME(dir)) { - vfat_t* VFAT = (vfat_t*)dir; - // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 - if (VFAT->firstClusterLow == 0) { - const uint8_t seq = VFAT->sequenceNumber & 0x1F; - if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { - // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table. - n = (seq - 1) * (FILENAME_LENGTH); - for (uint8_t i = 0; i < FILENAME_LENGTH; i++) - longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; - // If this VFAT entry is the last one, add a NUL terminator at the end of the string - if (VFAT->sequenceNumber & 0x40) longFilename[n + FILENAME_LENGTH] = '\0'; - } - } - } - // Return if normal file or subdirectory - if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; - } -} - - -// Read next directory entry into the cache -// Assumes file is correctly positioned -dir_t* SdBaseFile::readDirCache() { - uint8_t i; - // error if not directory - if (!isDir()) return 0; - - // index of entry in cache - i = (curPosition_ >> 5) & 0xF; - - // use read to locate and cache block - if (read() < 0) return 0; - - // advance to next entry - curPosition_ += 31; - - // return pointer to entry - return vol_->cache()->dir + i; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file read-only, is a directory, - * or an I/O error occurred. - */ -bool SdBaseFile::remove() { - dir_t* d; - // free any clusters - will fail if read-only or directory - if (!truncate(0)) return false; - - // cache directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // set this file closed - type_ = FAT_FILE_TYPE_CLOSED; - - // write entry to SD - return vol_->cacheFlush(); - return true; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \param[in] dirFile The directory that contains the file. - * \param[in] path Path for the file to be removed. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file is a directory, is read only, - * \a dirFile is not a directory, \a path is not found - * or an I/O error occurred. - */ -bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { - SdBaseFile file; - return file.open(dirFile, path, O_WRITE) ? file.remove() : false; -} - -/** - * Rename a file or subdirectory. - * - * \param[in] dirFile Directory for the new path. - * \param[in] newPath New path name for the file/directory. - * - * \return true for success, false for failure. - * Reasons for failure include \a dirFile is not open or is not a directory - * file, newPath is invalid or already exists, or an I/O error occurs. - */ -bool SdBaseFile::rename(SdBaseFile* dirFile, const char* newPath) { - dir_t entry; - uint32_t dirCluster = 0; - SdBaseFile file; - dir_t* d; - - // must be an open file or subdirectory - if (!(isFile() || isSubDir())) return false; - - // can't move file - if (vol_ != dirFile->vol_) return false; - - // sync() and cache directory entry - sync(); - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // save directory entry - memcpy(&entry, d, sizeof(entry)); - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // make directory entry for new path - if (isFile()) { - if (!file.open(dirFile, newPath, O_CREAT | O_EXCL | O_WRITE)) { - goto restore; - } - } - else { - // don't create missing path prefix components - if (!file.mkdir(dirFile, newPath, false)) { - goto restore; - } - // save cluster containing new dot dot - dirCluster = file.firstCluster_; - } - // change to new directory entry - dirBlock_ = file.dirBlock_; - dirIndex_ = file.dirIndex_; - - // mark closed to avoid possible destructor close call - file.type_ = FAT_FILE_TYPE_CLOSED; - - // cache new directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy all but name field to new directory entry - memcpy(&d->attributes, &entry.attributes, sizeof(entry) - sizeof(d->name)); - - // update dot dot if directory - if (dirCluster) { - // get new dot dot - uint32_t block = vol_->clusterStartBlock(dirCluster); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return false; - memcpy(&entry, &vol_->cache()->dir[1], sizeof(entry)); - - // free unused cluster - if (!vol_->freeChain(dirCluster)) return false; - - // store new dot dot - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - memcpy(&vol_->cache()->dir[1], &entry, sizeof(entry)); - } - return vol_->cacheFlush(); - -restore: - if ((d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE))) { - // restore entry - d->name[0] = entry.name[0]; - vol_->cacheFlush(); - } - return false; -} - -/** - * Remove a directory file. - * - * The directory file will be removed only if it is empty and is not the - * root directory. rmdir() follows DOS and Windows and ignores the - * read-only attribute for the directory. - * - * \note This function should not be used to delete the 8.3 version of a - * directory that has a long name. For example if a directory has the - * long name "New folder" you should not delete the 8.3 name "NEWFOL~1". - * - * \return true for success, false for failure. - * Reasons for failure include the file is not a directory, is the root - * directory, is not empty, or an I/O error occurred. - */ -bool SdBaseFile::rmdir() { - // must be open subdirectory - if (!isSubDir()) return false; - - rewind(); - - // make sure directory is empty - while (curPosition_ < fileSize_) { - dir_t* p = readDirCache(); - if (!p) return false; - // done if past last used entry - if (p->name[0] == DIR_NAME_FREE) break; - // skip empty slot, '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - // error not empty - if (DIR_IS_FILE_OR_SUBDIR(p)) return false; - } - // convert empty directory to normal file for remove - type_ = FAT_FILE_TYPE_NORMAL; - flags_ |= O_WRITE; - return remove(); -} - -/** - * Recursively delete a directory and all contained files. - * - * This is like the Unix/Linux 'rm -rf *' if called with the root directory - * hence the name. - * - * Warning - This will remove all contents of the directory including - * subdirectories. The directory will then be removed if it is not root. - * The read-only attribute for files will be ignored. - * - * \note This function should not be used to delete the 8.3 version of - * a directory that has a long name. See remove() and rmdir(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::rmRfStar() { - uint32_t index; - SdBaseFile f; - rewind(); - while (curPosition_ < fileSize_) { - // remember position - index = curPosition_ / 32; - - dir_t* p = readDirCache(); - if (!p) return false; - - // done if past last entry - if (p->name[0] == DIR_NAME_FREE) break; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - - // skip if part of long file name or volume label in root - if (!DIR_IS_FILE_OR_SUBDIR(p)) continue; - - if (!f.open(this, index, O_READ)) return false; - if (f.isSubDir()) { - // recursively delete - if (!f.rmRfStar()) return false; - } - else { - // ignore read-only - f.flags_ |= O_WRITE; - if (!f.remove()) return false; - } - // position to next entry if required - if (curPosition_ != (32 * (index + 1))) { - if (!seekSet(32 * (index + 1))) return false; - } - } - // don't try to delete root - if (!isRoot()) { - if (!rmdir()) return false; - } - return true; -} - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdBaseFile::SdBaseFile(const char* path, uint8_t oflag) { - type_ = FAT_FILE_TYPE_CLOSED; - writeError = false; - open(path, oflag); -} - -/** - * Sets a file's position. - * - * \param[in] pos The new position in bytes from the beginning of the file. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::seekSet(const uint32_t pos) { - uint32_t nCur, nNew; - // error if file not open or seek past end of file - if (!isOpen() || pos > fileSize_) return false; - - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - curPosition_ = pos; - return true; - } - if (pos == 0) { - curCluster_ = curPosition_ = 0; // set position to start of file - return true; - } - - // calculate cluster index for cur and new position - nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); - nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); - - if (nNew < nCur || curPosition_ == 0) - curCluster_ = firstCluster_; // must follow chain from first cluster - else - nNew -= nCur; // advance from curPosition - - while (nNew--) - if (!vol_->fatGet(curCluster_, &curCluster_)) return false; - - curPosition_ = pos; - return true; -} - -void SdBaseFile::setpos(filepos_t* pos) { - curPosition_ = pos->position; - curCluster_ = pos->cluster; -} - -/** - * The sync() call causes all modified data and directory fields - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include a call to sync() before a file has been - * opened or an I/O error. - */ -bool SdBaseFile::sync() { - // only allow open files and directories - if (!isOpen()) goto FAIL; - - if (flags_ & F_FILE_DIR_DIRTY) { - dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - // check for deleted by another open file object - if (!d || d->name[0] == DIR_NAME_DELETED) goto FAIL; - - // do not set filesize for dir files - if (!isDir()) d->fileSize = fileSize_; - - // update first cluster fields - d->firstClusterLow = firstCluster_ & 0xFFFF; - d->firstClusterHigh = firstCluster_ >> 16; - - // set modify time if user supplied a callback date/time function - if (dateTime_) { - dateTime_(&d->lastWriteDate, &d->lastWriteTime); - d->lastAccessDate = d->lastWriteDate; - } - // clear directory dirty - flags_ &= ~F_FILE_DIR_DIRTY; - } - return vol_->cacheFlush(); - - FAIL: - writeError = true; - return false; -} - -/** - * Copy a file's timestamps - * - * \param[in] file File to copy timestamps from. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(SdBaseFile* file) { - dir_t* d; - dir_t dir; - - // get timestamps - if (!file->dirEntry(&dir)) return false; - - // update directory fields - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy timestamps - d->lastAccessDate = dir.lastAccessDate; - d->creationDate = dir.creationDate; - d->creationTime = dir.creationTime; - d->creationTimeTenths = dir.creationTimeTenths; - d->lastWriteDate = dir.lastWriteDate; - d->lastWriteTime = dir.lastWriteTime; - - // write back entry - return vol_->cacheFlush(); -} - -/** - * Set a file's timestamps in its directory entry. - * - * \param[in] flags Values for \a flags are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * T_ACCESS - Set the file's last access date. - * - * T_CREATE - Set the file's creation date and time. - * - * T_WRITE - Set the file's last write/modification date and time. - * - * \param[in] year Valid range 1980 - 2107 inclusive. - * - * \param[in] month Valid range 1 - 12 inclusive. - * - * \param[in] day Valid range 1 - 31 inclusive. - * - * \param[in] hour Valid range 0 - 23 inclusive. - * - * \param[in] minute Valid range 0 - 59 inclusive. - * - * \param[in] second Valid range 0 - 59 inclusive - * - * \note It is possible to set an invalid date since there is no check for - * the number of days in a month. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, - uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { - uint16_t dirDate, dirTime; - dir_t* d; - - if (!isOpen() - || year < 1980 - || year > 2107 - || month < 1 - || month > 12 - || day < 1 - || day > 31 - || hour > 23 - || minute > 59 - || second > 59) { - return false; - } - // update directory entry - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - dirDate = FAT_DATE(year, month, day); - dirTime = FAT_TIME(hour, minute, second); - if (flags & T_ACCESS) { - d->lastAccessDate = dirDate; - } - if (flags & T_CREATE) { - d->creationDate = dirDate; - d->creationTime = dirTime; - // seems to be units of 1/100 second not 1/10 as Microsoft states - d->creationTimeTenths = second & 1 ? 100 : 0; - } - if (flags & T_WRITE) { - d->lastWriteDate = dirDate; - d->lastWriteTime = dirTime; - } - return vol_->cacheFlush(); -} - -/** - * Truncate a file to a specified length. The current file position - * will be maintained if it is less than or equal to \a length otherwise - * it will be set to end of file. - * - * \param[in] length The desired length for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is read only, file is a directory, - * \a length is greater than the current file size or an I/O error occurs. - */ -bool SdBaseFile::truncate(uint32_t length) { - uint32_t newPos; - // error if not a normal file or read-only - if (!isFile() || !(flags_ & O_WRITE)) return false; - - // error if length is greater than current size - if (length > fileSize_) return false; - - // fileSize and length are zero - nothing to do - if (fileSize_ == 0) return true; - - // remember position for seek after truncation - newPos = curPosition_ > length ? length : curPosition_; - - // position to last cluster in truncated file - if (!seekSet(length)) return false; - - if (length == 0) { - // free all clusters - if (!vol_->freeChain(firstCluster_)) return false; - firstCluster_ = 0; - } - else { - uint32_t toFree; - if (!vol_->fatGet(curCluster_, &toFree)) return false; - - if (!vol_->isEOC(toFree)) { - // free extra clusters - if (!vol_->freeChain(toFree)) return false; - - // current cluster is end of chain - if (!vol_->fatPutEOC(curCluster_)) return false; - } - } - fileSize_ = length; - - // need to update directory entry - flags_ |= F_FILE_DIR_DIRTY; - - if (!sync()) return false; - - // set file to correct position - return seekSet(newPos); -} - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { - // convert void* to uint8_t* - must be before goto statements - const uint8_t* src = reinterpret_cast(buf); - - // number of bytes left to write - must be before goto statements - uint16_t nToWrite = nbyte; - - // error if not a normal file or is read-only - if (!isFile() || !(flags_ & O_WRITE)) goto FAIL; - - // seek to end of file if append flag - if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { - if (!seekEnd()) goto FAIL; - } - - while (nToWrite > 0) { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - uint16_t blockOffset = curPosition_ & 0x1FF; - if (blockOfCluster == 0 && blockOffset == 0) { - // start of new cluster - if (curCluster_ == 0) { - if (firstCluster_ == 0) { - // allocate first cluster of file - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = firstCluster_; - } - } - else { - uint32_t next; - if (!vol_->fatGet(curCluster_, &next)) goto FAIL; - if (vol_->isEOC(next)) { - // add cluster if at end of chain - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = next; - } - } - } - // max space in block - uint16_t n = 512 - blockOffset; - - // lesser of space and amount to write - NOMORE(n, nToWrite); - - // block for data write - uint32_t block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - if (n == 512) { - // full block - don't need to use cache - if (vol_->cacheBlockNumber() == block) { - // invalidate cache if block is in cache - vol_->cacheSetBlockNumber(0xFFFFFFFF, false); - } - if (!vol_->writeBlock(block, src)) goto FAIL; - } - else { - if (blockOffset == 0 && curPosition_ >= fileSize_) { - // start of new block don't need to read into cache - if (!vol_->cacheFlush()) goto FAIL; - // set cache dirty and SD address of block - vol_->cacheSetBlockNumber(block, true); - } - else { - // rewrite part of block - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto FAIL; - } - uint8_t* dst = vol_->cache()->data + blockOffset; - memcpy(dst, src, n); - } - curPosition_ += n; - src += n; - nToWrite -= n; - } - if (curPosition_ > fileSize_) { - // update fileSize and insure sync will update dir entry - fileSize_ = curPosition_; - flags_ |= F_FILE_DIR_DIRTY; - } - else if (dateTime_ && nbyte) { - // insure sync will update modified date and time - flags_ |= F_FILE_DIR_DIRTY; - } - - if (flags_ & O_SYNC) { - if (!sync()) goto FAIL; - } - return nbyte; - - FAIL: - // return for write error - writeError = true; - return -1; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/SdBaseFile.h b/Marlin_thinkerV2/Marlin/SdBaseFile.h deleted file mode 100644 index 12216bdc3c..0000000000 --- a/Marlin_thinkerV2/Marlin/SdBaseFile.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdBaseFile class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDBASEFILE_H_ -#define _SDBASEFILE_H_ - -#include "SdFatConfig.h" -#include "SdVolume.h" - -#include - -/** - * \struct filepos_t - * \brief internal type for istream - * do not use in user apps - */ -struct filepos_t { - uint32_t position; // stream byte position - uint32_t cluster; // cluster of position - filepos_t() : position(0), cluster(0) {} -}; - -// use the gnu style oflag in open() -uint8_t const O_READ = 0x01, // open() oflag for reading - O_RDONLY = O_READ, // open() oflag - same as O_IN - O_WRITE = 0x02, // open() oflag for write - O_WRONLY = O_WRITE, // open() oflag - same as O_WRITE - O_RDWR = (O_READ | O_WRITE), // open() oflag for reading and writing - O_ACCMODE = (O_READ | O_WRITE), // open() oflag mask for access modes - O_APPEND = 0x04, // The file offset shall be set to the end of the file prior to each write. - O_SYNC = 0x08, // Synchronous writes - call sync() after each write - O_TRUNC = 0x10, // Truncate the file to zero length - O_AT_END = 0x20, // Set the initial position at the end of the file - O_CREAT = 0x40, // Create the file if nonexistent - O_EXCL = 0x80; // If O_CREAT and O_EXCL are set, open() shall fail if the file exists - -// SdBaseFile class static and const definitions - -// flags for ls() -uint8_t const LS_DATE = 1, // ls() flag to print modify date - LS_SIZE = 2, // ls() flag to print file size - LS_R = 4; // ls() flag for recursive list of subdirectories - - -// flags for timestamp -uint8_t const T_ACCESS = 1, // Set the file's last access date - T_CREATE = 2, // Set the file's creation date and time - T_WRITE = 4; // Set the file's write date and time - -// values for type_ -uint8_t const FAT_FILE_TYPE_CLOSED = 0, // This file has not been opened. - FAT_FILE_TYPE_NORMAL = 1, // A normal file - FAT_FILE_TYPE_ROOT_FIXED = 2, // A FAT12 or FAT16 root directory - FAT_FILE_TYPE_ROOT32 = 3, // A FAT32 root directory - FAT_FILE_TYPE_SUBDIR = 4, // A subdirectory file - FAT_FILE_TYPE_MIN_DIR = FAT_FILE_TYPE_ROOT_FIXED; // Test value for directory type - -/** - * date field for FAT directory entry - * \param[in] year [1980,2107] - * \param[in] month [1,12] - * \param[in] day [1,31] - * - * \return Packed date for dir_t entry. - */ -static inline uint16_t FAT_DATE(uint16_t year, uint8_t month, uint8_t day) { return (year - 1980) << 9 | month << 5 | day; } - -/** - * year part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted year [1980,2107] - */ -static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9); } - -/** - * month part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted month [1,12] - */ -static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0XF; } - -/** - * day part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted day [1,31] - */ -static inline uint8_t FAT_DAY(uint16_t fatDate) { return fatDate & 0x1F; } - -/** - * time field for FAT directory entry - * \param[in] hour [0,23] - * \param[in] minute [0,59] - * \param[in] second [0,59] - * - * \return Packed time for dir_t entry. - */ -static inline uint16_t FAT_TIME(uint8_t hour, uint8_t minute, uint8_t second) { return hour << 11 | minute << 5 | second >> 1; } - -/** - * hour part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted hour [0,23] - */ -static inline uint8_t FAT_HOUR(uint16_t fatTime) { return fatTime >> 11; } - -/** - * minute part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted minute [0,59] - */ -static inline uint8_t FAT_MINUTE(uint16_t fatTime) { return (fatTime >> 5) & 0x3F; } - -/** - * second part of FAT directory time field - * Note second/2 is stored in packed time. - * - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted second [0,58] - */ -static inline uint8_t FAT_SECOND(uint16_t fatTime) { return 2 * (fatTime & 0x1F); } - -// Default date for file timestamps is 1 Jan 2000 -uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1; -// Default time for file timestamp is 1 am -uint16_t const FAT_DEFAULT_TIME = (1 << 11); - -/** - * \class SdBaseFile - * \brief Base class for SdFile with Print and C++ streams. - */ -class SdBaseFile { - public: - SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} - SdBaseFile(const char* path, uint8_t oflag); - ~SdBaseFile() { if (isOpen()) close(); } - - /** - * writeError is set to true if an error occurs during a write(). - * Set writeError to false before calling print() and/or write() and check - * for true after calls to print() and/or write(). - */ - bool writeError; - - // helpers for stream classes - - /** - * get position for streams - * \param[out] pos struct to receive position - */ - void getpos(filepos_t* pos); - - /** - * set position for streams - * \param[out] pos struct with value for new position - */ - void setpos(filepos_t* pos); - - bool close(); - bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); - bool createContiguous(SdBaseFile* dirFile, - const char* path, uint32_t size); - /** - * \return The current cluster number for a file or directory. - */ - uint32_t curCluster() const { return curCluster_; } - - /** - * \return The current position for a file or directory. - */ - uint32_t curPosition() const { return curPosition_; } - - /** - * \return Current working directory - */ - static SdBaseFile* cwd() { return cwd_; } - - /** - * Set the date/time callback function - * - * \param[in] dateTime The user's call back function. The callback - * function is of the form: - * - * \code - * void dateTime(uint16_t* date, uint16_t* time) { - * uint16_t year; - * uint8_t month, day, hour, minute, second; - * - * // User gets date and time from GPS or real-time clock here - * - * // return date using FAT_DATE macro to format fields - * *date = FAT_DATE(year, month, day); - * - * // return time using FAT_TIME macro to format fields - * *time = FAT_TIME(hour, minute, second); - * } - * \endcode - * - * Sets the function that is called when a file is created or when - * a file's directory entry is modified by sync(). All timestamps, - * access, creation, and modify, are set when a file is created. - * sync() maintains the last access date and last modify date/time. - * - * See the timestamp() function. - */ - static void dateTimeCallback( - void (*dateTime)(uint16_t* date, uint16_t* time)) { - dateTime_ = dateTime; - } - - /** - * Cancel the date/time callback function. - */ - static void dateTimeCallbackCancel() { dateTime_ = 0; } - bool dirEntry(dir_t* dir); - static void dirName(const dir_t& dir, char* name); - bool exists(const char* name); - int16_t fgets(char* str, int16_t num, char* delim = 0); - - /** - * \return The total number of bytes in a file or directory. - */ - uint32_t fileSize() const { return fileSize_; } - - /** - * \return The first cluster number for a file or directory. - */ - uint32_t firstCluster() const { return firstCluster_; } - - /** - * \return True if this is a directory else false. - */ - bool isDir() const { return type_ >= FAT_FILE_TYPE_MIN_DIR; } - - /** - * \return True if this is a normal file else false. - */ - bool isFile() const { return type_ == FAT_FILE_TYPE_NORMAL; } - - /** - * \return True if this is an open file/directory else false. - */ - bool isOpen() const { return type_ != FAT_FILE_TYPE_CLOSED; } - - /** - * \return True if this is a subdirectory else false. - */ - bool isSubDir() const { return type_ == FAT_FILE_TYPE_SUBDIR; } - - /** - * \return True if this is the root directory. - */ - bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - - bool getFilename(char * const name); - void ls(uint8_t flags = 0, uint8_t indent = 0); - - bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); - bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag); - bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag); - bool open(const char* path, uint8_t oflag = O_READ); - bool openNext(SdBaseFile* dirFile, uint8_t oflag); - bool openRoot(SdVolume* vol); - int peek(); - static void printFatDate(uint16_t fatDate); - static void printFatTime(uint16_t fatTime); - bool printName(); - int16_t read(); - int16_t read(void* buf, uint16_t nbyte); - int8_t readDir(dir_t* dir, char* longFilename); - static bool remove(SdBaseFile* dirFile, const char* path); - bool remove(); - - /** - * Set the file's current position to zero. - */ - void rewind() { seekSet(0); } - bool rename(SdBaseFile* dirFile, const char* newPath); - bool rmdir(); - bool rmRfStar(); - - /** - * Set the files position to current position + \a pos. See seekSet(). - * \param[in] offset The new position in bytes from the current position. - * \return true for success or false for failure. - */ - bool seekCur(const int32_t offset) { return seekSet(curPosition_ + offset); } - - /** - * Set the files position to end-of-file + \a offset. See seekSet(). - * \param[in] offset The new position in bytes from end-of-file. - * \return true for success or false for failure. - */ - bool seekEnd(const int32_t offset = 0) { return seekSet(fileSize_ + offset); } - bool seekSet(const uint32_t pos); - bool sync(); - bool timestamp(SdBaseFile* file); - bool timestamp(uint8_t flag, uint16_t year, uint8_t month, uint8_t day, - uint8_t hour, uint8_t minute, uint8_t second); - - /** - * Type of file. Use isFile() or isDir() instead of type() if possible. - * - * \return The file or directory type. - */ - uint8_t type() const { return type_; } - bool truncate(uint32_t size); - - /** - * \return SdVolume that contains this file. - */ - SdVolume* volume() const { return vol_; } - int16_t write(const void* buf, uint16_t nbyte); - - private: - friend class SdFat; // allow SdFat to set cwd_ - static SdBaseFile* cwd_; // global pointer to cwd dir - - // data time callback function - static void (*dateTime_)(uint16_t* date, uint16_t* time); - - // bits defined in flags_ - static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC), // should be 0x0F - F_FILE_DIR_DIRTY = 0x80; // sync of directory entry required - - // private data - uint8_t flags_; // See above for definition of flags_ bits - uint8_t fstate_; // error and eof indicator - uint8_t type_; // type of file see above for values - uint32_t curCluster_; // cluster for current file position - uint32_t curPosition_; // current file position in bytes from beginning - uint32_t dirBlock_; // block for this files directory entry - uint8_t dirIndex_; // index of directory entry in dirBlock - uint32_t fileSize_; // file size in bytes - uint32_t firstCluster_; // first cluster of file - SdVolume* vol_; // volume where file is located - - /** - * EXPERIMENTAL - Don't use! - */ - //bool openParent(SdBaseFile* dir); - - // private functions - bool addCluster(); - bool addDirCluster(); - dir_t* cacheDirEntry(uint8_t action); - int8_t lsPrintNext(uint8_t flags, uint8_t indent); - static bool make83Name(const char* str, uint8_t* name, const char** ptr); - bool mkdir(SdBaseFile* parent, const uint8_t dname[11]); - bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); - bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); - dir_t* readDirCache(); -}; - -#endif // _SDBASEFILE_H_ diff --git a/Marlin_thinkerV2/Marlin/SdFatConfig.h b/Marlin_thinkerV2/Marlin/SdFatConfig.h deleted file mode 100644 index cfa5e34d18..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFatConfig.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * SdFatConfig.h - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#ifndef _SDFATCONFIG_H_ -#define _SDFATCONFIG_H_ - -#include "MarlinConfig.h" - -/** - * To use multiple SD cards set USE_MULTIPLE_CARDS nonzero. - * - * Using multiple cards costs 400 - 500 bytes of flash. - * - * Each card requires about 550 bytes of SRAM so use of a Mega is recommended. - */ -#define USE_MULTIPLE_CARDS 0 - -/** - * Call flush for endl if ENDL_CALLS_FLUSH is nonzero - * - * The standard for iostreams is to call flush. This is very costly for - * SdFat. Each call to flush causes 2048 bytes of I/O to the SD. - * - * SdFat has a single 512 byte buffer for SD I/O so it must write the current - * data block to the SD, read the directory block from the SD, update the - * directory entry, write the directory block to the SD and read the data - * block back into the buffer. - * - * The SD flash memory controller is not designed for this many rewrites - * so performance may be reduced by more than a factor of 100. - * - * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force - * all data to be written to the SD. - */ -#define ENDL_CALLS_FLUSH 0 - -/** - * Allow FAT12 volumes if FAT12_SUPPORT is nonzero. - * FAT12 has not been well tested. - */ -#define FAT12_SUPPORT 0 - -/** - * SPI init rate for SD initialization commands. Must be 5 (F_CPU/64) - * or 6 (F_CPU/128). - */ -#define SPI_SD_INIT_RATE 5 - -/** - * Set the SS pin high for hardware SPI. If SS is chip select for another SPI - * device this will disable that device during the SD init phase. - */ -#define SET_SPI_SS_HIGH 1 - -/** - * Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos. - * Pins used are SS 10, MOSI 11, MISO 12, and SCK 13. - * - * MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used - * on Mega Arduinos. Software SPI works well with GPS Shield V1.1 - * but many SD cards will fail with GPS Shield V1.0. - */ -#define MEGA_SOFT_SPI 0 - -// Set USE_SOFTWARE_SPI nonzero to ALWAYS use Software SPI. -#define USE_SOFTWARE_SPI 0 - -// Define software SPI pins so Mega can use unmodified 168/328 shields -#define SOFT_SPI_CS_PIN 10 // Software SPI chip select pin for the SD -#define SOFT_SPI_MOSI_PIN 11 // Software SPI Master Out Slave In pin -#define SOFT_SPI_MISO_PIN 12 // Software SPI Master In Slave Out pin -#define SOFT_SPI_SCK_PIN 13 // Software SPI Clock pin - -/** - * The __cxa_pure_virtual function is an error handler that is invoked when - * a pure virtual function is called. - */ -#define USE_CXA_PURE_VIRTUAL 1 - -/** - * Defines for 8.3 and long (vfat) filenames - */ - -#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry - -// Total bytes needed to store a single long filename -#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1) - -#endif // _SDFATCONFIG_H_ diff --git a/Marlin_thinkerV2/Marlin/SdFatStructs.h b/Marlin_thinkerV2/Marlin/SdFatStructs.h deleted file mode 100644 index 7257f3617a..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFatStructs.h +++ /dev/null @@ -1,615 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief FAT file structures - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef SDFATSTRUCTS_H -#define SDFATSTRUCTS_H - -#define PACKED __attribute__((__packed__)) - -/** - * mostly from Microsoft document fatgen103.doc - * http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx - */ - -uint8_t const BOOTSIG0 = 0x55, // Value for byte 510 of boot block or MBR - BOOTSIG1 = 0xAA, // Value for byte 511 of boot block or MBR - EXTENDED_BOOT_SIG = 0x29; // Value for bootSignature field int FAT/FAT32 boot sector - -/** - * \struct partitionTable - * \brief MBR partition table entry - * - * A partition table entry for a MBR formatted storage device. - * The MBR partition table has four entries. - */ -struct partitionTable { - /** - * Boot Indicator . Indicates whether the volume is the active - * partition. Legal values include: 0x00. Do not use for booting. - * 0x80 Active partition. - */ - uint8_t boot; - /** - * Head part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t beginHead; - /** - * Sector part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned beginSector : 6; - /** High bits cylinder for first block in partition. */ - unsigned beginCylinderHigh : 2; - /** - * Combine beginCylinderLow with beginCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t beginCylinderLow; - /** - * Partition type. See defines that begin with PART_TYPE_ for - * some Microsoft partition types. - */ - uint8_t type; - /** - * head part of cylinder-head-sector address of the last sector in the - * partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t endHead; - /** - * Sector part of cylinder-head-sector address of the last sector in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned endSector : 6; - /** High bits of end cylinder */ - unsigned endCylinderHigh : 2; - /** - * Combine endCylinderLow with endCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t endCylinderLow; - - uint32_t firstSector; // Logical block address of the first block in the partition. - uint32_t totalSectors; // Length of the partition, in blocks. -} PACKED; - -typedef struct partitionTable part_t; // Type name for partitionTable - -/** - * \struct masterBootRecord - * - * \brief Master Boot Record - * - * The first block of a storage device that is formatted with a MBR. - */ -struct masterBootRecord { - uint8_t codeArea[440]; // Code Area for master boot program. - uint32_t diskSignature; // Optional Windows NT disk signature. May contain boot code. - uint16_t usuallyZero; // Usually zero but may be more boot code. - part_t part[4]; // Partition tables. - uint8_t mbrSig0; // First MBR signature byte. Must be 0x55 - uint8_t mbrSig1; // Second MBR signature byte. Must be 0xAA -} PACKED; -/** Type name for masterBootRecord */ -typedef struct masterBootRecord mbr_t; - -/** - * \struct fat_boot - * - * \brief Boot sector for a FAT12/FAT16 volume. - * - */ -struct fat_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. The value of this field is always 1. - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * For FAT12 and FAT16 volumes, this field contains the count of - * 32-byte directory entries in the root directory. For FAT32 volumes, - * this field must be set to 0. For FAT12 and FAT16 volumes, this - * value should always specify a count that when multiplied by 32 - * results in a multiple of bytesPerSector. FAT16 volumes should - * use the value 512. - */ - uint16_t rootDirEntryCount; - /** - * This field is the old 16-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then totalSectors32 - * must be nonzero. For FAT32 volumes, this field must be 0. For - * FAT12 and FAT16 volumes, this field contains the sector count, and - * totalSectors32 is 0 if the total sector count fits - * (is less than 0x10000). - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * Count of sectors occupied by one FAT on FAT12/FAT16 volumes. - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * This field is the new 32-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then - * totalSectors16 must be nonzero. - */ - uint32_t totalSectors32; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A field with a value of either FAT, FAT12 or FAT16, - * depending on the disk format. - */ - char fileSystemType[8]; - - uint8_t bootCode[448]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA -} PACKED; - -typedef struct fat_boot fat_boot_t; // Type name for FAT Boot Sector - -/** - * \struct fat32_boot - * - * \brief Boot sector for a FAT32 volume. - */ -struct fat32_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. Must not be zero - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0. - */ - uint16_t rootDirEntryCount; - /** - * For FAT32 volumes, this field must be 0. - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * Contains the total number of sectors in the FAT32 volume. - */ - uint32_t totalSectors32; - /** - * Count of sectors occupied by one FAT on FAT32 volumes. - */ - uint32_t sectorsPerFat32; - /** - * This field is only defined for FAT32 media and does not exist on - * FAT12 and FAT16 media. - * Bits 0-3 -- Zero-based number of active FAT. - * Only valid if mirroring is disabled. - * Bits 4-6 -- Reserved. - * Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs. - * -- 1 means only one FAT is active; it is the one referenced - * in bits 0-3. - * Bits 8-15 -- Reserved. - */ - uint16_t fat32Flags; - /** - * FAT32 version. High byte is major revision number. - * Low byte is minor revision number. Only 0.0 define. - */ - uint16_t fat32Version; - /** - * Cluster number of the first cluster of the root directory for FAT32. - * This usually 2 but not required to be 2. - */ - uint32_t fat32RootCluster; - /** - * Sector number of FSINFO structure in the reserved area of the - * FAT32 volume. Usually 1. - */ - uint16_t fat32FSInfo; - /** - * If nonzero, indicates the sector number in the reserved area - * of the volume of a copy of the boot record. Usually 6. - * No value other than 6 is recommended. - */ - uint16_t fat32BackBootBlock; - /** - * Reserved for future expansion. Code that formats FAT32 volumes - * should always set all of the bytes of this field to 0. - */ - uint8_t fat32Reserved[12]; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // Used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A text field with a value of FAT32. - */ - char fileSystemType[8]; - - uint8_t bootCode[420]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA - -} PACKED; - -typedef struct fat32_boot fat32_boot_t; // Type name for FAT32 Boot Sector - -uint32_t const FSINFO_LEAD_SIG = 0x41615252, // 'AaRR' Lead signature for a FSINFO sector - FSINFO_STRUCT_SIG = 0x61417272; // 'aArr' Struct signature for a FSINFO sector - -/** - * \struct fat32_fsinfo - * - * \brief FSINFO sector for a FAT32 volume. - * - */ -struct fat32_fsinfo { - uint32_t leadSignature; // must be 0x52, 0x52, 0x61, 0x41 'RRaA' - uint8_t reserved1[480]; // must be zero - uint32_t structSignature; // must be 0x72, 0x72, 0x41, 0x61 'rrAa' - /** - * Contains the last known free cluster count on the volume. - * If the value is 0xFFFFFFFF, then the free count is unknown - * and must be computed. Any other value can be used, but is - * not necessarily correct. It should be range checked at least - * to make sure it is <= volume cluster count. - */ - uint32_t freeCount; - /** - * This is a hint for the FAT driver. It indicates the cluster - * number at which the driver should start looking for free clusters. - * If the value is 0xFFFFFFFF, then there is no hint and the driver - * should start looking at cluster 2. - */ - uint32_t nextFree; - - uint8_t reserved2[12]; // must be zero - uint8_t tailSignature[4]; // must be 0x00, 0x00, 0x55, 0xAA -} PACKED; - -typedef struct fat32_fsinfo fat32_fsinfo_t; // Type name for FAT32 FSINFO Sector - -// End Of Chain values for FAT entries -uint16_t const FAT12EOC = 0xFFF, // FAT12 end of chain value used by Microsoft. - FAT12EOC_MIN = 0xFF8, // Minimum value for FAT12 EOC. Use to test for EOC. - FAT16EOC = 0xFFFF, // FAT16 end of chain value used by Microsoft. - FAT16EOC_MIN = 0xFFF8; // Minimum value for FAT16 EOC. Use to test for EOC. -uint32_t const FAT32EOC = 0x0FFFFFFF, // FAT32 end of chain value used by Microsoft. - FAT32EOC_MIN = 0x0FFFFFF8, // Minimum value for FAT32 EOC. Use to test for EOC. - FAT32MASK = 0x0FFFFFFF; // Mask a for FAT32 entry. Entries are 28 bits. - -/** - * \struct directoryEntry - * \brief FAT short directory entry - * - * Short means short 8.3 name, not the entry size. - * - * Date Format. A FAT directory entry date stamp is a 16-bit field that is - * basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the - * format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the - * 16-bit word): - * - * Bits 9-15: Count of years from 1980, valid value range 0-127 - * inclusive (1980-2107). - * - * Bits 5-8: Month of year, 1 = January, valid value range 1-12 inclusive. - * - * Bits 0-4: Day of month, valid value range 1-31 inclusive. - * - * Time Format. A FAT directory entry time stamp is a 16-bit field that has - * a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the - * 16-bit word, bit 15 is the MSB of the 16-bit word). - * - * Bits 11-15: Hours, valid value range 0-23 inclusive. - * - * Bits 5-10: Minutes, valid value range 0-59 inclusive. - * - * Bits 0-4: 2-second count, valid value range 0-29 inclusive (0 - 58 seconds). - * - * The valid time range is from Midnight 00:00:00 to 23:59:58. - */ -struct directoryEntry { - /** - * Short 8.3 name. - * - * The first eight bytes contain the file name with blank fill. - * The last three bytes contain the file extension with blank fill. - */ - uint8_t name[11]; - /** - * Entry attributes. - * - * The upper two bits of the attribute byte are reserved and should - * always be set to 0 when a file is created and never modified or - * looked at after that. See defines that begin with DIR_ATT_. - */ - uint8_t attributes; - /** - * Reserved for use by Windows NT. Set value to 0 when a file is - * created and never modify or look at it after that. - */ - uint8_t reservedNT; - /** - * The granularity of the seconds part of creationTime is 2 seconds - * so this field is a count of tenths of a second and it's valid - * value range is 0-199 inclusive. (WHG note - seems to be hundredths) - */ - uint8_t creationTimeTenths; - - uint16_t creationTime; // Time file was created. - uint16_t creationDate; // Date file was created. - - /** - * Last access date. Note that there is no last access time, only - * a date. This is the date of last read or write. In the case of - * a write, this should be set to the same date as lastWriteDate. - */ - uint16_t lastAccessDate; - /** - * High word of this entry's first cluster number (always 0 for a - * FAT12 or FAT16 volume). - */ - uint16_t firstClusterHigh; - - uint16_t lastWriteTime; // Time of last write. File creation is considered a write. - uint16_t lastWriteDate; // Date of last write. File creation is considered a write. - uint16_t firstClusterLow; // Low word of this entry's first cluster number. - uint32_t fileSize; // 32-bit unsigned holding this file's size in bytes. -} PACKED; - -/** - * \struct directoryVFATEntry - * \brief VFAT long filename directory entry - * - * directoryVFATEntries are found in the same list as normal directoryEntry. - * But have the attribute field set to DIR_ATT_LONG_NAME. - * - * Long filenames are saved in multiple directoryVFATEntries. - * Each entry containing 13 UTF-16 characters. - */ -struct directoryVFATEntry { - /** - * Sequence number. Consists of 2 parts: - * bit 6: indicates first long filename block for the next file - * bit 0-4: the position of this long filename block (first block is 1) - */ - uint8_t sequenceNumber; - - uint16_t name1[5]; // First set of UTF-16 characters - uint8_t attributes; // attributes (at the same location as in directoryEntry), always 0x0F - uint8_t reservedNT; // Reserved for use by Windows NT. Always 0. - uint8_t checksum; // Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. - uint16_t name2[6]; // Second set of UTF-16 characters - uint16_t firstClusterLow; // firstClusterLow is always zero for longFilenames - uint16_t name3[2]; // Third set of UTF-16 characters -} PACKED; - -// Definitions for directory entries -// -typedef struct directoryEntry dir_t; // Type name for directoryEntry -typedef struct directoryVFATEntry vfat_t; // Type name for directoryVFATEntry - -uint8_t const DIR_NAME_0xE5 = 0x05, // escape for name[0] = 0xE5 - DIR_NAME_DELETED = 0xE5, // name[0] value for entry that is free after being "deleted" - DIR_NAME_FREE = 0x00, // name[0] value for entry that is free and no allocated entries follow - DIR_ATT_READ_ONLY = 0x01, // file is read-only - DIR_ATT_HIDDEN = 0x02, // File should hidden in directory listings - DIR_ATT_SYSTEM = 0x04, // Entry is for a system file - DIR_ATT_VOLUME_ID = 0x08, // Directory entry contains the volume label - DIR_ATT_DIRECTORY = 0x10, // Entry is for a directory - DIR_ATT_ARCHIVE = 0x20, // Old DOS archive bit for backup support - DIR_ATT_LONG_NAME = 0x0F, // Test value for long name entry. Test is (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. - DIR_ATT_LONG_NAME_MASK = 0x3F, // Test mask for long name entry - DIR_ATT_DEFINED_BITS = 0x3F; // defined attribute bits - -/** - * Directory entry is part of a long name - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for part of a long name else false. - */ -static inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) { - return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME; -} - -/** Mask for file/subdirectory tests */ -uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY); - -/** - * Directory entry is for a file - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file else false. - */ -static inline uint8_t DIR_IS_FILE(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0; -} - -/** - * Directory entry is for a subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a subdirectory else false. - */ -static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY; -} - -/** - * Directory entry is for a file or subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file or subdirectory else false. - */ -static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; -} - -#endif // SDFATSTRUCTS_H diff --git a/Marlin_thinkerV2/Marlin/SdFatUtil.cpp b/Marlin_thinkerV2/Marlin/SdFatUtil.cpp deleted file mode 100644 index 2bd471bc67..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFatUtil.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFatUtil.h" -#include "serial.h" - -/** - * Amount of free RAM - * \return The number of free bytes. - */ -#ifdef __arm__ -extern "C" char* sbrk(int incr); -int SdFatUtil::FreeRam() { - char top; - return &top - reinterpret_cast(sbrk(0)); -} -#else // __arm__ -extern char* __brkval; -extern char __bss_end; -/** - * Amount of free RAM - * \return The number of free bytes. - */ -int SdFatUtil::FreeRam() { - char top; - return __brkval ? &top - __brkval : &top - &__bss_end; -} -#endif // __arm - -/** - * %Print a string in flash memory. - * - * \param[in] pr Print object for output. - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::print_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) SERIAL_CHAR(c); -} - -/** - * %Print a string in flash memory followed by a CR/LF. - * - * \param[in] pr Print object for output. - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::println_P(PGM_P str) { print_P(str); SERIAL_EOL(); } - -/** - * %Print a string in flash memory to Serial. - * - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::SerialPrint_P(PGM_P str) { print_P(str); } - -/** - * %Print a string in flash memory to Serial followed by a CR/LF. - * - * \param[in] str Pointer to string stored in flash memory. - */ -void SdFatUtil::SerialPrintln_P(PGM_P str) { println_P(str); } - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/SdFatUtil.h b/Marlin_thinkerV2/Marlin/SdFatUtil.h deleted file mode 100644 index 793ba2f078..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFatUtil.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDFATUTIL_H_ -#define _SDFATUTIL_H_ - -/** - * \file - * \brief Useful utility functions. - */ -/** Store and print a string in flash memory.*/ -#define PgmPrint(x) SerialPrint_P(PSTR(x)) -/** Store and print a string in flash memory followed by a CR/LF.*/ -#define PgmPrintln(x) SerialPrintln_P(PSTR(x)) - -namespace SdFatUtil { - int FreeRam(); - void print_P(PGM_P str); - void println_P(PGM_P str); - void SerialPrint_P(PGM_P str); - void SerialPrintln_P(PGM_P str); -} - -using namespace SdFatUtil; // NOLINT - -#endif // _SDFATUTIL_H_ diff --git a/Marlin_thinkerV2/Marlin/SdFile.cpp b/Marlin_thinkerV2/Marlin/SdFile.cpp deleted file mode 100644 index 45d18e01b3..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFile.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFile.h" - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { } - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdFile::write(const void* buf, uint16_t nbyte) { return SdBaseFile::write(buf, nbyte); } - -/** - * Write a byte to a file. Required by the Arduino Print class. - * \param[in] b the byte to be written. - * Use writeError to check for errors. - */ -#if ARDUINO >= 100 - size_t SdFile::write(uint8_t b) { return SdBaseFile::write(&b, 1); } -#else - void SdFile::write(uint8_t b) { SdBaseFile::write(&b, 1); } -#endif - -/** - * Write a string to a file. Used by the Arduino Print class. - * \param[in] str Pointer to the string. - * Use writeError to check for errors. - */ -void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); } - -/** - * Write a PROGMEM string to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::write_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) write(c); -} - -/** - * Write a PROGMEM string followed by CR/LF to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::writeln_P(PGM_P str) { - write_P(str); - write_P(PSTR("\r\n")); -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/SdFile.h b/Marlin_thinkerV2/Marlin/SdFile.h deleted file mode 100644 index 36d6862d8d..0000000000 --- a/Marlin_thinkerV2/Marlin/SdFile.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdFile class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDFILE_H_ -#define _SDFILE_H_ - -#include "SdBaseFile.h" -#include - -/** - * \class SdFile - * \brief SdBaseFile with Print. - */ -class SdFile : public SdBaseFile, public Print { - public: - SdFile() {} - SdFile(const char* name, uint8_t oflag); - #if ARDUINO >= 100 - size_t write(uint8_t b); - #else - void write(uint8_t b); - #endif - - int16_t write(const void* buf, uint16_t nbyte); - void write(const char* str); - void write_P(PGM_P str); - void writeln_P(PGM_P str); -}; - -#endif // _SDFILE_H_ diff --git a/Marlin_thinkerV2/Marlin/SdInfo.h b/Marlin_thinkerV2/Marlin/SdInfo.h deleted file mode 100644 index 9fe121f168..0000000000 --- a/Marlin_thinkerV2/Marlin/SdInfo.h +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDINFO_H_ -#define _SDINFO_H_ - -#include - -// Based on the document: -// -// SD Specifications -// Part 1 -// Physical Layer -// Simplified Specification -// Version 3.01 -// May 18, 2010 -// -// http://www.sdcard.org/developers/tech/sdcard/pls/simplified_specs - -// SD card commands -uint8_t const CMD0 = 0x00, // GO_IDLE_STATE - init card in spi mode if CS low - CMD8 = 0x08, // SEND_IF_COND - verify SD Memory Card interface operating condition - CMD9 = 0x09, // SEND_CSD - read the Card Specific Data (CSD register) - CMD10 = 0x0A, // SEND_CID - read the card identification information (CID register) - CMD12 = 0x0C, // STOP_TRANSMISSION - end multiple block read sequence - CMD13 = 0x0D, // SEND_STATUS - read the card status register - CMD17 = 0x11, // READ_SINGLE_BLOCK - read a single data block from the card - CMD18 = 0x12, // READ_MULTIPLE_BLOCK - read a multiple data blocks from the card - CMD24 = 0x18, // WRITE_BLOCK - write a single data block to the card - CMD25 = 0x19, // WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION - CMD32 = 0x20, // ERASE_WR_BLK_START - sets the address of the first block to be erased - CMD33 = 0x21, // ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased*/ - CMD38 = 0x26, // ERASE - erase all previously selected blocks */ - CMD55 = 0x37, // APP_CMD - escape for application specific command */ - CMD58 = 0x3A, // READ_OCR - read the OCR register of a card */ - ACMD23 = 0x17, // SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing */ - ACMD41 = 0x29; // SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process */ - -/** status for card in the ready state */ -uint8_t const R1_READY_STATE = 0x00; -/** status for card in the idle state */ -uint8_t const R1_IDLE_STATE = 0x01; -/** status bit for illegal command */ -uint8_t const R1_ILLEGAL_COMMAND = 0x04; -/** start data token for read or write single block*/ -uint8_t const DATA_START_BLOCK = 0xFE; -/** stop token for write multiple blocks*/ -uint8_t const STOP_TRAN_TOKEN = 0xFD; -/** start data token for write multiple blocks*/ -uint8_t const WRITE_MULTIPLE_TOKEN = 0xFC; -/** mask for data response tokens after a write block operation */ -uint8_t const DATA_RES_MASK = 0x1F; -/** write data accepted token */ -uint8_t const DATA_RES_ACCEPTED = 0x05; - -/** Card IDentification (CID) register */ -typedef struct CID { - // byte 0 - /** Manufacturer ID */ - unsigned char mid; - // byte 1-2 - /** OEM/Application ID */ - char oid[2]; - // byte 3-7 - /** Product name */ - char pnm[5]; - // byte 8 - /** Product revision least significant digit */ - unsigned char prv_m : 4; - /** Product revision most significant digit */ - unsigned char prv_n : 4; - // byte 9-12 - /** Product serial number */ - uint32_t psn; - // byte 13 - /** Manufacturing date year low digit */ - unsigned char mdt_year_high : 4; - /** not used */ - unsigned char reserved : 4; - // byte 14 - /** Manufacturing date month */ - unsigned char mdt_month : 4; - /** Manufacturing date year low digit */ - unsigned char mdt_year_low : 4; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** CRC7 checksum */ - unsigned char crc : 7; -} cid_t; - -/** CSD for version 1.00 cards */ -typedef struct CSDV1 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - unsigned char taac; - // byte 2 - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - unsigned char c_size_high : 2; - unsigned char reserved2 : 2; - unsigned char dsr_imp : 1; - unsigned char read_blk_misalign : 1; - unsigned char write_blk_misalign : 1; - unsigned char read_bl_partial : 1; - // byte 7 - unsigned char c_size_mid; - // byte 8 - unsigned char vdd_r_curr_max : 3; - unsigned char vdd_r_curr_min : 3; - unsigned char c_size_low : 2; - // byte 9 - unsigned char c_size_mult_high : 2; - unsigned char vdd_w_cur_max : 3; - unsigned char vdd_w_curr_min : 3; - // byte 10 - unsigned char sector_size_high : 6; - unsigned char erase_blk_en : 1; - unsigned char c_size_mult_low : 1; - // byte 11 - unsigned char wp_grp_size : 7; - unsigned char sector_size_low : 1; - // byte 12 - unsigned char write_bl_len_high : 2; - unsigned char r2w_factor : 3; - unsigned char reserved3 : 2; - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved4 : 5; - unsigned char write_partial : 1; - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved5: 2; - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Indicates the file format on the card */ - unsigned char file_format_grp : 1; - // byte 15 - unsigned char always1 : 1; - unsigned char crc : 7; -} csd1_t; - -/** CSD for version 2.00 cards */ -typedef struct CSDV2 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - /** fixed to 0x0E */ - unsigned char taac; - // byte 2 - /** fixed to 0 */ - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - /** This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte */ - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - /** not used */ - unsigned char reserved2 : 4; - unsigned char dsr_imp : 1; - /** fixed to 0 */ - unsigned char read_blk_misalign : 1; - /** fixed to 0 */ - unsigned char write_blk_misalign : 1; - /** fixed to 0 - no partial read */ - unsigned char read_bl_partial : 1; - // byte 7 - /** not used */ - unsigned char reserved3 : 2; - /** high part of card size */ - unsigned char c_size_high : 6; - // byte 8 - /** middle part of card size */ - unsigned char c_size_mid; - // byte 9 - /** low part of card size */ - unsigned char c_size_low; - // byte 10 - /** sector size is fixed at 64 KB */ - unsigned char sector_size_high : 6; - /** fixed to 1 - erase single is supported */ - unsigned char erase_blk_en : 1; - /** not used */ - unsigned char reserved4 : 1; - // byte 11 - unsigned char wp_grp_size : 7; - /** sector size is fixed at 64 KB */ - unsigned char sector_size_low : 1; - // byte 12 - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_high : 2; - /** fixed value of 2 */ - unsigned char r2w_factor : 3; - /** not used */ - unsigned char reserved5 : 2; - /** fixed value of 0 - no write protect groups */ - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved6 : 5; - /** always zero - no partial block read*/ - unsigned char write_partial : 1; - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved7: 2; - /** Do not use always 0 */ - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Do not use always 0 */ - unsigned char file_format_grp : 1; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** checksum */ - unsigned char crc : 7; -} csd2_t; - -/** union of old and new style CSD register */ -union csd_t { - csd1_t v1; - csd2_t v2; -}; - -#endif // _SDINFO_H_ diff --git a/Marlin_thinkerV2/Marlin/SdVolume.cpp b/Marlin_thinkerV2/Marlin/SdVolume.cpp deleted file mode 100644 index df781cb6b6..0000000000 --- a/Marlin_thinkerV2/Marlin/SdVolume.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdVolume.h" - -#if !USE_MULTIPLE_CARDS - // raw block cache - uint32_t SdVolume::cacheBlockNumber_; // current block number - cache_t SdVolume::cacheBuffer_; // 512 byte cache for Sd2Card - Sd2Card* SdVolume::sdCard_; // pointer to SD card object - bool SdVolume::cacheDirty_; // cacheFlush() will write block if true - uint32_t SdVolume::cacheMirrorBlock_; // mirror block for second FAT -#endif // USE_MULTIPLE_CARDS - -// find a contiguous group of clusters -bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { - // start of group - uint32_t bgnCluster; - // end of group - uint32_t endCluster; - // last cluster of FAT - uint32_t fatEnd = clusterCount_ + 1; - - // flag to save place to start next search - bool setStart; - - // set search start cluster - if (*curCluster) { - // try to make file contiguous - bgnCluster = *curCluster + 1; - - // don't save new start location - setStart = false; - } - else { - // start at likely place for free cluster - bgnCluster = allocSearchStart_; - - // save next search start if one cluster - setStart = count == 1; - } - // end of group - endCluster = bgnCluster; - - // search the FAT for free clusters - for (uint32_t n = 0;; n++, endCluster++) { - // can't find space checked all clusters - if (n >= clusterCount_) return false; - - // past end - start from beginning of FAT - if (endCluster > fatEnd) { - bgnCluster = endCluster = 2; - } - uint32_t f; - if (!fatGet(endCluster, &f)) return false; - - if (f != 0) { - // cluster in use try next cluster as bgnCluster - bgnCluster = endCluster + 1; - } - else if ((endCluster - bgnCluster + 1) == count) { - // done - found space - break; - } - } - // mark end of chain - if (!fatPutEOC(endCluster)) return false; - - // link clusters - while (endCluster > bgnCluster) { - if (!fatPut(endCluster - 1, endCluster)) return false; - endCluster--; - } - if (*curCluster != 0) { - // connect chains - if (!fatPut(*curCluster, bgnCluster)) return false; - } - // return first cluster number to caller - *curCluster = bgnCluster; - - // remember possible next free cluster - if (setStart) allocSearchStart_ = bgnCluster + 1; - - return true; -} - -bool SdVolume::cacheFlush() { - if (cacheDirty_) { - if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) - return false; - - // mirror FAT tables - if (cacheMirrorBlock_) { - if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) - return false; - cacheMirrorBlock_ = 0; - } - cacheDirty_ = 0; - } - return true; -} - -bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { - if (cacheBlockNumber_ != blockNumber) { - if (!cacheFlush()) return false; - if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) return false; - cacheBlockNumber_ = blockNumber; - } - if (dirty) cacheDirty_ = true; - return true; -} - -// return the size in bytes of a cluster chain -bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { - uint32_t s = 0; - do { - if (!fatGet(cluster, &cluster)) return false; - s += 512UL << clusterSizeShift_; - } while (!isEOC(cluster)); - *size = s; - return true; -} - -// Fetch a FAT entry -bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { - uint32_t lba; - if (cluster > (clusterCount_ + 1)) return false; - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return false; - index &= 0x1FF; - uint16_t tmp = cacheBuffer_.data[index]; - index++; - if (index == 512) { - if (!cacheRawBlock(lba + 1, CACHE_FOR_READ)) return false; - index = 0; - } - tmp |= cacheBuffer_.data[index] << 8; - *value = cluster & 1 ? tmp >> 4 : tmp & 0xFFF; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (lba != cacheBlockNumber_ && !cacheRawBlock(lba, CACHE_FOR_READ)) - return false; - - *value = (fatType_ == 16) ? cacheBuffer_.fat16[cluster & 0xFF] : (cacheBuffer_.fat32[cluster & 0x7F] & FAT32MASK); - return true; -} - -// Store a FAT entry -bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { - uint32_t lba; - // error if reserved cluster - if (cluster < 2) return false; - - // error if not in FAT - if (cluster > (clusterCount_ + 1)) return false; - - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - index &= 0x1FF; - uint8_t tmp = value; - if (cluster & 1) { - tmp = (cacheBuffer_.data[index] & 0xF) | tmp << 4; - } - cacheBuffer_.data[index] = tmp; - index++; - if (index == 512) { - lba++; - index = 0; - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - } - tmp = value >> 4; - if (!(cluster & 1)) { - tmp = ((cacheBuffer_.data[index] & 0xF0)) | tmp >> 4; - } - cacheBuffer_.data[index] = tmp; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - - // store entry - if (fatType_ == 16) - cacheBuffer_.fat16[cluster & 0xFF] = value; - else - cacheBuffer_.fat32[cluster & 0x7F] = value; - - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - return true; -} - -// free a cluster chain -bool SdVolume::freeChain(uint32_t cluster) { - // clear free cluster location - allocSearchStart_ = 2; - - do { - uint32_t next; - if (!fatGet(cluster, &next)) return false; - - // free cluster - if (!fatPut(cluster, 0)) return false; - - cluster = next; - } while (!isEOC(cluster)); - - return true; -} - -/** Volume free space in clusters. - * - * \return Count of free clusters for success or -1 if an error occurs. - */ -int32_t SdVolume::freeClusterCount() { - uint32_t free = 0; - uint16_t n; - uint32_t todo = clusterCount_ + 2; - - if (fatType_ == 16) - n = 256; - else if (fatType_ == 32) - n = 128; - else // put FAT12 here - return -1; - - for (uint32_t lba = fatStartBlock_; todo; todo -= n, lba++) { - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return -1; - NOMORE(n, todo); - if (fatType_ == 16) { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat16[i] == 0) free++; - } - else { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat32[i] == 0) free++; - } - } - return free; -} - -/** Initialize a FAT volume. - * - * \param[in] dev The SD card where the volume is located. - * - * \param[in] part The partition to be used. Legal values for \a part are - * 1-4 to use the corresponding partition on a device formatted with - * a MBR, Master Boot Record, or zero if the device is formatted as - * a super floppy with the FAT boot sector in block zero. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding a valid - * FAT file system in the specified partition or an I/O error. - */ -bool SdVolume::init(Sd2Card* dev, uint8_t part) { - uint32_t totalBlocks, volumeStartBlock = 0; - fat32_boot_t* fbs; - - sdCard_ = dev; - fatType_ = 0; - allocSearchStart_ = 2; - cacheDirty_ = 0; // cacheFlush() will write block if true - cacheMirrorBlock_ = 0; - cacheBlockNumber_ = 0xFFFFFFFF; - - // if part == 0 assume super floppy with FAT boot sector in block zero - // if part > 0 assume mbr volume with partition table - if (part) { - if (part > 4) return false; - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - part_t* p = &cacheBuffer_.mbr.part[part - 1]; - if ((p->boot & 0x7F) != 0 || p->totalSectors < 100 || p->firstSector == 0) - return false; // not a valid partition - volumeStartBlock = p->firstSector; - } - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - fbs = &cacheBuffer_.fbs32; - if (fbs->bytesPerSector != 512 || - fbs->fatCount == 0 || - fbs->reservedSectorCount == 0 || - fbs->sectorsPerCluster == 0) { - // not valid FAT volume - return false; - } - fatCount_ = fbs->fatCount; - blocksPerCluster_ = fbs->sectorsPerCluster; - // determine shift that is same as multiply by blocksPerCluster_ - clusterSizeShift_ = 0; - while (blocksPerCluster_ != _BV(clusterSizeShift_)) { - // error if not power of 2 - if (clusterSizeShift_++ > 7) return false; - } - blocksPerFat_ = fbs->sectorsPerFat16 ? - fbs->sectorsPerFat16 : fbs->sectorsPerFat32; - - fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; - - // count for FAT16 zero for FAT32 - rootDirEntryCount_ = fbs->rootDirEntryCount; - - // directory start for FAT16 dataStart for FAT32 - rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; - - // data start for FAT16 and FAT32 - dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511) / 512); - - // total blocks for FAT16 or FAT32 - totalBlocks = fbs->totalSectors16 ? - fbs->totalSectors16 : fbs->totalSectors32; - - // total data blocks - clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); - - // divide by cluster size to get cluster count - clusterCount_ >>= clusterSizeShift_; - - // FAT type is determined by cluster count - if (clusterCount_ < 4085) { - fatType_ = 12; - if (!FAT12_SUPPORT) return false; - } - else if (clusterCount_ < 65525) - fatType_ = 16; - else { - rootDirStart_ = fbs->fat32RootCluster; - fatType_ = 32; - } - return true; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/SdVolume.h b/Marlin_thinkerV2/Marlin/SdVolume.h deleted file mode 100644 index 7cde194ebe..0000000000 --- a/Marlin_thinkerV2/Marlin/SdVolume.h +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file - * \brief SdVolume class - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -#ifndef _SDVOLUME_H_ -#define _SDVOLUME_H_ - -#include "SdFatConfig.h" -#include "Sd2Card.h" -#include "SdFatStructs.h" - -//============================================================================== -// SdVolume class -/** - * \brief Cache for an SD data block - */ -union cache_t { - uint8_t data[512]; // Used to access cached file data blocks. - uint16_t fat16[256]; // Used to access cached FAT16 entries. - uint32_t fat32[128]; // Used to access cached FAT32 entries. - dir_t dir[16]; // Used to access cached directory entries. - mbr_t mbr; // Used to access a cached Master Boot Record. - fat_boot_t fbs; // Used to access to a cached FAT boot sector. - fat32_boot_t fbs32; // Used to access to a cached FAT32 boot sector. - fat32_fsinfo_t fsinfo; // Used to access to a cached FAT32 FSINFO sector. -}; - -/** - * \class SdVolume - * \brief Access FAT16 and FAT32 volumes on SD and SDHC cards. - */ -class SdVolume { - public: - // Create an instance of SdVolume - SdVolume() : fatType_(0) {} - /** - * Clear the cache and returns a pointer to the cache. Used by the WaveRP - * recorder to do raw write to the SD card. Not for normal apps. - * \return A pointer to the cache buffer or zero if an error occurs. - */ - cache_t* cacheClear() { - if (!cacheFlush()) return 0; - cacheBlockNumber_ = 0xFFFFFFFF; - return &cacheBuffer_; - } - - /** - * Initialize a FAT volume. Try partition one first then try super - * floppy format. - * - * \param[in] dev The Sd2Card where the volume is located. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding - * a valid FAT file system or an I/O error. - */ - bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0); } - bool init(Sd2Card* dev, uint8_t part); - - // inline functions that return volume info - uint8_t blocksPerCluster() const { return blocksPerCluster_; } //> \return The volume's cluster size in blocks. - uint32_t blocksPerFat() const { return blocksPerFat_; } //> \return The number of blocks in one FAT. - uint32_t clusterCount() const { return clusterCount_; } //> \return The total number of clusters in the volume. - uint8_t clusterSizeShift() const { return clusterSizeShift_; } //> \return The shift count required to multiply by blocksPerCluster. - uint32_t dataStartBlock() const { return dataStartBlock_; } //> \return The logical block number for the start of file data. - uint8_t fatCount() const { return fatCount_; } //> \return The number of FAT structures on the volume. - uint32_t fatStartBlock() const { return fatStartBlock_; } //> \return The logical block number for the start of the first FAT. - uint8_t fatType() const { return fatType_; } //> \return The FAT type of the volume. Values are 12, 16 or 32. - int32_t freeClusterCount(); - uint32_t rootDirEntryCount() const { return rootDirEntryCount_; } /** \return The number of entries in the root directory for FAT16 volumes. */ - - /** - * \return The logical block number for the start of the root directory - * on FAT16 volumes or the first cluster number on FAT32 volumes. - */ - uint32_t rootDirStart() const { return rootDirStart_; } - - /** - * Sd2Card object for this volume - * \return pointer to Sd2Card object. - */ - Sd2Card* sdCard() { return sdCard_; } - - /** - * Debug access to FAT table - * - * \param[in] n cluster number. - * \param[out] v value of entry - * \return true for success or false for failure - */ - bool dbgFat(uint32_t n, uint32_t* v) { return fatGet(n, v); } - - private: - // Allow SdBaseFile access to SdVolume private data. - friend class SdBaseFile; - - // value for dirty argument in cacheRawBlock to indicate read from cache - static bool const CACHE_FOR_READ = false; - // value for dirty argument in cacheRawBlock to indicate write to cache - static bool const CACHE_FOR_WRITE = true; - - #if USE_MULTIPLE_CARDS - cache_t cacheBuffer_; // 512 byte cache for device blocks - uint32_t cacheBlockNumber_; // Logical number of block in the cache - Sd2Card* sdCard_; // Sd2Card object for cache - bool cacheDirty_; // cacheFlush() will write block if true - uint32_t cacheMirrorBlock_; // block number for mirror FAT - #else - static cache_t cacheBuffer_; // 512 byte cache for device blocks - static uint32_t cacheBlockNumber_; // Logical number of block in the cache - static Sd2Card* sdCard_; // Sd2Card object for cache - static bool cacheDirty_; // cacheFlush() will write block if true - static uint32_t cacheMirrorBlock_; // block number for mirror FAT - #endif - - uint32_t allocSearchStart_; // start cluster for alloc search - uint8_t blocksPerCluster_; // cluster size in blocks - uint32_t blocksPerFat_; // FAT size in blocks - uint32_t clusterCount_; // clusters in one FAT - uint8_t clusterSizeShift_; // shift to convert cluster count to block count - uint32_t dataStartBlock_; // first data block number - uint8_t fatCount_; // number of FATs on volume - uint32_t fatStartBlock_; // start block for first FAT - uint8_t fatType_; // volume type (12, 16, OR 32) - uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir - uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 - - bool allocContiguous(uint32_t count, uint32_t* curCluster); - uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1); } - uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_); } - uint32_t blockNumber(uint32_t cluster, uint32_t position) const { return clusterStartBlock(cluster) + blockOfCluster(position); } - - cache_t* cache() { return &cacheBuffer_; } - uint32_t cacheBlockNumber() const { return cacheBlockNumber_; } - - #if USE_MULTIPLE_CARDS - bool cacheFlush(); - bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #else - static bool cacheFlush(); - static bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #endif - - // used by SdBaseFile write to assign cache to SD location - void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { - cacheDirty_ = dirty; - cacheBlockNumber_ = blockNumber; - } - void cacheSetDirty() { cacheDirty_ |= CACHE_FOR_WRITE; } - bool chainSize(uint32_t beginCluster, uint32_t* size); - bool fatGet(uint32_t cluster, uint32_t* value); - bool fatPut(uint32_t cluster, uint32_t value); - bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); } - bool freeChain(uint32_t cluster); - bool isEOC(uint32_t cluster) const { - if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; - if (fatType_ == 16) return cluster >= FAT16EOC_MIN; - return cluster >= FAT32EOC_MIN; - } - bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst); } - bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); } - - // Deprecated functions - #if ALLOW_DEPRECATED_FUNCTIONS - public: - /** - * \deprecated Use: bool SdVolume::init(Sd2Card* dev); - * \param[in] dev The SD card where the volume is located. - * \return true for success or false for failure. - */ - bool init(Sd2Card& dev) { return init(&dev); } - /** - * \deprecated Use: bool SdVolume::init(Sd2Card* dev, uint8_t vol); - * \param[in] dev The SD card where the volume is located. - * \param[in] part The partition to be used. - * \return true for success or false for failure. - */ - bool init(Sd2Card& dev, uint8_t part) { return init(&dev, part); } - #endif // ALLOW_DEPRECATED_FUNCTIONS -}; - -#endif // _SDVOLUME_H_ diff --git a/Marlin_thinkerV2/Marlin/Version.h b/Marlin_thinkerV2/Marlin/Version.h deleted file mode 100644 index 8d600b6a33..0000000000 --- a/Marlin_thinkerV2/Marlin/Version.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * This file is the standard Marlin version identifier file, all fields can be - * overriden by the ones defined on _Version.h by using the Configuration.h - * directive USE_AUTOMATIC_VERSIONING. - */ - -#if ENABLED(USE_AUTOMATIC_VERSIONING) - - #include "_Version.h" - -#else - - /** - * Marlin release version identifier - */ - #define SHORT_BUILD_VERSION "1.1.9" - - /** - * Verbose version identifier which should contain a reference to the location - * from where the binary was downloaded or the source code was compiled. - */ - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" - - /** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ - #define STRING_DISTRIBUTION_DATE "2018-08-01" - - /** - * Required minimum Configuration.h and Configuration_adv.h file versions. - * - * You must increment this version number for every significant change such as, - * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on - * the configuration files. - */ - #define REQUIRED_CONFIGURATION_H_VERSION 010109 - #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010109 - - /** - * The protocol for communication to the host. Protocol indicates communication - * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. - * (Other behaviors are given by the firmware version and capabilities report.) - */ - #define PROTOCOL_VERSION "1.0" - - /** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ - #define MACHINE_NAME "3D Printer" - - /** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ - #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" - - /** - * Default generic printer UUID. - */ - #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" - - /** - * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. - */ - #define WEBSITE_URL "http://eryone.com" - -#endif // USE_AUTOMATIC_VERSIONING diff --git a/Marlin_thinkerV2/Marlin/bitmap_flags.h b/Marlin_thinkerV2/Marlin/bitmap_flags.h deleted file mode 100644 index 7f7d04f5dd..0000000000 --- a/Marlin_thinkerV2/Marlin/bitmap_flags.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef _BITMAP_FLAGS_H_ -#define _BITMAP_FLAGS_H_ - -#include "macros.h" - -/** - * These support functions allow the use of large bit arrays of flags that take very - * little RAM. Currently they are limited to being 16x16 in size. Changing the declaration - * to unsigned long will allow us to go to 32x32 if higher resolution meshes are needed - * in the future. - */ -FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); } -FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); } -FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } - -#endif // _BITMAP_FLAGS_H_ diff --git a/Marlin_thinkerV2/Marlin/blinkm.cpp b/Marlin_thinkerV2/Marlin/blinkm.cpp deleted file mode 100644 index 7eba6c0d92..0000000000 --- a/Marlin_thinkerV2/Marlin/blinkm.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * blinkm.cpp - Control a BlinkM over i2c - */ - -#include "MarlinConfig.h" - -#if ENABLED(BLINKM) - -#include "blinkm.h" -#include "leds.h" -#include - -void blinkm_set_led_color(const LEDColor &color) { - Wire.begin(); - Wire.beginTransmission(0x09); - Wire.write('o'); //to disable ongoing script, only needs to be used once - Wire.write('n'); - Wire.write(color.r); - Wire.write(color.g); - Wire.write(color.b); - Wire.endTransmission(); -} - -#endif // BLINKM diff --git a/Marlin_thinkerV2/Marlin/blinkm.h b/Marlin_thinkerV2/Marlin/blinkm.h deleted file mode 100644 index 20e84d9a95..0000000000 --- a/Marlin_thinkerV2/Marlin/blinkm.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * blinkm.h - Control a BlinkM over i2c - */ - -#ifndef _BLINKM_H_ -#define _BLINKM_H_ - -struct LEDColor; -typedef LEDColor LEDColor; - -void blinkm_set_led_color(const LEDColor &color); - -#endif // _BLINKM_H_ diff --git a/Marlin_thinkerV2/Marlin/boards.h b/Marlin_thinkerV2/Marlin/boards.h deleted file mode 100644 index 18912cedab..0000000000 --- a/Marlin_thinkerV2/Marlin/boards.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef BOARDS_H -#define BOARDS_H - -#define BOARD_UNKNOWN -1 - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 - -#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_PLUS_EFB 143 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_PLUS_EEB 144 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_PLUS_EFF 145 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_PLUS_EEF 146 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_PLUS_SF 148 // RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#define BOARD_3DRAG 77 // 3Drag Controller -#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller) -#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller) -#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers -#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers -#define BOARD_MKS_BASE 40 // MKS BASE v1.0 -#define BOARD_MKS_BASE_15 405 // MKS v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 41 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 47 // MKS GEN v1.3 or 1.4 -#define BOARD_MKS_GEN_L 53 // MKS GEN L -#define BOARD_ZRIB_V20 504 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 49 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 7 // Ultimaker -#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 67 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 80 // Rumba -#define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 431 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 343 // TriGorilla Anycubic version 1.3 based on RAMPS EFB -#define BOARD_TRIGORILLA_14 443 // TriGorilla Anycubic version 1.4 based on RAMPS EFB -#define BOARD_RAMPS_ENDER_4 243 // Creality: Ender-4, CR-8 - -// -// Other ATmega1280, ATmega2560 -// - -#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11 -#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12 -#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 -#define BOARD_CHEAPTRONIC_V2 21 // Cheaptronic v2.0 -#define BOARD_MIGHTYBOARD_REVE 200 // Makerbot Mightyboard Revision E -#define BOARD_MEGATRONICS 70 // Megatronics -#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0 -#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0 -#define BOARD_MEGATRONICS_31 704 // Megatronics v3.1 -#define BOARD_RAMBO 301 // Rambo -#define BOARD_MINIRAMBO 302 // Mini-Rambo -#define BOARD_MINIRAMBO_10A 303 // Mini-Rambo 1.0a -#define BOARD_EINSY_RAMBO 304 // Einsy Rambo -#define BOARD_EINSY_RETRO 305 // Einsy Retro -#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3) -#define BOARD_LEAPFROG 999 // Leapfrog -#define BOARD_MEGACONTROLLER 310 // Mega controller -#define BOARD_SCOOVO_X9H 321 // abee Scoovo X9H -#define BOARD_GT2560_REV_A 74 // Geeetech GT2560 Rev. A -#define BOARD_GT2560_REV_A_PLUS 75 // Geeetech GT2560 Rev. A+ (with auto level probe) - -// -// ATmega1281, ATmega2561 -// - -#define BOARD_MINITRONICS 702 // Minitronics v1.0/1.1 -#define BOARD_SILVER_GATE 25 // Silvergate v1.0 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2 -#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above -#define BOARD_MELZI 63 // Melzi -#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version) -#define BOARD_MELZI_CREALITY 89 // Melzi Creality3D board (for CR-10 etc) -#define BOARD_MELZI_MALYAN 92 // Melzi Malyan M150 board -#define BOARD_MELZI_TRONXY 505 // Tronxy X5S -#define BOARD_STB_11 64 // STB V1.1 -#define BOARD_AZTEEG_X1 65 // Azteeg X1 -#define BOARD_ANET_10 69 // Anet 1.0 (Melzi clone) - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics -#define BOARD_GEN3_PLUS 9 // Gen3+ -#define BOARD_GEN6 5 // Gen6 -#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe -#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" -#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2 -#define BOARD_GEN7_13 12 // Gen7 v1.3 -#define BOARD_GEN7_14 13 // Gen7 v1.4 -#define BOARD_OMCA_A 90 // Alpha OMCA board -#define BOARD_OMCA 91 // Final OMCA board -#define BOARD_SETHI 20 // Sethi 3D_1 - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#define BOARD_TEENSYLU 8 // Teensylu -#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286) -#define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286) -#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646) -#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) -#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286) -#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make -#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board - -#define MB(board) (defined(BOARD_##board) && MOTHERBOARD==BOARD_##board) - -#endif // __BOARDS_H diff --git a/Marlin_thinkerV2/Marlin/buzzer.h b/Marlin_thinkerV2/Marlin/buzzer.h deleted file mode 100644 index d36447deb4..0000000000 --- a/Marlin_thinkerV2/Marlin/buzzer.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __BUZZER_H__ -#define __BUZZER_H__ - -#include "types.h" -#include "fastio.h" -#include "circularqueue.h" -#include "temperature.h" - -#include "MarlinConfig.h" - -#define TONE_QUEUE_LENGTH 4 - -/** - * @brief Tone structure - * @details Simple abstraction of a tone based on a duration and a frequency. - */ -struct tone_t { - uint16_t duration; - uint16_t frequency; -}; - -/** - * @brief Buzzer class - */ -class Buzzer { - private: - struct state_t { - tone_t tone; - uint32_t endtime; - } state; - - protected: - CircularQueue buffer; - - /** - * @brief Inverts the sate of a digital PIN - * @details This will invert the current state of an digital IO pin. - */ - void invert() { - TOGGLE(BEEPER_PIN); - } - - /** - * @brief Turn off a digital PIN - * @details Alias of digitalWrite(PIN, LOW) using FastIO - */ - void off() { - WRITE(BEEPER_PIN, LOW); - } - - /** - * @brief Turn on a digital PIN - * @details Alias of digitalWrite(PIN, HIGH) using FastIO - */ - void on() { - WRITE(BEEPER_PIN, HIGH); - } - - /** - * @brief Resets the state of the class - * @details Brings the class state to a known one. - */ - void reset() { - this->off(); - this->state.endtime = 0; - } - - public: - /** - * @brief Class constructor - */ - Buzzer() { - SET_OUTPUT(BEEPER_PIN); - this->reset(); - } - - /** - * @brief Add a tone to the queue - * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. - * - * @param duration Duration of the tone in milliseconds - * @param frequency Frequency of the tone in hertz - */ - void tone(const uint16_t &duration, const uint16_t &frequency=0) { - while (buffer.isFull()) { - this->tick(); - thermalManager.manage_heater(); - } - tone_t tone = { duration, frequency }; - this->buffer.enqueue(tone); - } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * playing the tones in the queue. - */ - virtual void tick() { - const millis_t now = millis(); - - if (!this->state.endtime) { - if (this->buffer.isEmpty()) return; - - this->state.tone = this->buffer.dequeue(); - this->state.endtime = now + this->state.tone.duration; - - if (this->state.tone.frequency > 0) { - #if ENABLED(SPEAKER) - CRITICAL_SECTION_START; - ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); - CRITICAL_SECTION_END; - #else - this->on(); - #endif - } - } - else if (ELAPSED(now, this->state.endtime)) this->reset(); - } -}; - -extern Buzzer buzzer; - -#endif diff --git a/Marlin_thinkerV2/Marlin/cardreader.cpp b/Marlin_thinkerV2/Marlin/cardreader.cpp deleted file mode 100644 index 24a921a36b..0000000000 --- a/Marlin_thinkerV2/Marlin/cardreader.cpp +++ /dev/null @@ -1,1010 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "cardreader.h" - -#include "ultralcd.h" -#include "stepper.h" -#include "language.h" -#include "printcounter.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP -#include "power_loss_recovery.h" -#endif - - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -CardReader::CardReader() { - #if ENABLED(SDCARD_SORT_ALPHA) - sort_count = 0; - #if ENABLED(SDSORT_GCODE) - sort_alpha = true; - sort_folders = FOLDER_SORTING; - //sort_reverse = false; - #endif - #endif - sdprinting = cardOK = saving = logging = false; - filesize = 0; - sdpos = 0; - file_subcall_ctr = 0; - - workDirDepth = 0; - ZERO(workDirParents); - - // Disable autostart until card is initialized - autostart_index = -1; - - //power to SD reader - #if SDPOWER > -1 - OUT_WRITE(SDPOWER, HIGH); - #endif -} - -char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters - char *pos = buffer; - for (uint8_t i = 0; i < 11; i++) { - if (p.name[i] == ' ') continue; - if (i == 8) *pos++ = '.'; - *pos++ = p.name[i]; - } - *pos++ = 0; - return buffer; -} - -/** - * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction: - * LS_Count - Add +1 to nrFiles for every file within the parent - * LS_GetFilename - Get the filename of the file indexed by nrFile_index - * LS_SerialPrint - Print the full path and size of each file to serial output - */ - -uint16_t nrFile_index; - -void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) { - dir_t p; - uint8_t cnt = 0; - - // Read the next entry from a directory - while (parent.readDir(&p, longFilename) > 0) { - - // If the entry is a directory and the action is LS_SerialPrint - if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { - - // Get the short name for the item, which we know is a folder - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, p); - - // Allocate enough stack space for the full path to a folder, trailing slash, and nul - const bool prepend_is_empty = (!prepend || prepend[0] == '\0'); - const int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1; - char path[len]; - - // Append the FOLDERNAME12/ to the passed string. - // It contains the full path to the "parent" argument. - // We now have the full path to the item in this folder. - strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty - strcat(path, dosFilename); // FILENAME_LENGTH-1 characters maximum - strcat(path, "/"); // 1 character - - // Serial.print(path); - - // Get a new directory object using the full path - // and dive recursively into it. - SdFile dir; - if (!dir.open(&parent, dosFilename, O_READ)) { - if (lsAction == LS_SerialPrint) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHOLN(dosFilename); - } - } - lsDive(path, dir); - // close() is done automatically by destructor of SdFile - } - else { - uint8_t pn0 = p.name[0]; - if (pn0 == DIR_NAME_FREE) break; - if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; - if (longFilename[0] == '.') continue; - - if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; - - filenameIsDir = DIR_IS_SUBDIR(&p); - - if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; - - switch (lsAction) { // 1 based file count - case LS_Count: - nrFiles++; - break; - - case LS_SerialPrint: - createFilename(filename, p); - if (prepend) SERIAL_PROTOCOL(prepend); - SERIAL_PROTOCOL(filename); - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLLN(p.fileSize); - break; - - case LS_GetFilename: - createFilename(filename, p); - if (match != NULL) { - if (strcasecmp(match, filename) == 0) return; - } - else if (cnt == nrFile_index) return; // 0 based index - cnt++; - break; - } - - } - } // while readDir -} - -void CardReader::ls() { - lsAction = LS_SerialPrint; - root.rewind(); - lsDive(NULL, root); -} - -#if ENABLED(LONG_FILENAME_HOST_SUPPORT) - - /** - * Get a long pretty path based on a DOS 8.3 path - */ - void CardReader::printLongPath(char *path) { - lsAction = LS_GetFilename; - - int i, pathLen = strlen(path); - - // SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path); - - // Zero out slashes to make segments - for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0'; - - SdFile diveDir = root; // start from the root for segment 1 - for (i = 0; i < pathLen;) { - - if (path[i] == '\0') i++; // move past a single nul - - char *segment = &path[i]; // The segment after most slashes - - // If a segment is empty (extra-slash) then exit - if (!*segment) break; - - // Go to the next segment - while (path[++i]) { } - - // SERIAL_ECHOPGM("Looking for segment: "); SERIAL_ECHOLN(segment); - - // Find the item, setting the long filename - diveDir.rewind(); - lsDive(NULL, diveDir, segment); - - // Print /LongNamePart to serial output - SERIAL_PROTOCOLCHAR('/'); - SERIAL_PROTOCOL(longFilename[0] ? longFilename : "???"); - - // If the filename was printed then that's it - if (!filenameIsDir) break; - - // SERIAL_ECHOPGM("Opening dir: "); SERIAL_ECHOLN(segment); - - // Open the sub-item as the new dive parent - SdFile dir; - if (!dir.open(&diveDir, segment, O_READ)) { - SERIAL_EOL(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHO(segment); - break; - } - - diveDir.close(); - diveDir = dir; - - } // while i SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); - SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); - kill(PSTR(MSG_KILLED)); - return; - } - - // Store current filename (based on workDirParents) and position - getAbsFilename(proc_filenames[file_subcall_ctr]); - filespos[file_subcall_ctr] = sdpos; - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", path); - SERIAL_ECHOPAIR("\" parent:\"", proc_filenames[file_subcall_ctr]); - SERIAL_ECHOLNPAIR("\" pos", sdpos); - file_subcall_ctr++; - } - else - doing = 1; - } - else if (subcall) { // Returning from a subcall? - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("END SUBROUTINE"); - } - else { // Opening fresh file - doing = 2; - file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure - } - - if (doing) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Now "); - serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); - SERIAL_ECHOLNPAIR(" file: ", path); - } - - stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, path, false); - if (!fname) return; - - if (read) { - if (file.open(curDir, fname, O_READ)) { - filesize = file.fileSize(); - sdpos = 0; -#if POWER_LOSS_RECOVER_SUPER_CAP - strcpy(recovery_detect_cap.file_name, fname); - SERIAL_ECHOLN(recovery_detect_cap.file_name); -#endif -#if ENABLED(POWER_LOSS_RECOVERY) - memset(&job_recovery_info,0,sizeof(job_recovery_info)); -#endif - SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); - SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize); - SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); - - getfilename(0, fname); - lcd_setstatus(longFilename[0] ? longFilename : fname); - //if (longFilename[0]) { - // SERIAL_PROTOCOLPAIR(MSG_SD_FILE_LONG_NAME, longFilename); - //} - } - else { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - } - else { //write - if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else { - saving = true; - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, path); - lcd_setstatus(fname); - } - } -} - -void CardReader::removeFile(const char * const name) { - if (!cardOK) return; - - stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, name, false); - if (!fname) return; - - if (file.remove(curDir, fname)) { - SERIAL_PROTOCOLPGM("File deleted:"); - SERIAL_PROTOCOLLN(fname); - sdpos = 0; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - else { - SERIAL_PROTOCOLPGM("Deletion failed, File: "); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLCHAR('.'); - } -} - -uint32_t CardReader::getStatus(char disp) { - uint32_t ret=0; - if (cardOK && sdprinting) { - if(disp) - { - SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); - SERIAL_PROTOCOL(sdpos); - SERIAL_PROTOCOLCHAR('/'); - SERIAL_PROTOCOLLN(filesize); - } - ret=sdpos; - } - else - SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING); - return ret; -} - -void CardReader::write_command(char *buf) { - char* begin = buf; - char* npos = NULL; - char* end = buf + strlen(buf) - 1; - - file.writeError = false; - if ((npos = strchr(buf, 'N')) != NULL) { - begin = strchr(npos, ' ') + 1; - end = strchr(npos, '*') - 1; - } - end[1] = '\r'; - end[2] = '\n'; - end[3] = '\0'; - file.write(begin); - if (file.writeError) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE); - } -} - -// -// Run the next autostart file. Called: -// - On boot after successful card init -// - After finishing the previous autostart file -// - From the LCD command to run the autostart file -// - -void CardReader::checkautostart() { - - if (autostart_index < 0 || sdprinting) return; - - if (!cardOK) initsd(); - - if (cardOK - #if ENABLED(POWER_LOSS_RECOVERY) - && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists - #endif - ) { - char autoname[10]; - sprintf_P(autoname, PSTR("auto%i.g"), int(autostart_index)); - dir_t p; - root.rewind(); - while (root.readDir(&p, NULL) > 0) { - for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); - if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { - openAndPrintFile(autoname); - autostart_index++; - return; - } - } - } - autostart_index = -1; -} - -void CardReader::beginautostart() { - autostart_index = 0; - setroot(); -} - -void CardReader::closefile(const bool store_location) { - file.sync(); - file.close(); - saving = logging = false; - - if (store_location) { - //future: store printer state, filename and position for continuing a stopped print - // so one can unplug the printer and continue printing the next day. - } -} - -/** - * Get the name of a file in the current directory by index - * with optional name to match. - */ -void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) { - #if ENABLED(SDSORT_CACHE_NAMES) - if (match != NULL) { - while (nr < sort_count) { - if (strcasecmp(match, sortshort[nr]) == 0) break; - nr++; - } - } - if (nr < sort_count) { - strcpy(filename, sortshort[nr]); - strcpy(longFilename, sortnames[nr]); - filenameIsDir = TEST(isDir[nr>>3], nr & 0x07); - return; - } - #endif // SDSORT_CACHE_NAMES - lsAction = LS_GetFilename; - nrFile_index = nr; - workDir.rewind(); - lsDive(NULL, workDir, match); -} - -uint16_t CardReader::getnrfilenames() { - lsAction = LS_Count; - nrFiles = 0; - workDir.rewind(); - lsDive(NULL, workDir); - //SERIAL_ECHOLN(nrFiles); - return nrFiles; -} - -/** - * Dive to the given file path, with optional echo. - * On exit set curDir and return the name part of the path. - * A NULL result indicates an unrecoverable error. - */ -const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo) { - SdFile myDir; - if (path[0] != '/') { curDir = &workDir; return path; } - - curDir = &root; - const char *dirname_start = &path[1]; - while (dirname_start) { - char * const dirname_end = strchr(dirname_start, '/'); - if (dirname_end <= dirname_start) break; - const uint8_t len = dirname_end - dirname_start; - char dosSubdirname[len + 1]; - strncpy(dosSubdirname, dirname_start, len); - dosSubdirname[len] = 0; - - if (echo) SERIAL_ECHOLN(dosSubdirname); - - if (!myDir.open(curDir, dosSubdirname, O_READ)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - return NULL; - } - curDir = &myDir; - dirname_start = dirname_end + 1; - } - return dirname_start; -} - -void CardReader::chdir(const char * relpath) { - SdFile newDir; - SdFile *parent = workDir.isOpen() ? &workDir : &root; - - if (newDir.open(parent, relpath, O_READ)) { - workDir = newDir; - if (workDirDepth < MAX_DIR_DEPTH) - workDirParents[workDirDepth++] = workDir; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); - SERIAL_ECHOLN(relpath); - } -} - -int8_t CardReader::updir() { - if (workDirDepth > 0) { // At least 1 dir has been saved - workDir = --workDirDepth ? workDirParents[workDirDepth - 1] : root; // Use parent, or root if none - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - return workDirDepth; -} - -void CardReader::setroot() { - /*if (!workDir.openRoot(&volume)) { - SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - }*/ - workDir = root; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif -} - -#if ENABLED(SDCARD_SORT_ALPHA) - - /** - * Get the name of a file in the current directory by sort-index - */ - void CardReader::getfilename_sorted(const uint16_t nr) { - getfilename( - #if ENABLED(SDSORT_GCODE) - sort_alpha && - #endif - (nr < sort_count) ? sort_order[nr] : nr - ); - } - - /** - * Read all the files and produce a sort key - * - * We can do this in 3 ways... - * - Minimal RAM: Read two filenames at a time sorting along... - * - Some RAM: Buffer the directory just for this sort - * - Most RAM: Buffer the directory and return filenames from RAM - */ - void CardReader::presort() { - - // Throw away old sort index - flush_presort(); - - // Sorting may be turned off - #if ENABLED(SDSORT_GCODE) - if (!sort_alpha) return; - #endif - - // If there are files, sort up to the limit - uint16_t fileCnt = getnrfilenames(); - if (fileCnt > 0) { - - // Never sort more than the max allowed - // If you use folders to organize, 20 may be enough - if (fileCnt > SDSORT_LIMIT) fileCnt = SDSORT_LIMIT; - - // Sort order is always needed. May be static or dynamic. - #if ENABLED(SDSORT_DYNAMIC_RAM) - sort_order = new uint8_t[fileCnt]; - #endif - - // Use RAM to store the entire directory during pre-sort. - // SDSORT_LIMIT should be set to prevent over-allocation. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortshort = new char*[fileCnt]; - sortnames = new char*[fileCnt]; - #endif - #elif ENABLED(SDSORT_USES_STACK) - char sortnames[fileCnt][SORTED_LONGNAME_MAXLEN]; - #endif - - // Folder sorting needs 1 bit per entry for flags. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - isDir = new uint8_t[(fileCnt + 7) >> 3]; - #elif ENABLED(SDSORT_USES_STACK) - uint8_t isDir[(fileCnt + 7) >> 3]; - #endif - #endif - - #else // !SDSORT_USES_RAM - - // By default re-read the names from SD for every compare - // retaining only two filenames at a time. This is very - // slow but is safest and uses minimal RAM. - char name1[LONG_FILENAME_LENGTH + 1]; - - #endif - - if (fileCnt > 1) { - - // Init sort order. - for (uint16_t i = 0; i < fileCnt; i++) { - sort_order[i] = i; - // If using RAM then read all filenames now. - #if ENABLED(SDSORT_USES_RAM) - getfilename(i); - #if ENABLED(SDSORT_DYNAMIC_RAM) - // Use dynamic method to copy long filename - sortnames[i] = strdup(longest_filename()); - #if ENABLED(SDSORT_CACHE_NAMES) - // When caching also store the short name, since - // we're replacing the getfilename() behavior. - sortshort[i] = strdup(filename); - #endif - #else - // Copy filenames into the static array - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[i], filename); - #endif - #endif - // char out[30]; - // sprintf_P(out, PSTR("---- %i %s %s"), i, filenameIsDir ? "D" : " ", sortnames[i]); - // SERIAL_ECHOLN(out); - #if HAS_FOLDER_SORTING - const uint16_t bit = i & 0x07, ind = i >> 3; - if (bit == 0) isDir[ind] = 0x00; - if (filenameIsDir) isDir[ind] |= _BV(bit); - #endif - #endif - } - - // Bubble Sort - for (uint16_t i = fileCnt; --i;) { - bool didSwap = false; - for (uint16_t j = 0; j < i; ++j) { - const uint16_t o1 = sort_order[j], o2 = sort_order[j + 1]; - - // Compare names from the array or just the two buffered names - #if ENABLED(SDSORT_USES_RAM) - #define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0) - #else - #define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) - #endif - - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_USES_RAM) - // Folder sorting needs an index and bit to test for folder-ness. - const uint8_t ind1 = o1 >> 3, bit1 = o1 & 0x07, - ind2 = o2 >> 3, bit2 = o2 & 0x07; - #define _SORT_CMP_DIR(fs) \ - (((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \ - ? _SORT_CMP_NODIR() \ - : (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0) - #else - #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) - #endif - #endif - - // The most economical method reads names as-needed - // throughout the loop. Slow if there are many. - #if DISABLED(SDSORT_USES_RAM) - getfilename(o1); - strcpy(name1, longest_filename()); // save (or getfilename below will trounce it) - #if HAS_FOLDER_SORTING - bool dir1 = filenameIsDir; - #endif - getfilename(o2); - char *name2 = longest_filename(); // use the string in-place - #endif // !SDSORT_USES_RAM - - // Sort the current pair according to settings. - if ( - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_GCODE) - sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_NODIR() - #else - _SORT_CMP_DIR(FOLDER_SORTING) - #endif - #else - _SORT_CMP_NODIR() - #endif - ) { - sort_order[j] = o2; - sort_order[j + 1] = o1; - didSwap = true; - } - } - if (!didSwap) break; - } - // Using RAM but not keeping names around - #if ENABLED(SDSORT_USES_RAM) && DISABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - for (uint16_t i = 0; i < fileCnt; ++i) free(sortnames[i]); - #if HAS_FOLDER_SORTING - free(isDir); - #endif - #endif - #endif - } - else { - sort_order[0] = 0; - #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) - getfilename(0); - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortnames = new char*[1]; - sortnames[0] = strdup(longest_filename()); // malloc - #if ENABLED(SDSORT_CACHE_NAMES) - sortshort = new char*[1]; - sortshort[0] = strdup(filename); // malloc - #endif - isDir = new uint8_t[1]; - #else - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[0], filename); - #endif - #endif - isDir[0] = filenameIsDir ? 0x01 : 0x00; - #endif - } - - sort_count = fileCnt; - } - } - - void CardReader::flush_presort() { - if (sort_count > 0) { - #if ENABLED(SDSORT_DYNAMIC_RAM) - delete sort_order; - #if ENABLED(SDSORT_CACHE_NAMES) - for (uint8_t i = 0; i < sort_count; ++i) { - free(sortshort[i]); // strdup - free(sortnames[i]); // strdup - } - delete sortshort; - delete sortnames; - #endif - #endif - sort_count = 0; - } - } - -#endif // SDCARD_SORT_ALPHA - -uint16_t CardReader::get_num_Files() { - return - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES - nrFiles // no need to access the SD card for filenames - #else - getnrfilenames() - #endif - ; -} - -void CardReader::printingHasFinished() { - planner.synchronize(); - file.close(); - enqueue_and_echo_commands_P(PSTR("G28 X")); - if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. - file_subcall_ctr--; - openFile(proc_filenames[file_subcall_ctr], true, true); - setIndex(filespos[file_subcall_ctr]); - startFileprint(); - } - else { - sdprinting = false; - - #if ENABLED(POWER_LOSS_RECOVERY) - removeJobRecoveryFile(); - #endif - - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); - #endif - print_job_timer.stop(); - if (print_job_timer.duration() > 60) - enqueue_and_echo_commands_P(PSTR("M31")); - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - progress_bar_percent = 0; - #endif - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - lcd_reselect_last_file(); - #endif - } -} - -#if ENABLED(AUTO_REPORT_SD_STATUS) - uint8_t CardReader::auto_report_sd_interval = 0; - millis_t CardReader::next_sd_report_ms; - - void CardReader::auto_report_sd_status() { - millis_t current_ms = millis(); - if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) { - next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval; - getStatus(1); - } - } -#endif // AUTO_REPORT_SD_STATUS - -#if ENABLED(POWER_LOSS_RECOVERY) - - char job_recovery_file_name[4] = "bin"; - - void CardReader::openJobRecoveryFile(const bool read) { - if (!cardOK) return; - if (jobRecoveryFile.isOpen()) return; - if (!jobRecoveryFile.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else if (!read) - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); - } - - void CardReader::closeJobRecoveryFile() { jobRecoveryFile.close(); } - - bool CardReader::jobRecoverFileExists() { - const bool exists = jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); - if (exists) jobRecoveryFile.close(); - return exists; - } - - int16_t CardReader::saveJobRecoveryInfo() { - jobRecoveryFile.seekSet(0); - const int16_t ret = jobRecoveryFile.write(&job_recovery_info, sizeof(job_recovery_info)); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); - #endif - return ret; - } - - int16_t CardReader::loadJobRecoveryInfo() { - return jobRecoveryFile.read(&job_recovery_info, sizeof(job_recovery_info)); - } - - void CardReader::removeJobRecoveryFile() { - job_recovery_info.valid_head = job_recovery_info.valid_foot = job_recovery_commands_count = 0; - SERIAL_PROTOCOLPGM("removeJobRecoveryFile"); - - // if (jobRecoverFileExists()) - { - closefile(); - removeFile(job_recovery_file_name); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLPGM("Power-loss file delete"); - serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); - #endif - } - } - -#endif // POWER_LOSS_RECOVERY - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin/cardreader.h b/Marlin_thinkerV2/Marlin/cardreader.h deleted file mode 100644 index 13bac384df..0000000000 --- a/Marlin_thinkerV2/Marlin/cardreader.h +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _CARDREADER_H_ -#define _CARDREADER_H_ - -#include "MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#define SD_RESORT ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_DYNAMIC_RAM) - -#define MAX_DIR_DEPTH 10 // Maximum folder depth - -#include "SdFile.h" - -class CardReader { -public: - CardReader(); - - void initsd(); - void write_command(char *buf); - - void beginautostart(); - void checkautostart(); - - void openFile(char * const path, const bool read, const bool subcall=false); - void openLogFile(char * const path); - void removeFile(const char * const name); - void closefile(const bool store_location=false); - void release(); - void openAndPrintFile(const char *name); - void startFileprint(); - void stopSDPrint( - #if SD_RESORT - const bool re_sort=false - #endif - ); - uint32_t getStatus(char disp); - void printingHasFinished(); - void printFilename(); - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - void printLongPath(char *path); - #endif - - void getfilename(uint16_t nr, const char* const match=NULL); - uint16_t getnrfilenames(); - - void getAbsFilename(char *t); - - void ls(); - void chdir(const char *relpath); - int8_t updir(); - void setroot(); - - const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo); - - uint16_t get_num_Files(); - - #if ENABLED(SDCARD_SORT_ALPHA) - void presort(); - void getfilename_sorted(const uint16_t nr); - #if ENABLED(SDSORT_GCODE) - FORCE_INLINE void setSortOn(bool b) { sort_alpha = b; presort(); } - FORCE_INLINE void setSortFolders(int i) { sort_folders = i; presort(); } - //FORCE_INLINE void setSortReverse(bool b) { sort_reverse = b; } - #endif - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - void openJobRecoveryFile(const bool read); - void closeJobRecoveryFile(); - bool jobRecoverFileExists(); - int16_t saveJobRecoveryInfo(); - int16_t loadJobRecoveryInfo(); - void removeJobRecoveryFile(); - #endif - - FORCE_INLINE void pauseSDPrint() { sdprinting = false; } - FORCE_INLINE bool isFileOpen() { return file.isOpen(); } - FORCE_INLINE bool eof() { return sdpos >= filesize; } - FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } - FORCE_INLINE void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - FORCE_INLINE uint32_t getIndex() { return sdpos; } - FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - void auto_report_sd_status(void); - FORCE_INLINE void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_sd_interval = v; - next_sd_report_ms = millis() + 1000UL * v; - } - #endif - - FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } - -public: - bool saving, logging, sdprinting, cardOK, filenameIsDir; - char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - int8_t autostart_index; - uint32_t filesize, sdpos; -private: - SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; - uint8_t workDirDepth; - - // Sort files and folders alphabetically. - #if ENABLED(SDCARD_SORT_ALPHA) - uint16_t sort_count; // Count of sorted items in the current directory - #if ENABLED(SDSORT_GCODE) - bool sort_alpha; // Flag to enable / disable the feature - int sort_folders; // Flag to enable / disable folder sorting - //bool sort_reverse; // Flag to enable / disable reverse sorting - #endif - - // By default the sort index is static - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *sort_order; - #else - uint8_t sort_order[SDSORT_LIMIT]; - #endif - - #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #define SORTED_LONGNAME_MAXLEN ((SDSORT_CACHE_VFATS) * (FILENAME_LENGTH) + 1) - #else - #define SORTED_LONGNAME_MAXLEN LONG_FILENAME_LENGTH - #endif - - // Cache filenames to speed up SD menus. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - char **sortshort, **sortnames; - #else - char sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; - #endif - #elif DISABLED(SDSORT_USES_STACK) - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; - #endif - - // Folder sorting uses an isDir array when caching items. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *isDir; - #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) - uint8_t isDir[(SDSORT_LIMIT+7)>>3]; - #endif - #endif - - #endif // SDSORT_USES_RAM - - #endif // SDCARD_SORT_ALPHA - - Sd2Card sd2card; - SdVolume volume; - SdFile file; - - #if ENABLED(POWER_LOSS_RECOVERY) - SdFile jobRecoveryFile; - #endif - - #define SD_PROCEDURE_DEPTH 1 - #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) - uint8_t file_subcall_ctr; - uint32_t filespos[SD_PROCEDURE_DEPTH]; - char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - //uint32_t filesize, sdpos; - - LsAction lsAction; //stored for recursion. - uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. - char* diveDirName; - void lsDive(const char *prepend, SdFile parent, const char * const match=NULL); - - #if ENABLED(SDCARD_SORT_ALPHA) - void flush_presort(); - #endif - - #if ENABLED(AUTO_REPORT_SD_STATUS) - static uint8_t auto_report_sd_interval; - static millis_t next_sd_report_ms; - #endif -}; - -#if PIN_EXISTS(SD_DETECT) - #if ENABLED(SD_DETECT_INVERTED) - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH) - #else - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW) - #endif -#else - // No card detect line? Assume the card is inserted. - #define IS_SD_INSERTED true -#endif - -extern CardReader card; - -#endif // SDSUPPORT - -#if ENABLED(SDSUPPORT) - #define IS_SD_PRINTING (card.sdprinting) - #define IS_SD_FILE_OPEN (card.isFileOpen()) -#else - #define IS_SD_PRINTING (false) - #define IS_SD_FILE_OPEN (false) -#endif - -#endif // _CARDREADER_H_ diff --git a/Marlin_thinkerV2/Marlin/circularqueue.h b/Marlin_thinkerV2/Marlin/circularqueue.h deleted file mode 100644 index 9aafb99aca..0000000000 --- a/Marlin_thinkerV2/Marlin/circularqueue.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __CIRCULARQUEUE_H__ -#define __CIRCULARQUEUE_H__ - -#include - -/** - * @brief Circular Queue class - * @details Implementation of the classic ring buffer data structure - */ -template -class CircularQueue { - private: - - /** - * @brief Buffer structure - * @details This structure consolidates all the overhead required to handle - * a circular queue such as the pointers and the buffer vector. - */ - struct buffer_t { - uint8_t head; - uint8_t tail; - uint8_t count; - uint8_t size; - T queue[N]; - } buffer; - - public: - /** - * @brief Class constructor - * @details This class requires two template parameters, T defines the type - * of item this queue will handle and N defines the maximum number of - * items that can be stored on the queue. - */ - CircularQueue() { - this->buffer.size = N; - this->buffer.count = this->buffer.head = this->buffer.tail = 0; - } - - /** - * @brief Removes and returns a item from the queue - * @details Removes the oldest item on the queue, pointed to by the - * buffer_t head field. The item is returned to the caller. - * @return type T item - */ - T dequeue() { - if (this->isEmpty()) return T(); - - uint8_t index = this->buffer.head; - - --this->buffer.count; - if (++this->buffer.head == this->buffer.size) - this->buffer.head = 0; - - return this->buffer.queue[index]; - } - - /** - * @brief Adds an item to the queue - * @details Adds an item to the queue on the location pointed by the buffer_t - * tail variable. Returns false if no queue space is available. - * @param item Item to be added to the queue - * @return true if the operation was successful - */ - bool enqueue(T const &item) { - if (this->isFull()) return false; - - this->buffer.queue[this->buffer.tail] = item; - - ++this->buffer.count; - if (++this->buffer.tail == this->buffer.size) - this->buffer.tail = 0; - - return true; - } - - /** - * @brief Checks if the queue has no items - * @details Returns true if there are no items on the queue, false otherwise. - * @return true if queue is empty - */ - bool isEmpty() { - return this->buffer.count == 0; - } - - /** - * @brief Checks if the queue is full - * @details Returns true if the queue is full, false otherwise. - * @return true if queue is full - */ - bool isFull() { - return this->buffer.count == this->buffer.size; - } - - /** - * @brief Gets the queue size - * @details Returns the maximum number of items a queue can have. - * @return the queue size - */ - uint8_t size() { - return this->buffer.size; - } - - /** - * @brief Gets the next item from the queue without removing it - * @details Returns the next item in the queue without removing it - * or updating the pointers. - * @return first item in the queue - */ - T peek() { - return this->buffer.queue[this->buffer.head]; - } - - /** - * @brief Gets the number of items on the queue - * @details Returns the current number of items stored on the queue. - * @return number of items in the queue - */ - uint8_t count() { - return this->buffer.count; - } -}; - -#endif diff --git a/Marlin_thinkerV2/Marlin/configuration_store.cpp b/Marlin_thinkerV2/Marlin/configuration_store.cpp deleted file mode 100644 index c189b0df31..0000000000 --- a/Marlin_thinkerV2/Marlin/configuration_store.cpp +++ /dev/null @@ -1,2730 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * configuration_store.cpp - * - * Settings and EEPROM storage - * - * IMPORTANT: Whenever there are changes made to the variables stored in EEPROM - * in the functions below, also increment the version number. This makes sure that - * the default values are used whenever there is a change to the data, to prevent - * wrong data being written to the variables. - * - * ALSO: Variables in the Store and Retrieve sections must be in the same order. - * If a feature is disabled, some data must still be written that, when read, - * either sets a Sane Default, or results in No Change to the existing value. - * - */ - -// Change EEPROM version if the structure changes -#define EEPROM_VERSION "V55" -#define EEPROM_OFFSET 100 - -// Check the integrity of data offsets. -// Can be disabled for production build. -//#define DEBUG_EEPROM_READWRITE - -#include "configuration_store.h" -#include "Marlin.h" -#include "language.h" -#include "endstops.h" -#include "planner.h" -#include "temperature.h" -#include "ultralcd.h" -#include "stepper.h" -#include "parser.h" -#include "vector_3.h" -#include "power_loss_recovery.h" - -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "power_loss_recovery.h" -#endif -#if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if HAS_TRINAMIC - #include "stepper_indirection.h" - #include "tmc_util.h" - #define TMC_GET_PWMTHRS(A,Q) _tmc_thrs(stepper##Q.microsteps(), stepper##Q.TPWMTHRS(), planner.axis_steps_per_mm[_AXIS(A)]) -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - #define LPQ_LEN thermalManager.lpq_len -#endif - -#pragma pack(push, 1) // No padding between variables - -typedef struct PID { float Kp, Ki, Kd; } PID; -typedef struct PIDC { float Kp, Ki, Kd, Kc; } PIDC; - -/** - * Current EEPROM Layout - * - * Keep this data structure up to date so - * EEPROM size is known at compile time! - */ -typedef struct SettingsDataStruct { - char version[4]; // Vnn\0 - uint16_t crc; // Data Checksum - - // - // DISTINCT_E_FACTORS - // - uint8_t esteppers; // XYZE_N - XYZ - - uint32_t planner_max_acceleration_mm_per_s2[XYZE_N], // M201 XYZE planner.max_acceleration_mm_per_s2[XYZE_N] - planner_min_segment_time_us; // M205 B planner.min_segment_time_us - float planner_axis_steps_per_mm[XYZE_N], // M92 XYZE planner.axis_steps_per_mm[XYZE_N] - planner_max_feedrate_mm_s[XYZE_N], // M203 XYZE planner.max_feedrate_mm_s[XYZE_N] - planner_acceleration, // M204 P planner.acceleration - planner_retract_acceleration, // M204 R planner.retract_acceleration - planner_travel_acceleration, // M204 T planner.travel_acceleration - planner_min_feedrate_mm_s, // M205 S planner.min_feedrate_mm_s - planner_min_travel_feedrate_mm_s, // M205 T planner.min_travel_feedrate_mm_s - planner_max_jerk[XYZE], // M205 XYZE planner.max_jerk[XYZE] - planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm - - float home_offset[XYZ]; // M206 XYZ - - #if HOTENDS > 1 - float hotend_offset[XYZ][HOTENDS - 1]; // M218 XYZ - #endif - - // - // ENABLE_LEVELING_FADE_HEIGHT - // - float planner_z_fade_height; // M420 Zn planner.z_fade_height - - // - // MESH_BED_LEVELING - // - float mbl_z_offset; // mbl.z_offset - uint8_t mesh_num_x, mesh_num_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - #if ENABLED(MESH_BED_LEVELING) - float mbl_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // mbl.z_values - #else - float mbl_z_values[3][3]; - #endif - - // - // HAS_BED_PROBE - // - float zprobe_zoffset; // M851 Z - - // - // ABL_PLANAR - // - matrix_3x3 planner_bed_level_matrix; // planner.bed_level_matrix - - // - // AUTO_BED_LEVELING_BILINEAR - // - uint8_t grid_max_x, grid_max_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - int bilinear_grid_spacing[2], - bilinear_start[2]; // G29 L F - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // G29 - #else - float z_values[3][3]; - #endif - - // - // AUTO_BED_LEVELING_UBL - // - bool planner_leveling_active; // M420 S planner.leveling_active - int8_t ubl_storage_slot; // ubl.storage_slot - - // - // DELTA / [XYZ]_DUAL_ENDSTOPS - // - #if ENABLED(DELTA) - float delta_height, // M666 H - delta_endstop_adj[ABC], // M666 XYZ - delta_radius, // M665 R - delta_diagonal_rod, // M665 L - delta_segments_per_second, // M665 S - delta_calibration_radius, // M665 B - delta_tower_angle_trim[ABC]; // M665 XYZ - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - float x_endstop_adj, // M666 X - y_endstop_adj, // M666 Y - z_endstop_adj; // M666 Z - #endif - - // - // ULTIPANEL - // - int16_t lcd_preheat_hotend_temp[2], // M145 S0 H - lcd_preheat_bed_temp[2], // M145 S0 B - lcd_preheat_fan_speed[2]; // M145 S0 F - - // - // PIDTEMP - // - PIDC hotendPID[MAX_EXTRUDERS]; // M301 En PIDC / M303 En U - - int16_t lpq_len; // M301 L - - // - // PIDTEMPBED - // - PID bedPID; // M304 PID / M303 E-1 U - - // - // HAS_LCD_CONTRAST - // - int16_t lcd_contrast; // M250 C - - // - // FWRETRACT - // - bool autoretract_enabled; // M209 S - float retract_length, // M207 S - retract_feedrate_mm_s, // M207 F - retract_zlift, // M207 Z - retract_recover_length, // M208 S - retract_recover_feedrate_mm_s, // M208 F - swap_retract_length, // M207 W - swap_retract_recover_length, // M208 W - swap_retract_recover_feedrate_mm_s; // M208 R - - // - // !NO_VOLUMETRIC - // - bool parser_volumetric_enabled; // M200 D parser.volumetric_enabled - float planner_filament_size[MAX_EXTRUDERS]; // M200 T D planner.filament_size[] - - // - // HAS_TRINAMIC - // - #define TMC_AXES (MAX_EXTRUDERS + 6) - uint16_t tmc_stepper_current[TMC_AXES]; // M906 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - uint32_t tmc_hybrid_threshold[TMC_AXES]; // M913 X Y Z X2 Y2 Z2 E0 E1 E2 E3 E4 - int16_t tmc_sgt[XYZ]; // M914 X Y Z - - // - // LIN_ADVANCE - // - float planner_extruder_advance_K; // M900 K planner.extruder_advance_K - - // - // HAS_MOTOR_CURRENT_PWM - // - uint32_t motor_current_setting[XYZ]; // M907 X Z E - - // - // CNC_COORDINATE_SYSTEMS - // - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; // G54-G59.3 - - // - // SKEW_CORRECTION - // - float planner_xy_skew_factor, // M852 I planner.xy_skew_factor - planner_xz_skew_factor, // M852 J planner.xz_skew_factor - planner_yz_skew_factor; // M852 K planner.yz_skew_factor - - // - // ADVANCED_PAUSE_FEATURE - // - float filament_change_unload_length[MAX_EXTRUDERS], // M603 T U - filament_change_load_length[MAX_EXTRUDERS]; // M603 T L - -} SettingsData; - -#pragma pack(pop) - -MarlinSettings settings; - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - extern void refresh_bed_level(); -#endif - -uint16_t MarlinSettings::datasize() { return sizeof(SettingsData); } - -/** - * Post-process after Retrieve or Reset - */ - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float new_z_fade_height; -#endif - -void MarlinSettings::postprocess() { - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - - // steps per s2 needs to be updated to agree with units per s2 - planner.reset_acceleration_rates(); - - // Make sure delta kinematics are updated before refreshing the - // planner position so the stepper counts will be set correctly. - #if ENABLED(DELTA) - recalc_delta_settings(); - #endif - - #if ENABLED(PIDTEMP) - thermalManager.updatePID(); - #endif - - #if DISABLED(NO_VOLUMETRICS) - planner.calculate_volumetric_multipliers(); - #else - for (uint8_t i = COUNT(planner.e_factor); i--;) - planner.refresh_e_factor(i); - #endif - - #if HAS_HOME_OFFSET || ENABLED(DUAL_X_CARRIAGE) - // Software endstops depend on home_offset - LOOP_XYZ(i) update_software_endstops((AxisEnum)i); - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - set_z_fade_height(new_z_fade_height, false); // false = no report - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - refresh_bed_level(); - #endif - - #if HAS_MOTOR_CURRENT_PWM - stepper.refresh_motor_power(); - #endif - - #if ENABLED(FWRETRACT) - fwretract.refresh_autoretract(); - #endif - - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif - - // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm - // and init stepper.count[], planner.position[] with current_position - planner.refresh_positioning(); - - // Various factors can change the current position - if (memcmp(oldpos, current_position, sizeof(oldpos))) - report_current_position(); -} - -#if ENABLED(EEPROM_SETTINGS) - - #define DUMMY_PID_VALUE 3000.0f - #define EEPROM_START() int eeprom_index = EEPROM_OFFSET - #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR) - #define EEPROM_WRITE(VAR) write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_READ(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_READ_ALWAYS(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, true) - #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(ERR); eeprom_error = true; }while(0) - - #if ENABLED(DEBUG_EEPROM_READWRITE) - #define _FIELD_TEST(FIELD) \ - EEPROM_ASSERT( \ - eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ - "Field " STRINGIFY(FIELD) " mismatch." \ - ) - #else - #define _FIELD_TEST(FIELD) NOOP - #endif - - const char version[4] = EEPROM_VERSION; - - bool MarlinSettings::eeprom_error, MarlinSettings::validating; - - void MarlinSettings::write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { - if (eeprom_error) { pos += size; return; } - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); - eeprom_error = true; - return; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - } - - void MarlinSettings::read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool force/*=false*/) { - if (eeprom_error) { pos += size; return; } - do { - uint8_t c = eeprom_read_byte((unsigned char*)pos); - if (!validating || force) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - } - - bool MarlinSettings::size_error(const uint16_t size) { - if (size != datasize()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("EEPROM datasize error."); - return true; - } - return false; - } - - /** - * M500 - Store Configuration - */ - bool MarlinSettings::save() { - float dummy = 0; - char ver[4] = "ERR"; - - uint16_t working_crc = 0; - - EEPROM_START(); - - eeprom_error = false; - - EEPROM_WRITE(ver); // invalidate data first - EEPROM_SKIP(working_crc); // Skip the checksum slot - - working_crc = 0; // clear before first "real data" - - _FIELD_TEST(esteppers); - - const uint8_t esteppers = COUNT(planner.axis_steps_per_mm) - XYZ; - EEPROM_WRITE(esteppers); - - EEPROM_WRITE(planner.max_acceleration_mm_per_s2); - EEPROM_WRITE(planner.min_segment_time_us); - EEPROM_WRITE(planner.axis_steps_per_mm); - EEPROM_WRITE(planner.max_feedrate_mm_s); - EEPROM_WRITE(planner.acceleration); - EEPROM_WRITE(planner.retract_acceleration); - EEPROM_WRITE(planner.travel_acceleration); - EEPROM_WRITE(planner.min_feedrate_mm_s); - EEPROM_WRITE(planner.min_travel_feedrate_mm_s); - - #if ENABLED(JUNCTION_DEVIATION) - const float planner_max_jerk[] = { float(DEFAULT_XJERK), float(DEFAULT_YJERK), float(DEFAULT_ZJERK), float(DEFAULT_EJERK) }; - EEPROM_WRITE(planner_max_jerk); - EEPROM_WRITE(planner.junction_deviation_mm); - #else - EEPROM_WRITE(planner.max_jerk); - dummy = 0.02f; - EEPROM_WRITE(dummy); - #endif - - _FIELD_TEST(home_offset); - - #if !HAS_HOME_OFFSET - const float home_offset[XYZ] = { 0 }; - #endif - EEPROM_WRITE(home_offset); - - #if HOTENDS > 1 - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_WRITE(hotend_offset[i][e]); - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float zfh = planner.z_fade_height; - #else - const float zfh = 10.0; - #endif - EEPROM_WRITE(zfh); - - // - // Mesh Bed Leveling - // - - #if ENABLED(MESH_BED_LEVELING) - // Compile time test that sizeof(mbl.z_values) is as expected - static_assert( - sizeof(mbl.z_values) == GRID_MAX_POINTS * sizeof(mbl.z_values[0][0]), - "MBL Z array is the wrong size." - ); - const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(mbl.z_offset); - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - EEPROM_WRITE(mbl.z_values); - #else // For disabled MBL write a default mesh - dummy = 0; - const uint8_t mesh_num_x = 3, mesh_num_y = 3; - EEPROM_WRITE(dummy); // z_offset - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummy); - #endif // MESH_BED_LEVELING - - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - const float zprobe_zoffset = 0; - #endif - EEPROM_WRITE(zprobe_zoffset); - - // - // Planar Bed Leveling matrix - // - - #if ABL_PLANAR - EEPROM_WRITE(planner.bed_level_matrix); - #else - dummy = 0; - for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Bilinear Auto Bed Leveling - // - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Compile time test that sizeof(z_values) is as expected - static_assert( - sizeof(z_values) == GRID_MAX_POINTS * sizeof(z_values[0][0]), - "Bilinear Z array is the wrong size." - ); - const uint8_t grid_max_x = GRID_MAX_POINTS_X, grid_max_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(grid_max_x); // 1 byte - EEPROM_WRITE(grid_max_y); // 1 byte - EEPROM_WRITE(bilinear_grid_spacing); // 2 ints - EEPROM_WRITE(bilinear_start); // 2 ints - EEPROM_WRITE(z_values); // 9-256 floats - #else - // For disabled Bilinear Grid write an empty 3x3 grid - const uint8_t grid_max_x = 3, grid_max_y = 3; - const int bilinear_start[2] = { 0 }, bilinear_grid_spacing[2] = { 0 }; - dummy = 0; - EEPROM_WRITE(grid_max_x); - EEPROM_WRITE(grid_max_y); - EEPROM_WRITE(bilinear_grid_spacing); - EEPROM_WRITE(bilinear_start); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummy); - #endif // AUTO_BED_LEVELING_BILINEAR - - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_WRITE(planner.leveling_active); - EEPROM_WRITE(ubl.storage_slot); - #else - const bool ubl_active = false; - const int8_t storage_slot = -1; - EEPROM_WRITE(ubl_active); - EEPROM_WRITE(storage_slot); - #endif // AUTO_BED_LEVELING_UBL - - // 11 floats for DELTA / [XYZ]_DUAL_ENDSTOPS - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_WRITE(delta_height); // 1 float - EEPROM_WRITE(delta_endstop_adj); // 3 floats - EEPROM_WRITE(delta_radius); // 1 float - EEPROM_WRITE(delta_diagonal_rod); // 1 float - EEPROM_WRITE(delta_segments_per_second); // 1 float - EEPROM_WRITE(delta_calibration_radius); // 1 float - EEPROM_WRITE(delta_tower_angle_trim); // 3 floats - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - _FIELD_TEST(x_endstop_adj); - - // Write dual endstops in X, Y, Z order. Unused = 0.0 - dummy = 0; - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.x_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.y_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.z_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #endif - - _FIELD_TEST(lcd_preheat_hotend_temp); - - #if DISABLED(ULTIPANEL) - constexpr int16_t lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, - lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }, - lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; - #endif - - EEPROM_WRITE(lcd_preheat_hotend_temp); - EEPROM_WRITE(lcd_preheat_bed_temp); - EEPROM_WRITE(lcd_preheat_fan_speed); - - for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { - - #if ENABLED(PIDTEMP) - if (e < HOTENDS) { - EEPROM_WRITE(PID_PARAM(Kp, e)); - EEPROM_WRITE(PID_PARAM(Ki, e)); - EEPROM_WRITE(PID_PARAM(Kd, e)); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_WRITE(PID_PARAM(Kc, e)); - #else - dummy = 1.0f; // 1.0 = default kc - EEPROM_WRITE(dummy); - #endif - } - else - #endif // !PIDTEMP - { - dummy = DUMMY_PID_VALUE; // When read, will not change the existing value - EEPROM_WRITE(dummy); // Kp - dummy = 0; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc - } - - } // Hotends Loop - - _FIELD_TEST(lpq_len); - - #if DISABLED(PID_EXTRUSION_SCALING) - const int16_t LPQ_LEN = 20; - #endif - EEPROM_WRITE(LPQ_LEN); - - #if DISABLED(PIDTEMPBED) - dummy = DUMMY_PID_VALUE; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); - #else - EEPROM_WRITE(thermalManager.bedKp); - EEPROM_WRITE(thermalManager.bedKi); - EEPROM_WRITE(thermalManager.bedKd); - #endif - - _FIELD_TEST(lcd_contrast); - - #if !HAS_LCD_CONTRAST - const int16_t lcd_contrast = 32; - #endif - EEPROM_WRITE(lcd_contrast); - - #if DISABLED(FWRETRACT) - const bool autoretract_enabled = false; - const float autoretract_defaults[] = { 3, 45, 0, 0, 0, 13, 0, 8 }; - EEPROM_WRITE(autoretract_enabled); - EEPROM_WRITE(autoretract_defaults); - #else - EEPROM_WRITE(fwretract.autoretract_enabled); - EEPROM_WRITE(fwretract.retract_length); - EEPROM_WRITE(fwretract.retract_feedrate_mm_s); - EEPROM_WRITE(fwretract.retract_zlift); - EEPROM_WRITE(fwretract.retract_recover_length); - EEPROM_WRITE(fwretract.retract_recover_feedrate_mm_s); - EEPROM_WRITE(fwretract.swap_retract_length); - EEPROM_WRITE(fwretract.swap_retract_recover_length); - EEPROM_WRITE(fwretract.swap_retract_recover_feedrate_mm_s); - #endif - - // - // Volumetric & Filament Size - // - - _FIELD_TEST(parser_volumetric_enabled); - - #if DISABLED(NO_VOLUMETRICS) - - EEPROM_WRITE(parser.volumetric_enabled); - - // Save filament sizes - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(planner.filament_size)) dummy = planner.filament_size[q]; - EEPROM_WRITE(dummy); - } - - #else - - const bool volumetric_enabled = false; - dummy = DEFAULT_NOMINAL_FILAMENT_DIA; - EEPROM_WRITE(volumetric_enabled); - for (uint8_t q = MAX_EXTRUDERS; q--;) EEPROM_WRITE(dummy); - - #endif - - // - // Save TMC2130 or TMC2208 Configuration, and placeholder values - // - - _FIELD_TEST(tmc_stepper_current); - - uint16_t tmc_stepper_current[TMC_AXES] = { - #if HAS_TRINAMIC - #if AXIS_IS_TMC(X) - stepperX.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y) - stepperY.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z) - stepperZ.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(X2) - stepperX2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E0) - stepperE0.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E1) - stepperE1.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E2) - stepperE2.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E3) - stepperE3.getCurrent(), - #else - 0, - #endif - #if AXIS_IS_TMC(E4) - stepperE4.getCurrent() - #else - 0 - #endif - #else - 0 - #endif - }; - EEPROM_WRITE(tmc_stepper_current); - - // - // Save TMC2130 or TMC2208 Hybrid Threshold, and placeholder values - // - - _FIELD_TEST(tmc_hybrid_threshold); - - uint32_t tmc_hybrid_threshold[TMC_AXES] = { - #if ENABLED(HYBRID_THRESHOLD) - #if AXIS_HAS_STEALTHCHOP(X) - TMC_GET_PWMTHRS(X, X), - #else - X_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_GET_PWMTHRS(Y, Y), - #else - Y_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_GET_PWMTHRS(Z, Z), - #else - Z_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_GET_PWMTHRS(X, X2), - #else - X2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_GET_PWMTHRS(Y, Y2), - #else - Y2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_GET_PWMTHRS(Z, Z2), - #else - Z2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_GET_PWMTHRS(E, E0), - #else - E0_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_GET_PWMTHRS(E, E1), - #else - E1_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_GET_PWMTHRS(E, E2), - #else - E2_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_GET_PWMTHRS(E, E3), - #else - E3_HYBRID_THRESHOLD, - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_GET_PWMTHRS(E, E4) - #else - E4_HYBRID_THRESHOLD - #endif - #else - 100, 100, 3, // X, Y, Z - 100, 100, 3, // X2, Y2, Z2 - 30, 30, 30, 30, 30 // E0, E1, E2, E3, E4 - #endif - }; - EEPROM_WRITE(tmc_hybrid_threshold); - - // - // TMC2130 Sensorless homing threshold - // - int16_t tmc_sgt[XYZ] = { - #if ENABLED(SENSORLESS_HOMING) - #if X_SENSORLESS - stepperX.sgt(), - #else - 0, - #endif - #if Y_SENSORLESS - stepperY.sgt(), - #else - 0, - #endif - #if Z_SENSORLESS - stepperZ.sgt() - #else - 0 - #endif - #else - 0 - #endif - }; - EEPROM_WRITE(tmc_sgt); - - // - // Linear Advance - // - - _FIELD_TEST(planner_extruder_advance_K); - - #if ENABLED(LIN_ADVANCE) - EEPROM_WRITE(planner.extruder_advance_K); - #else - dummy = 0; - EEPROM_WRITE(dummy); - #endif - - _FIELD_TEST(motor_current_setting); - - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]); - #else - const uint32_t dummyui32[XYZ] = { 0 }; - EEPROM_WRITE(dummyui32); - #endif - - // - // CNC Coordinate Systems - // - - _FIELD_TEST(coordinate_system); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - EEPROM_WRITE(coordinate_system); // 27 floats - #else - dummy = 0; - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Skew correction factors - // - - _FIELD_TEST(planner_xy_skew_factor); - - #if ENABLED(SKEW_CORRECTION) - EEPROM_WRITE(planner.xy_skew_factor); - EEPROM_WRITE(planner.xz_skew_factor); - EEPROM_WRITE(planner.yz_skew_factor); - #else - dummy = 0; - for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_unload_length)) dummy = filament_change_unload_length[q]; - EEPROM_WRITE(dummy); - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < COUNT(filament_change_load_length)) dummy = filament_change_load_length[q]; - EEPROM_WRITE(dummy); - } - #else - dummy = 0; - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_WRITE(dummy); - #endif - - // - // Validate CRC and Data Size - // - if (!eeprom_error) { - const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET), - final_crc = working_crc; - - // Write the EEPROM header - eeprom_index = EEPROM_OFFSET; - - EEPROM_WRITE(version); - EEPROM_WRITE(final_crc); - - // Report storage size - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Settings Stored (", eeprom_size); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc); - SERIAL_ECHOLNPGM(")"); - #endif - - eeprom_error |= size_error(eeprom_size); - } -#if POWER_LOSS_RECOVER_SUPER_CAP - power_lose_save(); -#endif - // - // UBL Mesh - // - #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) - if (ubl.storage_slot >= 0) - store_mesh(ubl.storage_slot); - #endif - - return !eeprom_error; - } -#if POWER_LOSS_RECOVER_SUPER_CAP -#define EEPROM_OFFSET_POWEROFF 800 - - bool MarlinSettings::power_lose_save() { - - uint16_t working_crc = 0; - EEPROM_START(); - eeprom_index = EEPROM_OFFSET_POWEROFF; - - EEPROM_SKIP(working_crc); // Skip the checksum slot - working_crc = 0; - - EEPROM_WRITE(recovery_detect_cap); - - const uint16_t final_crc = working_crc; - const int eeprom_size = eeprom_index; - eeprom_index = EEPROM_OFFSET_POWEROFF; - EEPROM_WRITE(final_crc); - SERIAL_ECHOLN("save3"); - /* - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("poweroff Stored (", eeprom_size - EEPROM_OFFSET_POWEROFF); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc); - SERIAL_ECHOLNPGM(")"); - SERIAL_ECHOPAIR("write file name: ",P_file_name); -*/ - - } - - bool MarlinSettings::power_lose_load() { - uint16_t working_crc = 0; - uint16_t stored_crc; - EEPROM_START(); - eeprom_index = EEPROM_OFFSET_POWEROFF; - EEPROM_READ(stored_crc); - working_crc=0; - - EEPROM_READ(recovery_detect_cap); - - if (working_crc == stored_crc) { -//#if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("poweroff stored settings retrieved (", eeprom_index - EEPROM_OFFSET_POWEROFF); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc); - SERIAL_ECHOLNPGM(")"); - SERIAL_ECHOPAIR("read file name: ",recovery_detect_cap.file_name); -//#endif - } - else{ - SERIAL_ECHOPAIR(" \r\nbytes; crc error ", (uint32_t)working_crc); - SERIAL_ECHOPAIR(" \r\nbytes; crc error ", (uint32_t)stored_crc); - } - } - #endif - /** - * M501 - Retrieve Configuration - */ - bool MarlinSettings::_load() { - uint16_t working_crc = 0; - - EEPROM_START(); - - char stored_ver[4]; - EEPROM_READ_ALWAYS(stored_ver); - - uint16_t stored_crc; - EEPROM_READ_ALWAYS(stored_crc); - - // Version has to match or defaults are used - if (strncmp(version, stored_ver, 3) != 0) { - if (stored_ver[3] != '\0') { - stored_ver[0] = '?'; - stored_ver[1] = '\0'; - } - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("EEPROM version mismatch "); - SERIAL_ECHOPAIR("(EEPROM=", stored_ver); - SERIAL_ECHOLNPGM(" Marlin=" EEPROM_VERSION ")"); - #endif - eeprom_error = true; - reset(); - save(); - } - else { - float dummy = 0; - #if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT) || ENABLED(NO_VOLUMETRICS) - bool dummyb; - #endif - - working_crc = 0; // Init to 0. Accumulated by EEPROM_READ - - _FIELD_TEST(esteppers); - - // Number of esteppers may change - uint8_t esteppers; - EEPROM_READ_ALWAYS(esteppers); - - // - // Planner Motion - // - - // 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]; - EEPROM_READ(tmp1); // max_acceleration_mm_per_s2 - EEPROM_READ(planner.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) { - planner.max_acceleration_mm_per_s2[i] = i < XYZ + esteppers ? tmp1[i] : def1[i < COUNT(def1) ? i : COUNT(def1) - 1]; - planner.axis_steps_per_mm[i] = i < XYZ + esteppers ? tmp2[i] : def2[i < COUNT(def2) ? i : COUNT(def2) - 1]; - planner.max_feedrate_mm_s[i] = i < XYZ + esteppers ? tmp3[i] : def3[i < COUNT(def3) ? i : COUNT(def3) - 1]; - } - - EEPROM_READ(planner.acceleration); - EEPROM_READ(planner.retract_acceleration); - EEPROM_READ(planner.travel_acceleration); - EEPROM_READ(planner.min_feedrate_mm_s); - EEPROM_READ(planner.min_travel_feedrate_mm_s); - - #if ENABLED(JUNCTION_DEVIATION) - for (uint8_t q = 4; q--;) EEPROM_READ(dummy); - EEPROM_READ(planner.junction_deviation_mm); - #else - EEPROM_READ(planner.max_jerk); - EEPROM_READ(dummy); - #endif - - // - // Home Offset (M206) - // - - _FIELD_TEST(home_offset); - - #if !HAS_HOME_OFFSET - float home_offset[XYZ]; - #endif - EEPROM_READ(home_offset); - - // - // Hotend Offsets, if any - // - - #if HOTENDS > 1 - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_READ(hotend_offset[i][e]); - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - EEPROM_READ(new_z_fade_height); - #else - EEPROM_READ(dummy); - #endif - - // - // Mesh (Manual) Bed Leveling - // - - uint8_t mesh_num_x, mesh_num_y; - EEPROM_READ(dummy); - EEPROM_READ_ALWAYS(mesh_num_x); - EEPROM_READ_ALWAYS(mesh_num_y); - - #if ENABLED(MESH_BED_LEVELING) - if (!validating) mbl.z_offset = dummy; - if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) { - // EEPROM data fits the current mesh - EEPROM_READ(mbl.z_values); - } - else { - // EEPROM data is stale - if (!validating) mbl.reset(); - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - } - #else - // MBL is disabled - skip the stored data - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - #endif // MESH_BED_LEVELING - - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - float zprobe_zoffset; - #endif - EEPROM_READ(zprobe_zoffset); - - // - // Planar Bed Leveling matrix - // - - #if ABL_PLANAR - EEPROM_READ(planner.bed_level_matrix); - #else - for (uint8_t q = 9; q--;) EEPROM_READ(dummy); - #endif - - // - // Bilinear Auto Bed Leveling - // - - uint8_t grid_max_x, grid_max_y; - EEPROM_READ_ALWAYS(grid_max_x); // 1 byte - EEPROM_READ_ALWAYS(grid_max_y); // 1 byte - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) { - if (!validating) set_bed_leveling_enabled(false); - EEPROM_READ(bilinear_grid_spacing); // 2 ints - EEPROM_READ(bilinear_start); // 2 ints - EEPROM_READ(z_values); // 9 to 256 floats - } - else // EEPROM data is stale - #endif // AUTO_BED_LEVELING_BILINEAR - { - // Skip past disabled (or stale) Bilinear Grid data - int bgs[2], bs[2]; - EEPROM_READ(bgs); - EEPROM_READ(bs); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy); - } - - // - // Unified Bed Leveling active state - // - - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_READ(planner.leveling_active); - EEPROM_READ(ubl.storage_slot); - #else - uint8_t dummyui8; - EEPROM_READ(dummyb); - EEPROM_READ(dummyui8); - #endif // AUTO_BED_LEVELING_UBL - - // - // DELTA Geometry or Dual Endstops offsets - // - - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_READ(delta_height); // 1 float - EEPROM_READ(delta_endstop_adj); // 3 floats - EEPROM_READ(delta_radius); // 1 float - EEPROM_READ(delta_diagonal_rod); // 1 float - EEPROM_READ(delta_segments_per_second); // 1 float - EEPROM_READ(delta_calibration_radius); // 1 float - EEPROM_READ(delta_tower_angle_trim); // 3 floats - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - _FIELD_TEST(x_endstop_adj); - - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_READ(endstops.x_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_READ(endstops.y_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_READ(endstops.z_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - - #endif - - // - // LCD Preheat settings - // - - _FIELD_TEST(lcd_preheat_hotend_temp); - - #if DISABLED(ULTIPANEL) - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - #endif - EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats - EEPROM_READ(lcd_preheat_bed_temp); // 2 floats - EEPROM_READ(lcd_preheat_fan_speed); // 2 floats - - //EEPROM_ASSERT( - // WITHIN(lcd_preheat_fan_speed, 0, 255), - // "lcd_preheat_fan_speed out of range" - //); - - // - // Hotend PID - // - - #if ENABLED(PIDTEMP) - for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { - EEPROM_READ(dummy); // Kp - if (e < HOTENDS && dummy != DUMMY_PID_VALUE) { - // do not need to scale PID values as the values in EEPROM are already scaled - if (!validating) PID_PARAM(Kp, e) = dummy; - EEPROM_READ(PID_PARAM(Ki, e)); - EEPROM_READ(PID_PARAM(Kd, e)); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_READ(PID_PARAM(Kc, e)); - #else - EEPROM_READ(dummy); - #endif - } - else { - for (uint8_t q=3; q--;) EEPROM_READ(dummy); // Ki, Kd, Kc - } - } - #else // !PIDTEMP - // 4 x 4 = 16 slots for PID parameters - for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc - #endif // !PIDTEMP - - // - // PID Extrusion Scaling - // - - _FIELD_TEST(lpq_len); - - #if DISABLED(PID_EXTRUSION_SCALING) - int16_t LPQ_LEN; - #endif - EEPROM_READ(LPQ_LEN); - - // - // Heated Bed PID - // - - #if ENABLED(PIDTEMPBED) - EEPROM_READ(dummy); // bedKp - if (dummy != DUMMY_PID_VALUE) { - if (!validating) thermalManager.bedKp = dummy; - EEPROM_READ(thermalManager.bedKi); - EEPROM_READ(thermalManager.bedKd); - } - #else - for (uint8_t q=3; q--;) EEPROM_READ(dummy); // bedKp, bedKi, bedKd - #endif - - // - // LCD Contrast - // - - _FIELD_TEST(lcd_contrast); - - #if !HAS_LCD_CONTRAST - int16_t lcd_contrast; - #endif - EEPROM_READ(lcd_contrast); - - // - // Firmware Retraction - // - - #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - EEPROM_READ(fwretract.retract_length); - EEPROM_READ(fwretract.retract_feedrate_mm_s); - EEPROM_READ(fwretract.retract_zlift); - EEPROM_READ(fwretract.retract_recover_length); - EEPROM_READ(fwretract.retract_recover_feedrate_mm_s); - EEPROM_READ(fwretract.swap_retract_length); - EEPROM_READ(fwretract.swap_retract_recover_length); - EEPROM_READ(fwretract.swap_retract_recover_feedrate_mm_s); - #else - EEPROM_READ(dummyb); - for (uint8_t q=8; q--;) EEPROM_READ(dummy); - #endif - - // - // Volumetric & Filament Size - // - - _FIELD_TEST(parser_volumetric_enabled); - - #if DISABLED(NO_VOLUMETRICS) - - EEPROM_READ(parser.volumetric_enabled); - - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(planner.filament_size)) - planner.filament_size[q] = dummy; - } - - #else - - EEPROM_READ(dummyb); - for (uint8_t q=MAX_EXTRUDERS; q--;) EEPROM_READ(dummy); - - #endif - - if (!validating) reset_stepper_drivers(); - - // - // TMC2130 Stepper Settings - // - - _FIELD_TEST(tmc_stepper_current); - - #if HAS_TRINAMIC - - #define SET_CURR(Q) stepper##Q.setCurrent(currents[TMC_##Q] ? currents[TMC_##Q] : Q##_CURRENT, R_SENSE, HOLD_MULTIPLIER) - uint16_t currents[TMC_AXES]; - EEPROM_READ(currents); - if (!validating) { - #if AXIS_IS_TMC(X) - SET_CURR(X); - #endif - #if AXIS_IS_TMC(Y) - SET_CURR(Y); - #endif - #if AXIS_IS_TMC(Z) - SET_CURR(Z); - #endif - #if AXIS_IS_TMC(X2) - SET_CURR(X2); - #endif - #if AXIS_IS_TMC(Y2) - SET_CURR(Y2); - #endif - #if AXIS_IS_TMC(Z2) - SET_CURR(Z2); - #endif - #if AXIS_IS_TMC(E0) - SET_CURR(E0); - #endif - #if AXIS_IS_TMC(E1) - SET_CURR(E1); - #endif - #if AXIS_IS_TMC(E2) - SET_CURR(E2); - #endif - #if AXIS_IS_TMC(E3) - SET_CURR(E3); - #endif - #if AXIS_IS_TMC(E4) - SET_CURR(E4); - #endif - } - #else - uint16_t val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(val); - #endif - - #if ENABLED(HYBRID_THRESHOLD) - #define TMC_SET_PWMTHRS(A,Q) tmc_set_pwmthrs(stepper##Q, tmc_hybrid_threshold[TMC_##Q], planner.axis_steps_per_mm[_AXIS(A)]) - uint32_t tmc_hybrid_threshold[TMC_AXES]; - EEPROM_READ(tmc_hybrid_threshold); - if (!validating) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SET_PWMTHRS(X, X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SET_PWMTHRS(Y, Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SET_PWMTHRS(Z, Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SET_PWMTHRS(X, X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SET_PWMTHRS(Y, Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SET_PWMTHRS(Z, Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SET_PWMTHRS(E, E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_SET_PWMTHRS(E, E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_SET_PWMTHRS(E, E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_SET_PWMTHRS(E, E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_SET_PWMTHRS(E, E4); - #endif - } - #else - uint32_t thrs_val; - for (uint8_t q=TMC_AXES; q--;) EEPROM_READ(thrs_val); - #endif - - /* - * TMC2130 Sensorless homing threshold. - * X and X2 use the same value - * Y and Y2 use the same value - * Z and Z2 use the same value - */ - int16_t tmc_sgt[XYZ]; - EEPROM_READ(tmc_sgt); - #if ENABLED(SENSORLESS_HOMING) - if (!validating) { - #ifdef X_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(X) - stepperX.sgt(tmc_sgt[0]); - #endif - #if AXIS_HAS_STALLGUARD(X2) - stepperX2.sgt(tmc_sgt[0]); - #endif - #endif - #ifdef Y_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Y) - stepperY.sgt(tmc_sgt[1]); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.sgt(tmc_sgt[1]); - #endif - #endif - #ifdef Z_HOMING_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.sgt(tmc_sgt[2]); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.sgt(tmc_sgt[2]); - #endif - #endif - } - #endif - - // - // Linear Advance - // - - _FIELD_TEST(planner_extruder_advance_K); - - #if ENABLED(LIN_ADVANCE) - EEPROM_READ(planner.extruder_advance_K); - #else - EEPROM_READ(dummy); - #endif - - // - // Motor Current PWM - // - - _FIELD_TEST(motor_current_setting); - - #if HAS_MOTOR_CURRENT_PWM - for (uint8_t q = XYZ; q--;) EEPROM_READ(stepper.motor_current_setting[q]); - #else - uint32_t dummyui32[XYZ]; - EEPROM_READ(dummyui32); - #endif - - // - // CNC Coordinate System - // - - _FIELD_TEST(coordinate_system); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - if (!validating) (void)select_coordinate_system(-1); // Go back to machine space - EEPROM_READ(coordinate_system); // 27 floats - #else - for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_READ(dummy); - #endif - - // - // Skew correction factors - // - - _FIELD_TEST(planner_xy_skew_factor); - - #if ENABLED(SKEW_CORRECTION_GCODE) - EEPROM_READ(planner.xy_skew_factor); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - EEPROM_READ(planner.xz_skew_factor); - EEPROM_READ(planner.yz_skew_factor); - #else - EEPROM_READ(dummy); - EEPROM_READ(dummy); - #endif - #else - for (uint8_t q = 3; q--;) EEPROM_READ(dummy); - #endif - - // - // Advanced Pause filament load & unload lengths - // - - _FIELD_TEST(filament_change_unload_length); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_unload_length)) filament_change_unload_length[q] = dummy; - } - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ(dummy); - if (!validating && q < COUNT(filament_change_load_length)) filament_change_load_length[q] = dummy; - } - #else - for (uint8_t q = MAX_EXTRUDERS * 2; q--;) EEPROM_READ(dummy); - #endif - - eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); - if (eeprom_error) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET))); - SERIAL_ECHOLNPAIR(" Size: ", datasize()); - - } - else if (working_crc != stored_crc) { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("EEPROM CRC mismatch - (stored) "); - SERIAL_ERROR(stored_crc); - SERIAL_ERRORPGM(" != "); - SERIAL_ERROR(working_crc); - SERIAL_ERRORLNPGM(" (calculated)!"); - #endif - } - else if (!validating) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHO(version); - SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET)); - SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc); - SERIAL_ECHOLNPGM(")"); - #endif - } - - if (!validating && !eeprom_error) postprocess(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (!validating) { - ubl.report_state(); - - if (!ubl.sanity_check()) { - SERIAL_EOL(); - #if ENABLED(EEPROM_CHITCHAT) - ubl.echo_name(); - SERIAL_ECHOLNPGM(" initialized.\n"); - #endif - } - else { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLPGM("?Can't enable "); - ubl.echo_name(); - SERIAL_PROTOCOLLNPGM("."); - #endif - ubl.reset(); - } - - if (ubl.storage_slot >= 0) { - load_mesh(ubl.storage_slot); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOPAIR("Mesh ", ubl.storage_slot); - SERIAL_ECHOLNPGM(" loaded from storage."); - #endif - } - else { - ubl.reset(); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOLNPGM("UBL System reset()"); - #endif - } - } - #endif - } - - #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) - if (!validating) report(); - #endif -#if POWER_LOSS_RECOVER_SUPER_CAP - (void)settings.power_lose_load(); -#endif - return !eeprom_error; - } - - bool MarlinSettings::validate() { - validating = true; - const bool success = _load(); - validating = false; - return success; - } - - bool MarlinSettings::load() { - if (validate()) return _load(); - reset(); - return true; - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - #if ENABLED(EEPROM_CHITCHAT) - void ubl_invalid_slot(const int s) { - SERIAL_PROTOCOLLNPGM("?Invalid slot."); - SERIAL_PROTOCOL(s); - SERIAL_PROTOCOLLNPGM(" mesh slots available."); - } - #endif - - uint16_t MarlinSettings::meshes_start_index() { - return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up - // or down a little bit without disrupting the mesh data - } - - uint16_t MarlinSettings::calc_num_meshes() { - return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values); - } - - int MarlinSettings::mesh_slot_offset(const int8_t slot) { - return meshes_end - (slot + 1) * sizeof(ubl.z_values); - } - - void MarlinSettings::store_mesh(const int8_t slot) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - const int16_t a = calc_num_meshes(); - if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - SERIAL_PROTOCOLPAIR("E2END=", E2END); - SERIAL_PROTOCOLPAIR(" meshes_end=", meshes_end); - SERIAL_PROTOCOLLNPAIR(" slot=", slot); - SERIAL_EOL(); - #endif - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); - - // Write crc to MAT along with other data, or just tack on to the beginning or end - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot); - #endif - - #else - - // Other mesh types - - #endif - } - - void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=NULL*/) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - const int16_t a = settings.calc_num_meshes(); - - if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - #endif - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; - read_data(pos, dest, sizeof(ubl.z_values), &crc); - - // Compare crc with crc from MAT, or read from end - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot); - #endif - - #else - - // Other mesh types - - #endif - } - - //void MarlinSettings::delete_mesh() { return; } - //void MarlinSettings::defrag_meshes() { return; } - - #endif // AUTO_BED_LEVELING_UBL - -#else // !EEPROM_SETTINGS - - bool MarlinSettings::save() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("EEPROM disabled"); - return false; - } - -#endif // !EEPROM_SETTINGS - -/** - * 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.axis_steps_per_mm[i] = pgm_read_float(&tmp1[i < COUNT(tmp1) ? i : COUNT(tmp1) - 1]); - planner.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[i < COUNT(tmp2) ? i : COUNT(tmp2) - 1]); - planner.max_acceleration_mm_per_s2[i] = pgm_read_dword_near(&tmp3[i < COUNT(tmp3) ? i : COUNT(tmp3) - 1]); - } - - planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME; - planner.acceleration = DEFAULT_ACCELERATION; - planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; - planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; - planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; - planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; - - #if ENABLED(JUNCTION_DEVIATION) - planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); - #else - planner.max_jerk[X_AXIS] = DEFAULT_XJERK; - planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; - planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; - planner.max_jerk[E_AXIS] = DEFAULT_EJERK; - #endif - - #if HAS_HOME_OFFSET - ZERO(home_offset); - #endif - - #if HOTENDS > 1 - constexpr float tmp4[XYZ][HOTENDS] = { - HOTEND_OFFSET_X, - HOTEND_OFFSET_Y - #if HAS_HOTEND_OFFSET_Z - , HOTEND_OFFSET_Z - #else - , { 0 } - #endif - }; - static_assert( - tmp4[X_AXIS][0] == 0 && tmp4[Y_AXIS][0] == 0 && tmp4[Z_AXIS][0] == 0, - "Offsets for the first hotend must be 0.0." - ); - LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e]; - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - new_z_fade_height = 0.0; - #endif - - #if HAS_LEVELING - reset_bed_level(); - #endif - - #if HAS_BED_PROBE - zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; - #endif - - #if ENABLED(DELTA) - const float adj[ABC] = DELTA_ENDSTOP_ADJ, - dta[ABC] = DELTA_TOWER_ANGLE_TRIM; - delta_height = DELTA_HEIGHT; - COPY(delta_endstop_adj, adj); - delta_radius = DELTA_RADIUS; - delta_diagonal_rod = DELTA_DIAGONAL_ROD; - delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - delta_calibration_radius = DELTA_CALIBRATION_RADIUS; - COPY(delta_tower_angle_trim, dta); - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - #if ENABLED(X_DUAL_ENDSTOPS) - endstops.x_endstop_adj = ( - #ifdef X_DUAL_ENDSTOPS_ADJUSTMENT - X_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - endstops.y_endstop_adj = ( - #ifdef Y_DUAL_ENDSTOPS_ADJUSTMENT - Y_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - endstops.z_endstop_adj = ( - #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT - Z_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - - #endif - - #if ENABLED(ULTIPANEL) - lcd_preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; - lcd_preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; - lcd_preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; - lcd_preheat_bed_temp[1] = PREHEAT_2_TEMP_BED; - lcd_preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED; - lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED; - #endif - - #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - HOTEND_LOOP() - #endif - { - PID_PARAM(Kp, e) = float(DEFAULT_Kp); - PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki); - PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd); - #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = DEFAULT_Kc; - #endif - } - #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // default last-position-queue size - #endif - #endif // PIDTEMP - - #if ENABLED(PIDTEMPBED) - thermalManager.bedKp = DEFAULT_bedKp; - thermalManager.bedKi = scalePID_i(DEFAULT_bedKi); - thermalManager.bedKd = scalePID_d(DEFAULT_bedKd); - #endif - - #if HAS_LCD_CONTRAST - lcd_contrast = DEFAULT_LCD_CONTRAST; - #endif - - #if ENABLED(FWRETRACT) - fwretract.reset(); - #endif - - #if DISABLED(NO_VOLUMETRICS) - - parser.volumetric_enabled = - #if ENABLED(VOLUMETRIC_DEFAULT_ON) - true - #else - false - #endif - ; - for (uint8_t q = 0; q < COUNT(planner.filament_size); q++) - planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; - - #endif - - endstops.enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - - reset_stepper_drivers(); - - #if ENABLED(LIN_ADVANCE) - planner.extruder_advance_K = LIN_ADVANCE_K; - #endif - - #if HAS_MOTOR_CURRENT_PWM - uint32_t tmp_motor_current_setting[XYZ] = PWM_MOTOR_CURRENT; - for (uint8_t q = XYZ; q--;) - stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - planner.xy_skew_factor = XY_SKEW_FACTOR; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - planner.xz_skew_factor = XZ_SKEW_FACTOR; - planner.yz_skew_factor = YZ_SKEW_FACTOR; - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - filament_change_unload_length[e] = FILAMENT_CHANGE_UNLOAD_LENGTH; - filament_change_load_length[e] = FILAMENT_CHANGE_FAST_LOAD_LENGTH; - } - #endif - - postprocess(); - - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); - #endif -} - -#if DISABLED(DISABLE_M503) - - #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START(); }while(0) - - #if HAS_TRINAMIC - void say_M906() { SERIAL_ECHOPGM(" M906"); } - #if ENABLED(HYBRID_THRESHOLD) - void say_M913() { SERIAL_ECHOPGM(" M913"); } - #endif - #if ENABLED(SENSORLESS_HOMING) - void say_M914() { SERIAL_ECHOPGM(" M914"); } - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - void say_M603() { SERIAL_ECHOPGM(" M603 "); } - #endif - - inline void say_units(const bool colon=false) { - serialprintPGM( - #if ENABLED(INCH_MODE_SUPPORT) - parser.linear_unit_factor != 1.0 ? PSTR(" (in)") : - #endif - PSTR(" (mm)") - ); - if (colon) SERIAL_ECHOLNPGM(":"); - } - - /** - * M503 - Report current settings in RAM - * - * Unless specifically disabled, M503 is available even without EEPROM - */ - void MarlinSettings::report(const bool forReplay) { - - /** - * Announce current units, in case inches are being displayed - */ - CONFIG_ECHO_START; - #if ENABLED(INCH_MODE_SUPPORT) - #define LINEAR_UNIT(N) (float(N) / parser.linear_unit_factor) - #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor)) - SERIAL_ECHOPGM(" G2"); - SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0'); - SERIAL_ECHOPGM(" ;"); - say_units(); - #else - #define LINEAR_UNIT(N) (N) - #define VOLUMETRIC_UNIT(N) (N) - SERIAL_ECHOPGM(" G21 ;"); - say_units(); - #endif - SERIAL_EOL(); - - #if ENABLED(ULTIPANEL) - - // Temperature units - for Ultipanel temperature options - - CONFIG_ECHO_START; - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - #define TEMP_UNIT(N) parser.to_temp_units(N) - SERIAL_ECHOPGM(" M149 "); - SERIAL_CHAR(parser.temp_units_code()); - SERIAL_ECHOPGM(" ; Units in "); - serialprintPGM(parser.temp_units_name()); - #else - #define TEMP_UNIT(N) (N) - SERIAL_ECHOLNPGM(" M149 C ; Units in Celsius"); - #endif - - #endif - - SERIAL_EOL(); - - #if DISABLED(NO_VOLUMETRICS) - - /** - * Volumetric extrusion M200 - */ - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Filament settings:"); - if (parser.volumetric_enabled) - SERIAL_EOL(); - else - SERIAL_ECHOLNPGM(" Disabled"); - } - - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 D", LINEAR_UNIT(planner.filament_size[0])); - SERIAL_EOL(); - #if EXTRUDERS > 1 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T1 D", LINEAR_UNIT(planner.filament_size[1])); - SERIAL_EOL(); - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T2 D", LINEAR_UNIT(planner.filament_size[2])); - SERIAL_EOL(); - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T3 D", LINEAR_UNIT(planner.filament_size[3])); - SERIAL_EOL(); - #if EXTRUDERS > 4 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T4 D", LINEAR_UNIT(planner.filament_size[4])); - SERIAL_EOL(); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - if (!parser.volumetric_enabled) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM(" M200 D0"); - } - - #endif // !NO_VOLUMETRICS - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Steps per unit:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.axis_steps_per_mm[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.axis_steps_per_mm[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.axis_steps_per_mm[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M92 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Maximum feedrates (units/s):"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M203 X", LINEAR_UNIT(planner.max_feedrate_mm_s[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_feedrate_mm_s[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_feedrate_mm_s[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M203 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Maximum Acceleration (units/s2):"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M201 X", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS])); - #endif - SERIAL_EOL(); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOPAIR(" M201 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS + i])); - } - #endif - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Acceleration (units/s2): P R T"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M204 P", LINEAR_UNIT(planner.acceleration)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(planner.retract_acceleration)); - SERIAL_ECHOLNPAIR(" T", LINEAR_UNIT(planner.travel_acceleration)); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Advanced: B S T"); - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPGM(" J"); - #else - SERIAL_ECHOPGM(" X Y Z"); - #endif - #if DISABLED(JUNCTION_DEVIATION) || ENABLED(LIN_ADVANCE) - SERIAL_ECHOPGM(" E"); - #endif - SERIAL_EOL(); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M205 B", LINEAR_UNIT(planner.min_segment_time_us)); - SERIAL_ECHOPAIR(" S", LINEAR_UNIT(planner.min_feedrate_mm_s)); - SERIAL_ECHOPAIR(" T", LINEAR_UNIT(planner.min_travel_feedrate_mm_s)); - - #if ENABLED(JUNCTION_DEVIATION) - SERIAL_ECHOPAIR(" J", LINEAR_UNIT(planner.junction_deviation_mm)); - #else - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS])); - SERIAL_ECHOPAIR(" E", LINEAR_UNIT(planner.max_jerk[E_AXIS])); - #endif - - SERIAL_EOL(); - - #if HAS_M206_COMMAND - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Home offset:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M206 X", LINEAR_UNIT(home_offset[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(home_offset[Y_AXIS])); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(home_offset[Z_AXIS])); - #endif - - #if HOTENDS > 1 - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hotend offsets:"); - } - CONFIG_ECHO_START; - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR(" M218 T", (int)e); - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(hotend_offset[X_AXIS][e])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e])); - #if HAS_HOTEND_OFFSET_Z - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e])); - #endif - SERIAL_EOL(); - } - #endif - - /** - * Bed Leveling - */ - #if HAS_LEVELING - - #if ENABLED(MESH_BED_LEVELING) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Mesh Bed Leveling:"); - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - CONFIG_ECHO_START; - ubl.echo_name(); - SERIAL_ECHOLNPGM(":"); - } - - #elif HAS_ABL - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Auto Bed Leveling:"); - } - - #endif - - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M420 S", planner.leveling_active ? 1 : 0); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.z_fade_height)); - #endif - SERIAL_EOL(); - - #if ENABLED(MESH_BED_LEVELING) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 S3 X", (int)px + 1); - SERIAL_ECHOPAIR(" Y", (int)py + 1); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(mbl.z_values[px][py]), 5); - SERIAL_EOL(); - } - } - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - SERIAL_EOL(); - ubl.report_state(); - SERIAL_ECHOLNPAIR("\nActive Mesh Slot: ", ubl.storage_slot); - SERIAL_ECHOPAIR("EEPROM can hold ", calc_num_meshes()); - SERIAL_ECHOLNPGM(" meshes.\n"); - } - - //ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large mesh's. A better (more terse) - // solution needs to be found. - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" G29 W I", (int)px); - SERIAL_ECHOPAIR(" J", (int)py); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(LINEAR_UNIT(z_values[px][py]), 5); - SERIAL_EOL(); - } - } - } - - #endif - - #endif // HAS_LEVELING - - #if ENABLED(DELTA) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Endstop adjustment:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS])); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS])); - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Delta settings: L R H S B XYZ"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M665 L", LINEAR_UNIT(delta_diagonal_rod)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius)); - SERIAL_ECHOPAIR(" H", LINEAR_UNIT(delta_height)); - SERIAL_ECHOPAIR(" S", delta_segments_per_second); - SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius)); - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS])); - SERIAL_EOL(); - - #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Endstop adjustment:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPGM(" M666"); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(endstops.x_endstop_adj)); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstops.y_endstop_adj)); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(endstops.z_endstop_adj)); - #endif - SERIAL_EOL(); - - #endif // [XYZ]_DUAL_ENDSTOPS - - #if ENABLED(ULTIPANEL) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Material heatup parameters:"); - } - for (uint8_t i = 0; i < COUNT(lcd_preheat_hotend_temp); i++) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M145 S", (int)i); - SERIAL_ECHOPAIR(" H", TEMP_UNIT(lcd_preheat_hotend_temp[i])); - SERIAL_ECHOPAIR(" B", TEMP_UNIT(lcd_preheat_bed_temp[i])); - SERIAL_ECHOLNPAIR(" F", lcd_preheat_fan_speed[i]); - } - #endif // ULTIPANEL - - #if HAS_PID_HEATING - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("PID settings:"); - } - #if ENABLED(PIDTEMP) - #if HOTENDS > 1 - if (forReplay) { - HOTEND_LOOP() { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M301 E", e); - 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))); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); - if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); - #endif - SERIAL_EOL(); - } - } - else - #endif // HOTENDS > 1 - // !forReplay || HOTENDS == 1 - { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0 - SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); - SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0)); - SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); - #endif - SERIAL_EOL(); - } - #endif // PIDTEMP - - #if ENABLED(PIDTEMPBED) - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M304 P", thermalManager.bedKp); - SERIAL_ECHOPAIR(" I", unscalePID_i(thermalManager.bedKi)); - SERIAL_ECHOPAIR(" D", unscalePID_d(thermalManager.bedKd)); - SERIAL_EOL(); - #endif - - #endif // PIDTEMP || PIDTEMPBED - - #if HAS_LCD_CONTRAST - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("LCD Contrast:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M250 C", lcd_contrast); - #endif - - #if ENABLED(FWRETRACT) - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Retract: S F Z"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M207 S", LINEAR_UNIT(fwretract.retract_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_length)); - SERIAL_ECHOPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_feedrate_mm_s))); - SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(fwretract.retract_zlift)); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Recover: S F"); - } - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M208 S", LINEAR_UNIT(fwretract.retract_recover_length)); - SERIAL_ECHOPAIR(" W", LINEAR_UNIT(fwretract.swap_retract_recover_length)); - SERIAL_ECHOLNPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(fwretract.retract_recover_feedrate_mm_s))); - - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M209 S", fwretract.autoretract_enabled ? 1 : 0); - - #endif // FWRETRACT - - /** - * Probe Offset - */ - #if HAS_BED_PROBE - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM("Z-Probe Offset"); - say_units(true); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M851 Z", LINEAR_UNIT(zprobe_zoffset)); - #endif - - /** - * Bed Skew Correction - */ - #if ENABLED(SKEW_CORRECTION_GCODE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Skew Factor: "); - } - CONFIG_ECHO_START; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPGM(" M852 I"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_ECHOPGM(" J"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6); - SERIAL_ECHOPGM(" K"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6); - SERIAL_EOL(); - #else - SERIAL_ECHOPGM(" M852 S"); - SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_EOL(); - #endif - #endif - - #if HAS_TRINAMIC - - /** - * TMC2130 / TMC2208 stepper driver current - */ - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Stepper driver current:"); - } - CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M906(); - #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", stepperX.getCurrent()); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", stepperY.getCurrent()); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", stepperZ.getCurrent()); - #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M906(); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", stepperX2.getCurrent()); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", stepperY2.getCurrent()); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", stepperZ2.getCurrent()); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(E0) - say_M906(); - SERIAL_ECHOLNPAIR(" T0 E", stepperE0.getCurrent()); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M906(); - SERIAL_ECHOLNPAIR(" T1 E", stepperE1.getCurrent()); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M906(); - SERIAL_ECHOLNPAIR(" T2 E", stepperE2.getCurrent()); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M906(); - SERIAL_ECHOLNPAIR(" T3 E", stepperE3.getCurrent()); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M906(); - SERIAL_ECHOLNPAIR(" T4 E", stepperE4.getCurrent()); - #endif - SERIAL_EOL(); - - /** - * TMC2130 / TMC2208 / TRAMS Hybrid Threshold - */ - #if ENABLED(HYBRID_THRESHOLD) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Hybrid Threshold:"); - } - CONFIG_ECHO_START; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M913(); - #endif - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X)); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y)); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z)); - #endif - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M913(); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR(" X", TMC_GET_PWMTHRS(X, X2)); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR(" Y", TMC_GET_PWMTHRS(Y, Y2)); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR(" Z", TMC_GET_PWMTHRS(Z, Z2)); - #endif - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - SERIAL_EOL(); - #endif - #if AXIS_IS_TMC(E0) - say_M913(); - SERIAL_ECHOLNPAIR(" T0 E", TMC_GET_PWMTHRS(E, E0)); - #endif - #if E_STEPPERS > 1 && AXIS_IS_TMC(E1) - say_M913(); - SERIAL_ECHOLNPAIR(" T1 E", TMC_GET_PWMTHRS(E, E1)); - #endif - #if E_STEPPERS > 2 && AXIS_IS_TMC(E2) - say_M913(); - SERIAL_ECHOLNPAIR(" T2 E", TMC_GET_PWMTHRS(E, E2)); - #endif - #if E_STEPPERS > 3 && AXIS_IS_TMC(E3) - say_M913(); - SERIAL_ECHOLNPAIR(" T3 E", TMC_GET_PWMTHRS(E, E3)); - #endif - #if E_STEPPERS > 4 && AXIS_IS_TMC(E4) - say_M913(); - SERIAL_ECHOLNPAIR(" T4 E", TMC_GET_PWMTHRS(E, E4)); - #endif - SERIAL_EOL(); - #endif // HYBRID_THRESHOLD - - /** - * TMC2130 Sensorless homing thresholds - */ - #if ENABLED(SENSORLESS_HOMING) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Sensorless homing threshold:"); - } - CONFIG_ECHO_START; - #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS - say_M914(); - #if X_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX.sgt()); - #endif - #if Y_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY.sgt()); - #endif - #if Z_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ.sgt()); - #endif - SERIAL_EOL(); - #endif - - #define X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)) - #define Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)) - #define Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) - #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS - say_M914(); - SERIAL_ECHOPGM(" I1"); - #if X2_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX2.sgt()); - #endif - #if Y2_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY2.sgt()); - #endif - #if Z2_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ2.sgt()); - #endif - SERIAL_EOL(); - #endif - - #endif // SENSORLESS_HOMING - - #endif // HAS_TRINAMIC - - /** - * Linear Advance - */ - #if ENABLED(LIN_ADVANCE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Linear Advance:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K); - #endif - - #if HAS_MOTOR_CURRENT_PWM - CONFIG_ECHO_START; - if (!forReplay) { - SERIAL_ECHOLNPGM("Stepper motor currents:"); - CONFIG_ECHO_START; - } - SERIAL_ECHOPAIR(" M907 X", stepper.motor_current_setting[0]); - SERIAL_ECHOPAIR(" Z", stepper.motor_current_setting[1]); - SERIAL_ECHOPAIR(" E", stepper.motor_current_setting[2]); - SERIAL_EOL(); - #endif - - /** - * Advanced Pause filament load & unload lengths - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Filament load/unload lengths:"); - } - CONFIG_ECHO_START; - #if EXTRUDERS == 1 - say_M603(); - SERIAL_ECHOPAIR("L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - #else - say_M603(); - SERIAL_ECHOPAIR("T0 L", LINEAR_UNIT(filament_change_load_length[0])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[0])); - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T1 L", LINEAR_UNIT(filament_change_load_length[1])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[1])); - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T2 L", LINEAR_UNIT(filament_change_load_length[2])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[2])); - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T3 L", LINEAR_UNIT(filament_change_load_length[3])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[3])); - #if EXTRUDERS > 4 - CONFIG_ECHO_START; - say_M603(); - SERIAL_ECHOPAIR("T4 L", LINEAR_UNIT(filament_change_load_length[4])); - SERIAL_ECHOLNPAIR(" U", LINEAR_UNIT(filament_change_unload_length[4])); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS == 1 - #endif // ADVANCED_PAUSE_FEATURE - } - -#endif // !DISABLE_M503 diff --git a/Marlin_thinkerV2/Marlin/configuration_store.h b/Marlin_thinkerV2/Marlin/configuration_store.h deleted file mode 100644 index c191c89f2f..0000000000 --- a/Marlin_thinkerV2/Marlin/configuration_store.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef CONFIGURATION_STORE_H -#define CONFIGURATION_STORE_H - -#include "MarlinConfig.h" - -class MarlinSettings { - public: - MarlinSettings() { } - - static uint16_t datasize(); - - static void reset(); - static bool save(); // Return 'true' if data was saved -#if POWER_LOSS_RECOVER_SUPER_CAP - static bool power_lose_save(); - static bool power_lose_load(); -#endif - FORCE_INLINE static bool init_eeprom() { - reset(); - #if ENABLED(EEPROM_SETTINGS) - const bool success = save(); - #if ENABLED(EEPROM_CHITCHAT) - if (success) report(); - #endif - return success; - #else - return true; - #endif - } - - #if ENABLED(EEPROM_SETTINGS) - static bool load(); // Return 'true' if data was loaded ok - static bool validate(); // Return 'true' if EEPROM data is ok - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static uint16_t meshes_start_index(); - FORCE_INLINE static uint16_t meshes_end_index() { return meshes_end; } - static uint16_t calc_num_meshes(); - static int mesh_slot_offset(const int8_t slot); - static void store_mesh(const int8_t slot); - static void load_mesh(const int8_t slot, void * const into=NULL); - - //static void delete_mesh(); // necessary if we have a MAT - //static void defrag_meshes(); // " - #endif - #else - FORCE_INLINE - static bool load() { reset(); report(); return true; } - #endif - - #if DISABLED(DISABLE_M503) - static void report(const bool forReplay=false); - #else - FORCE_INLINE - static void report(const bool forReplay=false) { UNUSED(forReplay); } - #endif - - private: - static void postprocess(); - - #if ENABLED(EEPROM_SETTINGS) - - static bool eeprom_error, validating; - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static constexpr uint16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom - - #endif - - static bool _load(); - static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc); - static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc, const bool force=false); - static bool size_error(const uint16_t size); - #endif -}; - -extern MarlinSettings settings; - -#endif // CONFIGURATION_STORE_H diff --git a/Marlin_thinkerV2/Marlin/dac_mcp4728.cpp b/Marlin_thinkerV2/Marlin/dac_mcp4728.cpp deleted file mode 100644 index 783f9fb5e0..0000000000 --- a/Marlin_thinkerV2/Marlin/dac_mcp4728.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * mcp4728.cpp - Arduino library for MicroChip MCP4728 I2C D/A converter - * - * For implementation details, please take a look at the datasheet: - * http://ww1.microchip.com/downloads/en/DeviceDoc/22187a.pdf - * - * For discussion and feedback, please go to: - * http://arduino.cc/forum/index.php/topic,51842.0.html - */ - -#include "MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - -#include "dac_mcp4728.h" -#include "enum.h" - -uint16_t mcp4728_values[XYZE]; - -/** - * Begin I2C, get current values (input register and eeprom) of mcp4728 - */ -void mcp4728_init() { - Wire.begin(); - Wire.requestFrom(int(DAC_DEV_ADDRESS), 24); - while (Wire.available()) { - char deviceID = Wire.read(), - hiByte = Wire.read(), - loByte = Wire.read(); - - if (!(deviceID & 0x08)) - mcp4728_values[(deviceID & 0x30) >> 4] = word((hiByte & 0x0F), loByte); - } -} - -/** - * Write input resister value to specified channel using fastwrite method. - * Channel : 0-3, Values : 0-4095 - */ -uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value) { - mcp4728_values[channel] = value; - return mcp4728_fastWrite(); -} - -/** - * Write all input resistor values to EEPROM using SequencialWrite method. - * This will update both input register and EEPROM value - * This will also write current Vref, PowerDown, Gain settings to EEPROM - */ -uint8_t mcp4728_eepromWrite() { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(SEQWRITE); - LOOP_XYZE(i) { - Wire.write(DAC_STEPPER_VREF << 7 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Write Voltage reference setting to all input regiters - */ -uint8_t mcp4728_setVref_all(uint8_t value) { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(VREFWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} -/** - * Write Gain setting to all input regiters - */ -uint8_t mcp4728_setGain_all(uint8_t value) { - Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.write(GAINWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} - -/** - * Return Input Register value - */ -uint16_t mcp4728_getValue(uint8_t channel) { return mcp4728_values[channel]; } - -/** - * Steph: Might be useful in the future - * Return Vout - * -uint16_t mcp4728_getVout(uint8_t channel) { - uint32_t vref = 2048, - vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; - if (vOut > defaultVDD) vOut = defaultVDD; - return vOut; -} -*/ - -/** - * Returns DAC values as a 0-100 percentage of drive strength - */ -uint8_t mcp4728_getDrvPct(uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); } - -/** - * Receives all Drive strengths as 0-100 percent values, updates - * DAC Values array and calls fastwrite to update the DAC. - */ -void mcp4728_setDrvPct(uint8_t pct[XYZE]) { - LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX); - mcp4728_fastWrite(); -} - -/** - * FastWrite input register values - All DAC ouput update. refer to DATASHEET 5.6.1 - * DAC Input and PowerDown bits update. - * No EEPROM update - */ -uint8_t mcp4728_fastWrite() { - Wire.beginTransmission(DAC_DEV_ADDRESS); - LOOP_XYZE(i) { - Wire.write(highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Common function for simple general commands - */ -uint8_t mcp4728_simpleCommand(byte simpleCommand) { - Wire.beginTransmission(GENERALCALL); - Wire.write(simpleCommand); - return Wire.endTransmission(); -} - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin_thinkerV2/Marlin/dac_mcp4728.h b/Marlin_thinkerV2/Marlin/dac_mcp4728.h deleted file mode 100644 index f8337316de..0000000000 --- a/Marlin_thinkerV2/Marlin/dac_mcp4728.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino library for MicroChip MCP4728 I2C D/A converter. - */ - -#ifndef DAC_MCP4728_H -#define DAC_MCP4728_H - -#include "MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) -#include "Wire.h" - -#define defaultVDD DAC_STEPPER_MAX //was 5000 but differs with internal Vref -#define BASE_ADDR 0x60 -#define RESET 0B00000110 -#define WAKE 0B00001001 -#define UPDATE 0B00001000 -#define MULTIWRITE 0B01000000 -#define SINGLEWRITE 0B01011000 -#define SEQWRITE 0B01010000 -#define VREFWRITE 0B10000000 -#define GAINWRITE 0B11000000 -#define POWERDOWNWRITE 0B10100000 -#define GENERALCALL 0B00000000 -#define GAINWRITE 0B11000000 - -// This is taken from the original lib, makes it easy to edit if needed -// DAC_OR_ADDRESS defined in pins_BOARD.h file -#define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS) - - -void mcp4728_init(); -uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value); -uint8_t mcp4728_eepromWrite(); -uint8_t mcp4728_setVref_all(uint8_t value); -uint8_t mcp4728_setGain_all(uint8_t value); -uint16_t mcp4728_getValue(uint8_t channel); -uint8_t mcp4728_fastWrite(); -uint8_t mcp4728_simpleCommand(byte simpleCommand); -uint8_t mcp4728_getDrvPct(uint8_t channel); -void mcp4728_setDrvPct(uint8_t pct[XYZE]); - -#endif -#endif // DAC_MCP4728_H diff --git a/Marlin_thinkerV2/Marlin/delay.h b/Marlin_thinkerV2/Marlin/delay.h deleted file mode 100644 index 5689b2b4c1..0000000000 --- a/Marlin_thinkerV2/Marlin/delay.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AVR busy wait delay Cycles routines: - * - * DELAY_CYCLES(count): Delay execution in cycles - * DELAY_NS(count): Delay execution in nanoseconds - * DELAY_US(count): Delay execution in microseconds - */ - -#ifndef MARLIN_DELAY_H -#define MARLIN_DELAY_H - -#define nop() __asm__ __volatile__("nop;\n\t":::) - -FORCE_INLINE static void __delay_4cycles(uint8_t cy) { - __asm__ __volatile__( - L("1") - A("dec %[cnt]") - A("nop") - A("brne 1b") - : [cnt] "+r"(cy) // output: +r means input+output - : // input: - : "cc" // clobbers: - ); -} - -/* ---------------- Delay in cycles */ -FORCE_INLINE static void DELAY_CYCLES(uint16_t x) { - - if (__builtin_constant_p(x)) { - #define MAXNOPS 4 - - if (x <= (MAXNOPS)) { - switch (x) { case 4: nop(); case 3: nop(); case 2: nop(); case 1: nop(); } - } - else { - const uint32_t rem = (x) % (MAXNOPS); - switch (rem) { case 3: nop(); case 2: nop(); case 1: nop(); } - if ((x = (x) / (MAXNOPS))) - __delay_4cycles(x); // if need more then 4 nop loop is more optimal - } - - #undef MAXNOPS - } - else - __delay_4cycles(x / 4); -} -#undef nop - -/* ---------------- Delay in nanoseconds */ -#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) / 1000L ) - -/* ---------------- Delay in microseconds */ -#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) ) - -#endif // MARLIN_DELAY_H diff --git a/Marlin_thinkerV2/Marlin/digipot_mcp4018.cpp b/Marlin_thinkerV2/Marlin/digipot_mcp4018.cpp deleted file mode 100644 index 5871fdb99c..0000000000 --- a/Marlin_thinkerV2/Marlin/digipot_mcp4018.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(DIGIPOT_I2C) && ENABLED(DIGIPOT_MCP4018) - -#include "enum.h" -#include "Stream.h" -#include "utility/twi.h" -#include //https://github.com/stawel/SlowSoftI2CMaster - -// Settings for the I2C based DIGIPOT (MCP4018) based on WT150 - -#define DIGIPOT_I2C_ADDRESS 0x2F - -#define DIGIPOT_A4988_Rsx 0.250 -#define DIGIPOT_A4988_Vrefmax 1.666 -#define DIGIPOT_A4988_MAX_VALUE 127 - -#define DIGIPOT_A4988_Itripmax(Vref) ((Vref)/(8.0*DIGIPOT_A4988_Rsx)) - -#define DIGIPOT_A4988_FACTOR ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax)) -#define DIGIPOT_A4988_MAX_CURRENT 2.0 - -static byte current_to_wiper(const float current) { - const int16_t value = ceil(float(DIGIPOT_A4988_FACTOR) * current); - return byte(constrain(value, 0, DIGIPOT_A4988_MAX_VALUE)); -} - -const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = { - DIGIPOTS_I2C_SDA_X - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , DIGIPOTS_I2C_SDA_Y - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , DIGIPOTS_I2C_SDA_Z - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , DIGIPOTS_I2C_SDA_E0 - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , DIGIPOTS_I2C_SDA_E1 - #endif - #endif - #endif - #endif -}; - -static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { - SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL } - #endif - #endif - #endif - #endif -}; - -static void i2c_send(const uint8_t channel, const byte v) { - if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) { - pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS) << 1) | I2C_WRITE); - pots[channel].i2c_write(v); - pots[channel].i2c_stop(); - } -} - -// This is for the MCP4018 I2C based digipot -void digipot_i2c_set_current(uint8_t channel, float current) { - i2c_send(channel, current_to_wiper(MIN(MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT)))); -} - -void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - - for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++) - pots[i].i2c_init(); - - // setup initial currents as defined in Configuration_adv.h - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C && DIGIPOT_MCP4018 diff --git a/Marlin_thinkerV2/Marlin/digipot_mcp4451.cpp b/Marlin_thinkerV2/Marlin/digipot_mcp4451.cpp deleted file mode 100644 index fed84b2645..0000000000 --- a/Marlin_thinkerV2/Marlin/digipot_mcp4451.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018) - -#include "Stream.h" -#include "utility/twi.h" -#include "Wire.h" - -// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro -#if MB(5DPRINT) - #define DIGIPOT_I2C_FACTOR 117.96 - #define DIGIPOT_I2C_MAX_CURRENT 1.736 -#else - #define DIGIPOT_I2C_FACTOR 106.7 - #define DIGIPOT_I2C_MAX_CURRENT 2.5 -#endif - -static byte current_to_wiper(const float current) { - return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current)))); -} - -static void i2c_send(const byte addr, const byte a, const byte b) { - Wire.beginTransmission(addr); - Wire.write(a); - Wire.write(b); - Wire.endTransmission(); -} - -// This is for the MCP4451 I2C based digipot -void digipot_i2c_set_current(uint8_t channel, float current) { - current = MIN((float) MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT); - // these addresses are specific to Azteeg X3 Pro, can be set to others, - // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 - byte addr = 0x2C; // channel 0-3 - if (channel >= 4) { - addr = 0x2E; // channel 4-7 - channel -= 4; - } - - // Initial setup - i2c_send(addr, 0x40, 0xFF); - i2c_send(addr, 0xA0, 0xFF); - - // Set actual wiper value - byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; - i2c_send(addr, addresses[channel], current_to_wiper(current)); -} - -void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - Wire.begin(); - // setup initial currents as defined in Configuration_adv.h - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C diff --git a/Marlin_thinkerV2/Marlin/dogm_bitmaps.h b/Marlin_thinkerV2/Marlin/dogm_bitmaps.h deleted file mode 100644 index 12e6499f93..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_bitmaps.h +++ /dev/null @@ -1,1217 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Standard Marlin Boot and Status Screen bitmaps - * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html - */ - -#include "MarlinConfig.h" - - -#if ENABLED(SHOW_BOOTSCREEN) - - //#define START_BMPHIGH // Costs 399 bytes more flash - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - #include "_Bootscreen.h" -#define CUSTOM_BOOTSCREEN_TIMEOUT 25000 - - #ifndef CUSTOM_BOOTSCREEN_TIMEOUT - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #endif - - #endif - - #if ENABLED(START_BMPHIGH) - - #define START_BMPWIDTH 112 - - const unsigned char start_bmp[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - #else - - #define START_BMPWIDTH 128//56 - - - const unsigned char start_bmp[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x03, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xC3, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0xE1, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x03, 0xF0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x07, 0xF8, 0x1F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0xF8, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x1F, 0xF0, 0x03, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3F, 0xE0, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x80, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x00, 0x20, 0x07, 0x83, 0xFF, 0x87, 0xFF, 0x10, 0x00, 0x81, 0xC0, 0x60, 0x0C, 0x7F, 0xF8, -0x7C, 0x00, 0x70, 0x0F, 0x87, 0xFF, 0xCF, 0xFF, 0x98, 0x01, 0x87, 0xF0, 0x70, 0x0C, 0xFF, 0xFC, -0x7C, 0x01, 0xFE, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x9C, 0x03, 0x8E, 0x38, 0x78, 0x0C, 0x00, 0x00, -0x7C, 0x07, 0xFC, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x8E, 0x07, 0x1C, 0x1C, 0x7C, 0x0C, 0x00, 0x00, -0x7C, 0x01, 0xF0, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x87, 0x0E, 0x18, 0x0C, 0x6E, 0x0C, 0x00, 0x00, -0x7C, 0x00, 0xE0, 0x0F, 0x83, 0xFF, 0x8F, 0xFF, 0x83, 0xFC, 0x30, 0x06, 0x66, 0x0C, 0x7F, 0xF8, -0x7C, 0x00, 0x00, 0x0F, 0x87, 0xFF, 0xCF, 0xFF, 0x01, 0xF8, 0x30, 0x06, 0x60, 0x0C, 0xFF, 0xFC, -0x7C, 0x00, 0x80, 0x0F, 0x80, 0x00, 0x0C, 0x03, 0x00, 0x60, 0x30, 0x06, 0x60, 0xCC, 0x00, 0x00, -0x7C, 0x01, 0xF0, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x18, 0x0C, 0x60, 0xEC, 0x00, 0x00, -0x7C, 0x03, 0xFC, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x1C, 0x1C, 0x60, 0x7C, 0x00, 0x00, -0x7C, 0x0F, 0xF8, 0x0F, 0x80, 0x00, 0x0C, 0x01, 0x80, 0x60, 0x0E, 0x38, 0x60, 0x3C, 0x00, 0x00, -0x7C, 0x03, 0xE0, 0x0F, 0x83, 0xFF, 0x8C, 0x01, 0x80, 0x60, 0x07, 0xF0, 0x60, 0x1C, 0x7F, 0xF8, -0x7E, 0x01, 0xC0, 0x0F, 0x87, 0xFF, 0xCC, 0x01, 0x80, 0x60, 0x01, 0xC0, 0x60, 0x0C, 0xFF, 0xFC, -0x7F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xC0, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7F, 0xF0, 0x00, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3F, 0xFC, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0xFF, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x03, 0xFF, 0x9F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0x9F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x3F, 0x9F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x1F, 0x9F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - }; - - #endif - - #ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) - #endif - #ifndef START_BMPHEIGHT - #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) - #endif - - static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); - -#endif - -#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) - - // This file must define STATUS_SCREENWIDTH and status_screen[012]_bmp. - // It can also define STATUS_SCREEN_X, STATUS_SCREEN_{BED,FAN}_TEXT_X and - // STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations. - #include "_Statusscreen.h" - -#else // !CUSTOM_STATUS_SCREEN_IMAGE - - // Can also be overridden in Configuration.h - // If you can afford it, try the 3-frame fan animation! - #ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 - #endif - - #if HAS_HEATED_BED - - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 64)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 64)) - - #if HOTENDS == 0 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #else // !HAS_HEATED_BED - - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 96)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 96)) - - #if HOTENDS == 0 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 1 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #elif HOTENDS == 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #else // HOTENDS > 2 - - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif - - #endif // HOTENDS - - #endif // !HAS_HEATED_BED - -#endif // !CUSTOM_STATUS_SCREEN_IMAGE - -#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - const unsigned char cw_bmp[] PROGMEM = { - B00000011,B11111000,B00000000, - B00001111,B11111110,B00000000, - B00011110,B00001111,B00000000, - B00111000,B00000111,B00000000, - B00111000,B00000011,B10000000, - B01110000,B00000011,B10000000, - B01110000,B00001111,B11100000, - B01110000,B00000111,B11000000, - B01110000,B00000011,B10000000, - B01110000,B00000001,B00000000, - B01110000,B00000000,B00000000, - B00111000,B00000000,B00000000, - B00111000,B00000111,B00000000, - B00011110,B00001111,B00000000, - B00001111,B11111110,B00000000, - B00000011,B11111000,B00000000 - }; - - const unsigned char ccw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B10000011,B11000000, - B00001110,B00000001,B11000000, - B00001110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00111110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00001000,B00000000,B11100000, - B00000000,B00000000,B11100000, - B00000000,B00000001,B11000000, - B00001110,B00000001,B11000000, - B00001111,B00000111,B10000000, - B00000111,B11111111,B00000000, - B00000001,B11111100,B00000000 - }; - - const unsigned char up_arrow_bmp[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00011111,B00000000, - B00111111,B10000000, - B01111111,B11000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000 - }; - - const unsigned char down_arrow_bmp[] PROGMEM = { - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B00111111,B10000000, - B00011111,B00000000, - B00001110,B00000000, - B00000100,B00000000 - }; - - const unsigned char offset_bedline_bmp[] PROGMEM = { - B11111111,B11111111,B11111111 - }; - - const unsigned char nozzle_bmp[] PROGMEM = { - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B01111111,B10000000, - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B00111111,B00000000, - B00011110,B00000000, - B00001100,B00000000 - }; - -#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - -#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) -#endif -#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT - #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) -#endif - -#ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 -#elif FAN_ANIM_FRAMES > 3 - #error "Only 3 fan animation frames currently supported." -#endif -#ifndef STATUS_SCREEN_X - #define STATUS_SCREEN_X 0 -#endif -#ifndef STATUS_SCREEN_Y - #define STATUS_SCREEN_Y 1 -#endif -#ifndef STATUS_BMP_BYTEWIDTH - #define STATUS_BMP_BYTEWIDTH ((STATUS_SCREENWIDTH + 7) / 8) -#endif -#ifndef STATUS_SCREENHEIGHT - #define STATUS_SCREENHEIGHT (sizeof(status_screen0_bmp) / (STATUS_BMP_BYTEWIDTH)) -#endif -#ifndef STATUS_SCREEN_HOTEND_TEXT_X - #define STATUS_SCREEN_HOTEND_TEXT_X(i) (5 + (i) * 25) -#endif -#ifndef STATUS_SCREEN_BED_TEXT_X - #define STATUS_SCREEN_BED_TEXT_X 81 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_X - #define STATUS_SCREEN_FAN_TEXT_X 104 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_Y - #define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) -#endif - -#define BMP_SIZE (STATUS_BMP_BYTEWIDTH) * (STATUS_SCREENHEIGHT) -static_assert(sizeof(status_screen0_bmp) == BMP_SIZE, "Status header (status_screen0_bmp) dimensions don't match data."); -#if FAN_ANIM_FRAMES > 1 - static_assert(sizeof(status_screen1_bmp) == BMP_SIZE, "Status header (status_screen1_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 2 - static_assert(sizeof(status_screen2_bmp) == BMP_SIZE, "Status header (status_screen2_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 3 - static_assert(sizeof(status_screen3_bmp) == BMP_SIZE, "Status header (status_screen3_bmp) dimensions don't match data."); - #endif - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_6x9_marlin.h b/Marlin_thinkerV2/Marlin/dogm_font_data_6x9_marlin.h deleted file mode 100644 index f298a6ac78..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_6x9_marlin.h +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1 - Copyright: Public domain font. Share and enjoy. - Capital A Height: 6, '1' Height: 6 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 6 descent=-2 - X Font ascent = 6 descent=-2 - Max Font ascent = 7 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = { - 0, 6, 9, 0, 254, 6, 1, 137, 2, 254, 32, 255, 254, 7, 254, 6, - 254, 0, 0, 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 128, 128, - 128, 0, 128, 3, 3, 3, 6, 1, 3, 160, 160, 160, 5, 7, 7, 6, - 0, 255, 80, 80, 248, 80, 248, 80, 80, 5, 9, 9, 6, 0, 254, 32, - 112, 168, 160, 112, 40, 168, 112, 32, 6, 8, 8, 6, 0, 255, 64, 168, - 72, 16, 32, 72, 84, 8, 5, 7, 7, 6, 0, 255, 96, 144, 144, 96, - 152, 144, 104, 1, 3, 3, 6, 2, 3, 128, 128, 128, 2, 7, 7, 6, - 2, 255, 64, 128, 128, 128, 128, 128, 64, 2, 7, 7, 6, 2, 255, 128, - 64, 64, 64, 64, 64, 128, 5, 5, 5, 6, 0, 0, 136, 80, 248, 80, - 136, 5, 5, 5, 6, 0, 0, 32, 32, 248, 32, 32, 2, 4, 4, 6, - 2, 254, 192, 64, 64, 128, 5, 1, 1, 6, 0, 2, 248, 2, 2, 2, - 6, 2, 0, 192, 192, 4, 6, 6, 6, 1, 0, 16, 16, 32, 64, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 144, 144, 144, 96, 3, 6, 6, - 6, 1, 0, 64, 192, 64, 64, 64, 224, 4, 6, 6, 6, 1, 0, 96, - 144, 16, 32, 64, 240, 4, 6, 6, 6, 1, 0, 240, 32, 96, 16, 16, - 224, 5, 6, 6, 6, 0, 0, 16, 48, 80, 144, 248, 16, 4, 6, 6, - 6, 1, 0, 240, 128, 224, 16, 16, 224, 4, 6, 6, 6, 1, 0, 96, - 128, 224, 144, 144, 96, 4, 6, 6, 6, 1, 0, 240, 16, 16, 32, 64, - 64, 4, 6, 6, 6, 1, 0, 96, 144, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 96, 144, 144, 112, 16, 96, 2, 5, 5, 6, 2, 0, 192, - 192, 0, 192, 192, 2, 7, 7, 6, 2, 254, 192, 192, 0, 192, 64, 64, - 128, 5, 5, 5, 6, 0, 0, 24, 96, 128, 96, 24, 5, 3, 3, 6, - 0, 1, 248, 0, 248, 5, 5, 5, 6, 0, 0, 192, 48, 8, 48, 192, - 4, 7, 7, 6, 1, 0, 96, 144, 16, 96, 64, 0, 64, 5, 6, 6, - 6, 0, 0, 112, 144, 168, 176, 128, 112, 5, 6, 6, 6, 0, 0, 32, - 80, 136, 248, 136, 136, 5, 6, 6, 6, 0, 0, 240, 136, 240, 136, 136, - 240, 4, 6, 6, 6, 1, 0, 96, 144, 128, 128, 144, 96, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 144, 144, 224, 4, 6, 6, 6, 1, 0, 240, - 128, 224, 128, 128, 240, 4, 6, 6, 6, 1, 0, 240, 128, 224, 128, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 128, 176, 144, 96, 4, 6, 6, - 6, 1, 0, 144, 144, 240, 144, 144, 144, 3, 6, 6, 6, 1, 0, 224, - 64, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, 56, 16, 16, 16, 144, - 96, 4, 6, 6, 6, 1, 0, 144, 160, 192, 160, 144, 144, 4, 6, 6, - 6, 1, 0, 128, 128, 128, 128, 128, 240, 5, 6, 6, 6, 0, 0, 136, - 216, 168, 168, 136, 136, 4, 6, 6, 6, 1, 0, 144, 208, 176, 144, 144, - 144, 5, 6, 6, 6, 0, 0, 112, 136, 136, 136, 136, 112, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 224, 128, 128, 4, 7, 7, 6, 1, 255, 96, - 144, 144, 208, 176, 96, 16, 4, 6, 6, 6, 1, 0, 224, 144, 144, 224, - 144, 144, 4, 6, 6, 6, 1, 0, 96, 144, 64, 32, 144, 96, 5, 6, - 6, 6, 0, 0, 248, 32, 32, 32, 32, 32, 4, 6, 6, 6, 1, 0, - 144, 144, 144, 144, 144, 96, 4, 6, 6, 6, 1, 0, 144, 144, 144, 240, - 96, 96, 5, 6, 6, 6, 0, 0, 136, 136, 168, 168, 216, 136, 5, 6, - 6, 6, 0, 0, 136, 80, 32, 32, 80, 136, 5, 6, 6, 6, 0, 0, - 136, 136, 80, 32, 32, 32, 4, 6, 6, 6, 1, 0, 240, 16, 32, 64, - 128, 240, 3, 6, 6, 6, 1, 0, 224, 128, 128, 128, 128, 224, 4, 6, - 6, 6, 1, 0, 128, 128, 64, 32, 16, 16, 3, 6, 6, 6, 1, 0, - 224, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 3, 32, 80, 136, 5, - 1, 1, 6, 0, 254, 248, 2, 2, 2, 6, 2, 4, 128, 64, 4, 4, - 4, 6, 1, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, 128, 128, - 224, 144, 144, 224, 4, 4, 4, 6, 1, 0, 112, 128, 128, 112, 4, 6, - 6, 6, 1, 0, 16, 16, 112, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 96, 176, 192, 112, 4, 6, 6, 6, 1, 0, 32, 80, 64, 224, 64, 64, - 4, 6, 6, 6, 1, 254, 96, 144, 144, 112, 16, 96, 4, 6, 6, 6, - 1, 0, 128, 128, 224, 144, 144, 144, 3, 6, 6, 6, 1, 0, 64, 0, - 192, 64, 64, 224, 3, 8, 8, 6, 1, 254, 32, 0, 96, 32, 32, 32, - 160, 64, 4, 6, 6, 6, 1, 0, 128, 128, 160, 192, 160, 144, 3, 6, - 6, 6, 1, 0, 192, 64, 64, 64, 64, 224, 5, 4, 4, 6, 0, 0, - 208, 168, 168, 136, 4, 4, 4, 6, 1, 0, 224, 144, 144, 144, 4, 4, - 4, 6, 1, 0, 96, 144, 144, 96, 4, 6, 6, 6, 1, 254, 224, 144, - 144, 224, 128, 128, 4, 6, 6, 6, 1, 254, 112, 144, 144, 112, 16, 16, - 4, 4, 4, 6, 1, 0, 160, 208, 128, 128, 4, 4, 4, 6, 1, 0, - 112, 192, 48, 224, 4, 6, 6, 6, 1, 0, 64, 64, 224, 64, 80, 32, - 4, 4, 4, 6, 1, 0, 144, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 144, 144, 96, 96, 5, 4, 4, 6, 0, 0, 136, 168, 168, 80, 4, 4, - 4, 6, 1, 0, 144, 96, 96, 144, 4, 6, 6, 6, 1, 254, 144, 144, - 144, 112, 144, 96, 4, 4, 4, 6, 1, 0, 240, 32, 64, 240, 3, 7, - 7, 6, 1, 0, 32, 64, 64, 128, 64, 64, 32, 1, 7, 7, 6, 2, - 255, 128, 128, 128, 128, 128, 128, 128, 3, 7, 7, 6, 1, 0, 128, 64, - 64, 32, 64, 64, 128, 4, 2, 2, 6, 1, 3, 80, 160, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, - 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 0, 128, 128, 128, 128, - 4, 6, 6, 6, 1, 255, 32, 112, 160, 160, 112, 32, 5, 7, 7, 6, - 0, 255, 48, 72, 64, 240, 64, 64, 248, 5, 5, 5, 6, 0, 0, 168, - 80, 136, 80, 168, 5, 6, 6, 6, 0, 0, 136, 80, 248, 32, 248, 32, - 1, 7, 7, 6, 2, 255, 128, 128, 128, 0, 128, 128, 128, 4, 7, 7, - 6, 1, 255, 112, 128, 96, 144, 96, 16, 224, 3, 1, 1, 6, 1, 5, - 160, 6, 7, 7, 6, 0, 0, 120, 132, 148, 164, 148, 132, 120, 3, 5, - 5, 6, 1, 1, 96, 160, 96, 0, 224, 5, 5, 5, 6, 0, 0, 40, - 80, 160, 80, 40, 4, 3, 3, 6, 1, 0, 240, 16, 16, 4, 1, 1, - 6, 1, 2, 240, 6, 7, 7, 6, 0, 0, 120, 132, 180, 164, 164, 132, - 120, 4, 1, 1, 6, 1, 5, 240, 4, 3, 3, 6, 1, 2, 96, 144, - 96, 5, 7, 7, 6, 0, 255, 32, 32, 248, 32, 32, 0, 248, 3, 5, - 5, 6, 1, 1, 64, 160, 32, 64, 224, 3, 5, 5, 6, 1, 1, 192, - 32, 64, 32, 192, 2, 2, 2, 6, 2, 4, 64, 128, 4, 5, 5, 6, - 1, 255, 144, 144, 176, 208, 128, 5, 6, 6, 6, 0, 0, 120, 232, 232, - 104, 40, 40, 1, 1, 1, 6, 2, 2, 128, 2, 2, 2, 6, 2, 254, - 64, 128, 3, 5, 5, 6, 1, 1, 64, 192, 64, 64, 224, 3, 5, 5, - 6, 1, 1, 64, 160, 64, 0, 224, 5, 5, 5, 6, 0, 0, 160, 80, - 40, 80, 160, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 112, 48, 120, - 16, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 104, 8, 16, 56, 5, - 8, 8, 6, 0, 255, 192, 32, 64, 48, 240, 48, 120, 16, 4, 7, 7, - 6, 1, 0, 32, 0, 32, 96, 128, 144, 96, 5, 7, 7, 6, 0, 0, - 64, 32, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 16, 32, 32, - 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 32, 80, 32, 80, 112, 136, - 136, 5, 7, 7, 6, 0, 0, 40, 80, 32, 80, 112, 136, 136, 5, 7, - 7, 6, 0, 0, 80, 0, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, - 0, 32, 80, 32, 80, 112, 136, 136, 5, 6, 6, 6, 0, 0, 120, 160, - 240, 160, 160, 184, 4, 8, 8, 6, 1, 254, 96, 144, 128, 128, 144, 96, - 32, 64, 4, 7, 7, 6, 1, 0, 64, 32, 240, 128, 224, 128, 240, 4, - 7, 7, 6, 1, 0, 32, 64, 240, 128, 224, 128, 240, 4, 7, 7, 6, - 1, 0, 32, 80, 240, 128, 224, 128, 240, 4, 7, 7, 6, 1, 0, 80, - 0, 240, 128, 224, 128, 240, 3, 7, 7, 6, 1, 0, 128, 64, 224, 64, - 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, 64, 224, 64, 64, 64, 224, - 3, 7, 7, 6, 1, 0, 64, 160, 224, 64, 64, 64, 224, 3, 7, 7, - 6, 1, 0, 160, 0, 224, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, - 112, 72, 232, 72, 72, 112, 4, 7, 7, 6, 1, 0, 80, 160, 144, 208, - 176, 144, 144, 4, 7, 7, 6, 1, 0, 64, 32, 96, 144, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 32, 64, 96, 144, 144, 144, 96, 4, 7, 7, - 6, 1, 0, 32, 80, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 80, 160, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 96, - 144, 144, 144, 96, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 4, - 8, 8, 6, 1, 255, 16, 112, 176, 176, 208, 208, 224, 128, 4, 7, 7, - 6, 1, 0, 64, 32, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 32, 64, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 144, - 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 144, 144, 144, 144, - 96, 5, 7, 7, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, 4, 6, - 6, 6, 1, 0, 128, 224, 144, 144, 224, 128, 4, 6, 6, 6, 1, 0, - 96, 144, 160, 160, 144, 160, 4, 7, 7, 6, 1, 0, 64, 32, 0, 112, - 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 112, 144, 144, 112, - 4, 7, 7, 6, 1, 0, 32, 80, 0, 112, 144, 144, 112, 4, 7, 7, - 6, 1, 0, 80, 160, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, - 80, 0, 112, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, 32, 112, - 144, 144, 112, 5, 4, 4, 6, 0, 0, 112, 168, 176, 120, 4, 6, 6, - 6, 1, 254, 112, 128, 128, 112, 32, 64, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 176, 192, 112, - 4, 6, 6, 6, 1, 0, 80, 0, 96, 176, 192, 112, 3, 7, 7, 6, - 1, 0, 128, 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, - 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 64, 160, 0, 192, - 64, 64, 224, 3, 6, 6, 6, 1, 0, 160, 0, 192, 64, 64, 224, 4, - 7, 7, 6, 1, 0, 48, 96, 16, 112, 144, 144, 96, 4, 7, 7, 6, - 1, 0, 80, 160, 0, 224, 144, 144, 144, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 80, 160, 0, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 80, 0, 96, 144, 144, 96, 5, 5, 5, 6, 0, 0, 32, - 0, 248, 0, 32, 4, 4, 4, 6, 1, 0, 112, 176, 208, 224, 4, 7, - 7, 6, 1, 0, 64, 32, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, - 0, 32, 64, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, - 0, 144, 144, 144, 112, 4, 6, 6, 6, 1, 0, 80, 0, 144, 144, 144, - 112, 4, 9, 9, 6, 1, 254, 32, 64, 0, 144, 144, 144, 112, 144, 96, - 4, 8, 8, 6, 1, 254, 128, 128, 224, 144, 144, 224, 128, 128, 4, 8, - 8, 6, 1, 254, 80, 0, 144, 144, 144, 112, 144, 96 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_C.h b/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_C.h deleted file mode 100644 index 21d4aaabe2..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_C.h +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_C v1.2 - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 8 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_C_5x7[2522] U8G_SECTION(".progmem.HD44780_C_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 34, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 7, 7, 6, 0, 0, 32, 112, 160, 160, 168, 112, 32, 3, 7, 7, - 6, 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, - 32, 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, - 128, 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, - 6, 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, - 112, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, - 136, 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, - 112, 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, - 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 3, 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, - 7, 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, - 0, 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, - 168, 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, - 5, 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, - 136, 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, - 8, 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, - 64, 64, 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, - 5, 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, - 5, 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, - 0, 0, 248, 16, 32, 64, 248, 5, 5, 5, 6, 0, 2, 184, 168, 168, - 168, 184, 5, 5, 5, 6, 0, 2, 184, 136, 184, 160, 184, 5, 5, 5, - 6, 0, 2, 184, 160, 184, 136, 184, 5, 6, 6, 6, 0, 1, 8, 40, - 72, 248, 64, 32, 5, 5, 5, 6, 0, 0, 56, 112, 224, 136, 240, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, - 7, 7, 6, 0, 0, 248, 136, 128, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 248, 136, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 80, - 0, 248, 128, 240, 128, 248, 5, 7, 7, 6, 0, 0, 168, 168, 168, 112, - 168, 168, 168, 5, 7, 7, 6, 0, 0, 240, 8, 8, 112, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 136, 136, 152, 168, 200, 136, 136, 5, 8, 8, - 6, 0, 0, 80, 32, 136, 152, 168, 168, 200, 136, 5, 7, 7, 6, 0, - 0, 120, 40, 40, 40, 40, 168, 72, 5, 7, 7, 6, 0, 0, 248, 136, - 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, 136, 80, 32, - 64, 128, 5, 7, 7, 6, 0, 0, 32, 112, 168, 168, 168, 112, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 120, 8, 8, 8, 5, 7, 7, 6, - 0, 0, 168, 168, 168, 168, 168, 168, 248, 5, 7, 7, 6, 0, 0, 192, - 64, 64, 112, 72, 72, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 200, - 168, 168, 200, 5, 7, 7, 6, 0, 0, 112, 136, 8, 56, 8, 136, 112, - 5, 7, 7, 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, - 6, 0, 0, 120, 136, 136, 120, 40, 72, 136, 5, 7, 7, 6, 0, 0, - 24, 96, 128, 240, 136, 136, 112, 4, 5, 5, 6, 0, 0, 224, 144, 224, - 144, 224, 5, 5, 5, 6, 0, 0, 248, 136, 128, 128, 128, 5, 7, 7, - 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 5, 5, 5, 6, 0, 0, - 168, 168, 112, 168, 168, 5, 5, 5, 6, 0, 0, 240, 8, 48, 8, 240, - 5, 5, 5, 6, 0, 0, 136, 152, 168, 200, 136, 5, 7, 7, 6, 0, - 0, 80, 32, 136, 152, 168, 200, 136, 4, 5, 5, 6, 0, 0, 144, 160, - 192, 160, 144, 5, 5, 5, 6, 0, 0, 248, 40, 40, 168, 72, 5, 5, - 5, 6, 0, 0, 136, 216, 168, 136, 136, 5, 5, 5, 6, 0, 0, 136, - 136, 248, 136, 136, 5, 5, 5, 6, 0, 0, 248, 136, 136, 136, 136, 5, - 5, 5, 6, 0, 0, 248, 32, 32, 32, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 120, 8, 8, 5, 5, 5, 6, 0, 0, 168, 168, 168, 168, 248, - 5, 5, 5, 6, 0, 0, 192, 64, 112, 72, 112, 5, 5, 5, 6, 0, - 0, 136, 136, 200, 168, 200, 4, 5, 5, 6, 0, 0, 128, 128, 224, 144, - 224, 5, 5, 5, 6, 0, 0, 112, 136, 56, 136, 112, 5, 5, 5, 6, - 0, 0, 144, 168, 232, 168, 144, 5, 5, 5, 6, 0, 0, 120, 136, 120, - 40, 72, 5, 5, 5, 6, 0, 1, 32, 72, 144, 72, 32, 5, 5, 5, - 6, 0, 1, 32, 144, 72, 144, 32, 5, 3, 3, 6, 0, 0, 72, 144, - 216, 5, 3, 3, 6, 0, 4, 216, 72, 144, 5, 7, 7, 6, 0, 0, - 144, 208, 176, 144, 56, 40, 56, 5, 7, 7, 6, 0, 0, 32, 0, 32, - 64, 128, 136, 112, 5, 7, 7, 6, 0, 0, 24, 32, 32, 112, 32, 32, - 192, 5, 7, 7, 6, 0, 0, 32, 80, 64, 240, 64, 64, 120, 1, 2, - 2, 6, 2, 0, 128, 128, 1, 4, 4, 6, 2, 0, 128, 128, 128, 128, - 3, 5, 5, 6, 1, 0, 160, 160, 160, 0, 224, 3, 5, 5, 6, 1, - 0, 160, 160, 160, 0, 160, 5, 7, 7, 6, 0, 0, 160, 0, 232, 16, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 216, 112, 32, 112, 216, 5, 7, - 7, 6, 0, 0, 160, 64, 168, 16, 32, 64, 128, 3, 6, 6, 6, 1, - 1, 224, 64, 64, 64, 64, 224, 5, 6, 6, 6, 0, 1, 248, 80, 80, - 80, 80, 248, 5, 7, 7, 6, 0, 0, 32, 112, 168, 32, 32, 32, 32, - 5, 7, 7, 6, 0, 0, 32, 32, 32, 32, 168, 112, 32, 5, 7, 7, - 6, 0, 0, 128, 144, 176, 248, 176, 144, 128, 5, 7, 7, 6, 0, 0, - 8, 72, 104, 248, 104, 72, 8, 5, 7, 7, 6, 0, 0, 128, 136, 168, - 248, 168, 136, 128, 5, 7, 7, 6, 0, 0, 128, 224, 136, 16, 32, 64, - 128, 2, 2, 2, 6, 2, 2, 192, 192, 5, 8, 8, 6, 0, 255, 120, - 40, 40, 40, 72, 136, 248, 136, 5, 8, 8, 6, 0, 255, 136, 136, 136, - 136, 136, 136, 248, 8, 5, 8, 8, 6, 0, 255, 168, 168, 168, 168, 168, - 168, 248, 8, 5, 6, 6, 6, 0, 255, 120, 40, 72, 136, 248, 136, 5, - 7, 7, 6, 0, 255, 32, 32, 112, 168, 168, 112, 32, 5, 6, 6, 6, - 0, 255, 136, 136, 136, 136, 248, 8, 5, 6, 6, 6, 0, 255, 168, 168, - 168, 168, 248, 8, 2, 2, 2, 6, 2, 6, 64, 128, 3, 1, 1, 6, - 1, 7, 160, 5, 2, 2, 6, 0, 6, 72, 176, 5, 8, 8, 6, 0, - 0, 16, 32, 0, 112, 136, 248, 128, 112, 5, 6, 6, 6, 0, 255, 112, - 128, 136, 112, 32, 96, 3, 7, 7, 6, 1, 0, 160, 0, 160, 160, 160, - 32, 192, 5, 6, 6, 6, 0, 1, 32, 112, 112, 112, 248, 32, 5, 5, - 5, 6, 0, 1, 80, 0, 136, 0, 80, 5, 5, 5, 6, 0, 1, 112, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, - 8, 5, 7, 7, 6, 0, 0, 136, 144, 184, 72, 184, 8, 56, 5, 7, - 7, 6, 0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, - 0, 192, 64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 136, - 248, 136, 248, 136, 248, 136, 4, 5, 5, 6, 0, 2, 192, 0, 48, 0, - 96, 5, 8, 8, 6, 0, 0, 64, 160, 224, 168, 8, 40, 120, 32, 5, - 8, 8, 6, 0, 0, 64, 112, 64, 120, 64, 112, 64, 224, 5, 8, 8, - 6, 0, 0, 32, 112, 32, 248, 32, 112, 32, 112, 5, 7, 7, 6, 0, - 0, 104, 0, 232, 0, 104, 16, 56, 5, 8, 8, 6, 0, 0, 16, 112, - 16, 240, 16, 112, 16, 56, 5, 7, 7, 6, 0, 1, 32, 112, 32, 248, - 32, 112, 32, 5, 8, 8, 6, 0, 0, 16, 144, 80, 48, 80, 144, 16, - 56, 5, 8, 8, 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 5, - 7, 7, 6, 0, 0, 120, 168, 168, 120, 40, 40, 40, 5, 8, 8, 6, - 0, 0, 248, 248, 248, 248, 248, 248, 248, 248 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_J.h b/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_J.h deleted file mode 100644 index e4884c7cbc..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_J.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_J - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h=10 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_J_5x7[2492] U8G_SECTION(".progmem.HD44780_J_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 34, 32, 255, 255, 8, 254, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 7, 7, 6, 0, 0, 136, 80, 248, 32, 248, 32, 32, 3, 7, 7, - 6, 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, - 32, 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, - 128, 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, - 6, 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, - 112, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, - 136, 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, - 112, 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, - 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 3, 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, - 7, 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, - 0, 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, - 168, 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, - 5, 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, - 136, 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, - 8, 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, - 64, 64, 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, - 5, 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, - 136, 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, - 5, 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, - 0, 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, - 128, 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, - 128, 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 5, - 5, 6, 0, 1, 32, 16, 248, 16, 32, 5, 5, 5, 6, 0, 1, 32, - 64, 248, 64, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 3, 3, 3, 6, 0, 0, - 224, 160, 224, 3, 4, 4, 6, 2, 3, 224, 128, 128, 128, 3, 4, 4, - 6, 0, 0, 32, 32, 32, 224, 3, 3, 3, 6, 0, 0, 128, 64, 32, - 2, 2, 2, 6, 1, 2, 192, 192, 5, 6, 6, 6, 0, 0, 248, 8, - 248, 8, 16, 32, 5, 5, 5, 6, 0, 0, 248, 8, 48, 32, 64, 4, - 5, 5, 6, 0, 0, 16, 32, 96, 160, 32, 5, 5, 5, 6, 0, 0, - 32, 248, 136, 8, 48, 5, 4, 4, 6, 0, 0, 248, 32, 32, 248, 5, - 5, 5, 6, 0, 0, 16, 248, 48, 80, 144, 5, 5, 5, 6, 0, 0, - 64, 248, 72, 80, 64, 5, 4, 4, 6, 0, 0, 112, 16, 16, 248, 4, - 5, 5, 6, 0, 0, 240, 16, 240, 16, 240, 5, 4, 4, 6, 0, 0, - 168, 168, 8, 48, 5, 1, 1, 6, 0, 3, 248, 5, 7, 7, 6, 0, - 0, 248, 8, 40, 48, 32, 32, 64, 5, 7, 7, 6, 0, 0, 8, 16, - 32, 96, 160, 32, 32, 5, 7, 7, 6, 0, 0, 32, 248, 136, 136, 8, - 16, 32, 5, 6, 6, 6, 0, 0, 248, 32, 32, 32, 32, 248, 5, 7, - 7, 6, 0, 0, 16, 248, 16, 48, 80, 144, 16, 5, 7, 7, 6, 0, - 0, 64, 248, 72, 72, 72, 72, 144, 5, 7, 7, 6, 0, 0, 32, 248, - 32, 248, 32, 32, 32, 5, 6, 6, 6, 0, 0, 120, 72, 136, 8, 16, - 96, 5, 7, 7, 6, 0, 0, 64, 120, 144, 16, 16, 16, 32, 5, 6, - 6, 6, 0, 0, 248, 8, 8, 8, 8, 248, 5, 7, 7, 6, 0, 0, - 80, 248, 80, 80, 16, 32, 64, 5, 6, 6, 6, 0, 0, 192, 8, 200, - 8, 16, 224, 5, 6, 6, 6, 0, 0, 248, 8, 16, 32, 80, 136, 5, - 7, 7, 6, 0, 0, 64, 248, 72, 80, 64, 64, 56, 5, 6, 6, 6, - 0, 0, 136, 136, 72, 8, 16, 96, 5, 6, 6, 6, 0, 0, 120, 72, - 168, 24, 16, 96, 5, 7, 7, 6, 0, 0, 16, 224, 32, 248, 32, 32, - 64, 5, 6, 6, 6, 0, 0, 168, 168, 168, 8, 16, 32, 5, 7, 7, - 6, 0, 0, 112, 0, 248, 32, 32, 32, 64, 3, 7, 7, 6, 1, 0, - 128, 128, 128, 192, 160, 128, 128, 5, 7, 7, 6, 0, 0, 32, 32, 248, - 32, 32, 64, 128, 5, 6, 6, 6, 0, 0, 112, 0, 0, 0, 0, 248, - 5, 6, 6, 6, 0, 0, 248, 8, 80, 32, 80, 128, 5, 7, 7, 6, - 0, 0, 32, 248, 16, 32, 112, 168, 32, 3, 7, 7, 6, 1, 0, 32, - 32, 32, 32, 32, 64, 128, 5, 6, 6, 6, 0, 0, 32, 16, 136, 136, - 136, 136, 5, 7, 7, 6, 0, 0, 128, 128, 248, 128, 128, 128, 120, 5, - 6, 6, 6, 0, 0, 248, 8, 8, 8, 16, 96, 5, 5, 5, 6, 0, - 1, 64, 160, 16, 8, 8, 5, 7, 7, 6, 0, 0, 32, 248, 32, 32, - 168, 168, 32, 5, 6, 6, 6, 0, 0, 248, 8, 8, 80, 32, 16, 4, - 6, 6, 6, 1, 0, 224, 0, 224, 0, 224, 16, 5, 6, 6, 6, 0, - 0, 32, 64, 128, 136, 248, 8, 5, 6, 6, 6, 0, 0, 8, 8, 80, - 32, 80, 128, 5, 6, 6, 6, 0, 0, 248, 64, 248, 64, 64, 56, 5, - 7, 7, 6, 0, 0, 64, 64, 248, 72, 80, 64, 64, 5, 7, 7, 6, - 0, 0, 112, 16, 16, 16, 16, 16, 248, 5, 6, 6, 6, 0, 0, 248, - 8, 248, 8, 8, 248, 5, 7, 7, 6, 0, 0, 112, 0, 248, 8, 8, - 16, 32, 4, 7, 7, 6, 0, 0, 144, 144, 144, 144, 16, 32, 64, 5, - 6, 6, 6, 0, 0, 32, 160, 160, 168, 168, 176, 5, 7, 7, 6, 0, - 0, 128, 128, 128, 136, 144, 160, 192, 5, 6, 6, 6, 0, 0, 248, 136, - 136, 136, 136, 248, 5, 6, 6, 6, 0, 0, 248, 136, 136, 8, 16, 32, - 5, 6, 6, 6, 0, 0, 192, 0, 8, 8, 16, 224, 4, 3, 3, 6, - 0, 4, 32, 144, 64, 3, 3, 3, 6, 0, 4, 224, 160, 224, 5, 5, - 5, 6, 0, 1, 72, 168, 144, 144, 104, 5, 7, 7, 6, 0, 0, 80, - 0, 112, 8, 120, 136, 120, 4, 8, 8, 6, 1, 255, 96, 144, 144, 224, - 144, 144, 224, 128, 5, 5, 5, 6, 0, 0, 112, 128, 96, 136, 112, 5, - 6, 6, 6, 0, 255, 136, 136, 152, 232, 136, 128, 5, 5, 5, 6, 0, - 0, 120, 160, 144, 136, 112, 5, 7, 7, 6, 0, 254, 48, 72, 136, 136, - 240, 128, 128, 5, 8, 8, 6, 0, 254, 120, 136, 136, 136, 120, 8, 8, - 112, 5, 5, 5, 6, 0, 1, 56, 32, 32, 160, 64, 4, 3, 3, 6, - 0, 3, 16, 208, 16, 4, 8, 8, 6, 0, 255, 16, 0, 48, 16, 16, - 16, 144, 96, 3, 3, 3, 6, 0, 4, 160, 64, 160, 5, 7, 7, 6, - 0, 0, 32, 112, 160, 160, 168, 112, 32, 5, 7, 7, 6, 0, 0, 64, - 64, 224, 64, 224, 64, 120, 5, 7, 7, 6, 0, 0, 112, 0, 176, 200, - 136, 136, 136, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 136, 136, 112, - 5, 7, 7, 6, 0, 255, 176, 200, 136, 136, 240, 128, 128, 5, 7, 7, - 6, 0, 255, 104, 152, 136, 136, 120, 8, 8, 5, 6, 6, 6, 0, 0, - 112, 136, 248, 136, 136, 112, 5, 3, 3, 6, 0, 2, 88, 168, 208, 5, - 5, 5, 6, 0, 0, 112, 136, 136, 80, 216, 5, 7, 7, 6, 0, 0, - 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 248, 128, 64, - 32, 64, 128, 248, 5, 5, 5, 6, 0, 0, 248, 80, 80, 80, 152, 5, - 7, 7, 6, 0, 0, 248, 0, 136, 80, 32, 80, 136, 5, 7, 7, 6, - 0, 255, 136, 136, 136, 136, 120, 8, 112, 5, 6, 6, 6, 0, 0, 8, - 240, 32, 248, 32, 32, 5, 5, 5, 6, 0, 0, 248, 64, 120, 72, 136, - 5, 5, 5, 6, 0, 0, 248, 168, 248, 136, 136, 5, 5, 5, 6, 0, - 1, 32, 0, 248, 0, 32, 0, 0, 0, 6, 0, 0, 6, 10, 10, 6, - 0, 254, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_W.h b/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_W.h deleted file mode 100644 index 86b4bf4bff..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_HD44780_W.h +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: HD44780_W - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t HD44780_W_5x7[3034] U8G_SECTION(".progmem.HD44780_W_5x7") = { - 0, 6, 9, 0, 254, 7, 2, 79, 3, 222, 16, 255, 255, 8, 255, 7, - 255, 4, 7, 7, 6, 0, 0, 16, 48, 112, 240, 112, 48, 16, 4, 7, - 7, 6, 1, 0, 128, 192, 224, 240, 224, 192, 128, 5, 3, 3, 6, 0, - 4, 216, 72, 144, 5, 3, 3, 6, 0, 4, 216, 144, 72, 5, 7, 7, - 6, 0, 0, 32, 112, 248, 0, 32, 112, 248, 5, 7, 7, 6, 0, 0, - 248, 112, 32, 0, 248, 112, 32, 5, 5, 5, 6, 0, 1, 112, 248, 248, - 248, 112, 5, 7, 7, 6, 0, 0, 8, 8, 40, 72, 248, 64, 32, 5, - 7, 7, 6, 0, 0, 32, 112, 168, 32, 32, 32, 32, 5, 7, 7, 6, - 0, 0, 32, 32, 32, 32, 168, 112, 32, 5, 5, 5, 6, 0, 1, 32, - 64, 248, 64, 32, 5, 5, 5, 6, 0, 1, 32, 16, 248, 16, 32, 5, - 7, 7, 6, 0, 0, 16, 32, 64, 32, 16, 0, 248, 5, 7, 7, 6, - 0, 0, 64, 32, 16, 32, 64, 0, 248, 5, 5, 5, 6, 0, 1, 32, - 32, 112, 112, 248, 5, 5, 5, 6, 0, 0, 248, 112, 112, 32, 32, 0, - 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, - 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, 0, 0, - 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, 120, 160, - 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, 64, 152, - 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, 2, 3, - 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, 64, 128, - 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, 32, 64, - 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, 5, 6, - 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, 64, 128, - 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, 192, 5, - 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, - 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, 192, 64, - 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, 128, 128, - 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, 5, 7, - 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, 6, 0, - 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, 48, 64, - 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, 32, - 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, 112, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, 5, 6, - 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, 192, 0, - 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, 32, 16, - 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, 0, 128, - 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, 8, 16, - 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, 112, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, 7, 6, - 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, 0, 112, - 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, 136, 136, - 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 248, - 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, 7, 7, - 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, 16, 144, - 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, 5, 7, - 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, 6, 0, - 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, - 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, 7, 6, - 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, 0, 120, - 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, 32, 32, - 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 136, 112, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, 0, 0, - 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, 136, 136, - 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, 64, 128, - 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, 5, 5, - 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, 0, 224, - 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, 136, 5, - 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, 5, 5, - 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 128, - 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, 128, 136, - 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, 5, 5, - 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, 0, 48, - 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, 136, 120, - 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, 136, 1, - 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, 8, 6, - 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, 0, 0, - 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, 64, 64, - 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, 168, 5, - 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, 0, 0, - 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, 240, 128, - 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, 5, 5, - 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, 112, 128, - 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, 72, 48, - 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, 6, 0, - 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, 168, 168, - 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, 6, 6, - 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, 248, 16, - 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, 64, 32, - 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, 7, 7, - 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 6, 6, 6, 0, 1, - 8, 40, 72, 248, 64, 32, 5, 7, 7, 6, 0, 0, 32, 80, 136, 136, - 136, 136, 248, 5, 7, 7, 6, 0, 0, 248, 136, 128, 240, 136, 136, 240, - 5, 8, 8, 6, 0, 255, 120, 40, 40, 40, 72, 136, 248, 136, 5, 7, - 7, 6, 0, 0, 168, 168, 168, 112, 168, 168, 168, 5, 7, 7, 6, 0, - 0, 240, 8, 8, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 136, 136, - 152, 168, 200, 136, 136, 5, 8, 8, 6, 0, 0, 80, 32, 136, 152, 168, - 168, 200, 136, 5, 7, 7, 6, 0, 0, 120, 40, 40, 40, 40, 168, 72, - 5, 7, 7, 6, 0, 0, 248, 136, 136, 136, 136, 136, 136, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 80, 32, 64, 128, 5, 8, 8, 6, 0, 255, - 136, 136, 136, 136, 136, 136, 248, 8, 5, 7, 7, 6, 0, 0, 136, 136, - 136, 120, 8, 8, 8, 5, 7, 7, 6, 0, 0, 168, 168, 168, 168, 168, - 168, 248, 5, 8, 8, 6, 0, 255, 168, 168, 168, 168, 168, 168, 248, 8, - 5, 7, 7, 6, 0, 0, 192, 64, 64, 112, 72, 72, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 200, 168, 168, 200, 5, 7, 7, 6, 0, 0, - 112, 136, 40, 80, 8, 136, 112, 5, 5, 5, 6, 0, 0, 64, 160, 144, - 144, 104, 5, 7, 7, 6, 0, 0, 32, 48, 40, 40, 32, 224, 224, 5, - 7, 7, 6, 0, 0, 248, 136, 128, 128, 128, 128, 128, 5, 5, 5, 6, - 0, 0, 248, 80, 80, 80, 152, 5, 7, 7, 6, 0, 0, 248, 128, 64, - 32, 64, 128, 248, 5, 5, 5, 6, 0, 0, 120, 144, 144, 144, 96, 5, - 7, 7, 6, 0, 0, 48, 40, 56, 40, 200, 216, 24, 5, 6, 6, 6, - 0, 0, 8, 112, 160, 32, 32, 16, 5, 6, 6, 6, 0, 1, 32, 112, - 112, 112, 248, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, - 112, 5, 5, 5, 6, 0, 0, 112, 136, 136, 80, 216, 5, 7, 7, 6, - 0, 0, 48, 72, 32, 80, 136, 136, 112, 5, 3, 3, 6, 0, 2, 88, - 168, 208, 5, 6, 6, 6, 0, 0, 80, 248, 248, 248, 112, 32, 5, 5, - 5, 6, 0, 0, 112, 128, 96, 136, 112, 5, 7, 7, 6, 0, 0, 112, - 136, 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 216, 216, 216, 216, - 216, 216, 216, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 32, 112, 160, 160, 168, 112, 32, 5, 7, 7, - 6, 0, 0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, - 136, 112, 80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 248, 32, 248, - 32, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, - 8, 8, 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 5, 7, 7, - 6, 0, 0, 24, 32, 32, 112, 32, 32, 192, 5, 7, 7, 6, 0, 0, - 248, 136, 184, 184, 184, 136, 248, 5, 7, 7, 6, 0, 0, 112, 8, 120, - 136, 120, 0, 248, 5, 5, 5, 6, 0, 1, 40, 80, 160, 80, 40, 5, - 7, 7, 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, 6, - 0, 0, 120, 136, 136, 120, 40, 72, 136, 5, 7, 7, 6, 0, 0, 248, - 136, 168, 136, 152, 168, 248, 2, 3, 3, 6, 2, 4, 64, 128, 192, 4, - 5, 5, 6, 0, 3, 96, 144, 144, 144, 96, 5, 7, 7, 6, 0, 0, - 32, 32, 248, 32, 32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, - 64, 240, 3, 5, 5, 6, 0, 3, 224, 32, 224, 32, 224, 5, 8, 8, - 6, 0, 0, 224, 144, 224, 128, 144, 184, 144, 24, 5, 8, 8, 6, 0, - 255, 136, 136, 136, 136, 152, 232, 128, 128, 5, 7, 7, 6, 0, 0, 120, - 152, 152, 120, 24, 24, 24, 2, 2, 2, 6, 2, 2, 192, 192, 5, 5, - 5, 6, 0, 0, 80, 136, 168, 168, 80, 3, 5, 5, 6, 0, 3, 64, - 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 112, 0, - 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5, 7, 7, 6, - 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6, 0, 0, 136, - 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192, 64, 192, 72, - 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32, 64, 128, 136, - 112, 5, 8, 8, 6, 0, 0, 64, 32, 32, 80, 136, 248, 136, 136, 5, - 8, 8, 6, 0, 0, 16, 32, 32, 80, 136, 248, 136, 136, 5, 8, 8, - 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, 0, - 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, 80, - 0, 32, 80, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, 32, 80, 32, - 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96, 160, 184, 224, - 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136, 112, 32, 96, - 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128, 248, 5, 8, - 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5, 8, 8, 6, - 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7, 6, 0, 0, - 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0, 128, 64, 0, - 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, 0, 224, 64, - 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224, 64, 64, 64, - 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64, 224, 5, 7, - 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8, 8, 6, 0, - 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6, 0, 0, 64, - 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 112, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, 136, 136, 136, - 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136, 136, 112, 5, - 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 7, 7, 6, 0, 0, - 112, 32, 112, 168, 112, 32, 112, 5, 8, 8, 6, 0, 0, 64, 32, 136, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 136, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 136, 136, 136, 136, - 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136, 136, 136, 112, 5, - 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, 32, 5, 8, 8, - 6, 0, 0, 192, 64, 112, 72, 72, 112, 64, 224, 5, 7, 7, 6, 0, - 0, 48, 72, 72, 112, 72, 72, 176, 5, 8, 8, 6, 0, 0, 64, 32, - 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, - 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 8, 120, - 136, 120, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, 8, 120, 136, 120, - 5, 7, 7, 6, 0, 0, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, - 6, 0, 0, 32, 80, 32, 112, 8, 120, 136, 120, 5, 6, 6, 6, 0, - 0, 208, 40, 120, 160, 168, 80, 5, 6, 6, 6, 0, 255, 112, 128, 136, - 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, 128, - 112, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 128, 112, 5, - 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 128, 112, 5, 7, 7, - 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 3, 8, 8, 6, 1, 0, - 128, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, - 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 64, - 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 64, 192, 64, 64, - 224, 5, 7, 7, 6, 0, 0, 160, 64, 160, 16, 120, 136, 112, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 176, 200, 136, 136, 136, 5, 8, 8, 6, - 0, 0, 64, 32, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, - 16, 32, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, - 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 136, 136, - 112, 5, 5, 5, 6, 0, 1, 32, 0, 248, 0, 32, 5, 7, 7, 6, - 0, 0, 16, 32, 112, 168, 112, 32, 64, 5, 8, 8, 6, 0, 0, 64, - 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, 0, 16, 32, 0, - 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, 0, 32, 80, 0, 136, 136, - 136, 152, 104, 5, 7, 7, 6, 0, 0, 80, 0, 136, 136, 136, 152, 104, - 5, 9, 9, 6, 0, 255, 16, 32, 0, 136, 136, 136, 248, 8, 112, 4, - 7, 7, 6, 1, 0, 192, 64, 96, 80, 96, 64, 224, 5, 8, 8, 6, - 0, 255, 80, 0, 136, 136, 136, 248, 8, 112 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1.h deleted file mode 100644 index 5e12ea86ff..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1.h +++ /dev/null @@ -1,286 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646-1 - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include - -#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7) - - // - // Reduced font (only symbols 32 - 127) - About 1400 bytes smaller - // - const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = { - 0,6,9,0,254,7,1,146,3,33,32,127,255,7,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0}; - -#else - - // - // Extended (original) font (symbols 32 - 255) - // - const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 136, 136, 136, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168, - 168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240, - 136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, - 128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, - 16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, - 136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, - 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, - 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, - 0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, - 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, - 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, - 6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, - 224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, - 1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, - 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, - 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, - 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, - 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, - 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, - 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, - 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, - 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, - 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, - 6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, - 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, - 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, - 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, - 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, - 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, - 0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64, - 64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, - 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, - 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, - 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, - 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, - 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, - 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, - 6, 0, 2, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, - 0, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 5, 7, - 7, 6, 0, 0, 32, 112, 168, 160, 168, 112, 32, 5, 7, 7, 6, 0, - 0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, 136, 112, - 80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 32, 248, 32, 248, 32, - 1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, 8, 8, - 6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 3, 1, 1, 6, 1, - 7, 160, 5, 7, 7, 6, 0, 0, 248, 136, 184, 184, 184, 136, 248, 5, - 7, 7, 6, 0, 1, 112, 8, 120, 136, 120, 0, 248, 5, 5, 5, 6, - 0, 1, 40, 80, 160, 80, 40, 5, 3, 3, 6, 0, 1, 248, 8, 8, - 2, 2, 2, 6, 2, 6, 64, 128, 5, 7, 7, 6, 0, 0, 248, 136, - 168, 136, 152, 168, 248, 5, 1, 1, 6, 0, 6, 248, 4, 4, 4, 6, - 0, 3, 96, 144, 144, 96, 5, 7, 7, 6, 0, 0, 32, 32, 248, 32, - 32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, 64, 240, 3, 5, - 5, 6, 0, 3, 224, 32, 224, 32, 224, 2, 2, 2, 6, 2, 6, 64, - 128, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 152, 232, 128, 128, 5, - 7, 7, 6, 0, 0, 120, 152, 152, 120, 24, 24, 24, 2, 2, 2, 6, - 2, 2, 192, 192, 2, 2, 2, 6, 2, 255, 64, 128, 3, 5, 5, 6, - 0, 3, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 1, 112, 136, 136, - 136, 112, 0, 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5, - 7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6, - 0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192, - 64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32, - 64, 128, 136, 112, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, - 136, 136, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 136, 136, - 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6, - 0, 0, 80, 0, 112, 136, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0, - 32, 80, 32, 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96, - 160, 184, 224, 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136, - 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128, - 248, 5, 8, 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5, - 8, 8, 6, 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7, - 6, 0, 0, 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0, - 128, 64, 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64, - 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224, - 64, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64, - 224, 5, 7, 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8, - 8, 6, 0, 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6, - 0, 0, 64, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, - 16, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, - 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112, - 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136, - 136, 112, 5, 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 8, 8, - 6, 0, 255, 16, 112, 168, 168, 168, 168, 112, 64, 5, 8, 8, 6, 0, - 0, 64, 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, - 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, - 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136, - 136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, - 32, 5, 9, 9, 6, 0, 255, 192, 64, 112, 72, 72, 112, 64, 64, 224, - 4, 8, 8, 6, 1, 255, 96, 144, 144, 160, 144, 144, 224, 128, 5, 8, - 8, 6, 0, 0, 64, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, - 0, 0, 16, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, - 32, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 104, 144, - 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 80, 0, 112, 8, - 120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 32, 112, 8, 120, 136, - 120, 5, 6, 6, 6, 0, 0, 208, 40, 120, 160, 168, 80, 5, 6, 6, - 6, 0, 255, 112, 128, 136, 112, 32, 96, 5, 8, 8, 6, 0, 0, 64, - 32, 0, 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 16, 32, 0, - 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, - 248, 128, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, - 3, 8, 8, 6, 1, 0, 128, 64, 0, 64, 192, 64, 64, 224, 3, 8, - 8, 6, 1, 0, 32, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6, - 1, 0, 64, 160, 0, 64, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, - 160, 0, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 160, 64, 160, - 16, 120, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 176, 200, 136, - 136, 136, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 136, 136, 112, - 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 136, 136, 112, 5, 8, - 8, 6, 0, 0, 32, 80, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6, - 0, 0, 104, 144, 0, 112, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, - 80, 0, 112, 136, 136, 136, 112, 5, 5, 5, 6, 0, 1, 32, 0, 248, - 0, 32, 5, 7, 7, 6, 0, 255, 16, 112, 168, 168, 168, 112, 64, 5, - 8, 8, 6, 0, 0, 64, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, - 6, 0, 0, 16, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0, - 0, 32, 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 80, - 0, 136, 136, 136, 152, 104, 5, 9, 9, 6, 0, 255, 16, 32, 0, 136, - 136, 136, 248, 8, 112, 4, 7, 7, 6, 1, 255, 192, 64, 96, 80, 96, - 64, 224, 5, 8, 8, 6, 0, 255, 80, 0, 136, 136, 136, 120, 8, 112 - }; - -#endif diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_PL.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_PL.h deleted file mode 100644 index 47b0bbb065..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_PL.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - Fontname: ISO10646-1-PL - Copyright: A.Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_1_PL_5x7[2732] U8G_FONT_SECTION(".progmem.ISO10646_1_PL_5x7") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,254,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,9,9,6,0, - 254,112,136,136,248,136,136,136,16,32,5,7,7,6,0,254, - 112,8,120,136,120,16,32,5,8,8,6,0,0,16,32,112, - 136,128,128,136,112,5,7,7,6,0,0,16,32,112,128,128, - 136,112,5,9,9,6,0,254,248,128,128,240,128,128,248,8, - 16,5,7,7,6,0,254,112,136,248,128,112,16,32,5,7, - 7,6,0,0,128,144,160,192,128,128,248,5,7,7,6,0, - 0,96,40,48,96,160,32,112,5,8,8,6,0,0,16,168, - 136,200,168,152,136,136,5,8,8,6,0,0,8,16,0,176, - 200,136,136,136,5,8,8,6,0,0,16,32,112,136,136,136, - 136,112,5,8,8,6,0,0,16,32,0,112,136,136,136,112, - 5,8,8,6,0,0,16,120,128,128,112,8,8,240,5,8, - 8,6,0,0,16,32,0,112,128,112,8,240,5,8,8,6, - 0,0,32,248,8,16,32,64,128,248,5,8,8,6,0,0, - 16,32,0,248,16,32,64,248,5,7,7,6,0,0,248,8, - 16,248,64,128,248,5,8,8,6,0,0,48,48,0,248,16, - 32,64,248,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,1,7,7, - 6,2,0,128,0,128,128,128,128,128,5,7,7,6,0,0, - 32,112,168,160,168,112,32,5,7,7,6,0,0,48,64,64, - 224,64,80,168,5,5,5,6,0,0,136,112,80,112,136,5, - 7,7,6,0,0,136,80,32,248,32,248,32,1,7,7,6, - 2,0,128,128,128,0,128,128,128,5,8,8,6,0,0,48, - 72,32,80,80,32,144,96,3,1,1,6,1,7,160,5,7, - 7,6,0,0,248,136,184,184,184,136,248,5,7,7,6,0, - 1,112,8,120,136,120,0,248,5,5,5,6,0,1,40,80, - 160,80,40,5,3,3,6,0,1,248,8,8,2,2,2,6, - 2,6,64,128,5,7,7,6,0,0,248,136,168,136,152,168, - 248,5,1,1,6,0,6,248,4,4,4,6,0,3,96,144, - 144,96,5,7,7,6,0,0,32,32,248,32,32,0,248,4, - 5,5,6,0,3,96,144,32,64,240,3,5,5,6,0,3, - 224,32,224,32,224,2,2,2,6,2,6,64,128,5,8,8, - 6,0,255,136,136,136,136,152,232,128,128,5,7,7,6,0, - 0,120,152,152,120,24,24,24,2,2,2,6,2,2,192,192, - 2,2,2,6,2,255,64,128,3,5,5,6,0,3,64,192, - 64,64,224,5,7,7,6,0,1,112,136,136,136,112,0,248, - 5,5,5,6,0,1,160,80,40,80,160,5,7,7,6,0, - 0,136,144,168,88,184,8,8,5,7,7,6,0,0,136,144, - 184,72,152,32,56,5,8,8,6,0,0,192,64,192,72,216, - 56,8,8,5,7,7,6,0,0,32,0,32,64,128,136,112, - 5,8,8,6,0,0,64,32,0,112,136,248,136,136,5,8, - 8,6,0,0,16,32,0,112,136,248,136,136,5,8,8,6, - 0,0,32,80,0,112,136,248,136,136,5,8,8,6,0,0, - 104,144,0,112,136,248,136,136,5,8,8,6,0,0,80,0, - 112,136,136,248,136,136,5,8,8,6,0,0,32,80,32,112, - 136,248,136,136,5,7,7,6,0,0,56,96,160,184,224,160, - 184,5,8,8,6,0,255,112,136,128,128,136,112,32,96,5, - 8,8,6,0,0,64,32,0,248,128,240,128,248,5,8,8, - 6,0,0,8,16,0,248,128,240,128,248,5,8,8,6,0, - 0,32,80,0,248,128,240,128,248,5,7,7,6,0,0,80, - 0,248,128,240,128,248,3,8,8,6,1,0,128,64,0,224, - 64,64,64,224,3,8,8,6,1,0,32,64,0,224,64,64, - 64,224,3,8,8,6,1,0,64,160,0,224,64,64,64,224, - 3,7,7,6,1,0,160,0,224,64,64,64,224,5,7,7, - 6,0,0,112,72,72,232,72,72,112,5,8,8,6,0,0, - 104,144,0,136,200,168,152,136,5,8,8,6,0,0,64,32, - 112,136,136,136,136,112,5,8,8,6,0,0,16,32,112,136, - 136,136,136,112,5,8,8,6,0,0,32,80,0,112,136,136, - 136,112,5,8,8,6,0,0,104,144,0,112,136,136,136,112, - 5,8,8,6,0,0,80,0,112,136,136,136,136,112,5,5, - 5,6,0,1,136,80,32,80,136,5,8,8,6,0,255,16, - 112,168,168,168,168,112,64,5,8,8,6,0,0,64,32,136, - 136,136,136,136,112,5,8,8,6,0,0,16,32,136,136,136, - 136,136,112,5,8,8,6,0,0,32,80,0,136,136,136,136, - 112,5,8,8,6,0,0,80,0,136,136,136,136,136,112,5, - 8,8,6,0,0,16,32,136,80,32,32,32,32,5,9,9, - 6,0,255,192,64,112,72,72,112,64,64,224,4,8,8,6, - 1,255,96,144,144,160,144,144,224,128,5,8,8,6,0,0, - 64,32,0,112,8,120,136,120,5,8,8,6,0,0,16,32, - 0,112,8,120,136,120,5,8,8,6,0,0,32,80,0,112, - 8,120,136,120,5,8,8,6,0,0,104,144,0,112,8,120, - 136,120,5,7,7,6,0,0,80,0,112,8,120,136,120,5, - 8,8,6,0,0,32,80,32,112,8,120,136,120,5,6,6, - 6,0,0,208,40,120,160,168,80,5,6,6,6,0,255,112, - 128,136,112,32,96,5,8,8,6,0,0,64,32,0,112,136, - 248,128,112,5,8,8,6,0,0,16,32,0,112,136,248,128, - 112,5,8,8,6,0,0,32,80,0,112,136,248,128,112,5, - 7,7,6,0,0,80,0,112,136,248,128,112,3,8,8,6, - 1,0,128,64,0,64,192,64,64,224,3,8,8,6,1,0, - 32,64,0,64,192,64,64,224,3,8,8,6,1,0,64,160, - 0,64,192,64,64,224,3,7,7,6,1,0,160,0,64,192, - 64,64,224,5,7,7,6,0,0,160,64,160,16,120,136,112, - 5,8,8,6,0,0,104,144,0,176,200,136,136,136,5,8, - 8,6,0,0,64,32,0,112,136,136,136,112,5,8,8,6, - 0,0,16,32,0,112,136,136,136,112,5,8,8,6,0,0, - 32,80,0,112,136,136,136,112,5,8,8,6,0,0,104,144, - 0,112,136,136,136,112,5,7,7,6,0,0,80,0,112,136, - 136,136,112,5,5,5,6,0,1,32,0,248,0,32,5,7, - 7,6,0,255,16,112,168,168,168,112,64,5,8,8,6,0, - 0,64,32,0,136,136,136,152,104,5,8,8,6,0,0,16, - 32,0,136,136,136,152,104,5,8,8,6,0,0,32,80,0, - 136,136,136,152,104,5,7,7,6,0,0,80,0,136,136,136, - 152,104,5,9,9,6,0,255,16,32,0,136,136,136,248,8, - 112,4,7,7,6,1,255,192,64,96,80,96,64,224,5,8, - 8,6,0,255,80,0,136,136,136,120,8,112}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_tr.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_tr.h deleted file mode 100644 index e32f59f958..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_1_tr.h +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/* - Fontname: ISO10646-1-tr - Copyright: public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_TR[2591] U8G_SECTION(".progmem.ISO10646_TR") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,7, - 7,6,0,0,32,112,168,160,168,112,32,5,7,7,6,0, - 0,48,64,64,224,64,80,168,5,5,5,6,0,0,136,112, - 80,112,136,5,7,7,6,0,0,136,80,32,248,32,248,32, - 1,7,7,6,2,0,128,128,128,0,128,128,128,5,8,8, - 6,0,0,48,72,32,80,80,32,144,96,3,1,1,6,1, - 7,160,5,7,7,6,0,0,248,136,184,184,184,136,248,5, - 7,7,6,0,1,112,8,120,136,120,0,248,5,5,5,6, - 0,1,40,80,160,80,40,5,3,3,6,0,1,248,8,8, - 2,2,2,6,2,6,64,128,5,7,7,6,0,0,248,136, - 168,136,152,168,248,5,1,1,6,0,6,248,4,4,4,6, - 0,3,96,144,144,96,5,7,7,6,0,0,32,32,248,32, - 32,0,248,4,5,5,6,0,3,96,144,32,64,240,3,5, - 5,6,0,3,224,32,224,32,224,2,2,2,6,2,6,64, - 128,5,8,8,6,0,255,136,136,136,136,152,232,128,128,5, - 7,7,6,0,0,120,152,152,120,24,24,24,2,2,2,6, - 2,2,192,192,2,2,2,6,2,255,64,128,3,5,5,6, - 0,3,64,192,64,64,224,5,7,7,6,0,1,112,136,136, - 136,112,0,248,5,5,5,6,0,1,160,80,40,80,160,5, - 7,7,6,0,0,136,144,168,88,184,8,8,5,7,7,6, - 0,0,136,144,184,72,152,32,56,5,8,8,6,0,0,192, - 64,192,72,216,56,8,8,5,7,7,6,0,0,32,0,32, - 64,128,136,112,5,8,8,6,0,0,64,32,0,112,136,248, - 136,136,5,8,8,6,0,0,16,32,0,112,136,248,136,136, - 5,8,8,6,0,0,32,80,0,112,136,248,136,136,5,8, - 8,6,0,0,104,144,0,112,136,248,136,136,5,8,8,6, - 0,0,80,0,112,136,136,248,136,136,5,8,8,6,0,0, - 32,80,32,112,136,248,136,136,5,7,7,6,0,0,56,96, - 160,184,224,160,184,5,8,8,6,0,255,112,136,128,128,136, - 112,32,96,5,8,8,6,0,0,64,32,0,248,128,240,128, - 248,5,8,8,6,0,0,8,16,0,248,128,240,128,248,5, - 8,8,6,0,0,32,80,0,248,128,240,128,248,5,7,7, - 6,0,0,80,0,248,128,240,128,248,3,8,8,6,1,0, - 128,64,0,224,64,64,64,224,3,8,8,6,1,0,32,64, - 0,224,64,64,64,224,3,8,8,6,1,0,64,160,0,224, - 64,64,64,224,3,7,7,6,1,0,160,0,224,64,64,64, - 224,5,9,9,6,0,255,80,32,112,136,128,184,136,136,112, - 5,8,8,6,0,0,104,144,0,136,200,168,152,136,5,8, - 8,6,0,0,64,32,112,136,136,136,136,112,5,8,8,6, - 0,0,16,32,112,136,136,136,136,112,5,8,8,6,0,0, - 32,80,0,112,136,136,136,112,5,8,8,6,0,0,104,144, - 0,112,136,136,136,112,5,8,8,6,0,0,80,0,112,136, - 136,136,136,112,5,5,5,6,0,1,136,80,32,80,136,5, - 8,8,6,0,255,16,112,168,168,168,168,112,64,5,8,8, - 6,0,0,64,32,136,136,136,136,136,112,5,8,8,6,0, - 0,16,32,136,136,136,136,136,112,5,8,8,6,0,0,32, - 80,0,136,136,136,136,112,5,8,8,6,0,0,80,0,136, - 136,136,136,136,112,1,7,7,6,2,0,128,0,128,128,128, - 128,128,5,9,9,6,0,255,120,128,128,112,8,8,240,32, - 96,4,8,8,6,1,255,96,144,144,160,144,144,224,128,5, - 8,8,6,0,0,64,32,0,112,8,120,136,120,5,8,8, - 6,0,0,16,32,0,112,8,120,136,120,5,8,8,6,0, - 0,32,80,0,112,8,120,136,120,5,8,8,6,0,0,104, - 144,0,112,8,120,136,120,5,7,7,6,0,0,80,0,112, - 8,120,136,120,5,8,8,6,0,0,32,80,32,112,8,120, - 136,120,5,6,6,6,0,0,208,40,120,160,168,80,5,7, - 7,6,0,255,112,128,128,136,112,32,96,5,8,8,6,0, - 0,64,32,0,112,136,248,128,112,5,8,8,6,0,0,16, - 32,0,112,136,248,128,112,5,8,8,6,0,0,32,80,0, - 112,136,248,128,112,5,7,7,6,0,0,80,0,112,136,248, - 128,112,3,8,8,6,1,0,128,64,0,64,192,64,64,224, - 3,8,8,6,1,0,32,64,0,64,192,64,64,224,3,8, - 8,6,1,0,64,160,0,64,192,64,64,224,3,7,7,6, - 1,0,160,0,64,192,64,64,224,5,8,8,6,0,255,80, - 32,112,136,136,120,8,112,5,8,8,6,0,0,104,144,0, - 176,200,136,136,136,5,8,8,6,0,0,64,32,0,112,136, - 136,136,112,5,8,8,6,0,0,16,32,0,112,136,136,136, - 112,5,8,8,6,0,0,32,80,0,112,136,136,136,112,5, - 8,8,6,0,0,104,144,0,112,136,136,136,112,5,7,7, - 6,0,0,80,0,112,136,136,136,112,5,5,5,6,0,1, - 32,0,248,0,32,5,7,7,6,0,255,16,112,168,168,168, - 112,64,5,8,8,6,0,0,64,32,0,136,136,136,152,104, - 5,8,8,6,0,0,16,32,0,136,136,136,152,104,5,8, - 8,6,0,0,32,80,0,136,136,136,152,104,5,7,7,6, - 0,0,80,0,136,136,136,152,104,1,5,5,6,2,0,128, - 128,128,128,128,5,7,7,6,0,255,112,128,112,8,240,32, - 96,5,8,8,6,0,255,80,0,136,136,136,120,8,112}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h deleted file mode 100644 index 75e779fd0f..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_5_Cyrillic.h +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_5_Cyrillic - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_5_Cyrillic_5x7[2560] U8G_SECTION(".progmem.ISO10646_5_Cyrillic_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 32, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, - 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, - 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, - 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, - 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, - 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, - 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, - 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, - 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, - 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, - 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, - 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, - 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, - 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, - 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, - 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, - 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, - 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, - 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, - 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, - 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, - 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, - 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, 6, - 0, 3, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, 8, 8, 6, 0, 0, - 64, 248, 128, 128, 240, 128, 128, 248, 5, 8, 8, 6, 0, 0, 80, 248, - 128, 128, 240, 128, 128, 248, 5, 7, 7, 6, 0, 0, 224, 64, 64, 112, - 72, 72, 112, 5, 8, 8, 6, 0, 0, 16, 32, 248, 136, 128, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 48, 72, 128, 224, 128, 72, 48, 5, 7, - 7, 6, 0, 0, 112, 136, 128, 112, 8, 136, 112, 3, 7, 7, 6, 1, - 0, 224, 64, 64, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 160, 0, - 224, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 160, 160, 160, 184, 168, 168, 184, - 5, 7, 7, 6, 0, 0, 160, 160, 160, 248, 168, 168, 184, 4, 7, 7, - 6, 0, 0, 224, 64, 112, 80, 80, 80, 80, 5, 8, 8, 6, 0, 0, - 16, 32, 136, 144, 160, 224, 144, 136, 5, 8, 8, 6, 0, 0, 64, 32, - 136, 152, 168, 200, 136, 136, 5, 9, 9, 6, 0, 255, 80, 32, 136, 136, - 136, 80, 32, 32, 32, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 136, - 136, 248, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, - 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 136, 136, 240, 5, 7, 7, - 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, 0, - 248, 136, 128, 128, 128, 128, 128, 5, 8, 8, 6, 0, 255, 120, 40, 40, - 40, 72, 136, 248, 136, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 168, 168, 168, 112, 168, 168, 168, 5, - 7, 7, 6, 0, 0, 240, 8, 8, 112, 8, 8, 240, 5, 7, 7, 6, - 0, 0, 136, 136, 152, 168, 200, 136, 136, 5, 8, 8, 6, 0, 0, 80, - 32, 136, 152, 168, 168, 200, 136, 5, 7, 7, 6, 0, 0, 136, 144, 160, - 192, 160, 144, 136, 5, 7, 7, 6, 0, 0, 120, 40, 40, 40, 40, 168, - 72, 5, 7, 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 112, 136, 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 136, - 136, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, - 7, 7, 6, 0, 0, 248, 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 80, 32, 64, 128, 5, 7, 7, 6, 0, 0, 32, - 112, 168, 168, 168, 112, 32, 5, 7, 7, 6, 0, 0, 136, 136, 80, 32, - 80, 136, 136, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 136, 136, 248, - 8, 5, 7, 7, 6, 0, 0, 136, 136, 136, 152, 104, 8, 8, 5, 7, - 7, 6, 0, 0, 168, 168, 168, 168, 168, 168, 248, 5, 8, 8, 6, 0, - 255, 168, 168, 168, 168, 168, 168, 248, 8, 5, 7, 7, 6, 0, 0, 192, - 64, 64, 112, 72, 72, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 200, - 168, 168, 200, 5, 7, 7, 6, 0, 0, 128, 128, 128, 240, 136, 136, 240, - 5, 7, 7, 6, 0, 0, 112, 136, 8, 56, 8, 136, 112, 5, 7, 7, - 6, 0, 0, 144, 168, 168, 232, 168, 168, 144, 5, 7, 7, 6, 0, 0, - 120, 136, 136, 120, 40, 72, 136, 5, 5, 5, 6, 0, 0, 112, 8, 120, - 136, 120, 5, 7, 7, 6, 0, 0, 24, 96, 128, 240, 136, 136, 112, 4, - 5, 5, 6, 0, 0, 224, 144, 224, 144, 224, 5, 5, 5, 6, 0, 0, - 248, 136, 128, 128, 128, 5, 6, 6, 6, 0, 255, 120, 40, 72, 136, 248, - 136, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 5, 5, 6, - 0, 0, 168, 168, 112, 168, 168, 5, 5, 5, 6, 0, 0, 240, 8, 48, - 8, 240, 5, 5, 5, 6, 0, 0, 136, 152, 168, 200, 136, 5, 7, 7, - 6, 0, 0, 80, 32, 136, 152, 168, 200, 136, 4, 5, 5, 6, 0, 0, - 144, 160, 192, 160, 144, 5, 5, 5, 6, 0, 0, 248, 40, 40, 168, 72, - 5, 5, 5, 6, 0, 0, 136, 216, 168, 136, 136, 5, 5, 5, 6, 0, - 0, 136, 136, 248, 136, 136, 5, 5, 5, 6, 0, 0, 112, 136, 136, 136, - 112, 5, 5, 5, 6, 0, 0, 248, 136, 136, 136, 136, 5, 6, 6, 6, - 0, 255, 240, 136, 136, 240, 128, 128, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 5, 5, 6, 0, 0, 248, 32, 32, 32, 32, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 6, 6, 6, 0, 0, - 32, 112, 168, 168, 112, 32, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, - 136, 5, 6, 6, 6, 0, 255, 136, 136, 136, 136, 248, 8, 5, 5, 5, - 6, 0, 0, 136, 136, 248, 8, 8, 5, 5, 5, 6, 0, 0, 168, 168, - 168, 168, 248, 5, 6, 6, 6, 0, 255, 168, 168, 168, 168, 248, 8, 5, - 5, 5, 6, 0, 0, 192, 64, 112, 72, 112, 5, 5, 5, 6, 0, 0, - 136, 136, 200, 168, 200, 3, 5, 5, 6, 1, 0, 128, 128, 192, 160, 192, - 5, 5, 5, 6, 0, 0, 112, 136, 56, 136, 112, 5, 5, 5, 6, 0, - 0, 144, 168, 232, 168, 144, 5, 5, 5, 6, 0, 0, 120, 136, 120, 40, - 72, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248, 128, 112, 5, - 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112, 5, 9, 9, 6, - 0, 255, 64, 224, 64, 64, 120, 72, 72, 72, 16, 5, 8, 8, 6, 0, - 0, 16, 32, 0, 248, 136, 128, 128, 128, 5, 5, 5, 6, 0, 0, 112, - 136, 96, 136, 112, 5, 5, 5, 6, 0, 0, 112, 128, 112, 8, 240, 1, - 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 7, 7, 6, - 1, 0, 160, 0, 64, 64, 64, 64, 64, 3, 8, 8, 6, 1, 255, 32, - 0, 32, 32, 32, 32, 160, 64, 5, 5, 5, 6, 0, 0, 160, 160, 184, - 168, 184, 5, 5, 5, 6, 0, 0, 160, 160, 248, 168, 184, 5, 6, 6, - 6, 0, 0, 64, 224, 64, 120, 72, 72, 4, 8, 8, 6, 0, 0, 16, - 32, 0, 144, 160, 192, 160, 144, 5, 8, 8, 6, 0, 0, 64, 32, 0, - 136, 152, 168, 200, 136, 5, 9, 9, 6, 0, 255, 80, 32, 0, 136, 136, - 136, 120, 8, 112, 5, 6, 6, 6, 0, 255, 136, 136, 136, 136, 248, 32 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CN.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CN.h deleted file mode 100644 index 11fdb2240b..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CN.h +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_CN - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w=11 h=11 x= 2 y=10 dx=12 dy= 0 ascent=10 len=22 - Font Bounding box w=12 h=11 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent =10 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_CN[4105] U8G_SECTION(".progmem.ISO10646_CN") = { - 0, 12, 11, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 10, 255, 7, - 255, 0, 0, 0, 6, 0, 10, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 0, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168, - 168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, - 0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240, - 136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, - 5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, - 6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, - 128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, - 16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, - 136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, - 7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, - 0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, - 136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, - 128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, - 7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, - 0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, - 32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, - 136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, - 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, - 6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 64, 128, 248, 3, 7, 7, 6, 0, 0, 224, 128, 128, 128, 128, 128, - 224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, - 0, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, - 80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, - 64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, - 0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, - 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, - 120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, - 0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, - 136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, - 136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, - 8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, - 6, 1, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, - 192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, - 168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, - 6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, - 136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, - 5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, - 0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64, - 64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, - 5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, - 136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, - 6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, - 0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, - 64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, - 3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, - 6, 0, 3, 104, 144, 0, 0, 0, 6, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, - 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, - 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, 12, 0, 10, 0, 0, 0, - 12, 0, 10, 0, 0, 0, 12, 0, 10, 11, 11, 22, 12, 0, 255, 255, - 224, 2, 0, 2, 0, 4, 0, 13, 0, 20, 128, 36, 64, 196, 32, 4, - 0, 4, 0, 4, 0, 11, 11, 22, 12, 0, 255, 249, 0, 138, 0, 171, - 224, 172, 64, 170, 64, 170, 64, 170, 64, 170, 128, 33, 0, 82, 128, 140, - 96, 11, 11, 22, 12, 0, 255, 36, 0, 36, 0, 63, 128, 68, 0, 132, - 0, 4, 0, 255, 224, 10, 0, 17, 0, 32, 128, 192, 96, 11, 11, 22, - 12, 0, 255, 36, 0, 36, 0, 63, 192, 68, 0, 4, 0, 255, 224, 9, - 0, 9, 0, 17, 32, 33, 32, 64, 224, 11, 11, 22, 12, 0, 255, 32, - 0, 61, 224, 81, 32, 145, 32, 17, 32, 255, 32, 17, 32, 41, 32, 37, - 224, 69, 32, 128, 0, 11, 11, 22, 12, 0, 255, 32, 128, 127, 192, 8, - 64, 255, 224, 17, 0, 32, 128, 95, 64, 128, 32, 63, 128, 0, 0, 127, - 192, 11, 11, 22, 12, 0, 255, 34, 64, 71, 224, 148, 128, 228, 128, 47, - 224, 68, 128, 244, 128, 7, 224, 52, 128, 196, 128, 7, 224, 11, 11, 22, - 12, 0, 255, 4, 128, 143, 224, 73, 0, 25, 0, 47, 192, 9, 0, 9, - 0, 47, 192, 73, 0, 137, 0, 15, 224, 11, 11, 22, 12, 0, 255, 16, - 0, 63, 128, 81, 0, 14, 0, 49, 128, 192, 96, 63, 128, 36, 128, 63, - 128, 36, 128, 63, 128, 11, 11, 22, 12, 0, 255, 34, 128, 250, 64, 7, - 224, 250, 128, 138, 128, 138, 128, 250, 128, 34, 128, 178, 128, 170, 160, 100, - 224, 11, 11, 22, 12, 0, 255, 34, 32, 71, 64, 146, 128, 239, 224, 34, - 0, 71, 192, 236, 64, 7, 192, 52, 64, 199, 192, 4, 64, 11, 11, 22, - 12, 0, 255, 8, 0, 15, 192, 8, 0, 8, 0, 255, 224, 8, 0, 14, - 0, 9, 128, 8, 64, 8, 0, 8, 0, 10, 11, 22, 12, 0, 255, 255, - 128, 0, 128, 0, 128, 128, 128, 128, 128, 255, 128, 128, 0, 128, 0, 128, - 64, 128, 64, 127, 192, 11, 11, 22, 12, 0, 255, 71, 192, 65, 0, 239, - 224, 65, 0, 69, 0, 105, 96, 201, 32, 77, 96, 73, 32, 79, 224, 200, - 32, 11, 11, 22, 12, 0, 255, 8, 0, 4, 0, 4, 0, 10, 0, 10, - 0, 10, 0, 17, 0, 17, 0, 32, 128, 64, 64, 128, 32, 11, 11, 22, - 12, 0, 255, 34, 64, 34, 0, 247, 224, 34, 0, 35, 224, 53, 32, 229, - 32, 37, 64, 40, 128, 41, 64, 114, 32, 11, 10, 20, 12, 0, 0, 68, - 64, 68, 64, 68, 64, 127, 192, 4, 0, 4, 0, 132, 32, 132, 32, 132, - 32, 255, 224, 11, 11, 22, 12, 0, 255, 4, 0, 0, 0, 127, 192, 4, - 0, 4, 0, 4, 0, 127, 192, 4, 0, 4, 0, 4, 0, 255, 224, 11, - 11, 22, 12, 0, 255, 255, 224, 17, 0, 1, 192, 254, 0, 72, 128, 37, - 0, 4, 0, 255, 224, 21, 0, 36, 128, 196, 96, 11, 11, 22, 12, 0, - 255, 17, 0, 127, 192, 68, 64, 127, 192, 68, 64, 127, 192, 4, 0, 255, - 224, 4, 0, 4, 0, 4, 0, 9, 11, 22, 12, 0, 255, 16, 0, 255, - 128, 128, 128, 128, 128, 255, 128, 128, 128, 128, 128, 255, 128, 128, 128, 128, - 128, 255, 128, 11, 11, 22, 12, 0, 255, 113, 0, 1, 0, 3, 224, 249, - 32, 33, 32, 65, 32, 81, 32, 137, 32, 250, 32, 2, 32, 4, 192, 11, - 11, 22, 12, 0, 255, 127, 192, 17, 0, 17, 0, 17, 0, 17, 0, 255, - 224, 17, 0, 17, 0, 33, 0, 33, 0, 65, 0, 11, 11, 22, 12, 0, - 255, 33, 0, 34, 0, 244, 64, 87, 224, 80, 32, 87, 192, 148, 64, 84, - 64, 36, 64, 87, 192, 148, 64, 11, 11, 22, 12, 0, 255, 17, 0, 10, - 0, 127, 192, 4, 0, 4, 0, 255, 224, 4, 0, 10, 0, 17, 0, 32, - 128, 192, 96, 10, 11, 22, 12, 0, 255, 95, 192, 0, 64, 132, 64, 132, - 64, 191, 64, 132, 64, 140, 64, 148, 64, 164, 64, 140, 64, 129, 192, 11, - 11, 22, 12, 0, 255, 36, 0, 39, 192, 36, 0, 36, 0, 255, 224, 0, - 0, 20, 64, 36, 128, 71, 0, 12, 0, 112, 0, 11, 11, 22, 12, 0, - 255, 36, 128, 4, 128, 15, 192, 228, 128, 36, 128, 63, 224, 36, 128, 36, - 128, 40, 128, 80, 0, 143, 224, 11, 11, 22, 12, 0, 255, 8, 0, 8, - 0, 255, 128, 136, 128, 136, 128, 255, 128, 136, 128, 136, 128, 255, 160, 136, - 32, 7, 224, 11, 11, 22, 12, 0, 255, 39, 128, 36, 128, 244, 128, 36, - 128, 116, 128, 108, 128, 164, 128, 36, 128, 36, 160, 40, 160, 48, 96, 10, - 11, 22, 12, 0, 255, 255, 192, 128, 64, 128, 64, 158, 64, 146, 64, 146, - 64, 158, 64, 128, 64, 128, 64, 255, 192, 128, 64, 11, 11, 22, 12, 0, - 255, 127, 192, 68, 0, 95, 192, 80, 64, 95, 192, 80, 64, 95, 192, 66, - 0, 74, 128, 82, 64, 166, 32, 11, 11, 22, 12, 0, 255, 4, 0, 7, - 224, 4, 0, 127, 192, 64, 64, 64, 64, 64, 64, 127, 192, 0, 0, 82, - 64, 137, 32, 11, 11, 22, 12, 0, 255, 71, 128, 36, 128, 4, 128, 4, - 128, 232, 96, 32, 0, 47, 192, 36, 64, 34, 128, 49, 0, 38, 192, 11, - 11, 22, 12, 0, 255, 127, 192, 74, 64, 127, 192, 4, 0, 255, 224, 4, - 0, 63, 128, 32, 128, 36, 128, 36, 128, 255, 224, 11, 11, 22, 12, 0, - 255, 34, 0, 79, 224, 72, 32, 79, 224, 200, 0, 79, 224, 74, 160, 90, - 160, 111, 224, 74, 160, 72, 96, 11, 11, 22, 12, 0, 255, 243, 192, 36, - 64, 42, 128, 241, 0, 34, 128, 101, 224, 114, 32, 165, 64, 32, 128, 35, - 0, 44, 0, 11, 11, 22, 12, 0, 255, 4, 0, 255, 224, 128, 32, 0, - 0, 255, 224, 4, 0, 36, 0, 39, 192, 36, 0, 84, 0, 143, 224, 11, - 11, 22, 12, 0, 255, 115, 224, 16, 128, 81, 0, 35, 224, 250, 32, 42, - 160, 34, 160, 34, 160, 32, 128, 33, 64, 98, 32, 11, 11, 22, 12, 0, - 255, 34, 0, 247, 128, 34, 128, 54, 128, 226, 160, 37, 160, 36, 96, 104, - 32, 0, 0, 82, 64, 137, 32, 11, 11, 22, 12, 0, 255, 115, 192, 66, - 0, 66, 0, 123, 224, 74, 64, 74, 64, 122, 64, 74, 64, 66, 64, 68, - 64, 136, 64, 11, 11, 22, 12, 0, 255, 8, 0, 255, 224, 8, 0, 31, - 192, 48, 64, 95, 192, 144, 64, 31, 192, 16, 64, 16, 64, 16, 192, 11, - 11, 22, 12, 0, 255, 2, 0, 127, 224, 66, 0, 66, 0, 95, 192, 66, - 0, 71, 0, 74, 128, 82, 64, 98, 32, 130, 0, 11, 11, 22, 12, 0, - 255, 243, 192, 150, 64, 145, 128, 166, 96, 161, 0, 151, 192, 145, 0, 149, - 0, 231, 224, 129, 0, 129, 0, 11, 11, 22, 12, 0, 255, 15, 128, 136, - 128, 79, 128, 8, 128, 143, 128, 64, 0, 31, 192, 53, 64, 85, 64, 149, - 64, 63, 224, 11, 11, 22, 12, 0, 255, 39, 224, 32, 128, 248, 128, 32, - 128, 32, 128, 56, 128, 224, 128, 32, 128, 32, 128, 32, 128, 97, 128, 11, - 11, 22, 12, 0, 255, 31, 224, 145, 0, 87, 192, 20, 64, 23, 192, 148, - 64, 87, 192, 17, 0, 85, 64, 153, 32, 35, 0, 11, 11, 22, 12, 0, - 255, 32, 128, 39, 224, 242, 64, 33, 128, 34, 64, 52, 32, 226, 64, 34, - 64, 34, 64, 34, 64, 100, 64, 11, 11, 22, 12, 0, 255, 65, 0, 65, - 0, 79, 224, 233, 32, 73, 32, 73, 32, 111, 224, 201, 32, 73, 32, 73, - 32, 207, 224, 11, 11, 22, 12, 0, 255, 33, 0, 241, 0, 79, 224, 169, - 32, 249, 32, 47, 224, 57, 32, 233, 32, 41, 32, 47, 224, 40, 32, 11, - 11, 22, 12, 0, 255, 143, 224, 73, 32, 9, 32, 203, 160, 73, 32, 79, - 224, 72, 32, 75, 160, 74, 160, 107, 160, 80, 224, 11, 11, 22, 12, 0, - 255, 127, 192, 4, 0, 68, 64, 36, 64, 36, 128, 4, 0, 255, 224, 4, - 0, 4, 0, 4, 0, 4, 0, 11, 11, 22, 12, 0, 255, 130, 0, 66, - 0, 31, 224, 194, 0, 95, 192, 82, 64, 95, 192, 71, 0, 74, 128, 82, - 64, 191, 224, 11, 11, 22, 12, 0, 255, 4, 0, 127, 224, 72, 128, 127, - 224, 72, 128, 79, 128, 64, 0, 95, 192, 72, 64, 71, 128, 152, 96, 11, - 11, 22, 12, 0, 255, 1, 0, 239, 224, 161, 0, 164, 64, 175, 224, 164, - 64, 175, 224, 169, 32, 233, 32, 2, 128, 12, 96, 11, 11, 22, 12, 0, - 255, 20, 192, 246, 160, 188, 96, 167, 128, 168, 128, 191, 224, 169, 32, 239, - 224, 9, 32, 15, 224, 9, 32, 11, 11, 22, 12, 0, 255, 127, 128, 64, - 128, 66, 128, 98, 128, 84, 128, 72, 128, 72, 128, 84, 160, 98, 160, 64, - 96, 128, 32, 11, 11, 22, 12, 0, 255, 4, 0, 127, 224, 64, 32, 127, - 224, 64, 0, 125, 224, 84, 32, 76, 160, 84, 96, 100, 160, 141, 96, 11, - 11, 22, 12, 0, 255, 130, 0, 95, 224, 4, 0, 8, 64, 159, 224, 64, - 32, 10, 128, 10, 128, 74, 160, 146, 160, 34, 96, 11, 11, 22, 12, 0, - 255, 65, 0, 79, 224, 232, 32, 66, 128, 68, 64, 104, 32, 199, 192, 65, - 0, 65, 0, 65, 0, 207, 224, 11, 11, 22, 12, 0, 255, 80, 32, 125, - 32, 145, 32, 255, 32, 17, 32, 125, 32, 85, 32, 85, 32, 84, 32, 92, - 32, 16, 224, 11, 11, 22, 12, 0, 255, 63, 128, 32, 128, 63, 128, 32, - 128, 255, 224, 72, 0, 123, 192, 73, 64, 121, 64, 72, 128, 251, 96, 11, - 11, 22, 12, 0, 255, 4, 0, 4, 0, 4, 0, 36, 128, 36, 64, 68, - 64, 68, 32, 132, 32, 4, 0, 4, 0, 28, 0, 11, 11, 22, 12, 0, - 255, 4, 0, 4, 0, 4, 0, 255, 224, 4, 0, 10, 0, 10, 0, 17, - 0, 17, 0, 32, 128, 192, 96, 9, 10, 20, 10, 0, 0, 136, 128, 73, - 0, 8, 0, 255, 128, 0, 128, 0, 128, 127, 128, 0, 128, 0, 128, 255, - 128, 11, 11, 22, 12, 0, 255, 33, 0, 18, 0, 255, 224, 0, 0, 120, - 128, 74, 128, 122, 128, 74, 128, 122, 128, 72, 128, 89, 128, 11, 11, 22, - 12, 0, 255, 39, 192, 0, 0, 0, 0, 239, 224, 33, 0, 34, 0, 36, - 64, 47, 224, 32, 32, 80, 0, 143, 224, 11, 11, 22, 12, 0, 255, 32, - 128, 39, 0, 249, 0, 33, 192, 119, 0, 33, 0, 249, 224, 39, 0, 113, - 32, 169, 32, 32, 224, 11, 11, 22, 12, 0, 255, 16, 64, 16, 64, 253, - 224, 16, 64, 56, 192, 53, 64, 82, 64, 148, 64, 16, 64, 16, 64, 16, - 192, 11, 11, 22, 12, 0, 255, 0, 64, 248, 64, 11, 224, 8, 64, 136, - 64, 82, 64, 81, 64, 33, 64, 80, 64, 72, 64, 137, 192, 10, 11, 22, - 12, 0, 255, 132, 0, 132, 64, 132, 128, 245, 0, 134, 0, 132, 0, 132, - 0, 148, 0, 164, 64, 196, 64, 131, 192, 11, 11, 22, 12, 0, 255, 17, - 32, 125, 0, 17, 0, 255, 224, 41, 0, 253, 64, 73, 64, 124, 128, 8, - 160, 253, 96, 10, 32, 11, 11, 22, 12, 0, 255, 23, 192, 36, 64, 36, - 64, 103, 192, 161, 0, 47, 224, 33, 0, 35, 128, 37, 64, 41, 32, 33, - 0, 11, 11, 22, 12, 0, 255, 8, 0, 255, 224, 16, 0, 39, 192, 32, - 128, 97, 0, 175, 224, 33, 0, 33, 0, 33, 0, 35, 0, 11, 11, 22, - 12, 0, 255, 36, 0, 47, 224, 180, 0, 164, 128, 164, 160, 170, 192, 42, - 128, 40, 128, 41, 64, 50, 64, 36, 32, 11, 11, 22, 12, 0, 255, 127, - 224, 128, 0, 63, 192, 32, 64, 63, 192, 16, 0, 31, 192, 16, 64, 40, - 128, 71, 0, 56, 224, 11, 11, 22, 12, 0, 255, 127, 224, 64, 0, 64, - 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 128, - 0, 11, 11, 22, 12, 0, 255, 255, 224, 4, 0, 127, 192, 68, 64, 127, - 192, 68, 64, 127, 192, 68, 0, 36, 0, 24, 0, 231, 224, 11, 11, 22, - 12, 0, 255, 17, 224, 253, 0, 69, 0, 41, 224, 253, 64, 17, 64, 125, - 64, 17, 64, 85, 64, 146, 64, 52, 64, 11, 11, 22, 12, 0, 255, 33, - 0, 95, 224, 64, 0, 207, 192, 64, 0, 79, 192, 64, 0, 79, 192, 72, - 64, 79, 192, 72, 64, 11, 11, 22, 12, 0, 255, 4, 0, 127, 192, 64, - 64, 127, 192, 64, 64, 127, 192, 64, 64, 127, 192, 4, 64, 82, 32, 191, - 160, 11, 11, 22, 12, 0, 255, 127, 192, 68, 64, 127, 192, 68, 64, 127, - 192, 4, 0, 27, 0, 224, 224, 17, 0, 17, 0, 97, 0, 11, 11, 22, - 12, 0, 255, 255, 224, 4, 0, 8, 0, 127, 224, 73, 32, 79, 32, 73, - 32, 79, 32, 73, 32, 73, 32, 127, 224, 11, 11, 22, 12, 0, 255, 253, - 224, 86, 64, 121, 64, 56, 128, 85, 64, 146, 32, 255, 224, 4, 0, 39, - 192, 36, 0, 255, 224, 11, 11, 22, 12, 0, 255, 251, 128, 82, 0, 123, - 224, 18, 64, 250, 64, 20, 64, 63, 128, 32, 128, 63, 128, 32, 128, 63, - 128, 11, 11, 22, 12, 0, 255, 31, 224, 32, 0, 39, 192, 100, 64, 167, - 192, 32, 0, 47, 224, 40, 32, 39, 192, 33, 0, 35, 0, 11, 11, 22, - 12, 0, 255, 243, 224, 130, 32, 130, 32, 250, 32, 130, 32, 130, 32, 138, - 32, 178, 32, 194, 224, 2, 0, 2, 0, 11, 11, 22, 12, 0, 255, 36, - 128, 70, 160, 149, 192, 228, 128, 39, 224, 68, 128, 245, 192, 6, 160, 52, - 128, 196, 128, 7, 224, 11, 11, 22, 12, 0, 255, 39, 192, 65, 0, 135, - 224, 224, 32, 34, 128, 69, 128, 242, 128, 15, 224, 48, 128, 193, 64, 2, - 32, 11, 11, 22, 12, 0, 255, 2, 0, 2, 0, 34, 0, 35, 192, 34, - 0, 34, 0, 34, 0, 34, 0, 34, 0, 34, 0, 255, 224, 9, 11, 22, - 12, 0, 255, 8, 0, 8, 0, 255, 128, 136, 128, 136, 128, 136, 128, 255, - 128, 136, 128, 136, 128, 136, 128, 255, 128, 11, 11, 22, 12, 0, 255, 33, - 0, 83, 160, 65, 0, 247, 224, 81, 0, 83, 192, 86, 64, 83, 192, 90, - 64, 83, 192, 66, 64, 11, 11, 22, 12, 0, 255, 127, 192, 4, 0, 4, - 0, 4, 0, 255, 224, 10, 0, 10, 0, 18, 0, 34, 32, 66, 32, 129, - 224, 11, 11, 22, 12, 0, 255, 17, 0, 33, 0, 47, 224, 97, 0, 163, - 128, 35, 128, 37, 64, 37, 64, 41, 32, 33, 0, 33, 0, 11, 11, 22, - 12, 0, 255, 247, 224, 148, 32, 244, 32, 151, 224, 148, 128, 244, 128, 151, - 224, 148, 128, 244, 160, 150, 96, 4, 32, 11, 11, 22, 12, 0, 255, 123, - 224, 148, 128, 4, 0, 127, 192, 4, 0, 255, 224, 1, 0, 255, 224, 33, - 0, 17, 0, 7, 0, 11, 11, 22, 12, 0, 255, 33, 0, 71, 192, 145, - 0, 47, 224, 96, 128, 175, 224, 32, 128, 36, 128, 34, 128, 32, 128, 35, - 128, 11, 11, 22, 12, 0, 255, 39, 192, 36, 64, 247, 192, 46, 224, 42, - 160, 62, 224, 225, 0, 47, 224, 35, 128, 37, 64, 105, 32, 11, 11, 22, - 12, 0, 255, 20, 0, 39, 224, 42, 0, 98, 0, 163, 192, 34, 0, 34, - 0, 35, 224, 34, 0, 34, 0, 34, 0 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CZ.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CZ.h deleted file mode 100644 index 671ad8ea2d..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_CZ.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - Fontname: ISO10646_CZ - Copyright: A. Hardtung, public domain - Modified for Czech accents by Petr Zahradnik, http://www.zahradniksebavi.cz - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_CZ[2832] U8G_SECTION(".progmem.ISO10646_CZ") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0, - 0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,8, - 16,248,128,128,240,128,248,3,8,8,6,1,0,32,64,224, - 64,64,64,64,224,5,8,8,6,0,0,16,32,112,136,136, - 136,136,112,5,8,8,6,0,0,16,32,136,136,136,136,136, - 112,5,8,8,6,0,0,16,32,136,136,80,32,32,32,5, - 8,8,6,0,0,16,32,0,112,8,120,136,120,5,8,8, - 6,0,0,16,32,0,112,136,248,128,112,2,8,8,6,2, - 0,64,128,0,128,128,128,128,128,5,8,8,6,0,0,16, - 32,0,112,136,136,136,112,5,8,8,6,0,0,16,32,0, - 136,136,136,152,104,5,9,9,6,0,255,16,32,0,136,136, - 136,120,8,112,5,8,8,6,0,0,80,32,112,136,128,128, - 136,112,5,8,8,6,0,0,80,32,0,112,128,128,136,112, - 5,8,8,6,0,0,80,32,240,136,136,136,136,240,6,8, - 8,6,0,0,4,20,24,112,144,144,144,112,5,8,8,6, - 0,0,80,32,248,128,128,240,128,248,5,8,8,6,0,0, - 80,32,0,112,136,248,128,112,5,8,8,6,0,0,80,32, - 136,200,168,152,136,136,5,8,8,6,0,0,80,32,0,176, - 200,136,136,136,5,8,8,6,0,0,80,32,240,136,240,160, - 144,136,5,8,8,6,0,0,80,32,0,176,200,128,128,128, - 5,8,8,6,0,0,80,32,120,128,128,112,8,240,5,8, - 8,6,0,0,80,32,0,112,128,112,8,240,5,8,8,6, - 0,0,80,32,248,32,32,32,32,32,6,8,8,6,0,0, - 4,68,72,224,64,64,64,48,5,8,8,6,0,0,32,80, - 168,136,136,136,136,112,5,8,8,6,0,0,32,80,32,136, - 136,136,152,104,5,8,8,6,0,0,80,32,248,8,48,64, - 128,248,5,8,8,6,0,0,80,32,0,248,16,32,64,248, - 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, - 0,0,1,7,7,6,2,0,128,0,128,128,128,128,128,5, - 7,7,6,0,0,32,112,168,160,168,112,32,5,7,7,6, - 0,0,48,64,64,224,64,80,168,5,5,5,6,0,0,136, - 112,80,112,136,5,7,7,6,0,0,136,80,32,248,32,248, - 32,1,7,7,6,2,0,128,128,128,0,128,128,128,5,8, - 8,6,0,0,48,72,32,80,80,32,144,96,3,1,1,6, - 1,7,160,5,7,7,6,0,0,248,136,184,184,184,136,248, - 5,7,7,6,0,1,112,8,120,136,120,0,248,5,5,5, - 6,0,1,40,80,160,80,40,5,3,3,6,0,1,248,8, - 8,2,2,2,6,2,6,64,128,5,7,7,6,0,0,248, - 136,168,136,152,168,248,5,1,1,6,0,6,248,4,4,4, - 6,0,3,96,144,144,96,5,7,7,6,0,0,32,32,248, - 32,32,0,248,4,5,5,6,0,3,96,144,32,64,240,3, - 5,5,6,0,3,224,32,224,32,224,2,2,2,6,2,6, - 64,128,5,8,8,6,0,255,136,136,136,136,152,232,128,128, - 5,7,7,6,0,0,120,152,152,120,24,24,24,2,2,2, - 6,2,2,192,192,2,2,2,6,2,255,64,128,3,5,5, - 6,0,3,64,192,64,64,224,5,7,7,6,0,1,112,136, - 136,136,112,0,248,5,5,5,6,0,1,160,80,40,80,160, - 5,7,7,6,0,0,136,144,168,88,184,8,8,5,7,7, - 6,0,0,136,144,184,72,152,32,56,5,8,8,6,0,0, - 192,64,192,72,216,56,8,8,5,7,7,6,0,0,32,0, - 32,64,128,136,112,5,8,8,6,0,0,64,32,0,112,136, - 248,136,136,5,8,8,6,0,0,16,32,0,112,136,248,136, - 136,5,8,8,6,0,0,32,80,0,112,136,248,136,136,5, - 8,8,6,0,0,104,144,0,112,136,248,136,136,5,8,8, - 6,0,0,80,0,112,136,136,248,136,136,5,8,8,6,0, - 0,32,80,32,112,136,248,136,136,5,7,7,6,0,0,56, - 96,160,184,224,160,184,5,8,8,6,0,255,112,136,128,128, - 136,112,32,96,5,8,8,6,0,0,64,32,0,248,128,240, - 128,248,5,8,8,6,0,0,8,16,0,248,128,240,128,248, - 5,8,8,6,0,0,32,80,0,248,128,240,128,248,5,7, - 7,6,0,0,80,0,248,128,240,128,248,3,8,8,6,1, - 0,128,64,0,224,64,64,64,224,3,8,8,6,1,0,32, - 64,0,224,64,64,64,224,3,8,8,6,1,0,64,160,0, - 224,64,64,64,224,3,7,7,6,1,0,160,0,224,64,64, - 64,224,5,9,9,6,0,255,80,32,112,136,128,184,136,136, - 112,5,8,8,6,0,0,104,144,0,136,200,168,152,136,5, - 8,8,6,0,0,64,32,112,136,136,136,136,112,5,8,8, - 6,0,0,16,32,112,136,136,136,136,112,5,8,8,6,0, - 0,32,80,0,112,136,136,136,112,5,8,8,6,0,0,104, - 144,0,112,136,136,136,112,5,8,8,6,0,0,80,0,112, - 136,136,136,136,112,5,5,5,6,0,1,136,80,32,80,136, - 5,8,8,6,0,255,16,112,168,168,168,168,112,64,5,8, - 8,6,0,0,64,32,136,136,136,136,136,112,5,8,8,6, - 0,0,16,32,136,136,136,136,136,112,5,8,8,6,0,0, - 32,80,0,136,136,136,136,112,5,8,8,6,0,0,80,0, - 136,136,136,136,136,112,1,7,7,6,2,0,128,0,128,128, - 128,128,128,5,9,9,6,0,255,120,128,128,112,8,8,240, - 32,96,4,8,8,6,1,255,96,144,144,160,144,144,224,128, - 5,8,8,6,0,0,64,32,0,112,8,120,136,120,5,8, - 8,6,0,0,16,32,0,112,8,120,136,120,5,8,8,6, - 0,0,32,80,0,112,8,120,136,120,5,8,8,6,0,0, - 104,144,0,112,8,120,136,120,5,7,7,6,0,0,80,0, - 112,8,120,136,120,5,8,8,6,0,0,32,80,32,112,8, - 120,136,120,5,6,6,6,0,0,208,40,120,160,168,80,5, - 7,7,6,0,255,112,128,128,136,112,32,96,5,8,8,6, - 0,0,64,32,0,112,136,248,128,112,5,8,8,6,0,0, - 16,32,0,112,136,248,128,112,5,8,8,6,0,0,32,80, - 0,112,136,248,128,112,5,7,7,6,0,0,80,0,112,136, - 248,128,112,3,8,8,6,1,0,128,64,0,64,192,64,64, - 224,3,8,8,6,1,0,32,64,0,64,192,64,64,224,3, - 8,8,6,1,0,64,160,0,64,192,64,64,224,3,7,7, - 6,1,0,160,0,64,192,64,64,224,5,8,8,6,0,255, - 80,32,112,136,136,120,8,112,5,8,8,6,0,0,104,144, - 0,176,200,136,136,136,5,8,8,6,0,0,64,32,0,112, - 136,136,136,112,5,8,8,6,0,0,16,32,0,112,136,136, - 136,112,5,8,8,6,0,0,32,80,0,112,136,136,136,112, - 5,8,8,6,0,0,104,144,0,112,136,136,136,112,5,7, - 7,6,0,0,80,0,112,136,136,136,112,5,5,5,6,0, - 1,32,0,248,0,32,5,7,7,6,0,255,16,112,168,168, - 168,112,64,5,8,8,6,0,0,64,32,0,136,136,136,152, - 104,5,8,8,6,0,0,16,32,0,136,136,136,152,104,5, - 8,8,6,0,0,32,80,0,136,136,136,152,104,5,7,7, - 6,0,0,80,0,136,136,136,152,104,1,5,5,6,2,0, - 128,128,128,128,128,5,7,7,6,0,255,112,128,112,8,240, - 32,96,5,8,8,6,0,255,80,0,136,136,136,120,8,112 - }; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Greek.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Greek.h deleted file mode 100644 index efe44f3cc1..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Greek.h +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/* - Fontname: ISO10646_4_Greek - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 9 x= 2 y= 6 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_Greek_5x7[2715] U8G_SECTION(".progmem.ISO10646_Greek_5x7") = { - 0,6,9,0,254,7,1,145,3,32,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, - 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, - 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, - 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, - 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, - 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, - 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, - 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, - 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, - 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, - 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, - 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, - 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, - 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, - 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, - 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, - 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, - 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, - 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, - 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, - 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, - 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, - 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, - 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1, - 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80, - 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64, - 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0, - 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128, - 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120, - 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0, - 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136, - 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136, - 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8, - 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6, - 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192, - 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168, - 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6, - 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136, - 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5, - 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0, - 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64, - 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5, - 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136, - 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6, - 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0, - 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64, - 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3, - 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6, - 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0, - 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, - 0,0,2,2,2,6,1,6,64,128,3,3,3,6,1,5, - 32,64,160,5,8,8,6,0,0,64,160,80,80,136,248,136, - 136,2,2,2,6,1,2,192,192,5,8,8,6,0,0,64, - 128,248,128,240,128,128,248,5,8,8,6,0,0,64,128,136, - 136,248,136,136,136,4,8,8,6,0,0,64,128,112,32,32, - 32,32,112,0,0,0,6,0,0,5,8,8,6,0,0,64, - 128,112,136,136,136,136,112,0,0,0,6,0,0,5,8,8, - 6,0,0,64,128,8,136,112,32,32,32,5,8,8,6,0, - 0,64,128,112,136,136,136,80,216,3,8,8,6,1,0,32, - 64,160,0,64,64,64,32,5,7,7,6,0,0,32,80,136, - 136,248,136,136,5,7,7,6,0,0,240,72,72,112,72,72, - 240,5,7,7,6,0,0,248,128,128,128,128,128,128,5,6, - 6,6,0,0,32,80,80,136,136,248,5,7,7,6,0,0, - 248,128,128,240,128,128,248,5,7,7,6,0,0,248,8,16, - 32,64,128,248,5,7,7,6,0,0,136,136,136,248,136,136, - 136,5,7,7,6,0,0,112,136,136,168,136,136,112,3,7, - 7,6,1,0,224,64,64,64,64,64,224,5,7,7,6,0, - 0,136,144,160,192,160,144,136,5,7,7,6,0,0,32,80, - 136,136,136,136,136,5,7,7,6,0,0,136,216,168,168,136, - 136,136,5,7,7,6,0,0,136,200,200,168,152,152,136,5, - 7,7,6,0,0,248,0,0,112,0,0,248,5,7,7,6, - 0,0,112,136,136,136,136,136,112,5,7,7,6,0,0,248, - 80,80,80,80,80,80,5,7,7,6,0,0,240,136,136,240, - 128,128,128,0,0,0,6,0,0,5,7,7,6,0,0,248, - 128,64,32,64,128,248,5,7,7,6,0,0,248,32,32,32, - 32,32,32,5,7,7,6,0,0,136,136,80,32,32,32,32, - 5,7,7,6,0,0,112,32,112,168,112,32,112,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 168,168,168,168,112,32,32,5,6,6,6,0,0,112,136,136, - 80,80,216,3,8,8,6,1,0,160,0,224,64,64,64,64, - 224,5,8,8,6,0,0,80,0,136,136,136,80,32,32,5, - 8,8,6,0,0,32,64,8,104,152,144,144,104,5,8,8, - 6,0,0,32,64,0,112,136,224,136,112,5,9,9,6,0, - 255,32,64,0,112,136,136,136,136,8,2,8,8,6,1,0, - 64,128,0,128,128,128,128,64,5,8,8,6,0,0,16,32, - 80,0,136,136,136,112,5,6,6,6,0,0,8,104,152,144, - 144,104,4,6,6,6,0,255,96,144,240,144,224,128,5,6, - 6,6,0,255,136,72,80,32,32,64,5,6,6,6,0,0, - 48,64,112,136,136,112,5,5,5,6,0,0,112,136,224,136, - 112,5,8,8,6,0,255,128,112,64,128,128,112,8,112,5, - 6,6,6,0,255,184,200,136,136,136,8,5,5,5,6,0, - 0,112,136,248,136,112,3,5,5,6,1,0,128,128,128,128, - 96,4,5,5,6,0,0,144,160,192,160,144,5,6,6,6, - 0,0,64,32,32,80,80,136,5,6,6,6,0,255,136,136, - 136,216,168,128,5,5,5,6,0,0,136,136,80,96,32,5, - 9,9,6,0,255,128,224,128,112,32,64,240,8,112,5,5, - 5,6,0,0,112,136,136,136,112,5,5,5,6,0,0,248, - 80,80,80,80,5,6,6,6,0,255,112,136,136,200,176,128, - 5,7,7,6,0,255,48,64,128,64,48,8,112,5,5,5, - 6,0,0,104,144,144,144,96,4,5,5,6,0,0,240,64, - 64,64,48,5,5,5,6,0,0,136,136,144,144,224,5,7, - 7,6,0,255,32,168,168,168,112,32,32,5,6,6,6,0, - 255,136,80,32,32,80,136,5,6,6,6,0,255,168,168,168, - 168,112,32,5,5,5,6,0,0,80,136,136,168,112,4,7, - 7,6,0,0,160,0,64,64,64,64,48,5,7,7,6,0, - 0,80,0,136,136,144,144,224,4,8,8,6,0,0,32,64, - 0,96,144,144,144,96,5,8,8,6,0,0,32,64,0,136, - 136,144,144,96,5,8,8,6,0,0,32,64,0,80,136,136, - 168,112,5,7,7,6,0,255,144,160,192,160,144,136,16,5, - 8,8,6,0,0,96,144,160,128,240,136,136,112,5,7,7, - 6,0,0,112,80,56,144,144,144,96,5,6,6,6,0,0, - 152,80,32,32,32,32,5,8,8,6,0,0,64,128,152,80, - 32,32,32,32,5,8,8,6,0,0,80,0,152,80,32,32, - 32,32,5,7,7,6,0,255,48,168,168,168,168,112,32,5, - 5,5,6,0,0,248,80,80,80,88,5,6,6,6,0,255, - 136,80,112,80,136,16,5,7,7,6,0,255,112,136,136,136, - 112,32,112,5,6,6,6,0,255,112,136,136,112,32,112,5, - 6,6,6,0,0,112,136,128,112,32,112,5,7,7,6,0, - 255,8,8,112,128,112,16,96,5,6,6,6,0,0,248,128, - 128,240,128,128,4,5,5,6,0,0,240,128,224,128,128,5, - 6,6,6,0,0,248,0,0,112,0,248,4,5,5,6,0, - 0,64,128,240,16,32,5,7,7,6,0,0,224,80,40,40, - 8,8,16,5,7,7,6,0,0,192,32,80,40,8,8,8, - 5,7,7,6,0,255,168,168,168,168,88,8,112,5,6,6, - 6,0,255,168,168,168,88,8,112,5,6,6,6,0,0,104, - 136,136,120,8,8,5,6,6,6,0,255,104,136,136,120,8, - 8,4,8,8,6,0,255,128,224,144,144,144,144,32,192,5, - 5,5,6,0,0,104,144,112,16,224,5,6,6,6,0,0, - 96,144,16,96,136,112,4,6,6,6,0,0,96,144,16,96, - 128,112,5,6,6,6,0,0,136,80,32,80,136,248,5,5, - 5,6,0,0,136,80,32,80,112,5,6,6,6,0,0,120, - 128,240,136,136,112,4,5,5,6,0,0,240,128,224,144,96, - 3,6,6,6,1,0,64,224,64,64,64,64,3,6,6,6, - 1,255,64,224,64,64,64,128,5,5,5,6,0,0,136,80, - 112,80,136,5,6,6,6,0,255,112,136,136,240,128,112,4, - 5,5,6,0,0,112,128,128,128,112,2,8,8,6,1,255, - 64,0,192,64,64,64,64,128,5,7,7,6,0,0,112,136, - 136,248,136,136,112,4,5,5,6,0,0,112,128,224,128,112, - 4,5,5,6,0,0,224,16,112,16,224,5,7,7,6,0, - 0,128,240,136,136,136,240,128,4,7,7,6,0,255,128,224, - 144,144,144,224,128,5,6,6,6,0,0,112,136,128,128,136, - 112,5,6,6,6,0,0,136,216,168,136,136,136,5,6,6, - 6,0,255,136,216,168,136,136,128,5,8,8,6,0,255,112, - 136,136,136,112,64,224,64,5,6,6,6,0,0,112,136,8, - 8,136,112,5,6,6,6,0,0,112,136,160,128,136,112,5, - 6,6,6,0,0,112,136,40,8,136,112}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Kana.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Kana.h deleted file mode 100644 index 69683740c3..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_Kana.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: ISO10646_Kana - Copyright: A. Hardtung, public domain - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h= 8 x= 2 y= 5 dx= 6 dy= 0 ascent= 8 len= 8 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_Kana_5x7[2482] U8G_SECTION(".progmem.ISO10646_Kana_5x7") = { - 0, 6, 9, 0, 254, 7, 1, 145, 3, 32, 32, 255, 255, 8, 255, 7, - 255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128, - 128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6, - 0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32, - 120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32, - 64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104, - 2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32, - 64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32, - 32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5, - 5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192, - 64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192, - 192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6, - 0, 0, 112, 136, 152, 168, 200, 136, 112, 3, 7, 7, 6, 1, 0, 64, - 192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112, - 128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240, - 5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7, - 6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0, - 48, 64, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16, - 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 16, 96, 2, 5, - 5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192, - 192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64, - 32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1, - 0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136, - 8, 16, 32, 0, 32, 5, 6, 6, 6, 0, 0, 112, 136, 8, 104, 168, - 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6, 0, - 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 224, 144, - 136, 136, 136, 144, 224, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, - 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128, 5, - 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7, 6, - 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0, 128, - 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16, 16, - 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144, 136, - 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7, 7, - 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, - 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136, 136, - 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128, 128, - 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5, 7, - 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6, 0, - 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248, 32, - 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, - 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32, 5, - 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7, 6, - 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0, 136, - 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16, 32, - 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128, 224, - 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6, 1, - 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32, 80, - 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128, 64, - 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, - 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112, 128, - 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136, 120, - 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6, 0, - 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112, 136, - 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136, 136, - 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3, 8, - 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7, 6, - 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0, 192, - 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168, 168, - 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5, 6, - 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136, 136, - 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8, 5, - 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0, 0, - 112, 128, 112, 8, 240, 5, 7, 7, 6, 0, 0, 64, 64, 224, 64, 64, - 72, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5, 5, - 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136, 136, - 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5, 6, - 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0, 0, - 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128, 64, - 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128, 3, - 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2, 6, - 0, 3, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 5, 3, 3, 6, 0, 1, - 248, 0, 248, 4, 4, 4, 6, 0, 0, 240, 16, 96, 64, 5, 6, 6, - 6, 0, 0, 248, 8, 40, 48, 32, 64, 3, 4, 4, 6, 1, 0, 32, - 64, 192, 64, 4, 6, 6, 6, 0, 0, 16, 32, 96, 160, 32, 32, 4, - 4, 4, 6, 0, 0, 32, 240, 144, 32, 5, 6, 6, 6, 0, 0, 32, - 248, 136, 8, 16, 32, 3, 4, 4, 6, 1, 0, 224, 64, 64, 224, 5, - 5, 5, 6, 0, 0, 248, 32, 32, 32, 248, 4, 4, 4, 6, 0, 0, - 32, 240, 96, 160, 5, 6, 6, 6, 0, 0, 16, 248, 48, 80, 144, 16, - 5, 6, 6, 6, 0, 0, 64, 248, 72, 72, 72, 144, 5, 8, 8, 6, - 0, 0, 40, 0, 64, 248, 72, 72, 72, 144, 5, 6, 6, 6, 0, 0, - 32, 248, 32, 248, 32, 32, 5, 8, 8, 6, 0, 0, 40, 0, 32, 248, - 32, 248, 32, 32, 4, 5, 5, 6, 0, 0, 112, 144, 16, 32, 192, 5, - 7, 7, 6, 0, 0, 40, 0, 112, 144, 16, 32, 192, 5, 6, 6, 6, - 0, 0, 64, 120, 144, 16, 16, 32, 5, 8, 8, 6, 0, 0, 40, 0, - 64, 120, 144, 16, 16, 32, 5, 5, 5, 6, 0, 0, 248, 8, 8, 8, - 248, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 8, 8, 248, 5, 6, - 6, 6, 0, 0, 80, 248, 80, 16, 32, 64, 5, 8, 8, 6, 0, 0, - 40, 0, 80, 248, 80, 16, 32, 64, 5, 5, 5, 6, 0, 0, 192, 8, - 200, 16, 224, 5, 7, 7, 6, 0, 0, 40, 0, 192, 8, 200, 16, 224, - 5, 5, 5, 6, 0, 0, 248, 16, 32, 80, 136, 5, 7, 7, 6, 0, - 0, 40, 0, 248, 16, 32, 80, 136, 5, 6, 6, 6, 0, 0, 64, 248, - 72, 80, 64, 56, 5, 8, 8, 6, 0, 0, 40, 0, 64, 248, 72, 80, - 64, 56, 5, 5, 5, 6, 0, 0, 136, 136, 72, 16, 96, 5, 7, 7, - 6, 0, 0, 40, 0, 136, 136, 72, 16, 96, 5, 5, 5, 6, 0, 0, - 120, 72, 168, 16, 96, 5, 7, 7, 6, 0, 0, 40, 0, 120, 72, 168, - 16, 96, 5, 6, 6, 6, 0, 0, 16, 224, 32, 248, 32, 64, 5, 8, - 8, 6, 0, 0, 40, 0, 16, 224, 32, 248, 32, 64, 5, 4, 4, 6, - 0, 0, 168, 168, 8, 48, 5, 5, 5, 6, 0, 0, 168, 168, 8, 16, - 32, 5, 7, 7, 6, 0, 0, 40, 0, 168, 168, 8, 16, 32, 5, 6, - 6, 6, 0, 0, 112, 0, 248, 32, 32, 64, 5, 8, 8, 6, 0, 0, - 40, 0, 112, 0, 248, 32, 32, 64, 3, 6, 6, 6, 1, 0, 128, 128, - 192, 160, 128, 128, 4, 8, 8, 6, 1, 0, 80, 0, 128, 128, 192, 160, - 128, 128, 5, 6, 6, 6, 0, 0, 32, 248, 32, 32, 64, 128, 5, 5, - 5, 6, 0, 0, 112, 0, 0, 0, 248, 5, 5, 5, 6, 0, 0, 248, - 8, 80, 32, 208, 5, 6, 6, 6, 0, 0, 32, 248, 16, 32, 112, 168, - 3, 6, 6, 6, 1, 0, 32, 32, 32, 32, 64, 128, 5, 5, 5, 6, - 0, 0, 16, 136, 136, 136, 136, 5, 7, 7, 6, 0, 0, 40, 0, 16, - 136, 136, 136, 136, 5, 8, 8, 6, 0, 0, 24, 24, 0, 16, 136, 136, - 136, 136, 5, 6, 6, 6, 0, 0, 128, 128, 248, 128, 128, 120, 5, 7, - 7, 6, 0, 0, 40, 128, 128, 248, 128, 128, 120, 5, 7, 7, 6, 0, - 0, 24, 152, 128, 248, 128, 128, 120, 5, 5, 5, 6, 0, 0, 248, 8, - 8, 16, 96, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 8, 16, 96, - 5, 8, 8, 6, 0, 0, 24, 24, 0, 248, 8, 8, 16, 96, 5, 4, - 4, 6, 0, 1, 64, 160, 16, 8, 5, 6, 6, 6, 0, 1, 40, 0, - 64, 160, 16, 8, 5, 6, 6, 6, 0, 1, 24, 24, 64, 160, 16, 8, - 5, 6, 6, 6, 0, 0, 32, 248, 32, 168, 168, 32, 5, 8, 8, 6, - 0, 0, 40, 0, 32, 248, 32, 168, 168, 32, 5, 8, 8, 6, 0, 0, - 24, 24, 32, 248, 32, 168, 168, 32, 5, 5, 5, 6, 0, 0, 248, 8, - 80, 32, 16, 4, 5, 5, 6, 1, 0, 224, 0, 224, 0, 240, 5, 5, - 5, 6, 0, 0, 32, 64, 136, 248, 8, 5, 5, 5, 6, 0, 0, 8, - 40, 16, 40, 192, 5, 5, 5, 6, 0, 0, 248, 64, 248, 64, 56, 5, - 4, 4, 6, 0, 0, 64, 248, 80, 64, 5, 6, 6, 6, 0, 0, 64, - 248, 72, 80, 64, 64, 4, 4, 4, 6, 0, 0, 96, 32, 32, 240, 5, - 5, 5, 6, 0, 0, 112, 16, 16, 16, 248, 4, 5, 5, 6, 0, 0, - 240, 16, 240, 16, 240, 5, 5, 5, 6, 0, 0, 248, 8, 248, 8, 248, - 5, 6, 6, 6, 0, 0, 112, 0, 248, 8, 16, 32, 4, 6, 6, 6, - 0, 0, 144, 144, 144, 144, 16, 32, 5, 5, 5, 6, 0, 0, 32, 160, - 168, 168, 176, 4, 5, 5, 6, 0, 0, 128, 128, 144, 160, 192, 5, 5, - 5, 6, 0, 0, 248, 136, 136, 136, 248, 4, 4, 4, 6, 0, 0, 240, - 144, 16, 32, 5, 5, 5, 6, 0, 0, 248, 136, 8, 16, 32, 5, 6, - 6, 6, 0, 0, 16, 248, 80, 80, 248, 16, 5, 5, 5, 6, 0, 0, - 248, 8, 48, 32, 248, 5, 5, 5, 6, 0, 0, 248, 8, 248, 8, 48, - 5, 5, 5, 6, 0, 0, 192, 8, 8, 16, 224, 5, 8, 8, 6, 0, - 0, 40, 0, 32, 248, 136, 8, 16, 32, 4, 4, 4, 6, 0, 0, 64, - 240, 80, 160, 4, 4, 4, 6, 0, 0, 64, 240, 32, 64, 5, 7, 7, - 6, 0, 0, 40, 0, 248, 136, 8, 16, 96, 5, 8, 8, 6, 0, 0, - 40, 0, 16, 248, 80, 80, 248, 16, 5, 7, 7, 6, 0, 0, 40, 0, - 248, 8, 48, 32, 248, 5, 7, 7, 6, 0, 0, 40, 0, 248, 8, 248, - 8, 48, 2, 2, 2, 6, 2, 2, 192, 192, 5, 1, 1, 6, 0, 2, - 248, 5, 4, 4, 6, 0, 1, 128, 96, 16, 8, 5, 5, 5, 6, 0, - 1, 40, 128, 96, 16, 8, 5, 6, 6, 6, 0, 0, 248, 8, 8, 8, - 8, 8 -}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_SK.h b/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_SK.h deleted file mode 100644 index 7a460858d8..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_ISO10646_SK.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - Fontname: ISO10646_SK - Copyright: A. Hardtung, modified by Roman Moravcik - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-1 - X Font ascent = 7 descent=-1 - Max Font ascent = 8 descent=-1 -*/ -#include -const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = { - 0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7, - 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, - 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, - 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, - 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, - 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, - 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, - 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, - 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, - 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, - 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, - 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, - 0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64, - 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, - 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, - 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, - 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, - 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, - 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, - 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, - 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, - 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, - 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, - 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, - 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, - 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, - 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, - 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, - 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, - 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, - 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, - 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, - 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, - 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, - 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, - 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, - 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, - 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, - 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, - 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, - 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, - 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, - 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, - 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, - 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, - 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, - 32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128, - 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, - 1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, - 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, - 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, - 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, - 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, - 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, - 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, - 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, - 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, - 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, - 6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0, - 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, - 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, - 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, - 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, - 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, - 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, - 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, - 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, - 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, - 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, - 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, - 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, - 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, - 6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0, - 0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80, - 0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248, - 128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64, - 64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136, - 112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5, - 8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8, - 6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0, - 0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80, - 0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112, - 136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128, - 128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112, - 5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8, - 8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6, - 0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0, - 0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80, - 32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240, - 136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144, - 144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128, - 248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5, - 8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8, - 6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0, - 0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80, - 32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240, - 136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200, - 128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8, - 240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5, - 8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8, - 6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0, - 0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80, - 32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0, - 0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0, - 6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0, - 0,0,6,0,0,0,0,0,6,0,0}; diff --git a/Marlin_thinkerV2/Marlin/dogm_font_data_Marlin_symbols.h b/Marlin_thinkerV2/Marlin/dogm_font_data_Marlin_symbols.h deleted file mode 100644 index ad9b983b20..0000000000 --- a/Marlin_thinkerV2/Marlin/dogm_font_data_Marlin_symbols.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - Fontname: Marlin_symbols - Copyright: Created with Fony 1.4.7 - Capital A Height: 0, '1' Height: 0 - Calculated Max Values w= 5 h=10 x= 0 y= 3 dx= 6 dy= 0 ascent= 8 len=10 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 0 descent= 0 - X Font ascent = 0 descent= 0 - Max Font ascent = 8 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t Marlin_symbols[140] U8G_SECTION(".progmem.Marlin_symbols") = { - 0, 6, 9, 0, 254, 0, 0, 0, 0, 0, 1, 9, 0, 8, 254, 0, - 0, 5, 8, 8, 6, 0, 0, 64, 240, 200, 136, 136, 152, 120, 16, 5, - 8, 8, 6, 0, 0, 192, 248, 136, 136, 136, 136, 136, 248, 5, 5, 5, - 6, 0, 1, 32, 48, 248, 48, 32, 5, 8, 8, 6, 0, 0, 32, 112, - 248, 32, 32, 32, 32, 224, 5, 9, 9, 6, 0, 255, 32, 112, 168, 168, - 184, 136, 136, 112, 32, 5, 9, 9, 6, 0, 255, 224, 128, 192, 176, 168, - 40, 48, 40, 40, 5, 9, 9, 6, 0, 255, 248, 168, 136, 136, 136, 136, - 136, 168, 248, 5, 10, 10, 6, 0, 254, 32, 80, 80, 80, 80, 136, 168, - 168, 136, 112, 3, 3, 3, 6, 0, 3, 64, 160, 64 -}; diff --git a/Marlin_thinkerV2/Marlin/drivers.h b/Marlin_thinkerV2/Marlin/drivers.h deleted file mode 100644 index 3a8ff4a2a0..0000000000 --- a/Marlin_thinkerV2/Marlin/drivers.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifndef _DRIVERS_H_ -#define _DRIVERS_H_ - -#include "MarlinConfig.h" - -#define A4988 0x001 -#define DRV8825 0x002 -#define LV8729 0x003 -#define L6470 0x104 -#define TB6560 0x005 -#define TB6600 0x006 -#define TMC2100 0x007 -#define TMC2130 0x108 -#define TMC2130_STANDALONE 0x008 -#define TMC2208 0x109 -#define TMC2208_STANDALONE 0x009 -#define TMC26X 0x10A -#define TMC26X_STANDALONE 0x00A -#define TMC2660 0x10B -#define TMC2660_STANDALONE 0x00B - -#define _AXIS_DRIVER_TYPE(A,T) ( defined(A##_DRIVER_TYPE) && (A##_DRIVER_TYPE == T) ) - -#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T) -#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T) -#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T) -#define AXIS_DRIVER_TYPE_X2(T) (ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)) && _AXIS_DRIVER_TYPE(X2,T) -#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T)) -#define AXIS_DRIVER_TYPE_Z2(T) (ENABLED(Z_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z2,T)) -#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T)) -#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T)) -#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T)) -#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T)) -#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T)) - -#define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T) - -#define HAS_DRIVER(T) (AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) || \ - AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) || \ - AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || \ - AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) || \ - AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) || \ - AXIS_DRIVER_TYPE_E4(T) ) - -// Test for supported TMC drivers that require advanced configuration -// Does not match standalone configurations -#define HAS_TRINAMIC (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208)) - -#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE_##A(TMC2130) || \ - AXIS_DRIVER_TYPE_##A(TMC2208) ) - -#endif // _DRIVERS_H_ diff --git a/Marlin_thinkerV2/Marlin/duration_t.h b/Marlin_thinkerV2/Marlin/duration_t.h deleted file mode 100644 index bcc3011bb6..0000000000 --- a/Marlin_thinkerV2/Marlin/duration_t.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __DURATION_T__ -#define __DURATION_T__ - -#include -#include - -struct duration_t { - /** - * @brief Duration is stored in seconds - */ - uint32_t value; - - /** - * @brief Constructor - */ - duration_t() - : duration_t(0) {}; - - /** - * @brief Constructor - * - * @param seconds The number of seconds - */ - duration_t(uint32_t const &seconds) { - this->value = seconds; - } - - /** - * @brief Equality comparison - * @details Overloads the equality comparison operator - * - * @param value The number of seconds to compare to - * @return True if both durations are equal - */ - bool operator==(const uint32_t &value) const { - return (this->value == value); - } - - /** - * @brief Inequality comparison - * @details Overloads the inequality comparison operator - * - * @param value The number of seconds to compare to - * @return False if both durations are equal - */ - bool operator!=(const uint32_t &value) const { - return ! this->operator==(value); - } - - /** - * @brief Formats the duration as years - * @return The number of years - */ - inline uint8_t year() const { - return this->day() / 365; - } - - /** - * @brief Formats the duration as days - * @return The number of days - */ - inline uint16_t day() const { - return this->hour() / 24; - } - - /** - * @brief Formats the duration as hours - * @return The number of hours - */ - inline uint32_t hour() const { - return this->minute() / 60; - } - - /** - * @brief Formats the duration as minutes - * @return The number of minutes - */ - inline uint32_t minute() const { - return this->second() / 60; - } - - /** - * @brief Formats the duration as seconds - * @return The number of seconds - */ - inline uint32_t second() const { - return this->value; - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "full" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 21 bytes - * - * Output examples: - * 123456789012345678901 (strlen) - * 135y 364d 23h 59m 59s - * 364d 23h 59m 59s - * 23h 59m 59s - * 59m 59s - * 59s - */ - void toString(char *buffer) const { - int y = this->year(), - d = this->day() % 365, - h = this->hour() % 24, - m = this->minute() % 60, - s = this->second() % 60; - - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); - else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); - else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); - else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); - else sprintf_P(buffer, PSTR("%is"), s); - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "digital" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 10 bytes - * - * Output examples: - * 123456789 (strlen) - * 99:59 - * 11d 12:33 - */ - uint8_t toDigital(char *buffer, bool with_days=false) const { - uint16_t h = uint16_t(this->hour()), - m = uint16_t(this->minute() % 60UL); - if (with_days) { - uint16_t d = this->day(); - sprintf_P(buffer, PSTR("%ud %02u:%02u"), d, h % 24, m); - return d >= 10 ? 9 : 8; - } - else if (h < 100) { - sprintf_P(buffer, PSTR("%02u:%02u"), h, m); - return 5; - } - else { - sprintf_P(buffer, PSTR("%u:%02u"), h, m); - return 6; - } - } -}; - -#endif // __DURATION_T__ diff --git a/Marlin_thinkerV2/Marlin/emergency_parser.cpp b/Marlin_thinkerV2/Marlin/emergency_parser.cpp deleted file mode 100644 index c1cab3a2c7..0000000000 --- a/Marlin_thinkerV2/Marlin/emergency_parser.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * emergency_parser.cpp - Intercept special commands directly in the serial stream - */ - -#include "MarlinConfig.h" - -#if ENABLED(EMERGENCY_PARSER) - -#include "emergency_parser.h" - -// Static data members -bool EmergencyParser::killed_by_M112; // = false -EmergencyParser::State EmergencyParser::state; // = EP_RESET - -// Global instance -EmergencyParser emergency_parser; - -#endif // EMERGENCY_PARSER diff --git a/Marlin_thinkerV2/Marlin/emergency_parser.h b/Marlin_thinkerV2/Marlin/emergency_parser.h deleted file mode 100644 index 73981cc38e..0000000000 --- a/Marlin_thinkerV2/Marlin/emergency_parser.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * emergency_parser.h - Intercept special commands directly in the serial stream - */ - -#ifndef _EMERGENCY_PARSER_H_ -#define _EMERGENCY_PARSER_H_ - -// External references -extern volatile bool wait_for_user, wait_for_heatup; -void quickstop_stepper(); - -class EmergencyParser { - -public: - - // Currently looking for: M108, M112, M410 - enum State : char { - EP_RESET, - EP_N, - EP_M, - EP_M1, - EP_M10, - EP_M108, - EP_M11, - EP_M112, - EP_M4, - EP_M41, - EP_M410, - EP_IGNORE // to '\n' - }; - - static bool killed_by_M112; - static State state; - - EmergencyParser() {} - - __attribute__((always_inline)) inline - static void update(const uint8_t c) { - - switch (state) { - case EP_RESET: - switch (c) { - case ' ': break; - case 'N': state = EP_N; break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_N: - switch (c) { - case '0': case '1': case '2': - case '3': case '4': case '5': - case '6': case '7': case '8': - case '9': case '-': case ' ': break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_M: - switch (c) { - case ' ': break; - case '1': state = EP_M1; break; - case '4': state = EP_M4; break; - default: state = EP_IGNORE; - } - break; - - case EP_M1: - switch (c) { - case '0': state = EP_M10; break; - case '1': state = EP_M11; break; - default: state = EP_IGNORE; - } - break; - - case EP_M10: - state = (c == '8') ? EP_M108 : EP_IGNORE; - break; - - case EP_M11: - state = (c == '2') ? EP_M112 : EP_IGNORE; - break; - - case EP_M4: - state = (c == '1') ? EP_M41 : EP_IGNORE; - break; - - case EP_M41: - state = (c == '0') ? EP_M410 : EP_IGNORE; - break; - - case EP_IGNORE: - if (c == '\n') state = EP_RESET; - break; - - default: - if (c == '\n') { - switch (state) { - case EP_M108: - wait_for_user = wait_for_heatup = false; - break; - case EP_M112: - killed_by_M112 = true; - break; - case EP_M410: - quickstop_stepper(); - break; - default: - break; - } - state = EP_RESET; - } - } - } - -}; - -extern EmergencyParser emergency_parser; - -#endif // _EMERGENCY_PARSER_H_ diff --git a/Marlin_thinkerV2/Marlin/endstop_interrupts.h b/Marlin_thinkerV2/Marlin/endstop_interrupts.h deleted file mode 100644 index 62c2ea8532..0000000000 --- a/Marlin_thinkerV2/Marlin/endstop_interrupts.h +++ /dev/null @@ -1,239 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate either an - * 'external interrupt' or a 'pin change interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#ifndef _ENDSTOP_INTERRUPTS_H_ -#define _ENDSTOP_INTERRUPTS_H_ - -#include "macros.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } - -/** - * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) - * - * These macros for the Arduino MEGA do not include the two connected pins on Port J (D13, D14). - * So we extend them here because these are the normal pins for Y_MIN and Y_MAX on RAMPS. - * There are more PCI-enabled processor pins on Port J, but they are not connected to Arduino MEGA. - */ -#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA) - #undef digitalPinToPCICR - #define digitalPinToPCICR(p) ( WITHIN(p, 10, 15) || \ - WITHIN(p, 50, 53) || \ - WITHIN(p, 62, 69) ? &PCICR : (uint8_t*)0 ) - #undef digitalPinToPCICRbit - #define digitalPinToPCICRbit(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \ - WITHIN(p, 14, 15) ? 1 : \ - WITHIN(p, 62, 69) ? 2 : \ - 0 ) - #undef digitalPinToPCMSK - #define digitalPinToPCMSK(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? &PCMSK0 : \ - WITHIN(p, 14, 15) ? &PCMSK1 : \ - WITHIN(p, 62, 69) ? &PCMSK2 : \ - (uint8_t *)0 ) - #undef digitalPinToPCMSKbit - #define digitalPinToPCMSKbit(p) ( WITHIN(p, 10, 13) ? ((p) - 6) : \ - (p) == 14 || (p) == 51 ? 2 : \ - (p) == 15 || (p) == 52 ? 1 : \ - (p) == 50 ? 3 : \ - (p) == 53 ? 0 : \ - WITHIN(p, 62, 69) ? ((p) - 62) : \ - 0 ) -#endif - - -// Install Pin change interrupt for a pin. Can be called multiple times. -void pciSetup(const int8_t pin) { - SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin - SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt - SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group -} - - -// Handlers for pin change interrupts -#ifdef PCINT0_vect - ISR(PCINT0_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT1_vect - ISR(PCINT1_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT2_vect - ISR(PCINT2_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT3_vect - ISR(PCINT3_vect) { endstop_ISR(); } -#endif - -void setup_endstop_interrupts( void ) { - - #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 - #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) != NULL, "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error - pciSetup(X_MAX_PIN); // assign it - #endif - #endif - - #if HAS_X_MIN - #if digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "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); - #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) != NULL, "Z2_MIN_PIN is not interrupt-capable"); - pciSetup(Z2_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); - #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) != NULL, "Z_MIN_PROBE_PIN is not interrupt-capable"); - pciSetup(Z_MIN_PROBE_PIN); - #endif - #endif - - // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI. -} - -#endif // _ENDSTOP_INTERRUPTS_H_ diff --git a/Marlin_thinkerV2/Marlin/endstops.cpp b/Marlin_thinkerV2/Marlin/endstops.cpp deleted file mode 100644 index 9cca5f8839..0000000000 --- a/Marlin_thinkerV2/Marlin/endstops.cpp +++ /dev/null @@ -1,753 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * endstops.cpp - A singleton object to manage endstops - */ - -#include "Marlin.h" -#include "cardreader.h" -#include "endstops.h" -#include "temperature.h" -#include "stepper.h" -#include "ultralcd.h" - -#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - #include "endstop_interrupts.h" -#endif - -Endstops endstops; - -// public: - -bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() -volatile uint8_t Endstops::hit_state; - -Endstops::esbits_t Endstops::live_state = 0; - -#if ENABLED(ENDSTOP_NOISE_FILTER) - Endstops::esbits_t Endstops::validated_live_state; - uint8_t Endstops::endstop_poll_count; -#endif - -#if HAS_BED_PROBE - volatile bool Endstops::z_probe_enabled = false; -#endif - -// Initialized by settings.load() -#if ENABLED(X_DUAL_ENDSTOPS) - float Endstops::x_endstop_adj; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - float Endstops::y_endstop_adj; -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - float Endstops::z_endstop_adj; -#endif - -/** - * Class and Instance Methods - */ - -void Endstops::init() { - - #if HAS_X_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X_MIN_PIN); - #else - SET_INPUT(X_MIN_PIN); - #endif - #endif - - #if HAS_X2_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X2_MIN_PIN); - #else - SET_INPUT(X2_MIN_PIN); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y_MIN_PIN); - #else - SET_INPUT(Y_MIN_PIN); - #endif - #endif - - #if HAS_Y2_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y2_MIN_PIN); - #else - SET_INPUT(Y2_MIN_PIN); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - #if ENABLED(FIX_MOUNTED_PROBE) - SET_INPUT(Z_MIN_PIN); - #else - SET_INPUT_PULLUP(Z_MIN_PIN); - #endif - #else - SET_INPUT(Z_MIN_PIN); - #endif - #endif - - #if HAS_Z2_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - SET_INPUT_PULLUP(Z2_MIN_PIN); - #else - SET_INPUT(Z2_MIN_PIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X_MAX_PIN); - #else - SET_INPUT(X_MAX_PIN); - #endif - #endif - - #if HAS_X2_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X2_MAX_PIN); - #else - SET_INPUT(X2_MAX_PIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y_MAX_PIN); - #else - SET_INPUT(Y_MAX_PIN); - #endif - #endif - - #if HAS_Y2_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y2_MAX_PIN); - #else - SET_INPUT(Y2_MAX_PIN); - #endif - #endif - - #if HAS_Z_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z_MAX_PIN); - #else - SET_INPUT(Z_MAX_PIN); - #endif - #endif - - #if HAS_Z2_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z2_MAX_PIN); - #else - SET_INPUT(Z2_MAX_PIN); - #endif - #endif - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE) - SET_INPUT_PULLUP(Z_MIN_PROBE_PIN); - #else - SET_INPUT(Z_MIN_PROBE_PIN); - #endif - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - setup_endstop_interrupts(); - #endif - - // Enable endstops - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - -} // Endstops::init - -// Called at ~1KHz from Temperature ISR: Poll endstop state if required -void Endstops::poll() { - - #if ENABLED(PINS_DEBUGGING) - run_monitor(); // report changes in endstop status - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && ENABLED(ENDSTOP_NOISE_FILTER) - if (endstop_poll_count) update(); - #elif DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER) - update(); - #endif -} - -void Endstops::enable_globally(const bool onoff) { - enabled_globally = enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Enable / disable endstop checking -void Endstops::enable(const bool onoff) { - enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable -void Endstops::not_homing() { - enabled = enabled_globally; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif -} - -#if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - void Endstops::validate_homing_move() { - if (trigger_state()) hit_on_purpose(); - else kill(PSTR(MSG_ERR_HOMING_FAILED)); - } -#endif - -// Enable / disable endstop z-probe checking -#if HAS_BED_PROBE - void Endstops::enable_z_probe(const bool onoff) { - z_probe_enabled = onoff; - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #endif - } -#endif - -#if ENABLED(PINS_DEBUGGING) - void Endstops::run_monitor() { - if (!monitor_flag) return; - static uint8_t monitor_count = 16; // offset this check from the others - monitor_count += _BV(1); // 15 Hz - monitor_count &= 0x7F; - if (!monitor_count) monitor(); // report changes in endstop status - } -#endif - -void Endstops::event_handler() { - static uint8_t prev_hit_state; // = 0 - if (hit_state && hit_state != prev_hit_state) { - #if ENABLED(ULTRA_LCD) - char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; - #define _SET_STOP_CHAR(A,C) (chr## A = C) - #else - #define _SET_STOP_CHAR(A,C) ; - #endif - - #define _ENDSTOP_HIT_ECHO(A,C) do{ \ - SERIAL_ECHOPAIR(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); \ - _SET_STOP_CHAR(A,C); }while(0) - - #define _ENDSTOP_HIT_TEST(A,C) \ - if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \ - _ENDSTOP_HIT_ECHO(A,C) - - #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') - #define ENDSTOP_HIT_TEST_Y() _ENDSTOP_HIT_TEST(Y,'Y') - #define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z') - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); - ENDSTOP_HIT_TEST_X(); - ENDSTOP_HIT_TEST_Y(); - ENDSTOP_HIT_TEST_Z(); - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #define P_AXIS Z_AXIS - if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); - #endif - SERIAL_EOL(); - - #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) - if (planner.abort_on_endstop_hit) { - card.sdprinting = false; - card.closefile(); - quickstop_stepper(); - thermalManager.disable_all_heaters(); // switch off all heaters. - } - #endif - } - prev_hit_state = hit_state; -} // Endstops::report_state - -void Endstops::M119() { - SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); - #define ES_REPORT(AXIS) do{ \ - SERIAL_PROTOCOLPGM(MSG_##AXIS); \ - SERIAL_PROTOCOLLN(((READ(AXIS##_PIN)^AXIS##_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); \ - }while(0) - #if HAS_X_MIN - ES_REPORT(X_MIN); - #endif - #if HAS_X2_MIN - ES_REPORT(X2_MIN); - #endif - #if HAS_X_MAX - ES_REPORT(X_MAX); - #endif - #if HAS_X2_MAX - ES_REPORT(X2_MAX); - #endif - #if HAS_Y_MIN - ES_REPORT(Y_MIN); - #endif - #if HAS_Y2_MIN - ES_REPORT(Y2_MIN); - #endif - #if HAS_Y_MAX - ES_REPORT(Y_MAX); - #endif - #if HAS_Y2_MAX - ES_REPORT(Y2_MAX); - #endif - #if HAS_Z_MIN - ES_REPORT(Z_MIN); - #endif - #if HAS_Z2_MIN - ES_REPORT(Z2_MIN); - #endif - #if HAS_Z_MAX - ES_REPORT(Z_MAX); - #endif - #if HAS_Z2_MAX - ES_REPORT(Z2_MAX); - #endif - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - SERIAL_PROTOCOLPGM(MSG_Z_PROBE); - SERIAL_PROTOCOLLN(((READ(Z_MIN_PROBE_PIN)^Z_MIN_PROBE_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); - #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); - SERIAL_PROTOCOLLN(((READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); - #endif -} // Endstops::M119 - -// The following routines are called from an ISR context. It could be the temperature ISR, the -// endstop ISR or the Stepper ISR. - -#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX -#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN -#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING - -// Check endstops - Could be called from Temperature ISR! -void Endstops::update() { - - #if DISABLED(ENDSTOP_NOISE_FILTER) - if (!abort_enabled()) return; - #endif - - #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) - #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - // With Dual X, endstops are only checked in the homing direction for the active extruder - #if ENABLED(DUAL_X_CARRIAGE) - #define E0_ACTIVE stepper.movement_extruder() == 0 - #define X_MIN_TEST ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE)) - #define X_MAX_TEST ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE)) - #else - #define X_MIN_TEST true - #define X_MAX_TEST true - #endif - - // Use HEAD for core axes, AXIS for others - #if CORE_IS_XY || CORE_IS_XZ - #define X_AXIS_HEAD X_HEAD - #else - #define X_AXIS_HEAD X_AXIS - #endif - #if CORE_IS_XY || CORE_IS_YZ - #define Y_AXIS_HEAD Y_HEAD - #else - #define Y_AXIS_HEAD Y_AXIS - #endif - #if CORE_IS_XZ || CORE_IS_YZ - #define Z_AXIS_HEAD Z_HEAD - #else - #define Z_AXIS_HEAD Z_AXIS - #endif - - /** - * Check and update endstops - */ - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MIN); - #if HAS_X2_MIN - UPDATE_ENDSTOP_BIT(X2, MIN); - #else - COPY_LIVE_STATE(X_MIN, X2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(X, MAX); - #if HAS_X2_MAX - UPDATE_ENDSTOP_BIT(X2, MAX); - #else - COPY_LIVE_STATE(X_MAX, X2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(X, MAX); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MIN); - #if HAS_Y2_MIN - UPDATE_ENDSTOP_BIT(Y2, MIN); - #else - COPY_LIVE_STATE(Y_MIN, Y2_MIN); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(Y_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Y, MAX); - #if HAS_Y2_MAX - UPDATE_ENDSTOP_BIT(Y2, MAX); - #else - COPY_LIVE_STATE(Y_MAX, Y2_MAX); - #endif - #else - UPDATE_ENDSTOP_BIT(Y, MAX); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MIN); - #if HAS_Z2_MIN - UPDATE_ENDSTOP_BIT(Z2, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z2_MIN); - #endif - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - UPDATE_ENDSTOP_BIT(Z, MIN); - #elif Z_HOME_DIR < 0 - UPDATE_ENDSTOP_BIT(Z, MIN); - #endif - #endif - - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - #if HAS_Z_MAX - // Check both Z dual endstops - #if ENABLED(Z_DUAL_ENDSTOPS) - UPDATE_ENDSTOP_BIT(Z, MAX); - #if HAS_Z2_MAX - UPDATE_ENDSTOP_BIT(Z2, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z2_MAX); - #endif - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin isn't the bed probe it's the Z endstop - UPDATE_ENDSTOP_BIT(Z, MAX); - #endif - #endif - - #if ENABLED(ENDSTOP_NOISE_FILTER) - /** - * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise, - * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution - * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample - * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes - * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It - * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances - * still exist. The only way to reduce them further is to increase the number of samples. - * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay). - */ - static esbits_t old_live_state; - if (old_live_state != live_state) { - endstop_poll_count = 7; - old_live_state = live_state; - } - else if (endstop_poll_count && !--endstop_poll_count) - validated_live_state = live_state; - - if (!abort_enabled()) return; - - #endif - - // Test the current status of an endstop - #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) - - // Record endstop was hit - #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) - - // Call the endstop triggered routine for single endstops - #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \ - if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ - _ENDSTOP_HIT(AXIS, MINMAX); \ - planner.endstop_triggered(_AXIS(AXIS)); \ - } \ - }while(0) - - // Call the endstop triggered routine for dual endstops - #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \ - const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX)) << 1); \ - if (dual_hit) { \ - _ENDSTOP_HIT(AXIS1, MINMAX); \ - /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.homing_dual_axis || dual_hit == 0b11) \ - planner.endstop_triggered(_AXIS(AXIS1)); \ - } \ - }while(0) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) { - if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { - if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); } - else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); } - else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); } - G38_endstop_hit = true; - } - } - #endif - - // Now, we must signal, after validation, if an endstop limit is pressed or not - if (stepper.axis_is_moving(X_AXIS)) { - if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction - #if HAS_X_MIN - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MIN); - #else - if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN); - #endif - #endif - } - else { // +direction - #if HAS_X_MAX - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MAX); - #else - if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Y_AXIS)) { - if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction - #if HAS_Y_MIN - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); - #else - PROCESS_ENDSTOP(Y, MIN); - #endif - #endif - } - else { // +direction - #if HAS_Y_MAX - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); - #else - PROCESS_ENDSTOP(Y, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Z_AXIS)) { - if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. - #if HAS_Z_MIN - #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MIN); - #else - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #elif ENABLED(Z_MIN_PROBE_ENDSTOP) - if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #else - PROCESS_ENDSTOP(Z, MIN); - #endif - #endif - #endif - - // When closing the gap check the enabled probe - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); - #endif - } - else { // Z +direction. Gantry up, bed down. - #if HAS_Z_MAX - #if ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); - #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin is not hijacked for the bed probe - // then it belongs to the Z endstop - PROCESS_ENDSTOP(Z, MAX); - #endif - #endif - } - } -} // Endstops::update() - -#if ENABLED(PINS_DEBUGGING) - - bool Endstops::monitor_flag = false; - - /** - * monitors endstops & Z probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - * - */ - void Endstops::monitor() { - - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - - #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); - #endif - #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); - #endif - #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); - #endif - #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); - #endif - #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); - #endif - #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); - #endif - #if HAS_X2_MIN - if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN); - #endif - #if HAS_X2_MAX - if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX); - #endif - #if HAS_Y2_MIN - if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN); - #endif - #if HAS_Y2_MAX - if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX); - #endif - #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); - #endif - #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - - if (endstop_change) { - #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", TEST(live_state_local, X_MIN)); - #endif - #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", TEST(live_state_local, X_MAX)); - #endif - #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", TEST(live_state_local, Y_MIN)); - #endif - #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", TEST(live_state_local, Y_MAX)); - #endif - #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", TEST(live_state_local, Z_MIN)); - #endif - #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", TEST(live_state_local, Z_MAX)); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", TEST(live_state_local, Z_MIN_PROBE)); - #endif - #if HAS_X2_MIN - if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(live_state_local, X2_MIN)); - #endif - #if HAS_X2_MAX - if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(live_state_local, X2_MAX)); - #endif - #if HAS_Y2_MIN - if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(live_state_local, Y2_MIN)); - #endif - #if HAS_Y2_MAX - if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(live_state_local, Y2_MAX)); - #endif - #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", TEST(live_state_local, Z2_MIN)); - #endif - #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", TEST(live_state_local, Z2_MAX)); - #endif - SERIAL_PROTOCOLPGM("\n\n"); - analogWrite(LED_PIN, local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } - -#endif // PINS_DEBUGGING diff --git a/Marlin_thinkerV2/Marlin/endstops.h b/Marlin_thinkerV2/Marlin/endstops.h deleted file mode 100644 index 2114e23e3a..0000000000 --- a/Marlin_thinkerV2/Marlin/endstops.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * endstops.h - manages endstops - */ - -#ifndef __ENDSTOPS_H__ -#define __ENDSTOPS_H__ - -#include "MarlinConfig.h" - -#define VALIDATE_HOMING_ENDSTOPS - -enum EndstopEnum : char { - X_MIN, - Y_MIN, - Z_MIN, - Z_MIN_PROBE, - X_MAX, - Y_MAX, - Z_MAX, - X2_MIN, - X2_MAX, - Y2_MIN, - Y2_MAX, - Z2_MIN, - Z2_MAX -}; - -class Endstops { - - public: - - static bool enabled, enabled_globally; - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - typedef uint16_t esbits_t; - #if ENABLED(X_DUAL_ENDSTOPS) - static float x_endstop_adj; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static float y_endstop_adj; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static float z_endstop_adj; - #endif - #else - typedef uint8_t esbits_t; - #endif - - private: - static esbits_t live_state; - static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index - - #if ENABLED(ENDSTOP_NOISE_FILTER) - static esbits_t validated_live_state; - static uint8_t endstop_poll_count; // Countdown from threshold for polling - #endif - - public: - Endstops() {}; - - /** - * Initialize the endstop pins - */ - static void init(); - - /** - * Are endstops or the probe set to abort the move? - */ - FORCE_INLINE static bool abort_enabled() { - return (enabled - #if HAS_BED_PROBE - || z_probe_enabled - #endif - ); - } - - /** - * Periodic call to poll endstops if required. Called from temperature ISR - */ - static void poll(); - - /** - * Update endstops bits from the pins. Apply filtering to get a verified state. - * If abort_enabled() and moving towards a triggered switch, abort the current move. - * Called from ISR contexts. - */ - static void update(); - - /** - * Get Endstop hit state. - */ - FORCE_INLINE static uint8_t trigger_state() { return hit_state; } - - /** - * Get current endstops state - */ - FORCE_INLINE static esbits_t state() { - return - #if ENABLED(ENDSTOP_NOISE_FILTER) - validated_live_state - #else - live_state - #endif - ; - } - - /** - * Report endstop hits to serial. Called from loop(). - */ - static void event_handler(); - - /** - * Report endstop positions in response to M119 - */ - static void M119(); - - // Enable / disable endstop checking globally - static void enable_globally(const bool onoff=true); - - // Enable / disable endstop checking - static void enable(const bool onoff=true); - - // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable - static void not_homing(); - - #if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - static void validate_homing_move(); - #else - FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } - #endif - - // Clear endstops (i.e., they were hit intentionally) to suppress the report - FORCE_INLINE static void hit_on_purpose() { hit_state = 0; } - - // Enable / disable endstop z-probe checking - #if HAS_BED_PROBE - static volatile bool z_probe_enabled; - static void enable_z_probe(const bool onoff=true); - #endif - - // Debugging of endstops - #if ENABLED(PINS_DEBUGGING) - static bool monitor_flag; - static void monitor(); - static void run_monitor(); - #endif -}; - -extern Endstops endstops; - -#endif // __ENDSTOPS_H__ diff --git a/Marlin_thinkerV2/Marlin/enum.h b/Marlin_thinkerV2/Marlin/enum.h deleted file mode 100644 index d525e8ee9b..0000000000 --- a/Marlin_thinkerV2/Marlin/enum.h +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __ENUM_H__ -#define __ENUM_H__ - -#include "MarlinConfig.h" - -/** - * Axis indices as enumerated constants - * - * - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space - * - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians - * - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics - */ -enum AxisEnum : unsigned char { - X_AXIS = 0, - A_AXIS = 0, - Y_AXIS = 1, - B_AXIS = 1, - Z_AXIS = 2, - C_AXIS = 2, - E_AXIS = 3, - X_HEAD = 4, - Y_HEAD = 5, - Z_HEAD = 6, - ALL_AXES = 0xFE, - NO_AXIS = 0xFF -}; - -#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. - * - */ - -/** - * Fast I/O Routines for AVR - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -#include - -#ifndef _FASTIO_ARDUINO_H_ -#define _FASTIO_ARDUINO_H_ - -#include - -#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) -#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)) -#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)) -#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)) -#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)) - -/** - * Include Ports and Functions - */ -#if AVR_ATmega328_FAMILY - #include "fastio_168.h" -#elif AVR_ATmega1284_FAMILY - #include "fastio_644.h" -#elif AVR_ATmega2560_FAMILY - #include "fastio_1280.h" -#elif AVR_AT90USB1286_FAMILY - #include "fastio_AT90USB.h" -#elif AVR_ATmega2561_FAMILY - #include "fastio_1281.h" -#else - #error "No FastIO definition for the selected AVR Board." -#endif - -#include "macros.h" - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN) - -#define _WRITE_NC(IO,V) do{ \ - if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ - else CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ -}while(0) - -#define _WRITE_C(IO,V) do{ \ - uint8_t port_bits = DIO ## IO ## _WPORT; /* Get a mask from the current port bits */ \ - if (V) port_bits = ~port_bits; /* For setting bits, invert the mask */ \ - DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \ -}while(0) - -#define _WRITE(IO,V) do{ if (&(DIO ## IO ## _RPORT) < (uint8_t*)0x100) _WRITE_NC(IO,V); else _WRITE_C(IO,V); }while(0) - -#define _TOGGLE(IO) (DIO ## IO ## _RPORT = _BV(DIO ## IO ## _PIN)) - -#define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) - -#define _GET_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _GET_TIMER(IO) DIO ## IO ## _PWM - -#define READ(IO) _READ(IO) -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) - -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) - -#define GET_INPUT(IO) _GET_INPUT(IO) -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) -#define GET_TIMER(IO) _GET_TIMER(IO) - -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -/** - * Timer and Interrupt Control - */ - -// Waveform Generation Modes -enum WaveGenMode : char { - WGM_NORMAL, // 0 - WGM_PWM_PC_8, // 1 - WGM_PWM_PC_9, // 2 - WGM_PWM_PC_10, // 3 - WGM_CTC_OCRnA, // 4 COM OCnx - WGM_FAST_PWM_8, // 5 - WGM_FAST_PWM_9, // 6 - WGM_FAST_PWM_10, // 7 - WGM_PWM_PC_FC_ICRn, // 8 - WGM_PWM_PC_FC_OCRnA, // 9 COM OCnA - WGM_PWM_PC_ICRn, // 10 - WGM_PWM_PC_OCRnA, // 11 COM OCnA - WGM_CTC_ICRn, // 12 COM OCnx - WGM_reserved, // 13 - WGM_FAST_PWM_ICRn, // 14 COM OCnA - WGM_FAST_PWM_OCRnA // 15 COM OCnA -}; - -// Compare Modes -enum CompareMode : char { - COM_NORMAL, // 0 - COM_TOGGLE, // 1 Non-PWM: OCnx ... Both PWM (WGM 9,11,14,15): OCnA only ... else NORMAL - COM_CLEAR_SET, // 2 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down - COM_SET_CLEAR // 3 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down -}; - -// Clock Sources -enum ClockSource : char { - CS_NONE, // 0 - CS_PRESCALER_1, // 1 - CS_PRESCALER_8, // 2 - CS_PRESCALER_64, // 3 - CS_PRESCALER_256, // 4 - CS_PRESCALER_1024, // 5 - CS_EXT_FALLING, // 6 - CS_EXT_RISING // 7 -}; - -// Clock Sources (Timer 2 only) -enum ClockSource2 : char { - CS2_NONE, // 0 - CS2_PRESCALER_1, // 1 - CS2_PRESCALER_8, // 2 - CS2_PRESCALER_32, // 3 - CS2_PRESCALER_64, // 4 - CS2_PRESCALER_128, // 5 - CS2_PRESCALER_256, // 6 - CS2_PRESCALER_1024 // 7 -}; - -// Get interrupt bits in an orderly way -// Ex: cs = GET_CS(0); coma1 = GET_COM(A,1); -#define GET_WGM(T) (((TCCR##T##A >> WGM##T##0) & 0x3) | ((TCCR##T##B >> WGM##T##2 << 2) & 0xC)) -#define GET_CS(T) ((TCCR##T##B >> CS##T##0) & 0x7) -#define GET_COM(T,Q) ((TCCR##T##Q >> COM##T##Q##0) & 0x3) -#define GET_COMA(T) GET_COM(T,A) -#define GET_COMB(T) GET_COM(T,B) -#define GET_COMC(T) GET_COM(T,C) -#define GET_ICNC(T) (!!(TCCR##T##B & _BV(ICNC##T))) -#define GET_ICES(T) (!!(TCCR##T##B & _BV(ICES##T))) -#define GET_FOC(T,Q) (!!(TCCR##T##C & _BV(FOC##T##Q))) -#define GET_FOCA(T) GET_FOC(T,A) -#define GET_FOCB(T) GET_FOC(T,B) -#define GET_FOCC(T) GET_FOC(T,C) - -// Set Wave Generation Mode bits -// Ex: SET_WGM(5,CTC_ICRn); -#define _SET_WGM(T,V) do{ \ - TCCR##T##A = (TCCR##T##A & ~(0x3 << WGM##T##0)) | (( int(V) & 0x3) << WGM##T##0); \ - TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \ - }while(0) -#define SET_WGM(T,V) _SET_WGM(T,WGM_##V) - -// Set Clock Select bits -// Ex: SET_CS3(PRESCALER_64); -#define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0)) -#define _SET_CS0(V) _SET_CS(0,V) -#define _SET_CS1(V) _SET_CS(1,V) -#ifdef TCCR2 - #define _SET_CS2(V) (TCCR2 = (TCCR2 & ~(0x7 << CS20)) | (int(V) << CS20)) -#else - #define _SET_CS2(V) _SET_CS(2,V) -#endif -#define _SET_CS3(V) _SET_CS(3,V) -#define _SET_CS4(V) _SET_CS(4,V) -#define _SET_CS5(V) _SET_CS(5,V) -#define SET_CS0(V) _SET_CS0(CS_##V) -#define SET_CS1(V) _SET_CS1(CS_##V) -#ifdef TCCR2 - #define SET_CS2(V) _SET_CS2(CS2_##V) -#else - #define SET_CS2(V) _SET_CS2(CS_##V) -#endif -#define SET_CS3(V) _SET_CS3(CS_##V) -#define SET_CS4(V) _SET_CS4(CS_##V) -#define SET_CS5(V) _SET_CS5(CS_##V) -#define SET_CS(T,V) SET_CS##T(V) - -// Set Compare Mode bits -// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET); -#define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0)) -#define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V) -#define SET_COMA(T,V) SET_COM(T,A,V) -#define SET_COMB(T,V) SET_COM(T,B,V) -#define SET_COMC(T,V) SET_COM(T,C,V) -#define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0) - -// Set Noise Canceler bit -// Ex: SET_ICNC(2,1) -#define SET_ICNC(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICNC##T) : TCCR##T##B & ~_BV(ICNC##T)) - -// Set Input Capture Edge Select bit -// Ex: SET_ICES(5,0) -#define SET_ICES(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICES##T) : TCCR##T##B & ~_BV(ICES##T)) - -// Set Force Output Compare bit -// Ex: SET_FOC(3,A,1) -#define SET_FOC(T,Q,V) (TCCR##T##C = (V) ? TCCR##T##C | _BV(FOC##T##Q) : TCCR##T##C & ~_BV(FOC##T##Q)) -#define SET_FOCA(T,V) SET_FOC(T,A,V) -#define SET_FOCB(T,V) SET_FOC(T,B,V) -#define SET_FOCC(T,V) SET_FOC(T,C,V) - - -/** - * PWM availability macros - */ - -// Determine which harware PWMs are already in use -#if PIN_EXISTS(CONTROLLER_FAN) - #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) -#else - #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p == E1_AUTO_FAN_PIN || p == E2_AUTO_FAN_PIN || p == E3_AUTO_FAN_PIN || p == E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN) -#endif - -#if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2) - #if PIN_EXISTS(FAN2) - #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN || p == FAN2_PIN) - #elif PIN_EXISTS(FAN1) - #define PWM_CHK_FAN_A(p) (p == FAN_PIN || p == FAN1_PIN) - #else - #define PWM_CHK_FAN_A(p) (p == FAN_PIN) - #endif -#else - #define PWM_CHK_FAN_A(p) false -#endif - -#if HAS_MOTOR_CURRENT_PWM - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z || p == MOTOR_CURRENT_PWM_XY) - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E || p == MOTOR_CURRENT_PWM_Z) - #else - #define PWM_CHK_MOTOR_CURRENT(p) (p == MOTOR_CURRENT_PWM_E) - #endif -#else - #define PWM_CHK_MOTOR_CURRENT(p) false -#endif - -#ifdef NUM_SERVOS - #if AVR_ATmega2560_FAMILY - #define PWM_CHK_SERVO(p) (p == 5 || (NUM_SERVOS > 12 && p == 6) || (NUM_SERVOS > 24 && p == 46)) // PWMS 3A, 4A & 5A - #elif AVR_ATmega2561_FAMILY - #define PWM_CHK_SERVO(p) (p == 5) // PWM3A - #elif AVR_ATmega1284_FAMILY - #define PWM_CHK_SERVO(p) false - #elif AVR_AT90USB1286_FAMILY - #define PWM_CHK_SERVO(p) (p == 16) // PWM3A - #elif AVR_ATmega328_FAMILY - #define PWM_CHK_SERVO(p) false - #endif -#else - #define PWM_CHK_SERVO(p) false -#endif - -#if ENABLED(BARICUDA) - #if HAS_HEATER_1 && HAS_HEATER_2 - #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN || p == HEATER_2_PIN) - #elif HAS_HEATER_1 - #define PWM_CHK_HEATER(p) (p == HEATER_1_PIN) - #endif -#else - #define PWM_CHK_HEATER(p) false -#endif - -#define PWM_CHK(p) (PWM_CHK_HEATER(p) || PWM_CHK_SERVO(p) || PWM_CHK_MOTOR_CURRENT(p)\ - || PWM_CHK_FAN_A(p) || PWM_CHK_FAN_B(p)) - -// define which hardware PWMs are available for the current CPU -// all timer 1 PWMS deleted from this list because they are never available -#if AVR_ATmega2560_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 10) || p == 13 || p == 44 || p == 45 || p == 46) -#elif AVR_ATmega2561_FAMILY - #define PWM_PINS(p) ((p >= 2 && p <= 6) || p == 9) -#elif AVR_ATmega1284_FAMILY - #define PWM_PINS(p) (p == 3 || p == 4 || p == 14 || p == 15) -#elif AVR_AT90USB1286_FAMILY - #define PWM_PINS(p) (p == 0 || p == 1 || p == 14 || p == 15 || p == 16 || p == 24) -#elif AVR_ATmega328_FAMILY - #define PWM_PINS(p) (p == 3 || p == 5 || p == 6 || p == 11) -#else - #error "unknown CPU" -#endif - -// finally - the macro that tells us if a pin is an available hardware PWM -#define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p)) - -#endif // _FASTIO_ARDUINO_H_ diff --git a/Marlin_thinkerV2/Marlin/fastio_1280.h b/Marlin_thinkerV2/Marlin/fastio_1280.h deleted file mode 100644 index 09bac1fd11..0000000000 --- a/Marlin_thinkerV2/Marlin/fastio_1280.h +++ /dev/null @@ -1,1115 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 1280 and 2560 - * - * Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100 - * Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx - * 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 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx - */ - -#ifndef _FASTIO_1280 -#define _FASTIO_1280 - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO21 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO52 -#define MISO DIO50 -#define MOSI DIO51 -#define SS DIO53 - -// TWI (I2C) -#define SCL DIO21 -#define SDA DIO20 - -// Timers and PWM -#define OC0A DIO13 -#define OC0B DIO4 -#define OC1A DIO11 -#define OC1B DIO12 -#define OC2A DIO10 -#define OC2B DIO9 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 -#define OC4A DIO6 -#define OC4B DIO7 -#define OC4C DIO8 -#define OC5A DIO46 -#define OC5B DIO45 -#define OC5C DIO44 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM NULL - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM NULL - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINH3 -#define DIO6_RPORT PINH -#define DIO6_WPORT PORTH -#define DIO6_DDR DDRH -#define DIO6_PWM &OCR4AL - -#define DIO7_PIN PINH4 -#define DIO7_RPORT PINH -#define DIO7_WPORT PORTH -#define DIO7_DDR DDRH -#define DIO7_PWM &OCR4BL - -#define DIO8_PIN PINH5 -#define DIO8_RPORT PINH -#define DIO8_WPORT PORTH -#define DIO8_DDR DDRH -#define DIO8_PWM &OCR4CL - -#define DIO9_PIN PINH6 -#define DIO9_RPORT PINH -#define DIO9_WPORT PORTH -#define DIO9_DDR DDRH -#define DIO9_PWM &OCR2B - -#define DIO10_PIN PINB4 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM &OCR2A - -#define DIO11_PIN PINB5 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM NULL - -#define DIO12_PIN PINB6 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINB7 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM &OCR0A - -#define DIO14_PIN PINJ1 -#define DIO14_RPORT PINJ -#define DIO14_WPORT PORTJ -#define DIO14_DDR DDRJ -#define DIO14_PWM NULL - -#define DIO15_PIN PINJ0 -#define DIO15_RPORT PINJ -#define DIO15_WPORT PORTJ -#define DIO15_DDR DDRJ -#define DIO15_PWM NULL - -#define DIO16_PIN PINH1 -#define DIO16_RPORT PINH -#define DIO16_WPORT PORTH -#define DIO16_DDR DDRH -#define DIO16_PWM NULL - -#define DIO17_PIN PINH0 -#define DIO17_RPORT PINH -#define DIO17_WPORT PORTH -#define DIO17_DDR DDRH -#define DIO17_PWM NULL - -#define DIO18_PIN PIND3 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM NULL - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM NULL - -#define DIO20_PIN PIND1 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM NULL - -#define DIO21_PIN PIND0 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM NULL - -#define DIO22_PIN PINA0 -#define DIO22_RPORT PINA -#define DIO22_WPORT PORTA -#define DIO22_DDR DDRA -#define DIO22_PWM NULL - -#define DIO23_PIN PINA1 -#define DIO23_RPORT PINA -#define DIO23_WPORT PORTA -#define DIO23_DDR DDRA -#define DIO23_PWM NULL - -#define DIO24_PIN PINA2 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM NULL - -#define DIO25_PIN PINA3 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM NULL - -#define DIO26_PIN PINA4 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM NULL - -#define DIO27_PIN PINA5 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM NULL - -#define DIO28_PIN PINA6 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM NULL - -#define DIO29_PIN PINA7 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM NULL - -#define DIO30_PIN PINC7 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM NULL - -#define DIO31_PIN PINC6 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM NULL - -#define DIO32_PIN PINC5 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM NULL - -#define DIO33_PIN PINC4 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM NULL - -#define DIO34_PIN PINC3 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM NULL - -#define DIO35_PIN PINC2 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM NULL - -#define DIO36_PIN PINC1 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM NULL - -#define DIO37_PIN PINC0 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM NULL - -#define DIO38_PIN PIND7 -#define DIO38_RPORT PIND -#define DIO38_WPORT PORTD -#define DIO38_DDR DDRD -#define DIO38_PWM NULL - -#define DIO39_PIN PING2 -#define DIO39_RPORT PING -#define DIO39_WPORT PORTG -#define DIO39_DDR DDRG -#define DIO39_PWM NULL - -#define DIO40_PIN PING1 -#define DIO40_RPORT PING -#define DIO40_WPORT PORTG -#define DIO40_DDR DDRG -#define DIO40_PWM NULL - -#define DIO41_PIN PING0 -#define DIO41_RPORT PING -#define DIO41_WPORT PORTG -#define DIO41_DDR DDRG -#define DIO41_PWM NULL - -#define DIO42_PIN PINL7 -#define DIO42_RPORT PINL -#define DIO42_WPORT PORTL -#define DIO42_DDR DDRL -#define DIO42_PWM NULL - -#define DIO43_PIN PINL6 -#define DIO43_RPORT PINL -#define DIO43_WPORT PORTL -#define DIO43_DDR DDRL -#define DIO43_PWM NULL - -#define DIO44_PIN PINL5 -#define DIO44_RPORT PINL -#define DIO44_WPORT PORTL -#define DIO44_DDR DDRL -#define DIO44_PWM &OCR5CL - -#define DIO45_PIN PINL4 -#define DIO45_RPORT PINL -#define DIO45_WPORT PORTL -#define DIO45_DDR DDRL -#define DIO45_PWM &OCR5BL - -#define DIO46_PIN PINL3 -#define DIO46_RPORT PINL -#define DIO46_WPORT PORTL -#define DIO46_DDR DDRL -#define DIO46_PWM &OCR5AL - -#define DIO47_PIN PINL2 -#define DIO47_RPORT PINL -#define DIO47_WPORT PORTL -#define DIO47_DDR DDRL -#define DIO47_PWM NULL - -#define DIO48_PIN PINL1 -#define DIO48_RPORT PINL -#define DIO48_WPORT PORTL -#define DIO48_DDR DDRL -#define DIO48_PWM NULL - -#define DIO49_PIN PINL0 -#define DIO49_RPORT PINL -#define DIO49_WPORT PORTL -#define DIO49_DDR DDRL -#define DIO49_PWM NULL - -#define DIO50_PIN PINB3 -#define DIO50_RPORT PINB -#define DIO50_WPORT PORTB -#define DIO50_DDR DDRB -#define DIO50_PWM NULL - -#define DIO51_PIN PINB2 -#define DIO51_RPORT PINB -#define DIO51_WPORT PORTB -#define DIO51_DDR DDRB -#define DIO51_PWM NULL - -#define DIO52_PIN PINB1 -#define DIO52_RPORT PINB -#define DIO52_WPORT PORTB -#define DIO52_DDR DDRB -#define DIO52_PWM NULL - -#define DIO53_PIN PINB0 -#define DIO53_RPORT PINB -#define DIO53_WPORT PORTB -#define DIO53_DDR DDRB -#define DIO53_PWM NULL - -#define DIO54_PIN PINF0 -#define DIO54_RPORT PINF -#define DIO54_WPORT PORTF -#define DIO54_DDR DDRF -#define DIO54_PWM NULL - -#define DIO55_PIN PINF1 -#define DIO55_RPORT PINF -#define DIO55_WPORT PORTF -#define DIO55_DDR DDRF -#define DIO55_PWM NULL - -#define DIO56_PIN PINF2 -#define DIO56_RPORT PINF -#define DIO56_WPORT PORTF -#define DIO56_DDR DDRF -#define DIO56_PWM NULL - -#define DIO57_PIN PINF3 -#define DIO57_RPORT PINF -#define DIO57_WPORT PORTF -#define DIO57_DDR DDRF -#define DIO57_PWM NULL - -#define DIO58_PIN PINF4 -#define DIO58_RPORT PINF -#define DIO58_WPORT PORTF -#define DIO58_DDR DDRF -#define DIO58_PWM NULL - -#define DIO59_PIN PINF5 -#define DIO59_RPORT PINF -#define DIO59_WPORT PORTF -#define DIO59_DDR DDRF -#define DIO59_PWM NULL - -#define DIO60_PIN PINF6 -#define DIO60_RPORT PINF -#define DIO60_WPORT PORTF -#define DIO60_DDR DDRF -#define DIO60_PWM NULL - -#define DIO61_PIN PINF7 -#define DIO61_RPORT PINF -#define DIO61_WPORT PORTF -#define DIO61_DDR DDRF -#define DIO61_PWM NULL - -#define DIO62_PIN PINK0 -#define DIO62_RPORT PINK -#define DIO62_WPORT PORTK -#define DIO62_DDR DDRK -#define DIO62_PWM NULL - -#define DIO63_PIN PINK1 -#define DIO63_RPORT PINK -#define DIO63_WPORT PORTK -#define DIO63_DDR DDRK -#define DIO63_PWM NULL - -#define DIO64_PIN PINK2 -#define DIO64_RPORT PINK -#define DIO64_WPORT PORTK -#define DIO64_DDR DDRK -#define DIO64_PWM NULL - -#define DIO65_PIN PINK3 -#define DIO65_RPORT PINK -#define DIO65_WPORT PORTK -#define DIO65_DDR DDRK -#define DIO65_PWM NULL - -#define DIO66_PIN PINK4 -#define DIO66_RPORT PINK -#define DIO66_WPORT PORTK -#define DIO66_DDR DDRK -#define DIO66_PWM NULL - -#define DIO67_PIN PINK5 -#define DIO67_RPORT PINK -#define DIO67_WPORT PORTK -#define DIO67_DDR DDRK -#define DIO67_PWM NULL - -#define DIO68_PIN PINK6 -#define DIO68_RPORT PINK -#define DIO68_WPORT PORTK -#define DIO68_DDR DDRK -#define DIO68_PWM NULL - -#define DIO69_PIN PINK7 -#define DIO69_RPORT PINK -#define DIO69_WPORT PORTK -#define DIO69_DDR DDRK -#define DIO69_PWM NULL - -#define DIO70_PIN PING4 -#define DIO70_RPORT PING -#define DIO70_WPORT PORTG -#define DIO70_DDR DDRG -#define DIO70_PWM NULL - -#define DIO71_PIN PING3 -#define DIO71_RPORT PING -#define DIO71_WPORT PORTG -#define DIO71_DDR DDRG -#define DIO71_PWM NULL - -#define DIO72_PIN PINJ2 -#define DIO72_RPORT PINJ -#define DIO72_WPORT PORTJ -#define DIO72_DDR DDRJ -#define DIO72_PWM NULL - -#define DIO73_PIN PINJ3 -#define DIO73_RPORT PINJ -#define DIO73_WPORT PORTJ -#define DIO73_DDR DDRJ -#define DIO73_PWM NULL - -#define DIO74_PIN PINJ7 -#define DIO74_RPORT PINJ -#define DIO74_WPORT PORTJ -#define DIO74_DDR DDRJ -#define DIO74_PWM NULL - -#define DIO75_PIN PINJ4 -#define DIO75_RPORT PINJ -#define DIO75_WPORT PORTJ -#define DIO75_DDR DDRJ -#define DIO75_PWM NULL - -#define DIO76_PIN PINJ5 -#define DIO76_RPORT PINJ -#define DIO76_WPORT PORTJ -#define DIO76_DDR DDRJ -#define DIO76_PWM NULL - -#define DIO77_PIN PINJ6 -#define DIO77_RPORT PINJ -#define DIO77_WPORT PORTJ -#define DIO77_DDR DDRJ -#define DIO77_PWM NULL - -#define DIO78_PIN PINE2 -#define DIO78_RPORT PINE -#define DIO78_WPORT PORTE -#define DIO78_DDR DDRE -#define DIO78_PWM NULL - -#define DIO79_PIN PINE6 -#define DIO79_RPORT PINE -#define DIO79_WPORT PORTE -#define DIO79_DDR DDRE -#define DIO79_PWM NULL - -#define DIO80_PIN PINE7 -#define DIO80_RPORT PINE -#define DIO80_WPORT PORTE -#define DIO80_DDR DDRE -#define DIO80_PWM NULL - -#define DIO81_PIN PIND4 -#define DIO81_RPORT PIND -#define DIO81_WPORT PORTD -#define DIO81_DDR DDRD -#define DIO81_PWM NULL - -#define DIO82_PIN PIND5 -#define DIO82_RPORT PIND -#define DIO82_WPORT PORTD -#define DIO82_DDR DDRD -#define DIO82_PWM NULL - -#define DIO83_PIN PIND6 -#define DIO83_RPORT PIND -#define DIO83_WPORT PORTD -#define DIO83_DDR DDRD -#define DIO83_PWM NULL - -#define DIO84_PIN PINH2 -#define DIO84_RPORT PINH -#define DIO84_WPORT PORTH -#define DIO84_DDR DDRH -#define DIO84_PWM NULL - -#define DIO85_PIN PINH7 -#define DIO85_RPORT PINH -#define DIO85_WPORT PORTH -#define DIO85_DDR DDRH -#define DIO85_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM NULL -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM NULL -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM NULL -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM NULL -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM NULL -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM NULL -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM NULL - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM NULL -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM NULL -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM NULL -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM NULL -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM NULL -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM NULL -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM NULL -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM NULL - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM NULL -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM NULL -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM NULL -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM NULL -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM NULL -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B - -#undef PH0 -#define PH0_PIN PINH0 -#define PH0_RPORT PINH -#define PH0_WPORT PORTH -#define PH0_DDR DDRH -#define PH0_PWM NULL -#undef PH1 -#define PH1_PIN PINH1 -#define PH1_RPORT PINH -#define PH1_WPORT PORTH -#define PH1_DDR DDRH -#define PH1_PWM NULL -#undef PH2 -#define PH2_PIN PINH2 -#define PH2_RPORT PINH -#define PH2_WPORT PORTH -#define PH2_DDR DDRH -#define PH2_PWM NULL -#undef PH3 -#define PH3_PIN PINH3 -#define PH3_RPORT PINH -#define PH3_WPORT PORTH -#define PH3_DDR DDRH -#define PH3_PWM &OCR4AL -#undef PH4 -#define PH4_PIN PINH4 -#define PH4_RPORT PINH -#define PH4_WPORT PORTH -#define PH4_DDR DDRH -#define PH4_PWM &OCR4BL -#undef PH5 -#define PH5_PIN PINH5 -#define PH5_RPORT PINH -#define PH5_WPORT PORTH -#define PH5_DDR DDRH -#define PH5_PWM &OCR4CL -#undef PH6 -#define PH6_PIN PINH6 -#define PH6_RPORT PINH -#define PH6_WPORT PORTH -#define PH6_DDR DDRH -#define PH6_PWM &OCR2B -#undef PH7 -#define PH7_PIN PINH7 -#define PH7_RPORT PINH -#define PH7_WPORT PORTH -#define PH7_DDR DDRH -#define PH7_PWM NULL - -#undef PJ0 -#define PJ0_PIN PINJ0 -#define PJ0_RPORT PINJ -#define PJ0_WPORT PORTJ -#define PJ0_DDR DDRJ -#define PJ0_PWM NULL -#undef PJ1 -#define PJ1_PIN PINJ1 -#define PJ1_RPORT PINJ -#define PJ1_WPORT PORTJ -#define PJ1_DDR DDRJ -#define PJ1_PWM NULL -#undef PJ2 -#define PJ2_PIN PINJ2 -#define PJ2_RPORT PINJ -#define PJ2_WPORT PORTJ -#define PJ2_DDR DDRJ -#define PJ2_PWM NULL -#undef PJ3 -#define PJ3_PIN PINJ3 -#define PJ3_RPORT PINJ -#define PJ3_WPORT PORTJ -#define PJ3_DDR DDRJ -#define PJ3_PWM NULL -#undef PJ4 -#define PJ4_PIN PINJ4 -#define PJ4_RPORT PINJ -#define PJ4_WPORT PORTJ -#define PJ4_DDR DDRJ -#define PJ4_PWM NULL -#undef PJ5 -#define PJ5_PIN PINJ5 -#define PJ5_RPORT PINJ -#define PJ5_WPORT PORTJ -#define PJ5_DDR DDRJ -#define PJ5_PWM NULL -#undef PJ6 -#define PJ6_PIN PINJ6 -#define PJ6_RPORT PINJ -#define PJ6_WPORT PORTJ -#define PJ6_DDR DDRJ -#define PJ6_PWM NULL -#undef PJ7 -#define PJ7_PIN PINJ7 -#define PJ7_RPORT PINJ -#define PJ7_WPORT PORTJ -#define PJ7_DDR DDRJ -#define PJ7_PWM NULL - -#undef PK0 -#define PK0_PIN PINK0 -#define PK0_RPORT PINK -#define PK0_WPORT PORTK -#define PK0_DDR DDRK -#define PK0_PWM NULL -#undef PK1 -#define PK1_PIN PINK1 -#define PK1_RPORT PINK -#define PK1_WPORT PORTK -#define PK1_DDR DDRK -#define PK1_PWM NULL -#undef PK2 -#define PK2_PIN PINK2 -#define PK2_RPORT PINK -#define PK2_WPORT PORTK -#define PK2_DDR DDRK -#define PK2_PWM NULL -#undef PK3 -#define PK3_PIN PINK3 -#define PK3_RPORT PINK -#define PK3_WPORT PORTK -#define PK3_DDR DDRK -#define PK3_PWM NULL -#undef PK4 -#define PK4_PIN PINK4 -#define PK4_RPORT PINK -#define PK4_WPORT PORTK -#define PK4_DDR DDRK -#define PK4_PWM NULL -#undef PK5 -#define PK5_PIN PINK5 -#define PK5_RPORT PINK -#define PK5_WPORT PORTK -#define PK5_DDR DDRK -#define PK5_PWM NULL -#undef PK6 -#define PK6_PIN PINK6 -#define PK6_RPORT PINK -#define PK6_WPORT PORTK -#define PK6_DDR DDRK -#define PK6_PWM NULL -#undef PK7 -#define PK7_PIN PINK7 -#define PK7_RPORT PINK -#define PK7_WPORT PORTK -#define PK7_DDR DDRK -#define PK7_PWM NULL - -#undef PL0 -#define PL0_PIN PINL0 -#define PL0_RPORT PINL -#define PL0_WPORT PORTL -#define PL0_DDR DDRL -#define PL0_PWM NULL -#undef PL1 -#define PL1_PIN PINL1 -#define PL1_RPORT PINL -#define PL1_WPORT PORTL -#define PL1_DDR DDRL -#define PL1_PWM NULL -#undef PL2 -#define PL2_PIN PINL2 -#define PL2_RPORT PINL -#define PL2_WPORT PORTL -#define PL2_DDR DDRL -#define PL2_PWM NULL -#undef PL3 -#define PL3_PIN PINL3 -#define PL3_RPORT PINL -#define PL3_WPORT PORTL -#define PL3_DDR DDRL -#define PL3_PWM &OCR5AL -#undef PL4 -#define PL4_PIN PINL4 -#define PL4_RPORT PINL -#define PL4_WPORT PORTL -#define PL4_DDR DDRL -#define PL4_PWM &OCR5BL -#undef PL5 -#define PL5_PIN PINL5 -#define PL5_RPORT PINL -#define PL5_WPORT PORTL -#define PL5_DDR DDRL -#define PL5_PWM &OCR5CL -#undef PL6 -#define PL6_PIN PINL6 -#define PL6_RPORT PINL -#define PL6_WPORT PORTL -#define PL6_DDR DDRL -#define PL6_PWM NULL -#undef PL7 -#define PL7_PIN PINL7 -#define PL7_RPORT PINL -#define PL7_WPORT PORTL -#define PL7_DDR DDRL -#define PL7_PWM NULL - -#endif // _FASTIO_1280 diff --git a/Marlin_thinkerV2/Marlin/fastio_1281.h b/Marlin_thinkerV2/Marlin/fastio_1281.h deleted file mode 100644 index ab90a5ff9b..0000000000 --- a/Marlin_thinkerV2/Marlin/fastio_1281.h +++ /dev/null @@ -1,719 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 1281 and 2561 - * - * Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04 - * 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 - */ - -#ifndef _FASTIO_1281 -#define _FASTIO_1281 - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO46 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO10 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO16 - -// TWI (I2C) -#define SCL DIO17 -#define SDA DIO18 - -// Timers and PWM -#define OC0A DIO9 -#define OC0B DIO4 -#define OC1A DIO7 -#define OC1B DIO8 -#define OC2A DIO6 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM NULL - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM NULL - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINB4 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM &OCR2AL - -#define DIO7_PIN PINB5 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM &OCR1AL - -#define DIO8_PIN PINB6 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM &OCR1BL - -#define DIO9_PIN PINB7 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM &OCR0AL - -#define DIO10_PIN PINB1 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM NULL - -#define DIO11_PIN PINB2 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM NULL - -#define DIO12_PIN PINB3 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINE2 -#define DIO13_RPORT PINE -#define DIO13_WPORT PORTE -#define DIO13_DDR DDRE -#define DIO13_PWM NULL - -#define DIO14_PIN PINE6 -#define DIO14_RPORT PINE -#define DIO14_WPORT PORTE -#define DIO14_DDR DDRE -#define DIO14_PWM NULL - -#define DIO15_PIN PINE7 -#define DIO15_RPORT PINE -#define DIO15_WPORT PORTE -#define DIO15_DDR DDRE -#define DIO15_PWM NULL - -#define DIO16_PIN PINB0 -#define DIO16_RPORT PINB -#define DIO16_WPORT PORTB -#define DIO16_DDR DDRB -#define DIO16_PWM NULL - -#define DIO17_PIN PIND0 -#define DIO17_RPORT PIND -#define DIO17_WPORT PORTD -#define DIO17_DDR DDRD -#define DIO17_PWM NULL - -#define DIO18_PIN PIND1 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM NULL - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM NULL - -#define DIO20_PIN PIND3 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM NULL - -#define DIO21_PIN PIND4 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM NULL - -#define DIO22_PIN PIND5 -#define DIO22_RPORT PIND -#define DIO22_WPORT PORTD -#define DIO22_DDR DDRD -#define DIO22_PWM NULL - -#define DIO23_PIN PIND6 -#define DIO23_RPORT PIND -#define DIO23_WPORT PORTD -#define DIO23_DDR DDRD -#define DIO23_PWM NULL - -#define DIO24_PIN PIND7 -#define DIO24_RPORT PIND -#define DIO24_WPORT PORTD -#define DIO24_DDR DDRD -#define DIO24_PWM NULL - -#define DIO25_PIN PING0 -#define DIO25_RPORT PING -#define DIO25_WPORT PORTG -#define DIO25_DDR DDRG -#define DIO25_PWM NULL - -#define DIO26_PIN PING1 -#define DIO26_RPORT PING -#define DIO26_WPORT PORTG -#define DIO26_DDR DDRG -#define DIO26_PWM NULL - -#define DIO27_PIN PING2 -#define DIO27_RPORT PING -#define DIO27_WPORT PORTG -#define DIO27_DDR DDRG -#define DIO27_PWM NULL - -#define DIO28_PIN PING3 -#define DIO28_RPORT PING -#define DIO28_WPORT PORTG -#define DIO28_DDR DDRG -#define DIO28_PWM NULL - -#define DIO29_PIN PING4 -#define DIO29_RPORT PING -#define DIO29_WPORT PORTG -#define DIO29_DDR DDRG -#define DIO29_PWM NULL - -#define DIO30_PIN PINC0 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM NULL - -#define DIO31_PIN PINC1 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM NULL - -#define DIO32_PIN PINC2 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM NULL - -#define DIO33_PIN PINC3 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM NULL - -#define DIO34_PIN PINC4 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM NULL - -#define DIO35_PIN PINC5 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM NULL - -#define DIO36_PIN PINC6 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM NULL - -#define DIO37_PIN PINC7 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM NULL - -#define DIO38_PIN PINA0 -#define DIO38_RPORT PINA -#define DIO38_WPORT PORTA -#define DIO38_DDR DDRA -#define DIO38_PWM NULL - -#define DIO39_PIN PINA1 -#define DIO39_RPORT PINA -#define DIO39_WPORT PORTA -#define DIO39_DDR DDRA -#define DIO39_PWM NULL - -#define DIO40_PIN PINA2 -#define DIO40_RPORT PINA -#define DIO40_WPORT PORTA -#define DIO40_DDR DDRA -#define DIO40_PWM NULL - -#define DIO41_PIN PINA3 -#define DIO41_RPORT PINA -#define DIO41_WPORT PORTA -#define DIO41_DDR DDRA -#define DIO41_PWM NULL - -#define DIO42_PIN PINA4 -#define DIO42_RPORT PINA -#define DIO42_WPORT PORTA -#define DIO42_DDR DDRA -#define DIO42_PWM NULL - -#define DIO43_PIN PINA5 -#define DIO43_RPORT PINA -#define DIO43_WPORT PORTA -#define DIO43_DDR DDRA -#define DIO43_PWM NULL - -#define DIO44_PIN PINA6 -#define DIO44_RPORT PINA -#define DIO44_WPORT PORTA -#define DIO44_DDR DDRA -#define DIO44_PWM NULL - -#define DIO45_PIN PINA7 -#define DIO45_RPORT PINA -#define DIO45_WPORT PORTA -#define DIO45_DDR DDRA -#define DIO45_PWM NULL - -#define DIO46_PIN PINF0 -#define DIO46_RPORT PINF -#define DIO46_WPORT PORTF -#define DIO46_DDR DDRF -#define DIO46_PWM NULL - -#define DIO47_PIN PINF1 -#define DIO47_RPORT PINF -#define DIO47_WPORT PORTF -#define DIO47_DDR DDRF -#define DIO47_PWM NULL - -#define DIO48_PIN PINF2 -#define DIO48_RPORT PINF -#define DIO48_WPORT PORTF -#define DIO48_DDR DDRF -#define DIO48_PWM NULL - -#define DIO49_PIN PINF3 -#define DIO49_RPORT PINF -#define DIO49_WPORT PORTF -#define DIO49_DDR DDRF -#define DIO49_PWM NULL - -#define DIO50_PIN PINF4 -#define DIO50_RPORT PINF -#define DIO50_WPORT PORTF -#define DIO50_DDR DDRF -#define DIO50_PWM NULL - -#define DIO51_PIN PINF5 -#define DIO51_RPORT PINF -#define DIO51_WPORT PORTF -#define DIO51_DDR DDRF -#define DIO51_PWM NULL - -#define DIO52_PIN PINF6 -#define DIO52_RPORT PINF -#define DIO52_WPORT PORTF -#define DIO52_DDR DDRF -#define DIO52_PWM NULL - -#define DIO53_PIN PINF7 -#define DIO53_RPORT PINF -#define DIO53_WPORT PORTF -#define DIO53_DDR DDRF -#define DIO53_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM NULL -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM NULL -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM NULL -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM NULL -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM NULL -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM NULL -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM NULL - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM NULL -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM NULL -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM NULL -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM NULL -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM NULL -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM NULL -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM NULL -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM NULL - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM NULL -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM NULL -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM NULL -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM NULL -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM NULL -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B - -#endif // _FASTIO_1281 diff --git a/Marlin_thinkerV2/Marlin/fastio_168.h b/Marlin_thinkerV2/Marlin/fastio_168.h deleted file mode 100644 index e624654287..0000000000 --- a/Marlin_thinkerV2/Marlin/fastio_168.h +++ /dev/null @@ -1,361 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 168, 328, and 328P - * - * Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07 - * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 - */ - -#ifndef _FASTIO_168 -#define _FASTIO_168 - -#include "fastio.h" - -#define DEBUG_LED AIO5 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO13 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO10 - -// TWI (I2C) -#define SCL AIO5 -#define SDA AIO4 - -// Timers and PWM -#define OC0A DIO6 -#define OC0B DIO5 -#define OC1A DIO9 -#define OC1B DIO10 -#define OC2A DIO11 -#define OC2B DIO3 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_DDR DDRD -#define DIO0_PWM NULL - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_DDR DDRD -#define DIO1_PWM NULL - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_DDR DDRD -#define DIO2_PWM NULL - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_DDR DDRD -#define DIO3_PWM &OCR2B - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_DDR DDRD -#define DIO4_PWM NULL - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_DDR DDRD -#define DIO5_PWM &OCR0B - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_DDR DDRD -#define DIO6_PWM &OCR0A - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_DDR DDRD -#define DIO7_PWM NULL - -#define DIO8_PIN PINB0 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM NULL - -#define DIO9_PIN PINB1 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM NULL - -#define DIO10_PIN PINB2 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM NULL - -#define DIO11_PIN PINB3 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM &OCR2A - -#define DIO12_PIN PINB4 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM NULL - -#define DIO13_PIN PINB5 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM NULL - -#define DIO14_PIN PINC0 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_DDR DDRC -#define DIO14_PWM NULL - -#define DIO15_PIN PINC1 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_DDR DDRC -#define DIO15_PWM NULL - -#define DIO16_PIN PINC2 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM NULL - -#define DIO17_PIN PINC3 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM NULL - -#define DIO18_PIN PINC4 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM NULL - -#define DIO19_PIN PINC5 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM NULL - -#define DIO20_PIN PINC6 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM NULL - -#define DIO21_PIN PINC7 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM &OCR2A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM NULL - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM NULL - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM &OCR2B - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM &OCR0B - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM &OCR0A - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM NULL - -#endif // _FASTIO_168 diff --git a/Marlin_thinkerV2/Marlin/fastio_644.h b/Marlin_thinkerV2/Marlin/fastio_644.h deleted file mode 100644 index 6a6e977f9e..0000000000 --- a/Marlin_thinkerV2/Marlin/fastio_644.h +++ /dev/null @@ -1,556 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping for the 644, 644p, 644pa, and 1284p - * - * 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 - * Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0 - */ - -/** ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - */ - -#ifndef _FASTIO_644 -#define _FASTIO_644 - -#include "fastio.h" - -#define DEBUG_LED DIO0 - -// UART -#define RXD DIO8 -#define TXD DIO9 -#define RXD0 DIO8 -#define TXD0 DIO9 - -#define RXD1 DIO10 -#define TXD1 DIO11 - -// SPI -#define SCK DIO7 -#define MISO DIO6 -#define MOSI DIO5 -#define SS DIO4 - -// TWI (I2C) -#define SCL DIO16 -#define SDA DIO17 - -// Timers and PWM -#define OC0A DIO3 -#define OC0B DIO4 -#define OC1A DIO13 -#define OC1B DIO12 -#define OC2A DIO15 -#define OC2B DIO14 - -// Digital I/O - -#define DIO0_PIN PINB0 -#define DIO0_RPORT PINB -#define DIO0_WPORT PORTB -#define DIO0_DDR DDRB -#define DIO0_PWM NULL - -#define DIO1_PIN PINB1 -#define DIO1_RPORT PINB -#define DIO1_WPORT PORTB -#define DIO1_DDR DDRB -#define DIO1_PWM NULL - -#define DIO2_PIN PINB2 -#define DIO2_RPORT PINB -#define DIO2_WPORT PORTB -#define DIO2_DDR DDRB -#define DIO2_PWM NULL - -#define DIO3_PIN PINB3 -#define DIO3_RPORT PINB -#define DIO3_WPORT PORTB -#define DIO3_DDR DDRB -#define DIO3_PWM OCR0A - -#define DIO4_PIN PINB4 -#define DIO4_RPORT PINB -#define DIO4_WPORT PORTB -#define DIO4_DDR DDRB -#define DIO4_PWM OCR0B - -#define DIO5_PIN PINB5 -#define DIO5_RPORT PINB -#define DIO5_WPORT PORTB -#define DIO5_DDR DDRB -#define DIO5_PWM NULL - -#define DIO6_PIN PINB6 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM NULL - -#define DIO7_PIN PINB7 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM NULL - -#define DIO8_PIN PIND0 -#define DIO8_RPORT PIND -#define DIO8_WPORT PORTD -#define DIO8_DDR DDRD -#define DIO8_PWM NULL - -#define DIO9_PIN PIND1 -#define DIO9_RPORT PIND -#define DIO9_WPORT PORTD -#define DIO9_DDR DDRD -#define DIO9_PWM NULL - -#define DIO10_PIN PIND2 -#define DIO10_RPORT PIND -#define DIO10_WPORT PORTD -#define DIO10_DDR DDRD -#define DIO10_PWM NULL - -#define DIO11_PIN PIND3 -#define DIO11_RPORT PIND -#define DIO11_WPORT PORTD -#define DIO11_DDR DDRD -#define DIO11_PWM NULL - -#define DIO12_PIN PIND4 -#define DIO12_RPORT PIND -#define DIO12_WPORT PORTD -#define DIO12_DDR DDRD -#define DIO12_PWM OCR1B - -#define DIO13_PIN PIND5 -#define DIO13_RPORT PIND -#define DIO13_WPORT PORTD -#define DIO13_DDR DDRD -#define DIO13_PWM OCR1A - -#define DIO14_PIN PIND6 -#define DIO14_RPORT PIND -#define DIO14_WPORT PORTD -#define DIO14_DDR DDRD -#define DIO14_PWM OCR2B - -#define DIO15_PIN PIND7 -#define DIO15_RPORT PIND -#define DIO15_WPORT PORTD -#define DIO15_DDR DDRD -#define DIO15_PWM OCR2A - -#define DIO16_PIN PINC0 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM NULL - -#define DIO17_PIN PINC1 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM NULL - -#define DIO18_PIN PINC2 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM NULL - -#define DIO19_PIN PINC3 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM NULL - -#define DIO20_PIN PINC4 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM NULL - -#define DIO21_PIN PINC5 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM NULL - -#define DIO22_PIN PINC6 -#define DIO22_RPORT PINC -#define DIO22_WPORT PORTC -#define DIO22_DDR DDRC -#define DIO22_PWM NULL - -#define DIO23_PIN PINC7 -#define DIO23_RPORT PINC -#define DIO23_WPORT PORTC -#define DIO23_DDR DDRC -#define DIO23_PWM NULL - -#define DIO24_PIN PINA7 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM NULL - -#define DIO25_PIN PINA6 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM NULL - -#define DIO26_PIN PINA5 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM NULL - -#define DIO27_PIN PINA4 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM NULL - -#define DIO28_PIN PINA3 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM NULL - -#define DIO29_PIN PINA2 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM NULL - -#define DIO30_PIN PINA1 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_DDR DDRA -#define DIO30_PWM NULL - -#define DIO31_PIN PINA0 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_DDR DDRA -#define DIO31_PWM NULL - -#define AIO0_PIN PINA0 -#define AIO0_RPORT PINA -#define AIO0_WPORT PORTA -#define AIO0_DDR DDRA -#define AIO0_PWM NULL - -#define AIO1_PIN PINA1 -#define AIO1_RPORT PINA -#define AIO1_WPORT PORTA -#define AIO1_DDR DDRA -#define AIO1_PWM NULL - -#define AIO2_PIN PINA2 -#define AIO2_RPORT PINA -#define AIO2_WPORT PORTA -#define AIO2_DDR DDRA -#define AIO2_PWM NULL - -#define AIO3_PIN PINA3 -#define AIO3_RPORT PINA -#define AIO3_WPORT PORTA -#define AIO3_DDR DDRA -#define AIO3_PWM NULL - -#define AIO4_PIN PINA4 -#define AIO4_RPORT PINA -#define AIO4_WPORT PORTA -#define AIO4_DDR DDRA -#define AIO4_PWM NULL - -#define AIO5_PIN PINA5 -#define AIO5_RPORT PINA -#define AIO5_WPORT PORTA -#define AIO5_DDR DDRA -#define AIO5_PWM NULL - -#define AIO6_PIN PINA6 -#define AIO6_RPORT PINA -#define AIO6_WPORT PORTA -#define AIO6_DDR DDRA -#define AIO6_PWM NULL - -#define AIO7_PIN PINA7 -#define AIO7_RPORT PINA -#define AIO7_WPORT PORTA -#define AIO7_DDR DDRA -#define AIO7_PWM NULL - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM NULL - -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM NULL - -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM NULL - -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM NULL - -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM NULL - -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM NULL - -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM NULL - -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM NULL - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM NULL - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM NULL - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM NULL - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM OCR0A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM OCR0B - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM NULL - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM NULL - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM NULL - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM NULL - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM NULL - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM NULL - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM NULL - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM NULL - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM NULL - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM NULL - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM NULL - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM NULL - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM NULL - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM NULL - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM NULL - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM NULL - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM NULL - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM OCR2B - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM OCR2A - -#endif // _FASTIO_644 diff --git a/Marlin_thinkerV2/Marlin/fastio_AT90USB.h b/Marlin_thinkerV2/Marlin/fastio_AT90USB.h deleted file mode 100644 index aee9ddcddb..0000000000 --- a/Marlin_thinkerV2/Marlin/fastio_AT90USB.h +++ /dev/null @@ -1,701 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Pin mapping (Teensy) for AT90USB646, 647, 1286, and 1287 - * - * Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 - * 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 - * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 - */ - -#ifndef _FASTIO_AT90USB -#define _FASTIO_AT90USB - -#include "fastio.h" - -// change for your board -#define DEBUG_LED DIO31 /* led D5 red */ - -// SPI -#define SCK DIO21 // 9 -#define MISO DIO23 // 11 -#define MOSI DIO22 // 10 -#define SS DIO20 // 8 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_PWM NULL -#define DIO0_DDR DDRD - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_PWM NULL -#define DIO1_DDR DDRD - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_PWM NULL -#define DIO2_DDR DDRD - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_PWM NULL -#define DIO3_DDR DDRD - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_PWM NULL -#define DIO4_DDR DDRD - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_PWM NULL -#define DIO5_DDR DDRD - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_PWM NULL -#define DIO6_DDR DDRD - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_PWM NULL -#define DIO7_DDR DDRD - -#define DIO8_PIN PINE0 -#define DIO8_RPORT PINE -#define DIO8_WPORT PORTE -#define DIO8_PWM NULL -#define DIO8_DDR DDRE - -#define DIO9_PIN PINE1 -#define DIO9_RPORT PINE -#define DIO9_WPORT PORTE -#define DIO9_PWM NULL -#define DIO9_DDR DDRE - -#define DIO10_PIN PINC0 -#define DIO10_RPORT PINC -#define DIO10_WPORT PORTC -#define DIO10_PWM NULL -#define DIO10_DDR DDRC - -#define DIO11_PIN PINC1 -#define DIO11_RPORT PINC -#define DIO11_WPORT PORTC -#define DIO11_PWM NULL -#define DIO11_DDR DDRC - -#define DIO12_PIN PINC2 -#define DIO12_RPORT PINC -#define DIO12_WPORT PORTC -#define DIO12_PWM NULL -#define DIO12_DDR DDRC - -#define DIO13_PIN PINC3 -#define DIO13_RPORT PINC -#define DIO13_WPORT PORTC -#define DIO13_PWM NULL -#define DIO13_DDR DDRC - -#define DIO14_PIN PINC4 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_PWM NULL -#define DIO14_DDR DDRC - -#define DIO15_PIN PINC5 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_PWM NULL -#define DIO15_DDR DDRC - -#define DIO16_PIN PINC6 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_PWM NULL -#define DIO16_DDR DDRC - -#define DIO17_PIN PINC7 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_PWM NULL -#define DIO17_DDR DDRC - -#define DIO18_PIN PINE6 -#define DIO18_RPORT PINE -#define DIO18_WPORT PORTE -#define DIO18_PWM NULL -#define DIO18_DDR DDRE - -#define DIO19_PIN PINE7 -#define DIO19_RPORT PINE -#define DIO19_WPORT PORTE -#define DIO19_PWM NULL -#define DIO19_DDR DDRE - -#define DIO20_PIN PINB0 -#define DIO20_RPORT PINB -#define DIO20_WPORT PORTB -#define DIO20_PWM NULL -#define DIO20_DDR DDRB - -#define DIO21_PIN PINB1 -#define DIO21_RPORT PINB -#define DIO21_WPORT PORTB -#define DIO21_PWM NULL -#define DIO21_DDR DDRB - -#define DIO22_PIN PINB2 -#define DIO22_RPORT PINB -#define DIO22_WPORT PORTB -#define DIO22_PWM NULL -#define DIO22_DDR DDRB - -#define DIO23_PIN PINB3 -#define DIO23_RPORT PINB -#define DIO23_WPORT PORTB -#define DIO23_PWM NULL -#define DIO23_DDR DDRB - -#define DIO24_PIN PINB4 -#define DIO24_RPORT PINB -#define DIO24_WPORT PORTB -#define DIO24_PWM NULL -#define DIO24_DDR DDRB - -#define DIO25_PIN PINB5 -#define DIO25_RPORT PINB -#define DIO25_WPORT PORTB -#define DIO25_PWM NULL -#define DIO25_DDR DDRB - -#define DIO26_PIN PINB6 -#define DIO26_RPORT PINB -#define DIO26_WPORT PORTB -#define DIO26_PWM NULL -#define DIO26_DDR DDRB - -#define DIO27_PIN PINB7 -#define DIO27_RPORT PINB -#define DIO27_WPORT PORTB -#define DIO27_PWM NULL -#define DIO27_DDR DDRB - -#define DIO28_PIN PINA0 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_PWM NULL -#define DIO28_DDR DDRA - -#define DIO29_PIN PINA1 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_PWM NULL -#define DIO29_DDR DDRA - -#define DIO30_PIN PINA2 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_PWM NULL -#define DIO30_DDR DDRA - -#define DIO31_PIN PINA3 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_PWM NULL -#define DIO31_DDR DDRA - -#define DIO32_PIN PINA4 -#define DIO32_RPORT PINA -#define DIO32_WPORT PORTA -#define DIO32_PWM NULL -#define DIO32_DDR DDRA - -#define DIO33_PIN PINA5 -#define DIO33_RPORT PINA -#define DIO33_WPORT PORTA -#define DIO33_PWM NULL -#define DIO33_DDR DDRA - -#define DIO34_PIN PINA6 -#define DIO34_RPORT PINA -#define DIO34_WPORT PORTA -#define DIO34_PWM NULL -#define DIO34_DDR DDRA - -#define DIO35_PIN PINA7 -#define DIO35_RPORT PINA -#define DIO35_WPORT PORTA -#define DIO35_PWM NULL -#define DIO35_DDR DDRA - -#define DIO36_PIN PINE4 -#define DIO36_RPORT PINE -#define DIO36_WPORT PORTE -#define DIO36_PWM NULL -#define DIO36_DDR DDRE - -#define DIO37_PIN PINE5 -#define DIO37_RPORT PINE -#define DIO37_WPORT PORTE -#define DIO37_PWM NULL -#define DIO37_DDR DDRE - -#define DIO38_PIN PINF0 -#define DIO38_RPORT PINF -#define DIO38_WPORT PORTF -#define DIO38_PWM NULL -#define DIO38_DDR DDRF - -#define DIO39_PIN PINF1 -#define DIO39_RPORT PINF -#define DIO39_WPORT PORTF -#define DIO39_PWM NULL -#define DIO39_DDR DDRF - -#define DIO40_PIN PINF2 -#define DIO40_RPORT PINF -#define DIO40_WPORT PORTF -#define DIO40_PWM NULL -#define DIO40_DDR DDRF - -#define DIO41_PIN PINF3 -#define DIO41_RPORT PINF -#define DIO41_WPORT PORTF -#define DIO41_PWM NULL -#define DIO41_DDR DDRF - -#define DIO42_PIN PINF4 -#define DIO42_RPORT PINF -#define DIO42_WPORT PORTF -#define DIO42_PWM NULL -#define DIO42_DDR DDRF - -#define DIO43_PIN PINF5 -#define DIO43_RPORT PINF -#define DIO43_WPORT PORTF -#define DIO43_PWM NULL -#define DIO43_DDR DDRF - -#define DIO44_PIN PINF6 -#define DIO44_RPORT PINF -#define DIO44_WPORT PORTF -#define DIO44_PWM NULL -#define DIO44_DDR DDRF - -#define DIO45_PIN PINF7 -#define DIO45_RPORT PINF -#define DIO45_WPORT PORTF -#define DIO45_PWM NULL -#define DIO45_DDR DDRF - -#define AIO0_PIN PINF0 -#define AIO0_RPORT PINF -#define AIO0_WPORT PORTF -#define AIO0_PWM NULL -#define AIO0_DDR DDRF - -#define AIO1_PIN PINF1 -#define AIO1_RPORT PINF -#define AIO1_WPORT PORTF -#define AIO1_PWM NULL -#define AIO1_DDR DDRF - -#define AIO2_PIN PINF2 -#define AIO2_RPORT PINF -#define AIO2_WPORT PORTF -#define AIO2_PWM NULL -#define AIO2_DDR DDRF - -#define AIO3_PIN PINF3 -#define AIO3_RPORT PINF -#define AIO3_WPORT PORTF -#define AIO3_PWM NULL -#define AIO3_DDR DDRF - -#define AIO4_PIN PINF4 -#define AIO4_RPORT PINF -#define AIO4_WPORT PORTF -#define AIO4_PWM NULL -#define AIO4_DDR DDRF - -#define AIO5_PIN PINF5 -#define AIO5_RPORT PINF -#define AIO5_WPORT PORTF -#define AIO5_PWM NULL -#define AIO5_DDR DDRF - -#define AIO6_PIN PINF6 -#define AIO6_RPORT PINF -#define AIO6_WPORT PORTF -#define AIO6_PWM NULL -#define AIO6_DDR DDRF - -#define AIO7_PIN PINF7 -#define AIO7_RPORT PINF -#define AIO7_WPORT PORTF -#define AIO7_PWM NULL -#define AIO7_DDR DDRF - -//-- Begin not supported by Teensyduino -//-- don't use Arduino functions on these pins pinMode/digitalWrite/etc -#define DIO46_PIN PINE2 -#define DIO46_RPORT PINE -#define DIO46_WPORT PORTE -#define DIO46_PWM NULL -#define DIO46_DDR DDRE - -#define DIO47_PIN PINE3 -#define DIO47_RPORT PINE -#define DIO47_WPORT PORTE -#define DIO47_PWM NULL -#define DIO47_DDR DDRE - -#define TEENSY_E2 46 -#define TEENSY_E3 47 - -//-- end not supported by Teensyduino - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_PWM NULL -#define PA0_DDR DDRA -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_PWM NULL -#define PA1_DDR DDRA -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_PWM NULL -#define PA2_DDR DDRA -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_PWM NULL -#define PA3_DDR DDRA -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_PWM NULL -#define PA4_DDR DDRA -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_PWM NULL -#define PA5_DDR DDRA -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_PWM NULL -#define PA6_DDR DDRA -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_PWM NULL -#define PA7_DDR DDRA - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_PWM NULL -#define PB0_DDR DDRB -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_PWM NULL -#define PB1_DDR DDRB -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_PWM NULL -#define PB2_DDR DDRB -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_PWM NULL -#define PB3_DDR DDRB -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_PWM NULL -#define PB4_DDR DDRB -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_PWM NULL -#define PB5_DDR DDRB -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_PWM NULL -#define PB6_DDR DDRB -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_PWM NULL -#define PB7_DDR DDRB - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_PWM NULL -#define PC0_DDR DDRC -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_PWM NULL -#define PC1_DDR DDRC -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_PWM NULL -#define PC2_DDR DDRC -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_PWM NULL -#define PC3_DDR DDRC -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_PWM NULL -#define PC4_DDR DDRC -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_PWM NULL -#define PC5_DDR DDRC -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_PWM NULL -#define PC6_DDR DDRC -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_PWM NULL -#define PC7_DDR DDRC - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_PWM NULL -#define PD0_DDR DDRD -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_PWM NULL -#define PD1_DDR DDRD -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_PWM NULL -#define PD2_DDR DDRD -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_PWM NULL -#define PD3_DDR DDRD -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_PWM NULL -#define PD4_DDR DDRD -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_PWM NULL -#define PD5_DDR DDRD -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_PWM NULL -#define PD6_DDR DDRD -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_PWM NULL -#define PD7_DDR DDRD - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_PWM NULL -#define PE0_DDR DDRE -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_PWM NULL -#define PE1_DDR DDRE -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_PWM NULL -#define PE2_DDR DDRE -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_PWM NULL -#define PE3_DDR DDRE -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_PWM NULL -#define PE4_DDR DDRE -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_PWM NULL -#define PE5_DDR DDRE -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_PWM NULL -#define PE6_DDR DDRE -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_PWM NULL -#define PE7_DDR DDRE - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_PWM NULL -#define PF0_DDR DDRF -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_PWM NULL -#define PF1_DDR DDRF -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_PWM NULL -#define PF2_DDR DDRF -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_PWM NULL -#define PF3_DDR DDRF -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_PWM NULL -#define PF4_DDR DDRF -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_PWM NULL -#define PF5_DDR DDRF -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_PWM NULL -#define PF6_DDR DDRF -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_PWM NULL -#define PF7_DDR DDRF - - -/** - * some of the pin mapping functions of the Teensduino extension to the Arduino IDE - * do not function the same as the other Arduino extensions - */ - -//digitalPinToTimer(pin) function works like Arduino but Timers are not defined -#define TIMER0B 1 -#define TIMER1A 7 -#define TIMER1B 8 -#define TIMER1C 9 -#define TIMER2A 6 -#define TIMER2B 2 -#define TIMER3A 5 -#define TIMER3B 4 -#define TIMER3C 3 - -#endif // _FASTIO_AT90USB diff --git a/Marlin_thinkerV2/Marlin/fwretract.cpp b/Marlin_thinkerV2/Marlin/fwretract.cpp deleted file mode 100644 index 997e49a7f9..0000000000 --- a/Marlin_thinkerV2/Marlin/fwretract.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * fwretract.cpp - Implement firmware-based retraction - */ - -#include "MarlinConfig.h" - -#if ENABLED(FWRETRACT) - -#include "fwretract.h" -#include "Marlin.h" -#include "planner.h" -#include "stepper.h" - -FWRetract fwretract; // Single instance - this calls the constructor - -// private: - -#if EXTRUDERS > 1 - bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted -#endif - -// public: - -bool FWRetract::autoretract_enabled, // M209 S - Autoretract switch - FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted -float FWRetract::retract_length, // M207 S - G10 Retract length - FWRetract::retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - FWRetract::retract_zlift, // M207 Z - G10 Retract hop size - FWRetract::retract_recover_length, // M208 S - G11 Recover length - FWRetract::retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate - FWRetract::swap_retract_length, // M207 W - G10 Swap Retract length - FWRetract::swap_retract_recover_length, // M208 W - G11 Swap Recover length - FWRetract::swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate - FWRetract::hop_amount; - -void FWRetract::reset() { - autoretract_enabled = false; - retract_length = RETRACT_LENGTH; - retract_feedrate_mm_s = RETRACT_FEEDRATE; - retract_zlift = RETRACT_ZLIFT; - retract_recover_length = RETRACT_RECOVER_LENGTH; - retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; - swap_retract_length = RETRACT_LENGTH_SWAP; - swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP; - swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; - hop_amount = 0.0; - - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - retracted[i] = false; - #if EXTRUDERS > 1 - retracted_swap[i] = false; - #endif - } -} - -/** - * Retract or recover according to firmware settings - * - * This function handles retract/recover moves for G10 and G11, - * plus auto-retract moves sent from G0/G1 when E-only moves are done. - * - * To simplify the logic, doubled retract/recover moves are ignored. - * - * Note: Z lift is done transparently to the planner. Aborting - * a print between G10 and G11 may corrupt the Z position. - * - * Note: Auto-retract will apply the set Z hop in addition to any Z hop - * included in the G-code. Use M207 Z0 to to prevent double hop. - */ -void FWRetract::retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping /* =false */ - #endif -) { - - static float hop_amount = 0.0; // Total amount lifted, for use in recover - - // Prevent two retracts or recovers in a row - if (retracted[active_extruder] == retracting) return; - - // Prevent two swap-retract or recovers in a row - #if EXTRUDERS > 1 - // Allow G10 S1 only after G10 - if (swapping && retracted_swap[active_extruder] == retracting) return; - // G11 priority to recover the long retract if activated - if (!retracting) swapping = retracted_swap[active_extruder]; - #else - constexpr bool swapping = false; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR("retracting ", retracting); - SERIAL_ECHOLNPAIR("swapping ", swapping); - SERIAL_ECHOLNPAIR("active extruder ", active_extruder); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOPAIR("retracted[", i); - SERIAL_ECHOLNPAIR("] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOPAIR("retracted_swap[", i); - SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); - SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); - //*/ - - const float old_feedrate_mm_s = feedrate_mm_s, - renormalize = RECIPROCAL(planner.e_factor[active_extruder]), - base_retract = swapping ? swap_retract_length : retract_length, - old_z = current_position[Z_AXIS], - old_e = current_position[E_AXIS]; - - // The current position will be the destination for E and Z moves - set_destination_from_current(); - - if (retracting) { - // Retract by moving from a faux E position back to the current E position - feedrate_mm_s = retract_feedrate_mm_s; - destination[E_AXIS] -= base_retract * renormalize; - prepare_move_to_destination(); // set_current_to_destination - - // Is a Z hop set, and has the hop not yet been done? - if (retract_zlift > 0.01 && !hop_amount) { // Apply hop only once - hop_amount += retract_zlift; // Add to the hop total (again, only once) - destination[Z_AXIS] += retract_zlift; // Raise Z by the zlift (M207 Z) amount - feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Maximum Z feedrate - prepare_move_to_destination(); // Raise up, set_current_to_destination - } - } - else { - // If a hop was done and Z hasn't changed, undo the Z hop - if (hop_amount) { - current_position[Z_AXIS] += hop_amount; // Restore the actual Z position - SYNC_PLAN_POSITION_KINEMATIC(); // Unspoof the position planner - feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max - prepare_move_to_destination(); // Lower Z, set_current_to_destination - hop_amount = 0.0; // Clear the hop amount - } - - destination[E_AXIS] += (base_retract + (swapping ? swap_retract_recover_length : retract_recover_length)) * renormalize; - feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s; - prepare_move_to_destination(); // Recover E, set_current_to_destination - } - - feedrate_mm_s = old_feedrate_mm_s; // Restore original feedrate - current_position[Z_AXIS] = old_z; // Restore Z and E positions - current_position[E_AXIS] = old_e; - SYNC_PLAN_POSITION_KINEMATIC(); // As if the move never took place - - retracted[active_extruder] = retracting; // Active extruder now retracted / recovered - - // If swap retract/recover update the retracted_swap flag too - #if EXTRUDERS > 1 - if (swapping) retracted_swap[active_extruder] = retracting; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR("retracting ", retracting); - SERIAL_ECHOLNPAIR("swapping ", swapping); - SERIAL_ECHOLNPAIR("active_extruder ", active_extruder); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOPAIR("retracted[", i); - SERIAL_ECHOLNPAIR("] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOPAIR("retracted_swap[", i); - SERIAL_ECHOLNPAIR("] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); - SERIAL_ECHOLNPAIR("hop_amount ", hop_amount); - //*/ - -} - -#endif // FWRETRACT diff --git a/Marlin_thinkerV2/Marlin/fwretract.h b/Marlin_thinkerV2/Marlin/fwretract.h deleted file mode 100644 index d72f193eb4..0000000000 --- a/Marlin_thinkerV2/Marlin/fwretract.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * fwretract.h - Define firmware-based retraction interface - */ - -#ifndef FWRETRACT_H -#define FWRETRACT_H - -#include "MarlinConfig.h" - -class FWRetract { -public: - static bool autoretract_enabled, // M209 S - Autoretract switch - retracted[EXTRUDERS]; // Which extruders are currently retracted - #if EXTRUDERS > 1 - static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted - #endif - static float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zlift, // M207 Z - G10 Retract hop size - retract_recover_length, // 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_length, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate - hop_amount; - - FWRetract() { reset(); } - - static void reset(); - - static void refresh_autoretract() { - for (uint8_t i = 0; i < EXTRUDERS; i++) retracted[i] = false; - } - - static void enable_autoretract(const bool enable) { - autoretract_enabled = enable; - refresh_autoretract(); - } - - static void retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping = false - #endif - ); -}; - -extern FWRetract fwretract; - -#endif // FWRETRACT_H diff --git a/Marlin_thinkerV2/Marlin/hex_print_routines.cpp b/Marlin_thinkerV2/Marlin/hex_print_routines.cpp deleted file mode 100644 index e99a01afe4..0000000000 --- a/Marlin_thinkerV2/Marlin/hex_print_routines.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" -#include "parser.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(M100_FREE_MEMORY_WATCHER) || ENABLED(DEBUG_GCODE_PARSER) - -#include "Marlin.h" -#include "hex_print_routines.h" - -static char _hex[7] = "0x0000"; - -char* hex_byte(const uint8_t b) { - _hex[4] = hex_nybble(b >> 4); - _hex[5] = hex_nybble(b); - return &_hex[4]; -} - -char* hex_word(const uint16_t w) { - _hex[2] = hex_nybble(w >> 12); - _hex[3] = hex_nybble(w >> 8); - _hex[4] = hex_nybble(w >> 4); - _hex[5] = hex_nybble(w); - return &_hex[2]; -} - -char* hex_address(const void * const w) { - (void)hex_word((uint16_t)w); - return _hex; -} - -void print_hex_nybble(const uint8_t n) { SERIAL_CHAR(hex_nybble(n)); } -void print_hex_byte(const uint8_t b) { SERIAL_ECHO(hex_byte(b)); } -void print_hex_word(const uint16_t w) { SERIAL_ECHO(hex_word(w)); } -void print_hex_address(const void * const w) { SERIAL_ECHO(hex_address(w)); } - -#endif // AUTO_BED_LEVELING_UBL || M100_FREE_MEMORY_WATCHER || DEBUG_GCODE_PARSER diff --git a/Marlin_thinkerV2/Marlin/hex_print_routines.h b/Marlin_thinkerV2/Marlin/hex_print_routines.h deleted file mode 100644 index 05f1e79914..0000000000 --- a/Marlin_thinkerV2/Marlin/hex_print_routines.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef HEX_PRINT_ROUTINES_H -#define HEX_PRINT_ROUTINES_H - -#include - -// -// Utility functions to create and print hex strings as nybble, byte, and word. -// - -inline char hex_nybble(const uint8_t n) { - return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10); -} -char* hex_byte(const uint8_t b); -char* hex_word(const uint16_t w); -char* hex_address(const void * const w); - -void print_hex_nybble(const uint8_t n); -void print_hex_byte(const uint8_t b); -void print_hex_word(const uint16_t w); -void print_hex_address(const void * const w); - -#endif // HEX_PRINT_ROUTINES_H diff --git a/Marlin_thinkerV2/Marlin/language.h b/Marlin_thinkerV2/Marlin/language.h deleted file mode 100644 index f16c7242ae..0000000000 --- a/Marlin_thinkerV2/Marlin/language.h +++ /dev/null @@ -1,334 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef LANGUAGE_H -#define LANGUAGE_H - -#include "MarlinConfig.h" - -#define _UxGT(a) a - -// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h -//#define SIMULATE_ROMFONT - -// Fallback if no language is set. DON'T CHANGE -#ifndef LCD_LANGUAGE - #define LCD_LANGUAGE en -#endif - -// For character-based LCD controllers (DISPLAY_CHARSET_HD44780) -#define JAPANESE 1 -#define WESTERN 2 -#define CYRILLIC 3 - -// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES -// -// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" -// ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS -// See also http://marlinfw.org/docs/development/lcd_language.html - -// Languages -// an Aragonese -// bg Bulgarian -// ca Catalan -// cn Chinese -// cz Czech -// cz_utf8 Czech (UTF8) -// de German -// el Greek -// el-gr Greek (Greece) -// en English -// es Spanish -// es_utf8 Spanish (UTF8) -// eu Basque-Euskera -// fi Finnish -// fr French -// fr_utf8 French (UTF8) -// gl Galician -// hr Croatian -// it Italian -// kana Japanese -// kana_utf8 Japanese (UTF8) -// nl Dutch -// pl Polish -// pt Portuguese -// pt-br Portuguese (Brazilian) -// pt-br_utf8 Portuguese (Brazilian) (UTF8) -// pt_utf8 Portuguese (UTF8) -// ru Russian -// sk Slovak (UTF8) -// tr Turkish -// uk Ukrainian -// zh_CN Chinese (Simplified) -// zh_TW Chinese (Taiwan) - -#ifdef DEFAULT_SOURCE_CODE_URL - #undef SOURCE_CODE_URL - #define SOURCE_CODE_URL DEFAULT_SOURCE_CODE_URL -#endif - -#ifdef CUSTOM_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MACHINE_NAME -#else - #ifdef DEFAULT_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME DEFAULT_MACHINE_NAME - #endif -#endif - -#ifndef MACHINE_UUID - #define MACHINE_UUID DEFAULT_MACHINE_UUID -#endif - -#ifdef DEFAULT_WEBSITE_URL - #undef WEBSITE_URL - #define WEBSITE_URL DEFAULT_WEBSITE_URL -#endif - -// Common LCD messages - - /* nothing here yet */ - -// Common serial messages -#define MSG_MARLIN "Marlin" - -// Serial Console Messages (do not translate those!) - -#define MSG_ENQUEUEING "enqueueing \"" -#define MSG_POWERUP "PowerUp" -#define MSG_EXTERNAL_RESET " External Reset" -#define MSG_BROWNOUT_RESET " Brown out Reset" -#define MSG_WATCHDOG_RESET " Watchdog Reset" -#define MSG_SOFTWARE_RESET " Software Reset" -#define MSG_AUTHOR " | Author: " -#define MSG_CONFIGURATION_VER " Last Updated: " -#define MSG_FREE_MEMORY " Free Memory: " -#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " -#define MSG_OK "ok" -#define MSG_WAIT "wait" -#define MSG_STATS "Stats: " -#define MSG_FILE_SAVED "Done saving file." -#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " -#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " -#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " -#define MSG_FILE_PRINTED "Done printing file" -#define MSG_BEGIN_FILE_LIST "Begin file list" -#define MSG_END_FILE_LIST "End file list" -#define MSG_INVALID_EXTRUDER "Invalid extruder" -#define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID -#define MSG_COUNT_X " Count X:" -#define MSG_COUNT_A " Count A:" -#define MSG_ERR_KILLED "Printer halted. kill() called!" -#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" -#define MSG_BUSY_PROCESSING "busy: processing" -#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user" -#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input" -#define MSG_Z_MOVE_COMP "Z_move_comp" -#define MSG_RESEND "Resend: " -#define MSG_UNKNOWN_COMMAND "Unknown command: \"" -#define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min: " -#define MSG_X_MAX "x_max: " -#define MSG_X2_MIN "x2_min: " -#define MSG_X2_MAX "x2_max: " -#define MSG_Y_MIN "y_min: " -#define MSG_Y_MAX "y_max: " -#define MSG_Y2_MIN "y2_min: " -#define MSG_Y2_MAX "y2_max: " -#define MSG_Z_MIN "z_min: " -#define MSG_Z_MAX "z_max: " -#define MSG_Z2_MIN "z2_min: " -#define MSG_Z2_MAX "z2_max: " -#define MSG_Z_PROBE "z_probe: " -#define MSG_PROBE_Z_OFFSET "Probe Z Offset" -#define MSG_SKEW_MIN "min_skew_factor: " -#define MSG_SKEW_MAX "max_skew_factor: " -#define MSG_FILAMENT_RUNOUT_SENSOR "filament: " -#define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" -#define MSG_ERR_M355_NONE "No case light" -#define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage" -#define MSG_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" -#define MSG_ERR_MESH_XY "Mesh point cannot be resolved" -#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters" -#define MSG_ERR_PROTECTED_PIN "Protected Pin" -#define MSG_ERR_M420_FAILED "Failed to enable Bed Leveling" -#define MSG_ERR_M428_TOO_FAR "Too far from reference point" -#define MSG_ERR_M303_DISABLED "PIDTEMP disabled" -#define MSG_M119_REPORT "Reporting endstop status" -#define MSG_ENDSTOP_HIT "TRIGGERED" -#define MSG_ENDSTOP_OPEN "open" -#define MSG_HOTEND_OFFSET "Hotend offsets:" -#define MSG_DUPLICATION_MODE "Duplication mode: " -#define MSG_SOFT_ENDSTOPS "Soft endstops: " -#define MSG_SOFT_MIN " Min: " -#define MSG_SOFT_MAX " Max: " - -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define MSG_SD_INIT_FAIL "SD init fail" -#define MSG_SD_VOL_INIT_FAIL "volume.init failed" -#define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" -#define MSG_SD_WORKDIR_FAIL "workDir open failed" -#define MSG_SD_OPEN_FILE_FAIL "open failed, File: " -#define MSG_SD_FILE_OPENED "File opened: " -#define MSG_SD_SIZE " Size: " -#define MSG_SD_FILE_SELECTED "File selected" -#define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" -#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_ERR_READ "SD read error" -#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " - -#define MSG_STEPPER_TOO_HIGH "Steprate too high: " -#define MSG_ENDSTOPS_HIT "endstops hit: " -#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" -#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_HOTEND_TOO_COLD "Hotend too cold" - -#define MSG_FILAMENT_CHANGE_HEAT "Press button (or M108) to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT "Insert filament and press button (or M108)" -#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" -#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" - -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -#define MSG_STOP_BLTOUCH "STOP called because of BLTouch error - restart with M999" -#define MSG_STOP_UNHOMED "STOP called because of unhomed error - restart with M999" -#define MSG_KILL_INACTIVE_TIME "KILL caused by too much inactive time - current command: " -#define MSG_KILL_BUTTON "KILL caused by KILL button/pin" - -// temperature.cpp strings -#define MSG_PID_AUTOTUNE "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" -#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" -#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" -#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" -#define MSG_BIAS " bias: " -#define MSG_D " d: " -#define MSG_T_MIN " min: " -#define MSG_T_MAX " max: " -#define MSG_KU " Ku: " -#define MSG_TU " Tu: " -#define MSG_CLASSIC_PID " Classic PID " -#define MSG_KP " Kp: " -#define MSG_KI " Ki: " -#define MSG_KD " Kd: " -#define MSG_AT " @:" -#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" -#define MSG_PID_DEBUG " PID_DEBUG " -#define MSG_PID_DEBUG_INPUT ": Input " -#define MSG_PID_DEBUG_OUTPUT " Output " -#define MSG_PID_DEBUG_PTERM " pTerm " -#define MSG_PID_DEBUG_ITERM " iTerm " -#define MSG_PID_DEBUG_DTERM " dTerm " -#define MSG_PID_DEBUG_CTERM " cTerm " -#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" - -#define MSG_HEATER_BED "bed" -#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: " -#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" -#define MSG_T_HEATING_FAILED "Heating failed" -#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" -#define MSG_T_MAXTEMP "MAXTEMP triggered" -#define MSG_T_MINTEMP "MINTEMP triggered" - -// Debug -#define MSG_DEBUG_PREFIX "DEBUG:" -#define MSG_DEBUG_OFF "off" -#define MSG_DEBUG_ECHO "ECHO" -#define MSG_DEBUG_INFO "INFO" -#define MSG_DEBUG_ERRORS "ERRORS" -#define MSG_DEBUG_DRYRUN "DRYRUN" -#define MSG_DEBUG_COMMUNICATION "COMMUNICATION" -#define MSG_DEBUG_LEVELING "LEVELING" - -// LCD Menu Messages - -#define LANGUAGE_INCL_(M) STRINGIFY_(language_##M.h) -#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) -#define INCLUDE_LANGUAGE LANGUAGE_INCL(LCD_LANGUAGE) - -// Never translate these strings -#define MSG_X "X" -#define MSG_Y "Y" -#define MSG_Z "Z" -#define MSG_E "E" -#if IS_KINEMATIC - #define MSG_A "A" - #define MSG_B "B" - #define MSG_C "C" -#else - #define MSG_A "X" - #define MSG_B "Y" - #define MSG_C "Z" -#endif -#define MSG_H1 "1" -#define MSG_H2 "2" -#define MSG_H3 "3" -#define MSG_H4 "4" -#define MSG_H5 "5" -#define MSG_N1 " 1" -#define MSG_N2 " 2" -#define MSG_N3 " 3" -#define MSG_N4 " 4" -#define MSG_N5 " 5" -#define MSG_E1 "E1" -#define MSG_E2 "E2" -#define MSG_E3 "E3" -#define MSG_E4 "E4" -#define MSG_E5 "E5" -#define MSG_MOVE_E1 "1" -#define MSG_MOVE_E2 "2" -#define MSG_MOVE_E3 "3" -#define MSG_MOVE_E4 "4" -#define MSG_MOVE_E5 "5" -#define MSG_DIAM_E1 " 1" -#define MSG_DIAM_E2 " 2" -#define MSG_DIAM_E3 " 3" -#define MSG_DIAM_E4 " 4" -#define MSG_DIAM_E5 " 5" - -#include INCLUDE_LANGUAGE - -#if DISABLED(SIMULATE_ROMFONT) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_1) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_5) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CN) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_TR) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_PL) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CZ) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_SK) - #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#endif - -#include "language_en.h" - -#endif // __LANGUAGE_H diff --git a/Marlin_thinkerV2/Marlin/language_an.h b/Marlin_thinkerV2/Marlin/language_an.h deleted file mode 100644 index 679ed1cf3f..0000000000 --- a/Marlin_thinkerV2/Marlin/language_an.h +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Aragonese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_AN_H -#define LANGUAGE_AN_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" parada.") -#define MSG_SD_INSERTED _UxGT("Tarcheta mesa") -#define MSG_SD_REMOVED _UxGT("Tarcheta sacada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu prencipal") -#define MSG_AUTOSTART _UxGT("Inicio automatico") -#define MSG_DISABLE_STEPPERS _UxGT("Amortar motors") -#define MSG_AUTO_HOME _UxGT("Levar a l'orichen") -#define MSG_AUTO_HOME_X _UxGT("Orichen X") -#define MSG_AUTO_HOME_Y _UxGT("Orichen Y") -#define MSG_AUTO_HOME_Z _UxGT("Orichen Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Orichen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Encetar (pretar)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Vinient punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelacion feita!") -#define MSG_SET_HOME_OFFSETS _UxGT("Achustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicau") -#define MSG_SET_ORIGIN _UxGT("Establir orichen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Base") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Base") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Enchegar Fuent") -#define MSG_SWITCH_PS_OFF _UxGT("Amortar Fuent") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover Eixes") -#define MSG_BED_LEVELING _UxGT("Nivelar base") -#define MSG_LEVEL_BED _UxGT("Nivelar base") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidat") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Base") -#define MSG_FAN_SPEED _UxGT("Ixoriador") -#define MSG_FLOW _UxGT("Fluxo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("On") -#define MSG_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("Trigar") -#define MSG_ACC _UxGT("Aceleracion") -#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("Vel. viache min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Trangos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A trangos/mm") - #define MSG_BSTEPS _UxGT("B trangos/mm") - #define MSG_CSTEPS _UxGT("C trangos/mm") -#else - #define MSG_ASTEPS _UxGT("X trangos/mm") - #define MSG_BSTEPS _UxGT("Y trangos/mm") - #define MSG_CSTEPS _UxGT("Z trangos/mm") -#endif -#define MSG_ESTEPS _UxGT("E trangos/mm") -#define MSG_E1STEPS _UxGT("E1 trangos/mm") -#define MSG_E2STEPS _UxGT("E2 trangos/mm") -#define MSG_E3STEPS _UxGT("E3 trangos/mm") -#define MSG_E4STEPS _UxGT("E4 trangos/mm") -#define MSG_E5STEPS _UxGT("E5 trangos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Alzar memoria") -#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") -#define MSG_REFRESH _UxGT("Tornar a cargar") -#define MSG_WATCH _UxGT("Informacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Achustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresion") -#define MSG_RESUME_PRINT _UxGT("Contin. impresion") -#define MSG_STOP_PRINT _UxGT("Detener Impresion") -#define MSG_CARD_MENU _UxGT("Menu de SD") -#define MSG_NO_CARD _UxGT("No i hai tarcheta") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Aguardand ordines") -#define MSG_PRINT_ABORTED _UxGT("Impres. cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Aturada d'emerch.") -#define MSG_STOPPED _UxGT("Aturada.") -#define MSG_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Devantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet F") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambear filamento") -#define MSG_INIT_SDCARD _UxGT("Encetan. tarcheta") -#define MSG_CNG_SDCARD _UxGT("Cambiar tarcheta") -#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_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_ENDSTOP_ABORT _UxGT("Cancelado - Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error: en calentar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Error: temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Error de temperatura") -#define MSG_ERR_MAXTEMP _UxGT("Error: Temp Maxima") -#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_HALTED _UxGT("IMPRESORA ATURADA") -#define MSG_PLEASE_RESET _UxGT("Per favor reinic.") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Calentando...") -#define MSG_BED_HEATING _UxGT("Calentando base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_INFO_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_PRINTER_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. Controlador") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baudios") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresion") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total d'imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresion mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total d'extrusion") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impresions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusion") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura menima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura maxima") -#define MSG_INFO_PSU _UxGT("Fuente de aliment") - -#define MSG_DRIVE_STRENGTH _UxGT("Fuerza d'o driver") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escri. DAC EEPROM") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguardand iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y prete lo boton") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambear") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pa continar...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o fil. cambear") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Aguardando a") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("expulsar filament") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Aguardando a") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("cargar filamento") -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Aguardando impre.") -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pa continar") - -#endif // LANGUAGE_AN_H diff --git a/Marlin_thinkerV2/Marlin/language_bg.h b/Marlin_thinkerV2/Marlin/language_bg.h deleted file mode 100644 index 5920bac25f..0000000000 --- a/Marlin_thinkerV2/Marlin/language_bg.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Bulgarian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_BG_H -#define LANGUAGE_BG_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" Готов.") -#define MSG_SD_INSERTED _UxGT("Картата е поставена") -#define MSG_SD_REMOVED _UxGT("Картата е извадена") -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Изкл. двигатели") -#define MSG_AUTO_HOME _UxGT("Паркиране") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровка Z") -#define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") -#define MSG_SET_ORIGIN _UxGT("Изходна точка") -#define MSG_PREHEAT_1 _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_N _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Подгр. PLA Всички") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Подгр. PLA Легло") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Настройки PLA") -#define MSG_PREHEAT_2 _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_N _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Подгр. ABS Всички") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Подгр. ABS Легло") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Настройки ABS") -#define MSG_COOLDOWN _UxGT("Охлаждане") -#define MSG_SWITCH_PS_ON _UxGT("Вкл. захранване") -#define MSG_SWITCH_PS_OFF _UxGT("Изкл. захранване") -#define MSG_EXTRUDE _UxGT("Екструзия") -#define MSG_RETRACT _UxGT("Откат") -#define MSG_MOVE_AXIS _UxGT("Движение по ос") -#define MSG_BED_LEVELING _UxGT("Нивелиране") -#define MSG_LEVEL_BED _UxGT("Нивелиране") -#define MSG_MOVE_X _UxGT("Движение по X") -#define MSG_MOVE_Y _UxGT("Движение по Y") -#define MSG_MOVE_Z _UxGT("Движение по Z") -#define MSG_MOVE_E _UxGT("Екструдер") -#define MSG_MOVE_01MM _UxGT("Премести с 0.1mm") -#define MSG_MOVE_1MM _UxGT("Премести с 1mm") -#define MSG_MOVE_10MM _UxGT("Премести с 10mm") -#define MSG_SPEED _UxGT("Скорост") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE LCD_STR_THERMOMETER _UxGT(" Дюза") -#define MSG_BED LCD_STR_THERMOMETER _UxGT(" Легло") -#define MSG_FAN_SPEED _UxGT("Вентилатор") -#define MSG_FLOW _UxGT("Поток") -#define MSG_CONTROL _UxGT("Управление") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Минимум") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Максимум") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Фактор") -#define MSG_AUTOTEMP _UxGT("Авто-темп.") -#define MSG_ON _UxGT("Вкл. ") -#define MSG_OFF _UxGT("Изкл. ") -#define MSG_A_RETRACT _UxGT("A-откат") -#define MSG_A_TRAVEL _UxGT("A-travel") -#define MSG_STEPS_PER_MM _UxGT("Стъпки/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aстъпки/mm") - #define MSG_BSTEPS _UxGT("Bстъпки/mm") - #define MSG_CSTEPS _UxGT("Cстъпки/mm") -#else - #define MSG_ASTEPS _UxGT("Xстъпки/mm") - #define MSG_BSTEPS _UxGT("Yстъпки/mm") - #define MSG_CSTEPS _UxGT("Zстъпки/mm") -#endif -#define MSG_ESTEPS _UxGT("E стъпки/mm") -#define MSG_E1STEPS _UxGT("E1 стъпки/mm") -#define MSG_E2STEPS _UxGT("E2 стъпки/mm") -#define MSG_E3STEPS _UxGT("E3 стъпки/mm") -#define MSG_E4STEPS _UxGT("E4 стъпки/mm") -#define MSG_E5STEPS _UxGT("E5 стъпки/mm") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Нишка") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Диам. нишка") -#define MSG_CONTRAST _UxGT("LCD контраст") -#define MSG_STORE_EEPROM _UxGT("Запази в EPROM") -#define MSG_LOAD_EEPROM _UxGT("Зареди от EPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Фабрични настройки") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT("Обнови") -#define MSG_WATCH _UxGT("Преглед") -#define MSG_PREPARE _UxGT("Действия") -#define MSG_TUNE _UxGT("Настройка") -#define MSG_PAUSE_PRINT _UxGT("Пауза") -#define MSG_RESUME_PRINT _UxGT("Възобнови печата") -#define MSG_STOP_PRINT _UxGT("Спри печата") -#define MSG_CARD_MENU _UxGT("Меню карта") -#define MSG_NO_CARD _UxGT("Няма карта") -#define MSG_DWELL _UxGT("Почивка...") -#define MSG_USERWAIT _UxGT("Изчакване") -#define MSG_PRINT_ABORTED _UxGT("Печатът е прекъснат") -#define MSG_NO_MOVE _UxGT("Няма движение") -#define MSG_KILLED _UxGT("УБИТО.") -#define MSG_STOPPED _UxGT("СПРЯНО.") -#define MSG_CONTROL_RETRACT _UxGT("Откат mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Смяна Откат mm") -#define MSG_CONTROL_RETRACTF _UxGT("Откат V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Скок mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Възврат mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Смяна Възврат mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Възврат V") -#define MSG_AUTORETRACT _UxGT("Автоoткат") -#define MSG_FILAMENTCHANGE _UxGT("Смяна нишка") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD-Карта") -#define MSG_CNG_SDCARD _UxGT("Смяна SD-Карта") -#define MSG_ZPROBE_OUT _UxGT("Z-сондата е извадена") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Отстояние") -#define MSG_BABYSTEP_X _UxGT("Министъпка X") -#define MSG_BABYSTEP_Y _UxGT("Министъпка Y") -#define MSG_BABYSTEP_Z _UxGT("Министъпка Z") -#define MSG_ENDSTOP_ABORT _UxGT("Стоп Кр.Изключватели") -#define MSG_DELTA_CALIBRATE _UxGT("Делта Калибровка") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калибровка X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калибровка Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калибровка Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калибровка Център") - -#endif // LANGUAGE_BG_H diff --git a/Marlin_thinkerV2/Marlin/language_ca.h b/Marlin_thinkerV2/Marlin/language_ca.h deleted file mode 100644 index 8c8af7c308..0000000000 --- a/Marlin_thinkerV2/Marlin/language_ca.h +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Catalan - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_CA_H -#define LANGUAGE_CA_H - -#define MAPPER_C2C3 // because of "ó" -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" preparada.") -#define MSG_SD_INSERTED _UxGT("Targeta detectada.") -#define MSG_SD_REMOVED _UxGT("Targeta extreta.") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") -#define MSG_MAIN _UxGT("Menú principal") -#define MSG_AUTOSTART _UxGT("Inici automatic") -#define MSG_DISABLE_STEPPERS _UxGT("Desactiva motors") -#define MSG_DEBUG_MENU _UxGT("Menu de depuracio") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra progres") -#define MSG_AUTO_HOME _UxGT("Ves a l'origen") -#define MSG_AUTO_HOME_X _UxGT("X a origen") -#define MSG_AUTO_HOME_Y _UxGT("Y a origen") -#define MSG_AUTO_HOME_Z _UxGT("Z a origen") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Premeu per iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Següent punt") -#define MSG_LEVEL_BED_DONE _UxGT("Anivellament fet!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajusta decalatge") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalatge aplicat") -#define MSG_SET_ORIGIN _UxGT("Estableix origen") -#define MSG_PREHEAT_1 _UxGT("Preescalfa PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Llit") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf.") -#define MSG_PREHEAT_2 _UxGT("Preescalfa ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Llit") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf.") -#define MSG_COOLDOWN _UxGT("Refreda") -#define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#define MSG_EXTRUDE _UxGT("Extrudeix") -#define MSG_RETRACT _UxGT("Retreu") -#define MSG_MOVE_AXIS _UxGT("Mou eixos") -#define MSG_BED_LEVELING _UxGT("Anivella llit") -#define MSG_LEVEL_BED _UxGT("Anivella llit") -#define MSG_MOVING _UxGT("Movent..") -#define MSG_FREE_XY _UxGT("XY lliures") -#define MSG_MOVE_X _UxGT("Mou X") -#define MSG_MOVE_Y _UxGT("Mou Y") -#define MSG_MOVE_Z _UxGT("Mou Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mou 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mou 1mm") -#define MSG_MOVE_10MM _UxGT("Mou 10mm") -#define MSG_SPEED _UxGT("Velocitat") -#define MSG_BED_Z _UxGT("Llit Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Llit") -#define MSG_FAN_SPEED _UxGT("Vel. Ventilador") -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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("Select") -#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("VViatge min") -#define MSG_AMAX _UxGT("Accel. max ") -#define MSG_A_RETRACT _UxGT("Accel. retracc") -#define MSG_A_TRAVEL _UxGT("Accel. Viatge") -#define MSG_STEPS_PER_MM _UxGT("Passos/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassos/mm") - #define MSG_BSTEPS _UxGT("Bpassos/mm") - #define MSG_CSTEPS _UxGT("Cpassos/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassos/mm") - #define MSG_BSTEPS _UxGT("Ypassos/mm") - #define MSG_CSTEPS _UxGT("Zpassos/mm") -#endif -#define MSG_ESTEPS _UxGT("Epassos/mm") -#define MSG_E1STEPS _UxGT("E1passos/mm") -#define MSG_E2STEPS _UxGT("E2passos/mm") -#define MSG_E3STEPS _UxGT("E3passos/mm") -#define MSG_E4STEPS _UxGT("E4passos/mm") -#define MSG_E5STEPS _UxGT("E5passos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Moviment") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_CONTRAST _UxGT("Contrast de LCD") -#define MSG_STORE_EEPROM _UxGT("Desa memoria") -#define MSG_LOAD_EEPROM _UxGT("Carrega memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaura valors") -#define MSG_REFRESH _UxGT("Actualitza") -#define MSG_WATCH _UxGT("Pantalla Info.") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Ajusta") -#define MSG_PAUSE_PRINT _UxGT("Pausa impressio") -#define MSG_RESUME_PRINT _UxGT("Repren impressio") -#define MSG_STOP_PRINT _UxGT("Atura impressio.") -#define MSG_CARD_MENU _UxGT("Imprimeix de SD") -#define MSG_NO_CARD _UxGT("No hi ha targeta") -#define MSG_DWELL _UxGT("En repos...") -#define MSG_USERWAIT _UxGT("Esperant usuari..") -#define MSG_PRINT_ABORTED _UxGT("Imp. cancelada") -#define MSG_NO_MOVE _UxGT("Sense moviment.") -#define MSG_KILLED _UxGT("MATAT.") -#define MSG_STOPPED _UxGT("ATURADA.") -#define MSG_CONTROL_RETRACT _UxGT("Retreu mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retreure mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retreu V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Aixeca mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") -#define MSG_AUTORETRACT _UxGT("Auto retraccio") -#define MSG_FILAMENTCHANGE _UxGT("Canvia filament") -#define MSG_INIT_SDCARD _UxGT("Inicialitza SD") -#define MSG_CNG_SDCARD _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_ZPROBE_ZOFFSET _UxGT("Decalatge Z") -#define MSG_BABYSTEP_X _UxGT("Micropas X") -#define MSG_BABYSTEP_Y _UxGT("Micropas Y") -#define MSG_BABYSTEP_Z _UxGT("Micropas Z") -#define MSG_ENDSTOP_ABORT _UxGT("Cancel. Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error al escalfar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP REDUNDANT") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MAXIMA") -#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_HALTED _UxGT("IMPRESSORA PARADA") -#define MSG_PLEASE_RESET _UxGT("Reinicieu") -#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("Escalfant...") -#define MSG_BED_HEATING _UxGT("Escalfant llit...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibratge Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibra Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibra el centre") - -#define MSG_INFO_MENU _UxGT("Quant a la impr.") -#define MSG_INFO_PRINTER_MENU _UxGT("Info Impressora") -#define MSG_INFO_STATS_MENU _UxGT("Estadistiques") -#define MSG_INFO_BOARD_MENU _UxGT("Info placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Llum") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Temps imprimint") - #define MSG_INFO_PRINT_LONGEST _UxGT("Treball mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extrudit") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudit") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp. mínima") -#define MSG_INFO_MAX_TEMP _UxGT("Temp. màxima") -#define MSG_INFO_PSU _UxGT("Font alimentacio") - -#define MSG_DRIVE_STRENGTH _UxGT("Força motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Repren impressió") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar el canvi") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("treure filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Poseu filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i premeu el boto") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("per continuar...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premeu boto per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("escalfar nozzle.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant nozzle") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espereu...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperant carrega") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("reprendre") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Espereu...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Expulsant...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insereix i prem") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregant...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprenent...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CA_H diff --git a/Marlin_thinkerV2/Marlin/language_cn.h b/Marlin_thinkerV2/Marlin/language_cn.h deleted file mode 100644 index 403cffb6cb..0000000000 --- a/Marlin_thinkerV2/Marlin/language_cn.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_CN_H -#define LANGUAGE_CN_H - -#define cn 1234 - -#define DISPLAY_CHARSET_ISO10646_CN -#define CHARSIZE 2 - -#define WELCOME_MSG "\xa4\xa5\xa6\xa7" -#define MSG_SD_INSERTED "\xa8\xa9\xaa\xab" -#define MSG_SD_REMOVED "\xa8\xa9\xac\xad" -#define MSG_MAIN "\xae\xaf\xb0" -#define MSG_AUTOSTART "\xb1\xb2\xb3\xb4" -#define MSG_DISABLE_STEPPERS "\xb5\xb6\xb7\xb8\xb9\xba" -#define MSG_AUTO_HOME "\xbb\xbc\xbd" -#define MSG_TMC_Z_CALIBRATION "Calibrate Z" -#define MSG_LEVEL_BED_HOMING "Homing XYZ" -#define MSG_LEVEL_BED_WAITING "Click to Begin" -#define MSG_LEVEL_BED_DONE "Leveling Done!" -#define MSG_SET_HOME_OFFSETS "\xbe\xbf\xbb\xbc\xbd\xc0\xc1" -#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" -#define MSG_SET_ORIGIN "\xbe\xbf\xbc\xbd" -#define MSG_PREHEAT_1 "\xc3\xc4 PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xc5\xc6" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xc4\xc7" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xbf" -#define MSG_PREHEAT_2 "\xc3\xc4 ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xc5\xc6" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xbe\xc6" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xbf" -#define MSG_COOLDOWN "\xc8\xc9" -#define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3" -#define MSG_SWITCH_PS_OFF "\xb9\xcb\xb5\xb6" -#define MSG_EXTRUDE "\xcc\xad" -#define MSG_RETRACT "\xbb\xcd" -#define MSG_MOVE_AXIS "\xc1\xb2\xce" -#define MSG_BED_LEVELING "\xcf\xe0\xc4\xc7" -#define MSG_LEVEL_BED "\xcf\xe0\xc4\xc7" -#define MSG_MOVE_X "\xc1\xb2 X" -#define MSG_MOVE_Y "\xc1\xb2 Y" -#define MSG_MOVE_Z "\xc1\xb2 Z" -#define MSG_MOVE_E "\xcc\xad\xba" -#define MSG_MOVE_01MM "\xc1\xb2 0.1mm" -#define MSG_MOVE_1MM "\xc1\xb2 1mm" -#define MSG_MOVE_10MM "\xc1\xb2 10mm" -#define MSG_SPEED "\xd1\xd2" -#define MSG_NOZZLE "\xd3\xd4" -#define MSG_BED "\xc4\xc7" -#define MSG_FAN_SPEED "\xd5\xd6\xd1\xd2" -#define MSG_FLOW "\xcc\xad\xd1\xd2" -#define MSG_CONTROL "\xd8\xd9" -#define MSG_MIN LCD_STR_THERMOMETER " \xda\xdb" -#define MSG_MAX LCD_STR_THERMOMETER " \xda\xdc" -#define MSG_FACTOR LCD_STR_THERMOMETER " \xdd\xde" -#define MSG_AUTOTEMP "\xb1\xb2\xd8\xc9" -#define MSG_ON "\xb3 " // intentional space to shift wide symbol to the left -#define MSG_OFF "\xb5 " // intentional space to shift wide symbol to the left -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_ACC "Accel" -#define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif -#define MSG_VE_JERK "Ve-jerk" -#define MSG_VMAX "Vmax " -#define MSG_VMIN "Vmin" -#define MSG_VTRAV_MIN "VTrav min" -#define MSG_AMAX "Amax " -#define MSG_A_RETRACT "A-retract" -#define MSG_A_TRAVEL "A-travel" -#define MSG_STEPS_PER_MM "Steps/mm" -#define MSG_ESTEPS "Esteps/mm" -#define MSG_E1STEPS "E1steps/mm" -#define MSG_E2STEPS "E2steps/mm" -#define MSG_E3STEPS "E3steps/mm" -#define MSG_E4STEPS "E4steps/mm" -#define MSG_E5STEPS "E5steps/mm" -#define MSG_TEMPERATURE "\xc9\xd2" -#define MSG_MOTION "\xdf\xb2" -#define MSG_FILAMENT "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" -#define MSG_FILAMENT_DIAM "Fil. Dia." -#define MSG_CONTRAST "LCD contrast" -#define MSG_STORE_EEPROM "Store memory" -#define MSG_LOAD_EEPROM "Load memory" -#define MSG_RESTORE_FAILSAFE "Restore failsafe" -#define MSG_REFRESH "Refresh" -#define MSG_WATCH "\xec\xed\xee\xef" -#define MSG_PREPARE "\xa4\xa5" -#define MSG_TUNE "\xcf\xf0" -#define MSG_PAUSE_PRINT "\xf1\xf2\xca\xf3" -#define MSG_RESUME_PRINT "\xf4\xf5\xca\xf3" -#define MSG_STOP_PRINT "\xf2\xf6\xca\xf3" -#define MSG_CARD_MENU "\xaf\xb0" -#define MSG_NO_CARD "\xf9\xa8" -#define MSG_DWELL "Sleep..." -#define MSG_USERWAIT "Wait for user..." -#define MSG_PRINT_ABORTED "Print aborted" -#define MSG_NO_MOVE "No move." -#define MSG_KILLED "KILLED. " -#define MSG_STOPPED "STOPPED. " -#define MSG_CONTROL_RETRACT "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" -#define MSG_CONTROL_RETRACTF "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER "UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" -#define MSG_AUTORETRACT "AutoRetr." -#define MSG_FILAMENTCHANGE "Change filament" -#define MSG_INIT_SDCARD "Init. SD card" -#define MSG_CNG_SDCARD "Change SD card" -#define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" -#define MSG_ZPROBE_ZOFFSET "Z Offset" -#define MSG_BABYSTEP_X "Babystep X" -#define MSG_BABYSTEP_Y "Babystep Y" -#define MSG_BABYSTEP_Z "Babystep Z" -#define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_HEATING_FAILED_LCD "Heating failed" -#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP "Err: MAXTEMP" -#define MSG_ERR_MINTEMP "Err: MINTEMP" -#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" -#define MSG_DELTA_CALIBRATE "Delta Calibration" -#define MSG_DELTA_CALIBRATE_X "Calibrate X" -#define MSG_DELTA_CALIBRATE_Y "Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z "Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" - -#endif // LANGUAGE_CN_H diff --git a/Marlin_thinkerV2/Marlin/language_cz.h b/Marlin_thinkerV2/Marlin/language_cz.h deleted file mode 100644 index 950b58a172..0000000000 --- a/Marlin_thinkerV2/Marlin/language_cz.h +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Czech - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Petr Zahradnik, Computer Laboratory - * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz - * - */ -#ifndef LANGUAGE_CZ_H -#define LANGUAGE_CZ_H - -#define DISPLAY_CHARSET_ISO10646_1 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pripraven.") -#define MSG_BACK _UxGT("Zpet") -#define MSG_SD_INSERTED _UxGT("Karta vlozena") -#define MSG_SD_REMOVED _UxGT("Karta vyjmuta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znaku -#define MSG_MAIN _UxGT("Hlavni nabidka") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") -#define MSG_DEBUG_MENU _UxGT("Nabidka ladeni") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk.prubehu") -#define MSG_AUTO_HOME _UxGT("Domovska pozice") -#define MSG_AUTO_HOME_X _UxGT("Domu osa X") -#define MSG_AUTO_HOME_Y _UxGT("Domu osa Y") -#define MSG_AUTO_HOME_Z _UxGT("Domu osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Mereni podlozky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutim spustte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Dalsi bod") -#define MSG_LEVEL_BED_DONE _UxGT("Mereni hotovo!") -#define MSG_Z_FADE_HEIGHT _UxGT("Vyska srovnavani") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") -#define MSG_SET_ORIGIN _UxGT("Nastavit pocatek") -#define MSG_PREHEAT_1 _UxGT("Zahrat PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vse") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podloz") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahrat ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vse") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podloz") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Zchladit") -#define MSG_SWITCH_PS_ON _UxGT("Zapnout napajeni") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnout napajeni") -#define MSG_EXTRUDE _UxGT("Vytlacit (extr.)") -#define MSG_RETRACT _UxGT("Zatlacit (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunout osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnat podlozku") -#define MSG_LEVEL_BED _UxGT("Vyrovnat podlozku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnat rohy") -#define MSG_NEXT_CORNER _UxGT("Dalsi roh") -#define MSG_EDITING_STOPPED _UxGT("Konec uprav site") - -#define MSG_UBL_DOING_G29 _UxGT("Provadim G29") -#define MSG_UBL_UNHOMED _UxGT("Prejedte domu") -#define MSG_UBL_TOOLS _UxGT("UBL nastroje") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Manualni sit bodu") -#define MSG_UBL_BC_INSERT _UxGT("Vlozte kartu, zmerte") -#define MSG_UBL_BC_INSERT2 _UxGT("Zmerte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstrante a zmerte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Presoun na dalsi") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podlozky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Uprava site bodu") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastni sit") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit sit bodu") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec uprav site") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastni sit") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvorit sit") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Sit bodu PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Sit bodu ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studena sit bodu") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit vysku site") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Vyska") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat sit") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola site PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola site ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. site") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokracovat v siti") -#define MSG_UBL_MESH_LEVELING _UxGT("Sitove rovnani") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnani") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mrizkove rovnani") -#define MSG_UBL_MESH_LEVEL _UxGT("Srovnat podlozku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranni body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ site bodu") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovat sit") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovat do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovat do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Zaloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upravit sit dobu") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mrizky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Rucni hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytra hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplnit mrizku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrusit vsechno") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrusit posledni") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upravit vsechny") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upravit posledni") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uloziste siti") -#define MSG_UBL_STORAGE_SLOT _UxGT("Pametovy slot") -#define MSG_UBL_LOAD_MESH _UxGT("Nacist sit bodu") -#define MSG_UBL_SAVE_MESH _UxGT("Ulozit sit bodu") -#define MSG_MESH_LOADED _UxGT("Sit %i nactena") -#define MSG_NO_STORAGE _UxGT("Nedostatek mista") -#define MSG_MESH_SAVED _UxGT("Sit %i ulozena") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Ulozit UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnovit UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Konec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") - -#define MSG_LED_CONTROL _UxGT("LED Nastaveni") -#define MSG_LEDS _UxGT("Svetla") -#define MSG_LED_PRESETS _UxGT("Svetla Predvolby") -#define MSG_SET_LEDS_RED _UxGT("Cervena") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranzova") -#define MSG_SET_LEDS_YELLOW _UxGT("Zluta") -#define MSG_SET_LEDS_GREEN _UxGT("Zelena") -#define MSG_SET_LEDS_BLUE _UxGT("Modra") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialova") -#define MSG_SET_LEDS_WHITE _UxGT("Bila") -#define MSG_SET_LEDS_DEFAULT _UxGT("Vychozi") -#define MSG_CUSTOM_LEDS _UxGT("Vlastni svetla") -#define MSG_INTENSITY_R _UxGT("Cervena intenzita") -#define MSG_INTENSITY_G _UxGT("Zelena intezita") -#define MSG_INTENSITY_B _UxGT("Modra intenzita") -#define MSG_INTENSITY_W _UxGT("Bila intenzita") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastni prikazy") -#define MSG_MOVING _UxGT("Posouvani...") -#define MSG_FREE_XY _UxGT("Uvolnit XY") -#define MSG_MOVE_X _UxGT("Posunout X") -#define MSG_MOVE_Y _UxGT("Posunout Y") -#define MSG_MOVE_Z _UxGT("Posunout Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Posunout o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunout o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunout o 10mm") -#define MSG_SPEED _UxGT("Rychlost") -#define MSG_BED_Z _UxGT("Vyska podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podlozka") -#define MSG_FAN_SPEED _UxGT("Rychlost vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rychlost ex. vent.") -#define MSG_FLOW _UxGT("Prutok") -#define MSG_CONTROL _UxGT("Ovladani") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrat") -#define MSG_ACC _UxGT("Zrychl") -#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_VELOCITY _UxGT("Rychlost") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerace") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-prejezd") -#define MSG_STEPS_PER_MM _UxGT("Kroku/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroku/mm") - #define MSG_BSTEPS _UxGT("Bkroku/mm") - #define MSG_CSTEPS _UxGT("Ckroku/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroku/mm") - #define MSG_BSTEPS _UxGT("Ykroku/mm") - #define MSG_CSTEPS _UxGT("Zkroku/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekroku/mm") -#define MSG_E1STEPS _UxGT("E1kroku/mm") -#define MSG_E2STEPS _UxGT("E2kroku/mm") -#define MSG_E3STEPS _UxGT("E3kroku/mm") -#define MSG_E4STEPS _UxGT("E4kroku/mm") -#define MSG_E5STEPS _UxGT("E5kroku/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavest mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Ulozit nastaveni") -#define MSG_LOAD_EEPROM _UxGT("Nacist nastaveni") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnovit vychozi") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnovit") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Priprava tisku") -#define MSG_TUNE _UxGT("Doladeni tisku") -#define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") -#define MSG_RESUME_PRINT _UxGT("Obnovit tisk") -#define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_CARD_MENU _UxGT("Tisknout z SD") -#define MSG_NO_CARD _UxGT("Zadna SD karta") -#define MSG_DWELL _UxGT("Uspano...") -#define MSG_USERWAIT _UxGT("Cekani na uziv...") -#define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") -#define MSG_PRINT_ABORTED _UxGT("Tisk zrusen") -#define MSG_NO_MOVE _UxGT("Zadny pohyb.") -#define MSG_KILLED _UxGT("PRERUSENO. ") -#define MSG_STOPPED _UxGT("ZASTAVENO. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Vymena Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zvednuti Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vymenit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavest filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vse") - -#define MSG_INIT_SDCARD _UxGT("Nacist SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vymenit SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor zkoseni") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunout") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunout") -#define MSG_HOME _UxGT("Domu") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prvni") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") -#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("Chyba zahrivani") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNI SKOK") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKA TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NIZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NIZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TISK. ZASTAVENA") -#define MSG_PLEASE_RESET _UxGT("Provedte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Zahrivani...") -#define MSG_BED_HEATING _UxGT("Zahrivani podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovat Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovat Stred") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastaveni") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrace") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.vysku delty") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Vyska") -#define MSG_DELTA_RADIUS _UxGT("Polomer") -#define MSG_INFO_MENU _UxGT("O tiskarne") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tiskarne") -#define MSG_3POINT_LEVELING _UxGT("3-bodove rovnani") -#define MSG_LINEAR_LEVELING _UxGT("Linearni rovnani") -#define MSG_BILINEAR_LEVELING _UxGT("Bilinearni rovnani") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mrizkove rovnani") -#define MSG_INFO_STATS_MENU _UxGT("Statistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o desce") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudery") -#define MSG_INFO_BAUDRATE _UxGT("Rychlost") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvetleni") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas svetla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Pocet tisku") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokonceno") - #define MSG_INFO_PRINT_TIME _UxGT("Celkovy cas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelsi tisk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkem vytlaceno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tisky") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Cas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelsi") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlaceno") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Buzeni motoru") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Ulozit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENI FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTI FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOZNOSTI OBNOVENI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlacit vic") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkovani selhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studeny") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na zahajeni") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("vymeny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunuti") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vlozte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stisknete") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlacitko...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknete pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahrati trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na nahrati tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedeni") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyckejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlaceni") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Cekejte prosim") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokracovani") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Cekejte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysouvani...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vlozte, kliknete") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahrivani...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavadeni...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlacovani...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokracovani...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CZ_H diff --git a/Marlin_thinkerV2/Marlin/language_cz_utf8.h b/Marlin_thinkerV2/Marlin/language_cz_utf8.h deleted file mode 100644 index e76c947e48..0000000000 --- a/Marlin_thinkerV2/Marlin/language_cz_utf8.h +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Czech - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Petr Zahradnik, Computer Laboratory - * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz - * - */ -#ifndef LANGUAGE_CZ_UTF_H -#define LANGUAGE_CZ_UTF_H - -#define MAPPER_C3C4C5_CZ -#define DISPLAY_CHARSET_ISO10646_CZ -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" připraven.") -#define MSG_BACK _UxGT("Zpět") -#define MSG_SD_INSERTED _UxGT("Karta vložena") -#define MSG_SD_REMOVED _UxGT("Karta vyjmuta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znaku -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstopy") -#define MSG_MAIN _UxGT("Hlavní nabídka") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") -#define MSG_DEBUG_MENU _UxGT("Nabídka ladění") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. průběhu") -#define MSG_AUTO_HOME _UxGT("Domovská pozice") -#define MSG_AUTO_HOME_X _UxGT("Domů osa X") -#define MSG_AUTO_HOME_Y _UxGT("Domů osa Y") -#define MSG_AUTO_HOME_Z _UxGT("Domů osa Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovat Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Měření podložky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Další bod") -#define MSG_LEVEL_BED_DONE _UxGT("Měření hotovo!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška srovnávání") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") -#define MSG_SET_ORIGIN _UxGT("Nastavit počátek") -#define MSG_PREHEAT_1 _UxGT("Zahřát PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vše") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahřát ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vše") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Zchladit") -#define MSG_SWITCH_PS_ON _UxGT("Zapnout napájení") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnout napájení") -#define MSG_EXTRUDE _UxGT("Vytlačit (extr.)") -#define MSG_RETRACT _UxGT("Zatlačit (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunout osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_BED _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnat rohy") -#define MSG_NEXT_CORNER _UxGT("Další roh") -#define MSG_EDITING_STOPPED _UxGT("Konec úprav sítě") - -#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ů") -#define MSG_UBL_BC_INSERT _UxGT("Vložte kartu, změřte") -#define MSG_UBL_BC_INSERT2 _UxGT("Změřte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstraňte a změřte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Přesun na další") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sítě bodů") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastní síť") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit síť bodů") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec úprav sítě") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastní síť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvořit síť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Síť bodu PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Síť bodu ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená síť bodů") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit výšku sítě") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat síť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola sítě PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola sítě ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. sítě") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovat v síťi") -#define MSG_UBL_MESH_LEVELING _UxGT("Síťové rovnání") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnání") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mrizkove rovnání") -#define MSG_UBL_MESH_LEVEL _UxGT("Srovnat podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranní body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ sítě bodu") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovat síť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovat do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovat do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upravit síť bodů") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mřížky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ruční hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytrá hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplnit mřížku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušit všechno") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušit poslední") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upravit všechny") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upravit poslední") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uložiště sítí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Paměťový slot") -#define MSG_UBL_LOAD_MESH _UxGT("Načíst síť bodů") -#define MSG_UBL_SAVE_MESH _UxGT("Uložit síť bodů") -#define MSG_MESH_LOADED _UxGT("Síť %i načtena") -#define MSG_MESH_SAVED _UxGT("Síť %i uložena") -#define MSG_NO_STORAGE _UxGT("Nedostatek místa") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Uložit UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnovit UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Konec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně") - -#define MSG_LED_CONTROL _UxGT("LED Nastavení") -#define MSG_LEDS _UxGT("Světla") -#define MSG_LED_PRESETS _UxGT("Světla Předvolby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žlutá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Bílá") -#define MSG_SET_LEDS_DEFAULT _UxGT("Výchozí") -#define MSG_CUSTOM_LEDS _UxGT("Vlastní světla") -#define MSG_INTENSITY_R _UxGT("Červená intenzita") -#define MSG_INTENSITY_G _UxGT("Zelená intezita") -#define MSG_INTENSITY_B _UxGT("Modrá intenzita") -#define MSG_INTENSITY_W _UxGT("Bílá intenzita") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastní příkazy") -#define MSG_MOVING _UxGT("Posouvani...") -#define MSG_FREE_XY _UxGT("Uvolnit XY") -#define MSG_MOVE_X _UxGT("Posunout X") -#define MSG_MOVE_Y _UxGT("Posunout Y") -#define MSG_MOVE_Z _UxGT("Posunout Z") -#define MSG_MOVE_E _UxGT("Extrudér") -#define MSG_MOVE_01MM _UxGT("Posunout o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunout o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunout o 10mm") -#define MSG_SPEED _UxGT("Rychlost") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_FAN_SPEED _UxGT("Rychlost vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rychlost ex. vent.") -#define MSG_FLOW _UxGT("Průtok") -#define MSG_CONTROL _UxGT("Ovládaní") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrat") -#define MSG_ACC _UxGT("Zrychl") -#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_VELOCITY _UxGT("Rychlost") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerace") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-přejezd") -#define MSG_STEPS_PER_MM _UxGT("Kroků/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akroků/mm") - #define MSG_BSTEPS _UxGT("Bkroků/mm") - #define MSG_CSTEPS _UxGT("Ckroků/mm") -#else - #define MSG_ASTEPS _UxGT("Xkroků/mm") - #define MSG_BSTEPS _UxGT("Ykroků/mm") - #define MSG_CSTEPS _UxGT("Zkroků/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekroků/mm") -#define MSG_E1STEPS _UxGT("E1kroků/mm") -#define MSG_E2STEPS _UxGT("E2kroků/mm") -#define MSG_E3STEPS _UxGT("E3kroků/mm") -#define MSG_E4STEPS _UxGT("E4kroků/mm") -#define MSG_E5STEPS _UxGT("E5kroků/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunout mm") -#define MSG_FILAMENT_LOAD _UxGT("Zavést mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Uložit nastavení") -#define MSG_LOAD_EEPROM _UxGT("Načíst nastavení") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnovit výchozí") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnovit") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Připrava tisku") -#define MSG_TUNE _UxGT("Doladění tisku") -#define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") -#define MSG_RESUME_PRINT _UxGT("Obnovit tisk") -#define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Obnova vypadku") -#define MSG_CARD_MENU _UxGT("Tisknout z SD") -#define MSG_NO_CARD _UxGT("Žádná SD karta") -#define MSG_DWELL _UxGT("Uspáno...") -#define MSG_USERWAIT _UxGT("Čekání na uživ...") -#define MSG_PRINT_PAUSED _UxGT("Tisk pozastaven") -#define MSG_PRINTING _UxGT("Tisknu...") -#define MSG_PRINT_ABORTED _UxGT("Tisk zrušen") -#define MSG_NO_MOVE _UxGT("Žádný pohyb.") -#define MSG_KILLED _UxGT("PŘERUSENO. ") -#define MSG_STOPPED _UxGT("ZASTAVENO. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výměna Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zvednuti Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vyměnit filament") -#define MSG_FILAMENTLOAD _UxGT("Zavést filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunout filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vše") - -#define MSG_INIT_SDCARD _UxGT("Načíst SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vyměnit SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor zkosení") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunout") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunout") -#define MSG_HOME _UxGT("Domů") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("první") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") -#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("Chyba zahřívání") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba zahř. podl.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÍ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("PODL. TEPL. SKOK") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TISK. ZASTAVENA") -#define MSG_PLEASE_RESET _UxGT("Proveďte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Zahřívání...") -#define MSG_COOLING _UxGT("Chlazení") -#define MSG_BED_HEATING _UxGT("Zahřívání podl...") -#define MSG_BED_COOLING _UxGT("Chlazení podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovat Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovat Střed") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastavení") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrace") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Nast. Z-ofset") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Výška") -#define MSG_DELTA_RADIUS _UxGT("Poloměr") -#define MSG_INFO_MENU _UxGT("O tiskárně") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tiskárně") -#define MSG_3POINT_LEVELING _UxGT("3-bodové rovnání") -#define MSG_LINEAR_LEVELING _UxGT("Lineárni rovnání") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineární rovnání") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mřížkové rovnání") -#define MSG_INFO_STATS_MENU _UxGT("Statistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o desce") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rychlost") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvětlení") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas světla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tisků") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončeno") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší tisk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkem vytlačeno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tisky") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačeno") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Buzení motorů") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Uložit do EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("TISK POZASTAVEN") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTÍ FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽNOSTI OBNOVENÍ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačit víc") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnovit tisk") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkování selhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrace selhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Moc studený") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na zahájení") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výměny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunuti") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stiskněte") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlačítko...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahřátí trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na nahřátí tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedení") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vyčkejte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačení") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračování") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tisku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysouvání...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, klikněte") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahřívání...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádění...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačování...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračování...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_CZ_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_da.h b/Marlin_thinkerV2/Marlin/language_da.h deleted file mode 100644 index e51f8d014a..0000000000 --- a/Marlin_thinkerV2/Marlin/language_da.h +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Danish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_DA_H -#define LANGUAGE_DA_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" er klar") -#define MSG_SD_INSERTED _UxGT("Kort isat") -#define MSG_SD_REMOVED _UxGT("Kort fjernet") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Slå alle steppere fra") -#define MSG_AUTO_HOME _UxGT("Auto Home") // G28 -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik når du er klar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Næste punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level er færdig!") -#define MSG_SET_HOME_OFFSETS _UxGT("Sæt forsk. af home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Forsk. er nu aktiv") -#define MSG_SET_ORIGIN _UxGT("Sæt origin") -#define MSG_PREHEAT_1 _UxGT("Forvarm PLA") -#define MSG_PREHEAT_1_N _UxGT("Forvarm PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Forvarm PLA Alle") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Forvarm PLA Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Forvarm PLA conf") -#define MSG_PREHEAT_2 _UxGT("Forvarm ABS") -#define MSG_PREHEAT_2_N _UxGT("Forvarm ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Forvarm ABS Alle") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Forvarm ABS Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Forvarm ABS conf") -#define MSG_COOLDOWN _UxGT("Afkøl") -#define MSG_SWITCH_PS_ON _UxGT("Slå strøm til") -#define MSG_SWITCH_PS_OFF _UxGT("Slå strøm fra") -#define MSG_EXTRUDE _UxGT("Extruder") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Flyt akser") -#define MSG_BED_LEVELING _UxGT("Juster bed") -#define MSG_LEVEL_BED _UxGT("Juster bed") -#define MSG_MOVE_X _UxGT("Flyt X") -#define MSG_MOVE_Y _UxGT("Flyt Y") -#define MSG_MOVE_Z _UxGT("Flyt Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Flyt 0.1mm") -#define MSG_MOVE_1MM _UxGT("Flyt 1mm") -#define MSG_MOVE_10MM _UxGT("Flyt 10mm") -#define MSG_SPEED _UxGT("Hastighed") -#define MSG_BED_Z _UxGT("Plade Z") -#define MSG_NOZZLE _UxGT("Dyse") - -#define MSG_BED _UxGT("Plade") -#define MSG_FAN_SPEED _UxGT("Blæser hastighed") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Kontrol") -#define MSG_MIN _UxGT(" \002 Min") -#define MSG_MAX _UxGT(" \002 Max") -#define MSG_FACTOR _UxGT(" \002 Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("Til ") -#define MSG_OFF _UxGT("Fra") -#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("Vælg") -#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-rejse") -#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_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bevægelse") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E i mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrast") -#define MSG_STORE_EEPROM _UxGT("Gem i EEPROM") -#define MSG_LOAD_EEPROM _UxGT("Hent fra EEPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Gendan failsafe") -#define MSG_REFRESH _UxGT("Genopfrisk") -#define MSG_WATCH _UxGT("Info skærm") -#define MSG_PREPARE _UxGT("Forbered") -#define MSG_TUNE _UxGT("Tune") -#define MSG_PAUSE_PRINT _UxGT("Pause printet") -#define MSG_RESUME_PRINT _UxGT("Forsæt printet") -#define MSG_STOP_PRINT _UxGT("Stop printet") -#define MSG_CARD_MENU _UxGT("Print fra SD") -#define MSG_NO_CARD _UxGT("Intet SD kort") -#define MSG_DWELL _UxGT("Dvale...") -#define MSG_USERWAIT _UxGT("Venter på bruger...") -#define MSG_PRINT_ABORTED _UxGT("Print annulleret") -#define MSG_NO_MOVE _UxGT("Ingen bevægelse.") -#define MSG_KILLED _UxGT("DRÆBT. ") -#define MSG_STOPPED _UxGT("STOPPET. ") -#define MSG_CONTROL_RETRACT _UxGT("Tilbagetræk mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Skift Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Tilbagetræk V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Skift UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Skift filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD card") -#define MSG_CNG_SDCARD _UxGT("Skift SD kort") -#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_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("Opvarmning fejlet") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Fejl: reserve temp") -#define MSG_THERMAL_RUNAWAY _UxGT("Temp løber løbsk") -#define MSG_ERR_MAXTEMP _UxGT("Fejl: Maks temp") -#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_HALTED _UxGT("PRINTER STOPPET") -#define MSG_PLEASE_RESET _UxGT("Reset Venligst") -#define MSG_SHORT_DAY _UxGT("d") // Kun et bogstav -#define MSG_SHORT_HOUR _UxGT("h") // Kun et bogstav -#define MSG_SHORT_MINUTE _UxGT("m") // Kun et bogstav -#define MSG_HEATING _UxGT("Opvarmer...") -#define MSG_BED_HEATING _UxGT("Opvarmer plade...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrering") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrerings Center") - -#define MSG_INFO_MENU _UxGT("Om Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Kort Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Ant. Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total print tid") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total Extruderet") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruderet") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Strømfors.") - -#define MSG_DRIVE_STRENGTH _UxGT("Driv Styrke") -#define MSG_DAC_PERCENT _UxGT("Driv %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Skriv") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Forsæt print") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent på start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("af filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("skift") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vent på") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament udskyd.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("og tryk på knap") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("for at fortsætte...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Vent på") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament indtag") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Vent på at print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("fortsætter") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent venligst...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Udskyder...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt og klik") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Indtager...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsætter...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_DA_H diff --git a/Marlin_thinkerV2/Marlin/language_de.h b/Marlin_thinkerV2/Marlin/language_de.h deleted file mode 100644 index 2a28c9145d..0000000000 --- a/Marlin_thinkerV2/Marlin/language_de.h +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * German - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_DE_H -#define LANGUAGE_DE_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("ÄäÖöÜüß²³") - -#define WELCOME_MSG MACHINE_NAME _UxGT(" bereit") -#define MSG_BACK _UxGT("Zurück") -#define MSG_SD_INSERTED _UxGT("SD-Karte erkannt") -#define MSG_SD_REMOVED _UxGT("SD-Karte entfernt") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopp") // Max length 8 characters -#define MSG_MAIN _UxGT("Hauptmenü") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren deaktivieren") // M84 -#define MSG_DEBUG_MENU _UxGT("Debug Menü") -#define MSG_PROGRESS_BAR_TEST _UxGT("Fortschrittsb. Test") -#define MSG_AUTO_HOME _UxGT("Home") // G28 -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriere Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klick für Start") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") -#define MSG_LEVEL_BED_DONE _UxGT("Fertig") -#define MSG_Z_FADE_HEIGHT _UxGT("Ausblendhöhe") -#define MSG_SET_HOME_OFFSETS _UxGT("Setze Homeversatz") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Homeversatz aktiv") -#define MSG_SET_ORIGIN _UxGT("Setze Nullpunkt") //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_1 _UxGT("Vorwärmen PLA") -#define MSG_PREHEAT_1_N _UxGT("Vorwärmen PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Vorw. PLA Alle") -#define MSG_PREHEAT_1_END _UxGT("Vorw. PLA Extr.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Vorw. PLA Bett") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Vorw. PLA Einst.") -#define MSG_PREHEAT_2 _UxGT("Vorwärmen ABS") -#define MSG_PREHEAT_2_N _UxGT("Vorwärmen ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Vorw. ABS Alle") -#define MSG_PREHEAT_2_END _UxGT("Vorw. ABS Extr.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Vorw. ABS Bett") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Vorw. ABS Einst.") -#define MSG_COOLDOWN _UxGT("Abkühlen") -#define MSG_SWITCH_PS_ON _UxGT("Netzteil ein") -#define MSG_SWITCH_PS_OFF _UxGT("Netzteil aus") -#define MSG_EXTRUDE _UxGT("Extrudieren") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Bewegen") -#define MSG_BED_LEVELING _UxGT("Bett Nivellierung") -#define MSG_LEVEL_BED _UxGT("Bett nivellieren") -#define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") -#define MSG_NEXT_CORNER _UxGT("Nächste Ecke") -#define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") -#define MSG_USER_MENU _UxGT("Benutzer Menü") -#define MSG_MOVING _UxGT("In Bewegung...") -#define MSG_FREE_XY _UxGT("Abstand XY") -#define MSG_MOVE_X _UxGT("X") -#define MSG_MOVE_Y _UxGT("Y") -#define MSG_MOVE_Z _UxGT("Z") -#define MSG_MOVE_E _UxGT("Extruder ") -#define MSG_MOVE_01MM _UxGT(" 0,1 mm") -#define MSG_MOVE_1MM _UxGT(" 1,0 mm") -#define MSG_MOVE_10MM _UxGT("10,0 mm") -#define MSG_SPEED _UxGT("Geschw.") -#define MSG_BED_Z _UxGT("Bett Z") -#define MSG_NOZZLE _UxGT("Düse") -#define MSG_BED _UxGT("Bett") -#define MSG_FAN_SPEED _UxGT("Lüfter") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra Lüfter") -#define MSG_FLOW _UxGT("Flussrate") -#define MSG_CONTROL _UxGT("Einstellungen") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Faktor") -#define MSG_AUTOTEMP _UxGT("AutoTemp") -#define MSG_ON _UxGT("Ein") -#define MSG_OFF _UxGT("Aus") -#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("Auswählen") -#define MSG_ACC _UxGT("A") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("V A Jerk") - #define MSG_VB_JERK _UxGT("V B Jerk") - #define MSG_VC_JERK _UxGT("V C Jerk") -#else - #define MSG_VA_JERK _UxGT("V X Jerk") - #define MSG_VB_JERK _UxGT("V Y Jerk") - #define MSG_VC_JERK _UxGT("V Z Jerk") -#endif -#define MSG_VE_JERK _UxGT("V E Jerk") -#define MSG_VELOCITY _UxGT("Geschwindigkeit") -#define MSG_VMAX _UxGT("V max ") // space by purpose -#define MSG_VMIN _UxGT("V min") -#define MSG_VTRAV_MIN _UxGT("V min Leerfahrt") -#define MSG_ACCELERATION _UxGT("Beschleunigung") -#define MSG_AMAX _UxGT("A max ") // space by purpose -#define MSG_A_RETRACT _UxGT("A Retract") -#define MSG_A_TRAVEL _UxGT("A Leerfahrt") -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A Steps/mm") - #define MSG_BSTEPS _UxGT("B Steps/mm") - #define MSG_CSTEPS _UxGT("C Steps/mm") -#else - #define MSG_ASTEPS _UxGT("X Steps/mm") - #define MSG_BSTEPS _UxGT("Y Steps/mm") - #define MSG_CSTEPS _UxGT("Z Steps/mm") -#endif -#define MSG_ESTEPS _UxGT("E Steps/mm") -#define MSG_E1STEPS _UxGT("E1 Steps/mm") -#define MSG_E2STEPS _UxGT("E2 Steps/mm") -#define MSG_E3STEPS _UxGT("E3 Steps/mm") -#define MSG_E4STEPS _UxGT("E4 Steps/mm") -#define MSG_E5STEPS _UxGT("E5 Steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bewegung") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("D Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Entladen mm") -#define MSG_FILAMENT_LOAD _UxGT("Laden mm") -#define MSG_ADVANCE_K _UxGT("Advance Faktor") -#define MSG_CONTRAST _UxGT("LCD Kontrast") -#define MSG_STORE_EEPROM _UxGT("Konfig. speichern") -#define MSG_LOAD_EEPROM _UxGT("Konfig. laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden") -#define MSG_INIT_EEPROM _UxGT("Werkseinstellungen") -#define MSG_REFRESH _UxGT("Aktualisieren") -#define MSG_WATCH _UxGT("Info") -#define MSG_PREPARE _UxGT("Vorbereitung") -#define MSG_TUNE _UxGT("Justierung") -#define MSG_PAUSE_PRINT _UxGT("SD-Druck Pause") -#define MSG_RESUME_PRINT _UxGT("SD-Druck Fortsetzung") -#define MSG_STOP_PRINT _UxGT("SD-Druck Abbruch") -#define MSG_CARD_MENU _UxGT("SD-Karte") -#define MSG_NO_CARD _UxGT("Keine SD-Karte") -#define MSG_DWELL _UxGT("Warten...") -#define MSG_USERWAIT _UxGT("Warte auf Nutzer") -#define MSG_PRINT_PAUSED _UxGT("Druck pausiert") -#define MSG_PRINT_ABORTED _UxGT("Druck abgebrochen") -#define MSG_NO_MOVE _UxGT("Motoren eingeschaltet") -#define MSG_KILLED _UxGT("ABGEBROCHEN") -#define MSG_STOPPED _UxGT("ANGEHALTEN") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Wechs. Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z-Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Wechs. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("Autom. Retract") -#define MSG_FILAMENTCHANGE _UxGT("Filament wechseln") -#define MSG_FILAMENTLOAD _UxGT("Filament laden") -#define MSG_FILAMENTUNLOAD _UxGT("Filament entladen") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Alles entladen") -#define MSG_INIT_SDCARD _UxGT("SD-Karte erkennen") // Manually initialize the SD-card via user interface -#define MSG_CNG_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" -#define MSG_ZPROBE_OUT _UxGT("Sensor ausserhalb") -#define MSG_SKEW_FACTOR _UxGT("Skew Faktor") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch ausfahren") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch 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_ZPROBE_ZOFFSET _UxGT("Z Versatz") -#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("Endstopp-Abbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN FEHLGESCHLAGEN") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMPERATURABWEICHUNG") -#define MSG_THERMAL_RUNAWAY LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("BETT") MSG_THERMAL_RUNAWAY -#define MSG_ERR_MAXTEMP LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") -#define MSG_ERR_MINTEMP LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") -#define MSG_ERR_MAXTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") -#define MSG_ERR_MINTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("DRUCKER STOPP") -#define MSG_PLEASE_RESET _UxGT("Bitte Resetten") -#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_BED_HEATING _UxGT("Bett heizt...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrieren") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriere X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriere Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriere Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriere Mitte") -#define MSG_DELTA_SETTINGS _UxGT("Delta Einst. anzeig.") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autom. Kalibrierung") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Höhe setzen") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#define MSG_DELTA_HEIGHT _UxGT("Höhe") -#define MSG_DELTA_RADIUS _UxGT("Radius") -#define MSG_INFO_MENU _UxGT("Über den Drucker") -#define MSG_INFO_PRINTER_MENU _UxGT("Drucker Info") -#define MSG_3POINT_LEVELING _UxGT("3-Punkt Nivellierung") -#define MSG_LINEAR_LEVELING _UxGT("Lineare Nivellierung") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineare Nivell.") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Netz Nivellierung") -#define MSG_INFO_STATS_MENU _UxGT("Drucker Statistik") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistoren") -#define MSG_INFO_EXTRUDERS _UxGT("Extruder") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protokoll") -#define MSG_CASE_LIGHT _UxGT("Beleuchtung") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Helligkeit") - -#define MSG_UBL_DOING_G29 _UxGT("G29 UBL läuft!") -#define MSG_UBL_UNHOMED _UxGT("Erst XYZ homen") -#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.") -#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") -#define MSG_UBL_BC_INSERT2 _UxGT("Messen") -#define MSG_UBL_BC_REMOVE _UxGT("Entfernen & messen") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Nächster Punkt...") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktivieren") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL deaktivieren") -#define MSG_UBL_SET_BED_TEMP _UxGT("Bett Temp.") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Netz bearbeiten") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Eigenes Netz bearb.") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Feineinstellung...") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Bearbeitung beendet") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Eigenes Netz erst.") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Netz erstellen") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Netz erstellen PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Netz erstellen ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netz Höhe einst.") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Netz validieren PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Netz validieren ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") -#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 Nivellierung") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Gitternetz Nivell.") -#define MSG_UBL_MESH_LEVEL _UxGT("Netz nivellieren") -#define MSG_UBL_SIDE_POINTS _UxGT("Eckpunkte") -#define MSG_UBL_MAP_TYPE _UxGT("Kartentyp") -#define MSG_UBL_OUTPUT_MAP _UxGT("Karte ausgeben") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Ausgabe für Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Ausgabe für CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Externe Sicherung") -#define MSG_UBL_INFO_UBL _UxGT("UBL Info ausgeben") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Netz bearbeiten") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Menge an Fill-in") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuelles Fill-in") -#define MSG_UBL_SMART_FILLIN _UxGT("Kluges Fill-in") -#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Netz") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Alles annullieren") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Nächstlieg. ann.") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Feineinstellung Alle") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Feineinst. Nächstl.") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Netz Speicherplatz") -#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#define MSG_UBL_LOAD_MESH _UxGT("Bett Netz laden") -#define MSG_UBL_SAVE_MESH _UxGT("Bett Netz speichern") -#define MSG_MESH_LOADED _UxGT("Netz %i geladen") -#define MSG_MESH_SAVED _UxGT("Netz %i gespeichert") -#define MSG_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_STOPPED _UxGT("Z-Versatz angehalten") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") - -#define MSG_LED_CONTROL _UxGT("LED Kontrolle") -#define MSG_LEDS _UxGT("Licht") -#define MSG_LED_PRESETS _UxGT("Licht Einstellungen") -#define MSG_SET_LEDS_RED _UxGT("Rot") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Gelb") -#define MSG_SET_LEDS_GREEN _UxGT("Grün") -#define MSG_SET_LEDS_BLUE _UxGT("Blau") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violett") -#define MSG_SET_LEDS_WHITE _UxGT("Weiß") -#define MSG_SET_LEDS_DEFAULT _UxGT("Standard") -#define MSG_CUSTOM_LEDS _UxGT("Benutzerdef.") -#define MSG_INTENSITY_R _UxGT("Intensität Rot") -#define MSG_INTENSITY_G _UxGT("Intensität Grün") -#define MSG_INTENSITY_B _UxGT("Intensität Blau") -#define MSG_INTENSITY_W _UxGT("Intensität Weiß") -#define MSG_LED_BRIGHTNESS _UxGT("Helligkeit") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Gesamte Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Beendete Drucke") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamte Druckzeit") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster Druckjob") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Gesamt Extrudiert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplett") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamt ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Netzteil") - -#define MSG_DRIVE_STRENGTH _UxGT("Motorströme") -#define MSG_DAC_PERCENT _UxGT("Treiber %") -#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") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("FILAMENT ENTLADEN") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("FORTS. OPTIONEN:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Mehr entleeren") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Drucke weiter") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Düse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Homing gescheitert") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing gescheitert") -#define MSG_M600_TOO_COLD _UxGT("M600: Zu kalt") -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Warte auf den") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("Start des") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("Filamentwechsels") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("Herausnahme") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("des Filaments...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filament einlegen") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("und Knopf") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("drücken...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Knopf drücken um") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Düse aufzuheizen.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Düse heizt auf...") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Bitte warten...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Laden des") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("Filaments") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Entleeren des") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("Filaments") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("Fortsetzung des") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("Druckes...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Bitte warten...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Auswerfen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laden und Klick") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heizen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Laden...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Entleeren...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsetzen...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_DE_H diff --git a/Marlin_thinkerV2/Marlin/language_el-gr.h b/Marlin_thinkerV2/Marlin/language_el-gr.h deleted file mode 100644 index 775242bb8f..0000000000 --- a/Marlin_thinkerV2/Marlin/language_el-gr.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Greek (Greece) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EL_GR_H -#define LANGUAGE_EL_GR_H - -#define MAPPER_CECF -#define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _UxGT("Απενεργοποίηση βηματιστή") -#define MSG_AUTO_HOME _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο") -#define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") -#define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") -#define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ") -#define MSG_LEVEL_BED_WAITING _UxGT("Κάντε κλικ για να ξεκινήσετε") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") -#define MSG_LEVEL_BED_DONE _UxGT("Ολοκλήρωση επιπεδοποίησης!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" κλίνη") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" επιβεβαίωση") -#define MSG_COOLDOWN _UxGT("Μειωση θερμοκρασιας") -#define MSG_SWITCH_PS_ON _UxGT("Ενεργοποίηση") -#define MSG_SWITCH_PS_OFF _UxGT("Απενεργοποίηση") -#define MSG_EXTRUDE _UxGT("Εξώθηση") -#define MSG_RETRACT _UxGT("Ανάσυρση") -#define MSG_MOVE_AXIS _UxGT("Μετακίνηση άξονα") -#define MSG_BED_LEVELING _UxGT("Επιπεδοποίηση κλίνης") -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση κλίνης") -#define MSG_MOVE_X _UxGT("Μετακίνηση X") -#define MSG_MOVE_Y _UxGT("Μετακίνηση Y") -#define MSG_MOVE_Z _UxGT("Μετακίνηση Z") -#define MSG_MOVE_E _UxGT("Εξωθητήρας") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1 μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1 μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10 μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Κλίνη Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#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("Αυτομ. ρύθμιση θερμοκρασίας") -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") -#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_ACC _UxGT("Επιτάχυνση") -#define MSG_JERK _UxGT("Vαντίδραση") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") -#define MSG_VMAX _UxGT("Vμεγ ") -#define MSG_VMIN _UxGT("Vελαχ") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#define MSG_A_RETRACT _UxGT("Α-ανάσυρση") -#define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") -#define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif -#define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") -#define MSG_REFRESH _UxGT("Ανανέωση") -#define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") -#define MSG_PREPARE _UxGT("Προετοιμασία") -#define MSG_TUNE _UxGT("Συντονισμός") -#define MSG_PAUSE_PRINT _UxGT("Παύση εκτύπωσης") -#define MSG_RESUME_PRINT _UxGT("Συνέχιση εκτύπωσης") -#define MSG_STOP_PRINT _UxGT("Διακοπή εκτύπωσης") -#define MSG_CARD_MENU _UxGT("Εκτύπωση από SD") -#define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") -#define MSG_DWELL _UxGT("Αναστολή λειτουργίας…") -#define MSG_USERWAIT _UxGT("Αναμονή για χρήστη…") -#define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") -#define MSG_NO_MOVE _UxGT("Καμία κίνηση.") -#define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") -#define MSG_STOPPED _UxGT("ΔΙΑΚΟΠΗ. ") -#define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") -#define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") -#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("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός κλίνης") -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ματαίωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#define MSG_THERMAL_RUNAWAY _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ") -#define MSG_ERR_MAXTEMP _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ") -#define MSG_ERR_MINTEMP _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ") -#define MSG_ERR_MAXTEMP_BED _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") -#define MSG_ERR_MINTEMP_BED _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ") -#define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _UxGT("Θέρμανση κλίνης…") -#define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Βαθμονόμηση Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Βαθμονόμηση κέντρου") - -#endif // LANGUAGE_EL_GR_H diff --git a/Marlin_thinkerV2/Marlin/language_el.h b/Marlin_thinkerV2/Marlin/language_el.h deleted file mode 100644 index b4fe4d37f0..0000000000 --- a/Marlin_thinkerV2/Marlin/language_el.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Greek - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EL_H -#define LANGUAGE_EL_H - -#define MAPPER_CECF -#define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _UxGT("Απενεργοποίηση Μοτέρ") -#define MSG_AUTO_HOME _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο") //SHORTEN -#define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") -#define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") -#define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Βαθμονόμηση Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED_WAITING _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει") //SHORTEN -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") -#define MSG_LEVEL_BED_DONE _UxGT("Ολοκλήρωση επιπεδοποίησης!") //SHORTEN -#define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") //SHORTEN -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") //SHORTEN -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_COOLDOWN _UxGT("Μειωση θερμοκρασιας") -#define MSG_SWITCH_PS_ON _UxGT("Ενεργοποίηση") -#define MSG_SWITCH_PS_OFF _UxGT("Απενεργοποίηση") -#define MSG_EXTRUDE _UxGT("Εξώθηση") -#define MSG_RETRACT _UxGT("Ανάσυρση") -#define MSG_MOVE_AXIS _UxGT("Μετακίνηση άξονα") -#define MSG_BED_LEVELING _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#define MSG_MOVE_X _UxGT("Μετακίνηση X") -#define MSG_MOVE_Y _UxGT("Μετακίνηση Y") -#define MSG_MOVE_Z _UxGT("Μετακίνηση Z") -#define MSG_MOVE_E _UxGT("Εξωθητήρας") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Επ. Εκτύπωσης Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#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("Αυτομ ρύθμιση θερ/σίας") //SHORTEN -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") -#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_ACC _UxGT("Επιτάχυνση") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Vαντίδραση A") - #define MSG_VB_JERK _UxGT("Vαντίδραση B") - #define MSG_VC_JERK _UxGT("Vαντίδραση C") -#else - #define MSG_VA_JERK _UxGT("Vαντίδραση X") - #define MSG_VB_JERK _UxGT("Vαντίδραση Y") - #define MSG_VC_JERK _UxGT("Vαντίδραση Z") -#endif -#define MSG_VE_JERK _UxGT("Vαντίδραση E") -#define MSG_VMAX _UxGT("V Μέγιστο") -#define MSG_VMIN _UxGT("V Ελάχιστο") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#define MSG_A_RETRACT _UxGT("Α-ανάσυρση") -#define MSG_A_TRAVEL _UxGT("Α-μετατόπιση") -#define MSG_STEPS_PER_MM _UxGT("Bήματα ανά μμ") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Bήματα A ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα B ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα C ανά μμ") -#else - #define MSG_ASTEPS _UxGT("Bήματα X ανά μμ") - #define MSG_BSTEPS _UxGT("Bήματα Y ανά μμ") - #define MSG_CSTEPS _UxGT("Bήματα Z ανά μμ") -#endif -#define MSG_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") //SHORTEN -#define MSG_REFRESH _UxGT("Ανανέωση") -#define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") -#define MSG_PREPARE _UxGT("Προετοιμασία") -#define MSG_TUNE _UxGT("Συντονισμός") -#define MSG_PAUSE_PRINT _UxGT("Παύση εκτύπωσης") -#define MSG_RESUME_PRINT _UxGT("Συνέχιση εκτύπωσης") -#define MSG_STOP_PRINT _UxGT("Διακοπή εκτύπωσης") -#define MSG_CARD_MENU _UxGT("Εκτύπωση από SD") -#define MSG_NO_CARD _UxGT("Δεν βρέθηκε SD") -#define MSG_DWELL _UxGT("Αναστολή λειτουργίας") -#define MSG_USERWAIT _UxGT("Αναμονή για χρήστη") -#define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") //SHORTEN -#define MSG_NO_MOVE _UxGT("Καμία κίνηση.") -#define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") -#define MSG_STOPPED _UxGT("ΔΙΑΚΟΠΗ. ") -#define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") //SHORTEN -#define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") -#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("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") //SHORTEN -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης") //SHORTEN -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") //SHORTEN -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ακύρωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#define MSG_THERMAL_RUNAWAY _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ") -#define MSG_ERR_MAXTEMP _UxGT("ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ") -#define MSG_ERR_MINTEMP _UxGT("ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ") //SHORTEN -#define MSG_ERR_MAXTEMP_BED _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_ERR_MINTEMP_BED _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_HALTED _UxGT("H εκτύπωση διακόπηκε") -#define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _UxGT("Θέρμανση ΕΠ. Εκτύπωσης") //SHORTEN -#define MSG_DELTA_CALIBRATE _UxGT("Βαθμονόμηση Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Βαθμονόμηση X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Βαθμονόμηση Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Βαθμονόμηση Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Βαθμονόμηση κέντρου") - -#endif // LANGUAGE_EL_H diff --git a/Marlin_thinkerV2/Marlin/language_en.h b/Marlin_thinkerV2/Marlin/language_en.h deleted file mode 100644 index 577171b0df..0000000000 --- a/Marlin_thinkerV2/Marlin/language_en.h +++ /dev/null @@ -1,1075 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * English - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EN_H -#define LANGUAGE_EN_H - -#define en 1234 -#if LCD_LANGUAGE == en - #define NOT_EXTENDED_ISO10646_1_5X7 -#endif -#undef en - -#ifndef CHARSIZE - #define CHARSIZE 1 -#endif - -#ifndef WELCOME_MSG - #define WELCOME_MSG MACHINE_NAME _UxGT(" Ready.") -#endif -#ifndef MSG_BACK - #define MSG_BACK _UxGT("Back") -#endif -#ifndef MSG_SD_INSERTED - #define MSG_SD_INSERTED _UxGT("Card inserted") -#endif -#ifndef MSG_SD_REMOVED - #define MSG_SD_REMOVED _UxGT("Card removed") -#endif -#ifndef MSG_LCD_ENDSTOPS - #define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#endif -#ifndef MSG_LCD_SOFT_ENDSTOPS - #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstops") -#endif -#ifndef MSG_MAIN - #define MSG_MAIN _UxGT("Main") -#endif -#ifndef MSG_AUTOSTART - #define MSG_AUTOSTART _UxGT("Autostart") -#endif -#ifndef MSG_DISABLE_STEPPERS - #define MSG_DISABLE_STEPPERS _UxGT("Disable steppers") -#endif -#ifndef MSG_DEBUG_MENU - #define MSG_DEBUG_MENU _UxGT("Debug Menu") -#endif -#ifndef MSG_PROGRESS_BAR_TEST - #define MSG_PROGRESS_BAR_TEST _UxGT("Progress Bar Test") -#endif -#ifndef MSG_AUTO_HOME - #define MSG_AUTO_HOME _UxGT("Auto home") -#endif -#ifndef MSG_AUTO_HOME_X - #define MSG_AUTO_HOME_X _UxGT("Home X") -#endif -#ifndef MSG_AUTO_HOME_Y - #define MSG_AUTO_HOME_Y _UxGT("Home Y") -#endif -#ifndef MSG_AUTO_HOME_Z - #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#endif -#ifndef MSG_TMC_Z_CALIBRATION - #define MSG_TMC_Z_CALIBRATION _UxGT("Calibrate Z") -#endif -#ifndef MSG_LEVEL_BED_HOMING - #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#endif -#ifndef MSG_LEVEL_BED_WAITING - #define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") -#endif -#ifndef MSG_LEVEL_BED_NEXT_POINT - #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Next Point") -#endif -#ifndef MSG_LEVEL_BED_DONE - #define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") -#endif -#ifndef MSG_Z_FADE_HEIGHT - #define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#endif -#ifndef MSG_SET_HOME_OFFSETS - #define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#endif -#ifndef MSG_HOME_OFFSETS_APPLIED - #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#endif -#ifndef MSG_SET_ORIGIN - #define MSG_SET_ORIGIN _UxGT("Set origin") -#endif -#ifndef MSG_PREHEAT_1 - #define MSG_PREHEAT_1 _UxGT("Preheat PLA") -#endif -#ifndef MSG_PREHEAT_1_N - #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_1_ALL - #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_1_END - #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_1_BEDONLY - #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_1_SETTINGS - #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#endif -#ifndef MSG_PREHEAT_2 - #define MSG_PREHEAT_2 _UxGT("Preheat ABS") -#endif -#ifndef MSG_PREHEAT_2_N - #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_2_ALL - #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_2_END - #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_2_BEDONLY - #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_2_SETTINGS - #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#endif -#ifndef MSG_COOLDOWN - #define MSG_COOLDOWN _UxGT("Cooldown") -#endif -#ifndef MSG_SWITCH_PS_ON - #define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#endif -#ifndef MSG_SWITCH_PS_OFF - #define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#endif -#ifndef MSG_EXTRUDE - #define MSG_EXTRUDE _UxGT("Extrude") -#endif -#ifndef MSG_RETRACT - #define MSG_RETRACT _UxGT("Retract") -#endif -#ifndef MSG_MOVE_AXIS - #define MSG_MOVE_AXIS _UxGT("Move axis") -#endif -#ifndef MSG_BED_LEVELING - #define MSG_BED_LEVELING _UxGT("Bed Leveling") -#endif -#ifndef MSG_LEVEL_BED - #define MSG_LEVEL_BED _UxGT("Level bed") -#endif -#ifndef MSG_LEVEL_CORNERS - #define MSG_LEVEL_CORNERS _UxGT("Level corners") -#endif -#ifndef MSG_NEXT_CORNER - #define MSG_NEXT_CORNER _UxGT("Next corner") -#endif -#ifndef MSG_EDITING_STOPPED - #define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -#endif -#ifndef MSG_USER_MENU - #define MSG_USER_MENU _UxGT("Custom Commands") -#endif -#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 -#ifndef MSG_UBL_LEVEL_BED - #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_UBL_MANUAL_MESH - #define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") -#endif -#ifndef MSG_UBL_BC_INSERT - #define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#endif -#ifndef MSG_UBL_BC_INSERT2 - #define MSG_UBL_BC_INSERT2 _UxGT("Measure") -#endif -#ifndef MSG_UBL_BC_REMOVE - #define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -#endif -#ifndef MSG_UBL_MOVING_TO_NEXT - #define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#endif -#ifndef MSG_UBL_ACTIVATE_MESH - #define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL") -#endif -#ifndef MSG_UBL_DEACTIVATE_MESH - #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") -#endif -#ifndef MSG_UBL_SET_BED_TEMP - #define MSG_UBL_SET_BED_TEMP _UxGT("Bed Temp") -#endif -#ifndef MSG_UBL_CUSTOM_BED_TEMP - #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#endif -#ifndef MSG_UBL_SET_HOTEND_TEMP - #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp") -#endif -#ifndef MSG_UBL_CUSTOM_HOTEND_TEMP - #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#endif -#ifndef MSG_UBL_MESH_EDIT - #define MSG_UBL_MESH_EDIT _UxGT("Mesh Edit") -#endif -#ifndef MSG_UBL_EDIT_CUSTOM_MESH - #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -#endif -#ifndef MSG_UBL_FINE_TUNE_MESH - #define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#endif -#ifndef MSG_UBL_DONE_EDITING_MESH - #define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") -#endif -#ifndef MSG_UBL_BUILD_CUSTOM_MESH - #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#endif -#ifndef MSG_UBL_BUILD_MESH_MENU - #define MSG_UBL_BUILD_MESH_MENU _UxGT("Build Mesh") -#endif -#ifndef MSG_UBL_BUILD_PLA_MESH - #define MSG_UBL_BUILD_PLA_MESH _UxGT("Build PLA Mesh") -#endif -#ifndef MSG_UBL_BUILD_ABS_MESH - #define MSG_UBL_BUILD_ABS_MESH _UxGT("Build ABS Mesh") -#endif -#ifndef MSG_UBL_BUILD_COLD_MESH - #define MSG_UBL_BUILD_COLD_MESH _UxGT("Build Cold Mesh") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_ADJUST - #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Adjust Mesh Height") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_AMOUNT - #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#endif -#ifndef MSG_UBL_VALIDATE_MESH_MENU - #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validate Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_PLA_MESH - #define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Validate PLA Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_ABS_MESH - #define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Validate ABS Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_CUSTOM_MESH - #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#endif -#ifndef MSG_UBL_CONTINUE_MESH - #define MSG_UBL_CONTINUE_MESH _UxGT("Continue Bed Mesh") -#endif -#ifndef MSG_UBL_MESH_LEVELING - #define MSG_UBL_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_UBL_3POINT_MESH_LEVELING - #define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_UBL_GRID_MESH_LEVELING - #define MSG_UBL_GRID_MESH_LEVELING _UxGT("Grid Mesh Leveling") -#endif -#ifndef MSG_UBL_MESH_LEVEL - #define MSG_UBL_MESH_LEVEL _UxGT("Level Mesh") -#endif -#ifndef MSG_UBL_SIDE_POINTS - #define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#endif -#ifndef MSG_UBL_MAP_TYPE - #define MSG_UBL_MAP_TYPE _UxGT("Map Type") -#endif -#ifndef MSG_UBL_OUTPUT_MAP - #define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_HOST - #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_CSV - #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_BACKUP - #define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -#endif -#ifndef MSG_UBL_INFO_UBL - #define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#endif -#ifndef MSG_UBL_EDIT_MESH_MENU - #define MSG_UBL_EDIT_MESH_MENU _UxGT("Edit Mesh") -#endif -#ifndef MSG_UBL_FILLIN_AMOUNT - #define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -#endif -#ifndef MSG_UBL_MANUAL_FILLIN - #define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -#endif -#ifndef MSG_UBL_SMART_FILLIN - #define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -#endif -#ifndef MSG_UBL_FILLIN_MESH - #define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -#endif -#ifndef MSG_UBL_INVALIDATE_ALL - #define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -#endif -#ifndef MSG_UBL_INVALIDATE_CLOSEST - #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -#endif -#ifndef MSG_UBL_FINE_TUNE_ALL - #define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -#endif -#ifndef MSG_UBL_FINE_TUNE_CLOSEST - #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -#endif -#ifndef MSG_UBL_STORAGE_MESH_MENU - #define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -#endif -#ifndef MSG_UBL_STORAGE_SLOT - #define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#endif -#ifndef MSG_UBL_LOAD_MESH - #define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -#endif -#ifndef MSG_UBL_SAVE_MESH - #define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -#endif -#ifndef MSG_MESH_LOADED - #define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -#endif -#ifndef MSG_MESH_SAVED - #define MSG_MESH_SAVED _UxGT("Mesh %i saved") -#endif -#ifndef MSG_NO_STORAGE - #define MSG_NO_STORAGE _UxGT("No storage") -#endif -#ifndef MSG_UBL_SAVE_ERROR - #define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -#endif -#ifndef MSG_UBL_RESTORE_ERROR - #define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -#endif -#ifndef MSG_UBL_Z_OFFSET_STOPPED - #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -#endif -#ifndef MSG_UBL_STEP_BY_STEP_MENU - #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#endif - -#ifndef MSG_LED_CONTROL - #define MSG_LED_CONTROL _UxGT("LED Control") -#endif -#ifndef MSG_LEDS - #define MSG_LEDS _UxGT("Lights") -#endif -#ifndef MSG_LED_PRESETS - #define MSG_LED_PRESETS _UxGT("Light Presets") -#endif -#ifndef MSG_SET_LEDS_RED - #define MSG_SET_LEDS_RED _UxGT("Red") -#endif -#ifndef MSG_SET_LEDS_ORANGE - #define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#endif -#ifndef MSG_SET_LEDS_YELLOW - #define MSG_SET_LEDS_YELLOW _UxGT("Yellow") -#endif -#ifndef MSG_SET_LEDS_GREEN - #define MSG_SET_LEDS_GREEN _UxGT("Green") -#endif -#ifndef MSG_SET_LEDS_BLUE - #define MSG_SET_LEDS_BLUE _UxGT("Blue") -#endif -#ifndef MSG_SET_LEDS_INDIGO - #define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#endif -#ifndef MSG_SET_LEDS_VIOLET - #define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#endif -#ifndef MSG_SET_LEDS_WHITE - #define MSG_SET_LEDS_WHITE _UxGT("White") -#endif -#ifndef MSG_SET_LEDS_DEFAULT - #define MSG_SET_LEDS_DEFAULT _UxGT("Default") -#endif -#ifndef MSG_CUSTOM_LEDS - #define MSG_CUSTOM_LEDS _UxGT("Custom Lights") -#endif -#ifndef MSG_INTENSITY_R - #define MSG_INTENSITY_R _UxGT("Red Intensity") -#endif -#ifndef MSG_INTENSITY_G - #define MSG_INTENSITY_G _UxGT("Green Intensity") -#endif -#ifndef MSG_INTENSITY_B - #define MSG_INTENSITY_B _UxGT("Blue Intensity") -#endif -#ifndef MSG_INTENSITY_W - #define MSG_INTENSITY_W _UxGT("White Intensity") -#endif -#ifndef MSG_LED_BRIGHTNESS - #define MSG_LED_BRIGHTNESS _UxGT("Brightness") -#endif - -#ifndef MSG_MOVING - #define MSG_MOVING _UxGT("Moving...") -#endif -#ifndef MSG_FREE_XY - #define MSG_FREE_XY _UxGT("Free XY") -#endif -#ifndef MSG_MOVE_X - #define MSG_MOVE_X _UxGT("Move X") -#endif -#ifndef MSG_MOVE_Y - #define MSG_MOVE_Y _UxGT("Move Y") -#endif -#ifndef MSG_MOVE_Z - #define MSG_MOVE_Z _UxGT("Move Z") -#endif -#ifndef MSG_MOVE_E - #define MSG_MOVE_E _UxGT("Extruder") -#endif -#ifndef MSG_MOVE_01MM - #define MSG_MOVE_01MM _UxGT("Move 0.1mm") -#endif -#ifndef MSG_MOVE_1MM - #define MSG_MOVE_1MM _UxGT("Move 1mm") -#endif -#ifndef MSG_MOVE_10MM - #define MSG_MOVE_10MM _UxGT("Move 10mm") -#endif -#ifndef MSG_SPEED - #define MSG_SPEED _UxGT("Speed") -#endif -#ifndef MSG_BED_Z - #define MSG_BED_Z _UxGT("Bed Z") -#endif -#ifndef MSG_NOZZLE - #define MSG_NOZZLE _UxGT("Nozzle") -#endif -#ifndef MSG_BED - #define MSG_BED _UxGT("Bed") -#endif -#ifndef MSG_FAN_SPEED - #define MSG_FAN_SPEED _UxGT("Fan speed") -#endif -#ifndef MSG_EXTRA_FAN_SPEED - #define MSG_EXTRA_FAN_SPEED _UxGT("Extra fan speed") -#endif -#ifndef MSG_FLOW - #define MSG_FLOW _UxGT("Flow") -#endif -#ifndef MSG_CONTROL - #define MSG_CONTROL _UxGT("Control") -#endif -#ifndef MSG_MIN - #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#endif -#ifndef MSG_MAX - #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#endif -#ifndef MSG_FACTOR - #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#endif -#ifndef MSG_AUTOTEMP - #define MSG_AUTOTEMP _UxGT("Autotemp") -#endif -#ifndef MSG_ON - #define MSG_ON _UxGT("On ") -#endif -#ifndef MSG_OFF - #define MSG_OFF _UxGT("Off") -#endif -#ifndef MSG_PID_P - #define MSG_PID_P _UxGT("PID-P") -#endif -#ifndef MSG_PID_I - #define MSG_PID_I _UxGT("PID-I") -#endif -#ifndef MSG_PID_D - #define MSG_PID_D _UxGT("PID-D") -#endif -#ifndef MSG_PID_C - #define MSG_PID_C _UxGT("PID-C") -#endif -#ifndef MSG_SELECT - #define MSG_SELECT _UxGT("Select") -#endif -#ifndef MSG_ACC - #define MSG_ACC _UxGT("Accel") -#endif -#ifndef MSG_JERK - #define MSG_JERK _UxGT("Jerk") -#endif -#if IS_KINEMATIC - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Va-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vb-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vc-jerk") - #endif -#else - #ifndef MSG_VA_JERK - #define MSG_VA_JERK _UxGT("Vx-jerk") - #endif - #ifndef MSG_VB_JERK - #define MSG_VB_JERK _UxGT("Vy-jerk") - #endif - #ifndef MSG_VC_JERK - #define MSG_VC_JERK _UxGT("Vz-jerk") - #endif -#endif -#ifndef MSG_VE_JERK - #define MSG_VE_JERK _UxGT("Ve-jerk") -#endif -#ifndef MSG_JUNCTION_DEVIATION - #define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#endif -#ifndef MSG_VELOCITY - #define MSG_VELOCITY _UxGT("Velocity") -#endif -#ifndef MSG_VMAX - #define MSG_VMAX _UxGT("Vmax ") -#endif -#ifndef MSG_VMIN - #define MSG_VMIN _UxGT("Vmin") -#endif -#ifndef MSG_VTRAV_MIN - #define MSG_VTRAV_MIN _UxGT("VTrav min") -#endif -#ifndef MSG_ACCELERATION - #define MSG_ACCELERATION _UxGT("Acceleration") -#endif -#ifndef MSG_AMAX - #define MSG_AMAX _UxGT("Amax ") -#endif -#ifndef MSG_A_RETRACT - #define MSG_A_RETRACT _UxGT("A-retract") -#endif -#ifndef MSG_A_TRAVEL - #define MSG_A_TRAVEL _UxGT("A-travel") -#endif -#ifndef MSG_STEPS_PER_MM - #define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#endif -#if IS_KINEMATIC - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Asteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Csteps/mm") - #endif -#else - #ifndef MSG_ASTEPS - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #endif - #ifndef MSG_BSTEPS - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #endif - #ifndef MSG_CSTEPS - #define MSG_CSTEPS _UxGT("Zsteps/mm") - #endif -#endif -#ifndef MSG_ESTEPS - #define MSG_ESTEPS _UxGT("Esteps/mm") -#endif -#ifndef MSG_E1STEPS - #define MSG_E1STEPS _UxGT("E1steps/mm") -#endif -#ifndef MSG_E2STEPS - #define MSG_E2STEPS _UxGT("E2steps/mm") -#endif -#ifndef MSG_E3STEPS - #define MSG_E3STEPS _UxGT("E3steps/mm") -#endif -#ifndef MSG_E4STEPS - #define MSG_E4STEPS _UxGT("E4steps/mm") -#endif -#ifndef MSG_E5STEPS - #define MSG_E5STEPS _UxGT("E5steps/mm") -#endif -#ifndef MSG_TEMPERATURE - #define MSG_TEMPERATURE _UxGT("Temperature") -#endif -#ifndef MSG_MOTION - #define MSG_MOTION _UxGT("Motion") -#endif -#ifndef MSG_FILAMENT - #define MSG_FILAMENT _UxGT("Filament") -#endif -#ifndef MSG_VOLUMETRIC_ENABLED - #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#endif -#ifndef MSG_FILAMENT_DIAM - #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#endif -#ifndef MSG_FILAMENT_UNLOAD - #define MSG_FILAMENT_UNLOAD _UxGT("Unload mm") -#endif -#ifndef MSG_FILAMENT_LOAD - #define MSG_FILAMENT_LOAD _UxGT("Load mm") -#endif -#ifndef MSG_ADVANCE_K - #define MSG_ADVANCE_K _UxGT("Advance K") -#endif -#ifndef MSG_CONTRAST - #define MSG_CONTRAST _UxGT("LCD contrast") -#endif -#ifndef MSG_STORE_EEPROM - #define MSG_STORE_EEPROM _UxGT("Store settings") -#endif -#ifndef MSG_LOAD_EEPROM - #define MSG_LOAD_EEPROM _UxGT("Load settings") -#endif -#ifndef MSG_RESTORE_FAILSAFE - #define MSG_RESTORE_FAILSAFE _UxGT("Restore failsafe") -#endif -#ifndef MSG_INIT_EEPROM - #define MSG_INIT_EEPROM _UxGT("Initialize EEPROM") -#endif -#ifndef MSG_REFRESH - #define MSG_REFRESH _UxGT("Refresh") -#endif -#ifndef MSG_WATCH - #define MSG_WATCH _UxGT("Info screen") -#endif -#ifndef MSG_PREPARE - #define MSG_PREPARE _UxGT("Prepare") -#endif -#ifndef MSG_TUNE - #define MSG_TUNE _UxGT("Tune") -#endif -#ifndef MSG_PAUSE_PRINT - #define MSG_PAUSE_PRINT _UxGT("Pause print") -#endif -#ifndef MSG_RESUME_PRINT - #define MSG_RESUME_PRINT _UxGT("Resume print") -#endif -#ifndef MSG_STOP_PRINT - #define MSG_STOP_PRINT _UxGT("Stop print") -#endif -#ifndef MSG_POWER_LOSS_RECOVERY - #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") -#endif -#ifndef MSG_CARD_MENU - #define MSG_CARD_MENU _UxGT("Print from SD") -#endif -#ifndef MSG_NO_CARD - #define MSG_NO_CARD _UxGT("No SD card") -#endif -#ifndef MSG_DWELL - #define MSG_DWELL _UxGT("Sleep...") -#endif -#ifndef MSG_USERWAIT - #define MSG_USERWAIT _UxGT("Click to resume...") -#endif -#ifndef MSG_PRINT_PAUSED - #define MSG_PRINT_PAUSED _UxGT("Print paused") -#endif -#ifndef MSG_PRINTING - #define MSG_PRINTING _UxGT("Printing...") -#endif -#ifndef MSG_PRINT_ABORTED - #define MSG_PRINT_ABORTED _UxGT("Print aborted") -#endif -#ifndef MSG_NO_MOVE - #define MSG_NO_MOVE _UxGT("No move.") -#endif -#ifndef MSG_KILLED - #define MSG_KILLED _UxGT("KILLED. ") -#endif -#ifndef MSG_STOPPED - #define MSG_STOPPED _UxGT("STOPPED. ") -#endif -#ifndef MSG_CONTROL_RETRACT - #define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#endif -#ifndef MSG_CONTROL_RETRACT_SWAP - #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#endif -#ifndef MSG_CONTROL_RETRACTF - #define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#endif -#ifndef MSG_CONTROL_RETRACT_ZLIFT - #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER - #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAP - #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVERF - #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAPF - #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#endif -#ifndef MSG_AUTORETRACT - #define MSG_AUTORETRACT _UxGT("AutoRetr.") -#endif -#ifndef MSG_FILAMENTCHANGE - #define MSG_FILAMENTCHANGE _UxGT("Change filament") -#endif -#ifndef MSG_FILAMENTLOAD - #define MSG_FILAMENTLOAD _UxGT("Load filament") -#endif -#ifndef MSG_FILAMENTUNLOAD - #define MSG_FILAMENTUNLOAD _UxGT("Unload filament") -#endif -#ifndef MSG_FILAMENTUNLOAD_ALL - #define MSG_FILAMENTUNLOAD_ALL _UxGT("Unload All") -#endif -#ifndef MSG_INIT_SDCARD - #define MSG_INIT_SDCARD _UxGT("Init. SD card") -#endif -#ifndef MSG_CNG_SDCARD - #define MSG_CNG_SDCARD _UxGT("Change SD card") -#endif -#ifndef MSG_ZPROBE_OUT - #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") -#endif -#ifndef MSG_SKEW_FACTOR - #define MSG_SKEW_FACTOR _UxGT("Skew Factor") -#endif -#ifndef MSG_BLTOUCH - #define MSG_BLTOUCH _UxGT("BLTouch") -#endif -#ifndef MSG_BLTOUCH_SELFTEST - #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#endif -#ifndef MSG_BLTOUCH_RESET - #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#endif -#ifndef MSG_BLTOUCH_DEPLOY - #define MSG_BLTOUCH_DEPLOY _UxGT("Deploy BLTouch") -#endif -#ifndef MSG_BLTOUCH_STOW - #define MSG_BLTOUCH_STOW _UxGT("Stow BLTouch") -#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") -#endif -#ifndef MSG_ZPROBE_ZOFFSET - #define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") -#endif -#ifndef MSG_BABYSTEP_X - #define MSG_BABYSTEP_X _UxGT("Babystep X") -#endif -#ifndef MSG_BABYSTEP_Y - #define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#endif -#ifndef MSG_BABYSTEP_Z - #define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#endif -#ifndef MSG_ENDSTOP_ABORT - #define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#endif -#ifndef MSG_HEATING_FAILED_LCD - #define MSG_HEATING_FAILED_LCD _UxGT("Heating failed") -#endif -#ifndef MSG_HEATING_FAILED_LCD_BED - #define MSG_HEATING_FAILED_LCD_BED _UxGT("Bed heating failed") -#endif -#ifndef MSG_ERR_REDUNDANT_TEMP - #define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#endif -#ifndef MSG_THERMAL_RUNAWAY - #define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#endif -#ifndef MSG_THERMAL_RUNAWAY_BED - #define MSG_THERMAL_RUNAWAY_BED _UxGT("BED THERMAL RUNAWAY") -#endif -#ifndef MSG_ERR_MAXTEMP - #define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#endif -#ifndef MSG_ERR_MINTEMP - #define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") -#endif -#ifndef MSG_ERR_MAXTEMP_BED - #define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") -#endif -#ifndef MSG_ERR_MINTEMP_BED - #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#endif -#ifndef MSG_ERR_Z_HOMING - #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#endif -#ifndef MSG_HALTED - #define MSG_HALTED _UxGT("PRINTER HALTED") -#endif -#ifndef MSG_PLEASE_RESET - #define MSG_PLEASE_RESET _UxGT("Please reset") -#endif -#ifndef MSG_SHORT_DAY - #define MSG_SHORT_DAY _UxGT("d") // One character only -#endif -#ifndef MSG_SHORT_HOUR - #define MSG_SHORT_HOUR _UxGT("h") // One character only -#endif -#ifndef MSG_SHORT_MINUTE - #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#endif -#ifndef MSG_HEATING - #define MSG_HEATING _UxGT("Heating...") -#endif -#ifndef MSG_COOLING - #define MSG_COOLING _UxGT("Cooling...") -#endif -#ifndef MSG_BED_HEATING - #define MSG_BED_HEATING _UxGT("Bed heating...") -#endif -#ifndef MSG_BED_COOLING - #define MSG_BED_COOLING _UxGT("Bed cooling...") -#endif -#ifndef MSG_DELTA_CALIBRATE - #define MSG_DELTA_CALIBRATE _UxGT("Delta Calibration") -#endif -#ifndef MSG_DELTA_CALIBRATE_X - #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrate X") -#endif -#ifndef MSG_DELTA_CALIBRATE_Y - #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrate Y") -#endif -#ifndef MSG_DELTA_CALIBRATE_Z - #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrate Z") -#endif -#ifndef MSG_DELTA_CALIBRATE_CENTER - #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center") -#endif -#ifndef MSG_DELTA_SETTINGS - #define MSG_DELTA_SETTINGS _UxGT("Delta Settings") -#endif -#ifndef MSG_DELTA_AUTO_CALIBRATE - #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibration") -#endif -#ifndef MSG_DELTA_HEIGHT_CALIBRATE - #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Set Delta Height") -#endif -#ifndef MSG_DELTA_Z_OFFSET_CALIBRATE - #define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Probe Z-offset") -#endif -#ifndef MSG_DELTA_DIAG_ROD - #define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#endif -#ifndef MSG_DELTA_HEIGHT - #define MSG_DELTA_HEIGHT _UxGT("Height") -#endif -#ifndef MSG_DELTA_RADIUS - #define MSG_DELTA_RADIUS _UxGT("Radius") -#endif -#ifndef MSG_INFO_MENU - #define MSG_INFO_MENU _UxGT("About Printer") -#endif -#ifndef MSG_INFO_PRINTER_MENU - #define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#endif -#ifndef MSG_3POINT_LEVELING - #define MSG_3POINT_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_LINEAR_LEVELING - #define MSG_LINEAR_LEVELING _UxGT("Linear Leveling") -#endif -#ifndef MSG_BILINEAR_LEVELING - #define MSG_BILINEAR_LEVELING _UxGT("Bilinear Leveling") -#endif -#ifndef MSG_UBL_LEVELING - #define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_MESH_LEVELING - #define MSG_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_INFO_STATS_MENU - #define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#endif -#ifndef MSG_INFO_BOARD_MENU - #define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#endif -#ifndef MSG_INFO_THERMISTOR_MENU - #define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#endif -#ifndef MSG_INFO_EXTRUDERS - #define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#endif -#ifndef MSG_INFO_BAUDRATE - #define MSG_INFO_BAUDRATE _UxGT("Baud") -#endif -#ifndef MSG_INFO_PROTOCOL - #define MSG_INFO_PROTOCOL _UxGT("Protocol") -#endif -#ifndef MSG_CASE_LIGHT - #define MSG_CASE_LIGHT _UxGT("Case light") -#endif -#ifndef MSG_CASE_LIGHT_BRIGHTNESS - #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Light BRIGHTNESS") -#endif -#if LCD_WIDTH >= 20 - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Print Count") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total print time") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest job time") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded total") - #endif -#else - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded") - #endif -#endif -#ifndef MSG_INFO_MIN_TEMP - #define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#endif -#ifndef MSG_INFO_MAX_TEMP - #define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#endif -#ifndef MSG_INFO_PSU - #define MSG_INFO_PSU _UxGT("PSU") -#endif -#ifndef MSG_DRIVE_STRENGTH - #define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") -#endif -#ifndef MSG_DAC_PERCENT - #define MSG_DAC_PERCENT _UxGT("Driver %") -#endif -#ifndef MSG_DAC_EEPROM_WRITE - #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_PAUSE - #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PRINT PAUSED") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_LOAD - #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("LOAD FILAMENT") -#endif -#ifndef MSG_FILAMENT_CHANGE_HEADER_UNLOAD - #define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("UNLOAD FILAMENT") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER - #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("RESUME OPTIONS:") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_PURGE - #define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME - #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continue") -#endif -#ifndef MSG_FILAMENT_CHANGE_NOZZLE - #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") -#endif -#ifndef MSG_ERR_HOMING_FAILED - #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") -#endif -#ifndef MSG_ERR_PROBING_FAILED - #define MSG_ERR_PROBING_FAILED _UxGT("Probing failed") -#endif -#ifndef MSG_M600_TOO_COLD - #define MSG_M600_TOO_COLD _UxGT("M600: Too cold") -#endif - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") - #endif - #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") - #endif - #ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEAT_1 - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEATING_1 - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") - #endif - #ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") - #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") - #endif -#else // LCD_HEIGHT < 4 - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...") - #endif - #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") - #endif - #ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEATING_1 - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...") - #endif - #ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") - #endif - #ifndef MSG_FILAMENT_CHANGE_PURGE_1 - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") - #endif -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_EN_H diff --git a/Marlin_thinkerV2/Marlin/language_es.h b/Marlin_thinkerV2/Marlin/language_es.h deleted file mode 100644 index a4267af2b3..0000000000 --- a/Marlin_thinkerV2/Marlin/language_es.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Spanish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ES_H -#define LANGUAGE_ES_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_BACK _UxGT("Atras") -#define MSG_SD_INSERTED _UxGT("Tarjeta colocada") -#define MSG_SD_REMOVED _UxGT("Tarjeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Inicio automatico") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_DEBUG_MENU _UxGT("Menu depurar") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prueba barra avance") -#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_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelacion lista!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") -#define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#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_BEDONLY MSG_PREHEAT_1 _UxGT("Plataforma") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#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_BEDONLY MSG_PREHEAT_2 _UxGT("Plataforma") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("Config") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover ejes") -#define MSG_BED_LEVELING _UxGT("Nivelar plataforma") -#define MSG_LEVEL_BED _UxGT("Nivelar plataforma") -#define MSG_MOVING _UxGT("Moviendo...") -#define MSG_FREE_XY _UxGT("Libre XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidad") -#define MSG_BED_Z _UxGT("Plataforma Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Plataforma") -#define MSG_FAN_SPEED _UxGT("Ventilador") -#define MSG_FLOW _UxGT("Flujo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("Encender") -#define MSG_OFF _UxGT("Apagar") -#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("Seleccionar") -#define MSG_ACC _UxGT("Aceleracion") -#define MSG_JERK _UxGT("Jerk") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#elif IS_DELTA - #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("Vel. viaje min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("A pasos/deg") - #define MSG_BSTEPS _UxGT("B pasos/deg") - #define MSG_CSTEPS _UxGT("C pasos/mm") -#elif IS_DELTA - #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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#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("Informacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresion") -#define MSG_RESUME_PRINT _UxGT("Reanudar impresion") -#define MSG_STOP_PRINT _UxGT("Detener impresion") -#define MSG_CARD_MENU _UxGT("Menu de SD") -#define MSG_NO_CARD _UxGT("No hay tarjeta SD") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando ordenes") -#define MSG_PRINT_ABORTED _UxGT("Impresion cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Parada de emergencia") -#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") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") -#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_AUTORETRACT _UxGT("Retraccion Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CNG_SDCARD _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("inic.") -#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_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 Maxima") -#define MSG_ERR_MINTEMP _UxGT("Error: Temp Minima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max Plat") -#define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min Plat") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPRESORA PARADA") -#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_BED_HEATING _UxGT("Calentando Plat...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_AUTO_CALIBRATE _UxGT("Auto Calibracion") -#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_INFO_STATS_MENU _UxGT("Estadisticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. 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") - -#if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresion") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total de imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresion mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusion") -#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("Mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusion") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura minima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura maxima") -#define MSG_INFO_PSU _UxGT("Fuente de poder") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia driver") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSADA") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPC. REINICIO:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") - -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Boquilla: ") - -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el boton") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambiar") - #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("del fil. cambiar") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamento expulsado") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Cargar 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 boton 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") - -#endif // LANGUAGE_ES_H diff --git a/Marlin_thinkerV2/Marlin/language_es_utf8.h b/Marlin_thinkerV2/Marlin/language_es_utf8.h deleted file mode 100644 index a0c87452d9..0000000000 --- a/Marlin_thinkerV2/Marlin/language_es_utf8.h +++ /dev/null @@ -1,275 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Spanish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ES_UTF_H -#define LANGUAGE_ES_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_BACK _UxGT("Atrás") -#define MSG_SD_INSERTED _UxGT("Tarjeta colocada") -#define MSG_SD_REMOVED _UxGT("Tarjeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menú principal") -#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_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_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelación lista!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") -#define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") -#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_BEDONLY MSG_PREHEAT_1 _UxGT(" Cama") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") -#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_BEDONLY MSG_PREHEAT_2 _UxGT(" Cama") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Config") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#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_MOVING _UxGT("Moviendo...") -#define MSG_FREE_XY _UxGT("Libre XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidad") -#define MSG_BED_Z _UxGT("Cama Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Ventilador") -#define MSG_FLOW _UxGT("Flujo") -#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("Temperatura Auto.") -#define MSG_ON _UxGT("Encender") -#define MSG_OFF _UxGT("Apagar") -#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("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") -#define MSG_VMAX _UxGT("Vmax") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vel. viaje min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("A pasos/mm") - #define MSG_BSTEPS _UxGT("B pasos/mm") - #define MSG_CSTEPS _UxGT("Z pasos/mm") -#elif IS_DELTA - #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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#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_FILAMENT_DIAM _UxGT("Fil. Dia.") -#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_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#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_CARD_MENU _UxGT("Menú de SD") -#define MSG_NO_CARD _UxGT("No hay tarjeta SD") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando órdenes") -#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_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Interc. Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") -#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_AUTORETRACT _UxGT("Retracción Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CNG_SDCARD _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_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_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_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_BED_HEATING _UxGT("Calentando Cama...") -#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_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_INFO_STATS_MENU _UxGT("Estadísticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. 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") - -#if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo 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") -#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") -#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_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("IMPR. PAUSADA") -#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_NOZZLE _UxGT(" Boquilla: ") - -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando iniciar") - -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el botón") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambiar") - #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("del fil. cambiar") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte filamento") -#endif // LCD_HEIGHT < 4 - -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamento expulsado") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Cargar filamento") -#define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperado por") -#define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("Extruir 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") - -#endif // LANGUAGE_ES_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_eu.h b/Marlin_thinkerV2/Marlin/language_eu.h deleted file mode 100644 index 999855ef37..0000000000 --- a/Marlin_thinkerV2/Marlin/language_eu.h +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Basque-Euskera - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_EU_H -#define LANGUAGE_EU_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prest.") -#define MSG_BACK _UxGT("Atzera") -#define MSG_SD_INSERTED _UxGT("Txartela sartuta") -#define MSG_SD_REMOVED _UxGT("Txartela kenduta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu nagusia") -#define MSG_AUTOSTART _UxGT("Auto hasiera") -#define MSG_DISABLE_STEPPERS _UxGT("Itzali motoreak") -#define MSG_DEBUG_MENU _UxGT("Arazketa Menua") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prog. Barra Proba") -#define MSG_AUTO_HOME _UxGT("Hasierara joan") -#define MSG_AUTO_HOME_X _UxGT("X jatorrira") -#define MSG_AUTO_HOME_Y _UxGT("Y jatorrira") -#define MSG_AUTO_HOME_Z _UxGT("Z jatorrira") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibratu Z") -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ hasieraratzen") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik egin hasteko") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Hurrengo Puntua") -#define MSG_LEVEL_BED_DONE _UxGT("Berdintzea eginda") -//#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#define MSG_SET_HOME_OFFSETS _UxGT("Etxe. offset eza.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsetak ezarrita") -#define MSG_SET_ORIGIN _UxGT("Hasiera ipini") -#define MSG_PREHEAT_1 _UxGT("Berotu PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Guztia") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Amaia") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") -#define MSG_PREHEAT_2 _UxGT("Berotu ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_1 _UxGT(" Guztia") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Amaia") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") -#define MSG_COOLDOWN _UxGT("Hoztu") -#define MSG_SWITCH_PS_ON _UxGT("Energia piztu") -#define MSG_SWITCH_PS_OFF _UxGT("Energia itzali") -#define MSG_EXTRUDE _UxGT("Estruitu") -#define MSG_RETRACT _UxGT("Atzera eragin") -#define MSG_MOVE_AXIS _UxGT("Ardatzak mugitu") -#define MSG_BED_LEVELING _UxGT("Ohe berdinketa") -#define MSG_LEVEL_BED _UxGT("Ohea berdindu") -#define MSG_LEVEL_CORNERS _UxGT("Ertzak berdindu") -#define MSG_NEXT_CORNER _UxGT("Hurrengo ertza") -//#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -//#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") -//#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#define MSG_UBL_BC_INSERT2 _UxGT("Neurtu") -//#define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -//#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktibatu") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL desaktibatu") -#define MSG_UBL_SET_BED_TEMP _UxGT("Ohearen tenperatura") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Mutur beroaren tenp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Sarea editatu") -//#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -//#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Sarea editatzea eginda") -//#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Sarea sortu") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("PLA sarea sortu") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("ABS sarea sortu") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Sare hotza sortu") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Sarearen altuera doitu") -//#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Sarea balioetsi") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("PLA sarea balioetsi") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("ABS sarea balioetsi") -//#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#define MSG_UBL_CONTINUE_MESH _UxGT("Ohe sarea balioetsi") -#define MSG_UBL_MESH_LEVELING _UxGT("Sare berdinketa") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Lauki-sare berdinketa") -#define MSG_UBL_MESH_LEVEL _UxGT("Sarea berdindu") -//#define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#define MSG_UBL_MAP_TYPE _UxGT("Mapa mota") -//#define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -//#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -//#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -//#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -//#define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Sarea editatu") -//#define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -//#define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -//#define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -//#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -//#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -//#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -//#define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -//#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -//#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -//#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -//#define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -//#define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -//#define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -//#define MSG_MESH_SAVED _UxGT("Mesh %i saved") -//#define MSG_NO_STORAGE _UxGT("No storage") -//#define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -//#define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -//#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -//#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#define MSG_LED_CONTROL _UxGT("LED ezarpenak") -#define MSG_LEDS _UxGT("Argiak") -#define MSG_LED_PRESETS _UxGT("Argi aurrehautaketak") -#define MSG_SET_LEDS_RED _UxGT("Gorria") -#define MSG_SET_LEDS_ORANGE _UxGT("Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Horia") -#define MSG_SET_LEDS_GREEN _UxGT("Berdea") -#define MSG_SET_LEDS_BLUE _UxGT("Urdina") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Bioleta") -#define MSG_SET_LEDS_WHITE _UxGT("Zuria") -#define MSG_SET_LEDS_DEFAULT _UxGT("Lehenetsia") -#define MSG_CUSTOM_LEDS _UxGT("Argi pertsonalizatuak") -#define MSG_INTENSITY_R _UxGT("Intentsitate gorria") -#define MSG_INTENSITY_G _UxGT("Intentsitate berdea") -#define MSG_INTENSITY_B _UxGT("Intentsitate urdina") -#define MSG_INTENSITY_W _UxGT("Intentsitate zuria") -#define MSG_LED_BRIGHTNESS _UxGT("Distira") -#define MSG_MOVING _UxGT("Mugitzen...") -#define MSG_FREE_XY _UxGT("Askatu XY") -#define MSG_MOVE_X _UxGT("Mugitu X") -#define MSG_MOVE_Y _UxGT("Mugitu Y") -#define MSG_MOVE_Z _UxGT("Mugitu Z") -#define MSG_MOVE_E _UxGT("Estrusorea") -#define MSG_MOVE_01MM _UxGT("Mugitu 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mugitu 1mm") -#define MSG_MOVE_10MM _UxGT("Mugitu 10mm") -#define MSG_SPEED _UxGT("Abiadura") -#define MSG_BED_Z _UxGT("Z Ohea") -#define MSG_NOZZLE _UxGT("Pita") -#define MSG_BED _UxGT("Ohea") -#define MSG_FAN_SPEED _UxGT("Haizagailu abiadura") -#define MSG_EXTRA_FAN_SPEED _UxGT("Haiz.gehig. abiadura") -#define MSG_FLOW _UxGT("Fluxua") -#define MSG_CONTROL _UxGT("Kontrola") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Auto tenperatura") -#define MSG_ON _UxGT("On ") -#define MSG_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("Aukeratu") -#define MSG_ACC _UxGT("Azelerazioa") -#define MSG_JERK _UxGT("Astindua") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-astindua") - #define MSG_VB_JERK _UxGT("Vb-astindua") - #define MSG_VC_JERK _UxGT("Vc-astindua") -#else - #define MSG_VA_JERK _UxGT("Vx-astindua") - #define MSG_VB_JERK _UxGT("Vy-astindua") - #define MSG_VC_JERK _UxGT("Vz-astindua") -#endif -#define MSG_VE_JERK _UxGT("Ve-astindua") -//#define MSG_VELOCITY _UxGT("Velocity") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VBidaia min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-bidaia") -#define MSG_STEPS_PER_MM _UxGT("Pausoak/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pausoak/mm") - #define MSG_BSTEPS _UxGT("B pausoak/mm") - #define MSG_CSTEPS _UxGT("C pausoak/mm") -#else - #define MSG_ASTEPS _UxGT("X pausoak/mm") - #define MSG_BSTEPS _UxGT("Y pausoak/mm") - #define MSG_CSTEPS _UxGT("Z pausoak/mm") -#endif -#define MSG_ESTEPS _UxGT("E pausoak/mm") -#define MSG_E1STEPS _UxGT("E1 pausoak/mm") -#define MSG_E2STEPS _UxGT("E2 pausoak/mm") -#define MSG_E3STEPS _UxGT("E3 pausoak/mm") -#define MSG_E4STEPS _UxGT("E4 pausoak/mm") -#define MSG_E5STEPS _UxGT("E5 pausoak/mm") -#define MSG_TEMPERATURE _UxGT("Tenperatura") -#define MSG_MOTION _UxGT("Mugimendua") -#define MSG_FILAMENT _UxGT("Harizpia") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E mm3-tan") -#define MSG_FILAMENT_DIAM _UxGT("Hariz. Dia.") -#define MSG_FILAMENT_UNLOAD _UxGT("Deskargatu mm") -#define MSG_FILAMENT_LOAD _UxGT("Kargatu mm") -#define MSG_ADVANCE_K _UxGT("K Aurrerapena") -#define MSG_CONTRAST _UxGT("LCD kontrastea") -#define MSG_STORE_EEPROM _UxGT("Gorde memoria") -#define MSG_LOAD_EEPROM _UxGT("Kargatu memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Larri. berriz.") -#define MSG_INIT_EEPROM _UxGT("EEPROM-a hasieratu") -#define MSG_REFRESH _UxGT("Berriz kargatu") -#define MSG_WATCH _UxGT("Pantaila info") -#define MSG_PREPARE _UxGT("Prestatu") -#define MSG_TUNE _UxGT("Doitu") -#define MSG_PAUSE_PRINT _UxGT("Pausatu inprimak.") -#define MSG_RESUME_PRINT _UxGT("Jarraitu inprima.") -#define MSG_STOP_PRINT _UxGT("Gelditu inprima.") -#define MSG_CARD_MENU _UxGT("SD-tik inprimatu") -#define MSG_NO_CARD _UxGT("Ez dago SD-rik") -#define MSG_DWELL _UxGT("Lo egin...") -#define MSG_USERWAIT _UxGT("Aginduak zain...") -#define MSG_PRINT_PAUSED _UxGT("Inprim. geldi.") -#define MSG_PRINT_ABORTED _UxGT("Inprim. deusezta.") -#define MSG_NO_MOVE _UxGT("Mugimendu gabe.") -#define MSG_KILLED _UxGT("AKABATUTA. ") -#define MSG_STOPPED _UxGT("GELDITUTA. ") -#define MSG_CONTROL_RETRACT _UxGT("Atzera egin mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Atzera mm") -#define MSG_CONTROL_RETRACTF _UxGT("Atzera egin V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Igo mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Atzera egin mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap Atzera mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Atzera egin V") -//#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("Atzera egin") -#define MSG_FILAMENTCHANGE _UxGT("Aldatu harizpia") -#define MSG_FILAMENTLOAD _UxGT("Harizpia kargatu") -#define MSG_FILAMENTUNLOAD _UxGT("Harizpia deskargatu") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Erabat deskargatu") -#define MSG_INIT_SDCARD _UxGT("Hasieratu SD-a") -#define MSG_CNG_SDCARD _UxGT("Aldatu txartela") -#define MSG_ZPROBE_OUT _UxGT("Z zunda kanpora") -#define MSG_SKEW_FACTOR _UxGT("Okertze faktorea") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch AutoProba") -#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_ZPROBE_ZOFFSET _UxGT("Z Konpentsatu") -#define MSG_BABYSTEP_X _UxGT("Mikro-urratsa X") -#define MSG_BABYSTEP_Y _UxGT("Mikro-urratsa Y") -#define MSG_BABYSTEP_Z _UxGT("Mikro-urratsa Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop deusezta.") -#define MSG_HEATING_FAILED_LCD _UxGT("Err: Beroketa") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: Tenperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("TENP. KONTROL EZA") -#define MSG_ERR_MAXTEMP _UxGT("Err: Tenp Maximoa") -#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_HALTED _UxGT("INPRIMA. GELDIRIK") -#define MSG_PLEASE_RESET _UxGT("Berrabia. Mesedez") -#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("Berotzen...") -#define MSG_BED_HEATING _UxGT("Ohea Berotzen...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibraketa") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibratu X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibratu Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibratu Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibratu Zentrua") -#define MSG_DELTA_SETTINGS _UxGT("Delta ezarpenak") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Kalibraketa") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Alt. Ezar.") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra diagonala") -#define MSG_DELTA_HEIGHT _UxGT("Altuera") -#define MSG_DELTA_RADIUS _UxGT("Erradioa") -#define MSG_INFO_MENU _UxGT("Inprimagailu Inf.") -#define MSG_INFO_PRINTER_MENU _UxGT("Inprimagailu Inf.") -#define MSG_3POINT_LEVELING _UxGT("3 puntuko berdinketa") -#define MSG_LINEAR_LEVELING _UxGT("Berdinketa lineala") -#define MSG_BILINEAR_LEVELING _UxGT("Berdinketa bilinearra") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Sare berdinketa") -#define MSG_INFO_STATS_MENU _UxGT("Inprima. estatis.") -#define MSG_INFO_BOARD_MENU _UxGT("Txartelaren Info.") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistoreak") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusoreak") -#define MSG_INFO_BAUDRATE _UxGT("Baudioak") -#define MSG_INFO_PROTOCOL _UxGT("Protokoloa") -#define MSG_CASE_LIGHT _UxGT("Kabina Argia") -//#define MSG_CASE_LIGHT_BRIGHTNESS -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Inprim. Zenbaketa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Inprim. denbora") - #define MSG_INFO_PRINT_LONGEST _UxGT("Imprimatze luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruituta guztira") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Inprimatze") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Guztira") - #define MSG_INFO_PRINT_LONGEST _UxGT("Luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estrusio") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Tenp. Minimoa") -#define MSG_INFO_MAX_TEMP _UxGT("Tenp. Maximoa") -#define MSG_INFO_PSU _UxGT("Elikadura-iturria") -#define MSG_DRIVE_STRENGTH _UxGT("Driver-aren potentzia") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Idatzi DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("HARIZPIA ALDATU") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("HARIZPIA KARGATU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("HARIZPIA DESKARGATU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ALDAKETA AUKERAK:") -//#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Inprima. jarraitu") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Pita: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Hasi. huts egin du") -#define MSG_ERR_PROBING_FAILED _UxGT("Neurketak huts egin du") -#define MSG_M600_TOO_COLD _UxGT("M600: hotzegi") -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 -// #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for start") -// #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("of the filament") -// #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("change") -// #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") -// #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert filament") -// #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button") -// #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...") -// #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to") -// #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.") -// #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle") -// #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") -// #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Wait for") -// #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("filament purge") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") -// #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Mesedez, itxaron...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Deskargatzen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Sartu eta click egin") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Berotzen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Kargatzen...") -// #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purging...") -// #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_EU_H diff --git a/Marlin_thinkerV2/Marlin/language_fi.h b/Marlin_thinkerV2/Marlin/language_fi.h deleted file mode 100644 index 4e26bdb2b3..0000000000 --- a/Marlin_thinkerV2/Marlin/language_fi.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Finnish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FI_H -#define LANGUAGE_FI_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" valmis.") -#define MSG_SD_INSERTED _UxGT("Kortti asetettu") -#define MSG_SD_REMOVED _UxGT("Kortti poistettu") -#define MSG_MAIN _UxGT("Palaa") -#define MSG_AUTOSTART _UxGT("Automaatti") -#define MSG_DISABLE_STEPPERS _UxGT("Vapauta moottorit") -#define MSG_AUTO_HOME _UxGT("Aja referenssiin") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibroi Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") -#define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") -#define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#define MSG_SET_ORIGIN _UxGT("Aseta origo") -#define MSG_PREHEAT_1 _UxGT("Esilämmitä PLA") -#define MSG_PREHEAT_1_N _UxGT("Esilämmitä PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Esilä. PLA Kaikki") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Esilä. PLA Alusta") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Esilämm. PLA konf") -#define MSG_PREHEAT_2 _UxGT("Esilämmitä ABS") -#define MSG_PREHEAT_2_N _UxGT("Esilämmitä ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Esilä. ABS Kaikki") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Esilä. ABS Alusta") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Esilämm. ABS konf") -#define MSG_COOLDOWN _UxGT("Jäähdytä") -#define MSG_SWITCH_PS_ON _UxGT("Virta päälle") -#define MSG_SWITCH_PS_OFF _UxGT("Virta pois") -#define MSG_EXTRUDE _UxGT("Pursota") -#define MSG_RETRACT _UxGT("Vedä takaisin") -#define MSG_MOVE_AXIS _UxGT("Liikuta akseleita") -#define MSG_MOVE_X _UxGT("Liikuta X") -#define MSG_MOVE_Y _UxGT("Liikuta Y") -#define MSG_MOVE_Z _UxGT("Liikuta Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Liikuta 0.1mm") -#define MSG_MOVE_1MM _UxGT("Liikuta 1mm") -#define MSG_MOVE_10MM _UxGT("Liikuta 10mm") -#define MSG_SPEED _UxGT("Nopeus") -#define MSG_NOZZLE _UxGT("Suutin") -#define MSG_BED _UxGT("Alusta") -#define MSG_FAN_SPEED _UxGT("Tuul. nopeus") -#define MSG_FLOW _UxGT("Virtaus") -#define MSG_CONTROL _UxGT("Kontrolli") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Kerr") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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_ACC _UxGT("Kiihtyv") -#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("VLiike min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-peruuta") -#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_TEMPERATURE _UxGT("Lämpötila") -#define MSG_MOTION _UxGT("Liike") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrasti") -#define MSG_STORE_EEPROM _UxGT("Tallenna muistiin") -#define MSG_LOAD_EEPROM _UxGT("Lataa muistista") -#define MSG_RESTORE_FAILSAFE _UxGT("Palauta oletus") -#define MSG_REFRESH _UxGT("Päivitä") -#define MSG_WATCH _UxGT("Seuraa") -#define MSG_PREPARE _UxGT("Valmistele") -#define MSG_TUNE _UxGT("Säädä") -#define MSG_PAUSE_PRINT _UxGT("Keskeytä tulostus") -#define MSG_RESUME_PRINT _UxGT("Jatka tulostusta") -#define MSG_STOP_PRINT _UxGT("Pysäytä tulostus") -#define MSG_CARD_MENU _UxGT("Korttivalikko") -#define MSG_NO_CARD _UxGT("Ei korttia") -#define MSG_DWELL _UxGT("Nukkumassa...") -#define MSG_USERWAIT _UxGT("Odotet. valintaa") -#define MSG_PRINT_ABORTED _UxGT("Print aborted") -#define MSG_NO_MOVE _UxGT("Ei liiketta.") -#define MSG_KILLED _UxGT("KILLED. ") -#define MSG_STOPPED _UxGT("STOPPED. ") -#define MSG_CONTROL_RETRACT _UxGT("Vedä mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Va. Vedä mm") -#define MSG_CONTROL_RETRACTF _UxGT("Vedä V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Va. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoVeto.") -#define MSG_FILAMENTCHANGE _UxGT("Change filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD-Card") -#define MSG_CNG_SDCARD _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_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_DELTA_CALIBRATE _UxGT("Delta Kalibrointi") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibroi X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibroi Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibroi Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibroi Center") - -#endif // LANGUAGE_FI_H diff --git a/Marlin_thinkerV2/Marlin/language_fr.h b/Marlin_thinkerV2/Marlin/language_fr.h deleted file mode 100644 index eda672f0da..0000000000 --- a/Marlin_thinkerV2/Marlin/language_fr.h +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * French - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FR_H -#define LANGUAGE_FR_H - -#define MAPPER_NON -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prete.") -#define MSG_BACK _UxGT("Retour") -#define MSG_SD_INSERTED _UxGT("Carte inseree") -#define MSG_SD_REMOVED _UxGT("Carte retiree") -#define MSG_LCD_ENDSTOPS _UxGT("Butees") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Demarrage auto") -#define MSG_DISABLE_STEPPERS _UxGT("Arreter moteurs") -#define MSG_DEBUG_MENU _UxGT("Menu debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") -#define MSG_AUTO_HOME _UxGT("Origine auto.") -#define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") -#define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") -#define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") -#define MSG_LEVEL_BED_DONE _UxGT("Mise a niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissee") -#define MSG_SET_HOME_OFFSETS _UxGT("Regl. decal. origine") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalages appliques") -#define MSG_SET_ORIGIN _UxGT("Regler origine") -#define MSG_PREHEAT_1 _UxGT("Prechauffage PLA") -#define MSG_PREHEAT_1_N _UxGT("Prechauff. PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Prech. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Prech. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Regl. prech. PLA") -#define MSG_PREHEAT_2 _UxGT("Prechauffage ABS") -#define MSG_PREHEAT_2_N _UxGT("Prechauff. ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Prech. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Prech. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Regl. prech. ABS") -#define MSG_COOLDOWN _UxGT("Refroidir") -#define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") -#define MSG_MOVE_AXIS _UxGT("Deplacer un axe") -#define MSG_BED_LEVELING _UxGT("Regl. Niv. lit") -#define MSG_LEVEL_BED _UxGT("Regl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") -#define MSG_EDITING_STOPPED _UxGT("Arret edit. maillage") -#define MSG_USER_MENU _UxGT("Commandes perso") - -#define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ d'abord") -#define MSG_UBL_TOOLS _UxGT("Outils UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifie") -#define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#define MSG_UBL_BC_INSERT _UxGT("Poser cale & mesurer") -#define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("Oter et mesurer lit") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desactiver l'UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temperature lit") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temperature buse") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editer maille") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Reglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Creer maille perso") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Creer maille") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Creer maille PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Creer maille ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Creer maille froide") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valider maille PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valider maille ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") -#define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau a 3 points") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau grille") -#define MSG_UBL_MESH_LEVEL _UxGT("Maille de niveau") -#define MSG_UBL_SIDE_POINTS _UxGT("Point lateral") -#define MSG_UBL_MAP_TYPE _UxGT("Type de carte") -#define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hote") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") -#define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") -#define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") -#define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus pres") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Reglage fin (tous)") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Reglage fin (proche)") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Stockage maille") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot memoire") -#define MSG_UBL_LOAD_MESH _UxGT("Charger maille") -#define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_NO_STORAGE _UxGT("Pas de memoire") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Enreg. UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ouvrir UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Decal. Z arrete") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas a pas") - -#define MSG_LED_CONTROL _UxGT("Controle LED") -#define MSG_LEDS _UxGT("Lumiere") -#define MSG_LED_PRESETS _UxGT("Preregl. LED.") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensite rouge") -#define MSG_INTENSITY_G _UxGT("Intensite vert") -#define MSG_INTENSITY_B _UxGT("Intensite bleu") -#define MSG_INTENSITY_W _UxGT("Intensite blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosite") - -#define MSG_MOVING _UxGT("Deplacement...") -#define MSG_FREE_XY _UxGT("Debloquer XY") -#define MSG_MOVE_X _UxGT("Depl. X") -#define MSG_MOVE_Y _UxGT("Depl. Y") -#define MSG_MOVE_Z _UxGT("Depl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") -#define MSG_MOVE_01MM _UxGT("Depl. 0.1mm") -#define MSG_MOVE_1MM _UxGT("Depl. 1mm") -#define MSG_MOVE_10MM _UxGT("Depl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") -#define MSG_BED_Z _UxGT("Lit Z") -#define MSG_NOZZLE _UxGT("Buse") -#define MSG_BED _UxGT("Lit") -#define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Controler") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") -#define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_ON _UxGT("Marche") -#define MSG_OFF _UxGT("Arret") -#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("Selectionner") -#define MSG_ACC _UxGT("Acceleration") -#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_VELOCITY _UxGT("Velocite") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V depl. min") -#define MSG_ACCELERATION _UxGT("Acceleration") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A Depl.") -#define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") -#define MSG_TEMPERATURE _UxGT("Temperature") -#define MSG_MOTION _UxGT("Mouvement") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Decharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EEPROM _UxGT("Sauver config") -#define MSG_LOAD_EEPROM _UxGT("Lire config") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurer defauts") -#define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") -#define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Surveiller") -#define MSG_PREPARE _UxGT("Preparer") -#define MSG_TUNE _UxGT("Regler") -#define MSG_PAUSE_PRINT _UxGT("Interrompre impr.") -#define MSG_RESUME_PRINT _UxGT("Reprendre impr.") -#define MSG_STOP_PRINT _UxGT("Arreter impr.") -#define MSG_CARD_MENU _UxGT("Impr. depuis SD") -#define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Repos...") -#define MSG_USERWAIT _UxGT("Atten. de l'util.") -#define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINT_ABORTED _UxGT("Impr. Annulee") -#define MSG_NO_MOVE _UxGT("Moteurs bloques.") -#define MSG_KILLED _UxGT("MORT.") -#define MSG_STOPPED _UxGT("STOPPE.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rapp. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Decharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Decharger tout") -#define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur ecart") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Deployer BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ranger BLTouch") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") -#define MSG_ZPROBE_ZOFFSET _UxGT("Decalage Z") -#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("Butee abandon") -#define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPR. STOPPEE") -#define MSG_PLEASE_RESET _UxGT("RaZ. SVP") -#define MSG_SHORT_DAY _UxGT("j") // 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("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Reglages Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") - -#define MSG_INFO_MENU _UxGT("Infos imprimante") -#define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau a 3 points") -#define MSG_LINEAR_LEVELING _UxGT("Niveau lineaire") -#define MSG_BILINEAR_LEVELING _UxGT("Niveau bilineaire") -#define MSG_UBL_LEVELING _UxGT("Niveau lit unifie") -#define MSG_MESH_LEVELING _UxGT("Niveau maillage") -#define MSG_INFO_STATS_MENU _UxGT("Stats. imprimante") -#define MSG_INFO_BOARD_MENU _UxGT("Infos carte") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocole") -#define MSG_CASE_LIGHT _UxGT("Lumiere caisson") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosite") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Nbre impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminees") - #define MSG_INFO_PRINT_TIME _UxGT("Tps impr. total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impr. la + longue") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total filament") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminees") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("+ long") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filament") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("Alimentation") -#define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger encore") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Demarrage") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("decharger filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer 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_HEATING_1 _UxGT("Buse en chauffe") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patientez...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserer et clic") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_FR_H diff --git a/Marlin_thinkerV2/Marlin/language_fr_utf8.h b/Marlin_thinkerV2/Marlin/language_fr_utf8.h deleted file mode 100644 index 5d49c059b2..0000000000 --- a/Marlin_thinkerV2/Marlin/language_fr_utf8.h +++ /dev/null @@ -1,395 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * French - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_FR_UTF_H -#define LANGUAGE_FR_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" prête.") -#define MSG_BACK _UxGT("Retour") -#define MSG_SD_INSERTED _UxGT("Carte insérée") -#define MSG_SD_REMOVED _UxGT("Carte retirée") -#define MSG_LCD_ENDSTOPS _UxGT("Butées") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Demarrage auto") -#define MSG_DISABLE_STEPPERS _UxGT("Arrêter moteurs") -#define MSG_DEBUG_MENU _UxGT("Menu debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") -#define MSG_AUTO_HOME _UxGT("Origine auto.") -#define MSG_AUTO_HOME_X _UxGT("Origine X Auto.") -#define MSG_AUTO_HOME_Y _UxGT("Origine Y Auto.") -#define MSG_AUTO_HOME_Z _UxGT("Origine Z Auto.") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Origine XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Clic pour commencer") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Point suivant") -#define MSG_LEVEL_BED_DONE _UxGT("Mise à niveau OK!") -#define MSG_Z_FADE_HEIGHT _UxGT("Hauteur lissée") -#define MSG_SET_HOME_OFFSETS _UxGT("Régl. décal. origine") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Décalages appliqués") -#define MSG_SET_ORIGIN _UxGT("Régler origine") -#define MSG_PREHEAT_1 _UxGT("Préchauffage PLA") -#define MSG_PREHEAT_1_N _UxGT("Préchauff. PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Préch. PLA Tout") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" fini") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Régl. prech. PLA") -#define MSG_PREHEAT_2 _UxGT("Préchauffage ABS") -#define MSG_PREHEAT_2_N _UxGT("Préchauff. ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Préch. ABS Tout") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" fini") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Régl. prech. ABS") -#define MSG_COOLDOWN _UxGT("Refroidir") -#define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") -#define MSG_MOVE_AXIS _UxGT("Déplacer un axe") -#define MSG_BED_LEVELING _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_BED _UxGT("Régl. Niv. lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") -#define MSG_NEXT_CORNER _UxGT("Coin suivant") -#define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage") -#define MSG_USER_MENU _UxGT("Commandes perso") - -#define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ d'abord") -#define MSG_UBL_TOOLS _UxGT("Outils UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") -#define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#define MSG_UBL_BC_INSERT _UxGT("Poser câle & mesurer") -#define MSG_UBL_BC_INSERT2 _UxGT("Mesure") -#define MSG_UBL_BC_REMOVE _UxGT("ôter et mesurer lit") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Désactiver l'UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Température lit") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Température buse") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editer maille") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Réglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Créer maille perso") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Créer maille") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Créer maille PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Créer maille ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Créer maille froide") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valider maille PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valider maille ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") -#define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Niveau à 3 points") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Niveau grille") -#define MSG_UBL_MESH_LEVEL _UxGT("Maille de niveau") -#define MSG_UBL_SIDE_POINTS _UxGT("Point latéral") -#define MSG_UBL_MAP_TYPE _UxGT("Type de carte") -#define MSG_UBL_OUTPUT_MAP _UxGT("Voir maille") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Voir pour hôte") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Voir pour CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Voir pour sauveg.") -#define MSG_UBL_INFO_UBL _UxGT("Voir info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifier maille") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Taux de remplissage") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Remplissage manuel") -#define MSG_UBL_SMART_FILLIN _UxGT("Remplissage auto") -#define MSG_UBL_FILLIN_MESH _UxGT("Maille remplissage") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tout annuler") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Annuler le plus près") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Réglage fin (tous)") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Réglage fin (proche)") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Stockage maille") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot mémoire") -#define MSG_UBL_LOAD_MESH _UxGT("Charger maille") -#define MSG_UBL_SAVE_MESH _UxGT("Sauver maille") -#define MSG_MESH_LOADED _UxGT("Maille %i charg.") -#define MSG_MESH_SAVED _UxGT("Maille %i enreg.") -#define MSG_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_STOPPED _UxGT("Décal. Z arrêté") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas") - -#define MSG_LED_CONTROL _UxGT("Contrôle LED") -#define MSG_LEDS _UxGT("Lumière") -#define MSG_LED_PRESETS _UxGT("Préregl. LED") -#define MSG_SET_LEDS_RED _UxGT("Rouge") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Jaune") -#define MSG_SET_LEDS_GREEN _UxGT("Vert") -#define MSG_SET_LEDS_BLUE _UxGT("Bleu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#define MSG_SET_LEDS_WHITE _UxGT("Blanc") -#define MSG_SET_LEDS_DEFAULT _UxGT("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("Lum. perso.") -#define MSG_INTENSITY_R _UxGT("Intensité rouge") -#define MSG_INTENSITY_G _UxGT("Intensité vert") -#define MSG_INTENSITY_B _UxGT("Intensité bleu") -#define MSG_INTENSITY_W _UxGT("Intensité blanc") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosité") - -#define MSG_MOVING _UxGT("Déplacement...") -#define MSG_FREE_XY _UxGT("Débloquer XY") -#define MSG_MOVE_X _UxGT("Dépl. X") -#define MSG_MOVE_Y _UxGT("Dépl. Y") -#define MSG_MOVE_Z _UxGT("Dépl. Z") -#define MSG_MOVE_E _UxGT("Extrudeur") -#define MSG_MOVE_01MM _UxGT("Dépl. 0.1mm") -#define MSG_MOVE_1MM _UxGT("Dépl. 1mm") -#define MSG_MOVE_10MM _UxGT("Dépl. 10mm") -#define MSG_SPEED _UxGT("Vitesse") -#define MSG_BED_Z _UxGT("Lit Z") -#define MSG_NOZZLE _UxGT("Buse") -#define MSG_BED _UxGT("Lit") -#define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") - -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Contrôler") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") -#define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_ON _UxGT("Marche ") -#define MSG_OFF _UxGT("Arrêt") -#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("Sélectionner") -#define MSG_ACC _UxGT("Accélération") -#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_VELOCITY _UxGT("Vélocité") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V dépl. min") -#define MSG_ACCELERATION _UxGT("Accélération") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A retrait") -#define MSG_A_TRAVEL _UxGT("A dépl.") -#define MSG_STEPS_PER_MM _UxGT("Pas/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A pas/mm") - #define MSG_BSTEPS _UxGT("B pas/mm") - #define MSG_CSTEPS _UxGT("C pas/mm") -#else - #define MSG_ASTEPS _UxGT("X pas/mm") - #define MSG_BSTEPS _UxGT("Y pas/mm") - #define MSG_CSTEPS _UxGT("Z pas/mm") -#endif -#define MSG_ESTEPS _UxGT("E pas/mm") -#define MSG_E1STEPS _UxGT("E1 pas/mm") -#define MSG_E2STEPS _UxGT("E2 pas/mm") -#define MSG_E3STEPS _UxGT("E3 pas/mm") -#define MSG_E4STEPS _UxGT("E4 pas/mm") -#define MSG_E5STEPS _UxGT("E5 pas/mm") -#define MSG_TEMPERATURE _UxGT("Température") -#define MSG_MOTION _UxGT("Mouvement") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Décharger mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EEPROM _UxGT("Sauver config") -#define MSG_LOAD_EEPROM _UxGT("Lire config") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurer défauts") -#define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") -#define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Surveiller") -#define MSG_PREPARE _UxGT("Préparer") -#define MSG_TUNE _UxGT("Régler") -#define MSG_PAUSE_PRINT _UxGT("Interrompre impr.") -#define MSG_RESUME_PRINT _UxGT("Reprendre impr.") -#define MSG_STOP_PRINT _UxGT("Arrêter impr.") -#define MSG_CARD_MENU _UxGT("Impr. depuis SD") -#define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Repos...") -#define MSG_USERWAIT _UxGT("Atten. de l'util.") -#define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINT_ABORTED _UxGT("Impr. Annulée") -#define MSG_NO_MOVE _UxGT("Moteurs bloqués.") -#define MSG_KILLED _UxGT("MORT.") -#define MSG_STOPPED _UxGT("STOPPÉ.") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rappel mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Ech. Rappel V") -#define MSG_AUTORETRACT _UxGT("Retrait. Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger fil.") -#define MSG_FILAMENTUNLOAD _UxGT("Décharger fil.") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") -#define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CNG_SDCARD _UxGT("Changer de carte") -#define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur écart") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("RaZ BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Déployer BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ranger BLTouch") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") -#define MSG_ZPROBE_ZOFFSET _UxGT("Décalage Z") -#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("Butée abandon") -#define MSG_HEATING_FAILED_LCD _UxGT("Erreur de chauffe") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("EMBALLEMENT THERM.") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP. MAX") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP. MIN") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP. MAX LIT") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP. MIN LIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPR. STOPPÉE") -#define MSG_PLEASE_RESET _UxGT("RàZ. SVP") -#define MSG_SHORT_DAY _UxGT("j") // 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("En chauffe...") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibration Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrer centre") -#define MSG_DELTA_SETTINGS _UxGT("Réglages Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Calibration Auto") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Hauteur Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") - -#define MSG_INFO_MENU _UxGT("Infos imprimante") -#define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau à 3 points") -#define MSG_LINEAR_LEVELING _UxGT("Niveau linéaire") -#define MSG_BILINEAR_LEVELING _UxGT("Niveau bilinéaire") -#define MSG_UBL_LEVELING _UxGT("Niveau lit unifié") -#define MSG_MESH_LEVELING _UxGT("Niveau maillage") -#define MSG_INFO_STATS_MENU _UxGT("Stats. imprimante") -#define MSG_INFO_BOARD_MENU _UxGT("Infos carte") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocole") -#define MSG_CASE_LIGHT _UxGT("Lumière caisson") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosité") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Nbre impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Tps impr. total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impr. la + longue") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total filament") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("+ long") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filament") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("Alimentation") -#define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DECHARGER FIL") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPTIONS REPRISE:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purger encore") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Reprendre impr.") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Echec origine") -#define MSG_ERR_PROBING_FAILED _UxGT("Echec sonde") -#define MSG_M600_TOO_COLD _UxGT("M600: Trop froid") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente Démarrage") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("du filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("changer") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("décharger filament") - #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_HEATING_1 _UxGT("Buse en chauffe") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patientez SVP...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente de") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purger filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente impression") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pour reprendre") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patientez...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejection...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer et clic") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_FR_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_gl.h b/Marlin_thinkerV2/Marlin/language_gl.h deleted file mode 100644 index e0524d8df9..0000000000 --- a/Marlin_thinkerV2/Marlin/language_gl.h +++ /dev/null @@ -1,255 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Galician language (ISO "gl") - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_GL_H -#define LANGUAGE_GL_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_SD_INSERTED _UxGT("Tarxeta inserida") -#define MSG_SD_REMOVED _UxGT("Tarxeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("FinCarro") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autoarranque") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_AUTO_HOME _UxGT("Ir a orixe") -#define MSG_AUTO_HOME_X _UxGT("Ir orixe X") -#define MSG_AUTO_HOME_Y _UxGT("Ir orixe Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir orixe Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Ir orixes XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Prema pulsador") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Seguinte punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelado feito") -#define MSG_SET_HOME_OFFSETS _UxGT("Offsets na orixe") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets fixados") -#define MSG_SET_ORIGIN _UxGT("Fixar orixe") -#define MSG_PREHEAT_1 _UxGT("Prequentar PLA") -#define MSG_PREHEAT_1_N _UxGT("Prequentar PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Preque. PLA Todo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Preque. PLA Cama") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Preque. PLA conf") -#define MSG_PREHEAT_2 _UxGT("Prequentar ABS") -#define MSG_PREHEAT_2_N _UxGT("Prequentar ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Preque. ABS Todo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Preque. ABS Cama") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Preque. ABS conf") -#define MSG_COOLDOWN _UxGT("Arrefriar") -#define MSG_SWITCH_PS_ON _UxGT("Acender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover eixe") -#define MSG_BED_LEVELING _UxGT("Nivelar cama") -#define MSG_LEVEL_BED _UxGT("Nivelar cama") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Cama Z") -#define MSG_NOZZLE _UxGT("Bico") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Velocidade vent.") -#define MSG_FLOW _UxGT("Fluxo") -#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_ON _UxGT("On ") -#define MSG_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_STEPS_PER_MM _UxGT("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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movemento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. fil.") -#define MSG_CONTRAST _UxGT("Constraste LCD") -#define MSG_STORE_EEPROM _UxGT("Gardar en memo.") -#define MSG_LOAD_EEPROM _UxGT("Cargar de memo.") -#define MSG_RESTORE_FAILSAFE _UxGT("Cargar de firm.") -#define MSG_REFRESH _UxGT("Volver a cargar") -#define MSG_WATCH _UxGT("Monitorizacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Axustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impres.") -#define MSG_RESUME_PRINT _UxGT("Seguir impres.") -#define MSG_STOP_PRINT _UxGT("Deter impres.") -#define MSG_CARD_MENU _UxGT("Tarxeta SD") -#define MSG_NO_CARD _UxGT("Sen tarxeta SD") -#define MSG_DWELL _UxGT("En repouso...") -#define MSG_USERWAIT _UxGT("A espera...") -#define MSG_PRINT_ABORTED _UxGT("Impre. cancelada") -#define MSG_NO_MOVE _UxGT("Sen movemento.") -#define MSG_KILLED _UxGT("PROGRAMA MORTO") -#define MSG_STOPPED _UxGT("PROGRAMA PARADO") -#define MSG_CONTROL_RETRACT _UxGT("Retraccion mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Cambio retra. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraccion V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Alzar Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Recup. retra. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Cambio recup. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Recuperacion V") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamen.") -#define MSG_INIT_SDCARD _UxGT("Iniciando SD") -#define MSG_CNG_SDCARD _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_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") -#define MSG_BABYSTEP_Z _UxGT("Micropaso Z") -#define MSG_ENDSTOP_ABORT _UxGT("Erro fin carro") -#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_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_HEATING _UxGT("Quentando...") -#define MSG_BED_HEATING _UxGT("Quentando cama...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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_INFO_MENU _UxGT("Acerca de...") -#define MSG_INFO_PRINTER_MENU _UxGT("Informacion") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Placa nai") -#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") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Total completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo impresion") - #define MSG_INFO_PRINT_LONGEST _UxGT("Traballo +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extruido") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo") - #define MSG_INFO_PRINT_LONGEST _UxGT("O +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruido") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Fonte alime.") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia motor") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Garda DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Segue traballo") - -#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") -#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...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_GL_H diff --git a/Marlin_thinkerV2/Marlin/language_hr.h b/Marlin_thinkerV2/Marlin/language_hr.h deleted file mode 100644 index efdeae8b5b..0000000000 --- a/Marlin_thinkerV2/Marlin/language_hr.h +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Croatian (Hrvatski) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_HR_H -#define LANGUAGE_HR_H - -#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" spreman.") -#define MSG_SD_INSERTED _UxGT("SD kartica umetnuta") -#define MSG_SD_REMOVED _UxGT("SD kartica uklonjena") -#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") -#define MSG_AUTO_HOME_X _UxGT("Home-aj X") -#define MSG_AUTO_HOME_Y _UxGT("Home-aj Y") -#define MSG_AUTO_HOME_Z _UxGT("Home-aj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriraj Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home-aj XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klikni za početak") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sljedeća točka") -#define MSG_LEVEL_BED_DONE _UxGT("Niveliranje gotovo!") -#define MSG_SET_HOME_OFFSETS _UxGT("Postavi home offsete") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets postavljeni") -#define MSG_SET_ORIGIN _UxGT("Postavi ishodište") -#define MSG_PREHEAT_1 _UxGT("Predgrij PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Sve") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#define MSG_PREHEAT_2 _UxGT("Predgrij ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Sve") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#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_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_01MM _UxGT("Miči 0.1mm") -#define MSG_MOVE_1MM _UxGT("Miči 1mm") -#define MSG_MOVE_10MM _UxGT("Miči 10mm") -#define MSG_SPEED _UxGT("Brzina") -#define MSG_BED_Z _UxGT("Bed Z") -#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_ON _UxGT("On ") -#define MSG_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_TEMPERATURE _UxGT("Temperature") -#define MSG_MOTION _UxGT("Gibanje") -#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") -#define MSG_STORE_EEPROM _UxGT("Pohrani u memoriju") -#define MSG_LOAD_EEPROM _UxGT("Učitaj memoriju") -#define MSG_RESTORE_FAILSAFE _UxGT("Učitaj failsafe") -#define MSG_REFRESH _UxGT("Osvježi") -#define MSG_WATCH _UxGT("Info screen") -#define MSG_PREPARE _UxGT("Pripremi") -#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_CARD_MENU _UxGT("Printaj s SD kartice") -#define MSG_NO_CARD _UxGT("Nema SD kartice") -#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_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_ZLIFT _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_SDCARD _UxGT("Init. SD karticu") -#define MSG_CNG_SDCARD _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_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_HEATING _UxGT("Grijanje...") -#define MSG_BED_HEATING _UxGT("Grijanje Bed-a...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibracija") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriraj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriraj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriraj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriraj Središte") -#define MSG_INFO_MENU _UxGT("O printeru") -#define MSG_INFO_PRINTER_MENU _UxGT("Podaci o printeru") -#define MSG_INFO_STATS_MENU _UxGT("Statistika printera") -#define MSG_INFO_BOARD_MENU _UxGT("Podaci o elektronici") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Extruderi") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvjetljenje") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Broj printova") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno printanja") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudirano ukupno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Printovi") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži") - #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_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_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") -#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...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_HR_H diff --git a/Marlin_thinkerV2/Marlin/language_it.h b/Marlin_thinkerV2/Marlin/language_it.h deleted file mode 100644 index 306faa3313..0000000000 --- a/Marlin_thinkerV2/Marlin/language_it.h +++ /dev/null @@ -1,401 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Italian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_IT_H -#define LANGUAGE_IT_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") -#define MSG_BACK _UxGT("Indietro") -#define MSG_SD_INSERTED _UxGT("SD Card inserita") -#define MSG_SD_REMOVED _UxGT("SD Card rimossa") -#define MSG_LCD_ENDSTOPS _UxGT("Endstop") -#define MSG_MAIN _UxGT("Menu principale") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Disabilita Motori") -#define MSG_DEBUG_MENU _UxGT("Menu di debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra avanzamento") -#define MSG_AUTO_HOME _UxGT("Auto Home") -#define MSG_AUTO_HOME_X _UxGT("Home asse X") -#define MSG_AUTO_HOME_Y _UxGT("Home asse Y") -#define MSG_AUTO_HOME_Z _UxGT("Home asse Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibra Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Home assi XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Premi per iniziare") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Punto successivo") -#define MSG_LEVEL_BED_DONE _UxGT("Livel. terminato!") -#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#define MSG_SET_HOME_OFFSETS _UxGT("Imp. offset home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset applicato") -#define MSG_SET_ORIGIN _UxGT("Imposta Origine") -#define MSG_PREHEAT_1 _UxGT("Preriscalda PLA") -#define MSG_PREHEAT_1_N _UxGT("Preris.PLA ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("Tutto") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1_N _UxGT("Ugello") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Piatto") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1_N _UxGT("conf") -#define MSG_PREHEAT_2 _UxGT("Preriscalda ABS") -#define MSG_PREHEAT_2_N _UxGT("Preris.ABS ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("Tutto") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2_N _UxGT("Ugello") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Piatto") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2_N _UxGT("conf") -#define MSG_COOLDOWN _UxGT("Raffredda") -#define MSG_SWITCH_PS_ON _UxGT("Accendi aliment.") -#define MSG_SWITCH_PS_OFF _UxGT("Spegni aliment.") -#define MSG_EXTRUDE _UxGT("Estrudi") -#define MSG_RETRACT _UxGT("Ritrai") -#define MSG_MOVE_AXIS _UxGT("Muovi Asse") -#define MSG_BED_LEVELING _UxGT("Livella piano") -#define MSG_LEVEL_BED _UxGT("Livella piano") -#define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") -#define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") -#define MSG_EDITING_STOPPED _UxGT("Modifica Mesh Fermata") -#define MSG_USER_MENU _UxGT("Comandi Utente") - -#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") -#define MSG_UBL_BC_INSERT _UxGT("Metti spessore & misura") -#define MSG_UBL_BC_INSERT2 _UxGT("Misura") -#define MSG_UBL_BC_REMOVE _UxGT("Rimuovi e misura piatto") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Spostamento sucessivo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Attiva UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Disattiva UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp Piatto") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp Ugello") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Modifica Mesh") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Modif Custom Mesh") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ritocca Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Crea Custom Mesh") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Crea Mesh") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Crea PLA Mesh") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Crea ABS Mesh") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Crea Cold Mesh") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Aggiusta Altezza Mesh") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Altezza") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valida Mesh") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valida PLA Mesh") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valida ABS Mesh") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valida Custom Mesh") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continua Mesh") -#define MSG_UBL_MESH_LEVELING _UxGT("Livell. Mesh") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Livell. 3 Punti") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Livell. Griglia Mesh") -#define MSG_UBL_MESH_LEVEL _UxGT("Livella Mesh") -#define MSG_UBL_SIDE_POINTS _UxGT("Punti laterali") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo di Mappa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Esporta Mappa") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Esporta per Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Esporta in CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Backup esterno") -#define MSG_UBL_INFO_UBL _UxGT("Esporta Info UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Modifica Mesh") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Riempimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Riempimento Manuale") -#define MSG_UBL_SMART_FILLIN _UxGT("Riempimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Riempimento Mesh") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalida Tutto") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalida Punto Vicino") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ritocca All") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ritocca Punto Vicino") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Salvate") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot di memoria") -#define MSG_UBL_LOAD_MESH _UxGT("Carica Mesh Piatto") -#define MSG_UBL_SAVE_MESH _UxGT("Salva Mesh Piatto") -#define MSG_MESH_LOADED _UxGT("Mesh %i caricata") -#define MSG_MESH_SAVED _UxGT("Mesh %i salvata") -#define MSG_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_STOPPED _UxGT("Z-Offset Fermato") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo") - -#define MSG_LED_CONTROL _UxGT("Controllo LED") -#define MSG_LEDS _UxGT("Luci") -#define MSG_LED_PRESETS _UxGT("Preset luci") -#define MSG_SET_LEDS_RED _UxGT("Rosso") -#define MSG_SET_LEDS_ORANGE _UxGT("Arancione") -#define MSG_SET_LEDS_YELLOW _UxGT("Giallo") -#define MSG_SET_LEDS_GREEN _UxGT("Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Blu") -#define MSG_SET_LEDS_INDIGO _UxGT("Indaco") -#define MSG_SET_LEDS_VIOLET _UxGT("Viola") -#define MSG_SET_LEDS_WHITE _UxGT("Bianco") -#define MSG_SET_LEDS_DEFAULT _UxGT("Predefinito") -#define MSG_CUSTOM_LEDS _UxGT("Luci personalizzate") -#define MSG_INTENSITY_R _UxGT("Intensita rosso") -#define MSG_INTENSITY_G _UxGT("Intensita verde") -#define MSG_INTENSITY_B _UxGT("Intensita blu") -#define MSG_INTENSITY_W _UxGT("Intensita bianco") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosita") - -#define MSG_MOVING _UxGT("In movimento...") -#define MSG_FREE_XY _UxGT("XY liberi") -#define MSG_MOVE_X _UxGT("Muovi X") -#define MSG_MOVE_Y _UxGT("Muovi Y") -#define MSG_MOVE_Z _UxGT("Muovi Z") -#define MSG_MOVE_E _UxGT("Estrusore") -#define MSG_MOVE_01MM _UxGT("Muovi di 0.1mm") -#define MSG_MOVE_1MM _UxGT("Muovi di 1mm") -#define MSG_MOVE_10MM _UxGT("Muovi di 10mm") -#define MSG_SPEED _UxGT("Velocità") -#define MSG_BED_Z _UxGT("piatto Z") -#define MSG_NOZZLE _UxGT("Ugello") -#define MSG_BED _UxGT("Piatto") -#define MSG_FAN_SPEED _UxGT("Velocita ventola") -#define MSG_EXTRA_FAN_SPEED _UxGT("Magg vel ventola") -#define MSG_FLOW _UxGT("Flusso") -#define MSG_CONTROL _UxGT("Controllo") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_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("Seleziona") -#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_VELOCITY _UxGT("Velocità") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Accelerazione") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retract") -#define MSG_A_TRAVEL _UxGT("A-Spostamento") -#define MSG_STEPS_PER_MM _UxGT("Passi/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Apassi/mm") - #define MSG_BSTEPS _UxGT("Bpassi/mm") - #define MSG_CSTEPS _UxGT("Cpassi/mm") -#else - #define MSG_ASTEPS _UxGT("Xpassi/mm") - #define MSG_BSTEPS _UxGT("Ypassi/mm") - #define MSG_CSTEPS _UxGT("Zpassi/mm") -#endif -#define MSG_ESTEPS _UxGT("Epassi/mm") -#define MSG_E1STEPS _UxGT("E1passi/mm") -#define MSG_E2STEPS _UxGT("E2passi/mm") -#define MSG_E3STEPS _UxGT("E3passi/mm") -#define MSG_E4STEPS _UxGT("E4passi/mm") -#define MSG_E5STEPS _UxGT("E5passi/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. filo") -#define MSG_FILAMENT_UNLOAD _UxGT("Rimuovi mm") -#define MSG_FILAMENT_LOAD _UxGT("Carica mm") -#define MSG_ADVANCE_K _UxGT("K Avanzamento") -#define MSG_CONTRAST _UxGT("Contrasto LCD") -#define MSG_STORE_EEPROM _UxGT("Salva in memoria") -#define MSG_LOAD_EEPROM _UxGT("Carica da memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") -#define MSG_INIT_EEPROM _UxGT("Inizializza EEPROM") -#define MSG_REFRESH _UxGT("Aggiorna") -#define MSG_WATCH _UxGT("Guarda") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Regola") -#define MSG_PAUSE_PRINT _UxGT("Pausa") -#define MSG_RESUME_PRINT _UxGT("Riprendi stampa") -#define MSG_STOP_PRINT _UxGT("Arresta stampa") -#define MSG_CARD_MENU _UxGT("Stampa da SD") -#define MSG_NO_CARD _UxGT("SD non presente") -#define MSG_DWELL _UxGT("Sospensione...") -#define MSG_USERWAIT _UxGT("Premi tasto..") -#define MSG_PRINT_PAUSED _UxGT("Stampa sospesa") -#define MSG_PRINT_ABORTED _UxGT("Stampa annullata") -#define MSG_NO_MOVE _UxGT("Nessun Movimento") -#define MSG_KILLED _UxGT("UCCISO. ") -#define MSG_STOPPED _UxGT("ARRESTATO. ") -#define MSG_CONTROL_RETRACT _UxGT("Ritrai mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Scamb. Ritrai mm") -#define MSG_CONTROL_RETRACTF _UxGT("Ritrai V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Salta mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Scamb. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRitrai") -#define MSG_FILAMENTCHANGE _UxGT("Cambia filamento") -#define MSG_FILAMENTLOAD _UxGT("Carica filamento") -#define MSG_FILAMENTUNLOAD _UxGT("Rimuovi filamento") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Rimuovi tutto") -#define MSG_INIT_SDCARD _UxGT("Iniz. SD-Card") -#define MSG_CNG_SDCARD _UxGT("Cambia SD-Card") -#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_SKEW_FACTOR _UxGT("Fattore distorsione") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Autotest BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Resetta BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Estendi BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Ritrai BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prima") -#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("Finecorsa abort") -#define MSG_HEATING_FAILED_LCD _UxGT("Riscald. Fallito") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Risc. piatto fallito") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP RIDONDANTI") -#define MSG_THERMAL_RUNAWAY _UxGT("TEMP FUORI CONTROLLO") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MASSIMA") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP MASSIMA PIATTO") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP MINIMA PIATTO") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("STAMPANTE FERMATA") -#define MSG_PLEASE_RESET _UxGT("Riavviare prego") -#define MSG_SHORT_DAY _UxGT("g") // 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("Riscaldamento...") -#define MSG_COOLING _UxGT("Raffreddamento..") -#define MSG_BED_HEATING _UxGT("Risc. piatto...") -#define MSG_BED_COOLING _UxGT("Raffr. piatto...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibraz. Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibra X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibra Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Calibra Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibra Center") -#define MSG_DELTA_SETTINGS _UxGT("Impostaz. Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto calibrazione") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Imp. altezza Delta") -#define MSG_DELTA_DIAG_ROD _UxGT("Barra Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Altezza") -#define MSG_DELTA_RADIUS _UxGT("Raggio") -#define MSG_INFO_MENU _UxGT("Riguardo stampante") -#define MSG_INFO_PRINTER_MENU _UxGT("Info. stampante") -#define MSG_3POINT_LEVELING _UxGT("Livel. a 3 punti") -#define MSG_LINEAR_LEVELING _UxGT("Livel. Lineare") -#define MSG_BILINEAR_LEVELING _UxGT("Livel. Biliniare") -#define MSG_UBL_LEVELING _UxGT("Livel. UBL") -#define MSG_MESH_LEVELING _UxGT("Livel. Mesh") -#define MSG_INFO_STATS_MENU _UxGT("Statistiche") -#define MSG_INFO_BOARD_MENU _UxGT("Info. scheda") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusori") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocollo") -#define MSG_CASE_LIGHT _UxGT("Luci Case") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosità Luci") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Contat. stampa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo totale") - #define MSG_INFO_PRINT_LONGEST _UxGT("Lavoro più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totale estruso") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Stampe") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Durata") - #define MSG_INFO_PRINT_LONGEST _UxGT("Più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruso") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Temp min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp max") -#define MSG_INFO_PSU _UxGT("Alimentatore") - -#define MSG_DRIVE_STRENGTH _UxGT("Potenza Drive") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#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") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("RIMUOVI FILAMENTO") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPZIONI:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Libera di piu") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Riprendi stampa") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Ugello: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Home fallito") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing fallito") -#define MSG_M600_TOO_COLD _UxGT("M600:Troppo freddo") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere avvio") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del cambio") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("di filamento") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("l'espulsione") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci il") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("premi per cont") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premi per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("riscald ugello.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscald. ugello") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Attendere...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("il caricamento") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("lo spurgo") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("del filamento") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("la ripresa") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("della stampa") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Espulsione...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci e premi") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Riscalda ugello") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscaldamento...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Caricamento...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Spurgo filamento") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ripresa...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_IT_H diff --git a/Marlin_thinkerV2/Marlin/language_kana.h b/Marlin_thinkerV2/Marlin/language_kana.h deleted file mode 100644 index e75be4c210..0000000000 --- a/Marlin_thinkerV2/Marlin/language_kana.h +++ /dev/null @@ -1,340 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Japanese (Kana) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#ifndef LANGUAGE_KANA_H -#define LANGUAGE_KANA_H - -// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h -#define SIMULATE_ROMFONT -#define DISPLAY_CHARSET_ISO10646_KANA -#define CHARSIZE 2 - -// 片仮名表示定義 -#define WELCOME_MSG MACHINE_NAME " ready." -#define MSG_SD_INSERTED "\xb6\xb0\xc4\xde\xb6\xde\xbf\xb3\xc6\xad\xb3\xbb\xda\xcf\xbc\xc0" // "カードガソウニュウサレマシタ" ("Card inserted") -#define MSG_SD_REMOVED "\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "カードガアリマセン" ("Card removed") -#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters -#define MSG_MAIN "\xd2\xb2\xdd" // "メイン" ("Main") -#define MSG_AUTOSTART "\xbc\xde\xc4\xde\xb3\xb6\xb2\xbc" // "ジドウカイシ" ("Autostart") -#define MSG_DISABLE_STEPPERS "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "モーターデンゲン オフ" ("Disable steppers") -#define MSG_DEBUG_MENU "\xc3\xde\xca\xde\xaf\xb8\xde\xd2\xc6\xad\xb0" // "デバッグメニュー" ("Debug Menu") -#define MSG_PROGRESS_BAR_TEST "\xcc\xdf\xdb\xb8\xde\xda\xbd\xca\xde\xb0\x20\xc3\xbd\xc4" // "プログレスバー テスト" ("Progress Bar Test") -#define MSG_AUTO_HOME "\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "ゲンテンフッキ" ("Auto home") -#define MSG_AUTO_HOME_X "X\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Xジク ゲンテンフッキ" ("Home X") -#define MSG_AUTO_HOME_Y "Y\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Yジク ゲンテンフッキ" ("Home Y") -#define MSG_AUTO_HOME_Z "Z\xbc\xde\xb8\x20\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7" // "Zジク ゲンテンフッキ" ("Home Z") -#define MSG_TMC_Z_CALIBRATION "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") -#define MSG_LEVEL_BED_HOMING "\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xc1\xad\xb3" // "ゲンテンフッキチュウ" ("Homing XYZ") -#define MSG_LEVEL_BED_WAITING "\xda\xcd\xde\xd8\xdd\xb8\xde\xb6\xb2\xbc" // "レベリングカイシ" ("Click to Begin") -#define MSG_LEVEL_BED_NEXT_POINT "\xc2\xb7\xde\xc9\xbf\xb8\xc3\xb2\xc3\xdd\xcd" // "ツギノソクテイテンヘ" ("Next Point") -#define MSG_LEVEL_BED_DONE "\xda\xcd\xde\xd8\xdd\xb8\xde\xb6\xdd\xd8\xae\xb3" // "レベリングカンリョウ" ("Leveling Done!") -#define MSG_SET_HOME_OFFSETS "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2" // "キジュンオフセットセッテイ" ("Set home offsets") -#define MSG_HOME_OFFSETS_APPLIED "\xb5\xcc\xbe\xaf\xc4\xb6\xde\xc3\xb7\xd6\xb3\xbb\xda\xcf\xbc\xc0" // "オフセットガテキヨウサレマシタ" ("Offsets applied") -#define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "キジュンセット" ("Set origin") -#define MSG_PREHEAT_1 "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL "PLA \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "PLA スベテヨネツ" (" All") -#define MSG_PREHEAT_1_BEDONLY "PLA \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "PLA ベッドヨネツ" (" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") -#define MSG_PREHEAT_2 "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL "ABS \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "ABS スベテヨネツ" (" All") -#define MSG_PREHEAT_2_BEDONLY "ABS \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "ABS ベッドヨネツ" (" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") -#define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "カネツテイシ" ("Cooldown") -#define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xdd" // "デンゲン オン" ("Switch power on") -#define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "デンゲン オフ" ("Switch power off") -#define MSG_EXTRUDE "\xb5\xbc\xc0\xde\xbc" // "オシダシ" ("Extrude") -#define MSG_RETRACT "\xcb\xb7\xba\xd0\xbe\xaf\xc3\xb2" // "ヒキコミセッテイ" ("Retract") -#define MSG_MOVE_AXIS "\xbc\xde\xb8\xb2\xc4\xde\xb3" // "ジクイドウ" ("Move axis") -#define MSG_BED_LEVELING "\xcd\xde\xaf\xc4\xde\xda\xcd\xde\xd8\xdd\xb8\xde" // "ベッドレベリング" ("Bed Leveling") -#define MSG_LEVEL_BED "\xcd\xde\xaf\xc4\xde\xda\xcd\xde\xd8\xdd\xb8\xde" // "ベッドレベリング" ("Level bed") -#define MSG_MOVING "\xb2\xc4\xde\xb3\xc1\xad\xb3" // "イドウチュウ" ("Moving...") -#define MSG_FREE_XY "XY\xbc\xde\xb8\x20\xb6\xb2\xce\xb3" // "XYジク カイホウ" ("Free XY") -#define MSG_MOVE_X "X\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Xジク イドウ" ("Move X") -#define MSG_MOVE_Y "Y\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Yジク イドウ" ("Move Y") -#define MSG_MOVE_Z "Z\xbc\xde\xb8\x20\xb2\xc4\xde\xb3" // "Zジク イドウ" ("Move Z") -#define MSG_MOVE_E "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0" // "エクストルーダー" ("Extruder") -#define MSG_MOVE_01MM "0.1mm \xb2\xc4\xde\xb3" // "0.1mm イドウ" ("Move 0.1mm") -#define MSG_MOVE_1MM " 1mm \xb2\xc4\xde\xb3" // " 1mm イドウ" ("Move 1mm") -#define MSG_MOVE_10MM " 10mm \xb2\xc4\xde\xb3" // " 10mm イドウ" ("Move 10mm") -#define MSG_SPEED "\xbf\xb8\xc4\xde" // "ソクド" ("Speed") -#define MSG_BED_Z "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Bed Z") -#define MSG_NOZZLE "\xc9\xbd\xde\xd9" // "ノズル" ("Nozzle") -#define MSG_BED "\xcd\xde\xaf\xc4\xde" // "ベッド" ("Bed") -#define MSG_FAN_SPEED "\xcc\xa7\xdd\xbf\xb8\xc4\xde" // "ファンソクド" ("Fan speed") -#define MSG_FLOW "\xc4\xbc\xad\xc2\xd8\xae\xb3" // "トシュツリョウ" ("Flow") -#define MSG_CONTROL "\xbe\xb2\xb7\xde\xae" // "セイギョ" ("Control") -#define MSG_MIN LCD_STR_THERMOMETER " \xbb\xb2\xc3\xb2" // " サイテイ" (" Min") -#define MSG_MAX LCD_STR_THERMOMETER " \xbb\xb2\xba\xb3" // " サイコウ" (" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER " \xcc\xa7\xb8\xc0\xb0" // " ファクター" (" Fact") -#if LCD_WIDTH >= 20 - #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde\xbe\xb2\xb7\xde\xae" // "ジドウオンドセイギョ" ("Autotemp") -#else - #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp") -#endif -#define MSG_ON "\xb5\xdd " // "オン " ("On ") -#define MSG_OFF "\xb5\xcc " // "オフ " ("Off") -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select") -#define MSG_JERK "\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // ヤクド mm/s ("Jerk") -#if LCD_WIDTH >= 20 - #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Aジク ヤクド mm/s" ("Va-jerk") - #define MSG_VB_JERK "B\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Bジク ヤクド mm/s" ("Vb-jerk") - #define MSG_VC_JERK "C\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Cジク ヤクド mm/s" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Xジク ヤクド mm/s" ("Vx-jerk") - #define MSG_VB_JERK "Y\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Yジク ヤクド mm/s" ("Vy-jerk") - #define MSG_VC_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk") - #endif - #define MSG_VE_JERK "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\x20\xd4\xb8\xc4\xde" // "エクストルーダー ヤクド" ("Ve-jerk") - #define MSG_VMAX "\xbb\xb2\xc0\xde\xb2\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "サイダイオクリソクド " ("Vmax ") - #define MSG_VMIN "\xbb\xb2\xbc\xae\xb3\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "サイショウオクリソクド" ("Vmin") - #define MSG_VTRAV_MIN "\xbb\xb2\xbc\xae\xb3\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "サイショウイドウソクド" ("VTrav min") - #define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ") -#else - #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") - #if IS_KINEMATIC - #define MSG_VA_JERK "A\x20\xd4\xb8\xc4\xde" // "Aジク ヤクド" ("Va-jerk") - #define MSG_VB_JERK "B\x20\xd4\xb8\xc4\xde" // "Bジク ヤクド" ("Vb-jerk") - #define MSG_VC_JERK "C\x20\xd4\xb8\xc4\xde" // "Cジク ヤクド" ("Vc-jerk") - #else - #define MSG_VA_JERK "X\x20\xd4\xb8\xc4\xde" // "Xジク ヤクド" ("Vx-jerk") - #define MSG_VB_JERK "Y\x20\xd4\xb8\xc4\xde" // "Yジク ヤクド" ("Vy-jerk") - #define MSG_VC_JERK "Z\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") - #endif - #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk") - #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ") - #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin") - #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min") - #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ") -#endif -#define MSG_A_RETRACT "\xcb\xb7\xba\xd0\xb6\xbf\xb8\xc4\xde" // "ヒキコミカソクド" ("A-retract") -#define MSG_A_TRAVEL "\xb2\xc4\xde\xb3\xb6\xbf\xb8\xc4\xde" // "イドウカソクド" ("A-travel") -#if LCD_WIDTH >= 20 - #define MSG_STEPS_PER_MM "Steps/mm" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps/mm" - #define MSG_BSTEPS "Bsteps/mm" - #define MSG_CSTEPS "Csteps/mm" - #else - #define MSG_ASTEPS "Xsteps/mm" - #define MSG_BSTEPS "Ysteps/mm" - #define MSG_CSTEPS "Zsteps/mm" - #endif - #define MSG_ESTEPS "Esteps/mm" - #define MSG_E1STEPS "E1steps/mm" - #define MSG_E2STEPS "E2steps/mm" - #define MSG_E3STEPS "E3steps/mm" - #define MSG_E4STEPS "E4steps/mm" - #define MSG_E5STEPS "E5steps/mm" -#else - #define MSG_STEPS_PER_MM "Steps" - #if IS_KINEMATIC - #define MSG_ASTEPS "Asteps" - #define MSG_BSTEPS "Bsteps" - #define MSG_CSTEPS "Csteps" - #else - #define MSG_ASTEPS "Xsteps" - #define MSG_BSTEPS "Ysteps" - #define MSG_CSTEPS "Zsteps" - #endif - #define MSG_ESTEPS "Esteps" - #define MSG_E1STEPS "E1steps" - #define MSG_E2STEPS "E2steps" - #define MSG_E3STEPS "E3steps" - #define MSG_E4STEPS "E4steps" - #define MSG_E5STEPS "E5steps" -#endif -#define MSG_TEMPERATURE "\xb5\xdd\xc4\xde" // "オンド" ("Temperature") -#define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "ウゴキセッテイ" ("Motion") -#define MSG_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4" // "フィラメント" ("Filament") -#define MSG_VOLUMETRIC_ENABLED "E in mm3" -#if LCD_WIDTH >= 20 - #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xc1\xae\xaf\xb9\xb2" // "フィラメントチョッケイ" ("Fil. Dia.") -#else - #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.") -#endif -#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCDコントラスト" ("LCD contrast") -#define MSG_STORE_EEPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory") -#define MSG_LOAD_EEPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\xba\xd0" // "メモリカラヨミコミ" ("Load memory") -#define MSG_RESTORE_FAILSAFE "\xbe\xaf\xc3\xb2\xd8\xbe\xaf\xc4" // "セッテイリセット" ("Restore failsafe") -#define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "リフレッシュ" ("Refresh") -#define MSG_WATCH "\xbc\xde\xae\xb3\xce\xb3\xb6\xde\xd2\xdd" // "ジョウホウガメン" ("Info screen") -#define MSG_PREPARE "\xbc\xde\xad\xdd\xcb\xde\xbe\xaf\xc3\xb2" // "ジュンビセッテイ" ("Prepare") -#define MSG_TUNE "\xc1\xae\xb3\xbe\xb2" // "チョウセイ" ("Tune") -#define MSG_PAUSE_PRINT "\xb2\xc1\xbc\xde\xc3\xb2\xbc" // "イチジテイシ" ("Pause print") -#define MSG_RESUME_PRINT "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print") -#define MSG_STOP_PRINT "\xcc\xdf\xd8\xdd\xc4\xc3\xb2\xbc" // "プリントテイシ" ("Stop print") -#define MSG_CARD_MENU "SD\xb6\xb0\xc4\xde\xb6\xd7\xcc\xdf\xd8\xdd\xc4" // "SDカードカラプリント" ("Print from SD") -#define MSG_NO_CARD "SD\xb6\xb0\xc4\xde\xb6\xde\xb1\xd8\xcf\xbe\xdd" // "SDカードガアリマセン" ("No SD card") -#define MSG_DWELL "\xb7\xad\xb3\xbc" // "キュウシ" ("Sleep...") -#define MSG_USERWAIT "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("Wait for user...") -#define MSG_PRINT_ABORTED "\xcc\xdf\xd8\xdd\xc4\xb6\xde\xc1\xad\xb3\xbc\xbb\xda\xcf\xbc\xc0" // "プリントガチュウシサレマシタ" ("Print aborted") -#define MSG_NO_MOVE "\xb3\xba\xde\xb7\xcf\xbe\xdd" // "ウゴキマセン" ("No move.") -#define MSG_KILLED "\xcb\xbc\xde\xae\xb3\xc3\xb2\xbc" // "ヒジョウテイシ" ("KILLED. ") -#define MSG_STOPPED "\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "テイシシマシタ" ("STOPPED. ") -#if LCD_WIDTH >= 20 - #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3 mm" // "ヒキコミリョウ mm" ("Retract mm") - #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S mm" // "ヒキコミリョウS mm" ("Swap Re.mm") - #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde mm/s" // "ヒキコミソクド mm/s" ("Retract V") - #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb mm" // "ノズルタイヒ mm" ("Hop mm") - #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3 mm" // "ホショウリョウ mm" ("UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S mm" // "ホショウリョウS mm" ("S UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde mm/s" // "ホショウソクド mm/s" ("UnRet V") -#else - #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm") - #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm") - #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V") - #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm") - #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet mm") - #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V") -#endif -#define MSG_AUTORETRACT "\xbc\xde\xc4\xde\xb3\xcb\xb7\xba\xd0" // "ジドウヒキコミ" ("AutoRetr.") -#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("Change filament") -#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "SDカードサイヨミコミ" ("Init. SD card") -#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "SDカードコウカン" ("Change SD card") -#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde\x20\xcd\xde\xaf\xc4\xde\xb6\xde\xb2" // "Zプローブ ベッドガイ" ("Z probe out. bed") -#if LCD_WIDTH >= 20 - #define MSG_BLTOUCH_SELFTEST "BLTouch \xbc\xde\xba\xbc\xdd\xc0\xde\xdd" // "BLTouch ジコシンダン" ("BLTouch Self-Test") -#else - #define MSG_BLTOUCH_SELFTEST "BLTouch \xbe\xd9\xcc\xc3\xbd\xc4" // "BLTouch セルフテスト" ("BLTouch Self-Test") -#endif -#define MSG_BLTOUCH_RESET "BLTouch \xd8\xbe\xaf\xc4" // "BLTouch リセット" ("Reset BLTouch") -#define MSG_HOME "\xbb\xb7\xc6" // "サキニ" ("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#if LCD_WIDTH >= 20 - #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "ヲフッキサセテクダサイ" ("first") -#else - #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "ヲフッキサセヨ" ("first") -#endif -#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Z Offset") -#define MSG_BABYSTEP_X "X\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Xジク ビドウ" ("Babystep X") -#define MSG_BABYSTEP_Y "Y\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Yジク ビドウ" ("Babystep Y") -#define MSG_BABYSTEP_Z "Z\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Zジク ビドウ" ("Babystep Z") -#if LCD_WIDTH >= 20 - #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1\xb7\xc9\xb3" // "イドウゲンカイケンチキノウ" ("Endstop abort") -#else - #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort") -#endif -#define MSG_HEATING_FAILED_LCD "\xb6\xc8\xc2\xbc\xaf\xca\xdf\xb2" // "カネツシッパイ" ("Heating failed") -#if LCD_WIDTH >= 20 - #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0\xb0\xb7\xc9\xb3" // "エラー:ジョウチョウサーミスターキノウ" ("Err: REDUNDANT TEMP") -#else - #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP") -#endif -#define MSG_THERMAL_RUNAWAY "\xc8\xc2\xce\xde\xb3\xbf\xb3" // "ネツボウソウ" ("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP "\xb4\xd7\xb0:\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:サイコウオンチョウカ" ("Err: MAXTEMP") -#define MSG_ERR_MINTEMP "\xb4\xd7\xb0:\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:サイテイオンミマン" ("Err: MINTEMP") -#if LCD_WIDTH >= 20 - #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:ベッド サイコウオンチョウカ" ("Err: MAXTEMP BED") - #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:ベッド サイテイオンミマン" ("Err: MINTEMP BED") -#else - #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED") - #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED") -#endif -#define MSG_ERR_Z_HOMING MSG_HOME " " MSG_X MSG_Y " " MSG_FIRST // "サキニ XY ヲフッキサセテクダサイ" or "サキニ XY ヲフッキサセヨ" ("G28 Z Forbidden") -#define MSG_HALTED "\xcc\xdf\xd8\xdd\xc0\xb0\xca\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "プリンターハテイシシマシタ" ("PRINTER HALTED") -#define MSG_PLEASE_RESET "\xd8\xbe\xaf\xc4\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "リセットシテクダサイ" ("Please reset") -#define MSG_SHORT_DAY "d" // One character only -#define MSG_SHORT_HOUR "h" // One character only -#define MSG_SHORT_MINUTE "m" // One character only -#define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...") -#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating...") -#define MSG_DELTA_CALIBRATE "\xc3\xde\xd9\xc0\x20\xba\xb3\xbe\xb2" // "デルタ コウセイ" ("Delta Calibration") -#define MSG_DELTA_CALIBRATE_X "X\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Xジク コウセイ" ("Calibrate X") -#define MSG_DELTA_CALIBRATE_Y "Y\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Yジク コウセイ" ("Calibrate Y") -#define MSG_DELTA_CALIBRATE_Z "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") -#define MSG_DELTA_CALIBRATE_CENTER "\xc1\xad\xb3\xbc\xdd\x20\xba\xb3\xbe\xb2" // "チュウシン コウセイ" ("Calibrate Center") -#define MSG_INFO_MENU "\xba\xc9\xcc\xdf\xd8\xdd\xc0\xb0\xc6\xc2\xb2\xc3" // "コノプリンターニツイテ" ("About Printer") -#define MSG_INFO_PRINTER_MENU "\xcc\xdf\xd8\xdd\xc0\xb0\xbc\xde\xae\xb3\xce\xb3" // "プリンタージョウホウ" ("Printer Info") -#define MSG_INFO_STATS_MENU "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xae\xb3\xb7\xae\xb3" // "プリントジョウキョウ" ("Printer Stats") -#define MSG_INFO_BOARD_MENU "\xbe\xb2\xb7\xde\xae\xb9\xb2\xbc\xde\xae\xb3\xce\xb3" // "セイギョケイジョウホウ" ("Board Info") -#define MSG_INFO_THERMISTOR_MENU "\xbb\xb0\xd0\xbd\xc0\xb0" // "サーミスター" ("Thermistors") -#define MSG_INFO_EXTRUDERS "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\xbd\xb3" // "エクストルーダースウ" ("Extruders") -#define MSG_INFO_BAUDRATE "\xce\xde\xb0\xda\xb0\xc4" // "ボーレート" ("Baud") -#define MSG_INFO_PROTOCOL "\xcc\xdf\xdb\xc4\xba\xd9" // "プロトコル" ("Protocol") -#define MSG_CASE_LIGHT "\xb7\xae\xb3\xc0\xb2\xc5\xb2\xbc\xae\xb3\xd2\xb2" // "キョウタイナイショウメイ" ("Case light") -#define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3" // "プリントスウ" ("Print Count") -#define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed") -#define MSG_INFO_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd\xd9\xb2\xb9\xb2" // "プリントジカンルイケイ" ("Total print time") -#define MSG_INFO_PRINT_LONGEST "\xbb\xb2\xc1\xae\xb3\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "サイチョウプリントジカン" ("Longest job time") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbc\xd6\xb3\xd8\xae\xb3\xd9\xb2\xb9\xb2" // "フィラメントシヨウリョウルイケイ" ("Extruded total") -#else - #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xbc\xd6\xb3\xd8\xae\xb3" // "フィラメントソウシヨウリョウ" ("Extruded") -#endif -#define MSG_INFO_MIN_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xc3\xb2\xb5\xdd" // "セッテイサイテイオン" ("Min Temp") -#define MSG_INFO_MAX_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xba\xb3\xb5\xdd" // "セッテイサイコウオン" ("Max Temp") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd\xbc\xad\xcd\xde\xc2" // "デンゲンシュベツ" ("Power Supply") -#else - #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd" // "デンゲン" ("Power Supply") -#endif -#define MSG_DRIVE_STRENGTH "\xd3\xb0\xc0\xb0\xb8\xc4\xde\xb3\xd8\xae\xb8" // "モータークドウリョク" ("Drive Strength") -#if LCD_WIDTH >= 20 - #define MSG_DAC_PERCENT "DAC\xbc\xad\xc2\xd8\xae\xb8 %" // "DACシュツリョク %" ("Driver %") -#else - #define MSG_DAC_PERCENT "DAC\xbc\xad\xc2\xd8\xae\xb8" // "DACシュツリョク" ("Driver %") -#endif -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "メモリヘカクノウ" ("DAC EEPROM Write") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Wait for start") - #define MSG_FILAMENT_CHANGE_INIT_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("of the filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Wait for") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament unload") - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xa6\xbf\xb3\xc6\xad\xb3\xbc," // "フィラメントヲソウニュウシ," ("Insert filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 "\xb8\xd8\xaf\xb8\xbd\xd9\xc4\xbf\xde\xaf\xba\xb3\xbc\xcf\xbd" // "クリックスルトゾッコウシマス" ("and press button") - #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Wait for") - #define MSG_FILAMENT_CHANGE_LOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament load") - #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("to resume") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Please wait...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Ejecting...") - #if LCD_WIDTH >= 20 - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ソウニュウシ,クリックシテクダサイ" ("Insert and Click") - #else - #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbe\xd6" // "ソウニュウシ,クリックセヨ" ("Insert and Click") - #endif - #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Loading...") - #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Resuming...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_KANA_H diff --git a/Marlin_thinkerV2/Marlin/language_kana_utf8.h b/Marlin_thinkerV2/Marlin/language_kana_utf8.h deleted file mode 100644 index 050f3277a7..0000000000 --- a/Marlin_thinkerV2/Marlin/language_kana_utf8.h +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Japanese (Kana) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#ifndef LANGUAGE_KANA_UTF_H -#define LANGUAGE_KANA_UTF_H - -#define MAPPER_E382E383 -#define DISPLAY_CHARSET_ISO10646_KANA -#define CHARSIZE 3 - -// This just to show the potential benefit of unicode. -// This translation can be improved by using the full charset of unicode codeblock U+30A0 to U+30FF. - -// 片仮名表示定義 -#define WELCOME_MSG MACHINE_NAME _UxGT(" ready.") -#define MSG_SD_INSERTED _UxGT("カードガソウニュウサレマシタ") // "Card inserted" -#define MSG_SD_REMOVED _UxGT("カードガアリマセン") // "Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("エンドストップ") // "Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("メイン") // "Main" -#define MSG_AUTOSTART _UxGT("ジドウカイシ") // "Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("モーターデンゲン オフ") // "Disable steppers" -#define MSG_DEBUG_MENU _UxGT("デバッグメニュー") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("プログレスバー テスト") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("ゲンテンフッキ") // "Auto home" -#define MSG_AUTO_HOME_X _UxGT("Xジク ゲンテンフッキ") // "Home X" -#define MSG_AUTO_HOME_Y _UxGT("Yジク ゲンテンフッキ") // "Home Y" -#define MSG_AUTO_HOME_Z _UxGT("Zジク ゲンテンフッキ") // "Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("Zジク コウセイ") // "Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("ゲンテンフッキチュウ") // "Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("レベリングカイシ") // "Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("ツギノソクテイテンヘ") // "Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("レベリングカンリョウ") // "Leveling Done!" -#define MSG_SET_HOME_OFFSETS _UxGT("キジュンオフセットセッテイ") // "Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("オフセットガテキヨウサレマシタ") // "Offsets applied" -#define MSG_SET_ORIGIN _UxGT("キジュンセット") // "Set origin" -#define MSG_PREHEAT_1 _UxGT("PLA ヨネツ") // "Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("PLA スベテヨネツ") // " All" -#define MSG_PREHEAT_1_BEDONLY _UxGT("PLA ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("セッテイ") // " conf" -#define MSG_PREHEAT_2 _UxGT("ABS ヨネツ") // "Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL _UxGT("ABS スベテヨネツ") // " All" -#define MSG_PREHEAT_2_BEDONLY _UxGT("ABS ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("セッテイ") // " conf" -#define MSG_COOLDOWN _UxGT("カネツテイシ") // "Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("デンゲン オン") // "Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("デンゲン オフ") // "Switch power off" -#define MSG_EXTRUDE _UxGT("オシダシ") // "Extrude" -#define MSG_RETRACT _UxGT("ヒキコミセッテイ") // "Retract" -#define MSG_MOVE_AXIS _UxGT("ジクイドウ") // "Move axis" -#define MSG_BED_LEVELING _UxGT("ベッドレベリング") // "Bed leveling" -#define MSG_LEVEL_BED _UxGT("ベッドレベリング") // "Level bed" -#define MSG_MOVING _UxGT("イドウチュウ...") // "Moving..." -#define MSG_FREE_XY _UxGT("XYジク カイホウ") // "Free XY" -#define MSG_MOVE_X _UxGT("Xジク イドウ") // "Move X" -#define MSG_MOVE_Y _UxGT("Yジク イドウ") // "Move Y" -#define MSG_MOVE_Z _UxGT("Zジク イドウ") // "Move Z" -#define MSG_MOVE_E _UxGT("エクストルーダー") // "Extruder" -#define MSG_MOVE_01MM _UxGT("0.1mm イドウ") // "Move 0.1mm" -#define MSG_MOVE_1MM _UxGT(" 1mm イドウ") // "Move 1mm" -#define MSG_MOVE_10MM _UxGT(" 10mm イドウ") // "Move 10mm" -#define MSG_SPEED _UxGT("ソクド") // "Speed" -#define MSG_BED_Z _UxGT("Zオフセット") // "Bed Z" -#define MSG_NOZZLE _UxGT("ノズル") // "Nozzle" -#define MSG_BED _UxGT("ベッド") // "Bed" -#define MSG_FAN_SPEED _UxGT("ファンソクド") // "Fan speed" -#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_ON _UxGT("オン ") // "On " -#define MSG_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("センタク") // "Select" -#define MSG_ACC _UxGT("カソクド mm/s2") // "Accel" -#define MSG_JERK _UxGT("ヤクド mm/s") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Aジク ヤクド mm/s") // "Va-jerk" - #define MSG_VB_JERK _UxGT("Bジク ヤクド mm/s") // "Vb-jerk" - #define MSG_VC_JERK _UxGT("Cジク ヤクド mm/s") // "Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("Xジク ヤクド mm/s") // "Vx-jerk" - #define MSG_VB_JERK _UxGT("Yジク ヤクド mm/s") // "Vy-jerk" - #define MSG_VC_JERK _UxGT("Zジク ヤクド mm/s") // "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_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("サイダイカソクド ") // "Amax " -#define MSG_A_RETRACT _UxGT("ヒキコミカソクド") // "A-retract" -#define MSG_A_TRAVEL _UxGT("イドウカソクド") // "A-travel" -#define MSG_TEMPERATURE _UxGT("オンド") // "Temperature" -#define MSG_MOTION _UxGT("ウゴキセッテイ") // "Motion" -#define MSG_FILAMENT _UxGT("フィラメント") // "Filament" -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("フィラメントチョッケイ") // "Fil. Dia." -#define MSG_CONTRAST _UxGT("LCDコントラスト") // "LCD contrast" -#define MSG_STORE_EEPROM _UxGT("メモリヘカクノウ") // "Store memory" -#define MSG_LOAD_EEPROM _UxGT("メモリカラヨミコミ") // "Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("セッテイリセット") // "Restore failsafe" -#define MSG_REFRESH _UxGT("リフレッシュ") // "Refresh" -#define MSG_WATCH _UxGT("ジョウホウガメン") // "Info screen" -#define MSG_PREPARE _UxGT("ジュンビセッテイ") // "Prepare" -#define MSG_TUNE _UxGT("チョウセイ") // "Tune" -#define MSG_PAUSE_PRINT _UxGT("イチジテイシ") // "Pause print" -#define MSG_RESUME_PRINT _UxGT("プリントサイカイ") // "Resume print" -#define MSG_STOP_PRINT _UxGT("プリントテイシ") // "Stop print" -#define MSG_CARD_MENU _UxGT("SDカードカラプリント") // "Print from SD" -#define MSG_NO_CARD _UxGT("SDカードガアリマセン") // "No SD card" -#define MSG_DWELL _UxGT("キュウシ...") // "Sleep..." -#define MSG_USERWAIT _UxGT("シバラクオマチクダサイ...") // "Wait for user..." -#define MSG_PRINT_ABORTED _UxGT("プリントガチュウシサレマシタ") // "Print aborted" -#define MSG_NO_MOVE _UxGT("ウゴキマセン") // "No move." -#define MSG_KILLED _UxGT("ヒジョウテイシ") // "KILLED. " -#define MSG_STOPPED _UxGT("テイシシマシタ") // "STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("ヒキコミリョウ mm") // "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP _UxGT("ヒキコミリョウS mm") // "Swap Re.mm" -#define MSG_CONTROL_RETRACTF _UxGT("ヒキコミソクド mm/s") // "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("ノズルタイヒ mm") // "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("ホショウリョウ mm") // "UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("ホショウリョウS mm") // "S UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("ホショウソクド mm/s") // "UnRet V" -#define MSG_AUTORETRACT _UxGT("ジドウヒキコミ") // "AutoRetr." -#define MSG_FILAMENTCHANGE _UxGT("フィラメントコウカン") // "Change filament" -#define MSG_INIT_SDCARD _UxGT("SDカードサイヨミコミ") // "Init. SD card" -#define MSG_CNG_SDCARD _UxGT("SDカードコウカン") // "Change SD card" -#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_ZPROBE_ZOFFSET _UxGT("Zオフセット") // "Z Offset" -#define MSG_BABYSTEP_X _UxGT("Xジク ビドウ") // "Babystep X" -#define MSG_BABYSTEP_Y _UxGT("Yジク ビドウ") // "Babystep Y" -#define MSG_BABYSTEP_Z _UxGT("Zジク ビドウ") // "Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("イドウゲンカイケンチキノウ") // "Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("カネツシッパイ") // "Heating failed" -#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 // "G28 Z Forbidden" -#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("カネツチュウ...") // "Heating..." -#define MSG_BED_HEATING _UxGT("ベッド カネツチュウ...") // "Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("デルタ コウセイ") // "Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("Xジク コウセイ") // "Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("Yジク コウセイ") // "Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("Zジク コウセイ") // "Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("チュウシン コウセイ") // "Calibrate Center" -#define MSG_INFO_MENU _UxGT("コノプリンターニツイテ") // "About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("プリンタージョウホウ") // "Printer Info" -#define MSG_INFO_STATS_MENU _UxGT("プリントジョウキョウ") // "Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("セイギョケイジョウホウ") // "Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("サーミスター") // "Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("エクストルーダースウ") // "Extruders" -#define MSG_INFO_BAUDRATE _UxGT("ボーレート") // "Baud" -#define MSG_INFO_PROTOCOL _UxGT("プロトコル") // "Protocol" -#define MSG_CASE_LIGHT _UxGT("キョウタイナイショウメイ") // "Case light" -#define MSG_INFO_PRINT_COUNT _UxGT("プリントスウ ") // "Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("カンリョウスウ") // "Completed" -#define MSG_INFO_PRINT_TIME _UxGT("プリントジカンルイケイ") // "Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("サイチョウプリントジカン") // "Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("フィラメントシヨウリョウルイケイ") // "Extruded total" -#define MSG_INFO_MIN_TEMP _UxGT("セッテイサイテイオン") // "Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("セッテイサイコウオン") // "Max Temp" -#define MSG_INFO_PSU _UxGT("デンゲンシュベツ") // "Power Supply" -#define MSG_DRIVE_STRENGTH _UxGT("モータークドウリョク") // "Drive Strength" -#define MSG_DAC_PERCENT _UxGT("DACシュツリョク %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "DAC EEPROM Write" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("プリントサイカイ") // "Resume print" -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("コウカンヲカイシシマス") // "Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("シバラクオマチクダサイ") // "of the filament" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("フィラメントヌキダシチュウ") // "Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("シバラクオマチクダサイ") // "filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("フィラメントヲソウニュウシ,") // "Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("クリックスルトゾッコウシマス") // "and press button" -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("フィラメントソウテンチュウ") // "Wait for" -#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" - -#endif // LANGUAGE_KANA_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_nl.h b/Marlin_thinkerV2/Marlin/language_nl.h deleted file mode 100644 index 128bceaf41..0000000000 --- a/Marlin_thinkerV2/Marlin/language_nl.h +++ /dev/null @@ -1,283 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Dutch - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_NL_H -#define LANGUAGE_NL_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gereed.") -#define MSG_BACK _UxGT("Terug") -#define MSG_SD_INSERTED _UxGT("Kaart ingestoken") -#define MSG_SD_REMOVED _UxGT("Kaart verwijderd") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Hoofdmenu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren uit") -#define MSG_DEBUG_MENU _UxGT("Debug Menu") //accepted English terms -#define MSG_PROGRESS_BAR_TEST _UxGT("Vooruitgang Test") -#define MSG_AUTO_HOME _UxGT("Auto home") -#define MSG_AUTO_HOME_X _UxGT("Home X") -#define MSG_AUTO_HOME_Y _UxGT("Home Y") -#define MSG_AUTO_HOME_Z _UxGT("Home Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibreer Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik voor begin") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Volgende Plaats") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level kompl.") -#define MSG_SET_HOME_OFFSETS _UxGT("Zet home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("H offset toegep.") -#define MSG_SET_ORIGIN _UxGT("Nulpunt instellen") -#define MSG_PREHEAT_1 _UxGT("PLA voorverwarmen") -#define MSG_PREHEAT_1_N _UxGT("PLA voorverw. ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("aan") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Einde") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("PLA verw. conf") -#define MSG_PREHEAT_2 _UxGT("ABS voorverwarmen") -#define MSG_PREHEAT_2_N _UxGT("ABS voorverw. ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("aan") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Einde") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("ABS verw. conf") -#define MSG_COOLDOWN _UxGT("Afkoelen") -#define MSG_SWITCH_PS_ON _UxGT("Stroom aan") -#define MSG_SWITCH_PS_OFF _UxGT("Stroom uit") -#define MSG_EXTRUDE _UxGT("Extrude") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("As verplaatsen") -#define MSG_BED_LEVELING _UxGT("Bed Leveling") -#define MSG_LEVEL_BED _UxGT("Level bed") -#define MSG_MOVING _UxGT("Verplaatsen...") -#define MSG_FREE_XY _UxGT("Vrij XY") -#define MSG_MOVE_X _UxGT("Verplaats X") -#define MSG_MOVE_Y _UxGT("Verplaats Y") -#define MSG_MOVE_Z _UxGT("Verplaats Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_01MM _UxGT("Verplaats 0.1mm") -#define MSG_MOVE_1MM _UxGT("Verplaats 1mm") -#define MSG_MOVE_10MM _UxGT("Verplaats 10mm") -#define MSG_SPEED _UxGT("Snelheid") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Bed") -#define MSG_FAN_SPEED _UxGT("Fan snelheid") -#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_ON _UxGT("Aan ") -#define MSG_OFF _UxGT("Uit") -#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("Selecteer") -#define MSG_ACC _UxGT("Versn") -#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_TEMPERATURE _UxGT("Temperatuur") -#define MSG_MOTION _UxGT("Beweging") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_ADVANCE_K _UxGT("Advance K") //accepted english dutch -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD contrast") -#define MSG_STORE_EEPROM _UxGT("Geheugen opslaan") -#define MSG_LOAD_EEPROM _UxGT("Geheugen laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Noodstop reset") -#define MSG_REFRESH _UxGT("Ververs") -#define MSG_WATCH _UxGT("Info scherm") -#define MSG_PREPARE _UxGT("Voorbereiden") -#define MSG_TUNE _UxGT("Afstellen") -#define MSG_PAUSE_PRINT _UxGT("Print pauzeren") -#define MSG_RESUME_PRINT _UxGT("Print hervatten") -#define MSG_STOP_PRINT _UxGT("Print stoppen") -#define MSG_CARD_MENU _UxGT("Print van SD") -#define MSG_NO_CARD _UxGT("Geen SD kaart") -#define MSG_DWELL _UxGT("Slapen...") -#define MSG_USERWAIT _UxGT("Wachten...") -#define MSG_PRINT_ABORTED _UxGT("Print afgebroken") -#define MSG_NO_MOVE _UxGT("Geen beweging.") -#define MSG_KILLED _UxGT("Afgebroken. ") -#define MSG_STOPPED _UxGT("Gestopt. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") //accepted English term in Dutch -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ruil Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ruil UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet F") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Verv. Filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD kaart") -#define MSG_CNG_SDCARD _UxGT("Verv. SD Kaart") -#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_ZPROBE_ZOFFSET _UxGT("Z Offset") //accepted English term in Dutch -#define MSG_BABYSTEP_X _UxGT("Babystap X") -#define MSG_BABYSTEP_Y _UxGT("Babystap Y") -#define MSG_BABYSTEP_Z _UxGT("Babystap Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop afbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("Voorverw. fout") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Redun. temp fout") -#define MSG_THERMAL_RUNAWAY _UxGT("Therm. wegloop") -#define MSG_ERR_MAXTEMP _UxGT("Err: Max. temp") -#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_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 -#define MSG_SHORT_HOUR _UxGT("h") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Voorwarmen...") -#define MSG_BED_HEATING _UxGT("Bed voorverw...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Calibratie") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibreer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibreer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibreer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibreer Midden") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibratie") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Zet Delta Hoogte") - -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") //accepted English term in Dutch -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_MENU _UxGT("Over Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Case licht") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Printed Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Totaal Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Totale Printtijd") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste Printtijd") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totaal Extrudeert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Printtijd ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("PSU") //accepted English term in Dutch - -#define MSG_DRIVE_STRENGTH _UxGT("Motorstroom") -#define MSG_DAC_PERCENT _UxGT("Driver %") //accepted English term in Dutch -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC Opslaan") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Hervat print") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") //accepeted English term -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - // Up to 3 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filament te") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("verwisselen") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament uit") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("te laden") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozzle verw.") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Wacht a.u.b.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("om verder...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament te") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("laden") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("om verder") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("te gaan") -#else // LCD_HEIGHT < 4 - // Up to 2 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("start...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("uitladen...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Verwarmen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("inladen...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("printing...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_NL_H diff --git a/Marlin_thinkerV2/Marlin/language_pl-DOGM.h b/Marlin_thinkerV2/Marlin/language_pl-DOGM.h deleted file mode 100644 index 5839325726..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pl-DOGM.h +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish for DOGM display - includes accented characters - */ - -#ifndef LANGUAGE_PL_DOGM_H -#define LANGUAGE_PL_DOGM_H -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") -#define MSG_SD_INSERTED _UxGT("Karta włożona") -#define MSG_SD_REMOVED _UxGT("Karta usunięta") -#define MSG_LCD_ENDSTOPS _UxGT("Kranców.") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu główne") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Wyłącz silniki") -#define MSG_AUTO_HOME _UxGT("Pozycja zerowa") -#define MSG_AUTO_HOME_X _UxGT("Zeruj X") -#define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") -#define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") -#define MSG_LEVEL_BED _UxGT("Poziom. stołu") -#define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Następny punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Wypoziomowano!") -#define MSG_USER_MENU _UxGT("Własne Polecenia") -#define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") -#define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stół PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. PLA") -#define MSG_PREHEAT_2 _UxGT("Rozgrzej ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stół ABS") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. ABS") -#define MSG_COOLDOWN _UxGT("Chłodzenie") -#define MSG_SWITCH_PS_ON _UxGT("Włącz zasilacz") -#define MSG_SWITCH_PS_OFF _UxGT("Wyłącz zasilacz") -#define MSG_EXTRUDE _UxGT("Ekstruzja") -#define MSG_RETRACT _UxGT("Wycofanie") -#define MSG_MOVE_AXIS _UxGT("Ruch osi") -#define MSG_BED_LEVELING _UxGT("Poziom. stołu") -#define MSG_MOVE_X _UxGT("Przesuń w X") -#define MSG_MOVE_Y _UxGT("Przesuń w Y") -#define MSG_MOVE_Z _UxGT("Przesuń w Z") -#define MSG_MOVE_E _UxGT("Ekstruzja (os E)") -#define MSG_MOVE_01MM _UxGT("Przesuń co .1mm") -#define MSG_MOVE_1MM _UxGT("Przesuń co 1mm") -#define MSG_MOVE_10MM _UxGT("Przesuń co 10mm") -#define MSG_SPEED _UxGT("Predkość") -#define MSG_BED_Z _UxGT("Stół Z") -#define MSG_NOZZLE _UxGT("Dysza") -#define MSG_BED _UxGT("Stół") -#define MSG_FAN_SPEED _UxGT("Obroty wiatraka") -#define MSG_FLOW _UxGT("Przepływ") -#define MSG_CONTROL _UxGT("Ustawienia") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnożnik") -#define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_ON _UxGT("Wł. ") -#define MSG_OFF _UxGT("Wył.") -#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("Select") -#define MSG_ACC _UxGT("Przyśpieszenie") -#define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif -#define MSG_VE_JERK _UxGT("Zryw Ve") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vskok min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax") -#define MSG_A_RETRACT _UxGT("A-wycofanie") -#define MSG_A_TRAVEL _UxGT("A-przesuń.") -#define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif -#define MSG_ESTEPS _UxGT("krokiE/mm") -#define MSG_E1STEPS _UxGT("krokiE1/mm") -#define MSG_E2STEPS _UxGT("krokiE2/mm") -#define MSG_E3STEPS _UxGT("krokiE3/mm") -#define MSG_E4STEPS _UxGT("krokiE4/mm") -#define MSG_E5STEPS _UxGT("krokiE5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Ruch") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") -#define MSG_FILAMENT_DIAM _UxGT("Śr. fil.") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Zapisz w pamięci") -#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamięci") -#define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") -#define MSG_REFRESH _UxGT("Odswież") -#define MSG_WATCH _UxGT("Ekran główny") -#define MSG_PREPARE _UxGT("Przygotuj") -#define MSG_TUNE _UxGT("Strojenie") -#define MSG_PAUSE_PRINT _UxGT("Pauza") -#define MSG_RESUME_PRINT _UxGT("Wznowienie") -#define MSG_STOP_PRINT _UxGT("Stop") -#define MSG_CARD_MENU _UxGT("Karta SD") -#define MSG_NO_CARD _UxGT("Brak karty") -#define MSG_DWELL _UxGT("Uśpij...") -#define MSG_USERWAIT _UxGT("Oczekiwanie...") -#define MSG_PRINT_ABORTED _UxGT("Druk przerwany") -#define MSG_NO_MOVE _UxGT("Brak ruchu") -#define MSG_KILLED _UxGT("Ubity. ") -#define MSG_STOPPED _UxGT("Zatrzymany. ") -#define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Skok Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") -#define MSG_AUTORETRACT _UxGT("Auto. wycofanie") -#define MSG_FILAMENTCHANGE _UxGT("Zmień filament") -#define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CNG_SDCARD _UxGT("Zmiana karty SD") -#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_ZPROBE_ZOFFSET _UxGT("Offset Z") -#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("Błąd krańcówki") -#define MSG_HEATING_FAILED_LCD _UxGT("Rozgrz. nieudane") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Błąd temperatury") -#define MSG_THERMAL_RUNAWAY _UxGT("Zanik temp.") -#define MSG_ERR_MAXTEMP _UxGT("Err max temp") -#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_HALTED _UxGT("Drukarka zatrzym.") -#define MSG_PLEASE_RESET _UxGT("Proszę zresetować") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("g") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Rozgrzewanie...") -#define MSG_BED_HEATING _UxGT("Rozgrzewanie stołu...") -#define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibruj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibruj środek") - -#define MSG_INFO_MENU _UxGT("O drukarce") -#define MSG_INFO_PRINTER_MENU _UxGT("Info drukarki") -#define MSG_INFO_STATS_MENU _UxGT("Statystyki") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistory") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstrudery") -#define MSG_INFO_BAUDRATE _UxGT("Predkość USB") -#define MSG_INFO_PROTOCOL _UxGT("Protokół") -#define MSG_CASE_LIGHT _UxGT("Oświetlenie") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Czas druku") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Razem") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Zasilacz") - -#define MSG_DRIVE_STRENGTH _UxGT("Siła silnika") -#define MSG_DAC_PERCENT _UxGT("Siła %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEŃ FILAMENT") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEŃ OPCJE:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznów drukowanie") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmianę filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjęcie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i naciśnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuować...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("włożenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Proszę czekać...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóż i naciśnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ładowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_PL_DOGM_H diff --git a/Marlin_thinkerV2/Marlin/language_pl-HD44780.h b/Marlin_thinkerV2/Marlin/language_pl-HD44780.h deleted file mode 100644 index 933b5b9e53..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pl-HD44780.h +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish for HD44780 display - no accented characters - */ - -#ifndef LANGUAGE_PL_HD44780_H -#define LANGUAGE_PL_HD44780_H - -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") -#define MSG_SD_INSERTED _UxGT("Karta wlozona") -#define MSG_SD_REMOVED _UxGT("Karta usunieta") -#define MSG_LCD_ENDSTOPS _UxGT("Krancow.") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu glowne") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Wylacz silniki") -#define MSG_AUTO_HOME _UxGT("Pozycja zerowa") -#define MSG_AUTO_HOME_X _UxGT("Zeruj X") -#define MSG_AUTO_HOME_Y _UxGT("Zeruj Y") -#define MSG_AUTO_HOME_Z _UxGT("Zeruj Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibruj Z") -#define MSG_LEVEL_BED _UxGT("Poziom. stolu") -#define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nastepny punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Wypoziomowano!") -#define MSG_USER_MENU _UxGT("Wlasne Polecenia") -#define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") -#define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stol PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. PLA") -#define MSG_PREHEAT_2 _UxGT("Rozgrzej ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stol ABS") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. ABS") -#define MSG_COOLDOWN _UxGT("Chlodzenie") -#define MSG_SWITCH_PS_ON _UxGT("Wlacz zasilacz") -#define MSG_SWITCH_PS_OFF _UxGT("Wylacz zasilacz") -#define MSG_EXTRUDE _UxGT("Ekstruzja") -#define MSG_RETRACT _UxGT("Wycofanie") -#define MSG_MOVE_AXIS _UxGT("Ruch osi") -#define MSG_BED_LEVELING _UxGT("Poziom. stolu") -#define MSG_MOVE_X _UxGT("Przesun w X") -#define MSG_MOVE_Y _UxGT("Przesun w Y") -#define MSG_MOVE_Z _UxGT("Przesun w Z") -#define MSG_MOVE_E _UxGT("Ekstruzja (os E)") -#define MSG_MOVE_01MM _UxGT("Przesun co .1mm") -#define MSG_MOVE_1MM _UxGT("Przesun co 1mm") -#define MSG_MOVE_10MM _UxGT("Przesun co 10mm") -#define MSG_SPEED _UxGT("Predkosc") -#define MSG_BED_Z _UxGT("Stol Z") -#define MSG_NOZZLE _UxGT("Dysza") -#define MSG_BED _UxGT("Stol") -#define MSG_FAN_SPEED _UxGT("Obroty wiatraka") -#define MSG_FLOW _UxGT("Przeplyw") -#define MSG_CONTROL _UxGT("Ustawienia") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnoznik") -#define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_ON _UxGT("Wl. ") -#define MSG_OFF _UxGT("Wyl.") -#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("Select") -#define MSG_ACC _UxGT("Przyspieszenie") -#define MSG_JERK _UxGT("Zryw") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Zryw Va") - #define MSG_VB_JERK _UxGT("Zryw Vb") - #define MSG_VC_JERK _UxGT("Zryw Vc") -#else - #define MSG_VA_JERK _UxGT("Zryw Vx") - #define MSG_VB_JERK _UxGT("Zryw Vy") - #define MSG_VC_JERK _UxGT("Zryw Vz") -#endif -#define MSG_VE_JERK _UxGT("Zryw Ve") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vskok min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax") -#define MSG_A_RETRACT _UxGT("A-wycofanie") -#define MSG_A_TRAVEL _UxGT("A-przesun.") -#define MSG_STEPS_PER_MM _UxGT("kroki/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("krokiA/mm") - #define MSG_BSTEPS _UxGT("krokiB/mm") - #define MSG_CSTEPS _UxGT("krokiC/mm") -#else - #define MSG_ASTEPS _UxGT("krokiX/mm") - #define MSG_BSTEPS _UxGT("krokiY/mm") - #define MSG_CSTEPS _UxGT("krokiZ/mm") -#endif -#define MSG_ESTEPS _UxGT("krokiE/mm") -#define MSG_E1STEPS _UxGT("krokiE1/mm") -#define MSG_E2STEPS _UxGT("krokiE2/mm") -#define MSG_E3STEPS _UxGT("krokiE3/mm") -#define MSG_E4STEPS _UxGT("krokiE4/mm") -#define MSG_E5STEPS _UxGT("krokiE5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Ruch") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") -#define MSG_FILAMENT_DIAM _UxGT("Sr. fil.") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Zapisz w pamieci") -#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamieci") -#define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") -#define MSG_REFRESH _UxGT("Odswiez") -#define MSG_WATCH _UxGT("Ekran glowny") -#define MSG_PREPARE _UxGT("Przygotuj") -#define MSG_TUNE _UxGT("Strojenie") -#define MSG_PAUSE_PRINT _UxGT("Pauza") -#define MSG_RESUME_PRINT _UxGT("Wznowienie") -#define MSG_STOP_PRINT _UxGT("Stop") -#define MSG_CARD_MENU _UxGT("Karta SD") -#define MSG_NO_CARD _UxGT("Brak karty") -#define MSG_DWELL _UxGT("Uspij...") -#define MSG_USERWAIT _UxGT("Oczekiwanie...") -#define MSG_PRINT_ABORTED _UxGT("Druk przerwany") -#define MSG_NO_MOVE _UxGT("Brak ruchu") -#define MSG_KILLED _UxGT("Ubity. ") -#define MSG_STOPPED _UxGT("Zatrzymany. ") -#define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Skok Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") -#define MSG_AUTORETRACT _UxGT("Auto. wycofanie") -#define MSG_FILAMENTCHANGE _UxGT("Zmien filament") -#define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CNG_SDCARD _UxGT("Zmiana karty SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z za stolem") -#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("Offset Z") -#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("Blad krancowki") -#define MSG_HEATING_FAILED_LCD _UxGT("Rozgrz. nieudane") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Blad temperatury") -#define MSG_THERMAL_RUNAWAY _UxGT("Zanik temp.") -#define MSG_ERR_MAXTEMP _UxGT("Err max temp") -#define MSG_ERR_MINTEMP _UxGT("Err min temp") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err max temp stolu") -#define MSG_ERR_MINTEMP_BED _UxGT("Err min temp stolu") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("Drukarka zatrzym.") -#define MSG_PLEASE_RESET _UxGT("Prosze zresetowac") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("g") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Rozgrzewanie...") -#define MSG_BED_HEATING _UxGT("Rozgrzewanie stolu...") -#define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibruj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibruj srodek") - -#define MSG_INFO_MENU _UxGT("O drukarce") -#define MSG_INFO_PRINTER_MENU _UxGT("Info drukarki") -#define MSG_INFO_STATS_MENU _UxGT("Statystyki") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistory") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstrudery") -#define MSG_INFO_BAUDRATE _UxGT("Predkosc USB") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Oswietlenie") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukonczono") - #define MSG_INFO_PRINT_TIME _UxGT("Czas druku") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdl. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Uzyty fil.") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukonczono") - #define MSG_INFO_PRINT_TIME _UxGT("Razem") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdl. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Uzyty fil.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Zasilacz") - -#define MSG_DRIVE_STRENGTH _UxGT("Sila silnika") -#define MSG_DAC_PERCENT _UxGT("Sila %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEN FILAMENT") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEN OPCJE:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznow drukowanie") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmiane filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjecie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i nacisnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Prosze czekac...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmiane filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjecie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i nacisnij przycisk") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("aby kontynuowac...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("wlozenie filamentu") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Prosze czekac...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wysuwanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Wloz i nacisnij prz.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ladowanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_PL_HD44780_H diff --git a/Marlin_thinkerV2/Marlin/language_pl.h b/Marlin_thinkerV2/Marlin/language_pl.h deleted file mode 100644 index 3bc792714b..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pl.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Polish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PL_H -#define LANGUAGE_PL_H - -#define MAPPER_C3C4C5_PL -#define DISPLAY_CHARSET_ISO10646_PL - -/** - * One version with accented characters and one without - */ -#if ENABLED(DOGLCD) - #include "language_pl-DOGM.h" -#else - #include "language_pl-HD44780.h" -#endif - -#endif // LANGUAGE_PL_H diff --git a/Marlin_thinkerV2/Marlin/language_pt-br.h b/Marlin_thinkerV2/Marlin/language_pt-br.h deleted file mode 100644 index 303ea1aaa6..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pt-br.h +++ /dev/null @@ -1,382 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese (Brazil) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_BR_H -#define LANGUAGE_PT_BR_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") -#define MSG_SD_INSERTED _UxGT("Cartao inserido") -#define MSG_SD_REMOVED _UxGT("Cartao removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Proximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim da nivelacao!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteracao feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") -#define MSG_COOLDOWN _UxGT("Esfriar") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelacao Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Proximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edicao") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#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("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calcar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Proximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edicao") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevacao") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelacao da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelacao 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelacao Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informacao do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar proximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Proximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memoria") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensacao Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuracao da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrao") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") -#define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazao") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automatica") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") -#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("Selecionar") -#define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif -#define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif -#define MSG_ESTEPS _UxGT("E/mm") -#define MSG_E1STEPS _UxGT("E1/mm") -#define MSG_E2STEPS _UxGT("E2/mm") -#define MSG_E3STEPS _UxGT("E3/mm") -#define MSG_E4STEPS _UxGT("E4/mm") -#define MSG_E5STEPS _UxGT("E5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusao em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avancar K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuracao") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuracao") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualizacao") -#define MSG_WATCH _UxGT("Informacoes") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressao") -#define MSG_RESUME_PRINT _UxGT("Resumir impressao") -#define MSG_STOP_PRINT _UxGT("Parar impressao") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartao SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressao Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGENCIA") -#define MSG_STOPPED _UxGT("PAROU. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retracao Automatica") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") -#define MSG_BABYSTEP_X _UxGT("Passinho X") -#define MSG_BABYSTEP_Y _UxGT("Passinho Y") -#define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TERMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Maxima") -#define MSG_ERR_MINTEMP _UxGT("Erro:Temp Minima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Max") -#define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Min") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibrar 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("Configuracao Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibracao") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequencia Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressoes") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressao Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Forca do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressao") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Minima eh ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir a origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remocao de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botao") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botao") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusao") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressao") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif - -#endif // LANGUAGE_PT_BR_H diff --git a/Marlin_thinkerV2/Marlin/language_pt-br_utf8.h b/Marlin_thinkerV2/Marlin/language_pt-br_utf8.h deleted file mode 100644 index 880b396ff3..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pt-br_utf8.h +++ /dev/null @@ -1,384 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese (Brazil) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_BR_UTF_H -#define LANGUAGE_PT_BR_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") - -#define MSG_BACK _UxGT("Voltar") -#define MSG_SD_INSERTED _UxGT("Cartão inserido") -#define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso -#define MSG_AUTO_HOME_X _UxGT("Ir na origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo Ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Fim nivelação!") -#define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") -#define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração feita") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo PLA") -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar ABS") -#define MSG_COOLDOWN _UxGT("Esfriar") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrusar") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_BED_LEVELING _UxGT("Nivelação Mesa") -#define MSG_LEVEL_BED _UxGT("Nivelar Mesa") -#define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") -#define MSG_NEXT_CORNER _UxGT("Próximo Canto") -#define MSG_EDITING_STOPPED _UxGT("Fim da Edição") - -#define MSG_USER_MENU _UxGT("Comando customizado") -#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("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") -#define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar") -#define MSG_UBL_BC_INSERT2 _UxGT("Medir") -#define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") - -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Próximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edição") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevação") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") -#define MSG_UBL_MESH_LEVELING _UxGT("Nivelação da Malha") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelação 3 pontos") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivelação Grid") -#define MSG_UBL_MESH_LEVEL _UxGT("Nivelar Malha") -#define MSG_UBL_SIDE_POINTS _UxGT("Cantos") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo de Mapa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Salvar Mapa da Malha") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Enviar Para Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salvar Malha CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Salvar Backup") -#define MSG_UBL_INFO_UBL _UxGT("Informação do UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Editar Malha") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Qtd de Enchimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Enchimento Manual") -#define MSG_UBL_SMART_FILLIN _UxGT("Enchimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Preencher malha") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar tudo") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar próximo") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajuste Fino de Todos") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajuar Mais Próximo") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Armazenamento Malha") -#define MSG_UBL_STORAGE_SLOT _UxGT("Slot de Memória") -#define MSG_UBL_LOAD_MESH _UxGT("Ler Malha") -#define MSG_UBL_SAVE_MESH _UxGT("Salvar Malha") -#define MSG_MESH_LOADED _UxGT("Malha %i carregada") -#define MSG_MESH_SAVED _UxGT("Malha %i salva") -#define MSG_NO_STORAGE _UxGT("Sem armazenamento") -#define MSG_UBL_SAVE_ERROR _UxGT("Erro ao salvar UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Erro no restauro UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensação Z parou") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") -#define MSG_LED_CONTROL _UxGT("Controle do LED") -#define MSG_LEDS _UxGT("Luz") -#define MSG_LED_PRESETS _UxGT("Configuração da Luz") -#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") -#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") -#define MSG_SET_LEDS_YELLOW _UxGT("Luz Amarela") -#define MSG_SET_LEDS_GREEN _UxGT("Luz Verde") -#define MSG_SET_LEDS_BLUE _UxGT("Luz Azul") -#define MSG_SET_LEDS_INDIGO _UxGT("Luz Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Luz Violeta") -#define MSG_SET_LEDS_WHITE _UxGT("Luz Branca") -#define MSG_SET_LEDS_DEFAULT _UxGT("Luz Padrão") -#define MSG_CUSTOM_LEDS _UxGT("Luz Customizada") -#define MSG_INTENSITY_R _UxGT("Intensidade Vermelho") -#define MSG_INTENSITY_G _UxGT("Intensidade Verde") -#define MSG_INTENSITY_B _UxGT("Intensidade Azul") -#define MSG_INTENSITY_W _UxGT("Intensidade Branco") -#define MSG_LED_BRIGHTNESS _UxGT("Brilho") - -#define MSG_MOVING _UxGT("Movendo...") -#define MSG_FREE_XY _UxGT("Liberar XY") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Bocal") -#define MSG_BED _UxGT("Mesa") -#define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazão") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") -#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("Selecionar") -#define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif IS_DELTA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") -#else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") -#endif -#define MSG_VE_JERK _UxGT("jogo VE") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("Retrair A") -#define MSG_A_TRAVEL _UxGT("Movimento A") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif IS_DELTA - #define MSG_ASTEPS _UxGT("Passo A/mm") - #define MSG_BSTEPS _UxGT("Passo B/mm") - #define MSG_CSTEPS _UxGT("Passo C/mm") -#else - #define MSG_ASTEPS _UxGT("Passo X/mm") - #define MSG_BSTEPS _UxGT("Passo Y/mm") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#endif -#define MSG_ESTEPS _UxGT("E/mm") -#define MSG_E1STEPS _UxGT("E1/mm") -#define MSG_E2STEPS _UxGT("E2/mm") -#define MSG_E3STEPS _UxGT("E3/mm") -#define MSG_E4STEPS _UxGT("E4/mm") -#define MSG_E5STEPS _UxGT("E5/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusão em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avançar K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Salvar Configuração") -#define MSG_LOAD_EEPROM _UxGT("Ler Configuração") -#define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") -#define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualização") -#define MSG_WATCH _UxGT("Informações") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressão") -#define MSG_RESUME_PRINT _UxGT("Resumir impressão") -#define MSG_STOP_PRINT _UxGT("Parar impressão") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("ZzZzZz...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_ABORTED _UxGT("Impressão Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGÊNCIA") -#define MSG_STOPPED _UxGT("PAROU. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") -#define MSG_AUTORETRACT _UxGT("Retração Automática") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") -#define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") - -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") -#define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") -#define MSG_BABYSTEP_X _UxGT("Passinho X") -#define MSG_BABYSTEP_Y _UxGT("Passinho Y") -#define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TÉRMICO") -#define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Máxima") -#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_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibrar 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("Configuração Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibração") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") -#define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") -#define MSG_DELTA_HEIGHT _UxGT("Altura") -#define MSG_DELTA_RADIUS _UxGT("Raio") -#define MSG_INFO_MENU _UxGT("Sobre") -#define MSG_INFO_PRINTER_MENU _UxGT("Impressora") -#define MSG_3POINT_LEVELING _UxGT("Nivelamento 3 pontos") -#define MSG_LINEAR_LEVELING _UxGT("Nivelamento Linear") -#define MSG_BILINEAR_LEVELING _UxGT("Nivelamento Bilinear") -#define MSG_UBL_LEVELING _UxGT("Nivelamento UBL") -#define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") -#define MSG_INFO_STATS_MENU _UxGT("Estatísticas") -#define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequência Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd Impressões") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Completas") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Imprimindo") -#define MSG_INFO_PRINT_LONGEST _UxGT("Impressão Mais Longa") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#define MSG_INFO_PSU _UxGT("PSU") -#define MSG_DRIVE_STRENGTH _UxGT("Força do Motor") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressão") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Mínima é ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir à origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") - -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") - - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botão") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") - - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botão") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") - - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusão") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") - - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressão") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") -#else LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif - -#endif // LANGUAGE_PT_BR_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_pt.h b/Marlin_thinkerV2/Marlin/language_pt.h deleted file mode 100644 index 949381142d..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pt.h +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_H -#define LANGUAGE_PT_H - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -#define WELCOME_MSG MACHINE_NAME " pronta." -#define MSG_SD_INSERTED "Cartao inserido" -#define MSG_SD_REMOVED "Cartao removido" -#define MSG_MAIN "Menu principal" -#define MSG_AUTOSTART "Autostart" -#define MSG_DISABLE_STEPPERS "Desactivar motores" -#define MSG_AUTO_HOME "Ir para origem" -#define MSG_AUTO_HOME_X "Ir para origem X" -#define MSG_AUTO_HOME_Y "Ir para origem Y" -#define MSG_AUTO_HOME_Z "Ir para origem Z" -#define MSG_TMC_Z_CALIBRATION "Calibrar Z" -#define MSG_LEVEL_BED_HOMING "Indo para origem" -#define MSG_LEVEL_BED_WAITING "Click para iniciar" -#define MSG_LEVEL_BED_NEXT_POINT "Proximo ponto" -#define MSG_LEVEL_BED_DONE "Pronto !" -#define MSG_SET_HOME_OFFSETS "Definir desvio" -#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" -#define MSG_SET_ORIGIN "Definir origem" -#define MSG_PREHEAT_1 "Pre-aquecer PLA" -#define MSG_PREHEAT_1_N "Pre-aquecer PLA" -#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_1_SETTINGS "Definicoes PLA" -#define MSG_PREHEAT_2 "Pre-aquecer ABS" -#define MSG_PREHEAT_2_N "Pre-aquecer ABS " -#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_2_SETTINGS "Definicoes ABS" -#define MSG_COOLDOWN "Arrefecer" -#define MSG_SWITCH_PS_ON "Ligar" -#define MSG_SWITCH_PS_OFF "Desligar" -#define MSG_EXTRUDE "Extrudir" -#define MSG_RETRACT "Retrair" -#define MSG_MOVE_AXIS "Mover eixo" -#define MSG_MOVE_X "Mover X" -#define MSG_MOVE_Y "Mover Y" -#define MSG_MOVE_Z "Mover Z" -#define MSG_MOVE_E "Mover Extrusor" -#define MSG_MOVE_01MM "Mover 0.1mm" -#define MSG_MOVE_1MM "Mover 1mm" -#define MSG_MOVE_10MM "Mover 10mm" -#define MSG_SPEED "Velocidade" -#define MSG_BED_Z "Base Z" -#define MSG_NOZZLE LCD_STR_THERMOMETER " Bico" -#define MSG_BED LCD_STR_THERMOMETER " Base" -#define MSG_FAN_SPEED "Vel. ventoinha" -#define MSG_FLOW "Fluxo" -#define MSG_CONTROL "Controlo" -#define MSG_MIN LCD_STR_THERMOMETER " Min" -#define MSG_MAX LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP "Temp. Automatica" -#define MSG_ON "On " -#define MSG_OFF "Off" -#define MSG_PID_P "PID-P" -#define MSG_PID_I "PID-I" -#define MSG_PID_D "PID-D" -#define MSG_PID_C "PID-C" -#define MSG_ACC "Acc" -#define MSG_JERK "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK "Va-jerk" - #define MSG_VB_JERK "Vb-jerk" - #define MSG_VC_JERK "Vc-jerk" -#else - #define MSG_VA_JERK "Vx-jerk" - #define MSG_VB_JERK "Vy-jerk" - #define MSG_VC_JERK "Vz-jerk" -#endif -#define MSG_VE_JERK "Ve-jerk" -#define MSG_VMAX " Vmax " -#define MSG_VMIN "Vmin" -#define MSG_VTRAV_MIN "VTrav min" -#define MSG_AMAX "Amax " -#define MSG_A_RETRACT "A-retraccao" -#define MSG_A_TRAVEL "A-movimento" -#define MSG_STEPS_PER_MM "Passo/mm" -#if IS_KINEMATIC - #define MSG_ASTEPS "A passo/mm" - #define MSG_BSTEPS "B passo/mm" - #define MSG_CSTEPS "C passo/mm" -#else - #define MSG_ASTEPS "X passo/mm" - #define MSG_BSTEPS "Y passo/mm" - #define MSG_CSTEPS "Z passo/mm" -#endif -#define MSG_ESTEPS "E passo/mm" -#define MSG_E1STEPS "E1 passo/mm" -#define MSG_E2STEPS "E2 passo/mm" -#define MSG_E3STEPS "E3 passo/mm" -#define MSG_E4STEPS "E4 passo/mm" -#define MSG_E5STEPS "E5 passo/mm" -#define MSG_TEMPERATURE "Temperatura" -#define MSG_MOTION "Movimento" -#define MSG_FILAMENT "Filamento" -#define MSG_VOLUMETRIC_ENABLED "E em mm3" -#define MSG_FILAMENT_DIAM "Fil. Diam." -#define MSG_CONTRAST "Contraste" -#define MSG_STORE_EEPROM "Guardar na memoria" -#define MSG_LOAD_EEPROM "Carregar da memoria" -#define MSG_RESTORE_FAILSAFE "Rest. de emergen." -#define MSG_REFRESH LCD_STR_REFRESH " Recarregar" -#define MSG_WATCH "Monitorizar" -#define MSG_PREPARE "Preparar" -#define MSG_TUNE "Afinar" -#define MSG_PAUSE_PRINT "Pausar impressao" -#define MSG_RESUME_PRINT "Retomar impressao" -#define MSG_STOP_PRINT "Parar impressao" -#define MSG_CARD_MENU "Imprimir do SD" -#define MSG_NO_CARD "Sem cartao SD" -#define MSG_DWELL "Em espera..." -#define MSG_USERWAIT "A espera de ordem" -#define MSG_PRINT_ABORTED "Impressao cancelada" -#define MSG_NO_MOVE "Sem movimento" -#define MSG_KILLED "EMERGENCIA. " -#define MSG_STOPPED "PARADO. " -#define MSG_CONTROL_RETRACT " Retrair mm" -#define MSG_CONTROL_RETRACT_SWAP "Troca Retrair mm" -#define MSG_CONTROL_RETRACTF " Retrair V" -#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm" -#define MSG_CONTROL_RETRACT_RECOVER " DesRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP "Troca DesRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF " DesRet V" -#define MSG_AUTORETRACT " AutoRetr." -#define MSG_FILAMENTCHANGE "Trocar filamento" -#define MSG_INIT_SDCARD "Inici. cartao SD" -#define MSG_CNG_SDCARD "Trocar cartao SD" -#define MSG_ZPROBE_OUT "Sensor fora/base" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" -#define MSG_ZPROBE_ZOFFSET "Desvio Z" -#define MSG_BABYSTEP_X "Babystep X" -#define MSG_BABYSTEP_Y "Babystep Y" -#define MSG_BABYSTEP_Z "Babystep Z" -#define MSG_ENDSTOP_ABORT "Fim de curso" -#define MSG_HEATING_FAILED_LCD "Aquecimento falhou" -#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP "Err: T Maxima" -#define MSG_ERR_MINTEMP "Err: T Minima" -#define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima" -#define MSG_ERR_MINTEMP_BED "Err: T Base Minima" -#define MSG_HEATING "Aquecendo..." -#define MSG_BED_HEATING "Aquecendo base.." -#define MSG_DELTA_CALIBRATE "Calibracao Delta" -#define MSG_DELTA_CALIBRATE_X "Calibrar X" -#define MSG_DELTA_CALIBRATE_Y "Calibrar Y" -#define MSG_DELTA_CALIBRATE_Z "Calibrar Z" -#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" - -#define MSG_LCD_ENDSTOPS "Fim de curso" - -#endif // LANGUAGE_PT_H diff --git a/Marlin_thinkerV2/Marlin/language_pt_utf8.h b/Marlin_thinkerV2/Marlin/language_pt_utf8.h deleted file mode 100644 index 0b0113c1d8..0000000000 --- a/Marlin_thinkerV2/Marlin/language_pt_utf8.h +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Portuguese - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_PT_UTF_H -#define LANGUAGE_PT_UTF_H - -#define MAPPER_C2C3 -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronta.") -#define MSG_SD_INSERTED _UxGT("Cartão inserido") -#define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desactivar motores") -#define MSG_AUTO_HOME _UxGT("Ir para origem") -#define MSG_AUTO_HOME_X _UxGT("Ir para origem X") -#define MSG_AUTO_HOME_Y _UxGT("Ir para origem Y") -#define MSG_AUTO_HOME_Z _UxGT("Ir para origem Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") -#define MSG_LEVEL_BED_WAITING _UxGT("Click para iniciar") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo ponto") -#define MSG_LEVEL_BED_DONE _UxGT("Pronto !") -#define MSG_SET_HOME_OFFSETS _UxGT("Definir desvio") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets aplicados") -#define MSG_SET_ORIGIN _UxGT("Definir origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq. PLA Tudo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. PLA ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Definições PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq. ABS Tudo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. ABS ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Definições ABS") -#define MSG_COOLDOWN _UxGT("Arrefecer") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#define MSG_MOVE_X _UxGT("Mover X") -#define MSG_MOVE_Y _UxGT("Mover Y") -#define MSG_MOVE_Z _UxGT("Mover Z") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_MOVE_01MM _UxGT("Mover 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mover 1mm") -#define MSG_MOVE_10MM _UxGT("Mover 10mm") -#define MSG_SPEED _UxGT("Velocidade") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Bico") -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Base") -#define MSG_FAN_SPEED _UxGT("Vel. ventoinha") -#define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Controlo") -#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("Temp. Automática") -#define MSG_ON _UxGT("On ") -#define MSG_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_ACC _UxGT("Acc") -#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-retracção") -#define MSG_A_TRAVEL _UxGT("A-movimento") -#define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A passo/mm") - #define MSG_BSTEPS _UxGT("B passo/mm") - #define MSG_CSTEPS _UxGT("C passo/mm") -#else - #define MSG_ASTEPS _UxGT("X passo/mm") - #define MSG_BSTEPS _UxGT("Y passo/mm") - #define MSG_CSTEPS _UxGT("Z passo/mm") -#endif -#define MSG_ESTEPS _UxGT("E passo/mm") -#define MSG_E1STEPS _UxGT("E1 passo/mm") -#define MSG_E2STEPS _UxGT("E2 passo/mm") -#define MSG_E3STEPS _UxGT("E3 passo/mm") -#define MSG_E4STEPS _UxGT("E4 passo/mm") -#define MSG_E5STEPS _UxGT("E5 passo/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Diam.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Guardar na memoria") -#define MSG_LOAD_EEPROM _UxGT("Carregar da memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emergen.") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Recarregar") -#define MSG_WATCH _UxGT("Monitorizar") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Afinar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressão") -#define MSG_RESUME_PRINT _UxGT("Retomar impressão") -#define MSG_STOP_PRINT _UxGT("Parar impressão") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("Em espera...") -#define MSG_USERWAIT _UxGT("Á espera de ordem") -#define MSG_PRINT_ABORTED _UxGT("Impressão cancelada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("EMERGÊNCIA. ") -#define MSG_STOPPED _UxGT("PARADO. ") -#define MSG_CONTROL_RETRACT _UxGT(" Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Troca Retrair mm") -#define MSG_CONTROL_RETRACTF _UxGT(" Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT(" Levantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT(" DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Troca DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT(" DesRet V") -#define MSG_AUTORETRACT _UxGT(" AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Trocar filamento") -#define MSG_INIT_SDCARD _UxGT("Inici. cartão SD") -#define MSG_CNG_SDCARD _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_ZPROBE_ZOFFSET _UxGT("Desvio Z") -#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("Fim de curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: T Máxima") -#define MSG_ERR_MINTEMP _UxGT("Err: T Mínima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: T Base Máxima") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: T Base Mínima") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibração 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_LCD_ENDSTOPS _UxGT("Fim de curso") - -#endif // LANGUAGE_PT_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_ru.h b/Marlin_thinkerV2/Marlin/language_ru.h deleted file mode 100644 index 4a9fc53fe7..0000000000 --- a/Marlin_thinkerV2/Marlin/language_ru.h +++ /dev/null @@ -1,402 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Russian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_RU_H -#define LANGUAGE_RU_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" готов.") -#define MSG_BACK _UxGT("Назад") -#define MSG_SD_INSERTED _UxGT("Карта вставлена") -#define MSG_SD_REMOVED _UxGT("Карта извлечена") -#define MSG_LCD_ENDSTOPS _UxGT("Эндстопы") // Max length 8 characters -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Прогр. эндстопы") -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Выкл. двигатели") -#define MSG_DEBUG_MENU _UxGT("Меню отладки") -#define MSG_PROGRESS_BAR_TEST _UxGT("Тест индикатора") -#define MSG_AUTO_HOME _UxGT("Авто парковка") -#define MSG_AUTO_HOME_X _UxGT("Парковка X") -#define MSG_AUTO_HOME_Y _UxGT("Парковка Y") -#define MSG_AUTO_HOME_Z _UxGT("Парковка Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калибровать Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Нулевое положение") -#define MSG_LEVEL_BED_WAITING _UxGT("Нажмите чтобы начать") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Следующая точка") -#define MSG_LEVEL_BED_DONE _UxGT("Выравнивание готово!") -#define MSG_Z_FADE_HEIGHT _UxGT("Высота спада") -#define MSG_SET_HOME_OFFSETS _UxGT("Запомнить парковку") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции применены") -#define MSG_SET_ORIGIN _UxGT("Запомнить ноль") -#define MSG_PREHEAT_1 _UxGT("Преднагрев PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" всё") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" сопло") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" стол") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" настр.") -#define MSG_PREHEAT_2 _UxGT("Преднагрев ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" всё") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" сопло") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" стол") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" настр.") -#define MSG_COOLDOWN _UxGT("Охлаждение") -#define MSG_SWITCH_PS_ON _UxGT("Включить питание") -#define MSG_SWITCH_PS_OFF _UxGT("Выключить питание") -#define MSG_EXTRUDE _UxGT("Экструзия") -#define MSG_RETRACT _UxGT("Втягивание") -#define MSG_MOVE_AXIS _UxGT("Движение по осям") -#define MSG_BED_LEVELING _UxGT("Калибровка стола") -#define MSG_LEVEL_BED _UxGT("Калибровать стол") -#define MSG_LEVEL_CORNERS _UxGT("Выровнять углы") -#define MSG_NEXT_CORNER _UxGT("Следующий угол") -#define MSG_EDITING_STOPPED _UxGT("Ред. сетки завершено") -#define MSG_USER_MENU _UxGT("Свои комманды") -#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("Постр. сетку от руки") -#define MSG_UBL_BC_INSERT _UxGT("Пост. шимм и измер.") -#define MSG_UBL_BC_INSERT2 _UxGT("Измерение") -#define MSG_UBL_BC_REMOVE _UxGT("Удал. и измер. стол") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Двигаемся дальше") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Активировать UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Деактивировать UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Температура стола") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Температура сопла") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Редактор сеток") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Редакт. свою сетку") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Точная настр. сетки") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Ред. сетки завершено") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Построить свою сетку") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Построить сетку") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Построить сетку PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Построить сетку ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Построить хол. сетку") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Устан. высоту сетки") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Высота") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Проверить сетку") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Проверить сетку PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Проверить сетку ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Проверить свою сетку") -#define MSG_UBL_CONTINUE_MESH _UxGT("Продолжить сетку") -#define MSG_UBL_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Калибровка 3-х точек") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Калибровка растера") -#define MSG_UBL_MESH_LEVEL _UxGT("Выровнить сетку") -#define MSG_UBL_SIDE_POINTS _UxGT("Крайние точки") -#define MSG_UBL_MAP_TYPE _UxGT("Тип карты") -#define MSG_UBL_OUTPUT_MAP _UxGT("Вывести карту сетки") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Вывести на хост") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Вывести в CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Забекапить сетку") -#define MSG_UBL_INFO_UBL _UxGT("Вывод информации UBL") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Редактировать сетку") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Кол-во заполнителя") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ручное заполнение") -#define MSG_UBL_SMART_FILLIN _UxGT("Умное заполнение") -#define MSG_UBL_FILLIN_MESH _UxGT("Заполнить сетку") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Аннулировать всё") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Аннулир. ближ. точку") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Точная настр. всего") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Настр. ближ. точки") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Хранилище сетей") -#define MSG_UBL_STORAGE_SLOT _UxGT("Слот памяти") -#define MSG_UBL_LOAD_MESH _UxGT("Загрузить сетку стола") -#define MSG_UBL_SAVE_MESH _UxGT("Сохранить сетку стола") -#define MSG_MESH_LOADED _UxGT("Сетка %i загружена") -#define MSG_MESH_SAVED _UxGT("Сетка %i сохранена") -#define MSG_NO_STORAGE _UxGT("Нет хранилища") -#define MSG_UBL_SAVE_ERROR _UxGT("Ошибка: Сохран. UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Ошибка: Восстан. UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Смещение Z останов.") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL") - -#define MSG_LED_CONTROL _UxGT("Настройки LED") -#define MSG_LEDS _UxGT("Подсветку") -#define MSG_LED_PRESETS _UxGT("Предустановки света") -#define MSG_SET_LEDS_RED _UxGT("Красный свет") -#define MSG_SET_LEDS_ORANGE _UxGT("Оранжевый свет") -#define MSG_SET_LEDS_YELLOW _UxGT("Жёлтый свет") -#define MSG_SET_LEDS_GREEN _UxGT("Зелёный свет") -#define MSG_SET_LEDS_BLUE _UxGT("Синий свет") -#define MSG_SET_LEDS_INDIGO _UxGT("Индиго свет") -#define MSG_SET_LEDS_VIOLET _UxGT("Фиолетовый свет") -#define MSG_SET_LEDS_WHITE _UxGT("Белый свет") -#define MSG_SET_LEDS_DEFAULT _UxGT("Свет по умолчанию") -#define MSG_CUSTOM_LEDS _UxGT("Свои настр. света") -#define MSG_INTENSITY_R _UxGT("Интенсивн. красного") -#define MSG_INTENSITY_G _UxGT("Интенсивн. зелёного") -#define MSG_INTENSITY_B _UxGT("Интенсивн. синего") -#define MSG_INTENSITY_W _UxGT("Интенсивн. белого") -#define MSG_LED_BRIGHTNESS _UxGT("Яркость") - -#define MSG_MOVING _UxGT("Движемся...") -#define MSG_FREE_XY _UxGT("Освобождаем XY") -#define MSG_MOVE_X _UxGT("Движение по X") -#define MSG_MOVE_Y _UxGT("Движение по Y") -#define MSG_MOVE_Z _UxGT("Движение по Z") -#define MSG_MOVE_E _UxGT("Экструдер") -#define MSG_MOVE_01MM _UxGT("Движение 0.1мм") -#define MSG_MOVE_1MM _UxGT("Движение 1мм") -#define MSG_MOVE_10MM _UxGT("Движение 10мм") -#define MSG_SPEED _UxGT("Скорость") -#define MSG_BED_Z _UxGT("Z стола") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _UxGT("Стол") -#define MSG_FAN_SPEED _UxGT("Кулер") -#define MSG_EXTRA_FAN_SPEED _UxGT("Кулер доп.") -#define MSG_FLOW _UxGT("Поток") -#define MSG_CONTROL _UxGT("Настройки") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Мин") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Фактор") -#define MSG_AUTOTEMP _UxGT("Автотемпература") -#define MSG_ON _UxGT("Вкл.") -#define MSG_OFF _UxGT("Выкл.") -#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("Выбор") -#define MSG_ACC _UxGT("Ускорение") -#define MSG_JERK _UxGT("Рывок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-рывок") - #define MSG_VB_JERK _UxGT("Vb-рывок") - #define MSG_VC_JERK _UxGT("Vc-рывок") -#else - #define MSG_VX_JERK _UxGT("Vx-рывок") - #define MSG_VY_JERK _UxGT("Vy-рывок") - #define MSG_VZ_JERK _UxGT("Vz-рывок") -#endif -#define MSG_VE_JERK _UxGT("Ve-рывок") -#define MSG_VELOCITY _UxGT("Быстрота") -#define MSG_VMAX _UxGT("Vмакс ") -#define MSG_VMIN _UxGT("Vмин") -#define MSG_VTRAV_MIN _UxGT("Vпутеш. мин") -#define MSG_ACCELERATION _UxGT("Ускорение") -#define MSG_AMAX _UxGT("Aмакс ") -#define MSG_A_RETRACT _UxGT("A-втягивание") -#define MSG_A_TRAVEL _UxGT("A-путеш.") -#define MSG_STEPS_PER_MM _UxGT("Шаг/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aшаг/мм") - #define MSG_BSTEPS _UxGT("Bшаг/мм") - #define MSG_CSTEPS _UxGT("Cшаг/мм") -#else - #define MSG_ASTEPS _UxGT("Xшаг/мм") - #define MSG_BSTEPS _UxGT("Yшаг/мм") - #define MSG_CSTEPS _UxGT("Zшаг/мм") -#endif -#define MSG_ESTEPS _UxGT("Eшаг/мм") -#define MSG_E1STEPS _UxGT("E1шаг/мм") -#define MSG_E2STEPS _UxGT("E2шаг/мм") -#define MSG_E3STEPS _UxGT("E3шаг/мм") -#define MSG_E4STEPS _UxGT("E4шаг/мм") -#define MSG_E5STEPS _UxGT("E5шаг/мм") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Филамент") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") -#define MSG_FILAMENT_DIAM _UxGT("Диаметр филамента") -#define MSG_FILAMENT_UNLOAD _UxGT("Загрузка мм") -#define MSG_FILAMENT_LOAD _UxGT("Выгрузка мм") -#define MSG_ADVANCE_K _UxGT("K продвижения") -#define MSG_CONTRAST _UxGT("Контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Сохранить настройки") -#define MSG_LOAD_EEPROM _UxGT("Загрузить настройки") -#define MSG_RESTORE_FAILSAFE _UxGT("Восстановить настр.") -#define MSG_INIT_EEPROM _UxGT("Инициализация EEPROM") -#define MSG_REFRESH _UxGT("Обновить") -#define MSG_WATCH _UxGT("Информационный экран") -#define MSG_PREPARE _UxGT("Подготовить") -#define MSG_TUNE _UxGT("Настроить") -#define MSG_PAUSE_PRINT _UxGT("Пауза печати") -#define MSG_RESUME_PRINT _UxGT("Продолжить печать") -#define MSG_STOP_PRINT _UxGT("Остановить печать") -#define MSG_CARD_MENU _UxGT("Печать с SD карты") -#define MSG_NO_CARD _UxGT("Нет SD карты") -#define MSG_DWELL _UxGT("Сон...") -#define MSG_USERWAIT _UxGT("Продолжить...") -#define MSG_PRINT_PAUSED _UxGT("Печать на паузе") -#define MSG_PRINTING _UxGT("Печать...") -#define MSG_PRINT_ABORTED _UxGT("Печать отменена") -#define MSG_NO_MOVE _UxGT("Нет движения.") -#define MSG_KILLED _UxGT("УБИТО. ") -#define MSG_STOPPED _UxGT("ОСТАНОВЛЕНО. ") -#define MSG_CONTROL_RETRACT _UxGT("Втягивание мм") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Втягивание смены мм") -#define MSG_CONTROL_RETRACTF _UxGT("Втягивание V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Втяг. прыжка мм") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Возврат мм") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Возврат смены мм") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Возврат V") -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Возврат смены V") -#define MSG_AUTORETRACT _UxGT("Авто Втягивание") -#define MSG_FILAMENTCHANGE _UxGT("Смена филамента") -#define MSG_FILAMENTLOAD _UxGT("Загрузка филамента") -#define MSG_FILAMENTUNLOAD _UxGT("Выгрузка филамента") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Выгрузить всё") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD карту") -#define MSG_CNG_SDCARD _UxGT("Сменить SD карту") -#define MSG_ZPROBE_OUT _UxGT("Z датчик вне стола") -#define MSG_SKEW_FACTOR _UxGT("Фактор наклона") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Тестирование BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Сброс BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Установка BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Набивка BLTouch") -#define MSG_HOME _UxGT("Паркуй") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("первый") -#define MSG_ZPROBE_ZOFFSET _UxGT("Смещение Z") -#define MSG_BABYSTEP_X _UxGT("Микрошаг X") -#define MSG_BABYSTEP_Y _UxGT("Микрошаг Y") -#define MSG_BABYSTEP_Z _UxGT("Микрошаг Z") -#define MSG_ENDSTOP_ABORT _UxGT("Сработал концевик") -#define MSG_HEATING_FAILED_LCD _UxGT("Разогрев не удался") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Разогр. стола не уд.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Ошибка: Избыточная Т") -#define MSG_THERMAL_RUNAWAY _UxGT("УБЕГАНИЕ ТЕПЛА") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("УБЕГАНИЕ ТЕПЛА СТОЛА") -#define MSG_ERR_MAXTEMP _UxGT("Ошибка: Т макс.") -#define MSG_ERR_MINTEMP _UxGT("Ошибка: Т мин.") -#define MSG_ERR_MAXTEMP_BED _UxGT("Ошибка: Т стола макс") -#define MSG_ERR_MINTEMP_BED _UxGT("Ошибка: Т стола мин.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("ПРИНТЕР ОСТАНОВЛЕН") -#define MSG_PLEASE_RESET _UxGT("Сделайте сброс") -#define MSG_SHORT_DAY _UxGT("д") // One character only -#define MSG_SHORT_HOUR _UxGT("ч") // One character only -#define MSG_SHORT_MINUTE _UxGT("м") // One character only -#define MSG_HEATING _UxGT("Нагрев...") -#define MSG_COOLING _UxGT("Охлаждение...") -#define MSG_BED_HEATING _UxGT("Нагрев стола...") -#define MSG_BED_COOLING _UxGT("Охлаждение стола...") -#define MSG_DELTA_CALIBRATE _UxGT("Калибровка Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калибровать X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калибровать Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калибровать Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калибровать центр") -#define MSG_DELTA_SETTINGS _UxGT("Настройки Delta") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Авто калибровка") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Задать высоту Delta") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Задать Z-смещение") -#define MSG_DELTA_DIAG_ROD _UxGT("Диаг. стержень") -#define MSG_DELTA_HEIGHT _UxGT("Высота") -#define MSG_DELTA_RADIUS _UxGT("Радиус") -#define MSG_INFO_MENU _UxGT("О принтере") -#define MSG_INFO_PRINTER_MENU _UxGT("Инф. о принтере") -#define MSG_3POINT_LEVELING _UxGT("Калибровка 3-х точек") -#define MSG_LINEAR_LEVELING _UxGT("Линейная калибровка") -#define MSG_BILINEAR_LEVELING _UxGT("Билинейная калибр.") -#define MSG_UBL_LEVELING _UxGT("Калибровка UBL") -#define MSG_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_INFO_STATS_MENU _UxGT("Статистика принтера") -#define MSG_INFO_BOARD_MENU _UxGT("Информация о плате") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термисторы") -#define MSG_INFO_EXTRUDERS _UxGT("Экструдеры") -#define MSG_INFO_BAUDRATE _UxGT("Бод") -#define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Подсветка корпуса") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Яркость подсветки") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Счётчик печати") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") - #define MSG_INFO_PRINT_TIME _UxGT("Общее время печати") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее задание") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Длинна филамента") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Отпечатков") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Закончено") - #define MSG_INFO_PRINT_TIME _UxGT("Всего") - #define MSG_INFO_PRINT_LONGEST _UxGT("Наидольшее") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Выдавлено") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Мин. Т") -#define MSG_INFO_MAX_TEMP _UxGT("Макс. Т") -#define MSG_INFO_PSU _UxGT("Блок питания") -#define MSG_DRIVE_STRENGTH _UxGT("Сила привода") -#define MSG_DAC_PERCENT _UxGT("Привод %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запись DAC EEPROM") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ПЕЧАТЬ НА ПАУЗЕ") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ЗАГРУЗКА ФИЛАМЕНТА") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("ВЫГРУЗКА ФИЛАМЕНТА") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Выдавить ещё") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Возобновить печать") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Сопла: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Возврат не удался") -#define MSG_ERR_PROBING_FAILED _UxGT("Не удалось прощупать") -#define MSG_M600_TOO_COLD _UxGT("M600: Низкая Т") - -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("начала смены") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("выгрузки") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставьте пруток") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("и нажмите кнопку") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("для продолжения") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Нажмите кнопку для") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("нагрева сопла...") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев сопла") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Ждите...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("загрузки прутка") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("экструзии") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("филамента") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ожидайте") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("возобновления") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("печати") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Ожидайте...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Выгрузка...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставь и нажми") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Нагрев...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Загрузка...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Выдавливание...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Возобновление...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_RU_H diff --git a/Marlin_thinkerV2/Marlin/language_sk_utf8.h b/Marlin_thinkerV2/Marlin/language_sk_utf8.h deleted file mode 100644 index de3b2ba38b..0000000000 --- a/Marlin_thinkerV2/Marlin/language_sk_utf8.h +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Slovak - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Michal Holeš, Farma MaM - * http://www.facebook.com/farmamam - * - */ -#ifndef LANGUAGE_SK_UTF_H -#define LANGUAGE_SK_UTF_H - -#define MAPPER_C3C4C5_SK -#define DISPLAY_CHARSET_ISO10646_SK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" pripravená.") -#define MSG_BACK _UxGT("Naspať") -#define MSG_SD_INSERTED _UxGT("Karta vložená") -#define MSG_SD_REMOVED _UxGT("Karta vybratá") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopy") // max 8 znakov -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft.endstopy") -#define MSG_MAIN _UxGT("Hlavná ponuka") -#define MSG_AUTOSTART _UxGT("Autoštart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolniť motory") -#define MSG_DEBUG_MENU _UxGT("Ponuka ladenia") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. priebehu") -#define MSG_AUTO_HOME _UxGT("Domovská pozícia") -#define MSG_AUTO_HOME_X _UxGT("Domov os X") -#define MSG_AUTO_HOME_Y _UxGT("Domov os Y") -#define MSG_AUTO_HOME_Z _UxGT("Domov os Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Kalibrovať Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Meranie podložky") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Ďalší bod") -#define MSG_LEVEL_BED_DONE _UxGT("Meranie hotové!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška merania") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastaviť offsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsety nastavené") -#define MSG_SET_ORIGIN _UxGT("Nastaviť začiatok") -#define MSG_PREHEAT_1 _UxGT("Zahriať PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" všetko") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahriať ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" všetko") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_COOLDOWN _UxGT("Schladiť") -#define MSG_SWITCH_PS_ON _UxGT("Zapnúť napájanie") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnúť napájanie") -#define MSG_EXTRUDE _UxGT("Vytlačiť (extr.)") -#define MSG_RETRACT _UxGT("Vytiahnuť (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunúť osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnať podložku") -#define MSG_LEVEL_BED _UxGT("Vyrovnať podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnať rohy") -#define MSG_NEXT_CORNER _UxGT("Ďalší roh") -#define MSG_EDITING_STOPPED _UxGT("Koniec úprav siete") - -#define MSG_UBL_DOING_G29 _UxGT("Vykonávam G29") -#define MSG_UBL_UNHOMED _UxGT("Prejdite domov") -#define MSG_UBL_TOOLS _UxGT("UBL nástroje") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") -#define MSG_UBL_BC_INSERT _UxGT("Vložte kartu, zmerajte") -#define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstráňte a zmerajte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Presun na ďalší") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovať UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovať UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sieťe bodov") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upraviť vlastnú sieť") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladiť sieť bodov") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Koniec úprav siete") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastná sieť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvoriť sieť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Sieť bodov PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Sieť bodov ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená sieť bodov") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upraviť výšku siete") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Skontrolovať sieť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola siete PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola siete ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. siete") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovať v sieti") -#define MSG_UBL_MESH_LEVELING _UxGT("Sieťové rovnanie") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodove rovnanie") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_UBL_MESH_LEVEL _UxGT("Vyrovnať podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranné body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ siete bodov") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovať sieť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovať do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovať do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Upraviť sieť bodov") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mriežky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ručná hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Smart hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplniť mriežku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušiť všetko") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušiť posledný") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upraviť všetky") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upraviť posledný") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uložisko sietí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Pamaťový slot") -#define MSG_UBL_LOAD_MESH _UxGT("Načítať sieť bodov") -#define MSG_UBL_SAVE_MESH _UxGT("Uložiť sieť bodov") -#define MSG_MESH_LOADED _UxGT("Sieť %i načítaná") -#define MSG_MESH_SAVED _UxGT("Sieť %i uložená") -#define MSG_NO_STORAGE _UxGT("Nedostatok miesta") -#define MSG_UBL_SAVE_ERROR _UxGT("Err: Uložiť UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Err: Obnoviť UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Koniec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") - -#define MSG_LED_CONTROL _UxGT("Nastavenie LED") -#define MSG_LEDS _UxGT("Svetlo") -#define MSG_LED_PRESETS _UxGT("Prednastavené farby") -#define MSG_SET_LEDS_RED _UxGT("Červená") -#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") -#define MSG_SET_LEDS_YELLOW _UxGT("Žltá") -#define MSG_SET_LEDS_GREEN _UxGT("Zelená") -#define MSG_SET_LEDS_BLUE _UxGT("Modrá") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Fialová") -#define MSG_SET_LEDS_WHITE _UxGT("Biela") -#define MSG_SET_LEDS_DEFAULT _UxGT("Obnoviť nastavenie") -#define MSG_CUSTOM_LEDS _UxGT("Vlastná farba") -#define MSG_INTENSITY_R _UxGT("Inten. červenej") -#define MSG_INTENSITY_G _UxGT("Inten. zelenej") -#define MSG_INTENSITY_B _UxGT("Inten. modrej") -#define MSG_INTENSITY_W _UxGT("Inten. bielej") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") - -#define MSG_USER_MENU _UxGT("Vlastné príkazy") -#define MSG_MOVING _UxGT("Posun...") -#define MSG_FREE_XY _UxGT("Uvolniť XY") -#define MSG_MOVE_X _UxGT("Posunúť X") -#define MSG_MOVE_Y _UxGT("Posunúť Y") -#define MSG_MOVE_Z _UxGT("Posunúť Z") -#define MSG_MOVE_E _UxGT("Extrúder") -#define MSG_MOVE_01MM _UxGT("Posunúť o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunúť o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunúť o 10mm") -#define MSG_SPEED _UxGT("Rýchlosť") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_FAN_SPEED _UxGT("Rýchlosť vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rýchlosť ex. vent.") -#define MSG_FLOW _UxGT("Prietok") -#define MSG_CONTROL _UxGT("Ovládanie") -#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(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") -#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("Vybrať") -#define MSG_ACC _UxGT("Zrýchl") -#define MSG_JERK _UxGT("Skok") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-skok") - #define MSG_VB_JERK _UxGT("Vb-skok") - #define MSG_VC_JERK _UxGT("Vc-skok") -#else - #define MSG_VA_JERK _UxGT("Vx-skok") - #define MSG_VB_JERK _UxGT("Vy-skok") - #define MSG_VC_JERK _UxGT("Vz-skok") -#endif -#define MSG_VE_JERK _UxGT("Ve-skok") -#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#define MSG_VELOCITY _UxGT("Rýchlosť") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerácia") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-prejazd") -#define MSG_STEPS_PER_MM _UxGT("Krokov/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Akrokov/mm") - #define MSG_BSTEPS _UxGT("Bkrokov/mm") - #define MSG_CSTEPS _UxGT("Ckrokov/mm") -#else - #define MSG_ASTEPS _UxGT("Xkrokov/mm") - #define MSG_BSTEPS _UxGT("Ykrokov/mm") - #define MSG_CSTEPS _UxGT("Zkrokov/mm") -#endif -#define MSG_ESTEPS _UxGT("Ekrokov/mm") -#define MSG_E1STEPS _UxGT("E1krokov/mm") -#define MSG_E2STEPS _UxGT("E2krokov/mm") -#define MSG_E3STEPS _UxGT("E3krokov/mm") -#define MSG_E4STEPS _UxGT("E4krokov/mm") -#define MSG_E5STEPS _UxGT("E5kroků/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Priem.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunúť mm") -#define MSG_FILAMENT_LOAD _UxGT("Zaviesť mm") -#define MSG_ADVANCE_K _UxGT("K pro posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Uložiť nastavenie") -#define MSG_LOAD_EEPROM _UxGT("Načítať nastaveníe") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnoviť nastavenie") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_REFRESH _UxGT("Obnoviť") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Príprava tlače") -#define MSG_TUNE _UxGT("Doladenie tlače") -#define MSG_PAUSE_PRINT _UxGT("Pozastaviť tlač") -#define MSG_RESUME_PRINT _UxGT("Obnoviť tlač") -#define MSG_STOP_PRINT _UxGT("Zastaviť tlač") -#define MSG_CARD_MENU _UxGT("Tlačiť z SD") -#define MSG_NO_CARD _UxGT("Žiadna SD karta") -#define MSG_DWELL _UxGT("Spím...") -#define MSG_USERWAIT _UxGT("Kliknutím pokrač.") -#define MSG_PRINT_PAUSED _UxGT("Tlač pozastavená") -#define MSG_PRINTING _UxGT("Tlačím...") -#define MSG_PRINT_ABORTED _UxGT("Tlač zrušená") -#define MSG_NO_MOVE _UxGT("Žiadny pohyb.") -#define MSG_KILLED _UxGT("PRERUŠENÉ. ") -#define MSG_STOPPED _UxGT("ZASTAVENÉ. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výmena Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovať V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zdvih Z 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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Vymeniť filament") -#define MSG_FILAMENTLOAD _UxGT("Zaviesť filament") -#define MSG_FILAMENTUNLOAD _UxGT("Vysunúť filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunúť všetko") - -#define MSG_INIT_SDCARD _UxGT("Načítať SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vymeniť SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor skosenia") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Vysunúť") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Zasunúť") -#define MSG_HOME _UxGT("Najprv") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("domov") -#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 zastavil") -#define MSG_HEATING_FAILED_LCD _UxGT("Chyba ohrevu") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba ohrevu podl.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEPLOTA") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÝ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEPLOTNÝ SKOK PODL.") -#define MSG_ERR_MAXTEMP _UxGT("VYSOKÁ TEPLOTA") -#define MSG_ERR_MINTEMP _UxGT("NÍZKA TEPLOTA") -#define MSG_ERR_MAXTEMP_BED _UxGT("VYS. TEPL. PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TLAČ. ZASTAVENÁ") -#define MSG_PLEASE_RESET _UxGT("Spravte reset") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Ohrev...") -#define MSG_COOLING _UxGT("Ochladzovanie...") -#define MSG_BED_HEATING _UxGT("Ohrev podl...") -#define MSG_BED_COOLING _UxGT("Ochladzovanie podl...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrácia") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovať X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovať Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovať Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovať Stred") -#define MSG_DELTA_SETTINGS _UxGT("Delta nastavenia") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autokalibrácia") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast.výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Offset sondy Z") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag rameno") -#define MSG_DELTA_HEIGHT _UxGT("Výška") -#define MSG_DELTA_RADIUS _UxGT("Polomer") -#define MSG_INFO_MENU _UxGT("O tlačiarni") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tlačiarni") -#define MSG_3POINT_LEVELING _UxGT("3-bodové rovnanie") -#define MSG_LINEAR_LEVELING _UxGT("Lineárne rovnanie") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineárne rovnanie") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_INFO_STATS_MENU _UxGT("Štatistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o doske") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rýchlosť") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvetlenie") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas svetla") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tlačí") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončené") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia tlač") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkom vytlačené") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tlače") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačené") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Budenie motorov") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Uložiť do EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("PAUZA TLAČE") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("ZAVEDENIE FILAMENTU") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("VYSUNUTIE FILAMENTU") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("MOŽN. POKRAČ.:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačiť viacej") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnoviť tlač") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_ERR_HOMING_FAILED _UxGT("Parkovanie zlyhalo") -#define MSG_ERR_PROBING_FAILED _UxGT("Kalibrácia zlyhala") -#define MSG_M600_TOO_COLD _UxGT("M600: Príliž studený") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na spustenie") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výmeny filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čakejte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunutie") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stlačte") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlačidlo...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknite pre") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na teplotu tr.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedenie") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Čakajte na") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("vytlačenie") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("na pokračovanie") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("tlače") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysúvanie...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, kliknite") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_SK_UTF_H diff --git a/Marlin_thinkerV2/Marlin/language_test.h b/Marlin_thinkerV2/Marlin/language_test.h deleted file mode 100644 index 8823bd5f11..0000000000 --- a/Marlin_thinkerV2/Marlin/language_test.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * TEST - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_TEST_H -#define LANGUAGE_TEST_H - -// Select ONE of the following Mappers. -// They decide what to do with a symbol in the area of [0x80:0xFF]. They take a symbol of this language file and make them point -// into an array with 128 cells, where they'll find the place of the symbol of the font in use. -// -// a.)For ASCII coded Language_xx.h files like (en) there are no occurrences of symbols above 0x7F so no mapper is needed. -// If such a symbol appears it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or -// "\xxx" symbols. All Symbols are only one byte long. -// b.) For Unicoded Language_xx.h files (currently ru, de and kana_utf8 ) the non ASCII [0x00-0x7F] symbols are represented by more than one byte. -// In the case of two bytes the first is pointing to a 'codepage' and the second to a place in the codepage. These codepages contain 64 symbols. -// So two of them can be mapped. For most of the European languages the necessary symbols are contained in the pages C2 and C3. Cyrillic uses D0 -// and D1. -// c.) For katakana (one of the Japanese symbol sets) Unicode uses 3 bytes. Here the second byte also points to a codepage and byte 3 to the symbol. -// I hope the pages E282 and E283 are sufficient to write katakana. -// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not -// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). - -//#define MAPPER_C2C3 // For most European languages when language file is in utf8 -//#define MAPPER_D0D1 // For Cyrillic -//#define MAPPER_E382E383 // For Katakana -//#define MAPPER_NON // For direct ascii codes. Fall back mapper - if no other is defined. - - -// Select the better font for full graphic displays. -//#define DISPLAY_CHARSET_ISO10646_1 -//#define DISPLAY_CHARSET_ISO10646_5 -//#define DISPLAY_CHARSET_ISO10646_GREEK -//#define DISPLAY_CHARSET_ISO10646_KANA - - - -// next 5 lines select variants in this file only -#define DISPLAYTEST -//#define WEST -//#define CYRIL -//#define KANA - - -// TESTSTRINGS - -#define STRG_ASCII_2 " !\"#$%&'()*+,-./" -#define STRG_ASCII_3 "0123456789:;<=>?" -#define STRG_ASCII_4 "@ABCDEFGHIJKLMNO" -#define STRG_ASCII_5 "PQRSTUVWXYZ[\]^_" -#define STRG_ASCII_6 "`abcdefghijklmno" -#define STRG_ASCII_7 "pqrstuvwxyz{|}~" - -#define STRG_C2_8 "" -#define STRG_C2_9 "" -#define STRG_C2_a " ¡¢£¤¥¦§¨©ª«¬­®¯" -#define STRG_C2_b "°±²³´µ¶·¸¹º»¼½¾¿" -#define STRG_C3_8 "ÈÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" -#define STRG_C3_9 "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" -#define STRG_C3_a "àáâãäåæçèéêëìíîï" -#define STRG_C3_b "ðñòóôõö÷øùúûüýþÿ" - -#define STRG_D0_8 "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ" -#define STRG_D0_9 "АБВГДЕЖЗИЙКЛМНОП" -#define STRG_D0_a "РСТУФХЦЧШЩЪЫЬЭЮЯ" -#define STRG_D0_b "абвгдежзийклмноп" -#define STRG_D1_8 "рстуфхцчшщъыьэюя" -#define STRG_D1_9 "ѐёђѓєѕіїјљњћќѝўџ" -#define STRG_D1_a "ѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯ" -#define STRG_D1_b "ѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿ" - -#define STRG_E382_8 "よめもゃやゅゆょよらりるれろゎわ" -#define STRG_E382_9 "ゐゑをんゔゕゖ゗゘゙゚゛ ゜ゝゞゟ" -#define STRG_E382_a "゠ァアィイゥウェエォオカガキギク" -#define STRG_E382_b "グケゲコゴサザシジスズセゼソゾタ" -#define STRG_E383_8 "トチヂッツヅテデトドナニヌネノハ" -#define STRG_E383_9 "バパヒビピフブプヘベペホボポマミ" -#define STRG_E383_a "ムメモャヤュユョヨラリルレロヮワ" -#define STRG_E383_b "ヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿ" - -#define STRG_OKTAL_0 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" -#define STRG_OKTAL_1 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define STRG_OKTAL_2 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" -#define STRG_OKTAL_3 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" -#define STRG_OKTAL_4 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" -#define STRG_OKTAL_5 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" -#define STRG_OKTAL_6 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" -#define STRG_OKTAL_7 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" -#define STRG_OKTAL_8 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" -#define STRG_OKTAL_9 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" -#define STRG_OKTAL_a "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" -#define STRG_OKTAL_b "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" -#define STRG_OKTAL_c "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" -#define STRG_OKTAL_d "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" -#define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" -#define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" - -#if ENABLED(DISPLAYTEST) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "Display test" - #define MSG_PREPARE STRG_OKTAL_b - #define MSG_CONTROL STRG_OKTAL_c -#endif - -#if ENABLED(WEST) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_C2_8 - #define MSG_AUTO_HOME STRG_C2_9 - #define MSG_SET_HOME_OFFSETS STRG_C2_a - #define MSG_PREHEAT_1 STRG_C2_b - #define MSG_PREHEAT_2 STRG_C3_8 - #define MSG_COOLDOWN STRG_C3_9 - #define MSG_SWITCH_PS_OFF STRG_C3_a - #define MSG_MOVE_AXIS STRG_C3_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(CYRIL) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_D0_8 - #define MSG_AUTO_HOME STRG_D0_9 - #define MSG_SET_HOME_OFFSETS STRG_D0_a - #define MSG_PREHEAT_1 STRG_D0_b - #define MSG_PREHEAT_2 STRG_D1_8 - #define MSG_COOLDOWN STRG_D1_9 - #define MSG_SWITCH_PS_OFF STRG_D1_a - #define MSG_MOVE_AXIS STRG_D1_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(KANA) - #define WELCOME_MSG "Language TEST" - - #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" - #define MSG_PREPARE "UTF8" - #define MSG_CONTROL "ASCII" - - //#define MSG_MAIN ".." - #define MSG_DISABLE_STEPPERS STRG_E382_8 - #define MSG_AUTO_HOME STRG_E382_9 - #define MSG_SET_HOME_OFFSETS STRG_E382_a - #define MSG_PREHEAT_1 STRG_E382_b - #define MSG_PREHEAT_2 STRG_E383_8 - #define MSG_COOLDOWN STRG_E383_9 - #define MSG_SWITCH_PS_OFF STRG_E383_a - #define MSG_MOVE_AXIS STRG_E383_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f -#endif - -#endif // LANGUAGE_TEST_H diff --git a/Marlin_thinkerV2/Marlin/language_tr.h b/Marlin_thinkerV2/Marlin/language_tr.h deleted file mode 100644 index 6234d149ac..0000000000 --- a/Marlin_thinkerV2/Marlin/language_tr.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Turkish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_TR_H -#define LANGUAGE_TR_H - -#define MAPPER_C2C3_TR -#define DISPLAY_CHARSET_ISO10646_TR -#define CHARSIZE 2 - -#if DISABLED(DOGLCD) - #error "Turkish needs a graphical display." -#endif - -#define WELCOME_MSG MACHINE_NAME _UxGT(" hazır.") // hazır. -#define MSG_SD_INSERTED _UxGT("SD Yerleşti.") // SD Yerleşti. -#define MSG_SD_REMOVED _UxGT("SD Çıkarıldı.") // SD Çıkarıldı. -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters // Endstops -#define MSG_MAIN _UxGT("Ana") // Ana -#define MSG_BACK _UxGT("Geri") // Geri -#define MSG_AUTOSTART _UxGT("Otobaşlat") // Otobaşlat -#define MSG_DISABLE_STEPPERS _UxGT("Motorları Durdur") // Motorları Durdur -#define MSG_DEBUG_MENU _UxGT("Hata Ayıklama") // Hata Ayıklama -#define MSG_PROGRESS_BAR_TEST _UxGT("Durum Çubuğu Testi") // Durum Çubuğu Testi -#define MSG_AUTO_HOME _UxGT("Eksenleri Sıfırla") // Eksenleri Sıfırla -#define MSG_AUTO_HOME_X _UxGT("X Sıfırla") // X Sıfırla -#define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") // Y Sıfırla -#define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") // Z Sıfırla -#define MSG_TMC_Z_CALIBRATION _UxGT("Ayarla Z") // Ayarla Z -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") // XYZ Sıfırlanıyor -#define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") // Başlatmak için tıkla -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sıradaki Nokta") // Sıradaki Nokta -#define MSG_LEVEL_BED_DONE _UxGT("Seviyeleme Tamam!") // Seviyeleme Tamam! -#define MSG_SET_HOME_OFFSETS _UxGT("Offset Ayarla") // Offset Ayarla -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset Tamam") // Offset Tamam -#define MSG_SET_ORIGIN _UxGT("Sıfır Belirle") // Sıfır Belirle -#define MSG_PREHEAT_1 _UxGT("Ön Isınma PLA") // Ön Isınma PLA -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") // -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ayar") // Ayar -#define MSG_PREHEAT_2 _UxGT("Ön Isınma ABS") // Ön Isınma ABS -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") // -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ayar") // Ayar -#define MSG_COOLDOWN _UxGT("Soğut") // Soğut -#define MSG_SWITCH_PS_ON _UxGT("Gücü Aç") // Gücü Aç -#define MSG_SWITCH_PS_OFF _UxGT("Gücü Kapat") // Gücü Kapat -#define MSG_EXTRUDE _UxGT("Extrude") // Extrude -#define MSG_RETRACT _UxGT("Geri Çek") // Geri Çek -#define MSG_MOVE_AXIS _UxGT("Eksen Yönet") // Eksenleri Yönet -#define MSG_BED_LEVELING _UxGT("Tabla Seviyele") // Tabla Seviyele -#define MSG_LEVEL_BED _UxGT("Tabla Seviyele") // Tabla Seviyele -#define MSG_MOVING _UxGT("Konumlanıyor...") // Konumlanıyor... -#define MSG_FREE_XY _UxGT("Durdur XY") // Durdur XY -#define MSG_MOVE_X _UxGT("X") // X -#define MSG_MOVE_Y _UxGT("Y") // Y -#define MSG_MOVE_Z _UxGT("Z") // Z -#define MSG_MOVE_E _UxGT("Ekstruder") // Ekstruder -#define MSG_MOVE_01MM _UxGT("0.1mm") // 0.1mm -#define MSG_MOVE_1MM _UxGT("1mm") // 1mm -#define MSG_MOVE_10MM _UxGT("10mm") // 10mm -#define MSG_SPEED _UxGT("Hız") // Hız -#define MSG_BED_Z _UxGT("Z Mesafesi") // Z Mesafesi -#define MSG_NOZZLE _UxGT("Nozül") // Nozül -#define MSG_BED _UxGT("Tabla") // Tabla -#define MSG_FAN_SPEED _UxGT("Fan Hızı") // Fan Hızı -#define MSG_FLOW _UxGT("Akış") // Akış -#define MSG_CONTROL _UxGT("Kontrol") // Kontrol -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") // Min -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") // Max -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Çarpan") // Çarpan -#define MSG_AUTOTEMP _UxGT("Autotemp") // Autotemp -#define MSG_ON _UxGT("On ") // On -#define MSG_OFF _UxGT("Off") // Off -#define MSG_PID_P _UxGT("PID-P") // PID-P -#define MSG_PID_I _UxGT("PID-I") // PID-I -#define MSG_PID_D _UxGT("PID-D") // PID-D -#define MSG_PID_C _UxGT("PID-C") // PID-C -#define MSG_SELECT _UxGT("Seç") // Seç -#define MSG_ACC _UxGT("İvme") // İvme -#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") // Ve-Jerk -#define MSG_VMAX _UxGT("Vmax ") // Vmax -#define MSG_VMIN _UxGT("Vmin") // Vmin -#define MSG_VTRAV_MIN _UxGT("VTrav min") // Vtrav min -#define MSG_AMAX _UxGT("Amax ") // Amax -#define MSG_A_RETRACT _UxGT("A-retract") // A-retract -#define MSG_A_TRAVEL _UxGT("A-travel") // A-travel -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") // 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") // Esteps/mm -#define MSG_E1STEPS _UxGT("E1steps/mm") // E1steps/mm -#define MSG_E2STEPS _UxGT("E2steps/mm") // E2steps/mm -#define MSG_E3STEPS _UxGT("E3steps/mm") // E3steps/mm -#define MSG_E4STEPS _UxGT("E4steps/mm") // E4steps/mm -#define MSG_E5STEPS _UxGT("E5steps/mm") // E4steps/mm -#define MSG_TEMPERATURE _UxGT("Sıcaklık") // Sıcaklık -#define MSG_MOTION _UxGT("Hareket") // Hareket -#define MSG_FILAMENT _UxGT("Filaman") // Filaman -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") // E in mm3 -#define MSG_FILAMENT_DIAM _UxGT("Fil. Çap") // Fil. Çap -#define MSG_ADVANCE_K _UxGT("K İlerlet") // K İlerlet -#define MSG_CONTRAST _UxGT("LCD Kontrast") // LCD Kontrast -#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") // Hafızaya Al -#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") // Hafızadan Yükle -#define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") // Fabrika Ayarları -#define MSG_REFRESH _UxGT("Yenile") // Yenile -#define MSG_WATCH _UxGT("Bilgi Ekranı") // Bilgi Ekranı -#define MSG_PREPARE _UxGT("Hazırlık") // Hazırlık -#define MSG_TUNE _UxGT("Ayar") // Ayar -#define MSG_PAUSE_PRINT _UxGT("Duraklat") // Duraklat -#define MSG_RESUME_PRINT _UxGT("Sürdür") // Sürdür -#define MSG_STOP_PRINT _UxGT("Durdur") // Durdur -#define MSG_CARD_MENU _UxGT("SD den Yazdır") // SD den Yazdır -#define MSG_NO_CARD _UxGT("SD Kart Yok") // SD Kart Yok -#define MSG_DWELL _UxGT("Uyku...") // Uyku... -#define MSG_USERWAIT _UxGT("Operatör bekleniyor...") // Operatör bekleniyor... -#define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu") // Baskı Durduruldu -#define MSG_NO_MOVE _UxGT("İşlem yok.") // İşlem yok. -#define MSG_KILLED _UxGT("Kilitlendi. ") // Kilitlendi. -#define MSG_STOPPED _UxGT("Durdu. ") // Durdu. -#define MSG_CONTROL_RETRACT _UxGT("Geri Çek mm") // Geri Çek mm -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") // Swap Re.mm -#define MSG_CONTROL_RETRACTF _UxGT("Geri Çekme V") // Geri Çekme V -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") // Hop mm -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") // UnRet mm -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") // S UnRetmm -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") // UnRet V -#define MSG_AUTORETRACT _UxGT("AutoRetr.") // AutoRetr. -#define MSG_FILAMENTCHANGE _UxGT("Filaman Değiştir") // Filaman Değiştir -#define MSG_INIT_SDCARD _UxGT("Init. SD") // Init. SD -#define MSG_CNG_SDCARD _UxGT("SD Değiştir") // SD Değiştir -#define MSG_ZPROBE_OUT _UxGT("Z Prob Açık. Tabla") // Z Prob Açık. Tabla -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") // BLTouch Self-Test -#define MSG_BLTOUCH_RESET _UxGT("Sıfırla BLTouch") // Sıfırla BLTouch -#define MSG_HOME _UxGT("Sıfırla") // Sıfırla -#define MSG_FIRST _UxGT("önce") // Önce -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") // Z Offset -#define MSG_BABYSTEP_X _UxGT("Miniadım X") // Miniadım X -#define MSG_BABYSTEP_Y _UxGT("Miniadım Y") // Miniadım Y -#define MSG_BABYSTEP_Z _UxGT("Miniadım Z") // Miniadım Z -#define MSG_ENDSTOP_ABORT _UxGT("Endstop iptal") // Endstop iptal -#define MSG_HEATING_FAILED_LCD _UxGT("Isınma başarısız") // Isınma başarısız -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Hata: Geçersiz Sıcaklık") // Hata: Geçersiz Sıcaklık -#define MSG_THERMAL_RUNAWAY _UxGT("TERMAL PROBLEM") // TERMAL PROBLEM -#define MSG_ERR_MAXTEMP _UxGT("Hata: MAXSICAKLIK") // Hata: MAXSICAKLIK -#define MSG_ERR_MINTEMP _UxGT("Hata: MINSICAKLIK") // Hata: MINSICAKLIK -#define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAXSIC. TABLA") // Hata: MAXSIC. TABLA -#define MSG_ERR_MINTEMP_BED _UxGT("Hata: MINSIC. TABLA") // Hata: MINSIC. TABLA -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("YAZICI DURDURULDU") // YAZICI DURDURULDU -#define MSG_PLEASE_RESET _UxGT("Lütfen resetleyin") // Lütfen resetleyin -#define MSG_SHORT_DAY _UxGT("G") // One character only // G -#define MSG_SHORT_HOUR _UxGT("S") // One character only // S -#define MSG_SHORT_MINUTE _UxGT("D") // One character only // D -#define MSG_HEATING _UxGT("Isınıyor...") // Isınıyor... -#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") // Tabla Isınıyor... -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") // Delta Kalibrasyonu -#define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") // Ayarla X -#define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") // Ayarla Y -#define MSG_DELTA_CALIBRATE_Z _UxGT("Ayarla Z") // Ayarla Z -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Ayarla Merkez") // Ayarla Merkez -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Oto Kalibrasyon") // Oto Kalibrasyon -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Yük. Ayarla") // Delta Yük. Ayarla -#define MSG_INFO_MENU _UxGT("Yazıcı Hakkında") // Yazıcı Hakkında -#define MSG_INFO_PRINTER_MENU _UxGT("Yazıcı Bilgisi") // Yazıcı Bilgisi -#define MSG_INFO_STATS_MENU _UxGT("İstatistikler") // İstatistikler -#define MSG_INFO_BOARD_MENU _UxGT("Kontrolör Bilgisi") // Kontrol Bilgisi -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistörler") // Termistörler -#define MSG_INFO_EXTRUDERS _UxGT("Ekstruderler") // Ekstruderler -#define MSG_INFO_BAUDRATE _UxGT("İletişim Hızı") // İletişim Hızı -#define MSG_INFO_PROTOCOL _UxGT("Protokol") // Protokol -#define MSG_CASE_LIGHT _UxGT("Aydınlatmayı") // Aydınlatmayı Aç - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı Sayısı") // Baskı Sayısı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Toplam Baskı Süresi") // Toplam Baskı Süresi - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun Baskı Süresi") // En Uzun Baskı Süresi - #define MSG_INFO_PRINT_FILAMENT _UxGT("Toplam Filaman") // Toplam Filaman -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı") // Baskı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Süre") // Süre - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun") // En Uzun - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filaman") // Filaman -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Sıc.") // Min Sıcak. -#define MSG_INFO_MAX_TEMP _UxGT("Max Sıc.") // Max Sıcak. -#define MSG_INFO_PSU _UxGT("Güç Kaynağı") // Güç Kaynağı - -#define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") // Sürücü Gücü -#define MSG_DAC_PERCENT _UxGT("Sürücü %") // Sürücü % -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") // Seçenekler: -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül: - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Başlama bekleniyor") // Başlama bekleniyor - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamanın") // filamanın - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("değişimi") // değişimi - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamanın çıkması") // filamanın çıkması - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filamanı yükle") // Filamanı yükle - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("ve devam için") // ve devam için - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tuşa bas...") // tuşa bas... - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Nozülü Isıtmak için") // Nozülü Isıtmak için - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Butona Bas.") // Butona Bas. - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozül Isınıyor") // Nozül Isınıyor - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") // Lütfen Bekleyin... - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamanın yüklenmesi") // filamanın yüklenmesi - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının sürdürülmesini") // Baskının sürdürülmesini - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("bekle") // bekle -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Lütfen bekleyiniz...") // Lütfen bekleyiniz... - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") // Çıkartılıyor... - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") // Yükle ve bas - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") // Yüklüyor... - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") // Sürdürülüyor... -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_TR_H diff --git a/Marlin_thinkerV2/Marlin/language_uk.h b/Marlin_thinkerV2/Marlin/language_uk.h deleted file mode 100644 index ed71d1a6c5..0000000000 --- a/Marlin_thinkerV2/Marlin/language_uk.h +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ukrainian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_UK_H -#define LANGUAGE_UK_H - -#define MAPPER_D0D1 // For Cyrillic -#define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" готовий.") -#define MSG_SD_INSERTED _UxGT("Картка вставлена") -#define MSG_SD_REMOVED _UxGT("Картка видалена") -#define MSG_LCD_ENDSTOPS _UxGT("Кінцевик") // Max length 8 characters -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Вимк. двигуни") -#define MSG_AUTO_HOME _UxGT("Авто паркування") -#define MSG_AUTO_HOME_X _UxGT("Паркування X") -#define MSG_AUTO_HOME_Y _UxGT("Паркування Y") -#define MSG_AUTO_HOME_Z _UxGT("Паркування Z") -#define MSG_TMC_Z_CALIBRATION _UxGT("Калібрування Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Паркування XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Почати") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Слідуюча Точка") -#define MSG_LEVEL_BED_DONE _UxGT("Завершено!") -#define MSG_SET_HOME_OFFSETS _UxGT("Зберегти паркув.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Зміщення застос.") -#define MSG_SET_ORIGIN _UxGT("Встанов. початок") -#define MSG_PREHEAT_1 _UxGT("Нагрів PLA") -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Все") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Стіл") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" нал.") -#define MSG_PREHEAT_2 _UxGT("Нагрів ABS") -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Все") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Стіл") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" нал.") -#define MSG_COOLDOWN _UxGT("Охолодження") -#define MSG_SWITCH_PS_ON _UxGT("Увімкнути живлення") -#define MSG_SWITCH_PS_OFF _UxGT("Вимкнути живлення") -#define MSG_EXTRUDE _UxGT("Екструзія") -#define MSG_RETRACT _UxGT("Втягування") -#define MSG_MOVE_AXIS _UxGT("Рух по осям") -#define MSG_BED_LEVELING _UxGT("Нівелювання столу") -#define MSG_LEVEL_BED _UxGT("Нівелювання столу") -#define MSG_MOVE_X _UxGT("Рух по X") -#define MSG_MOVE_Y _UxGT("Рух по Y") -#define MSG_MOVE_Z _UxGT("Рух по Z") -#define MSG_MOVE_E _UxGT("Екструдер") -#define MSG_MOVE_01MM _UxGT("Рух по 0.1mm") -#define MSG_MOVE_1MM _UxGT("Рух по 1mm") -#define MSG_MOVE_10MM _UxGT("Рух по 10mm") -#define MSG_SPEED _UxGT("Швидкість") -#define MSG_BED_Z _UxGT("Z Столу") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _UxGT("Стіл") -#define MSG_FAN_SPEED _UxGT("Охолодж.") -#define MSG_FLOW _UxGT("Потік") -#define MSG_CONTROL _UxGT("Налаштування") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Мін") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Факт") -#define MSG_AUTOTEMP _UxGT("Автотемпер.") -#define MSG_ON _UxGT("Увімк.") -#define MSG_OFF _UxGT("Вимк. ") -#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("Вибрати") -#define MSG_ACC _UxGT("Приск.") -#define MSG_JERK _UxGT("Ривок") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-ривок") - #define MSG_VB_JERK _UxGT("Vb-ривок") - #define MSG_VC_JERK _UxGT("Vc-ривок") -#else - #define MSG_VA_JERK _UxGT("Vx-ривок") - #define MSG_VB_JERK _UxGT("Vy-ривок") - #define MSG_VC_JERK _UxGT("Vz-ривок") -#endif -#define MSG_VE_JERK _UxGT("Ve-ривок") -#define MSG_VMAX _UxGT("Vмакс") -#define MSG_VMIN _UxGT("Vмін") -#define MSG_VTRAV_MIN _UxGT("Vруху мін") -#define MSG_AMAX _UxGT("Aмакс ") -#define MSG_A_RETRACT _UxGT("A-втягув.") -#define MSG_A_TRAVEL _UxGT("A-руху") -#define MSG_STEPS_PER_MM _UxGT("Кроків/мм") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Aкроків/мм") - #define MSG_BSTEPS _UxGT("Bкроків/мм") - #define MSG_CSTEPS _UxGT("Cкроків/мм") -#else - #define MSG_ASTEPS _UxGT("Xкроків/мм") - #define MSG_BSTEPS _UxGT("Yкроків/мм") - #define MSG_CSTEPS _UxGT("Zкроків/мм") -#endif -#define MSG_ESTEPS _UxGT("Eкроків/мм") -#define MSG_E1STEPS _UxGT("E1кроків/мм") -#define MSG_E2STEPS _UxGT("E2кроків/мм") -#define MSG_E3STEPS _UxGT("E3кроків/мм") -#define MSG_E4STEPS _UxGT("E4кроків/мм") -#define MSG_E5STEPS _UxGT("E5кроків/мм") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Рух") -#define MSG_FILAMENT _UxGT("Волокно") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") -#define MSG_FILAMENT_DIAM _UxGT("Діам. волок.") -#define MSG_CONTRAST _UxGT("контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Зберегти в ПЗП") -#define MSG_LOAD_EEPROM _UxGT("Зчитати з ПЗП") -#define MSG_RESTORE_FAILSAFE _UxGT("Відновити базові") -#define MSG_REFRESH _UxGT("Поновити") -#define MSG_WATCH _UxGT("Інформація") -#define MSG_PREPARE _UxGT("Підготувати") -#define MSG_TUNE _UxGT("Підлаштування") -#define MSG_PAUSE_PRINT _UxGT("Призупинити друк") -#define MSG_RESUME_PRINT _UxGT("Відновити друк") -#define MSG_STOP_PRINT _UxGT("Скасувати друк") -#define MSG_CARD_MENU _UxGT("Друкувати з SD") -#define MSG_NO_CARD _UxGT("Відсутня SD карт.") -#define MSG_DWELL _UxGT("Сплячка...") -#define MSG_USERWAIT _UxGT("Очікування дій...") -#define MSG_PRINT_ABORTED _UxGT("Друк скасовано") -#define MSG_NO_MOVE _UxGT("Немає руху.") -#define MSG_KILLED _UxGT("ПЕРЕРВАНО. ") -#define MSG_STOPPED _UxGT("ЗУПИНЕНО. ") -#define MSG_FILAMENTCHANGE _UxGT("Зміна волокна") -#define MSG_INIT_SDCARD _UxGT("Старт SD картки") -#define MSG_CNG_SDCARD _UxGT("Заміна SD карти") -#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_ZPROBE_ZOFFSET _UxGT("Зміщення Z") -#define MSG_BABYSTEP_X _UxGT("Мікрокрок X") -#define MSG_BABYSTEP_Y _UxGT("Мікрокрок Y") -#define MSG_BABYSTEP_Z _UxGT("Мікрокрок Z") -#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_HALTED _UxGT("ПРИНТЕР ЗУПИНЕНО") -#define MSG_PLEASE_RESET _UxGT("Перезавантажте") -#define MSG_SHORT_DAY _UxGT("д") // One character only -#define MSG_SHORT_HOUR _UxGT("г") // One character only -#define MSG_SHORT_MINUTE _UxGT("х") // One character only -#define MSG_HEATING _UxGT("Нагрівання...") -#define MSG_BED_HEATING _UxGT("Нагрівання столу...") -#define MSG_DELTA_CALIBRATE _UxGT("Калібр. Delta") -#define MSG_DELTA_CALIBRATE_X _UxGT("Калібрування X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Калібрування Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Калібрування Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Калібр. Центру") - -#define MSG_INFO_MENU _UxGT("Про принтер") -#define MSG_INFO_PRINTER_MENU _UxGT("Інформація") -#define MSG_INFO_STATS_MENU _UxGT("Статистика") -#define MSG_INFO_BOARD_MENU _UxGT("Про плату") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термістори") -#define MSG_INFO_EXTRUDERS _UxGT("Екструдери") -#define MSG_INFO_BAUDRATE _UxGT("біт/с") -#define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Підсвітка") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("К-сть друків") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Завершено") - #define MSG_INFO_PRINT_TIME _UxGT("Весь час друку") - #define MSG_INFO_PRINT_LONGEST _UxGT("Найдовший час") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Екструдовано") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Друків") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Завершено") - #define MSG_INFO_PRINT_TIME _UxGT("Загалом") - #define MSG_INFO_PRINT_LONGEST _UxGT("Найдовший") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Ексдруд.") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Мін Темп.") -#define MSG_INFO_MAX_TEMP _UxGT("Макс Темп.") -#define MSG_INFO_PSU _UxGT("Джерело жив.") - -#define MSG_DRIVE_STRENGTH _UxGT("Сила мотору") -#define MSG_DAC_PERCENT _UxGT("% мотору") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запис ЦАП на ПЗП") - -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Відновити друк") - -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("початок заміни") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("волокна") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("вивід волокна") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставте волокно") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("та натисніть для") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("продовження...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("ввід волокна") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("відновлення") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("друку") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Зачекайте...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Вивід...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Вставте і нат.") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Ввід...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Відновлення...") -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_UK_H diff --git a/Marlin_thinkerV2/Marlin/language_zh_CN.h b/Marlin_thinkerV2/Marlin/language_zh_CN.h deleted file mode 100644 index 824033c0b0..0000000000 --- a/Marlin_thinkerV2/Marlin/language_zh_CN.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Simplified Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ZH_CN_H -#define LANGUAGE_ZH_CN_H - -//#define zh_CN 1234 - -#define CHARSIZE 3 - -#define WELCOME_MSG MACHINE_NAME _UxGT("已就绪.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ -#define MSG_SD_INSERTED _UxGT("存储卡已插入") //"Card inserted" -#define MSG_SD_REMOVED _UxGT("存储卡被拔出") //"Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("挡块") //"Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("主菜单") //"Main" -#define MSG_AUTOSTART _UxGT("自动开始") //"Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("关闭步进电机") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("调试菜单") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("进度条测试") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("回原点") //"Auto home" -#define MSG_AUTO_HOME_X _UxGT("回X原位") //"Home X" -#define MSG_AUTO_HOME_Y _UxGT("回Y原位") //"Home Y" -#define MSG_AUTO_HOME_Z _UxGT("回Z原位") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校准Z") //"Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("平台调平XYZ归原位") //"Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("单击开始热床调平") //"Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("下个热床调平点") //"Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("完成热床调平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" -#define MSG_SET_HOME_OFFSETS _UxGT("设置原点偏移") //"Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已启用") //"Offsets applied" -#define MSG_SET_ORIGIN _UxGT("设置原点") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("预热PLA") //"Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 热床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 设置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("预热ABS") //"Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 热床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 设置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降温") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("电源打开") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("电源关闭") //"Switch power off" -#define MSG_EXTRUDE _UxGT("挤出") //"Extrude" -#define MSG_RETRACT _UxGT("回抽") //"Retract" -#define MSG_MOVE_AXIS _UxGT("移动轴") //"Move axis" -#define MSG_BED_LEVELING _UxGT("调平热床") //"Bed leveling" -#define MSG_LEVEL_BED _UxGT("调平热床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("调平边角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个边角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("网格编辑已停止") // "Mesh Editing Stopped" - -#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" - -#define MSG_UBL_BC_INSERT _UxGT("放置垫片并测量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("测量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除并测量热床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移动到下一个") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("关闭UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("设置热床温度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("热端温度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("网格编辑") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("编辑客户网格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("细调网格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成编辑网格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("创设客户网格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("创设网格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("创设PLA网格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("创设ABS网格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("创设冷网格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("调整网格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合计") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准网格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA网格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS网格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客户网格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("继续热床网格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子网格调平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("调平网格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("边点") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("图类型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("输出网格图") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("输出到主机") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("输出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("输出到备份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("输出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("编辑网格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合计") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聪明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充网格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作废所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作废最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("细调所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("细调最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("网格存储") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存储槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("装载热床网格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存热床网格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("网格 %i 已装载") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("网格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("没有存储") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("错误: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("错误: UBL还原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红饱和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿饱和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝饱和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白饱和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - -#define MSG_MOVE_X _UxGT("移动X") //"Move X" -#define MSG_MOVE_Y _UxGT("移动Y") //"Move Y" -#define MSG_MOVE_Z _UxGT("移动Z") //"Move Z" -#define MSG_MOVE_E _UxGT("挤出机") //"Extruder" -#define MSG_MOVE_01MM _UxGT("移动 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移动 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移动 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("热床Z") //"Bed Z" -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 喷嘴") //"Nozzle" 噴嘴 -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 热床") //"Bed" -#define MSG_FAN_SPEED _UxGT("风扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("额外风扇速率") // "Extra fan speed" -#define MSG_FLOW _UxGT("挤出速率") //"Flow" -#define MSG_CONTROL _UxGT("控制") //"Control" -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 因数") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自动控温") //"Autotemp" -#define MSG_ON _UxGT("开 ") //"On " -#define MSG_OFF _UxGT("关 ") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#define MSG_SELECT _UxGT("选择") //"Select" -#define MSG_ACC _UxGT("加速度") //"Accel" acceleration -#define MSG_JERK _UxGT("抖动速率") // "Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A轴抖动速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B轴抖动速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C轴抖动速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X轴抖动速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y轴抖动速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z轴抖动速率") //"Vz-jerk" -#endif -#define MSG_VE_JERK _UxGT("挤出机抖动速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" -#define MSG_VMAX _UxGT("最大进料速率") //"Vmax " max_feedrate_mm_s -#define MSG_VMIN _UxGT("最小进料速率") //"Vmin" min_feedrate_mm_s -#define MSG_VTRAV_MIN _UxGT("最小移动速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" -#define MSG_AMAX _UxGT("最大打印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves -#define MSG_A_RETRACT _UxGT("收进加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts -#define MSG_A_TRAVEL _UxGT("非打印移动加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves -#define MSG_STEPS_PER_MM _UxGT("轴步数/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A轴步数/mm") //"Asteps/mm" - #define MSG_BSTEPS _UxGT("B轴步数/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C轴步数/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X轴步数/mm") //"Xsteps/mm" - #define MSG_BSTEPS _UxGT("Y轴步数/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z轴步数/mm") //"Zsteps/mm" -#endif -#define MSG_ESTEPS _UxGT("挤出机步数/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("挤出机1步数/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("挤出机2步数/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("挤出机3步数/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("挤出机4步数/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("挤出机5步数/mm") //"E5steps/mm" -#define MSG_TEMPERATURE _UxGT("温度") //"Temperature" -#define MSG_MOTION _UxGT("运动") //"Motion" -#define MSG_FILAMENT _UxGT("丝料测容") //"Filament" lcd_control_volumetric_menu -#define MSG_VOLUMETRIC_ENABLED _UxGT("测容积mm³") //"E in mm3" volumetric_enabled -#define MSG_FILAMENT_DIAM _UxGT("丝料直径") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸载 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装载 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" -#define MSG_CONTRAST _UxGT("LCD对比度") //"LCD contrast" -#define MSG_STORE_EEPROM _UxGT("保存设置") //"Store memory" -#define MSG_LOAD_EEPROM _UxGT("装载设置") //"Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("恢复安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化设置") // "Initialize EEPROM" -#define MSG_REFRESH _UxGT("刷新") //"Refresh" -#define MSG_WATCH _UxGT("信息屏") //"Info screen" -#define MSG_PREPARE _UxGT("准备") //"Prepare" -#define MSG_TUNE _UxGT("调整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暂停打印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢复打印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止打印") //"Stop print" -#define MSG_CARD_MENU _UxGT("从存储卡上打印") //"Print from SD" -#define MSG_NO_CARD _UxGT("无存储卡") //"No SD card" -#define MSG_DWELL _UxGT("休眠中 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("点击继续 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("暫停打印") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消打印") //"Print aborted" -#define MSG_NO_MOVE _UxGT("无移动") //"No move." -#define MSG_KILLED _UxGT("已杀掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回抽长度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("换手回抽长度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回抽速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回抽恢复长度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("换手回抽恢复长度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回抽恢复后进料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" -#define MSG_AUTORETRACT _UxGT("自动抽回") //"AutoRetr." autoretract_enabled, -#define MSG_FILAMENTCHANGE _UxGT("更换丝料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("装载丝料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸载丝料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸载全部") // "Unload All" -#define MSG_INIT_SDCARD _UxGT("初始化存储卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更换存储卡") //"Change SD card" -#define MSG_ZPROBE_OUT _UxGT("Z探针在热床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因数") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自检") // "BLTouch Self-Test" -#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_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" -#define MSG_BABYSTEP_Z _UxGT("微量调整Z轴") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("挡块终止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加热失败") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("错误:REDUNDANT TEMP") //"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_HEATING _UxGT("加热中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加热热床中...") //"Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("⊿校准") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校准X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校准Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校准Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校准中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿设置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自动校准") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("设置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半径") // "Radius" -#define MSG_INFO_MENU _UxGT("关于打印机") //"About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("打印机信息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三点调平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("线性调平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("双线性调平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("统一热床调平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" -#define MSG_INFO_STATS_MENU _UxGT("打印机统计") //"Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("主板信息") //"Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("温度计") //"Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("挤出机") //"Extruders" -#define MSG_INFO_BAUDRATE _UxGT("波特率") //"Baud" -#define MSG_INFO_PROTOCOL _UxGT("协议") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外壳灯") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("灯亮度") // "Light BRIGHTNESS" - -#if LCD_WIDTH > 19 -#define MSG_INFO_PRINT_COUNT _UxGT("打印计数") //"Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成了") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("总打印时间") //"Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("最长工作时间") //"Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("总计挤出") //"Extruded total" -#else -#define MSG_INFO_PRINT_COUNT _UxGT("打印数") //"Prints" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("总共") //"Total" -#define MSG_INFO_PRINT_LONGEST _UxGT("最长") //"Longest" -#define MSG_INFO_PRINT_FILAMENT _UxGT("已挤出") //"Extruded" -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("最低温度") //"Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("最高温度") //"Max Temp" -#define MSG_INFO_PSU _UxGT("电源供应") //"Power Supply" -#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_HEADER_PAUSE _UxGT("打印已暂停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("装载丝料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸载丝料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢复选项:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢复打印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 喷嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("归原位失败") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探针探测失败") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太凉") // "M600: Too cold" - -#if LCD_HEIGHT >= 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待开始") //"Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("丝料") //"of the filament" -#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("变更") //"change" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下丝料") //"filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入丝料") //"Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("并按键") //"and press button" -#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("来继续 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按钮来") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加热喷嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热喷嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("请等待 ...") // "Please wait..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("进料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("丝料清除") // "filament purge" -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待打印") //"Wait for print" -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢复") //"to resume" - -#else // LCD_HEIGHT < 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("请等待 ...") //"Please wait..." -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入并单击") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加热中 ...") // "Heating..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("装载中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢复中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_ZH_CN_H diff --git a/Marlin_thinkerV2/Marlin/language_zh_TW.h b/Marlin_thinkerV2/Marlin/language_zh_TW.h deleted file mode 100644 index b5a62a984e..0000000000 --- a/Marlin_thinkerV2/Marlin/language_zh_TW.h +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Traditional Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#ifndef LANGUAGE_ZH_TW_H -#define LANGUAGE_ZH_TW_H - -#define CHARSIZE 3 - -#define WELCOME_MSG MACHINE_NAME _UxGT("已就緒.") //" ready." -#define MSG_BACK _UxGT("返回") // ”Back“ -#define MSG_SD_INSERTED _UxGT("記憶卡已插入") //"Card inserted" -#define MSG_SD_REMOVED _UxGT("記憶卡被拔出") //"Card removed" -#define MSG_LCD_ENDSTOPS _UxGT("擋塊") //"Endstops" // Max length 8 characters -#define MSG_MAIN _UxGT("主選單") //"Main" -#define MSG_AUTOSTART _UxGT("自動開始") //"Autostart" -#define MSG_DISABLE_STEPPERS _UxGT("關閉步進馬達") //"Disable steppers" -#define MSG_DEBUG_MENU _UxGT("除錯選單") // "Debug Menu" -#define MSG_PROGRESS_BAR_TEST _UxGT("進度條測試") // "Progress Bar Test" -#define MSG_AUTO_HOME _UxGT("自動回原點") //"Auto home" -#define MSG_AUTO_HOME_X _UxGT("回X原點") //"Home X" -#define MSG_AUTO_HOME_Y _UxGT("回Y原點") //"Home Y" -#define MSG_AUTO_HOME_Z _UxGT("回Z原點") //"Home Z" -#define MSG_TMC_Z_CALIBRATION _UxGT("⊿校準Z") //"Calibrate Z" -#define MSG_LEVEL_BED_HOMING _UxGT("平台調平XYZ歸原點") //"Homing XYZ" -#define MSG_LEVEL_BED_WAITING _UxGT("單擊開始熱床調平") //"Click to Begin" -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("下個熱床調平點") //"Next Point" -#define MSG_LEVEL_BED_DONE _UxGT("完成熱床調平") //"Leveling Done!" -#define MSG_Z_FADE_HEIGHT _UxGT("淡出高度") // "Fade Height" -#define MSG_SET_HOME_OFFSETS _UxGT("設置原點偏移") //"Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已啟用") //"Offsets applied" -#define MSG_SET_ORIGIN _UxGT("設置原點") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("預熱PLA") //"Preheat PLA" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 熱床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 設置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("預熱ABS") //"Preheat ABS" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 熱床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 設置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降溫") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("電源打開") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("電源關閉") //"Switch power off" -#define MSG_EXTRUDE _UxGT("擠出") //"Extrude" -#define MSG_RETRACT _UxGT("回縮") //"Retract" -#define MSG_MOVE_AXIS _UxGT("移動軸") //"Move axis" -#define MSG_BED_LEVELING _UxGT("調平熱床") //"Bed leveling" -#define MSG_LEVEL_BED _UxGT("調平熱床") //"Level bed" -#define MSG_LEVEL_CORNERS _UxGT("調平邊角") // "Level corners" - -#define MSG_NEXT_CORNER _UxGT("下个邊角") // "Next corner" -#define MSG_EDITING_STOPPED _UxGT("網格編輯已停止") // "Mesh Editing Stopped" - -#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" - -#define MSG_UBL_BC_INSERT _UxGT("放置墊片並測量") // "Place shim & measure" -#define MSG_UBL_BC_INSERT2 _UxGT("測量") // "Measure" -#define MSG_UBL_BC_REMOVE _UxGT("移除並測量熱床") // "Remove & measure bed" -#define MSG_UBL_MOVING_TO_NEXT _UxGT("移動到下一個") // "Moving to next" -#define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" -#define MSG_UBL_DEACTIVATE_MESH _UxGT("關閉UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("設置熱床溫度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("熱端溫度") // "Hotend Temp" -#define MSG_UBL_MESH_EDIT _UxGT("網格編輯") // "Mesh Edit" -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("編輯客戶網格") // "Edit Custom Mesh" -#define MSG_UBL_FINE_TUNE_MESH _UxGT("細調網格") // "Fine Tuning Mesh" -#define MSG_UBL_DONE_EDITING_MESH _UxGT("完成編輯網格") // "Done Editing Mesh" -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("創設客戶網格") // "Build Custom Mesh" -#define MSG_UBL_BUILD_MESH_MENU _UxGT("創設網格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("創設PLA網格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("創設ABS網格") // "Build ABS Mesh" -#define MSG_UBL_BUILD_COLD_MESH _UxGT("創設冷網格") // "Build Cold Mesh" -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("調整網格高度") // "Adjust Mesh Height" -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合計") // "Height Amount" -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准網格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA網格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS網格") // "Validate ABS Mesh" -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客戶網格") // "Validate Custom Mesh" -#define MSG_UBL_CONTINUE_MESH _UxGT("繼續熱床網格") // "Continue Bed Mesh" -#define MSG_UBL_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("格子網格調平") // "Grid Mesh Leveling" -#define MSG_UBL_MESH_LEVEL _UxGT("調平網格") // "Level Mesh" -#define MSG_UBL_SIDE_POINTS _UxGT("邊點") // "Side Points" -#define MSG_UBL_MAP_TYPE _UxGT("圖類型") // "Map Type" -#define MSG_UBL_OUTPUT_MAP _UxGT("輸出網格圖") // "Output Mesh Map" -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("輸出到主機") // "Output for Host" -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("輸出到CSV") // "Output for CSV" -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("輸出到備份") // "Off Printer Backup" -#define MSG_UBL_INFO_UBL _UxGT("輸出UBL信息") // "Output UBL Info" -#define MSG_UBL_EDIT_MESH_MENU _UxGT("編輯網格") // "Edit Mesh" -#define MSG_UBL_FILLIN_AMOUNT _UxGT("填充合計") // "Fill-in Amount" -#define MSG_UBL_MANUAL_FILLIN _UxGT("手工填充") // "Manual Fill-in" -#define MSG_UBL_SMART_FILLIN _UxGT("聰明填充") // "Smart Fill-in" -#define MSG_UBL_FILLIN_MESH _UxGT("填充網格") // "Fill-in Mesh" -#define MSG_UBL_INVALIDATE_ALL _UxGT("作廢所有的") // "Invalidate All" -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("作廢最近的") // "Invalidate Closest" -#define MSG_UBL_FINE_TUNE_ALL _UxGT("細調所有的") // "Fine Tune All" -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("細調最近的") // "Fine Tune Closest" -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("網格存儲") // "Mesh Storage" -#define MSG_UBL_STORAGE_SLOT _UxGT("存儲槽") // "Memory Slot" -#define MSG_UBL_LOAD_MESH _UxGT("裝載熱床網格") // "Load Bed Mesh" -#define MSG_UBL_SAVE_MESH _UxGT("保存熱床網格") // "Save Bed Mesh" -#define MSG_MESH_LOADED _UxGT("網格 %i 已裝載") // "Mesh %i loaded" -#define MSG_MESH_SAVED _UxGT("網格 %i 已保存") // "Mesh %i saved" -#define MSG_NO_STORAGE _UxGT("沒有存儲") // "No storage" -#define MSG_UBL_SAVE_ERROR _UxGT("錯誤: UBL保存") // "Err: UBL Save" -#define MSG_UBL_RESTORE_ERROR _UxGT("錯誤: UBL還原") // "Err: UBL Restore" -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z偏移已停止") // "Z-Offset Stopped" -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" - -#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") -#define MSG_LEDS _UxGT("灯") // "Lights") -#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") -#define MSG_SET_LEDS_RED _UxGT("红") // "Red") -#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("黄") // "Yellow") -#define MSG_SET_LEDS_GREEN _UxGT("绿") // "Green") -#define MSG_SET_LEDS_BLUE _UxGT("蓝") // "Blue") -#define MSG_SET_LEDS_INDIGO _UxGT("青") // "Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("紫") // "Violet") -#define MSG_SET_LEDS_WHITE _UxGT("白") // "White") -#define MSG_SET_LEDS_DEFAULT _UxGT("缺省") // "Default") -#define MSG_CUSTOM_LEDS _UxGT("定制灯") // "Custom Lights") -#define MSG_INTENSITY_R _UxGT("红飽和度") // "Red Intensity") -#define MSG_INTENSITY_G _UxGT("绿飽和度") // "Green Intensity") -#define MSG_INTENSITY_B _UxGT("蓝飽和度") // "Blue Intensity") -#define MSG_INTENSITY_W _UxGT("白飽和度") // "White Intensity") -#define MSG_LED_BRIGHTNESS _UxGT("亮度") // "Brightness") -#define MSG_MOVING _UxGT("移动 ...") // "Moving...") -#define MSG_FREE_XY _UxGT("释放 XY") // "Free XY") - -#define MSG_MOVE_X _UxGT("移動X") //"Move X" -#define MSG_MOVE_Y _UxGT("移動Y") //"Move Y" -#define MSG_MOVE_Z _UxGT("移動Z") //"Move Z" -#define MSG_MOVE_E _UxGT("擠出機") //"Extruder" -#define MSG_MOVE_01MM _UxGT("移動 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移動 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移動 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("熱床Z") //"Bed Z" -#define MSG_NOZZLE _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 噴嘴") //"Nozzle" 噴嘴 -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 熱床") //"Bed" -#define MSG_FAN_SPEED _UxGT("風扇速率") //"Fan speed" -#define MSG_EXTRA_FAN_SPEED _UxGT("額外風扇速率") // "Extra fan speed" -#define MSG_FLOW _UxGT("擠出速率") //"Flow" -#define MSG_CONTROL _UxGT("控制") //"Control" -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最小") //" " LCD_STR_THERMOMETER " Min" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 系數") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自動控溫") //"Autotemp" -#define MSG_ON _UxGT("開 ") //"On " -#define MSG_OFF _UxGT("關 ") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#define MSG_SELECT _UxGT("選擇") //"Select" -#define MSG_ACC _UxGT("加速度") //"Accel" acceleration -#define MSG_JERK _UxGT("抖動速率") //"Jerk" -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("A軸抖動速率") //"Va-jerk" - #define MSG_VB_JERK _UxGT("B軸抖動速率") //"Vb-jerk" - #define MSG_VC_JERK _UxGT("C軸抖動速率") //"Vc-jerk" -#else - #define MSG_VA_JERK _UxGT("X軸抖動速率") //"Vx-jerk" - #define MSG_VB_JERK _UxGT("Y軸抖動速率") //"Vy-jerk" - #define MSG_VC_JERK _UxGT("Z軸抖動速率") //"Vz-jerk" -#endif -#define MSG_VE_JERK _UxGT("擠出機抖動速率") //"Ve-jerk" -#define MSG_VELOCITY _UxGT("速度") // "Velocity" -#define MSG_VMAX _UxGT("最大進料速率") //"Vmax " max_feedrate_mm_s -#define MSG_VMIN _UxGT("最小進料速率") //"Vmin" min_feedrate_mm_s -#define MSG_VTRAV_MIN _UxGT("最小移動速率") //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move -#define MSG_ACCELERATION _UxGT("加速度") // "Acceleration" -#define MSG_AMAX _UxGT("最大列印加速度") //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves -#define MSG_A_RETRACT _UxGT("回縮加速度") //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts -#define MSG_A_TRAVEL _UxGT("非列印移動加速度") //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves -#define MSG_STEPS_PER_MM _UxGT("軸步數/mm") //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A軸步數/mm") //"Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("B軸步數/mm") //"Bsteps/mm" - #define MSG_CSTEPS _UxGT("C軸步數/mm") //"Csteps/mm" -#else - #define MSG_ASTEPS _UxGT("X軸步數/mm") //"Xsteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - #define MSG_BSTEPS _UxGT("Y軸步數/mm") //"Ysteps/mm" - #define MSG_CSTEPS _UxGT("Z軸步數/mm") //"Zsteps/mm" -#endif -#define MSG_ESTEPS _UxGT("擠出機步數/mm") //"Esteps/mm" -#define MSG_E1STEPS _UxGT("擠出機1步數/mm") //"E1steps/mm" -#define MSG_E2STEPS _UxGT("擠出機2步數/mm") //"E2steps/mm" -#define MSG_E3STEPS _UxGT("擠出機3步數/mm") //"E3steps/mm" -#define MSG_E4STEPS _UxGT("擠出機4步數/mm") //"E4steps/mm" -#define MSG_E5STEPS _UxGT("擠出機5步數/mm") //"E5steps/mm" -#define MSG_TEMPERATURE _UxGT("溫度") //"Temperature" -#define MSG_MOTION _UxGT("運作") //"Motion" -#define MSG_FILAMENT _UxGT("絲料測容") //"Filament" lcd_control_volumetric_menu -#define MSG_VOLUMETRIC_ENABLED _UxGT("測容積mm³") //"E in mm3" volumetric_enabled -#define MSG_FILAMENT_DIAM _UxGT("絲料直徑") //"Fil. Dia." -#define MSG_FILAMENT_UNLOAD _UxGT("卸載 mm") // "Unload mm" -#define MSG_FILAMENT_LOAD _UxGT("装載 mm") // "Load mm" -#define MSG_ADVANCE_K _UxGT("Advance K") // "Advance K" -#define MSG_CONTRAST _UxGT("LCD對比度") //"LCD contrast" -#define MSG_STORE_EEPROM _UxGT("保存設置") //"Store memory" -#define MSG_LOAD_EEPROM _UxGT("載入設置") //"Load memory" -#define MSG_RESTORE_FAILSAFE _UxGT("恢復安全值") //"Restore failsafe" -#define MSG_INIT_EEPROM _UxGT("初始化設置") // "Initialize EEPROM" -#define MSG_REFRESH _UxGT("刷新") //"Refresh" -#define MSG_WATCH _UxGT("資訊界面") //"Info screen" -#define MSG_PREPARE _UxGT("準備") //"Prepare" -#define MSG_TUNE _UxGT("調整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暫停列印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢復列印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止列印") //"Stop print" -#define MSG_CARD_MENU _UxGT("從記憶卡上列印") //"Print from SD" -#define MSG_NO_CARD _UxGT("無記憶卡") //"No SD card" -#define MSG_DWELL _UxGT("休眠 ...") //"Sleep..." -#define MSG_USERWAIT _UxGT("點擊繼續 ...") //"Click to resume..." -#define MSG_PRINT_PAUSED _UxGT("列印已暫停") // "Print paused" -#define MSG_PRINT_ABORTED _UxGT("已取消列印") //"Print aborted" -#define MSG_NO_MOVE _UxGT("無移動") //"No move." -#define MSG_KILLED _UxGT("已砍掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回縮長度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("換手回抽長度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回縮速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回縮恢復長度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("換手回縮恢復長度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回縮恢復後進料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) -#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") // "S UnRet V" -#define MSG_AUTORETRACT _UxGT("自動回縮") //"AutoRetr." autoretract_enabled, -#define MSG_FILAMENTCHANGE _UxGT("更換絲料") //"Change filament" -#define MSG_FILAMENTLOAD _UxGT("裝載絲料") // "Load filament" -#define MSG_FILAMENTUNLOAD _UxGT("卸載絲料") // "Unload filament" -#define MSG_FILAMENTUNLOAD_ALL _UxGT("卸載全部") // "Unload All" -#define MSG_INIT_SDCARD _UxGT("初始化記憶卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更換記憶卡") //"Change SD card" -#define MSG_ZPROBE_OUT _UxGT("Z探針在熱床之外") //"Z probe out. bed" Z probe is not within the physical limits -#define MSG_SKEW_FACTOR _UxGT("偏斜因數") // "Skew Factor" -#define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch 自檢") // "BLTouch Self-Test" -#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_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" -#define MSG_BABYSTEP_Z _UxGT("微量調整Z軸") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("擋塊終止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加熱失敗") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("錯誤:REDUNDANT TEMP") //"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_HEATING _UxGT("加熱中 ...") //"Heating..." -#define MSG_BED_HEATING _UxGT("加熱熱床中...") //"Bed Heating..." -#define MSG_DELTA_CALIBRATE _UxGT("⊿校準") //"Delta Calibration" -#define MSG_DELTA_CALIBRATE_X _UxGT("⊿校準X") //"Calibrate X" -#define MSG_DELTA_CALIBRATE_Y _UxGT("⊿校準Y") //"Calibrate Y" -#define MSG_DELTA_CALIBRATE_Z _UxGT("⊿校準Z") //"Calibrate Z" -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("⊿校準中心") //"Calibrate Center" -#define MSG_DELTA_SETTINGS _UxGT("⊿設置") // "Delta Settings" -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("⊿自動校準") // "Auto Calibration" -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("設置⊿高度") // "Set Delta Height" -#define MSG_DELTA_DIAG_ROD _UxGT("⊿斜柱") // "Diag Rod" -#define MSG_DELTA_HEIGHT _UxGT("⊿高度") // "Height" -#define MSG_DELTA_RADIUS _UxGT("⊿半徑") // "Radius" -#define MSG_INFO_MENU _UxGT("關於印表機") //"About Printer" -#define MSG_INFO_PRINTER_MENU _UxGT("印表機訊息") //"Printer Info" -#define MSG_3POINT_LEVELING _UxGT("三點調平") // "3-Point Leveling" -#define MSG_LINEAR_LEVELING _UxGT("線性調平") // "Linear Leveling" -#define MSG_BILINEAR_LEVELING _UxGT("雙線性調平") // "Bilinear Leveling" -#define MSG_UBL_LEVELING _UxGT("統一熱床調平(UBL)") // "Unified Bed Leveling" -#define MSG_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" -#define MSG_INFO_STATS_MENU _UxGT("印表機統計") //"Printer Stats" -#define MSG_INFO_BOARD_MENU _UxGT("主板訊息") //"Board Info" -#define MSG_INFO_THERMISTOR_MENU _UxGT("溫度計") //"Thermistors" -#define MSG_INFO_EXTRUDERS _UxGT("擠出機") //"Extruders" -#define MSG_INFO_BAUDRATE _UxGT("傳輸率") //"Baud" -#define MSG_INFO_PROTOCOL _UxGT("協議") //"Protocol" -#define MSG_CASE_LIGHT _UxGT("外殼燈") // "Case light" -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("燈亮度") // "Light BRIGHTNESS" - -#if LCD_WIDTH > 19 -#define MSG_INFO_PRINT_COUNT _UxGT("列印計數") //"Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("已完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("總列印時間") //"Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("最長工作時間") //"Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("總計擠出") //"Extruded total" -#else -#define MSG_INFO_PRINT_COUNT _UxGT("列印數") //"Prints" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" -#define MSG_INFO_PRINT_TIME _UxGT("總共") //"Total" -#define MSG_INFO_PRINT_LONGEST _UxGT("最長") //"Longest" -#define MSG_INFO_PRINT_FILAMENT _UxGT("已擠出") //"Extruded" -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("最低溫度") //"Min Temp" -#define MSG_INFO_MAX_TEMP _UxGT("最高溫度") //"Max Temp" -#define MSG_INFO_PSU _UxGT("電源供應") //"Power Supply" -#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_HEADER_PAUSE _UxGT("列印已暫停") // "PRINT PAUSED" -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("裝載絲料") // "LOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("卸載絲料") // "UNLOAD FILAMENT" -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("恢複選項:") // "RESUME OPTIONS:" -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("清除更多") // "Purge more" -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("恢復列印") //"Resume print" -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" 噴嘴: ") // " Nozzle: " -#define MSG_ERR_HOMING_FAILED _UxGT("歸原位失敗") // "Homing failed" -#define MSG_ERR_PROBING_FAILED _UxGT("探針探測失敗") // "Probing failed" -#define MSG_M600_TOO_COLD _UxGT("M600: 太涼") // "M600: Too cold" - -#if LCD_HEIGHT >= 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("等待開始") //"Wait for start" -#define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("絲料") //"of the filament" -#define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("變更") //"change" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("卸下絲料") //"filament unload" -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入絲料") //"Insert filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("並按鍵") //"and press button" -#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("繼續 ...") //"to continue..." -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("按下按鈕來") // "Press button to" -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("加熱噴嘴.") // "heat nozzle." -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱噴嘴") // "Heating nozzle" -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("請等待 ...") // "Please wait..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("等待") //"Wait for" -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("進料") //"filament load" -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("等待") // "Wait for" -#define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("絲料清除") // "filament purge" -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("等待列印") //"Wait for print" -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("恢復") //"to resume" - -#else // LCD_HEIGHT < 4 -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("請等待 ...") //"Please wait..." -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("退出中 ...") //"Ejecting..." -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("插入並點擊") //"Insert and Click" -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("加熱中 ...") // "Heating..." -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("載入中 ...") //"Loading..." -#define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("清除中 ...") // "Purging..." -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("恢復中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 - -#endif // LANGUAGE_ZH_TW_H diff --git a/Marlin_thinkerV2/Marlin/least_squares_fit.cpp b/Marlin_thinkerV2/Marlin/least_squares_fit.cpp deleted file mode 100644 index 9e59804f09..0000000000 --- a/Marlin_thinkerV2/Marlin/least_squares_fit.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Least Squares Best Fit by Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. It also does not require all of - * coordinates to be present during the calculations. Each point can be - * probed and then discarded. - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR) - -#include "macros.h" -#include - -#include "least_squares_fit.h" - -int finish_incremental_LSF(struct linear_fit_data *lsf) { - - const float N = lsf->N; - - if (N == 0.0) - return 1; - - lsf->xbar /= N; - lsf->ybar /= N; - lsf->zbar /= N; - lsf->x2bar = lsf->x2bar / N - sq(lsf->xbar); - lsf->y2bar = lsf->y2bar / N - sq(lsf->ybar); - lsf->z2bar = lsf->z2bar / N - sq(lsf->zbar); - lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar; - lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar; - lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar; - const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar); - - if (ABS(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy)) - return 1; - - lsf->A = (lsf->yzbar * lsf->xybar - lsf->xzbar * lsf->y2bar) / DD; - lsf->B = (lsf->xzbar * lsf->xybar - lsf->yzbar * lsf->x2bar) / DD; - lsf->D = -(lsf->zbar + lsf->A * lsf->xbar + lsf->B * lsf->ybar); - return 0; -} - -#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR) diff --git a/Marlin_thinkerV2/Marlin/least_squares_fit.h b/Marlin_thinkerV2/Marlin/least_squares_fit.h deleted file mode 100644 index 68aa62b9c5..0000000000 --- a/Marlin_thinkerV2/Marlin/least_squares_fit.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Incremental Least Squares Best Fit By Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. And even better... the data - * fed into the algorithm does not need to all be present at the same time. - * A point can be probed and its values fed into the algorithm and then discarded. - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR) - -#include "Marlin.h" -#include "macros.h" -#include - -struct linear_fit_data { - float xbar, ybar, zbar, - x2bar, y2bar, z2bar, - xybar, xzbar, yzbar, - max_absx, max_absy, - A, B, D, N; -}; - -void inline 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) { - // weight each accumulator by factor w, including the "number" of samples - // (analagous 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; - lsf->N += w; - lsf->max_absx = MAX(ABS(w * x), lsf->max_absx); - lsf->max_absy = MAX(ABS(w * y), lsf->max_absy); -} - -void inline 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; - lsf->x2bar += sq(x); - lsf->y2bar += sq(y); - lsf->z2bar += sq(z); - lsf->xybar += x * y; - lsf->xzbar += x * z; - lsf->yzbar += y * z; - lsf->max_absx = MAX(ABS(x), lsf->max_absx); - lsf->max_absy = MAX(ABS(y), lsf->max_absy); - lsf->N += 1.0; -} - -int finish_incremental_LSF(struct linear_fit_data *); - -#endif - diff --git a/Marlin_thinkerV2/Marlin/leds.cpp b/Marlin_thinkerV2/Marlin/leds.cpp deleted file mode 100644 index df798acf8f..0000000000 --- a/Marlin_thinkerV2/Marlin/leds.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * leds.cpp - Marlin RGB LED general support - */ - -#include "MarlinConfig.h" - -#if HAS_COLOR_LEDS - -#include "leds.h" - -#if ENABLED(BLINKM) - #include "blinkm.h" -#endif - -#if ENABLED(PCA9632) - #include "pca9632.h" -#endif - -#if ENABLED(LED_COLOR_PRESETS) - const LEDColor LEDLights::defaultLEDColor = MakeLEDColor( - LED_USER_PRESET_RED, - LED_USER_PRESET_GREEN, - LED_USER_PRESET_BLUE, - LED_USER_PRESET_WHITE, - LED_USER_PRESET_BRIGHTNESS - ); -#endif - -#if ENABLED(LED_CONTROL_MENU) - LEDColor LEDLights::color; - bool LEDLights::lights_on; -#endif - -LEDLights leds; - -void LEDLights::setup() { - #if ENABLED(NEOPIXEL_LED) - setup_neopixel(); - #endif - #if ENABLED(LED_USER_PRESET_STARTUP) - set_default(); - #endif -} - -void LEDLights::set_color(const LEDColor &incol - #if ENABLED(NEOPIXEL_LED) - , bool isSequence/*=false*/ - #endif -) { - - #if ENABLED(NEOPIXEL_LED) - - const uint32_t neocolor = pixels.Color(incol.r, incol.g, incol.b, incol.w); - static uint16_t nextLed = 0; - - pixels.setBrightness(incol.i); - if (!isSequence) - set_neopixel_color(neocolor); - else { - pixels.setPixelColor(nextLed, neocolor); - pixels.show(); - if (++nextLed >= pixels.numPixels()) nextLed = 0; - return; - } - - #endif - - #if ENABLED(BLINKM) - - // This variant uses i2c to send the RGB components to the device. - blinkm_set_led_color(incol); - - #endif - - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - - // This variant uses 3-4 separate pins for the RGB(W) components. - // If the pins can do PWM then their intensity will be set. - WRITE(RGB_LED_R_PIN, incol.r ? HIGH : LOW); - WRITE(RGB_LED_G_PIN, incol.g ? HIGH : LOW); - WRITE(RGB_LED_B_PIN, incol.b ? HIGH : LOW); - analogWrite(RGB_LED_R_PIN, incol.r); - analogWrite(RGB_LED_G_PIN, incol.g); - analogWrite(RGB_LED_B_PIN, incol.b); - - #if ENABLED(RGBW_LED) - WRITE(RGB_LED_W_PIN, incol.w ? HIGH : LOW); - analogWrite(RGB_LED_W_PIN, incol.w); - #endif - - #endif - - #if ENABLED(PCA9632) - // Update I2C LED driver - pca9632_set_led_color(incol); - #endif - - #if ENABLED(LED_CONTROL_MENU) - // Don't update the color when OFF - lights_on = !incol.is_off(); - if (lights_on) color = incol; - #endif -} - -void LEDLights::set_white() { - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) - set_color(LEDColorWhite()); - #endif - #if ENABLED(NEOPIXEL_LED) - set_neopixel_color(pixels.Color(NEO_WHITE)); - #endif -} - -#if ENABLED(LED_CONTROL_MENU) - void LEDLights::toggle() { if (lights_on) set_off(); else update(); } -#endif - -#endif // HAS_COLOR_LEDS diff --git a/Marlin_thinkerV2/Marlin/leds.h b/Marlin_thinkerV2/Marlin/leds.h deleted file mode 100644 index f5e74b3caa..0000000000 --- a/Marlin_thinkerV2/Marlin/leds.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * leds.h - Marlin general RGB LED support - */ - -#ifndef __LEDS_H__ -#define __LEDS_H__ - -#include "MarlinConfig.h" - -#if ENABLED(NEOPIXEL_LED) - #include "neopixel.h" -#endif - -#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)) - -/** - * LEDcolor type for use with leds.set_color - */ -typedef struct LEDColor { - uint8_t r, g, b - #if HAS_WHITE_LED - , w - #if ENABLED(NEOPIXEL_LED) - , i - #endif - #endif - ; - LEDColor() : r(255), g(255), b(255) - #if HAS_WHITE_LED - , w(255) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - LEDColor(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - ) : r(r), g(g), b(b) - #if HAS_WHITE_LED - , w(w) - #if ENABLED(NEOPIXEL_LED) - , i(i) - #endif - #endif - {} - LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2]) - #if HAS_WHITE_LED - , w(rgbw[3]) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - LEDColor& operator=(const uint8_t (&rgbw)[4]) { - r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; - #if HAS_WHITE_LED - w = rgbw[3]; - #endif - return *this; - } - LEDColor& operator=(const LEDColor &right) { - if (this != &right) memcpy(this, &right, sizeof(LEDColor)); - return *this; - } - bool operator==(const LEDColor &right) { - if (this == &right) return true; - return 0 == memcmp(this, &right, sizeof(LEDColor)); - } - bool operator!=(const LEDColor &right) { return !operator==(right); } - bool is_off() const { - return 3 > r + g + b - #if HAS_WHITE_LED - + w - #endif - ; - } -} LEDColor; - -/** - * Color helpers and presets - */ -#if HAS_WHITE_LED - #define LEDColorWhite() LEDColor(0, 0, 0, 255) - #if ENABLED(NEOPIXEL_LED) - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I) - #else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W) - #endif -#else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B) - #define LEDColorWhite() LEDColor(255, 255, 255) -#endif -#define LEDColorOff() LEDColor( 0, 0, 0) -#define LEDColorRed() LEDColor(255, 0, 0) -#define LEDColorOrange() LEDColor(255, 80, 0) -#define LEDColorYellow() LEDColor(255, 255, 0) -#define LEDColorGreen() LEDColor( 0, 255, 0) -#define LEDColorBlue() LEDColor( 0, 0, 255) -#define LEDColorIndigo() LEDColor( 0, 255, 255) -#define LEDColorViolet() LEDColor(255, 0, 255) - -class LEDLights { -public: - LEDLights() {} // ctor - - static void setup(); // init() - - static void set_color(const LEDColor &color - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ); - - FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ) { - set_color(MakeLEDColor(r, g, b, w, i) - #if ENABLED(NEOPIXEL_LED) - , isSequence - #endif - ); - } - - static void set_white(); - FORCE_INLINE static void set_off() { set_color(LEDColorOff()); } - FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); } - - #if ENABLED(LED_COLOR_PRESETS) - static const LEDColor defaultLEDColor; - FORCE_INLINE static void set_default() { set_color(defaultLEDColor); } - FORCE_INLINE static void set_red() { set_color(LEDColorRed()); } - FORCE_INLINE static void set_orange() { set_color(LEDColorOrange()); } - FORCE_INLINE static void set_yellow() { set_color(LEDColorYellow()); } - FORCE_INLINE static void set_blue() { set_color(LEDColorBlue()); } - FORCE_INLINE static void set_indigo() { set_color(LEDColorIndigo()); } - FORCE_INLINE static void set_violet() { set_color(LEDColorViolet()); } - #endif - - #if ENABLED(LED_CONTROL_MENU) - static LEDColor color; // last non-off color - static bool lights_on; // the last set color was "on" - static void toggle(); // swap "off" with color - FORCE_INLINE static void update() { set_color(color); } - #endif -}; - -extern LEDLights leds; - -#endif // __LEDS_H__ diff --git a/Marlin_thinkerV2/Marlin/macros.h b/Marlin_thinkerV2/Marlin/macros.h deleted file mode 100644 index 9479788aa2..0000000000 --- a/Marlin_thinkerV2/Marlin/macros.h +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef MACROS_H -#define MACROS_H - -#define NUM_AXIS 4 -#define ABCE 4 -#define XYZE 4 -#define ABC 3 -#define XYZ 3 - -// For use in macros that take a single axis letter -#define _AXIS(A) (A##_AXIS) - -#define _XMIN_ 100 -#define _YMIN_ 200 -#define _ZMIN_ 300 -#define _XMAX_ 101 -#define _YMAX_ 201 -#define _ZMAX_ 301 - -#define FORCE_INLINE __attribute__((always_inline)) inline -#define _UNUSED __attribute__((unused)) -#define _O0 __attribute__((optimize("O0"))) -#define _Os __attribute__((optimize("Os"))) -#define _O1 __attribute__((optimize("O1"))) -#define _O2 __attribute__((optimize("O2"))) -#define _O3 __attribute__((optimize("O3"))) - -// Clock speed factors -#define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 -#define INT0_PRESCALER 8 - -// Nanoseconds per cycle -#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) - -// Remove compiler warning on an unused variable -#define UNUSED(x) (void) (x) - -// Macros to make a string from a macro -#define STRINGIFY_(M) #M -#define STRINGIFY(M) STRINGIFY_(M) - -#define A(CODE) " " CODE "\n\t" -#define L(CODE) CODE ":\n\t" - -// Macros for bit masks -#undef _BV -#define _BV(b) (1 << (b)) -#define TEST(n,b) !!((n)&_BV(b)) -#define SBI(n,b) (n |= _BV(b)) -#define CBI(n,b) (n &= ~_BV(b)) -#define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) - -#define _BV32(b) (1UL << (b)) -#define TEST32(n,b) !!((n)&_BV32(b)) -#define SBI32(n,b) (n |= _BV32(b)) -#define CBI32(n,b) (n &= ~_BV32(b)) - -// Macro to check that a number if a power if 2 -#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) - -// Macros for maths shortcuts -#undef M_PI -#define M_PI 3.14159265358979323846f -#define RADIANS(d) ((d)*M_PI/180.0f) -#define DEGREES(r) ((r)*180.0f/M_PI) -#define HYPOT2(x,y) (sq(x)+sq(y)) - -#define CIRCLE_AREA(R) (M_PI * sq(float(R))) -#define CIRCLE_CIRC(R) (2 * M_PI * (float(R))) - -#define SIGN(a) ((a>0)-(a<0)) -#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) - -// Macros to contrain values -#define NOLESS(v,n) do{ if (v < n) v = n; }while(0) -#define NOMORE(v,n) do{ if (v > n) v = n; }while(0) -#define LIMIT(v,n1,n2) do{ if (v < n1) v = n1; else if (v > n2) v = n2; }while(0) - -// Macros to support option testing -#define _CAT(a, ...) a ## __VA_ARGS__ -#define SWITCH_ENABLED_false 0 -#define SWITCH_ENABLED_true 1 -#define SWITCH_ENABLED_0 0 -#define SWITCH_ENABLED_1 1 -#define SWITCH_ENABLED_0x0 0 -#define SWITCH_ENABLED_0x1 1 -#define SWITCH_ENABLED_ 1 -#define ENABLED(b) _CAT(SWITCH_ENABLED_, b) -#define DISABLED(b) !ENABLED(b) - -#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H)) -#define NUMERIC(a) WITHIN(a, '0', '9') -#define DECIMAL(a) (NUMERIC(a) || a == '.') -#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') -#define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') -#define COUNT(a) (sizeof(a)/sizeof(*a)) -#define ZERO(a) memset(a,0,sizeof(a)) -#define COPY(a,b) memcpy(a,b,MIN(sizeof(a),sizeof(b))) - -// 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_N(N, ...) ARRAY_ ##N(__VA_ARGS__) -#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__) - -// Macros for adding -#define INC_0 1 -#define INC_1 2 -#define INC_2 3 -#define INC_3 4 -#define INC_4 5 -#define INC_5 6 -#define INC_6 7 -#define INC_7 8 -#define INC_8 9 -#define INCREMENT_(n) INC_ ##n -#define INCREMENT(n) INCREMENT_(n) - -// Macros for subtracting -#define DEC_1 0 -#define DEC_2 1 -#define DEC_3 2 -#define DEC_4 3 -#define DEC_5 4 -#define DEC_6 5 -#define DEC_7 6 -#define DEC_8 7 -#define DEC_9 8 -#define DECREMENT_(n) DEC_ ##n -#define DECREMENT(n) DECREMENT_(n) - -#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0) - -#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) -#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) - -#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) -#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) - -#define NOOP do{} while(0) - -#define CEILING(x,y) (((x) + (y) - 1) / (y)) - -// Avoid double evaluation of arguments on MIN/MAX/ABS -#undef MIN -#undef MAX -#undef ABS -#ifdef __cplusplus - - // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; - } - template static inline constexpr auto MAX(const L lhs, const R rhs) -> decltype(lhs + rhs){ - return lhs > rhs ? lhs : rhs; - } - template static inline constexpr const T ABS(const T v) { - return v >= 0 ? v : -v; - } -#else - - // Using GCC extensions, but Travis GCC version does not like it and gives - // "error: statement-expressions are not allowed outside functions nor in template-argument lists" - #define MIN(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a < _b ? _a : _b;}) - - #define MAX(a, b) \ - ({__typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a > _b ? _a : _b;}) - - #define ABS(a) \ - ({__typeof__(a) _a = (a); \ - _a >= 0 ? _a : -_a;}) - -#endif - -#define MIN3(a, b, c) MIN(MIN(a, b), c) -#define MIN4(a, b, c, d) MIN(MIN3(a, b, c), d) -#define MIN5(a, b, c, d, e) MIN(MIN4(a, b, c, d), e) -#define MAX3(a, b, c) MAX(MAX(a, b), c) -#define MAX4(a, b, c, d) MAX(MAX3(a, b, c), d) -#define MAX5(a, b, c, d, e) MAX(MAX4(a, b, c, d), e) - -#define UNEAR_ZERO(x) ((x) < 0.000001f) -#define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f) -#define NEAR(x,y) NEAR_ZERO((x)-(y)) - -#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0.0f : 1.0f / (x)) -#define FIXFLOAT(f) (f + (f < 0.0f ? -0.00005f : 0.00005f)) - -// -// Maths macros that can be overridden by HAL -// -#define ATAN2(y, x) atan2f(y, x) -#define POW(x, y) powf(x, y) -#define SQRT(x) sqrtf(x) -#define RSQRT(x) (1 / sqrtf(x)) -#define CEIL(x) ceilf(x) -#define FLOOR(x) floorf(x) -#define LROUND(x) lroundf(x) -#define FMOD(x, y) fmodf(x, y) -#define HYPOT(x,y) SQRT(HYPOT2(x,y)) - -#endif // MACROS_H diff --git a/Marlin_thinkerV2/Marlin/malyanlcd.cpp b/Marlin_thinkerV2/Marlin/malyanlcd.cpp deleted file mode 100644 index 74a5b611d8..0000000000 --- a/Marlin_thinkerV2/Marlin/malyanlcd.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * malyanlcd.cpp - * - * LCD implementation for Malyan's LCD, a separate ESP8266 MCU running - * on Serial1 for the M200 board. This module outputs a pseudo-gcode - * wrapped in curly braces which the LCD implementation translates into - * actual G-code commands. - * - * Added to Marlin for Mini/Malyan M200 - * Unknown commands as of Jan 2018: {H:} - * Not currently implemented: - * {E:} when sent by LCD. Meaning unknown. - * - * Notes for connecting to boards that are not Malyan: - * The LCD is 3.3v, so if powering from a RAMPS 1.4 board or - * other 5v/12v board, use a buck converter to power the LCD and - * the 3.3v side of a logic level shifter. Aux1 on the RAMPS board - * has Serial1 and 12v, making it perfect for this. - * Copyright (c) 2017 Jason Nelson (xC0000005) - */ - -#include "MarlinConfig.h" - -#if ENABLED(MALYAN_LCD) - -#if ENABLED(SDSUPPORT) - #include "cardreader.h" - #include "SdFatConfig.h" -#else - #define LONG_FILENAME_LENGTH 0 -#endif - -#include "temperature.h" -#include "planner.h" -#include "stepper.h" -#include "duration_t.h" -#include "printcounter.h" -#include "parser.h" -#include "configuration_store.h" - -#include "Marlin.h" - -#if USE_MARLINSERIAL - // Make an exception to use HardwareSerial too - #undef HardwareSerial_h - #include - #define USB_STATUS true -#else - #define USB_STATUS Serial -#endif - -// On the Malyan M200, this will be Serial1. On a RAMPS board, -// it might not be. -#define LCD_SERIAL Serial1 - -// This is based on longest sys command + a filename, plus some buffer -// in case we encounter some data we don't recognize -// There is no evidence a line will ever be this long, but better safe than sorry -#define MAX_CURLY_COMMAND (32 + LONG_FILENAME_LENGTH) * 2 - -// Track incoming command bytes from the LCD -int inbound_count; - -// For sending print completion messages -bool last_printing_status = false; - -// Everything written needs the high bit set. -void write_to_lcd_P(const char * const message) { - char encoded_message[MAX_CURLY_COMMAND]; - uint8_t message_length = MIN(strlen_P(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = pgm_read_byte(&message[i]) | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -void write_to_lcd(const char * const message) { - char encoded_message[MAX_CURLY_COMMAND]; - const uint8_t message_length = MIN(strlen(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = message[i] | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -/** - * Process an LCD 'C' command. - * These are currently all temperature commands - * {C:T0190} - * Set temp for hotend to 190 - * {C:P050} - * Set temp for bed to 50 - * - * {C:S09} set feedrate to 90 %. - * {C:S12} set feedrate to 120 %. - * - * the command portion begins after the : - */ -void process_lcd_c_command(const char* command) { - switch (command[0]) { - case 'C': { - int raw_feedrate = atoi(command + 1); - feedrate_percentage = raw_feedrate * 10; - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - } break; - case 'T': { - thermalManager.setTargetHotend(atoi(command + 1), 0); - } break; - case 'P': { - thermalManager.setTargetBed(atoi(command + 1)); - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command); - return; - } -} - -/** - * Process an LCD 'B' command. - * {B:0} results in: {T0:008/195}{T1:000/000}{TP:000/000}{TQ:000C}{TT:000000} - * T0/T1 are hot end temperatures, TP is bed, TQ is percent, and TT is probably - * time remaining (HH:MM:SS). The UI can't handle displaying a second hotend, - * but the stock firmware always sends it, and it's always zero. - */ -void process_lcd_eb_command(const char* command) { - char elapsed_buffer[10]; - duration_t elapsed; - switch (command[0]) { - case '0': { - elapsed = print_job_timer.duration(); - sprintf_P(elapsed_buffer, PSTR("%02u%02u%02u"), uint16_t(elapsed.hour()), uint16_t(elapsed.minute()) % 60UL, elapsed.second()); - - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, - PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}{TQ:%03i}{TT:%s}"), - thermalManager.degHotend(0), - thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - thermalManager.degBed(), - thermalManager.degTargetBed(), - #else - 0, 0, - #endif - #if ENABLED(SDSUPPORT) - card.percentDone(), - #else - 0, - #endif - elapsed_buffer); - write_to_lcd(message_buffer); - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN E/B COMMAND", command); - return; - } -} - -/** - * Process an LCD 'J' command. - * These are currently all movement commands. - * The command portion begins after the : - * Move X Axis - * - * {J:E}{J:X-200}{J:E} - * {J:E}{J:X+200}{J:E} - * X, Y, Z, A (extruder) - */ -void process_lcd_j_command(const char* command) { - static bool steppers_enabled = false; - char axis = command[0]; - - switch (axis) { - case 'E': - // enable or disable steppers - // switch to relative - enqueue_and_echo_commands_now_P(PSTR("G91")); - enqueue_and_echo_commands_now_P(steppers_enabled ? PSTR("M18") : PSTR("M17")); - steppers_enabled = !steppers_enabled; - break; - case 'A': - axis = 'E'; - // fallthru - case 'Y': - case 'Z': - case 'X': { - // G0 - // The M200 class UI seems to send movement in .1mm values. - char cmd[20]; - sprintf_P(cmd, PSTR("G1 %c%03.1f"), axis, atof(command + 1) / 10.0); - enqueue_and_echo_command_now(cmd); - } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); - return; - } -} - -/** - * Process an LCD 'P' command, related to homing and printing. - * Cancel: - * {P:X} - * - * Home all axes: - * {P:H} - * - * Print a file: - * {P:000} - * The File number is specified as a three digit value. - * Printer responds with: - * {PRINTFILE:Mini_SNES_Bottom.gcode} - * {SYS:BUILD}echo:Now fresh file: Mini_SNES_Bottom.gcode - * File opened: Mini_SNES_Bottom.gcode Size: 5805813 - * File selected - * {SYS:BUILD} - * T:-2526.8 E:0 - * T:-2533.0 E:0 - * T:-2537.4 E:0 - * Note only the curly brace stuff matters. - */ -void process_lcd_p_command(const char* command) { - - switch (command[0]) { - case 'X': - #if ENABLED(SDSUPPORT) - // cancel print - write_to_lcd_P(PSTR("{SYS:CANCELING}")); - last_printing_status = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - clear_command_queue(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - wait_for_heatup = false; - write_to_lcd_P(PSTR("{SYS:STARTED}")); - #endif - break; - case 'H': - // Home all axis - enqueue_and_echo_commands_now_P(PSTR("G28")); - break; - default: { - #if ENABLED(SDSUPPORT) - // Print file 000 - a three digit number indicating which - // file to print in the SD card. If it's a directory, - // then switch to the directory. - - // Find the name of the file to print. - // It's needed to echo the PRINTFILE option. - // The {S:L} command should've ensured the SD card was mounted. - card.getfilename(atoi(command)); - - // There may be a difference in how V1 and V2 LCDs handle subdirectory - // prints. Investigate more. This matches the V1 motion controller actions - // but the V2 LCD switches to "print" mode on {SYS:DIR} response. - if (card.filenameIsDir) { - card.chdir(card.filename); - write_to_lcd_P(PSTR("{SYS:DIR}")); - } - else { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - write_to_lcd_P(PSTR("{SYS:BUILD}")); - card.openAndPrintFile(card.filename); - } - #endif - } break; // default - } // switch -} - -/** - * Handle an lcd 'S' command - * {S:I} - Temperature request - * {T0:999/000}{T1:000/000}{TP:004/000} - * - * {S:L} - File Listing request - * Printer Response: - * {FILE:buttons.gcode} - * {FILE:update.bin} - * {FILE:nupdate.bin} - * {FILE:fcupdate.flg} - * {SYS:OK} - */ -void process_lcd_s_command(const char* command) { - switch (command[0]) { - case 'I': { - // temperature information - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}"), - thermalManager.degHotend(0), thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - thermalManager.degBed(), thermalManager.degTargetBed() - #else - 0, 0 - #endif - ); - write_to_lcd(message_buffer); - } break; - - case 'H': - // Home all axis - enqueue_and_echo_command("G28"); - break; - - case 'L': { - #if ENABLED(SDSUPPORT) - if (!card.cardOK) card.initsd(); - - // A more efficient way to do this would be to - // implement a callback in the ls_SerialPrint code, but - // that requires changes to the core cardreader class that - // would not benefit the majority of users. Since one can't - // select a file for printing during a print, there's - // little reason not to do it this way. - char message_buffer[MAX_CURLY_COMMAND]; - uint16_t file_count = card.get_num_Files(); - for (uint16_t i = 0; i < file_count; i++) { - card.getfilename(i); - sprintf_P(message_buffer, card.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - } - - write_to_lcd_P(PSTR("{SYS:OK}")); - #endif - } break; - - default: - SERIAL_ECHOLNPAIR("UNKNOWN S COMMAND", command); - return; - } -} - -/** - * Receive a curly brace command and translate to G-code. - * Currently {E:0} is not handled. Its function is unknown, - * but it occurs during the temp window after a sys build. - */ -void process_lcd_command(const char* command) { - const char *current = command; - - current++; // skip the leading {. The trailing one is already gone. - byte command_code = *current++; - if (*current != ':') { - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND FORMAT", command); - return; - } - - current++; // skip the : - - switch (command_code) { - case 'S': - process_lcd_s_command(current); - break; - case 'J': - process_lcd_j_command(current); - break; - case 'P': - process_lcd_p_command(current); - break; - case 'C': - process_lcd_c_command(current); - break; - case 'B': - case 'E': - process_lcd_eb_command(current); - break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND", command); - return; - } -} - -/** - * UC means connected. - * UD means disconnected - * The stock firmware considers USB initialized as "connected." - */ -void update_usb_status(const bool forceUpdate) { - static bool last_usb_connected_status = false; - // This is mildly different than stock, which - // appears to use the usb discovery status. - // This is more logical. - if (last_usb_connected_status != USB_STATUS || forceUpdate) { - last_usb_connected_status = USB_STATUS; - write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n")); - } -} - -/** - * - from printer on startup: - * {SYS:STARTED}{VER:29}{SYS:STARTED}{R:UD} - * The optimize attribute fixes a register Compile - * error for amtel. - */ -void _O2 lcd_update() { - static char inbound_buffer[MAX_CURLY_COMMAND]; - - // First report USB status. - update_usb_status(false); - - // now drain commands... - while (LCD_SERIAL.available()) { - const byte b = (byte)LCD_SERIAL.read() & 0x7F; - inbound_buffer[inbound_count++] = b; - if (b == '}' || inbound_count == sizeof(inbound_buffer) - 1) { - inbound_buffer[inbound_count - 1] = '\0'; - process_lcd_command(inbound_buffer); - inbound_count = 0; - inbound_buffer[0] = 0; - } - } - - #if ENABLED(SDSUPPORT) - // The way last printing status works is simple: - // The UI needs to see at least one TQ which is not 100% - // and then when the print is complete, one which is. - static uint8_t last_percent_done = 100; - - // If there was a print in progress, we need to emit the final - // print status as {TQ:100}. Reset last percent done so a new print will - // issue a percent of 0. - const uint8_t percent_done = card.sdprinting ? card.percentDone() : last_printing_status ? 100 : 0; - if (percent_done != last_percent_done) { - char message_buffer[10]; - sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); - write_to_lcd(message_buffer); - last_percent_done = percent_done; - last_printing_status = card.sdprinting; - } - #endif -} - -/** - * The Malyan LCD actually runs as a separate MCU on Serial 1. - * This code's job is to siphon the weird curly-brace commands from - * it and translate into gcode, which then gets injected into - * the command queue where possible. - */ -void lcd_init() { - inbound_count = 0; - LCD_SERIAL.begin(500000); - - // Signal init - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - - // send a version that says "unsupported" - write_to_lcd_P(PSTR("{VER:99}\r\n")); - - // No idea why it does this twice. - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - update_usb_status(true); -} - -/** - * Set an alert. - */ -void lcd_setalertstatusPGM(const char* message) { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{E:%s}"), message); - write_to_lcd(message_buffer); -} - -#endif // MALYAN_LCD diff --git a/Marlin_thinkerV2/Marlin/mesh_bed_leveling.cpp b/Marlin_thinkerV2/Marlin/mesh_bed_leveling.cpp deleted file mode 100644 index cc2ee6ac45..0000000000 --- a/Marlin_thinkerV2/Marlin/mesh_bed_leveling.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(MESH_BED_LEVELING) - - #include "mesh_bed_leveling.h" - #include "Marlin.h" - #include "serial.h" - - mesh_bed_leveling mbl; - - float mesh_bed_leveling::z_offset, - mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X], - mesh_bed_leveling::index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling::mesh_bed_leveling() { - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; ++i) - index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; ++i) - index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST); - reset(); - } - - void mesh_bed_leveling::reset() { - z_offset = 0; - ZERO(z_values); - } - - void mesh_bed_leveling::report_mesh() { - SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); - SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5); - SERIAL_PROTOCOLLNPGM("\nMeasured points:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - -#endif // MESH_BED_LEVELING diff --git a/Marlin_thinkerV2/Marlin/mesh_bed_leveling.h b/Marlin_thinkerV2/Marlin/mesh_bed_leveling.h deleted file mode 100644 index cb95ad733f..0000000000 --- a/Marlin_thinkerV2/Marlin/mesh_bed_leveling.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _MESH_BED_LEVELING_H_ -#define _MESH_BED_LEVELING_H_ - -#include "MarlinConfig.h" - -enum MeshLevelingState : char { - MeshReport, - MeshStart, - MeshNext, - MeshSet, - MeshSetZOffset, - MeshReset -}; - -#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)) - -class mesh_bed_leveling { -public: - static float z_offset, - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - index_to_xpos[GRID_MAX_POINTS_X], - index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling(); - - static void report_mesh(); - - static void reset(); - - FORCE_INLINE static bool has_mesh() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (z_values[x][y]) return true; - return false; - } - - static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { - px = index % (GRID_MAX_POINTS_X); - py = index / (GRID_MAX_POINTS_X); - if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag - } - - static void set_zigzag_z(const int8_t index, const float &z) { - int8_t px, py; - zigzag(index, px, py); - set_z(px, py, z); - } - - static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (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)); - 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)); - 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)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - const float delta_z = (z2 - z1) / (a2 - a1), - delta_a = a0 - a1; - return z1 + delta_a * delta_z; - } - - static float get_z(const float &x0, const float &y0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , const float &factor - #endif - ) { - const int8_t cx = cell_index_x(x0), cy = cell_index_y(y0); - const float z1 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy], index_to_xpos[cx + 1], z_values[cx + 1][cy]), - z2 = calc_z0(x0, index_to_xpos[cx], z_values[cx][cy + 1], index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]), - z0 = calc_z0(y0, index_to_ypos[cy], z1, index_to_ypos[cy + 1], z2); - - return z_offset + z0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * factor - #endif - ; - } -}; - -extern mesh_bed_leveling mbl; - -#endif // _MESH_BED_LEVELING_H_ diff --git a/Marlin_thinkerV2/Marlin/neopixel.cpp b/Marlin_thinkerV2/Marlin/neopixel.cpp deleted file mode 100644 index 8daca3badf..0000000000 --- a/Marlin_thinkerV2/Marlin/neopixel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * neopixel.cpp - */ - -#include "MarlinConfig.h" - -#if ENABLED(NEOPIXEL_LED) - -#include "neopixel.h" - -#if ENABLED(NEOPIXEL_STARTUP_TEST) - #include "utility.h" -#endif - -Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); - -void set_neopixel_color(const uint32_t color) { - for (uint16_t i = 0; i < pixels.numPixels(); ++i) - pixels.setPixelColor(i, color); - pixels.show(); -} - -void setup_neopixel() { - SET_OUTPUT(NEOPIXEL_PIN); - pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range - pixels.begin(); - pixels.show(); // initialize to all off - - #if ENABLED(NEOPIXEL_STARTUP_TEST) - safe_delay(1000); - set_neopixel_color(pixels.Color(255, 0, 0, 0)); // red - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 255, 0, 0)); // green - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 0, 255, 0)); // blue - safe_delay(1000); - #endif - set_neopixel_color(pixels.Color(NEO_WHITE)); // white -} - -#endif // NEOPIXEL_LED - diff --git a/Marlin_thinkerV2/Marlin/neopixel.h b/Marlin_thinkerV2/Marlin/neopixel.h deleted file mode 100644 index b7ed45c827..0000000000 --- a/Marlin_thinkerV2/Marlin/neopixel.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * neopixel.h - */ - -#include "MarlinConfig.h" - -#define NEOPIXEL_IS_RGB (NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR) -#define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB - -#if NEOPIXEL_IS_RGB - #define NEO_WHITE 255, 255, 255, 0 -#else - #define NEO_WHITE 0, 0, 0, 255 -#endif - -#include -#include - -void setup_neopixel(); -void set_neopixel_color(const uint32_t color); - -extern Adafruit_NeoPixel pixels; diff --git a/Marlin_thinkerV2/Marlin/nozzle.cpp b/Marlin_thinkerV2/Marlin/nozzle.cpp deleted file mode 100644 index 8bff692e44..0000000000 --- a/Marlin_thinkerV2/Marlin/nozzle.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) - -#include "nozzle.h" - -#include "Marlin.h" -#include "point_t.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - */ - void Nozzle::stroke(const point_t &start, const point_t &end, const uint8_t &strokes) { - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - // Move to the starting point - do_blocking_move_to(start.x, start.y, start.z); - - // Start the stroke pattern - for (uint8_t i = 0; i < (strokes >> 1); i++) { - do_blocking_move_to_xy(end.x, end.y); - do_blocking_move_to_xy(start.x, start.y); - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of triangles to do - */ - void Nozzle::zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) { - const float diffx = end.x - start.x, diffy = end.y - start.y; - if (!diffx || !diffy) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - do_blocking_move_to(start.x, start.y, start.z); - - const uint8_t zigs = objects << 1; - const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe? - const float P = (horiz ? diffx : diffy) / zigs; // Period of each zig / zag - const point_t *side; - for (uint8_t j = 0; j < strokes; j++) { - for (int8_t i = 0; i < zigs; i++) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - for (int8_t i = zigs; i >= 0; i--) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start point_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - void Nozzle::circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) { - if (strokes == 0) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; - #endif - - do_blocking_move_to(start.x, start.y, start.z); - - for (uint8_t s = 0; s < strokes; s++) - for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++) - do_blocking_move_to_xy( - middle.x + sin((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius, - middle.y + cos((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius - ); - - // Let's be safe - do_blocking_move_to_xy(start.x, start.y); - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); - #endif - } - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects/*=0*/) { - switch (pattern) { - case 1: - zigzag(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes, objects); - break; - - case 2: - circle(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_CIRCLE_MIDDLE, strokes, radius); - break; - - default: - stroke(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes); - } - } - -#endif // NOZZLE_CLEAN_FEATURE - -#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; - const float fr_z = NOZZLE_PARK_Z_FEEDRATE; - - switch (z_action) { - case 1: // Go to Z-park height - do_blocking_move_to_z(park.z, fr_z); - break; - - case 2: // Raise by Z-park height - do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z); - break; - - default: // Raise to at least the Z-park height - do_blocking_move_to_z(MAX(park.z, current_position[Z_AXIS]), fr_z); - } - - do_blocking_move_to_xy(park.x, park.y, fr_xy); - } - -#endif // NOZZLE_PARK_FEATURE - -#endif // NOZZLE_CLEAN_FEATURE || NOZZLE_PARK_FEATURE diff --git a/Marlin_thinkerV2/Marlin/nozzle.h b/Marlin_thinkerV2/Marlin/nozzle.h deleted file mode 100644 index e564081e52..0000000000 --- a/Marlin_thinkerV2/Marlin/nozzle.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __NOZZLE_H__ -#define __NOZZLE_H__ - -#include "Marlin.h" -#include "point_t.h" - -/** - * @brief Nozzle class - * - * @todo: Do not ignore the end.z value and allow XYZ movements - */ -class Nozzle { - private: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - */ - static void stroke(const point_t &start, const point_t &end, const uint8_t &strokes) _Os; - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start point_t defining the starting point - * @param end point_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of objects to create - */ - static void zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start point_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - static void circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - public: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects=0) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - #if ENABLED(NOZZLE_PARK_FEATURE) - - static void park(const uint8_t &z_action, const point_t &park=NOZZLE_PARK_POINT) _Os; - - #endif -}; - -#endif // __NOZZLE_H__ diff --git a/Marlin_thinkerV2/Marlin/parser.cpp b/Marlin_thinkerV2/Marlin/parser.cpp deleted file mode 100644 index 178583cad0..0000000000 --- a/Marlin_thinkerV2/Marlin/parser.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * parser.cpp - Parser for a GCode line, providing a parameter interface. - */ - -#include "parser.h" - -#include "Marlin.h" -#include "language.h" - -// Must be declared for allocation and to satisfy the linker -// Zero values need no initialization. - -bool GCodeParser::volumetric_enabled; - -#if ENABLED(INCH_MODE_SUPPORT) - float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor; -#endif - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - TempUnit GCodeParser::input_temp_units; -#endif - -char *GCodeParser::command_ptr, - *GCodeParser::string_arg, - *GCodeParser::value_ptr; -char GCodeParser::command_letter; -int GCodeParser::codenum; -#if USE_GCODE_SUBCODES - uint8_t GCodeParser::subcode; -#endif - -#if ENABLED(FASTER_GCODE_PARSER) - // Optimized Parameters - uint32_t GCodeParser::codebits; // found bits - uint8_t GCodeParser::param[26]; // parameter offsets from command_ptr -#else - char *GCodeParser::command_args; // start of parameters -#endif - -// Create a global instance of the GCode parser singleton -GCodeParser parser; - -/** - * Clear all code-seen (and value pointers) - * - * Since each param is set/cleared on seen codes, - * this may be optimized by commenting out ZERO(param) - */ -void GCodeParser::reset() { - string_arg = NULL; // No whole line argument - command_letter = '?'; // No command letter - codenum = 0; // No command code - #if USE_GCODE_SUBCODES - subcode = 0; // No command sub-code - #endif - #if ENABLED(FASTER_GCODE_PARSER) - codebits = 0; // No codes yet - //ZERO(param); // No parameters (should be safe to comment out this line) - #endif -} - -// Populate all fields by parsing a single line of GCode -// 58 bytes of SRAM are used to speed up seen/value -void GCodeParser::parse(char *p) { - - reset(); // No codes to report - - // Skip spaces - while (*p == ' ') ++p; - - // Skip N[-0-9] if included in the command line - if (*p == 'N' && NUMERIC_SIGNED(p[1])) { - #if ENABLED(FASTER_GCODE_PARSER) - //set('N', p + 1); // (optional) Set the 'N' parameter value - #endif - p += 2; // skip N[-0-9] - while (NUMERIC(*p)) ++p; // skip [0-9]* - while (*p == ' ') ++p; // skip [ ]* - } - - // *p now points to the current command, which should be G, M, or T - command_ptr = p; - - // Get the command letter, which must be G, M, or T - const char letter = *p++; - - // Nullify asterisk and trailing whitespace - char *starpos = strchr(p, '*'); - if (starpos) { - --starpos; // * - while (*starpos == ' ') --starpos; // spaces... - starpos[1] = '\0'; - } - - // Bail if the letter is not G, M, or T - switch (letter) { case 'G': case 'M': case 'T': break; default: return; } - - // Skip spaces to get the numeric part - while (*p == ' ') p++; - - // Bail if there's no command code number - if (!NUMERIC(*p)) return; - - // Save the command letter at this point - // A '?' signifies an unknown command - command_letter = letter; - - // Get the code number - integer digits only - codenum = 0; - do { - codenum *= 10, codenum += *p++ - '0'; - } while (NUMERIC(*p)); - - // Allow for decimal point in command - #if USE_GCODE_SUBCODES - if (*p == '.') { - p++; - while (NUMERIC(*p)) - subcode *= 10, subcode += *p++ - '0'; - } - #endif - - // Skip all spaces to get to the first argument, or nul - while (*p == ' ') p++; - - // The command parameters (if any) start here, for sure! - - #if DISABLED(FASTER_GCODE_PARSER) - command_args = p; // Scan for parameters in seen() - #endif - - // Only use string_arg for these M codes - if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; } - - #if ENABLED(DEBUG_GCODE_PARSER) - const bool debug = codenum == 800; - #endif - - /** - * Find all parameters, set flags and pointers for fast parsing - * - * Most codes ignore 'string_arg', but those that want a string will get the right pointer. - * The following loop assigns the first "parameter" having no numeric value to 'string_arg'. - * This allows M0/M1 with expire time to work: "M0 S5 You Win!" - * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' - */ - string_arg = NULL; - while (const char code = *p++) { // Get the next parameter. A NUL ends the loop - - // Special handling for M32 [P] !/path/to/file.g# - // The path must be the last parameter - if (code == '!' && letter == 'M' && codenum == 32) { - string_arg = p; // Name starts after '!' - char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering) - if (lb) *lb = '\0'; // Safe to mark the end of the filename - return; - } - - // Arguments MUST be uppercase for fast GCode parsing - #if ENABLED(FASTER_GCODE_PARSER) - #define PARAM_TEST WITHIN(code, 'A', 'Z') - #else - #define PARAM_TEST true - #endif - - if (PARAM_TEST) { - - while (*p == ' ') p++; // Skip spaces between parameters & values - - const bool has_num = valid_float(p); - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) { - SERIAL_ECHOPAIR("Got letter ", code); - SERIAL_ECHOPAIR(" at index ", (int)(p - command_ptr - 1)); - if (has_num) SERIAL_ECHOPGM(" (has_num)"); - } - #endif - - if (!has_num && !string_arg) { // No value? First time, keep as string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_EOL(); - #endif - - #if ENABLED(FASTER_GCODE_PARSER) - set(code, has_num ? p : NULL); // Set parameter exists and pointer (NULL for no number) - #endif - } - else if (!string_arg) { // Not A-Z? First time, keep as the string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - if (!WITHIN(*p, 'A', 'Z')) { // Another parameter right away? - while (*p && DECIMAL_SIGNED(*p)) p++; // Skip over the value section of a parameter - while (*p == ' ') p++; // Skip over all spaces - } - } -} - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - - // Parse the next parameter as a new command - bool GCodeParser::chain() { - #if ENABLED(FASTER_GCODE_PARSER) - char *next_command = command_ptr; - if (next_command) { - while (*next_command && *next_command != ' ') ++next_command; - while (*next_command == ' ') ++next_command; - if (!*next_command) next_command = NULL; - } - #else - const char *next_command = command_args; - #endif - if (next_command) parse(next_command); - return !!next_command; - } - -#endif // CNC_COORDINATE_SYSTEMS - -void GCodeParser::unknown_command_error() { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_UNKNOWN_COMMAND, command_ptr); - SERIAL_CHAR('"'); - SERIAL_EOL(); -} - -#if ENABLED(DEBUG_GCODE_PARSER) - - void GCodeParser::debug() { - SERIAL_ECHOPAIR("Command: ", command_ptr); - SERIAL_ECHOPAIR(" (", command_letter); - SERIAL_ECHO(codenum); - SERIAL_ECHOLNPGM(")"); - #if ENABLED(FASTER_GCODE_PARSER) - SERIAL_ECHOPGM(" args: \""); - for (char c = 'A'; c <= 'Z'; ++c) - if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); } - #else - SERIAL_ECHOPAIR(" args: \"", command_args); - #endif - SERIAL_CHAR('"'); - if (string_arg) { - SERIAL_ECHOPGM(" string: \""); - SERIAL_ECHO(string_arg); - SERIAL_CHAR('"'); - } - SERIAL_ECHOPGM("\n\n"); - for (char c = 'A'; c <= 'Z'; ++c) { - if (seen(c)) { - SERIAL_ECHOPAIR("Code '", c); SERIAL_ECHOPGM("':"); - if (has_value()) { - SERIAL_ECHOPAIR("\n float: ", value_float()); - SERIAL_ECHOPAIR("\n long: ", value_long()); - SERIAL_ECHOPAIR("\n ulong: ", value_ulong()); - SERIAL_ECHOPAIR("\n millis: ", value_millis()); - SERIAL_ECHOPAIR("\n sec-ms: ", value_millis_from_seconds()); - SERIAL_ECHOPAIR("\n int: ", value_int()); - SERIAL_ECHOPAIR("\n ushort: ", value_ushort()); - SERIAL_ECHOPAIR("\n byte: ", (int)value_byte()); - SERIAL_ECHOPAIR("\n bool: ", (int)value_bool()); - SERIAL_ECHOPAIR("\n linear: ", value_linear_units()); - SERIAL_ECHOPAIR("\n celsius: ", value_celsius()); - } - else - SERIAL_ECHOPGM(" (no value)"); - SERIAL_ECHOPGM("\n\n"); - } - } - } - -#endif // DEBUG_GCODE_PARSER diff --git a/Marlin_thinkerV2/Marlin/parser.h b/Marlin_thinkerV2/Marlin/parser.h deleted file mode 100644 index 6a86ad373e..0000000000 --- a/Marlin_thinkerV2/Marlin/parser.h +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * parser.h - Parser for a GCode line, providing a parameter interface. - * Codes like M149 control the way the GCode parser behaves, - * so settings for these codes are located in this class. - */ - -#ifndef _PARSER_H_ -#define _PARSER_H_ - -#include "enum.h" -#include "types.h" -#include "MarlinConfig.h" - -//#define DEBUG_GCODE_PARSER -#if ENABLED(DEBUG_GCODE_PARSER) - #include "hex_print_routines.h" - #include "serial.h" -#endif - -#define strtof strtod - -/** - * GCode parser - * - * - Parse a single gcode line for its letter, code, subcode, and parameters - * - FASTER_GCODE_PARSER: - * - Flags existing params (1 bit each) - * - Stores value offsets (1 byte each) - * - Provide accessors for parameters: - * - Parameter exists - * - Parameter has value - * - Parameter value in different units and types - */ -class GCodeParser { - -private: - static char *value_ptr; // Set by seen, used to fetch the value - - #if ENABLED(FASTER_GCODE_PARSER) - static uint32_t codebits; // Parameters pre-scanned - static uint8_t param[26]; // For A-Z, offsets into command args - #else - static char *command_args; // Args start here, for slow scan - #endif - -public: - - // Global states for GCode-level units features - - static bool volumetric_enabled; - - #if ENABLED(INCH_MODE_SUPPORT) - static float linear_unit_factor, volumetric_unit_factor; - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static TempUnit input_temp_units; - #endif - - // Command line state - static char *command_ptr, // The command, so it can be echoed - *string_arg; // string of command line - - static char command_letter; // G, M, or T - static int codenum; // 123 - #if USE_GCODE_SUBCODES - static uint8_t subcode; // .1 - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - static void debug(); - #endif - - GCodeParser() { - #if ENABLED(INCH_MODE_SUPPORT) - set_input_linear_units(LINEARUNIT_MM); - #endif - } - - // Reset is done before parsing - static void reset(); - - #define LETTER_BIT(N) ((N) - 'A') - - FORCE_INLINE static bool valid_signless(const char * const p) { - return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9] - } - - FORCE_INLINE static bool valid_float(const char * const p) { - return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9] - } - - #if ENABLED(FASTER_GCODE_PARSER) - - FORCE_INLINE static bool valid_int(const char * const p) { - return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9] - } - - // Set the flag and pointer for a parameter - static void set(const char c, char * const ptr) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return; // Only A-Z - SBI32(codebits, ind); // parameter exists - param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0 - #if ENABLED(DEBUG_GCODE_PARSER) - if (codenum == 800) { - SERIAL_ECHOPAIR("Set bit ", (int)ind); - SERIAL_ECHOPAIR(" of codebits (", hex_address((void*)(codebits >> 16))); - print_hex_word((uint16_t)(codebits & 0xFFFF)); - SERIAL_ECHOLNPAIR(") | param = ", (int)param[ind]); - } - #endif - } - - // Code seen bit was set. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static bool seen(const char c) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return false; // Only A-Z - const bool b = TEST32(codebits, ind); - if (b) { - #if ENABLED(DEBUG_GCODE_PARSER) - if (codenum == 800) { - SERIAL_CHAR('\''); SERIAL_CHAR(c); SERIAL_ECHOLNPGM("' is seen"); - } - #endif - char * const ptr = command_ptr + param[ind]; - value_ptr = param[ind] && valid_float(ptr) ? ptr : (char*)NULL; - } - return b; - } - - static bool seen_any() { return !!codebits; } - - #define SEEN_TEST(L) TEST32(codebits, LETTER_BIT(L)) - - #else // !FASTER_GCODE_PARSER - - // Code is found in the string. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static bool seen(const char c) { - char *p = strchr(command_args, c); - const bool b = !!p; - if (b) value_ptr = valid_float(&p[1]) ? &p[1] : (char*)NULL; - return b; - } - - static bool seen_any() { return *command_args == '\0'; } - - #define SEEN_TEST(L) !!strchr(command_args, L) - - #endif // !FASTER_GCODE_PARSER - - // Seen any axis parameter - static bool seen_axis() { - return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E'); - } - - // Populate all fields by parsing a single line of GCode - // This uses 54 bytes of SRAM to speed up seen/value - static void parse(char * p); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Parse the next parameter as a new command - static bool chain(); - #endif - - // The code value pointer was set - FORCE_INLINE static bool has_value() { return value_ptr != NULL; } - - // Seen a parameter with a value - inline static bool seenval(const char c) { return seen(c) && has_value(); } - - // Float removes 'E' to prevent scientific notation interpretation - inline static float value_float() { - if (value_ptr) { - char *e = value_ptr; - for (;;) { - const char c = *e; - if (c == '\0' || c == ' ') break; - if (c == 'E' || c == 'e') { - *e = '\0'; - const float ret = strtof(value_ptr, NULL); - *e = c; - return ret; - } - ++e; - } - return strtof(value_ptr, NULL); - } - return 0; - } - - // Code value as a long or ulong - inline static int32_t value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; } - inline static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; } - - // Code value for use as time - FORCE_INLINE static millis_t value_millis() { return value_ulong(); } - FORCE_INLINE static millis_t value_millis_from_seconds() { return value_float() * 1000UL; } - - // Reduce to fewer bits - FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); } - FORCE_INLINE static uint16_t value_ushort() { return (uint16_t)value_long(); } - inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } - - // Bool is true with no value or non-zero - inline static bool value_bool() { return !has_value() || !!value_byte(); } - - // Units modes: Inches, Fahrenheit, Kelvin - - #if ENABLED(INCH_MODE_SUPPORT) - - inline static void set_input_linear_units(const LinearUnit units) { - switch (units) { - case LINEARUNIT_INCH: - linear_unit_factor = 25.4; - break; - case LINEARUNIT_MM: - default: - linear_unit_factor = 1.0; - break; - } - volumetric_unit_factor = POW(linear_unit_factor, 3.0); - } - - inline static float axis_unit_factor(const AxisEnum axis) { - return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); - } - - inline static float value_linear_units() { return value_float() * linear_unit_factor; } - inline static float value_axis_units(const AxisEnum axis) { return value_float() * axis_unit_factor(axis); } - inline static float value_per_axis_unit(const AxisEnum axis) { return value_float() / axis_unit_factor(axis); } - - #else - - FORCE_INLINE static float value_linear_units() { return value_float(); } - FORCE_INLINE static float value_axis_units(const AxisEnum a) { UNUSED(a); return value_float(); } - FORCE_INLINE static float value_per_axis_unit(const AxisEnum a) { UNUSED(a); return value_float(); } - - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - - inline static void set_input_temp_units(TempUnit units) { input_temp_units = units; } - - #if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503) - - FORCE_INLINE static char temp_units_code() { - return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; - } - FORCE_INLINE static const char* temp_units_name() { - return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius"); - } - inline static float to_temp_units(const float &f) { - switch (input_temp_units) { - case TEMPUNIT_F: - return f * 0.5555555556 + 32.0; - case TEMPUNIT_K: - return f + 273.15; - case TEMPUNIT_C: - default: - return f; - } - } - - #endif // ULTIPANEL && !DISABLE_M503 - - inline static float value_celsius() { - const float f = value_float(); - switch (input_temp_units) { - case TEMPUNIT_F: - return (f - 32.0) * 0.5555555556; - case TEMPUNIT_K: - return f - 273.15; - case TEMPUNIT_C: - default: - return f; - } - } - - inline static float value_celsius_diff() { - switch (input_temp_units) { - case TEMPUNIT_F: - return value_float() * 0.5555555556; - case TEMPUNIT_C: - case TEMPUNIT_K: - default: - return value_float(); - } - } - - #else // !TEMPERATURE_UNITS_SUPPORT - - FORCE_INLINE static float value_celsius() { return value_float(); } - FORCE_INLINE static float value_celsius_diff() { return value_float(); } - - #endif // !TEMPERATURE_UNITS_SUPPORT - - FORCE_INLINE static float value_feedrate() { return value_linear_units(); } - - void unknown_command_error(); - - // Provide simple value accessors with default option - FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - FORCE_INLINE static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - FORCE_INLINE static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - FORCE_INLINE static float linearval(const char c, const float dval=0.0) { return seenval(c) ? value_linear_units() : dval; } - FORCE_INLINE static float celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius() : dval; } - -}; - -extern GCodeParser parser; - -#endif // _PARSER_H_ diff --git a/Marlin_thinkerV2/Marlin/pca9632.cpp b/Marlin_thinkerV2/Marlin/pca9632.cpp deleted file mode 100644 index 4c339f4604..0000000000 --- a/Marlin_thinkerV2/Marlin/pca9632.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -#include "MarlinConfig.h" - -#if ENABLED(PCA9632) - -#include "pca9632.h" -#include "leds.h" -#include - -#define PCA9632_MODE1_VALUE 0b00000001 //(ALLCALL) -#define PCA9632_MODE2_VALUE 0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM) -#define PCA9632_LEDOUT_VALUE 0b00101010 - -/* Register addresses */ -#define PCA9632_MODE1 0x00 -#define PCA9632_MODE2 0x01 -#define PCA9632_PWM0 0x02 -#define PCA9632_PWM1 0x03 -#define PCA9632_PWM2 0x04 -#define PCA9632_PWM3 0x05 -#define PCA9632_GRPPWM 0x06 -#define PCA9632_GRPFREQ 0x07 -#define PCA9632_LEDOUT 0x08 -#define PCA9632_SUBADR1 0x09 -#define PCA9632_SUBADR2 0x0A -#define PCA9632_SUBADR3 0x0B -#define PCA9632_ALLCALLADDR 0x0C - -#define PCA9632_NO_AUTOINC 0x00 -#define PCA9632_AUTO_ALL 0x80 -#define PCA9632_AUTO_IND 0xA0 -#define PCA9632_AUTOGLO 0xC0 -#define PCA9632_AUTOGI 0xE0 - -// Red LED0 -// Green LED1 -// Blue LED2 -#define PCA9632_RED 0x00 -#define PCA9632_GRN 0x02 -#define PCA9632_BLU 0x04 - -#define LED_OFF 0x00 -#define LED_ON 0x01 -#define LED_PWM 0x02 - -#define PCA9632_ADDRESS 0b01100000 - -byte PCA_init = 0; - -static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte value) { - Wire.beginTransmission(addr); - Wire.write(regadd); - Wire.write(value); - Wire.endTransmission(); -} - -static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte value1, const byte value2, const byte value3) { - Wire.beginTransmission(addr); - Wire.write(PCA9632_AUTO_IND | regadd); - Wire.write(value1); - Wire.write(value2); - Wire.write(value3); - Wire.endTransmission(); -} - -#if 0 - static byte PCA9632_ReadRegister(const byte addr, const byte regadd) { - Wire.beginTransmission(addr); - Wire.write(regadd); - const byte value = Wire.read(); - Wire.endTransmission(); - return value; - } -#endif - -void pca9632_set_led_color(const LEDColor &color) { - Wire.begin(); - if (!PCA_init) { - PCA_init = 1; - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); - } - - const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0) - | (color.g ? LED_PWM << PCA9632_GRN : 0) - | (color.b ? LED_PWM << PCA9632_BLU : 0); - - PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); -} - -#endif // PCA9632 diff --git a/Marlin_thinkerV2/Marlin/pca9632.h b/Marlin_thinkerV2/Marlin/pca9632.h deleted file mode 100644 index 4d98267beb..0000000000 --- a/Marlin_thinkerV2/Marlin/pca9632.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -#ifndef __PCA9632_H__ -#define __PCA9632_H__ - -struct LEDColor; -typedef LEDColor LEDColor; - -void pca9632_set_led_color(const LEDColor &color); - -#endif // __PCA9632_H__ diff --git a/Marlin_thinkerV2/Marlin/pins.h b/Marlin_thinkerV2/Marlin/pins.h deleted file mode 100644 index 355fa7319f..0000000000 --- a/Marlin_thinkerV2/Marlin/pins.h +++ /dev/null @@ -1,833 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Include pins definitions - * - * Pins numbering schemes: - * - * - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR) - * The FastIO headers map digital pins to their ports and functions. - * - * - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN) - * These numbers are the same in any pin mapping. - */ - -#ifndef __PINS_H__ -#define __PINS_H__ - -#if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) - #define IS_RAMPS_EFB -#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_PLUS_EEB) - #define IS_RAMPS_EEB -#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_PLUS_EFF) - #define IS_RAMPS_EFF -#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_PLUS_EEF) - #define IS_RAMPS_EEF -#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) || MB(RAMPS_PLUS_SF) - #define IS_RAMPS_SF -#endif - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#if MB(RAMPS_OLD) - #include "pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_SF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_SF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_SF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#elif MB(3DRAG) - #include "pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(K8200) - #include "pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(K8400) - #include "pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(BAM_DICE) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(BAM_DICE_DUE) - #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE) - #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_15) - #include "pins_MKS_BASE_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_HEROIC) - #include "pins_MKS_BASE_HEROIC.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_13) - #include "pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_L) - #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ZRIB_V20) - #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) -#elif MB(FELIX2) - #include "pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD) - #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD_V2) - #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(SAINSMART_2IN1) - #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER) - #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER_OLD) - #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(AZTEEG_X3) - #include "pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 -#elif MB(AZTEEG_X3_PRO) - #include "pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 -#elif MB(ULTIMAIN_2) - #include "pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(RUMBA) - #include "pins_RUMBA.h" // ATmega2560 env:megaatmega2560 -#elif MB(BQ_ZUM_MEGA_3D) - #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 -#elif MB(MAKEBOARD_MINI) - #include "pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_13) - #include "pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_14) - #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_ENDER_4) - #include "pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 - -// -// Other ATmega1280, ATmega2560 -// - -#elif MB(CNCONTROLS_11) - #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CNCONTROLS_12) - #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MIGHTYBOARD_REVE) - #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CHEAPTRONIC) - #include "pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 -#elif MB(CHEAPTRONIC_V2) - #include "pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS) - #include "pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_2) - #include "pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31) - #include "pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMBO) - #include "pins_RAMBO.h" // ATmega2560 env:rambo -#elif MB(MINIRAMBO) || MB(MINIRAMBO_10A) - #include "pins_MINIRAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RAMBO) - #include "pins_EINSY_RAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RETRO) - #include "pins_EINSY_RETRO.h" // ATmega2560 env:rambo -#elif MB(ELEFU_3) - #include "pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(LEAPFROG) - #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MEGACONTROLLER) - #include "pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 -#elif MB(SCOOVO_X9H) - #include "pins_SCOOVO_X9H.h" // ATmega2560 env:rambo -#elif MB(GT2560_REV_A) - #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(GT2560_REV_A_PLUS) - #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 - -// -// ATmega1281, ATmega2561 -// - -#elif MB(MINITRONICS) - #include "pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 -#elif MB(SILVER_GATE) - #include "pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#elif MB(SANGUINOLOLU_11) - #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(SANGUINOLOLU_12) - #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI) - #include "pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MAKR3D) - #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_CREALITY) - #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MALYAN) - #include "pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_TRONXY) - #include "pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(STB_11) - #include "pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(AZTEEG_X1) - #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#elif MB(GEN3_MONOLITHIC) - #include "pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p -#elif MB(GEN3_PLUS) - #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6) - #include "pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6_DELUXE) - #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_CUSTOM) - #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_12) - #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_13) - #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_14) - #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(OMCA_A) - #include "pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p -#elif MB(OMCA) - #include "pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p -#elif MB(ANET_10) - #include "pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p -#elif MB(SETHI) - #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#elif MB(TEENSYLU) - #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90USB1286_CDC -#elif MB(PRINTRBOARD) - #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90USB1286_DFU -#elif MB(PRINTRBOARD_REVF) - #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90USB1286_DFU -#elif MB(BRAINWAVE) - #include "pins_BRAINWAVE.h" // AT90USB646 env:at90USB1286_CDC -#elif MB(BRAINWAVE_PRO) - #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90USB1286_CDC -#elif MB(SAV_MKI) - #include "pins_SAV_MKI.h" // AT90USB1286 env:at90USB1286_CDC -#elif MB(TEENSY2) - #include "pins_TEENSY2.h" // AT90USB1286 env:teensy20 -#elif MB(5DPRINT) - #include "pins_5DPRINT.h" // AT90USB1286 ?env:at90USB1286_DFU - -#else - #error "Unknown MOTHERBOARD value set in Configuration.h" -#endif - -// Define certain undefined pins -#ifndef X_MS1_PIN - #define X_MS1_PIN -1 -#endif -#ifndef X_MS2_PIN - #define X_MS2_PIN -1 -#endif -#ifndef Y_MS1_PIN - #define Y_MS1_PIN -1 -#endif -#ifndef Y_MS2_PIN - #define Y_MS2_PIN -1 -#endif -#ifndef Z_MS1_PIN - #define Z_MS1_PIN -1 -#endif -#ifndef Z_MS2_PIN - #define Z_MS2_PIN -1 -#endif -#ifndef Z_MS3_PIN - #define Z_MS3_PIN -1 -#endif -#ifndef E0_MS1_PIN - #define E0_MS1_PIN -1 -#endif -#ifndef E0_MS2_PIN - #define E0_MS2_PIN -1 -#endif -#ifndef E1_MS1_PIN - #define E1_MS1_PIN -1 -#endif -#ifndef E1_MS2_PIN - #define E1_MS2_PIN -1 -#endif -#ifndef E2_MS1_PIN - #define E2_MS1_PIN -1 -#endif -#ifndef E2_MS2_PIN - #define E2_MS2_PIN -1 -#endif -#ifndef E3_MS1_PIN - #define E3_MS1_PIN -1 -#endif -#ifndef E3_MS2_PIN - #define E3_MS2_PIN -1 -#endif -#ifndef E3_MS3_PIN - #define E3_MS3_PIN -1 -#endif -#ifndef E4_MS1_PIN - #define E4_MS1_PIN -1 -#endif -#ifndef E4_MS2_PIN - #define E4_MS2_PIN -1 -#endif -#ifndef E4_MS3_PIN - #define E4_MS3_PIN -1 -#endif - -#ifndef E0_STEP_PIN - #define E0_STEP_PIN -1 -#endif -#ifndef E0_DIR_PIN - #define E0_DIR_PIN -1 -#endif -#ifndef E0_ENABLE_PIN - #define E0_ENABLE_PIN -1 -#endif -#ifndef E1_STEP_PIN - #define E1_STEP_PIN -1 -#endif -#ifndef E1_DIR_PIN - #define E1_DIR_PIN -1 -#endif -#ifndef E1_ENABLE_PIN - #define E1_ENABLE_PIN -1 -#endif -#ifndef E2_STEP_PIN - #define E2_STEP_PIN -1 -#endif -#ifndef E2_DIR_PIN - #define E2_DIR_PIN -1 -#endif -#ifndef E2_ENABLE_PIN - #define E2_ENABLE_PIN -1 -#endif -#ifndef E3_STEP_PIN - #define E3_STEP_PIN -1 -#endif -#ifndef E3_DIR_PIN - #define E3_DIR_PIN -1 -#endif -#ifndef E3_ENABLE_PIN - #define E3_ENABLE_PIN -1 -#endif -#ifndef E4_STEP_PIN - #define E4_STEP_PIN -1 -#endif -#ifndef E4_DIR_PIN - #define E4_DIR_PIN -1 -#endif -#ifndef E4_ENABLE_PIN - #define E4_ENABLE_PIN -1 -#endif - -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif -#ifndef E4_CS_PIN - #define E4_CS_PIN -1 -#endif - -#ifndef FAN_PIN - #define FAN_PIN -1 -#endif -#ifndef FAN1_PIN - #define FAN1_PIN -1 -#endif -#ifndef FAN2_PIN - #define FAN2_PIN -1 -#endif -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN -1 -#endif - -#ifndef FANMUX0_PIN - #define FANMUX0_PIN -1 -#endif -#ifndef FANMUX1_PIN - #define FANMUX1_PIN -1 -#endif -#ifndef FANMUX2_PIN - #define FANMUX2_PIN -1 -#endif - -#ifndef HEATER_0_PIN - #define HEATER_0_PIN -1 -#endif -#ifndef HEATER_1_PIN - #define HEATER_1_PIN -1 -#endif -#ifndef HEATER_2_PIN - #define HEATER_2_PIN -1 -#endif -#ifndef HEATER_3_PIN - #define HEATER_3_PIN -1 -#endif -#ifndef HEATER_4_PIN - #define HEATER_4_PIN -1 -#endif -#ifndef HEATER_BED_PIN - #define HEATER_BED_PIN -1 -#endif - -#ifndef TEMP_0_PIN - #define TEMP_0_PIN -1 -#endif -#ifndef TEMP_1_PIN - #define TEMP_1_PIN -1 -#endif -#ifndef TEMP_2_PIN - #define TEMP_2_PIN -1 -#endif -#ifndef TEMP_3_PIN - #define TEMP_3_PIN -1 -#endif -#ifndef TEMP_4_PIN - #define TEMP_4_PIN -1 -#endif -#ifndef TEMP_BED_PIN - #define TEMP_BED_PIN -1 -#endif - -#ifndef SD_DETECT_PIN - #define SD_DETECT_PIN -1 -#endif -#ifndef SDPOWER - #define SDPOWER -1 -#endif -#ifndef SDSS - #define SDSS -1 -#endif -#ifndef LED_PIN - #define LED_PIN -1 -#endif -#ifndef PS_ON_PIN - #define PS_ON_PIN -1 -#endif -#ifndef KILL_PIN - #define KILL_PIN -1 -#endif -#ifndef SUICIDE_PIN - #define SUICIDE_PIN -1 -#endif - -#ifndef MAX_EXTRUDERS - #define MAX_EXTRUDERS 5 -#endif - -// -// Assign auto fan pins if needed -// -#ifndef E0_AUTO_FAN_PIN - #ifdef ORIG_E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN - #else - #define E0_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E1_AUTO_FAN_PIN - #ifdef ORIG_E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN - #else - #define E1_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E2_AUTO_FAN_PIN - #ifdef ORIG_E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN - #else - #define E2_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E3_AUTO_FAN_PIN - #ifdef ORIG_E3_AUTO_FAN_PIN - #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN - #else - #define E3_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E4_AUTO_FAN_PIN - #ifdef ORIG_E4_AUTO_FAN_PIN - #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN - #else - #define E4_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef CHAMBER_AUTO_FAN_PIN - #ifdef ORIG_CHAMBER_AUTO_FAN_PIN - #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN - #else - #define CHAMBER_AUTO_FAN_PIN -1 - #endif -#endif - -// List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those! -#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN, -#define _E1_PINS -#define _E2_PINS -#define _E3_PINS -#define _E4_PINS - -#if ENABLED(SWITCHING_EXTRUDER) - // Tools 0 and 1 use E0 - #if EXTRUDERS > 2 // Tools 2 and 3 use E1 - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if EXTRUDERS > 4 // Tools 4 and 5 use E2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #endif - #endif -#elif EXTRUDERS > 1 - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if EXTRUDERS > 2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #if EXTRUDERS > 3 - #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN, - #if EXTRUDERS > 4 - #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN, - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 -#endif // EXTRUDERS > 1 - -// Marlin needs to account for pins that equal -1 -#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p)) - -#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), -#define _H1_PINS -#define _H2_PINS -#define _H3_PINS -#define _H4_PINS - -#if HOTENDS > 1 - #undef _H1_PINS - #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN), - #if HOTENDS > 2 - #undef _H2_PINS - #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN), - #if HOTENDS > 3 - #undef _H3_PINS - #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN), - #if HOTENDS > 4 - #undef _H4_PINS - #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN), - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#elif ENABLED(MIXING_EXTRUDER) - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN, - #if MIXING_STEPPERS > 2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN, - #if MIXING_STEPPERS > 3 - #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN, - #if MIXING_STEPPERS > 4 - #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN, - #endif // MIXING_STEPPERS > 4 - #endif // MIXING_STEPPERS > 3 - #endif // MIXING_STEPPERS > 2 -#endif // MIXING_STEPPERS > 1 - -#define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN), - -// -// Assign endstop pins for boards with only 3 connectors -// -#ifdef X_STOP_PIN - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_STOP_PIN - #define X_MAX_PIN -1 - #else - #define X_MIN_PIN -1 - #define X_MAX_PIN X_STOP_PIN - #endif -#endif - -#ifdef Y_STOP_PIN - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_STOP_PIN - #define Y_MAX_PIN -1 - #else - #define Y_MIN_PIN -1 - #define Y_MAX_PIN Y_STOP_PIN - #endif -#endif - -#ifdef Z_STOP_PIN - #if Z_HOME_DIR < 0 - #define Z_MIN_PIN Z_STOP_PIN - #define Z_MAX_PIN -1 - #else - #define Z_MIN_PIN -1 - #define Z_MAX_PIN Z_STOP_PIN - #endif -#endif - -// -// Disable unused endstop / probe pins -// -#if DISABLED(Z_MIN_PROBE_ENDSTOP) - #undef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN -1 -#endif - -#if DISABLED(USE_XMAX_PLUG) - #undef X_MAX_PIN - #define X_MAX_PIN -1 -#endif - -#if DISABLED(USE_YMAX_PLUG) - #undef Y_MAX_PIN - #define Y_MAX_PIN -1 -#endif - -#if DISABLED(USE_ZMAX_PLUG) - #undef Z_MAX_PIN - #define Z_MAX_PIN -1 -#endif - -#if DISABLED(USE_XMIN_PLUG) - #undef X_MIN_PIN - #define X_MIN_PIN -1 -#endif - -#if DISABLED(USE_YMIN_PLUG) - #undef Y_MIN_PIN - #define Y_MIN_PIN -1 -#endif - -#if DISABLED(USE_ZMIN_PLUG) - #undef Z_MIN_PIN - #define Z_MIN_PIN -1 -#endif - -#ifndef LCD_PINS_D4 - #define LCD_PINS_D4 -1 -#endif -#ifndef LCD_PINS_D5 - #define LCD_PINS_D5 -1 -#endif -#ifndef LCD_PINS_D6 - #define LCD_PINS_D6 -1 -#endif -#ifndef LCD_PINS_D7 - #define LCD_PINS_D7 -1 -#endif - -// -// Dual X-carriage, Dual Y, Dual Z support -// - -#define _X2_PINS -#define _Y2_PINS -#define _Z2_PINS - -#define __EPIN(p,q) E##p##_##q##_PIN -#define _EPIN(p,q) __EPIN(p,q) - -// The X2 axis, if any, should be the next open extruder port -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS) - #ifndef X2_STEP_PIN - #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) - #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) - #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) - #ifndef X2_CS_PIN - #define X2_CS_PIN _EPIN(E_STEPPERS, CS) - #endif - #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE) - #error "No E stepper plug left for X2!" - #endif - #endif - #undef _X2_PINS - #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, - #ifdef X2_CS_PIN - #define _X2_PINS __X2_PINS X2_CS_PIN, - #else - #define _X2_PINS __X2_PINS - #endif - #define Y2_E_INDEX INCREMENT(E_STEPPERS) -#else - #define Y2_E_INDEX E_STEPPERS -#endif - -// The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #ifndef Y2_STEP_PIN - #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) - #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) - #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) - #ifndef Y2_CS_PIN - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif - #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE) - #error "No E stepper plug left for Y2!" - #endif - #endif - #undef _Y2_PINS - #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, - #ifdef Y2_CS_PIN - #define _Y2_PINS __Y2_PINS Y2_CS_PIN, - #else - #define _Y2_PINS __Y2_PINS - #endif - #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) -#else - #define Z2_E_INDEX Y2_E_INDEX -#endif - -// The Z2 axis, if any, should be the next open extruder port -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #ifndef Z2_STEP_PIN - #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) - #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) - #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) - #ifndef Z2_CS_PIN - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif - #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE) - #error "No E stepper plug left for Z2!" - #endif - #endif - #undef _Z2_PINS - #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, - #ifdef Z2_CS_PIN - #define _Z2_PINS __Z2_PINS Z2_CS_PIN, - #else - #define _Z2_PINS __Z2_PINS - #endif -#endif - -#define SENSITIVE_PINS { 0, 1, \ - X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \ - Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \ - Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MS1_PIN, Z_MS2_PIN, Z_MS3_PIN, Z_CS_PIN, Z_MIN_PROBE_PIN, \ - PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \ - _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \ - _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \ - _X2_PINS _Y2_PINS _Z2_PINS \ - } - -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) - #define AVR_SCK_PIN 13 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 10 -#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) - #define AVR_SCK_PIN 7 - #define AVR_MISO_PIN 6 - #define AVR_MOSI_PIN 5 - #define AVR_SS_PIN 4 -#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - #define AVR_SCK_PIN 52 - #define AVR_MISO_PIN 50 - #define AVR_MOSI_PIN 51 - #define AVR_SS_PIN 53 -#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) - #define AVR_SCK_PIN 21 - #define AVR_MISO_PIN 23 - #define AVR_MOSI_PIN 22 - #define AVR_SS_PIN 20 -#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - #define AVR_SCK_PIN 10 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 16 -#endif - -#ifndef SCK_PIN - #define SCK_PIN AVR_SCK_PIN -#endif -#ifndef MISO_PIN - #define MISO_PIN AVR_MISO_PIN -#endif -#ifndef MOSI_PIN - #define MOSI_PIN AVR_MOSI_PIN -#endif -#ifndef SS_PIN - #define SS_PIN AVR_SS_PIN -#endif - -#endif // __PINS_H__ diff --git a/Marlin_thinkerV2/Marlin/pinsDebug.h b/Marlin_thinkerV2/Marlin/pinsDebug.h deleted file mode 100644 index 24d058b4f2..0000000000 --- a/Marlin_thinkerV2/Marlin/pinsDebug.h +++ /dev/null @@ -1,586 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -bool endstop_monitor_flag = false; - -#define NAME_FORMAT "%-35s" // one place to specify the format of all the sources of names - // "-" left justify, "28" minimum width of name, pad with blanks - -#if AVR_ATmega1284_FAMILY - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0)) -#else - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) -#endif - -/** - * This routine minimizes RAM usage by creating a FLASH resident array to - * store the pin names, pin numbers and analog/digital flag. - * - * Creating the array in FLASH is a two pass process. The first pass puts the - * name strings into FLASH. The second pass actually creates the array. - * - * Both passes use the same pin list. The list contains two macro names. The - * actual macro definitions are changed depending on which pass is being done. - * - */ - -// first pass - put the name strings into FLASH - -#define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const char ENTRY_NAME[] PROGMEM = { PIN_NAME }; -#define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) - -#include "pinsDebug_list.h" -#line 51 - -// manually add pins that have names that are macros which don't play well with these macros -#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY) - static const char RXD_NAME[] PROGMEM = { "RXD" }; - static const char TXD_NAME[] PROGMEM = { "TXD" }; -#endif - -///////////////////////////////////////////////////////////////////////////// - -// second pass - create the array - -#undef _ADD_PIN_2 -#undef _ADD_PIN -#undef REPORT_NAME_DIGITAL -#undef REPORT_NAME_ANALOG - -#define _ADD_PIN_2(ENTRY_NAME, NAME, IS_DIGITAL) { ENTRY_NAME, NAME, IS_DIGITAL }, -#define _ADD_PIN(NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2(entry_NAME_##COUNTER, NAME, IS_DIGITAL) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) - -typedef struct { - const char * const name; - pin_t pin; - bool is_digital; -} PinInfo; - -const PinInfo pin_array[] PROGMEM = { - - /** - * [pin name] [pin number] [is digital or analog] 1 = digital, 0 = analog - * Each entry takes up 6 bytes in FLASH: - * 2 byte pointer to location of the name string - * 2 bytes containing the pin number - * analog pin numbers were convereted to digital when the array was created - * 2 bytes containing the digital/analog bool flag - */ - - // manually add pins ... - #if SERIAL_PORT == 0 - #if AVR_ATmega2560_FAMILY - { RXD_NAME, 0, true }, - { TXD_NAME, 1, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME, 8, true }, - { TXD_NAME, 9, true }, - #endif - #endif - - #include "pinsDebug_list.h" - #line 102 - -}; - -#define AVR_ATmega2560_FAMILY_PLUS_70 (MB(BQ_ZUM_MEGA_3D) || MB(MIGHTYBOARD_REVE) || MB(MINIRAMBO) || MB(SCOOVO_X9H)) - -#if AVR_AT90USB1286_FAMILY - // Working with Teensyduino extension so need to re-define some things - #include "pinsDebug_Teensyduino.h" - // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs - // portModeRegister takes a different argument - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p) - #define get_pinMode(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin)) -#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70 - #include "pinsDebug_plus_70.h" - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p) - bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } -#else - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort(p) - bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } -#endif - -#if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of - #undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it - #define NUM_DIGITAL_PINS 32 // set to digital only + digital/analog -#endif - -#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), V); SERIAL_ECHO(buffer); }while(0) -#define PWM_CASE(N,Z) \ - case TIMER##N##Z: \ - if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \ - PWM_PRINT(OCR##N##Z); \ - return true; \ - } else return false - -/** - * Print a pin's PWM status. - * Return true if it's currently a PWM pin. - */ -static bool pwm_status(uint8_t pin) { - char buffer[20]; // for the sprintf statements - - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - PWM_CASE(0, A); - #endif - #endif - PWM_CASE(0, B); - #endif - - #if defined(TCCR1A) && defined(COM1A1) - PWM_CASE(1, A); - PWM_CASE(1, B); - #if defined(COM1C1) && defined(TIMER1C) - PWM_CASE(1, C); - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - PWM_CASE(2, A); - PWM_CASE(2, B); - #endif - - #if defined(TCCR3A) && defined(COM3A1) - PWM_CASE(3, A); - PWM_CASE(3, B); - #ifdef COM3C1 - PWM_CASE(3, C); - #endif - #endif - - #ifdef TCCR4A - PWM_CASE(4, A); - PWM_CASE(4, B); - PWM_CASE(4, C); - #endif - - #if defined(TCCR5A) && defined(COM5A1) - PWM_CASE(5, A); - PWM_CASE(5, B); - PWM_CASE(5, C); - #endif - - case NOT_ON_TIMER: - default: - return false; - } - SERIAL_PROTOCOL_SP(2); -} // pwm_status - - -const volatile uint8_t* const PWM_other[][3] PROGMEM = { - { &TCCR0A, &TCCR0B, &TIMSK0 }, - { &TCCR1A, &TCCR1B, &TIMSK1 }, - #if defined(TCCR2A) && defined(COM2A1) - { &TCCR2A, &TCCR2B, &TIMSK2 }, - #endif - #if defined(TCCR3A) && defined(COM3A1) - { &TCCR3A, &TCCR3B, &TIMSK3 }, - #endif - #ifdef TCCR4A - { &TCCR4A, &TCCR4B, &TIMSK4 }, - #endif - #if defined(TCCR5A) && defined(COM5A1) - { &TCCR5A, &TCCR5B, &TIMSK5 }, - #endif -}; - - -const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { - - #ifdef TIMER0A - { &OCR0A, &OCR0B, 0 }, - #else - { 0, &OCR0B, 0 }, - #endif - - #if defined(COM1C1) && defined(TIMER1C) - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, (const uint8_t*)&OCR1C }, - #else - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, 0 }, - #endif - - #if defined(TCCR2A) && defined(COM2A1) - { &OCR2A, &OCR2B, 0 }, - #endif - - #if defined(TCCR3A) && defined(COM3A1) - #ifdef COM3C1 - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, (const uint8_t*)&OCR3C }, - #else - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, 0 }, - #endif - #endif - - #ifdef TCCR4A - { (const uint8_t*)&OCR4A, (const uint8_t*)&OCR4B, (const uint8_t*)&OCR4C }, - #endif - - #if defined(TCCR5A) && defined(COM5A1) - { (const uint8_t*)&OCR5A, (const uint8_t*)&OCR5B, (const uint8_t*)&OCR5C }, - #endif -}; - - -#define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) -#define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) -#define TIMSK(T) pgm_read_word(&PWM_other[T][2]) -#define CS_0 0 -#define CS_1 1 -#define CS_2 2 -#define WGM_0 0 -#define WGM_1 1 -#define WGM_2 3 -#define WGM_3 4 -#define TOIE 0 - -#define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L]) - -static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); } -static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); } -static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); } - -#if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY - static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); } -#endif - -void com_print(uint8_t N, uint8_t Z) { - const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); - SERIAL_PROTOCOLPGM(" COM"); - SERIAL_PROTOCOLCHAR(N + '0'); - switch (Z) { - case 'A': - SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); - break; - case 'B': - SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); - break; - case 'C': - SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); - break; - } -} - -void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout - char buffer[20]; // for the sprintf statements - const uint8_t *TCCRB = (uint8_t*)TCCR_B(T), - *TCCRA = (uint8_t*)TCCR_A(T); - uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); - if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); - - SERIAL_PROTOCOLPGM(" TIMER"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLCHAR(L); - SERIAL_PROTOCOL_SP(3); - - if (N == 3) { - const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL8); - } - else { - const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL16); - } - SERIAL_PROTOCOLPAIR(" WGM: ", WGM); - com_print(T,L); - SERIAL_PROTOCOLPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); - - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("A: ", *TCCRA); - - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("B: ", *TCCRB); - - const uint8_t *TMSK = (uint8_t*)TIMSK(T); - SERIAL_PROTOCOLPGM(" TIMSK"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR(": ", *TMSK); - - const uint8_t OCIE = L - 'A' + 1; - if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); } - else { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); } - if (TEST(*TMSK, OCIE)) err_is_interrupt(); - if (TEST(*TMSK, TOIE)) err_prob_interrupt(); -} - -static void pwm_details(uint8_t pin) { - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - case TIMER0A: timer_prefix(0, 'A', 3); break; - #endif - #endif - case TIMER0B: timer_prefix(0, 'B', 3); break; - #endif - - #if defined(TCCR1A) && defined(COM1A1) - case TIMER1A: timer_prefix(1, 'A', 4); break; - case TIMER1B: timer_prefix(1, 'B', 4); break; - #if defined(COM1C1) && defined(TIMER1C) - case TIMER1C: timer_prefix(1, 'C', 4); break; - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - case TIMER2A: timer_prefix(2, 'A', 3); break; - case TIMER2B: timer_prefix(2, 'B', 3); break; - #endif - - #if defined(TCCR3A) && defined(COM3A1) - case TIMER3A: timer_prefix(3, 'A', 4); break; - case TIMER3B: timer_prefix(3, 'B', 4); break; - #ifdef COM3C1 - case TIMER3C: timer_prefix(3, 'C', 4); break; - #endif - #endif - - #ifdef TCCR4A - case TIMER4A: timer_prefix(4, 'A', 4); break; - case TIMER4B: timer_prefix(4, 'B', 4); break; - case TIMER4C: timer_prefix(4, 'C', 4); break; - #endif - - #if defined(TCCR5A) && defined(COM5A1) - case TIMER5A: timer_prefix(5, 'A', 4); break; - case TIMER5B: timer_prefix(5, 'B', 4); break; - case TIMER5C: timer_prefix(5, 'C', 4); break; - #endif - - case NOT_ON_TIMER: break; - - } - SERIAL_PROTOCOLPGM(" "); - - // on pins that have two PWMs, print info on second PWM - #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY - // looking for port B7 - PWMs 0A and 1C - if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) { - #if !AVR_AT90USB1286_FAMILY - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER1C"); - print_is_also_tied(); - timer_prefix(1, 'C', 4); - #else - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER0A"); - print_is_also_tied(); - timer_prefix(0, 'A', 3); - #endif - } - #endif -} // pwm_details - -#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs - int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed - const uint8_t port = digitalPinToPort_DEBUG(pin); - return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask_DEBUG(pin)) ? HIGH : LOW; - } -#endif - -void print_port(int8_t pin) { // print port number - #ifdef digitalPinToPort_DEBUG - uint8_t x; - SERIAL_PROTOCOLPGM(" Port: "); - #if AVR_AT90USB1286_FAMILY - x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64; - #else - x = digitalPinToPort_DEBUG(pin) + 64; - #endif - SERIAL_CHAR(x); - - #if AVR_AT90USB1286_FAMILY - if (pin == 46) - x = '2'; - else if (pin == 47) - x = '3'; - else { - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - } - #else - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - #endif - SERIAL_CHAR(x); - #else - SERIAL_PROTOCOL_SP(10); - #endif -} - -static void print_input_or_output(const bool isout) { - serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input = ")); -} - -// pretty report with PWM info -inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = false, const char *start_string = "") { - uint8_t temp_char; - char *name_mem_pointer, buffer[30]; // for the sprintf statements - bool found = false, multi_name_pin = false; - for (uint8_t x = 0; x < COUNT(pin_array); x++) { // scan entire array and report all instances of this pin - if (pgm_read_byte(&pin_array[x].pin) == pin) { - if (found) multi_name_pin = true; - found = true; - if (!multi_name_pin) { // report digitial and analog pin number only on the first time through - sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin); // digital pin number - SERIAL_ECHO(buffer); - print_port(pin); - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number - SERIAL_ECHO(buffer); - } - else SERIAL_ECHO_SP(8); // add padding if not an analog pin - } - else { - SERIAL_CHAR('.'); - SERIAL_ECHO_SP(26 + strlen(start_string)); // add padding if not the first instance found - } - name_mem_pointer = (char*)pgm_read_word(&pin_array[x].name); - for (uint8_t y = 0; y < 28; y++) { // always print pin name - temp_char = pgm_read_byte(name_mem_pointer + y); - if (temp_char != 0) - SERIAL_CHAR(temp_char); - else { - for (uint8_t i = 0; i < 28 - y; i++) SERIAL_CHAR(' '); - break; - } - } - if (extended) { - if (pin_is_protected(pin) && !ignore) - SERIAL_ECHOPGM("protected "); - else { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - if (pin == 46) { - print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); - } - else if (pin == 47) { - print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); - } - } - else - #endif - { - if (!(pgm_read_byte(&pin_array[x].is_digital))) { - sprintf_P(buffer, PSTR("Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0))); - SERIAL_ECHO(buffer); - } - else { - - if (!get_pinMode(pin)) { - //pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this - // because this could interfere with inductive/capacitive - // sensors (high impedance voltage divider) and with PT100 amplifier - print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - else if (pwm_status(pin)) { - // do nothing - } - else { - print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - } - if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report - } - } - } - SERIAL_EOL(); - } // end of IF - } // end of for loop - - if (!found) { - sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin); - SERIAL_ECHO(buffer); - print_port(pin); - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number - SERIAL_ECHO(buffer); - } - else - SERIAL_ECHO_SP(8); // add padding if not an analog pin - SERIAL_ECHOPGM(""); - if (extended) { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - SERIAL_PROTOCOL_SP(12); - if (pin == 46) { - print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); - } - else { - print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); - } - } - else - #endif - { - if (get_pinMode(pin)) { - SERIAL_PROTOCOL_SP(12); - print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - else { - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0))); - SERIAL_ECHO(buffer); - SERIAL_ECHOPGM(" "); - } - else - SERIAL_ECHO_SP(12); // add padding if not an analog pin - - print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); - } - //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin - if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report - } - } - SERIAL_EOL(); - } -} diff --git a/Marlin_thinkerV2/Marlin/pinsDebug_Teensyduino.h b/Marlin_thinkerV2/Marlin/pinsDebug_Teensyduino.h deleted file mode 100644 index 3e08bbbc66..0000000000 --- a/Marlin_thinkerV2/Marlin/pinsDebug_Teensyduino.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -// -// some of the pin mapping functions of the Teensduino extension to the Arduino IDE -// do not function the same as the other Arduino extensions -// - -#ifndef __PINSDEBUG_TEENSYDUINO_H__ -#define __PINSDEBUG_TEENSYDUINO_H__ - -#undef NUM_DIGITAL_PINS -#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48 - -// "digitalPinToPort" function just returns the pin number so need to create our own. -// Can't use the name "digitalPinToPort" for our own because it interferes with the -// FAST_PWM_FAN function if we do - -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 - -const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = { - PD, // 0 - PD0 - INT0 - PWM - PD, // 1 - PD1 - INT1 - PWM - PD, // 2 - PD2 - INT2 - RX - PD, // 3 - PD3 - INT3 - TX - PD, // 4 - PD4 - PD, // 5 - PD5 - PD, // 6 - PD6 - PD, // 7 - PD7 - PE, // 8 - PE0 - PE, // 9 - PE1 - PC, // 10 - PC0 - PC, // 11 - PC1 - PC, // 12 - PC2 - PC, // 13 - PC3 - PC, // 14 - PC4 - PWM - PC, // 15 - PC5 - PWM - PC, // 16 - PC6 - PWM - PC, // 17 - PC7 - PE, // 18 - PE6 - INT6 - PE, // 19 - PE7 - INT7 - PB, // 20 - PB0 - PB, // 21 - PB1 - PB, // 22 - PB2 - PB, // 23 - PB3 - PB, // 24 - PB4 - PWM - PB, // 25 - PB5 - PWM - PB, // 26 - PB6 - PWM - PB, // 27 - PB7 - PWM - PA, // 28 - PA0 - PA, // 29 - PA1 - PA, // 30 - PA2 - PA, // 31 - PA3 - PA, // 32 - PA4 - PA, // 33 - PA5 - PA, // 34 - PA6 - PA, // 35 - PA7 - PE, // 36 - PE4 - INT4 - PE, // 37 - PE5 - INT5 - PF, // 38 - PF0 - A0 - PF, // 39 - PF1 - A1 - PF, // 40 - PF2 - A2 - PF, // 41 - PF3 - A3 - PF, // 42 - PF4 - A4 - PF, // 43 - PF5 - A5 - PF, // 44 - PF6 - A6 - PF, // 45 - PF7 - A7 - PE, // 46 - PE2 (not defined in teensyduino) - PE, // 47 - PE3 (not defined in teensyduino) -}; - -#define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) ) - -// digitalPinToBitMask(pin) is OK - -#define digitalRead_mod(p) digitalRead(p) // Teensyduino's version of digitalRead doesn't - // disable the PWMs so we can use it as is - -// portModeRegister(pin) is OK - -#endif // __PINSDEBUG_TEENSYDUINO_H__ diff --git a/Marlin_thinkerV2/Marlin/pinsDebug_list.h b/Marlin_thinkerV2/Marlin/pinsDebug_list.h deleted file mode 100644 index e19858d528..0000000000 --- a/Marlin_thinkerV2/Marlin/pinsDebug_list.h +++ /dev/null @@ -1,1021 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Please update this list when adding new pins to Marlin. -// The order doesn't matter. -// Following this pattern is a must. -// If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. - -// Pin lists 1.1.x and 2.0.x synchronized 2018-02-17 - -#line 31 // set __LINE__ to a known value for both passes - -// -// Analog Pin Assignments -// - -#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) -#endif -#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A1) -#endif -#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A2) -#endif -#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A3) -#endif -#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A4) -#endif -#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) -#endif -#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) -#endif -#if !defined(ARDUINO_ARCH_SAM) //TC1 & TC2 are macros in the SAM tool chain - #if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC1) - #endif - #if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC2) - #endif -#endif -#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) -#endif -#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) -#endif -#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) -#endif -#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) -#endif -#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) -#endif -#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) -#endif -#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) -#endif -#if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) -#endif - -// -// Digital Pin Assignments -// - -#if defined(__FD) && __FD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FD) -#endif -#if defined(__FS) && __FS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FS) -#endif -#if defined(__GD) && __GD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GD) -#endif -#if defined(__GS) && __GS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GS) -#endif -#if PIN_EXISTS(AVR_MISO) - REPORT_NAME_DIGITAL(__LINE__, AVR_MISO_PIN) -#endif -#if PIN_EXISTS(AVR_MOSI) - REPORT_NAME_DIGITAL(__LINE__, AVR_MOSI_PIN) -#endif -#if PIN_EXISTS(AVR_SCK) - REPORT_NAME_DIGITAL(__LINE__, AVR_SCK_PIN) -#endif -#if PIN_EXISTS(ALARM) - REPORT_NAME_DIGITAL(__LINE__, ALARM_PIN) -#endif -#if PIN_EXISTS(AVR_SS) - REPORT_NAME_DIGITAL(__LINE__, AVR_SS_PIN) -#endif -#if PIN_EXISTS(BEEPER) - REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN) -#endif -#if defined(BTN_BACK) && BTN_BACK >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_BACK) -#endif -#if defined(BTN_CENTER) && BTN_CENTER >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER) -#endif -#if defined(BTN_DOWN) && BTN_DOWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN) -#endif -#if defined(BTN_DWN) && BTN_DWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DWN) -#endif -#if defined(BTN_EN1) && BTN_EN1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN1) -#endif -#if defined(BTN_EN2) && BTN_EN2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) -#endif -#if defined(BTN_ENC) && BTN_ENC >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) -#endif -#if defined(BTN_HOME) && BTN_HOME >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_HOME) -#endif -#if defined(BTN_LEFT) && BTN_LEFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT) -#endif -#if defined(BTN_LFT) && BTN_LFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LFT) -#endif -#if defined(BTN_RIGHT) && BTN_RIGHT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT) -#endif -#if defined(BTN_RT) && BTN_RT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RT) -#endif -#if defined(BTN_UP) && BTN_UP >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_UP) -#endif -#if PIN_EXISTS(CASE_LIGHT) - REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN) -#endif -#if PIN_EXISTS(CHAMBER_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, CHAMBER_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(CONTROLLER_FAN) - REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN) -#endif -#if PIN_EXISTS(CUTOFF_RESET) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_RESET_PIN) -#endif -#if PIN_EXISTS(CUTOFF_TEST) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN) -#endif -#if defined(D57) && D57 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D57) -#endif -#if defined(D58) && D58 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D58) -#endif -#if PIN_EXISTS(DAC_DISABLE) - REPORT_NAME_DIGITAL(__LINE__, DAC_DISABLE_PIN) -#endif -#if defined(DAC0_SYNC) && DAC0_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC0_SYNC) -#endif -#if defined(DAC1_SYNC) && DAC1_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC1_SYNC) -#endif -#if PIN_EXISTS(DEBUG) - REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN) -#endif -#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL) -#endif -#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0) -#endif -#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1) -#endif -#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X) -#endif -#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y) -#endif -#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z) -#endif -#if PIN_EXISTS(DIGIPOTSS) - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN) -#endif -#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0) -#endif -#if defined(DOGLCD_CS) && DOGLCD_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS) -#endif -#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI) -#endif -#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK) -#endif -#if defined(TMC_SW_MISO) && TMC_SW_MISO >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO) -#endif -#if defined(TMC_SW_MOSI) && TMC_SW_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI) -#endif -#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) -#endif -#if PIN_EXISTS(E_MUX0) - REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN) -#endif -#if PIN_EXISTS(E_MUX1) - REPORT_NAME_DIGITAL(__LINE__, E_MUX1_PIN) -#endif -#if PIN_EXISTS(E_MUX2) - REPORT_NAME_DIGITAL(__LINE__, E_MUX2_PIN) -#endif -#if PIN_EXISTS(E_STOP) - REPORT_NAME_DIGITAL(__LINE__, E_STOP_PIN) -#endif -#if PIN_EXISTS(E0_ATT) - REPORT_NAME_DIGITAL(__LINE__, E0_ATT_PIN) -#endif -#if PIN_EXISTS(E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E0_CS) - REPORT_NAME_DIGITAL(__LINE__, E0_CS_PIN) -#endif -#if PIN_EXISTS(E0_DIR) - REPORT_NAME_DIGITAL(__LINE__, E0_DIR_PIN) -#endif -#if PIN_EXISTS(E0_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E0_ENABLE_PIN) -#endif -#if PIN_EXISTS(E0_MS1) - REPORT_NAME_DIGITAL(__LINE__, E0_MS1_PIN) -#endif -#if PIN_EXISTS(E0_MS2) - REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN) -#endif -#if PIN_EXISTS(E0_STEP) - REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN) -#endif -#if PIN_EXISTS(E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E1_CS) - REPORT_NAME_DIGITAL(__LINE__, E1_CS_PIN) -#endif -#if PIN_EXISTS(E1_DIR) - REPORT_NAME_DIGITAL(__LINE__, E1_DIR_PIN) -#endif -#if PIN_EXISTS(E1_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E1_ENABLE_PIN) -#endif -#if PIN_EXISTS(E1_MS1) - REPORT_NAME_DIGITAL(__LINE__, E1_MS1_PIN) -#endif -#if PIN_EXISTS(E1_MS2) - REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN) -#endif -#if PIN_EXISTS(E1_STEP) - REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN) -#endif -#if PIN_EXISTS(E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E2_CS) - REPORT_NAME_DIGITAL(__LINE__, E2_CS_PIN) -#endif -#if PIN_EXISTS(E2_DIR) - REPORT_NAME_DIGITAL(__LINE__, E2_DIR_PIN) -#endif -#if PIN_EXISTS(E2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E2_ENABLE_PIN) -#endif -#if PIN_EXISTS(E2_MS1) - REPORT_NAME_DIGITAL(__LINE__, E2_MS1_PIN) -#endif -#if PIN_EXISTS(E2_MS2) - REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN) -#endif -#if PIN_EXISTS(E2_STEP) - REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN) -#endif -#if PIN_EXISTS(E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E3_CS) - REPORT_NAME_DIGITAL(__LINE__, E3_CS_PIN) -#endif -#if PIN_EXISTS(E3_DIR) - REPORT_NAME_DIGITAL(__LINE__, E3_DIR_PIN) -#endif -#if PIN_EXISTS(E3_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E3_ENABLE_PIN) -#endif -#if PIN_EXISTS(E3_MS1) - REPORT_NAME_DIGITAL(__LINE__, E3_MS1_PIN) -#endif -#if PIN_EXISTS(E3_MS2) - REPORT_NAME_DIGITAL(__LINE__, E3_MS2_PIN) -#endif -#if PIN_EXISTS(E3_MS3) - REPORT_NAME_DIGITAL(__LINE__, E3_MS3_PIN) -#endif -#if PIN_EXISTS(E3_STEP) - REPORT_NAME_DIGITAL(__LINE__, E3_STEP_PIN) -#endif -#if PIN_EXISTS(E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E4_CS) - REPORT_NAME_DIGITAL(__LINE__, E4_CS_PIN) -#endif -#if PIN_EXISTS(E4_DIR) - REPORT_NAME_DIGITAL(__LINE__, E4_DIR_PIN) -#endif -#if PIN_EXISTS(E4_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E4_ENABLE_PIN) -#endif -#if PIN_EXISTS(E4_MS1) - REPORT_NAME_DIGITAL(__LINE__, E4_MS1_PIN) -#endif -#if PIN_EXISTS(E4_MS2) - REPORT_NAME_DIGITAL(__LINE__, E4_MS2_PIN) -#endif -#if PIN_EXISTS(E4_MS3) - REPORT_NAME_DIGITAL(__LINE__, E4_MS3_PIN) -#endif -#if PIN_EXISTS(E4_STEP) - REPORT_NAME_DIGITAL(__LINE__, E4_STEP_PIN) -#endif -#if defined(ENET_CRS) && ENET_CRS >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) -#endif -#if defined(ENET_MDIO) && ENET_MDIO >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO) -#endif -#if defined(ENET_MOC) && ENET_MOC >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MOC) -#endif -#if defined(ENET_RX_ER) && ENET_RX_ER >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER) -#endif -#if defined(ENET_RXD0) && ENET_RXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0) -#endif -#if defined(ENET_RXD1) && ENET_RXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1) -#endif -#if defined(ENET_TX_EN) && ENET_TX_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN) -#endif -#if defined(ENET_TXD0) && ENET_TXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0) -#endif -#if defined(ENET_TXD1) && ENET_TXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1) -#endif -#if PIN_EXISTS(EXP_VOLTAGE_LEVEL) - REPORT_NAME_DIGITAL(__LINE__, EXP_VOLTAGE_LEVEL_PIN) -#endif - -#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO) -#endif -#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO) -#endif -#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO) -#endif -#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO) -#endif -#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO) -#endif -#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24) -#endif -#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2) -#endif -#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0) -#endif -#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1) -#endif -#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3) -#endif -#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN) -#endif -#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN) -#endif -#if PIN_EXISTS(FAN) - REPORT_NAME_DIGITAL(__LINE__, FAN_PIN) -#endif -#if PIN_EXISTS(FAN1) - REPORT_NAME_DIGITAL(__LINE__, FAN1_PIN) -#endif -#if PIN_EXISTS(FAN2) - REPORT_NAME_DIGITAL(__LINE__, FAN2_PIN) -#endif -#if PIN_EXISTS(FAN3) - REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN) -#endif -#if PIN_EXISTS(HEATER_0) - REPORT_NAME_DIGITAL(__LINE__, HEATER_0_PIN) -#endif -#if PIN_EXISTS(HEATER_1) - REPORT_NAME_DIGITAL(__LINE__, HEATER_1_PIN) -#endif -#if PIN_EXISTS(HEATER_2) - REPORT_NAME_DIGITAL(__LINE__, HEATER_2_PIN) -#endif -#if PIN_EXISTS(HEATER_3) - REPORT_NAME_DIGITAL(__LINE__, HEATER_3_PIN) -#endif -#if PIN_EXISTS(HEATER_4) - REPORT_NAME_DIGITAL(__LINE__, HEATER_4_PIN) -#endif -#if PIN_EXISTS(HEATER_5) - REPORT_NAME_DIGITAL(__LINE__, HEATER_5_PIN) -#endif -#if PIN_EXISTS(HEATER_6) - REPORT_NAME_DIGITAL(__LINE__, HEATER_6_PIN) -#endif -#if PIN_EXISTS(HEATER_7) - REPORT_NAME_DIGITAL(__LINE__, HEATER_7_PIN) -#endif -#if PIN_EXISTS(HEATER_BED) - REPORT_NAME_DIGITAL(__LINE__, HEATER_BED_PIN) -#endif -#if PIN_EXISTS(HOME) - REPORT_NAME_DIGITAL(__LINE__, HOME_PIN) -#endif -#if PIN_EXISTS(I2C_SCL) - REPORT_NAME_DIGITAL(__LINE__, I2C_SCL_PIN) -#endif -#if PIN_EXISTS(I2C_SDA) - REPORT_NAME_DIGITAL(__LINE__, I2C_SDA_PIN) -#endif -#if PIN_EXISTS(KILL) - REPORT_NAME_DIGITAL(__LINE__, KILL_PIN) -#endif -#if PIN_EXISTS(LCD_BACKLIGHT) - REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN) -#endif -#if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4) -#endif -#if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5) -#endif -#if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6) -#endif -#if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7) -#endif -#if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE) -#endif -#if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS) -#endif -#if defined(LCD_SDSS) && LCD_SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS) -#endif -#if PIN_EXISTS(LED_GREEN) - REPORT_NAME_DIGITAL(__LINE__, LED_GREEN_PIN) -#endif -#if PIN_EXISTS(LED) - REPORT_NAME_DIGITAL(__LINE__, LED_PIN) -#endif -#if PIN_EXISTS(LED_RED) - REPORT_NAME_DIGITAL(__LINE__, LED_RED_PIN) -#endif -#if PIN_EXISTS(MAX) - REPORT_NAME_DIGITAL(__LINE__, MAX_PIN) -#endif -#if PIN_EXISTS(MAX6675_DO) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_DO_PIN) -#endif -#if PIN_EXISTS(MAX6675_SCK) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN) -#endif -#if defined(MAX6675_SS) && MAX6675_SS >= 0 - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS) -#endif -// #if defined(MISO) && MISO >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MISO) -// #endif -#if PIN_EXISTS(MISO) - REPORT_NAME_DIGITAL(__LINE__, MISO_PIN) -#endif -#if PIN_EXISTS(MOSFET_A) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN) -#endif -#if PIN_EXISTS(MOSFET_B) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_B_PIN) -#endif -#if PIN_EXISTS(MOSFET_C) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_C_PIN) -#endif -#if PIN_EXISTS(MOSFET_D) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN) -#endif -// #if defined(MOSI) && MOSI >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MOSI) -// #endif -#if PIN_EXISTS(MOSI) - REPORT_NAME_DIGITAL(__LINE__, MOSI_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_E_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_XY_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Z_PIN) -#endif -#if PIN_EXISTS(MOTOR_FAULT) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_FAULT_PIN) -#endif -#if PIN_EXISTS(ORIG_E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(PHOTOGRAPH) - REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN) -#endif -#if PIN_EXISTS(PS_ON) - REPORT_NAME_DIGITAL(__LINE__, PS_ON_PIN) -#endif -#if PIN_EXISTS(PWM_1) - REPORT_NAME_DIGITAL(__LINE__, PWM_1_PIN) -#endif -#if PIN_EXISTS(PWM_2) - REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN) -#endif -#if defined(REF_CLK) && REF_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, REF_CLK) -#endif -#if PIN_EXISTS(RAMPS_D10) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D10_PIN) -#endif -#if PIN_EXISTS(RAMPS_D8) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D8_PIN) -#endif -#if PIN_EXISTS(RAMPS_D9) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D9_PIN) -#endif -#if PIN_EXISTS(RGB_LED_R) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_R_PIN) -#endif -#if PIN_EXISTS(RGB_LED_G) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_G_PIN) -#endif -#if PIN_EXISTS(RGB_LED_B) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_B_PIN) -#endif -#if PIN_EXISTS(RGB_LED_W) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_W_PIN) -#endif -#if PIN_EXISTS(RX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, RX_ENABLE_PIN) -#endif -#if PIN_EXISTS(SAFETY_TRIGGERED) - REPORT_NAME_DIGITAL(__LINE__, SAFETY_TRIGGERED_PIN) -#endif -// #if defined(SCK) && SCK >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCK) -// #endif -#if PIN_EXISTS(SCK) - REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) -#endif -// #if defined(SCL) && SCL >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCL) -// #endif -#if PIN_EXISTS(SD_DETECT) - REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) -#endif -// #if defined(SDA) && SDA >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SDA) -// #endif -#if defined(SDPOWER) && SDPOWER >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDPOWER) -#endif -#if defined(SDSS) && SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDSS) -#endif -#if defined(SERVO0) && SERVO0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SERVO0) -#endif -#if PIN_EXISTS(SERVO0) - REPORT_NAME_DIGITAL(__LINE__, SERVO0_PIN) -#endif -#if PIN_EXISTS(SERVO1) - REPORT_NAME_DIGITAL(__LINE__, SERVO1_PIN) -#endif -#if PIN_EXISTS(SERVO2) - REPORT_NAME_DIGITAL(__LINE__, SERVO2_PIN) -#endif -#if PIN_EXISTS(SERVO3) - REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN) -#endif -#if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK) -#endif -#if defined(SHIFT_EN) && SHIFT_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN) -#endif -#if defined(SHIFT_LD) && SHIFT_LD >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD) -#endif -#if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT) -#endif -#if PIN_EXISTS(SLED) - REPORT_NAME_DIGITAL(__LINE__, SLED_PIN) -#endif -#if PIN_EXISTS(SLEEP_WAKE) - REPORT_NAME_DIGITAL(__LINE__, SLEEP_WAKE_PIN) -#endif -#if PIN_EXISTS(SOL0) - REPORT_NAME_DIGITAL(__LINE__, SOL0_PIN) -#endif -#if PIN_EXISTS(SOL1) - REPORT_NAME_DIGITAL(__LINE__, SOL1_PIN) -#endif -#if PIN_EXISTS(SOL2) - REPORT_NAME_DIGITAL(__LINE__, SOL2_PIN) -#endif -#if PIN_EXISTS(SOL3) - REPORT_NAME_DIGITAL(__LINE__, SOL3_PIN) -#endif -#if PIN_EXISTS(SOL4) - REPORT_NAME_DIGITAL(__LINE__, SOL4_PIN) -#endif -#if defined(SPARE_IO) && SPARE_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPARE_IO) -#endif -#if defined(SPI_CHAN_DAC) && SPI_CHAN_DAC >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_DAC) -#endif -#if defined(SPI_CHAN_EEPROM1) && SPI_CHAN_EEPROM1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_CHAN_EEPROM1) -#endif -#if defined(SPI_EEPROM) && SPI_EEPROM >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM) -#endif -#if defined(SPI_EEPROM1_CS) && SPI_EEPROM1_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM1_CS) -#endif -#if defined(SPI_EEPROM2_CS) && SPI_EEPROM2_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM2_CS) -#endif -#if defined(SPI_FLASH_CS) && SPI_FLASH_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_FLASH_CS) -#endif -#if PIN_EXISTS(SPINDLE_DIR) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_DIR_PIN) -#endif -#if PIN_EXISTS(SPINDLE_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_ENABLE_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_ENABLE_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_PWM) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_PWM_PIN) -#endif -#if PIN_EXISTS(SR_CLK) - REPORT_NAME_DIGITAL(__LINE__, SR_CLK_PIN) -#endif -#if PIN_EXISTS(SR_DATA) - REPORT_NAME_DIGITAL(__LINE__, SR_DATA_PIN) -#endif -#if PIN_EXISTS(SR_STROBE) - REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN) -#endif -#if PIN_EXISTS(SS) - REPORT_NAME_DIGITAL(__LINE__, SS_PIN) -#endif -#if PIN_EXISTS(STAT_LED_BLUE) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) -#endif -#if defined(STAT_LED_RED_LED) && STAT_LED_RED_LED >= 0 - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED) -#endif -#if PIN_EXISTS(STAT_LED_RED) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_PIN) -#endif -#if PIN_EXISTS(STEPPER_RESET) - REPORT_NAME_DIGITAL(__LINE__, STEPPER_RESET_PIN) -#endif -#if PIN_EXISTS(SUICIDE) - REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN) -#endif -#if defined(THERMO_CS1) && THERMO_CS1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1) -#endif -#if defined(THERMO_CS2) && THERMO_CS2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2) -#endif -#if PIN_EXISTS(THERMO_DO) - REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN) -#endif -#if PIN_EXISTS(THERMO_SCK) - REPORT_NAME_DIGITAL(__LINE__, THERMO_SCK_PIN) -#endif -#if PIN_EXISTS(TLC_BLANK) - REPORT_NAME_DIGITAL(__LINE__, TLC_BLANK_PIN) -#endif -#if PIN_EXISTS(TLC_CLOCK) - REPORT_NAME_DIGITAL(__LINE__, TLC_CLOCK_PIN) -#endif -#if PIN_EXISTS(TLC_DATA) - REPORT_NAME_DIGITAL(__LINE__, TLC_DATA_PIN) -#endif -#if PIN_EXISTS(TLC_XLAT) - REPORT_NAME_DIGITAL(__LINE__, TLC_XLAT_PIN) -#endif -#if PIN_EXISTS(TOOL_0) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PIN) -#endif -#if PIN_EXISTS(TOOL_0_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_1) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PIN) -#endif -#if PIN_EXISTS(TOOL_1_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_2) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PIN) -#endif -#if PIN_EXISTS(TOOL_2_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_3) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PIN) -#endif -#if PIN_EXISTS(TOOL_3_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_PWM_PIN) -#endif -#if PIN_EXISTS(TX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN) -#endif -#if defined(UI1) && UI1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI1) -#endif -#if defined(UI2) && UI2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI2) -#endif -#if defined(UNUSED_PWM) && UNUSED_PWM >= 0 - REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM) -#endif -#if PIN_EXISTS(X_ATT) - REPORT_NAME_DIGITAL(__LINE__, X_ATT_PIN) -#endif -#if PIN_EXISTS(X_CS) - REPORT_NAME_DIGITAL(__LINE__, X_CS_PIN) -#endif -#if PIN_EXISTS(X_DIR) - REPORT_NAME_DIGITAL(__LINE__, X_DIR_PIN) -#endif -#if PIN_EXISTS(X_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X_ENABLE_PIN) -#endif -#if PIN_EXISTS(X_MAX) - REPORT_NAME_DIGITAL(__LINE__, X_MAX_PIN) -#endif -#if PIN_EXISTS(X_MIN) - REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN) -#endif -#if PIN_EXISTS(X_MS1) - REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN) -#endif -#if PIN_EXISTS(X_MS2) - REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN) -#endif -#if PIN_EXISTS(X_STEP) - REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN) -#endif -#if PIN_EXISTS(X_STOP) - REPORT_NAME_DIGITAL(__LINE__, X_STOP_PIN) -#endif -#if PIN_EXISTS(X2_DIR) - REPORT_NAME_DIGITAL(__LINE__, X2_DIR_PIN) -#endif -#if PIN_EXISTS(X2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) -#endif -#if PIN_EXISTS(X2_STEP) - REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN) -#endif -#if PIN_EXISTS(Y_ATT) - REPORT_NAME_DIGITAL(__LINE__, Y_ATT_PIN) -#endif -#if PIN_EXISTS(Y_CS) - REPORT_NAME_DIGITAL(__LINE__, Y_CS_PIN) -#endif -#if PIN_EXISTS(Y_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y_DIR_PIN) -#endif -#if PIN_EXISTS(Y_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y_MAX) - REPORT_NAME_DIGITAL(__LINE__, Y_MAX_PIN) -#endif -#if PIN_EXISTS(Y_MIN) - REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN) -#endif -#if PIN_EXISTS(Y_MS1) - REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN) -#endif -#if PIN_EXISTS(Y_MS2) - REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN) -#endif -#if PIN_EXISTS(Y_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN) -#endif -#if PIN_EXISTS(Y_STOP) - REPORT_NAME_DIGITAL(__LINE__, Y_STOP_PIN) -#endif -#if PIN_EXISTS(Y2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y2_DIR_PIN) -#endif -#if PIN_EXISTS(Y2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN) -#endif -#if PIN_EXISTS(Z_ATT) - REPORT_NAME_DIGITAL(__LINE__, Z_ATT_PIN) -#endif -#if PIN_EXISTS(Z_CS) - REPORT_NAME_DIGITAL(__LINE__, Z_CS_PIN) -#endif -#if PIN_EXISTS(Z_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z_DIR_PIN) -#endif -#if PIN_EXISTS(Z_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z_MAX) - REPORT_NAME_DIGITAL(__LINE__, Z_MAX_PIN) -#endif -#if PIN_EXISTS(Z_MIN) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN) -#endif -#if PIN_EXISTS(Z_MIN_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) -#endif -#if PIN_EXISTS(Z_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN) -#endif -#if PIN_EXISTS(Z_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) -#endif -#if PIN_EXISTS(Z_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_PROBE_PIN) -#endif -#if PIN_EXISTS(Z_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) -#endif -#if PIN_EXISTS(Z_STOP) - REPORT_NAME_DIGITAL(__LINE__, Z_STOP_PIN) -#endif -#if PIN_EXISTS(Z2_CS) - REPORT_NAME_DIGITAL(__LINE__, Z2_CS_PIN) -#endif -#if PIN_EXISTS(Z2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z2_DIR_PIN) -#endif -#if PIN_EXISTS(Z2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z2_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN) -#endif -#if PIN_EXISTS(Z2_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS2_PIN) -#endif -#if PIN_EXISTS(Z2_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS3_PIN) -#endif -#if PIN_EXISTS(Z2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z2_STEP_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D6) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D9) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D9_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN) -#endif diff --git a/Marlin_thinkerV2/Marlin/pinsDebug_plus_70.h b/Marlin_thinkerV2/Marlin/pinsDebug_plus_70.h deleted file mode 100644 index c18c595ec9..0000000000 --- a/Marlin_thinkerV2/Marlin/pinsDebug_plus_70.h +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * structurs for 2560 family boards that use morre than 70 pins - */ - -#ifndef __PINSDEBUG_PLUS_70_H__ -#define __PINSDEBUG_PLUS_70_H__ - -#undef NUM_DIGITAL_PINS -#if MB(BQ_ZUM_MEGA_3D) - #define NUM_DIGITAL_PINS 85 -#elif MB(MIGHTYBOARD_REVE) - #define NUM_DIGITAL_PINS 80 -#elif MB(MINIRAMBO) - #define NUM_DIGITAL_PINS 85 -#elif MB(SCOOVO_X9H) - #define NUM_DIGITAL_PINS 85 -#endif - -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 -#define PG 7 -#define PH 8 -#define PJ 10 -#define PK 11 -#define PL 12 - -const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { - // PORTLIST - // ------------------------------------------- - PE , // PE 0 ** 0 ** USART0_RX - PE , // PE 1 ** 1 ** USART0_TX - PE , // PE 4 ** 2 ** PWM2 - PE , // PE 5 ** 3 ** PWM3 - PG , // PG 5 ** 4 ** PWM4 - PE , // PE 3 ** 5 ** PWM5 - PH , // PH 3 ** 6 ** PWM6 - PH , // PH 4 ** 7 ** PWM7 - PH , // PH 5 ** 8 ** PWM8 - PH , // PH 6 ** 9 ** PWM9 - PB , // PB 4 ** 10 ** PWM10 - PB , // PB 5 ** 11 ** PWM11 - PB , // PB 6 ** 12 ** PWM12 - PB , // PB 7 ** 13 ** PWM13 - PJ , // PJ 1 ** 14 ** USART3_TX - PJ , // PJ 0 ** 15 ** USART3_RX - PH , // PH 1 ** 16 ** USART2_TX - PH , // PH 0 ** 17 ** USART2_RX - PD , // PD 3 ** 18 ** USART1_TX - PD , // PD 2 ** 19 ** USART1_RX - PD , // PD 1 ** 20 ** I2C_SDA - PD , // PD 0 ** 21 ** I2C_SCL - PA , // PA 0 ** 22 ** D22 - PA , // PA 1 ** 23 ** D23 - PA , // PA 2 ** 24 ** D24 - PA , // PA 3 ** 25 ** D25 - PA , // PA 4 ** 26 ** D26 - PA , // PA 5 ** 27 ** D27 - PA , // PA 6 ** 28 ** D28 - PA , // PA 7 ** 29 ** D29 - PC , // PC 7 ** 30 ** D30 - PC , // PC 6 ** 31 ** D31 - PC , // PC 5 ** 32 ** D32 - PC , // PC 4 ** 33 ** D33 - PC , // PC 3 ** 34 ** D34 - PC , // PC 2 ** 35 ** D35 - PC , // PC 1 ** 36 ** D36 - PC , // PC 0 ** 37 ** D37 - PD , // PD 7 ** 38 ** D38 - PG , // PG 2 ** 39 ** D39 - PG , // PG 1 ** 40 ** D40 - PG , // PG 0 ** 41 ** D41 - PL , // PL 7 ** 42 ** D42 - PL , // PL 6 ** 43 ** D43 - PL , // PL 5 ** 44 ** D44 - PL , // PL 4 ** 45 ** D45 - PL , // PL 3 ** 46 ** D46 - PL , // PL 2 ** 47 ** D47 - PL , // PL 1 ** 48 ** D48 - PL , // PL 0 ** 49 ** D49 - PB , // PB 3 ** 50 ** SPI_MISO - PB , // PB 2 ** 51 ** SPI_MOSI - PB , // PB 1 ** 52 ** SPI_SCK - PB , // PB 0 ** 53 ** SPI_SS - PF , // PF 0 ** 54 ** A0 - PF , // PF 1 ** 55 ** A1 - PF , // PF 2 ** 56 ** A2 - PF , // PF 3 ** 57 ** A3 - PF , // PF 4 ** 58 ** A4 - PF , // PF 5 ** 59 ** A5 - PF , // PF 6 ** 60 ** A6 - PF , // PF 7 ** 61 ** A7 - PK , // PK 0 ** 62 ** A8 - PK , // PK 1 ** 63 ** A9 - PK , // PK 2 ** 64 ** A10 - PK , // PK 3 ** 65 ** A11 - PK , // PK 4 ** 66 ** A12 - PK , // PK 5 ** 67 ** A13 - PK , // PK 6 ** 68 ** A14 - PK , // PK 7 ** 69 ** A15 - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** - PE , // PE 7 ** 80 ** - PD , // PD 4 ** 81 ** - PD , // PD 5 ** 82 ** - PD , // PD 6 ** 83 ** - PH , // PH 2 ** 84 ** - PH , // PH 7 ** 85 ** -}; - -#define digitalPinToPort_plus_70(P) ( pgm_read_byte( digital_pin_to_port_PGM_plus_70 + (P) ) ) - -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { - // PIN IN PORT - // ------------------------------------------- - _BV( 0 ) , // PE 0 ** 0 ** USART0_RX - _BV( 1 ) , // PE 1 ** 1 ** USART0_TX - _BV( 4 ) , // PE 4 ** 2 ** PWM2 - _BV( 5 ) , // PE 5 ** 3 ** PWM3 - _BV( 5 ) , // PG 5 ** 4 ** PWM4 - _BV( 3 ) , // PE 3 ** 5 ** PWM5 - _BV( 3 ) , // PH 3 ** 6 ** PWM6 - _BV( 4 ) , // PH 4 ** 7 ** PWM7 - _BV( 5 ) , // PH 5 ** 8 ** PWM8 - _BV( 6 ) , // PH 6 ** 9 ** PWM9 - _BV( 4 ) , // PB 4 ** 10 ** PWM10 - _BV( 5 ) , // PB 5 ** 11 ** PWM11 - _BV( 6 ) , // PB 6 ** 12 ** PWM12 - _BV( 7 ) , // PB 7 ** 13 ** PWM13 - _BV( 1 ) , // PJ 1 ** 14 ** USART3_TX - _BV( 0 ) , // PJ 0 ** 15 ** USART3_RX - _BV( 1 ) , // PH 1 ** 16 ** USART2_TX - _BV( 0 ) , // PH 0 ** 17 ** USART2_RX - _BV( 3 ) , // PD 3 ** 18 ** USART1_TX - _BV( 2 ) , // PD 2 ** 19 ** USART1_RX - _BV( 1 ) , // PD 1 ** 20 ** I2C_SDA - _BV( 0 ) , // PD 0 ** 21 ** I2C_SCL - _BV( 0 ) , // PA 0 ** 22 ** D22 - _BV( 1 ) , // PA 1 ** 23 ** D23 - _BV( 2 ) , // PA 2 ** 24 ** D24 - _BV( 3 ) , // PA 3 ** 25 ** D25 - _BV( 4 ) , // PA 4 ** 26 ** D26 - _BV( 5 ) , // PA 5 ** 27 ** D27 - _BV( 6 ) , // PA 6 ** 28 ** D28 - _BV( 7 ) , // PA 7 ** 29 ** D29 - _BV( 7 ) , // PC 7 ** 30 ** D30 - _BV( 6 ) , // PC 6 ** 31 ** D31 - _BV( 5 ) , // PC 5 ** 32 ** D32 - _BV( 4 ) , // PC 4 ** 33 ** D33 - _BV( 3 ) , // PC 3 ** 34 ** D34 - _BV( 2 ) , // PC 2 ** 35 ** D35 - _BV( 1 ) , // PC 1 ** 36 ** D36 - _BV( 0 ) , // PC 0 ** 37 ** D37 - _BV( 7 ) , // PD 7 ** 38 ** D38 - _BV( 2 ) , // PG 2 ** 39 ** D39 - _BV( 1 ) , // PG 1 ** 40 ** D40 - _BV( 0 ) , // PG 0 ** 41 ** D41 - _BV( 7 ) , // PL 7 ** 42 ** D42 - _BV( 6 ) , // PL 6 ** 43 ** D43 - _BV( 5 ) , // PL 5 ** 44 ** D44 - _BV( 4 ) , // PL 4 ** 45 ** D45 - _BV( 3 ) , // PL 3 ** 46 ** D46 - _BV( 2 ) , // PL 2 ** 47 ** D47 - _BV( 1 ) , // PL 1 ** 48 ** D48 - _BV( 0 ) , // PL 0 ** 49 ** D49 - _BV( 3 ) , // PB 3 ** 50 ** SPI_MISO - _BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI - _BV( 1 ) , // PB 1 ** 52 ** SPI_SCK - _BV( 0 ) , // PB 0 ** 53 ** SPI_SS - _BV( 0 ) , // PF 0 ** 54 ** A0 - _BV( 1 ) , // PF 1 ** 55 ** A1 - _BV( 2 ) , // PF 2 ** 56 ** A2 - _BV( 3 ) , // PF 3 ** 57 ** A3 - _BV( 4 ) , // PF 4 ** 58 ** A4 - _BV( 5 ) , // PF 5 ** 59 ** A5 - _BV( 6 ) , // PF 6 ** 60 ** A6 - _BV( 7 ) , // PF 7 ** 61 ** A7 - _BV( 0 ) , // PK 0 ** 62 ** A8 - _BV( 1 ) , // PK 1 ** 63 ** A9 - _BV( 2 ) , // PK 2 ** 64 ** A10 - _BV( 3 ) , // PK 3 ** 65 ** A11 - _BV( 4 ) , // PK 4 ** 66 ** A12 - _BV( 5 ) , // PK 5 ** 67 ** A13 - _BV( 6 ) , // PK 6 ** 68 ** A14 - _BV( 7 ) , // PK 7 ** 69 ** A15 - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** - _BV( 7 ) , // PE 7 ** 80 ** - _BV( 4 ) , // PD 4 ** 81 ** - _BV( 5 ) , // PD 5 ** 82 ** - _BV( 6 ) , // PD 6 ** 83 ** - _BV( 2 ) , // PH 2 ** 84 ** - _BV( 7 ) , // PH 7 ** 85 ** -}; - -#define digitalPinToBitMask_plus_70(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM_plus_70 + (P) ) ) - - -const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { - // TIMERS - // ------------------------------------------- - NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX - NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX - TIMER3B , // PE 4 ** 2 ** PWM2 - TIMER3C , // PE 5 ** 3 ** PWM3 - TIMER0B , // PG 5 ** 4 ** PWM4 - TIMER3A , // PE 3 ** 5 ** PWM5 - TIMER4A , // PH 3 ** 6 ** PWM6 - TIMER4B , // PH 4 ** 7 ** PWM7 - TIMER4C , // PH 5 ** 8 ** PWM8 - TIMER2B , // PH 6 ** 9 ** PWM9 - TIMER2A , // PB 4 ** 10 ** PWM10 - TIMER1A , // PB 5 ** 11 ** PWM11 - TIMER1B , // PB 6 ** 12 ** PWM12 - TIMER0A , // PB 7 ** 13 ** PWM13 - NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX - NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX - NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX - NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX - NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX - NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX - NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA - NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL - NOT_ON_TIMER , // PA 0 ** 22 ** D22 - NOT_ON_TIMER , // PA 1 ** 23 ** D23 - NOT_ON_TIMER , // PA 2 ** 24 ** D24 - NOT_ON_TIMER , // PA 3 ** 25 ** D25 - NOT_ON_TIMER , // PA 4 ** 26 ** D26 - NOT_ON_TIMER , // PA 5 ** 27 ** D27 - NOT_ON_TIMER , // PA 6 ** 28 ** D28 - NOT_ON_TIMER , // PA 7 ** 29 ** D29 - NOT_ON_TIMER , // PC 7 ** 30 ** D30 - NOT_ON_TIMER , // PC 6 ** 31 ** D31 - NOT_ON_TIMER , // PC 5 ** 32 ** D32 - NOT_ON_TIMER , // PC 4 ** 33 ** D33 - NOT_ON_TIMER , // PC 3 ** 34 ** D34 - NOT_ON_TIMER , // PC 2 ** 35 ** D35 - NOT_ON_TIMER , // PC 1 ** 36 ** D36 - NOT_ON_TIMER , // PC 0 ** 37 ** D37 - NOT_ON_TIMER , // PD 7 ** 38 ** D38 - NOT_ON_TIMER , // PG 2 ** 39 ** D39 - NOT_ON_TIMER , // PG 1 ** 40 ** D40 - NOT_ON_TIMER , // PG 0 ** 41 ** D41 - NOT_ON_TIMER , // PL 7 ** 42 ** D42 - NOT_ON_TIMER , // PL 6 ** 43 ** D43 - TIMER5C , // PL 5 ** 44 ** D44 - TIMER5B , // PL 4 ** 45 ** D45 - TIMER5A , // PL 3 ** 46 ** D46 - NOT_ON_TIMER , // PL 2 ** 47 ** D47 - NOT_ON_TIMER , // PL 1 ** 48 ** D48 - NOT_ON_TIMER , // PL 0 ** 49 ** D49 - NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO - NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI - NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK - NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS - NOT_ON_TIMER , // PF 0 ** 54 ** A0 - NOT_ON_TIMER , // PF 1 ** 55 ** A1 - NOT_ON_TIMER , // PF 2 ** 56 ** A2 - NOT_ON_TIMER , // PF 3 ** 57 ** A3 - NOT_ON_TIMER , // PF 4 ** 58 ** A4 - NOT_ON_TIMER , // PF 5 ** 59 ** A5 - NOT_ON_TIMER , // PF 6 ** 60 ** A6 - NOT_ON_TIMER , // PF 7 ** 61 ** A7 - NOT_ON_TIMER , // PK 0 ** 62 ** A8 - NOT_ON_TIMER , // PK 1 ** 63 ** A9 - NOT_ON_TIMER , // PK 2 ** 64 ** A10 - NOT_ON_TIMER , // PK 3 ** 65 ** A11 - NOT_ON_TIMER , // PK 4 ** 66 ** A12 - NOT_ON_TIMER , // PK 5 ** 67 ** A13 - NOT_ON_TIMER , // PK 6 ** 68 ** A14 - NOT_ON_TIMER , // PK 7 ** 69 ** A15 - NOT_ON_TIMER , // PG 4 ** 70 ** - NOT_ON_TIMER , // PG 3 ** 71 ** - NOT_ON_TIMER , // PJ 2 ** 72 ** - NOT_ON_TIMER , // PJ 3 ** 73 ** - NOT_ON_TIMER , // PJ 7 ** 74 ** - NOT_ON_TIMER , // PJ 4 ** 75 ** - NOT_ON_TIMER , // PJ 5 ** 76 ** - NOT_ON_TIMER , // PJ 6 ** 77 ** - NOT_ON_TIMER , // PE 2 ** 78 ** - NOT_ON_TIMER , // PE 6 ** 79 ** -}; - -#define digitalPinToTimer_plus_70(P) ( pgm_read_byte( digital_pin_to_timer_PGM_plus_70 + (P) ) ) - -/** - * Interrupts that are not implemented - * - * INT6 E6 79 - * INT7 E7 80 - * PCINT11 J2 72 - * PCINT12 J3 73 - * PCINT13 J4 75 - * PCINT14 J5 76 - * PCINT15 J6 77 - */ - - -#endif // __PINSDEBUG_PLUS_70_H__ diff --git a/Marlin_thinkerV2/Marlin/pins_3DRAG.h b/Marlin_thinkerV2/Marlin/pins_3DRAG.h deleted file mode 100644 index 61cdb56c1d..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_3DRAG.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "3Drag" -#endif - -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "3Drag" -#endif - -#ifndef DEFAULT_SOURCE_CODE_URL - #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" -#endif - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 9 -#define RAMPS_D9_PIN 8 -#define MOSFET_D_PIN 12 - -#define CASE_LIGHT_PIN -1 // MUST BE HARDWARE PWM but one is not available on expansion header - -#include "pins_RAMPS.h" - -// -// Limit Switches -// -#undef Z_MAX_PIN -#define Z_MAX_PIN -1 - -// -// Steppers -// -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 63 - -// -// Heaters / Fans -// -#define HEATER_2_PIN 6 - -// -// Misc. Functions -// -#undef SDSS -#define SDSS 25 - -#undef SD_DETECT_PIN -#define SD_DETECT_PIN 53 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - #undef BEEPER_PIN - #define BEEPER_PIN -1 - - #undef LCD_PINS_RS - #undef LCD_PINS_ENABLE - #undef LCD_PINS_D4 - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 37 - #define LCD_PINS_D5 35 - #define LCD_PINS_D6 33 - #define LCD_PINS_D7 31 - - // Buttons - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #define BTN_EN1 16 - #define BTN_EN2 17 - #define BTN_ENC 23 - -#else - - #define BEEPER_PIN 33 - -#endif // ULTRA_LCD && NEWPANEL - -/** - * M3/M4/M5 - Spindle/Laser Control - * - * If you want to control the speed of your spindle then you'll have - * have to sacrifce the Extruder and pull some signals off the Z stepper - * driver socket. - * - * The following assumes: - * - the Z stepper driver socket is empty - * - the extruder driver socket has a driver board plugged into it - * - the Z stepper wires are attached the the extruder connector - * - * If you want to keep the extruder AND don't have a LCD display then - * you can still control the power on/off and spindle direction. - * - * Where to get spindle signals - * - * stepper signal socket name socket name - * ------- - * SPINDLE_LASER_ENABLE_PIN /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_DIR_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor - */ -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not good with 3DRAG -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !EXTRUDERS - #undef E0_DIR_PIN - #undef E0_ENABLE_PIN - #undef E0_STEP_PIN - #undef Z_DIR_PIN - #undef Z_ENABLE_PIN - #undef Z_STEP_PIN - #define Z_DIR_PIN 28 - #define Z_ENABLE_PIN 24 - #define Z_STEP_PIN 26 - #define SPINDLE_LASER_PWM_PIN 46 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 62 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 48 - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // use expansion header if no LCD in use - #define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup/pulldown! - #define SPINDLE_DIR_PIN 17 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_5DPRINT.h b/Marlin_thinkerV2/Marlin/pins_5DPRINT.h deleted file mode 100644 index 415cc23bce..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_5DPRINT.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * 5DPrint D8 Driver board pin assignments - * - * https://bitbucket.org/makible/5dprint-d8-controller-board - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Makibox" -#define BOARD_NAME "5DPrint D8" - -// -// Servos -// -#define SERVO0_PIN 41 -#define SERVO1_PIN 42 -#define SERVO2_PIN 43 -#define SERVO3_PIN 44 - -// -// Limit Switches -// -#define X_STOP_PIN 37 // E5 -#define Y_STOP_PIN 36 // E4 -#define Z_STOP_PIN 19 // E7 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 17 // C7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 13 // C3 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 12 // C2 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 11 // C1 - -// -// Digital Microstepping -// -#define X_MS1_PIN 25 // B5 -#define X_MS2_PIN 26 // B6 -#define Y_MS1_PIN 9 // E1 -#define Y_MS2_PIN 8 // E0 -#define Z_MS1_PIN 7 // D7 -#define Z_MS2_PIN 6 // D6 -#define E0_MS1_PIN 5 // D5 -#define E0_MS2_PIN 4 // D4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 -#define HEATER_BED_PIN 14 // C4 - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -//DIGIPOTS slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for DIGIPOT 0x2C (0x58 <- 0x2C << 1) diff --git a/Marlin_thinkerV2/Marlin/pins_ANET_10.h b/Marlin_thinkerV2/Marlin/pins_ANET_10.h deleted file mode 100644 index a8cbd5f29c..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ANET_10.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Anet V1.0 board pin assignments - */ - -/** - * Rev B 16 JUN 2017 - * - * 1) no longer uses Sanguino files to define some of the pins - * 2) added pointers to useable Arduino IDE extensions - * - */ - -/** - * The standard Arduino IDE extension (board manager) for this board - * is located at https://github.com/SkyNet3D/anet-board. - * - * Installation instructions are on that page. - * - * After copying the files to the appropriate location, restart Arduino and - * you'll see "Anet V1.0" and "Anet V1.0 (Optiboot)" in the boards list. - * - * "Anet V1.0" uses the bootloader that was installed on the board when - * it shipped from the factory. - * - * "Anet V1.0 (Optiboot)" frees up another 3K of FLASH. You'll need to burn - * a new bootloader to the board to be able to automatically download a - * compiled image. - * - */ - -/** - * Another usable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -/** - * To burn a new bootloader: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select the board and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Additional info: - * - * Anet Schematics - https://github.com/ralf-e/ANET-3D-Board-V1.0 - * Wiring RRDFG Smart Controller - http://www.thingiverse.com/thing:2103748 - * SkyNet3D Anet software development - https://github.com/SkyNet3D/Marlin/ - * Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/ - * - * Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community. - */ - -#ifndef __AVR_ATmega1284P__ - #error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected in the 'Tools -> Boards' menu and ATmega1284P selected in 'Tools -> Processor' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Anet" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 -#define X_ENABLE_PIN 14 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 -#define Y_ENABLE_PIN 14 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 -#define Z_ENABLE_PIN 26 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 -#define E0_ENABLE_PIN 14 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) -#define HEATER_BED_PIN 12 // (bed) - -#ifndef FAN_PIN - #define FAN_PIN 4 -#endif - -// -// Misc. Functions -// -#define SDSS 31 -#define LED_PIN -1 - -/** - * LCD / Controller - * - * Only the following displays are supported: - * ZONESTAR_LCD - * ANET_FULL_GRAPHICS_LCD - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - */ - -#if ENABLED(ULTRA_LCD) - #define LCD_SDSS 28 - #if ENABLED(ADC_KEYPAD) - #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 - #define ADC_KEYPAD_PIN 1 - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD) - // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics - // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb - // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #define SERVO0_PIN 29 // free for BLTouch/3D-Touch - #define BEEPER_PIN 17 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 28 - #define LCD_PINS_D4 30 - #define BTN_EN1 11 - #define BTN_EN2 10 - #define BTN_ENC 16 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(63) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - #endif -#else - #define SERVO0_PIN 27 -#endif - -/** - * ==================================================================== - * =============== Alternative RepRapDiscount Wiring ================== - * ==================================================================== - * - * An alternative wiring scheme for the RepRapDiscount Full Graphics Display is - * published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748. - * - * Using that adapter requires changing the pin definition as follows: - * #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - * #define BEEPER_PIN 28 - * #define LCD_PINS_RS 30 - * #define LCD_PINS_ENABLE 29 - * #define LCD_PINS_D4 17 - * - * The BLTouch pin becomes LCD:3 - */ - -/** - * ==================================================================== - * ===================== LCD PINOUTS ================================== - * ==================================================================== - * - * Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring - * physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | http://www.thingiverse - * pin pin functions | | | | .com/thing:2103748 - *------------------------------------------------------------------------------------------------------------------------ - * ANET-J3.1 8 *** | N/A | J3_TX *** | | - * ANET-J3.2 9 *** | N/A | J3_RX *** | | - * ANET-J3.3 6 MISO | N/A | MISO *** | EXP2.1 MISO | EXP2.1 MISO - * ANET-J3.4 +5V | N/A | +5V | | - * ANET-J3.5 7 SCK | N/A | SCK *** | EXP2.2 SCK | EXP2.2 SCK - * ANET-J3.6 5 MOSI | N/A | MOSI *** | EXP2.6 MOSI | EXP2.6 MOSI - * ANET-J3.7 !RESET | N/A | button | EXP2.8 panel button | EXP2.8 panel button - * ANET-J3.8 GND | N/A | GND | EXP2.9 GND | EXP2.9 GND - * ANET-J3.9 4 Don't use | N/A | N/C | | - * ANET-J3.10 +3.3V | N/A | +3.3V *** | | - * | | | | - * | | | | - * ANET-LCD.1 GND | GND | GND | EXP1.9 GND | EXP1.9 GND - * ANET-LCD.2 +5V | +5V | +5V | EXP1.10 +5V | EXP1.10 +5V - * ANET-LCD.3 27 A4 | N/C * | LCD_PINS_RS | EXP1.4 LCD_PINS_RS | EXP2.4 SDSS or N/C * - * ANET-LCD.4 10 | LCD_PINS_D4 | BTN_EN2 | EXP2.3 BTN_EN2 | EXP2.3 BTN_EN2 - * ANET-LCD.5 28 A3 | LCD_PINS_RS | LCD_PINS_ENABLE | EXP1.3 LCD_PINS_ENABLE | EXP1.1 BEEPER_PIN - * ANET-LCD.6 11 | LCD_PINS_D5 | BTN_EN1 | EXP2.5 BTN_EN1 | EXP2.5 BTN_EN1 - * ANET-LCD.7 29 A2 | LCD_PINS_ENABLE | N/C * | EXP2.4 SDSS or N/C * | EXP1.3 LCD_PINS_ENABLE - * ANET-LCD.8 16 SCL | LCD_PINS_D6 | BTN_ENC | EXP1.2 BTN_ENC | EXP1.2 BTN_ENC - * ANET-LCD.9 30 A1 | ADC_KEYPAD_PIN ** | LCD_PINS_D4 | EXP1.5 LCD_PINS_D4 | EXP1.4 LCD_PINS_RS - * ANET-LCD.10 17 SDA | LCD_PINS_D7 | BEEPER_PIN | EXP1.1 BEEPER_PIN | EXP1.5 LCD_PINS_D4 - * - * N/C * - if not connected to the LCD can be used for BLTouch servo input - * ** - analog pin -WITHOUT a pullup - * *** - only connected to something if the Bluetooth module is populated - */ - -/** - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * physical pin function - * EXP1.1 BEEPER - * EXP1.2 BTN_ENC - * EXP1.3 LCD_PINS_ENABLE - * EXP1.4 LCD_PINS_RS - * EXP1.5 LCD_PINS_D4 - * EXP1.6 LCD_PINS_D5 (not used) - * EXP1.7 LCD_PINS_D6 (not used) - * EXP1.8 LCD_PINS_D7 (not used) - * EXP1.9 GND - * EXP1.10 VCC - * - * - * EXP2.1 MISO - * EXP2.2 SCK - * EXP2.3 BTN_EN2 - * EXP2.4 SDSS - * EXP2.5 BTN_EN1 - * EXP2.6 MOSI - * EXP2.7 SD_DETECT_PIN - * EXP2.8 button - * EXP2.9 GND - * EXP2.10 NC - */ diff --git a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X1.h b/Marlin_thinkerV2/Marlin/pins_AZTEEG_X1.h deleted file mode 100644 index 17290d1108..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X1.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Azteeg X1 pin assignments - */ - -#define BOARD_NAME "Azteeg X1" - -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3.h b/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3.h deleted file mode 100644 index 0abc9b87d6..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 6 // Define before RAMPS pins include -#endif -#define BOARD_NAME "Azteeg X3" - -#include "pins_RAMPS_13.h" - -// -// Servos -// -#undef SERVO0_PIN -#undef SERVO1_PIN -#define SERVO0_PIN 44 // SERVO1 port -#define SERVO1_PIN 55 // SERVO2 port - -// -// LCD / Controller -// -#undef STAT_LED_RED_PIN -#undef STAT_LED_BLUE_PIN - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef BTN_ENC - #define DOGLCD_A0 31 - #define DOGLCD_CS 32 - #define BTN_ENC 12 - - #define STAT_LED_RED_PIN 64 - #define STAT_LED_BLUE_PIN 63 - -#else - - #define STAT_LED_RED_PIN 6 - #define STAT_LED_BLUE_PIN 11 - -#endif - -// -// Misc -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && PIN_EXISTS(STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN - #undef STAT_LED_RED_PIN -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3 board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) - #undef SDA // use EXP3 header - #undef SCL - #if SERVO0_PIN == 7 - #undef SERVO0_PIN - #define SERVO0_PIN 11 - #endif - #define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 21 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3_PRO.h deleted file mode 100644 index fa17120651..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_AZTEEG_X3_PRO.h +++ /dev/null @@ -1,177 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * AZTEEG_X3_PRO (Arduino Mega) pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 5 || E_STEPPERS > 5 - #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Azteeg X3 Pro" - -// -// RAMPS pins overrides -// -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 44 -#endif - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif - -#include "pins_RAMPS.h" - -// DIGIPOT slave addresses -#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT 0x2C (0x58 <- 0x2C << 1) -#define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT 0x2E (0x5C <- 0x2E << 1) - -// -// Servos -// -// Tested this pin with bed leveling on a Delta with 1 servo. -// Physical wire attachment on EXT1: GND, 5V, D47. -// -#undef SERVO0_PIN -#define SERVO0_PIN 47 - -// -// Limit Switches -// -// Swap the MIN and MAX endstop pins because the X3 Pro comes with only -// MIN endstop pin headers soldered onto the board. -// -#if ENABLED(DELTA) - #undef X_MIN_PIN - #undef X_MAX_PIN - #undef Y_MIN_PIN - #undef Y_MAX_PIN - #undef Z_MIN_PIN - #undef Z_MAX_PIN - - #define X_MIN_PIN 2 - #define X_MAX_PIN 3 - #define Y_MIN_PIN 15 - #define Y_MAX_PIN 14 - #define Z_MIN_PIN 19 - #define Z_MAX_PIN 18 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 18 -#endif - -// -// Steppers -// -#define E2_STEP_PIN 23 -#define E2_DIR_PIN 25 -#define E2_ENABLE_PIN 40 - -#define E3_STEP_PIN 27 -#define E3_DIR_PIN 29 -#define E3_ENABLE_PIN 41 - -#define E4_STEP_PIN 43 -#define E4_DIR_PIN 37 -#define E4_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_2_PIN 12 // Analog Input -#define TEMP_3_PIN 11 // Analog Input -#define TEMP_4_PIN 10 // Analog Input -#define TC1 4 // Analog Input (Thermo couple on Azteeg X3Pro) -#define TC2 5 // Analog Input (Thermo couple on Azteeg X3Pro) - -// -// Heaters / Fans -// -#define HEATER_2_PIN 16 -#define HEATER_3_PIN 17 -#define HEATER_4_PIN 4 -#define HEATER_5_PIN 5 -#define HEATER_6_PIN 6 -#define HEATER_7_PIN 11 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable) -#endif - -// Fans/Water Pump to cool the hotend cool side. -#define ORIG_E0_AUTO_FAN_PIN 5 -#define ORIG_E1_AUTO_FAN_PIN 5 -#define ORIG_E2_AUTO_FAN_PIN 5 -#define ORIG_E3_AUTO_FAN_PIN 5 - -// -// LCD / Controller -// -#undef BEEPER_PIN -#define BEEPER_PIN 33 - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 49 // For easy adapter board - #undef BEEPER_PIN - #define BEEPER_PIN 12 // 33 isn't physically available to the LCD display -#else - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 -#endif - -// -// Misc. Functions -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN - #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it - #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3pro board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN - -#if ENABLED(SPINDLE_LASER_ENABLE) // EXP2 header - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #undef BTN_EN2 - #define BTN_EN2 31 // need 7 for the spindle speed PWM - #endif - #define SPINDLE_LASER_PWM_PIN 7 // must have a hardware PWM - #define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 21 -#endif - diff --git a/Marlin_thinkerV2/Marlin/pins_BAM_DICE_DUE.h b/Marlin_thinkerV2/Marlin/pins_BAM_DICE_DUE.h deleted file mode 100644 index d763392c5d..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_BAM_DICE_DUE.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * BAM&DICE Due (Arduino Mega) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "2PrintBeta Due" - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 66 // Pin should have a pullup/pulldown! -#define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - -#include "pins_RAMPS.h" - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#define TEMP_0_PIN 9 // Analog Input -#define TEMP_1_PIN 11 // Analog Input diff --git a/Marlin_thinkerV2/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin_thinkerV2/Marlin/pins_BQ_ZUM_MEGA_3D.h deleted file mode 100644 index f80379eda2..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_BQ_ZUM_MEGA_3D.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * bq ZUM Mega 3D board definition - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "ZUM Mega 3D" - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 10 -#define RAMPS_D9_PIN 12 -#define RAMPS_D10_PIN 9 -#define MOSFET_D_PIN 7 - -// -// Auto fans -// -#define ORIG_E0_AUTO_FAN_PIN 11 -#define ORIG_E1_AUTO_FAN_PIN 6 -#define ORIG_E2_AUTO_FAN_PIN 6 -#define ORIG_E3_AUTO_FAN_PIN 6 - -// -// Misc. Functions -// -#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 42 - -#include "pins_RAMPS_13.h" - -// -// Limit Switches -// -#undef X_MAX_PIN -#define X_MAX_PIN 79 // 2 - -// -// Z Probe (when not Z_MIN_PIN) -// -#undef Z_MIN_PROBE_PIN -#define Z_MIN_PROBE_PIN 19 // IND_S_5V - -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 77 // 62 - -// -// Steppers -// -#define DIGIPOTSS_PIN 22 -#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } - -// -// Temperature Sensors -// -#undef TEMP_1_PIN -#define TEMP_1_PIN 14 // Analog Input (15) - -#undef TEMP_BED_PIN -#define TEMP_BED_PIN 15 // Analog Input (14) - -// -// Misc. Functions -// -#undef PS_ON_PIN // 12 -#define PS_ON_PIN 81 // External Power Supply - - -// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team -// decided to ship the printer only with the probe and no additional Z-min -// endstop and the instruction manual advises the user to connect the probe to -// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work. -#ifdef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PIN - #undef Z_MAX_PIN - #define Z_MIN_PIN 19 // IND_S_5V - #define Z_MAX_PIN 18 // Z-MIN Label -#endif - - -// -// This pin is used by the official Hephestos 2 heated bed upgrade kit -// -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef HEATER_BED_PIN - #define HEATER_BED_PIN 8 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_BRAINWAVE.h b/Marlin_thinkerV2/Marlin/pins_BRAINWAVE.h deleted file mode 100644 index a43c6be95c..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_BRAINWAVE.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Brainwave 1.0 pin assignments (AT90USB646) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointer to a currently available Arduino IDE extension that will - * allow this board to use the latest Marlin software - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB - * This is the only known IDE extension that is compatible with the pin definitions - * in this file, Adrduino 1.6.12 and the latest mainstream Marlin software. - * - * "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share - * the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such - * that PWM1A, PWM1B & PWM1C can't be used. - * - * Installation: - * - * 1. In the Arduino IDE, under Files -> Preferences paste the following URL - * https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json - * 2. Under Tools -> Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB - * and then click on "Install" - * 3. Select "AT90USB646_TEENSYPP" from the 'Tools -> Boards' menu. - */ - -/** - * To burn the bootloader that comes with Marlin_AT90USB: - * - * 1. Connect your programmer to the board. - * 2. In Arduino IDE select "AT90USB646_TEENSYPP" and then select the programmer. - * 3. In Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB646__ - #error "Oops! Make sure you have 'AT90USB646_TEENSYPP' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Brainwave" - -// -// Limit Switches -// -#define X_STOP_PIN 35 // A7 -#define Y_STOP_PIN 34 // A6 -#define Z_STOP_PIN 33 // A5 - -// -// Steppers -// -#define X_STEP_PIN 3 // D3 -#define X_DIR_PIN 5 // D5 -#define X_ENABLE_PIN 4 // D4 -#define X_ATT_PIN 2 // D2 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 9 // E1 -#define Y_ENABLE_PIN 8 // E0 -#define Y_ATT_PIN 6 // D6 - -#define Z_STEP_PIN 11 // C1 -#define Z_DIR_PIN 13 // C3 -#define Z_ENABLE_PIN 12 // C2 -#define Z_ATT_PIN 10 // C0 - -#define E0_STEP_PIN 15 // C5 -#define E0_DIR_PIN 17 // C7 -#define E0_ENABLE_PIN 16 // C6 -#define E0_ATT_PIN 14 // C4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input -#define TEMP_BED_PIN 6 // F6 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 32 // A4 Extruder -#define HEATER_BED_PIN 18 // E6 Bed - -#ifndef FAN_PIN - #define FAN_PIN 31 // A3 Fan -#endif - -// -// Misc. Functions -// -#define LED_PIN 19 // E7 diff --git a/Marlin_thinkerV2/Marlin/pins_BRAINWAVE_PRO.h b/Marlin_thinkerV2/Marlin/pins_BRAINWAVE_PRO.h deleted file mode 100644 index 49c8ab6b59..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_BRAINWAVE_PRO.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Brainwave Pro pin assignments (AT90USB1286) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointers to currently available Arduino IDE extensions that will - * allow this board to use the latest Marlin software - * - * - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Brainwave Pro" - -// -// Limit Switches -// -#define X_STOP_PIN 45 // F7 -#define Y_STOP_PIN 12 // C2 -#define Z_STOP_PIN 36 // E4 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 11 // C1 -#endif - -// -// Steppers -// -#define X_STEP_PIN 9 // E1 -#define X_DIR_PIN 8 // E0 -#define X_ENABLE_PIN 23 // B3 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 6 // D6 -#define Y_ENABLE_PIN 20 // B0 - -#define Z_STEP_PIN 5 // D5 -#define Z_DIR_PIN 4 // D4 -#define Z_ENABLE_PIN 37 // E5 - -#define E0_STEP_PIN 47 // E3 -#define E0_DIR_PIN 46 // E2 -#define E0_ENABLE_PIN 25 // B5 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // F2 Analog Input -#define TEMP_1_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 27 // B7 -#define HEATER_BED_PIN 26 // B6 Bed -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 Fan, PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define SD_DETECT_PIN 24 // B4 -#define LED_PIN 13 // C3 diff --git a/Marlin_thinkerV2/Marlin/pins_CHEAPTRONIC.h b/Marlin_thinkerV2/Marlin/pins_CHEAPTRONIC.h deleted file mode 100644 index e8f2c5f67e..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_CHEAPTRONIC.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Cheaptronic v1.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Cheaptronic v1.0" -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 2 -#define Z_STOP_PIN 5 - -// -// Steppers -// -#define X_STEP_PIN 14 -#define X_DIR_PIN 15 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 35 -#define Y_DIR_PIN 36 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 41 -#define Z_ENABLE_PIN 37 - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 25 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 // Analog Input -#define TEMP_1_PIN 14 // Analog Input -#define TEMP_BED_PIN 13 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 19 // EXTRUDER 1 -#define HEATER_1_PIN 23 // EXTRUDER 2 -#define HEATER_BED_PIN 22 - -// -// LCD / Controller -// -// Cheaptronic v1.0 doesn't support LCD -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 - -// Cheaptronic v1.0 doesn't support keypad -#define BTN_EN1 -1 -#define BTN_EN2 -1 -#define BTN_ENC -1 diff --git a/Marlin_thinkerV2/Marlin/pins_CHEAPTRONICv2.h b/Marlin_thinkerV2/Marlin/pins_CHEAPTRONICv2.h deleted file mode 100644 index eea57d23ec..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_CHEAPTRONICv2.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Cheaptronic v2.0 pin assignments - * Built and sold by Michal Dyntar - RRO - * www.reprapobchod.cz - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Cheaptronic v2.0" - -// -// Limit Switches -// -#define X_MIN_PIN 30 -#define X_MAX_PIN 31 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 33 -#define Z_MIN_PIN 34 -#define Z_MAX_PIN 35 - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 22 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 25 -#define E1_ENABLE_PIN 27 - -#define E2_STEP_PIN 29 -#define E2_DIR_PIN 28 -#define E2_ENABLE_PIN 39 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 -#define TEMP_1_PIN 13 -#define TEMP_2_PIN 14 -#define TEMP_3_PIN 11 // should be used for chamber temperature control -#define TEMP_BED_PIN 12 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 6 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 9 -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif -#define FAN2_PIN 58 // additional fan or light control output - -// -// Other board specific pins -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 37 // board input labeled as F-DET -#endif -#define Z_MIN_PROBE_PIN 36 // additional external board input labeled as E-SENS (should be used for Z-probe) -#define LED_PIN 13 -#define SPINDLE_ENABLE_PIN 4 // additional PWM pin 1 at JP1 connector - should be used for laser control too -#define EXT_2 5 // additional PWM pin 2 at JP1 connector -#define EXT_3 2 // additional PWM pin 3 at JP1 connector -#define PS_ON_PIN 45 -#define KILL_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // shared with TEMP_3 analog input -#endif - -// -// LCD -// -#define LCD_PINS_RS 19 -#define LCD_PINS_ENABLE 42 -#define LCD_PINS_D4 18 -#define LCD_PINS_D5 38 -#define LCD_PINS_D6 41 -#define LCD_PINS_D7 40 - -// -// SD CARD, ROTARY ENCODER, BEEPER -// -#define SDPOWER -1 -#define SDSS 53 -#define SD_DETECT_PIN 49 -#define BEEPER_PIN 44 -#define BTN_EN1 11 -#define BTN_EN2 12 -#define BTN_ENC 43 diff --git a/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_11.h b/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_11.h deleted file mode 100644 index 0a32d04a18..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_11.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * CartesioV11 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. -#endif - -#define BOARD_NAME "CN Controls V11" - -// -// Limit Switches -// -#define X_STOP_PIN 43 -#define Y_STOP_PIN 45 -#define Z_STOP_PIN 42 - -// -// Steppers -// -#define X_STEP_PIN 34 -#define X_DIR_PIN 36 -#define X_ENABLE_PIN 35 - -#define Y_STEP_PIN 37 -#define Y_DIR_PIN 39 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 41 - -#define E0_STEP_PIN 29 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 3 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 15 -#define E2_DIR_PIN 14 -#define E2_ENABLE_PIN 16 - -#define E3_STEP_PIN 44 -#define E3_DIR_PIN 49 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 3 // Analog Input. 3 for tool2 -> 2 for chambertemp -#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 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 5 -#define HEATER_1_PIN 58 -#define HEATER_2_PIN 64 -#define HEATER_3_PIN 46 -#define HEATER_BED_PIN 2 - -#ifndef FAN_PIN - //#define FAN_PIN 7 // common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 13 - -// Tools - -//#define TOOL_0_PIN 4 -//#define TOOL_1_PIN 59 -//#define TOOL_2_PIN 8 -//#define TOOL_3_PIN 30 -//#define TOOL_PWM_PIN 7 // common PWM pin for all tools - -// Common I/O - -//#define FIL_RUNOUT_PIN -1 -//#define PWM_1_PIN 11 -//#define PWM_2_PIN 10 -//#define SPARE_IO 12 - -// -// LCD / Controller -// -#define BEEPER_PIN 6 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 26 -#define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 -#define DOGLCD_SCK -1 - -#define BTN_EN1 23 -#define BTN_EN2 25 -#define BTN_ENC 27 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 19 -#define SHIFT_LD 18 -#define SHIFT_CLK 17 - -//#define UI1 31 -//#define UI2 22 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 31 diff --git a/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_12.h b/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_12.h deleted file mode 100644 index f073b19c96..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_CNCONTROLS_12.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * CartesioV12 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. -#endif - -#define BOARD_NAME "CN Controls V12" - -// -// Limit Switches -// -#define X_STOP_PIN 19 -#define Y_STOP_PIN 22 -#define Z_STOP_PIN 23 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 26 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 30 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 31 -#define Z_DIR_PIN 33 -#define Z_ENABLE_PIN 32 - -#define E0_STEP_PIN 57 -#define E0_DIR_PIN 55 -#define E0_ENABLE_PIN 58 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 46 -#define E2_DIR_PIN 66 -#define E2_ENABLE_PIN 44 - -#define E3_STEP_PIN 45 -#define E3_DIR_PIN 69 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 9 // Analog Input. 9 for tool2 -> 13 for chambertemp -#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 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 11 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 3 -#define HEATER_BED_PIN 24 - -#ifndef FAN_PIN - #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 15 - -// Tools - -//#define TOOL_0_PIN 56 -//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder -//#define TOOL_1_PIN 59 -//#define TOOL_1_PWM_PIN 8 // lights at dual extruder -//#define TOOL_2_PIN 4 -//#define TOOL_2_PWM_PIN 5 -//#define TOOL_3_PIN 14 -//#define TOOL_3_PWM_PIN 2 - -// Common I/O - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 18 -#endif -//#define PWM_1_PIN 12 -//#define PWM_2_PIN 13 -//#define SPARE_IO 17 - -// -// LCD / Controller -// -#define BEEPER_PIN 16 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 39 -#define DOGLCD_CS 35 -#define DOGLCD_MOSI 48 -#define DOGLCD_SCK 49 -#define LCD_SCREEN_ROT_180 - -// The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 42 -#define SHIFT_LD 41 -#define SHIFT_CLK 40 - -//#define UI1 43 -//#define UI2 37 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN diff --git a/Marlin_thinkerV2/Marlin/pins_EINSY_RAMBO.h b/Marlin_thinkerV2/Marlin/pins_EINSY_RAMBO.h deleted file mode 100644 index e3f67059fa..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_EINSY_RAMBO.h +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Einsy-Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Einsy Rambo" - -// -// TMC2130 Configuration_adv defaults for EinsyRambo -// -#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRambo." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_STOP_PIN 12 - #define Y_STOP_PIN 11 - #define Z_STOP_PIN 10 - -#else - - #define X_STOP_PIN X_DIAG_PIN - #define Y_STOP_PIN Y_DIAG_PIN - - #if ENABLED(BLTOUCH) - #define Z_STOP_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_STOP_PIN 10 - #endif - -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif - -#ifndef FAN1_PIN - #define FAN1_PIN 6 -#endif - -// -// Misc. Functions -// -#define SDSS 77 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 32 - - #if ENABLED(NEWPANEL) - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 61 - #define BTN_EN2 59 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 61 - #define LCD_PINS_D4 59 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - #define SD_DETECT_PIN 15 - - #endif // NEWPANEL -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_EINSY_RETRO.h b/Marlin_thinkerV2/Marlin/pins_EINSY_RETRO.h deleted file mode 100644 index a100d9329e..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_EINSY_RETRO.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Einsy-Retro pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Einsy Retro" - -// -// TMC2130 Configuration_adv defaults for EinsyRetro -// -#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_MIN_PIN 12 - #define Y_MIN_PIN 11 - #define Z_MIN_PIN 10 - #define X_MAX_PIN 81 - #define Y_MAX_PIN 57 - -#else - - #if X_HOME_DIR == -1 - #define X_MIN_PIN X_DIAG_PIN - #define X_MAX_PIN 81 - #else - #define X_MIN_PIN 12 - #define X_MAX_PIN X_DIAG_PIN - #endif - - #if Y_HOME_DIR == -1 - #define Y_MIN_PIN Y_DIAG_PIN - #define Y_MAX_PIN 57 - #else - #define Y_MIN_PIN 11 - #define Y_MAX_PIN Y_DIAG_PIN - #endif - - #if ENABLED(BLTOUCH) - #define Z_MIN_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_MIN_PIN 10 - #endif - -#endif - -#define Z_MAX_PIN 7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 32 - - #if ENABLED(NEWPANEL) - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 18 - #define BTN_EN2 19 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 - #define LCD_PINS_D4 19 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - #define SD_DETECT_PIN 15 - - #endif // NEWPANEL -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_ELEFU_3.h b/Marlin_thinkerV2/Marlin/pins_ELEFU_3.h deleted file mode 100644 index 79a4bce712..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ELEFU_3.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Elefu RA Board Pin Assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Elefu Ra v3" - -// -// Limit Switches -// -#define X_MIN_PIN 35 -#define X_MAX_PIN 34 -#define Y_MIN_PIN 33 -#define Y_MAX_PIN 32 -#define Z_MIN_PIN 31 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 49 -#define X_DIR_PIN 13 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 11 -#define Y_DIR_PIN 9 -#define Y_ENABLE_PIN 12 - -#define Z_STEP_PIN 7 -#define Z_DIR_PIN 6 -#define Z_ENABLE_PIN 8 - -#define E0_STEP_PIN 40 -#define E0_DIR_PIN 41 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 18 -#define E1_DIR_PIN 19 -#define E1_ENABLE_PIN 38 - -#define E2_STEP_PIN 43 -#define E2_DIR_PIN 47 -#define E2_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 3 // Analog Input -#define TEMP_1_PIN 2 // Analog Input -#define TEMP_2_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 45 // 12V PWM1 -#define HEATER_1_PIN 46 // 12V PWM2 -#define HEATER_2_PIN 17 // 12V PWM3 -#define HEATER_BED_PIN 44 // DOUBLE 12V PWM - -#ifndef FAN_PIN - #define FAN_PIN 16 // 5V PWM -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 10 // Set to -1 if using a manual switch on the PWRSW Connector -#define SLEEP_WAKE_PIN 26 // This feature still needs work -#define PHOTOGRAPH_PIN 29 - -// -// LCD / Controller -// -#define BEEPER_PIN 36 - -#if ENABLED(RA_CONTROL_PANEL) - - #define SDSS 53 - #define SD_DETECT_PIN 28 - - #define BTN_EN1 14 - #define BTN_EN2 39 - #define BTN_ENC 15 - -#endif // RA_CONTROL_PANEL - -#if ENABLED(RA_DISCO) - // variables for which pins the TLC5947 is using - #define TLC_CLOCK_PIN 25 - #define TLC_BLANK_PIN 23 - #define TLC_XLAT_PIN 22 - #define TLC_DATA_PIN 24 - - // We also need to define pin to port number mapping for the 2560 to match the pins listed above. - // If you change the TLC pins, update this as well per the 2560 datasheet! This currently only works with the RA Board. - #define TLC_CLOCK_BIT 3 - #define TLC_CLOCK_PORT &PORTA - - #define TLC_BLANK_BIT 1 - #define TLC_BLANK_PORT &PORTA - - #define TLC_DATA_BIT 2 - #define TLC_DATA_PORT &PORTA - - #define TLC_XLAT_BIT 0 - #define TLC_XLAT_PORT &PORTA - - // Change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful - // Leave it at at least 1 if you have enabled RA_LIGHTING - // The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module. - #define NUM_TLCS 2 - - // These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. - // Modify them according to your specific situation. - // NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs. - #define TRANS_ARRAY { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8 } // forward - //#define TRANS_ARRAY { 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15 } // backward -#endif // RA_DISCO diff --git a/Marlin_thinkerV2/Marlin/pins_FELIX2.h b/Marlin_thinkerV2/Marlin/pins_FELIX2.h deleted file mode 100644 index 5d6765c840..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_FELIX2.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Felix 2.0+" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#include "pins_RAMPS.h" - -// -// Misc. Functions -// -#undef SDPOWER -#define SDPOWER 1 - -#define PS_ON_PIN 12 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define SD_DETECT_PIN 6 - -#endif // NEWPANEL && ULTRA_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not valid with this board -#undef SPINDLE_LASER_ENABLE_PIN -#undef SPINDLE_DIR_PIN diff --git a/Marlin_thinkerV2/Marlin/pins_GEN3_MONOLITHIC.h b/Marlin_thinkerV2/Marlin/pins_GEN3_MONOLITHIC.h deleted file mode 100644 index 5d64e94290..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN3_MONOLITHIC.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen3 Monolithic Electronics pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644P__ - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen3 Monolithic" -#define DEBUG_PIN 0 - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 // actually uses Y_enable_pin - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 // shared with X_enable_pin - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 12 -#define E0_DIR_PIN 17 -#define E0_ENABLE_PIN 3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 16 - -// -// Misc. Functions -// -#define PS_ON_PIN 14 // Alex, does this work on the card? - -// Alex extras from Gen3+ diff --git a/Marlin_thinkerV2/Marlin/pins_GEN3_PLUS.h b/Marlin_thinkerV2/Marlin/pins_GEN3_PLUS.h deleted file mode 100644 index 85c47305b3..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN3_PLUS.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen3+ pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen3+" - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 17 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 13 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 5 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 12 -#define HEATER_BED_PIN 16 - -// -// Misc. Functions -// -#define SDSS 4 -#define PS_ON_PIN 14 diff --git a/Marlin_thinkerV2/Marlin/pins_GEN6.h b/Marlin_thinkerV2/Marlin/pins_GEN6.h deleted file mode 100644 index 1c5e2069ae..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN6.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen6 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Gen6" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 4 // Edited @ EJE Electronics 20100715 -#define E0_DIR_PIN 2 // Edited @ EJE Electronics 20100715 -#define E0_ENABLE_PIN 3 // Added @ EJE Electronics 20100715 - -// -// Temperature Sensor -// -#define TEMP_0_PIN 5 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 14 // changed @ rkoeppl 20110410 - -#if !MB(GEN6) - #define HEATER_BED_PIN 1 // changed @ rkoeppl 20110410 - #define TEMP_BED_PIN 0 // Analog Input -#endif - -// -// Misc. Functions -// -#define SDSS 17 -#define DEBUG_PIN 0 -#define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin_thinkerV2/Marlin/pins_GEN6_DELUXE.h b/Marlin_thinkerV2/Marlin/pins_GEN6_DELUXE.h deleted file mode 100644 index 5834068667..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN6_DELUXE.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen6 Deluxe pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#define BOARD_NAME "Gen6 Deluxe" - -#include "pins_GEN6.h" diff --git a/Marlin_thinkerV2/Marlin/pins_GEN7_12.h b/Marlin_thinkerV2/Marlin/pins_GEN7_12.h deleted file mode 100644 index 1afaae9abc..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN7_12.h +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.1, v1.2, v1.3 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Gen7 v1.1 / 1.2" -#endif - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 7 -#define Y_MIN_PIN 5 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 -#define Y_MAX_PIN 2 -#define X_MAX_PIN 6 - - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 0 -#endif - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#if !defined(FAN_PIN) && GEN7_VERSION < 13 // Gen7 v1.3 removed the fan pin - #define FAN_PIN 31 -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -#if GEN7_VERSION < 13 - #define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM -#endif - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! -#define SPINDLE_DIR_PIN 11 -#if GEN7_VERSION < 13 - #define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_GEN7_13.h b/Marlin_thinkerV2/Marlin/pins_GEN7_13.h deleted file mode 100644 index 749a6c3389..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN7_13.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.3 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#define BOARD_NAME "Gen7 v1.3" - -#define GEN7_VERSION 13 // v1.3 -#include "pins_GEN7_12.h" diff --git a/Marlin_thinkerV2/Marlin/pins_GEN7_14.h b/Marlin_thinkerV2/Marlin/pins_GEN7_14.h deleted file mode 100644 index dedd227ca0..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN7_14.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 v1.4 pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen7 v1.4" - -#define GEN7_VERSION 14 // v1.4 - -// -// Limit switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 29 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 27 -#define Y_DIR_PIN 26 -#define Y_ENABLE_PIN 25 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 25 - -#define E0_STEP_PIN 19 -#define E0_DIR_PIN 18 -#define E0_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -// -// Misc. Functions -// -#define PS_ON_PIN 15 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM - -// A pin for debugging -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 20 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 21 diff --git a/Marlin_thinkerV2/Marlin/pins_GEN7_CUSTOM.h b/Marlin_thinkerV2/Marlin/pins_GEN7_CUSTOM.h deleted file mode 100644 index fdfb6b5fa1..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GEN7_CUSTOM.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Gen7 Alfons3 board pin assignments - * - * These Pins are assigned for the modified GEN7 Board from Alfons3. - * Please review the pins and adjust them for your needs. - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Gen7 Custom" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 // different from standard GEN7 -#define X_DIR_PIN 20 // different from standard GEN7 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 // (bed) - -// -// Misc. Functions -// -#define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support -#define PS_ON_PIN 19 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM - -// A pin for debugging -#define DEBUG_PIN -1 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -// 4bit LCD Support -#define LCD_PINS_RS 18 -#define LCD_PINS_ENABLE 17 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 15 -#define LCD_PINS_D6 13 -#define LCD_PINS_D7 14 - -// Buttons are directly attached -#define BTN_EN1 11 -#define BTN_EN2 10 -#define BTN_ENC 12 - -// RS485 pins -//#define TX_ENABLE_PIN 12 -//#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A.h b/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A.h deleted file mode 100644 index 63f166ab32..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Geeetech GT2560 Revision A board pin assignments, based on the work of - * George Robles (https://georges3dprinters.com) and - * Richard Smith - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "GT2560 Rev.A" -#endif -#define DEFAULT_MACHINE_NAME "Prusa i3 Pro B" - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 -#define TEMP_1_PIN 9 -#define TEMP_BED_PIN 10 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDPOWER -1 -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing -#define KILL_PIN -1 - -#if ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 5 - #define DOGLCD_CS 21 - #define BTN_EN1 40 - #define BTN_EN2 42 - #else - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - #define BTN_EN1 42 - #define BTN_EN2 40 - #endif - - #define BTN_ENC 19 - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A_PLUS.h b/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A_PLUS.h deleted file mode 100644 index 99399e34ba..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_GT2560_REV_A_PLUS.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Geeetech GT2560 Revision A+ board pin assignments - */ - -#define BOARD_NAME "GT2560 Rev.A+" - -#include "pins_GT2560_REV_A.h" - -#if ENABLED(BLTOUCH) - #define SERVO0_PIN 11 -#else - #define SERVO0_PIN 32 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_K8200.h b/Marlin_thinkerV2/Marlin/pins_K8200.h deleted file mode 100644 index cc3e731172..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_K8200.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * K8200 Arduino Mega with RAMPS v1.3 pin assignments - * Identical to 3DRAG - */ - -#define BOARD_NAME "Velleman K8200" -#define DEFAULT_MACHINE_NAME "K8200" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" - -#include "pins_3DRAG.h" diff --git a/Marlin_thinkerV2/Marlin/pins_K8400.h b/Marlin_thinkerV2/Marlin/pins_K8400.h deleted file mode 100644 index 3e2cd4b212..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_K8400.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Velleman K8400 (Vertex) - * 3DRAG clone - * - * K8400 has some minor differences over a normal 3Drag: - * - No X/Y max endstops - * - Second extruder step pin has moved - * - No power supply control - * - Second heater has moved pin - */ - -#define BOARD_NAME "K8400" -#define DEFAULT_MACHINE_NAME "Vertex" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/birkett/Vertex-K8400-Firmware" - -#include "pins_3DRAG.h" - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 - -#undef X_MIN_PIN -#undef X_MAX_PIN -#undef Y_MIN_PIN -#undef Y_MAX_PIN - -// -// Steppers -// -#undef E1_STEP_PIN -#define E1_STEP_PIN 32 - -// -// Heaters / Fans -// -#undef HEATER_1_PIN -#define HEATER_1_PIN 11 - -// -// Misc. Functions -// -#undef PS_ON_PIN -#undef KILL_PIN -#undef SD_DETECT_PIN - -#if Z_STEP_PIN == 26 - #undef Z_STEP_PIN - #define Z_STEP_PIN 32 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_LEAPFROG.h b/Marlin_thinkerV2/Marlin/pins_LEAPFROG.h deleted file mode 100644 index 9a31520e8a..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_LEAPFROG.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Leapfrog Driver board pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Leapfrog" - -// -// Limit Switches -// -#define X_MIN_PIN 47 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 48 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 49 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 28 -#define X_DIR_PIN 63 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 14 // A6 -#define Y_DIR_PIN 15 // A0 -#define Y_ENABLE_PIN 39 - -#define Z_STEP_PIN 31 // A2 -#define Z_DIR_PIN 32 // A6 -#define Z_ENABLE_PIN 30 // A1 - -#define E0_STEP_PIN 34 // 34 -#define E0_DIR_PIN 35 // 35 -#define E0_ENABLE_PIN 33 // 33 - -#define E1_STEP_PIN 37 // 37 -#define E1_DIR_PIN 40 // 40 -#define E1_ENABLE_PIN 36 // 36 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input (D27) -#define TEMP_1_PIN 15 // Analog Input (1) -#define TEMP_BED_PIN 14 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 // 12 -#define HEATER_2_PIN 11 // 13 -#define HEATER_BED_PIN 10 // 14/15 - -#define FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 11 -#define LED_PIN 13 -#define SOL1_PIN 16 -#define SOL2_PIN 17 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin_thinkerV2/Marlin/pins_MAKEBOARD_MINI.h b/Marlin_thinkerV2/Marlin/pins_MAKEBOARD_MINI.h deleted file mode 100644 index 5dcf1e2180..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MAKEBOARD_MINI.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "pins_RAMPS.h" - -#undef BOARD_NAME -#define BOARD_NAME "MAKEBOARD_MINI" - -// -// Only 3 Limit Switch plugs on Micromake C1 -// -#undef X_MIN_PIN -#undef Y_MIN_PIN -#undef Z_MIN_PIN -#undef X_MAX_PIN -#undef Y_MAX_PIN -#undef Z_MAX_PIN -#define X_STOP_PIN 2 -#define Y_STOP_PIN 15 -#define Z_STOP_PIN 19 diff --git a/Marlin_thinkerV2/Marlin/pins_MEGACONTROLLER.h b/Marlin_thinkerV2/Marlin/pins_MEGACONTROLLER.h deleted file mode 100644 index 709dc413be..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MEGACONTROLLER.h +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mega controller pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Mega Controller" - -// -// Servos -// -#define SERVO0_PIN 30 -#define SERVO1_PIN 31 -#define SERVO2_PIN 32 -#define SERVO3_PIN 33 - -// -// Limit Switches -// -#define X_MIN_PIN 43 -#define X_MAX_PIN 42 -#define Y_MIN_PIN 38 -#define Y_MAX_PIN 41 -#define Z_MIN_PIN 40 -#define Z_MAX_PIN 37 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 37 -#endif - -// -// Steppers -// -#define X_STEP_PIN 62 // A8 -#define X_DIR_PIN 63 // A9 -#define X_ENABLE_PIN 61 // A7 - -#define Y_STEP_PIN 65 // A11 -#define Y_DIR_PIN 66 // A12 -#define Y_ENABLE_PIN 64 // A10 - -#define Z_STEP_PIN 68 // A14 -#define Z_DIR_PIN 69 // A15 -#define Z_ENABLE_PIN 67 // A13 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 24 -#define E0_ENABLE_PIN 22 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 27 -#define E1_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 0 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input -#else - #define TEMP_1_PIN 2 // Analog Input -#endif - -#define TEMP_2_PIN 3 // Analog Input - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 6 // Analog Input -#else - #define TEMP_BED_PIN 1 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 29 -#define HEATER_1_PIN 34 -#define HEATER_BED_PIN 28 - -#ifndef FAN_PIN - #define FAN_PIN 39 -#endif -#define FAN1_PIN 35 -#define FAN2_PIN 36 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN FAN2_PIN -#endif - -#define FAN_SOFT_PWM - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#if ENABLED(MINIPANEL) - - #define BEEPER_PIN 46 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 47 - #define DOGLCD_CS 45 - #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 - - #define KILL_PIN 12 - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 48 - #define BTN_EN2 11 - #define BTN_ENC 10 - - #define SD_DETECT_PIN 49 - -#endif // MINIPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 7 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 8 diff --git a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS.h b/Marlin_thinkerV2/Marlin/pins_MEGATRONICS.h deleted file mode 100644 index 8b608eff88..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Megatronics" -// -// Limit Switches -// -#define X_MIN_PIN 41 -#define X_MAX_PIN 37 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 60 // A6 -#define Y_DIR_PIN 61 // A7 -#define Y_ENABLE_PIN 22 - -#define Z_STEP_PIN 54 // A0 -#define Z_DIR_PIN 55 // A1 -#define Z_ENABLE_PIN 56 // A2 - -#define E0_STEP_PIN 31 -#define E0_DIR_PIN 32 -#define E0_ENABLE_PIN 38 - -#define E1_STEP_PIN 34 -#define E1_DIR_PIN 36 -#define E1_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 8 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 // IO pin. Buffer needed -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#define BEEPER_PIN 33 - -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - // Buttons directly attached using AUX-2 - #define BTN_EN1 59 - #define BTN_EN2 64 - #define BTN_ENC 43 - - #define SD_DETECT_PIN -1 // RAMPS doesn't use this - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 diff --git a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_2.h b/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_2.h deleted file mode 100644 index 9bd8b4506d..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_2.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics v2.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Megatronics v2.0" -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 4 // A6 -#define Y_DIR_PIN 54 // A0 -#define Y_ENABLE_PIN 5 - -#define Z_STEP_PIN 56 // A2 -#define Z_DIR_PIN 60 // A6 -#define Z_ENABLE_PIN 55 // A1 - -#define E0_STEP_PIN 35 -#define E0_DIR_PIN 36 -#define E0_ENABLE_PIN 34 - -#define E1_STEP_PIN 29 -#define E1_DIR_PIN 39 -#define E1_ENABLE_PIN 28 - -#define E2_STEP_PIN 23 // ? schematic says 24 -#define E2_DIR_PIN 24 // ? schematic says 23 -#define E2_ENABLE_PIN 22 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 8 // Analog Input -#else - #define TEMP_1_PIN 15 // Analog Input -#endif - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#define BEEPER_PIN 64 - -#define LCD_PINS_RS 14 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 30 -#define LCD_PINS_D5 31 -#define LCD_PINS_D6 32 -#define LCD_PINS_D7 33 - -// Buttons are directly attached using keypad -#define BTN_EN1 61 -#define BTN_EN2 59 -#define BTN_ENC 43 - -// Buttons that are attached using shift register of reprapworld keypad v1.1 -#define SHIFT_CLK 63 -#define SHIFT_LD 42 -#define SHIFT_OUT 17 -#define SHIFT_EN 17 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 16 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 diff --git a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_3.h b/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_3.h deleted file mode 100644 index 119c63a585..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MEGATRONICS_3.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MegaTronics v3.0 / v3.1 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if MB(MEGATRONICS_31) - #define BOARD_NAME "Megatronics v3.1" -#else - #define BOARD_NAME "Megatronics v3.0" -#endif - -// -// Servos -// -#define SERVO0_PIN 46 // AUX3-6 -#define SERVO1_PIN 47 // AUX3-5 -#define SERVO2_PIN 48 // AUX3-4 -#define SERVO3_PIN 49 // AUX3-3 - -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 58 -#define X_DIR_PIN 57 -#define X_ENABLE_PIN 59 - -#define Y_STEP_PIN 5 -#define Y_DIR_PIN 17 -#define Y_ENABLE_PIN 4 - -#define Z_STEP_PIN 16 -#define Z_DIR_PIN 11 -#define Z_ENABLE_PIN 3 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 29 - -#define E1_STEP_PIN 25 -#define E1_DIR_PIN 24 -#define E1_ENABLE_PIN 26 - -#define E2_STEP_PIN 22 -#define E2_DIR_PIN 60 -#define E2_ENABLE_PIN 23 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 11 // Analog Input -#else - #define TEMP_0_PIN 15 // Analog Input -#endif -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 10 // Analog Input -#else - #define TEMP_1_PIN 13 // Analog Input -#endif -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 9 // Analog Input -#else - #define TEMP_2_PIN 12 // Analog Input -#endif -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif -#define FAN1_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 45 // Try the keypad connector - -// -// LCD / Controller -// -#define BEEPER_PIN 61 - -#define BTN_EN1 44 -#define BTN_EN2 45 -#define BTN_ENC 33 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 56 // CS chip select / SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #define SD_DETECT_PIN 35 - -#else - - #define LCD_PINS_RS 32 - #define LCD_PINS_ENABLE 31 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 30 - #define LCD_PINS_D6 39 - #define LCD_PINS_D7 15 - - #define SHIFT_CLK 43 - #define SHIFT_LD 35 - #define SHIFT_OUT 34 - #define SHIFT_EN 44 - - #if MB(MEGATRONICS_31) - #define SD_DETECT_PIN 56 - #endif - -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 43 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 42 -#elif EXTRUDERS <= 2 - // Hijack the last extruder so that we can get the PWM signal off the Y breakout - // Move Y to the E2 plug. This makes dual Y steppers harder - #undef Y_ENABLE_PIN // 4 - #undef Y_STEP_PIN // 5 - #undef Y_DIR_PIN // 17 - #undef E2_ENABLE_PIN // 23 - #undef E2_STEP_PIN // 22 - #undef E2_DIR_PIN // 60 - #define Y_ENABLE_PIN 23 - #define Y_STEP_PIN 22 - #define Y_DIR_PIN 60 - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 5 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_MELZI.h b/Marlin_thinkerV2/Marlin/pins_MELZI.h deleted file mode 100644 index 79042f61dc..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MELZI.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi pin assignments - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Melzi" -#endif - -#define IS_MELZI -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin/pins_MELZI_CREALITY.h b/Marlin_thinkerV2/Marlin/pins_MELZI_CREALITY.h deleted file mode 100644 index 8bfd3b860a..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MELZI_CREALITY.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi (Creality) pin assignments - * - * The Creality board needs a bootloader installed before Marlin can be uploaded. - * If you don't have a chip programmer you can use a spare Arduino plus a few - * electronic components to write the bootloader. - * - * See http://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/ - */ - -#define BOARD_NAME "Melzi (Creality)" - -#include "pins_MELZI.h" - -// For the stock CR-10 use the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -// option for the display in Configuration.h - -#undef LCD_SDSS -#undef LED_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef FIL_RUNOUT_PIN - -#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) -#define LCD_PINS_RS 28 // ST9720 CS -#define LCD_PINS_ENABLE 17 // ST9720 DAT -#define LCD_PINS_D4 30 // ST9720 CLK -#define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND - -// Alter timing for graphical display -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) -#endif - -#if ENABLED(MINIPANEL) - #undef DOGLCD_CS - #define DOGLCD_CS LCD_PINS_RS -#endif - -/** - PIN: 0 Port: B0 E0_DIR_PIN protected - PIN: 1 Port: B1 E0_STEP_PIN protected - PIN: 2 Port: B2 Z_DIR_PIN protected - PIN: 3 Port: B3 Z_STEP_PIN protected - PIN: 4 Port: B4 AVR_SS_PIN protected - . FAN_PIN protected - . SS_PIN protected - PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 - . MOSI_PIN Output = 1 - PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . MISO_PIN Input = 0 - PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SCK_PIN Output = 0 - PIN: 8 Port: D0 RXD Input = 1 - PIN: 9 Port: D1 TXD Input = 0 - PIN: 10 Port: D2 BTN_EN2 Input = 1 - PIN: 11 Port: D3 BTN_EN1 Input = 1 - PIN: 12 Port: D4 HEATER_BED_PIN protected - PIN: 13 Port: D5 HEATER_0_PIN protected - PIN: 14 Port: D6 E0_ENABLE_PIN protected - . X_ENABLE_PIN protected - . Y_ENABLE_PIN protected - PIN: 15 Port: D7 X_STEP_PIN protected - PIN: 16 Port: C0 BTN_ENC Input = 1 - . SCL Input = 1 - PIN: 17 Port: C1 LCD_PINS_ENABLE Output = 0 - . SDA Output = 0 - PIN: 18 Port: C2 X_MIN_PIN protected - . X_STOP_PIN protected - PIN: 19 Port: C3 Y_MIN_PIN protected - . Y_STOP_PIN protected - PIN: 20 Port: C4 Z_MIN_PIN protected - . Z_STOP_PIN protected - PIN: 21 Port: C5 X_DIR_PIN protected - PIN: 22 Port: C6 Y_STEP_PIN protected - PIN: 23 Port: C7 Y_DIR_PIN protected - PIN: 24 Port: A7 TEMP_0_PIN protected - PIN: 25 Port: A6 TEMP_BED_PIN protected - PIN: 26 Port: A5 Z_ENABLE_PIN protected - PIN: 27 Port: A4 BEEPER_PIN Output = 0 - PIN: 28 Port: A3 LCD_PINS_RS Output = 0 - PIN: 29 Port: A2 Input = 0 - PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 - PIN: 31 Port: A0 SDSS Output = 1 -*/ diff --git a/Marlin_thinkerV2/Marlin/pins_MELZI_MAKR3D.h b/Marlin_thinkerV2/Marlin/pins_MELZI_MAKR3D.h deleted file mode 100644 index 1b20d2ae09..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MELZI_MAKR3D.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi with ATmega1284 (MaKr3d version) pin assignments - */ - -#define BOARD_NAME "Melzi (ATmega1284)" -#include "pins_MELZI.h" diff --git a/Marlin_thinkerV2/Marlin/pins_MELZI_MALYAN.h b/Marlin_thinkerV2/Marlin/pins_MELZI_MALYAN.h deleted file mode 100644 index a81526f065..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MELZI_MALYAN.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi (Malyan M150) pin assignments - */ - -#define BOARD_NAME "Melzi (Malyan)" -#include "pins_MELZI.h" - -#undef LCD_SDSS -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC - -#define LCD_PINS_RS 17 // ST9720 CS -#define LCD_PINS_ENABLE 16 // ST9720 DAT -#define LCD_PINS_D4 11 // ST9720 CLK -#define BTN_EN1 30 -#define BTN_EN2 29 -#define BTN_ENC 28 - -// Alter timing for graphical display -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_MELZI_TRONXY.h b/Marlin_thinkerV2/Marlin/pins_MELZI_TRONXY.h deleted file mode 100644 index 0da7934302..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MELZI_TRONXY.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Melzi pin assignments - */ - -#define BOARD_NAME "Melzi (Tronxy)" -#include "pins_MELZI.h" - -#undef Z_ENABLE_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC -#undef LCD_SDSS - -#define Z_ENABLE_PIN 14 -#define LCD_PINS_RS 30 -#define LCD_PINS_ENABLE 28 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 17 -#define LCD_PINS_D6 27 -#define LCD_PINS_D7 29 -#define BTN_EN1 10 -#define BTN_EN2 11 -#define BTN_ENC 26 - -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_MIGHTYBOARD_REVE.h b/Marlin_thinkerV2/Marlin/pins_MIGHTYBOARD_REVE.h deleted file mode 100644 index 989533d53e..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MIGHTYBOARD_REVE.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mightyboard Rev.E pin assignments - */ - -/** - * - * This is a starting-point to support the Makerbot Replicator series of 3D printers. - * It's not functional because Marlin has limited support for some features. - * Marlin will need the following augmentations before it will be supportable: - * - * - Support for two or more MAX6675 thermocouples - * - Support for multiple i2c buses to control the MCP4018 digital pots - * - Support for one additional unidirectional SPI bus, to read the thermocouples - * - Support for an RGB LED that may work differently from BLINKM - * - * The MCP4018 requires separate I2C buses because it has a fixed address (0x2F << 1 = 0x5E) - * The thermocouples share the same SCK and DO pins, with their own CS pins. - * The controller interface port connects to a 3-wire shift-register display controller - * - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - * - * Corrected pin assignment for MOSFET_B_PIN pin. Changed it from 9 to 11. The port - * number (B5) agrees with the schematic but B5 is assigned to logical pin 11. - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "MB Replicator" -#define BOARD_NAME "Mightyboard" - -// -// Servos -// -#define SERVO0_PIN 36 // C1 (1280-EX1) -#define SERVO1_PIN 37 // C0 (1280-EX2) -#define SERVO2_PIN 40 // G1 (1280-EX3) -#define SERVO3_PIN 41 // G0 (1280-EX4) - -// -// Limit Switches -// -#define X_MIN_PIN 49 // L0 -#define X_MAX_PIN 48 // L1 -#define Y_MIN_PIN 47 // L2 -#define Y_MAX_PIN 46 // L3 -#define Z_MIN_PIN 43 // L6 -#define Z_MAX_PIN 42 // L7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 42 -#endif - -// -// Steppers -// -#define X_STEP_PIN 55 // F1 -#define X_DIR_PIN 54 // F0 -#define X_ENABLE_PIN 56 // F2 - -#define Y_STEP_PIN 59 // F5 -#define Y_DIR_PIN 58 // F4 -#define Y_ENABLE_PIN 60 // F6 - -#define Z_STEP_PIN 63 // K1 -#define Z_DIR_PIN 62 // K0 -#define Z_ENABLE_PIN 64 // K2 - -#define E0_STEP_PIN 25 // A3 -#define E0_DIR_PIN 24 // A2 -#define E0_ENABLE_PIN 26 // A4 - -#define E1_STEP_PIN 29 // A7 -#define E1_DIR_PIN 28 // A6 -#define E1_ENABLE_PIN 39 // G2 - -// -// I2C Digipots - MCP4018 -// Address 5E (2F << 1) -// Set from 0 - 127 with stop bit. -// (Ex. 3F << 1 | 1) -// -#define DIGIPOTS_I2C_SCL 76 // J5 -#define DIGIPOTS_I2C_SDA_X 57 // F3 -#define DIGIPOTS_I2C_SDA_Y 61 // F7 -#define DIGIPOTS_I2C_SDA_Z 65 // K3 -#define DIGIPOTS_I2C_SDA_E0 27 // A5 -#define DIGIPOTS_I2C_SDA_E1 77 // J6 -#define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) - -// -// Temperature Sensors -// -#define TEMP_BED_PIN 15 // K7 - 69 / ADC15 - 15 - -// SPI for Max6675 or Max31855 Thermocouple -// Uses a separate SPI bus -// -// 3 E5 DO (SO) -// 5 E3 CS1 -// 2 E4 CS2 -// 78 E2 SCK -// -#define THERMO_SCK_PIN 78 // E2 -#define THERMO_DO_PIN 3 // E5 -#define THERMO_CS1 5 // E3 -#define THERMO_CS2 2 // E4 - -#define MAX6675_SS THERMO_CS1 -#define MAX6675_SCK_PIN THERMO_SCK_PIN -#define MAX6675_DO_PIN THERMO_DO_PIN -// -// Augmentation for auto-assigning plugs -// -// Two thermocouple connectors allows for either -// 2 extruders or 1 extruder and a heated bed. -// With no heated bed, an additional 24V fan is possible. -// -#define MOSFET_A_PIN 6 // H3 -#define MOSFET_B_PIN 11 // B5 - Rev A of this file had this pin assigned to 9 -#define MOSFET_C_PIN 45 // L4 -#define MOSFET_D_PIN 44 // L5 - -#if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_EEB - #else - #define IS_EEF - #endif -#elif TEMP_SENSOR_BED - #define IS_EFB -#else - #define IS_EFF -#endif - -// -// Heaters / Fans (24V) -// -#define HEATER_0_PIN MOSFET_A_PIN - -#if ENABLED(IS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN MOSFET_C_PIN -#elif ENABLED(IS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN MOSFET_B_PIN -#elif ENABLED(IS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN -#elif ENABLED(IS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN MOSFET_C_PIN -#endif - -#ifndef FAN_PIN - #if ENABLED(IS_EFB) || ENABLED(IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN MOSFET_B_PIN - #elif ENABLED(IS_EEF) || ENABLED(IS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN MOSFET_C_PIN - #else - #define FAN_PIN MOSFET_D_PIN - #endif -#endif - -// -// Extruder Auto Fan Pins -// -#define ORIG_E0_AUTO_FAN_PIN 7 // H4 -#define ORIG_E1_AUTO_FAN_PIN 12 // B6 - -// -// Misc. Functions -// -#define LED_PIN 13 // B7 -#define CUTOFF_RESET_PIN 16 // H1 -#define CUTOFF_TEST_PIN 17 // H0 -#define CASE_LIGHT_PIN 44 // L5 MUST BE HARDWARE PWM - -// -// LCD / Controller -// -#ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - - #define LCD_PINS_RS 33 // C4: LCD-STROBE - #define LCD_PINS_ENABLE 72 // J2: LEFT - #define LCD_PINS_D4 35 // C2: LCD-CLK - #define LCD_PINS_D5 32 // C5: RLED - #define LCD_PINS_D6 34 // C3: LCD-DATA - #define LCD_PINS_D7 31 // C6: GLED - - #define BTN_EN2 75 // J4, UP - #define BTN_EN1 73 // J3, DOWN - //STOP button connected as KILL_PIN - #define KILL_PIN 14 // J1, RIGHT - //KILL - not connected - - #define BEEPER_PIN 8 // H5, SD_WP - - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER - - //on board leds - #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2) - #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3) - -#else - // Replicator uses a 3-wire SR controller with HD44780 - // For now, pretend it's the SAV - // - - #define SAV_3DLCD - #define SR_DATA_PIN 34 // C3 - #define SR_CLK_PIN 35 // C2 - #define SR_STROBE_PIN 33 // C4 - - #define BTN_UP 75 // J4 - #define BTN_DOWN 73 // J3 - #define BTN_LEFT 72 // J2 - #define BTN_RIGHT 14 // J1 - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER - - #define BEEPER_PIN 4 // G5 - - #define STAT_LED_RED_PIN 32 // C5 - #define STAT_LED_BLUE_PIN 31 // C6 (Actually green) - -#endif - -// -// SD Card -// -#define SDSS 53 // B0 -#define SD_DETECT_PIN 9 // H6 - -#define MAX_PIN THERMO_SCK_PIN - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 66 // K4 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 8 // H5 MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 67 // K5 - - -// Check if all pins are defined in mega/pins_arduino.h -#include -static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h" - "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below"); - -/* in [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h -change: -#define NUM_DIGITAL_PINS 70 -to: -#define NUM_DIGITAL_PINS 80 - -to digital_pin_to_port_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_port_PGM[] = { -.... - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** -}; - -to digital_pin_to_bit_mask_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { -.... - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** -}; - -to digital_pin_to_timer_PGM add at the end: -const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { -.... - NOT_ON_TIMER , // PG 4 ** 70 ** - NOT_ON_TIMER , // PG 3 ** 71 ** - NOT_ON_TIMER , // PJ 2 ** 72 ** - NOT_ON_TIMER , // PJ 3 ** 73 ** - NOT_ON_TIMER , // PJ 7 ** 74 ** - NOT_ON_TIMER , // PJ 4 ** 75 ** - NOT_ON_TIMER , // PJ 5 ** 76 ** - NOT_ON_TIMER , // PJ 6 ** 77 ** - NOT_ON_TIMER , // PE 2 ** 78 ** - NOT_ON_TIMER , // PE 6 ** 79 ** -}; -*/ diff --git a/Marlin_thinkerV2/Marlin/pins_MINIRAMBO.h b/Marlin_thinkerV2/Marlin/pins_MINIRAMBO.h deleted file mode 100644 index 89335ea8d4..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MINIRAMBO.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Mini-Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Rambo' selected from the 'Tools -> Boards' menu." -#endif - -#if MB(MINIRAMBO_10A) - #define BOARD_NAME "Mini Rambo 1.0a" -#else - #define BOARD_NAME "Mini Rambo" -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 30 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 24 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 23 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 23 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 - -#define MOTOR_CURRENT_PWM_XY_PIN 46 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 44 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_1_PIN 7 -#if !MB(MINIRAMBO_10A) - #define HEATER_2_PIN 6 -#endif -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#if !MB(MINIRAMBO_10A) - #define CASE_LIGHT_PIN 9 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 18 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#if !MB(MINIRAMBO_10A) - #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 -#endif - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #if !MB(MINIRAMBO_10A) - #define KILL_PIN 32 - #endif - - #if ENABLED(NEWPANEL) - - #if MB(MINIRAMBO_10A) - - #define BEEPER_PIN 78 - - #define BTN_EN1 80 - #define BTN_EN2 73 - #define BTN_ENC 21 - - #define LCD_PINS_RS 38 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 15 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 31 - - #define SD_DETECT_PIN 72 - - #else // !MINIRAMBO_10A - - // AUX-4 - #define BEEPER_PIN 84 - - // AUX-2 - #define BTN_EN1 14 - #define BTN_EN2 72 - #define BTN_ENC 9 - - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 - #define LCD_PINS_D4 19 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - - #define SD_DETECT_PIN 15 - - #endif // !MINIRAMBO_10A - - #endif // NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_MINITRONICS.h b/Marlin_thinkerV2/Marlin/pins_MINITRONICS.h deleted file mode 100644 index f5fdac21d2..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MINITRONICS.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Minitronics v1.0/1.1 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for M3, M4 & M5 spindle control commands - * - */ - -#ifndef __AVR_ATmega1281__ - #error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Minitronics v1.0 / v1.1" -// -// Limit Switches -// -#define X_MIN_PIN 5 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 2 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 6 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 48 -#define X_DIR_PIN 47 -#define X_ENABLE_PIN 49 - -#define Y_STEP_PIN 39 // A6 -#define Y_DIR_PIN 40 // A0 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 42 // A2 -#define Z_DIR_PIN 43 // A6 -#define Z_ENABLE_PIN 41 // A1 - -#define E0_STEP_PIN 45 -#define E0_DIR_PIN 44 -#define E0_ENABLE_PIN 27 - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 35 -#define E1_ENABLE_PIN 37 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input -#define TEMP_1_PIN 6 // Analog Input -#define TEMP_BED_PIN 6 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 7 // EXTRUDER 1 -#define HEATER_1_PIN 8 // EXTRUDER 2 -#define HEATER_BED_PIN 3 // BED - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif - -// -// Misc. Functions -// -#define SDSS 16 -#define LED_PIN 46 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 15 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 11 // SID (MOSI) - #define LCD_PINS_D4 10 // SCK (CLK) clock - - #define BTN_EN1 18 - #define BTN_EN2 17 - #define BTN_ENC 25 - - #define SD_DETECT_PIN 30 - -#else - - #define LCD_PINS_RS -1 - #define LCD_PINS_ENABLE -1 - - // Buttons are directly attached using keypad - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 - - #define SD_DETECT_PIN -1 // Minitronics doesn't use this -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) // assumes we're only doing CNC work (no 3D printing) - #undef HEATER_BED_PIN - #undef TEMP_BED_PIN // need to free up some pins but also need to - #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin - #undef TEMP_1_PIN // requires the presence of certain pins or else it - #define HEATER_BED_PIN 4 // won't compile - #define TEMP_BED_PIN 50 - #define TEMP_0_PIN 51 - #define SPINDLE_LASER_ENABLE_PIN 52 // using A6 because it already has a pullup - #define SPINDLE_LASER_PWM_PIN 3 // WARNING - LED & resistor pull up to +12/+24V stepper voltage - #define SPINDLE_DIR_PIN 53 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_MKS_BASE.h b/Marlin_thinkerV2/Marlin/pins_MKS_BASE.h deleted file mode 100644 index 65c78e1486..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MKS_BASE.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments - * - * Rev B - Override pin definitions for CASE_LIGHT and M3/M4/M5 spindle control - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS BASE 1.0" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#define CASE_LIGHT_PIN 2 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 15 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_MKS_BASE_15.h b/Marlin_thinkerV2/Marlin/pins_MKS_BASE_15.h deleted file mode 100644 index e9f7050a1b..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MKS_BASE_15.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE v1.5 with A4982 stepper drivers and digital micro-stepping - */ - -#include "pins_MKS_BASE.h" - -/** - * Microstepping pins - */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 / SERVO2_PIN -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 / SERVO1_PIN -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 / SERVO3_PIN diff --git a/Marlin_thinkerV2/Marlin/pins_MKS_BASE_HEROIC.h b/Marlin_thinkerV2/Marlin/pins_MKS_BASE_HEROIC.h deleted file mode 100644 index 84f7280dfa..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MKS_BASE_HEROIC.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS BASE with Heroic HR4982 stepper drivers - */ - -#include "pins_MKS_BASE_15.h" - -/** - * Some new boards use HR4982 (Heroic) instead of the A4982 (Allegro) stepper drivers. - * Most the functionality is similar, the HR variant obviously doesn't work with diode - * smoothers (no fast decay). And the Heroic has a 128 µStepping mode where the A4982 - * is doing quarter steps (MS1=0, MS2=1). - */ -#define HEROIC_STEPPER_DRIVERS diff --git a/Marlin_thinkerV2/Marlin/pins_MKS_GEN_13.h b/Marlin_thinkerV2/Marlin/pins_MKS_GEN_13.h deleted file mode 100644 index e0e916b878..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MKS_GEN_13.h +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 adjusted pin assignments - * - * MKS GEN v1.3 (Extruder, Fan, Bed) - * MKS GEN v1.3 (Extruder, Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Extruder, Fan, Bed) - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS GEN >= v1.3" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// PSU / SERVO -// -// If POWER_SUPPLY is specified, always hijack Servo 3 -// -#if POWER_SUPPLY > 0 - #define SERVO3_PIN -1 - #define PS_ON_PIN 4 -#endif - -#include "pins_RAMPS.h" - -// -// LCD / Controller -// -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - /** - * VIKI2 Has two groups of wires with... - * - * +Vin + Input supply, requires 120ma for LCD and mSD card - * GND Ground Pin - * MOSI Data input for LCD and SD - * MISO Data output for SD - * SCK Clock for LCD and SD - * AO Reg. Sel for LCD - * LCS Chip Select for LCD - * SDCS Chip Select for SD - * SDCD Card Detect pin for SD - * ENCA Encoder output A - * ENCB Encoder output B - * ENCBTN Encoder button switch - * - * BTN Panel mounted button switch - * BUZZER Piezo buzzer - * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered) - * RED-LED Red LED ring pin (3 to 5v, mosfet buffered) - * - * This configuration uses the following arrangement: - * - * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK - * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS - * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI - * D27 = A0 D29 = LCS D49 = SDCD RST = --- - * GND = GND 5V = 5V GND = --- D41 = --- - */ - - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef SD_DETECT_PIN - #undef BEEPER_PIN - #undef KILL_PIN - - // - // VIKI2 12-wire lead - // - - // orange/white SDCD - #define SD_DETECT_PIN 49 - - // white ENCA - #define BTN_EN1 35 - - // green ENCB - #define BTN_EN2 37 - - // purple ENCBTN - #define BTN_ENC 31 - - // brown A0 - #define DOGLCD_A0 27 - - // green/white LCS - #define DOGLCD_CS 29 - - // 50 gray MISO - // 51 yellow MOSI - // 52 orange SCK - - // blue SDCS - //#define SDSS 53 - - // - // VIKI2 4-wire lead - // - - // blue BTN - #define KILL_PIN 23 - - // green BUZZER - #define BEEPER_PIN 25 - - // yellow RED-LED - #define STAT_LED_RED_PIN 16 - - // white BLUE-LED - #define STAT_LED_BLUE_PIN 17 - -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_MKS_GEN_L.h b/Marlin_thinkerV2/Marlin/pins_MKS_GEN_L.h deleted file mode 100644 index 59c5bcf481..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_MKS_GEN_L.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * MKS GEN L – Arduino Mega2560 with RAMPS v1.4 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "MKS GEN L" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// CS Pins wired to avoid conflict with the LCD -// See https://www.thingiverse.com/asset:66604 -// - -#ifndef X_CS_PIN - #define X_CS_PIN 59 -#endif - -#ifndef Y_CS_PIN - #define Y_CS_PIN 63 -#endif - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_OMCA.h b/Marlin_thinkerV2/Marlin/pins_OMCA.h deleted file mode 100644 index 6ee6fabe6b..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_OMCA.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Open Motion controller with enable based extruders (Final!) - * - * ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - * REF http://sanguino.cc/hardware - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. (Final OMCA board)" -#endif - -#define BOARD_NAME "Final OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 25 -#define X_ENABLE_PIN 10 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 27 -#define Y_ENABLE_PIN 10 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 10 - -#define E0_STEP_PIN 24 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 10 - -#define E1_STEP_PIN -1 // 21 -#define E1_DIR_PIN -1 // 20 -#define E1_ENABLE_PIN -1 // 19 - -#define E2_STEP_PIN -1 // 21 -#define E2_DIR_PIN -1 // 20 -#define E2_ENABLE_PIN -1 // 18 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 // DONE PWM on RIGHT connector -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 14 // PWM on MIDDLE connector -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -#define I2C_SCL_PIN 16 -#define I2C_SDA_PIN 17 - -// future proofing -#define __FS 20 -#define __FD 19 -#define __GS 18 -#define __GD 13 - -#define UNUSED_PWM 14 // PWM on LEFT connector diff --git a/Marlin_thinkerV2/Marlin/pins_OMCA_A.h b/Marlin_thinkerV2/Marlin/pins_OMCA_A.h deleted file mode 100644 index 777c80b22f..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_OMCA_A.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Open Motion controller with enable based extruders (Alpha!) - * - * ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644__ - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Alpha OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 -#define X_DIR_PIN 20 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN -1 // 19 -#define E1_DIR_PIN -1 // 18 -#define E1_ENABLE_PIN 24 - -#define E2_STEP_PIN -1 // 17 -#define E2_DIR_PIN -1 // 16 -#define E2_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (D27) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD.h b/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD.h deleted file mode 100644 index 42632d174a..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD.h +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Printrboard" - -// Disable JTAG pins so they can be used for the Extrudrboard -#define DISABLE_JTAG - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 20 // B0 SS -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_1_PIN 44 // F6 -#define HEATER_2_PIN 45 // F7 -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 26 // B6 SDCS -#define FILWIDTH_PIN 2 // Analog Input - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 8 // E0 JP11-10 - - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #undef SDSS - #define SDSS 43 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 3 // D3 RX1 JP2-7 - #define BTN_EN2 2 // D2 TX1 JP2-5 - #define BTN_ENC 41 // F3 JP2-4 - #undef SDSS - #define SDSS 38 // F0 B-THERM connector - use SD card on Panelolu2 - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif // ULTRA_LCD && NEWPANEL diff --git a/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD_REVF.h deleted file mode 100644 index 8239a91586..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_PRINTRBOARD_REVF.h +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - https://www.pjrc.com/teensy/teensyduino.html - * Installation - https://www.pjrc.com/teensy/td_download.html - * - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Note: With Teensyduino extension, the Arduino IDE will report 130048 bytes of program storage space available, - * but there is actually only 122880 bytes due to the larger DFU bootloader shipped by default on all Printrboard RevF. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular and easiest option. - */ - -/** - * To burn the bootloader that comes with Printrboard HID extension: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef USBCON - #error "USBCON should be defined by the platform for this board." -#endif - -#define BOARD_NAME "Printrboard Rev.F" -// Disable JTAG pins so EXP1 pins work correctly -// (Its pins are used for the Extrudrboard and filament sensor, for example). -#define DISABLE_JTAG - -/** - * Note that REV F6 of the Printrboard stole the A HOTEND pin and - * reassigned it to a second fan for the extruder heater. It's - * recommended that you swap the A and B outputs on the Extrudrboard - * so EXTRUDERS=2 will still work on F6, using B for E1/HEATER_1/TEMP_1. - * See https://printrbot.zendesk.com/hc/en-us/articles/115003072346 - * - * If you have REV F6 you probably also want to set E0_AUTO_FAN_PIN - * to PRINTRBOARD_F6_HEATER_FAN_PIN (44). - * - * Define NO_EXTRUDRBOARD if you don't have an EXTRUDRBOARD and wish to - * reassign different functions to EXP1. - * - * Define NO_EXTRUDRBOARD_OUTPUT_SWAP if you have a REV F5 or lower and - * want to use EXTRUDRBOARD A for E1 and EXTRUDRBOARD B for E2. - */ -//#define NO_EXTRUDRBOARD -//#define NO_EXTRUDRBOARD_OUTPUT_SWAP - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 24 // B4 PWM2A -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define E1_STEP_PIN 25 // B5 - #define E1_DIR_PIN 37 // E5 - #define E1_ENABLE_PIN 42 // F4 - - #define E2_STEP_PIN 2 // D2 - #define E2_DIR_PIN 3 // D3 - #define E2_ENABLE_PIN 43 // F5 -#else - #define E1_STEP_PIN 2 // D2 - #define E1_DIR_PIN 3 // D3 - #define E1_ENABLE_PIN 43 // F5 - - #define E2_STEP_PIN 25 // B5 - #define E2_DIR_PIN 37 // E5 - #define E2_ENABLE_PIN 42 // F4 -#endif -#endif // NO_EXTRUDRBOARD - -// Enable control of stepper motor currents with the I2C based MCP4728 DAC used on Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Set default drive strength percents if not already defined - X, Y, Z, E axis -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 70, 50, 70 } -#endif - -// Number of channels available for DAC -#define DAC_STEPPER_ORDER { 3, 2, 1, 0 } - -#define DAC_STEPPER_SENSE 0.11 -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 3520 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 1x = 2.048V -#define DAC_STEPPER_GAIN 0 -#define DAC_OR_ADDRESS 0x00 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input (Extruder) -#define TEMP_BED_PIN 0 // Analog Input (Bed) - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define TEMP_1_PIN 2 // Analog Input (Extrudrboard A THERM) - #define TEMP_2_PIN 3 // Analog Input (Extrudrboard B THERM) -#else - #define TEMP_1_PIN 3 // Analog Input (Extrudrboard B THERM) - #define TEMP_2_PIN 2 // Analog Input (Extrudrboard A THERM) -#endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define HEATER_1_PIN 44 // F6 - Extrudrboard A HOTEND - #define HEATER_2_PIN 45 // F7 - Extrudrboard B HOTEND -#else - #define HEATER_1_PIN 45 // F7 - Extrudrboard B HOTEND - #define HEATER_2_PIN 44 // F6 - Extrudrboard A HOTEND -#endif -#endif - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// LCD / Controller -// -//#define USE_INTERNAL_SD - -#if ENABLED(ULTRA_LCD) - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - - #define BEEPER_PIN 8 // E0 JP11-10 - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #define SDSS 3 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(MINIPANEL) - - #if DISABLED(USE_INTERNAL_SD) - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define SDSS 11 // 36 C1 EXP2-13 EXP2-07 - #define SD_DETECT_PIN 9 // 34 E1 EXP2-11 EXP2-04 - #endif - - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define DOGLCD_A0 4 // 29 D4 EXP2-05 EXP1-04 - #define DOGLCD_CS 5 // 30 D5 EXP2-06 EXP1-05 - #define BTN_ENC 6 // 31 D6 EXP2-07 EXP1-09 - #define BEEPER_PIN 7 // 32 D7 EXP2-08 EXP1-10 - #define KILL_PIN 8 // 33 E0 EXP2-10 EXP2-03 - #define BTN_EN1 10 // 35 C0 EXP2-12 EXP2-06 - #define BTN_EN2 12 // 37 C2 EXP2-14 EXP2-08 - //#define LCD_BACKLIGHT_PIN 43 // 56 F5 EXP1-12 Not Implemented - //#define SCK 21 // 11 B1 ICSP-04 EXP2-09 - //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 - //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 - - // increase delays - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(313) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(313) - #endif - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif - -// -// Misc. Functions -// -// PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. -#ifndef SDSS - #define SDSS 20 // 10 B0 -#endif - -/** - * This is EXP1-2, which is also the TEMP_A_PIN for the Extrudrboard. - * If using w/ Extrudrboard, cut off pin 2 on the Extrudrboard male - * connector to ensure this is disconnected from the A THERM pullups. - * You probably want to set EXTRUDERS=2 and swap the Extrudrboard outputs, - * which will let you use Channel B on the Extrudrboard as E1. - */ -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 2 // Analog Input -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_RAMBO.h b/Marlin_thinkerV2/Marlin/pins_RAMBO.h deleted file mode 100644 index fb88612e3a..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMBO.h +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * IMPORTANT NOTE: - * Rambo users should be sure to compile Marlin using either the RAMBo - * board type if using the Arduino IDE - available via the link below - or - * the 'rambo' environment if using platformio, by specifying '-e rambo' on - * the command line or by changing the value of the 'env_default' variable to - * 'rambo' in the supplied platformio.ini. - * - * If you don't compile using the proper board type, the RAMBo's extended - * pins will likely be unavailable and accessories/addons may not work. - * - * Instructions for installing the Arduino RAMBo board type for the - * Arduino IDE are available at: - * http://reprap.org/wiki/Rambo_firmware - */ - -/** - * Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Rambo" - -#define POWER_LOSS_DETECT_PIN 44 -#define FIL_RUNOUT_PIN 22 - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MAX_PIN 30 - -#if ENABLED(BLTOUCH) - #define Z_MIN_PIN 22 -#elif ENABLED(FIX_MOUNTED_PROBE) - #define Z_MIN_PIN 24 -#else - - #define Z_MIN_PIN 10 -#endif - - -// -// Servos -// -#define SERVO0_PIN 4/* X_MAX_PIN//22 // Motor header MX1*/ -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - - #define X_HARDWARE_SERIAL Serial1 -// //#define X2_HARDWARE_SERIAL Serial1 - #define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - #define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - #define E0_HARDWARE_SERIAL Serial1 - - - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS { 4,5,3,0,1 } // X Y Z E0 E1 digipot channels to stepper driver mapping -#ifndef DIGIPOT_MOTOR_CURRENT - #define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 6 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 2 -#define FAN2_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 -#define CASE_LIGHT_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 31 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 32 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 84 // 84 in MK2 Firmware - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define KILL_PIN 80 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 70 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 72 - #define LCD_PINS_D5 73 - #define LCD_PINS_D6 74 - #define LCD_PINS_D7 75 - - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 - // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the - // beeper/buzzer is connected to pin 33; however, the pin used in the - // diagram is actually pin 44, so this is correct. - - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 85 - #define BTN_EN2 84 - #define BTN_ENC 83 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 - - #else // !VIKI2 && !miniVIKI - - #define BEEPER_PIN 79 - - // AUX-2 - #define BTN_EN1 63 - #define BTN_EN2 64 - #define BTN_ENC 78 - - #define SD_DETECT_PIN 81 - - #endif // !VIKI2 && !miniVIKI - - #else // !NEWPANEL - old style panel with shift register - - // No Beeper added - #define BEEPER_PIN 33 - - // buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - - #define LCD_PINS_RS 75 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_RAMPS.h b/Marlin_thinkerV2/Marlin/pins_RAMPS.h deleted file mode 100644 index 20d1cba520..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMPS.h +++ /dev/null @@ -1,572 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4" -#endif - -// -// Servos -// -#ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI -#else - #define SERVO0_PIN 11 -#endif -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 -#ifndef SERVO3_PIN - #define SERVO3_PIN 4 -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -/** - * Default pins for TMC software SPI - */ -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif - -#if HAS_DRIVER(TMC2208) - /** - * TMC2208 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - /** - * Software serial - */ - - #define X_SERIAL_TX_PIN 40 - #define X_SERIAL_RX_PIN 63 - #define X2_SERIAL_TX_PIN -1 - #define X2_SERIAL_RX_PIN -1 - - #define Y_SERIAL_TX_PIN 59 - #define Y_SERIAL_RX_PIN 64 - #define Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 - - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 - #define Z2_SERIAL_TX_PIN -1 - #define Z2_SERIAL_RX_PIN -1 - - #define E0_SERIAL_TX_PIN 44 - #define E0_SERIAL_RX_PIN 66 - #define E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif -#ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN 8 -#endif -#ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN 9 -#endif -#ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN 10 -#endif - -#define HEATER_0_PIN RAMPS_D10_PIN - -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN RAMPS_D9_PIN -#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN RAMPS_D8_PIN -#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") - #define HEATER_BED_PIN RAMPS_D8_PIN - #if HOTENDS == 1 - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif - -#ifndef FAN_PIN - #if ENABLED(IS_RAMPS_EFB) || ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #elif ENABLED(IS_RAMPS_EEF) || ENABLED(IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN - #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define FAN_PIN 4 // IO pin. Buffer needed - #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #endif -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif - -// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENABLE_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ - && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first - #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 5 - #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \ - && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2 - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN -#endif - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -#if ENABLED(ULTRA_LCD) - - // - // LCD Display output pins - // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - - #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) - - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - - #else - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 25 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 37 - #endif - - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - - #else - - #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #endif - - #define LCD_PINS_D7 29 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - #endif - - #endif - - #if DISABLED(NEWPANEL) - // Buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - - #endif - - // - // LCD Display input pins - // - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 - #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #endif - - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS SDSS - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - #define BTN_ENC -1 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - - #elif ENABLED(VIKI2) || ENABLED(miniVIKI) - - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN 33 - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - #define KILL_PIN 31 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 - - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 - - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BEEPER_PIN 37 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD_PIN 12 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons are directly attached using AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #endif - - #endif - #endif // NEWPANEL - -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/pins_RAMPS_13.h b/Marlin_thinkerV2/Marlin/pins_RAMPS_13.h deleted file mode 100644 index effce90706..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMPS_13.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.3 pin assignments - * - * Applies to the following boards: - * - * RAMPS_13_EFB (Extruder, Fan, Bed) - * RAMPS_13_EEB (Extruder, Extruder, Bed) - * RAMPS_13_EFF (Extruder, Fan, Fan) - * RAMPS_13_EEF (Extruder, Extruder, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.3" -#endif - -#define IS_RAMPS_13 -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_RAMPS_ENDER_4.h b/Marlin_thinkerV2/Marlin/pins_RAMPS_ENDER_4.h deleted file mode 100644 index a14ace25ba..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMPS_ENDER_4.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "Ender-4 supports only 1 hotend / E-stepper. Comment out this line to continue." -#endif - -#define BOARD_NAME "Ender-4" - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_RAMPS_OLD.h b/Marlin_thinkerV2/Marlin/pins_RAMPS_OLD.h deleted file mode 100644 index da047e2b0a..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMPS_OLD.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.0, v1.1, v1.2 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "MEGA/RAMPS <1.2" - -// Uncomment the following line for RAMPS v1.0 -//#define RAMPS_V_1_0 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 16 -#define Y_MAX_PIN 17 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 38 -#define Y_DIR_PIN 40 -#define Y_ENABLE_PIN 36 - -#define Z_STEP_PIN 44 -#define Z_DIR_PIN 46 -#define Z_ENABLE_PIN 42 - -#define E0_STEP_PIN 32 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#if ENABLED(RAMPS_V_1_0) - #define HEATER_0_PIN 12 - #define HEATER_BED_PIN -1 - #ifndef FAN_PIN - #define FAN_PIN 11 - #endif -#else // RAMPS_V_1_1 or RAMPS_V_1_2 - #define HEATER_0_PIN 10 - #define HEATER_BED_PIN 8 - #ifndef FAN_PIN - #define FAN_PIN 9 - #endif -#endif - -// -// Misc. Functions -// -#define SDPOWER 48 -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // MUST BE HARDWARE PWM - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 43 diff --git a/Marlin_thinkerV2/Marlin/pins_RAMPS_PLUS.h b/Marlin_thinkerV2/Marlin/pins_RAMPS_PLUS.h deleted file mode 100644 index 77e0e140c0..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RAMPS_PLUS.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments - * The differences to the RAMPS v1.4 are: - * - Swap heater E0 with E1 - * - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10. - * - Change pins 16->42, 17->44 and 29->53 used for display. - * - * Applies to the following boards: - * - * RAMPS_PLUS_EFB (Extruder, Fan, Bed) - * RAMPS_PLUS_EEB (Extruder, Extruder, Bed) - * RAMPS_PLUS_EFF (Extruder, Fan, Fan) - * RAMPS_PLUS_EEF (Extruder, Extruder, Fan) - * RAMPS_PLUS_SF (Spindle, Controller Fan) - * - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4 Plus" -#endif - -#define RAMPS_D8_PIN 10 -#define RAMPS_D10_PIN 8 - -#include "pins_RAMPS.h" - -// -// Steppers - Swap E0 / E1 on 3DYMY -// -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN - -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#undef X_CS_PIN -#undef Y_CS_PIN -#undef Z_CS_PIN -#undef E0_CS_PIN -#undef E1_CS_PIN - -#if ENABLED(ULTRA_LCD) && DISABLED(REPRAPWORLD_GRAPHICAL_LCD) && (DISABLED(NEWPANEL) || DISABLED(PANEL_ONE)) && DISABLED(CR10_STOCKDISPLAY) - #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #undef LCD_PINS_RS - #define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42 - #undef LCD_PINS_ENABLE - #define LCD_PINS_ENABLE 44 // 3DYMY boards pin 17 -> 44 - #endif - #undef LCD_PINS_D7 - #define LCD_PINS_D7 53 // 3DYMY boards pin 29 -> 53 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD.h b/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD.h deleted file mode 100644 index e985963505..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments - */ - -#define BOARD_NAME "RigidBoard" - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops -#endif - -// -// MOSFET changes -// -#define RAMPS_D10_PIN 9 // EXTRUDER 1 -#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN - -#include "pins_RAMPS.h" - -// -// Steppers -// -// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3 -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#define STEPPER_RESET_PIN 41 // Stepper drivers have a reset on RigidBot - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#undef TEMP_BED_PIN -#define TEMP_0_PIN 14 // Analog Input -#define TEMP_1_PIN 13 // Analog Input -#define TEMP_BED_PIN 15 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS -#if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#undef HEATER_BED_PIN -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 8 // Same as RAMPS_13_EEF -#endif - -// -// Misc. Functions -// -#undef PS_ON_PIN -#define PS_ON_PIN -1 - -// -// LCD / Controller -// -// LCD Panel options for the RigidBoard -#if ENABLED(RIGIDBOT_PANEL) - - #undef BEEPER_PIN - #define BEEPER_PIN -1 - - // Direction buttons - #define BTN_UP 37 - #define BTN_DWN 35 - #define BTN_LFT 33 - #define BTN_RT 32 - - // 'R' button - #undef BTN_ENC - #define BTN_ENC 31 - - // Disable encoder - #undef BTN_EN1 - #define BTN_EN1 -1 - #undef BTN_EN2 - #define BTN_EN2 -1 - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - -#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - - #undef KILL_PIN - #define KILL_PIN 32 - -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD_V2.h b/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD_V2.h deleted file mode 100644 index 2075892ab8..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RIGIDBOARD_V2.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#include "pins_RIGIDBOARD.h" - -#undef BOARD_NAME -#define BOARD_NAME "RigidBoard V2" - -// -// Steppers -// - -// I2C based DAC like on the Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Channels available for DAC, For Rigidboard there are 4 -#define DAC_STEPPER_ORDER { 0, 1, 2, 3 } - -#define DAC_STEPPER_SENSE 0.05 // sense resistors on rigidboard stepper chips are .05 value -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 4096 // was 5000 but max allowable value is actually 4096 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 2x = 4.096V -#define DAC_STEPPER_GAIN 1 // value of 1 here sets gain of 2 -#define DAC_DISABLE_PIN 42 // set low to enable DAC -#define DAC_OR_ADDRESS 0x01 - -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_RUMBA.h b/Marlin_thinkerV2/Marlin/pins_RUMBA.h deleted file mode 100644 index 160dae55b8..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_RUMBA.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * RUMBA pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." -#endif - -#define DEFAULT_MACHINE_NAME "Rumba" -#define BOARD_NAME "Rumba" - -// -// Servos -// -#define SERVO0_PIN 5 - -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 36 -#define Y_MIN_PIN 35 -#define Y_MAX_PIN 34 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 22 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 25 -#define E1_ENABLE_PIN 27 - -#define E2_STEP_PIN 29 -#define E2_DIR_PIN 28 -#define E2_ENABLE_PIN 39 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 6 // Analog Input (connector *K1* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input (connector *K2* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) -#endif - -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 7 // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_BED is defined as thermocouple) -#else - #define TEMP_2_PIN 13 // Analog Input (default connector for thermistor *T2* on rumba board is used) -#endif - -// 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) - -#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) -#else - #define TEMP_BED_PIN 11 // Analog Input (default connector for thermistor *THB* on rumba board is used) -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 8 -#define HEATER_BED_PIN 9 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#define FAN1_PIN 8 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 45 -#define KILL_PIN 46 -#define CASE_LIGHT_PIN 45 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#ifndef SPINDLE_LASER_PWM_PIN - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM. Pin 4 interrupts OC0* and OC1* always in use? -#endif -#ifndef SPINDLE_LASER_ENABLE_PIN - #define SPINDLE_LASER_ENABLE_PIN 14 // Pin should have a pullup! -#endif -#ifndef SPINDLE_DIR_PIN - #define SPINDLE_DIR_PIN 15 -#endif - -// -// LCD / Controller -// -#define SD_DETECT_PIN 49 -#define BEEPER_PIN 44 -#define LCD_PINS_D7 40 -#define BTN_EN1 11 -#define BTN_EN2 12 -#define BTN_ENC 43 - -#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 38 // Set as output on init - #define LCD_PINS_RS 41 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 19 - #define DOGLCD_MOSI 42 - #define DOGLCD_SCK 18 - #define DOGLCD_A0 LCD_PINS_DC -#else - #define LCD_PINS_RS 19 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 18 - #define LCD_PINS_D5 38 - #define LCD_PINS_D6 41 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_SAINSMART_2IN1.h b/Marlin_thinkerV2/Marlin/pins_SAINSMART_2IN1.h deleted file mode 100644 index 53d1a3e95b..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SAINSMART_2IN1.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sainsmart 2-in-1 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_NAME "Sainsmart" - -// -// Heaters / Fans -// -#define RAMPS_D10_PIN 9 // E -#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat - // RAMPS_D8_PIN 8 // B -#define MOSFET_D_PIN 10 // F / E - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_11.h b/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_11.h deleted file mode 100644 index 0d9af5b5a8..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_11.h +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sanguinololu board pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu <1.2" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) - -#if ENABLED(SANGUINOLOLU_V_1_2) - - #define HEATER_BED_PIN 12 // (bed) - #define X_ENABLE_PIN 14 - #define Y_ENABLE_PIN 14 - #define Z_ENABLE_PIN 26 - #define E0_ENABLE_PIN 14 - - #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2) - #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan - #endif - -#else - - #define HEATER_BED_PIN 14 // (bed) - #define X_ENABLE_PIN -1 - #define Y_ENABLE_PIN -1 - #define Z_ENABLE_PIN -1 - #define E0_ENABLE_PIN -1 - -#endif - -#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI)) - #define FAN_PIN 4 // Works for Panelolu2 too -#endif - -// -// Misc. Functions -// - -/** - * In some versions of the Sanguino libraries the pin - * definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi). - * If you encounter issues with these pins, upgrade your - * Sanguino libraries! See #368. - */ -//#define SDSS 24 -#define SDSS 31 - -#if ENABLED(IS_MELZI) - #define LED_PIN 27 -#elif MB(STB_11) - #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED -#endif - -#if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available -#endif - -/** - * Sanguinololu 1.4 AUX pins: - * - * PWM TX1 RX1 SDA SCL - * 12V 5V D12 D11 D10 D17 D16 - * GND GND D31 D30 D29 D28 D27 - * A4 A3 A2 A1 A0 - */ - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #if ENABLED(DOGLCD) - - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 - - #if ENABLED(IS_MELZI) - #define LCD_PINS_RS 30 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 29 // SID (MOSI) - #define LCD_PINS_D4 17 // SCK (CLK) clock - // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with - // Marlin so this can be used for BEEPER_PIN. You can use this pin - // with M42 instead of BEEPER_PIN. - #define BEEPER_PIN 27 - #else // Sanguinololu >=1.3 - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - #endif - - #else // DOGM SPI LCD Support - - #define DOGLCD_A0 30 - #define LCD_CONTRAST 1 - - #if ENABLED(MAKRPANEL) - - #define BEEPER_PIN 29 - #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN 28 // PA3 - - #elif ENABLED(IS_MELZI) - - #define BEEPER_PIN 27 - #define DOGLCD_CS 28 - - #else // !MAKRPANEL - - #define DOGLCD_CS 29 - - #endif - - #endif - - // Uncomment screen orientation - #define LCD_SCREEN_ROT_0 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #else // !DOGLCD - - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - - #endif // !DOGLCD - - #define BTN_EN1 11 - #define BTN_EN2 10 - - #if ENABLED(LCD_I2C_PANELOLU2) - - #if ENABLED(IS_MELZI) - #define BTN_ENC 29 - #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi - #else - #define BTN_ENC 30 - #endif - - #elif ENABLED(LCD_FOR_MELZI) - - #define LCD_PINS_RS 17 - #define LCD_PINS_ENABLE 16 - #define LCD_PINS_D4 11 - #define BTN_ENC 28 - #define BTN_EN1 29 - #define BTN_EN2 30 - - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(188) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) - #endif - - #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards - - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define ADC_KEYPAD_PIN 1 - - // Not used - #define BTN_EN1 -1 - #define BTN_EN2 -1 - - #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD - - #define BTN_ENC 16 - #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi - - #endif - - #define SD_DETECT_PIN -1 - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header - - #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN 11 - - #elif !MB(MELZI) // use X stepper motor socket - - /** - * To control the spindle speed and have an LCD you must sacrifice - * the Extruder and pull some signals off the X stepper driver socket. - * - * The following assumes: - * - The X stepper driver socket is empty - * - The extruder driver socket has a driver board plugged into it - * - The X stepper wires are attached the the extruder connector - */ - - /** - * Where to get the spindle signals - * - * spindle signal socket name socket name - * ------- - * /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_LASER_ENABLE_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor. - */ - #undef X_DIR_PIN - #undef X_ENABLE_PIN - #undef X_STEP_PIN - #define X_DIR_PIN 0 - #define X_ENABLE_PIN 14 - #define X_STEP_PIN 1 - #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup! - #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin - #endif -#endif // SPINDLE_LASER_ENABLE diff --git a/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_12.h b/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_12.h deleted file mode 100644 index f648dce085..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SANGUINOLOLU_12.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sanguinololu V1.2 pin assignments - * - * Applies to the following boards: - * - * AZTEEG_X1 - * MELZI - * MELZI_CREALITY - * MELZI_MAKR3D - * SANGUINOLOLU_12 - * STB_11 - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu 1.2" -#endif - -#define SANGUINOLOLU_V_1_2 -#include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin_thinkerV2/Marlin/pins_SAV_MKI.h b/Marlin_thinkerV2/Marlin/pins_SAV_MKI.h deleted file mode 100644 index 8945594495..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SAV_MKI.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "SAV MkI" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" -#define BOARD_NAME "SAV MkI" - -// -// Servos -// -#define SERVO0_PIN 39 // F1 In teensy's pin definition for pinMode (in servo.cpp) - -// -// Limit Switches -// -#define X_STOP_PIN 25 // B5 -#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 For inductive sensor. -//#define E_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - Bed - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -// Extension header pin mapping -// ---------------------------- -// SCL (I2C)-D0 A0 (An), IO -// SDA (I2C)-D1 A1 (An), IO -// RX1-D2 A2 (An), IO -// TX1-D3 A3 (An), IO -// PWM-D24 A4 (An), IO -// 5V GND -// 12V GND -#define EXT_AUX_SCL_D0 0 // D0 PWM0B -#define EXT_AUX_SDA_D1 1 // D1 -#define EXT_AUX_RX1_D2 2 // D2 -#define EXT_AUX_TX1_D3 3 // D3 -#define EXT_AUX_PWM_D24 24 // B4 PWM2A -#define EXT_AUX_A0 0 // F0 Analog Input -#define EXT_AUX_A0_IO 38 // F0 Digital IO -#define EXT_AUX_A1 1 // F1 Analog Input -#define EXT_AUX_A1_IO 39 // F1 Digital IO -#define EXT_AUX_A2 2 // F2 Analog Input -#define EXT_AUX_A2_IO 40 // F2 Digital IO -#define EXT_AUX_A3 3 // F3 Analog Input -#define EXT_AUX_A3_IO 41 // F3 Digital IO -#define EXT_AUX_A4 4 // F4 Analog Input -#define EXT_AUX_A4_IO 42 // F4 Digital IO - -// -// LCD / Controller -// -#define BEEPER_PIN -1 -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 - -#if ENABLED(SAV_3DLCD) - // For LCD SHIFT register LCD - #define SR_DATA_PIN EXT_AUX_SDA_D1 - #define SR_CLK_PIN EXT_AUX_SCL_D0 -#endif - -#if ENABLED(SAV_3DLCD) || ENABLED(SAV_3DGLCD) - - #define BTN_EN1 EXT_AUX_A1_IO - #define BTN_EN2 EXT_AUX_A0_IO - #define BTN_ENC EXT_AUX_PWM_D24 - - #define KILL_PIN EXT_AUX_A2_IO - #define HOME_PIN EXT_AUX_A4_IO - -#else // Use the expansion header for spindle control - - // - // M3/M4/M5 - Spindle/Laser Control - // - #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A - #define SPINDLE_LASER_ENABLE_PIN 39 // F1 Pin should have a pullup! - #define SPINDLE_DIR_PIN 40 // F2 - - #define CASE_LIGHT_PIN 0 // D0 PWM0B - -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_SCOOVO_X9H.h b/Marlin_thinkerV2/Marlin/pins_SCOOVO_X9H.h deleted file mode 100644 index ea6685def4..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SCOOVO_X9H.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/************************************************ - * Rambo pin assignments MODIFIED FOR Scoovo X9H - ************************************************/ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Scoovo X9H" - -// -// Servos -// -#define SERVO0_PIN 22 // Motor header MX1 -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_BED_PIN 7 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 -#define FAN2_PIN 2 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// LCD / Controller -// -#define LCD_PINS_RS 70 // Ext2_5 -#define LCD_PINS_ENABLE 71 // Ext2_7 -#define LCD_PINS_D4 72 // Ext2_9 ? -#define LCD_PINS_D5 73 // Ext2_11 ? -#define LCD_PINS_D6 74 // Ext2_13 -#define LCD_PINS_D7 75 // Ext2_15 ? -#define BEEPER_PIN -1 - -#define BTN_HOME 80 // Ext_16 -#define BTN_CENTER 81 // Ext_14 -#define BTN_ENC BTN_CENTER -#define BTN_RIGHT 82 // Ext_12 -#define BTN_LEFT 83 // Ext_10 -#define BTN_UP 84 // Ext2_8 -#define BTN_DOWN 85 // Ext2_6 - -#define HOME_PIN BTN_HOME - -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 -#endif // VIKI2/miniVIKI diff --git a/Marlin_thinkerV2/Marlin/pins_SETHI.h b/Marlin_thinkerV2/Marlin/pins_SETHI.h deleted file mode 100644 index 801560e5e3..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SETHI.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Sethi 3D_1 pin assignments - www.sethi3d.com.br - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * this assumes that this board uses the Sanguino pin map - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Make sure you have 'Sethi 3D' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Sethi 3D_1" - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 2 -#define Y_STOP_PIN 0 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #if GEN7_VERSION >= 13 - // Gen7 v1.3 removed the fan pin - #define FAN_PIN -1 - #else - #define FAN_PIN 31 - #endif -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -// our pin for debugging. -#define DEBUG_PIN 0 - -// our RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 diff --git a/Marlin_thinkerV2/Marlin/pins_SILVER_GATE.h b/Marlin_thinkerV2/Marlin/pins_SILVER_GATE.h deleted file mode 100644 index 005c4c6eca..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_SILVER_GATE.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#if !defined(__AVR_ATmega1281__) && !defined(__AVR_ATmega2561__) - #error Oops! Make sure you have 'Silvergate' selected from the 'Tools -> Boards' menu. -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "Silver Gate" -#endif - -#define X_STEP_PIN 43 -#define X_DIR_PIN 44 -#define X_ENABLE_PIN 42 -#define X_MIN_PIN 31 -#define X_MAX_PIN 34 - -#define Y_STEP_PIN 40 -#define Y_DIR_PIN 41 -#define Y_ENABLE_PIN 39 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 35 - -#define Z_STEP_PIN 13 -#define Z_DIR_PIN 38 -#define Z_ENABLE_PIN 14 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 36 - -#define E0_STEP_PIN 27 -#define E0_DIR_PIN 37 -#define E0_ENABLE_PIN 45 - -#define SDSS 16 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 34 // X_MAX unless overridden -#endif - -#ifndef FAN_PIN - #define FAN_PIN 5 -#endif - -#define HEATER_0_PIN 7 - -#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN -#define CONTROLLER_FAN_PIN 2 - -#define TEMP_0_PIN 7 // Analog Input - -#define HEATER_BED_PIN 8 -#define TEMP_BED_PIN 6 - -#if ENABLED(DOGLCD) - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 - #define LCD_PINS_RS 30 - #define LCD_PINS_ENABLE 20 - #define LCD_PINS_D4 25 - #define BEEPER_PIN 29 - #define BTN_EN1 19 - #define BTN_EN2 22 - #define BTN_ENC 24 - #define LCD_BACKLIGHT_PIN 6 - #if ENABLED(SILVER_GATE_GLCD_CONTROLLER) - #define KILL_PIN 21 - #define HOME_PIN 28 - #endif - #endif -#endif - -#define SD_DETECT_PIN 15 - -#define STAT_LED_RED_PIN 23 -#define STAT_LED_BLUE_PIN 26 -#define CASE_LIGHT_PIN 51 diff --git a/Marlin_thinkerV2/Marlin/pins_STB_11.h b/Marlin_thinkerV2/Marlin/pins_STB_11.h deleted file mode 100644 index de769fcb68..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_STB_11.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * STB V1.1 pin assignments - */ - -#define BOARD_NAME "STB V1.1" -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin/pins_TEENSY2.h b/Marlin_thinkerV2/Marlin/pins_TEENSY2.h deleted file mode 100644 index 736be6f73e..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_TEENSY2.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Teensy++ 2.0 Breadboard pin assignments (AT90USB1286) - * Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! - * http://www.pjrc.com/teensy/teensyduino.html - * See http://reprap.org/wiki/Printrboard for more info - * - * CLI build: HARDWARE_MOTHERBOARD=84 make - * - * DaveX plan for Teensylu/printrboard-type pinouts for a TeensyBreadboard: - * (ref teensylu & sprinter) - * - * USB - * GND GND |-----#####-----| +5V ATX +5SB - * ATX PS_ON PWM 27 |b7 ##### b6| 26 PWM* Stepper Enable - * PWM 0 |d0 b5| 25 PWM* - * PWM 1 |d1 b4| 24 PWM - * X_MIN 2 |d2 b3| 23 MISO_PIN - * Y_MIN 3 |d3 b2| 22 MOSI_PIN - * Z_MIN 4 |d4 * * b1| 21 SCK_PIN - * 5 |d5 e e b0| 20 SDSS - * LED 6 |d6 5 4 e7| 19 - * 7 |d7 e6| 18 - * LCD RS 8 |e0 | GND - * LCD EN 9 |e1 a4 a0 R| AREF - * LCD D4 10 |c0 a5 a1 f0| 38 A0 ENC_1 - * LCD D5 11 |c1 a6 a2 f1| 39 A1 ENC_2 - * LCD D6 12 |c2 a7 a3 f2| 40 A2 ENC_CLK - * LCD D6 13 |c3 f3| 41 A3 - * Bed Heat PWM 14 |c4 V G R f4| 42 A4 - * Extruder Heat PWM 15 |c5 c n S f5| 43 A5 - * Fan PWM 16 |c6 c d T f6| 44 A6 Bed TC - * 17 |c7 * * * f7| 45 A7 Extruder TC * 4.7k * +5 - * ----------------- - * - * Interior E4: 36, INT4 - * Interior E5: 37, INT5 - * Interior PA0-7: 28-35 -- Printrboard and Teensylu use these pins for step & direction: - * T++ PA Signal Marlin - * - * Z STEP 32 a4 a0 28 X STEP - * Z DIR 33 a5 a1 29 X DIR - * E STEP 34 a6 a2 30 Y STEP - * E DIR 35 a7 a3 31 Y DIR - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Teensy++2.0" - -// -// Limit Switches -// -#define X_STOP_PIN 2 // D2 -#define Y_STOP_PIN 3 // D3 -#define Z_STOP_PIN 4 // D4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 Marlin -#define X_DIR_PIN 29 // A1 Marlin -#define X_ENABLE_PIN 26 // B6 - -#define Y_STEP_PIN 30 // A2 Marlin -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 26 // B6 Shared w/x - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 26 // B6 Shared w/x - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 26 // B6 Shared w/x - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A Fan -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define LED_PIN 6 // D6 -#define PS_ON_PIN 27 // B7 -#define CASE_LIGHT_PIN 1 // D1 PWM2B MUST BE HARDWARE PWM - -// -// LCD / Controller -// -#if ENABLED(ULTIPANEL) - #define LCD_PINS_RS 8 // E0 - #define LCD_PINS_ENABLE 9 // E1 - #define LCD_PINS_D4 10 // C0 - #define LCD_PINS_D5 11 // C1 - #define LCD_PINS_D6 12 // C2 - #define LCD_PINS_D7 13 // C3 - #define BTN_EN1 38 // F0 - #define BTN_EN2 39 // F1 - #define BTN_ENC 40 // F2 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENABLE_PIN 5 // D5 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 7 // D7 diff --git a/Marlin_thinkerV2/Marlin/pins_TEENSYLU.h b/Marlin_thinkerV2/Marlin/pins_TEENSYLU.h deleted file mode 100644 index e733b98287..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_TEENSYLU.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. All have been used with Arduino 1.6.12 - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * This is basically Teensyduino but with a bootloader that can handle image sizes - * larger than 64K. - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools -> Boards' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - - /** - * SILKSCREEN ERROR - * - * The silkscreen for the endstops do NOT match the schematic. The silkscreen SHOULD - * read (from left to right) X-STOP, Y-STOP, Z-STOP & E-STOP. The silkscreen actually - * reads E-STOP, X-STOP, Y-STOP & Z-STOP. - * - * The pin assignments in this file match the silkscreen. - */ - -#if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1286P__) - #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu." -#endif - -#define BOARD_NAME "Teensylu" - -// -// Limit Switch definitions that match the SCHEMATIC -// -//#define X_STOP_PIN 25 // B5 -//#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -//#define E_STOP_PIN 36 // E4 - - -// -// Limit Switch definitions that match the SILKSCREEN -// -#define X_STOP_PIN 26 // B6 -#define Y_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 -//#define E_STOP_PIN 25 // B5 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (Extruder) -#define TEMP_BED_PIN 6 // Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 JP31-6 -#define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - - #define BEEPER_PIN -1 - - #if ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 3 // D3 IO-8 - #define BTN_EN2 2 // D2 IO-10 - #define BTN_ENC 41 // F3 IO-7 - #define SDSS 38 // F0 IO-13 use SD card on Panelolu2 - #endif - - #define SD_DETECT_PIN -1 - -#endif // ULTRA_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 24 // B4 IO-3 PWM2A - MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 39 // F1 IO-11 - Pin should have a pullup! -#define SPINDLE_DIR_PIN 40 // F2 IO-9 diff --git a/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_13.h b/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_13.h deleted file mode 100644 index 0907eaf286..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_13.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.3 for Anycubic - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.3" -#endif - -#define IS_RAMPS_EFB -#define RAMPS_D9_PIN 44 -#define FAN2_PIN 9 -#define ORIG_E0_AUTO_FAN_PIN 9 - -#include "pins_RAMPS_13.h" - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#undef E1_CS_PIN diff --git a/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_14.h b/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_14.h deleted file mode 100644 index 70b0a930a9..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_TRIGORILLA_14.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 for Anycubic - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.4" -#endif - -#define IS_RAMPS_EFB - -#define FAN2_PIN 44 -#define ORIG_E0_AUTO_FAN_PIN 44 - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin/pins_ULTIMAIN_2.h b/Marlin_thinkerV2/Marlin/pins_ULTIMAIN_2.h deleted file mode 100644 index ea7a8325c0..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ULTIMAIN_2.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultiboard v2.0 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker 2.x" - -// -// Limit Switches -// -#define X_STOP_PIN 22 -#define Y_STOP_PIN 26 -#define Z_STOP_PIN 29 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 32 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 36 -#define Z_ENABLE_PIN 34 - -#define E0_STEP_PIN 42 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -#define MOTOR_CURRENT_PWM_XY_PIN 44 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 46 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 39 -#define LED_PIN 8 -#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered -#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. - -// -// LCD / Controller -// -#define BEEPER_PIN 18 - -#define LCD_PINS_RS 20 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 14 -#define LCD_PINS_D5 21 -#define LCD_PINS_D6 5 -#define LCD_PINS_D7 6 - -// Buttons are directly attached -#define BTN_EN1 40 -#define BTN_EN2 41 -#define BTN_ENC 19 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) // use the LED_PIN for spindle speed control or case light - #undef LED_PIN - #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_LASER_PWM_PIN 8 // MUST BE HARDWARE PWM -#else - #undef LED_PIN - #define CASE_LIGHT_PIN 8 -#endif diff --git a/Marlin_thinkerV2/Marlin/pins_ULTIMAKER.h b/Marlin_thinkerV2/Marlin/pins_ULTIMAKER.h deleted file mode 100644 index 23941a1624..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ULTIMAKER.h +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultimaker pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker" - -// -// Servos -// -#define SERVO0_PIN 11 - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // PIN that has to be turned on right after start, to keep power flowing. -#define CASE_LIGHT_PIN 8 - -// -// LCD / Controller -// -#if ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // buttons are directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // buttons are attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header diff --git a/Marlin_thinkerV2/Marlin/pins_ULTIMAKER_OLD.h b/Marlin_thinkerV2/Marlin/pins_ULTIMAKER_OLD.h deleted file mode 100644 index c07f2d0e75..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ULTIMAKER_OLD.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Ultimaker pin assignments (Old electronics) - */ - - /** - * Rev B 3 JAN 2017 - * - * Details on pin definitions for M3, M4 & M5 spindle control commands and for - * the CASE_LIGHT_PIN are at the end of this file. - * - * This started out as an attempt to add pin definitions for M3, M4 & M5 spindle - * control commands but quickly turned into a head scratcher as the sources for - * the revisions provided inconsistent information. - * - * As best I can determine: - * 1.5.3 boards should use the pins_ULTIMAKER.h file which means the BOARD_NAME - * define in this file should say 1.5.3 rather than 1.5.4 - * This file is meant for 1.1 - 1.3 boards. - * The endstops for the 1.0 boards use different definitions than on the 1.1 - 1.3 - * boards. - * - * I've added sections that have the 1.0 and 1.5.3 + endstop definitions so you can - * easily switch if needed. I've also copied over the 1.5.3 + LCD definitions. - * - * To be 100% sure of the board you have: - * 1. In Configuration_adv.h enable "PINS_DEBUGGING" - * 2. Compile & uploade - * 3. Enter the command "M43 W1 I1". This command will report that pin nmumber and - * name of any pin that changes state. - * 4. Using a 1k (approximately) resistor pull the endstops and some of the LCD pins - * to ground and see what is reported. - * 5. If the reported pin doesn't match the file then try a different board revision - * and repeat steps 2 - 5 - */ - -#define board_rev_1_1_TO_1_3 -//#define board_rev_1_0 -//#define board_rev_1_5 - - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." -#endif - -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker <1.5.4" - -// -// Limit Switches -// -#if ENABLED(board_rev_1_1_TO_1_3) - #define X_MIN_PIN 15 // SW1 - #define X_MAX_PIN 14 // SW2 - #define Y_MIN_PIN 17 // SW3 - #define Y_MAX_PIN 16 // SW4 - #define Z_MIN_PIN 19 // SW5 - #define Z_MAX_PIN 18 // SW6 -#endif - -#if ENABLED(board_rev_1_0) - #define X_MIN_PIN 13 // SW1 - #define X_MAX_PIN 12 // SW2 - #define Y_MIN_PIN 11 // SW3 - #define Y_MAX_PIN 10 // SW4 - #define Z_MIN_PIN 9 // SW5 - #define Z_MAX_PIN 8 // SW6 -#endif - -#if ENABLED(board_rev_1_5) - #define X_MIN_PIN 22 - #define X_MAX_PIN 24 - #define Y_MIN_PIN 26 - #define Y_MAX_PIN 28 - #define Z_MIN_PIN 30 - #define Z_MAX_PIN 32 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN Z_MAX_PIN -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN -1 // 49 -#define E1_DIR_PIN -1 // 47 -#define E1_ENABLE_PIN -1 // 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 1 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -//#define HEATER_1_PIN 3 // used for case light Rev A said "1" -#define HEATER_BED_PIN 4 - -// -// LCD / Controller -// -#if ENABLED(board_rev_1_0) || ENABLED(board_rev_1_1_TO_1_3) - #define LCD_PINS_RS 24 - #define LCD_PINS_ENABLE 22 - #define LCD_PINS_D4 36 - #define LCD_PINS_D5 34 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 30 -#elif ENABLED(board_rev_1_5) && ENABLED(ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // buttons are directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // buttons are attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // ULTRA_LCD - -// -// case light - see spindle section for more info on available hardware PWMs -// -#if !PIN_EXISTS(CASE_LIGHT) && ENABLED(board_rev_1_5) - #define CASE_LIGHT_PIN 7 // use PWM - MUST BE HARDWARE PWM -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) - - #if ENABLED(board_rev_1_0) // use the last three SW positions - - #undef Z_MIN_PROBE_PIN - #undef X_MIN_PIN // SW1 - #undef X_MAX_PIN // SW2 - #undef Y_MIN_PIN // SW3 - #undef Y_MAX_PIN // SW4 - #undef Z_MIN_PIN // SW5 - #undef Z_MAX_PIN // SW6 - - #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM - #define Y_STOP_PIN 12 // SW2 - #define Z_STOP_PIN 11 // SW3 - - #define SPINDLE_DIR_PIN 10 // SW4 - #define SPINDLE_LASER_PWM_PIN 9 // SW5 MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // SW6 Pin should have a pullup! - - #elif ENABLED(board_rev_1_5) // use the same pins - but now they are on a different connector - - #define SPINDLE_DIR_PIN 10 // EXP3-6 (silkscreen says 10) - #define SPINDLE_LASER_PWM_PIN 9 // EXP3-7 (silkscreen says 9) MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 8 // EXP3-8 (silkscreen says 8) Pin should have a pullup! - - #elif ENABLED(board_rev_1_1_TO_1_3) - - /** - * Only four hardware PWMs physically connected to anything on these boards: - * - * HEATER_0_PIN 2 silkscreen varies - usually "PWM 1" or "HEATER1" - * HEATER_1_PIN 3 silkscreen varies - usually "PWM 2" or "HEATER2" - * HEATER_BED_PIN 4 silkscreen varies - usually "PWM 3" or "HEATED BED" - * E0_DIR_PIN 45 - * - * If one of the heaters is used then special precautions will usually be needed. - * They have an LED and resistor pullup to +24V which could damage 3.3V-5V ICs. - */ - #if EXTRUDERS == 1 // Move E0 stepper module to the spare and get signals from E0 - #undef E0_STEP_PIN - #undef E0_DIR_PIN - #undef E0_ENABLE_PIN - #define E0_STEP_PIN 49 - #define E0_DIR_PIN 47 - #define E0_ENABLE_PIN 48 - #define SPINDLE_DIR_PIN 43 - #define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup! - #elif TEMP_SENSOR_BED == 0 // Can't use E0 so see if HEATER_BED_PIN is available - #undef HEATER_BED_PIN - #define SPINDLE_DIR_PIN 38 // Probably pin 4 on 10 pin connector closest to the E0 socket - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM - Special precautions usually needed. - #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup! (Probably pin 6 on the 10-pin - // connector closest to the E0 socket) - #endif - #endif -#endif - -/** - * Where to get the spindle signals on the E0 socket - * - * spindle signal socket name socket name - * ------- - * SPINDLE_LASER_ENABLE_PIN /ENABLE *| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_DIR_PIN STEP O| |O VDD - * SPINDLE_LASER_PWM_PIN DIR O| |O GND - * ------- - * * - pin closest to MS1, MS2 & MS3 jumpers on the board - * - * Note: Socket names vary from vendor to vendor. - */ diff --git a/Marlin_thinkerV2/Marlin/pins_ZRIB_V20.h b/Marlin_thinkerV2/Marlin/pins_ZRIB_V20.h deleted file mode 100644 index 94a083dd40..0000000000 --- a/Marlin_thinkerV2/Marlin/pins_ZRIB_V20.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * ZRIB V2.0 pin assignments - */ - -#define ZRIB_V20_D6_PIN 6 -#define ZRIB_V20_D9_PIN 9 -#define RAMPS_D9_PIN ZRIB_V20_D6_PIN -#define ORIG_E0_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E1_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E2_AUTO_FAN_PIN ZRIB_V20_D9_PIN -#define ORIG_E3_AUTO_FAN_PIN ZRIB_V20_D9_PIN - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // Analog Input -#endif - -#include "pins_MKS_GEN_13.h" diff --git a/Marlin_thinkerV2/Marlin/planner.cpp b/Marlin_thinkerV2/Marlin/planner.cpp deleted file mode 100644 index 515ddc33a3..0000000000 --- a/Marlin_thinkerV2/Marlin/planner.cpp +++ /dev/null @@ -1,2625 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner.cpp - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * The ring buffer implementation gleaned from the wiring_serial library by David A. Mellis. - * - * - * Reasoning behind the mathematics in this module (in the key of 'Mathematica'): - * - * s == speed, a == acceleration, t == time, d == distance - * - * Basic definitions: - * Speed[s_, a_, t_] := s + (a*t) - * Travel[s_, a_, t_] := Integrate[Speed[s, a, t], t] - * - * Distance to reach a specific speed with a constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, d, t] - * d -> (m^2 - s^2)/(2 a) --> estimate_acceleration_distance() - * - * Speed after a given distance of travel with constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, m, t] - * m -> Sqrt[2 a d + s^2] - * - * DestinationSpeed[s_, a_, d_] := Sqrt[2 a d + s^2] - * - * When to start braking (di) to reach a specified destination speed (s2) after accelerating - * from initial speed s1 without ever stopping at a plateau: - * Solve[{DestinationSpeed[s1, a, di] == DestinationSpeed[s2, a, d - di]}, di] - * di -> (2 a d - s1^2 + s2^2)/(4 a) --> intersection_distance() - * - * IntersectionDistance[s1_, s2_, a_, d_] := (2 a d - s1^2 + s2^2)/(4 a) - * - * -- - * - * The fast inverse function needed for Bézier interpolation for AVR - * was designed, written and tested by Eduardo José Tagle on April/2018 - */ - -#include "planner.h" -#include "stepper.h" -#include "temperature.h" -#include "ultralcd.h" -#include "language.h" -#include "parser.h" - -#include "Marlin.h" - -#if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.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 - -Planner planner; - - // public: - -/** - * A ring buffer of moves described in steps - */ -block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; -volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed - Planner::block_buffer_nonbusy, // Index of the first non-busy block - Planner::block_buffer_planned, // Index of the optimally planned block - Planner::block_buffer_tail; // Index of the busy block, if any -uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks -uint8_t Planner::delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - -uint32_t Planner::max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - Planner::max_acceleration_steps_per_s2[XYZE_N], // (steps/s^2) Derived from mm_per_s2 - Planner::min_segment_time_us; // (µs) M205 B - -float Planner::max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - Planner::axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - Planner::steps_to_mm[XYZE_N], // (mm) Millimeters per step - Planner::min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - Planner::acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. - Planner::retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes - Planner::travel_acceleration, // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. - Planner::min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate - -#if ENABLED(JUNCTION_DEVIATION) - float Planner::junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - float Planner::max_e_jerk; - #endif - #endif -#else - float Planner::max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. -#endif - -#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - bool Planner::abort_on_endstop_hit = false; -#endif - -#if ENABLED(DISTINCT_E_FACTORS) - uint8_t Planner::last_extruder = 0; // Respond to extruder change - #define _EINDEX (E_AXIS + active_extruder) -#else - #define _EINDEX E_AXIS -#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 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 - Planner::volumetric_area_nominal = CIRCLE_AREA(float(DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5f), // Nominal cross-sectional area - Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner -#endif - -#if HAS_LEVELING - bool Planner::leveling_active = false; // Flag that auto bed leveling is enabled - #if ABL_PLANAR - matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float Planner::z_fade_height, // Initialized by settings.load() - Planner::inverse_z_fade_height, - Planner::last_fade_z; - #endif -#else - constexpr bool Planner::leveling_active; -#endif - -#if ENABLED(SKEW_CORRECTION) - #if ENABLED(SKEW_CORRECTION_GCODE) - float Planner::xy_skew_factor; - #else - constexpr float Planner::xy_skew_factor; - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) && ENABLED(SKEW_CORRECTION_GCODE) - float Planner::xz_skew_factor, Planner::yz_skew_factor; - #else - constexpr float Planner::xz_skew_factor, Planner::yz_skew_factor; - #endif -#endif - -#if ENABLED(AUTOTEMP) - float Planner::autotemp_max = 250, - Planner::autotemp_min = 210, - Planner::autotemp_factor = 0.1f; - bool Planner::autotemp_enabled = false; -#endif - -// private: - -int32_t Planner::position[NUM_AXIS] = { 0 }; - -uint32_t Planner::cutoff_long; - -float Planner::previous_speed[NUM_AXIS], - Planner::previous_nominal_speed_sqr; - -#if ENABLED(DISABLE_INACTIVE_EXTRUDER) - uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; -#endif - -#ifdef XY_FREQUENCY_LIMIT - // Old direction bits. Used for speed calculations - unsigned char Planner::old_direction_bits = 0; - // Segment times (in µs). Used for speed calculations - uint32_t Planner::axis_segment_time_us[2][3] = { { MAX_FREQ_TIME_US + 1, 0, 0 }, { MAX_FREQ_TIME_US + 1, 0, 0 } }; -#endif - -#if ENABLED(LIN_ADVANCE) - float Planner::extruder_advance_K; // Initialized by settings.load() -#endif - -#if HAS_POSITION_FLOAT - float Planner::position_float[XYZE]; // Needed for accurate maths. Steps cannot be used! -#endif - -#if ENABLED(ULTRA_LCD) - volatile uint32_t Planner::block_buffer_runtime_us = 0; -#endif - -/** - * Class and Instance Methods - */ - -Planner::Planner() { init(); } - -void Planner::init() { - ZERO(position); - #if HAS_POSITION_FLOAT - ZERO(position_float); - #endif - ZERO(previous_speed); - previous_nominal_speed_sqr = 0; - #if ABL_PLANAR - bed_level_matrix.set_to_identity(); - #endif - clear_block_buffer(); - delay_before_delivering = 0; -} - -#if ENABLED(S_CURVE_ACCELERATION) - - /** - * This routine returns 0x1000000 / d, getting the inverse as fast as possible. - * A fast-converging iterative Newton-Raphson method can reach full precision in - * just 1 iteration, and takes 211 cycles (worst case; the mean case is less, up - * to 30 cycles for small divisors), instead of the 500 cycles a normal division - * would take. - * - * Inspired by the following page: - * https://stackoverflow.com/questions/27801397/newton-raphson-division-with-big-integers - * - * Suppose we want to calculate floor(2 ^ k / B) where B is a positive integer - * Then, B must be <= 2^k, otherwise, the quotient is 0. - * - * The Newton - Raphson iteration for x = B / 2 ^ k yields: - * q[n + 1] = q[n] * (2 - q[n] * B / 2 ^ k) - * - * This can be rearranged to: - * q[n + 1] = q[n] * (2 ^ (k + 1) - q[n] * B) >> k - * - * Each iteration requires only integer multiplications and bit shifts. - * It doesn't necessarily converge to floor(2 ^ k / B) but in the worst case - * it eventually alternates between floor(2 ^ k / B) and ceil(2 ^ k / B). - * So it checks for this case and extracts floor(2 ^ k / B). - * - * A simple but important optimization for this approach is to truncate - * multiplications (i.e., calculate only the higher bits of the product) in the - * early iterations of the Newton - Raphson method. This is done so the results - * of the early iterations are far from the quotient. Then it doesn't matter if - * they are done inaccurately. - * It's important to pick a good starting value for x. Knowing how many - * digits the divisor has, it can be estimated: - * - * 2^k / x = 2 ^ log2(2^k / x) - * 2^k / x = 2 ^(log2(2^k)-log2(x)) - * 2^k / x = 2 ^(k*log2(2)-log2(x)) - * 2^k / x = 2 ^ (k-log2(x)) - * 2^k / x >= 2 ^ (k-floor(log2(x))) - * floor(log2(x)) is simply the index of the most significant bit set. - * - * If this estimation can be improved even further the number of iterations can be - * reduced a lot, saving valuable execution time. - * The paper "Software Integer Division" by Thomas L.Rodeheffer, Microsoft - * Research, Silicon Valley,August 26, 2008, available at - * https://www.microsoft.com/en-us/research/wp-content/uploads/2008/08/tr-2008-141.pdf - * suggests, for its integer division algorithm, using a table to supply the first - * 8 bits of precision, then, due to the quadratic convergence nature of the - * Newton-Raphon iteration, just 2 iterations should be enough to get maximum - * precision of the division. - * By precomputing values of inverses for small denominator values, just one - * Newton-Raphson iteration is enough to reach full precision. - * This code uses the top 9 bits of the denominator as index. - * - * The AVR assembly function implements this C code using the data below: - * - * // For small divisors, it is best to directly retrieve the results - * if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - * - * // Compute initial estimation of 0x1000000/x - - * // Get most significant bit set on divider - * uint8_t idx = 0; - * uint32_t nr = d; - * if (!(nr & 0xFF0000)) { - * nr <<= 8; idx += 8; - * if (!(nr & 0xFF0000)) { nr <<= 8; idx += 8; } - * } - * if (!(nr & 0xF00000)) { nr <<= 4; idx += 4; } - * if (!(nr & 0xC00000)) { nr <<= 2; idx += 2; } - * if (!(nr & 0x800000)) { nr <<= 1; idx += 1; } - * - * // Isolate top 9 bits of the denominator, to be used as index into the initial estimation table - * uint32_t tidx = nr >> 15, // top 9 bits. bit8 is always set - * ie = inv_tab[tidx & 0xFF] + 256, // Get the table value. bit9 is always set - * x = idx <= 8 ? (ie >> (8 - idx)) : (ie << (idx - 8)); // Position the estimation at the proper place - * - * x = uint32_t((x * uint64_t(_BV(25) - x * d)) >> 24); // Refine estimation by newton-raphson. 1 iteration is enough - * const uint32_t r = _BV(24) - x * d; // Estimate remainder - * if (r >= d) x++; // Check whether to adjust result - * return uint32_t(x); // x holds the proper estimation - * - */ - static uint32_t get_period_inverse(uint32_t d) { - - static const uint8_t inv_tab[256] PROGMEM = { - 255,253,252,250,248,246,244,242,240,238,236,234,233,231,229,227, - 225,224,222,220,218,217,215,213,212,210,208,207,205,203,202,200, - 199,197,195,194,192,191,189,188,186,185,183,182,180,179,178,176, - 175,173,172,170,169,168,166,165,164,162,161,160,158,157,156,154, - 153,152,151,149,148,147,146,144,143,142,141,139,138,137,136,135, - 134,132,131,130,129,128,127,126,125,123,122,121,120,119,118,117, - 116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101, - 100,99,98,97,96,95,94,93,92,91,90,89,88,88,87,86, - 85,84,83,82,81,80,80,79,78,77,76,75,74,74,73,72, - 71,70,70,69,68,67,66,66,65,64,63,62,62,61,60,59, - 59,58,57,56,56,55,54,53,53,52,51,50,50,49,48,48, - 47,46,46,45,44,43,43,42,41,41,40,39,39,38,37,37, - 36,35,35,34,33,33,32,32,31,30,30,29,28,28,27,27, - 26,25,25,24,24,23,22,22,21,21,20,19,19,18,18,17, - 17,16,15,15,14,14,13,13,12,12,11,10,10,9,9,8, - 8,7,7,6,6,5,5,4,4,3,3,2,2,1,0,0 - }; - - // For small denominators, it is cheaper to directly store the result. - // For bigger ones, just ONE Newton-Raphson iteration is enough to get - // maximum precision we need - static const uint32_t small_inv_tab[111] PROGMEM = { - 16777216,16777216,8388608,5592405,4194304,3355443,2796202,2396745,2097152,1864135,1677721,1525201,1398101,1290555,1198372,1118481, - 1048576,986895,932067,883011,838860,798915,762600,729444,699050,671088,645277,621378,599186,578524,559240,541200, - 524288,508400,493447,479349,466033,453438,441505,430185,419430,409200,399457,390167,381300,372827,364722,356962, - 349525,342392,335544,328965,322638,316551,310689,305040,299593,294337,289262,284359,279620,275036,270600,266305, - 262144,258111,254200,250406,246723,243148,239674,236298,233016,229824,226719,223696,220752,217885,215092,212369, - 209715,207126,204600,202135,199728,197379,195083,192841,190650,188508,186413,184365,182361,180400,178481,176602, - 174762,172960,171196,169466,167772,166111,164482,162885,161319,159783,158275,156796,155344,153919,152520 - }; - - // For small divisors, it is best to directly retrieve the results - if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - - register uint8_t r8 = d & 0xFF, - r9 = (d >> 8) & 0xFF, - r10 = (d >> 16) & 0xFF, - r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18; - register const uint8_t* ptab = inv_tab; - - __asm__ __volatile__( - // %8:%7:%6 = interval - // r31:r30: MUST be those registers, and they must point to the inv_tab - - A("clr %13") // %13 = 0 - - // Now we must compute - // result = 0xFFFFFF / d - // %8:%7:%6 = interval - // %16:%15:%14 = nr - // %13 = 0 - - // A plain division of 24x24 bits should take 388 cycles to complete. We will - // use Newton-Raphson for the calculation, and will strive to get way less cycles - // for the same result - Using C division, it takes 500cycles to complete . - - A("clr %3") // idx = 0 - A("mov %14,%6") - A("mov %15,%7") - A("mov %16,%8") // nr = interval - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") - A("mov %15,%14") // nr <<= 8, %14 not needed - A("subi %3,-8") // idx += 8 - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") // nr <<= 8, %14 not needed - A("clr %15") // We clear %14 - A("subi %3,-8") // idx += 8 - - // here %16 != 0 and %16:%15 contains at least 9 MSBits, or both %16:%15 are 0 - L("2") - A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? - A("brcc 3f") // No, skip this - A("swap %15") // Swap nibbles - A("swap %16") // Swap nibbles. Low nibble is 0 - A("mov %14, %15") - A("andi %14,0x0F") // Isolate low nibble - A("andi %15,0xF0") // Keep proper nibble in %15 - A("or %16, %14") // %16:%15 <<= 4 - A("subi %3,-4") // idx += 4 - - L("3") - A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? - A("brcc 4f") // No, skip this - A("add %15,%15") - A("adc %16,%16") - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 2 - A("subi %3,-2") // idx += 2 - - L("4") - A("cpi %16,0x80") // (nr & 0x800000) == 0 ? - A("brcc 5f") // No, skip this - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 1 - A("inc %3") // idx += 1 - - // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure - // we have at least 9 MSBits available to enter the initial estimation table - L("5") - A("add %15,%15") - A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) - A("add r30,%16") // Only use top 8 bits - A("adc r31,%13") // r31:r30 = inv_tab + (tidx) - A("lpm %14, Z") // %14 = inv_tab[tidx] - A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 - - // We must scale the approximation to the proper place - A("clr %16") // %16 will always be 0 here - A("subi %3,8") // idx == 8 ? - A("breq 6f") // yes, no need to scale - A("brcs 7f") // If C=1, means idx < 8, result was negative! - - // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8] - A("sbrs %3,0") // shift by 1bit position? - A("rjmp 8f") // No - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("8") - A("sbrs %3,1") // shift by 2bit position? - A("rjmp 9f") // No - A("add %14,%14") - A("adc %15,%15") - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("9") - A("sbrs %3,2") // shift by 4bits position? - A("rjmp 16f") // No - A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 - A("swap %14") // Swap nibbles - A("mov %12,%14") - A("andi %12,0x0F") // isolate low nibble - A("andi %14,0xF0") // and clear it - A("or %15,%12") // %15:%16 <<= 4 - L("16") - A("sbrs %3,3") // shift by 8bits position? - A("rjmp 6f") // No, we are done - A("mov %16,%15") - A("mov %15,%14") - A("clr %14") - A("jmp 6f") - - // idx < 8, now %3 = idx - 8. Get the count of bits - L("7") - A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] - A("sbrs %3,0") // shift by 1 bit position ? - A("rjmp 10f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("10") - A("sbrs %3,1") // shift by 2 bit position ? - A("rjmp 11f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("11") - A("sbrs %3,2") // shift by 4 bit position ? - A("rjmp 12f") // No, skip it - A("swap %15") // Swap nibbles - A("andi %14, 0xF0") // Lose the lowest nibble - A("swap %14") // Swap nibbles. Upper nibble is 0 - A("or %14,%15") // Pass nibble from upper byte - A("andi %15, 0x0F") // And get rid of that nibble - L("12") - A("sbrs %3,3") // shift by 8 bit position ? - A("rjmp 6f") // No, skip it - A("mov %14,%15") - A("clr %15") - L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d - - // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration - // of Newton-Raphson. As it has a quadratic convergence, 1 iteration is enough - // to get more than 18bits of precision (the initial table lookup gives 9 bits of - // precision to start from). 18bits of precision is all what is needed here for result - - // %8:%7:%6 = d = interval - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %13 = 0 - // %3:%2:%1:%0 = working accumulator - - // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive - A("clr %0") - A("clr %1") - A("clr %2") - A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 - A("mul %6,%14") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%14") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%14") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%15") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%15") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%15") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%16") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%16") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = (1<<25) - x*d [169] - - // We need to multiply that result by x, and we are only interested in the top 24bits of that multiply - - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %3:%2:%1:%0 = (1<<25) - x*d = acc - // %13 = 0 - - // result = %11:%10:%9:%5:%4 - A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) - A("mov %4,r1") - A("clr %5") - A("clr %9") - A("clr %10") - A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 - A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) - A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 - - A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) - A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 - A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 - - A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 - A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 - A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 - - A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 - A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 - A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) - A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 - - // At this point, %11:%10:%9 contains the new estimation of x. - - // Finally, we must correct the result. Estimate remainder as - // (1<<24) - x*d - // %11:%10:%9 = x - // %8:%7:%6 = d = interval" "\n\t" - A("ldi %3,1") - A("clr %2") - A("clr %1") - A("clr %0") // %3:%2:%1:%0 = 0x1000000 - A("mul %6,%9") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%9") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%9") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%10") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%10") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%10") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%11") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%11") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = r = (1<<24) - x*d - // %8:%7:%6 = d = interval - - // Perform the final correction - A("sub %0,%6") - A("sbc %1,%7") - A("sbc %2,%8") // r -= d - A("brcs 14f") // if ( r >= d) - - // %11:%10:%9 = x - A("ldi %3,1") - A("add %9,%3") - A("adc %10,%13") - A("adc %11,%13") // x++ - L("14") - - // Estimation is done. %11:%10:%9 = x - A("clr __zero_reg__") // Make C runtime happy - // [211 cycles total] - : "=r" (r2), - "=r" (r3), - "=r" (r4), - "=d" (r5), - "=r" (r6), - "=r" (r7), - "+r" (r8), - "+r" (r9), - "+r" (r10), - "=d" (r11), - "=r" (r12), - "=r" (r13), - "=d" (r14), - "=d" (r15), - "=d" (r16), - "=d" (r17), - "=d" (r18), - "+z" (ptab) - : - : "r0", "r1", "cc" - ); - - // Return the result - return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16); - } - -#endif // S_CURVE_ACCELERATION - -#define MINIMAL_STEP_RATE 120 - -/** - * Calculate trapezoid parameters, multiplying the entry- and exit-speeds - * by the provided factors. - ** - * ############ VERY IMPORTANT ############ - * NOTE that the PRECONDITION to call this function is that the block is - * NOT BUSY and it is marked as RECALCULATE. That WARRANTIES the Stepper ISR - * is not and will not use the block while we modify it, so it is safe to - * alter its values. - */ -void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { - - uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), - final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) - - // Limit minimal step rate (Otherwise the timer will overflow.) - NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); - NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate = initial_rate; - #endif - - const int32_t accel = block->acceleration_steps_per_s2; - - // Steps required for acceleration, deceleration to/from nominal rate - uint32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), - decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); - // Steps between acceleration and deceleration, if any - int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; - - // Does accelerate_steps + decelerate_steps exceed step_event_count? - // Then we can't possibly reach the nominal rate, there will be no cruising. - // Use intersection_distance() to calculate accel / braking time in order to - // reach the final_rate exactly at the end of this block. - if (plateau_steps < 0) { - const float accelerate_steps_float = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); - accelerate_steps = MIN(uint32_t(MAX(accelerate_steps_float, 0)), block->step_event_count); - plateau_steps = 0; - - #if ENABLED(S_CURVE_ACCELERATION) - // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); - #endif - } - #if ENABLED(S_CURVE_ACCELERATION) - else // We have some plateau time, so the cruise rate will be the nominal rate - cruise_rate = block->nominal_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Jerk controlled speed requires to express speed versus time, NOT steps - uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), - deceleration_time = ((float)(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE); - - // And to offload calculations from the ISR, we also calculate the inverse of those times here - uint32_t acceleration_time_inverse = get_period_inverse(acceleration_time); - uint32_t deceleration_time_inverse = get_period_inverse(deceleration_time); - #endif - - // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = accelerate_steps + plateau_steps; - block->initial_rate = initial_rate; - #if ENABLED(S_CURVE_ACCELERATION) - block->acceleration_time = acceleration_time; - block->deceleration_time = deceleration_time; - block->acceleration_time_inverse = acceleration_time_inverse; - block->deceleration_time_inverse = deceleration_time_inverse; - block->cruise_rate = cruise_rate; - #endif - block->final_rate = final_rate; -} - -/* PLANNER SPEED DEFINITION - +--------+ <- current->nominal_speed - / \ - current->entry_speed -> + \ - | + <- next->entry_speed (aka exit speed) - +-------------+ - time --> - - Recalculates the motion plan according to the following basic guidelines: - - 1. Go over every feasible block sequentially in reverse order and calculate the junction speeds - (i.e. current->entry_speed) such that: - a. No junction speed exceeds the pre-computed maximum junction speed limit or nominal speeds of - neighboring blocks. - b. A block entry speed cannot exceed one reverse-computed from its exit speed (next->entry_speed) - with a maximum allowable deceleration over the block travel distance. - c. The last (or newest appended) block is planned from a complete stop (an exit speed of zero). - 2. Go over every block in chronological (forward) order and dial down junction speed values if - a. The exit speed exceeds the one forward-computed from its entry speed with the maximum allowable - acceleration over the block travel distance. - - When these stages are complete, the planner will have maximized the velocity profiles throughout the all - of the planner blocks, where every block is operating at its maximum allowable acceleration limits. In - other words, for all of the blocks in the planner, the plan is optimal and no further speed improvements - are possible. If a new block is added to the buffer, the plan is recomputed according to the said - guidelines for a new optimal plan. - - To increase computational efficiency of these guidelines, a set of planner block pointers have been - created to indicate stop-compute points for when the planner guidelines cannot logically make any further - changes or improvements to the plan when in normal operation and new blocks are streamed and added to the - planner buffer. For example, if a subset of sequential blocks in the planner have been planned and are - bracketed by junction velocities at their maximums (or by the first planner block as well), no new block - added to the planner buffer will alter the velocity profiles within them. So we no longer have to compute - them. Or, if a set of sequential blocks from the first block in the planner (or a optimal stop-compute - point) are all accelerating, they are all optimal and can not be altered by a new block added to the - planner buffer, as this will only further increase the plan speed to chronological blocks until a maximum - junction velocity is reached. However, if the operational conditions of the plan changes from infrequently - used feed holds or feedrate overrides, the stop-compute pointers will be reset and the entire plan is - recomputed as stated in the general guidelines. - - Planner buffer index mapping: - - block_buffer_tail: Points to the beginning of the planner buffer. First to be executed or being executed. - - block_buffer_head: Points to the buffer block after the last block in the buffer. Used to indicate whether - the buffer is full or empty. As described for standard ring buffers, this block is always empty. - - block_buffer_planned: Points to the first buffer block after the last optimally planned block for normal - streaming operating conditions. Use for planning optimizations by avoiding recomputing parts of the - planner buffer that don't change with the addition of a new block, as describe above. In addition, - this block can never be less than block_buffer_tail and will always be pushed forward and maintain - this requirement when encountered by the Planner::discard_current_block() routine during a cycle. - - NOTE: Since the planner only computes on what's in the planner buffer, some motions with lots of short - line segments, like G2/3 arcs or complex curves, may seem to move slow. This is because there simply isn't - enough combined distance traveled in the entire buffer to accelerate up to the nominal speed and then - decelerate to a complete stop at the end of the buffer, as stated by the guidelines. If this happens and - becomes an annoyance, there are a few simple solutions: (1) Maximize the machine acceleration. The planner - will be able to compute higher velocity profiles within the same combined distance. (2) Maximize line - motion(s) distance per block to a desired tolerance. The more combined distance the planner has to use, - the faster it can go. (3) Maximize the planner buffer size. This also will increase the combined distance - for the planner to compute over. It also increases the number of computations the planner has to perform - to compute an optimal plan, so select carefully. -*/ - -// The kernel called by recalculate() when scanning the plan from last to first entry. -void Planner::reverse_pass_kernel(block_t* const current, const block_t * const next) { - if (current) { - // If entry speed is already at the maximum entry speed, and there was no change of speed - // in the next block, there is no need to recheck. Block is cruising and there is no need to - // compute anything for this block, - // If not, block entry speed needs to be recalculated to ensure maximum possible planned speed. - const float max_entry_speed_sqr = current->max_entry_speed_sqr; - - // Compute maximum entry speed decelerating over the current block from its exit speed. - // If not at the maximum entry speed, or the previous block entry speed changed - if (current->entry_speed_sqr != max_entry_speed_sqr || (next && TEST(next->flag, BLOCK_BIT_RECALCULATE))) { - - // If nominal length true, max junction speed is guaranteed to be reached. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - - const float new_entry_speed_sqr = TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) - ? max_entry_speed_sqr - : MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(float(MINIMUM_PLANNER_SPEED)), current->millimeters)); - if (current->entry_speed_sqr != new_entry_speed_sqr) { - - // Need to recalculate the block speed - Mark it now, so the stepper - // ISR does not consume the block before being recalculated - SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block may have - // become BUSY just before being marked RECALCULATE, so check for that! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks). And don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY so this is ahead of the Stepper ISR: - // Just Set the new entry speed. - current->entry_speed_sqr = new_entry_speed_sqr; - } - } - } - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the reverse pass. - */ -void Planner::reverse_pass() { - // Initialize block index to the last block in the planner buffer. - uint8_t block_index = prev_block_index(block_buffer_head); - - // Read the index of the last buffer planned block. - // The ISR may change it so get a stable local copy. - uint8_t planned_block_index = block_buffer_planned; - - // If there was a race condition and block_buffer_planned was incremented - // or was pointing at the head (queue empty) break loop now and avoid - // planning already consumed blocks - if (planned_block_index == block_buffer_head) return; - - // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last - // block in buffer. Cease planning when the last optimal planned or tail pointer is reached. - // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan. - const block_t *next = NULL; - while (block_index != planned_block_index) { - - // Perform the reverse pass - block_t *current = &block_buffer[block_index]; - - // Only consider non sync blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { - reverse_pass_kernel(current, next); - next = current; - } - - // Advance to the next - block_index = prev_block_index(block_index); - - // The ISR could advance the block_buffer_planned while we were doing the reverse pass. - // We must try to avoid using an already consumed block as the last one - So follow - // changes to the pointer and make sure to limit the loop to the currently busy block - while (planned_block_index != block_buffer_planned) { - - // If we reached the busy block or an already processed block, break the loop now - if (block_index == planned_block_index) return; - - // Advance the pointer, following the busy block - planned_block_index = next_block_index(planned_block_index); - } - } -} - -// The kernel called by recalculate() when scanning the plan from first to last entry. -void Planner::forward_pass_kernel(const block_t* const previous, block_t* const current, const uint8_t block_index) { - if (previous) { - // If the previous block is an acceleration block, too short to complete the full speed - // change, adjust the entry speed accordingly. Entry speeds have already been reset, - // maximized, and reverse-planned. If nominal length is set, max junction speed is - // guaranteed to be reached. No need to recheck. - if (!TEST(previous->flag, BLOCK_BIT_NOMINAL_LENGTH) && - previous->entry_speed_sqr < current->entry_speed_sqr) { - - // Compute the maximum allowable speed - const float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - - // If true, current block is full-acceleration and we can move the planned pointer forward. - if (new_entry_speed_sqr < current->entry_speed_sqr) { - - // Mark we need to recompute the trapezoidal shape, and do it now, - // so the stepper ISR does not consume the block before being recalculated - SBI(current->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)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks and don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY, we won the race against the Stepper ISR: - - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. - - // Set optimal plan pointer. - block_buffer_planned = block_index; - } - } - } - - // Any block set at its maximum entry speed also creates an optimal plan up to this - // point in the buffer. When the plan is bracketed by either the beginning of the - // buffer and a maximum entry speed or two maximum entry speeds, every block in between - // cannot logically be further improved. Hence, we don't have to recompute them anymore. - if (current->entry_speed_sqr == current->max_entry_speed_sqr) - block_buffer_planned = block_index; - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the forward pass. - */ -void Planner::forward_pass() { - - // Forward Pass: Forward plan the acceleration curve from the planned pointer onward. - // Also scans for optimal plan breakpoints and appropriately updates the planned pointer. - - // Begin at buffer planned pointer. Note that block_buffer_planned can be modified - // by the stepper ISR, so read it ONCE. It it guaranteed that block_buffer_planned - // will never lead head, so the loop is safe to execute. Also note that the forward - // pass will never modify the values at the tail. - uint8_t block_index = block_buffer_planned; - - block_t *current; - const block_t * previous = NULL; - while (block_index != block_buffer_head) { - - // Perform the forward pass - current = &block_buffer[block_index]; - - // Skip SYNC blocks - if (!TEST(current->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; - } - // Advance to the previous - block_index = next_block_index(block_index); - } -} - -/** - * Recalculate the trapezoid speed profiles for all blocks in the plan - * according to the entry_factor for each junction. Must be called by - * recalculate() after updating the blocks. - */ -void Planner::recalculate_trapezoids() { - // The tail may be changed by the ISR so get a local copy. - uint8_t block_index = block_buffer_tail, - head_block_index = block_buffer_head; - // Since there could be a sync block in the head of the queue, and the - // next loop must not recalculate the head block (as it needs to be - // specially handled), scan backwards to the first non-SYNC block. - while (head_block_index != block_index) { - - // Go back (head always point to the first free block) - const uint8_t prev_index = prev_block_index(head_block_index); - - // Get the pointer to the block - block_t *prev = &block_buffer[prev_index]; - - // If not dealing with a sync block, we are done. The last block is not a SYNC block - if (!TEST(prev->flag, BLOCK_BIT_SYNC_POSITION)) break; - - // Examine the previous block. This and all following are SYNC blocks - head_block_index = prev_index; - } - - // Go from the tail (currently executed block) to the first block, without including it) - block_t *current = NULL, *next = NULL; - float current_entry_speed = 0.0, next_entry_speed = 0.0; - while (block_index != head_block_index) { - - next = &block_buffer[block_index]; - - // Skip sync blocks - if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { - next_entry_speed = SQRT(next->entry_speed_sqr); - - if (current) { - // Recalculate if current block entry or exit junction speed has changed. - if (TEST(current->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); - - // 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)) { - // 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), - nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(current, 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 * axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->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); - } - } - - current = next; - current_entry_speed = next_entry_speed; - } - - block_index = next_block_index(block_index); - } - - // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated. - if (next) { - - // Mark the next(last) block as RECALCULATE, to prevent the Stepper ISR running it. - // As the last block is always recalculated here, there is a chance the block isn't - // marked as RECALCULATE yet. That's the reason for the following line. - SBI(next->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)) { - // Block is not BUSY, we won the race against the Stepper ISR: - - const float next_nominal_speed = SQRT(next->nominal_speed_sqr), - nomr = 1.0f / next_nominal_speed; - calculate_trapezoid_for_block(next, next_entry_speed * nomr, float(MINIMUM_PLANNER_SPEED) * nomr); - #if ENABLED(LIN_ADVANCE) - if (next->use_advance_lead) { - const float comp = next->e_D_ratio * extruder_advance_K * axis_steps_per_mm[E_AXIS]; - next->max_adv_steps = next_nominal_speed * comp; - next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; - } - #endif - } - - // Reset next only to ensure its trapezoid is computed - The stepper is free to use - // the block from now on. - CBI(next->flag, BLOCK_BIT_RECALCULATE); - } -} - -void Planner::recalculate() { - // Initialize block index to the last block in the planner buffer. - const uint8_t block_index = prev_block_index(block_buffer_head); - // If there is just one block, no planning can be done. Avoid it! - if (block_index != block_buffer_planned) { - reverse_pass(); - forward_pass(); - } - recalculate_trapezoids(); -} - -#if ENABLED(AUTOTEMP) - - void Planner::getHighESpeed() { - static float oldt = 0; - - if (!autotemp_enabled) return; - if (thermalManager.degTargetHotend(0) + 2 < autotemp_min) return; // probably temperature set to zero. - - float high = 0.0; - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t* block = &block_buffer[b]; - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) { - const float se = (float)block->steps[E_AXIS] / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; - NOLESS(high, se); - } - } - - float t = autotemp_min + high * autotemp_factor; - t = constrain(t, autotemp_min, autotemp_max); - if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); - oldt = t; - thermalManager.setTargetHotend(t, 0); - } - -#endif // AUTOTEMP - -/** - * Maintain fans, paste extruder pressure, - */ -void Planner::check_axes_activity() { - unsigned char axis_active[NUM_AXIS] = { 0 }, - tail_fan_speed[FAN_COUNT]; - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - uint8_t tail_valve_pressure; - #endif - #if HAS_HEATER_2 - uint8_t tail_e_to_p_pressure; - #endif - #endif - - if (has_blocks_queued()) { - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) - tail_fan_speed[i] = block_buffer[block_buffer_tail].fan_speed[i]; - #endif - - block_t* block; - - #if ENABLED(BARICUDA) - block = &block_buffer[block_buffer_tail]; - #if HAS_HEATER_1 - tail_valve_pressure = block->valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = block->e_to_p_pressure; - #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]++; - } - } - else { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) tail_fan_speed[i] = fanSpeeds[i]; - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - tail_valve_pressure = baricuda_valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - #endif - } - - #if ENABLED(DISABLE_X) - if (!axis_active[X_AXIS]) disable_X(); - #endif - #if ENABLED(DISABLE_Y) - if (!axis_active[Y_AXIS]) disable_Y(); - #endif - #if ENABLED(DISABLE_Z) - if (!axis_active[Z_AXIS]) disable_Z(); - #endif - #if ENABLED(DISABLE_E) - if (!axis_active[E_AXIS]) disable_e_steppers(); - #endif - - #if FAN_COUNT > 0 - - #if FAN_KICKSTART_TIME > 0 - - static millis_t fan_kick_end[FAN_COUNT] = { 0 }; - - #define KICKSTART_FAN(f) \ - if (tail_fan_speed[f]) { \ - millis_t ms = millis(); \ - if (fan_kick_end[f] == 0) { \ - fan_kick_end[f] = ms + FAN_KICKSTART_TIME; \ - tail_fan_speed[f] = 255; \ - } else if (PENDING(ms, fan_kick_end[f])) \ - tail_fan_speed[f] = 255; \ - } else fan_kick_end[f] = 0 - - #if HAS_FAN0 - KICKSTART_FAN(0); - #endif - #if HAS_FAN1 - KICKSTART_FAN(1); - #endif - #if HAS_FAN2 - KICKSTART_FAN(2); - #endif - - #endif // FAN_KICKSTART_TIME > 0 - - #if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255 - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : 0) - #else - #define CALC_FAN_SPEED(f) tail_fan_speed[f] - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - thermalManager.soft_pwm_amount_fan[0] = CALC_FAN_SPEED(0); - #endif - #if HAS_FAN1 - thermalManager.soft_pwm_amount_fan[1] = CALC_FAN_SPEED(1); - #endif - #if HAS_FAN2 - thermalManager.soft_pwm_amount_fan[2] = CALC_FAN_SPEED(2); - #endif - #else - #if HAS_FAN0 - analogWrite(FAN_PIN, CALC_FAN_SPEED(0)); - #endif - #if HAS_FAN1 - analogWrite(FAN1_PIN, CALC_FAN_SPEED(1)); - #endif - #if HAS_FAN2 - analogWrite(FAN2_PIN, CALC_FAN_SPEED(2)); - #endif - #endif - - #endif // FAN_COUNT > 0 - - #if ENABLED(AUTOTEMP) - getHighESpeed(); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - analogWrite(HEATER_1_PIN, tail_valve_pressure); - #endif - #if HAS_HEATER_2 - analogWrite(HEATER_2_PIN, tail_e_to_p_pressure); - #endif - #endif -} - -#if DISABLED(NO_VOLUMETRICS) - - /** - * Get a volumetric multiplier from a filament diameter. - * This is the reciprocal of the circular cross-section area. - * Return 1.0 with volumetric off or a diameter of 0.0. - */ - inline float calculate_volumetric_multiplier(const float &diameter) { - return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5) : 1.0; - } - - /** - * Convert the filament sizes into volumetric multipliers. - * The multiplier converts a given E value into a length. - */ - void Planner::calculate_volumetric_multipliers() { - for (uint8_t i = 0; i < COUNT(filament_size); i++) { - volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); - refresh_e_factor(i); - } - } - -#endif // !NO_VOLUMETRICS - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Convert the ratio value given by the filament width sensor - * 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) { - // 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 - - refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); - } -#endif - -#if PLANNER_LEVELING || HAS_UBL_AND_CURVES - /** - * rx, ry, rz - Cartesian positions in mm - * Leveled XYZ on completion - */ - void Planner::apply_leveling(float &rx, float &ry, float &rz) { - - #if ENABLED(SKEW_CORRECTION) - skew(rx, ry, rz); - #endif - - if (!leveling_active) return; - - #if ABL_PLANAR - - float dx = rx - (X_TILT_FULCRUM), - dy = ry - (Y_TILT_FULCRUM); - - apply_rotation_xyz(bed_level_matrix, dx, dy, rz); - - rx = dx + X_TILT_FULCRUM; - ry = dy + Y_TILT_FULCRUM; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(rz); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const float raw[XYZ] = { rx, ry, 0 }; - #endif - - rz += ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(rx, ry - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(rx, ry) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - -#endif - -#if PLANNER_LEVELING - - void Planner::unapply_leveling(float raw[XYZ]) { - - if (leveling_active) { - - #if ABL_PLANAR - - matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); - - float dx = raw[X_AXIS] - (X_TILT_FULCRUM), - dy = raw[Y_AXIS] - (Y_TILT_FULCRUM); - - apply_rotation_xyz(inverse, dx, dy, raw[Z_AXIS]); - - raw[X_AXIS] = dx + X_TILT_FULCRUM; - raw[Y_AXIS] = dy + Y_TILT_FULCRUM; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw[Z_AXIS]); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - raw[Z_AXIS] -= ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw[X_AXIS], raw[Y_AXIS] - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw[X_AXIS], raw[Y_AXIS]) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - - #if ENABLED(SKEW_CORRECTION) - unskew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); - #endif - } - -#endif // PLANNER_LEVELING - -void Planner::quick_stop() { - - // Remove all the queued blocks. Note that this function is NOT - // called from the Stepper ISR, so we must consider tail as readonly! - // that is why we set head to tail - But there is a race condition that - // must be handled: The tail could change between the read and the assignment - // so this must be enclosed in a critical section - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // Drop all queue entries - block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail; - - // Restart the block delay for the first movement - As the queue was - // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - - #if ENABLED(ULTRA_LCD) - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif - - // Make sure to drop any attempt of queuing moves for at least 1 second - cleaning_buffer_counter = 1000; - - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // And stop the stepper ISR - stepper.quick_stop(); -} - -void Planner::endstop_triggered(const AxisEnum axis) { - // Record stepper position and discard the current block - stepper.endstop_triggered(axis); -} - -float Planner::triggered_position_mm(const AxisEnum axis) { - return stepper.triggered_position(axis) * steps_to_mm[axis]; -} - -void Planner::finish_and_disable() { - while (has_blocks_queued() || cleaning_buffer_counter) idle(); - disable_all_steppers(); -} - -/** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ -float Planner::get_axis_position_mm(const AxisEnum axis) { - float axis_steps; - #if IS_CORE - // Requesting one of the "core" axes? - if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) { - - // Protect the access to the position. - 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) - ); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - else - axis_steps = stepper.position(axis); - #else - axis_steps = stepper.position(axis); - #endif - return axis_steps * steps_to_mm[axis]; -} - -/** - * Block until all buffered steps are executed / cleaned - */ -void Planner::synchronize() { while (has_blocks_queued() || cleaning_buffer_counter) idle(); } - -/** - * Planner::_buffer_steps - * - * Add a new linear movement to the planner queue (in terms of steps). - * - * target - target position in steps units - * 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 - */ -bool Planner::_buffer_steps(const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters -) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Fill the block with the specified movement - if (!_populate_block(block, false, target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - )) { - // Movement was not queued, probably because it was too short. - // Simply accept that as movement queued and done - return true; - } - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - // Move buffer head - block_buffer_head = next_buffer_head; - - // Recalculate and optimize trapezoidal speed profiles - recalculate(); - - // Movement successfully queued! - return true; -} - -/** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * - * Returns true is movement is acceptable, false otherwise - */ -bool Planner::_populate_block(block_t * const block, bool split_move, - const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float 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]; - - /* <-- 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)"); - //*/ - - #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (de) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(extruder)) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (ABS(de * e_factor[extruder]) > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; - #endif - de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif // PREVENT_LENGTHY_EXTRUDE - } - #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE - - // Compute direction bit-mask for this block - uint8_t dm = 0; - #if CORE_IS_XY - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_HEAD); // ...and Y - if (dc < 0) SBI(dm, Z_AXIS); - if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction - #elif CORE_IS_XZ - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #elif CORE_IS_YZ - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_HEAD); // Save the real Extruder (head) direction in Y Axis - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction - if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #else - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_AXIS); - #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; - - // Clear all flags, including the "busy" bit - block->flag = 0x00; - - // Set direction bits - block->direction_bits = dm; - - // Number of steps for each axis - // See http://www.corexy.com/theory.html - #if CORE_IS_XY - block->steps[A_AXIS] = ABS(da + db); - block->steps[B_AXIS] = ABS(da - db); - block->steps[Z_AXIS] = ABS(dc); - #elif CORE_IS_XZ - block->steps[A_AXIS] = ABS(da + dc); - block->steps[Y_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(da - dc); - #elif CORE_IS_YZ - block->steps[X_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db + dc); - block->steps[C_AXIS] = ABS(db - dc); - #elif IS_SCARA - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[Z_AXIS] = ABS(dc); - #else - // default non-h-bot planning - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[C_AXIS] = ABS(dc); - #endif - - block->steps[E_AXIS] = esteps; - block->step_event_count = MAX4(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps); - - // Bail if this is a zero-length block - if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; - - // For a mixing extruder, get a magnified esteps for each - #if ENABLED(MIXING_EXTRUDER) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - block->mix_steps[i] = mixing_factor[i] * ( - #if ENABLED(LIN_ADVANCE) - esteps - #else - block->step_event_count - #endif - ); - #endif - - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fanSpeeds[i]; - #endif - - #if ENABLED(BARICUDA) - block->valve_pressure = baricuda_valve_pressure; - block->e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - - block->active_extruder = extruder; - - #if ENABLED(AUTO_POWER_CONTROL) - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) - powerManager.power_on(); - #endif - - // Enable active axes - #if CORE_IS_XY - if (block->steps[A_AXIS] || block->steps[B_AXIS]) { - enable_X(); - enable_Y(); - } - #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); - #endif - #elif CORE_IS_XZ - if (block->steps[A_AXIS] || block->steps[C_AXIS]) { - enable_X(); - enable_Z(); - } - if (block->steps[Y_AXIS]) enable_Y(); - #elif CORE_IS_YZ - if (block->steps[B_AXIS] || block->steps[C_AXIS]) { - enable_Y(); - enable_Z(); - } - if (block->steps[X_AXIS]) enable_X(); - #else - if (block->steps[X_AXIS]) enable_X(); - if (block->steps[Y_AXIS]) enable_Y(); - #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); - #endif - #endif - - // Enable extruder(s) - if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - - #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(); - - 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: - #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); - #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 ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_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); - #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); - #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); - #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); - enable_E4(); - g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; - break; - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #else - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); - #endif - } - - if (esteps) - NOLESS(fr_mm_s, min_feedrate_mm_s); - else - NOLESS(fr_mm_s, min_travel_feedrate_mm_s); - - /** - * This part of the code calculates the total length of the movement. - * For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS. - * But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS - * and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y. - * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. - * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. - */ - #if IS_CORE - float delta_mm[Z_HEAD + 1]; - #if CORE_IS_XY - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS]; - delta_mm[A_AXIS] = (da + db) * steps_to_mm[A_AXIS]; - delta_mm[B_AXIS] = CORESIGN(da - db) * steps_to_mm[B_AXIS]; - #elif CORE_IS_XZ - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[A_AXIS] = (da + dc) * steps_to_mm[A_AXIS]; - delta_mm[C_AXIS] = CORESIGN(da - dc) * steps_to_mm[C_AXIS]; - #elif CORE_IS_YZ - delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[B_AXIS] = (db + dc) * steps_to_mm[B_AXIS]; - delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; - #endif - #else - float delta_mm[ABCE]; - delta_mm[A_AXIS] = da * steps_to_mm[A_AXIS]; - 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]; - - 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]); - } - else if (!millimeters) { - block->millimeters = SQRT( - #if CORE_IS_XY - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS]) - #elif CORE_IS_XZ - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) - #elif CORE_IS_YZ - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) - #else - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) - #endif - ); - } - else - block->millimeters = millimeters; - - const float inverse_millimeters = 1.0f / block->millimeters; // Inverse millimeters to remove multiple divides - - // Calculate inverse time for this move. No divide by zero due to previous checks. - // Example: At 120mm/s a 60mm move takes 0.5s. So this will give 2.0. - float inverse_secs = fr_mm_s * inverse_millimeters; - - // Get the number of non busy movements in queue (non busy means that they can be altered) - const uint8_t moves_queued = nonbusy_movesplanned(); - - // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill - #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) - // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); - #endif - - #if ENABLED(SLOWDOWN) - if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) { - if (segment_time_us < min_segment_time_us) { - // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - const uint32_t nst = segment_time_us + LROUND(2 * (min_segment_time_us - segment_time_us) / moves_queued); - inverse_secs = 1000000.0f / nst; - #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) - segment_time_us = nst; - #endif - } - } - #endif - - #if ENABLED(ULTRA_LCD) - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us += segment_time_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 - 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? - } - } - } - #endif - - // Calculate and limit speed in mm/sec for each axis - float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed - LOOP_XYZE(i) { - const float cs = ABS((current_speed[i] = delta_mm[i] * inverse_secs)); - #if ENABLED(DISTINCT_E_FACTORS) - if (i == E_AXIS) i += extruder; - #endif - if (cs > max_feedrate_mm_s[i]) NOMORE(speed_factor, max_feedrate_mm_s[i] / cs); - } - - // Max segment time in µs. - #ifdef XY_FREQUENCY_LIMIT - - // Check and limit the xy direction change frequency - const unsigned char direction_change = block->direction_bits ^ old_direction_bits; - old_direction_bits = block->direction_bits; - segment_time_us = LROUND((float)segment_time_us / speed_factor); - - uint32_t xs0 = axis_segment_time_us[X_AXIS][0], - xs1 = axis_segment_time_us[X_AXIS][1], - xs2 = axis_segment_time_us[X_AXIS][2], - ys0 = axis_segment_time_us[Y_AXIS][0], - ys1 = axis_segment_time_us[Y_AXIS][1], - ys2 = axis_segment_time_us[Y_AXIS][2]; - - if (TEST(direction_change, X_AXIS)) { - xs2 = axis_segment_time_us[X_AXIS][2] = xs1; - xs1 = axis_segment_time_us[X_AXIS][1] = xs0; - xs0 = 0; - } - xs0 = axis_segment_time_us[X_AXIS][0] = xs0 + segment_time_us; - - if (TEST(direction_change, Y_AXIS)) { - ys2 = axis_segment_time_us[Y_AXIS][2] = axis_segment_time_us[Y_AXIS][1]; - ys1 = axis_segment_time_us[Y_AXIS][1] = axis_segment_time_us[Y_AXIS][0]; - ys0 = 0; - } - ys0 = axis_segment_time_us[Y_AXIS][0] = ys0 + segment_time_us; - - const uint32_t max_x_segment_time = MAX3(xs0, xs1, xs2), - max_y_segment_time = MAX3(ys0, ys1, ys2), - min_xy_segment_time = MIN(max_x_segment_time, max_y_segment_time); - if (min_xy_segment_time < MAX_FREQ_TIME_US) { - const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US); - NOMORE(speed_factor, low_sf); - } - #endif // XY_FREQUENCY_LIMIT - - // Correct the speed - if (speed_factor < 1.0f) { - LOOP_XYZE(i) current_speed[i] *= speed_factor; - block->nominal_rate *= speed_factor; - block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); - } - - // Compute and limit the acceleration rate for the trapezoid generator. - const float steps_per_mm = block->step_event_count * inverse_millimeters; - uint32_t accel; - if (!block->steps[A_AXIS] && !block->steps[B_AXIS] && !block->steps[C_AXIS]) { - // convert to: acceleration steps/sec^2 - accel = CEIL(retract_acceleration * steps_per_mm); - #if ENABLED(LIN_ADVANCE) - block->use_advance_lead = false; - #endif - } - else { - #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const uint32_t comp = max_acceleration_steps_per_s2[AXIS+INDX] * block->step_event_count; \ - if (accel * block->steps[AXIS] > comp) accel = comp / block->steps[AXIS]; \ - } \ - }while(0) - - #define LIMIT_ACCEL_FLOAT(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const float comp = (float)max_acceleration_steps_per_s2[AXIS+INDX] * (float)block->step_event_count; \ - if ((float)accel * (float)block->steps[AXIS] > comp) accel = comp / (float)block->steps[AXIS]; \ - } \ - }while(0) - - // Start with print or travel acceleration - accel = CEIL((esteps ? acceleration : travel_acceleration) * steps_per_mm); - - #if ENABLED(LIN_ADVANCE) - - #if ENABLED(JUNCTION_DEVIATION) - #if ENABLED(DISTINCT_E_FACTORS) - #define MAX_E_JERK max_e_jerk[extruder] - #else - #define MAX_E_JERK max_e_jerk - #endif - #else - #define MAX_E_JERK max_jerk[E_AXIS] - #endif - - /** - * - * Use LIN_ADVANCE for blocks if all these are true: - * - * esteps : This is a print move, because we checked for A, B, C steps before. - * - * extruder_advance_K : There is an advance factor set. - * - * de > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves) - */ - block->use_advance_lead = esteps - && extruder_advance_K - && de > 0; - - if (block->use_advance_lead) { - block->e_D_ratio = (target_float[E_AXIS] - position_float[E_AXIS]) / - #if IS_KINEMATIC - block->millimeters - #else - SQRT(sq(target_float[X_AXIS] - position_float[X_AXIS]) - + sq(target_float[Y_AXIS] - position_float[Y_AXIS]) - + sq(target_float[Z_AXIS] - position_float[Z_AXIS])) - #endif - ; - - // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance! - // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. - if (block->e_D_ratio > 3.0f) - block->use_advance_lead = false; - else { - const uint32_t max_accel_steps_per_s2 = MAX_E_JERK / (extruder_advance_K * block->e_D_ratio) * steps_per_mm; - #if ENABLED(LA_DEBUG) - if (accel > max_accel_steps_per_s2) SERIAL_ECHOLNPGM("Acceleration limited."); - #endif - NOMORE(accel, max_accel_steps_per_s2); - } - } - #endif - - #if ENABLED(DISTINCT_E_FACTORS) - #define ACCEL_IDX extruder - #else - #define ACCEL_IDX 0 - #endif - - // Limit acceleration per axis - if (block->step_event_count <= cutoff_long) { - LIMIT_ACCEL_LONG(A_AXIS, 0); - LIMIT_ACCEL_LONG(B_AXIS, 0); - LIMIT_ACCEL_LONG(C_AXIS, 0); - LIMIT_ACCEL_LONG(E_AXIS, ACCEL_IDX); - } - else { - LIMIT_ACCEL_FLOAT(A_AXIS, 0); - LIMIT_ACCEL_FLOAT(B_AXIS, 0); - LIMIT_ACCEL_FLOAT(C_AXIS, 0); - LIMIT_ACCEL_FLOAT(E_AXIS, ACCEL_IDX); - } - } - block->acceleration_steps_per_s2 = accel; - block->acceleration = accel / steps_per_mm; - #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (4096.0f * 4096.0f / (STEPPER_TIMER_RATE))); - #endif - #if ENABLED(LIN_ADVANCE) - if (block->use_advance_lead) { - block->advance_speed = (STEPPER_TIMER_RATE) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]); - #if ENABLED(LA_DEBUG) - if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) - SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); - if (block->advance_speed < 200) - SERIAL_ECHOLNPGM("eISR running at > 10kHz."); - #endif - } - #endif - - float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 - - #if ENABLED(JUNCTION_DEVIATION) - - /** - * Compute maximum allowable entry speed at junction by centripetal acceleration approximation. - * Let a circle be tangent to both previous and current path line segments, where the junction - * deviation is defined as the distance from the junction to the closest edge of the circle, - * colinear with the circle center. The circular segment joining the two paths represents the - * path of centripetal acceleration. Solve for max velocity based on max acceleration about the - * radius of the circle, defined indirectly by junction deviation. This may be also viewed as - * path width or max_jerk in the previous Grbl version. This approach does not actually deviate - * from path, but used as a robust way to compute cornering speeds, as it takes into account the - * nonlinearities of both the junction angle and junction velocity. - * - * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path - * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact - * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here - * is exactly the same. Instead of motioning all the way to junction point, the machine will - * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform - * a continuous mode path, but ARM-based microcontrollers most certainly do. - * - * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be - * changed dynamically during operation nor can the line move geometry. This must be kept in - * memory in the event of a feedrate override changing the nominal speeds of blocks, which can - * change the overall maximum entry speed conditions of all blocks. - * - * ####### - * https://github.com/MarlinFirmware/Marlin/issues/10341#issuecomment-388191754 - * - * hoffbaked: on May 10 2018 tuned and improved the GRBL algorithm for Marlin: - Okay! It seems to be working good. I somewhat arbitrarily cut it off at 1mm - on then on anything with less sides than an octagon. With this, and the - reverse pass actually recalculating things, a corner acceleration value - of 1000 junction deviation of .05 are pretty reasonable. If the cycles - can be spared, a better acos could be used. For all I know, it may be - already calculated in a different place. */ - - // Unit vector of previous path line segment - static float previous_unit_vec[XYZE]; - - float unit_vec[] = { - delta_mm[A_AXIS] * inverse_millimeters, - delta_mm[B_AXIS] * inverse_millimeters, - delta_mm[C_AXIS] * inverse_millimeters, - delta_mm[E_AXIS] * inverse_millimeters - }; - - // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Compute cosine of angle between previous and current path. (prev_unit_vec is negative) - // NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity. - float junction_cos_theta = -previous_unit_vec[X_AXIS] * unit_vec[X_AXIS] - -previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS] - -previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS] - -previous_unit_vec[E_AXIS] * unit_vec[E_AXIS] - ; - - // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). - if (junction_cos_theta > 0.999999f) { - // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); - } - else { - NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. - - // Convert delta vector to unit vector - float junction_unit_vec[XYZE] = { - unit_vec[X_AXIS] - previous_unit_vec[X_AXIS], - unit_vec[Y_AXIS] - previous_unit_vec[Y_AXIS], - unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS], - unit_vec[E_AXIS] - previous_unit_vec[E_AXIS] - }; - normalize_junction_vector(junction_unit_vec); - - const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), - sin_theta_d2 = SQRT(0.5f * (1.0f - junction_cos_theta)); // Trig half angle identity. Always positive. - - vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0f - sin_theta_d2); - if (block->millimeters < 1) { - - // Fast acos approximation, minus the error bar to be safe - const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18f; - - // If angle is greater than 135 degrees (octagon), find speed for approximate arc - if (junction_theta > RADIANS(135)) { - const float limit_sqr = block->millimeters / (RADIANS(180) - junction_theta) * junction_acceleration; - NOMORE(vmax_junction_sqr, limit_sqr); - } - } - } - - // Get the lowest speed - vmax_junction_sqr = MIN3(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); - } - else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0; - - COPY(previous_unit_vec, unit_vec); - - #else // Classic Jerk Limiting - - /** - * Adapted from Průša MKS firmware - * https://github.com/prusa3d/Prusa-Firmware - */ - const float nominal_speed = SQRT(block->nominal_speed_sqr); - - // Exit speed limited by a jerk to full halt of a previous last segment - static float previous_safe_speed; - - // Start with a safe speed (from which the machine may halt to stop immediately). - float safe_speed = nominal_speed; - - uint8_t limited = 0; - LOOP_XYZE(i) { - const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis - maxj = max_jerk[i]; // mj : The max jerk setting for this axis - if (jerk > maxj) { // cs > mj : New current speed too fast? - if (limited) { // limited already? - const float mjerk = nominal_speed * maxj; // ns*mj - if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs - } - else { - safe_speed *= maxj / jerk; // Initial limit: ns*mj/cs - ++limited; // Initially limited - } - } - } - - float vmax_junction; - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Estimate a maximum velocity allowed at a joint of two successive segments. - // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, - // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. - - // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. - float v_factor = 1; - limited = 0; - - // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. - // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. - const float previous_nominal_speed = SQRT(previous_nominal_speed_sqr); - vmax_junction = MIN(nominal_speed, previous_nominal_speed); - - // Now limit the jerk in all axes. - const float smaller_speed_factor = vmax_junction / previous_nominal_speed; - LOOP_XYZE(axis) { - // Limit an axis. We have to differentiate: coasting, reversal of an axis, full stop. - float v_exit = previous_speed[axis] * smaller_speed_factor, - v_entry = current_speed[axis]; - if (limited) { - v_exit *= v_factor; - v_entry *= v_factor; - } - - // Calculate jerk depending on whether the axis is coasting in the same direction or reversing. - const float jerk = (v_exit > v_entry) - ? // coasting axis reversal - ( (v_entry > 0 || v_exit < 0) ? (v_exit - v_entry) : MAX(v_exit, -v_entry) ) - : // v_exit <= v_entry coasting axis reversal - ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : MAX(-v_exit, v_entry) ); - - if (jerk > max_jerk[axis]) { - v_factor *= max_jerk[axis] / jerk; - ++limited; - } - } - if (limited) vmax_junction *= v_factor; - // Now the transition velocity is known, which maximizes the shared exit / entry velocity while - // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. - const float vmax_junction_threshold = vmax_junction * 0.99f; - if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) - vmax_junction = safe_speed; - } - else - vmax_junction = safe_speed; - - previous_safe_speed = safe_speed; - vmax_junction_sqr = sq(vmax_junction); - - #endif // Classic Jerk Limiting - - // Max entry speed of this block equals the max exit speed of the previous block. - block->max_entry_speed_sqr = vmax_junction_sqr; - - // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); - - // If we are trying to add a split block, start with the - // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : MIN(vmax_junction_sqr, v_allowable_sqr); - - // Initialize planner efficiency flags - // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag |= block->nominal_speed_sqr <= v_allowable_sqr ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE; - - // Update previous path unit_vector and nominal speed - COPY(previous_speed, current_speed); - previous_nominal_speed_sqr = block->nominal_speed_sqr; - - // Update the position - static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!"); - COPY(position, target); - #if HAS_POSITION_FLOAT - COPY(position_float, target_float); - #endif - - // Movement was accepted - return true; -} // _populate_block() - -/** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ -void Planner::buffer_sync_block() { - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Clear block - memset(block, 0, sizeof(block_t)); - - block->flag = BLOCK_FLAG_SYNC_POSITION; - - block->position[A_AXIS] = position[A_AXIS]; - block->position[B_AXIS] = position[B_AXIS]; - block->position[C_AXIS] = position[C_AXIS]; - block->position[E_AXIS] = position[E_AXIS]; - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - block_buffer_head = next_buffer_head; - - stepper.wake_up(); -} // buffer_sync_block() - -/** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ -bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - - // When changing extruders recalculate steps corresponding to the E position - #if ENABLED(DISTINCT_E_FACTORS) - if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) { - position[E_AXIS] = LROUND(position[E_AXIS] * axis_steps_per_mm[E_AXIS_N] * steps_to_mm[E_AXIS + last_extruder]); - last_extruder = extruder; - } - #endif - - // The target position of the tool in absolute steps - // Calculate target position in absolute steps - const int32_t target[ABCE] = { - LROUND(a * axis_steps_per_mm[A_AXIS]), - LROUND(b * axis_steps_per_mm[B_AXIS]), - LROUND(c * axis_steps_per_mm[C_AXIS]), - LROUND(e * axis_steps_per_mm[E_AXIS_N]) - }; - - #if HAS_POSITION_FLOAT - const float target_float[XYZE] = { a, b, c, e }; - #endif - - // DRYRUN prevents E moves from taking place - if (DEBUGGING(DRYRUN)) { - position[E_AXIS] = target[E_AXIS]; - #if HAS_POSITION_FLOAT - position_float[E_AXIS] = e; - #endif - } - - /* <-- add a slash to enable - SERIAL_ECHOPAIR(" buffer_segment FR:", fr_mm_s); - #if IS_KINEMATIC - SERIAL_ECHOPAIR(" A:", a); - SERIAL_ECHOPAIR(" (", position[A_AXIS]); - SERIAL_ECHOPAIR("->", target[A_AXIS]); - SERIAL_ECHOPAIR(") B:", b); - #else - SERIAL_ECHOPAIR(" X:", a); - SERIAL_ECHOPAIR(" (", position[X_AXIS]); - SERIAL_ECHOPAIR("->", target[X_AXIS]); - SERIAL_ECHOPAIR(") Y:", b); - #endif - SERIAL_ECHOPAIR(" (", position[Y_AXIS]); - SERIAL_ECHOPAIR("->", target[Y_AXIS]); - #if ENABLED(DELTA) - SERIAL_ECHOPAIR(") C:", c); - #else - SERIAL_ECHOPAIR(") Z:", c); - #endif - SERIAL_ECHOPAIR(" (", position[Z_AXIS]); - SERIAL_ECHOPAIR("->", target[Z_AXIS]); - SERIAL_ECHOPAIR(") E:", e); - SERIAL_ECHOPAIR(" (", position[E_AXIS]); - SERIAL_ECHOPAIR("->", target[E_AXIS]); - SERIAL_ECHOLNPGM(")"); - //*/ - - // Queue the movement - if ( - !_buffer_steps(target - #if HAS_POSITION_FLOAT - , target_float - #endif - , fr_mm_s, extruder, millimeters - ) - ) return false; - - stepper.wake_up(); - return true; -} // buffer_segment() - -/** - * Directly set the planner XYZ position (and stepper positions) - * converting mm (or angles for SCARA) into steps. - * - * On CORE machines stepper ABC will be translated from the given XYZ. - */ - -void Planner::_set_position_mm(const float &a, const float &b, const float &c, const float &e) { - #if ENABLED(DISTINCT_E_FACTORS) - last_extruder = active_extruder; - #endif - position[A_AXIS] = LROUND(a * axis_steps_per_mm[A_AXIS]); - position[B_AXIS] = LROUND(b * axis_steps_per_mm[B_AXIS]); - position[C_AXIS] = LROUND(axis_steps_per_mm[C_AXIS] * (c + ( - #if !IS_KINEMATIC && ENABLED(AUTO_BED_LEVELING_UBL) - leveling_active ? ubl.get_z_correction(a, b) : - #endif - 0 - ))); - position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); - #if HAS_POSITION_FLOAT - position_float[A_AXIS] = a; - position_float[B_AXIS] = b; - position_float[C_AXIS] = c; - position_float[E_AXIS] = e; - #endif - if (has_blocks_queued()) { - //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. - //ZERO(previous_speed); - buffer_sync_block(); - } - else - stepper.set_position(position[A_AXIS], position[B_AXIS], position[C_AXIS], position[E_AXIS]); -} - -void Planner::set_position_mm_kinematic(const float (&cart)[XYZE]) { - #if PLANNER_LEVELING - float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - apply_leveling(raw); - #else - const float (&raw)[XYZE] = cart; - #endif - #if IS_KINEMATIC - inverse_kinematics(raw); - _set_position_mm(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS]); - #else - _set_position_mm(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS]); - #endif -} - -/** - * Setters for planner position (also setting stepper position). - */ -void Planner::set_position_mm(const AxisEnum axis, const float &v) { - #if ENABLED(DISTINCT_E_FACTORS) - const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0); - last_extruder = active_extruder; - #else - const uint8_t axis_index = axis; - #endif - position[axis] = LROUND(axis_steps_per_mm[axis_index] * (v + ( - #if ENABLED(AUTO_BED_LEVELING_UBL) - axis == Z_AXIS && leveling_active ? ubl.get_z_correction(current_position[X_AXIS], current_position[Y_AXIS]) : - #endif - 0) - )); - #if HAS_POSITION_FLOAT - position_float[axis] = v; - #endif - if (has_blocks_queued()) - buffer_sync_block(); - else - stepper.set_position(axis, position[axis]); -} - -// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 -void Planner::reset_acceleration_rates() { - #if ENABLED(DISTINCT_E_FACTORS) - #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder) - #else - #define AXIS_CONDITION true - #endif - uint32_t highest_rate = 1; - LOOP_XYZE_N(i) { - max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; - if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); - } - cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL - #if ENABLED(JUNCTION_DEVIATION) && ENABLED(LIN_ADVANCE) - recalculate_max_e_jerk(); - #endif -} - -// Recalculate position, steps_to_mm if axis_steps_per_mm changes! -void Planner::refresh_positioning() { - LOOP_XYZE_N(i) steps_to_mm[i] = 1.0f / axis_steps_per_mm[i]; - set_position_mm_kinematic(current_position); - reset_acceleration_rates(); -} - -#if ENABLED(AUTOTEMP) - - void Planner::autotemp_M104_M109() { - if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float(); - if (parser.seen('S')) autotemp_min = parser.value_celsius(); - if (parser.seen('B')) autotemp_max = parser.value_celsius(); - } - -#endif diff --git a/Marlin_thinkerV2/Marlin/planner.h b/Marlin_thinkerV2/Marlin/planner.h deleted file mode 100644 index fd06be588c..0000000000 --- a/Marlin_thinkerV2/Marlin/planner.h +++ /dev/null @@ -1,835 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner.h - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - */ - -#ifndef PLANNER_H -#define PLANNER_H - -#include "types.h" -#include "enum.h" -#include "Marlin.h" - -#if ABL_PLANAR - #include "vector_3.h" -#endif - -enum BlockFlagBit : char { - // Recalculate trapezoids on entry junction. For optimization. - BLOCK_BIT_RECALCULATE, - - // Nominal speed always reached. - // i.e., The segment is long enough, so the nominal speed is reachable if accelerating - // from a safe speed (in consideration of jerking from zero speed). - BLOCK_BIT_NOMINAL_LENGTH, - - // The block is segment 2+ of a longer move - BLOCK_BIT_CONTINUED, - - // Sync the stepper counts from the block - BLOCK_BIT_SYNC_POSITION -}; - -enum BlockFlag : char { - BLOCK_FLAG_RECALCULATE = _BV(BLOCK_BIT_RECALCULATE), - BLOCK_FLAG_NOMINAL_LENGTH = _BV(BLOCK_BIT_NOMINAL_LENGTH), - BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED), - BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION) -}; - -/** - * struct block_t - * - * A single entry in the planner buffer. - * Tracks linear movement over multiple axes. - * - * The "nominal" values are as-specified by gcode, and - * may never actually be reached due to acceleration limits. - */ -typedef struct { - - volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! - - // Fields used by the motion planner to manage acceleration - float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 - entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 - max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 - millimeters, // The total travel of this block in mm - acceleration; // acceleration mm/sec^2 - - union { - // Data used by all move blocks - struct { - // Fields used by the Bresenham algorithm for tracing the line - uint32_t steps[NUM_AXIS]; // Step count along each axis - }; - // Data used by all sync blocks - struct { - int32_t position[NUM_AXIS]; // New position to force when this sync block is executed - }; - }; - uint32_t step_event_count; // The number of step events required to complete this block - - uint8_t active_extruder; // The extruder to move (if E move) - - #if ENABLED(MIXING_EXTRUDER) - uint32_t mix_steps[MIXING_STEPPERS]; // Scaled steps[E_AXIS] for the mixing steppers - #endif - - // Settings for the trapezoid generator - uint32_t accelerate_until, // The index of the step event on which to stop acceleration - decelerate_after; // The index of the step event on which to start decelerating - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase - acceleration_time, // Acceleration time and deceleration time in STEP timer counts - deceleration_time, - acceleration_time_inverse, // Inverse of acceleration and deceleration periods, expressed as integer. Scale depends on CPU being used - deceleration_time_inverse; - #else - uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation - #endif - - uint8_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) - - // Advance extrusion - #if ENABLED(LIN_ADVANCE) - bool use_advance_lead; - uint16_t advance_speed, // STEP timer value for extruder speed offset ISR - max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!) - final_adv_steps; // advance steps due to exit speed - float e_D_ratio; - #endif - - uint32_t nominal_rate, // The nominal step rate for this block in step_events/sec - initial_rate, // The jerk-adjusted step rate at start of block - final_rate, // The minimal rate at exit - acceleration_steps_per_s2; // acceleration steps/sec^2 - - #if FAN_COUNT > 0 - uint16_t fan_speed[FAN_COUNT]; - #endif - - #if ENABLED(BARICUDA) - uint8_t valve_pressure, e_to_p_pressure; - #endif - - uint32_t segment_time_us; - -} block_t; - -#define HAS_POSITION_FLOAT (ENABLED(LIN_ADVANCE) || HAS_FEEDRATE_SCALING) - -#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) - -class Planner { - public: - - /** - * The move buffer, calculated in stepper steps - * - * block_buffer is a ring buffer... - * - * head,tail : indexes for write,read - * head==tail : the buffer is empty - * head!=tail : blocks are in the buffer - * head==(tail-1)%size : the buffer is full - * - * Writer of head is Planner::buffer_segment(). - * Reader of tail is Stepper::isr(). Always consider tail busy / read-only - */ - static block_t block_buffer[BLOCK_BUFFER_SIZE]; - static volatile uint8_t block_buffer_head, // Index of the next block to be pushed - block_buffer_nonbusy, // Index of the first non busy block - block_buffer_planned, // Index of the optimally planned block - block_buffer_tail; // Index of the busy block, if any - static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks - static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - - - #if ENABLED(DISTINCT_E_FACTORS) - 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 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 - volumetric_area_nominal, // Nominal cross-sectional area - volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner - // May be auto-adjusted by a filament width sensor - #endif - - static uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - max_acceleration_steps_per_s2[XYZE_N], // (steps/s^2) Derived from mm_per_s2 - min_segment_time_us; // (µs) M205 B - static float max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - steps_to_mm[XYZE_N], // (mm) Millimeters per step - min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - 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_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate - - #if ENABLED(JUNCTION_DEVIATION) - static float junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - static float max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - static float max_e_jerk; - #endif - #endif - #else - static float max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif - - #if HAS_LEVELING - static bool leveling_active; // Flag that bed leveling is enabled - #if ABL_PLANAR - static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float z_fade_height, inverse_z_fade_height; - #endif - #else - static constexpr bool leveling_active = false; - #endif - - #if ENABLED(LIN_ADVANCE) - static float extruder_advance_K; - #endif - - #if HAS_POSITION_FLOAT - static float position_float[XYZE]; - #endif - - #if ENABLED(SKEW_CORRECTION) - #if ENABLED(SKEW_CORRECTION_GCODE) - static float xy_skew_factor; - #else - static constexpr float xy_skew_factor = XY_SKEW_FACTOR; - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #if ENABLED(SKEW_CORRECTION_GCODE) - static float xz_skew_factor, yz_skew_factor; - #else - static constexpr float xz_skew_factor = XZ_SKEW_FACTOR, yz_skew_factor = YZ_SKEW_FACTOR; - #endif - #else - static constexpr float xz_skew_factor = 0, yz_skew_factor = 0; - #endif - #endif - - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - static bool abort_on_endstop_hit; - #endif - - private: - - /** - * The current position of the tool in absolute steps - * Recalculated if any axis_steps_per_mm are changed by gcode - */ - static int32_t position[NUM_AXIS]; - - /** - * Speed of previous path line segment - */ - static float previous_speed[NUM_AXIS]; - - /** - * Nominal speed of previous path line segment (mm/s)^2 - */ - static float previous_nominal_speed_sqr; - - /** - * Limit where 64bit math is necessary for acceleration calculation - */ - static uint32_t cutoff_long; - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float last_fade_z; - #endif - - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) - /** - * Counters to manage disabling inactive extruders - */ - static uint8_t g_uc_extruder_last_move[EXTRUDERS]; - #endif // DISABLE_INACTIVE_EXTRUDER - - #ifdef XY_FREQUENCY_LIMIT - // Used for the frequency limit - #define MAX_FREQ_TIME_US (uint32_t)(1000000.0 / XY_FREQUENCY_LIMIT) - // Old direction bits. Used for speed calculations - static unsigned char old_direction_bits; - // Segment times (in µs). Used for speed calculations - static uint32_t axis_segment_time_us[2][3]; - #endif - - #if ENABLED(ULTRA_LCD) - volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs - #endif - - public: - - /** - * Instance Methods - */ - - Planner(); - - void init(); - - /** - * Static (class) Methods - */ - - 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 - ); - } - - // Manage fans, paste pressure, etc. - static void check_axes_activity(); - - // Update multipliers based on new diameter measurements - static void calculate_volumetric_multipliers(); - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - void calculate_volumetric_for_width_sensor(const int8_t encoded_ratio); - #endif - - #if DISABLED(NO_VOLUMETRICS) - - FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) { - filament_size[e] = v; - // make sure all extruders have some sane value for the filament size - for (uint8_t i = 0; i < COUNT(filament_size); i++) - if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; - } - - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - /** - * Get the Z leveling fade factor based on the given Z height, - * re-calculating only when needed. - * - * Returns 1.0 if planner.z_fade_height is 0.0. - * Returns 0.0 if Z is past the specified 'Fade Height'. - */ - inline static 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; - } - return 1; - } - - FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } - - FORCE_INLINE static void set_z_fade_height(const float &zfh) { - z_fade_height = zfh > 0 ? zfh : 0; - inverse_z_fade_height = RECIPROCAL(z_fade_height); - force_fade_recalc(); - } - - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { - return !z_fade_height || rz < z_fade_height; - } - - #else - - FORCE_INLINE static float fade_scaling_factor_for_z(const float &rz) { - UNUSED(rz); - return 1; - } - - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { UNUSED(rz); return true; } - - #endif - - #if ENABLED(SKEW_CORRECTION) - - FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) { - const float sx = cx - cy * xy_skew_factor - cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)), - sy = cy - cz * yz_skew_factor; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - - FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) { - const float sx = cx + cy * xy_skew_factor + cz * xz_skew_factor, - sy = cy + cz * yz_skew_factor; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - - #endif // SKEW_CORRECTION - - #if PLANNER_LEVELING || HAS_UBL_AND_CURVES - /** - * Apply leveling to transform a cartesian position - * as it will be given to the planner and steppers. - */ - static void apply_leveling(float &rx, float &ry, float &rz); - FORCE_INLINE static void apply_leveling(float (&raw)[XYZ]) { apply_leveling(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - #endif - - #if PLANNER_LEVELING - #define ARG_X float rx - #define ARG_Y float ry - #define ARG_Z float rz - static void unapply_leveling(float raw[XYZ]); - #else - #define ARG_X const float &rx - #define ARG_Y const float &ry - #define ARG_Z const float &rz - #endif - - // Number of moves currently in the planner including the busy block, if any - FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } - - // Number of nonbusy moves currently in the planner - FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } - - // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } - - // Check if movement queue is full - FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } - - // Get count of movement slots free - FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); } - - /** - * Planner::get_next_free_block - * - * - Get the next head indices (passed by reference) - * - Wait for the number of spaces to open up in the planner - * - Return the first head block - */ - FORCE_INLINE static block_t* get_next_free_block(uint8_t &next_buffer_head, const uint8_t count=1) { - - // Wait until there are enough slots free - while (moves_free() < count) { idle(); } - - // Return the first available block - next_buffer_head = next_block_index(block_buffer_head); - return &block_buffer[block_buffer_head]; - } - - /** - * Planner::_buffer_steps - * - * Add a new linear movement to the buffer (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true if movement was buffered, false otherwise - */ - static bool _buffer_steps(const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true is movement is acceptable, false otherwise - */ - static bool _populate_block(block_t * const block, bool split_move, - const int32_t (&target)[XYZE] - #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] - #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ - static void buffer_sync_block(); - - /** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - static bool buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0); - - static void _set_position_mm(const float &a, const float &b, const float &c, const float &e); - - /** - * Add a new linear movement to the buffer. - * The target is NOT translated to delta/scara - * - * Leveling will be applied to input on cartesians. - * Kinematic machines should call buffer_line_kinematic (for leveled moves). - * (Cartesians may also call buffer_line_kinematic.) - * - * rx,ry,rz,e - target position in mm or degrees - * fr_mm_s - (target) speed of the move (mm/s) - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - FORCE_INLINE static bool buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0) { - #if PLANNER_LEVELING && IS_CARTESIAN - apply_leveling(rx, ry, rz); - #endif - return buffer_segment(rx, ry, rz, e, fr_mm_s, extruder, millimeters); - } - - /** - * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * - * cart - x,y,z,e CARTESIAN target in mm - * fr_mm_s - (target) speed of the move (mm/s) - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - FORCE_INLINE static bool buffer_line_kinematic(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder, const float millimeters = 0.0) { - #if PLANNER_LEVELING - float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] }; - apply_leveling(raw); - #else - const float (&raw)[XYZE] = cart; - #endif - #if IS_KINEMATIC - inverse_kinematics(raw); - return buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder, millimeters); - #else - return buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder, millimeters); - #endif - } - - /** - * Set the planner.position and individual stepper positions. - * Used by G92, G28, G29, and other procedures. - * - * Multiplies by axis_steps_per_mm[] and does necessary conversion - * for COREXY / COREXZ / COREYZ to set the corresponding stepper positions. - * - * Clears previous speed values. - */ - FORCE_INLINE static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) { - #if PLANNER_LEVELING && IS_CARTESIAN - apply_leveling(rx, ry, rz); - #endif - _set_position_mm(rx, ry, rz, e); - } - static void set_position_mm_kinematic(const float (&cart)[XYZE]); - static void set_position_mm(const AxisEnum axis, const float &v); - FORCE_INLINE static void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); } - FORCE_INLINE static void set_e_position_mm(const float &e) { set_position_mm(E_AXIS, e); } - - /** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ - static float get_axis_position_mm(const AxisEnum axis); - - // SCARA AB axes are in degrees, not mm - #if IS_SCARA - 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) - static void quick_stop(); - - // Called when an endstop is triggered. Causes the machine to stop inmediately - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in mm (not core-savvy) - static float triggered_position_mm(const AxisEnum axis); - - // Block until all buffered steps are executed / cleaned - static void synchronize(); - - // Wait for moves to finish and disable all steppers - static void finish_and_disable(); - - // Periodic tick to handle cleaning timeouts - // Called from the Temperature ISR at ~1kHz - static void tick() { - if (cleaning_buffer_counter) { - --cleaning_buffer_counter; - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - if (!cleaning_buffer_counter) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); - #endif - } - } - - /** - * Does the buffer have any blocks queued? - */ - FORCE_INLINE static bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); } - - /** - * The current block. NULL if the buffer is empty. - * This also marks the block as busy. - * WARNING: Called from Stepper ISR context! - */ - static block_t* get_current_block() { - - // Get the number of moves in the planner queue so far - const uint8_t nr_moves = movesplanned(); - - // If there are any moves queued ... - if (nr_moves) { - - // If there is still delay of delivery of blocks running, decrement it - if (delay_before_delivering) { - --delay_before_delivering; - // If the number of movements queued is less than 3, and there is still time - // to wait, do not deliver anything - if (nr_moves < 3 && delay_before_delivering) return NULL; - delay_before_delivering = 0; - } - - // If we are here, there is no excuse to deliver the block - block_t * const block = &block_buffer[block_buffer_tail]; - - // No trapezoid calculated? Don't execute yet. - if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return NULL; - - #if ENABLED(ULTRA_LCD) - block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. - #endif - - // As this block is busy, advance the nonbusy block pointer - block_buffer_nonbusy = next_block_index(block_buffer_tail); - - // Push block_buffer_planned pointer, if encountered. - if (block_buffer_tail == block_buffer_planned) - block_buffer_planned = block_buffer_nonbusy; - - // Return the block - return block; - } - - // The queue became empty - #if ENABLED(ULTRA_LCD) - clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. - #endif - - return NULL; - } - - /** - * "Discard" the block and "release" the memory. - * Called when the current block is no longer needed. - * NB: There MUST be a current block to call this function!! - */ - FORCE_INLINE static void discard_current_block() { - if (has_blocks_queued()) - block_buffer_tail = next_block_index(block_buffer_tail); - } - - #if ENABLED(ULTRA_LCD) - - static uint16_t block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - millis_t bbru = block_buffer_runtime_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // To translate µs to ms a division by 1000 would be required. - // We introduce 2.4% error here by dividing by 1024. - // Doesn't matter because block_buffer_runtime_us is already too small an estimation. - bbru >>= 10; - // limit to about a minute. - NOMORE(bbru, 0xFFFFul); - return bbru; - } - - static void clear_block_buffer_runtime() { - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us = 0; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - #endif - - #if ENABLED(AUTOTEMP) - static float autotemp_min, autotemp_max, autotemp_factor; - static bool autotemp_enabled; - static void getHighESpeed(); - static void autotemp_M104_M109(); - #endif - - #if ENABLED(JUNCTION_DEVIATION) - FORCE_INLINE static void recalculate_max_e_jerk() { - #define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5))) - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - for (uint8_t i = 0; i < EXTRUDERS; i++) - max_e_jerk[i] = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS + i]); - #else - max_e_jerk = GET_MAX_E_JERK(max_acceleration_mm_per_s2[E_AXIS]); - #endif - #endif - } - #endif - - private: - - /** - * Get the index of the next / previous block in the ring buffer - */ - static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } - static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } - - /** - * Calculate the distance (not time) it takes to accelerate - * from initial_rate to target_rate using the given acceleration: - */ - static float estimate_acceleration_distance(const float &initial_rate, const float &target_rate, const float &accel) { - if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 - return (sq(target_rate) - sq(initial_rate)) / (accel * 2); - } - - /** - * Return the point at which you must start braking (at the rate of -'accel') if - * you start at 'initial_rate', accelerate (until reaching the point), and want to end at - * 'final_rate' after traveling 'distance'. - * - * This is used to compute the intersection point between acceleration and deceleration - * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed) - */ - static float intersection_distance(const float &initial_rate, const float &final_rate, const float &accel, const float &distance) { - if (accel == 0) return 0; // accel was 0, set intersection distance to 0 - return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4); - } - - /** - * Calculate the maximum allowable speed squared at this point, in order - * to reach 'target_velocity_sqr' using 'acceleration' within a given - * 'distance'. - */ - static float max_allowable_speed_sqr(const float &accel, const float &target_velocity_sqr, const float &distance) { - return target_velocity_sqr - 2 * accel * distance; - } - - #if ENABLED(S_CURVE_ACCELERATION) - /** - * Calculate the speed reached given initial speed, acceleration and distance - */ - static float final_speed(const float &initial_velocity, const float &accel, const float &distance) { - return SQRT(sq(initial_velocity) + 2 * accel * distance); - } - #endif - - static void calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor); - - static void reverse_pass_kernel(block_t* const current, const block_t * const next); - static void forward_pass_kernel(const block_t * const previous, block_t* const current, uint8_t block_index); - - static void reverse_pass(); - static void forward_pass(); - - static void recalculate_trapezoids(); - - static void recalculate(); - - #if ENABLED(JUNCTION_DEVIATION) - - FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) { - float magnitude_sq = 0; - LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]); - const float inv_magnitude = RSQRT(magnitude_sq); - LOOP_XYZE(idx) vector[idx] *= inv_magnitude; - } - - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) { - float limit_value = max_value; - LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero - NOMORE(limit_value, ABS(max_acceleration_mm_per_s2[idx] / unit_vec[idx])); - return limit_value; - } - - #endif // JUNCTION_DEVIATION -}; - -#define PLANNER_XY_FEEDRATE() (MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) - -extern Planner planner; - -#endif // PLANNER_H diff --git a/Marlin_thinkerV2/Marlin/planner_bezier.cpp b/Marlin_thinkerV2/Marlin/planner_bezier.cpp deleted file mode 100644 index fdb4bab86b..0000000000 --- a/Marlin_thinkerV2/Marlin/planner_bezier.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner_bezier.cpp - * - * Compute and buffer movement commands for bezier curves - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(BEZIER_CURVE_SUPPORT) - -#include "planner.h" -#include "language.h" -#include "temperature.h" -#include "Marlin.h" - -// See the meaning in the documentation of cubic_b_spline(). -#define MIN_STEP 0.002f -#define MAX_STEP 0.1f -#define SIGMA 0.1f - -// Compute the linear interpolation between two real numbers. -inline static float interp(float a, float b, float t) { return (1.0f - t) * a + t * b; } - -/** - * Compute a Bézier curve using the De Casteljau's algorithm (see - * https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm), which is - * easy to code and has good numerical stability (very important, - * since Arudino works with limited precision real numbers). - */ -inline static float eval_bezier(float a, float b, float c, float d, float t) { - float iab = interp(a, b, t); - float ibc = interp(b, c, t); - float icd = interp(c, d, t); - float iabc = interp(iab, ibc, t); - float ibcd = interp(ibc, icd, t); - float iabcd = interp(iabc, ibcd, t); - return iabcd; -} - -/** - * We approximate Euclidean distance with the sum of the coordinates - * offset (so-called "norm 1"), which is quicker to compute. - */ -inline static float dist1(float x1, float y1, float x2, float y2) { return ABS(x1 - x2) + ABS(y1 - y2); } - -/** - * The algorithm for computing the step is loosely based on the one in Kig - * (See https://sources.debian.net/src/kig/4:15.08.3-1/misc/kigpainter.cpp/#L759) - * However, we do not use the stack. - * - * The algorithm goes as it follows: the parameters t runs from 0.0 to - * 1.0 describing the curve, which is evaluated by eval_bezier(). At - * each iteration we have to choose a step, i.e., the increment of the - * t variable. By default the step of the previous iteration is taken, - * and then it is enlarged or reduced depending on how straight the - * curve locally is. The step is always clamped between MIN_STEP/2 and - * 2*MAX_STEP. MAX_STEP is taken at the first iteration. - * - * For some t, the step value is considered acceptable if the curve in - * the interval [t, t+step] is sufficiently straight, i.e., - * sufficiently close to linear interpolation. In practice the - * following test is performed: the distance between eval_bezier(..., - * t+step/2) is evaluated and compared with 0.5*(eval_bezier(..., - * t)+eval_bezier(..., t+step)). If it is smaller than SIGMA, then the - * step value is considered acceptable, otherwise it is not. The code - * seeks to find the larger step value which is considered acceptable. - * - * At every iteration the recorded step value is considered and then - * iteratively halved until it becomes acceptable. If it was already - * acceptable in the beginning (i.e., no halving were done), then - * maybe it was necessary to enlarge it; then it is iteratively - * doubled while it remains acceptable. The last acceptable value - * found is taken, provided that it is between MIN_STEP and MAX_STEP - * and does not bring t over 1.0. - * - * Caveat: this algorithm is not perfect, since it can happen that a - * step is considered acceptable even when the curve is not linear at - * all in the interval [t, t+step] (but its mid point coincides "by - * chance" with the midpoint according to the parametrization). This - * kind of glitches can be eliminated with proper first derivative - * estimates; however, given the improbability of such configurations, - * 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) { - // 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]; - bez_target[Y_AXIS] = position[Y_AXIS]; - float step = MAX_STEP; - - millis_t next_idle_ms = millis() + 200UL; - - while (t < 1) { - - thermalManager.manage_heater(); - millis_t now = millis(); - if (ELAPSED(now, next_idle_ms)) { - next_idle_ms = now + 200UL; - idle(); - } - - // First try to reduce the step in order to make it sufficiently - // close to a linear interpolation. - bool did_reduce = false; - float new_t = t + step; - NOMORE(new_t, 1); - float new_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], new_t), - new_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], new_t); - for (;;) { - if (new_t - t < (MIN_STEP)) break; - const float candidate_t = 0.5f * (t + new_t), - candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + new_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + new_pos1); - if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - did_reduce = true; - } - - // If we did not reduce the step, maybe we should enlarge it. - if (!did_reduce) for (;;) { - if (new_t - t > MAX_STEP) break; - const float candidate_t = t + 2 * (new_t - t); - if (candidate_t >= 1) break; - const float candidate_pos0 = eval_bezier(position[X_AXIS], first0, second0, target[X_AXIS], candidate_t), - candidate_pos1 = eval_bezier(position[Y_AXIS], first1, second1, target[Y_AXIS], candidate_t), - interp_pos0 = 0.5f * (bez_target[X_AXIS] + candidate_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + candidate_pos1); - if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - } - - // Check some postcondition; they are disabled in the actual - // Marlin build, but if you test the same code on a computer you - // may want to check they are respect. - /* - assert(new_t <= 1.0); - if (new_t < 1.0) { - assert(new_t - t >= (MIN_STEP) / 2.0); - assert(new_t - t <= (MAX_STEP) * 2.0); - } - */ - - step = new_t - t; - t = new_t; - - // Compute and send new position - bez_target[X_AXIS] = new_pos0; - bez_target[Y_AXIS] = new_pos1; - // FIXME. The following two are wrong, since the parameter t is - // not linear in the distance. - bez_target[Z_AXIS] = interp(position[Z_AXIS], target[Z_AXIS], t); - bez_target[E_AXIS] = interp(position[E_AXIS], target[E_AXIS], t); - clamp_to_software_endstops(bez_target); - - #if HAS_UBL_AND_CURVES - float pos[XYZ] = { bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS] }; - planner.apply_leveling(pos); - if (!planner.buffer_segment(pos[X_AXIS], pos[Y_AXIS], pos[Z_AXIS], bez_target[E_AXIS], fr_mm_s, active_extruder)) - break; - #else - if (!planner.buffer_line_kinematic(bez_target, fr_mm_s, extruder)) - break; - #endif - } -} - -#endif // BEZIER_CURVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin/planner_bezier.h b/Marlin_thinkerV2/Marlin/planner_bezier.h deleted file mode 100644 index d17e7c80a0..0000000000 --- a/Marlin_thinkerV2/Marlin/planner_bezier.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * planner_bezier.h - * - * Compute and buffer movement commands for bezier curves - * - */ - -#ifndef PLANNER_BEZIER_H -#define PLANNER_BEZIER_H - -#include "Marlin.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 - ); - -#endif // PLANNER_BEZIER_H diff --git a/Marlin_thinkerV2/Marlin/point_t.h b/Marlin_thinkerV2/Marlin/point_t.h deleted file mode 100644 index 37ade7eba7..0000000000 --- a/Marlin_thinkerV2/Marlin/point_t.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __POINT_T__ -#define __POINT_T__ - -/** - * @brief Cartesian Point - * @details Represents a three dimensional point on Cartesian coordinate system, - * using an additional fourth dimension for the extrusion length. - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ -struct point_t { - float x, y, z; - - /** - * @brief Three dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ - point_t(const float x, const float y, const float z) : x(x), y(y), z(z) {} - - /** - * @brief Two dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - */ - point_t(const float x, const float y) : point_t(x, y, NAN) {} - -}; - -#endif // __POINT_T__ diff --git a/Marlin_thinkerV2/Marlin/power.cpp b/Marlin_thinkerV2/Marlin/power.cpp deleted file mode 100644 index 2f4708b075..0000000000 --- a/Marlin_thinkerV2/Marlin/power.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power.cpp - power control - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - -#include "power.h" -#include "temperature.h" -#include "stepper_indirection.h" - -Power powerManager; - -millis_t Power::lastPowerOn; - -bool Power::is_power_needed() { - #if ENABLED(AUTO_POWER_FANS) - for (uint8_t i = 0; i < FAN_COUNT; i++) if (fanSpeeds[i] > 0) return true; - #endif - - #if ENABLED(AUTO_POWER_E_FANS) - HOTEND_LOOP() if (thermalManager.autofan_speed[e] > 0) return true; - #endif - - #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLER_FAN && ENABLED(USE_CONTROLLER_FAN) - if (controllerFanSpeed > 0) return true; - #endif - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.soft_pwm_amount_bed > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON - #endif - || E0_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 1 - || E1_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 2 - || E2_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 3 - || E3_ENABLE_READ == E_ENABLE_ON - #if E_STEPPERS > 4 - || E4_ENABLE_READ == E_ENABLE_ON - #endif - #endif - #endif - #endif - ) return true; - - HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) return true; - #endif - - return false; -} - -void Power::check() { - static millis_t nextPowerCheck = 0; - millis_t ms = millis(); - if (ELAPSED(ms, nextPowerCheck)) { - nextPowerCheck = ms + 2500UL; - if (is_power_needed()) - power_on(); - else if (!lastPowerOn || ELAPSED(ms, lastPowerOn + (POWER_TIMEOUT) * 1000UL)) - power_off(); - } -} - -void Power::power_on() { - lastPowerOn = millis(); - if (!powersupply_on) { - PSU_PIN_ON(); - - #if HAS_TRINAMIC - delay(100); // Wait for power to settle - restore_stepper_drivers(); - #endif - } -} - -void Power::power_off() { - if (powersupply_on) PSU_PIN_OFF(); -} - -#endif // AUTO_POWER_CONTROL diff --git a/Marlin_thinkerV2/Marlin/power.h b/Marlin_thinkerV2/Marlin/power.h deleted file mode 100644 index a5c7dba793..0000000000 --- a/Marlin_thinkerV2/Marlin/power.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power.h - power control - */ - -#ifndef POWER_H -#define POWER_H - -#include "types.h" - -class Power { - public: - static void check(); - static void power_on(); - static void power_off(); - private: - static millis_t lastPowerOn; - static bool is_power_needed(); -}; - -extern Power powerManager; - -#endif // POWER_H diff --git a/Marlin_thinkerV2/Marlin/power_loss_recovery.cpp b/Marlin_thinkerV2/Marlin/power_loss_recovery.cpp deleted file mode 100644 index aebb82f787..0000000000 --- a/Marlin_thinkerV2/Marlin/power_loss_recovery.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power_loss_recovery.cpp - Resume an SD print after power-loss - */ - -#include "MarlinConfig.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - -#include "power_loss_recovery.h" - -#include "cardreader.h" -#include "planner.h" -#include "printcounter.h" -#include "serial.h" -#include "temperature.h" -#include "ultralcd.h" - -// Recovery data -job_recovery_info_t job_recovery_info; -JobRecoveryPhase job_recovery_phase = JOB_RECOVERY_IDLE; -uint8_t job_recovery_commands_count; //=0 -char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; -// Extern -extern uint8_t active_extruder, commands_in_queue, cmd_queue_index_r; - - -#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - void debug_print_job_recovery(const bool recovery) { - SERIAL_PROTOCOLLNPGM("---- Job Recovery Info ----"); - SERIAL_PROTOCOLPAIR("valid_head:", int(job_recovery_info.valid_head)); - SERIAL_PROTOCOLLNPAIR(" valid_foot:", int(job_recovery_info.valid_foot)); - if (job_recovery_info.valid_head) { - if (job_recovery_info.valid_head == job_recovery_info.valid_foot) { - SERIAL_PROTOCOLPGM("current_position: "); - LOOP_XYZE(i) { - SERIAL_PROTOCOL(job_recovery_info.current_position[i]); - if (i < E_AXIS) SERIAL_CHAR(','); - } - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("feedrate: ", job_recovery_info.feedrate); - - #if HOTENDS > 1 - SERIAL_PROTOCOLLNPAIR("active_hotend: ", int(job_recovery_info.active_hotend)); - #endif - - SERIAL_PROTOCOLPGM("target_temperature: "); - HOTEND_LOOP() { - SERIAL_PROTOCOL(job_recovery_info.target_temperature[e]); - if (e < HOTENDS - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - - #if HAS_HEATED_BED - SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed); - #endif - - #if FAN_COUNT - SERIAL_PROTOCOLPGM("fanSpeeds: "); - for (int8_t i = 0; i < FAN_COUNT; i++) { - SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]); - if (i < FAN_COUNT - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - #endif - - #if HAS_LEVELING - SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling)); - SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade)); - #endif - SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", int(job_recovery_info.cmd_queue_index_r)); - SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", int(job_recovery_info.commands_in_queue)); - if (recovery) - for (uint8_t i = 0; i < job_recovery_commands_count; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_commands[i]); - else - for (uint8_t i = 0; i < job_recovery_info.commands_in_queue; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_info.command_queue[i]); - SERIAL_PROTOCOLLNPAIR("sd_filename: ", job_recovery_info.sd_filename); - SERIAL_PROTOCOLLNPAIR("sdpos: ", job_recovery_info.sdpos); - SERIAL_PROTOCOLLNPAIR("print_job_elapsed: ", job_recovery_info.print_job_elapsed); - } - else - SERIAL_PROTOCOLLNPGM("INVALID DATA"); - } - SERIAL_PROTOCOLLNPGM("---------------------------"); - } -#endif // DEBUG_POWER_LOSS_RECOVERY - -/** - * Check for Print Job Recovery during setup() - * - * If a saved state exists, populate job_recovery_commands with - * commands to restore the machine state and continue the file. - */ -void check_print_job_recovery() { - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - ZERO(job_recovery_commands); - - if (!card.cardOK) card.initsd(); - - if (card.cardOK) { - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPAIR("Init job recovery info. Size: ", int(sizeof(job_recovery_info))); - #endif - - if (card.jobRecoverFileExists()) { - card.openJobRecoveryFile(true); - card.loadJobRecoveryInfo(); - card.closeJobRecoveryFile(); - //card.removeJobRecoveryFile(); - - if (job_recovery_info.valid_head && job_recovery_info.valid_head == job_recovery_info.valid_foot) { - - uint8_t ind = 0; - - #if HAS_LEVELING - strcpy_P(job_recovery_commands[ind++], PSTR("M420 S0 Z0")); // Leveling off before G92 or G28 - #endif - - strcpy_P(job_recovery_commands[ind++], PSTR("G92.0 Z0")); // Ensure Z is equal to 0 - strcpy_P(job_recovery_commands[ind++], PSTR("G1 Z2")); // Raise Z by 2mm (we hope!) - strcpy_P(job_recovery_commands[ind++], PSTR("G28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" // Home X and Y for Cartesian - #endif - )); - - char str_1[16], str_2[16]; - - #if HAS_LEVELING - if (job_recovery_info.fade || job_recovery_info.leveling) { - // Restore leveling state before G92 sets Z - // This ensures the steppers correspond to the native Z - dtostrf(job_recovery_info.fade, 1, 1, str_1); - sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), str_1); - } - #endif - - dtostrf(job_recovery_info.current_position[Z_AXIS] + 2, 1, 3, str_1); - dtostrf(job_recovery_info.current_position[E_AXIS] - #if ENABLED(SAVE_EACH_CMD_MODE) - - 5 - #endif - , 1, 3, str_2 - ); - sprintf_P(job_recovery_commands[ind++], PSTR("G92.0 Z%s E%s"), str_1, str_2); // Current Z + 2 and E - - uint8_t r = job_recovery_info.cmd_queue_index_r, c = job_recovery_info.commands_in_queue; - while (c--) { - strcpy(job_recovery_commands[ind++], job_recovery_info.command_queue[r]); - r = (r + 1) % BUFSIZE; - } - - if (job_recovery_info.sd_filename[0] == '/') job_recovery_info.sd_filename[0] = ' '; - sprintf_P(job_recovery_commands[ind++], PSTR("M23 %s"), job_recovery_info.sd_filename); - sprintf_P(job_recovery_commands[ind++], PSTR("M24 S%ld T%ld"), job_recovery_info.sdpos, job_recovery_info.print_job_elapsed); - sprintf_P(job_recovery_commands[ind++], PSTR("M106 S200")); - - job_recovery_commands_count = ind; - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - debug_print_job_recovery(true); - #endif - } - else { - if (job_recovery_info.valid_head != job_recovery_info.valid_foot) - LCD_ALERTMESSAGEPGM("INVALID DATA"); - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - } - } - } -} - -/** - * Save the current machine state to the power-loss recovery file - */ -void save_job_recovery_info() { - #if SAVE_INFO_INTERVAL_MS > 0 - static millis_t next_save_ms; // = 0; // Init on reset - millis_t ms = millis(); - #endif -// SERIAL_PROTOCOLLNPGM("save_job_recovery_info..."); - if ( - // Save on every command - #if ENABLED(SAVE_EACH_CMD_MODE) - true - #else - // Save if power loss pin is triggered - #if PIN_EXISTS(POWER_LOSS) - READ(POWER_LOSS_PIN) == POWER_LOSS_STATE || - #endif - // Save if interval is elapsed - #if SAVE_INFO_INTERVAL_MS > 0 - ELAPSED(ms, next_save_ms) || - #endif - // Save on every new Z height - (LOGICAL_Z_POSITION(current_position[X_AXIS]) > 0 &&LOGICAL_Z_POSITION(current_position[Z_AXIS]) > 0 && LOGICAL_Z_POSITION(current_position[Z_AXIS]) > job_recovery_info.current_position[Z_AXIS]) - #endif - ) { - #if SAVE_INFO_INTERVAL_MS > 0 - next_save_ms = ms + SAVE_INFO_INTERVAL_MS; - #endif - - // Head and foot will match if valid data was saved - if (!++job_recovery_info.valid_head) ++job_recovery_info.valid_head; // non-zero in sequence - job_recovery_info.valid_foot = job_recovery_info.valid_head; - - // Machine state - COPY(job_recovery_info.current_position, current_position); - job_recovery_info.current_position[Z_AXIS]=LOGICAL_Z_POSITION(current_position[Z_AXIS]); - job_recovery_info.feedrate = feedrate_mm_s; - - #if HOTENDS > 1 - job_recovery_info.active_hotend = active_extruder; - #endif - - COPY(job_recovery_info.target_temperature, thermalManager.target_temperature); - - #if HAS_HEATED_BED - job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed; - #endif - - #if FAN_COUNT - COPY(job_recovery_info.fanSpeeds, fanSpeeds); - #endif - - #if HAS_LEVELING - job_recovery_info.leveling = planner.leveling_active; - job_recovery_info.fade = ( - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.z_fade_height - #else - 0 - #endif - ); - #endif - - // Commands in the queue - job_recovery_info.cmd_queue_index_r = cmd_queue_index_r; - job_recovery_info.commands_in_queue = commands_in_queue; - COPY(job_recovery_info.command_queue, command_queue); - - // Elapsed print job time - job_recovery_info.print_job_elapsed = print_job_timer.duration(); - - // SD file position - card.getAbsFilename(job_recovery_info.sd_filename); - job_recovery_info.sdpos = card.getStatus(0);//card.getIndex(); - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPGM("Saving..."); - debug_print_job_recovery(false); - #endif - - card.openJobRecoveryFile(false); - (void)card.saveJobRecoveryInfo(); - - // If power-loss pin was triggered, write just once then kill - #if PIN_EXISTS(POWER_LOSS) - if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(MSG_POWER_LOSS_RECOVERY); - #endif - } -} - -#endif // POWER_LOSS_RECOVERY diff --git a/Marlin_thinkerV2/Marlin/power_loss_recovery.h b/Marlin_thinkerV2/Marlin/power_loss_recovery.h deleted file mode 100644 index 183e862a07..0000000000 --- a/Marlin_thinkerV2/Marlin/power_loss_recovery.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * power_loss_recovery.h - Resume an SD print after power-loss - */ - -#ifndef _POWER_LOSS_RECOVERY_H_ -#define _POWER_LOSS_RECOVERY_H_ - -#include "cardreader.h" -#include "types.h" -#include "MarlinConfig.h" - -#define SAVE_INFO_INTERVAL_MS 0 -//#define SAVE_EACH_CMD_MODE -//#define DEBUG_POWER_LOSS_RECOVERY - -#if POWER_LOSS_RECOVER_SUPER_CAP - -typedef struct -{ - char file_name[14]; - unsigned int Z_t; - unsigned int T0_t; - unsigned int B_t; - uint32_t pos_t; - uint32_t E_t; - char recovery;//=0 idle,=1~2 recoverying,=3 power down - -} recovery_D; - -extern recovery_D recovery_detect_cap; -#endif - - - - -typedef struct { - uint8_t valid_head; - - // Machine state - float current_position[NUM_AXIS], feedrate; - - #if HOTENDS > 1 - uint8_t active_hotend; - #endif - - int16_t target_temperature[HOTENDS]; - - #if HAS_HEATED_BED - int16_t target_temperature_bed; - #endif - - #if FAN_COUNT - int16_t fanSpeeds[FAN_COUNT]; - #endif - - #if HAS_LEVELING - bool leveling; - float fade; - #endif - - // Command queue - uint8_t cmd_queue_index_r, commands_in_queue; - char command_queue[BUFSIZE][MAX_CMD_SIZE]; - - // SD Filename and position - char sd_filename[MAXPATHNAMELENGTH]; - uint32_t sdpos; - - // Job elapsed time - millis_t print_job_elapsed; - - uint8_t valid_foot; -} job_recovery_info_t; - -extern job_recovery_info_t job_recovery_info; - -enum JobRecoveryPhase : unsigned char { - JOB_RECOVERY_IDLE, - JOB_RECOVERY_MAYBE, - JOB_RECOVERY_YES, - JOB_RECOVERY_DONE -}; -extern JobRecoveryPhase job_recovery_phase; - -#if HAS_LEVELING - #define APPEND_CMD_COUNT 9 -#else - #define APPEND_CMD_COUNT 7 -#endif - -extern char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; -extern uint8_t job_recovery_commands_count; - -void check_print_job_recovery(); -void save_job_recovery_info(); - -#endif // _POWER_LOSS_RECOVERY_H_ diff --git a/Marlin_thinkerV2/Marlin/printcounter.cpp b/Marlin_thinkerV2/Marlin/printcounter.cpp deleted file mode 100644 index d1de7d1754..0000000000 --- a/Marlin_thinkerV2/Marlin/printcounter.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if DISABLED(PRINTCOUNTER) - -#include "stopwatch.h" -Stopwatch print_job_timer; // Global Print Job Timer instance - -#else // PRINTCOUNTER - -#include "printcounter.h" -#include "duration_t.h" -#include "Marlin.h" - -PrintCounter print_job_timer; // Global Print Job Timer instance - -#if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - // round up address to next page boundary (assuming 32 byte pages) - #define STATS_EEPROM_ADDRESS 0x40 -#else - #define STATS_EEPROM_ADDRESS 0x32 -#endif - -const PrintCounter::promdress PrintCounter::address = STATS_EEPROM_ADDRESS; - -const uint16_t PrintCounter::updateInterval = 10; -const uint16_t PrintCounter::saveInterval = 3600; -printStatistics PrintCounter::data; -millis_t PrintCounter::lastDuration; -bool PrintCounter::loaded = false; - -millis_t PrintCounter::deltaDuration() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("deltaDuration")); - #endif - - millis_t tmp = lastDuration; - lastDuration = duration(); - return lastDuration - tmp; -} - -void PrintCounter::incFilamentUsed(float const &amount) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("incFilamentUsed")); - #endif - - // Refuses to update data if object is not loaded - if (!isLoaded()) return; - - data.filamentUsed += amount; // mm -} - -void PrintCounter::initStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("initStats")); - #endif - - loaded = true; - data = { 0, 0, 0, 0, 0.0 }; - - saveStats(); - eeprom_write_byte((uint8_t*)address, 0x16); -} - -void PrintCounter::loadStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("loadStats")); - #endif - - // Checks if the EEPROM block is initialized - if (eeprom_read_byte((uint8_t*)address) != 0x16) initStats(); - else eeprom_read_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); - - loaded = true; -} - -void PrintCounter::saveStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("saveStats")); - #endif - - // Refuses to save data if object is not loaded - if (!isLoaded()) return; - - // Saves the struct to EEPROM - eeprom_update_block(&data, - (void*)(address + sizeof(uint8_t)), sizeof(printStatistics)); -} - -void PrintCounter::showStats() { - char buffer[21]; - - SERIAL_PROTOCOLPGM(MSG_STATS); - - SERIAL_ECHOPGM("Prints: "); - SERIAL_ECHO(data.totalPrints); - - SERIAL_ECHOPGM(", Finished: "); - SERIAL_ECHO(data.finishedPrints); - - SERIAL_ECHOPGM(", Failed: "); // Note: Removes 1 from failures with an active counter - SERIAL_ECHO(data.totalPrints - data.finishedPrints - - ((isRunning() || isPaused()) ? 1 : 0)); - - SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); - - duration_t elapsed = data.printTime; - elapsed.toString(buffer); - - SERIAL_ECHOPGM("Total time: "); - SERIAL_ECHO(buffer); - - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.printTime); - SERIAL_CHAR(')'); - #endif - - elapsed = data.longestPrint; - elapsed.toString(buffer); - - SERIAL_ECHOPGM(", Longest job: "); - SERIAL_ECHO(buffer); - - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPGM(" ("); - SERIAL_ECHO(data.longestPrint); - SERIAL_CHAR(')'); - #endif - - SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); - - SERIAL_ECHOPGM("Filament used: "); - SERIAL_ECHO(data.filamentUsed / 1000); - SERIAL_CHAR('m'); - - SERIAL_EOL(); -} - -void PrintCounter::tick() { - if (!isRunning()) return; - - static uint32_t update_last = millis(), - eeprom_last = millis(); - - millis_t now = millis(); - - // Trying to get the amount of calculations down to the bare min - const static uint16_t i = updateInterval * 1000; - - if (now - update_last >= i) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("tick")); - #endif - - data.printTime += deltaDuration(); - update_last = now; - } - - // Trying to get the amount of calculations down to the bare min - const static millis_t j = saveInterval * 1000; - if (now - eeprom_last >= j) { - eeprom_last = now; - saveStats(); - } -} - -// @Override -bool PrintCounter::start() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("start")); - #endif - - bool paused = isPaused(); - - if (super::start()) { - if (!paused) { - data.totalPrints++; - lastDuration = 0; - } - return true; - } - - return false; -} - -// @Override -bool PrintCounter::stop() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - if (super::stop()) { - data.finishedPrints++; - data.printTime += deltaDuration(); - - if (duration() > data.longestPrint) - data.longestPrint = duration(); - - saveStats(); - return true; - } - else return false; -} - -// @Override -void PrintCounter::reset() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - super::reset(); - lastDuration = 0; -} - -#if ENABLED(DEBUG_PRINTCOUNTER) - - void PrintCounter::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("PrintCounter::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } -#endif - -#endif // PRINTCOUNTER diff --git a/Marlin_thinkerV2/Marlin/printcounter.h b/Marlin_thinkerV2/Marlin/printcounter.h deleted file mode 100644 index 848d9715b8..0000000000 --- a/Marlin_thinkerV2/Marlin/printcounter.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef PRINTCOUNTER_H -#define PRINTCOUNTER_H - -// Print debug messages with M111 S2 -//#define DEBUG_PRINTCOUNTER - -#include "macros.h" -#include "language.h" -#include "stopwatch.h" -#include - -struct printStatistics { // 16 bytes - //const uint8_t magic; // Magic header, it will always be 0x16 - uint16_t totalPrints; // Number of prints - uint16_t finishedPrints; // Number of complete prints - uint32_t printTime; // Accumulated printing time - uint32_t longestPrint; // Longest successful print job - float filamentUsed; // Accumulated filament consumed in mm -}; - -class PrintCounter: public Stopwatch { - private: - typedef Stopwatch super; - - #if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) - typedef uint32_t promdress; - #else - typedef uint16_t promdress; - #endif - - static printStatistics data; - - /** - * @brief EEPROM address - * @details Defines the start offset address where the data is stored. - */ - static const promdress address; - - /** - * @brief Interval in seconds between counter updates - * @details This const value defines what will be the time between each - * accumulator update. This is different from the EEPROM save interval. - * - * @note The max value for this option is 60(s), otherwise integer - * overflow will happen. - */ - static const uint16_t updateInterval; - - /** - * @brief Interval in seconds between EEPROM saves - * @details This const value defines what will be the time between each - * EEPROM save cycle, the development team recommends to set this value - * no lower than 3600 secs (1 hour). - */ - static const uint16_t saveInterval; - - /** - * @brief Timestamp of the last call to deltaDuration() - * @details Store the timestamp of the last deltaDuration(), this is - * required due to the updateInterval cycle. - */ - static millis_t lastDuration; - - /** - * @brief Stats were loaded from EEPROM - * @details If set to true it indicates if the statistical data was already - * loaded from the EEPROM. - */ - static bool loaded; - - protected: - /** - * @brief dT since the last call - * @details Return the elapsed time in seconds since the last call, this is - * used internally for print statistics accounting is not intended to be a - * user callable function. - */ - static millis_t deltaDuration(); - - public: - - /** - * @brief Initialize the print counter - */ - static inline void init() { - super::init(); - loadStats(); - } - - /** - * @brief Check if Print Statistics has been loaded - * @details Return true if the statistical data has been loaded. - * @return bool - */ - FORCE_INLINE static bool isLoaded() { return loaded; } - - /** - * @brief Increment the total filament used - * @details The total filament used counter will be incremented by "amount". - * - * @param amount The amount of filament used in mm - */ - static void incFilamentUsed(float const &amount); - - /** - * @brief Reset the Print Statistics - * @details Reset the statistics to zero and saves them to EEPROM creating - * also the magic header. - */ - static void initStats(); - - /** - * @brief Load the Print Statistics - * @details Load the statistics from EEPROM - */ - static void loadStats(); - - /** - * @brief Save the Print Statistics - * @details Save the statistics to EEPROM - */ - static void saveStats(); - - /** - * @brief Serial output the Print Statistics - * @details This function may change in the future, for now it directly - * prints the statistical data to serial. - */ - static void showStats(); - - /** - * @brief Return the currently loaded statistics - * @details Return the raw data, in the same structure used internally - */ - static printStatistics getStats() { return data; } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * periodically save the statistical data to EEPROM and do time keeping. - */ - static void tick(); - - /** - * The following functions are being overridden - */ - static bool start(); - static bool stop(); - static void reset(); - - #if ENABLED(DEBUG_PRINTCOUNTER) - - /** - * @brief Print a debug message - * @details Print a simple debug message - */ - static void debug(const char func[]); - - #endif -}; - -// Global Print Job Timer instance -#if ENABLED(PRINTCOUNTER) - extern PrintCounter print_job_timer; -#else - extern Stopwatch print_job_timer; -#endif - -#endif // PRINTCOUNTER_H diff --git a/Marlin_thinkerV2/Marlin/runout.cpp b/Marlin_thinkerV2/Marlin/runout.cpp deleted file mode 100644 index 44ca694df1..0000000000 --- a/Marlin_thinkerV2/Marlin/runout.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * runout.cpp - Runout sensor support - */ - -#include "MarlinConfig.h" - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - -#include "runout.h" - -FilamentRunoutSensor runout; - -bool FilamentRunoutSensor::filament_ran_out; // = false -uint8_t FilamentRunoutSensor::runout_count; // = 0 - -void FilamentRunoutSensor::setup() { - - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) - #endif - - INIT_RUNOUT_PIN(FIL_RUNOUT_PIN); - #if NUM_RUNOUT_SENSORS > 1 - INIT_RUNOUT_PIN(FIL_RUNOUT2_PIN); - #if NUM_RUNOUT_SENSORS > 2 - INIT_RUNOUT_PIN(FIL_RUNOUT3_PIN); - #if NUM_RUNOUT_SENSORS > 3 - INIT_RUNOUT_PIN(FIL_RUNOUT4_PIN); - #if NUM_RUNOUT_SENSORS > 4 - INIT_RUNOUT_PIN(FIL_RUNOUT5_PIN); - #endif - #endif - #endif - #endif -} - -#endif // FILAMENT_RUNOUT_SENSOR diff --git a/Marlin_thinkerV2/Marlin/runout.h b/Marlin_thinkerV2/Marlin/runout.h deleted file mode 100644 index c4c88b6c15..0000000000 --- a/Marlin_thinkerV2/Marlin/runout.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * runout.h - Runout sensor support - */ - -#ifndef _RUNOUT_H_ -#define _RUNOUT_H_ - -#include "cardreader.h" -#include "printcounter.h" -#include "stepper.h" -#include "Marlin.h" - -#include "MarlinConfig.h" - -#define FIL_RUNOUT_THRESHOLD 5 - -class FilamentRunoutSensor { - public: - FilamentRunoutSensor() {} - - static void setup(); - - FORCE_INLINE static void reset() { runout_count = 0; filament_ran_out = false; } - - FORCE_INLINE static void run() { - if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) { - filament_ran_out = true; - enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); - planner.synchronize(); - } - } - private: - static bool filament_ran_out; - static uint8_t runout_count; - - FORCE_INLINE static bool check() { - #if NUM_RUNOUT_SENSORS < 2 - // A single sensor applying to all extruders - const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; - #else - // Read the sensor for the active extruder - bool is_out; - switch (active_extruder) { - case 0: is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; break; - case 1: is_out = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 2 - case 2: is_out = READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 3 - case 3: is_out = READ(FIL_RUNOUT4_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 4 - case 4: is_out = READ(FIL_RUNOUT5_PIN) == FIL_RUNOUT_INVERTING; break; - #endif - #endif - #endif - } - #endif - return (is_out ? ++runout_count : (runout_count = 0)) > FIL_RUNOUT_THRESHOLD; - } -}; - -extern FilamentRunoutSensor runout; - -#endif // _RUNOUT_H_ diff --git a/Marlin_thinkerV2/Marlin/serial.cpp b/Marlin_thinkerV2/Marlin/serial.cpp deleted file mode 100644 index 8b6a1c2b49..0000000000 --- a/Marlin_thinkerV2/Marlin/serial.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "serial.h" - -const char errormagic[] PROGMEM = "Error:"; -const char echomagic[] PROGMEM = "echo:"; - -void serial_echopair_PGM(const char* s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } -void serial_echopair_PGM(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } - -void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } diff --git a/Marlin_thinkerV2/Marlin/serial.h b/Marlin_thinkerV2/Marlin/serial.h deleted file mode 100644 index 139f99c110..0000000000 --- a/Marlin_thinkerV2/Marlin/serial.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __SERIAL_H__ -#define __SERIAL_H__ - -#include "MarlinConfig.h" - -#if USE_MARLINSERIAL - #include "MarlinSerial.h" - #define MYSERIAL0 customizedSerial -#else - #include - #if ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; - #define MYSERIAL0 bluetoothSerial - #else - #define MYSERIAL0 Serial - #endif // BLUETOOTH -#endif - -extern const char echomagic[] PROGMEM; -extern const char errormagic[] PROGMEM; - -#define SERIAL_CHAR(x) ((void)MYSERIAL0.write(x)) -#define SERIAL_EOL() SERIAL_CHAR('\n') - -#define SERIAL_PRINT(x,b) MYSERIAL0.print(x,b) -#define SERIAL_PRINTLN(x,b) MYSERIAL0.println(x,b) -#define SERIAL_PRINTF(args...) MYSERIAL0.printf(args) - -#define SERIAL_FLUSH() MYSERIAL0.flush() -#if TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX() MYSERIAL0.flushTX() -#endif - -#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) -#define SERIAL_PROTOCOL(x) MYSERIAL0.print(x) -#define SERIAL_PROTOCOL_F(x,y) MYSERIAL0.print(x,y) -#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) -#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL0.print(x); SERIAL_EOL(); }while(0) -#define SERIAL_PROTOCOLLNPGM(x) serialprintPGM(PSTR(x "\n")) -#define SERIAL_PROTOCOLPAIR(name, value) serial_echopair_PGM(PSTR(name),(value)) -#define SERIAL_PROTOCOLLNPAIR(name, value) do{ SERIAL_PROTOCOLPAIR(name, value); SERIAL_EOL(); }while(0) - -#define SERIAL_ECHO_START() serialprintPGM(echomagic) -#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) -#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHOPAIR(pre,value) SERIAL_PROTOCOLPAIR(pre, value) -#define SERIAL_ECHOLNPAIR(pre,value) SERIAL_PROTOCOLLNPAIR(pre, value) -#define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y) - -#define SERIAL_ERROR_START() serialprintPGM(errormagic) -#define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) -#define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) - -// These macros compensate for float imprecision -#define SERIAL_PROTOCOLPAIR_F(pre, value) SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value)) -#define SERIAL_PROTOCOLLNPAIR_F(pre, value) SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value)) - -// -// Functions for serial printing from PROGMEM. (Saves loads of SRAM.) -// -FORCE_INLINE void serialprintPGM(const char* str) { - while (char ch = pgm_read_byte(str++)) SERIAL_CHAR(ch); -} - -void serial_echopair_PGM(const char* s_P, const char *v); -void serial_echopair_PGM(const char* s_P, char v); -void serial_echopair_PGM(const char* s_P, int v); -void serial_echopair_PGM(const char* s_P, long v); -void serial_echopair_PGM(const char* s_P, float v); -void serial_echopair_PGM(const char* s_P, double v); -void serial_echopair_PGM(const char* s_P, unsigned int v); -void serial_echopair_PGM(const char* s_P, unsigned long v); -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, uint16_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(const char* s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } - -void serial_spaces(uint8_t count); -#define SERIAL_ECHO_SP(C) serial_spaces(C) -#define SERIAL_ERROR_SP(C) serial_spaces(C) -#define SERIAL_PROTOCOL_SP(C) serial_spaces(C) - -#endif // __SERIAL_H__ diff --git a/Marlin_thinkerV2/Marlin/servo.cpp b/Marlin_thinkerV2/Marlin/servo.cpp deleted file mode 100644 index e1d11573ab..0000000000 --- a/Marlin_thinkerV2/Marlin/servo.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - */ - -/** - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin) - Attach a servo motor to an i/o pin. - * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds - * Default min is 544, max is 2400 - * - * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) - * writeMicroseconds() - Set the servo pulse width in microseconds. - * move(pin, angle) - Sequence of attach(pin), write(angle), delay(SERVO_DELAY). - * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after SERVO_DELAY. - * read() - Get the last-written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Get the last-written servo pulse width in microseconds. - * attached() - Return true if a servo is attached. - * detach() - Stop an attached servo from pulsing its i/o pin. - * - */ -#include "MarlinConfig.h" - -#if HAS_SERVOS - -#include -#include - -#include "servo.h" -#include "utility.h" - -#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009 -#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds - -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays // 12 August 2009 - -//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER)) - -static ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures -static volatile int8_t Channel[_Nbr_16timers ]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) - -uint8_t ServoCount = 0; // the total number of attached servos - - -// convenience macros -#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo -#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // returns the index of the servo on this timer -#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // macro to access servo index by timer and channel -#define SERVO(_timer,_channel) (servo_info[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel - -#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 - -/************ static functions common to all instances ***********************/ - -static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { - if (Channel[timer] < 0) - *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer - else { - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - } - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - *OCRnA = *TCNTn + SERVO(timer, Channel[timer]).ticks; - if (SERVO(timer, Channel[timer]).Pin.isActive) // check if activated - digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high - } - else { - // finished all channels so wait for the refresh period to expire before starting over - if (((unsigned)*TCNTn) + 4 < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - *OCRnA = (unsigned int)usToTicks(REFRESH_INTERVAL); - else - *OCRnA = *TCNTn + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - } -} - -#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform - - // Interrupt handlers for Arduino - #if ENABLED(_useTimer1) - SIGNAL (TIMER1_COMPA_vect) { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - - #if ENABLED(_useTimer3) - SIGNAL (TIMER3_COMPA_vect) { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - - #if ENABLED(_useTimer4) - SIGNAL (TIMER4_COMPA_vect) { handle_interrupts(_timer4, &TCNT4, &OCR4A); } - #endif - - #if ENABLED(_useTimer5) - SIGNAL (TIMER5_COMPA_vect) { handle_interrupts(_timer5, &TCNT5, &OCR5A); } - #endif - -#else // WIRING - - // Interrupt handlers for Wiring - #if ENABLED(_useTimer1) - void Timer1Service() { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - #if ENABLED(_useTimer3) - void Timer3Service() { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - -#endif // WIRING - - -static void initISR(timer16_Sequence_t timer) { - #if ENABLED(_useTimer1) - if (timer == _timer1) { - 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__) - SBI(TIFR, OCF1A); // clear any pending interrupts; - SBI(TIMSK, OCIE1A); // enable the output compare interrupt - #else - // here if not ATmega8 or ATmega128 - SBI(TIFR1, OCF1A); // clear any pending interrupts; - SBI(TIMSK1, OCIE1A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service); - #endif - } - #endif - - #if ENABLED(_useTimer3) - if (timer == _timer3) { - TCCR3A = 0; // normal counting mode - TCCR3B = _BV(CS31); // set prescaler of 8 - TCNT3 = 0; // clear the timer count - #ifdef __AVR_ATmega128__ - SBI(TIFR, OCF3A); // clear any pending interrupts; - SBI(ETIMSK, OCIE3A); // enable the output compare interrupt - #else - SBI(TIFR3, OCF3A); // clear any pending interrupts; - SBI(TIMSK3, OCIE3A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only - #endif - } - #endif - - #if ENABLED(_useTimer4) - if (timer == _timer4) { - TCCR4A = 0; // normal counting mode - TCCR4B = _BV(CS41); // set prescaler of 8 - TCNT4 = 0; // clear the timer count - TIFR4 = _BV(OCF4A); // clear any pending interrupts; - TIMSK4 = _BV(OCIE4A); // enable the output compare interrupt - } - #endif - - #if ENABLED(_useTimer5) - if (timer == _timer5) { - TCCR5A = 0; // normal counting mode - TCCR5B = _BV(CS51); // set prescaler of 8 - TCNT5 = 0; // clear the timer count - TIFR5 = _BV(OCF5A); // clear any pending interrupts; - TIMSK5 = _BV(OCIE5A); // enable the output compare interrupt - } - #endif -} - -static void finISR(timer16_Sequence_t timer) { - // Disable use of the given timer - #ifdef WIRING - if (timer == _timer1) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK1 - #else - TIMSK - #endif - , OCIE1A); // disable timer 1 output compare interrupt - timerDetach(TIMER1OUTCOMPAREA_INT); - } - else if (timer == _timer3) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK3 - #else - ETIMSK - #endif - , OCIE3A); // disable the timer3 output compare A interrupt - timerDetach(TIMER3OUTCOMPAREA_INT); - } - #else // !WIRING - // For arduino - in future: call here to a currently undefined function to reset the timer - UNUSED(timer); - #endif -} - -static bool isTimerActive(timer16_Sequence_t timer) { - // returns true if any servo is active on this timer - for (uint8_t channel = 0; channel < SERVOS_PER_TIMER; channel++) { - if (SERVO(timer, channel).Pin.isActive) - return true; - } - return false; -} - -/****************** end of static functions ******************************/ - -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 - } - else - this->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 pin, const int min, const int max) { - - if (this->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 - - // 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; - - // 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 - - return this->servoIndex; -} - -void Servo::detach() { - servo_info[this->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); -} - -void Servo::writeMicroseconds(int value) { - // calculate and store the values for the given channel - byte channel = this->servoIndex; - if (channel < MAX_SERVOS) { // ensure channel is valid - // ensure pulse width is valid - value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION); - value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 - - CRITICAL_SECTION_START; - servo_info[channel].ticks = value; - CRITICAL_SECTION_END; - } -} - -// return the value as degrees -int Servo::read() { return map(this->readMicroseconds() + 1, SERVO_MIN(), SERVO_MAX(), 0, 180); } - -int Servo::readMicroseconds() { - return (this->servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[this->servoIndex].ticks) + TRIM_DURATION; -} - -bool Servo::attached() { return servo_info[this->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 ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); - #endif - } -} - -#endif // HAS_SERVOS diff --git a/Marlin_thinkerV2/Marlin/servo.h b/Marlin_thinkerV2/Marlin/servo.h deleted file mode 100644 index 16496461e4..0000000000 --- a/Marlin_thinkerV2/Marlin/servo.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * The sequence used to seize timers is defined in timers.h - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin ) - Attaches a servo motor to an i/o pin. - * attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds - * default min is 544, max is 2400 - * - * write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) - * writeMicroseconds() - Sets the servo pulse width in microseconds - * read() - Gets the last written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) - * attached() - Returns true if there is a servo attached. - * detach() - Stops an attached servos from pulsing its i/o pin. - * move(angle) - Sequence of attach(0), write(angle), - * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. - */ - -#ifndef SERVO_H -#define SERVO_H - -#include - -/** - * Defines for 16 bit timers used with Servo library - * - * If _useTimerX is defined then TimerX is a 16 bit timer on the current board - * timer16_Sequence_t enumerates the sequence that the timers should be allocated - * _Nbr_16timers indicates how many 16 bit timers are available. - * - */ - -// Say which 16 bit timers can be used and in what order -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - //#define _useTimer1 // Timer 1 is used by the stepper ISR - #define _useTimer3 - #define _useTimer4 - #if !HAS_MOTOR_CURRENT_PWM - #define _useTimer5 // Timer 5 is used for motor current PWM and can't be used for servos. - #endif -#elif defined(__AVR_ATmega32U4__) - #define _useTimer3 -#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) - #define _useTimer3 -#elif defined(__AVR_ATmega128__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega2561__) - #define _useTimer3 -#else - // everything else -#endif - -typedef enum { - #if ENABLED(_useTimer1) - _timer1, - #endif - #if ENABLED(_useTimer3) - _timer3, - #endif - #if ENABLED(_useTimer4) - _timer4, - #endif - #if ENABLED(_useTimer5) - _timer5, - #endif - _Nbr_16timers -} timer16_Sequence_t; - -#define Servo_VERSION 2 // software version of this library - -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds - -#define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer -#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER) - -#define INVALID_SERVO 255 // flag indicating an invalid servo index - -typedef struct { - uint8_t nbr : 6 ; // a pin number from 0 to 63 - uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false -} ServoPin_t; - -typedef struct { - ServoPin_t Pin; - unsigned int ticks; -} ServoInfo_t; - -class Servo { - public: - Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - int8_t attach(const int pin, const int min, const int max); // as above but also sets min and max values for writes. - void detach(); - void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - void writeMicroseconds(int value); // write pulse width in microseconds - void move(const int value); // attach the servo, then move to value - // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach - int read(); // returns current pulse width as an angle between 0 and 180 degrees - int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) - bool attached(); // return true if this servo is attached, otherwise false - - private: - uint8_t servoIndex; // index into the channel data for this servo - int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH - int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH -}; - -#endif // SERVO_H diff --git a/Marlin_thinkerV2/Marlin/softspi.h b/Marlin_thinkerV2/Marlin/softspi.h deleted file mode 100644 index c9fbea01b4..0000000000 --- a/Marlin_thinkerV2/Marlin/softspi.h +++ /dev/null @@ -1,769 +0,0 @@ -//https://github.com/niteris/ArduinoSoftSpi - -#include -#ifdef __arm__ -#ifdef CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - return *portInputRegister(pin); -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value) { - if (value) { - *portSetRegister(pin) = 1; - } else { - *portClearRegister(pin) = 1; - } -} -#else // CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin){ - return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value){ - if (value) - g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else - g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; -} -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -inline void fastDigitalToggle(uint8_t pin) { - fastDigitalWrite(pin, !fastDigitalRead(pin)); - } -//------------------------------------------------------------------------------ -inline void fastPinMode(uint8_t pin, bool mode) {pinMode(pin, mode);} -#else // __arm__ -#include -#include -//------------------------------------------------------------------------------ -/** - * @class pin_map_t - * @brief struct for mapping digital pins - */ -struct pin_map_t { - volatile uint8_t* ddr; /**< address of DDR for this pin */ - volatile uint8_t* pin; /**< address of PIN for this pin */ - volatile uint8_t* port; /**< address of PORT for this pin */ - uint8_t bit; /**< bit number for this pin */ -}; -//------------------------------------------------------------------------------ -#if defined(__AVR_ATmega168__)\ -||defined(__AVR_ATmega168P__)\ -||defined(__AVR_ATmega328P__) -// 168 and 328 Arduinos -const static pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRB, &PINB, &PORTB, 0}, // B0 8 - {&DDRB, &PINB, &PORTB, 1}, // B1 9 - {&DDRB, &PINB, &PORTB, 2}, // B2 10 - {&DDRB, &PINB, &PORTB, 3}, // B3 11 - {&DDRB, &PINB, &PORTB, 4}, // B4 12 - {&DDRB, &PINB, &PORTB, 5}, // B5 13 - {&DDRC, &PINC, &PORTC, 0}, // C0 14 - {&DDRC, &PINC, &PORTC, 1}, // C1 15 - {&DDRC, &PINC, &PORTC, 2}, // C2 16 - {&DDRC, &PINC, &PORTC, 3}, // C3 17 - {&DDRC, &PINC, &PORTC, 4}, // C4 18 - {&DDRC, &PINC, &PORTC, 5} // C5 19 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1280__)\ -|| defined(__AVR_ATmega2560__) -// Mega -static const pin_map_t pinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 4}, // E4 2 - {&DDRE, &PINE, &PORTE, 5}, // E5 3 - {&DDRG, &PING, &PORTG, 5}, // G5 4 - {&DDRE, &PINE, &PORTE, 3}, // E3 5 - {&DDRH, &PINH, &PORTH, 3}, // H3 6 - {&DDRH, &PINH, &PORTH, 4}, // H4 7 - {&DDRH, &PINH, &PORTH, 5}, // H5 8 - {&DDRH, &PINH, &PORTH, 6}, // H6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 - {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 - {&DDRH, &PINH, &PORTH, 1}, // H1 16 - {&DDRH, &PINH, &PORTH, 0}, // H0 17 - {&DDRD, &PIND, &PORTD, 3}, // D3 18 - {&DDRD, &PIND, &PORTD, 2}, // D2 19 - {&DDRD, &PIND, &PORTD, 1}, // D1 20 - {&DDRD, &PIND, &PORTD, 0}, // D0 21 - {&DDRA, &PINA, &PORTA, 0}, // A0 22 - {&DDRA, &PINA, &PORTA, 1}, // A1 23 - {&DDRA, &PINA, &PORTA, 2}, // A2 24 - {&DDRA, &PINA, &PORTA, 3}, // A3 25 - {&DDRA, &PINA, &PORTA, 4}, // A4 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRA, &PINA, &PORTA, 6}, // A6 28 - {&DDRA, &PINA, &PORTA, 7}, // A7 29 - {&DDRC, &PINC, &PORTC, 7}, // C7 30 - {&DDRC, &PINC, &PORTC, 6}, // C6 31 - {&DDRC, &PINC, &PORTC, 5}, // C5 32 - {&DDRC, &PINC, &PORTC, 4}, // C4 33 - {&DDRC, &PINC, &PORTC, 3}, // C3 34 - {&DDRC, &PINC, &PORTC, 2}, // C2 35 - {&DDRC, &PINC, &PORTC, 1}, // C1 36 - {&DDRC, &PINC, &PORTC, 0}, // C0 37 - {&DDRD, &PIND, &PORTD, 7}, // D7 38 - {&DDRG, &PING, &PORTG, 2}, // G2 39 - {&DDRG, &PING, &PORTG, 1}, // G1 40 - {&DDRG, &PING, &PORTG, 0}, // G0 41 - {&DDRL, &PINL, &PORTL, 7}, // L7 42 - {&DDRL, &PINL, &PORTL, 6}, // L6 43 - {&DDRL, &PINL, &PORTL, 5}, // L5 44 - {&DDRL, &PINL, &PORTL, 4}, // L4 45 - {&DDRL, &PINL, &PORTL, 3}, // L3 46 - {&DDRL, &PINL, &PORTL, 2}, // L2 47 - {&DDRL, &PINL, &PORTL, 1}, // L1 48 - {&DDRL, &PINL, &PORTL, 0}, // L0 49 - {&DDRB, &PINB, &PORTB, 3}, // B3 50 - {&DDRB, &PINB, &PORTB, 2}, // B2 51 - {&DDRB, &PINB, &PORTB, 1}, // B1 52 - {&DDRB, &PINB, &PORTB, 0}, // B0 53 - {&DDRF, &PINF, &PORTF, 0}, // F0 54 - {&DDRF, &PINF, &PORTF, 1}, // F1 55 - {&DDRF, &PINF, &PORTF, 2}, // F2 56 - {&DDRF, &PINF, &PORTF, 3}, // F3 57 - {&DDRF, &PINF, &PORTF, 4}, // F4 58 - {&DDRF, &PINF, &PORTF, 5}, // F5 59 - {&DDRF, &PINF, &PORTF, 6}, // F6 60 - {&DDRF, &PINF, &PORTF, 7}, // F7 61 - {&DDRK, &PINK, &PORTK, 0}, // K0 62 - {&DDRK, &PINK, &PORTK, 1}, // K1 63 - {&DDRK, &PINK, &PORTK, 2}, // K2 64 - {&DDRK, &PINK, &PORTK, 3}, // K3 65 - {&DDRK, &PINK, &PORTK, 4}, // K4 66 - {&DDRK, &PINK, &PORTK, 5}, // K5 67 - {&DDRK, &PINK, &PORTK, 6}, // K6 68 - {&DDRK, &PINK, &PORTK, 7}, // K7 69 - -//pins_MIGHTYBOARD_REVE.h - {&DDRG, &PING, &PORTG, 4}, // G4 70 - {&DDRG, &PING, &PORTG, 3}, // G3 71 - {&DDRJ, &PINJ, &PORTJ, 2}, // J2 72 - {&DDRJ, &PINJ, &PORTJ, 3}, // J3 73 - {&DDRJ, &PINJ, &PORTJ, 7}, // J7 74 - {&DDRJ, &PINJ, &PORTJ, 4}, // J4 75 - {&DDRJ, &PINJ, &PORTJ, 5}, // J5 76 - {&DDRJ, &PINJ, &PORTJ, 6}, // J6 77 - {&DDRE, &PINE, &PORTE, 2}, // E2 78 - {&DDRE, &PINE, &PORTE, 6} // E6 79 - -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1284P__)\ -|| defined(__AVR_ATmega1284__)\ -|| defined(__AVR_ATmega644P__)\ -|| defined(__AVR_ATmega644__)\ -|| defined(__AVR_ATmega64__)\ -|| defined(__AVR_ATmega32__)\ -|| defined(__AVR_ATmega324__)\ -|| defined(__AVR_ATmega16__) - -#if defined(VARIANT_MIGHTY) -// Mighty Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 0}, // A0 24 - {&DDRA, &PINA, &PORTA, 1}, // A1 25 - {&DDRA, &PINA, &PORTA, 2}, // A2 26 - {&DDRA, &PINA, &PORTA, 3}, // A3 27 - {&DDRA, &PINA, &PORTA, 4}, // A4 28 - {&DDRA, &PINA, &PORTA, 5}, // A5 29 - {&DDRA, &PINA, &PORTA, 6}, // A6 30 - {&DDRA, &PINA, &PORTA, 7} // A7 31 -}; -#elif defined(VARIANT_BOBUINO) -// Bobuino Layout -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRB, &PINB, &PORTB, 0}, // B0 4 - {&DDRB, &PINB, &PORTB, 1}, // B1 5 - {&DDRB, &PINB, &PORTB, 2}, // B2 6 - {&DDRB, &PINB, &PORTB, 3}, // B3 7 - {&DDRD, &PIND, &PORTD, 5}, // D5 8 - {&DDRD, &PIND, &PORTD, 6}, // D6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRA, &PINA, &PORTA, 7}, // A7 14 - {&DDRA, &PINA, &PORTA, 6}, // A6 15 - {&DDRA, &PINA, &PORTA, 5}, // A5 16 - {&DDRA, &PINA, &PORTA, 4}, // A4 17 - {&DDRA, &PINA, &PORTA, 3}, // A3 18 - {&DDRA, &PINA, &PORTA, 2}, // A2 19 - {&DDRA, &PINA, &PORTA, 1}, // A1 20 - {&DDRA, &PINA, &PORTA, 0}, // A0 21 - {&DDRC, &PINC, &PORTC, 0}, // C0 22 - {&DDRC, &PINC, &PORTC, 1}, // C1 23 - {&DDRC, &PINC, &PORTC, 2}, // C2 24 - {&DDRC, &PINC, &PORTC, 3}, // C3 25 - {&DDRC, &PINC, &PORTC, 4}, // C4 26 - {&DDRC, &PINC, &PORTC, 5}, // C5 27 - {&DDRC, &PINC, &PORTC, 6}, // C6 28 - {&DDRC, &PINC, &PORTC, 7}, // C7 29 - {&DDRD, &PIND, &PORTD, 4}, // D4 30 - {&DDRD, &PIND, &PORTD, 7} // D7 31 -}; -#elif defined(VARIANT_STANDARD) -// Standard Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 7}, // A7 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRA, &PINA, &PORTA, 5}, // A5 26 - {&DDRA, &PINA, &PORTA, 4}, // A4 27 - {&DDRA, &PINA, &PORTA, 3}, // A3 28 - {&DDRA, &PINA, &PORTA, 2}, // A2 29 - {&DDRA, &PINA, &PORTA, 1}, // A1 30 - {&DDRA, &PINA, &PORTA, 0} // A0 31 -}; -#else // VARIANT_MIGHTY -#error Undefined variant 1284, 644, 324, 64, 32 -#endif // VARIANT_MIGHTY -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega32U4__) -#ifdef CORE_TEENSY -// Teensy 2.0 -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 7}, // B7 4 - {&DDRD, &PIND, &PORTD, 0}, // D0 5 - {&DDRD, &PIND, &PORTD, 1}, // D1 6 - {&DDRD, &PIND, &PORTD, 2}, // D2 7 - {&DDRD, &PIND, &PORTD, 3}, // D3 8 - {&DDRC, &PINC, &PORTC, 6}, // C6 9 - {&DDRC, &PINC, &PORTC, 7}, // C7 10 - {&DDRD, &PIND, &PORTD, 6}, // D6 11 - {&DDRD, &PIND, &PORTD, 7}, // D7 12 - {&DDRB, &PINB, &PORTB, 4}, // B4 13 - {&DDRB, &PINB, &PORTB, 5}, // B5 14 - {&DDRB, &PINB, &PORTB, 6}, // B6 15 - {&DDRF, &PINF, &PORTF, 7}, // F7 16 - {&DDRF, &PINF, &PORTF, 6}, // F6 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 4}, // F4 19 - {&DDRF, &PINF, &PORTF, 1}, // F1 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRD, &PIND, &PORTD, 4}, // D4 22 - {&DDRD, &PIND, &PORTD, 5}, // D5 23 - {&DDRE, &PINE, &PORTE, 6} // E6 24 -}; -//------------------------------------------------------------------------------ -#else // CORE_TEENSY -// Leonardo -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 2}, // D2 0 - {&DDRD, &PIND, &PORTD, 3}, // D3 1 - {&DDRD, &PIND, &PORTD, 1}, // D1 2 - {&DDRD, &PIND, &PORTD, 0}, // D0 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRC, &PINC, &PORTC, 6}, // C6 5 - {&DDRD, &PIND, &PORTD, 7}, // D7 6 - {&DDRE, &PINE, &PORTE, 6}, // E6 7 - {&DDRB, &PINB, &PORTB, 4}, // B4 8 - {&DDRB, &PINB, &PORTB, 5}, // B5 9 - {&DDRB, &PINB, &PORTB, 6}, // B6 10 - {&DDRB, &PINB, &PORTB, 7}, // B7 11 - {&DDRD, &PIND, &PORTD, 6}, // D6 12 - {&DDRC, &PINC, &PORTC, 7}, // C7 13 - {&DDRB, &PINB, &PORTB, 3}, // B3 14 - {&DDRB, &PINB, &PORTB, 1}, // B1 15 - {&DDRB, &PINB, &PORTB, 2}, // B2 16 - {&DDRB, &PINB, &PORTB, 0}, // B0 17 - {&DDRF, &PINF, &PORTF, 7}, // F7 18 - {&DDRF, &PINF, &PORTF, 6}, // F6 19 - {&DDRF, &PINF, &PORTF, 5}, // F5 20 - {&DDRF, &PINF, &PORTF, 4}, // F4 21 - {&DDRF, &PINF, &PORTF, 1}, // F1 22 - {&DDRF, &PINF, &PORTF, 0}, // F0 23 - {&DDRD, &PIND, &PORTD, 4}, // D4 24 - {&DDRD, &PIND, &PORTD, 7}, // D7 25 - {&DDRB, &PINB, &PORTB, 4}, // B4 26 - {&DDRB, &PINB, &PORTB, 5}, // B5 27 - {&DDRB, &PINB, &PORTB, 6}, // B6 28 - {&DDRD, &PIND, &PORTD, 6} // D6 29 -}; -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -#elif defined(__AVR_AT90USB646__)\ -|| defined(__AVR_AT90USB1286__) -// Teensy++ 1.0 & 2.0 -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRE, &PINE, &PORTE, 0}, // E0 8 - {&DDRE, &PINE, &PORTE, 1}, // E1 9 - {&DDRC, &PINC, &PORTC, 0}, // C0 10 - {&DDRC, &PINC, &PORTC, 1}, // C1 11 - {&DDRC, &PINC, &PORTC, 2}, // C2 12 - {&DDRC, &PINC, &PORTC, 3}, // C3 13 - {&DDRC, &PINC, &PORTC, 4}, // C4 14 - {&DDRC, &PINC, &PORTC, 5}, // C5 15 - {&DDRC, &PINC, &PORTC, 6}, // C6 16 - {&DDRC, &PINC, &PORTC, 7}, // C7 17 - {&DDRE, &PINE, &PORTE, 6}, // E6 18 - {&DDRE, &PINE, &PORTE, 7}, // E7 19 - {&DDRB, &PINB, &PORTB, 0}, // B0 20 - {&DDRB, &PINB, &PORTB, 1}, // B1 21 - {&DDRB, &PINB, &PORTB, 2}, // B2 22 - {&DDRB, &PINB, &PORTB, 3}, // B3 23 - {&DDRB, &PINB, &PORTB, 4}, // B4 24 - {&DDRB, &PINB, &PORTB, 5}, // B5 25 - {&DDRB, &PINB, &PORTB, 6}, // B6 26 - {&DDRB, &PINB, &PORTB, 7}, // B7 27 - {&DDRA, &PINA, &PORTA, 0}, // A0 28 - {&DDRA, &PINA, &PORTA, 1}, // A1 29 - {&DDRA, &PINA, &PORTA, 2}, // A2 30 - {&DDRA, &PINA, &PORTA, 3}, // A3 31 - {&DDRA, &PINA, &PORTA, 4}, // A4 32 - {&DDRA, &PINA, &PORTA, 5}, // A5 33 - {&DDRA, &PINA, &PORTA, 6}, // A6 34 - {&DDRA, &PINA, &PORTA, 7}, // A7 35 - {&DDRE, &PINE, &PORTE, 4}, // E4 36 - {&DDRE, &PINE, &PORTE, 5}, // E5 37 - {&DDRF, &PINF, &PORTF, 0}, // F0 38 - {&DDRF, &PINF, &PORTF, 1}, // F1 39 - {&DDRF, &PINF, &PORTF, 2}, // F2 40 - {&DDRF, &PINF, &PORTF, 3}, // F3 41 - {&DDRF, &PINF, &PORTF, 4}, // F4 42 - {&DDRF, &PINF, &PORTF, 5}, // F5 43 - {&DDRF, &PINF, &PORTF, 6}, // F6 44 - {&DDRF, &PINF, &PORTF, 7} // F7 45 -}; -//------------------------------------------------------------------------------ -#else // CPU type -#error unknown CPU type -#endif // CPU type -//------------------------------------------------------------------------------ -/** count of pins */ -static const uint8_t digitalPinCount = sizeof(pinMap)/sizeof(pin_map_t); -//============================================================================== -/** generate bad pin number error */ -void badPinNumber(void) - __attribute__((error("Pin number is too large or not a constant"))); -//------------------------------------------------------------------------------ -/** Check for valid pin number - * @param[in] pin Number of pin to be checked. - */ -static inline __attribute__((always_inline)) -void badPinCheck(uint8_t pin) { - if (!__builtin_constant_p(pin) || pin >= digitalPinCount) { - badPinNumber(); - } -} -//------------------------------------------------------------------------------ -/** fast write helper - * @param[in] address I/O register address - * @param[in] bit bit number to write - * @param[in] level value for bit - */ -static inline __attribute__((always_inline)) -void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) { - uint8_t oldSREG; - if (address > (uint8_t*)0x5F) { - oldSREG = SREG; - cli(); - } - if (level) { - *address |= 1 << bit; - } else { - *address &= ~(1 << bit); - } - if (address > (uint8_t*)0x5F) { - SREG = oldSREG; - } -} -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - badPinCheck(pin); - return (*pinMap[pin].pin >> pinMap[pin].bit) & 1; -} -//------------------------------------------------------------------------------ -/** toggle a pin - * @param[in] pin Arduino pin number - * - * If the pin is in output mode toggle the pin level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ -static inline __attribute__((always_inline)) -void fastDigitalToggle(uint8_t pin) { - badPinCheck(pin); - if (pinMap[pin].pin > (uint8_t*)0x5F) { - // must write bit to high address port - *pinMap[pin].pin = 1 << pinMap[pin].bit; - } else { - // will compile to sbi and PIN register will not be read. - *pinMap[pin].pin |= 1 << pinMap[pin].bit; - } -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool level) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, level); -} -//------------------------------------------------------------------------------ -/** set pin mode - * @param[in] pin Arduino pin number - * @param[in] mode if true set output mode else input mode - * - * fastPinMode does not enable or disable the 20K pullup for input mode. - */ -static inline __attribute__((always_inline)) -void fastPinMode(uint8_t pin, bool mode) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].ddr, pinMap[pin].bit, mode); -} - -#endif // __arm__ -//------------------------------------------------------------------------------ -/** set pin configuration - * @param[in] pin Arduino pin number - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ -static inline __attribute__((always_inline)) -void fastPinConfig(uint8_t pin, bool mode, bool level) { - fastPinMode(pin, mode); - fastDigitalWrite(pin, level); -} -//============================================================================== -/** - * @class DigitalPin - * @brief Fast digital port I/O - */ -template -class DigitalPin { - public: - //---------------------------------------------------------------------------- - /** Constructor */ - DigitalPin() {} - //---------------------------------------------------------------------------- - /** Constructor - * @param[in] pinMode if true set output mode else input mode. - */ - explicit DigitalPin(bool pinMode) { - mode(pinMode); - } - //---------------------------------------------------------------------------- - /** Constructor - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - DigitalPin(bool mode, bool level) { - config(mode, level); - } - //---------------------------------------------------------------------------- - /** Asignment operator - * @param[in] value If true set the pin's level high else set the - * pin's level low. - * - * @return This DigitalPin instance. - */ - inline DigitalPin & operator = (bool value) __attribute__((always_inline)) { - write(value); - return *this; - } - //---------------------------------------------------------------------------- - /** Parenthesis operator - * @return Pin's level - */ - inline operator bool () const __attribute__((always_inline)) { - return read(); - } - //---------------------------------------------------------------------------- - /** set pin configuration - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - inline __attribute__((always_inline)) - void config(bool mode, bool level) { - fastPinConfig(PinNumber, mode, level); - } - //---------------------------------------------------------------------------- - /** - * Set pin level high if output mode or enable 20K pullup if input mode. - */ - inline __attribute__((always_inline)) - void high() {write(true);} - //---------------------------------------------------------------------------- - /** - * Set pin level low if output mode or disable 20K pullup if input mode. - */ - inline __attribute__((always_inline)) - void low() {write(false);} - //---------------------------------------------------------------------------- - /** - * Set pin mode - * @param[in] pinMode if true set output mode else input mode. - * - * mode() does not enable or disable the 20K pullup for input mode. - */ - inline __attribute__((always_inline)) - void mode(bool pinMode) { - fastPinMode(PinNumber, pinMode); - } - //---------------------------------------------------------------------------- - /** @return Pin's level */ - inline __attribute__((always_inline)) - bool read() const { - return fastDigitalRead(PinNumber); - } - //---------------------------------------------------------------------------- - /** toggle a pin - * - * If the pin is in output mode toggle the pin's level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ - inline __attribute__((always_inline)) - void toggle() { - fastDigitalToggle(PinNumber); - } - //---------------------------------------------------------------------------- - /** Write the pin's level. - * @param[in] value If true set the pin's level high else set the - * pin's level low. - */ - inline __attribute__((always_inline)) - void write(bool value) { - fastDigitalWrite(PinNumber, value); - } -}; - -//------------------------------------------------------------------------------ -/** Nop for timing. */ -#define nop asm volatile ("nop\n\t") -//------------------------------------------------------------------------------ -/** Pin Mode for MISO is input.*/ -const bool MISO_MODE = false; -/** Pullups disabled for MISO are disabled. */ -const bool MISO_LEVEL = false; -/** Pin Mode for MOSI is output.*/ -const bool MOSI_MODE = true; -/** Pin Mode for SCK is output. */ -const bool SCK_MODE = true; -//------------------------------------------------------------------------------ -/** - * @class SoftSPI - * @brief Fast software SPI. - */ -template -class SoftSPI { - public: - //---------------------------------------------------------------------------- - /** Initialize SoftSPI pins. */ - void begin() { - fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL); - fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode)); - fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode)); - } - //---------------------------------------------------------------------------- - /** Soft SPI receive byte. - * @return Data byte received. - */ - inline __attribute__((always_inline)) - uint8_t receive() { - uint8_t data = 0; - receiveBit(7, &data); - receiveBit(6, &data); - receiveBit(5, &data); - receiveBit(4, &data); - receiveBit(3, &data); - receiveBit(2, &data); - receiveBit(1, &data); - receiveBit(0, &data); - return data; - } - //---------------------------------------------------------------------------- - /** Soft SPI send byte. - * @param[in] data Data byte to send. - */ - inline __attribute__((always_inline)) - void send(uint8_t data) { - sendBit(7, data); - sendBit(6, data); - sendBit(5, data); - sendBit(4, data); - sendBit(3, data); - sendBit(2, data); - sendBit(1, data); - sendBit(0, data); - } - //---------------------------------------------------------------------------- - /** Soft SPI transfer byte. - * @param[in] txData Data byte to send. - * @return Data byte received. - */ - inline __attribute__((always_inline)) - uint8_t transfer(uint8_t txData) { - uint8_t rxData = 0; - transferBit(7, &rxData, txData); - transferBit(6, &rxData, txData); - transferBit(5, &rxData, txData); - transferBit(4, &rxData, txData); - transferBit(3, &rxData, txData); - transferBit(2, &rxData, txData); - transferBit(1, &rxData, txData); - transferBit(0, &rxData, txData); - return rxData; - } - - private: - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - bool MODE_CPHA(uint8_t mode) {return (mode & 1) != 0;} - inline __attribute__((always_inline)) - bool MODE_CPOL(uint8_t mode) {return (mode & 2) != 0;} - inline __attribute__((always_inline)) - void receiveBit(uint8_t bit, uint8_t* data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - nop; - nop; - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *data |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void sendBit(uint8_t bit, uint8_t data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, data & (1 << bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - nop; - nop; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, txData & (1 << bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *rxData |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - } - //---------------------------------------------------------------------------- -}; - - diff --git a/Marlin_thinkerV2/Marlin/speed_lookuptable.h b/Marlin_thinkerV2/Marlin/speed_lookuptable.h deleted file mode 100644 index 72e96e0f86..0000000000 --- a/Marlin_thinkerV2/Marlin/speed_lookuptable.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef SPEED_LOOKUPTABLE_H -#define SPEED_LOOKUPTABLE_H - -#include "MarlinConfig.h" - -#if F_CPU == 16000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, - { 961, 105}, { 856, 85}, { 771, 69}, { 702, 58}, { 644, 49}, { 595, 42}, { 553, 37}, { 516, 32}, - { 484, 28}, { 456, 25}, { 431, 23}, { 408, 20}, { 388, 19}, { 369, 16}, { 353, 16}, { 337, 14}, - { 323, 13}, { 310, 11}, { 299, 11}, { 288, 11}, { 277, 9}, { 268, 9}, { 259, 8}, { 251, 8}, - { 243, 8}, { 235, 7}, { 228, 6}, { 222, 6}, { 216, 6}, { 210, 6}, { 204, 5}, { 199, 5}, - { 194, 5}, { 189, 4}, { 185, 4}, { 181, 4}, { 177, 4}, { 173, 4}, { 169, 4}, { 165, 3}, - { 162, 3}, { 159, 4}, { 155, 3}, { 152, 3}, { 149, 2}, { 147, 3}, { 144, 3}, { 141, 2}, - { 139, 3}, { 136, 2}, { 134, 2}, { 132, 3}, { 129, 2}, { 127, 2}, { 125, 2}, { 123, 2}, - { 121, 2}, { 119, 1}, { 118, 2}, { 116, 2}, { 114, 1}, { 113, 2}, { 111, 2}, { 109, 1}, - { 108, 2}, { 106, 1}, { 105, 2}, { 103, 1}, { 102, 1}, { 101, 1}, { 100, 2}, { 98, 1}, - { 97, 1}, { 96, 1}, { 95, 2}, { 93, 1}, { 92, 1}, { 91, 1}, { 90, 1}, { 89, 1}, - { 88, 1}, { 87, 1}, { 86, 1}, { 85, 1}, { 84, 1}, { 83, 0}, { 83, 1}, { 82, 1}, - { 81, 1}, { 80, 1}, { 79, 1}, { 78, 0}, { 78, 1}, { 77, 1}, { 76, 1}, { 75, 0}, - { 75, 1}, { 74, 1}, { 73, 1}, { 72, 0}, { 72, 1}, { 71, 1}, { 70, 0}, { 70, 1}, - { 69, 0}, { 69, 1}, { 68, 1}, { 67, 0}, { 67, 1}, { 66, 0}, { 66, 1}, { 65, 0}, - { 65, 1}, { 64, 1}, { 63, 0}, { 63, 1}, { 62, 0}, { 62, 1}, { 61, 0}, { 61, 1}, - { 60, 0}, { 60, 0}, { 60, 1}, { 59, 0}, { 59, 1}, { 58, 0}, { 58, 1}, { 57, 0}, - { 57, 1}, { 56, 0}, { 56, 0}, { 56, 1}, { 55, 0}, { 55, 1}, { 54, 0}, { 54, 0}, - { 54, 1}, { 53, 0}, { 53, 0}, { 53, 1}, { 52, 0}, { 52, 0}, { 52, 1}, { 51, 0}, - { 51, 0}, { 51, 1}, { 50, 0}, { 50, 0}, { 50, 1}, { 49, 0}, { 49, 0}, { 49, 1}, - { 48, 0}, { 48, 0}, { 48, 1}, { 47, 0}, { 47, 0}, { 47, 0}, { 47, 1}, { 46, 0}, - { 46, 0}, { 46, 1}, { 45, 0}, { 45, 0}, { 45, 0}, { 45, 1}, { 44, 0}, { 44, 0}, - { 44, 0}, { 44, 1}, { 43, 0}, { 43, 0}, { 43, 0}, { 43, 1}, { 42, 0}, { 42, 0}, - { 42, 0}, { 42, 1}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 1}, { 40, 0}, - { 40, 0}, { 40, 0}, { 40, 0}, { 40, 1}, { 39, 0}, { 39, 0}, { 39, 0}, { 39, 0}, - { 39, 1}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 1}, { 37, 0}, { 37, 0}, - { 37, 0}, { 37, 0}, { 37, 0}, { 37, 1}, { 36, 0}, { 36, 0}, { 36, 0}, { 36, 0}, - { 36, 1}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 1}, - { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 1}, { 33, 0}, { 33, 0}, - { 33, 0}, { 33, 0}, { 33, 0}, { 33, 0}, { 33, 1}, { 32, 0}, { 32, 0}, { 32, 0}, - { 32, 0}, { 32, 0}, { 32, 0}, { 32, 0}, { 32, 1}, { 31, 0}, { 31, 0}, { 31, 0}, - { 31, 0}, { 31, 0}, { 31, 0}, { 31, 1}, { 30, 0}, { 30, 0}, { 30, 0}, { 30, 0} - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - { 62500, 12500}, { 50000, 8334}, { 41666, 5952}, { 35714, 4464}, { 31250, 3473}, { 27777, 2777}, { 25000, 2273}, { 22727, 1894}, - { 20833, 1603}, { 19230, 1373}, { 17857, 1191}, { 16666, 1041}, { 15625, 920}, { 14705, 817}, { 13888, 731}, { 13157, 657}, - { 12500, 596}, { 11904, 541}, { 11363, 494}, { 10869, 453}, { 10416, 416}, { 10000, 385}, { 9615, 356}, { 9259, 331}, - { 8928, 308}, { 8620, 287}, { 8333, 269}, { 8064, 252}, { 7812, 237}, { 7575, 223}, { 7352, 210}, { 7142, 198}, - { 6944, 188}, { 6756, 178}, { 6578, 168}, { 6410, 160}, { 6250, 153}, { 6097, 145}, { 5952, 139}, { 5813, 132}, - { 5681, 126}, { 5555, 121}, { 5434, 115}, { 5319, 111}, { 5208, 106}, { 5102, 102}, { 5000, 99}, { 4901, 94}, - { 4807, 91}, { 4716, 87}, { 4629, 84}, { 4545, 81}, { 4464, 79}, { 4385, 75}, { 4310, 73}, { 4237, 71}, - { 4166, 68}, { 4098, 66}, { 4032, 64}, { 3968, 62}, { 3906, 60}, { 3846, 59}, { 3787, 56}, { 3731, 55}, - { 3676, 53}, { 3623, 52}, { 3571, 50}, { 3521, 49}, { 3472, 48}, { 3424, 46}, { 3378, 45}, { 3333, 44}, - { 3289, 43}, { 3246, 41}, { 3205, 41}, { 3164, 39}, { 3125, 39}, { 3086, 38}, { 3048, 36}, { 3012, 36}, - { 2976, 35}, { 2941, 35}, { 2906, 33}, { 2873, 33}, { 2840, 32}, { 2808, 31}, { 2777, 30}, { 2747, 30}, - { 2717, 29}, { 2688, 29}, { 2659, 28}, { 2631, 27}, { 2604, 27}, { 2577, 26}, { 2551, 26}, { 2525, 25}, - { 2500, 25}, { 2475, 25}, { 2450, 23}, { 2427, 24}, { 2403, 23}, { 2380, 22}, { 2358, 22}, { 2336, 22}, - { 2314, 21}, { 2293, 21}, { 2272, 20}, { 2252, 20}, { 2232, 20}, { 2212, 20}, { 2192, 19}, { 2173, 18}, - { 2155, 19}, { 2136, 18}, { 2118, 18}, { 2100, 17}, { 2083, 17}, { 2066, 17}, { 2049, 17}, { 2032, 16}, - { 2016, 16}, { 2000, 16}, { 1984, 16}, { 1968, 15}, { 1953, 16}, { 1937, 14}, { 1923, 15}, { 1908, 15}, - { 1893, 14}, { 1879, 14}, { 1865, 14}, { 1851, 13}, { 1838, 14}, { 1824, 13}, { 1811, 13}, { 1798, 13}, - { 1785, 12}, { 1773, 13}, { 1760, 12}, { 1748, 12}, { 1736, 12}, { 1724, 12}, { 1712, 12}, { 1700, 11}, - { 1689, 12}, { 1677, 11}, { 1666, 11}, { 1655, 11}, { 1644, 11}, { 1633, 10}, { 1623, 11}, { 1612, 10}, - { 1602, 10}, { 1592, 10}, { 1582, 10}, { 1572, 10}, { 1562, 10}, { 1552, 9}, { 1543, 10}, { 1533, 9}, - { 1524, 9}, { 1515, 9}, { 1506, 9}, { 1497, 9}, { 1488, 9}, { 1479, 9}, { 1470, 9}, { 1461, 8}, - { 1453, 8}, { 1445, 9}, { 1436, 8}, { 1428, 8}, { 1420, 8}, { 1412, 8}, { 1404, 8}, { 1396, 8}, - { 1388, 7}, { 1381, 8}, { 1373, 7}, { 1366, 8}, { 1358, 7}, { 1351, 7}, { 1344, 8}, { 1336, 7}, - { 1329, 7}, { 1322, 7}, { 1315, 7}, { 1308, 6}, { 1302, 7}, { 1295, 7}, { 1288, 6}, { 1282, 7}, - { 1275, 6}, { 1269, 7}, { 1262, 6}, { 1256, 6}, { 1250, 7}, { 1243, 6}, { 1237, 6}, { 1231, 6}, - { 1225, 6}, { 1219, 6}, { 1213, 6}, { 1207, 6}, { 1201, 5}, { 1196, 6}, { 1190, 6}, { 1184, 5}, - { 1179, 6}, { 1173, 5}, { 1168, 6}, { 1162, 5}, { 1157, 5}, { 1152, 6}, { 1146, 5}, { 1141, 5}, - { 1136, 5}, { 1131, 5}, { 1126, 5}, { 1121, 5}, { 1116, 5}, { 1111, 5}, { 1106, 5}, { 1101, 5}, - { 1096, 5}, { 1091, 5}, { 1086, 4}, { 1082, 5}, { 1077, 5}, { 1072, 4}, { 1068, 5}, { 1063, 4}, - { 1059, 5}, { 1054, 4}, { 1050, 4}, { 1046, 5}, { 1041, 4}, { 1037, 4}, { 1033, 5}, { 1028, 4}, - { 1024, 4}, { 1020, 4}, { 1016, 4}, { 1012, 4}, { 1008, 4}, { 1004, 4}, { 1000, 4}, { 996, 4}, - { 992, 4}, { 988, 4}, { 984, 4}, { 980, 4}, { 976, 4}, { 972, 4}, { 968, 3}, { 965, 3} - }; - -#elif F_CPU == 20000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - {62500, 54055}, {8445, 3917}, {4528, 1434}, {3094, 745}, {2349, 456}, {1893, 307}, {1586, 222}, {1364, 167}, - {1197, 131}, {1066, 105}, {961, 86}, {875, 72}, {803, 61}, {742, 53}, {689, 45}, {644, 40}, - {604, 35}, {569, 32}, {537, 28}, {509, 25}, {484, 23}, {461, 21}, {440, 19}, {421, 17}, - {404, 16}, {388, 15}, {373, 14}, {359, 13}, {346, 12}, {334, 11}, {323, 10}, {313, 10}, - {303, 9}, {294, 9}, {285, 8}, {277, 7}, {270, 8}, {262, 7}, {255, 6}, {249, 6}, - {243, 6}, {237, 6}, {231, 5}, {226, 5}, {221, 5}, {216, 5}, {211, 4}, {207, 5}, - {202, 4}, {198, 4}, {194, 4}, {190, 3}, {187, 4}, {183, 3}, {180, 3}, {177, 4}, - {173, 3}, {170, 3}, {167, 2}, {165, 3}, {162, 3}, {159, 2}, {157, 3}, {154, 2}, - {152, 3}, {149, 2}, {147, 2}, {145, 2}, {143, 2}, {141, 2}, {139, 2}, {137, 2}, - {135, 2}, {133, 2}, {131, 2}, {129, 1}, {128, 2}, {126, 2}, {124, 1}, {123, 2}, - {121, 1}, {120, 2}, {118, 1}, {117, 1}, {116, 2}, {114, 1}, {113, 1}, {112, 2}, - {110, 1}, {109, 1}, {108, 1}, {107, 2}, {105, 1}, {104, 1}, {103, 1}, {102, 1}, - {101, 1}, {100, 1}, {99, 1}, {98, 1}, {97, 1}, {96, 1}, {95, 1}, {94, 1}, - {93, 1}, {92, 1}, {91, 0}, {91, 1}, {90, 1}, {89, 1}, {88, 1}, {87, 0}, - {87, 1}, {86, 1}, {85, 1}, {84, 0}, {84, 1}, {83, 1}, {82, 1}, {81, 0}, - {81, 1}, {80, 1}, {79, 0}, {79, 1}, {78, 0}, {78, 1}, {77, 1}, {76, 0}, - {76, 1}, {75, 0}, {75, 1}, {74, 1}, {73, 0}, {73, 1}, {72, 0}, {72, 1}, - {71, 0}, {71, 1}, {70, 0}, {70, 1}, {69, 0}, {69, 1}, {68, 0}, {68, 1}, - {67, 0}, {67, 1}, {66, 0}, {66, 1}, {65, 0}, {65, 0}, {65, 1}, {64, 0}, - {64, 1}, {63, 0}, {63, 1}, {62, 0}, {62, 0}, {62, 1}, {61, 0}, {61, 1}, - {60, 0}, {60, 0}, {60, 1}, {59, 0}, {59, 0}, {59, 1}, {58, 0}, {58, 0}, - {58, 1}, {57, 0}, {57, 0}, {57, 1}, {56, 0}, {56, 0}, {56, 1}, {55, 0}, - {55, 0}, {55, 1}, {54, 0}, {54, 0}, {54, 1}, {53, 0}, {53, 0}, {53, 0}, - {53, 1}, {52, 0}, {52, 0}, {52, 1}, {51, 0}, {51, 0}, {51, 0}, {51, 1}, - {50, 0}, {50, 0}, {50, 0}, {50, 1}, {49, 0}, {49, 0}, {49, 0}, {49, 1}, - {48, 0}, {48, 0}, {48, 0}, {48, 1}, {47, 0}, {47, 0}, {47, 0}, {47, 1}, - {46, 0}, {46, 0}, {46, 0}, {46, 0}, {46, 1}, {45, 0}, {45, 0}, {45, 0}, - {45, 1}, {44, 0}, {44, 0}, {44, 0}, {44, 0}, {44, 1}, {43, 0}, {43, 0}, - {43, 0}, {43, 0}, {43, 1}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, - {42, 1}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 1}, {40, 0}, - {40, 0}, {40, 0}, {40, 0}, {40, 1}, {39, 0}, {39, 0}, {39, 0}, {39, 0}, - {39, 0}, {39, 0}, {39, 1}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - {62500, 10417}, {52083, 7441}, {44642, 5580}, {39062, 4340}, {34722, 3472}, {31250, 2841}, {28409, 2368}, {26041, 2003}, - {24038, 1717}, {22321, 1488}, {20833, 1302}, {19531, 1149}, {18382, 1021}, {17361, 914}, {16447, 822}, {15625, 745}, - {14880, 676}, {14204, 618}, {13586, 566}, {13020, 520}, {12500, 481}, {12019, 445}, {11574, 414}, {11160, 385}, - {10775, 359}, {10416, 336}, {10080, 315}, {9765, 296}, {9469, 278}, {9191, 263}, {8928, 248}, {8680, 235}, - {8445, 222}, {8223, 211}, {8012, 200}, {7812, 191}, {7621, 181}, {7440, 173}, {7267, 165}, {7102, 158}, - {6944, 151}, {6793, 145}, {6648, 138}, {6510, 133}, {6377, 127}, {6250, 123}, {6127, 118}, {6009, 113}, - {5896, 109}, {5787, 106}, {5681, 101}, {5580, 98}, {5482, 95}, {5387, 91}, {5296, 88}, {5208, 86}, - {5122, 82}, {5040, 80}, {4960, 78}, {4882, 75}, {4807, 73}, {4734, 70}, {4664, 69}, {4595, 67}, - {4528, 64}, {4464, 63}, {4401, 61}, {4340, 60}, {4280, 58}, {4222, 56}, {4166, 55}, {4111, 53}, - {4058, 52}, {4006, 51}, {3955, 49}, {3906, 48}, {3858, 48}, {3810, 45}, {3765, 45}, {3720, 44}, - {3676, 43}, {3633, 42}, {3591, 40}, {3551, 40}, {3511, 39}, {3472, 38}, {3434, 38}, {3396, 36}, - {3360, 36}, {3324, 35}, {3289, 34}, {3255, 34}, {3221, 33}, {3188, 32}, {3156, 31}, {3125, 31}, - {3094, 31}, {3063, 30}, {3033, 29}, {3004, 28}, {2976, 28}, {2948, 28}, {2920, 27}, {2893, 27}, - {2866, 26}, {2840, 25}, {2815, 25}, {2790, 25}, {2765, 24}, {2741, 24}, {2717, 24}, {2693, 23}, - {2670, 22}, {2648, 22}, {2626, 22}, {2604, 22}, {2582, 21}, {2561, 21}, {2540, 20}, {2520, 20}, - {2500, 20}, {2480, 20}, {2460, 19}, {2441, 19}, {2422, 19}, {2403, 18}, {2385, 18}, {2367, 18}, - {2349, 17}, {2332, 18}, {2314, 17}, {2297, 16}, {2281, 17}, {2264, 16}, {2248, 16}, {2232, 16}, - {2216, 16}, {2200, 15}, {2185, 15}, {2170, 15}, {2155, 15}, {2140, 15}, {2125, 14}, {2111, 14}, - {2097, 14}, {2083, 14}, {2069, 14}, {2055, 13}, {2042, 13}, {2029, 13}, {2016, 13}, {2003, 13}, - {1990, 13}, {1977, 12}, {1965, 12}, {1953, 13}, {1940, 11}, {1929, 12}, {1917, 12}, {1905, 12}, - {1893, 11}, {1882, 11}, {1871, 11}, {1860, 11}, {1849, 11}, {1838, 11}, {1827, 11}, {1816, 10}, - {1806, 11}, {1795, 10}, {1785, 10}, {1775, 10}, {1765, 10}, {1755, 10}, {1745, 9}, {1736, 10}, - {1726, 9}, {1717, 10}, {1707, 9}, {1698, 9}, {1689, 9}, {1680, 9}, {1671, 9}, {1662, 9}, - {1653, 9}, {1644, 8}, {1636, 9}, {1627, 8}, {1619, 9}, {1610, 8}, {1602, 8}, {1594, 8}, - {1586, 8}, {1578, 8}, {1570, 8}, {1562, 8}, {1554, 7}, {1547, 8}, {1539, 8}, {1531, 7}, - {1524, 8}, {1516, 7}, {1509, 7}, {1502, 7}, {1495, 7}, {1488, 7}, {1481, 7}, {1474, 7}, - {1467, 7}, {1460, 7}, {1453, 7}, {1446, 6}, {1440, 7}, {1433, 7}, {1426, 6}, {1420, 6}, - {1414, 7}, {1407, 6}, {1401, 6}, {1395, 7}, {1388, 6}, {1382, 6}, {1376, 6}, {1370, 6}, - {1364, 6}, {1358, 6}, {1352, 6}, {1346, 5}, {1341, 6}, {1335, 6}, {1329, 5}, {1324, 6}, - {1318, 5}, {1313, 6}, {1307, 5}, {1302, 6}, {1296, 5}, {1291, 5}, {1286, 6}, {1280, 5}, - {1275, 5}, {1270, 5}, {1265, 5}, {1260, 5}, {1255, 5}, {1250, 5}, {1245, 5}, {1240, 5}, - {1235, 5}, {1230, 5}, {1225, 5}, {1220, 5}, {1215, 4}, {1211, 5}, {1206, 5}, {1201, 5}, - }; - -#endif - -#endif // SPEED_LOOKUPTABLE_H diff --git a/Marlin_thinkerV2/Marlin/status_screen_DOGM.h b/Marlin_thinkerV2/Marlin/status_screen_DOGM.h deleted file mode 100644 index 98678807be..0000000000 --- a/Marlin_thinkerV2/Marlin/status_screen_DOGM.h +++ /dev/null @@ -1,493 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * status_screen_DOGM.h - * - * Standard Status Screen for Graphical Display - */ - -#ifndef _STATUS_SCREEN_DOGM_H_ -#define _STATUS_SCREEN_DOGM_H_ - -FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t x, const uint8_t y) { - const char * const str = itostr3(temp); - u8g.setPrintPos(x - (str[0] != ' ' ? 0 : str[1] != ' ' ? 1 : 2) * DOG_CHAR_WIDTH / 2, y); - lcd_print(str); - lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); -} - -#ifndef HEAT_INDICATOR_X - #define HEAT_INDICATOR_X 8 -#endif - -FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, const bool blink) { - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif - - #if HAS_HEATED_BED - const bool isBed = heater < 0; - #else - constexpr bool isBed = false; - #endif - - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : - #endif - thermalManager.is_heater_idle(heater) - ); - - if (blink || !is_idle) - #endif - _draw_centered_temp(0.5f + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degTargetBed() : - #endif - thermalManager.degTargetHotend(heater) - ), x, 7 - ); - } - - if (PAGE_CONTAINS(21, 28)) { - _draw_centered_temp(0.5f + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degBed() : - #endif - thermalManager.degHotend(heater) - ), x, 28 - ); - - if (PAGE_CONTAINS(17, 20)) { - const uint8_t h = isBed ? 7 : HEAT_INDICATOR_X, - y = isBed ? 18 : 17; - if ( - #if HAS_HEATED_BED - isBed ? thermalManager.isHeatingBed() : - #endif - thermalManager.isHeatingHotend(heater) - ) { - u8g.setColorIndex(0); // white on black - u8g.drawBox(x + h, y, 2, 2); - u8g.setColorIndex(1); // black on white - } - else - u8g.drawBox(x + h, y, 2, 2); - } - } -} - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - if (blink) - lcd_print(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_print(c <= '.' ? c : '?'); - else { - #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_printPGM(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_print(value); - } - } -} - -inline void lcd_implementation_status_message(const bool blink) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_print_utf(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - u8g.print(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_print_utf(stat, LCD_WIDTH); - } - else { - // The remaining string does not completely fill the screen - lcd_print_utf(stat, LCD_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - u8g.print('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - u8g.print('.'); - if (--chars) // Print a second copy of the message - lcd_print_utf(lcd_status_message, LCD_WIDTH - (rlen + 2)); - } - } - if (last_blink != blink) { - last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_print_utf(lcd_status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - u8g.print(' '); - ++slen; - } - #endif -} - -static void lcd_implementation_status_screen() { - - const bool blink = lcd_blink(); - - #if FAN_ANIM_FRAMES > 2 - static bool old_blink; - static uint8_t fan_frame; - if (old_blink != blink) { - old_blink = blink; - if (!fanSpeeds[0] || ++fan_frame >= FAN_ANIM_FRAMES) fan_frame = 0; - } - #endif - - // Status Menu Font - lcd_setFont(FONT_STATUSMENU); - - // - // Fan Animation - // - // Draws the whole heading image as a B/W bitmap rather than - // drawing the elements separately. - // This was done as an optimization, as it was slower to draw - // multiple parts compared to a single bitmap. - // - // The bitmap: - // - May be offset in X - // - Includes all nozzle(s), bed(s), and the fan. - // - // TODO: - // - // - Only draw the whole header on the first - // entry to the status screen. Nozzle, bed, and - // fan outline bits don't change. - // - if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { - - u8g.drawBitmapP( - STATUS_SCREEN_X, STATUS_SCREEN_Y, - (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, - #if HAS_FAN0 - #if FAN_ANIM_FRAMES > 2 - fan_frame == 1 ? status_screen1_bmp : - fan_frame == 2 ? status_screen2_bmp : - #if FAN_ANIM_FRAMES > 3 - fan_frame == 3 ? status_screen3_bmp : - #endif - #else - blink && fanSpeeds[0] ? status_screen1_bmp : - #endif - #endif - status_screen0_bmp - ); - - } - - // - // Temperature Graphics and Info - // - - if (PAGE_UNDER(28)) { - // Extruders - HOTEND_LOOP() _draw_heater_status(STATUS_SCREEN_HOTEND_TEXT_X(e), e, blink); - - // Heated bed - #if HOTENDS < 4 && HAS_HEATED_BED - _draw_heater_status(STATUS_SCREEN_BED_TEXT_X, -1, blink); - #endif - - #if HAS_FAN0 - if (PAGE_CONTAINS(STATUS_SCREEN_FAN_TEXT_Y - 7, STATUS_SCREEN_FAN_TEXT_Y)) { - // Fan - const int16_t per = ((fanSpeeds[0] + 1) * 100) / 256; - if (per) { - u8g.setPrintPos(STATUS_SCREEN_FAN_TEXT_X, STATUS_SCREEN_FAN_TEXT_Y); - lcd_print(itostr3(per)); - u8g.print('%'); - } - } - #endif - } - - #if ENABLED(SDSUPPORT) - // - // SD Card Symbol - // - if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) { - // Upper box - u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47) - // Right edge - u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5); // 44-48 (or 43-47) - // Bottom hollow box - u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4); // 49-52 (or 48-51) - // Corner pixel - u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION)); // 43 (or 42) - } - #endif // SDSUPPORT - - #if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) - // - // Progress bar frame - // - #define PROGRESS_BAR_X 54 - #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - - if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51) - u8g.drawFrame( - PROGRESS_BAR_X, 49, - PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) - ); - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - - if (progress_bar_percent > 1) { - - // - // Progress bar solid part - // - - if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) - u8g.drawBox( - PROGRESS_BAR_X + 1, 50, - (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION) - ); - - // - // SD Percent Complete - // - - #if ENABLED(DOGM_SD_PERCENT) - if (PAGE_CONTAINS(41, 48)) { - // Percent complete - u8g.setPrintPos(55, 48); - u8g.print(itostr3(progress_bar_percent)); - u8g.print('%'); - } - #endif - } - - // - // Elapsed Time - // - - #if DISABLED(DOGM_SD_PERCENT) - #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (DOG_CHAR_WIDTH / 2)) - #else - #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * DOG_CHAR_WIDTH) - #endif - - if (PAGE_CONTAINS(41, 48)) { - char buffer[10]; - duration_t elapsed = print_job_timer.duration(); - bool has_days = (elapsed.value >= 60*60*24L); - uint8_t len = elapsed.toDigital(buffer, has_days); - u8g.setPrintPos(SD_DURATION_X, 48); - lcd_print(buffer); - } - - #endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY - - // - // XYZ Coordinates - // - - #define XYZ_BASELINE (30 + INFO_FONT_HEIGHT) - - #define X_LABEL_POS 3 - #define X_VALUE_POS 11 - #define XYZ_SPACING 40 - - #if ENABLED(XYZ_HOLLOW_FRAME) - #define XYZ_FRAME_TOP 29 - #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 3 - #else - #define XYZ_FRAME_TOP 30 - #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 1 - #endif - - static char xstring[5], ystring[5], zstring[7]; - #if ENABLED(FILAMENT_LCD_DISPLAY) - static char wstring[5], mstring[4]; - #endif - - // At the first page, regenerate the XYZ strings - if (page.page == 0) { - 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]))); - #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filament_width_meas)); - strcpy(mstring, itostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); - #endif - } - - if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { - - #if ENABLED(XYZ_HOLLOW_FRAME) - u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39 - #else - u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37 - #endif - - if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_HEIGHT - 1), XYZ_BASELINE)) { - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(0); // white on black - #endif - - u8g.setPrintPos(0 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_X)); - u8g.setPrintPos(0 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(X_AXIS, xstring, blink); - - u8g.setPrintPos(1 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_Y)); - u8g.setPrintPos(1 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(Y_AXIS, ystring, blink); - - u8g.setPrintPos(2 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE); - lcd_printPGM(PSTR(MSG_Z)); - u8g.setPrintPos(2 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE); - _draw_axis_value(Z_AXIS, zstring, blink); - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(1); // black on white - #endif - } - } - - // - // Feedrate - // - - if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49)) { - lcd_setFont(FONT_MENU); - u8g.setPrintPos(3, 50); - lcd_print(LCD_STR_FEEDRATE[0]); - - lcd_setFont(FONT_STATUSMENU); - u8g.setPrintPos(12, 50); - lcd_print(itostr3(feedrate_percentage)); - u8g.print('%'); - - // - // Filament sensor display if SD is disabled - // - #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) - u8g.setPrintPos(56, 50); - lcd_print(wstring); - u8g.setPrintPos(102, 50); - lcd_print(mstring); - u8g.print('%'); - lcd_setFont(FONT_MENU); - u8g.setPrintPos(47, 50); - lcd_print(LCD_STR_FILAM_DIA); - u8g.setPrintPos(93, 50); - lcd_print(LCD_STR_FILAM_MUL); - #endif - } - - // - // Status line - // - - #define STATUS_BASELINE (55 + INFO_FONT_HEIGHT) - - if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_HEIGHT - 1), STATUS_BASELINE)) { - u8g.setPrintPos(0, STATUS_BASELINE); - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { //Display both Status message line and Filament display on the last line - lcd_implementation_status_message(blink); - } - else { - lcd_printPGM(PSTR(LCD_STR_FILAM_DIA)); - u8g.print(':'); - lcd_print(wstring); - lcd_printPGM(PSTR(" " LCD_STR_FILAM_MUL)); - u8g.print(':'); - lcd_print(mstring); - u8g.print('%'); - } - #else - lcd_implementation_status_message(blink); - #endif - } -} - -#endif // _STATUS_SCREEN_DOGM_H_ diff --git a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920.h b/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920.h deleted file mode 100644 index 8bf1b4176c..0000000000 --- a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920.h +++ /dev/null @@ -1,972 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -/** - * Implementation of a Status Screen for the RepRapDiscount - * Full Graphics Smart Controller using native ST7920 commands - * instead of U8Glib. - * - * This alternative Status Screen makes use of the built-in character - * generation capabilities of the ST7920 to update the Status Screen - * with less SPI traffic and CPU use. In particular: - * - * - The fan and bed animations are handled using custom characters - * that are stored in CGRAM. This allows for the animation to be - * updated by writing a single character to the text-buffer (DDRAM). - * - * - All the information in the Status Screen is text that is written - * to DDRAM, so the work of generating the bitmaps is offloaded to - * the ST7920 rather than being render by U8Glib on the MCU. - * - * - The graphics buffer (GDRAM) is only used for static graphics - * elements (nozzle and feedrate bitmaps) and for the progress - * bar, so updates are sporadic. - */ - -#include "status_screen_lite_ST7920_class.h" - -#include "duration_t.h" - -#define BUFFER_WIDTH 256 -#define BUFFER_HEIGHT 32 - -#define DDRAM_LINE_1 0x00 -#define DDRAM_LINE_2 0x10 -#define DDRAM_LINE_3 0x08 -#define DDRAM_LINE_4 0x18 - -ST7920_Lite_Status_Screen::st7920_state_t ST7920_Lite_Status_Screen::current_bits; - -void ST7920_Lite_Status_Screen::cmd(const uint8_t cmd) { - if (!current_bits.synced || !current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = true; - sync_cmd(); - } - write_byte(cmd); -} - -void ST7920_Lite_Status_Screen::begin_data() { - if (!current_bits.synced || current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = false; - sync_dat(); - } -} - -void ST7920_Lite_Status_Screen::write_str(const char *str) { - while (*str) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str(const char *str, uint8_t len) { - while (*str && len--) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str_P(const char * const str) { - const char *p_str = (const char *)str; - while (char c = pgm_read_byte_near(p_str++)) write_byte(c); -} - -void ST7920_Lite_Status_Screen::write_str(progmem_str str) { - write_str_P((const char*)str); -} - -void ST7920_Lite_Status_Screen::write_number(const int16_t value, const uint8_t digits/*=3*/) { - char str[7]; - const char *fmt; - switch (digits) { - case 6: fmt = PSTR("%6d"); break; - case 5: fmt = PSTR("%5d"); break; - case 4: fmt = PSTR("%4d"); break; - case 3: fmt = PSTR("%3d"); break; - case 2: fmt = PSTR("%2d"); break; - case 1: fmt = PSTR("%1d"); break; - } - sprintf_P(str, fmt, value); - write_str(str); -} - -void ST7920_Lite_Status_Screen::display_status(const bool display_on, const bool cursor_on, const bool blink_on) { - extended_function_set(false); - cmd(0b00001000 | - (display_on ? 0b0100 : 0) | - (cursor_on ? 0b0010 : 0) | - (blink_on ? 0b0001 : 0) - ); -} - -// Sets the extended and graphics bits simultaneously, regardless of -// the current state. This is a helper function for extended_function_set() -// and graphics() -void ST7920_Lite_Status_Screen::_extended_function_set(const bool extended, const bool graphics) { - cmd( 0b00100000 | - (extended ? 0b00000100 : 0) | - (graphics ? 0b00000010 : 0) - ); - current_bits.extended = extended; - current_bits.graphics = graphics; -} - -void ST7920_Lite_Status_Screen::extended_function_set(const bool extended) { - if (extended != current_bits.extended) - _extended_function_set(extended, current_bits.graphics); -} - -void ST7920_Lite_Status_Screen::graphics(const bool graphics) { - if (graphics != current_bits.graphics) - _extended_function_set(current_bits.extended, graphics); -} - -void ST7920_Lite_Status_Screen::entry_mode_select(const bool ac_increase, const bool shift) { - extended_function_set(false); - cmd(0b00000100 | - (ac_increase ? 0b00000010 : 0) | - (shift ? 0b00000001 : 0) - ); -} - -// Sets the sa bit regardless of the current state. This is a helper -// function for scroll_or_addr_select() -void ST7920_Lite_Status_Screen::_scroll_or_addr_select(const bool sa) { - extended_function_set(true); - cmd(0b00100010 | - (sa ? 0b000001 : 0) - ); - current_bits.sa = sa; -} - -void ST7920_Lite_Status_Screen::scroll_or_addr_select(const bool sa) { - if (sa != current_bits.sa) - _scroll_or_addr_select(sa); -} - -void ST7920_Lite_Status_Screen::set_ddram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b10000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_cgram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b01000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_gdram_address(const uint8_t x, const uint8_t y) { - extended_function_set(true); - cmd(0b10000000 | (y & 0b01111111)); - cmd(0b10000000 | (x & 0b00001111)); -} - -void ST7920_Lite_Status_Screen::clear() { - extended_function_set(false); - cmd(0x00000001); - delay(15); //delay for CGRAM clear -} - -void ST7920_Lite_Status_Screen::home() { - extended_function_set(false); - cmd(0x00000010); -} - -/* This fills the entire text buffer with spaces */ -void ST7920_Lite_Status_Screen::clear_ddram() { - set_ddram_address(DDRAM_LINE_1); - begin_data(); - for (uint8_t i = 64; i--;) write_byte(' '); -} - -/* This fills the entire graphics buffer with zeros */ -void ST7920_Lite_Status_Screen::clear_gdram() { - for (uint8_t y = 0; y < BUFFER_HEIGHT; y++) { - set_gdram_address(0, y); - begin_data(); - for (uint8_t i = (BUFFER_WIDTH) / 16; i--;) write_word(0); - } -} - -void ST7920_Lite_Status_Screen::load_cgram_icon(const uint16_t addr, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - set_cgram_address(addr); - begin_data(); - for (uint8_t i = 16; i--;) - write_word(pgm_read_word_near(p_word++)); -} - -/** - * Draw an icon in GDRAM. Position specified in DDRAM - * coordinates. i.e., X from 1 to 8, Y from 1 to 4. - */ -void ST7920_Lite_Status_Screen::draw_gdram_icon(uint8_t x, uint8_t y, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - if (y > 2) { // Handle display folding - y -= 2; - x += 8; - } - --x; - --y; - for (int i = 0; i < 16; i++) { - set_gdram_address(x, i + y * 16); - begin_data(); - write_word(pgm_read_word_near(p_word++)); - } -} - -/************************** ICON DEFINITIONS *************************************/ - -#define CGRAM_ICON_1_ADDR 0x00 -#define CGRAM_ICON_2_ADDR 0x10 -#define CGRAM_ICON_3_ADDR 0x20 -#define CGRAM_ICON_4_ADDR 0x30 - -#define CGRAM_ICON_1_WORD 0x00 -#define CGRAM_ICON_2_WORD 0x02 -#define CGRAM_ICON_3_WORD 0x04 -#define CGRAM_ICON_4_WORD 0x06 - -const uint8_t degree_symbol_y_top = 1; -PROGMEM const uint8_t degree_symbol[] = { - 0b00110000, - 0b01001000, - 0b01001000, - 0b00110000, -}; - -const uint16_t nozzle_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000111111110000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000011111100000, - 0b0000001111000000, - 0b0000000110000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t bed_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0111111111111110, - 0b0111111111111110, - 0b0110000000000110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110001111000110, - 0b0100001111000010, - 0b0100000110000010, - 0b0101100000011010, - 0b0101110110111010, - 0b0101100000011010, - 0b0100000110000010, - 0b0100001111000010, - 0b0110001111000110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110010000100110, - 0b0100111001110010, - 0b0101111001111010, - 0b0100110000110010, - 0b0100000110000010, - 0b0100110000110010, - 0b0101111001111010, - 0b0100111001110010, - 0b0110010000100110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t feedrate_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0111111011111000, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011111000, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000000000000, - 0b0000000000000000 -}; - -/************************** MAIN SCREEN *************************************/ - -// The ST7920 does not have a degree character, but we -// can fake it by writing it to GDRAM. -// This function takes as an argument character positions -// i.e x is [1-16], while the y position is [1-4] -void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, bool draw) { - const uint8_t *p_bytes = degree_symbol; - if (y > 2) { - // Handle display folding - y -= 2; - x += 16; - } - x -= 1; - y -= 1; - const bool oddChar = x & 1; - const uint8_t x_word = x >> 1; - const uint8_t y_top = degree_symbol_y_top; - const uint8_t y_bot = y_top + sizeof(degree_symbol)/sizeof(degree_symbol[0]); - for (uint8_t i = y_top; i < y_bot; i++) { - uint8_t byte = pgm_read_byte_near(p_bytes++); - set_gdram_address(x_word,i+y*16); - begin_data(); - if (draw) { - write_byte(oddChar ? 0x00 : byte); - write_byte(oddChar ? byte : 0x00); - } - else - write_word(0x0000); - } -} - -void ST7920_Lite_Status_Screen::draw_static_elements() { - scroll_or_addr_select(0); - - // Load the animated bed and fan icons - load_cgram_icon(CGRAM_ICON_1_ADDR, heat1_icon); - load_cgram_icon(CGRAM_ICON_2_ADDR, heat2_icon); - load_cgram_icon(CGRAM_ICON_3_ADDR, fan1_icon); - load_cgram_icon(CGRAM_ICON_4_ADDR, fan2_icon); - - // Draw the static icons in GDRAM - draw_gdram_icon(1, 1, nozzle_icon); - #if EXTRUDERS == 2 - draw_gdram_icon(1,2,nozzle_icon); - draw_gdram_icon(1,3,bed_icon); - #else - draw_gdram_icon(1,2,bed_icon); - #endif - draw_gdram_icon(6,2,feedrate_icon); - - // Draw the initial fan icon - draw_fan_icon(false); -} - -/** - * Although this is undocumented, the ST7920 allows the character - * data buffer (DDRAM) to be used in conjunction with the graphics - * bitmap buffer (CGRAM). The contents of the graphics buffer is - * XORed with the data from the character generator. This allows - * us to make the progess bar out of graphical data (the bar) and - * text data (the percentage). - */ -void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) { - #if EXTRUDERS == 1 - // If we have only one extruder, draw a long progress bar on the third line - const uint8_t top = 1, // Top in pixels - bottom = 13, // Bottom in pixels - left = 12, // Left edge, in 16-bit words - width = 4; // Width of progress bar, in 16-bit words - #else - const uint8_t top = 16 + 1, - bottom = 16 + 13, - left = 5, - width = 3; - #endif - const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent? - - // Draw the progress bar as a bitmap in CGRAM - for (uint8_t y = top; y <= bottom; y++) { - set_gdram_address(left, y); - begin_data(); - for (uint8_t x = 0; x < width; x++) { - uint16_t gfx_word = 0x0000; - if ((x + 1) * char_pcnt <= value) - gfx_word = 0xFFFF; // Draw completely filled bytes - else if ((x * char_pcnt) < value) - gfx_word = int(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes - - // Draw the frame around the progress bar - if (y == top || y == bottom) - gfx_word = 0xFFFF; // Draw top/bottom border - else if (x == width - 1) - gfx_word |= 0x0001; // Draw right border - else if (x == 0) - gfx_word |= 0x8000; // Draw left border - write_word(gfx_word); - } - } - - // Draw the percentage as text in DDRAM - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_3 + 4); - begin_data(); - write_byte(' '); - #else - set_ddram_address(DDRAM_LINE_2 + left); - begin_data(); - #endif - - // Draw centered - if (value > 9) { - write_number(value, 4); - write_str(F("% ")); - } - else { - write_number(value, 3); - write_str(F("% ")); - } -} - -void ST7920_Lite_Status_Screen::draw_fan_icon(const bool whichIcon) { - set_ddram_address(DDRAM_LINE_1 + 5); - begin_data(); - write_word(whichIcon ? CGRAM_ICON_3_WORD : CGRAM_ICON_4_WORD); -} - -void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool heating) { - set_ddram_address( - #if EXTRUDERS == 1 - DDRAM_LINE_2 - #else - DDRAM_LINE_3 - #endif - ); - begin_data(); - if (heating) - write_word(whichIcon ? CGRAM_ICON_1_WORD : CGRAM_ICON_2_WORD); - else { - write_byte(' '); - write_byte(' '); - } -} - -#define FAR(a,b) (((a > b) ? (a-b) : (b-a)) > 2) - -static struct { - bool E1_show_target : 1; - bool E2_show_target : 1; - #if HAS_HEATED_BED - bool bed_show_target : 1; - #endif -} display_state = { - true, true - #if HAS_HEATED_BED - , true - #endif -}; - -void ST7920_Lite_Status_Screen::draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange) { - switch (line) { - case 1: set_ddram_address(DDRAM_LINE_1 + 1); break; - case 2: set_ddram_address(DDRAM_LINE_2 + 1); break; - case 3: set_ddram_address(DDRAM_LINE_3 + 1); break; - case 4: set_ddram_address(DDRAM_LINE_3 + 1); break; - } - begin_data(); - write_number(temp); - - if (showTarget) { - write_str(F("\x1A")); - write_number(target); - }; - - if (targetStateChange) { - if (!showTarget) write_str(F(" ")); - draw_degree_symbol(6, line, !showTarget); - draw_degree_symbol(10, line, showTarget); - } -} - -void ST7920_Lite_Status_Screen::draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(1, temp, target, show_target, display_state.E1_show_target != show_target || forceUpdate); - display_state.E1_show_target = show_target; -} - -void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(2, temp, target, show_target, display_state.E2_show_target != show_target || forceUpdate); - display_state.E2_show_target = show_target; -} - -#if HAS_HEATED_BED - void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(2 - #if EXTRUDERS > 1 - + 1 - #endif - , temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate - ); - display_state.bed_show_target = show_target; - } -#endif - -void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) { - set_ddram_address(DDRAM_LINE_1 + 6); - begin_data(); - write_number(value, 3); - write_byte('%'); -} - -void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) { - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_3); - #else - set_ddram_address(DDRAM_LINE_3 + 5); - #endif - char str[7]; - str[elapsed.toDigital(str)] = ' '; - begin_data(); - write_str(str, 6); -} - -void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint8_t percentage) { - // We only have enough room for the feedrate when - // we have one extruder - #if EXTRUDERS == 1 - set_ddram_address(DDRAM_LINE_2 + 6); - begin_data(); - write_number(percentage, 3); - write_byte('%'); - #endif -} - -void ST7920_Lite_Status_Screen::draw_status_message(const char *str) { - set_ddram_address(DDRAM_LINE_4); - begin_data(); - const uint8_t lcd_len = 16; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - - uint8_t slen = utf8_strlen(str); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= lcd_len) { - - // The string isn't scrolling and may not fill the screen - write_str(str); - - // Fill the rest with spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = str + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= lcd_len) { - // The remaining string fills the screen - Print it - write_str(stat, lcd_len); - } - else { - // The remaining string does not completely fill the screen - write_str(stat); // The string leaves space - uint8_t chars = lcd_len - rlen; // Amount of space left in characters - - write_byte('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - write_byte('.'); - if (--chars) - write_str(str, chars); // Print a second copy of the message - } - } - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(str[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - #else - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(str); - - // Just print the string to the LCD - write_str(str, lcd_len); - - // Fill the rest with spaces if there are missing spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } - #endif -} - -void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, const float z, bool position_known) { - char str[7]; - set_ddram_address(DDRAM_LINE_4); - begin_data(); - - // If position is unknown, flash the labels. - const unsigned char alt_label = position_known ? 0 : (lcd_blink() ? ' ' : 0); - - dtostrf(x, -4, 0, str); - write_byte(alt_label ? alt_label : 'X'); - write_str(str, 4); - - dtostrf(y, -4, 0, str); - write_byte(alt_label ? alt_label : 'Y'); - write_str(str, 4); - - dtostrf(z, -5, 1, str); - write_byte(alt_label ? alt_label : 'Z'); - write_str(str, 5); -} - -bool ST7920_Lite_Status_Screen::indicators_changed() { - // We only add the target temperatures to the checksum - // because the actual temps fluctuate so by updating - // them only during blinks we gain a bit of stability. - const bool blink = lcd_blink(); - const uint8_t feedrate_perc = feedrate_percentage; - const uint8_t fan_speed = ((fanSpeeds[0] + 1) * 100) / 256; - const int16_t extruder_1_target = thermalManager.degTargetHotend(0); - #if EXTRUDERS == 2 - const int16_t extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_target = thermalManager.degTargetBed(); - #endif - static uint16_t last_checksum = 0; - const uint16_t checksum = blink ^ feedrate_perc ^ fan_speed ^ extruder_1_target - #if EXTRUDERS == 2 - ^ extruder_2_target - #endif - #if HAS_HEATED_BED - ^ bed_target - #endif - ; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { - if (forceUpdate || indicators_changed()) { - const bool blink = lcd_blink(); - const duration_t elapsed = print_job_timer.duration(); - const uint8_t feedrate_perc = feedrate_percentage; - const uint8_t fan_speed = ((fanSpeeds[0] + 1) * 100) / 256; - const int16_t extruder_1_temp = thermalManager.degHotend(0), - extruder_1_target = thermalManager.degTargetHotend(0); - #if EXTRUDERS == 2 - const int16_t extruder_2_temp = thermalManager.degHotend(1), - extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_temp = thermalManager.degBed(), - bed_target = thermalManager.degTargetBed(); - #endif - - draw_extruder_1_temp(extruder_1_temp, extruder_1_target, forceUpdate); - #if EXTRUDERS == 2 - draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate); - #endif - #if HAS_HEATED_BED - draw_bed_temp(bed_temp, bed_target, forceUpdate); - #endif - draw_fan_speed(fan_speed); - draw_print_time(elapsed); - draw_feedrate_percentage(feedrate_perc); - - // Update the fan and bed animations - if (fan_speed > 0) draw_fan_icon(blink); - #if HAS_HEATED_BED - if (bed_target > 0) - draw_heat_icon(blink, true); - else - draw_heat_icon(false, false); - #endif - } -} - -bool ST7920_Lite_Status_Screen::position_changed() { - const float x_pos = current_position[X_AXIS], - y_pos = current_position[Y_AXIS], - z_pos = current_position[Z_AXIS]; - const uint8_t checksum = uint8_t(x_pos) ^ uint8_t(y_pos) ^ uint8_t(z_pos); - - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -bool ST7920_Lite_Status_Screen::status_changed() { - uint8_t checksum = 0; - for (const char *p = lcd_status_message; *p; p++) checksum ^= *p; - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -bool ST7920_Lite_Status_Screen::blink_changed() { - static uint8_t last_blink = 0; - const bool blink = lcd_blink(); - if (last_blink == blink) return false; - last_blink = blink; - return true; -} - -#ifndef STATUS_EXPIRE_SECONDS - #define STATUS_EXPIRE_SECONDS 20 -#endif - -void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { - - #if STATUS_EXPIRE_SECONDS - static uint8_t countdown = 0; - #endif - - /** - * There is only enough room in the display for either the - * status message or the position, not both, so we choose - * one or another. Whenever the status message changes, - * we show it for a number of consecutive seconds, but - * then go back to showing the position as soon as the - * head moves, i.e: - * - * countdown > 1 -- Show status - * countdown = 1 -- Show status, until movement - * countdown = 0 -- Show position - * - * If STATUS_EXPIRE_SECONDS is zero, the position display - * will be disabled and only the status will be shown. - */ - if (forceUpdate || status_changed()) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif - #if STATUS_EXPIRE_SECONDS - countdown = lcd_status_message[0] ? STATUS_EXPIRE_SECONDS : 0; - #endif - draw_status_message(lcd_status_message); - blink_changed(); // Clear changed flag - } - #if !STATUS_EXPIRE_SECONDS - #if ENABLED(STATUS_MESSAGE_SCROLLING) - else - draw_status_message(lcd_status_message); - #endif - #else - else if (countdown > 1 && blink_changed()) { - countdown--; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif - } - else if (countdown > 0 && blink_changed()) { - if (position_changed()) { - countdown--; - forceUpdate = true; - } - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif - } - if (countdown == 0 && (forceUpdate || position_changed() || - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - 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() - #endif - ); - } - #endif -} - -void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) || ENABLED(SDSUPPORT) - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; //=0 - #endif - - #if ENABLED(SDSUPPORT) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING) progress_bar_percent = card.percentDone(); - #endif - - // Since the progress bar involves writing - // quite a few bytes to GDRAM, only do this - // when an update is actually necessary. - - static uint8_t last_progress = 0; - if (!forceUpdate && last_progress == progress_bar_percent) return; - last_progress = progress_bar_percent; - - draw_progress_bar(progress_bar_percent); - - #else - - UNUSED(forceUpdate); - - #endif // LCD_SET_PROGRESS_MANUALLY || SDSUPPORT -} - -void ST7920_Lite_Status_Screen::update(const bool forceUpdate) { - cs(); - update_indicators(forceUpdate); - update_status_or_position(forceUpdate); - update_progress(forceUpdate); - ncs(); -} - -void ST7920_Lite_Status_Screen::reset_state_from_unknown() { - _extended_function_set(true, true); // Do it twice as only one bit - _extended_function_set(true, true); // get set at a time. - _scroll_or_addr_select(false); -} - -void ST7920_Lite_Status_Screen::on_entry() { - cs(); - reset_state_from_unknown(); - clear(); - clear_gdram(); - draw_static_elements(); - update(true); - ncs(); -} - -void ST7920_Lite_Status_Screen::on_exit() { - cs(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -// This is called prior to the KILL screen to -// clear the screen so we don't end up with a -// garbled display. -void ST7920_Lite_Status_Screen::clear_text_buffer() { - cs(); - reset_state_from_unknown(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -static void lcd_implementation_status_screen() { - ST7920_Lite_Status_Screen::update(false); -} - -/** - * In order to properly update the lite Status Screen, - * we must know when we have entered and left the - * Status Screen. Since the ultralcd code is not - * set up for doing this, we call this function before - * each update indicating whether the current screen - * is the Status Screen. - * - * This function keeps track of whether we have left or - * entered the Status Screen and calls the on_entry() - * and on_exit() methods for cleanup. - */ -static void lcd_in_status(const bool inStatus) { - static bool lastInStatus = false; - if (lastInStatus == inStatus) return; - if ((lastInStatus = inStatus)) - ST7920_Lite_Status_Screen::on_entry(); - else - ST7920_Lite_Status_Screen::on_exit(); -} diff --git a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_class.h b/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_class.h deleted file mode 100644 index 289723479a..0000000000 --- a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_class.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -#ifndef STATUS_SCREEN_LITE_ST7920_CLASS_H -#define STATUS_SCREEN_LITE_ST7920_CLASS_H - -#include "macros.h" -#include "duration_t.h" - -typedef const __FlashStringHelper *progmem_str; - -class ST7920_Lite_Status_Screen { - private: - static struct st7920_state_t { - uint8_t synced : 1; // Whether a sync has been sent - uint8_t cmd : 1; // Whether the sync was cmd or data - uint8_t extended : 1; - uint8_t graphics : 1; - uint8_t sa : 1; - } current_bits; - - static void cs(); - static void ncs(); - static void sync_cmd(); - static void sync_dat(); - static void write_byte(const uint8_t w); - - FORCE_INLINE static void write_word(const uint16_t w) { - write_byte((w >> 8) & 0xFF); - write_byte((w >> 0) & 0xFF); - } - - static void cmd(const uint8_t cmd); - static void begin_data(); - - static void write_str(const char *str); - static void write_str(const char *str, const uint8_t len); - static void write_str_P(const char * const str); - static void write_str(progmem_str str); - static void write_number(const int16_t value, const uint8_t digits=3); - - static void _extended_function_set(const bool extended, const bool graphics); - static void _scroll_or_addr_select(const bool sa); - static void reset_state_from_unknown(); - - static void home(); - static void display_status(const bool display_on, const bool cursor_on, const bool blink_on); - static void extended_function_set(const bool extended); - static void graphics(const bool graphics); - static void entry_mode_select(const bool ac_increase, const bool shift); - static void scroll_or_addr_select(const bool sa); - static void set_ddram_address(const uint8_t addr); - static void set_cgram_address(const uint8_t addr); - static void set_gdram_address(const uint8_t x, const uint8_t y); - - static void clear(); - static void clear_ddram(); - static void clear_gdram(); - - static void load_cgram_icon(const uint16_t addr, const void *data); - static void draw_gdram_icon(uint8_t x, uint8_t y, const void *data); - - static uint8_t string_checksum(const char *str); - - protected: - static void draw_degree_symbol(uint8_t x, uint8_t y, bool draw); - static void draw_static_elements(); - static void draw_progress_bar(const uint8_t value); - static void draw_fan_icon(const bool whichIcon); - static void draw_heat_icon(const bool whichIcon, const bool heating); - static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange); - static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_fan_speed(const uint8_t value); - static void draw_print_time(const duration_t &elapsed); - static void draw_feedrate_percentage(const uint8_t percentage); - static void draw_status_message(const char *str); - static void draw_position(const float x, const float y, const float z, bool position_known = true); - - static bool indicators_changed(); - static bool position_changed(); - static bool blink_changed(); - static bool status_changed(); - - static void update_indicators(const bool forceUpdate); - static void update_position(const bool forceUpdate, bool resetChecksum); - static void update_status_or_position(bool forceUpdate); - static void update_progress(const bool forceUpdate); - - public: - static void update(const bool forceUpdate); - static void on_entry(); - static void on_exit(); - static void clear_text_buffer(); -}; - -#endif // STATUS_SCREEN_LITE_ST7920_CLASS_H diff --git a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_spi.h b/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_spi.h deleted file mode 100644 index 9c59068f46..0000000000 --- a/Marlin_thinkerV2/Marlin/status_screen_lite_ST7920_spi.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -#include "status_screen_lite_ST7920_class.h" - -void ST7920_Lite_Status_Screen::cs() { - ST7920_CS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::ncs() { - ST7920_NCS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::sync_cmd() { - ST7920_SET_CMD(); -} - -void ST7920_Lite_Status_Screen::sync_dat() { - ST7920_SET_DAT(); -} - -void ST7920_Lite_Status_Screen::write_byte(const uint8_t data) { - ST7920_WRITE_BYTE(data); -} diff --git a/Marlin_thinkerV2/Marlin/stepper.cpp b/Marlin_thinkerV2/Marlin/stepper.cpp deleted file mode 100644 index 2df0199e36..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper.cpp +++ /dev/null @@ -1,2533 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper.cpp - A singleton object to execute motion plans using stepper motors - * Marlin Firmware - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -/** - * Timer calculations informed by the 'RepRap cartesian firmware' by Zack Smith - * and Philipp Tiefenbacher. - */ - -/** - * __________________________ - * /| |\ _________________ ^ - * / | | \ /| |\ | - * / | | \ / | | \ s - * / | | | | | \ p - * / | | | | | \ e - * +-----+------------------------+---+--+---------------+----+ e - * | BLOCK 1 | BLOCK 2 | d - * - * time -----> - * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. - */ - -/** - * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and - * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html - */ - -/** - * Jerk controlled movements planner added Apr 2018 by Eduardo José Tagle. - * Equations based on Synthethos TinyG2 sources, but the fixed-point - * implementation is new, as we are running the ISR with a variable period. - * Also implemented the Bézier velocity curve evaluation in ARM assembler, - * to avoid impacting ISR speed. - */ - -#include "Marlin.h" -#include "stepper.h" -#include "endstops.h" -#include "planner.h" -#include "temperature.h" -#include "ultralcd.h" -#include "language.h" -#include "cardreader.h" -#include "speed_lookuptable.h" -#include "delay.h" - -#if HAS_DIGIPOTSS - #include -#endif - -Stepper stepper; // Singleton - -// public: - -#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::homing_dual_axis = false; -#endif - -#if HAS_MOTOR_CURRENT_PWM - uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load() -#endif - -// private: - -block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced - -uint8_t Stepper::last_direction_bits = 0, - Stepper::axis_did_move; - -bool Stepper::abort_current_block; - -#if DISABLED(MIXING_EXTRUDER) - uint8_t Stepper::last_moved_extruder = 0xFF; -#endif - -#if ENABLED(X_DUAL_ENDSTOPS) - bool Stepper::locked_X_motor = false, Stepper::locked_X2_motor = false; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - bool Stepper::locked_Y_motor = false, Stepper::locked_Y2_motor = false; -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false; -#endif - -uint32_t Stepper::acceleration_time, Stepper::deceleration_time; -uint8_t Stepper::steps_per_isr; - -#if DISABLED(ADAPTIVE_STEP_SMOOTHING) - constexpr -#endif - uint8_t Stepper::oversampling_factor; - -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::step_event_count; // The total event count for the current block - -#if ENABLED(MIXING_EXTRUDER) - int32_t Stepper::delta_error_m[MIXING_STEPPERS]; - uint32_t Stepper::advance_dividend_m[MIXING_STEPPERS], - Stepper::advance_divisor_m; -#else - int8_t Stepper::active_extruder; // Active extruder -#endif - -#if ENABLED(S_CURVE_ACCELERATION) - int32_t __attribute__((used)) Stepper::bezier_A __asm__("bezier_A"); // A coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_B __asm__("bezier_B"); // B coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_C __asm__("bezier_C"); // C coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_F __asm__("bezier_F"); // F coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_AV __asm__("bezier_AV"); // AV coefficient in Bézier speed curve with alias for assembler - bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative - bool Stepper::bezier_2nd_half; // =false If Bézier curve has been initialized or not -#endif - -uint32_t Stepper::nextMainISR = 0; - -#if ENABLED(LIN_ADVANCE) - - constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF; - uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER, - Stepper::LA_isr_rate = LA_ADV_NEVER; - uint16_t Stepper::LA_current_adv_steps = 0, - Stepper::LA_final_adv_steps, - Stepper::LA_max_adv_steps; - - int8_t Stepper::LA_steps = 0; - - bool Stepper::LA_use_advance_lead; - -#endif // LIN_ADVANCE - -int32_t Stepper::ticks_nominal = -1; -#if DISABLED(S_CURVE_ACCELERATION) - uint32_t Stepper::acc_step_rate; // needed for deceleration start point -#endif - -volatile int32_t Stepper::endstops_trigsteps[XYZ]; - -volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 }; -int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 }; - -#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ - if (homing_dual_axis) { \ - if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - else { \ - if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - } -#endif - -#if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0) - #if ENABLED(X_DUAL_ENDSTOPS) - #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) - #else - #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0) - #endif -#elif ENABLED(DUAL_X_CARRIAGE) - #define X_APPLY_DIR(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_DIR_WRITE(v); \ - X2_DIR_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ - } - #define X_APPLY_STEP(v,ALWAYS) \ - if (extruder_duplication_enabled || ALWAYS) { \ - X_STEP_WRITE(v); \ - X2_STEP_WRITE(v); \ - } \ - else { \ - if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ - } -#else - #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) - #define X_APPLY_STEP(v,Q) X_STEP_WRITE(v) -#endif - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0) - #if ENABLED(Y_DUAL_ENDSTOPS) - #define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v) - #else - #define Y_APPLY_STEP(v,Q) do{ Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }while(0) - #endif -#else - #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v) - #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) -#endif - -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0) - #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v) - #else - #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }while(0) - #endif -#else - #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) - #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) -#endif - -#if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(active_extruder, v) -#endif - -// intRes = longIn1 * longIn2 >> 24 -// uses: -// A[tmp] to store 0 -// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result. -// note that the lower two bytes and the upper byte of the 48bit result are not calculated. -// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones. -// B A are bits 24-39 and are the returned value -// C B A is longIn1 -// D C B A is longIn2 -// -static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { - register uint8_t tmp1; - register uint8_t tmp2; - register uint16_t intRes; - __asm__ __volatile__( - A("clr %[tmp1]") - A("mul %A[longIn1], %B[longIn2]") - A("mov %[tmp2], r1") - A("mul %B[longIn1], %C[longIn2]") - A("movw %A[intRes], r0") - A("mul %C[longIn1], %C[longIn2]") - A("add %B[intRes], r0") - A("mul %C[longIn1], %B[longIn2]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %A[longIn1], %C[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %B[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %C[longIn1], %A[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %A[longIn2]") - A("add %[tmp2], r1") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("lsr %[tmp2]") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("mul %D[longIn2], %A[longIn1]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %D[longIn2], %B[longIn1]") - A("add %B[intRes], r0") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp1] "=&r" (tmp1), - [tmp2] "=&r" (tmp2) - : [longIn1] "d" (longIn1), - [longIn2] "d" (longIn2) - : "cc" - ); - return intRes; -} - -void Stepper::wake_up() { - // TCNT1 = 0; - ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -/** - * Set the stepper direction of each axis - * - * COREXY: X_AXIS=A_AXIS and Y_AXIS=B_AXIS - * COREXZ: X_AXIS=A_AXIS and Z_AXIS=C_AXIS - * COREYZ: Y_AXIS=B_AXIS and Z_AXIS=C_AXIS - */ -void Stepper::set_directions() { - - #define SET_STEP_DIR(A) \ - if (motor_direction(_AXIS(A))) { \ - A##_APPLY_DIR(INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = -1; \ - } \ - else { \ - A##_APPLY_DIR(!INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = 1; \ - } - - #if HAS_X_DIR - SET_STEP_DIR(X); // A - #endif - #if HAS_Y_DIR - SET_STEP_DIR(Y); // B - #endif - #if HAS_Z_DIR - SET_STEP_DIR(Z); // C - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - if (motor_direction(E_AXIS)) { - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - count_direction[E_AXIS] = -1; - } - else { - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - count_direction[E_AXIS] = 1; - } - #else - if (motor_direction(E_AXIS)) { - REV_E_DIR(active_extruder); - count_direction[E_AXIS] = -1; - } - else { - NORM_E_DIR(active_extruder); - count_direction[E_AXIS] = 1; - } - #endif - #endif // !LIN_ADVANCE - - // A small delay may be needed after changing direction - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); - #endif -} - - - -#if ENABLED(S_CURVE_ACCELERATION) - /** - * This uses a quintic (fifth-degree) Bézier polynomial for the velocity curve, giving - * a "linear pop" velocity curve; with pop being the sixth derivative of position: - * velocity - 1st, acceleration - 2nd, jerk - 3rd, snap - 4th, crackle - 5th, pop - 6th - * - * The Bézier curve takes the form: - * - * V(t) = P_0 * B_0(t) + P_1 * B_1(t) + P_2 * B_2(t) + P_3 * B_3(t) + P_4 * B_4(t) + P_5 * B_5(t) - * - * Where 0 <= t <= 1, and V(t) is the velocity. P_0 through P_5 are the control points, and B_0(t) - * through B_5(t) are the Bernstein basis as follows: - * - * B_0(t) = (1-t)^5 = -t^5 + 5t^4 - 10t^3 + 10t^2 - 5t + 1 - * B_1(t) = 5(1-t)^4 * t = 5t^5 - 20t^4 + 30t^3 - 20t^2 + 5t - * B_2(t) = 10(1-t)^3 * t^2 = -10t^5 + 30t^4 - 30t^3 + 10t^2 - * B_3(t) = 10(1-t)^2 * t^3 = 10t^5 - 20t^4 + 10t^3 - * B_4(t) = 5(1-t) * t^4 = -5t^5 + 5t^4 - * B_5(t) = t^5 = t^5 - * ^ ^ ^ ^ ^ ^ - * | | | | | | - * A B C D E F - * - * Unfortunately, we cannot use forward-differencing to calculate each position through - * the curve, as Marlin uses variable timer periods. So, we require a formula of the form: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + D*t^2 + E*t + F - * - * Looking at the above B_0(t) through B_5(t) expanded forms, if we take the coefficients of t^5 - * through t of the Bézier form of V(t), we can determine that: - * - * A = -P_0 + 5*P_1 - 10*P_2 + 10*P_3 - 5*P_4 + P_5 - * B = 5*P_0 - 20*P_1 + 30*P_2 - 20*P_3 + 5*P_4 - * C = -10*P_0 + 30*P_1 - 30*P_2 + 10*P_3 - * D = 10*P_0 - 20*P_1 + 10*P_2 - * E = - 5*P_0 + 5*P_1 - * F = P_0 - * - * Now, since we will (currently) *always* want the initial acceleration and jerk values to be 0, - * We set P_i = P_0 = P_1 = P_2 (initial velocity), and P_t = P_3 = P_4 = P_5 (target velocity), - * which, after simplification, resolves to: - * - * A = - 6*P_i + 6*P_t = 6*(P_t - P_i) - * B = 15*P_i - 15*P_t = 15*(P_i - P_t) - * C = -10*P_i + 10*P_t = 10*(P_t - P_i) - * D = 0 - * E = 0 - * F = P_i - * - * As the t is evaluated in non uniform steps here, there is no other way rather than evaluating - * the Bézier curve at each point: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + F [0 <= t <= 1] - * - * Floating point arithmetic execution time cost is prohibitive, so we will transform the math to - * use fixed point values to be able to evaluate it in realtime. Assuming a maximum of 250000 steps - * per second (driver pulses should at least be 2µS hi/2µS lo), and allocating 2 bits to avoid - * overflows on the evaluation of the Bézier curve, means we can use - * - * t: unsigned Q0.32 (0 <= t < 1) |range 0 to 0xFFFFFFFF unsigned - * A: signed Q24.7 , |range = +/- 250000 * 6 * 128 = +/- 192000000 = 0x0B71B000 | 28 bits + sign - * B: signed Q24.7 , |range = +/- 250000 *15 * 128 = +/- 480000000 = 0x1C9C3800 | 29 bits + sign - * C: signed Q24.7 , |range = +/- 250000 *10 * 128 = +/- 320000000 = 0x1312D000 | 29 bits + sign - * F: signed Q24.7 , |range = +/- 250000 * 128 = 32000000 = 0x01E84800 | 25 bits + sign - * - * The trapezoid generator state contains the following information, that we will use to create and evaluate - * the Bézier curve: - * - * blk->step_event_count [TS] = The total count of steps for this movement. (=distance) - * blk->initial_rate [VI] = The initial steps per second (=velocity) - * blk->final_rate [VF] = The ending steps per second (=velocity) - * and the count of events completed (step_events_completed) [CS] (=distance until now) - * - * Note the abbreviations we use in the following formulae are between []s - * - * For Any 32bit CPU: - * - * At the start of each trapezoid, calculate the coefficients A,B,C,F and Advance [AV], as follows: - * - * A = 6*128*(VF - VI) = 768*(VF - VI) - * B = 15*128*(VI - VF) = 1920*(VI - VF) - * C = 10*128*(VF - VI) = 1280*(VF - VI) - * F = 128*VI = 128*VI - * AV = (1<<32)/TS ~= 0xFFFFFFFF / TS (To use ARM UDIV, that is 32 bits) (this is computed at the planner, to offload expensive calculations from the ISR) - * - * And for each point, evaluate the curve with the following sequence: - * - * void lsrs(uint32_t& d, uint32_t s, int cnt) { - * d = s >> cnt; - * } - * void lsls(uint32_t& d, uint32_t s, int cnt) { - * d = s << cnt; - * } - * void lsrs(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) >> cnt; - * } - * void lsls(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) << cnt; - * } - * void umull(uint32_t& rlo, uint32_t& rhi, uint32_t op1, uint32_t op2) { - * uint64_t res = uint64_t(op1) * op2; - * rlo = uint32_t(res & 0xFFFFFFFF); - * rhi = uint32_t((res >> 32) & 0xFFFFFFFF); - * } - * void smlal(int32_t& rlo, int32_t& rhi, int32_t op1, int32_t op2) { - * int64_t mul = int64_t(op1) * op2; - * int64_t s = int64_t(uint32_t(rlo) | ((uint64_t(uint32_t(rhi)) << 32U))); - * mul += s; - * rlo = int32_t(mul & 0xFFFFFFFF); - * rhi = int32_t((mul >> 32) & 0xFFFFFFFF); - * } - * int32_t _eval_bezier_curve_arm(uint32_t curr_step) { - * register uint32_t flo = 0; - * register uint32_t fhi = bezier_AV * curr_step; - * register uint32_t t = fhi; - * register int32_t alo = bezier_F; - * register int32_t ahi = 0; - * register int32_t A = bezier_A; - * register int32_t B = bezier_B; - * register int32_t C = bezier_C; - * - * lsrs(ahi, alo, 1); // a = F << 31 - * lsls(alo, alo, 31); // - * umull(flo, fhi, fhi, t); // f *= t - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, C); // a+=(f>>33)*C - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, B); // a+=(f>>33)*B - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // f>>=33; - * smlal(alo, ahi, flo, A); // a+=(f>>33)*A; - * lsrs(alo, ahi, 6); // a>>=38 - * - * return alo; - * } - * - * This is rewritten in ARM assembly for optimal performance (43 cycles to execute). - * - * For AVR, the precision of coefficients is scaled so the Bézier curve can be evaluated in real-time: - * Let's reduce precision as much as possible. After some experimentation we found that: - * - * Assume t and AV with 24 bits is enough - * A = 6*(VF - VI) - * B = 15*(VI - VF) - * C = 10*(VF - VI) - * F = VI - * AV = (1<<24)/TS (this is computed at the planner, to offload expensive calculations from the ISR) - * - * Instead of storing sign for each coefficient, we will store its absolute value, - * and flag the sign of the A coefficient, so we can save to store the sign bit. - * It always holds that sign(A) = - sign(B) = sign(C) - * - * So, the resulting range of the coefficients are: - * - * t: unsigned (0 <= t < 1) |range 0 to 0xFFFFFF unsigned - * A: signed Q24 , range = 250000 * 6 = 1500000 = 0x16E360 | 21 bits - * B: signed Q24 , range = 250000 *15 = 3750000 = 0x393870 | 22 bits - * C: signed Q24 , range = 250000 *10 = 2500000 = 0x1312D0 | 21 bits - * F: signed Q24 , range = 250000 = 250000 = 0x0ED090 | 20 bits - * - * And for each curve, estimate its coefficients with: - * - * void _calc_bezier_curve_coeffs(int32_t v0, int32_t v1, uint32_t av) { - * // Calculate the Bézier coefficients - * if (v1 < v0) { - * A_negative = true; - * bezier_A = 6 * (v0 - v1); - * bezier_B = 15 * (v0 - v1); - * bezier_C = 10 * (v0 - v1); - * } - * else { - * A_negative = false; - * bezier_A = 6 * (v1 - v0); - * bezier_B = 15 * (v1 - v0); - * bezier_C = 10 * (v1 - v0); - * } - * bezier_F = v0; - * } - * - * And for each point, evaluate the curve with the following sequence: - * - * // unsigned multiplication of 24 bits x 24bits, return upper 16 bits - * void umul24x24to16hi(uint16_t& r, uint24_t op1, uint24_t op2) { - * r = (uint64_t(op1) * op2) >> 8; - * } - * // unsigned multiplication of 16 bits x 16bits, return upper 16 bits - * void umul16x16to16hi(uint16_t& r, uint16_t op1, uint16_t op2) { - * r = (uint32_t(op1) * op2) >> 16; - * } - * // unsigned multiplication of 16 bits x 24bits, return upper 24 bits - * void umul16x24to24hi(uint24_t& r, uint16_t op1, uint24_t op2) { - * r = uint24_t((uint64_t(op1) * op2) >> 16); - * } - * - * int32_t _eval_bezier_curve(uint32_t curr_step) { - * // To save computing, the first step is always the initial speed - * if (!curr_step) - * return bezier_F; - * - * uint16_t t; - * umul24x24to16hi(t, bezier_AV, curr_step); // t: Range 0 - 1^16 = 16 bits - * uint16_t f = t; - * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) - * uint24_t acc = bezier_F; // Range 20 bits (unsigned) - * if (A_negative) { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc -= v; - * } - * else { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc += v; - * } - * return acc; - * } - * These functions are translated to assembler for optimal performance. - * Coefficient calculation takes 70 cycles. Bezier point evaluation takes 150 cycles. - */ - - // For AVR we use assembly to maximize speed - void Stepper::_calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av) { - - // Store advance - bezier_AV = av; - - // Calculate the rest of the coefficients - register uint8_t r2 = v0 & 0xFF; - register uint8_t r3 = (v0 >> 8) & 0xFF; - register uint8_t r12 = (v0 >> 16) & 0xFF; - register uint8_t r5 = v1 & 0xFF; - register uint8_t r6 = (v1 >> 8) & 0xFF; - register uint8_t r7 = (v1 >> 16) & 0xFF; - register uint8_t r4,r8,r9,r10,r11; - - __asm__ __volatile__( - /* Calculate the Bézier coefficients */ - /* %10:%1:%0 = v0*/ - /* %5:%4:%3 = v1*/ - /* %7:%6:%10 = temporary*/ - /* %9 = val (must be high register!)*/ - /* %10 (must be high register!)*/ - - /* Store initial velocity*/ - A("sts bezier_F, %0") - A("sts bezier_F+1, %1") - A("sts bezier_F+2, %10") /* bezier_F = %10:%1:%0 = v0 */ - - /* Get delta speed */ - A("ldi %2,-1") /* %2 = 0xFF, means A_negative = true */ - A("clr %8") /* %8 = 0 */ - A("sub %0,%3") - A("sbc %1,%4") - A("sbc %10,%5") /* v0 -= v1, C=1 if result is negative */ - A("brcc 1f") /* branch if result is positive (C=0), that means v0 >= v1 */ - - /* Result was negative, get the absolute value*/ - A("com %10") - A("com %1") - A("neg %0") - A("sbc %1,%2") - A("sbc %10,%2") /* %10:%1:%0 +1 -> %10:%1:%0 = -(v0 - v1) = (v1 - v0) */ - A("clr %2") /* %2 = 0, means A_negative = false */ - - /* Store negative flag*/ - L("1") - A("sts A_negative, %2") /* Store negative flag */ - - /* Compute coefficients A,B and C [20 cycles worst case]*/ - A("ldi %9,6") /* %9 = 6 */ - A("mul %0,%9") /* r1:r0 = 6*LO(v0-v1) */ - A("sts bezier_A, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:r0 = 6*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 6*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 6*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 6*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 6*HI(v0-v1) << 16 */ - A("sts bezier_A+1, %6") - A("sts bezier_A+2, %7") /* bezier_A = %7:%6:?? = 6*(v0-v1) [35 cycles worst] */ - - A("ldi %9,15") /* %9 = 15 */ - A("mul %0,%9") /* r1:r0 = 5*LO(v0-v1) */ - A("sts bezier_B, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 5*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 5*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 5*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 5*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 5*HI(v0-v1) << 16 */ - A("sts bezier_B+1, %6") - A("sts bezier_B+2, %7") /* bezier_B = %7:%6:?? = 5*(v0-v1) [50 cycles worst] */ - - A("ldi %9,10") /* %9 = 10 */ - A("mul %0,%9") /* r1:r0 = 10*LO(v0-v1) */ - A("sts bezier_C, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 10*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 10*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 10*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 10*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 10*HI(v0-v1) << 16 */ - A("sts bezier_C+1, %6") - " sts bezier_C+2, %7" /* bezier_C = %7:%6:?? = 10*(v0-v1) [65 cycles worst] */ - : "+r" (r2), - "+d" (r3), - "=r" (r4), - "+r" (r5), - "+r" (r6), - "+r" (r7), - "=r" (r8), - "=r" (r9), - "=r" (r10), - "=d" (r11), - "+r" (r12) - : - : "r0", "r1", "cc", "memory" - ); - } - - FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) { - - // If dealing with the first step, save expensive computing and return the initial speed - if (!curr_step) - return bezier_F; - - register uint8_t r0 = 0; /* Zero register */ - register uint8_t r2 = (curr_step) & 0xFF; - register uint8_t r3 = (curr_step >> 8) & 0xFF; - register uint8_t r4 = (curr_step >> 16) & 0xFF; - register uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */ - - __asm__ __volatile( - /* umul24x24to16hi(t, bezier_AV, curr_step); t: Range 0 - 1^16 = 16 bits*/ - A("lds %9,bezier_AV") /* %9 = LO(AV)*/ - A("mul %9,%2") /* r1:r0 = LO(bezier_AV)*LO(curr_step)*/ - A("mov %7,r1") /* %7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("clr %8") /* %8:%7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("lds %10,bezier_AV+1") /* %10 = MI(AV)*/ - A("mul %10,%2") /* r1:r0 = MI(bezier_AV)*LO(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += MI(bezier_AV)*LO(curr_step)*/ - A("lds r1,bezier_AV+2") /* r11 = HI(AV)*/ - A("mul r1,%2") /* r1:r0 = HI(bezier_AV)*LO(curr_step)*/ - A("add %8,r0") /* %8:%7 += HI(bezier_AV)*LO(curr_step) << 8*/ - A("mul %9,%3") /* r1:r0 = LO(bezier_AV)*MI(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += LO(bezier_AV)*MI(curr_step)*/ - A("mul %10,%3") /* r1:r0 = MI(bezier_AV)*MI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*MI(curr_step) << 8*/ - A("mul %9,%4") /* r1:r0 = LO(bezier_AV)*HI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*HI(curr_step) << 8*/ - /* %8:%7 = t*/ - - /* uint16_t f = t;*/ - A("mov %5,%7") /* %6:%5 = f*/ - A("mov %6,%8") - /* %6:%5 = f*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits (unsigned) [17] */ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %9,r1") /* store MIL(LO(f) * LO(t)) in %9, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %9,r0") /* %9 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %9,r0") /* %9 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t)) */ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 = */ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - /* [15 +17*2] = [49]*/ - - /* %4:%3:%2 will be acc from now on*/ - - /* uint24_t acc = bezier_F; / Range 20 bits (unsigned)*/ - A("clr %9") /* "decimal place we get for free"*/ - A("lds %2,bezier_F") - A("lds %3,bezier_F+1") - A("lds %4,bezier_F+2") /* %4:%3:%2 = acc*/ - - /* if (A_negative) {*/ - A("lds r0,A_negative") - A("or r0,%0") /* Is flag signalling negative? */ - A("brne 3f") /* If yes, Skip next instruction if A was negative*/ - A("rjmp 1f") /* Otherwise, jump */ - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29] */ - /* acc -= v; */ - L("3") - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc -= v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 16*/ - A("jmp 2f") /* Done!*/ - - L("1") - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc -= v;*/ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 16*/ - L("2") - " clr __zero_reg__" /* C runtime expects r1 = __zero_reg__ = 0 */ - : "+r"(r0), - "+r"(r1), - "+r"(r2), - "+r"(r3), - "+r"(r4), - "+r"(r5), - "+r"(r6), - "+r"(r7), - "+r"(r8), - "+r"(r9), - "+r"(r10), - "+r"(r11) - : - :"cc","r0","r1" - ); - return (r2 | (uint16_t(r3) << 8)) | (uint32_t(r4) << 16); - } - -#endif // S_CURVE_ACCELERATION - -/** - * Stepper Driver Interrupt - * - * Directly pulses the stepper motors at high frequency. - */ - -HAL_STEP_TIMER_ISR { - HAL_timer_isr_prologue(STEP_TIMER_NUM); - - Stepper::isr(); - - HAL_timer_isr_epilogue(STEP_TIMER_NUM); -} - -#define STEP_MULTIPLY(A,B) MultiU24X32toH16(A, B) - -void Stepper::isr() { - DISABLE_ISRS(); - // Program timer compare for the maximum period, so it does NOT - // flag an interrupt while this ISR is running - So changes from small - // periods to big periods are respected and the timer does not reset to 0 - HAL_timer_set_compare(STEP_TIMER_NUM, HAL_TIMER_TYPE_MAX); - - // Count of ticks for the next ISR - hal_timer_t next_isr_ticks = 0; - - // Limit the amount of iterations - uint8_t max_loops = 10; - - // We need this variable here to be able to use it in the following loop - hal_timer_t min_ticks; - do { - // Enable ISRs to reduce USART processing latency - ENABLE_ISRS(); - - // Run main stepping pulse phase ISR if we have to - if (!nextMainISR) Stepper::stepper_pulse_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // Run linear advance stepper ISR if we have to - if (!nextAdvanceISR) nextAdvanceISR = Stepper::advance_isr(); - #endif - - // ^== Time critical. NOTHING besides pulse generation should be above here!!! - - // Run main stepping block processing ISR if we have to - if (!nextMainISR) nextMainISR = Stepper::stepper_block_phase_isr(); - - uint32_t interval = - #if ENABLED(LIN_ADVANCE) - MIN(nextAdvanceISR, nextMainISR) // Nearest time interval - #else - nextMainISR // Remaining stepper ISR time - #endif - ; - - // Limit the value to the maximum possible value of the timer - NOMORE(interval, HAL_TIMER_TYPE_MAX); - - // Compute the time remaining for the main isr - nextMainISR -= interval; - - #if ENABLED(LIN_ADVANCE) - // Compute the time remaining for the advance isr - if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval; - #endif - - /** - * This needs to avoid a race-condition caused by interleaving - * of interrupts required by both the LA and Stepper algorithms. - * - * Assume the following tick times for stepper pulses: - * Stepper ISR (S): 1 1000 2000 3000 4000 - * Linear Adv. (E): 10 1010 2010 3010 4010 - * - * The current algorithm tries to interleave them, giving: - * 1:S 10:E 1000:S 1010:E 2000:S 2010:E 3000:S 3010:E 4000:S 4010:E - * - * Ideal timing would yield these delta periods: - * 1:S 9:E 990:S 10:E 990:S 10:E 990:S 10:E 990:S 10:E - * - * But, since each event must fire an ISR with a minimum duration, the - * minimum delta might be 900, so deltas under 900 get rounded up: - * 900:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E - * - * It works, but divides the speed of all motors by half, leading to a sudden - * reduction to 1/2 speed! Such jumps in speed lead to lost steps (not even - * accounting for double/quad stepping, which makes it even worse). - */ - - // Compute the tick count for the next ISR - next_isr_ticks += interval; - - /** - * The following section must be done with global interrupts disabled. - * We want nothing to interrupt it, as that could mess the calculations - * we do for the next value to program in the period register of the - * stepper timer and lead to skipped ISRs (if the value we happen to program - * is less than the current count due to something preempting between the - * read and the write of the new period value). - */ - DISABLE_ISRS(); - - /** - * Get the current tick value + margin - * Assuming at least 6µs between calls to this ISR... - * On AVR the ISR epilogue+prologue is estimated at 100 instructions - Give 8µs as margin - * On ARM the ISR epilogue+prologue is estimated at 20 instructions - Give 1µs as margin - */ - min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t((STEPPER_TIMER_TICKS_PER_US) * 8); - - /** - * NB: If for some reason the stepper monopolizes the MPU, eventually the - * timer will wrap around (and so will 'next_isr_ticks'). So, limit the - * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse - * timing, since the MCU isn't fast enough. - */ - if (!--max_loops) next_isr_ticks = min_ticks; - - // Advance pulses if not enough time to wait for the next ISR - } while (next_isr_ticks < min_ticks); - - // Now 'next_isr_ticks' contains the period to the next Stepper ISR - And we are - // sure that the time has not arrived yet - Warrantied by the scheduler - - // Set the next ISR to fire at the proper time - HAL_timer_set_compare(STEP_TIMER_NUM, hal_timer_t(next_isr_ticks)); - - // Don't forget to finally reenable interrupts - ENABLE_ISRS(); -} - -/** - * This phase of the ISR should ONLY create the pulses for the steppers. - * This prevents jitter caused by the interval between the start of the - * interrupt and the start of the pulses. DON'T add any logic ahead of the - * call to this method that might cause variation in the timing. The aim - * is to keep pulse timing as regular as possible. - */ -void Stepper::stepper_pulse_phase_isr() { - - // If we must abort the current block, do so! - if (abort_current_block) { - abort_current_block = false; - if (current_block) { - axis_did_move = 0; - current_block = NULL; - planner.discard_current_block(); - } - } - - // If there is no current block, do nothing - if (!current_block) return; - - // Count of pending loops and events for this iteration - const uint32_t pending_events = step_event_count - step_events_completed; - uint8_t events_to_do = MIN(pending_events, steps_per_isr); - - // Just update the value we will get at the end of the loop - step_events_completed += events_to_do; - - // 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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Take multiple steps per interrupt (For high speed moves) - do { - - #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP - #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN - - // Start an active pulse, if Bresenham says so, and update position - #define PULSE_START(AXIS) do{ \ - delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); \ - count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ - } \ - }while(0) - - // Stop an active pulse, if any, and adjust error term - #define PULSE_STOP(AXIS) do { \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - delta_error[_AXIS(AXIS)] -= advance_divisor; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0); \ - } \ - }while(0) - - // Pulse start - #if HAS_X_STEP - PULSE_START(X); - #endif - #if HAS_Y_STEP - PULSE_START(Y); - #endif - #if HAS_Z_STEP - PULSE_START(Z); - #endif - - // Pulse E/Mixing extruders - #if ENABLED(LIN_ADVANCE) - // Tick the E axis, correct error term and update position - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - - // Don't step E here - But remember the number of steps to perform - motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; - } - #else // !LIN_ADVANCE - use linear interpolation for E also - #if ENABLED(MIXING_EXTRUDER) - - // Tick the E axis - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - } - - // Tick the counters used for this mix in proper proportion - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - - #else // !MIXING_EXTRUDER - PULSE_START(E); - #endif - #endif // !LIN_ADVANCE - - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - // Pulse stop - #if HAS_X_STEP - PULSE_STOP(X); - #endif - #if HAS_Y_STEP - PULSE_STOP(Y); - #endif - #if HAS_Z_STEP - PULSE_STOP(Z); - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } - #else // !MIXING_EXTRUDER - PULSE_STOP(E); - #endif - #endif // !LIN_ADVANCE - - // Decrement the count of pending pulses to do - --events_to_do; - - // For minimum pulse time wait after stopping pulses also - if (events_to_do) { - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - - } while (events_to_do); -} - -// This is the last half of the stepper interrupt: This one processes and -// properly schedules blocks from the planner. This is executed after creating -// the step pulses, so it is not time critical, as pulses are already done. - -uint32_t Stepper::stepper_block_phase_isr() { - - // If no queued movements, just wait 1ms for the next move - uint32_t interval = (STEPPER_TIMER_RATE / 1000); - - // If there is a current block - if (current_block) { - - // If current block is finished, reset pointer - if (step_events_completed >= step_event_count) { - axis_did_move = 0; - current_block = NULL; - planner.discard_current_block(); - } - else { - // Step events not completed yet... - - // Are we in acceleration phase ? - if (step_events_completed <= accelerate_until) { // Calculate new timer value - - #if ENABLED(S_CURVE_ACCELERATION) - // Get the next speed to use (Jerk limited!) - uint32_t acc_step_rate = - acceleration_time < current_block->acceleration_time - ? _eval_bezier_curve(acceleration_time) - : current_block->cruise_rate; - #else - acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; - NOMORE(acc_step_rate, current_block->nominal_rate); - #endif - - // acc_step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(acc_step_rate, oversampling_factor, &steps_per_isr); - acceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Wake up eISR on first acceleration loop and fire ISR if final adv_rate is reached - if (step_events_completed == steps_per_isr || (LA_steps && LA_isr_rate != current_block->advance_speed)) { - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - } - else { - LA_isr_rate = LA_ADV_NEVER; - if (LA_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - // Are we in Deceleration phase ? - else if (step_events_completed > decelerate_after) { - uint32_t step_rate; - - #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... - if (!bezier_2nd_half) { - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); - bezier_2nd_half = true; - // The first point starts at cruise rate. Just save evaluation of the Bézier curve - step_rate = current_block->cruise_rate; - } - else { - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - } - #else - - // Using the old trapezoidal control - step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? - step_rate = acc_step_rate - step_rate; - NOLESS(step_rate, current_block->final_rate); - } - else - step_rate = current_block->final_rate; - #endif - - // step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(step_rate, oversampling_factor, &steps_per_isr); - deceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - if (step_events_completed <= decelerate_after + steps_per_isr || - (LA_steps && LA_isr_rate != current_block->advance_speed) - ) { - nextAdvanceISR = 0; // Wake up eISR on first deceleration loop - LA_isr_rate = current_block->advance_speed; - } - } - else { - LA_isr_rate = LA_ADV_NEVER; - if (LA_steps) nextAdvanceISR = 0; - } - #endif // LIN_ADVANCE - } - // We must be in cruise phase otherwise - else { - - #if ENABLED(LIN_ADVANCE) - // If there are any esteps, fire the next advance_isr "now" - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - #endif - - // Calculate the ticks_nominal for this nominal speed, if not done yet - if (ticks_nominal < 0) { - // step_rate to timer interval and loops for the nominal speed - ticks_nominal = calc_timer_interval(current_block->nominal_rate, oversampling_factor, &steps_per_isr); - } - - // The timer interval is just the nominal value for the nominal speed - interval = ticks_nominal; - } - } - } - - // If there is no current block at this point, attempt to pop one from the buffer - // and prepare its movement - if (!current_block) { - - // Anything in the buffer? - if ((current_block = planner.get_current_block())) { - - // Sync block? Sync the stepper counts and return - while (TEST(current_block->flag, BLOCK_BIT_SYNC_POSITION)) { - _set_position( - current_block->position[A_AXIS], current_block->position[B_AXIS], - current_block->position[C_AXIS], current_block->position[E_AXIS] - ); - planner.discard_current_block(); - - // Try to get a new block - if (!(current_block = planner.get_current_block())) - return interval; // No more queued movements! - } - - // Flag all moving axes for proper endstop handling - - #if IS_CORE - // Define conditions for checking endstops - #define S_(N) current_block->steps[CORE_AXIS_##N] - #define D_(N) TEST(current_block->direction_bits, CORE_AXIS_##N) - #endif - - #if CORE_IS_XY || CORE_IS_XZ - /** - * Head direction in -X axis for CoreXY and CoreXZ bots. - * - * If steps differ, both axes are moving. - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) - * If DeltaA == DeltaB, the movement is only in the 1st axis (X) - */ - #if ENABLED(COREXY) || ENABLED(COREXZ) - #define X_CMP == - #else - #define X_CMP != - #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) - #else - #define X_MOVE_TEST !!current_block->steps[A_AXIS] - #endif - - #if CORE_IS_XY || CORE_IS_YZ - /** - * Head direction in -Y axis for CoreXY / CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) - */ - #if ENABLED(COREYX) || ENABLED(COREYZ) - #define Y_CMP == - #else - #define Y_CMP != - #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) - #else - #define Y_MOVE_TEST !!current_block->steps[B_AXIS] - #endif - - #if CORE_IS_XZ || CORE_IS_YZ - /** - * Head direction in -Z axis for CoreXZ or CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) - */ - #if ENABLED(COREZX) || ENABLED(COREZY) - #define Z_CMP == - #else - #define Z_CMP != - #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) - #else - #define Z_MOVE_TEST !!current_block->steps[C_AXIS] - #endif - - uint8_t axis_bits = 0; - if (X_MOVE_TEST) SBI(axis_bits, A_AXIS); - if (Y_MOVE_TEST) SBI(axis_bits, B_AXIS); - if (Z_MOVE_TEST) SBI(axis_bits, C_AXIS); - //if (!!current_block->steps[E_AXIS]) SBI(axis_bits, E_AXIS); - //if (!!current_block->steps[A_AXIS]) SBI(axis_bits, X_HEAD); - //if (!!current_block->steps[B_AXIS]) SBI(axis_bits, Y_HEAD); - //if (!!current_block->steps[C_AXIS]) SBI(axis_bits, Z_HEAD); - axis_did_move = axis_bits; - - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; - - uint8_t oversampling = 0; // Assume we won't use it - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - // At this point, we must decide if we can use Stepper movement axis smoothing. - uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) - while (max_rate < MIN_STEP_ISR_FREQUENCY) { - max_rate <<= 1; - if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; - ++oversampling; - } - oversampling_factor = oversampling; - #endif - - // Based on the oversampling factor, do the calculations - step_event_count = current_block->step_event_count << oversampling; - - // Initialize Bresenham delta errors to 1/2 - delta_error[X_AXIS] = delta_error[Y_AXIS] = delta_error[Z_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); - - // Calculate Bresenham dividends - advance_dividend[X_AXIS] = current_block->steps[X_AXIS] << 1; - advance_dividend[Y_AXIS] = current_block->steps[Y_AXIS] << 1; - advance_dividend[Z_AXIS] = current_block->steps[Z_AXIS] << 1; - advance_dividend[E_AXIS] = current_block->steps[E_AXIS] << 1; - - // Calculate Bresenham divisor - advance_divisor = step_event_count << 1; - - // No step events completed so far - step_events_completed = 0; - - // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling; - decelerate_after = current_block->decelerate_after << oversampling; - - #if ENABLED(MIXING_EXTRUDER) - const uint32_t e_steps = ( - #if ENABLED(LIN_ADVANCE) - current_block->steps[E_AXIS] - #else - step_event_count - #endif - ); - MIXING_STEPPERS_LOOP(i) { - delta_error_m[i] = -int32_t(e_steps); - advance_dividend_m[i] = current_block->mix_steps[i] << 1; - } - advance_divisor_m = e_steps << 1; - #else - active_extruder = current_block->active_extruder; - #endif - - // Initialize the trapezoid generator from the current block. - #if ENABLED(LIN_ADVANCE) - #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 - // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - if (active_extruder != last_moved_extruder) LA_current_adv_steps = 0; - #endif - - if ((LA_use_advance_lead = current_block->use_advance_lead)) { - LA_final_adv_steps = current_block->final_adv_steps; - LA_max_adv_steps = current_block->max_adv_steps; - } - #endif - - if (current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || active_extruder != last_moved_extruder - #endif - ) { - last_direction_bits = current_block->direction_bits; - #if DISABLED(MIXING_EXTRUDER) - last_moved_extruder = active_extruder; - #endif - set_directions(); - } - - // At this point, we must ensure the movement about to execute isn't - // trying to force the head against a limit switch. If using interrupt- - // driven change detection, and already against a limit then no call to - // the endstop_triggered method will be done and the movement will be - // done against the endstop. So, check the limits here: If the movement - // is against the limits, the block will be marked as to be killed, and - // on the next call to this ISR, will be discarded. - endstops.update(); - - #if ENABLED(Z_LATE_ENABLE) - // If delayed Z enable, enable it now. This option will severely interfere with - // timing between pulses when chaining motion between blocks, and it could lead - // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! - if (current_block->steps[Z_AXIS]) enable_Z(); - #endif - - // Mark the time_nominal as not calculated yet - ticks_nominal = -1; - - #if DISABLED(S_CURVE_ACCELERATION) - // Set as deceleration point the initial rate of the block - acc_step_rate = current_block->initial_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->initial_rate, current_block->cruise_rate, current_block->acceleration_time_inverse); - // We haven't started the 2nd half of the trapezoid - bezier_2nd_half = false; - #endif - - // Calculate the initial timer interval - interval = calc_timer_interval(current_block->initial_rate, oversampling_factor, &steps_per_isr); - } - } - - // Return the interval to wait - return interval; -} - -#if ENABLED(LIN_ADVANCE) - - // Timer interrupt for E. LA_steps is set in the main routine - uint32_t Stepper::advance_isr() { - uint32_t interval; - - if (LA_use_advance_lead) { - if (step_events_completed > decelerate_after && LA_current_adv_steps > LA_final_adv_steps) { - LA_steps--; - LA_current_adv_steps--; - interval = LA_isr_rate; - } - else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { - //step_events_completed <= (uint32_t)accelerate_until) { - LA_steps++; - LA_current_adv_steps++; - interval = LA_isr_rate; - } - else - interval = LA_isr_rate = LA_ADV_NEVER; - } - else - interval = LA_ADV_NEVER; - - #if ENABLED(MIXING_EXTRUDER) - if (LA_steps >= 0) - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); - else - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); - #else - if (LA_steps >= 0) - NORM_E_DIR(active_extruder); - else - REV_E_DIR(active_extruder); - #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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Step E stepper if we have steps - while (LA_steps) { - - // Set the STEP pulse ON - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - #else - E_STEP_WRITE(active_extruder, !INVERT_E_STEP_PIN); - #endif - - // Enforce a minimum duration for STEP pulse ON - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - LA_steps < 0 ? ++LA_steps : --LA_steps; - - // Set the STEP pulse OFF - #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } - #else - E_STEP_WRITE(active_extruder, INVERT_E_STEP_PIN); - #endif - - // For minimum pulse time wait before looping - // Just wait for the requested pulse duration - if (LA_steps) { - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - } // LA_steps - - return interval; - } -#endif // LIN_ADVANCE - -// Check if the given block is busy or not - Must not be called from ISR contexts -// The current_block could change in the middle of the read by an Stepper ISR, so -// we must explicitly prevent that! -bool Stepper::is_block_busy(const block_t* const block) { - #define sw_barrier() asm volatile("": : :"memory"); - - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because stepper ISRs happen at a slower rate than - // successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - block_t* vold, *vnew = current_block; - sw_barrier(); - do { - vold = vnew; - vnew = current_block; - sw_barrier(); - } while (vold != vnew); - - // Return if the block is busy or not - return block == vnew; -} - -void Stepper::init() { - - // Init Digipot Motor Current - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - digipot_init(); - #endif - - // Init Microstepping Pins - #if HAS_MICROSTEPS - microstep_init(); - #endif - - // Init Dir Pins - #if HAS_X_DIR - X_DIR_INIT; - #endif - #if HAS_X2_DIR - X2_DIR_INIT; - #endif - #if HAS_Y_DIR - Y_DIR_INIT; - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR - Y2_DIR_INIT; - #endif - #endif - #if HAS_Z_DIR - Z_DIR_INIT; - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_DIR - Z2_DIR_INIT; - #endif - #endif - #if HAS_E0_DIR - E0_DIR_INIT; - #endif - #if HAS_E1_DIR - E1_DIR_INIT; - #endif - #if HAS_E2_DIR - E2_DIR_INIT; - #endif - #if HAS_E3_DIR - E3_DIR_INIT; - #endif - #if HAS_E4_DIR - E4_DIR_INIT; - #endif - - // Init Enable Pins - steppers default to disabled. - #if HAS_X_ENABLE - X_ENABLE_INIT; - if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); - #if (ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)) && HAS_X2_ENABLE - X2_ENABLE_INIT; - if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Y_ENABLE - Y_ENABLE_INIT; - if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE - Y2_ENABLE_INIT; - if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Z_ENABLE - Z_ENABLE_INIT; - if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_ENABLE - Z2_ENABLE_INIT; - if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_E0_ENABLE - E0_ENABLE_INIT; - if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); - #endif - #if HAS_E1_ENABLE - E1_ENABLE_INIT; - if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); - #endif - #if HAS_E2_ENABLE - E2_ENABLE_INIT; - if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); - #endif - #if HAS_E3_ENABLE - E3_ENABLE_INIT; - if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); - #endif - #if HAS_E4_ENABLE - E4_ENABLE_INIT; - if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); - #endif - - #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT - #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) - #define _DISABLE(AXIS) disable_## AXIS() - - #define AXIS_INIT(AXIS, PIN) \ - _STEP_INIT(AXIS); \ - _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \ - _DISABLE(AXIS) - - #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E) - - // Init Step Pins - #if HAS_X_STEP - #if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE) - X2_STEP_INIT; - X2_STEP_WRITE(INVERT_X_STEP_PIN); - #endif - AXIS_INIT(X, X); - #endif - - #if HAS_Y_STEP - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - Y2_STEP_INIT; - Y2_STEP_WRITE(INVERT_Y_STEP_PIN); - #endif - AXIS_INIT(Y, Y); - #endif - - #if HAS_Z_STEP - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - Z2_STEP_INIT; - Z2_STEP_WRITE(INVERT_Z_STEP_PIN); - #endif - AXIS_INIT(Z, Z); - #endif - - #if E_STEPPERS > 0 && HAS_E0_STEP - E_AXIS_INIT(0); - #endif - #if E_STEPPERS > 1 && HAS_E1_STEP - E_AXIS_INIT(1); - #endif - #if E_STEPPERS > 2 && HAS_E2_STEP - E_AXIS_INIT(2); - #endif - #if E_STEPPERS > 3 && HAS_E3_STEP - E_AXIS_INIT(3); - #endif - #if E_STEPPERS > 4 && HAS_E4_STEP - E_AXIS_INIT(4); - #endif - - // Init Stepper ISR to 122 Hz for quick starting - HAL_timer_start(STEP_TIMER_NUM, 122); // OCR1A = 0x4000 - - ENABLE_STEPPER_DRIVER_INTERRUPT(); - - endstops.enable(true); // Start with endstops active. After homing they can be disabled - sei(); - - set_directions(); // Init directions to last_direction_bits = 0 -} - -/** - * Set the stepper positions directly in steps - * - * The input is based on the typical per-axis XYZ steps. - * For CORE machines XYZ needs to be translated to ABC. - * - * This allows get_axis_position_mm to correctly - * derive the current XYZ position later on. - */ -void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - #if CORE_IS_XY - // corexy positioning - // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html - count_position[A_AXIS] = a + b; - count_position[B_AXIS] = CORESIGN(a - b); - count_position[Z_AXIS] = c; - #elif CORE_IS_XZ - // corexz planning - count_position[A_AXIS] = a + c; - count_position[Y_AXIS] = b; - count_position[C_AXIS] = CORESIGN(a - c); - #elif CORE_IS_YZ - // coreyz planning - count_position[X_AXIS] = a; - count_position[B_AXIS] = b + c; - count_position[C_AXIS] = CORESIGN(b - c); - #else - // default non-h-bot planning - count_position[X_AXIS] = a; - count_position[Y_AXIS] = b; - count_position[Z_AXIS] = c; - #endif - count_position[E_AXIS] = e; -} - -/** - * Get a stepper's position in steps. - */ -int32_t Stepper::position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = count_position[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - return v; -} - -// Signal endstops were triggered - This function can be called from -// an ISR context (Temperature, Stepper or limits ISR), so we must -// be very careful here. If the interrupt being preempted was the -// Stepper ISR (this CAN happen with the endstop limits ISR) then -// when the stepper ISR resumes, we must be very sure that the movement -// is properly cancelled -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 - - // Discard the rest of the move if there is a current block - quick_stop(); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -int32_t Stepper::triggered_position(const AxisEnum axis) { - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - const int32_t v = endstops_trigsteps[axis]; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - return v; -} - -void Stepper::report_positions() { - - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - 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(); - - #if CORE_IS_XY || CORE_IS_XZ || IS_DELTA || IS_SCARA - SERIAL_PROTOCOLPGM(MSG_COUNT_A); - #else - SERIAL_PROTOCOLPGM(MSG_COUNT_X); - #endif - SERIAL_PROTOCOL(xpos); - - #if CORE_IS_XY || CORE_IS_YZ || IS_DELTA || IS_SCARA - SERIAL_PROTOCOLPGM(" B:"); - #else - SERIAL_PROTOCOLPGM(" Y:"); - #endif - SERIAL_PROTOCOL(ypos); - - #if CORE_IS_XZ || CORE_IS_YZ || IS_DELTA - SERIAL_PROTOCOLPGM(" C:"); - #else - SERIAL_PROTOCOLPGM(" Z:"); - #endif - SERIAL_PROTOCOL(zpos); - - SERIAL_EOL(); -} - -#if ENABLED(BABYSTEPPING) - - #if MINIMUM_STEPPER_PULSE - #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) - #else - #define STEP_PULSE_CYCLES 0 - #endif - - #if ENABLED(DELTA) - #define CYCLES_EATEN_BABYSTEP (2 * 15) - #else - #define CYCLES_EATEN_BABYSTEP 0 - #endif - #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) - - #define _ENABLE(AXIS) enable_## AXIS() - #define _READ_DIR(AXIS) AXIS ##_DIR_READ - #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR - #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) - - #if EXTRA_CYCLES_BABYSTEP > 20 - #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM) - #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - #else - #define _SAVE_START NOOP - #if EXTRA_CYCLES_BABYSTEP > 0 - #define _PULSE_WAIT DELAY_NS(EXTRA_CYCLES_BABYSTEP * NANOSECONDS_PER_CYCLE) - #elif STEP_PULSE_CYCLES > 0 - #define _PULSE_WAIT NOOP - #elif ENABLED(DELTA) - #define _PULSE_WAIT DELAY_US(2); - #else - #define _PULSE_WAIT DELAY_US(4); - #endif - #endif - - #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ - const uint8_t old_dir = _READ_DIR(AXIS); \ - _ENABLE(AXIS); \ - _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); \ - _SAVE_START; \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ - _APPLY_DIR(AXIS, old_dir); \ - } - - // MUST ONLY BE CALLED BY AN ISR, - // No other ISR should ever interrupt this! - void Stepper::babystep(const AxisEnum axis, const bool direction) { - cli(); - - switch (axis) { - - #if ENABLED(BABYSTEP_XY) - - case X_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction); - #elif CORE_IS_XZ - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Z, false, direction); - #else - BABYSTEP_AXIS(X, false, direction); - #endif - break; - - case Y_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0)); - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, false, direction); - BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0)); - #else - BABYSTEP_AXIS(Y, false, direction); - #endif - break; - - #endif - - case Z_AXIS: { - - #if CORE_IS_XZ - BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); - - #else // DELTA - - const bool z_direction = direction ^ BABYSTEP_INVERT_Z; - - enable_X(); - enable_Y(); - enable_Z(); - - const uint8_t old_x_dir_pin = X_DIR_READ, - old_y_dir_pin = Y_DIR_READ, - old_z_dir_pin = Z_DIR_READ; - - X_DIR_WRITE(INVERT_X_DIR ^ z_direction); - 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); - #endif - - _SAVE_START; - - X_STEP_WRITE(!INVERT_X_STEP_PIN); - Y_STEP_WRITE(!INVERT_Y_STEP_PIN); - Z_STEP_WRITE(!INVERT_Z_STEP_PIN); - - _PULSE_WAIT; - - X_STEP_WRITE(INVERT_X_STEP_PIN); - Y_STEP_WRITE(INVERT_Y_STEP_PIN); - Z_STEP_WRITE(INVERT_Z_STEP_PIN); - - // Restore direction bits - X_DIR_WRITE(old_x_dir_pin); - Y_DIR_WRITE(old_y_dir_pin); - Z_DIR_WRITE(old_z_dir_pin); - - #endif - - } break; - - default: break; - } - sei(); - } - -#endif // BABYSTEPPING - -/** - * Software-controlled Stepper Motor Current - */ - -#if HAS_DIGIPOTSS - - // From Arduino DigitalPotControl example - void Stepper::digitalPotWrite(const int16_t address, const int16_t value) { - WRITE(DIGIPOTSS_PIN, LOW); // Take the SS pin low to select the chip - SPI.transfer(address); // Send the address and value via SPI - SPI.transfer(value); - WRITE(DIGIPOTSS_PIN, HIGH); // Take the SS pin high to de-select the chip - //delay(10); - } - -#endif // HAS_DIGIPOTSS - -#if HAS_MOTOR_CURRENT_PWM - - void Stepper::refresh_motor_power() { - for (uint8_t i = 0; i < COUNT(motor_current_setting); ++i) { - switch (i) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - case 0: - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - case 2: - #endif - digipot_current(i, motor_current_setting[i]); - default: break; - } - } - } - -#endif // HAS_MOTOR_CURRENT_PWM - -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - - void Stepper::digipot_current(const uint8_t driver, const int current) { - - #if HAS_DIGIPOTSS - - const uint8_t digipot_ch[] = DIGIPOT_CHANNELS; - digitalPotWrite(digipot_ch[driver], current); - - #elif HAS_MOTOR_CURRENT_PWM - - if (WITHIN(driver, 0, 2)) - motor_current_setting[driver] = current; // update motor_current_setting - - #define _WRITE_CURRENT_PWM(P) analogWrite(MOTOR_CURRENT_PWM_## P ##_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)) - switch (driver) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - case 0: _WRITE_CURRENT_PWM(XY); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: _WRITE_CURRENT_PWM(Z); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - case 2: _WRITE_CURRENT_PWM(E); break; - #endif - } - #endif - } - - void Stepper::digipot_init() { - - #if HAS_DIGIPOTSS - - static const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT; - - SPI.begin(); - SET_OUTPUT(DIGIPOTSS_PIN); - - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) { - //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]); - digipot_current(i, digipot_motor_current[i]); - } - - #elif HAS_MOTOR_CURRENT_PWM - - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); - #endif - - refresh_motor_power(); - - // Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) - SET_CS5(PRESCALER_1); - - #endif - } - -#endif - -#if HAS_MICROSTEPS - - /** - * Software-controlled Microstepping - */ - - void Stepper::microstep_init() { - SET_OUTPUT(X_MS1_PIN); - SET_OUTPUT(X_MS2_PIN); - #if HAS_Y_MICROSTEPS - SET_OUTPUT(Y_MS1_PIN); - SET_OUTPUT(Y_MS2_PIN); - #endif - #if HAS_Z_MICROSTEPS - SET_OUTPUT(Z_MS1_PIN); - SET_OUTPUT(Z_MS2_PIN); - #endif - #if HAS_E0_MICROSTEPS - SET_OUTPUT(E0_MS1_PIN); - SET_OUTPUT(E0_MS2_PIN); - #endif - #if HAS_E1_MICROSTEPS - SET_OUTPUT(E1_MS1_PIN); - SET_OUTPUT(E1_MS2_PIN); - #endif - #if HAS_E2_MICROSTEPS - SET_OUTPUT(E2_MS1_PIN); - SET_OUTPUT(E2_MS2_PIN); - #endif - #if HAS_E3_MICROSTEPS - SET_OUTPUT(E3_MS1_PIN); - SET_OUTPUT(E3_MS2_PIN); - #endif - #if HAS_E4_MICROSTEPS - SET_OUTPUT(E4_MS1_PIN); - SET_OUTPUT(E4_MS2_PIN); - #endif - static const uint8_t microstep_modes[] = MICROSTEP_MODES; - for (uint16_t i = 0; i < COUNT(microstep_modes); i++) - microstep_mode(i, microstep_modes[i]); - } - - void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2) { - if (ms1 >= 0) switch (driver) { - case 0: WRITE(X_MS1_PIN, ms1); break; - #if HAS_Y_MICROSTEPS - case 1: WRITE(Y_MS1_PIN, ms1); break; - #endif - #if HAS_Z_MICROSTEPS - case 2: WRITE(Z_MS1_PIN, ms1); break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS1_PIN, ms1); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS1_PIN, ms1); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS1_PIN, ms1); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS1_PIN, ms1); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS1_PIN, ms1); break; - #endif - } - if (ms2 >= 0) switch (driver) { - case 0: WRITE(X_MS2_PIN, ms2); break; - #if HAS_Y_MICROSTEPS - case 1: WRITE(Y_MS2_PIN, ms2); break; - #endif - #if HAS_Z_MICROSTEPS - case 2: WRITE(Z_MS2_PIN, ms2); break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS2_PIN, ms2); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS2_PIN, ms2); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS2_PIN, ms2); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS2_PIN, ms2); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS2_PIN, ms2); break; - #endif - } - } - - void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) { - switch (stepping_mode) { - case 1: microstep_ms(driver, MICROSTEP1); break; - #if ENABLED(HEROIC_STEPPER_DRIVERS) - case 128: microstep_ms(driver, MICROSTEP128); break; - #else - case 2: microstep_ms(driver, MICROSTEP2); break; - case 4: microstep_ms(driver, MICROSTEP4); break; - #endif - case 8: microstep_ms(driver, MICROSTEP8); break; - case 16: microstep_ms(driver, MICROSTEP16); break; - default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break; - } - } - - void Stepper::microstep_readings() { - SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); - SERIAL_PROTOCOLPGM("X: "); - SERIAL_PROTOCOL(READ(X_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(X_MS2_PIN)); - #if HAS_Y_MICROSTEPS - SERIAL_PROTOCOLPGM("Y: "); - SERIAL_PROTOCOL(READ(Y_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(Y_MS2_PIN)); - #endif - #if HAS_Z_MICROSTEPS - SERIAL_PROTOCOLPGM("Z: "); - SERIAL_PROTOCOL(READ(Z_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(Z_MS2_PIN)); - #endif - #if HAS_E0_MICROSTEPS - SERIAL_PROTOCOLPGM("E0: "); - SERIAL_PROTOCOL(READ(E0_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E0_MS2_PIN)); - #endif - #if HAS_E1_MICROSTEPS - SERIAL_PROTOCOLPGM("E1: "); - SERIAL_PROTOCOL(READ(E1_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E1_MS2_PIN)); - #endif - #if HAS_E2_MICROSTEPS - SERIAL_PROTOCOLPGM("E2: "); - SERIAL_PROTOCOL(READ(E2_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E2_MS2_PIN)); - #endif - #if HAS_E3_MICROSTEPS - SERIAL_PROTOCOLPGM("E3: "); - SERIAL_PROTOCOL(READ(E3_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E3_MS2_PIN)); - #endif - #if HAS_E4_MICROSTEPS - SERIAL_PROTOCOLPGM("E4: "); - SERIAL_PROTOCOL(READ(E4_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E4_MS2_PIN)); - #endif - } - -#endif // HAS_MICROSTEPS diff --git a/Marlin_thinkerV2/Marlin/stepper.h b/Marlin_thinkerV2/Marlin/stepper.h deleted file mode 100644 index 2ac9c7756a..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper.h +++ /dev/null @@ -1,527 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors - * Derived from Grbl - * - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -#ifndef STEPPER_H -#define STEPPER_H - -#include "MarlinConfig.h" - -// Disable multiple steps per ISR -//#define DISABLE_MULTI_STEPPING - -// -// Estimate the amount of time the Stepper ISR will take to execute -// - -#ifndef MINIMUM_STEPPER_PULSE - #define MINIMUM_STEPPER_PULSE 0UL -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if MINIMUM_STEPPER_PULSE - #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (unsigned long)(MINIMUM_STEPPER_PULSE))) - #else - #define MAXIMUM_STEPPER_RATE 500000UL - #endif -#endif - -// The base ISR takes 752 cycles -#define ISR_BASE_CYCLES 752UL - -// Linear advance base time is 32 cycles -#if ENABLED(LIN_ADVANCE) - #define ISR_LA_BASE_CYCLES 32UL -#else - #define ISR_LA_BASE_CYCLES 0UL -#endif - -// S curve interpolation adds 160 cycles -#if ENABLED(S_CURVE_ACCELERATION) - #define ISR_S_CURVE_CYCLES 160UL -#else - #define ISR_S_CURVE_CYCLES 0UL -#endif - -// Stepper Loop base cycles -#define ISR_LOOP_BASE_CYCLES 32UL - -// To start the step pulse, in the worst case takes -#define ISR_START_STEPPER_CYCLES 57UL - -// And each stepper (start + stop pulse) takes in worst case -#define ISR_STEPPER_CYCLES 88UL - -// Add time for each stepper -#ifdef HAS_X_STEP - #define ISR_START_X_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_X_STEPPER_CYCLES 0UL - #define ISR_X_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Y_STEP - #define ISR_START_Y_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Y_STEPPER_CYCLES 0UL - #define ISR_Y_STEPPER_CYCLES 0UL -#endif -#ifdef HAS_Z_STEP - #define ISR_START_Z_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Z_STEPPER_CYCLES 0UL - #define ISR_Z_STEPPER_CYCLES 0UL -#endif - -// E is always interpolated, even for mixing extruders -#define ISR_START_E_STEPPER_CYCLES ISR_START_STEPPER_CYCLES -#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES - -// If linear advance is disabled, then the loop also handles them -#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) - #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES)) - #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) -#else - #define ISR_START_MIXING_STEPPER_CYCLES 0UL - #define ISR_MIXING_STEPPER_CYCLES 0UL -#endif - -// Calculate the minimum time to start all stepper pulses in the ISR loop -#define MIN_ISR_START_LOOP_CYCLES (ISR_START_X_STEPPER_CYCLES + ISR_START_Y_STEPPER_CYCLES + ISR_START_Z_STEPPER_CYCLES + ISR_START_E_STEPPER_CYCLES + ISR_START_MIXING_STEPPER_CYCLES) - -// And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES) - -// Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate -#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((unsigned long)((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) -#if MINIMUM_STEPPER_PULSE - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((unsigned long)(MINIMUM_STEPPER_PULSE)) -#else - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL) -#endif - -// Calculate the minimum ticks of the PULSE timer that must elapse with the step pulse enabled -// 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 -#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (unsigned long)(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (unsigned long)(PULSE_TIMER_PRESCALE))) - -// Calculate the extra ticks of the PULSE timer between step pulses -#define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS)) - -// But the user could be enforcing a minimum time, so the loop time is -#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES)) - -// If linear advance is enabled, then it is handled separately -#if ENABLED(LIN_ADVANCE) - - // Estimate the minimum LA loop time - #if ENABLED(MIXING_EXTRUDER) - #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) - #else - #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES - #endif - - // And the real loop time - #define ISR_LA_LOOP_CYCLES MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES) - -#else - #define ISR_LA_LOOP_CYCLES 0UL -#endif - -// Now estimate the total ISR execution time in cycles given a step per ISR multiplier -#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES) * (R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R)) - -// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz) -#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128)) -#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64)) -#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32)) -#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16)) -#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8)) -#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4)) -#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2)) -#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1)) - -// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz) -#define MIN_STEP_ISR_FREQUENCY MAX_STEP_ISR_FREQUENCY_1X - -// -// Stepper class definition -// - -#include "planner.h" -#include "speed_lookuptable.h" -#include "stepper_indirection.h" -#include "language.h" -#include "types.h" - -// intRes = intIn1 * intIn2 >> 16 -// uses: -// r26 to store 0 -// r27 to store the byte 1 of the 24 bit result -static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { - register uint8_t tmp; - register uint16_t intRes; - __asm__ __volatile__ ( - A("clr %[tmp]") - A("mul %[charIn1], %B[intIn2]") - A("movw %A[intRes], r0") - A("mul %[charIn1], %A[intIn2]") - A("add %A[intRes], r1") - A("adc %B[intRes], %[tmp]") - A("lsr r0") - A("adc %A[intRes], %[tmp]") - A("adc %B[intRes], %[tmp]") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp] "=&r" (tmp) - : [charIn1] "d" (charIn1), - [intIn2] "d" (intIn2) - : "cc" - ); - return intRes; -} - -class Stepper { - - public: - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - static bool homing_dual_axis; - #endif - - #if HAS_MOTOR_CURRENT_PWM - #ifndef PWM_MOTOR_CURRENT - #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT - #endif - static uint32_t motor_current_setting[3]; - #endif - - private: - - static block_t* current_block; // A pointer to the block currently being traced - - static uint8_t last_direction_bits, // The next stepping-bits to be output - axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner - - static bool abort_current_block; // Signals to the stepper that current block should be aborted - - #if DISABLED(MIXING_EXTRUDER) - static uint8_t last_moved_extruder; // Last-moved extruder, as set when the last movement was fetched from planner - #endif - - #if ENABLED(X_DUAL_ENDSTOPS) - static bool locked_X_motor, locked_X2_motor; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static bool locked_Y_motor, locked_Y2_motor; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static bool locked_Z_motor, locked_Z2_motor; - #endif - - static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks - static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis - #else - static constexpr uint8_t oversampling_factor = 0; - #endif - - // Delta error variables for the Bresenham line tracer - static int32_t delta_error[XYZE]; - static uint32_t advance_dividend[XYZE], - advance_divisor, - step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating - step_event_count; // The total event count for the current block - - // Mixing extruder mix delta_errors for bresenham tracing - #if ENABLED(MIXING_EXTRUDER) - static int32_t delta_error_m[MIXING_STEPPERS]; - static uint32_t advance_dividend_m[MIXING_STEPPERS], - advance_divisor_m; - #define MIXING_STEPPERS_LOOP(VAR) \ - for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) - #else - static int8_t active_extruder; // Active extruder - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - static int32_t bezier_A, // A coefficient in Bézier speed curve - bezier_B, // B coefficient in Bézier speed curve - bezier_C; // C coefficient in Bézier speed curve - static uint32_t bezier_F, // F coefficient in Bézier speed curve - bezier_AV; // AV coefficient in Bézier speed curve - static bool A_negative, // If A coefficient was negative - bezier_2nd_half; // If Bézier curve has been initialized or not - #endif - - static uint32_t nextMainISR; // time remaining for the next Step ISR - #if ENABLED(LIN_ADVANCE) - static uint32_t nextAdvanceISR, LA_isr_rate; - static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early". - static int8_t LA_steps; - static bool LA_use_advance_lead; - #endif // LIN_ADVANCE - - static int32_t ticks_nominal; - #if DISABLED(S_CURVE_ACCELERATION) - static uint32_t acc_step_rate; // needed for deceleration start point - #endif - - static volatile int32_t endstops_trigsteps[XYZ]; - - // - // Positions of stepper motors, in step units - // - static volatile int32_t count_position[NUM_AXIS]; - - // - // Current direction of stepper motors (+1 or -1) - // - static int8_t count_direction[NUM_AXIS]; - - public: - - // - // Constructor / initializer - // - Stepper() { }; - - // Initialize stepper hardware - static void init(); - - // Interrupt Service Routines - - // The ISR scheduler - static void isr(); - - // The stepper pulse phase ISR - static void stepper_pulse_phase_isr(); - - // The stepper block processing phase ISR - static uint32_t stepper_block_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // The Linear advance stepper ISR - static uint32_t advance_isr(); - #endif - - // Check if the given block is busy or not - Must not be called from ISR contexts - static bool is_block_busy(const block_t* const block); - - // Get the position of a stepper, in steps - static int32_t position(const AxisEnum axis); - - // Report the positions of the steppers, in steps - static void report_positions(); - - // The stepper subsystem goes to sleep when it runs out of things to execute. Call this - // to notify the subsystem that it is time to go to work. - static void wake_up(); - - // Quickly stop all steppers - FORCE_INLINE static void quick_stop() { abort_current_block = true; } - - // The direction of a single motor - FORCE_INLINE static bool motor_direction(const AxisEnum axis) { return TEST(last_direction_bits, axis); } - - // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same. - FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } - - // The extruder associated to the last movement - FORCE_INLINE static uint8_t movement_extruder() { - return - #if ENABLED(MIXING_EXTRUDER) - 0 - #else - last_moved_extruder - #endif - ; - } - - // Handle a triggered endstop - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in steps - static int32_t triggered_position(const AxisEnum axis); - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digitalPotWrite(const int16_t address, const int16_t value); - static void digipot_current(const uint8_t driver, const int16_t current); - #endif - - #if HAS_MICROSTEPS - static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2); - static void microstep_mode(const uint8_t driver, const uint8_t stepping); - static void microstep_readings(); - #endif - - #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_homing_dual_axis(const bool state) { homing_dual_axis = state; } - #endif - #if ENABLED(X_DUAL_ENDSTOPS) - FORCE_INLINE static void set_x_lock(const bool state) { locked_X_motor = state; } - FORCE_INLINE static void set_x2_lock(const bool state) { locked_X2_motor = state; } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - FORCE_INLINE static void set_y_lock(const bool state) { locked_Y_motor = state; } - FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; } - FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } - #endif - - #if ENABLED(BABYSTEPPING) - static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention - #endif - - #if HAS_MOTOR_CURRENT_PWM - static void refresh_motor_power(); - #endif - - // Set the current position in steps - inline static void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - planner.synchronize(); - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - _set_position(a, b, c, e); - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - inline static void set_position(const AxisEnum a, const int32_t &v) { - planner.synchronize(); - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - count_position[a] = v; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - - private: - - // Set the current position in steps - static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e); - - // Set direction bits for all steppers - static void set_directions(); - - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { - uint32_t timer; - - // Scale the frequency, as requested by the caller - step_rate <<= scale; - - uint8_t multistep = 1; - #if DISABLED(DISABLE_MULTI_STEPPING) - - // The stepping frequency limits for each multistepping rate - static const uint32_t limit[] PROGMEM = { - ( MAX_STEP_ISR_FREQUENCY_1X ), - ( MAX_STEP_ISR_FREQUENCY_2X >> 1), - ( MAX_STEP_ISR_FREQUENCY_4X >> 2), - ( MAX_STEP_ISR_FREQUENCY_8X >> 3), - ( MAX_STEP_ISR_FREQUENCY_16X >> 4), - ( MAX_STEP_ISR_FREQUENCY_32X >> 5), - ( MAX_STEP_ISR_FREQUENCY_64X >> 6), - (MAX_STEP_ISR_FREQUENCY_128X >> 7) - }; - - // Select the proper multistepping - uint8_t idx = 0; - while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) { - step_rate >>= 1; - multistep <<= 1; - ++idx; - }; - #else - NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X)); - #endif - *loops = multistep; - - constexpr uint32_t min_step_rate = F_CPU / 500000U; - NOLESS(step_rate, min_step_rate); - step_rate -= min_step_rate; // Correct for minimal speed - if (step_rate >= (8 * 256)) { // higher step rate - const uint8_t tmp_step_rate = (step_rate & 0x00FF); - const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0], - gain = (uint16_t)pgm_read_word_near(table_address + 2); - timer = MultiU16X8toH16(tmp_step_rate, gain); - timer = (uint16_t)pgm_read_word_near(table_address) - timer; - } - else { // lower step rates - uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0]; - table_address += ((step_rate) >> 1) & 0xFFFC; - timer = (uint16_t)pgm_read_word_near(table_address) - - (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3); - } - // (there is no need to limit the timer value here. All limits have been - // applied above, and AVR is able to keep up at 30khz Stepping ISR rate) - - return timer; - } - - #if ENABLED(S_CURVE_ACCELERATION) - static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); - static int32_t _eval_bezier_curve(const uint32_t curr_step); - #endif - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digipot_init(); - #endif - - #if HAS_MICROSTEPS - static void microstep_init(); - #endif - -}; - -extern Stepper stepper; - -#endif // STEPPER_H diff --git a/Marlin_thinkerV2/Marlin/stepper_dac.cpp b/Marlin_thinkerV2/Marlin/stepper_dac.cpp deleted file mode 100644 index d5f713fedb..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper_dac.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - stepper_dac.cpp - To set stepper current via DAC - - Part of Marlin - - Copyright (c) 2016 MarlinFirmware - - Marlin 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. - - Marlin 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 Marlin. If not, see . -*/ - -#include "Marlin.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - - #include "stepper_dac.h" - - bool dac_present = false; - const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER; - uint8_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT; - - int dac_init() { - #if PIN_EXISTS(DAC_DISABLE) - OUT_WRITE(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC - #endif - - mcp4728_init(); - - if (mcp4728_simpleCommand(RESET)) return -1; - - dac_present = true; - - mcp4728_setVref_all(DAC_STEPPER_VREF); - mcp4728_setGain_all(DAC_STEPPER_GAIN); - - if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) { - mcp4728_setDrvPct(dac_channel_pct); - mcp4728_eepromWrite(); - } - - return 0; - } - - void dac_current_percent(uint8_t channel, float val) { - if (!dac_present) return; - - NOMORE(val, 100); - - mcp4728_analogWrite(dac_order[channel], val * 0.01 * (DAC_STEPPER_MAX)); - mcp4728_simpleCommand(UPDATE); - } - - void dac_current_raw(uint8_t channel, uint16_t val) { - if (!dac_present) return; - - NOMORE(val, DAC_STEPPER_MAX); - - mcp4728_analogWrite(dac_order[channel], val); - mcp4728_simpleCommand(UPDATE); - } - - static float dac_perc(int8_t n) { return 100.0f * 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)); } - - uint8_t dac_current_get_percent(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } - void dac_current_set_percents(const uint8_t pct[XYZE]) { - LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; - mcp4728_setDrvPct(dac_channel_pct); - } - - void dac_print_values() { - if (!dac_present) return; - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Stepper current values in % (Amps):"); - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" X:", dac_perc(X_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(X_AXIS)); - SERIAL_ECHOPAIR(") Y:", dac_perc(Y_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(Y_AXIS)); - SERIAL_ECHOPAIR(") Z:", dac_perc(Z_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(Z_AXIS)); - SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS)); - SERIAL_ECHOPAIR(" (", dac_amps(E_AXIS)); - SERIAL_ECHOLNPGM(")"); - } - - void dac_commit_eeprom() { - if (!dac_present) return; - mcp4728_eepromWrite(); - } - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin_thinkerV2/Marlin/stepper_dac.h b/Marlin_thinkerV2/Marlin/stepper_dac.h deleted file mode 100644 index cf56050e72..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper_dac.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - stepper_dac.h - To set stepper current via DAC - - Part of Marlin - - Copyright (c) 2016 MarlinFirmware - - Marlin 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. - - Marlin 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 Marlin. If not, see . -*/ - -#ifndef STEPPER_DAC_H -#define STEPPER_DAC_H - -#include "dac_mcp4728.h" - -int dac_init(); -void dac_current_percent(uint8_t channel, float val); -void dac_current_raw(uint8_t channel, uint16_t val); -void dac_print_values(); -void dac_commit_eeprom(); -uint8_t dac_current_get_percent(const AxisEnum axis); -void dac_current_set_percents(const uint8_t pct[XYZE]); - -#endif // STEPPER_DAC_H diff --git a/Marlin_thinkerV2/Marlin/stepper_indirection.cpp b/Marlin_thinkerV2/Marlin/stepper_indirection.cpp deleted file mode 100644 index 6c3ec5b2da..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper_indirection.cpp +++ /dev/null @@ -1,672 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper_indirection.cpp - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Part of Marlin - * - * Copyright (c) 2015 Dominik Wenger - */ - -#include "stepper_indirection.h" - -#include "MarlinConfig.h" - -// -// TMC26X Driver objects and inits -// -#if HAS_DRIVER(TMC26X) - #include - #include - - #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(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 - - #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(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 - } -#endif // TMC26X - -// -// TMC2130 Driver objects and inits -// -#if HAS_DRIVER(TMC2130) - - #include - #include - #include "planner.h" - #include "enum.h" - - #if TMC2130STEPPER_VERSION < 0x020201 - #error "Update TMC2130Stepper library to 2.2.1 or newer." - #endif - - #if ENABLED(TMC_USE_SW_SPI) - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) - #else - #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN) - #endif - - // Stepper objects of TMC2130 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2130) - _TMC2130_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - _TMC2130_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - _TMC2130_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - _TMC2130_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - _TMC2130_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - _TMC2130_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - _TMC2130_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - _TMC2130_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - _TMC2130_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - _TMC2130_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - _TMC2130_DEFINE(E4); - #endif - - // Use internal reference voltage for current calculations. This is the default. - // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) - // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/ - void tmc2130_init(TMC2130Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { - #if DISABLED(STEALTHCHOP) || DISABLED(HYBRID_THRESHOLD) - UNUSED(thrs); - UNUSED(spmm); - #endif - st.begin(); - st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.blank_time(24); - st.off_time(5); // Only enables the driver if used with stealthChop - st.interpolate(INTERPOLATE); - st.power_down_delay(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); - #if ENABLED(STEALTHCHOP) - st.stealth_freq(1); // f_pwm = 2/683 f_clk - st.stealth_autoscale(1); - st.stealth_gradient(5); - st.stealth_amplitude(255); - st.stealthChop(1); - #if ENABLED(HYBRID_THRESHOLD) - st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm)); - #endif - #endif - st.GSTAT(); // Clear GSTAT - } - - #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - - void tmc2130_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2130) - _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - - #if ENABLED(SENSORLESS_HOMING) - #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); - #if X_SENSORLESS - #if AXIS_DRIVER_TYPE(X, TMC2130) - stepperX.sgt(X_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - stepperX2.sgt(X_HOMING_SENSITIVITY); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_DRIVER_TYPE(Y, TMC2130) - stepperY.sgt(Y_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - stepperY2.sgt(Y_HOMING_SENSITIVITY); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_DRIVER_TYPE(Z, TMC2130) - stepperZ.sgt(Z_HOMING_SENSITIVITY); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - stepperZ2.sgt(Z_HOMING_SENSITIVITY); - #endif - #endif - #endif - } -#endif // TMC2130 - -// -// TMC2208 Driver objects and inits -// -#if HAS_DRIVER(TMC2208) - - #undef HardwareSerial_h // undo Marlin trickery - #include - #include - #include - #include "planner.h" - - #if TMC2208STEPPER_VERSION < 0x000101 - #error "Update TMC2208Stepper library to 0.1.1 or newer." - #endif - - #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL) - #define _TMC2208_DEFINE_SOFTWARE(ST) TMC2208Stepper stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_SERIAL_RX_PIN > -1) - - // Stepper objects of TMC2208 steppers used - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(X); - #else - _TMC2208_DEFINE_SOFTWARE(X); - #endif - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(X2); - #else - _TMC2208_DEFINE_SOFTWARE(X2); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Y); - #else - _TMC2208_DEFINE_SOFTWARE(Y); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Y2); - #else - _TMC2208_DEFINE_SOFTWARE(Y2); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Z); - #else - _TMC2208_DEFINE_SOFTWARE(Z); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(Z2); - #else - _TMC2208_DEFINE_SOFTWARE(Z2); - #endif - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E0); - #else - _TMC2208_DEFINE_SOFTWARE(E0); - #endif - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E1); - #else - _TMC2208_DEFINE_SOFTWARE(E1); - #endif - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E2); - #else - _TMC2208_DEFINE_SOFTWARE(E2); - #endif - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E3); - #else - _TMC2208_DEFINE_SOFTWARE(E3); - #endif - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL - _TMC2208_DEFINE_HARDWARE(E4); - #else - _TMC2208_DEFINE_SOFTWARE(E4); - #endif - #endif - - void tmc2208_serial_begin() { - #if AXIS_DRIVER_TYPE(X, TMC2208) - #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(115200); - #else - stepperX.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(115200); - #else - stepperX2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(115200); - #else - stepperY.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(115200); - #else - stepperY2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(115200); - #else - stepperZ.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(115200); - #else - stepperZ2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(115200); - #else - stepperE0.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(115200); - #else - stepperE1.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(115200); - #else - stepperE2.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(115200); - #else - stepperE3.beginSerial(115200); - #endif - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(115200); - #else - stepperE4.beginSerial(115200); - #endif - #endif - } - - // Use internal reference voltage for current calculations. This is the default. - // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) - void tmc2208_init(TMC2208Stepper &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) { - st.pdn_disable(true); // Use UART - st.mstep_reg_select(true); // Select microsteps with UART - st.I_scale_analog(false); - st.rms_current(mA, HOLD_MULTIPLIER, R_SENSE); - st.microsteps(microsteps); - st.blank_time(24); - st.toff(5); - st.intpol(INTERPOLATE); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - st.hysteresis_start(3); - st.hysteresis_end(2); - #if ENABLED(STEALTHCHOP) - st.pwm_lim(12); - st.pwm_reg(8); - st.pwm_autograd(1); - st.pwm_autoscale(1); - st.pwm_freq(1); - st.pwm_grad(14); - st.pwm_ofs(36); - st.en_spreadCycle(false); - #if ENABLED(HYBRID_THRESHOLD) - st.TPWMTHRS(12650000UL*microsteps/(256*thrs*spmm)); - #else - UNUSED(thrs); - UNUSED(spmm); - #endif - #else - st.en_spreadCycle(true); - #endif - st.GSTAT(0b111); // Clear - delay(200); - } - - #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) - - void tmc2208_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, TMC2208) - _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2208) - _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2208) - _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2208) - _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2208) - _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2208) - _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2208) - _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2208) - { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2208) - { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2208) - { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2208) - { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); } - #endif - } -#endif // TMC2208 - -void restore_stepper_drivers() { - #if AXIS_IS_TMC(X) - stepperX.push(); - #endif - #if AXIS_IS_TMC(X2) - stepperX2.push(); - #endif - #if AXIS_IS_TMC(Y) - stepperY.push(); - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.push(); - #endif - #if AXIS_IS_TMC(Z) - stepperZ.push(); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.push(); - #endif - #if AXIS_IS_TMC(E0) - stepperE0.push(); - #endif - #if AXIS_IS_TMC(E1) - stepperE1.push(); - #endif - #if AXIS_IS_TMC(E2) - stepperE2.push(); - #endif - #if AXIS_IS_TMC(E3) - stepperE3.push(); - #endif - #if AXIS_IS_TMC(E4) - stepperE4.push(); - #endif -} - -void reset_stepper_drivers() { - #if HAS_DRIVER(TMC26X) - tmc26x_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2130) - delay(100); - tmc2130_init_to_defaults(); - #endif - #if HAS_DRIVER(TMC2208) - delay(100); - tmc2208_init_to_defaults(); - #endif - #ifdef TMC_ADV - TMC_ADV() - #endif - #if HAS_DRIVER(L6470) - L6470_init_to_defaults(); - #endif -} - -// -// L6470 Driver objects and inits -// -#if HAS_DRIVER(L6470) - - #include - #include - - #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_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(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 - - #define _L6470_INIT(A) do{ \ - stepper##A.init(); \ - stepper##A.softFree(); \ - stepper##A.setMicroSteps(A##_MICROSTEPS); \ - stepper##A.setOverCurrent(A##_OVERCURRENT); \ - stepper##A.setStallCurrent(A##_STALLCURRENT); \ - }while(0) - - void L6470_init_to_defaults() { - #if AXIS_DRIVER_TYPE(X, L6470) - _L6470_INIT(X); - #endif - #if AXIS_DRIVER_TYPE(X2, L6470) - _L6470_INIT(X2); - #endif - #if AXIS_DRIVER_TYPE(Y, L6470) - _L6470_INIT(Y); - #endif - #if AXIS_DRIVER_TYPE(Y2, L6470) - _L6470_INIT(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z, L6470) - _L6470_INIT(Z); - #endif - #if AXIS_DRIVER_TYPE(Z2, L6470) - _L6470_INIT(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, L6470) - _L6470_INIT(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, L6470) - _L6470_INIT(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, L6470) - _L6470_INIT(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, L6470) - _L6470_INIT(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, L6470) - _L6470_INIT(E4); - #endif - } - -#endif // L6470 diff --git a/Marlin_thinkerV2/Marlin/stepper_indirection.h b/Marlin_thinkerV2/Marlin/stepper_indirection.h deleted file mode 100644 index 54a17c51e1..0000000000 --- a/Marlin_thinkerV2/Marlin/stepper_indirection.h +++ /dev/null @@ -1,499 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper_indirection.h - stepper motor driver indirection macros - * to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation - * Part of Marlin - * - * Copyright (c) 2015 Dominik Wenger - * - * Marlin 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. - * - * Marlin 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 Marlin. If not, see . - */ - -#ifndef STEPPER_INDIRECTION_H -#define STEPPER_INDIRECTION_H - -#include "MarlinConfig.h" - -// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if HAS_DRIVER(TMC26X) - #include - #include - void tmc26x_init_to_defaults(); -#endif - -#if HAS_DRIVER(TMC2130) - #include - void tmc2130_init_to_defaults(); -#endif - -#if HAS_DRIVER(TMC2208) - #include - void tmc2208_serial_begin(); - void tmc2208_init_to_defaults(); -#endif - -// L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) - #include - #include - void L6470_init_to_defaults(); -#endif - -void restore_stepper_drivers(); // Called by PSU_ON -void reset_stepper_drivers(); // Called by settings.load / settings.reset - -// X Stepper -#if AXIS_DRIVER_TYPE(X, L6470) - extern L6470 stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) do{ if (STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree(); }while(0) - #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) - #define X_DIR_INIT NOOP - #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) - #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(X, TMC2130) - extern TMC2130Stepper stepperX; - #elif AXIS_DRIVER_TYPE(X, TMC2208) - extern TMC2208Stepper stepperX; - #endif - #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) -#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) -#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) do{ if (STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree(); }while(0) - #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) - #define Y_DIR_INIT NOOP - #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) - #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(Y, TMC2130) - extern TMC2130Stepper stepperY; - #elif AXIS_DRIVER_TYPE(Y, TMC2208) - extern TMC2208Stepper stepperY; - #endif - #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) -#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) -#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) do{ if (STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree(); }while(0) - #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) - #define Z_DIR_INIT NOOP - #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) - #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(Z, TMC2130) - extern TMC2130Stepper stepperZ; - #elif AXIS_DRIVER_TYPE(Z, TMC2208) - extern TMC2208Stepper stepperZ; - #endif - #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) -#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) -#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) do{ if (STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree(); }while(0) - #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) - #define X2_DIR_INIT NOOP - #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) - #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(X2, TMC2130) - extern TMC2130Stepper stepperX2; - #elif AXIS_DRIVER_TYPE(X2, TMC2208) - extern TMC2208Stepper stepperX2; - #endif - #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) - #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) - #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) do{ if (STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree(); }while(0) - #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) - #define Y2_DIR_INIT NOOP - #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) - #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - extern TMC2130Stepper stepperY2; - #elif AXIS_DRIVER_TYPE(Y2, TMC2208) - extern TMC2208Stepper stepperY2; - #endif - #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) - #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) - #define Y2_STEP_READ READ(Y2_STEP_PIN) -#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) do{ if (STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree(); }while(0) - #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) - #define Z2_DIR_INIT NOOP - #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) - #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) - #else - #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() - #else - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - extern TMC2130Stepper stepperZ2; - #elif AXIS_DRIVER_TYPE(Z2, TMC2208) - extern TMC2208Stepper stepperZ2; - #endif - #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) - #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) - #define Z2_STEP_READ READ(Z2_STEP_PIN) -#endif - -// E0 Stepper -#if AXIS_DRIVER_TYPE(E0, L6470) - extern L6470 stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) do{ if (STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree(); }while(0) - #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) - #define E0_DIR_INIT NOOP - #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) - #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E0, TMC2130) - extern TMC2130Stepper stepperE0; - #elif AXIS_DRIVER_TYPE(E0, TMC2208) - extern TMC2208Stepper stepperE0; - #endif - #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) -#define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree(); }while(0) - #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) - #define E1_DIR_INIT NOOP - #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) - #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E1, TMC2130) - extern TMC2130Stepper stepperE1; - #elif AXIS_DRIVER_TYPE(E1, TMC2208) - extern TMC2208Stepper stepperE1; - #endif - #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) -#define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree(); }while(0) - #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) - #define E2_DIR_INIT NOOP - #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) - #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E2, TMC2130) - extern TMC2130Stepper stepperE2; - #elif AXIS_DRIVER_TYPE(E2, TMC2208) - extern TMC2208Stepper stepperE2; - #endif - #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) -#define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree(); }while(0) - #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) - #define E3_DIR_INIT NOOP - #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) - #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E3, TMC2130) - extern TMC2130Stepper stepperE3; - #elif AXIS_DRIVER_TYPE(E3, TMC2208) - extern TMC2208Stepper stepperE3; - #endif - #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) -#define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) -#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) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0) - #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) - #define E4_DIR_INIT NOOP - #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE) - #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) -#else - #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() - #else - #if AXIS_DRIVER_TYPE(E4, TMC2130) - extern TMC2130Stepper stepperE4; - #elif AXIS_DRIVER_TYPE(E4, TMC2208) - extern TMC2208Stepper stepperE4; - #endif - #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) -#define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) -#define E4_STEP_READ READ(E4_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 > 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(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 > 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) -#elif E_STEPPERS > 1 - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { E0_STEP_WRITE(V); E1_STEP_WRITE(V); } else if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else 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 (extruder_duplication_enabled) { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); } else if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_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 -#else - #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) -#endif - -#endif // STEPPER_INDIRECTION_H diff --git a/Marlin_thinkerV2/Marlin/stopwatch.cpp b/Marlin_thinkerV2/Marlin/stopwatch.cpp deleted file mode 100644 index e5bc015904..0000000000 --- a/Marlin_thinkerV2/Marlin/stopwatch.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "stopwatch.h" - -#include "Marlin.h" - -Stopwatch::State Stopwatch::state; -millis_t Stopwatch::accumulator; -millis_t Stopwatch::startTimestamp; -millis_t Stopwatch::stopTimestamp; - -bool Stopwatch::stop() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("stop")); - #endif - - if (isRunning() || isPaused()) { - state = STOPPED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::pause() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("pause")); - #endif - - if (isRunning()) { - state = PAUSED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::start() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("start")); - #endif - - if (!isRunning()) { - if (isPaused()) accumulator = duration(); - else reset(); - - state = RUNNING; - startTimestamp = millis(); - return true; - } - else return false; -} - -void Stopwatch::resume(const millis_t duration) { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("resume")); - #endif - - reset(); - if ((accumulator = duration)) state = RUNNING; -} - -void Stopwatch::reset() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("reset")); - #endif - - state = STOPPED; - startTimestamp = 0; - stopTimestamp = 0; - accumulator = 0; -} - -millis_t Stopwatch::duration() { - return ((isRunning() ? millis() : stopTimestamp) - - startTimestamp) / 1000UL + accumulator; -} - -#if ENABLED(DEBUG_STOPWATCH) - - void Stopwatch::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("Stopwatch::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } - -#endif diff --git a/Marlin_thinkerV2/Marlin/stopwatch.h b/Marlin_thinkerV2/Marlin/stopwatch.h deleted file mode 100644 index f5e04bbde8..0000000000 --- a/Marlin_thinkerV2/Marlin/stopwatch.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef STOPWATCH_H -#define STOPWATCH_H - -// Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) -//#define DEBUG_STOPWATCH - -#include "macros.h" -#include "types.h" - -/** - * @brief Stopwatch class - * @details This class acts as a timer proving stopwatch functionality including - * the ability to pause the running time counter. - */ -class Stopwatch { - private: - enum State : char { - STOPPED, - RUNNING, - PAUSED - }; - - static Stopwatch::State state; - static millis_t accumulator; - static millis_t startTimestamp; - static millis_t stopTimestamp; - - public: - /** - * @brief Initialize the stopwatch - */ - FORCE_INLINE static void init() { reset(); } - - /** - * @brief Stop the stopwatch - * @details Stop the running timer. Silently ignore the request if - * no timer is running. - * @return true on success - */ - static bool stop(); - - /** - * @brief Pause the stopwatch - * @details Pause the running timer, it will silently ignore the request if - * no timer is running. - * @return true on success - */ - static bool pause(); - - /** - * @brief Start the stopwatch - * @details Start the timer, it will silently ignore the request if the - * timer is already running. - * @return true on success - */ - static bool start(); - - /** - * @brief Resume the stopwatch - * @details Resume a timer from a given duration - */ - static void resume(const millis_t duration); - - /** - * @brief Reset the stopwatch - * @details Reset all settings to their default values. - */ - static void reset(); - - /** - * @brief Check if the timer is running - * @details Return true if the timer is currently running, false otherwise. - * @return true if stopwatch is running - */ - FORCE_INLINE static bool isRunning() { return state == RUNNING; } - - /** - * @brief Check if the timer is paused - * @details Return true if the timer is currently paused, false otherwise. - * @return true if stopwatch is paused - */ - FORCE_INLINE static bool isPaused() { return state == PAUSED; } - - /** - * @brief Get the running time - * @details Return the total number of seconds the timer has been running. - * @return the delta since starting the stopwatch - */ - static millis_t duration(); - - #ifdef DEBUG_STOPWATCH - - /** - * @brief Print a debug message - * @details Print a simple debug message "Stopwatch::function" - */ - static void debug(const char func[]); - - #endif -}; - -#endif // STOPWATCH_H diff --git a/Marlin_thinkerV2/Marlin/temperature.cpp b/Marlin_thinkerV2/Marlin/temperature.cpp deleted file mode 100644 index aff73bc031..0000000000 --- a/Marlin_thinkerV2/Marlin/temperature.cpp +++ /dev/null @@ -1,2469 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * temperature.cpp - temperature control - */ - -#include "Marlin.h" -#include "temperature.h" -#include "thermistortables.h" -#include "ultralcd.h" -#include "planner.h" -#include "language.h" -#include "printcounter.h" -#include "delay.h" -#include "endstops.h" -#if POWER_LOSS_RECOVER_SUPER_CAP - #include "configuration_store.h" - #include "Buzzer.h" - #include "printcounter.h" - #include "power_loss_recovery.h" - extern Buzzer buzzer; - extern MarlinSettings settings; -#endif - -#if ENABLED(HEATER_0_USES_MAX6675) - #include "MarlinSPI.h" -#endif - -#if ENABLED(BABYSTEPPING) - #include "stepper.h" -#endif - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -#if ENABLED(EMERGENCY_PARSER) - #include "emergency_parser.h" -#endif - -#if HOTEND_USES_THERMISTOR - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; - static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; - #else - static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE); - static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN); - #endif -#endif - -Temperature thermalManager; - -/** - * Macros to include the heater id in temp errors. The compiler's dead-code - * elimination should (hopefully) optimize out the unused strings. - */ -#if HAS_HEATED_BED - #define TEMP_ERR_PSTR(MSG, E) \ - (E) == -1 ? PSTR(MSG ## _BED) : \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#else - #define TEMP_ERR_PSTR(MSG, E) \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) -#endif - -// public: - -float Temperature::current_temperature[HOTENDS] = { 0.0 }; -int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 }, - Temperature::target_temperature[HOTENDS] = { 0 }; - -#if ENABLED(AUTO_POWER_E_FANS) - int16_t Temperature::autofan_speed[HOTENDS] = { 0 }; -#endif - -#if HAS_HEATED_BED - float Temperature::current_temperature_bed = 0.0; - int16_t Temperature::current_temperature_bed_raw = 0, - Temperature::target_temperature_bed = 0; - uint8_t Temperature::soft_pwm_amount_bed; - #ifdef BED_MINTEMP - int16_t Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; - #endif - #ifdef BED_MAXTEMP - int16_t Temperature::bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; - #endif - #if WATCH_THE_BED - uint16_t Temperature::watch_target_bed_temp = 0; - millis_t Temperature::watch_bed_next_ms = 0; - #endif - #if ENABLED(PIDTEMPBED) - float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd, // Initialized by settings.load() - Temperature::temp_iState_bed = { 0 }, - Temperature::temp_dState_bed = { 0 }, - Temperature::pTerm_bed, - Temperature::iTerm_bed, - Temperature::dTerm_bed, - Temperature::pid_error_bed; - #else - millis_t Temperature::next_bed_check_ms; - #endif - uint16_t Temperature::raw_temp_bed_value = 0; - #if HEATER_IDLE_HANDLER - millis_t Temperature::bed_idle_timeout_ms = 0; - bool Temperature::bed_idle_timeout_exceeded = false; - #endif -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - float Temperature::current_temperature_chamber = 0.0; - int16_t Temperature::current_temperature_chamber_raw = 0; - uint16_t Temperature::raw_temp_chamber_value = 0; -#endif - -// Initialized by settings.load() -#if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - float Temperature::Kp[HOTENDS], Temperature::Ki[HOTENDS], Temperature::Kd[HOTENDS]; - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::Kc[HOTENDS]; - #endif - #else - float Temperature::Kp, Temperature::Ki, Temperature::Kd; - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::Kc; - #endif - #endif -#endif - -#if ENABLED(BABYSTEPPING) - volatile int Temperature::babystepsTodo[XYZ] = { 0 }; -#endif - -#if WATCH_HOTENDS - uint16_t Temperature::watch_target_temp[HOTENDS] = { 0 }; - millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 }; -#endif - -#if ENABLED(PREVENT_COLD_EXTRUSION) - bool Temperature::allow_cold_extrude = false; - int16_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - uint16_t Temperature::redundant_temperature_raw = 0; - float Temperature::redundant_temperature = 0.0; -#endif - -volatile bool Temperature::temp_meas_ready = false; - -#if ENABLED(PIDTEMP) - float Temperature::temp_iState[HOTENDS] = { 0 }, - Temperature::temp_dState[HOTENDS] = { 0 }, - Temperature::pTerm[HOTENDS], - Temperature::iTerm[HOTENDS], - Temperature::dTerm[HOTENDS]; - - #if ENABLED(PID_EXTRUSION_SCALING) - float Temperature::cTerm[HOTENDS]; - long Temperature::last_e_position; - long Temperature::lpq[LPQ_MAX_LEN]; - int Temperature::lpq_ptr = 0; - #endif - - float Temperature::pid_error[HOTENDS]; - bool Temperature::pid_reset[HOTENDS]; -#endif - -uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 }; - -// Init min and max temp with extreme values to prevent false errors during startup -int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP, HEATER_4_RAW_LO_TEMP), - Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP, HEATER_4_RAW_HI_TEMP), - Temperature::minttemp[HOTENDS] = { 0 }, - Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); - -#ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; -#endif - -#ifdef MILLISECONDS_PREHEAT_TIME - 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 - -uint8_t Temperature::soft_pwm_amount[HOTENDS]; - -#if ENABLED(FAN_SOFT_PWM) - uint8_t Temperature::soft_pwm_amount_fan[FAN_COUNT], - 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 - -#if HEATER_IDLE_HANDLER - millis_t Temperature::heater_idle_timeout_ms[HOTENDS] = { 0 }; - bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false }; -#endif - -#if ENABLED(ADC_KEYPAD) - uint32_t Temperature::current_ADCKey_raw = 0; - uint8_t Temperature::ADCKey_count = 0; -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - int16_t Temperature::lpq_len; // Initialized in configuration_store -#endif - -#if HAS_PID_HEATING - - /** - * PID Autotuning (M303) - * - * Alternately heat and cool the nozzle, observing its behavior to - * determine the best PID values to achieve a stable temperature. - */ - void Temperature::PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { - float current = 0.0; - int cycles = 0; - bool heating = true; - - millis_t next_temp_ms = millis(), t1 = next_temp_ms, t2 = next_temp_ms; - long t_high = 0, t_low = 0; - - long bias, d; - float Ku, Tu, - workKp = 0, workKi = 0, workKd = 0, - max = 0, min = 10000; - - #if HAS_PID_FOR_BOTH - #define GHV(B,H) (hotend < 0 ? (B) : (H)) - #define SHV(S,B,H) if (hotend < 0) S##_bed = B; else S [hotend] = H; - #elif ENABLED(PIDTEMPBED) - #define GHV(B,H) B - #define SHV(S,B,H) (S##_bed = B) - #else - #define GHV(B,H) H - #define SHV(S,B,H) (S [hotend] = H) - #endif - - #if WATCH_THE_BED || WATCH_HOTENDS - #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) - #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) - #define GTV(B,H) (hotend < 0 ? (B) : (H)) - #elif HAS_TP_BED - #define GTV(B,H) (B) - #else - #define GTV(B,H) (H) - #endif - const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); - const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); - millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL; - float next_watch_temp = 0.0; - bool heated = false; - #endif - - #if HAS_AUTO_FAN - next_auto_fan_check_ms = next_temp_ms + 2500UL; - #endif - - #if ENABLED(PIDTEMP) - #define _TOP_HOTEND HOTENDS - 1 - #else - #define _TOP_HOTEND -1 - #endif - #if ENABLED(PIDTEMPBED) - #define _BOT_HOTEND -1 - #else - #define _BOT_HOTEND 0 - #endif - - if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); - return; - } - - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); - - disable_all_heaters(); // switch off all heaters. - - SHV(soft_pwm_amount, bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); - - wait_for_heatup = true; // Can be interrupted with M108 - - // PID Tuning loop - while (wait_for_heatup) { - - const millis_t ms = millis(); - - if (temp_meas_ready) { // temp sample ready - updateTemperaturesFromRawValues(); - - // Get the current temperature and constrain it - current = GHV(current_temperature_bed, current_temperature[hotend]); - NOLESS(max, current); - NOMORE(min, current); - - #if HAS_AUTO_FAN - if (ELAPSED(ms, next_auto_fan_check_ms)) { - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - if (heating && current > target) { - if (ELAPSED(ms, t2 + 5000UL)) { - heating = false; - SHV(soft_pwm_amount, (bias - d) >> 1, (bias - d) >> 1); - t1 = ms; - t_high = t1 - t2; - max = target; - } - } - - if (!heating && current < target) { - if (ELAPSED(ms, t1 + 5000UL)) { - heating = true; - t2 = ms; - t_low = t2 - t1; - if (cycles > 0) { - const long max_pow = GHV(MAX_BED_POWER, PID_MAX); - bias += (d * (t_high - t_low)) / (t_low + t_high); - bias = constrain(bias, 20, max_pow - 20); - d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - - SERIAL_PROTOCOLPAIR(MSG_BIAS, bias); - SERIAL_PROTOCOLPAIR(MSG_D, d); - SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); - SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); - if (cycles > 2) { - Ku = (4.0f * d) / (M_PI * (max - min) * 0.5f); - Tu = ((float)(t_low + t_high) * 0.001f); - SERIAL_PROTOCOLPAIR(MSG_KU, Ku); - SERIAL_PROTOCOLPAIR(MSG_TU, Tu); - workKp = 0.6f * Ku; - workKi = 2 * workKp / Tu; - workKd = workKp * Tu * 0.125f; - SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_PROTOCOLPAIR(MSG_KP, workKp); - SERIAL_PROTOCOLPAIR(MSG_KI, workKi); - SERIAL_PROTOCOLLNPAIR(MSG_KD, workKd); - /** - workKp = 0.33*Ku; - workKi = workKp/Tu; - workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" Some overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", workKp); - SERIAL_PROTOCOLPAIR(" Ki: ", workKi); - SERIAL_PROTOCOLPAIR(" Kd: ", workKd); - workKp = 0.2*Ku; - workKi = 2*workKp/Tu; - workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" No overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", workKp); - SERIAL_PROTOCOLPAIR(" Ki: ", workKi); - SERIAL_PROTOCOLPAIR(" Kd: ", workKd); - */ - } - } - SHV(soft_pwm_amount, (bias + d) >> 1, (bias + d) >> 1); - cycles++; - min = target; - } - } - } - - // Did the temperature overshoot very far? - #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 20 - #endif - if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH); - break; - } - - // Report heater states every 2 seconds - if (ELAPSED(ms, next_temp_ms)) { - #if HAS_TEMP_SENSOR - print_heaterstates(); - SERIAL_EOL(); - #endif - next_temp_ms = ms + 2000UL; - - // Make sure heating is actually working - #if WATCH_THE_BED || WATCH_HOTENDS - if ( - #if WATCH_THE_BED && WATCH_HOTENDS - true - #elif WATCH_HOTENDS - hotend >= 0 - #else - hotend < 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 - 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 - } - else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(hotend, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, hotend)); - } - else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(hotend, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, hotend)); - } - #endif - } // every 2 seconds - - // Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle - #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE - #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L - #endif - if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT); - break; - } - - if (cycles > ncycles) { - SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); - - #if HAS_PID_FOR_BOTH - const char* estring = GHV("bed", ""); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); SERIAL_EOL(); - #elif ENABLED(PIDTEMP) - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd); SERIAL_EOL(); - #else - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi); SERIAL_EOL(); - SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd); SERIAL_EOL(); - #endif - - #define _SET_BED_PID() do { \ - bedKp = workKp; \ - bedKi = scalePID_i(workKi); \ - bedKd = scalePID_d(workKd); \ - }while(0) - - #define _SET_EXTRUDER_PID() do { \ - PID_PARAM(Kp, hotend) = workKp; \ - PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ - PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ - updatePID(); }while(0) - - // Use the result? (As with "M303 U1") - if (set_result) { - #if HAS_PID_FOR_BOTH - if (hotend < 0) - _SET_BED_PID(); - else - _SET_EXTRUDER_PID(); - #elif ENABLED(PIDTEMP) - _SET_EXTRUDER_PID(); - #else - _SET_BED_PID(); - #endif - } - return; - } - lcd_update(); - } - disable_all_heaters(); - } - -#endif // HAS_PID_HEATING - -/** - * Class and Instance Methods - */ - -Temperature::Temperature() { } - -int Temperature::getHeaterPower(const int heater) { - return ( - #if HAS_HEATED_BED - heater < 0 ? soft_pwm_amount_bed : - #endif - soft_pwm_amount[heater] - ); -} - -#if HAS_AUTO_FAN - - void Temperature::checkExtruderAutoFans() { - static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN }; - static const uint8_t fanBit[] PROGMEM = { - 0, - AUTO_1_IS_0 ? 0 : 1, - AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 : 2, - AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3, - AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4, - AUTO_CHAMBER_IS_0 ? 0 : AUTO_CHAMBER_IS_1 ? 1 : AUTO_CHAMBER_IS_2 ? 2 : AUTO_CHAMBER_IS_3 ? 3 : AUTO_CHAMBER_IS_4 ? 4 : 5 - }; - uint8_t fanState = 0; - - HOTEND_LOOP() - if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[e])); - - #if HAS_TEMP_CHAMBER - if (current_temperature_chamber > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[5])); - #endif - - uint8_t fanDone = 0; - for (uint8_t f = 0; f < COUNT(fanPin); f++) { - const pin_t pin = - #ifdef ARDUINO - pgm_read_byte(&fanPin[f]) - #else - fanPin[f] - #endif - ; - const uint8_t bit = pgm_read_byte(&fanBit[f]); - if (pin >= 0 && !TEST(fanDone, bit)) { - uint8_t newFanSpeed = TEST(fanState, bit) ? EXTRUDER_AUTO_FAN_SPEED : 0; - #if ENABLED(AUTO_POWER_E_FANS) - autofan_speed[f] = newFanSpeed; - #endif - // this idiom allows both digital and PWM fan outputs (see M42 handling). - digitalWrite(pin, newFanSpeed); - analogWrite(pin, newFanSpeed); - SBI(fanDone, bit); - } - } - } - -#endif // HAS_AUTO_FAN - -// -// Temperature Error Handlers -// -void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) { - if (IsRunning()) { - SERIAL_ERROR_START(); - serialprintPGM(serial_msg); - SERIAL_ERRORPGM(MSG_STOPPED_HEATER); - if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED); - } - #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE) - static bool killed = false; - if (!killed) { - Running = false; - killed = true; - kill(lcd_msg); - } - else - disable_all_heaters(); // paranoia - #endif -} - -void Temperature::max_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, e)); -} - -void Temperature::min_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, e)); -} - -float Temperature::get_pid_output(const int8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #define _HOTEND_TEST true - #else - #define _HOTEND_TEST e == active_extruder - #endif - float pid_output; - #if ENABLED(PIDTEMP) - #if DISABLED(PID_OPENLOOP) - pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; - dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + float(PID_K1) * dTerm[HOTEND_INDEX]; - temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; - #if HEATER_IDLE_HANDLER - if (heater_idle_timeout_exceeded[HOTEND_INDEX]) { - pid_output = 0; - pid_reset[HOTEND_INDEX] = true; - } - else - #endif - if (pid_error[HOTEND_INDEX] > PID_FUNCTIONAL_RANGE) { - pid_output = BANG_MAX; - pid_reset[HOTEND_INDEX] = true; - } - else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0 - #if HEATER_IDLE_HANDLER - || heater_idle_timeout_exceeded[HOTEND_INDEX] - #endif - ) { - pid_output = 0; - pid_reset[HOTEND_INDEX] = true; - } - else { - if (pid_reset[HOTEND_INDEX]) { - temp_iState[HOTEND_INDEX] = 0.0; - pid_reset[HOTEND_INDEX] = false; - } - pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX]; - temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX]; - iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX]; - - pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX]; - - #if ENABLED(PID_EXTRUSION_SCALING) - cTerm[HOTEND_INDEX] = 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; - cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); - pid_output += cTerm[HOTEND_INDEX]; - } - #endif // PID_EXTRUSION_SCALING - - if (pid_output > PID_MAX) { - if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration - pid_output = PID_MAX; - } - else if (pid_output < 0) { - if (pid_error[HOTEND_INDEX] < 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration - pid_output = 0; - } - } - #else - pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX); - #endif // PID_OPENLOOP - - #if ENABLED(PID_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_PID_DEBUG, HOTEND_INDEX); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_OUTPUT, pid_output); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]); - #endif - SERIAL_EOL(); - #endif // PID_DEBUG - - #else /* PID off */ - #if HEATER_IDLE_HANDLER - if (heater_idle_timeout_exceeded[HOTEND_INDEX]) - pid_output = 0; - else - #endif - pid_output = (current_temperature[HOTEND_INDEX] < target_temperature[HOTEND_INDEX]) ? PID_MAX : 0; - #endif - - return pid_output; -} - -#if ENABLED(PIDTEMPBED) - float Temperature::get_pid_output_bed() { - float pid_output; - #if DISABLED(PID_OPENLOOP) - pid_error_bed = target_temperature_bed - current_temperature_bed; - pTerm_bed = bedKp * pid_error_bed; - temp_iState_bed += pid_error_bed; - iTerm_bed = bedKi * temp_iState_bed; - - dTerm_bed = PID_K2 * bedKd * (current_temperature_bed - temp_dState_bed) + PID_K1 * dTerm_bed; - temp_dState_bed = current_temperature_bed; - - pid_output = pTerm_bed + iTerm_bed - dTerm_bed; - if (pid_output > MAX_BED_POWER) { - if (pid_error_bed > 0) temp_iState_bed -= pid_error_bed; // conditional un-integration - pid_output = MAX_BED_POWER; - } - else if (pid_output < 0) { - if (pid_error_bed < 0) temp_iState_bed -= pid_error_bed; // conditional un-integration - pid_output = 0; - } - #else - pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER); - #endif // PID_OPENLOOP - - #if ENABLED(PID_BED_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(" PID_BED_DEBUG "); - SERIAL_ECHOPGM(": Input "); - SERIAL_ECHO(current_temperature_bed); - SERIAL_ECHOPGM(" Output "); - SERIAL_ECHO(pid_output); - SERIAL_ECHOPGM(" pTerm "); - SERIAL_ECHO(pTerm_bed); - SERIAL_ECHOPGM(" iTerm "); - SERIAL_ECHO(iTerm_bed); - SERIAL_ECHOPGM(" dTerm "); - SERIAL_ECHOLN(dTerm_bed); - #endif // PID_BED_DEBUG - - return pid_output; - } -#endif // PIDTEMPBED - -/** - * Manage heating activities for extruder hot-ends and a heated bed - * - Acquire updated temperature readings - * - Also resets the watchdog timer - * - Invoke thermal runaway protection - * - Manage extruder auto-fan - * - Apply filament width to the extrusion rate (may move) - * - Update the heated bed PID output value - */ -void Temperature::manage_heater() { - - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - static bool last_pause_state; - #endif - - #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(PSTR(MSG_KILLED)); - #endif - - if (!temp_meas_ready) return; - - updateTemperaturesFromRawValues(); // also resets the watchdog - - #if ENABLED(HEATER_0_USES_MAX6675) - if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); - if (current_temperature[0] < MAX(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0); - #endif - - #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER - millis_t ms = millis(); - #endif - - HOTEND_LOOP() { - - #if HEATER_IDLE_HANDLER - if (!heater_idle_timeout_exceeded[e] && heater_idle_timeout_ms[e] && ELAPSED(ms, heater_idle_timeout_ms[e])) - heater_idle_timeout_exceeded[e] = true; - #endif - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - // Check for thermal runaway - thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); - #endif - - soft_pwm_amount[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)get_pid_output(e) >> 1 : 0; - - #if WATCH_HOTENDS - // Make sure temperature is increasing - if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) { // Time to check this extruder? - if (degHotend(e) < watch_target_temp[e]) // Failed to increase enough? - _temp_error(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_heater(e); - } - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - // Make sure measured temperatures are close together - if (ABS(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) - _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); - #endif - - } // HOTEND_LOOP - - #if HAS_AUTO_FAN - if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Filament Width Sensor dynamically sets the volumetric multiplier - * based on a delayed measurement of the filament diameter. - */ - 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 - meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - planner.calculate_volumetric_for_width_sensor(measurement_delay[meas_shift_index]); - } - #endif // FILAMENT_WIDTH_SENSOR - - #if HAS_HEATED_BED - - #if WATCH_THE_BED - // Make sure temperature is increasing - if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) { // Time to check the bed? - if (degBed() < watch_target_bed_temp) // Failed to increase enough? - _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, -1)); - else // Start again if the target is still far off - start_watching_bed(); - } - #endif // WATCH_THE_BED - - #if DISABLED(PIDTEMPBED) - if (PENDING(ms, next_bed_check_ms) - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - && paused == last_pause_state - #endif - ) return; - next_bed_check_ms = ms + BED_CHECK_INTERVAL; - #if ENABLED(PROBING_HEATERS_OFF) && ENABLED(BED_LIMIT_SWITCHING) - last_pause_state = paused; - #endif - #endif - - #if HEATER_IDLE_HANDLER - if (!bed_idle_timeout_exceeded && bed_idle_timeout_ms && ELAPSED(ms, bed_idle_timeout_ms)) - bed_idle_timeout_exceeded = true; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); - #endif - - #if HEATER_IDLE_HANDLER - if (bed_idle_timeout_exceeded) { - soft_pwm_amount_bed = 0; - #if DISABLED(PIDTEMPBED) - WRITE_HEATER_BED(LOW); - #endif - } - else - #endif - { - #if ENABLED(PIDTEMPBED) - soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; - #else - // Check if temperature is within the correct band - if (WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP)) { - #if ENABLED(BED_LIMIT_SWITCHING) - if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS) - soft_pwm_amount_bed = 0; - else if (current_temperature_bed <= target_temperature_bed - (BED_HYSTERESIS)) - soft_pwm_amount_bed = MAX_BED_POWER >> 1; - #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - soft_pwm_amount_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0; - #endif - } - else { - soft_pwm_amount_bed = 0; - WRITE_HEATER_BED(LOW); - } - #endif - } - #endif // HAS_HEATED_BED -} - -#define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) -#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) - -/** - * Bisect search for the range of the 'raw' value, then interpolate - * proportionally between the under and over values. - */ -#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ - uint8_t l = 0, r = LEN, m; \ - for (;;) { \ - m = (l + r) >> 1; \ - if (m == l || m == r) return (short)pgm_read_word(&TBL[LEN-1][1]); \ - short v00 = pgm_read_word(&TBL[m-1][0]), \ - v10 = pgm_read_word(&TBL[m-0][0]); \ - if (raw < v00) r = m; \ - else if (raw > v10) l = m; \ - else { \ - const short v01 = (short)pgm_read_word(&TBL[m-1][1]), \ - v11 = (short)pgm_read_word(&TBL[m-0][1]); \ - return v01 + (raw - v00) * float(v11 - v01) / float(v10 - v00); \ - } \ - } \ -}while(0) - -// Derived from RepRap FiveD extruder::getTemperature() -// For hot end temperature measurement. -float Temperature::analog2temp(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_ERROR((int)e); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM); - kill(PSTR(MSG_KILLED)); - return 0.0; - } - - switch (e) { - case 0: - #if 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_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_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_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_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_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 HAS_HEATED_BED - // Derived from RepRap FiveD extruder::getTemperature() - // For bed temperature measurement. - float Temperature::analog2tempBed(const int raw) { - #if ENABLED(HEATER_BED_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - // Derived from RepRap FiveD extruder::getTemperature() - // For chamber temperature measurement. - float Temperature::analog2tempChamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_TEMP_CHAMBER - -/** - * Get the raw values into the actual temperatures. - * The raw values are created in interrupt context, - * and this function is called from normal context - * as it would block the stepper routine. - */ -void Temperature::updateTemperaturesFromRawValues() { - #if ENABLED(HEATER_0_USES_MAX6675) - current_temperature_raw[0] = read_max6675(); - #endif - HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); - #if HAS_HEATED_BED - current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); - #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw); - #endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog2widthFil(); - #endif - - #if ENABLED(USE_WATCHDOG) - // Reset the watchdog after we know we have a temperature measurement. - watchdog_reset(); - #endif - - temp_meas_ready = false; -} - - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - // Convert raw Filament Width to millimeters - float Temperature::analog2widthFil() { - return current_raw_filwidth * 5.0f * (1.0f / 16383.0); - } - - /** - * 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 ENABLED(HEATER_0_USES_MAX6675) - #ifndef MAX6675_SCK_PIN - #define MAX6675_SCK_PIN SCK_PIN - #endif - #ifndef MAX6675_DO_PIN - #define MAX6675_DO_PIN MISO_PIN - #endif - SPI max6675_spi; -#endif - -/** - * Initialize the temperature manager - * The manager is implemented by periodic calls to manage_heater() - */ -void Temperature::init() { - - #if MB(RUMBA) && ( \ - ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595) || ENABLED(HEATER_4_USES_AD595) || ENABLED(HEATER_BED_USES_AD595) || ENABLED(HEATER_CHAMBER_USES_AD595) \ - || ENABLED(HEATER_0_USES_AD8495) || ENABLED(HEATER_1_USES_AD8495) || ENABLED(HEATER_2_USES_AD8495) || ENABLED(HEATER_3_USES_AD8495) || ENABLED(HEATER_4_USES_AD8495) || ENABLED(HEATER_BED_USES_AD8495) || ENABLED(HEATER_CHAMBER_USES_AD8495)) - // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector - MCUCR = _BV(JTD); - MCUCR = _BV(JTD); - #endif - - // Finish init of mult hotend arrays - HOTEND_LOOP() maxttemp[e] = maxttemp[0]; - - #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - - #if HAS_HEATER_0 - SET_OUTPUT(HEATER_0_PIN); - #endif - #if HAS_HEATER_1 - SET_OUTPUT(HEATER_1_PIN); - #endif - #if HAS_HEATER_2 - SET_OUTPUT(HEATER_2_PIN); - #endif - #if HAS_HEATER_3 - SET_OUTPUT(HEATER_3_PIN); - #endif - #if HAS_HEATER_4 - SET_OUTPUT(HEATER_3_PIN); - #endif - #if HAS_HEATED_BED - SET_OUTPUT(HEATER_BED_PIN); - #endif - - #if HAS_FAN0 - SET_OUTPUT(FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if HAS_FAN1 - SET_OUTPUT(FAN1_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if HAS_FAN2 - SET_OUTPUT(FAN2_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #endif - - #if ENABLED(HEATER_0_USES_MAX6675) - - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - - max6675_spi.init(); - - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS, HIGH); - - #endif // HEATER_0_USES_MAX6675 - - HAL_adc_init(); - - #if HAS_TEMP_ADC_0 - HAL_ANALOG_SELECT(TEMP_0_PIN); - #endif - #if HAS_TEMP_ADC_1 - HAL_ANALOG_SELECT(TEMP_1_PIN); - #endif - #if HAS_TEMP_ADC_2 - HAL_ANALOG_SELECT(TEMP_2_PIN); - #endif - #if HAS_TEMP_ADC_3 - HAL_ANALOG_SELECT(TEMP_3_PIN); - #endif - #if HAS_TEMP_ADC_4 - HAL_ANALOG_SELECT(TEMP_4_PIN); - #endif - #if HAS_HEATED_BED - HAL_ANALOG_SELECT(TEMP_BED_PIN); - #endif - #if HAS_TEMP_CHAMBER - HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - HAL_ANALOG_SELECT(FILWIDTH_PIN); - #endif - - HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); - ENABLE_TEMPERATURE_INTERRUPT(); - - #if HAS_AUTO_FAN_0 - #if E0_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E0_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E0_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E0_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_1 && !AUTO_1_IS_0 - #if E1_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E1_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E1_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E1_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_2 && !AUTO_2_IS_0 && !AUTO_2_IS_1 - #if E2_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E2_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E2_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E2_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_3 && !AUTO_3_IS_0 && !AUTO_3_IS_1 && !AUTO_3_IS_2 - #if E3_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E3_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E3_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E3_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_FAN_4 && !AUTO_4_IS_0 && !AUTO_4_IS_1 && !AUTO_4_IS_2 && !AUTO_4_IS_3 - #if E4_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(E4_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(E4_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(E4_AUTO_FAN_PIN); - #endif - #endif - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_0 && !AUTO_CHAMBER_IS_1 && !AUTO_CHAMBER_IS_2 && !AUTO_CHAMBER_IS_3 && ! AUTO_CHAMBER_IS_4 - #if CHAMBER_AUTO_FAN_PIN == FAN1_PIN - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #if ENABLED(FAST_PWM_FAN) - setPwmFrequency(CHAMBER_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 - #endif - #else - SET_OUTPUT(CHAMBER_AUTO_FAN_PIN); - #endif - #endif - - // Wait for temperature measurement to settle - delay(250); - - #define TEMP_MIN_ROUTINE(NR) \ - minttemp[NR] = HEATER_ ##NR## _MINTEMP; \ - while (analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \ - if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ - minttemp_raw[NR] += OVERSAMPLENR; \ - else \ - minttemp_raw[NR] -= OVERSAMPLENR; \ - } - #define TEMP_MAX_ROUTINE(NR) \ - maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \ - while (analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \ - if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ - maxttemp_raw[NR] -= OVERSAMPLENR; \ - else \ - maxttemp_raw[NR] += OVERSAMPLENR; \ - } - - #ifdef HEATER_0_MINTEMP - TEMP_MIN_ROUTINE(0); - #endif - #ifdef HEATER_0_MAXTEMP - TEMP_MAX_ROUTINE(0); - #endif - #if HOTENDS > 1 - #ifdef HEATER_1_MINTEMP - TEMP_MIN_ROUTINE(1); - #endif - #ifdef HEATER_1_MAXTEMP - TEMP_MAX_ROUTINE(1); - #endif - #if HOTENDS > 2 - #ifdef HEATER_2_MINTEMP - TEMP_MIN_ROUTINE(2); - #endif - #ifdef HEATER_2_MAXTEMP - TEMP_MAX_ROUTINE(2); - #endif - #if HOTENDS > 3 - #ifdef HEATER_3_MINTEMP - TEMP_MIN_ROUTINE(3); - #endif - #ifdef HEATER_3_MAXTEMP - TEMP_MAX_ROUTINE(3); - #endif - #if HOTENDS > 4 - #ifdef HEATER_4_MINTEMP - TEMP_MIN_ROUTINE(4); - #endif - #ifdef HEATER_4_MAXTEMP - TEMP_MAX_ROUTINE(4); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - #ifdef BED_MINTEMP - while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { - #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP - bed_minttemp_raw += OVERSAMPLENR; - #else - bed_minttemp_raw -= OVERSAMPLENR; - #endif - } - #endif // BED_MINTEMP - #ifdef BED_MAXTEMP - while (analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { - #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP - bed_maxttemp_raw -= OVERSAMPLENR; - #else - bed_maxttemp_raw += OVERSAMPLENR; - #endif - } - #endif // BED_MAXTEMP - #endif // HAS_HEATED_BED - - #if ENABLED(PROBING_HEATERS_OFF) - paused = false; - #endif -} - -#if ENABLED(FAST_PWM_FAN) - - void Temperature::setPwmFrequency(const pin_t pin, int val) { - val &= 0x07; - switch (digitalPinToTimer(pin)) { - #ifdef TCCR0A - #if !AVR_AT90USB1286_FAMILY - case TIMER0A: - #endif - case TIMER0B: //_SET_CS(0, val); - break; - #endif - #ifdef TCCR1A - case TIMER1A: case TIMER1B: //_SET_CS(1, val); - break; - #endif - #if defined(TCCR2) || defined(TCCR2A) - #ifdef TCCR2 - case TIMER2: - #endif - #ifdef TCCR2A - case TIMER2A: case TIMER2B: - #endif - _SET_CS(2, val); break; - #endif - #ifdef TCCR3A - case TIMER3A: case TIMER3B: case TIMER3C: _SET_CS(3, val); break; - #endif - #ifdef TCCR4A - case TIMER4A: case TIMER4B: case TIMER4C: _SET_CS(4, val); break; - #endif - #ifdef TCCR5A - case TIMER5A: case TIMER5B: case TIMER5C: _SET_CS(5, val); break; - #endif - } - } - -#endif // FAST_PWM_FAN - -#if WATCH_HOTENDS - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M104, M109) - */ - void Temperature::start_watching_heater(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { - watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE; - watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; - } - else - watch_heater_next_ms[HOTEND_INDEX] = 0; - } -#endif - -#if WATCH_THE_BED - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M140, M190) - */ - void Temperature::start_watching_bed() { - if (degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { - watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE; - watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL; - } - else - watch_bed_next_ms = 0; - } -#endif - -#if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - Temperature::TRState Temperature::thermal_runaway_state_machine[HOTENDS] = { TRInactive }; - millis_t Temperature::thermal_runaway_timer[HOTENDS] = { 0 }; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - Temperature::TRState Temperature::thermal_runaway_bed_state_machine = TRInactive; - millis_t Temperature::thermal_runaway_bed_timer; - #endif - - void Temperature::thermal_runaway_protection(Temperature::TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) { - - static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; - - /** - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: "); - if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHO(heater_id); - SERIAL_ECHOPAIR(" ; State:", *state); - SERIAL_ECHOPAIR(" ; Timer:", *timer); - SERIAL_ECHOPAIR(" ; Temperature:", current); - SERIAL_ECHOPAIR(" ; Target Temp:", target); - if (heater_id >= 0) - SERIAL_ECHOPAIR(" ; Idle Timeout:", heater_idle_timeout_exceeded[heater_id]); - else - SERIAL_ECHOPAIR(" ; Idle Timeout:", bed_idle_timeout_exceeded); - SERIAL_EOL(); - */ - - const int heater_index = heater_id >= 0 ? heater_id : HOTENDS; - - #if HEATER_IDLE_HANDLER - // If the heater idle timeout expires, restart - if ((heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) - #if HAS_HEATED_BED - || (heater_id < 0 && bed_idle_timeout_exceeded) - #endif - ) { - *state = TRInactive; - tr_target_temperature[heater_index] = 0; - } - else - #endif - { - // If the target temperature changes, restart - if (tr_target_temperature[heater_index] != target) { - tr_target_temperature[heater_index] = target; - *state = target > 0 ? TRFirstHeating : TRInactive; - } - } - - switch (*state) { - // Inactive state waits for a target temperature to be set - case TRInactive: break; - // When first heating, wait for the temperature to be reached then go to Stable state - case TRFirstHeating: - if (current < tr_target_temperature[heater_index]) break; - *state = TRStable; - // While the temperature is stable watch for a bad temperature - case TRStable: - if (current >= tr_target_temperature[heater_index] - hysteresis_degc) { - *timer = millis() + period_seconds * 1000UL; - break; - } - else if (PENDING(millis(), *timer)) break; - *state = TRRunaway; - case TRRunaway: - _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater_id)); - } - } - -#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED - -void Temperature::disable_all_heaters() { - - #if ENABLED(AUTOTEMP) - planner.autotemp_enabled = false; - #endif - - HOTEND_LOOP() setTargetHotend(0, e); - - #if HAS_HEATED_BED - setTargetBed(0); - #endif - - // Unpause and reset everything - #if ENABLED(PROBING_HEATERS_OFF) - pause(false); - #endif - - // If all heaters go down then for sure our print job has stopped - print_job_timer.stop(); - - #define DISABLE_HEATER(NR) { \ - setTargetHotend(0, NR); \ - soft_pwm_amount[NR] = 0; \ - WRITE_HEATER_ ##NR (LOW); \ - } - - #if HAS_TEMP_HOTEND - DISABLE_HEATER(0); - #if HOTENDS > 1 - DISABLE_HEATER(1); - #if HOTENDS > 2 - DISABLE_HEATER(2); - #if HOTENDS > 3 - DISABLE_HEATER(3); - #if HOTENDS > 4 - DISABLE_HEATER(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif - - #if HAS_HEATED_BED - target_temperature_bed = 0; - soft_pwm_amount_bed = 0; - #if HAS_HEATED_BED - WRITE_HEATER_BED(LOW); - #endif - #endif -} - -#if ENABLED(PROBING_HEATERS_OFF) - - void Temperature::pause(const bool p) { - if (p != paused) { - paused = p; - if (p) { - HOTEND_LOOP() start_heater_idle_timer(e, 0); // timeout immediately - #if HAS_HEATED_BED - start_bed_idle_timer(0); // timeout immediately - #endif - } - else { - HOTEND_LOOP() reset_heater_idle_timer(e); - #if HAS_HEATED_BED - reset_bed_idle_timer(); - #endif - } - } - } - -#endif // PROBING_HEATERS_OFF - -#if ENABLED(HEATER_0_USES_MAX6675) - - #define MAX6675_HEAT_INTERVAL 250u - - #if ENABLED(MAX6675_IS_MAX31855) - uint32_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 7 - #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS (_BV(SPR1)) // clock ÷ 64 - #else - uint16_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 4 - #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS (_BV(SPR0)) // clock ÷ 16 - #endif - - int Temperature::read_max6675() { - - static millis_t next_max6675_ms = 0; - - millis_t ms = millis(); - - if (PENDING(ms, next_max6675_ms)) return (int)max6675_temp; - - next_max6675_ms = ms + MAX6675_HEAT_INTERVAL; - - CBI( - #ifdef PRR - PRR - #elif defined(PRR0) - PRR0 - #endif - , PRSPI); - SPCR = _BV(MSTR) | _BV(SPE) | MAX6675_SPEED_BITS; - - WRITE(MAX6675_SS, 0); // enable TT_MAX6675 - - DELAY_NS(100); // Ensure 100ns delay - - // Read a big-endian temperature value - max6675_temp = 0; - for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= max6675_spi.receive(); - if (i > 0) max6675_temp <<= 8; // shift left if not the last byte - } - - WRITE(MAX6675_SS, 1); // disable TT_MAX6675 - - if (max6675_temp & MAX6675_ERROR_MASK) { - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("Temp measurement error! "); - #if MAX6675_ERROR_MASK == 7 - SERIAL_ERRORPGM("MAX31855 "); - if (max6675_temp & 1) - SERIAL_ERRORLNPGM("Open Circuit"); - else if (max6675_temp & 2) - SERIAL_ERRORLNPGM("Short to GND"); - else if (max6675_temp & 4) - SERIAL_ERRORLNPGM("Short to VCC"); - #else - SERIAL_ERRORLNPGM("MAX6675"); - #endif - max6675_temp = MAX6675_TMAX * 4; // thermocouple open - } - else - max6675_temp >>= MAX6675_DISCARD_BITS; - #if ENABLED(MAX6675_IS_MAX31855) - // Support negative temperature - if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; - #endif - - return (int)max6675_temp; - } - -#endif // HEATER_0_USES_MAX6675 - -/** - * Get raw temperatures - */ -void Temperature::set_current_temp_raw() { - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) - current_temperature_raw[0] = raw_temp_value[0]; - #endif - #if HAS_TEMP_ADC_1 - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - redundant_temperature_raw = raw_temp_value[1]; - #else - current_temperature_raw[1] = raw_temp_value[1]; - #endif - #if HAS_TEMP_ADC_2 - current_temperature_raw[2] = raw_temp_value[2]; - #if HAS_TEMP_ADC_3 - current_temperature_raw[3] = raw_temp_value[3]; - #if HAS_TEMP_ADC_4 - current_temperature_raw[4] = raw_temp_value[4]; - #endif - #endif - #endif - #endif - - #if HAS_HEATED_BED - current_temperature_bed_raw = raw_temp_bed_value; - #endif - #if HAS_TEMP_CHAMBER - current_temperature_chamber_raw = raw_temp_chamber_value; - #endif - temp_meas_ready = true; -} - -#if ENABLED(PINS_DEBUGGING) - /** - * monitors endstops & Z probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - * - */ - void endstop_monitor() { - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); - #endif - #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); - #endif - #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); - #endif - #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); - #endif - #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); - #endif - #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); - #endif - #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); - #endif - #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - - if (endstop_change) { - #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(live_state_local, X_MIN)); - #endif - #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(live_state_local, X_MAX)); - #endif - #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(live_state_local, Y_MIN)); - #endif - #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(live_state_local, Y_MAX)); - #endif - #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(live_state_local, Z_MIN)); - #endif - #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(live_state_local, Z_MAX)); - #endif - #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(live_state_local, Z_MIN_PROBE)); - #endif - #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(live_state_local, Z2_MIN)); - #endif - #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(live_state_local, Z2_MAX)); - #endif - SERIAL_PROTOCOLPGM("\n\n"); - analogWrite(LED_PIN, local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } -#endif // PINS_DEBUGGING - -void Temperature::readings_ready() { - // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); - - // 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 - #endif - - ZERO(raw_temp_value); - - #if HAS_HEATED_BED - raw_temp_bed_value = 0; - #endif - - #if HAS_TEMP_CHAMBER - raw_temp_chamber_value = 0; - #endif - - #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) - - int constexpr temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - , TEMPDIR(1) - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; - - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int16_t tdir = temp_dir[e], rawtemp = current_temperature_raw[e] * tdir; - const bool heater_on = 0 < - #if ENABLED(PIDTEMP) - soft_pwm_amount[e] - #else - target_temperature[e] - #endif - ; - if (rawtemp > maxttemp_raw[e] * tdir && heater_on) max_temp_error(e); - if (rawtemp < minttemp_raw[e] * tdir && !is_preheating(e) && heater_on) { - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error(e); - } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; - #endif - } - - #if HAS_HEATED_BED - #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP - #define GEBED <= - #else - #define GEBED >= - #endif - const bool bed_on = 0 < - #if ENABLED(PIDTEMPBED) - soft_pwm_amount_bed - #else - target_temperature_bed - #endif - ; - if (current_temperature_bed_raw GEBED bed_maxttemp_raw && bed_on) max_temp_error(-1); - if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); - #endif -} - -/** - * Timer 0 is shared with millies so don't change the prescaler. - * - * This ISR uses the compare method so it runs at the base - * frequency (16 MHz / 64 / 256 = 976.5625 Hz), but at the TCNT0 set - * in OCR0B above (128 or halfway between OVFs). - * - * - Manage PWM to all the heaters and fan - * - Prepare or Measure one of the raw ADC sensor values - * - Check new temperature values for MIN/MAX errors (kill on error) - * - Step the babysteps value for each axis towards 0 - * - For PINS_DEBUGGING, monitor and report endstop pins - * - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged - * - Call planner.tick to count down its "ignore" time - */ -HAL_TEMP_TIMER_ISR { - HAL_timer_isr_prologue(TEMP_TIMER_NUM); - - Temperature::isr(); - - HAL_timer_isr_epilogue(TEMP_TIMER_NUM); -} - -void Temperature::isr() { - - static int8_t temp_count = -1; - static ADCSensorState adc_sensor_state = StartupDelay; - static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); - // avoid multiple loads of pwm_count - uint8_t pwm_count_tmp = pwm_count; - #if ENABLED(ADC_KEYPAD) - static unsigned int raw_ADCKey_value = 0; - #endif - - //////////////////////////// - if(current_temperature[0]>50&&fanSpeeds[2]<=100) - { - - fanSpeeds[2]=255; - - - } - else if (current_temperature[0]<50&&fanSpeeds[2]>100) - { - - fanSpeeds[2]=0; - - } - /////////////////////////////////////// - - - -#if POWER_LOSS_RECOVER_SUPER_CAP - char tmp_d[32]; - static char test=0; - if((digitalRead(POWER_LOSS_DETECT_PIN)==0)&&(recovery_detect_cap.file_name[0])&&(recovery_detect_cap.recovery==0)&&(print_job_timer.isRunning()==true))// power off - { - // SERIAL_ECHOLN("Down0"); - // enquecommand("M929"); - recovery_detect_cap.T0_t=thermalManager.degTargetHotend(0)+0.5; - recovery_detect_cap.B_t=thermalManager.degTargetBed()+0.5; - //////////// - thermalManager.disable_all_heaters(); - disable_all_steppers(); - ////////////// - recovery_detect_cap.Z_t=LOGICAL_Z_POSITION(current_position[Z_AXIS])*10; - recovery_detect_cap.E_t=current_position[E_AXIS]; - recovery_detect_cap.pos_t=card.getStatus(0); - recovery_detect_cap.recovery=3; - // sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),Z_t,E_t,pos_t,T0_t,B_t); - // SERIAL_ECHOLN(tmp_d); - - //settings.save(); - settings.power_lose_save(); - SERIAL_ECHOLN("save ok"); - // settings.load(); - - sprintf_P(tmp_d,PSTR("Z%u,E%lu,P%lu,T%u,B%u,"),recovery_detect_cap.Z_t,recovery_detect_cap.E_t,recovery_detect_cap.pos_t,recovery_detect_cap.T0_t,recovery_detect_cap.B_t); - SERIAL_ECHOLN(tmp_d); - sprintf_P(tmp_d,PSTR("%s, save end--------"),recovery_detect_cap.file_name); - SERIAL_ECHOLN(tmp_d); -#if ENABLED(USE_WATCHDOG) - while(1); -#endif - } -#endif - - - - // Static members for each heater - #if ENABLED(SLOW_PWM_HEATERS) - static uint8_t slow_pwm_count = 0; - #define ISR_STATICS(n) \ - static uint8_t soft_pwm_count_ ## n, \ - state_heater_ ## n = 0, \ - state_timer_heater_ ## n = 0 - #else - #define ISR_STATICS(n) static uint8_t soft_pwm_count_ ## n = 0 - #endif - - // Statics per heater - ISR_STATICS(0); - #if HOTENDS > 1 - ISR_STATICS(1); - #if HOTENDS > 2 - ISR_STATICS(2); - #if HOTENDS > 3 - ISR_STATICS(3); - #if HOTENDS > 4 - ISR_STATICS(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - ISR_STATICS(BED); - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static unsigned long raw_filwidth_value = 0; - #endif - - #if DISABLED(SLOW_PWM_HEATERS) - constexpr uint8_t pwm_mask = - #if ENABLED(SOFT_PWM_DITHER) - _BV(SOFT_PWM_SCALE) - 1 - #else - 0 - #endif - ; - - /** - * Standard PWM modulation - */ - if (pwm_count_tmp >= 127) { - pwm_count_tmp -= 127; - soft_pwm_count_0 = (soft_pwm_count_0 & pwm_mask) + soft_pwm_amount[0]; - WRITE_HEATER_0(soft_pwm_count_0 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 1 - soft_pwm_count_1 = (soft_pwm_count_1 & pwm_mask) + soft_pwm_amount[1]; - WRITE_HEATER_1(soft_pwm_count_1 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 2 - soft_pwm_count_2 = (soft_pwm_count_2 & pwm_mask) + soft_pwm_amount[2]; - WRITE_HEATER_2(soft_pwm_count_2 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 3 - soft_pwm_count_3 = (soft_pwm_count_3 & pwm_mask) + soft_pwm_amount[3]; - WRITE_HEATER_3(soft_pwm_count_3 > pwm_mask ? HIGH : LOW); - #if HOTENDS > 4 - soft_pwm_count_4 = (soft_pwm_count_4 & pwm_mask) + soft_pwm_amount[4]; - WRITE_HEATER_4(soft_pwm_count_4 > pwm_mask ? HIGH : LOW); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - soft_pwm_count_BED = (soft_pwm_count_BED & pwm_mask) + soft_pwm_amount_bed; - WRITE_HEATER_BED(soft_pwm_count_BED > pwm_mask ? HIGH : LOW); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask) + (soft_pwm_amount_fan[0] >> 1); - WRITE_FAN(soft_pwm_count_fan[0] > pwm_mask ? HIGH : LOW); - #endif - #if HAS_FAN1 - soft_pwm_count_fan[1] = (soft_pwm_count_fan[1] & pwm_mask) + (soft_pwm_amount_fan[1] >> 1); - WRITE_FAN1(soft_pwm_count_fan[1] > pwm_mask ? HIGH : LOW); - #endif - #if HAS_FAN2 - soft_pwm_count_fan[2] = (soft_pwm_count_fan[2] & pwm_mask) + (soft_pwm_amount_fan[2] >> 1); - WRITE_FAN2(soft_pwm_count_fan[2] > pwm_mask ? HIGH : LOW); - #endif - #endif - } - else { - if (soft_pwm_count_0 <= pwm_count_tmp) WRITE_HEATER_0(LOW); - #if HOTENDS > 1 - if (soft_pwm_count_1 <= pwm_count_tmp) WRITE_HEATER_1(LOW); - #if HOTENDS > 2 - if (soft_pwm_count_2 <= pwm_count_tmp) WRITE_HEATER_2(LOW); - #if HOTENDS > 3 - if (soft_pwm_count_3 <= pwm_count_tmp) WRITE_HEATER_3(LOW); - #if HOTENDS > 4 - if (soft_pwm_count_4 <= pwm_count_tmp) WRITE_HEATER_4(LOW); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - if (soft_pwm_count_BED <= pwm_count_tmp) WRITE_HEATER_BED(LOW); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(LOW); - #endif - #endif - } - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - #else // SLOW_PWM_HEATERS - - /** - * SLOW PWM HEATERS - * - * For relay-driven heaters - */ - #ifndef MIN_STATE_TIME - #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds - #endif - - // Macros for Slow PWM timer logic - #define _SLOW_PWM_ROUTINE(NR, src) \ - soft_pwm_count_ ##NR = src; \ - if (soft_pwm_count_ ##NR > 0) { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 1; \ - WRITE_HEATER_ ##NR(1); \ - } \ - } \ - else { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 0; \ - WRITE_HEATER_ ##NR(0); \ - } \ - } - #define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n]) - - #define PWM_OFF_ROUTINE(NR) \ - if (soft_pwm_count_ ##NR < slow_pwm_count) { \ - if (state_timer_heater_ ##NR == 0) { \ - if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \ - state_heater_ ##NR = 0; \ - WRITE_HEATER_ ##NR (0); \ - } \ - } - - if (slow_pwm_count == 0) { - - SLOW_PWM_ROUTINE(0); - #if HOTENDS > 1 - SLOW_PWM_ROUTINE(1); - #if HOTENDS > 2 - SLOW_PWM_ROUTINE(2); - #if HOTENDS > 3 - SLOW_PWM_ROUTINE(3); - #if HOTENDS > 4 - SLOW_PWM_ROUTINE(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - _SLOW_PWM_ROUTINE(BED, soft_pwm_amount_bed); // BED - #endif - - } // slow_pwm_count == 0 - - PWM_OFF_ROUTINE(0); - #if HOTENDS > 1 - PWM_OFF_ROUTINE(1); - #if HOTENDS > 2 - PWM_OFF_ROUTINE(2); - #if HOTENDS > 3 - PWM_OFF_ROUTINE(3); - #if HOTENDS > 4 - PWM_OFF_ROUTINE(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - PWM_OFF_ROUTINE(BED); // BED - #endif - - #if ENABLED(FAN_SOFT_PWM) - if (pwm_count_tmp >= 127) { - pwm_count_tmp = 0; - #if HAS_FAN0 - soft_pwm_count_fan[0] = soft_pwm_amount_fan[0] >> 1; - WRITE_FAN(soft_pwm_count_fan[0] > 0 ? HIGH : LOW); - #endif - #if HAS_FAN1 - soft_pwm_count_fan[1] = soft_pwm_amount_fan[1] >> 1; - WRITE_FAN1(soft_pwm_count_fan[1] > 0 ? HIGH : LOW); - #endif - #if HAS_FAN2 - soft_pwm_count_fan[2] = soft_pwm_amount_fan[2] >> 1; - WRITE_FAN2(soft_pwm_count_fan[2] > 0 ? HIGH : LOW); - #endif - } - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN1(LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN2(LOW); - #endif - #endif // FAN_SOFT_PWM - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - // increment slow_pwm_count only every 64th pwm_count, - // i.e. yielding a PWM frequency of 16/128 Hz (8s). - if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) { - slow_pwm_count++; - slow_pwm_count &= 0x7F; - - if (state_timer_heater_0 > 0) state_timer_heater_0--; - #if HOTENDS > 1 - if (state_timer_heater_1 > 0) state_timer_heater_1--; - #if HOTENDS > 2 - if (state_timer_heater_2 > 0) state_timer_heater_2--; - #if HOTENDS > 3 - if (state_timer_heater_3 > 0) state_timer_heater_3--; - #if HOTENDS > 4 - if (state_timer_heater_4 > 0) state_timer_heater_4--; - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - if (state_timer_heater_BED > 0) state_timer_heater_BED--; - #endif - } // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0 - - #endif // SLOW_PWM_HEATERS - - // - // Update lcd buttons 488 times per second - // - static bool do_buttons; - if ((do_buttons ^= true)) lcd_buttons_update(); - - /** - * One sensor is sampled on every other call of the ISR. - * Each sensor is read 16 (OVERSAMPLENR) times, taking the average. - * - * On each Prepare pass, ADC is started for a sensor pin. - * On the next pass, the ADC value is read and accumulated. - * - * This gives each ADC 0.9765ms to charge up. - */ - #define ACCUMULATE_ADC(var) do{ \ - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else var += HAL_READ_ADC(); \ - }while(0) - - ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; - - switch (adc_sensor_state) { - - case SensorsReady: { - // All sensors have been read. Stay in this state for a few - // ISRs to save on calls to temp update/checking code below. - constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; - static uint8_t delay_count = 0; - if (extra_loops > 0) { - if (delay_count == 0) delay_count = extra_loops; // Init this delay - if (--delay_count) // While delaying... - next_sensor_state = SensorsReady; // retain this state (else, next state will be 0) - break; - } - else { - adc_sensor_state = StartSampling; // Fall-through to start sampling - next_sensor_state = (ADCSensorState)(int(StartSampling) + 1); - } - } - - case StartSampling: // Start of sampling loops. Do updates/checks. - if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - temp_count = 0; - readings_ready(); - } - break; - - #if HAS_TEMP_ADC_0 - case PrepareTemp_0: - HAL_START_ADC(TEMP_0_PIN); - break; - case MeasureTemp_0: - ACCUMULATE_ADC(raw_temp_value[0]); - break; - #endif - - #if HAS_HEATED_BED - case PrepareTemp_BED: - HAL_START_ADC(TEMP_BED_PIN); - break; - case MeasureTemp_BED: - ACCUMULATE_ADC(raw_temp_bed_value); - break; - #endif - - #if HAS_TEMP_CHAMBER - case PrepareTemp_CHAMBER: - HAL_START_ADC(TEMP_CHAMBER_PIN); - break; - case MeasureTemp_CHAMBER: - ACCUMULATE_ADC(raw_temp_chamber_value); - break; - #endif - - #if HAS_TEMP_ADC_1 - case PrepareTemp_1: - HAL_START_ADC(TEMP_1_PIN); - break; - case MeasureTemp_1: - ACCUMULATE_ADC(raw_temp_value[1]); - break; - #endif - - #if HAS_TEMP_ADC_2 - case PrepareTemp_2: - HAL_START_ADC(TEMP_2_PIN); - break; - case MeasureTemp_2: - ACCUMULATE_ADC(raw_temp_value[2]); - break; - #endif - - #if HAS_TEMP_ADC_3 - case PrepareTemp_3: - HAL_START_ADC(TEMP_3_PIN); - break; - case MeasureTemp_3: - ACCUMULATE_ADC(raw_temp_value[3]); - break; - #endif - - #if HAS_TEMP_ADC_4 - case PrepareTemp_4: - HAL_START_ADC(TEMP_4_PIN); - break; - case MeasureTemp_4: - ACCUMULATE_ADC(raw_temp_value[4]); - break; - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - 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 += ((unsigned long)HAL_READ_ADC() << 7); // Add new ADC reading, scaled by 128 - } - break; - #endif - - #if ENABLED(ADC_KEYPAD) - 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 - else if (ADCKey_count < 16) { - raw_ADCKey_value = HAL_READ_ADC(); - if (raw_ADCKey_value > 900) { - //ADC Key release - ADCKey_count = 0; - current_ADCKey_raw = 0; - } - else { - current_ADCKey_raw += raw_ADCKey_value; - ADCKey_count++; - } - } - break; - #endif // ADC_KEYPAD - - case StartupDelay: break; - - } // switch(adc_sensor_state) - - // Go to the next state - adc_sensor_state = next_sensor_state; - - // - // Additional ~1KHz Tasks - // - - #if ENABLED(BABYSTEPPING) - LOOP_XYZ(axis) { - const int curTodo = babystepsTodo[axis]; // get rid of volatile for performance - if (curTodo) { - stepper.babystep((AxisEnum)axis, curTodo > 0); - if (curTodo > 0) babystepsTodo[axis]--; - else babystepsTodo[axis]++; - } - } - #endif // BABYSTEPPING - - // Poll endstops state, if required - endstops.poll(); - - // Periodically call the planner timer - planner.tick(); -} - -#if HAS_TEMP_SENSOR - - void print_heater_state(const float &c, const float &t, - #if ENABLED(SHOW_TEMP_ADC_VALUES) - const float r, - #endif - const int8_t e=-3 - ) { - #if !(HAS_HEATED_BED && HAS_TEMP_HOTEND && HAS_TEMP_CHAMBER) && HOTENDS <= 1 - UNUSED(e); - #endif - - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLCHAR( - #if HAS_TEMP_CHAMBER && HAS_HEATED_BED && HAS_TEMP_HOTEND - e == -2 ? 'C' : e == -1 ? 'B' : 'T' - #elif HAS_HEATED_BED && HAS_TEMP_HOTEND - e == -1 ? 'B' : 'T' - #elif HAS_TEMP_HOTEND - 'T' - #else - 'B' - #endif - ); - #if HOTENDS > 1 - if (e >= 0) SERIAL_PROTOCOLCHAR('0' + e); - #endif - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL(c); - SERIAL_PROTOCOLPAIR(" /" , t); - #if ENABLED(SHOW_TEMP_ADC_VALUES) - SERIAL_PROTOCOLPAIR(" (", r / OVERSAMPLENR); - SERIAL_PROTOCOLCHAR(')'); - #endif - delay(2); - } - - extern uint8_t target_extruder; - - void Temperature::print_heaterstates() { - #if HAS_TEMP_HOTEND - print_heater_state(degHotend(target_extruder), degTargetHotend(target_extruder) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(target_extruder) - #endif - ); - #endif - #if HAS_HEATED_BED - print_heater_state(degBed(), degTargetBed() - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawBedTemp() - #endif - , -1 // BED - ); - #endif - #if HAS_TEMP_CHAMBER - print_heater_state(degChamber(), 0 - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawChamberTemp() - #endif - , -2 // CHAMBER - ); - #endif - #if HOTENDS > 1 - HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(e) - #endif - , e - ); - #endif - SERIAL_PROTOCOLPGM(" @:"); - SERIAL_PROTOCOL(getHeaterPower(target_extruder)); - #if HAS_HEATED_BED - SERIAL_PROTOCOLPGM(" B@:"); - SERIAL_PROTOCOL(getHeaterPower(-1)); - #endif - #if HOTENDS > 1 - HOTEND_LOOP() { - SERIAL_PROTOCOLPAIR(" @", e); - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL(getHeaterPower(e)); - } - #endif - } - - #if ENABLED(AUTO_REPORT_TEMPERATURES) - - uint8_t Temperature::auto_report_temp_interval; - millis_t Temperature::next_temp_report_ms; - - void Temperature::auto_report_temperatures() { - if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) { - next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; - print_heaterstates(); - SERIAL_EOL(); - } - } - - #endif // AUTO_REPORT_TEMPERATURES - -#endif // HAS_TEMP_SENSOR diff --git a/Marlin_thinkerV2/Marlin/temperature.h b/Marlin_thinkerV2/Marlin/temperature.h deleted file mode 100644 index cc6df0bdf7..0000000000 --- a/Marlin_thinkerV2/Marlin/temperature.h +++ /dev/null @@ -1,655 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * temperature.h - temperature controller - */ - -#ifndef TEMPERATURE_H -#define TEMPERATURE_H - -#include "thermistortables.h" - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - #include "power.h" -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - #include "stepper.h" -#endif - -#ifndef SOFT_PWM_SCALE - #define SOFT_PWM_SCALE 0 -#endif - -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - -#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) - -#if HOTENDS == 1 - #define HOTEND_INDEX 0 -#else - #define HOTEND_INDEX e -#endif - -/** - * States for ADC reading in the ISR - */ -enum ADCSensorState : char { - StartSampling, - #if HAS_TEMP_ADC_0 - PrepareTemp_0, - MeasureTemp_0, - #endif - #if HAS_TEMP_ADC_1 - PrepareTemp_1, - MeasureTemp_1, - #endif - #if HAS_TEMP_ADC_2 - PrepareTemp_2, - MeasureTemp_2, - #endif - #if HAS_TEMP_ADC_3 - PrepareTemp_3, - MeasureTemp_3, - #endif - #if HAS_TEMP_ADC_4 - PrepareTemp_4, - MeasureTemp_4, - #endif - #if HAS_HEATED_BED - PrepareTemp_BED, - MeasureTemp_BED, - #endif - #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - Prepare_FILWIDTH, - Measure_FILWIDTH, - #endif - #if ENABLED(ADC_KEYPAD) - 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 -}; - -// Minimum number of Temperature::ISR loops between sensor readings. -// Multiplied by 16 (OVERSAMPLENR) to obtain the total time to -// get all oversampled sensor readings -#define MIN_ADC_ISR_LOOPS 10 - -#define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) - -#if HAS_PID_HEATING - #define PID_K2 (1.0f-PID_K1) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0f / 256.0f)) - - // Apply the scale factors to the PID values - #define scalePID_i(i) ( (i) * float(PID_dT) ) - #define unscalePID_i(i) ( (i) / float(PID_dT) ) - #define scalePID_d(d) ( (d) / float(PID_dT) ) - #define unscalePID_d(d) ( (d) * float(PID_dT) ) -#endif - -class Temperature { - - public: - - static float current_temperature[HOTENDS]; - static int16_t current_temperature_raw[HOTENDS], - target_temperature[HOTENDS]; - static uint8_t soft_pwm_amount[HOTENDS]; - - #if ENABLED(AUTO_POWER_E_FANS) - static int16_t autofan_speed[HOTENDS]; - #endif - - #if ENABLED(FAN_SOFT_PWM) - static uint8_t soft_pwm_amount_fan[FAN_COUNT], - soft_pwm_count_fan[FAN_COUNT]; - #endif - - #if ENABLED(PIDTEMP) - - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - - static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; - #if ENABLED(PID_EXTRUSION_SCALING) - static float Kc[HOTENDS]; - #endif - #define PID_PARAM(param, h) Temperature::param[h] - - #else - - static float Kp, Ki, Kd; - #if ENABLED(PID_EXTRUSION_SCALING) - static float Kc; - #endif - #define PID_PARAM(param, h) Temperature::param - - #endif // PID_PARAMS_PER_HOTEND - - #endif - - #if HAS_HEATED_BED - static float current_temperature_bed; - static int16_t current_temperature_bed_raw, target_temperature_bed; - static uint8_t soft_pwm_amount_bed; - #if ENABLED(PIDTEMPBED) - static float bedKp, bedKi, bedKd; - #endif - #endif - - #if ENABLED(BABYSTEPPING) - static volatile int babystepsTodo[3]; - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - static bool allow_cold_extrude; - static int16_t extrude_min_temp; - FORCE_INLINE static bool tooCold(const int16_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp; } - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degHotend(HOTEND_INDEX)); - } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return tooCold(degTargetHotend(HOTEND_INDEX)); - } - #else - FORCE_INLINE static bool tooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { UNUSED(e); return false; } - #endif - - FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } - - private: - - static volatile bool temp_meas_ready; - static uint16_t raw_temp_value[MAX_EXTRUDERS]; - - #if WATCH_HOTENDS - static uint16_t watch_target_temp[HOTENDS]; - static millis_t watch_heater_next_ms[HOTENDS]; - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static uint16_t redundant_temperature_raw; - static float redundant_temperature; - #endif - - #if ENABLED(PIDTEMP) - static float temp_iState[HOTENDS], - temp_dState[HOTENDS], - pTerm[HOTENDS], - iTerm[HOTENDS], - dTerm[HOTENDS]; - - #if ENABLED(PID_EXTRUSION_SCALING) - static float cTerm[HOTENDS]; - static long last_e_position; - static long lpq[LPQ_MAX_LEN]; - static int lpq_ptr; - #endif - - static float pid_error[HOTENDS]; - static bool pid_reset[HOTENDS]; - #endif - - // Init min and max temp with extreme values to prevent false errors during startup - static int16_t minttemp_raw[HOTENDS], - maxttemp_raw[HOTENDS], - minttemp[HOTENDS], - maxttemp[HOTENDS]; - - #if HAS_HEATED_BED - static uint16_t raw_temp_bed_value; - #if WATCH_THE_BED - static uint16_t watch_target_bed_temp; - static millis_t watch_bed_next_ms; - #endif - #if ENABLED(PIDTEMPBED) - static float temp_iState_bed, - temp_dState_bed, - pTerm_bed, - iTerm_bed, - dTerm_bed, - pid_error_bed; - #else - static millis_t next_bed_check_ms; - #endif - #if HEATER_IDLE_HANDLER - static millis_t bed_idle_timeout_ms; - static bool bed_idle_timeout_exceeded; - #endif - #ifdef BED_MINTEMP - static int16_t bed_minttemp_raw; - #endif - #ifdef BED_MAXTEMP - static int16_t bed_maxttemp_raw; - #endif - #endif - - #if HAS_TEMP_CHAMBER - static uint16_t raw_temp_chamber_value; - static float current_temperature_chamber; - static int16_t current_temperature_chamber_raw; - #endif - - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - static uint8_t consecutive_low_temperature_error[HOTENDS]; - #endif - - #ifdef MILLISECONDS_PREHEAT_TIME - 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 - - #if HEATER_IDLE_HANDLER - static millis_t heater_idle_timeout_ms[HOTENDS]; - static bool heater_idle_timeout_exceeded[HOTENDS]; - #endif - - public: - #if ENABLED(ADC_KEYPAD) - static uint32_t current_ADCKey_raw; - static uint8_t ADCKey_count; - #endif - - #if ENABLED(PID_EXTRUSION_SCALING) - static int16_t lpq_len; - #endif - - /** - * Instance Methods - */ - - Temperature(); - - void init(); - - /** - * Static (class) methods - */ - static float analog2temp(const int raw, const uint8_t e); - - #if HAS_HEATED_BED - static float analog2tempBed(const int raw); - #endif - #if HAS_TEMP_CHAMBER - static float analog2tempChamber(const int raw); - #endif - - /** - * Called from the Temperature ISR - */ - static void readings_ready(); - static void isr(); - - /** - * Call periodically to manage heaters - */ - static void manage_heater() _O2; // Added _O2 to work around a compiler error - - /** - * Preheating hotends - */ - #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); - } - static void start_preheat_time(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; - } - static void reset_preheat_time(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - preheat_end_time[HOTEND_INDEX] = 0; - } - #else - #define is_preheating(n) (false) - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float analog2widthFil(); // 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) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return current_temperature[HOTEND_INDEX]; - } - - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return current_temperature_raw[HOTEND_INDEX]; - } - #endif - - FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX]; - } - - #if WATCH_HOTENDS - static void start_watching_heater(const uint8_t e = 0); - #endif - - static void setTargetHotend(const int16_t celsius, const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - #ifdef MILLISECONDS_PREHEAT_TIME - if (celsius == 0) - reset_preheat_time(HOTEND_INDEX); - else if (target_temperature[HOTEND_INDEX] == 0) - start_preheat_time(HOTEND_INDEX); - #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - target_temperature[HOTEND_INDEX] = celsius; - #if WATCH_HOTENDS - start_watching_heater(HOTEND_INDEX); - #endif - } - - FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] > current_temperature[HOTEND_INDEX]; - } - - FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return target_temperature[HOTEND_INDEX] < current_temperature[HOTEND_INDEX]; - } - - #if HAS_HEATED_BED - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawBedTemp() { return current_temperature_bed_raw; } - #endif - FORCE_INLINE static float degBed() { return current_temperature_bed; } - FORCE_INLINE static int16_t degTargetBed() { return target_temperature_bed; } - FORCE_INLINE static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } - FORCE_INLINE static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } - - static void setTargetBed(const int16_t celsius) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - target_temperature_bed = - #ifdef BED_MAXTEMP - MIN(celsius, BED_MAXTEMP) - #else - celsius - #endif - ; - #if WATCH_THE_BED - start_watching_bed(); - #endif - } - - #if WATCH_THE_BED - static void start_watching_bed(); - #endif - #endif - - #if HAS_TEMP_CHAMBER - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawChamberTemp() { return current_temperature_chamber_raw; } - #endif - FORCE_INLINE static float degChamber() { return current_temperature_chamber; } - #endif - - FORCE_INLINE static bool wait_for_heating(const uint8_t e) { - return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; - } - - /** - * The software PWM power for a heater - */ - static int getHeaterPower(const int heater); - - /** - * Switch off all heaters, set all target temperatures to 0 - */ - static void disable_all_heaters(); - - /** - * Perform auto-tuning for hotend or bed in response to M303 - */ - #if HAS_PID_HEATING - static void PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result=false); - - /** - * Update the temp manager when PID values change - */ - #if ENABLED(PIDTEMP) - FORCE_INLINE static void updatePID() { - #if ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - } - #endif - - #endif - - #if ENABLED(BABYSTEPPING) - - static void babystep_axis(const AxisEnum axis, const int16_t distance) { - if (TEST(axis_known_position, axis)) { - #if IS_CORE - #if ENABLED(BABYSTEP_XY) - switch (axis) { - case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ - babystepsTodo[CORE_AXIS_1] += distance * 2; - babystepsTodo[CORE_AXIS_2] += distance * 2; - break; - case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ - babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); - babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); - break; - case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ - babystepsTodo[NORMAL_AXIS] += distance; - break; - } - #elif CORE_IS_XZ || CORE_IS_YZ - // Only Z stepping needs to be handled here - babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); - babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); - #else - babystepsTodo[Z_AXIS] += distance; - #endif - #else - babystepsTodo[axis] += distance; - #endif - } - } - - #endif // BABYSTEPPING - - #if ENABLED(PROBING_HEATERS_OFF) - static void pause(const bool p); - FORCE_INLINE static bool is_paused() { return paused; } - #endif - - #if HEATER_IDLE_HANDLER - - static void start_heater_idle_timer(const uint8_t e, const millis_t timeout_ms) { - #if HOTENDS == 1 - UNUSED(e); - #endif - heater_idle_timeout_ms[HOTEND_INDEX] = millis() + timeout_ms; - heater_idle_timeout_exceeded[HOTEND_INDEX] = false; - } - - static void reset_heater_idle_timer(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - heater_idle_timeout_ms[HOTEND_INDEX] = 0; - heater_idle_timeout_exceeded[HOTEND_INDEX] = false; - #if WATCH_HOTENDS - start_watching_heater(HOTEND_INDEX); - #endif - } - - FORCE_INLINE static bool is_heater_idle(const uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); - #endif - return heater_idle_timeout_exceeded[HOTEND_INDEX]; - } - - #if HAS_HEATED_BED - static void start_bed_idle_timer(const millis_t timeout_ms) { - bed_idle_timeout_ms = millis() + timeout_ms; - bed_idle_timeout_exceeded = false; - } - - static void reset_bed_idle_timer() { - bed_idle_timeout_ms = 0; - bed_idle_timeout_exceeded = false; - #if WATCH_THE_BED - start_watching_bed(); - #endif - } - - FORCE_INLINE static bool is_bed_idle() { return bed_idle_timeout_exceeded; } - #endif - - #endif // HEATER_IDLE_HANDLER - - #if HAS_TEMP_SENSOR - static void print_heaterstates(); - #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); - FORCE_INLINE void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_temp_interval = v; - next_temp_report_ms = millis() + 1000UL * v; - } - #endif - #endif - - private: - - #if ENABLED(FAST_PWM_FAN) - static void setPwmFrequency(const pin_t pin, int val); - #endif - - static void set_current_temp_raw(); - - static void updateTemperaturesFromRawValues(); - - #if ENABLED(HEATER_0_USES_MAX6675) - static int read_max6675(); - #endif - - static void checkExtruderAutoFans(); - - static float get_pid_output(const int8_t e); - - #if ENABLED(PIDTEMPBED) - static float get_pid_output_bed(); - #endif - - static void _temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg); - static void min_temp_error(const int8_t e); - static void max_temp_error(const int8_t e); - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED - - enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; - - static void thermal_runaway_protection(TRState * const state, millis_t * const timer, const float ¤t, const float &target, const int8_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - static TRState thermal_runaway_state_machine[HOTENDS]; - static millis_t thermal_runaway_timer[HOTENDS]; - #endif - - #if HAS_THERMALLY_PROTECTED_BED - static TRState thermal_runaway_bed_state_machine; - static millis_t thermal_runaway_bed_timer; - #endif - - #endif // THERMAL_PROTECTION - -}; - -extern Temperature thermalManager; - -#endif // TEMPERATURE_H diff --git a/Marlin_thinkerV2/Marlin/thermistornames.h b/Marlin_thinkerV2/Marlin/thermistornames.h deleted file mode 100644 index c26a1fe91c..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistornames.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#undef THERMISTOR_NAME - -// Thermcouples -#if THERMISTOR_ID == -4 - #define THERMISTOR_NAME "AD8495" -#elif THERMISTOR_ID == -3 - #define THERMISTOR_NAME "MAX31855" -#elif THERMISTOR_ID == -2 - #define THERMISTOR_NAME "MAX6675" -#elif THERMISTOR_ID == -1 - #define THERMISTOR_NAME "AD595" - -// Standard thermistors -#elif THERMISTOR_ID == 1 - #define THERMISTOR_NAME "EPCOS 100K" -#elif THERMISTOR_ID == 2 - #define THERMISTOR_NAME "ATC 204GT-2" -#elif THERMISTOR_ID == 3 - #define THERMISTOR_NAME "Mendel-parts" -#elif THERMISTOR_ID == 4 - #define THERMISTOR_NAME "Generic 10K" -#elif THERMISTOR_ID == 5 - #define THERMISTOR_NAME "ATC 104GT-2" -#elif THERMISTOR_ID == 6 - #define THERMISTOR_NAME "EPCOS (alt)" -#elif THERMISTOR_ID == 7 - #define THERMISTOR_NAME "Honeywell 104LAG" -#elif THERMISTOR_ID == 71 - #define THERMISTOR_NAME "Honeywell 104LAF" -#elif THERMISTOR_ID == 8 - #define THERMISTOR_NAME "E3104FHT" -#elif THERMISTOR_ID == 9 - #define THERMISTOR_NAME "GE AL03006" -#elif THERMISTOR_ID == 10 - #define THERMISTOR_NAME "RS 198-961" -#elif THERMISTOR_ID == 11 - #define THERMISTOR_NAME "1% beta 3950" -#elif THERMISTOR_ID == 12 - #define THERMISTOR_NAME "Unknown" -#elif THERMISTOR_ID == 13 - #define THERMISTOR_NAME "Hisens" -#elif THERMISTOR_ID == 20 - #define THERMISTOR_NAME "PT100 UltiMB" -#elif THERMISTOR_ID == 60 - #define THERMISTOR_NAME "Makers Tool" -#elif THERMISTOR_ID == 70 - #define THERMISTOR_NAME "Hephestos 2" -#elif THERMISTOR_ID == 75 - #define THERMISTOR_NAME "MGB18" - -// Modified thermistors -#elif THERMISTOR_ID == 51 - #define THERMISTOR_NAME "EPCOS 1K" -#elif THERMISTOR_ID == 52 - #define THERMISTOR_NAME "ATC204GT-2 1K" -#elif THERMISTOR_ID == 55 - #define THERMISTOR_NAME "ATC104GT-2 1K" -#elif THERMISTOR_ID == 1047 - #define THERMISTOR_NAME "PT1000 4K7" -#elif THERMISTOR_ID == 1010 - #define THERMISTOR_NAME "PT1000 1K" -#elif THERMISTOR_ID == 147 - #define THERMISTOR_NAME "PT100 4K7" -#elif THERMISTOR_ID == 110 - #define THERMISTOR_NAME "PT100 1K" - -// High Temperature thermistors -#elif THERMISTOR_ID == 66 - #define THERMISTOR_NAME "Dyze 4.7M" - -// Dummies for dev testing -#elif THERMISTOR_ID == 998 - #define THERMISTOR_NAME "Dummy 1" -#elif THERMISTOR_ID == 999 - #define THERMISTOR_NAME "Dummy 2" - -#endif // THERMISTOR_ID diff --git a/Marlin_thinkerV2/Marlin/thermistortable_1.h b/Marlin_thinkerV2/Marlin/thermistortable_1.h deleted file mode 100644 index ea887952f5..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_1.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor -const short temptable_1[][2] PROGMEM = { - { OV( 23), 300 }, - { OV( 25), 295 }, - { OV( 27), 290 }, - { OV( 28), 285 }, - { OV( 31), 280 }, - { OV( 33), 275 }, - { OV( 35), 270 }, - { OV( 38), 265 }, - { OV( 41), 260 }, - { OV( 44), 255 }, - { OV( 48), 250 }, - { OV( 52), 245 }, - { OV( 56), 240 }, - { OV( 61), 235 }, - { OV( 66), 230 }, - { OV( 71), 225 }, - { OV( 78), 220 }, - { OV( 84), 215 }, - { OV( 92), 210 }, - { OV( 100), 205 }, - { OV( 109), 200 }, - { OV( 120), 195 }, - { OV( 131), 190 }, - { OV( 143), 185 }, - { OV( 156), 180 }, - { OV( 171), 175 }, - { OV( 187), 170 }, - { OV( 205), 165 }, - { OV( 224), 160 }, - { OV( 245), 155 }, - { OV( 268), 150 }, - { OV( 293), 145 }, - { OV( 320), 140 }, - { OV( 348), 135 }, - { OV( 379), 130 }, - { OV( 411), 125 }, - { OV( 445), 120 }, - { OV( 480), 115 }, - { OV( 516), 110 }, - { OV( 553), 105 }, - { OV( 591), 100 }, - { OV( 628), 95 }, - { OV( 665), 90 }, - { OV( 702), 85 }, - { OV( 737), 80 }, - { OV( 770), 75 }, - { OV( 801), 70 }, - { OV( 830), 65 }, - { OV( 857), 60 }, - { OV( 881), 55 }, - { OV( 903), 50 }, - { OV( 922), 45 }, - { OV( 939), 40 }, - { OV( 954), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_10.h b/Marlin_thinkerV2/Marlin/thermistortable_10.h deleted file mode 100644 index b54425fff8..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_10.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, RS thermistor 198-961 -const short temptable_10[][2] PROGMEM = { - { OV( 1), 929 }, - { OV( 36), 299 }, - { OV( 71), 246 }, - { OV( 106), 217 }, - { OV( 141), 198 }, - { OV( 176), 184 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 154 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 91 }, - { OV( 701), 86 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_1010.h b/Marlin_thinkerV2/Marlin/thermistortable_1010.h deleted file mode 100644 index 79a557954e..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_1010.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt1000 with 1k0 pullup -const short temptable_1010[][2] PROGMEM = { - PtLine( 0, 1000, 1000) - PtLine( 25, 1000, 1000) - PtLine( 50, 1000, 1000) - PtLine( 75, 1000, 1000) - PtLine(100, 1000, 1000) - PtLine(125, 1000, 1000) - PtLine(150, 1000, 1000) - PtLine(175, 1000, 1000) - PtLine(200, 1000, 1000) - PtLine(225, 1000, 1000) - PtLine(250, 1000, 1000) - PtLine(275, 1000, 1000) - PtLine(300, 1000, 1000) -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_1047.h b/Marlin_thinkerV2/Marlin/thermistortable_1047.h deleted file mode 100644 index 01997abc3a..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_1047.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt1000 with 4k7 pullup -const short temptable_1047[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 1000, 4700) - PtLine( 50, 1000, 4700) - PtLine(100, 1000, 4700) - PtLine(150, 1000, 4700) - PtLine(200, 1000, 4700) - PtLine(250, 1000, 4700) - PtLine(300, 1000, 4700) -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_11.h b/Marlin_thinkerV2/Marlin/thermistortable_11.h deleted file mode 100644 index eb8030697f..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_11.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, QU-BD silicone bed QWG-104F-3950 thermistor -const short temptable_11[][2] PROGMEM = { - { OV( 1), 938 }, - { OV( 31), 314 }, - { OV( 41), 290 }, - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 111), 215 }, - { OV( 121), 209 }, - { OV( 131), 204 }, - { OV( 141), 199 }, - { OV( 151), 195 }, - { OV( 161), 190 }, - { OV( 171), 187 }, - { OV( 181), 183 }, - { OV( 191), 179 }, - { OV( 201), 176 }, - { OV( 221), 170 }, - { OV( 241), 165 }, - { OV( 261), 160 }, - { OV( 281), 155 }, - { OV( 301), 150 }, - { OV( 331), 144 }, - { OV( 361), 139 }, - { OV( 391), 133 }, - { OV( 421), 128 }, - { OV( 451), 123 }, - { OV( 491), 117 }, - { OV( 531), 111 }, - { OV( 571), 105 }, - { OV( 611), 100 }, - { OV( 641), 95 }, - { OV( 681), 90 }, - { OV( 711), 85 }, - { OV( 751), 79 }, - { OV( 791), 72 }, - { OV( 811), 69 }, - { OV( 831), 65 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 901), 51 }, - { OV( 921), 45 }, - { OV( 941), 39 }, - { OV( 971), 28 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1021), -27 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_110.h b/Marlin_thinkerV2/Marlin/thermistortable_110.h deleted file mode 100644 index 7a4c80df71..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_110.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt100 with 1k0 pullup -const short temptable_110[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 1000) - PtLine( 50, 100, 1000) - PtLine(100, 100, 1000) - PtLine(150, 100, 1000) - PtLine(200, 100, 1000) - PtLine(250, 100, 1000) - PtLine(300, 100, 1000) -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_12.h b/Marlin_thinkerV2/Marlin/thermistortable_12.h deleted file mode 100644 index c05ba4077b..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_12.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4700 K, 4.7 kOhm pull-up, (personal calibration for Makibox hot bed) -const short temptable_12[][2] PROGMEM = { - { OV( 35), 180 }, // top rating 180C - { OV( 211), 140 }, - { OV( 233), 135 }, - { OV( 261), 130 }, - { OV( 290), 125 }, - { OV( 328), 120 }, - { OV( 362), 115 }, - { OV( 406), 110 }, - { OV( 446), 105 }, - { OV( 496), 100 }, - { OV( 539), 95 }, - { OV( 585), 90 }, - { OV( 629), 85 }, - { OV( 675), 80 }, - { OV( 718), 75 }, - { OV( 758), 70 }, - { OV( 793), 65 }, - { OV( 822), 60 }, - { OV( 841), 55 }, - { OV( 875), 50 }, - { OV( 899), 45 }, - { OV( 926), 40 }, - { OV( 946), 35 }, - { OV( 962), 30 }, - { OV( 977), 25 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1010), 0 }, - { OV(1023), -40 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_13.h b/Marlin_thinkerV2/Marlin/thermistortable_13.h deleted file mode 100644 index b0bfd8aa62..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_13.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, Hisens thermistor -const short temptable_13[][2] PROGMEM = { - { OV( 20.04), 300 }, - { OV( 23.19), 290 }, - { OV( 26.71), 280 }, - { OV( 31.23), 270 }, - { OV( 36.52), 260 }, - { OV( 42.75), 250 }, - { OV( 50.68), 240 }, - { OV( 60.22), 230 }, - { OV( 72.03), 220 }, - { OV( 86.84), 210 }, - { OV(102.79), 200 }, - { OV(124.46), 190 }, - { OV(151.02), 180 }, - { OV(182.86), 170 }, - { OV(220.72), 160 }, - { OV(316.96), 140 }, - { OV(447.17), 120 }, - { OV(590.61), 100 }, - { OV(737.31), 80 }, - { OV(857.77), 60 }, - { OV(939.52), 40 }, - { OV(986.03), 20 }, - { OV(1008.7), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_147.h b/Marlin_thinkerV2/Marlin/thermistortable_147.h deleted file mode 100644 index 7e4a3b6fb6..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_147.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Pt100 with 4k7 pullup -const short temptable_147[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 4700) - PtLine( 50, 100, 4700) - PtLine(100, 100, 4700) - PtLine(150, 100, 4700) - PtLine(200, 100, 4700) - PtLine(250, 100, 4700) - PtLine(300, 100, 4700) -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_15.h b/Marlin_thinkerV2/Marlin/thermistortable_15.h deleted file mode 100644 index 8e207cdca4..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_15.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - // 100k bed thermistor in JGAurora A5. Calibrated by Sam Pinches 21st Jan 2018 using cheap k-type thermocouple inserted into heater block, using TM-902C meter. -const short temptable_15[][2] PROGMEM = { - { OV( 31), 275 }, - { OV( 33), 270 }, - { OV( 35), 260 }, - { OV( 38), 253 }, - { OV( 41), 248 }, - { OV( 48), 239 }, - { OV( 56), 232 }, - { OV( 66), 222 }, - { OV( 78), 212 }, - { OV( 93), 206 }, - { OV( 106), 199 }, - { OV( 118), 191 }, - { OV( 130), 186 }, - { OV( 158), 176 }, - { OV( 187), 167 }, - { OV( 224), 158 }, - { OV( 270), 148 }, - { OV( 321), 137 }, - { OV( 379), 127 }, - { OV( 446), 117 }, - { OV( 518), 106 }, - { OV( 593), 96 }, - { OV( 668), 86 }, - { OV( 739), 76 }, - { OV( 767), 72 }, - { OV( 830), 62 }, - { OV( 902), 48 }, - { OV( 926), 45 }, - { OV( 955), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_2.h b/Marlin_thinkerV2/Marlin/thermistortable_2.h deleted file mode 100644 index e747b2ffad..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_2.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// -// R25 = 200 kOhm, beta25 = 4338 K, 4.7 kOhm pull-up, ATC Semitec 204GT-2 -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// -const short temptable_2[][2] PROGMEM = { - { OV( 1), 848 }, - { OV( 30), 300 }, // top rating 300C - { OV( 34), 290 }, - { OV( 39), 280 }, - { OV( 46), 270 }, - { OV( 53), 260 }, - { OV( 63), 250 }, - { OV( 74), 240 }, - { OV( 87), 230 }, - { OV( 104), 220 }, - { OV( 124), 210 }, - { OV( 148), 200 }, - { OV( 176), 190 }, - { OV( 211), 180 }, - { OV( 252), 170 }, - { OV( 301), 160 }, - { OV( 357), 150 }, - { OV( 420), 140 }, - { OV( 489), 130 }, - { OV( 562), 120 }, - { OV( 636), 110 }, - { OV( 708), 100 }, - { OV( 775), 90 }, - { OV( 835), 80 }, - { OV( 884), 70 }, - { OV( 924), 60 }, - { OV( 955), 50 }, - { OV( 977), 40 }, - { OV( 993), 30 }, - { OV(1004), 20 }, - { OV(1012), 10 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_20.h b/Marlin_thinkerV2/Marlin/thermistortable_20.h deleted file mode 100644 index 1cd9480c80..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_20.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// PT100 with INA826 amp on Ultimaker v2.0 electronics -// The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. -// This does not match the normal thermistor behaviour so we need to set the following defines -#if THERMISTORHEATER_0 == 20 - #define HEATER_0_RAW_HI_TEMP 16383 - #define HEATER_0_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_1 == 20 - #define HEATER_1_RAW_HI_TEMP 16383 - #define HEATER_1_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_2 == 20 - #define HEATER_2_RAW_HI_TEMP 16383 - #define HEATER_2_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_3 == 20 - #define HEATER_3_RAW_HI_TEMP 16383 - #define HEATER_3_RAW_LO_TEMP 0 -#endif -#if THERMISTORHEATER_4 == 20 - #define HEATER_4_RAW_HI_TEMP 16383 - #define HEATER_4_RAW_LO_TEMP 0 -#endif -#if THERMISTORBED == 20 - #define HEATER_BED_RAW_HI_TEMP 16383 - #define HEATER_BED_RAW_LO_TEMP 0 -#endif -#if THERMISTORCHAMBER == 20 - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 -#endif -const short temptable_20[][2] PROGMEM = { - { OV( 0), 0 }, - { OV(227), 1 }, - { OV(236), 10 }, - { OV(245), 20 }, - { OV(253), 30 }, - { OV(262), 40 }, - { OV(270), 50 }, - { OV(279), 60 }, - { OV(287), 70 }, - { OV(295), 80 }, - { OV(304), 90 }, - { OV(312), 100 }, - { OV(320), 110 }, - { OV(329), 120 }, - { OV(337), 130 }, - { OV(345), 140 }, - { OV(353), 150 }, - { OV(361), 160 }, - { OV(369), 170 }, - { OV(377), 180 }, - { OV(385), 190 }, - { OV(393), 200 }, - { OV(401), 210 }, - { OV(409), 220 }, - { OV(417), 230 }, - { OV(424), 240 }, - { OV(432), 250 }, - { OV(440), 260 }, - { OV(447), 270 }, - { OV(455), 280 }, - { OV(463), 290 }, - { OV(470), 300 }, - { OV(478), 310 }, - { OV(485), 320 }, - { OV(493), 330 }, - { OV(500), 340 }, - { OV(507), 350 }, - { OV(515), 360 }, - { OV(522), 370 }, - { OV(529), 380 }, - { OV(537), 390 }, - { OV(544), 400 }, - { OV(614), 500 }, - { OV(681), 600 }, - { OV(744), 700 }, - { OV(805), 800 }, - { OV(862), 900 }, - { OV(917), 1000 }, - { OV(968), 1100 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_3.h b/Marlin_thinkerV2/Marlin/thermistortable_3.h deleted file mode 100644 index a82a9b6ff9..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_3.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4120 K, 4.7 kOhm pull-up, mendel-parts -const short temptable_3[][2] PROGMEM = { - { OV( 1), 864 }, - { OV( 21), 300 }, - { OV( 25), 290 }, - { OV( 29), 280 }, - { OV( 33), 270 }, - { OV( 39), 260 }, - { OV( 46), 250 }, - { OV( 54), 240 }, - { OV( 64), 230 }, - { OV( 75), 220 }, - { OV( 90), 210 }, - { OV( 107), 200 }, - { OV( 128), 190 }, - { OV( 154), 180 }, - { OV( 184), 170 }, - { OV( 221), 160 }, - { OV( 265), 150 }, - { OV( 316), 140 }, - { OV( 375), 130 }, - { OV( 441), 120 }, - { OV( 513), 110 }, - { OV( 588), 100 }, - { OV( 734), 80 }, - { OV( 856), 60 }, - { OV( 938), 40 }, - { OV( 986), 20 }, - { OV(1008), 0 }, - { OV(1018), -20 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_4.h b/Marlin_thinkerV2/Marlin/thermistortable_4.h deleted file mode 100644 index 6c3ea61709..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_4.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 10 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, Generic 10k thermistor -const short temptable_4[][2] PROGMEM = { - { OV( 1), 430 }, - { OV( 54), 137 }, - { OV( 107), 107 }, - { OV( 160), 91 }, - { OV( 213), 80 }, - { OV( 266), 71 }, - { OV( 319), 64 }, - { OV( 372), 57 }, - { OV( 425), 51 }, - { OV( 478), 46 }, - { OV( 531), 41 }, - { OV( 584), 35 }, - { OV( 637), 30 }, - { OV( 690), 25 }, - { OV( 743), 20 }, - { OV( 796), 14 }, - { OV( 849), 7 }, - { OV( 902), 0 }, - { OV( 955), -11 }, - { OV(1008), -35 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_5.h b/Marlin_thinkerV2/Marlin/thermistortable_5.h deleted file mode 100644 index 7f654b1e63..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_5.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4267 K, 4.7 kOhm pull-up -// 100k ParCan thermistor (104GT-2) -// ATC Semitec 104GT-2 (Used in ParCan) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -const short temptable_5[][2] PROGMEM = { - { OV( 1), 713 }, - { OV( 17), 300 }, // top rating 300C - { OV( 20), 290 }, - { OV( 23), 280 }, - { OV( 27), 270 }, - { OV( 31), 260 }, - { OV( 37), 250 }, - { OV( 43), 240 }, - { OV( 51), 230 }, - { OV( 61), 220 }, - { OV( 73), 210 }, - { OV( 87), 200 }, - { OV( 106), 190 }, - { OV( 128), 180 }, - { OV( 155), 170 }, - { OV( 189), 160 }, - { OV( 230), 150 }, - { OV( 278), 140 }, - { OV( 336), 130 }, - { OV( 402), 120 }, - { OV( 476), 110 }, - { OV( 554), 100 }, - { OV( 635), 90 }, - { OV( 713), 80 }, - { OV( 784), 70 }, - { OV( 846), 60 }, - { OV( 897), 50 }, - { OV( 937), 40 }, - { OV( 966), 30 }, - { OV( 986), 20 }, - { OV(1000), 10 }, - { OV(1010), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_501.h b/Marlin_thinkerV2/Marlin/thermistortable_501.h deleted file mode 100644 index 512ac0d8d8..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_501.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// 100k Zonestar thermistor. Adjusted By Hally -const short temptable_501[][2] PROGMEM = { - {OV( 1), 713}, - {OV( 14), 300}, // Top rating 300C - {OV( 16), 290}, - {OV( 19), 280}, - {OV( 23), 270}, - {OV( 27), 260}, - {OV( 32), 250}, - {OV( 30), 240}, - {OV( 47), 230}, - {OV( 57), 220}, - {OV( 68), 210}, - {OV( 84), 200}, - {OV( 100), 190}, - {OV( 128), 180}, - {OV( 155), 170}, - {OV( 189), 160}, - {OV( 230), 150}, - {OV( 278), 140}, - {OV( 336), 130}, - {OV( 402), 120}, - {OV( 476), 110}, - {OV( 554), 100}, - {OV( 635), 90}, - {OV( 713), 80}, - {OV( 784), 70}, - {OV( 846), 60}, - {OV( 897), 50}, - {OV( 937), 40}, - {OV( 966), 30}, - {OV( 986), 20}, - {OV(1000), 10}, - {OV(1010), 0} -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_51.h b/Marlin_thinkerV2/Marlin/thermistortable_51.h deleted file mode 100644 index 0746c70558..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_51.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 1 kOhm pull-up, -// 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: Twice the resolution and better linearity from 150C to 200C -const short temptable_51[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 190), 250 }, // top rating 250C - { OV( 203), 245 }, - { OV( 217), 240 }, - { OV( 232), 235 }, - { OV( 248), 230 }, - { OV( 265), 225 }, - { OV( 283), 220 }, - { OV( 302), 215 }, - { OV( 322), 210 }, - { OV( 344), 205 }, - { OV( 366), 200 }, - { OV( 390), 195 }, - { OV( 415), 190 }, - { OV( 440), 185 }, - { OV( 467), 180 }, - { OV( 494), 175 }, - { OV( 522), 170 }, - { OV( 551), 165 }, - { OV( 580), 160 }, - { OV( 609), 155 }, - { OV( 638), 150 }, - { OV( 666), 145 }, - { OV( 695), 140 }, - { OV( 722), 135 }, - { OV( 749), 130 }, - { OV( 775), 125 }, - { OV( 800), 120 }, - { OV( 823), 115 }, - { OV( 845), 110 }, - { OV( 865), 105 }, - { OV( 884), 100 }, - { OV( 901), 95 }, - { OV( 917), 90 }, - { OV( 932), 85 }, - { OV( 944), 80 }, - { OV( 956), 75 }, - { OV( 966), 70 }, - { OV( 975), 65 }, - { OV( 982), 60 }, - { OV( 989), 55 }, - { OV( 995), 50 }, - { OV(1000), 45 }, - { OV(1004), 40 }, - { OV(1007), 35 }, - { OV(1010), 30 }, - { OV(1013), 25 }, - { OV(1015), 20 }, - { OV(1017), 15 }, - { OV(1018), 10 }, - { OV(1019), 5 }, - { OV(1020), 0 }, - { OV(1021), -5 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_52.h b/Marlin_thinkerV2/Marlin/thermistortable_52.h deleted file mode 100644 index 63b53e1a70..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_52.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 200 kOhm, beta25 = 4338 K, 1 kOhm pull-up, -// 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_52[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 125), 300 }, // top rating 300C - { OV( 142), 290 }, - { OV( 162), 280 }, - { OV( 185), 270 }, - { OV( 211), 260 }, - { OV( 240), 250 }, - { OV( 274), 240 }, - { OV( 312), 230 }, - { OV( 355), 220 }, - { OV( 401), 210 }, - { OV( 452), 200 }, - { OV( 506), 190 }, - { OV( 563), 180 }, - { OV( 620), 170 }, - { OV( 677), 160 }, - { OV( 732), 150 }, - { OV( 783), 140 }, - { OV( 830), 130 }, - { OV( 871), 120 }, - { OV( 906), 110 }, - { OV( 935), 100 }, - { OV( 958), 90 }, - { OV( 976), 80 }, - { OV( 990), 70 }, - { OV(1000), 60 }, - { OV(1008), 50 }, - { OV(1013), 40 }, - { OV(1017), 30 }, - { OV(1019), 20 }, - { OV(1021), 10 }, - { OV(1022), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_55.h b/Marlin_thinkerV2/Marlin/thermistortable_55.h deleted file mode 100644 index aa6677febe..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_55.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4267 K, 1 kOhm pull-up, -// 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_55[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 76), 300 }, - { OV( 87), 290 }, - { OV( 100), 280 }, - { OV( 114), 270 }, - { OV( 131), 260 }, - { OV( 152), 250 }, - { OV( 175), 240 }, - { OV( 202), 230 }, - { OV( 234), 220 }, - { OV( 271), 210 }, - { OV( 312), 200 }, - { OV( 359), 190 }, - { OV( 411), 180 }, - { OV( 467), 170 }, - { OV( 527), 160 }, - { OV( 590), 150 }, - { OV( 652), 140 }, - { OV( 713), 130 }, - { OV( 770), 120 }, - { OV( 822), 110 }, - { OV( 867), 100 }, - { OV( 905), 90 }, - { OV( 936), 80 }, - { OV( 961), 70 }, - { OV( 979), 60 }, - { OV( 993), 50 }, - { OV(1003), 40 }, - { OV(1010), 30 }, - { OV(1015), 20 }, - { OV(1018), 10 }, - { OV(1020), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_6.h b/Marlin_thinkerV2/Marlin/thermistortable_6.h deleted file mode 100644 index bb97267ba9..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_6.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4092 K, 8.2 kOhm pull-up, 100k Epcos (?) thermistor -const short temptable_6[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 28), 250 }, // top rating 250C - { OV( 31), 245 }, - { OV( 35), 240 }, - { OV( 39), 235 }, - { OV( 42), 230 }, - { OV( 44), 225 }, - { OV( 49), 220 }, - { OV( 53), 215 }, - { OV( 62), 210 }, - { OV( 71), 205 }, // fitted graphically - { OV( 78), 200 }, // fitted graphically - { OV( 94), 190 }, - { OV( 102), 185 }, - { OV( 116), 170 }, - { OV( 143), 160 }, - { OV( 183), 150 }, - { OV( 223), 140 }, - { OV( 270), 130 }, - { OV( 318), 120 }, - { OV( 383), 110 }, - { OV( 413), 105 }, - { OV( 439), 100 }, - { OV( 484), 95 }, - { OV( 513), 90 }, - { OV( 607), 80 }, - { OV( 664), 70 }, - { OV( 781), 60 }, - { OV( 810), 55 }, - { OV( 849), 50 }, - { OV( 914), 45 }, - { OV( 914), 40 }, - { OV( 935), 35 }, - { OV( 954), 30 }, - { OV( 970), 25 }, - { OV( 978), 22 }, - { OV(1008), 3 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_60.h b/Marlin_thinkerV2/Marlin/thermistortable_60.h deleted file mode 100644 index ab92406f46..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_60.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, -// Maker's Tool Works Kapton Bed Thermistor -// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 -// r0: 100000 -// t0: 25 -// r1: 0 (parallel with rTherm) -// r2: 4700 (series with rTherm) -// beta: 3950 -// min adc: 1 at 0.0048828125 V -// max adc: 1023 at 4.9951171875 V -const short temptable_60[][2] PROGMEM = { - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 131), 204 }, - { OV( 161), 190 }, - { OV( 191), 179 }, - { OV( 231), 167 }, - { OV( 271), 157 }, - { OV( 311), 148 }, - { OV( 351), 140 }, - { OV( 381), 135 }, - { OV( 411), 130 }, - { OV( 441), 125 }, - { OV( 451), 123 }, - { OV( 461), 122 }, - { OV( 471), 120 }, - { OV( 481), 119 }, - { OV( 491), 117 }, - { OV( 501), 116 }, - { OV( 511), 114 }, - { OV( 521), 113 }, - { OV( 531), 111 }, - { OV( 541), 110 }, - { OV( 551), 108 }, - { OV( 561), 107 }, - { OV( 571), 105 }, - { OV( 581), 104 }, - { OV( 591), 102 }, - { OV( 601), 101 }, - { OV( 611), 100 }, - { OV( 621), 98 }, - { OV( 631), 97 }, - { OV( 641), 95 }, - { OV( 651), 94 }, - { OV( 661), 92 }, - { OV( 671), 91 }, - { OV( 681), 90 }, - { OV( 691), 88 }, - { OV( 701), 87 }, - { OV( 711), 85 }, - { OV( 721), 84 }, - { OV( 731), 82 }, - { OV( 741), 81 }, - { OV( 751), 79 }, - { OV( 761), 77 }, - { OV( 771), 76 }, - { OV( 781), 74 }, - { OV( 791), 72 }, - { OV( 801), 71 }, - { OV( 811), 69 }, - { OV( 821), 67 }, - { OV( 831), 65 }, - { OV( 841), 63 }, - { OV( 851), 62 }, - { OV( 861), 60 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 891), 53 }, - { OV( 901), 51 }, - { OV( 911), 48 }, - { OV( 921), 45 }, - { OV( 931), 42 }, - { OV( 941), 39 }, - { OV( 951), 36 }, - { OV( 961), 32 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1008), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_66.h b/Marlin_thinkerV2/Marlin/thermistortable_66.h deleted file mode 100644 index 7fb9a2d20c..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_66.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor -const short temptable_66[][2] PROGMEM = { - { OV( 17.5), 850 }, - { OV( 17.9), 500 }, - { OV( 21.7), 480 }, - { OV( 26.6), 460 }, - { OV( 33.1), 440 }, - { OV( 41.0), 420 }, - { OV( 52.3), 400 }, - { OV( 67.7), 380 }, - { OV( 86.5), 360 }, - { OV( 112.0), 340 }, - { OV( 147.2), 320 }, - { OV( 194.0), 300 }, - { OV( 254.3), 280 }, - { OV( 330.2), 260 }, - { OV( 427.9), 240 }, - { OV( 533.4), 220 }, - { OV( 646.5), 200 }, - { OV( 754.4), 180 }, - { OV( 844.3), 160 }, - { OV( 911.7), 140 }, - { OV( 958.6), 120 }, - { OV( 988.8), 100 }, - { OV(1006.6), 80 }, - { OV(1015.8), 60 }, - { OV(1021.3), 30 }, - { OV(1023) - 1, 25}, - { OV( 1023), 20} -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_7.h b/Marlin_thinkerV2/Marlin/thermistortable_7.h deleted file mode 100644 index 025c53ce97..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_7.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAG-J01 -const short temptable_7[][2] PROGMEM = { - { OV( 1), 941 }, - { OV( 19), 362 }, - { OV( 37), 299 }, // top rating 300C - { OV( 55), 266 }, - { OV( 73), 245 }, - { OV( 91), 229 }, - { OV( 109), 216 }, - { OV( 127), 206 }, - { OV( 145), 197 }, - { OV( 163), 190 }, - { OV( 181), 183 }, - { OV( 199), 177 }, - { OV( 217), 171 }, - { OV( 235), 166 }, - { OV( 253), 162 }, - { OV( 271), 157 }, - { OV( 289), 153 }, - { OV( 307), 149 }, - { OV( 325), 146 }, - { OV( 343), 142 }, - { OV( 361), 139 }, - { OV( 379), 135 }, - { OV( 397), 132 }, - { OV( 415), 129 }, - { OV( 433), 126 }, - { OV( 451), 123 }, - { OV( 469), 121 }, - { OV( 487), 118 }, - { OV( 505), 115 }, - { OV( 523), 112 }, - { OV( 541), 110 }, - { OV( 559), 107 }, - { OV( 577), 105 }, - { OV( 595), 102 }, - { OV( 613), 99 }, - { OV( 631), 97 }, - { OV( 649), 94 }, - { OV( 667), 92 }, - { OV( 685), 89 }, - { OV( 703), 86 }, - { OV( 721), 84 }, - { OV( 739), 81 }, - { OV( 757), 78 }, - { OV( 775), 75 }, - { OV( 793), 72 }, - { OV( 811), 69 }, - { OV( 829), 66 }, - { OV( 847), 62 }, - { OV( 865), 59 }, - { OV( 883), 55 }, - { OV( 901), 51 }, - { OV( 919), 46 }, - { OV( 937), 41 }, - { OV( 955), 35 }, - { OV( 973), 27 }, - { OV( 991), 17 }, - { OV(1009), 1 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_70.h b/Marlin_thinkerV2/Marlin/thermistortable_70.h deleted file mode 100644 index 2f9434e300..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_70.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Stock BQ Hephestos 2 100k thermistor. -// Created on 29/12/2017 with an ambient temperature of 20C. -// ANENG AN8009 DMM with a K-type probe used for measurements. - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, bqh2 stock thermistor -const short temptable_70[][2] PROGMEM = { - { OV( 18), 270 }, - { OV( 27), 248 }, - { OV( 34), 234 }, - { OV( 45), 220 }, - { OV( 61), 205 }, - { OV( 86), 188 }, - { OV( 123), 172 }, - { OV( 420), 110 }, - { OV( 590), 90 }, - { OV( 845), 56 }, - { OV( 970), 25 }, - { OV( 986), 20 }, - { OV( 994), 15 }, - { OV(1000), 10 }, - { OV(1005), 5 }, - { OV(1009), 0 } // safety -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_71.h b/Marlin_thinkerV2/Marlin/thermistortable_71.h deleted file mode 100644 index f28a4ceabb..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_71.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAF-J01 -// R0 = 100000 Ohm -// T0 = 25 °C -// Beta = 3974 -// R1 = 0 Ohm -// R2 = 4700 Ohm -const short temptable_71[][2] PROGMEM = { - { OV( 35), 300 }, - { OV( 51), 269 }, - { OV( 59), 258 }, - { OV( 64), 252 }, - { OV( 71), 244 }, - { OV( 81), 235 }, - { OV( 87), 230 }, - { OV( 92), 226 }, - { OV( 102), 219 }, - { OV( 110), 214 }, - { OV( 115), 211 }, - { OV( 126), 205 }, - { OV( 128), 204 }, - { OV( 130), 203 }, - { OV( 132), 202 }, - { OV( 134), 201 }, - { OV( 136), 200 }, - { OV( 147), 195 }, - { OV( 154), 192 }, - { OV( 159), 190 }, - { OV( 164), 188 }, - { OV( 172), 185 }, - { OV( 175), 184 }, - { OV( 178), 183 }, - { OV( 181), 182 }, - { OV( 184), 181 }, - { OV( 187), 180 }, - { OV( 190), 179 }, - { OV( 193), 178 }, - { OV( 196), 177 }, - { OV( 199), 176 }, - { OV( 202), 175 }, - { OV( 205), 174 }, - { OV( 208), 173 }, - { OV( 215), 171 }, - { OV( 237), 165 }, - { OV( 256), 160 }, - { OV( 300), 150 }, - { OV( 351), 140 }, - { OV( 470), 120 }, - { OV( 504), 115 }, - { OV( 538), 110 }, - { OV( 745), 80 }, - { OV( 770), 76 }, - { OV( 806), 70 }, - { OV( 829), 66 }, - { OV( 860), 60 }, - { OV( 879), 56 }, - { OV( 888), 54 }, - { OV( 905), 50 }, - { OV( 924), 45 }, - { OV( 940), 40 }, - { OV( 955), 35 }, - { OV( 972), 28 }, - { OV( 974), 27 }, - { OV( 976), 26 }, - { OV( 978), 25 }, - { OV( 980), 24 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1006), 5 }, - { OV(1010), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_75.h b/Marlin_thinkerV2/Marlin/thermistortable_75.h deleted file mode 100644 index dda764949f..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_75.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, -// Generic Silicon Heat Pad with NTC 100K thermistor -// -// Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor It is used for various -// wattage and voltage heat pads. This table is correct if this part is used. It has been -// optimized to provide good granularity around the 60 C. and 110 C. which corrisponds to bed temperatures -// for PLA and ABS. If you are printing higher temperature filament such as nylon you can uncomment -// the higher earlier entries in the table to give better accuracy. But for speed reasons, if these -// temperatures are not going to be used, it is better to leave them commented out. - -const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor - { OV( 111.06), 200 }, // v=0.542 r=571.747 res=0.501 degC/count -// { OV( 174.87), 175 }, // v=0.854 r=967.950 res=0.311 degC/count These values are valid. But they serve no -// { OV( 191.64), 170 }, // v=0.936 r=1082.139 res=0.284 degC/count purpose. It is better to delete them so -// { OV( 209.99), 165 }, // v=1.025 r=1212.472 res=0.260 degC/count the search is quicker and get to the meaningful -// { OV( 230.02), 160 }, // v=1.123 r=1361.590 res=0.239 degC/count part of the table sooner. -// { OV( 251.80), 155 }, // v=1.230 r=1532.621 res=0.220 degC/count - { OV( 275.43), 150 }, // v=1.345 r=1729.283 res=0.203 degC/count -// { OV( 300.92), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun - { 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_thinkerV2/Marlin/thermistortable_8.h b/Marlin_thinkerV2/Marlin/thermistortable_8.h deleted file mode 100644 index 3ef78da0c5..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_8.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3950 K, 10 kOhm pull-up, NTCS0603E3104FHT -const short temptable_8[][2] PROGMEM = { - { OV( 1), 704 }, - { OV( 54), 216 }, - { OV( 107), 175 }, - { OV( 160), 152 }, - { OV( 213), 137 }, - { OV( 266), 125 }, - { OV( 319), 115 }, - { OV( 372), 106 }, - { OV( 425), 99 }, - { OV( 478), 91 }, - { OV( 531), 85 }, - { OV( 584), 78 }, - { OV( 637), 71 }, - { OV( 690), 65 }, - { OV( 743), 58 }, - { OV( 796), 50 }, - { OV( 849), 42 }, - { OV( 902), 31 }, - { OV( 955), 17 }, - { OV(1008), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_9.h b/Marlin_thinkerV2/Marlin/thermistortable_9.h deleted file mode 100644 index e9ef924d1f..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_9.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, GE Sensing AL03006-58.2K-97-G1 -const short temptable_9[][2] PROGMEM = { - { OV( 1), 936 }, - { OV( 36), 300 }, - { OV( 71), 246 }, - { OV( 106), 218 }, - { OV( 141), 199 }, - { OV( 176), 185 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 155 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 92 }, - { OV( 701), 87 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_998.h b/Marlin_thinkerV2/Marlin/thermistortable_998.h deleted file mode 100644 index 66becc7029..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_998.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// User-defined table 1 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_998_VALUE - #define DUMMY_THERMISTOR_998_VALUE 25 -#endif - -const short temptable_998[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_998_VALUE }, - { OV(1023), DUMMY_THERMISTOR_998_VALUE } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortable_999.h b/Marlin_thinkerV2/Marlin/thermistortable_999.h deleted file mode 100644 index ea45952f60..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortable_999.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// User-defined table 2 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_999_VALUE - #define DUMMY_THERMISTOR_999_VALUE 25 -#endif - -const short temptable_999[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_999_VALUE }, - { OV(1023), DUMMY_THERMISTOR_999_VALUE } -}; diff --git a/Marlin_thinkerV2/Marlin/thermistortables.h b/Marlin_thinkerV2/Marlin/thermistortables.h deleted file mode 100644 index a65d3eb501..0000000000 --- a/Marlin_thinkerV2/Marlin/thermistortables.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef THERMISTORTABLES_H_ -#define THERMISTORTABLES_H_ - -#include "Marlin.h" -#include "macros.h" - -#define OVERSAMPLENR 16 -#define OV(N) int16_t((N)*(OVERSAMPLENR)) - -#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n || THERMISTORCHAMBER == n) - -// Pt1000 and Pt100 handling -// -// Rt=R0*(1+a*T+b*T*T) [for T>0] -// a=3.9083E-3, b=-5.775E-7 -#define PtA 3.9083E-3 -#define PtB -5.775E-7 -#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T))) -#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1)) -#define PtLine(T,R0,Rup) { OV(PtAdVal(T,R0,Rup)), T }, - -#if ANY_THERMISTOR_IS(1) // 100k bed thermistor - #include "thermistortable_1.h" -#endif -#if ANY_THERMISTOR_IS(2) // 200k bed thermistor - #include "thermistortable_2.h" -#endif -#if ANY_THERMISTOR_IS(3) // mendel-parts - #include "thermistortable_3.h" -#endif -#if ANY_THERMISTOR_IS(4) // 10k thermistor - #include "thermistortable_4.h" -#endif -#if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2) - #include "thermistortable_5.h" -#endif -#if ANY_THERMISTOR_IS(501) // 100k Zonestar thermistor - #include "thermistortable_501.h" -#endif -#if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor - #include "thermistortable_6.h" -#endif -#if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01 - #include "thermistortable_7.h" -#endif -#if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01 - #include "thermistortable_71.h" -#endif -#if ANY_THERMISTOR_IS(8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) - #include "thermistortable_8.h" -#endif -#if ANY_THERMISTOR_IS(9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) - #include "thermistortable_9.h" -#endif -#if ANY_THERMISTOR_IS(10) // 100k RS thermistor 198-961 (4.7k pullup) - #include "thermistortable_10.h" -#endif -#if ANY_THERMISTOR_IS(11) // QU-BD silicone bed QWG-104F-3950 thermistor - #include "thermistortable_11.h" -#endif -#if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1% - #include "thermistortable_13.h" -#endif -#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration - #include "thermistortable_15.h" -#endif -#if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics - #include "thermistortable_20.h" -#endif -#if ANY_THERMISTOR_IS(51) // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_51.h" -#endif -#if ANY_THERMISTOR_IS(52) // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_52.h" -#endif -#if ANY_THERMISTOR_IS(55) // 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) - #include "thermistortable_55.h" -#endif -#if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor - #include "thermistortable_60.h" -#endif -#if ANY_THERMISTOR_IS(66) // DyzeDesign 500°C Thermistor - #include "thermistortable_66.h" -#endif -#if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) - #include "thermistortable_12.h" -#endif -#if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor - #include "thermistortable_70.h" -#endif -#if ANY_THERMISTOR_IS(75) // Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor - #include "thermistortable_75.h" -#endif -#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup - #include "thermistortable_110.h" -#endif -#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup - #include "thermistortable_147.h" -#endif -#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup - #include "thermistortable_1010.h" -#endif -#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup - #include "thermistortable_1047.h" -#endif -#if ANY_THERMISTOR_IS(998) // User-defined table 1 - #include "thermistortable_998.h" -#endif -#if ANY_THERMISTOR_IS(999) // User-defined table 2 - #include "thermistortable_999.h" -#endif - -#define _TT_NAME(_N) temptable_ ## _N -#define TT_NAME(_N) _TT_NAME(_N) - -#if THERMISTORHEATER_0 - #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0) - #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) -#elif defined(HEATER_0_USES_THERMISTOR) - #error "No heater 0 thermistor table specified" -#else - #define HEATER_0_TEMPTABLE NULL - #define HEATER_0_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_1 - #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1) - #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) -#elif defined(HEATER_1_USES_THERMISTOR) - #error "No heater 1 thermistor table specified" -#else - #define HEATER_1_TEMPTABLE NULL - #define HEATER_1_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_2 - #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2) - #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) -#elif defined(HEATER_2_USES_THERMISTOR) - #error "No heater 2 thermistor table specified" -#else - #define HEATER_2_TEMPTABLE NULL - #define HEATER_2_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_3 - #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3) - #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) -#elif defined(HEATER_3_USES_THERMISTOR) - #error "No heater 3 thermistor table specified" -#else - #define HEATER_3_TEMPTABLE NULL - #define HEATER_3_TEMPTABLE_LEN 0 -#endif - -#if THERMISTORHEATER_4 - #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4) - #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) -#elif defined(HEATER_4_USES_THERMISTOR) - #error "No heater 4 thermistor table specified" -#else - #define HEATER_4_TEMPTABLE NULL - #define HEATER_4_TEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORBED - #define BEDTEMPTABLE TT_NAME(THERMISTORBED) - #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) - #error "No bed thermistor table specified" -#else - #define BEDTEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORCHAMBER - #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER) - #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) - #error "No chamber thermistor table specified" -#else - #define CHAMBERTEMPTABLE_LEN 0 -#endif - -// The SCAN_THERMISTOR_TABLE macro needs alteration? -static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && BEDTEMPTABLE_LEN < 256 && CHAMBERTEMPTABLE_LEN < 256, - "Temperature conversion tables over 255 entries need special consideration." -); - -// Set the high and low raw values for the heaters -// For thermistors the highest temperature results in the lowest ADC value -// For thermocouples the highest temperature results in the highest ADC value -#ifndef HEATER_0_RAW_HI_TEMP - #ifdef HEATER_0_USES_THERMISTOR - #define HEATER_0_RAW_HI_TEMP 0 - #define HEATER_0_RAW_LO_TEMP 16383 - #else - #define HEATER_0_RAW_HI_TEMP 16383 - #define HEATER_0_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_1_RAW_HI_TEMP - #ifdef HEATER_1_USES_THERMISTOR - #define HEATER_1_RAW_HI_TEMP 0 - #define HEATER_1_RAW_LO_TEMP 16383 - #else - #define HEATER_1_RAW_HI_TEMP 16383 - #define HEATER_1_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_2_RAW_HI_TEMP - #ifdef HEATER_2_USES_THERMISTOR - #define HEATER_2_RAW_HI_TEMP 0 - #define HEATER_2_RAW_LO_TEMP 16383 - #else - #define HEATER_2_RAW_HI_TEMP 16383 - #define HEATER_2_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_3_RAW_HI_TEMP - #ifdef HEATER_3_USES_THERMISTOR - #define HEATER_3_RAW_HI_TEMP 0 - #define HEATER_3_RAW_LO_TEMP 16383 - #else - #define HEATER_3_RAW_HI_TEMP 16383 - #define HEATER_3_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_4_RAW_HI_TEMP - #ifdef HEATER_4_USES_THERMISTOR - #define HEATER_4_RAW_HI_TEMP 0 - #define HEATER_4_RAW_LO_TEMP 16383 - #else - #define HEATER_4_RAW_HI_TEMP 16383 - #define HEATER_4_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_BED_RAW_HI_TEMP - #ifdef HEATER_BED_USES_THERMISTOR - #define HEATER_BED_RAW_HI_TEMP 0 - #define HEATER_BED_RAW_LO_TEMP 16383 - #else - #define HEATER_BED_RAW_HI_TEMP 16383 - #define HEATER_BED_RAW_LO_TEMP 0 - #endif -#endif -#ifndef HEATER_CHAMBER_RAW_HI_TEMP - #ifdef HEATER_CHAMBER_USES_THERMISTOR - #define HEATER_CHAMBER_RAW_HI_TEMP 0 - #define HEATER_CHAMBER_RAW_LO_TEMP 16383 - #else - #define HEATER_CHAMBER_RAW_HI_TEMP 16383 - #define HEATER_CHAMBER_RAW_LO_TEMP 0 - #endif -#endif - -#endif // THERMISTORTABLES_H_ diff --git a/Marlin_thinkerV2/Marlin/tmc_util.cpp b/Marlin_thinkerV2/Marlin/tmc_util.cpp deleted file mode 100644 index 2e9ba5575c..0000000000 --- a/Marlin_thinkerV2/Marlin/tmc_util.cpp +++ /dev/null @@ -1,631 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "tmc_util.h" -#include "Marlin.h" -#include "printcounter.h" -#include "duration_t.h" -#include "stepper_indirection.h" - -#if ENABLED(TMC_DEBUG) - #include "planner.h" -#endif - -bool report_tmc_status = false; - -/** - * Check for over temperature or short to ground error flags. - * Report and log warning of overtemperature condition. - * Reduce driver current in a persistent otpw condition. - * Keep track of otpw counter so we don't reduce current on a single instance, - * and so we don't repeatedly report warning before the condition is cleared. - */ -#if ENABLED(MONITOR_DRIVER_STATUS) - struct TMC_driver_data { - uint32_t drv_status; - bool is_otpw; - bool is_ot; - bool is_error; - }; - #if HAS_DRIVER(TMC2130) - static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); } - static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response & 0xF; } - static TMC_driver_data get_driver_data(TMC2130Stepper &st) { - constexpr uint32_t OTPW_bm = 0x4000000UL; - constexpr uint8_t OTPW_bp = 26; - constexpr uint32_t OT_bm = 0x2000000UL; - constexpr uint8_t OT_bp = 25; - constexpr uint8_t DRIVER_ERROR_bm = 0x2UL; - constexpr uint8_t DRIVER_ERROR_bp = 1; - TMC_driver_data data; - data.drv_status = st.DRV_STATUS(); - data.is_otpw = (data.drv_status & OTPW_bm) >> OTPW_bp; - data.is_ot = (data.drv_status & OT_bm) >> OT_bp; - data.is_error = (st.status_response & DRIVER_ERROR_bm) >> DRIVER_ERROR_bp; - return data; - } - #endif - #if HAS_DRIVER(TMC2208) - static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } - static uint8_t get_status_response(TMC2208Stepper &st) { - uint32_t drv_status = st.DRV_STATUS(); - uint8_t gstat = st.GSTAT(); - uint8_t response = 0; - response |= (drv_status >> (31-3)) & 0b1000; - response |= gstat & 0b11; - return response; - } - static TMC_driver_data get_driver_data(TMC2208Stepper &st) { - constexpr uint32_t OTPW_bm = 0b1ul; - constexpr uint8_t OTPW_bp = 0; - constexpr uint32_t OT_bm = 0b10ul; - constexpr uint8_t OT_bp = 1; - TMC_driver_data data; - data.drv_status = st.DRV_STATUS(); - data.is_otpw = (data.drv_status & OTPW_bm) >> OTPW_bp; - data.is_ot = (data.drv_status & OT_bm) >> OT_bp; - data.is_error = st.drv_err(); - return data; - } - #endif - - template - void monitor_tmc_driver(TMC &st, const TMC_AxisEnum axis, uint8_t &otpw_cnt) { - TMC_driver_data data = get_driver_data(st); - - #if ENABLED(STOP_ON_ERROR) - if (data.is_error) { - SERIAL_EOL(); - _tmc_say_axis(axis); - SERIAL_ECHOLNPGM(" driver error detected:"); - if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature"); - if (st.s2ga()) SERIAL_ECHOLNPGM("short to ground (coil A)"); - if (st.s2gb()) SERIAL_ECHOLNPGM("short to ground (coil B)"); - #if ENABLED(TMC_DEBUG) - tmc_report_all(); - #endif - kill(PSTR("Driver error")); - } - #endif - - // Report if a warning was triggered - if (data.is_otpw && otpw_cnt == 0) { - char timestamp[10]; - duration_t elapsed = print_job_timer.duration(); - const bool has_days = (elapsed.value > 60*60*24L); - (void)elapsed.toDigital(timestamp, has_days); - SERIAL_EOL(); - SERIAL_ECHO(timestamp); - SERIAL_ECHOPGM(": "); - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" driver overtemperature warning! ("); - SERIAL_ECHO(st.getCurrent()); - SERIAL_ECHOLNPGM("mA)"); - } - #if CURRENT_STEP_DOWN > 0 - // Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings - if (data.is_otpw && st.isEnabled() && otpw_cnt > 4) { - st.setCurrent(st.getCurrent() - CURRENT_STEP_DOWN, R_SENSE, HOLD_MULTIPLIER); - #if ENABLED(REPORT_CURRENT_CHANGE) - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" current decreased to ", st.getCurrent()); - #endif - } - #endif - - if (data.is_otpw) { - otpw_cnt++; - st.flag_otpw = true; - } - else if (otpw_cnt > 0) otpw_cnt = 0; - - if (report_tmc_status) { - const uint32_t pwm_scale = get_pwm_scale(st); - _tmc_say_axis(axis); - SERIAL_ECHOPAIR(":", pwm_scale); - SERIAL_ECHOPGM(" |0b"); SERIAL_PRINT(get_status_response(st), BIN); - SERIAL_ECHOPGM("| "); - if (data.is_error) SERIAL_CHAR('E'); - else if (data.is_ot) SERIAL_CHAR('O'); - else if (data.is_otpw) SERIAL_CHAR('W'); - else if (otpw_cnt > 0) SERIAL_PRINT(otpw_cnt, DEC); - else if (st.flag_otpw) SERIAL_CHAR('F'); - SERIAL_CHAR('\t'); - } - } - - #define HAS_HW_COMMS(ST) AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && defined(ST##_HARDWARE_SERIAL)) - - void monitor_tmc_driver() { - static millis_t next_cOT = 0; - if (ELAPSED(millis(), next_cOT)) { - next_cOT = millis() + 500; - #if HAS_HW_COMMS(X) - static uint8_t x_otpw_cnt = 0; - monitor_tmc_driver(stepperX, TMC_X, x_otpw_cnt); - #endif - #if HAS_HW_COMMS(Y) - static uint8_t y_otpw_cnt = 0; - monitor_tmc_driver(stepperY, TMC_Y, y_otpw_cnt); - #endif - #if HAS_HW_COMMS(Z) - static uint8_t z_otpw_cnt = 0; - monitor_tmc_driver(stepperZ, TMC_Z, z_otpw_cnt); - #endif - #if HAS_HW_COMMS(X2) - static uint8_t x2_otpw_cnt = 0; - monitor_tmc_driver(stepperX2, TMC_X, x2_otpw_cnt); - #endif - #if HAS_HW_COMMS(Y2) - static uint8_t y2_otpw_cnt = 0; - monitor_tmc_driver(stepperY2, TMC_Y, y2_otpw_cnt); - #endif - #if HAS_HW_COMMS(Z2) - static uint8_t z2_otpw_cnt = 0; - monitor_tmc_driver(stepperZ2, TMC_Z, z2_otpw_cnt); - #endif - #if HAS_HW_COMMS(E0) - static uint8_t e0_otpw_cnt = 0; - monitor_tmc_driver(stepperE0, TMC_E0, e0_otpw_cnt); - #endif - #if HAS_HW_COMMS(E1) - static uint8_t e1_otpw_cnt = 0; - monitor_tmc_driver(stepperE1, TMC_E1, e1_otpw_cnt); - #endif - #if HAS_HW_COMMS(E2) - static uint8_t e2_otpw_cnt = 0; - monitor_tmc_driver(stepperE2, TMC_E2, e2_otpw_cnt); - #endif - #if HAS_HW_COMMS(E3) - static uint8_t e3_otpw_cnt = 0; - monitor_tmc_driver(stepperE3, TMC_E3, e3_otpw_cnt); - #endif - #if HAS_HW_COMMS(E4) - static uint8_t e4_otpw_cnt = 0; - monitor_tmc_driver(stepperE4, TMC_E4, e4_otpw_cnt); - #endif - - if (report_tmc_status) SERIAL_EOL(); - } - } - -#endif // MONITOR_DRIVER_STATUS - -void _tmc_say_axis(const TMC_AxisEnum axis) { - static const char ext_X[] PROGMEM = "X", ext_Y[] PROGMEM = "Y", ext_Z[] PROGMEM = "Z", - ext_X2[] PROGMEM = "X2", ext_Y2[] PROGMEM = "Y2", ext_Z2[] PROGMEM = "Z2", - ext_E0[] PROGMEM = "E0", ext_E1[] PROGMEM = "E1", - ext_E2[] PROGMEM = "E2", ext_E3[] PROGMEM = "E3", - ext_E4[] PROGMEM = "E4"; - static const char* const tmc_axes[] PROGMEM = { ext_X, ext_Y, ext_Z, ext_X2, ext_Y2, ext_Z2, ext_E0, ext_E1, ext_E2, ext_E3, ext_E4 }; - serialprintPGM((char*)pgm_read_ptr(&tmc_axes[axis])); -} - -void _tmc_say_current(const TMC_AxisEnum axis, const uint16_t curr) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" driver current: ", curr); -} -void _tmc_say_otpw(const TMC_AxisEnum axis, const bool otpw) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" temperature prewarn triggered: "); - serialprintPGM(otpw ? PSTR("true") : PSTR("false")); - SERIAL_EOL(); -} -void _tmc_say_otpw_cleared(const TMC_AxisEnum axis) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPGM(" prewarn flag cleared"); -} -void _tmc_say_pwmthrs(const TMC_AxisEnum axis, const uint32_t thrs) { - _tmc_say_axis(axis); - SERIAL_ECHOLNPAIR(" stealthChop max speed: ", thrs); -} -void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" homing sensitivity: "); - SERIAL_PRINTLN(sgt, DEC); -} - -#if ENABLED(TMC_DEBUG) - - enum TMC_debug_enum : char { - TMC_CODES, - TMC_ENABLED, - TMC_CURRENT, - TMC_RMS_CURRENT, - TMC_MAX_CURRENT, - TMC_IRUN, - TMC_IHOLD, - TMC_CS_ACTUAL, - TMC_PWM_SCALE, - TMC_VSENSE, - TMC_STEALTHCHOP, - TMC_MICROSTEPS, - TMC_TSTEP, - TMC_TPWMTHRS, - TMC_TPWMTHRS_MMS, - TMC_OTPW, - TMC_OTPW_TRIGGERED, - TMC_TOFF, - TMC_TBL, - TMC_HEND, - TMC_HSTRT, - TMC_SGT - }; - enum TMC_drv_status_enum : char { - TMC_DRV_CODES, - TMC_STST, - TMC_OLB, - TMC_OLA, - TMC_S2GB, - TMC_S2GA, - TMC_DRV_OTPW, - TMC_OT, - TMC_STALLGUARD, - TMC_DRV_CS_ACTUAL, - TMC_FSACTIVE, - TMC_SG_RESULT, - TMC_DRV_STATUS_HEX, - TMC_T157, - TMC_T150, - TMC_T143, - TMC_T120, - TMC_STEALTH, - TMC_S2VSB, - TMC_S2VSA - }; - static void drv_status_print_hex(const TMC_AxisEnum axis, const uint32_t drv_status) { - _tmc_say_axis(axis); - SERIAL_ECHOPGM(" = 0x"); - for (int B = 24; B >= 8; B -= 8){ - SERIAL_PRINT((drv_status >> (B + 4)) & 0xF, HEX); - SERIAL_PRINT((drv_status >> B) & 0xF, HEX); - SERIAL_CHAR(':'); - } - SERIAL_PRINT((drv_status >> 4) & 0xF, HEX); - SERIAL_PRINT((drv_status) & 0xF, HEX); - SERIAL_EOL(); - } - - #if HAS_DRIVER(TMC2130) - static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; - case TMC_TSTEP: SERIAL_ECHO(st.TSTEP()); break; - case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; - case TMC_STEALTHCHOP: serialprintPGM(st.stealthChop() ? PSTR("true") : PSTR("false")); break; - default: break; - } - } - static void tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('X'); break; - case TMC_SG_RESULT: SERIAL_PRINT(st.sg_result(), DEC); break; - case TMC_FSACTIVE: if (st.fsactive()) SERIAL_CHAR('X'); break; - default: break; - } - } - #endif - - #if HAS_DRIVER(TMC2208) - static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; } - case TMC_PWM_SCALE: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; - case TMC_STEALTHCHOP: serialprintPGM(st.stealth() ? PSTR("true") : PSTR("false")); break; - case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('X'); break; - case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('X'); break; - default: break; - } - } - static void tmc_parse_drv_status(TMC2208Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_T157: if (st.t157()) SERIAL_CHAR('X'); break; - case TMC_T150: if (st.t150()) SERIAL_CHAR('X'); break; - case TMC_T143: if (st.t143()) SERIAL_CHAR('X'); break; - case TMC_T120: if (st.t120()) SERIAL_CHAR('X'); break; - default: break; - } - } - #endif - - template - static void tmc_status(TMC &st, const TMC_AxisEnum axis, const TMC_debug_enum i, const float spmm) { - SERIAL_ECHO('\t'); - switch (i) { - case TMC_CODES: _tmc_say_axis(axis); break; - case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; - case TMC_CURRENT: SERIAL_ECHO(st.getCurrent()); break; - case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break; - case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; - case TMC_IRUN: - SERIAL_PRINT(st.irun(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_IHOLD: - SERIAL_PRINT(st.ihold(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_CS_ACTUAL: - SERIAL_PRINT(st.cs_actual(), DEC); - SERIAL_ECHOPGM("/31"); - break; - - case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); break; - - case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; - case TMC_TPWMTHRS: { - uint32_t tpwmthrs_val = st.TPWMTHRS(); - SERIAL_ECHO(tpwmthrs_val); - } - break; - case TMC_TPWMTHRS_MMS: { - uint32_t tpwmthrs_val = st.TPWMTHRS(); - if (tpwmthrs_val) - SERIAL_ECHO(12650000UL * st.microsteps() / (256 * tpwmthrs_val * spmm)); - else - SERIAL_CHAR('-'); - } - break; - case TMC_OTPW: serialprintPGM(st.otpw() ? PSTR("true") : PSTR("false")); break; - case TMC_OTPW_TRIGGERED: serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false")); break; - case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; - case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; - case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; - case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; - default: tmc_status(st, i); break; - } - } - - template - static void tmc_parse_drv_status(TMC &st, const TMC_AxisEnum axis, const TMC_drv_status_enum i) { - SERIAL_CHAR('\t'); - switch (i) { - case TMC_DRV_CODES: _tmc_say_axis(axis); break; - case TMC_STST: if (st.stst()) SERIAL_CHAR('X'); break; - case TMC_OLB: if (st.olb()) SERIAL_CHAR('X'); break; - case TMC_OLA: if (st.ola()) SERIAL_CHAR('X'); break; - case TMC_S2GB: if (st.s2gb()) SERIAL_CHAR('X'); break; - case TMC_S2GA: if (st.s2ga()) SERIAL_CHAR('X'); break; - case TMC_DRV_OTPW: if (st.otpw()) SERIAL_CHAR('X'); break; - case TMC_OT: if (st.ot()) SERIAL_CHAR('X'); break; - case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; - case TMC_DRV_STATUS_HEX:drv_status_print_hex(axis, st.DRV_STATUS()); break; - default: tmc_parse_drv_status(st, i); break; - } - } - - static void tmc_debug_loop(const TMC_debug_enum i) { - #if AXIS_IS_TMC(X) - tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]); - #endif - #if AXIS_IS_TMC(X2) - tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]); - #endif - - #if AXIS_IS_TMC(Y) - tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]); - #endif - #if AXIS_IS_TMC(Y2) - tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]); - #endif - - #if AXIS_IS_TMC(Z) - tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]); - #endif - #if AXIS_IS_TMC(Z2) - tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]); - #endif - - #if AXIS_IS_TMC(E0) - tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]); - #endif - #if AXIS_IS_TMC(E1) - tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 1 - #endif - ]); - #endif - #if AXIS_IS_TMC(E2) - tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 2 - #endif - ]); - #endif - #if AXIS_IS_TMC(E3) - tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 3 - #endif - ]); - #endif - #if AXIS_IS_TMC(E4) - tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS - #if ENABLED(DISTINCT_E_FACTORS) - + 4 - #endif - ]); - #endif - - SERIAL_EOL(); - } - - static void drv_status_loop(const TMC_drv_status_enum i) { - #if AXIS_IS_TMC(X) - tmc_parse_drv_status(stepperX, TMC_X, i); - #endif - #if AXIS_IS_TMC(X2) - tmc_parse_drv_status(stepperX2, TMC_X2, i); - #endif - - #if AXIS_IS_TMC(Y) - tmc_parse_drv_status(stepperY, TMC_Y, i); - #endif - #if AXIS_IS_TMC(Y2) - tmc_parse_drv_status(stepperY2, TMC_Y2, i); - #endif - - #if AXIS_IS_TMC(Z) - tmc_parse_drv_status(stepperZ, TMC_Z, i); - #endif - #if AXIS_IS_TMC(Z2) - tmc_parse_drv_status(stepperZ2, TMC_Z2, i); - #endif - - #if AXIS_IS_TMC(E0) - tmc_parse_drv_status(stepperE0, TMC_E0, i); - #endif - #if AXIS_IS_TMC(E1) - tmc_parse_drv_status(stepperE1, TMC_E1, i); - #endif - #if AXIS_IS_TMC(E2) - tmc_parse_drv_status(stepperE2, TMC_E2, i); - #endif - #if AXIS_IS_TMC(E3) - tmc_parse_drv_status(stepperE3, TMC_E3, i); - #endif - #if AXIS_IS_TMC(E4) - tmc_parse_drv_status(stepperE4, TMC_E4, i); - #endif - - SERIAL_EOL(); - } - - /** - * M122 report functions - */ - void tmc_set_report_status(const bool status) { - if ((report_tmc_status = status)) - SERIAL_ECHOLNPGM("axis:pwm_scale |status_response|"); - } - - void tmc_report_all() { - #define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM); }while(0) - #define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM); }while(0) - TMC_REPORT("\t", TMC_CODES); - TMC_REPORT("Enabled\t", TMC_ENABLED); - TMC_REPORT("Set current", TMC_CURRENT); - TMC_REPORT("RMS current", TMC_RMS_CURRENT); - TMC_REPORT("MAX current", TMC_MAX_CURRENT); - TMC_REPORT("Run current", TMC_IRUN); - TMC_REPORT("Hold current", TMC_IHOLD); - TMC_REPORT("CS actual\t", TMC_CS_ACTUAL); - TMC_REPORT("PWM scale\t", TMC_PWM_SCALE); - TMC_REPORT("vsense\t", TMC_VSENSE); - TMC_REPORT("stealthChop", TMC_STEALTHCHOP); - TMC_REPORT("msteps\t", TMC_MICROSTEPS); - TMC_REPORT("tstep\t", TMC_TSTEP); - TMC_REPORT("pwm\nthreshold\t", TMC_TPWMTHRS); - TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS); - TMC_REPORT("OT prewarn", TMC_OTPW); - TMC_REPORT("OT prewarn has\n" - "been triggered", TMC_OTPW_TRIGGERED); - TMC_REPORT("off time\t", TMC_TOFF); - TMC_REPORT("blank time", TMC_TBL); - TMC_REPORT("hysteresis\n-end\t", TMC_HEND); - TMC_REPORT("-start\t", TMC_HSTRT); - TMC_REPORT("Stallguard thrs", TMC_SGT); - - DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); - #if HAS_DRIVER(TMC2130) - DRV_REPORT("stallguard\t", TMC_STALLGUARD); - DRV_REPORT("sg_result\t", TMC_SG_RESULT); - DRV_REPORT("fsactive\t", TMC_FSACTIVE); - #endif - DRV_REPORT("stst\t", TMC_STST); - DRV_REPORT("olb\t", TMC_OLB); - DRV_REPORT("ola\t", TMC_OLA); - DRV_REPORT("s2gb\t", TMC_S2GB); - DRV_REPORT("s2ga\t", TMC_S2GA); - DRV_REPORT("otpw\t", TMC_DRV_OTPW); - DRV_REPORT("ot\t", TMC_OT); - #if HAS_DRIVER(TMC2208) - DRV_REPORT("157C\t", TMC_T157); - DRV_REPORT("150C\t", TMC_T150); - DRV_REPORT("143C\t", TMC_T143); - DRV_REPORT("120C\t", TMC_T120); - DRV_REPORT("s2vsa\t", TMC_S2VSA); - DRV_REPORT("s2vsb\t", TMC_S2VSB); - #endif - DRV_REPORT("Driver registers:", TMC_DRV_STATUS_HEX); - SERIAL_EOL(); - } - -#endif // TMC_DEBUG - -#if ENABLED(SENSORLESS_HOMING) - - void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable/*=true*/) { - st.coolstep_min_speed(enable ? 1024UL * 1024UL - 1UL : 0); - #if ENABLED(STEALTHCHOP) - st.stealthChop(!enable); - #endif - st.diag1_stall(enable ? 1 : 0); - } - -#endif // SENSORLESS_HOMING - -#if HAS_DRIVER(TMC2130) - #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) - void tmc_init_cs_pins() { - #if AXIS_DRIVER_TYPE(X, TMC2130) - SET_CS_PIN(X); - #endif - #if AXIS_DRIVER_TYPE(Y, TMC2130) - SET_CS_PIN(Y); - #endif - #if AXIS_DRIVER_TYPE(Z, TMC2130) - SET_CS_PIN(Z); - #endif - #if AXIS_DRIVER_TYPE(X2, TMC2130) - SET_CS_PIN(X2); - #endif - #if AXIS_DRIVER_TYPE(Y2, TMC2130) - SET_CS_PIN(Y2); - #endif - #if AXIS_DRIVER_TYPE(Z2, TMC2130) - SET_CS_PIN(Z2); - #endif - #if AXIS_DRIVER_TYPE(E0, TMC2130) - SET_CS_PIN(E0); - #endif - #if AXIS_DRIVER_TYPE(E1, TMC2130) - SET_CS_PIN(E1); - #endif - #if AXIS_DRIVER_TYPE(E2, TMC2130) - SET_CS_PIN(E2); - #endif - #if AXIS_DRIVER_TYPE(E3, TMC2130) - SET_CS_PIN(E3); - #endif - #if AXIS_DRIVER_TYPE(E4, TMC2130) - SET_CS_PIN(E4); - #endif - } -#endif // TMC2130 - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin/tmc_util.h b/Marlin_thinkerV2/Marlin/tmc_util.h deleted file mode 100644 index 7efe67a502..0000000000 --- a/Marlin_thinkerV2/Marlin/tmc_util.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef _TMC_UTIL_H_ -#define _TMC_UTIL_H_ - -#include "MarlinConfig.h" - -#if HAS_DRIVER(TMC2130) - #include -#endif - -#if HAS_DRIVER(TMC2208) - #include -#endif - -extern bool report_tmc_status; - -enum TMC_AxisEnum : char { TMC_X, TMC_Y, TMC_Z, TMC_X2, TMC_Y2, TMC_Z2, TMC_E0, TMC_E1, TMC_E2, TMC_E3, TMC_E4 }; - -constexpr uint32_t _tmc_thrs(const uint16_t msteps, const int32_t thrs, const uint32_t spmm) { - return 12650000UL * msteps / (256 * thrs * spmm); -} - -void _tmc_say_axis(const TMC_AxisEnum axis); -void _tmc_say_current(const TMC_AxisEnum axis, const uint16_t curr); -void _tmc_say_otpw(const TMC_AxisEnum axis, const bool otpw); -void _tmc_say_otpw_cleared(const TMC_AxisEnum axis); -void _tmc_say_pwmthrs(const TMC_AxisEnum axis, const uint32_t thrs); -void _tmc_say_sgt(const TMC_AxisEnum axis, const int8_t sgt); - -template -void tmc_get_current(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_current(axis, st.getCurrent()); -} -template -void tmc_set_current(TMC &st, const int mA) { - st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER); -} -template -void tmc_report_otpw(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_otpw(axis, st.getOTPW()); -} -template -void tmc_clear_otpw(TMC &st, const TMC_AxisEnum axis) { - st.clear_otpw(); - _tmc_say_otpw_cleared(axis); -} -template -void tmc_get_pwmthrs(TMC &st, const TMC_AxisEnum axis, const uint16_t spmm) { - _tmc_say_pwmthrs(axis, _tmc_thrs(st.microsteps(), st.TPWMTHRS(), spmm)); -} -template -void tmc_set_pwmthrs(TMC &st, const int32_t thrs, const uint32_t spmm) { - st.TPWMTHRS(_tmc_thrs(st.microsteps(), thrs, spmm)); -} -template -void tmc_get_sgt(TMC &st, const TMC_AxisEnum axis) { - _tmc_say_sgt(axis, st.sgt()); -} -template -void tmc_set_sgt(TMC &st, const int8_t sgt_val) { - st.sgt(sgt_val); -} - -void monitor_tmc_driver(); - -#if ENABLED(TMC_DEBUG) - void tmc_set_report_status(const bool status); - void tmc_report_all(); -#endif - -/** - * TMC2130 specific sensorless homing using stallGuard2. - * stallGuard2 only works when in spreadCycle mode. - * spreadCycle and stealthChop are mutually exclusive. - * - * Defined here because of limitations with templates and headers. - */ -#if ENABLED(SENSORLESS_HOMING) - void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable=true); -#endif - -#if HAS_DRIVER(TMC2130) - void tmc_init_cs_pins(); -#endif - -#endif // _TMC_UTIL_H_ diff --git a/Marlin_thinkerV2/Marlin/twibus.cpp b/Marlin_thinkerV2/Marlin/twibus.cpp deleted file mode 100644 index 777d151e4f..0000000000 --- a/Marlin_thinkerV2/Marlin/twibus.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(EXPERIMENTAL_I2CBUS) - -#include "twibus.h" -#include -#include "Marlin.h" - -TWIBus::TWIBus() { - #if I2C_SLAVE_ADDRESS == 0 - Wire.begin(); // No address joins the BUS as the master - #else - Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave - #endif - this->reset(); -} - -void TWIBus::reset() { - this->buffer_s = 0; - this->buffer[0] = 0x00; -} - -void TWIBus::address(const uint8_t adr) { - if (!WITHIN(adr, 8, 127)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Bad I2C address (8-127)"); - } - - this->addr = adr; - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("address"), adr); - #endif -} - -void TWIBus::addbyte(const char c) { - if (this->buffer_s >= COUNT(this->buffer)) return; - this->buffer[this->buffer_s++] = c; - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbyte"), c); - #endif -} - -void TWIBus::addbytes(char src[], uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbytes"), bytes); - #endif - while (bytes--) this->addbyte(*src++); -} - -void TWIBus::addstring(char str[]) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addstring"), str); - #endif - while (char c = *str++) this->addbyte(c); -} - -void TWIBus::send() { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("send"), this->addr); - #endif - - Wire.beginTransmission(this->addr); - Wire.write(this->buffer, this->buffer_s); - Wire.endTransmission(); - - this->reset(); -} - -// static -void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) { - SERIAL_ECHO_START(); - serialprintPGM(prefix); - SERIAL_ECHOPAIR(": from:", adr); - SERIAL_ECHOPAIR(" bytes:", bytes); - SERIAL_ECHOPGM (" data:"); -} - -// static -void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) { - echoprefix(bytes, prefix, adr); - while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read()); - SERIAL_EOL(); -} - -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]); - SERIAL_EOL(); -} - -bool TWIBus::request(const uint8_t bytes) { - if (!this->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 ENABLED(DEBUG_TWIBUS) - debug("request fail", this->addr); - #endif - return false; - } - - return true; -} - -void TWIBus::relay(const uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("relay"), bytes); - #endif - - if (this->request(bytes)) - echodata(bytes, PSTR("i2c-reply"), this->addr); -} - -uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { - this->reset(); - uint8_t count = 0; - while (count < bytes && Wire.available()) - dst[count++] = Wire.read(); - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("capture"), count); - #endif - - return count; -} - -// static -void TWIBus::flush() { - while (Wire.available()) Wire.read(); -} - -#if I2C_SLAVE_ADDRESS > 0 - - void TWIBus::receive(uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("receive"), bytes); - #endif - echodata(bytes, PSTR("i2c-receive"), 0); - } - - void TWIBus::reply(char str[]/*=NULL*/) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("reply"), str); - #endif - - if (str) { - this->reset(); - this->addstring(str); - } - - Wire.write(this->buffer, this->buffer_s); - - this->reset(); - } - -#endif - -#if ENABLED(DEBUG_TWIBUS) - - // static - void TWIBus::prefix(const char func[]) { - SERIAL_ECHOPGM("TWIBus::"); - serialprintPGM(func); - SERIAL_ECHOPGM(": "); - } - void TWIBus::debug(const char func[], uint32_t adr) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(adr); } - } - void TWIBus::debug(const char func[], char c) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(c); } - } - void TWIBus::debug(const char func[], char str[]) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(str); } - } - -#endif - -#endif // EXPERIMENTAL_I2CBUS diff --git a/Marlin_thinkerV2/Marlin/twibus.h b/Marlin_thinkerV2/Marlin/twibus.h deleted file mode 100644 index 03763972a7..0000000000 --- a/Marlin_thinkerV2/Marlin/twibus.h +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef TWIBUS_H -#define TWIBUS_H - -#include "macros.h" - -#include - -// Print debug messages with M111 S2 (Uses 236 bytes of PROGMEM) -//#define DEBUG_TWIBUS - -typedef void (*twiReceiveFunc_t)(int bytes); -typedef void (*twiRequestFunc_t)(); - -#define TWIBUS_BUFFER_SIZE 32 - -/** - * TWIBUS class - * - * This class implements a wrapper around the two wire (I2C) bus, allowing - * Marlin to send and request data from any slave device on the bus. - * - * The two main consumers of this class are M260 and M261. M260 provides a way - * to send an I2C packet to a device (no repeated starts) by caching up to 32 - * bytes in a buffer and then sending the buffer. - * M261 requests data from a device. The received data is relayed to serial out - * for the host to interpret. - * - * For more information see - * - http://marlinfw.org/docs/gcode/M260.html - * - http://marlinfw.org/docs/gcode/M261.html - * - */ -class TWIBus { - private: - /** - * @brief Number of bytes on buffer - * @description Number of bytes in the buffer waiting to be flushed to the bus - */ - uint8_t buffer_s = 0; - - /** - * @brief Internal buffer - * @details A fixed buffer. TWI commands can be no longer than this. - */ - char buffer[TWIBUS_BUFFER_SIZE]; - - - public: - /** - * @brief Target device address - * @description The target device address. Persists until changed. - */ - uint8_t addr = 0; - - /** - * @brief Class constructor - * @details Initialize the TWI bus and clear the buffer - */ - TWIBus(); - - /** - * @brief Reset the buffer - * @details Set the buffer to a known-empty state - */ - void reset(); - - /** - * @brief Send the buffer data to the bus - * @details Flush the buffer to the target address - */ - void send(); - - /** - * @brief Add one byte to the buffer - * @details Add a byte to the end of the buffer. - * Silently fails if the buffer is full. - * - * @param c a data byte - */ - void addbyte(const char c); - - /** - * @brief Add some bytes to the buffer - * @details Add bytes to the end of the buffer. - * Concatenates at the buffer size. - * - * @param src source data address - * @param bytes the number of bytes to add - */ - void addbytes(char src[], uint8_t bytes); - - /** - * @brief Add a null-terminated string to the buffer - * @details Add bytes to the end of the buffer up to a nul. - * Concatenates at the buffer size. - * - * @param str source string address - */ - void addstring(char str[]); - - /** - * @brief Set the target slave address - * @details The target slave address for sending the full packet - * - * @param adr 7-bit integer address - */ - void address(const uint8_t adr); - - /** - * @brief Prefix for echo to serial - * @details Echo a label, length, address, and "data:" - * - * @param bytes the number of bytes to request - */ - static void echoprefix(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data on the bus to serial - * @details Echo some number of bytes from the bus - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - static void echodata(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data in the buffer to serial - * @details Echo the entire buffer to serial - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void echobuffer(const char prefix[], uint8_t adr); - - /** - * @brief Request data from the slave device and wait. - * @details Request a number of bytes from a slave device. - * Wait for the data to arrive, and return true - * on success. - * - * @param bytes the number of bytes to request - * @return status of the request: true=success, false=fail - */ - bool request(const uint8_t bytes); - - /** - * @brief Capture data from the bus into the buffer. - * @details Capture data after a request has succeeded. - * - * @param bytes the number of bytes to request - * @return the number of bytes captured to the buffer - */ - uint8_t capture(char *dst, const uint8_t bytes); - - /** - * @brief Flush the i2c bus. - * @details Get all bytes on the bus and throw them away. - */ - static void flush(); - - /** - * @brief Request data from the slave device, echo to serial. - * @details Request a number of bytes from a slave device and output - * the returned data to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void relay(const uint8_t bytes); - - #if I2C_SLAVE_ADDRESS > 0 - - /** - * @brief Register a slave receive handler - * @details Set a handler to receive data addressed to us - * - * @param handler A function to handle receiving bytes - */ - inline void onReceive(const twiReceiveFunc_t handler) { Wire.onReceive(handler); } - - /** - * @brief Register a slave request handler - * @details Set a handler to send data requested from us - * - * @param handler A function to handle receiving bytes - */ - inline void onRequest(const twiRequestFunc_t handler) { Wire.onRequest(handler); } - - /** - * @brief Default handler to receive - * @details Receive bytes sent to our slave address - * and simply echo them to serial. - */ - void receive(uint8_t bytes); - - /** - * @brief Send a reply to the bus - * @details Send the buffer and clear it. - * If a string is passed, write it into the buffer first. - */ - void reply(char str[]=NULL); - inline void reply(const char str[]) { this->reply((char*)str); } - - #endif - - #if ENABLED(DEBUG_TWIBUS) - - /** - * @brief Prints a debug message - * @details Prints a simple debug message "TWIBus::function: value" - */ - static void prefix(const char func[]); - static void debug(const char func[], uint32_t adr); - static void debug(const char func[], char c); - static void debug(const char func[], char adr[]); - static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); } - - #endif -}; - -#endif // TWIBUS_H diff --git a/Marlin_thinkerV2/Marlin/types.h b/Marlin_thinkerV2/Marlin/types.h deleted file mode 100644 index 8d4a0bd04c..0000000000 --- a/Marlin_thinkerV2/Marlin/types.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __TYPES_H__ -#define __TYPES_H__ - -#include - -typedef unsigned long millis_t; - -typedef struct { - int8_t x_index, y_index; - float distance; // When populated, the distance from the search location -} mesh_index_pair; - -#endif diff --git a/Marlin_thinkerV2/Marlin/ubl.cpp b/Marlin_thinkerV2/Marlin/ubl.cpp deleted file mode 100644 index df9c212bbf..0000000000 --- a/Marlin_thinkerV2/Marlin/ubl.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "Marlin.h" - #include "ubl.h" - #include "hex_print_routines.h" - #include "temperature.h" - #include "planner.h" - #include "math.h" - - unified_bed_leveling ubl; - - uint8_t ubl_cnt = 0; - - void unified_bed_leveling::echo_name() { SERIAL_PROTOCOLPGM("Unified Bed Leveling"); } - - void unified_bed_leveling::report_current_mesh() { - if (!leveling_is_valid()) return; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(" G29 I999"); - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - 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); - SERIAL_ECHOPAIR(" J", y); - SERIAL_ECHOPGM(" Z"); - SERIAL_ECHO_F(z_values[x][y], 2); - SERIAL_EOL(); - } - } - - void unified_bed_leveling::report_state() { - echo_name(); - SERIAL_PROTOCOLPGM(" System v" UBL_VERSION " "); - if (!planner.leveling_active) SERIAL_PROTOCOLPGM("in"); - SERIAL_PROTOCOLLNPGM("active."); - safe_delay(50); - } - - #if ENABLED(UBL_DEVEL_DEBUGGING) - - static void debug_echo_axis(const AxisEnum axis) { - if (current_position[axis] == destination[axis]) - SERIAL_ECHOPGM("-------------"); - else - SERIAL_ECHO_F(destination[X_AXIS], 6); - } - - void debug_current_and_destination(const char *title) { - - // if the title message starts with a '!' it is so important, we are going to - // ignore the status of the g26_debug_flag - if (*title != '!' && !g26_debug_flag) return; - - const float de = destination[E_AXIS] - current_position[E_AXIS]; - - if (de == 0.0) return; // Printing moves only - - const float dx = destination[X_AXIS] - current_position[X_AXIS], - dy = destination[Y_AXIS] - current_position[Y_AXIS], - xy_dist = HYPOT(dx, dy); - - if (xy_dist == 0.0) return; - - SERIAL_ECHOPGM(" fpmm="); - const float fpmm = de / xy_dist; - SERIAL_ECHO_F(fpmm, 6); - - SERIAL_ECHOPGM(" current=( "); - SERIAL_ECHO_F(current_position[X_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Y_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Z_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[E_AXIS], 6); - SERIAL_ECHOPGM(" ) destination=( "); - debug_echo_axis(X_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Y_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Z_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(E_AXIS); - SERIAL_ECHOPGM(" ) "); - SERIAL_ECHO(title); - SERIAL_EOL(); - - } - - #endif // UBL_DEVEL_DEBUGGING - - int8_t unified_bed_leveling::storage_slot; - - 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]; - - #if ENABLED(ULTIPANEL) - bool unified_bed_leveling::lcd_map_control = false; - #endif - - volatile int unified_bed_leveling::encoder_diff; - - unified_bed_leveling::unified_bed_leveling() { - ubl_cnt++; // Debug counter to ensure we only have one UBL object present in memory. We can eliminate this (and all references to ubl_cnt) very soon. - reset(); - } - - void unified_bed_leveling::reset() { - 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 (was_enabled) report_current_position(); - } - - void unified_bed_leveling::invalidate() { - set_bed_leveling_enabled(false); - set_all_mesh_points_to_value(NAN); - } - - void unified_bed_leveling::set_all_mesh_points_to_value(const float value) { - 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] = value; - } - } - } - - static void serial_echo_xy(const uint8_t sp, const int16_t x, const int16_t y) { - SERIAL_ECHO_SP(sp); - SERIAL_CHAR('('); - if (x < 100) { SERIAL_CHAR(' '); if (x < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(x); - SERIAL_CHAR(','); - if (y < 100) { SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(y); - SERIAL_CHAR(')'); - safe_delay(5); - } - - static void serial_echo_column_labels(const uint8_t sp) { - SERIAL_ECHO_SP(7); - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - if (i < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(i); - SERIAL_ECHO_SP(sp); - } - safe_delay(10); - } - - /** - * Produce one of these mesh maps: - * 0: Human-readable - * 1: CSV format for spreadsheet import - * 2: TODO: Display on Graphical LCD - * 4: Compact Human-Readable - */ - void unified_bed_leveling::display_map(const int map_type) { - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = true; - #endif - - constexpr uint8_t eachsp = 1 + 6 + 1, // [-3.567] - twixt = eachsp * (GRID_MAX_POINTS_X) - 9 * 2; // Leading 4sp, Coordinates 9sp each - - const bool human = !(map_type & 0x3), csv = map_type == 1, lcd = map_type == 2, comp = map_type & 0x4; - - SERIAL_ECHOPGM("\nBed Topography Report"); - if (human) { - SERIAL_ECHOPGM(":\n\n"); - serial_echo_xy(4, MESH_MIN_X, MESH_MAX_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MAX_Y); - SERIAL_EOL(); - serial_echo_column_labels(eachsp - 2); - } - else { - SERIAL_ECHOPGM(" for "); - serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); - } - - const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), - current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); - - if (!lcd) SERIAL_EOL(); - for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { - - // Row Label (J index) - if (human) { - if (j < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(j); - SERIAL_ECHOPGM(" |"); - } - - // Row Values (I indexes) - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - - // Opening Brace or Space - const bool is_current = i == current_xi && j == current_yi; - if (human) SERIAL_CHAR(is_current ? '[' : ' '); - - // Z Value at current I, J - const float f = z_values[i][j]; - if (lcd) { - // TODO: Display on Graphical LCD - } - else if (isnan(f)) - serialprintPGM(human ? PSTR(" . ") : PSTR("NAN")); - else if (human || csv) { - if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Space for positive ('-' for negative) - SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits - } - idle(); - if (csv && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR('\t'); - - // Closing Brace or Space - if (human) SERIAL_CHAR(is_current ? ']' : ' '); - - #if TX_BUFFER_SIZE > 0 - SERIAL_FLUSHTX(); - #endif - safe_delay(5); - } - if (!lcd) SERIAL_EOL(); - - // A blank line between rows (unless compact) - if (j && human && !comp) SERIAL_ECHOLNPGM(" |"); - } - - if (human) { - serial_echo_column_labels(eachsp - 2); - SERIAL_EOL(); - serial_echo_xy(4, MESH_MIN_X, MESH_MIN_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MIN_Y); - SERIAL_EOL(); - SERIAL_EOL(); - } - - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = false; - #endif - } - - bool unified_bed_leveling::sanity_check() { - uint8_t error_flag = 0; - - if (settings.calc_num_meshes() < 1) { - SERIAL_PROTOCOLLNPGM("?Mesh too big for EEPROM."); - error_flag++; - } - - return !!error_flag; - } - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin/ubl.h b/Marlin_thinkerV2/Marlin/ubl.h deleted file mode 100644 index 03380af452..0000000000 --- a/Marlin_thinkerV2/Marlin/ubl.h +++ /dev/null @@ -1,370 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef UNIFIED_BED_LEVELING_H -#define UNIFIED_BED_LEVELING_H - -#include "MarlinConfig.h" - -//#define UBL_DEVEL_DEBUGGING - -#include "Marlin.h" -#include "planner.h" -#include "math.h" -#include "configuration_store.h" - -#define UBL_VERSION "1.01" -#define UBL_OK false -#define UBL_ERR true - -#define USE_NOZZLE_AS_REFERENCE 0 -#define USE_PROBE_AS_REFERENCE 1 - -// ubl_motion.cpp - -#if ENABLED(UBL_DEVEL_DEBUGGING) - void debug_current_and_destination(const char * const title); -#else - FORCE_INLINE void debug_current_and_destination(const char * const title) { UNUSED(title); } -#endif - -// ubl_G29.cpp - -enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; - -// External references - -char *ftostr43sign(const float&, char); - -extern uint8_t ubl_cnt; - -/////////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(ULTRA_LCD) - void lcd_quick_feedback(const bool clear_buttons); -#endif - -#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)) - -class unified_bed_leveling { - private: - - static int g29_verbose_level, - g29_phase_value, - g29_repetition_cnt, - g29_storage_slot, - g29_map_type; - static bool g29_c_flag, g29_x_flag, g29_y_flag; - static float g29_x_pos, g29_y_pos, - g29_card_thickness, - g29_constant; - - #if HAS_BED_PROBE - static int g29_grid_size; - #endif - - #if ENABLED(NEWPANEL) - static void move_z_with_encoder(const float &multiplier); - static float measure_point_with_encoder(); - static float measure_business_card_thickness(float in_height); - static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool) _O0; - static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) _O0; - #endif - - static bool g29_parameter_parsing() _O0; - static void shift_mesh_height(); - static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest) _O0; - static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); - static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); - static void g29_what_command(); - static void g29_eeprom_dump(); - static void g29_compare_current_mesh_to_stored_mesh(); - static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static void smart_fill_mesh(); - - public: - - static void echo_name(); - static void report_current_mesh(); - static void report_state(); - static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); - static void display_map(const int) _O0; - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]) _O0; - static mesh_index_pair find_furthest_invalid_mesh_point() _O0; - static void reset(); - static void invalidate(); - static void set_all_mesh_points_to_value(const float value); - static void adjust_mesh_to_mean(const bool cflag, const float value); - static bool sanity_check(); - - static void G29() _O0; // O0 for no optimization - static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560 - - 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) - }; - - #if ENABLED(ULTIPANEL) - static bool lcd_map_control; - #endif - - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. - - 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)); - 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)); - 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 - // that is OK because something else should be keeping that from - // 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.5f) * (1.0f / (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.5f) * (1.0f / (MESH_Y_DIST)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - - /** - * z2 --| - * z0 | | - * | | + (z2-z1) - * z1 | | | - * ---+-------------+--------+-- --| - * a1 a0 a2 - * |<---delta_a---------->| - * - * calc_z0 is the basis for all the Mesh Based correction. It is used to - * find the expected Z Height at a position between two known Z-Height locations. - * - * It is fairly expensive with its 4 floating point additions and 2 floating point - * multiplications. - */ - FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); - } - - /** - * z_correction_for_x_on_horizontal_mesh_line is an optimization for - * the case where the printer is making a vertical line that only crosses horizontal mesh lines. - */ - inline static float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1_i") : PSTR("yi") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0); - SERIAL_ECHOPAIR(",x1_i=", x1_i); - SERIAL_ECHOPAIR(",yi=", yi); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - // - // See comments above for z_correction_for_x_on_horizontal_mesh_line - // - inline static float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("y1_i") ); - SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0); - SERIAL_ECHOPAIR(", xi=", xi); - SERIAL_ECHOPAIR(", y1_i=", y1_i); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - /** - * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first - * does a linear interpolation along both of the bounding X-Mesh-Lines to find the - * Z-Height at both ends. Then it does a linear interpolation of these heights based - * on the Y position within the cell. - */ - static float get_z_correction(const float &rx0, const float &ry0) { - const int8_t cx = get_cell_index_x(rx0), - cy = get_cell_index_y(ry0); // return values are clamped - - /** - * Check if the requested location is off the mesh. If so, and - * UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned. - */ - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - if (!WITHIN(rx0, MESH_MIN_X, MESH_MAX_X) || !WITHIN(ry0, MESH_MIN_Y, MESH_MAX_Y)) - return UBL_Z_RAISE_WHEN_OFF_MESH; - #endif - - const float z1 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][cy], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]); - - const float z2 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1], - mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]); - - float z0 = calc_z0(ry0, - mesh_index_to_ypos(cy), z1, - mesh_index_to_ypos(cy + 1), z2); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR(" raw get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(z0, 6); - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPGM(" >>>---> "); - SERIAL_ECHO_F(z0, 6); - SERIAL_EOL(); - } - #endif - - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_CHAR(')'); - SERIAL_EOL(); - } - #endif - } - return z0; - } - - FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { - return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); - } - - FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { - return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); - } - - #if UBL_SEGMENTED - static bool prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate); - #else - static void line_to_destination_cartesian(const float &fr, const uint8_t e); - #endif - - inline static bool mesh_is_valid() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) return false; - return true; - } - -}; // class unified_bed_leveling - -extern unified_bed_leveling ubl; - -FORCE_INLINE void gcode_G29() { ubl.G29(); } - -#endif // UNIFIED_BED_LEVELING_H diff --git a/Marlin_thinkerV2/Marlin/ubl_G29.cpp b/Marlin_thinkerV2/Marlin/ubl_G29.cpp deleted file mode 100644 index c401fa6962..0000000000 --- a/Marlin_thinkerV2/Marlin/ubl_G29.cpp +++ /dev/null @@ -1,1820 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - //#define UBL_DEVEL_DEBUGGING - - #include "ubl.h" - #include "Marlin.h" - #include "hex_print_routines.h" - #include "configuration_store.h" - #include "ultralcd.h" - #include "stepper.h" - #include "planner.h" - #include "parser.h" - #include "serial.h" - #include "bitmap_flags.h" - - #include - #include "least_squares_fit.h" - - #define UBL_G29_P31 - - extern float destination[XYZE], current_position[XYZE]; - - #if ENABLED(NEWPANEL) - void lcd_return_to_status(); - void _lcd_ubl_output_map_lcd(); - #endif - - #define SIZE_OF_LITTLE_RAISE 1 - #define BIG_RAISE_NOT_NEEDED 0 - - int unified_bed_leveling::g29_verbose_level, - unified_bed_leveling::g29_phase_value, - unified_bed_leveling::g29_repetition_cnt, - unified_bed_leveling::g29_storage_slot = 0, - unified_bed_leveling::g29_map_type; - bool unified_bed_leveling::g29_c_flag, - unified_bed_leveling::g29_x_flag, - unified_bed_leveling::g29_y_flag; - float unified_bed_leveling::g29_x_pos, - unified_bed_leveling::g29_y_pos, - unified_bed_leveling::g29_card_thickness = 0, - unified_bed_leveling::g29_constant = 0; - - #if HAS_BED_PROBE - int unified_bed_leveling::g29_grid_size; - #endif - - /** - * G29: Unified Bed Leveling by Roxy - * - * Parameters understood by this leveling system: - * - * A Activate Activate the Unified Bed Leveling system. - * - * B # Business Use the 'Business Card' mode of the Manual Probe subsystem with P2. - * Note: A non-compressible Spark Gap feeler gauge is recommended over a business card. - * In this mode of G29 P2, a business or index card is used as a shim that the nozzle can - * grab onto as it is lowered. In principle, the nozzle-bed distance is the same when the - * same resistance is felt in the shim. You can omit the numerical value on first invocation - * of G29 P2 B to measure shim thickness. Subsequent use of 'B' will apply the previously- - * measured thickness by default. - * - * C Continue G29 P1 C continues the generation of a partially-constructed Mesh without invalidating - * previous measurements. - * - * C G29 P2 C tells the Manual Probe subsystem to not use the current nozzle - * location in its search for the closest unmeasured Mesh Point. Instead, attempt to - * start at one end of the uprobed points and Continue sequentially. - * - * G29 P3 C specifies the Constant for the fill. Otherwise, uses a "reasonable" value. - * - * C Current G29 Z C uses the Current location (instead of bed center or nearest edge). - * - * D Disable Disable the Unified Bed Leveling system. - * - * E Stow_probe Stow the probe after each sampled point. - * - * F # Fade Fade the amount of Mesh Based Compensation over a specified height. At the - * specified height, no correction is applied and natural printer kenimatics take over. If no - * number is specified for the command, 10mm is assumed to be reasonable. - * - * H # Height With P2, 'H' specifies the Height to raise the nozzle after each manual probe of the bed. - * If omitted, the nozzle will raise by Z_CLEARANCE_BETWEEN_PROBES. - * - * H # Offset With P4, 'H' specifies the Offset above the mesh height to place the nozzle. - * If omitted, Z_CLEARANCE_BETWEEN_PROBES will be used. - * - * I # Invalidate Invalidate the specified number of Mesh Points near the given 'X' 'Y'. If X or Y are omitted, - * the nozzle location is used. If no 'I' value is given, only the point nearest to the location - * is invalidated. Use 'T' to produce a map afterward. This command is useful to invalidate a - * portion of the Mesh so it can be adjusted using other UBL tools. When attempting to invalidate - * an isolated bad mesh point, the 'T' option shows the nozzle position in the Mesh with (#). You - * can move the nozzle around and use this feature to select the center of the area (or cell) to - * invalidate. - * - * J # Grid Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side. - * Not specifying a grid size will invoke the 3-Point leveling function. - * - * K # Kompare Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This - * command literally performs a diff between two Meshes. - * - * L Load Load Mesh from the previously activated location in the EEPROM. - * - * L # Load Load Mesh from the specified location in the EEPROM. Set this location as activated - * for subsequent Load and Store operations. - * - * The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will - * start off being initialized with a G29 P0 or a G29 P1. Further refinement of the Mesh happens with - * each additional Phase that processes it. - * - * P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System. This reverts the - * 3D Printer to the same state it was in before the Unified Bed Leveling Compensation - * was turned on. Setting the entire Mesh to Zero is a special case that allows - * a subsequent G or T leveling operation for backward compatibility. - * - * P1 Phase 1 Invalidate entire Mesh and continue with automatic generation of the Mesh data using - * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. For delta - * printers only the areas where the probe and nozzle can both reach will be automatically probed. - * - * Unreachable points will be handled in Phase 2 and Phase 3. - * - * Use 'C' to leave the previous mesh intact and automatically probe needed points. This allows you - * to invalidate parts of the Mesh but still use Automatic Probing. - * - * The 'X' and 'Y' parameters prioritize where to try and measure points. If omitted, the current - * probe position is used. - * - * Use 'T' (Topology) to generate a report of mesh generation. - * - * P1 will suspend Mesh generation if the controller button is held down. Note that you may need - * to press and hold the switch for several seconds if moves are underway. - * - * P2 Phase 2 Probe unreachable points. - * - * Use 'H' to set the height between Mesh points. If omitted, Z_CLEARANCE_BETWEEN_PROBES is used. - * Smaller values will be quicker. Move the nozzle down till it barely touches the bed. Make sure the - * nozzle is clean and unobstructed. Use caution and move slowly. This can damage your printer! - * (Uses SIZE_OF_LITTLE_RAISE mm if the nozzle is moving less than BIG_RAISE_NOT_NEEDED mm.) - * - * The 'H' value can be negative if the Mesh dips in a large area. Press and hold the - * controller button to terminate the current Phase 2 command. You can then re-issue "G29 P 2" - * with an 'H' parameter more suitable for the area you're manually probing. Note that the command - * tries to start in a corner of the bed where movement will be predictable. Override the distance - * calculation location with the X and Y parameters. You can print a Mesh Map (G29 T) to see where - * the mesh is invalidated and where the nozzle needs to move to complete the command. Use 'C' to - * indicate that the search should be based on the current position. - * - * The 'B' parameter for this command is described above. It places the manual probe subsystem into - * Business Card mode where the thickness of a business card is measured and then used to accurately - * set the nozzle height in all manual probing for the duration of the command. A Business card can - * be used, but you'll get better results with a flexible Shim that doesn't compress. This makes it - * easier to produce similar amounts of force and get more accurate measurements. Google if you're - * not sure how to use a shim. - * - * The 'T' (Map) parameter helps track Mesh building progress. - * - * NOTE: P2 requires an LCD controller! - * - * P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths to - * go down: - * - * - If a 'C' constant is specified, the closest invalid mesh points to the nozzle will be filled, - * and a repeat count can then also be specified with 'R'. - * - * - Leaving out 'C' invokes Smart Fill, which scans the mesh from the edges inward looking for - * invalid mesh points. Adjacent points are used to determine the bed slope. If the bed is sloped - * upward from the invalid point, it takes the value of the nearest point. If sloped downward, it's - * replaced by a value that puts all three points in a line. This version of G29 P3 is a quick, easy - * and (usually) safe way to populate unprobed mesh regions before continuing to G26 Mesh Validation - * Pattern. Note that this populates the mesh with unverified values. Pay attention and use caution. - * - * P4 Phase 4 Fine tune the Mesh. The Delta Mesh Compensation System assumes the existence of - * an LCD Panel. It is possible to fine tune the mesh without an LCD Panel using - * G42 and M421. See the UBL documentation for further details. - * - * Phase 4 is meant to be used with G26 Mesh Validation to fine tune the mesh by direct editing - * of Mesh Points. Raise and lower points to fine tune the mesh until it gives consistently reliable - * adhesion. - * - * P4 moves to the closest Mesh Point (and/or the given X Y), raises the nozzle above the mesh height - * by the given 'H' offset (or default 0), and waits while the controller is used to adjust the nozzle - * height. On click the displayed height is saved in the mesh. - * - * Start Phase 4 at a specific location with X and Y. Adjust a specific number of Mesh Points with - * the 'R' (Repeat) parameter. (If 'R' is left out, the whole matrix is assumed.) This command can be - * terminated early (e.g., after editing the area of interest) by pressing and holding the encoder button. - * - * The general form is G29 P4 [R points] [X position] [Y position] - * - * The H [offset] parameter is useful if a shim is used to fine-tune the mesh. For a 0.4mm shim the - * command would be G29 P4 H0.4. The nozzle is moved to the shim height, you adjust height to the shim, - * and on click the height minus the shim thickness will be saved in the mesh. - * - * !!Use with caution, as a very poor mesh could cause the nozzle to crash into the bed!! - * - * NOTE: P4 is not available unless you have LCD support enabled! - * - * P5 Phase 5 Find Mean Mesh Height and Standard Deviation. Typically, it is easier to use and - * work with the Mesh if it is Mean Adjusted. You can specify a C parameter to - * Correct the Mesh to a 0.00 Mean Height. Adding a C parameter will automatically - * execute a G29 P6 C . - * - * P6 Phase 6 Shift Mesh height. The entire Mesh's height is adjusted by the height specified - * with the C parameter. Being able to adjust the height of a Mesh is useful tool. It - * can be used to compensate for poorly calibrated Z-Probes and other errors. Ideally, - * you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring - * 0.000 at the Z Home location. - * - * Q Test Load specified Test Pattern to assist in checking correct operation of system. This - * command is not anticipated to be of much value to the typical user. It is intended - * for developers to help them verify correct operation of the Unified Bed Leveling System. - * - * R # Repeat Repeat this command the specified number of times. If no number is specified the - * command will be repeated GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y times. - * - * S Store Store the current Mesh in the Activated area of the EEPROM. It will also store the - * current state of the Unified Bed Leveling system in the EEPROM. - * - * S # Store Store the current Mesh at the specified location in EEPROM. Activate this location - * for subsequent Load and Store operations. Valid storage slot numbers begin at 0 and - * extend to a limit related to the available EEPROM storage. - * - * S -1 Store Print the current Mesh as G-code that can be used to restore the mesh anytime. - * - * T Topology Display the Mesh Map Topology. - * 'T' can be used alone (e.g., G29 T) or in combination with most of the other commands. - * This option works with all Phase commands (e.g., G29 P4 R 5 T X 50 Y100 C -.1 O) - * This parameter can also specify a Map Type. T0 (the default) is user-readable. T1 can - * is suitable to paste into a spreadsheet for a 3D graph of the mesh. - * - * U Unlevel Perform a probe of the outer perimeter to assist in physically leveling unlevel beds. - * Only used for G29 P1 T U. This speeds up the probing of the edge of the bed. Useful - * when the entire bed doesn't need to be probed because it will be adjusted. - * - * V # Verbosity Set the verbosity level (0-4) for extra details. (Default 0) - * - * W What? Display valuable Unified Bed Leveling System data. - * - * X # X Location for this command - * - * Y # Y Location for this command - * - * - * Release Notes: - * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all - * kinds of problems. Enabling EEPROM Storage is required. - * - * When you do a G28 and G29 P1 to automatically build your first mesh, you are going to notice that - * UBL probes points increasingly further from the starting location. (The starting location defaults - * to the center of the bed.) In contrast, ABL and MBL follow a zigzag pattern. The spiral pattern is - * 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 - * 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 - * the mesh just right. To prevent this valuable data from being destroyed as the EEPROM structure - * evolves, UBL stores all mesh data at the end of EEPROM. - * - * UBL is founded on Edward Patel's Mesh Bed Leveling code. A big 'Thanks!' to him and the creators of - * 3-Point and Grid Based leveling. Combining their contributions we now have the functionality and - * features of all three systems combined. - */ - - void unified_bed_leveling::G29() { - - if (g29_parameter_parsing()) return; // Abort on parameter error - - const int8_t p_val = parser.intval('P', -1); - const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'); - - // Check for commands that require the printer to be homed - if (may_move) { - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - if (axis_unhomed_error()) home_all_axes(); - } - - // Invalidate Mesh Points. This command is a little bit asymmetrical because - // it directly specifies the repetition count and does not use the 'R' parameter. - if (parser.seen('I')) { - uint8_t cnt = 0; - g29_repetition_cnt = parser.has_value() ? parser.value_int() : 1; - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(NAN); - } - else { - while (g29_repetition_cnt--) { - if (cnt > 20) { cnt = 0; idle(); } - const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); - if (location.x_index < 0) { - // No more REACHABLE mesh points to invalidate, so we ASSUME the user - // meant to invalidate the ENTIRE mesh, which cannot be done with - // find_closest_mesh_point loop which only returns REACHABLE points. - set_all_mesh_points_to_value(NAN); - SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n"); - break; // No more invalid Mesh Points to populate - } - z_values[location.x_index][location.y_index] = NAN; - cnt++; - } - } - SERIAL_PROTOCOLLNPGM("Locations invalidated.\n"); - } - - if (parser.seen('Q')) { - const int test_pattern = parser.has_value() ? parser.value_int() : -99; - if (!WITHIN(test_pattern, -1, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid test_pattern value. (-1 to 2)\n"); - return; - } - SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n"); - switch (test_pattern) { - case -1: - g29_eeprom_dump(); - break; - case 0: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. - const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x, - p2 = 0.5f * (GRID_MAX_POINTS_Y) - y; - z_values[x][y] += 2.0f * HYPOT(p1, p2); - } - } - break; - case 1: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised - z_values[x][x] += 9.999f; - z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick - } - break; - case 2: - // Allow the user to specify the height because 10mm is a little extreme in some cases. - for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in - for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed - z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f; - break; - } - } - - #if HAS_BED_PROBE - - if (parser.seen('J')) { - if (g29_grid_size) { // if not 0 it is a normal n x n grid being probed - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(false /* false says to do normal grid probing */ ); - restore_ubl_active_state_and_leave(); - } - else { // grid_size == 0 : A 3-Point leveling has been requested - - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ ); - restore_ubl_active_state_and_leave(); - } - do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); - report_current_position(); - } - - #endif // HAS_BED_PROBE - - if (parser.seen('P')) { - if (WITHIN(g29_phase_value, 0, 1) && storage_slot == -1) { - storage_slot = 0; - SERIAL_PROTOCOLLNPGM("Default storage slot 0 selected."); - } - - switch (g29_phase_value) { - case 0: - // - // Zero Mesh Data - // - reset(); - SERIAL_PROTOCOLLNPGM("Mesh zeroed."); - break; - - #if HAS_BED_PROBE - - case 1: - // - // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe - // - if (!parser.seen('C')) { - invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated. Probing mesh."); - } - if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPAIR("Probing Mesh Points Closest to (", g29_x_pos); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL(g29_y_pos); - SERIAL_PROTOCOLLNPGM(").\n"); - } - probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, - parser.seen('T'), parser.seen('E'), parser.seen('U')); - - report_current_position(); - break; - - #endif // HAS_BED_PROBE - - case 2: { - #if ENABLED(NEWPANEL) - // - // Manually Probe Mesh in areas that can't be reached by the probe - // - SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations."); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - - if (parser.seen('C') && !g29_x_flag && !g29_y_flag) { - /** - * Use a good default location for the path. - * The flipped > and < operators in these comparisons is intentional. - * It should cause the probed points to follow a nice path on Cartesian printers. - * It may make sense to have Delta printers default to the center of the bed. - * Until that is decided, this can be forced with the X and Y parameters. - */ - #if IS_KINEMATIC - 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; - #endif - } - - if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); - if (ABS(g29_card_thickness) > 1.5f) { - SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement."); - return; - } - } - - if (!position_is_reachable(g29_x_pos, g29_y_pos)) { - SERIAL_PROTOCOLLNPGM("XY outside printable radius."); - return; - } - - const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES); - manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T')); - - SERIAL_PROTOCOLLNPGM("G29 P2 finished."); - - report_current_position(); - - #else - - SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present."); - return; - - #endif - } break; - - case 3: { - /** - * Populate invalid mesh areas. Proceed with caution. - * Two choices are available: - * - Specify a constant with the 'C' parameter. - * - Allow 'G29 P3' to choose a 'reasonable' constant. - */ - - if (g29_c_flag) { - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(g29_constant); - } - else { - while (g29_repetition_cnt--) { // this only populates reachable mesh points near - const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); - if (location.x_index < 0) { - // No more REACHABLE INVALID mesh points to populate, so we ASSUME - // user meant to populate ALL INVALID mesh points to value - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) - z_values[x][y] = g29_constant; - break; // No more invalid Mesh Points to populate - } - z_values[location.x_index][location.y_index] = g29_constant; - } - } - } - else { - const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 - #if ENABLED(UBL_G29_P31) - case 1: { - - // P3.1 use least squares fit to fill missing mesh values - // P3.10 zero weighting for distance, all grid points equal, best fit tilted plane - // P3.11 10X weighting for nearest grid points versus farthest grid points - // P3.12 100X distance weighting - // P3.13 1000X distance weighting, approaches simple average of nearest points - - const float weight_power = (cvf - 3.10f) * 100.0f, // 3.12345 -> 2.345 - weight_factor = weight_power ? POW(10.0f, weight_power) : 0; - smart_fill_wlsf(weight_factor); - } - break; - #endif - case 0: // P3 or P3.0 - default: // and anything P3.x that's not P3.1 - smart_fill_mesh(); // Do a 'Smart' fill using nearby known values - break; - } - } - break; - } - - case 4: // Fine Tune (i.e., Edit) the Mesh - #if ENABLED(NEWPANEL) - fine_tune_mesh(g29_x_pos, g29_y_pos, parser.seen('T')); - #else - SERIAL_PROTOCOLLNPGM("?P4 is only available when an LCD is present."); - return; - #endif - break; - - case 5: adjust_mesh_to_mean(g29_c_flag, g29_constant); break; - - case 6: shift_mesh_height(); break; - } - } - - // - // Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - // good to have the extra information. Soon... we prune this to just a few items - // - if (parser.seen('W')) g29_what_command(); - - // - // When we are fully debugged, this may go away. But there are some valid - // use cases for the users. So we can wait and see what to do with it. - // - - if (parser.seen('K')) // Kompare Current Mesh Data to Specified Stored Mesh - g29_compare_current_mesh_to_stored_mesh(); - - // - // Load a Mesh from the EEPROM - // - - if (parser.seen('L')) { // Load Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_PROTOCOLLNPGM("Done."); - } - - // - // Store a Mesh in the EEPROM - // - - if (parser.seen('S')) { // Store (or Save) Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - if (g29_storage_slot == -1) // Special case, the user wants to 'Export' the mesh to the - return report_current_mesh(); // host program to be saved on the user's computer - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - goto LEAVE; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - goto LEAVE; - } - - settings.store_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_PROTOCOLLNPGM("Done."); - } - - if (parser.seen('T')) - display_map(g29_map_type); - - LEAVE: - - #if ENABLED(NEWPANEL) - lcd_reset_alert_level(); - lcd_quick_feedback(true); - lcd_reset_status(); - lcd_external_control = false; - #endif - - return; - } - - void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) { - float sum = 0; - int n = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - sum += z_values[x][y]; - n++; - } - - const float mean = sum / n; - - // - // Sum the squares of difference from mean - // - float sum_of_diff_squared = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - sum_of_diff_squared += sq(z_values[x][y] - mean); - - SERIAL_ECHOLNPAIR("# of samples: ", n); - SERIAL_ECHOPGM("Mean Mesh Height: "); - SERIAL_ECHO_F(mean, 6); - SERIAL_EOL(); - - const float sigma = SQRT(sum_of_diff_squared / (n + 1)); - SERIAL_ECHOPGM("Standard Deviation: "); - SERIAL_ECHO_F(sigma, 6); - SERIAL_EOL(); - - if (cflag) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - z_values[x][y] -= mean + value; - } - - void unified_bed_leveling::shift_mesh_height() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - z_values[x][y] += g29_constant; - } - - #if ENABLED(NEWPANEL) - - typedef void (*clickFunc_t)(); - - bool click_and_hold(const clickFunc_t func=NULL) { - if (is_lcd_clicked()) { - lcd_quick_feedback(false); // Do NOT clear button status! If cleared, the code - // code can not look for a 'click and hold' - const millis_t nxt = millis() + 1500UL; - while (is_lcd_clicked()) { // Loop while the encoder is pressed. Uses hardware flag! - idle(); // idle, of course - if (ELAPSED(millis(), nxt)) { // After 1.5 seconds - lcd_quick_feedback(true); - if (func) (*func)(); - wait_for_release(); - safe_delay(50); // Debounce the Encoder wheel - return true; - } - } - } - safe_delay(15); - return false; - } - - #endif // NEWPANEL - - #if HAS_BED_PROBE - /** - * Probe all invalidated locations of the mesh that can be reached by the probe. - * This attempts to fill in locations closest to the nozzle's start location first. - */ - void unified_bed_leveling::probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { - mesh_index_pair location; - - #if ENABLED(NEWPANEL) - lcd_external_control = true; - #endif - - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe - DEPLOY_PROBE(); - - uint16_t count = GRID_MAX_POINTS; - - do { - if (do_ubl_mesh_map) display_map(g29_map_type); - - #if ENABLED(NEWPANEL) - if (is_lcd_clicked()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n"); - lcd_quick_feedback(false); - STOW_PROBE(); - while (is_lcd_clicked()) idle(); - lcd_external_control = false; - restore_ubl_active_state_and_leave(); - lcd_quick_feedback(true); - safe_delay(50); // Debounce the Encoder wheel - return; - } - #endif - - if (do_furthest) - location = find_furthest_invalid_mesh_point(); - else - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL); - - 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); - - const float measured_z = probe_pt(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; - } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && --count); - - STOW_PROBE(); - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - 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) - ); - } - - - #endif // HAS_BED_PROBE - - #if ENABLED(NEWPANEL) - - void unified_bed_leveling::move_z_with_encoder(const float &multiplier) { - wait_for_release(); - while (!is_lcd_clicked()) { - idle(); - reset_stepper_timeout(); // Keep steppers powered - if (encoder_diff) { - do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) * multiplier); - encoder_diff = 0; - } - } - } - - float unified_bed_leveling::measure_point_with_encoder() { - KEEPALIVE_STATE(PAUSED_FOR_USER); - move_z_with_encoder(0.01f); - KEEPALIVE_STATE(IN_HANDLER); - return current_position[Z_AXIS]; - } - - static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); } - - float unified_bed_leveling::measure_business_card_thickness(float in_height) { - lcd_external_control = true; - save_ubl_active_state_and_disable(); // Disable bed level correction for probing - - do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); - //, MIN(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) * 0.5f); - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Place shim under nozzle"); - LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); - lcd_return_to_status(); - echo_and_take_a_measurement(); - - const float z1 = measure_point_with_encoder(); - do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE); - planner.synchronize(); - - SERIAL_PROTOCOLPGM("Remove shim"); - LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE); - echo_and_take_a_measurement(); - - const float z2 = measure_point_with_encoder(); - - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES); - - const float thickness = ABS(z1 - z2); - - if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPGM("Business Card is "); - SERIAL_PROTOCOL_F(thickness, 4); - SERIAL_PROTOCOLLNPGM("mm thick."); - } - - lcd_external_control = false; - - restore_ubl_active_state_and_leave(); - - return thickness; - } - - void abort_manual_probe_remaining_mesh() { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - lcd_quick_feedback(true); - ubl.restore_ubl_active_state_and_leave(); - } - - void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { - - lcd_external_control = true; - - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_clearance); - - lcd_return_to_status(); - - mesh_index_pair location; - do { - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_NOZZLE_AS_REFERENCE, NULL); - // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. - if (location.x_index < 0 && location.y_index < 0) continue; - - const float xProbe = mesh_index_to_xpos(location.x_index), - yProbe = mesh_index_to_ypos(location.y_index); - - if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) - - LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT); - - do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_z(z_clearance); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - lcd_external_control = true; - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2)); - - const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step - //const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click - - move_z_with_encoder(z_step); - - if (click_and_hold()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - restore_ubl_active_state_and_leave(); - return; - } - - z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick; - if (g29_verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mesh Point Measured at: "); - SERIAL_PROTOCOL_F(z_values[location.x_index][location.y_index], 6); - SERIAL_EOL(); - } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && location.y_index >= 0); - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - restore_ubl_active_state_and_leave(); - KEEPALIVE_STATE(IN_HANDLER); - do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE); - } - #endif // NEWPANEL - - bool unified_bed_leveling::g29_parameter_parsing() { - bool err_flag = false; - - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_DOING_G29); - lcd_quick_feedback(true); - #endif - - g29_constant = 0; - g29_repetition_cnt = 0; - - g29_x_flag = parser.seenval('X'); - g29_x_pos = g29_x_flag ? parser.value_float() : current_position[X_AXIS]; - g29_y_flag = parser.seenval('Y'); - g29_y_pos = g29_y_flag ? parser.value_float() : current_position[Y_AXIS]; - - if (parser.seen('R')) { - g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS; - NOMORE(g29_repetition_cnt, GRID_MAX_POINTS); - if (g29_repetition_cnt < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epetition count invalid (1+).\n"); - return UBL_ERR; - } - } - - g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; - if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).\n"); - err_flag = true; - } - - if (parser.seen('P')) { - const int pv = parser.value_int(); - #if !HAS_BED_PROBE - if (pv == 1) { - SERIAL_PROTOCOLLNPGM("G29 P1 requires a probe.\n"); - err_flag = true; - } - else - #endif - { - g29_phase_value = pv; - if (!WITHIN(g29_phase_value, 0, 6)) { - SERIAL_PROTOCOLLNPGM("?(P)hase value invalid (0-6).\n"); - err_flag = true; - } - } - } - - if (parser.seen('J')) { - #if HAS_BED_PROBE - g29_grid_size = parser.has_value() ? parser.value_int() : 0; - if (g29_grid_size && !WITHIN(g29_grid_size, 2, 9)) { - SERIAL_PROTOCOLLNPGM("?Invalid grid size (J) specified (2-9).\n"); - err_flag = true; - } - #else - SERIAL_PROTOCOLLNPGM("G29 J action requires a probe.\n"); - err_flag = true; - #endif - } - - if (g29_x_flag != g29_y_flag) { - SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n"); - err_flag = true; - } - - // If X or Y are not valid, use center of the bed values - if (!WITHIN(g29_x_pos, X_MIN_BED, X_MAX_BED)) g29_x_pos = X_CENTER; - if (!WITHIN(g29_y_pos, Y_MIN_BED, Y_MAX_BED)) g29_y_pos = Y_CENTER; - - if (err_flag) return UBL_ERR; - - /** - * Activate or deactivate UBL - * Note: UBL's G29 restores the state set here when done. - * Leveling is being enabled here with old data, possibly - * none. Error handling should disable for safety... - */ - if (parser.seen('A')) { - if (parser.seen('D')) { - SERIAL_PROTOCOLLNPGM("?Can't activate and deactivate at the same time.\n"); - return UBL_ERR; - } - set_bed_leveling_enabled(true); - report_state(); - } - else if (parser.seen('D')) { - set_bed_leveling_enabled(false); - report_state(); - } - - // Set global 'C' flag and its value - if ((g29_c_flag = parser.seen('C'))) - g29_constant = parser.value_float(); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seenval('F')) { - const float fh = parser.value_float(); - if (!WITHIN(fh, 0, 100)) { - SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); - return UBL_ERR; - } - set_z_fade_height(fh); - } - #endif - - g29_map_type = parser.intval('T'); - if (!WITHIN(g29_map_type, 0, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid map type.\n"); - return UBL_ERR; - } - return UBL_OK; - } - - static uint8_t ubl_state_at_invocation = 0; - - #ifdef UBL_DEVEL_DEBUGGING - static uint8_t ubl_state_recursion_chk = 0; - #endif - - void unified_bed_leveling::save_ubl_active_state_and_disable() { - #ifdef UBL_DEVEL_DEBUGGING - ubl_state_recursion_chk++; - if (ubl_state_recursion_chk != 1) { - SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR); - lcd_quick_feedback(true); - #endif - return; - } - #endif - ubl_state_at_invocation = planner.leveling_active; - set_bed_leveling_enabled(false); - } - - void unified_bed_leveling::restore_ubl_active_state_and_leave() { - #ifdef UBL_DEVEL_DEBUGGING - if (--ubl_state_recursion_chk) { - SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); - #if ENABLED(NEWPANEL) - LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR); - lcd_quick_feedback(true); - #endif - return; - } - #endif - set_bed_leveling_enabled(ubl_state_at_invocation); - } - - /** - * Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - * good to have the extra information. Soon... we prune this to just a few items - */ - void unified_bed_leveling::g29_what_command() { - report_state(); - - if (storage_slot == -1) - SERIAL_PROTOCOLPGM("No Mesh Loaded."); - else { - SERIAL_PROTOCOLPAIR("Mesh ", storage_slot); - SERIAL_PROTOCOLPGM(" Loaded."); - } - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_PROTOCOLPGM("planner.z_fade_height : "); - SERIAL_PROTOCOL_F(planner.z_fade_height, 4); - SERIAL_EOL(); - #endif - - adjust_mesh_to_mean(g29_c_flag, g29_constant); - - #if HAS_BED_PROBE - SERIAL_PROTOCOLPGM("zprobe_zoffset: "); - SERIAL_PROTOCOL_F(zprobe_zoffset, 7); - SERIAL_EOL(); - #endif - - SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); - SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); - safe_delay(50); - - SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - #if HAS_KILL - SERIAL_PROTOCOLPAIR("Kill pin on :", KILL_PIN); - SERIAL_PROTOCOLLNPAIR(" state:", READ(KILL_PIN)); - #endif - SERIAL_EOL(); - safe_delay(50); - - #ifdef UBL_DEVEL_DEBUGGING - SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index())); - SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index())); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); - SERIAL_EOL(); - safe_delay(25); - - SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes()); - SERIAL_PROTOCOLLNPGM(" meshes.\n"); - safe_delay(25); - #endif // UBL_DEVEL_DEBUGGING - - if (!sanity_check()) { - echo_name(); - SERIAL_PROTOCOLLNPGM(" sanity checks passed."); - } - } - - /** - * When we are fully debugged, the EEPROM dump command will get deleted also. But - * right now, it is good to have the extra information. Soon... we prune this. - */ - void unified_bed_leveling::g29_eeprom_dump() { - unsigned char cccc; - unsigned int kkkk; // Needs to be of unspecfied size to compile clean on all platforms - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM Dump:"); - for (uint16_t i = 0; i <= E2END; i += 16) { - if (!(i & 0x3)) idle(); - print_hex_word(i); - SERIAL_ECHOPGM(": "); - for (uint16_t j = 0; j < 16; j++) { - kkkk = i + j; - eeprom_read_block(&cccc, (const void *)kkkk, sizeof(unsigned char)); - print_hex_byte(cccc); - SERIAL_ECHO(' '); - } - SERIAL_EOL(); - } - SERIAL_EOL(); - } - - /** - * When we are fully debugged, this may go away. But there are some valid - * use cases for the users. So we can wait and see what to do with it. - */ - void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?Storage slot # required."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - g29_storage_slot = parser.value_int(); - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - settings.load_mesh(g29_storage_slot, &tmp_z_values); - - SERIAL_PROTOCOLPAIR("Subtracting mesh in slot ", g29_storage_slot); - SERIAL_PROTOCOLLNPGM(" from current mesh."); - - 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] -= tmp_z_values[x][y]; - } - - mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { - - bool found_a_NAN = false, found_a_real = false; - - mesh_index_pair out_mesh; - out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.99f; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if (isnan(z_values[i][j])) { // Check to see if this location holds an invalid mesh point - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); - - if (!position_is_reachable_by_probe(mx, my)) // make sure the probe can get to the mesh point - continue; - - found_a_NAN = true; - - int8_t closest_x = -1, closest_y = -1; - float d1, d2 = 99999.9f; - for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { - for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { - if (!isnan(z_values[k][l])) { - found_a_real = true; - - // Add in a random weighting factor that scrambles the probing of the - // last half of the mesh (when every unprobed mesh point is one index - // from a probed location). - - d1 = HYPOT(i - k, j - l) + (1.0f / ((millis() % 47) + 13)); - - if (d1 < d2) { // found a closer distance from invalid mesh point at (i,j) to defined mesh point at (k,l) - d2 = d1; // found a closer location with - closest_x = i; // an assigned mesh point value - closest_y = j; - } - } - } - } - - // - // At this point d2 should have the closest defined mesh point to invalid mesh point (i,j) - // - - if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) { - out_mesh.distance = d2; // found an invalid location with a greater distance - out_mesh.x_index = closest_x; // to a defined mesh point - out_mesh.y_index = closest_y; - } - } - } // for j - } // for i - - if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing - out_mesh.x_index = GRID_MAX_POINTS_X / 2; - out_mesh.y_index = GRID_MAX_POINTS_Y / 2; - out_mesh.distance = 1; - } - return out_mesh; - } - - mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &rx, const float &ry, const bool probe_as_reference, uint16_t bits[16]) { - mesh_index_pair out_mesh; - out_mesh.x_index = out_mesh.y_index = -1; - 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); - - float best_so_far = 99999.99f; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if ( (type == INVALID && isnan(z_values[i][j])) // Check to see if this location holds the right thing - || (type == REAL && !isnan(z_values[i][j])) - || (type == SET_IN_BITMAP && is_bitmap_set(bits, i, j)) - ) { - // We only get here if we found a Mesh Point of the specified type - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); - - // If using the probe as the reference there are some unreachable locations. - // Also for round beds, there are grid points outside the bed the nozzle can't reach. - // Prune them from the list and ignore them till the next Phase (manual nozzle probing). - - if (probe_as_reference ? !position_is_reachable_by_probe(mx, my) : !position_is_reachable(mx, my)) - continue; - - // Reachable. Check if it's the best_so_far location to the nozzle. - - float distance = HYPOT(px - mx, py - my); - - // factor in the distance from the current location for the normal case - // so the nozzle isn't running all over the bed. - distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1f; - if (distance < best_so_far) { - best_so_far = distance; // We found a closer location with - out_mesh.x_index = i; // the specified type of mesh value. - out_mesh.y_index = j; - out_mesh.distance = best_so_far; - } - } - } // for j - } // for i - - return out_mesh; - } - - #if ENABLED(NEWPANEL) - - void abort_fine_tune() { - lcd_return_to_status(); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - LCD_MESSAGEPGM(MSG_EDITING_STOPPED); - lcd_quick_feedback(true); - } - - void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { - if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified - g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; - if (!WITHIN(h_offset, 0, 10)) { - SERIAL_PROTOCOLLNPGM("Offset out of bounds. (0 to 10mm)\n"); - return; - } - #endif - - mesh_index_pair location; - - if (!position_is_reachable(rx, ry)) { - SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius."); - return; - } - - save_ubl_active_state_and_disable(); - - LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - lcd_external_control = true; // Take over control of the LCD encoder - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif - - uint16_t not_done[16]; - memset(not_done, 0xFF, sizeof(not_done)); - do { - location = find_closest_mesh_point_of_type(SET_IN_BITMAP, rx, ry, USE_NOZZLE_AS_REFERENCE, not_done); - - if (location.x_index < 0) break; // Stop when there are no more reachable points - - bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so a new - // location is used on the next loop - - const float rawx = mesh_index_to_xpos(location.x_index), - rawy = mesh_index_to_ypos(location.y_index); - - if (!position_is_reachable(rawx, rawy)) break; // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable - - do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point - - lcd_refresh(); - - float new_z = z_values[location.x_index][location.y_index]; - if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place - - lcd_mesh_edit_setup(new_z); - - do { - new_z = lcd_mesh_edit(); - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited - #endif - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (!is_lcd_clicked()); - - if (!lcd_map_control) lcd_return_to_status(); // Just editing a single point? Return to status - - if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing - - z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value - - safe_delay(20); // No switch noise - lcd_refresh(); - - } while (location.x_index >= 0 && --g29_repetition_cnt > 0); - - FINE_TUNE_EXIT: - - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - - if (do_ubl_mesh_map) display_map(g29_map_type); - restore_ubl_active_state_and_leave(); - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); - - LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); - SERIAL_ECHOLNPGM("Done Editing Mesh"); - - if (lcd_map_control) - lcd_goto_screen(_lcd_ubl_output_map_lcd); - else - lcd_return_to_status(); - } - - #endif // NEWPANEL - - /** - * 'Smart Fill': Scan from the outward edges of the mesh towards the center. - * If an invalid location is found, use the next two points (if valid) to - * calculate a 'reasonable' value for the unprobed mesh point. - */ - - bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - const int8_t x1 = x + xdir, x2 = x1 + xdir, - y1 = y + ydir, y2 = y1 + ydir; - // A NAN next to a pair of real values? - if (isnan(z_values[x][y]) && !isnan(z_values[x1][y1]) && !isnan(z_values[x2][y2])) { - if (z_values[x1][y1] < z_values[x2][y2]) // Angled downward? - z_values[x][y] = z_values[x1][y1]; // Use nearest (maybe a little too high.) - else - z_values[x][y] = 2.0f * z_values[x1][y1] - z_values[x2][y2]; // Angled upward... - return true; - } - return false; - } - - typedef struct { uint8_t sx, ex, sy, ey; bool yfirst; } smart_fill_info; - - void unified_bed_leveling::smart_fill_mesh() { - static const smart_fill_info - info0 PROGMEM = { 0, GRID_MAX_POINTS_X, 0, GRID_MAX_POINTS_Y - 2, false }, // Bottom of the mesh looking up - info1 PROGMEM = { 0, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - 1, 0, false }, // Top of the mesh looking down - info2 PROGMEM = { 0, GRID_MAX_POINTS_X - 2, 0, GRID_MAX_POINTS_Y, true }, // Left side of the mesh looking right - info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left - static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 }; - - for (uint8_t i = 0; i < COUNT(info); ++i) { - const smart_fill_info *f = (smart_fill_info*)pgm_read_ptr(&info[i]); - const int8_t sx = pgm_read_byte(&f->sx), sy = pgm_read_byte(&f->sy), - ex = pgm_read_byte(&f->ex), ey = pgm_read_byte(&f->ey); - if (pgm_read_byte(&f->yfirst)) { - const int8_t dir = ex > sx ? 1 : -1; - for (uint8_t y = sy; y != ey; ++y) - for (uint8_t x = sx; x != ex; x += dir) - if (smart_fill_one(x, y, dir, 0)) break; - } - else { - const int8_t dir = ey > sy ? 1 : -1; - for (uint8_t x = sx; x != ex; ++x) - for (uint8_t y = sy; y != ey; y += dir) - if (smart_fill_one(x, y, 0, dir)) break; - } - } - } - - #if HAS_BED_PROBE - - #include "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); - - bool abort_flag = false; - - float measured_z; - - const float dx = float(x_max - x_min) / (g29_grid_size - 1), - dy = float(y_max - y_min) / (g29_grid_size - 1); - - 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) { - measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_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; - 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); - } - - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level); - //z2 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_2_X, PROBE_PT_2_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); - } - } - - if (!abort_flag) { - measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level); - //z3 = measured_z; - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(PROBE_PT_3_X, PROBE_PT_3_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); - } - } - - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag) { - SERIAL_ECHOPGM("?Error probing point. Aborting operation.\n"); - return; - } - } - else { // !do_3_pt_leveling - - bool zig_zag = false; - for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - const float rx = float(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); - - if (!abort_flag) { - measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling - - abort_flag = isnan(measured_z); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(rx, 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(ry, 7); - SERIAL_ECHOPGM(") logical: "); - SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7); - SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7); - SERIAL_ECHOPGM(") measured: "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_ECHOPGM(" correction: "); - SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7); - } - #endif - - measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM(" final >>>---> "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_EOL(); - } - #endif - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, rx, ry, measured_z); - } - } - - zig_zag ^= true; - } - } - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag || finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOPGM("Could not complete LSF!"); - return; - } - - vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); - - if (g29_verbose_level > 2) { - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); - SERIAL_ECHOLNPGM("]"); - } - - matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - float x_tmp = mesh_index_to_xpos(i), - y_tmp = mesh_index_to_ypos(j), - z_tmp = z_values[i][j]; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("before rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); - SERIAL_ECHOPGM("] ---> "); - safe_delay(20); - } - #endif - - apply_rotation_xyz(rotation, x_tmp, y_tmp, z_tmp); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("after rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); - SERIAL_ECHOLNPGM("]"); - safe_delay(55); - } - #endif - - z_values[i][j] = z_tmp - lsf_results.D; - } - } - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - rotation.debug(PSTR("rotation matrix:\n")); - SERIAL_ECHOPGM("LSF Results A="); - SERIAL_PROTOCOL_F(lsf_results.A, 7); - SERIAL_ECHOPGM(" B="); - SERIAL_PROTOCOL_F(lsf_results.B, 7); - SERIAL_ECHOPGM(" D="); - SERIAL_PROTOCOL_F(lsf_results.D, 7); - SERIAL_EOL(); - safe_delay(55); - - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); - SERIAL_ECHOPGM("]\n"); - SERIAL_EOL(); - - /** - * The following code can be used to check the validity of the mesh tilting algorithm. - * When a 3-Point Mesh Tilt is done, the same algorithm is used as the grid based tilting. - * The only difference is just 3 points are used in the calculations. That fact guarantees - * each probed point should have an exact match when a get_z_correction() for that location - * 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; - SERIAL_ECHOPGM("D from 1st point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); - d = t + normal.z * z2; - SERIAL_EOL(); - SERIAL_ECHOPGM("D from 2nd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); - SERIAL_EOL(); - - t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); - d = t + normal.z * z3; - SERIAL_ECHOPGM("D from 3rd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); - SERIAL_EOL(); - - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0; - SERIAL_ECHOPGM("D from home location with Z=0 : "); - SERIAL_ECHO_F(d, 6); - SERIAL_EOL(); - - 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; - SERIAL_ECHOPGM("D from home location using mesh value for Z: "); - SERIAL_ECHO_F(d, 6); - - SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT); - SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT ); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); - SERIAL_EOL(); - #endif - } // DEBUGGING(LEVELING) - #endif - - } - - #endif // HAS_BED_PROBE - - #if ENABLED(UBL_G29_P31) - void unified_bed_leveling::smart_fill_wlsf(const float &weight_factor) { - - // For each undefined mesh point, compute a distance-weighted least squares fit - // from all the originally populated mesh points, weighted toward the point - // being extrapolated so that nearby points will have greater influence on - // the point being extrapolated. Then extrapolate the mesh point from WLSF. - - static_assert(GRID_MAX_POINTS_Y <= 16, "GRID_MAX_POINTS_Y too big"); - uint16_t bitmap[GRID_MAX_POINTS_X] = { 0 }; - struct linear_fit_data lsf_results; - - SERIAL_ECHOPGM("Extrapolating mesh..."); - - const float weight_scaled = weight_factor * MAX(MESH_X_DIST, MESH_Y_DIST); - - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) - if (!isnan(z_values[jx][jy])) - SBI(bitmap[jx], jy); - - for (uint8_t ix = 0; ix < GRID_MAX_POINTS_X; ix++) { - const float px = mesh_index_to_xpos(ix); - for (uint8_t iy = 0; iy < GRID_MAX_POINTS_Y; iy++) { - const float py = mesh_index_to_ypos(iy); - if (isnan(z_values[ix][iy])) { - // undefined mesh point at (px,py), compute weighted LSF from original valid mesh points. - incremental_LSF_reset(&lsf_results); - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) { - const float rx = mesh_index_to_xpos(jx); - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) { - if (TEST(bitmap[jx], jy)) { - const float ry = mesh_index_to_ypos(jy), - rz = z_values[jx][jy], - w = 1 + weight_scaled / HYPOT((rx - px), (ry - py)); - incremental_WLSF(&lsf_results, rx, ry, rz, w); - } - } - } - if (finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOLNPGM("Insufficient data"); - return; - } - const float ez = -lsf_results.D - lsf_results.A * px - lsf_results.B * py; - z_values[ix][iy] = ez; - idle(); // housekeeping - } - } - } - - SERIAL_ECHOLNPGM("done"); - } - #endif // UBL_G29_P31 - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin/ubl_motion.cpp b/Marlin_thinkerV2/Marlin/ubl_motion.cpp deleted file mode 100644 index 5272e20795..0000000000 --- a/Marlin_thinkerV2/Marlin/ubl_motion.cpp +++ /dev/null @@ -1,580 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#include "MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "Marlin.h" - #include "ubl.h" - #include "planner.h" - #include "stepper.h" - #include - #include - - #if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this - inline void set_current_from_destination() { COPY(current_position, destination); } - #else - extern void set_current_from_destination(); - #endif - - #if !UBL_SEGMENTED - - void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, 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 - * just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave - */ - #if ENABLED(SKEW_CORRECTION) - // For skew correction just adjust the destination point and we're done - float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] }, - end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] }; - planner.skew(start[X_AXIS], start[Y_AXIS], start[Z_AXIS]); - planner.skew(end[X_AXIS], end[Y_AXIS], end[Z_AXIS]); - #else - const float (&start)[XYZE] = current_position, - (&end)[XYZE] = destination; - #endif - - const int cell_start_xi = get_cell_index_x(start[X_AXIS]), - cell_start_yi = get_cell_index_y(start[Y_AXIS]), - cell_dest_xi = get_cell_index_x(end[X_AXIS]), - cell_dest_yi = get_cell_index_y(end[Y_AXIS]); - - if (g26_debug_flag) { - SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]); - SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]); - SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]); - SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]); - SERIAL_CHAR(')'); - SERIAL_EOL(); - debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()")); - } - - // A move within the same cell needs no splitting - if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { - - // For a move off the bed, use a constant Z raise - if (!WITHIN(cell_dest_xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cell_dest_yi, 0, GRID_MAX_POINTS_Y - 1)) { - - // Note: There is no Z Correction in this case. We are off the grid and don't know what - // a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH - // value, that will be used instead of a calculated (Bi-Linear interpolation) correction. - - const float z_raise = 0.0 - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - + 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); - set_current_from_destination(); - - if (g26_debug_flag) - debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination_cartesian()")); - - 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)); - - 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 ]), - z2 = z_values[cell_dest_xi ][cell_dest_yi + 1] + xratio * - (z_values[cell_dest_xi + 1][cell_dest_yi + 1] - z_values[cell_dest_xi][cell_dest_yi + 1]); - - 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)), - 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); - - if (g26_debug_flag) - debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination_cartesian()")); - - set_current_from_destination(); - return; - } - - /** - * Past this point the move is known to cross one or more mesh lines. Check for the most common - * case - crossing only one X or Y line - after details are worked out to reduce computation. - */ - - const float dx = end[X_AXIS] - start[X_AXIS], - dy = end[Y_AXIS] - start[Y_AXIS]; - - const int left_flag = dx < 0.0 ? 1 : 0, - down_flag = dy < 0.0 ? 1 : 0; - - const float adx = left_flag ? -dx : dx, - ady = down_flag ? -dy : dy; - - const int dxi = cell_start_xi == cell_dest_xi ? 0 : left_flag ? -1 : 1, - dyi = cell_start_yi == cell_dest_yi ? 0 : down_flag ? -1 : 1; - - /** - * Compute the extruder scaling factor for each partial move, checking for - * zero-length moves that would result in an infinite scaling factor. - * A float divide is required for this, but then it just multiplies. - * Also select a scaling factor based on the larger of the X and Y - * components. The larger of the two is used to preserve precision. - */ - - const bool use_x_dist = adx > ady; - - float on_axis_distance = use_x_dist ? dx : dy, - e_position = end[E_AXIS] - start[E_AXIS], - z_position = end[Z_AXIS] - start[Z_AXIS]; - - const float e_normalized_dist = e_position / on_axis_distance, - z_normalized_dist = z_position / on_axis_distance; - - int current_xi = cell_start_xi, - current_yi = cell_start_yi; - - const float m = dy / dx, - c = start[Y_AXIS] - m * start[X_AXIS]; - - const bool inf_normalized_flag = (isinf(e_normalized_dist) != 0), - inf_m_flag = (isinf(m) != 0); - - /** - * Handle vertical lines that stay within one column. - * These need not be perfectly vertical. - */ - if (dxi == 0) { // Vertical line? - current_yi += down_flag; // Line going down? Just go to the bottom. - while (current_yi != cell_dest_yi + down_flag) { - current_yi += dyi; - const float next_mesh_line_y = mesh_index_to_ypos(current_yi); - - /** - * Skip the calculations for an infinite slope. - * For others the next X is the same so this can continue. - * Calculate X at the next Y mesh line. - */ - const float rx = inf_m_flag ? start[X_AXIS] : (next_mesh_line_y - c) / m; - - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - const float ry = mesh_index_to_ypos(current_yi); - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading down, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (ry != start[Y_AXIS]) { - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder); - } //else printf("FIRST MOVE PRUNED "); - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("vertical move done in ubl.line_to_destination_cartesian()")); - - // At the final destination? Usually not, but when on a Y Mesh Line it's completed. - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - return; - } - - /** - * Handle horizontal lines that stay within one row. - * These need not be perfectly horizontal. - */ - if (dyi == 0) { // Horizontal line? - current_xi += left_flag; // Heading left? Just go to the left edge of the cell for the first move. - while (current_xi != cell_dest_xi + left_flag) { - current_xi += dxi; - const float next_mesh_line_x = mesh_index_to_xpos(current_xi), - ry = m * next_mesh_line_x + c; // Calculate Y at the next X mesh line - - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - const float rx = mesh_index_to_xpos(current_xi); - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading left, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (rx != start[X_AXIS]) { - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder)) - break; - } //else printf("FIRST MOVE PRUNED "); - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("horizontal move done in ubl.line_to_destination_cartesian()")); - - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - return; - } - - /** - * - * Handle the generic case of a line crossing both X and Y Mesh lines. - * - */ - - int xi_cnt = cell_start_xi - cell_dest_xi, - yi_cnt = cell_start_yi - cell_dest_yi; - - if (xi_cnt < 0) xi_cnt = -xi_cnt; - if (yi_cnt < 0) yi_cnt = -yi_cnt; - - current_xi += left_flag; - current_yi += down_flag; - - while (xi_cnt || yi_cnt) { - - const float next_mesh_line_x = mesh_index_to_xpos(current_xi + dxi), - next_mesh_line_y = mesh_index_to_ypos(current_yi + dyi), - ry = m * next_mesh_line_x + c, // Calculate Y at the next X mesh line - rx = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line - // (No need to worry about m being zero. - // If that was the case, it was already detected - // as a vertical line move above.) - - if (left_flag == (rx > next_mesh_line_x)) { // Check if we hit the Y line first - // Yes! Crossing a Y Mesh Line next - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi - left_flag, current_yi + dyi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : next_mesh_line_y - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - 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)) - break; - current_yi += dyi; - yi_cnt--; - } - else { - // Yes! Crossing a X Mesh Line next - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi + dxi, current_yi - down_flag) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? next_mesh_line_x - start[X_AXIS] : ry - start[Y_AXIS]; - e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; - } - else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; - } - - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder)) - break; - current_xi += dxi; - xi_cnt--; - } - - if (xi_cnt < 0 || yi_cnt < 0) break; // Too far! Exit the loop and go to FINAL_MOVE - } - - if (g26_debug_flag) - debug_current_and_destination(PSTR("generic move done in ubl.line_to_destination_cartesian()")); - - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) - goto FINAL_MOVE; - - set_current_from_destination(); - } - - #else // UBL_SEGMENTED - - #if IS_SCARA // scale the feed rate from mm/s to degrees/s - static float scara_feed_factor, scara_oldA, scara_oldB; - #endif - - // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic, - // so we call buffer_segment directly here. Per-segmented leveling and kinematics performed first. - - inline void _O2 ubl_buffer_segment_raw(const float (&in_raw)[XYZE], const float &fr) { - - #if ENABLED(SKEW_CORRECTION) - float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS] }; - planner.skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); - #else - const float (&raw)[XYZE] = in_raw; - #endif - - #if ENABLED(DELTA) // apply delta inverse_kinematics - - DELTA_IK(raw); - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder); - - #elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw) - - inverse_kinematics(raw); // this writes delta[ABC] from raw[XYZE] - // should move the feedrate scaling to scara inverse_kinematics - - const float adiff = ABS(delta[A_AXIS] - scara_oldA), - bdiff = ABS(delta[B_AXIS] - scara_oldB); - scara_oldA = delta[A_AXIS]; - scara_oldB = delta[B_AXIS]; - float s_feedrate = MAX(adiff, bdiff) * scara_feed_factor; - - planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], s_feedrate, active_extruder); - - #else // CARTESIAN - - planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_AXIS], fr, active_extruder); - - #endif - } - - #if IS_SCARA - #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm - #elif ENABLED(DELTA) - #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND) - #else // CARTESIAN - #ifdef LEVELED_SEGMENT_LENGTH - #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH - #else - #define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation) - #endif - #endif - - /** - * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics. - * This calls planner.buffer_segment multiple times for small incremental moves. - * 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) { - - if (!position_is_reachable(rtarget[X_AXIS], rtarget[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] - }; - - 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 = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = lroundf(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) - #else - uint16_t segments = lroundf(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length - #endif - - NOLESS(segments, 1U); // must have at least one segment - const float inv_segments = 1.0f / segments; // divide once, multiply thereafter - - #if IS_SCARA // scale the feed rate from mm/s to degrees/s - scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate; - scara_oldA = planner.get_axis_position_degrees(A_AXIS); - scara_oldB = planner.get_axis_position_degrees(B_AXIS); - #endif - - const float diff[XYZE] = { - total[X_AXIS] * inv_segments, - total[Y_AXIS] * inv_segments, - total[Z_AXIS] * inv_segments, - total[E_AXIS] * inv_segments - }; - - // Note that E segment distance could vary slightly as z mesh height - // changes for each segment, but small enough to ignore. - - float raw[XYZE] = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - 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 - while (--segments) { - LOOP_XYZE(i) raw[i] += diff[i]; - ubl_buffer_segment_raw(raw, feedrate); - } - ubl_buffer_segment_raw(rtarget, feedrate); - return false; // moved but did not set_current_from_destination(); - } - - // 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]); - #endif - - // increment to first segment destination - LOOP_XYZE(i) raw[i] += diff[i]; - - for (;;) { // for each mesh cell encountered during the move - - // Compute mesh cell invariants that remain constant for all segments within cell. - // Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter) - // the bilinear interpolation from the adjacent cell within the mesh will still work. - // Inner loop will exit each time (because out of cell bounds) but will come back - // 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)); - - cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); - cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); - - const float x0 = mesh_index_to_xpos(cell_xi), // 64 byte table lookup avoids mul+add - y0 = mesh_index_to_ypos(cell_yi); - - float z_x0y0 = z_values[cell_xi ][cell_yi ], // z at lower left corner - z_x1y0 = z_values[cell_xi+1][cell_yi ], // z at upper left corner - z_x0y1 = z_values[cell_xi ][cell_yi+1], // z at lower right corner - z_x1y1 = z_values[cell_xi+1][cell_yi+1]; // z at upper right corner - - if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A) - if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points - if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell, - if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points - - 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) - - 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_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) - - // As subsequent segments step through this cell, the z_cxy0 intercept will change - // and the z_cxym slope will change, both as a function of cx within the cell, and - // 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 - - for (;;) { // for all segments within this mesh cell - - if (--segments == 0) // if this is last segment, use rtarget for exact - COPY(raw, rtarget); - - const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * fade_scaling_factor // apply fade factor to interpolated mesh height - #endif - ; - - const float z = raw[Z_AXIS]; - raw[Z_AXIS] += z_cxcy; - ubl_buffer_segment_raw(raw, feedrate); - raw[Z_AXIS] = z; - - if (segments == 0) // done with last segment - return false; // did not set_current_from_destination() - - LOOP_XYZE(i) raw[i] += diff[i]; - - cx += diff[X_AXIS]; - cy += diff[Y_AXIS]; - - if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) // done within this cell, break to next - break; - - // Next segment still within same mesh cell, adjust the per-segment - // slope and intercept to compute next z height. - - z_cxy0 += z_sxy0; // adjust z_cxy0 by per-segment z_sxy0 - z_cxym += z_sxym; // adjust z_cxym by per-segment z_sxym - - } // segment loop - } // cell loop - - return false; // caller will update current_position - } - - #endif // UBL_SEGMENTED - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin/ultralcd.cpp b/Marlin_thinkerV2/Marlin/ultralcd.cpp deleted file mode 100644 index 974fa567d0..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd.cpp +++ /dev/null @@ -1,5802 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "MarlinConfig.h" - -#if ENABLED(ULTRA_LCD) - -#include "ultralcd.h" -#include "Marlin.h" -#include "language.h" -#include "cardreader.h" -#include "temperature.h" -#include "planner.h" -#include "stepper.h" -#include "configuration_store.h" -#include "utility.h" -#include "parser.h" - - -#if POWER_LOSS_RECOVER_SUPER_CAP -#include "power_loss_recovery.h" - -#endif -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) - #include "buzzer.h" -#endif - -#include "printcounter.h" - -#if ENABLED(PRINTCOUNTER) - #include "duration_t.h" -#endif - -#if ENABLED(BLTOUCH) - #include "endstops.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#elif HAS_ABL - #include "planner.h" -#elif ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - #include "mesh_bed_leveling.h" -#endif - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "power_loss_recovery.h" -#endif - -#if ENABLED(STATUS_MESSAGE_SCROLLING) - #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) - #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH - #else - #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) - #endif - uint8_t status_scroll_offset = 0; -#else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) -#endif - -char lcd_status_message[MAX_MESSAGE_LENGTH + 1]; -uint8_t lcd_status_update_delay = 1, // First update one loop delayed - lcd_status_message_level; // Higher level blocks lower level - -#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - millis_t previous_lcd_status_ms = 0; -#endif - -#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) - uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash; -#endif - -#if ENABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; -#endif - -#if ENABLED(DOGLCD) - #include "ultralcd_impl_DOGM.h" - #include - bool drawing_screen, first_page; // = false -#else - #include "ultralcd_impl_HD44780.h" - constexpr bool first_page = true; -#endif - -// The main status screen -void lcd_status_screen(); - -millis_t next_lcd_update_ms; - -uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) -uint16_t max_display_update_time = 0; - -#if ENABLED(ULTIPANEL) - - #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \ - inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type (*pget)(), void (*pset)(_type), ...) { \ - UNUSED(pstr2); UNUSED(pset); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(pget())); \ - } \ - typedef void _name##_void - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj); - #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) DRAW_BOOL_SETTING(sel, row, pstr, data) - #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) DRAW_BOOL_SETTING(sel, row, pstr, data) - #define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) - - #ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 - #endif - - bool no_reentry = false; - constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION); - - // Initialized by settings.load() - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool lcd_external_control; // = false - #endif - - #if ENABLED(BABYSTEPPING) - long babysteps_done = 0; - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - static void lcd_babystep_zoffset(); - #else - static void lcd_babystep_z(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes - uint8_t driverPercent[XYZE]; - #endif - - //////////////////////////////////////////// - ///////////////// Menu Tree //////////////// - //////////////////////////////////////////// - - void lcd_main_menu(); - void lcd_tune_menu(); - void lcd_prepare_menu(); - void lcd_move_menu(); - void lcd_control_menu(); - void lcd_control_temperature_menu(); - void lcd_control_motion_menu(); - - #if DISABLED(SLIM_LCD_MENUS) - void lcd_control_temperature_preheat_material1_settings_menu(); - void lcd_control_temperature_preheat_material2_settings_menu(); - #endif - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_control_filament_menu(); - #endif - - #if ENABLED(LCD_INFO_MENU) - #if ENABLED(PRINTCOUNTER) - void lcd_info_stats_menu(); - #endif - void lcd_info_thermistors_menu(); - void lcd_info_board_menu(); - void lcd_info_menu(); - #endif // LCD_INFO_MENU - - #if ENABLED(LED_CONTROL_MENU) - #include "leds.h" - void lcd_led_menu(); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu(); - #else - void lcd_temp_menu_e0_filament_change(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - void dac_driver_commit(); - void dac_driver_getValues(); - void lcd_dac_menu(); - void lcd_dac_write_eeprom(); - #endif - - #if ENABLED(FWRETRACT) - void lcd_control_retract_menu(); - #endif - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - void lcd_delta_calibrate_menu(); - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float new_z_fade_height; - void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); } - #endif - - //////////////////////////////////////////// - //////////// Menu System Actions /////////// - //////////////////////////////////////////// - - #define menu_action_back(dummy) _menu_action_back() - void _menu_action_back(); - void menu_action_submenu(screenFunc_t data); - void menu_action_gcode(const char* pgcode); - void menu_action_function(menuAction_t data); - - #define DECLARE_MENU_EDIT_TYPE(_type, _name) \ - bool _menu_edit_ ## _name(); \ - void menu_edit_ ## _name(); \ - void menu_edit_callback_ ## _name(); \ - void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \ - typedef void _name##_void - - DECLARE_MENU_EDIT_TYPE(int16_t, int3); - DECLARE_MENU_EDIT_TYPE(uint8_t, int8); - DECLARE_MENU_EDIT_TYPE(float, float3); - DECLARE_MENU_EDIT_TYPE(float, float52); - DECLARE_MENU_EDIT_TYPE(float, float43); - DECLARE_MENU_EDIT_TYPE(float, float5); - DECLARE_MENU_EDIT_TYPE(float, float51); - DECLARE_MENU_EDIT_TYPE(float, float52sign); - DECLARE_MENU_EDIT_TYPE(float, float62); - DECLARE_MENU_EDIT_TYPE(uint32_t, long5); - - void menu_action_setting_edit_bool(const char* pstr, bool* ptr); - void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc); - - #if ENABLED(SDSUPPORT) - void lcd_sdcard_menu(); - void menu_action_sdfile(CardReader& theCard); - void menu_action_sddirectory(CardReader& theCard); - #endif - - //////////////////////////////////////////// - //////////// Menu System Macros //////////// - //////////////////////////////////////////// - - /** - * MENU_ITEM generates draw & handler code for a menu item, potentially calling: - * - * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) - * menu_action_[type](arg3...) - * - * Examples: - * MENU_ITEM(back, MSG_WATCH, 0 [dummy parameter] ) - * or - * MENU_BACK(MSG_WATCH) - * lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH)) - * menu_action_back() - * - * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * menu_action_function(lcd_sdcard_pause) - * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - */ - #define _MENU_ITEM_PART_1(TYPE, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && lcd_clicked) { \ - lcd_clicked = false - - #define _MENU_ITEM_PART_2(TYPE, PLABEL, ...) \ - menu_action_ ## TYPE(__VA_ARGS__); \ - if (screen_changed) return; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define MENU_ITEM_P(TYPE, PLABEL, ...) do { \ - _skipStatic = false; \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - _MENU_ITEM_PART_2(TYPE, PLABEL, ## __VA_ARGS__); \ - }while(0) - - #define MENU_ITEM(TYPE, LABEL, ...) MENU_ITEM_P(TYPE, PSTR(LABEL), ## __VA_ARGS__) - - #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) - - // Used to print static text with no visible cursor. - // Parameters: label [, bool center [, bool invert [, char *value] ] ] - #define STATIC_ITEM_P(LABEL, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - - bool encoderRateMultiplierEnabled; - #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F) - - //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value - - /** - * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item - */ - #define MENU_MULTIPLIER_ITEM(TYPE, LABEL, ...) do { \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - encoderRateMultiplierEnabled = true; \ - lastEncoderMovementMillis = 0; \ - _MENU_ITEM_PART_2(TYPE, PSTR(LABEL), ## __VA_ARGS__); \ - }while(0) - - #else // !ENCODER_RATE_MULTIPLIER - #define ENCODER_RATE_MULTIPLY(F) NOOP - #endif // !ENCODER_RATE_MULTIPLIER - - #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) - #define MENU_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #else // !ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(setting_edit_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(setting_edit_callback_ ## TYPE, LABEL, PSTR(LABEL), ## __VA_ARGS__) - #endif // !ENCODER_RATE_MULTIPLIER - - #define SCREEN_OR_MENU_LOOP() \ - int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ - for (int8_t _lcdLineNr = 0; _lcdLineNr < menu_bottom; _lcdLineNr++, _menuLineNr++) { \ - _thisItemNr = 0 - - /** - * START_SCREEN Opening code for a screen having only static items. - * Do simplified scrolling of the entire screen. - * - * START_MENU Opening code for a screen with menu items. - * Scroll as-needed to keep the selected line in view. - */ - #define START_SCREEN() \ - scroll_screen(menu_bottom, false); \ - bool _skipStatic = false; \ - SCREEN_OR_MENU_LOOP() - - #define START_MENU() \ - scroll_screen(1, true); \ - bool _skipStatic = true; \ - SCREEN_OR_MENU_LOOP() - - #define END_SCREEN() \ - } \ - screen_items = _thisItemNr - - #define END_MENU() \ - } \ - screen_items = _thisItemNr; \ - UNUSED(_skipStatic) - - //////////////////////////////////////////// - ///////////// Global Variables ///////////// - //////////////////////////////////////////// - - /** - * REVERSE_MENU_DIRECTION - * - * To reverse the menu direction we need a general way to reverse - * the direction of the encoder everywhere. So encoderDirection is - * added to allow the encoder to go the other way. - * - * This behavior is limited to scrolling Menus and SD card listings, - * and is disabled in other contexts. - */ - #if ENABLED(REVERSE_MENU_DIRECTION) - int8_t encoderDirection = 1; - #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) - #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) - #else - #define ENCODER_DIRECTION_NORMAL() ; - #define ENCODER_DIRECTION_MENUS() ; - #endif - - // Encoder Movement - volatile int8_t encoderDiff; // Updated in lcd_buttons_update, added to encoderPosition every LCD update - uint32_t encoderPosition; - millis_t lastEncoderMovementMillis = 0; - - // Button States - bool lcd_clicked, wait_for_unclick; - volatile uint8_t buttons; - millis_t next_button_update_ms; - #if ENABLED(REPRAPWORLD_KEYPAD) - volatile uint8_t buttons_reprapworld_keypad; - #endif - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - volatile uint8_t slow_buttons; - #endif - - // Menu System Navigation - screenFunc_t currentScreen = lcd_status_screen; - int8_t encoderTopLine; - typedef struct { - screenFunc_t menu_function; - uint32_t encoder_position; - } menuPosition; - menuPosition screen_history[6]; - uint8_t screen_history_depth = 0; - bool screen_changed, defer_return_to_status; - - // Value Editing - const char *editLabel; - void *editValue; - int32_t minEditValue, maxEditValue; - screenFunc_t callbackFunc; - bool liveEdit; - - // Manual Moves - const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE; - millis_t manual_move_start_time = 0; - int8_t manual_move_axis = (int8_t)NO_AXIS; - #if EXTRUDERS > 1 - int8_t manual_move_e_index = 0; - #else - #define manual_move_e_index 0 - #endif - - #if IS_KINEMATIC - bool processing_manual_move = false; - float manual_move_offset = 0; - #else - constexpr bool processing_manual_move = false; - #endif - - #if PIN_EXISTS(SD_DETECT) - uint8_t lcd_sd_status; - #endif - - #if ENABLED(PIDTEMP) - float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits - #endif - - inline bool use_click() { - const bool click = lcd_clicked; - lcd_clicked = false; - return click; - } - - /** - * General function to go directly to a screen - */ - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { - if (currentScreen != screen) { - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - new_z_fade_height = planner.z_fade_height; - #endif - - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) - static millis_t doubleclick_expire_ms = 0; - // Going to lcd_main_menu from status screen? Remember first click time. - // Going back to status screen within a very short time? Go to Z babystepping. - if (screen == lcd_main_menu) { - if (currentScreen == lcd_status_screen) - doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; - } - else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms) && (planner.movesplanned() || IS_SD_PRINTING)) - screen = - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - lcd_babystep_zoffset - #else - lcd_babystep_z - #endif - ; - #endif - - currentScreen = screen; - encoderPosition = encoder; - if (screen == lcd_status_screen) { - defer_return_to_status = false; - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.lcd_map_control = false; - #endif - screen_history_depth = 0; - } - lcd_implementation_clear(); - // Re-initialize custom characters that may be re-used - #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL) - if (!ubl.lcd_map_control) { - lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) - screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU - #endif - ); - } - #elif ENABLED(LCD_PROGRESS_BAR) - lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); - #endif - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - } - } - - /** - * Show "Moving..." till moves are done, then revert to previous display. - */ - static const char moving[] PROGMEM = MSG_MOVING; - static const char *sync_message = moving; - - // - // Display the synchronize screen until moves are - // finished, and don't return to the caller until - // done. ** This blocks the command queue! ** - // - void _lcd_synchronize() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); - if (no_reentry) return; - // Make this the current handler till all moves are done - no_reentry = true; - const screenFunc_t old_screen = currentScreen; - lcd_goto_screen(_lcd_synchronize); - planner.synchronize(); // idle() is called until moves complete - no_reentry = false; - lcd_goto_screen(old_screen); - } - - // Display the synchronize screen with a custom message - // ** This blocks the command queue! ** - void lcd_synchronize(const char * const msg=NULL) { - sync_message = msg ? msg : moving; - _lcd_synchronize(); - } - - void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } - - void lcd_save_previous_screen() { - if (screen_history_depth < COUNT(screen_history)) { - screen_history[screen_history_depth].menu_function = currentScreen; - screen_history[screen_history_depth].encoder_position = encoderPosition; - ++screen_history_depth; - } - } - - void lcd_goto_previous_menu() { - if (screen_history_depth > 0) { - --screen_history_depth; - lcd_goto_screen( - screen_history[screen_history_depth].menu_function, - screen_history[screen_history_depth].encoder_position - ); - } - else - lcd_return_to_status(); - } - - void lcd_goto_previous_menu_no_defer() { - defer_return_to_status = false; - lcd_goto_previous_menu(); - } - - /** - * Scrolling for menus and other line-based screens - * - * encoderLine is the position based on the encoder - * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM - * screen_items is the total number of items in the menu (after one call) - */ - int8_t encoderLine, screen_items; - void scroll_screen(const uint8_t limit, const bool is_menu) { - ENCODER_DIRECTION_MENUS(); - ENCODER_RATE_MULTIPLY(false); - if (encoderPosition > 0x8000) encoderPosition = 0; - if (first_page) { - encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); - screen_changed = false; - } - if (screen_items > 0 && encoderLine >= screen_items - limit) { - encoderLine = MAX(0, screen_items - limit); - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); - } - if (is_menu) { - NOMORE(encoderTopLine, encoderLine); - if (encoderLine >= encoderTopLine + menu_bottom) - encoderTopLine = encoderLine - menu_bottom + 1; - } - else - encoderTopLine = encoderLine; - } - -#endif // ULTIPANEL - -#if POWER_LOSS_RECOVER_SUPER_CAP -void lcd_recover_ok(void) -{ - char tmp_n[64]; - recovery_detect_cap.recovery=0; - lcd_goto_screen(lcd_status_screen); - SERIAL_ECHOLN(recovery_detect_cap.file_name); - recovery_detect_cap.recovery=1; - sprintf_P(tmp_n,PSTR("G92 Z%u.%u"),recovery_detect_cap.Z_t/10,recovery_detect_cap.Z_t%10); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - sprintf_P(tmp_n,PSTR("G92 E%u"),recovery_detect_cap.E_t); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - sprintf_P(tmp_n,PSTR("M104 S%u"),recovery_detect_cap.T0_t); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); -} -void lcd_cover_cancel(void) -{ - char tmp_n[32]; - recovery_detect_cap.recovery=0; - recovery_detect_cap.file_name[0]=0; - sprintf_P(tmp_n,PSTR("M500")); - SERIAL_ECHOLN(tmp_n); - enqueue_and_echo_command(tmp_n); - lcd_goto_screen(lcd_status_screen); - - -} - -void lcd_recovery(void) -{ - START_MENU(); - MENU_ITEM(submenu, "Resume Print ?", lcd_recovery); - MENU_ITEM(submenu, "YES ", lcd_recover_ok); - MENU_ITEM(submenu, "NO ", lcd_cover_cancel); - END_MENU(); - -} - - -void lcd_recover_menu(void) -{ - lcd_goto_screen(lcd_recovery); - -} -#endif - -/** - * - * "Info Screen" - * - * This is very display-dependent, so the lcd implementation draws this. - */ - -void lcd_status_screen() { - - #if ENABLED(ULTIPANEL) - ENCODER_DIRECTION_NORMAL(); - ENCODER_RATE_MULTIPLY(false); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING) - progress_bar_percent = card.percentDone(); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - - // - // HD44780 implements the following message blinking and - // message expiration because Status Line and Progress Bar - // share the same line on the display. - // - - millis_t ms = millis(); - - // If the message will blink rather than expire... - #if DISABLED(PROGRESS_MSG_ONCE) - if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) - progress_bar_ms = ms; - #endif - - #if PROGRESS_MSG_EXPIRE > 0 - - // Handle message expire - if (expire_status_ms > 0) { - - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - - // Expire the message if a job is active and the bar has ticks - if (progress_bar_percent > 2 && !print_job_timer.isPaused()) { - if (ELAPSED(ms, expire_status_ms)) { - lcd_status_message[0] = '\0'; - expire_status_ms = 0; - } - } - else { - // Defer message expiration before bar appears - // and during any pause (not just SD) - expire_status_ms += LCD_UPDATE_INTERVAL; - } - } - - #endif // PROGRESS_MSG_EXPIRE - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(ULTIPANEL) - - if (use_click()) { - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); // get status message to show up for a while - #endif - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) - CHARSET_MENU - #endif - ); - lcd_goto_screen(lcd_main_menu); - return; - } - - #if ENABLED(ULTIPANEL_FEEDMULTIPLY) - const int16_t new_frm = feedrate_percentage + (int32_t)encoderPosition; - // Dead zone at 100% feedrate - if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) { - feedrate_percentage = 100; - encoderPosition = 0; - } - else if (feedrate_percentage == 100) { - if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) { - feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); - encoderPosition = 0; - } - else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) { - feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; - encoderPosition = 0; - } - } - else { - feedrate_percentage = new_frm; - encoderPosition = 0; - } - #endif // ULTIPANEL_FEEDMULTIPLY - - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - - #endif // ULTIPANEL - - lcd_implementation_status_screen(); -} - -/** - * Reset the status message - */ -void lcd_reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; - const char *msg; - if (print_job_timer.isPaused()) - msg = paused; - #if ENABLED(SDSUPPORT) - else if (card.sdprinting) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); -} - -/** - * - * draw the kill screen - * - */ -void kill_screen(const char* lcd_msg) { - lcd_init(); - lcd_setalertstatusPGM(lcd_msg); - lcd_kill_screen(); -} - -/** - * - * Audio feedback for controller clicks - * - */ -void lcd_buzz(const long duration, const uint16_t freq) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(duration, freq); - #else - UNUSED(duration); UNUSED(freq); - #endif -} - -void lcd_quick_feedback(const bool clear_buttons) { - - #if ENABLED(ULTIPANEL) - lcd_refresh(); - if (clear_buttons) buttons = 0; - next_button_update_ms = millis() + 500; - #else - UNUSED(clear_buttons); - #endif - - // Buzz and wait. The delay is needed for buttons to settle! - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - - #if ENABLED(ULTIPANEL) - #if ENABLED(LCD_USE_I2C_BUZZER) - delay(10); - #elif PIN_EXISTS(BEEPER) - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #endif - #endif -} - -#if ENABLED(ULTIPANEL) - - void lcd_completion_feedback(const bool good/*=true*/) { - if (good) { - lcd_buzz(100, 659); - lcd_buzz(100, 698); - } - else lcd_buzz(20, 440); - } - - inline void line_to_current_z() { - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder); - } - - inline void line_to_z(const float &z) { - current_position[Z_AXIS] = z; - line_to_current_z(); - } - - #if ENABLED(SDSUPPORT) - - void lcd_sdcard_pause() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); - #endif - lcd_reset_status(); - } - - void lcd_sdcard_resume() { - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M24")); - #else - card.startFileprint(); - print_job_timer.start(); - #endif - lcd_reset_status(); - } - - bool abort_sd_printing; // =false - - void lcd_sdcard_stop() { - wait_for_heatup = wait_for_user = false; - abort_sd_printing = true; - lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); - lcd_return_to_status(); - } - - #endif // SDSUPPORT - - #if ENABLED(POWER_LOSS_RECOVERY) - - static void lcd_power_loss_recovery_resume() { - char cmd[20]; - - // Return to status now - lcd_return_to_status(); - - // Turn leveling off and home - enqueue_and_echo_commands_P(PSTR("M420 S0\nG28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" - #endif - )); - - #if HAS_HEATED_BED - const int16_t bt = job_recovery_info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - enqueue_and_echo_command(cmd); - } - #endif - - // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = job_recovery_info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); - enqueue_and_echo_command(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - enqueue_and_echo_command(cmd); - } - } - - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), job_recovery_info.active_hotend); - enqueue_and_echo_command(cmd); - #endif - - // Restore print cooling fan speeds - for (uint8_t i = 0; i < FAN_COUNT; i++) { - int16_t f = job_recovery_info.fanSpeeds[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - enqueue_and_echo_command(cmd); - } - } - - // Start draining the job recovery command queue - job_recovery_phase = JOB_RECOVERY_YES; - } - - static void lcd_power_loss_recovery_cancel() { - card.removeJobRecoveryFile(); - card.autostart_index = 0; - lcd_return_to_status(); - } - - static void lcd_job_recovery_menu() { - defer_return_to_status = true; - START_MENU(); - STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); - END_MENU(); - } - - #endif // POWER_LOSS_RECOVERY - - #if ENABLED(MENU_ITEM_CASE_LIGHT) - - extern uint8_t case_light_brightness; - extern bool case_light_on; - extern void update_case_light(); - - void case_light_menu() { - START_MENU(); - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - END_MENU(); - } - #endif // MENU_ITEM_CASE_LIGHT - - #if ENABLED(BLTOUCH) - - /** - * - * "BLTouch" submenu - * - */ - static void bltouch_menu() { - START_MENU(); - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); - MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); - END_MENU(); - } - - #endif // BLTOUCH - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - - static void progress_bar_test() { - static int8_t bar_percent = 0; - if (use_click()) { - lcd_goto_previous_menu(); - lcd_set_custom_characters(CHARSET_MENU); - return; - } - bar_percent += (int8_t)encoderPosition; - bar_percent = constrain(bar_percent, 0, 100); - encoderPosition = 0; - lcd_implementation_drawmenu_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); - lcd.setCursor((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); - lcd.print(itostr3(bar_percent)); lcd.write('%'); - lcd.setCursor(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent); - } - - void _progress_bar_test() { - lcd_goto_screen(progress_bar_test); - lcd_set_custom_characters(); - } - - #endif // LCD_PROGRESS_BAR_TEST - - #if HAS_DEBUG_MENU - - void lcd_debug_menu() { - START_MENU(); - - MENU_BACK(MSG_MAIN); // ^ Main - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test); - #endif - - END_MENU(); - } - - #endif // HAS_DEBUG_MENU - - #if ENABLED(CUSTOM_USER_MENUS) - - #ifdef USER_SCRIPT_DONE - #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE - #else - #define _DONE_SCRIPT "" - #endif - - void _lcd_user_gcode(const char * const cmd) { - enqueue_and_echo_commands_P(cmd); - #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) - lcd_completion_feedback(); - #endif - #if ENABLED(USER_SCRIPT_RETURN) - lcd_return_to_status(); - #endif - } - - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); } - #endif - - void _lcd_user_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1); - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2); - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3); - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4); - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5); - #endif - END_MENU(); - } - - #endif - - /** - * - * "Main" menu - * - */ - - void lcd_main_menu() { - START_MENU(); - MENU_BACK(MSG_WATCH); - - #if ENABLED(CUSTOM_USER_MENUS) - MENU_ITEM(submenu, MSG_USER_MENU, _lcd_user_menu); - #endif - - // - // Debug Menu when certain options are enabled - // - #if HAS_DEBUG_MENU - MENU_ITEM(submenu, MSG_DEBUG_MENU, lcd_debug_menu); - #endif - - // - // Set Case light on/off/brightness - // - #if ENABLED(MENU_ITEM_CASE_LIGHT) - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) { - MENU_ITEM(submenu, MSG_CASE_LIGHT, case_light_menu); - } - else - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - #endif - - if (planner.movesplanned() || IS_SD_PRINTING) - MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); - else - MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); - - MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); - - #if ENABLED(SDSUPPORT) - if (card.cardOK) { - if (card.isFileOpen()) { - if (card.sdprinting) - MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); - else - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); - } - else { - MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user - #endif - } - } - else { - MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface - #endif - } - #endif // SDSUPPORT - - #if ENABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); - #endif - - #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu); - #endif - - END_MENU(); - } - - /** - * - * "Tune" submenu items - * - */ - - #if HAS_M206_COMMAND - /** - * Set the home offset based on the current_position - */ - void lcd_set_home_offsets() { - // M428 Command - enqueue_and_echo_commands_P(PSTR("M428")); - lcd_return_to_status(); - } - #endif - - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - void _lcd_zoffset_overlay_gfx(const float zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } - - #if ENABLED(OVERLAY_GFX_REVERSE) - const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp; - #else - const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp; - #endif - - #if ENABLED(USE_BIG_EDIT_FONT) - const int left = 0, right = 45, nozzle = 95; - #else - const int left = 5, right = 90, nozzle = 60; - #endif - - // Draw a representation of the nozzle - if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); - if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); - - // Draw cw/ccw indicator and up/down arrows. - if (PAGE_CONTAINS(47, 62)) { - u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down); - u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up); - u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp); - u8g.drawBitmapP(left + 20, 49 - dir, 2, 13, down_arrow_bmp); - } - } - - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - - #if ENABLED(BABYSTEPPING) - - void _lcd_babystep(const AxisEnum axis, const char* msg) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - thermalManager.babystep_axis(axis, babystep_increment); - babysteps_done += babystep_increment; - } - if (lcdDrawUpdate) - lcd_implementation_drawedit(msg, ftostr43sign(planner.steps_to_mm[axis] * babysteps_done)); - } - - #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); } - void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; defer_return_to_status = true; } - void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; } - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - - void lcd_babystep_zoffset() { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - defer_return_to_status = true; - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; - - const float new_zoffset = zprobe_zoffset + planner.steps_to_mm[Z_AXIS] * babystep_increment; - if (WITHIN(new_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - thermalManager.babystep_axis(Z_AXIS, babystep_increment); - zprobe_zoffset = new_zoffset; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - } - if (lcdDrawUpdate) { - lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(zprobe_zoffset); - #endif - } - } - - #else // !BABYSTEP_ZPROBE_OFFSET - - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); } - void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; } - - #endif // !BABYSTEP_ZPROBE_OFFSET - - #endif // BABYSTEPPING - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places. So we keep a - // separate value that doesn't lose precision. - static int16_t ubl_encoderPosition = 0; - - static void _lcd_mesh_fine_tune(const char* msg) { - defer_return_to_status = true; - if (ubl.encoder_diff) { - ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; - ubl.encoder_diff = 0; - - mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; - mesh_edit_value = mesh_edit_accumulator; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - - const int32_t rounded = (int32_t)(mesh_edit_value * 1000); - mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; - } - - if (lcdDrawUpdate) { - lcd_implementation_drawedit(msg, ftostr43sign(mesh_edit_value)); - #if ENABLED(MESH_EDIT_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(mesh_edit_value); - #endif - } - } - - void _lcd_mesh_edit_NOP() { - defer_return_to_status = true; - } - - float lcd_mesh_edit() { - lcd_goto_screen(_lcd_mesh_edit_NOP); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - _lcd_mesh_fine_tune(PSTR("Mesh Editor")); - return mesh_edit_value; - } - - void lcd_mesh_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_mesh_edit_NOP); - } - - void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); - } - - float lcd_z_offset_edit() { - lcd_goto_screen(_lcd_z_offset_edit); - return mesh_edit_value; - } - - void lcd_z_offset_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_z_offset_edit); - } - - #endif // AUTO_BED_LEVELING_UBL - - - /** - * Watch temperature callbacks - */ - #if HAS_TEMP_HOTEND - #if WATCH_HOTENDS - #define _WATCH_FUNC(N) thermalManager.start_watching_heater(N) - #else - #define _WATCH_FUNC(N) NOOP - #endif - void watch_temp_callback_E0() { _WATCH_FUNC(0); } - #if HOTENDS > 1 - void watch_temp_callback_E1() { _WATCH_FUNC(1); } - #if HOTENDS > 2 - void watch_temp_callback_E2() { _WATCH_FUNC(2); } - #if HOTENDS > 3 - void watch_temp_callback_E3() { _WATCH_FUNC(3); } - #if HOTENDS > 4 - void watch_temp_callback_E4() { _WATCH_FUNC(4); } - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HAS_TEMP_HOTEND - - void watch_temp_callback_bed() { - #if WATCH_THE_BED - thermalManager.start_watching_bed(); - #endif - } - - // First Fan Speed title in "Tune" and "Control>Temperature" menus - #if FAN_COUNT > 0 && HAS_FAN0 - #if FAN_COUNT > 1 - #define FAN_SPEED_1_SUFFIX " 1" - #else - #define FAN_SPEED_1_SUFFIX "" - #endif - #endif - - // Refresh the E factor after changing flow - inline void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } - #if EXTRUDERS > 1 - inline void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } - inline void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); } - #if EXTRUDERS > 2 - inline void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); } - #if EXTRUDERS > 3 - inline void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); } - #if EXTRUDERS > 4 - inline void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); } - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - /** - * - * "Tune" submenu - * - */ - void lcd_tune_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - - // - // Speed: - // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); - - // - // Manual bed leveling, Bed Z: - // - #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - // - // Leveling Fade Height - // - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(SLIM_LCD_MENUS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fanSpeeds[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fanSpeeds[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 2", &new_fanSpeeds[1], 3, 255); - #endif - #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 3", &new_fanSpeeds[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Flow: - // Flow [1-5]: - // - #if EXTRUDERS == 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - #else // EXTRUDERS > 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3); - #if EXTRUDERS > 4 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - // - // Babystep X: - // Babystep Y: - // Babystep Z: - // - #if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_XY) - MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); - MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); - #endif - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #else - MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); - #endif - #endif - - // - // Change filament - // - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - #endif - - END_MENU(); - } - - /** - * - * "Driver current control" submenu items - * - */ - #if ENABLED(DAC_STEPPER_CURRENT) - - void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); } - - void dac_driver_commit() { dac_current_set_percents(driverPercent); } - - void dac_driver_eeprom_write() { dac_commit_eeprom(); } - - void lcd_dac_menu() { - dac_driver_getValues(); - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_E " " MSG_DAC_PERCENT, &driverPercent[E_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_driver_eeprom_write); - END_MENU(); - } - - #endif // DAC_STEPPER_CURRENT - - #if HAS_MOTOR_CURRENT_PWM - - void lcd_pwm_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_X MSG_Y, &stepper.motor_current_setting[0], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_Z, &stepper.motor_current_setting[1], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_E, &stepper.motor_current_setting[2], 100, 2000, Stepper::refresh_motor_power); - #endif - END_MENU(); - } - - #endif // HAS_MOTOR_CURRENT_PWM - - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - - /** - * - * "Prepare" submenu items - * - */ - void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const int16_t fan) { - if (temph > 0) thermalManager.setTargetHotend(MIN(heater_maxtemp[endnum], temph), endnum); - #if HAS_HEATED_BED - if (tempb >= 0) thermalManager.setTargetBed(tempb); - #else - UNUSED(tempb); - #endif - #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; - #else - fanSpeeds[0] = fan; - #endif - #else - UNUSED(fan); - #endif - lcd_return_to_status(); - } - - #if HAS_TEMP_HOTEND - void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #endif - - #if HOTENDS > 1 - void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 2 - void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 3 - void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #if HOTENDS > 4 - void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - - void lcd_preheat_m1_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m1_e0(); - #else - lcd_preheat_m1_e0_only(); - #endif - } - void lcd_preheat_m2_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m2_e0(); - #else - lcd_preheat_m2_e0_only(); - #endif - } - - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - #endif - - #if HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_preheat_m1_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); - #endif - END_MENU(); - } - - void lcd_preheat_m2_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); - #endif - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); - #endif - END_MENU(); - } - - #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_cooldown() { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; - #endif - thermalManager.disable_all_heaters(); - lcd_return_to_status(); - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * If the queue is full, the command will fail, so we have to loop - * with idle() to make sure the command has been enqueued. - */ - void lcd_enqueue_command(char * const cmd) { - no_reentry = true; - enqueue_and_echo_command_now(cmd); - no_reentry = false; - } - - void lcd_enqueue_commands_P(const char * const cmd) { - no_reentry = true; - enqueue_and_echo_commands_now_P(cmd); - no_reentry = false; - } - - #endif - - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - - void lcd_autostart_sd() { card.beginautostart(); } - - #endif - - #if ENABLED(EEPROM_SETTINGS) - static void lcd_store_settings() { lcd_completion_feedback(settings.save()); } - static void lcd_load_settings() { lcd_completion_feedback(settings.load()); } - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - - /** - * Level corners, starting in the front-left corner. - */ - static int8_t bed_corner; - void _lcd_goto_next_corner() { - line_to_z(4.0); - switch (bed_corner) { - case 0: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; - break; - case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 3: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: - current_position[X_AXIS] = X_CENTER; - current_position[Y_AXIS] = Y_CENTER; - break; - #endif - } - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); - line_to_z(0.0); - if (++bed_corner > 3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - ) bed_corner = 0; - } - - void _lcd_corner_submenu() { - START_MENU(); - MENU_ITEM(function, - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - , _lcd_goto_next_corner); - MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); - END_MENU(); - } - - void _lcd_level_bed_corners() { - defer_return_to_status = true; - lcd_goto_screen(_lcd_corner_submenu); - bed_corner = 0; - _lcd_goto_next_corner(); - } - - #endif // LEVEL_BED_CORNERS - - #if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - - /** - * - * "Prepare" > "Level Bed" handlers - * - */ - - static uint8_t manual_probe_index; - - // LCD probed points are from defaults - constexpr uint8_t total_probe_points = ( - #if ENABLED(AUTO_BED_LEVELING_3POINT) - 3 - #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) - GRID_MAX_POINTS - #endif - ); - - bool lcd_wait_for_move; - - // - // Bed leveling is done. Wait for G29 to complete. - // A flag is used so that this can release control - // and allow the command queue to be processed. - // - // When G29 finishes the last move: - // - Raise Z to the "manual probe height" - // - Don't return until done. - // - // ** This blocks the command queue! ** - // - void _lcd_level_bed_done() { - if (!lcd_wait_for_move) { - #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) - // Display "Done" screen and wait for moves to complete - line_to_z(MANUAL_PROBE_HEIGHT); - lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE)); - #endif - lcd_goto_previous_menu_no_defer(); - lcd_completion_feedback(); - } - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - - void _lcd_level_goto_next_point(); - - /** - * Step 7: Get the Z coordinate, click goes to the next point or exits - */ - void _lcd_level_bed_get_z() { - ENCODER_DIRECTION_NORMAL(); - - if (use_click()) { - - // - // Save the current Z position and move - // - - // If done... - if (++manual_probe_index >= total_probe_points) { - // - // The last G29 records the point and enables bed leveling - // - lcd_wait_for_move = true; - lcd_goto_screen(_lcd_level_bed_done); - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(PSTR("G29 S2")); - #elif ENABLED(PROBE_MANUALLY) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - else - _lcd_level_goto_next_point(); - - return; - } - - // - // Encoder knob or keypad buttons adjust the Z position - // - if (encoderPosition) { - const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP); - line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - encoderPosition = 0; - } - - // - // Draw on first display, then only on Z change - // - if (lcdDrawUpdate) { - const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); - } - } - - /** - * Step 6: Display "Next point: 1 / 9" while waiting for move to finish - */ - void _lcd_level_bed_moving() { - if (lcdDrawUpdate) { - char msg[10]; - sprintf_P(msg, PSTR("%i / %u"), (int)(manual_probe_index + 1), total_probe_points); - lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); - } - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (!lcd_wait_for_move) lcd_goto_screen(_lcd_level_bed_get_z); - } - - /** - * Step 5: Initiate a move to the next point - */ - void _lcd_level_goto_next_point() { - lcd_goto_screen(_lcd_level_bed_moving); - - // G29 Records Z, moves, and signals when it pauses - lcd_wait_for_move = true; - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); - #elif ENABLED(PROBE_MANUALLY) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - - /** - * Step 4: Display "Click to Begin", wait for click - * Move to the first probe position - */ - void _lcd_level_bed_homing_done() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); - if (use_click()) { - manual_probe_index = 0; - _lcd_level_goto_next_point(); - } - } - - /** - * Step 3: Display "Homing XYZ" - Wait for homing to finish - */ - void _lcd_level_bed_homing() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL); - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); - } - - #if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; - #endif - - /** - * Step 2: Continue Bed Leveling... - */ - void _lcd_level_bed_continue() { - defer_return_to_status = true; - axis_homed = 0; - lcd_goto_screen(_lcd_level_bed_homing); - enqueue_and_echo_commands_P(PSTR("G28")); - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - void _lcd_ubl_level_bed(); - - static int16_t ubl_storage_slot = 0, - custom_hotend_temp = 190, - side_points = 3, - ubl_fillin_amount = 5, - ubl_height_amount = 1, - n_edit_pts = 1, - x_plot = 0, - y_plot = 0; - - #if HAS_HEATED_BED - static int16_t custom_bed_temp = 50; - #endif - - /** - * UBL Build Custom Mesh Command - */ - void _lcd_ubl_build_custom_mesh() { - char UBL_LCD_GCODE[20]; - enqueue_and_echo_commands_P(PSTR("G28")); - #if HAS_HEATED_BED - sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - #endif - sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - enqueue_and_echo_commands_P(PSTR("G29 P1")); - } - - /** - * UBL Custom Mesh submenu - * - * << Build Mesh - * Hotend Temp: --- - * Bed Temp: --- - * Build Custom Mesh - */ - void _lcd_ubl_custom_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 15)); - #endif - MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); - END_MENU(); - } - - /** - * UBL Adjust Mesh Height Command - */ - void _lcd_ubl_adjust_height_cmd() { - char UBL_LCD_GCODE[16]; - const int ind = ubl_height_amount > 0 ? 9 : 10; - strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); - sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount)); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Adjust Mesh Height submenu - * - * << Edit Mesh - * Height Amount: --- - * Adjust Mesh Height - * << Info Screen - */ - void _lcd_ubl_height_adjust_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_EDIT_MESH_MENU); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Edit Mesh submenu - * - * << UBL Tools - * Fine Tune All - * Fine Tune Closest - * - Adjust Mesh Height >> - * << Info Screen - */ - void _lcd_ubl_edit_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); - MENU_ITEM(submenu, MSG_UBL_MESH_HEIGHT_ADJUST, _lcd_ubl_height_adjust_menu); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Validate Custom Mesh Command - */ - void _lcd_ubl_validate_custom_mesh() { - char UBL_LCD_GCODE[24]; - const int temp = - #if HAS_HEATED_BED - custom_bed_temp - #else - 0 - #endif - ; - sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_commands_P(PSTR("G28")); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Validate Mesh submenu - * - * << UBL Tools - * PLA Mesh Validation - * ABS Mesh Validation - * Validate Custom Mesh - * << Info Screen - */ - void _lcd_ubl_validate_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #else - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #endif - MENU_ITEM(function, MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Grid Leveling Command - */ - void _lcd_ubl_grid_level_cmd() { - char UBL_LCD_GCODE[10]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Grid Leveling submenu - * - * << UBL Tools - * Side points: --- - * Level Mesh - */ - void _lcd_ubl_grid_level() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM_EDIT(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); - MENU_ITEM(function, MSG_UBL_MESH_LEVEL, _lcd_ubl_grid_level_cmd); - END_MENU(); - } - - /** - * UBL Mesh Leveling submenu - * - * << UBL Tools - * 3-Point Mesh Leveling - * - Grid Mesh Leveling >> - * << Info Screen - */ - void _lcd_ubl_mesh_leveling() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); - MENU_ITEM(submenu, MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Fill-in Amount Mesh Command - */ - void _lcd_ubl_fillin_amount_cmd() { - char UBL_LCD_GCODE[16]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Fill-in Mesh submenu - * - * << Build Mesh - * Fill-in Amount: --- - * Fill-in Mesh - * Smart Fill-in - * Manual Fill-in - * << Info Screen - */ - void _lcd_ubl_fillin_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - MENU_ITEM(gcode, MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - MENU_ITEM(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - void _lcd_ubl_invalidate() { - ubl.invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated."); - } - - /** - * UBL Build Mesh submenu - * - * << UBL Tools - * Build PLA Mesh - * Build ABS Mesh - * - Build Custom Mesh >> - * Build Cold Mesh - * - Fill-in Mesh >> - * Continue Bed Mesh - * Invalidate All - * Invalidate Closest - * << Info Screen - */ - void _lcd_ubl_build_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - #else - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - #endif - MENU_ITEM(submenu, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - MENU_ITEM(gcode, MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(submenu, MSG_UBL_FILLIN_MESH, _lcd_ubl_fillin_menu); - MENU_ITEM(gcode, MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); - MENU_ITEM(function, MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - MENU_ITEM(gcode, MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Load Mesh Command - */ - void _lcd_ubl_load_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Save Mesh Command - */ - void _lcd_ubl_save_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Mesh Storage submenu - * - * << Unified Bed Leveling - * Memory Slot: --- - * Load Bed Mesh - * Save Bed Mesh - */ - void _lcd_ubl_storage_mesh() { - int16_t a = settings.calc_num_meshes(); - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - if (!WITHIN(ubl_storage_slot, 0, a - 1)) { - STATIC_ITEM(MSG_NO_STORAGE); - } - else { - MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); - MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); - MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - } - END_MENU(); - } - - /** - * UBL LCD "radar" map homing - */ - void _lcd_ubl_output_map_lcd(); - - void _lcd_ubl_map_homing() { - defer_return_to_status = true; - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING)); - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (all_axes_homed()) { - ubl.lcd_map_control = true; // Return to the map screen - lcd_goto_screen(_lcd_ubl_output_map_lcd); - } - } - - /** - * UBL LCD "radar" map point editing - */ - 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); - snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL LCD Map Movement - */ - void ubl_map_move_to_xy() { - current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); - current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder); - } - - /** - * UBL LCD "radar" map - */ - void set_current_from_steppers_for_axis(const AxisEnum axis); - - void _lcd_do_nothing() {} - void _lcd_hard_stop() { - const screenFunc_t old_screen = currentScreen; - currentScreen = _lcd_do_nothing; - planner.quick_stop(); - currentScreen = old_screen; - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); - } - - void _lcd_ubl_output_map_lcd() { - static int16_t step_scaler = 0; - - if (use_click()) return _lcd_ubl_map_lcd_edit_cmd(); - ENCODER_DIRECTION_NORMAL(); - - if (encoderPosition) { - step_scaler += (int32_t)encoderPosition; - x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); - if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - - // Encoder to the right (++) - if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; } - if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0; - - // Encoder to the left (--) - if (x_plot <= GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1)) { x_plot = GRID_MAX_POINTS_X - 1; y_plot--; } - if (y_plot <= GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1)) y_plot = GRID_MAX_POINTS_Y - 1; - - // Prevent underrun/overrun of plot numbers - x_plot = constrain(x_plot, GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1), GRID_MAX_POINTS_X + 1); - y_plot = constrain(y_plot, GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1), GRID_MAX_POINTS_Y + 1); - - // Determine number of points to edit - #if IS_KINEMATIC - n_edit_pts = 9; //TODO: Delta accessible edit points - #else - const bool xc = WITHIN(x_plot, 1, GRID_MAX_POINTS_X - 2), - yc = WITHIN(y_plot, 1, GRID_MAX_POINTS_Y - 2); - n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners - #endif - - if (lcdDrawUpdate) { - lcd_implementation_ubl_plot(x_plot, y_plot); - - if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. - _lcd_hard_stop(); - - ubl_map_move_to_xy(); // Move to new location - } - } - - /** - * UBL Homing before LCD map - */ - void _lcd_ubl_output_map_lcd_cmd() { - if (!all_axes_known()) { - axis_homed = 0; - enqueue_and_echo_commands_P(PSTR("G28")); - } - lcd_goto_screen(_lcd_ubl_map_homing); - } - - /** - * UBL Output map submenu - * - * << Unified Bed Leveling - * Output for Host - * Output for CSV - * Off Printer Backup - * Output Mesh Map - */ - void _lcd_ubl_output_map() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); - MENU_ITEM(function, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); - END_MENU(); - } - - /** - * UBL Tools submenu - * - * << Unified Bed Leveling - * - Build Mesh >> - * - Validate Mesh >> - * - Edit Mesh >> - * - Mesh Leveling >> - */ - void _lcd_ubl_tools_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(submenu, MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); - MENU_ITEM(submenu, MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(submenu, MSG_UBL_EDIT_MESH_MENU, _lcd_ubl_edit_mesh); - MENU_ITEM(submenu, MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); - END_MENU(); - } - - /** - * UBL Step-By-Step submenu - * - * << Unified Bed Leveling - * 1 Build Cold Mesh - * 2 Smart Fill-in - * - 3 Validate Mesh >> - * 4 Fine Tune All - * - 5 Validate Mesh >> - * 6 Fine Tune All - * 7 Save Bed Mesh - */ - void _lcd_ubl_step_by_step() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(gcode, "2 " MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - END_MENU(); - } - - /** - * UBL System submenu - * - * << Prepare - * - Manually Build Mesh >> - * - Activate UBL >> - * - Deactivate UBL >> - * - Step-By-Step UBL >> - * - Mesh Storage >> - * - Output Map >> - * - UBL Tools >> - * - Output UBL Info >> - */ - - void _lcd_ubl_level_bed() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); - MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); - MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); - MENU_ITEM(function, MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); - MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); - MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); - MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); - MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - END_MENU(); - } - - #endif // AUTO_BED_LEVELING_UBL - - - #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } - #endif - - #if ENABLED(LCD_BED_LEVELING) - - /** - * Step 1: Bed Level entry-point - * - * << Prepare - * Auto Home (if homing needed) - * Leveling On/Off (if data exists, and homed) - * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) - * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) - * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) - * Level Bed > - * Level Corners > (if homed) - * Load Settings (Req: EEPROM_SETTINGS) - * Save Settings (Req: EEPROM_SETTINGS) - */ - void lcd_bed_leveling() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - const bool is_homed = all_axes_known(); - - // Auto Home if not using manual probing - #if DISABLED(PROBE_MANUALLY) && DISABLED(MESH_BED_LEVELING) - if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #endif - - // Level Bed - #if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) - // Manual leveling uses a guided procedure - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); - #else - // Automatic leveling can just run the G-code - MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); - #endif - - // Homed and leveling is valid? Then leveling can be toggled. - if (is_homed && leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - - // Z Fade Height - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // MBL Z Offset - // - #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - #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); - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - // Move to the next corner for leveling - if (all_axes_homed()) MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - #endif // LCD_BED_LEVELING - - /** - * - * "Prepare" submenu - * - */ - - void lcd_prepare_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - - // - // Move Axis - // - #if ENABLED(DELTA) - if (all_axes_homed()) - #endif - MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); - - // - // Auto Home - // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); - #endif - - // - // TMC Z Calibration - // - #if ENABLED(TMC_Z_CALIBRATION) - MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); - #endif - - // - // Level Bed - // - #if ENABLED(AUTO_BED_LEVELING_UBL) - - MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); - - #elif ENABLED(LCD_BED_LEVELING) - - #if ENABLED(PROBE_MANUALLY) - if (!g29_in_progress) - #endif - MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling); - - #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) - - #if DISABLED(PROBE_MANUALLY) - MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); - #endif - if (leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - #endif - - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - if (all_axes_homed()) - MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if HAS_M206_COMMAND && DISABLED(SLIM_LCD_MENUS) - // - // Set Home Offsets - // - MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); - #endif - - // - // Disable Steppers - // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); - - // - // Change filament - // - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!IS_SD_FILE_OPEN) { - #if E_STEPPERS == 1 && !ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - } - #endif // ADVANCED_PAUSE_FEATURE - - #if HAS_TEMP_HOTEND - - // - // Cooldown - // - bool has_heat = false; - HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; } - #if HAS_HEATED_BED - if (thermalManager.target_temperature_bed) has_heat = true; - #endif - if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); - - // - // Preheat for Material 1 and 2 - // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED - MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - - #endif // HAS_TEMP_HOTEND - - // - // BLTouch Self-Test and Reset - // - #if ENABLED(BLTOUCH) - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - if (!endstops.z_probe_enabled && TEST_BLTOUCH()) - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - #endif - - // - // Switch power on/off - // - #if HAS_POWER_SWITCH - if (powersupply_on) - MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); - else - MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); - #endif - - // - // Autostart - // - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); - #endif - - // - // Delta Calibration - // - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); - #endif - - END_MENU(); - } - - float move_menu_scale; - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void lcd_move_z(); - - void _man_probe_pt(const float &rx, const float &ry) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_xy(rx, ry); - - lcd_synchronize(); - move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - lcd_goto_screen(lcd_move_z); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_AUTO_CALIBRATION) - - float lcd_probe_pt(const float &rx, const float &ry) { - _man_probe_pt(rx, ry); - KEEPALIVE_STATE(PAUSED_FOR_USER); - defer_return_to_status = true; - wait_for_user = true; - while (wait_for_user) idle(); - KEEPALIVE_STATE(IN_HANDLER); - lcd_goto_previous_menu_no_defer(); - return current_position[Z_AXIS]; - } - - #endif // DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_CALIBRATION_MENU) - - void _lcd_calibrate_homing() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - if (all_axes_homed()) - lcd_goto_previous_menu(); - } - - void _lcd_delta_calibrate_home() { - enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_screen(_lcd_calibrate_homing); - } - - void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } - void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); } - void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); } - void _goto_center() { _man_probe_pt(0,0); } - - #endif // DELTA_CALIBRATION_MENU - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void _recalc_delta_settings() { - #if HAS_LEVELING - reset_bed_level(); // After changing kinematics bed-level data is no longer valid - #endif - recalc_delta_settings(); - } - - void lcd_delta_settings() { - START_MENU(); - MENU_BACK(MSG_DELTA_CALIBRATE); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); - END_MENU(); - } - - void lcd_delta_calibrate_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); - MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1")); - MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1")); - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - #endif - MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); - #if ENABLED(DELTA_CALIBRATION_MENU) - MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center); - } - #endif - END_MENU(); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - /** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send immediately - */ - inline void manage_manual_move() { - - if (processing_manual_move) return; - - if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { - - #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; - #endif - - // Set movement on a single axis - set_destination_from_current(); - destination[manual_move_axis] += manual_move_offset; - - // Reset for the next move - manual_move_offset = 0; - manual_move_axis = (int8_t)NO_AXIS; - - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // 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() - processing_manual_move = false; - - feedrate_mm_s = old_feedrate; - #if EXTRUDERS > 1 - active_extruder = old_extruder; - #endif - - #else - - planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); - manual_move_axis = (int8_t)NO_AXIS; - - #endif - } - } - - /** - * Set a flag that lcd_update() should start a move - * to "current_position" after a short delay. - */ - inline void manual_move_to_current(AxisEnum axis - #if E_MANUAL > 1 - , const int8_t eindex=-1 - #endif - ) { - #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1 - #if E_MANUAL > 1 - if (axis == E_AXIS) - #endif - manual_move_e_index = eindex >= 0 ? eindex : active_extruder; - #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - manual_move_axis = (int8_t)axis; - } - - /** - * - * "Prepare" > "Move Axis" submenu - * - */ - - void _lcd_move_xyz(const char* name, AxisEnum axis) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition && !processing_manual_move) { - - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop_min[X_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop_max[X_AXIS]; - #endif - break; - case Y_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop_min[Y_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop_max[Y_AXIS]; - #endif - break; - case Z_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop_min[Z_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop_max[Z_AXIS]; - #endif - default: break; - } - #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS - - // Delta limits XY based on the current offset from center - // This assumes the center is 0,0 - #if ENABLED(DELTA) - if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis - min = -max; - } - #endif - - // Get the new position - const float diff = float((int32_t)encoderPosition) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(manual_move_offset, min - current_position[axis]); - else - NOMORE(manual_move_offset, max - current_position[axis]); - #else - current_position[axis] += diff; - if ((int32_t)encoderPosition < 0) - NOLESS(current_position[axis], min); - else - NOMORE(current_position[axis], max); - #endif - - manual_move_to_current(axis); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - if (lcdDrawUpdate) { - const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis] - #if IS_KINEMATIC - + manual_move_offset - #endif - , axis); - lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); - } - } - 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); } - void _lcd_move_e( - #if E_MANUAL > 1 - const int8_t eindex=-1 - #endif - ) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - if (!processing_manual_move) { - const float diff = float((int32_t)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 - #endif - ); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - } - if (lcdDrawUpdate) { - 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; - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - } - #endif // E_MANUAL > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] - #if IS_KINEMATIC - + manual_move_offset - #endif - )); - } - } - - void lcd_move_e() { _lcd_move_e(); } - #if E_MANUAL > 1 - void lcd_move_e0() { _lcd_move_e(0); } - void lcd_move_e1() { _lcd_move_e(1); } - #if E_MANUAL > 2 - void lcd_move_e2() { _lcd_move_e(2); } - #if E_MANUAL > 3 - void lcd_move_e3() { _lcd_move_e(3); } - #if E_MANUAL > 4 - void lcd_move_e4() { _lcd_move_e(4); } - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Prepare" > "Move Xmm" > "Move XYZ" submenu - * - */ - - screenFunc_t _manual_move_func_ptr; - - void _goto_manual_move(const float scale) { - defer_return_to_status = true; - move_menu_scale = scale; - lcd_goto_screen(_manual_move_func_ptr); - } - void lcd_move_menu_10mm() { _goto_manual_move(10); } - void lcd_move_menu_1mm() { _goto_manual_move( 1); } - void lcd_move_menu_01mm() { _goto_manual_move( 0.1f); } - - void _lcd_move_distance_menu(const AxisEnum axis, const screenFunc_t func) { - _manual_move_func_ptr = func; - 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; - default: - STATIC_ITEM(MSG_MOVE_E, true, true); break; - } - } - MENU_BACK(MSG_MOVE_AXIS); - MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); - END_MENU(); - } - void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); } - void lcd_move_get_y_amount() { _lcd_move_distance_menu(Y_AXIS, lcd_move_y); } - void lcd_move_get_z_amount() { _lcd_move_distance_menu(Z_AXIS, lcd_move_z); } - void lcd_move_get_e_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e); } - #if E_MANUAL > 1 - void lcd_move_get_e0_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e0); } - void lcd_move_get_e1_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e1); } - #if E_MANUAL > 2 - void lcd_move_get_e2_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e2); } - #if E_MANUAL > 3 - void lcd_move_get_e3_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e3); } - #if E_MANUAL > 4 - void lcd_move_get_e4_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e4); } - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Prepare" > "Move Axis" submenu - * - */ - - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - #define _MOVE_XYZ_ALLOWED (all_axes_homed()) - #else - #define _MOVE_XYZ_ALLOWED true - #endif - - #if ENABLED(DELTA) - #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height) - void lcd_lower_z_to_clip_height() { - line_to_z(delta_clip_start_height); - lcd_synchronize(); - } - #else - #define _MOVE_XY_ALLOWED true - #endif - - void lcd_move_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); - #endif - - if (_MOVE_XYZ_ALLOWED) { - if (_MOVE_XY_ALLOWED) { - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount); - } - #if ENABLED(DELTA) - else - MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height); - #endif - - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount); - } - else - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - #if EXTRUDERS == 4 - switch (active_extruder) { - case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; - case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; - case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; - case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; - } - #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - } - #else - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - #endif - - #elif ENABLED(DUAL_X_CARRIAGE) - - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - - #endif - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(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); - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - #endif - - END_MENU(); - } - - /** - * - * "Control" submenu - * - */ - - #if HAS_LCD_CONTRAST - void lcd_callback_set_contrast() { set_lcd_contrast(lcd_contrast); } - #endif - - static void lcd_factory_settings() { - settings.reset(); - lcd_completion_feedback(); - } - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - - static void lcd_init_eeprom() { - lcd_completion_feedback(settings.init_eeprom()); - lcd_goto_previous_menu(); - } - - static void lcd_init_eeprom_confirm() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom); - END_MENU(); - } - - #endif - - void lcd_control_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); - MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu); - #elif ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif - - #if HAS_LCD_CONTRAST - MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true); - #endif - #if ENABLED(FWRETRACT) - MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu); - #endif - #if ENABLED(DAC_STEPPER_CURRENT) - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_dac_menu); - #endif - #if HAS_MOTOR_CURRENT_PWM - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_pwm_menu); - #endif - - #if ENABLED(BLTOUCH) - MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); - #endif - - END_MENU(); - } - - /** - * - * "Temperature" submenu - * - */ - - #if ENABLED(PID_AUTOTUNE_MENU) - - #if ENABLED(PIDTEMP) - int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); - #endif - - #if ENABLED(PIDTEMPBED) - int16_t autotune_temp_bed = 70; - #endif - - void _lcd_autotune(int16_t e) { - char cmd[30]; - sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, - #if HAS_PID_FOR_BOTH - e < 0 ? autotune_temp_bed : autotune_temp[e] - #elif ENABLED(PIDTEMPBED) - autotune_temp_bed - #else - autotune_temp[e] - #endif - ); - lcd_enqueue_command(cmd); - } - - #endif // PID_AUTOTUNE_MENU - - #if ENABLED(PIDTEMP) - - // Helpers for editing PID Ki & Kd values - // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); - } - void copy_and_scalePID_d(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); - } - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } - - #if ENABLED(PID_AUTOTUNE_MENU) - #define DEFINE_PIDTEMP_FUNCS(N) \ - _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } typedef void _pid_##N##_void - #else - #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N) typedef void _pid_##N##_void - #endif - - DEFINE_PIDTEMP_FUNCS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - #if HOTENDS > 1 - DEFINE_PIDTEMP_FUNCS(1); - #if HOTENDS > 2 - DEFINE_PIDTEMP_FUNCS(2); - #if HOTENDS > 3 - DEFINE_PIDTEMP_FUNCS(3); - #if HOTENDS > 4 - DEFINE_PIDTEMP_FUNCS(4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // PID_PARAMS_PER_HOTEND - - #endif // PIDTEMP - - /** - * - * "Control" > "Temperature" submenu - * - */ - void lcd_control_temperature_menu() { - START_MENU(); - - // - // ^ Control - // - MENU_BACK(MSG_CONTROL); - - // - // Nozzle: - // Nozzle [1-5]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fanSpeeds[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fanSpeeds[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 2", &new_fanSpeeds[1], 3, 255); - #endif - #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED " 3", &new_fanSpeeds[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Autotemp, Min, Max, Fact - // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND - MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); - #endif - - // - // PID-P, PID-I, PID-D, PID-C, PID Autotune - // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 - // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 - // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 - // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 - // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 - // - #if ENABLED(PIDTEMP) - - #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ - raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ - raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ - MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) - - #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ - MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) - #else - #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_MENU_ITEMS(ELABEL, eindex); \ - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) - #else - #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - PID_MENU_ITEMS(" " MSG_E1, 0); - PID_MENU_ITEMS(" " MSG_E2, 1); - #if HOTENDS > 2 - PID_MENU_ITEMS(" " MSG_E3, 2); - #if HOTENDS > 3 - PID_MENU_ITEMS(" " MSG_E4, 3); - #if HOTENDS > 4 - PID_MENU_ITEMS(" " MSG_E5, 4); - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - PID_MENU_ITEMS("", 0); - #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - - #endif // PIDTEMP - - #if DISABLED(SLIM_LCD_MENUS) - // - // Preheat Material 1 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_material1_settings_menu); - - // - // Preheat Material 2 conf - // - MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_material2_settings_menu); - #endif - - END_MENU(); - } - - #if DISABLED(SLIM_LCD_MENUS) - - void _lcd_control_temperature_preheat_settings_menu(const uint8_t material) { - #if HOTENDS > 4 - #define MINTEMP_ALL MIN5(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) - #define MAXTEMP_ALL MAX5(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) - #elif HOTENDS > 3 - #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) - #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) - #elif HOTENDS > 2 - #define MINTEMP_ALL MIN3(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) - #define MAXTEMP_ALL MAX3(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) - #elif HOTENDS > 1 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) - #else - #define MINTEMP_ALL HEATER_0_MINTEMP - #define MAXTEMP_ALL HEATER_0_MAXTEMP - #endif - START_MENU(); - MENU_BACK(MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255); - #if HAS_TEMP_HOTEND - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); - #endif - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - /** - * - * "Temperature" > "Preheat Material 1 conf" submenu - * - */ - void lcd_control_temperature_preheat_material1_settings_menu() { _lcd_control_temperature_preheat_settings_menu(0); } - - /** - * - * "Temperature" > "Preheat Material 2 conf" submenu - * - */ - void lcd_control_temperature_preheat_material2_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); } - - void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } - void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } - void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } - #if E_STEPPERS > 2 - void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } - #if E_STEPPERS > 3 - void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } - #if E_STEPPERS > 4 - void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - void _planner_refresh_positioning() { planner.refresh_positioning(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - _planner_refresh_positioning(); - else - planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.axis_steps_per_mm[E_AXIS + e]; - } - void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } - void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } - #if E_STEPPERS > 2 - void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } - #if E_STEPPERS > 3 - void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } - #if E_STEPPERS > 4 - void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - // M203 / M205 Velocity options - void lcd_control_motion_velocity_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - // M203 Max Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_A, &planner.max_feedrate_mm_s[A_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_B, &planner.max_feedrate_mm_s[B_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_C, &planner.max_feedrate_mm_s[C_AXIS], 1, 999); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.max_feedrate_mm_s[E_AXIS + 1], 1, 999); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.max_feedrate_mm_s[E_AXIS + 2], 1, 999); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E4, &planner.max_feedrate_mm_s[E_AXIS + 3], 1, 999); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E5, &planner.max_feedrate_mm_s[E_AXIS + 4], 1, 999); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); - #endif - - // M205 S Min Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999); - - // M205 T Min Travel Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999); - - END_MENU(); - } - - // M201 / M204 Accelerations - void lcd_control_motion_acceleration_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - // M204 P Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); - - // M204 R Retract Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); - - // M204 T Travel Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - - // M201 settings - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_A, &planner.max_acceleration_mm_per_s2[A_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_B, &planner.max_acceleration_mm_per_s2[B_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_C, &planner.max_acceleration_mm_per_s2[C_AXIS], 10, 99000, _reset_acceleration_rates); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E5, &planner.max_acceleration_mm_per_s2[E_AXIS + 4], 100, 99000, _reset_e4_acceleration_rate); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); - #endif - - END_MENU(); - } - - // M205 Jerk - void lcd_control_motion_jerk_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - #if ENABLED(JUNCTION_DEVIATION) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990); - #if ENABLED(DELTA) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990); - #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); - #endif - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); - #endif - - END_MENU(); - } - - // M92 Steps-per-mm - void lcd_control_motion_steps_per_mm_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ASTEPS, &planner.axis_steps_per_mm[A_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_BSTEPS, &planner.axis_steps_per_mm[B_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_CSTEPS, &planner.axis_steps_per_mm[C_AXIS], 5, 9999, _planner_refresh_positioning); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); - #endif - - END_MENU(); - } - - #endif // !SLIM_LCD_MENUS - - /** - * - * "Control" > "Motion" submenu - * - */ - - void lcd_control_motion_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - - #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); - #endif - - #if DISABLED(SLIM_LCD_MENUS) - - // M203 / M205 - Feedrate items - MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu); - - // M201 - Acceleration items - MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu); - - // M205 - Max Jerk - MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu); - - // M92 - Steps Per mm - MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu); - - #endif // !SLIM_LCD_MENUS - - // M540 S - Abort on endstop hit when SD printing - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); - #endif - - END_MENU(); - } - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - /** - * - * "Control" > "Filament" submenu - * - */ - void lcd_control_filament_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - - #if ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K, 0, 999); - #endif - - #if DISABLED(NO_VOLUMETRICS) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); - - if (parser.volumetric_enabled) { - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - const float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &filament_change_unload_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &filament_change_unload_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &filament_change_unload_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &filament_change_unload_length[2], 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &filament_change_unload_length[3], 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &filament_change_unload_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[0], 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &filament_change_load_length[active_extruder], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &filament_change_load_length[0], 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &filament_change_load_length[1], 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &filament_change_load_length[2], 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &filament_change_load_length[3], 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &filament_change_load_length[4], 0, extrude_maxlength); - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - END_MENU(); - } - #endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE - - /** - * - * "Control" > "Retract" submenu - * - */ - #if ENABLED(FWRETRACT) - - void lcd_control_retract_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.retract_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.swap_retract_length, 0, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.retract_feedrate_mm_s, 1, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.retract_recover_length, -100, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.swap_retract_recover_length, -100, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.retract_recover_feedrate_mm_s, 1, 999); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.swap_retract_recover_feedrate_mm_s, 1, 999); - #endif - END_MENU(); - } - - #endif // FWRETRACT - - #if ENABLED(SDSUPPORT) - - #if !PIN_EXISTS(SD_DETECT) - void lcd_sd_refresh() { - card.initsd(); - encoderTopLine = 0; - } - #endif - - void lcd_sd_updir() { - encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; - encoderTopLine = 0; - screen_changed = true; - lcd_refresh(); - } - - /** - * - * "Print from SD" submenu - * - */ - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - uint32_t last_sdfile_encoderPosition = 0xFFFF; - - void lcd_reselect_last_file() { - if (last_sdfile_encoderPosition == 0xFFFF) return; - #if ENABLED(DOGLCD) - // Some of this is a hack to force the screen update to work. - // TODO: Fix the real issue that causes this! - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - _lcd_synchronize(); - safe_delay(50); - _lcd_synchronize(); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - drawing_screen = screen_changed = true; - #endif - - lcd_goto_screen(lcd_sdcard_menu, last_sdfile_encoderPosition); - defer_return_to_status = true; - last_sdfile_encoderPosition = 0xFFFF; - - #if ENABLED(DOGLCD) - lcd_update(); - #endif - } - #endif - - void lcd_sdcard_menu() { - ENCODER_DIRECTION_MENUS(); - - const uint16_t fileCnt = card.get_num_Files(); - - START_MENU(); - MENU_BACK(MSG_MAIN); - card.getWorkDirName(); - - if (card.filename[0] == '/') { - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); - #endif - } - else { - MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); - } - - for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuLineNr == _thisItemNr) { - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; - - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename(nr); - #endif - - if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card); - else - MENU_ITEM(sdfile, MSG_CARD_MENU, card); - } - else { - MENU_ITEM_DUMMY(); - } - } - END_MENU(); - } - - #endif // SDSUPPORT - - #if ENABLED(LCD_INFO_MENU) - - #if ENABLED(PRINTCOUNTER) - /** - * - * About Printer > Statistics submenu - * - */ - void lcd_info_stats_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - - char buffer[21]; - printStatistics stats = print_job_timer.getStats(); - - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - - duration_t elapsed = stats.printTime; - elapsed.toString(buffer); - - 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 - - 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 - END_SCREEN(); - } - #endif // PRINTCOUNTER - - /** - * - * About Printer > Thermistors - * - */ - void lcd_info_thermistors_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - 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 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); - #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); - #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); - #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); - #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); - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Board Info - * - */ - void lcd_info_board_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - START_SCREEN(); - STATIC_ITEM(BOARD_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 - #if POWER_SUPPLY == 0 - STATIC_ITEM(MSG_INFO_PSU ": Generic", true); - #elif POWER_SUPPLY == 1 - STATIC_ITEM(MSG_INFO_PSU ": ATX", true); // Power Supply: ATX - #elif POWER_SUPPLY == 2 - STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Printer Info - * - */ - void lcd_info_printer_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - 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(); - } - - /** - * - * "About Printer" submenu - * - */ - void lcd_info_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu); // Printer Info > - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info > - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors > - #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics > - #endif - END_MENU(); - } - #endif // LCD_INFO_MENU - - /** - * - * LED Menu - * - */ - - #if ENABLED(LED_CONTROL_MENU) - - #if ENABLED(LED_COLOR_PRESETS) - - void lcd_led_presets_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, true, true); - #endif - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); - MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); - MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); - MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); - MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); - MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); - MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); - MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); - END_MENU(); - } - #endif // LED_COLOR_PRESETS - - void lcd_led_custom_menu() { - START_MENU(); - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); - #if ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); - #endif - #endif - END_MENU(); - } - - void lcd_led_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - bool led_on = leds.lights_on; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); - MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); - #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); - #endif - MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu); - END_MENU(); - } - - #endif // LED_CONTROL_MENU - - /** - * - * Filament Change Feature Screens - * - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * - * "Change Filament" > "Change/Unload/Load Filament" submenu - * - */ - static AdvancedPauseMode _change_filament_temp_mode; - static int8_t _change_filament_temp_extruder; - - static const char* _change_filament_temp_command() { - switch (_change_filament_temp_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR("M701 T%d"); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); - case ADVANCED_PAUSE_MODE_PAUSE_PRINT: - default: - return PSTR("M600 B0 T%d"); - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _change_filament_temp(const uint8_t index) { - char cmd[11]; - sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); - thermalManager.setTargetHotend(index == 1 ? PREHEAT_1_TEMP_HOTEND : PREHEAT_2_TEMP_HOTEND, _change_filament_temp_extruder); - lcd_enqueue_command(cmd); - } - void _lcd_change_filament_temp_1_menu() { _change_filament_temp(1); } - void _lcd_change_filament_temp_2_menu() { _change_filament_temp(2); } - - static const char* change_filament_header(const AdvancedPauseMode mode) { - switch (mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENTLOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENTUNLOAD); - default: break; - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _lcd_temp_menu_filament_op(const AdvancedPauseMode 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); - MENU_BACK(MSG_FILAMENTCHANGE); - MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu); - END_MENU(); - } - void lcd_temp_menu_e0_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } - void lcd_temp_menu_e0_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } - void lcd_temp_menu_e0_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } - #if E_STEPPERS > 1 - void lcd_temp_menu_e1_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); } - void lcd_temp_menu_e1_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); } - void lcd_temp_menu_e1_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); } - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - void lcd_unload_filament_all_temp_menu() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); } - #endif - #if E_STEPPERS > 2 - void lcd_temp_menu_e2_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); } - void lcd_temp_menu_e2_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); } - void lcd_temp_menu_e2_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); } - #if E_STEPPERS > 3 - void lcd_temp_menu_e3_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); } - void lcd_temp_menu_e3_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); } - void lcd_temp_menu_e3_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); } - #if E_STEPPERS > 4 - void lcd_temp_menu_e4_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); } - void lcd_temp_menu_e4_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); } - void lcd_temp_menu_e4_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - - /** - * - * "Change Filament" submenu - * - */ - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu() { - START_MENU(); - MENU_BACK(MSG_PREPARE); - - // Change filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_change); - else - MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_change); - else - MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_change); - else - MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_change); - else - MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!planner.movesplanned() && !IS_SD_FILE_OPEN) { - // Load filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_load); - else - MENU_ITEM_P(gcode, msg1, PSTR("M701 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_load); - else - MENU_ITEM_P(gcode, msg2, PSTR("M701 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_load); - else - MENU_ITEM_P(gcode, msg3, PSTR("M701 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_load); - else - MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - // Unload filament - #if E_STEPPERS == 1 - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, lcd_temp_menu_e0_filament_unload); - #else - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (thermalManager.targetHotEnoughToExtrude(0) - #if E_STEPPERS > 1 - && thermalManager.targetHotEnoughToExtrude(1) - #if E_STEPPERS > 2 - && thermalManager.targetHotEnoughToExtrude(2) - #if E_STEPPERS > 3 - && thermalManager.targetHotEnoughToExtrude(3) - #if E_STEPPERS > 4 - && thermalManager.targetHotEnoughToExtrude(4) - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - ) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, lcd_unload_filament_all_temp_menu); - #endif - if (thermalManager.targetHotEnoughToExtrude(0)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, lcd_temp_menu_e0_filament_unload); - if (thermalManager.targetHotEnoughToExtrude(1)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, lcd_temp_menu_e1_filament_unload); - #if E_STEPPERS > 2 - if (thermalManager.targetHotEnoughToExtrude(2)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, lcd_temp_menu_e2_filament_unload); - #if E_STEPPERS > 3 - if (thermalManager.targetHotEnoughToExtrude(3)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, lcd_temp_menu_e3_filament_unload); - #if E_STEPPERS > 4 - if (thermalManager.targetHotEnoughToExtrude(4)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, lcd_temp_menu_e4_filament_unload); - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - } - #endif - - END_MENU(); - } - #endif - - static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; - static uint8_t hotend_status_extruder = 0; - - static const char* advanced_pause_header() { - switch (advanced_pause_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); - default: break; - } - return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); - } - - // Portions from STATIC_ITEM... - #define HOTEND_STATUS_ITEM() do { \ - if (_menuLineNr == _thisItemNr) { \ - if (lcdDrawUpdate) { \ - lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ - lcd_implementation_hotend_status(_lcdLineNr, hotend_status_extruder); \ - } \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } \ - ++_thisItemNr; \ - }while(0) - - void lcd_advanced_pause_resume_print() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; - } - - void lcd_advanced_pause_extrude_more() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; - } - - void lcd_advanced_pause_option_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); - #endif - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_advanced_pause_resume_print); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); - END_MENU(); - } - - void lcd_advanced_pause_init_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); - #ifdef MSG_FILAMENT_CHANGE_INIT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); - #define __FC_LINES_A 3 - #else - #define __FC_LINES_A 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INIT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); - #define _FC_LINES_A (__FC_LINES_A + 1) - #else - #define _FC_LINES_A __FC_LINES_A - #endif - #if LCD_HEIGHT > _FC_LINES_A + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_unload_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); - #define __FC_LINES_B 3 - #else - #define __FC_LINES_B 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); - #define _FC_LINES_B (__FC_LINES_B + 1) - #else - #define _FC_LINES_B __FC_LINES_B - #endif - #if LCD_HEIGHT > _FC_LINES_B + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_wait_for_nozzles_to_heat() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); - #ifdef MSG_FILAMENT_CHANGE_HEATING_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); - #define _FC_LINES_C 3 - #else - #define _FC_LINES_C 2 - #endif - #if LCD_HEIGHT > _FC_LINES_C + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_heat_nozzle() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); - #define _FC_LINES_D 3 - #else - #define _FC_LINES_D 2 - #endif - #if LCD_HEIGHT > _FC_LINES_D + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_insert_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); - #define __FC_LINES_E 3 - #else - #define __FC_LINES_E 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INSERT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); - #define _FC_LINES_E (__FC_LINES_E + 1) - #else - #define _FC_LINES_E __FC_LINES_E - #endif - #if LCD_HEIGHT > _FC_LINES_E + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_load_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); - #ifdef MSG_FILAMENT_CHANGE_LOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); - #define __FC_LINES_F 3 - #else - #define __FC_LINES_F 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_LOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); - #define _FC_LINES_F (__FC_LINES_F + 1) - #else - #define _FC_LINES_F __FC_LINES_F - #endif - #if LCD_HEIGHT > _FC_LINES_F + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_purge_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - void lcd_advanced_pause_continuous_purge_menu() { - START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - STATIC_ITEM(MSG_USERWAIT); - END_SCREEN(); - } - #endif - - void lcd_advanced_pause_resume_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); - #ifdef MSG_FILAMENT_CHANGE_RESUME_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); - #endif - #ifdef MSG_FILAMENT_CHANGE_RESUME_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); - #endif - END_SCREEN(); - } - - FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) { - switch (message) { - case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message; - case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message; - case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message; - case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message; - case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message; - case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message; - case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle; - case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat; - case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; - return lcd_advanced_pause_option_menu; - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE: return lcd_advanced_pause_continuous_purge_menu; - #endif - case ADVANCED_PAUSE_MESSAGE_STATUS: - default: break; - } - return NULL; - } - - void lcd_advanced_pause_show_message( - const AdvancedPauseMessage message, - const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/, - const uint8_t extruder/*=active_extruder*/ - ) { - advanced_pause_mode = mode; - hotend_status_extruder = extruder; - const screenFunc_t next_screen = ap_message_screen(message); - if (next_screen) { - defer_return_to_status = true; - lcd_goto_screen(next_screen); - } - else - lcd_return_to_status(); - } - - #endif // ADVANCED_PAUSE_FEATURE - - /** - * - * Functions for editing single values - * - * The "DEFINE_MENU_EDIT_TYPE" macro generates the functions needed to edit a numerical value. - * - * For example, DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1) expands into these functions: - * - * bool _menu_edit_int3(); - * void menu_edit_int3(); // edit int16_t (interactively) - * void menu_edit_callback_int3(); // edit int16_t (interactively) with callback on completion - * void _menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_callback_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback - * - * You can then use one of the menu macros to present the edit interface: - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * - * This expands into a more primitive menu item: - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - * ...which calls: - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - */ - #define DEFINE_MENU_EDIT_TYPE(_type, _name, _strFunc, _scale) \ - bool _menu_edit_ ## _name() { \ - ENCODER_DIRECTION_NORMAL(); \ - if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ - if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale))); \ - if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ - _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale); \ - if (editValue != NULL) *((_type*)editValue) = value; \ - if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ - if (lcd_clicked) lcd_goto_previous_menu(); \ - } \ - return use_click(); \ - } \ - void menu_edit_ ## _name() { _menu_edit_ ## _name(); } \ - void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \ - lcd_save_previous_screen(); \ - lcd_refresh(); \ - \ - editLabel = pstr; \ - editValue = ptr; \ - minEditValue = minValue * _scale; \ - maxEditValue = maxValue * _scale - minEditValue; \ - encoderPosition = (*ptr) * _scale - minEditValue; \ - } \ - void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \ - _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentScreen = menu_edit_ ## _name; \ - callbackFunc = callback; \ - liveEdit = live; \ - } \ - FORCE_INLINE void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \ - menu_action_setting_edit_callback_ ## _name(pstr, ptr, minValue, maxValue); \ - } \ - typedef void _name##_void - - DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); - DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); - DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); - DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); - DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); - DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); - DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); - DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); - - /** - * - * Handlers for Keypad input - * - */ - #if ENABLED(ADC_KEYPAD) - - inline bool handle_adc_keypad() { - #define ADC_MIN_KEY_DELAY 100 - if (buttons_reprapworld_keypad) { - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - if (encoderDirection == -1) { // side effect which signals we are inside a menu - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(true); } - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(true); } - } - else { - if (buttons_reprapworld_keypad & (EN_REPRAPWORLD_KEYPAD_DOWN|EN_REPRAPWORLD_KEYPAD_UP|EN_REPRAPWORLD_KEYPAD_RIGHT)) { - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition += ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) encoderPosition = 0; - } - } - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLNPAIR("buttons_reprapworld_keypad = ", (uint32_t)buttons_reprapworld_keypad); - SERIAL_PROTOCOLLNPAIR("encoderPosition = ", (uint32_t)encoderPosition); - #endif - next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; - return true; - } - - return false; - } - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - encoderPosition = dir; - switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); - default: break; - } - } - void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); } - void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); } - void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); } - void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); } - void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } - void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } - void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait - void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); } - - inline void handle_reprapworld_keypad() { - - static uint8_t keypad_debounce = 0; - - if (!REPRAPWORLD_KEYPAD_PRESSED) { - if (keypad_debounce > 0) keypad_debounce--; - } - else if (!keypad_debounce) { - keypad_debounce = 2; - - if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu(); - - #if DISABLED(DELTA) && Z_HOME_DIR == -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - - if (all_axes_homed()) { - #if ENABLED(DELTA) || Z_HOME_DIR != -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); - if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); - if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); - } - else { - if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); - } - } - } - - #endif // REPRAPWORLD_KEYPAD - - /** - * - * Menu actions - * - */ - void _menu_action_back() { lcd_goto_previous_menu(); } - void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } - void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } - void menu_action_function(screenFunc_t func) { (*func)(); } - - #if ENABLED(SDSUPPORT) - - void menu_action_sdfile(CardReader& theCard) { - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use - #endif - card.openAndPrintFile(theCard.filename); -#if POWER_LOSS_RECOVER_SUPER_CAP - strcpy(recovery_detect_cap.file_name, theCard.filename); - SERIAL_ECHOLN(theCard.filename); - recovery_detect_cap.recovery=0; -#endif - lcd_return_to_status(); - lcd_reset_status(); - } - - void menu_action_sddirectory(CardReader& theCard) { - card.chdir(theCard.filename); - encoderTopLine = 0; - encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - lcd_refresh(); - } - - #endif // SDSUPPORT - - void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); } - void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) { - menu_action_setting_edit_bool(pstr, ptr); - (*callback)(); - } - -#endif // ULTIPANEL - -void lcd_init() { - - lcd_implementation_init(); - - #if ENABLED(NEWPANEL) - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - - #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - SET_INPUT_PULLUP(SHIFT_OUT); - #endif - - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - - #else // !NEWPANEL - - #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register - SET_OUTPUT(SR_DATA_PIN); - SET_OUTPUT(SR_CLK_PIN); - #elif defined(SHIFT_CLK) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - OUT_WRITE(SHIFT_EN, LOW); - SET_INPUT_PULLUP(SHIFT_OUT); - #endif // SR_LCD_2W_NL - - #endif // !NEWPANEL - - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - SET_INPUT_PULLUP(SD_DETECT_PIN); - lcd_sd_status = 2; // UNKNOWN - #endif - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = 0; - #endif - - lcd_buttons_update(); - - #if ENABLED(ULTIPANEL) - encoderDiff = 0; - #endif -} - -int16_t utf8_strlen(const char* s) { - int16_t i = 0, j = 0; - while (s[i]) { - if (START_OF_UTF8_CHAR(s[i])) j++; - i++; - } - return j; -} - -int16_t utf8_strlen_P(const char* s) { - int16_t j = 0; - while (pgm_read_byte(s)) { - if (START_OF_UTF8_CHAR(pgm_read_byte(s))) j++; - s++; - } - return j; -} - -bool lcd_blink() { - static uint8_t blink = 0; - static millis_t next_blink_ms = 0; - millis_t ms = millis(); - if (ELAPSED(ms, next_blink_ms)) { - blink ^= 0xFF; - next_blink_ms = ms + 1000 - (LCD_UPDATE_INTERVAL) / 2; - } - return blink != 0; -} - -/** - * Update the LCD, read encoder buttons, etc. - * - Read button states - * - Check the SD Card slot state - * - Act on RepRap World keypad input - * - Update the encoder position - * - Apply acceleration to the encoder position - * - Set lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NOW on controller events - * - Reset the Info Screen timeout if there's any input - * - Update status indicators, if any - * - * Run the current LCD menu handler callback function: - * - Call the handler only if lcdDrawUpdate != LCDVIEW_NONE - * - Before calling the handler, LCDVIEW_CALL_NO_REDRAW => LCDVIEW_NONE - * - Call the menu handler. Menu handlers should do the following: - * - If a value changes, set lcdDrawUpdate to LCDVIEW_REDRAW_NOW and draw the value - * (Encoder events automatically set lcdDrawUpdate for you.) - * - if (lcdDrawUpdate) { redraw } - * - Before exiting the handler set lcdDrawUpdate to: - * - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT. - * - LCDVIEW_REDRAW_NOW to draw now (including remaining stripes). - * - LCDVIEW_CALL_REDRAW_NEXT to draw now and get LCDVIEW_REDRAW_NOW on the next loop. - * - LCDVIEW_CALL_NO_REDRAW to draw now and get LCDVIEW_NONE on the next loop. - * - NOTE: For graphical displays menu handlers may be called 2 or more times per loop, - * so don't change lcdDrawUpdate without considering this. - * - * After the menu handler callback runs (or not): - * - Clear the LCD if lcdDrawUpdate == LCDVIEW_CLEAR_CALL_REDRAW - * - Update lcdDrawUpdate for the next loop (i.e., move one state down, usually) - * - * No worries. This function is only called from the main thread. - */ -void lcd_update() { - - #if ENABLED(ULTIPANEL) - static millis_t return_to_status_ms = 0; - - // Handle any queued Move Axis motion - manage_manual_move(); - - // Update button states for LCD_CLICKED, etc. - // After state changes the next button update - // may be delayed 300-500ms. - lcd_buttons_update(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - // Don't run the debouncer if UBL owns the display - #define UBL_CONDITION !lcd_external_control - #else - #define UBL_CONDITION true - #endif - - // If the action button is pressed... - if (UBL_CONDITION && LCD_CLICKED) { - if (!wait_for_unclick) { // 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 - lcd_quick_feedback(true); // Always make a click sound - } - } - else wait_for_unclick = false; - - #if BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED) { - lcd_quick_feedback(true); - lcd_goto_previous_menu(); - } - #endif - - #endif // ULTIPANEL - - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - - const uint8_t sd_status = (uint8_t)IS_SD_INSERTED; - if (sd_status != lcd_sd_status && lcd_detected()) { - - uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! - lcd_sd_status = sd_status; - - if (sd_status) { - safe_delay(500); // Some boards need a delay to get settled - card.initsd(); - if (old_sd_status == 2) - card.beginautostart(); // Initial boot - else - LCD_MESSAGEPGM(MSG_SD_INSERTED); - } - else { - card.release(); - if (old_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED); - } - - lcd_refresh(); - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) - currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU - #endif - ); - } - - #endif // SDSUPPORT && SD_DETECT_PIN - - #if ENABLED(POWER_LOSS_RECOVERY) - if (job_recovery_commands_count && job_recovery_phase == JOB_RECOVERY_IDLE) { - lcd_goto_screen(lcd_job_recovery_menu); - job_recovery_phase = JOB_RECOVERY_MAYBE; // Waiting for a response - } - #endif - - const millis_t ms = millis(); - if (ELAPSED(ms, next_lcd_update_ms) - #if ENABLED(DOGLCD) - || drawing_screen - #endif - ) { - - next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - lcd_implementation_update_indicators(); - #endif - - #if ENABLED(ULTIPANEL) - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context - #endif - - #if ENABLED(ADC_KEYPAD) - - if (handle_adc_keypad()) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - handle_reprapworld_keypad(); - - #endif - - const bool encoderPastThreshold = (ABS(encoderDiff) >= ENCODER_PULSES_PER_STEP); - if (encoderPastThreshold || lcd_clicked) { - if (encoderPastThreshold) { - int32_t encoderMultiplier = 1; - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - - if (encoderRateMultiplierEnabled) { - int32_t encoderMovementSteps = ABS(encoderDiff) / ENCODER_PULSES_PER_STEP; - - if (lastEncoderMovementMillis) { - // Note that the rate is always calculated between two passes through the - // loop and that the abs of the encoderDiff value is tracked. - float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000; - - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; - - #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate); - SERIAL_ECHOPAIR(" Multiplier: ", encoderMultiplier); - SERIAL_ECHOPAIR(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); - SERIAL_ECHOPAIR(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); - SERIAL_EOL(); - #endif // ENCODER_RATE_MULTIPLIER_DEBUG - } - - lastEncoderMovementMillis = ms; - } // encoderRateMultiplierEnabled - #endif // ENCODER_RATE_MULTIPLIER - - encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; - encoderDiff = 0; - } - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - #endif // ULTIPANEL - - // We arrive here every ~100ms when idling often enough. - // Instead of tracking the changes simply redraw the Info Screen ~1 time a second. - if ( - #if ENABLED(ULTIPANEL) - currentScreen == lcd_status_screen && - #endif - !lcd_status_update_delay-- - ) { - lcd_status_update_delay = 9 - #if ENABLED(DOGLCD) - + 3 - #endif - ; - max_display_update_time--; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - - #if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) - // If scrolling of long file names is enabled and we are in the sd card menu, - // cause a refresh to occur until all the text has scrolled into view. - if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { - lcd_status_update_delay = 6; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - filename_scroll_pos++; - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - } - #endif - - // then we want to use 1/2 of the time only. - uint16_t bbr2 = planner.block_buffer_runtime() >> 1; - - #if ENABLED(DOGLCD) - #define IS_DRAWING drawing_screen - #else - #define IS_DRAWING false - #endif - - if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { - - // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { - case LCDVIEW_CALL_NO_REDRAW: - lcdDrawUpdate = LCDVIEW_NONE; - break; - case LCDVIEW_CLEAR_CALL_REDRAW: - case LCDVIEW_CALL_REDRAW_NEXT: - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT - case LCDVIEW_NONE: - break; - } // switch - - #if ENABLED(ADC_KEYPAD) - buttons_reprapworld_keypad = 0; - #endif - - #if ENABLED(ULTIPANEL) - #define CURRENTSCREEN() (*currentScreen)() - #else - #define CURRENTSCREEN() lcd_status_screen() - #endif - - #if ENABLED(DOGLCD) - #if ENABLED(LIGHTWEIGHT_UI) - #if ENABLED(ULTIPANEL) - const bool in_status = currentScreen == lcd_status_screen; - #else - constexpr bool in_status = true; - #endif - const bool do_u8g_loop = !in_status; - lcd_in_status(in_status); - if (in_status) lcd_status_screen(); - #else - constexpr bool do_u8g_loop = true; - #endif - if (do_u8g_loop) { - if (!drawing_screen) { // If not already drawing pages - u8g.firstPage(); // Start the first page - drawing_screen = first_page = true; // Flag as drawing pages - } - lcd_setFont(FONT_MENU); // Setup font for every page draw - u8g.setColorIndex(1); // And reset the color - CURRENTSCREEN(); // Draw and process the current screen - first_page = false; - - // The screen handler can clear drawing_screen for an action that changes the screen. - // If still drawing and there's another page, update max-time and return now. - // The nextPage will already be set up on the next call. - if (drawing_screen && (drawing_screen = u8g.nextPage())) { - NOLESS(max_display_update_time, millis() - ms); - return; - } - } - #else - CURRENTSCREEN(); - #endif - - #if ENABLED(ULTIPANEL) - lcd_clicked = false; - #endif - - // Keeping track of the longest time for an individual LCD update. - // Used to do screen throttling when the planner starts to fill up. - NOLESS(max_display_update_time, millis() - ms); - } - - #if ENABLED(ULTIPANEL) - - // Return to Status Screen after a timeout - if (currentScreen == lcd_status_screen || defer_return_to_status) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; -#if POWER_LOSS_RECOVER_SUPER_CAP - else if (ELAPSED(ms, return_to_status_ms)&&(recovery_detect_cap.recovery!=3)) -#else - else if (ELAPSED(ms, return_to_status_ms)) -#endif - lcd_return_to_status(); - - #endif // ULTIPANEL - - // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { - case LCDVIEW_CLEAR_CALL_REDRAW: - lcd_implementation_clear(); break; - case LCDVIEW_REDRAW_NOW: - lcdDrawUpdate = LCDVIEW_NONE; - case LCDVIEW_NONE: - case LCDVIEW_CALL_REDRAW_NEXT: - case LCDVIEW_CALL_NO_REDRAW: - default: break; - } // switch - - } // ELAPSED(ms, next_lcd_update_ms) -} - -void lcd_finishstatus(const bool persist=false) { - - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) - UNUSED(persist); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - progress_bar_ms = millis(); - #if PROGRESS_MSG_EXPIRE > 0 - expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; - #endif - #endif - lcd_refresh(); - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); //get status message to show up for a while - #endif - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif -} - -#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - void dontExpireStatus() { expire_status_ms = 0; } -#endif - -bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } - -void lcd_setstatus(const char * const message, const bool persist) { - if (lcd_status_message_level > 0) return; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(*pend)) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(persist); -} - -void lcd_setstatusPGM(const char * const message, int8_t level) { - if (level < 0) level = lcd_status_message_level = 0; - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen_P(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy_P(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(level > 0); -} - -void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - va_list args; - va_start(args, fmt); - vsnprintf_P(lcd_status_message, MAX_MESSAGE_LENGTH, fmt, args); - va_end(args); - lcd_finishstatus(level > 0); -} - -void lcd_setalertstatusPGM(const char * const message) { - lcd_setstatusPGM(message, 1); - #if ENABLED(ULTIPANEL) - lcd_return_to_status(); - #endif -} - -void lcd_reset_alert_level() { lcd_status_message_level = 0; } - -#if HAS_LCD_CONTRAST - - void set_lcd_contrast(const int16_t value) { - lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(lcd_contrast); - } - -#endif - -#if ENABLED(ULTIPANEL) - - /** - * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) - * These values are independent of which pins are used for EN_A and EN_B indications - * The rotary encoder part is also independent to the chipset used for the LCD - */ - #if defined(EN_A) && defined(EN_B) - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 - #endif - - #define GET_SHIFT_BUTTON_STATES(DST) \ - uint8_t new_##DST = 0; \ - WRITE(SHIFT_LD, LOW); \ - WRITE(SHIFT_LD, HIGH); \ - for (int8_t i = 0; i < 8; i++) { \ - new_##DST >>= 1; \ - if (READ(SHIFT_OUT)) SBI(new_##DST, 7); \ - WRITE(SHIFT_CLK, HIGH); \ - WRITE(SHIFT_CLK, LOW); \ - } \ - DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 - - - /** - * Read encoder buttons from the hardware registers - * Warning: This function is called from interrupt context! - */ - void lcd_buttons_update() { - static uint8_t lastEncoderBits; - const millis_t now = millis(); - if (ELAPSED(now, next_button_update_ms)) { - - #if ENABLED(NEWPANEL) - uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif -// SERIAL_ECHOPAIR("n: ", BTN_EN1); -// SERIAL_ECHOPAIR("c: ", BTN_EN2); - - // - // Directional buttons - // - #if LCD_HAS_DIRECTIONAL_BUTTONS - - #if ENABLED(REVERSE_MENU_DIRECTION) - #define _ENCODER_UD_STEPS (ENCODER_STEPS_PER_MENU_ITEM * encoderDirection) - #else - #define _ENCODER_UD_STEPS ENCODER_STEPS_PER_MENU_ITEM - #endif - #if ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_UD_STEPS _ENCODER_UD_STEPS - #define ENCODER_LR_PULSES ENCODER_PULSES_PER_STEP - #else - #define ENCODER_UD_STEPS -(_ENCODER_UD_STEPS) - #define ENCODER_LR_PULSES -(ENCODER_PULSES_PER_STEP) - #endif - - if (false) { - // for the else-ifs below - } - #if BUTTON_EXISTS(UP) - else if (BUTTON_PRESSED(UP)) { - encoderDiff = -(ENCODER_UD_STEPS); - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(DWN) - else if (BUTTON_PRESSED(DWN)) { - encoderDiff = ENCODER_UD_STEPS; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(LFT) - else if (BUTTON_PRESSED(LFT)) { - encoderDiff = -(ENCODER_LR_PULSES); - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(RT) - else if (BUTTON_PRESSED(RT)) { - encoderDiff = ENCODER_LR_PULSES; - next_button_update_ms = now + 300; - } - #endif - - #endif // LCD_HAS_DIRECTIONAL_BUTTONS - - buttons = newbutton; - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - buttons |= slow_buttons; - #endif - - #if ENABLED(ADC_KEYPAD) - - uint8_t newbutton_reprapworld_keypad = 0; - buttons = 0; - if (buttons_reprapworld_keypad == 0) { - newbutton_reprapworld_keypad = get_ADC_keyValue(); - if (WITHIN(newbutton_reprapworld_keypad, 1, 8)) - buttons_reprapworld_keypad = _BV(newbutton_reprapworld_keypad - 1); - } - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - GET_SHIFT_BUTTON_STATES(buttons_reprapworld_keypad); - - #endif - - #else // !NEWPANEL - - GET_SHIFT_BUTTON_STATES(buttons); - - #endif - - } // next_button_update_ms - - // Manage encoder rotation - #if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff -= encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff += encoderDirection) - #elif ENABLED(REVERSE_MENU_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff += encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff -= encoderDirection) - #elif ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff--) - #define ENCODER_DIFF_CCW (encoderDiff++) - #else - #define ENCODER_DIFF_CW (encoderDiff++) - #define ENCODER_DIFF_CCW (encoderDiff--) - #endif - #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; } - - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case encrot0: ENCODER_SPIN(encrot3, encrot1); break; - case encrot1: ENCODER_SPIN(encrot0, encrot2); break; - case encrot2: ENCODER_SPIN(encrot1, encrot3); break; - case encrot3: ENCODER_SPIN(encrot2, encrot0); break; - } - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (lcd_external_control) { - ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. - encoderDiff = 0; // Hide the encoder event from the current screen handler. - } - #endif - lastEncoderBits = enc; - } - } - - #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE) - bool lcd_detected() { return lcd.LcdDetected() == 1; } - #else - bool lcd_detected() { return true; } - #endif - - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp() { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #endif - } - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked() { return LCD_CLICKED; } - void wait_for_release() { - while (is_lcd_clicked()) safe_delay(50); - safe_delay(50); - } - #endif - -#endif // ULTIPANEL - -#if ENABLED(ADC_KEYPAD) - - typedef struct { - uint16_t ADCKeyValueMin, ADCKeyValueMax; - uint8_t ADCKeyNo; - } _stADCKeypadTable_; - - static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { - // VALUE_MIN, VALUE_MAX, KEY - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 }, // F1 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 }, // F2 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 }, // F3 - { 300, 500, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 }, // LEFT - { 1900, 2200, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 }, // RIGHT - { 570, 870, BLEN_REPRAPWORLD_KEYPAD_UP + 1 }, // UP - { 2670, 2870, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 }, // DOWN - { 1150, 1450, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, // ENTER - }; - - uint8_t get_ADC_keyValue(void) { - if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw >> 2; - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLN(currentkpADCValue); - #endif - thermalManager.current_ADCKey_raw = 0; - thermalManager.ADCKey_count = 0; - if (currentkpADCValue < 4000) - for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { - const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), - hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); - if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); - } - } - return 0; - } -#endif - -#endif // ULTRA_LCD diff --git a/Marlin_thinkerV2/Marlin/ultralcd.h b/Marlin_thinkerV2/Marlin/ultralcd.h deleted file mode 100644 index 772c98fe3d..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULTRALCD_H -#define ULTRALCD_H - -#include "MarlinConfig.h" - -#if ENABLED(ULTRA_LCD) || ENABLED(MALYAN_LCD) - void lcd_init(); - bool lcd_detected(); - void lcd_update(); - void lcd_setalertstatusPGM(const char* message); -#else - inline void lcd_init() {} - inline bool lcd_detected() { return true; } - inline void lcd_update() {} - inline void lcd_setalertstatusPGM(const char* message) { UNUSED(message); } -#endif - -#if ENABLED(ULTRA_LCD) - - #include "Marlin.h" - - int16_t utf8_strlen(const char* s); - int16_t utf8_strlen_P(const char* s); - bool lcd_hasstatus(); - void lcd_setstatus(const char* message, const bool persist=false); - void lcd_setstatusPGM(const char* message, const int8_t level=0); - void lcd_setalertstatusPGM(const char* message); - void lcd_reset_alert_level(); - void lcd_reset_status(); - void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...); - void lcd_kill_screen(); - void kill_screen(const char* lcd_msg); -#if POWER_LOSS_RECOVER_SUPER_CAP - void lcd_recover_menu(void) ; -#endif - extern uint8_t lcdDrawUpdate; - inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } - - #if HAS_BUZZER - void lcd_buzz(const long duration, const uint16_t freq); - #endif - - void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual - - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - void dontExpireStatus(); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - extern uint8_t progress_bar_percent; - #endif - - #if ENABLED(ADC_KEYPAD) - uint8_t get_ADC_keyValue(); - #endif - - #if ENABLED(DOGLCD) - extern int16_t lcd_contrast; - void set_lcd_contrast(const int16_t value); - #endif - - #if ENABLED(SHOW_BOOTSCREEN) - void lcd_bootscreen(); - #endif - - #define LCD_UPDATE_INTERVAL 100 - #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - - #if ENABLED(ULTIPANEL) // LCD with a click-wheel input - - extern bool defer_return_to_status; - - // Function pointer to menu functions. - typedef void (*screenFunc_t)(); - typedef void (*menuAction_t)(); - - extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - extern bool lcd_external_control; - #else - constexpr bool lcd_external_control = false; - #endif - - #if ENABLED(LCD_BED_LEVELING) - extern bool lcd_wait_for_move; - #else - constexpr bool lcd_wait_for_move = false; - #endif - - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); - - void lcd_completion_feedback(const bool good=true); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - extern uint8_t active_extruder; - void lcd_advanced_pause_show_message(const AdvancedPauseMessage message, - const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT, - const uint8_t extruder=active_extruder); - #endif - - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp(); - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) - void lcd_mesh_edit_setup(const float &initial); - float lcd_mesh_edit(); - void lcd_z_offset_edit_setup(const float &initial); - float lcd_z_offset_edit(); - #endif - - #endif - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - extern millis_t previous_lcd_status_ms; - #endif - - bool lcd_blink(); - - #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL - - #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values - - #define BLEN_REPRAPWORLD_KEYPAD_F3 0 - #define BLEN_REPRAPWORLD_KEYPAD_F2 1 - #define BLEN_REPRAPWORLD_KEYPAD_F1 2 - #define BLEN_REPRAPWORLD_KEYPAD_DOWN 3 - #define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4 - #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5 - #define BLEN_REPRAPWORLD_KEYPAD_UP 6 - #define BLEN_REPRAPWORLD_KEYPAD_LEFT 7 - - #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3)) - #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2)) - #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1)) - #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN)) - #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT)) - #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE)) - #define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP)) - #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT)) - - #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3) - #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2) - #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) - #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) - #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) - #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) - - #if ENABLED(ADC_KEYPAD) - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_F1 - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_MIDDLE - #else - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_MIDDLE - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_F1 - #endif - #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) - #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) - - #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ - EN_REPRAPWORLD_KEYPAD_F3 | \ - EN_REPRAPWORLD_KEYPAD_F2 | \ - EN_REPRAPWORLD_KEYPAD_F1 | \ - EN_REPRAPWORLD_KEYPAD_DOWN | \ - EN_REPRAPWORLD_KEYPAD_RIGHT | \ - EN_REPRAPWORLD_KEYPAD_MIDDLE | \ - EN_REPRAPWORLD_KEYPAD_UP | \ - EN_REPRAPWORLD_KEYPAD_LEFT) \ - ) - - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked(); - void wait_for_release(); - #endif - -#else // MALYAN_LCD or no LCD - - constexpr bool lcd_wait_for_move = false; - - inline void lcd_refresh() {} - inline bool lcd_hasstatus() { return false; } - inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } - inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } - inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); } - inline void lcd_reset_alert_level() {} - inline void lcd_reset_status() {} - -#endif // ULTRA_LCD - -#if ENABLED(ULTIPANEL) - - #if ENABLED(NEWPANEL) // Uses digital switches, not a shift register - - // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) - #define BLEN_A 0 - #define BLEN_B 1 - - #define EN_A _BV(BLEN_A) - #define EN_B _BV(BLEN_B) - - #if BUTTON_EXISTS(ENC) - #define BLEN_C 2 - #define EN_C _BV(BLEN_C) - #endif - - #if BUTTON_EXISTS(BACK) - #define BLEN_D 3 - #define EN_D _BV(BLEN_D) - #define LCD_BACK_CLICKED (buttons & EN_D) - #endif - - #endif // NEWPANEL - - extern volatile uint8_t buttons; // The last-checked buttons in a bit array. - void lcd_buttons_update(); - -#else - - inline void lcd_buttons_update() {} - -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #ifdef EN_C - #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) - #else - #define LCD_CLICKED REPRAPWORLD_KEYPAD_MOVE_MENU - #endif -#elif defined(EN_C) - #define LCD_CLICKED (buttons & EN_C) -#else - #define LCD_CLICKED false -#endif - -#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) -#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x)) - -#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - void lcd_reselect_last_file(); -#endif - -#if ENABLED(ULTIPANEL) && ENABLED(SDSUPPORT) - extern bool abort_sd_printing; -#else - constexpr bool abort_sd_printing = false; -#endif - -#endif // ULTRALCD_H diff --git a/Marlin_thinkerV2/Marlin/ultralcd_impl_DOGM.h b/Marlin_thinkerV2/Marlin/ultralcd_impl_DOGM.h deleted file mode 100644 index 2858878bc2..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd_impl_DOGM.h +++ /dev/null @@ -1,723 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * ultralcd_impl_DOGM.h - * - * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin - * Demonstrator: http://www.reprap.org/wiki/STB_Electronics - * 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 - */ - -/** - * Implementation of the LCD display routines for a DOGM128 graphic display. - * These are common LCD 128x64 pixel graphic displays. - */ - -#ifndef ULTRALCD_IMPL_DOGM_H -#define ULTRALCD_IMPL_DOGM_H - -#include "MarlinConfig.h" - -#include - -#include "ultralcd.h" -#include "dogm_bitmaps.h" -#include "utility.h" -#include "duration_t.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" -#endif - -// Only Western languages support big / small fonts -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT -#endif - -#if ENABLED(U8GLIB_ST7920) - #include "ultralcd_st7920_u8glib_rrd.h" -#endif - -#if ENABLED(U8GLIB_ST7565_64128N) - #include "ultralcd_st7565_u8glib_VIKI.h" -#endif - -#if ENABLED(USE_SMALL_INFOFONT) - #include "dogm_font_data_6x9_marlin.h" - #define FONT_STATUSMENU_NAME u8g_font_6x9 - #define INFO_FONT_HEIGHT 7 -#else - #define FONT_STATUSMENU_NAME FONT_MENU_NAME - #define INFO_FONT_HEIGHT 8 -#endif - -#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#define FONT_SPECIAL_NAME Marlin_symbols - -#if DISABLED(SIMULATE_ROMFONT) - #if ENABLED(DISPLAY_CHARSET_ISO10646_1) - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_PL) - #include "dogm_font_data_ISO10646_1_PL.h" - #define FONT_MENU_NAME ISO10646_1_PL_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_5) - #include "dogm_font_data_ISO10646_5_Cyrillic.h" - #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA) - #include "dogm_font_data_ISO10646_Kana.h" - #define FONT_MENU_NAME ISO10646_Kana_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) - #include "dogm_font_data_ISO10646_Greek.h" - #define FONT_MENU_NAME ISO10646_Greek_5x7 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_CN) - #include "dogm_font_data_ISO10646_CN.h" - #define FONT_MENU_NAME ISO10646_CN - #define TALL_FONT_CORRECTION 1 - #elif ENABLED(DISPLAY_CHARSET_ISO10646_TR) - #include "dogm_font_data_ISO10646_1_tr.h" - #define FONT_MENU_NAME ISO10646_TR - #elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ) - #include "dogm_font_data_ISO10646_CZ.h" - #define FONT_MENU_NAME ISO10646_CZ - #elif ENABLED(DISPLAY_CHARSET_ISO10646_SK) - #include "dogm_font_data_ISO10646_SK.h" - #define FONT_MENU_NAME ISO10646_SK - #else // fall-back - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #endif -#else // SIMULATE_ROMFONT - #if DISPLAY_CHARSET_HD44780 == JAPANESE - #include "dogm_font_data_HD44780_J.h" - #define FONT_MENU_NAME HD44780_J_5x7 - #elif DISPLAY_CHARSET_HD44780 == WESTERN - #include "dogm_font_data_HD44780_W.h" - #define FONT_MENU_NAME HD44780_W_5x7 - #elif DISPLAY_CHARSET_HD44780 == CYRILLIC - #include "dogm_font_data_HD44780_C.h" - #define FONT_MENU_NAME HD44780_C_5x7 - #else // fall-back - #include "dogm_font_data_ISO10646_1.h" - #define FONT_MENU_NAME ISO10646_1_5x7 - #endif -#endif // SIMULATE_ROMFONT - -//#define FONT_STATUSMENU_NAME FONT_MENU_NAME - -#define FONT_STATUSMENU 1 -#define FONT_SPECIAL 2 -#define FONT_MENU_EDIT 3 -#define FONT_MENU 4 - -// DOGM parameters (size in pixels) -#define DOG_CHAR_WIDTH 6 -#define DOG_CHAR_HEIGHT 12 -#if ENABLED(USE_BIG_EDIT_FONT) - #define FONT_MENU_EDIT_NAME u8g_font_9x18 - #define DOG_CHAR_WIDTH_EDIT 9 - #define DOG_CHAR_HEIGHT_EDIT 18 -#else - #define FONT_MENU_EDIT_NAME FONT_MENU_NAME - #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH - #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT -#endif - -#ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 -#endif - -#define START_COL 0 - -// LCD selection -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS); // 2 stripes - // U8GLIB_ST7920_128X64 u8g(LCD_PINS_RS); // 8 stripes -#elif ENABLED(U8GLIB_ST7920) - //U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 2 stripes - // No 4 stripe device available from u8glib. - //U8GLIB_ST7920_128X64_1X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 8 stripes - U8GLIB_ST7920_128X64_RRD u8g(0); // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT -#elif ENABLED(CARTESIO_UI) - // The CartesioUI display - #if DOGLCD_MOSI != -1 && DOGLCD_SCK != -1 - // using SW-SPI - //U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes - #else - //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes - #endif -#elif ENABLED(U8GLIB_LM6059_AF) - // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_LM6059_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, and Viki 2.0, ST7565 controller as well - // U8GLIB_ST7565_64128n_2x_VIKI u8g(0); // using SW-SPI DOGLCD_MOSI != -1 && DOGLCD_SCK - U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI - //U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes HWSPI -#elif ENABLED(MKS_12864OLED_SSD1306) - // MKS 128x64 (SSD1306) OLED I2C LCD - U8GLIB_SSD1306_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SSD1306_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes - U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(MKS_12864OLED) - // MKS 128x64 (SH1106) OLED I2C LCD - U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SH1106_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes - U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - U8GLIB_SSD1309_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); -#elif ENABLED(MINIPANEL) - // The MINIPanel display - //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes -#else - // for regular DOGM128 display with HW-SPI - //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 4 stripes -#endif - -#ifndef LCD_PIXEL_WIDTH - #define LCD_PIXEL_WIDTH 128 -#endif -#ifndef LCD_PIXEL_HEIGHT - #define LCD_PIXEL_HEIGHT 64 -#endif - -#include "utf_mapper.h" - -int16_t lcd_contrast; // Initialized by settings.load() -static char currentfont = 0; - -// The current graphical page being rendered -u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p; - -// For selective rendering within a Y range -#define PAGE_UNDER(yb) (u8g.getU8g()->current_page.y0 <= (yb)) -#define PAGE_CONTAINS(ya, yb) (PAGE_UNDER(yb) && u8g.getU8g()->current_page.y1 >= (ya)) - -static void lcd_setFont(const char font_nr) { - switch (font_nr) { - case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; - case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; - case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; - case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; - break; - } -} - -void lcd_print(const char c) { - if (WITHIN(c, 1, LCD_STR_SPECIAL_MAX)) { - u8g.setFont(FONT_SPECIAL_NAME); - u8g.print(c); - lcd_setFont(currentfont); - } - else charset_mapper(c); -} - -char lcd_print_and_count(const char c) { - if (WITHIN(c, 1, LCD_STR_SPECIAL_MAX)) { - u8g.setFont(FONT_SPECIAL_NAME); - u8g.print(c); - lcd_setFont(currentfont); - return 1; - } - else return charset_mapper(c); -} - -/** - * Core LCD printing functions - * On DOGM all strings go through a filter for utf - * But only use lcd_print_utf and lcd_printPGM_utf for translated text - */ -void lcd_print(const char *str) { while (*str) lcd_print(*str++); } -void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd_print(c), ++str; } - -void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = *str)) n -= charset_mapper(c), ++str; -} - -void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str; -} - -#if ENABLED(SHOW_BOOTSCREEN) - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - void lcd_custom_bootscreen() { - constexpr u8g_uint_t left = (LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2, - top = (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2; - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - constexpr u8g_uint_t right = left + CUSTOM_BOOTSCREEN_BMPWIDTH, - bottom = top + CUSTOM_BOOTSCREEN_BMPHEIGHT; - #endif - u8g.firstPage(); - do { - u8g.drawBitmapP( - left, top, - CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp - ); - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - u8g.setColorIndex(1); - if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); - if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); - #endif - } while (u8g.nextPage()); - safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); - } - - #endif // SHOW_CUSTOM_BOOTSCREEN - - void lcd_bootscreen() { - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - lcd_custom_bootscreen(); - #endif - - constexpr uint8_t offy = - #if ENABLED(START_BMPHIGH) - (LCD_PIXEL_HEIGHT - (START_BMPHEIGHT)) / 2 - #else - 0 - //DOG_CHAR_HEIGHT - #endif - ; - - const uint8_t width = u8g.getWidth(), height = u8g.getHeight(), - offx = (width - (START_BMPWIDTH)) / 2; - - u8g.firstPage(); - do { - u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); - lcd_setFont(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - const uint8_t txt1X = width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH); - u8g.drawStr(txt1X, (height + DOG_CHAR_HEIGHT) / 2, STRING_SPLASH_LINE1); - #else - const uint8_t txt1X = (width - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2, - txt2X = (width - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2; - u8g.drawStr(txt1X, height - (DOG_CHAR_HEIGHT) * 3 / 3, STRING_SPLASH_LINE1); - u8g.drawStr(txt2X, height - (DOG_CHAR_HEIGHT) * 1 / 6, STRING_SPLASH_LINE2); - #endif - } while (u8g.nextPage()); - safe_delay(BOOTSCREEN_TIMEOUT); - } - -#endif // SHOW_BOOTSCREEN - -#if ENABLED(LIGHTWEIGHT_UI) - #include "status_screen_lite_ST7920.h" -#else - #include "status_screen_DOGM.h" -#endif - -// Initialize or re-initialize the LCD -static void lcd_implementation_init() { - - #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - #endif - - #if !defined(LCD_RESET_PIN) && (ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)) - #define LCD_RESET_PIN LCD_PINS_RS - #endif - - #if PIN_EXISTS(LCD_RESET) - OUT_WRITE(LCD_RESET_PIN, LOW); // perform a clean hardware reset - _delay_ms(5); - OUT_WRITE(LCD_RESET_PIN, HIGH); - _delay_ms(5); // delay to allow the display to initalize - #endif - - #if PIN_EXISTS(LCD_RESET) - u8g.begin(); - #endif - - #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel - u8g.setContrast(lcd_contrast); - #endif - - #if ENABLED(LCD_SCREEN_ROT_90) - u8g.setRot90(); // Rotate screen by 90° - #elif ENABLED(LCD_SCREEN_ROT_180) - u8g.setRot180(); // Rotate screen by 180° - #elif ENABLED(LCD_SCREEN_ROT_270) - u8g.setRot270(); // Rotate screen by 270° - #endif -} - -// The kill screen is displayed for unrecoverable conditions -void lcd_kill_screen() { - #if ENABLED(LIGHTWEIGHT_UI) - ST7920_Lite_Status_Screen::clear_text_buffer(); - #endif - const uint8_t h4 = u8g.getHeight() / 4; - u8g.firstPage(); - do { - lcd_setFont(FONT_MENU); - u8g.setPrintPos(0, h4 * 1); - lcd_print_utf(lcd_status_message); - u8g.setPrintPos(0, h4 * 2); - lcd_printPGM_utf(PSTR(MSG_HALTED)); - u8g.setPrintPos(0, h4 * 3); - lcd_printPGM_utf(PSTR(MSG_PLEASE_RESET)); - } while (u8g.nextPage()); -} - -void lcd_implementation_clear() { } // Automatically cleared by Picture Loop - -#if ENABLED(ULTIPANEL) - - uint8_t row_y1, row_y2; - uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION); - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - - u8g.setPrintPos(LCD_PIXEL_WIDTH - 11 * (DOG_CHAR_WIDTH), row_y2); - lcd_print('E'); - lcd_print((char)('1' + extruder)); - lcd_print(' '); - lcd_print(itostr3(thermalManager.degHotend(extruder))); - lcd_print('/'); - - if (lcd_blink() || !thermalManager.is_heater_idle(extruder)) - lcd_print(itostr3(thermalManager.degTargetHotend(extruder))); - } - - #endif // ADVANCED_PAUSE_FEATURE - - // Set the colors for a menu item based on whether it is selected - static void lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - - if (isSelected) { - #if ENABLED(MENU_HOLLOW_FRAME) - u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH); - u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH); - #else - u8g.setColorIndex(1); // black on white - u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, row_height - 1); - u8g.setColorIndex(0); // white on black - #endif - } - #if DISABLED(MENU_HOLLOW_FRAME) - else { - u8g.setColorIndex(1); // unmarked text is black on white - } - #endif - u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), row_y2); - } - - // Draw a static line of text in the same idiom as a menu item - static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char* valstr=NULL) { - - lcd_implementation_mark_as_selected(row, invert); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - char c; - int8_t n = LCD_WIDTH - (START_COL); - - if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { u8g.print(' '); n--; } - } - while (n > 0 && (c = pgm_read_byte(pstr))) { - n -= lcd_print_and_count(c); - pstr++; - } - if (valstr) while (n > 0 && (c = *valstr)) { - n -= lcd_print_and_count(c); - valstr++; - } - while (n-- > 0) u8g.print(' '); - } - - // Draw a generic menu item - static void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, const char* pstr, const char pre_char, const char post_char) { - UNUSED(pre_char); - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - uint8_t n = LCD_WIDTH - (START_COL) - 2; - while (char c = pgm_read_byte(pstr)) { - n -= lcd_print_and_count(c); - pstr++; - } - while (n--) u8g.print(' '); - u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), row_y2); - lcd_print(post_char); - u8g.print(' '); - } - - // Macros for specific types of menu items - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) - #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) - #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - - // Draw a menu item with an editable value - static void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, const char* pstr, const char* const data, const bool pgm) { - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); - uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen; - - while (char c = pgm_read_byte(pstr)) { - n -= lcd_print_and_count(c); - pstr++; - } - u8g.print(':'); - while (n--) u8g.print(' '); - u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, row_y2); - if (pgm) lcd_printPGM(data); else lcd_print((char*)data); - } - - // Macros for edit items - #define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false) - #define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true) - - #define DRAWMENU_SETTING_EDIT_GENERIC(_src) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, _src) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - - void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) { - const uint8_t labellen = utf8_strlen_P(pstr), - vallen = utf8_strlen(value); - - uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1; - - #if ENABLED(USE_BIG_EDIT_FONT) - constexpr uint8_t lcd_width_edit = (LCD_PIXEL_WIDTH) / (DOG_CHAR_WIDTH_EDIT); - - uint8_t lcd_width, char_width; - if (labellen <= lcd_width_edit - 1) { - if (labellen + vallen + 2 >= lcd_width_edit) rows = 2; - lcd_width = lcd_width_edit + 1; - char_width = DOG_CHAR_WIDTH_EDIT; - lcd_setFont(FONT_MENU_EDIT); - } - else { - lcd_width = LCD_WIDTH - (START_COL); - char_width = DOG_CHAR_WIDTH; - lcd_setFont(FONT_MENU); - } - #else - constexpr uint8_t lcd_width = LCD_WIDTH - (START_COL), - char_width = DOG_CHAR_WIDTH; - #endif - - // Center either one or two rows - const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3 - uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2; - - bool onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline); - if (onpage) { - u8g.setPrintPos(0, baseline); - lcd_printPGM_utf(pstr); - } - - if (value != NULL) { - u8g.print(':'); - if (rows == 2) { - baseline += segmentHeight; - onpage = PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline); - } - if (onpage) { - u8g.setPrintPos(((lcd_width - 1) - (vallen + 1)) * char_width, baseline); // Right-justified, leaving padded by spaces - u8g.print(' '); // overwrite char if value gets shorter - lcd_print(value); - } - } - } - - #if ENABLED(SDSUPPORT) - - static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, CardReader& theCard, const bool isDir) { - UNUSED(pstr); - - lcd_implementation_mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - constexpr uint8_t maxlen = LCD_WIDTH - (START_COL) - 1; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (isSelected) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge - #endif - } - - if (isDir) lcd_print(LCD_STR_FOLDER[0]); - - char c; - uint8_t n = maxlen; - while (n && (c = *outstr)) { - n -= lcd_print_and_count(c); - ++outstr; - } - while (n) { --n; u8g.print(' '); } - } - - #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, false) - #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, true) - - #endif // SDSUPPORT - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * UBL LCD "radar" map data - */ - #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now, - #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here - #define MAP_MAX_PIXELS_X 53 - #define MAP_MAX_PIXELS_Y 49 - - void lcd_implementation_ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { - // Scale the box pixels appropriately - uint8_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), - y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X), - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y), - - x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2, - y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2; - - // Clear the Mesh Map - - if (PAGE_CONTAINS(y_offset - 2, y_offset + y_map_pixels + 4)) { - u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box - u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4); - if (PAGE_CONTAINS(y_offset, y_offset + y_map_pixels)) { - u8g.setColorIndex(0); // Now actually clear the mesh map box - u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels); - } - } - - // Display Mesh Point Locations - - u8g.setColorIndex(1); - const uint8_t sx = x_offset + pixels_per_x_mesh_pnt / 2; - uint8_t y = y_offset + pixels_per_y_mesh_pnt / 2; - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) - if (PAGE_CONTAINS(y, y)) - for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) - u8g.drawBox(x, y, 1, 1); - - // Fill in the Specified Mesh Point - - uint8_t inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to - // invert the Y to get it to plot in the right location. - - const uint8_t by = y_offset + inverted_y * pixels_per_y_mesh_pnt; - if (PAGE_CONTAINS(by, by + pixels_per_y_mesh_pnt)) - u8g.drawBox( - x_offset + x_plot * pixels_per_x_mesh_pnt, by, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt - ); - - // Put Relevant Text on Display - - // Show X and Y positions at top of screen - u8g.setColorIndex(1); - if (PAGE_UNDER(7)) { - u8g.setPrintPos(5, 7); - lcd_print("X:"); - lcd_print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); - u8g.setPrintPos(74, 7); - lcd_print("Y:"); - lcd_print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); - } - - // Print plot position - if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - u8g.setPrintPos(5, LCD_PIXEL_HEIGHT); - lcd_print('('); - u8g.print(x_plot); - lcd_print(','); - u8g.print(y_plot); - lcd_print(')'); - - // Show the location value - u8g.setPrintPos(74, LCD_PIXEL_HEIGHT); - lcd_print("Z:"); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_print(ftostr43sign(ubl.z_values[x_plot][y_plot])); - else - lcd_printPGM(PSTR(" -----")); - } - - } - - #endif // AUTO_BED_LEVELING_UBL - -#endif // ULTIPANEL - -#endif // __ULTRALCD_IMPL_DOGM_H diff --git a/Marlin_thinkerV2/Marlin/ultralcd_impl_HD44780.h b/Marlin_thinkerV2/Marlin/ultralcd_impl_HD44780.h deleted file mode 100644 index d229a8378b..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd_impl_HD44780.h +++ /dev/null @@ -1,1635 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULTRALCD_IMPL_HD44780_H -#define ULTRALCD_IMPL_HD44780_H - -/** - * Implementation of the LCD display routines for a Hitachi HD44780 display. - * These are the most common LCD character displays. - */ - -#include "utility.h" -#include "duration_t.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" - - #if ENABLED(ULTIPANEL) - #define ULTRA_X_PIXELS_PER_CHAR 5 - #define ULTRA_Y_PIXELS_PER_CHAR 8 - #define ULTRA_COLUMNS_FOR_MESH_MAP 7 - #define ULTRA_ROWS_FOR_MESH_MAP 4 - - #define N_USER_CHARS 8 - - #define TOP_LEFT _BV(0) - #define TOP_RIGHT _BV(1) - #define LOWER_LEFT _BV(2) - #define LOWER_RIGHT _BV(3) - #endif -#endif - -extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. - -//////////////////////////////////// -// Setup button and encode mappings for each panel (into 'buttons' variable -// -// This is just to map common functions (across different panels) onto the same -// macro name. The mapping is independent of whether the button is directly connected or -// via a shift/i2c register. - -#if ENABLED(ULTIPANEL) - - // - // Setup other button mappings of each panel - // - #if ENABLED(LCD_I2C_VIKI) - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) - - #undef LCD_CLICKED - #if BUTTON_EXISTS(ENC) - // the pause/stop/restart button is connected to BTN_ENC when used - #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name - #define LCD_CLICKED (buttons & (B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop. - #else - #define LCD_CLICKED (buttons & (B_MI|B_RI)) - #endif - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later - - #undef LCD_CLICKED - #define LCD_CLICKED (buttons & B_MI) - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #endif - - #elif DISABLED(NEWPANEL) // old style ULTIPANEL - // Shift register bits correspond to buttons: - #define BL_LE 7 // Left - #define BL_UP 6 // Up - #define BL_MI 5 // Middle - #define BL_DW 4 // Down - #define BL_RI 3 // Right - #define BL_ST 2 // Red Button - #define B_LE (_BV(BL_LE)) - #define B_UP (_BV(BL_UP)) - #define B_MI (_BV(BL_MI)) - #define B_DW (_BV(BL_DW)) - #define B_RI (_BV(BL_RI)) - #define B_ST (_BV(BL_ST)) - #define LCD_CLICKED (buttons & (B_MI|B_ST)) - #endif - -#endif // ULTIPANEL - -//////////////////////////////////// -// Create LCD class instance and chipset-specific information -#if ENABLED(LCD_I2C_TYPE_PCF8575) - // note: these are register mapped pins on the PCF8575 controller not Arduino pins - #define LCD_I2C_PIN_BL 3 - #define LCD_I2C_PIN_EN 2 - #define LCD_I2C_PIN_RW 1 - #define LCD_I2C_PIN_RS 0 - #define LCD_I2C_PIN_D4 4 - #define LCD_I2C_PIN_D5 5 - #define LCD_I2C_PIN_D6 6 - #define LCD_I2C_PIN_D7 7 - - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_I2C_PIN_EN, LCD_I2C_PIN_RW, LCD_I2C_PIN_RS, LCD_I2C_PIN_D4, LCD_I2C_PIN_D5, LCD_I2C_PIN_D6, LCD_I2C_PIN_D7); - -#elif ENABLED(LCD_I2C_TYPE_MCP23017) - //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators()) - #define LED_A 0x04 //100 - #define LED_B 0x02 //010 - #define LED_C 0x01 //001 - - #define LCD_HAS_STATUS_INDICATORS - - #include - #include - #define LCD_CLASS LiquidTWI2 - #if ENABLED(DETECT_DEVICE) - LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); - #else - LCD_CLASS lcd(LCD_I2C_ADDRESS); - #endif - -#elif ENABLED(LCD_I2C_TYPE_MCP23008) - #include - #include - #define LCD_CLASS LiquidTWI2 - #if ENABLED(DETECT_DEVICE) - LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); - #else - LCD_CLASS lcd(LCD_I2C_ADDRESS); - #endif - -#elif ENABLED(LCD_I2C_TYPE_PCA8574) - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT); - -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection -#elif ENABLED(SR_LCD_2W_NL) - extern "C" void __cxa_pure_virtual() { while (1); } - #include - #include - #define LCD_CLASS LiquidCrystal_SR - #if PIN_EXISTS(SR_STROBE) - LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN, SR_STROBE_PIN); - #else - LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN); - #endif -#elif ENABLED(LCM1602) - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); -#else - // Standard directly connected LCD implementations - #include - #define LCD_CLASS LiquidCrystal - LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 -#endif - -#include "utf_mapper.h" - -#if ENABLED(LCD_PROGRESS_BAR) - static millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle - #if PROGRESS_MSG_EXPIRE > 0 - static millis_t expire_status_ms = 0; // millis at which to expire the status message - #endif - #define LCD_STR_PROGRESS "\x03\x04\x05" -#endif - -#if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void lcd_implementation_update_indicators(); -#endif - -static void createChar_P(const char c, const byte * const ptr) { - byte temp[8]; - for (uint8_t i = 0; i < 8; i++) - temp[i] = pgm_read_byte(&ptr[i]); - lcd.createChar(c, temp); -} - -#define CHARSET_MENU 0 -#define CHARSET_INFO 1 -#define CHARSET_BOOT 2 - -static void lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) - const uint8_t screen_charset=CHARSET_INFO - #endif -) { - // CHARSET_BOOT - #if ENABLED(SHOW_BOOTSCREEN) - const static PROGMEM byte corner[4][8] = { { - B00000, - B00000, - B00000, - B00000, - B00001, - B00010, - B00100, - B00100 - }, { - B00000, - B00000, - B00000, - B11100, - B11100, - B01100, - B00100, - B00100 - }, { - B00100, - B00010, - B00001, - B00000, - B00000, - B00000, - B00000, - B00000 - }, { - B00100, - B01000, - B10000, - B00000, - B00000, - B00000, - B00000, - B00000 - } }; - #endif // SHOW_BOOTSCREEN - - // CHARSET_INFO - const static PROGMEM byte bedTemp[8] = { - B00000, - B11111, - B10101, - B10001, - B10101, - B11111, - B00000, - B00000 - }; - - const static PROGMEM byte degree[8] = { - B01100, - B10010, - B10010, - B01100, - B00000, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte thermometer[8] = { - B00100, - B01010, - B01010, - B01010, - B01010, - B10001, - B10001, - B01110 - }; - - const static PROGMEM byte uplevel[8] = { - B00100, - B01110, - B11111, - B00100, - B11100, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte feedrate[8] = { - B11100, - B10000, - B11000, - B10111, - B00101, - B00110, - B00101, - B00000 - }; - - const static PROGMEM byte clock[8] = { - B00000, - B01110, - B10011, - B10101, - B10001, - B01110, - B00000, - B00000 - }; - - #if ENABLED(LCD_PROGRESS_BAR) - - // CHARSET_INFO - const static PROGMEM byte progress[3][8] = { { - B00000, - B10000, - B10000, - B10000, - B10000, - B10000, - B10000, - B00000 - }, { - B00000, - B10100, - B10100, - B10100, - B10100, - B10100, - B10100, - B00000 - }, { - B00000, - B10101, - B10101, - B10101, - B10101, - B10101, - B10101, - B00000 - } }; - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(SDSUPPORT) - - // CHARSET_MENU - const static PROGMEM byte refresh[8] = { - B00000, - B00110, - B11001, - B11000, - B00011, - B10011, - B01100, - B00000, - }; - const static PROGMEM byte folder[8] = { - B00000, - B11100, - B11111, - B10001, - B10001, - B11111, - B00000, - B00000 - }; - - #endif // SDSUPPORT - - #if ENABLED(SHOW_BOOTSCREEN) - // Set boot screen corner characters - if (screen_charset == CHARSET_BOOT) { - for (uint8_t i = 4; i--;) - createChar_P(i, corner[i]); - } - else - #endif - { // Info Screen uses 5 special characters - createChar_P(LCD_BEDTEMP_CHAR, bedTemp); - createChar_P(LCD_DEGREE_CHAR, degree); - createChar_P(LCD_STR_THERMOMETER[0], thermometer); - createChar_P(LCD_FEEDRATE_CHAR, feedrate); - createChar_P(LCD_CLOCK_CHAR, clock); - - #if ENABLED(LCD_PROGRESS_BAR) - if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen - for (int16_t i = 3; i--;) - createChar_P(LCD_STR_PROGRESS[i], progress[i]); - } - else - #endif - { - createChar_P(LCD_UPLEVEL_CHAR, uplevel); - #if ENABLED(SDSUPPORT) - // SD Card sub-menu special characters - createChar_P(LCD_STR_REFRESH[0], refresh); - createChar_P(LCD_STR_FOLDER[0], folder); - #endif - } - } -} - -static void lcd_implementation_init( - #if ENABLED(LCD_PROGRESS_BAR) - const uint8_t screen_charset=CHARSET_INFO - #endif -) { - - #if ENABLED(LCD_I2C_TYPE_PCF8575) - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #ifdef LCD_I2C_PIN_BL - lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE); - lcd.setBacklight(HIGH); - #endif - - #elif ENABLED(LCD_I2C_TYPE_MCP23017) - lcd.setMCPType(LTI_TYPE_MCP23017); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - lcd_implementation_update_indicators(); - - #elif ENABLED(LCD_I2C_TYPE_MCP23008) - lcd.setMCPType(LTI_TYPE_MCP23008); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - - #elif ENABLED(LCD_I2C_TYPE_PCA8574) - lcd.init(); - lcd.backlight(); - - #else - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #endif - - lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) - screen_charset - #endif - ); - - lcd.clear(); -} - -void lcd_implementation_clear() { lcd.clear(); } -void lcd_print(const char c) { charset_mapper(c); } -void lcd_print(const char *str) { while (*str) lcd.print(*str++); } -void lcd_printPGM(const char *str) { while (const char c = pgm_read_byte(str)) lcd.print(c), ++str; } - -void lcd_print_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = *str)) n -= charset_mapper(c), ++str; -} - -void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { - char c; - while (n && (c = pgm_read_byte(str))) n -= charset_mapper(c), ++str; -} - -#if ENABLED(SHOW_BOOTSCREEN) - - void lcd_erase_line(const int16_t line) { - lcd.setCursor(0, line); - for (uint8_t i = LCD_WIDTH + 1; --i;) - lcd.write(' '); - } - - // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line - void lcd_scroll(const int16_t col, const int16_t line, const char* const text, const int16_t len, const int16_t time) { - uint8_t slen = utf8_strlen_P(text); - if (slen < len) { - // Fits into, - lcd.setCursor(col, line); - lcd_printPGM_utf(text, len); - while (slen < len) { - lcd.write(' '); - ++slen; - } - safe_delay(time); - } - else { - const char* p = text; - int dly = time / MAX(slen, 1); - for (uint8_t i = 0; i <= slen; i++) { - - // Go to the correct place - lcd.setCursor(col, line); - - // Print the text - lcd_printPGM_utf(p, len); - - // Fill with spaces - uint8_t ix = slen - i; - while (ix < len) { - lcd.write(' '); - ++ix; - } - - // Delay - safe_delay(dly); - - // Advance to the next UTF8 valid position - p++; - while (!START_OF_UTF8_CHAR(pgm_read_byte(p))) p++; - } - } - } - - static void logo_lines(const char* const extra) { - int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; - lcd.setCursor(indent, 0); lcd.print('\x00'); lcd_printPGM(PSTR( "------" )); lcd.write('\x01'); - lcd.setCursor(indent, 1); lcd_printPGM(PSTR("|Marlin|")); lcd_printPGM(extra); - lcd.setCursor(indent, 2); lcd.write('\x02'); lcd_printPGM(PSTR( "------" )); lcd.write('\x03'); - } - - void lcd_bootscreen() { - lcd_set_custom_characters(CHARSET_BOOT); - lcd.clear(); - - #define LCD_EXTRA_SPACE (LCD_WIDTH-8) - - #define CENTER_OR_SCROLL(STRING,DELAY) \ - lcd_erase_line(3); \ - if (strlen(STRING) <= LCD_WIDTH) { \ - lcd.setCursor((LCD_WIDTH - utf8_strlen_P(PSTR(STRING))) / 2, 3); \ - lcd_printPGM_utf(PSTR(STRING)); \ - safe_delay(DELAY); \ - } \ - else { \ - 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 >= 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); - #endif - } - #elif defined(STRING_SPLASH_LINE2) - // - // Show splash line 2 only, alongside the logo if possible - // - if (LCD_EXTRA_SPACE >= 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 - // - logo_lines(PSTR("")); - safe_delay(2000); - #endif - - lcd.clear(); - safe_delay(100); - lcd_set_custom_characters(); - lcd.clear(); - } - -#endif // SHOW_BOOTSCREEN - -void lcd_kill_screen() { - lcd.setCursor(0, 0); - lcd_print_utf(lcd_status_message); - #if LCD_HEIGHT < 4 - lcd.setCursor(0, 2); - #else - lcd.setCursor(0, 2); - lcd_printPGM_utf(PSTR(MSG_HALTED)); - lcd.setCursor(0, 3); - #endif - lcd_printPGM_utf(PSTR(MSG_PLEASE_RESET)); -} - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - lcd_print('X' + uint8_t(axis)); - if (blink) - lcd.print(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_print(c <= '.' ? c : '?'); - else { - #if DISABLED(HOME_AFTER_DEACTIVATE) && DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_printPGM(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd.print(value); - } - } -} - -FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, const bool blink) { - #if HAS_HEATED_BED - const bool isBed = heater < 0; - const float t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), - t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); - #else - const float t1 = thermalManager.degHotend(heater), t2 = thermalManager.degTargetHotend(heater); - #endif - - if (prefix >= 0) lcd.print(prefix); - - lcd.print(itostr3(t1 + 0.5)); - lcd.write('/'); - - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #else - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : - #endif - thermalManager.is_heater_idle(heater) - ); - - if (!blink && is_idle) { - lcd.write(' '); - if (t2 >= 10) lcd.write(' '); - if (t2 >= 100) lcd.write(' '); - } - else - #endif - lcd.print(itostr3left(t2 + 0.5)); - - if (prefix >= 0) { - lcd.print((char)LCD_DEGREE_CHAR); - lcd.write(' '); - if (t2 < 10) lcd.write(' '); - } -} - -#if ENABLED(LCD_PROGRESS_BAR) - - inline void lcd_draw_progress_bar(const uint8_t percent) { - const int16_t tix = (int16_t)(percent * (LCD_WIDTH) * 3) / 100, - cel = tix / 3, - rem = tix % 3; - uint8_t i = LCD_WIDTH; - char msg[LCD_WIDTH + 1], b = ' '; - msg[LCD_WIDTH] = '\0'; - while (i--) { - if (i == cel - 1) - b = LCD_STR_PROGRESS[2]; - else if (i == cel && rem != 0) - b = LCD_STR_PROGRESS[rem - 1]; - msg[i] = b; - } - lcd.print(msg); - } - -#endif // LCD_PROGRESS_BAR - -/** -Possible status screens: -16x2 |000/000 B000/000| - |0123456789012345| - -16x4 |000/000 B000/000| - |SD100% Z 000.00| - |F100% T--:--| - |0123456789012345| - -20x2 |T000/000D B000/000D | - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |X 000 Y 000 Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |T000/000D Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| -*/ -static void lcd_implementation_status_screen() { - const bool blink = lcd_blink(); - - // - // Line 1 - // - - lcd.setCursor(0, 0); - - #if LCD_WIDTH < 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, -1, blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - - lcd.setCursor(8, 0); - #if HOTENDS > 1 - lcd.print((char)LCD_STR_THERMOMETER[0]); - _draw_heater_status(1, -1, blink); - #else - lcd.print((char)LCD_BEDTEMP_CHAR); - _draw_heater_status(-1, -1, blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #else // LCD_WIDTH >= 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - lcd.setCursor(10, 0); - #if HOTENDS > 1 - _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); - #else - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #endif // LCD_WIDTH >= 20 - - // - // Line 2 - // - - #if LCD_HEIGHT > 2 - - #if LCD_WIDTH < 20 - - #if ENABLED(SDSUPPORT) - lcd.setCursor(0, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) - lcd.print(itostr3(card.percentDone())); - else - lcd_printPGM(PSTR("---")); - lcd.write('%'); - #endif // SDSUPPORT - - #else // LCD_WIDTH >= 20 - - lcd.setCursor(0, 1); - - // If the first line has two extruder temps, - // show more temperatures on the next line - - #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) - - #if HOTENDS > 2 - _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); - lcd.setCursor(10, 1); - #endif - - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - - #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); - - lcd.write(' '); - - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); - - #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - #endif // LCD_WIDTH >= 20 - - lcd.setCursor(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); - - #if HAS_LEVELING && !HAS_HEATED_BED - lcd.write(planner.leveling_active || blink ? '_' : ' '); - #endif - - #endif // LCD_HEIGHT > 2 - - // - // Line 3 - // - - #if LCD_HEIGHT > 3 - - lcd.setCursor(0, 2); - lcd.print((char)LCD_FEEDRATE_CHAR); - lcd.print(itostr3(feedrate_percentage)); - lcd.write('%'); - - #if LCD_WIDTH >= 20 && ENABLED(SDSUPPORT) - - lcd.setCursor(7, 2); - lcd_printPGM(PSTR("SD")); - if (IS_SD_PRINTING) - lcd.print(itostr3(card.percentDone())); - else - lcd_printPGM(PSTR("---")); - lcd.write('%'); - - #endif // LCD_WIDTH >= 20 && SDSUPPORT - - char buffer[10]; - duration_t elapsed = print_job_timer.duration(); - uint8_t len = elapsed.toDigital(buffer); - - lcd.setCursor(LCD_WIDTH - len - 1, 2); - lcd.print((char)LCD_CLOCK_CHAR); - lcd_print(buffer); - - #endif // LCD_HEIGHT > 3 - - // - // Last Line - // Status Message (which may be a Progress Bar or Filament display) - // - - lcd.setCursor(0, LCD_HEIGHT - 1); - - #if ENABLED(LCD_PROGRESS_BAR) - - // Draw the progress bar if the message has shown long enough - // or if there is no message set. - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) - return lcd_draw_progress_bar(progress_bar_percent); - - #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - - // Show Filament Diameter and Volumetric Multiplier % - // After allowing lcd_status_message to show for 5 seconds - if (ELAPSED(millis(), previous_lcd_status_ms + 5000UL)) { - lcd_printPGM(PSTR("Dia ")); - lcd.print(ftostr12ns(filament_width_meas)); - lcd_printPGM(PSTR(" V")); - lcd.print(itostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); - lcd.write('%'); - return; - } - - #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_print_utf(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_print_utf(stat, LCD_WIDTH); - } - else { - - // The remaining string does not completely fill the screen - lcd_print_utf(stat, LCD_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - lcd.write('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - lcd.write('.'); - if (--chars) - lcd_print_utf(lcd_status_message, chars); // Print a second copy of the message - } - } - if (last_blink != blink) { - last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_print_utf(lcd_status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - lcd.write(' '); - ++slen; - } - #endif -} - -#if ENABLED(ULTIPANEL) - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { - if (row < LCD_HEIGHT) { - lcd.setCursor(LCD_WIDTH - 9, row); - _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], lcd_blink()); - } - } - - #endif // ADVANCED_PAUSE_FEATURE - - static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL) { - UNUSED(invert); - char c; - int8_t n = LCD_WIDTH; - lcd.setCursor(0, row); - if (center && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd.write(' '); n--; } - } - while (n > 0 && (c = pgm_read_byte(pstr))) { - n -= charset_mapper(c); - pstr++; - } - if (valstr) while (n > 0 && (c = *valstr)) { - n -= charset_mapper(c); - valstr++; - } - while (n-- > 0) lcd.write(' '); - } - - static void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char post_char) { - char c; - uint8_t n = LCD_WIDTH - 2; - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - while (n--) lcd.write(' '); - lcd.print(post_char); - } - - static void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { - char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen(data); - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - lcd.write(':'); - while (n--) lcd.write(' '); - lcd_print(data); - } - static void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) { - char c; - uint8_t n = LCD_WIDTH - 2 - utf8_strlen_P(data); - lcd.setCursor(0, row); - lcd.print(sel ? pre_char : ' '); - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= charset_mapper(c); - pstr++; - } - lcd.write(':'); - while (n--) lcd.write(' '); - lcd_printPGM(data); - } - - #define DRAWMENU_SETTING_EDIT_GENERIC(_src) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', _src) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - - void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) { - lcd.setCursor(1, 1); - lcd_printPGM_utf(pstr); - if (value != NULL) { - lcd.write(':'); - const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + utf8_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit - lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), valrow); // Right-justified, padded by spaces - lcd.write(' '); // overwrite char if value gets shorter - lcd_print(value); - } - } - - #if ENABLED(SDSUPPORT) - - static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, CardReader& theCard, const uint8_t concat, const char post_char) { - UNUSED(pstr); - lcd.setCursor(0, row); - lcd.print(sel ? '>' : ' '); - - uint8_t n = LCD_WIDTH - concat; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (sel) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - n); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[n] = '\0'; // cutoff at screen edge - #endif - } - - char c; - while (n && (c = *outstr)) { - n -= charset_mapper(c); - ++outstr; - } - while (n) { --n; lcd.write(' '); } - - lcd.print(post_char); - } - - static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, ' '); - } - - static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, CardReader& theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); - } - - #endif // SDSUPPORT - - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR) - #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) - #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - - extern millis_t next_button_update_ms; - - static uint8_t lcd_implementation_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 - uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; - #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 - return slow_bits; - #endif // LCD_I2C_TYPE_MCP23017 - } - - #endif // LCD_HAS_SLOW_BUTTONS - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - - static void lcd_implementation_update_indicators() { - // Set the LEDS - referred to as backlights by the LiquidTWI2 library - static uint8_t ledsprev = 0; - uint8_t leds = 0; - - if (thermalManager.degTargetBed() > 0) leds |= LED_A; - - if (thermalManager.degTargetHotend(0) > 0) leds |= LED_B; - - #if FAN_COUNT > 0 - if (0 - #if HAS_FAN0 - || fanSpeeds[0] - #endif - #if HAS_FAN1 - || fanSpeeds[1] - #endif - #if HAS_FAN2 - || fanSpeeds[2] - #endif - ) leds |= LED_C; - #endif // FAN_COUNT > 0 - - #if HOTENDS > 1 - if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C; - #endif - - if (leds != ledsprev) { - lcd.setBacklight(leds); - ledsprev = leds; - } - } - - #endif // LCD_HAS_STATUS_INDICATORS - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - Possible map screens: - - 16x2 |X000.00 Y000.00| - |(00,00) Z00.000| - - 20x2 | X:000.00 Y:000.00 | - | (00,00) Z:00.000 | - - 16x4 |+-------+(00,00)| - || |X000.00| - || |Y000.00| - |+-------+Z00.000| - - 20x4 | +-------+ (00,00) | - | | | X:000.00| - | | | Y:000.00| - | +-------+ Z:00.000| - */ - - typedef struct { - uint8_t custom_char_bits[ULTRA_Y_PIXELS_PER_CHAR]; - } custom_char; - - typedef struct { - uint8_t column, row; - uint8_t y_pixel_offset, x_pixel_offset; - uint8_t x_pixel_mask; - } coordinate; - - void add_edges_to_custom_char(custom_char * const custom, coordinate * const ul, coordinate * const lr, coordinate * const brc, const uint8_t cell_location); - FORCE_INLINE static void clear_custom_char(custom_char * const cc) { ZERO(cc->custom_char_bits); } - - /* - // This debug routine should be deleted by anybody that sees it. It doesn't belong here - // But I'm leaving it for now until we know the 20x4 Radar Map is working right. - // We may need it again if any funny lines show up on the mesh points. - void dump_custom_char(char *title, custom_char *c) { - SERIAL_PROTOCOLLN(title); - for (uint8_t j = 0; j < 8; j++) { - for (uint8_t i = 7; i >= 0; i--) - SERIAL_PROTOCOLCHAR(TEST(c->custom_char_bits[j], i) ? '1' : '0'); - SERIAL_EOL(); - } - SERIAL_EOL(); - } - //*/ - - coordinate pixel_location(int16_t x, int16_t y) { - coordinate ret_val; - int16_t xp, yp, r, c; - - x++; y++; // +1 because lines on the left and top - - c = x / (ULTRA_X_PIXELS_PER_CHAR); - r = y / (ULTRA_Y_PIXELS_PER_CHAR); - - ret_val.column = c; - ret_val.row = r; - - xp = x - c * (ULTRA_X_PIXELS_PER_CHAR); // get the pixel offsets into the character cell - xp = ULTRA_X_PIXELS_PER_CHAR - 1 - xp; // column within relevant character cell (0 on the right) - yp = y - r * (ULTRA_Y_PIXELS_PER_CHAR); - - ret_val.x_pixel_mask = _BV(xp); - ret_val.x_pixel_offset = xp; - ret_val.y_pixel_offset = yp; - return ret_val; - } - - inline coordinate pixel_location(const uint8_t x, const uint8_t y) { return pixel_location((int16_t)x, (int16_t)y); } - - void lcd_implementation_ubl_plot(const uint8_t x, const uint8_t inverted_y) { - - #if LCD_WIDTH >= 20 - #define _LCD_W_POS 12 - #define _PLOT_X 1 - #define _MAP_X 3 - #define _LABEL(C,X,Y) lcd.setCursor(X, Y); lcd.print(C) - #define _XLABEL(X,Y) _LABEL("X:",X,Y) - #define _YLABEL(X,Y) _LABEL("Y:",X,Y) - #define _ZLABEL(X,Y) _LABEL("Z:",X,Y) - #else - #define _LCD_W_POS 8 - #define _PLOT_X 0 - #define _MAP_X 1 - #define _LABEL(X,Y,C) lcd.setCursor(X, Y); lcd.write(C) - #define _XLABEL(X,Y) _LABEL('X',X,Y) - #define _YLABEL(X,Y) _LABEL('Y',X,Y) - #define _ZLABEL(X,Y) _LABEL('Z',X,Y) - #endif - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Show X and Y positions - */ - _XLABEL(_PLOT_X, 0); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); - - _YLABEL(_LCD_W_POS, 0); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); - - lcd.setCursor(_PLOT_X, 0); - - #else // 16x4 or 20x4 display - - coordinate upper_left, lower_right, bottom_right_corner; - custom_char new_char; - uint8_t i, j, k, l, m, n, n_rows, n_cols, y, - bottom_line, right_edge, - x_map_pixels, y_map_pixels, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt, - suppress_x_offset = 0, suppress_y_offset = 0; - - y = GRID_MAX_POINTS_Y - inverted_y - 1; - - upper_left.column = 0; - upper_left.row = 0; - lower_right.column = 0; - lower_right.row = 0; - - lcd_implementation_clear(); - - x_map_pixels = (ULTRA_X_PIXELS_PER_CHAR) * (ULTRA_COLUMNS_FOR_MESH_MAP) - 2; // minus 2 because we are drawing a box around the map - y_map_pixels = (ULTRA_Y_PIXELS_PER_CHAR) * (ULTRA_ROWS_FOR_MESH_MAP) - 2; - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X); - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y); - - if (pixels_per_x_mesh_pnt >= ULTRA_X_PIXELS_PER_CHAR) { // There are only 2 custom characters available, so the X - pixels_per_x_mesh_pnt = ULTRA_X_PIXELS_PER_CHAR; // size of the mesh point needs to fit within them independent - suppress_x_offset = 1; // of where the starting pixel is located. - } - - if (pixels_per_y_mesh_pnt >= ULTRA_Y_PIXELS_PER_CHAR) { // There are only 2 custom characters available, so the Y - pixels_per_y_mesh_pnt = ULTRA_Y_PIXELS_PER_CHAR; // size of the mesh point needs to fit within them independent - suppress_y_offset = 1; // of where the starting pixel is located. - } - - x_map_pixels = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X); // now we have the right number of pixels to make both - y_map_pixels = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y); // directions fit nicely - - right_edge = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X) + 1; // find location of right edge within the character cell - bottom_line= pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 1; // find location of bottome line within the character cell - - n_rows = bottom_line / (ULTRA_Y_PIXELS_PER_CHAR) + 1; - n_cols = right_edge / (ULTRA_X_PIXELS_PER_CHAR) + 1; - - for (i = 0; i < n_cols; i++) { - lcd.setCursor(i, 0); - lcd.print((char)0x00); // top line of the box - - lcd.setCursor(i, n_rows - 1); - lcd.write(0x01); // bottom line of the box - } - - for (j = 0; j < n_rows; j++) { - lcd.setCursor(0, j); - lcd.write(0x02); // Left edge of the box - lcd.setCursor(n_cols - 1, j); - lcd.write(0x03); // right edge of the box - } - - /** - * If the entire 4th row is not in use, do not put vertical bars all the way down to the bottom of the display - */ - - k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2; - l = (ULTRA_Y_PIXELS_PER_CHAR) * n_rows; - if (l > k && l - k >= (ULTRA_Y_PIXELS_PER_CHAR) / 2) { - lcd.setCursor(0, n_rows - 1); // left edge of the box - lcd.write(' '); - lcd.setCursor(n_cols - 1, n_rows - 1); // right edge of the box - lcd.write(' '); - } - - clear_custom_char(&new_char); - new_char.custom_char_bits[0] = 0b11111U; // char #0 is used for the top line of the box - lcd.createChar(0, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - k = (GRID_MAX_POINTS_Y) * pixels_per_y_mesh_pnt + 1; // row of pixels for the bottom box line - l = k % (ULTRA_Y_PIXELS_PER_CHAR); // row within relevant character cell - new_char.custom_char_bits[l] = 0b11111U; // char #1 is used for the bottom line of the box - lcd.createChar(1, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - for (j = 0; j < ULTRA_Y_PIXELS_PER_CHAR; j++) - new_char.custom_char_bits[j] = 0b10000U; // char #2 is used for the left edge of the box - lcd.createChar(2, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - m = (GRID_MAX_POINTS_X) * pixels_per_x_mesh_pnt + 1; // Column of pixels for the right box line - n = m % (ULTRA_X_PIXELS_PER_CHAR); // Column within relevant character cell - i = ULTRA_X_PIXELS_PER_CHAR - 1 - n; // Column within relevant character cell (0 on the right) - for (j = 0; j < ULTRA_Y_PIXELS_PER_CHAR; j++) - new_char.custom_char_bits[j] = (uint8_t)_BV(i); // Char #3 is used for the right edge of the box - lcd.createChar(3, (uint8_t*)&new_char); - - i = x * pixels_per_x_mesh_pnt - suppress_x_offset; - j = y * pixels_per_y_mesh_pnt - suppress_y_offset; - upper_left = pixel_location(i, j); - - k = (x + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset; - l = (y + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset; - lower_right = pixel_location(k, l); - - bottom_right_corner = pixel_location(x_map_pixels, y_map_pixels); - - /** - * First, handle the simple case where everything is within a single character cell. - * If part of the Mesh Plot is outside of this character cell, we will follow up - * and deal with that next. - */ - - //dump_custom_char("at entry:", &new_char); - - clear_custom_char(&new_char); - const uint8_t ypix = MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, ULTRA_Y_PIXELS_PER_CHAR); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = upper_left.x_pixel_mask; - for (k = 0; k < pixels_per_x_mesh_pnt; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - //dump_custom_char("after loops:", &new_char); - - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, TOP_LEFT); - //dump_custom_char("after add edges", &new_char); - lcd.createChar(4, (uint8_t*)&new_char); - - lcd.setCursor(upper_left.column, upper_left.row); - lcd.write(0x04); - //dump_custom_char("after lcd update:", &new_char); - - /** - * Next, check for two side by side character cells being used to display the Mesh Point - * If found... do the right hand character cell next. - */ - if (upper_left.column == lower_right.column - 1) { - l = upper_left.x_pixel_offset; - clear_custom_char(&new_char); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = _BV(ULTRA_X_PIXELS_PER_CHAR - 1); // Fill in the left side of the right character cell - for (k = 0; k < pixels_per_x_mesh_pnt - 1 - l; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, TOP_RIGHT); - - lcd.createChar(5, (uint8_t *) &new_char); - - lcd.setCursor(lower_right.column, upper_left.row); - lcd.write(0x05); - } - - /** - * Next, check for two character cells stacked on top of each other being used to display the Mesh Point - */ - if (upper_left.row == lower_right.row - 1) { - l = ULTRA_Y_PIXELS_PER_CHAR - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - i = upper_left.x_pixel_mask; - for (m = 0; m < pixels_per_x_mesh_pnt; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - if (!(i >>= 1)) break; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, LOWER_LEFT); - lcd.createChar(6, (uint8_t *) &new_char); - - lcd.setCursor(upper_left.column, lower_right.row); - lcd.write(0x06); - } - - /** - * Next, check for four character cells being used to display the Mesh Point. If that is - * what is here, we work to fill in the character cell that is down one and to the right one - * from the upper_left character cell. - */ - - if (upper_left.column == lower_right.column - 1 && upper_left.row == lower_right.row - 1) { - l = ULTRA_Y_PIXELS_PER_CHAR - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - l = upper_left.x_pixel_offset; - i = _BV(ULTRA_X_PIXELS_PER_CHAR - 1); // Fill in the left side of the right character cell - for (m = 0; m < pixels_per_x_mesh_pnt - 1 - l; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - add_edges_to_custom_char(&new_char, &upper_left, &lower_right, &bottom_right_corner, LOWER_RIGHT); - lcd.createChar(7, (uint8_t*)&new_char); - - lcd.setCursor(lower_right.column, lower_right.row); - lcd.write(0x07); - } - - #endif - - /** - * Print plot position - */ - lcd.setCursor(_LCD_W_POS, 0); - lcd.write('('); - lcd.print(x); - lcd.write(','); - lcd.print(inverted_y); - lcd.write(')'); - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Print Z values - */ - _ZLABEL(_LCD_W_POS, 1); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd.print(ftostr43sign(ubl.z_values[x][inverted_y])); - else - lcd_printPGM(PSTR(" -----")); - - #else // 16x4 or 20x4 display - - /** - * Show all values at right of screen - */ - _XLABEL(_LCD_W_POS, 1); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); - _YLABEL(_LCD_W_POS, 2); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); - - /** - * Show the location value - */ - _ZLABEL(_LCD_W_POS, 3); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd.print(ftostr43sign(ubl.z_values[x][inverted_y])); - else - lcd_printPGM(PSTR(" -----")); - - #endif // LCD_HEIGHT > 3 - } - - void add_edges_to_custom_char(custom_char * const custom, coordinate * const ul, coordinate * const lr, coordinate * const brc, uint8_t cell_location) { - uint8_t i, k; - int16_t n_rows = lr->row - ul->row + 1, - n_cols = lr->column - ul->column + 1; - - /** - * Check if Top line of box needs to be filled in - */ - if (ul->row == 0 && ((cell_location & TOP_LEFT) || (cell_location & TOP_RIGHT))) { // Only fill in the top line for the top character cells - - if (n_cols == 1) { - if (ul->column != brc->column) - custom->custom_char_bits[0] = 0xFF; // Single column in middle - else - for (i = brc->x_pixel_offset; i < ULTRA_X_PIXELS_PER_CHAR; i++) // Single column on right side - SBI(custom->custom_char_bits[0], i); - } - else if ((cell_location & TOP_LEFT) || lr->column != brc->column) // Multiple column in the middle or with right cell in middle - custom->custom_char_bits[0] = 0xFF; - else - for (i = brc->x_pixel_offset; i < ULTRA_X_PIXELS_PER_CHAR; i++) - SBI(custom->custom_char_bits[0], i); - } - - /** - * Check if left line of box needs to be filled in - */ - if ((cell_location & TOP_LEFT) || (cell_location & LOWER_LEFT)) { - if (ul->column == 0) { // Left column of characters on LCD Display - k = ul->row == brc->row ? brc->y_pixel_offset : ULTRA_Y_PIXELS_PER_CHAR; // If it isn't the last row... do the full character cell - for (i = 0; i < k; i++) - SBI(custom->custom_char_bits[i], ULTRA_X_PIXELS_PER_CHAR - 1); - } - } - - /** - * Check if bottom line of box needs to be filled in - */ - - // Single row of mesh plot cells - if (n_rows == 1 /* && (cell_location == TOP_LEFT || cell_location == TOP_RIGHT) */ && ul->row == brc->row) { - if (n_cols == 1) // Single row, single column case - k = ul->column == brc->column ? brc->x_pixel_mask : 0x01; - else if (cell_location & TOP_RIGHT) // Single row, multiple column case - k = lr->column == brc->column ? brc->x_pixel_mask : 0x01; - else // Single row, left of multiple columns - k = 0x01; - while (k < _BV(ULTRA_X_PIXELS_PER_CHAR)) { - custom->custom_char_bits[brc->y_pixel_offset] |= k; - k <<= 1; - } - } - - // Double row of characters on LCD Display - // And this is a bottom custom character - if (n_rows == 2 && (cell_location == LOWER_LEFT || cell_location == LOWER_RIGHT) && lr->row == brc->row) { - if (n_cols == 1) // Double row, single column case - k = ul->column == brc->column ? brc->x_pixel_mask : 0x01; - else if (cell_location & LOWER_RIGHT) // Double row, multiple column case - k = lr->column == brc->column ? brc->x_pixel_mask : 0x01; - else // Double row, left of multiple columns - k = 0x01; - while (k < _BV(ULTRA_X_PIXELS_PER_CHAR)) { - custom->custom_char_bits[brc->y_pixel_offset] |= k; - k <<= 1; - } - } - - /** - * Check if right line of box needs to be filled in - */ - // Nothing to do if the lower right part of the mesh pnt isn't in the same column as the box line - if (lr->column == brc->column) { - // This mesh point is in the same character cell as the right box line - if (ul->column == brc->column || (cell_location & TOP_RIGHT) || (cell_location & LOWER_RIGHT)) { - // If not the last row... do the full character cell - k = ul->row == brc->row ? brc->y_pixel_offset : ULTRA_Y_PIXELS_PER_CHAR; - for (i = 0; i < k; i++) custom->custom_char_bits[i] |= brc->x_pixel_mask; - } - } - } - - #endif // AUTO_BED_LEVELING_UBL - -#endif // ULTIPANEL - -#endif // ULTRALCD_IMPL_HD44780_H diff --git a/Marlin_thinkerV2/Marlin/ultralcd_st7565_u8glib_VIKI.h b/Marlin_thinkerV2/Marlin/ultralcd_st7565_u8glib_VIKI.h deleted file mode 100644 index adb48ea6b2..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd_st7565_u8glib_VIKI.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -#ifndef ULCDST7565_H -#define ULCDST7565_H - -#include -#include "delay.h" - -#define ST7565_CLK_PIN DOGLCD_SCK -#define ST7565_DAT_PIN DOGLCD_MOSI -#define ST7565_CS_PIN DOGLCD_CS -#define ST7565_A0_PIN DOGLCD_A0 - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 -#define PAGE_HEIGHT 8 - -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - -// If you want you can define your own set of delays in Configuration.h -//#define ST7565_DELAY_1 DELAY_NS(0) -//#define ST7565_DELAY_2 DELAY_NS(0) -//#define ST7565_DELAY_3 DELAY_NS(0) - -/* -#define ST7565_DELAY_1 u8g_10MicroDelay() -#define ST7565_DELAY_2 u8g_10MicroDelay() -#define ST7565_DELAY_3 u8g_10MicroDelay() -*/ - -#if F_CPU >= 20000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(188) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(250) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(0) -#elif F_CPU == 16000000 - #define CPU_ST7565_DELAY_1 DELAY_NS(0) - #define CPU_ST7565_DELAY_2 DELAY_NS(0) - #define CPU_ST7565_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7565_u8glib_VIKI.h'" -#endif - -#ifndef ST7565_DELAY_1 - #define ST7565_DELAY_1 CPU_ST7565_DELAY_1 -#endif -#ifndef ST7565_DELAY_2 - #define ST7565_DELAY_2 CPU_ST7565_DELAY_2 -#endif -#ifndef ST7565_DELAY_3 - #define ST7565_DELAY_3 CPU_ST7565_DELAY_3 -#endif - -// On Viki2 the LCD and the SD card share a single SPI -#define HARDWARE_SPI ((DOGLCD_SCK == SCK_PIN) && (DOGLCD_MOSI == MOSI_PIN)) - -#if HARDWARE_SPI // using the hardware SPI - - #define ST7565_WRITE_BYTE(a) { SPDR = a; while (!TEST(SPSR, SPIF)); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {SPDR = *ptr++; while (!TEST(SPSR, SPIF));} U8G_DELAY(); } - -#else // !HARDWARE_SPI - - #define ST7565_SND_BIT \ - WRITE(ST7565_CLK_PIN, LOW); ST7565_DELAY_1; \ - WRITE(ST7565_DAT_PIN, val & 0x80); ST7565_DELAY_2; \ - WRITE(ST7565_CLK_PIN, HIGH); ST7565_DELAY_3; \ - WRITE(ST7565_CLK_PIN, LOW);\ - val <<= 1 - - static void ST7565_SWSPI_SND_8BIT(uint8_t val) { - ST7565_SND_BIT; // 1 - ST7565_SND_BIT; // 2 - ST7565_SND_BIT; // 3 - ST7565_SND_BIT; // 4 - ST7565_SND_BIT; // 5 - ST7565_SND_BIT; // 6 - ST7565_SND_BIT; // 7 - ST7565_SND_BIT; // 8 - } - - #define ST7565_WRITE_BYTE(a) { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY(); } - #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) { ST7565_SWSPI_SND_8BIT(*ptr++); } U8G_DELAY(); } - -#endif // !HARDWARE_SPI - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() u8g_10MicroDelay() -#endif - -#define ST7565_CS() do{ WRITE(ST7565_CS_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NCS() WRITE(ST7565_CS_PIN, LOW) -#define ST7565_A0() do{ WRITE(ST7565_A0_PIN, HIGH); U8G_DELAY(); }while(0) -#define ST7565_NA0() WRITE(ST7565_A0_PIN, LOW) - -#define ST7565_ADC_REVERSE(N) ST7565_WRITE_BYTE(0xA0 | ((N) & 0x1)) -#define ST7565_BIAS_MODE(N) ST7565_WRITE_BYTE(0xA2 | ((N) & 0x1)) -#define ST7565_ALL_PIX(N) ST7565_WRITE_BYTE(0xA4 | ((N) & 0x1)) -#define ST7565_INVERTED(N) ST7565_WRITE_BYTE(0xA6 | ((N) & 0x1)) -#define ST7565_ON(N) ST7565_WRITE_BYTE(0xAE | ((N) & 0x1)) -#define ST7565_OUT_MODE(N) ST7565_WRITE_BYTE(0xC0 | ((N) & 0x1) << 3) -#define ST7565_POWER_CONTROL(N) ST7565_WRITE_BYTE(0x28 | (N)) -#define ST7565_V0_RATIO(N) ST7565_WRITE_BYTE(0x10 | ((N) & 0x7)) // Specific to Displaytech 64128N? (ST7565 is 0x20 | N) -#define ST7565_CONTRAST(N) do{ ST7565_WRITE_BYTE(0x81); ST7565_WRITE_BYTE(N); }while(0) - -#define ST7565_COLUMN_ADR(N) do{ ST7565_WRITE_BYTE(0x10 | (((N) >> 4) & 0xF)); ST7565_WRITE_BYTE((N) & 0xF); }while(0) -#define ST7565_PAGE_ADR(N) ST7565_WRITE_BYTE(0xB0 | (N)) -#define ST7565_START_LINE(N) ST7565_WRITE_BYTE(0x40 | (N)) -#define ST7565_SLEEP_MODE() ST7565_WRITE_BYTE(0xAC) -#define ST7565_NOOP() ST7565_WRITE_BYTE(0xE3) - -uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - - case U8G_DEV_MSG_INIT: { - - OUT_WRITE(ST7565_CS_PIN, LOW); - OUT_WRITE(ST7565_DAT_PIN, LOW); - OUT_WRITE(ST7565_CLK_PIN, LOW); - - #if HARDWARE_SPI - OUT_WRITE(SDSS, 1); // must be set to an output first or else will never go into master mode - SPCR = 0x50; // enable SPI in master mode at fast speed - SPSR = 1; // kick it up to 2x speed mode - #endif - - OUT_WRITE(ST7565_A0_PIN, LOW); - - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - - ST7565_BIAS_MODE(0); // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet) - ST7565_ADC_REVERSE(0); // Normal (not flipped) ADC Select (according to Displaytech 64128N datasheet) - - ST7565_OUT_MODE(1); // common output mode: set scan direction normal operation/SHL Select; 0x0C0 --> SHL = 0; normal; 0x0C8 --> SHL = 1 - ST7565_START_LINE(0); // Display start line for Displaytech 64128N - - ST7565_POWER_CONTROL(0x4); // power control: turn on Booster - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_POWER_CONTROL(0x6); // power control: turn on Booster, Voltage Regulator - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_POWER_CONTROL(0x7); // power control: turn on Booster, Voltage Regulator, Voltage Follower - U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used - - ST7565_V0_RATIO(0); // Set V0 Voltage Resistor ratio. Setting for controlling brightness of Displaytech 64128N - - ST7565_INVERTED(0); // display normal, bit val 0: LCD pixel off. - - ST7565_CONTRAST(0x1E); // Contrast value. Setting for controlling contrast of Displaytech 64128N - - ST7565_ON(1); // display on - - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(1); // display all points; ST7565 - U8G_ESC_DLY(100); // delay 100 ms - U8G_ESC_DLY(100); // delay 100 ms - ST7565_ALL_PIX(0); // normal display - ST7565_CS(); // chip select off - } // end of sequence - break; - - case U8G_DEV_MSG_STOP: break; - - case U8G_DEV_MSG_PAGE_NEXT: { - u8g_pb_t *pb = (u8g_pb_t*)(dev->dev_mem); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf); - ST7565_CS(); // chip select off - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_COLUMN_ADR(0x00); // high 4 bits to 0, low 4 bits to 0 - // end of sequence - ST7565_PAGE_ADR(2 * pb->p.page + 1); // select current page (ST7565R) - ST7565_A0(); // data mode - ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf) + pb->width); - ST7565_CS(); // chip select off - } - break; - - case U8G_DEV_MSG_CONTRAST: - ST7565_NCS(); - ST7565_NA0(); // instruction mode - ST7565_CONTRAST((*(uint8_t*)arg) >> 2); - ST7565_CS(); // chip select off - return 1; - - case U8G_DEV_MSG_SLEEP_ON: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_SLEEP_MODE(); // static indicator off - //ST7565_WRITE_BYTE(0x00); // indicator register set (not sure if this is required) - ST7565_ON(0); // display off - ST7565_ALL_PIX(1); // all points on - ST7565_CS(); // chip select off - return 1; - - case U8G_DEV_MSG_SLEEP_OFF: - ST7565_NA0(); // instruction mode - ST7565_NCS(); // chip select - ST7565_ALL_PIX(0); // all points off - ST7565_ON(1); // display on - U8G_ESC_DLY(50); // delay 50 ms - ST7565_CS(); // chip select off - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[LCD_PIXEL_WIDTH * 2] U8G_NOCOMMON; -u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = {{16, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf}; -u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = {u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn}; - -class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB { - public: - U8GLIB_ST7565_64128n_2x_VIKI(uint8_t dummy) - : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi) - { } - U8GLIB_ST7565_64128n_2x_VIKI(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi) - { } -}; - -#pragma GCC reset_options - -#endif // ULCDST7565_H diff --git a/Marlin_thinkerV2/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin_thinkerV2/Marlin/ultralcd_st7920_u8glib_rrd.h deleted file mode 100644 index db6224e478..0000000000 --- a/Marlin_thinkerV2/Marlin/ultralcd_st7920_u8glib_rrd.h +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef ULCDST7920_H -#define ULCDST7920_H - -#include -#include "delay.h" - -#define ST7920_CLK_PIN LCD_PINS_D4 -#define ST7920_DAT_PIN LCD_PINS_ENABLE -#define ST7920_CS_PIN LCD_PINS_RS - -//#define PAGE_HEIGHT 8 //128 byte framebuffer -#define PAGE_HEIGHT 16 //256 byte framebuffer -//#define PAGE_HEIGHT 32 //512 byte framebuffer - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 - -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - -// If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) - -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'" -#endif - -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 -#endif - -#define ST7920_SND_BIT \ - WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ - WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \ - WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ - val <<= 1 - -static void ST7920_SWSPI_SND_8BIT(uint8_t val) { - ST7920_SND_BIT; // 1 - ST7920_SND_BIT; // 2 - ST7920_SND_BIT; // 3 - ST7920_SND_BIT; // 4 - ST7920_SND_BIT; // 5 - ST7920_SND_BIT; // 6 - ST7920_SND_BIT; // 7 - ST7920_SND_BIT; // 8 -} - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() u8g_10MicroDelay() -#endif - -#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } -#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } -#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } -#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(); } - -uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - uint8_t i, y; - switch (msg) { - case U8G_DEV_MSG_INIT: { - OUT_WRITE(ST7920_CS_PIN, LOW); - OUT_WRITE(ST7920_DAT_PIN, LOW); - OUT_WRITE(ST7920_CLK_PIN, HIGH); - - ST7920_CS(); - u8g_Delay(120); //initial delay for boot up - ST7920_SET_CMD(); - ST7920_WRITE_BYTE(0x20); //non-extended mode - ST7920_WRITE_BYTE(0x08); //display off, cursor+blink off - ST7920_WRITE_BYTE(0x01); //clear DDRAM ram - u8g_Delay(15); //delay for DDRAM clear - ST7920_WRITE_BYTE(0x24); //extended mode - ST7920_WRITE_BYTE(0x26); //extended mode + GDRAM active - for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM - ST7920_WRITE_BYTE(0x80 | y); //set y - ST7920_WRITE_BYTE(0x80); //set x = 0 - ST7920_SET_DAT(); - for (i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) //2x width clears both segments - ST7920_WRITE_BYTE(0); - ST7920_SET_CMD(); - } - ST7920_WRITE_BYTE(0x0C); //display on, cursor+blink off - ST7920_NCS(); - } - break; - - case U8G_DEV_MSG_STOP: break; - - case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t* ptr; - u8g_pb_t* pb = (u8g_pb_t*)(dev->dev_mem); - y = pb->p.page_y0; - ptr = (uint8_t*)pb->buf; - - ST7920_CS(); - for (i = 0; i < PAGE_HEIGHT; i ++) { - ST7920_SET_CMD(); - if (y < 32) { - ST7920_WRITE_BYTE(0x80 | y); //y - ST7920_WRITE_BYTE(0x80); //x=0 - } - else { - ST7920_WRITE_BYTE(0x80 | (y - 32)); //y - ST7920_WRITE_BYTE(0x80 | 8); //x=64 - } - ST7920_SET_DAT(); - ST7920_WRITE_BYTES(ptr, (LCD_PIXEL_WIDTH) / 8); //ptr is incremented inside of macro - y++; - } - ST7920_NCS(); - } - break; - } - #if PAGE_HEIGHT == 8 - return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg); - #elif PAGE_HEIGHT == 16 - return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg); - #else - return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg); - #endif -} - -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}; - -class U8GLIB_ST7920_128X64_RRD : public U8GLIB { - public: - U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } -}; - -#if ENABLED(LIGHTWEIGHT_UI) - // We have to include the code for the lightweight UI here - // as it relies on macros that are only defined in this file. - #include "status_screen_lite_ST7920_spi.h" -#endif - -#pragma GCC reset_options - -#endif // ULCDST7920_H diff --git a/Marlin_thinkerV2/Marlin/utf_mapper.h b/Marlin_thinkerV2/Marlin/utf_mapper.h deleted file mode 100644 index aacf2f11d5..0000000000 --- a/Marlin_thinkerV2/Marlin/utf_mapper.h +++ /dev/null @@ -1,671 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef UTF_MAPPER_H -#define UTF_MAPPER_H - -#include "language.h" - -#if ENABLED(DOGLCD) - #define HARDWARE_CHAR_OUT(C) u8g.print((char)(C)) -#else - #define HARDWARE_CHAR_OUT(C) lcd.write((char)(C)) -#endif - -#if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD) - #if ENABLED(DISPLAY_CHARSET_ISO10646_1) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_5) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - || ENABLED(DISPLAY_CHARSET_ISO10646_TR) - #define MAPPER_ONE_TO_ONE - #endif -#else // SIMULATE_ROMFONT || !DOGLCD - #if DISPLAY_CHARSET_HD44780 == JAPANESE - #if ENABLED(MAPPER_C2C3) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols - 0x20,0x3F,0xEC,0xED,0x3F,0x5C,0x7C,0x3F,0x22,0x63,0x61,0x7F,0x3F,0x3F,0x52,0xB0, // c2a - //' ' ¢ £ ­ l " c a « R - 0xDF,0x3F,0x32,0x33,0x27,0xE4,0xF1,0xA5,0x2C,0x31,0xDF,0x7E,0x3F,0x3F,0x3F,0x3F, // c2b but relatively bad for letters. - // ° 2 3 ` N p . , 1 ° » - 0x3F,0x3F,0x3F,0x3F,0xE1,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, // c38 - // ä - 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0xEF,0x78,0x3F,0x3F,0x3F,0x3F,0xF5,0x3F,0x3F,0xE2, // c39 missing characters display as '?' - // ö x ü ß - 0x3F,0x3F,0x3F,0x3F,0xE1,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, // c3a - // ä - 0x3F,0xEE,0x3F,0x3F,0x3F,0x3F,0xEF,0xFD,0x3F,0x3F,0x3F,0x3F,0xF5,0x3F,0x3F,0x3F // c3b - // n ö ÷ ü - }; - #elif ENABLED(MAPPER_E382E383) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 0x3D,0xB1,0xB1,0xA8,0xB2,0xA9,0xB3,0xAA,0xB4,0xAB,0xB5,0xB6,0xB6,0xB7,0xB7,0xB8, // e382a Please test and correct - // = ア ア ィ イ ゥ ウ ェ エ ォ オ ガ ガ キ キ ク - 0xB8,0xB9,0xB9,0xBA,0xBA,0xBB,0xBB,0xBC,0xBC,0xBD,0xBD,0xBE,0xBE,0xBF,0xBF,0xC0, // e382b - // ク ケ ケ コ コ サ サ シ シ ス ス セ セ ソ ソ タ - 0xC0,0xC1,0xC1,0xC2,0xC2,0xC2,0xC3,0xC3,0xC4,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA, // e3838 - // タ チ チ ッ ッ ッ テ テ ト ト ナ ニ ヌ ネ ノ ハ - 0xCA,0xCA,0xCB,0xCB,0xCB,0xCC,0xCC,0xCC,0xCD,0xCD,0xCD,0xCE,0xCE,0xCE,0xCF,0xD0, // e3839 - // ハ ハ ヒ ヒ ヒ フ フ フ ヘ ヘ ヘ ホ ホ ホ マ ミ - 0xD1,0xD2,0xD3,0xD4,0xD4,0xD5,0xD5,0xAE,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDC, // e383a - // ム メ モ ャ ャ ユ ユ ョ ヨ ラ リ ル レ ロ ワ ワ - 0xEC,0xA7,0xA6,0xDD,0xCC,0x3F,0x3F,0x3F,0x3F,0x3F,0xA6,0xA5,0xB0,0xA4,0xA4,0x3F // e383b - // ヰ ヱ ヲ ン フ ? ? ? ? ? ヲ ・ ー ヽ ヽ ? - }; - #elif ENABLED(MAPPER_D0D1) - #error "Cyrillic on a JAPANESE display makes no sense. There are no matching symbols." - #endif - - #elif DISPLAY_CHARSET_HD44780 == WESTERN - #if ENABLED(MAPPER_C2C3) - const PROGMEM uint8_t utf_recode[] = - { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete. - 0x20,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0x22,0xA9,0xAA,0xAB,0x3F,0x3F,0xAE,0x3F, // c2a ¡¢£¤¥¦§¨©ª«¬­®¯ - //' ' ¡ ¢ £ ¤ ¥ ¦ § " © ª « ? ? ® ? - 0xB0,0xB1,0xB2,0xB3,0x27,0xB5,0xB6,0xB7,0x2C,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, // c2b °±²³´µ¶·¸¹º»¼½¾¿ - // ° ± ³ ² ? µ ¶ · , ¹ º » ¼ ½ ¾ ¿ - 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, // c38 ÀÁÃÄÅÆÇÈÉÊËÌÍÎÏ - // À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï - 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, // c39 ÐÑÓÔÕÖ×ØÙÚÛÜÝÞß - // Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß - 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, // c3a àáãäåæçèéêëìíîï - // à á â ã ä å æ ç è é ê ë ì í î ï - 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF // c3b ðñóôõö÷øùúûüýþÿ - // ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ - }; - #elif ENABLED(MAPPER_D0D1) - #define MAPPER_D0D1_MOD - const PROGMEM uint8_t utf_recode[] = - {//0 1 2 3 4 5 6 7 8 9 a b c d e f - 0x41,0x80,0x42,0x92,0x81,0x45,0x82,0x83,0x84,0x85,0x4B,0x86,0x4D,0x48,0x4F,0x87, // d0a - // A Б B Г Д E Ж З И Й K Л M H O П - 0x50,0x43,0x54,0x88,0xD8,0x58,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x62,0x8F,0xAC,0xAD, // d0b - // P C T У Ф X Ч ч Ш Щ Ъ Ы b Э Ю Я - 0x61,0x36,0x42,0x92,0x81,0x65,0x82,0xB3,0x84,0x85,0x6B,0x86,0x4D,0x48,0x6F,0x87, // d18 - // a 6 B Г Д e Ж ³ И Й k Л M H o П - 0x70,0x63,0x54,0x79,0xD8,0x78,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x62,0x8F,0xAC,0xAD // d19 - // p c T y Ф x Ч ч Ш Щ Ъ Ы b Э Ю Я - }; - #elif ENABLED(MAPPER_E382E383) - #error "Katakana on a WESTERN display makes no sense. There are no matching symbols." - #endif - - #elif DISPLAY_CHARSET_HD44780 == CYRILLIC - #if ENABLED(MAPPER_D0D1) - #define MAPPER_D0D1_MOD - // it is a Russian alphabet translation - // except 0401 --> 0xA2 = Ё, 0451 --> 0xB5 = ё - const PROGMEM uint8_t utf_recode[] = - { 0x41,0xA0,0x42,0xA1,0xE0,0x45,0xA3,0xA4, // unicode U+0400 to U+047f - // A Б->Ё B Г Д E Ж З // 0 Ѐ Ё Ђ Ѓ Є Ѕ І Ї - 0xA5,0xA6,0x4B,0xA7,0x4D,0x48,0x4F,0xA8, // Ј Љ Њ Ћ Ќ Ѝ Ў Џ - // И Й K Л M H O П // 1 А Б В Г Д Е Ж З - 0x50,0x43,0x54,0xA9,0xAA,0x58,0xE1,0xAB, // И Й К Л М Н О П - // P C T У Ф X Ч ч // 2 Р С Т У Ф Х Г Ч - 0xAC,0xE2,0xAD,0xAE,0x62,0xAF,0xB0,0xB1, // Ш Щ Ъ Ы Ь Э Ю Я - // Ш Щ Ъ Ы b Э Ю Я // 3 а б в г д е ж з - 0x61,0xB2,0xB3,0xB4,0xE3,0x65,0xB6,0xB7, // и й к л м н о п - // a б->ё в г д e ж з // 4 р с т у ф х ц ч - 0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0x6F,0xBE, // ш щ ъ ы ь э ю я - // и й к л м н o п // 5 ѐ ё ђ ѓ є ѕ і ї - 0x70,0x63,0xBF,0x79,0xE4,0x78,0xE5,0xC0, // ј љ њ ћ ќ ѝ ў џ - // p c т y ф x ц ч // 6 Ѡ ѡ Ѣ ѣ Ѥ ѥ Ѧ ѧ - 0xC1,0xE6,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7 // Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ - // ш щ ъ ы ь э ю я // 7 Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ - }; // ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ - #elif ENABLED(MAPPER_C2C3) - #error "Western languages on a CYRILLIC display makes no sense. There are no matching symbols." - #elif ENABLED(MAPPER_E382E383) - #error "Katakana on a CYRILLIC display makes no sense. There are no matching symbols." - #endif - #else - #error "Something went wrong in the setting of DISPLAY_CHARSET_HD44780" - #endif // DISPLAY_CHARSET_HD44780 -#endif // SIMULATE_ROMFONT - -#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) - -#if ENABLED(MAPPER_C2C3) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_c2 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d >= 0xC0u && !seen_c2) { - utf_hi_char = d - 0xC2u; - seen_c2 = true; - return 0; - } - else if (seen_c2) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_c2 = false; - return 1; - } - -#elif ENABLED(MAPPER_C2C3_TR) - - // the C2C3-mapper extended for the 6 altered symbols from C4 and C5 range. - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_c2 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d >= 0xC0u && !seen_c2) { - utf_hi_char = d - 0xC2u; - seen_c2 = true; - return 0; - } - else if (seen_c4) { - switch(d) { - case 0x9Eu: d = 0xD0u; break; - case 0x9Fu: d = 0xF0u; break; - case 0xB0u: d = 0xDDu; break; - case 0xB1u: d = 0xFDu; break; - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x9Eu: d = 0xDEu; break; - case 0x9Fu: d = 0xFEu; break; - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c2) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_c2 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_CECF) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_ce = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xC0 && !seen_ce) { - utf_hi_char = d - 0xCE; - seen_ce = true; - return 0; - } - else if (seen_ce) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_ce = false; - return 1; - } - -#elif ENABLED(MAPPER_CECF) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_ce = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xC0 && !seen_ce) { - utf_hi_char = d - 0xCE; - seen_ce = true; - return 0; - } - else if (seen_ce) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_ce = false; - return 1; - } - -#elif ENABLED(MAPPER_D0D1_MOD) - - char charset_mapper(const char c) { - // it is a Russian alphabet translation - // except 0401 --> 0xA2 = Ё, 0451 --> 0xB5 = ё - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_d5 = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d >= 0xD0 && !seen_d5) { - utf_hi_char = d - 0xD0; - seen_d5 = true; - return 0; - } - else if (seen_d5) { - d &= 0x3F; - if (!utf_hi_char && d == 1) { - HARDWARE_CHAR_OUT(0xA2); // Ё - } - else if (utf_hi_char == 1 && d == 0x11) { - HARDWARE_CHAR_OUT(0xB5); // ё - } - else { - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10)); - } - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_d5 = false; - return 1; - } - -#elif ENABLED(MAPPER_D0D1) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_d5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d >= 0xD0u && !seen_d5) { - utf_hi_char = d - 0xD0u; - seen_d5 = true; - return 0; - } - else if (seen_d5) { - d &= 0x3Fu; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0xA0u + (utf_hi_char << 6) + d); - #endif - } - else { - HARDWARE_CHAR_OUT('?'); - } - } - else { - HARDWARE_CHAR_OUT(c); - } - seen_d5 = false; - return 1; - } - -#elif ENABLED(MAPPER_E382E383) - - char charset_mapper(const char c) { - static uint8_t utf_hi_char; // UTF-8 high part - static bool seen_e3 = false, - seen_82_83 = false; - uint8_t d = c; - if (d >= 0x80) { // UTF-8 handling - if (d == 0xE3 && !seen_e3) { - seen_e3 = true; - return 0; // eat 0xE3 - } - else if (d >= 0x82 && seen_e3 && !seen_82_83) { - utf_hi_char = d - 0x82; - seen_82_83 = true; - return 0; - } - else if (seen_e3 && seen_82_83) { - d &= 0x3F; - #ifndef MAPPER_ONE_TO_ONE - HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); - #else - HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d); - #endif - } - else - HARDWARE_CHAR_OUT('?'); - } - else - HARDWARE_CHAR_OUT(c); - - seen_e3 = false; - seen_82_83 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_PL) - - /** - * Ą C4 84 = 80 - * ą C4 85 = 81 - * Ć C4 86 = 82 - * ć C4 87 = 83 - * Ę C4 98 = 84 - * ę C4 99 = 85 - * Ł C5 81 = 86 - * ł C5 82 = 87 - * Ń C5 83 = 88 - * ń C5 84 = 89 - * Ó C3 93 = 8A - * ó C3 B3 = 8B - * Ś C5 9A = 8C - * ś C5 9B = 8D - * Ź C5 B9 = 8E - * ź C5 BA = 8F - * Ż C5 BB = 90 - * ż C5 BC = 91 - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x84u ... 0x87u: d -= 4; break; //Ą - ć - case 0x98u ... 0x99u: d -= 20; break; //Ę i ę - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x81u ... 0x84u: d += 5; break; //Ł - ń - case 0x9Au ... 0x9Bu: d -= 0x0Eu; break; //Ś i ś - case 0xB9u ... 0xBCu: d -= 0x2Bu; break; //Ź - ż - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x93u: d = 0x8Au; break; //Ó - case 0xB3u: d = 0x8Bu; break; //ó - d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_CZ) - - /** - * Á C3 81 = 80 - * É C3 89 = 81 - * Í C3 8D = 82 - * Ó C3 93 = 83 - * Ú C3 9A = 84 - * Ý C3 9D = 85 - * á C3 A1 = 86 - * é C3 A9 = 87 - * í C3 AD = 88 - * ó C3 B3 = 89 - * ú C3 BA = 8A - * ý C3 BD = 8B - * Č C4 8C = 8C - * č C4 8D = 8D - * Ď C4 8E = 8E - * ď C4 8F = 8F - * Ě C4 9A = 90 - * ě C4 9B = 91 - * Ň C5 87 = 92 - * ň C5 88 = 93 - * Ř C5 98 = 94 - * ř C5 99 = 95 - * Š C5 A0 = 96 - * š C5 A1 = 97 - * Ť C5 A4 = 98 - * ť C5 A5 = 99 - * Ů C5 AE = 9A - * ů C5 AF = 9B - * Ž C5 BD = 9C - * ž C5 BE = 9D - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x8Cu ... 0x8Fu: break; // ČčĎď Mapping 1:1 - case 0x9Au ... 0x9Bu: d -= 10; break; // Ěě - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x87u ... 0x88u: d += 0x0Bu; break; // Ňň - case 0x98u ... 0x99u: d -= 0x04u; break; // Řř - case 0xA0u ... 0xA1u: d -= 0x0Au; break; // Šš - case 0xA4u ... 0xA5u: d -= 0x0Cu; break; // Ťť - case 0xAEu ... 0xAFu: d -= 0x14u; break; // Ůů - case 0xBDu ... 0xBEu: d -= 0x21u; break; // Žž - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x81u: d = 0x80u; break; // Á - case 0x89u: d = 0x81u; break; // É - case 0x8Du: d = 0x82u; break; // Í - case 0x93u: d = 0x83u; break; // Ó - case 0x9Au: d = 0x84u; break; // Ú - case 0x9Du: d = 0x85u; break; // Ý - case 0xA1u: d = 0x86u; break; // á - case 0xA9u: d = 0x87u; break; // é - case 0xADu: d = 0x88u; break; // í - case 0xB3u: d = 0x89u; break; // ó - case 0xBAu: d = 0x8Au; break; // ú - case 0xBDu: d = 0x8Bu; break; // ý - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#elif ENABLED(MAPPER_C3C4C5_SK) - - /** - * Á C3 81 = 80 - * Ä C3 84 = 81 - * É C3 89 = 82 - * Í C3 8D = 83 - * Ó C3 93 = 84 - * Ô C3 94 = 85 - * Ú C3 9A = 86 - * Ý C3 9D = 87 - * á C3 A1 = 88 - * ä C3 A4 = 89 - * é C3 A9 = 8A - * í C3 AD = 8B - * ó C3 B3 = 8C - * ô C3 B4 = 8D - * ú C3 BA = 8E - * ý C3 BD = 8F - * Č C4 8C = 90 - * č C4 8D = 91 - * Ď C4 8E = 92 - * ď C4 8F = 93 - * Ĺ C4 B9 = 94 - * ĺ C4 BA = 95 - * Ľ C4 BD = 96 - * ľ C4 BE = 97 - * Ň C5 87 = 98 - * ň C5 88 = 99 - * Ŕ C5 94 = 9A - * ŕ C5 95 = 9B - * Š C5 A0 = 9C - * š C5 A1 = 9D - * Ť C5 A4 = 9E - * ť C5 A5 = 9F - * Ž C5 BD = A0 - * ž C5 BE = A1 - */ - - char charset_mapper(const char c) { - static bool seen_c3 = false, - seen_c4 = false, - seen_c5 = false; - uint8_t d = c; - if (d >= 0x80u) { // UTF-8 handling - if (d == 0xC4u) { seen_c4 = true; return 0; } - else if (d == 0xC5u) { seen_c5 = true; return 0; } - else if (d == 0xC3u) { seen_c3 = true; return 0; } - else if (seen_c4) { - switch(d) { - case 0x8Cu ... 0x8Fu: d += 0x04u; break; // ČčĎď - case 0xB9u ... 0xBAu: d -= 0x25u; break; // Ĺĺ - case 0xBDu ... 0xBEu: d -= 0x27u; break; // Ľľ - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c5) { - switch(d) { - case 0x87u ... 0x88u: d += 0x11u; break; // Ňň - case 0x94u ... 0x95u: d += 0x06u; break; // Ŕŕ - case 0xA0u ... 0xA1u: d -= 0x04u; break; // Šš - case 0xA4u ... 0xA5u: d -= 0x06u; break; // Ťť - case 0xBDu ... 0xBEu: d -= 0x1Du; break; // Žž - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - else if (seen_c3) { - switch(d) { - case 0x81u: d = 0x80u; break; // Á - case 0x84u: d = 0x81u; break; // Ä - case 0x89u: d = 0x82u; break; // É - case 0x8Du: d = 0x83u; break; // Í - case 0x93u: d = 0x84u; break; // Ó - case 0x94u: d = 0x85u; break; // Ô - case 0x9Au: d = 0x86u; break; // Ú - case 0x9Du: d = 0x87u; break; // Ý - case 0xA1u: d = 0x88u; break; // á - case 0xA4u: d = 0x89u; break; // ä - case 0xA9u: d = 0x8Au; break; // é - case 0xADu: d = 0x8Bu; break; // í - case 0xB3u: d = 0x8Cu; break; // ó - case 0xB4u: d = 0x8Du; break; // ô - case 0xBAu: d = 0x8Eu; break; // ú - case 0xBDu: d = 0x8Fu; break; // ý - default: d = '?'; - } - HARDWARE_CHAR_OUT(d); - } - - } - else - HARDWARE_CHAR_OUT(c); - - seen_c3 = seen_c4 = seen_c5 = false; - return 1; - } - -#else - - #define MAPPER_NON - - #undef PRINTABLE - #define PRINTABLE(C) true - - char charset_mapper(const char c) { - HARDWARE_CHAR_OUT(c); - return 1; - } - -#endif // code mappers - -#endif // UTF_MAPPER_H diff --git a/Marlin_thinkerV2/Marlin/utility.cpp b/Marlin_thinkerV2/Marlin/utility.cpp deleted file mode 100644 index 88a0503d5e..0000000000 --- a/Marlin_thinkerV2/Marlin/utility.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "Marlin.h" -#include "utility.h" -#include "temperature.h" - -void safe_delay(millis_t ms) { - while (ms > 50) { - ms -= 50; - delay(50); - thermalManager.manage_heater(); - } - delay(ms); - thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made -} - -#if ENABLED(EEPROM_SETTINGS) - - void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { - uint8_t *ptr = (uint8_t *)data; - while (cnt--) { - *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8)); - for (uint8_t i = 0; i < 8; i++) - *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (*crc << 1)); - } - } - -#endif // EEPROM_SETTINGS - -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) - - char conv[8] = { 0 }; - - #define DIGIT(n) ('0' + (n)) - #define DIGIMOD(n, f) DIGIT((n)/(f) % 10) - #define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ') - #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-')) - - // Convert unsigned int to string 123 format - char* i8tostr3(const uint8_t i) { - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[4]; - } - - // Convert signed int to rj string with 123 or -12 format - char* itostr3(int i) { - conv[4] = MINUSOR(i, RJDIGIT(i, 100)); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[4]; - } - - // Convert unsigned int to lj string with 123 format - char* itostr3left(const int i) { - char *str = &conv[6]; - *str = DIGIMOD(i, 1); - if (i >= 10) { - *(--str) = DIGIMOD(i, 10); - if (i >= 100) - *(--str) = DIGIMOD(i, 100); - } - return str; - } - - // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format - char* itostr4sign(const int i) { - const bool neg = i < 0; - const int ii = neg ? -i : i; - if (i >= 1000) { - conv[3] = DIGIMOD(ii, 1000); - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else if (ii >= 100) { - conv[3] = neg ? '-' : ' '; - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[3] = ' '; - conv[4] = ' '; - if (ii >= 10) { - conv[4] = neg ? '-' : ' '; - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[5] = neg ? '-' : ' '; - } - } - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; - } - - // Convert unsigned float to string with 1.23 format - char* ftostr12ns(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[3]; - } - - // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, DIGIMOD(i, 10000)); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - #if ENABLED(LCD_DECIMAL_SMALL_XY) - - // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format - char* ftostr4sign(const float &f) { - const int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - if (!WITHIN(i, -99, 999)) return itostr4sign((int)f); - const bool neg = i < 0; - const int ii = neg ? -i : i; - conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' '); - conv[4] = DIGIMOD(ii, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; - } - - #endif // LCD_DECIMAL_SMALL_XY - - // Convert float to fixed-length string with +123.4 / -123.4 format - char* ftostr41sign(const float &f) { - int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format - char* ftostr43sign(const float &f, char plus/*=' '*/) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; - conv[1] = i ? MINUSOR(i, plus) : ' '; - conv[2] = DIGIMOD(i, 1000); - conv[3] = '.'; - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; - } - - // Convert unsigned float to rj string with 12345 format - char* ftostr5rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[2]; - } - - // Convert signed float to string with +1234.5 format - char* ftostr51sign(const float &f) { - long i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert signed float to string with +123.45 format - char* ftostr52sign(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert unsigned float to string with 1234.56 format omitting trailing zeros - char* ftostr62rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[0] = RJDIGIT(i, 100000); - conv[1] = RJDIGIT(i, 10000); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return conv; - } - - // Convert signed float to space-padded string with -_23.4_ format - char* ftostr52sp(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - uint8_t dig; - conv[1] = MINUSOR(i, RJDIGIT(i, 10000)); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); - - if ((dig = i % 10)) { // second digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIT(dig); - } - else { - if ((dig = (i / 10) % 10)) { // first digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIT(dig); - } - else // nothing after decimal point - conv[4] = conv[5] = ' '; - conv[6] = ' '; - } - return &conv[1]; - } - -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) diff --git a/Marlin_thinkerV2/Marlin/utility.h b/Marlin_thinkerV2/Marlin/utility.h deleted file mode 100644 index 991d66289a..0000000000 --- a/Marlin_thinkerV2/Marlin/utility.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __UTILITY_H__ -#define __UTILITY_H__ - -#include "types.h" - -void safe_delay(millis_t ms); - -#if ENABLED(EEPROM_SETTINGS) - void crc16(uint16_t *crc, const void * const data, uint16_t cnt); -#endif - -#if ENABLED(ULTRA_LCD) || (ENABLED(DEBUG_LEVELING_FEATURE) && (ENABLED(MESH_BED_LEVELING) || (HAS_ABL && !ABL_PLANAR))) - - // Convert uint8_t to string with 123 format - char* i8tostr3(const uint8_t x); - - // Convert signed int to rj string with 123 or -12 format - char* itostr3(const int x); - - // Convert unsigned int to lj string with 123 format - char* itostr3left(const int xx); - - // Convert signed int to rj string with _123, -123, _-12, or __-1 format - char* itostr4sign(const int x); - - // Convert unsigned float to string with 1.23 format - char* ftostr12ns(const float &x); - - // Convert signed float to fixed-length string with 023.45 / -23.45 format - char* ftostr52(const float &x); - - // Convert float to fixed-length string with +123.4 / -123.4 format - char* ftostr41sign(const float &x); - - // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format - char* ftostr43sign(const float &x, char plus=' '); - - // Convert unsigned float to rj string with 12345 format - char* ftostr5rj(const float &x); - - // Convert signed float to string with +1234.5 format - char* ftostr51sign(const float &x); - - // Convert signed float to space-padded string with -_23.4_ format - char* ftostr52sp(const float &x); - - // Convert signed float to string with +123.45 format - char* ftostr52sign(const float &x); - - // Convert unsigned float to string with 1234.56 format omitting trailing zeros - char* ftostr62rj(const float &x); - - // Convert float to rj string with 123 or -12 format - FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(x + (x < 0 ? -0.5f : 0.5f))); } - - #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); - #else - // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format - FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(x + (x < 0 ? -0.5f : 0.5f))); } - #endif - -#endif // ULTRA_LCD || (DEBUG_LEVELING_FEATURE && (MESH_BED_LEVELING || (HAS_ABL && !ABL_PLANAR))) - -#endif // __UTILITY_H__ diff --git a/Marlin_thinkerV2/Marlin/vector_3.cpp b/Marlin_thinkerV2/Marlin/vector_3.cpp deleted file mode 100644 index e5afd9e831..0000000000 --- a/Marlin_thinkerV2/Marlin/vector_3.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - vector_3.cpp - Vector library for bed leveling - Copyright (c) 2012 Lars Brubaker. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "MarlinConfig.h" - -#if ABL_PLANAR || (HAS_BED_PROBE && ENABLED(AUTO_BED_LEVELING_UBL)) - -#include "vector_3.h" -#include "serial.h" -#include - -vector_3::vector_3() : x(0), y(0), z(0) { } - -vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { } - -vector_3 vector_3::cross(vector_3 left, vector_3 right) { - return vector_3(left.y * right.z - left.z * right.y, - left.z * right.x - left.x * right.z, - left.x * right.y - left.y * right.x); -} - -vector_3 vector_3::operator+(vector_3 v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } -vector_3 vector_3::operator-(vector_3 v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } - -vector_3 vector_3::get_normal() { - vector_3 normalized = vector_3(x, y, z); - normalized.normalize(); - return normalized; -} - -float vector_3::get_length() { return SQRT(sq(x) + sq(y) + sq(z)); } - -void vector_3::normalize() { - const float inv_length = RSQRT(sq(x) + sq(y) + sq(z)); - x *= inv_length; - y *= inv_length; - z *= inv_length; -} - -void vector_3::apply_rotation(matrix_3x3 matrix) { - const float resultX = x * matrix.matrix[3 * 0 + 0] + y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0], - resultY = x * matrix.matrix[3 * 0 + 1] + y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1], - resultZ = x * matrix.matrix[3 * 0 + 2] + y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2]; - x = resultX; - y = resultY; - z = resultZ; -} - -void vector_3::debug(const char * const title) { - serialprintPGM(title); - SERIAL_PROTOCOLPGM(" x: "); - SERIAL_PROTOCOL_F(x, 6); - SERIAL_PROTOCOLPGM(" y: "); - SERIAL_PROTOCOL_F(y, 6); - SERIAL_PROTOCOLPGM(" z: "); - SERIAL_PROTOCOL_F(z, 6); - SERIAL_EOL(); -} - -void apply_rotation_xyz(matrix_3x3 matrix, float &x, float &y, float &z) { - vector_3 vector = vector_3(x, y, z); - vector.apply_rotation(matrix); - x = vector.x; - y = vector.y; - z = vector.z; -} - -matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) { - //row_0.debug(PSTR("row_0")); - //row_1.debug(PSTR("row_1")); - //row_2.debug(PSTR("row_2")); - matrix_3x3 new_matrix; - new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z; - new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z; - new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z; - //new_matrix.debug(PSTR("new_matrix")); - return new_matrix; -} - -void matrix_3x3::set_to_identity() { - matrix[0] = 1; matrix[1] = 0; matrix[2] = 0; - matrix[3] = 0; matrix[4] = 1; matrix[5] = 0; - matrix[6] = 0; matrix[7] = 0; matrix[8] = 1; -} - -matrix_3x3 matrix_3x3::create_look_at(vector_3 target) { - vector_3 z_row = target.get_normal(); - vector_3 x_row = vector_3(1, 0, -target.x / target.z).get_normal(); - vector_3 y_row = vector_3::cross(z_row, x_row).get_normal(); - - // x_row.debug(PSTR("x_row")); - // y_row.debug(PSTR("y_row")); - // z_row.debug(PSTR("z_row")); - - // create the matrix already correctly transposed - matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); - - // rot.debug(PSTR("rot")); - return rot; -} - -matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { - matrix_3x3 new_matrix; - new_matrix.matrix[0] = original.matrix[0]; new_matrix.matrix[1] = original.matrix[3]; new_matrix.matrix[2] = original.matrix[6]; - new_matrix.matrix[3] = original.matrix[1]; new_matrix.matrix[4] = original.matrix[4]; new_matrix.matrix[5] = original.matrix[7]; - new_matrix.matrix[6] = original.matrix[2]; new_matrix.matrix[7] = original.matrix[5]; new_matrix.matrix[8] = original.matrix[8]; - return new_matrix; -} - -void matrix_3x3::debug(const char * const title) { - if (title != NULL) { - serialprintPGM(title); - SERIAL_EOL(); - } - uint8_t count = 0; - for (uint8_t i = 0; i < 3; i++) { - for (uint8_t j = 0; j < 3; j++) { - if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(matrix[count], 6); - SERIAL_PROTOCOLCHAR(' '); - count++; - } - SERIAL_EOL(); - } -} - -#endif // HAS_ABL diff --git a/Marlin_thinkerV2/Marlin/vector_3.h b/Marlin_thinkerV2/Marlin/vector_3.h deleted file mode 100644 index a92660018f..0000000000 --- a/Marlin_thinkerV2/Marlin/vector_3.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - vector_3.cpp - Vector library for bed leveling - Copyright (c) 2012 Lars Brubaker. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef VECTOR_3_H -#define VECTOR_3_H - -class matrix_3x3; - -struct vector_3 { - float x, y, z; - - vector_3(); - vector_3(float x, float y, float z); - - static vector_3 cross(vector_3 a, vector_3 b); - - vector_3 operator+(vector_3 v); - vector_3 operator-(vector_3 v); - void normalize(); - float get_length(); - vector_3 get_normal(); - - void debug(const char * const title); - - void apply_rotation(matrix_3x3 matrix); -}; - -struct matrix_3x3 { - float matrix[9]; - - static matrix_3x3 create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2); - static matrix_3x3 create_look_at(vector_3 target); - static matrix_3x3 transpose(matrix_3x3 original); - - void set_to_identity(); - - void debug(const char * const title); -}; - - -void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z); - -#endif // VECTOR_3_H diff --git a/Marlin_thinkerV2/Marlin/watchdog.cpp b/Marlin_thinkerV2/Marlin/watchdog.cpp deleted file mode 100644 index 135a050fff..0000000000 --- a/Marlin_thinkerV2/Marlin/watchdog.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "Marlin.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s. -void watchdog_init() { - #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S) - #define WDTO_NS WDTO_8S - #else - #define WDTO_NS WDTO_4S - #endif - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - // Take care, as this requires the correct order of operation, with interrupts disabled. - // See the datasheet of any AVR chip for details. - wdt_reset(); - cli(); - _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); - _WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5 - // So worked for up to WDTO_2S - sei(); - wdt_reset(); - #else - wdt_enable(WDTO_NS); // The function handles the upper bit correct. - #endif - //delay(10000); // test it! -} - -//=========================================================================== -//=================================== ISR =================================== -//=========================================================================== - -// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled. -#if ENABLED(WATCHDOG_RESET_MANUAL) - ISR(WDT_vect) { - sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Watchdog barked, please turn off the printer."); - kill(PSTR("ERR:Watchdog")); //kill blocks //up to 16 characters so it fits on a 16x2 display - while (1); //wait for user or serial reset - } -#endif // WATCHDOG_RESET_MANUAL - -#endif // USE_WATCHDOG diff --git a/Marlin_thinkerV2/Marlin/watchdog.h b/Marlin_thinkerV2/Marlin/watchdog.h deleted file mode 100644 index 2c04b58972..0000000000 --- a/Marlin_thinkerV2/Marlin/watchdog.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef WATCHDOG_H -#define WATCHDOG_H - -#include "Marlin.h" -#include - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void watchdog_reset() { wdt_reset(); } - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration.h b/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration.h deleted file mode 100644 index 1287629913..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration.h +++ /dev/null @@ -1,2238 +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 - -/** - * 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. -// - -// @section info - -// 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) - -/** - * *** 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 0 - -/** - * 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 -1 - -/** - * 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_RAMBO -#endif - -// Name displayed in the LCD "Ready" message and Info menu -#define CUSTOM_MACHINE_NAME "Thinker 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 -//#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, 'true' for X-Box - - //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 - //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power - - //#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: - * - * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) - * -3 : thermocouple with MAX31855 (only for sensors 0-1) - * -2 : thermocouple with MAX6675 (only for sensors 0-1) - * -4 : thermocouple with AD8495 - * -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 - * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) - * - * 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. - */ -#define TEMP_SENSOR_0 13 -#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 13 -#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 - - // Ultimaker Kp: 29.88 Ki: 2.72 Kd: 81.99 - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 - - // 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 100.00 - #define DEFAULT_bedKi 5.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 - - // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. -#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 400//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//false // set to true to invert the logic of the endstop. -#define Y_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. -#define Z_MIN_ENDSTOP_INVERTING true//false // 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. -#define Z_MIN_PROBE_ENDSTOP_INVERTING true//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...]] - */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } //{ 80, 80, 400, 93 } - -/** - * Default Max Feed Rate (mm/s) - * Override with M203 - * X, Y, Z, E0 [, E1[, E2...]] - */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } - -//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 -#if ENABLED(LIMITED_MAX_FR_EDITING) - #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits -#endif - -/** - * Default Max Acceleration (change/s) change = mm/s - * (Maximum start speed for accelerated moves) - * Override with M201 - * X, Y, Z, E0 [, E1[, E2...]] - */ -#define DEFAULT_MAX_ACCELERATION { 1500, 1500, 50, 1500 } - -//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 -#if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits -#endif - -/** - * Default Acceleration (change/s) change = mm/s - * Override with M204 - * - * M204 P Acceleration - * M204 R Retract Acceleration - * M204 T Travel Acceleration - */ -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves - -/** - * Default Jerk limits (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. - */ -#define CLASSIC_JERK -#if ENABLED(CLASSIC_JERK) - #define DEFAULT_XJERK 10.0 - #define DEFAULT_YJERK 10.0 - #define DEFAULT_ZJERK 0.3 - - //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 - #if ENABLED(LIMITED_JERK_EDITING) - #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits - #endif -#endif - -#define DEFAULT_EJERK 5.0 // May be used by Linear Advance - -/** - * Junction Deviation Factor - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#if DISABLED(CLASSIC_JERK) - #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge -#endif - -/** - * 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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) - //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed - -#else -// power lose detect pin and super capacitor for save data - //#define POWER_LOSS_RECOVER_SUPER_CAP 1 - -#endif - - -/** - * 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) - #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 { 10, 10, 0 } - -// 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 - -#if POWER_LOSS_RECOVER_SUPER_CAP -#define Z_CLEARANCE_BETWEEN_PROBES 0 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 0 // Z Clearance between multiple probes -#else -#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -#endif -//#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 false - -// @section extruder - -// For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR true -#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 4 // (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 - -// The size of the print bed -#define X_BED_SIZE 300 -#define Y_BED_SIZE 300 - -// 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 400 - -/** - * 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 false // 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 -#if ENABLED(BLTOUCH)||ENABLED(FIX_MOUNTED_PROBE) -#define AUTO_BED_LEVELING_BILINEAR -#else -// power lose detect pin and super capacitor for save data -// #define POWER_LOSS_RECOVER_SUPER_CAP 1 - -#endif -//#define AUTO_BED_LEVELING_UBL -#define MESH_BED_LEVELING - -//#define POWER_LOSS_RECOVER_SUPER_CAP 1 - - -/** - * 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 5 - #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 5//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.0 // (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). -#endif - -// Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z (4*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 205//180 -#define PREHEAT_1_TEMP_BED 65//70 -#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 - -#define PREHEAT_2_LABEL "ABS" -#define PREHEAT_2_TEMP_HOTEND 240 -#define PREHEAT_2_TEMP_BED 95//110 -#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 - -/** - * 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 2 -//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 - -//============================================================================= -//======================== 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 - -// -// Touch UI for FTDI EVE (FT800/FT810) displays -// See Configuration_adv.h for all configuration options. -// -//#define TOUCH_UI_FTDI_EVE - -// -// 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 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 - #define XPT2046_Y_OFFSET 257 -#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 -#if ENABLED(BLTOUCH) - -#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. -// 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 } -#endif -// 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/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration_adv.h deleted file mode 100644 index bb9f33afe3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/Configuration_adv.h +++ /dev/null @@ -1,2867 +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 - -/** - * 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 40 // Seconds - #define THERMAL_PROTECTION_HYSTERESIS 4 // 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 20 // Seconds - #define WATCH_TEMP_INCREASE 2 // Degrees Celsius -#endif - -/** - * Thermal Protection parameters for the bed are just as above for hotends. - */ -#if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds - #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius - - /** - * 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 - - /** - * Add an experimental additional term to the heater power, proportional to the fan speed. - * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. - * You can either just add a constant compensation with the DEFAULT_Kf value - * or follow the instruction below to get speed-dependent compensation. - * - * Constant compensation (use only with fanspeeds of 0% and 100%) - * --------------------------------------------------------------------- - * A good starting point for the Kf-value comes from the calculation: - * kf = (power_fan * eff_fan) / power_heater * 255 - * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. - * - * Example: - * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 - * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 - * - * Fan-speed dependent compensation - * -------------------------------- - * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). - * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. - * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature - * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. - * 2. Note the Kf-value for fan-speed at 100% - * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. - * 4. Repeat step 1. and 2. for this fan speed. - * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in - * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED - */ - //#define PID_FAN_SCALING - #if ENABLED(PID_FAN_SCALING) - //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION - #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) - // The alternative definition is used for an easier configuration. - // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. - // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. - - #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf - #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf - #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING - - #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) - #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 - - #else - #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) - #define DEFAULT_Kf 10 // A constant value added to the PID-tuner - #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING - #endif - #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 - -// Some coolers may require a non-zero "off" state. -//#define FAN_OFF_PWM 1 - -/** - * 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 6 -#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_MAX_PWM 128 // Limit pwm - //#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 { 2, 2, 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: - */ - - // 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_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } - - // Provide Z stepper positions for more rapid convergence in bed alignment. - // Currently requires triple stepper drivers. - //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Define Stepper XY positions for Z1, Z2, Z3 corresponding to - // the Z screw positions in the bed carriage. - // Define one position per Z stepper in stepper driver order. - #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } - #else - // Amplification factor. Used to scale the correction step up or down. - // 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 - #endif - - // 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 - - // 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 - -// Show the E position (filament used) during printing -//#define LCD_SHOW_E_TOTAL - -#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS - //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits - //#define SHOW_REMAINING_TIME // Display estimated time to completion - #if ENABLED(SHOW_REMAINING_TIME) - //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation - //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time - #endif -#endif - -#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 "G28XY" // 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss - //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) - //#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 - #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 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_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_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 - -// -// Touch UI for the FTDI Embedded Video Engine (EVE) -// -#if ENABLED(TOUCH_UI_FTDI_EVE) - // 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 - - // Developer menu (accessed by touching "About Printer" copyright text) - //#define TOUCH_UI_DEVELOPER_MENU -#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 - -/** - * 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_Z 1 // Babysteps are very small. Increase for faster motion. - //#define BABYSTEP_MULTIPLICATOR_XY 1 - - #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 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller -#else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer -#endif - -// @section serial - -// The ASCII buffer for serial input -#define MAX_CMD_SIZE 96 -#define BUFSIZE 4 - -// 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 50 // (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_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 - #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... - #endif - - #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_CURRENT_HOME X2_CURRENT - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 - #define X2_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_CURRENT_HOME Y_CURRENT - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 - #define Y_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_CURRENT_HOME Y2_CURRENT - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 - #define Y2_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_CURRENT_HOME Z_CURRENT - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 - #define Z_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_CURRENT_HOME Z2_CURRENT - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 - #define Z2_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_CURRENT_HOME Z3_CURRENT - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 - #define Z3_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 - #define E0_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 - #define E1_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 - #define E2_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 - #define E3_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 - #define E4_CHAIN_POS -1 - #endif - - #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 - #define E5_CHAIN_POS -1 - #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. - * - * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING - */ - //#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 HOME_USING_SPREADCYCLE - //#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_otpw(1); \ - * stepperY.intpol(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 -1 // 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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 -1 - #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 - -/** - * Cancel Objects - * - * Implement M486 to allow Marlin to skip objects - */ -//#define CANCEL_OBJECTS - -/** - * 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/Marlin_thinkerV2/Marlin2.0/Marlin/Makefile b/Marlin_thinkerV2/Marlin2.0/Marlin/Makefile deleted file mode 100644 index b0ada2616b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/Makefile +++ /dev/null @@ -1,884 +0,0 @@ -# Marlin Firmware Arduino Project Makefile -# -# Makefile Based on: -# Arduino 0011 Makefile -# Arduino adaptation by mellis, eighthave, oli.keller -# Marlin adaption by Daid -# Marlin 2.0 support and RELOC_WORKAROUND by @marcio-ao -# -# This has been tested with Arduino 0022. -# -# This makefile allows you to build sketches from the command line -# without the Arduino environment (or Java). -# -# Detailed instructions for using the makefile: -# -# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that -# contains the Arduino installation (for example, under Mac OS X, this -# might be /Applications/Arduino.app/Contents/Resources/Java). -# -# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename -# representing the USB or serial connection to your Arduino board -# (e.g. UPLOAD_PORT = /dev/tty.USB0). If the exact name of this file -# changes, you can use * as a wild card (e.g. UPLOAD_PORT = /dev/tty.usb*). -# -# 3. Set the line containing "MCU" to match your board's processor. -# Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth -# or Diecimila have the atmega168. If you're using a LilyPad Arduino, -# change F_CPU to 8000000. If you are using Gen7 electronics, you -# probably need to use 20000000. Either way, you must regenerate -# the speed lookup table with create_speed_lookuptable.py. -# -# 4. Type "make" and press enter to compile/verify your program. -# -# 5. Type "make upload", reset your Arduino board, and press enter to -# upload your program to the Arduino board. -# -# Note that all settings at the top of this file can be overriden from -# the command line with, for example, "make HARDWARE_MOTHERBOARD=71" -# -# To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino -# -# To compile and upload simply add "upload" to the end of the line... -# -# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \ -# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino upload -# -# If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or -# start upload manually (using stk500) like so: -# -# avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \ -# -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0 -# -# Or, try disconnecting USB to power down and then reconnecting before running avrdude. -# - -# This defines the board to compile for (see boards.h for your board's ID) -HARDWARE_MOTHERBOARD ?= 11 - -# Arduino source install directory, and version number -# On most linuxes this will be /usr/share/arduino -ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino -ARDUINO_VERSION ?= 106 - -# The installed Libraries are in the User folder -ARDUINO_USER_DIR ?= ${HOME}/Arduino - -# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin) -AVR_TOOLS_PATH ?= - -#Programmer configuration -UPLOAD_RATE ?= 57600 -AVRDUDE_PROGRAMMER ?= arduino -# on most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1 -UPLOAD_PORT ?= /dev/ttyUSB0 - -#Directory used to build files in, contains all the build files, from object files to the final hex file -#on linux it is best to put an absolute path like /home/username/tmp . -BUILD_DIR ?= applet - -# This defines whether Liquid_TWI2 support will be built -LIQUID_TWI2 ?= 0 - -# this defines if Wire is needed -WIRE ?= 0 - -# this defines if U8GLIB is needed (may require RELOC_WORKAROUND) -U8GLIB ?= 1 - -# this defines whether to include the Trinamic TMCStepper library -TMC ?= 1 - -# this defines whether to include the AdaFruit NeoPixel library -NEOPIXEL ?= 0 - -############ -# Try to automatically determine whether RELOC_WORKAROUND is needed based -# on GCC versions: -# http://www.avrfreaks.net/comment/1789106#comment-1789106 - -CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ ) -CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ ) -CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | cut -f3 -d\ ) -CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) ))) -ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1) - @echo This version of GCC is likely broken. Enabling relocation workaround. - RELOC_WORKAROUND = 1 -endif - -############################################################################ -# Below here nothing should be changed... - -# Here the Arduino variant is selected by the board type -# HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ... -# MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ... - -ifeq ($(HARDWARE_MOTHERBOARD),0) - - # No motherboard selected - -# -# RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -# - -# MEGA/RAMPS up to 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1000) - -# RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1010) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1011) -# RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),1012) -# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1013) -# RAMPS 1.3 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1014) - -# RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1020) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1021) -# RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),1022) -# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1023) -# RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1024) - -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1030) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -else ifeq ($(HARDWARE_MOTHERBOARD),1031) -# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -else ifeq ($(HARDWARE_MOTHERBOARD),1032) -# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1033) -# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) -else ifeq ($(HARDWARE_MOTHERBOARD),1034) - -# -# RAMPS Derivatives - ATmega1280, ATmega2560 -# - -# 3Drag Controller -else ifeq ($(HARDWARE_MOTHERBOARD),1100) -# Velleman K8200 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),1101) -# Velleman K8400 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),1102) -# 2PrintBeta BAM&DICE with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1103) -# 2PrintBeta BAM&DICE Due with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1104) -# MKS BASE v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1105) -# MKS v1.4 with A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1106) -# MKS v1.5 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1107) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1108) -# MKS GEN v1.3 or 1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),1109) -# MKS GEN L -else ifeq ($(HARDWARE_MOTHERBOARD),1110) -# zrib V2.0 control board (Chinese knock off RAMPS replica) -else ifeq ($(HARDWARE_MOTHERBOARD),1111) -# Bigtreetech or BIQU KFB2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1112) -# Felix 2.0+ Electronics Board (RAMPS like) -else ifeq ($(HARDWARE_MOTHERBOARD),1113) -# Invent-A-Part RigidBoard -else ifeq ($(HARDWARE_MOTHERBOARD),1114) -# Invent-A-Part RigidBoard V2 -else ifeq ($(HARDWARE_MOTHERBOARD),1115) -# Sainsmart 2-in-1 board -else ifeq ($(HARDWARE_MOTHERBOARD),1116) -# Ultimaker -else ifeq ($(HARDWARE_MOTHERBOARD),1117) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) -else ifeq ($(HARDWARE_MOTHERBOARD),1118) - MCU ?= atmega1280 - -# Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),1119) -# Azteeg X3 Pro -else ifeq ($(HARDWARE_MOTHERBOARD),1120) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) -else ifeq ($(HARDWARE_MOTHERBOARD),1121) -# Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1122) -# Raise3D Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1123) -# Rapide Lite RL200 Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1124) -# Formbot T-Rex 2 Plus -else ifeq ($(HARDWARE_MOTHERBOARD),1125) -# Formbot T-Rex 3 -else ifeq ($(HARDWARE_MOTHERBOARD),1126) -# Formbot Raptor -else ifeq ($(HARDWARE_MOTHERBOARD),1127) -# Formbot Raptor 2 -else ifeq ($(HARDWARE_MOTHERBOARD),1128) -# bq ZUM Mega 3D -else ifeq ($(HARDWARE_MOTHERBOARD),1129) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake -else ifeq ($(HARDWARE_MOTHERBOARD),1130) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),1131) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),1132) -# TriGorilla Anycubic version 1.4 Rev 1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1133) -# Creality: Ender-4, CR-8 -else ifeq ($(HARDWARE_MOTHERBOARD),1134) -# Creality: CR10S, CR20, CR-X -else ifeq ($(HARDWARE_MOTHERBOARD),1135) -# Dagoma F5 -else ifeq ($(HARDWARE_MOTHERBOARD),1136) -# FYSETC F6 -else ifeq ($(HARDWARE_MOTHERBOARD),1137) -# Duplicator i3 Plus -else ifeq ($(HARDWARE_MOTHERBOARD),1138) -# VORON -else ifeq ($(HARDWARE_MOTHERBOARD),1139) -# TRONXY V3 1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1140) -# Z-Bolt X Series -else ifeq ($(HARDWARE_MOTHERBOARD),1141) -# TT OSCAR -else ifeq ($(HARDWARE_MOTHERBOARD),1142) -# Overlord/Overlord Pro -else ifeq ($(HARDWARE_MOTHERBOARD),1143) -# ADIMLab Gantry v1 -else ifeq ($(HARDWARE_MOTHERBOARD),1144) -# ADIMLab Gantry v2 -else ifeq ($(HARDWARE_MOTHERBOARD),1145) -# BIQU Tango V1 -else ifeq ($(HARDWARE_MOTHERBOARD),1146) -# MKS GEN L V2 -else ifeq ($(HARDWARE_MOTHERBOARD),1147) - -# -# RAMBo and derivatives -# - -# Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1200) -# Mini-Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1201) -# Mini-Rambo 1.0a -else ifeq ($(HARDWARE_MOTHERBOARD),1202) -# Einsy Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1203) -# Einsy Retro -else ifeq ($(HARDWARE_MOTHERBOARD),1204) -# abee Scoovo X9H -else ifeq ($(HARDWARE_MOTHERBOARD),1205) - -# -# Other ATmega1280, ATmega2560 -# - -# Cartesio CN Controls V11 -else ifeq ($(HARDWARE_MOTHERBOARD),1300) -# Cartesio CN Controls V12 -else ifeq ($(HARDWARE_MOTHERBOARD),1301) -# Cartesio CN Controls V15 -else ifeq ($(HARDWARE_MOTHERBOARD),1302) -# Cheaptronic v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1303) -# Cheaptronic v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1304) -# Makerbot Mightyboard Revision E -else ifeq ($(HARDWARE_MOTHERBOARD),1305) -# Megatronics -else ifeq ($(HARDWARE_MOTHERBOARD),1306) -# Megatronics v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1307) -# Megatronics v3.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1308) -# Megatronics v3.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1309) -# Megatronics v3.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1310) -# Elefu Ra Board (v3) -else ifeq ($(HARDWARE_MOTHERBOARD),1311) -# Leapfrog -else ifeq ($(HARDWARE_MOTHERBOARD),1312) -# Mega controller -else ifeq ($(HARDWARE_MOTHERBOARD),1313) -# Geeetech GT2560 Rev B for Mecreator2 -else ifeq ($(HARDWARE_MOTHERBOARD),1314) -# Geeetech GT2560 Rev. A -else ifeq ($(HARDWARE_MOTHERBOARD),1315) -# Geeetech GT2560 Rev. A+ (with auto level probe) -else ifeq ($(HARDWARE_MOTHERBOARD),1316) -# Geeetech GT2560 Rev B for A10(M/D) -else ifeq ($(HARDWARE_MOTHERBOARD),1317) -# Geeetech GT2560 Rev B for A20(M/D) -else ifeq ($(HARDWARE_MOTHERBOARD),1318) -# Einstart retrofit -else ifeq ($(HARDWARE_MOTHERBOARD),1319) -# Wanhao 0ne+ i3 Mini -else ifeq ($(HARDWARE_MOTHERBOARD),1320) - -# -# ATmega1281, ATmega2561 -# - -# Minitronics v1.0/1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1400) - MCU ?= atmega1281 -# Silvergate v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1401) - MCU ?= atmega1281 - -# -# Sanguinololu and Derivatives - ATmega644P, ATmega1284P -# - -# Sanguinololu < 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1500) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Sanguinololu 1.2 and above -else ifeq ($(HARDWARE_MOTHERBOARD),1501) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Melzi -else ifeq ($(HARDWARE_MOTHERBOARD),1502) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Melzi with ATmega1284 (MaKr3d version) -else ifeq ($(HARDWARE_MOTHERBOARD),1503) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# Melzi Creality3D board (for CR-10 etc) -else ifeq ($(HARDWARE_MOTHERBOARD),1504) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# Melzi Malyan M150 board -else ifeq ($(HARDWARE_MOTHERBOARD),1505) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# Tronxy X5S -else ifeq ($(HARDWARE_MOTHERBOARD),1506) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# STB V1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1507) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# Azteeg X1 -else ifeq ($(HARDWARE_MOTHERBOARD),1508) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p -# Anet 1.0 (Melzi clone) -else ifeq ($(HARDWARE_MOTHERBOARD),1509) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega1284p - -# -# Other ATmega644P, ATmega644, ATmega1284P -# - -# Gen3 Monolithic Electronics -else ifeq ($(HARDWARE_MOTHERBOARD),1600) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Gen3+ -else ifeq ($(HARDWARE_MOTHERBOARD),1601) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Gen6 -else ifeq ($(HARDWARE_MOTHERBOARD),1602) - HARDWARE_VARIANT ?= Gen6 - MCU ?= atmega644p -# Gen6 deluxe -else ifeq ($(HARDWARE_MOTHERBOARD),1603) - HARDWARE_VARIANT ?= Gen6 - MCU ?= atmega644p -# Gen7 custom (Alfons3 Version) -else ifeq ($(HARDWARE_MOTHERBOARD),1604) - HARDWARE_VARIANT ?= Gen7 - MCU ?= atmega644 - F_CPU ?= 20000000 -# Gen7 v1.1, v1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1605) - HARDWARE_VARIANT ?= Gen7 - MCU ?= atmega644p - F_CPU ?= 20000000 -# Gen7 v1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),1606) - HARDWARE_VARIANT ?= Gen7 - MCU ?= atmega644p - F_CPU ?= 20000000 -# Gen7 v1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),1607) - HARDWARE_VARIANT ?= Gen7 - MCU ?= atmega1284p - F_CPU ?= 20000000 -# Alpha OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),1608) - HARDWARE_VARIANT ?= SanguinoA - MCU ?= atmega644 -# Final OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),1609) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p -# Sethi 3D_1 -else ifeq ($(HARDWARE_MOTHERBOARD),1610) - HARDWARE_VARIANT ?= Sanguino - MCU ?= atmega644p - -# -# Teensyduino - AT90USB1286, AT90USB1286P -# - -# Teensylu -else ifeq ($(HARDWARE_MOTHERBOARD),1700) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# Printrboard (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1701) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# Printrboard Revision F (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1702) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# Brainwave (AT90USB646) -else ifeq ($(HARDWARE_MOTHERBOARD),1703) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb646 -# Brainwave Pro (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1704) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# SAV Mk-I (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1705) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# Teensy++2.0 (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1706) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 -# 5DPrint D8 Driver Board -else ifeq ($(HARDWARE_MOTHERBOARD),1707) - HARDWARE_VARIANT ?= Teensy - MCU ?= at90usb1286 - -# UltiMachine Archim1 (with DRV8825 drivers) -else ifeq ($(HARDWARE_MOTHERBOARD),3023) - HARDWARE_VARIANT ?= archim - MCPU = cortex-m3 - F_CPU = 84000000L - IS_MCU = 0 -# UltiMachine Archim2 (with TMC2130 drivers) -else ifeq ($(HARDWARE_MOTHERBOARD),3024) - HARDWARE_VARIANT ?= archim - MCPU = cortex-m3 - F_CPU = 84000000L - IS_MCU = 0 -endif - -# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py -# if you are setting this to something other than 16MHz -# Set to 16Mhz if not yet set. -F_CPU ?= 16000000 - -# Set to microcontroller if IS_MCU not yet set -IS_MCU ?= 1 - -ifeq ($(IS_MCU),1) - # Set to arduino, ATmega2560 if not yet set. - HARDWARE_VARIANT ?= arduino - MCU ?= atmega2560 - - TOOL_PREFIX = avr - MCU_FLAGS = -mmcu=$(MCU) - SIZE_FLAGS = --mcu=$(MCU) -C -else - TOOL_PREFIX = arm-none-eabi - CPU_FLAGS = -mthumb -mcpu=$(MCPU) - SIZE_FLAGS = -A -endif - -# Arduino contained the main source code for the Arduino -# Libraries, the "hardware variant" are for boards -# that derives from that, and their source are present in -# the main Marlin source directory - -TARGET = $(notdir $(CURDIR)) - -# VPATH tells make to look into these directory for source files, -# there is no need to specify explicit pathnames as long as the -# directory is added here - -# The Makefile for previous versions of Marlin used VPATH for all -# source files, but for Marlin 2.0, we use VPATH only for arduino -# library files. - -VPATH = . -VPATH += $(BUILD_DIR) -VPATH += $(HARDWARE_SRC) - -ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino)) -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/LiquidCrystal/src -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/SPI -endif - -ifeq ($(IS_MCU),1) - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino - - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src -endif - -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src -ifeq ($(LIQUID_TWI2), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2 -endif -ifeq ($(WIRE), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility -endif -ifeq ($(NEOPIXEL), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel -endif -ifeq ($(U8GLIB), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc -endif -ifeq ($(TMC), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source -endif - -ifeq ($(HARDWARE_VARIANT), arduino) - HARDWARE_SUB_VARIANT ?= mega - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT) -else ifeq ($(HARDWARE_VARIANT), Sanguino) - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino -else ifeq ($(HARDWARE_VARIANT), archim) - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/ - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/ - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/avr - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/USB - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/Wire/src - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/SPI/src - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib - VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim - LDSCRIPT = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/linker_scripts/gcc/flash.ld - LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a -else - HARDWARE_SUB_VARIANT ?= standard - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT) -endif - -LIB_SRC = wiring.c \ - wiring_analog.c wiring_digital.c \ - wiring_shift.c WInterrupts.c hooks.c - -ifeq ($(HARDWARE_VARIANT), archim) - LIB_ASRC += wiring_pulse_asm.S -else - LIB_SRC += wiring_pulse.c -endif - -ifeq ($(HARDWARE_VARIANT), Teensy) - LIB_SRC = wiring.c - VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy -endif - -LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp - -ifeq ($(NEOPIXEL), 1) - LIB_CXXSRC += Adafruit_NeoPixel.cpp -endif - -ifeq ($(LIQUID_TWI2), 0) - LIB_CXXSRC += LiquidCrystal.cpp -else - LIB_SRC += twi.c - LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp -endif - -ifeq ($(WIRE), 1) - LIB_SRC += twi.c - LIB_CXXSRC += Wire.cpp -endif - -ifeq ($(U8GLIB), 1) - LIB_CXXSRC += U8glib.cpp - LIB_SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_6x13.c u8g_font_04b_03.c u8g_font_5x8.c -endif - -ifeq ($(TMC), 1) - LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp TMC2209Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp -endif - -ifeq ($(RELOC_WORKAROUND), 1) - LD_PREFIX=-nodefaultlibs - LD_SUFFIX=-lm -lgcc -lc -lgcc -endif - -#Check for Arduino 1.0.0 or higher and use the correct source files for that version -ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true) - LIB_CXXSRC += main.cpp -else - LIB_SRC += pins_arduino.c main.c -endif - -FORMAT = ihex - -# Name of this Makefile (used for "make depend"). -MAKEFILE = Makefile - -# Debugging format. -# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. -# AVR (extended) COFF requires stabs, plus an avr-objcopy run. -DEBUG = stabs - -OPT = s - -DEFINES ?= - -# Program settings -CC = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-gcc -CXX = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-g++ -OBJCOPY = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objcopy -OBJDUMP = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objdump -AR = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-ar -SIZE = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-size -NM = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-nm -AVRDUDE = avrdude -REMOVE = rm -f -MV = mv -f - -# Place -D or -U options here -CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION) -CXXDEFS = $(CDEFS) - -ifeq ($(HARDWARE_VARIANT), Teensy) - CDEFS += -DUSB_SERIAL - LIB_SRC += usb.c pins_teensy.c - LIB_CXXSRC += usb_api.cpp - -else ifeq ($(HARDWARE_VARIANT), archim) - CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"' - LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp - LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c - - ifeq ($(U8GLIB), 1) - LIB_SRC += u8g_com_api.c u8g_pb32h1.c - endif -endif - -# Add all the source directories as include directories too -CINCS = ${addprefix -I ,${VPATH}} -CXXINCS = ${addprefix -I ,${VPATH}} - -# Silence warnings for library code (won't work for .h files, unfortunately) -LIBWARN = -w -Wno-packed-bitfield-compat - -# Compiler flag to set the C/CPP Standard level. -CSTANDARD = -std=gnu99 -CXXSTANDARD = -std=gnu++11 -CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter -CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter -CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \ - -fshort-enums -ffunction-sections -fdata-sections -ifneq ($(HARDWARE_MOTHERBOARD),) - CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} -endif -#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CXXEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti -CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CEXTRA) $(CTUNING) $(CSTANDARD) -CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) $(CXXEXTRA) $(CTUNING) $(CXXSTANDARD) -ASFLAGS := $(CDEFS) -#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs -ifeq ($(HARDWARE_VARIANT), archim) - LD_PREFIX = -Wl,--gc-sections,-Map,Marlin.ino.map,--cref,--check-sections,--entry=Reset_Handler,--unresolved-symbols=report-all,--warn-common,--warn-section-align - LD_SUFFIX = $(LDLIBS) - LDFLAGS = -lm -T$(LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid -else - LD_PREFIX = -Wl,--gc-sections,--relax - LDFLAGS = -lm - CTUNING += -flto -endif - -# Programming support using avrdude. Settings and variables. -AVRDUDE_PORT = $(UPLOAD_PORT) -AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i -ifeq ($(shell uname -s), Linux) - AVRDUDE_CONF = /etc/avrdude/avrdude.conf -else - AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf -endif -AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \ - -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \ - -b$(UPLOAD_RATE) - -# Since Marlin 2.0, the source files may be distributed into several -# different directories, so it is necessary to find them recursively - -SRC = $(shell find src -name '*.c' -type f) -CXXSRC = $(shell find src -name '*.cpp' -type f) - -# Define all object files. -OBJ = ${patsubst %.c, $(BUILD_DIR)/arduino/%.o, ${LIB_SRC}} -OBJ += ${patsubst %.cpp, $(BUILD_DIR)/arduino/%.o, ${LIB_CXXSRC}} -OBJ += ${patsubst %.S, $(BUILD_DIR)/arduino/%.o, ${LIB_ASRC}} -OBJ += ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}} -OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}} - -# Define all listing files. -LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst) - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CFLAGS) -I. -ALL_CXXFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CXXFLAGS) -ALL_ASFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(ASFLAGS) -x assembler-with-cpp - -# set V=1 (eg, "make V=1") to print the full commands etc. -ifneq ($V,1) - Pecho=@echo - P=@ -else - Pecho=@: - P= -endif - -# Create required build hierarchy if it does not exist - -$(shell mkdir -p $(dir $(OBJ))) - -# Default target. -all: sizeafter - -build: elf hex bin - -elf: $(BUILD_DIR)/$(TARGET).elf -bin: $(BUILD_DIR)/$(TARGET).bin -hex: $(BUILD_DIR)/$(TARGET).hex -eep: $(BUILD_DIR)/$(TARGET).eep -lss: $(BUILD_DIR)/$(TARGET).lss -sym: $(BUILD_DIR)/$(TARGET).sym - -# Program the device. -# Do not try to reset an Arduino if it's not one -upload: $(BUILD_DIR)/$(TARGET).hex -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty hup < $(UPLOAD_PORT); true -endif - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) -ifeq (${AVRDUDE_PROGRAMMER}, arduino) - stty -hup < $(UPLOAD_PORT); true -endif - -# Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex -ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \ - $(SIZE) $(BUILD_DIR)/$(TARGET).elf -sizebefore: - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi - -sizeafter: build - $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ - --change-section-address .data-0x800000 \ - --change-section-address .bss-0x800000 \ - --change-section-address .noinit-0x800000 \ - --change-section-address .eeprom-0x810000 - - -coff: $(BUILD_DIR)/$(TARGET).elf - $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -extcoff: $(TARGET).elf - $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof - - -.SUFFIXES: .elf .hex .eep .lss .sym .bin -.PRECIOUS: .o - -.elf.hex: - $(Pecho) " COPY $@" - $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -.elf.bin: - $(Pecho) " COPY $@" - $P $(OBJCOPY) -O binary -R .eeprom $< $@ - -.elf.eep: - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -.elf.lss: - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -.elf.sym: - $(NM) -n $< > $@ - -# Link: create ELF output file from library. - -$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h - $(Pecho) " CXX $@" - $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) - -# Object files that were found in "src" will be stored in $(BUILD_DIR) -# in directories that mirror the structure of "src" - -$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@ - -$(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@ - -# Object files for Arduino libs will be created in $(BUILD_DIR)/arduino - -$(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@ - -$(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@ - -$(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE) - $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@ - -# Target: clean project. -clean: - $(Pecho) " RMDIR $(BUILD_DIR)/" - $P rm -rf $(BUILD_DIR) - - -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter - -# Automaticaly include the dependency files created by gcc --include ${patsubst %.o, %.d, ${OBJ}} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/Marlin.ino b/Marlin_thinkerV2/Marlin2.0/Marlin/Marlin.ino deleted file mode 100644 index ae5bca1dfe..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/Marlin.ino +++ /dev/null @@ -1,53 +0,0 @@ -/* -================================================================================ - - Marlin Firmware - - (c) 2011-2019 MarlinFirmware - Portions of Marlin are (c) by their respective authors. - All code complies with GPLv2 and/or GPLv3 - -================================================================================ - -Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware. - -To configure Marlin you must edit Configuration.h and Configuration_adv.h -located in the root 'Marlin' folder. Check the config/examples folder to see if -there's a more suitable starting-point for your specific hardware. - -Before diving in, we recommend the following essential links: - -Marlin Firmware Official Website - - - http://marlinfw.org/ - The official Marlin Firmware website contains the most up-to-date - documentation. Contributions are always welcome! - -Configuration - - - https://www.youtube.com/watch?v=3gwWVFtdg-4 - A good 20-minute overview of Marlin configuration by Tom Sanladerer. - (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.) - Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin - - - http://marlinfw.org/docs/configuration/configuration.html - Marlin's configuration options are explained in more detail here. - -Getting Help - - - http://forums.reprap.org/list.php?415 - The Marlin Discussion Forum is a great place to get help from other Marlin - users who may have experienced similar issues to your own. - - - https://github.com/MarlinFirmware/Marlin/issues - With a free GitHub account you can provide us with feedback, bug reports, - and feature requests via the Marlin Issue Queue. - -Contributing - - - http://marlinfw.org/docs/development/contributing.html - If you'd like to contribute to Marlin, read this first! - - - http://marlinfw.org/docs/development/coding_standards.html - Before submitting code get to know the Coding Standards. -*/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/Version.h b/Marlin_thinkerV2/Marlin2.0/Marlin/Version.h deleted file mode 100644 index bcfb4575d1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/Version.h +++ /dev/null @@ -1,76 +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 - -//////////////////////////// -// VENDOR VERSION EXAMPLE // -//////////////////////////// - -/** - * Marlin release version identifier - */ -//#define SHORT_BUILD_VERSION "2.0.x" - -/** - * Verbose version identifier which should contain a reference to the location - * from where the binary was downloaded or the source code was compiled. - */ -//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" - -/** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ -//#define STRING_DISTRIBUTION_DATE "2020-02-25" - -/** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ -#define MACHINE_NAME "Thinker V2-N" - -/** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ -//#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" - -/** - * Default generic printer UUID. - */ -//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" - -/** - * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. - */ -//#define WEBSITE_URL "http://marlinfw.org" - -/** - * Set the vendor info the serial USB interface, if changable - * Currently only supported by DUE platform - */ -//#define USB_DEVICE_VENDOR_ID 0x0000 -//#define USB_DEVICE_PRODUCT_ID 0x0000 -//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/lib/readme.txt b/Marlin_thinkerV2/Marlin2.0/Marlin/lib/readme.txt deleted file mode 100644 index dbadc3d630..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/lib/readme.txt +++ /dev/null @@ -1,36 +0,0 @@ - -This directory is intended for the project specific (private) libraries. -PlatformIO will compile them to static libraries and link to executable file. - -The source code of each library should be placed in separate directory, like -"lib/private_lib/[here are source files]". - -For example, see how can be organized `Foo` and `Bar` libraries: - -|--lib -| |--Bar -| | |--docs -| | |--examples -| | |--src -| | |- Bar.c -| | |- Bar.h -| |--Foo -| | |- Foo.c -| | |- Foo.h -| |- readme.txt --> THIS FILE -|- platformio.ini -|--src - |- main.c - -Then in `src/main.c` you should use: - -#include -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -More information about PlatformIO Library Dependency Finder -- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL.h deleted file mode 100644 index 5ad1393110..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL.h +++ /dev/null @@ -1,34 +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 - -#include "platforms.h" - -#include HAL_PATH(.,HAL.h) - -#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) - -inline void watchdog_refresh() { - #if ENABLED(USE_WATCHDOG) - HAL_watchdog_refresh(); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.cpp deleted file mode 100644 index 4a10f73dcf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.cpp +++ /dev/null @@ -1,79 +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 . - * - */ - -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" - -// ------------------------ -// Public Variables -// ------------------------ - -//uint8_t MCUSR; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_init() { - // Init Servo Pins - #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) - #if HAS_SERVO_0 - INIT_SERVO(0); - #endif - #if HAS_SERVO_1 - INIT_SERVO(1); - #endif - #if HAS_SERVO_2 - INIT_SERVO(2); - #endif - #if HAS_SERVO_3 - INIT_SERVO(3); - #endif -} - -#if ENABLED(SDSUPPORT) - - #include "../../sd/SdFatUtil.h" - int freeMemory() { return SdFatUtil::FreeRam(); } - -#else // !SDSUPPORT - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} - -#endif // !SDSUPPORT - -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.h deleted file mode 100644 index e6d9683675..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL.h +++ /dev/null @@ -1,402 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -#include "../shared/Marduino.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "math.h" - -#ifdef USBCON - #include -#else - #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion - #include "MarlinSerial.h" -#endif - -#include -#include -#include -#include -#include -#include - -#ifndef pgm_read_ptr - // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for - // Windows Subsystem for Linux on Windows 10 as of 10/18/2019 - #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long)) - #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short)) - #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short) -#endif - -// ------------------------ -// Defines -// ------------------------ - -//#define analogInputToDigitalPin(IO) IO - -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli() - #define CRITICAL_SECTION_END SREG = _sreg -#endif -#define ISRS_ENABLED() TEST(SREG, SREG_I) -#define ENABLE_ISRS() sei() -#define DISABLE_ISRS() cli() - -// On AVR this is in math.h? -//#define square(x) ((x)*(x)) - -// ------------------------ -// Types -// ------------------------ - -typedef uint16_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFF - -typedef int8_t pin_t; - -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo - -// ------------------------ -// Public Variables -// ------------------------ - -//extern uint8_t MCUSR; - -// Serial ports -#ifdef USBCON - #if ENABLED(BLUETOOTH) - #define MYSERIAL0 bluetoothSerial - #else - #define MYSERIAL0 Serial - #endif - #define NUM_SERIAL 1 -#else - #if !WITHIN(SERIAL_PORT, -1, 3) - #error "SERIAL_PORT must be from -1 to 3" - #endif - - #define MYSERIAL0 customizedSerial1 - - #ifdef SERIAL_PORT_2 - #if !WITHIN(SERIAL_PORT_2, -1, 3) - #error "SERIAL_PORT_2 must be from -1 to 3" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #define MYSERIAL1 customizedSerial2 - #else - #define NUM_SERIAL 1 - #endif -#endif - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_init(); - -//void cli(); - -//void _delay_ms(const int delay); - -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(); -} -#pragma GCC diagnostic pop - -// timers -#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz - -#define STEP_TIMER_NUM 1 -#define TEMP_TIMER_NUM 0 -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0) - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE -#define STEPPER_TIMER_PRESCALE 8 -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A) -#define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A) - -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) - -FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) { - switch (timer_num) { - case STEP_TIMER_NUM: - // waveform generation = 0100 = CTC - SET_WGM(1, CTC_OCRnA); - - // output mode = 00 (disconnected) - SET_COMA(1, NORMAL); - - // Set the timer pre-scaler - // Generally we use a divider of 8, resulting in a 2MHz timer - // frequency on a 16MHz MCU. If you are going to change this, be - // sure to regenerate speed_lookuptable.h with - // create_speed_lookuptable.py - SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler - - // Init Stepper ISR to 122 Hz for quick starting - // (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency - OCR1A = 0x4000; - TCNT1 = 0; - break; - - case TEMP_TIMER_NUM: - // Use timer0 for temperature measurement - // Interleave temperature interrupt with millies interrupt - OCR0B = 128; - break; - } -} - -#define TIMER_OCR_1 OCR1A -#define TIMER_COUNTER_1 TCNT1 - -#define TIMER_OCR_0 OCR0A -#define TIMER_COUNTER_0 TCNT0 - -#define _CAT(a,V...) a##V -#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare) -#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer) -#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer) - -/** - * On AVR there is no hardware prioritization and preemption of - * interrupts, so this emulates it. The UART has first priority - * (otherwise, characters will be lost due to UART overflow). - * Then: Stepper, Endstops, Temperature, and -finally- all others. - */ -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) - -/* 18 cycles maximum latency */ -#define HAL_STEP_TIMER_ISR() \ -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 */ \ - A("push r16") /* 2 Save SREG into stack */ \ - A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \ - A("push r16") /* 2 Save TIMSK0 into the stack */ \ - A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \ - A("sts %[timsk0], r16") /* 2 And set the new value */ \ - A("lds r16, %[timsk1]") /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \ - A("andi r16,~%[msk1]") /* 1 Disable the stepper ISR */ \ - A("sts %[timsk1], r16") /* 2 And set the new value */ \ - A("push r16") /* 2 Save TIMSK1 into stack */ \ - A("in r16, 0x3B") /* 1 Get RAMPZ register */ \ - A("push r16") /* 2 Save RAMPZ into stack */ \ - A("in r16, 0x3C") /* 1 Get EIND register */ \ - A("push r0") /* C runtime can modify all the following registers without restoring them */ \ - A("push r1") \ - A("push r18") \ - A("push r19") \ - A("push r20") \ - A("push r21") \ - A("push r22") \ - A("push r23") \ - A("push r24") \ - A("push r25") \ - A("push r26") \ - A("push r27") \ - A("push r30") \ - A("push r31") \ - A("clr r1") /* C runtime expects this register to be 0 */ \ - A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \ - A("pop r31") \ - A("pop r30") \ - A("pop r27") \ - A("pop r26") \ - A("pop r25") \ - A("pop r24") \ - A("pop r23") \ - A("pop r22") \ - A("pop r21") \ - A("pop r20") \ - A("pop r19") \ - A("pop r18") \ - A("pop r1") \ - A("pop r0") \ - A("out 0x3C, r16") /* 1 Restore EIND register */ \ - A("pop r16") /* 2 Get the original RAMPZ register value */ \ - A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \ - A("pop r16") /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \ - A("ori r16,%[msk1]") /* 1 Reenable the stepper ISR */ \ - A("cli") /* 1 Disable global interrupts - Reenabling Stepper ISR can reenter amd temperature can reenter, and we want that, if it happens, after this ISR has ended */ \ - A("sts %[timsk1], r16") /* 2 And restore the old value - This reenables the stepper ISR */ \ - A("pop r16") /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \ - A("sts %[timsk0], r16") /* 2 And restore the old value - This reenables the temperature ISR */ \ - A("pop r16") /* 2 Get the old SREG value */ \ - A("out __SREG__, r16") /* 1 And restore the SREG value */ \ - A("pop r16") /* 2 Restore R16 value */ \ - A("reti") /* 4 Return from interrupt */ \ - : \ - : [timsk0] "i" ((uint16_t)&TIMSK0), \ - [timsk1] "i" ((uint16_t)&TIMSK1), \ - [msk0] "M" ((uint8_t)(1< 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#else - #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) -#endif - -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() ADC -#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) - -#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 HAL_SENSITIVE_PINS 0, 1 - -#ifdef __AVR_AT90USB1286__ - #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0) -#endif - -// AVR compatibility -#define strtof strtod - -/** - * set_pwm_frequency - * Sets the frequency of the timer corresponding to the provided pin - * as close as possible to the provided desired frequency. Internally - * calculates the required waveform generation mode, prescaler and - * resolution values required and sets the timer registers accordingly. - * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B) - * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings) - */ -void set_pwm_frequency(const pin_t pin, int f_desired); - -/** - * set_pwm_duty - * Sets the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp deleted file mode 100644 index 7a0f7246ee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp +++ /dev/null @@ -1,253 +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 . - * - */ - -/** - * Adapted from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * HAL for AVR - SPI functions - */ - -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" - -void spiBegin() { - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); - - #if DISABLED(SOFTWARE_SPI) - // SS must be in output mode even it is not chip select - //SET_OUTPUT(SS_PIN); - // set SS high - may be chip select for another SPI device - //#if SET_SPI_SS_HIGH - //WRITE(SS_PIN, HIGH); - //#endif - // set a default rate - spiInit(1); - #endif -} - -#if NONE(SOFTWARE_SPI, FORCE_SOFT_SPI) - - // ------------------------ - // Hardware SPI - // ------------------------ - - // make sure SPCR rate is in expected bits - #if (SPR0 != 0 || SPR1 != 1) - #error "unexpected SPCR bits" - #endif - - /** - * Initialize hardware SPI - * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] - */ - void spiInit(uint8_t spiRate) { - // See avr processor documentation - CBI( - #ifdef PRR - PRR - #elif defined(PRR0) - PRR0 - #endif - , PRSPI); - - SPCR = _BV(SPE) | _BV(MSTR) | (spiRate >> 1); - SPSR = spiRate & 1 || spiRate == 6 ? 0 : _BV(SPI2X); - } - - /** SPI receive a byte */ - uint8_t spiRec() { - SPDR = 0xFF; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - return SPDR; - } - - /** SPI read data */ - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte-- == 0) return; - SPDR = 0xFF; - for (uint16_t i = 0; i < nbyte; i++) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[i] = SPDR; - SPDR = 0xFF; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - buf[nbyte] = SPDR; - } - - /** SPI send a byte */ - void spiSend(uint8_t b) { - SPDR = b; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - - /** SPI send block */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPDR = token; - for (uint16_t i = 0; i < 512; i += 2) { - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i]; - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - SPDR = buf[i + 1]; - } - while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - } - - - /** begin spi transaction */ - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - // Based on Arduino SPI library - // Clock settings are defined as follows. Note that this shows SPI2X - // inverted, so the bits form increasing numbers. Also note that - // fosc/64 appears twice - // SPR1 SPR0 ~SPI2X Freq - // 0 0 0 fosc/2 - // 0 0 1 fosc/4 - // 0 1 0 fosc/8 - // 0 1 1 fosc/16 - // 1 0 0 fosc/32 - // 1 0 1 fosc/64 - // 1 1 0 fosc/64 - // 1 1 1 fosc/128 - - // We find the fastest clock that is less than or equal to the - // given clock rate. The clock divider that results in clock_setting - // is 2 ^^ (clock_div + 1). If nothing is slow enough, we'll use the - // slowest (128 == 2 ^^ 7, so clock_div = 6). - uint8_t clockDiv; - - // When the clock is known at compiletime, use this if-then-else - // cascade, which the compiler knows how to completely optimize - // away. When clock is not known, use a loop instead, which generates - // shorter code. - if (__builtin_constant_p(spiClock)) { - if (spiClock >= F_CPU / 2) clockDiv = 0; - else if (spiClock >= F_CPU / 4) clockDiv = 1; - else if (spiClock >= F_CPU / 8) clockDiv = 2; - else if (spiClock >= F_CPU / 16) clockDiv = 3; - else if (spiClock >= F_CPU / 32) clockDiv = 4; - else if (spiClock >= F_CPU / 64) clockDiv = 5; - else clockDiv = 6; - } - else { - uint32_t clockSetting = F_CPU / 2; - clockDiv = 0; - while (clockDiv < 6 && spiClock < clockSetting) { - clockSetting /= 2; - clockDiv++; - } - } - - // Compensate for the duplicate fosc/64 - if (clockDiv == 6) clockDiv = 7; - - // Invert the SPI2X bit - clockDiv ^= 0x1; - - SPCR = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) | - (dataMode << CPHA) | ((clockDiv >> 1) << SPR0); - SPSR = clockDiv | 0x01; - } - - -#else // SOFTWARE_SPI || FORCE_SOFT_SPI - - // ------------------------ - // Software SPI - // ------------------------ - - // nop to tune soft SPI timing - #define nop asm volatile ("\tnop\n") - - void spiInit(uint8_t) { /* do nothing */ } - - // Begin SPI transaction, set clock, bit order, data mode - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ } - - // Soft SPI receive byte - uint8_t spiRec() { - uint8_t data = 0; - // no interrupts during byte receive - about 8µs - cli(); - // output pin high - like sending 0xFF - WRITE(MOSI_PIN, HIGH); - - for (uint8_t i = 0; i < 8; i++) { - WRITE(SCK_PIN, HIGH); - - nop; // adjust so SCK is nice - nop; - - data <<= 1; - - if (READ(MISO_PIN)) data |= 1; - - WRITE(SCK_PIN, LOW); - } - - sei(); - return data; - } - - // Soft SPI read data - void spiRead(uint8_t* buf, uint16_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) - buf[i] = spiRec(); - } - - // Soft SPI send byte - void spiSend(uint8_t data) { - // no interrupts during byte send - about 8µs - cli(); - for (uint8_t i = 0; i < 8; i++) { - WRITE(SCK_PIN, LOW); - WRITE(MOSI_PIN, data & 0x80); - data <<= 1; - WRITE(SCK_PIN, HIGH); - } - - nop; // hold SCK high for a few ns - nop; - nop; - nop; - - WRITE(SCK_PIN, LOW); - - sei(); - } - - // Soft SPI send block - void spiSendBlock(uint8_t token, const uint8_t* buf) { - spiSend(token); - for (uint16_t i = 0; i < 512; i++) - spiSend(buf[i]); - } - -#endif // SOFTWARE_SPI || FORCE_SOFT_SPI - -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp deleted file mode 100644 index 3502aa6b0c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ /dev/null @@ -1,765 +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 . - * - */ - -/** - * MarlinSerial.cpp - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 23 November 2006 by David A. Mellis - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - * Modified 10 June 2018 by Eduardo José Tagle (See #10991) - * Templatized 01 October 2018 by Eduardo José Tagle to allow multiple instances - */ - -#ifdef __AVR__ - -// Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.) - -#include "../../inc/MarlinConfig.h" - -#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)) - - #include "MarlinSerial.h" - #include "../../Marlin.h" - - template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; - template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 }; - template bool MarlinSerial::_written = false; - template uint8_t MarlinSerial::xon_xoff_state = MarlinSerial::XON_XOFF_CHAR_SENT | MarlinSerial::XON_CHAR; - template uint8_t MarlinSerial::rx_dropped_bytes = 0; - template uint8_t MarlinSerial::rx_buffer_overruns = 0; - template uint8_t MarlinSerial::rx_framing_errors = 0; - template typename MarlinSerial::ring_buffer_pos_t MarlinSerial::rx_max_enqueued = 0; - - // A SW memory barrier, to ensure GCC does not overoptimize loops - #define sw_barrier() asm volatile("": : :"memory"); - - #include "../../feature/emergency_parser.h" - - // "Atomically" read the RX head index value without disabling interrupts: - // This MUST be called with RX interrupts enabled, and CAN'T be called - // from the RX ISR itself! - template - FORCE_INLINE typename MarlinSerial::ring_buffer_pos_t MarlinSerial::atomic_read_rx_head() { - if (Cfg::RX_SIZE > 256) { - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because serial RX interrupts happen at a slower rate - // than successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - ring_buffer_pos_t vold, vnew = rx_buffer.head; - sw_barrier(); - do { - vold = vnew; - vnew = rx_buffer.head; - sw_barrier(); - } while (vold != vnew); - return vnew; - } - else { - // With an 8bit index, reads are always atomic. No need for special handling - return rx_buffer.head; - } - } - - template - volatile bool MarlinSerial::rx_tail_value_not_stable = false; - template - volatile uint16_t MarlinSerial::rx_tail_value_backup = 0; - - // Set RX tail index, taking into account the RX ISR could interrupt - // the write to this variable in the middle - So a backup strategy - // is used to ensure reads of the correct values. - // -Must NOT be called from the RX ISR - - template - FORCE_INLINE void MarlinSerial::atomic_set_rx_tail(typename MarlinSerial::ring_buffer_pos_t value) { - if (Cfg::RX_SIZE > 256) { - // Store the new value in the backup - rx_tail_value_backup = value; - sw_barrier(); - // Flag we are about to change the true value - rx_tail_value_not_stable = true; - sw_barrier(); - // Store the new value - rx_buffer.tail = value; - sw_barrier(); - // Signal the new value is completely stored into the value - rx_tail_value_not_stable = false; - sw_barrier(); - } - else - rx_buffer.tail = value; - } - - // Get the RX tail index, taking into account the read could be - // interrupting in the middle of the update of that index value - // -Called from the RX ISR - - template - FORCE_INLINE typename MarlinSerial::ring_buffer_pos_t MarlinSerial::atomic_read_rx_tail() { - if (Cfg::RX_SIZE > 256) { - // If the true index is being modified, return the backup value - if (rx_tail_value_not_stable) return rx_tail_value_backup; - } - // The true index is stable, return it - return rx_buffer.tail; - } - - // (called with RX interrupts disabled) - template - FORCE_INLINE void MarlinSerial::store_rxd_char() { - - static EmergencyParser::State emergency_state; // = EP_RESET - - // Get the tail - Nothing can alter its value while this ISR is executing, but there's - // a chance that this ISR interrupted the main process while it was updating the index. - // The backup mechanism ensures the correct value is always returned. - const ring_buffer_pos_t t = atomic_read_rx_tail(); - - // Get the head pointer - This ISR is the only one that modifies its value, so it's safe to read here - ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // This must read the R_UCSRA register before reading the received byte to detect error causes - if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes; - if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns; - if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors; - - // Read the character from the USART - uint8_t c = R_UDR; - - if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - - if (Cfg::MAX_RX_QUEUED) { - // Calculate count of bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Keep track of the maximum count of enqueued bytes - NOLESS(rx_max_enqueued, rx_count); - } - - if (Cfg::XONOFF) { - // If the last char that was sent was an XON - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) { - - // Bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // If over 12.5% of RX buffer capacity, send XOFF before running out of - // RX buffer space .. 325 bytes @ 250kbits/s needed to let the host react - // and stop sending bytes. This translates to 13mS propagation time. - if (rx_count >= (Cfg::RX_SIZE) / 8) { - - // At this point, definitely no TX interrupt was executing, since the TX ISR can't be preempted. - // Don't enable the TX interrupt here as a means to trigger the XOFF char, because if it happens - // to be in the middle of trying to disable the RX interrupt in the main program, eventually the - // enabling of the TX interrupt could be undone. The ONLY reliable thing this can do to ensure - // the sending of the XOFF char is to send it HERE AND NOW. - - // About to send the XOFF char - xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; - - // Wait until the TX register becomes empty and send it - Here there could be a problem - // - While waiting for the TX register to empty, the RX register could receive a new - // character. This must also handle that situation! - while (!B_UDRE) { - - if (B_RXC) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Read the character from the USART - c = R_UDR; - - if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - } - sw_barrier(); - } - - R_UDR = XOFF_CHAR; - - // Clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - B_TXC = 1; - - // At this point there could be a race condition between the write() function - // and this sending of the XOFF char. This interrupt could happen between the - // wait to be empty TX buffer loop and the actual write of the character. Since - // the TX buffer is full because it's sending the XOFF char, the only way to be - // sure the write() function will succeed is to wait for the XOFF char to be - // completely sent. Since an extra character could be received during the wait - // it must also be handled! - while (!B_UDRE) { - - if (B_RXC) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Read the character from the USART - c = R_UDR; - - if (Cfg::EMERGENCYPARSER) - emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - } - sw_barrier(); - } - - // At this point everything is ready. The write() function won't - // have any issues writing to the UART TX register if it needs to! - } - } - } - - // Store the new head value - The main loop will retry until the value is stable - rx_buffer.head = h; - } - - // (called with TX irqs disabled) - template - FORCE_INLINE void MarlinSerial::_tx_udr_empty_irq() { - if (Cfg::TX_SIZE > 0) { - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; - - if (Cfg::XONOFF) { - // If an XON char is pending to be sent, do it now - if (xon_xoff_state == XON_CHAR) { - - // Send the character - R_UDR = XON_CHAR; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - B_TXC = 1; - - // Remember we sent it. - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - - // If nothing else to transmit, just disable TX interrupts. - if (h == t) B_UDRIE = 0; // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - - return; - } - } - - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - B_UDRIE = 0; // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - return; - } - - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (Cfg::TX_SIZE - 1); - R_UDR = c; - tx_buffer.tail = t; - - // Clear the TXC bit (by writing a one to its bit location). - // Ensures flush() won't return until the bytes are actually written/ - B_TXC = 1; - - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) B_UDRIE = 0; // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - } - } - - // Public Methods - template - void MarlinSerial::begin(const long baud) { - uint16_t baud_setting; - bool useU2X = true; - - #if F_CPU == 16000000UL && SERIAL_PORT == 0 - // Hard-coded exception for compatibility with the bootloader shipped - // with the Duemilanove and previous boards, and the firmware on the - // 8U2 on the Uno and Mega 2560. - if (baud == 57600) useU2X = false; - #endif - - R_UCSRA = 0; - if (useU2X) { - B_U2X = 1; - baud_setting = (F_CPU / 4 / baud - 1) / 2; - } - else - baud_setting = (F_CPU / 8 / baud - 1) / 2; - - // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) - R_UBRRH = baud_setting >> 8; - R_UBRRL = baud_setting; - - B_RXEN = 1; - B_TXEN = 1; - B_RXCIE = 1; - if (Cfg::TX_SIZE > 0) B_UDRIE = 0; - _written = false; - } - - template - void MarlinSerial::end() { - B_RXEN = 0; - B_TXEN = 0; - B_RXCIE = 0; - B_UDRIE = 0; - } - - template - 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() { - 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 - ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - // Get the next char - const int v = rx_buffer.buffer[t]; - t = (ring_buffer_pos_t)(t + 1) & (Cfg::RX_SIZE - 1); - - // Advance tail - Making sure the RX ISR will always get an stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(t); - - if (Cfg::XONOFF) { - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - // Get count of bytes in the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - if (rx_count < (Cfg::RX_SIZE) / 10) { - if (Cfg::TX_SIZE > 0) { - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable them - B_UDRIE = 1; - } - else { - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!B_UDRE) sw_barrier(); - R_UDR = XON_CHAR; - } - } - } - } - - return v; - } - - template - 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() { - - // Set the tail to the head: - // - Read the RX head index in a safe way. (See atomic_read_rx_head.) - // - Set the tail, making sure the RX ISR will always get a stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(atomic_read_rx_head()); - - if (Cfg::XONOFF) { - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - if (Cfg::TX_SIZE > 0) { - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX ISR. Non atomic, but it will eventually enable it. - B_UDRIE = 1; - } - else { - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!B_UDRE) sw_barrier(); - R_UDR = XON_CHAR; - } - } - } - } - - template - void MarlinSerial::write(const uint8_t c) { - if (Cfg::TX_SIZE == 0) { - - _written = true; - while (!B_UDRE) sw_barrier(); - R_UDR = c; - - } - else { - - _written = true; - - // If the TX interrupts are disabled and the data register - // is empty, just write the byte to the data register and - // be done. This shortcut helps significantly improve the - // effective datarate at high (>500kbit/s) bitrates, where - // interrupt overhead becomes a slowdown. - // Yes, there is a race condition between the sending of the - // XOFF char at the RX ISR, but it is properly handled there - if (!B_UDRIE && B_UDRE) { - R_UDR = c; - - // clear the TXC bit -- "can be cleared by writing a one to its bit - // location". This makes sure flush() won't return until the bytes - // actually got written - B_TXC = 1; - return; - } - - const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1); - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Make room by polling if it is possible to transmit, and do so! - while (i == tx_buffer.tail) { - - // If we can transmit another byte, do it. - if (B_UDRE) _tx_udr_empty_irq(); - - // Make sure compiler rereads tx_buffer.tail - sw_barrier(); - } - } - else { - // Interrupts are enabled, just wait until there is space - while (i == tx_buffer.tail) sw_barrier(); - } - - // Store new char. head is always safe to move - tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - - // Enable TX ISR - Non atomic, but it will eventually enable TX ISR - B_UDRIE = 1; - } - } - - template - void MarlinSerial::flushTX() { - - if (Cfg::TX_SIZE == 0) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // Wait until everything was transmitted - while (!B_TXC) sw_barrier(); - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - - } - else { - - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Wait until everything was transmitted - We must do polling, as interrupts are disabled - while (tx_buffer.head != tx_buffer.tail || !B_TXC) { - - // If there is more space, send an extra character - if (B_UDRE) _tx_udr_empty_irq(); - - sw_barrier(); - } - - } - else { - // Wait until everything was transmitted - while (tx_buffer.head != tx_buffer.tail || !B_TXC) sw_barrier(); - } - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } - } - - /** - * Imports from print.h - */ - - template - void MarlinSerial::print(char c, int base) { - print((long)c, base); - } - - template - void MarlinSerial::print(unsigned char b, int base) { - print((unsigned long)b, base); - } - - template - void MarlinSerial::print(int n, int base) { - print((long)n, base); - } - - template - void MarlinSerial::print(unsigned int n, int base) { - print((unsigned long)n, base); - } - - template - void MarlinSerial::print(long n, int base) { - if (base == 0) write(n); - else if (base == 10) { - if (n < 0) { print('-'); n = -n; } - printNumber(n, 10); - } - else - printNumber(n, base); - } - - template - void MarlinSerial::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); - } - - template - void MarlinSerial::print(double n, int digits) { - printFloat(n, digits); - } - - template - void MarlinSerial::println() { - print('\r'); - print('\n'); - } - - template - void MarlinSerial::println(const String& s) { - print(s); - println(); - } - - template - void MarlinSerial::println(const char c[]) { - print(c); - println(); - } - - template - void MarlinSerial::println(char c, int base) { - print(c, base); - println(); - } - - template - void MarlinSerial::println(unsigned char b, int base) { - print(b, base); - println(); - } - - template - void MarlinSerial::println(int n, int base) { - print(n, base); - println(); - } - - template - void MarlinSerial::println(unsigned int n, int base) { - print(n, base); - println(); - } - - template - void MarlinSerial::println(long n, int base) { - print(n, base); - println(); - } - - template - void MarlinSerial::println(unsigned long n, int base) { - print(n, base); - println(); - } - - template - void MarlinSerial::println(double n, int digits) { - print(n, digits); - println(); - } - - // Private Methods - - template - void MarlinSerial::printNumber(unsigned long n, uint8_t base) { - if (n) { - unsigned char buf[8 * sizeof(long)]; // Enough space for base 2 - int8_t i = 0; - while (n) { - buf[i++] = n % base; - n /= base; - } - while (i--) - print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10))); - } - else - print('0'); - } - - template - void MarlinSerial::printFloat(double number, uint8_t digits) { - // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1; - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; - print(int_part); - - // Print the decimal point, but only if there are digits beyond - if (digits) { - print('.'); - // Extract digits from the remainder one at a time - while (digits--) { - remainder *= 10.0; - int toPrint = int(remainder); - print(toPrint); - remainder -= toPrint; - } - } - } - - // Hookup ISR handlers - ISR(SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect)) { - MarlinSerial>::store_rxd_char(); - } - - ISR(SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect)) { - MarlinSerial>::_tx_udr_empty_irq(); - } - - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> customizedSerial1; - - #ifdef SERIAL_PORT_2 - - // Hookup ISR handlers - ISR(SERIAL_REGNAME(USART,SERIAL_PORT_2,_RX_vect)) { - MarlinSerial>::store_rxd_char(); - } - - ISR(SERIAL_REGNAME(USART,SERIAL_PORT_2,_UDRE_vect)) { - MarlinSerial>::_tx_udr_empty_irq(); - } - - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> customizedSerial2; - - #endif - -#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) - -#ifdef INTERNAL_SERIAL_PORT - - ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) { - MarlinSerial>::store_rxd_char(); - } - - ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) { - MarlinSerial>::_tx_udr_empty_irq(); - } - - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> internalSerial; - -#endif - -// For AT90USB targets use the UART for BT interfacing -#if defined(USBCON) && ENABLED(BLUETOOTH) - HardwareSerial bluetoothSerial; -#endif - -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.h deleted file mode 100644 index 7560d880e3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ /dev/null @@ -1,298 +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 - -/** - * MarlinSerial.h - Hardware serial library for Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * Modified 28 September 2010 by Mark Sproul - * Modified 14 February 2016 by Andreas Hardtung (added tx buffer) - * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF) - * Templatized 01 October 2018 by Eduardo José Tagle to allow multiple instances - */ - -#include "../shared/MarlinSerial.h" - -#include - -#ifndef SERIAL_PORT - #define SERIAL_PORT 0 -#endif - -#ifndef USBCON - - // The presence of the UBRRH register is used to detect a UART. - #define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \ - (port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \ - (port == 3 && defined(UBRR3H))) - - // These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor - // requires two levels of indirection to expand macro values properly) - #define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) - #if SERIAL_PORT == 0 && (!defined(UBRR0H) || !defined(UDR0)) // use un-numbered registers if necessary - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix - #else - #define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix - #endif - - // Registers used by MarlinSerial class (expanded depending on selected serial port) - - // Templated 8bit register (generic) - #define UART_REGISTER_DECL_BASE(registerbase, suffix) \ - template struct R_##registerbase##x##suffix {} - - // Templated 8bit register (specialization for each port) - #define UART_REGISTER_DECL(port, registerbase, suffix) \ - template<> struct R_##registerbase##x##suffix { \ - constexpr R_##registerbase##x##suffix(int) {} \ - FORCE_INLINE void operator=(uint8_t newVal) const { SERIAL_REGNAME(registerbase,port,suffix) = newVal; } \ - FORCE_INLINE operator uint8_t() const { return SERIAL_REGNAME(registerbase,port,suffix); } \ - } - - // Templated 1bit register (generic) - #define UART_BIT_DECL_BASE(registerbase, suffix, bit) \ - templatestruct B_##bit##x {} - - // Templated 1bit register (specialization for each port) - #define UART_BIT_DECL(port, registerbase, suffix, bit) \ - template<> struct B_##bit##x { \ - constexpr B_##bit##x(int) {} \ - FORCE_INLINE void operator=(int newVal) const { \ - if (newVal) \ - SBI(SERIAL_REGNAME(registerbase,port,suffix),SERIAL_REGNAME(bit,port,)); \ - else \ - CBI(SERIAL_REGNAME(registerbase,port,suffix),SERIAL_REGNAME(bit,port,)); \ - } \ - FORCE_INLINE operator bool() const { return TEST(SERIAL_REGNAME(registerbase,port,suffix),SERIAL_REGNAME(bit,port,)); } \ - } - - #define UART_DECL_BASE() \ - UART_REGISTER_DECL_BASE(UCSR,A);\ - UART_REGISTER_DECL_BASE(UDR,);\ - UART_REGISTER_DECL_BASE(UBRR,H);\ - UART_REGISTER_DECL_BASE(UBRR,L);\ - UART_BIT_DECL_BASE(UCSR,B,RXEN);\ - UART_BIT_DECL_BASE(UCSR,B,TXEN);\ - UART_BIT_DECL_BASE(UCSR,A,TXC);\ - UART_BIT_DECL_BASE(UCSR,B,RXCIE);\ - UART_BIT_DECL_BASE(UCSR,A,UDRE);\ - UART_BIT_DECL_BASE(UCSR,A,FE);\ - UART_BIT_DECL_BASE(UCSR,A,DOR);\ - UART_BIT_DECL_BASE(UCSR,B,UDRIE);\ - UART_BIT_DECL_BASE(UCSR,A,RXC);\ - UART_BIT_DECL_BASE(UCSR,A,U2X) - - #define UART_DECL(port) \ - UART_REGISTER_DECL(port,UCSR,A);\ - UART_REGISTER_DECL(port,UDR,);\ - UART_REGISTER_DECL(port,UBRR,H);\ - UART_REGISTER_DECL(port,UBRR,L);\ - UART_BIT_DECL(port,UCSR,B,RXEN);\ - UART_BIT_DECL(port,UCSR,B,TXEN);\ - UART_BIT_DECL(port,UCSR,A,TXC);\ - UART_BIT_DECL(port,UCSR,B,RXCIE);\ - UART_BIT_DECL(port,UCSR,A,UDRE);\ - UART_BIT_DECL(port,UCSR,A,FE);\ - UART_BIT_DECL(port,UCSR,A,DOR);\ - UART_BIT_DECL(port,UCSR,B,UDRIE);\ - UART_BIT_DECL(port,UCSR,A,RXC);\ - UART_BIT_DECL(port,UCSR,A,U2X) - - // Declare empty templates - UART_DECL_BASE(); - - // And all the specializations for each possible serial port - #if UART_PRESENT(0) - UART_DECL(0); - #endif - #if UART_PRESENT(1) - UART_DECL(1); - #endif - #if UART_PRESENT(2) - UART_DECL(2); - #endif - #if UART_PRESENT(3) - UART_DECL(3); - #endif - - #define DEC 10 - #define HEX 16 - #define OCT 8 - #define BIN 2 - #define BYTE 0 - - // Templated type selector - template struct TypeSelector { typedef T type;} ; - template struct TypeSelector { typedef F type; }; - - template - class MarlinSerial { - protected: - // Registers - static constexpr R_UCSRxA R_UCSRA = 0; - static constexpr R_UDRx R_UDR = 0; - static constexpr R_UBRRxH R_UBRRH = 0; - static constexpr R_UBRRxL R_UBRRL = 0; - - // Bits - static constexpr B_RXENx B_RXEN = 0; - static constexpr B_TXENx B_TXEN = 0; - static constexpr B_TXCx B_TXC = 0; - static constexpr B_RXCIEx B_RXCIE = 0; - static constexpr B_UDREx B_UDRE = 0; - static constexpr B_FEx B_FE = 0; - static constexpr B_DORx B_DOR = 0; - static constexpr B_UDRIEx B_UDRIE = 0; - static constexpr B_RXCx B_RXC = 0; - static constexpr B_U2Xx B_U2X = 0; - - // Base size of type on buffer size - typedef typename TypeSelector<(Cfg::RX_SIZE>256), uint16_t, uint8_t>::type ring_buffer_pos_t; - - struct ring_buffer_r { - volatile ring_buffer_pos_t head, tail; - unsigned char buffer[Cfg::RX_SIZE]; - }; - - struct ring_buffer_t { - volatile uint8_t head, tail; - unsigned char buffer[Cfg::TX_SIZE]; - }; - - static ring_buffer_r rx_buffer; - static ring_buffer_t tx_buffer; - static bool _written; - - static constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80, // XON / XOFF Character was sent - XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send - - // XON / XOFF character definitions - static constexpr uint8_t XON_CHAR = 17, XOFF_CHAR = 19; - static uint8_t xon_xoff_state, - rx_dropped_bytes, - rx_buffer_overruns, - rx_framing_errors; - static ring_buffer_pos_t rx_max_enqueued; - - static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head(); - - static volatile bool rx_tail_value_not_stable; - static volatile uint16_t rx_tail_value_backup; - - static FORCE_INLINE void atomic_set_rx_tail(ring_buffer_pos_t value); - static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail(); - - public: - - FORCE_INLINE static void store_rxd_char(); - FORCE_INLINE static void _tx_udr_empty_irq(); - - public: - MarlinSerial() {}; - static void begin(const long); - static void end(); - 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(); - - 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; } - FORCE_INLINE static uint8_t framing_errors() { return Cfg::RX_FRAMING_ERRORS ? rx_framing_errors : 0; } - FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return Cfg::MAX_RX_QUEUED ? rx_max_enqueued : 0; } - - FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } - FORCE_INLINE static void print(const char* str) { write(str); } - - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); - static void print(int, int = DEC); - static void print(unsigned int, int = DEC); - static void print(long, int = DEC); - static void print(unsigned long, int = DEC); - static void print(double, int = 2); - - static void println(const String& s); - static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); - static void println(int, int = DEC); - static void println(unsigned int, int = DEC); - static void println(long, int = DEC); - static void println(unsigned long, int = DEC); - static void println(double, int = 2); - static void println(); - operator bool() { return true; } - - private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); - }; - - template - struct MarlinSerialCfg { - static constexpr int PORT = serial; - static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE; - static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE; - static constexpr bool XONOFF = bSERIAL_XON_XOFF; - static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER; - static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX; - static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS; - static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS; - static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED; - }; - extern MarlinSerial> customizedSerial1; - - #ifdef SERIAL_PORT_2 - - extern MarlinSerial> customizedSerial2; - - #endif - -#endif // !USBCON - -#ifdef INTERNAL_SERIAL_PORT - template - struct MarlinInternalSerialCfg { - static constexpr int PORT = serial; - static constexpr unsigned int RX_SIZE = 32; - static constexpr unsigned int TX_SIZE = 32; - static constexpr bool XONOFF = false; - static constexpr bool EMERGENCYPARSER = false; - static constexpr bool DROPPED_RX = false; - static constexpr bool RX_OVERRUNS = false; - static constexpr bool RX_FRAMING_ERRORS = false; - static constexpr bool MAX_RX_QUEUED = false; - }; - - extern MarlinSerial> internalSerial; -#endif - -// Use the UART for Bluetooth in AT90USB configurations -#if defined(USBCON) && ENABLED(BLUETOOTH) - extern HardwareSerial bluetoothSerial; -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/Servo.cpp deleted file mode 100644 index 33818edb96..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/Servo.cpp +++ /dev/null @@ -1,218 +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 . - * - */ - -/** - * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - */ - -/** - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin) - Attach a servo motor to an i/o pin. - * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds - * Default min is 544, max is 2400 - * - * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) - * writeMicroseconds() - Set the servo pulse width in microseconds. - * move(pin, angle) - Sequence of attach(pin), write(angle), safe_delay(servo_delay[servoIndex]). - * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after servo_delay[servoIndex]. - * read() - Get the last-written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Get the last-written servo pulse width in microseconds. - * attached() - Return true if a servo is attached. - * detach() - Stop an attached servo from pulsing its i/o pin. - * - */ - -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include - -#include "../shared/Marduino.h" -#include "../shared/servo.h" -#include "../shared/servo_private.h" - -static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) - - -/************ static functions common to all instances ***********************/ - -static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { - if (Channel[timer] < 0) - *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer - else { - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - } - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - *OCRnA = *TCNTn + SERVO(timer, Channel[timer]).ticks; - if (SERVO(timer, Channel[timer]).Pin.isActive) // check if activated - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high - } - else { - // finished all channels so wait for the refresh period to expire before starting over - if (((unsigned)*TCNTn) + 4 < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - *OCRnA = (unsigned int)usToTicks(REFRESH_INTERVAL); - else - *OCRnA = *TCNTn + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - } -} - -#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform - - // Interrupt handlers for Arduino - #ifdef _useTimer1 - SIGNAL(TIMER1_COMPA_vect) { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - - #ifdef _useTimer3 - SIGNAL(TIMER3_COMPA_vect) { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - - #ifdef _useTimer4 - SIGNAL(TIMER4_COMPA_vect) { handle_interrupts(_timer4, &TCNT4, &OCR4A); } - #endif - - #ifdef _useTimer5 - SIGNAL(TIMER5_COMPA_vect) { handle_interrupts(_timer5, &TCNT5, &OCR5A); } - #endif - -#else // WIRING - - // Interrupt handlers for Wiring - #ifdef _useTimer1 - void Timer1Service() { handle_interrupts(_timer1, &TCNT1, &OCR1A); } - #endif - #ifdef _useTimer3 - void Timer3Service() { handle_interrupts(_timer3, &TCNT3, &OCR3A); } - #endif - -#endif // WIRING - -/****************** end of static functions ******************************/ - -void initISR(timer16_Sequence_t timer) { - #ifdef _useTimer1 - if (timer == _timer1) { - 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__) - SBI(TIFR, OCF1A); // clear any pending interrupts; - SBI(TIMSK, OCIE1A); // enable the output compare interrupt - #else - // here if not ATmega8 or ATmega128 - SBI(TIFR1, OCF1A); // clear any pending interrupts; - SBI(TIMSK1, OCIE1A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service); - #endif - } - #endif - - #ifdef _useTimer3 - if (timer == _timer3) { - TCCR3A = 0; // normal counting mode - TCCR3B = _BV(CS31); // set prescaler of 8 - TCNT3 = 0; // clear the timer count - #ifdef __AVR_ATmega128__ - SBI(TIFR, OCF3A); // clear any pending interrupts; - SBI(ETIMSK, OCIE3A); // enable the output compare interrupt - #else - SBI(TIFR3, OCF3A); // clear any pending interrupts; - SBI(TIMSK3, OCIE3A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only - #endif - } - #endif - - #ifdef _useTimer4 - if (timer == _timer4) { - TCCR4A = 0; // normal counting mode - TCCR4B = _BV(CS41); // set prescaler of 8 - TCNT4 = 0; // clear the timer count - TIFR4 = _BV(OCF4A); // clear any pending interrupts; - TIMSK4 = _BV(OCIE4A); // enable the output compare interrupt - } - #endif - - #ifdef _useTimer5 - if (timer == _timer5) { - TCCR5A = 0; // normal counting mode - TCCR5B = _BV(CS51); // set prescaler of 8 - TCNT5 = 0; // clear the timer count - TIFR5 = _BV(OCF5A); // clear any pending interrupts; - TIMSK5 = _BV(OCIE5A); // enable the output compare interrupt - } - #endif -} - -void finISR(timer16_Sequence_t timer) { - // Disable use of the given timer - #ifdef WIRING - if (timer == _timer1) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK1 - #else - TIMSK - #endif - , OCIE1A); // disable timer 1 output compare interrupt - timerDetach(TIMER1OUTCOMPAREA_INT); - } - else if (timer == _timer3) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK3 - #else - ETIMSK - #endif - , OCIE3A); // disable the timer3 output compare A interrupt - timerDetach(TIMER3OUTCOMPAREA_INT); - } - #else // !WIRING - // For arduino - in future: call here to a currently undefined function to reset the timer - UNUSED(timer); - #endif -} - -#endif // HAS_SERVOS - -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/ServoTimers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/ServoTimers.h deleted file mode 100644 index 4991caefe6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/ServoTimers.h +++ /dev/null @@ -1,91 +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 - -/** - * ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * Defines for 16 bit timers used with Servo library - * - * If _useTimerX is defined then TimerX is a 16 bit timer on the current board - * timer16_Sequence_t enumerates the sequence that the timers should be allocated - * _Nbr_16timers indicates how many 16 bit timers are available. - */ - -/** - * AVR Only definitions - * -------------------- - */ - -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays -#define SERVO_TIMER_PRESCALER 8 // timer prescaler - -// Say which 16 bit timers can be used and in what order -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - //#define _useTimer1 - #define _useTimer3 - #define _useTimer4 - #if !HAS_MOTOR_CURRENT_PWM - #define _useTimer5 // Timer 5 is used for motor current PWM and can't be used for servos. - #endif -#elif defined(__AVR_ATmega32U4__) - #define _useTimer3 -#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) - #define _useTimer3 -#elif defined(__AVR_ATmega128__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega2561__) - #define _useTimer3 -#else - // everything else -#endif - -typedef enum { - #ifdef _useTimer1 - _timer1, - #endif - #ifdef _useTimer3 - _timer3, - #endif - #ifdef _useTimer4 - _timer4, - #endif - #ifdef _useTimer5 - _timer5, - #endif - _Nbr_16timers -} timer16_Sequence_t; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h deleted file mode 100644 index 77fa581632..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h +++ /dev/null @@ -1,245 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate either an - * 'external interrupt' or a 'pin change interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -#include - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -/** - * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) - * - * These macros for the Arduino MEGA do not include the two connected pins on Port J (D14, D15). - * So we extend them here because these are the normal pins for Y_MIN and Y_MAX on RAMPS. - * There are more PCI-enabled processor pins on Port J, but they are not connected to Arduino MEGA. - */ -#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA) - - #define digitalPinHasPCICR(p) (WITHIN(p, 10, 15) || WITHIN(p, 50, 53) || WITHIN(p, 62, 69)) - - #undef digitalPinToPCICR - #define digitalPinToPCICR(p) (digitalPinHasPCICR(p) ? (&PCICR) : nullptr) - - #undef digitalPinToPCICRbit - #define digitalPinToPCICRbit(p) (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \ - WITHIN(p, 14, 15) ? 1 : \ - WITHIN(p, 62, 69) ? 2 : \ - 0) - - #undef digitalPinToPCMSK - #define digitalPinToPCMSK(p) (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? (&PCMSK0) : \ - WITHIN(p, 14, 15) ? (&PCMSK1) : \ - WITHIN(p, 62, 69) ? (&PCMSK2) : \ - nullptr) - - #undef digitalPinToPCMSKbit - #define digitalPinToPCMSKbit(p) (WITHIN(p, 10, 13) ? ((p) - 6) : \ - (p) == 14 || (p) == 51 ? 2 : \ - (p) == 15 || (p) == 52 ? 1 : \ - (p) == 50 ? 3 : \ - (p) == 53 ? 0 : \ - WITHIN(p, 62, 69) ? ((p) - 62) : \ - 0) - -#elif defined(__AVR_ATmega164A__) || defined(__AVR_ATmega164P__) || defined(__AVR_ATmega324A__) || \ - defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega324PB__) || \ - defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || \ - defined(__AVR_ATmega1284P__) - - #define digitalPinHasPCICR(p) WITHIN(p, 0, NUM_DIGITAL_PINS) - -#else - - #error "Unsupported AVR variant!" - -#endif - - -// Install Pin change interrupt for a pin. Can be called multiple times. -void pciSetup(const int8_t pin) { - if (digitalPinHasPCICR(pin)) { - SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin - SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt - SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group - } -} - -// Handlers for pin change interrupts -#ifdef PCINT0_vect - ISR(PCINT0_vect) { endstop_ISR(); } -#endif - -#ifdef PCINT1_vect - ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect)); -#endif - -#ifdef PCINT2_vect - ISR(PCINT2_vect, ISR_ALIASOF(PCINT0_vect)); -#endif - -#ifdef PCINT3_vect - ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect)); -#endif - -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) - _ATTACH(X_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(X_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Y_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Y_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(X2_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(X2_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Y2_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Y2_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z2_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z2_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z3_MAX_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z3_MIN_PIN); - #else - static_assert(digitalPinHasPCICR(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) - _ATTACH(Z_MIN_PROBE_PIN); - #else - static_assert(digitalPinHasPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable"); - pciSetup(Z_MIN_PROBE_PIN); - #endif - #endif - - // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI. -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp deleted file mode 100644 index 4884ede63f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp +++ /dev/null @@ -1,282 +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 . - * - */ -#ifdef __AVR__ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM - -#include "HAL.h" - -struct Timer { - volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer - volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer - volatile uint16_t* ICRn; // max 1 ICR register per timer - uint8_t n; // the timer number [0->5] - uint8_t q; // the timer output [0->2] (A->C) -}; - -/** - * get_pwm_timer - * Get the timer information and register of the provided pin. - * Return a Timer struct containing this information. - * Used by set_pwm_frequency, set_pwm_duty - */ -Timer get_pwm_timer(const pin_t pin) { - uint8_t q = 0; - switch (digitalPinToTimer(pin)) { - // Protect reserved timers (TIMER0 & TIMER1) - #ifdef TCCR0A - #if !AVR_AT90USB1286_FAMILY - case TIMER0A: - #endif - case TIMER0B: - #endif - #ifdef TCCR1A - case TIMER1A: case TIMER1B: - #endif - break; - #if defined(TCCR2) || defined(TCCR2A) - #ifdef TCCR2 - case TIMER2: { - Timer timer = { - /*TCCRnQ*/ { &TCCR2, nullptr, nullptr }, - /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr }, - /*ICRn*/ nullptr, - /*n, q*/ 2, 0 - }; - } - #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 }, - /*ICRn*/ nullptr, - /*n, q*/ 2, 1 - }; - return timer; - } - #else - case TIMER2B: ++q; - case TIMER2A: { - Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, - /*ICRn*/ nullptr, - 2, q - }; - return timer; - } - #endif - #endif - #endif - #ifdef OCR3C - case TIMER3C: ++q; - case TIMER3B: ++q; - case TIMER3A: { - Timer timer = { - /*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 - }; - return timer; - } - #endif - #ifdef TCCR4A - case TIMER4C: ++q; - case TIMER4B: ++q; - case TIMER4A: { - Timer timer = { - /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C }, - /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C }, - /*ICRn*/ &ICR4, - /*n, q*/ 4, q - }; - return timer; - } - #endif - #ifdef TCCR5A - case TIMER5C: ++q; - case TIMER5B: ++q; - case TIMER5A: { - Timer timer = { - /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C }, - /*OCRnQ*/ { &OCR5A, &OCR5B, &OCR5C }, - /*ICRn*/ &ICR5, - /*n, q*/ 5, q - }; - return timer; - } - #endif - } - Timer timer = { - /*TCCRnQ*/ { nullptr, nullptr, nullptr }, - /*OCRnQ*/ { nullptr, nullptr, nullptr }, - /*ICRn*/ nullptr, - 0, 0 - }; - return timer; -} - -void set_pwm_frequency(const pin_t pin, int f_desired) { - Timer timer = get_pwm_timer(pin); - if (timer.n == 0) return; // Don't proceed if protected timer or not recognised - uint16_t size; - if (timer.n == 2) size = 255; else size = 65535; - - uint16_t res = 255; // resolution (TOP value) - uint8_t j = 0; // prescaler index - uint8_t wgm = 1; // waveform generation mode - - // Calculating the prescaler and resolution to use to achieve closest frequency - if (f_desired != 0) { - int f = (F_CPU) / (2 * 1024 * size) + 1; // Initialize frequency as lowest (non-zero) achievable - uint16_t prescaler[] = { 0, 1, 8, /*TIMER2 ONLY*/32, 64, /*TIMER2 ONLY*/128, 256, 1024 }; - - // loop over prescaler values - for (uint8_t i = 1; i < 8; i++) { - uint16_t res_temp_fast = 255, res_temp_phase_correct = 255; - if (timer.n == 2) { - // No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP - #if ENABLED(USE_OCR2A_AS_TOP) - const uint16_t rtf = (F_CPU) / (prescaler[i] * f_desired); - res_temp_fast = rtf - 1; - res_temp_phase_correct = rtf / 2; - #endif - } - else { - // Skip TIMER2 specific prescalers when not TIMER2 - if (i == 3 || i == 5) continue; - const uint16_t rtf = (F_CPU) / (prescaler[i] * f_desired); - res_temp_fast = rtf - 1; - res_temp_phase_correct = rtf / 2; - } - - LIMIT(res_temp_fast, 1u, size); - LIMIT(res_temp_phase_correct, 1u, size); - // Calculate frequencies of test prescaler and resolution values - const int f_temp_fast = (F_CPU) / (prescaler[i] * (1 + res_temp_fast)), - f_temp_phase_correct = (F_CPU) / (2 * prescaler[i] * res_temp_phase_correct), - f_diff = ABS(f - f_desired), - f_fast_diff = ABS(f_temp_fast - f_desired), - f_phase_diff = ABS(f_temp_phase_correct - f_desired); - - // If FAST values are closest to desired f - if (f_fast_diff < f_diff && f_fast_diff <= f_phase_diff) { - // Remember this combination - f = f_temp_fast; - res = res_temp_fast; - j = i; - // Set the Wave Generation Mode to FAST PWM - if (timer.n == 2) { - wgm = ( - #if ENABLED(USE_OCR2A_AS_TOP) - WGM2_FAST_PWM_OCR2A - #else - WGM2_FAST_PWM - #endif - ); - } - else wgm = WGM_FAST_PWM_ICRn; - } - // If PHASE CORRECT values are closes to desired f - else if (f_phase_diff < f_diff) { - f = f_temp_phase_correct; - res = res_temp_phase_correct; - j = i; - // Set the Wave Generation Mode to PWM PHASE CORRECT - if (timer.n == 2) { - wgm = ( - #if ENABLED(USE_OCR2A_AS_TOP) - WGM2_PWM_PC_OCR2A - #else - WGM2_PWM_PC - #endif - ); - } - else wgm = WGM_PWM_PC_ICRn; - } - } - } - _SET_WGMnQ(timer.TCCRnQ, wgm); - _SET_CSn(timer.TCCRnQ, j); - - if (timer.n == 2) { - #if ENABLED(USE_OCR2A_AS_TOP) - _SET_OCRnQ(timer.OCRnQ, 0, res); // Set OCR2A value (TOP) = res - #endif - } - else - _SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res -} - -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - // If v is 0 or v_size (max), digitalWrite to LOW or HIGH. - // Note that digitalWrite also disables pwm output for us (sets COM bit to 0) - if (v == 0) - digitalWrite(pin, invert); - else if (v == v_size) - digitalWrite(pin, !invert); - else { - Timer timer = get_pwm_timer(pin); - if (timer.n == 0) return; // Don't proceed if protected timer or not recognised - // Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted) - _SET_COMnQ(timer.TCCRnQ, (timer.q - #ifdef TCCR2 - + (timer.q == 2) // COM20 is on bit 4 of TCCR2, thus requires q + 1 in the macro - #endif - ), COM_CLEAR_SET + invert - ); - - uint16_t top; - if (timer.n == 2) { // if TIMER2 - top = ( - #if ENABLED(USE_OCR2A_AS_TOP) - *timer.OCRnQ[0] // top = OCR2A - #else - 255 // top = 0xFF (max) - #endif - ); - } - else - top = *timer.ICRn; // top = ICRn - - _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value - } -} - -#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.cpp deleted file mode 100644 index f0f7688f1b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.cpp +++ /dev/null @@ -1,238 +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 . - * - */ - -/** - * Fast I/O for extended pins - */ - -#ifdef __AVR__ - -#include "fastio.h" - -#ifdef FASTIO_EXT_START - -#include "../shared/Marduino.h" - -#define _IS_EXT(P) WITHIN(P, FASTIO_EXT_START, FASTIO_EXT_END) - -void extDigitalWrite(const int8_t pin, const uint8_t state) { - #define _WCASE(N) case N: WRITE(N, state); break - switch (pin) { - default: digitalWrite(pin, state); - #if _IS_EXT(70) - _WCASE(70); - #endif - #if _IS_EXT(71) - _WCASE(71); - #endif - #if _IS_EXT(72) - _WCASE(72); - #endif - #if _IS_EXT(73) - _WCASE(73); - #endif - #if _IS_EXT(74) - _WCASE(74); - #endif - #if _IS_EXT(75) - _WCASE(75); - #endif - #if _IS_EXT(76) - _WCASE(76); - #endif - #if _IS_EXT(77) - _WCASE(77); - #endif - #if _IS_EXT(78) - _WCASE(78); - #endif - #if _IS_EXT(79) - _WCASE(79); - #endif - #if _IS_EXT(80) - _WCASE(80); - #endif - #if _IS_EXT(81) - _WCASE(81); - #endif - #if _IS_EXT(82) - _WCASE(82); - #endif - #if _IS_EXT(83) - _WCASE(83); - #endif - #if _IS_EXT(84) - _WCASE(84); - #endif - #if _IS_EXT(85) - _WCASE(85); - #endif - #if _IS_EXT(86) - _WCASE(86); - #endif - #if _IS_EXT(87) - _WCASE(87); - #endif - #if _IS_EXT(88) - _WCASE(88); - #endif - #if _IS_EXT(89) - _WCASE(89); - #endif - #if _IS_EXT(90) - _WCASE(90); - #endif - #if _IS_EXT(91) - _WCASE(91); - #endif - #if _IS_EXT(92) - _WCASE(92); - #endif - #if _IS_EXT(93) - _WCASE(93); - #endif - #if _IS_EXT(94) - _WCASE(94); - #endif - #if _IS_EXT(95) - _WCASE(95); - #endif - #if _IS_EXT(96) - _WCASE(96); - #endif - #if _IS_EXT(97) - _WCASE(97); - #endif - #if _IS_EXT(98) - _WCASE(98); - #endif - #if _IS_EXT(99) - _WCASE(99); - #endif - #if _IS_EXT(100) - _WCASE(100); - #endif - } -} - -uint8_t extDigitalRead(const int8_t pin) { - #define _RCASE(N) case N: return READ(N) - switch (pin) { - default: return digitalRead(pin); - #if _IS_EXT(70) - _RCASE(70); - #endif - #if _IS_EXT(71) - _RCASE(71); - #endif - #if _IS_EXT(72) - _RCASE(72); - #endif - #if _IS_EXT(73) - _RCASE(73); - #endif - #if _IS_EXT(74) - _RCASE(74); - #endif - #if _IS_EXT(75) - _RCASE(75); - #endif - #if _IS_EXT(76) - _RCASE(76); - #endif - #if _IS_EXT(77) - _RCASE(77); - #endif - #if _IS_EXT(78) - _RCASE(78); - #endif - #if _IS_EXT(79) - _RCASE(79); - #endif - #if _IS_EXT(80) - _RCASE(80); - #endif - #if _IS_EXT(81) - _RCASE(81); - #endif - #if _IS_EXT(82) - _RCASE(82); - #endif - #if _IS_EXT(83) - _RCASE(83); - #endif - #if _IS_EXT(84) - _RCASE(84); - #endif - #if _IS_EXT(85) - _RCASE(85); - #endif - #if _IS_EXT(86) - _RCASE(86); - #endif - #if _IS_EXT(87) - _RCASE(87); - #endif - #if _IS_EXT(88) - _RCASE(88); - #endif - #if _IS_EXT(89) - _RCASE(89); - #endif - #if _IS_EXT(90) - _RCASE(90); - #endif - #if _IS_EXT(91) - _RCASE(91); - #endif - #if _IS_EXT(92) - _RCASE(92); - #endif - #if _IS_EXT(93) - _RCASE(93); - #endif - #if _IS_EXT(94) - _RCASE(94); - #endif - #if _IS_EXT(95) - _RCASE(95); - #endif - #if _IS_EXT(96) - _RCASE(96); - #endif - #if _IS_EXT(97) - _RCASE(97); - #endif - #if _IS_EXT(98) - _RCASE(98); - #endif - #if _IS_EXT(99) - _RCASE(99); - #endif - #if _IS_EXT(100) - _RCASE(100); - #endif - } -} - -#endif // FASTIO_EXT_START -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.h deleted file mode 100644 index 501a7cdf06..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio.h +++ /dev/null @@ -1,356 +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 - -/** - * Fast I/O Routines for AVR - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -#include - -#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) -#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)) -#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)) -#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)) -#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)) - -/** - * Include Ports and Functions - */ -#if AVR_ATmega328_FAMILY - #include "fastio/fastio_168.h" -#elif AVR_ATmega1284_FAMILY - #include "fastio/fastio_644.h" -#elif AVR_ATmega2560_FAMILY - #include "fastio/fastio_1280.h" -#elif AVR_AT90USB1286_FAMILY - #include "fastio/fastio_AT90USB.h" -#elif AVR_ATmega2561_FAMILY - #include "fastio/fastio_1281.h" -#else - #error "No FastIO definition for the selected AVR Board." -#endif - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN) - -#define _WRITE_NC(IO,V) do{ \ - if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ - else CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \ -}while(0) - -#define _WRITE_C(IO,V) do{ \ - uint8_t port_bits = DIO ## IO ## _WPORT; /* Get a mask from the current port bits */ \ - if (V) port_bits = ~port_bits; /* For setting bits, invert the mask */ \ - DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \ -}while(0) - -#define _WRITE(IO,V) do{ if (&(DIO ## IO ## _RPORT) < (uint8_t*)0x100) _WRITE_NC(IO,V); else _WRITE_C(IO,V); }while(0) - -#define _TOGGLE(IO) (DIO ## IO ## _RPORT = _BV(DIO ## IO ## _PIN)) - -#define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) - -#define _IS_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) -#define _IS_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) - -// digitalRead/Write wrappers -#ifdef FASTIO_EXT_START - void extDigitalWrite(const int8_t pin, const uint8_t state); - uint8_t extDigitalRead(const int8_t pin); -#else - #define extDigitalWrite(IO,V) digitalWrite(IO,V) - #define extDigitalRead(IO) digitalRead(IO) -#endif - -#define READ(IO) _READ(IO) -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) - -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) - -#define SET_PWM(IO) SET_OUTPUT(IO) - -#define IS_INPUT(IO) _IS_INPUT(IO) -#define IS_OUTPUT(IO) _IS_OUTPUT(IO) - -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -/** - * Timer and Interrupt Control - */ - -// Waveform Generation Modes -enum WaveGenMode : char { - WGM_NORMAL, // 0 - WGM_PWM_PC_8, // 1 - WGM_PWM_PC_9, // 2 - WGM_PWM_PC_10, // 3 - WGM_CTC_OCRnA, // 4 COM OCnx - WGM_FAST_PWM_8, // 5 - WGM_FAST_PWM_9, // 6 - WGM_FAST_PWM_10, // 7 - WGM_PWM_PC_FC_ICRn, // 8 - WGM_PWM_PC_FC_OCRnA, // 9 COM OCnA - WGM_PWM_PC_ICRn, // 10 - WGM_PWM_PC_OCRnA, // 11 COM OCnA - WGM_CTC_ICRn, // 12 COM OCnx - WGM_reserved, // 13 - WGM_FAST_PWM_ICRn, // 14 COM OCnA - WGM_FAST_PWM_OCRnA // 15 COM OCnA -}; - -// Wavefore Generation Modes (Timer 2 only) -enum WaveGenMode2 : char { - WGM2_NORMAL, // 0 - WGM2_PWM_PC, // 1 - WGM2_CTC_OCR2A, // 2 - WGM2_FAST_PWM, // 3 - WGM2_reserved_1, // 4 - WGM2_PWM_PC_OCR2A, // 5 - WGM2_reserved_2, // 6 - WGM2_FAST_PWM_OCR2A, // 7 -}; - -// Compare Modes -enum CompareMode : char { - COM_NORMAL, // 0 - COM_TOGGLE, // 1 Non-PWM: OCnx ... Both PWM (WGM 9,11,14,15): OCnA only ... else NORMAL - COM_CLEAR_SET, // 2 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down - COM_SET_CLEAR // 3 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down -}; - -// Clock Sources -enum ClockSource : char { - CS_NONE, // 0 - CS_PRESCALER_1, // 1 - CS_PRESCALER_8, // 2 - CS_PRESCALER_64, // 3 - CS_PRESCALER_256, // 4 - CS_PRESCALER_1024, // 5 - CS_EXT_FALLING, // 6 - CS_EXT_RISING // 7 -}; - -// Clock Sources (Timer 2 only) -enum ClockSource2 : char { - CS2_NONE, // 0 - CS2_PRESCALER_1, // 1 - CS2_PRESCALER_8, // 2 - CS2_PRESCALER_32, // 3 - CS2_PRESCALER_64, // 4 - CS2_PRESCALER_128, // 5 - CS2_PRESCALER_256, // 6 - CS2_PRESCALER_1024 // 7 -}; - -// Get interrupt bits in an orderly way -// Ex: cs = GET_CS(0); coma1 = GET_COM(A,1); -#define GET_WGM(T) (((TCCR##T##A >> WGM##T##0) & 0x3) | ((TCCR##T##B >> WGM##T##2 << 2) & 0xC)) -#define GET_CS(T) ((TCCR##T##B >> CS##T##0) & 0x7) -#define GET_COM(T,Q) ((TCCR##T##Q >> COM##T##Q##0) & 0x3) -#define GET_COMA(T) GET_COM(T,A) -#define GET_COMB(T) GET_COM(T,B) -#define GET_COMC(T) GET_COM(T,C) -#define GET_ICNC(T) (!!(TCCR##T##B & _BV(ICNC##T))) -#define GET_ICES(T) (!!(TCCR##T##B & _BV(ICES##T))) -#define GET_FOC(T,Q) (!!(TCCR##T##C & _BV(FOC##T##Q))) -#define GET_FOCA(T) GET_FOC(T,A) -#define GET_FOCB(T) GET_FOC(T,B) -#define GET_FOCC(T) GET_FOC(T,C) - -// Set Wave Generation Mode bits -// Ex: SET_WGM(5,CTC_ICRn); -#define _SET_WGM(T,V) do{ \ - TCCR##T##A = (TCCR##T##A & ~(0x3 << WGM##T##0)) | (( int(V) & 0x3) << WGM##T##0); \ - TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \ - }while(0) -#define SET_WGM(T,V) _SET_WGM(T,WGM_##V) -// Runtime (see set_pwm_frequency): -#define _SET_WGMnQ(TCCRnQ, V) do{ \ - *(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << 0)) | (( int(V) & 0x3) << 0); \ - *(TCCRnQ)[1] = (*(TCCRnQ)[1] & ~(0x3 << 3)) | (((int(V) >> 2) & 0x3) << 3); \ - }while(0) - -// Set Clock Select bits -// Ex: SET_CS3(PRESCALER_64); -#define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0)) -#define _SET_CS0(V) _SET_CS(0,V) -#define _SET_CS1(V) _SET_CS(1,V) -#ifdef TCCR2 - #define _SET_CS2(V) (TCCR2 = (TCCR2 & ~(0x7 << CS20)) | (int(V) << CS20)) -#else - #define _SET_CS2(V) _SET_CS(2,V) -#endif -#define _SET_CS3(V) _SET_CS(3,V) -#define _SET_CS4(V) _SET_CS(4,V) -#define _SET_CS5(V) _SET_CS(5,V) -#define SET_CS0(V) _SET_CS0(CS_##V) -#define SET_CS1(V) _SET_CS1(CS_##V) -#ifdef TCCR2 - #define SET_CS2(V) _SET_CS2(CS2_##V) -#else - #define SET_CS2(V) _SET_CS2(CS_##V) -#endif -#define SET_CS3(V) _SET_CS3(CS_##V) -#define SET_CS4(V) _SET_CS4(CS_##V) -#define SET_CS5(V) _SET_CS5(CS_##V) -#define SET_CS(T,V) SET_CS##T(V) -// Runtime (see set_pwm_frequency) -#define _SET_CSn(TCCRnQ, V) do{ \ - (*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)); \ - }while(0) - -// Set Compare Mode bits -// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET); -#define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0)) -#define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V) -#define SET_COMA(T,V) SET_COM(T,A,V) -#define SET_COMB(T,V) SET_COM(T,B,V) -#define SET_COMC(T,V) SET_COM(T,C,V) -#define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0) -// Runtime (see set_pwm_duty) -#define _SET_COMnQ(TCCRnQ, Q, V) do{ \ - (*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))); \ - }while(0) - -// Set OCRnQ register -// Runtime (see set_pwm_duty): -#define _SET_OCRnQ(OCRnQ, Q, V) do{ \ - (*(OCRnQ)[(Q)] = (0x0000) | (int(V) & 0xFFFF)); \ - }while(0) - -// Set ICRn register (one per timer) -// Runtime (see set_pwm_frequency) -#define _SET_ICRn(ICRn, V) do{ \ - (*(ICRn) = (0x0000) | (int(V) & 0xFFFF)); \ - }while(0) - -// Set Noise Canceler bit -// Ex: SET_ICNC(2,1) -#define SET_ICNC(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICNC##T) : TCCR##T##B & ~_BV(ICNC##T)) - -// Set Input Capture Edge Select bit -// Ex: SET_ICES(5,0) -#define SET_ICES(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICES##T) : TCCR##T##B & ~_BV(ICES##T)) - -// Set Force Output Compare bit -// Ex: SET_FOC(3,A,1) -#define SET_FOC(T,Q,V) (TCCR##T##C = (V) ? TCCR##T##C | _BV(FOC##T##Q) : TCCR##T##C & ~_BV(FOC##T##Q)) -#define SET_FOCA(T,V) SET_FOC(T,A,V) -#define SET_FOCB(T,V) SET_FOC(T,B,V) -#define SET_FOCC(T,V) SET_FOC(T,C,V) - -#if 0 - -/** - * PWM availability macros - */ - -// Determine which harware PWMs are already in use -#if PIN_EXISTS(CONTROLLER_FAN) - #define PWM_CHK_FAN_B(P) (P == CONTROLLER_FAN_PIN || P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN) -#else - #define PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN) -#endif - -#if ANY_PIN(FAN, FAN1, FAN2) - #if PIN_EXISTS(FAN2) - #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN) - #elif PIN_EXISTS(FAN1) - #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN) - #else - #define PWM_CHK_FAN_A(P) (P == FAN0_PIN) - #endif -#else - #define PWM_CHK_FAN_A(P) false -#endif - -#if HAS_MOTOR_CURRENT_PWM - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY) - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z) - #else - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E) - #endif -#else - #define PWM_CHK_MOTOR_CURRENT(P) false -#endif - -#ifdef NUM_SERVOS - #if AVR_ATmega2560_FAMILY - #define PWM_CHK_SERVO(P) (P == 5 || (NUM_SERVOS > 12 && P == 6) || (NUM_SERVOS > 24 && P == 46)) // PWMS 3A, 4A & 5A - #elif AVR_ATmega2561_FAMILY - #define PWM_CHK_SERVO(P) (P == 5) // PWM3A - #elif AVR_ATmega1284_FAMILY - #define PWM_CHK_SERVO(P) false - #elif AVR_AT90USB1286_FAMILY - #define PWM_CHK_SERVO(P) (P == 16) // PWM3A - #elif AVR_ATmega328_FAMILY - #define PWM_CHK_SERVO(P) false - #endif -#else - #define PWM_CHK_SERVO(P) false -#endif - -#if ENABLED(BARICUDA) - #if HAS_HEATER_1 && HAS_HEATER_2 - #define PWM_CHK_HEATER(P) (P == HEATER_1_PIN || P == HEATER_2_PIN) - #elif HAS_HEATER_1 - #define PWM_CHK_HEATER(P) (P == HEATER_1_PIN) - #endif -#else - #define PWM_CHK_HEATER(P) false -#endif - -#define PWM_CHK(P) (PWM_CHK_HEATER(P) || PWM_CHK_SERVO(P) || PWM_CHK_MOTOR_CURRENT(P) || PWM_CHK_FAN_A(P) || PWM_CHK_FAN_B(P)) - -#endif // PWM_CHK is not used in Marlin - -// define which hardware PWMs are available for the current CPU -// all timer 1 PWMS deleted from this list because they are never available -#if AVR_ATmega2560_FAMILY - #define PWM_PIN(P) ((P >= 2 && P <= 10) || P == 13 || P == 44 || P == 45 || P == 46) -#elif AVR_ATmega2561_FAMILY - #define PWM_PIN(P) ((P >= 2 && P <= 6) || P == 9) -#elif AVR_ATmega1284_FAMILY - #define PWM_PIN(P) (P == 3 || P == 4 || P == 14 || P == 15) -#elif AVR_AT90USB1286_FAMILY - #define PWM_PIN(P) (P == 0 || P == 1 || P == 14 || P == 15 || P == 16 || P == 24) -#elif AVR_ATmega328_FAMILY - #define PWM_PIN(P) (P == 3 || P == 5 || P == 6 || P == 11) -#else - #error "unknown CPU" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h deleted file mode 100644 index 62de534d53..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h +++ /dev/null @@ -1,1114 +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 - -/** - * Pin mapping for the 1280 and 2560 - * - * Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 | 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100 - * Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx - * 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.h" - -// change for your board -#define DEBUG_LED DIO21 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO52 -#define MISO DIO50 -#define MOSI DIO51 -#define SS DIO53 - -// TWI (I2C) -#define SCL DIO21 -#define SDA DIO20 - -// Timers and PWM -#define OC0A DIO13 -#define OC0B DIO4 -#define OC1A DIO11 -#define OC1B DIO12 -#define OC2A DIO10 -#define OC2B DIO9 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 -#define OC4A DIO6 -#define OC4B DIO7 -#define OC4C DIO8 -#define OC5A DIO46 -#define OC5B DIO45 -#define OC5C DIO44 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM nullptr - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM nullptr - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINH3 -#define DIO6_RPORT PINH -#define DIO6_WPORT PORTH -#define DIO6_DDR DDRH -#define DIO6_PWM &OCR4AL - -#define DIO7_PIN PINH4 -#define DIO7_RPORT PINH -#define DIO7_WPORT PORTH -#define DIO7_DDR DDRH -#define DIO7_PWM &OCR4BL - -#define DIO8_PIN PINH5 -#define DIO8_RPORT PINH -#define DIO8_WPORT PORTH -#define DIO8_DDR DDRH -#define DIO8_PWM &OCR4CL - -#define DIO9_PIN PINH6 -#define DIO9_RPORT PINH -#define DIO9_WPORT PORTH -#define DIO9_DDR DDRH -#define DIO9_PWM &OCR2B - -#define DIO10_PIN PINB4 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM &OCR2A - -#define DIO11_PIN PINB5 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM nullptr - -#define DIO12_PIN PINB6 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM nullptr - -#define DIO13_PIN PINB7 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM &OCR0A - -#define DIO14_PIN PINJ1 -#define DIO14_RPORT PINJ -#define DIO14_WPORT PORTJ -#define DIO14_DDR DDRJ -#define DIO14_PWM nullptr - -#define DIO15_PIN PINJ0 -#define DIO15_RPORT PINJ -#define DIO15_WPORT PORTJ -#define DIO15_DDR DDRJ -#define DIO15_PWM nullptr - -#define DIO16_PIN PINH1 -#define DIO16_RPORT PINH -#define DIO16_WPORT PORTH -#define DIO16_DDR DDRH -#define DIO16_PWM nullptr - -#define DIO17_PIN PINH0 -#define DIO17_RPORT PINH -#define DIO17_WPORT PORTH -#define DIO17_DDR DDRH -#define DIO17_PWM nullptr - -#define DIO18_PIN PIND3 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM nullptr - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM nullptr - -#define DIO20_PIN PIND1 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM nullptr - -#define DIO21_PIN PIND0 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM nullptr - -#define DIO22_PIN PINA0 -#define DIO22_RPORT PINA -#define DIO22_WPORT PORTA -#define DIO22_DDR DDRA -#define DIO22_PWM nullptr - -#define DIO23_PIN PINA1 -#define DIO23_RPORT PINA -#define DIO23_WPORT PORTA -#define DIO23_DDR DDRA -#define DIO23_PWM nullptr - -#define DIO24_PIN PINA2 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM nullptr - -#define DIO25_PIN PINA3 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM nullptr - -#define DIO26_PIN PINA4 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM nullptr - -#define DIO27_PIN PINA5 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM nullptr - -#define DIO28_PIN PINA6 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM nullptr - -#define DIO29_PIN PINA7 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM nullptr - -#define DIO30_PIN PINC7 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM nullptr - -#define DIO31_PIN PINC6 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM nullptr - -#define DIO32_PIN PINC5 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM nullptr - -#define DIO33_PIN PINC4 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM nullptr - -#define DIO34_PIN PINC3 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM nullptr - -#define DIO35_PIN PINC2 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM nullptr - -#define DIO36_PIN PINC1 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM nullptr - -#define DIO37_PIN PINC0 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM nullptr - -#define DIO38_PIN PIND7 -#define DIO38_RPORT PIND -#define DIO38_WPORT PORTD -#define DIO38_DDR DDRD -#define DIO38_PWM nullptr - -#define DIO39_PIN PING2 -#define DIO39_RPORT PING -#define DIO39_WPORT PORTG -#define DIO39_DDR DDRG -#define DIO39_PWM nullptr - -#define DIO40_PIN PING1 -#define DIO40_RPORT PING -#define DIO40_WPORT PORTG -#define DIO40_DDR DDRG -#define DIO40_PWM nullptr - -#define DIO41_PIN PING0 -#define DIO41_RPORT PING -#define DIO41_WPORT PORTG -#define DIO41_DDR DDRG -#define DIO41_PWM nullptr - -#define DIO42_PIN PINL7 -#define DIO42_RPORT PINL -#define DIO42_WPORT PORTL -#define DIO42_DDR DDRL -#define DIO42_PWM nullptr - -#define DIO43_PIN PINL6 -#define DIO43_RPORT PINL -#define DIO43_WPORT PORTL -#define DIO43_DDR DDRL -#define DIO43_PWM nullptr - -#define DIO44_PIN PINL5 -#define DIO44_RPORT PINL -#define DIO44_WPORT PORTL -#define DIO44_DDR DDRL -#define DIO44_PWM &OCR5CL - -#define DIO45_PIN PINL4 -#define DIO45_RPORT PINL -#define DIO45_WPORT PORTL -#define DIO45_DDR DDRL -#define DIO45_PWM &OCR5BL - -#define DIO46_PIN PINL3 -#define DIO46_RPORT PINL -#define DIO46_WPORT PORTL -#define DIO46_DDR DDRL -#define DIO46_PWM &OCR5AL - -#define DIO47_PIN PINL2 -#define DIO47_RPORT PINL -#define DIO47_WPORT PORTL -#define DIO47_DDR DDRL -#define DIO47_PWM nullptr - -#define DIO48_PIN PINL1 -#define DIO48_RPORT PINL -#define DIO48_WPORT PORTL -#define DIO48_DDR DDRL -#define DIO48_PWM nullptr - -#define DIO49_PIN PINL0 -#define DIO49_RPORT PINL -#define DIO49_WPORT PORTL -#define DIO49_DDR DDRL -#define DIO49_PWM nullptr - -#define DIO50_PIN PINB3 -#define DIO50_RPORT PINB -#define DIO50_WPORT PORTB -#define DIO50_DDR DDRB -#define DIO50_PWM nullptr - -#define DIO51_PIN PINB2 -#define DIO51_RPORT PINB -#define DIO51_WPORT PORTB -#define DIO51_DDR DDRB -#define DIO51_PWM nullptr - -#define DIO52_PIN PINB1 -#define DIO52_RPORT PINB -#define DIO52_WPORT PORTB -#define DIO52_DDR DDRB -#define DIO52_PWM nullptr - -#define DIO53_PIN PINB0 -#define DIO53_RPORT PINB -#define DIO53_WPORT PORTB -#define DIO53_DDR DDRB -#define DIO53_PWM nullptr - -#define DIO54_PIN PINF0 -#define DIO54_RPORT PINF -#define DIO54_WPORT PORTF -#define DIO54_DDR DDRF -#define DIO54_PWM nullptr - -#define DIO55_PIN PINF1 -#define DIO55_RPORT PINF -#define DIO55_WPORT PORTF -#define DIO55_DDR DDRF -#define DIO55_PWM nullptr - -#define DIO56_PIN PINF2 -#define DIO56_RPORT PINF -#define DIO56_WPORT PORTF -#define DIO56_DDR DDRF -#define DIO56_PWM nullptr - -#define DIO57_PIN PINF3 -#define DIO57_RPORT PINF -#define DIO57_WPORT PORTF -#define DIO57_DDR DDRF -#define DIO57_PWM nullptr - -#define DIO58_PIN PINF4 -#define DIO58_RPORT PINF -#define DIO58_WPORT PORTF -#define DIO58_DDR DDRF -#define DIO58_PWM nullptr - -#define DIO59_PIN PINF5 -#define DIO59_RPORT PINF -#define DIO59_WPORT PORTF -#define DIO59_DDR DDRF -#define DIO59_PWM nullptr - -#define DIO60_PIN PINF6 -#define DIO60_RPORT PINF -#define DIO60_WPORT PORTF -#define DIO60_DDR DDRF -#define DIO60_PWM nullptr - -#define DIO61_PIN PINF7 -#define DIO61_RPORT PINF -#define DIO61_WPORT PORTF -#define DIO61_DDR DDRF -#define DIO61_PWM nullptr - -#define DIO62_PIN PINK0 -#define DIO62_RPORT PINK -#define DIO62_WPORT PORTK -#define DIO62_DDR DDRK -#define DIO62_PWM nullptr - -#define DIO63_PIN PINK1 -#define DIO63_RPORT PINK -#define DIO63_WPORT PORTK -#define DIO63_DDR DDRK -#define DIO63_PWM nullptr - -#define DIO64_PIN PINK2 -#define DIO64_RPORT PINK -#define DIO64_WPORT PORTK -#define DIO64_DDR DDRK -#define DIO64_PWM nullptr - -#define DIO65_PIN PINK3 -#define DIO65_RPORT PINK -#define DIO65_WPORT PORTK -#define DIO65_DDR DDRK -#define DIO65_PWM nullptr - -#define DIO66_PIN PINK4 -#define DIO66_RPORT PINK -#define DIO66_WPORT PORTK -#define DIO66_DDR DDRK -#define DIO66_PWM nullptr - -#define DIO67_PIN PINK5 -#define DIO67_RPORT PINK -#define DIO67_WPORT PORTK -#define DIO67_DDR DDRK -#define DIO67_PWM nullptr - -#define DIO68_PIN PINK6 -#define DIO68_RPORT PINK -#define DIO68_WPORT PORTK -#define DIO68_DDR DDRK -#define DIO68_PWM nullptr - -#define DIO69_PIN PINK7 -#define DIO69_RPORT PINK -#define DIO69_WPORT PORTK -#define DIO69_DDR DDRK -#define DIO69_PWM nullptr - -//#define FASTIO_EXT_START 70 -//#define FASTIO_EXT_END 85 - -#define DIO70_PIN PING4 -#define DIO70_RPORT PING -#define DIO70_WPORT PORTG -#define DIO70_DDR DDRG -#define DIO70_PWM nullptr - -#define DIO71_PIN PING3 -#define DIO71_RPORT PING -#define DIO71_WPORT PORTG -#define DIO71_DDR DDRG -#define DIO71_PWM nullptr - -#define DIO72_PIN PINJ2 -#define DIO72_RPORT PINJ -#define DIO72_WPORT PORTJ -#define DIO72_DDR DDRJ -#define DIO72_PWM nullptr - -#define DIO73_PIN PINJ3 -#define DIO73_RPORT PINJ -#define DIO73_WPORT PORTJ -#define DIO73_DDR DDRJ -#define DIO73_PWM nullptr - -#define DIO74_PIN PINJ7 -#define DIO74_RPORT PINJ -#define DIO74_WPORT PORTJ -#define DIO74_DDR DDRJ -#define DIO74_PWM nullptr - -#define DIO75_PIN PINJ4 -#define DIO75_RPORT PINJ -#define DIO75_WPORT PORTJ -#define DIO75_DDR DDRJ -#define DIO75_PWM nullptr - -#define DIO76_PIN PINJ5 -#define DIO76_RPORT PINJ -#define DIO76_WPORT PORTJ -#define DIO76_DDR DDRJ -#define DIO76_PWM nullptr - -#define DIO77_PIN PINJ6 -#define DIO77_RPORT PINJ -#define DIO77_WPORT PORTJ -#define DIO77_DDR DDRJ -#define DIO77_PWM nullptr - -#define DIO78_PIN PINE2 -#define DIO78_RPORT PINE -#define DIO78_WPORT PORTE -#define DIO78_DDR DDRE -#define DIO78_PWM nullptr - -#define DIO79_PIN PINE6 -#define DIO79_RPORT PINE -#define DIO79_WPORT PORTE -#define DIO79_DDR DDRE -#define DIO79_PWM nullptr - -#define DIO80_PIN PINE7 -#define DIO80_RPORT PINE -#define DIO80_WPORT PORTE -#define DIO80_DDR DDRE -#define DIO80_PWM nullptr - -#define DIO81_PIN PIND4 -#define DIO81_RPORT PIND -#define DIO81_WPORT PORTD -#define DIO81_DDR DDRD -#define DIO81_PWM nullptr - -#define DIO82_PIN PIND5 -#define DIO82_RPORT PIND -#define DIO82_WPORT PORTD -#define DIO82_DDR DDRD -#define DIO82_PWM nullptr - -#define DIO83_PIN PIND6 -#define DIO83_RPORT PIND -#define DIO83_WPORT PORTD -#define DIO83_DDR DDRD -#define DIO83_PWM nullptr - -#define DIO84_PIN PINH2 -#define DIO84_RPORT PINH -#define DIO84_WPORT PORTH -#define DIO84_DDR DDRH -#define DIO84_PWM nullptr - -#define DIO85_PIN PINH7 -#define DIO85_RPORT PINH -#define DIO85_WPORT PORTH -#define DIO85_DDR DDRH -#define DIO85_PWM nullptr - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM nullptr -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM nullptr -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM nullptr -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM nullptr -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM nullptr -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM nullptr -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM nullptr -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM nullptr - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM nullptr -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM nullptr -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM nullptr -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM nullptr -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM nullptr -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM nullptr -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM nullptr -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM nullptr -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM nullptr -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM nullptr -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM nullptr -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM nullptr -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM nullptr -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM nullptr - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM nullptr -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM nullptr -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM nullptr -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM nullptr -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM nullptr -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM nullptr -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM nullptr -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM nullptr - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM nullptr -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM nullptr -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM nullptr -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM nullptr -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM nullptr - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM nullptr -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM nullptr -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM nullptr -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM nullptr -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM nullptr -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM nullptr -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM nullptr -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM nullptr - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM nullptr -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM nullptr -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM nullptr -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM nullptr -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM nullptr -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B - -#undef PH0 -#define PH0_PIN PINH0 -#define PH0_RPORT PINH -#define PH0_WPORT PORTH -#define PH0_DDR DDRH -#define PH0_PWM nullptr -#undef PH1 -#define PH1_PIN PINH1 -#define PH1_RPORT PINH -#define PH1_WPORT PORTH -#define PH1_DDR DDRH -#define PH1_PWM nullptr -#undef PH2 -#define PH2_PIN PINH2 -#define PH2_RPORT PINH -#define PH2_WPORT PORTH -#define PH2_DDR DDRH -#define PH2_PWM nullptr -#undef PH3 -#define PH3_PIN PINH3 -#define PH3_RPORT PINH -#define PH3_WPORT PORTH -#define PH3_DDR DDRH -#define PH3_PWM &OCR4AL -#undef PH4 -#define PH4_PIN PINH4 -#define PH4_RPORT PINH -#define PH4_WPORT PORTH -#define PH4_DDR DDRH -#define PH4_PWM &OCR4BL -#undef PH5 -#define PH5_PIN PINH5 -#define PH5_RPORT PINH -#define PH5_WPORT PORTH -#define PH5_DDR DDRH -#define PH5_PWM &OCR4CL -#undef PH6 -#define PH6_PIN PINH6 -#define PH6_RPORT PINH -#define PH6_WPORT PORTH -#define PH6_DDR DDRH -#define PH6_PWM &OCR2B -#undef PH7 -#define PH7_PIN PINH7 -#define PH7_RPORT PINH -#define PH7_WPORT PORTH -#define PH7_DDR DDRH -#define PH7_PWM nullptr - -#undef PJ0 -#define PJ0_PIN PINJ0 -#define PJ0_RPORT PINJ -#define PJ0_WPORT PORTJ -#define PJ0_DDR DDRJ -#define PJ0_PWM nullptr -#undef PJ1 -#define PJ1_PIN PINJ1 -#define PJ1_RPORT PINJ -#define PJ1_WPORT PORTJ -#define PJ1_DDR DDRJ -#define PJ1_PWM nullptr -#undef PJ2 -#define PJ2_PIN PINJ2 -#define PJ2_RPORT PINJ -#define PJ2_WPORT PORTJ -#define PJ2_DDR DDRJ -#define PJ2_PWM nullptr -#undef PJ3 -#define PJ3_PIN PINJ3 -#define PJ3_RPORT PINJ -#define PJ3_WPORT PORTJ -#define PJ3_DDR DDRJ -#define PJ3_PWM nullptr -#undef PJ4 -#define PJ4_PIN PINJ4 -#define PJ4_RPORT PINJ -#define PJ4_WPORT PORTJ -#define PJ4_DDR DDRJ -#define PJ4_PWM nullptr -#undef PJ5 -#define PJ5_PIN PINJ5 -#define PJ5_RPORT PINJ -#define PJ5_WPORT PORTJ -#define PJ5_DDR DDRJ -#define PJ5_PWM nullptr -#undef PJ6 -#define PJ6_PIN PINJ6 -#define PJ6_RPORT PINJ -#define PJ6_WPORT PORTJ -#define PJ6_DDR DDRJ -#define PJ6_PWM nullptr -#undef PJ7 -#define PJ7_PIN PINJ7 -#define PJ7_RPORT PINJ -#define PJ7_WPORT PORTJ -#define PJ7_DDR DDRJ -#define PJ7_PWM nullptr - -#undef PK0 -#define PK0_PIN PINK0 -#define PK0_RPORT PINK -#define PK0_WPORT PORTK -#define PK0_DDR DDRK -#define PK0_PWM nullptr -#undef PK1 -#define PK1_PIN PINK1 -#define PK1_RPORT PINK -#define PK1_WPORT PORTK -#define PK1_DDR DDRK -#define PK1_PWM nullptr -#undef PK2 -#define PK2_PIN PINK2 -#define PK2_RPORT PINK -#define PK2_WPORT PORTK -#define PK2_DDR DDRK -#define PK2_PWM nullptr -#undef PK3 -#define PK3_PIN PINK3 -#define PK3_RPORT PINK -#define PK3_WPORT PORTK -#define PK3_DDR DDRK -#define PK3_PWM nullptr -#undef PK4 -#define PK4_PIN PINK4 -#define PK4_RPORT PINK -#define PK4_WPORT PORTK -#define PK4_DDR DDRK -#define PK4_PWM nullptr -#undef PK5 -#define PK5_PIN PINK5 -#define PK5_RPORT PINK -#define PK5_WPORT PORTK -#define PK5_DDR DDRK -#define PK5_PWM nullptr -#undef PK6 -#define PK6_PIN PINK6 -#define PK6_RPORT PINK -#define PK6_WPORT PORTK -#define PK6_DDR DDRK -#define PK6_PWM nullptr -#undef PK7 -#define PK7_PIN PINK7 -#define PK7_RPORT PINK -#define PK7_WPORT PORTK -#define PK7_DDR DDRK -#define PK7_PWM nullptr - -#undef PL0 -#define PL0_PIN PINL0 -#define PL0_RPORT PINL -#define PL0_WPORT PORTL -#define PL0_DDR DDRL -#define PL0_PWM nullptr -#undef PL1 -#define PL1_PIN PINL1 -#define PL1_RPORT PINL -#define PL1_WPORT PORTL -#define PL1_DDR DDRL -#define PL1_PWM nullptr -#undef PL2 -#define PL2_PIN PINL2 -#define PL2_RPORT PINL -#define PL2_WPORT PORTL -#define PL2_DDR DDRL -#define PL2_PWM nullptr -#undef PL3 -#define PL3_PIN PINL3 -#define PL3_RPORT PINL -#define PL3_WPORT PORTL -#define PL3_DDR DDRL -#define PL3_PWM &OCR5AL -#undef PL4 -#define PL4_PIN PINL4 -#define PL4_RPORT PINL -#define PL4_WPORT PORTL -#define PL4_DDR DDRL -#define PL4_PWM &OCR5BL -#undef PL5 -#define PL5_PIN PINL5 -#define PL5_RPORT PINL -#define PL5_WPORT PORTL -#define PL5_DDR DDRL -#define PL5_PWM &OCR5CL -#undef PL6 -#define PL6_PIN PINL6 -#define PL6_RPORT PINL -#define PL6_WPORT PORTL -#define PL6_DDR DDRL -#define PL6_PWM nullptr -#undef PL7 -#define PL7_PIN PINL7 -#define PL7_RPORT PINL -#define PL7_WPORT PORTL -#define PL7_DDR DDRL -#define PL7_PWM nullptr diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h deleted file mode 100644 index e3d2f12851..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h +++ /dev/null @@ -1,715 +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 - -/** - * Pin mapping for the 1281 and 2561 - * - * Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04 - * 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.h" - -// change for your board -#define DEBUG_LED DIO46 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO10 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO16 - -// TWI (I2C) -#define SCL DIO17 -#define SDA DIO18 - -// Timers and PWM -#define OC0A DIO9 -#define OC0B DIO4 -#define OC1A DIO7 -#define OC1B DIO8 -#define OC2A DIO6 -#define OC3A DIO5 -#define OC3B DIO2 -#define OC3C DIO3 - -// Digital I/O - -#define DIO0_PIN PINE0 -#define DIO0_RPORT PINE -#define DIO0_WPORT PORTE -#define DIO0_DDR DDRE -#define DIO0_PWM nullptr - -#define DIO1_PIN PINE1 -#define DIO1_RPORT PINE -#define DIO1_WPORT PORTE -#define DIO1_DDR DDRE -#define DIO1_PWM nullptr - -#define DIO2_PIN PINE4 -#define DIO2_RPORT PINE -#define DIO2_WPORT PORTE -#define DIO2_DDR DDRE -#define DIO2_PWM &OCR3BL - -#define DIO3_PIN PINE5 -#define DIO3_RPORT PINE -#define DIO3_WPORT PORTE -#define DIO3_DDR DDRE -#define DIO3_PWM &OCR3CL - -#define DIO4_PIN PING5 -#define DIO4_RPORT PING -#define DIO4_WPORT PORTG -#define DIO4_DDR DDRG -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINE3 -#define DIO5_RPORT PINE -#define DIO5_WPORT PORTE -#define DIO5_DDR DDRE -#define DIO5_PWM &OCR3AL - -#define DIO6_PIN PINB4 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM &OCR2AL - -#define DIO7_PIN PINB5 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM &OCR1AL - -#define DIO8_PIN PINB6 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM &OCR1BL - -#define DIO9_PIN PINB7 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM &OCR0AL - -#define DIO10_PIN PINB1 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM nullptr - -#define DIO11_PIN PINB2 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM nullptr - -#define DIO12_PIN PINB3 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM nullptr - -#define DIO13_PIN PINE2 -#define DIO13_RPORT PINE -#define DIO13_WPORT PORTE -#define DIO13_DDR DDRE -#define DIO13_PWM nullptr - -#define DIO14_PIN PINE6 -#define DIO14_RPORT PINE -#define DIO14_WPORT PORTE -#define DIO14_DDR DDRE -#define DIO14_PWM nullptr - -#define DIO15_PIN PINE7 -#define DIO15_RPORT PINE -#define DIO15_WPORT PORTE -#define DIO15_DDR DDRE -#define DIO15_PWM nullptr - -#define DIO16_PIN PINB0 -#define DIO16_RPORT PINB -#define DIO16_WPORT PORTB -#define DIO16_DDR DDRB -#define DIO16_PWM nullptr - -#define DIO17_PIN PIND0 -#define DIO17_RPORT PIND -#define DIO17_WPORT PORTD -#define DIO17_DDR DDRD -#define DIO17_PWM nullptr - -#define DIO18_PIN PIND1 -#define DIO18_RPORT PIND -#define DIO18_WPORT PORTD -#define DIO18_DDR DDRD -#define DIO18_PWM nullptr - -#define DIO19_PIN PIND2 -#define DIO19_RPORT PIND -#define DIO19_WPORT PORTD -#define DIO19_DDR DDRD -#define DIO19_PWM nullptr - -#define DIO20_PIN PIND3 -#define DIO20_RPORT PIND -#define DIO20_WPORT PORTD -#define DIO20_DDR DDRD -#define DIO20_PWM nullptr - -#define DIO21_PIN PIND4 -#define DIO21_RPORT PIND -#define DIO21_WPORT PORTD -#define DIO21_DDR DDRD -#define DIO21_PWM nullptr - -#define DIO22_PIN PIND5 -#define DIO22_RPORT PIND -#define DIO22_WPORT PORTD -#define DIO22_DDR DDRD -#define DIO22_PWM nullptr - -#define DIO23_PIN PIND6 -#define DIO23_RPORT PIND -#define DIO23_WPORT PORTD -#define DIO23_DDR DDRD -#define DIO23_PWM nullptr - -#define DIO24_PIN PIND7 -#define DIO24_RPORT PIND -#define DIO24_WPORT PORTD -#define DIO24_DDR DDRD -#define DIO24_PWM nullptr - -#define DIO25_PIN PING0 -#define DIO25_RPORT PING -#define DIO25_WPORT PORTG -#define DIO25_DDR DDRG -#define DIO25_PWM nullptr - -#define DIO26_PIN PING1 -#define DIO26_RPORT PING -#define DIO26_WPORT PORTG -#define DIO26_DDR DDRG -#define DIO26_PWM nullptr - -#define DIO27_PIN PING2 -#define DIO27_RPORT PING -#define DIO27_WPORT PORTG -#define DIO27_DDR DDRG -#define DIO27_PWM nullptr - -#define DIO28_PIN PING3 -#define DIO28_RPORT PING -#define DIO28_WPORT PORTG -#define DIO28_DDR DDRG -#define DIO28_PWM nullptr - -#define DIO29_PIN PING4 -#define DIO29_RPORT PING -#define DIO29_WPORT PORTG -#define DIO29_DDR DDRG -#define DIO29_PWM nullptr - -#define DIO30_PIN PINC0 -#define DIO30_RPORT PINC -#define DIO30_WPORT PORTC -#define DIO30_DDR DDRC -#define DIO30_PWM nullptr - -#define DIO31_PIN PINC1 -#define DIO31_RPORT PINC -#define DIO31_WPORT PORTC -#define DIO31_DDR DDRC -#define DIO31_PWM nullptr - -#define DIO32_PIN PINC2 -#define DIO32_RPORT PINC -#define DIO32_WPORT PORTC -#define DIO32_DDR DDRC -#define DIO32_PWM nullptr - -#define DIO33_PIN PINC3 -#define DIO33_RPORT PINC -#define DIO33_WPORT PORTC -#define DIO33_DDR DDRC -#define DIO33_PWM nullptr - -#define DIO34_PIN PINC4 -#define DIO34_RPORT PINC -#define DIO34_WPORT PORTC -#define DIO34_DDR DDRC -#define DIO34_PWM nullptr - -#define DIO35_PIN PINC5 -#define DIO35_RPORT PINC -#define DIO35_WPORT PORTC -#define DIO35_DDR DDRC -#define DIO35_PWM nullptr - -#define DIO36_PIN PINC6 -#define DIO36_RPORT PINC -#define DIO36_WPORT PORTC -#define DIO36_DDR DDRC -#define DIO36_PWM nullptr - -#define DIO37_PIN PINC7 -#define DIO37_RPORT PINC -#define DIO37_WPORT PORTC -#define DIO37_DDR DDRC -#define DIO37_PWM nullptr - -#define DIO38_PIN PINA0 -#define DIO38_RPORT PINA -#define DIO38_WPORT PORTA -#define DIO38_DDR DDRA -#define DIO38_PWM nullptr - -#define DIO39_PIN PINA1 -#define DIO39_RPORT PINA -#define DIO39_WPORT PORTA -#define DIO39_DDR DDRA -#define DIO39_PWM nullptr - -#define DIO40_PIN PINA2 -#define DIO40_RPORT PINA -#define DIO40_WPORT PORTA -#define DIO40_DDR DDRA -#define DIO40_PWM nullptr - -#define DIO41_PIN PINA3 -#define DIO41_RPORT PINA -#define DIO41_WPORT PORTA -#define DIO41_DDR DDRA -#define DIO41_PWM nullptr - -#define DIO42_PIN PINA4 -#define DIO42_RPORT PINA -#define DIO42_WPORT PORTA -#define DIO42_DDR DDRA -#define DIO42_PWM nullptr - -#define DIO43_PIN PINA5 -#define DIO43_RPORT PINA -#define DIO43_WPORT PORTA -#define DIO43_DDR DDRA -#define DIO43_PWM nullptr - -#define DIO44_PIN PINA6 -#define DIO44_RPORT PINA -#define DIO44_WPORT PORTA -#define DIO44_DDR DDRA -#define DIO44_PWM nullptr - -#define DIO45_PIN PINA7 -#define DIO45_RPORT PINA -#define DIO45_WPORT PORTA -#define DIO45_DDR DDRA -#define DIO45_PWM nullptr - -#define DIO46_PIN PINF0 -#define DIO46_RPORT PINF -#define DIO46_WPORT PORTF -#define DIO46_DDR DDRF -#define DIO46_PWM nullptr - -#define DIO47_PIN PINF1 -#define DIO47_RPORT PINF -#define DIO47_WPORT PORTF -#define DIO47_DDR DDRF -#define DIO47_PWM nullptr - -#define DIO48_PIN PINF2 -#define DIO48_RPORT PINF -#define DIO48_WPORT PORTF -#define DIO48_DDR DDRF -#define DIO48_PWM nullptr - -#define DIO49_PIN PINF3 -#define DIO49_RPORT PINF -#define DIO49_WPORT PORTF -#define DIO49_DDR DDRF -#define DIO49_PWM nullptr - -#define DIO50_PIN PINF4 -#define DIO50_RPORT PINF -#define DIO50_WPORT PORTF -#define DIO50_DDR DDRF -#define DIO50_PWM nullptr - -#define DIO51_PIN PINF5 -#define DIO51_RPORT PINF -#define DIO51_WPORT PORTF -#define DIO51_DDR DDRF -#define DIO51_PWM nullptr - -#define DIO52_PIN PINF6 -#define DIO52_RPORT PINF -#define DIO52_WPORT PORTF -#define DIO52_DDR DDRF -#define DIO52_PWM nullptr - -#define DIO53_PIN PINF7 -#define DIO53_RPORT PINF -#define DIO53_WPORT PORTF -#define DIO53_DDR DDRF -#define DIO53_PWM nullptr - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM nullptr -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM nullptr -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM nullptr -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM nullptr -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM nullptr -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM nullptr -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM nullptr -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM nullptr - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM nullptr -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM nullptr -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM nullptr -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM nullptr -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR2A -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM nullptr -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM nullptr -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM &OCR0A - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM nullptr -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM nullptr -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM nullptr -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM nullptr -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM nullptr -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM nullptr -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM nullptr -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM nullptr - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM nullptr -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM nullptr -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM nullptr -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM nullptr -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM nullptr -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM nullptr -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM nullptr -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM nullptr - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_DDR DDRE -#define PE0_PWM nullptr -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_DDR DDRE -#define PE1_PWM nullptr -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_DDR DDRE -#define PE2_PWM nullptr -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_DDR DDRE -#define PE3_PWM &OCR3AL -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_DDR DDRE -#define PE4_PWM &OCR3BL -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_DDR DDRE -#define PE5_PWM &OCR3CL -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_DDR DDRE -#define PE6_PWM nullptr -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_DDR DDRE -#define PE7_PWM nullptr - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_DDR DDRF -#define PF0_PWM nullptr -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_DDR DDRF -#define PF1_PWM nullptr -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_DDR DDRF -#define PF2_PWM nullptr -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_DDR DDRF -#define PF3_PWM nullptr -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_DDR DDRF -#define PF4_PWM nullptr -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_DDR DDRF -#define PF5_PWM nullptr -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_DDR DDRF -#define PF6_PWM nullptr -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_DDR DDRF -#define PF7_PWM nullptr - -#undef PG0 -#define PG0_PIN PING0 -#define PG0_RPORT PING -#define PG0_WPORT PORTG -#define PG0_DDR DDRG -#define PG0_PWM nullptr -#undef PG1 -#define PG1_PIN PING1 -#define PG1_RPORT PING -#define PG1_WPORT PORTG -#define PG1_DDR DDRG -#define PG1_PWM nullptr -#undef PG2 -#define PG2_PIN PING2 -#define PG2_RPORT PING -#define PG2_WPORT PORTG -#define PG2_DDR DDRG -#define PG2_PWM nullptr -#undef PG3 -#define PG3_PIN PING3 -#define PG3_RPORT PING -#define PG3_WPORT PORTG -#define PG3_DDR DDRG -#define PG3_PWM nullptr -#undef PG4 -#define PG4_PIN PING4 -#define PG4_RPORT PING -#define PG4_WPORT PORTG -#define PG4_DDR DDRG -#define PG4_PWM nullptr -#undef PG5 -#define PG5_PIN PING5 -#define PG5_RPORT PING -#define PG5_WPORT PORTG -#define PG5_DDR DDRG -#define PG5_PWM &OCR0B diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h deleted file mode 100644 index f6ee7a5d00..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h +++ /dev/null @@ -1,357 +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 - -/** - * Pin mapping for the 168, 328, and 328P - * - * Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07 - * 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.h" - -#define DEBUG_LED AIO5 - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// SPI -#define SCK DIO13 -#define MISO DIO12 -#define MOSI DIO11 -#define SS DIO10 - -// TWI (I2C) -#define SCL AIO5 -#define SDA AIO4 - -// Timers and PWM -#define OC0A DIO6 -#define OC0B DIO5 -#define OC1A DIO9 -#define OC1B DIO10 -#define OC2A DIO11 -#define OC2B DIO3 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_DDR DDRD -#define DIO0_PWM nullptr - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_DDR DDRD -#define DIO1_PWM nullptr - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_DDR DDRD -#define DIO2_PWM nullptr - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_DDR DDRD -#define DIO3_PWM &OCR2B - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_DDR DDRD -#define DIO4_PWM nullptr - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_DDR DDRD -#define DIO5_PWM &OCR0B - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_DDR DDRD -#define DIO6_PWM &OCR0A - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_DDR DDRD -#define DIO7_PWM nullptr - -#define DIO8_PIN PINB0 -#define DIO8_RPORT PINB -#define DIO8_WPORT PORTB -#define DIO8_DDR DDRB -#define DIO8_PWM nullptr - -#define DIO9_PIN PINB1 -#define DIO9_RPORT PINB -#define DIO9_WPORT PORTB -#define DIO9_DDR DDRB -#define DIO9_PWM nullptr - -#define DIO10_PIN PINB2 -#define DIO10_RPORT PINB -#define DIO10_WPORT PORTB -#define DIO10_DDR DDRB -#define DIO10_PWM nullptr - -#define DIO11_PIN PINB3 -#define DIO11_RPORT PINB -#define DIO11_WPORT PORTB -#define DIO11_DDR DDRB -#define DIO11_PWM &OCR2A - -#define DIO12_PIN PINB4 -#define DIO12_RPORT PINB -#define DIO12_WPORT PORTB -#define DIO12_DDR DDRB -#define DIO12_PWM nullptr - -#define DIO13_PIN PINB5 -#define DIO13_RPORT PINB -#define DIO13_WPORT PORTB -#define DIO13_DDR DDRB -#define DIO13_PWM nullptr - -#define DIO14_PIN PINC0 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_DDR DDRC -#define DIO14_PWM nullptr - -#define DIO15_PIN PINC1 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_DDR DDRC -#define DIO15_PWM nullptr - -#define DIO16_PIN PINC2 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM nullptr - -#define DIO17_PIN PINC3 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM nullptr - -#define DIO18_PIN PINC4 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM nullptr - -#define DIO19_PIN PINC5 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM nullptr - -#define DIO20_PIN PINC6 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM nullptr - -#define DIO21_PIN PINC7 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM nullptr - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM nullptr - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM nullptr - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM nullptr - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM &OCR2A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM nullptr - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM nullptr - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM nullptr - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM nullptr - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM nullptr - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM nullptr - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM nullptr - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM nullptr - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM nullptr - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM nullptr - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM nullptr - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM nullptr - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM nullptr - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM nullptr - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM nullptr - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM &OCR2B - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM nullptr - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM &OCR0B - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM &OCR0A - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM nullptr diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h deleted file mode 100644 index 180a3c4e32..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h +++ /dev/null @@ -1,552 +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 - -/** - * Pin mapping for the 644, 644p, 644pa, and 1284p - * - * 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 - * Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0 - */ - -/** ATMega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - */ - -#include "../fastio.h" - -#define DEBUG_LED DIO0 - -// UART -#define RXD DIO8 -#define TXD DIO9 -#define RXD0 DIO8 -#define TXD0 DIO9 - -#define RXD1 DIO10 -#define TXD1 DIO11 - -// SPI -#define SCK DIO7 -#define MISO DIO6 -#define MOSI DIO5 -#define SS DIO4 - -// TWI (I2C) -#define SCL DIO16 -#define SDA DIO17 - -// Timers and PWM -#define OC0A DIO3 -#define OC0B DIO4 -#define OC1A DIO13 -#define OC1B DIO12 -#define OC2A DIO15 -#define OC2B DIO14 - -// Digital I/O - -#define DIO0_PIN PINB0 -#define DIO0_RPORT PINB -#define DIO0_WPORT PORTB -#define DIO0_DDR DDRB -#define DIO0_PWM nullptr - -#define DIO1_PIN PINB1 -#define DIO1_RPORT PINB -#define DIO1_WPORT PORTB -#define DIO1_DDR DDRB -#define DIO1_PWM nullptr - -#define DIO2_PIN PINB2 -#define DIO2_RPORT PINB -#define DIO2_WPORT PORTB -#define DIO2_DDR DDRB -#define DIO2_PWM nullptr - -#define DIO3_PIN PINB3 -#define DIO3_RPORT PINB -#define DIO3_WPORT PORTB -#define DIO3_DDR DDRB -#define DIO3_PWM &OCR0A - -#define DIO4_PIN PINB4 -#define DIO4_RPORT PINB -#define DIO4_WPORT PORTB -#define DIO4_DDR DDRB -#define DIO4_PWM &OCR0B - -#define DIO5_PIN PINB5 -#define DIO5_RPORT PINB -#define DIO5_WPORT PORTB -#define DIO5_DDR DDRB -#define DIO5_PWM nullptr - -#define DIO6_PIN PINB6 -#define DIO6_RPORT PINB -#define DIO6_WPORT PORTB -#define DIO6_DDR DDRB -#define DIO6_PWM nullptr - -#define DIO7_PIN PINB7 -#define DIO7_RPORT PINB -#define DIO7_WPORT PORTB -#define DIO7_DDR DDRB -#define DIO7_PWM nullptr - -#define DIO8_PIN PIND0 -#define DIO8_RPORT PIND -#define DIO8_WPORT PORTD -#define DIO8_DDR DDRD -#define DIO8_PWM nullptr - -#define DIO9_PIN PIND1 -#define DIO9_RPORT PIND -#define DIO9_WPORT PORTD -#define DIO9_DDR DDRD -#define DIO9_PWM nullptr - -#define DIO10_PIN PIND2 -#define DIO10_RPORT PIND -#define DIO10_WPORT PORTD -#define DIO10_DDR DDRD -#define DIO10_PWM nullptr - -#define DIO11_PIN PIND3 -#define DIO11_RPORT PIND -#define DIO11_WPORT PORTD -#define DIO11_DDR DDRD -#define DIO11_PWM nullptr - -#define DIO12_PIN PIND4 -#define DIO12_RPORT PIND -#define DIO12_WPORT PORTD -#define DIO12_DDR DDRD -#define DIO12_PWM &OCR1B - -#define DIO13_PIN PIND5 -#define DIO13_RPORT PIND -#define DIO13_WPORT PORTD -#define DIO13_DDR DDRD -#define DIO13_PWM &OCR1A - -#define DIO14_PIN PIND6 -#define DIO14_RPORT PIND -#define DIO14_WPORT PORTD -#define DIO14_DDR DDRD -#define DIO14_PWM &OCR2B - -#define DIO15_PIN PIND7 -#define DIO15_RPORT PIND -#define DIO15_WPORT PORTD -#define DIO15_DDR DDRD -#define DIO15_PWM &OCR2A - -#define DIO16_PIN PINC0 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_DDR DDRC -#define DIO16_PWM nullptr - -#define DIO17_PIN PINC1 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_DDR DDRC -#define DIO17_PWM nullptr - -#define DIO18_PIN PINC2 -#define DIO18_RPORT PINC -#define DIO18_WPORT PORTC -#define DIO18_DDR DDRC -#define DIO18_PWM nullptr - -#define DIO19_PIN PINC3 -#define DIO19_RPORT PINC -#define DIO19_WPORT PORTC -#define DIO19_DDR DDRC -#define DIO19_PWM nullptr - -#define DIO20_PIN PINC4 -#define DIO20_RPORT PINC -#define DIO20_WPORT PORTC -#define DIO20_DDR DDRC -#define DIO20_PWM nullptr - -#define DIO21_PIN PINC5 -#define DIO21_RPORT PINC -#define DIO21_WPORT PORTC -#define DIO21_DDR DDRC -#define DIO21_PWM nullptr - -#define DIO22_PIN PINC6 -#define DIO22_RPORT PINC -#define DIO22_WPORT PORTC -#define DIO22_DDR DDRC -#define DIO22_PWM nullptr - -#define DIO23_PIN PINC7 -#define DIO23_RPORT PINC -#define DIO23_WPORT PORTC -#define DIO23_DDR DDRC -#define DIO23_PWM nullptr - -#define DIO24_PIN PINA7 -#define DIO24_RPORT PINA -#define DIO24_WPORT PORTA -#define DIO24_DDR DDRA -#define DIO24_PWM nullptr - -#define DIO25_PIN PINA6 -#define DIO25_RPORT PINA -#define DIO25_WPORT PORTA -#define DIO25_DDR DDRA -#define DIO25_PWM nullptr - -#define DIO26_PIN PINA5 -#define DIO26_RPORT PINA -#define DIO26_WPORT PORTA -#define DIO26_DDR DDRA -#define DIO26_PWM nullptr - -#define DIO27_PIN PINA4 -#define DIO27_RPORT PINA -#define DIO27_WPORT PORTA -#define DIO27_DDR DDRA -#define DIO27_PWM nullptr - -#define DIO28_PIN PINA3 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_DDR DDRA -#define DIO28_PWM nullptr - -#define DIO29_PIN PINA2 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_DDR DDRA -#define DIO29_PWM nullptr - -#define DIO30_PIN PINA1 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_DDR DDRA -#define DIO30_PWM nullptr - -#define DIO31_PIN PINA0 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_DDR DDRA -#define DIO31_PWM nullptr - -#define AIO0_PIN PINA0 -#define AIO0_RPORT PINA -#define AIO0_WPORT PORTA -#define AIO0_DDR DDRA -#define AIO0_PWM nullptr - -#define AIO1_PIN PINA1 -#define AIO1_RPORT PINA -#define AIO1_WPORT PORTA -#define AIO1_DDR DDRA -#define AIO1_PWM nullptr - -#define AIO2_PIN PINA2 -#define AIO2_RPORT PINA -#define AIO2_WPORT PORTA -#define AIO2_DDR DDRA -#define AIO2_PWM nullptr - -#define AIO3_PIN PINA3 -#define AIO3_RPORT PINA -#define AIO3_WPORT PORTA -#define AIO3_DDR DDRA -#define AIO3_PWM nullptr - -#define AIO4_PIN PINA4 -#define AIO4_RPORT PINA -#define AIO4_WPORT PORTA -#define AIO4_DDR DDRA -#define AIO4_PWM nullptr - -#define AIO5_PIN PINA5 -#define AIO5_RPORT PINA -#define AIO5_WPORT PORTA -#define AIO5_DDR DDRA -#define AIO5_PWM nullptr - -#define AIO6_PIN PINA6 -#define AIO6_RPORT PINA -#define AIO6_WPORT PORTA -#define AIO6_DDR DDRA -#define AIO6_PWM nullptr - -#define AIO7_PIN PINA7 -#define AIO7_RPORT PINA -#define AIO7_WPORT PORTA -#define AIO7_DDR DDRA -#define AIO7_PWM nullptr - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_DDR DDRA -#define PA0_PWM nullptr - -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_DDR DDRA -#define PA1_PWM nullptr - -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_DDR DDRA -#define PA2_PWM nullptr - -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_DDR DDRA -#define PA3_PWM nullptr - -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_DDR DDRA -#define PA4_PWM nullptr - -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_DDR DDRA -#define PA5_PWM nullptr - -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_DDR DDRA -#define PA6_PWM nullptr - -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_DDR DDRA -#define PA7_PWM nullptr - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_DDR DDRB -#define PB0_PWM nullptr - -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_DDR DDRB -#define PB1_PWM nullptr - -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_DDR DDRB -#define PB2_PWM nullptr - -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_DDR DDRB -#define PB3_PWM &OCR0A - -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_DDR DDRB -#define PB4_PWM &OCR0B - -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_DDR DDRB -#define PB5_PWM nullptr - -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_DDR DDRB -#define PB6_PWM nullptr - -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_DDR DDRB -#define PB7_PWM nullptr - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_DDR DDRC -#define PC0_PWM nullptr - -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_DDR DDRC -#define PC1_PWM nullptr - -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_DDR DDRC -#define PC2_PWM nullptr - -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_DDR DDRC -#define PC3_PWM nullptr - -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_DDR DDRC -#define PC4_PWM nullptr - -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_DDR DDRC -#define PC5_PWM nullptr - -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_DDR DDRC -#define PC6_PWM nullptr - -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_DDR DDRC -#define PC7_PWM nullptr - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_DDR DDRD -#define PD0_PWM nullptr - -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_DDR DDRD -#define PD1_PWM nullptr - -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_DDR DDRD -#define PD2_PWM nullptr - -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_DDR DDRD -#define PD3_PWM nullptr - -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_DDR DDRD -#define PD4_PWM nullptr - -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_DDR DDRD -#define PD5_PWM nullptr - -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_DDR DDRD -#define PD6_PWM &OCR2B - -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_DDR DDRD -#define PD7_PWM &OCR2A diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h deleted file mode 100644 index 3f17a2e261..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h +++ /dev/null @@ -1,697 +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 - -/** - * Pin mapping (Teensy) for AT90USB646, 647, 1286, and 1287 - * - * Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 - * 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 - * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 - */ - -#include "../fastio.h" - -// change for your board -#define DEBUG_LED DIO31 /* led D5 red */ - -// SPI -#define SCK DIO21 // 9 -#define MISO DIO23 // 11 -#define MOSI DIO22 // 10 -#define SS DIO20 // 8 - -// Digital I/O - -#define DIO0_PIN PIND0 -#define DIO0_RPORT PIND -#define DIO0_WPORT PORTD -#define DIO0_PWM 0 -#define DIO0_DDR DDRD - -#define DIO1_PIN PIND1 -#define DIO1_RPORT PIND -#define DIO1_WPORT PORTD -#define DIO1_PWM 0 -#define DIO1_DDR DDRD - -#define DIO2_PIN PIND2 -#define DIO2_RPORT PIND -#define DIO2_WPORT PORTD -#define DIO2_PWM 0 -#define DIO2_DDR DDRD - -#define DIO3_PIN PIND3 -#define DIO3_RPORT PIND -#define DIO3_WPORT PORTD -#define DIO3_PWM 0 -#define DIO3_DDR DDRD - -#define DIO4_PIN PIND4 -#define DIO4_RPORT PIND -#define DIO4_WPORT PORTD -#define DIO4_PWM 0 -#define DIO4_DDR DDRD - -#define DIO5_PIN PIND5 -#define DIO5_RPORT PIND -#define DIO5_WPORT PORTD -#define DIO5_PWM 0 -#define DIO5_DDR DDRD - -#define DIO6_PIN PIND6 -#define DIO6_RPORT PIND -#define DIO6_WPORT PORTD -#define DIO6_PWM 0 -#define DIO6_DDR DDRD - -#define DIO7_PIN PIND7 -#define DIO7_RPORT PIND -#define DIO7_WPORT PORTD -#define DIO7_PWM 0 -#define DIO7_DDR DDRD - -#define DIO8_PIN PINE0 -#define DIO8_RPORT PINE -#define DIO8_WPORT PORTE -#define DIO8_PWM 0 -#define DIO8_DDR DDRE - -#define DIO9_PIN PINE1 -#define DIO9_RPORT PINE -#define DIO9_WPORT PORTE -#define DIO9_PWM 0 -#define DIO9_DDR DDRE - -#define DIO10_PIN PINC0 -#define DIO10_RPORT PINC -#define DIO10_WPORT PORTC -#define DIO10_PWM 0 -#define DIO10_DDR DDRC - -#define DIO11_PIN PINC1 -#define DIO11_RPORT PINC -#define DIO11_WPORT PORTC -#define DIO11_PWM 0 -#define DIO11_DDR DDRC - -#define DIO12_PIN PINC2 -#define DIO12_RPORT PINC -#define DIO12_WPORT PORTC -#define DIO12_PWM 0 -#define DIO12_DDR DDRC - -#define DIO13_PIN PINC3 -#define DIO13_RPORT PINC -#define DIO13_WPORT PORTC -#define DIO13_PWM 0 -#define DIO13_DDR DDRC - -#define DIO14_PIN PINC4 -#define DIO14_RPORT PINC -#define DIO14_WPORT PORTC -#define DIO14_PWM 0 // OC3C -#define DIO14_DDR DDRC - -#define DIO15_PIN PINC5 -#define DIO15_RPORT PINC -#define DIO15_WPORT PORTC -#define DIO15_PWM 0 // OC3B -#define DIO15_DDR DDRC - -#define DIO16_PIN PINC6 -#define DIO16_RPORT PINC -#define DIO16_WPORT PORTC -#define DIO16_PWM 0 // OC3A -#define DIO16_DDR DDRC - -#define DIO17_PIN PINC7 -#define DIO17_RPORT PINC -#define DIO17_WPORT PORTC -#define DIO17_PWM 0 -#define DIO17_DDR DDRC - -#define DIO18_PIN PINE6 -#define DIO18_RPORT PINE -#define DIO18_WPORT PORTE -#define DIO18_PWM 0 -#define DIO18_DDR DDRE - -#define DIO19_PIN PINE7 -#define DIO19_RPORT PINE -#define DIO19_WPORT PORTE -#define DIO19_PWM 0 -#define DIO19_DDR DDRE - -#define DIO20_PIN PINB0 -#define DIO20_RPORT PINB -#define DIO20_WPORT PORTB -#define DIO20_PWM 0 -#define DIO20_DDR DDRB - -#define DIO21_PIN PINB1 -#define DIO21_RPORT PINB -#define DIO21_WPORT PORTB -#define DIO21_PWM 0 -#define DIO21_DDR DDRB - -#define DIO22_PIN PINB2 -#define DIO22_RPORT PINB -#define DIO22_WPORT PORTB -#define DIO22_PWM 0 -#define DIO22_DDR DDRB - -#define DIO23_PIN PINB3 -#define DIO23_RPORT PINB -#define DIO23_WPORT PORTB -#define DIO23_PWM 0 -#define DIO23_DDR DDRB - -#define DIO24_PIN PINB4 -#define DIO24_RPORT PINB -#define DIO24_WPORT PORTB -#define DIO24_PWM 0 // OC2A -#define DIO24_DDR DDRB - -#define DIO25_PIN PINB5 -#define DIO25_RPORT PINB -#define DIO25_WPORT PORTB -#define DIO25_PWM 0 // OC1A -#define DIO25_DDR DDRB - -#define DIO26_PIN PINB6 -#define DIO26_RPORT PINB -#define DIO26_WPORT PORTB -#define DIO26_PWM 0 // OC1B -#define DIO26_DDR DDRB - -#define DIO27_PIN PINB7 -#define DIO27_RPORT PINB -#define DIO27_WPORT PORTB -#define DIO27_PWM 0 // OC1C -#define DIO27_DDR DDRB - -#define DIO28_PIN PINA0 -#define DIO28_RPORT PINA -#define DIO28_WPORT PORTA -#define DIO28_PWM 0 -#define DIO28_DDR DDRA - -#define DIO29_PIN PINA1 -#define DIO29_RPORT PINA -#define DIO29_WPORT PORTA -#define DIO29_PWM 0 -#define DIO29_DDR DDRA - -#define DIO30_PIN PINA2 -#define DIO30_RPORT PINA -#define DIO30_WPORT PORTA -#define DIO30_PWM 0 -#define DIO30_DDR DDRA - -#define DIO31_PIN PINA3 -#define DIO31_RPORT PINA -#define DIO31_WPORT PORTA -#define DIO31_PWM 0 -#define DIO31_DDR DDRA - -#define DIO32_PIN PINA4 -#define DIO32_RPORT PINA -#define DIO32_WPORT PORTA -#define DIO32_PWM 0 -#define DIO32_DDR DDRA - -#define DIO33_PIN PINA5 -#define DIO33_RPORT PINA -#define DIO33_WPORT PORTA -#define DIO33_PWM 0 -#define DIO33_DDR DDRA - -#define DIO34_PIN PINA6 -#define DIO34_RPORT PINA -#define DIO34_WPORT PORTA -#define DIO34_PWM 0 -#define DIO34_DDR DDRA - -#define DIO35_PIN PINA7 -#define DIO35_RPORT PINA -#define DIO35_WPORT PORTA -#define DIO35_PWM 0 -#define DIO35_DDR DDRA - -#define DIO36_PIN PINE4 -#define DIO36_RPORT PINE -#define DIO36_WPORT PORTE -#define DIO36_PWM 0 -#define DIO36_DDR DDRE - -#define DIO37_PIN PINE5 -#define DIO37_RPORT PINE -#define DIO37_WPORT PORTE -#define DIO37_PWM 0 -#define DIO37_DDR DDRE - -#define DIO38_PIN PINF0 -#define DIO38_RPORT PINF -#define DIO38_WPORT PORTF -#define DIO38_PWM 0 -#define DIO38_DDR DDRF - -#define DIO39_PIN PINF1 -#define DIO39_RPORT PINF -#define DIO39_WPORT PORTF -#define DIO39_PWM 0 -#define DIO39_DDR DDRF - -#define DIO40_PIN PINF2 -#define DIO40_RPORT PINF -#define DIO40_WPORT PORTF -#define DIO40_PWM 0 -#define DIO40_DDR DDRF - -#define DIO41_PIN PINF3 -#define DIO41_RPORT PINF -#define DIO41_WPORT PORTF -#define DIO41_PWM 0 -#define DIO41_DDR DDRF - -#define DIO42_PIN PINF4 -#define DIO42_RPORT PINF -#define DIO42_WPORT PORTF -#define DIO42_PWM 0 -#define DIO42_DDR DDRF - -#define DIO43_PIN PINF5 -#define DIO43_RPORT PINF -#define DIO43_WPORT PORTF -#define DIO43_PWM 0 -#define DIO43_DDR DDRF - -#define DIO44_PIN PINF6 -#define DIO44_RPORT PINF -#define DIO44_WPORT PORTF -#define DIO44_PWM 0 -#define DIO44_DDR DDRF - -#define DIO45_PIN PINF7 -#define DIO45_RPORT PINF -#define DIO45_WPORT PORTF -#define DIO45_PWM 0 -#define DIO45_DDR DDRF - -#define AIO0_PIN PINF0 -#define AIO0_RPORT PINF -#define AIO0_WPORT PORTF -#define AIO0_PWM 0 -#define AIO0_DDR DDRF - -#define AIO1_PIN PINF1 -#define AIO1_RPORT PINF -#define AIO1_WPORT PORTF -#define AIO1_PWM 0 -#define AIO1_DDR DDRF - -#define AIO2_PIN PINF2 -#define AIO2_RPORT PINF -#define AIO2_WPORT PORTF -#define AIO2_PWM 0 -#define AIO2_DDR DDRF - -#define AIO3_PIN PINF3 -#define AIO3_RPORT PINF -#define AIO3_WPORT PORTF -#define AIO3_PWM 0 -#define AIO3_DDR DDRF - -#define AIO4_PIN PINF4 -#define AIO4_RPORT PINF -#define AIO4_WPORT PORTF -#define AIO4_PWM 0 -#define AIO4_DDR DDRF - -#define AIO5_PIN PINF5 -#define AIO5_RPORT PINF -#define AIO5_WPORT PORTF -#define AIO5_PWM 0 -#define AIO5_DDR DDRF - -#define AIO6_PIN PINF6 -#define AIO6_RPORT PINF -#define AIO6_WPORT PORTF -#define AIO6_PWM 0 -#define AIO6_DDR DDRF - -#define AIO7_PIN PINF7 -#define AIO7_RPORT PINF -#define AIO7_WPORT PORTF -#define AIO7_PWM 0 -#define AIO7_DDR DDRF - -//-- Begin not supported by Teensyduino -//-- don't use Arduino functions on these pins pinMode/digitalWrite/etc -#define DIO46_PIN PINE2 -#define DIO46_RPORT PINE -#define DIO46_WPORT PORTE -#define DIO46_PWM 0 -#define DIO46_DDR DDRE - -#define DIO47_PIN PINE3 -#define DIO47_RPORT PINE -#define DIO47_WPORT PORTE -#define DIO47_PWM 0 -#define DIO47_DDR DDRE - -#define TEENSY_E2 46 -#define TEENSY_E3 47 - -//-- end not supported by Teensyduino - -#undef PA0 -#define PA0_PIN PINA0 -#define PA0_RPORT PINA -#define PA0_WPORT PORTA -#define PA0_PWM 0 -#define PA0_DDR DDRA -#undef PA1 -#define PA1_PIN PINA1 -#define PA1_RPORT PINA -#define PA1_WPORT PORTA -#define PA1_PWM 0 -#define PA1_DDR DDRA -#undef PA2 -#define PA2_PIN PINA2 -#define PA2_RPORT PINA -#define PA2_WPORT PORTA -#define PA2_PWM 0 -#define PA2_DDR DDRA -#undef PA3 -#define PA3_PIN PINA3 -#define PA3_RPORT PINA -#define PA3_WPORT PORTA -#define PA3_PWM 0 -#define PA3_DDR DDRA -#undef PA4 -#define PA4_PIN PINA4 -#define PA4_RPORT PINA -#define PA4_WPORT PORTA -#define PA4_PWM 0 -#define PA4_DDR DDRA -#undef PA5 -#define PA5_PIN PINA5 -#define PA5_RPORT PINA -#define PA5_WPORT PORTA -#define PA5_PWM 0 -#define PA5_DDR DDRA -#undef PA6 -#define PA6_PIN PINA6 -#define PA6_RPORT PINA -#define PA6_WPORT PORTA -#define PA6_PWM 0 -#define PA6_DDR DDRA -#undef PA7 -#define PA7_PIN PINA7 -#define PA7_RPORT PINA -#define PA7_WPORT PORTA -#define PA7_PWM 0 -#define PA7_DDR DDRA - -#undef PB0 -#define PB0_PIN PINB0 -#define PB0_RPORT PINB -#define PB0_WPORT PORTB -#define PB0_PWM 0 -#define PB0_DDR DDRB -#undef PB1 -#define PB1_PIN PINB1 -#define PB1_RPORT PINB -#define PB1_WPORT PORTB -#define PB1_PWM 0 -#define PB1_DDR DDRB -#undef PB2 -#define PB2_PIN PINB2 -#define PB2_RPORT PINB -#define PB2_WPORT PORTB -#define PB2_PWM 0 -#define PB2_DDR DDRB -#undef PB3 -#define PB3_PIN PINB3 -#define PB3_RPORT PINB -#define PB3_WPORT PORTB -#define PB3_PWM 0 -#define PB3_DDR DDRB -#undef PB4 -#define PB4_PIN PINB4 -#define PB4_RPORT PINB -#define PB4_WPORT PORTB -#define PB4_PWM 0 -#define PB4_DDR DDRB -#undef PB5 -#define PB5_PIN PINB5 -#define PB5_RPORT PINB -#define PB5_WPORT PORTB -#define PB5_PWM 0 -#define PB5_DDR DDRB -#undef PB6 -#define PB6_PIN PINB6 -#define PB6_RPORT PINB -#define PB6_WPORT PORTB -#define PB6_PWM 0 -#define PB6_DDR DDRB -#undef PB7 -#define PB7_PIN PINB7 -#define PB7_RPORT PINB -#define PB7_WPORT PORTB -#define PB7_PWM 0 -#define PB7_DDR DDRB - -#undef PC0 -#define PC0_PIN PINC0 -#define PC0_RPORT PINC -#define PC0_WPORT PORTC -#define PC0_PWM 0 -#define PC0_DDR DDRC -#undef PC1 -#define PC1_PIN PINC1 -#define PC1_RPORT PINC -#define PC1_WPORT PORTC -#define PC1_PWM 0 -#define PC1_DDR DDRC -#undef PC2 -#define PC2_PIN PINC2 -#define PC2_RPORT PINC -#define PC2_WPORT PORTC -#define PC2_PWM 0 -#define PC2_DDR DDRC -#undef PC3 -#define PC3_PIN PINC3 -#define PC3_RPORT PINC -#define PC3_WPORT PORTC -#define PC3_PWM 0 -#define PC3_DDR DDRC -#undef PC4 -#define PC4_PIN PINC4 -#define PC4_RPORT PINC -#define PC4_WPORT PORTC -#define PC4_PWM 0 -#define PC4_DDR DDRC -#undef PC5 -#define PC5_PIN PINC5 -#define PC5_RPORT PINC -#define PC5_WPORT PORTC -#define PC5_PWM 0 -#define PC5_DDR DDRC -#undef PC6 -#define PC6_PIN PINC6 -#define PC6_RPORT PINC -#define PC6_WPORT PORTC -#define PC6_PWM 0 -#define PC6_DDR DDRC -#undef PC7 -#define PC7_PIN PINC7 -#define PC7_RPORT PINC -#define PC7_WPORT PORTC -#define PC7_PWM 0 -#define PC7_DDR DDRC - -#undef PD0 -#define PD0_PIN PIND0 -#define PD0_RPORT PIND -#define PD0_WPORT PORTD -#define PD0_PWM 0 // OC0B -#define PD0_DDR DDRD -#undef PD1 -#define PD1_PIN PIND1 -#define PD1_RPORT PIND -#define PD1_WPORT PORTD -#define PD1_PWM 0 // OC2B -#define PD1_DDR DDRD -#undef PD2 -#define PD2_PIN PIND2 -#define PD2_RPORT PIND -#define PD2_WPORT PORTD -#define PD2_PWM 0 -#define PD2_DDR DDRD -#undef PD3 -#define PD3_PIN PIND3 -#define PD3_RPORT PIND -#define PD3_WPORT PORTD -#define PD3_PWM 0 -#define PD3_DDR DDRD -#undef PD4 -#define PD4_PIN PIND4 -#define PD4_RPORT PIND -#define PD4_WPORT PORTD -#define PD4_PWM 0 -#define PD4_DDR DDRD -#undef PD5 -#define PD5_PIN PIND5 -#define PD5_RPORT PIND -#define PD5_WPORT PORTD -#define PD5_PWM 0 -#define PD5_DDR DDRD -#undef PD6 -#define PD6_PIN PIND6 -#define PD6_RPORT PIND -#define PD6_WPORT PORTD -#define PD6_PWM 0 -#define PD6_DDR DDRD -#undef PD7 -#define PD7_PIN PIND7 -#define PD7_RPORT PIND -#define PD7_WPORT PORTD -#define PD7_PWM 0 -#define PD7_DDR DDRD - -#undef PE0 -#define PE0_PIN PINE0 -#define PE0_RPORT PINE -#define PE0_WPORT PORTE -#define PE0_PWM 0 -#define PE0_DDR DDRE -#undef PE1 -#define PE1_PIN PINE1 -#define PE1_RPORT PINE -#define PE1_WPORT PORTE -#define PE1_PWM 0 -#define PE1_DDR DDRE -#undef PE2 -#define PE2_PIN PINE2 -#define PE2_RPORT PINE -#define PE2_WPORT PORTE -#define PE2_PWM 0 -#define PE2_DDR DDRE -#undef PE3 -#define PE3_PIN PINE3 -#define PE3_RPORT PINE -#define PE3_WPORT PORTE -#define PE3_PWM 0 -#define PE3_DDR DDRE -#undef PE4 -#define PE4_PIN PINE4 -#define PE4_RPORT PINE -#define PE4_WPORT PORTE -#define PE4_PWM 0 -#define PE4_DDR DDRE -#undef PE5 -#define PE5_PIN PINE5 -#define PE5_RPORT PINE -#define PE5_WPORT PORTE -#define PE5_PWM 0 -#define PE5_DDR DDRE -#undef PE6 -#define PE6_PIN PINE6 -#define PE6_RPORT PINE -#define PE6_WPORT PORTE -#define PE6_PWM 0 -#define PE6_DDR DDRE -#undef PE7 -#define PE7_PIN PINE7 -#define PE7_RPORT PINE -#define PE7_WPORT PORTE -#define PE7_PWM 0 -#define PE7_DDR DDRE - -#undef PF0 -#define PF0_PIN PINF0 -#define PF0_RPORT PINF -#define PF0_WPORT PORTF -#define PF0_PWM 0 -#define PF0_DDR DDRF -#undef PF1 -#define PF1_PIN PINF1 -#define PF1_RPORT PINF -#define PF1_WPORT PORTF -#define PF1_PWM 0 -#define PF1_DDR DDRF -#undef PF2 -#define PF2_PIN PINF2 -#define PF2_RPORT PINF -#define PF2_WPORT PORTF -#define PF2_PWM 0 -#define PF2_DDR DDRF -#undef PF3 -#define PF3_PIN PINF3 -#define PF3_RPORT PINF -#define PF3_WPORT PORTF -#define PF3_PWM 0 -#define PF3_DDR DDRF -#undef PF4 -#define PF4_PIN PINF4 -#define PF4_RPORT PINF -#define PF4_WPORT PORTF -#define PF4_PWM 0 -#define PF4_DDR DDRF -#undef PF5 -#define PF5_PIN PINF5 -#define PF5_RPORT PINF -#define PF5_WPORT PORTF -#define PF5_PWM 0 -#define PF5_DDR DDRF -#undef PF6 -#define PF6_PIN PINF6 -#define PF6_RPORT PINF -#define PF6_WPORT PORTF -#define PF6_PWM 0 -#define PF6_DDR DDRF -#undef PF7 -#define PF7_PIN PINF7 -#define PF7_RPORT PINF -#define PF7_WPORT PORTF -#define PF7_PWM 0 -#define PF7_DDR DDRF - - -/** - * Some of the pin mapping functions of the Teensduino extension to the Arduino IDE - * do not function the same as the other Arduino extensions. - */ - -//digitalPinToTimer(pin) function works like Arduino but Timers are not defined -#define TIMER0B 1 -#define TIMER1A 7 -#define TIMER1B 8 -#define TIMER1C 9 -#define TIMER2A 6 -#define TIMER2B 2 -#define TIMER3A 5 -#define TIMER3B 4 -#define TIMER3C 3 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h deleted file mode 100644 index 93fadf20a5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h +++ /dev/null @@ -1,61 +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 - -/** - * Test AVR-specific configuration values for errors at compile-time. - */ - -/** - * Digipot requirement - */ - #if ENABLED(DIGIPOT_MCP4018) - #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \ - || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1) - #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined." - #endif -#endif - -/** - * Checks for FAST PWM - */ -#if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2)) - #error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2" -#endif - -/** - * Sanity checks for Spindle / Laser PWM - */ -#if ENABLED(SPINDLE_LASER_PWM) - #if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." - #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." - #endif -#endif - -/** - * The Trinamic library includes SoftwareSerial.h, leading to a compile error. - */ -#if HAS_TRINAMIC && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/math.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/math.h deleted file mode 100644 index d397cc4e9a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/math.h +++ /dev/null @@ -1,113 +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 - -/** - * Optimized math functions for AVR - */ - -// intRes = longIn1 * longIn2 >> 24 -// uses: -// A[tmp] to store 0 -// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result. -// note that the lower two bytes and the upper byte of the 48bit result are not calculated. -// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones. -// B A are bits 24-39 and are the returned value -// C B A is longIn1 -// D C B A is longIn2 -// -static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { - uint8_t tmp1; - uint8_t tmp2; - uint16_t intRes; - __asm__ __volatile__( - A("clr %[tmp1]") - A("mul %A[longIn1], %B[longIn2]") - A("mov %[tmp2], r1") - A("mul %B[longIn1], %C[longIn2]") - A("movw %A[intRes], r0") - A("mul %C[longIn1], %C[longIn2]") - A("add %B[intRes], r0") - A("mul %C[longIn1], %B[longIn2]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %A[longIn1], %C[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %B[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %C[longIn1], %A[longIn2]") - A("add %[tmp2], r0") - A("adc %A[intRes], r1") - A("adc %B[intRes], %[tmp1]") - A("mul %B[longIn1], %A[longIn2]") - A("add %[tmp2], r1") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("lsr %[tmp2]") - A("adc %A[intRes], %[tmp1]") - A("adc %B[intRes], %[tmp1]") - A("mul %D[longIn2], %A[longIn1]") - A("add %A[intRes], r0") - A("adc %B[intRes], r1") - A("mul %D[longIn2], %B[longIn1]") - A("add %B[intRes], r0") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp1] "=&r" (tmp1), - [tmp2] "=&r" (tmp2) - : [longIn1] "d" (longIn1), - [longIn2] "d" (longIn2) - : "cc" - ); - return intRes; -} - -// intRes = intIn1 * intIn2 >> 16 -// uses: -// r26 to store 0 -// r27 to store the byte 1 of the 24 bit result -static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { - uint8_t tmp; - uint16_t intRes; - __asm__ __volatile__ ( - A("clr %[tmp]") - A("mul %[charIn1], %B[intIn2]") - A("movw %A[intRes], r0") - A("mul %[charIn1], %A[intIn2]") - A("add %A[intRes], r1") - A("adc %B[intRes], %[tmp]") - A("lsr r0") - A("adc %A[intRes], %[tmp]") - A("adc %B[intRes], %[tmp]") - A("clr r1") - : [intRes] "=&r" (intRes), - [tmp] "=&r" (tmp) - : [charIn1] "d" (charIn1), - [intIn2] "d" (intIn2) - : "cc" - ); - return intRes; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp deleted file mode 100644 index 116a8288e2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp +++ /dev/null @@ -1,67 +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 . - * - */ -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" - -#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) - -#include "../shared/persistent_store_api.h" - -bool PersistentStore::access_start() { return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; // always assume success for AVR's -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug.h deleted file mode 100644 index e4738e0332..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug.h +++ /dev/null @@ -1,396 +0,0 @@ -/** - * 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 - -/** - * PWM print routines for Atmel 8 bit AVR CPUs - */ - -#include "../../inc/MarlinConfig.h" - -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS - -#if AVR_AT90USB1286_FAMILY - // Working with Teensyduino extension so need to re-define some things - #include "pinsDebug_Teensyduino.h" - // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs - // portModeRegister takes a different argument - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p) - #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin)) -#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70 - #include "pinsDebug_plus_70.h" - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p) - bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } - -#else - #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) - #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) - #define digitalPinToPort_DEBUG(p) digitalPinToPort(p) - bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } - #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin) -#endif - -#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0) -#if AVR_ATmega1284_FAMILY - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int(analogInputToDigitalPin(0) - (P)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0)) -#else - #define DIGITAL_PIN_TO_ANALOG_PIN(P) int((P) - analogInputToDigitalPin(0)) - #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) -#endif -#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin) -#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin - -void PRINT_ARRAY_NAME(uint8_t x) { - char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name); - for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) { - char temp_char = pgm_read_byte(name_mem_pointer + y); - if (temp_char != 0) - SERIAL_CHAR(temp_char); - else { - for (uint8_t i = 0; i < MAX_NAME_LENGTH - y; i++) SERIAL_CHAR(' '); - break; - } - } -} - -#define GET_ARRAY_IS_DIGITAL(x) pgm_read_byte(&pin_array[x].is_digital) - - -#if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of - #undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it - #define NUM_DIGITAL_PINS 32 // set to digital only + digital/analog -#endif - -#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), V); SERIAL_ECHO(buffer); }while(0) -#define PWM_CASE(N,Z) \ - case TIMER##N##Z: \ - if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \ - PWM_PRINT(OCR##N##Z); \ - return true; \ - } else return false - - - -/** - * Print a pin's PWM status. - * Return true if it's currently a PWM pin. - */ -static bool pwm_status(uint8_t pin) { - char buffer[20]; // for the sprintf statements - - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - PWM_CASE(0, A); - #endif - #endif - PWM_CASE(0, B); - #endif - - #if defined(TCCR1A) && defined(COM1A1) - PWM_CASE(1, A); - PWM_CASE(1, B); - #if defined(COM1C1) && defined(TIMER1C) - PWM_CASE(1, C); - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - PWM_CASE(2, A); - PWM_CASE(2, B); - #endif - - #if defined(TCCR3A) && defined(COM3A1) - PWM_CASE(3, A); - PWM_CASE(3, B); - #ifdef COM3C1 - PWM_CASE(3, C); - #endif - #endif - - #ifdef TCCR4A - PWM_CASE(4, A); - PWM_CASE(4, B); - PWM_CASE(4, C); - #endif - - #if defined(TCCR5A) && defined(COM5A1) - PWM_CASE(5, A); - PWM_CASE(5, B); - PWM_CASE(5, C); - #endif - - case NOT_ON_TIMER: - default: - return false; - } - SERIAL_ECHO_SP(2); -} // pwm_status - - -const volatile uint8_t* const PWM_other[][3] PROGMEM = { - { &TCCR0A, &TCCR0B, &TIMSK0 }, - { &TCCR1A, &TCCR1B, &TIMSK1 }, - #if defined(TCCR2A) && defined(COM2A1) - { &TCCR2A, &TCCR2B, &TIMSK2 }, - #endif - #if defined(TCCR3A) && defined(COM3A1) - { &TCCR3A, &TCCR3B, &TIMSK3 }, - #endif - #ifdef TCCR4A - { &TCCR4A, &TCCR4B, &TIMSK4 }, - #endif - #if defined(TCCR5A) && defined(COM5A1) - { &TCCR5A, &TCCR5B, &TIMSK5 }, - #endif -}; - - -const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { - - #ifdef TIMER0A - { &OCR0A, &OCR0B, 0 }, - #else - { 0, &OCR0B, 0 }, - #endif - - #if defined(COM1C1) && defined(TIMER1C) - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, (const uint8_t*)&OCR1C }, - #else - { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, 0 }, - #endif - - #if defined(TCCR2A) && defined(COM2A1) - { &OCR2A, &OCR2B, 0 }, - #endif - - #if defined(TCCR3A) && defined(COM3A1) - #ifdef COM3C1 - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, (const uint8_t*)&OCR3C }, - #else - { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, 0 }, - #endif - #endif - - #ifdef TCCR4A - { (const uint8_t*)&OCR4A, (const uint8_t*)&OCR4B, (const uint8_t*)&OCR4C }, - #endif - - #if defined(TCCR5A) && defined(COM5A1) - { (const uint8_t*)&OCR5A, (const uint8_t*)&OCR5B, (const uint8_t*)&OCR5C }, - #endif -}; - - -#define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) -#define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) -#define TIMSK(T) pgm_read_word(&PWM_other[T][2]) -#define CS_0 0 -#define CS_1 1 -#define CS_2 2 -#define WGM_0 0 -#define WGM_1 1 -#define WGM_2 3 -#define WGM_3 4 -#define TOIE 0 - -#define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L]) - -static void err_is_counter() { SERIAL_ECHOPGM(" non-standard PWM mode"); } -static void err_is_interrupt() { SERIAL_ECHOPGM(" compare interrupt enabled"); } -static void err_prob_interrupt() { SERIAL_ECHOPGM(" overflow interrupt enabled"); } -static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); } - -void com_print(uint8_t N, uint8_t Z) { - const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); - SERIAL_ECHOPGM(" COM"); - SERIAL_CHAR('0' + N); - SERIAL_CHAR('A' + Z); - SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03)); -} - -void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout - char buffer[20]; // for the sprintf statements - const uint8_t *TCCRB = (uint8_t*)TCCR_B(T), - *TCCRA = (uint8_t*)TCCR_A(T); - uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); - if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); - - SERIAL_ECHOPGM(" TIMER"); - SERIAL_CHAR(T + '0'); - SERIAL_CHAR(L); - SERIAL_ECHO_SP(3); - - if (N == 3) { - const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL8); - } - else { - const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A'); - PWM_PRINT(*OCRVAL16); - } - SERIAL_ECHOPAIR(" WGM: ", WGM); - com_print(T,L); - SERIAL_ECHOPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); - - SERIAL_ECHOPGM(" TCCR"); - SERIAL_CHAR(T + '0'); - SERIAL_ECHOPAIR("A: ", *TCCRA); - - SERIAL_ECHOPGM(" TCCR"); - SERIAL_CHAR(T + '0'); - SERIAL_ECHOPAIR("B: ", *TCCRB); - - const uint8_t *TMSK = (uint8_t*)TIMSK(T); - SERIAL_ECHOPGM(" TIMSK"); - SERIAL_CHAR(T + '0'); - SERIAL_ECHOPAIR(": ", *TMSK); - - const uint8_t OCIE = L - 'A' + 1; - if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); } - else { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); } - if (TEST(*TMSK, OCIE)) err_is_interrupt(); - if (TEST(*TMSK, TOIE)) err_prob_interrupt(); -} - -static void pwm_details(uint8_t pin) { - switch (digitalPinToTimer_DEBUG(pin)) { - - #if defined(TCCR0A) && defined(COM0A1) - #ifdef TIMER0A - #if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs - case TIMER0A: timer_prefix(0, 'A', 3); break; - #endif - #endif - case TIMER0B: timer_prefix(0, 'B', 3); break; - #endif - - #if defined(TCCR1A) && defined(COM1A1) - case TIMER1A: timer_prefix(1, 'A', 4); break; - case TIMER1B: timer_prefix(1, 'B', 4); break; - #if defined(COM1C1) && defined(TIMER1C) - case TIMER1C: timer_prefix(1, 'C', 4); break; - #endif - #endif - - #if defined(TCCR2A) && defined(COM2A1) - case TIMER2A: timer_prefix(2, 'A', 3); break; - case TIMER2B: timer_prefix(2, 'B', 3); break; - #endif - - #if defined(TCCR3A) && defined(COM3A1) - case TIMER3A: timer_prefix(3, 'A', 4); break; - case TIMER3B: timer_prefix(3, 'B', 4); break; - #ifdef COM3C1 - case TIMER3C: timer_prefix(3, 'C', 4); break; - #endif - #endif - - #ifdef TCCR4A - case TIMER4A: timer_prefix(4, 'A', 4); break; - case TIMER4B: timer_prefix(4, 'B', 4); break; - case TIMER4C: timer_prefix(4, 'C', 4); break; - #endif - - #if defined(TCCR5A) && defined(COM5A1) - case TIMER5A: timer_prefix(5, 'A', 4); break; - case TIMER5B: timer_prefix(5, 'B', 4); break; - case TIMER5C: timer_prefix(5, 'C', 4); break; - #endif - - case NOT_ON_TIMER: break; - - } - SERIAL_ECHOPGM(" "); - - // on pins that have two PWMs, print info on second PWM - #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY - // looking for port B7 - PWMs 0A and 1C - if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) { - #if !AVR_AT90USB1286_FAMILY - SERIAL_ECHOPGM("\n ."); - SERIAL_ECHO_SP(18); - SERIAL_ECHOPGM("TIMER1C"); - print_is_also_tied(); - timer_prefix(1, 'C', 4); - #else - SERIAL_ECHOPGM("\n ."); - SERIAL_ECHO_SP(18); - SERIAL_ECHOPGM("TIMER0A"); - print_is_also_tied(); - timer_prefix(0, 'A', 3); - #endif - } - #else - UNUSED(print_is_also_tied); - #endif -} // pwm_details - - -#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs - int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed - const uint8_t port = digitalPinToPort_DEBUG(pin); - return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask_DEBUG(pin)) ? HIGH : LOW; - } -#endif - -#ifndef PRINT_PORT - - void print_port(int8_t pin) { // print port number - #ifdef digitalPinToPort_DEBUG - uint8_t x; - SERIAL_ECHOPGM(" Port: "); - #if AVR_AT90USB1286_FAMILY - x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64; - #else - x = digitalPinToPort_DEBUG(pin) + 64; - #endif - SERIAL_CHAR(x); - - #if AVR_AT90USB1286_FAMILY - if (pin == 46) - x = '2'; - else if (pin == 47) - x = '3'; - else { - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - } - #else - uint8_t temp = digitalPinToBitMask_DEBUG(pin); - for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; - #endif - SERIAL_CHAR(x); - #else - SERIAL_ECHO_SP(10); - #endif - } - - #define PRINT_PORT(p) print_port(p) - -#endif - -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h deleted file mode 100644 index 4388430779..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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 - -// -// some of the pin mapping functions of the Teensduino extension to the Arduino IDE -// do not function the same as the other Arduino extensions -// - - -#define TEENSYDUINO_IDE - -//digitalPinToTimer(pin) function works like Arduino but Timers are not defined -#define TIMER0B 1 -#define TIMER1A 7 -#define TIMER1B 8 -#define TIMER1C 9 -#define TIMER2A 6 -#define TIMER2B 2 -#define TIMER3A 5 -#define TIMER3B 4 -#define TIMER3C 3 - -// digitalPinToPort function just returns the pin number so need to create our own -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 - -#undef digitalPinToPort - -const uint8_t PROGMEM digital_pin_to_port_PGM[] = { - PD, // 0 - PD0 - INT0 - PWM - PD, // 1 - PD1 - INT1 - PWM - PD, // 2 - PD2 - INT2 - RX - PD, // 3 - PD3 - INT3 - TX - PD, // 4 - PD4 - PD, // 5 - PD5 - PD, // 6 - PD6 - PD, // 7 - PD7 - PE, // 8 - PE0 - PE, // 9 - PE1 - PC, // 10 - PC0 - PC, // 11 - PC1 - PC, // 12 - PC2 - PC, // 13 - PC3 - PC, // 14 - PC4 - PWM - PC, // 15 - PC5 - PWM - PC, // 16 - PC6 - PWM - PC, // 17 - PC7 - PE, // 18 - PE6 - INT6 - PE, // 19 - PE7 - INT7 - PB, // 20 - PB0 - PB, // 21 - PB1 - PB, // 22 - PB2 - PB, // 23 - PB3 - PB, // 24 - PB4 - PWM - PB, // 25 - PB5 - PWM - PB, // 26 - PB6 - PWM - PB, // 27 - PB7 - PWM - PA, // 28 - PA0 - PA, // 29 - PA1 - PA, // 30 - PA2 - PA, // 31 - PA3 - PA, // 32 - PA4 - PA, // 33 - PA5 - PA, // 34 - PA6 - PA, // 35 - PA7 - PE, // 36 - PE4 - INT4 - PE, // 37 - PE5 - INT5 - PF, // 38 - PF0 - A0 - PF, // 39 - PF1 - A1 - PF, // 40 - PF2 - A2 - PF, // 41 - PF3 - A3 - PF, // 42 - PF4 - A4 - PF, // 43 - PF5 - A5 - PF, // 44 - PF6 - A6 - PF, // 45 - PF7 - A7 - PE, // 46 - PE2 (not defined in teensyduino) - PE, // 47 - PE3 (not defined in teensyduino) -}; - -#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) ) - -// digitalPinToBitMask(pin) is OK - -#define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't - // disable the PWMs so we can use it as is - -// portModeRegister(pin) is OK diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h deleted file mode 100644 index e5bb82f226..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h +++ /dev/null @@ -1,332 +0,0 @@ -/** - * 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 - -/** - * Structures for 2560 family boards that use more than 70 pins - */ - -#undef NUM_DIGITAL_PINS -#if MB(BQ_ZUM_MEGA_3D) - #define NUM_DIGITAL_PINS 85 -#elif MB(MIGHTYBOARD_REVE) - #define NUM_DIGITAL_PINS 80 -#elif MB(MINIRAMBO) - #define NUM_DIGITAL_PINS 85 -#elif MB(SCOOVO_X9H) - #define NUM_DIGITAL_PINS 85 -#endif - -#define PA 1 -#define PB 2 -#define PC 3 -#define PD 4 -#define PE 5 -#define PF 6 -#define PG 7 -#define PH 8 -#define PJ 10 -#define PK 11 -#define PL 12 - -const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { - // PORTLIST - // ------------------------ - PE , // PE 0 ** 0 ** USART0_RX - PE , // PE 1 ** 1 ** USART0_TX - PE , // PE 4 ** 2 ** PWM2 - PE , // PE 5 ** 3 ** PWM3 - PG , // PG 5 ** 4 ** PWM4 - PE , // PE 3 ** 5 ** PWM5 - PH , // PH 3 ** 6 ** PWM6 - PH , // PH 4 ** 7 ** PWM7 - PH , // PH 5 ** 8 ** PWM8 - PH , // PH 6 ** 9 ** PWM9 - PB , // PB 4 ** 10 ** PWM10 - PB , // PB 5 ** 11 ** PWM11 - PB , // PB 6 ** 12 ** PWM12 - PB , // PB 7 ** 13 ** PWM13 - PJ , // PJ 1 ** 14 ** USART3_TX - PJ , // PJ 0 ** 15 ** USART3_RX - PH , // PH 1 ** 16 ** USART2_TX - PH , // PH 0 ** 17 ** USART2_RX - PD , // PD 3 ** 18 ** USART1_TX - PD , // PD 2 ** 19 ** USART1_RX - PD , // PD 1 ** 20 ** I2C_SDA - PD , // PD 0 ** 21 ** I2C_SCL - PA , // PA 0 ** 22 ** D22 - PA , // PA 1 ** 23 ** D23 - PA , // PA 2 ** 24 ** D24 - PA , // PA 3 ** 25 ** D25 - PA , // PA 4 ** 26 ** D26 - PA , // PA 5 ** 27 ** D27 - PA , // PA 6 ** 28 ** D28 - PA , // PA 7 ** 29 ** D29 - PC , // PC 7 ** 30 ** D30 - PC , // PC 6 ** 31 ** D31 - PC , // PC 5 ** 32 ** D32 - PC , // PC 4 ** 33 ** D33 - PC , // PC 3 ** 34 ** D34 - PC , // PC 2 ** 35 ** D35 - PC , // PC 1 ** 36 ** D36 - PC , // PC 0 ** 37 ** D37 - PD , // PD 7 ** 38 ** D38 - PG , // PG 2 ** 39 ** D39 - PG , // PG 1 ** 40 ** D40 - PG , // PG 0 ** 41 ** D41 - PL , // PL 7 ** 42 ** D42 - PL , // PL 6 ** 43 ** D43 - PL , // PL 5 ** 44 ** D44 - PL , // PL 4 ** 45 ** D45 - PL , // PL 3 ** 46 ** D46 - PL , // PL 2 ** 47 ** D47 - PL , // PL 1 ** 48 ** D48 - PL , // PL 0 ** 49 ** D49 - PB , // PB 3 ** 50 ** SPI_MISO - PB , // PB 2 ** 51 ** SPI_MOSI - PB , // PB 1 ** 52 ** SPI_SCK - PB , // PB 0 ** 53 ** SPI_SS - PF , // PF 0 ** 54 ** A0 - PF , // PF 1 ** 55 ** A1 - PF , // PF 2 ** 56 ** A2 - PF , // PF 3 ** 57 ** A3 - PF , // PF 4 ** 58 ** A4 - PF , // PF 5 ** 59 ** A5 - PF , // PF 6 ** 60 ** A6 - PF , // PF 7 ** 61 ** A7 - PK , // PK 0 ** 62 ** A8 - PK , // PK 1 ** 63 ** A9 - PK , // PK 2 ** 64 ** A10 - PK , // PK 3 ** 65 ** A11 - PK , // PK 4 ** 66 ** A12 - PK , // PK 5 ** 67 ** A13 - PK , // PK 6 ** 68 ** A14 - PK , // PK 7 ** 69 ** A15 - PG , // PG 4 ** 70 ** - PG , // PG 3 ** 71 ** - PJ , // PJ 2 ** 72 ** - PJ , // PJ 3 ** 73 ** - PJ , // PJ 7 ** 74 ** - PJ , // PJ 4 ** 75 ** - PJ , // PJ 5 ** 76 ** - PJ , // PJ 6 ** 77 ** - PE , // PE 2 ** 78 ** - PE , // PE 6 ** 79 ** - PE , // PE 7 ** 80 ** - PD , // PD 4 ** 81 ** - PD , // PD 5 ** 82 ** - PD , // PD 6 ** 83 ** - PH , // PH 2 ** 84 ** - PH , // PH 7 ** 85 ** -}; - -#define digitalPinToPort_plus_70(P) ( pgm_read_byte( digital_pin_to_port_PGM_plus_70 + (P) ) ) - -const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { - // PIN IN PORT - // ------------------------ - _BV( 0 ) , // PE 0 ** 0 ** USART0_RX - _BV( 1 ) , // PE 1 ** 1 ** USART0_TX - _BV( 4 ) , // PE 4 ** 2 ** PWM2 - _BV( 5 ) , // PE 5 ** 3 ** PWM3 - _BV( 5 ) , // PG 5 ** 4 ** PWM4 - _BV( 3 ) , // PE 3 ** 5 ** PWM5 - _BV( 3 ) , // PH 3 ** 6 ** PWM6 - _BV( 4 ) , // PH 4 ** 7 ** PWM7 - _BV( 5 ) , // PH 5 ** 8 ** PWM8 - _BV( 6 ) , // PH 6 ** 9 ** PWM9 - _BV( 4 ) , // PB 4 ** 10 ** PWM10 - _BV( 5 ) , // PB 5 ** 11 ** PWM11 - _BV( 6 ) , // PB 6 ** 12 ** PWM12 - _BV( 7 ) , // PB 7 ** 13 ** PWM13 - _BV( 1 ) , // PJ 1 ** 14 ** USART3_TX - _BV( 0 ) , // PJ 0 ** 15 ** USART3_RX - _BV( 1 ) , // PH 1 ** 16 ** USART2_TX - _BV( 0 ) , // PH 0 ** 17 ** USART2_RX - _BV( 3 ) , // PD 3 ** 18 ** USART1_TX - _BV( 2 ) , // PD 2 ** 19 ** USART1_RX - _BV( 1 ) , // PD 1 ** 20 ** I2C_SDA - _BV( 0 ) , // PD 0 ** 21 ** I2C_SCL - _BV( 0 ) , // PA 0 ** 22 ** D22 - _BV( 1 ) , // PA 1 ** 23 ** D23 - _BV( 2 ) , // PA 2 ** 24 ** D24 - _BV( 3 ) , // PA 3 ** 25 ** D25 - _BV( 4 ) , // PA 4 ** 26 ** D26 - _BV( 5 ) , // PA 5 ** 27 ** D27 - _BV( 6 ) , // PA 6 ** 28 ** D28 - _BV( 7 ) , // PA 7 ** 29 ** D29 - _BV( 7 ) , // PC 7 ** 30 ** D30 - _BV( 6 ) , // PC 6 ** 31 ** D31 - _BV( 5 ) , // PC 5 ** 32 ** D32 - _BV( 4 ) , // PC 4 ** 33 ** D33 - _BV( 3 ) , // PC 3 ** 34 ** D34 - _BV( 2 ) , // PC 2 ** 35 ** D35 - _BV( 1 ) , // PC 1 ** 36 ** D36 - _BV( 0 ) , // PC 0 ** 37 ** D37 - _BV( 7 ) , // PD 7 ** 38 ** D38 - _BV( 2 ) , // PG 2 ** 39 ** D39 - _BV( 1 ) , // PG 1 ** 40 ** D40 - _BV( 0 ) , // PG 0 ** 41 ** D41 - _BV( 7 ) , // PL 7 ** 42 ** D42 - _BV( 6 ) , // PL 6 ** 43 ** D43 - _BV( 5 ) , // PL 5 ** 44 ** D44 - _BV( 4 ) , // PL 4 ** 45 ** D45 - _BV( 3 ) , // PL 3 ** 46 ** D46 - _BV( 2 ) , // PL 2 ** 47 ** D47 - _BV( 1 ) , // PL 1 ** 48 ** D48 - _BV( 0 ) , // PL 0 ** 49 ** D49 - _BV( 3 ) , // PB 3 ** 50 ** SPI_MISO - _BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI - _BV( 1 ) , // PB 1 ** 52 ** SPI_SCK - _BV( 0 ) , // PB 0 ** 53 ** SPI_SS - _BV( 0 ) , // PF 0 ** 54 ** A0 - _BV( 1 ) , // PF 1 ** 55 ** A1 - _BV( 2 ) , // PF 2 ** 56 ** A2 - _BV( 3 ) , // PF 3 ** 57 ** A3 - _BV( 4 ) , // PF 4 ** 58 ** A4 - _BV( 5 ) , // PF 5 ** 59 ** A5 - _BV( 6 ) , // PF 6 ** 60 ** A6 - _BV( 7 ) , // PF 7 ** 61 ** A7 - _BV( 0 ) , // PK 0 ** 62 ** A8 - _BV( 1 ) , // PK 1 ** 63 ** A9 - _BV( 2 ) , // PK 2 ** 64 ** A10 - _BV( 3 ) , // PK 3 ** 65 ** A11 - _BV( 4 ) , // PK 4 ** 66 ** A12 - _BV( 5 ) , // PK 5 ** 67 ** A13 - _BV( 6 ) , // PK 6 ** 68 ** A14 - _BV( 7 ) , // PK 7 ** 69 ** A15 - _BV( 4 ) , // PG 4 ** 70 ** - _BV( 3 ) , // PG 3 ** 71 ** - _BV( 2 ) , // PJ 2 ** 72 ** - _BV( 3 ) , // PJ 3 ** 73 ** - _BV( 7 ) , // PJ 7 ** 74 ** - _BV( 4 ) , // PJ 4 ** 75 ** - _BV( 5 ) , // PJ 5 ** 76 ** - _BV( 6 ) , // PJ 6 ** 77 ** - _BV( 2 ) , // PE 2 ** 78 ** - _BV( 6 ) , // PE 6 ** 79 ** - _BV( 7 ) , // PE 7 ** 80 ** - _BV( 4 ) , // PD 4 ** 81 ** - _BV( 5 ) , // PD 5 ** 82 ** - _BV( 6 ) , // PD 6 ** 83 ** - _BV( 2 ) , // PH 2 ** 84 ** - _BV( 7 ) , // PH 7 ** 85 ** -}; - -#define digitalPinToBitMask_plus_70(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM_plus_70 + (P) ) ) - - -const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { - // TIMERS - // ------------------------ - NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX - NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX - TIMER3B , // PE 4 ** 2 ** PWM2 - TIMER3C , // PE 5 ** 3 ** PWM3 - TIMER0B , // PG 5 ** 4 ** PWM4 - TIMER3A , // PE 3 ** 5 ** PWM5 - TIMER4A , // PH 3 ** 6 ** PWM6 - TIMER4B , // PH 4 ** 7 ** PWM7 - TIMER4C , // PH 5 ** 8 ** PWM8 - TIMER2B , // PH 6 ** 9 ** PWM9 - TIMER2A , // PB 4 ** 10 ** PWM10 - TIMER1A , // PB 5 ** 11 ** PWM11 - TIMER1B , // PB 6 ** 12 ** PWM12 - TIMER0A , // PB 7 ** 13 ** PWM13 - NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX - NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX - NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX - NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX - NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX - NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX - NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA - NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL - NOT_ON_TIMER , // PA 0 ** 22 ** D22 - NOT_ON_TIMER , // PA 1 ** 23 ** D23 - NOT_ON_TIMER , // PA 2 ** 24 ** D24 - NOT_ON_TIMER , // PA 3 ** 25 ** D25 - NOT_ON_TIMER , // PA 4 ** 26 ** D26 - NOT_ON_TIMER , // PA 5 ** 27 ** D27 - NOT_ON_TIMER , // PA 6 ** 28 ** D28 - NOT_ON_TIMER , // PA 7 ** 29 ** D29 - NOT_ON_TIMER , // PC 7 ** 30 ** D30 - NOT_ON_TIMER , // PC 6 ** 31 ** D31 - NOT_ON_TIMER , // PC 5 ** 32 ** D32 - NOT_ON_TIMER , // PC 4 ** 33 ** D33 - NOT_ON_TIMER , // PC 3 ** 34 ** D34 - NOT_ON_TIMER , // PC 2 ** 35 ** D35 - NOT_ON_TIMER , // PC 1 ** 36 ** D36 - NOT_ON_TIMER , // PC 0 ** 37 ** D37 - NOT_ON_TIMER , // PD 7 ** 38 ** D38 - NOT_ON_TIMER , // PG 2 ** 39 ** D39 - NOT_ON_TIMER , // PG 1 ** 40 ** D40 - NOT_ON_TIMER , // PG 0 ** 41 ** D41 - NOT_ON_TIMER , // PL 7 ** 42 ** D42 - NOT_ON_TIMER , // PL 6 ** 43 ** D43 - TIMER5C , // PL 5 ** 44 ** D44 - TIMER5B , // PL 4 ** 45 ** D45 - TIMER5A , // PL 3 ** 46 ** D46 - NOT_ON_TIMER , // PL 2 ** 47 ** D47 - NOT_ON_TIMER , // PL 1 ** 48 ** D48 - NOT_ON_TIMER , // PL 0 ** 49 ** D49 - NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO - NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI - NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK - NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS - NOT_ON_TIMER , // PF 0 ** 54 ** A0 - NOT_ON_TIMER , // PF 1 ** 55 ** A1 - NOT_ON_TIMER , // PF 2 ** 56 ** A2 - NOT_ON_TIMER , // PF 3 ** 57 ** A3 - NOT_ON_TIMER , // PF 4 ** 58 ** A4 - NOT_ON_TIMER , // PF 5 ** 59 ** A5 - NOT_ON_TIMER , // PF 6 ** 60 ** A6 - NOT_ON_TIMER , // PF 7 ** 61 ** A7 - NOT_ON_TIMER , // PK 0 ** 62 ** A8 - NOT_ON_TIMER , // PK 1 ** 63 ** A9 - NOT_ON_TIMER , // PK 2 ** 64 ** A10 - NOT_ON_TIMER , // PK 3 ** 65 ** A11 - NOT_ON_TIMER , // PK 4 ** 66 ** A12 - NOT_ON_TIMER , // PK 5 ** 67 ** A13 - NOT_ON_TIMER , // PK 6 ** 68 ** A14 - NOT_ON_TIMER , // PK 7 ** 69 ** A15 - NOT_ON_TIMER , // PG 4 ** 70 ** - NOT_ON_TIMER , // PG 3 ** 71 ** - NOT_ON_TIMER , // PJ 2 ** 72 ** - NOT_ON_TIMER , // PJ 3 ** 73 ** - NOT_ON_TIMER , // PJ 7 ** 74 ** - NOT_ON_TIMER , // PJ 4 ** 75 ** - NOT_ON_TIMER , // PJ 5 ** 76 ** - NOT_ON_TIMER , // PJ 6 ** 77 ** - NOT_ON_TIMER , // PE 2 ** 78 ** - NOT_ON_TIMER , // PE 6 ** 79 ** -}; - -#define digitalPinToTimer_plus_70(P) ( pgm_read_byte( digital_pin_to_timer_PGM_plus_70 + (P) ) ) - -/** - * Interrupts that are not implemented - * - * INT6 E6 79 - * INT7 E7 80 - * PCINT11 J2 72 - * PCINT12 J3 73 - * PCINT13 J4 75 - * PCINT14 J5 76 - * PCINT15 J6 77 - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/spi_pins.h deleted file mode 100644 index c7951acfa3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/spi_pins.h +++ /dev/null @@ -1,65 +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 - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) - #define AVR_SCK_PIN 13 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 10 -#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) - #define AVR_SCK_PIN 7 - #define AVR_MISO_PIN 6 - #define AVR_MOSI_PIN 5 - #define AVR_SS_PIN 4 -#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - #define AVR_SCK_PIN 52 - #define AVR_MISO_PIN 50 - #define AVR_MOSI_PIN 51 - #define AVR_SS_PIN 53 -#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) - #define AVR_SCK_PIN 21 - #define AVR_MISO_PIN 23 - #define AVR_MOSI_PIN 22 - #define AVR_SS_PIN 20 -#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - #define AVR_SCK_PIN 10 - #define AVR_MISO_PIN 12 - #define AVR_MOSI_PIN 11 - #define AVR_SS_PIN 16 -#endif - -#ifndef SCK_PIN - #define SCK_PIN AVR_SCK_PIN -#endif -#ifndef MISO_PIN - #define MISO_PIN AVR_MISO_PIN -#endif -#ifndef MOSI_PIN - #define MOSI_PIN AVR_MOSI_PIN -#endif -#ifndef SS_PIN - #define SS_PIN AVR_SS_PIN -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp deleted file mode 100644 index bc08bc379b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp +++ /dev/null @@ -1,193 +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 . - * - */ - -/** - * Based on u8g_com_st7920_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#if defined(ARDUINO) && !defined(ARDUINO_ARCH_STM32) && !defined(ARDUINO_ARCH_SAM) - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "../shared/Marduino.h" -#include "../shared/Delay.h" - -#include - -uint8_t u8g_bitData, u8g_bitNotData, u8g_bitClock, u8g_bitNotClock; -volatile uint8_t *u8g_outData, *u8g_outClock; - -static void u8g_com_arduino_init_shift_out(uint8_t dataPin, uint8_t clockPin) { - u8g_outData = portOutputRegister(digitalPinToPort(dataPin)); - u8g_outClock = portOutputRegister(digitalPinToPort(clockPin)); - u8g_bitData = digitalPinToBitMask(dataPin); - u8g_bitClock = digitalPinToBitMask(clockPin); - - u8g_bitNotClock = u8g_bitClock; - u8g_bitNotClock ^= 0xFF; - - u8g_bitNotData = u8g_bitData; - u8g_bitNotData ^= 0xFF; -} - -void u8g_spiSend_sw_AVR_mode_0(uint8_t val) { - uint8_t bitData = u8g_bitData, - bitNotData = u8g_bitNotData, - bitClock = u8g_bitClock, - bitNotClock = u8g_bitNotClock; - volatile uint8_t *outData = u8g_outData, - *outClock = u8g_outClock; - U8G_ATOMIC_START(); - for (uint8_t i = 0; i < 8; i++) { - if (val & 0x80) - *outData |= bitData; - else - *outData &= bitNotData; - *outClock |= bitClock; - val <<= 1; - *outClock &= bitNotClock; - } - U8G_ATOMIC_END(); -} - -void u8g_spiSend_sw_AVR_mode_3(uint8_t val) { - uint8_t bitData = u8g_bitData, - bitNotData = u8g_bitNotData, - bitClock = u8g_bitClock, - bitNotClock = u8g_bitNotClock; - volatile uint8_t *outData = u8g_outData, - *outClock = u8g_outClock; - U8G_ATOMIC_START(); - for (uint8_t i = 0; i < 8; i++) { - *outClock &= bitNotClock; - if (val & 0x80) - *outData |= bitData; - else - *outData &= bitNotData; - *outClock |= bitClock; - val <<= 1; - } - U8G_ATOMIC_END(); -} - - -#if ENABLED(FYSETC_MINI_12864) - #define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3 -#else - #define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_0 -#endif - -uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - u8g_com_arduino_init_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK]); - u8g_com_arduino_assign_pin_output_high(u8g); - u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 0); - u8g_com_arduino_digital_write(u8g, U8G_PI_MOSI, 0); - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_com_arduino_digital_write(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_CHIP_SELECT: - #if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0 - if (arg_val) { // SCK idle state needs to be set to the proper idle state before - // the next chip select goes active - u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active - u8g_com_arduino_digital_write(u8g, U8G_PI_CS, LOW); - } - else { - u8g_com_arduino_digital_write(u8g, U8G_PI_CS, HIGH); - u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive - } - #else - u8g_com_arduino_digital_write(u8g, U8G_PI_CS, !arg_val); - #endif - break; - - case U8G_COM_MSG_WRITE_BYTE: - SPISEND_SW_AVR(arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - SPISEND_SW_AVR(*ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - SPISEND_SW_AVR(u8g_pgm_read(ptr)); - ptr++; - arg_val--; - } - } - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g_com_arduino_digital_write(u8g, U8G_PI_A0, arg_val); - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.cpp deleted file mode 100644 index 63a5031966..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.cpp +++ /dev/null @@ -1,71 +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 . - * - */ - -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#include "../../Marlin.h" - -// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s. -void watchdog_init() { - #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S) - #define WDTO_NS WDTO_8S - #else - #define WDTO_NS WDTO_4S - #endif - #if ENABLED(WATCHDOG_RESET_MANUAL) - // Enable the watchdog timer, but only for the interrupt. - // Take care, as this requires the correct order of operation, with interrupts disabled. - // See the datasheet of any AVR chip for details. - wdt_reset(); - cli(); - _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); - _WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5 - // So worked for up to WDTO_2S - sei(); - wdt_reset(); - #else - wdt_enable(WDTO_NS); // The function handles the upper bit correct. - #endif - //delay(10000); // test it! -} - -//=========================================================================== -//=================================== ISR =================================== -//=========================================================================== - -// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled. -#if ENABLED(WATCHDOG_RESET_MANUAL) - ISR(WDT_vect) { - sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED); - minkill(); // interrupt-safe final kill and infinite loop - } -#endif - -#endif // USE_WATCHDOG -#endif // __AVR__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.h deleted file mode 100644 index efd725d7d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_AVR/watchdog.h +++ /dev/null @@ -1,31 +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 - -#include - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void HAL_watchdog_refresh() { wdt_reset(); } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp deleted file mode 100644 index 20f10ce405..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp +++ /dev/null @@ -1,343 +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 . - * - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../core/macros.h" -#include "../../core/serial.h" - -#include "../shared/backtrace/unwinder.h" -#include "../shared/backtrace/unwmemaccess.h" - -#include - -// Debug monitor that dumps to the Programming port all status when -// an exception or WDT timeout happens - And then resets the board - -// All the Monitor routines must run with interrupts disabled and -// under an ISR execution context. That is why we cannot reuse the -// Serial interrupt routines or any C runtime, as we don't know the -// state we are when running them - -// A SW memory barrier, to ensure GCC does not overoptimize loops -#define sw_barrier() __asm__ volatile("": : :"memory"); - -// (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin() { - - // Disable UART interrupt in NVIC - NVIC_DisableIRQ( UART_IRQn ); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Disable clock - pmc_disable_periph_clk( ID_UART ); - - // Configure PMC - pmc_enable_periph_clk( ID_UART ); - - // Disable PDC channel - UART->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; - - // Reset and disable receiver and transmitter - UART->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS; - - // Configure mode: 8bit, No parity, 1 bit stop - UART->UART_MR = UART_MR_CHMODE_NORMAL | US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_NO; - - // Configure baudrate (asynchronous, no oversampling) to BAUDRATE bauds - UART->UART_BRGR = (SystemCoreClock / (BAUDRATE << 4)); - - // Enable receiver and transmitter - UART->UART_CR = UART_CR_RXEN | UART_CR_TXEN; -} - -// Send character through UART with no interrupts -static void TX(char c) { - while (!(UART->UART_SR & UART_SR_TXRDY)) { WDT_Restart(WDT); sw_barrier(); }; - UART->UART_THR = c; -} - -// Send String through UART -static void TX(const char* s) { - while (*s) TX(*s++); -} - -static void TXDigit(uint32_t d) { - if (d < 10) TX((char)(d+'0')); - else if (d < 16) TX((char)(d+'A'-10)); - else TX('?'); -} - -// Send Hex number thru UART -static void TXHex(uint32_t v) { - TX("0x"); - for (uint8_t i = 0; i < 8; i++, v <<= 4) - TXDigit((v >> 28) & 0xF); -} - -// Send Decimal number thru UART -static void TXDec(uint32_t v) { - if (!v) { - TX('0'); - return; - } - - char nbrs[14]; - char *p = &nbrs[0]; - while (v != 0) { - *p++ = '0' + (v % 10); - v /= 10; - } - do { - p--; - TX(*p); - } while (p != &nbrs[0]); -} - -// Dump a backtrace entry -static bool UnwReportOut(void* ctx, const UnwReport* bte) { - int* p = (int*)ctx; - - (*p)++; - TX('#'); TXDec(*p); TX(" : "); - TX(bte->name?bte->name:"unknown"); TX('@'); TXHex(bte->function); - TX('+'); TXDec(bte->address - bte->function); - TX(" PC:");TXHex(bte->address); TX('\n'); - return true; -} - -#ifdef UNW_DEBUG - void UnwPrintf(const char* format, ...) { - char dest[256]; - va_list argptr; - va_start(argptr, format); - vsprintf(dest, format, argptr); - va_end(argptr); - TX(&dest[0]); - } -#endif - -/* Table of function pointers for passing to the unwinder */ -static const UnwindCallbacks UnwCallbacks = { - UnwReportOut, - UnwReadW, - UnwReadH, - UnwReadB - #ifdef UNW_DEBUG - , UnwPrintf - #endif -}; - -/** - * HardFaultHandler_C: - * This is called from the HardFault_HandlerAsm with a pointer the Fault stack - * as the parameter. We can then read the values from the stack and place them - * into local variables for ease of reading. - * We then read the various Fault Status and Address Registers to help decode - * cause of the fault. - * The function ends with a BKPT instruction to force control back into the debugger - */ -extern "C" -void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause) { - - static const char* causestr[] = { - "NMI","Hard","Mem","Bus","Usage","Debug","WDT","RSTC" - }; - - UnwindFrame btf; - - // Dump report to the Programming port (interrupts are DISABLED) - TXBegin(); - TX("\n\n## Software Fault detected ##\n"); - TX("Cause: "); TX(causestr[cause]); TX('\n'); - - TX("R0 : "); TXHex(((unsigned long)sp[0])); TX('\n'); - TX("R1 : "); TXHex(((unsigned long)sp[1])); TX('\n'); - TX("R2 : "); TXHex(((unsigned long)sp[2])); TX('\n'); - TX("R3 : "); TXHex(((unsigned long)sp[3])); TX('\n'); - TX("R12 : "); TXHex(((unsigned long)sp[4])); TX('\n'); - TX("LR : "); TXHex(((unsigned long)sp[5])); TX('\n'); - TX("PC : "); TXHex(((unsigned long)sp[6])); TX('\n'); - TX("PSR : "); TXHex(((unsigned long)sp[7])); TX('\n'); - - // Configurable Fault Status Register - // Consists of MMSR, BFSR and UFSR - TX("CFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED28)))); TX('\n'); - - // Hard Fault Status Register - TX("HFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED2C)))); TX('\n'); - - // Debug Fault Status Register - TX("DFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED30)))); TX('\n'); - - // Auxiliary Fault Status Register - TX("AFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED3C)))); TX('\n'); - - // Read the Fault Address Registers. These may not contain valid values. - // Check BFARVALID/MMARVALID to see if they are valid values - // MemManage Fault Address Register - TX("MMAR : "); TXHex((*((volatile unsigned long *)(0xE000ED34)))); TX('\n'); - - // Bus Fault Address Register - TX("BFAR : "); TXHex((*((volatile unsigned long *)(0xE000ED38)))); TX('\n'); - - TX("ExcLR: "); TXHex(lr); TX('\n'); - TX("ExcSP: "); TXHex((unsigned long)sp); TX('\n'); - - btf.sp = ((unsigned long)sp) + 8*4; // The original stack pointer - btf.fp = btf.sp; - btf.lr = ((unsigned long)sp[5]); - btf.pc = ((unsigned long)sp[6]) | 1; // Force Thumb, as CORTEX only support it - - // Perform a backtrace - TX("\nBacktrace:\n\n"); - int ctr = 0; - UnwindStart(&btf, &UnwCallbacks, &ctr); - - // Disable all NVIC interrupts - NVIC->ICER[0] = 0xFFFFFFFF; - NVIC->ICER[1] = 0xFFFFFFFF; - - // Relocate VTOR table to default position - SCB->VTOR = 0; - - // Disable USB - otg_disable(); - - // Restart watchdog - WDT_Restart(WDT); - - // Reset controller - NVIC_SystemReset(); - for (;;) WDT_Restart(WDT); -} - -__attribute__((naked)) void NMI_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#0") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void HardFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#1") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void MemManage_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#2") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void BusFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#3") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void UsageFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#4") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void DebugMon_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#5") - A("b HardFault_HandlerC") - ); -} - -/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#6") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void RSTC_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#7") - A("b HardFault_HandlerC") - ); -} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp deleted file mode 100644 index c7b7007053..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp +++ /dev/null @@ -1,999 +0,0 @@ - -/* EEPROM emulation over flash with reduced wear - * - * We will use 2 contiguous groups of pages as main and alternate. - * We want an structure that allows to read as fast as possible, - * without the need of scanning the whole FLASH memory. - * - * FLASH bits default erased state is 1, and can be set to 0 - * on a per bit basis. To reset them to 1, a full page erase - * is needed. - * - * Values are stored as differences that should be applied to a - * completely erased EEPROM (filled with 0xFFs). We just encode - * the starting address of the values to change, the length of - * the block of new values, and the values themselves. All diffs - * are accumulated into a RAM buffer, compacted into the least - * amount of non overlapping diffs possible and sorted by starting - * address before being saved into the next available page of FLASH - * of the current group. - * Once the current group is completely full, we compact it and save - * it into the other group, then erase the current group and switch - * to that new group and set it as current. - * - * The FLASH endurance is about 1/10 ... 1/100 of an EEPROM - * endurance, but EEPROM endurance is specified per byte, not - * per page. We can't emulate EE endurance with FLASH for all - * bytes, but we can emulate endurance for a given percent of - * bytes. - * - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM) - -#include "../shared/Marduino.h" -#include "../shared/persistent_store_api.h" - -#define EEPROMSize 4096 -#define PagesPerGroup 128 -#define GroupCount 2 -#define PageSize 256u - - /* Flash storage */ -typedef struct FLASH_SECTOR { - uint8_t page[PageSize]; -} FLASH_SECTOR_T; - -#define PAGE_FILL \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \ - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - -#define FLASH_INIT_FILL \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL, \ - PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL,PAGE_FILL - -/* This is the FLASH area used to emulate a 2Kbyte EEPROM -- We need this buffer aligned - to a 256 byte boundary. */ -static const uint8_t flashStorage[PagesPerGroup * GroupCount * PageSize] __attribute__ ((aligned (PageSize))) = { FLASH_INIT_FILL }; - -/* Get the address of an specific page */ -static const FLASH_SECTOR_T* getFlashStorage(int page) { - return (const FLASH_SECTOR_T*)&flashStorage[page*PageSize]; -} - -static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes - curPage = 0, // Current FLASH page inside the group - curGroup = 0xFF; // Current FLASH group - -//#define EE_EMU_DEBUG -#ifdef EE_EMU_DEBUG - static void ee_Dump(int page,const void* data) { - - const uint8_t* c = (const uint8_t*) data; - char buffer[80]; - - sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page); - SERIAL_ECHO(buffer); - - char* p = &buffer[0]; - for (int i = 0; i< PageSize; ++i) { - if ((i & 0xF) == 0) p += sprintf_P(p, PSTR("%04x] "), i); - - p += sprintf_P(p, PSTR(" %02x"), c[i]); - if ((i & 0xF) == 0xF) { - *p++ = '\n'; - *p = 0; - SERIAL_ECHO(buffer); - p = &buffer[0]; - } - } - } -#endif - -/* Flash Writing Protection Key */ -#define FWP_KEY 0x5Au - -#if SAM4S_SERIES - #define EEFC_FCR_FCMD(value) \ - ((EEFC_FCR_FCMD_Msk & ((value) << EEFC_FCR_FCMD_Pos))) - #define EEFC_ERROR_FLAGS (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE | EEFC_FSR_FLERR) -#else - #define EEFC_ERROR_FLAGS (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE) -#endif - - -/** - * Writes the contents of the specified page (no previous erase) - * @param page (page #) - * @param data (pointer to the data buffer) - */ -__attribute__ ((long_call, section (".ramfunc"))) -static bool ee_PageWrite(uint16_t page,const void* data) { - - uint16_t i; - uint32_t addrflash = ((uint32_t)getFlashStorage(page)); - - // Read the flash contents - uint32_t pageContents[PageSize>>2]; - memcpy(pageContents, (void*)addrflash, PageSize); - - // We ONLY want to toggle bits that have changed, and that have changed to 0. - // SAM3X8E tends to destroy contiguous bits if reprogrammed without erasing, so - // we try by all means to avoid this. That is why it says: "The Partial - // Programming mode works only with 128-bit (or higher) boundaries. It cannot - // be used with boundaries lower than 128 bits (8, 16 or 32-bit for example)." - // All bits that did not change, set them to 1. - for (i = 0; i > 2; i++) - pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i])); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM PageWrite ", page); - SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); - SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); - SERIAL_FLUSH(); - #endif - - // Get the page relative to the start of the EFC controller, and the EFC controller to use - Efc *efc; - uint16_t fpage; - if (addrflash >= IFLASH1_ADDR) { - efc = EFC1; - fpage = (addrflash - IFLASH1_ADDR) / IFLASH1_PAGE_SIZE; - } - else { - efc = EFC0; - fpage = (addrflash - IFLASH0_ADDR) / IFLASH0_PAGE_SIZE; - } - - // Get the page that must be unlocked, then locked - uint16_t lpage = fpage & (~((IFLASH0_LOCK_REGION_SIZE / IFLASH0_PAGE_SIZE) - 1)); - - // Disable all interrupts - __disable_irq(); - - // Get the FLASH wait states - uint32_t orgWS = (efc->EEFC_FMR & EEFC_FMR_FWS_Msk) >> EEFC_FMR_FWS_Pos; - - // Set wait states to 6 (SAM errata) - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(6); - - // Unlock the flash page - uint32_t status; - efc->EEFC_FCR = EEFC_FCR_FKEY(FWP_KEY) | EEFC_FCR_FARG(lpage) | EEFC_FCR_FCMD(EFC_FCMD_CLB); - while (((status = efc->EEFC_FSR) & EEFC_FSR_FRDY) != EEFC_FSR_FRDY) { - // force compiler to not optimize this -- NOPs don't work! - __asm__ __volatile__(""); - }; - - if ((status & EEFC_ERROR_FLAGS) != 0) { - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ", page); - #endif - return false; - } - - // Write page and lock: Writing 8-bit and 16-bit data is not allowed and may lead to unpredictable data corruption. - const uint32_t * aligned_src = (const uint32_t *) &pageContents[0]; /*data;*/ - uint32_t * p_aligned_dest = (uint32_t *) addrflash; - for (i = 0; i < (IFLASH0_PAGE_SIZE / sizeof(uint32_t)); ++i) { - *p_aligned_dest++ = *aligned_src++; - } - efc->EEFC_FCR = EEFC_FCR_FKEY(FWP_KEY) | EEFC_FCR_FARG(fpage) | EEFC_FCR_FCMD(EFC_FCMD_WPL); - while (((status = efc->EEFC_FSR) & EEFC_FSR_FRDY) != EEFC_FSR_FRDY) { - // force compiler to not optimize this -- NOPs don't work! - __asm__ __volatile__(""); - }; - - if ((status & EEFC_ERROR_FLAGS) != 0) { - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Write failure for page ", page); - #endif - return false; - } - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - // Compare contents - if (memcmp(getFlashStorage(page),data,PageSize)) { - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Verify Write failure for page ", page); - - ee_Dump( page,(uint32_t *) addrflash); - ee_Dump(-page,data); - - // Calculate count of changed bits - uint32_t* p1 = (uint32_t*)addrflash; - uint32_t* p2 = (uint32_t*)data; - int count = 0; - for (i =0; i> 2; i++) { - if (p1[i] != p2[i]) { - uint32_t delta = p1[i] ^ p2[i]; - while (delta) { - if ((delta&1) != 0) - count++; - delta >>= 1; - } - } - } - SERIAL_ECHOLNPAIR("--> Differing bits: ", count); - #endif - - return false; - } - - return true; -} - -/** - * Erases the contents of the specified page - * @param page (page #) - */ -__attribute__ ((long_call, section (".ramfunc"))) -static bool ee_PageErase(uint16_t page) { - - uint16_t i; - uint32_t addrflash = ((uint32_t)getFlashStorage(page)); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM PageErase ", page); - SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); - SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); - SERIAL_FLUSH(); - #endif - - // Get the page relative to the start of the EFC controller, and the EFC controller to use - Efc *efc; - uint16_t fpage; - if (addrflash >= IFLASH1_ADDR) { - efc = EFC1; - fpage = (addrflash - IFLASH1_ADDR) / IFLASH1_PAGE_SIZE; - } - else { - efc = EFC0; - fpage = (addrflash - IFLASH0_ADDR) / IFLASH0_PAGE_SIZE; - } - - // Get the page that must be unlocked, then locked - uint16_t lpage = fpage & (~((IFLASH0_LOCK_REGION_SIZE / IFLASH0_PAGE_SIZE) - 1)); - - // Disable all interrupts - __disable_irq(); - - // Get the FLASH wait states - uint32_t orgWS = (efc->EEFC_FMR & EEFC_FMR_FWS_Msk) >> EEFC_FMR_FWS_Pos; - - // Set wait states to 6 (SAM errata) - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(6); - - // Unlock the flash page - uint32_t status; - efc->EEFC_FCR = EEFC_FCR_FKEY(FWP_KEY) | EEFC_FCR_FARG(lpage) | EEFC_FCR_FCMD(EFC_FCMD_CLB); - while (((status = efc->EEFC_FSR) & EEFC_FSR_FRDY) != EEFC_FSR_FRDY) { - // force compiler to not optimize this -- NOPs don't work! - __asm__ __volatile__(""); - }; - if ((status & EEFC_ERROR_FLAGS) != 0) { - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ",page); - #endif - return false; - } - - // Erase Write page and lock: Writing 8-bit and 16-bit data is not allowed and may lead to unpredictable data corruption. - uint32_t * p_aligned_dest = (uint32_t *) addrflash; - for (i = 0; i < (IFLASH0_PAGE_SIZE / sizeof(uint32_t)); ++i) { - *p_aligned_dest++ = 0xFFFFFFFF; - } - efc->EEFC_FCR = EEFC_FCR_FKEY(FWP_KEY) | EEFC_FCR_FARG(fpage) | EEFC_FCR_FCMD(EFC_FCMD_EWPL); - while (((status = efc->EEFC_FSR) & EEFC_FSR_FRDY) != EEFC_FSR_FRDY) { - // force compiler to not optimize this -- NOPs don't work! - __asm__ __volatile__(""); - }; - if ((status & EEFC_ERROR_FLAGS) != 0) { - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Erase failure for page ",page); - #endif - return false; - } - - // Restore original wait states - efc->EEFC_FMR = (efc->EEFC_FMR & (~EEFC_FMR_FWS_Msk)) | EEFC_FMR_FWS(orgWS); - - // Reenable interrupts - __enable_irq(); - - // Check erase - uint32_t * aligned_src = (uint32_t *) addrflash; - for (i = 0; i < PageSize >> 2; i++) { - if (*aligned_src++ != 0xFFFFFFFF) { - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page); - - ee_Dump( page,(uint32_t *) addrflash); - #endif - return false; - } - } - - return true; -} -static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) { - - uint32_t baddr; - uint32_t blen; - - // If we were requested an address outside of the emulated range, fail now - if (address >= EEPROMSize) - return false; - - // Check that the value is not contained in the RAM buffer - if (!excludeRAMBuffer) { - uint16_t i = 0; - while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Get the address of the block - baddr = buffer[i] | (buffer[i + 1] << 8); - - // Get the length of the block - blen = buffer[i + 2]; - - // If we reach the end of the list, break loop - if (blen == 0xFF) - break; - - // Check if data is contained in this block - if (address >= baddr && - address < (baddr + blen)) { - - // Yes, it is contained. Return it! - return buffer[i + 3 + address - baddr]; - } - - // As blocks are always sorted, if the starting address of this block is higher - // than the address we are looking for, break loop now - We wont find the value - // associated to the address - if (baddr > address) - break; - - // Jump to the next block - i += 3 + blen; - } - } - - // It is NOT on the RAM buffer. It could be stored in FLASH. We are - // ensured on a given FLASH page, address contents are never repeated - // but on different pages, there is no such warranty, so we must go - // backwards from the last written FLASH page to the first one. - for (int page = curPage - 1; page >= 0; --page) { - - // Get a pointer to the flash page - uint8_t* pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); - - uint16_t i = 0; - while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Get the address of the block - baddr = pflash[i] | (pflash[i + 1] << 8); - - // Get the length of the block - blen = pflash[i + 2]; - - // If we reach the end of the list, break loop - if (blen == 0xFF) - break; - - // Check if data is contained in this block - if (address >= baddr && address < (baddr + blen)) - return pflash[i + 3 + address - baddr]; // Yes, it is contained. Return it! - - // As blocks are always sorted, if the starting address of this block is higher - // than the address we are looking for, break loop now - We wont find the value - // associated to the address - if (baddr > address) break; - - // Jump to the next block - i += 3 + blen; - } - } - - // If reached here, value is not stored, so return its default value - return 0xFF; -} - -static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer = false) { - uint32_t baddr, - blen, - nextAddr = 0xFFFF, - nextRange = 0; - - // Check that the value is not contained in the RAM buffer - if (!excludeRAMBuffer) { - uint16_t i = 0; - while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Get the address of the block - baddr = buffer[i] | (buffer[i + 1] << 8); - - // Get the length of the block - blen = buffer[i + 2]; - - // If we reach the end of the list, break loop - if (blen == 0xFF) break; - - // Check if address and address + 1 is contained in this block - if (address >= baddr && address < (baddr + blen)) - return address | ((blen - address + baddr) << 16); // Yes, it is contained. Return it! - - // Otherwise, check if we can use it as a limit - if (baddr > address && baddr < nextAddr) { - nextAddr = baddr; - nextRange = blen; - } - - // As blocks are always sorted, if the starting address of this block is higher - // than the address we are looking for, break loop now - We wont find the value - // associated to the address - if (baddr > address) break; - - // Jump to the next block - i += 3 + blen; - } - } - - // It is NOT on the RAM buffer. It could be stored in FLASH. We are - // ensured on a given FLASH page, address contents are never repeated - // but on different pages, there is no such warranty, so we must go - // backwards from the last written FLASH page to the first one. - for (int page = curPage - 1; page >= 0; --page) { - - // Get a pointer to the flash page - uint8_t* pflash = (uint8_t*)getFlashStorage(page + curGroup * PagesPerGroup); - - uint16_t i = 0; - while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Get the address of the block - baddr = pflash[i] | (pflash[i + 1] << 8); - - // Get the length of the block - blen = pflash[i + 2]; - - // If we reach the end of the list, break loop - if (blen == 0xFF) break; - - // Check if data is contained in this block - if (address >= baddr && address < (baddr + blen)) - return address | ((blen - address + baddr) << 16); // Yes, it is contained. Return it! - - // Otherwise, check if we can use it as a limit - if (baddr > address && baddr < nextAddr) { - nextAddr = baddr; - nextRange = blen; - } - - // As blocks are always sorted, if the starting address of this block is higher - // than the address we are looking for, break loop now - We wont find the value - // associated to the address - if (baddr > address) break; - - // Jump to the next block - i += 3 + blen; - } - } - - // If reached here, we will return the next valid address - return nextAddr | (nextRange << 16); -} - -static bool ee_IsPageClean(int page) { - uint32_t* pflash = (uint32_t*) getFlashStorage(page); - for (uint16_t i = 0; i < (PageSize >> 2); ++i) - if (*pflash++ != 0xFFFFFFFF) return false; - return true; -} - -static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData = 0xFF) { - - // Check if RAM buffer has something to be written - bool isEmpty = true; - uint32_t* p = (uint32_t*) &buffer[0]; - for (uint16_t j = 0; j < (PageSize >> 2); j++) { - if (*p++ != 0xFFFFFFFF) { - isEmpty = false; - break; - } - } - - // If something has to be written, do so! - if (!isEmpty) { - - // Write the current ram buffer into FLASH - ee_PageWrite(curPage + curGroup * PagesPerGroup, buffer); - - // Clear the RAM buffer - memset(buffer, 0xFF, sizeof(buffer)); - - // Increment the page to use the next time - ++curPage; - } - - // Did we reach the maximum count of available pages per group for storage ? - if (curPage < PagesPerGroup) { - - // Do we have an override address ? - if (overrideAddress < EEPROMSize) { - - // Yes, just store the value into the RAM buffer - buffer[0] = overrideAddress & 0xFF; - buffer[0 + 1] = (overrideAddress >> 8) & 0xFF; - buffer[0 + 2] = 1; - buffer[0 + 3] = overrideData; - } - - // Done! - return true; - } - - // We have no space left on the current group - We must compact the values - uint16_t i = 0; - - // Compute the next group to use - int curwPage = 0, curwGroup = curGroup + 1; - if (curwGroup >= GroupCount) curwGroup = 0; - - uint32_t rdAddr = 0; - do { - - // Get the next valid range - uint32_t addrRange = ee_GetAddrRange(rdAddr, true); - - // Make sure not to skip the override address, if specified - int rdRange; - if (overrideAddress < EEPROMSize && - rdAddr <= overrideAddress && - (addrRange & 0xFFFF) > overrideAddress) { - - rdAddr = overrideAddress; - rdRange = 1; - } - else { - rdAddr = addrRange & 0xFFFF; - rdRange = addrRange >> 16; - } - - // If no range, break loop - if (rdRange == 0) - break; - - do { - - // Get the value - uint8_t rdValue = overrideAddress == rdAddr ? overrideData : ee_Read(rdAddr, true); - - // Do not bother storing default values - if (rdValue != 0xFF) { - - // If we have room, add it to the buffer - if (buffer[i + 2] == 0xFF) { - - // Uninitialized buffer, just add it! - buffer[i] = rdAddr & 0xFF; - buffer[i + 1] = (rdAddr >> 8) & 0xFF; - buffer[i + 2] = 1; - buffer[i + 3] = rdValue; - - } - else { - // Buffer already has contents. Check if we can extend it - - // Get the address of the block - uint32_t baddr = buffer[i] | (buffer[i + 1] << 8); - - // Get the length of the block - uint32_t blen = buffer[i + 2]; - - // Can we expand it ? - if (rdAddr == (baddr + blen) && - i < (PageSize - 4) && /* This block has a chance to contain data AND */ - buffer[i + 2] < (PageSize - i - 3)) {/* There is room for this block to be expanded */ - - // Yes, do it - ++buffer[i + 2]; - - // And store the value - buffer[i + 3 + rdAddr - baddr] = rdValue; - - } - else { - - // No, we can't expand it - Skip the existing block - i += 3 + blen; - - // Can we create a new slot ? - if (i > (PageSize - 4)) { - - // Not enough space - Write the current buffer to FLASH - ee_PageWrite(curwPage + curwGroup * PagesPerGroup, buffer); - - // Advance write page (as we are compacting, should never overflow!) - ++curwPage; - - // Clear RAM buffer - memset(buffer, 0xFF, sizeof(buffer)); - - // Start fresh */ - i = 0; - } - - // Enough space, add the new block - buffer[i] = rdAddr & 0xFF; - buffer[i + 1] = (rdAddr >> 8) & 0xFF; - buffer[i + 2] = 1; - buffer[i + 3] = rdValue; - } - } - } - - // Go to the next address - ++rdAddr; - - // Repeat for bytes of this range - } while (--rdRange); - - // Repeat until we run out of ranges - } while (rdAddr < EEPROMSize); - - // We must erase the previous group, in preparation for the next swap - for (int page = 0; page < curPage; page++) { - ee_PageErase(page + curGroup * PagesPerGroup); - } - - // Finally, Now the active group is the created new group - curGroup = curwGroup; - curPage = curwPage; - - // Done! - return true; -} - -static bool ee_Write(uint32_t address, uint8_t data) { - - // If we were requested an address outside of the emulated range, fail now - if (address >= EEPROMSize) return false; - - // Lets check if we have a block with that data previously defined. Block - // start addresses are always sorted in ascending order - uint16_t i = 0; - while (i <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Get the address of the block - uint32_t baddr = buffer[i] | (buffer[i + 1] << 8); - - // Get the length of the block - uint32_t blen = buffer[i + 2]; - - // If we reach the end of the list, break loop - if (blen == 0xFF) - break; - - // Check if data is contained in this block - if (address >= baddr && - address < (baddr + blen)) { - - // Yes, it is contained. Just modify it - buffer[i + 3 + address - baddr] = data; - - // Done! - return true; - } - - // Maybe we could add it to the front or to the back - // of this block ? - if ((address + 1) == baddr || address == (baddr + blen)) { - - // Potentially, it could be done. But we must ensure there is room - // so we can expand the block. Lets find how much free space remains - uint32_t iend = i; - do { - uint32_t ln = buffer[iend + 2]; - if (ln == 0xFF) break; - iend += 3 + ln; - } while (iend <= (PageSize - 4)); /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - - // Here, inxt points to the first free address in the buffer. Do we have room ? - if (iend < PageSize) { - // Yes, at least a byte is free - We can expand the block - - // Do we have to insert at the beginning ? - if ((address + 1) == baddr) { - - // Insert at the beginning - - // Make room at the beginning for our byte - memmove(&buffer[i + 3 + 1], &buffer[i + 3], iend - i - 3); - - // Adjust the header and store the data - buffer[i] = address & 0xFF; - buffer[i + 1] = (address >> 8) & 0xFF; - buffer[i + 2]++; - buffer[i + 3] = data; - - } - else { - - // Insert at the end - There is a very interesting thing that could happen here: - // Maybe we could coalesce the next block with this block. Let's try to do it! - uint16_t inext = i + 3 + blen; - if (inext <= (PageSize - 4) && - (buffer[inext] | uint16_t(buffer[inext + 1] << 8)) == (baddr + blen + 1)) { - // YES! ... we can coalesce blocks! . Do it! - - // Adjust this block header to include the next one - buffer[i + 2] += buffer[inext + 2] + 1; - - // Store data at the right place - buffer[i + 3 + blen] = data; - - // Remove the next block header and append its data - memmove(&buffer[inext + 1], &buffer[inext + 3], iend - inext - 3); - - // Finally, as we have saved 2 bytes at the end, make sure to clean them - buffer[iend - 2] = 0xFF; - buffer[iend - 1] = 0xFF; - - } - else { - // NO ... No coalescing possible yet - - // Make room at the end for our byte - memmove(&buffer[i + 3 + blen + 1], &buffer[i + 3 + blen], iend - i - 3 - blen); - - // And add the data to the block - buffer[i + 2]++; - buffer[i + 3 + blen] = data; - } - } - - // Done! - return true; - } - } - - // As blocks are always sorted, if the starting address of this block is higher - // than the address we are looking for, break loop now - We wont find the value - // associated to the address - if (baddr > address) break; - - // Jump to the next block - i += 3 + blen; - } - - // Value is not stored AND we can't expand previous block to contain it. We must create a new block - - // First, lets find how much free space remains - uint32_t iend = i; - while (iend <= (PageSize - 4)) { /* (PageSize - 4) because otherwise, there is not enough room for data and headers */ - uint32_t ln = buffer[iend + 2]; - if (ln == 0xFF) break; - iend += 3 + ln; - } - - // If there is room for a new block, insert it at the proper place - if (iend <= (PageSize - 4)) { - - // We have room to create a new block. Do so --- But add - // the block at the proper position, sorted by starting - // address, so it will be possible to compact it with other blocks. - - // Make space - memmove(&buffer[i + 4], &buffer[i], iend - i); - - // And add the block - buffer[i] = address & 0xFF; - buffer[i + 1] = (address >> 8) & 0xFF; - buffer[i + 2] = 1; - buffer[i + 3] = data; - - // Done! - return true; - } - - // Not enough room to store this information on this FLASH page - Perform a - // flush and override the address with the specified contents - return ee_Flush(address, data); -} - -static void ee_Init() { - - // Just init once! - if (curGroup != 0xFF) return; - - // Clean up the SRAM buffer - memset(buffer, 0xFF, sizeof(buffer)); - - // Now, we must find out the group where settings are stored - for (curGroup = 0; curGroup < GroupCount; curGroup++) - if (!ee_IsPageClean(curGroup * PagesPerGroup)) break; - - // If all groups seem to be used, default to first group - if (curGroup >= GroupCount) curGroup = 0; - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Current Group: ",curGroup); - SERIAL_FLUSH(); - #endif - - // Now, validate that all the other group pages are empty - for (int grp = 0; grp < GroupCount; grp++) { - if (grp == curGroup) continue; - - for (int page = 0; page < PagesPerGroup; page++) { - if (!ee_IsPageClean(grp * PagesPerGroup + page)) { - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp); - SERIAL_FLUSH(); - #endif - ee_PageErase(grp * PagesPerGroup + page); - } - } - } - - // Finally, for the active group, determine the first unused page - // and also validate that all the other ones are clean - for (curPage = 0; curPage < PagesPerGroup; curPage++) { - if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) { - #ifdef EE_EMU_DEBUG - ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage)); - #endif - break; - } - } - - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage); - SERIAL_FLUSH(); - #endif - - // Make sure the pages following the first clean one are also clean - for (int page = curPage + 1; page < PagesPerGroup; page++) { - if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { - #ifdef EE_EMU_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup); - SERIAL_FLUSH(); - ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); - #endif - ee_PageErase(curGroup * PagesPerGroup + page); - } - } -} - -uint8_t eeprom_read_byte(uint8_t* addr) { - ee_Init(); - return ee_Read((uint32_t)addr); -} - -void eeprom_write_byte(uint8_t* addr, uint8_t value) { - ee_Init(); - ee_Write((uint32_t)addr, value); -} - -void eeprom_update_block(const void* __src, void* __dst, size_t __n) { - uint8_t* dst = (uint8_t*)__dst; - const uint8_t* src = (const uint8_t*)__src; - while (__n--) { - eeprom_write_byte(dst, *src); - ++dst; - ++src; - } -} - -void eeprom_read_block(void* __dst, const void* __src, size_t __n) { - uint8_t* dst = (uint8_t*)__dst; - uint8_t* src = (uint8_t*)__src; - while (__n--) { - *dst = eeprom_read_byte(src); - ++dst; - ++src; - } -} - -void eeprom_flush() { - ee_Flush(); -} - -#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM) -#endif // ARDUINO_ARCH_AVR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.cpp deleted file mode 100644 index 130779896d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 . - */ - -/** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" - -#include -#include "usb/usb_task.h" - -// ------------------------ -// Public Variables -// ------------------------ - -uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// HAL initialization task -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 - #endif - usb_task_init(); -} - -// HAL idle task -void HAL_idletask() { - // Perform USB stack housekeeping - usb_task_idle(); -} - -// Disable interrupts -void cli() { noInterrupts(); } - -// Enable interrupts -void sei() { interrupts(); } - -void HAL_clear_reset_source() { } - -uint8_t HAL_get_reset_source() { - switch ((RSTC->RSTC_SR >> 8) & 0x07) { - case 0: return RST_POWER_ON; - case 1: return RST_BACKUP; - case 2: return RST_WATCHDOG; - case 3: return RST_SOFTWARE; - case 4: return RST_EXTERNAL; - default: return 0; - } -} - -void _delay_ms(const int delay_ms) { - // Todo: port for Due? - delay(delay_ms); -} - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// Return free memory between end of heap (or end bss) and whatever is current -int freeMemory() { - int free_memory, heap_end = (int)_sbrk(0); - return (int)&free_memory - (heap_end ?: (int)&_ebss); -} - -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - HAL_adc_result = analogRead(adc_pin); -} - -uint16_t HAL_adc_get_result() { - // nop - return HAL_adc_result; -} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.h deleted file mode 100644 index 64cff24665..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -/** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - */ - -#define CPU_32_BIT - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "timers.h" - -#include - -// Define MYSERIAL0/1 before MarlinSerial includes! -#if SERIAL_PORT == -1 - #define MYSERIAL0 customizedSerial1 -#elif SERIAL_PORT == 0 - #define MYSERIAL0 Serial -#elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 -#else - #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration." -#endif - -#ifdef SERIAL_PORT_2 - #if SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." - #endif - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 customizedSerial2 - #elif SERIAL_PORT_2 == 0 - #define MYSERIAL1 Serial - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 Serial1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 Serial2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 Serial3 - #else - #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." - #endif - #define NUM_SERIAL 2 -#else - #define NUM_SERIAL 1 -#endif - -#include "MarlinSerial.h" -#include "MarlinSerialUSB.h" - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*((void**)(addr))) -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - -typedef int8_t pin_t; - -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo - -// -// Interrupts -// -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -void cli(); // Disable interrupts -void sei(); // Enable interrupts - -void HAL_clear_reset_source(); // clear reset reason -uint8_t HAL_get_reset_source(); // get reset reason - -// -// EEPROM -// -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *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); - -// -// ADC -// -extern uint16_t HAL_adc_result; // result of last ADC conversion - -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1) -#endif - -#define HAL_ANALOG_SELECT(pin) - -inline void HAL_adc_init() {}//todo - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#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(); - -// -// Pin Map -// -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -// -// Tone -// -void toneInit(); -void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); -void noTone(const pin_t _pin); - -// Enable hooks into idle and setup for HAL -#define HAL_IDLETASK 1 -void HAL_idletask(); -void HAL_init(); - -// -// Utility functions -// -void _delay_ms(const int delay); - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp deleted file mode 100644 index 35763a5ec7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp +++ /dev/null @@ -1,826 +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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - * - * Completely rewritten and tuned by Eduardo José Tagle in 2017/2018 - * in ARM thumb2 inline assembler and tuned for maximum speed and performance - * allowing SPI clocks of up to 12 Mhz to increase SD card read/write performance - */ - -/** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "../shared/Delay.h" - -// ------------------------ -// Public functions -// ------------------------ - -#if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI) - - // ------------------------ - // Software SPI - // ------------------------ - - // Make sure GCC optimizes this file. - // Note that this line triggers a bug in GCC which is fixed by casting. - // See the note below. - #pragma GCC optimize (3) - - typedef uint8_t (*pfnSpiTransfer)(uint8_t b); - typedef void (*pfnSpiRxBlock)(uint8_t* buf, uint32_t nbyte); - typedef void (*pfnSpiTxBlock)(const uint8_t* buf, uint32_t nbyte); - - /* ---------------- Macros to be able to access definitions from asm */ - #define _PORT(IO) DIO ## IO ## _WPORT - #define _PIN_MASK(IO) MASK(DIO ## IO ## _PIN) - #define _PIN_SHIFT(IO) DIO ## IO ## _PIN - #define PORT(IO) _PORT(IO) - #define PIN_MASK(IO) _PIN_MASK(IO) - #define PIN_SHIFT(IO) _PIN_SHIFT(IO) - - // run at ~8 .. ~10Mhz - Tx version (Rx data discarded) - static uint8_t spiTransferTx0(uint8_t bout) { // using Mode 0 - uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30; /* SODR of port */ - uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN); - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); - uint32_t idx = 0; - - /* Negate bout, as the assembler requires a negated value */ - bout = ~bout; - - /* The software SPI routine */ - __asm__ __volatile__( - A(".syntax unified") // is to prevent CM0,CM1 non-unified syntax - - /* Bit 7 */ - A("ubfx %[idx],%[txval],#7,#1") /* Place bit 7 in bit 0 of idx*/ - - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#6,#1") /* Place bit 6 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 6 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#5,#1") /* Place bit 5 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 5 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#4,#1") /* Place bit 4 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 4 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#3,#1") /* Place bit 3 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 3 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#2,#1") /* Place bit 2 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 2 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#1,#1") /* Place bit 1 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 1 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[idx],%[txval],#0,#1") /* Place bit 0 in bit 0 of idx*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 0 */ - A("str %[mosi_mask],[%[mosi_port], %[idx],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("nop") /* Result will be 0 */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - : [idx]"+r"( idx ) - : [txval]"r"( bout ) , - [mosi_mask]"r"( MOSI_MASK ), - [mosi_port]"r"( MOSI_PORT_PLUS30 ), - [sck_mask]"r"( SCK_MASK ), - [sck_port]"r"( SCK_PORT_PLUS30 ) - : "cc" - ); - - return 0; - } - - // Calculates the bit band alias address and returns a pointer address to word. - // addr: The byte address of bitbanding bit. - // bit: The bit position of bitbanding bit. - #define BITBAND_ADDRESS(addr, bit) \ - (((uint32_t)(addr) & 0xF0000000) + 0x02000000 + ((uint32_t)(addr)&0xFFFFF)*32 + (bit)*4) - - // run at ~8 .. ~10Mhz - Rx version (Tx line not altered) - static uint8_t spiTransferRx0(uint8_t) { // using Mode 0 - uint32_t bin = 0; - uint32_t work = 0; - uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */ - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); - - /* The software SPI routine */ - __asm__ __volatile__( - A(".syntax unified") // is to prevent CM0,CM1 non-unified syntax - - /* bit 7 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#7,#1") /* Store read bit as the bit 7 */ - - /* bit 6 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#6,#1") /* Store read bit as the bit 6 */ - - /* bit 5 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#5,#1") /* Store read bit as the bit 5 */ - - /* bit 4 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#4,#1") /* Store read bit as the bit 4 */ - - /* bit 3 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#3,#1") /* Store read bit as the bit 3 */ - - /* bit 2 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#2,#1") /* Store read bit as the bit 2 */ - - /* bit 1 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#1,#1") /* Store read bit as the bit 1 */ - - /* bit 0 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#0,#1") /* Store read bit as the bit 0 */ - - : [bin]"+r"(bin), - [work]"+r"(work) - : [bitband_miso_port]"r"( BITBAND_MISO_PORT ), - [sck_mask]"r"( SCK_MASK ), - [sck_port]"r"( SCK_PORT_PLUS30 ) - : "cc" - ); - - return bin; - } - - // run at ~4Mhz - static uint8_t spiTransfer1(uint8_t b) { // using Mode 0 - int bits = 8; - do { - WRITE(MOSI_PIN, b & 0x80); - b <<= 1; // little setup time - - WRITE(SCK_PIN, HIGH); - DELAY_NS(125); // 10 cycles @ 84mhz - - b |= (READ(MISO_PIN) != 0); - - WRITE(SCK_PIN, LOW); - DELAY_NS(125); // 10 cycles @ 84mhz - } while (--bits); - return b; - } - - // all the others - static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4uS => 125khz - - static uint8_t spiTransferX(uint8_t b) { // using Mode 0 - int bits = 8; - do { - WRITE(MOSI_PIN, b & 0x80); - b <<= 1; // little setup time - - WRITE(SCK_PIN, HIGH); - __delay_4cycles(spiDelayCyclesX4); - - b |= (READ(MISO_PIN) != 0); - - WRITE(SCK_PIN, LOW); - __delay_4cycles(spiDelayCyclesX4); - } while (--bits); - return b; - } - - // Pointers to generic functions for byte transfers - - /** - * Note: The cast is unnecessary, but without it, this file triggers a GCC 4.8.3-2014 bug. - * Later GCC versions do not have this problem, but at this time (May 2018) Arduino still - * uses that buggy and obsolete GCC version!! - */ - static pfnSpiTransfer spiTransferRx = (pfnSpiTransfer)spiTransferX; - static pfnSpiTransfer spiTransferTx = (pfnSpiTransfer)spiTransferX; - - // Block transfers run at ~8 .. ~10Mhz - Tx version (Rx data discarded) - static void spiTxBlock0(const uint8_t* ptr, uint32_t todo) { - uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30; /* SODR of port */ - uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN); - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); - uint32_t work = 0; - uint32_t txval = 0; - - /* The software SPI routine */ - __asm__ __volatile__( - A(".syntax unified") // is to prevent CM0,CM1 non-unified syntax - - L("loop%=") - A("ldrb.w %[txval], [%[ptr]], #1") /* Load value to send, increment buffer */ - A("mvn %[txval],%[txval]") /* Negate value */ - - /* Bit 7 */ - A("ubfx %[work],%[txval],#7,#1") /* Place bit 7 in bit 0 of work*/ - - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#6,#1") /* Place bit 6 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 6 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#5,#1") /* Place bit 5 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 5 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#4,#1") /* Place bit 4 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 4 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#3,#1") /* Place bit 3 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 3 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#2,#1") /* Place bit 2 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 2 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#1,#1") /* Place bit 1 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 1 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ubfx %[work],%[txval],#0,#1") /* Place bit 0 in bit 0 of work*/ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - - /* Bit 0 */ - A("str %[mosi_mask],[%[mosi_port], %[work],LSL #2]") /* Access the proper SODR or CODR registers based on that bit */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("subs %[todo],#1") /* Decrement count of pending words to send, update status */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bne.n loop%=") /* Repeat until done */ - - : [ptr]"+r" ( ptr ) , - [todo]"+r" ( todo ) , - [work]"+r"( work ) , - [txval]"+r"( txval ) - : [mosi_mask]"r"( MOSI_MASK ), - [mosi_port]"r"( MOSI_PORT_PLUS30 ), - [sck_mask]"r"( SCK_MASK ), - [sck_port]"r"( SCK_PORT_PLUS30 ) - : "cc" - ); - } - - static void spiRxBlock0(uint8_t* ptr, uint32_t todo) { - uint32_t bin = 0; - uint32_t work = 0; - uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */ - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); - - /* The software SPI routine */ - __asm__ __volatile__( - A(".syntax unified") // is to prevent CM0,CM1 non-unified syntax - - L("loop%=") - - /* bit 7 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#7,#1") /* Store read bit as the bit 7 */ - - /* bit 6 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#6,#1") /* Store read bit as the bit 6 */ - - /* bit 5 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#5,#1") /* Store read bit as the bit 5 */ - - /* bit 4 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#4,#1") /* Store read bit as the bit 4 */ - - /* bit 3 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#3,#1") /* Store read bit as the bit 3 */ - - /* bit 2 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#2,#1") /* Store read bit as the bit 2 */ - - /* bit 1 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#1,#1") /* Store read bit as the bit 1 */ - - /* bit 0 */ - A("str %[sck_mask],[%[sck_port]]") /* SODR */ - A("ldr %[work],[%[bitband_miso_port]]") /* PDSR on bitband area for required bit: work will be 1 or 0 based on port */ - A("str %[sck_mask],[%[sck_port],#0x4]") /* CODR */ - A("bfi %[bin],%[work],#0,#1") /* Store read bit as the bit 0 */ - - A("subs %[todo],#1") /* Decrement count of pending words to send, update status */ - A("strb.w %[bin], [%[ptr]], #1") /* Store read value into buffer, increment buffer pointer */ - A("bne.n loop%=") /* Repeat until done */ - - : [ptr]"+r"(ptr), - [todo]"+r"(todo), - [bin]"+r"(bin), - [work]"+r"(work) - : [bitband_miso_port]"r"( BITBAND_MISO_PORT ), - [sck_mask]"r"( SCK_MASK ), - [sck_port]"r"( SCK_PORT_PLUS30 ) - : "cc" - ); - } - - static void spiTxBlockX(const uint8_t* buf, uint32_t todo) { - do { - (void)spiTransferTx(*buf++); - } while (--todo); - } - - static void spiRxBlockX(uint8_t* buf, uint32_t todo) { - do { - *buf++ = spiTransferRx(0xFF); - } while (--todo); - } - - // Pointers to generic functions for block tranfers - static pfnSpiTxBlock spiTxBlock = (pfnSpiTxBlock)spiTxBlockX; - static pfnSpiRxBlock spiRxBlock = (pfnSpiRxBlock)spiRxBlockX; - - #if MB(ALLIGATOR) - #define _SS_WRITE(S) WRITE(SS_PIN, S) - #else - #define _SS_WRITE(S) NOOP - #endif - - void spiBegin() { - SET_OUTPUT(SS_PIN); - _SS_WRITE(HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); - } - - uint8_t spiRec() { - _SS_WRITE(LOW); - WRITE(MOSI_PIN, HIGH); // Output 1s 1 - uint8_t b = spiTransferRx(0xFF); - _SS_WRITE(HIGH); - return b; - } - - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte) { - _SS_WRITE(LOW); - WRITE(MOSI_PIN, HIGH); // Output 1s 1 - spiRxBlock(buf, nbyte); - _SS_WRITE(HIGH); - } - } - - void spiSend(uint8_t b) { - _SS_WRITE(LOW); - (void)spiTransferTx(b); - _SS_WRITE(HIGH); - } - - void spiSendBlock(uint8_t token, const uint8_t* buf) { - _SS_WRITE(LOW); - (void)spiTransferTx(token); - spiTxBlock(buf, 512); - _SS_WRITE(HIGH); - } - - /** - * spiRate should be - * 0 : 8 - 10 MHz - * 1 : 4 - 5 MHz - * 2 : 2 - 2.5 MHz - * 3 : 1 - 1.25 MHz - * 4 : 500 - 625 kHz - * 5 : 250 - 312 kHz - * 6 : 125 - 156 kHz - */ - void spiInit(uint8_t spiRate) { - switch (spiRate) { - case 0: - spiTransferTx = (pfnSpiTransfer)spiTransferTx0; - spiTransferRx = (pfnSpiTransfer)spiTransferRx0; - spiTxBlock = (pfnSpiTxBlock)spiTxBlock0; - spiRxBlock = (pfnSpiRxBlock)spiRxBlock0; - break; - case 1: - spiTransferTx = (pfnSpiTransfer)spiTransfer1; - spiTransferRx = (pfnSpiTransfer)spiTransfer1; - spiTxBlock = (pfnSpiTxBlock)spiTxBlockX; - spiRxBlock = (pfnSpiRxBlock)spiRxBlockX; - break; - default: - spiDelayCyclesX4 = ((F_CPU) / 1000000) >> (6 - spiRate); - spiTransferTx = (pfnSpiTransfer)spiTransferX; - spiTransferRx = (pfnSpiTransfer)spiTransferX; - spiTxBlock = (pfnSpiTxBlock)spiTxBlockX; - spiRxBlock = (pfnSpiRxBlock)spiRxBlockX; - break; - } - - _SS_WRITE(HIGH); - WRITE(MOSI_PIN, HIGH); - WRITE(SCK_PIN, LOW); - } - - /** Begin SPI transaction, set clock, bit order, data mode */ - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - // TODO: to be implemented - } - - #pragma GCC reset_options - -#else // !SOFTWARE_SPI - - #define WHILE_TX(N) while ((SPI0->SPI_SR & SPI_SR_TDRE) == (N)) - #define WHILE_RX(N) while ((SPI0->SPI_SR & SPI_SR_RDRF) == (N)) - #define FLUSH_TX() do{ WHILE_RX(1) SPI0->SPI_RDR; }while(0) - - #if MB(ALLIGATOR) - - // slave selects controlled by SPI controller - // doesn't support changing SPI speeds for SD card - - // ------------------------ - // hardware SPI - // ------------------------ - static bool spiInitialized = false; - - void spiInit(uint8_t spiRate) { - if (spiInitialized) return; - - // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz - constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 }; - if (spiRate > 6) spiRate = 1; - - // Set SPI mode 1, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN_DAC, - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | - SPI_CSR_DLYBCT(1)); - // Set SPI mode 0, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN_EEPROM1, SPI_CSR_NCPHA | - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | - SPI_CSR_DLYBCT(1)); - - // Set SPI mode 0, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN, SPI_CSR_NCPHA | - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | - SPI_CSR_DLYBCT(1)); - SPI_Enable(SPI0); - spiInitialized = true; - } - - void spiBegin() { - if (spiInitialized) return; - - // Configure SPI pins - PIO_Configure( - g_APinDescription[SCK_PIN].pPort, - g_APinDescription[SCK_PIN].ulPinType, - g_APinDescription[SCK_PIN].ulPin, - g_APinDescription[SCK_PIN].ulPinConfiguration); - PIO_Configure( - g_APinDescription[MOSI_PIN].pPort, - g_APinDescription[MOSI_PIN].ulPinType, - g_APinDescription[MOSI_PIN].ulPin, - g_APinDescription[MOSI_PIN].ulPinConfiguration); - PIO_Configure( - g_APinDescription[MISO_PIN].pPort, - g_APinDescription[MISO_PIN].ulPinType, - g_APinDescription[MISO_PIN].ulPin, - g_APinDescription[MISO_PIN].ulPinConfiguration); - - // set master mode, peripheral select, fault detection - SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS); - SPI_Enable(SPI0); - - SET_OUTPUT(DAC0_SYNC); - #if EXTRUDERS > 1 - SET_OUTPUT(DAC1_SYNC); - WRITE(DAC1_SYNC, HIGH); - #endif - SET_OUTPUT(SPI_EEPROM1_CS); - SET_OUTPUT(SPI_EEPROM2_CS); - SET_OUTPUT(SPI_FLASH_CS); - WRITE(DAC0_SYNC, HIGH); - WRITE(SPI_EEPROM1_CS, HIGH); - WRITE(SPI_EEPROM2_CS, HIGH); - WRITE(SPI_FLASH_CS, HIGH); - WRITE(SS_PIN, HIGH); - - OUT_WRITE(SDSS, LOW); - - PIO_Configure( - g_APinDescription[SPI_PIN].pPort, - g_APinDescription[SPI_PIN].ulPinType, - g_APinDescription[SPI_PIN].ulPin, - g_APinDescription[SPI_PIN].ulPinConfiguration - ); - - spiInit(1); - } - - // Read single byte from SPI - uint8_t spiRec() { - // write dummy byte with address and end transmission flag - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN) | SPI_TDR_LASTXFER; - - WHILE_TX(0); - WHILE_RX(0); - - //DELAY_US(1U); - return SPI0->SPI_RDR; - } - - uint8_t spiRec(uint32_t chan) { - - WHILE_TX(0); - FLUSH_RX(); - - // write dummy byte with address and end transmission flag - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(chan) | SPI_TDR_LASTXFER; - WHILE_RX(0); - - return SPI0->SPI_RDR; - } - - // Read from SPI into buffer - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (!nbyte) return; - --nbyte; - for (int i = 0; i < nbyte; i++) { - //WHILE_TX(0); - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN); - WHILE_RX(0); - buf[i] = SPI0->SPI_RDR; - //DELAY_US(1U); - } - buf[nbyte] = spiRec(); - } - - // Write single byte to SPI - void spiSend(const byte b) { - // write byte with address and end transmission flag - SPI0->SPI_TDR = (uint32_t)b | SPI_PCS(SPI_CHAN) | SPI_TDR_LASTXFER; - WHILE_TX(0); - WHILE_RX(0); - SPI0->SPI_RDR; - //DELAY_US(1U); - } - - void spiSend(const uint8_t* buf, size_t nbyte) { - if (!nbyte) return; - --nbyte; - for (size_t i = 0; i < nbyte; i++) { - SPI0->SPI_TDR = (uint32_t)buf[i] | SPI_PCS(SPI_CHAN); - WHILE_TX(0); - WHILE_RX(0); - SPI0->SPI_RDR; - //DELAY_US(1U); - } - spiSend(buf[nbyte]); - } - - void spiSend(uint32_t chan, byte b) { - WHILE_TX(0); - // write byte with address and end transmission flag - SPI0->SPI_TDR = (uint32_t)b | SPI_PCS(chan) | SPI_TDR_LASTXFER; - WHILE_RX(0); - FLUSH_RX(); - } - - void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) { - if (!nbyte) return; - --nbyte; - for (size_t i = 0; i < nbyte; i++) { - WHILE_TX(0); - SPI0->SPI_TDR = (uint32_t)buf[i] | SPI_PCS(chan); - WHILE_RX(0); - FLUSH_RX(); - } - spiSend(chan, buf[nbyte]); - } - - // Write from buffer to SPI - void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI0->SPI_TDR = (uint32_t)token | SPI_PCS(SPI_CHAN); - WHILE_TX(0); - //WHILE_RX(0); - //SPI0->SPI_RDR; - for (int i = 0; i < 511; i++) { - SPI0->SPI_TDR = (uint32_t)buf[i] | SPI_PCS(SPI_CHAN); - WHILE_TX(0); - WHILE_RX(0); - SPI0->SPI_RDR; - //DELAY_US(1U); - } - spiSend(buf[511]); - } - - /** Begin SPI transaction, set clock, bit order, data mode */ - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - // TODO: to be implemented - } - - #else // U8G compatible hardware SPI - - #define SPI_MODE_0_DUE_HW 2 // DUE CPHA control bit is inverted - #define SPI_MODE_1_DUE_HW 3 - #define SPI_MODE_2_DUE_HW 0 - #define SPI_MODE_3_DUE_HW 1 - - /** - * The DUE SPI controller is set up so the upper word of the longword - * written to the transmit data register selects which SPI Chip Select - * Register is used. This allows different streams to have different SPI - * settings. - * - * In practice it's spooky. Some combinations hang the system, while others - * upset the peripheral device. - * - * SPI mode should be the same for all streams. The FYSETC_MINI_12864 gets - * upset if the clock phase changes after chip select goes active. - * - * SPI_CSR_CSAAT should be set for all streams. If not the WHILE_TX(0) - * macro returns immediately which can result in the SPI chip select going - * inactive before all the data has been sent. - * - * The TMC2130 library uses SPI0->SPI_CSR[3]. - * - * The U8G hardware SPI uses SPI0->SPI_CSR[0]. The system hangs and/or the - * FYSETC_MINI_12864 gets upset if lower baud rates are used and the SD card - * is inserted or removed. - * - * The SD card uses SPI0->SPI_CSR[3]. Efforts were made to use [1] and [2] - * but they all resulted in hangs or garbage on the LCD. - * - * The SPI controlled chip selects are NOT enabled in the GPIO controller. - * The application must control the chip select. - * - * All of the above can be avoided by defining FORCE_SOFT_SPI to force the - * display to use software SPI. - * - */ - - void spiInit(uint8_t spiRate=6) { // Default to slowest rate if not specified) - // Also sets U8G SPI rate to 4MHz and the SPI mode to 3 - - // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz - constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 }; - if (spiRate > 6) spiRate = 1; - - // Enable PIOA and SPI0 - REG_PMC_PCER0 = (1UL << ID_PIOA) | (1UL << ID_SPI0); - - // Disable PIO on A26 and A27 - REG_PIOA_PDR = 0x0C000000; - OUT_WRITE(SDSS, HIGH); - - // Reset SPI0 (from sam lib) - SPI0->SPI_CR = SPI_CR_SPIDIS; - SPI0->SPI_CR = SPI_CR_SWRST; - SPI0->SPI_CR = SPI_CR_SWRST; - SPI0->SPI_CR = SPI_CR_SPIEN; - - // TMC2103 compatible setup - // Master mode, no fault detection, PCS bits in data written to TDR select CSR register - SPI0->SPI_MR = SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS; - // SPI mode 3, 8 Bit data transfer, baud rate - SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW; // use same CSR as TMC2130 - SPI0->SPI_CSR[0] = SPI_CSR_SCBR(spiDivider[1]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW; // U8G default to 4MHz - } - - void spiBegin() { spiInit(); } - - static uint8_t spiTransfer(uint8_t data) { - WHILE_TX(0); - SPI0->SPI_TDR = (uint32_t)data | 0x00070000UL; // Add TMC2130 PCS bits to every byte (use SPI0->SPI_CSR[3]) - WHILE_TX(0); - WHILE_RX(0); - return SPI0->SPI_RDR; - } - - uint8_t spiRec() { return (uint8_t)spiTransfer(0xFF); } - - void spiRead(uint8_t* buf, uint16_t nbyte) { - for (int i = 0; i < nbyte; i++) - buf[i] = spiTransfer(0xFF); - } - - void spiSend(uint8_t data) { spiTransfer(data); } - - void spiSend(const uint8_t* buf, size_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) - spiTransfer(buf[i]); - } - - void spiSendBlock(uint8_t token, const uint8_t* buf) { - spiTransfer(token); - for (uint16_t i = 0; i < 512; i++) - spiTransfer(buf[i]); - } - - #endif // !ALLIGATOR -#endif // !SOFTWARE_SPI - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp deleted file mode 100644 index b9f14823f6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp +++ /dev/null @@ -1,98 +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 . - * - */ - -/** - * InterruptVectors_Due.cpp - This module relocates the Interrupt vector table to SRAM, - * allowing to register new interrupt handlers at runtime. Specially valuable and needed - * because Arduino runtime allocates some interrupt handlers that we NEED to override to - * properly support extended functionality, as for example, USB host or USB device (MSD, MTP) - * and custom serial port handlers, and we don't actually want to modify and/or recompile the - * Arduino runtime. We just want to run as much as possible on Stock Arduino - * - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "InterruptVectors.h" - -/* The relocated Exception/Interrupt Table - According to the ARM - reference manual, alignment to 128 bytes should suffice, but in - practice, we need alignment to 256 bytes to make this work in all - cases */ -__attribute__ ((aligned(256))) -static DeviceVectors ram_tab = { nullptr }; - -/** - * This function checks if the exception/interrupt table is already in SRAM or not. - * 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() { - // Get the address of the interrupt/exception table - uint32_t isrtab = SCB->VTOR; - - // If already relocated, we are done! - if (isrtab >= IRAM0_ADDR) - return (pfnISR_Handler*)isrtab; - - // Get the address of the table stored in FLASH - const pfnISR_Handler* romtab = (const pfnISR_Handler*)isrtab; - - // Copy it to SRAM - memcpy(&ram_tab, romtab, sizeof(ram_tab)); - - // Disable global interrupts - CRITICAL_SECTION_START; - - // Set the vector table base address to the SRAM copy - SCB->VTOR = (uint32_t)(&ram_tab); - - // Reenable interrupts - CRITICAL_SECTION_END; - - // Return the address of the table - return (pfnISR_Handler*)(&ram_tab); -} - -pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler) { - // Get the address of the relocated table - pfnISR_Handler *isrtab = get_relocated_table_addr(); - - // Disable global interrupts - CRITICAL_SECTION_START; - - // Get the original handler - pfnISR_Handler oldHandler = isrtab[irq + 16]; - - // Install the new one - isrtab[irq + 16] = newHandler; - - // Reenable interrupts - CRITICAL_SECTION_END; - - // Return the original one - return oldHandler; -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.h deleted file mode 100644 index 87dd049624..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/InterruptVectors.h +++ /dev/null @@ -1,45 +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 - -/** - * InterruptVectors_Due.h - * - * This module relocates the Interrupt vector table to SRAM, allowing new - * interrupt handlers to be added at runtime. This is required because the - * Arduino runtime steals interrupt handlers that Marlin MUST use to support - * extended functionality such as USB hosts and USB devices (MSD, MTP) and - * custom serial port handlers. Rather than modifying and/or recompiling the - * Arduino runtime, We just want to run as much as possible on Stock Arduino. - * - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - */ - -#ifdef ARDUINO_ARCH_SAM - -// ISR handler type -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); - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp deleted file mode 100644 index 7b88b6d43e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp +++ /dev/null @@ -1,651 +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 . - * - */ - -/** - * MarlinSerial_Due.cpp - Hardware serial library for Arduino DUE - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - * Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved. - */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" - -#include "MarlinSerial.h" -#include "InterruptVectors.h" -#include "../../Marlin.h" - -template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; -template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 }; -template bool MarlinSerial::_written = false; -template uint8_t MarlinSerial::xon_xoff_state = MarlinSerial::XON_XOFF_CHAR_SENT | MarlinSerial::XON_CHAR; -template uint8_t MarlinSerial::rx_dropped_bytes = 0; -template uint8_t MarlinSerial::rx_buffer_overruns = 0; -template uint8_t MarlinSerial::rx_framing_errors = 0; -template typename MarlinSerial::ring_buffer_pos_t MarlinSerial::rx_max_enqueued = 0; - -// A SW memory barrier, to ensure GCC does not overoptimize loops -#define sw_barrier() asm volatile("": : :"memory"); - -#include "../../feature/emergency_parser.h" - -// (called with RX interrupts disabled) -template -FORCE_INLINE void MarlinSerial::store_rxd_char() { - - static EmergencyParser::State emergency_state; // = EP_RESET - - // Get the tail - Nothing can alter its value while we are at this ISR - const ring_buffer_pos_t t = rx_buffer.tail; - - // Get the head pointer - ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Read the character from the USART - uint8_t c = HWUART->UART_RHR; - - if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - // Calculate count of bytes stored into the RX buffer - - // Keep track of the maximum count of enqueued bytes - if (Cfg::MAX_RX_QUEUED) NOLESS(rx_max_enqueued, rx_count); - - if (Cfg::XONOFF) { - // If the last char that was sent was an XON - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) { - - // Bytes stored into the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // If over 12.5% of RX buffer capacity, send XOFF before running out of - // RX buffer space .. 325 bytes @ 250kbits/s needed to let the host react - // and stop sending bytes. This translates to 13mS propagation time. - if (rx_count >= (Cfg::RX_SIZE) / 8) { - - // At this point, definitely no TX interrupt was executing, since the TX isr can't be preempted. - // Don't enable the TX interrupt here as a means to trigger the XOFF char, because if it happens - // to be in the middle of trying to disable the RX interrupt in the main program, eventually the - // enabling of the TX interrupt could be undone. The ONLY reliable thing this can do to ensure - // the sending of the XOFF char is to send it HERE AND NOW. - - // About to send the XOFF char - xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT; - - // Wait until the TX register becomes empty and send it - Here there could be a problem - // - While waiting for the TX register to empty, the RX register could receive a new - // character. This must also handle that situation! - uint32_t status; - while (!((status = HWUART->UART_SR) & UART_SR_TXRDY)) { - - if (status & UART_SR_RXRDY) { - // We received a char while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Read the character from the USART - c = HWUART->UART_RHR; - - if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - } - sw_barrier(); - } - - HWUART->UART_THR = XOFF_CHAR; - - // At this point there could be a race condition between the write() function - // and this sending of the XOFF char. This interrupt could happen between the - // wait to be empty TX buffer loop and the actual write of the character. Since - // the TX buffer is full because it's sending the XOFF char, the only way to be - // sure the write() function will succeed is to wait for the XOFF char to be - // completely sent. Since an extra character could be received during the wait - // it must also be handled! - while (!((status = HWUART->UART_SR) & UART_SR_TXRDY)) { - - if (status & UART_SR_RXRDY) { - // A char arrived while waiting for the TX buffer to be empty - Receive and process it! - - i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - - // Read the character from the USART - c = HWUART->UART_RHR; - - if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else if (Cfg::DROPPED_RX && !++rx_dropped_bytes) - --rx_dropped_bytes; - } - sw_barrier(); - } - - // At this point everything is ready. The write() function won't - // have any issues writing to the UART TX register if it needs to! - } - } - } - - // Store the new head value - rx_buffer.head = h; -} - -template -FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq() { - if (Cfg::TX_SIZE > 0) { - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; - - if (Cfg::XONOFF) { - // If an XON char is pending to be sent, do it now - if (xon_xoff_state == XON_CHAR) { - - // Send the character - HWUART->UART_THR = XON_CHAR; - - // Remember we sent it. - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - - // If nothing else to transmit, just disable TX interrupts. - if (h == t) HWUART->UART_IDR = UART_IDR_TXRDY; - - return; - } - } - - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - HWUART->UART_IDR = UART_IDR_TXRDY; - return; - } - - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (Cfg::TX_SIZE - 1); - HWUART->UART_THR = c; - tx_buffer.tail = t; - - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) HWUART->UART_IDR = UART_IDR_TXRDY; - } -} - -template -void MarlinSerial::UART_ISR() { - const uint32_t status = HWUART->UART_SR; - - // Data received? - if (status & UART_SR_RXRDY) store_rxd_char(); - - if (Cfg::TX_SIZE > 0) { - // Something to send, and TX interrupts are enabled (meaning something to send)? - if ((status & UART_SR_TXRDY) && (HWUART->UART_IMR & UART_IMR_TXRDY)) _tx_thr_empty_irq(); - } - - // Acknowledge errors - if ((status & UART_SR_OVRE) || (status & UART_SR_FRAME)) { - if (Cfg::DROPPED_RX && (status & UART_SR_OVRE) && !++rx_dropped_bytes) --rx_dropped_bytes; - if (Cfg::RX_OVERRUNS && (status & UART_SR_OVRE) && !++rx_buffer_overruns) --rx_buffer_overruns; - if (Cfg::RX_FRAMING_ERRORS && (status & UART_SR_FRAME) && !++rx_framing_errors) --rx_framing_errors; - - // TODO: error reporting outside ISR - HWUART->UART_CR = UART_CR_RSTSTA; - } -} - -// Public Methods -template -void MarlinSerial::begin(const long baud_setting) { - - // Disable UART interrupt in NVIC - NVIC_DisableIRQ( HWUART_IRQ ); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Disable clock - pmc_disable_periph_clk( HWUART_IRQ_ID ); - - // Configure PMC - pmc_enable_periph_clk( HWUART_IRQ_ID ); - - // Disable PDC channel - HWUART->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; - - // Reset and disable receiver and transmitter - HWUART->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS; - - // Configure mode: 8bit, No parity, 1 bit stop - HWUART->UART_MR = UART_MR_CHMODE_NORMAL | US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_NO; - - // Configure baudrate (asynchronous, no oversampling) - HWUART->UART_BRGR = (SystemCoreClock / (baud_setting << 4)); - - // Configure interrupts - HWUART->UART_IDR = 0xFFFFFFFF; - HWUART->UART_IER = UART_IER_RXRDY | UART_IER_OVRE | UART_IER_FRAME; - - // Install interrupt handler - install_isr(HWUART_IRQ, UART_ISR); - - // Configure priority. We need a very high priority to avoid losing characters - // and we need to be able to preempt the Stepper ISR and everything else! - // (this could probably be fixed by using DMA with the Serial port) - NVIC_SetPriority(HWUART_IRQ, 1); - - // Enable UART interrupt in NVIC - NVIC_EnableIRQ(HWUART_IRQ); - - // Enable receiver and transmitter - HWUART->UART_CR = UART_CR_RXEN | UART_CR_TXEN; - - if (Cfg::TX_SIZE > 0) _written = false; -} - -template -void MarlinSerial::end() { - // Disable UART interrupt in NVIC - NVIC_DisableIRQ( HWUART_IRQ ); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - pmc_disable_periph_clk( HWUART_IRQ_ID ); -} - -template -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() { - - const ring_buffer_pos_t h = rx_buffer.head; - ring_buffer_pos_t t = rx_buffer.tail; - - if (h == t) return -1; - - int v = rx_buffer.buffer[t]; - t = (ring_buffer_pos_t)(t + 1) & (Cfg::RX_SIZE - 1); - - // Advance tail - rx_buffer.tail = t; - - if (Cfg::XONOFF) { - // If the XOFF char was sent, or about to be sent... - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - // Get count of bytes in the RX buffer - const ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(h - t) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); - // When below 10% of RX buffer capacity, send XON before running out of RX buffer bytes - if (rx_count < (Cfg::RX_SIZE) / 10) { - if (Cfg::TX_SIZE > 0) { - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX isr. - HWUART->UART_IER = UART_IER_TXRDY; - } - else { - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!(HWUART->UART_SR & UART_SR_TXRDY)) sw_barrier(); - HWUART->UART_THR = XON_CHAR; - } - } - } - } - - return v; -} - -template -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() { - rx_buffer.tail = rx_buffer.head; - - if (Cfg::XONOFF) { - if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) { - if (Cfg::TX_SIZE > 0) { - // Signal we want an XON character to be sent. - xon_xoff_state = XON_CHAR; - // Enable TX isr. - HWUART->UART_IER = UART_IER_TXRDY; - } - else { - // If not using TX interrupts, we must send the XON char now - xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT; - while (!(HWUART->UART_SR & UART_SR_TXRDY)) sw_barrier(); - HWUART->UART_THR = XON_CHAR; - } - } - } -} - -template -void MarlinSerial::write(const uint8_t c) { - _written = true; - - if (Cfg::TX_SIZE == 0) { - while (!(HWUART->UART_SR & UART_SR_TXRDY)) sw_barrier(); - HWUART->UART_THR = c; - } - else { - - // If the TX interrupts are disabled and the data register - // is empty, just write the byte to the data register and - // be done. This shortcut helps significantly improve the - // effective datarate at high (>500kbit/s) bitrates, where - // interrupt overhead becomes a slowdown. - // Yes, there is a race condition between the sending of the - // XOFF char at the RX isr, but it is properly handled there - if (!(HWUART->UART_IMR & UART_IMR_TXRDY) && (HWUART->UART_SR & UART_SR_TXRDY)) { - HWUART->UART_THR = c; - return; - } - - const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1); - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Make room by polling if it is possible to transmit, and do so! - while (i == tx_buffer.tail) { - // If we can transmit another byte, do it. - if (HWUART->UART_SR & UART_SR_TXRDY) _tx_thr_empty_irq(); - // Make sure compiler rereads tx_buffer.tail - sw_barrier(); - } - } - else { - // Interrupts are enabled, just wait until there is space - while (i == tx_buffer.tail) sw_barrier(); - } - - // Store new char. head is always safe to move - tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - - // Enable TX isr - Non atomic, but it will eventually enable TX isr - HWUART->UART_IER = UART_IER_TXRDY; - } -} - -template -void MarlinSerial::flushTX() { - // TX - - if (Cfg::TX_SIZE == 0) { - // No bytes written, no need to flush. This special case is needed since there's - // no way to force the TXC (transmit complete) bit to 1 during initialization. - if (!_written) return; - - // Wait until everything was transmitted - while (!(HWUART->UART_SR & UART_SR_TXEMPTY)) sw_barrier(); - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - - } - else { - // If we have never written a byte, no need to flush. This special - // case is needed since there is no way to force the TXC (transmit - // complete) bit to 1 during initialization - if (!_written) return; - - // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { - - // Wait until everything was transmitted - We must do polling, as interrupts are disabled - while (tx_buffer.head != tx_buffer.tail || !(HWUART->UART_SR & UART_SR_TXEMPTY)) { - // If there is more space, send an extra character - if (HWUART->UART_SR & UART_SR_TXRDY) _tx_thr_empty_irq(); - sw_barrier(); - } - - } - else { - // Wait until everything was transmitted - while (tx_buffer.head != tx_buffer.tail || !(HWUART->UART_SR & UART_SR_TXEMPTY)) sw_barrier(); - } - - // At this point nothing is queued anymore (DRIE is disabled) and - // the hardware finished transmission (TXC is set). - } -} - -/** - * Imports from print.h - */ - -template -void MarlinSerial::print(char c, int base) { - print((long)c, base); -} - -template -void MarlinSerial::print(unsigned char b, int base) { - print((unsigned long)b, base); -} - -template -void MarlinSerial::print(int n, int base) { - print((long)n, base); -} - -template -void MarlinSerial::print(unsigned int n, int base) { - print((unsigned long)n, base); -} - -template -void MarlinSerial::print(long n, int base) { - if (base == 0) write(n); - else if (base == 10) { - if (n < 0) { print('-'); n = -n; } - printNumber(n, 10); - } - else - printNumber(n, base); -} - -template -void MarlinSerial::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); -} - -template -void MarlinSerial::print(double n, int digits) { - printFloat(n, digits); -} - -template -void MarlinSerial::println() { - print('\r'); - print('\n'); -} - -template -void MarlinSerial::println(const String& s) { - print(s); - println(); -} - -template -void MarlinSerial::println(const char c[]) { - print(c); - println(); -} - -template -void MarlinSerial::println(char c, int base) { - print(c, base); - println(); -} - -template -void MarlinSerial::println(unsigned char b, int base) { - print(b, base); - println(); -} - -template -void MarlinSerial::println(int n, int base) { - print(n, base); - println(); -} - -template -void MarlinSerial::println(unsigned int n, int base) { - print(n, base); - println(); -} - -template -void MarlinSerial::println(long n, int base) { - print(n, base); - println(); -} - -template -void MarlinSerial::println(unsigned long n, int base) { - print(n, base); - println(); -} - -template -void MarlinSerial::println(double n, int digits) { - print(n, digits); - println(); -} - -// Private Methods -template -void MarlinSerial::printNumber(unsigned long n, uint8_t base) { - if (n) { - unsigned char buf[8 * sizeof(long)]; // Enough space for base 2 - int8_t i = 0; - while (n) { - buf[i++] = n % base; - n /= base; - } - while (i--) - print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10))); - } - else - print('0'); -} - -template -void MarlinSerial::printFloat(double number, uint8_t digits) { - // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1; - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; - print(int_part); - - // Print the decimal point, but only if there are digits beyond - if (digits) { - print('.'); - // Extract digits from the remainder one at a time - while (digits--) { - remainder *= 10.0; - int toPrint = int(remainder); - print(toPrint); - remainder -= toPrint; - } - } -} - -// If not using the USB port as serial port -#if SERIAL_PORT >= 0 - - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> customizedSerial1; - -#endif - -#ifdef SERIAL_PORT_2 - - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> customizedSerial2; - -#endif - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.h deleted file mode 100644 index 92806f15b4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerial.h +++ /dev/null @@ -1,184 +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 - -/** - * MarlinSerial_Due.h - Hardware serial library for Arduino DUE - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - * Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved. - */ - -#include "../shared/MarlinSerial.h" - -#include - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 - -// Define constants and variables for buffering incoming serial data. We're -// using a ring buffer (I think), in which rx_buffer_head is the index of the -// location to which to write the next incoming character and rx_buffer_tail -// is the index of the location from which to read. -// 256 is the max limit due to uint8_t head and tail. Use only powers of 2. (...,16,32,64,128,256) -#ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 -#endif -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 -#endif - -//#if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 -// #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." -//#elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) -// #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." -//#elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) -// #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." -//#endif - -// Templated type selector -template struct TypeSelector { typedef T type;} ; -template struct TypeSelector { typedef F type; }; - -// Templated structure wrapper -template struct StructWrapper { - constexpr StructWrapper(int) {} - FORCE_INLINE S* operator->() const { return (S*)addr; } -}; - -template -class MarlinSerial { -protected: - // Information for all supported UARTs - static constexpr uint32_t BASES[] = {0x400E0800U, 0x40098000U, 0x4009C000U, 0x400A0000U, 0x400A4000U}; - static constexpr IRQn_Type IRQS[] = { UART_IRQn, USART0_IRQn, USART1_IRQn, USART2_IRQn, USART3_IRQn}; - static constexpr int IRQ_IDS[] = { ID_UART, ID_USART0, ID_USART1, ID_USART2, ID_USART3}; - - // Alias for shorter code - static constexpr StructWrapper HWUART = 0; - static constexpr IRQn_Type HWUART_IRQ = IRQS[Cfg::PORT]; - static constexpr int HWUART_IRQ_ID = IRQ_IDS[Cfg::PORT]; - - // Base size of type on buffer size - typedef typename TypeSelector<(Cfg::RX_SIZE>256), uint16_t, uint8_t>::type ring_buffer_pos_t; - - struct ring_buffer_r { - volatile ring_buffer_pos_t head, tail; - unsigned char buffer[Cfg::RX_SIZE]; - }; - - struct ring_buffer_t { - volatile uint8_t head, tail; - unsigned char buffer[Cfg::TX_SIZE]; - }; - - static ring_buffer_r rx_buffer; - static ring_buffer_t tx_buffer; - static bool _written; - - static constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80, // XON / XOFF Character was sent - XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send - - // XON / XOFF character definitions - static constexpr uint8_t XON_CHAR = 17, XOFF_CHAR = 19; - static uint8_t xon_xoff_state, - rx_dropped_bytes, - rx_buffer_overruns, - rx_framing_errors; - static ring_buffer_pos_t rx_max_enqueued; - - FORCE_INLINE static void store_rxd_char(); - 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(); - static int read(); - static void flush(); - static ring_buffer_pos_t available(); - static void write(const uint8_t c); - 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; } - FORCE_INLINE static uint8_t framing_errors() { return Cfg::RX_FRAMING_ERRORS ? rx_framing_errors : 0; } - FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return Cfg::MAX_RX_QUEUED ? rx_max_enqueued : 0; } - - FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } - FORCE_INLINE static void print(const char* str) { write(str); } - - static void print(char, int = 0); - static void print(unsigned char, int = 0); - static void print(int, int = DEC); - static void print(unsigned int, int = DEC); - static void print(long, int = DEC); - static void print(unsigned long, int = DEC); - static void print(double, int = 2); - - static void println(const String& s); - static void println(const char[]); - static void println(char, int = 0); - static void println(unsigned char, int = 0); - static void println(int, int = DEC); - static void println(unsigned int, int = DEC); - static void println(long, int = DEC); - static void println(unsigned long, int = DEC); - static void println(double, int = 2); - static void println(); - operator bool() { return true; } - -private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); -}; - -// Serial port configuration -template -struct MarlinSerialCfg { - static constexpr int PORT = serial; - static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE; - static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE; - static constexpr bool XONOFF = bSERIAL_XON_XOFF; - static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER; - static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX; - static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS; - static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS; - static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED; -}; - -#if SERIAL_PORT >= 0 - - extern MarlinSerial> customizedSerial1; - -#endif // SERIAL_PORT >= 0 - -#ifdef SERIAL_PORT_2 - - extern MarlinSerial> customizedSerial2; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp deleted file mode 100644 index f7f48d5f42..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp +++ /dev/null @@ -1,290 +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 . - * - */ - -/** - * MarlinSerial_Due.cpp - Hardware serial library for Arduino DUE - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - * Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved. - */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" - -#if SERIAL_PORT == -1 - -#include "MarlinSerialUSB.h" - -#if ENABLED(EMERGENCY_PARSER) - #include "../../feature/emergency_parser.h" -#endif - -// Imports from Atmel USB Stack/CDC implementation -extern "C" { - 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); -}; - -// Pending character -static int pending_char = -1; - -#if ENABLED(EMERGENCY_PARSER) - static EmergencyParser::State emergency_state; // = EP_RESET -#endif - -// Public Methods -void MarlinSerialUSB::begin(const long) {} - -void MarlinSerialUSB::end() {} - -int MarlinSerialUSB::peek() { - if (pending_char >= 0) - return pending_char; - - // If USB CDC not enumerated or not configured on the PC side - if (!usb_task_cdc_isenabled()) - return -1; - - // If no bytes sent from the PC - if (!udi_cdc_is_rx_ready()) - return -1; - - pending_char = udi_cdc_getc(); - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(emergency_state, (char)pending_char); - #endif - - return pending_char; -} - -int MarlinSerialUSB::read() { - if (pending_char >= 0) { - int ret = pending_char; - pending_char = -1; - return ret; - } - - // If USB CDC not enumerated or not configured on the PC side - if (!usb_task_cdc_isenabled()) - return -1; - - // If no bytes sent from the PC - if (!udi_cdc_is_rx_ready()) - return -1; - - int c = udi_cdc_getc(); - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(emergency_state, (char)c); - #endif - - return c; -} - -bool MarlinSerialUSB::available() { - /* If Pending chars */ - return pending_char >= 0 || - /* or USB CDC enumerated and configured on the PC side and some - bytes where sent to us */ - (usb_task_cdc_isenabled() && udi_cdc_is_rx_ready()); -} - -void MarlinSerialUSB::flush() { } -void MarlinSerialUSB::flushTX() { } - -void MarlinSerialUSB::write(const uint8_t c) { - - /* Do not even bother sending anything if USB CDC is not enumerated - or not configured on the PC side or there is no program on the PC - listening to our messages */ - if (!usb_task_cdc_isenabled() || !usb_task_cdc_dtr_active()) - return; - - /* Wait until the PC has read the pending to be sent data */ - while (usb_task_cdc_isenabled() && - usb_task_cdc_dtr_active() && - !udi_cdc_is_tx_ready()) { - }; - - /* Do not even bother sending anything if USB CDC is not enumerated - or not configured on the PC side or there is no program on the PC - listening to our messages at this point */ - if (!usb_task_cdc_isenabled() || !usb_task_cdc_dtr_active()) - return; - - // Fifo full - // udi_cdc_signal_overrun(); - udi_cdc_putc(c); -} - -/** - * Imports from print.h - */ - -void MarlinSerialUSB::print(char c, int base) { - print((long)c, base); -} - -void MarlinSerialUSB::print(unsigned char b, int base) { - print((unsigned long)b, base); -} - -void MarlinSerialUSB::print(int n, int base) { - print((long)n, base); -} - -void MarlinSerialUSB::print(unsigned int n, int base) { - print((unsigned long)n, base); -} - -void MarlinSerialUSB::print(long n, int base) { - if (base == 0) - write(n); - else if (base == 10) { - if (n < 0) { - print('-'); - n = -n; - } - printNumber(n, 10); - } - else - printNumber(n, base); -} - -void MarlinSerialUSB::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); -} - -void MarlinSerialUSB::print(double n, int digits) { - printFloat(n, digits); -} - -void MarlinSerialUSB::println() { - print('\r'); - print('\n'); -} - -void MarlinSerialUSB::println(const String& s) { - print(s); - println(); -} - -void MarlinSerialUSB::println(const char c[]) { - print(c); - println(); -} - -void MarlinSerialUSB::println(char c, int base) { - print(c, base); - println(); -} - -void MarlinSerialUSB::println(unsigned char b, int base) { - print(b, base); - println(); -} - -void MarlinSerialUSB::println(int n, int base) { - print(n, base); - println(); -} - -void MarlinSerialUSB::println(unsigned int n, int base) { - print(n, base); - println(); -} - -void MarlinSerialUSB::println(long n, int base) { - print(n, base); - println(); -} - -void MarlinSerialUSB::println(unsigned long n, int base) { - print(n, base); - println(); -} - -void MarlinSerialUSB::println(double n, int digits) { - print(n, digits); - println(); -} - -// Private Methods - -void MarlinSerialUSB::printNumber(unsigned long n, uint8_t base) { - if (n) { - unsigned char buf[8 * sizeof(long)]; // Enough space for base 2 - int8_t i = 0; - while (n) { - buf[i++] = n % base; - n /= base; - } - while (i--) - print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10))); - } - else - print('0'); -} - -void MarlinSerialUSB::printFloat(double number, uint8_t digits) { - // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) - rounding *= 0.1; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; - print(int_part); - - // Print the decimal point, but only if there are digits beyond - if (digits) { - print('.'); - // Extract digits from the remainder one at a time - while (digits--) { - remainder *= 10.0; - int toPrint = int(remainder); - print(toPrint); - remainder -= toPrint; - } - } -} - -// Preinstantiate -MarlinSerialUSB customizedSerial1; - -#endif // SERIAL_PORT == -1 - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h deleted file mode 100644 index 3d9d4bafaa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h +++ /dev/null @@ -1,93 +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 - -/** - * MarlinSerialUSB_Due.h - Hardware Serial over USB (CDC) library for Arduino DUE - * Copyright (c) 2017 Eduardo José Tagle. All right reserved - */ - -#include "../../inc/MarlinConfig.h" - -#if SERIAL_PORT == -1 - -#include - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 - -class MarlinSerialUSB { - -public: - MarlinSerialUSB() {}; - static void begin(const long); - static void end(); - 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) - FORCE_INLINE static uint32_t dropped() { return 0; } - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - FORCE_INLINE static int rxMaxEnqueued() { return 0; } - #endif - - FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } - FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); } - FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } - FORCE_INLINE static void print(const char* str) { write(str); } - - static void print(char, int = 0); - static void print(unsigned char, int = 0); - static void print(int, int = DEC); - static void print(unsigned int, int = DEC); - static void print(long, int = DEC); - static void print(unsigned long, int = DEC); - static void print(double, int = 2); - - static void println(const String& s); - static void println(const char[]); - static void println(char, int = 0); - static void println(unsigned char, int = 0); - static void println(int, int = DEC); - static void println(unsigned int, int = DEC); - static void println(long, int = DEC); - static void println(unsigned long, int = DEC); - static void println(double, int = 2); - static void println(); - operator bool() { return true; } - -private: - static void printNumber(unsigned long, const uint8_t); - static void printFloat(double, uint8_t); -}; - -extern MarlinSerialUSB customizedSerial1; - -#endif // SERIAL_PORT == -1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Servo.cpp deleted file mode 100644 index f48fdf5796..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Servo.cpp +++ /dev/null @@ -1,160 +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 . - * - */ - -/* - Copyright (c) 2013 Arduino LLC. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "../shared/Marduino.h" -#include "../shared/servo.h" -#include "../shared/servo_private.h" - -static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) - -// ------------------------ -/// Interrupt handler for the TC0 channel 1. -// ------------------------ -void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel); - -#ifdef _useTimer1 - void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } -#endif -#ifdef _useTimer2 - void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); } -#endif -#ifdef _useTimer3 - void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); } -#endif -#ifdef _useTimer4 - void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); } -#endif -#ifdef _useTimer5 - 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) { - // clear interrupt - tc->TC_CHANNEL[channel].TC_SR; - if (Channel[timer] < 0) - tc->TC_CHANNEL[channel].TC_CCR |= TC_CCR_SWTRG; // channel set to -1 indicated that refresh interval completed so reset the timer - else if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - tc->TC_CHANNEL[channel].TC_RA = tc->TC_CHANNEL[channel].TC_CV + SERVO(timer,Channel[timer]).ticks; - if (SERVO(timer,Channel[timer]).Pin.isActive) // check if activated - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // its an active channel so pulse it high - } - else { - // finished all channels so wait for the refresh period to expire before starting over - tc->TC_CHANNEL[channel].TC_RA = - tc->TC_CHANNEL[channel].TC_CV < usToTicks(REFRESH_INTERVAL) - 4 - ? (unsigned int)usToTicks(REFRESH_INTERVAL) // allow a few ticks to ensure the next OCR1A not missed - : tc->TC_CHANNEL[channel].TC_CV + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - } -} - -static void _initISR(Tc *tc, uint32_t channel, uint32_t id, IRQn_Type irqn) { - pmc_enable_periph_clk(id); - TC_Configure(tc, channel, - TC_CMR_TCCLKS_TIMER_CLOCK3 | // MCK/32 - TC_CMR_WAVE | // Waveform mode - TC_CMR_WAVSEL_UP_RC ); // Counter running up and reset when equals to RC - - /* 84MHz, MCK/32, for 1.5ms: 3937 */ - TC_SetRA(tc, channel, 2625); // 1ms - - /* Configure and enable interrupt */ - NVIC_EnableIRQ(irqn); - // TC_IER_CPAS: RA Compare - tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPAS; - - // Enables the timer clock and performs a software reset to start the counting - TC_Start(tc, channel); -} - -void initISR(timer16_Sequence_t timer) { - #ifdef _useTimer1 - if (timer == _timer1) - _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1); - #endif - #ifdef _useTimer2 - if (timer == _timer2) - _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2); - #endif - #ifdef _useTimer3 - if (timer == _timer3) - _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3); - #endif - #ifdef _useTimer4 - if (timer == _timer4) - _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4); - #endif - #ifdef _useTimer5 - if (timer == _timer5) - _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5); - #endif -} - -void finISR(timer16_Sequence_t) { - #ifdef _useTimer1 - TC_Stop(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); - #endif - #ifdef _useTimer2 - TC_Stop(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); - #endif - #ifdef _useTimer3 - TC_Stop(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); - #endif - #ifdef _useTimer4 - TC_Stop(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); - #endif - #ifdef _useTimer5 - TC_Stop(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); - #endif -} - -#endif // HAS_SERVOS - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/ServoTimers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/ServoTimers.h deleted file mode 100644 index c32c938253..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/ServoTimers.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) 2013 Arduino LLC. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * Defines for 16 bit timers used with Servo library - * - * If _useTimerX is defined then TimerX is a 32 bit timer on the current board - * timer16_Sequence_t enumerates the sequence that the timers should be allocated - * _Nbr_16timers indicates how many timers are available. - */ - -/** - * SAM Only definitions - * -------------------- - */ - -// For SAM3X: -//!#define _useTimer1 -//!#define _useTimer2 -#define _useTimer3 -//!#define _useTimer4 -#define _useTimer5 - -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays -#define SERVO_TIMER_PRESCALER 32 // timer prescaler - -/* - TC0, chan 0 => TC0_Handler - TC0, chan 1 => TC1_Handler - TC0, chan 2 => TC2_Handler - TC1, chan 0 => TC3_Handler - TC1, chan 1 => TC4_Handler - TC1, chan 2 => TC5_Handler - TC2, chan 0 => TC6_Handler - TC2, chan 1 => TC7_Handler - TC2, chan 2 => TC8_Handler - */ - -#ifdef _useTimer1 - #define TC_FOR_TIMER1 TC1 - #define CHANNEL_FOR_TIMER1 0 - #define ID_TC_FOR_TIMER1 ID_TC3 - #define IRQn_FOR_TIMER1 TC3_IRQn - #define HANDLER_FOR_TIMER1 TC3_Handler -#endif -#ifdef _useTimer2 - #define TC_FOR_TIMER2 TC1 - #define CHANNEL_FOR_TIMER2 1 - #define ID_TC_FOR_TIMER2 ID_TC4 - #define IRQn_FOR_TIMER2 TC4_IRQn - #define HANDLER_FOR_TIMER2 TC4_Handler -#endif -#ifdef _useTimer3 - #define TC_FOR_TIMER3 TC1 - #define CHANNEL_FOR_TIMER3 2 - #define ID_TC_FOR_TIMER3 ID_TC5 - #define IRQn_FOR_TIMER3 TC5_IRQn - #define HANDLER_FOR_TIMER3 TC5_Handler -#endif -#ifdef _useTimer4 - #define TC_FOR_TIMER4 TC0 - #define CHANNEL_FOR_TIMER4 2 - #define ID_TC_FOR_TIMER4 ID_TC2 - #define IRQn_FOR_TIMER4 TC2_IRQn - #define HANDLER_FOR_TIMER4 TC2_Handler -#endif -#ifdef _useTimer5 - #define TC_FOR_TIMER5 TC0 - #define CHANNEL_FOR_TIMER5 0 - #define ID_TC_FOR_TIMER5 ID_TC0 - #define IRQn_FOR_TIMER5 TC0_IRQn - #define HANDLER_FOR_TIMER5 TC0_Handler -#endif - -typedef enum : unsigned char { - #ifdef _useTimer1 - _timer1, - #endif - #ifdef _useTimer2 - _timer2, - #endif - #ifdef _useTimer3 - _timer3, - #endif - #ifdef _useTimer4 - _timer4, - #endif - #ifdef _useTimer5 - _timer5, - #endif - _Nbr_16timers -} timer16_Sequence_t; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Tone.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Tone.cpp deleted file mode 100644 index 2af97aac61..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/Tone.cpp +++ /dev/null @@ -1,61 +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 - * - * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) - * - * 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 . - * - */ - -/** - * Description: Tone function for Arduino Due and compatible (SAM3X8E) - * Derived from http://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012 - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "timers.h" - -static pin_t tone_pin; -volatile static int32_t toggles; - -void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) { - tone_pin = _pin; - toggles = 2 * frequency * duration / 1000; - HAL_timer_start(TONE_TIMER_NUM, 2 * frequency); -} - -void noTone(const pin_t _pin) { - HAL_timer_disable_interrupt(TONE_TIMER_NUM); - extDigitalWrite(_pin, LOW); -} - -HAL_TONE_TIMER_ISR() { - static uint8_t pin_state = 0; - HAL_timer_isr_prologue(TONE_TIMER_NUM); - - if (toggles) { - toggles--; - extDigitalWrite(tone_pin, (pin_state ^= 1)); - } - else noTone(tone_pin); // turn off interrupt -} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp deleted file mode 100644 index 5e5a4e5fc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ /dev/null @@ -1,150 +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 . - * - */ - - -/** - * Based on u8g_com_msp430_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2012, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifdef __SAM3X8E__ - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include - -#include "../../../Marlin.h" - -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); - -#include "../../shared/Marduino.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, - g_APinDescription[u8g->pin_list[pin_index]].ulPin, g_APinDescription[u8g->pin_list[pin_index]].ulPinConfiguration); // OUTPUT -} - -void u8g_SetPILevel_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index, uint8_t level) { - volatile Pio* port = g_APinDescription[u8g->pin_list[pin_index]].pPort; - uint32_t mask = g_APinDescription[u8g->pin_list[pin_index]].ulPin; - if (level) port->PIO_SODR = mask; - else port->PIO_CODR = mask; -} - -uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_INIT: - u8g_SetPILevel_DUE_hw_spi(u8g, U8G_PI_CS, 1); - u8g_SetPILevel_DUE_hw_spi(u8g, U8G_PI_A0, 1); - - u8g_SetPIOutput_DUE_hw_spi(u8g, U8G_PI_CS); - u8g_SetPIOutput_DUE_hw_spi(u8g, U8G_PI_A0); - - u8g_Delay(5); - - spiBegin(); - - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card - #endif - spiInit(2); - - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g_SetPILevel_DUE_hw_spi(u8g, U8G_PI_A0, arg_val); - break; - - case U8G_COM_MSG_CHIP_SELECT: - u8g_SetPILevel_DUE_hw_spi(u8g, U8G_PI_CS, (arg_val ? 0 : 1)); - break; - - case U8G_COM_MSG_RESET: - break; - - case U8G_COM_MSG_WRITE_BYTE: - - spiSend((uint8_t)arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - spiSend(*ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - spiSend(*ptr++); - arg_val--; - } - } - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD - -#endif //__SAM3X8E__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp deleted file mode 100644 index 47e56fddb0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ /dev/null @@ -1,185 +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 . - * - */ - -/** - * Based on u8g_com_st7920_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(U8GLIB_ST7920) - -#include "../../shared/Delay.h" - -#include - -#include "u8g_com_HAL_DUE_sw_spi_shared.h" - -#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_0 - -static uint8_t rs_last_state = 255; - -static void u8g_com_DUE_st7920_write_byte_sw_spi(uint8_t rs, uint8_t val) { - if (rs != rs_last_state) { // time to send a command/data byte - rs_last_state = rs; - SPISEND_SW_DUE(rs ? 0x0FA : 0x0F8); // Command or Data - DELAY_US(40); // give the controller some time to process the data: 20 is bad, 30 is OK, 40 is safe - } - SPISEND_SW_DUE(val & 0xF0); - SPISEND_SW_DUE(val << 4); -} - -uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - SCK_pPio = g_APinDescription[u8g->pin_list[U8G_PI_SCK]].pPort; - SCK_dwMask = g_APinDescription[u8g->pin_list[U8G_PI_SCK]].ulPin; - MOSI_pPio = g_APinDescription[u8g->pin_list[U8G_PI_MOSI]].pPort; - MOSI_dwMask = g_APinDescription[u8g->pin_list[U8G_PI_MOSI]].ulPin; - - u8g_SetPILevel_DUE(u8g, U8G_PI_CS, 0); - u8g_SetPIOutput_DUE(u8g, U8G_PI_CS); - u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); - u8g_SetPIOutput_DUE(u8g, U8G_PI_SCK); - u8g_SetPILevel_DUE(u8g, U8G_PI_MOSI, 0); - u8g_SetPIOutput_DUE(u8g, U8G_PI_MOSI); - - SCK_pPio->PIO_CODR = SCK_dwMask; //SCK low - needed at power up but not after reset - MOSI_pPio->PIO_CODR = MOSI_dwMask; //MOSI low - needed at power up but not after reset - - u8g_Delay(5); - - u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: command mode */ - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPILevel_DUE(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g->pin_list[U8G_PI_A0_STATE] = arg_val; - break; - - case U8G_COM_MSG_CHIP_SELECT: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_CS]) - u8g_SetPILevel_DUE(u8g, U8G_PI_CS, arg_val); //note: the st7920 has an active high chip select - break; - - case U8G_COM_MSG_WRITE_BYTE: - - u8g_com_DUE_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_DUE_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_DUE_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - } - return 1; -} - -#if ENABLED(LIGHTWEIGHT_UI) - #include "../../../lcd/ultralcd.h" - #include "../../shared/HAL_ST7920.h" - - #define ST7920_CS_PIN LCD_PINS_RS - - #if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) - #else - #define U8G_DELAY() DELAY_US(10) - #endif - - void ST7920_cs() { - WRITE(ST7920_CS_PIN, HIGH); - U8G_DELAY(); - } - - void ST7920_ncs() { - WRITE(ST7920_CS_PIN, LOW); - } - - void ST7920_set_cmd() { - SPISEND_SW_DUE(0xF8); - DELAY_US(40); - } - - void ST7920_set_dat() { - SPISEND_SW_DUE(0xFA); - DELAY_US(40); - } - - void ST7920_write_byte(const uint8_t val) { - SPISEND_SW_DUE(val & 0xF0); - SPISEND_SW_DUE(val << 4); - } -#endif // LIGHTWEIGHT_UI - -#endif // U8GLIB_ST7920 -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp deleted file mode 100644 index e078bc420f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp +++ /dev/null @@ -1,148 +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 . - * - */ - -/** - * Based on u8g_com_std_sw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2015, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) - -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz - -#include "u8g_com_HAL_DUE_sw_spi_shared.h" - -#include "../../shared/Marduino.h" -#include "../../shared/Delay.h" - -#include - -#if ENABLED(FYSETC_MINI_12864) - #define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3 -#else - #define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_0 -#endif - -uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - SCK_pPio = g_APinDescription[u8g->pin_list[U8G_PI_SCK]].pPort; - SCK_dwMask = g_APinDescription[u8g->pin_list[U8G_PI_SCK]].ulPin; - MOSI_pPio = g_APinDescription[u8g->pin_list[U8G_PI_MOSI]].pPort; - MOSI_dwMask = g_APinDescription[u8g->pin_list[U8G_PI_MOSI]].ulPin; - u8g_SetPIOutput_DUE(u8g, U8G_PI_SCK); - u8g_SetPIOutput_DUE(u8g, U8G_PI_MOSI); - u8g_SetPIOutput_DUE(u8g, U8G_PI_CS); - u8g_SetPIOutput_DUE(u8g, U8G_PI_A0); - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput_DUE(u8g, U8G_PI_RESET); - u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); - u8g_SetPILevel_DUE(u8g, U8G_PI_MOSI, 0); - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPILevel_DUE(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_CHIP_SELECT: - #if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0 - if (arg_val) { // SCK idle state needs to be set to the proper idle state before - // the next chip select goes active - u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 1); //set SCK to mode 3 idle state before CS goes active - u8g_SetPILevel_DUE(u8g, U8G_PI_CS, LOW); - } - else { - u8g_SetPILevel_DUE(u8g, U8G_PI_CS, HIGH); - u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); //set SCK to mode 0 idle state after CS goes inactive - } - #else - u8g_SetPILevel_DUE(u8g, U8G_PI_CS, !arg_val); - #endif - break; - - case U8G_COM_MSG_WRITE_BYTE: - SPISEND_SW_DUE(arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - SPISEND_SW_DUE(*ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - SPISEND_SW_DUE(u8g_pgm_read(ptr)); - ptr++; - arg_val--; - } - } - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g_SetPILevel_DUE(u8g, U8G_PI_A0, arg_val); - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD && !U8GLIB_ST7920 -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp deleted file mode 100644 index d3609f60ef..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp +++ /dev/null @@ -1,112 +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 . - * - */ - -/** - * Based on u8g_com_st7920_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "../../shared/Delay.h" - -#include - -#include "u8g_com_HAL_DUE_sw_spi_shared.h" - -void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) { - PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1, - g_APinDescription[u8g->pin_list[pin_index]].ulPin, g_APinDescription[u8g->pin_list[pin_index]].ulPinConfiguration); // OUTPUT -} - -void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level) { - volatile Pio* port = g_APinDescription[u8g->pin_list[pin_index]].pPort; - uint32_t mask = g_APinDescription[u8g->pin_list[pin_index]].ulPin; - if (level) port->PIO_SODR = mask; else port->PIO_CODR = mask; -} - -Pio *SCK_pPio, *MOSI_pPio; -uint32_t SCK_dwMask, MOSI_dwMask; - -void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz - for (uint8_t i = 0; i < 8; i++) { - if (val & 0x80) - MOSI_pPio->PIO_SODR = MOSI_dwMask; - else - MOSI_pPio->PIO_CODR = MOSI_dwMask; - DELAY_NS(48); - SCK_pPio->PIO_SODR = SCK_dwMask; - DELAY_NS(905); - val <<= 1; - SCK_pPio->PIO_CODR = SCK_dwMask; - } -} - -void u8g_spiSend_sw_DUE_mode_3(uint8_t val) { // 3.5MHz - for (uint8_t i = 0; i < 8; i++) { - SCK_pPio->PIO_CODR = SCK_dwMask; - DELAY_NS(50); - if (val & 0x80) - MOSI_pPio->PIO_SODR = MOSI_dwMask; - else - MOSI_pPio->PIO_CODR = MOSI_dwMask; - val <<= 1; - DELAY_NS(10); - SCK_pPio->PIO_SODR = SCK_dwMask; - DELAY_NS(70); - } -} - -#endif // HAS_GRAPHICAL_LCD -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h deleted file mode 100644 index b832474150..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h +++ /dev/null @@ -1,35 +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 - -#include "../../../inc/MarlinConfigPre.h" -#include "../../shared/Marduino.h" -#include - -void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index); -void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level); - -void u8g_spiSend_sw_DUE_mode_0(uint8_t val); -void u8g_spiSend_sw_DUE_mode_3(uint8_t val); - -extern Pio *SCK_pPio, *MOSI_pPio; -extern uint32_t SCK_dwMask, MOSI_dwMask; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h deleted file mode 100644 index daa2b3c15e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h +++ /dev/null @@ -1,83 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -/** - * Endstop interrupts for Due based targets. - * On Due, all pins support external interrupt capability. - */ - -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) - #if HAS_X_MAX - _ATTACH(X_MAX_PIN); - #endif - #if HAS_X_MIN - _ATTACH(X_MIN_PIN); - #endif - #if HAS_Y_MAX - _ATTACH(Y_MAX_PIN); - #endif - #if HAS_Y_MIN - _ATTACH(Y_MIN_PIN); - #endif - #if HAS_Z_MAX - _ATTACH(Z_MAX_PIN); - #endif - #if HAS_Z_MIN - _ATTACH(Z_MIN_PIN); - #endif - #if HAS_Z2_MAX - _ATTACH(Z2_MAX_PIN); - #endif - #if HAS_Z2_MIN - _ATTACH(Z2_MIN_PIN); - #endif - #if HAS_Z3_MAX - _ATTACH(Z3_MAX_PIN); - #endif - #if HAS_Z3_MIN - _ATTACH(Z3_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio.h deleted file mode 100644 index a97a944e33..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio.h +++ /dev/null @@ -1,562 +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 - -/** - * Fast I/O Routines for SAM3X8E - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -/** - * Description: Fast IO functions for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - * Note the code here was specifically crafted by disassembling what GCC produces - * out of it, so GCC is able to optimize it out as much as possible to the least - * amount of instructions. Be very carefull if you modify them, as "clean code" - * leads to less efficient compiled code!! - */ - -#include - -#include "../../inc/MarlinConfigPre.h" - -/** - * Utility functions - */ - -// Due has 12 PWMs assigned to logical pins 2-13. -// 6, 7, 8 & 9 come from the PWM controller. The others come from the timers. -#define PWM_PIN(P) WITHIN(P, 2, 13) - -#ifndef MASK - #define MASK(PIN) (1 << PIN) -#endif - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -// Read a pin -#define _READ(IO) bool(DIO ## IO ## _WPORT -> PIO_PDSR & MASK(DIO ## IO ## _PIN)) - -// Write to a pin -#define _WRITE(IO,V) do { \ - volatile Pio* port = (DIO ## IO ## _WPORT); \ - const uint32_t mask = MASK(DIO ## IO ## _PIN); \ - if (V) port->PIO_SODR = mask; \ - else port->PIO_CODR = mask; \ -}while(0) - -// Toggle a pin -#define _TOGGLE(IO) _WRITE(IO, !READ(IO)) - -#if MB(PRINTRBOARD_G2) - - #include "fastio/G2_pins.h" - - // Set pin as input - #define _SET_INPUT(IO) do{ \ - pmc_enable_periph_clk(G2_g_APinDescription[IO].ulPeripheralId); \ - PIO_Configure((DIO ## IO ## _WPORT), PIO_INPUT, MASK(DIO ## IO ## _PIN), 0); \ - }while(0) - - // Set pin as output - #define _SET_OUTPUT(IO) do{ \ - uint32_t mask = MASK(G2_g_APinDescription[IO].ulPeripheralId); \ - if ((PMC->PMC_PCSR0 & mask) != (mask)) PMC->PMC_PCER0 = mask; \ - volatile Pio* port = (DIO ## IO ## _WPORT); \ - mask = MASK(DIO ## IO ## _PIN); \ - if (_READ(IO)) port->PIO_SODR = mask; \ - else port->PIO_CODR = mask; \ - port->PIO_IDR = mask; \ - const uint32_t pin_config = G2_g_APinDescription[IO].ulPinConfiguration; \ - if (pin_config & PIO_PULLUP) port->PIO_PUER = mask; \ - else port->PIO_PUDR = mask; \ - if (pin_config & PIO_OPENDRAIN) port->PIO_MDER = mask; \ - else port->PIO_MDDR = mask; \ - port->PIO_PER = mask; \ - port->PIO_OER = mask; \ - g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT; \ - }while(0) - - /** - * Set pin as output with comments - * #define _SET_OUTPUT(IO) do{ \ - * uint32_t mask = MASK(G2_g_APinDescription[IO].ulPeripheralId); \ - * if ((PMC->PMC_PCSR0 & mask ) != (mask)) PMC->PMC_PCER0 = mask; \ // enable PIO clock if not already enabled - * - * volatile Pio* port = (DIO ## IO ## _WPORT); \ - * const uint32_t mask = MASK(DIO ## IO ## _PIN); \ - * if (_READ(IO)) port->PIO_SODR = mask; \ // set output to match input BEFORE setting direction or will glitch the output - * else port->PIO_CODR = mask; \ - * - * port->PIO_IDR = mask; \ // disable interrupt - * - * uint32_t pin_config = G2_g_APinDescription[IO].ulPinConfiguration; \ - * if (pin_config & PIO_PULLUP) pPio->PIO_PUER = mask; \ // enable pullup if necessary - * else pPio->PIO_PUDR = mask; \ - * - * if (pin_config & PIO_OPENDRAIN) port->PIO_MDER = mask; \ // Enable multi-drive if necessary - * else port->PIO_MDDR = mask; \ - * - * port->PIO_PER = mask; \ - * port->PIO_OER = mask; \ // set to output - * - * g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT; \ - * }while(0) - */ - -#else - - // Set pin as input - #define _SET_INPUT(IO) do{ \ - pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \ - PIO_Configure(digitalPinToPort(IO), PIO_INPUT, digitalPinToBitMask(IO), 0); \ - }while(0) - - // Set pin as output - #define _SET_OUTPUT(IO) do{ \ - pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \ - PIO_Configure(digitalPinToPort(IO), _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, digitalPinToBitMask(IO), g_APinDescription[IO].ulPinConfiguration); \ - g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT; \ - }while(0) -#endif - -// Set pin as input with pullup mode -#define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT) - -// Read a pin (wrapper) -#define READ(IO) _READ(IO) - -// Write to a pin (wrapper) -#define WRITE(IO,V) _WRITE(IO,V) - -// Toggle a pin (wrapper) -#define TOGGLE(IO) _TOGGLE(IO) - -// Set pin as input (wrapper) -#define SET_INPUT(IO) _SET_INPUT(IO) -// Set pin as input with pullup (wrapper) -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) -// Set pin as output (wrapper) - reads the pin and sets the output to that value -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) -// Set pin as PWM -#define SET_PWM(IO) SET_OUTPUT(IO) - -// Check if pin is an input -#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0) -// Check if pin is an output -#define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0) - -// Shorthand -#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); } - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -/** - * Ports and functions - * Added as necessary or if I feel like it- not a comprehensive list! - */ - -// UART -#define RXD DIO0 -#define TXD DIO1 - -// TWI (I2C) -#define SCL DIO21 -#define SDA DIO20 - -/** - * pins - */ - -#define DIO0_PIN 8 -#define DIO0_WPORT PIOA - -#define DIO1_PIN 9 -#define DIO1_WPORT PIOA - -#define DIO2_PIN 25 -#define DIO2_WPORT PIOB - -#define DIO3_PIN 28 -#define DIO3_WPORT PIOC - -#define DIO4_PIN 26 -#define DIO4_WPORT PIOC - -#define DIO5_PIN 25 -#define DIO5_WPORT PIOC - -#define DIO6_PIN 24 -#define DIO6_WPORT PIOC - -#define DIO7_PIN 23 -#define DIO7_WPORT PIOC - -#define DIO8_PIN 22 -#define DIO8_WPORT PIOC - -#define DIO9_PIN 21 -#define DIO9_WPORT PIOC - -#define DIO10_PIN 29 -#define DIO10_WPORT PIOC - -#define DIO11_PIN 7 -#define DIO11_WPORT PIOD - -#define DIO12_PIN 8 -#define DIO12_WPORT PIOD - -#define DIO13_PIN 27 -#define DIO13_WPORT PIOB - -#define DIO14_PIN 4 -#define DIO14_WPORT PIOD - -#define DIO15_PIN 5 -#define DIO15_WPORT PIOD - -#define DIO16_PIN 13 -#define DIO16_WPORT PIOA - -#define DIO17_PIN 12 -#define DIO17_WPORT PIOA - -#define DIO18_PIN 11 -#define DIO18_WPORT PIOA - -#define DIO19_PIN 10 -#define DIO19_WPORT PIOA - -#define DIO20_PIN 12 -#define DIO20_WPORT PIOB - -#define DIO21_PIN 13 -#define DIO21_WPORT PIOB - -#define DIO22_PIN 26 -#define DIO22_WPORT PIOB - -#define DIO23_PIN 14 -#define DIO23_WPORT PIOA - -#define DIO24_PIN 15 -#define DIO24_WPORT PIOA - -#define DIO25_PIN 0 -#define DIO25_WPORT PIOD - -#define DIO26_PIN 1 -#define DIO26_WPORT PIOD - -#define DIO27_PIN 2 -#define DIO27_WPORT PIOD - -#define DIO28_PIN 3 -#define DIO28_WPORT PIOD - -#define DIO29_PIN 6 -#define DIO29_WPORT PIOD - -#define DIO30_PIN 9 -#define DIO30_WPORT PIOD - -#define DIO31_PIN 7 -#define DIO31_WPORT PIOA - -#define DIO32_PIN 10 -#define DIO32_WPORT PIOD - -#define DIO33_PIN 1 -#define DIO33_WPORT PIOC - -#if !MB(PRINTRBOARD_G2) // normal DUE pin mapping - - #define DIO34_PIN 2 - #define DIO34_WPORT PIOC - - #define DIO35_PIN 3 - #define DIO35_WPORT PIOC - - #define DIO36_PIN 4 - #define DIO36_WPORT PIOC - - #define DIO37_PIN 5 - #define DIO37_WPORT PIOC - - #define DIO38_PIN 6 - #define DIO38_WPORT PIOC - - #define DIO39_PIN 7 - #define DIO39_WPORT PIOC - - #define DIO40_PIN 8 - #define DIO40_WPORT PIOC - - #define DIO41_PIN 9 - #define DIO41_WPORT PIOC - -#endif // !PRINTRBOARD_G2 - -#define DIO42_PIN 19 -#define DIO42_WPORT PIOA - -#define DIO43_PIN 20 -#define DIO43_WPORT PIOA - -#define DIO44_PIN 19 -#define DIO44_WPORT PIOC - -#define DIO45_PIN 18 -#define DIO45_WPORT PIOC - -#define DIO46_PIN 17 -#define DIO46_WPORT PIOC - -#define DIO47_PIN 16 -#define DIO47_WPORT PIOC - -#define DIO48_PIN 15 -#define DIO48_WPORT PIOC - -#define DIO49_PIN 14 -#define DIO49_WPORT PIOC - -#define DIO50_PIN 13 -#define DIO50_WPORT PIOC - -#define DIO51_PIN 12 -#define DIO51_WPORT PIOC - -#define DIO52_PIN 21 -#define DIO52_WPORT PIOB - -#define DIO53_PIN 14 -#define DIO53_WPORT PIOB - -#define DIO54_PIN 16 -#define DIO54_WPORT PIOA - -#define DIO55_PIN 24 -#define DIO55_WPORT PIOA - -#define DIO56_PIN 23 -#define DIO56_WPORT PIOA - -#define DIO57_PIN 22 -#define DIO57_WPORT PIOA - -#define DIO58_PIN 6 -#define DIO58_WPORT PIOA - -#define DIO59_PIN 4 -#define DIO59_WPORT PIOA - -#define DIO60_PIN 3 -#define DIO60_WPORT PIOA - -#define DIO61_PIN 2 -#define DIO61_WPORT PIOA - -#define DIO62_PIN 17 -#define DIO62_WPORT PIOB - -#define DIO63_PIN 18 -#define DIO63_WPORT PIOB - -#define DIO64_PIN 19 -#define DIO64_WPORT PIOB - -#define DIO65_PIN 20 -#define DIO65_WPORT PIOB - -#define DIO66_PIN 15 -#define DIO66_WPORT PIOB - -#define DIO67_PIN 16 -#define DIO67_WPORT PIOB - -#define DIO68_PIN 1 -#define DIO68_WPORT PIOA - -#define DIO69_PIN 0 -#define DIO69_WPORT PIOA - -#define DIO70_PIN 17 -#define DIO70_WPORT PIOA - -#define DIO71_PIN 18 -#define DIO71_WPORT PIOA - -#define DIO72_PIN 30 -#define DIO72_WPORT PIOC - -#define DIO73_PIN 21 -#define DIO73_WPORT PIOA - -#define DIO74_PIN 25 -#define DIO74_WPORT PIOA - -#define DIO75_PIN 26 -#define DIO75_WPORT PIOA - -#define DIO76_PIN 27 -#define DIO76_WPORT PIOA - -#define DIO77_PIN 28 -#define DIO77_WPORT PIOA - -#define DIO78_PIN 23 -#define DIO78_WPORT PIOB - -#define DIO79_PIN 17 -#define DIO79_WPORT PIOA - -#define DIO80_PIN 12 -#define DIO80_WPORT PIOB - -#define DIO81_PIN 8 -#define DIO81_WPORT PIOA - -#define DIO82_PIN 11 -#define DIO82_WPORT PIOA - -#define DIO83_PIN 13 -#define DIO83_WPORT PIOA - -#define DIO84_PIN 4 -#define DIO84_WPORT PIOD - -#define DIO85_PIN 11 -#define DIO85_WPORT PIOB - -#define DIO86_PIN 21 -#define DIO86_WPORT PIOB - -#define DIO87_PIN 29 -#define DIO87_WPORT PIOA - -#define DIO88_PIN 15 -#define DIO88_WPORT PIOB - -#define DIO89_PIN 14 -#define DIO89_WPORT PIOB - -#define DIO90_PIN 1 -#define DIO90_WPORT PIOA - -#define DIO91_PIN 15 -#define DIO91_WPORT PIOB - -#if ARDUINO_SAM_ARCHIM - - #define DIO92_PIN 11 - #define DIO92_WPORT PIOC - - #define DIO93_PIN 2 - #define DIO93_WPORT PIOB - - #define DIO94_PIN 1 - #define DIO94_WPORT PIOB - - #define DIO95_PIN 0 - #define DIO95_WPORT PIOB - - #define DIO96_PIN 10 - #define DIO96_WPORT PIOC - - #define DIO97_PIN 24 - #define DIO97_WPORT PIOB - - #define DIO98_PIN 7 - #define DIO98_WPORT PIOB - - #define DIO99_PIN 6 - #define DIO99_WPORT PIOB - - #define DIO100_PIN 8 - #define DIO100_WPORT PIOB - - #define DIO101_PIN 5 - #define DIO101_WPORT PIOB - - #define DIO102_PIN 4 - #define DIO102_WPORT PIOB - - #define DIO103_PIN 3 - #define DIO103_WPORT PIOB - - #define DIO104_PIN 20 - #define DIO104_WPORT PIOC - - #define DIO105_PIN 22 - #define DIO105_WPORT PIOB - - #define DIO106_PIN 27 - #define DIO106_WPORT PIOC - - #define DIO107_PIN 10 - #define DIO107_WPORT PIOB - - #define DIO108_PIN 9 - #define DIO108_WPORT PIOB - -#else // !ARDUINO_SAM_ARCHIM - - #define DIO92_PIN 5 - #define DIO92_WPORT PIOA - - #define DIO93_PIN 12 - #define DIO93_WPORT PIOB - - #define DIO94_PIN 22 - #define DIO94_WPORT PIOB - - #define DIO95_PIN 23 - #define DIO95_WPORT PIOB - - #define DIO96_PIN 24 - #define DIO96_WPORT PIOB - - #define DIO97_PIN 20 - #define DIO97_WPORT PIOC - - #define DIO98_PIN 27 - #define DIO98_WPORT PIOC - - #define DIO99_PIN 10 - #define DIO99_WPORT PIOC - - #define DIO100_PIN 11 - #define DIO100_WPORT PIOC - -#endif // !ARDUINO_SAM_ARCHIM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp deleted file mode 100644 index 4afd83ad4b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp +++ /dev/null @@ -1,145 +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 . - * - */ - -/** - * The PWM module is only used to generate interrupts at specified times. It - * is NOT used to directly toggle pins. The ISR writes to the pin assigned to - * that interrupt. - * - * All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to - * not have obvious ripple on the Vref signals. - * - * The data structures are setup to minimize the computation done by the ISR which - * minimizes ISR execution time. Execution times are 0.8 to 1.1 microseconds. - * - * FIve PWM interrupt sources are used. Channel 0 sets the base period. All Vref - * signals are set active when this counter overflows and resets to zero. The compare - * values in channels 1-4 are set to give the desired duty cycle for that Vref pin. - * When counter 0 matches the compare value then that channel generates an interrupt. - * The ISR checks the source of the interrupt and sets the corresponding pin inactive. - * - * Some jitter in the Vref signal is OK so the interrupt priority is left at its default value. - */ - -#include "../../../inc/MarlinConfig.h" - -#if MB(PRINTRBOARD_G2) - -#include "G2_PWM.h" - -volatile uint32_t *SODR_A = &PIOA->PIO_SODR, - *SODR_B = &PIOB->PIO_SODR, - *CODR_A = &PIOA->PIO_CODR, - *CODR_B = &PIOB->PIO_CODR; - -PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT; - -void Stepper::digipot_init() { - - OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins - OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0); - OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0); - OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0); - - #define WPKEY (0x50574D << 8) // “PWM” in ASCII - #define WPCMD_DIS_SW 0 // command to disable Write Protect SW - #define WPRG_ALL (PWM_WPCR_WPRG0 | PWM_WPCR_WPRG1 | PWM_WPCR_WPRG2 | PWM_WPCR_WPRG3 | PWM_WPCR_WPRG4 | PWM_WPCR_WPRG5) // all Write Protect Groups - - #define PWM_CLOCK_F F_CPU / 1000000UL // set clock to 1MHz - - PMC->PMC_PCER1 = PMC_PCER1_PID36; // enable PWM controller clock (disabled on power up) - - PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers - PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled - PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned - PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned - PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned - PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned - PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned - - PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period - - PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows - PWM->PWM_IER2 = PWM_IER2_CMPM0 | PWM_IER2_CMPM1 | PWM_IER2_CMPM2 | PWM_IER2_CMPM3 | PWM_IER2_CMPM4; // generate interrupt on compare event - - PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive - PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive - PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive - PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive - - PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event - PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event - PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event - PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event - - PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0 | PWM_SCM_SYNC1 | PWM_SCM_SYNC2 | PWM_SCM_SYNC3 | PWM_SCM_SYNC4; // sync 1-4 with 0, use mode 0 for updates - - PWM->PWM_ENA = PWM_ENA_CHID0 | PWM_ENA_CHID1 | PWM_ENA_CHID2 | PWM_ENA_CHID3 | PWM_ENA_CHID4; // enable the channels used by G2 - PWM->PWM_IER1 = PWM_IER1_CHID0 | PWM_IER1_CHID1 | PWM_IER1_CHID2 | PWM_IER1_CHID3 | PWM_IER1_CHID4; // enable interrupts for the channels used by G2 - - NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler - NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals) -} - -void Stepper::digipot_current(const uint8_t driver, const int16_t current) { - - if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed - - switch (driver) { - case 0: PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y - PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); - PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event - PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event - PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle - break; - case 1: PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z - PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event - PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle - break; - default:PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E - PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event - PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle - break; - } -} - -volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS; - -void PWM_Handler() { - PWM_ISR1_STATUS = PWM->PWM_ISR1; - PWM_ISR2_STATUS = PWM->PWM_ISR2; - if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt - *ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active - *ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active - *ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active - *ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active - } - else { - if (PWM_ISR2_STATUS & PWM_IER2_CMPM1) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive - if (PWM_ISR2_STATUS & PWM_IER2_CMPM2) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive - if (PWM_ISR2_STATUS & PWM_IER2_CMPM3) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive - if (PWM_ISR2_STATUS & PWM_IER2_CMPM4) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive - } - return; -} - -#endif // PRINTRBOARD_G2 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h deleted file mode 100644 index 4a84dfe64a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h +++ /dev/null @@ -1,78 +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 - -/** - * This module is stripped down version of the LPC1768_PWM.h file from - * PR #7500. It is hardwired for the PRINTRBOARD_G2 Motor Current needs. - */ - -#include "../../../inc/MarlinConfigPre.h" -#include "../../../module/stepper.h" -//C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\stepper.h -//C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\HAL\HAL_DUE\G2_PWM.h - -#define PWM_PERIOD_US 100 // base repetition rate in micro seconds - -typedef struct { // holds the data needed by the ISR to control the Vref pin - volatile uint32_t* set_register; - volatile uint32_t* clr_register; - uint32_t write_mask; -} PWM_map; - -#define G2_VREF(I) (uint32_t)(I * 5 * 0.15) // desired Vref * 1000 (scaled so don't loose accuracy in next step) - -#define G2_VREF_COUNT(Q) (uint32_t)map(constrain(Q, 500, 3.3 * 1000), 0, 3.3 * 1000, 0, PWM_PERIOD_US) // under 500 the results are very non-linear - -extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B; - -#define _PIN(IO) (DIO ## IO ## _PIN) - -#define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) } - - -#define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \ - PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \ - PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \ - PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_E_PIN, 'A'), \ - }; - -#define NUM_PWMS 4 - -extern PWM_map ISR_table[NUM_PWMS]; - -extern uint32_t motor_current_setting[3]; - -#define IR_BIT(p) (WITHIN(p, 0, 3) ? (p) : (p) + 4) -#define COPY_ACTIVE_TABLE() do{ for (uint8_t i = 0; i < 6 ; i++) work_table[i] = active_table[i]; }while(0) - -#define PWM_MR0 19999 // base repetition rate minus one count - 20mS -#define PWM_PR 24 // prescaler value - prescaler divide by 24 + 1 - 1 MHz output -#define PWM_PCLKSEL0 0x00 // select clock source for prescaler - defaults to 25MHz on power up - // 0: 25MHz, 1: 100MHz, 2: 50MHz, 3: 12.5MHZ to PWM1 prescaler -#define MR0_MARGIN 200 // if channel value too close to MR0 the system locks up - -extern bool PWM_table_swap; // flag to tell the ISR that the tables have been swapped - -#define HAL_G2_PWM_ISR void PWM_Handler() - -extern volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h deleted file mode 100644 index e5ce834f45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h +++ /dev/null @@ -1,278 +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 - -#include - -/** - * This file contains the custom port/pin definitions for the PRINTRBOARD_G2 - * motherboard. This motherboard uses the SAM3X8C which is a subset of the - * SAM3X8E used in the DUE board. It uses port/pin pairs that are not - * available using the DUE definitions. - * - * The first part is a copy of the pin descriptions in the - * "variants\arduino_due_x\variant.cpp" file but with pins 34-41 replaced by - * the G2 pins. - * - * The second part is the FASTIO port/pin definitions. - * - * THESE PINS CAN ONLY BE ACCESSED VIA FASTIO COMMANDS. - */ - -/* - Copyright (c) 2011 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -typedef struct _G2_PinDescription { - Pio* pPort; - uint32_t ulPin; - uint32_t ulPeripheralId; - EPioType ulPinType; - uint32_t ulPinConfiguration; - uint32_t ulPinAttribute; - EAnalogChannel ulAnalogChannel; /* Analog pin in the Arduino context (label on the board) */ - EAnalogChannel ulADCChannelNumber; /* ADC Channel number in the SAM device */ - EPWMChannel ulPWMChannel; - ETCChannel ulTCChannel; -} G2_PinDescription; - -/** - * This section is a copy of the pin descriptions in the "variants\arduino_due_x\variant.cpp" file - * with pins 34-41 replaced by the G2 pins. - */ - -/** - * Pins descriptions - */ -const G2_PinDescription G2_g_APinDescription[] = { - // 0 .. 53 - Digital pins - // ---------------------- - // 0/1 - UART (Serial) - { PIOA, PIO_PA8A_URXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // URXD - { PIOA, PIO_PA9A_UTXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // UTXD - - // 2 - { PIOB, PIO_PB25B_TIOA0, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC0_CHA0 }, // TIOA0 - { PIOC, PIO_PC28B_TIOA7, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHA7 }, // TIOA7 - { PIOC, PIO_PC26B_TIOB6, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHB6 }, // TIOB6 - - // 5 - { PIOC, PIO_PC25B_TIOA6, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHA6 }, // TIOA6 - { PIOC, PIO_PC24B_PWML7, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), NO_ADC, NO_ADC, PWM_CH7, NOT_ON_TIMER }, // PWML7 - { PIOC, PIO_PC23B_PWML6, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), NO_ADC, NO_ADC, PWM_CH6, NOT_ON_TIMER }, // PWML6 - { PIOC, PIO_PC22B_PWML5, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), NO_ADC, NO_ADC, PWM_CH5, NOT_ON_TIMER }, // PWML5 - { PIOC, PIO_PC21B_PWML4, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), NO_ADC, NO_ADC, PWM_CH4, NOT_ON_TIMER }, // PWML4 - // 10 - { PIOC, PIO_PC29B_TIOB7, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHB7 }, // TIOB7 - { PIOD, PIO_PD7B_TIOA8, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHA8 }, // TIOA8 - { PIOD, PIO_PD8B_TIOB8, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC2_CHB8 }, // TIOB8 - - // 13 - AMBER LED - { PIOB, PIO_PB27B_TIOB0, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_TIMER), NO_ADC, NO_ADC, NOT_ON_PWM, TC0_CHB0 }, // TIOB0 - - // 14/15 - USART3 (Serial3) - { PIOD, PIO_PD4B_TXD3, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TXD3 - { PIOD, PIO_PD5B_RXD3, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // RXD3 - - // 16/17 - USART1 (Serial2) - { PIOA, PIO_PA13A_TXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TXD1 - { PIOA, PIO_PA12A_RXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // RXD1 - - // 18/19 - USART0 (Serial1) - { PIOA, PIO_PA11A_TXD0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TXD0 - { PIOA, PIO_PA10A_RXD0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // RXD0 - - // 20/21 - TWI1 - { PIOB, PIO_PB12A_TWD1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TWD1 - SDA0 - { PIOB, PIO_PB13A_TWCK1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TWCK1 - SCL0 - - // 22 - { PIOB, PIO_PB26, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 22 - { PIOA, PIO_PA14, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 23 - { PIOA, PIO_PA15, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 24 - { PIOD, PIO_PD0, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 25 - - // 26 - { PIOD, PIO_PD1, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 26 - { PIOD, PIO_PD2, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 27 - { PIOD, PIO_PD3, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 28 - { PIOD, PIO_PD6, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 29 - - // 30 - { PIOD, PIO_PD9, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 30 - { PIOA, PIO_PA7, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 31 - { PIOD, PIO_PD10, ID_PIOD, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 32 - { PIOC, PIO_PC1, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 33 - - // 34 - - // start of custom pins - { PIOA, PIO_PA29, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 34 Y_STEP_PIN - { PIOB, PIO_PB1, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 35 Y_DIR_PIN - { PIOB, PIO_PB0, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 36 Y_ENABLE_PIN - { PIOB, PIO_PB22, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 37 E0_ENABLE_PIN - { PIOB, PIO_PB11, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 38 E0_MS1_PIN - { PIOB, PIO_PB10, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 39 E0_MS3_PIN - { PIOA, PIO_PA5, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 40 HEATER_0_PIN - { PIOB, PIO_PB24, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 41 HEATER_BED_PIN - // end of custom pins - - // 42 - { PIOA, PIO_PA19, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 42 - { PIOA, PIO_PA20, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 43 - { PIOC, PIO_PC19, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 44 - { PIOC, PIO_PC18, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 45 - - // 46 - { PIOC, PIO_PC17, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 46 - { PIOC, PIO_PC16, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 47 - { PIOC, PIO_PC15, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 48 - { PIOC, PIO_PC14, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 49 - - // 50 - { PIOC, PIO_PC13, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 50 - { PIOC, PIO_PC12, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 51 - { PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52 - { PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53 - - - // 54 .. 65 - Analog pins - // ---------------------- - { PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0 - { PIOA, PIO_PA24X1_AD6, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC1, ADC6, NOT_ON_PWM, NOT_ON_TIMER }, // AD1 - { PIOA, PIO_PA23X1_AD5, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC2, ADC5, NOT_ON_PWM, NOT_ON_TIMER }, // AD2 - { PIOA, PIO_PA22X1_AD4, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC3, ADC4, NOT_ON_PWM, NOT_ON_TIMER }, // AD3 - // 58 - { PIOA, PIO_PA6X1_AD3, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC4, ADC3, NOT_ON_PWM, TC0_CHB2 }, // AD4 - { PIOA, PIO_PA4X1_AD2, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC5, ADC2, NOT_ON_PWM, NOT_ON_TIMER }, // AD5 - { PIOA, PIO_PA3X1_AD1, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC6, ADC1, NOT_ON_PWM, TC0_CHB1 }, // AD6 - { PIOA, PIO_PA2X1_AD0, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC7, ADC0, NOT_ON_PWM, TC0_CHA1 }, // AD7 - // 62 - { PIOB, PIO_PB17X1_AD10, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC8, ADC10, NOT_ON_PWM, NOT_ON_TIMER }, // AD8 - { PIOB, PIO_PB18X1_AD11, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC9, ADC11, NOT_ON_PWM, NOT_ON_TIMER }, // AD9 - { PIOB, PIO_PB19X1_AD12, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC10, ADC12, NOT_ON_PWM, NOT_ON_TIMER }, // AD10 - { PIOB, PIO_PB20X1_AD13, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC11, ADC13, NOT_ON_PWM, NOT_ON_TIMER }, // AD11 - - // 66/67 - DAC0/DAC1 - { PIOB, PIO_PB15X1_DAC0, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC12, DA0, NOT_ON_PWM, NOT_ON_TIMER }, // DAC0 - { PIOB, PIO_PB16X1_DAC1, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC13, DA1, NOT_ON_PWM, NOT_ON_TIMER }, // DAC1 - - // 68/69 - CANRX0/CANTX0 - { PIOA, PIO_PA1A_CANRX0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, ADC14, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANRX - { PIOA, PIO_PA0A_CANTX0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, ADC15, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANTX - - // 70/71 - TWI0 - { PIOA, PIO_PA17A_TWD0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TWD0 - SDA1 - { PIOA, PIO_PA18A_TWCK0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // TWCK0 - SCL1 - - // 72/73 - LEDs - { PIOC, PIO_PC30, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // LED AMBER RXL - { PIOA, PIO_PA21, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // LED AMBER TXL - - // 74/75/76 - SPI - { PIOA, PIO_PA25A_SPI0_MISO,ID_PIOA,PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // MISO - { PIOA, PIO_PA26A_SPI0_MOSI,ID_PIOA,PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // MOSI - { PIOA, PIO_PA27A_SPI0_SPCK,ID_PIOA,PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // SPCK - - // 77 - SPI CS0 - { PIOA, PIO_PA28A_SPI0_NPCS0,ID_PIOA,PIO_PERIPH_A,PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // NPCS0 - - // 78 - SPI CS3 (unconnected) - { PIOB, PIO_PB23B_SPI0_NPCS3,ID_PIOB,PIO_PERIPH_B,PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // NPCS3 - - // 79 .. 84 - "All pins" masks - - // 79 - TWI0 all pins - { PIOA, PIO_PA17A_TWD0|PIO_PA18A_TWCK0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 80 - TWI1 all pins - { PIOB, PIO_PB12A_TWD1|PIO_PB13A_TWCK1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 81 - UART (Serial) all pins - { PIOA, PIO_PA8A_URXD|PIO_PA9A_UTXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 82 - USART0 (Serial1) all pins - { PIOA, PIO_PA11A_TXD0|PIO_PA10A_RXD0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 83 - USART1 (Serial2) all pins - { PIOA, PIO_PA13A_TXD1|PIO_PA12A_RXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 84 - USART3 (Serial3) all pins - { PIOD, PIO_PD4B_TXD3|PIO_PD5B_RXD3, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - - // 85 - USB - { PIOB, PIO_PB11A_UOTGID|PIO_PB10A_UOTGVBOF, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL,NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // ID - VBOF - - // 86 - SPI CS2 - { PIOB, PIO_PB21B_SPI0_NPCS2, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // NPCS2 - - // 87 - SPI CS1 - { PIOA, PIO_PA29A_SPI0_NPCS1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // NPCS1 - - // 88/89 - CANRX1/CANTX1 (same physical pin for 66/53) - { PIOB, PIO_PB15A_CANRX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANRX1 - { PIOB, PIO_PB14A_CANTX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANTX1 - - // 90 .. 91 - "All CAN pins" masks - // 90 - CAN0 all pins - { PIOA, PIO_PA1A_CANRX0|PIO_PA0A_CANTX0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - // 91 - CAN1 all pins - { PIOB, PIO_PB15A_CANRX1|PIO_PB14A_CANTX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, - - // END - { nullptr, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER } -}; - -// This section replaces the FASTIO definitions of pins 34-41 - -#define DIO34_PIN 29 -#define DIO34_WPORT PIOA // only available via FASTIO // 34 PA29 - Y_STEP_PIN - -#define DIO35_PIN 1 -#define DIO35_WPORT PIOB // only available via FASTIO // 35 PAB1 - Y_DIR_PIN - -#define DIO36_PIN 0 -#define DIO36_WPORT PIOB // only available via FASTIO // 36 PB0 - Y_ENABLE_PIN - -#define DIO37_PIN 22 -#define DIO37_WPORT PIOB // only available via FASTIO // 37 PB22 - E0_ENABLE_PIN - -#define DIO38_PIN 11 -#define DIO38_WPORT PIOB // only available via FASTIO // 38 PB11 - E0_MS1_PIN - -#define DIO39_PIN 10 -#define DIO39_WPORT PIOB // only available via FASTIO // 39 PB10 - E0_MS3_PIN - -#define DIO40_PIN 5 -#define DIO40_WPORT PIOA // only available via FASTIO // 40 PA5 - HEATER_0_PIN - -#define DIO41_PIN 24 -#define DIO41_WPORT PIOB // only available via FASTIO // 41 PB24 - HEATER_BED_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h deleted file mode 100644 index a8d51edfab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h +++ /dev/null @@ -1,57 +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 - -/** - * Test Arduino Due specific configuration values for errors at compile-time. - */ - -/** - * HARDWARE VS. SOFTWARE SPI COMPATIBILITY - * - * DUE selects hardware vs. software SPI depending on whether one of the hardware-controllable SDSS pins is in use. - * - * The hardware SPI controller doesn't allow software SPIs to control any shared pins. - * - * When DUE software SPI is used then Trinamic drivers must use the TMC softSPI. - * - * When DUE hardware SPI is used then a Trinamic driver can use either its hardware SPI or, if there are no shared - * pins, its software SPI. - * - * Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time - * as the TMC2130 soft SPI the most common setup. - */ -#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN)) - -#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130) - #if ENABLED(TMC_USE_SW_SPI) - #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) - #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs." - #endif - #elif ENABLED(DUE_SOFTWARE_SPI) - #error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix." - #endif -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp deleted file mode 100644 index fc1baa22ac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../../inc/MarlinConfig.h" -#include "../shared/persistent_store_api.h" - -#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM) - #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) -#endif - -extern void eeprom_flush(); - -bool PersistentStore::access_start() { return true; } - -bool PersistentStore::access_finish() { - #if NONE(I2C_EEPROM, SPI_EEPROM) - eeprom_flush(); - #endif - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - delay(2); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/pinsDebug.h deleted file mode 100644 index ed78f8adbb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/pinsDebug.h +++ /dev/null @@ -1,183 +0,0 @@ -/** - * 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 . - * - */ - -/** - * Support routines for Due - */ - -/** - * Translation of routines & variables used by pinsDebug.h - */ - -#include "../shared/Marduino.h" - -/** - * Due/Marlin quirks - * - * a) determining the state of a pin - * The Due/Arduino status definitions for the g_pinStatus[pin] array are: - * #define PIN_STATUS_DIGITAL_INPUT_PULLUP (0x01) - * #define PIN_STATUS_DIGITAL_INPUT (0x02) - * #define PIN_STATUS_DIGITAL_OUTPUT (0x03) - * #define PIN_STATUS_ANALOG (0x04) - * #define PIN_STATUS_PWM (0x05) - * #define PIN_STATUS_TIMER (0x06) - * - * These are only valid if the following Due/Arduino provided functions are used: - * analogRead - * analogWrite - * digitalWrite - * pinMode - * - * The FASTIO routines do not touch the g_pinStatus[pin] array. - * - * The net result is that both the g_pinStatus[pin] array and the PIO_OSR register - * needs to be looked at when determining if a pin is an input or an output. - * - * b) Due has only pins 6, 7, 8 & 9 enabled for PWMs. FYI - they run at 1KHz - * - * c) NUM_DIGITAL_PINS does not include the analog pins - * - * d) Pins 0-78 are defined for Due but 78 has a comment of "unconnected!". 78 is - * included just in case. - */ - -#define NUMBER_PINS_TOTAL PINS_COUNT - -#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin -#define PRINT_PORT(p) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0) -#define GET_ARRAY_PIN(p) pin_array[p].pin -#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital -#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0) -#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0)) -#define IS_ANALOG(P) WITHIN(P, char(analogInputToDigitalPin(0)), char(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1))) -#define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \ - ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM)) -#define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin - -bool GET_PINMODE(int8_t pin) { // 1: output, 0: input - volatile Pio* port = g_APinDescription[pin].pPort; - uint32_t mask = g_APinDescription[pin].ulPin; - uint8_t pin_status = g_pinStatus[pin] & 0xF; - return ( (pin_status == 0 && (port->PIO_OSR & mask)) - || pin_status == PIN_STATUS_DIGITAL_OUTPUT - || pwm_status(pin)); -} - - -void pwm_details(int32_t pin) { - if (pwm_status(pin)) { - uint32_t chan = g_APinDescription[pin].ulPWMChannel; - SERIAL_ECHOPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY); - } -} - -/** - * DUE Board pin | PORT | Label - * ----------------+--------+------- - * 0 | PA8 | "RX0" - * 1 | PA9 | "TX0" - * 2 TIOA0 | PB25 | - * 3 TIOA7 | PC28 | - * 4 NPCS1 | PA29 | - * TIOB6 | PC26 | - * 5 TIOA6 | PC25 | - * 6 PWML7 | PC24 | - * 7 PWML6 | PC23 | - * 8 PWML5 | PC22 | - * 9 PWML4 | PC21 | - * 10 NPCS0 | PA28 | - * TIOB7 | PC29 | - * 11 TIOA8 | PD7 | - * 12 TIOB8 | PD8 | - * 13 TIOB0 | PB27 | LED AMBER "L" - * 14 TXD3 | PD4 | "TX3" - * 15 RXD3 | PD5 | "RX3" - * 16 TXD1 | PA13 | "TX2" - * 17 RXD1 | PA12 | "RX2" - * 18 TXD0 | PA11 | "TX1" - * 19 RXD0 | PA10 | "RX1" - * 20 | PB12 | "SDA" - * 21 | PB13 | "SCL" - * 22 | PB26 | - * 23 | PA14 | - * 24 | PA15 | - * 25 | PD0 | - * 26 | PD1 | - * 27 | PD2 | - * 28 | PD3 | - * 29 | PD6 | - * 30 | PD9 | - * 31 | PA7 | - * 32 | PD10 | - * 33 | PC1 | - * 34 | PC2 | - * 35 | PC3 | - * 36 | PC4 | - * 37 | PC5 | - * 38 | PC6 | - * 39 | PC7 | - * 40 | PC8 | - * 41 | PC9 | - * 42 | PA19 | - * 43 | PA20 | - * 44 | PC19 | - * 45 | PC18 | - * 46 | PC17 | - * 47 | PC16 | - * 48 | PC15 | - * 49 | PC14 | - * 50 | PC13 | - * 51 | PC12 | - * 52 NPCS2 | PB21 | - * 53 | PB14 | - * 54 | PA16 | "A0" - * 55 | PA24 | "A1" - * 56 | PA23 | "A2" - * 57 | PA22 | "A3" - * 58 TIOB2 | PA6 | "A4" - * 69 | PA4 | "A5" - * 60 TIOB1 | PA3 | "A6" - * 61 TIOA1 | PA2 | "A7" - * 62 | PB17 | "A8" - * 63 | PB18 | "A9" - * 64 | PB19 | "A10" - * 65 | PB20 | "A11" - * 66 | PB15 | "DAC0" - * 67 | PB16 | "DAC1" - * 68 | PA1 | "CANRX" - * 69 | PA0 | "CANTX" - * 70 | PA17 | "SDA1" - * 71 | PA18 | "SCL1" - * 72 | PC30 | LED AMBER "RX" - * 73 | PA21 | LED AMBER "TX" - * 74 MISO | PA25 | - * 75 MOSI | PA26 | - * 76 SCLK | PA27 | - * 77 NPCS0 | PA28 | - * 78 NPCS3 | PB23 | unconnected! - * - * USB pin | PORT - * ----------------+-------- - * ID | PB11 - * VBOF | PB10 - * - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/spi_pins.h deleted file mode 100644 index 64ee17a9d8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/spi_pins.h +++ /dev/null @@ -1,64 +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 - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - * - * Available chip select pins for HW SPI are 4 10 52 77 - */ -#if SDSS == 4 || SDSS == 10 || SDSS == 52 || SDSS == 77 || SDSS == 87 - #if SDSS == 4 - #define SPI_PIN 87 - #define SPI_CHAN 1 - #elif SDSS == 10 - #define SPI_PIN 77 - #define SPI_CHAN 0 - #elif SDSS == 52 - #define SPI_PIN 86 - #define SPI_CHAN 2 - #elif SDSS == 77 - #define SPI_PIN 77 - #define SPI_CHAN 0 - #else - #define SPI_PIN 87 - #define SPI_CHAN 1 - #endif - #define SCK_PIN 76 - #define MISO_PIN 74 - #define MOSI_PIN 75 -#else - // defaults - #define DUE_SOFTWARE_SPI - #ifndef SCK_PIN - #define SCK_PIN 52 - #endif - #ifndef MISO_PIN - #define MISO_PIN 50 - #endif - #ifndef MOSI_PIN - #define MOSI_PIN 51 - #endif -#endif - -/* A.28, A.29, B.21, C.26, C.29 */ -#define SS_PIN SDSS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.cpp deleted file mode 100644 index 6925f93498..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ - -/** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - */ - -#ifdef ARDUINO_ARCH_SAM - -// ------------------------ -// Includes -// ------------------------ -#include "../../inc/MarlinConfig.h" -#include "HAL.h" - -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 9 - -// ------------------------ -// Private Variables -// ------------------------ - -const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { - { TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5] - { TC0, 1, TC1_IRQn, 0}, // 1 - { TC0, 2, TC2_IRQn, 2}, // 2 - stepper - { TC1, 0, TC3_IRQn, 0}, // 3 - stepper for BOARD_ARCHIM1 - { TC1, 1, TC4_IRQn, 15}, // 4 - temperature - { TC1, 2, TC5_IRQn, 3}, // 5 - [servo timer3] - { TC2, 0, TC6_IRQn, 14}, // 6 - tone - { TC2, 1, TC7_IRQn, 0}, // 7 - { TC2, 2, TC8_IRQn, 0}, // 8 -}; - -// ------------------------ -// Public functions -// ------------------------ - -/* - Timer_clock1: Prescaler 2 -> 42MHz - Timer_clock2: Prescaler 8 -> 10.5MHz - Timer_clock3: Prescaler 32 -> 2.625MHz - Timer_clock4: Prescaler 128 -> 656.25kHz -*/ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - Tc *tc = TimerConfig[timer_num].pTimerRegs; - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - uint32_t channel = TimerConfig[timer_num].channel; - - // Disable interrupt, just in case it was already enabled - NVIC_DisableIRQ(irq); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Disable timer interrupt - tc->TC_CHANNEL[channel].TC_IDR = TC_IDR_CPCS; - - // Stop timer, just in case, to be able to reconfigure it - TC_Stop(tc, channel); - - pmc_set_writeprotect(false); - pmc_enable_periph_clk((uint32_t)irq); - NVIC_SetPriority(irq, TimerConfig [timer_num].priority); - - // wave mode, reset counter on match with RC, - TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1); - - // Set compare value - TC_SetRC(tc, channel, VARIANT_MCK / 2 / frequency); - - // And start timer - TC_Start(tc, channel); - - // enable interrupt on RC compare - tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPCS; - - // Finally, enable IRQ - NVIC_EnableIRQ(irq); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - NVIC_EnableIRQ(irq); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - NVIC_DisableIRQ(irq); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -// missing from CMSIS: Check if interrupt is enabled or not -static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0; -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - return NVIC_GetEnabledIRQ(irq); -} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.h deleted file mode 100644 index b7b2cf7341..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/timers.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -/** - * HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM - */ - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals - -#ifndef STEP_TIMER_NUM -#define STEP_TIMER_NUM 2 // index of timer to use for stepper -#endif -#define TEMP_TIMER_NUM 4 // index of timer to use for temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM -#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones - -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -#ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() void TC2_Handler() -#endif -#define HAL_TEMP_TIMER_ISR() void TC4_Handler() -#define HAL_TONE_TIMER_ISR() void TC6_Handler() - -// ------------------------ -// Types -// ------------------------ - -typedef struct { - Tc *pTimerRegs; - uint16_t channel; - IRQn_Type IRQ_Id; - uint8_t priority; -} tTimerConfig; - -// ------------------------ -// Public Variables -// ------------------------ - -extern const tTimerConfig TimerConfig[]; - -// ------------------------ -// Public functions -// ------------------------ - -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) { - const tTimerConfig * const pConfig = &TimerConfig[timer_num]; - pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC = compare; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - const tTimerConfig * const pConfig = &TimerConfig[timer_num]; - return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - const tTimerConfig * const pConfig = &TimerConfig[timer_num]; - return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV; -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - const tTimerConfig * const pConfig = &TimerConfig[timer_num]; - // Reading the status register clears the interrupt flag - pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_SR; -} - -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h deleted file mode 100644 index 7355f74f6d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * \file - * - * \brief Arduino Due/X Board Definition. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -#pragma once - -/** - * Support and FAQ: visit Atmel Support - */ - -/** - * \page arduino_due_x_opfreq "Arduino Due/X - Operating frequencies" - * This page lists several definition related to the board operating frequency - * - * \section Definitions - * - \ref BOARD_FREQ_* - * - \ref BOARD_MCK - */ - -/*! Board oscillator settings */ -#define BOARD_FREQ_SLCK_XTAL (32768U) -#define BOARD_FREQ_SLCK_BYPASS (32768U) -#define BOARD_FREQ_MAINCK_XTAL (12000000U) -#define BOARD_FREQ_MAINCK_BYPASS (12000000U) - -/*! Master clock frequency */ -#define BOARD_MCK CHIP_FREQ_CPU_MAX -#define BOARD_NO_32K_XTAL - -/** board main clock xtal startup time */ -#define BOARD_OSC_STARTUP_US 15625 - -/* ------------------------------------------------------------------------ */ - -/** - * \page arduino_due_x_board_info "Arduino Due/X - Board informations" - * This page lists several definition related to the board description. - * - */ - -/* ------------------------------------------------------------------------ */ -/* USB */ -/* ------------------------------------------------------------------------ */ -/*! USB OTG VBus On/Off: Bus Power Control Port. */ -#define PIN_UOTGHS_VBOF { PIO_PB10, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP } -/*! USB OTG Identification: Mini Connector Identification Port. */ -#define PIN_UOTGHS_ID { PIO_PB11, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP } - -/*! Multiplexed pin used for USB_ID: */ -#define USB_ID PIO_PB11_IDX -#define USB_ID_GPIO (PIO_PB11_IDX) -#define USB_ID_FLAGS (PIO_PERIPH_A | PIO_DEFAULT) -/*! Multiplexed pin used for USB_VBOF: */ -#define USB_VBOF PIO_PB10_IDX -#define USB_VBOF_GPIO (PIO_PB10_IDX) -#define USB_VBOF_FLAGS (PIO_PERIPH_A | PIO_DEFAULT) -/*! Active level of the USB_VBOF output pin. */ -#define USB_VBOF_ACTIVE_LEVEL LOW -/* ------------------------------------------------------------------------ */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/compiler.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/compiler.h deleted file mode 100644 index 33df080e2f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/compiler.h +++ /dev/null @@ -1,1151 +0,0 @@ -/** - * \file - * - * \brief Commonly used includes, types and macros. - * - * Copyright (c) 2010-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef UTILS_COMPILER_H -#define UTILS_COMPILER_H - -#include -#include -#include "arduino_due_x.h" -#include "conf_clock.h" -#ifdef SAM3XA_SERIES -#define SAM3XA 1 -#endif -#define UDD_NO_SLEEP_MGR 1 -#define pmc_is_wakeup_clocks_restored() true - -#undef udd_get_endpoint_size_max -#define UDD_USB_INT_FUN USBD_ISR - -/** - * \defgroup group_sam_utils Compiler abstraction layer and code utilities - * - * Compiler abstraction layer and code utilities for AT91SAM. - * This module provides various abstraction layers and utilities to make code compatible between different compilers. - * - * \{ - */ -#include - -#if (defined __ICCARM__) -# include -#endif - -#include -#include "preprocessor.h" - -//_____ D E C L A R A T I O N S ____________________________________________ - -#ifndef __ASSEMBLY__ // Not defined for assembling. - -#include -#include -#include -#include - -#ifdef __ICCARM__ -/*! \name Compiler Keywords - * - * Port of some keywords from GCC to IAR Embedded Workbench. - */ -//! @{ -#define __asm__ asm -#define __inline__ inline -#define __volatile__ -//! @} - -#endif - -#define FUNC_PTR void * -/** - * \def UNUSED - * \brief Marking \a v as a unused parameter or value. - */ -#ifndef UNUSED - #define UNUSED(x) ((void)(x)) -#endif - -/** - * \def unused - * \brief Marking \a v as a unused parameter or value. - */ -#define unused(v) do { (void)(v); }while(0) - -/** - * \def barrier - * \brief Memory barrier - */ -#define barrier() __DMB() - -/** - * \brief Emit the compiler pragma \a arg. - * - * \param arg The pragma directive as it would appear after \e \#pragma - * (i.e. not stringified). - */ -#define COMPILER_PRAGMA(arg) _Pragma(#arg) - -/** - * \def COMPILER_PACK_SET(alignment) - * \brief Set maximum alignment for subsequent struct and union - * definitions to \a alignment. - */ -#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) - -/** - * \def COMPILER_PACK_RESET() - * \brief Set default alignment for subsequent struct and union - * definitions. - */ -#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) - - -/** - * \brief Set aligned boundary. - */ -#if (defined __GNUC__) || (defined __CC_ARM) -# define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) -#elif (defined __ICCARM__) -# define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) -#endif - -/** - * \brief Set word-aligned boundary. - */ -#if (defined __GNUC__) || defined(__CC_ARM) -#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) -#elif (defined __ICCARM__) -#define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) -#endif - -/** - * \def __always_inline - * \brief The function should always be inlined. - * - * This annotation instructs the compiler to ignore its inlining - * heuristics and inline the function no matter how big it thinks it - * becomes. - */ -#ifdef __CC_ARM -# define __always_inline __forceinline -#elif (defined __GNUC__) -#ifdef __always_inline -# undef __always_inline -#endif -# define __always_inline inline __attribute__((__always_inline__)) -#elif (defined __ICCARM__) -# define __always_inline _Pragma("inline=forced") -#endif - -/** - * \def __no_inline - * \brief The function should not be inlined. - * - * This annotation instructs the compiler to ignore its inlining - * heuristics and not inline the function. - */ -#ifdef __CC_ARM -# define __no_inline __attribute__((noinline)) -#elif (defined __GNUC__) -# define __no_inline __attribute__((__noinline__)) -#elif (defined __ICCARM__) -# define __no_inline _Pragma("inline=never") -#endif - -/*! \brief This macro is used to test fatal errors. - * - * The macro tests if the expression is false. If it is, a fatal error is - * detected and the application hangs up. If TEST_SUITE_DEFINE_ASSERT_MACRO - * is defined, a unit test version of the macro is used, to allow execution - * of further tests after a false expression. - * - * \param expr Expression to evaluate and supposed to be nonzero. - */ -#ifdef _ASSERT_ENABLE_ -# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) - // Assert() is defined in unit_test/suite.h -# include "unit_test/suite.h" -# else -#undef TEST_SUITE_DEFINE_ASSERT_MACRO -# define Assert(expr) \ - {\ - if (!(expr)) while (true);\ - } -# endif -#else -# define Assert(expr) ((void) 0) -#endif - -/* Define WEAK attribute */ -#if defined ( __CC_ARM ) /* Keil µVision 4 */ -# define WEAK __attribute__ ((weak)) -#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ -# define WEAK __weak -#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ -# define WEAK __attribute__ ((weak)) -#endif - -/* Define NO_INIT attribute */ -#if 0 //ndef NO_INIT -#ifdef __CC_ARM -# define NO_INIT __attribute__((zero_init)) -#elif defined ( __ICCARM__ ) -# define NO_INIT __no_init -#elif defined ( __GNUC__ ) -# define NO_INIT __attribute__((section(".no_init"))) -#endif -#endif - -/* Define RAMFUNC attribute */ -#if defined ( __CC_ARM ) /* Keil µVision 4 */ -# define RAMFUNC __attribute__ ((section(".ramfunc"))) -#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ -# define RAMFUNC __ramfunc -#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ -# define RAMFUNC __attribute__ ((section(".ramfunc"))) -#endif - -/* Define OPTIMIZE_HIGH attribute */ -#if defined ( __CC_ARM ) /* Keil µVision 4 */ -# define OPTIMIZE_HIGH _Pragma("O3") -#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ -# define OPTIMIZE_HIGH _Pragma("optimize=high") -#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ -# define OPTIMIZE_HIGH __attribute__((optimize("s"))) -#endif - -/*! \name Usual Types - */ -//! @{ -typedef unsigned char Bool; //!< Boolean. -#ifndef __cplusplus -#ifndef __bool_true_false_are_defined -typedef unsigned char bool; //!< Boolean. -#endif -#endif -typedef int8_t S8 ; //!< 8-bit signed integer. -typedef uint8_t U8 ; //!< 8-bit unsigned integer. -typedef int16_t S16; //!< 16-bit signed integer. -typedef uint16_t U16; //!< 16-bit unsigned integer. -typedef uint16_t le16_t; -typedef uint16_t be16_t; -typedef int32_t S32; //!< 32-bit signed integer. -typedef uint32_t U32; //!< 32-bit unsigned integer. -typedef uint32_t le32_t; -typedef uint32_t be32_t; -typedef int64_t S64; //!< 64-bit signed integer. -typedef uint64_t U64; //!< 64-bit unsigned integer. -typedef float F32; //!< 32-bit floating-point number. -typedef double F64; //!< 64-bit floating-point number. -typedef uint32_t iram_size_t; -//! @} - - -/*! \name Status Types - */ -//! @{ -typedef bool Status_bool_t; //!< Boolean status. -typedef U8 Status_t; //!< 8-bit-coded status. -//! @} - - -/*! \name Aliasing Aggregate Types - */ -//! @{ - -//! 16-bit union. -typedef union -{ - S16 s16 ; - U16 u16 ; - S8 s8 [2]; - U8 u8 [2]; -} Union16; - -//! 32-bit union. -typedef union -{ - S32 s32 ; - U32 u32 ; - S16 s16[2]; - U16 u16[2]; - S8 s8 [4]; - U8 u8 [4]; -} Union32; - -//! 64-bit union. -typedef union -{ - S64 s64 ; - U64 u64 ; - S32 s32[2]; - U32 u32[2]; - S16 s16[4]; - U16 u16[4]; - S8 s8 [8]; - U8 u8 [8]; -} Union64; - -//! Union of pointers to 64-, 32-, 16- and 8-bit unsigned integers. -typedef union -{ - S64 *s64ptr; - U64 *u64ptr; - S32 *s32ptr; - U32 *u32ptr; - S16 *s16ptr; - U16 *u16ptr; - S8 *s8ptr ; - U8 *u8ptr ; -} UnionPtr; - -//! Union of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. -typedef union -{ - volatile S64 *s64ptr; - volatile U64 *u64ptr; - volatile S32 *s32ptr; - volatile U32 *u32ptr; - volatile S16 *s16ptr; - volatile U16 *u16ptr; - volatile S8 *s8ptr ; - volatile U8 *u8ptr ; -} UnionVPtr; - -//! Union of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. -typedef union -{ - const S64 *s64ptr; - const U64 *u64ptr; - const S32 *s32ptr; - const U32 *u32ptr; - const S16 *s16ptr; - const U16 *u16ptr; - const S8 *s8ptr ; - const U8 *u8ptr ; -} UnionCPtr; - -//! Union of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. -typedef union -{ - const volatile S64 *s64ptr; - const volatile U64 *u64ptr; - const volatile S32 *s32ptr; - const volatile U32 *u32ptr; - const volatile S16 *s16ptr; - const volatile U16 *u16ptr; - const volatile S8 *s8ptr ; - const volatile U8 *u8ptr ; -} UnionCVPtr; - -//! Structure of pointers to 64-, 32-, 16- and 8-bit unsigned integers. -typedef struct -{ - S64 *s64ptr; - U64 *u64ptr; - S32 *s32ptr; - U32 *u32ptr; - S16 *s16ptr; - U16 *u16ptr; - S8 *s8ptr ; - U8 *u8ptr ; -} StructPtr; - -//! Structure of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. -typedef struct -{ - volatile S64 *s64ptr; - volatile U64 *u64ptr; - volatile S32 *s32ptr; - volatile U32 *u32ptr; - volatile S16 *s16ptr; - volatile U16 *u16ptr; - volatile S8 *s8ptr ; - volatile U8 *u8ptr ; -} StructVPtr; - -//! Structure of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. -typedef struct -{ - const S64 *s64ptr; - const U64 *u64ptr; - const S32 *s32ptr; - const U32 *u32ptr; - const S16 *s16ptr; - const U16 *u16ptr; - const S8 *s8ptr ; - const U8 *u8ptr ; -} StructCPtr; - -//! Structure of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. -typedef struct -{ - const volatile S64 *s64ptr; - const volatile U64 *u64ptr; - const volatile S32 *s32ptr; - const volatile U32 *u32ptr; - const volatile S16 *s16ptr; - const volatile U16 *u16ptr; - const volatile S8 *s8ptr ; - const volatile U8 *u8ptr ; -} StructCVPtr; - -//! @} - -#endif // #ifndef __ASSEMBLY__ - -/*! \name Usual Constants - */ -//! @{ -#define DISABLE 0 -#define ENABLE 1 -#ifndef __cplusplus -#ifndef __bool_true_false_are_defined -#define false (1==0) -#define true (1==1) -#endif -#endif -#ifndef PASS -#define PASS 0 -#endif -#ifndef FAIL -#define FAIL 1 -#endif -#ifndef LOW -#define LOW 0x0 -#endif -#ifndef HIGH -#define HIGH 0x1 -#endif -//! @} - - -#ifndef __ASSEMBLY__ // not for assembling. - -//! \name Optimization Control -//@{ - -/** - * \def likely(exp) - * \brief The expression \a exp is likely to be true - */ -#ifndef likely -# define likely(exp) (exp) -#endif - -/** - * \def unlikely(exp) - * \brief The expression \a exp is unlikely to be true - */ -#ifndef unlikely -# define unlikely(exp) (exp) -#endif - -/** - * \def is_constant(exp) - * \brief Determine if an expression evaluates to a constant value. - * - * \param exp Any expression - * - * \return true if \a exp is constant, false otherwise. - */ -#if (defined __GNUC__) || (defined __CC_ARM) -# define is_constant(exp) __builtin_constant_p(exp) -#else -# define is_constant(exp) (0) -#endif - -//! @} - -/*! \name Bit-Field Handling - */ -//! @{ - -/*! \brief Reads the bits of a value specified by a given bit-mask. - * - * \param value Value to read bits from. - * \param mask Bit-mask indicating bits to read. - * - * \return Read bits. - */ -#define Rd_bits( value, mask) ((value) & (mask)) - -/*! \brief Writes the bits of a C lvalue specified by a given bit-mask. - * - * \param lvalue C lvalue to write bits to. - * \param mask Bit-mask indicating bits to write. - * \param bits Bits to write. - * - * \return Resulting value with written bits. - */ -#define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) |\ - ((bits ) & (mask))) - -/*! \brief Tests the bits of a value specified by a given bit-mask. - * - * \param value Value of which to test bits. - * \param mask Bit-mask indicating bits to test. - * - * \return \c 1 if at least one of the tested bits is set, else \c 0. - */ -#define Tst_bits( value, mask) (Rd_bits(value, mask) != 0) - -/*! \brief Clears the bits of a C lvalue specified by a given bit-mask. - * - * \param lvalue C lvalue of which to clear bits. - * \param mask Bit-mask indicating bits to clear. - * - * \return Resulting value with cleared bits. - */ -#define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) - -/*! \brief Sets the bits of a C lvalue specified by a given bit-mask. - * - * \param lvalue C lvalue of which to set bits. - * \param mask Bit-mask indicating bits to set. - * - * \return Resulting value with set bits. - */ -#define Set_bits(lvalue, mask) ((lvalue) |= (mask)) - -/*! \brief Toggles the bits of a C lvalue specified by a given bit-mask. - * - * \param lvalue C lvalue of which to toggle bits. - * \param mask Bit-mask indicating bits to toggle. - * - * \return Resulting value with toggled bits. - */ -#define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) - -/*! \brief Reads the bit-field of a value specified by a given bit-mask. - * - * \param value Value to read a bit-field from. - * \param mask Bit-mask indicating the bit-field to read. - * - * \return Read bit-field. - */ -#define Rd_bitfield( value, mask) (Rd_bits( value, mask) >> ctz(mask)) - -/*! \brief Writes the bit-field of a C lvalue specified by a given bit-mask. - * - * \param lvalue C lvalue to write a bit-field to. - * \param mask Bit-mask indicating the bit-field to write. - * \param bitfield Bit-field to write. - * - * \return Resulting value with written bit-field. - */ -#define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask))) - -//! @} - - -/*! \name Zero-Bit Counting - * - * Under GCC, __builtin_clz and __builtin_ctz behave like macros when - * applied to constant expressions (values known at compile time), so they are - * more optimized than the use of the corresponding assembly instructions and - * they can be used as constant expressions e.g. to initialize objects having - * static storage duration, and like the corresponding assembly instructions - * when applied to non-constant expressions (values unknown at compile time), so - * they are more optimized than an assembly periphrasis. Hence, clz and ctz - * ensure a possible and optimized behavior for both constant and non-constant - * expressions. - */ -//! @{ - -/*! \brief Counts the leading zero bits of the given value considered as a 32-bit integer. - * - * \param u Value of which to count the leading zero bits. - * - * \return The count of leading zero bits in \a u. - */ -#ifndef clz -#if (defined __GNUC__) || (defined __CC_ARM) -# define clz(u) ((u) ? __builtin_clz(u) : 32) -#elif (defined __ICCARM__) -# define clz(u) ((u) ? __CLZ(u) : 32) -#else -# define clz(u) (((u) == 0) ? 32 : \ - ((u) & (1ul << 31)) ? 0 : \ - ((u) & (1ul << 30)) ? 1 : \ - ((u) & (1ul << 29)) ? 2 : \ - ((u) & (1ul << 28)) ? 3 : \ - ((u) & (1ul << 27)) ? 4 : \ - ((u) & (1ul << 26)) ? 5 : \ - ((u) & (1ul << 25)) ? 6 : \ - ((u) & (1ul << 24)) ? 7 : \ - ((u) & (1ul << 23)) ? 8 : \ - ((u) & (1ul << 22)) ? 9 : \ - ((u) & (1ul << 21)) ? 10 : \ - ((u) & (1ul << 20)) ? 11 : \ - ((u) & (1ul << 19)) ? 12 : \ - ((u) & (1ul << 18)) ? 13 : \ - ((u) & (1ul << 17)) ? 14 : \ - ((u) & (1ul << 16)) ? 15 : \ - ((u) & (1ul << 15)) ? 16 : \ - ((u) & (1ul << 14)) ? 17 : \ - ((u) & (1ul << 13)) ? 18 : \ - ((u) & (1ul << 12)) ? 19 : \ - ((u) & (1ul << 11)) ? 20 : \ - ((u) & (1ul << 10)) ? 21 : \ - ((u) & (1ul << 9)) ? 22 : \ - ((u) & (1ul << 8)) ? 23 : \ - ((u) & (1ul << 7)) ? 24 : \ - ((u) & (1ul << 6)) ? 25 : \ - ((u) & (1ul << 5)) ? 26 : \ - ((u) & (1ul << 4)) ? 27 : \ - ((u) & (1ul << 3)) ? 28 : \ - ((u) & (1ul << 2)) ? 29 : \ - ((u) & (1ul << 1)) ? 30 : \ - 31) -#endif -#endif - -/*! \brief Counts the trailing zero bits of the given value considered as a 32-bit integer. - * - * \param u Value of which to count the trailing zero bits. - * - * \return The count of trailing zero bits in \a u. - */ -#ifndef ctz -#if (defined __GNUC__) || (defined __CC_ARM) -# define ctz(u) ((u) ? __builtin_ctz(u) : 32) -#else -# define ctz(u) ((u) & (1ul << 0) ? 0 : \ - (u) & (1ul << 1) ? 1 : \ - (u) & (1ul << 2) ? 2 : \ - (u) & (1ul << 3) ? 3 : \ - (u) & (1ul << 4) ? 4 : \ - (u) & (1ul << 5) ? 5 : \ - (u) & (1ul << 6) ? 6 : \ - (u) & (1ul << 7) ? 7 : \ - (u) & (1ul << 8) ? 8 : \ - (u) & (1ul << 9) ? 9 : \ - (u) & (1ul << 10) ? 10 : \ - (u) & (1ul << 11) ? 11 : \ - (u) & (1ul << 12) ? 12 : \ - (u) & (1ul << 13) ? 13 : \ - (u) & (1ul << 14) ? 14 : \ - (u) & (1ul << 15) ? 15 : \ - (u) & (1ul << 16) ? 16 : \ - (u) & (1ul << 17) ? 17 : \ - (u) & (1ul << 18) ? 18 : \ - (u) & (1ul << 19) ? 19 : \ - (u) & (1ul << 20) ? 20 : \ - (u) & (1ul << 21) ? 21 : \ - (u) & (1ul << 22) ? 22 : \ - (u) & (1ul << 23) ? 23 : \ - (u) & (1ul << 24) ? 24 : \ - (u) & (1ul << 25) ? 25 : \ - (u) & (1ul << 26) ? 26 : \ - (u) & (1ul << 27) ? 27 : \ - (u) & (1ul << 28) ? 28 : \ - (u) & (1ul << 29) ? 29 : \ - (u) & (1ul << 30) ? 30 : \ - (u) & (1ul << 31) ? 31 : \ - 32) -#endif -#endif - -//! @} - - -/*! \name Bit Reversing - */ -//! @{ - -/*! \brief Reverses the bits of \a u8. - * - * \param u8 U8 of which to reverse the bits. - * - * \return Value resulting from \a u8 with reversed bits. - */ -#define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) - -/*! \brief Reverses the bits of \a u16. - * - * \param u16 U16 of which to reverse the bits. - * - * \return Value resulting from \a u16 with reversed bits. - */ -#define bit_reverse16(u16) ((U16)(bit_reverse32((U16)(u16)) >> 16)) - -/*! \brief Reverses the bits of \a u32. - * - * \param u32 U32 of which to reverse the bits. - * - * \return Value resulting from \a u32 with reversed bits. - */ -#define bit_reverse32(u32) __RBIT(u32) - -/*! \brief Reverses the bits of \a u64. - * - * \param u64 U64 of which to reverse the bits. - * - * \return Value resulting from \a u64 with reversed bits. - */ -#define bit_reverse64(u64) ((U64)(((U64)bit_reverse32((U64)(u64) >> 32)) |\ - ((U64)bit_reverse32((U64)(u64)) << 32))) - -//! @} - - -/*! \name Alignment - */ -//! @{ - -/*! \brief Tests alignment of the number \a val with the \a n boundary. - * - * \param val Input value. - * \param n Boundary. - * - * \return \c 1 if the number \a val is aligned with the \a n boundary, else \c 0. - */ -#define Test_align(val, n ) (!Tst_bits( val, (n) - 1 ) ) - -/*! \brief Gets alignment of the number \a val with respect to the \a n boundary. - * - * \param val Input value. - * \param n Boundary. - * - * \return Alignment of the number \a val with respect to the \a n boundary. - */ -#define Get_align( val, n ) ( Rd_bits( val, (n) - 1 ) ) - -/*! \brief Sets alignment of the lvalue number \a lval to \a alg with respect to the \a n boundary. - * - * \param lval Input/output lvalue. - * \param n Boundary. - * \param alg Alignment. - * - * \return New value of \a lval resulting from its alignment set to \a alg with respect to the \a n boundary. - */ -#define Set_align(lval, n, alg) ( Wr_bits(lval, (n) - 1, alg) ) - -/*! \brief Aligns the number \a val with the upper \a n boundary. - * - * \param val Input value. - * \param n Boundary. - * - * \return Value resulting from the number \a val aligned with the upper \a n boundary. - */ -#define Align_up( val, n ) (((val) + ((n) - 1)) & ~((n) - 1)) - -/*! \brief Aligns the number \a val with the lower \a n boundary. - * - * \param val Input value. - * \param n Boundary. - * - * \return Value resulting from the number \a val aligned with the lower \a n boundary. - */ -#define Align_down(val, n ) ( (val) & ~((n) - 1)) - -//! @} - -/*! \brief Calls the routine at address \a addr. - * - * It generates a long call opcode. - * - * For example, `Long_call(0x80000000)' generates a software reset on a UC3 if - * it is invoked from the CPU supervisor mode. - * - * \param addr Address of the routine to call. - * - * \note It may be used as a long jump opcode in some special cases. - */ -#define Long_call(addr) ((*(void (*)(void))(addr))()) - - -/*! \name MCU Endianism Handling - * ARM is MCU little endianism. - */ -//! @{ -#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. -#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. - -#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. -#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. -#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. -#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. -#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. -#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. -#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. -#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. -#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. -#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. - -#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. -#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. -#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. -#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. -#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. -#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. -#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. -#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. -#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. -#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. -#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. -#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. -#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. -#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. -#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. -#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. -#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. -#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. -#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. -#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. -#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. -#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. -#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. -#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. -#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. -#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. - -#define BE16(x) swap16(x) -#define LE16(x) (x) - -#define le16_to_cpu(x) (x) -#define cpu_to_le16(x) (x) -#define LE16_TO_CPU(x) (x) -#define CPU_TO_LE16(x) (x) - -#define be16_to_cpu(x) swap16(x) -#define cpu_to_be16(x) swap16(x) -#define BE16_TO_CPU(x) swap16(x) -#define CPU_TO_BE16(x) swap16(x) - -#define le32_to_cpu(x) (x) -#define cpu_to_le32(x) (x) -#define LE32_TO_CPU(x) (x) -#define CPU_TO_LE32(x) (x) - -#define be32_to_cpu(x) swap32(x) -#define cpu_to_be32(x) swap32(x) -#define BE32_TO_CPU(x) swap32(x) -#define CPU_TO_BE32(x) swap32(x) -//! @} - - -/*! \name Endianism Conversion - * - * The same considerations as for clz and ctz apply here but GCC's - * __builtin_bswap_32 and __builtin_bswap_64 do not behave like macros when - * applied to constant expressions, so two sets of macros are defined here: - * - Swap16, Swap32 and Swap64 to apply to constant expressions (values known - * at compile time); - * - swap16, swap32 and swap64 to apply to non-constant expressions (values - * unknown at compile time). - */ -//! @{ - -/*! \brief Toggles the endianism of \a u16 (by swapping its bytes). - * - * \param u16 U16 of which to toggle the endianism. - * - * \return Value resulting from \a u16 with toggled endianism. - * - * \note More optimized if only used with values known at compile time. - */ -#define Swap16(u16) ((U16)(((U16)(u16) >> 8) |\ - ((U16)(u16) << 8))) - -/*! \brief Toggles the endianism of \a u32 (by swapping its bytes). - * - * \param u32 U32 of which to toggle the endianism. - * - * \return Value resulting from \a u32 with toggled endianism. - * - * \note More optimized if only used with values known at compile time. - */ -#define Swap32(u32) ((U32)(((U32)Swap16((U32)(u32) >> 16)) |\ - ((U32)Swap16((U32)(u32)) << 16))) - -/*! \brief Toggles the endianism of \a u64 (by swapping its bytes). - * - * \param u64 U64 of which to toggle the endianism. - * - * \return Value resulting from \a u64 with toggled endianism. - * - * \note More optimized if only used with values known at compile time. - */ -#define Swap64(u64) ((U64)(((U64)Swap32((U64)(u64) >> 32)) |\ - ((U64)Swap32((U64)(u64)) << 32))) - -/*! \brief Toggles the endianism of \a u16 (by swapping its bytes). - * - * \param u16 U16 of which to toggle the endianism. - * - * \return Value resulting from \a u16 with toggled endianism. - * - * \note More optimized if only used with values unknown at compile time. - */ -#define swap16(u16) Swap16(u16) - -/*! \brief Toggles the endianism of \a u32 (by swapping its bytes). - * - * \param u32 U32 of which to toggle the endianism. - * - * \return Value resulting from \a u32 with toggled endianism. - * - * \note More optimized if only used with values unknown at compile time. - */ -#if (defined __GNUC__) -# define swap32(u32) ((U32)__builtin_bswap32((U32)(u32))) -#else -# define swap32(u32) Swap32(u32) -#endif - -/*! \brief Toggles the endianism of \a u64 (by swapping its bytes). - * - * \param u64 U64 of which to toggle the endianism. - * - * \return Value resulting from \a u64 with toggled endianism. - * - * \note More optimized if only used with values unknown at compile time. - */ -#if (defined __GNUC__) -# define swap64(u64) ((U64)__builtin_bswap64((U64)(u64))) -#else -# define swap64(u64) ((U64)(((U64)swap32((U64)(u64) >> 32)) |\ - ((U64)swap32((U64)(u64)) << 32))) -#endif - -//! @} - - -/*! \name Target Abstraction - */ -//! @{ - -#define _GLOBEXT_ extern //!< extern storage-class specifier. -#define _CONST_TYPE_ const //!< const type qualifier. -#define _MEM_TYPE_SLOW_ //!< Slow memory type. -#define _MEM_TYPE_MEDFAST_ //!< Fairly fast memory type. -#define _MEM_TYPE_FAST_ //!< Fast memory type. - -typedef U8 Byte; //!< 8-bit unsigned integer. - -#define memcmp_ram2ram memcmp //!< Target-specific memcmp of RAM to RAM. -#define memcmp_code2ram memcmp //!< Target-specific memcmp of RAM to NVRAM. -#define memcpy_ram2ram memcpy //!< Target-specific memcpy from RAM to RAM. -#define memcpy_code2ram memcpy //!< Target-specific memcpy from NVRAM to RAM. - -#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. -#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. -#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. -#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. -#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. -#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. -#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. -#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. - -//! @} - -/** - * \brief Calculate \f$ \left\lceil \frac{a}{b} \right\rceil \f$ using - * integer arithmetic. - * - * \param a An integer - * \param b Another integer - * - * \return (\a a / \a b) rounded up to the nearest integer. - */ -#define div_ceil(a, b) (((a) + (b) - 1) / (b)) - -#endif // #ifndef __ASSEMBLY__ - - -#ifdef __ICCARM__ -#define SHORTENUM __packed -#elif defined(__GNUC__) -#define SHORTENUM __attribute__((packed)) -#endif - -/* No operation */ -#ifdef __ICCARM__ -#define nop() __no_operation() -#elif defined(__GNUC__) -#define nop() (__NOP()) -#endif - -#define FLASH_DECLARE(x) const x -#define FLASH_EXTERN(x) extern const x -#define PGM_READ_BYTE(x) *(x) -#define PGM_READ_WORD(x) *(x) -#define PGM_READ_DWORD(x) *(x) -#define MEMCPY_ENDIAN memcpy -#define PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) - -/*Defines the Flash Storage for the request and response of MAC*/ -#define CMD_ID_OCTET (0) - -/* Converting of values from CPU endian to little endian. */ -#define CPU_ENDIAN_TO_LE16(x) (x) -#define CPU_ENDIAN_TO_LE32(x) (x) -#define CPU_ENDIAN_TO_LE64(x) (x) - -/* Converting of values from little endian to CPU endian. */ -#define LE16_TO_CPU_ENDIAN(x) (x) -#define LE32_TO_CPU_ENDIAN(x) (x) -#define LE64_TO_CPU_ENDIAN(x) (x) - -/* Converting of constants from little endian to CPU endian. */ -#define CLE16_TO_CPU_ENDIAN(x) (x) -#define CLE32_TO_CPU_ENDIAN(x) (x) -#define CLE64_TO_CPU_ENDIAN(x) (x) - -/* Converting of constants from CPU endian to little endian. */ -#define CCPU_ENDIAN_TO_LE16(x) (x) -#define CCPU_ENDIAN_TO_LE32(x) (x) -#define CCPU_ENDIAN_TO_LE64(x) (x) - -#define ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) -#define ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) - -/** - * @brief Converts a 64-Bit value into a 8 Byte array - * - * @param[in] value 64-Bit value - * @param[out] data Pointer to the 8 Byte array to be updated with 64-Bit value - * @ingroup apiPalApi - */ -static inline void convert_64_bit_to_byte_array(uint64_t value, uint8_t *data) -{ - uint8_t val_index = 0; - - while (val_index < 8) - { - data[val_index++] = value & 0xFF; - value = value >> 8; - } -} - -/** - * @brief Converts a 16-Bit value into a 2 Byte array - * - * @param[in] value 16-Bit value - * @param[out] data Pointer to the 2 Byte array to be updated with 16-Bit value - * @ingroup apiPalApi - */ -static inline void convert_16_bit_to_byte_array(uint16_t value, uint8_t *data) -{ - data[0] = value & 0xFF; - data[1] = (value >> 8) & 0xFF; -} - -/* Converts a 16-Bit value into a 2 Byte array */ -static inline void convert_spec_16_bit_to_byte_array(uint16_t value, uint8_t *data) -{ - data[0] = value & 0xFF; - data[1] = (value >> 8) & 0xFF; -} - -/* Converts a 16-Bit value into a 2 Byte array */ -static inline void convert_16_bit_to_byte_address(uint16_t value, uint8_t *data) -{ - data[0] = value & 0xFF; - data[1] = (value >> 8) & 0xFF; -} - -/* - * @brief Converts a 2 Byte array into a 16-Bit value - * - * @param data Specifies the pointer to the 2 Byte array - * - * @return 16-Bit value - * @ingroup apiPalApi - */ -static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) -{ - return (data[0] | ((uint16_t)data[1] << 8)); -} - -/* Converts a 8 Byte array into a 32-Bit value */ -static inline uint32_t convert_byte_array_to_32_bit(uint8_t *data) -{ - union - { - uint32_t u32; - uint8_t u8[8]; - }long_addr; - uint8_t index; - for (index = 0; index < 4; index++) - { - long_addr.u8[index] = *data++; - } - return long_addr.u32; -} - -/** - * @brief Converts a 8 Byte array into a 64-Bit value - * - * @param data Specifies the pointer to the 8 Byte array - * - * @return 64-Bit value - * @ingroup apiPalApi - */ -static inline uint64_t convert_byte_array_to_64_bit(uint8_t *data) -{ - union - { - uint64_t u64; - uint8_t u8[8]; - } long_addr; - - uint8_t val_index; - - for (val_index = 0; val_index < 8; val_index++) - { - long_addr.u8[val_index] = *data++; - } - - return long_addr.u64; -} -/** - * \} - */ - -#endif /* UTILS_COMPILER_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_access.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_access.h deleted file mode 100644 index fdac1ab7e8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_access.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * \file - * - * \brief Memory access control configuration file. - * - * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _CONF_ACCESS_H_ -#define _CONF_ACCESS_H_ - -#include "compiler.h" -#include "../../../inc/MarlinConfigPre.h" - -/*! \name Activation of Logical Unit Numbers - */ -//! @{ - -#define LUN_0 ENABLE //!< SD/MMC Card over MCI Slot 0. -#define LUN_1 DISABLE -#define LUN_2 DISABLE -#define LUN_3 DISABLE -#define LUN_4 DISABLE -#define LUN_5 DISABLE -#define LUN_6 DISABLE -#define LUN_7 DISABLE -#define LUN_USB DISABLE -//! @} - -/*! \name LUN 0 Definitions - */ -//! @{ -#define SD_MMC_SPI_MEM LUN_0 -#define LUN_ID_SD_MMC_SPI_MEM LUN_ID_0 -#define LUN_0_INCLUDE "sd_mmc_spi_mem.h" -#define Lun_0_test_unit_ready sd_mmc_spi_test_unit_ready -#define Lun_0_read_capacity sd_mmc_spi_read_capacity -#define Lun_0_unload sd_mmc_spi_unload -#define Lun_0_wr_protect sd_mmc_spi_wr_protect -#define Lun_0_removal sd_mmc_spi_removal -#define Lun_0_usb_read_10 sd_mmc_spi_usb_read_10 -#define Lun_0_usb_write_10 sd_mmc_spi_usb_write_10 -#define LUN_0_NAME "\"SD/MMC Card\"" -//! @} - - -/*! \name Actions Associated with Memory Accesses - * - * Write here the action to associate with each memory access. - * - * \warning Be careful not to waste time in order not to disturb the functions. - */ -//! @{ -#define memory_start_read_action(nb_sectors) -#define memory_stop_read_action() -#define memory_start_write_action(nb_sectors) -#define memory_stop_write_action() -//! @} - -/*! \name Activation of Interface Features - */ -//! @{ -#define ACCESS_USB true //!< MEM <-> USB interface. -#define ACCESS_MEM_TO_RAM false //!< MEM <-> RAM interface. -#define ACCESS_STREAM false //!< Streaming MEM <-> MEM interface. -#define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode. -#define ACCESS_MEM_TO_MEM false //!< MEM <-> MEM interface. -#define ACCESS_CODEC false //!< Codec interface. -//! @} - -/*! \name Specific Options for Access Control - */ -//! @{ -#define GLOBAL_WR_PROTECT false //!< Management of a global write protection. -//! @} - - -#endif // _CONF_ACCESS_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h deleted file mode 100644 index d0f68500ad..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * \file - * - * \brief SAM3X clock configuration. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CONF_CLOCK_H_INCLUDED -#define CONF_CLOCK_H_INCLUDED - -// ===== System Clock (MCK) Source Options -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_RC -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_XTAL -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_BYPASS -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_4M_RC -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_8M_RC -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_12M_RC -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_XTAL -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_BYPASS -#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK -//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_UPLLCK - -// ===== System Clock (MCK) Prescaler Options (Fmck = Fsys / (SYSCLK_PRES)) -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_1 -#define CONFIG_SYSCLK_PRES SYSCLK_PRES_2 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_4 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_8 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_16 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_32 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_64 -//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_3 - -// ===== PLL0 (A) Options (Fpll = (Fclk * PLL_mul) / PLL_div) -// Use mul and div effective values here. -#define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_XTAL -#define CONFIG_PLL0_MUL 14 -#define CONFIG_PLL0_DIV 1 - -// ===== UPLL (UTMI) Hardware fixed at 480MHz. - -// ===== USB Clock Source Options (Fusb = FpllX / USB_div) -// Use div effective value here. -//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL0 -#define CONFIG_USBCLK_SOURCE USBCLK_SRC_UPLL -#define CONFIG_USBCLK_DIV 1 - -// ===== Target frequency (System clock) -// - XTAL frequency: 12MHz -// - System clock source: PLLA -// - System clock prescaler: 2 (divided by 2) -// - PLLA source: XTAL -// - PLLA output: XTAL * 14 / 1 -// - System clock is: 12 * 14 / 1 /2 = 84MHz -// ===== Target frequency (USB Clock) -// - USB clock source: UPLL -// - USB clock divider: 1 (not divided) -// - UPLL frequency: 480MHz -// - USB clock: 480 / 1 = 480MHz - - -#endif /* CONF_CLOCK_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h deleted file mode 100644 index 8d5924d375..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h +++ /dev/null @@ -1,300 +0,0 @@ -/** - * \file - * - * \brief USB configuration file - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _CONF_USB_H_ -#define _CONF_USB_H_ - -#undef UNUSED /* To avoid a macro clash as macros.h already defines it */ -#include "../../../inc/MarlinConfigPre.h" -#include "compiler.h" - -/** - * USB Device Configuration - * @{ - */ - -//! Device definition (mandatory) -#define USB_DEVICE_MAJOR_VERSION 1 -#define USB_DEVICE_MINOR_VERSION 0 -#define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA) -#define USB_DEVICE_ATTR \ - (USB_CONFIG_ATTR_SELF_POWERED) -// (USB_CONFIG_ATTR_BUS_POWERED) -// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) -// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) - -/** - * Device speeds support - * Low speed not supported by CDC and MSC - * @{ - */ - -//! To define a Low speed device -//#define USB_DEVICE_LOW_SPEED - -//! To define a Full speed device -//#define USB_DEVICE_FULL_SPEED - -#if MB(ARCHIM1) - #define USB_DEVICE_FULL_SPEED -#endif - -//! To authorize the High speed -#ifndef USB_DEVICE_FULL_SPEED - #if (UC3A3||UC3A4) - #define USB_DEVICE_HS_SUPPORT - #elif (SAM3XA||SAM3U) - #define USB_DEVICE_HS_SUPPORT - #endif -#endif -//@} - - -/** - * USB Device Callbacks definitions (Optional) - * @{ - */ -#define UDC_VBUS_EVENT(b_vbus_high) -#define UDC_SOF_EVENT() -#define UDC_SUSPEND_EVENT() -#define UDC_RESUME_EVENT() -#define UDC_GET_EXTRA_STRING() usb_task_extra_string() -#define USB_DEVICE_SPECIFIC_REQUEST() usb_task_other_requests() -//@} - -#if ENABLED(SDSUPPORT) - /** - * USB Device low level configuration - * When only one interface is used, these configurations are defined by the class module. - * For composite device, these configuration must be defined here - * @{ - */ - //! Control endpoint size - #define USB_DEVICE_EP_CTRL_SIZE 64 - - //! Two interfaces for this device (CDC COM + CDC DATA + MSC) - #define USB_DEVICE_NB_INTERFACE 3 - - //! 5 endpoints used by CDC and MSC interfaces - #if SAM3U - // (3 | USB_EP_DIR_IN) // CDC Notify endpoint - // (6 | USB_EP_DIR_IN) // CDC TX - // (5 | USB_EP_DIR_OUT) // CDC RX - // (1 | USB_EP_DIR_IN) // MSC IN - // (2 | USB_EP_DIR_OUT) // MSC OUT - # define USB_DEVICE_MAX_EP 6 - # if defined(USB_DEVICE_HS_SUPPORT) - // In HS mode, size of bulk endpoints are 512 - // If CDC and MSC endpoints all uses 2 banks, DPRAM is not enough: 4 bulk - // endpoints requires 4K bytes. So reduce the number of banks of CDC bulk - // endpoints to use less DPRAM. Keep MSC setting to keep MSC performance. - # define UDD_BULK_NB_BANK(ep) ((ep == 5 || ep== 6) ? 1 : 2) - #endif - #else - // (3 | USB_EP_DIR_IN) // CDC Notify endpoint - // (4 | USB_EP_DIR_IN) // CDC TX - // (5 | USB_EP_DIR_OUT) // CDC RX - // (1 | USB_EP_DIR_IN) // MSC IN - // (2 | USB_EP_DIR_OUT) // MSC OUT - # define USB_DEVICE_MAX_EP 5 - # if SAM3XA && defined(USB_DEVICE_HS_SUPPORT) - // In HS mode, size of bulk endpoints are 512 - // If CDC and MSC endpoints all uses 2 banks, DPRAM is not enough: 4 bulk - // endpoints requires 4K bytes. So reduce the number of banks of CDC bulk - // endpoints to use less DPRAM. Keep MSC setting to keep MSC performance. - # define UDD_BULK_NB_BANK(ep) ((ep == 4 || ep== 5) ? 1 : 2) - # endif - #endif -#endif - -//@} - -//@} - - -/** - * USB Interface Configuration - * @{ - */ -/** - * Configuration of CDC interface - * @{ - */ - -//! Define one USB communication ports -#define UDI_CDC_PORT_NB 1 - -//! Interface callback definition -#define UDI_CDC_ENABLE_EXT(port) usb_task_cdc_enable(port) -#define UDI_CDC_DISABLE_EXT(port) usb_task_cdc_disable(port) -#define UDI_CDC_RX_NOTIFY(port) usb_task_cdc_rx_notify(port) -#define UDI_CDC_TX_EMPTY_NOTIFY(port) -#define UDI_CDC_SET_CODING_EXT(port,cfg) usb_task_cdc_config(port,cfg) -#define UDI_CDC_SET_DTR_EXT(port,set) usb_task_cdc_set_dtr(port,set) -#define UDI_CDC_SET_RTS_EXT(port,set) - -//! Define it when the transfer CDC Device to Host is a low rate (<512000 bauds) -//! to reduce CDC buffers size -//#define UDI_CDC_LOW_RATE - -//! Default configuration of communication port -#define UDI_CDC_DEFAULT_RATE 115200 -#define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 -#define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE -#define UDI_CDC_DEFAULT_DATABITS 8 - -//! Enable id string of interface to add an extra USB string -#define UDI_CDC_IAD_STRING_ID 4 - -#if ENABLED(SDSUPPORT) - /** - * USB CDC low level configuration - * In standalone these configurations are defined by the CDC module. - * For composite device, these configuration must be defined here - * @{ - */ - //! Endpoint numbers definition - #if SAM3U - # define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint - # define UDI_CDC_DATA_EP_IN_0 (6 | USB_EP_DIR_IN) // TX - # define UDI_CDC_DATA_EP_OUT_0 (5 | USB_EP_DIR_OUT)// RX - #else - # define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint - # define UDI_CDC_DATA_EP_IN_0 (4 | USB_EP_DIR_IN) // TX - # define UDI_CDC_DATA_EP_OUT_0 (5 | USB_EP_DIR_OUT)// RX - #endif - - //! Interface numbers - #define UDI_CDC_COMM_IFACE_NUMBER_0 0 - #define UDI_CDC_DATA_IFACE_NUMBER_0 1 - - //@} - //@} - - - /** - * Configuration of MSC interface - * @{ - */ - //! Vendor name and Product version of MSC interface - #define UDI_MSC_GLOBAL_VENDOR_ID \ - 'M', 'A', 'R', 'L', 'I', 'N', '3', 'D' - #define UDI_MSC_GLOBAL_PRODUCT_VERSION \ - '1', '.', '0', '0' - - //! Interface callback definition - #define UDI_MSC_ENABLE_EXT() usb_task_msc_enable() - #define UDI_MSC_DISABLE_EXT() usb_task_msc_disable() - - //! Enable id string of interface to add an extra USB string - #define UDI_MSC_STRING_ID 5 - - /** - * USB MSC low level configuration - * In standalone these configurations are defined by the MSC module. - * For composite device, these configuration must be defined here - * @{ - */ - //! Endpoint numbers definition - #define UDI_MSC_EP_IN (1 | USB_EP_DIR_IN) - #define UDI_MSC_EP_OUT (2 | USB_EP_DIR_OUT) - - //! Interface number - #define UDI_MSC_IFACE_NUMBER 2 - //@} - //@} - - //@} - - - /** - * Description of Composite Device - * @{ - */ - //! USB Interfaces descriptor structure - #define UDI_COMPOSITE_DESC_T \ - usb_iad_desc_t udi_cdc_iad; \ - udi_cdc_comm_desc_t udi_cdc_comm; \ - udi_cdc_data_desc_t udi_cdc_data; \ - udi_msc_desc_t udi_msc - - //! USB Interfaces descriptor value for Full Speed - #define UDI_COMPOSITE_DESC_FS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_FS, \ - .udi_msc = UDI_MSC_DESC_FS - - //! USB Interfaces descriptor value for High Speed - #define UDI_COMPOSITE_DESC_HS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_HS, \ - .udi_msc = UDI_MSC_DESC_HS - - //! USB Interface APIs - #define UDI_COMPOSITE_API \ - &udi_api_cdc_comm, \ - &udi_api_cdc_data, \ - &udi_api_msc - //@} - - /** - * USB Device Driver Configuration - * @{ - */ - //@} - - //! The includes of classes and other headers must be done at the end of this file to avoid compile error - #include "udi_cdc.h" - #include "udi_msc.h" -#else - #include "udi_cdc_conf.h" -#endif - -#include "usb_task.h" - -#endif // _CONF_USB_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c deleted file mode 100644 index 0ec14e0b8f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c +++ /dev/null @@ -1,647 +0,0 @@ -/***************************************************************************** - * - * \file - * - * \brief Abstraction layer for memory interfaces. - * - * This module contains the interfaces: - * - MEM <-> USB; - * - MEM <-> RAM; - * - MEM <-> MEM. - * - * This module may be configured and expanded to support the following features: - * - write-protected globals; - * - password-protected data; - * - specific features; - * - etc. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - ******************************************************************************/ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -//_____ I N C L U D E S ____________________________________________________ - -#include "compiler.h" -#include "preprocessor.h" -#ifdef FREERTOS_USED -#include "FreeRTOS.h" -#include "semphr.h" -#endif -#include "ctrl_access.h" - - -//_____ D E F I N I T I O N S ______________________________________________ - -#ifdef FREERTOS_USED - -/*! \name LUN Access Protection Macros - */ -//! @{ - -/*! \brief Locks accesses to LUNs. - * - * \return \c true if the access was successfully locked, else \c false. - */ -#define Ctrl_access_lock() ctrl_access_lock() - -/*! \brief Unlocks accesses to LUNs. - */ -#define Ctrl_access_unlock() xSemaphoreGive(ctrl_access_semphr) - -//! @} - -//! Handle to the semaphore protecting accesses to LUNs. -static xSemaphoreHandle ctrl_access_semphr = NULL; - -#else - -/*! \name LUN Access Protection Macros - */ -//! @{ - -/*! \brief Locks accesses to LUNs. - * - * \return \c true if the access was successfully locked, else \c false. - */ -#define Ctrl_access_lock() true - -/*! \brief Unlocks accesses to LUNs. - */ -#define Ctrl_access_unlock() - -//! @} - -#endif // FREERTOS_USED - - -#if MAX_LUN - -/*! \brief Initializes an entry of the LUN descriptor table. - * - * \param lun Logical Unit Number. - * - * \return LUN descriptor table entry initializer. - */ -#if ACCESS_USB == true && ACCESS_MEM_TO_RAM == true -#define Lun_desc_entry(lun) \ - {\ - TPASTE3(Lun_, lun, _test_unit_ready),\ - TPASTE3(Lun_, lun, _read_capacity),\ - TPASTE3(Lun_, lun, _unload),\ - TPASTE3(Lun_, lun, _wr_protect),\ - TPASTE3(Lun_, lun, _removal),\ - TPASTE3(Lun_, lun, _usb_read_10),\ - TPASTE3(Lun_, lun, _usb_write_10),\ - TPASTE3(Lun_, lun, _mem_2_ram),\ - TPASTE3(Lun_, lun, _ram_2_mem),\ - TPASTE3(LUN_, lun, _NAME)\ - } -#elif ACCESS_USB == true -#define Lun_desc_entry(lun) \ - {\ - TPASTE3(Lun_, lun, _test_unit_ready),\ - TPASTE3(Lun_, lun, _read_capacity),\ - TPASTE3(Lun_, lun, _unload),\ - TPASTE3(Lun_, lun, _wr_protect),\ - TPASTE3(Lun_, lun, _removal),\ - TPASTE3(Lun_, lun, _usb_read_10),\ - TPASTE3(Lun_, lun, _usb_write_10),\ - TPASTE3(LUN_, lun, _NAME)\ - } -#elif ACCESS_MEM_TO_RAM == true -#define Lun_desc_entry(lun) \ - {\ - TPASTE3(Lun_, lun, _test_unit_ready),\ - TPASTE3(Lun_, lun, _read_capacity),\ - TPASTE3(Lun_, lun, _unload),\ - TPASTE3(Lun_, lun, _wr_protect),\ - TPASTE3(Lun_, lun, _removal),\ - TPASTE3(Lun_, lun, _mem_2_ram),\ - TPASTE3(Lun_, lun, _ram_2_mem),\ - TPASTE3(LUN_, lun, _NAME)\ - } -#else -#define Lun_desc_entry(lun) \ - {\ - TPASTE3(Lun_, lun, _test_unit_ready),\ - TPASTE3(Lun_, lun, _read_capacity),\ - TPASTE3(Lun_, lun, _unload),\ - TPASTE3(Lun_, lun, _wr_protect),\ - TPASTE3(Lun_, lun, _removal),\ - TPASTE3(LUN_, lun, _NAME)\ - } -#endif - -//! LUN descriptor table. -static const struct -{ - Ctrl_status (*test_unit_ready)(void); - Ctrl_status (*read_capacity)(U32 *); - bool (*unload)(bool); - bool (*wr_protect)(void); - bool (*removal)(void); -#if ACCESS_USB == true - Ctrl_status (*usb_read_10)(U32, U16); - Ctrl_status (*usb_write_10)(U32, U16); -#endif -#if ACCESS_MEM_TO_RAM == true - Ctrl_status (*mem_2_ram)(U32, void *); - Ctrl_status (*ram_2_mem)(U32, const void *); -#endif - const char *name; -} lun_desc[MAX_LUN] = -{ -#if LUN_0 == ENABLE -# ifndef Lun_0_unload -# define Lun_0_unload NULL -# endif - Lun_desc_entry(0), -#endif -#if LUN_1 == ENABLE -# ifndef Lun_1_unload -# define Lun_1_unload NULL -# endif - Lun_desc_entry(1), -#endif -#if LUN_2 == ENABLE -# ifndef Lun_2_unload -# define Lun_2_unload NULL -# endif - Lun_desc_entry(2), -#endif -#if LUN_3 == ENABLE -# ifndef Lun_3_unload -# define Lun_3_unload NULL -# endif - Lun_desc_entry(3), -#endif -#if LUN_4 == ENABLE -# ifndef Lun_4_unload -# define Lun_4_unload NULL -# endif - Lun_desc_entry(4), -#endif -#if LUN_5 == ENABLE -# ifndef Lun_5_unload -# define Lun_5_unload NULL -# endif - Lun_desc_entry(5), -#endif -#if LUN_6 == ENABLE -# ifndef Lun_6_unload -# define Lun_6_unload NULL -# endif - Lun_desc_entry(6), -#endif -#if LUN_7 == ENABLE -# ifndef Lun_7_unload -# define Lun_7_unload NULL -# endif - Lun_desc_entry(7) -#endif -}; - -#endif - - -#if GLOBAL_WR_PROTECT == true -bool g_wr_protect; -#endif - - -/*! \name Control Interface - */ -//! @{ - - -#ifdef FREERTOS_USED - -bool ctrl_access_init(void) -{ - // If the handle to the protecting semaphore is not valid, - if (!ctrl_access_semphr) - { - // try to create the semaphore. - vSemaphoreCreateBinary(ctrl_access_semphr); - - // If the semaphore could not be created, there is no backup solution. - if (!ctrl_access_semphr) return false; - } - - return true; -} - - -/*! \brief Locks accesses to LUNs. - * - * \return \c true if the access was successfully locked, else \c false. - */ -static bool ctrl_access_lock(void) -{ - // If the semaphore could not be created, there is no backup solution. - if (!ctrl_access_semphr) return false; - - // Wait for the semaphore. - while (!xSemaphoreTake(ctrl_access_semphr, portMAX_DELAY)); - - return true; -} - -#endif // FREERTOS_USED - - -U8 get_nb_lun(void) -{ -#if MEM_USB == ENABLE -# ifndef Lun_usb_get_lun -# define Lun_usb_get_lun() host_get_lun() -# endif - U8 nb_lun; - - if (!Ctrl_access_lock()) return MAX_LUN; - - nb_lun = MAX_LUN + Lun_usb_get_lun(); - - Ctrl_access_unlock(); - - return nb_lun; -#else - return MAX_LUN; -#endif -} - - -U8 get_cur_lun(void) -{ - return LUN_ID_0; -} - - -Ctrl_status mem_test_unit_ready(U8 lun) -{ - Ctrl_status status; - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].test_unit_ready() : -#endif -#if LUN_USB == ENABLE - Lun_usb_test_unit_ready(lun - LUN_ID_USB); -#else - CTRL_FAIL; -#endif - - Ctrl_access_unlock(); - - return status; -} - - -Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector) -{ - Ctrl_status status; - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].read_capacity(u32_nb_sector) : -#endif -#if LUN_USB == ENABLE - Lun_usb_read_capacity(lun - LUN_ID_USB, u32_nb_sector); -#else - CTRL_FAIL; -#endif - - Ctrl_access_unlock(); - - return status; -} - - -U8 mem_sector_size(U8 lun) -{ - U8 sector_size; - - if (!Ctrl_access_lock()) return 0; - - sector_size = -#if MAX_LUN - (lun < MAX_LUN) ? 1 : -#endif -#if LUN_USB == ENABLE - Lun_usb_read_sector_size(lun - LUN_ID_USB); -#else - 0; -#endif - - Ctrl_access_unlock(); - - return sector_size; -} - - -bool mem_unload(U8 lun, bool unload) -{ - bool unloaded; -#if !MAX_LUN || !defined(Lun_usb_unload) - UNUSED(lun); -#endif - - if (!Ctrl_access_lock()) return false; - - unloaded = -#if MAX_LUN - (lun < MAX_LUN) ? - (lun_desc[lun].unload ? - lun_desc[lun].unload(unload) : !unload) : -#endif -#if LUN_USB == ENABLE -# if defined(Lun_usb_unload) - Lun_usb_unload(lun - LUN_ID_USB, unload); -# else - !unload; /* Can not unload: load success, unload fail */ -# endif -#else - false; /* No mem, unload/load fail */ -#endif - - Ctrl_access_unlock(); - - return unloaded; -} - -bool mem_wr_protect(U8 lun) -{ - bool wr_protect; - - if (!Ctrl_access_lock()) return true; - - wr_protect = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].wr_protect() : -#endif -#if LUN_USB == ENABLE - Lun_usb_wr_protect(lun - LUN_ID_USB); -#else - true; -#endif - - Ctrl_access_unlock(); - - return wr_protect; -} - - -bool mem_removal(U8 lun) -{ - bool removal; -#if MAX_LUN==0 - UNUSED(lun); -#endif - - if (!Ctrl_access_lock()) return true; - - removal = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].removal() : -#endif -#if LUN_USB == ENABLE - Lun_usb_removal(); -#else - true; -#endif - - Ctrl_access_unlock(); - - return removal; -} - - -const char *mem_name(U8 lun) -{ -#if MAX_LUN==0 - UNUSED(lun); -#endif - return -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].name : -#endif -#if LUN_USB == ENABLE - LUN_USB_NAME; -#else - NULL; -#endif -} - - -//! @} - - -#if ACCESS_USB == true - -/*! \name MEM <-> USB Interface - */ -//! @{ - - -Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector) -{ - Ctrl_status status; - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - memory_start_read_action(nb_sector); - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].usb_read_10(addr, nb_sector) : -#endif - CTRL_FAIL; - memory_stop_read_action(); - - Ctrl_access_unlock(); - - return status; -} - - -Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector) -{ - Ctrl_status status; - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - memory_start_write_action(nb_sector); - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].usb_write_10(addr, nb_sector) : -#endif - CTRL_FAIL; - memory_stop_write_action(); - - Ctrl_access_unlock(); - - return status; -} - - -//! @} - -#endif // ACCESS_USB == true - - -#if ACCESS_MEM_TO_RAM == true - -/*! \name MEM <-> RAM Interface - */ -//! @{ - - -Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram) -{ - Ctrl_status status; -#if MAX_LUN==0 - UNUSED(lun); -#endif - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - memory_start_read_action(1); - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].mem_2_ram(addr, ram) : -#endif -#if LUN_USB == ENABLE - Lun_usb_mem_2_ram(addr, ram); -#else - CTRL_FAIL; -#endif - memory_stop_read_action(); - - Ctrl_access_unlock(); - - return status; -} - - -Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram) -{ - Ctrl_status status; -#if MAX_LUN==0 - UNUSED(lun); -#endif - - if (!Ctrl_access_lock()) return CTRL_FAIL; - - memory_start_write_action(1); - status = -#if MAX_LUN - (lun < MAX_LUN) ? lun_desc[lun].ram_2_mem(addr, ram) : -#endif -#if LUN_USB == ENABLE - Lun_usb_ram_2_mem(addr, ram); -#else - CTRL_FAIL; -#endif - memory_stop_write_action(); - - Ctrl_access_unlock(); - - return status; -} - - -//! @} - -#endif // ACCESS_MEM_TO_RAM == true - - -#if ACCESS_STREAM == true - -/*! \name Streaming MEM <-> MEM Interface - */ -//! @{ - - - #if ACCESS_MEM_TO_MEM == true - -#include "fat.h" - -Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_addr, U16 nb_sector) -{ - COMPILER_ALIGNED(4) - static U8 sector_buf[FS_512B]; - Ctrl_status status = CTRL_GOOD; - - while (nb_sector--) - { - if ((status = memory_2_ram(src_lun, src_addr++, sector_buf)) != CTRL_GOOD) break; - if ((status = ram_2_memory(dest_lun, dest_addr++, sector_buf)) != CTRL_GOOD) break; - } - - return status; -} - - #endif // ACCESS_MEM_TO_MEM == true - - -Ctrl_status stream_state(U8 id) -{ - UNUSED(id); - return CTRL_GOOD; -} - - -U16 stream_stop(U8 id) -{ - UNUSED(id); - return 0; -} - - -//! @} - -#endif // ACCESS_STREAM - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h deleted file mode 100644 index af6c8ceb96..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h +++ /dev/null @@ -1,402 +0,0 @@ -/***************************************************************************** - * - * \file - * - * \brief Abstraction layer for memory interfaces. - * - * This module contains the interfaces: - * - MEM <-> USB; - * - MEM <-> RAM; - * - MEM <-> MEM. - * - * This module may be configured and expanded to support the following features: - * - write-protected globals; - * - password-protected data; - * - specific features; - * - etc. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - ******************************************************************************/ -/* - * Support and FAQ: visit Atmel Support - */ - - -#ifndef _CTRL_ACCESS_H_ -#define _CTRL_ACCESS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \defgroup group_common_services_storage_ctrl_access Memory Control Access - * - * Common abstraction layer for memory interfaces. It provides interfaces between: - * Memory and USB, Memory and RAM, Memory and Memory. Common API for XMEGA and UC3. - * - * \{ - */ - -#include "compiler.h" -#include "conf_access.h" - -#ifndef SECTOR_SIZE -#define SECTOR_SIZE 512 -#endif - -//! Status returned by CTRL_ACCESS interfaces. -typedef enum -{ - CTRL_GOOD = PASS, //!< Success, memory ready. - CTRL_FAIL = FAIL, //!< An error occurred. - CTRL_NO_PRESENT = FAIL + 1, //!< Memory unplugged. - CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed. -} Ctrl_status; - - -// FYI: Each Logical Unit Number (LUN) corresponds to a memory. - -// Check LUN defines. -#ifndef LUN_0 - #error LUN_0 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_1 - #error LUN_1 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_2 - #error LUN_2 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_3 - #error LUN_3 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_4 - #error LUN_4 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_5 - #error LUN_5 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_6 - #error LUN_6 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_7 - #error LUN_7 must be defined as ENABLE or DISABLE in conf_access.h -#endif -#ifndef LUN_USB - #error LUN_USB must be defined as ENABLE or DISABLE in conf_access.h -#endif - -/*! \name LUN IDs - */ -//! @{ -#define LUN_ID_0 (0) //!< First static LUN. -#define LUN_ID_1 (LUN_ID_0 + LUN_0) -#define LUN_ID_2 (LUN_ID_1 + LUN_1) -#define LUN_ID_3 (LUN_ID_2 + LUN_2) -#define LUN_ID_4 (LUN_ID_3 + LUN_3) -#define LUN_ID_5 (LUN_ID_4 + LUN_4) -#define LUN_ID_6 (LUN_ID_5 + LUN_5) -#define LUN_ID_7 (LUN_ID_6 + LUN_6) -#define MAX_LUN (LUN_ID_7 + LUN_7) //!< Number of static LUNs. -#define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage). -//! @} - - -// Include LUN header files. -#if LUN_0 == ENABLE - #include LUN_0_INCLUDE -#endif -#if LUN_1 == ENABLE - #include LUN_1_INCLUDE -#endif -#if LUN_2 == ENABLE - #include LUN_2_INCLUDE -#endif -#if LUN_3 == ENABLE - #include LUN_3_INCLUDE -#endif -#if LUN_4 == ENABLE - #include LUN_4_INCLUDE -#endif -#if LUN_5 == ENABLE - #include LUN_5_INCLUDE -#endif -#if LUN_6 == ENABLE - #include LUN_6_INCLUDE -#endif -#if LUN_7 == ENABLE - #include LUN_7_INCLUDE -#endif -#if LUN_USB == ENABLE - #include LUN_USB_INCLUDE -#endif - - -// Check the configuration of write protection in conf_access.h. -#ifndef GLOBAL_WR_PROTECT - #error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h -#endif - - -#if GLOBAL_WR_PROTECT == true - -//! Write protect. -extern bool g_wr_protect; - -#endif - - -/*! \name Control Interface - */ -//! @{ - -#ifdef FREERTOS_USED - -/*! \brief Initializes the LUN access locker. - * - * \return \c true if the locker was successfully initialized, else \c false. - */ -extern bool ctrl_access_init(void); - -#endif // FREERTOS_USED - -/*! \brief Returns the number of LUNs. - * - * \return Number of LUNs in the system. - */ -extern U8 get_nb_lun(void); - -/*! \brief Returns the current LUN. - * - * \return Current LUN. - * - * \todo Implement. - */ -extern U8 get_cur_lun(void); - -/*! \brief Tests the memory state and initializes the memory if required. - * - * The TEST UNIT READY SCSI primary command allows an application client to poll - * a LUN until it is ready without having to allocate memory for returned data. - * - * This command may be used to check the media status of LUNs with removable - * media. - * - * \param lun Logical Unit Number. - * - * \return Status. - */ -extern Ctrl_status mem_test_unit_ready(U8 lun); - -/*! \brief Returns the address of the last valid sector (512 bytes) in the - * memory. - * - * \param lun Logical Unit Number. - * \param u32_nb_sector Pointer to the address of the last valid sector. - * - * \return Status. - */ -extern Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector); - -/*! \brief Returns the size of the physical sector. - * - * \param lun Logical Unit Number. - * - * \return Sector size (unit: 512 bytes). - */ -extern U8 mem_sector_size(U8 lun); - -/*! \brief Unload/load the medium. - * - * \param lun Logical Unit Number. - * \param unload \c true to unload the medium, \c false to load the medium. - * - * \return \c true if unload/load success, else \c false. - */ -extern bool mem_unload(U8 lun, bool unload); - -/*! \brief Returns the write-protection state of the memory. - * - * \param lun Logical Unit Number. - * - * \return \c true if the memory is write-protected, else \c false. - * - * \note Only used by removable memories with hardware-specific write - * protection. - */ -extern bool mem_wr_protect(U8 lun); - -/*! \brief Tells whether the memory is removable. - * - * \param lun Logical Unit Number. - * - * \return \c true if the memory is removable, else \c false. - */ -extern bool mem_removal(U8 lun); - -/*! \brief Returns a pointer to the LUN name. - * - * \param lun Logical Unit Number. - * - * \return Pointer to the LUN name string. - */ -extern const char *mem_name(U8 lun); - -//! @} - - -#if ACCESS_USB == true - -/*! \name MEM <-> USB Interface - */ -//! @{ - -/*! \brief Transfers data from the memory to USB. - * - * \param lun Logical Unit Number. - * \param addr Address of first memory sector to read. - * \param nb_sector Number of sectors to transfer. - * - * \return Status. - */ -extern Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector); - -/*! \brief Transfers data from USB to the memory. - * - * \param lun Logical Unit Number. - * \param addr Address of first memory sector to write. - * \param nb_sector Number of sectors to transfer. - * - * \return Status. - */ -extern Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector); - -//! @} - -#endif // ACCESS_USB == true - - -#if ACCESS_MEM_TO_RAM == true - -/*! \name MEM <-> RAM Interface - */ -//! @{ - -/*! \brief Copies 1 data sector from the memory to RAM. - * - * \param lun Logical Unit Number. - * \param addr Address of first memory sector to read. - * \param ram Pointer to RAM buffer to write. - * - * \return Status. - */ -extern Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram); - -/*! \brief Copies 1 data sector from RAM to the memory. - * - * \param lun Logical Unit Number. - * \param addr Address of first memory sector to write. - * \param ram Pointer to RAM buffer to read. - * - * \return Status. - */ -extern Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram); - -//! @} - -#endif // ACCESS_MEM_TO_RAM == true - - -#if ACCESS_STREAM == true - -/*! \name Streaming MEM <-> MEM Interface - */ -//! @{ - -//! Erroneous streaming data transfer ID. -#define ID_STREAM_ERR 0xFF - - #if ACCESS_MEM_TO_MEM == true - -/*! \brief Copies data from one memory to another. - * - * \param src_lun Source Logical Unit Number. - * \param src_addr Source address of first memory sector to read. - * \param dest_lun Destination Logical Unit Number. - * \param dest_addr Destination address of first memory sector to write. - * \param nb_sector Number of sectors to copy. - * - * \return Status. - */ -extern Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_addr, U16 nb_sector); - - #endif // ACCESS_MEM_TO_MEM == true - -/*! \brief Returns the state of a streaming data transfer. - * - * \param id Transfer ID. - * - * \return Status. - * - * \todo Implement. - */ -extern Ctrl_status stream_state(U8 id); - -/*! \brief Stops a streaming data transfer. - * - * \param id Transfer ID. - * - * \return Number of remaining sectors. - * - * \todo Implement. - */ -extern U16 stream_stop(U8 id); - -//! @} - -#endif // ACCESS_STREAM == true - -/** - * \} - */ - -#ifdef __cplusplus -} -#endif - -#endif // _CTRL_ACCESS_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/genclk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/genclk.h deleted file mode 100644 index 895aba0352..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/genclk.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * \file - * - * \brief Chip-specific generic clock management. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CHIP_GENCLK_H_INCLUDED -#define CHIP_GENCLK_H_INCLUDED - -#include -#include - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -/** - * \weakgroup genclk_group - * @{ - */ - -//! \name Programmable Clock Identifiers (PCK) -//@{ -#define GENCLK_PCK_0 0 //!< PCK0 ID -#define GENCLK_PCK_1 1 //!< PCK1 ID -#define GENCLK_PCK_2 2 //!< PCK2 ID -//@} - -//! \name Programmable Clock Sources (PCK) -//@{ - -enum genclk_source { - GENCLK_PCK_SRC_SLCK_RC = 0, //!< Internal 32kHz RC oscillator as PCK source clock - GENCLK_PCK_SRC_SLCK_XTAL = 1, //!< External 32kHz crystal oscillator as PCK source clock - GENCLK_PCK_SRC_SLCK_BYPASS = 2, //!< External 32kHz bypass oscillator as PCK source clock - GENCLK_PCK_SRC_MAINCK_4M_RC = 3, //!< Internal 4MHz RC oscillator as PCK source clock - GENCLK_PCK_SRC_MAINCK_8M_RC = 4, //!< Internal 8MHz RC oscillator as PCK source clock - GENCLK_PCK_SRC_MAINCK_12M_RC = 5, //!< Internal 12MHz RC oscillator as PCK source clock - GENCLK_PCK_SRC_MAINCK_XTAL = 6, //!< External crystal oscillator as PCK source clock - GENCLK_PCK_SRC_MAINCK_BYPASS = 7, //!< External bypass oscillator as PCK source clock - GENCLK_PCK_SRC_PLLACK = 8, //!< Use PLLACK as PCK source clock - GENCLK_PCK_SRC_PLLBCK = 9, //!< Use PLLBCK as PCK source clock - GENCLK_PCK_SRC_MCK = 10, //!< Use Master Clk as PCK source clock -}; - -//@} - -//! \name Programmable Clock Prescalers (PCK) -//@{ - -enum genclk_divider { - GENCLK_PCK_PRES_1 = PMC_PCK_PRES_CLK_1, //!< Set PCK clock prescaler to 1 - GENCLK_PCK_PRES_2 = PMC_PCK_PRES_CLK_2, //!< Set PCK clock prescaler to 2 - GENCLK_PCK_PRES_4 = PMC_PCK_PRES_CLK_4, //!< Set PCK clock prescaler to 4 - GENCLK_PCK_PRES_8 = PMC_PCK_PRES_CLK_8, //!< Set PCK clock prescaler to 8 - GENCLK_PCK_PRES_16 = PMC_PCK_PRES_CLK_16, //!< Set PCK clock prescaler to 16 - GENCLK_PCK_PRES_32 = PMC_PCK_PRES_CLK_32, //!< Set PCK clock prescaler to 32 - GENCLK_PCK_PRES_64 = PMC_PCK_PRES_CLK_64, //!< Set PCK clock prescaler to 64 -}; - -//@} - -struct genclk_config { - uint32_t ctrl; -}; - -static inline void genclk_config_defaults(struct genclk_config *p_cfg, - uint32_t ul_id) -{ - ul_id = ul_id; - p_cfg->ctrl = 0; -} - -static inline void genclk_config_read(struct genclk_config *p_cfg, - uint32_t ul_id) -{ - p_cfg->ctrl = PMC->PMC_PCK[ul_id]; -} - -static inline void genclk_config_write(const struct genclk_config *p_cfg, - uint32_t ul_id) -{ - PMC->PMC_PCK[ul_id] = p_cfg->ctrl; -} - -//! \name Programmable Clock Source and Prescaler configuration -//@{ - -static inline void genclk_config_set_source(struct genclk_config *p_cfg, - enum genclk_source e_src) -{ - p_cfg->ctrl &= (~PMC_PCK_CSS_Msk); - - switch (e_src) { - case GENCLK_PCK_SRC_SLCK_RC: - case GENCLK_PCK_SRC_SLCK_XTAL: - case GENCLK_PCK_SRC_SLCK_BYPASS: - p_cfg->ctrl |= (PMC_PCK_CSS_SLOW_CLK); - break; - - case GENCLK_PCK_SRC_MAINCK_4M_RC: - case GENCLK_PCK_SRC_MAINCK_8M_RC: - case GENCLK_PCK_SRC_MAINCK_12M_RC: - case GENCLK_PCK_SRC_MAINCK_XTAL: - case GENCLK_PCK_SRC_MAINCK_BYPASS: - p_cfg->ctrl |= (PMC_PCK_CSS_MAIN_CLK); - break; - - case GENCLK_PCK_SRC_PLLACK: - p_cfg->ctrl |= (PMC_PCK_CSS_PLLA_CLK); - break; - - case GENCLK_PCK_SRC_PLLBCK: - p_cfg->ctrl |= (PMC_PCK_CSS_UPLL_CLK); - break; - - case GENCLK_PCK_SRC_MCK: - p_cfg->ctrl |= (PMC_PCK_CSS_MCK); - break; - } -} - -static inline void genclk_config_set_divider(struct genclk_config *p_cfg, - uint32_t e_divider) -{ - p_cfg->ctrl &= ~PMC_PCK_PRES_Msk; - p_cfg->ctrl |= e_divider; -} - -//@} - -static inline void genclk_enable(const struct genclk_config *p_cfg, - uint32_t ul_id) -{ - PMC->PMC_PCK[ul_id] = p_cfg->ctrl; - pmc_enable_pck(ul_id); -} - -static inline void genclk_disable(uint32_t ul_id) -{ - pmc_disable_pck(ul_id); -} - -static inline void genclk_enable_source(enum genclk_source e_src) -{ - switch (e_src) { - case GENCLK_PCK_SRC_SLCK_RC: - if (!osc_is_ready(OSC_SLCK_32K_RC)) { - osc_enable(OSC_SLCK_32K_RC); - osc_wait_ready(OSC_SLCK_32K_RC); - } - break; - - case GENCLK_PCK_SRC_SLCK_XTAL: - if (!osc_is_ready(OSC_SLCK_32K_XTAL)) { - osc_enable(OSC_SLCK_32K_XTAL); - osc_wait_ready(OSC_SLCK_32K_XTAL); - } - break; - - case GENCLK_PCK_SRC_SLCK_BYPASS: - if (!osc_is_ready(OSC_SLCK_32K_BYPASS)) { - osc_enable(OSC_SLCK_32K_BYPASS); - osc_wait_ready(OSC_SLCK_32K_BYPASS); - } - break; - - case GENCLK_PCK_SRC_MAINCK_4M_RC: - if (!osc_is_ready(OSC_MAINCK_4M_RC)) { - osc_enable(OSC_MAINCK_4M_RC); - osc_wait_ready(OSC_MAINCK_4M_RC); - } - break; - - case GENCLK_PCK_SRC_MAINCK_8M_RC: - if (!osc_is_ready(OSC_MAINCK_8M_RC)) { - osc_enable(OSC_MAINCK_8M_RC); - osc_wait_ready(OSC_MAINCK_8M_RC); - } - break; - - case GENCLK_PCK_SRC_MAINCK_12M_RC: - if (!osc_is_ready(OSC_MAINCK_12M_RC)) { - osc_enable(OSC_MAINCK_12M_RC); - osc_wait_ready(OSC_MAINCK_12M_RC); - } - break; - - case GENCLK_PCK_SRC_MAINCK_XTAL: - if (!osc_is_ready(OSC_MAINCK_XTAL)) { - osc_enable(OSC_MAINCK_XTAL); - osc_wait_ready(OSC_MAINCK_XTAL); - } - break; - - case GENCLK_PCK_SRC_MAINCK_BYPASS: - if (!osc_is_ready(OSC_MAINCK_BYPASS)) { - osc_enable(OSC_MAINCK_BYPASS); - osc_wait_ready(OSC_MAINCK_BYPASS); - } - break; - -#ifdef CONFIG_PLL0_SOURCE - case GENCLK_PCK_SRC_PLLACK: - pll_enable_config_defaults(0); - break; -#endif - -#ifdef CONFIG_PLL1_SOURCE - case GENCLK_PCK_SRC_PLLBCK: - pll_enable_config_defaults(1); - break; -#endif - - case GENCLK_PCK_SRC_MCK: - break; - - default: - Assert(false); - break; - } -} - -//! @} - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif /* CHIP_GENCLK_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h deleted file mode 100644 index 5a2017be99..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h +++ /dev/null @@ -1,339 +0,0 @@ -/** - * \file - * - * \brief Preprocessor macro repeating utils. - * - * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _MREPEAT_H_ -#define _MREPEAT_H_ - -/** - * \defgroup group_sam_utils_mrepeat Preprocessor - Macro Repeat - * - * \ingroup group_sam_utils - * - * \{ - */ - -#include "preprocessor.h" - - -//! Maximal number of repetitions supported by MREPEAT. -#define MREPEAT_LIMIT 256 - -/*! \brief Macro repeat. - * - * This macro represents a horizontal repetition construct. - * - * \param count The number of repetitious calls to macro. Valid values range from 0 to MREPEAT_LIMIT. - * \param macro A binary operation of the form macro(n, data). This macro is expanded by MREPEAT with - * the current repetition number and the auxiliary data argument. - * \param data Auxiliary data passed to macro. - * - * \return macro(0, data) macro(1, data) ... macro(count - 1, data) - */ -#define MREPEAT(count, macro, data) TPASTE2(MREPEAT, count)(macro, data) - -#define MREPEAT0( macro, data) -#define MREPEAT1( macro, data) MREPEAT0( macro, data) macro( 0, data) -#define MREPEAT2( macro, data) MREPEAT1( macro, data) macro( 1, data) -#define MREPEAT3( macro, data) MREPEAT2( macro, data) macro( 2, data) -#define MREPEAT4( macro, data) MREPEAT3( macro, data) macro( 3, data) -#define MREPEAT5( macro, data) MREPEAT4( macro, data) macro( 4, data) -#define MREPEAT6( macro, data) MREPEAT5( macro, data) macro( 5, data) -#define MREPEAT7( macro, data) MREPEAT6( macro, data) macro( 6, data) -#define MREPEAT8( macro, data) MREPEAT7( macro, data) macro( 7, data) -#define MREPEAT9( macro, data) MREPEAT8( macro, data) macro( 8, data) -#define MREPEAT10( macro, data) MREPEAT9( macro, data) macro( 9, data) -#define MREPEAT11( macro, data) MREPEAT10( macro, data) macro( 10, data) -#define MREPEAT12( macro, data) MREPEAT11( macro, data) macro( 11, data) -#define MREPEAT13( macro, data) MREPEAT12( macro, data) macro( 12, data) -#define MREPEAT14( macro, data) MREPEAT13( macro, data) macro( 13, data) -#define MREPEAT15( macro, data) MREPEAT14( macro, data) macro( 14, data) -#define MREPEAT16( macro, data) MREPEAT15( macro, data) macro( 15, data) -#define MREPEAT17( macro, data) MREPEAT16( macro, data) macro( 16, data) -#define MREPEAT18( macro, data) MREPEAT17( macro, data) macro( 17, data) -#define MREPEAT19( macro, data) MREPEAT18( macro, data) macro( 18, data) -#define MREPEAT20( macro, data) MREPEAT19( macro, data) macro( 19, data) -#define MREPEAT21( macro, data) MREPEAT20( macro, data) macro( 20, data) -#define MREPEAT22( macro, data) MREPEAT21( macro, data) macro( 21, data) -#define MREPEAT23( macro, data) MREPEAT22( macro, data) macro( 22, data) -#define MREPEAT24( macro, data) MREPEAT23( macro, data) macro( 23, data) -#define MREPEAT25( macro, data) MREPEAT24( macro, data) macro( 24, data) -#define MREPEAT26( macro, data) MREPEAT25( macro, data) macro( 25, data) -#define MREPEAT27( macro, data) MREPEAT26( macro, data) macro( 26, data) -#define MREPEAT28( macro, data) MREPEAT27( macro, data) macro( 27, data) -#define MREPEAT29( macro, data) MREPEAT28( macro, data) macro( 28, data) -#define MREPEAT30( macro, data) MREPEAT29( macro, data) macro( 29, data) -#define MREPEAT31( macro, data) MREPEAT30( macro, data) macro( 30, data) -#define MREPEAT32( macro, data) MREPEAT31( macro, data) macro( 31, data) -#define MREPEAT33( macro, data) MREPEAT32( macro, data) macro( 32, data) -#define MREPEAT34( macro, data) MREPEAT33( macro, data) macro( 33, data) -#define MREPEAT35( macro, data) MREPEAT34( macro, data) macro( 34, data) -#define MREPEAT36( macro, data) MREPEAT35( macro, data) macro( 35, data) -#define MREPEAT37( macro, data) MREPEAT36( macro, data) macro( 36, data) -#define MREPEAT38( macro, data) MREPEAT37( macro, data) macro( 37, data) -#define MREPEAT39( macro, data) MREPEAT38( macro, data) macro( 38, data) -#define MREPEAT40( macro, data) MREPEAT39( macro, data) macro( 39, data) -#define MREPEAT41( macro, data) MREPEAT40( macro, data) macro( 40, data) -#define MREPEAT42( macro, data) MREPEAT41( macro, data) macro( 41, data) -#define MREPEAT43( macro, data) MREPEAT42( macro, data) macro( 42, data) -#define MREPEAT44( macro, data) MREPEAT43( macro, data) macro( 43, data) -#define MREPEAT45( macro, data) MREPEAT44( macro, data) macro( 44, data) -#define MREPEAT46( macro, data) MREPEAT45( macro, data) macro( 45, data) -#define MREPEAT47( macro, data) MREPEAT46( macro, data) macro( 46, data) -#define MREPEAT48( macro, data) MREPEAT47( macro, data) macro( 47, data) -#define MREPEAT49( macro, data) MREPEAT48( macro, data) macro( 48, data) -#define MREPEAT50( macro, data) MREPEAT49( macro, data) macro( 49, data) -#define MREPEAT51( macro, data) MREPEAT50( macro, data) macro( 50, data) -#define MREPEAT52( macro, data) MREPEAT51( macro, data) macro( 51, data) -#define MREPEAT53( macro, data) MREPEAT52( macro, data) macro( 52, data) -#define MREPEAT54( macro, data) MREPEAT53( macro, data) macro( 53, data) -#define MREPEAT55( macro, data) MREPEAT54( macro, data) macro( 54, data) -#define MREPEAT56( macro, data) MREPEAT55( macro, data) macro( 55, data) -#define MREPEAT57( macro, data) MREPEAT56( macro, data) macro( 56, data) -#define MREPEAT58( macro, data) MREPEAT57( macro, data) macro( 57, data) -#define MREPEAT59( macro, data) MREPEAT58( macro, data) macro( 58, data) -#define MREPEAT60( macro, data) MREPEAT59( macro, data) macro( 59, data) -#define MREPEAT61( macro, data) MREPEAT60( macro, data) macro( 60, data) -#define MREPEAT62( macro, data) MREPEAT61( macro, data) macro( 61, data) -#define MREPEAT63( macro, data) MREPEAT62( macro, data) macro( 62, data) -#define MREPEAT64( macro, data) MREPEAT63( macro, data) macro( 63, data) -#define MREPEAT65( macro, data) MREPEAT64( macro, data) macro( 64, data) -#define MREPEAT66( macro, data) MREPEAT65( macro, data) macro( 65, data) -#define MREPEAT67( macro, data) MREPEAT66( macro, data) macro( 66, data) -#define MREPEAT68( macro, data) MREPEAT67( macro, data) macro( 67, data) -#define MREPEAT69( macro, data) MREPEAT68( macro, data) macro( 68, data) -#define MREPEAT70( macro, data) MREPEAT69( macro, data) macro( 69, data) -#define MREPEAT71( macro, data) MREPEAT70( macro, data) macro( 70, data) -#define MREPEAT72( macro, data) MREPEAT71( macro, data) macro( 71, data) -#define MREPEAT73( macro, data) MREPEAT72( macro, data) macro( 72, data) -#define MREPEAT74( macro, data) MREPEAT73( macro, data) macro( 73, data) -#define MREPEAT75( macro, data) MREPEAT74( macro, data) macro( 74, data) -#define MREPEAT76( macro, data) MREPEAT75( macro, data) macro( 75, data) -#define MREPEAT77( macro, data) MREPEAT76( macro, data) macro( 76, data) -#define MREPEAT78( macro, data) MREPEAT77( macro, data) macro( 77, data) -#define MREPEAT79( macro, data) MREPEAT78( macro, data) macro( 78, data) -#define MREPEAT80( macro, data) MREPEAT79( macro, data) macro( 79, data) -#define MREPEAT81( macro, data) MREPEAT80( macro, data) macro( 80, data) -#define MREPEAT82( macro, data) MREPEAT81( macro, data) macro( 81, data) -#define MREPEAT83( macro, data) MREPEAT82( macro, data) macro( 82, data) -#define MREPEAT84( macro, data) MREPEAT83( macro, data) macro( 83, data) -#define MREPEAT85( macro, data) MREPEAT84( macro, data) macro( 84, data) -#define MREPEAT86( macro, data) MREPEAT85( macro, data) macro( 85, data) -#define MREPEAT87( macro, data) MREPEAT86( macro, data) macro( 86, data) -#define MREPEAT88( macro, data) MREPEAT87( macro, data) macro( 87, data) -#define MREPEAT89( macro, data) MREPEAT88( macro, data) macro( 88, data) -#define MREPEAT90( macro, data) MREPEAT89( macro, data) macro( 89, data) -#define MREPEAT91( macro, data) MREPEAT90( macro, data) macro( 90, data) -#define MREPEAT92( macro, data) MREPEAT91( macro, data) macro( 91, data) -#define MREPEAT93( macro, data) MREPEAT92( macro, data) macro( 92, data) -#define MREPEAT94( macro, data) MREPEAT93( macro, data) macro( 93, data) -#define MREPEAT95( macro, data) MREPEAT94( macro, data) macro( 94, data) -#define MREPEAT96( macro, data) MREPEAT95( macro, data) macro( 95, data) -#define MREPEAT97( macro, data) MREPEAT96( macro, data) macro( 96, data) -#define MREPEAT98( macro, data) MREPEAT97( macro, data) macro( 97, data) -#define MREPEAT99( macro, data) MREPEAT98( macro, data) macro( 98, data) -#define MREPEAT100(macro, data) MREPEAT99( macro, data) macro( 99, data) -#define MREPEAT101(macro, data) MREPEAT100(macro, data) macro(100, data) -#define MREPEAT102(macro, data) MREPEAT101(macro, data) macro(101, data) -#define MREPEAT103(macro, data) MREPEAT102(macro, data) macro(102, data) -#define MREPEAT104(macro, data) MREPEAT103(macro, data) macro(103, data) -#define MREPEAT105(macro, data) MREPEAT104(macro, data) macro(104, data) -#define MREPEAT106(macro, data) MREPEAT105(macro, data) macro(105, data) -#define MREPEAT107(macro, data) MREPEAT106(macro, data) macro(106, data) -#define MREPEAT108(macro, data) MREPEAT107(macro, data) macro(107, data) -#define MREPEAT109(macro, data) MREPEAT108(macro, data) macro(108, data) -#define MREPEAT110(macro, data) MREPEAT109(macro, data) macro(109, data) -#define MREPEAT111(macro, data) MREPEAT110(macro, data) macro(110, data) -#define MREPEAT112(macro, data) MREPEAT111(macro, data) macro(111, data) -#define MREPEAT113(macro, data) MREPEAT112(macro, data) macro(112, data) -#define MREPEAT114(macro, data) MREPEAT113(macro, data) macro(113, data) -#define MREPEAT115(macro, data) MREPEAT114(macro, data) macro(114, data) -#define MREPEAT116(macro, data) MREPEAT115(macro, data) macro(115, data) -#define MREPEAT117(macro, data) MREPEAT116(macro, data) macro(116, data) -#define MREPEAT118(macro, data) MREPEAT117(macro, data) macro(117, data) -#define MREPEAT119(macro, data) MREPEAT118(macro, data) macro(118, data) -#define MREPEAT120(macro, data) MREPEAT119(macro, data) macro(119, data) -#define MREPEAT121(macro, data) MREPEAT120(macro, data) macro(120, data) -#define MREPEAT122(macro, data) MREPEAT121(macro, data) macro(121, data) -#define MREPEAT123(macro, data) MREPEAT122(macro, data) macro(122, data) -#define MREPEAT124(macro, data) MREPEAT123(macro, data) macro(123, data) -#define MREPEAT125(macro, data) MREPEAT124(macro, data) macro(124, data) -#define MREPEAT126(macro, data) MREPEAT125(macro, data) macro(125, data) -#define MREPEAT127(macro, data) MREPEAT126(macro, data) macro(126, data) -#define MREPEAT128(macro, data) MREPEAT127(macro, data) macro(127, data) -#define MREPEAT129(macro, data) MREPEAT128(macro, data) macro(128, data) -#define MREPEAT130(macro, data) MREPEAT129(macro, data) macro(129, data) -#define MREPEAT131(macro, data) MREPEAT130(macro, data) macro(130, data) -#define MREPEAT132(macro, data) MREPEAT131(macro, data) macro(131, data) -#define MREPEAT133(macro, data) MREPEAT132(macro, data) macro(132, data) -#define MREPEAT134(macro, data) MREPEAT133(macro, data) macro(133, data) -#define MREPEAT135(macro, data) MREPEAT134(macro, data) macro(134, data) -#define MREPEAT136(macro, data) MREPEAT135(macro, data) macro(135, data) -#define MREPEAT137(macro, data) MREPEAT136(macro, data) macro(136, data) -#define MREPEAT138(macro, data) MREPEAT137(macro, data) macro(137, data) -#define MREPEAT139(macro, data) MREPEAT138(macro, data) macro(138, data) -#define MREPEAT140(macro, data) MREPEAT139(macro, data) macro(139, data) -#define MREPEAT141(macro, data) MREPEAT140(macro, data) macro(140, data) -#define MREPEAT142(macro, data) MREPEAT141(macro, data) macro(141, data) -#define MREPEAT143(macro, data) MREPEAT142(macro, data) macro(142, data) -#define MREPEAT144(macro, data) MREPEAT143(macro, data) macro(143, data) -#define MREPEAT145(macro, data) MREPEAT144(macro, data) macro(144, data) -#define MREPEAT146(macro, data) MREPEAT145(macro, data) macro(145, data) -#define MREPEAT147(macro, data) MREPEAT146(macro, data) macro(146, data) -#define MREPEAT148(macro, data) MREPEAT147(macro, data) macro(147, data) -#define MREPEAT149(macro, data) MREPEAT148(macro, data) macro(148, data) -#define MREPEAT150(macro, data) MREPEAT149(macro, data) macro(149, data) -#define MREPEAT151(macro, data) MREPEAT150(macro, data) macro(150, data) -#define MREPEAT152(macro, data) MREPEAT151(macro, data) macro(151, data) -#define MREPEAT153(macro, data) MREPEAT152(macro, data) macro(152, data) -#define MREPEAT154(macro, data) MREPEAT153(macro, data) macro(153, data) -#define MREPEAT155(macro, data) MREPEAT154(macro, data) macro(154, data) -#define MREPEAT156(macro, data) MREPEAT155(macro, data) macro(155, data) -#define MREPEAT157(macro, data) MREPEAT156(macro, data) macro(156, data) -#define MREPEAT158(macro, data) MREPEAT157(macro, data) macro(157, data) -#define MREPEAT159(macro, data) MREPEAT158(macro, data) macro(158, data) -#define MREPEAT160(macro, data) MREPEAT159(macro, data) macro(159, data) -#define MREPEAT161(macro, data) MREPEAT160(macro, data) macro(160, data) -#define MREPEAT162(macro, data) MREPEAT161(macro, data) macro(161, data) -#define MREPEAT163(macro, data) MREPEAT162(macro, data) macro(162, data) -#define MREPEAT164(macro, data) MREPEAT163(macro, data) macro(163, data) -#define MREPEAT165(macro, data) MREPEAT164(macro, data) macro(164, data) -#define MREPEAT166(macro, data) MREPEAT165(macro, data) macro(165, data) -#define MREPEAT167(macro, data) MREPEAT166(macro, data) macro(166, data) -#define MREPEAT168(macro, data) MREPEAT167(macro, data) macro(167, data) -#define MREPEAT169(macro, data) MREPEAT168(macro, data) macro(168, data) -#define MREPEAT170(macro, data) MREPEAT169(macro, data) macro(169, data) -#define MREPEAT171(macro, data) MREPEAT170(macro, data) macro(170, data) -#define MREPEAT172(macro, data) MREPEAT171(macro, data) macro(171, data) -#define MREPEAT173(macro, data) MREPEAT172(macro, data) macro(172, data) -#define MREPEAT174(macro, data) MREPEAT173(macro, data) macro(173, data) -#define MREPEAT175(macro, data) MREPEAT174(macro, data) macro(174, data) -#define MREPEAT176(macro, data) MREPEAT175(macro, data) macro(175, data) -#define MREPEAT177(macro, data) MREPEAT176(macro, data) macro(176, data) -#define MREPEAT178(macro, data) MREPEAT177(macro, data) macro(177, data) -#define MREPEAT179(macro, data) MREPEAT178(macro, data) macro(178, data) -#define MREPEAT180(macro, data) MREPEAT179(macro, data) macro(179, data) -#define MREPEAT181(macro, data) MREPEAT180(macro, data) macro(180, data) -#define MREPEAT182(macro, data) MREPEAT181(macro, data) macro(181, data) -#define MREPEAT183(macro, data) MREPEAT182(macro, data) macro(182, data) -#define MREPEAT184(macro, data) MREPEAT183(macro, data) macro(183, data) -#define MREPEAT185(macro, data) MREPEAT184(macro, data) macro(184, data) -#define MREPEAT186(macro, data) MREPEAT185(macro, data) macro(185, data) -#define MREPEAT187(macro, data) MREPEAT186(macro, data) macro(186, data) -#define MREPEAT188(macro, data) MREPEAT187(macro, data) macro(187, data) -#define MREPEAT189(macro, data) MREPEAT188(macro, data) macro(188, data) -#define MREPEAT190(macro, data) MREPEAT189(macro, data) macro(189, data) -#define MREPEAT191(macro, data) MREPEAT190(macro, data) macro(190, data) -#define MREPEAT192(macro, data) MREPEAT191(macro, data) macro(191, data) -#define MREPEAT193(macro, data) MREPEAT192(macro, data) macro(192, data) -#define MREPEAT194(macro, data) MREPEAT193(macro, data) macro(193, data) -#define MREPEAT195(macro, data) MREPEAT194(macro, data) macro(194, data) -#define MREPEAT196(macro, data) MREPEAT195(macro, data) macro(195, data) -#define MREPEAT197(macro, data) MREPEAT196(macro, data) macro(196, data) -#define MREPEAT198(macro, data) MREPEAT197(macro, data) macro(197, data) -#define MREPEAT199(macro, data) MREPEAT198(macro, data) macro(198, data) -#define MREPEAT200(macro, data) MREPEAT199(macro, data) macro(199, data) -#define MREPEAT201(macro, data) MREPEAT200(macro, data) macro(200, data) -#define MREPEAT202(macro, data) MREPEAT201(macro, data) macro(201, data) -#define MREPEAT203(macro, data) MREPEAT202(macro, data) macro(202, data) -#define MREPEAT204(macro, data) MREPEAT203(macro, data) macro(203, data) -#define MREPEAT205(macro, data) MREPEAT204(macro, data) macro(204, data) -#define MREPEAT206(macro, data) MREPEAT205(macro, data) macro(205, data) -#define MREPEAT207(macro, data) MREPEAT206(macro, data) macro(206, data) -#define MREPEAT208(macro, data) MREPEAT207(macro, data) macro(207, data) -#define MREPEAT209(macro, data) MREPEAT208(macro, data) macro(208, data) -#define MREPEAT210(macro, data) MREPEAT209(macro, data) macro(209, data) -#define MREPEAT211(macro, data) MREPEAT210(macro, data) macro(210, data) -#define MREPEAT212(macro, data) MREPEAT211(macro, data) macro(211, data) -#define MREPEAT213(macro, data) MREPEAT212(macro, data) macro(212, data) -#define MREPEAT214(macro, data) MREPEAT213(macro, data) macro(213, data) -#define MREPEAT215(macro, data) MREPEAT214(macro, data) macro(214, data) -#define MREPEAT216(macro, data) MREPEAT215(macro, data) macro(215, data) -#define MREPEAT217(macro, data) MREPEAT216(macro, data) macro(216, data) -#define MREPEAT218(macro, data) MREPEAT217(macro, data) macro(217, data) -#define MREPEAT219(macro, data) MREPEAT218(macro, data) macro(218, data) -#define MREPEAT220(macro, data) MREPEAT219(macro, data) macro(219, data) -#define MREPEAT221(macro, data) MREPEAT220(macro, data) macro(220, data) -#define MREPEAT222(macro, data) MREPEAT221(macro, data) macro(221, data) -#define MREPEAT223(macro, data) MREPEAT222(macro, data) macro(222, data) -#define MREPEAT224(macro, data) MREPEAT223(macro, data) macro(223, data) -#define MREPEAT225(macro, data) MREPEAT224(macro, data) macro(224, data) -#define MREPEAT226(macro, data) MREPEAT225(macro, data) macro(225, data) -#define MREPEAT227(macro, data) MREPEAT226(macro, data) macro(226, data) -#define MREPEAT228(macro, data) MREPEAT227(macro, data) macro(227, data) -#define MREPEAT229(macro, data) MREPEAT228(macro, data) macro(228, data) -#define MREPEAT230(macro, data) MREPEAT229(macro, data) macro(229, data) -#define MREPEAT231(macro, data) MREPEAT230(macro, data) macro(230, data) -#define MREPEAT232(macro, data) MREPEAT231(macro, data) macro(231, data) -#define MREPEAT233(macro, data) MREPEAT232(macro, data) macro(232, data) -#define MREPEAT234(macro, data) MREPEAT233(macro, data) macro(233, data) -#define MREPEAT235(macro, data) MREPEAT234(macro, data) macro(234, data) -#define MREPEAT236(macro, data) MREPEAT235(macro, data) macro(235, data) -#define MREPEAT237(macro, data) MREPEAT236(macro, data) macro(236, data) -#define MREPEAT238(macro, data) MREPEAT237(macro, data) macro(237, data) -#define MREPEAT239(macro, data) MREPEAT238(macro, data) macro(238, data) -#define MREPEAT240(macro, data) MREPEAT239(macro, data) macro(239, data) -#define MREPEAT241(macro, data) MREPEAT240(macro, data) macro(240, data) -#define MREPEAT242(macro, data) MREPEAT241(macro, data) macro(241, data) -#define MREPEAT243(macro, data) MREPEAT242(macro, data) macro(242, data) -#define MREPEAT244(macro, data) MREPEAT243(macro, data) macro(243, data) -#define MREPEAT245(macro, data) MREPEAT244(macro, data) macro(244, data) -#define MREPEAT246(macro, data) MREPEAT245(macro, data) macro(245, data) -#define MREPEAT247(macro, data) MREPEAT246(macro, data) macro(246, data) -#define MREPEAT248(macro, data) MREPEAT247(macro, data) macro(247, data) -#define MREPEAT249(macro, data) MREPEAT248(macro, data) macro(248, data) -#define MREPEAT250(macro, data) MREPEAT249(macro, data) macro(249, data) -#define MREPEAT251(macro, data) MREPEAT250(macro, data) macro(250, data) -#define MREPEAT252(macro, data) MREPEAT251(macro, data) macro(251, data) -#define MREPEAT253(macro, data) MREPEAT252(macro, data) macro(252, data) -#define MREPEAT254(macro, data) MREPEAT253(macro, data) macro(253, data) -#define MREPEAT255(macro, data) MREPEAT254(macro, data) macro(254, data) -#define MREPEAT256(macro, data) MREPEAT255(macro, data) macro(255, data) - -/** - * \} - */ - -#endif // _MREPEAT_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/osc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/osc.h deleted file mode 100644 index 3a9543507b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/osc.h +++ /dev/null @@ -1,261 +0,0 @@ -/** - * \file - * - * \brief Chip-specific oscillator management functions. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CHIP_OSC_H_INCLUDED -#define CHIP_OSC_H_INCLUDED - -#include "compiler.h" - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -/* - * Below BOARD_XXX macros are related to the specific board, and - * should be defined by the board code, otherwise default value are used. - */ -#ifndef BOARD_FREQ_SLCK_XTAL -# warning The board slow clock xtal frequency has not been defined. -# define BOARD_FREQ_SLCK_XTAL (32768UL) -#endif - -#ifndef BOARD_FREQ_SLCK_BYPASS -# warning The board slow clock bypass frequency has not been defined. -# define BOARD_FREQ_SLCK_BYPASS (32768UL) -#endif - -#ifndef BOARD_FREQ_MAINCK_XTAL -# warning The board main clock xtal frequency has not been defined. -# define BOARD_FREQ_MAINCK_XTAL (12000000UL) -#endif - -#ifndef BOARD_FREQ_MAINCK_BYPASS -# warning The board main clock bypass frequency has not been defined. -# define BOARD_FREQ_MAINCK_BYPASS (12000000UL) -#endif - -#ifndef BOARD_OSC_STARTUP_US -# warning The board main clock xtal startup time has not been defined. -# define BOARD_OSC_STARTUP_US (15625UL) -#endif - -/** - * \weakgroup osc_group - * @{ - */ - -//! \name Oscillator identifiers -//@{ -#define OSC_SLCK_32K_RC 0 //!< Internal 32kHz RC oscillator. -#define OSC_SLCK_32K_XTAL 1 //!< External 32kHz crystal oscillator. -#define OSC_SLCK_32K_BYPASS 2 //!< External 32kHz bypass oscillator. -#define OSC_MAINCK_4M_RC 3 //!< Internal 4MHz RC oscillator. -#define OSC_MAINCK_8M_RC 4 //!< Internal 8MHz RC oscillator. -#define OSC_MAINCK_12M_RC 5 //!< Internal 12MHz RC oscillator. -#define OSC_MAINCK_XTAL 6 //!< External crystal oscillator. -#define OSC_MAINCK_BYPASS 7 //!< External bypass oscillator. -//@} - -//! \name Oscillator clock speed in hertz -//@{ -#define OSC_SLCK_32K_RC_HZ CHIP_FREQ_SLCK_RC //!< Internal 32kHz RC oscillator. -#define OSC_SLCK_32K_XTAL_HZ BOARD_FREQ_SLCK_XTAL //!< External 32kHz crystal oscillator. -#define OSC_SLCK_32K_BYPASS_HZ BOARD_FREQ_SLCK_BYPASS //!< External 32kHz bypass oscillator. -#define OSC_MAINCK_4M_RC_HZ CHIP_FREQ_MAINCK_RC_4MHZ //!< Internal 4MHz RC oscillator. -#define OSC_MAINCK_8M_RC_HZ CHIP_FREQ_MAINCK_RC_8MHZ //!< Internal 8MHz RC oscillator. -#define OSC_MAINCK_12M_RC_HZ CHIP_FREQ_MAINCK_RC_12MHZ //!< Internal 12MHz RC oscillator. -#define OSC_MAINCK_XTAL_HZ BOARD_FREQ_MAINCK_XTAL //!< External crystal oscillator. -#define OSC_MAINCK_BYPASS_HZ BOARD_FREQ_MAINCK_BYPASS //!< External bypass oscillator. -//@} - -static inline void osc_enable(uint32_t ul_id) -{ - switch (ul_id) { - case OSC_SLCK_32K_RC: - break; - - case OSC_SLCK_32K_XTAL: - pmc_switch_sclk_to_32kxtal(PMC_OSC_XTAL); - break; - - case OSC_SLCK_32K_BYPASS: - pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS); - break; - - - case OSC_MAINCK_4M_RC: - pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz); - break; - - case OSC_MAINCK_8M_RC: - pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_8_MHz); - break; - - case OSC_MAINCK_12M_RC: - pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz); - break; - - - case OSC_MAINCK_XTAL: - pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*, - pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US, - OSC_SLCK_32K_RC_HZ)*/); - break; - - case OSC_MAINCK_BYPASS: - pmc_switch_mainck_to_xtal(PMC_OSC_BYPASS/*, - pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US, - OSC_SLCK_32K_RC_HZ)*/); - break; - } -} - -static inline void osc_disable(uint32_t ul_id) -{ - switch (ul_id) { - case OSC_SLCK_32K_RC: - case OSC_SLCK_32K_XTAL: - case OSC_SLCK_32K_BYPASS: - break; - - case OSC_MAINCK_4M_RC: - case OSC_MAINCK_8M_RC: - case OSC_MAINCK_12M_RC: - pmc_osc_disable_fastrc(); - break; - - case OSC_MAINCK_XTAL: - pmc_osc_disable_xtal(PMC_OSC_XTAL); - break; - - case OSC_MAINCK_BYPASS: - pmc_osc_disable_xtal(PMC_OSC_BYPASS); - break; - } -} - -static inline bool osc_is_ready(uint32_t ul_id) -{ - switch (ul_id) { - case OSC_SLCK_32K_RC: - return 1; - - case OSC_SLCK_32K_XTAL: - case OSC_SLCK_32K_BYPASS: - return pmc_osc_is_ready_32kxtal(); - - case OSC_MAINCK_4M_RC: - case OSC_MAINCK_8M_RC: - case OSC_MAINCK_12M_RC: - case OSC_MAINCK_XTAL: - case OSC_MAINCK_BYPASS: - return pmc_osc_is_ready_mainck(); - } - - return 0; -} - -static inline uint32_t osc_get_rate(uint32_t ul_id) -{ - switch (ul_id) { - case OSC_SLCK_32K_RC: - return OSC_SLCK_32K_RC_HZ; - - case OSC_SLCK_32K_XTAL: - return BOARD_FREQ_SLCK_XTAL; - - case OSC_SLCK_32K_BYPASS: - return BOARD_FREQ_SLCK_BYPASS; - - case OSC_MAINCK_4M_RC: - return OSC_MAINCK_4M_RC_HZ; - - case OSC_MAINCK_8M_RC: - return OSC_MAINCK_8M_RC_HZ; - - case OSC_MAINCK_12M_RC: - return OSC_MAINCK_12M_RC_HZ; - - case OSC_MAINCK_XTAL: - return BOARD_FREQ_MAINCK_XTAL; - - case OSC_MAINCK_BYPASS: - return BOARD_FREQ_MAINCK_BYPASS; - } - - return 0; -} - -/** - * \brief Wait until the oscillator identified by \a id is ready - * - * This function will busy-wait for the oscillator identified by \a id - * to become stable and ready to use as a clock source. - * - * \param id A number identifying the oscillator to wait for. - */ -static inline void osc_wait_ready(uint8_t id) -{ - while (!osc_is_ready(id)) { - /* Do nothing */ - } -} - -//! @} - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif /* CHIP_OSC_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/pll.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/pll.h deleted file mode 100644 index d3d2174870..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/pll.h +++ /dev/null @@ -1,288 +0,0 @@ -/** - * \file - * - * \brief Chip-specific PLL definitions. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CHIP_PLL_H_INCLUDED -#define CHIP_PLL_H_INCLUDED - -#include "osc.h" - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -/** - * \weakgroup pll_group - * @{ - */ - -#define PLL_OUTPUT_MIN_HZ 84000000 -#define PLL_OUTPUT_MAX_HZ 192000000 - -#define PLL_INPUT_MIN_HZ 8000000 -#define PLL_INPUT_MAX_HZ 16000000 - -#define NR_PLLS 2 -#define PLLA_ID 0 -#define UPLL_ID 1 //!< USB UTMI PLL. - -#define PLL_UPLL_HZ 480000000 - -#define PLL_COUNT 0x3FU - -enum pll_source { - PLL_SRC_MAINCK_4M_RC = OSC_MAINCK_4M_RC, //!< Internal 4MHz RC oscillator. - PLL_SRC_MAINCK_8M_RC = OSC_MAINCK_8M_RC, //!< Internal 8MHz RC oscillator. - PLL_SRC_MAINCK_12M_RC = OSC_MAINCK_12M_RC, //!< Internal 12MHz RC oscillator. - PLL_SRC_MAINCK_XTAL = OSC_MAINCK_XTAL, //!< External crystal oscillator. - PLL_SRC_MAINCK_BYPASS = OSC_MAINCK_BYPASS, //!< External bypass oscillator. - PLL_NR_SOURCES, //!< Number of PLL sources. -}; - -struct pll_config { - uint32_t ctrl; -}; - -#define pll_get_default_rate(pll_id) \ - ((osc_get_rate(CONFIG_PLL##pll_id##_SOURCE) \ - * CONFIG_PLL##pll_id##_MUL) \ - / CONFIG_PLL##pll_id##_DIV) - -/* Force UTMI PLL parameters (Hardware defined) */ -#ifdef CONFIG_PLL1_SOURCE -# undef CONFIG_PLL1_SOURCE -#endif -#ifdef CONFIG_PLL1_MUL -# undef CONFIG_PLL1_MUL -#endif -#ifdef CONFIG_PLL1_DIV -# undef CONFIG_PLL1_DIV -#endif -#define CONFIG_PLL1_SOURCE PLL_SRC_MAINCK_XTAL -#define CONFIG_PLL1_MUL 0 -#define CONFIG_PLL1_DIV 0 - -/** - * \note The SAM3X PLL hardware interprets mul as mul+1. For readability the hardware mul+1 - * is hidden in this implementation. Use mul as mul effective value. - */ -static inline void pll_config_init(struct pll_config *p_cfg, - enum pll_source e_src, uint32_t ul_div, uint32_t ul_mul) -{ - uint32_t vco_hz; - - Assert(e_src < PLL_NR_SOURCES); - - if (ul_div == 0 && ul_mul == 0) { /* Must only be true for UTMI PLL */ - p_cfg->ctrl = CKGR_UCKR_UPLLCOUNT(PLL_COUNT); - } else { /* PLLA */ - /* Calculate internal VCO frequency */ - vco_hz = osc_get_rate(e_src) / ul_div; - Assert(vco_hz >= PLL_INPUT_MIN_HZ); - Assert(vco_hz <= PLL_INPUT_MAX_HZ); - - vco_hz *= ul_mul; - Assert(vco_hz >= PLL_OUTPUT_MIN_HZ); - Assert(vco_hz <= PLL_OUTPUT_MAX_HZ); - - /* PMC hardware will automatically make it mul+1 */ - p_cfg->ctrl = CKGR_PLLAR_MULA(ul_mul - 1) | CKGR_PLLAR_DIVA(ul_div) | CKGR_PLLAR_PLLACOUNT(PLL_COUNT); - } -} - -#define pll_config_defaults(cfg, pll_id) \ - pll_config_init(cfg, \ - CONFIG_PLL##pll_id##_SOURCE, \ - CONFIG_PLL##pll_id##_DIV, \ - CONFIG_PLL##pll_id##_MUL) - -static inline void pll_config_read(struct pll_config *p_cfg, uint32_t ul_pll_id) -{ - Assert(ul_pll_id < NR_PLLS); - - if (ul_pll_id == PLLA_ID) { - p_cfg->ctrl = PMC->CKGR_PLLAR; - } else { - p_cfg->ctrl = PMC->CKGR_UCKR; - } -} - -static inline void pll_config_write(const struct pll_config *p_cfg, uint32_t ul_pll_id) -{ - Assert(ul_pll_id < NR_PLLS); - - if (ul_pll_id == PLLA_ID) { - pmc_disable_pllack(); // Always stop PLL first! - PMC->CKGR_PLLAR = CKGR_PLLAR_ONE | p_cfg->ctrl; - } else { - PMC->CKGR_UCKR = p_cfg->ctrl; - } -} - -static inline void pll_enable(const struct pll_config *p_cfg, uint32_t ul_pll_id) -{ - Assert(ul_pll_id < NR_PLLS); - - if (ul_pll_id == PLLA_ID) { - pmc_disable_pllack(); // Always stop PLL first! - PMC->CKGR_PLLAR = CKGR_PLLAR_ONE | p_cfg->ctrl; - } else { - PMC->CKGR_UCKR = p_cfg->ctrl | CKGR_UCKR_UPLLEN; - } -} - -/** - * \note This will only disable the selected PLL, not the underlying oscillator (mainck). - */ -static inline void pll_disable(uint32_t ul_pll_id) -{ - Assert(ul_pll_id < NR_PLLS); - - if (ul_pll_id == PLLA_ID) { - pmc_disable_pllack(); - } else { - PMC->CKGR_UCKR &= ~CKGR_UCKR_UPLLEN; - } -} - -static inline uint32_t pll_is_locked(uint32_t ul_pll_id) -{ - Assert(ul_pll_id < NR_PLLS); - - if (ul_pll_id == PLLA_ID) { - return pmc_is_locked_pllack(); - } else { - return pmc_is_locked_upll(); - } -} - -static inline void pll_enable_source(enum pll_source e_src) -{ - switch (e_src) { - case PLL_SRC_MAINCK_4M_RC: - case PLL_SRC_MAINCK_8M_RC: - case PLL_SRC_MAINCK_12M_RC: - case PLL_SRC_MAINCK_XTAL: - case PLL_SRC_MAINCK_BYPASS: - osc_enable(e_src); - osc_wait_ready(e_src); - break; - - default: - Assert(false); - break; - } -} - -static inline void pll_enable_config_defaults(unsigned int ul_pll_id) -{ - struct pll_config pllcfg; - - if (pll_is_locked(ul_pll_id)) { - return; // Pll already running - } - switch (ul_pll_id) { -#ifdef CONFIG_PLL0_SOURCE - case 0: - pll_enable_source(CONFIG_PLL0_SOURCE); - pll_config_init(&pllcfg, - CONFIG_PLL0_SOURCE, - CONFIG_PLL0_DIV, - CONFIG_PLL0_MUL); - break; -#endif -#ifdef CONFIG_PLL1_SOURCE - case 1: - pll_enable_source(CONFIG_PLL1_SOURCE); - pll_config_init(&pllcfg, - CONFIG_PLL1_SOURCE, - CONFIG_PLL1_DIV, - CONFIG_PLL1_MUL); - break; -#endif - default: - Assert(false); - break; - } - pll_enable(&pllcfg, ul_pll_id); - while (!pll_is_locked(ul_pll_id)); -} - -/** - * \brief Wait for PLL \a pll_id to become locked - * - * \todo Use a timeout to avoid waiting forever and hanging the system - * - * \param pll_id The ID of the PLL to wait for. - * - * \retval STATUS_OK The PLL is now locked. - * \retval ERR_TIMEOUT Timed out waiting for PLL to become locked. - */ -static inline int pll_wait_for_lock(unsigned int pll_id) -{ - Assert(pll_id < NR_PLLS); - - while (!pll_is_locked(pll_id)) { - /* Do nothing */ - } - - return 0; -} - -//! @} - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif /* CHIP_PLL_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h deleted file mode 100644 index 184c03ae71..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * \file - * - * \brief Preprocessor utils. - * - * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _PREPROCESSOR_H_ -#define _PREPROCESSOR_H_ - -#include "tpaste.h" -#include "stringz.h" -#include "mrepeat.h" - - -#endif // _PREPROCESSOR_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h deleted file mode 100644 index 082b735fa6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * \file - * - * \brief SCSI Block Commands - * - * This file contains definitions of some of the commands found in the - * SCSI SBC-2 standard. - * - * Note that the SBC specification depends on several commands defined - * by the SCSI Primary Commands (SPC) standard. Each version of the SBC - * standard is meant to be used in conjunction with a specific version - * of the SPC standard, as follows: - * - SBC depends on SPC - * - SBC-2 depends on SPC-3 - * - SBC-3 depends on SPC-4 - * - * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ -#ifndef _SBC_PROTOCOL_H_ -#define _SBC_PROTOCOL_H_ - - -/** - * \ingroup usb_msc_protocol - * \defgroup usb_sbc_protocol SCSI Block Commands protocol definitions - * - * @{ - */ - -//! \name SCSI commands defined by SBC-2 -//@{ -#define SBC_FORMAT_UNIT 0x04 -#define SBC_READ6 0x08 -#define SBC_WRITE6 0x0A -#define SBC_START_STOP_UNIT 0x1B -#define SBC_READ_CAPACITY10 0x25 -#define SBC_READ10 0x28 -#define SBC_WRITE10 0x2A -#define SBC_VERIFY10 0x2F -//@} - -//! \name SBC-2 Mode page definitions -//@{ - -enum scsi_sbc_mode { - SCSI_MS_MODE_RW_ERR_RECOV = 0x01, //!< Read-Write Error Recovery mode page - SCSI_MS_MODE_FORMAT_DEVICE = 0x03, //!< Format Device mode page - SCSI_MS_MODE_FLEXIBLE_DISK = 0x05, //!< Flexible Disk mode page - SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page -}; - - -//! \name SBC-2 Device-Specific Parameter -//@{ -#define SCSI_MS_SBC_WP 0x80 //!< Write Protected -#define SCSI_MS_SBC_DPOFUA 0x10 //!< DPO and FUA supported -//@} - -/** - * \brief SBC-2 Short LBA mode parameter block descriptor - */ -struct sbc_slba_block_desc { - be32_t nr_blocks; //!< Number of Blocks - be32_t block_len; //!< Block Length -#define SBC_SLBA_BLOCK_LEN_MASK 0x00FFFFFFU //!< Mask reserved bits -}; - -/** - * \brief SBC-2 Caching mode page - */ -struct sbc_caching_mode_page { - uint8_t page_code; - uint8_t page_length; - uint8_t flags2; -#define SBC_MP_CACHE_IC (1 << 7) //!< Initiator Control -#define SBC_MP_CACHE_ABPF (1 << 6) //!< Abort Pre-Fetch -#define SBC_MP_CACHE_CAP (1 << 5) //!< Catching Analysis Permitted -#define SBC_MP_CACHE_DISC (1 << 4) //!< Discontinuity -#define SBC_MP_CACHE_SIZE (1 << 3) //!< Size enable -#define SBC_MP_CACHE_WCE (1 << 2) //!< Write back Cache Enable -#define SBC_MP_CACHE_MF (1 << 1) //!< Multiplication Factor -#define SBC_MP_CACHE_RCD (1 << 0) //!< Read Cache Disable - uint8_t retention; - be16_t dis_pf_transfer_len; - be16_t min_prefetch; - be16_t max_prefetch; - be16_t max_prefetch_ceil; - uint8_t flags12; -#define SBC_MP_CACHE_FSW (1 << 7) //!< Force Sequential Write -#define SBC_MP_CACHE_LBCSS (1 << 6) //!< Logical Blk Cache Seg Sz -#define SBC_MP_CACHE_DRA (1 << 5) //!< Disable Read-Ahead -#define SBC_MP_CACHE_NV_DIS (1 << 0) //!< Non-Volatile Cache Disable - uint8_t nr_cache_segments; - be16_t cache_segment_size; - uint8_t reserved[4]; -}; - -/** - * \brief SBC-2 Read-Write Error Recovery mode page - */ -struct sbc_rdwr_error_recovery_mode_page { - uint8_t page_code; - uint8_t page_length; -#define SPC_MP_RW_ERR_RECOV_PAGE_LENGTH 0x0A - uint8_t flags1; -#define SBC_MP_RW_ERR_RECOV_AWRE (1 << 7) -#define SBC_MP_RW_ERR_RECOV_ARRE (1 << 6) -#define SBC_MP_RW_ERR_RECOV_TB (1 << 5) -#define SBC_MP_RW_ERR_RECOV_RC (1 << 4) -#define SBC_MP_RW_ERR_RECOV_ERR (1 << 3) -#define SBC_MP_RW_ERR_RECOV_PER (1 << 2) -#define SBC_MP_RW_ERR_RECOV_DTE (1 << 1) -#define SBC_MP_RW_ERR_RECOV_DCR (1 << 0) - uint8_t read_retry_count; - uint8_t correction_span; - uint8_t head_offset_count; - uint8_t data_strobe_offset_count; - uint8_t flags2; - uint8_t write_retry_count; - uint8_t flags3; - be16_t recovery_time_limit; -}; -//@} - -/** - * \brief SBC-2 READ CAPACITY (10) parameter data - */ -struct sbc_read_capacity10_data { - be32_t max_lba; //!< LBA of last logical block - be32_t block_len; //!< Number of bytes in the last logical block -}; - -//@} - -#endif // _SBC_PROTOCOL_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp deleted file mode 100644 index ea2936359d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Interface from Atmel USB MSD to Marlin SD card - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../../../sd/cardreader.h" -extern "C" { -#include "sd_mmc_spi_mem.h" -} - -#define SD_MMC_BLOCK_SIZE 512 - -void sd_mmc_spi_mem_init() { -} - -Ctrl_status sd_mmc_spi_test_unit_ready() { - #ifdef DISABLE_DUE_SD_MMC - return CTRL_NO_PRESENT; - #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; - return CTRL_GOOD; -} - -// 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.isMounted()) - return CTRL_NO_PRESENT; - *nb_sector = card.getSd2Card().cardSize() - 1; - return CTRL_GOOD; -} - -bool sd_mmc_spi_unload(bool) { return true; } - -bool sd_mmc_spi_wr_protect() { return false; } - -bool sd_mmc_spi_removal() { - return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()); -} - -#if ACCESS_USB == true -/** - * \name MEM <-> USB Interface - * @{ - */ - -#include "udi_msc.h" - -COMPILER_WORD_ALIGNED -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) { - #ifdef DISABLE_DUE_SD_MMC - return CTRL_NO_PRESENT; - #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; - - #ifdef DEBUG_MMC - { - char buffer[80]; - sprintf_P(buffer, PSTR("SDRD: %d @ 0x%08x\n"), nb_sector, addr); - PORT_REDIRECT(0); - SERIAL_ECHO(buffer); - } - #endif - - // Start reading - if (!card.getSd2Card().readStart(addr)) - return CTRL_FAIL; - - // For each specified sector - while (nb_sector--) { - - // Read a sector - card.getSd2Card().readData(sector_buf); - - // RAM -> USB - if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) { - card.getSd2Card().readStop(); - return CTRL_FAIL; - } - } - - // Stop reading - card.getSd2Card().readStop(); - - // Done - return CTRL_GOOD; -} - -Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { - #ifdef DISABLE_DUE_SD_MMC - return CTRL_NO_PRESENT; - #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; - - #ifdef DEBUG_MMC - { - char buffer[80]; - sprintf_P(buffer, PSTR("SDWR: %d @ 0x%08x\n"), nb_sector, addr); - PORT_REDIRECT(0); - SERIAL_ECHO(buffer); - } - #endif - - if (!card.getSd2Card().writeStart(addr, nb_sector)) - return CTRL_FAIL; - - // For each specified sector - while (nb_sector--) { - - // USB -> RAM - if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) { - card.getSd2Card().writeStop(); - return CTRL_FAIL; - } - - // Write a sector - card.getSd2Card().writeData(sector_buf); - } - - // Stop writing - card.getSd2Card().writeStop(); - - // Done - return CTRL_GOOD; -} - -#endif // ACCESS_USB == true - -#endif // SDSUPPORT -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h deleted file mode 100644 index 6df82c146b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h +++ /dev/null @@ -1,177 +0,0 @@ -/***************************************************************************** - * - * \file - * - * \brief CTRL_ACCESS interface for SD/MMC card. - * - * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - ******************************************************************************/ -/* - * Support and FAQ: visit Atmel Support - */ - - -#ifndef _SD_MMC_SPI_MEM_H_ -#define _SD_MMC_SPI_MEM_H_ - -/** - * \defgroup group_avr32_components_memory_sd_mmc_sd_mmc_spi_mem SD/MMC SPI Memory - * - * \ingroup group_avr32_components_memory_sd_mmc_sd_mmc_spi - * - * \{ - */ - -#include "conf_access.h" - -#if SD_MMC_SPI_MEM == DISABLE - #error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled -#endif - - -#include "ctrl_access.h" - - -//_____ D E F I N I T I O N S ______________________________________________ - -#define SD_MMC_REMOVED 0 -#define SD_MMC_INSERTED 1 -#define SD_MMC_REMOVING 2 - - -//---- CONTROL FONCTIONS ---- -//! -//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI. -//!/ -extern void sd_mmc_spi_mem_init(void); - -//! -//! @brief This function tests the state of the SD_MMC memory and sends it to the Host. -//! For a PC, this device is seen as a removable media -//! Before indicating any modification of the status of the media (GOOD->NO_PRESENT or vice-versa), -//! the function must return the BUSY data to make the PC accepting the change -//! -//! @return Ctrl_status -//! Media is ready -> CTRL_GOOD -//! Media not present -> CTRL_NO_PRESENT -//! Media has changed -> CTRL_BUSY -//!/ -extern Ctrl_status sd_mmc_spi_test_unit_ready(void); - -//! -//! @brief This function gives the address of the last valid sector. -//! -//! @param *nb_sector number of sector (sector = 512B). OUT -//! -//! @return Ctrl_status -//! Media ready -> CTRL_GOOD -//! Media not present -> CTRL_NO_PRESENT -//!/ -extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); - -/*! \brief Unload/Load the SD/MMC card selected - * - * The START STOP UNIT SCSI optional command allows an application client to - * eject the removable medium on a LUN. - * - * \param unload \c true to unload the medium, \c false to load the medium. - * - * \return \c true if unload/load done success. - */ -extern bool sd_mmc_spi_unload(bool unload); - -//! -//! @brief This function returns the write protected status of the memory. -//! -//! Only used by memory removal with a HARDWARE SPECIFIC write protected detection -//! ! The user must unplug the memory to change this write protected status, -//! which cannot be for a SD_MMC. -//! -//! @return false -> the memory is not write-protected (always) -//!/ -extern bool sd_mmc_spi_wr_protect(void); - -//! -//! @brief This function tells if the memory has been removed or not. -//! -//! @return false -> The memory isn't removed -//! -extern bool sd_mmc_spi_removal(void); - - -//---- ACCESS DATA FONCTIONS ---- - -#if ACCESS_USB == true -// Standard functions for open in read/write mode the device - -//! -//! @brief This function performs a read operation of n sectors from a given address on. -//! (sector = 512B) -//! -//! DATA FLOW is: SD_MMC => USB -//! -//! @param addr Sector address to start the read from -//! @param nb_sector Number of sectors to transfer -//! -//! @return Ctrl_status -//! It is ready -> CTRL_GOOD -//! A error occur -> CTRL_FAIL -//! -extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); - -//! This function initializes the SD/MMC memory for a write operation -//! -//! DATA FLOW is: USB => SD_MMC -//! -//! (sector = 512B) -//! @param addr Sector address to start write -//! @param nb_sector Number of sectors to transfer -//! -//! @return Ctrl_status -//! It is ready -> CTRL_GOOD -//! An error occurs -> CTRL_FAIL -//! -extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); - -#endif // #if ACCESS_USB == true - -/** - * \} - */ - -#endif // _SD_MMC_SPI_MEM_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h deleted file mode 100644 index 6fadb9f36c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h +++ /dev/null @@ -1,337 +0,0 @@ -/** - * \file - * - * \brief SCSI Primary Commands - * - * This file contains definitions of some of the commands found in the - * SPC-2 standard. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ - -/* - * Support and FAQ: visit Atmel Support - */ -#ifndef _SPC_PROTOCOL_H_ -#define _SPC_PROTOCOL_H_ - -/** - * \ingroup usb_msc_protocol - * \defgroup usb_spc_protocol SCSI Primary Commands protocol definitions - * - * @{ - */ - -//! \name SCSI commands defined by SPC-2 -//@{ -#define SPC_TEST_UNIT_READY 0x00 -#define SPC_REQUEST_SENSE 0x03 -#define SPC_INQUIRY 0x12 -#define SPC_MODE_SELECT6 0x15 -#define SPC_MODE_SENSE6 0x1A -#define SPC_SEND_DIAGNOSTIC 0x1D -#define SPC_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E -#define SPC_MODE_SENSE10 0x5A -#define SPC_REPORT_LUNS 0xA0 -//@} - -//! \brief May be set in byte 0 of the INQUIRY CDB -//@{ -//! Enable Vital Product Data -#define SCSI_INQ_REQ_EVPD 0x01 -//! Command Support Data specified by the PAGE OR OPERATION CODE field -#define SCSI_INQ_REQ_CMDT 0x02 -//@} - -COMPILER_PACK_SET(1) - -/** - * \brief SCSI Standard Inquiry data structure - */ -struct scsi_inquiry_data { - uint8_t pq_pdt; //!< Peripheral Qual / Peripheral Dev Type -#define SCSI_INQ_PQ_CONNECTED 0x00 //!< Peripheral connected -#define SCSI_INQ_PQ_NOT_CONN 0x20 //!< Peripheral not connected -#define SCSI_INQ_PQ_NOT_SUPP 0x60 //!< Peripheral not supported -#define SCSI_INQ_DT_DIR_ACCESS 0x00 //!< Direct Access (SBC) -#define SCSI_INQ_DT_SEQ_ACCESS 0x01 //!< Sequential Access -#define SCSI_INQ_DT_PRINTER 0x02 //!< Printer -#define SCSI_INQ_DT_PROCESSOR 0x03 //!< Processor device -#define SCSI_INQ_DT_WRITE_ONCE 0x04 //!< Write-once device -#define SCSI_INQ_DT_CD_DVD 0x05 //!< CD/DVD device -#define SCSI_INQ_DT_OPTICAL 0x07 //!< Optical Memory -#define SCSI_INQ_DT_MC 0x08 //!< Medium Changer -#define SCSI_INQ_DT_ARRAY 0x0C //!< Storage Array Controller -#define SCSI_INQ_DT_ENCLOSURE 0x0D //!< Enclosure Services -#define SCSI_INQ_DT_RBC 0x0E //!< Simplified Direct Access -#define SCSI_INQ_DT_OCRW 0x0F //!< Optical card reader/writer -#define SCSI_INQ_DT_BCC 0x10 //!< Bridge Controller Commands -#define SCSI_INQ_DT_OSD 0x11 //!< Object-based Storage -#define SCSI_INQ_DT_NONE 0x1F //!< No Peripheral - uint8_t flags1; //!< Flags (byte 1) -#define SCSI_INQ_RMB 0x80 //!< Removable Medium - uint8_t version; //!< Version -#define SCSI_INQ_VER_NONE 0x00 //!< No standards conformance -#define SCSI_INQ_VER_SPC 0x03 //!< SCSI Primary Commands (link to SBC) -#define SCSI_INQ_VER_SPC2 0x04 //!< SCSI Primary Commands - 2 (link to SBC-2) -#define SCSI_INQ_VER_SPC3 0x05 //!< SCSI Primary Commands - 3 (link to SBC-2) -#define SCSI_INQ_VER_SPC4 0x06 //!< SCSI Primary Commands - 4 (link to SBC-3) - uint8_t flags3; //!< Flags (byte 3) -#define SCSI_INQ_NORMACA 0x20 //!< Normal ACA Supported -#define SCSI_INQ_HISUP 0x10 //!< Hierarchal LUN addressing -#define SCSI_INQ_RSP_SPC2 0x02 //!< SPC-2 / SPC-3 response format - uint8_t addl_len; //!< Additional Length (n-4) -#define SCSI_INQ_ADDL_LEN(tot) ((tot)-5) //!< Total length is \a tot - uint8_t flags5; //!< Flags (byte 5) -#define SCSI_INQ_SCCS 0x80 - uint8_t flags6; //!< Flags (byte 6) -#define SCSI_INQ_BQUE 0x80 -#define SCSI_INQ_ENCSERV 0x40 -#define SCSI_INQ_MULTIP 0x10 -#define SCSI_INQ_MCHGR 0x08 -#define SCSI_INQ_ADDR16 0x01 - uint8_t flags7; //!< Flags (byte 7) -#define SCSI_INQ_WBUS16 0x20 -#define SCSI_INQ_SYNC 0x10 -#define SCSI_INQ_LINKED 0x08 -#define SCSI_INQ_CMDQUE 0x02 - uint8_t vendor_id[8]; //!< T10 Vendor Identification - uint8_t product_id[16]; //!< Product Identification - uint8_t product_rev[4]; //!< Product Revision Level -}; - -/** - * \brief SCSI Standard Request sense data structure - */ -struct scsi_request_sense_data { - /* 1st byte: REQUEST SENSE response flags*/ - uint8_t valid_reponse_code; -#define SCSI_SENSE_VALID 0x80 //!< Indicates the INFORMATION field contains valid information -#define SCSI_SENSE_RESPONSE_CODE_MASK 0x7F -#define SCSI_SENSE_CURRENT 0x70 //!< Response code 70h (current errors) -#define SCSI_SENSE_DEFERRED 0x71 - - /* 2nd byte */ - uint8_t obsolete; - - /* 3rd byte */ - uint8_t sense_flag_key; -#define SCSI_SENSE_FILEMARK 0x80 //!< Indicates that the current command has read a filemark or setmark. -#define SCSI_SENSE_EOM 0x40 //!< Indicates that an end-of-medium condition exists. -#define SCSI_SENSE_ILI 0x20 //!< Indicates that the requested logical block length did not match the logical block length of the data on the medium. -#define SCSI_SENSE_RESERVED 0x10 //!< Reserved -#define SCSI_SENSE_KEY(x) (x&0x0F) //!< Sense Key - - /* 4th to 7th bytes - INFORMATION field */ - uint8_t information[4]; - - /* 8th byte - ADDITIONAL SENSE LENGTH field */ - uint8_t AddSenseLen; -#define SCSI_SENSE_ADDL_LEN(total_len) ((total_len) - 8) - - /* 9th to 12th byte - COMMAND-SPECIFIC INFORMATION field */ - uint8_t CmdSpecINFO[4]; - - /* 13th byte - ADDITIONAL SENSE CODE field */ - uint8_t AddSenseCode; - - /* 14th byte - ADDITIONAL SENSE CODE QUALIFIER field */ - uint8_t AddSnsCodeQlfr; - - /* 15th byte - FIELD REPLACEABLE UNIT CODE field */ - uint8_t FldReplUnitCode; - - /* 16th byte */ - uint8_t SenseKeySpec[3]; -#define SCSI_SENSE_SKSV 0x80 //!< Indicates the SENSE-KEY SPECIFIC field contains valid information -}; - -COMPILER_PACK_RESET() - -/* Vital Product Data page codes */ -enum scsi_vpd_page_code { - SCSI_VPD_SUPPORTED_PAGES = 0x00, - SCSI_VPD_UNIT_SERIAL_NUMBER = 0x80, - SCSI_VPD_DEVICE_IDENTIFICATION = 0x83, -}; -#define SCSI_VPD_HEADER_SIZE 4 - -/* Constants associated with the Device Identification VPD page */ -#define SCSI_VPD_ID_HEADER_SIZE 4 - -#define SCSI_VPD_CODE_SET_BINARY 1 -#define SCSI_VPD_CODE_SET_ASCII 2 -#define SCSI_VPD_CODE_SET_UTF8 3 - -#define SCSI_VPD_ID_TYPE_T10 1 - - -/* Sense keys */ -enum scsi_sense_key { - SCSI_SK_NO_SENSE = 0x0, - SCSI_SK_RECOVERED_ERROR = 0x1, - SCSI_SK_NOT_READY = 0x2, - SCSI_SK_MEDIUM_ERROR = 0x3, - SCSI_SK_HARDWARE_ERROR = 0x4, - SCSI_SK_ILLEGAL_REQUEST = 0x5, - SCSI_SK_UNIT_ATTENTION = 0x6, - SCSI_SK_DATA_PROTECT = 0x7, - SCSI_SK_BLANK_CHECK = 0x8, - SCSI_SK_VENDOR_SPECIFIC = 0x9, - SCSI_SK_COPY_ABORTED = 0xA, - SCSI_SK_ABORTED_COMMAND = 0xB, - SCSI_SK_VOLUME_OVERFLOW = 0xD, - SCSI_SK_MISCOMPARE = 0xE, -}; - -/* Additional Sense Code / Additional Sense Code Qualifier pairs */ -enum scsi_asc_ascq { - SCSI_ASC_NO_ADDITIONAL_SENSE_INFO = 0x0000, - SCSI_ASC_LU_NOT_READY_REBUILD_IN_PROGRESS = 0x0405, - SCSI_ASC_WRITE_ERROR = 0x0C00, - SCSI_ASC_UNRECOVERED_READ_ERROR = 0x1100, - SCSI_ASC_INVALID_COMMAND_OPERATION_CODE = 0x2000, - SCSI_ASC_INVALID_FIELD_IN_CDB = 0x2400, - SCSI_ASC_WRITE_PROTECTED = 0x2700, - SCSI_ASC_NOT_READY_TO_READY_CHANGE = 0x2800, - SCSI_ASC_MEDIUM_NOT_PRESENT = 0x3A00, - SCSI_ASC_INTERNAL_TARGET_FAILURE = 0x4400, -}; - -/** - * \brief SPC-2 Mode parameter - * This subclause describes the block descriptors and the pages - * used with MODE SELECT and MODE SENSE commands - * that are applicable to all SCSI devices. - */ -enum scsi_spc_mode { - SCSI_MS_MODE_VENDOR_SPEC = 0x00, - SCSI_MS_MODE_INFEXP = 0x1C, // Informational exceptions control page - SCSI_MS_MODE_ALL = 0x3F, -}; - -/** - * \brief SPC-2 Informational exceptions control page - * See chapter 8.3.8 - */ -struct spc_control_page_info_execpt { - uint8_t page_code; - uint8_t page_length; -#define SPC_MP_INFEXP_PAGE_LENGTH 0x0A - uint8_t flags1; -#define SPC_MP_INFEXP_PERF (1<<7) //!< Initiator Control -#define SPC_MP_INFEXP_EBF (1<<5) //!< Caching Analysis Permitted -#define SPC_MP_INFEXP_EWASC (1<<4) //!< Discontinuity -#define SPC_MP_INFEXP_DEXCPT (1<<3) //!< Size enable -#define SPC_MP_INFEXP_TEST (1<<2) //!< Writeback Cache Enable -#define SPC_MP_INFEXP_LOGERR (1<<0) //!< Log errors bit - uint8_t mrie; -#define SPC_MP_INFEXP_MRIE_NO_REPORT 0x00 -#define SPC_MP_INFEXP_MRIE_ASYNC_EVENT 0x01 -#define SPC_MP_INFEXP_MRIE_GEN_UNIT 0x02 -#define SPC_MP_INFEXP_MRIE_COND_RECOV_ERROR 0x03 -#define SPC_MP_INFEXP_MRIE_UNCOND_RECOV_ERROR 0x04 -#define SPC_MP_INFEXP_MRIE_NO_SENSE 0x05 -#define SPC_MP_INFEXP_MRIE_ONLY_REPORT 0x06 - be32_t interval_timer; - be32_t report_count; -}; - - -enum scsi_spc_mode_sense_pc { - SCSI_MS_SENSE_PC_CURRENT = 0, - SCSI_MS_SENSE_PC_CHANGEABLE = 1, - SCSI_MS_SENSE_PC_DEFAULT = 2, - SCSI_MS_SENSE_PC_SAVED = 3, -}; - - - -static inline bool scsi_mode_sense_dbd_is_set(const uint8_t * cdb) -{ - return (cdb[1] >> 3) & 1; -} - -static inline uint8_t scsi_mode_sense_get_page_code(const uint8_t * cdb) -{ - return cdb[2] & 0x3F; -} - -static inline uint8_t scsi_mode_sense_get_pc(const uint8_t * cdb) -{ - return cdb[2] >> 6; -} - -/** - * \brief SCSI Mode Parameter Header used by MODE SELECT(6) and MODE - * SENSE(6) - */ -struct scsi_mode_param_header6 { - uint8_t mode_data_length; //!< Number of bytes after this - uint8_t medium_type; //!< Medium Type - uint8_t device_specific_parameter; //!< Defined by command set - uint8_t block_descriptor_length; //!< Length of block descriptors -}; - -/** - * \brief SCSI Mode Parameter Header used by MODE SELECT(10) and MODE - * SENSE(10) - */ -struct scsi_mode_param_header10 { - be16_t mode_data_length; //!< Number of bytes after this - uint8_t medium_type; //!< Medium Type - uint8_t device_specific_parameter; //!< Defined by command set - uint8_t flags4; //!< LONGLBA in bit 0 - uint8_t reserved; - be16_t block_descriptor_length; //!< Length of block descriptors -}; - -/** - * \brief SCSI Page_0 Mode Page header (SPF not set) - */ -struct scsi_mode_page_0_header { - uint8_t page_code; -#define SCSI_PAGE_CODE_PS (1 << 7) //!< Parameters Saveable -#define SCSI_PAGE_CODE_SPF (1 << 6) //!< SubPage Format - uint8_t page_length; //!< Number of bytes after this -#define SCSI_MS_PAGE_LEN(total) ((total) - 2) -}; - -//@} - -#endif // SPC_PROTOCOL_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/stringz.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/stringz.h deleted file mode 100644 index b914b73489..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/stringz.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * \file - * - * \brief Preprocessor stringizing utils. - * - * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _STRINGZ_H_ -#define _STRINGZ_H_ - -/** - * \defgroup group_sam_utils_stringz Preprocessor - Stringize - * - * \ingroup group_sam_utils - * - * \{ - */ - -/*! \brief Stringize. - * - * Stringize a preprocessing token, this token being allowed to be \#defined. - * - * May be used only within macros with the token passed as an argument if the token is \#defined. - * - * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) - * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to - * writing "A0". - */ -#define STRINGZ(x) #x - -/*! \brief Absolute stringize. - * - * Stringize a preprocessing token, this token being allowed to be \#defined. - * - * No restriction of use if the token is \#defined. - * - * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is - * equivalent to writing "A0". - */ -#define ASTRINGZ(x) STRINGZ(x) - -/** - * \} - */ - -#endif // _STRINGZ_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.c deleted file mode 100644 index 899244dd88..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.c +++ /dev/null @@ -1,122 +0,0 @@ -/** - * \file - * - * \brief Chip-specific system clock management functions. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "sysclk.h" - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -/** - * \weakgroup sysclk_group - * @{ - */ - -#if defined(CONFIG_USBCLK_SOURCE) || defined(__DOXYGEN__) -/** - * \brief Enable full speed USB clock. - * - * \note The SAM3X PMC hardware interprets div as div+1. For readability the hardware div+1 - * is hidden in this implementation. Use div as div effective value. - * - * \param pll_id Source of the USB clock. - * \param div Actual clock divisor. Must be superior to 0. - */ -void sysclk_enable_usb(void) -{ - Assert(CONFIG_USBCLK_DIV > 0); - -#ifdef CONFIG_PLL0_SOURCE - if (CONFIG_USBCLK_SOURCE == USBCLK_SRC_PLL0) { - struct pll_config pllcfg; - - pll_enable_source(CONFIG_PLL0_SOURCE); - pll_config_defaults(&pllcfg, 0); - pll_enable(&pllcfg, 0); - pll_wait_for_lock(0); - pmc_switch_udpck_to_pllack(CONFIG_USBCLK_DIV - 1); - pmc_enable_udpck(); - return; - } -#endif - - if (CONFIG_USBCLK_SOURCE == USBCLK_SRC_UPLL) { - - pmc_enable_upll_clock(); - pmc_switch_udpck_to_upllck(CONFIG_USBCLK_DIV - 1); - pmc_enable_udpck(); - return; - } -} - -/** - * \brief Disable full speed USB clock. - * - * \note This implementation does not switch off the PLL, it just turns off the USB clock. - */ -void sysclk_disable_usb(void) -{ - pmc_disable_udpck(); -} -#endif // CONFIG_USBCLK_SOURCE - -//! @} - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.h deleted file mode 100644 index 48c99de298..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/sysclk.h +++ /dev/null @@ -1,229 +0,0 @@ -/** - * \file - * - * \brief Chip-specific system clock management functions. - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CHIP_SYSCLK_H_INCLUDED -#define CHIP_SYSCLK_H_INCLUDED - -#include "osc.h" -#include "pll.h" - -/** - * \page sysclk_quickstart Quick Start Guide for the System Clock Management service (SAM3A) - * - * This is the quick start guide for the \ref sysclk_group "System Clock Management" - * service, with step-by-step instructions on how to configure and use the service for - * specific use cases. - * - * \section sysclk_quickstart_usecases System Clock Management use cases - * - \ref sysclk_quickstart_basic - * - * \section sysclk_quickstart_basic Basic usage of the System Clock Management service - * This section will present a basic use case for the System Clock Management service. - * This use case will configure the main system clock to 84MHz, using an internal PLL - * module to multiply the frequency of a crystal attached to the microcontroller. - * - * \subsection sysclk_quickstart_use_case_1_prereq Prerequisites - * - None - * - * \subsection sysclk_quickstart_use_case_1_setup_steps Initialization code - * Add to the application initialization code: - * \code - sysclk_init(); -\endcode - * - * \subsection sysclk_quickstart_use_case_1_setup_steps_workflow Workflow - * -# Configure the system clocks according to the settings in conf_clock.h: - * \code sysclk_init(); \endcode - * - * \subsection sysclk_quickstart_use_case_1_example_code Example code - * Add or uncomment the following in your conf_clock.h header file, commenting out all other - * definitions of the same symbol(s): - * \code - #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK - - // Fpll0 = (Fclk * PLL_mul) / PLL_div - #define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_XTAL - #define CONFIG_PLL0_MUL (84000000UL / BOARD_FREQ_MAINCK_XTAL) - #define CONFIG_PLL0_DIV 1 - - // Fbus = Fsys / BUS_div - #define CONFIG_SYSCLK_PRES SYSCLK_PRES_1 -\endcode - * - * \subsection sysclk_quickstart_use_case_1_example_workflow Workflow - * -# Configure the main system clock to use the output of the PLL module as its source: - * \code #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK \endcode - * -# Configure the PLL module to use the fast external fast crystal oscillator as its source: - * \code #define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_XTAL \endcode - * -# Configure the PLL module to multiply the external fast crystal oscillator frequency up to 84MHz: - * \code - #define CONFIG_PLL0_MUL (84000000UL / BOARD_FREQ_MAINCK_XTAL) - #define CONFIG_PLL0_DIV 1 -\endcode - * \note For user boards, \c BOARD_FREQ_MAINCK_XTAL should be defined in the board \c conf_board.h configuration - * file as the frequency of the fast crystal attached to the microcontroller. - * -# Configure the main clock to run at the full 84MHz, disable scaling of the main system clock speed: - * \code - #define CONFIG_SYSCLK_PRES SYSCLK_PRES_1 -\endcode - * \note Some dividers are powers of two, while others are integer division factors. Refer to the - * formulas in the conf_clock.h template commented above each division define. - */ - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -/** - * \weakgroup sysclk_group - * @{ - */ - -//! \name Configuration Symbols -//@{ -/** - * \def CONFIG_SYSCLK_SOURCE - * \brief Initial/static main system clock source - * - * The main system clock will be configured to use this clock during - * initialization. - */ -#ifndef CONFIG_SYSCLK_SOURCE -# define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_4M_RC -#endif -/** - * \def CONFIG_SYSCLK_PRES - * \brief Initial CPU clock divider (mck) - * - * The MCK will run at - * \f[ - * f_{MCK} = \frac{f_{sys}}{\mathrm{CONFIG\_SYSCLK\_PRES}}\,\mbox{Hz} - * \f] - * after initialization. - */ -#ifndef CONFIG_SYSCLK_PRES -# define CONFIG_SYSCLK_PRES 0 -#endif - -//@} - -//! \name Master Clock Sources (MCK) -//@{ -#define SYSCLK_SRC_SLCK_RC 0 //!< Internal 32kHz RC oscillator as master source clock -#define SYSCLK_SRC_SLCK_XTAL 1 //!< External 32kHz crystal oscillator as master source clock -#define SYSCLK_SRC_SLCK_BYPASS 2 //!< External 32kHz bypass oscillator as master source clock -#define SYSCLK_SRC_MAINCK_4M_RC 3 //!< Internal 4MHz RC oscillator as master source clock -#define SYSCLK_SRC_MAINCK_8M_RC 4 //!< Internal 8MHz RC oscillator as master source clock -#define SYSCLK_SRC_MAINCK_12M_RC 5 //!< Internal 12MHz RC oscillator as master source clock -#define SYSCLK_SRC_MAINCK_XTAL 6 //!< External crystal oscillator as master source clock -#define SYSCLK_SRC_MAINCK_BYPASS 7 //!< External bypass oscillator as master source clock -#define SYSCLK_SRC_PLLACK 8 //!< Use PLLACK as master source clock -#define SYSCLK_SRC_UPLLCK 9 //!< Use UPLLCK as master source clock -//@} - -//! \name Master Clock Prescalers (MCK) -//@{ -#define SYSCLK_PRES_1 PMC_MCKR_PRES_CLK_1 //!< Set master clock prescaler to 1 -#define SYSCLK_PRES_2 PMC_MCKR_PRES_CLK_2 //!< Set master clock prescaler to 2 -#define SYSCLK_PRES_4 PMC_MCKR_PRES_CLK_4 //!< Set master clock prescaler to 4 -#define SYSCLK_PRES_8 PMC_MCKR_PRES_CLK_8 //!< Set master clock prescaler to 8 -#define SYSCLK_PRES_16 PMC_MCKR_PRES_CLK_16 //!< Set master clock prescaler to 16 -#define SYSCLK_PRES_32 PMC_MCKR_PRES_CLK_32 //!< Set master clock prescaler to 32 -#define SYSCLK_PRES_64 PMC_MCKR_PRES_CLK_64 //!< Set master clock prescaler to 64 -#define SYSCLK_PRES_3 PMC_MCKR_PRES_CLK_3 //!< Set master clock prescaler to 3 -//@} - -//! \name USB Clock Sources -//@{ -#define USBCLK_SRC_PLL0 0 //!< Use PLLA -#define USBCLK_SRC_UPLL 1 //!< Use UPLL -//@} - -/** - * \def CONFIG_USBCLK_SOURCE - * \brief Configuration symbol for the USB generic clock source - * - * Sets the clock source to use for the USB. The source must also be properly - * configured. - * - * Define this to one of the \c USBCLK_SRC_xxx settings. Leave it undefined if - * USB is not required. - */ -#ifdef __DOXYGEN__ -# define CONFIG_USBCLK_SOURCE -#endif - -/** - * \def CONFIG_USBCLK_DIV - * \brief Configuration symbol for the USB generic clock divider setting - * - * Sets the clock division for the USB generic clock. If a USB clock source is - * selected with CONFIG_USBCLK_SOURCE, this configuration symbol must also be - * defined. - */ -#ifdef __DOXYGEN__ -# define CONFIG_USBCLK_DIV -#endif - - -extern void sysclk_enable_usb(void); -extern void sysclk_disable_usb(void); - -//! @} - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif /* CHIP_SYSCLK_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/tpaste.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/tpaste.h deleted file mode 100644 index f8ec44a41d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/tpaste.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * \file - * - * \brief Preprocessor token pasting utils. - * - * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _TPASTE_H_ -#define _TPASTE_H_ - -/** - * \defgroup group_sam_utils_tpaste Preprocessor - Token Paste - * - * \ingroup group_sam_utils - * - * \{ - */ - -/*! \name Token Paste - * - * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. - * - * May be used only within macros with the tokens passed as arguments if the tokens are \#defined. - * - * For example, writing TPASTE2(U, WIDTH) within a macro \#defined by - * UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is - * equivalent to writing U32. - */ -//! @{ -#define TPASTE2( a, b) a##b -#define TPASTE3( a, b, c) a##b##c -#define TPASTE4( a, b, c, d) a##b##c##d -#define TPASTE5( a, b, c, d, e) a##b##c##d##e -#define TPASTE6( a, b, c, d, e, f) a##b##c##d##e##f -#define TPASTE7( a, b, c, d, e, f, g) a##b##c##d##e##f##g -#define TPASTE8( a, b, c, d, e, f, g, h) a##b##c##d##e##f##g##h -#define TPASTE9( a, b, c, d, e, f, g, h, i) a##b##c##d##e##f##g##h##i -#define TPASTE10(a, b, c, d, e, f, g, h, i, j) a##b##c##d##e##f##g##h##i##j -//! @} - -/*! \name Absolute Token Paste - * - * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. - * - * No restriction of use if the tokens are \#defined. - * - * For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined - * as 32 is equivalent to writing U32. - */ -//! @{ -#define ATPASTE2( a, b) TPASTE2( a, b) -#define ATPASTE3( a, b, c) TPASTE3( a, b, c) -#define ATPASTE4( a, b, c, d) TPASTE4( a, b, c, d) -#define ATPASTE5( a, b, c, d, e) TPASTE5( a, b, c, d, e) -#define ATPASTE6( a, b, c, d, e, f) TPASTE6( a, b, c, d, e, f) -#define ATPASTE7( a, b, c, d, e, f, g) TPASTE7( a, b, c, d, e, f, g) -#define ATPASTE8( a, b, c, d, e, f, g, h) TPASTE8( a, b, c, d, e, f, g, h) -#define ATPASTE9( a, b, c, d, e, f, g, h, i) TPASTE9( a, b, c, d, e, f, g, h, i) -#define ATPASTE10(a, b, c, d, e, f, g, h, i, j) TPASTE10(a, b, c, d, e, f, g, h, i, j) -//! @} - -/** - * \} - */ - -#endif // _TPASTE_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.c deleted file mode 100644 index 048a902d3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.c +++ /dev/null @@ -1,1149 +0,0 @@ -/** - * \file - * - * \brief USB Device Controller (UDC) - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "udd.h" -#include "udc_desc.h" -#include "udi.h" -#include "udc.h" - -/** - * \ingroup udc_group - * \defgroup udc_group_interne Implementation of UDC - * - * Internal implementation - * @{ - */ - -//! \name Internal variables to manage the USB device -//! @{ - -//! Device status state (see enum usb_device_status in usb_protocol.h) -static le16_t udc_device_status; - -COMPILER_WORD_ALIGNED -//! Device interface setting value -static uint8_t udc_iface_setting = 0; - -//! Device Configuration number selected by the USB host -COMPILER_WORD_ALIGNED -static uint8_t udc_num_configuration = 0; - -//! Pointer on the selected speed device configuration -static udc_config_speed_t UDC_DESC_STORAGE *udc_ptr_conf; - -//! Pointer on interface descriptor used by SETUP request. -static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface; - -//! @} - - -//! \name Internal structure to store the USB device main strings -//! @{ - -/** - * \brief Language ID of USB device (US ID by default) - */ -COMPILER_WORD_ALIGNED -static UDC_DESC_STORAGE usb_str_lgid_desc_t udc_string_desc_languageid = { - .desc.bLength = sizeof(usb_str_lgid_desc_t), - .desc.bDescriptorType = USB_DT_STRING, - .string = {LE16(USB_LANGID_EN_US)} -}; - -/** - * \brief USB device manufacture name storage - * String is allocated only if USB_DEVICE_MANUFACTURE_NAME is declared - * by usb application configuration - */ -#ifdef USB_DEVICE_MANUFACTURE_NAME -static uint8_t udc_string_manufacturer_name[] = USB_DEVICE_MANUFACTURE_NAME; -# define USB_DEVICE_MANUFACTURE_NAME_SIZE \ - (sizeof(udc_string_manufacturer_name)-1) -#else -# define USB_DEVICE_MANUFACTURE_NAME_SIZE 0 -#endif - -/** - * \brief USB device product name storage - * String is allocated only if USB_DEVICE_PRODUCT_NAME is declared - * by usb application configuration - */ -#ifdef USB_DEVICE_PRODUCT_NAME -static uint8_t udc_string_product_name[] = USB_DEVICE_PRODUCT_NAME; -# define USB_DEVICE_PRODUCT_NAME_SIZE (sizeof(udc_string_product_name)-1) -#else -# define USB_DEVICE_PRODUCT_NAME_SIZE 0 -#endif - -/** - * \brief Get USB device serial number - * - * Use the define USB_DEVICE_SERIAL_NAME to set static serial number. - * - * For dynamic serial number set the define USB_DEVICE_GET_SERIAL_NAME_POINTER - * to a suitable pointer. This will also require the serial number length - * define USB_DEVICE_GET_SERIAL_NAME_LENGTH. - */ -#if defined USB_DEVICE_GET_SERIAL_NAME_POINTER - static const uint8_t *udc_get_string_serial_name(void) - { - return (const uint8_t *)USB_DEVICE_GET_SERIAL_NAME_POINTER; - } -# define USB_DEVICE_SERIAL_NAME_SIZE \ - USB_DEVICE_GET_SERIAL_NAME_LENGTH -#elif defined USB_DEVICE_SERIAL_NAME - static const uint8_t *udc_get_string_serial_name(void) - { - return (const uint8_t *)USB_DEVICE_SERIAL_NAME; - } -# define USB_DEVICE_SERIAL_NAME_SIZE \ - (sizeof(USB_DEVICE_SERIAL_NAME)-1) -#else -# define USB_DEVICE_SERIAL_NAME_SIZE 0 -#endif - -/** - * \brief USB device string descriptor - * Structure used to transfer ASCII strings to USB String descriptor structure. - */ -struct udc_string_desc_t { - usb_str_desc_t header; - le16_t string[Max(Max(USB_DEVICE_MANUFACTURE_NAME_SIZE, \ - USB_DEVICE_PRODUCT_NAME_SIZE), USB_DEVICE_SERIAL_NAME_SIZE)]; -}; -COMPILER_WORD_ALIGNED -static UDC_DESC_STORAGE struct udc_string_desc_t udc_string_desc = { - .header.bDescriptorType = USB_DT_STRING -}; -//! @} - -usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) -{ - return udc_ptr_iface; -} - -/** - * \brief Returns a value to check the end of USB Configuration descriptor - * - * \return address after the last byte of USB Configuration descriptor - */ -static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) -{ - return (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) - udc_ptr_conf->desc + - le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); -} - -#if (0!=USB_DEVICE_MAX_EP) -/** - * \brief Search specific descriptor in global interface descriptor - * - * \param desc Address of interface descriptor - * or previous specific descriptor found - * \param desc_id Descriptor ID to search - * - * \return address of specific descriptor found - * \return NULL if it is the end of global interface descriptor - */ -static usb_conf_desc_t UDC_DESC_STORAGE *udc_next_desc_in_iface(usb_conf_desc_t - UDC_DESC_STORAGE * desc, uint8_t desc_id) -{ - usb_conf_desc_t UDC_DESC_STORAGE *ptr_eof_desc; - - ptr_eof_desc = udc_get_eof_conf(); - // Go to next descriptor - desc = (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) desc + - desc->bLength); - // Check the end of configuration descriptor - while (ptr_eof_desc > desc) { - // If new interface descriptor is found, - // then it is the end of the current global interface descriptor - if (USB_DT_INTERFACE == desc->bDescriptorType) { - break; // End of global interface descriptor - } - if (desc_id == desc->bDescriptorType) { - return desc; // Specific descriptor found - } - // Go to next descriptor - desc = (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) desc + - desc->bLength); - } - return NULL; // No specific descriptor found -} -#endif - -/** - * \brief Search an interface descriptor - * This routine updates the internal pointer udc_ptr_iface. - * - * \param iface_num Interface number to find in Configuration Descriptor - * \param setting_num Setting number of interface to find - * - * \return 1 if found or 0 if not found - */ -static bool udc_update_iface_desc(uint8_t iface_num, uint8_t setting_num) -{ - usb_conf_desc_t UDC_DESC_STORAGE *ptr_end_desc; - - if (0 == udc_num_configuration) { - return false; - } - - if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { - return false; - } - - // Start at the beginning of configuration descriptor - udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *) - udc_ptr_conf->desc; - - // Check the end of configuration descriptor - ptr_end_desc = udc_get_eof_conf(); - while (ptr_end_desc > - (UDC_DESC_STORAGE usb_conf_desc_t *) udc_ptr_iface) { - if (USB_DT_INTERFACE == udc_ptr_iface->bDescriptorType) { - // A interface descriptor is found - // Check interface and alternate setting number - if ((iface_num == udc_ptr_iface->bInterfaceNumber) && - (setting_num == - udc_ptr_iface->bAlternateSetting)) { - return true; // Interface found - } - } - // Go to next descriptor - udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *) ( - (uint8_t *) udc_ptr_iface + - udc_ptr_iface->bLength); - } - return false; // Interface not found -} - -/** - * \brief Disables an usb device interface (UDI) - * This routine call the UDI corresponding to interface number - * - * \param iface_num Interface number to disable - * - * \return 1 if it is done or 0 if interface is not found - */ -static bool udc_iface_disable(uint8_t iface_num) -{ - udi_api_t UDC_DESC_STORAGE *udi_api; - - // Select first alternate setting of the interface - // to update udc_ptr_iface before call iface->getsetting() - if (!udc_update_iface_desc(iface_num, 0)) { - return false; - } - - // Select the interface with the current alternate setting - udi_api = udc_ptr_conf->udi_apis[iface_num]; - -#if (0!=USB_DEVICE_MAX_EP) - if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { - return false; - } - - // Start at the beginning of interface descriptor - { - usb_ep_desc_t UDC_DESC_STORAGE *ep_desc; - ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) udc_ptr_iface; - while (1) { - // Search Endpoint descriptor included in global interface descriptor - ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) - udc_next_desc_in_iface((UDC_DESC_STORAGE - usb_conf_desc_t *) - ep_desc, USB_DT_ENDPOINT); - if (NULL == ep_desc) { - break; - } - // Free the endpoint used by the interface - udd_ep_free(ep_desc->bEndpointAddress); - } - } -#endif - - // Disable interface - udi_api->disable(); - return true; -} - -/** - * \brief Enables an usb device interface (UDI) - * This routine calls the UDI corresponding - * to the interface and setting number. - * - * \param iface_num Interface number to enable - * \param setting_num Setting number to enable - * - * \return 1 if it is done or 0 if interface is not found - */ -static bool udc_iface_enable(uint8_t iface_num, uint8_t setting_num) -{ - // Select the interface descriptor - if (!udc_update_iface_desc(iface_num, setting_num)) { - return false; - } - -#if (0!=USB_DEVICE_MAX_EP) - usb_ep_desc_t UDC_DESC_STORAGE *ep_desc; - - // Start at the beginning of the global interface descriptor - ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) udc_ptr_iface; - while (1) { - // Search Endpoint descriptor included in the global interface descriptor - ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) - udc_next_desc_in_iface((UDC_DESC_STORAGE - usb_conf_desc_t *) ep_desc, - USB_DT_ENDPOINT); - if (NULL == ep_desc) - break; - // Alloc the endpoint used by the interface - if (!udd_ep_alloc(ep_desc->bEndpointAddress, - ep_desc->bmAttributes, - le16_to_cpu - (ep_desc->wMaxPacketSize))) { - return false; - } - } -#endif - // Enable the interface - return udc_ptr_conf->udi_apis[iface_num]->enable(); -} - -/*! \brief Start the USB Device stack - */ -void udc_start(void) -{ - udd_enable(); -} - -/*! \brief Stop the USB Device stack - */ -void udc_stop(void) -{ - udd_disable(); - udc_reset(); -} - -/** - * \brief Reset the current configuration of the USB device, - * This routines can be called by UDD when a RESET on the USB line occurs. - */ -void udc_reset(void) -{ - uint8_t iface_num; - - if (udc_num_configuration) { - for (iface_num = 0; - iface_num < udc_ptr_conf->desc->bNumInterfaces; - iface_num++) { - udc_iface_disable(iface_num); - } - } - udc_num_configuration = 0; -#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ - == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) - if (CPU_TO_LE16(USB_DEV_STATUS_REMOTEWAKEUP) & udc_device_status) { - // Remote wakeup is enabled then disable it - UDC_REMOTEWAKEUP_DISABLE(); - } -#endif - udc_device_status = -#if (USB_DEVICE_ATTR & USB_CONFIG_ATTR_SELF_POWERED) - CPU_TO_LE16(USB_DEV_STATUS_SELF_POWERED); -#else - CPU_TO_LE16(USB_DEV_STATUS_BUS_POWERED); -#endif -} - -void udc_sof_notify(void) -{ - uint8_t iface_num; - - if (udc_num_configuration) { - for (iface_num = 0; - iface_num < udc_ptr_conf->desc->bNumInterfaces; - iface_num++) { - if (udc_ptr_conf->udi_apis[iface_num]->sof_notify != NULL) { - udc_ptr_conf->udi_apis[iface_num]->sof_notify(); - } - } - } -} - -/** - * \brief Standard device request to get device status - * - * \return true if success - */ -static bool udc_req_std_dev_get_status(void) -{ - if (udd_g_ctrlreq.req.wLength != sizeof(udc_device_status)) { - return false; - } - - udd_set_setup_payload( (uint8_t *) & udc_device_status, - sizeof(udc_device_status)); - return true; -} - -#if (0!=USB_DEVICE_MAX_EP) -/** - * \brief Standard endpoint request to get endpoint status - * - * \return true if success - */ -static bool udc_req_std_ep_get_status(void) -{ - static le16_t udc_ep_status; - - if (udd_g_ctrlreq.req.wLength != sizeof(udc_ep_status)) { - return false; - } - - udc_ep_status = udd_ep_is_halted(udd_g_ctrlreq.req. - wIndex & 0xFF) ? CPU_TO_LE16(USB_EP_STATUS_HALTED) : 0; - - udd_set_setup_payload( (uint8_t *) & udc_ep_status, - sizeof(udc_ep_status)); - return true; -} -#endif - -/** - * \brief Standard device request to change device status - * - * \return true if success - */ -static bool udc_req_std_dev_clear_feature(void) -{ - if (udd_g_ctrlreq.req.wLength) { - return false; - } - - if (udd_g_ctrlreq.req.wValue == USB_DEV_FEATURE_REMOTE_WAKEUP) { - udc_device_status &= CPU_TO_LE16(~(uint32_t)USB_DEV_STATUS_REMOTEWAKEUP); -#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ - == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) - UDC_REMOTEWAKEUP_DISABLE(); -#endif - return true; - } - return false; -} - -#if (0!=USB_DEVICE_MAX_EP) -/** - * \brief Standard endpoint request to clear endpoint feature - * - * \return true if success - */ -static bool udc_req_std_ep_clear_feature(void) -{ - if (udd_g_ctrlreq.req.wLength) { - return false; - } - - if (udd_g_ctrlreq.req.wValue == USB_EP_FEATURE_HALT) { - return udd_ep_clear_halt(udd_g_ctrlreq.req.wIndex & 0xFF); - } - return false; -} -#endif - -/** - * \brief Standard device request to set a feature - * - * \return true if success - */ -static bool udc_req_std_dev_set_feature(void) -{ - if (udd_g_ctrlreq.req.wLength) { - return false; - } - - switch (udd_g_ctrlreq.req.wValue) { - - case USB_DEV_FEATURE_REMOTE_WAKEUP: -#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ - == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) - udc_device_status |= CPU_TO_LE16(USB_DEV_STATUS_REMOTEWAKEUP); - UDC_REMOTEWAKEUP_ENABLE(); - return true; -#else - return false; -#endif - -#ifdef USB_DEVICE_HS_SUPPORT - case USB_DEV_FEATURE_TEST_MODE: - if (!udd_is_high_speed()) { - break; - } - if (udd_g_ctrlreq.req.wIndex & 0xFF) { - break; - } - // Unconfigure the device, terminating all ongoing requests - udc_reset(); - switch ((udd_g_ctrlreq.req.wIndex >> 8) & 0xFF) { - case USB_DEV_TEST_MODE_J: - udd_g_ctrlreq.callback = udd_test_mode_j; - return true; - - case USB_DEV_TEST_MODE_K: - udd_g_ctrlreq.callback = udd_test_mode_k; - return true; - - case USB_DEV_TEST_MODE_SE0_NAK: - udd_g_ctrlreq.callback = udd_test_mode_se0_nak; - return true; - - case USB_DEV_TEST_MODE_PACKET: - udd_g_ctrlreq.callback = udd_test_mode_packet; - return true; - - case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports - default: - break; - } - break; -#endif - default: - break; - } - return false; -} - -/** - * \brief Standard endpoint request to halt an endpoint - * - * \return true if success - */ -#if (0!=USB_DEVICE_MAX_EP) -static bool udc_req_std_ep_set_feature(void) -{ - if (udd_g_ctrlreq.req.wLength) { - return false; - } - if (udd_g_ctrlreq.req.wValue == USB_EP_FEATURE_HALT) { - udd_ep_abort(udd_g_ctrlreq.req.wIndex & 0xFF); - return udd_ep_set_halt(udd_g_ctrlreq.req.wIndex & 0xFF); - } - return false; -} -#endif - -/** - * \brief Change the address of device - * Callback called at the end of request set address - */ -static void udc_valid_address(void) -{ - udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); -} - -/** - * \brief Standard device request to set device address - * - * \return true if success - */ -static bool udc_req_std_dev_set_address(void) -{ - if (udd_g_ctrlreq.req.wLength) { - return false; - } - - // The address must be changed at the end of setup request after the handshake - // then we use a callback to change address - udd_g_ctrlreq.callback = udc_valid_address; - return true; -} - -/** - * \brief Standard device request to get device string descriptor - * - * \return true if success - */ -static bool udc_req_std_dev_get_str_desc(void) -{ - uint8_t i; - const uint8_t *str; - uint8_t str_length = 0; - - // Link payload pointer to the string corresponding at request - switch (udd_g_ctrlreq.req.wValue & 0xFF) { - case 0: - udd_set_setup_payload((uint8_t *) &udc_string_desc_languageid, - sizeof(udc_string_desc_languageid)); - break; - -#ifdef USB_DEVICE_MANUFACTURE_NAME - case 1: - str_length = USB_DEVICE_MANUFACTURE_NAME_SIZE; - str = udc_string_manufacturer_name; - break; -#endif -#ifdef USB_DEVICE_PRODUCT_NAME - case 2: - str_length = USB_DEVICE_PRODUCT_NAME_SIZE; - str = udc_string_product_name; - break; -#endif -#if defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER - case 3: - str_length = USB_DEVICE_SERIAL_NAME_SIZE; - str = udc_get_string_serial_name(); - break; -#endif - default: -#ifdef UDC_GET_EXTRA_STRING - if (UDC_GET_EXTRA_STRING()) { - break; - } -#endif - return false; - } - - if (str_length) { - for(i = 0; i < str_length; i++) { - udc_string_desc.string[i] = cpu_to_le16((le16_t)str[i]); - } - - udc_string_desc.header.bLength = 2 + (str_length) * 2; - udd_set_setup_payload( - (uint8_t *) &udc_string_desc, - udc_string_desc.header.bLength); - } - - return true; -} - -/** - * \brief Standard device request to get descriptors about USB device - * - * \return true if success - */ -static bool udc_req_std_dev_get_descriptor(void) -{ - uint8_t conf_num; - - conf_num = udd_g_ctrlreq.req.wValue & 0xFF; - - // Check descriptor ID - switch ((uint8_t) (udd_g_ctrlreq.req.wValue >> 8)) { - case USB_DT_DEVICE: - // Device descriptor requested -#ifdef USB_DEVICE_HS_SUPPORT - if (!udd_is_high_speed()) { - udd_set_setup_payload( - (uint8_t *) udc_config.confdev_hs, - udc_config.confdev_hs->bLength); - } else -#endif - { - udd_set_setup_payload( - (uint8_t *) udc_config.confdev_lsfs, - udc_config.confdev_lsfs->bLength); - } - break; - - case USB_DT_CONFIGURATION: - // Configuration descriptor requested -#ifdef USB_DEVICE_HS_SUPPORT - if (udd_is_high_speed()) { - // HS descriptor - if (conf_num >= udc_config.confdev_hs-> - bNumConfigurations) { - return false; - } - udd_set_setup_payload( - (uint8_t *)udc_config.conf_hs[conf_num].desc, - le16_to_cpu(udc_config.conf_hs[conf_num].desc->wTotalLength)); - } else -#endif - { - // FS descriptor - if (conf_num >= udc_config.confdev_lsfs-> - bNumConfigurations) { - return false; - } - udd_set_setup_payload( - (uint8_t *)udc_config.conf_lsfs[conf_num].desc, - le16_to_cpu(udc_config.conf_lsfs[conf_num].desc->wTotalLength)); - } - ((usb_conf_desc_t *) udd_g_ctrlreq.payload)->bDescriptorType = - USB_DT_CONFIGURATION; - break; - -#ifdef USB_DEVICE_HS_SUPPORT - case USB_DT_DEVICE_QUALIFIER: - // Device qualifier descriptor requested - udd_set_setup_payload( (uint8_t *) udc_config.qualifier, - udc_config.qualifier->bLength); - break; - - case USB_DT_OTHER_SPEED_CONFIGURATION: - // Other configuration descriptor requested - if (!udd_is_high_speed()) { - // HS descriptor - if (conf_num >= udc_config.confdev_hs-> - bNumConfigurations) { - return false; - } - udd_set_setup_payload( - (uint8_t *)udc_config.conf_hs[conf_num].desc, - le16_to_cpu(udc_config.conf_hs[conf_num].desc->wTotalLength)); - } else { - // FS descriptor - if (conf_num >= udc_config.confdev_lsfs-> - bNumConfigurations) { - return false; - } - udd_set_setup_payload( - (uint8_t *)udc_config.conf_lsfs[conf_num].desc, - le16_to_cpu(udc_config.conf_lsfs[conf_num].desc->wTotalLength)); - } - ((usb_conf_desc_t *) udd_g_ctrlreq.payload)->bDescriptorType = - USB_DT_OTHER_SPEED_CONFIGURATION; - break; -#endif - - case USB_DT_BOS: - // Device BOS descriptor requested - if (udc_config.conf_bos == NULL) { - return false; - } - udd_set_setup_payload( (uint8_t *) udc_config.conf_bos, - udc_config.conf_bos->wTotalLength); - break; - - case USB_DT_STRING: - // String descriptor requested - if (!udc_req_std_dev_get_str_desc()) { - return false; - } - break; - - default: - // Unknown descriptor requested - return false; - } - // if the descriptor is larger than length requested, then reduce it - if (udd_g_ctrlreq.req.wLength < udd_g_ctrlreq.payload_size) { - udd_g_ctrlreq.payload_size = udd_g_ctrlreq.req.wLength; - } - return true; -} - -/** - * \brief Standard device request to get configuration number - * - * \return true if success - */ -static bool udc_req_std_dev_get_configuration(void) -{ - if (udd_g_ctrlreq.req.wLength != 1) { - return false; - } - - udd_set_setup_payload(&udc_num_configuration,1); - return true; -} - -/** - * \brief Standard device request to enable a configuration - * - * \return true if success - */ -static bool udc_req_std_dev_set_configuration(void) -{ - uint8_t iface_num; - - // Check request length - if (udd_g_ctrlreq.req.wLength) { - return false; - } - // Authorize configuration only if the address is valid - if (!udd_getaddress()) { - return false; - } - // Check the configuration number requested -#ifdef USB_DEVICE_HS_SUPPORT - if (udd_is_high_speed()) { - // HS descriptor - if ((udd_g_ctrlreq.req.wValue & 0xFF) > - udc_config.confdev_hs->bNumConfigurations) { - return false; - } - } else -#endif - { - // FS descriptor - if ((udd_g_ctrlreq.req.wValue & 0xFF) > - udc_config.confdev_lsfs->bNumConfigurations) { - return false; - } - } - - // Reset current configuration - udc_reset(); - - // Enable new configuration - udc_num_configuration = udd_g_ctrlreq.req.wValue & 0xFF; - if (udc_num_configuration == 0) { - return true; // Default empty configuration requested - } - // Update pointer of the configuration descriptor -#ifdef USB_DEVICE_HS_SUPPORT - if (udd_is_high_speed()) { - // HS descriptor - udc_ptr_conf = &udc_config.conf_hs[udc_num_configuration - 1]; - } else -#endif - { - // FS descriptor - udc_ptr_conf = &udc_config.conf_lsfs[udc_num_configuration - 1]; - } - // Enable all interfaces of the selected configuration - for (iface_num = 0; iface_num < udc_ptr_conf->desc->bNumInterfaces; - iface_num++) { - if (!udc_iface_enable(iface_num, 0)) { - return false; - } - } - return true; -} - -/** - * \brief Standard interface request - * to get the alternate setting number of an interface - * - * \return true if success - */ -static bool udc_req_std_iface_get_setting(void) -{ - uint8_t iface_num; - udi_api_t UDC_DESC_STORAGE *udi_api; - - if (udd_g_ctrlreq.req.wLength != 1) { - return false; // Error in request - } - if (!udc_num_configuration) { - return false; // The device is not is configured state yet - } - - // Check the interface number included in the request - iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; - if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { - return false; - } - - // Select first alternate setting of the interface to update udc_ptr_iface - // before call iface->getsetting() - if (!udc_update_iface_desc(iface_num, 0)) { - return false; - } - // Get alternate setting from UDI - udi_api = udc_ptr_conf->udi_apis[iface_num]; - udc_iface_setting = udi_api->getsetting(); - - // Link value to payload pointer of request - udd_set_setup_payload(&udc_iface_setting,1); - return true; -} - -/** - * \brief Standard interface request - * to set an alternate setting of an interface - * - * \return true if success - */ -static bool udc_req_std_iface_set_setting(void) -{ - uint8_t iface_num, setting_num; - - if (udd_g_ctrlreq.req.wLength) { - return false; // Error in request - } - if (!udc_num_configuration) { - return false; // The device is not is configured state yet - } - - iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; - setting_num = udd_g_ctrlreq.req.wValue & 0xFF; - - // Disable current setting - if (!udc_iface_disable(iface_num)) { - return false; - } - - // Enable new setting - return udc_iface_enable(iface_num, setting_num); -} - -/** - * \brief Main routine to manage the standard USB SETUP request - * - * \return true if the request is supported - */ -static bool udc_reqstd(void) -{ - if (Udd_setup_is_in()) { - // GET Standard Requests - if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error for USB host - } - - if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { - // Standard Get Device request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_GET_STATUS: - return udc_req_std_dev_get_status(); - case USB_REQ_GET_DESCRIPTOR: - return udc_req_std_dev_get_descriptor(); - case USB_REQ_GET_CONFIGURATION: - return udc_req_std_dev_get_configuration(); - default: - break; - } - } - - if (USB_REQ_RECIP_INTERFACE == Udd_setup_recipient()) { - // Standard Get Interface request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_GET_INTERFACE: - return udc_req_std_iface_get_setting(); - default: - break; - } - } -#if (0!=USB_DEVICE_MAX_EP) - if (USB_REQ_RECIP_ENDPOINT == Udd_setup_recipient()) { - // Standard Get Endpoint request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_GET_STATUS: - return udc_req_std_ep_get_status(); - default: - break; - } - } -#endif - } else { - // SET Standard Requests - if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { - // Standard Set Device request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_SET_ADDRESS: - return udc_req_std_dev_set_address(); - case USB_REQ_CLEAR_FEATURE: - return udc_req_std_dev_clear_feature(); - case USB_REQ_SET_FEATURE: - return udc_req_std_dev_set_feature(); - case USB_REQ_SET_CONFIGURATION: - return udc_req_std_dev_set_configuration(); - case USB_REQ_SET_DESCRIPTOR: - /* Not supported (defined as optional by the USB 2.0 spec) */ - break; - default: - break; - } - } - - if (USB_REQ_RECIP_INTERFACE == Udd_setup_recipient()) { - // Standard Set Interface request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_SET_INTERFACE: - return udc_req_std_iface_set_setting(); - default: - break; - } - } -#if (0!=USB_DEVICE_MAX_EP) - if (USB_REQ_RECIP_ENDPOINT == Udd_setup_recipient()) { - // Standard Set Endpoint request - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_CLEAR_FEATURE: - return udc_req_std_ep_clear_feature(); - case USB_REQ_SET_FEATURE: - return udc_req_std_ep_set_feature(); - default: - break; - } - } -#endif - } - return false; -} - -/** - * \brief Send the SETUP interface request to UDI - * - * \return true if the request is supported - */ -static bool udc_req_iface(void) -{ - uint8_t iface_num; - udi_api_t UDC_DESC_STORAGE *udi_api; - - if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet - } - // Check interface number - iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; - if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { - return false; - } - - //* To update udc_ptr_iface with the selected interface in request - // Select first alternate setting of interface to update udc_ptr_iface - // before calling udi_api->getsetting() - if (!udc_update_iface_desc(iface_num, 0)) { - return false; - } - // Select the interface with the current alternate setting - udi_api = udc_ptr_conf->udi_apis[iface_num]; - if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { - return false; - } - - // Send the SETUP request to the UDI corresponding to the interface number - return udi_api->setup(); -} - -/** - * \brief Send the SETUP interface request to UDI - * - * \return true if the request is supported - */ -static bool udc_req_ep(void) -{ - uint8_t iface_num; - udi_api_t UDC_DESC_STORAGE *udi_api; - - if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet - } - // Send this request on all enabled interfaces - iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; - for (iface_num = 0; iface_num < udc_ptr_conf->desc->bNumInterfaces; - iface_num++) { - // Select the interface with the current alternate setting - udi_api = udc_ptr_conf->udi_apis[iface_num]; - if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { - return false; - } - - // Send the SETUP request to the UDI - if (udi_api->setup()) { - return true; - } - } - return false; -} - -/** - * \brief Main routine to manage the USB SETUP request. - * - * This function parses a USB SETUP request and submits an appropriate - * response back to the host or, in the case of SETUP OUT requests - * with data, sets up a buffer for receiving the data payload. - * - * The main standard requests defined by the USB 2.0 standard are handled - * internally. The interface requests are sent to UDI, and the specific request - * sent to a specific application callback. - * - * \return true if the request is supported, else the request is stalled by UDD - */ -bool udc_process_setup(void) -{ - // By default no data (receive/send) and no callbacks registered - udd_g_ctrlreq.payload_size = 0; - udd_g_ctrlreq.callback = NULL; - udd_g_ctrlreq.over_under_run = NULL; - - if (Udd_setup_is_in()) { - if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error from USB host - } - } - - // If standard request then try to decode it in UDC - if (Udd_setup_type() == USB_REQ_TYPE_STANDARD) { - if (udc_reqstd()) { - return true; - } - } - - // If interface request then try to decode it in UDI - if (Udd_setup_recipient() == USB_REQ_RECIP_INTERFACE) { - if (udc_req_iface()) { - return true; - } - } - - // If endpoint request then try to decode it in UDI - if (Udd_setup_recipient() == USB_REQ_RECIP_ENDPOINT) { - if (udc_req_ep()) { - return true; - } - } - - // Here SETUP request unknown by UDC and UDIs -#ifdef USB_DEVICE_SPECIFIC_REQUEST - // Try to decode it in specific callback - return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... -#else - return false; -#endif -} - -//! @} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.h deleted file mode 100644 index 885bdf04d6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc.h +++ /dev/null @@ -1,697 +0,0 @@ -/** - * \file - * - * \brief Interface of the USB Device Controller (UDC) - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDC_H_ -#define _UDC_H_ - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "udc_desc.h" -#include "udd.h" - -#if USB_DEVICE_VENDOR_ID == 0 -# error USB_DEVICE_VENDOR_ID cannot be equal to 0 -#endif - -#if USB_DEVICE_PRODUCT_ID == 0 -# error USB_DEVICE_PRODUCT_ID cannot be equal to 0 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \ingroup usb_device_group - * \defgroup udc_group USB Device Controller (UDC) - * - * The UDC provides a high-level abstraction of the usb device. - * You can use these functions to control the main device state - * (start/attach/wakeup). - * - * \section USB_DEVICE_CONF USB Device Custom configuration - * The following USB Device configuration must be included in the conf_usb.h - * file of the application. - * - * USB_DEVICE_VENDOR_ID (Word)
- * Vendor ID provided by USB org (ATMEL 0x03EB). - * - * USB_DEVICE_PRODUCT_ID (Word)
- * Product ID (Referenced in usb_atmel.h). - * - * USB_DEVICE_MAJOR_VERSION (Byte)
- * Major version of the device - * - * USB_DEVICE_MINOR_VERSION (Byte)
- * Minor version of the device - * - * USB_DEVICE_MANUFACTURE_NAME (string)
- * ASCII name for the manufacture - * - * USB_DEVICE_PRODUCT_NAME (string)
- * ASCII name for the product - * - * USB_DEVICE_SERIAL_NAME (string)
- * ASCII name to enable and set a serial number - * - * USB_DEVICE_POWER (Numeric)
- * (unit mA) Maximum device power - * - * USB_DEVICE_ATTR (Byte)
- * USB attributes available: - * - USB_CONFIG_ATTR_SELF_POWERED - * - USB_CONFIG_ATTR_REMOTE_WAKEUP - * Note: if remote wake enabled then defines remotewakeup callbacks, - * see Table 5-2. External API from UDC - Callback - * - * USB_DEVICE_LOW_SPEED (Only defined)
- * Force the USB Device to run in low speed - * - * USB_DEVICE_HS_SUPPORT (Only defined)
- * Authorize the USB Device to run in high speed - * - * USB_DEVICE_MAX_EP (Byte)
- * Define the maximum endpoint number used by the USB Device.
- * This one is already defined in UDI default configuration. - * Ex: - * - When endpoint control 0x00, endpoint 0x01 and - * endpoint 0x82 is used then USB_DEVICE_MAX_EP=2 - * - When only endpoint control 0x00 is used then USB_DEVICE_MAX_EP=0 - * - When endpoint 0x01 and endpoint 0x81 is used then USB_DEVICE_MAX_EP=1
- * (configuration not possible on USBB interface) - * @{ - */ - -/** - * \brief Authorizes the VBUS event - * - * \return true, if the VBUS monitoring is possible. - * - * \section udc_vbus_monitoring VBus monitoring used cases - * - * The VBus monitoring is used only for USB SELF Power application. - * - * - By default the USB device is automatically attached when Vbus is high - * or when USB is start for devices without internal Vbus monitoring. - * conf_usb.h file does not contains define USB_DEVICE_ATTACH_AUTO_DISABLE. - * \code //#define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode - * - * - Add custom VBUS monitoring. conf_usb.h file contains define - * USB_DEVICE_ATTACH_AUTO_DISABLE: - * \code #define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode - * User C file contains: - * \code - // Authorize VBUS monitoring - if (!udc_include_vbus_monitoring()) { - // Implement custom VBUS monitoring via GPIO or other - } - Event_VBUS_present() // VBUS interrupt or GPIO interrupt or other - { - // Attach USB Device - udc_attach(); - } -\endcode - * - * - Case of battery charging. conf_usb.h file contains define - * USB_DEVICE_ATTACH_AUTO_DISABLE: - * \code #define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode - * User C file contains: - * \code - Event VBUS present() // VBUS interrupt or GPIO interrupt or .. - { - // Authorize battery charging, but wait key press to start USB. - } - Event Key press() - { - // Stop batteries charging - // Start USB - udc_attach(); - } -\endcode - */ -static inline bool udc_include_vbus_monitoring(void) -{ - return udd_include_vbus_monitoring(); -} - -/*! \brief Start the USB Device stack - */ -void udc_start(void); - -/*! \brief Stop the USB Device stack - */ -void udc_stop(void); - -/** - * \brief Attach device to the bus when possible - * - * \warning If a VBus control is included in driver, - * then it will attach device when an acceptable Vbus - * level from the host is detected. - */ -static inline void udc_attach(void) -{ - udd_attach(); -} - - -/** - * \brief Detaches the device from the bus - * - * The driver must remove pull-up on USB line D- or D+. - */ -static inline void udc_detach(void) -{ - udd_detach(); -} - - -/*! \brief The USB driver sends a resume signal called \e "Upstream Resume" - * This is authorized only when the remote wakeup feature is enabled by host. - */ -static inline void udc_remotewakeup(void) -{ - udd_send_remotewakeup(); -} - - -/** - * \brief Returns a pointer on the current interface descriptor - * - * \return pointer on the current interface descriptor. - */ -usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void); - -//@} - -/** - * \ingroup usb_group - * \defgroup usb_device_group USB Stack Device - * - * This module includes USB Stack Device implementation. - * The stack is divided in three parts: - * - USB Device Controller (UDC) provides USB chapter 9 compliance - * - USB Device Interface (UDI) provides USB Class compliance - * - USB Device Driver (UDD) provides USB Driver for each Atmel MCU - - * Many USB Device applications can be implemented on Atmel MCU. - * Atmel provides many application notes for different applications: - * - AVR4900, provides general information about Device Stack - * - AVR4901, explains how to create a new class - * - AVR4902, explains how to create a composite device - * - AVR49xx, all device classes provided in ASF have an application note - * - * A basic USB knowledge is required to understand the USB Device - * Class application notes (HID,MS,CDC,PHDC,...). - * Then, to create an USB device with - * only one class provided by ASF, refer directly to the application note - * corresponding to this USB class. The USB Device application note for - * New Class and Composite is dedicated to advanced USB users. - * - * @{ - */ - -//! @} - -#ifdef __cplusplus -} -#endif - -/** - * \ingroup udc_group - * \defgroup udc_basic_use_case_setup_prereq USB Device Controller (UDC) - Prerequisites - * Common prerequisites for all USB devices. - * - * This module is based on USB device stack full interrupt driven, and supporting - * \ref sleepmgr_group sleepmgr. For AVR and SAM3/4 devices the \ref clk_group clock services - * is supported. For SAMD devices the \ref asfdoc_sam0_system_clock_group clock driver is supported. - * - * The following procedure must be executed to setup the project correctly: - * - Specify the clock configuration: - * - XMEGA USB devices need 48MHz clock input.\n - * XMEGA USB devices need CPU frequency higher than 12MHz.\n - * You can use either an internal RC48MHz auto calibrated by Start of Frames - * or an external OSC. - * - UC3 and SAM3/4 devices without USB high speed support need 48MHz clock input.\n - * You must use a PLL and an external OSC. - * - UC3 and SAM3/4 devices with USB high speed support need 12MHz clock input.\n - * You must use an external OSC. - * - UC3 devices with USBC hardware need CPU frequency higher than 25MHz. - * - SAMD devices without USB high speed support need 48MHz clock input.\n - * You should use DFLL with USBCRM. - * - In conf_board.h, the define CONF_BOARD_USB_PORT must be added to enable USB lines. - * (Not mandatory for all boards) - * - Enable interrupts - * - Initialize the clock service - * - * The usage of \ref sleepmgr_group sleepmgr service is optional, but recommended to reduce power - * consumption: - * - Initialize the sleep manager service - * - Activate sleep mode when the application is in IDLE state - * - * \subpage udc_conf_clock. - * - * for AVR and SAM3/4 devices, add to the initialization code: - * \code - sysclk_init(); - irq_initialize_vectors(); - cpu_irq_enable(); - board_init(); - sleepmgr_init(); // Optional -\endcode - * - * For SAMD devices, add to the initialization code: - * \code - system_init(); - irq_initialize_vectors(); - cpu_irq_enable(); - sleepmgr_init(); // Optional -\endcode - * Add to the main IDLE loop: - * \code - sleepmgr_enter_sleep(); // Optional -\endcode - * - */ - -/** - * \ingroup udc_group - * \defgroup udc_basic_use_case_setup_code USB Device Controller (UDC) - Example code - * Common example code for all USB devices. - * - * Content of conf_usb.h: - * \code - #define USB_DEVICE_VENDOR_ID 0x03EB - #define USB_DEVICE_PRODUCT_ID 0xXXXX - #define USB_DEVICE_MAJOR_VERSION 1 - #define USB_DEVICE_MINOR_VERSION 0 - #define USB_DEVICE_POWER 100 - #define USB_DEVICE_ATTR USB_CONFIG_ATTR_BUS_POWERED -\endcode - * - * Add to application C-file: - * \code - void usb_init(void) - { - udc_start(); - } -\endcode - */ - -/** - * \ingroup udc_group - * \defgroup udc_basic_use_case_setup_flow USB Device Controller (UDC) - Workflow - * Common workflow for all USB devices. - * - * -# Ensure that conf_usb.h is available and contains the following configuration - * which is the main USB device configuration: - * - \code // Vendor ID provided by USB org (ATMEL 0x03EB) - #define USB_DEVICE_VENDOR_ID 0x03EB // Type Word - // Product ID (Atmel PID referenced in usb_atmel.h) - #define USB_DEVICE_PRODUCT_ID 0xXXXX // Type Word - // Major version of the device - #define USB_DEVICE_MAJOR_VERSION 1 // Type Byte - // Minor version of the device - #define USB_DEVICE_MINOR_VERSION 0 // Type Byte - // Maximum device power (mA) - #define USB_DEVICE_POWER 100 // Type 9-bits - // USB attributes to enable features - #define USB_DEVICE_ATTR USB_CONFIG_ATTR_BUS_POWERED // Flags \endcode - * -# Call the USB device stack start function to enable stack and start USB: - * - \code udc_start(); \endcode - * \note In case of USB dual roles (Device and Host) managed through USB OTG connector - * (USB ID pin), the call of udc_start() must be removed and replaced by uhc_start(). - * SeRefer to "AVR4950 section 6.1 Dual roles" for further information about dual roles. - */ - -/** - * \page udc_conf_clock conf_clock.h examples with USB support - * - * Content of XMEGA conf_clock.h: - * \code - // Configuration based on internal RC: - // USB clock need of 48Mhz - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_RCOSC - #define CONFIG_OSC_RC32_CAL 48000000UL - #define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_USBSOF - // CPU clock need of clock > 12MHz to run with USB (Here 24MHz) - #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC32MHZ - #define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_2 - #define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 -\endcode - * - * Content of conf_clock.h for AT32UC3A0, AT32UC3A1, AT32UC3B devices (USBB): - * \code - // Configuration based on 12MHz external OSC: - #define CONFIG_PLL1_SOURCE PLL_SRC_OSC0 - #define CONFIG_PLL1_MUL 8 - #define CONFIG_PLL1_DIV 2 - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL1 - #define CONFIG_USBCLK_DIV 1 // Fusb = Fsys/(2 ^ USB_div) -\endcode - * - * Content of conf_clock.h for AT32UC3A3, AT32UC3A4 devices (USBB with high speed support): - * \code - // Configuration based on 12MHz external OSC: - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_OSC0 - #define CONFIG_USBCLK_DIV 1 // Fusb = Fsys/(2 ^ USB_div) -\endcode - * - * Content of conf_clock.h for AT32UC3C, ATUCXXD, ATUCXXL3U, ATUCXXL4U devices (USBC): - * \code - // Configuration based on 12MHz external OSC: - #define CONFIG_PLL1_SOURCE PLL_SRC_OSC0 - #define CONFIG_PLL1_MUL 8 - #define CONFIG_PLL1_DIV 2 - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL1 - #define CONFIG_USBCLK_DIV 1 // Fusb = Fsys/(2 ^ USB_div) - // CPU clock need of clock > 25MHz to run with USBC - #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL1 -\endcode - * - * Content of conf_clock.h for SAM3S, SAM3SD, SAM4S devices (UPD: USB Peripheral Device): - * \code - // PLL1 (B) Options (Fpll = (Fclk * PLL_mul) / PLL_div) - #define CONFIG_PLL1_SOURCE PLL_SRC_MAINCK_XTAL - #define CONFIG_PLL1_MUL 16 - #define CONFIG_PLL1_DIV 2 - // USB Clock Source Options (Fusb = FpllX / USB_div) - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL1 - #define CONFIG_USBCLK_DIV 2 -\endcode - * - * Content of conf_clock.h for SAM3U device (UPDHS: USB Peripheral Device High Speed): - * \code - // USB Clock Source fixed at UPLL. -\endcode - * - * Content of conf_clock.h for SAM3X, SAM3A devices (UOTGHS: USB OTG High Speed): - * \code - // USB Clock Source fixed at UPLL. - #define CONFIG_USBCLK_SOURCE USBCLK_SRC_UPLL - #define CONFIG_USBCLK_DIV 1 -\endcode - * - * Content of conf_clocks.h for SAMD devices (USB): - * \code - // System clock bus configuration - # define CONF_CLOCK_FLASH_WAIT_STATES 2 - - // USB Clock Source fixed at DFLL. - // SYSTEM_CLOCK_SOURCE_DFLL configuration - Digital Frequency Locked Loop - # define CONF_CLOCK_DFLL_ENABLE true - # define CONF_CLOCK_DFLL_LOOP_MODE SYSTEM_CLOCK_DFLL_LOOP_MODE_USB_RECOVERY - # define CONF_CLOCK_DFLL_ON_DEMAND true - - // Set this to true to configure the GCLK when running clocks_init. - // If set to false, none of the GCLK generators will be configured in clocks_init(). - # define CONF_CLOCK_CONFIGURE_GCLK true - - // Configure GCLK generator 0 (Main Clock) - # define CONF_CLOCK_GCLK_0_ENABLE true - # define CONF_CLOCK_GCLK_0_RUN_IN_STANDBY true - # define CONF_CLOCK_GCLK_0_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_DFLL - # define CONF_CLOCK_GCLK_0_PRESCALER 1 - # define CONF_CLOCK_GCLK_0_OUTPUT_ENABLE false -\endcode - */ - -/** - * \page udc_use_case_1 Change USB speed - * - * In this use case, the USB device is used with different USB speeds. - * - * \section udc_use_case_1_setup Setup steps - * - * Prior to implement this use case, be sure to have already - * apply the UDI module "basic use case". - * - * \section udc_use_case_1_usage Usage steps - * - * \subsection udc_use_case_1_usage_code Example code - * Content of conf_usb.h: - * \code - #if // Low speed - #define USB_DEVICE_LOW_SPEED - // #define USB_DEVICE_HS_SUPPORT - - #elif // Full speed - // #define USB_DEVICE_LOW_SPEED - // #define USB_DEVICE_HS_SUPPORT - - #elif // High speed - // #define USB_DEVICE_LOW_SPEED - #define USB_DEVICE_HS_SUPPORT - - #endif -\endcode - * - * \subsection udc_use_case_1_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required for a USB device low speed (1.5Mbit/s): - * - \code #define USB_DEVICE_LOW_SPEED - //#define USB_DEVICE_HS_SUPPORT \endcode - * -# Ensure that conf_usb.h contains the following parameters - * required for a USB device full speed (12Mbit/s): - * - \code //#define USB_DEVICE_LOW_SPEED - //#define USB_DEVICE_HS_SUPPORT \endcode - * -# Ensure that conf_usb.h contains the following parameters - * required for a USB device high speed (480Mbit/s): - * - \code //#define USB_DEVICE_LOW_SPEED - #define USB_DEVICE_HS_SUPPORT \endcode - */ - -/** - * \page udc_use_case_2 Use USB strings - * - * In this use case, the usual USB strings is added in the USB device. - * - * \section udc_use_case_2_setup Setup steps - * Prior to implement this use case, be sure to have already - * apply the UDI module "basic use case". - * - * \section udc_use_case_2_usage Usage steps - * - * \subsection udc_use_case_2_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_MANUFACTURE_NAME "Manufacture name" - #define USB_DEVICE_PRODUCT_NAME "Product name" - #define USB_DEVICE_SERIAL_NAME "12...EF" -\endcode - * - * \subsection udc_use_case_2_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required to enable different USB strings: - * - \code // Static ASCII name for the manufacture - #define USB_DEVICE_MANUFACTURE_NAME "Manufacture name" \endcode - * - \code // Static ASCII name for the product - #define USB_DEVICE_PRODUCT_NAME "Product name" \endcode - * - \code // Static ASCII name to enable and set a serial number - #define USB_DEVICE_SERIAL_NAME "12...EF" \endcode - */ - -/** - * \page udc_use_case_3 Use USB remote wakeup feature - * - * In this use case, the USB remote wakeup feature is enabled. - * - * \section udc_use_case_3_setup Setup steps - * Prior to implement this use case, be sure to have already - * apply the UDI module "basic use case". - * - * \section udc_use_case_3_usage Usage steps - * - * \subsection udc_use_case_3_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_ATTR \ - (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED) - #define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable() - extern void my_callback_remotewakeup_enable(void); - #define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable() - extern void my_callback_remotewakeup_disable(void); -\endcode - * - * Add to application C-file: - * \code - void my_callback_remotewakeup_enable(void) - { - // Enable application wakeup events (e.g. enable GPIO interrupt) - } - void my_callback_remotewakeup_disable(void) - { - // Disable application wakeup events (e.g. disable GPIO interrupt) - } - - void my_interrupt_event(void) - { - udc_remotewakeup(); - } -\endcode - * - * \subsection udc_use_case_3_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required to enable remote wakeup feature: - * - \code // Authorizes the remote wakeup feature - #define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED) \endcode - * - \code // Define callback called when the host enables the remotewakeup feature - #define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable() - extern void my_callback_remotewakeup_enable(void); \endcode - * - \code // Define callback called when the host disables the remotewakeup feature - #define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable() - extern void my_callback_remotewakeup_disable(void); \endcode - * -# Send a remote wakeup (USB upstream): - * - \code udc_remotewakeup(); \endcode - */ - -/** - * \page udc_use_case_5 Bus power application recommendations - * - * In this use case, the USB device BUS power feature is enabled. - * This feature requires a correct power consumption management. - * - * \section udc_use_case_5_setup Setup steps - * Prior to implement this use case, be sure to have already - * apply the UDI module "basic use case". - * - * \section udc_use_case_5_usage Usage steps - * - * \subsection udc_use_case_5_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED) - #define UDC_SUSPEND_EVENT() user_callback_suspend_action() - extern void user_callback_suspend_action(void) - #define UDC_RESUME_EVENT() user_callback_resume_action() - extern void user_callback_resume_action(void) -\endcode - * - * Add to application C-file: - * \code - void user_callback_suspend_action(void) - { - // Disable hardware component to reduce power consumption - } - void user_callback_resume_action(void) - { - // Re-enable hardware component - } -\endcode - * - * \subsection udc_use_case_5_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters: - * - \code // Authorizes the BUS power feature - #define USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED) \endcode - * - \code // Define callback called when the host suspend the USB line - #define UDC_SUSPEND_EVENT() user_callback_suspend_action() - extern void user_callback_suspend_action(void); \endcode - * - \code // Define callback called when the host or device resume the USB line - #define UDC_RESUME_EVENT() user_callback_resume_action() - extern void user_callback_resume_action(void); \endcode - * -# Reduce power consumption in suspend mode (max. 2.5mA on Vbus): - * - \code void user_callback_suspend_action(void) - { - turn_off_components(); - } \endcode - */ - -/** - * \page udc_use_case_6 USB dynamic serial number - * - * In this use case, the USB serial strings is dynamic. - * For a static serial string refer to \ref udc_use_case_2. - * - * \section udc_use_case_6_setup Setup steps - * Prior to implement this use case, be sure to have already - * apply the UDI module "basic use case". - * - * \section udc_use_case_6_usage Usage steps - * - * \subsection udc_use_case_6_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_SERIAL_NAME - #define USB_DEVICE_GET_SERIAL_NAME_POINTER serial_number - #define USB_DEVICE_GET_SERIAL_NAME_LENGTH 12 - extern uint8_t serial_number[]; -\endcode - * - * Add to application C-file: - * \code - uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH]; - - void init_build_usb_serial_number(void) - { - serial_number[0] = 'A'; - serial_number[1] = 'B'; - ... - serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH-1] = 'C'; - } \endcode - * - * \subsection udc_use_case_6_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required to enable a USB serial number strings dynamically: - * - \code #define USB_DEVICE_SERIAL_NAME // Define this empty - #define USB_DEVICE_GET_SERIAL_NAME_POINTER serial_number // Give serial array pointer - #define USB_DEVICE_GET_SERIAL_NAME_LENGTH 12 // Give size of serial array - extern uint8_t serial_number[]; // Declare external serial array \endcode - * -# Before start USB stack, initialize the serial array - * - \code - uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH]; - - void init_build_usb_serial_number(void) - { - serial_number[0] = 'A'; - serial_number[1] = 'B'; - ... - serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH-1] = 'C'; - } \endcode - */ - - - -#endif // _UDC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h deleted file mode 100644 index 88ed08a961..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * \file - * - * \brief Common API for USB Device Interface - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDC_DESC_H_ -#define _UDC_DESC_H_ - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "udi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \ingroup udc_group - * \defgroup udc_desc_group USB Device Descriptor - * - * @{ - */ - -/** - * \brief Defines the memory's location of USB descriptors - * - * By default the Descriptor is stored in RAM - * (UDC_DESC_STORAGE is defined empty). - * - * If you have need to free RAM space, - * it is possible to put descriptor in flash in following case: - * - USB driver authorize flash transfer (USBB on UC3 and USB on Mega) - * - USB Device is not high speed (UDC no need to change USB descriptors) - * - * For UC3 application used "const". - * - * For Mega application used "code". - */ -#define UDC_DESC_STORAGE - // Descriptor storage in internal RAM -#if (defined UDC_DATA_USE_HRAM_SUPPORT) -# if defined(__GNUC__) -# define UDC_DATA(x) COMPILER_WORD_ALIGNED __attribute__((__section__(".data_hram0"))) -# define UDC_BSS(x) COMPILER_ALIGNED(x) __attribute__((__section__(".bss_hram0"))) -# elif defined(__ICCAVR32__) -# define UDC_DATA(x) COMPILER_ALIGNED(x) __data32 -# define UDC_BSS(x) COMPILER_ALIGNED(x) __data32 -# endif -#else -# define UDC_DATA(x) COMPILER_ALIGNED(x) -# define UDC_BSS(x) COMPILER_ALIGNED(x) -#endif - - - -/** - * \brief Configuration descriptor and UDI link for one USB speed - */ -typedef struct { - //! USB configuration descriptor - usb_conf_desc_t UDC_DESC_STORAGE *desc; - //! Array of UDI API pointer - udi_api_t UDC_DESC_STORAGE *UDC_DESC_STORAGE * udi_apis; -} udc_config_speed_t; - - -/** - * \brief All information about the USB Device - */ -typedef struct { - //! USB device descriptor for low or full speed - usb_dev_desc_t UDC_DESC_STORAGE *confdev_lsfs; - //! USB configuration descriptor and UDI API pointers for low or full speed - udc_config_speed_t UDC_DESC_STORAGE *conf_lsfs; -#ifdef USB_DEVICE_HS_SUPPORT - //! USB device descriptor for high speed - usb_dev_desc_t UDC_DESC_STORAGE *confdev_hs; - //! USB device qualifier, only use in high speed mode - usb_dev_qual_desc_t UDC_DESC_STORAGE *qualifier; - //! USB configuration descriptor and UDI API pointers for high speed - udc_config_speed_t UDC_DESC_STORAGE *conf_hs; -#endif - usb_dev_bos_desc_t UDC_DESC_STORAGE *conf_bos; -} udc_config_t; - -//! Global variables of USB Device Descriptor and UDI links -extern UDC_DESC_STORAGE udc_config_t udc_config; - -//@} - -#ifdef __cplusplus -} -#endif -#endif // _UDC_DESC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udd.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udd.h deleted file mode 100644 index c87763de23..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udd.h +++ /dev/null @@ -1,396 +0,0 @@ -/** - * \file - * - * \brief Common API for USB Device Drivers (UDD) - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDD_H_ -#define _UDD_H_ - -#include "usb_protocol.h" -#include "udc_desc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \ingroup usb_device_group - * \defgroup udd_group USB Device Driver (UDD) - * - * The UDD driver provides a low-level abstraction of the device - * controller hardware. Most events coming from the hardware such as - * interrupts, which may cause the UDD to call into the UDC and UDI. - * - * @{ - */ - -//! \brief Endpoint identifier -typedef uint8_t udd_ep_id_t; - -//! \brief Endpoint transfer status -//! Returned in parameters of callback register via udd_ep_run routine. -typedef enum { - UDD_EP_TRANSFER_OK = 0, - UDD_EP_TRANSFER_ABORT = 1, -} udd_ep_status_t; - -/** - * \brief Global variable to give and record information of the setup request management - * - * This global variable allows to decode and response a setup request. - * It can be updated by udc_process_setup() from UDC or *setup() from UDIs. - */ -typedef struct { - //! Data received in USB SETUP packet - //! Note: The swap of "req.wValues" from uin16_t to le16_t is done by UDD. - usb_setup_req_t req; - - //! Point to buffer to send or fill with data following SETUP packet - //! This buffer must be word align for DATA IN phase (use prefix COMPILER_WORD_ALIGNED for buffer) - uint8_t *payload; - - //! Size of buffer to send or fill, and content the number of byte transfered - uint16_t payload_size; - - //! Callback called after reception of ZLP from setup request - 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); -} udd_ctrl_request_t; -extern udd_ctrl_request_t udd_g_ctrlreq; - -//! Return true if the setup request \a udd_g_ctrlreq indicates IN data transfer -#define Udd_setup_is_in() \ - (USB_REQ_DIR_IN == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK)) - -//! Return true if the setup request \a udd_g_ctrlreq indicates OUT data transfer -#define Udd_setup_is_out() \ - (USB_REQ_DIR_OUT == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK)) - -//! Return the type of the SETUP request \a udd_g_ctrlreq. \see usb_reqtype. -#define Udd_setup_type() \ - (udd_g_ctrlreq.req.bmRequestType & USB_REQ_TYPE_MASK) - -//! Return the recipient of the SETUP request \a udd_g_ctrlreq. \see usb_recipient -#define Udd_setup_recipient() \ - (udd_g_ctrlreq.req.bmRequestType & USB_REQ_RECIP_MASK) - -/** - * \brief End of halt callback function type. - * Registered by routine udd_ep_wait_stall_clear() - * Callback called when endpoint stall is cleared. - */ -typedef void (*udd_callback_halt_cleared_t)(void); - -/** - * \brief End of transfer callback function type. - * Registered by routine udd_ep_run() - * Callback called by USB interrupt after data transfer or abort (reset,...). - * - * \param status UDD_EP_TRANSFER_OK, if transfer is complete - * \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted - * \param n number of data transfered - */ -typedef void (*udd_callback_trans_t) (udd_ep_status_t status, - iram_size_t nb_transfered, udd_ep_id_t ep); - -/** - * \brief Authorizes the VBUS event - * - * \return true, if the VBUS monitoring is possible. - */ -bool udd_include_vbus_monitoring(void); - -/** - * \brief Enables the USB Device mode - */ -void udd_enable(void); - -/** - * \brief Disables the USB Device mode - */ -void udd_disable(void); - -/** - * \brief Attach device to the bus when possible - * - * \warning If a VBus control is included in driver, - * then it will attach device when an acceptable Vbus - * level from the host is detected. - */ -void udd_attach(void); - -/** - * \brief Detaches the device from the bus - * - * The driver must remove pull-up on USB line D- or D+. - */ -void udd_detach(void); - -/** - * \brief Test whether the USB Device Controller is running at high - * speed or not. - * - * \return \c true if the Device is running at high speed mode, otherwise \c false. - */ -bool udd_is_high_speed(void); - -/** - * \brief Changes the USB address of device - * - * \param address New USB address - */ -void udd_set_address(uint8_t address); - -/** - * \brief Returns the USB address of device - * - * \return USB address - */ -uint8_t udd_getaddress(void); - -/** - * \brief Returns the current start of frame number - * - * \return current start of frame number. - */ -uint16_t udd_get_frame_number(void); - -/** - * \brief Returns the current micro start of frame number - * - * \return current micro start of frame number required in high speed mode. - */ -uint16_t udd_get_micro_frame_number(void); - -/*! \brief The USB driver sends a resume signal called Upstream Resume - */ -void udd_send_remotewakeup(void); - -/** - * \brief Load setup payload - * - * \param payload Pointer on payload - * \param payload_size Size of payload - */ -void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size ); - - -/** - * \name Endpoint Management - * - * The following functions allow drivers to create and remove - * endpoints, as well as set, clear and query their "halted" and - * "wedged" states. - */ -//@{ - -#if (USB_DEVICE_MAX_EP != 0) - -/** - * \brief Configures and enables an endpoint - * - * \param ep Endpoint number including direction (USB_EP_DIR_IN/USB_EP_DIR_OUT). - * \param bmAttributes Attributes of endpoint declared in the descriptor. - * \param MaxEndpointSize Endpoint maximum size - * - * \return \c 1 if the endpoint is enabled, otherwise \c 0. - */ -bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, - uint16_t MaxEndpointSize); - -/** - * \brief Disables an endpoint - * - * \param ep Endpoint number including direction (USB_EP_DIR_IN/USB_EP_DIR_OUT). - */ -void udd_ep_free(udd_ep_id_t ep); - -/** - * \brief Check if the endpoint \a ep is halted. - * - * \param ep The ID of the endpoint to check. - * - * \return \c 1 if \a ep is halted, otherwise \c 0. - */ -bool udd_ep_is_halted(udd_ep_id_t ep); - -/** - * \brief Set the halted state of the endpoint \a ep - * - * After calling this function, any transaction on \a ep will result - * in a STALL handshake being sent. Any pending transactions will be - * performed first, however. - * - * \param ep The ID of the endpoint to be halted - * - * \return \c 1 if \a ep is halted, otherwise \c 0. - */ -bool udd_ep_set_halt(udd_ep_id_t ep); - -/** - * \brief Clear the halted state of the endpoint \a ep - * - * After calling this function, any transaction on \a ep will - * be handled normally, i.e. a STALL handshake will not be sent, and - * the data toggle sequence will start at DATA0. - * - * \param ep The ID of the endpoint to be un-halted - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -bool udd_ep_clear_halt(udd_ep_id_t ep); - -/** - * \brief Registers a callback to call when endpoint halt is cleared - * - * \param ep The ID of the endpoint to use - * \param callback NULL or function to call when endpoint halt is cleared - * - * \warning if the endpoint is not halted then the \a callback is called immediately. - * - * \return \c 1 if the register is accepted, otherwise \c 0. - */ -bool udd_ep_wait_stall_clear(udd_ep_id_t ep, - udd_callback_halt_cleared_t callback); - -/** - * \brief Allows to receive or send data on an endpoint - * - * The driver uses a specific DMA USB to transfer data - * from internal RAM to endpoint, if this one is available. - * When the transfer is finished or aborted (stall, reset, ...), the \a callback is called. - * The \a callback returns the transfer status and eventually the number of byte transfered. - * Note: The control endpoint is not authorized. - * - * \param ep The ID of the endpoint to use - * \param b_shortpacket Enabled automatic short packet - * \param buf Buffer on Internal RAM to send or fill. - * It must be align, then use COMPILER_WORD_ALIGNED. - * \param buf_size Buffer size to send or fill - * \param callback NULL or function to call at the end of transfer - * - * \warning About \a b_shortpacket, for IN endpoint it means that a short packet - * (or a Zero Length Packet) will be sent to the USB line to properly close the usb - * transfer at the end of the data transfer. - * For Bulk and Interrupt OUT endpoint, it will automatically stop the transfer - * at the end of the data transfer (received short packet). - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, - uint8_t * buf, iram_size_t buf_size, - udd_callback_trans_t callback); -/** - * \brief Aborts transfer on going on endpoint - * - * If a transfer is on going, then it is stopped and - * the callback registered is called to signal the end of transfer. - * Note: The control endpoint is not authorized. - * - * \param ep Endpoint to abort - */ -void udd_ep_abort(udd_ep_id_t ep); - -#endif - -//@} - - -/** - * \name High speed test mode management - * - * The following functions allow the device to jump to a specific test mode required in high speed mode. - */ -//@{ -void udd_test_mode_j(void); -void udd_test_mode_k(void); -void udd_test_mode_se0_nak(void); -void udd_test_mode_packet(void); -//@} - - -/** - * \name UDC callbacks to provide for UDD - * - * The following callbacks are used by UDD. - */ -//@{ - -/** - * \brief Decodes and manages a setup request - * - * The driver call it when a SETUP packet is received. - * The \c udd_g_ctrlreq contains the data of SETUP packet. - * If this callback accepts the setup request then it must - * return \c 1 and eventually update \c udd_g_ctrlreq to send or receive data. - * - * \return \c 1 if the request is accepted, otherwise \c 0. - */ -extern bool udc_process_setup(void); - -/** - * \brief Reset the UDC - * - * The UDC must reset all configuration. - */ -extern void udc_reset(void); - -/** - * \brief To signal that a SOF is occurred - * - * The UDC must send the signal to all UDIs enabled - */ -extern void udc_sof_notify(void); - -//@} - -//@} - -#ifdef __cplusplus -} -#endif -#endif // _UDD_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi.h deleted file mode 100644 index 709908cad9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi.h +++ /dev/null @@ -1,133 +0,0 @@ -/** - * \file - * - * \brief Common API for USB Device Interface - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDI_H_ -#define _UDI_H_ - -#include "conf_usb.h" -#include "usb_protocol.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \ingroup usb_device_group - * \defgroup udi_group USB Device Interface (UDI) - * The UDI provides a common API for all classes, - * and this is used by UDC for the main control of USB Device interface. - * @{ - */ - -/** - * \brief UDI API. - * - * The callbacks within this structure are called only by - * USB Device Controller (UDC) - * - * The udc_get_interface_desc() can be use by UDI to know the interface descriptor - * selected by UDC. - */ -typedef struct { - /** - * \brief Enable the interface. - * - * This function is called when the host selects a configuration - * to which this interface belongs through a Set Configuration - * request, and when the host selects an alternate setting of - * this interface through a Set Interface request. - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ - bool (*enable)(void); - - /** - * \brief Disable the interface. - * - * This function is called when this interface is currently - * active, and - * - the host selects any configuration through a Set - * Configuration request, or - * - the host issues a USB reset, or - * - the device is detached from the host (i.e. Vbus is no - * longer present) - */ - void (*disable)(void); - - /** - * \brief Handle a control request directed at an interface. - * - * This function is called when this interface is currently - * active and the host sends a SETUP request - * with this interface as the recipient. - * - * Use udd_g_ctrlreq to decode and response to SETUP request. - * - * \return \c 1 if this interface supports the SETUP request, otherwise \c 0. - */ - bool (*setup)(void); - - /** - * \brief Returns the current setting of the selected interface. - * - * This function is called when UDC when know alternate setting of selected interface. - * - * \return alternate setting of selected interface - */ - uint8_t (*getsetting)(void); - - /** - * \brief To signal that a SOF is occurred - */ - void (*sof_notify)(void); -} udi_api_t; - -//@} - -#ifdef __cplusplus -} -#endif -#endif // _UDI_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c deleted file mode 100644 index 60c9546ce2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c +++ /dev/null @@ -1,1155 +0,0 @@ -/** - * \file - * - * \brief USB Device Communication Device Class (CDC) interface. - * - * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "usb_protocol_cdc.h" -#include "udd.h" -#include "udc.h" -#include "udi_cdc.h" -#include - -#ifdef UDI_CDC_LOW_RATE -# ifdef USB_DEVICE_HS_SUPPORT -# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) -# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) -# else -# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_FS_SIZE) -# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_FS_SIZE) -# endif -#else -# ifdef USB_DEVICE_HS_SUPPORT -# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) -# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) -# else -# define UDI_CDC_TX_BUFFERS (5*UDI_CDC_DATA_EPS_FS_SIZE) -# define UDI_CDC_RX_BUFFERS (5*UDI_CDC_DATA_EPS_FS_SIZE) -# endif -#endif - -#ifndef UDI_CDC_TX_EMPTY_NOTIFY -# define UDI_CDC_TX_EMPTY_NOTIFY(port) -#endif - -/** - * \ingroup udi_cdc_group - * \defgroup udi_cdc_group_udc Interface with USB Device Core (UDC) - * - * Structures and functions required by UDC. - * - * @{ - */ -bool udi_cdc_comm_enable(void); -void udi_cdc_comm_disable(void); -bool udi_cdc_comm_setup(void); -bool udi_cdc_data_enable(void); -void udi_cdc_data_disable(void); -bool udi_cdc_data_setup(void); -uint8_t udi_cdc_getsetting(void); -void udi_cdc_data_sof_notify(void); -UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = { - .enable = udi_cdc_comm_enable, - .disable = udi_cdc_comm_disable, - .setup = udi_cdc_comm_setup, - .getsetting = udi_cdc_getsetting, -}; -UDC_DESC_STORAGE udi_api_t udi_api_cdc_data = { - .enable = udi_cdc_data_enable, - .disable = udi_cdc_data_disable, - .setup = udi_cdc_data_setup, - .getsetting = udi_cdc_getsetting, - .sof_notify = udi_cdc_data_sof_notify, -}; -//@} - -/** - * \ingroup udi_cdc_group - * \defgroup udi_cdc_group_internal Implementation of UDI CDC - * - * Class internal implementation - * @{ - */ - -/** - * \name Internal routines - */ -//@{ - -/** - * \name Routines to control serial line - */ -//@{ - -/** - * \brief Returns the port number corresponding at current setup request - * - * \return port number - */ -static uint8_t udi_cdc_setup_to_port(void); - -/** - * \brief Sends line coding to application - * - * Called after SETUP request when line coding data is received. - */ -static void udi_cdc_line_coding_received(void); - -/** - * \brief Records new state - * - * \param port Communication port number to manage - * \param b_set State is enabled if true, else disabled - * \param bit_mask Field to process (see CDC_SERIAL_STATE_ defines) - */ -static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask); - -/** - * \brief Check and eventually notify the USB host of new state - * - * \param port Communication port number to manage - * \param ep Port communication endpoint - */ -static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep); - -/** - * \brief Ack sent of serial state message - * Callback called after serial state message sent - * - * \param status UDD_EP_TRANSFER_OK, if transfer finished - * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted - * \param n number of data transfered - */ -static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); - -//@} - -/** - * \name Routines to process data transfer - */ -//@{ - -/** - * \brief Enable the reception of data from the USB host - * - * The value udi_cdc_rx_trans_sel indicate the RX buffer to fill. - * - * \param port Communication port number to manage - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -static bool udi_cdc_rx_start(uint8_t port); - -/** - * \brief Update rx buffer management with a new data - * Callback called after data reception on USB line - * - * \param status UDD_EP_TRANSFER_OK, if transfer finish - * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted - * \param n number of data received - */ -static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); - -/** - * \brief Ack sent of tx buffer - * Callback called after data transfer on USB line - * - * \param status UDD_EP_TRANSFER_OK, if transfer finished - * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted - * \param n number of data transfered - */ -static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); - -/** - * \brief Send buffer on line or wait a SOF event - * - * \param port Communication port number to manage - */ -static void udi_cdc_tx_send(uint8_t port); - -//@} - -//@} - -/** - * \name Information about configuration of communication line - */ -//@{ -COMPILER_WORD_ALIGNED - static usb_cdc_line_coding_t udi_cdc_line_coding[UDI_CDC_PORT_NB]; -static bool udi_cdc_serial_state_msg_ongoing[UDI_CDC_PORT_NB]; -static volatile le16_t udi_cdc_state[UDI_CDC_PORT_NB]; -COMPILER_WORD_ALIGNED static usb_cdc_notify_serial_state_t uid_cdc_state_msg[UDI_CDC_PORT_NB]; - -//! Status of CDC COMM interfaces -static volatile uint8_t udi_cdc_nb_comm_enabled = 0; -//@} - -/** - * \name Variables to manage RX/TX transfer requests - * Two buffers for each sense are used to optimize the speed. - */ -//@{ - -//! Status of CDC DATA interfaces -static volatile uint8_t udi_cdc_nb_data_enabled = 0; -static volatile bool udi_cdc_data_running = false; -//! Buffer to receive data -COMPILER_WORD_ALIGNED static uint8_t udi_cdc_rx_buf[UDI_CDC_PORT_NB][2][UDI_CDC_RX_BUFFERS]; -//! Data available in RX buffers -static volatile uint16_t udi_cdc_rx_buf_nb[UDI_CDC_PORT_NB][2]; -//! Give the current RX buffer used (rx0 if 0, rx1 if 1) -static volatile uint8_t udi_cdc_rx_buf_sel[UDI_CDC_PORT_NB]; -//! Read position in current RX buffer -static volatile uint16_t udi_cdc_rx_pos[UDI_CDC_PORT_NB]; -//! Signal a transfer on-going -static volatile bool udi_cdc_rx_trans_ongoing[UDI_CDC_PORT_NB]; - -//! Define a transfer halted -#define UDI_CDC_TRANS_HALTED 2 - -//! Buffer to send data -COMPILER_WORD_ALIGNED static uint8_t udi_cdc_tx_buf[UDI_CDC_PORT_NB][2][UDI_CDC_TX_BUFFERS]; -//! Data available in TX buffers -static uint16_t udi_cdc_tx_buf_nb[UDI_CDC_PORT_NB][2]; -//! Give current TX buffer used (tx0 if 0, tx1 if 1) -static volatile uint8_t udi_cdc_tx_buf_sel[UDI_CDC_PORT_NB]; -//! Value of SOF during last TX transfer -static uint16_t udi_cdc_tx_sof_num[UDI_CDC_PORT_NB]; -//! Signal a transfer on-going -static volatile bool udi_cdc_tx_trans_ongoing[UDI_CDC_PORT_NB]; -//! Signal that both buffer content data to send -static volatile bool udi_cdc_tx_both_buf_to_send[UDI_CDC_PORT_NB]; - -//@} - -bool udi_cdc_comm_enable(void) -{ - uint8_t port; - uint8_t iface_comm_num; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; - udi_cdc_nb_comm_enabled = 0; -#else - if (udi_cdc_nb_comm_enabled > UDI_CDC_PORT_NB) { - udi_cdc_nb_comm_enabled = 0; - } - port = udi_cdc_nb_comm_enabled; -#endif - - // Initialize control signal management - udi_cdc_state[port] = CPU_TO_LE16(0); - - uid_cdc_state_msg[port].header.bmRequestType = - USB_REQ_DIR_IN | USB_REQ_TYPE_CLASS | - USB_REQ_RECIP_INTERFACE; - uid_cdc_state_msg[port].header.bNotification = USB_REQ_CDC_NOTIFY_SERIAL_STATE; - uid_cdc_state_msg[port].header.wValue = LE16(0); - - switch (port) { -#define UDI_CDC_PORT_TO_IFACE_COMM(index, unused) \ - case index: \ - iface_comm_num = UDI_CDC_COMM_IFACE_NUMBER_##index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_IFACE_COMM, ~) -#undef UDI_CDC_PORT_TO_IFACE_COMM - default: - iface_comm_num = UDI_CDC_COMM_IFACE_NUMBER_0; - break; - } - - uid_cdc_state_msg[port].header.wIndex = LE16(iface_comm_num); - uid_cdc_state_msg[port].header.wLength = LE16(2); - uid_cdc_state_msg[port].value = CPU_TO_LE16(0); - - udi_cdc_line_coding[port].dwDTERate = CPU_TO_LE32(UDI_CDC_DEFAULT_RATE); - udi_cdc_line_coding[port].bCharFormat = UDI_CDC_DEFAULT_STOPBITS; - udi_cdc_line_coding[port].bParityType = UDI_CDC_DEFAULT_PARITY; - udi_cdc_line_coding[port].bDataBits = UDI_CDC_DEFAULT_DATABITS; - // Call application callback - // to initialize memories or indicate that interface is enabled - UDI_CDC_SET_CODING_EXT(port,(&udi_cdc_line_coding[port])); - if (!UDI_CDC_ENABLE_EXT(port)) { - return false; - } - udi_cdc_nb_comm_enabled++; - return true; -} - -bool udi_cdc_data_enable(void) -{ - uint8_t port; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; - udi_cdc_nb_data_enabled = 0; -#else - if (udi_cdc_nb_data_enabled > UDI_CDC_PORT_NB) { - udi_cdc_nb_data_enabled = 0; - } - port = udi_cdc_nb_data_enabled; -#endif - - // Initialize TX management - udi_cdc_tx_trans_ongoing[port] = false; - udi_cdc_tx_both_buf_to_send[port] = false; - udi_cdc_tx_buf_sel[port] = 0; - udi_cdc_tx_buf_nb[port][0] = 0; - udi_cdc_tx_buf_nb[port][1] = 0; - udi_cdc_tx_sof_num[port] = 0; - udi_cdc_tx_send(port); - - // Initialize RX management - udi_cdc_rx_trans_ongoing[port] = false; - udi_cdc_rx_buf_sel[port] = 0; - udi_cdc_rx_buf_nb[port][0] = 0; - udi_cdc_rx_buf_nb[port][1] = 0; - udi_cdc_rx_pos[port] = 0; - if (!udi_cdc_rx_start(port)) { - return false; - } - udi_cdc_nb_data_enabled++; - if (udi_cdc_nb_data_enabled == UDI_CDC_PORT_NB) { - udi_cdc_data_running = true; - } - return true; -} - -void udi_cdc_comm_disable(void) -{ - Assert(udi_cdc_nb_comm_enabled != 0); - udi_cdc_nb_comm_enabled--; -} - -void udi_cdc_data_disable(void) -{ - uint8_t port; - - Assert(udi_cdc_nb_data_enabled != 0); - udi_cdc_nb_data_enabled--; - port = udi_cdc_nb_data_enabled; - UDI_CDC_DISABLE_EXT(port); - udi_cdc_data_running = false; -} - -bool udi_cdc_comm_setup(void) -{ - uint8_t port = udi_cdc_setup_to_port(); - - if (Udd_setup_is_in()) { - // GET Interface Requests - if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { - // Requests Class Interface Get - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_CDC_GET_LINE_CODING: - // Get configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != - udd_g_ctrlreq.req.wLength) - return false; // Error for USB host - udd_g_ctrlreq.payload = - (uint8_t *) & - udi_cdc_line_coding[port]; - udd_g_ctrlreq.payload_size = - sizeof(usb_cdc_line_coding_t); - return true; - } - } - } - if (Udd_setup_is_out()) { - // SET Interface Requests - if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { - // Requests Class Interface Set - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_CDC_SET_LINE_CODING: - // Change configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != - udd_g_ctrlreq.req.wLength) - return false; // Error for USB host - udd_g_ctrlreq.callback = - udi_cdc_line_coding_received; - udd_g_ctrlreq.payload = - (uint8_t *) & - udi_cdc_line_coding[port]; - udd_g_ctrlreq.payload_size = - sizeof(usb_cdc_line_coding_t); - return true; - case USB_REQ_CDC_SET_CONTROL_LINE_STATE: - // According cdc spec 1.1 chapter 6.2.14 - UDI_CDC_SET_DTR_EXT(port, (0 != - (udd_g_ctrlreq.req.wValue - & CDC_CTRL_SIGNAL_DTE_PRESENT))); - UDI_CDC_SET_RTS_EXT(port, (0 != - (udd_g_ctrlreq.req.wValue - & CDC_CTRL_SIGNAL_ACTIVATE_CARRIER))); - return true; - } - } - } - return false; // request Not supported -} - -bool udi_cdc_data_setup(void) -{ - return false; // request Not supported -} - -uint8_t udi_cdc_getsetting(void) -{ - return 0; // CDC don't have multiple alternate setting -} - -void udi_cdc_data_sof_notify(void) -{ - static uint8_t port_notify = 0; - - // A call of udi_cdc_data_sof_notify() is done for each port - udi_cdc_tx_send(port_notify); -#if UDI_CDC_PORT_NB != 1 // To optimize code - port_notify++; - if (port_notify >= UDI_CDC_PORT_NB) { - port_notify = 0; - } -#endif -} - - -// ------------------------ -//------- Internal routines to control serial line - -static uint8_t udi_cdc_setup_to_port(void) -{ - uint8_t port; - - switch (udd_g_ctrlreq.req.wIndex & 0xFF) { -#define UDI_CDC_IFACE_COMM_TO_PORT(iface, unused) \ - case UDI_CDC_COMM_IFACE_NUMBER_##iface: \ - port = iface; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_IFACE_COMM_TO_PORT, ~) -#undef UDI_CDC_IFACE_COMM_TO_PORT - default: - port = 0; - break; - } - return port; -} - -static void udi_cdc_line_coding_received(void) -{ - uint8_t port = udi_cdc_setup_to_port(); - UNUSED(port); - - UDI_CDC_SET_CODING_EXT(port, (&udi_cdc_line_coding[port])); -} - -static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) -{ - irqflags_t flags; - udd_ep_id_t ep_comm; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - // Update state - flags = cpu_irq_save(); // Protect udi_cdc_state - if (b_set) { - udi_cdc_state[port] |= bit_mask; - } else { - udi_cdc_state[port] &= ~(unsigned)bit_mask; - } - cpu_irq_restore(flags); - - // Send it if possible and state changed - switch (port) { -#define UDI_CDC_PORT_TO_COMM_EP(index, unused) \ - case index: \ - ep_comm = UDI_CDC_COMM_EP_##index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_COMM_EP, ~) -#undef UDI_CDC_PORT_TO_COMM_EP - default: - ep_comm = UDI_CDC_COMM_EP_0; - break; - } - udi_cdc_ctrl_state_notify(port, ep_comm); -} - - -static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) -{ -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - // Send it if possible and state changed - if ((!udi_cdc_serial_state_msg_ongoing[port]) - && (udi_cdc_state[port] != uid_cdc_state_msg[port].value)) { - // Fill notification message - uid_cdc_state_msg[port].value = udi_cdc_state[port]; - // Send notification message - udi_cdc_serial_state_msg_ongoing[port] = - udd_ep_run(ep, - false, - (uint8_t *) & uid_cdc_state_msg[port], - sizeof(uid_cdc_state_msg[0]), - udi_cdc_serial_state_msg_sent); - } -} - - -static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) -{ - uint8_t port; - UNUSED(n); - UNUSED(status); - - switch (ep) { -#define UDI_CDC_GET_PORT_FROM_COMM_EP(iface, unused) \ - case UDI_CDC_COMM_EP_##iface: \ - port = iface; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_GET_PORT_FROM_COMM_EP, ~) -#undef UDI_CDC_GET_PORT_FROM_COMM_EP - default: - port = 0; - break; - } - - udi_cdc_serial_state_msg_ongoing[port] = false; - - // For the irregular signals like break, the incoming ring signal, - // or the overrun error state, this will reset their values to zero - // and again will not send another notification until their state changes. - udi_cdc_state[port] &= ~(CDC_SERIAL_STATE_BREAK | - CDC_SERIAL_STATE_RING | - CDC_SERIAL_STATE_FRAMING | - CDC_SERIAL_STATE_PARITY | CDC_SERIAL_STATE_OVERRUN); - uid_cdc_state_msg[port].value &= ~(CDC_SERIAL_STATE_BREAK | - CDC_SERIAL_STATE_RING | - CDC_SERIAL_STATE_FRAMING | - CDC_SERIAL_STATE_PARITY | CDC_SERIAL_STATE_OVERRUN); - // Send it if possible and state changed - udi_cdc_ctrl_state_notify(port, ep); -} - - -// ------------------------ -//------- Internal routines to process data transfer - - -static bool udi_cdc_rx_start(uint8_t port) -{ - irqflags_t flags; - uint8_t buf_sel_trans; - udd_ep_id_t ep; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - flags = cpu_irq_save(); - buf_sel_trans = udi_cdc_rx_buf_sel[port]; - if (udi_cdc_rx_trans_ongoing[port] || - (udi_cdc_rx_pos[port] < udi_cdc_rx_buf_nb[port][buf_sel_trans])) { - // Transfer already on-going or current buffer no empty - cpu_irq_restore(flags); - return false; - } - - // Change current buffer - udi_cdc_rx_pos[port] = 0; - udi_cdc_rx_buf_sel[port] = (buf_sel_trans==0)?1:0; - - // Start transfer on RX - udi_cdc_rx_trans_ongoing[port] = true; - cpu_irq_restore(flags); - - if (udi_cdc_multi_is_rx_ready(port)) { - UDI_CDC_RX_NOTIFY(port); - } - // Send the buffer with enable of short packet - switch (port) { -#define UDI_CDC_PORT_TO_DATA_EP_OUT(index, unused) \ - case index: \ - ep = UDI_CDC_DATA_EP_OUT_##index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_OUT, ~) -#undef UDI_CDC_PORT_TO_DATA_EP_OUT - default: - ep = UDI_CDC_DATA_EP_OUT_0; - break; - } - return udd_ep_run(ep, - true, - udi_cdc_rx_buf[port][buf_sel_trans], - UDI_CDC_RX_BUFFERS, - udi_cdc_data_received); -} - - -static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) -{ - uint8_t buf_sel_trans; - uint8_t port; - - switch (ep) { -#define UDI_CDC_DATA_EP_OUT_TO_PORT(index, unused) \ - case UDI_CDC_DATA_EP_OUT_##index: \ - port = index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DATA_EP_OUT_TO_PORT, ~) -#undef UDI_CDC_DATA_EP_OUT_TO_PORT - default: - port = 0; - break; - } - - if (UDD_EP_TRANSFER_OK != status) { - // Abort reception - return; - } - buf_sel_trans = (udi_cdc_rx_buf_sel[port]==0)?1:0; - if (!n) { - udd_ep_run( ep, - true, - udi_cdc_rx_buf[port][buf_sel_trans], - UDI_CDC_RX_BUFFERS, - udi_cdc_data_received); - return; - } - udi_cdc_rx_buf_nb[port][buf_sel_trans] = n; - udi_cdc_rx_trans_ongoing[port] = false; - udi_cdc_rx_start(port); -} - - -static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) -{ - uint8_t port; - UNUSED(n); - - switch (ep) { -#define UDI_CDC_DATA_EP_IN_TO_PORT(index, unused) \ - case UDI_CDC_DATA_EP_IN_##index: \ - port = index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DATA_EP_IN_TO_PORT, ~) -#undef UDI_CDC_DATA_EP_IN_TO_PORT - default: - port = 0; - break; - } - - if (UDD_EP_TRANSFER_OK != status) { - // Abort transfer - return; - } - udi_cdc_tx_buf_nb[port][(udi_cdc_tx_buf_sel[port]==0)?1:0] = 0; - udi_cdc_tx_both_buf_to_send[port] = false; - udi_cdc_tx_trans_ongoing[port] = false; - - if (n != 0) { - UDI_CDC_TX_EMPTY_NOTIFY(port); - } - udi_cdc_tx_send(port); -} - - -static void udi_cdc_tx_send(uint8_t port) -{ - irqflags_t flags; - uint8_t buf_sel_trans; - bool b_short_packet; - udd_ep_id_t ep; - static uint16_t sof_zlp_counter = 0; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - if (udi_cdc_tx_trans_ongoing[port]) { - return; // Already on going or wait next SOF to send next data - } - if (udd_is_high_speed()) { - if (udi_cdc_tx_sof_num[port] == udd_get_micro_frame_number()) { - return; // Wait next SOF to send next data - } - }else{ - if (udi_cdc_tx_sof_num[port] == udd_get_frame_number()) { - return; // Wait next SOF to send next data - } - } - - flags = cpu_irq_save(); // to protect udi_cdc_tx_buf_sel - buf_sel_trans = udi_cdc_tx_buf_sel[port]; - if (udi_cdc_tx_buf_nb[port][buf_sel_trans] == 0) { - sof_zlp_counter++; - if (((!udd_is_high_speed()) && (sof_zlp_counter < 100)) - || (udd_is_high_speed() && (sof_zlp_counter < 800))) { - cpu_irq_restore(flags); - return; - } - } - sof_zlp_counter = 0; - - if (!udi_cdc_tx_both_buf_to_send[port]) { - // Send current Buffer - // and switch the current buffer - udi_cdc_tx_buf_sel[port] = (buf_sel_trans==0)?1:0; - }else{ - // Send the other Buffer - // and no switch the current buffer - buf_sel_trans = (buf_sel_trans==0)?1:0; - } - udi_cdc_tx_trans_ongoing[port] = true; - cpu_irq_restore(flags); - - b_short_packet = (udi_cdc_tx_buf_nb[port][buf_sel_trans] != UDI_CDC_TX_BUFFERS); - if (b_short_packet) { - if (udd_is_high_speed()) { - udi_cdc_tx_sof_num[port] = udd_get_micro_frame_number(); - }else{ - udi_cdc_tx_sof_num[port] = udd_get_frame_number(); - } - }else{ - udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF - } - - // Send the buffer with enable of short packet - switch (port) { -#define UDI_CDC_PORT_TO_DATA_EP_IN(index, unused) \ - case index: \ - ep = UDI_CDC_DATA_EP_IN_##index; \ - break; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_IN, ~) -#undef UDI_CDC_PORT_TO_DATA_EP_IN - default: - ep = UDI_CDC_DATA_EP_IN_0; - break; - } - udd_ep_run( ep, - b_short_packet, - udi_cdc_tx_buf[port][buf_sel_trans], - udi_cdc_tx_buf_nb[port][buf_sel_trans], - udi_cdc_data_sent); -} - - -// ------------------------ -//------- Application interface - - -//------- Application interface - -void udi_cdc_ctrl_signal_dcd(bool b_set) -{ - udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); -} - -void udi_cdc_ctrl_signal_dsr(bool b_set) -{ - udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); -} - -void udi_cdc_signal_framing_error(void) -{ - udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); -} - -void udi_cdc_signal_parity_error(void) -{ - udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); -} - -void udi_cdc_signal_overrun(void) -{ - udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); -} - -void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) -{ - udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); -} - -void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) -{ - udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); -} - -void udi_cdc_multi_signal_framing_error(uint8_t port) -{ - udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); -} - -void udi_cdc_multi_signal_parity_error(uint8_t port) -{ - udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); -} - -void udi_cdc_multi_signal_overrun(uint8_t port) -{ - udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); -} - -iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) -{ - irqflags_t flags; - uint16_t pos; - iram_size_t nb_received; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - flags = cpu_irq_save(); - pos = udi_cdc_rx_pos[port]; - nb_received = udi_cdc_rx_buf_nb[port][udi_cdc_rx_buf_sel[port]] - pos; - cpu_irq_restore(flags); - return nb_received; -} - -iram_size_t udi_cdc_get_nb_received_data(void) -{ - return udi_cdc_multi_get_nb_received_data(0); -} - -bool udi_cdc_multi_is_rx_ready(uint8_t port) -{ - return (udi_cdc_multi_get_nb_received_data(port) > 0); -} - -bool udi_cdc_is_rx_ready(void) -{ - return udi_cdc_multi_is_rx_ready(0); -} - -int udi_cdc_multi_getc(uint8_t port) -{ - irqflags_t flags; - int rx_data = 0; - bool b_databit_9; - uint16_t pos; - uint8_t buf_sel; - bool again; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - b_databit_9 = (9 == udi_cdc_line_coding[port].bDataBits); - -udi_cdc_getc_process_one_byte: - // Check available data - flags = cpu_irq_save(); - pos = udi_cdc_rx_pos[port]; - buf_sel = udi_cdc_rx_buf_sel[port]; - again = pos >= udi_cdc_rx_buf_nb[port][buf_sel]; - cpu_irq_restore(flags); - while (again) { - if (!udi_cdc_data_running) { - return 0; - } - goto udi_cdc_getc_process_one_byte; - } - - // Read data - rx_data |= udi_cdc_rx_buf[port][buf_sel][pos]; - udi_cdc_rx_pos[port] = pos+1; - - udi_cdc_rx_start(port); - - if (b_databit_9) { - // Receive MSB - b_databit_9 = false; - rx_data = rx_data << 8; - goto udi_cdc_getc_process_one_byte; - } - return rx_data; -} - -int udi_cdc_getc(void) -{ - return udi_cdc_multi_getc(0); -} - -iram_size_t udi_cdc_multi_read_buf(uint8_t port, void* buf, iram_size_t size) -{ - irqflags_t flags; - uint8_t *ptr_buf = (uint8_t *)buf; - iram_size_t copy_nb; - uint16_t pos; - uint8_t buf_sel; - bool again; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - -udi_cdc_read_buf_loop_wait: - // Check available data - flags = cpu_irq_save(); - pos = udi_cdc_rx_pos[port]; - buf_sel = udi_cdc_rx_buf_sel[port]; - again = pos >= udi_cdc_rx_buf_nb[port][buf_sel]; - cpu_irq_restore(flags); - while (again) { - if (!udi_cdc_data_running) { - return size; - } - goto udi_cdc_read_buf_loop_wait; - } - - // Read data - copy_nb = udi_cdc_rx_buf_nb[port][buf_sel] - pos; - if (copy_nb>size) { - copy_nb = size; - } - memcpy(ptr_buf, &udi_cdc_rx_buf[port][buf_sel][pos], copy_nb); - udi_cdc_rx_pos[port] += copy_nb; - ptr_buf += copy_nb; - size -= copy_nb; - udi_cdc_rx_start(port); - - if (size) { - goto udi_cdc_read_buf_loop_wait; - } - return 0; -} - -static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void* buf, iram_size_t size) -{ - uint8_t *ptr_buf = (uint8_t *)buf; - iram_size_t nb_avail_data; - uint16_t pos; - uint8_t buf_sel; - irqflags_t flags; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - //Data interface not started... exit - if (!udi_cdc_data_running) { - return 0; - } - - //Get number of available data - // Check available data - flags = cpu_irq_save(); // to protect udi_cdc_rx_pos & udi_cdc_rx_buf_sel - pos = udi_cdc_rx_pos[port]; - buf_sel = udi_cdc_rx_buf_sel[port]; - nb_avail_data = udi_cdc_rx_buf_nb[port][buf_sel] - pos; - cpu_irq_restore(flags); - //If the buffer contains less than the requested number of data, - //adjust read size - if(nb_avail_data0) { - memcpy(ptr_buf, &udi_cdc_rx_buf[port][buf_sel][pos], size); - flags = cpu_irq_save(); // to protect udi_cdc_rx_pos - udi_cdc_rx_pos[port] += size; - cpu_irq_restore(flags); - - ptr_buf += size; - udi_cdc_rx_start(port); - } - return(nb_avail_data); -} - -iram_size_t udi_cdc_read_no_polling(void* buf, iram_size_t size) -{ - return udi_cdc_multi_read_no_polling(0, buf, size); -} - -iram_size_t udi_cdc_read_buf(void* buf, iram_size_t size) -{ - return udi_cdc_multi_read_buf(0, buf, size); -} - -iram_size_t __attribute__((optimize("O0"))) udi_cdc_multi_get_free_tx_buffer(uint8_t port) -{ - irqflags_t flags; - iram_size_t buf_sel_nb, retval; - uint8_t buf_sel; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - flags = cpu_irq_save(); - buf_sel = udi_cdc_tx_buf_sel[port]; - buf_sel_nb = udi_cdc_tx_buf_nb[port][buf_sel]; - if (buf_sel_nb == UDI_CDC_TX_BUFFERS) { - if ((!udi_cdc_tx_trans_ongoing[port]) - && (!udi_cdc_tx_both_buf_to_send[port])) { - /* One buffer is full, but the other buffer is not used. - * (not used = transfer on-going) - * then move to the other buffer to store data */ - udi_cdc_tx_both_buf_to_send[port] = true; - udi_cdc_tx_buf_sel[port] = (buf_sel == 0)? 1 : 0; - buf_sel_nb = 0; - } - } - retval = UDI_CDC_TX_BUFFERS - buf_sel_nb; - cpu_irq_restore(flags); - return retval; -} - -iram_size_t udi_cdc_get_free_tx_buffer(void) -{ - return udi_cdc_multi_get_free_tx_buffer(0); -} - -bool udi_cdc_multi_is_tx_ready(uint8_t port) -{ - return (udi_cdc_multi_get_free_tx_buffer(port) != 0); -} - -bool udi_cdc_is_tx_ready(void) -{ - return udi_cdc_multi_is_tx_ready(0); -} - -int udi_cdc_multi_putc(uint8_t port, int value) -{ - irqflags_t flags; - bool b_databit_9; - uint8_t buf_sel; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - b_databit_9 = (9 == udi_cdc_line_coding[port].bDataBits); - -udi_cdc_putc_process_one_byte: - // Check available space - if (!udi_cdc_multi_is_tx_ready(port)) { - if (!udi_cdc_data_running) { - return false; - } - goto udi_cdc_putc_process_one_byte; - } - - // Write value - flags = cpu_irq_save(); - buf_sel = udi_cdc_tx_buf_sel[port]; - udi_cdc_tx_buf[port][buf_sel][udi_cdc_tx_buf_nb[port][buf_sel]++] = value; - cpu_irq_restore(flags); - - if (b_databit_9) { - // Send MSB - b_databit_9 = false; - value = value >> 8; - goto udi_cdc_putc_process_one_byte; - } - return true; -} - -int udi_cdc_putc(int value) -{ - return udi_cdc_multi_putc(0, value); -} - -iram_size_t __attribute__((optimize("O0"))) udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t size) -{ - irqflags_t flags; - uint8_t buf_sel; - uint16_t buf_nb; - iram_size_t copy_nb; - uint8_t *ptr_buf = (uint8_t *)buf; - -#if UDI_CDC_PORT_NB == 1 // To optimize code - port = 0; -#endif - - if (9 == udi_cdc_line_coding[port].bDataBits) { - size *=2; - } - -udi_cdc_write_buf_loop_wait: - // Check available space - if (!udi_cdc_multi_is_tx_ready(port)) { - if (!udi_cdc_data_running) { - return size; - } - goto udi_cdc_write_buf_loop_wait; - } - - // Write values - flags = cpu_irq_save(); - buf_sel = udi_cdc_tx_buf_sel[port]; - buf_nb = udi_cdc_tx_buf_nb[port][buf_sel]; - copy_nb = UDI_CDC_TX_BUFFERS - buf_nb; - if (copy_nb > size) { - copy_nb = size; - } - memcpy(&udi_cdc_tx_buf[port][buf_sel][buf_nb], ptr_buf, copy_nb); - udi_cdc_tx_buf_nb[port][buf_sel] = buf_nb + copy_nb; - cpu_irq_restore(flags); - - // Update buffer pointer - ptr_buf = ptr_buf + copy_nb; - size -= copy_nb; - - if (size) { - goto udi_cdc_write_buf_loop_wait; - } - - return 0; -} - -iram_size_t udi_cdc_write_buf(const void* buf, iram_size_t size) -{ - return udi_cdc_multi_write_buf(0, buf, size); -} - -//@} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h deleted file mode 100644 index 526419c860..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h +++ /dev/null @@ -1,810 +0,0 @@ -/** - * \file - * - * \brief USB Device Communication Device Class (CDC) interface definitions. - * - * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDI_CDC_H_ -#define _UDI_CDC_H_ - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "usb_protocol_cdc.h" -#include "udd.h" -#include "udc_desc.h" -#include "udi.h" - -// Check the number of port -#ifndef UDI_CDC_PORT_NB -# define UDI_CDC_PORT_NB 1 -#endif -#if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7) -# error UDI_CDC_PORT_NB must be between 1 and 7 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup udi_cdc_group_udc - * @{ - */ - -//! Global structure which contains standard UDI API for UDC -extern UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm; -extern UDC_DESC_STORAGE udi_api_t udi_api_cdc_data; -//@} - -/** - * \ingroup udi_cdc_group - * \defgroup udi_cdc_group_desc USB interface descriptors - * - * The following structures provide predefined USB interface descriptors. - * It must be used to define the final USB descriptors. - */ -//@{ - -/** - * \brief Communication Class interface descriptor - * - * Interface descriptor with associated functional and endpoint - * descriptors for the CDC Communication Class interface. - */ -typedef struct { - //! Standard interface descriptor - usb_iface_desc_t iface; - //! CDC Header functional descriptor - usb_cdc_hdr_desc_t header; - //! CDC Abstract Control Model functional descriptor - usb_cdc_acm_desc_t acm; - //! CDC Union functional descriptor - usb_cdc_union_desc_t union_desc; - //! CDC Call Management functional descriptor - usb_cdc_call_mgmt_desc_t call_mgmt; - //! Notification endpoint descriptor - usb_ep_desc_t ep_notify; -} udi_cdc_comm_desc_t; - - -/** - * \brief Data Class interface descriptor - * - * Interface descriptor with associated endpoint descriptors for the - * CDC Data Class interface. - */ -typedef struct { - //! Standard interface descriptor - usb_iface_desc_t iface; - //! Data IN/OUT endpoint descriptors - usb_ep_desc_t ep_in; - usb_ep_desc_t ep_out; -} udi_cdc_data_desc_t; - - -//! CDC communication endpoints size for all speeds -#define UDI_CDC_COMM_EP_SIZE 64 -//! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) -#define UDI_CDC_DATA_EPS_FS_SIZE 64 -//! CDC data endpoints size for HS speed (512B only) -#define UDI_CDC_DATA_EPS_HS_SIZE 512 - -/** - * \name Content of interface descriptors - * Up to 7 CDC interfaces can be implemented on a USB device. - */ -//@{ -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_0 -#define UDI_CDC_IAD_STRING_ID_0 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_0 -#define UDI_CDC_COMM_STRING_ID_0 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_0 -#define UDI_CDC_DATA_STRING_ID_0 0 -#endif -#define UDI_CDC_IAD_DESC_0 UDI_CDC_IAD_DESC(0) -#define UDI_CDC_COMM_DESC_0 UDI_CDC_COMM_DESC(0) -#define UDI_CDC_DATA_DESC_0_FS UDI_CDC_DATA_DESC_FS(0) -#define UDI_CDC_DATA_DESC_0_HS UDI_CDC_DATA_DESC_HS(0) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_1 -#define UDI_CDC_IAD_STRING_ID_1 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_1 -#define UDI_CDC_COMM_STRING_ID_1 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_1 -#define UDI_CDC_DATA_STRING_ID_1 0 -#endif -#define UDI_CDC_IAD_DESC_1 UDI_CDC_IAD_DESC(1) -#define UDI_CDC_COMM_DESC_1 UDI_CDC_COMM_DESC(1) -#define UDI_CDC_DATA_DESC_1_FS UDI_CDC_DATA_DESC_FS(1) -#define UDI_CDC_DATA_DESC_1_HS UDI_CDC_DATA_DESC_HS(1) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_2 -#define UDI_CDC_IAD_STRING_ID_2 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_2 -#define UDI_CDC_COMM_STRING_ID_2 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_2 -#define UDI_CDC_DATA_STRING_ID_2 0 -#endif -#define UDI_CDC_IAD_DESC_2 UDI_CDC_IAD_DESC(2) -#define UDI_CDC_COMM_DESC_2 UDI_CDC_COMM_DESC(2) -#define UDI_CDC_DATA_DESC_2_FS UDI_CDC_DATA_DESC_FS(2) -#define UDI_CDC_DATA_DESC_2_HS UDI_CDC_DATA_DESC_HS(2) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_3 -#define UDI_CDC_IAD_STRING_ID_3 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_3 -#define UDI_CDC_COMM_STRING_ID_3 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_3 -#define UDI_CDC_DATA_STRING_ID_3 0 -#endif -#define UDI_CDC_IAD_DESC_3 UDI_CDC_IAD_DESC(3) -#define UDI_CDC_COMM_DESC_3 UDI_CDC_COMM_DESC(3) -#define UDI_CDC_DATA_DESC_3_FS UDI_CDC_DATA_DESC_FS(3) -#define UDI_CDC_DATA_DESC_3_HS UDI_CDC_DATA_DESC_HS(3) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_4 -#define UDI_CDC_IAD_STRING_ID_4 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_4 -#define UDI_CDC_COMM_STRING_ID_4 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_4 -#define UDI_CDC_DATA_STRING_ID_4 0 -#endif -#define UDI_CDC_IAD_DESC_4 UDI_CDC_IAD_DESC(4) -#define UDI_CDC_COMM_DESC_4 UDI_CDC_COMM_DESC(4) -#define UDI_CDC_DATA_DESC_4_FS UDI_CDC_DATA_DESC_FS(4) -#define UDI_CDC_DATA_DESC_4_HS UDI_CDC_DATA_DESC_HS(4) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_5 -#define UDI_CDC_IAD_STRING_ID_5 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_5 -#define UDI_CDC_COMM_STRING_ID_5 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_5 -#define UDI_CDC_DATA_STRING_ID_5 0 -#endif -#define UDI_CDC_IAD_DESC_5 UDI_CDC_IAD_DESC(5) -#define UDI_CDC_COMM_DESC_5 UDI_CDC_COMM_DESC(5) -#define UDI_CDC_DATA_DESC_5_FS UDI_CDC_DATA_DESC_FS(5) -#define UDI_CDC_DATA_DESC_5_HS UDI_CDC_DATA_DESC_HS(5) - -//! By default no string associated to these interfaces -#ifndef UDI_CDC_IAD_STRING_ID_6 -#define UDI_CDC_IAD_STRING_ID_6 0 -#endif -#ifndef UDI_CDC_COMM_STRING_ID_6 -#define UDI_CDC_COMM_STRING_ID_6 0 -#endif -#ifndef UDI_CDC_DATA_STRING_ID_6 -#define UDI_CDC_DATA_STRING_ID_6 0 -#endif -#define UDI_CDC_IAD_DESC_6 UDI_CDC_IAD_DESC(6) -#define UDI_CDC_COMM_DESC_6 UDI_CDC_COMM_DESC(6) -#define UDI_CDC_DATA_DESC_6_FS UDI_CDC_DATA_DESC_FS(6) -#define UDI_CDC_DATA_DESC_6_HS UDI_CDC_DATA_DESC_HS(6) -//@} - - -//! Content of CDC IAD interface descriptor for all speeds -#define UDI_CDC_IAD_DESC(port) { \ - .bLength = sizeof(usb_iad_desc_t),\ - .bDescriptorType = USB_DT_IAD,\ - .bInterfaceCount = 2,\ - .bFunctionClass = CDC_CLASS_COMM,\ - .bFunctionSubClass = CDC_SUBCLASS_ACM,\ - .bFunctionProtocol = CDC_PROTOCOL_V25TER,\ - .bFirstInterface = UDI_CDC_COMM_IFACE_NUMBER_##port,\ - .iFunction = UDI_CDC_IAD_STRING_ID_##port,\ - } - -//! Content of CDC COMM interface descriptor for all speeds -#define UDI_CDC_COMM_DESC(port) { \ - .iface.bLength = sizeof(usb_iface_desc_t),\ - .iface.bDescriptorType = USB_DT_INTERFACE,\ - .iface.bAlternateSetting = 0,\ - .iface.bNumEndpoints = 1,\ - .iface.bInterfaceClass = CDC_CLASS_COMM,\ - .iface.bInterfaceSubClass = CDC_SUBCLASS_ACM,\ - .iface.bInterfaceProtocol = CDC_PROTOCOL_V25TER,\ - .header.bFunctionLength = sizeof(usb_cdc_hdr_desc_t),\ - .header.bDescriptorType = CDC_CS_INTERFACE,\ - .header.bDescriptorSubtype = CDC_SCS_HEADER,\ - .header.bcdCDC = LE16(0x0110),\ - .call_mgmt.bFunctionLength = sizeof(usb_cdc_call_mgmt_desc_t),\ - .call_mgmt.bDescriptorType = CDC_CS_INTERFACE,\ - .call_mgmt.bDescriptorSubtype = CDC_SCS_CALL_MGMT,\ - .call_mgmt.bmCapabilities = \ - CDC_CALL_MGMT_SUPPORTED | CDC_CALL_MGMT_OVER_DCI,\ - .acm.bFunctionLength = sizeof(usb_cdc_acm_desc_t),\ - .acm.bDescriptorType = CDC_CS_INTERFACE,\ - .acm.bDescriptorSubtype = CDC_SCS_ACM,\ - .acm.bmCapabilities = CDC_ACM_SUPPORT_LINE_REQUESTS,\ - .union_desc.bFunctionLength = sizeof(usb_cdc_union_desc_t),\ - .union_desc.bDescriptorType = CDC_CS_INTERFACE,\ - .union_desc.bDescriptorSubtype= CDC_SCS_UNION,\ - .ep_notify.bLength = sizeof(usb_ep_desc_t),\ - .ep_notify.bDescriptorType = USB_DT_ENDPOINT,\ - .ep_notify.bmAttributes = USB_EP_TYPE_INTERRUPT,\ - .ep_notify.wMaxPacketSize = LE16(UDI_CDC_COMM_EP_SIZE),\ - .ep_notify.bInterval = 0x10,\ - .ep_notify.bEndpointAddress = UDI_CDC_COMM_EP_##port,\ - .iface.bInterfaceNumber = UDI_CDC_COMM_IFACE_NUMBER_##port,\ - .call_mgmt.bDataInterface = UDI_CDC_DATA_IFACE_NUMBER_##port,\ - .union_desc.bMasterInterface = UDI_CDC_COMM_IFACE_NUMBER_##port,\ - .union_desc.bSlaveInterface0 = UDI_CDC_DATA_IFACE_NUMBER_##port,\ - .iface.iInterface = UDI_CDC_COMM_STRING_ID_##port,\ - } - -//! Content of CDC DATA interface descriptors -#define UDI_CDC_DATA_DESC_COMMON \ - .iface.bLength = sizeof(usb_iface_desc_t),\ - .iface.bDescriptorType = USB_DT_INTERFACE,\ - .iface.bAlternateSetting = 0,\ - .iface.bNumEndpoints = 2,\ - .iface.bInterfaceClass = CDC_CLASS_DATA,\ - .iface.bInterfaceSubClass = 0,\ - .iface.bInterfaceProtocol = 0,\ - .ep_in.bLength = sizeof(usb_ep_desc_t),\ - .ep_in.bDescriptorType = USB_DT_ENDPOINT,\ - .ep_in.bmAttributes = USB_EP_TYPE_BULK,\ - .ep_in.bInterval = 0,\ - .ep_out.bLength = sizeof(usb_ep_desc_t),\ - .ep_out.bDescriptorType = USB_DT_ENDPOINT,\ - .ep_out.bmAttributes = USB_EP_TYPE_BULK,\ - .ep_out.bInterval = 0, - -#define UDI_CDC_DATA_DESC_FS(port) { \ - UDI_CDC_DATA_DESC_COMMON \ - .ep_in.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_FS_SIZE),\ - .ep_out.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_FS_SIZE),\ - .ep_in.bEndpointAddress = UDI_CDC_DATA_EP_IN_##port,\ - .ep_out.bEndpointAddress = UDI_CDC_DATA_EP_OUT_##port,\ - .iface.bInterfaceNumber = UDI_CDC_DATA_IFACE_NUMBER_##port,\ - .iface.iInterface = UDI_CDC_DATA_STRING_ID_##port,\ - } - -#define UDI_CDC_DATA_DESC_HS(port) { \ - UDI_CDC_DATA_DESC_COMMON \ - .ep_in.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_HS_SIZE),\ - .ep_out.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_HS_SIZE),\ - .ep_in.bEndpointAddress = UDI_CDC_DATA_EP_IN_##port,\ - .ep_out.bEndpointAddress = UDI_CDC_DATA_EP_OUT_##port,\ - .iface.bInterfaceNumber = UDI_CDC_DATA_IFACE_NUMBER_##port,\ - .iface.iInterface = UDI_CDC_DATA_STRING_ID_##port,\ - } - -//@} - -/** - * \ingroup udi_group - * \defgroup udi_cdc_group USB Device Interface (UDI) for Communication Class Device (CDC) - * - * Common APIs used by high level application to use this USB class. - * - * These routines are used to transfer and control data - * to/from USB CDC endpoint. - * - * See \ref udi_cdc_quickstart. - * @{ - */ - -/** - * \name Interface for application with single CDC interface support - */ -//@{ - -/** - * \brief Notify a state change of DCD signal - * - * \param b_set DCD is enabled if true, else disabled - */ -void udi_cdc_ctrl_signal_dcd(bool b_set); - -/** - * \brief Notify a state change of DSR signal - * - * \param b_set DSR is enabled if true, else disabled - */ -void udi_cdc_ctrl_signal_dsr(bool b_set); - -/** - * \brief Notify a framing error - */ -void udi_cdc_signal_framing_error(void); - -/** - * \brief Notify a parity error - */ -void udi_cdc_signal_parity_error(void); - -/** - * \brief Notify a overrun - */ -void udi_cdc_signal_overrun(void); - -/** - * \brief Gets the number of byte received - * - * \return the number of data available - */ -iram_size_t udi_cdc_get_nb_received_data(void); - -/** - * \brief This function checks if a character has been received on the CDC line - * - * \return \c 1 if a byte is ready to be read. - */ -bool udi_cdc_is_rx_ready(void); - -/** - * \brief Waits and gets a value on CDC line - * - * \return value read on CDC line - */ -int udi_cdc_getc(void); - -/** - * \brief Reads a RAM buffer on CDC line - * - * \param buf Values read - * \param size Number of value read - * - * \return the number of data remaining - */ -iram_size_t udi_cdc_read_buf(void* buf, iram_size_t size); - -/** - * \brief Non polling reads of a up to 'size' data from CDC line - * - * \param port Communication port number to manage - * \param buf Buffer where to store read data - * \param size Maximum number of data to read (size of buffer) - * - * \return the number of data effectively read - */ -iram_size_t udi_cdc_read_no_polling(void* buf, iram_size_t size); - -/** - * \brief Gets the number of free byte in TX buffer - * - * \return the number of free byte in TX buffer - */ -iram_size_t udi_cdc_get_free_tx_buffer(void); - -/** - * \brief This function checks if a new character sent is possible - * The type int is used to support scanf redirection from compiler LIB. - * - * \return \c 1 if a new character can be sent - */ -bool udi_cdc_is_tx_ready(void); - -/** - * \brief Puts a byte on CDC line - * The type int is used to support printf redirection from compiler LIB. - * - * \param value Value to put - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -int udi_cdc_putc(int value); - -/** - * \brief Writes a RAM buffer on CDC line - * - * \param buf Values to write - * \param size Number of value to write - * - * \return the number of data remaining - */ -iram_size_t udi_cdc_write_buf(const void* buf, iram_size_t size); -//@} - -/** - * \name Interface for application with multi CDC interfaces support - */ -//@{ - -/** - * \brief Notify a state change of DCD signal - * - * \param port Communication port number to manage - * \param b_set DCD is enabled if true, else disabled - */ -void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set); - -/** - * \brief Notify a state change of DSR signal - * - * \param port Communication port number to manage - * \param b_set DSR is enabled if true, else disabled - */ -void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set); - -/** - * \brief Notify a framing error - * - * \param port Communication port number to manage - */ -void udi_cdc_multi_signal_framing_error(uint8_t port); - -/** - * \brief Notify a parity error - * - * \param port Communication port number to manage - */ -void udi_cdc_multi_signal_parity_error(uint8_t port); - -/** - * \brief Notify a overrun - * - * \param port Communication port number to manage - */ -void udi_cdc_multi_signal_overrun(uint8_t port); - -/** - * \brief Gets the number of byte received - * - * \param port Communication port number to manage - * - * \return the number of data available - */ -iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port); - -/** - * \brief This function checks if a character has been received on the CDC line - * - * \param port Communication port number to manage - * - * \return \c 1 if a byte is ready to be read. - */ -bool udi_cdc_multi_is_rx_ready(uint8_t port); - -/** - * \brief Waits and gets a value on CDC line - * - * \param port Communication port number to manage - * - * \return value read on CDC line - */ -int udi_cdc_multi_getc(uint8_t port); - -/** - * \brief Reads a RAM buffer on CDC line - * - * \param port Communication port number to manage - * \param buf Values read - * \param size Number of values read - * - * \return the number of data remaining - */ -iram_size_t udi_cdc_multi_read_buf(uint8_t port, void* buf, iram_size_t size); - -/** - * \brief Gets the number of free byte in TX buffer - * - * \param port Communication port number to manage - * - * \return the number of free byte in TX buffer - */ -iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port); - -/** - * \brief This function checks if a new character sent is possible - * The type int is used to support scanf redirection from compiler LIB. - * - * \param port Communication port number to manage - * - * \return \c 1 if a new character can be sent - */ -bool udi_cdc_multi_is_tx_ready(uint8_t port); - -/** - * \brief Puts a byte on CDC line - * The type int is used to support printf redirection from compiler LIB. - * - * \param port Communication port number to manage - * \param value Value to put - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -int udi_cdc_multi_putc(uint8_t port, int value); - -/** - * \brief Writes a RAM buffer on CDC line - * - * \param port Communication port number to manage - * \param buf Values to write - * \param size Number of value to write - * - * \return the number of data remaining - */ -iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t size); -//@} - -//@} - -/** - * \page udi_cdc_quickstart Quick start guide for USB device Communication Class Device module (UDI CDC) - * - * This is the quick start guide for the \ref udi_cdc_group - * "USB device interface CDC module (UDI CDC)" with step-by-step instructions on - * how to configure and use the modules in a selection of use cases. - * - * The use cases contain several code fragments. The code fragments in the - * steps for setup can be copied into a custom initialization function, while - * the steps for usage can be copied into, e.g., the main application function. - * - * \section udi_cdc_basic_use_case Basic use case - * In this basic use case, the "USB CDC (Single Interface Device)" module is used - * with only one communication port. - * The "USB CDC (Composite Device)" module usage is described in \ref udi_cdc_use_cases - * "Advanced use cases". - * - * \section udi_cdc_basic_use_case_setup Setup steps - * \subsection udi_cdc_basic_use_case_setup_prereq Prerequisites - * \copydetails udc_basic_use_case_setup_prereq - * \subsection udi_cdc_basic_use_case_setup_code Example code - * \copydetails udc_basic_use_case_setup_code - * \subsection udi_cdc_basic_use_case_setup_flow Workflow - * \copydetails udc_basic_use_case_setup_flow - * - * \section udi_cdc_basic_use_case_usage Usage steps - * - * \subsection udi_cdc_basic_use_case_usage_code Example code - * Content of conf_usb.h: - * \code - #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable() - extern bool my_callback_cdc_enable(void); - #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable() - extern void my_callback_cdc_disable(void); - #define UDI_CDC_LOW_RATE - - #define UDI_CDC_DEFAULT_RATE 115200 - #define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 - #define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE - #define UDI_CDC_DEFAULT_DATABITS 8 - - #include "udi_cdc_conf.h" // At the end of conf_usb.h file -\endcode - * - * Add to application C-file: - * \code - static bool my_flag_autorize_cdc_transfert = false; - bool my_callback_cdc_enable(void) - { - my_flag_autorize_cdc_transfert = true; - return true; - } - void my_callback_cdc_disable(void) - { - my_flag_autorize_cdc_transfert = false; - } - - void task(void) - { - if (my_flag_autorize_cdc_transfert) { - udi_cdc_putc('A'); - udi_cdc_getc(); - } - } -\endcode - * - * \subsection udi_cdc_basic_use_case_setup_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following configuration, - * which is the USB device CDC configuration: - * - \code #define USB_DEVICE_SERIAL_NAME "12...EF" // Disk SN for CDC \endcode - * \note The USB serial number is mandatory when a CDC interface is used. - * - \code #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable() - extern bool my_callback_cdc_enable(void); \endcode - * \note After the device enumeration (detecting and identifying USB devices), - * the USB host starts the device configuration. When the USB CDC interface - * from the device is accepted by the host, the USB host enables this interface and the - * UDI_CDC_ENABLE_EXT() callback function is called and return true. - * Thus, when this event is received, the data transfer on CDC interface are authorized. - * - \code #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable() - extern void my_callback_cdc_disable(void); \endcode - * \note When the USB device is unplugged or is reset by the USB host, the USB - * interface is disabled and the UDI_CDC_DISABLE_EXT() callback function - * is called. Thus, the data transfer must be stopped on CDC interface. - * - \code #define UDI_CDC_LOW_RATE \endcode - * \note Define it when the transfer CDC Device to Host is a low rate - * (<512000 bauds) to reduce CDC buffers size. - * - \code #define UDI_CDC_DEFAULT_RATE 115200 - #define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 - #define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE - #define UDI_CDC_DEFAULT_DATABITS 8 \endcode - * \note Default configuration of communication port at startup. - * -# Send or wait data on CDC line: - * - \code // Waits and gets a value on CDC line - int udi_cdc_getc(void); - // Reads a RAM buffer on CDC line - iram_size_t udi_cdc_read_buf(int* buf, iram_size_t size); - // Puts a byte on CDC line - int udi_cdc_putc(int value); - // Writes a RAM buffer on CDC line - iram_size_t udi_cdc_write_buf(const int* buf, iram_size_t size); \endcode - * - * \section udi_cdc_use_cases Advanced use cases - * For more advanced use of the UDI CDC module, see the following use cases: - * - \subpage udi_cdc_use_case_composite - * - \subpage udc_use_case_1 - * - \subpage udc_use_case_2 - * - \subpage udc_use_case_3 - * - \subpage udc_use_case_4 - * - \subpage udc_use_case_5 - * - \subpage udc_use_case_6 - */ - -/** - * \page udi_cdc_use_case_composite CDC in a composite device - * - * A USB Composite Device is a USB Device which uses more than one USB class. - * In this use case, the "USB CDC (Composite Device)" module is used to - * create a USB composite device. Thus, this USB module can be associated with - * another "Composite Device" module, like "USB HID Mouse (Composite Device)". - * - * Also, you can refer to application note - * - * AVR4902 ASF - USB Composite Device. - * - * \section udi_cdc_use_case_composite_setup Setup steps - * For the setup code of this use case to work, the - * \ref udi_cdc_basic_use_case "basic use case" must be followed. - * - * \section udi_cdc_use_case_composite_usage Usage steps - * - * \subsection udi_cdc_use_case_composite_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_EP_CTRL_SIZE 64 - #define USB_DEVICE_NB_INTERFACE (X+2) - #define USB_DEVICE_MAX_EP (X+3) - - #define UDI_CDC_DATA_EP_IN_0 (1 | USB_EP_DIR_IN) // TX - #define UDI_CDC_DATA_EP_OUT_0 (2 | USB_EP_DIR_OUT) // RX - #define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint - #define UDI_CDC_COMM_IFACE_NUMBER_0 X+0 - #define UDI_CDC_DATA_IFACE_NUMBER_0 X+1 - - #define UDI_COMPOSITE_DESC_T \ - usb_iad_desc_t udi_cdc_iad; \ - udi_cdc_comm_desc_t udi_cdc_comm; \ - udi_cdc_data_desc_t udi_cdc_data; \ - ... - #define UDI_COMPOSITE_DESC_FS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_FS, \ - ... - #define UDI_COMPOSITE_DESC_HS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_HS, \ - ... - #define UDI_COMPOSITE_API \ - &udi_api_cdc_comm, \ - &udi_api_cdc_data, \ - ... -\endcode - * - * \subsection udi_cdc_use_case_composite_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required for a USB composite device configuration: - * - \code // Endpoint control size, This must be: - // - 8, 16, 32 or 64 for full speed device (8 is recommended to save RAM) - // - 64 for a high speed device - #define USB_DEVICE_EP_CTRL_SIZE 64 - // Total Number of interfaces on this USB device. - // Add 2 for CDC. - #define USB_DEVICE_NB_INTERFACE (X+2) - // Total number of endpoints on this USB device. - // This must include each endpoint for each interface. - // Add 3 for CDC. - #define USB_DEVICE_MAX_EP (X+3) \endcode - * -# Ensure that conf_usb.h contains the description of - * composite device: - * - \code // The endpoint numbers chosen by you for the CDC. - // The endpoint numbers starting from 1. - #define UDI_CDC_DATA_EP_IN_0 (1 | USB_EP_DIR_IN) // TX - #define UDI_CDC_DATA_EP_OUT_0 (2 | USB_EP_DIR_OUT) // RX - #define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint - // The interface index of an interface starting from 0 - #define UDI_CDC_COMM_IFACE_NUMBER_0 X+0 - #define UDI_CDC_DATA_IFACE_NUMBER_0 X+1 \endcode - * -# Ensure that conf_usb.h contains the following parameters - * required for a USB composite device configuration: - * - \code // USB Interfaces descriptor structure - #define UDI_COMPOSITE_DESC_T \ - ... - usb_iad_desc_t udi_cdc_iad; \ - udi_cdc_comm_desc_t udi_cdc_comm; \ - udi_cdc_data_desc_t udi_cdc_data; \ - ... - // USB Interfaces descriptor value for Full Speed - #define UDI_COMPOSITE_DESC_FS \ - ... - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_FS, \ - ... - // USB Interfaces descriptor value for High Speed - #define UDI_COMPOSITE_DESC_HS \ - ... - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_HS, \ - ... - // USB Interface APIs - #define UDI_COMPOSITE_API \ - ... - &udi_api_cdc_comm, \ - &udi_api_cdc_data, \ - ... \endcode - * - \note The descriptors order given in the four lists above must be the - * same as the order defined by all interface indexes. The interface index - * orders are defined through UDI_X_IFACE_NUMBER defines.\n - * Also, the CDC requires a USB Interface Association Descriptor (IAD) for - * composite device. - */ - -#ifdef __cplusplus -} -#endif -#endif // _UDI_CDC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h deleted file mode 100644 index cbd3eb00ae..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h +++ /dev/null @@ -1,156 +0,0 @@ -/** - * \file - * - * \brief Default CDC configuration for a USB Device with a single interface - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDI_CDC_CONF_H_ -#define _UDI_CDC_CONF_H_ - -#include "usb_protocol_cdc.h" -#include "conf_usb.h" - -#ifndef UDI_CDC_PORT_NB -# define UDI_CDC_PORT_NB 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup udi_cdc_group_single_desc - * @{ - */ - -//! Control endpoint size (Endpoint 0) -#define USB_DEVICE_EP_CTRL_SIZE 64 - -#if XMEGA -/** - * \name Endpoint configuration on XMEGA - * The XMEGA supports a IN and OUT endpoint with the same number endpoint, - * thus XMEGA can support up to 7 CDC interfaces. - */ -//@{ -#define UDI_CDC_DATA_EP_IN_0 ( 1 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_0 ( 2 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_0 ( 2 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_1 ( 3 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_1 ( 4 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_1 ( 4 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_2 ( 5 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_2 ( 6 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_2 ( 6 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_3 ( 7 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_3 ( 8 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_3 ( 8 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_4 ( 9 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_4 (10 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_4 (10 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_5 (11 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_5 (12 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_5 (12 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_6 (13 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_6 (14 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_6 (14 | USB_EP_DIR_IN) // Notify endpoint -//! 2 endpoints numbers used per CDC interface -#define USB_DEVICE_MAX_EP (2*UDI_CDC_PORT_NB) -//@} - -#else - -/** - * \name Default endpoint configuration - * The USBB, UDP, UDPHS and UOTGHS interfaces can support up to 2 CDC interfaces. - */ -//@{ -# if UDI_CDC_PORT_NB > 2 -# error USBB, UDP, UDPHS and UOTGHS interfaces have not enought endpoints. -# endif -#define UDI_CDC_DATA_EP_IN_0 (1 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_0 (2 | USB_EP_DIR_OUT) // RX -#define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint -# if SAM3U - /* For 3U max endpoint size of 4 is 64, use 5 and 6 as bulk tx and rx */ -# define UDI_CDC_DATA_EP_IN_1 (6 | USB_EP_DIR_IN) // TX -# define UDI_CDC_DATA_EP_OUT_1 (5 | USB_EP_DIR_OUT) // RX -# define UDI_CDC_COMM_EP_1 (4 | USB_EP_DIR_IN) // Notify -# else -# define UDI_CDC_DATA_EP_IN_1 (4 | USB_EP_DIR_IN) // TX -# define UDI_CDC_DATA_EP_OUT_1 (5 | USB_EP_DIR_OUT) // RX -# define UDI_CDC_COMM_EP_1 (6 | USB_EP_DIR_IN) // Notify -# endif -//! 3 endpoints used per CDC interface -#undef USB_DEVICE_MAX_EP // undefine this definition in header file -#define USB_DEVICE_MAX_EP (3*UDI_CDC_PORT_NB) -//@} - -#endif - -/** - * \name Default Interface numbers - */ -//@{ -#define UDI_CDC_COMM_IFACE_NUMBER_0 0 -#define UDI_CDC_DATA_IFACE_NUMBER_0 1 -#define UDI_CDC_COMM_IFACE_NUMBER_1 2 -#define UDI_CDC_DATA_IFACE_NUMBER_1 3 -#define UDI_CDC_COMM_IFACE_NUMBER_2 4 -#define UDI_CDC_DATA_IFACE_NUMBER_2 5 -#define UDI_CDC_COMM_IFACE_NUMBER_3 6 -#define UDI_CDC_DATA_IFACE_NUMBER_3 7 -#define UDI_CDC_COMM_IFACE_NUMBER_4 8 -#define UDI_CDC_DATA_IFACE_NUMBER_4 9 -#define UDI_CDC_COMM_IFACE_NUMBER_5 10 -#define UDI_CDC_DATA_IFACE_NUMBER_5 11 -#define UDI_CDC_COMM_IFACE_NUMBER_6 12 -#define UDI_CDC_DATA_IFACE_NUMBER_6 13 -//@} - -//@} - -#ifdef __cplusplus -} -#endif -#endif // _UDI_CDC_CONF_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c deleted file mode 100644 index 8f730ba823..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c +++ /dev/null @@ -1,261 +0,0 @@ -/** - * \file - * - * \brief Default descriptors for a USB Device with a single interface CDC - * - * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "conf_usb.h" -#include "udd.h" -#include "udc_desc.h" -#include "udi_cdc.h" - -#if DISABLED(SDSUPPORT) - -/** - * \defgroup udi_cdc_group_single_desc USB device descriptors for a single interface - * - * The following structures provide the USB device descriptors required for - * USB Device with a single interface CDC. - * - * It is ready to use and do not require more definition. - * - * @{ - */ - -//! Two interfaces for a CDC device -#define USB_DEVICE_NB_INTERFACE (2*UDI_CDC_PORT_NB) - -#ifdef USB_DEVICE_LPM_SUPPORT -# define USB_VERSION USB_V2_1 -#else -# define USB_VERSION USB_V2_0 -#endif - -//! USB Device Descriptor -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = { - .bLength = sizeof(usb_dev_desc_t), - .bDescriptorType = USB_DT_DEVICE, - .bcdUSB = LE16(USB_VERSION), -#if UDI_CDC_PORT_NB > 1 - .bDeviceClass = 0, -#else - .bDeviceClass = CDC_CLASS_DEVICE, -#endif - .bDeviceSubClass = 0, - .bDeviceProtocol = 0, - .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, - .idVendor = LE16(USB_DEVICE_VENDOR_ID), - .idProduct = LE16(USB_DEVICE_PRODUCT_ID), - .bcdDevice = LE16((USB_DEVICE_MAJOR_VERSION << 8) - | USB_DEVICE_MINOR_VERSION), -#ifdef USB_DEVICE_MANUFACTURE_NAME - .iManufacturer = 1, -#else - .iManufacturer = 0, // No manufacture string -#endif -#ifdef USB_DEVICE_PRODUCT_NAME - .iProduct = 2, -#else - .iProduct = 0, // No product string -#endif -#if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER) - .iSerialNumber = 3, -#else - .iSerialNumber = 0, // No serial string -#endif - .bNumConfigurations = 1 -}; - - -#ifdef USB_DEVICE_HS_SUPPORT -//! USB Device Qualifier Descriptor for HS -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE usb_dev_qual_desc_t udc_device_qual = { - .bLength = sizeof(usb_dev_qual_desc_t), - .bDescriptorType = USB_DT_DEVICE_QUALIFIER, - .bcdUSB = LE16(USB_VERSION), -#if UDI_CDC_PORT_NB > 1 - .bDeviceClass = 0, -#else - .bDeviceClass = CDC_CLASS_DEVICE, -#endif - .bDeviceSubClass = 0, - .bDeviceProtocol = 0, - .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, - .bNumConfigurations = 1 -}; -#endif - -#ifdef USB_DEVICE_LPM_SUPPORT -//! USB Device Qualifier Descriptor -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE usb_dev_lpm_desc_t udc_device_lpm = { - .bos.bLength = sizeof(usb_dev_bos_desc_t), - .bos.bDescriptorType = USB_DT_BOS, - .bos.wTotalLength = LE16(sizeof(usb_dev_bos_desc_t) + sizeof(usb_dev_capa_ext_desc_t)), - .bos.bNumDeviceCaps = 1, - .capa_ext.bLength = sizeof(usb_dev_capa_ext_desc_t), - .capa_ext.bDescriptorType = USB_DT_DEVICE_CAPABILITY, - .capa_ext.bDevCapabilityType = USB_DC_USB20_EXTENSION, - .capa_ext.bmAttributes = USB_DC_EXT_LPM, -}; -#endif - -//! Structure for USB Device Configuration Descriptor -COMPILER_PACK_SET(1) -typedef struct { - usb_conf_desc_t conf; -#if UDI_CDC_PORT_NB == 1 - udi_cdc_comm_desc_t udi_cdc_comm_0; - udi_cdc_data_desc_t udi_cdc_data_0; -#else -# define UDI_CDC_DESC_STRUCTURE(index, unused) \ - usb_iad_desc_t udi_cdc_iad_##index; \ - udi_cdc_comm_desc_t udi_cdc_comm_##index; \ - udi_cdc_data_desc_t udi_cdc_data_##index; - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DESC_STRUCTURE, ~) -# undef UDI_CDC_DESC_STRUCTURE -#endif -} udc_desc_t; -COMPILER_PACK_RESET() - -//! USB Device Configuration Descriptor filled for full and high speed -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE udc_desc_t udc_desc_fs = { - .conf.bLength = sizeof(usb_conf_desc_t), - .conf.bDescriptorType = USB_DT_CONFIGURATION, - .conf.wTotalLength = LE16(sizeof(udc_desc_t)), - .conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE, - .conf.bConfigurationValue = 1, - .conf.iConfiguration = 0, - .conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR, - .conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER), -#if UDI_CDC_PORT_NB == 1 - .udi_cdc_comm_0 = UDI_CDC_COMM_DESC_0, - .udi_cdc_data_0 = UDI_CDC_DATA_DESC_0_FS, -#else -# define UDI_CDC_DESC_FS(index, unused) \ - .udi_cdc_iad_##index = UDI_CDC_IAD_DESC_##index,\ - .udi_cdc_comm_##index = UDI_CDC_COMM_DESC_##index,\ - .udi_cdc_data_##index = UDI_CDC_DATA_DESC_##index##_FS, - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DESC_FS, ~) -# undef UDI_CDC_DESC_FS -#endif -}; - -#ifdef USB_DEVICE_HS_SUPPORT -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE udc_desc_t udc_desc_hs = { - .conf.bLength = sizeof(usb_conf_desc_t), - .conf.bDescriptorType = USB_DT_CONFIGURATION, - .conf.wTotalLength = LE16(sizeof(udc_desc_t)), - .conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE, - .conf.bConfigurationValue = 1, - .conf.iConfiguration = 0, - .conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR, - .conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER), -#if UDI_CDC_PORT_NB == 1 - .udi_cdc_comm_0 = UDI_CDC_COMM_DESC_0, - .udi_cdc_data_0 = UDI_CDC_DATA_DESC_0_HS, -#else -# define UDI_CDC_DESC_HS(index, unused) \ - .udi_cdc_iad_##index = UDI_CDC_IAD_DESC_##index, \ - .udi_cdc_comm_##index = UDI_CDC_COMM_DESC_##index, \ - .udi_cdc_data_##index = UDI_CDC_DATA_DESC_##index##_HS, - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DESC_HS, ~) -# undef UDI_CDC_DESC_HS -#endif -}; -#endif - -/** - * \name UDC structures which content all USB Device definitions - */ -//@{ - -//! Associate an UDI for each USB interface -UDC_DESC_STORAGE udi_api_t *udi_apis[USB_DEVICE_NB_INTERFACE] = { -# define UDI_CDC_API(index, unused) \ - &udi_api_cdc_comm, \ - &udi_api_cdc_data, - MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_API, ~) -# undef UDI_CDC_API -}; - -//! Add UDI with USB Descriptors FS & HS -UDC_DESC_STORAGE udc_config_speed_t udc_config_fs[1] = { { - .desc = (usb_conf_desc_t UDC_DESC_STORAGE*)&udc_desc_fs, - .udi_apis = udi_apis, -}}; -#ifdef USB_DEVICE_HS_SUPPORT -UDC_DESC_STORAGE udc_config_speed_t udc_config_hs[1] = { { - .desc = (usb_conf_desc_t UDC_DESC_STORAGE*)&udc_desc_hs, - .udi_apis = udi_apis, -}}; -#endif - -//! Add all information about USB Device in global structure for UDC -UDC_DESC_STORAGE udc_config_t udc_config = { - .confdev_lsfs = &udc_device_desc, - .conf_lsfs = udc_config_fs, -#ifdef USB_DEVICE_HS_SUPPORT - .confdev_hs = &udc_device_desc, - .qualifier = &udc_device_qual, - .conf_hs = udc_config_hs, -#endif -#ifdef USB_DEVICE_LPM_SUPPORT - .conf_bos = &udc_device_lpm.bos, -#else - .conf_bos = NULL, -#endif -}; - -//@} -//@} - -#endif // SDSUPPORT - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c deleted file mode 100644 index 07bdd1b9d6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c +++ /dev/null @@ -1,192 +0,0 @@ -/** - * \file - * - * \brief Descriptors for an USB Composite Device - * - * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "conf_usb.h" -#include "udd.h" -#include "udc_desc.h" - -#if ENABLED(SDSUPPORT) - -/** - * \defgroup udi_group_desc Descriptors for a USB Device - * composite - * - * @{ - */ - -/**INDENT-OFF**/ - -//! USB Device Descriptor -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = { - .bLength = sizeof(usb_dev_desc_t), - .bDescriptorType = USB_DT_DEVICE, - .bcdUSB = LE16(USB_V2_0), - .bDeviceClass = CDC_CLASS_MULTI, - .bDeviceSubClass = CDC_SUBCLASS_ACM, - .bDeviceProtocol = CDC_PROTOCOL_V25TER, - .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, - .idVendor = LE16(USB_DEVICE_VENDOR_ID), - .idProduct = LE16(USB_DEVICE_PRODUCT_ID), - .bcdDevice = LE16((USB_DEVICE_MAJOR_VERSION << 8) - | USB_DEVICE_MINOR_VERSION), -#ifdef USB_DEVICE_MANUFACTURE_NAME - .iManufacturer = 1, -#else - .iManufacturer = 0, // No manufacture string -#endif -#ifdef USB_DEVICE_PRODUCT_NAME - .iProduct = 2, -#else - .iProduct = 0, // No product string -#endif -#if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER) - .iSerialNumber = 3, -#else - .iSerialNumber = 0, // No serial string -#endif - .bNumConfigurations = 1 -}; - - -#ifdef USB_DEVICE_HS_SUPPORT -//! USB Device Qualifier Descriptor for HS -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE usb_dev_qual_desc_t udc_device_qual = { - .bLength = sizeof(usb_dev_qual_desc_t), - .bDescriptorType = USB_DT_DEVICE_QUALIFIER, - .bcdUSB = LE16(USB_V2_0), - .bDeviceClass = CDC_CLASS_MULTI, - .bDeviceSubClass = CDC_SUBCLASS_ACM, - .bDeviceProtocol = CDC_PROTOCOL_V25TER, - .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, - .bNumConfigurations = 1 -}; -#endif - -//! Structure for USB Device Configuration Descriptor -COMPILER_PACK_SET(1) -typedef struct { - usb_conf_desc_t conf; - UDI_COMPOSITE_DESC_T; -} udc_desc_t; -COMPILER_PACK_RESET() - -//! USB Device Configuration Descriptor filled for FS -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE udc_desc_t udc_desc_fs = { - .conf.bLength = sizeof(usb_conf_desc_t), - .conf.bDescriptorType = USB_DT_CONFIGURATION, - .conf.wTotalLength = LE16(sizeof(udc_desc_t)), - .conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE, - .conf.bConfigurationValue = 1, - .conf.iConfiguration = 0, - .conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR, - .conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER), - UDI_COMPOSITE_DESC_FS -}; - -#ifdef USB_DEVICE_HS_SUPPORT -//! USB Device Configuration Descriptor filled for HS -COMPILER_WORD_ALIGNED -UDC_DESC_STORAGE udc_desc_t udc_desc_hs = { - .conf.bLength = sizeof(usb_conf_desc_t), - .conf.bDescriptorType = USB_DT_CONFIGURATION, - .conf.wTotalLength = LE16(sizeof(udc_desc_t)), - .conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE, - .conf.bConfigurationValue = 1, - .conf.iConfiguration = 0, - .conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR, - .conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER), - UDI_COMPOSITE_DESC_HS -}; -#endif - - -/** - * \name UDC structures which contains all USB Device definitions - */ -//@{ - -//! Associate an UDI for each USB interface -UDC_DESC_STORAGE udi_api_t *udi_apis[USB_DEVICE_NB_INTERFACE] = { - UDI_COMPOSITE_API -}; - -//! Add UDI with USB Descriptors FS -UDC_DESC_STORAGE udc_config_speed_t udc_config_lsfs[1] = {{ - .desc = (usb_conf_desc_t UDC_DESC_STORAGE*)&udc_desc_fs, - .udi_apis = udi_apis, -}}; - -#ifdef USB_DEVICE_HS_SUPPORT -//! Add UDI with USB Descriptors HS -UDC_DESC_STORAGE udc_config_speed_t udc_config_hs[1] = {{ - .desc = (usb_conf_desc_t UDC_DESC_STORAGE*)&udc_desc_hs, - .udi_apis = udi_apis, -}}; -#endif - -//! Add all information about USB Device in global structure for UDC -UDC_DESC_STORAGE udc_config_t udc_config = { - .confdev_lsfs = &udc_device_desc, - .conf_lsfs = udc_config_lsfs, -#ifdef USB_DEVICE_HS_SUPPORT - .confdev_hs = &udc_device_desc, - .qualifier = &udc_device_qual, - .conf_hs = udc_config_hs, -#endif -}; - -//@} -/**INDENT-ON**/ -//@} - -#endif // ARDUINO_ARCH_SAM - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c deleted file mode 100644 index 627bca0d4f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c +++ /dev/null @@ -1,1132 +0,0 @@ -/** - * \file - * - * \brief USB Device Mass Storage Class (MSC) interface. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "usb_protocol_msc.h" -#include "spc_protocol.h" -#include "sbc_protocol.h" -#include "udd.h" -#include "udc.h" -#include "udi_msc.h" -#include "ctrl_access.h" -#include - -#if ENABLED(SDSUPPORT) - -#ifndef UDI_MSC_NOTIFY_TRANS_EXT -# define UDI_MSC_NOTIFY_TRANS_EXT() -#endif - -/** - * \ingroup udi_msc_group - * \defgroup udi_msc_group_udc Interface with USB Device Core (UDC) - * - * Structures and functions required by UDC. - * - * @{ - */ -bool udi_msc_enable(void); -void udi_msc_disable(void); -bool udi_msc_setup(void); -uint8_t udi_msc_getsetting(void); - -//! Global structure which contains standard UDI API for UDC -UDC_DESC_STORAGE udi_api_t udi_api_msc = { - .enable = udi_msc_enable, - .disable = udi_msc_disable, - .setup = udi_msc_setup, - .getsetting = udi_msc_getsetting, - .sof_notify = NULL, -}; -//@} - - -/** - * \ingroup udi_msc_group - * \defgroup udi_msc_group_internal Implementation of UDI MSC - * - * Class internal implementation - * @{ - */ - -//! Static block size for all memories -#define UDI_MSC_BLOCK_SIZE 512L - -/** - * \name Variables to manage SCSI requests - */ -//@{ - -//! Structure to receive a CBW packet -UDC_BSS(4) static struct usb_msc_cbw udi_msc_cbw; -//! Structure to send a CSW packet -UDC_DATA(4) static struct usb_msc_csw udi_msc_csw = - {.dCSWSignature = CPU_TO_BE32(USB_CSW_SIGNATURE) }; -//! Number of lun -UDC_DATA(4) static uint8_t udi_msc_nb_lun = 0; -//! Structure with current SCSI sense data -UDC_BSS(4) static struct scsi_request_sense_data udi_msc_sense; - -/** - * \name Variables to manage the background read/write SCSI commands - */ -//@{ -//! True if an invalid CBW command has been detected -static bool udi_msc_b_cbw_invalid = false; -//! True if a transfer command must be processed -static bool udi_msc_b_trans_req = false; -//! True if it is a read command, else write command -static bool udi_msc_b_read; -//! Memory address to execute the command -static uint32_t udi_msc_addr; -//! Number of block to transfer -static uint16_t udi_msc_nb_block; -//! Signal end of transfer, if true -volatile bool udi_msc_b_ack_trans = true; -//! Status of transfer, aborted if true -volatile bool udi_msc_b_abort_trans; -//! Signal (re)init of transfer, if true (by reset/reconnect) -volatile bool udi_msc_b_reset_trans = true; -//@} - -//@} - - -/** - * \name Internal routines - */ -//@{ - -/** - * \name Routines to process CBW packet - */ -//@{ - -/** - * \brief Stall CBW request - */ -static void udi_msc_cbw_invalid(void); - -/** - * \brief Stall CSW request - */ -static void udi_msc_csw_invalid(void); - -/** - * \brief Links a callback and buffer on endpoint OUT reception - * - * Called by: - * - enable interface - * - at the end of previous command after sending the CSW - */ -static void udi_msc_cbw_wait(void); - -/** - * \brief Callback called after CBW reception - * Called by UDD when a transfer is finished or aborted - * - * \param status UDD_EP_TRANSFER_OK, if transfer is finished - * \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted - * \param nb_received number of data transfered - */ -static void udi_msc_cbw_received(udd_ep_status_t status, - iram_size_t nb_received, udd_ep_id_t ep); - -/** - * \brief Function to check the CBW length and direction - * Call it after SCSI command decode to check integrity of command - * - * \param alloc_len number of bytes that device want transfer - * \param dir_flag Direction of transfer (USB_CBW_DIRECTION_IN/OUT) - * - * \retval true if the command can be processed - */ -static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag); -//@} - - -/** - * \name Routines to process small data packet - */ -//@{ - -/** - * \brief Sends data on MSC IN endpoint - * Called by SCSI command which must send a data to host followed by a CSW - * - * \param buffer Internal RAM buffer to send - * \param buf_size Size of buffer to send - */ -static void udi_msc_data_send(uint8_t * buffer, uint8_t buf_size); - -/** - * \brief Callback called after data sent - * It start CSW packet process - * - * \param status UDD_EP_TRANSFER_OK, if transfer finish - * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted - * \param nb_sent number of data transfered - */ -static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent, - udd_ep_id_t ep); -//@} - - -/** - * \name Routines to process CSW packet - */ -//@{ - -/** - * \brief Build CSW packet and send it - * - * Called at the end of SCSI command - */ -static void udi_msc_csw_process(void); - -/** - * \brief Sends CSW - * - * Called by #udi_msc_csw_process() - * or UDD callback when endpoint halt is cleared - */ -void udi_msc_csw_send(void); - -/** - * \brief Callback called after CSW sent - * It restart CBW reception. - * - * \param status UDD_EP_TRANSFER_OK, if transfer is finished - * \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted - * \param nb_sent number of data transfered - */ -static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent, - udd_ep_id_t ep); -//@} - - -/** - * \name Routines manage sense data - */ -//@{ - -/** - * \brief Reinitialize sense data. - */ -static void udi_msc_clear_sense(void); - -/** - * \brief Update sense data with new value to signal a fail - * - * \param sense_key Sense key - * \param add_sense Additional Sense Code - * \param lba LBA corresponding at error - */ -static void udi_msc_sense_fail(uint8_t sense_key, uint16_t add_sense, - uint32_t lba); - -/** - * \brief Update sense data with new value to signal success - */ -static void udi_msc_sense_pass(void); - -/** - * \brief Update sense data to signal that memory is not present - */ -static void udi_msc_sense_fail_not_present(void); - -/** - * \brief Update sense data to signal that memory is busy - */ -static void udi_msc_sense_fail_busy_or_change(void); - -/** - * \brief Update sense data to signal a hardware error on memory - */ -static void udi_msc_sense_fail_hardware(void); - -/** - * \brief Update sense data to signal that memory is protected - */ -static void udi_msc_sense_fail_protected(void); - -/** - * \brief Update sense data to signal that CDB fields are not valid - */ -static void udi_msc_sense_fail_cdb_invalid(void); - -/** - * \brief Update sense data to signal that command is not supported - */ -static void udi_msc_sense_command_invalid(void); -//@} - - -/** - * \name Routines manage SCSI Commands - */ -//@{ - -/** - * \brief Process SPC Request Sense command - * Returns error information about last command - */ -static void udi_msc_spc_requestsense(void); - -/** - * \brief Process SPC Inquiry command - * Returns information (name,version) about disk - */ -static void udi_msc_spc_inquiry(void); - -/** - * \brief Checks state of disk - * - * \retval true if disk is ready, otherwise false and updates sense data - */ -static bool udi_msc_spc_testunitready_global(void); - -/** - * \brief Process test unit ready command - * Returns state of logical unit - */ -static void udi_msc_spc_testunitready(void); - -/** - * \brief Process prevent allow medium removal command - */ -static void udi_msc_spc_prevent_allow_medium_removal(void); - -/** - * \brief Process mode sense command - * - * \param b_sense10 Sense10 SCSI command, if true - * \param b_sense10 Sense6 SCSI command, if false - */ -static void udi_msc_spc_mode_sense(bool b_sense10); - -/** - * \brief Process start stop command - */ -static void udi_msc_sbc_start_stop(void); - -/** - * \brief Process read capacity command - */ -static void udi_msc_sbc_read_capacity(void); - -/** - * \brief Process read10 or write10 command - * - * \param b_read Read transfer, if true, - * \param b_read Write transfer, if false - */ -static void udi_msc_sbc_trans(bool b_read); -//@} - -//@} - - -bool udi_msc_enable(void) -{ - uint8_t lun; - udi_msc_b_trans_req = false; - udi_msc_b_cbw_invalid = false; - udi_msc_b_ack_trans = true; - udi_msc_b_reset_trans = true; - udi_msc_nb_lun = get_nb_lun(); - if (0 == udi_msc_nb_lun) - return false; // No lun available, then not authorize to enable interface - udi_msc_nb_lun--; - // Call application callback - // to initialize memories or signal that interface is enabled - if (!UDI_MSC_ENABLE_EXT()) - return false; - // Load the medium on each LUN - for (lun = 0; lun <= udi_msc_nb_lun; lun ++) { - mem_unload(lun, false); - } - // Start MSC process by CBW reception - udi_msc_cbw_wait(); - return true; -} - - -void udi_msc_disable(void) -{ - udi_msc_b_trans_req = false; - udi_msc_b_ack_trans = true; - udi_msc_b_reset_trans = true; - UDI_MSC_DISABLE_EXT(); -} - - -bool udi_msc_setup(void) -{ - if (Udd_setup_is_in()) { - // Requests Interface GET - if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { - // Requests Class Interface Get - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_MSC_GET_MAX_LUN: - // Give the number of memories available - if (1 != udd_g_ctrlreq.req.wLength) - return false; // Error for USB host - if (0 != udd_g_ctrlreq.req.wValue) - return false; - udd_g_ctrlreq.payload = &udi_msc_nb_lun; - udd_g_ctrlreq.payload_size = 1; - return true; - } - } - } - if (Udd_setup_is_out()) { - // Requests Interface SET - if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { - // Requests Class Interface Set - switch (udd_g_ctrlreq.req.bRequest) { - case USB_REQ_MSC_BULK_RESET: - // Reset MSC interface - if (0 != udd_g_ctrlreq.req.wLength) - return false; - if (0 != udd_g_ctrlreq.req.wValue) - return false; - udi_msc_b_cbw_invalid = false; - udi_msc_b_trans_req = false; - // Abort all tasks (transfer or clear stall wait) on endpoints - udd_ep_abort(UDI_MSC_EP_OUT); - udd_ep_abort(UDI_MSC_EP_IN); - // Restart by CBW wait - udi_msc_cbw_wait(); - return true; - } - } - } - return false; // Not supported request -} - -uint8_t udi_msc_getsetting(void) -{ - return 0; // MSC don't have multiple alternate setting -} - - -// ------------------------ -//------- Routines to process CBW packet - -static void udi_msc_cbw_invalid(void) -{ - if (!udi_msc_b_cbw_invalid) - return; // Don't re-stall endpoint if error reseted by setup - udd_ep_set_halt(UDI_MSC_EP_OUT); - // If stall cleared then re-stall it. Only Setup MSC Reset can clear it - udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_invalid); -} - -static void udi_msc_csw_invalid(void) -{ - if (!udi_msc_b_cbw_invalid) - return; // Don't re-stall endpoint if error reseted by setup - udd_ep_set_halt(UDI_MSC_EP_IN); - // If stall cleared then re-stall it. Only Setup MSC Reset can clear it - udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_invalid); -} - -static void udi_msc_cbw_wait(void) -{ - // Register buffer and callback on OUT endpoint - if (!udd_ep_run(UDI_MSC_EP_OUT, true, - (uint8_t *) & udi_msc_cbw, - sizeof(udi_msc_cbw), - udi_msc_cbw_received)) { - // OUT endpoint not available (halted), then wait a clear of halt. - udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_wait); - } -} - - -static void udi_msc_cbw_received(udd_ep_status_t status, - iram_size_t nb_received, udd_ep_id_t ep) -{ - UNUSED(ep); - // Check status of transfer - if (UDD_EP_TRANSFER_OK != status) { - // Transfer aborted - // Now wait MSC setup reset to relaunch CBW reception - return; - } - // Check CBW integrity: - // transfer status/CBW length/CBW signature - if ((sizeof(udi_msc_cbw) != nb_received) - || (udi_msc_cbw.dCBWSignature != - CPU_TO_BE32(USB_CBW_SIGNATURE))) { - // (5.2.1) Devices receiving a CBW with an invalid signature should stall - // further traffic on the Bulk In pipe, and either stall further traffic - // or accept and discard further traffic on the Bulk Out pipe, until - // reset recovery. - udi_msc_b_cbw_invalid = true; - udi_msc_cbw_invalid(); - udi_msc_csw_invalid(); - return; - } - // Check LUN asked - udi_msc_cbw.bCBWLUN &= USB_CBW_LUN_MASK; - if (udi_msc_cbw.bCBWLUN > udi_msc_nb_lun) { - // Bad LUN, then stop command process - udi_msc_sense_fail_cdb_invalid(); - udi_msc_csw_process(); - return; - } - // Prepare CSW residue field with the size requested - udi_msc_csw.dCSWDataResidue = - le32_to_cpu(udi_msc_cbw.dCBWDataTransferLength); - - // Decode opcode - switch (udi_msc_cbw.CDB[0]) { - case SPC_REQUEST_SENSE: - udi_msc_spc_requestsense(); - break; - - case SPC_INQUIRY: - udi_msc_spc_inquiry(); - break; - - case SPC_MODE_SENSE6: - udi_msc_spc_mode_sense(false); - break; - case SPC_MODE_SENSE10: - udi_msc_spc_mode_sense(true); - break; - - case SPC_TEST_UNIT_READY: - udi_msc_spc_testunitready(); - break; - - case SBC_READ_CAPACITY10: - udi_msc_sbc_read_capacity(); - break; - - case SBC_START_STOP_UNIT: - udi_msc_sbc_start_stop(); - break; - - // Accepts request to support plug/plug in case of card reader - case SPC_PREVENT_ALLOW_MEDIUM_REMOVAL: - udi_msc_spc_prevent_allow_medium_removal(); - break; - - // Accepts request to support full format from Windows - case SBC_VERIFY10: - udi_msc_sense_pass(); - udi_msc_csw_process(); - break; - - case SBC_READ10: - udi_msc_sbc_trans(true); - break; - - case SBC_WRITE10: - udi_msc_sbc_trans(false); - break; - - default: - udi_msc_sense_command_invalid(); - udi_msc_csw_process(); - break; - } -} - - -static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag) -{ - /* - * The following cases should result in a phase error: - * - Case 2: Hn < Di - * - Case 3: Hn < Do - * - Case 7: Hi < Di - * - Case 8: Hi <> Do - * - Case 10: Ho <> Di - * - Case 13: Ho < Do - */ - if (((udi_msc_cbw.bmCBWFlags ^ dir_flag) & USB_CBW_DIRECTION_IN) - || (udi_msc_csw.dCSWDataResidue < alloc_len)) { - udi_msc_sense_fail_cdb_invalid(); - udi_msc_csw_process(); - return false; - } - - /* - * The following cases should result in a stall and nonzero - * residue: - * - Case 4: Hi > Dn - * - Case 5: Hi > Di - * - Case 9: Ho > Dn - * - Case 11: Ho > Do - */ - return true; -} - - -// ------------------------ -//------- Routines to process small data packet - -static void udi_msc_data_send(uint8_t * buffer, uint8_t buf_size) -{ - // Sends data on IN endpoint - if (!udd_ep_run(UDI_MSC_EP_IN, true, - buffer, buf_size, udi_msc_data_sent)) { - // If endpoint not available, then exit process command - udi_msc_sense_fail_hardware(); - udi_msc_csw_process(); - } -} - - -static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent, - udd_ep_id_t ep) -{ - UNUSED(ep); - if (UDD_EP_TRANSFER_OK != status) { - // Error protocol - // Now wait MSC setup reset to relaunch CBW reception - return; - } - // Update sense data - udi_msc_sense_pass(); - // Update CSW - udi_msc_csw.dCSWDataResidue -= nb_sent; - udi_msc_csw_process(); -} - - -// ------------------------ -//------- Routines to process CSW packet - -static void udi_msc_csw_process(void) -{ - if (0 != udi_msc_csw.dCSWDataResidue) { - // Residue not NULL - // then STALL next request from USB host on corresponding endpoint - if (udi_msc_cbw.bmCBWFlags & USB_CBW_DIRECTION_IN) - udd_ep_set_halt(UDI_MSC_EP_IN); - else - udd_ep_set_halt(UDI_MSC_EP_OUT); - } - // Prepare and send CSW - udi_msc_csw.dCSWTag = udi_msc_cbw.dCBWTag; - udi_msc_csw.dCSWDataResidue = cpu_to_le32(udi_msc_csw.dCSWDataResidue); - udi_msc_csw_send(); -} - - -void udi_msc_csw_send(void) -{ - // Sends CSW on IN endpoint - if (!udd_ep_run(UDI_MSC_EP_IN, false, - (uint8_t *) & udi_msc_csw, - sizeof(udi_msc_csw), - udi_msc_csw_sent)) { - // Endpoint not available - // then restart CSW sent when endpoint IN STALL will be cleared - udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_send); - } -} - - -static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent, - udd_ep_id_t ep) -{ - UNUSED(ep); - UNUSED(status); - UNUSED(nb_sent); - // CSW is sent or not - // In all case, restart process and wait CBW - udi_msc_cbw_wait(); -} - - -// ------------------------ -//------- Routines manage sense data - -static void udi_msc_clear_sense(void) -{ - memset((uint8_t*)&udi_msc_sense, 0, sizeof(struct scsi_request_sense_data)); - udi_msc_sense.valid_reponse_code = SCSI_SENSE_VALID | SCSI_SENSE_CURRENT; - udi_msc_sense.AddSenseLen = SCSI_SENSE_ADDL_LEN(sizeof(udi_msc_sense)); -} - -static void udi_msc_sense_fail(uint8_t sense_key, uint16_t add_sense, - uint32_t lba) -{ - udi_msc_clear_sense(); - udi_msc_csw.bCSWStatus = USB_CSW_STATUS_FAIL; - udi_msc_sense.sense_flag_key = sense_key; - udi_msc_sense.information[0] = lba >> 24; - udi_msc_sense.information[1] = lba >> 16; - udi_msc_sense.information[2] = lba >> 8; - udi_msc_sense.information[3] = lba; - udi_msc_sense.AddSenseCode = add_sense >> 8; - udi_msc_sense.AddSnsCodeQlfr = add_sense; -} - -static void udi_msc_sense_pass(void) -{ - udi_msc_clear_sense(); - udi_msc_csw.bCSWStatus = USB_CSW_STATUS_PASS; -} - - -static void udi_msc_sense_fail_not_present(void) -{ - udi_msc_sense_fail(SCSI_SK_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT, 0); -} - -static void udi_msc_sense_fail_busy_or_change(void) -{ - udi_msc_sense_fail(SCSI_SK_UNIT_ATTENTION, - SCSI_ASC_NOT_READY_TO_READY_CHANGE, 0); -} - -static void udi_msc_sense_fail_hardware(void) -{ - udi_msc_sense_fail(SCSI_SK_HARDWARE_ERROR, - SCSI_ASC_NO_ADDITIONAL_SENSE_INFO, 0); -} - -static void udi_msc_sense_fail_protected(void) -{ - udi_msc_sense_fail(SCSI_SK_DATA_PROTECT, SCSI_ASC_WRITE_PROTECTED, 0); -} - -static void udi_msc_sense_fail_cdb_invalid(void) -{ - udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST, - SCSI_ASC_INVALID_FIELD_IN_CDB, 0); -} - -static void udi_msc_sense_command_invalid(void) -{ - udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST, - SCSI_ASC_INVALID_COMMAND_OPERATION_CODE, 0); -} - - -// ------------------------ -//------- Routines manage SCSI Commands - -static void udi_msc_spc_requestsense(void) -{ - uint8_t length = udi_msc_cbw.CDB[4]; - - // Can't send more than sense data length - if (length > sizeof(udi_msc_sense)) - length = sizeof(udi_msc_sense); - - if (!udi_msc_cbw_validate(length, USB_CBW_DIRECTION_IN)) - return; - // Send sense data - udi_msc_data_send((uint8_t*)&udi_msc_sense, length); -} - - -static void udi_msc_spc_inquiry(void) -{ - uint8_t length, i; - UDC_DATA(4) - // Constant inquiry data for all LUNs - static struct scsi_inquiry_data udi_msc_inquiry_data = { - .pq_pdt = SCSI_INQ_PQ_CONNECTED | SCSI_INQ_DT_DIR_ACCESS, - .version = SCSI_INQ_VER_SPC, - .flags3 = SCSI_INQ_RSP_SPC2, - .addl_len = SCSI_INQ_ADDL_LEN(sizeof(struct scsi_inquiry_data)), - .vendor_id = {UDI_MSC_GLOBAL_VENDOR_ID}, - .product_rev = {UDI_MSC_GLOBAL_PRODUCT_VERSION}, - }; - - length = udi_msc_cbw.CDB[4]; - - // Can't send more than inquiry data length - if (length > sizeof(udi_msc_inquiry_data)) - length = sizeof(udi_msc_inquiry_data); - - if (!udi_msc_cbw_validate(length, USB_CBW_DIRECTION_IN)) - return; - if ((0 != (udi_msc_cbw.CDB[1] & (SCSI_INQ_REQ_EVPD | SCSI_INQ_REQ_CMDT))) - || (0 != udi_msc_cbw.CDB[2])) { - // CMDT and EPVD bits are not at 0 - // PAGE or OPERATION CODE fields are not empty - // = No standard inquiry asked - udi_msc_sense_fail_cdb_invalid(); // Command is unsupported - udi_msc_csw_process(); - return; - } - - udi_msc_inquiry_data.flags1 = mem_removal(udi_msc_cbw.bCBWLUN) ? - SCSI_INQ_RMB : 0; - - //* Fill product ID field - // Copy name in product id field - memcpy(udi_msc_inquiry_data.product_id, - mem_name(udi_msc_cbw.bCBWLUN)+1, // To remove first '"' - sizeof(udi_msc_inquiry_data.product_id)); - - // Search end of name '/0' or '"' - i = 0; - while (sizeof(udi_msc_inquiry_data.product_id) != i) { - if ((0 == udi_msc_inquiry_data.product_id[i]) - || ('"' == udi_msc_inquiry_data.product_id[i])) { - break; - } - i++; - } - // Padding with space char - while (sizeof(udi_msc_inquiry_data.product_id) != i) { - udi_msc_inquiry_data.product_id[i] = ' '; - i++; - } - - // Send inquiry data - udi_msc_data_send((uint8_t *) & udi_msc_inquiry_data, length); -} - - -static bool udi_msc_spc_testunitready_global(void) -{ - switch (mem_test_unit_ready(udi_msc_cbw.bCBWLUN)) { - case CTRL_GOOD: - return true; // Don't change sense data - case CTRL_BUSY: - udi_msc_sense_fail_busy_or_change(); - break; - case CTRL_NO_PRESENT: - udi_msc_sense_fail_not_present(); - break; - case CTRL_FAIL: - default: - udi_msc_sense_fail_hardware(); - break; - } - return false; -} - - -static void udi_msc_spc_testunitready(void) -{ - if (udi_msc_spc_testunitready_global()) { - // LUN ready, then update sense data with status pass - udi_msc_sense_pass(); - } - // Send status in CSW packet - udi_msc_csw_process(); -} - - -static void udi_msc_spc_mode_sense(bool b_sense10) -{ - // Union of all mode sense structures - union sense_6_10 { - struct { - struct scsi_mode_param_header6 header; - struct spc_control_page_info_execpt sense_data; - } s6; - struct { - struct scsi_mode_param_header10 header; - struct spc_control_page_info_execpt sense_data; - } s10; - }; - - uint8_t data_sense_lgt; - uint8_t mode; - uint8_t request_lgt; - uint8_t wp; - struct spc_control_page_info_execpt *ptr_mode; - UDC_BSS(4) static union sense_6_10 sense; - - // Clear all fields - memset(&sense, 0, sizeof(sense)); - - // Initialize process - if (b_sense10) { - request_lgt = udi_msc_cbw.CDB[8]; - ptr_mode = &sense.s10.sense_data; - data_sense_lgt = sizeof(struct scsi_mode_param_header10); - } else { - request_lgt = udi_msc_cbw.CDB[4]; - ptr_mode = &sense.s6.sense_data; - data_sense_lgt = sizeof(struct scsi_mode_param_header6); - } - - // No Block descriptor - - // Fill page(s) - mode = udi_msc_cbw.CDB[2] & SCSI_MS_MODE_ALL; - if ((SCSI_MS_MODE_INFEXP == mode) - || (SCSI_MS_MODE_ALL == mode)) { - // Informational exceptions control page (from SPC) - ptr_mode->page_code = - SCSI_MS_MODE_INFEXP; - ptr_mode->page_length = - SPC_MP_INFEXP_PAGE_LENGTH; - ptr_mode->mrie = - SPC_MP_INFEXP_MRIE_NO_SENSE; - data_sense_lgt += sizeof(struct spc_control_page_info_execpt); - } - // Can't send more than mode sense data length - if (request_lgt > data_sense_lgt) - request_lgt = data_sense_lgt; - if (!udi_msc_cbw_validate(request_lgt, USB_CBW_DIRECTION_IN)) - return; - - // Fill mode parameter header length - wp = (mem_wr_protect(udi_msc_cbw.bCBWLUN)) ? SCSI_MS_SBC_WP : 0; - - if (b_sense10) { - sense.s10.header.mode_data_length = - cpu_to_be16((data_sense_lgt - 2)); - //sense.s10.header.medium_type = 0; - sense.s10.header.device_specific_parameter = wp; - //sense.s10.header.block_descriptor_length = 0; - } else { - sense.s6.header.mode_data_length = data_sense_lgt - 1; - //sense.s6.header.medium_type = 0; - sense.s6.header.device_specific_parameter = wp; - //sense.s6.header.block_descriptor_length = 0; - } - - // Send mode sense data - udi_msc_data_send((uint8_t *) & sense, request_lgt); -} - - -static void udi_msc_spc_prevent_allow_medium_removal(void) -{ - uint8_t prevent = udi_msc_cbw.CDB[4]; - if (0 == prevent) { - udi_msc_sense_pass(); - } else { - udi_msc_sense_fail_cdb_invalid(); // Command is unsupported - } - udi_msc_csw_process(); -} - - -static void udi_msc_sbc_start_stop(void) -{ - bool start = 0x1 & udi_msc_cbw.CDB[4]; - bool loej = 0x2 & udi_msc_cbw.CDB[4]; - if (loej) { - mem_unload(udi_msc_cbw.bCBWLUN, !start); - } - udi_msc_sense_pass(); - udi_msc_csw_process(); -} - - -static void udi_msc_sbc_read_capacity(void) -{ - UDC_BSS(4) static struct sbc_read_capacity10_data udi_msc_capacity; - - if (!udi_msc_cbw_validate(sizeof(udi_msc_capacity), - USB_CBW_DIRECTION_IN)) - return; - - // Get capacity of LUN - switch (mem_read_capacity(udi_msc_cbw.bCBWLUN, - &udi_msc_capacity.max_lba)) { - case CTRL_GOOD: - break; - case CTRL_BUSY: - udi_msc_sense_fail_busy_or_change(); - udi_msc_csw_process(); - return; - case CTRL_NO_PRESENT: - udi_msc_sense_fail_not_present(); - udi_msc_csw_process(); - return; - default: - udi_msc_sense_fail_hardware(); - udi_msc_csw_process(); - return; - } - - // Format capacity data - udi_msc_capacity.block_len = CPU_TO_BE32(UDI_MSC_BLOCK_SIZE); - udi_msc_capacity.max_lba = cpu_to_be32(udi_msc_capacity.max_lba); - // Send the corresponding sense data - udi_msc_data_send((uint8_t *) & udi_msc_capacity, - sizeof(udi_msc_capacity)); -} - - -static void udi_msc_sbc_trans(bool b_read) -{ - uint32_t trans_size; - - if (!b_read) { - // Write operation then check Write Protect - if (mem_wr_protect(udi_msc_cbw.bCBWLUN)) { - // Write not authorized - udi_msc_sense_fail_protected(); - udi_msc_csw_process(); - return; - } - } - // Read/Write command fields (address and number of block) - MSB0(udi_msc_addr) = udi_msc_cbw.CDB[2]; - MSB1(udi_msc_addr) = udi_msc_cbw.CDB[3]; - MSB2(udi_msc_addr) = udi_msc_cbw.CDB[4]; - MSB3(udi_msc_addr) = udi_msc_cbw.CDB[5]; - MSB(udi_msc_nb_block) = udi_msc_cbw.CDB[7]; - LSB(udi_msc_nb_block) = udi_msc_cbw.CDB[8]; - - // Compute number of byte to transfer and valid it - trans_size = (uint32_t) udi_msc_nb_block *UDI_MSC_BLOCK_SIZE; - if (!udi_msc_cbw_validate(trans_size, - (b_read) ? USB_CBW_DIRECTION_IN : - USB_CBW_DIRECTION_OUT)) - return; - - // Record transfer request to do it in a task and not under interrupt - udi_msc_b_read = b_read; - udi_msc_b_trans_req = true; - UDI_MSC_NOTIFY_TRANS_EXT(); -} - - -bool udi_msc_process_trans(void) -{ - Ctrl_status status; - - if (!udi_msc_b_trans_req) - return false; // No Transfer request to do - udi_msc_b_trans_req = false; - udi_msc_b_reset_trans = false; - - // Start transfer - if (udi_msc_b_read) { - status = memory_2_usb(udi_msc_cbw.bCBWLUN, udi_msc_addr, - udi_msc_nb_block); - } else { - status = usb_2_memory(udi_msc_cbw.bCBWLUN, udi_msc_addr, - udi_msc_nb_block); - } - - // Check if transfer is aborted by reset - if (udi_msc_b_reset_trans) { - udi_msc_b_reset_trans = false; - return true; - } - - // Check status of transfer - switch (status) { - case CTRL_GOOD: - udi_msc_sense_pass(); - break; - case CTRL_BUSY: - udi_msc_sense_fail_busy_or_change(); - break; - case CTRL_NO_PRESENT: - udi_msc_sense_fail_not_present(); - break; - default: - case CTRL_FAIL: - udi_msc_sense_fail_hardware(); - break; - } - // Send status of transfer in CSW packet - udi_msc_csw_process(); - return true; -} - - -static void udi_msc_trans_ack(udd_ep_status_t status, iram_size_t n, - udd_ep_id_t ep) -{ - UNUSED(ep); - UNUSED(n); - // Update variable to signal the end of transfer - udi_msc_b_abort_trans = (UDD_EP_TRANSFER_OK != status) ? true : false; - udi_msc_b_ack_trans = true; -} - - -bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size, - void (*callback) (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)) -{ - if (!udi_msc_b_ack_trans) - return false; // No possible, transfer on going - - // Start transfer Internal RAM<->USB line - udi_msc_b_ack_trans = false; - if (!udd_ep_run((b_read) ? UDI_MSC_EP_IN : UDI_MSC_EP_OUT, - false, - block, - block_size, - (NULL == callback) ? udi_msc_trans_ack : - callback)) { - udi_msc_b_ack_trans = true; - return false; - } - if (NULL == callback) { - while (!udi_msc_b_ack_trans); - if (udi_msc_b_abort_trans) { - return false; - } - udi_msc_csw.dCSWDataResidue -= block_size; - return (!udi_msc_b_abort_trans); - } - udi_msc_csw.dCSWDataResidue -= block_size; - return true; -} - -//@} - -#endif // SDSUPPORT - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h deleted file mode 100644 index c632ee4aac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h +++ /dev/null @@ -1,376 +0,0 @@ -/** - * \file - * - * \brief USB Device Mass Storage Class (MSC) interface definitions. - * - * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _UDI_MSC_H_ -#define _UDI_MSC_H_ - -#include "conf_usb.h" -#include "usb_protocol.h" -#include "usb_protocol_msc.h" -#include "udd.h" -#include "udc_desc.h" -#include "udi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup udi_msc_group_udc - * @{ - */ -//! Global structure which contains standard UDI interface for UDC -extern UDC_DESC_STORAGE udi_api_t udi_api_msc; -//@} - -/** - * \ingroup udi_msc_group - * \defgroup udi_msc_group USB interface descriptors - * - * The following structures provide predefined USB interface descriptors. - * It must be used to define the final USB descriptors. - */ -//@{ - -//! Interface descriptor structure for MSC -typedef struct { - usb_iface_desc_t iface; - usb_ep_desc_t ep_in; - usb_ep_desc_t ep_out; -} udi_msc_desc_t; - -//! By default no string associated to this interface -#ifndef UDI_MSC_STRING_ID -#define UDI_MSC_STRING_ID 0 -#endif - -//! MSC endpoints size for full speed -#define UDI_MSC_EPS_SIZE_FS 64 -//! MSC endpoints size for high speed -#define UDI_MSC_EPS_SIZE_HS 512 - -//! Content of MSC interface descriptor for all speeds -#define UDI_MSC_DESC \ - .iface.bLength = sizeof(usb_iface_desc_t),\ - .iface.bDescriptorType = USB_DT_INTERFACE,\ - .iface.bInterfaceNumber = UDI_MSC_IFACE_NUMBER,\ - .iface.bAlternateSetting = 0,\ - .iface.bNumEndpoints = 2,\ - .iface.bInterfaceClass = MSC_CLASS,\ - .iface.bInterfaceSubClass = MSC_SUBCLASS_TRANSPARENT,\ - .iface.bInterfaceProtocol = MSC_PROTOCOL_BULK,\ - .iface.iInterface = UDI_MSC_STRING_ID,\ - .ep_in.bLength = sizeof(usb_ep_desc_t),\ - .ep_in.bDescriptorType = USB_DT_ENDPOINT,\ - .ep_in.bEndpointAddress = UDI_MSC_EP_IN,\ - .ep_in.bmAttributes = USB_EP_TYPE_BULK,\ - .ep_in.bInterval = 0,\ - .ep_out.bLength = sizeof(usb_ep_desc_t),\ - .ep_out.bDescriptorType = USB_DT_ENDPOINT,\ - .ep_out.bEndpointAddress = UDI_MSC_EP_OUT,\ - .ep_out.bmAttributes = USB_EP_TYPE_BULK,\ - .ep_out.bInterval = 0, - -//! Content of MSC interface descriptor for full speed only -#define UDI_MSC_DESC_FS {\ - UDI_MSC_DESC \ - .ep_in.wMaxPacketSize = LE16(UDI_MSC_EPS_SIZE_FS),\ - .ep_out.wMaxPacketSize = LE16(UDI_MSC_EPS_SIZE_FS),\ - } - -//! Content of MSC interface descriptor for high speed only -#define UDI_MSC_DESC_HS {\ - UDI_MSC_DESC \ - .ep_in.wMaxPacketSize = LE16(UDI_MSC_EPS_SIZE_HS),\ - .ep_out.wMaxPacketSize = LE16(UDI_MSC_EPS_SIZE_HS),\ - } -//@} - - -/** - * \ingroup udi_group - * \defgroup udi_msc_group USB Device Interface (UDI) for Mass Storage Class (MSC) - * - * Common APIs used by high level application to use this USB class. - * - * These routines are used by memory to transfer its data - * to/from USB MSC endpoints. - * - * See \ref udi_msc_quickstart. - * @{ - */ - -/** - * \brief Process the background read/write commands - * - * Routine called by the main loop - */ -bool udi_msc_process_trans(void); - -/** - * \brief Transfers data to/from USB MSC endpoints - * - * - * \param b_read Memory to USB, if true - * \param block Buffer on Internal RAM to send or fill - * \param block_size Buffer size to send or fill - * \param callback Function to call at the end of transfer. - * If NULL then the routine exit when transfer is finish. - * - * \return \c 1 if function was successfully done, otherwise \c 0. - */ -bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size, - void (*callback) (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)); -//@} - -#ifdef __cplusplus -} -#endif - - -/** - * \page udi_msc_quickstart Quick start guide for USB device Mass Storage module (UDI MSC) - * - * This is the quick start guide for the \ref udi_msc_group - * "USB device interface MSC module (UDI MSC)" with step-by-step instructions on - * how to configure and use the modules in a selection of use cases. - * - * The use cases contain several code fragments. The code fragments in the - * steps for setup can be copied into a custom initialization function, while - * the steps for usage can be copied into, e.g., the main application function. - * - * \section udi_msc_basic_use_case Basic use case - * In this basic use case, the "USB MSC (Single Interface Device)" module is used. - * The "USB MSC (Composite Device)" module usage is described in \ref udi_msc_use_cases - * "Advanced use cases". - * - * \section udi_msc_basic_use_case_setup Setup steps - * \subsection udi_msc_basic_use_case_setup_prereq Prerequisites - * \copydetails udc_basic_use_case_setup_prereq - * \subsection udi_msc_basic_use_case_setup_code Example code - * \copydetails udc_basic_use_case_setup_code - * \subsection udi_msc_basic_use_case_setup_flow Workflow - * \copydetails udc_basic_use_case_setup_flow - * - * \section udi_msc_basic_use_case_usage Usage steps - * - * \subsection udi_msc_basic_use_case_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_SERIAL_NAME "12...EF" // Disk SN for MSC - #define UDI_MSC_GLOBAL_VENDOR_ID \ - 'A', 'T', 'M', 'E', 'L', ' ', ' ', ' ' - #define UDI_MSC_GLOBAL_PRODUCT_VERSION \ - '1', '.', '0', '0' - #define UDI_MSC_ENABLE_EXT() my_callback_msc_enable() - extern bool my_callback_msc_enable(void); - #define UDI_MSC_DISABLE_EXT() my_callback_msc_disable() - extern void my_callback_msc_disable(void); - #include "udi_msc_conf.h" // At the end of conf_usb.h file -\endcode - * - * Add to application C-file: - * \code - static bool my_flag_autorize_msc_transfert = false; - bool my_callback_msc_enable(void) - { - my_flag_autorize_msc_transfert = true; - return true; - } - void my_callback_msc_disable(void) - { - my_flag_autorize_msc_transfert = false; - } - - void task(void) - { - udi_msc_process_trans(); - } -\endcode - * - * \subsection udi_msc_basic_use_case_setup_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following configuration, - * which is the USB device MSC configuration: - * - \code #define USB_DEVICE_SERIAL_NAME "12...EF" // Disk SN for MSC \endcode - * \note The USB serial number is mandatory when a MSC interface is used. - * - \code //! Vendor name and Product version of MSC interface - #define UDI_MSC_GLOBAL_VENDOR_ID \ - 'A', 'T', 'M', 'E', 'L', ' ', ' ', ' ' - #define UDI_MSC_GLOBAL_PRODUCT_VERSION \ - '1', '.', '0', '0' \endcode - * \note The USB MSC interface requires a vendor ID (8 ASCII characters) - * and a product version (4 ASCII characters). - * - \code #define UDI_MSC_ENABLE_EXT() my_callback_msc_enable() - extern bool my_callback_msc_enable(void); \endcode - * \note After the device enumeration (detecting and identifying USB devices), - * the USB host starts the device configuration. When the USB MSC interface - * from the device is accepted by the host, the USB host enables this interface and the - * UDI_MSC_ENABLE_EXT() callback function is called and return true. - * Thus, when this event is received, the tasks which call - * udi_msc_process_trans() must be enabled. - * - \code #define UDI_MSC_DISABLE_EXT() my_callback_msc_disable() - extern void my_callback_msc_disable(void); \endcode - * \note When the USB device is unplugged or is reset by the USB host, the USB - * interface is disabled and the UDI_MSC_DISABLE_EXT() callback function - * is called. Thus, it is recommended to disable the task which is called udi_msc_process_trans(). - * -# The MSC is automatically linked with memory control access component - * which provides the memories interfaces. However, the memory data transfers - * must be done outside USB interrupt routine. This is done in the MSC process - * ("udi_msc_process_trans()") called by main loop: - * - \code * void task(void) { - udi_msc_process_trans(); - } \endcode - * -# The MSC speed depends on task periodicity. To get the best speed - * the notification callback "UDI_MSC_NOTIFY_TRANS_EXT" can be used to wakeup - * this task (Example, through a mutex): - * - \code #define UDI_MSC_NOTIFY_TRANS_EXT() msc_notify_trans() - void msc_notify_trans(void) { - wakeup_my_task(); - } \endcode - * - * \section udi_msc_use_cases Advanced use cases - * For more advanced use of the UDI MSC module, see the following use cases: - * - \subpage udi_msc_use_case_composite - * - \subpage udc_use_case_1 - * - \subpage udc_use_case_2 - * - \subpage udc_use_case_3 - * - \subpage udc_use_case_5 - * - \subpage udc_use_case_6 - */ - -/** - * \page udi_msc_use_case_composite MSC in a composite device - * - * A USB Composite Device is a USB Device which uses more than one USB class. - * In this use case, the "USB MSC (Composite Device)" module is used to - * create a USB composite device. Thus, this USB module can be associated with - * another "Composite Device" module, like "USB HID Mouse (Composite Device)". - * - * Also, you can refer to application note - * - * AVR4902 ASF - USB Composite Device. - * - * \section udi_msc_use_case_composite_setup Setup steps - * For the setup code of this use case to work, the - * \ref udi_msc_basic_use_case "basic use case" must be followed. - * - * \section udi_msc_use_case_composite_usage Usage steps - * - * \subsection udi_msc_use_case_composite_usage_code Example code - * Content of conf_usb.h: - * \code - #define USB_DEVICE_EP_CTRL_SIZE 64 - #define USB_DEVICE_NB_INTERFACE (X+1) - #define USB_DEVICE_MAX_EP (X+2) - - #define UDI_MSC_EP_IN (X | USB_EP_DIR_IN) - #define UDI_MSC_EP_OUT (Y | USB_EP_DIR_OUT) - #define UDI_MSC_IFACE_NUMBER X - - #define UDI_COMPOSITE_DESC_T \ - udi_msc_desc_t udi_msc; \ - ... - #define UDI_COMPOSITE_DESC_FS \ - .udi_msc = UDI_MSC_DESC, \ - ... - #define UDI_COMPOSITE_DESC_HS \ - .udi_msc = UDI_MSC_DESC, \ - ... - #define UDI_COMPOSITE_API \ - &udi_api_msc, \ - ... -\endcode - * - * \subsection udi_msc_use_case_composite_usage_flow Workflow - * -# Ensure that conf_usb.h is available and contains the following parameters - * required for a USB composite device configuration: - * - \code // Endpoint control size, This must be: - // - 8, 16, 32 or 64 for full speed device (8 is recommended to save RAM) - // - 64 for a high speed device - #define USB_DEVICE_EP_CTRL_SIZE 64 - // Total Number of interfaces on this USB device. - // Add 1 for MSC. - #define USB_DEVICE_NB_INTERFACE (X+1) - // Total number of endpoints on this USB device. - // This must include each endpoint for each interface. - // Add 2 for MSC. - #define USB_DEVICE_MAX_EP (X+2) \endcode - * -# Ensure that conf_usb.h contains the description of - * composite device: - * - \code // The endpoint numbers chosen by you for the MSC. - // The endpoint numbers starting from 1. - #define UDI_MSC_EP_IN (X | USB_EP_DIR_IN) - #define UDI_MSC_EP_OUT (Y | USB_EP_DIR_OUT) - // The interface index of an interface starting from 0 - #define UDI_MSC_IFACE_NUMBER X \endcode - * -# Ensure that conf_usb.h contains the following parameters - * required for a USB composite device configuration: - * - \code // USB Interfaces descriptor structure - #define UDI_COMPOSITE_DESC_T \ - ... - udi_msc_desc_t udi_msc; \ - ... - // USB Interfaces descriptor value for Full Speed - #define UDI_COMPOSITE_DESC_FS \ - ... - .udi_msc = UDI_MSC_DESC_FS, \ - ... - // USB Interfaces descriptor value for High Speed - #define UDI_COMPOSITE_DESC_HS \ - ... - .udi_msc = UDI_MSC_DESC_HS, \ - ... - // USB Interface APIs - #define UDI_COMPOSITE_API \ - ... - &udi_api_msc, \ - ... \endcode - * - \note The descriptors order given in the four lists above must be the - * same as the order defined by all interface indexes. The interface index - * orders are defined through UDI_X_IFACE_NUMBER defines. - */ - -#endif // _UDI_MSC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c deleted file mode 100644 index 9bac29276c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c +++ /dev/null @@ -1,2074 +0,0 @@ -/** - * \file - * - * \brief USB Device Driver for UOTGHS. Compliant with common UDD driver. - * - * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ - -/* - * Support and FAQ: visit Atmel Support - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "compiler.h" -#include "uotghs_device_due.h" - -#include "conf_usb.h" -#include "sysclk.h" -#include "udd.h" -#include "uotghs_otg.h" -#include - -#ifndef UDD_NO_SLEEP_MGR -# include "sleep.h" -# include "sleepmgr.h" -#endif - -#if !(SAM3XA) -# error The current UOTGHS Device Driver supports only SAM3X and SAM3A. -#endif -#ifndef UDD_USB_INT_FUN -# define UDD_USB_INT_FUN UOTGHS_Handler -#endif - -#ifndef UDD_USB_INT_LEVEL -# define UDD_USB_INT_LEVEL 5 // By default USB interrupt have low priority -#endif - -#define UDD_EP_USED(ep) (USB_DEVICE_MAX_EP >= ep) - -#if ( (UDD_EP_USED( 1) && Is_udd_endpoint_dma_supported( 1)) \ - ||(UDD_EP_USED( 2) && Is_udd_endpoint_dma_supported( 2)) \ - ||(UDD_EP_USED( 3) && Is_udd_endpoint_dma_supported( 3)) \ - ||(UDD_EP_USED( 4) && Is_udd_endpoint_dma_supported( 4)) \ - ||(UDD_EP_USED( 5) && Is_udd_endpoint_dma_supported( 5)) \ - ||(UDD_EP_USED( 6) && Is_udd_endpoint_dma_supported( 6)) \ - ||(UDD_EP_USED( 7) && Is_udd_endpoint_dma_supported( 7)) \ - ||(UDD_EP_USED( 8) && Is_udd_endpoint_dma_supported( 8)) \ - ||(UDD_EP_USED( 9) && Is_udd_endpoint_dma_supported( 9)) \ - ||(UDD_EP_USED(10) && Is_udd_endpoint_dma_supported(10)) \ - ||(UDD_EP_USED(11) && Is_udd_endpoint_dma_supported(11)) \ - ||(UDD_EP_USED(12) && Is_udd_endpoint_dma_supported(12)) \ - ||(UDD_EP_USED(13) && Is_udd_endpoint_dma_supported(13)) \ - ||(UDD_EP_USED(14) && Is_udd_endpoint_dma_supported(14)) \ - ||(UDD_EP_USED(15) && Is_udd_endpoint_dma_supported(15)) \ - ) -# define UDD_EP_DMA_SUPPORTED -#endif - -#if ( (UDD_EP_USED( 1) && !Is_udd_endpoint_dma_supported( 1)) \ - ||(UDD_EP_USED( 2) && !Is_udd_endpoint_dma_supported( 2)) \ - ||(UDD_EP_USED( 3) && !Is_udd_endpoint_dma_supported( 3)) \ - ||(UDD_EP_USED( 4) && !Is_udd_endpoint_dma_supported( 4)) \ - ||(UDD_EP_USED( 5) && !Is_udd_endpoint_dma_supported( 5)) \ - ||(UDD_EP_USED( 6) && !Is_udd_endpoint_dma_supported( 6)) \ - ||(UDD_EP_USED( 7) && !Is_udd_endpoint_dma_supported( 7)) \ - ||(UDD_EP_USED( 8) && !Is_udd_endpoint_dma_supported( 8)) \ - ||(UDD_EP_USED( 9) && !Is_udd_endpoint_dma_supported( 9)) \ - ||(UDD_EP_USED(10) && !Is_udd_endpoint_dma_supported(10)) \ - ||(UDD_EP_USED(11) && !Is_udd_endpoint_dma_supported(11)) \ - ||(UDD_EP_USED(12) && !Is_udd_endpoint_dma_supported(12)) \ - ||(UDD_EP_USED(13) && !Is_udd_endpoint_dma_supported(13)) \ - ||(UDD_EP_USED(14) && !Is_udd_endpoint_dma_supported(14)) \ - ||(UDD_EP_USED(15) && !Is_udd_endpoint_dma_supported(15)) \ - ) -# define UDD_EP_FIFO_SUPPORTED -#endif - -// for debug text -//#define dbg_print printf -#define dbg_print(...) - -/** - * \ingroup udd_group - * \defgroup udd_udphs_group USB On-The-Go High-Speed Port for device mode (UOTGHS) - * - * \section UOTGHS_CONF UOTGHS Custom configuration - * The following UOTGHS driver configuration must be included in the conf_usb.h - * file of the application. - * - * UDD_USB_INT_LEVEL
- * Option to change the interrupt priority (0 to 15) by default 5 (recommended). - * - * UDD_USB_INT_FUN
- * Option to fit interrupt function to what defined in exception table. - * - * UDD_ISOCHRONOUS_NB_BANK(ep)
- * Feature to reduce or increase isochronous endpoints buffering (1 to 3). - * Default value 2. - * - * UDD_BULK_NB_BANK(ep)
- * Feature to reduce or increase bulk endpoints buffering (1 to 2). - * Default value 2. - * - * UDD_INTERRUPT_NB_BANK(ep)
- * Feature to reduce or increase interrupt endpoints buffering (1 to 2). - * Default value 1. - * - * \section Callbacks management - * The USB driver is fully managed by interrupt and does not request periodique - * task. Thereby, the USB events use callbacks to transfer the information. - * The callbacks are declared in static during compilation or in variable during - * code execution. - * - * Static declarations defined in conf_usb.h: - * - UDC_VBUS_EVENT(bool b_present)
- * To signal Vbus level change - * - UDC_SUSPEND_EVENT()
- * Called when USB bus enter in suspend mode - * - UDC_RESUME_EVENT()
- * Called when USB bus is wakeup - * - UDC_SOF_EVENT()
- * Called for each received SOF, Note: Each 1ms in HS/FS mode only. - * - * Dynamic callbacks, called "endpoint job" , are registered - * in udd_ep_job_t structure via the following functions: - * - udd_ep_run()
- * To call it when a transfer is finish - * - udd_ep_wait_stall_clear()
- * To call it when a endpoint halt is disabled - * - * \section Power mode management - * The Sleep modes authorized : - * - in USB IDLE state, the UOTGHS needs of USB clock and authorizes up to sleep mode WFI. - * - in USB SUSPEND state, the UOTGHS no needs USB clock and authorizes up to sleep mode WAIT. - * @{ - */ - -// Check USB Device configuration -#ifndef USB_DEVICE_EP_CTRL_SIZE -# error USB_DEVICE_EP_CTRL_SIZE not defined -#endif -#ifndef USB_DEVICE_MAX_EP -# error USB_DEVICE_MAX_EP not defined -#endif - -// Note: USB_DEVICE_MAX_EP does not include control endpoint -#if USB_DEVICE_MAX_EP > (UDD_MAX_PEP_NB-1) -# error USB_DEVICE_MAX_EP is too high and not supported by this part -#endif - -#define UDD_EP_ISO_NBANK_ERROR(ep) \ - ( (UDD_ISOCHRONOUS_NB_BANK(ep) < 1) \ - || (UDD_ISOCHRONOUS_NB_BANK(ep) > 3) ) -#define UDD_EP_BULK_NBANK_ERROR(ep) \ - ( (UDD_BULK_NB_BANK(ep) < 1) || (UDD_BULK_NB_BANK(ep) > 2) ) -#define UDD_EP_INT_NBANK_ERROR(ep) \ - ( (UDD_INTERRUPT_NB_BANK(ep) < 1) || (UDD_INTERRUPT_NB_BANK(ep) > 2) ) - -#define UDD_EP_ISO_NB_BANK_ERROR(ep) \ - (UDD_EP_USED(ep) && UDD_EP_ISO_NBANK_ERROR(ep)) -#define UDD_EP_BULK_NB_BANK_ERROR(ep) \ - (UDD_EP_USED(ep) && UDD_EP_ISO_NBANK_ERROR(ep)) -#define UDD_EP_INT_NB_BANK_ERROR(ep) \ - (UDD_EP_USED(ep) && UDD_EP_ISO_NBANK_ERROR(ep)) - -#define UDD_EP_NB_BANK_ERROR(ep, type) \ - (ATPASTE3(UDD_EP_, type, _NB_BANK_ERROR(ep))) - -#define UDD_ISO_NB_BANK_ERROR \ - ( UDD_EP_NB_BANK_ERROR( 1, ISO) \ - || UDD_EP_NB_BANK_ERROR( 2, ISO) \ - || UDD_EP_NB_BANK_ERROR( 3, ISO) \ - || UDD_EP_NB_BANK_ERROR( 4, ISO) \ - || UDD_EP_NB_BANK_ERROR( 5, ISO) \ - || UDD_EP_NB_BANK_ERROR( 6, ISO) \ - || UDD_EP_NB_BANK_ERROR( 7, ISO) \ - || UDD_EP_NB_BANK_ERROR( 8, ISO) \ - || UDD_EP_NB_BANK_ERROR( 9, ISO) \ - || UDD_EP_NB_BANK_ERROR(10, ISO) \ - || UDD_EP_NB_BANK_ERROR(11, ISO) \ - || UDD_EP_NB_BANK_ERROR(12, ISO) \ - || UDD_EP_NB_BANK_ERROR(13, ISO) \ - || UDD_EP_NB_BANK_ERROR(14, ISO) \ - || UDD_EP_NB_BANK_ERROR(15, ISO) ) -#define UDD_BULK_NB_BANK_ERROR \ - ( UDD_EP_NB_BANK_ERROR( 1, BULK) \ - || UDD_EP_NB_BANK_ERROR( 2, BULK) \ - || UDD_EP_NB_BANK_ERROR( 3, BULK) \ - || UDD_EP_NB_BANK_ERROR( 4, BULK) \ - || UDD_EP_NB_BANK_ERROR( 5, BULK) \ - || UDD_EP_NB_BANK_ERROR( 6, BULK) \ - || UDD_EP_NB_BANK_ERROR( 7, BULK) \ - || UDD_EP_NB_BANK_ERROR( 8, BULK) \ - || UDD_EP_NB_BANK_ERROR( 9, BULK) \ - || UDD_EP_NB_BANK_ERROR(10, BULK) \ - || UDD_EP_NB_BANK_ERROR(11, BULK) \ - || UDD_EP_NB_BANK_ERROR(12, BULK) \ - || UDD_EP_NB_BANK_ERROR(13, BULK) \ - || UDD_EP_NB_BANK_ERROR(14, BULK) \ - || UDD_EP_NB_BANK_ERROR(15, BULK) ) -#define UDD_INTERRUPT_NB_BANK_ERROR \ - ( UDD_EP_NB_BANK_ERROR( 1, INT) \ - || UDD_EP_NB_BANK_ERROR( 2, INT) \ - || UDD_EP_NB_BANK_ERROR( 3, INT) \ - || UDD_EP_NB_BANK_ERROR( 4, INT) \ - || UDD_EP_NB_BANK_ERROR( 5, INT) \ - || UDD_EP_NB_BANK_ERROR( 6, INT) \ - || UDD_EP_NB_BANK_ERROR( 7, INT) \ - || UDD_EP_NB_BANK_ERROR( 8, INT) \ - || UDD_EP_NB_BANK_ERROR( 9, INT) \ - || UDD_EP_NB_BANK_ERROR(10, INT) \ - || UDD_EP_NB_BANK_ERROR(11, INT) \ - || UDD_EP_NB_BANK_ERROR(12, INT) \ - || UDD_EP_NB_BANK_ERROR(13, INT) \ - || UDD_EP_NB_BANK_ERROR(14, INT) \ - || UDD_EP_NB_BANK_ERROR(15, INT) ) - -#ifndef UDD_ISOCHRONOUS_NB_BANK -# define UDD_ISOCHRONOUS_NB_BANK(ep) 2 -#else -# if UDD_ISO_NB_BANK_ERROR -# error UDD_ISOCHRONOUS_NB_BANK(ep) must be define within 1 to 3. -# endif -#endif - -#ifndef UDD_BULK_NB_BANK -# define UDD_BULK_NB_BANK(ep) 2 -#else -# if UDD_BULK_NB_BANK_ERROR -# error UDD_BULK_NB_BANK must be define with 1 or 2. -# endif -#endif - -#ifndef UDD_INTERRUPT_NB_BANK -# define UDD_INTERRUPT_NB_BANK(ep) 1 -#else -# if UDD_INTERRUPT_NB_BANK_ERROR -# error UDD_INTERRUPT_NB_BANK must be define with 1 or 2. -# endif -#endif - - -/** - * \name Power management routine. - */ -//@{ - -#ifndef UDD_NO_SLEEP_MGR - -//! Definition of sleep levels -#define UOTGHS_SLEEP_MODE_USB_SUSPEND SLEEPMGR_WAIT_FAST -#define UOTGHS_SLEEP_MODE_USB_IDLE SLEEPMGR_SLEEP_WFI - -//! State of USB line -static bool udd_b_idle; -//! State of sleep manager -static bool udd_b_sleep_initialized = false; - - -/*! \brief Authorize or not the CPU powerdown mode - * - * \param b_enable true to authorize idle mode - */ -static void udd_sleep_mode(bool b_idle) -{ - if (!b_idle && udd_b_idle) { - dbg_print("_S "); - sleepmgr_unlock_mode(UOTGHS_SLEEP_MODE_USB_IDLE); - } - if (b_idle && !udd_b_idle) { - dbg_print("_W "); - sleepmgr_lock_mode(UOTGHS_SLEEP_MODE_USB_IDLE); - } - udd_b_idle = b_idle; -} -#else - -static void udd_sleep_mode(bool b_idle) -{ - b_idle = b_idle; -} - -#endif // UDD_NO_SLEEP_MGR - -//@} - - -/** - * \name Control endpoint low level management routine. - * - * This function performs control endpoint mangement. - * It handle the SETUP/DATA/HANDSHAKE phases of a control transaction. - */ -//@{ - -//! Global variable to give and record information about setup request management -COMPILER_WORD_ALIGNED udd_ctrl_request_t udd_g_ctrlreq; - -//! Bit definitions about endpoint control state machine for udd_ep_control_state -typedef enum { - UDD_EPCTRL_SETUP = 0, //!< Wait a SETUP packet - UDD_EPCTRL_DATA_OUT = 1, //!< Wait a OUT data packet - UDD_EPCTRL_DATA_IN = 2, //!< Wait a IN data packet - UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP = 3, //!< Wait a IN ZLP packet - UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP = 4, //!< Wait a OUT ZLP packet - UDD_EPCTRL_STALL_REQ = 5, //!< STALL enabled on IN & OUT packet -} udd_ctrl_ep_state_t; - -//! State of the endpoint control management -static udd_ctrl_ep_state_t udd_ep_control_state; - -//! Total number of data received/sent during data packet phase with previous payload buffers -static uint16_t udd_ctrl_prev_payload_buf_cnt; - -//! Number of data received/sent to/from udd_g_ctrlreq.payload buffer -static uint16_t udd_ctrl_payload_buf_cnt; - -/** - * \brief Reset control endpoint - * - * Called after a USB line reset or when UDD is enabled - */ -static void udd_reset_ep_ctrl(void); - -/** - * \brief Reset control endpoint management - * - * Called after a USB line reset or at the end of SETUP request (after ZLP) - */ -static void udd_ctrl_init(void); - -//! \brief Managed reception of SETUP packet on control endpoint -static void udd_ctrl_setup_received(void); - -//! \brief Managed reception of IN packet on control endpoint -static void udd_ctrl_in_sent(void); - -//! \brief Managed reception of OUT packet on control endpoint -static void udd_ctrl_out_received(void); - -//! \brief Managed underflow event of IN packet on control endpoint -static void udd_ctrl_underflow(void); - -//! \brief Managed overflow event of OUT packet on control endpoint -static void udd_ctrl_overflow(void); - -//! \brief Managed stall event of IN/OUT packet on control endpoint -static void udd_ctrl_stall_data(void); - -//! \brief Send a ZLP IN on control endpoint -static void udd_ctrl_send_zlp_in(void); - -//! \brief Send a ZLP OUT on control endpoint -static void udd_ctrl_send_zlp_out(void); - -//! \brief Call callback associated to setup request -static void udd_ctrl_endofrequest(void); - - -/** - * \brief Main interrupt routine for control endpoint - * - * This switchs control endpoint events to correct sub function. - * - * \return \c 1 if an event about control endpoint is occured, otherwise \c 0. - */ -static bool udd_ctrl_interrupt(void); - -//@} - - -/** - * \name Management of bulk/interrupt/isochronous endpoints - * - * The UDD manages the data transfer on endpoints: - * - Start data tranfer on endpoint with USB Device DMA - * - Send a ZLP packet if requested - * - Call callback registered to signal end of transfer - * The transfer abort and stall feature are supported. - */ -//@{ -#if (0!=USB_DEVICE_MAX_EP) - -//! Structure definition about job registered on an endpoint -typedef struct { - union { - //! Callback to call at the end of transfer - udd_callback_trans_t call_trans; - - //! Callback to call when the endpoint halt is cleared - udd_callback_halt_cleared_t call_nohalt; - }; - //! Buffer located in internal RAM to send or fill during job - uint8_t *buf; - //! Size of buffer to send or fill - iram_size_t buf_size; - //!< Size of data transfered - iram_size_t buf_cnt; - //!< Size of data loaded (or prepared for DMA) last time - iram_size_t buf_load; - //! A job is registered on this endpoint - uint8_t busy:1; - //! A short packet is requested for this job on endpoint IN - uint8_t b_shortpacket:1; - //! A stall has been requested but not executed - uint8_t stall_requested:1; -} udd_ep_job_t; - - -//! Array to register a job on bulk/interrupt/isochronous endpoint -static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP]; - -//! \brief Reset all job table -static void udd_ep_job_table_reset(void); - -//! \brief Abort all endpoint jobs on going -static void udd_ep_job_table_kill(void); - -#ifdef UDD_EP_FIFO_SUPPORTED - /** - * \brief Fill banks and send them - * - * \param ep endpoint number of job to abort - */ - static void udd_ep_in_sent(udd_ep_id_t ep); - - /** - * \brief Store received banks - * - * \param ep endpoint number of job to abort - */ - static void udd_ep_out_received(udd_ep_id_t ep); -#endif - -/** - * \brief Abort endpoint job on going - * - * \param ep endpoint number of job to abort - */ -static void udd_ep_abort_job(udd_ep_id_t ep); - -/** - * \brief Call the callback associated to the job which is finished - * - * \param ptr_job job to complete - * \param b_abort if true then the job has been aborted - */ -static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num); - -#ifdef UDD_EP_DMA_SUPPORTED - /** - * \brief Start the next transfer if necessary or complet the job associated. - * - * \param ep endpoint number without direction flag - */ - static void udd_ep_trans_done(udd_ep_id_t ep); -#endif - -/** - * \brief Main interrupt routine for bulk/interrupt/isochronous endpoints - * - * This switchs endpoint events to correct sub function. - * - * \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occured, otherwise \c 0. - */ -static bool udd_ep_interrupt(void); - -#endif // (0!=USB_DEVICE_MAX_EP) -//@} - - -// ------------------------ -//--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS - -/** - * \internal - * \brief Function called by UOTGHS interrupt to manage USB Device interrupts - * - * USB Device interrupt events are splited in three parts: - * - USB line events (SOF, reset, suspend, resume, wakeup) - * - control endpoint events (setup reception, end of data transfer, underflow, overflow, stall) - * - bulk/interrupt/isochronous endpoints events (end of data transfer) - * - * Note: - * Here, the global interrupt mask is not clear when an USB interrupt is enabled - * because this one can not be occured during the USB ISR (=during INTX is masked). - * See Technical reference $3.8.3 Masking interrupt requests in peripheral modules. - */ -#ifdef UHD_ENABLE -void udd_interrupt(void); -void udd_interrupt(void) -#else -ISR(UDD_USB_INT_FUN) -#endif -{ - /* For fast wakeup clocks restore - * In WAIT mode, clocks are switched to FASTRC. - * After wakeup clocks should be restored, before that ISR should not - * be served. - */ - if (!pmc_is_wakeup_clocks_restored() && !Is_udd_suspend()) { - cpu_irq_disable(); - return; - } - - if (Is_udd_sof()) { - udd_ack_sof(); - if (Is_udd_full_speed_mode()) { - udc_sof_notify(); - } -#ifdef UDC_SOF_EVENT - UDC_SOF_EVENT(); -#endif - goto udd_interrupt_sof_end; - } - - if (Is_udd_msof()) { - udd_ack_msof(); - udc_sof_notify(); - goto udd_interrupt_sof_end; - } - - dbg_print("%c ", udd_is_high_speed() ? 'H' : 'F'); - - if (udd_ctrl_interrupt()) { - goto udd_interrupt_end; // Interrupt acked by control endpoint managed - } - -#if (0 != USB_DEVICE_MAX_EP) - if (udd_ep_interrupt()) { - goto udd_interrupt_end; // Interrupt acked by bulk/interrupt/isochronous endpoint managed - } -#endif - - // USB bus reset detection - if (Is_udd_reset()) { - udd_ack_reset(); - dbg_print("RST "); - // Abort all jobs on-going -#if (USB_DEVICE_MAX_EP != 0) - udd_ep_job_table_kill(); -#endif - // Reset USB Device Stack Core - udc_reset(); - // Reset endpoint control - udd_reset_ep_ctrl(); - // Reset endpoint control management - udd_ctrl_init(); - goto udd_interrupt_end; - } - - if (Is_udd_suspend_interrupt_enabled() && Is_udd_suspend()) { - otg_unfreeze_clock(); - // The suspend interrupt is automatic acked when a wakeup occur - udd_disable_suspend_interrupt(); - udd_enable_wake_up_interrupt(); - otg_freeze_clock(); // Mandatory to exit of sleep mode after a wakeup event - udd_sleep_mode(false); // Enter in SUSPEND mode -#ifdef UDC_SUSPEND_EVENT - UDC_SUSPEND_EVENT(); -#endif - goto udd_interrupt_end; - } - - if (Is_udd_wake_up_interrupt_enabled() && Is_udd_wake_up()) { - // Ack wakeup interrupt and enable suspend interrupt - otg_unfreeze_clock(); - // Check USB clock ready after suspend and eventually sleep USB clock - while (!Is_otg_clock_usable()) { - if (Is_udd_suspend()) { - break; // In case of USB state change in HS - } - }; - // The wakeup interrupt is automatic acked when a suspend occur - udd_disable_wake_up_interrupt(); - udd_enable_suspend_interrupt(); - udd_sleep_mode(true); // Enter in IDLE mode -#ifdef UDC_RESUME_EVENT - UDC_RESUME_EVENT(); -#endif - goto udd_interrupt_end; - } - - if (Is_otg_vbus_transition()) { - dbg_print("VBus "); - // Ack Vbus transition and send status to high level - otg_unfreeze_clock(); - otg_ack_vbus_transition(); - otg_freeze_clock(); -#ifndef USB_DEVICE_ATTACH_AUTO_DISABLE - if (Is_otg_vbus_high()) { - udd_attach(); - } else { - udd_detach(); - } -#endif -#ifdef UDC_VBUS_EVENT - UDC_VBUS_EVENT(Is_otg_vbus_high()); -#endif - goto udd_interrupt_end; - } -udd_interrupt_end: - dbg_print("\n\r"); -udd_interrupt_sof_end: - return; -} - - -bool udd_include_vbus_monitoring(void) -{ - return true; -} - - -void udd_enable(void) -{ - irqflags_t flags; - - flags = cpu_irq_save(); - -#ifdef UHD_ENABLE - // DUAL ROLE INITIALIZATION - if (otg_dual_enable()) { - // The current mode has been started by otg_dual_enable() - cpu_irq_restore(flags); - return; - } -#else - // SINGLE DEVICE MODE INITIALIZATION - pmc_enable_periph_clk(ID_UOTGHS); - sysclk_enable_usb(); - - // Here, only the device mode is possible, then link UOTGHS interrupt to UDD interrupt - NVIC_SetPriority((IRQn_Type) ID_UOTGHS, UDD_USB_INT_LEVEL); - NVIC_EnableIRQ((IRQn_Type) ID_UOTGHS); - - // Always authorize asynchrone USB interrupts to exit of sleep mode - // For SAM USB wake up device except BACKUP mode - pmc_set_fast_startup_input(PMC_FSMR_USBAL); -#endif - -#if (defined USB_ID_GPIO) && (defined UHD_ENABLE) - // Check that the device mode is selected by ID pin - if (!Is_otg_id_device()) { - cpu_irq_restore(flags); - return; // Device is not the current mode - } -#else - // ID pin not used then force device mode - otg_disable_id_pin(); - otg_force_device_mode(); -#endif - // Enable USB hardware - otg_enable_pad(); - otg_enable(); - - // Set the USB speed requested by configuration file -#ifdef USB_DEVICE_LOW_SPEED - udd_low_speed_enable(); -#else - udd_low_speed_disable(); -# ifdef USB_DEVICE_HS_SUPPORT - udd_high_speed_enable(); -# else - udd_high_speed_disable(); -# endif -#endif // USB_DEVICE_LOW_SPEED - - // Check USB clock - otg_unfreeze_clock(); - while (!Is_otg_clock_usable()); - - // Reset internal variables -#if (0!=USB_DEVICE_MAX_EP) - udd_ep_job_table_reset(); -#endif - - otg_ack_vbus_transition(); - // Force Vbus interrupt in case of Vbus always with a high level - // This is possible with a short timing between a Host mode stop/start. - if (Is_otg_vbus_high()) { - otg_raise_vbus_transition(); - } - otg_enable_vbus_interrupt(); - otg_freeze_clock(); - -#ifndef UDD_NO_SLEEP_MGR - if (!udd_b_sleep_initialized) { - udd_b_sleep_initialized = true; - // Initialize the sleep mode authorized for the USB suspend mode - udd_b_idle = false; - sleepmgr_lock_mode(UOTGHS_SLEEP_MODE_USB_SUSPEND); - } else { - udd_sleep_mode(false); // Enter idle mode - } -#endif - - cpu_irq_restore(flags); -} - - -void udd_disable(void) -{ - irqflags_t flags; - -#ifdef UHD_ENABLE -# ifdef USB_ID_GPIO - if (Is_otg_id_host()) { - // Freeze clock to switch mode - otg_freeze_clock(); - udd_detach(); - otg_disable(); - return; // Host mode running, ignore UDD disable - } -# else - if (Is_otg_host_mode_forced()) { - return; // Host mode running, ignore UDD disable - } -# endif -#endif - - flags = cpu_irq_save(); - otg_unfreeze_clock(); - udd_detach(); -#ifndef UDD_NO_SLEEP_MGR - if (udd_b_sleep_initialized) { - udd_b_sleep_initialized = false; - sleepmgr_unlock_mode(UOTGHS_SLEEP_MODE_USB_SUSPEND); - } -#endif - -#ifndef UHD_ENABLE - otg_disable(); - otg_disable_pad(); - sysclk_disable_usb(); - pmc_disable_periph_clk(ID_UOTGHS); - // Else the USB clock disable is done by UHC which manage USB dual role -#endif - cpu_irq_restore(flags); -} - - -void udd_attach(void) -{ - irqflags_t flags; - flags = cpu_irq_save(); - - // At startup the USB bus state is unknown, - // therefore the state is considered IDLE to not miss any USB event - udd_sleep_mode(true); - otg_unfreeze_clock(); - - // This section of clock check can be improved with a chek of - // USB clock source via sysclk() - // Check USB clock because the source can be a PLL - while (!Is_otg_clock_usable()); - - // Authorize attach if Vbus is present - udd_attach_device(); - - // Enable USB line events - udd_enable_reset_interrupt(); - udd_enable_suspend_interrupt(); - udd_enable_wake_up_interrupt(); - udd_enable_sof_interrupt(); -#ifdef USB_DEVICE_HS_SUPPORT - udd_enable_msof_interrupt(); -#endif - // Reset following interupts flag - udd_ack_reset(); - udd_ack_sof(); - udd_ack_msof(); - - // The first suspend interrupt must be forced - // The first suspend interrupt is not detected else raise it - udd_raise_suspend(); - - udd_ack_wake_up(); - otg_freeze_clock(); - cpu_irq_restore(flags); -} - - -void udd_detach(void) -{ - otg_unfreeze_clock(); - - // Detach device from the bus - udd_detach_device(); - otg_freeze_clock(); - udd_sleep_mode(false); -} - - -bool udd_is_high_speed(void) -{ -#ifdef USB_DEVICE_HS_SUPPORT - return !Is_udd_full_speed_mode(); -#else - return false; -#endif -} - - -void udd_set_address(uint8_t address) -{ - udd_disable_address(); - udd_configure_address(address); - udd_enable_address(); -} - - -uint8_t udd_getaddress(void) -{ - return udd_get_configured_address(); -} - - -uint16_t udd_get_frame_number(void) -{ - return udd_frame_number(); -} - -uint16_t udd_get_micro_frame_number(void) -{ - return udd_micro_frame_number(); -} - -void udd_send_remotewakeup(void) -{ -#ifndef UDD_NO_SLEEP_MGR - if (!udd_b_idle) -#endif - { - udd_sleep_mode(true); // Enter in IDLE mode - otg_unfreeze_clock(); - udd_initiate_remote_wake_up(); - } -} - - -void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size) -{ - udd_g_ctrlreq.payload = payload; - udd_g_ctrlreq.payload_size = payload_size; -} - - -#if (0 != USB_DEVICE_MAX_EP) -bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, - uint16_t MaxEndpointSize) -{ - bool b_dir_in; - uint16_t ep_allocated; - uint8_t nb_bank, bank, i; - - b_dir_in = ep & USB_EP_DIR_IN; - ep = ep & USB_EP_ADDR_MASK; - - if (ep > USB_DEVICE_MAX_EP) { - return false; - } - if (Is_udd_endpoint_enabled(ep)) { - return false; - } - dbg_print("alloc(%x, %d) ", ep, MaxEndpointSize); - - // Bank choise - switch (bmAttributes & USB_EP_TYPE_MASK) { - case USB_EP_TYPE_ISOCHRONOUS: - nb_bank = UDD_ISOCHRONOUS_NB_BANK(ep); - break; - case USB_EP_TYPE_INTERRUPT: - nb_bank = UDD_INTERRUPT_NB_BANK(ep); - break; - case USB_EP_TYPE_BULK: - nb_bank = UDD_BULK_NB_BANK(ep); - break; - default: - Assert(false); - return false; - } - switch (nb_bank) { - case 1: - bank = UOTGHS_DEVEPTCFG_EPBK_1_BANK >> - UOTGHS_DEVEPTCFG_EPBK_Pos; - break; - case 2: - bank = UOTGHS_DEVEPTCFG_EPBK_2_BANK >> - UOTGHS_DEVEPTCFG_EPBK_Pos; - break; - case 3: - bank = UOTGHS_DEVEPTCFG_EPBK_3_BANK >> - UOTGHS_DEVEPTCFG_EPBK_Pos; - break; - default: - Assert(false); - return false; - } - - // Check if endpoint size is 8,16,32,64,128,256,512 or 1023 - Assert(MaxEndpointSize < 1024); - Assert((MaxEndpointSize == 1023) - || !(MaxEndpointSize & (MaxEndpointSize - 1))); - Assert(MaxEndpointSize >= 8); - - // Set configuration of new endpoint - udd_configure_endpoint(ep, bmAttributes, (b_dir_in ? 1 : 0), - MaxEndpointSize, bank); - ep_allocated = 1 << ep; - - // Unalloc endpoints superior - for (i = USB_DEVICE_MAX_EP; i > ep; i--) { - if (Is_udd_endpoint_enabled(i)) { - ep_allocated |= 1 << i; - udd_disable_endpoint(i); - udd_unallocate_memory(i); - } - } - - // Realloc/Enable endpoints - for (i = ep; i <= USB_DEVICE_MAX_EP; i++) { - if (ep_allocated & (1 << i)) { - udd_ep_job_t *ptr_job = &udd_ep_job[i - 1]; - bool b_restart = ptr_job->busy; - // Restart running job because - // memory window slides up and its data is lost - ptr_job->busy = false; - // Re-allocate memory - udd_allocate_memory(i); - udd_enable_endpoint(i); - if (!Is_udd_endpoint_configured(i)) { - dbg_print("ErrRealloc%d ", i); - if (NULL == ptr_job->call_trans) { - return false; - } - if (Is_udd_endpoint_in(i)) { - i |= USB_EP_DIR_IN; - } - ptr_job->call_trans(UDD_EP_TRANSFER_ABORT, - ptr_job->buf_cnt, i); - return false; - } - udd_enable_endpoint_bank_autoswitch(i); - if (b_restart) { - // Re-run the job remaining part -# ifdef UDD_EP_FIFO_SUPPORTED - if (!Is_udd_endpoint_dma_supported(i) - && !Is_udd_endpoint_in(i)) { - ptr_job->buf_cnt -= ptr_job->buf_load; - } -# else - ptr_job->buf_cnt -= ptr_job->buf_load; -# endif - b_restart = udd_ep_run(Is_udd_endpoint_in(i) ? - (i | USB_EP_DIR_IN) : i, - ptr_job->b_shortpacket, - &ptr_job->buf[ptr_job->buf_cnt], - ptr_job->buf_size - - ptr_job->buf_cnt, - ptr_job->call_trans); - if (!b_restart) { - dbg_print("ErrReRun%d ", i); - return false; - } - } - } - } - return true; -} - - -void udd_ep_free(udd_ep_id_t ep) -{ - uint8_t ep_index = ep & USB_EP_ADDR_MASK; - if (USB_DEVICE_MAX_EP < ep_index) { - return; - } - udd_disable_endpoint(ep_index); - udd_unallocate_memory(ep_index); - udd_ep_abort_job(ep); - udd_ep_job[ep_index - 1].stall_requested = false; -} - - -bool udd_ep_is_halted(udd_ep_id_t ep) -{ - uint8_t ep_index = ep & USB_EP_ADDR_MASK; - return Is_udd_endpoint_stall_requested(ep_index); -} - - -bool udd_ep_set_halt(udd_ep_id_t ep) -{ - uint8_t ep_index = ep & USB_EP_ADDR_MASK; - udd_ep_job_t *ptr_job = &udd_ep_job[ep_index - 1]; - irqflags_t flags; - - if (USB_DEVICE_MAX_EP < ep_index) { - return false; - } - - if (Is_udd_endpoint_stall_requested(ep_index) // Endpoint stalled - || ptr_job->stall_requested) { // Endpoint stall is requested - return true; // Already STALL - } - - if (ptr_job->busy == true) { - return false; // Job on going, stall impossible - } - - flags = cpu_irq_save(); - if ((ep & USB_EP_DIR_IN) && (0 != udd_nb_busy_bank(ep_index))) { - // Delay the stall after the end of IN transfer on USB line - ptr_job->stall_requested = true; -#ifdef UDD_EP_FIFO_SUPPORTED - udd_disable_in_send_interrupt(ep_index); - udd_enable_endpoint_bank_autoswitch(ep_index); -#endif - udd_enable_bank_interrupt(ep_index); - udd_enable_endpoint_interrupt(ep_index); - cpu_irq_restore(flags); - return true; - } - // Stall endpoint immediately - udd_disable_endpoint_bank_autoswitch(ep_index); - udd_ack_stall(ep_index); - udd_enable_stall_handshake(ep_index); - cpu_irq_restore(flags); - return true; -} - - -bool udd_ep_clear_halt(udd_ep_id_t ep) -{ - uint8_t ep_index = ep & USB_EP_ADDR_MASK; - udd_ep_job_t *ptr_job = &udd_ep_job[ep_index - 1]; - bool b_stall_cleared = false; - - if (USB_DEVICE_MAX_EP < ep_index) - return false; - - if (ptr_job->stall_requested) { - // Endpoint stall has been requested but not done - // Remove stall request - ptr_job->stall_requested = false; - udd_disable_bank_interrupt(ep_index); - udd_disable_endpoint_interrupt(ep_index); - b_stall_cleared = true; - } - if (Is_udd_endpoint_stall_requested(ep_index)) { - if (Is_udd_stall(ep_index)) { - udd_ack_stall(ep_index); - // A packet has been stalled - // then reset datatoggle - udd_reset_data_toggle(ep_index); - } - // Disable stall - udd_disable_stall_handshake(ep_index); - udd_enable_endpoint_bank_autoswitch(ep_index); - b_stall_cleared = true; - } - if (b_stall_cleared) { - // If a job is register on clear halt action - // then execute callback - if (ptr_job->busy == true) { - ptr_job->busy = false; - ptr_job->call_nohalt(); - } - } - return true; -} - - -bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, - uint8_t * buf, iram_size_t buf_size, - udd_callback_trans_t callback) -{ -#ifdef UDD_EP_FIFO_SUPPORTED - bool b_dir_in = Is_udd_endpoint_in(ep & USB_EP_ADDR_MASK); -#endif - udd_ep_job_t *ptr_job; - irqflags_t flags; - - ep &= USB_EP_ADDR_MASK; - if (USB_DEVICE_MAX_EP < ep) { - return false; - } - - // Get job about endpoint - ptr_job = &udd_ep_job[ep - 1]; - - if ((!Is_udd_endpoint_enabled(ep)) - || Is_udd_endpoint_stall_requested(ep) - || ptr_job->stall_requested) { - return false; // Endpoint is halted - } - - flags = cpu_irq_save(); - if (ptr_job->busy == true) { - cpu_irq_restore(flags); - return false; // Job already on going - } - ptr_job->busy = true; - cpu_irq_restore(flags); - - // No job running. Let's setup a new one. - ptr_job->buf = buf; - ptr_job->buf_size = buf_size; - ptr_job->buf_cnt = 0; - ptr_job->buf_load = 0; - ptr_job->call_trans = callback; - ptr_job->b_shortpacket = b_shortpacket || (buf_size == 0); - -#ifdef UDD_EP_FIFO_SUPPORTED - // No DMA support - if (!Is_udd_endpoint_dma_supported(ep)) { - dbg_print("ex%x.%c%d\n\r", ep, b_dir_in ? 'i':'o', buf_size); - flags = cpu_irq_save(); - udd_enable_endpoint_interrupt(ep); - if (b_dir_in) { - udd_disable_endpoint_bank_autoswitch(ep); - udd_enable_in_send_interrupt(ep); - } else { - udd_disable_endpoint_bank_autoswitch(ep); - udd_enable_out_received_interrupt(ep); - } - cpu_irq_restore(flags); - return true; - } -#endif // UDD_EP_FIFO_SUPPORTED - -#ifdef UDD_EP_DMA_SUPPORTED - // Request first DMA transfer - dbg_print("(exDMA%x) ", ep); - udd_ep_trans_done(ep); - return true; -#endif -} - - -void udd_ep_abort(udd_ep_id_t ep) -{ - uint8_t ep_index = ep & USB_EP_ADDR_MASK; - -#ifdef UDD_EP_FIFO_SUPPORTED - if (!Is_udd_endpoint_dma_supported(ep_index)) { - // Disable interrupts - udd_disable_endpoint_interrupt(ep_index); - udd_disable_out_received_interrupt(ep_index); - udd_disable_in_send_interrupt(ep_index); - } else -#endif - { - // Stop DMA transfer - udd_disable_endpoint_dma_interrupt(ep_index); - udd_endpoint_dma_set_control(ep_index, 0); - } - udd_disable_endpoint_interrupt(ep_index); - // Kill IN banks - if (ep & USB_EP_DIR_IN) { - while(udd_nb_busy_bank(ep_index)) { - udd_kill_last_in_bank(ep_index); - while(Is_udd_kill_last(ep_index)); - } - } - udd_ep_abort_job(ep); -} - - -bool udd_ep_wait_stall_clear(udd_ep_id_t ep, - udd_callback_halt_cleared_t callback) -{ - udd_ep_job_t *ptr_job; - - ep &= USB_EP_ADDR_MASK; - if (USB_DEVICE_MAX_EP < ep) { - return false; - } - - ptr_job = &udd_ep_job[ep - 1]; - - if (!Is_udd_endpoint_enabled(ep)) { - return false; // Endpoint not enabled - } - - // Wait clear halt endpoint - if (ptr_job->busy == true) { - return false; // Job already on going - } - - if (Is_udd_endpoint_stall_requested(ep) - || ptr_job->stall_requested) { - // Endpoint halted then registes the callback - ptr_job->busy = true; - ptr_job->call_nohalt = callback; - } else { - // endpoint not halted then call directly callback - callback(); - } - return true; -} -#endif // (0 != USB_DEVICE_MAX_EP) - - -#ifdef USB_DEVICE_HS_SUPPORT - -void udd_test_mode_j(void) -{ - udd_enable_hs_test_mode(); - udd_enable_hs_test_mode_j(); -} - - -void udd_test_mode_k(void) -{ - udd_enable_hs_test_mode(); - udd_enable_hs_test_mode_k(); -} - - -void udd_test_mode_se0_nak(void) -{ - udd_enable_hs_test_mode(); -} - - -void udd_test_mode_packet(void) -{ - uint8_t i; - uint8_t *ptr_dest; - const uint8_t *ptr_src; - - const uint8_t test_packet[] = { - // 00000000 * 9 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // 01010101 * 8 - 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, - // 01110111 * 8 - 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, - // 0, {111111S * 15}, 111111 - 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, - // S, 111111S, {0111111S * 7} - 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, - // 00111111, {S0111111 * 9}, S0 - 0xFC, 0x7E, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0x7E - }; - - // Reconfigure control endpoint to bulk IN endpoint - udd_disable_endpoint(0); - udd_configure_endpoint(0, USB_EP_TYPE_BULK, 1, - 64, UOTGHS_DEVEPTCFG_EPBK_1_BANK); - udd_allocate_memory(0); - udd_enable_endpoint(0); - - udd_enable_hs_test_mode(); - udd_enable_hs_test_mode_packet(); - - // Send packet on endpoint 0 - ptr_dest = (uint8_t *) & udd_get_endpoint_fifo_access(0, 8); - ptr_src = test_packet; - - for (i = 0; i < sizeof(test_packet); i++) { - *ptr_dest++ = *ptr_src++; - } - udd_ack_fifocon(0); -} -#endif // USB_DEVICE_HS_SUPPORT - - - -// ------------------------ -//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT - -static void udd_reset_ep_ctrl(void) -{ - irqflags_t flags; - - // Reset USB address to 0 - udd_configure_address(0); - udd_enable_address(); - - // Alloc and configure control endpoint - udd_configure_endpoint(0, - USB_EP_TYPE_CONTROL, - 0, - USB_DEVICE_EP_CTRL_SIZE, - UOTGHS_DEVEPTCFG_EPBK_1_BANK); - - udd_allocate_memory(0); - udd_enable_endpoint(0); - flags = cpu_irq_save(); - udd_enable_setup_received_interrupt(0); - udd_enable_out_received_interrupt(0); - udd_enable_endpoint_interrupt(0); - cpu_irq_restore(flags); -} - -static void udd_ctrl_init(void) -{ - irqflags_t flags; - flags = cpu_irq_save(); - - // In case of abort of IN Data Phase: - // No need to abort IN transfer (rise TXINI), - // because it is automatically done by hardware when a Setup packet is received. - // But the interrupt must be disabled to don't generate interrupt TXINI - // after SETUP reception. - udd_disable_in_send_interrupt(0); - cpu_irq_restore(flags); - - // In case of OUT ZLP event is no processed before Setup event occurs - udd_ack_out_received(0); - - udd_g_ctrlreq.callback = NULL; - udd_g_ctrlreq.over_under_run = NULL; - udd_g_ctrlreq.payload_size = 0; - udd_ep_control_state = UDD_EPCTRL_SETUP; -} - - -static void udd_ctrl_setup_received(void) -{ - irqflags_t flags; - uint8_t i; - - if (UDD_EPCTRL_SETUP != udd_ep_control_state) { - // May be a hidden DATA or ZLP phase or protocol abort - udd_ctrl_endofrequest(); - - // Reinitializes control endpoint management - udd_ctrl_init(); - } - // Fill setup request structure - if (8 != udd_byte_count(0)) { - udd_ctrl_stall_data(); - udd_ack_setup_received(0); - return; // Error data number doesn't correspond to SETUP packet - } - uint8_t *ptr = (uint8_t *) & udd_get_endpoint_fifo_access(0,8); - for (i = 0; i < 8; i++) { - ((uint8_t*) &udd_g_ctrlreq.req)[i] = *ptr++; - } - // Manage LSB/MSB to fit with CPU usage - udd_g_ctrlreq.req.wValue = le16_to_cpu(udd_g_ctrlreq.req.wValue); - udd_g_ctrlreq.req.wIndex = le16_to_cpu(udd_g_ctrlreq.req.wIndex); - udd_g_ctrlreq.req.wLength = le16_to_cpu(udd_g_ctrlreq.req.wLength); - - // Decode setup request - if (udc_process_setup() == false) { - // Setup request unknow then stall it - udd_ctrl_stall_data(); - udd_ack_setup_received(0); - return; - } - udd_ack_setup_received(0); - - if (Udd_setup_is_in()) { - // IN data phase requested - udd_ctrl_prev_payload_buf_cnt = 0; - udd_ctrl_payload_buf_cnt = 0; - udd_ep_control_state = UDD_EPCTRL_DATA_IN; - udd_ctrl_in_sent(); // Send first data transfer - } else { - if (0 == udd_g_ctrlreq.req.wLength) { - // No data phase requested - // Send IN ZLP to ACK setup request - udd_ctrl_send_zlp_in(); - return; - } - // OUT data phase requested - udd_ctrl_prev_payload_buf_cnt = 0; - udd_ctrl_payload_buf_cnt = 0; - udd_ep_control_state = UDD_EPCTRL_DATA_OUT; - // To detect a protocol error, enable nak interrupt on data IN phase - udd_ack_nak_in(0); - flags = cpu_irq_save(); - udd_enable_nak_in_interrupt(0); - cpu_irq_restore(flags); - } -} - - -static void udd_ctrl_in_sent(void) -{ - static bool b_shortpacket = false; - uint16_t nb_remain; - uint8_t i; - uint8_t *ptr_dest, *ptr_src; - irqflags_t flags; - - flags = cpu_irq_save(); - udd_disable_in_send_interrupt(0); - cpu_irq_restore(flags); - - if (UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP == udd_ep_control_state) { - // ZLP on IN is sent, then valid end of setup request - udd_ctrl_endofrequest(); - // Reinitializes control endpoint management - udd_ctrl_init(); - return; - } - Assert(udd_ep_control_state == UDD_EPCTRL_DATA_IN); - - nb_remain = udd_g_ctrlreq.payload_size - udd_ctrl_payload_buf_cnt; - if (0 == nb_remain) { - // All content of current buffer payload are sent - // Update number of total data sending by previous playlaod buffer - udd_ctrl_prev_payload_buf_cnt += udd_ctrl_payload_buf_cnt; - if ((udd_g_ctrlreq.req.wLength == udd_ctrl_prev_payload_buf_cnt) - || b_shortpacket) { - // All data requested are transfered or a short packet has been sent - // then it is the end of data phase. - // Generate an OUT ZLP for handshake phase. - udd_ctrl_send_zlp_out(); - return; - } - // Need of new buffer because the data phase is not complete - if ((!udd_g_ctrlreq.over_under_run) - || (!udd_g_ctrlreq.over_under_run())) { - // Underrun then send zlp on IN - // Here nb_remain=0 and allows to send a IN ZLP - } else { - // A new payload buffer is given - udd_ctrl_payload_buf_cnt = 0; - nb_remain = udd_g_ctrlreq.payload_size; - } - } - // Continue transfer and send next data - if (nb_remain >= USB_DEVICE_EP_CTRL_SIZE) { - nb_remain = USB_DEVICE_EP_CTRL_SIZE; - b_shortpacket = false; - } else { - b_shortpacket = true; - } - // Fill buffer of endpoint control - ptr_dest = (uint8_t *) & udd_get_endpoint_fifo_access(0, 8); - ptr_src = udd_g_ctrlreq.payload + udd_ctrl_payload_buf_cnt; - // Critical section - // Only in case of DATA IN phase abort without USB Reset signal after. - // The IN data don't must be written in endpoint 0 DPRAM during - // a next setup reception in same endpoint 0 DPRAM. - // Thereby, an OUT ZLP reception must check before IN data write - // and if no OUT ZLP is recevied the data must be written quickly (800us) - // before an eventually ZLP OUT and SETUP reception - flags = cpu_irq_save(); - if (Is_udd_out_received(0)) { - // IN DATA phase aborted by OUT ZLP - cpu_irq_restore(flags); - udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP; - return; // Exit of IN DATA phase - } - // Write quickly the IN data - for (i = 0; i < nb_remain; i++) { - *ptr_dest++ = *ptr_src++; - } - udd_ctrl_payload_buf_cnt += nb_remain; - - // Validate and send the data available in the control endpoint buffer - udd_ack_in_send(0); - udd_enable_in_send_interrupt(0); - // In case of abort of DATA IN phase, no need to enable nak OUT interrupt - // because OUT endpoint is already free and ZLP OUT accepted. - cpu_irq_restore(flags); -} - - -static void udd_ctrl_out_received(void) -{ - irqflags_t flags; - uint8_t i; - uint16_t nb_data; - - if (UDD_EPCTRL_DATA_OUT != udd_ep_control_state) { - if ((UDD_EPCTRL_DATA_IN == udd_ep_control_state) - || (UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP == - udd_ep_control_state)) { - // End of SETUP request: - // - Data IN Phase aborted, - // - or last Data IN Phase hidden by ZLP OUT sending quiclky, - // - or ZLP OUT received normaly. - udd_ctrl_endofrequest(); - } else { - // Protocol error during SETUP request - udd_ctrl_stall_data(); - } - // Reinitializes control endpoint management - udd_ctrl_init(); - return; - } - // Read data received during OUT phase - nb_data = udd_byte_count(0); - if (udd_g_ctrlreq.payload_size < (udd_ctrl_payload_buf_cnt + nb_data)) { - // Payload buffer too small - nb_data = udd_g_ctrlreq.payload_size - udd_ctrl_payload_buf_cnt; - } - uint8_t *ptr_src = (uint8_t *) & udd_get_endpoint_fifo_access(0, 8); - uint8_t *ptr_dest = udd_g_ctrlreq.payload + udd_ctrl_payload_buf_cnt; - for (i = 0; i < nb_data; i++) { - *ptr_dest++ = *ptr_src++; - } - udd_ctrl_payload_buf_cnt += nb_data; - - if ((USB_DEVICE_EP_CTRL_SIZE != nb_data) - || (udd_g_ctrlreq.req.wLength <= - (udd_ctrl_prev_payload_buf_cnt + - udd_ctrl_payload_buf_cnt))) { - // End of reception because it is a short packet - // Before send ZLP, call intermediat calback - // in case of data receiv generate a stall - udd_g_ctrlreq.payload_size = udd_ctrl_payload_buf_cnt; - if (NULL != udd_g_ctrlreq.over_under_run) { - if (!udd_g_ctrlreq.over_under_run()) { - // Stall ZLP - udd_ctrl_stall_data(); - // Ack reception of OUT to replace NAK by a STALL - udd_ack_out_received(0); - return; - } - } - // Send IN ZLP to ACK setup request - udd_ack_out_received(0); - udd_ctrl_send_zlp_in(); - return; - } - - if (udd_g_ctrlreq.payload_size == udd_ctrl_payload_buf_cnt) { - // Overrun then request a new payload buffer - if (!udd_g_ctrlreq.over_under_run) { - // No callback availabled to request a new payload buffer - udd_ctrl_stall_data(); - // Ack reception of OUT to replace NAK by a STALL - udd_ack_out_received(0); - return; - } - if (!udd_g_ctrlreq.over_under_run()) { - // No new payload buffer delivered - udd_ctrl_stall_data(); - // Ack reception of OUT to replace NAK by a STALL - udd_ack_out_received(0); - return; - } - // New payload buffer available - // Update number of total data received - udd_ctrl_prev_payload_buf_cnt += udd_ctrl_payload_buf_cnt; - // Reinit reception on payload buffer - udd_ctrl_payload_buf_cnt = 0; - } - // Free buffer of control endpoint to authorize next reception - udd_ack_out_received(0); - // To detect a protocol error, enable nak interrupt on data IN phase - udd_ack_nak_in(0); - flags = cpu_irq_save(); - udd_enable_nak_in_interrupt(0); - cpu_irq_restore(flags); -} - - -static void udd_ctrl_underflow(void) -{ - if (Is_udd_out_received(0)) - return; // Underflow ignored if OUT data is received - - if (UDD_EPCTRL_DATA_OUT == udd_ep_control_state) { - // Host want to stop OUT transaction - // then stop to wait OUT data phase and wait IN ZLP handshake - udd_ctrl_send_zlp_in(); - } else if (UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP == udd_ep_control_state) { - // A OUT handshake is waiting by device, - // but host want extra IN data then stall extra IN data - udd_enable_stall_handshake(0); - } -} - - -static void udd_ctrl_overflow(void) -{ - if (Is_udd_in_send(0)) - return; // Overflow ignored if IN data is received - - // The case of UDD_EPCTRL_DATA_IN is not managed - // because the OUT endpoint is already free and OUT ZLP accepted - - if (UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP == udd_ep_control_state) { - // A IN handshake is waiting by device, - // but host want extra OUT data then stall extra OUT data - udd_enable_stall_handshake(0); - } -} - - -static void udd_ctrl_stall_data(void) -{ - // Stall all packets on IN & OUT control endpoint - udd_ep_control_state = UDD_EPCTRL_STALL_REQ; - udd_enable_stall_handshake(0); -} - - -static void udd_ctrl_send_zlp_in(void) -{ - irqflags_t flags; - - udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP; - - // Validate and send empty IN packet on control endpoint - flags = cpu_irq_save(); - // Send ZLP on IN endpoint - udd_ack_in_send(0); - udd_enable_in_send_interrupt(0); - // To detect a protocol error, enable nak interrupt on data OUT phase - udd_ack_nak_out(0); - udd_enable_nak_out_interrupt(0); - cpu_irq_restore(flags); -} - - -static void udd_ctrl_send_zlp_out(void) -{ - irqflags_t flags; - - udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP; - // No action is necessary to accept OUT ZLP - // because the buffer of control endpoint is already free - - // To detect a protocol error, enable nak interrupt on data IN phase - flags = cpu_irq_save(); - udd_ack_nak_in(0); - udd_enable_nak_in_interrupt(0); - cpu_irq_restore(flags); -} - - -static void udd_ctrl_endofrequest(void) -{ - // If a callback is registered then call it - if (udd_g_ctrlreq.callback) { - udd_g_ctrlreq.callback(); - } -} - - -static bool udd_ctrl_interrupt(void) -{ - - if (!Is_udd_endpoint_interrupt(0)) { - return false; // No interrupt events on control endpoint - } - - dbg_print("0: "); - - // By default disable overflow and underflow interrupt - udd_disable_nak_in_interrupt(0); - udd_disable_nak_out_interrupt(0); - - // Search event on control endpoint - if (Is_udd_setup_received(0)) { - dbg_print("stup "); - // SETUP packet received - udd_ctrl_setup_received(); - return true; - } - if (Is_udd_in_send(0) && Is_udd_in_send_interrupt_enabled(0)) { - dbg_print("in "); - // IN packet sent - udd_ctrl_in_sent(); - return true; - } - if (Is_udd_out_received(0)) { - dbg_print("out "); - // OUT packet received - udd_ctrl_out_received(); - return true; - } - if (Is_udd_nak_out(0)) { - dbg_print("nako "); - // Overflow on OUT packet - udd_ack_nak_out(0); - udd_ctrl_overflow(); - return true; - } - if (Is_udd_nak_in(0)) { - dbg_print("naki "); - // Underflow on IN packet - udd_ack_nak_in(0); - udd_ctrl_underflow(); - return true; - } - dbg_print("n%x ", UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], 0)); - return false; -} - - -// ------------------------ -//--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS - -#if (0 != USB_DEVICE_MAX_EP) - -static void udd_ep_job_table_reset(void) -{ - uint8_t i; - for (i = 0; i < USB_DEVICE_MAX_EP; i++) { - udd_ep_job[i].busy = false; - udd_ep_job[i].stall_requested = false; - } -} - - -static void udd_ep_job_table_kill(void) -{ - uint8_t i; - - // For each endpoint, kill job - for (i = 0; i < USB_DEVICE_MAX_EP; i++) { - udd_ep_finish_job(&udd_ep_job[i], true, i + 1); - } -} - - -static void udd_ep_abort_job(udd_ep_id_t ep) -{ - ep &= USB_EP_ADDR_MASK; - - // Abort job on endpoint - udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep); -} - - -static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num) -{ - if (ptr_job->busy == false) { - return; // No on-going job - } - dbg_print("(JobE%x:%d) ", (ptr_job-udd_ep_job)+1, b_abort); - ptr_job->busy = false; - if (NULL == ptr_job->call_trans) { - return; // No callback linked to job - } - if (Is_udd_endpoint_in(ep_num)) { - ep_num |= USB_EP_DIR_IN; - } - ptr_job->call_trans((b_abort) ? UDD_EP_TRANSFER_ABORT : - UDD_EP_TRANSFER_OK, ptr_job->buf_size, ep_num); -} - -#ifdef UDD_EP_DMA_SUPPORTED -static void udd_ep_trans_done(udd_ep_id_t ep) -{ - uint32_t udd_dma_ctrl = 0; - udd_ep_job_t *ptr_job; - iram_size_t next_trans; - irqflags_t flags; - - // Get job corresponding at endpoint - ptr_job = &udd_ep_job[ep - 1]; - - if (!ptr_job->busy) { - return; // No job is running, then ignore it (system error) - } - - if (ptr_job->buf_cnt != ptr_job->buf_size) { - // Need to send or receiv other data - next_trans = ptr_job->buf_size - ptr_job->buf_cnt; - - if (UDD_ENDPOINT_MAX_TRANS < next_trans) { - // The USB hardware support a maximum - // transfer size of UDD_ENDPOINT_MAX_TRANS Bytes - next_trans = UDD_ENDPOINT_MAX_TRANS; - - // Set 0 to tranfer the maximum - udd_dma_ctrl = UOTGHS_DEVDMACONTROL_BUFF_LENGTH(0); - } else { - udd_dma_ctrl = UOTGHS_DEVDMACONTROL_BUFF_LENGTH(next_trans); - } - if (Is_udd_endpoint_in(ep)) { - if (0 != (next_trans % udd_get_endpoint_size(ep))) { - // Enable short packet option - // else the DMA transfer is accepted - // and interrupt DMA valid but nothing is sent. - udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_B_EN; - // No need to request another ZLP - ptr_job->b_shortpacket = false; - } - } else { - if ((USB_EP_TYPE_ISOCHRONOUS != udd_get_endpoint_type(ep)) - || (next_trans <= (iram_size_t) udd_get_endpoint_size(ep))) { - - // Enable short packet reception - udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_TR_IT - | UOTGHS_DEVDMACONTROL_END_TR_EN; - } - } - - // Start USB DMA to fill or read fifo of the selected endpoint - udd_endpoint_dma_set_addr(ep, (uint32_t) & ptr_job->buf[ptr_job->buf_cnt]); - udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT | - UOTGHS_DEVDMACONTROL_CHANN_ENB; - - - // Disable IRQs to have a short sequence - // between read of EOT_STA and DMA enable - flags = cpu_irq_save(); - if (!(udd_endpoint_dma_get_status(ep) - & UOTGHS_DEVDMASTATUS_END_TR_ST)) { - dbg_print("dmaS%x ", ep); - udd_endpoint_dma_set_control(ep, udd_dma_ctrl); - ptr_job->buf_cnt += next_trans; - ptr_job->buf_load = next_trans; - udd_enable_endpoint_dma_interrupt(ep); - cpu_irq_restore(flags); - return; - } - cpu_irq_restore(flags); - - // Here a ZLP has been recieved - // and the DMA transfer must be not started. - // It is the end of transfer - ptr_job->buf_size = ptr_job->buf_cnt; - } - if (Is_udd_endpoint_in(ep)) { - if (ptr_job->b_shortpacket) { - dbg_print("zlpS%x ", ep); - // Need to send a ZLP (No possible with USB DMA) - // enable interrupt to wait a free bank to sent ZLP - udd_ack_in_send(ep); - if (Is_udd_write_enabled(ep)) { - // Force interrupt in case of ep already free - udd_raise_in_send(ep); - } - udd_enable_in_send_interrupt(ep); - udd_enable_endpoint_interrupt(ep); - return; - } - } - dbg_print("dmaE "); - // Call callback to signal end of transfer - udd_ep_finish_job(ptr_job, false, ep); -} -#endif - -#ifdef UDD_EP_FIFO_SUPPORTED -static void udd_ep_in_sent(udd_ep_id_t ep) -{ - udd_ep_job_t *ptr_job = &udd_ep_job[ep - 1]; - uint8_t *ptr_src = &ptr_job->buf[ptr_job->buf_cnt]; - uint8_t *ptr_dst = (uint8_t *) & udd_get_endpoint_fifo_access(ep, 8); - uint32_t pkt_size = udd_get_endpoint_size(ep); - uint32_t nb_data = 0, i; - uint32_t nb_remain; - irqflags_t flags; - - // All transfer done, including ZLP, Finish Job - if (ptr_job->buf_cnt >= ptr_job->buf_size && !ptr_job->b_shortpacket) { - flags = cpu_irq_save(); - udd_disable_in_send_interrupt(ep); - udd_disable_endpoint_interrupt(ep); - cpu_irq_restore(flags); - - ptr_job->buf_size = ptr_job->buf_cnt; // buf_size is passed to callback as XFR count - udd_ep_finish_job(ptr_job, false, ep); - return; - } else { - // ACK TXINI - udd_ack_in_send(ep); - // Fill FIFO - ptr_dst = (uint8_t *) & udd_get_endpoint_fifo_access(ep, 8); - ptr_src = &ptr_job->buf[ptr_job->buf_cnt]; - nb_remain = ptr_job->buf_size - ptr_job->buf_cnt; - // Fill a bank even if no data (ZLP) - nb_data = min(nb_remain, pkt_size); - // Modify job information - ptr_job->buf_cnt += nb_data; - ptr_job->buf_load = nb_data; - - // Copy buffer to FIFO - for (i = 0; i < nb_data; i++) { - *ptr_dst++ = *ptr_src++; - } - // Switch to next bank - udd_ack_fifocon(ep); - // ZLP? - if (nb_data < pkt_size) { - ptr_job->b_shortpacket = false; - } - } -} - -static void udd_ep_out_received(udd_ep_id_t ep) -{ - udd_ep_job_t *ptr_job = &udd_ep_job[ep - 1]; - uint32_t nb_data = 0, i; - uint32_t nb_remain = ptr_job->buf_size - ptr_job->buf_cnt; - uint32_t pkt_size = udd_get_endpoint_size(ep); - uint8_t *ptr_src = (uint8_t *) & udd_get_endpoint_fifo_access(ep, 8); - uint8_t *ptr_dst = &ptr_job->buf[ptr_job->buf_cnt]; - bool b_full = false, b_short = false; - - // Clear RX OUT - udd_ack_out_received(ep); - - // Read byte count - nb_data = udd_byte_count(ep); - if (nb_data < pkt_size) { - b_short = true; - } - //dbg_print("o%d ", ep); - //dbg_print("%d ", nb_data); - // Copy data if there is - if (nb_data > 0) { - if (nb_data >= nb_remain) { - nb_data = nb_remain; - b_full = true; - } - // Modify job information - ptr_job->buf_cnt += nb_data; - ptr_job->buf_load = nb_data; - // Copy FIFO to buffer - for (i = 0; i < nb_data; i++) { - *ptr_dst++ = *ptr_src++; - } - } - // Clear FIFO Status - udd_ack_fifocon(ep); - // Finish job on error or short packet - if (b_full || b_short) { - //dbg_print("EoO%d\n\r", ep); - udd_disable_out_received_interrupt(ep); - udd_disable_endpoint_interrupt(ep); - ptr_job->buf_size = ptr_job->buf_cnt; // buf_size is passed to callback as XFR count - udd_ep_finish_job(ptr_job, false, ep); - } -} -#endif // #ifdef UDD_EP_FIFO_SUPPORTED - -static bool udd_ep_interrupt(void) -{ - udd_ep_id_t ep; - udd_ep_job_t *ptr_job; - - // For each endpoint different of control endpoint (0) - for (ep = 1; ep <= USB_DEVICE_MAX_EP; ep++) { - // Get job corresponding at endpoint - ptr_job = &udd_ep_job[ep - 1]; - -#ifdef UDD_EP_DMA_SUPPORTED - // Check DMA event - if (Is_udd_endpoint_dma_interrupt_enabled(ep) - && Is_udd_endpoint_dma_interrupt(ep)) { - uint32_t nb_remaining; - if (udd_endpoint_dma_get_status(ep) - & UOTGHS_DEVDMASTATUS_CHANN_ENB) { - return true; // Ignore EOT_STA interrupt - } - dbg_print("dma%x: ", ep); - udd_disable_endpoint_dma_interrupt(ep); - // Save number of data no transfered - nb_remaining = (udd_endpoint_dma_get_status(ep) & - UOTGHS_DEVDMASTATUS_BUFF_COUNT_Msk) - >> UOTGHS_DEVDMASTATUS_BUFF_COUNT_Pos; - if (nb_remaining) { - // Transfer no complete (short packet or ZLP) then: - // Update number of data transfered - ptr_job->buf_cnt -= nb_remaining; - // Set transfer complete to stop the transfer - ptr_job->buf_size = ptr_job->buf_cnt; - } - udd_ep_trans_done(ep); - return true; - } -#endif -#ifdef UDD_EP_FIFO_SUPPORTED - // Check RXRDY and TXEMPTY event for none DMA endpoints - if (!Is_udd_endpoint_dma_supported(ep) - && Is_udd_endpoint_interrupt_enabled(ep)) { - dbg_print("ep%x: ", ep); - // RXOUT: Full packet received - if (Is_udd_out_received(ep) - && Is_udd_out_received_interrupt_enabled(ep)) { - dbg_print("Out "); - udd_ep_out_received(ep); - return true; - } - // TXIN: packet sent - if (Is_udd_in_send(ep) - && Is_udd_in_send_interrupt_enabled(ep)) { - dbg_print("In "); - udd_ep_in_sent(ep); - return true; - } - // Errors: Abort? - if (Is_udd_overflow(ep) - || Is_udd_underflow(ep) - || Is_udd_crc_error(ep)) { - dbg_print("Err "); - udd_ep_abort(ep); - return true; - } - } -#endif // UDD_EP_FIFO_SUPPORTED - // Check empty bank interrupt event - if (Is_udd_endpoint_interrupt_enabled(ep)) { - dbg_print("bg%x: ", ep); - if (Is_udd_in_send_interrupt_enabled(ep) - && Is_udd_in_send(ep)) { - dbg_print("I "); - udd_disable_in_send_interrupt(ep); - // One bank is free then send a ZLP - udd_ack_in_send(ep); - udd_ack_fifocon(ep); - udd_ep_finish_job(ptr_job, false, ep); - return true; - } - if (Is_udd_bank_interrupt_enabled(ep) - && (0 == udd_nb_busy_bank(ep))) { - dbg_print("EoT "); - // End of background transfer on IN endpoint - udd_disable_bank_interrupt(ep); - udd_disable_endpoint_interrupt(ep); - - Assert(ptr_job->stall_requested); - // A stall has been requested during backgound transfer - ptr_job->stall_requested = false; - udd_disable_endpoint_bank_autoswitch(ep); - udd_enable_stall_handshake(ep); - udd_reset_data_toggle(ep); - return true; - } - } - } - return false; -} -#endif // (0 != USB_DEVICE_MAX_EP) - -//@} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h deleted file mode 100644 index 97877994bf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h +++ /dev/null @@ -1,664 +0,0 @@ -/** - * \file - * - * \brief USB Device Driver for UOTGHS. Compliant with common UDD driver. - * - * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef UOTGHS_DEVICE_DUE_H_INCLUDED -#define UOTGHS_DEVICE_DUE_H_INCLUDED - -//#include "compiler.h" - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/// @endcond - -//! \ingroup udd_group -//! \defgroup udd_udphs_group USB On-The-Go High-Speed Port for device mode (UOTGHS) -//! UOTGHS low-level driver for USB device mode -//! -//! @{ - -#ifndef UOTGHS_DEVEPTCFG_EPDIR_Pos -// Bit pos is not defined in SAM header file but we need it. -# define UOTGHS_DEVEPTCFG_EPDIR_Pos 8 -#endif - -//! @name UOTGHS Device IP properties -//! These macros give access to IP properties -//! @{ - //! Get maximal number of endpoints -#define udd_get_endpoint_max_nbr() (9) -#define UDD_MAX_PEP_NB (udd_get_endpoint_max_nbr() + 1) - //! Get maximal number of banks of endpoints -#define udd_get_endpoint_bank_max_nbr(ep) ((ep == 0) ? 1 : (( ep <= 2) ? 3 : 2)) - //! Get maximal size of endpoint (3X, 1024/64) -#define udd_get_endpoint_size_max(ep) (((ep) == 0) ? 64 : 1024) - //! Get DMA support of endpoints -#define Is_udd_endpoint_dma_supported(ep) ((((ep) >= 1) && ((ep) <= 6)) ? true : false) - //! Get High Band Width support of endpoints -#define Is_udd_endpoint_high_bw_supported(ep) (((ep) >= 2) ? true : false) -//! @} - -//! @name UOTGHS Device speeds management -//! @{ - //! Enable/disable device low-speed mode -#define udd_low_speed_enable() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_LS)) -#define udd_low_speed_disable() (Clr_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_LS)) - //! Test if device low-speed mode is forced -#define Is_udd_low_speed_enable() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_LS)) - -#ifdef UOTGHS_DEVCTRL_SPDCONF_HIGH_SPEED - //! Enable high speed mode -# define udd_high_speed_enable() (Wr_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_SPDCONF_Msk, 0)) - //! Disable high speed mode -# define udd_high_speed_disable() (Wr_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_SPDCONF_Msk, 3)) - //! Test if controller is in full speed mode -# define Is_udd_full_speed_mode() (Rd_bitfield(UOTGHS->UOTGHS_SR, UOTGHS_SR_SPEED_Msk) == UOTGHS_SR_SPEED_FULL_SPEED) -#else -# define udd_high_speed_enable() do { } while (0) -# define udd_high_speed_disable() do { } while (0) -# define Is_udd_full_speed_mode() true -#endif -//! @} - -//! @name UOTGHS Device HS test mode management -//! @{ -#ifdef UOTGHS_DEVCTRL_SPDCONF_HIGH_SPEED - //! Enable high speed test mode -# define udd_enable_hs_test_mode() (Wr_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_SPDCONF_Msk, 2)) -# define udd_enable_hs_test_mode_j() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_TSTJ)) -# define udd_enable_hs_test_mode_k() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_TSTK)) -# define udd_enable_hs_test_mode_packet() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_TSTPCKT)) -#endif -//! @} - -//! @name UOTGHS Device vbus management -//! @{ -#define udd_enable_vbus_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define udd_disable_vbus_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define Is_udd_vbus_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define Is_udd_vbus_high() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUS)) -#define Is_udd_vbus_low() (!Is_udd_vbus_high()) -#define udd_ack_vbus_transition() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_VBUSTIC) -#define udd_raise_vbus_transition() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_VBUSTIS) -#define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI)) -//! @} - - -//! @name UOTGHS device attach control -//! These macros manage the UOTGHS Device attach. -//! @{ - //! Detaches from USB bus -#define udd_detach_device() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH)) - //! Attaches to USB bus -#define udd_attach_device() (Clr_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH)) - //! Test if the device is detached -#define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH)) -//! @} - - -//! @name UOTGHS device bus events control -//! These macros manage the UOTGHS Device bus events. -//! @{ - -//! Initiates a remote wake-up event -//! @{ -#define udd_initiate_remote_wake_up() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_RMWKUP)) -#define Is_udd_pending_remote_wake_up() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_RMWKUP)) -//! @} - -//! Manage upstream resume event (=remote wakeup) -//! The USB driver sends a resume signal called "Upstream Resume" -//! @{ -#define udd_enable_remote_wake_up_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_UPRSMES) -#define udd_disable_remote_wake_up_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_UPRSMEC) -#define Is_udd_remote_wake_up_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_UPRSME)) -#define udd_ack_remote_wake_up_start() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_UPRSMC) -#define udd_raise_remote_wake_up_start() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_UPRSMS) -#define Is_udd_remote_wake_up_start() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_UPRSM)) -//! @} - -//! Manage downstream resume event (=remote wakeup from host) -//! The USB controller detects a valid "End of Resume" signal initiated by the host -//! @{ -#define udd_enable_resume_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_EORSMES) -#define udd_disable_resume_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_EORSMEC) -#define Is_udd_resume_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_EORSME)) -#define udd_ack_resume() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_EORSMC) -#define udd_raise_resume() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_EORSMS) -#define Is_udd_resume() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_EORSM)) -//! @} - -//! Manage wake-up event (=usb line activity) -//! The USB controller is reactivated by a filtered non-idle signal from the lines -//! @{ -#define udd_enable_wake_up_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_WAKEUPES) -#define udd_disable_wake_up_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_WAKEUPEC) -#define Is_udd_wake_up_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_WAKEUPE)) -#define udd_ack_wake_up() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_WAKEUPC) -#define udd_raise_wake_up() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_WAKEUPS) -#define Is_udd_wake_up() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_WAKEUP)) -//! @} - -//! Manage reset event -//! Set when a USB "End of Reset" has been detected -//! @{ -#define udd_enable_reset_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_EORSTES) -#define udd_disable_reset_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_EORSTEC) -#define Is_udd_reset_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_EORSTE)) -#define udd_ack_reset() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_EORSTC) -#define udd_raise_reset() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_EORSTS) -#define Is_udd_reset() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_EORST)) -//! @} - -//! Manage start of frame event -//! @{ -#define udd_enable_sof_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_SOFES) -#define udd_disable_sof_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_SOFEC) -#define Is_udd_sof_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_SOFE)) -#define udd_ack_sof() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_SOFC) -#define udd_raise_sof() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_SOFS) -#define Is_udd_sof() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_SOF)) -#define udd_frame_number() (Rd_bitfield(UOTGHS->UOTGHS_DEVFNUM, UOTGHS_DEVFNUM_FNUM_Msk)) -#define Is_udd_frame_number_crc_error() (Tst_bits(UOTGHS->UOTGHS_DEVFNUM, UOTGHS_DEVFNUM_FNCERR)) -//! @} - -//! Manage Micro start of frame event (High Speed Only) -//! @{ -#define udd_enable_msof_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_MSOFES) -#define udd_disable_msof_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_MSOFEC) -#define Is_udd_msof_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_MSOFE)) -#define udd_ack_msof() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVIMR_MSOFE) -#define udd_raise_msof() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_MSOFS) -#define Is_udd_msof() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_MSOF)) -#define udd_micro_frame_number() \ - (Rd_bitfield(UOTGHS->UOTGHS_DEVFNUM, (UOTGHS_DEVFNUM_FNUM_Msk|UOTGHS_DEVFNUM_MFNUM_Msk))) -//! @} - -//! Manage suspend event -//! @{ -#define udd_enable_suspend_interrupt() (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_SUSPES) -#define udd_disable_suspend_interrupt() (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_SUSPEC) -#define Is_udd_suspend_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_SUSPE)) -#define udd_ack_suspend() (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVICR_SUSPC) -#define udd_raise_suspend() (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_SUSPS) -#define Is_udd_suspend() (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_SUSP)) -//! @} - -//! @} - -//! @name UOTGHS device address control -//! These macros manage the UOTGHS Device address. -//! @{ - //! enables USB device address -#define udd_enable_address() (Set_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_ADDEN)) - //! disables USB device address -#define udd_disable_address() (Clr_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_ADDEN)) -#define Is_udd_address_enabled() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_ADDEN)) - //! configures the USB device address -#define udd_configure_address(addr) (Wr_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk, addr)) - //! gets the currently configured USB device address -#define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk)) -//! @} - - -//! @name UOTGHS Device endpoint drivers -//! These macros manage the common features of the endpoints. -//! @{ - -//! Generic macro for UOTGHS registers that can be arrayed -//! @{ -#define UOTGHS_ARRAY(reg,index) ((&(UOTGHS->reg))[(index)]) -//! @} - -//! @name UOTGHS Device endpoint configuration -//! @{ - //! enables the selected endpoint -#define udd_enable_endpoint(ep) (Set_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPEN0 << (ep))) - //! disables the selected endpoint -#define udd_disable_endpoint(ep) (Clr_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPEN0 << (ep))) - //! tests if the selected endpoint is enabled -#define Is_udd_endpoint_enabled(ep) (Tst_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPEN0 << (ep))) - //! resets the selected endpoint -#define udd_reset_endpoint(ep) \ - do { \ - Set_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \ - Clr_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \ - } while (0) - //! Tests if the selected endpoint is being reset -#define Is_udd_resetting_endpoint(ep) (Tst_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep))) - - //! Configures the selected endpoint type -#define udd_configure_endpoint_type(ep, type) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPTYPE_Msk, type)) - //! Gets the configured selected endpoint type -#define udd_get_endpoint_type(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPTYPE_Msk)) - //! Enables the bank autoswitch for the selected endpoint -#define udd_enable_endpoint_bank_autoswitch(ep) (Set_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_AUTOSW)) - //! Disables the bank autoswitch for the selected endpoint -#define udd_disable_endpoint_bank_autoswitch(ep) (Clr_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_AUTOSW)) -#define Is_udd_endpoint_bank_autoswitch_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_AUTOSW)) - //! Configures the selected endpoint direction -#define udd_configure_endpoint_direction(ep, dir) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPDIR, dir)) - //! Gets the configured selected endpoint direction -#define udd_get_endpoint_direction(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPDIR)) -#define Is_udd_endpoint_in(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPDIR)) - //! Bounds given integer size to allowed range and rounds it up to the nearest - //! available greater size, then applies register format of UOTGHS controller - //! for endpoint size bit-field. -#undef udd_format_endpoint_size -#define udd_format_endpoint_size(size) (32 - clz(((uint32_t)min(max(size, 8), 1024) << 1) - 1) - 1 - 3) - //! Configures the selected endpoint size -#define udd_configure_endpoint_size(ep, size) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPSIZE_Msk, udd_format_endpoint_size(size))) - //! Gets the configured selected endpoint size -#define udd_get_endpoint_size(ep) (8 << Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPSIZE_Msk)) - //! Configures the selected endpoint number of banks -#define udd_configure_endpoint_bank(ep, bank) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPBK_Msk, bank)) - //! Gets the configured selected endpoint number of banks -#define udd_get_endpoint_bank(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPBK_Msk)+1) - //! Allocates the configuration selected endpoint in DPRAM memory -#define udd_allocate_memory(ep) (Set_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_ALLOC)) - //! un-allocates the configuration selected endpoint in DPRAM memory -#define udd_unallocate_memory(ep) (Clr_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_ALLOC)) -#define Is_udd_memory_allocated(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_ALLOC)) - - //! Configures selected endpoint in one step -#define udd_configure_endpoint(ep, type, dir, size, bank) (\ - Wr_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPTYPE_Msk |\ - UOTGHS_DEVEPTCFG_EPDIR |\ - UOTGHS_DEVEPTCFG_EPSIZE_Msk |\ - UOTGHS_DEVEPTCFG_EPBK_Msk , \ - (((uint32_t)(type) << UOTGHS_DEVEPTCFG_EPTYPE_Pos) & UOTGHS_DEVEPTCFG_EPTYPE_Msk) |\ - (((uint32_t)(dir ) << UOTGHS_DEVEPTCFG_EPDIR_Pos ) & UOTGHS_DEVEPTCFG_EPDIR) |\ - ( (uint32_t)udd_format_endpoint_size(size) << UOTGHS_DEVEPTCFG_EPSIZE_Pos) |\ - (((uint32_t)(bank) << UOTGHS_DEVEPTCFG_EPBK_Pos) & UOTGHS_DEVEPTCFG_EPBK_Msk))\ -) - //! Tests if current endpoint is configured -#define Is_udd_endpoint_configured(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_CFGOK)) - //! Returns the control direction -#define udd_control_direction() (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], EP_CONTROL), UOTGHS_DEVEPTISR_CTRLDIR)) - - //! Resets the data toggle sequence -#define udd_reset_data_toggle(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_RSTDTS) - //! Tests if the data toggle sequence is being reset -#define Is_udd_data_toggle_reset(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_RSTDT)) - //! Returns data toggle -#define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk)) -//! @} - - -//! @name UOTGHS Device control endpoint -//! These macros control the endpoints. -//! @{ - -//! @name UOTGHS Device control endpoint interrupts -//! These macros control the endpoints interrupts. -//! @{ - //! Enables the selected endpoint interrupt -#define udd_enable_endpoint_interrupt(ep) (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_PEP_0 << (ep)) - //! Disables the selected endpoint interrupt -#define udd_disable_endpoint_interrupt(ep) (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_PEP_0 << (ep)) - //! Tests if the selected endpoint interrupt is enabled -#define Is_udd_endpoint_interrupt_enabled(ep) (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_PEP_0 << (ep))) - //! Tests if an interrupt is triggered by the selected endpoint -#define Is_udd_endpoint_interrupt(ep) (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_PEP_0 << (ep))) - //! Returns the lowest endpoint number generating an endpoint interrupt or MAX_PEP_NB if none -#define udd_get_interrupt_endpoint_number() (ctz(((UOTGHS->UOTGHS_DEVISR >> UOTGHS_DEVISR_PEP_Pos) & \ - (UOTGHS->UOTGHS_DEVIMR >> UOTGHS_DEVIMR_PEP_Pos)) | \ - (1 << MAX_PEP_NB))) -#define UOTGHS_DEVISR_PEP_Pos 12 -#define UOTGHS_DEVIMR_PEP_Pos 12 -//! @} - -//! @name UOTGHS Device control endpoint errors -//! These macros control the endpoint errors. -//! @{ - //! Enables the STALL handshake -#define udd_enable_stall_handshake(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_STALLRQS) - //! Disables the STALL handshake -#define udd_disable_stall_handshake(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_STALLRQC) - //! Tests if STALL handshake request is running -#define Is_udd_endpoint_stall_requested(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_STALLRQ)) - //! Tests if STALL sent -#define Is_udd_stall(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_STALLEDI)) - //! ACKs STALL sent -#define udd_ack_stall(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_STALLEDIC) - //! Raises STALL sent -#define udd_raise_stall(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_STALLEDIS) - //! Enables STALL sent interrupt -#define udd_enable_stall_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_STALLEDES) - //! Disables STALL sent interrupt -#define udd_disable_stall_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_STALLEDEC) - //! Tests if STALL sent interrupt is enabled -#define Is_udd_stall_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_STALLEDE)) - - //! Tests if NAK OUT received -#define Is_udd_nak_out(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_NAKOUTI)) - //! ACKs NAK OUT received -#define udd_ack_nak_out(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_NAKOUTIC) - //! Raises NAK OUT received -#define udd_raise_nak_out(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_NAKOUTIS) - //! Enables NAK OUT interrupt -#define udd_enable_nak_out_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_NAKOUTES) - //! Disables NAK OUT interrupt -#define udd_disable_nak_out_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_NAKOUTEC) - //! Tests if NAK OUT interrupt is enabled -#define Is_udd_nak_out_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_NAKOUTE)) - - //! Tests if NAK IN received -#define Is_udd_nak_in(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_NAKINI)) - //! ACKs NAK IN received -#define udd_ack_nak_in(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_NAKINIC) - //! Raises NAK IN received -#define udd_raise_nak_in(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_NAKINIS) - //! Enables NAK IN interrupt -#define udd_enable_nak_in_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_NAKINES) - //! Disables NAK IN interrupt -#define udd_disable_nak_in_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_NAKINEC) - //! Tests if NAK IN interrupt is enabled -#define Is_udd_nak_in_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_NAKINE)) - - //! ACKs endpoint isochronous overflow interrupt -#define udd_ack_overflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_OVERFIC) - //! Raises endpoint isochronous overflow interrupt -#define udd_raise_overflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_OVERFIS) - //! Tests if an overflow occurs -#define Is_udd_overflow(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_OVERFI)) - //! Enables overflow interrupt -#define udd_enable_overflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_OVERFES) - //! Disables overflow interrupt -#define udd_disable_overflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_OVERFEC) - //! Tests if overflow interrupt is enabled -#define Is_udd_overflow_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_OVERFE)) - - //! ACKs endpoint isochronous underflow interrupt -#define udd_ack_underflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_UNDERFIC) - //! Raises endpoint isochronous underflow interrupt -#define udd_raise_underflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_UNDERFIS) - //! Tests if an underflow occurs -#define Is_udd_underflow(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_UNDERFI)) - //! Enables underflow interrupt -#define udd_enable_underflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_UNDERFES) - //! Disables underflow interrupt -#define udd_disable_underflow_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_UNDERFEC) - //! Tests if underflow interrupt is enabled -#define Is_udd_underflow_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_UNDERFE)) - - //! Tests if CRC ERROR ISO OUT detected -#define Is_udd_crc_error(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_CRCERRI)) - //! ACKs CRC ERROR ISO OUT detected -#define udd_ack_crc_error(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_CRCERRIC) - //! Raises CRC ERROR ISO OUT detected -#define udd_raise_crc_error(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_CRCERRIS) - //! Enables CRC ERROR ISO OUT detected interrupt -#define udd_enable_crc_error_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_CRCERRES) - //! Disables CRC ERROR ISO OUT detected interrupt -#define udd_disable_crc_error_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_CRCERREC) - //! Tests if CRC ERROR ISO OUT detected interrupt is enabled -#define Is_udd_crc_error_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_CRCERRE)) -//! @} - -//! @name UOTGHS Device control endpoint transfer -//! These macros control the endpoint transfer. -//! @{ - - //! Tests if endpoint read allowed -#define Is_udd_read_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_RWALL)) - //! Tests if endpoint write allowed -#define Is_udd_write_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_RWALL)) - - //! Returns the byte count -#define udd_byte_count(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_BYCT_Msk)) - //! Clears FIFOCON bit -#define udd_ack_fifocon(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_FIFOCONC) - //! Tests if FIFOCON bit set -#define Is_udd_fifocon(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_FIFOCON)) - - //! Returns the number of busy banks -#define udd_nb_busy_bank(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_NBUSYBK_Msk)) - //! Returns the number of the current bank -#define udd_current_bank(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_CURRBK_Msk)) - //! Kills last bank -#define udd_kill_last_in_bank(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_KILLBKS) -#define Is_udd_kill_last(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_KILLBK)) - //! Tests if last bank killed -#define Is_udd_last_in_bank_killed(ep) (!Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_KILLBK)) - //! Forces all banks full (OUT) or free (IN) interrupt -#define udd_force_bank_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_NBUSYBKS) - //! Unforces all banks full (OUT) or free (IN) interrupt -#define udd_unforce_bank_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_NBUSYBKS) - //! Enables all banks full (OUT) or free (IN) interrupt -#define udd_enable_bank_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_NBUSYBKES) - //! Disables all banks full (OUT) or free (IN) interrupt -#define udd_disable_bank_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_NBUSYBKEC) - //! Tests if all banks full (OUT) or free (IN) interrupt enabled -#define Is_udd_bank_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_NBUSYBKE)) - - //! Tests if SHORT PACKET received -#define Is_udd_short_packet(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_SHORTPACKET)) - //! ACKs SHORT PACKET received -#define udd_ack_short_packet(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_SHORTPACKETC) - //! Raises SHORT PACKET received -#define udd_raise_short_packet(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_SHORTPACKETS) - //! Enables SHORT PACKET received interrupt -#define udd_enable_short_packet_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_SHORTPACKETES) - //! Disables SHORT PACKET received interrupt -#define udd_disable_short_packet_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_SHORTPACKETEC) - //! Tests if SHORT PACKET received interrupt is enabled -#define Is_udd_short_packet_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_SHORTPACKETE)) - - //! Tests if SETUP received -#define Is_udd_setup_received(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_RXSTPI)) - //! ACKs SETUP received -#define udd_ack_setup_received(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_RXSTPIC) - //! Raises SETUP received -#define udd_raise_setup_received(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_RXSTPIS) - //! Enables SETUP received interrupt -#define udd_enable_setup_received_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_RXSTPES) - //! Disables SETUP received interrupt -#define udd_disable_setup_received_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_RXSTPEC) - //! Tests if SETUP received interrupt is enabled -#define Is_udd_setup_received_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_RXSTPE)) - - //! Tests if OUT received -#define Is_udd_out_received(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_RXOUTI)) - //! ACKs OUT received -#define udd_ack_out_received(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_RXOUTIC) - //! Raises OUT received -#define udd_raise_out_received(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_RXOUTIS) - //! Enables OUT received interrupt -#define udd_enable_out_received_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_RXOUTES) - //! Disables OUT received interrupt -#define udd_disable_out_received_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_RXOUTEC) - //! Tests if OUT received interrupt is enabled -#define Is_udd_out_received_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_RXOUTE)) - - //! Tests if IN sending -#define Is_udd_in_send(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_TXINI)) - //! ACKs IN sending -#define udd_ack_in_send(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTICR[0], ep) = UOTGHS_DEVEPTICR_TXINIC) - //! Raises IN sending -#define udd_raise_in_send(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIFR[0], ep) = UOTGHS_DEVEPTIFR_TXINIS) - //! Enables IN sending interrupt -#define udd_enable_in_send_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0], ep) = UOTGHS_DEVEPTIER_TXINES) - //! Disables IN sending interrupt -#define udd_disable_in_send_interrupt(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0], ep) = UOTGHS_DEVEPTIDR_TXINEC) - //! Tests if IN sending interrupt is enabled -#define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE)) - - - //! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint. - //! @param ep Endpoint of which to access FIFO data register - //! @param scale Data scale in bits: 64, 32, 16 or 8 - //! @return Volatile 64-, 32-, 16- or 8-bit data pointer to FIFO data register - //! @warning It is up to the user of this macro to make sure that all accesses - //! are aligned with their natural boundaries except 64-bit accesses which - //! require only 32-bit alignment. - //! @warning It is up to the user of this macro to make sure that used HSB - //! addresses are identical to the DPRAM internal pointer modulo 32 bits. -#define udd_get_endpoint_fifo_access(ep, scale) \ - (((volatile TPASTE2(U, scale) (*)[0x8000 / ((scale) / 8)])UOTGHS_RAM_ADDR)[(ep)]) - -//! @name UOTGHS endpoint DMA drivers -//! These macros manage the common features of the endpoint DMA channels. -//! @{ - - //! Maximum transfer size on USB DMA -#define UDD_ENDPOINT_MAX_TRANS 0x10000 - //! Enables the disabling of HDMA requests by endpoint interrupts -#define udd_enable_endpoint_int_dis_hdma_req(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIER[0](ep) = UOTGHS_DEVEPTIER_EPDISHDMAS) - //! Disables the disabling of HDMA requests by endpoint interrupts -#define udd_disable_endpoint_int_dis_hdma_req(ep) (UOTGHS_ARRAY(UOTGHS_DEVEPTIDR[0](ep) = UOTGHS_DEVEPTIDR_EPDISHDMAC) - //! Tests if the disabling of HDMA requests by endpoint interrupts is enabled -#define Is_udd_endpoint_int_dis_hdma_req_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0](ep), UOTGHS_DEVEPTIMR_EPDISHDMA)) - - //! Raises the selected endpoint DMA channel interrupt -#define udd_raise_endpoint_dma_interrupt(ep) (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_DMA_1 << ((ep) - 1)) - //! Raises the selected endpoint DMA channel interrupt -#define udd_clear_endpoint_dma_interrupt(ep) (UOTGHS->UOTGHS_DEVICR = UOTGHS_DEVISR_DMA_1 << ((ep) - 1)) - //! Tests if an interrupt is triggered by the selected endpoint DMA channel -#define Is_udd_endpoint_dma_interrupt(ep) (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_DMA_1 << ((ep) - 1))) - //! Enables the selected endpoint DMA channel interrupt -#define udd_enable_endpoint_dma_interrupt(ep) (UOTGHS->UOTGHS_DEVIER = UOTGHS_DEVIER_DMA_1 << ((ep) - 1)) - //! Disables the selected endpoint DMA channel interrupt -#define udd_disable_endpoint_dma_interrupt(ep) (UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_DMA_1 << ((ep) - 1)) - //! Tests if the selected endpoint DMA channel interrupt is enabled -#define Is_udd_endpoint_dma_interrupt_enabled(ep) (Tst_bits(UOTGHS->UOTGHS_DEVIMR, UOTGHS_DEVIMR_DMA_1 << ((ep) - 1))) - - //! Access points to the UOTGHS device DMA memory map with arrayed registers - //! @{ - //! Structure for DMA next descriptor register -typedef struct { - uint32_t *NXT_DSC_ADD; -} uotghs_dma_nextdesc_t; - //! Structure for DMA control register -typedef struct { - uint32_t CHANN_ENB:1, - LDNXT_DSC:1, - END_TR_EN:1, - END_B_EN:1, - END_TR_IT:1, - END_BUFFIT:1, - DESC_LD_IT:1, - BUST_LCK:1, - reserved:8, - BUFF_LENGTH:16; -} uotghs_dma_control_t; - //! Structure for DMA status register -typedef struct { - uint32_t CHANN_ENB:1, - CHANN_ACT:1, - reserved0:2, - END_TR_ST:1, - END_BF_ST:1, - DESC_LDST:1, - reserved1:9, - BUFF_COUNT:16; -} uotghs_dma_status_t; - //! Structure for DMA descriptor -typedef struct { - union { - uint32_t nextdesc; - uotghs_dma_nextdesc_t NEXTDESC; - }; - uint32_t addr; - union { - uint32_t control; - uotghs_dma_control_t CONTROL; - }; - uint32_t reserved; -} sam_uotghs_dmadesc_t, uotghs_dmadesc_t; - //! Structure for DMA registers in a channel -typedef struct { - union { - uint32_t nextdesc; - uotghs_dma_nextdesc_t NEXTDESC; - }; - uint32_t addr; - union { - uint32_t control; - uotghs_dma_control_t CONTROL; - }; - union { - unsigned long status; - uotghs_dma_status_t STATUS; - }; -} sam_uotghs_dmach_t, uotghs_dmach_t; - //! DMA channel control command -#define UDD_ENDPOINT_DMA_STOP_NOW (0) -#define UDD_ENDPOINT_DMA_RUN_AND_STOP (UOTGHS_DEVDMACONTROL_CHANN_ENB) -#define UDD_ENDPOINT_DMA_LOAD_NEXT_DESC (UOTGHS_DEVDMACONTROL_LDNXT_DSC) -#define UDD_ENDPOINT_DMA_RUN_AND_LINK (UOTGHS_DEVDMACONTROL_CHANN_ENB|UOTGHS_DEVDMACONTROL_LDNXT_DSC) - //! Structure for DMA registers -#define UOTGHS_UDDMA_ARRAY(ep) (((volatile uotghs_dmach_t *)UOTGHS->UOTGHS_DEVDMA)[(ep) - 1]) - - //! Set control desc to selected endpoint DMA channel -#define udd_endpoint_dma_set_control(ep,desc) (UOTGHS_UDDMA_ARRAY(ep).control = desc) - //! Get control desc to selected endpoint DMA channel -#define udd_endpoint_dma_get_control(ep) (UOTGHS_UDDMA_ARRAY(ep).control) - //! Set RAM address to selected endpoint DMA channel -#define udd_endpoint_dma_set_addr(ep,add) (UOTGHS_UDDMA_ARRAY(ep).addr = add) - //! Get status to selected endpoint DMA channel -#define udd_endpoint_dma_get_status(ep) (UOTGHS_UDDMA_ARRAY(ep).status) - //! @} -//! @} - -//! @} -//! @} -//! @} -//! @} - - -/// @cond 0 -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/// @endcond - -#endif /* UOTGHS_DEVICE_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h deleted file mode 100644 index 86c903b2c1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h +++ /dev/null @@ -1,241 +0,0 @@ -/** - * \file - * - * \brief USB OTG Driver for UOTGHS. - * - * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef UOTGHS_OTG_H_INCLUDED -#define UOTGHS_OTG_H_INCLUDED - -#include "compiler.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -//! \ingroup usb_group -//! \defgroup otg_group UOTGHS OTG Driver -//! UOTGHS low-level driver for OTG features -//! -//! @{ - -/** - * \brief Initialize the dual role - * This function is implemented in uotghs_host.c file. - * - * \return \c true if the ID pin management has been started, otherwise \c false. - */ -bool otg_dual_enable(void); - -/** - * \brief Uninitialize the dual role - * This function is implemented in uotghs_host.c file. - */ -void otg_dual_disable(void); - - -//! @name UOTGHS OTG ID pin management -//! The ID pin come from the USB OTG connector (A and B receptable) and -//! allows to select the USB mode host or device. -//! The UOTGHS hardware can manage it automatically. This feature is optional. -//! When USB_ID_GPIO is defined (in board.h), this feature is enabled. -//! -//! @{ - //! Enable external OTG_ID pin (listened to by USB) -#define otg_enable_id_pin() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) - //! Disable external OTG_ID pin (ignored by USB) -#define otg_disable_id_pin() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) - //! Test if external OTG_ID pin enabled (listened to by USB) -#define Is_otg_id_pin_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) - //! Disable external OTG_ID pin and force device mode -#define otg_force_device_mode() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD), otg_disable_id_pin()) - //! Test if device mode is forced -#define Is_otg_device_mode_forced() (!Is_otg_id_pin_enabled() && Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD)) - //! Disable external OTG_ID pin and force host mode -#define otg_force_host_mode() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD), otg_disable_id_pin()) - //! Test if host mode is forced -#define Is_otg_host_mode_forced() (!Is_otg_id_pin_enabled() && !Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD)) - -//! @name UOTGHS OTG ID pin interrupt management -//! These macros manage the ID pin interrupt -//! @{ -#define otg_enable_id_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) -#define otg_disable_id_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) -#define Is_otg_id_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) -#define Is_otg_id_device() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_ID)) -#define Is_otg_id_host() (!Is_otg_id_device()) -#define otg_ack_id_transition() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_IDTIC) -#define otg_raise_id_transition() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_IDTIS) -#define Is_otg_id_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_IDTI)) -//! @} -//! @} - -//! @name OTG Vbus management -//! @{ -#define otg_enable_vbus_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define otg_disable_vbus_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define Is_otg_vbus_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_VBUSTE)) -#define Is_otg_vbus_high() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUS)) -#define Is_otg_vbus_low() (!Is_otg_vbus_high()) -#define otg_ack_vbus_transition() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_VBUSTIC) -#define otg_raise_vbus_transition() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_VBUSTIS) -#define Is_otg_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI)) -//! @} - -//! @name UOTGHS OTG main management -//! These macros allows to enable/disable pad and UOTGHS hardware -//! @{ - //! Reset USB macro -#define otg_reset() \ - do { \ - UOTGHS->UOTGHS_CTRL = 0; \ - while( UOTGHS->UOTGHS_SR & 0x3FFF) {\ - UOTGHS->UOTGHS_SCR = 0xFFFFFFFF;\ - } \ - } while (0) - //! Enable USB macro -#define otg_enable() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_USBE)) - //! Disable USB macro -#define otg_disable() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_USBE)) -#define Is_otg_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_USBE)) - - //! Enable OTG pad -#define otg_enable_pad() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_OTGPADE)) - //! Disable OTG pad -#define otg_disable_pad() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_OTGPADE)) -#define Is_otg_pad_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_OTGPADE)) - - //! Check Clock Usable - //! For parts with HS feature, this one corresponding at UTMI clock -#define Is_otg_clock_usable() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_CLKUSABLE)) - - //! Stop (freeze) internal USB clock -#define otg_freeze_clock() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK)) -#define otg_unfreeze_clock() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK)) -#define Is_otg_clock_frozen() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK)) - - //! Configure time-out of specified OTG timer -#define otg_configure_timeout(timer, timeout) (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UNLOCK),\ - Wr_bitfield(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_TIMPAGE_Msk, timer),\ - Wr_bitfield(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_TIMVALUE_Msk, timeout),\ - Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UNLOCK)) - //! Get configured time-out of specified OTG timer -#define otg_get_timeout(timer) (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UNLOCK),\ - Wr_bitfield(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_TIMPAGE_Msk, timer),\ - Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UNLOCK),\ - Rd_bitfield(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_TIMVALUE_Msk)) - - - //! Get the dual-role device state of the internal USB finite state machine of the UOTGHS controller -#define otg_get_fsm_drd_state() (Rd_bitfield(UOTGHS->UOTGHS_FSM, UOTGHS_FSM_DRDSTATE_Msk)) -#define Is_otg_a_suspend() (4==otg_get_fsm_drd_state()) -#define Is_otg_a_wait_vrise() (1==otg_get_fsm_drd_state()) -//! @} - -//! @name UOTGHS OTG hardware protocol -//! These macros manages the hardware OTG protocol -//! @{ - //! Initiates a Host negotiation Protocol -#define otg_device_initiate_hnp() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPREQ)) - //! Accepts a Host negotiation Protocol -#define otg_host_accept_hnp() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPREQ)) - //! Rejects a Host negotiation Protocol -#define otg_host_reject_hnp() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPREQ)) - //! initiates a Session Request Protocol -#define otg_device_initiate_srp() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPREQ)) - //! Selects VBus as SRP method -#define otg_select_vbus_srp_method() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPSEL)) -#define Is_otg_vbus_srp_method_selected() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPSEL)) - //! Selects data line as SRP method -#define otg_select_data_srp_method() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPSEL)) -#define Is_otg_data_srp_method_selected() (!Is_otg_vbus_srp_method_selected()) - //! Tests if a HNP occurs -#define Is_otg_hnp() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPREQ)) - //! Tests if a SRP from device occurs -#define Is_otg_device_srp() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPREQ)) - - //! Enables HNP error interrupt -#define otg_enable_hnp_error_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPERRE)) - //! Disables HNP error interrupt -#define otg_disable_hnp_error_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPERRE)) -#define Is_otg_hnp_error_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_HNPERRE)) - //! ACKs HNP error interrupt -#define otg_ack_hnp_error_interrupt() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_HNPERRIC) - //! Raises HNP error interrupt -#define otg_raise_hnp_error_interrupt() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_HNPERRIS) - //! Tests if a HNP error occurs -#define Is_otg_hnp_error_interrupt() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_HNPERRI)) - - //! Enables role exchange interrupt -#define otg_enable_role_exchange_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_ROLEEXE)) - //! Disables role exchange interrupt -#define otg_disable_role_exchange_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_ROLEEXE)) -#define Is_otg_role_exchange_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_ROLEEXE)) - //! ACKs role exchange interrupt -#define otg_ack_role_exchange_interrupt() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_ROLEEXIC) - //! Raises role exchange interrupt -#define otg_raise_role_exchange_interrupt() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_ROLEEXIS) - //! Tests if a role exchange occurs -#define Is_otg_role_exchange_interrupt() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_ROLEEXI)) - - //! Enables SRP interrupt -#define otg_enable_srp_interrupt() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPE)) - //! Disables SRP interrupt -#define otg_disable_srp_interrupt() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPE)) -#define Is_otg_srp_interrupt_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_SRPE)) - //! ACKs SRP interrupt -#define otg_ack_srp_interrupt() (UOTGHS->UOTGHS_SCR = UOTGHS_SCR_SRPIC) - //! Raises SRP interrupt -#define otg_raise_srp_interrupt() (UOTGHS->UOTGHS_SFR = UOTGHS_SFR_SRPIS) - //! Tests if a SRP occurs -#define Is_otg_srp_interrupt() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_SRPI)) -//! @} - -//! @} - -#ifdef __cplusplus -} -#endif - -#endif /* UOTGHS_OTG_H_INCLUDED */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h deleted file mode 100644 index 31c783f974..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h +++ /dev/null @@ -1,496 +0,0 @@ -/** - * \file - * - * \brief USB protocol definitions. - * - * This file contains the USB definitions and data structures provided by the - * USB 2.0 specification. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _USB_PROTOCOL_H_ -#define _USB_PROTOCOL_H_ - -/** - * \ingroup usb_group - * \defgroup usb_protocol_group USB Protocol Definitions - * - * This module defines constants and data structures provided by the USB - * 2.0 specification. - * - * @{ - */ - -//! Value for field bcdUSB -#define USB_V2_0 0x0200 //!< USB Specification version 2.00 -#define USB_V2_1 0x0201 //!< USB Specification version 2.01 - -/*! \name Generic definitions (Class, subclass and protocol) - */ -//! @{ -#define NO_CLASS 0x00 -#define CLASS_VENDOR_SPECIFIC 0xFF -#define NO_SUBCLASS 0x00 -#define NO_PROTOCOL 0x00 -//! @} - -//! \name IAD (Interface Association Descriptor) constants -//! @{ -#define CLASS_IAD 0xEF -#define SUB_CLASS_IAD 0x02 -#define PROTOCOL_IAD 0x01 -//! @} - -/** - * \brief USB request data transfer direction (bmRequestType) - */ -#define USB_REQ_DIR_OUT (0<<7) //!< Host to device -#define USB_REQ_DIR_IN (1<<7) //!< Device to host -#define USB_REQ_DIR_MASK (1<<7) //!< Mask - -/** - * \brief USB request types (bmRequestType) - */ -#define USB_REQ_TYPE_STANDARD (0<<5) //!< Standard request -#define USB_REQ_TYPE_CLASS (1<<5) //!< Class-specific request -#define USB_REQ_TYPE_VENDOR (2<<5) //!< Vendor-specific request -#define USB_REQ_TYPE_MASK (3<<5) //!< Mask - -/** - * \brief USB recipient codes (bmRequestType) - */ -#define USB_REQ_RECIP_DEVICE (0<<0) //!< Recipient device -#define USB_REQ_RECIP_INTERFACE (1<<0) //!< Recipient interface -#define USB_REQ_RECIP_ENDPOINT (2<<0) //!< Recipient endpoint -#define USB_REQ_RECIP_OTHER (3<<0) //!< Recipient other -#define USB_REQ_RECIP_MASK (0x1F) //!< Mask - -/** - * \brief Standard USB requests (bRequest) - */ -enum usb_reqid { - USB_REQ_GET_STATUS = 0, - USB_REQ_CLEAR_FEATURE = 1, - USB_REQ_SET_FEATURE = 3, - USB_REQ_SET_ADDRESS = 5, - USB_REQ_GET_DESCRIPTOR = 6, - USB_REQ_SET_DESCRIPTOR = 7, - USB_REQ_GET_CONFIGURATION = 8, - USB_REQ_SET_CONFIGURATION = 9, - USB_REQ_GET_INTERFACE = 10, - USB_REQ_SET_INTERFACE = 11, - USB_REQ_SYNCH_FRAME = 12, -}; - -/** - * \brief Standard USB device status flags - * - */ -enum usb_device_status { - USB_DEV_STATUS_BUS_POWERED = 0, - USB_DEV_STATUS_SELF_POWERED = 1, - USB_DEV_STATUS_REMOTEWAKEUP = 2 -}; - -/** - * \brief Standard USB Interface status flags - * - */ -enum usb_interface_status { - USB_IFACE_STATUS_RESERVED = 0 -}; - -/** - * \brief Standard USB endpoint status flags - * - */ -enum usb_endpoint_status { - USB_EP_STATUS_HALTED = 1, -}; - -/** - * \brief Standard USB device feature flags - * - * \note valid for SetFeature request. - */ -enum usb_device_feature { - USB_DEV_FEATURE_REMOTE_WAKEUP = 1, //!< Remote wakeup enabled - USB_DEV_FEATURE_TEST_MODE = 2, //!< USB test mode - USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3, - USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4, - USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5 -}; - -/** - * \brief Test Mode possible on HS USB device - * - * \note valid for USB_DEV_FEATURE_TEST_MODE request. - */ -enum usb_device_hs_test_mode { - USB_DEV_TEST_MODE_J = 1, - USB_DEV_TEST_MODE_K = 2, - USB_DEV_TEST_MODE_SE0_NAK = 3, - USB_DEV_TEST_MODE_PACKET = 4, - USB_DEV_TEST_MODE_FORCE_ENABLE = 5, -}; - -/** - * \brief Standard USB endpoint feature/status flags - */ -enum usb_endpoint_feature { - USB_EP_FEATURE_HALT = 0, -}; - -/** - * \brief Standard USB Test Mode Selectors - */ -enum usb_test_mode_selector { - USB_TEST_J = 0x01, - USB_TEST_K = 0x02, - USB_TEST_SE0_NAK = 0x03, - USB_TEST_PACKET = 0x04, - USB_TEST_FORCE_ENABLE = 0x05, -}; - -/** - * \brief Standard USB descriptor types - */ -enum usb_descriptor_type { - USB_DT_DEVICE = 1, - USB_DT_CONFIGURATION = 2, - USB_DT_STRING = 3, - USB_DT_INTERFACE = 4, - USB_DT_ENDPOINT = 5, - USB_DT_DEVICE_QUALIFIER = 6, - USB_DT_OTHER_SPEED_CONFIGURATION = 7, - USB_DT_INTERFACE_POWER = 8, - USB_DT_OTG = 9, - USB_DT_IAD = 0x0B, - USB_DT_BOS = 0x0F, - USB_DT_DEVICE_CAPABILITY = 0x10, -}; - -/** - * \brief USB Device Capability types - */ -enum usb_capability_type { - USB_DC_USB20_EXTENSION = 0x02, -}; - -/** - * \brief USB Device Capability - USB 2.0 Extension - * To fill bmAttributes field of usb_capa_ext_desc_t structure. - */ -enum usb_capability_extension_attr { - USB_DC_EXT_LPM = 0x00000002, -}; - -#define HIRD_50_US 0 -#define HIRD_125_US 1 -#define HIRD_200_US 2 -#define HIRD_275_US 3 -#define HIRD_350_US 4 -#define HIRD_425_US 5 -#define HIRD_500_US 6 -#define HIRD_575_US 7 -#define HIRD_650_US 8 -#define HIRD_725_US 9 -#define HIRD_800_US 10 -#define HIRD_875_US 11 -#define HIRD_950_US 12 -#define HIRD_1025_US 13 -#define HIRD_1100_US 14 -#define HIRD_1175_US 15 - -/** Fields definition from a LPM TOKEN */ -#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) -#define USB_LPM_ATTRIBUT_FIRD_MASK (0xF << 4) -#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) -#define USB_LPM_ATTRIBUT_BLINKSTATE(value) ((value & 0xF) << 0) -#define USB_LPM_ATTRIBUT_FIRD(value) ((value & 0xF) << 4) -#define USB_LPM_ATTRIBUT_REMOTEWAKE(value) ((value & 1) << 8) -#define USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) - -/** - * \brief Standard USB endpoint transfer types - */ -enum usb_ep_type { - USB_EP_TYPE_CONTROL = 0x00, - USB_EP_TYPE_ISOCHRONOUS = 0x01, - USB_EP_TYPE_BULK = 0x02, - USB_EP_TYPE_INTERRUPT = 0x03, - USB_EP_TYPE_MASK = 0x03, -}; - -/** - * \brief Standard USB language IDs for string descriptors - */ -enum usb_langid { - USB_LANGID_EN_US = 0x0409, //!< English (United States) -}; - -/** - * \brief Mask selecting the index part of an endpoint address - */ -#define USB_EP_ADDR_MASK 0x0F - -//! \brief USB address identifier -typedef uint8_t usb_add_t; - -/** - * \brief Endpoint transfer direction is IN - */ -#define USB_EP_DIR_IN 0x80 - -/** - * \brief Endpoint transfer direction is OUT - */ -#define USB_EP_DIR_OUT 0x00 - -//! \brief Endpoint identifier -typedef uint8_t usb_ep_t; - -/** - * \brief Maximum length in bytes of a USB descriptor - * - * The maximum length of a USB descriptor is limited by the 8-bit - * bLength field. - */ -#define USB_MAX_DESC_LEN 255 - -/* - * 2-byte alignment requested for all USB structures. - */ -COMPILER_PACK_SET(1) - -/** - * \brief A USB Device SETUP request - * - * The data payload of SETUP packets always follows this structure. - */ -typedef struct { - uint8_t bmRequestType; - uint8_t bRequest; - le16_t wValue; - le16_t wIndex; - le16_t wLength; -} usb_setup_req_t; - -/** - * \brief Standard USB device descriptor structure - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - le16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - le16_t idVendor; - le16_t idProduct; - le16_t bcdDevice; - uint8_t iManufacturer; - uint8_t iProduct; - uint8_t iSerialNumber; - uint8_t bNumConfigurations; -} usb_dev_desc_t; - -/** - * \brief Standard USB device qualifier descriptor structure - * - * This descriptor contains information about the device when running at - * the "other" speed (i.e. if the device is currently operating at high - * speed, this descriptor can be used to determine what would change if - * the device was operating at full speed.) - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - le16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - uint8_t bNumConfigurations; - uint8_t bReserved; -} usb_dev_qual_desc_t; - -/** - * \brief USB Device BOS descriptor structure - * - * The BOS descriptor (Binary device Object Store) defines a root - * descriptor that is similar to the configuration descriptor, and is - * the base descriptor for accessing a family of related descriptors. - * A host can read a BOS descriptor and learn from the wTotalLength field - * the entire size of the device-level descriptor set, or it can read in - * the entire BOS descriptor set of device capabilities. - * The host accesses this descriptor using the GetDescriptor() request. - * The descriptor type in the GetDescriptor() request is set to BOS. - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - le16_t wTotalLength; - uint8_t bNumDeviceCaps; -} usb_dev_bos_desc_t; - - -/** - * \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure - * - * Defines the set of USB 1.1-specific device level capabilities. - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bDevCapabilityType; - le32_t bmAttributes; -} usb_dev_capa_ext_desc_t; - -/** - * \brief USB Device LPM Descriptor structure - * - * The BOS descriptor and capabilities descriptors for LPM. - */ -typedef struct { - usb_dev_bos_desc_t bos; - usb_dev_capa_ext_desc_t capa_ext; -} usb_dev_lpm_desc_t; - -/** - * \brief Standard USB Interface Association Descriptor structure - */ -typedef struct { - uint8_t bLength; //!< size of this descriptor in bytes - uint8_t bDescriptorType; //!< INTERFACE descriptor type - uint8_t bFirstInterface; //!< Number of interface - uint8_t bInterfaceCount; //!< value to select alternate setting - uint8_t bFunctionClass; //!< Class code assigned by the USB - uint8_t bFunctionSubClass;//!< Sub-class code assigned by the USB - uint8_t bFunctionProtocol;//!< Protocol code assigned by the USB - uint8_t iFunction; //!< Index of string descriptor -} usb_association_desc_t; - - -/** - * \brief Standard USB configuration descriptor structure - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - le16_t wTotalLength; - uint8_t bNumInterfaces; - uint8_t bConfigurationValue; - uint8_t iConfiguration; - uint8_t bmAttributes; - uint8_t bMaxPower; -} usb_conf_desc_t; - - -#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set -#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered -#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered -#define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) //!< remote wakeup supported - -#define USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) //!< Max power in mA - -/** - * \brief Standard USB association descriptor structure - */ -typedef struct { - uint8_t bLength; //!< Size of this descriptor in bytes - uint8_t bDescriptorType; //!< Interface descriptor type - uint8_t bFirstInterface; //!< Number of interface - uint8_t bInterfaceCount; //!< value to select alternate setting - uint8_t bFunctionClass; //!< Class code assigned by the USB - uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB - uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB - uint8_t iFunction; //!< Index of string descriptor -} usb_iad_desc_t; - -/** - * \brief Standard USB interface descriptor structure - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bNumEndpoints; - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - uint8_t iInterface; -} usb_iface_desc_t; - -/** - * \brief Standard USB endpoint descriptor structure - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bEndpointAddress; - uint8_t bmAttributes; - le16_t wMaxPacketSize; - uint8_t bInterval; -} usb_ep_desc_t; - - -/** - * \brief A standard USB string descriptor structure - */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; -} usb_str_desc_t; - -typedef struct { - usb_str_desc_t desc; - le16_t string[1]; -} usb_str_lgid_desc_t; - -COMPILER_PACK_RESET() - -//! @} - -#endif /* _USB_PROTOCOL_H_ */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h deleted file mode 100644 index 49fc7387ef..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h +++ /dev/null @@ -1,320 +0,0 @@ -/** - * \file - * - * \brief USB Communication Device Class (CDC) protocol definitions - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ -#ifndef _USB_PROTOCOL_CDC_H_ -#define _USB_PROTOCOL_CDC_H_ - -#include "compiler.h" - -/** - * \ingroup usb_protocol_group - * \defgroup cdc_protocol_group Communication Device Class Definitions - * @{ - */ - -/** - * \name Possible values of class - */ -//@{ -#define CDC_CLASS_DEVICE 0x02 //!< USB Communication Device Class -#define CDC_CLASS_COMM 0x02 //!< CDC Communication Class Interface -#define CDC_CLASS_DATA 0x0A //!< CDC Data Class Interface -#define CDC_CLASS_MULTI 0xEF //!< CDC Multi-interface Function - -//@} - -//! \name USB CDC Subclass IDs -//@{ -#define CDC_SUBCLASS_DLCM 0x01 //!< Direct Line Control Model -#define CDC_SUBCLASS_ACM 0x02 //!< Abstract Control Model -#define CDC_SUBCLASS_TCM 0x03 //!< Telephone Control Model -#define CDC_SUBCLASS_MCCM 0x04 //!< Multi-Channel Control Model -#define CDC_SUBCLASS_CCM 0x05 //!< CAPI Control Model -#define CDC_SUBCLASS_ETH 0x06 //!< Ethernet Networking Control Model -#define CDC_SUBCLASS_ATM 0x07 //!< ATM Networking Control Model -//@} - -//! \name USB CDC Communication Interface Protocol IDs -//@{ -#define CDC_PROTOCOL_V25TER 0x01 //!< Common AT commands -//@} - -//! \name USB CDC Data Interface Protocol IDs -//@{ -#define CDC_PROTOCOL_I430 0x30 //!< ISDN BRI -#define CDC_PROTOCOL_HDLC 0x31 //!< HDLC -#define CDC_PROTOCOL_TRANS 0x32 //!< Transparent -#define CDC_PROTOCOL_Q921M 0x50 //!< Q.921 management protocol -#define CDC_PROTOCOL_Q921 0x51 //!< Q.931 [sic] Data link protocol -#define CDC_PROTOCOL_Q921TM 0x52 //!< Q.921 TEI-multiplexor -#define CDC_PROTOCOL_V42BIS 0x90 //!< Data compression procedures -#define CDC_PROTOCOL_Q931 0x91 //!< Euro-ISDN protocol control -#define CDC_PROTOCOL_V120 0x92 //!< V.24 rate adaption to ISDN -#define CDC_PROTOCOL_CAPI20 0x93 //!< CAPI Commands -#define CDC_PROTOCOL_HOST 0xFD //!< Host based driver -/** - * \brief Describes the Protocol Unit Functional Descriptors [sic] - * on Communication Class Interface - */ -#define CDC_PROTOCOL_PUFD 0xFE -//@} - -//! \name USB CDC Functional Descriptor Types -//@{ -#define CDC_CS_INTERFACE 0x24 //!< Interface Functional Descriptor -#define CDC_CS_ENDPOINT 0x25 //!< Endpoint Functional Descriptor -//@} - -//! \name USB CDC Functional Descriptor Subtypes -//@{ -#define CDC_SCS_HEADER 0x00 //!< Header Functional Descriptor -#define CDC_SCS_CALL_MGMT 0x01 //!< Call Management -#define CDC_SCS_ACM 0x02 //!< Abstract Control Management -#define CDC_SCS_UNION 0x06 //!< Union Functional Descriptor -//@} - -//! \name USB CDC Request IDs -//@{ -#define USB_REQ_CDC_SEND_ENCAPSULATED_COMMAND 0x00 -#define USB_REQ_CDC_GET_ENCAPSULATED_RESPONSE 0x01 -#define USB_REQ_CDC_SET_COMM_FEATURE 0x02 -#define USB_REQ_CDC_GET_COMM_FEATURE 0x03 -#define USB_REQ_CDC_CLEAR_COMM_FEATURE 0x04 -#define USB_REQ_CDC_SET_AUX_LINE_STATE 0x10 -#define USB_REQ_CDC_SET_HOOK_STATE 0x11 -#define USB_REQ_CDC_PULSE_SETUP 0x12 -#define USB_REQ_CDC_SEND_PULSE 0x13 -#define USB_REQ_CDC_SET_PULSE_TIME 0x14 -#define USB_REQ_CDC_RING_AUX_JACK 0x15 -#define USB_REQ_CDC_SET_LINE_CODING 0x20 -#define USB_REQ_CDC_GET_LINE_CODING 0x21 -#define USB_REQ_CDC_SET_CONTROL_LINE_STATE 0x22 -#define USB_REQ_CDC_SEND_BREAK 0x23 -#define USB_REQ_CDC_SET_RINGER_PARMS 0x30 -#define USB_REQ_CDC_GET_RINGER_PARMS 0x31 -#define USB_REQ_CDC_SET_OPERATION_PARMS 0x32 -#define USB_REQ_CDC_GET_OPERATION_PARMS 0x33 -#define USB_REQ_CDC_SET_LINE_PARMS 0x34 -#define USB_REQ_CDC_GET_LINE_PARMS 0x35 -#define USB_REQ_CDC_DIAL_DIGITS 0x36 -#define USB_REQ_CDC_SET_UNIT_PARAMETER 0x37 -#define USB_REQ_CDC_GET_UNIT_PARAMETER 0x38 -#define USB_REQ_CDC_CLEAR_UNIT_PARAMETER 0x39 -#define USB_REQ_CDC_GET_PROFILE 0x3A -#define USB_REQ_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 -#define USB_REQ_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x41 -#define USB_REQ_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x42 -#define USB_REQ_CDC_SET_ETHERNET_PACKET_FILTER 0x43 -#define USB_REQ_CDC_GET_ETHERNET_STATISTIC 0x44 -#define USB_REQ_CDC_SET_ATM_DATA_FORMAT 0x50 -#define USB_REQ_CDC_GET_ATM_DEVICE_STATISTICS 0x51 -#define USB_REQ_CDC_SET_ATM_DEFAULT_VC 0x52 -#define USB_REQ_CDC_GET_ATM_VC_STATISTICS 0x53 -// Added bNotification codes according cdc spec 1.1 chapter 6.3 -#define USB_REQ_CDC_NOTIFY_RING_DETECT 0x09 -#define USB_REQ_CDC_NOTIFY_SERIAL_STATE 0x20 -#define USB_REQ_CDC_NOTIFY_CALL_STATE_CHANGE 0x28 -#define USB_REQ_CDC_NOTIFY_LINE_STATE_CHANGE 0x29 -//@} - -/* - * Need to pack structures tightly, or the compiler might insert padding - * and violate the spec-mandated layout. - */ -COMPILER_PACK_SET(1) - -//! \name USB CDC Descriptors -//@{ - - -//! CDC Header Functional Descriptor -typedef struct { - uint8_t bFunctionLength; - uint8_t bDescriptorType; - uint8_t bDescriptorSubtype; - le16_t bcdCDC; -} usb_cdc_hdr_desc_t; - -//! CDC Call Management Functional Descriptor -typedef struct { - uint8_t bFunctionLength; - uint8_t bDescriptorType; - uint8_t bDescriptorSubtype; - uint8_t bmCapabilities; - uint8_t bDataInterface; -} usb_cdc_call_mgmt_desc_t; - -//! CDC ACM Functional Descriptor -typedef struct { - uint8_t bFunctionLength; - uint8_t bDescriptorType; - uint8_t bDescriptorSubtype; - uint8_t bmCapabilities; -} usb_cdc_acm_desc_t; - -//! CDC Union Functional Descriptor -typedef struct { - uint8_t bFunctionLength; - uint8_t bDescriptorType; - uint8_t bDescriptorSubtype; - uint8_t bMasterInterface; - uint8_t bSlaveInterface0; -} usb_cdc_union_desc_t; - - -//! \name USB CDC Call Management Capabilities -//@{ -//! Device handles call management itself -#define CDC_CALL_MGMT_SUPPORTED (1 << 0) -//! Device can send/receive call management info over a Data Class interface -#define CDC_CALL_MGMT_OVER_DCI (1 << 1) -//@} - -//! \name USB CDC ACM Capabilities -//@{ -//! Device supports the request combination of -//! Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature. -#define CDC_ACM_SUPPORT_FEATURE_REQUESTS (1 << 0) -//! Device supports the request combination of -//! Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, -//! and the notification Serial_State. -#define CDC_ACM_SUPPORT_LINE_REQUESTS (1 << 1) -//! Device supports the request Send_Break -#define CDC_ACM_SUPPORT_SENDBREAK_REQUESTS (1 << 2) -//! Device supports the notification Network_Connection. -#define CDC_ACM_SUPPORT_NOTIFY_REQUESTS (1 << 3) -//@} -//@} - -//! \name USB CDC line control -//@{ - -//! \name USB CDC line coding -//@{ -//! Line Coding structure -typedef struct { - le32_t dwDTERate; - uint8_t bCharFormat; - uint8_t bParityType; - uint8_t bDataBits; -} usb_cdc_line_coding_t; -//! Possible values of bCharFormat -enum cdc_char_format { - CDC_STOP_BITS_1 = 0, //!< 1 stop bit - CDC_STOP_BITS_1_5 = 1, //!< 1.5 stop bits - CDC_STOP_BITS_2 = 2, //!< 2 stop bits -}; -//! Possible values of bParityType -enum cdc_parity { - CDC_PAR_NONE = 0, //!< No parity - CDC_PAR_ODD = 1, //!< Odd parity - CDC_PAR_EVEN = 2, //!< Even parity - CDC_PAR_MARK = 3, //!< Parity forced to 0 (space) - CDC_PAR_SPACE = 4, //!< Parity forced to 1 (mark) -}; -//@} - -//! \name USB CDC control signals -//! spec 1.1 chapter 6.2.14 -//@{ - -//! Control signal structure -typedef struct { - uint16_t value; -} usb_cdc_control_signal_t; - -//! \name Possible values in usb_cdc_control_signal_t -//@{ -//! Carrier control for half duplex modems. -//! This signal corresponds to V.24 signal 105 and RS-232 signal RTS. -//! The device ignores the value of this bit -//! when operating in full duplex mode. -#define CDC_CTRL_SIGNAL_ACTIVATE_CARRIER (1 << 1) -//! Indicates to DCE if DTE is present or not. -//! This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR. -#define CDC_CTRL_SIGNAL_DTE_PRESENT (1 << 0) -//@} -//@} - - -//! \name USB CDC notification message -//@{ - -typedef struct { - uint8_t bmRequestType; - uint8_t bNotification; - le16_t wValue; - le16_t wIndex; - le16_t wLength; -} usb_cdc_notify_msg_t; - -//! \name USB CDC serial state -//@{* - -//! Hardware handshake support (cdc spec 1.1 chapter 6.3.5) -typedef struct { - usb_cdc_notify_msg_t header; - le16_t value; -} usb_cdc_notify_serial_state_t; - -//! \name Possible values in usb_cdc_notify_serial_state_t -//@{ -#define CDC_SERIAL_STATE_DCD CPU_TO_LE16((1<<0)) -#define CDC_SERIAL_STATE_DSR CPU_TO_LE16((1<<1)) -#define CDC_SERIAL_STATE_BREAK CPU_TO_LE16((1<<2)) -#define CDC_SERIAL_STATE_RING CPU_TO_LE16((1<<3)) -#define CDC_SERIAL_STATE_FRAMING CPU_TO_LE16((1<<4)) -#define CDC_SERIAL_STATE_PARITY CPU_TO_LE16((1<<5)) -#define CDC_SERIAL_STATE_OVERRUN CPU_TO_LE16((1<<6)) -//@} -//! @} - -//! @} - -COMPILER_PACK_RESET() - -//! @} - -#endif // _USB_PROTOCOL_CDC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h deleted file mode 100644 index db8f9cafd0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h +++ /dev/null @@ -1,147 +0,0 @@ -/** - * \file - * - * \brief USB Mass Storage Class (MSC) protocol definitions. - * - * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _USB_PROTOCOL_MSC_H_ -#define _USB_PROTOCOL_MSC_H_ - - -/** - * \ingroup usb_protocol_group - * \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions - * - * @{ - */ - -/** - * \name Possible Class value - */ -//@{ -#define MSC_CLASS 0x08 -//@} - -/** - * \name Possible SubClass value - * \note In practise, most devices should use - * #MSC_SUBCLASS_TRANSPARENT and specify the actual command set in - * the standard INQUIRY data block, even if the MSC spec indicates - * otherwise. In particular, RBC is not supported by certain major - * operating systems like Windows XP. - */ -//@{ -#define MSC_SUBCLASS_RBC 0x01 //!< Reduced Block Commands -#define MSC_SUBCLASS_ATAPI 0x02 //!< CD/DVD devices -#define MSC_SUBCLASS_QIC_157 0x03 //!< Tape devices -#define MSC_SUBCLASS_UFI 0x04 //!< Floppy disk drives -#define MSC_SUBCLASS_SFF_8070I 0x05 //!< Floppy disk drives -#define MSC_SUBCLASS_TRANSPARENT 0x06 //!< Determined by INQUIRY -//@} - -/** - * \name Possible protocol value - * \note Only the BULK protocol should be used in new designs. - */ -//@{ -#define MSC_PROTOCOL_CBI 0x00 //!< Command/Bulk/Interrupt -#define MSC_PROTOCOL_CBI_ALT 0x01 //!< W/o command completion -#define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only -//@} - - -/** - * \brief MSC USB requests (bRequest) - */ -enum usb_reqid_msc { - USB_REQ_MSC_BULK_RESET = 0xFF, //!< Mass Storage Reset - USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN -}; - - -COMPILER_PACK_SET(1) - -/** - * \name A Command Block Wrapper (CBW). - */ -//@{ -struct usb_msc_cbw { - le32_t dCBWSignature; //!< Must contain 'USBC' - le32_t dCBWTag; //!< Unique command ID - le32_t dCBWDataTransferLength; //!< Number of bytes to transfer - uint8_t bmCBWFlags; //!< Direction in bit 7 - uint8_t bCBWLUN; //!< Logical Unit Number - uint8_t bCBWCBLength; //!< Number of valid CDB bytes - uint8_t CDB[16]; //!< SCSI Command Descriptor Block -}; - -#define USB_CBW_SIGNATURE 0x55534243 //!< dCBWSignature value -#define USB_CBW_DIRECTION_IN (1<<7) //!< Data from device to host -#define USB_CBW_DIRECTION_OUT (0<<7) //!< Data from host to device -#define USB_CBW_LUN_MASK 0x0F //!< Valid bits in bCBWLUN -#define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength -//@} - - -/** - * \name A Command Status Wrapper (CSW). - */ -//@{ -struct usb_msc_csw { - le32_t dCSWSignature; //!< Must contain 'USBS' - le32_t dCSWTag; //!< Same as dCBWTag - le32_t dCSWDataResidue; //!< Number of bytes not transfered - uint8_t bCSWStatus; //!< Status code -}; - -#define USB_CSW_SIGNATURE 0x55534253 //!< dCSWSignature value -#define USB_CSW_STATUS_PASS 0x00 //!< Command Passed -#define USB_CSW_STATUS_FAIL 0x01 //!< Command Failed -#define USB_CSW_STATUS_PE 0x02 //!< Phase Error -//@} - -COMPILER_PACK_RESET() - -//@} - -#endif // _USB_PROTOCOL_MSC_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.c deleted file mode 100644 index 29d02faef7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.c +++ /dev/null @@ -1,341 +0,0 @@ -/** - * \file - * - * \brief Main functions for USB composite example - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ - -// Support and FAQ: visit Atmel Support - -#ifdef ARDUINO_ARCH_SAM - -#include -#include - -#include "conf_usb.h" -#include "udc.h" - -#if ENABLED(SDSUPPORT) - static volatile bool main_b_msc_enable = false; -#endif -static volatile bool main_b_cdc_enable = false; -static volatile bool main_b_dtr_active = false; - -void usb_task_idle(void) { - #if ENABLED(SDSUPPORT) - // Attend SD card access from the USB MSD -- Prioritize access to improve speed - int delay = 2; - while (main_b_msc_enable && --delay > 0) { - if (udi_msc_process_trans()) delay = 10000; - - // Reset the watchdog, just to be sure - REG_WDT_CR = WDT_CR_WDRSTT | WDT_CR_KEY(0xA5); - } - #endif -} - -#if ENABLED(SDSUPPORT) - bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); } - void usb_task_msc_disable(void) { main_b_msc_enable = false; } - bool usb_task_msc_isenabled(void) { return main_b_msc_enable; } -#endif - -bool usb_task_cdc_enable(const uint8_t port) { UNUSED(port); return ((main_b_cdc_enable = true)); } -void usb_task_cdc_disable(const uint8_t port) { UNUSED(port); main_b_cdc_enable = false; main_b_dtr_active = false; } -bool usb_task_cdc_isenabled(void) { return main_b_cdc_enable; } - -/*! \brief Called by CDC interface - * Callback running when CDC device have received data - */ -void usb_task_cdc_rx_notify(const uint8_t port) { UNUSED(port); } - -/*! \brief Configures communication line - * - * \param cfg line configuration - */ -static uint16_t dwDTERate = 0; -void usb_task_cdc_config(const uint8_t port, usb_cdc_line_coding_t *cfg) { - UNUSED(port); - // Store last DTE rate - dwDTERate = cfg->dwDTERate; -} - -void usb_task_cdc_set_dtr(const uint8_t port, const bool b_enable) { - UNUSED(port); - // Keep DTR status - main_b_dtr_active = b_enable; - - // Implement Arduino-Compatible kludge to enter programming mode from - // the native port: - // "Auto-reset into the bootloader is triggered when the port, already - // open at 1200 bps, is closed." - - if (1200 == dwDTERate) { - // We check DTR state to determine if host port is open (bit 0 of lineState). - if (!b_enable) { - - // Set RST pin to go low for 65535 clock cycles on reset - // This helps restarting when firmware flash ends - RSTC->RSTC_MR = 0xA5000F01; - - // Schedule delayed reset - initiateReset(250); - } - else - cancelReset(); - } -} - -bool usb_task_cdc_dtr_active(void) { return main_b_dtr_active; } - -/// Microsoft WCID descriptor -typedef struct USB_MicrosoftCompatibleDescriptor_Interface { - uint8_t bFirstInterfaceNumber; - uint8_t reserved1; - uint8_t compatibleID[8]; - uint8_t subCompatibleID[8]; - uint8_t reserved2[6]; -} __attribute__((packed)) USB_MicrosoftCompatibleDescriptor_Interface; - -typedef struct USB_MicrosoftCompatibleDescriptor { - uint32_t dwLength; - uint16_t bcdVersion; - uint16_t wIndex; - uint8_t bCount; - uint8_t reserved[7]; - USB_MicrosoftCompatibleDescriptor_Interface interfaces[]; -} __attribute__((packed)) USB_MicrosoftCompatibleDescriptor; - -// 3D Printer compatible descriptor -static USB_MicrosoftCompatibleDescriptor microsoft_compatible_id_descriptor = { - .dwLength = sizeof(USB_MicrosoftCompatibleDescriptor) + - 1*sizeof(USB_MicrosoftCompatibleDescriptor_Interface), - .bcdVersion = 0x0100, - .wIndex = 0x0004, - .bCount = 1, - .reserved = {0, 0, 0, 0, 0, 0, 0}, - .interfaces = { - { - .bFirstInterfaceNumber = 0, - .reserved1 = 1, - .compatibleID = "3DPRINT", - .subCompatibleID = {0, 0, 0, 0, 0, 0, 0, 0}, - .reserved2 = {0, 0, 0, 0, 0, 0}, - } - } -}; - -#define xstr(s) str(s) -#define str(s) #s - -#define MS3DPRINT_CONFIG u"MS3DPrintConfig" -#define MS3DPRINT_CONFIG_DATA \ - u"Base=SD\0"\ - u"Job3DOutputAreaWidth=" xstr(X_BED_SIZE) "000\0"\ - u"Job3DOutputAreaDepth=" xstr(Y_BED_SIZE) "000\0"\ - u"Job3DOutputAreaHeight=" xstr(Z_MAX_POS) "000\0"\ - u"filamentdiameter=1750\0" - -typedef struct USB_MicrosoftExtendedPropertiesDescriptor { - uint32_t dwLength; - uint16_t bcdVersion; - uint16_t wIndex; - uint16_t bCount; - uint32_t dwPropertySize; - uint32_t dwPropertyDataType; - uint16_t wPropertyNameLength; - uint16_t PropertyName[sizeof(MS3DPRINT_CONFIG)/sizeof(uint16_t)]; - uint32_t dwPropertyDataLength; - uint16_t PropertyData[sizeof(MS3DPRINT_CONFIG_DATA)/sizeof(uint16_t)]; -} __attribute__((packed)) USB_MicrosoftExtendedPropertiesDescriptor; - -static USB_MicrosoftExtendedPropertiesDescriptor microsoft_extended_properties_descriptor = { - .dwLength = sizeof(USB_MicrosoftExtendedPropertiesDescriptor), - .bcdVersion = 0x0100, - .wIndex = 0x0005, - .bCount = 1, - - .dwPropertySize = 4 + 4 + 2 + 4 + sizeof(MS3DPRINT_CONFIG) + sizeof(MS3DPRINT_CONFIG_DATA), - .dwPropertyDataType = 7, // (1=REG_SZ, 4=REG_DWORD, 7=REG_MULTI_SZ) - .wPropertyNameLength = sizeof(MS3DPRINT_CONFIG), - .PropertyName = MS3DPRINT_CONFIG, - .dwPropertyDataLength = sizeof(MS3DPRINT_CONFIG_DATA), - .PropertyData = MS3DPRINT_CONFIG_DATA -}; - -/************************************************************************************************** -** WCID configuration information -** Hooked into UDC via UDC_GET_EXTRA_STRING #define. -*/ -bool usb_task_extra_string(void) { - static uint8_t udi_msft_magic[] = "MSFT100\xEE"; - static uint8_t udi_cdc_name[] = "CDC interface"; - #if ENABLED(SDSUPPORT) - static uint8_t udi_msc_name[] = "MSC interface"; - #endif - - struct extra_strings_desc_t { - usb_str_desc_t header; - #if ENABLED(SDSUPPORT) - le16_t string[Max(Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msc_name) - 1), sizeof(udi_msft_magic) - 1)]; - #else - le16_t string[Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msft_magic) - 1)]; - #endif - }; - static UDC_DESC_STORAGE struct extra_strings_desc_t extra_strings_desc = { - .header.bDescriptorType = USB_DT_STRING - }; - - uint8_t *str; - uint8_t str_lgt = 0; - - // Link payload pointer to the string corresponding at request - switch (udd_g_ctrlreq.req.wValue & 0xFF) { - case UDI_CDC_IAD_STRING_ID: - str_lgt = sizeof(udi_cdc_name) - 1; - str = udi_cdc_name; - break; - #if ENABLED(SDSUPPORT) - case UDI_MSC_STRING_ID: - str_lgt = sizeof(udi_msc_name) - 1; - str = udi_msc_name; - break; - #endif - case 0xEE: - str_lgt = sizeof(udi_msft_magic) - 1; - str = udi_msft_magic; - break; - default: - return false; - } - - for (uint8_t i = 0; i < str_lgt; i++) - extra_strings_desc.string[i] = cpu_to_le16((le16_t)str[i]); - - extra_strings_desc.header.bLength = 2 + str_lgt * 2; - udd_g_ctrlreq.payload_size = extra_strings_desc.header.bLength; - udd_g_ctrlreq.payload = (uint8_t*)&extra_strings_desc; - - // if the string is larger than request length, then cut it - if (udd_g_ctrlreq.payload_size > udd_g_ctrlreq.req.wLength) { - udd_g_ctrlreq.payload_size = udd_g_ctrlreq.req.wLength; - } - - return true; -} - -/************************************************************************************************** -** Handle device requests that the ASF stack doesn't -*/ -bool usb_task_other_requests(void) { - uint8_t* ptr = 0; - uint16_t size = 0; - - if (Udd_setup_type() == USB_REQ_TYPE_VENDOR) { - //if (udd_g_ctrlreq.req.bRequest == 0x30) - if (1) { - if (udd_g_ctrlreq.req.wIndex == 0x04) { - ptr = (uint8_t*)µsoft_compatible_id_descriptor; - size = (udd_g_ctrlreq.req.wLength); - if (size > microsoft_compatible_id_descriptor.dwLength) - size = microsoft_compatible_id_descriptor.dwLength; - } - else if (udd_g_ctrlreq.req.wIndex == 0x05) { - ptr = (uint8_t*)µsoft_extended_properties_descriptor; - size = (udd_g_ctrlreq.req.wLength); - if (size > microsoft_extended_properties_descriptor.dwLength) - size = microsoft_extended_properties_descriptor.dwLength; - } - else - return false; - } - } - - udd_g_ctrlreq.payload_size = size; - if (size == 0) { - udd_g_ctrlreq.callback = 0; - udd_g_ctrlreq.over_under_run = 0; - } - else - udd_g_ctrlreq.payload = ptr; - - return true; -} - -void usb_task_init(void) { - - uint16_t *ptr; - - // Disable USB peripheral so we start clean and avoid lockups - otg_disable(); - udd_disable(); - - // Set the USB interrupt to our stack - UDD_SetStack(&USBD_ISR); - - // Start USB stack to authorize VBus monitoring - udc_start(); - - // Patch in filament diameter - Be careful: String is in UNICODE (2bytes per char) - ptr = µsoft_extended_properties_descriptor.PropertyData[0]; - while (ptr[0] || ptr[1]) { // Double 0 flags end of resource - - // Found the filamentdiameter= unicode string - if (ptr[0] == 'r' && ptr[1] == '=') { - char diam[16]; - char *sptr; - - // Patch in the filament diameter - sprintf_P(diam, PSTR("%d"), (int)((DEFAULT_NOMINAL_FILAMENT_DIA) * 1000.0)); - - // And copy it to the proper place, expanding it to unicode - sptr = &diam[0]; - ptr += 2; - while (*sptr) *ptr++ = *sptr++; - - // Done! - break; - } - - // Go to the next character - ptr++; - } -} - -#endif // ARDUINO_ARCH_SAM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.h deleted file mode 100644 index fad62fda50..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/usb/usb_task.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * \file - * - * \brief Declaration of main function used by Composite example 4 - * - * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _USB_TASK_H_ -#define _USB_TASK_H_ - -#include "usb_protocol_cdc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*! \brief Called by MSC interface - * Callback running when USB Host enable MSC interface - * - * \retval true if MSC startup is ok - */ -bool usb_task_msc_enable(void); - -/*! \brief Called by MSC interface - * Callback running when USB Host disable MSC interface - */ -void usb_task_msc_disable(void); - -/*! \brief Opens the communication port - * This is called by CDC interface when USB Host enable it. - * - * \retval true if cdc startup is successfully done - */ -bool usb_task_cdc_enable(const uint8_t port); - -/*! \brief Closes the communication port - * This is called by CDC interface when USB Host disable it. - */ -void usb_task_cdc_disable(const uint8_t port); - -/*! \brief Save new DTR state to change led behavior. - * The DTR notify that the terminal have open or close the communication port. - */ -void usb_task_cdc_set_dtr(const uint8_t port, const bool b_enable); - -/*! \brief Check if MSC is enumerated and configured on the PC side - */ -bool usb_task_msc_isenabled(void); - -/*! \brief Check if CDC is enumerated and configured on the PC side - */ -bool usb_task_cdc_isenabled(void); - -/*! \brief Check if CDC is actually OPEN by an application on the PC side - * assuming DTR signal means a program is listening to messages - */ -bool usb_task_cdc_dtr_active(void); - -/*! \brief Called by UDC when USB Host request a extra string different - * of this specified in USB device descriptor - */ -bool usb_task_extra_string(void); - -/*! \brief Called by UDC when USB Host performs unknown requests - */ -bool usb_task_other_requests(void); - -/*! \brief Called by CDC interface - * Callback running when CDC device have received data - */ -void usb_task_cdc_rx_notify(const uint8_t port); - -/*! \brief Configures communication line - * - * \param cfg line configuration - */ -void usb_task_cdc_config(const uint8_t port, usb_cdc_line_coding_t *cfg); - -/*! \brief The USB device interrupt - */ -void USBD_ISR(void); - -/*! \brief USB task init - */ -void usb_task_init(void); - -/*! \brief USB task idle - */ -void usb_task_idle(void); - -#ifdef __cplusplus -} -#endif - -#endif // _USB_TASK_H_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.cpp deleted file mode 100644 index 1f51b75c18..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.cpp +++ /dev/null @@ -1,115 +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 . - * - */ - -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "../../Marlin.h" -#include "watchdog.h" - -// Override Arduino runtime to either config or disable the watchdog -// -// We need to configure the watchdog as soon as possible in the boot -// 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() { - - #if ENABLED(USE_WATCHDOG) - - // 4 seconds timeout - uint32_t timeout = 4000; - - // Calculate timeout value in WDT counter ticks: This assumes - // the slow clock is running at 32.768 kHz watchdog - // frequency is therefore 32768 / 128 = 256 Hz - timeout = (timeout << 8) / 1000; - if (timeout == 0) - timeout = 1; - else if (timeout > 0xFFF) - timeout = 0xFFF; - - // We want to enable the watchdog with the specified timeout - uint32_t value = - WDT_MR_WDV(timeout) | // With the specified timeout - WDT_MR_WDD(timeout) | // and no invalid write window - #if !(SAMV70 || SAMV71 || SAME70 || SAMS70) - WDT_MR_WDRPROC | // WDT fault resets processor only - We want - // to keep PIO controller state - #endif - WDT_MR_WDDBGHLT | // WDT stops in debug state. - WDT_MR_WDIDLEHLT; // WDT stops in idle state. - - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - - // Configure WDT to only trigger an interrupt - value |= WDT_MR_WDFIEN; // Enable WDT fault interrupt. - - // Disable WDT interrupt (just in case, to avoid triggering it!) - NVIC_DisableIRQ(WDT_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Initialize WDT with the given parameters - WDT_Enable(WDT, value); - - // Configure and enable WDT interrupt. - NVIC_ClearPendingIRQ(WDT_IRQn); - NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups - NVIC_EnableIRQ(WDT_IRQn); - - #else - - // a WDT fault triggers a reset - value |= WDT_MR_WDRSTEN; - - // Initialize WDT with the given parameters - WDT_Enable(WDT, value); - - #endif - - // Reset the watchdog - WDT_Restart(WDT); - - #else - - // Make sure to completely disable the Watchdog - WDT_Disable(WDT); - - #endif -} - -#if ENABLED(USE_WATCHDOG) - // Initialize watchdog - On SAM3X, Watchdog was already configured - // and enabled or disabled at startup, so no need to reconfigure it - // here. - void watchdog_init() { - // Reset watchdog to start clean - WDT_Restart(WDT); - } -#endif // USE_WATCHDOG - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.h deleted file mode 100644 index 6e70adef81..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_DUE/watchdog.h +++ /dev/null @@ -1,33 +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 - -// Arduino Due core now has watchdog support - -#include "HAL.h" - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void HAL_watchdog_refresh() { watchdogReset(); } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp deleted file mode 100644 index 544b1b3f67..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp +++ /dev/null @@ -1,33 +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 . - * - */ - -#include "FlushableHardwareSerial.h" - -#ifdef ARDUINO_ARCH_ESP32 - -FlushableHardwareSerial::FlushableHardwareSerial(int uart_nr) - : HardwareSerial(uart_nr) -{} - -FlushableHardwareSerial flushableSerial(0); - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h deleted file mode 100644 index 9fca4fcbea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h +++ /dev/null @@ -1,37 +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 - -#ifdef ARDUINO_ARCH_ESP32 - -#include - -class FlushableHardwareSerial : public HardwareSerial { -public: - FlushableHardwareSerial(int uart_nr); - - inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ } -}; - -extern FlushableHardwareSerial flushableSerial; - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.cpp deleted file mode 100644 index 81567eeede..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ /dev/null @@ -1,264 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "HAL.h" -#include "timers.h" -#include -#include -#include - -#include "../../inc/MarlinConfigPre.h" - -#if EITHER(EEPROM_SETTINGS, WEBSUPPORT) - #include "spiffs.h" -#endif - -#if ENABLED(WIFISUPPORT) - #include - #include "wifi.h" - #if ENABLED(OTASUPPORT) - #include "ota.h" - #endif - #if ENABLED(WEBSUPPORT) - #include "web.h" - #endif -#endif - -// ------------------------ -// Externs -// ------------------------ - -portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; - -// ------------------------ -// Local defines -// ------------------------ - -#define V_REF 1100 - -// ------------------------ -// Public Variables -// ------------------------ - -uint16_t HAL_adc_result; - -// ------------------------ -// Private Variables -// ------------------------ - -esp_adc_cal_characteristics_t characteristics[ADC_ATTEN_MAX]; -adc_atten_t attenuations[ADC1_CHANNEL_MAX] = {}; -uint32_t thresholds[ADC_ATTEN_MAX]; -volatile int numPWMUsed = 0, - pwmPins[MAX_PWM_PINS], - pwmValues[MAX_PWM_PINS]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_init() { - i2s_init(); -} - -void HAL_init_board() { - #if EITHER(EEPROM_SETTINGS, WEBSUPPORT) - spiffs_init(); - #endif - - #if ENABLED(WIFISUPPORT) - wifi_init(); - #if ENABLED(OTASUPPORT) - OTA_init(); - #endif - #if ENABLED(WEBSUPPORT) - web_init(); - #endif - server.begin(); - #endif -} - -void HAL_idletask() { - #if ENABLED(OTASUPPORT) - OTA_handle(); - #endif -} - -void HAL_clear_reset_source() { } - -uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); } - -void _delay_ms(int delay_ms) { delay(delay_ms); } - -// return free memory between end of heap (or end bss) and whatever is current -int freeMemory() { return ESP.getFreeHeap(); } - -// ------------------------ -// ADC -// ------------------------ -#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL - -adc1_channel_t get_channel(int pin) { - switch (pin) { - case 39: return ADC1_CHANNEL(39); - case 36: return ADC1_CHANNEL(36); - case 35: return ADC1_CHANNEL(35); - case 34: return ADC1_CHANNEL(34); - case 33: return ADC1_CHANNEL(33); - case 32: return ADC1_CHANNEL(32); - } - return ADC1_CHANNEL_MAX; -} - -void adc1_set_attenuation(adc1_channel_t chan, adc_atten_t atten) { - if (attenuations[chan] != atten) { - adc1_config_channel_atten(chan, atten); - attenuations[chan] = atten; - } -} - -void HAL_adc_init() { - // Configure ADC - adc1_config_width(ADC_WIDTH_12Bit); - - // Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects - #if HAS_TEMP_ADC_0 - adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_1 - adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_2 - adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_3 - adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_4 - adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_ADC_5 - adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db); - #endif - #if HAS_HEATED_BED - adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db); - #endif - #if HAS_TEMP_CHAMBER - adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db); - #endif - - // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail. - // That's why we're not setting it up here. - - // Calculate ADC characteristics (i.e., gain and offset factors for each attenuation level) - for (int i = 0; i < ADC_ATTEN_MAX; i++) { - esp_adc_cal_characterize(ADC_UNIT_1, (adc_atten_t)i, ADC_WIDTH_BIT_12, V_REF, &characteristics[i]); - - // Change attenuation 100mV below the calibrated threshold - thresholds[i] = esp_adc_cal_raw_to_voltage(4095, &characteristics[i]); - } -} - -void HAL_adc_start_conversion(uint8_t adc_pin) { - const adc1_channel_t chan = get_channel(adc_pin); - uint32_t mv; - esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv); - HAL_adc_result = mv * 1023.0 / 3300.0; - - // Change the attenuation level based on the new reading - adc_atten_t atten; - if (mv < thresholds[ADC_ATTEN_DB_0] - 100) - atten = ADC_ATTEN_DB_0; - else if (mv > thresholds[ADC_ATTEN_DB_0] - 50 && mv < thresholds[ADC_ATTEN_DB_2_5] - 100) - atten = ADC_ATTEN_DB_2_5; - else if (mv > thresholds[ADC_ATTEN_DB_2_5] - 50 && mv < thresholds[ADC_ATTEN_DB_6] - 100) - atten = ADC_ATTEN_DB_6; - else if (mv > thresholds[ADC_ATTEN_DB_6] - 50) - atten = ADC_ATTEN_DB_11; - else return; - - adc1_set_attenuation(chan, atten); -} - -void analogWrite(pin_t pin, int value) { - // Use ledc hardware for internal pins - if (pin < 34) { - static int cnt_channel = 1, pin_to_channel[40] = { 0 }; - if (pin_to_channel[pin] == 0) { - ledcAttachPin(pin, cnt_channel); - ledcSetup(cnt_channel, 490, 8); - ledcWrite(cnt_channel, value); - pin_to_channel[pin] = cnt_channel++; - } - ledcWrite(pin_to_channel[pin], value); - return; - } - - int idx = -1; - - // Search Pin - for (int i = 0; i < numPWMUsed; ++i) - if (pwmPins[i] == pin) { idx = i; break; } - - // not found ? - if (idx < 0) { - // No slots remaining - if (numPWMUsed >= MAX_PWM_PINS) return; - - // Take new slot for pin - idx = numPWMUsed; - pwmPins[idx] = pin; - // Start timer on first use - if (idx == 0) HAL_timer_start(PWM_TIMER_NUM, PWM_TIMER_FREQUENCY); - - ++numPWMUsed; - } - - // Use 7bit internal value - add 1 to have 100% high at 255 - pwmValues[idx] = (value + 1) / 2; -} - -// Handle PWM timer interrupt -HAL_PWM_TIMER_ISR() { - HAL_timer_isr_prologue(PWM_TIMER_NUM); - - static uint8_t count = 0; - - for (int i = 0; i < numPWMUsed; ++i) { - if (count == 0) // Start of interval - WRITE(pwmPins[i], pwmValues[i] ? HIGH : LOW); - else if (pwmValues[i] == count) // End of duration - WRITE(pwmPins[i], LOW); - } - - // 128 for 7 Bit resolution - count = (count + 1) & 0x7F; - - HAL_timer_isr_epilogue(PWM_TIMER_NUM); -} - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.h deleted file mode 100644 index df9a5648c8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -/** - * Description: HAL for Espressif ESP32 WiFi - */ - -#define CPU_32_BIT - -#include - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "watchdog.h" -#include "i2s.h" - -#include "timers.h" - -#include "WebSocketSerial.h" -#include "FlushableHardwareSerial.h" - -// ------------------------ -// Defines -// ------------------------ - -extern portMUX_TYPE spinlock; - -#define MYSERIAL0 flushableSerial - -#if ENABLED(WIFISUPPORT) - #define NUM_SERIAL 2 - #define MYSERIAL1 webSocketSerial -#else - #define NUM_SERIAL 1 -#endif - -#define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock) -#define CRITICAL_SECTION_END portEXIT_CRITICAL(&spinlock) -#define ISRS_ENABLED() (spinlock.owner == portMUX_FREE_VAL) -#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock) -#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock) - - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -// ------------------------ -// Types -// ------------------------ - -typedef int16_t pin_t; - -#define HAL_SERVO_LIB Servo - -// ------------------------ -// Public Variables -// ------------------------ - -/** result of last ADC conversion */ -extern uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// clear reset reason -void HAL_clear_reset_source(); - -// reset reason -uint8_t HAL_get_reset_source(); - -void _delay_ms(int delay); - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(); -#pragma GCC diagnostic pop - -void analogWrite(pin_t pin, int value); - -// EEPROM -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *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); - -// ADC -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_init(); - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true - -void HAL_adc_start_conversion(uint8_t adc_pin); - -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -// Enable hooks into idle and setup for HAL -#define HAL_IDLETASK 1 -#define BOARD_INIT() HAL_init_board(); -void HAL_idletask(); -void HAL_init(); -void HAL_init_board(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp deleted file mode 100644 index eba880b4fd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp +++ /dev/null @@ -1,117 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "HAL.h" -#include "../shared/HAL_SPI.h" -#include -#include "spi_pins.h" -#include - -#include "../../core/macros.h" - -// ------------------------ -// Public Variables -// ------------------------ - -static SPISettings spiConfig; - -// ------------------------ -// Public functions -// ------------------------ - -#if ENABLED(SOFTWARE_SPI) - - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for ESP32. Use Hardware SPI." - -#else - -// ------------------------ -// Hardware SPI -// ------------------------ - -void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" - #endif - - OUT_WRITE(SS_PIN, HIGH); -} - -void spiInit(uint8_t spiRate) { - uint32_t clock; - - switch (spiRate) { - case SPI_FULL_SPEED: clock = 16000000; break; - case SPI_HALF_SPEED: clock = 8000000; break; - case SPI_QUARTER_SPEED: clock = 4000000; break; - case SPI_EIGHTH_SPEED: clock = 2000000; break; - case SPI_SIXTEENTH_SPEED: clock = 1000000; break; - case SPI_SPEED_5: clock = 500000; break; - case SPI_SPEED_6: clock = 250000; break; - default: clock = 1000000; // Default from the SPI library - } - - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; -} - -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - SPI.transferBytes(0, buf, nbyte); - SPI.endTransaction(); -} - -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); -} - -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPI.transfer(token); - SPI.writeBytes(const_cast(buf), 512); - SPI.endTransaction(); -} - -void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - spiConfig = SPISettings(spiClock, bitOrder, dataMode); - - SPI.beginTransaction(spiConfig); -} - -#endif // !SOFTWARE_SPI - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.cpp deleted file mode 100644 index 3c3b8fa704..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.cpp +++ /dev/null @@ -1,71 +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 . - * - */ -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#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() { - channel = channel_next_free++; -} - -int8_t Servo::attach(const int inPin) { - if (channel >= CHANNEL_MAX_NUM) return -1; - if (pin > 0) pin = inPin; - - ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth - ledcAttachPin(pin, channel); - return true; -} - -void Servo::detach() { ledcDetachPin(pin); } - -int Servo::read() { return degrees; } - -void Servo::write(int inDegrees) { - 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); -} - -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 (attach(0) >= 0) { - write(value); - safe_delay(servo_delay[channel]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif - } -} -#endif // HAS_SERVOS - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.h deleted file mode 100644 index 7b73ef0f3c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/Servo.h +++ /dev/null @@ -1,49 +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 - -#include - -class Servo { - static const int MIN_ANGLE = 0, - MAX_ANGLE = 180, - MIN_PULSE_WIDTH = 544, // Shortest pulse sent to a servo - MAX_PULSE_WIDTH = 2400, // Longest pulse sent to a servo - TAU_MSEC = 20, - TAU_USEC = (TAU_MSEC * 1000), - MAX_COMPARE = ((1 << 16) - 1), // 65535 - CHANNEL_MAX_NUM = 16; - -public: - Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - void detach(); - void write(int degrees); // set angle - void move(const int degrees); // attach the servo, then move to value - int read(); // returns current pulse width as an angle between 0 and 180 degrees - -private: - static int channel_next_free; - int channel; - int pin; - int degrees; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp deleted file mode 100644 index 9a38d3996a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp +++ /dev/null @@ -1,153 +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 . - * - */ -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(WIFISUPPORT) - -#include "WebSocketSerial.h" -#include "wifi.h" -#include - -WebSocketSerial webSocketSerial; -AsyncWebSocket ws("/ws"); // TODO Move inside the class. - -// RingBuffer impl - -#define NEXT_INDEX(I, SIZE) ((I + 1) & (ring_buffer_pos_t)(SIZE - 1)) - -RingBuffer::RingBuffer(ring_buffer_pos_t size) - : data(new uint8_t[size]), - size(size), - read_index(0), - write_index(0) -{} - -RingBuffer::~RingBuffer() { delete[] data; } - -ring_buffer_pos_t RingBuffer::write(const uint8_t c) { - const ring_buffer_pos_t n = NEXT_INDEX(write_index, size); - - if (n != read_index) { - this->data[write_index] = c; - write_index = n; - return 1; - } - - // TODO: buffer is full, handle? - return 0; -} - -ring_buffer_pos_t RingBuffer::write(const uint8_t *buffer, ring_buffer_pos_t size) { - ring_buffer_pos_t written = 0; - for (ring_buffer_pos_t i = 0; i < size; i++) { - written += write(buffer[i]); - } - return written; -} - -int RingBuffer::available() { - return (size - read_index + write_index) & (size - 1); -} - -int RingBuffer::peek() { - return available() ? data[read_index] : -1; -} - -int RingBuffer::read() { - if (available()) { - const int ret = data[read_index]; - read_index = NEXT_INDEX(read_index, size); - return ret; - } - return -1; -} - -ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) { - ring_buffer_pos_t len = available(); - - for(ring_buffer_pos_t i = 0; read_index != write_index; i++) { - buffer[i] = data[read_index]; - read_index = NEXT_INDEX(read_index, size); - } - - return len; -} - -void RingBuffer::flush() { read_index = write_index; } - -// WebSocketSerial impl -WebSocketSerial::WebSocketSerial() - : rx_buffer(RingBuffer(RX_BUFFER_SIZE)), - tx_buffer(RingBuffer(TX_BUFFER_SIZE)) -{} - -void WebSocketSerial::begin(const long baud_setting) { - ws.onEvent([this](AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) { - switch (type) { - case WS_EVT_CONNECT: client->ping(); break; // client connected - case WS_EVT_DISCONNECT: // client disconnected - case WS_EVT_ERROR: // error was received from the other end - case WS_EVT_PONG: break; // pong message was received (in response to a ping request maybe) - case WS_EVT_DATA: { // data packet - AwsFrameInfo * info = (AwsFrameInfo*)arg; - if (info->opcode == WS_TEXT || info->message_opcode == WS_TEXT) - this->rx_buffer.write(data, len); - } - } - }); - server.addHandler(&ws); -} - -void WebSocketSerial::end() { } -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); - - if (ret && c == '\n') { - uint8_t tmp[TX_BUFFER_SIZE]; - ring_buffer_pos_t size = tx_buffer.read(tmp); - ws.textAll(tmp, size); - } - - return ret; -} - -size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) { - size_t written = 0; - for(size_t i = 0; i < size; i++) { - written += write(buffer[i]); - } - return written; -} - -void WebSocketSerial::flushTX() { - // No need to do anything as there's no benefit to sending partial lines over the websocket connection. -} - -#endif // WIFISUPPORT -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h deleted file mode 100644 index 85436d151b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h +++ /dev/null @@ -1,84 +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 - -#include "../../inc/MarlinConfig.h" - -#include - -#ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 -#endif -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 -#endif -#if TX_BUFFER_SIZE <= 0 - #error "TX_BUFFER_SIZE is required for the WebSocket." -#endif - -typedef uint16_t ring_buffer_pos_t; - -class RingBuffer { - uint8_t *data; - ring_buffer_pos_t size, read_index, write_index; - -public: - RingBuffer(ring_buffer_pos_t size); - ~RingBuffer(); - - int available(); - int peek(); - int read(); - ring_buffer_pos_t read(uint8_t *buffer); - 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); -}; - -class WebSocketSerial: public Stream { - RingBuffer rx_buffer; - RingBuffer tx_buffer; - -public: - WebSocketSerial(); - void begin(const long); - void end(); - 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); - - operator bool() { return true; } - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - FORCE_INLINE uint32_t dropped() { return 0; } - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - FORCE_INLINE int rxMaxEnqueued() { return 0; } - #endif -}; - -extern WebSocketSerial webSocketSerial; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h deleted file mode 100644 index 31a3e4d667..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h +++ /dev/null @@ -1,78 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the stepper-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) - #if HAS_X_MAX - _ATTACH(X_MAX_PIN); - #endif - #if HAS_X_MIN - _ATTACH(X_MIN_PIN); - #endif - #if HAS_Y_MAX - _ATTACH(Y_MAX_PIN); - #endif - #if HAS_Y_MIN - _ATTACH(Y_MIN_PIN); - #endif - #if HAS_Z_MAX - _ATTACH(Z_MAX_PIN); - #endif - #if HAS_Z_MIN - _ATTACH(Z_MIN_PIN); - #endif - #if HAS_Z2_MAX - _ATTACH(Z2_MAX_PIN); - #endif - #if HAS_Z2_MIN - _ATTACH(Z2_MIN_PIN); - #endif - #if HAS_Z3_MAX - _ATTACH(Z3_MAX_PIN); - #endif - #if HAS_Z3_MIN - _ATTACH(Z3_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/fastio.h deleted file mode 100644 index 1641116b90..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/fastio.h +++ /dev/null @@ -1,84 +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 - -#include "i2s.h" - -/** - * Utility functions - */ - -// I2S expander pin mapping. -#define IS_I2S_EXPANDER_PIN(IO) TEST(IO, 7) -#define I2S_EXPANDER_PIN_INDEX(IO) (IO & 0x7F) - -// Set pin as input -#define _SET_INPUT(IO) pinMode(IO, INPUT) - -// Set pin as output -#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) - -// Set pin as input with pullup mode -#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT) - -// Read a pin wrapper -#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO)) - -// Write to a pin wrapper -#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v)) - -// Set pin as input wrapper -#define SET_INPUT(IO) _SET_INPUT(IO) - -// Set pin as input with pullup wrapper -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) - -// Set pin as output wrapper -#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0) - -// Set pin as PWM -#define SET_PWM(IO) SET_OUTPUT(IO) - -// Set pin as output and init -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -// PWM outputs -#define PWM_PIN(P) (P < 34 || P > 127) // NOTE Pins >= 34 are input only on ESP32, so they can't be used for output. - -// Toggle pin value -#define TOGGLE(IO) WRITE(IO, !READ(IO)) - -// -// Ports and functions -// - -// UART -#define RXD 3 -#define TXD 1 - -// TWI (I2C) -#define SCL 5 -#define SDA 4 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.cpp deleted file mode 100644 index 33a503455c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.cpp +++ /dev/null @@ -1,343 +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 . - * - */ -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfigPre.h" - -#include "i2s.h" - -#include "../shared/Marduino.h" -#include -#include -#include -#include -#include "../../module/stepper.h" - -#define DMA_BUF_COUNT 8 // number of DMA buffers to store data -#define DMA_BUF_LEN 4092 // maximum size in bytes -#define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample -#define DMA_SAMPLE_COUNT DMA_BUF_LEN / I2S_SAMPLE_SIZE // number of samples per buffer - -typedef enum { - I2S_NUM_0 = 0x0, /*!< I2S 0*/ - I2S_NUM_1 = 0x1, /*!< I2S 1*/ - I2S_NUM_MAX, -} i2s_port_t; - -typedef struct { - uint32_t **buffers; - uint32_t *current; - uint32_t rw_pos; - lldesc_t **desc; - xQueueHandle queue; -} i2s_dma_t; - -static portMUX_TYPE i2s_spinlock[I2S_NUM_MAX] = {portMUX_INITIALIZER_UNLOCKED, portMUX_INITIALIZER_UNLOCKED}; -static i2s_dev_t* I2S[I2S_NUM_MAX] = {&I2S0, &I2S1}; -static i2s_dma_t dma; - -// output value -uint32_t i2s_port_data = 0; - -#define I2S_ENTER_CRITICAL() portENTER_CRITICAL(&i2s_spinlock[i2s_num]) -#define I2S_EXIT_CRITICAL() portEXIT_CRITICAL(&i2s_spinlock[i2s_num]) - -static inline void gpio_matrix_out_check(uint32_t gpio, uint32_t signal_idx, bool out_inv, bool oen_inv) { - //if pin = -1, do not need to configure - if (gpio != -1) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO); - gpio_set_direction((gpio_num_t)gpio, (gpio_mode_t)GPIO_MODE_DEF_OUTPUT); - gpio_matrix_out(gpio, signal_idx, out_inv, oen_inv); - } -} - -static esp_err_t i2s_reset_fifo(i2s_port_t i2s_num) { - I2S_ENTER_CRITICAL(); - I2S[i2s_num]->conf.rx_fifo_reset = 1; - I2S[i2s_num]->conf.rx_fifo_reset = 0; - I2S[i2s_num]->conf.tx_fifo_reset = 1; - I2S[i2s_num]->conf.tx_fifo_reset = 0; - I2S_EXIT_CRITICAL(); - - return ESP_OK; -} - -esp_err_t i2s_start(i2s_port_t i2s_num) { - //start DMA link - I2S_ENTER_CRITICAL(); - i2s_reset_fifo(i2s_num); - - //reset dma - I2S[i2s_num]->lc_conf.in_rst = 1; - I2S[i2s_num]->lc_conf.in_rst = 0; - I2S[i2s_num]->lc_conf.out_rst = 1; - I2S[i2s_num]->lc_conf.out_rst = 0; - - I2S[i2s_num]->conf.tx_reset = 1; - I2S[i2s_num]->conf.tx_reset = 0; - I2S[i2s_num]->conf.rx_reset = 1; - I2S[i2s_num]->conf.rx_reset = 0; - - I2S[i2s_num]->int_clr.val = 0xFFFFFFFF; - I2S[i2s_num]->out_link.start = 1; - I2S[i2s_num]->conf.tx_start = 1; - I2S_EXIT_CRITICAL(); - - return ESP_OK; -} - -esp_err_t i2s_stop(i2s_port_t i2s_num) { - I2S_ENTER_CRITICAL(); - I2S[i2s_num]->out_link.stop = 1; - I2S[i2s_num]->conf.tx_start = 0; - - I2S[i2s_num]->int_clr.val = I2S[i2s_num]->int_st.val; //clear pending interrupt - I2S_EXIT_CRITICAL(); - - return ESP_OK; -} - -static void IRAM_ATTR i2s_intr_handler_default(void *arg) { - int dummy; - lldesc_t *finish_desc; - portBASE_TYPE high_priority_task_awoken = pdFALSE; - - if (I2S0.int_st.out_eof) { - // Get the descriptor of the last item in the linkedlist - finish_desc = (lldesc_t*) I2S0.out_eof_des_addr; - - // If the queue is full it's because we have an underflow, - // more than buf_count isr without new data, remove the front buffer - if (xQueueIsQueueFullFromISR(dma.queue)) - xQueueReceiveFromISR(dma.queue, &dummy, &high_priority_task_awoken); - - xQueueSendFromISR(dma.queue, (void *)(&finish_desc->buf), &high_priority_task_awoken); - } - - if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR(); - - // clear interrupt - I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt -} - -void stepperTask(void* parameter) { - uint32_t remaining = 0; - - while (1) { - xQueueReceive(dma.queue, &dma.current, portMAX_DELAY); - dma.rw_pos = 0; - - while (dma.rw_pos < DMA_SAMPLE_COUNT) { - // Fill with the port data post pulse_phase until the next step - if (remaining) { - i2s_push_sample(); - remaining--; - } - else { - Stepper::stepper_pulse_phase_isr(); - remaining = Stepper::stepper_block_phase_isr(); - } - } - } -} - -int i2s_init() { - periph_module_enable(PERIPH_I2S0_MODULE); - - /** - * Each i2s transfer will take - * fpll = PLL_D2_CLK -- clka_en = 0 - * - * fi2s = fpll / N + b/a -- N = clkm_div_num - * fi2s = 160MHz / 2 - * fi2s = 80MHz - * - * fbclk = fi2s / M -- M = tx_bck_div_num - * fbclk = 80MHz / 2 - * fbclk = 40MHz - * - * fwclk = fbclk / 32 - * - * for fwclk = 250kHz (4uS pulse time) - * N = 10 - * M = 20 - */ - - // Allocate the array of pointers to the buffers - dma.buffers = (uint32_t **)malloc(sizeof(uint32_t*) * DMA_BUF_COUNT); - if (dma.buffers == nullptr) return -1; - - // Allocate each buffer that can be used by the DMA controller - for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) { - dma.buffers[buf_idx] = (uint32_t*) heap_caps_calloc(1, DMA_BUF_LEN, MALLOC_CAP_DMA); - if (dma.buffers[buf_idx] == nullptr) return -1; - } - - // Allocate the array of DMA descriptors - dma.desc = (lldesc_t**) malloc(sizeof(lldesc_t*) * DMA_BUF_COUNT); - if (dma.desc == nullptr) return -1; - - // Allocate each DMA descriptor that will be used by the DMA controller - for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) { - dma.desc[buf_idx] = (lldesc_t*) heap_caps_malloc(sizeof(lldesc_t), MALLOC_CAP_DMA); - if (dma.desc[buf_idx] == nullptr) return -1; - } - - // Initialize - for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) { - dma.desc[buf_idx]->owner = 1; - dma.desc[buf_idx]->eof = 1; // set to 1 will trigger the interrupt - dma.desc[buf_idx]->sosf = 0; - dma.desc[buf_idx]->length = DMA_BUF_LEN; - dma.desc[buf_idx]->size = DMA_BUF_LEN; - dma.desc[buf_idx]->buf = (uint8_t *) dma.buffers[buf_idx]; - dma.desc[buf_idx]->offset = 0; - dma.desc[buf_idx]->empty = (uint32_t)((buf_idx < (DMA_BUF_COUNT - 1)) ? (dma.desc[buf_idx + 1]) : dma.desc[0]); - } - - dma.queue = xQueueCreate(DMA_BUF_COUNT, sizeof(uint32_t *)); - - // Set the first DMA descriptor - I2S0.out_link.addr = (uint32_t)dma.desc[0]; - - // stop i2s - i2s_stop(I2S_NUM_0); - - // configure I2S data port interface. - i2s_reset_fifo(I2S_NUM_0); - - //reset i2s - I2S0.conf.tx_reset = 1; - I2S0.conf.tx_reset = 0; - I2S0.conf.rx_reset = 1; - I2S0.conf.rx_reset = 0; - - //reset dma - I2S0.lc_conf.in_rst = 1; - I2S0.lc_conf.in_rst = 0; - I2S0.lc_conf.out_rst = 1; - I2S0.lc_conf.out_rst = 0; - - //Enable and configure DMA - I2S0.lc_conf.check_owner = 0; - I2S0.lc_conf.out_loop_test = 0; - I2S0.lc_conf.out_auto_wrback = 0; - I2S0.lc_conf.out_data_burst_en = 0; - I2S0.lc_conf.outdscr_burst_en = 0; - I2S0.lc_conf.out_no_restart_clr = 0; - I2S0.lc_conf.indscr_burst_en = 0; - I2S0.lc_conf.out_eof_mode = 1; - - I2S0.conf2.lcd_en = 0; - I2S0.conf2.camera_en = 0; - I2S0.pdm_conf.pcm2pdm_conv_en = 0; - I2S0.pdm_conf.pdm2pcm_conv_en = 0; - - I2S0.fifo_conf.dscr_en = 0; - - I2S0.conf_chan.tx_chan_mod = ( - #if ENABLED(I2S_STEPPER_SPLIT_STREAM) - 4 - #else - 0 - #endif - ); - I2S0.fifo_conf.tx_fifo_mod = 0; - I2S0.conf.tx_mono = 0; - - I2S0.conf_chan.rx_chan_mod = 0; - I2S0.fifo_conf.rx_fifo_mod = 0; - I2S0.conf.rx_mono = 0; - - I2S0.fifo_conf.dscr_en = 1; //connect dma to fifo - - I2S0.conf.tx_start = 0; - I2S0.conf.rx_start = 0; - - I2S0.conf.tx_msb_right = 1; - I2S0.conf.tx_right_first = 1; - - I2S0.conf.tx_slave_mod = 0; // Master - I2S0.fifo_conf.tx_fifo_mod_force_en = 1; - - I2S0.pdm_conf.rx_pdm_en = 0; - I2S0.pdm_conf.tx_pdm_en = 0; - - I2S0.conf.tx_short_sync = 0; - I2S0.conf.rx_short_sync = 0; - I2S0.conf.tx_msb_shift = 0; - I2S0.conf.rx_msb_shift = 0; - - // set clock - I2S0.clkm_conf.clka_en = 0; // Use PLL/2 as reference - I2S0.clkm_conf.clkm_div_num = 10; // minimum value of 2, reset value of 4, max 256 - I2S0.clkm_conf.clkm_div_a = 0; // 0 at reset, what about divide by 0? (not an issue) - I2S0.clkm_conf.clkm_div_b = 0; // 0 at reset - - // fbck = fi2s / tx_bck_div_num - I2S0.sample_rate_conf.tx_bck_div_num = 2; // minimum value of 2 defaults to 6 - - // Enable TX interrupts - I2S0.int_ena.out_eof = 1; - I2S0.int_ena.out_dscr_err = 0; - I2S0.int_ena.out_total_eof = 0; - I2S0.int_ena.out_done = 0; - - // Allocate and Enable the I2S interrupt - intr_handle_t i2s_isr_handle; - esp_intr_alloc(ETS_I2S0_INTR_SOURCE, 0, i2s_intr_handler_default, nullptr, &i2s_isr_handle); - esp_intr_enable(i2s_isr_handle); - - // Create the task that will feed the buffer - xTaskCreate(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr); - - // Route the i2s pins to the appropriate GPIO - gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0); - gpio_matrix_out_check(I2S_BCK, I2S0O_BCK_OUT_IDX, 0, 0); - gpio_matrix_out_check(I2S_WS, I2S0O_WS_OUT_IDX, 0, 0); - - // Start the I2S peripheral - return i2s_start(I2S_NUM_0); -} - -void i2s_write(uint8_t pin, uint8_t val) { - #if ENABLED(I2S_STEPPER_SPLIT_STREAM) - if (pin >= 16) { - SET_BIT_TO(I2S0.conf_single_data, pin, val); - return; - } - #endif - SET_BIT_TO(i2s_port_data, pin, val); -} - -uint8_t i2s_state(uint8_t pin) { - #if ENABLED(I2S_STEPPER_SPLIT_STREAM) - if (pin >= 16) return TEST(I2S0.conf_single_data, pin); - #endif - return TEST(i2s_port_data, pin); -} - -void i2s_push_sample() { - dma.current[dma.rw_pos++] = i2s_port_data; -} - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.h deleted file mode 100644 index 971405a343..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/i2s.h +++ /dev/null @@ -1,35 +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 - -#include - -// current value of the outputs provided over i2s -extern uint32_t i2s_port_data; - -int i2s_init(); - -uint8_t i2s_state(uint8_t pin); - -void i2s_write(uint8_t pin, uint8_t val); - -void i2s_push_sample(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h deleted file mode 100644 index 9c62a353e7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h +++ /dev/null @@ -1,30 +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 - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for ESP32. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.cpp deleted file mode 100644 index 377856f8d8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 . - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(OTASUPPORT) - -#include -#include -#include -#include -#include - -void OTA_init() { - ArduinoOTA - .onStart([]() { - timer_pause(TIMER_GROUP_0, TIMER_0); - timer_pause(TIMER_GROUP_0, TIMER_1); - - // U_FLASH or U_SPIFFS - String type = (ArduinoOTA.getCommand() == U_FLASH) ? "sketch" : "filesystem"; - - // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() - Serial.println("Start updating " + type); - }) - .onEnd([]() { - Serial.println("\nEnd"); - }) - .onProgress([](unsigned int progress, unsigned int total) { - Serial.printf("Progress: %u%%\r", (progress / (total / 100))); - }) - .onError([](ota_error_t error) { - Serial.printf("Error[%u]: ", error); - char *str; - switch (error) { - case OTA_AUTH_ERROR: str = "Auth Failed"; break; - case OTA_BEGIN_ERROR: str = "Begin Failed"; break; - case OTA_CONNECT_ERROR: str = "Connect Failed"; break; - case OTA_RECEIVE_ERROR: str = "Receive Failed"; break; - case OTA_END_ERROR: str = "End Failed"; break; - } - Serial.println(str); - }); - - ArduinoOTA.begin(); -} - -void OTA_handle() { - ArduinoOTA.handle(); -} - -#endif // OTASUPPORT - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.h deleted file mode 100644 index 7e89e93ce2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/ota.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -void OTA_init(); -void OTA_handle(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp deleted file mode 100644 index 5227da3568..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp +++ /dev/null @@ -1,106 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION) - -#include "../shared/persistent_store_api.h" - -#include -#include -#include "spiffs.h" - -#define HAL_ESP32_EEPROM_SIZE 4096 -#define HAL_ESP32_EEPROM_FILE_PATH "/eeprom.dat" - -File eeprom_file; - -bool PersistentStore::access_start() { - if (spiffs_initialized) { - eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "r+"); - - size_t file_size = eeprom_file.size(); - if (file_size < HAL_ESP32_EEPROM_SIZE) { - SERIAL_ECHO_MSG("SPIFFS EEPROM settings file " HAL_ESP32_EEPROM_FILE_PATH " is too small or did not exist, expanding."); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" file size: ", file_size, ", required size: ", HAL_ESP32_EEPROM_SIZE); - - // mode r+ does not allow to expand the file (at least on ESP32 SPIFFS9, so we close, reopen "a", append, close, reopen "r+" - eeprom_file.close(); - - eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "a"); - for (size_t i = eeprom_file.size(); i < HAL_ESP32_EEPROM_SIZE; i++) - eeprom_file.write(0xFF); - eeprom_file.close(); - - eeprom_file = SPIFFS.open(HAL_ESP32_EEPROM_FILE_PATH, "r+"); - file_size = eeprom_file.size(); - if (file_size < HAL_ESP32_EEPROM_SIZE) { - SERIAL_ERROR_MSG("Failed to expand " HAL_ESP32_EEPROM_FILE_PATH " to required size. SPIFFS partition full?"); - SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(" file size: ", file_size, ", required size: ", HAL_ESP32_EEPROM_SIZE); - SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(" SPIFFS used bytes: ", SPIFFS.usedBytes(), ", total bytes: ", SPIFFS.totalBytes()); - } - } - return true; - } - return false; -} - -bool PersistentStore::access_finish() { - eeprom_file.close(); - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - if (!eeprom_file.seek(pos)) return true; // return true for any error - if (eeprom_file.write(value, size) != size) return true; - - crc16(crc, value, size); - pos += size; - - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - if (!eeprom_file.seek(pos)) return true; // return true for any error - - if (writing) { - if (eeprom_file.read(value, size) != size) return true; - crc16(crc, value, size); - } - else { - uint8_t tmp[size]; - if (eeprom_file.read(tmp, size) != size) return true; - crc16(crc, tmp, size); - } - - pos += size; - - return false; -} - -size_t PersistentStore::capacity() { return HAL_ESP32_EEPROM_SIZE; } - -#endif // EEPROM_SETTINGS -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/servotimers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/servotimers.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/servotimers.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spi_pins.h deleted file mode 100644 index 03ab215224..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spi_pins.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 - -#define SS_PIN SDSS -#define SCK_PIN 18 -#define MISO_PIN 19 -#define MOSI_PIN 23 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.cpp deleted file mode 100644 index a3e1bd8a25..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.cpp +++ /dev/null @@ -1,44 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfigPre.h" - -#if EITHER(WEBSUPPORT, EEPROM_SETTINGS) - -#include "../../core/serial.h" - -#include -#include - -bool spiffs_initialized; - -void spiffs_init() { - if (SPIFFS.begin(true)) // formatOnFail = true - spiffs_initialized = true; - else - SERIAL_ERROR_MSG("SPIFFS mount failed"); -} - -#endif // WEBSUPPORT -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.h deleted file mode 100644 index 8a1ee2f191..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/spiffs.h +++ /dev/null @@ -1,26 +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 - -extern bool spiffs_initialized; - -void spiffs_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.cpp deleted file mode 100644 index 543889760e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.cpp +++ /dev/null @@ -1,174 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include -#include -#include -#include -#include - -#include "HAL.h" - -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 4 - -// ------------------------ -// Private Variables -// ------------------------ - -static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1}; - -const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { - { TIMER_GROUP_0, TIMER_0, STEPPER_TIMER_PRESCALE, stepTC_Handler }, // 0 - Stepper - { TIMER_GROUP_0, TIMER_1, TEMP_TIMER_PRESCALE, tempTC_Handler }, // 1 - Temperature - { TIMER_GROUP_1, TIMER_0, PWM_TIMER_PRESCALE, pwmTC_Handler }, // 2 - PWM - { TIMER_GROUP_1, TIMER_1, 1, nullptr }, // 3 -}; - -// ------------------------ -// Public functions -// ------------------------ - -void IRAM_ATTR timer_isr(void *para) { - const tTimerConfig& timer = TimerConfig[(int)para]; - - // Retrieve the interrupt status and the counter value - // from the timer that reported the interrupt - uint32_t intr_status = TG[timer.group]->int_st_timers.val; - TG[timer.group]->hw_timer[timer.idx].update = 1; - - // Clear the interrupt - if (intr_status & BIT(timer.idx)) { - switch (timer.idx) { - case TIMER_0: TG[timer.group]->int_clr_timers.t0 = 1; break; - case TIMER_1: TG[timer.group]->int_clr_timers.t1 = 1; break; - case TIMER_MAX: break; - } - } - - timer.fn(); - - // After the alarm has been triggered - // Enable it again so it gets triggered the next time - TG[timer.group]->hw_timer[timer.idx].config.alarm_en = TIMER_ALARM_EN; -} - -/** - * Enable and initialize the timer - * @param timer_num timer number to initialize - * @param frequency frequency of the timer - */ -void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) { - const tTimerConfig timer = TimerConfig[timer_num]; - - timer_config_t config; - config.divider = timer.divider; - config.counter_dir = TIMER_COUNT_UP; - config.counter_en = TIMER_PAUSE; - config.alarm_en = TIMER_ALARM_EN; - config.intr_type = TIMER_INTR_LEVEL; - config.auto_reload = true; - - // Select and initialize the timer - timer_init(timer.group, timer.idx, &config); - - // Timer counter initial value and auto reload on alarm - timer_set_counter_value(timer.group, timer.idx, 0x00000000ULL); - - // Configure the alam value and the interrupt on alarm - timer_set_alarm_value(timer.group, timer.idx, (HAL_TIMER_RATE) / timer.divider / frequency - 1); - - timer_enable_intr(timer.group, timer.idx); - - timer_isr_register(timer.group, timer.idx, timer_isr, (void*)timer_num, 0, nullptr); - - timer_start(timer.group, timer.idx); -} - -/** - * Set the upper value of the timer, when the timer reaches this upper value the - * interrupt should be triggered and the counter reset - * @param timer_num timer number to set the count to - * @param count threshold at which the interrupt is triggered - */ -void HAL_timer_set_compare(const uint8_t timer_num, hal_timer_t count) { - const tTimerConfig timer = TimerConfig[timer_num]; - timer_set_alarm_value(timer.group, timer.idx, count); -} - -/** - * Get the current upper value of the timer - * @param timer_num timer number to get the count from - * @return the timer current threshold for the alarm to be triggered - */ -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - const tTimerConfig timer = TimerConfig[timer_num]; - - uint64_t alarm_value; - timer_get_alarm_value(timer.group, timer.idx, &alarm_value); - - return alarm_value; -} - -/** - * Get the current counter value between 0 and the maximum count (HAL_timer_set_count) - * @param timer_num timer number to get the current count - * @return the current counter of the alarm - */ -hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - const tTimerConfig timer = TimerConfig[timer_num]; - uint64_t counter_value; - timer_get_counter_value(timer.group, timer.idx, &counter_value); - return counter_value; -} - -/** - * Enable timer interrupt on the timer - * @param timer_num timer number to enable interrupts on - */ -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - //const tTimerConfig timer = TimerConfig[timer_num]; - //timer_enable_intr(timer.group, timer.idx); -} - -/** - * Disable timer interrupt on the timer - * @param timer_num timer number to disable interrupts on - */ -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - //const tTimerConfig timer = TimerConfig[timer_num]; - //timer_disable_intr(timer.group, timer.idx); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - const tTimerConfig timer = TimerConfig[timer_num]; - return TG[timer.group]->int_ena.val | BIT(timer_num); -} - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.h deleted file mode 100644 index e6e3495bea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/timers.h +++ /dev/null @@ -1,121 +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 - -#include -#include - -// Includes needed to get I2S_STEPPER_STREAM. Note that pins.h -// is included in case this header is being included early. -#include "../../inc/MarlinConfig.h" -#include "../../pins/pins.h" - -// ------------------------ -// Defines -// ------------------------ -// -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint64_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFFULL - -#define STEP_TIMER_NUM 0 // index of timer to use for stepper -#define TEMP_TIMER_NUM 1 // index of timer to use for temperature -#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals - -#if ENABLED(I2S_STEPPER_STREAM) - #define STEPPER_TIMER_PRESCALE 1 - #define STEPPER_TIMER_RATE 250000 // 250khz, 4us pulses of i2s word clock - #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25 -#else - #define STEPPER_TIMER_PRESCALE 40 - #define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz - #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs -#endif - -#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts - -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define PWM_TIMER_PRESCALE 10 -#if ENABLED(FAST_PWM_FAN) - #define PWM_TIMER_FREQUENCY FAST_PWM_FAN_FREQUENCY -#else - #define PWM_TIMER_FREQUENCY (50*128) // 50Hz and 7bit resolution -#endif -#define MAX_PWM_PINS 32 // Number of PWM pin-slots - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#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() -#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(); -extern "C" void stepTC_Handler(); -extern "C" void pwmTC_Handler(); - -// ------------------------ -// Types -// ------------------------ - -typedef struct { - timer_group_t group; - timer_idx_t idx; - uint32_t divider; - void (*fn)(); -} tTimerConfig; - -// ------------------------ -// Public Variables -// ------------------------ - -extern const tTimerConfig TimerConfig[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start (const uint8_t timer_num, uint32_t frequency); -void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t count); -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num); -hal_timer_t HAL_timer_get_count(const uint8_t timer_num); - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.cpp deleted file mode 100644 index d05e67c856..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.cpp +++ /dev/null @@ -1,41 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -void watchdogSetup() { - // do whatever. don't remove this function. -} - -void watchdog_init() { - // TODO -} - -#endif // USE_WATCHDOG - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.h deleted file mode 100644 index 6647ecefe6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/watchdog.h +++ /dev/null @@ -1,28 +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 - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. -inline void HAL_watchdog_refresh() {} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.cpp deleted file mode 100644 index c593fc0242..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.cpp +++ /dev/null @@ -1,47 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include -#undef DISABLED // esp32-hal-gpio.h - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(WEBSUPPORT) - -#include "wifi.h" - -AsyncEventSource events("/events"); // event source (Server-Sent events) - -void onNotFound(AsyncWebServerRequest *request) { - request->send(404); -} - -void web_init() { - server.addHandler(&events); // attach AsyncEventSource - server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html"); - server.onNotFound(onNotFound); -} - -#endif // WEBSUPPORT -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.h deleted file mode 100644 index d1d91b9c0f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/web.h +++ /dev/null @@ -1,24 +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 - -void web_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.cpp deleted file mode 100644 index 19f1d8fb85..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.cpp +++ /dev/null @@ -1,67 +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 . - * - */ - -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../core/serial.h" -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(WIFISUPPORT) - -#include -#include -#include -#include "wifi.h" - -AsyncWebServer server(80); - -#ifndef WIFI_HOSTNAME - #define WIFI_HOSTNAME DEFAULT_WIFI_HOSTNAME -#endif - -void wifi_init() { - - SERIAL_ECHO_MSG("Starting WiFi..."); - - WiFi.mode(WIFI_STA); - WiFi.begin(WIFI_SSID, WIFI_PWD); - - while (WiFi.waitForConnectResult() != WL_CONNECTED) { - SERIAL_ERROR_MSG("Unable to connect to WiFi with SSID '" WIFI_SSID "', restarting."); - delay(5000); - ESP.restart(); - } - - delay(10); - if (!MDNS.begin(WIFI_HOSTNAME)) { - SERIAL_ERROR_MSG("Unable to start mDNS with hostname '" WIFI_HOSTNAME "', restarting."); - delay(5000); - ESP.restart(); - } - - MDNS.addService("http", "tcp", 80); - - SERIAL_ECHOLNPAIR("Successfully connected to WiFi with SSID '" WIFI_SSID "', hostname: '" WIFI_HOSTNAME "', IP address: ", WiFi.localIP().toString().c_str()); -} - -#endif // WIFISUPPORT -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.h deleted file mode 100644 index 4cd656cb33..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_ESP32/wifi.h +++ /dev/null @@ -1,30 +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 - -#include - -extern AsyncWebServer server; - -#define DEFAULT_WIFI_HOSTNAME "marlin" - -void wifi_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.cpp deleted file mode 100644 index 316f6b452a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.cpp +++ /dev/null @@ -1,82 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "../../inc/MarlinConfig.h" -#include "../shared/Delay.h" - -HalSerial usb_serial; - -// U8glib required functions -extern "C" void u8g_xMicroDelay(uint16_t val) { - DELAY_US(val); -} -extern "C" void u8g_MicroDelay() { - u8g_xMicroDelay(1); -} -extern "C" void u8g_10MicroDelay() { - u8g_xMicroDelay(10); -} -extern "C" void u8g_Delay(uint16_t val) { - delay(val); -} -//************************// - -// return free heap space -int freeMemory() { - return 0; -} - -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_init() { - -} - -void HAL_adc_enable_channel(int ch) { - -} - -uint8_t active_ch = 0; -void HAL_adc_start_conversion(const uint8_t ch) { - active_ch = ch; -} - -bool HAL_adc_finished() { - return true; -} - -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() { - -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.h deleted file mode 100644 index 37b3b479bc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/HAL.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -#define CPU_32_BIT - -#define F_CPU 100000000 -#define SystemCoreClock F_CPU -#include -#include -#include - -#undef min -#undef max - -#include - -void _printf (const char *format, ...); -void _putc(uint8_t c); -uint8_t _getc(); - -//extern "C" volatile uint32_t _millis; - -//arduino: Print.h -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 -//arduino: binary.h (weird defines) -#define B01 1 -#define B10 2 - -#include "hardware/Clock.h" - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "timers.h" -#include "serial.h" - -#define SHARED_SERVOS HAS_SERVOS - -extern HalSerial usb_serial; -#define MYSERIAL0 usb_serial -#define NUM_SERIAL 1 - -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) - -// -// Interrupts -// -#define CRITICAL_SECTION_START -#define CRITICAL_SECTION_END -#define ISRS_ENABLED() -#define ENABLE_ISRS() -#define DISABLE_ISRS() - -inline void HAL_init() {} - -// Utility functions -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(); -#pragma GCC diagnostic pop - -// ADC -#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin) -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true - -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(); - -// Reset source -inline void HAL_clear_reset_source(void) {} -inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } - -/* ---------------- Delay in cycles */ -FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { - Clock::delayCycles(x); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/arduino.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/arduino.cpp deleted file mode 100644 index 88128dd91a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/arduino.cpp +++ /dev/null @@ -1,116 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include -#include "../../inc/MarlinConfig.h" -#include "hardware/Clock.h" -#include "../shared/Delay.h" - -// Interrupts -void cli() { } // Disable -void sei() { } // Enable - -// Time functions -void _delay_ms(const int delay_ms) { - delay(delay_ms); -} - -uint32_t millis() { - return (uint32_t)Clock::millis(); -} - -// This is required for some Arduino libraries we are using -void delayMicroseconds(uint32_t us) { - Clock::delayMicros(us); -} - -extern "C" void delay(const int msec) { - Clock::delayMillis(msec); -} - -// IO functions -// As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2) -void pinMode(const pin_t pin, const uint8_t mode) { - if (!VALID_PIN(pin)) return; - Gpio::setMode(pin, mode); -} - -void digitalWrite(pin_t pin, uint8_t pin_status) { - if (!VALID_PIN(pin)) return; - Gpio::set(pin, pin_status); -} - -bool digitalRead(pin_t pin) { - if (!VALID_PIN(pin)) return false; - return Gpio::get(pin); -} - -void analogWrite(pin_t pin, int pwm_value) { // 1 - 254: pwm_value, 0: LOW, 255: HIGH - if (!VALID_PIN(pin)) return; - Gpio::set(pin, pwm_value); -} - -uint16_t analogRead(pin_t adc_pin) { - if (!VALID_PIN(DIGITAL_PIN_TO_ANALOG_PIN(adc_pin))) return 0; - return Gpio::get(DIGITAL_PIN_TO_ANALOG_PIN(adc_pin)); -} - -// ************************** -// Persistent Config Storage -// ************************** - -void eeprom_write_byte(unsigned char *pos, unsigned char value) { - -} - -unsigned char eeprom_read_byte(uint8_t * pos) { return '\0'; } - -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 format_string[20]; - snprintf(format_string, 20, "%%%d.%df", __width, __prec); - sprintf(__s, format_string, __val); - return __s; -} - -int32_t random(int32_t max) { - return rand() % max; -} - -int32_t random(int32_t min, int32_t max) { - return min + rand() % (max - min); -} - -void randomSeed(uint32_t value) { - srand(value); -} - -int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/fastio.h deleted file mode 100644 index 5c2d6fcb7e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/fastio.h +++ /dev/null @@ -1,111 +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 - -/** - * Fast I/O Routines for X86_64 - */ - -#include "../shared/Marduino.h" -#include - -#define SET_DIR_INPUT(IO) Gpio::setDir(IO, 1) -#define SET_DIR_OUTPUT(IO) Gpio::setDir(IO, 0) - -#define SET_MODE(IO, mode) Gpio::setMode(IO, mode) - -#define WRITE_PIN_SET(IO) Gpio::set(IO) -#define WRITE_PIN_CLR(IO) Gpio::clear(IO) - -#define READ_PIN(IO) Gpio::get(IO) -#define WRITE_PIN(IO,V) Gpio::set(IO, V) - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -/// Read a pin -#define _READ(IO) READ_PIN(IO) - -/// Write to a pin -#define _WRITE(IO,V) WRITE_PIN(IO,V) - -/// toggle a pin -#define _TOGGLE(IO) _WRITE(IO, !READ(IO)) - -/// set pin as input -#define _SET_INPUT(IO) SET_DIR_INPUT(IO) - -/// set pin as output -#define _SET_OUTPUT(IO) SET_DIR_OUTPUT(IO) - -/// set pin as input with pullup mode -#define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT) - -/// set pin as input with pulldown mode -#define _PULLDOWN(IO,V) pinMode(IO, (V) ? INPUT_PULLDOWN : INPUT) - -// hg42: all pins can be input or output (I hope) -// hg42: undefined pins create compile error (IO, is no pin) -// hg42: currently not used, but was used by pinsDebug - -/// check if pin is an input -#define _IS_INPUT(IO) (LPC1768_PIN_PIN(IO) >= 0) - -/// check if pin is an output -#define _IS_OUTPUT(IO) (LPC1768_PIN_PIN(IO) >= 0) - -/// Read a pin wrapper -#define READ(IO) _READ(IO) - -/// Write to a pin wrapper -#define WRITE(IO,V) _WRITE(IO,V) - -/// toggle a pin wrapper -#define TOGGLE(IO) _TOGGLE(IO) - -/// set pin as input wrapper -#define SET_INPUT(IO) _SET_INPUT(IO) -/// set pin as input with pullup wrapper -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) -/// set pin as input with pulldown wrapper -#define SET_INPUT_PULLDOWN(IO) do{ _SET_INPUT(IO); _PULLDOWN(IO, HIGH); }while(0) -/// set pin as output wrapper - reads the pin and sets the output to that value -#define SET_OUTPUT(IO) do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0) -// set pin as PWM -#define SET_PWM(IO) SET_OUTPUT(IO) - -/// check if pin is an input wrapper -#define IS_INPUT(IO) _IS_INPUT(IO) -/// check if pin is an output wrapper -#define IS_OUTPUT(IO) _IS_OUTPUT(IO) - -// Shorthand -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp deleted file mode 100644 index 39dd3d1b3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp +++ /dev/null @@ -1,32 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "../../../inc/MarlinConfig.h" -#include "Clock.h" - -std::chrono::nanoseconds Clock::startup = std::chrono::high_resolution_clock::now().time_since_epoch(); -uint32_t Clock::frequency = F_CPU; -double Clock::time_multiplier = 1.0; - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h deleted file mode 100644 index e61051a0a3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h +++ /dev/null @@ -1,89 +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 - -#include -#include - -class Clock { -public: - static uint64_t ticks(uint32_t frequency = Clock::frequency) { - return (Clock::nanos() - Clock::startup.count()) / (1000000000ULL / frequency); - } - - static uint64_t nanosToTicks(uint64_t ns, uint32_t frequency = Clock::frequency) { - return ns / (1000000000ULL / frequency); - } - - // Time acceleration compensated - static uint64_t ticksToNanos(uint64_t tick, uint32_t frequency = Clock::frequency) { - return (tick * (1000000000ULL / frequency)) / Clock::time_multiplier; - } - - static void setFrequency(uint32_t freq) { - Clock::frequency = freq; - } - - // Time Acceleration compensated - static uint64_t nanos() { - auto now = std::chrono::high_resolution_clock::now().time_since_epoch(); - return (now.count() - Clock::startup.count()) * Clock::time_multiplier; - } - - static uint64_t micros() { - return Clock::nanos() / 1000; - } - - static uint64_t millis() { - return Clock::micros() / 1000; - } - - static double seconds() { - return Clock::nanos() / 1000000000.0; - } - - static void delayCycles(uint64_t cycles) { - std::this_thread::sleep_for(std::chrono::nanoseconds( (1000000000L / frequency) * cycles) / Clock::time_multiplier ); - } - - static void delayMicros(uint64_t micros) { - std::this_thread::sleep_for(std::chrono::microseconds( micros ) / Clock::time_multiplier); - } - - static void delayMillis(uint64_t millis) { - std::this_thread::sleep_for(std::chrono::milliseconds( millis ) / Clock::time_multiplier); - } - - static void delaySeconds(double secs) { - std::this_thread::sleep_for(std::chrono::duration(secs * 1000) / Clock::time_multiplier); - } - - // Will reduce timer resolution increasing likelihood of overflows - static void setTimeMultiplier(double tm) { - Clock::time_multiplier = tm; - } - -private: - static std::chrono::nanoseconds startup; - static uint32_t frequency; - static double time_multiplier; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp deleted file mode 100644 index aced728172..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp +++ /dev/null @@ -1,30 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "Gpio.h" - -pin_data Gpio::pin_map[Gpio::pin_count+1] = {}; -IOLogger* Gpio::logger = nullptr; - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h deleted file mode 100644 index 37f3bc7a44..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h +++ /dev/null @@ -1,141 +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 - -#include "Clock.h" -#include "../../../inc/MarlinConfigPre.h" -#include - -typedef int16_t pin_type; - -struct GpioEvent { - enum Type { - NOP, - FALL, - RISE, - SET_VALUE, - SETM, - SETD - }; - uint64_t timestamp; - pin_type pin_id; - GpioEvent::Type event; - - GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event){ - this->timestamp = timestamp; - this->pin_id = pin_id; - this->event = event; - } -}; - -class IOLogger { -public: - virtual ~IOLogger(){}; - virtual void log(GpioEvent ev) = 0; -}; - -class Peripheral { -public: - virtual ~Peripheral(){}; - virtual void interrupt(GpioEvent ev) = 0; - virtual void update() = 0; -}; - -struct pin_data { - uint8_t dir; - uint8_t mode; - uint16_t value; - Peripheral* cb; -}; - -class Gpio { -public: - - static const pin_type pin_count = 255; - static pin_data pin_map[pin_count+1]; - - static bool valid_pin(pin_type pin) { - return pin >= 0 && pin <= pin_count; - } - - static void set(pin_type pin) { - set(pin, 1); - } - - static void set(pin_type pin, uint16_t value) { - if (!valid_pin(pin)) return; - GpioEvent::Type evt_type = value > 1 ? GpioEvent::SET_VALUE : value > pin_map[pin].value ? GpioEvent::RISE : value < pin_map[pin].value ? GpioEvent::FALL : GpioEvent::NOP; - pin_map[pin].value = value; - GpioEvent evt(Clock::nanos(), pin, evt_type); - if (pin_map[pin].cb != nullptr) { - pin_map[pin].cb->interrupt(evt); - } - if (Gpio::logger != nullptr) Gpio::logger->log(evt); - } - - static uint16_t get(pin_type pin) { - if (!valid_pin(pin)) return 0; - return pin_map[pin].value; - } - - static void clear(pin_type pin) { - set(pin, 0); - } - - static void setMode(pin_type pin, uint8_t value) { - if (!valid_pin(pin)) return; - pin_map[pin].mode = value; - GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETM); - if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt); - if (Gpio::logger != nullptr) Gpio::logger->log(evt); - } - - static uint8_t getMode(pin_type pin) { - if (!valid_pin(pin)) return 0; - return pin_map[pin].mode; - } - - static void setDir(pin_type pin, uint8_t value) { - if (!valid_pin(pin)) return; - pin_map[pin].dir = value; - GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETD); - if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt); - if (Gpio::logger != nullptr) Gpio::logger->log(evt); - } - - static uint8_t getDir(pin_type pin) { - if (!valid_pin(pin)) return 0; - return pin_map[pin].dir; - } - - static void attachPeripheral(pin_type pin, Peripheral* per) { - if (!valid_pin(pin)) return; - pin_map[pin].cb = per; - } - - static void attachLogger(IOLogger* logger) { - Gpio::logger = logger; - } - -private: - static IOLogger* logger; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp deleted file mode 100644 index 59da64d337..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp +++ /dev/null @@ -1,61 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "Clock.h" -#include -#include "../../../inc/MarlinConfig.h" - -#include "Heater.h" - -Heater::Heater(pin_t heater, pin_t adc) { - heater_state = 0; - room_temp_raw = 150; - last = Clock::micros(); - heater_pin = heater; - adc_pin = adc; - heat = 0.0; -} - -Heater::~Heater() { -} - -void Heater::update() { - // crude pwm read and cruder heat simulation - auto now = Clock::micros(); - double delta = (now - last); - if (delta > 1000 ) { - heater_state = pwmcap.update(0xFFFF * Gpio::pin_map[heater_pin].value); - last = now; - heat += (heater_state - heat) * (delta / 1000000000.0); - - NOLESS(heat, room_temp_raw); - Gpio::pin_map[analogInputToDigitalPin(adc_pin)].value = 0xFFFF - (uint16_t)heat; - } -} - -void Heater::interrupt(GpioEvent ev) { - // ununsed -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h deleted file mode 100644 index e0c250f62c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h +++ /dev/null @@ -1,47 +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 - -#include "Gpio.h" - -struct LowpassFilter { - uint64_t data_delay = 0; - uint16_t update(uint16_t value) { - data_delay = data_delay - (data_delay >> 6) + value; - return (uint16_t)(data_delay >> 6); - } -}; - -class Heater: public Peripheral { -public: - Heater(pin_t heater, pin_t adc); - virtual ~Heater(); - void interrupt(GpioEvent ev); - void update(); - - pin_t heater_pin, adc_pin; - uint16_t room_temp_raw; - uint16_t heater_state; - LowpassFilter pwmcap; - double heat; - uint64_t last; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp deleted file mode 100644 index 675afd4a21..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp +++ /dev/null @@ -1,50 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "IOLoggerCSV.h" - -IOLoggerCSV::IOLoggerCSV(std::string filename) { - file.open(filename); -} - -IOLoggerCSV::~IOLoggerCSV() { - file.close(); -} - -void IOLoggerCSV::log(GpioEvent ev) { - std::lock_guard lock(vector_lock); - events.push_back(ev); //minimal impact to signal handler -} - -void IOLoggerCSV::flush() { - { std::lock_guard lock(vector_lock); - while (!events.empty()) { - file << events.front().timestamp << ", "<< events.front().pin_id << ", " << events.front().event << std::endl; - events.pop_front(); - } - } - file.flush(); -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h deleted file mode 100644 index afc2125971..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h +++ /dev/null @@ -1,40 +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 - -#include -#include -#include -#include "Gpio.h" - -class IOLoggerCSV: public IOLogger { -public: - IOLoggerCSV(std::string filename); - virtual ~IOLoggerCSV(); - void flush(); - void log(GpioEvent ev); - -private: - std::ofstream file; - std::list events; - std::mutex vector_lock; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp deleted file mode 100644 index df133e9e18..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp +++ /dev/null @@ -1,66 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include -#include -#include "Clock.h" -#include "LinearAxis.h" - -LinearAxis::LinearAxis(pin_type enable, pin_type dir, pin_type step, pin_type end_min, pin_type end_max) { - enable_pin = enable; - dir_pin = dir; - step_pin = step; - min_pin = end_min; - max_pin = end_max; - - min_position = 50; - max_position = (200*80) + min_position; - position = rand() % ((max_position - 40) - min_position) + (min_position + 20); - last_update = Clock::nanos(); - - Gpio::attachPeripheral(step_pin, this); - -} - -LinearAxis::~LinearAxis() { - -} - -void LinearAxis::update() { - -} - -void LinearAxis::interrupt(GpioEvent ev) { - if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value){ - if (ev.event == GpioEvent::RISE) { - last_update = ev.timestamp; - position += -1 + 2 * Gpio::pin_map[dir_pin].value; - Gpio::pin_map[min_pin].value = (position < min_position); - //Gpio::pin_map[max_pin].value = (position > max_position); - //if (position < min_position) printf("axis(%d) endstop : pos: %d, mm: %f, min: %d\n", step_pin, position, position / 80.0, Gpio::pin_map[min_pin].value); - } - } -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h deleted file mode 100644 index 1e8e887de5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h +++ /dev/null @@ -1,45 +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 - -#include -#include "Gpio.h" - -class LinearAxis: public Peripheral { -public: - LinearAxis(pin_type enable, pin_type dir, pin_type step, pin_type end_min, pin_type end_max); - virtual ~LinearAxis(); - void update(); - void interrupt(GpioEvent ev); - - pin_type enable_pin; - pin_type dir_pin; - pin_type step_pin; - pin_type min_pin; - pin_type max_pin; - - int32_t position; - int32_t min_position; - int32_t max_position; - uint64_t last_update; - -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp deleted file mode 100644 index 1c930cfce1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp +++ /dev/null @@ -1,118 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "Timer.h" -#include - -Timer::Timer() { - active = false; - compare = 0; - frequency = 0; - overruns = 0; - timerid = 0; - cbfn = nullptr; - period = 0; - start_time = 0; - avg_error = 0; -} - -Timer::~Timer() { - timer_delete(timerid); -} - -void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) { - struct sigaction sa; - struct sigevent sev; - - frequency = sim_freq; - cbfn = fn; - - sa.sa_flags = SA_SIGINFO; - sa.sa_sigaction = Timer::handler; - sigemptyset(&sa.sa_mask); - if (sigaction(SIGRTMIN, &sa, nullptr) == -1) { - return; // todo: handle error - } - - sigemptyset(&mask); - sigaddset(&mask, SIGRTMIN); - - disable(); - - sev.sigev_notify = SIGEV_SIGNAL; - sev.sigev_signo = SIGRTMIN; - sev.sigev_value.sival_ptr = (void*)this; - if (timer_create(CLOCK_REALTIME, &sev, &timerid) == -1) { - return; // todo: handle error - } -} - -void Timer::start(uint32_t frequency) { - setCompare(this->frequency / frequency); - //printf("timer(%ld) started\n", getID()); -} - -void Timer::enable() { - if (sigprocmask(SIG_UNBLOCK, &mask, nullptr) == -1) { - return; // todo: handle error - } - active = true; - //printf("timer(%ld) enabled\n", getID()); -} - -void Timer::disable() { - if (sigprocmask(SIG_SETMASK, &mask, nullptr) == -1) { - return; // todo: handle error - } - active = false; -} - -void Timer::setCompare(uint32_t compare) { - uint32_t nsec_offset = 0; - if (active) { - nsec_offset = Clock::nanos() - this->start_time; // calculate how long the timer would have been running for - nsec_offset = nsec_offset < 1000 ? nsec_offset : 0; // constrain, this shouldn't be needed but apparently Marlin enables interrupts on the stepper timer before initialising it, todo: investigate ?bug? - } - this->compare = compare; - uint64_t ns = Clock::ticksToNanos(compare, frequency) - nsec_offset; - struct itimerspec its; - its.it_value.tv_sec = ns / 1000000000; - its.it_value.tv_nsec = ns % 1000000000; - its.it_interval.tv_sec = its.it_value.tv_sec; - its.it_interval.tv_nsec = its.it_value.tv_nsec; - - if (timer_settime(timerid, 0, &its, nullptr) == -1) { - printf("timer(%ld) failed, compare: %d(%ld)\n", getID(), compare, its.it_value.tv_nsec); - return; // todo: handle error - } - //printf("timer(%ld) started, compare: %d(%d)\n", getID(), compare, its.it_value.tv_nsec); - this->period = its.it_value.tv_nsec; - this->start_time = Clock::nanos(); -} - -uint32_t Timer::getCount() { - return Clock::nanosToTicks(Clock::nanos() - this->start_time, frequency); -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h deleted file mode 100644 index 740d8ef4e8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h +++ /dev/null @@ -1,76 +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 - -#include -#include -#include -#include -#include -#include - -#include "Clock.h" - -class Timer { -public: - Timer(); - virtual ~Timer(); - - typedef void (callback_fn)(); - - void init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn); - void start(uint32_t frequency); - void enable(); - bool enabled() {return active;} - void disable(); - void setCompare(uint32_t compare); - uint32_t getCount(); - uint32_t getCompare() {return compare;} - uint32_t getOverruns() {return overruns;} - uint32_t getAvgError() {return avg_error;} - - intptr_t getID() { - return (*(intptr_t*)timerid); - } - - static void handler(int sig, siginfo_t *si, void *uc){ - Timer* _this = (Timer*)si->si_value.sival_ptr; - _this->avg_error += (Clock::nanos() - _this->start_time) - _this->period; //high_resolution_clock is also limited in precision, but best we have - _this->avg_error /= 2; //very crude precision analysis (actually within +-500ns usually) - _this->start_time = Clock::nanos(); // wrap - _this->cbfn(); - _this->overruns += timer_getoverrun(_this->timerid); // even at 50Khz this doesn't stay zero, again demonstrating the limitations - // using a realtime linux kernel would help somewhat - } - -private: - bool active; - uint32_t compare; - uint32_t frequency; - uint32_t overruns; - timer_t timerid; - sigset_t mask; - callback_fn* cbfn; - uint64_t period; - uint64_t avg_error; - uint64_t start_time; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h deleted file mode 100644 index 776fa2f139..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h +++ /dev/null @@ -1,35 +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 - -/** - * Test X86_64-specific configuration values for errors at compile-time. - */ - -// Emulating RAMPS -#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/Arduino.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/Arduino.h deleted file mode 100644 index 13a8206e1b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/Arduino.h +++ /dev/null @@ -1,121 +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 - -#include -#include -#include -#include - -#include - -#define HIGH 0x01 -#define LOW 0x00 - -#define INPUT 0x00 -#define OUTPUT 0x01 -#define INPUT_PULLUP 0x02 -#define INPUT_PULLDOWN 0x03 - -#define LSBFIRST 0 -#define MSBFIRST 1 - -#define CHANGE 0x02 -#define FALLING 0x03 -#define RISING 0x04 - -typedef uint8_t byte; -#define PROGMEM -#define PSTR(v) (v) -#define PGM_P const char * - -// Used for libraries, preprocessor, and constants -#define abs(x) ((x)>0?(x):-(x)) - -#ifndef isnan - #define isnan std::isnan -#endif -#ifndef isinf - #define isinf std::isinf -#endif - -#define sq(v) ((v) * (v)) -#define square(v) sq(v) -#define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value))) - -//Interrupts -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); - -// Program Memory -#define pgm_read_ptr(addr) (*((void**)(addr))) -#define pgm_read_byte_near(addr) (*((uint8_t*)(addr))) -#define pgm_read_float_near(addr) (*((float*)(addr))) -#define pgm_read_word_near(addr) (*((uint16_t*)(addr))) -#define pgm_read_dword_near(addr) (*((uint32_t*)(addr))) -#define pgm_read_byte(addr) pgm_read_byte_near(addr) -#define pgm_read_float(addr) pgm_read_float_near(addr) -#define pgm_read_word(addr) pgm_read_word_near(addr) -#define pgm_read_dword(addr) pgm_read_dword_near(addr) - -using std::memcpy; -#define memcpy_P memcpy -#define sprintf_P sprintf -#define strstr_P strstr -#define strncpy_P strncpy -#define vsnprintf_P vsnprintf -#define strcpy_P strcpy -#define snprintf_P snprintf -#define strlen_P strlen - -// Time functions -extern "C" { - void delay(const int milis); -} -void _delay_ms(const int delay); -void delayMicroseconds(unsigned long); -uint32_t millis(); - -//IO functions -void pinMode(const pin_t, const uint8_t); -void digitalWrite(pin_t, uint8_t); -bool digitalRead(pin_t); -void analogWrite(pin_t, int); -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); - -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); - -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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp deleted file mode 100644 index a4ddb1b1ff..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp +++ /dev/null @@ -1,70 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include - -#include "../../../gcode/parser.h" - -uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS; - -// Get the digital pin for an analog index -pin_t analogInputToDigitalPin(const int8_t p) { - return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC); -} - -// Return the index of a pin number -int16_t GET_PIN_MAP_INDEX(const pin_t pin) { - return pin; -} - -// Test whether the pin is valid -bool VALID_PIN(const pin_t p) { - return WITHIN(p, 0, NUM_DIGITAL_PINS); -} - -// Get the analog index for a digital pin -int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p) { - return (WITHIN(p, analog_offset, NUM_DIGITAL_PINS) ? p - analog_offset : P_NC); -} - -// Test whether the pin is PWM -bool PWM_PIN(const pin_t p) { - return false; -} - -// Test whether the pin is interruptable -bool INTERRUPT_PIN(const pin_t p) { - return false; -} - -// Get the pin number at the given index -pin_t GET_PIN_MAP_PIN(const int16_t ind) { - return ind; -} - -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { - return parser.intval(code, dval); -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h deleted file mode 100644 index a24f0b3ed1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h +++ /dev/null @@ -1,59 +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 - -#include "../../../inc/MarlinConfigPre.h" - -#include -#include "../hardware/Gpio.h" - -typedef pin_type pin_t; - -#define P_NC -1 -constexpr uint16_t NUM_DIGITAL_PINS = Gpio::pin_count; -constexpr uint8_t NUM_ANALOG_INPUTS = 16; - -#define HAL_SENSITIVE_PINS - -// Get the digital pin for an analog index -pin_t analogInputToDigitalPin(const int8_t p); - -// Return the index of a pin number -int16_t GET_PIN_MAP_INDEX(const pin_t pin); - -// Test whether the pin is valid -bool VALID_PIN(const pin_t p); - -// Get the analog index for a digital pin -int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p); - -// Test whether the pin is PWM -bool PWM_PIN(const pin_t p); - -// Test whether the pin is interruptable -bool INTERRUPT_PIN(const pin_t p); - -// Get the pin number at the given index -pin_t GET_PIN_MAP_PIN(const int16_t ind); - -// Parse a G-code word into a pin index -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/serial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/serial.h deleted file mode 100644 index c6da82ad5a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/include/serial.h +++ /dev/null @@ -1,208 +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 - -#include "../../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) - #include "../../../feature/emergency_parser.h" -#endif - -#include -#include - -/** - * Generic RingBuffer - * T type of the buffer array - * S size of the buffer (must be power of 2) - * - */ -template class RingBuffer { -public: - RingBuffer() { index_read = index_write = 0; } - uint32_t available() volatile { return index_write - index_read; } - uint32_t free() volatile { return buffer_size - available(); } - bool empty() volatile { return index_read == index_write; } - bool full() volatile { return available() == buffer_size; } - void clear() volatile { index_read = index_write = 0; } - - bool peek(T *value) volatile { - if (value == 0 || available() == 0) - return false; - *value = buffer[mask(index_read)]; - return true; - } - - int read() volatile { - if (empty()) return -1; - return buffer[mask(index_read++)]; - } - - bool write(T value) volatile { - if (full()) return false; - buffer[mask(index_write++)] = value; - return true; - } - -private: - uint32_t mask(uint32_t val) volatile { - return buffer_mask & val; - } - - static const uint32_t buffer_size = S; - static const uint32_t buffer_mask = buffer_size - 1; - volatile T buffer[buffer_size]; - volatile uint32_t index_write; - volatile uint32_t index_read; -}; - -class HalSerial { -public: - - #if ENABLED(EMERGENCY_PARSER) - EmergencyParser::State emergency_state; - #endif - - HalSerial() { host_connected = true; } - - void begin(int32_t) {} - - void end() {} - - int peek() { - uint8_t value; - return receive_buffer.peek(&value) ? value : -1; - } - - int read() { return receive_buffer.read(); } - - size_t write(char c) { - if (!host_connected) return 0; - while (!transmit_buffer.free()); - return transmit_buffer.write(c); - } - - operator bool() { return host_connected; } - - uint16_t available() { - return (uint16_t)receive_buffer.available(); - } - - void flush() { receive_buffer.clear(); } - - uint8_t availableForWrite() { - return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free(); - } - - void flushTX() { - if (host_connected) - while (transmit_buffer.available()) { /* nada */ } - } - - void printf(const char *format, ...) { - static char buffer[256]; - va_list vArgs; - va_start(vArgs, format); - int length = vsnprintf((char *) buffer, 256, (char const *) format, vArgs); - va_end(vArgs); - if (length > 0 && length < 256) { - if (host_connected) { - for (int i = 0; i < length;) { - if (transmit_buffer.write(buffer[i])) { - ++i; - } - } - } - } - } - - #define DEC 10 - #define HEX 16 - #define OCT 8 - #define BIN 2 - - void print_bin(uint32_t value, uint8_t num_digits) { - uint32_t mask = 1 << (num_digits -1); - for (uint8_t i = 0; i < num_digits; i++) { - if (!(i % 4) && i) write(' '); - if (!(i % 16) && i) write(' '); - if (value & mask) write('1'); - else write('0'); - value <<= 1; - } - } - - void print(const char value[]) { printf("%s" , value); } - void print(char value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 8); - else if (nbase == OCT) printf("%3o", value); - else if (nbase == HEX) printf("%2X", value); - else if (nbase == DEC ) printf("%d", value); - else printf("%c" , value); - } - void print(unsigned char value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 8); - else if (nbase == OCT) printf("%3o", value); - else if (nbase == HEX) printf("%2X", value); - else printf("%u" , value); - } - void print(int value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 16); - else if (nbase == OCT) printf("%6o", value); - else if (nbase == HEX) printf("%4X", value); - else printf("%d", value); - } - void print(unsigned int value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 16); - else if (nbase == OCT) printf("%6o", value); - else if (nbase == HEX) printf("%4X", value); - else printf("%u" , value); - } - void print(long value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 32); - else if (nbase == OCT) printf("%11o", value); - else if (nbase == HEX) printf("%8X", value); - else printf("%ld" , value); - } - void print(unsigned long value, int nbase = 0) { - if (nbase == BIN) print_bin(value, 32); - else if (nbase == OCT) printf("%11o", value); - else if (nbase == HEX) printf("%8X", value); - else printf("%lu" , value); - } - void print(float value, int round = 6) { printf("%f" , value); } - void print(double value, int round = 6) { printf("%f" , value); } - - void println(const char value[]) { printf("%s\n" , value); } - void println(char value, int nbase = 0) { print(value, nbase); println(); } - void println(unsigned char value, int nbase = 0) { print(value, nbase); println(); } - void println(int value, int nbase = 0) { print(value, nbase); println(); } - void println(unsigned int value, int nbase = 0) { print(value, nbase); println(); } - void println(long value, int nbase = 0) { print(value, nbase); println(); } - 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() { print('\n'); } - - volatile RingBuffer receive_buffer; - volatile RingBuffer transmit_buffer; - volatile bool host_connected; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/main.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/main.cpp deleted file mode 100644 index 4231affba7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/main.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * 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 . - * - */ - -#ifdef __PLAT_LINUX__ - -extern void setup(); -extern void loop(); - -#include - -#include -#include - -#include "../../inc/MarlinConfig.h" -#include -#include -#include "../shared/Delay.h" -#include "hardware/IOLoggerCSV.h" -#include "hardware/Heater.h" -#include "hardware/LinearAxis.h" - -// simple stdout / stdin implementation for fake serial port -void write_serial_thread() { - for (;;) { - for (std::size_t i = usb_serial.transmit_buffer.available(); i > 0; i--) { - fputc(usb_serial.transmit_buffer.read(), stdout); - } - std::this_thread::yield(); - } -} - -void read_serial_thread() { - char buffer[255] = {}; - for (;;) { - std::size_t len = _MIN(usb_serial.receive_buffer.free(), 254U); - if (fgets(buffer, len, stdin)) - for (std::size_t i = 0; i < strlen(buffer); i++) - usb_serial.receive_buffer.write(buffer[i]); - std::this_thread::yield(); - } -} - -void simulation_loop() { - Heater hotend(HEATER_0_PIN, TEMP_0_PIN); - Heater bed(HEATER_BED_PIN, TEMP_BED_PIN); - LinearAxis x_axis(X_ENABLE_PIN, X_DIR_PIN, X_STEP_PIN, X_MIN_PIN, X_MAX_PIN); - LinearAxis y_axis(Y_ENABLE_PIN, Y_DIR_PIN, Y_STEP_PIN, Y_MIN_PIN, Y_MAX_PIN); - LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN); - LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC); - - //#define GPIO_LOGGING // Full GPIO and Positional Logging - - #ifdef GPIO_LOGGING - IOLoggerCSV logger("all_gpio_log.csv"); - Gpio::attachLogger(&logger); - - std::ofstream position_log; - position_log.open("axis_position_log.csv"); - - int32_t x,y,z; - #endif - - for (;;) { - - hotend.update(); - bed.update(); - - x_axis.update(); - y_axis.update(); - z_axis.update(); - extruder0.update(); - - #ifdef GPIO_LOGGING - if (x_axis.position != x || y_axis.position != y || z_axis.position != z) { - uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update); - position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl; - position_log.flush(); - x = x_axis.position; - y = y_axis.position; - z = z_axis.position; - } - // flush the logger - logger.flush(); - #endif - - std::this_thread::yield(); - } -} - -int main() { - std::thread write_serial (write_serial_thread); - std::thread read_serial (read_serial_thread); - - #if NUM_SERIAL > 0 - MYSERIAL0.begin(BAUDRATE); - SERIAL_ECHOLNPGM("x86_64 Initialized"); - SERIAL_FLUSHTX(); - #endif - - Clock::setFrequency(F_CPU); - Clock::setTimeMultiplier(1.0); // some testing at 10x - - HAL_timer_init(); - - std::thread simulation (simulation_loop); - - DELAY_US(10000); - - setup(); - for (;;) { - loop(); - std::this_thread::yield(); - } - - simulation.join(); - write_serial.join(); - read_serial.join(); -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp deleted file mode 100644 index c4965d90e3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp +++ /dev/null @@ -1,102 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" -#include - -#define LINUX_EEPROM_SIZE (E2END + 1) -uint8_t buffer[LINUX_EEPROM_SIZE]; -char filename[] = "eeprom.dat"; - -bool PersistentStore::access_start() { - const char eeprom_erase_value = 0xFF; - FILE * eeprom_file = fopen(filename, "rb"); - if (eeprom_file == nullptr) return false; - - fseek(eeprom_file, 0L, SEEK_END); - std::size_t file_size = ftell(eeprom_file); - - if (file_size < LINUX_EEPROM_SIZE) { - memset(buffer + file_size, eeprom_erase_value, LINUX_EEPROM_SIZE - file_size); - } - else { - fseek(eeprom_file, 0L, SEEK_SET); - fread(buffer, sizeof(uint8_t), sizeof(buffer), eeprom_file); - } - - fclose(eeprom_file); - return true; -} - -bool PersistentStore::access_finish() { - FILE * eeprom_file = fopen(filename, "wb"); - if (eeprom_file == nullptr) return false; - fwrite(buffer, sizeof(uint8_t), sizeof(buffer), eeprom_file); - fclose(eeprom_file); - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - std::size_t bytes_written = 0; - - for (std::size_t i = 0; i < size; i++) { - buffer[pos+i] = value[i]; - bytes_written ++; - } - - crc16(crc, value, size); - pos = pos + size; - return (bytes_written != size); // return true for any error -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - std::size_t bytes_read = 0; - if (writing) { - for (std::size_t i = 0; i < size; i++) { - value[i] = buffer[pos+i]; - bytes_read ++; - } - crc16(crc, value, size); - } - else { - uint8_t temp[size]; - for (std::size_t i = 0; i < size; i++) { - temp[i] = buffer[pos+i]; - bytes_read ++; - } - crc16(crc, temp, size); - } - - pos = pos + size; - return bytes_read != size; // return true for any error -} - -size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM - -#endif // EEPROM_SETTINGS -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/pinsDebug.h deleted file mode 100644 index a28d2b60b9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/pinsDebug.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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 . - * - */ - -/** - * Support routines for X86_64 - */ - -/** - * Translation of routines & variables used by pinsDebug.h - */ - -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define pwm_details(pin) pin = pin // do nothing // print PWM details -#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin. -#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0) -#define digitalRead_mod(p) digitalRead(p) -#define PRINT_PORT(p) -#define GET_ARRAY_PIN(p) pin_array[p].pin -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin - -// active ADC function/mode/code values for PINSEL registers -constexpr int8_t ADC_pin_mode(pin_t pin) { - return (-1); -} - -int8_t get_pin_mode(pin_t pin) { - if (!VALID_PIN(pin)) return -1; - return 0; -} - -bool GET_PINMODE(pin_t pin) { - int8_t pin_mode = get_pin_mode(pin); - if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // found an invalid pin or active analog pin - return false; - - return (Gpio::getMode(pin) != 0); //input/output state -} - -bool GET_ARRAY_IS_DIGITAL(pin_t pin) { - return (!IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin)); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/servo_private.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/servo_private.h deleted file mode 100644 index 2aba9a37db..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/servo_private.h +++ /dev/null @@ -1,80 +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 - -/** - * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * Based on "servo.h - Interrupt driven Servo library for Arduino using 16 bit timers - - * Version 2 Copyright (c) 2009 Michael Margolis. All right reserved. - * - * The only modification was to update/delete macros to match the LPC176x. - * - */ - -#include - -// Macros -//values in microseconds -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds - -#define MAX_SERVOS 4 - -#define INVALID_SERVO 255 // flag indicating an invalid servo index - - -// Types - -typedef struct { - uint8_t nbr : 8 ; // a pin number from 0 to 254 (255 signals invalid pin) - uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false -} ServoPin_t; - -typedef struct { - ServoPin_t Pin; - unsigned int pulse_width; // pulse width in microseconds -} ServoInfo_t; - -// Global variables - -extern uint8_t ServoCount; -extern ServoInfo_t servo_info[MAX_SERVOS]; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/spi_pins.h deleted file mode 100644 index fdd09b1c03..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/spi_pins.h +++ /dev/null @@ -1,54 +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 - -#include "../../core/macros.h" -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD && ENABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) - #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently - // needed due to the speed and mode required for communicating with each device being different. - // This requirement can be removed if the SPI access to these devices is updated to use - // spiBeginTransaction. -#endif - -/** onboard SD card */ -//#define SCK_PIN P0_07 -//#define MISO_PIN P0_08 -//#define MOSI_PIN P0_09 -//#define SS_PIN P0_06 -/** external */ -#ifndef SCK_PIN - #define SCK_PIN 50 -#endif -#ifndef MISO_PIN - #define MISO_PIN 51 -#endif -#ifndef MOSI_PIN - #define MOSI_PIN 52 -#endif -#ifndef SS_PIN - #define SS_PIN 53 -#endif -#ifndef SDSS - #define SDSS SS_PIN -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.cpp deleted file mode 100644 index f293d7f408..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "hardware/Timer.h" - -#include "../../inc/MarlinConfig.h" -#include "timers.h" - -/** - * Use POSIX signals to attempt to emulate Interrupts - * This has many limitations and is not fit for the purpose - */ - -HAL_STEP_TIMER_ISR(); -HAL_TEMP_TIMER_ISR(); - -Timer timers[2]; - -void HAL_timer_init() { - timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler); - timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler); -} - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - timers[timer_num].start(frequency); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - timers[timer_num].enable(); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - timers[timer_num].disable(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - return timers[timer_num].enabled(); -} - -void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { - timers[timer_num].setCompare(compare); -} - -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return timers[timer_num].getCompare(); -} - -hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - return timers[timer_num].getCount(); -} - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.h deleted file mode 100644 index 8022aabd26..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/timers.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -/** - * HAL timers for Linux X86_64 - */ - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals - -#define STEP_TIMER_NUM 0 // Timer Index for Stepper -#define TEMP_TIMER_NUM 1 // Timer Index for Temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_RATE 1000000 -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#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() -#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() -#define HAL_PWM_TIMER_IRQn - - -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); -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num); -hal_timer_t HAL_timer_get_count(const uint8_t timer_num); -FORCE_INLINE static void HAL_timer_restrain(const uint8_t timer_num, const uint16_t interval_ticks) { - const hal_timer_t mincmp = HAL_timer_get_count(timer_num) + interval_ticks; - if (HAL_timer_get_compare(timer_num) < mincmp) HAL_timer_set_compare(timer_num, mincmp); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.cpp deleted file mode 100644 index 6338ea3b1d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.cpp +++ /dev/null @@ -1,36 +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 . - * - */ - -#ifdef __PLAT_LINUX__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -void watchdog_init() {} -void HAL_watchdog_refresh() {} - -#endif - -#endif // __PLAT_LINUX__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.h deleted file mode 100644 index 51d30c8437..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LINUX/watchdog.h +++ /dev/null @@ -1,27 +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 - -#define WDT_TIMEOUT 4000000 // 4 second timeout - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp deleted file mode 100644 index fefee386e5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp +++ /dev/null @@ -1,318 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../core/macros.h" -#include "../../core/serial.h" -#include - -#include "../shared/backtrace/unwinder.h" -#include "../shared/backtrace/unwmemaccess.h" -#include "watchdog.h" -#include - - -// Debug monitor that dumps to the Programming port all status when -// an exception or WDT timeout happens - And then resets the board - -// All the Monitor routines must run with interrupts disabled and -// under an ISR execution context. That is why we cannot reuse the -// Serial interrupt routines or any C runtime, as we don't know the -// state we are when running them - -// A SW memory barrier, to ensure GCC does not overoptimize loops -#define sw_barrier() __asm__ volatile("": : :"memory"); - -// (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin() { -} - -// Send character through UART with no interrupts -static void TX(char c) { - _DBC(c); -} - -// Send String through UART -static void TX(const char* s) { - while (*s) TX(*s++); -} - -static void TXDigit(uint32_t d) { - if (d < 10) TX((char)(d+'0')); - else if (d < 16) TX((char)(d+'A'-10)); - else TX('?'); -} - -// Send Hex number thru UART -static void TXHex(uint32_t v) { - TX("0x"); - for (uint8_t i = 0; i < 8; i++, v <<= 4) - TXDigit((v >> 28) & 0xF); -} - -// Send Decimal number thru UART -static void TXDec(uint32_t v) { - if (!v) { - TX('0'); - return; - } - - char nbrs[14]; - char *p = &nbrs[0]; - while (v != 0) { - *p++ = '0' + (v % 10); - v /= 10; - } - do { - p--; - TX(*p); - } while (p != &nbrs[0]); -} - -// Dump a backtrace entry -static bool UnwReportOut(void* ctx, const UnwReport* bte) { - int* p = (int*)ctx; - - (*p)++; - TX('#'); TXDec(*p); TX(" : "); - TX(bte->name?bte->name:"unknown"); TX('@'); TXHex(bte->function); - TX('+'); TXDec(bte->address - bte->function); - TX(" PC:");TXHex(bte->address); TX('\n'); - return true; -} - -#ifdef UNW_DEBUG - void UnwPrintf(const char* format, ...) { - char dest[256]; - va_list argptr; - va_start(argptr, format); - vsprintf(dest, format, argptr); - va_end(argptr); - TX(&dest[0]); - } -#endif - -/* Table of function pointers for passing to the unwinder */ -static const UnwindCallbacks UnwCallbacks = { - UnwReportOut, - UnwReadW, - UnwReadH, - UnwReadB - #ifdef UNW_DEBUG - ,UnwPrintf - #endif -}; - - -/** - * HardFaultHandler_C: - * This is called from the HardFault_HandlerAsm with a pointer the Fault stack - * as the parameter. We can then read the values from the stack and place them - * into local variables for ease of reading. - * We then read the various Fault Status and Address Registers to help decode - * cause of the fault. - * The function ends with a BKPT instruction to force control back into the debugger - */ -extern "C" -void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause) { - - static const char* causestr[] = { - "NMI","Hard","Mem","Bus","Usage","Debug","WDT","RSTC" - }; - - UnwindFrame btf; - - // Dump report to the Programming port (interrupts are DISABLED) - TXBegin(); - TX("\n\n## Software Fault detected ##\n"); - TX("Cause: "); TX(causestr[cause]); TX('\n'); - - TX("R0 : "); TXHex(((unsigned long)sp[0])); TX('\n'); - TX("R1 : "); TXHex(((unsigned long)sp[1])); TX('\n'); - TX("R2 : "); TXHex(((unsigned long)sp[2])); TX('\n'); - TX("R3 : "); TXHex(((unsigned long)sp[3])); TX('\n'); - TX("R12 : "); TXHex(((unsigned long)sp[4])); TX('\n'); - TX("LR : "); TXHex(((unsigned long)sp[5])); TX('\n'); - TX("PC : "); TXHex(((unsigned long)sp[6])); TX('\n'); - TX("PSR : "); TXHex(((unsigned long)sp[7])); TX('\n'); - - // Configurable Fault Status Register - // Consists of MMSR, BFSR and UFSR - TX("CFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED28)))); TX('\n'); - - // Hard Fault Status Register - TX("HFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED2C)))); TX('\n'); - - // Debug Fault Status Register - TX("DFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED30)))); TX('\n'); - - // Auxiliary Fault Status Register - TX("AFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED3C)))); TX('\n'); - - // Read the Fault Address Registers. These may not contain valid values. - // Check BFARVALID/MMARVALID to see if they are valid values - // MemManage Fault Address Register - TX("MMAR : "); TXHex((*((volatile unsigned long *)(0xE000ED34)))); TX('\n'); - - // Bus Fault Address Register - TX("BFAR : "); TXHex((*((volatile unsigned long *)(0xE000ED38)))); TX('\n'); - - TX("ExcLR: "); TXHex(lr); TX('\n'); - TX("ExcSP: "); TXHex((unsigned long)sp); TX('\n'); - - btf.sp = ((unsigned long)sp) + 8*4; // The original stack pointer - btf.fp = btf.sp; - btf.lr = ((unsigned long)sp[5]); - btf.pc = ((unsigned long)sp[6]) | 1; // Force Thumb, as CORTEX only support it - - // Perform a backtrace - TX("\nBacktrace:\n\n"); - int ctr = 0; - UnwindStart(&btf, &UnwCallbacks, &ctr); - - // Disable all NVIC interrupts - NVIC->ICER[0] = 0xFFFFFFFF; - NVIC->ICER[1] = 0xFFFFFFFF; - - // Relocate VTOR table to default position - SCB->VTOR = 0; - - // Clear cause of reset to prevent entering smoothie bootstrap - HAL_clear_reset_source(); - // Restart watchdog - //WDT_Restart(WDT); - watchdog_init(); - - // Reset controller - NVIC_SystemReset(); - - for (;;) watchdog_init(); -} - -extern "C" { -__attribute__((naked)) void NMI_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#0") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void HardFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#1") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void MemManage_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#2") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void BusFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#3") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void UsageFault_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#4") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void DebugMon_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#5") - A("b HardFault_HandlerC") - ); -} - -/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_IRQHandler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#6") - A("b HardFault_HandlerC") - ); -} - -__attribute__((naked)) void RSTC_Handler() { - __asm__ __volatile__ ( - ".syntax unified" "\n\t" - A("tst lr, #4") - A("ite eq") - A("mrseq r0, msp") - A("mrsne r0, psp") - A("mov r1,lr") - A("mov r2,#7") - A("b HardFault_HandlerC") - ); -} -} -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.cpp deleted file mode 100644 index 4da55c2f3d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.cpp +++ /dev/null @@ -1,87 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" -#include "../shared/Delay.h" -#include "../../../gcode/parser.h" - -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - -uint32_t HAL_adc_reading = 0; - -// U8glib required functions -extern "C" void u8g_xMicroDelay(uint16_t val) { - DELAY_US(val); -} -extern "C" void u8g_MicroDelay() { - u8g_xMicroDelay(1); -} -extern "C" void u8g_10MicroDelay() { - u8g_xMicroDelay(10); -} -extern "C" void u8g_Delay(uint16_t val) { - delay(val); -} -//************************// - -// return free heap space -int freeMemory() { - char stack_end; - void *heap_start = malloc(sizeof(uint32_t)); - if (heap_start == 0) return 0; - - uint32_t result = (uint32_t)&stack_end - (uint32_t)heap_start; - free(heap_start); - return result; -} - -// scan command line for code -// return index into pin map array if found and the pin is valid. -// return dval if not found or not a valid pin. -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { - const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100; - const int16_t ind = (port < ((NUM_DIGITAL_PINS) >> 5) && pin < 32) ? ((port << 5) | pin) : -2; - return ind > -1 ? ind : dval; -} - -void flashFirmware(int16_t value) { - NVIC_SystemReset(); -} - -void HAL_clear_reset_source(void) { - #if ENABLED(USE_WATCHDOG) - watchdog_clear_timeout_flag(); - #endif -} - -uint8_t HAL_get_reset_source(void) { - #if ENABLED(USE_WATCHDOG) - if (watchdog_timed_out()) return RST_WATCHDOG; - #endif - return RST_POWER_ON; -} - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.h deleted file mode 100644 index 1648905453..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ /dev/null @@ -1,201 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -/** - * HAL_LPC1768/HAL.h - * Hardware Abstraction Layer for NXP LPC1768 - */ - -#define CPU_32_BIT - -void HAL_init(); - -#include -#include -#include - -extern "C" volatile uint32_t _millis; - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "timers.h" -#include "MarlinSerial.h" - -#include -#include -#include - -// -// Default graphical display delays -// -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(600) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(750) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(750) -#endif - -#if !WITHIN(SERIAL_PORT, -1, 3) - #error "SERIAL_PORT must be from -1 to 3" -#endif - -#if SERIAL_PORT == -1 - #define MYSERIAL0 UsbSerial -#elif SERIAL_PORT == 0 - #define MYSERIAL0 MSerial -#elif SERIAL_PORT == 1 - #define MYSERIAL0 MSerial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 MSerial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 MSerial3 -#endif - -#ifdef SERIAL_PORT_2 - #if !WITHIN(SERIAL_PORT_2, -1, 3) - #error "SERIAL_PORT_2 must be from -1 to 3" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 UsbSerial - #elif SERIAL_PORT_2 == 0 - #define MYSERIAL1 MSerial - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 MSerial1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 MSerial2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 MSerial3 - #endif -#else - #define NUM_SERIAL 1 -#endif - -// -// Interrupts -// -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -// -// Utility functions -// -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(); -#pragma GCC diagnostic pop - -// -// ADC API -// - -#define ADC_MEDIAN_FILTER_SIZE (23) // Higher values increase step delay (phase shift), - // (ADC_MEDIAN_FILTER_SIZE + 1) / 2 sample step delay (12 samples @ 500Hz: 24ms phase shift) - // Memory usage per ADC channel (bytes): (6 * ADC_MEDIAN_FILTER_SIZE) + 16 - // 8 * ((6 * 23) + 16 ) = 1232 Bytes for 8 channels - -#define ADC_LOWPASS_K_VALUE (2) // Higher values increase rise time - // Rise time sample delays for 100% signal convergence on full range step - // (1 : 13, 2 : 32, 3 : 67, 4 : 139, 5 : 281, 6 : 565, 7 : 1135, 8 : 2273) - // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step - // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels) - -#define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t -#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL - -using FilteredADC = LPC176x::ADC; -extern uint32_t HAL_adc_reading; -[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) { - HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits -} -[[gnu::always_inline]] inline uint16_t HAL_read_adc() { - return HAL_adc_reading; -} - -#define HAL_adc_init() -#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin) -#define HAL_START_ADC(pin) HAL_start_adc(pin) -#define HAL_READ_ADC() HAL_read_adc() -#define HAL_ADC_READY() (true) - -// Test whether the pin is valid -constexpr bool VALID_PIN(const pin_t pin) { - return LPC176x::pin_is_valid(pin); -} - -// Get the analog index for a digital pin -constexpr int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t pin) { - return (LPC176x::pin_is_valid(pin) && LPC176x::pin_has_adc(pin)) ? pin : -1; -} - -// Return the index of a pin number -constexpr int16_t GET_PIN_MAP_INDEX(const pin_t pin) { - return LPC176x::pin_index(pin); -} - -// Get the pin number at the given index -constexpr pin_t GET_PIN_MAP_PIN(const int16_t index) { - return LPC176x::pin_index(index); -} - -// Parse a G-code word into a pin index -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); -// P0.6 thru P0.9 are for the onboard SD card -#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09 - -#define HAL_IDLETASK 1 -void HAL_idletask(); - -#define PLATFORM_M997_SUPPORT -void flashFirmware(int16_t value); - -/** - * set_pwm_frequency - * Set the frequency of the timer corresponding to the provided pin - * All Hardware PWM pins run at the same frequency and all - * Software PWM pins run at the same frequency - */ -void set_pwm_frequency(const pin_t pin, int f_desired); - -/** - * set_pwm_duty - * Set the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); - -// Reset source -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp deleted file mode 100644 index 5f32c7874d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp +++ /dev/null @@ -1,240 +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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * For TARGET_LPC1768 - */ - -/** - * Hardware SPI and a software SPI implementations are included in this file. - * The hardware SPI runs faster and has higher throughput but is not compatible - * with some LCD interfaces/adapters. - * - * Control of the slave select pin(s) is handled by the calling routines. - * - * Some of the LCD interfaces/adapters result in the LCD SPI and the SD card - * SPI sharing pins. The SCK, MOSI & MISO pins can NOT be set/cleared with - * WRITE nor digitalWrite when the hardware SPI module within the LPC17xx is - * active. If any of these pins are shared then the software SPI must be used. - * - * A more sophisticated hardware SPI can be found at the following link. This - * implementation has not been fully debugged. - * https://github.com/MarlinFirmware/Marlin/tree/071c7a78f27078fd4aee9a3ef365fcf5e143531e - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" -#include - -// ------------------------ -// Public functions -// ------------------------ -#if ENABLED(LPC_SOFTWARE_SPI) - - #include - - // Software SPI - - static uint8_t SPI_speed = 0; - - static uint8_t spiTransfer(uint8_t b) { - return swSpiTransfer(b, SPI_speed, SCK_PIN, MISO_PIN, MOSI_PIN); - } - - void spiBegin() { - swSpiBegin(SCK_PIN, MISO_PIN, MOSI_PIN); - } - - void spiInit(uint8_t spiRate) { - SPI_speed = swSpiInit(spiRate, SCK_PIN, MOSI_PIN); - } - - uint8_t spiRec() { return spiTransfer(0xFF); } - - void spiRead(uint8_t*buf, uint16_t nbyte) { - for (int i = 0; i < nbyte; i++) - buf[i] = spiTransfer(0xFF); - } - - void spiSend(uint8_t b) { (void)spiTransfer(b); } - - void spiSend(const uint8_t* buf, size_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) - (void)spiTransfer(buf[i]); - } - - void spiSendBlock(uint8_t token, const uint8_t* buf) { - (void)spiTransfer(token); - for (uint16_t i = 0; i < 512; i++) - (void)spiTransfer(buf[i]); - } - -#else - - // Hardware SPI - - #include - #include - #include - - // decide which HW SPI device to use - #ifndef LPC_HW_SPI_DEV - #if (SCK_PIN == P0_07 && MISO_PIN == P0_08 && MOSI_PIN == P0_09) - #define LPC_HW_SPI_DEV 1 - #else - #if (SCK_PIN == P0_15 && MISO_PIN == P0_17 && MOSI_PIN == P0_18) - #define LPC_HW_SPI_DEV 0 - #else - #error "Invalid pins selected for hardware SPI" - #endif - #endif - #endif - #if (LPC_HW_SPI_DEV == 0) - #define LPC_SSPn LPC_SSP0 - #else - #define LPC_SSPn LPC_SSP1 - #endif - - void spiBegin() { // setup SCK, MOSI & MISO pins for SSP0 - PINSEL_CFG_Type PinCfg; // data structure to hold init values - PinCfg.Funcnum = 2; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - PinCfg.Pinnum = LPC176x::pin_bit(SCK_PIN); - PinCfg.Portnum = LPC176x::pin_port(SCK_PIN); - PINSEL_ConfigPin(&PinCfg); - SET_OUTPUT(SCK_PIN); - - PinCfg.Pinnum = LPC176x::pin_bit(MISO_PIN); - PinCfg.Portnum = LPC176x::pin_port(MISO_PIN); - PINSEL_ConfigPin(&PinCfg); - SET_INPUT(MISO_PIN); - - PinCfg.Pinnum = LPC176x::pin_bit(MOSI_PIN); - PinCfg.Portnum = LPC176x::pin_port(MOSI_PIN); - PINSEL_ConfigPin(&PinCfg); - SET_OUTPUT(MOSI_PIN); - // divide PCLK by 2 for SSP0 - CLKPWR_SetPCLKDiv(LPC_HW_SPI_DEV == 0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2); - spiInit(0); - SSP_Cmd(LPC_SSPn, ENABLE); // start SSP running - } - - void spiInit(uint8_t spiRate) { - // table to convert Marlin spiRates (0-5 plus default) into bit rates - uint32_t Marlin_speed[7]; // CPSR is always 2 - Marlin_speed[0] = 8333333; //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED - Marlin_speed[1] = 4166667; //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED - Marlin_speed[2] = 2083333; //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED - Marlin_speed[3] = 1000000; //(SCR: 24) desired: 1,000,000 actual: 1,000,000 SPI_EIGHTH_SPEED - Marlin_speed[4] = 500000; //(SCR: 49) desired: 500,000 actual: 500,000 SPI_SPEED_5 - Marlin_speed[5] = 250000; //(SCR: 99) desired: 250,000 actual: 250,000 SPI_SPEED_6 - Marlin_speed[6] = 125000; //(SCR:199) desired: 125,000 actual: 125,000 Default from HAL.h - // setup for SPI mode - SSP_CFG_Type HW_SPI_init; // data structure to hold init values - SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode - HW_SPI_init.ClockRate = Marlin_speed[_MIN(spiRate, 6)]; // put in the specified bit rate - HW_SPI_init.Mode |= SSP_CR1_SSP_EN; - SSP_Init(LPC_SSPn, &HW_SPI_init); // puts the values into the proper bits in the SSP0 registers - } - - static uint8_t doio(uint8_t b) { - /* send and receive a single byte */ - SSP_SendData(LPC_SSPn, b & 0x00FF); - while (SSP_GetStatus(LPC_SSPn, SSP_STAT_BUSY)); // wait for it to finish - return SSP_ReceiveData(LPC_SSPn) & 0x00FF; - } - - void spiSend(uint8_t b) { doio(b); } - - void spiSend(const uint8_t* buf, size_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]); - } - - void spiSend(uint32_t chan, byte b) { - } - - void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) { - } - - // Read single byte from SPI - uint8_t spiRec() { return doio(0xFF); } - - uint8_t spiRec(uint32_t chan) { return 0; } - - // Read from SPI into buffer - void spiRead(uint8_t *buf, uint16_t nbyte) { - for (uint16_t i = 0; i < nbyte; i++) buf[i] = doio(0xFF); - } - - static uint8_t spiTransfer(uint8_t b) { - return doio(b); - } - - // Write from buffer to SPI - void spiSendBlock(uint8_t token, const uint8_t* buf) { - (void)spiTransfer(token); - for (uint16_t i = 0; i < 512; i++) - (void)spiTransfer(buf[i]); - } - - /** Begin SPI transaction, set clock, bit order, data mode */ - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - // TODO: to be implemented - - } - -#endif // ENABLED(LPC_SOFTWARE_SPI) - -void SPIClass::begin() { spiBegin(); } - -void SPIClass::beginTransaction(SPISettings cfg) { - uint8_t spiRate; - switch (cfg.spiRate()) { - case 8000000: spiRate = 0; break; - case 4000000: spiRate = 1; break; - case 2000000: spiRate = 2; break; - case 1000000: spiRate = 3; break; - case 500000: spiRate = 4; break; - case 250000: spiRate = 5; break; - case 125000: spiRate = 6; break; - default: spiRate = 2; break; - } - spiInit(spiRate); -} - -uint8_t SPIClass::transfer(const uint8_t B) { return spiTransfer(B); } - -uint16_t SPIClass::transfer16(const uint16_t data) { - return (transfer((data >> 8) & 0xFF) << 8) - | (transfer(data & 0xFF) & 0xFF); -} - -SPIClass SPI; - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp deleted file mode 100644 index a8778f7446..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp +++ /dev/null @@ -1,56 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfigPre.h" -#include "MarlinSerial.h" - -#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) - MarlinSerial MSerial(LPC_UART0); - 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() { - 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() { - 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() { - MSerial3.IRQHandler(); - } -#endif - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h deleted file mode 100644 index 8050685538..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h +++ /dev/null @@ -1,67 +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 - -#include -#include - -#include "../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) - #include "../../feature/emergency_parser.h" -#endif - -#ifndef SERIAL_PORT - #define SERIAL_PORT 0 -#endif -#ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 -#endif -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 -#endif - -class MarlinSerial : public HardwareSerial { -public: - MarlinSerial(LPC_UART_TypeDef *UARTx) : - HardwareSerial(UARTx) - #if ENABLED(EMERGENCY_PARSER) - , emergency_state(EmergencyParser::State::EP_RESET) - #endif - { - } - - void end() {} - - #if ENABLED(EMERGENCY_PARSER) - bool recv_callback(const char c) override { - emergency_parser.update(emergency_state, c); - return true; // do not discard character - } - - EmergencyParser::State emergency_state; - #endif -}; - -extern MarlinSerial MSerial; -extern MarlinSerial MSerial1; -extern MarlinSerial MSerial2; -extern MarlinSerial MSerial3; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/Servo.h deleted file mode 100644 index 1bbf84c73e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/Servo.h +++ /dev/null @@ -1,71 +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 - -/** - * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#pragma once - -/** - * Based on "servo.h - Interrupt driven Servo library for Arduino using 16 bit timers - - * Version 2 Copyright (c) 2009 Michael Margolis. All right reserved. - * - * The only modification was to update/delete macros to match the LPC176x. - * - */ - -#include - -class libServo: public Servo { - public: - void 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(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) - detach(); - #endif - } - - } -}; - -#define HAL_SERVO_LIB libServo diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h deleted file mode 100644 index f1d4fc754f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h +++ /dev/null @@ -1,113 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) - #define LPC1768_PIN_INTERRUPT_M(pin) ((pin >> 0x5 & 0x7) == 0 || (pin >> 0x5 & 0x7) == 2) - - #if HAS_X_MAX - #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN) - #error "X_MAX_PIN is not INTERRUPT-capable." - #endif - _ATTACH(X_MAX_PIN); - #endif - #if HAS_X_MIN - #if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN) - #error "X_MIN_PIN is not INTERRUPT-capable." - #endif - _ATTACH(X_MIN_PIN); - #endif - #if HAS_Y_MAX - #if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN) - #error "Y_MAX_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Y_MAX_PIN); - #endif - #if HAS_Y_MIN - #if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN) - #error "Y_MIN_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Y_MIN_PIN); - #endif - #if HAS_Z_MAX - #if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN) - #error "Z_MAX_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Z_MAX_PIN); - #endif - #if HAS_Z_MIN - #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) - #error "Z_MIN_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Z_MIN_PIN); - #endif - #if HAS_Z2_MAX - #if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN) - #error "Z2_MAX_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Z2_MAX_PIN); - #endif - #if HAS_Z2_MIN - #if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN) - #error "Z2_MIN_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Z2_MIN_PIN); - #endif - #if HAS_Z3_MAX - #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not INTERRUPT-capable." - #endif - _ATTACH(Z3_MAX_PIN); - #endif - #if HAS_Z3_MIN - #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not INTERRUPT-capable." - #endif - _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 INTERRUPT-capable." - #endif - _ATTACH(Z_MIN_PROBE_PIN); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp deleted file mode 100644 index 6c7de9bb1d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM - -#include - -void set_pwm_frequency(const pin_t pin, int f_desired) { - LPC176x::pwm_set_frequency(pin, f_desired); -} - -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); -} - -#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fastio.h deleted file mode 100644 index 8b90ec20d3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/fastio.h +++ /dev/null @@ -1,119 +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 - -/** - * Fast I/O Routines for LPC1768/9 - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -/** - * Description: Fast IO functions LPC1768 - * - * For TARGET LPC1768 - */ - -#include "../shared/Marduino.h" - -#define PWM_PIN(P) true // all pins are PWM capable - -#define LPC_PIN(pin) LPC176x::gpio_pin(pin) -#define LPC_GPIO(port) LPC176x::gpio_port(port) - -#define SET_DIR_INPUT(IO) LPC176x::gpio_set_input(IO) -#define SET_DIR_OUTPUT(IO) LPC176x::gpio_set_output(IO) - -#define SET_MODE(IO, mode) pinMode(IO, mode) - -#define WRITE_PIN_SET(IO) LPC176x::gpio_set(IO) -#define WRITE_PIN_CLR(IO) LPC176x::gpio_clear(IO) - -#define READ_PIN(IO) LPC176x::gpio_get(IO) -#define WRITE_PIN(IO,V) LPC176x::gpio_set(IO, V) - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -/// Read a pin -#define _READ(IO) READ_PIN(IO) - -/// Write to a pin -#define _WRITE(IO,V) WRITE_PIN(IO,V) - -/// toggle a pin -#define _TOGGLE(IO) _WRITE(IO, !READ(IO)) - -/// set pin as input -#define _SET_INPUT(IO) SET_DIR_INPUT(IO) - -/// set pin as output -#define _SET_OUTPUT(IO) SET_DIR_OUTPUT(IO) - -/// set pin as input with pullup mode -#define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT) - -/// set pin as input with pulldown mode -#define _PULLDOWN(IO,V) pinMode(IO, (V) ? INPUT_PULLDOWN : INPUT) - -/// check if pin is an input -#define _IS_INPUT(IO) (!LPC176x::gpio_get_dir(IO)) - -/// check if pin is an output -#define _IS_OUTPUT(IO) (LPC176x::gpio_get_dir(IO)) - -/// Read a pin wrapper -#define READ(IO) _READ(IO) - -/// Write to a pin wrapper -#define WRITE(IO,V) _WRITE(IO,V) - -/// toggle a pin wrapper -#define TOGGLE(IO) _TOGGLE(IO) - -/// set pin as input wrapper -#define SET_INPUT(IO) _SET_INPUT(IO) -/// set pin as input with pullup wrapper -#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) -/// set pin as input with pulldown wrapper -#define SET_INPUT_PULLDOWN(IO) do{ _SET_INPUT(IO); _PULLDOWN(IO, HIGH); }while(0) -/// set pin as output wrapper - reads the pin and sets the output to that value -#define SET_OUTPUT(IO) do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0) -// set pin as PWM -#define SET_PWM(IO) SET_OUTPUT(IO) - -/// check if pin is an input wrapper -#define IS_INPUT(IO) _IS_INPUT(IO) -/// check if pin is an output wrapper -#define IS_OUTPUT(IO) _IS_OUTPUT(IO) - -// Shorthand -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h deleted file mode 100644 index 17cbf20ef0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h +++ /dev/null @@ -1,70 +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 - -#if PIO_PLATFORM_VERSION < 1001 - #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically." -#endif -#if PIO_FRAMEWORK_VERSION < 2002 - #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries." -#endif - -/** - * Detect an old pins file by checking for old ADC pins values. - */ -#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3 -#if _OLD_TEMP_PIN(TEMP_BED) - #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_0) - #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_1) - #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_2) - #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_3) - #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_4) - #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#elif _OLD_TEMP_PIN(TEMP_5) - #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." -#endif -#undef _OLD_TEMP_PIN - -/** - * Because PWM hardware channels all share the same frequency, along with the - * fallback software channels, FAST_PWM_FAN is incompatible with Servos. - */ -#if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN) - #error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards." -#endif - -/** - * Test LPC176x-specific configuration values for errors at compile-time. - */ - -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif - -#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) - #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/SPI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/SPI.h deleted file mode 100644 index 559759ea03..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/SPI.h +++ /dev/null @@ -1,48 +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 - -#include "../../shared/HAL_SPI.h" - -#include - -#define MSBFIRST 1 -#define SPI_MODE3 0 - -class SPISettings { - public: - SPISettings(uint32_t speed, int, int) : spi_speed(speed) {}; - uint32_t spiRate() { return spi_speed; } - private: - uint32_t spi_speed; -}; - -class SPIClass { - public: - void begin(); - void beginTransaction(SPISettings); - void endTransaction() {}; - uint8_t transfer(uint8_t data); - uint16_t transfer16(uint16_t data); -}; - -extern SPIClass SPI; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c deleted file mode 100644 index 3ad1aff017..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c +++ /dev/null @@ -1,140 +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 . - * - */ - -// adapted from I2C/master/master.c example -// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if MB(MKS_SBASE) - -#include "digipot_mcp4451_I2C_routines.h" - -#ifdef __cplusplus - extern "C" { -#endif - -// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to -// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. - -static uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) { - // Reset STA, STO, SI - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; - - // Enter to Master Transmitter mode - I2Cx->I2CONSET = I2C_I2CONSET_STA; - - // Wait for complete - while (!(I2Cx->I2CONSET & I2C_I2CONSET_SI)); - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); -} - -static void _I2C_Stop(LPC_I2C_TypeDef *I2Cx) { - // Make sure start bit is not active - if (I2Cx->I2CONSET & I2C_I2CONSET_STA) - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - - I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; -} - -PINSEL_CFG_Type PinCfg; -I2C_M_SETUP_Type transferMCfg; - -#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK) - -uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bit - // Sometimes TX data ACK or NAK status is returned. That mean the start state didn't - // happen which means only the value of the slave address was send. Keep looping until - // the slave address and write bit are actually sent. - do { - _I2C_Stop(I2CDEV_M); // output stop state on I2C bus - _I2C_Start(I2CDEV_M); // output start state on I2C bus - while ((I2C_status != I2C_I2STAT_M_TX_START) - && (I2C_status != I2C_I2STAT_M_TX_RESTART) - && (I2C_status != I2C_I2STAT_M_TX_DAT_ACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK)); //wait for start to be asserted - - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_STAC; // clear start state before tansmitting slave address - LPC_I2C1->I2DAT = (sla << 1) & I2C_I2DAT_BITMASK; // transmit slave address & write bit - LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - while ((I2C_status != I2C_I2STAT_M_TX_SLAW_ACK) - && (I2C_status != I2C_I2STAT_M_TX_SLAW_NACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_ACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK)) { /* wait for slaw to finish */ } - } while ( (I2C_status == I2C_I2STAT_M_TX_DAT_ACK) || (I2C_status == I2C_I2STAT_M_TX_DAT_NACK)); - return 1; -} - -void digipot_mcp4451_init() { - /** - * Init I2C pin connect - */ - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - #if USEDI2CDEV_M == 0 - PinCfg.Funcnum = 1; - PinCfg.Pinnum = 27; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1 - PinCfg.Pinnum = 28; - PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1 - #elif USEDI2CDEV_M == 1 - PinCfg.Funcnum = 3; - PinCfg.Pinnum = 0; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA - PinCfg.Pinnum = 1; - PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL - #elif USEDI2CDEV_M == 2 - PinCfg.Funcnum = 2; - PinCfg.Pinnum = 10; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN - PinCfg.Pinnum = 11; - PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN - #endif - // Initialize I2C peripheral - I2C_Init(I2CDEV_M, 400000); // hardwired to 400KHz bit rate, 100KHz is the other option - - // Enable Master I2C operation - I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE); -} - -uint8_t digipot_mcp4451_send_byte(uint8_t data) { - LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data - LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - while (I2C_status != I2C_I2STAT_M_TX_DAT_ACK && I2C_status != I2C_I2STAT_M_TX_DAT_NACK); // wait for xmit to finish - return 1; -} - -#ifdef __cplusplus - } -#endif - -#endif // MB(MKS_SBASE) -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h deleted file mode 100644 index d7e4b0dc7a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h +++ /dev/null @@ -1,53 +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 - -// adapted from I2C/master/master.c example -// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html - -#define USEDI2CDEV_M 1 // use I2C1 controller - -#if USEDI2CDEV_M == 0 - #define I2CDEV_M LPC_I2C0 -#elif USEDI2CDEV_M == 1 - #define I2CDEV_M LPC_I2C1 -#elif USEDI2CDEV_M == 2 - #define I2CDEV_M LPC_I2C2 -#else - #error "Master I2C device not defined!" -#endif - -#ifdef __cplusplus - extern "C" { -#endif - -#include -#include -#include - -uint8_t digipot_mcp4451_start(uint8_t sla); -void digipot_mcp4451_init(); -uint8_t digipot_mcp4451_send_byte(uint8_t data); - -#ifdef __cplusplus - } -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/main.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/main.cpp deleted file mode 100644 index b20841bdeb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/main.cpp +++ /dev/null @@ -1,170 +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 . - * - */ -#ifdef TARGET_LPC1768 - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern "C" { - #include -} - -#include "../../sd/cardreader.h" -#include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "timers.h" - -extern uint32_t MSC_SD_Init(uint8_t pdrv); -extern "C" int isLPC1769(); -extern "C" void disk_timerproc(); - -void SysTick_Callback() { disk_timerproc(); } - -void HAL_init() { - - // Init LEDs - #if PIN_EXISTS(LED) - SET_DIR_OUTPUT(LED_PIN); - WRITE_PIN_CLR(LED_PIN); - #if PIN_EXISTS(LED2) - SET_DIR_OUTPUT(LED2_PIN); - WRITE_PIN_CLR(LED2_PIN); - #if PIN_EXISTS(LED3) - SET_DIR_OUTPUT(LED3_PIN); - WRITE_PIN_CLR(LED3_PIN); - #if PIN_EXISTS(LED4) - SET_DIR_OUTPUT(LED4_PIN); - WRITE_PIN_CLR(LED4_PIN); - #endif - #endif - #endif - - // Flash status LED 3 times to indicate Marlin has started booting - for (uint8_t i = 0; i < 6; ++i) { - TOGGLE(LED_PIN); - delay(100); - } - #endif - - // Init Servo Pins - #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) - #if HAS_SERVO_0 - INIT_SERVO(0); - #endif - #if HAS_SERVO_1 - INIT_SERVO(1); - #endif - #if HAS_SERVO_2 - INIT_SERVO(2); - #endif - #if HAS_SERVO_3 - INIT_SERVO(3); - #endif - - //debug_frmwrk_init(); - //_DBG("\n\nDebug running\n"); - // Initialise the SD card chip select pins as soon as possible - #if PIN_EXISTS(SS) - OUT_WRITE(SS_PIN, HIGH); - #endif - - #if PIN_EXISTS(ONBOARD_SD_CS) && ONBOARD_SD_CS_PIN != SS_PIN - OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); - #endif - - #ifdef LPC1768_ENABLE_CLKOUT_12M - /** - * CLKOUTCFG register - * bit 8 (CLKOUT_EN) = enables CLKOUT signal. Disabled for now to prevent glitch when enabling GPIO. - * bits 7:4 (CLKOUTDIV) = set to 0 for divider setting of /1 - * bits 3:0 (CLKOUTSEL) = set to 1 to select main crystal oscillator as CLKOUT source - */ - LPC_SC->CLKOUTCFG = (0<<8)|(0<<4)|(1<<0); - // set P1.27 pin to function 01 (CLKOUT) - PINSEL_CFG_Type PinCfg; - PinCfg.Portnum = 1; - PinCfg.Pinnum = 27; - PinCfg.Funcnum = 1; // function 01 (CLKOUT) - PinCfg.OpenDrain = 0; // not open drain - PinCfg.Pinmode = 2; // no pull-up/pull-down - PINSEL_ConfigPin(&PinCfg); - // now set CLKOUT_EN bit - LPC_SC->CLKOUTCFG |= (1<<8); - #endif - - USB_Init(); // USB Initialization - USB_Connect(FALSE); // USB clear connection - delay(1000); // Give OS time to notice - USB_Connect(TRUE); - - #if !BOTH(SHARED_SD_CARD, INIT_SDCARD_ON_BOOT) && DISABLED(NO_SD_HOST_DRIVE) - MSC_SD_Init(0); // Enable USB SD card access - #endif - - const millis_t usb_timeout = millis() + 2000; - while (!USB_Configuration && PENDING(millis(), usb_timeout)) { - delay(50); - HAL_idletask(); - #if PIN_EXISTS(LED) - TOGGLE(LED_PIN); // Flash quickly during USB initialization - #endif - } - - #if NUM_SERIAL > 0 - MYSERIAL0.begin(BAUDRATE); - #if NUM_SERIAL > 1 - MYSERIAL1.begin(BAUDRATE); - #endif - SERIAL_PRINTF("\n\necho:%s (%dMhz) Initialized\n", isLPC1769() ? "LPC1769" : "LPC1768", SystemCoreClock / 1000000); - SERIAL_FLUSHTX(); - #endif - - HAL_timer_init(); -} - -// HAL idle task -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. - // 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. Unfortunately there is currently no way - // to unmount the disk from the LCD menu. - // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) - if (card.isMounted()) - MSC_Aquire_Lock(); - else - MSC_Release_Lock(); - #endif - // Perform USB stack housekeeping - MSC_RunDeferredCommands(); -} - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h deleted file mode 100644 index cafa53b30e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h +++ /dev/null @@ -1,26 +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 - -#include "../shared/persistent_store_api.h" - -#define FLASH_EEPROM_EMULATION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp deleted file mode 100644 index 3de02022eb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp +++ /dev/null @@ -1,132 +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 . - * - */ -#ifdef TARGET_LPC1768 - -/** - * Emulate EEPROM storage using Flash Memory - * - * Use a single 32K flash sector to store EEPROM data. To reduce the - * number of erase operations a simple "levelling" scheme is used that - * maintains a number of EEPROM "slots" within the larger flash sector. - * Each slot is used in turn and the entire sector is only erased when all - * slots have been used. - * - * A simple RAM image is used to hold the EEPROM data during I/O operations - * and this is flushed to the next available slot when an update is complete. - * If RAM usage becomes an issue we could store this image in one of the two - * 16Kb I/O buffers (intended to hold DMA USB and Ethernet data, but currently - * unused). - */ -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "persistent_store_api.h" -#include "../../inc/MarlinConfig.h" - -#if ENABLED(FLASH_EEPROM_EMULATION) - -extern "C" { - #include -} - -#define SECTOR_START(sector) ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000)) -#define EEPROM_SECTOR 29 -#define EEPROM_SIZE (4096) -#define SECTOR_SIZE (32768) -#define EEPROM_SLOTS (SECTOR_SIZE/EEPROM_SIZE) -#define EEPROM_ERASE (0xFF) -#define SLOT_ADDRESS(sector, slot) (((uint8_t *)SECTOR_START(sector)) + slot * EEPROM_SIZE) - -static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; -static bool eeprom_dirty = false; -static int current_slot = 0; - -bool PersistentStore::access_start() { - uint32_t first_nblank_loc, first_nblank_val; - IAP_STATUS_CODE status; - - // discover which slot we are currently using. - __disable_irq(); - status = BlankCheckSector(EEPROM_SECTOR, EEPROM_SECTOR, &first_nblank_loc, &first_nblank_val); - __enable_irq(); - - if (status == CMD_SUCCESS) { - // sector is blank so nothing stored yet - for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE; - current_slot = EEPROM_SLOTS; - } - else { - // current slot is the first non blank one - current_slot = first_nblank_loc / EEPROM_SIZE; - uint8_t *eeprom_data = SLOT_ADDRESS(EEPROM_SECTOR, current_slot); - // load current settings - for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i]; - } - eeprom_dirty = false; - - return true; -} - -bool PersistentStore::access_finish() { - if (eeprom_dirty) { - IAP_STATUS_CODE status; - if (--current_slot < 0) { - // all slots have been used, erase everything and start again - __disable_irq(); - status = EraseSector(EEPROM_SECTOR, EEPROM_SECTOR); - __enable_irq(); - - current_slot = EEPROM_SLOTS - 1; - } - - __disable_irq(); - status = CopyRAM2Flash(SLOT_ADDRESS(EEPROM_SECTOR, current_slot), ram_eeprom, IAP_WRITE_4096); - __enable_irq(); - - if (status != CMD_SUCCESS) return false; - eeprom_dirty = false; - } - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; - eeprom_dirty = true; - crc16(crc, value, size); - pos += size; - return false; // return true for any error -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; - if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; - crc16(crc, buff, size); - pos += size; - return false; // return true for any error -} - -size_t PersistentStore::capacity() { return EEPROM_SIZE; } - -#endif // FLASH_EEPROM_EMULATION -#endif // EEPROM_SETTINGS -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp deleted file mode 100644 index 2454dea195..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../../inc/MarlinConfig.h" -#include "persistent_store_api.h" - -#if DISABLED(FLASH_EEPROM_EMULATION) - -#include -#include - -extern uint32_t MSC_Aquire_Lock(); -extern uint32_t MSC_Release_Lock(); - -FATFS fat_fs; -FIL eeprom_file; -bool eeprom_file_open = false; - -bool PersistentStore::access_start() { - const char eeprom_erase_value = 0xFF; - MSC_Aquire_Lock(); - if (f_mount(&fat_fs, "", 1)) { - MSC_Release_Lock(); - return false; - } - FRESULT res = f_open(&eeprom_file, "eeprom.dat", FA_OPEN_ALWAYS | FA_WRITE | FA_READ); - if (res) MSC_Release_Lock(); - - if (res == FR_OK) { - UINT bytes_written; - FSIZE_t file_size = f_size(&eeprom_file); - f_lseek(&eeprom_file, file_size); - while (file_size < capacity() && res == FR_OK) { - res = f_write(&eeprom_file, &eeprom_erase_value, 1, &bytes_written); - file_size++; - } - } - if (res == FR_OK) { - f_lseek(&eeprom_file, 0); - f_sync(&eeprom_file); - eeprom_file_open = true; - } - return res == FR_OK; -} - -bool PersistentStore::access_finish() { - f_close(&eeprom_file); - f_unmount(""); - MSC_Release_Lock(); - eeprom_file_open = false; - return true; -} - -// This extra chit-chat goes away soon, but is helpful for now -// to see errors that are happening in read_data / write_data -static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) { - PGM_P const rw_str = write ? PSTR("write") : PSTR("read"); - SERIAL_CHAR(' '); - serialprintPGM(rw_str); - SERIAL_ECHOPAIR("_data(", pos); - SERIAL_ECHOPAIR(",", (int)value); - SERIAL_ECHOPAIR(",", (int)size); - SERIAL_ECHOLNPGM(", ...)"); - if (total) { - SERIAL_ECHOPGM(" f_"); - serialprintPGM(rw_str); - SERIAL_ECHOPAIR("()=", (int)s); - SERIAL_ECHOPAIR("\n size=", size); - SERIAL_ECHOPGM("\n bytes_"); - serialprintPGM(write ? PSTR("written=") : PSTR("read=")); - SERIAL_ECHOLN(total); - } - else - SERIAL_ECHOLNPAIR(" f_lseek()=", (int)s); -} - -// File function return codes for type FRESULT. This goes away soon, but -// is helpful right now to see any errors in read_data and write_data. -// -// typedef enum { -// FR_OK = 0, /* (0) Succeeded */ -// FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */ -// FR_INT_ERR, /* (2) Assertion failed */ -// FR_NOT_READY, /* (3) The physical drive cannot work */ -// FR_NO_FILE, /* (4) Could not find the file */ -// FR_NO_PATH, /* (5) Could not find the path */ -// FR_INVALID_NAME, /* (6) The path name format is invalid */ -// FR_DENIED, /* (7) Access denied due to prohibited access or directory full */ -// FR_EXIST, /* (8) Access denied due to prohibited access */ -// FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */ -// FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */ -// FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */ -// FR_NOT_ENABLED, /* (12) The volume has no work area */ -// FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */ -// FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any problem */ -// FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */ -// FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ -// FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ -// FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ -// FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ -// } FRESULT; - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - if (!eeprom_file_open) return true; - FRESULT s; - UINT bytes_written = 0; - - s = f_lseek(&eeprom_file, pos); - if (s) { - debug_rw(true, pos, value, size, s); - return s; - } - - s = f_write(&eeprom_file, (void*)value, size, &bytes_written); - if (s) { - debug_rw(true, pos, value, size, s, bytes_written); - return s; - } - crc16(crc, value, size); - pos += size; - return bytes_written != size; // return true for any error -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - if (!eeprom_file_open) return true; - UINT bytes_read = 0; - FRESULT s; - s = f_lseek(&eeprom_file, pos); - - if (s) { - debug_rw(false, pos, value, size, s); - return true; - } - - if (writing) { - s = f_read(&eeprom_file, (void*)value, size, &bytes_read); - crc16(crc, value, size); - } - else { - uint8_t temp[size]; - s = f_read(&eeprom_file, (void*)temp, size, &bytes_read); - crc16(crc, temp, size); - } - - if (s) { - debug_rw(false, pos, value, size, s, bytes_read); - return true; - } - - pos += size; - return bytes_read != size; // return true for any error -} - -size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM - -#endif // !FLASH_EEPROM_EMULATION -#endif // EEPROM_SETTINGS -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h deleted file mode 100644 index 133cd11be2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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 . - * - */ - -/** - * Support routines for LPC1768 - */ - -/** - * Translation of routines & variables used by pinsDebug.h - */ - -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define pwm_details(pin) pin = pin // do nothing // print PWM details -#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin. -#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0) -#define digitalRead_mod(p) extDigitalRead(p) -#define PRINT_PORT(p) -#define GET_ARRAY_PIN(p) pin_array[p].pin -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%d.%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin - -// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -#ifndef M43_NEVER_TOUCH - #define M43_NEVER_TOUCH(Q) ((Q) == P0_29 || (Q) == P0_30 || (Q) == P2_09) // USB pins -#endif - -bool GET_PINMODE(const pin_t pin) { - if (!LPC176x::pin_is_valid(pin) || LPC176x::pin_adc_enabled(pin)) // found an invalid pin or active analog pin - return false; - - return LPC176x::gpio_direction(pin); -} - -bool GET_ARRAY_IS_DIGITAL(const pin_t pin) { - return (!LPC176x::pin_has_adc(pin) || !LPC176x::pin_adc_enabled(pin)); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/spi_pins.h deleted file mode 100644 index acf991a9d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/spi_pins.h +++ /dev/null @@ -1,54 +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 - -#include "../../core/macros.h" - -#if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) - #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently - // needed due to the speed and mode required for communicating with each device being different. - // This requirement can be removed if the SPI access to these devices is updated to use - // spiBeginTransaction. -#endif - -/** onboard SD card */ -//#define SCK_PIN P0_07 -//#define MISO_PIN P0_08 -//#define MOSI_PIN P0_09 -//#define SS_PIN P0_06 -/** external */ -#ifndef SCK_PIN - #define SCK_PIN P0_15 -#endif -#ifndef MISO_PIN - #define MISO_PIN P0_17 -#endif -#ifndef MOSI_PIN - #define MOSI_PIN P0_18 -#endif -#ifndef SS_PIN - #define SS_PIN P1_23 -#endif -#if !defined(SDSS) || SDSS == P_NC // gets defaulted in pins.h - #undef SDSS - #define SDSS SS_PIN -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.cpp deleted file mode 100644 index 7bf7ff3880..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ - -/** - * Description: - * - * Timers for LPC1768 - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" -#include "timers.h" - -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 - - SBI(LPC_SC->PCONP, SBIT_TIMER1); // Power ON Timer 1 - LPC_TIM1->PR = (HAL_TIMER_RATE) / 1000000 - 1; -} - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - switch (timer_num) { - case 0: - LPC_TIM0->MCR = _BV(SBIT_MR0I) | _BV(SBIT_MR0R); // Match on MR0, reset on MR0, interrupts when NVIC enables them - LPC_TIM0->MR0 = uint32_t(STEPPER_TIMER_RATE) / frequency; // Match value (period) to set frequency - LPC_TIM0->TCR = _BV(SBIT_CNTEN); // Counter Enable - - NVIC_SetPriority(TIMER0_IRQn, NVIC_EncodePriority(0, 1, 0)); - NVIC_EnableIRQ(TIMER0_IRQn); - break; - - case 1: - LPC_TIM1->MCR = _BV(SBIT_MR0I) | _BV(SBIT_MR0R); // Match on MR0, reset on MR0, interrupts when NVIC enables them - LPC_TIM1->MR0 = uint32_t(TEMP_TIMER_RATE) / frequency; - LPC_TIM1->TCR = _BV(SBIT_CNTEN); // Counter Enable - - NVIC_SetPriority(TIMER1_IRQn, NVIC_EncodePriority(0, 2, 0)); - NVIC_EnableIRQ(TIMER1_IRQn); - break; - - default: break; - } -} - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.h deleted file mode 100644 index 5f4e06265e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/timers.h +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * - * 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 - -/** - * - * HAL For LPC1768 - */ - -#include - -#include "../../core/macros.h" - -#define SBIT_TIMER0 1 -#define SBIT_TIMER1 2 - -#define SBIT_CNTEN 0 - -#define SBIT_MR0I 0 // Timer 0 Interrupt when TC matches MR0 -#define SBIT_MR0R 1 // Timer 0 Reset TC on Match -#define SBIT_MR0S 2 // Timer 0 Stop TC and PC on Match -#define SBIT_MR1I 3 -#define SBIT_MR1R 4 -#define SBIT_MR1S 5 -#define SBIT_MR2I 6 -#define SBIT_MR2R 7 -#define SBIT_MR2S 8 -#define SBIT_MR3I 9 -#define SBIT_MR3R 10 -#define SBIT_MR3S 11 - -// ------------------------ -// Defines -// ------------------------ - -#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() -#define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T) - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define HAL_TIMER_RATE ((F_CPU) / 4) // frequency of timers peripherals - -#define STEP_TIMER_NUM 0 // Timer Index for Stepper -#define TEMP_TIMER_NUM 1 // Timer Index for Temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM -#define PWM_TIMER_NUM 3 // Timer Index for PWM - -#define TEMP_TIMER_RATE 1000000 -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#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() _HAL_TIMER_ISR(STEP_TIMER_NUM) -#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM) - -// Timer references by index -#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM) -#define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM) - -// ------------------------ -// Public functions -// ------------------------ -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) { - switch (timer_num) { - case 0: STEP_TIMER->MR0 = compare; break; // Stepper Timer Match Register 0 - case 1: TEMP_TIMER->MR0 = compare; break; // Temp Timer Match Register 0 - } -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - switch (timer_num) { - case 0: return STEP_TIMER->MR0; // Stepper Timer Match Register 0 - case 1: return TEMP_TIMER->MR0; // Temp Timer Match Register 0 - } - return 0; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - switch (timer_num) { - case 0: return STEP_TIMER->TC; // Stepper Timer Count - case 1: return TEMP_TIMER->TC; // Temp Timer Count - } - return 0; -} - -FORCE_INLINE static void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_EnableIRQ(TIMER0_IRQn); break; // Enable interrupt handler - case 1: NVIC_EnableIRQ(TIMER1_IRQn); break; // Enable interrupt handler - } -} - -FORCE_INLINE static void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_DisableIRQ(TIMER0_IRQn); break; // Disable interrupt handler - case 1: NVIC_DisableIRQ(TIMER1_IRQn); break; // Disable interrupt handler - } - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -// This function is missing from CMSIS -FORCE_INLINE static bool NVIC_GetEnableIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[((uint32_t)IRQn) >> 5] & (1 << ((uint32_t)IRQn) & 0x1F)) != 0; -} - -FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case 0: return NVIC_GetEnableIRQ(TIMER0_IRQn); // Check if interrupt is enabled or not - case 1: return NVIC_GetEnableIRQ(TIMER1_IRQn); // Check if interrupt is enabled or not - } - return false; -} - -FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - switch (timer_num) { - case 0: SBI(STEP_TIMER->IR, SBIT_CNTEN); break; - case 1: SBI(TEMP_TIMER->IR, SBIT_CNTEN); break; - } -} - -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp deleted file mode 100644 index 9a95b1b660..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp +++ /dev/null @@ -1,176 +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 . - * - */ - -// adapted from I2C/master/master.c example -// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html - -#ifdef TARGET_LPC1768 - -extern int millis(); - -#ifdef __cplusplus - extern "C" { -#endif - -#include -#include -#include - -#include "../../../core/millis_t.h" - - -////////////////////////////////////////////////////////////////////////////////////// - -// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to -// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. - -static uint32_t _I2C_Start (LPC_I2C_TypeDef *I2Cx) { - // Reset STA, STO, SI - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; - - // Enter to Master Transmitter mode - I2Cx->I2CONSET = I2C_I2CONSET_STA; - - // Wait for complete - while (!(I2Cx->I2CONSET & I2C_I2CONSET_SI)); - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); -} - -static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) { - /* Make sure start bit is not active */ - if (I2Cx->I2CONSET & I2C_I2CONSET_STA) - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - - I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; -} - -////////////////////////////////////////////////////////////////////////////////////// - -#define U8G_I2C_OPT_FAST 16 // from u8g.h - -#define USEDI2CDEV_M 1 - -#define I2CDEV_S_ADDR 0x78 // from SSD1306 //actual address is 0x3C - shift left 1 with LSB set to 0 to indicate write - -#define BUFFER_SIZE 0x1 // only do single byte transfers with LCDs - -#if (USEDI2CDEV_M == 0) - #define I2CDEV_M LPC_I2C0 -#elif (USEDI2CDEV_M == 1) - #define I2CDEV_M LPC_I2C1 -#elif (USEDI2CDEV_M == 2) - #define I2CDEV_M LPC_I2C2 -#else - #error "Master I2C device not defined!" -#endif - -PINSEL_CFG_Type PinCfg; -I2C_M_SETUP_Type transferMCfg; - -#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK) - -uint8_t u8g_i2c_start(uint8_t sla) { // send slave address and write bit - // Sometimes TX data ACK or NAK status is returned. That mean the start state didn't - // happen which means only the value of the slave address was send. Keep looping until - // the slave address and write bit are actually sent. - do{ - _I2C_Stop(I2CDEV_M); // output stop state on I2C bus - _I2C_Start(I2CDEV_M); // output start state on I2C bus - while ((I2C_status != I2C_I2STAT_M_TX_START) - && (I2C_status != I2C_I2STAT_M_TX_RESTART) - && (I2C_status != I2C_I2STAT_M_TX_DAT_ACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK)); //wait for start to be asserted - - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_STAC; // clear start state before tansmitting slave address - LPC_I2C1->I2DAT = I2CDEV_S_ADDR & I2C_I2DAT_BITMASK; // transmit slave address & write bit - LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - while ((I2C_status != I2C_I2STAT_M_TX_SLAW_ACK) - && (I2C_status != I2C_I2STAT_M_TX_SLAW_NACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_ACK) - && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK)); //wait for slaw to finish - }while ( (I2C_status == I2C_I2STAT_M_TX_DAT_ACK) || (I2C_status == I2C_I2STAT_M_TX_DAT_NACK)); - return 1; -} - -void u8g_i2c_init(uint8_t clock_option) { - - /** - * Init I2C pin connect - */ - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - #if ((USEDI2CDEV_M == 0)) - PinCfg.Funcnum = 1; - PinCfg.Pinnum = 27; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1 - PinCfg.Pinnum = 28; - PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1 - #endif - #if ((USEDI2CDEV_M == 1)) - PinCfg.Funcnum = 3; - PinCfg.Pinnum = 0; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA - PinCfg.Pinnum = 1; - PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL - #endif - #if ((USEDI2CDEV_M == 2)) - PinCfg.Funcnum = 2; - PinCfg.Pinnum = 10; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN - PinCfg.Pinnum = 11; - PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN - #endif - // Initialize I2C peripheral - I2C_Init(I2CDEV_M, (clock_option & U8G_I2C_OPT_FAST) ? 400000: 100000); // LCD data rates - - // Enable Master I2C operation - I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE); - - u8g_i2c_start(0); // send slave address and write bit -} - -uint8_t u8g_i2c_send_byte(uint8_t data) { - #define I2C_TIMEOUT 3 - LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data - LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; - LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - const millis_t timeout = millis() + I2C_TIMEOUT; - while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && PENDING(millis(), timeout)); // wait for xmit to finish - // had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens - return 1; -} - -void u8g_i2c_stop() { -} - - -#ifdef __cplusplus - } -#endif - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h deleted file mode 100644 index 9dd594cd9e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h +++ /dev/null @@ -1,28 +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 - -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(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h deleted file mode 100644 index 1153329d89..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h +++ /dev/null @@ -1,49 +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 - -/** - * LPC1768 LCD-specific defines - */ - -// The following are optional depending on the platform. - -// definitions of HAL specific com and device drivers. -uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); -uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); -uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); -uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); -uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - - -// connect U8g com generic com names to the desired driver -#define U8G_COM_HW_SPI u8g_com_HAL_LPC1768_hw_spi_fn // use LPC1768 specific hardware SPI routine -#define U8G_COM_SW_SPI u8g_com_HAL_LPC1768_sw_spi_fn // use LPC1768 specific software SPI routine -#define U8G_COM_ST7920_HW_SPI u8g_com_HAL_LPC1768_ST7920_hw_spi_fn -#define U8G_COM_ST7920_SW_SPI u8g_com_HAL_LPC1768_ST7920_sw_spi_fn -#define U8G_COM_SSD_I2C u8g_com_HAL_LPC1768_ssd_hw_i2c_fn - -// let these default for now -#define U8G_COM_PARALLEL u8g_com_null_fn -#define U8G_COM_T6963 u8g_com_null_fn -#define U8G_COM_FAST_PARALLEL u8g_com_null_fn -#define U8G_COM_UC_I2C u8g_com_null_fn diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h deleted file mode 100644 index 8806e87477..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h +++ /dev/null @@ -1,43 +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 - -/** - * LCD delay routines - used by all the drivers. - * - * These are based on the LPC1768 routines. - * - * Couldn't just call exact copies because the overhead resulted in the - * one microsecond delay being about 4uS. - */ - -#ifdef __cplusplus - extern "C" { -#endif - -void U8g_delay(int msec); -void u8g_MicroDelay(); -void u8g_10MicroDelay(); - -#ifdef __cplusplus - } -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c deleted file mode 100644 index d441b7b4d0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c +++ /dev/null @@ -1,110 +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 . - * - */ - -/** - * Low level pin manipulation routines - used by all the drivers. - * - * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. - * - * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20kHz range which - * resulted in using about about 25% of the CPU's time. - */ - -#ifdef TARGET_LPC1768 - -#include -#include -#include "../../../core/macros.h" -//#include - -#define LPC_PORT_OFFSET (0x0020) -#define LPC_PIN(pin) (1UL << pin) -#define LPC_GPIO(port) ((volatile LPC_GPIO_TypeDef *)(LPC_GPIO0_BASE + LPC_PORT_OFFSET * port)) - -#define INPUT 0 -#define OUTPUT 1 -#define INPUT_PULLUP 2 - -uint8_t LPC1768_PIN_PORT(const uint8_t pin); -uint8_t LPC1768_PIN_PIN(const uint8_t pin); - -#ifdef __cplusplus - extern "C" { -#endif - -// I/O functions -// As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2) -void pinMode_LCD(uint8_t pin, uint8_t mode) { - #define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111)) - #define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111)) - PINSEL_CFG_Type config = { LPC1768_PIN_PORT(pin), - LPC1768_PIN_PIN(pin), - PINSEL_FUNC_0, - PINSEL_PINMODE_TRISTATE, - PINSEL_PINMODE_NORMAL }; - switch (mode) { - case INPUT: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(pin)); - PINSEL_ConfigPin(&config); - break; - case OUTPUT: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR |= LPC_PIN(LPC1768_PIN_PIN(pin)); - PINSEL_ConfigPin(&config); - break; - case INPUT_PULLUP: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(pin)); - config.Pinmode = PINSEL_PINMODE_PULLUP; - PINSEL_ConfigPin(&config); - break; - default: break; - } -} - -void u8g_SetPinOutput(uint8_t internal_pin_number) { - pinMode_LCD(internal_pin_number, 1); // OUTPUT -} - -void u8g_SetPinInput(uint8_t internal_pin_number) { - pinMode_LCD(internal_pin_number, 0); // INPUT -} - -void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status) { - #define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111)) - #define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111)) - if (pin_status) - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOSET = LPC_PIN(LPC1768_PIN_PIN(pin)); - else - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOCLR = LPC_PIN(LPC1768_PIN_PIN(pin)); -} - -uint8_t u8g_GetPinLevel(uint8_t pin) { - #define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111)) - #define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111)) - return (uint32_t)LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOPIN & LPC_PIN(LPC1768_PIN_PIN(pin)) ? 1 : 0; -} - -#ifdef __cplusplus - } -#endif - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h deleted file mode 100644 index 569706b483..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h +++ /dev/null @@ -1,37 +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 - -/** - * Low level pin manipulation routines - used by all the drivers. - * - * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. - * - * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20kHz range which - * resulted in using about about 25% of the CPU's time. - */ - -void u8g_SetPinOutput(uint8_t internal_pin_number); -void u8g_SetPinInput(uint8_t internal_pin_number); -void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status); -uint8_t u8g_GetPinLevel(uint8_t pin); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp deleted file mode 100644 index 057a137445..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp +++ /dev/null @@ -1,129 +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 . - * - */ - -/** - * Based on u8g_com_msp430_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include -#include "../../shared/HAL_SPI.h" - -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); - -uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_INIT: - u8g_SetPILevel(u8g, U8G_PI_CS, 1); - u8g_SetPILevel(u8g, U8G_PI_A0, 1); - u8g_SetPILevel(u8g, U8G_PI_RESET, 1); - u8g_SetPIOutput(u8g, U8G_PI_CS); - u8g_SetPIOutput(u8g, U8G_PI_A0); - u8g_SetPIOutput(u8g, U8G_PI_RESET); - u8g_Delay(5); - spiBegin(); - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card - #endif - spiInit(SPI_SPEED); - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g_SetPILevel(u8g, U8G_PI_A0, arg_val); - break; - - case U8G_COM_MSG_CHIP_SELECT: - u8g_SetPILevel(u8g, U8G_PI_CS, (arg_val ? 0 : 1)); - break; - - case U8G_COM_MSG_RESET: - u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_WRITE_BYTE: - spiSend((uint8_t)arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - spiSend(*ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - spiSend(*ptr++); - arg_val--; - } - } - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp deleted file mode 100644 index b624b24d35..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp +++ /dev/null @@ -1,200 +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 . - * - */ - -/** - * Based on u8g_com_arduino_ssd_i2c.c - * - * COM interface for Arduino (AND ATmega) and the SSDxxxx chip (SOLOMON) variant - * I2C protocol - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Special pin usage: - * U8G_PI_I2C_OPTION additional options - * U8G_PI_A0_STATE used to store the last value of the command/data register selection - * U8G_PI_SET_A0 1: Signal request to update I2C device with new A0_STATE, 0: Do nothing, A0_STATE matches I2C device - * U8G_PI_SCL clock line (NOT USED) - * U8G_PI_SDA data line (NOT USED) - * - * U8G_PI_RESET reset line (currently disabled, see below) - * - * Protocol: - * SLA, Cmd/Data Selection, Arguments - * The command/data register is selected by a special instruction byte, which is sent after SLA - * - * The continue bit is always 0 so that a (re)start is equired for the change from cmd to/data mode - */ - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include - -#define I2C_SLA (0x3C*2) -//#define I2C_CMD_MODE 0x080 -#define I2C_CMD_MODE 0x000 -#define I2C_DATA_MODE 0x040 - -//#define U8G_I2C_OPT_FAST 16 - -uint8_t u8g_com_ssd_I2C_start_sequence(u8g_t *u8g) { - /* are we requested to set the a0 state? */ - if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1; - - /* setup bus, might be a repeated start */ - if (u8g_i2c_start(I2C_SLA) == 0) return 0; - if (u8g->pin_list[U8G_PI_A0_STATE] == 0) { - if (u8g_i2c_send_byte(I2C_CMD_MODE) == 0) return 0; - } - else if (u8g_i2c_send_byte(I2C_DATA_MODE) == 0) - return 0; - - u8g->pin_list[U8G_PI_SET_A0] = 0; - return 1; -} - -uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - //u8g_com_arduino_digital_write(u8g, U8G_PI_SCL, HIGH); - //u8g_com_arduino_digital_write(u8g, U8G_PI_SDA, HIGH); - //u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: unknown mode */ - - u8g_i2c_init(u8g->pin_list[U8G_PI_I2C_OPTION]); - u8g_com_ssd_I2C_start_sequence(u8g); - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - /* Currently disabled, but it could be enable. Previous restrictions have been removed */ - /* u8g_com_arduino_digital_write(u8g, U8G_PI_RESET, arg_val); */ - break; - - case U8G_COM_MSG_CHIP_SELECT: - u8g->pin_list[U8G_PI_A0_STATE] = 0; - u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again, also forces start condition */ - if (arg_val == 0 ) { - /* disable chip, send stop condition */ - u8g_i2c_stop(); - } - else { - /* enable, do nothing: any byte writing will trigger the i2c start */ - } - break; - - case U8G_COM_MSG_WRITE_BYTE: - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) { - u8g_i2c_stop(); - return 0; - } - - if (u8g_i2c_send_byte(arg_val) == 0) { - u8g_i2c_stop(); - return 0; - } - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) { - u8g_i2c_stop(); - return 0; - } - - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - if (u8g_i2c_send_byte(*ptr++) == 0) { - u8g_i2c_stop(); - return 0; - } - arg_val--; - } - } - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) { - u8g_i2c_stop(); - return 0; - } - - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - if (u8g_i2c_send_byte(u8g_pgm_read(ptr)) == 0) - return 0; - ptr++; - arg_val--; - } - } - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g->pin_list[U8G_PI_A0_STATE] = arg_val; - u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again */ - break; - - } // switch - return 1; -} - -#endif // HAS_GRAPHICAL_LCD - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction deleted file mode 100644 index 0222c62280..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction +++ /dev/null @@ -1,254 +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 . - * - */ - -/** - * Based on U8G2 code - u8x8_byte.c - * - * Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) - * - * Copyright (c) 2016, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Software i2c, - * ignores ACK response (which is anyway not provided by some displays) - * also does not allow reading from the device - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include - -//void pinMode(int16_t pin, uint8_t mode); -//void digitalWrite(int16_t pin, uint8_t pin_status); - - -#define I2C_SLA (0x3C*2) -//#define I2C_CMD_MODE 0x080 -#define I2C_CMD_MODE 0x000 -#define I2C_DATA_MODE 0x040 - -//static uint8_t I2C_speed; // 3 - 400KHz, 13 - 100KHz -//#define SPEED_400KHz 3 -//#define SPEED_100KHz 13 - -// #define U8G_I2C_OPT_FAST 16 - -uint8_t SCL_pin_HAL_LPC1768_sw_I2C, SCL_port_HAL_LPC1768_sw_I2C, SDA_pin_HAL_LPC1768_sw_I2C, SDA_port_HAL_LPC1768_sw_I2C; - -#define SPI_SPEED 2 //20: 200KHz 5:750KHz 2:3-4MHz - -uint8_t u8g_i2c_send_byte_sw(uint8_t data) { - for (uint8_t i = 0; i < 9; i++) { // 1 extra bit for the ack/nak - - if (val & 0x80) - for (uint8_t j = 0; j < SPI_SPEED; j++) { - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - } - else - for (uint8_t j = 0; j < SPI_SPEED; j++) { - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - } - - for (uint8_t j = 0; j < SPI_SPEED; j++) { - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - } - - for (uint8_t j = 0; j < SPI_SPEED; j++) { - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - } - val <<= 1; - } - return 1; -} - - -uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send slave address with write bit - /* send the start condition, both lines go from 1 to 0 */ - - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - DELAY_US(2); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - DELAY_US(2); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - DELAY_US(2); - LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C); - DELAY_US(2); - LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C); - - u8g_i2c_send_byte_sw(I2C_SLA); // send slave address with write bit -} - - -void u8g_i2c_stop_sw() { } - -void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit - -uint8_t u8g_com_ssd_I2C_start_sequence_sw(u8g_t *u8g) { - /* are we requested to set the a0 state? */ - if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1; - - /* setup bus, might be a repeated start */ - if (u8g_i2c_start(I2C_SLA) == 0) return 0; - if (u8g->pin_list[U8G_PI_A0_STATE] == 0) { - if (u8g_i2c_send_byte(I2C_CMD_MODE) == 0) return 0; - } - else if (u8g_i2c_send_byte(I2C_DATA_MODE) == 0) return 0; - - u8g->pin_list[U8G_PI_SET_A0] = 0; - - return 1; -} - -uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - - #define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111)) - #define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111)) - SCL_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SCL]); - SCL_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SCL]); - SDA_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SDA]); - SDA_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SDA]); - // As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2) - #define OUTPUT 0x1 - u8g_SetPIOutput(u8g, U8G_PI_SCL); - u8g_SetPIOutput(u8g, U8G_PI_SDA); - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_CS]) u8g_SetPIOutput(u8g, U8G_PI_CS); - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_A0]) u8g_SetPIOutput(u8g, U8G_PI_A0); - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET); - - //u8g_com_arduino_digital_write(u8g, U8G_PI_SCL, HIGH); - //u8g_com_arduino_digital_write(u8g, U8G_PI_SDA, HIGH); - //u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: unknown mode */ - - u8g_i2c_init_sw(u8g->pin_list[U8G_PI_I2C_OPTION]); - u8g_com_ssd_I2C_start_sequence_sw(u8g); - break; - - case U8G_COM_MSG_STOP: break; - - case U8G_COM_MSG_RESET: break; - - case U8G_COM_MSG_CHIP_SELECT: - u8g->pin_list[U8G_PI_A0_STATE] = 0; - u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again, also forces start condition */ - if (arg_val == 0) { - /* disable chip, send stop condition */ - u8g_i2c_stop_sw(); - } - else { - /* enable, do nothing: any byte writing will trigger the i2c start */ - } - break; - - case U8G_COM_MSG_WRITE_BYTE: - //u8g->pin_list[U8G_PI_SET_A0] = 1; - //if (u8g_com_arduino_ssd_start_sequence(u8g) == 0) - // return u8g_i2c_stop(), 0; - if (u8g_i2c_send_byte_sw(arg_val) == 0) - return u8g_i2c_stop_sw(), 0; - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0) - return u8g_i2c_stop_sw(), 0; - - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - if (u8g_i2c_send_byte_sw(*ptr++) == 0) - return u8g_i2c_stop_sw(), 0; - arg_val--; - } - } - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0) - return u8g_i2c_stop_sw(), 0; - - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - if (u8g_i2c_send_byte_sw(u8g_pgm_read(ptr)) == 0) return 0; - ptr++; - arg_val--; - } - } - // u8g_i2c_stop(); - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g->pin_list[U8G_PI_A0_STATE] = arg_val; - u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again */ - u8g_i2c_start_sw(0); // send slave address and write bit - u8g_i2c_send_byte_sw(arg_val ? 0x40 : 0x80); // Write to ? Graphics DRAM mode : Command mode - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp deleted file mode 100644 index ac289c1a20..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp +++ /dev/null @@ -1,138 +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 . - * - */ - -/** - * Based on u8g_com_LPC1768_st7920_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include -#include "../../shared/HAL_SPI.h" -#include "../../shared/Delay.h" - -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); - -static uint8_t rs_last_state = 255; - -static void u8g_com_LPC1768_st7920_write_byte_hw_spi(uint8_t rs, uint8_t val) { - - if (rs != rs_last_state) { // Time to send a command/data byte - rs_last_state = rs; - spiSend(rs ? 0x0FA : 0x0F8); // Send data or command - DELAY_US(40); // Give the controller some time: 20 is bad, 30 is OK, 40 is safe - } - - spiSend(val & 0xF0); - spiSend(val << 4); -} - -uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - u8g_SetPILevel(u8g, U8G_PI_CS, 0); - u8g_SetPIOutput(u8g, U8G_PI_CS); - u8g_Delay(5); - spiBegin(); - spiInit(SPI_EIGHTH_SPEED); // ST7920 max speed is about 1.1 MHz - u8g->pin_list[U8G_PI_A0_STATE] = 0; // initial RS state: command mode - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_ADDRESS: // Define cmd (arg_val = 0) or data mode (arg_val = 1) - u8g->pin_list[U8G_PI_A0_STATE] = arg_val; - break; - - case U8G_COM_MSG_CHIP_SELECT: - u8g_SetPILevel(u8g, U8G_PI_CS, arg_val); // Note: the ST7920 has an active high chip-select - break; - - case U8G_COM_MSG_WRITE_BYTE: - u8g_com_LPC1768_st7920_write_byte_hw_spi(u8g->pin_list[U8G_PI_A0_STATE], arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_LPC1768_st7920_write_byte_hw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_LPC1768_st7920_write_byte_hw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp deleted file mode 100644 index 0a1bd84875..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ /dev/null @@ -1,145 +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 . - * - */ - -/** - * Based on u8g_com_st7920_hw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(U8GLIB_ST7920) - -#include -#include -#include "../../shared/Delay.h" - -#undef SPI_SPEED -#define SPI_SPEED 3 // About 1 MHz - -static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL; -static uint8_t SPI_speed = 0; - -static void u8g_com_LPC1768_st7920_write_byte_sw_spi(uint8_t rs, uint8_t val) { - static uint8_t rs_last_state = 255; - if (rs != rs_last_state) { - // Transfer Data (FA) or Command (F8) - swSpiTransfer(rs ? 0x0FA : 0x0F8, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL); - rs_last_state = rs; - DELAY_US(40); // Give the controller time to process the data: 20 is bad, 30 is OK, 40 is safe - } - swSpiTransfer(val & 0x0F0, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL); - swSpiTransfer(val << 4, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL); -} - -uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - SCK_pin_ST7920_HAL = u8g->pin_list[U8G_PI_SCK]; - MOSI_pin_ST7920_HAL_HAL = u8g->pin_list[U8G_PI_MOSI]; - - u8g_SetPIOutput(u8g, U8G_PI_CS); - u8g_SetPIOutput(u8g, U8G_PI_SCK); - u8g_SetPIOutput(u8g, U8G_PI_MOSI); - u8g_Delay(5); - - SPI_speed = swSpiInit(SPI_SPEED, SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL); - - u8g_SetPILevel(u8g, U8G_PI_CS, 0); - u8g_SetPILevel(u8g, U8G_PI_SCK, 0); - u8g_SetPILevel(u8g, U8G_PI_MOSI, 0); - - u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: command mode */ - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g->pin_list[U8G_PI_A0_STATE] = arg_val; - break; - - case U8G_COM_MSG_CHIP_SELECT: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_CS]) u8g_SetPILevel(u8g, U8G_PI_CS, arg_val); //note: the st7920 has an active high chip select - break; - - case U8G_COM_MSG_WRITE_BYTE: - u8g_com_LPC1768_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_LPC1768_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t*) arg_ptr; - while (arg_val > 0) { - u8g_com_LPC1768_st7920_write_byte_sw_spi(u8g->pin_list[U8G_PI_A0_STATE], *ptr++); - arg_val--; - } - } - break; - } - return 1; -} - -#endif // U8GLIB_ST7920 -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp deleted file mode 100644 index 7b6557148a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ /dev/null @@ -1,207 +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 . - * - */ - -/** - * Based on u8g_com_std_sw_spi.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2015, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef TARGET_LPC1768 - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) - -#include - -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz - -#include -#include -#include -#include - -#include - -uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin ) { - - for (uint8_t i = 0; i < 8; i++) { - if (spi_speed == 0) { - LPC176x::gpio_set(mosi_pin, !!(b & 0x80)); - LPC176x::gpio_set(sck_pin, HIGH); - b <<= 1; - if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; - LPC176x::gpio_set(sck_pin, LOW); - } - else { - const uint8_t state = (b & 0x80) ? HIGH : LOW; - for (uint8_t j = 0; j < spi_speed; j++) - LPC176x::gpio_set(mosi_pin, state); - - for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - LPC176x::gpio_set(sck_pin, HIGH); - - b <<= 1; - if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; - - for (uint8_t j = 0; j < spi_speed; j++) - LPC176x::gpio_set(sck_pin, LOW); - } - } - - return b; -} - -uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin ) { - - for (uint8_t i = 0; i < 8; i++) { - const uint8_t state = (b & 0x80) ? HIGH : LOW; - if (spi_speed == 0) { - LPC176x::gpio_set(sck_pin, LOW); - LPC176x::gpio_set(mosi_pin, state); - LPC176x::gpio_set(mosi_pin, state); // need some setup time - LPC176x::gpio_set(sck_pin, HIGH); - } - else { - for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - LPC176x::gpio_set(sck_pin, LOW); - - for (uint8_t j = 0; j < spi_speed; j++) - LPC176x::gpio_set(mosi_pin, state); - - for (uint8_t j = 0; j < spi_speed; j++) - LPC176x::gpio_set(sck_pin, HIGH); - } - b <<= 1; - if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; - } - - return b; -} - -static uint8_t SPI_speed = 0; - -static void u8g_sw_spi_HAL_LPC1768_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) { - #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864) - swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin); - #else - swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin); - #endif -} - -uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - u8g_SetPIOutput(u8g, U8G_PI_SCK); - u8g_SetPIOutput(u8g, U8G_PI_MOSI); - u8g_SetPIOutput(u8g, U8G_PI_CS); - u8g_SetPIOutput(u8g, U8G_PI_A0); - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET); - SPI_speed = swSpiInit(SPI_SPEED, u8g->pin_list[U8G_PI_SCK], u8g->pin_list[U8G_PI_MOSI]); - u8g_SetPILevel(u8g, U8G_PI_SCK, 0); - u8g_SetPILevel(u8g, U8G_PI_MOSI, 0); - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_CHIP_SELECT: - #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0 - if (arg_val) { // SCK idle state needs to be set to the proper idle state before - // the next chip select goes active - u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active - u8g_SetPILevel(u8g, U8G_PI_CS, LOW); - } - else { - u8g_SetPILevel(u8g, U8G_PI_CS, HIGH); - u8g_SetPILevel(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive - } - #else - u8g_SetPILevel(u8g, U8G_PI_CS, !arg_val); - #endif - break; - - case U8G_COM_MSG_WRITE_BYTE: - u8g_sw_spi_HAL_LPC1768_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - u8g_sw_spi_HAL_LPC1768_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], *ptr++); - arg_val--; - } - } - break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - u8g_sw_spi_HAL_LPC1768_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], u8g_pgm_read(ptr)); - ptr++; - arg_val--; - } - } - break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - u8g_SetPILevel(u8g, U8G_PI_A0, arg_val); - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD && !U8GLIB_ST7920 -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py deleted file mode 100644 index b3ab59026e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py +++ /dev/null @@ -1,144 +0,0 @@ -# -# sets output_port -# if target_filename is found then that drive is used -# else if target_drive is found then that drive is used -# -from __future__ import print_function - -target_filename = "FIRMWARE.CUR" -target_drive = "REARM" - -import os -import platform -current_OS = platform.system() -Import("env") - -def print_error(e): - print('\nUnable to find destination disk (' + e + ')\n' \ - 'Please select it in platformio.ini using the upload_port keyword ' \ - '(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \ - 'or copy the firmware (.pio/build/' + env.get('PIOENV') + '/firmware.bin) manually to the appropriate disk\n') - -try: - if current_OS == 'Windows': - # - # platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:' - # Windows - doesn't care about the disk's name, only cares about the drive letter - # - - # - # get all drives on this computer - # - import subprocess - # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - driveStr = str(subprocess.check_output("fsutil fsinfo drives")) - # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - # driveStr = driveStr.strip().lstrip('Drives: ') <- Doesn't work in other Languages as English. In German is "Drives:" = "Laufwerke:" - FirstFound = driveStr.find(':',0,-1) # Find the first ":" and - driveStr = driveStr[FirstFound + 1 : -1] # truncate to the rest - # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\', - # 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\'] - drives = driveStr.split() - - upload_disk = 'Disk not found' - target_file_found = False - target_drive_found = False - for drive in drives: - final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:' - try: - volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT)) - except Exception as e: - continue - else: - if target_drive in volume_info and target_file_found == False: # set upload if not found target file yet - target_drive_found = True - upload_disk = final_drive_name - if target_filename in volume_info: - if target_file_found == False: - upload_disk = final_drive_name - target_file_found = True - - # - # set upload_port to drive if found - # - - if target_file_found == True or target_drive_found == True: - env.Replace( - UPLOAD_PORT=upload_disk - ) - print('upload disk: ', upload_disk) - else: - print_error('Autodetect Error') - - elif current_OS == 'Linux': - # - # platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive' - # - upload_disk = 'Disk not found' - target_file_found = False - target_drive_found = False - medias = os.listdir('/media') # - for media in medias: - drives = os.listdir('/media/' + media) # - if target_drive in drives and target_file_found == False: # set upload if not found target file yet - target_drive_found = True - upload_disk = '/media/' + media + '/' + target_drive + '/' - for drive in drives: - try: - files = os.listdir('/media/' + media + '/' + drive) - except: - continue - else: - if target_filename in files: - if target_file_found == False: - upload_disk = '/media/' + media + '/' + drive + '/' - target_file_found = True - - # - # set upload_port to drive if found - # - - if target_file_found == True or target_drive_found == True: - env.Replace( - UPLOAD_FLAGS="-P$UPLOAD_PORT", - UPLOAD_PORT=upload_disk - ) - print('upload disk: ', upload_disk) - else: - print_error('Autodetect Error') - - elif current_OS == 'Darwin': # MAC - # - # platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive' - # - upload_disk = 'Disk not found' - drives = os.listdir('/Volumes') # human readable names - target_file_found = False - target_drive_found = False - if target_drive in drives and target_file_found == False: # set upload if not found target file yet - target_drive_found = True - upload_disk = '/Volumes/' + target_drive + '/' - for drive in drives: - try: - filenames = os.listdir('/Volumes/' + drive + '/') # will get an error if the drive is protected - except: - continue - else: - if target_filename in filenames: - if target_file_found == False: - upload_disk = '/Volumes/' + drive + '/' - target_file_found = True - # - # set upload_port to drive if found - # - - if target_file_found == True or target_drive_found == True: - env.Replace( - UPLOAD_PORT=upload_disk - ) - print('\nupload disk: ', upload_disk, '\n') - else: - print_error('Autodetect Error') - -except Exception as e: - print_error(str(e)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp deleted file mode 100644 index c83931745a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp +++ /dev/null @@ -1,37 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EMERGENCY_PARSER) - -#include "../../feature/emergency_parser.h" -EmergencyParser::State emergency_state; -bool CDC_RecvCallback(const char buffer) { - emergency_parser.update(emergency_state, buffer); - return true; -} - -#endif // EMERGENCY_PARSER -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp deleted file mode 100644 index 6d0200e9f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp +++ /dev/null @@ -1,72 +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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include -#include "watchdog.h" - -void watchdog_init() { - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - - // Configure WDT to only trigger an interrupt - // Disable WDT interrupt (just in case, to avoid triggering it!) - NVIC_DisableIRQ(WDT_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Configure WDT to only trigger an interrupt - // Initialize WDT with the given parameters - WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY); - - // Configure and enable WDT interrupt. - NVIC_ClearPendingIRQ(WDT_IRQn); - NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups - NVIC_EnableIRQ(WDT_IRQn); - #else - WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); - #endif - WDT_Start(WDT_TIMEOUT); -} - -void HAL_watchdog_refresh() { - WDT_Feed(); - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif -} - -// Timeout state -bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); } -void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); } - -#endif // USE_WATCHDOG - -#endif // TARGET_LPC1768 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.h deleted file mode 100644 index dd6617ea31..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/watchdog.h +++ /dev/null @@ -1,30 +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 - -#define WDT_TIMEOUT 4000000 // 4 second timeout - -void watchdog_init(); -void HAL_watchdog_refresh(); - -bool watchdog_timed_out(); -void watchdog_clear_timeout_flag(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf deleted file mode 100644 index 4732eb8552..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf +++ /dev/null @@ -1,36 +0,0 @@ -[Version] -Signature="$Windows NT$" -Class=Ports -ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} -Provider=%PROVIDER% -DriverVer =04/14/2008, 5.1.2600.5512 - -[Manufacturer] -%PROVIDER%=DeviceList,ntamd64 - - -[DeviceList] -%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 - -[DeviceList.ntamd64] -%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 - - -[LPC1768USB] -include=mdmcpq.inf -CopyFiles=FakeModemCopyFileSection -AddReg=LowerFilterAddReg,SerialPropPageAddReg - -[LPC1768USB.Services] -include=mdmcpq.inf -AddService=usbser, 0x00000002, LowerFilter_Service_Inst - -[SerialPropPageAddReg] -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - - -[Strings] -PROVIDER = "marlinfw.org" -DRIVER.SVC = "Marlin USB Driver" -DESCRIPTION= "Marlin USB Serial" -COMPOSITE = "Marlin USB VCOM" \ No newline at end of file diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.cpp deleted file mode 100644 index 1c53042f8d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -#ifdef __SAMD51__ - -#include "../../inc/MarlinConfig.h" -#include -#include - -// ------------------------ -// Local defines -// ------------------------ - -#if HAS_TEMP_ADC_0 - #define GET_TEMP_0_ADC() PIN_TO_ADC(TEMP_0_PIN) -#else - #define GET_TEMP_0_ADC() -1 -#endif -#if HAS_TEMP_ADC_1 - #define GET_TEMP_1_ADC() PIN_TO_ADC(TEMP_1_PIN) -#else - #define GET_TEMP_1_ADC() -1 -#endif -#if HAS_TEMP_ADC_2 - #define GET_TEMP_2_ADC() PIN_TO_ADC(TEMP_2_PIN) -#else - #define GET_TEMP_2_ADC() -1 -#endif -#if HAS_TEMP_ADC_3 - #define GET_TEMP_3_ADC() PIN_TO_ADC(TEMP_3_PIN) -#else - #define GET_TEMP_3_ADC() -1 -#endif -#if HAS_TEMP_ADC_4 - #define GET_TEMP_4_ADC() PIN_TO_ADC(TEMP_4_PIN) -#else - #define GET_TEMP_4_ADC() -1 -#endif -#if HAS_TEMP_ADC_5 - #define GET_TEMP_5_ADC() PIN_TO_ADC(TEMP_5_PIN) -#else - #define GET_TEMP_5_ADC() -1 -#endif -#if HAS_TEMP_ADC_BED - #define GET_BED_ADC() PIN_TO_ADC(TEMP_BED_PIN) -#else - #define GET_BED_ADC() -1 -#endif -#if HAS_TEMP_ADC_CHAMBER - #define GET_CHAMBER_ADC() PIN_TO_ADC(TEMP_CHAMBER_PIN) -#else - #define GET_CHAMBER_ADC() -1 -#endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #define GET_FILAMENT_WIDTH_ADC() PIN_TO_ADC(FILWIDTH_PIN) -#else - #define GET_FILAMENT_WIDTH_ADC() -1 -#endif -#if HAS_ADC_BUTTONS - #define GET_BUTTONS_ADC() PIN_TO_ADC(ADC_KEYPAD_PIN) -#else - #define GET_BUTTONS_ADC() -1 -#endif - -#define IS_ADC_REQUIRED(n) (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n \ - || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n \ - || GET_BED_ADC() == n \ - || GET_CHAMBER_ADC() == n \ - || GET_FILAMENT_WIDTH_ADC() == n \ - || GET_BUTTONS_ADC() == n) - -#define ADC0_IS_REQUIRED IS_ADC_REQUIRED(0) -#define ADC1_IS_REQUIRED IS_ADC_REQUIRED(1) -#define ADC_IS_REQUIRED (ADC0_IS_REQUIRED || ADC1_IS_REQUIRED) -#if ADC0_IS_REQUIRED - #define FIRST_ADC 0 -#else - #define FIRST_ADC 1 -#endif -#if ADC1_IS_REQUIRED - #define LAST_ADC 1 -#else - #define LAST_ADC 0 -#endif - -#define DMA_IS_REQUIRED ADC_IS_REQUIRED - -// ------------------------ -// Types -// ------------------------ - -#if DMA_IS_REQUIRED - - // Struct must be 32 bits aligned because of DMA accesses but fields needs to be 8 bits packed - typedef struct __attribute__((aligned(4), packed)) { - ADC_INPUTCTRL_Type INPUTCTRL; - } HAL_DMA_DAC_Registers; // DMA transfered registers - -#endif - -// ------------------------ -// Private Variables -// ------------------------ - -uint16_t HAL_adc_result; - -#if ADC_IS_REQUIRED - - // Pins used by ADC inputs. Order must be ADC0 inputs first then ADC1 - const uint8_t adc_pins[] = { - // ADC0 pins - #if GET_TEMP_0_ADC() == 0 - TEMP_0_PIN, - #endif - #if GET_TEMP_1_ADC() == 0 - TEMP_1_PIN, - #endif - #if GET_TEMP_2_ADC() == 0 - TEMP_2_PIN, - #endif - #if GET_TEMP_3_ADC() == 0 - TEMP_3_PIN, - #endif - #if GET_TEMP_4_ADC() == 0 - TEMP_4_PIN, - #endif - #if GET_TEMP_5_ADC() == 0 - TEMP_5_PIN, - #endif - #if GET_BED_ADC() == 0 - TEMP_BED_PIN, - #endif - #if GET_CHAMBER_ADC() == 0 - TEMP_CHAMBER_PIN, - #endif - #if GET_FILAMENT_WIDTH_ADC() == 0 - FILWIDTH_PIN, - #endif - #if GET_BUTTONS_ADC() == 0 - ADC_KEYPAD_PIN, - #endif - // ADC1 pins - #if GET_TEMP_0_ADC() == 1 - TEMP_0_PIN, - #endif - #if GET_TEMP_1_ADC() == 1 - TEMP_1_PIN, - #endif - #if GET_TEMP_2_ADC() == 1 - TEMP_2_PIN, - #endif - #if GET_TEMP_3_ADC() == 1 - TEMP_3_PIN, - #endif - #if GET_TEMP_4_ADC() == 1 - TEMP_4_PIN, - #endif - #if GET_TEMP_5_ADC() == 1 - TEMP_5_PIN, - #endif - #if GET_BED_ADC() == 1 - TEMP_BED_PIN, - #endif - #if GET_CHAMBER_ADC() == 1 - TEMP_CHAMBER_PIN, - #endif - #if GET_FILAMENT_WIDTH_ADC() == 1 - FILWIDTH_PIN, - #endif - #if GET_BUTTONS_ADC() == 1 - ADC_KEYPAD_PIN, - #endif - }; - - uint16_t HAL_adc_results[COUNT(adc_pins)]; - - #if ADC0_IS_REQUIRED - Adafruit_ZeroDMA adc0DMAProgram, - adc0DMARead; - - const HAL_DMA_DAC_Registers adc0_dma_regs_list[] = { - #if GET_TEMP_0_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, - #endif - #if GET_TEMP_1_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_1_PIN) }, - #endif - #if GET_TEMP_2_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_2_PIN) }, - #endif - #if GET_TEMP_3_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_3_PIN) }, - #endif - #if GET_TEMP_4_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_4_PIN) }, - #endif - #if GET_TEMP_5_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, - #endif - #if GET_BED_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, - #endif - #if GET_CHAMBER_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, - #endif - #if GET_FILAMENT_WIDTH_ADC() == 0 - { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, - #endif - #if GET_BUTTONS_ADC() == 0 - { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, - #endif - }; - - #define ADC0_AINCOUNT COUNT(adc0_dma_regs_list) - #endif // ADC0_IS_REQUIRED - - #if ADC1_IS_REQUIRED - Adafruit_ZeroDMA adc1DMAProgram, - adc1DMARead; - - const HAL_DMA_DAC_Registers adc1_dma_regs_list[] = { - #if GET_TEMP_0_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, - #endif - #if GET_TEMP_1_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_1_PIN) }, - #endif - #if GET_TEMP_2_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_2_PIN) }, - #endif - #if GET_TEMP_3_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_3_PIN) }, - #endif - #if GET_TEMP_4_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_4_PIN) }, - #endif - #if GET_TEMP_5_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, - #endif - #if GET_BED_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, - #endif - #if GET_CHAMBER_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, - #endif - #if GET_FILAMENT_WIDTH_ADC() == 1 - { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, - #endif - #if GET_BUTTONS_ADC() == 1 - { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, - #endif - }; - - #define ADC1_AINCOUNT COUNT(adc1_dma_regs_list) - #endif // ADC1_IS_REQUIRED - -#endif // ADC_IS_REQUIRED - -// ------------------------ -// Private functions -// ------------------------ - -#if DMA_IS_REQUIRED - - void dma_init() { - DmacDescriptor *descriptor; - - #if ADC0_IS_REQUIRED - adc0DMAProgram.setTrigger(ADC0_DMAC_ID_SEQ); - adc0DMAProgram.setAction(DMA_TRIGGER_ACTON_BEAT); - adc0DMAProgram.loop(true); - if (adc0DMAProgram.allocate() == DMA_STATUS_OK) { - descriptor = adc0DMAProgram.addDescriptor( - (void *)adc0_dma_regs_list, // SRC - (void *)&ADC0->DSEQDATA.reg, // DEST - sizeof(adc0_dma_regs_list) / 4, // CNT - DMA_BEAT_SIZE_WORD, - true, // SRCINC - false, // DSTINC - DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE - DMA_STEPSEL_SRC // STEPSEL - ); - if (descriptor != nullptr) - descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; - adc0DMAProgram.startJob(); - } - - adc0DMARead.setTrigger(ADC0_DMAC_ID_RESRDY); - adc0DMARead.setAction(DMA_TRIGGER_ACTON_BEAT); - adc0DMARead.loop(true); - if (adc0DMARead.allocate() == DMA_STATUS_OK) { - adc0DMARead.addDescriptor( - (void *)&ADC0->RESULT.reg, // SRC - &HAL_adc_results, // DEST - ADC0_AINCOUNT, // CNT - DMA_BEAT_SIZE_HWORD, - false, // SRCINC - true, // DSTINC - DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE - DMA_STEPSEL_DST // STEPSEL - ); - adc0DMARead.startJob(); - } - #endif - #if ADC1_IS_REQUIRED - adc1DMAProgram.setTrigger(ADC1_DMAC_ID_SEQ); - adc1DMAProgram.setAction(DMA_TRIGGER_ACTON_BEAT); - adc1DMAProgram.loop(true); - if (adc1DMAProgram.allocate() == DMA_STATUS_OK) { - descriptor = adc1DMAProgram.addDescriptor( - (void *)adc1_dma_regs_list, // SRC - (void *)&ADC1->DSEQDATA.reg, // DEST - sizeof(adc1_dma_regs_list) / 4, // CNT - DMA_BEAT_SIZE_WORD, - true, // SRCINC - false, // DSTINC - DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE - DMA_STEPSEL_SRC // STEPSEL - ); - if (descriptor != nullptr) - descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; - adc1DMAProgram.startJob(); - } - - adc1DMARead.setTrigger(ADC1_DMAC_ID_RESRDY); - adc1DMARead.setAction(DMA_TRIGGER_ACTON_BEAT); - adc1DMARead.loop(true); - if (adc1DMARead.allocate() == DMA_STATUS_OK) { - adc1DMARead.addDescriptor( - (void *)&ADC1->RESULT.reg, // SRC - &HAL_adc_results[ADC0_AINCOUNT], // DEST - ADC1_AINCOUNT, // CNT - DMA_BEAT_SIZE_HWORD, - false, // SRCINC - true, // DSTINC - DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE - DMA_STEPSEL_DST // STEPSEL - ); - adc1DMARead.startJob(); - } - #endif - - DMAC->PRICTRL0.bit.RRLVLEN0 = true; // Activate round robin for DMA channels required by ADCs - } - -#endif // DMA_IS_REQUIRED - -// ------------------------ -// Public functions -// ------------------------ - -// HAL initialization task -void HAL_init() { - #if DMA_IS_REQUIRED - dma_init(); - #endif - #if ENABLED(SDSUPPORT) - // 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 - #endif -} - -// HAL idle task -/* -void HAL_idletask() { -} -*/ - -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() { - RSTC_RCAUSE_Type resetCause; - - resetCause.reg = REG_RSTC_RCAUSE; - if (resetCause.bit.POR) return RST_POWER_ON; - else if (resetCause.bit.EXT) return RST_EXTERNAL; - else if (resetCause.bit.BODCORE || resetCause.bit.BODVDD) return RST_BROWN_OUT; - else if (resetCause.bit.WDT) return RST_WATCHDOG; - else if (resetCause.bit.SYST || resetCause.bit.NVM) return RST_SOFTWARE; - else if (resetCause.bit.BACKUP) return RST_BACKUP; - return 0; -} -#pragma pop_macro("WDT") - -extern "C" { - void * _sbrk(int incr); - - extern unsigned int __bss_end__; // end of bss section -} - -// Return free memory between end of heap (or end bss) and whatever is current -int freeMemory() { - int free_memory, heap_end = (int)_sbrk(0); - return (int)&free_memory - (heap_end ?: (int)&__bss_end__); -} - -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_init() { - #if ADC_IS_REQUIRED - memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values - - for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi) - pinPeripheral(adc_pins[pi], PIO_ANALOG); - - for (uint8_t ai = FIRST_ADC; ai <= LAST_ADC; ++ai) { - Adc* adc = ((Adc*[])ADC_INSTS)[ai]; - - // ADC clock setup - GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN = false; - SYNC(GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN); - GCLK->PCHCTRL[ADC0_GCLK_ID + ai].reg = GCLK_PCHCTRL_GEN_GCLK1 | GCLK_PCHCTRL_CHEN; // 48MHz startup code programmed - SYNC(!GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN); - adc->CTRLA.bit.PRESCALER = ADC_CTRLA_PRESCALER_DIV32_Val; // 1.5MHZ adc clock - - // ADC setup - // Preloaded data (fixed for all ADC instances hence not loaded by DMA) - adc->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; // VRefA pin - SYNC(adc->SYNCBUSY.bit.REFCTRL); - adc->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val; - SYNC(adc->SYNCBUSY.bit.CTRLB); - adc->SAMPCTRL.bit.SAMPLEN = (6 - 1); // Sampling clocks - adc->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_16 | ADC_AVGCTRL_ADJRES(4); // 16 Accumulated conversions and shift 4 to get oversampled 12 bits result - SYNC(adc->SYNCBUSY.bit.AVGCTRL); - // Registers loaded by DMA - adc->DSEQCTRL.bit.INPUTCTRL = true; - - adc->DSEQCTRL.bit.AUTOSTART = true; // Start conversion after DMA sequence - - adc->CTRLA.bit.ENABLE = true; // Enable ADC - SYNC(adc->SYNCBUSY.bit.ENABLE); - } - #endif // ADC_IS_REQUIRED -} - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - #if ADC_IS_REQUIRED - for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi) { - if (adc_pin == adc_pins[pi]) { - HAL_adc_result = HAL_adc_results[pi]; - return; - } - } - #endif - - HAL_adc_result = 0xFFFF; -} - -uint16_t HAL_adc_get_result() { - return HAL_adc_result; -} - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.h deleted file mode 100644 index dea84da5d1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#define CPU_32_BIT - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "timers.h" - -#ifdef ADAFRUIT_GRAND_CENTRAL_M4 - #include "MarlinSerial_AGCM4.h" - - // Serial ports - #if !WITHIN(SERIAL_PORT, -1, 3) - #error "SERIAL_PORT must be from -1 to 3" - #endif - - // MYSERIAL0 required before MarlinSerial includes! - #if SERIAL_PORT == -1 - #define MYSERIAL0 Serial - #elif SERIAL_PORT == 0 - #define MYSERIAL0 Serial1 - #elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial2 - #elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial3 - #else - #define MYSERIAL0 Serial4 - #endif - - #ifdef SERIAL_PORT_2 - #if !WITHIN(SERIAL_PORT_2, -1, 3) - #error "SERIAL_PORT_2 must be from -1 to 3" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 Serial - #elif SERIAL_PORT_2 == 0 - #define MYSERIAL1 Serial1 - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 Serial2 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 Serial3 - #else - #define MYSERIAL1 Serial4 - #endif - #else - #define NUM_SERIAL 1 - #endif - -#endif // ADAFRUIT_GRAND_CENTRAL_M4 - -typedef int8_t pin_t; - -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo - -// -// Interrupts -// -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -#define cli() __disable_irq() // Disable interrupts -#define sei() __enable_irq() // Enable interrupts - -void HAL_clear_reset_source(); // clear reset reason -uint8_t HAL_get_reset_source(); // get reset reason - -// -// EEPROM -// -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *pos); - -// -// ADC -// -extern uint16_t HAL_adc_result; // result of last ADC conversion - -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_init(); - -#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL -#define HAL_ADC_RESOLUTION 12 -#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(); - -// -// Pin Map -// -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -// -// Tone -// -void toneInit(); -void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); -void noTone(const pin_t _pin); - -// Enable hooks into idle and setup for HAL -void HAL_init(); -/* -#define HAL_IDLETASK 1 -void HAL_idletask(); -*/ - -// -// Utility functions -// -FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp deleted file mode 100644 index bbd12912a2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -/** - * Hardware and software SPI implementations are included in this file. - * - * Control of the slave select pin(s) is handled by the calling routines and - * SAMD51 let hardware SPI handling to remove SS from its logic. - */ - -#ifdef __SAMD51__ - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "../../inc/MarlinConfig.h" -#include - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -#if EITHER(SOFTWARE_SPI, FORCE_SOFT_SPI) - - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for SAMD51. Use Hardware SPI." - - #if SD_CONNECTION_IS(ONBOARD) - #endif - -#else // !SOFTWARE_SPI - - #ifdef ADAFRUIT_GRAND_CENTRAL_M4 - #if SD_CONNECTION_IS(ONBOARD) - #define sdSPI SDCARD_SPI - #else - #define sdSPI SPI - #endif - #endif - - static SPISettings spiConfig; - - // ------------------------ - // Hardware SPI - // ------------------------ - void spiBegin() { - spiInit(SPI_HALF_SPEED); - } - - void spiInit(uint8_t spiRate) { - // Use datarates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 8000000; break; - case SPI_HALF_SPEED: clock = 4000000; break; - case SPI_QUARTER_SPEED: clock = 2000000; break; - case SPI_EIGHTH_SPEED: clock = 1000000; break; - case SPI_SIXTEENTH_SPEED: clock = 500000; break; - case SPI_SPEED_5: clock = 250000; break; - case SPI_SPEED_6: clock = 125000; break; - default: clock = 4000000; break; // Default from the SPI library - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - sdSPI.begin(); - } - - /** - * @brief Receives a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ - uint8_t spiRec() { - sdSPI.beginTransaction(spiConfig); - uint8_t returnByte = sdSPI.transfer(0xFF); - sdSPI.endTransaction(); - return returnByte; - } - - /** - * @brief Receives a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - */ - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte == 0) return; - memset(buf, 0xFF, nbyte); - sdSPI.beginTransaction(spiConfig); - sdSPI.transfer(buf, nbyte); - sdSPI.endTransaction(); - } - - /** - * @brief Sends a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ - void spiSend(uint8_t b) { - sdSPI.beginTransaction(spiConfig); - sdSPI.transfer(b); - sdSPI.endTransaction(); - } - - /** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Uses DMA - */ - void spiSendBlock(uint8_t token, const uint8_t* buf) { - sdSPI.beginTransaction(spiConfig); - sdSPI.transfer(token); - sdSPI.transfer((uint8_t*)buf, nullptr, 512); - sdSPI.endTransaction(); - } - - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - spiConfig = SPISettings(spiClock, (BitOrder)bitOrder, dataMode); - sdSPI.beginTransaction(spiConfig); - } -#endif // !SOFTWARE_SPI - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp deleted file mode 100644 index 2da4d8c07e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -#ifdef ADAFRUIT_GRAND_CENTRAL_M4 - -/** - * Framework doesn't define some serial to save sercom resources - * hence if these are used I need to define them - */ - -#include "../../inc/MarlinConfig.h" - -#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 - Uart Serial2(&sercom4, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX); - void SERCOM4_0_Handler() { Serial2.IrqHandler(); } - void SERCOM4_1_Handler() { Serial2.IrqHandler(); } - void SERCOM4_2_Handler() { Serial2.IrqHandler(); } - void SERCOM4_3_Handler() { Serial2.IrqHandler(); } -#endif - -#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 - Uart Serial3(&sercom1, PIN_SERIAL3_RX, PIN_SERIAL3_TX, PAD_SERIAL3_RX, PAD_SERIAL3_TX); - void SERCOM1_0_Handler() { Serial3.IrqHandler(); } - void SERCOM1_1_Handler() { Serial3.IrqHandler(); } - void SERCOM1_2_Handler() { Serial3.IrqHandler(); } - void SERCOM1_3_Handler() { Serial3.IrqHandler(); } -#endif - -#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 - Uart Serial4(&sercom5, PIN_SERIAL4_RX, PIN_SERIAL4_TX, PAD_SERIAL4_RX, PAD_SERIAL4_TX); - void SERCOM5_0_Handler() { Serial4.IrqHandler(); } - void SERCOM5_1_Handler() { Serial4.IrqHandler(); } - void SERCOM5_2_Handler() { Serial4.IrqHandler(); } - void SERCOM5_3_Handler() { Serial4.IrqHandler(); } -#endif - -#endif // ADAFRUIT_GRAND_CENTRAL_M4 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h deleted file mode 100644 index 0768d8a04e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -extern Uart Serial2; -extern Uart Serial3; -extern Uart Serial4; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/SAMD51.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/SAMD51.h deleted file mode 100644 index d29d134c00..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/SAMD51.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#define SYNC(sc) while (sc) { \ - asm(""); \ - } - -// Get SAMD port/pin from specified arduino pin -#define GET_SAMD_PORT(P) _GET_SAMD_PORT(PIN_TO_SAMD_PIN(P)) -#define GET_SAMD_PIN(P) _GET_SAMD_PIN(PIN_TO_SAMD_PIN(P)) - -// Get external interrupt line associated to specified arduino pin -#define PIN_TO_EILINE(P) _SAMDPORTPIN_TO_EILINE(GET_SAMD_PORT(P), GET_SAMD_PIN(P)) - -// Get adc/ain associated to specified arduino pin -#define PIN_TO_ADC(P) (ANAPIN_TO_ADCAIN(P) >> 8) -#define PIN_TO_AIN(P) (ANAPIN_TO_ADCAIN(P) & 0xFF) - -// Private defines -#define PIN_TO_SAMD_PIN(P) DIO##P##_PIN - -#define _GET_SAMD_PORT(P) ((P) >> 5) -#define _GET_SAMD_PIN(P) ((P) & 0x1F) - -// Get external interrupt line -#define _SAMDPORTPIN_TO_EILINE(P,B) ((P == 0 && WITHIN(B, 0, 31) && B != 8 && B != 26 && B != 28 && B != 29) ? (B) & 0xF \ - : (P == 1 && (WITHIN(B, 0, 25) || WITHIN(B, 30, 31))) ? (B) & 0xF \ - : (P == 1 && WITHIN(B, 26, 29)) ? 12 + (B) - 26 \ - : (P == 2 && (WITHIN(B, 0, 6) || WITHIN(B, 10, 31)) && B != 29) ? (B) & 0xF \ - : (P == 2 && B == 7) ? 9 \ - : (P == 3 && WITHIN(B, 0, 1)) ? (B) \ - : (P == 3 && WITHIN(B, 8, 12)) ? 3 + (B) - 8 \ - : (P == 3 && WITHIN(B, 20, 21)) ? 10 + (B) - 20 \ - : -1) - -// Get adc/ain -#define ANAPIN_TO_ADCAIN(P) _PIN_TO_ADCAIN(ANAPIN_TO_SAMDPIN(P)) -#define _PIN_TO_ADCAIN(P) _SAMDPORTPIN_TO_ADCAIN(_GET_SAMD_PORT(P), _GET_SAMD_PIN(P)) - -#define _SAMDPORTPIN_TO_ADCAIN(P,B) ((P == 0 && WITHIN(B, 2, 3)) ? 0x000 + (B) - 2 \ - : (P == 0 && WITHIN(B, 4, 7)) ? 0x000 + (B) \ - : (P == 0 && WITHIN(B, 8, 9)) ? 0x100 + 2 + (B) - 8 \ - : (P == 0 && WITHIN(B, 10, 11)) ? 0x000 + (B) \ - : (P == 1 && WITHIN(B, 0, 3)) ? 0x000 + 12 + (B) \ - : (P == 1 && WITHIN(B, 4, 7)) ? 0x100 + 6 + (B) - 4 \ - : (P == 1 && WITHIN(B, 8, 9)) ? 0x100 + (B) - 8 \ - : (P == 2 && WITHIN(B, 0, 1)) ? 0x100 + 10 + (B) \ - : (P == 2 && WITHIN(B, 2, 3)) ? 0x100 + 4 + (B) - 2 \ - : (P == 2 && WITHIN(B, 30, 31)) ? 0x100 + 12 + (B) - 30 \ - : (P == 3 && WITHIN(B, 0, 1)) ? 0x100 + 14 + (B) \ - : -1) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/Servo.cpp deleted file mode 100644 index dbae750425..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/Servo.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -/** - * This comes from Arduino library which at the moment is buggy and uncompilable - */ - -#ifdef __SAMD51__ - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "../shared/Marduino.h" -#include "../shared/servo.h" -#include "../shared/servo_private.h" -#include "SAMD51.h" -#include "timers.h" - -#define __TC_GCLK_ID(t) TC##t##_GCLK_ID -#define _TC_GCLK_ID(t) __TC_GCLK_ID(t) -#define TC_GCLK_ID _TC_GCLK_ID(SERVO_TC) - -#define _TC_PRESCALER(d) TC_CTRLA_PRESCALER_DIV##d##_Val -#define TC_PRESCALER(d) _TC_PRESCALER(d) - -#define __SERVO_IRQn(t) TC##t##_IRQn -#define _SERVO_IRQn(t) __SERVO_IRQn(t) -#define SERVO_IRQn _SERVO_IRQn(SERVO_TC) - -#define HAL_SERVO_TIMER_ISR() TC_HANDLER(SERVO_TC) - -#define TIMER_TCCHANNEL(t) ((t) & 1) -#define TC_COUNTER_START_VAL 0xFFFF - - -static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval) - -FORCE_INLINE static uint16_t getTimerCount() { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; - - tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC; - SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB || tc->COUNT16.SYNCBUSY.bit.COUNT); - - return tc->COUNT16.COUNT.reg; -} - -// ---------------------------- -// Interrupt handler for the TC -// ---------------------------- -HAL_SERVO_TIMER_ISR() { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; - const timer16_Sequence_t timer = - #ifndef _useTimer1 - _timer2 - #elif !defined(_useTimer2) - _timer1 - #else - (tc->COUNT16.INTFLAG.reg & tc->COUNT16.INTENSET.reg & TC_INTFLAG_MC0) ? _timer1 : _timer2 - #endif - ; - const uint8_t tcChannel = TIMER_TCCHANNEL(timer); - - if (currentServoIndex[timer] < 0) { - #if defined(_useTimer1) && defined(_useTimer2) - if (currentServoIndex[timer ^ 1] >= 0) { - // Wait for both channels - // Clear the interrupt - tc->COUNT16.INTFLAG.reg = (tcChannel == 0) ? TC_INTFLAG_MC0 : TC_INTFLAG_MC1; - return; - } - #endif - tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; - SYNC(tc->COUNT16.SYNCBUSY.bit.COUNT); - } - else if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && SERVO(timer, currentServoIndex[timer]).Pin.isActive) - digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, LOW); // pulse this channel low if activated - - // Select the next servo controlled by this timer - currentServoIndex[timer]++; - - if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && currentServoIndex[timer] < SERVOS_PER_TIMER) { - if (SERVO(timer, currentServoIndex[timer]).Pin.isActive) // check if activated - digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high - - tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)SERVO(timer, currentServoIndex[timer]).ticks; - } - else { - // finished all channels so wait for the refresh period to expire before starting over - currentServoIndex[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - - const uint16_t tcCounterValue = getTimerCount(); - - if ((TC_COUNTER_START_VAL - tcCounterValue) + 4UL < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - tc->COUNT16.CC[tcChannel].reg = TC_COUNTER_START_VAL - (uint16_t)usToTicks(REFRESH_INTERVAL); - else - tc->COUNT16.CC[tcChannel].reg = (uint16_t)(tcCounterValue - 4UL); // at least REFRESH_INTERVAL has elapsed - } - if (tcChannel == 0) { - SYNC(tc->COUNT16.SYNCBUSY.bit.CC0); - // Clear the interrupt - tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; - } - else { - SYNC(tc->COUNT16.SYNCBUSY.bit.CC1); - // Clear the interrupt - tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC1; - } -} - -void initISR(timer16_Sequence_t timer) { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; - const uint8_t tcChannel = TIMER_TCCHANNEL(timer); - - static bool initialized = false; // Servo TC has been initialized - if (!initialized) { - NVIC_DisableIRQ(SERVO_IRQn); - - // Disable the timer - tc->COUNT16.CTRLA.bit.ENABLE = false; - SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); - - // Select GCLK0 as timer/counter input clock source - GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN = false; - SYNC(GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN); - GCLK->PCHCTRL[TC_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed - SYNC(!GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN); - - // Reset the timer - tc->COUNT16.CTRLA.bit.SWRST = true; - SYNC(tc->COUNT16.SYNCBUSY.bit.SWRST); - SYNC(tc->COUNT16.CTRLA.bit.SWRST); - - // Set timer counter mode to 16 bits - tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16; - - // Set timer counter mode as normal PWM - tc->COUNT16.WAVE.bit.WAVEGEN = TCC_WAVE_WAVEGEN_NPWM_Val; - - // Set the prescaler factor - tc->COUNT16.CTRLA.bit.PRESCALER = TC_PRESCALER(SERVO_TIMER_PRESCALER); - - // Count down - tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_DIR; - SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB); - - // Reset all servo indexes - memset((void *)currentServoIndex, 0xFF, sizeof(currentServoIndex)); - - // Configure interrupt request - NVIC_ClearPendingIRQ(SERVO_IRQn); - NVIC_SetPriority(SERVO_IRQn, 5); - NVIC_EnableIRQ(SERVO_IRQn); - - initialized = true; - } - - if (!tc->COUNT16.CTRLA.bit.ENABLE) { - // Reset the timer counter - tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; - SYNC(tc->COUNT16.SYNCBUSY.bit.COUNT); - - // Enable the timer and start it - tc->COUNT16.CTRLA.bit.ENABLE = true; - SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); - } - // First interrupt request after 1 ms - tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)usToTicks(1000UL); - - if (tcChannel == 0 ) { - SYNC(tc->COUNT16.SYNCBUSY.bit.CC0); - - // Clear pending match interrupt - tc->COUNT16.INTFLAG.reg = TC_INTENSET_MC0; - // Enable the match channel interrupt request - tc->COUNT16.INTENSET.reg = TC_INTENSET_MC0; - } - else { - SYNC(tc->COUNT16.SYNCBUSY.bit.CC1); - - // Clear pending match interrupt - tc->COUNT16.INTFLAG.reg = TC_INTENSET_MC1; - // Enable the match channel interrupt request - tc->COUNT16.INTENSET.reg = TC_INTENSET_MC1; - } -} - -void finISR(timer16_Sequence_t timer) { - Tc * const tc = TimerConfig[SERVO_TC].pTimer; - const uint8_t tcChannel = TIMER_TCCHANNEL(timer); - - // Disable the match channel interrupt request - tc->COUNT16.INTENCLR.reg = (tcChannel == 0) ? TC_INTENCLR_MC0 : TC_INTENCLR_MC1; - - if (true - #if defined(_useTimer1) && defined(_useTimer2) - && (tc->COUNT16.INTENCLR.reg & (TC_INTENCLR_MC0|TC_INTENCLR_MC1)) == 0 - #endif - ) { - // Disable the timer if not used - tc->COUNT16.CTRLA.bit.ENABLE = false; - SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); - } -} - -#endif // HAS_SERVOS - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h deleted file mode 100644 index 8b77d5b503..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#define _useTimer1 -#define _useTimer2 - -#define TRIM_DURATION 5 // compensation ticks to trim adjust for digitalWrite delays -#define SERVO_TIMER_PRESCALER 64 // timer prescaler factor to 64 (avoid overflowing 16-bit clock counter, at 120MHz this is 1831 ticks per millisecond - -#define SERVO_TC 3 - -typedef enum { - #ifdef _useTimer1 - _timer1, - #endif - #ifdef _useTimer2 - _timer2, - #endif - _Nbr_16timers -} timer16_Sequence_t; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h deleted file mode 100644 index 1f66e02e31..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -/** - * Endstop interrupts for ATMEL SAMD51 based targets. - * - * On SAMD51, all pins support external interrupt capability. - * Any pin can be used for external interrupts, but there are some restrictions. - * At most 16 different external interrupts can be used at one time. - * Further, you can’t just pick any 16 pins to use. This is because every pin on the SAMD51 - * connects to what is called an EXTINT line, and only one pin per EXTINT line can be used for external - * interrupts at a time - */ - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2)) -#if HAS_X_MAX - #define MATCH_X_MAX_EILINE(P) MATCH_EILINE(P, X_MAX_PIN) -#else - #define MATCH_X_MAX_EILINE(P) false -#endif -#if HAS_X_MIN - #define MATCH_X_MIN_EILINE(P) MATCH_EILINE(P, X_MIN_PIN) -#else - #define MATCH_X_MIN_EILINE(P) false -#endif -#if HAS_Y_MAX - #define MATCH_Y_MAX_EILINE(P) MATCH_EILINE(P, Y_MAX_PIN) -#else - #define MATCH_Y_MAX_EILINE(P) false -#endif -#if HAS_Y_MIN - #define MATCH_Y_MIN_EILINE(P) MATCH_EILINE(P, Y_MIN_PIN) -#else - #define MATCH_Y_MIN_EILINE(P) false -#endif -#if HAS_Z_MAX - #define MATCH_Z_MAX_EILINE(P) MATCH_EILINE(P, Z_MAX_PIN) -#else - #define MATCH_Z_MAX_EILINE(P) false -#endif -#if HAS_Z_MIN - #define MATCH_Z_MIN_EILINE(P) MATCH_EILINE(P, Z_MIN_PIN) -#else - #define MATCH_Z_MIN_EILINE(P) false -#endif -#if HAS_Z2_MAX - #define MATCH_Z2_MAX_EILINE(P) MATCH_EILINE(P, Z2_MAX_PIN) -#else - #define MATCH_Z2_MAX_EILINE(P) false -#endif -#if HAS_Z2_MIN - #define MATCH_Z2_MIN_EILINE(P) MATCH_EILINE(P, Z2_MIN_PIN) -#else - #define MATCH_Z2_MIN_EILINE(P) false -#endif -#if HAS_Z3_MAX - #define MATCH_Z3_MAX_EILINE(P) MATCH_EILINE(P, Z3_MAX_PIN) -#else - #define MATCH_Z3_MAX_EILINE(P) false -#endif -#if HAS_Z3_MIN - #define MATCH_Z3_MIN_EILINE(P) MATCH_EILINE(P, Z3_MIN_PIN) -#else - #define MATCH_Z3_MIN_EILINE(P) false -#endif -#if HAS_Z_MIN_PROBE_PIN - #define MATCH_Z_MIN_PROBE_EILINE(P) MATCH_EILINE(P, Z_MIN_PROBE_PIN) -#else - #define MATCH_Z_MIN_PROBE_EILINE(P) false -#endif -#define AVAILABLE_EILINE(P) (PIN_TO_EILINE(P) != -1 \ - && !MATCH_X_MAX_EILINE(P) && !MATCH_X_MIN_EILINE(P) \ - && !MATCH_Y_MAX_EILINE(P) && !MATCH_Y_MIN_EILINE(P) \ - && !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \ - && !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \ - && !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \ - && !MATCH_Z_MIN_PROBE_EILINE(P)) - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -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."); - #endif - attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_X_MIN - #if !AVAILABLE_EILINE(X_MIN_PIN) - static_assert(false, "X_MIN_PIN has no EXTINT line available."); - #endif - attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MAX - #if !AVAILABLE_EILINE(Y_MAX_PIN) - static_assert(false, "Y_MAX_PIN has no EXTINT line available."); - #endif - attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MIN - #if !AVAILABLE_EILINE(Y_MIN_PIN) - static_assert(false, "Y_MIN_PIN has no EXTINT line available."); - #endif - attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MAX - #if !AVAILABLE_EILINE(Z_MAX_PIN) - static_assert(false, "Z_MAX_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN - #if !AVAILABLE_EILINE(Z_MIN_PIN) - static_assert(false, "Z_MIN_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MAX - #if !AVAILABLE_EILINE(Z2_MAX_PIN) - static_assert(false, "Z2_MAX_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MIN - #if !AVAILABLE_EILINE(Z2_MIN_PIN) - static_assert(false, "Z2_MIN_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MAX - #if !AVAILABLE_EILINE(Z3_MAX_PIN) - static_assert(false, "Z3_MAX_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MIN - #if !AVAILABLE_EILINE(Z3_MIN_PIN) - static_assert(false, "Z3_MIN_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - #if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN) - static_assert(false, "Z_MIN_PROBE_PIN has no EXTINT line available."); - #endif - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/fastio.h deleted file mode 100644 index ecd9acea44..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/fastio.h +++ /dev/null @@ -1,252 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 IO functions for SAMD51 - */ - -#include "SAMD51.h" - -/** - * Utility functions - */ - -#ifndef MASK - #define MASK(PIN) (1 << PIN) -#endif - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); - */ - -// Read a pin -#define READ(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].IN.reg & MASK(GET_SAMD_PIN(IO))) != 0) - -// Write to a pin -#define WRITE(IO,V) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t mask = MASK(GET_SAMD_PIN(IO)); \ - \ - if (V) PORT->Group[port].OUTSET.reg = mask; \ - else PORT->Group[port].OUTCLR.reg = mask; \ - }while(0) - -// Toggle a pin -#define TOGGLE(IO) PORT->Group[(EPortType)GET_SAMD_PORT(IO)].OUTTGL.reg = MASK(GET_SAMD_PIN(IO)); - -// Set pin as input -#define SET_INPUT(IO) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t pin = GET_SAMD_PIN(IO); \ - \ - PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \ - PORT->Group[port].DIRCLR.reg = MASK(pin); \ - }while(0) -// Set pin as input with pullup -#define SET_INPUT_PULLUP(IO) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t pin = GET_SAMD_PIN(IO); \ - const uint32_t mask = MASK(pin); \ - \ - PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN); \ - PORT->Group[port].DIRCLR.reg = mask; \ - PORT->Group[port].OUTSET.reg = mask; \ - }while(0) -// Set pin as input with pulldown -#define SET_INPUT_PULLDOWN(IO) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t pin = GET_SAMD_PIN(IO); \ - const uint32_t mask = MASK(pin); \ - \ - PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN); \ - PORT->Group[port].DIRCLR.reg = mask; \ - PORT->Group[port].OUTCLR.reg = mask; \ - }while(0) -// Set pin as output (push pull) -#define SET_OUTPUT(IO) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t pin = GET_SAMD_PIN(IO); \ - \ - PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \ - PORT->Group[port].DIRSET.reg = MASK(pin); \ - }while(0) -// Set pin as output (open drain) -#define SET_OUTPUT_OD(IO) do{ \ - const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ - const uint32_t pin = GET_SAMD_PIN(IO); \ - \ - PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_PULLEN); \ - PORT->Group[port].DIRCLR.reg = MASK(pin); \ - }while(0) -// Set pin as PWM (push pull) -#define SET_PWM(IO) SET_OUTPUT(IO) -// Set pin as PWM (open drain) -#define SET_PWM_OD(IO) SET_OUTPUT_OD(IO) - -// check if pin is an output -#define IS_OUTPUT(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].DIR.reg & MASK(GET_SAMD_PIN(IO))) \ - || (PORT->Group[(EPortType)GET_SAMD_PORT(IO)].PINCFG[GET_SAMD_PIN(IO)].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN) -// check if pin is an input -#define IS_INPUT(IO) !IS_OUTPUT(IO) - -// Shorthand -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) -#define OUT_WRITE_OD(IO,V) do{ SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -/** - * Ports and functions - * Added as necessary or if I feel like it- not a comprehensive list! - */ - -#ifdef ADAFRUIT_GRAND_CENTRAL_M4 - - /* - * Adafruit Grand Central M4 has a lot of PWMs the availables are listed here. - * Some of these share the same source and so can't be used in the same time - */ - #define PWM_PIN(P) (WITHIN(P, 2, 13) || WITHIN(P, 22, 23) || WITHIN(P, 44, 45) || P == 48) - - // Return fullfilled ADCx->INPUTCTRL.reg - #define PIN_TO_INPUTCTRL(P) ( (PIN_TO_AIN(P) == 0) ? ADC_INPUTCTRL_MUXPOS_AIN0 \ - : (PIN_TO_AIN(P) == 1) ? ADC_INPUTCTRL_MUXPOS_AIN1 \ - : (PIN_TO_AIN(P) == 2) ? ADC_INPUTCTRL_MUXPOS_AIN2 \ - : (PIN_TO_AIN(P) == 3) ? ADC_INPUTCTRL_MUXPOS_AIN3 \ - : (PIN_TO_AIN(P) == 4) ? ADC_INPUTCTRL_MUXPOS_AIN4 \ - : (PIN_TO_AIN(P) == 5) ? ADC_INPUTCTRL_MUXPOS_AIN5 \ - : (PIN_TO_AIN(P) == 6) ? ADC_INPUTCTRL_MUXPOS_AIN6 \ - : (PIN_TO_AIN(P) == 7) ? ADC_INPUTCTRL_MUXPOS_AIN7 \ - : (PIN_TO_AIN(P) == 8) ? ADC_INPUTCTRL_MUXPOS_AIN8 \ - : (PIN_TO_AIN(P) == 9) ? ADC_INPUTCTRL_MUXPOS_AIN9 \ - : (PIN_TO_AIN(P) == 10) ? ADC_INPUTCTRL_MUXPOS_AIN10 \ - : (PIN_TO_AIN(P) == 11) ? ADC_INPUTCTRL_MUXPOS_AIN11 \ - : (PIN_TO_AIN(P) == 12) ? ADC_INPUTCTRL_MUXPOS_AIN12 \ - : (PIN_TO_AIN(P) == 13) ? ADC_INPUTCTRL_MUXPOS_AIN13 \ - : (PIN_TO_AIN(P) == 14) ? ADC_INPUTCTRL_MUXPOS_AIN14 \ - : ADC_INPUTCTRL_MUXPOS_AIN15) - - #define ANAPIN_TO_SAMDPIN(P) ( (P == 0) ? PIN_TO_SAMD_PIN(67) \ - : (P == 1) ? PIN_TO_SAMD_PIN(68) \ - : (P == 2) ? PIN_TO_SAMD_PIN(69) \ - : (P == 3) ? PIN_TO_SAMD_PIN(70) \ - : (P == 4) ? PIN_TO_SAMD_PIN(71) \ - : (P == 5) ? PIN_TO_SAMD_PIN(72) \ - : (P == 6) ? PIN_TO_SAMD_PIN(73) \ - : (P == 7) ? PIN_TO_SAMD_PIN(74) \ - : (P == 8) ? PIN_TO_SAMD_PIN(54) \ - : (P == 9) ? PIN_TO_SAMD_PIN(55) \ - : (P == 10) ? PIN_TO_SAMD_PIN(56) \ - : (P == 11) ? PIN_TO_SAMD_PIN(57) \ - : (P == 12) ? PIN_TO_SAMD_PIN(58) \ - : (P == 13) ? PIN_TO_SAMD_PIN(59) \ - : (P == 14) ? PIN_TO_SAMD_PIN(60) \ - : (P == 15) ? PIN_TO_SAMD_PIN(61) \ - : (P == 16) ? PIN_TO_SAMD_PIN(12) \ - : (P == 17) ? PIN_TO_SAMD_PIN(13) \ - : PIN_TO_SAMD_PIN(9)) - - #define digitalPinToAnalogInput(P) (WITHIN(P, 67, 74) ? (P) - 67 : WITHIN(P, 54, 61) ? 8 + (P) - 54 : WITHIN(P, 12, 13) ? 16 + (P) - 12 : P == 9 ? 18 : -1) - - /* - * pins - */ - - // PORTA - #define DIO67_PIN PIN_PA02 // A0 - #define DIO59_PIN PIN_PA04 // A13 - #define DIO68_PIN PIN_PA05 // A1 - #define DIO60_PIN PIN_PA06 // A14 - #define DIO61_PIN PIN_PA07 // A15 - #define DIO26_PIN PIN_PA12 - #define DIO27_PIN PIN_PA13 - #define DIO28_PIN PIN_PA14 - #define DIO23_PIN PIN_PA15 - #define DIO37_PIN PIN_PA16 - #define DIO36_PIN PIN_PA17 - #define DIO35_PIN PIN_PA18 - #define DIO34_PIN PIN_PA19 - #define DIO33_PIN PIN_PA20 - #define DIO32_PIN PIN_PA21 - #define DIO31_PIN PIN_PA22 - #define DIO30_PIN PIN_PA23 - // PORTB - #define DIO12_PIN PIN_PB00 // A16 - #define DIO13_PIN PIN_PB01 // A17 - #define DIO9_PIN PIN_PB02 // A18 - #define DIO69_PIN PIN_PB03 // A2 - #define DIO74_PIN PIN_PB04 // A7 - #define DIO54_PIN PIN_PB05 // A8 - #define DIO55_PIN PIN_PB06 // A9 - #define DIO56_PIN PIN_PB07 // A10 - #define DIO57_PIN PIN_PB08 // A11 - #define DIO58_PIN PIN_PB09 // A12 - #define DIO18_PIN PIN_PB12 - #define DIO19_PIN PIN_PB13 - #define DIO39_PIN PIN_PB14 - #define DIO38_PIN PIN_PB15 - #define DIO14_PIN PIN_PB16 - #define DIO15_PIN PIN_PB17 - #define DIO8_PIN PIN_PB18 - #define DIO29_PIN PIN_PB19 - #define DIO20_PIN PIN_PB20 - #define DIO21_PIN PIN_PB21 - #define DIO10_PIN PIN_PB22 - #define DIO11_PIN PIN_PB23 - #define DIO1_PIN PIN_PB24 - #define DIO0_PIN PIN_PB25 - #define DIO83_PIN PIN_PB28 // SD_CS - #define DIO95_PIN PIN_PB31 // SD_CD - // PORTC - #define DIO70_PIN PIN_PC00 // A3 - #define DIO71_PIN PIN_PC01 // A4 - #define DIO72_PIN PIN_PC02 // A5 - #define DIO73_PIN PIN_PC03 // A6 - #define DIO48_PIN PIN_PC04 - #define DIO49_PIN PIN_PC05 - #define DIO46_PIN PIN_PC06 - #define DIO47_PIN PIN_PC07 - #define DIO45_PIN PIN_PC10 - #define DIO44_PIN PIN_PC11 - #define DIO41_PIN PIN_PC12 - #define DIO40_PIN PIN_PC13 - #define DIO43_PIN PIN_PC14 - #define DIO42_PIN PIN_PC15 - #define DIO25_PIN PIN_PC16 - #define DIO24_PIN PIN_PC17 - #define DIO2_PIN PIN_PC18 - #define DIO3_PIN PIN_PC19 - #define DIO4_PIN PIN_PC20 - #define DIO5_PIN PIN_PC21 - #define DIO16_PIN PIN_PC22 - #define DIO17_PIN PIN_PC23 - #define DIO88_PIN PIN_PC24 // NEOPIXEL - // PORTD - #define DIO22_PIN PIN_PD12 - #define DIO6_PIN PIN_PD20 - #define DIO7_PIN PIN_PD21 - -#endif // ADAFRUIT_GRAND_CENTRAL_M4 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h deleted file mode 100644 index 0f27d8bf35..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -/** - * Test SAMD51 specific configuration values for errors at compile-time. - */ - -#if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif - -#if defined(MAX6675_SCK_PIN) && defined(MAX6675_DO_PIN) && (MAX6675_SCK_PIN == SCK1 || MAX6675_DO_PIN == MISO1) - #error "OnBoard SPI BUS can't be shared with other devices." -#endif - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(SDIO_SUPPORT) - #error "SDIO_SUPPORT is not supported." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif - -#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM) - #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp deleted file mode 100644 index e41dd85c85..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -#ifdef __SAMD51__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" - -#if NONE(SPI_EEPROM, I2C_EEPROM) - #define NVMCTRL_CMD(c) do{ \ - SYNC(!NVMCTRL->STATUS.bit.READY); \ - NVMCTRL->INTFLAG.bit.DONE = true; \ - NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \ - SYNC(NVMCTRL->INTFLAG.bit.DONE); \ - }while(0) - #define NVMCTRL_FLUSH() do{ \ - if (NVMCTRL->SEESTAT.bit.LOAD) \ - NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \ - }while(0) -#endif - -bool PersistentStore::access_start() { - #if NONE(SPI_EEPROM, I2C_EEPROM) - NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active - #endif - - return true; -} - -bool PersistentStore::access_finish() { - #if NONE(SPI_EEPROM, I2C_EEPROM) - NVMCTRL_FLUSH(); - if (!NVMCTRL->SEESTAT.bit.LOCK) - NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access - #endif - - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - #if NONE(SPI_EEPROM, I2C_EEPROM) - if (NVMCTRL->SEESTAT.bit.RLOCK) - NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access - #endif - - while (size--) { - const uint8_t v = *value; - #if ANY(SPI_EEPROM, I2C_EEPROM) - uint8_t * const p = (uint8_t * const)pos; - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - delay(2); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - #else - SYNC(NVMCTRL->SEESTAT.bit.BUSY); - if (NVMCTRL->INTFLAG.bit.SEESFULL) - NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer' - ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v; - SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC); - #endif - crc16(crc, &v, 1); - pos++; - value++; - } - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - while (size--) { - uint8_t c; - #if ANY(SPI_EEPROM, I2C_EEPROM) - c = eeprom_read_byte((uint8_t*)pos); - #else - SYNC(NVMCTRL->SEESTAT.bit.BUSY); - c = ((volatile uint8_t *)SEEPROM_ADDR)[pos]; - #endif - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } - return false; -} - -size_t PersistentStore::capacity() { - #if ANY(SPI_EEPROM, I2C_EEPROM) - return E2END + 1; - #else - const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ, - sblk = NVMCTRL->SEESTAT.bit.SBLK; - - if (!psz && !sblk) return 0; - else if (psz <= 2) return (0x200 << psz); - else if (sblk == 1 || psz == 3) return 4096; - else if (sblk == 2 || psz == 4) return 8192; - else if (sblk <= 4 || psz == 5) return 16384; - else if (sblk >= 9 && psz == 7) return 65536; - else return 32768; - #endif -} - -#endif // EEPROM_SETTINGS - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h deleted file mode 100644 index 64f6929c00..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#define NUMBER_PINS_TOTAL PINS_COUNT - -#define digitalRead_mod(p) extDigitalRead(p) -#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) -#define GET_ARRAY_PIN(p) pin_array[p].pin -#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital -#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL) -#define DIGITAL_PIN_TO_ANALOG_PIN(p) digitalPinToAnalogInput(p) -#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P)!=-1) -#define pwm_status(pin) digitalPinHasPWM(pin) -#define MULTI_NAME_PAD 27 // space needed to be pretty if not first name assigned to a pin - -// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -// uses pin index -#define M43_NEVER_TOUCH(Q) ((Q) >= 75) - -bool GET_PINMODE(int8_t pin) { // 1: output, 0: input - const EPortType samdport = g_APinDescription[pin].ulPort; - const uint32_t samdpin = g_APinDescription[pin].ulPin; - return PORT->Group[samdport].DIR.reg & MASK(samdpin) || (PORT->Group[samdport].PINCFG[samdpin].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN; -} - -void pwm_details(int32_t pin) { - if (pwm_status(pin)) { - //uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative; - //SERIAL_ECHOPAIR("PWM = ", duty); - } -} - -/** - * AGCM4 Board pin | PORT | Label - * ----------------+--------+------- - * 0 | PB25 | "RX0" - * 1 | PB24 | "TX0" - * 2 | PC18 | - * 3 | PC19 | - * 4 | PC20 | - * 5 | PC21 | - * 6 | PD20 | - * 7 | PD21 | - * 8 | PB18 | - * 9 | PB2 | - * 10 | PB22 | - * 11 | PB23 | - * 12 | PB0 | "A16" - * 13 | PB1 | LED AMBER "L" / "A17" - * 14 | PB16 | "TX3" - * 15 | PB17 | "RX3" - * 16 | PC22 | "TX2" - * 17 | PC23 | "RX2" - * 18 | PB12 | "TX1" / "A18" - * 19 | PB13 | "RX1" - * 20 | PB20 | "SDA" - * 21 | PB21 | "SCL" - * 22 | PD12 | - * 23 | PA15 | - * 24 | PC17 | - * 25 | PC16 | - * 26 | PA12 | - * 27 | PA13 | - * 28 | PA14 | - * 29 | PB19 | - * 30 | PA23 | - * 31 | PA22 | - * 32 | PA21 | - * 33 | PA20 | - * 34 | PA19 | - * 35 | PA18 | - * 36 | PA17 | - * 37 | PA16 | - * 38 | PB15 | - * 39 | PB14 | - * 40 | PC13 | - * 41 | PC12 | - * 42 | PC15 | - * 43 | PC14 | - * 44 | PC11 | - * 45 | PC10 | - * 46 | PC6 | - * 47 | PC7 | - * 48 | PC4 | - * 49 | PC5 | - * 50 | PD11 | - * 51 | PD8 | - * 52 | PD9 | - * 53 | PD10 | - * 54 | PB5 | "A8" - * 55 | PB6 | "A9" - * 56 | PB7 | "A10" - * 57 | PB8 | "A11" - * 58 | PB9 | "A12" - * 69 | PA4 | "A13" - * 60 | PA6 | "A14" - * 61 | PA7 | "A15" - * 62 | PB17 | - * 63 | PB20 | - * 64 | PD11 | - * 65 | PD8 | - * 66 | PD9 | - * 67 | PA2 | "A0" / "DAC0" - * 68 | PA5 | "A1" / "DAC1" - * 69 | PB3 | "A2" - * 70 | PC0 | "A3" - * 71 | PC1 | "A4" - * 72 | PC2 | "A5" - * 73 | PC3 | "A6" - * 74 | PB4 | "A7" - * 75 | PC31 | LED GREEN "RX" - * 76 | PC30 | LED GREEN "TX" - * 77 | PA27 | USB: Host enable - * 78 | PA24 | USB: D- - * 79 | PA25 | USB: D+ - * 80 | PB29 | SD: MISO - * 81 | PB27 | SD: SCK - * 82 | PB26 | SD: MOSI - * 83 | PB28 | SD: CS - * 84 | PA3 | AREF - * 85 | PA2 | DAC0 (Duplicate) - * 86 | PA5 | DAC1 (Duplicate) - * 87 | PB1 | LED AMBER "L" (Duplicate) - * 88 | PC24 | NeoPixel - * 89 | PB10 | QSPI: SCK - * 90 | PB11 | QSPI: CS - * 91 | PA8 | QSPI: IO0 - * 92 | PA9 | QSPI: IO1 - * 93 | PA10 | QSPI: IO2 - * 94 | PA11 | QSPI: IO3 - * - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/spi_pins.h deleted file mode 100644 index 3315fa08ac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/spi_pins.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#ifdef ADAFRUIT_GRAND_CENTRAL_M4 - - /* - * AGCM4 Default SPI Pins - * - * SS SCK MISO MOSI - * +-------------------------+ - * SPI | 53 52 50 51 | - * SPI1 | 83 81 80 82 | - * +-------------------------+ - * Any pin can be used for Chip Select (SS_PIN) - */ - #ifndef SCK_PIN - #define SCK_PIN 52 - #endif - #ifndef MISO_PIN - #define MISO_PIN 50 - #endif - #ifndef MOSI_PIN - #define MOSI_PIN 51 - #endif - #ifndef SDSS - #define SDSS 53 - #endif - -#else - - #error "Unsupported board!" - -#endif - -#define SS_PIN SDSS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.cpp deleted file mode 100644 index 2434043966..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -#ifdef __SAMD51__ - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- -#include "../../inc/MarlinConfig.h" -#include "timers.h" - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -#define NUM_HARDWARE_TIMERS 8 - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS] = { - { TC0, TC0_IRQn, TC_PRIORITY(0) }, - { TC1, TC1_IRQn, TC_PRIORITY(1) }, - { TC2, TC2_IRQn, TC_PRIORITY(2) }, // Reserved by framework tone function - { TC3, TC3_IRQn, TC_PRIORITY(3) }, // Reserved by servo library - { TC4, TC4_IRQn, TC_PRIORITY(4) }, - { TC5, TC5_IRQn, TC_PRIORITY(5) }, - { TC6, TC6_IRQn, TC_PRIORITY(6) }, - { TC7, TC7_IRQn, TC_PRIORITY(7) } -}; - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -FORCE_INLINE void Disable_Irq(IRQn_Type irq) { - NVIC_DisableIRQ(irq); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - Tc * const tc = TimerConfig[timer_num].pTimer; - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - - // Disable interrupt, just in case it was already enabled - Disable_Irq(irq); - - // Disable timer interrupt - tc->COUNT32.INTENCLR.reg = TC_INTENCLR_OVF; // disable overflow interrupt - - // TCn clock setup - const uint8_t clockID = GCLK_CLKCTRL_IDs[TCC_INST_NUM + timer_num]; - GCLK->PCHCTRL[clockID].bit.CHEN = false; - SYNC(GCLK->PCHCTRL[clockID].bit.CHEN); - GCLK->PCHCTRL[clockID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed - SYNC(!GCLK->PCHCTRL[clockID].bit.CHEN); - - // Stop timer, just in case, to be able to reconfigure it - tc->COUNT32.CTRLA.bit.ENABLE = false; - SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE); - - // Reset timer - tc->COUNT32.CTRLA.bit.SWRST = true; - SYNC(tc->COUNT32.SYNCBUSY.bit.SWRST); - - NVIC_SetPriority(irq, TimerConfig[timer_num].priority); - - // Wave mode, reset counter on overflow on 0 (I use count down to prevent double buffer use) - tc->COUNT32.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ; - tc->COUNT32.CTRLA.reg = TC_CTRLA_MODE_COUNT32 | TC_CTRLA_PRESCALER_DIV1; - tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_DIR; - SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB); - - // Set compare value - tc->COUNT32.COUNT.reg = tc->COUNT32.CC[0].reg = (HAL_TIMER_RATE) / frequency; - - // And start timer - tc->COUNT32.CTRLA.bit.ENABLE = true; - SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE); - - // Enable interrupt on RC compare - tc->COUNT32.INTENSET.reg = TC_INTENCLR_OVF; // enable overflow interrupt - - // Finally, enable IRQ - NVIC_EnableIRQ(irq); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - NVIC_EnableIRQ(irq); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - Disable_Irq(irq); -} - -// missing from CMSIS: Check if interrupt is enabled or not -static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0; -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; - return NVIC_GetEnabledIRQ(irq); -} - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.h deleted file mode 100644 index 80c37d14af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/timers.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -#include - -// -------------------------------------------------------------------------- -// Defines -// -------------------------------------------------------------------------- - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define HAL_TIMER_RATE SystemCoreClock // frequency of timers peripherals - -#define STEP_TIMER_NUM 0 // index of timer to use for stepper (also +1 for 32bits counter) -#define PULSE_TIMER_NUM STEP_TIMER_NUM -#define TEMP_TIMER_NUM 4 // index of timer to use for temperature (also +1 for 32bits counter) - -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -#define TC_PRIORITY(t) (t == STEP_TIMER_NUM || t == PULSE_TIMER_NUM) ? 2 \ - : (t == TEMP_TIMER_NUM) ? 6 \ - : 7 - -#define _TC_HANDLER(t) void TC##t##_Handler() -#define TC_HANDLER(t) _TC_HANDLER(t) -#define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM) -#if STEP_TIMER_NUM != PULSE_TIMER_NUM - #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM) -#endif -#define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM) - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -typedef struct { - Tc *pTimer; - IRQn_Type IRQ_Id; - uint8_t priority; -} tTimerConfig; - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -extern const tTimerConfig TimerConfig[]; - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -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) { - Tc * const tc = TimerConfig[timer_num].pTimer; - tc->COUNT32.CC[0].reg = HAL_TIMER_TYPE_MAX - compare; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - Tc * const tc = TimerConfig[timer_num].pTimer; - return (hal_timer_t)(HAL_TIMER_TYPE_MAX - tc->COUNT32.CC[0].reg); -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - Tc * const tc = TimerConfig[timer_num].pTimer; - tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC; - SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB || tc->COUNT32.SYNCBUSY.bit.COUNT); - return HAL_TIMER_TYPE_MAX - tc->COUNT32.COUNT.reg; -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - Tc * const tc = TimerConfig[timer_num].pTimer; - // Clear interrupt flag - tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF; -} - -#define HAL_timer_isr_epilogue(timer_num) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp deleted file mode 100644 index 69a6de4ef7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 . - * - */ - -#ifdef __SAMD51__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - - #include "watchdog.h" - - 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. - - // Setup WDT clocks - MCLK->APBAMASK.bit.OSC32KCTRL_ = true; - MCLK->APBAMASK.bit.WDT_ = true; - OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) - - WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config - SYNC(WDT->SYNCBUSY.bit.ENABLE); - - WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt - WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset - - HAL_watchdog_refresh(); - - WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode - SYNC(WDT->SYNCBUSY.bit.ENABLE); - } - -#endif // USE_WATCHDOG - -#endif // __SAMD51__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.h deleted file mode 100644 index b626b0b06a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_SAMD51/watchdog.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * 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 - * 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 - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or SAMD will go into emergency procedures. -inline void HAL_watchdog_refresh() { - SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution - WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.cpp deleted file mode 100644 index 4fbfa7298c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 . - * - */ - -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "HAL.h" - -#include "../../inc/MarlinConfig.h" -#include "../shared/Delay.h" - -#if (__cplusplus == 201703L) && defined(__has_include) - #define HAS_SWSERIAL __has_include() -#else - #define HAS_SWSERIAL HAS_TMC220x -#endif - -#if HAS_SWSERIAL - #include "SoftwareSerial.h" -#endif - -#if ENABLED(SRAM_EEPROM_EMULATION) - #if STM32F7xx - #include - #elif STM32F4xx - #include - #else - #error "SRAM_EEPROM_EMULATION is currently only supported for STM32F4xx and STM32F7xx" - #endif -#endif - -// ------------------------ -// Public Variables -// ------------------------ - -uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// Needed for DELAY_NS() / DELAY_US() on CORTEX-M7 -#if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7 - // HAL pre-initialization task - // Force the preinit function to run between the premain() and main() function - // of the STM32 arduino core - __attribute__((constructor (102))) - void HAL_preinit() { - enableCycleCounter(); - } -#endif - -// HAL initialization task -void HAL_init() { - FastIO_init(); - - #if ENABLED(SDSUPPORT) - OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up - #endif - - #if PIN_EXISTS(LED) - OUT_WRITE(LED_PIN, LOW); - #endif - - #if ENABLED(SRAM_EEPROM_EMULATION) - // Enable access to backup SRAM - __HAL_RCC_PWR_CLK_ENABLE(); - HAL_PWR_EnableBkUpAccess(); - __HAL_RCC_BKPSRAM_CLK_ENABLE(); - - // Enable backup regulator - LL_PWR_EnableBkUpRegulator(); - // Wait until backup regulator is initialized - while (!LL_PWR_IsActiveFlag_BRR()); - #endif // EEPROM_EMULATED_SRAM - - #if HAS_SWSERIAL - SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0); - #endif -} - -void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } - -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; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON; - return 0; -} - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// ------------------------ -// ADC -// ------------------------ - -// TODO: Make sure this doesn't cause any delay -void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } - -uint16_t HAL_adc_get_result() { return HAL_adc_result; } - -void flashFirmware(int16_t) { NVIC_SystemReset(); } - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.h deleted file mode 100644 index 910d437bd6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL.h +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 - -#define CPU_32_BIT - -#include "../../core/macros.h" -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" - -#include "../../inc/MarlinConfigPre.h" - -#include - -#ifdef USBCON - #include -#endif - -// ------------------------ -// Defines -// ------------------------ - -#if SERIAL_PORT == 0 - #error "Serial port 0 does not exist" -#endif - -#if !WITHIN(SERIAL_PORT, -1, 6) - #error "SERIAL_PORT must be from -1 to 6" -#endif -#if SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 -#elif SERIAL_PORT == 4 - #define MYSERIAL0 Serial4 -#elif SERIAL_PORT == 5 - #define MYSERIAL0 Serial5 -#elif SERIAL_PORT == 6 - #define MYSERIAL0 Serial6 -#endif - -#ifdef SERIAL_PORT_2 - #if SERIAL_PORT_2 == 0 - #error "Serial port 0 does not exist" - #endif - - #if !WITHIN(SERIAL_PORT_2, -1, 6) - #error "SERIAL_PORT_2 must be from -1 to 6" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 SerialUSB - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 Serial1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 Serial2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 Serial3 - #elif SERIAL_PORT_2 == 4 - #define MYSERIAL1 Serial4 - #elif SERIAL_PORT_2 == 5 - #define MYSERIAL1 Serial5 - #elif SERIAL_PORT_2 == 6 - #define MYSERIAL1 Serial6 - #endif -#else - #define NUM_SERIAL 1 -#endif - -#include "timers.h" - -/** - * TODO: review this to return 1 for pins that are not analog input - */ -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) (p) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() -#define cli() __disable_irq() -#define sei() __enable_irq() - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -// ------------------------ -// Types -// ------------------------ - -typedef int16_t pin_t; - -#define HAL_SERVO_LIB libServo - -// ------------------------ -// Public Variables -// ------------------------ - -// result of last ADC conversion -extern uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// Memory related -#define __bss_end __bss_end__ - -// Enable hooks into setup for HAL -void HAL_init(); - -// Clear reset reason -void HAL_clear_reset_source(); - -// Reset reason -uint8_t HAL_get_reset_source(); - -void _delay_ms(const int delay); - -extern "C" char* _sbrk(int incr); - -#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 - -// -// EEPROM -// - -// Wire library should work for i2c EEPROMs -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *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); - -// -// ADC -// - -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) - -inline void HAL_adc_init() {} - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#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(); - -#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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp deleted file mode 100644 index 45bd26d720..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp +++ /dev/null @@ -1,151 +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 . - * - */ -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfig.h" - -#include - -// ------------------------ -// Public Variables -// ------------------------ - -static SPISettings spiConfig; - -// ------------------------ -// Public functions -// ------------------------ - -#if ENABLED(SOFTWARE_SPI) - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for STM32. Use Hardware SPI." - -#else - -// ------------------------ -// Hardware SPI -// ------------------------ - -/** - * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz - */ - -/** - * @brief Begin SPI port setup - * - * @return Nothing - * - * @details Only configures SS pin since stm32duino creates and initialize the SPI object - */ -void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" - #endif - - OUT_WRITE(SS_PIN, HIGH); -} - -/** Configure SPI for specified SPI speed */ -void spiInit(uint8_t spiRate) { - // Use datarates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 300000; break; - default: - clock = 4000000; // Default from the SPI library - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - - SPI.begin(); -} - -/** - * @brief Receives a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; -} - -/** - * @brief Receives a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - * - * @details Uses DMA - */ -void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte == 0) return; - memset(buf, 0xFF, nbyte); - SPI.beginTransaction(spiConfig); - SPI.transfer(buf, nbyte); - SPI.endTransaction(); -} - -/** - * @brief Sends a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); -} - -/** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Use DMA - */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { - uint8_t rxBuf[512]; - SPI.beginTransaction(spiConfig); - SPI.transfer(token); - SPI.transfer((uint8_t*)buf, &rxBuf, 512); - SPI.endTransaction(); -} - -#endif // SOFTWARE_SPI - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/README.md deleted file mode 100644 index 7680df6654..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Generic STM32 HAL based on the stm32duino core - -This HAL is intended to act as the generic STM32 HAL for all STM32 chips (The whole F, H and L family). - -Currently it supports: - * STM32F0xx - * STM32F1xx - * STM32F4xx - * STM32F7xx - -Targeting the official [Arduino STM32 Core](https://github.com/stm32duino/Arduino_Core_STM32). diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.cpp deleted file mode 100644 index 2882f071ac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.cpp +++ /dev/null @@ -1,57 +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 . - * - */ -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "Servo.h" - -uint8_t servoPin[MAX_SERVOS] = { 0 }; - -int8_t libServo::attach(const int pin) { - 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[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 (attach(0) >= 0) { - write(value); - safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif - } -} -#endif // HAS_SERVOS - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.h deleted file mode 100644 index 592f3a0662..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/Servo.h +++ /dev/null @@ -1,37 +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 - -#include - -// Inherit and expand on the official library -class libServo : public Servo { - public: - int8_t attach(const int pin); - 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp deleted file mode 100644 index 2d2883f4ce..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/* - * SoftwareSerial.cpp (formerly NewSoftSerial.cpp) - * - * Multi-instance software serial library for Arduino/Wiring - * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) - * -- Tuning, circular buffer, derivation from class Print/Stream, - * multi-instance support, porting to 8MHz processors, - * various optimizations, PROGMEM delay tables, inverse logic and - * direct port writing by Mikal Hart (http://www.arduiniana.org) - * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) - * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) - * -- STM32 support by Armin van der Togt - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * The latest version of this library can always be found at - * http://arduiniana.org. - */ - -// -// Includes -// -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "SoftwareSerial.h" -#include "timers.h" - -#define OVERSAMPLE 3 // in RX, Timer will generate interruption OVERSAMPLE time during a bit. Thus OVERSAMPLE ticks in a bit. (interrupt not synchonized with edge). - -// defined in bit-periods -#define HALFDUPLEX_SWITCH_DELAY 5 -// It's best to define TIMER_SERIAL in variant.h. If not defined, we choose one here -// The order is based on (lack of) features and compare channels, we choose the simplest available -// because we only need an update interrupt -#if !defined(TIMER_SERIAL) -#if defined (TIM18_BASE) -#define TIMER_SERIAL TIM18 -#elif defined (TIM7_BASE) -#define TIMER_SERIAL TIM7 -#elif defined (TIM6_BASE) -#define TIMER_SERIAL TIM6 -#elif defined (TIM22_BASE) -#define TIMER_SERIAL TIM22 -#elif defined (TIM21_BASE) -#define TIMER_SERIAL TIM21 -#elif defined (TIM17_BASE) -#define TIMER_SERIAL TIM17 -#elif defined (TIM16_BASE) -#define TIMER_SERIAL TIM16 -#elif defined (TIM15_BASE) -#define TIMER_SERIAL TIM15 -#elif defined (TIM14_BASE) -#define TIMER_SERIAL TIM14 -#elif defined (TIM13_BASE) -#define TIMER_SERIAL TIM13 -#elif defined (TIM11_BASE) -#define TIMER_SERIAL TIM11 -#elif defined (TIM10_BASE) -#define TIMER_SERIAL TIM10 -#elif defined (TIM12_BASE) -#define TIMER_SERIAL TIM12 -#elif defined (TIM19_BASE) -#define TIMER_SERIAL TIM19 -#elif defined (TIM9_BASE) -#define TIMER_SERIAL TIM9 -#elif defined (TIM5_BASE) -#define TIMER_SERIAL TIM5 -#elif defined (TIM4_BASE) -#define TIMER_SERIAL TIM4 -#elif defined (TIM3_BASE) -#define TIMER_SERIAL TIM3 -#elif defined (TIM2_BASE) -#define TIMER_SERIAL TIM2 -#elif defined (TIM20_BASE) -#define TIMER_SERIAL TIM20 -#elif defined (TIM8_BASE) -#define TIMER_SERIAL TIM8 -#elif defined (TIM1_BASE) -#define TIMER_SERIAL TIM1 -#else -#error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h -#endif -#endif -// -// Statics -// -HardwareTimer SoftwareSerial::timer(TIMER_SERIAL); -const IRQn_Type SoftwareSerial::timer_interrupt_number = static_cast(getTimerUpIrq(TIMER_SERIAL)); -uint32_t SoftwareSerial::timer_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), TIM_IRQ_PRIO, TIM_IRQ_SUBPRIO); -SoftwareSerial *SoftwareSerial::active_listener = nullptr; -SoftwareSerial *volatile SoftwareSerial::active_out = nullptr; -SoftwareSerial *volatile SoftwareSerial::active_in = nullptr; -int32_t SoftwareSerial::tx_tick_cnt = 0; // OVERSAMPLE ticks needed for a bit -int32_t volatile SoftwareSerial::rx_tick_cnt = 0; // OVERSAMPLE ticks needed for a bit -uint32_t SoftwareSerial::tx_buffer = 0; -int32_t SoftwareSerial::tx_bit_cnt = 0; -uint32_t SoftwareSerial::rx_buffer = 0; -int32_t SoftwareSerial::rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit -uint32_t SoftwareSerial::cur_speed = 0; - -void SoftwareSerial::setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority) { - timer_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), preemptPriority, subPriority); -} - -// -// Private methods -// - -void SoftwareSerial::setSpeed(uint32_t speed) { - if (speed != cur_speed) { - timer.pause(); - if (speed != 0) { - // Disable the timer - uint32_t clock_rate, cmp_value; - // Get timer clock - clock_rate = timer.getTimerClkFreq(); - int pre = 1; - // Calculate prescale an compare value - do { - cmp_value = clock_rate / (speed * OVERSAMPLE); - if (cmp_value >= UINT16_MAX) { - clock_rate /= 2; - pre *= 2; - } - } while (cmp_value >= UINT16_MAX); - timer.setPrescaleFactor(pre); - timer.setOverflow(cmp_value); - timer.setCount(0); - timer.attachInterrupt(&handleInterrupt); - timer.resume(); - NVIC_SetPriority(timer_interrupt_number, timer_interrupt_priority); - } - else - timer.detachInterrupt(); - cur_speed = speed; - } -} - -// This function sets the current object as the "listening" -// one and returns true if it replaces another -bool SoftwareSerial::listen() { - if (active_listener != this) { - // wait for any transmit to complete as we may change speed - while (active_out); - active_listener->stopListening(); - rx_tick_cnt = 1; // 1 : next interrupt will decrease rx_tick_cnt to 0 which means RX pin level will be considered. - rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit - setSpeed(_speed); - active_listener = this; - if (!_half_duplex) active_in = this; - return true; - } - return false; -} - -// Stop listening. Returns true if we were actually listening. -bool SoftwareSerial::stopListening() { - if (active_listener == this) { - // wait for any output to complete - while (active_out); - if (_half_duplex) setRXTX(false); - active_listener = nullptr; - active_in = nullptr; - // turn off ints - setSpeed(0); - return true; - } - return false; -} - -inline void SoftwareSerial::setTX() { - if (_inverse_logic) - LL_GPIO_ResetOutputPin(_transmitPinPort, _transmitPinNumber); - else - LL_GPIO_SetOutputPin(_transmitPinPort, _transmitPinNumber); - pinMode(_transmitPin, OUTPUT); -} - -inline void SoftwareSerial::setRX() { - pinMode(_receivePin, _inverse_logic ? INPUT_PULLDOWN : INPUT_PULLUP); // pullup for normal logic! -} - -inline void SoftwareSerial::setRXTX(bool input) { - if (_half_duplex) { - if (input) { - if (active_in != this) { - setRX(); - rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit - rx_tick_cnt = 2; // 2 : next interrupt will be discarded. 2 interrupts required to consider RX pin level - active_in = this; - } - } - else { - if (active_in == this) { - setTX(); - active_in = nullptr; - } - } - } -} - -inline void SoftwareSerial::send() { - if (--tx_tick_cnt <= 0) { // if tx_tick_cnt > 0 interrupt is discarded. Only when tx_tick_cnt reaches 0 is TX pin set. - if (tx_bit_cnt++ < 10) { // tx_bit_cnt < 10 transmission is not finished (10 = 1 start +8 bits + 1 stop) - // Send data (including start and stop bits) - if (tx_buffer & 1) - LL_GPIO_SetOutputPin(_transmitPinPort, _transmitPinNumber); - else - LL_GPIO_ResetOutputPin(_transmitPinPort, _transmitPinNumber); - tx_buffer >>= 1; - tx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE ticks to send next bit - } - else { // Transmission finished - tx_tick_cnt = 1; - if (_output_pending) { - active_out = nullptr; - - // In half-duplex mode wait HALFDUPLEX_SWITCH_DELAY bit-periods after the byte has - // been transmitted before allowing the switch to RX mode - } - else if (tx_bit_cnt > 10 + OVERSAMPLE * HALFDUPLEX_SWITCH_DELAY) { - if (_half_duplex && active_listener == this) setRXTX(true); - active_out = nullptr; - } - } - } -} - -// -// The receive routine called by the interrupt handler -// -inline void SoftwareSerial::recv() { - if (--rx_tick_cnt <= 0) { // if rx_tick_cnt > 0 interrupt is discarded. Only when rx_tick_cnt reaches 0 is RX pin considered - bool inbit = LL_GPIO_IsInputPinSet(_receivePinPort, _receivePinNumber) ^ _inverse_logic; - if (rx_bit_cnt == -1) { // rx_bit_cnt = -1 : waiting for start bit - if (!inbit) { - // got start bit - rx_bit_cnt = 0; // rx_bit_cnt == 0 : start bit received - rx_tick_cnt = OVERSAMPLE + 1; // Wait 1 bit (OVERSAMPLE ticks) + 1 tick in order to sample RX pin in the middle of the edge (and not too close to the edge) - rx_buffer = 0; - } - else - rx_tick_cnt = 1; // Waiting for start bit, but wrong level. Wait for next Interrupt to check RX pin level - } - else if (rx_bit_cnt >= 8) { // rx_bit_cnt >= 8 : waiting for stop bit - if (inbit) { - // Stop-bit read complete. Add to buffer. - uint8_t next = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF; - if (next != _receive_buffer_head) { - // save new data in buffer: tail points to byte destination - _receive_buffer[_receive_buffer_tail] = rx_buffer; // save new byte - _receive_buffer_tail = next; - } - else // rx_bit_cnt = x with x = [0..7] correspond to new bit x received - _buffer_overflow = true; - } - // Full trame received. Restart waiting for start bit at next interrupt - rx_tick_cnt = 1; - rx_bit_cnt = -1; - } - else { - // data bits - rx_buffer >>= 1; - if (inbit) rx_buffer |= 0x80; - rx_bit_cnt++; // Prepare for next bit - rx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE ticks before sampling next bit - } - } -} - -// -// Interrupt handling -// - -/* static */ -inline void SoftwareSerial::handleInterrupt(HardwareTimer*) { - if (active_in) active_in->recv(); - if (active_out) active_out->send(); -} - -// -// Constructor -// -SoftwareSerial::SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic /* = false */) : - _receivePin(receivePin), - _transmitPin(transmitPin), - _receivePinPort(digitalPinToPort(receivePin)), - _receivePinNumber(STM_LL_GPIO_PIN(digitalPinToPinName(receivePin))), - _transmitPinPort(digitalPinToPort(transmitPin)), - _transmitPinNumber(STM_LL_GPIO_PIN(digitalPinToPinName(transmitPin))), - _speed(0), - _buffer_overflow(false), - _inverse_logic(inverse_logic), - _half_duplex(receivePin == transmitPin), - _output_pending(0), - _receive_buffer_tail(0), - _receive_buffer_head(0) -{ - if ((receivePin < NUM_DIGITAL_PINS) || (transmitPin < NUM_DIGITAL_PINS)) { - /* Enable GPIO clock for tx and rx pin*/ - set_GPIO_Port_Clock(STM_PORT(digitalPinToPinName(transmitPin))); - set_GPIO_Port_Clock(STM_PORT(digitalPinToPinName(receivePin))); - } - else - _Error_Handler("ERROR: invalid pin number\n", -1); -} - -// -// Destructor -// -SoftwareSerial::~SoftwareSerial() { end(); } - -// -// Public methods -// - -void SoftwareSerial::begin(long speed) { - #ifdef FORCE_BAUD_RATE - speed = FORCE_BAUD_RATE; - #endif - _speed = speed; - if (!_half_duplex) { - setTX(); - setRX(); - listen(); - } - else - setTX(); -} - -void SoftwareSerial::end() { - stopListening(); -} - -// Read data from buffer -int SoftwareSerial::read() { - // Empty buffer? - if (_receive_buffer_head == _receive_buffer_tail) return -1; - - // Read from "head" - uint8_t d = _receive_buffer[_receive_buffer_head]; // grab next byte - _receive_buffer_head = (_receive_buffer_head + 1) % _SS_MAX_RX_BUFF; - return d; -} - -int SoftwareSerial::available() { - return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; -} - -size_t SoftwareSerial::write(uint8_t b) { - // wait for previous transmit to complete - _output_pending = 1; - while (active_out) { /* nada */ } - // add start and stop bits. - tx_buffer = b << 1 | 0x200; - if (_inverse_logic) tx_buffer = ~tx_buffer; - tx_bit_cnt = 0; - tx_tick_cnt = OVERSAMPLE; - setSpeed(_speed); - if (_half_duplex) setRXTX(false); - _output_pending = 0; - // make us active - active_out = this; - return 1; -} - -void SoftwareSerial::flush() { - noInterrupts(); - _receive_buffer_head = _receive_buffer_tail = 0; - interrupts(); -} - -int SoftwareSerial::peek() { - // Empty buffer? - if (_receive_buffer_head == _receive_buffer_tail) return -1; - - // Read from "head" - return _receive_buffer[_receive_buffer_head]; -} - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h deleted file mode 100644 index 3799701cfe..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * SoftwareSerial.h (formerly NewSoftSerial.h) - * - * Multi-instance software serial library for Arduino/Wiring - * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) - * -- Tuning, circular buffer, derivation from class Print/Stream, - * multi-instance support, porting to 8MHz processors, - * various optimizations, PROGMEM delay tables, inverse logic and - * direct port writing by Mikal Hart (http://www.arduiniana.org) - * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) - * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * The latest version of this library can always be found at - * http://arduiniana.org. - */ - -#ifndef SOFTWARESERIAL_H -#define SOFTWARESERIAL_H - -#include - -/****************************************************************************** - * Definitions - ******************************************************************************/ - -#define _SS_MAX_RX_BUFF 64 // RX buffer size - -class SoftwareSerial : public Stream { - private: - // per object data - uint16_t _receivePin; - uint16_t _transmitPin; - GPIO_TypeDef *_receivePinPort; - uint32_t _receivePinNumber; - GPIO_TypeDef *_transmitPinPort; - uint32_t _transmitPinNumber; - uint32_t _speed; - - uint16_t _buffer_overflow: 1; - uint16_t _inverse_logic: 1; - uint16_t _half_duplex: 1; - uint16_t _output_pending: 1; - - unsigned char _receive_buffer[_SS_MAX_RX_BUFF]; - volatile uint8_t _receive_buffer_tail; - volatile uint8_t _receive_buffer_head; - - uint32_t delta_start = 0; - - // static data - static bool initialised; - static HardwareTimer timer; - static const IRQn_Type timer_interrupt_number; - static uint32_t timer_interrupt_priority; - static SoftwareSerial *active_listener; - static SoftwareSerial *volatile active_out; - static SoftwareSerial *volatile active_in; - static int32_t tx_tick_cnt; - static volatile int32_t rx_tick_cnt; - static uint32_t tx_buffer; - static int32_t tx_bit_cnt; - static uint32_t rx_buffer; - static int32_t rx_bit_cnt; - static uint32_t cur_speed; - - // private methods - void send(); - void recv(); - void setTX(); - void setRX(); - void setSpeed(uint32_t speed); - void setRXTX(bool input); - static void handleInterrupt(HardwareTimer *timer); - - public: - // public methods - - SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false); - virtual ~SoftwareSerial(); - void begin(long speed); - bool listen(); - void end(); - bool isListening() { return active_listener == this; } - bool stopListening(); - bool overflow() { - bool ret = _buffer_overflow; - if (ret) _buffer_overflow = false; - return ret; - } - int peek(); - - virtual size_t write(uint8_t byte); - virtual int read(); - virtual int available(); - virtual void flush(); - operator bool() { return true; } - - static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority); - - using Print::write; -}; - -#endif // SOFTWARESERIAL_H diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h deleted file mode 100644 index d0aa731e89..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h +++ /dev/null @@ -1,64 +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 - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #if HAS_X_MAX - attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_X_MIN - attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MAX - attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MIN - attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MAX - attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN - attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MAX - attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MIN - attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MAX - attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MIN - attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.cpp deleted file mode 100644 index 33685cedda..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.cpp +++ /dev/null @@ -1,34 +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 . - * - */ -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfig.h" - -GPIO_TypeDef* FastIOPortMap[LastPort + 1]; - -void FastIO_init() { - for (uint8_t i = 0; i < NUM_DIGITAL_PINS; i++) - FastIOPortMap[STM_PORT(digitalPin[i])] = get_GPIO_Port(STM_PORT(digitalPin[i])); -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.h deleted file mode 100644 index 917ee3a1a6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/fastio.h +++ /dev/null @@ -1,87 +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 STM32 - * These use GPIO register access for fast port manipulation. - */ - -// ------------------------ -// Public Variables -// ------------------------ - -extern GPIO_TypeDef * FastIOPortMap[]; - -// ------------------------ -// Public functions -// ------------------------ - -void FastIO_init(); // Must be called before using fast io macros - -// ------------------------ -// Defines -// ------------------------ - -#define _BV32(b) (1UL << (b)) - -#ifndef PWM - #define PWM OUTPUT -#endif - -#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx) - #define _WRITE(IO, V) do { \ - if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \ - else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \ - }while(0) -#else - #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + (V ? 0 : 16))) -#endif - -#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO])))) -#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(STM_PIN(digitalPin[IO]))) - -#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 WRITE(IO,V) _WRITE(IO,V) -#define READ(IO) _READ(IO) -#define TOGGLE(IO) _TOGGLE(IO) - -#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 IS_INPUT(IO) -#define IS_OUTPUT(IO) - -#define PWM_PIN(P) digitalPinHasPWM(P) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h deleted file mode 100644 index 9a1727bceb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h +++ /dev/null @@ -1,37 +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 - -/** - * Test STM32-specific configuration values for errors at compile-time. - */ -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp deleted file mode 100644 index c94bce3b65..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) - -#include "../shared/persistent_store_api.h" - -#if ENABLED(FLASH_EEPROM_EMULATION) - #include - static bool eeprom_data_written = false; -#endif - -bool PersistentStore::access_start() { - #if ENABLED(FLASH_EEPROM_EMULATION) - eeprom_buffer_fill(); - #endif - return true; -} - -bool PersistentStore::access_finish() { - #if ENABLED(FLASH_EEPROM_EMULATION) - if (eeprom_data_written) { - eeprom_buffer_flush(); - eeprom_data_written = false; - } - #endif - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t v = *value; - - // Save to either external EEPROM, program flash or Backup SRAM - #if EITHER(SPI_EEPROM, I2C_EEPROM) - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - uint8_t * const p = (uint8_t * const)pos; - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - #elif ENABLED(FLASH_EEPROM_EMULATION) - eeprom_buffered_write_byte(pos, v); - #else - *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v; - #endif - - crc16(crc, &v, 1); - pos++; - value++; - }; - #if ENABLED(FLASH_EEPROM_EMULATION) - eeprom_data_written = true; - #endif - - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - // Read from either external EEPROM, program flash or Backup SRAM - const uint8_t c = ( - #if EITHER(SPI_EEPROM, I2C_EEPROM) - eeprom_read_byte((uint8_t*)pos) - #elif ENABLED(FLASH_EEPROM_EMULATION) - eeprom_buffered_read_byte(pos) - #else - (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos))) - #endif - ); - - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { - return ( - #if ENABLED(SRAM_EEPROM_EMULATION) - 4096 // 4kB - #else - E2END + 1 - #endif - ); -} - -#endif // EEPROM_SETTINGS && (FLASH_EEPROM_EMULATION || SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM) -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp deleted file mode 100644 index 6ce63073c4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp +++ /dev/null @@ -1,103 +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 . - * - */ - -/** - * Implementation of EEPROM settings in SD Card - */ - -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) - -#include "../shared/persistent_store_api.h" - -#ifndef E2END - #define E2END 0xFFF // 4KB -#endif -#define HAL_EEPROM_SIZE int(E2END + 1) - -#define _ALIGN(x) __attribute__ ((aligned(x))) -static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; - -#if ENABLED(SDSUPPORT) - - #include "../../sd/cardreader.h" - - #define EEPROM_FILENAME "eeprom.dat" - - bool PersistentStore::access_start() { - if (!card.isMounted()) return false; - - SdFile file, root = card.getroot(); - if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) - return true; - - int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE); - if (bytes_read < 0) return false; - for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++) - HAL_eeprom_data[bytes_read] = 0xFF; - file.close(); - return true; - } - - bool PersistentStore::access_finish() { - if (!card.isMounted()) return false; - - SdFile file, root = card.getroot(); - int bytes_written = 0; - if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { - bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE); - file.close(); - } - return (bytes_written == HAL_EEPROM_SIZE); - } - -#else // !SDSUPPORT - - #error "Please define an EEPROM, a SDCARD or disable EEPROM_SETTINGS." - -#endif // !SDSUPPORT - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - for (size_t i = 0; i < size; i++) - HAL_eeprom_data[pos + i] = value[i]; - crc16(crc, value, size); - pos += size; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - for (size_t i = 0; i < size; i++) { - uint8_t c = HAL_eeprom_data[pos + i]; - if (writing) value[i] = c; - crc16(crc, &c, 1); - } - pos += size; - return false; -} - -size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } - -#endif // EEPROM_SETTINGS -#endif // STM32 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug.h deleted file mode 100644 index 4e27cee195..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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(NUM_DIGITAL_PINS) || defined(BOARD_NR_GPIO_PINS)) - #error "M43 not supported for this board" -#endif - -// Strange - STM32F4 comes to HAL_STM32 rather than HAL_STM32F4 for these files -#ifdef STM32F4 - #ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "pinsDebug_STM32duino.h" - #elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "pinsDebug_STM32GENERIC.h" - #else - #error "M43 not supported for this board" - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h deleted file mode 100644 index b1c2562185..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * 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 - -/** - * Support routines for STM32GENERIC (Maple) - */ - -/** - * Translation of routines & variables used by pinsDebug.h - */ - -#ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple) - -#ifdef __STM32F1__ - #include "../HAL_STM32F1/fastio.h" -#elif defined(STM32F4) || defined(STM32F7) - #include "../HAL_STM32_F4_F7/fastio.h" -#else - #include "fastio.h" -#endif - -extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; - -#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS -#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS -#define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS) -#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin) -#define pwm_status(pin) PWM_PIN(pin) -#define digitalRead_mod(p) extDigitalRead(p) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PORT(p) print_port(p) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin - -// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -#ifndef M43_NEVER_TOUCH - #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX) -#endif - -static inline int8_t get_pin_mode(pin_t pin) { - return VALID_PIN(pin) ? _GET_MODE(pin) : -1; -} - -static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { - if (!VALID_PIN(pin)) return -1; - int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel); - #ifdef NUM_ANALOG_INPUTS - if (adc_channel >= NUM_ANALOG_INPUTS) adc_channel = ADCx; - #endif - return pin_t(adc_channel); -} - -static inline bool IS_ANALOG(pin_t pin) { - if (!VALID_PIN(pin)) return false; - if (PIN_MAP[pin].adc_channel != ADCx) { - #ifdef NUM_ANALOG_INPUTS - if (PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) return false; - #endif - return _GET_MODE(pin) == GPIO_INPUT_ANALOG && !M43_NEVER_TOUCH(pin); - } - return false; -} - -static inline bool GET_PINMODE(const pin_t pin) { - return VALID_PIN(pin) && !IS_INPUT(pin); -} - -static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { - const pin_t pin = GET_ARRAY_PIN(array_pin); - return (!IS_ANALOG(pin) - #ifdef NUM_ANALOG_INPUTS - || PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS - #endif - ); -} - -#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density - -static inline void pwm_details(const pin_t pin) { - if (PWM_PIN(pin)) { - timer_dev * const tdev = PIN_MAP[pin].timer_device; - const uint8_t channel = PIN_MAP[pin].timer_channel; - const char num = ( - #if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY) - tdev == &timer8 ? '8' : - tdev == &timer5 ? '5' : - #endif - tdev == &timer4 ? '4' : - tdev == &timer3 ? '3' : - tdev == &timer2 ? '2' : - tdev == &timer1 ? '1' : '?' - ); - char buffer[10]; - sprintf_P(buffer, PSTR(" TIM%c CH%c"), num, ('0' + channel)); - SERIAL_ECHO(buffer); - } -} - -static inline void print_port(pin_t pin) { - const char port = 'A' + char(pin >> 4); // pin div 16 - const int16_t gbit = PIN_MAP[pin].gpio_bit; - char buffer[8]; - sprintf_P(buffer, PSTR("P%c%hd "), port, gbit); - if (gbit < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(buffer); -} - -#endif // BOARD_NR_GPIO_PINS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h deleted file mode 100644 index 9d9796eabe..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h +++ /dev/null @@ -1,275 +0,0 @@ -/** - * 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 - -#include - -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - -/** - * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order) - * because the variants in this platform do not always define all the I/O port/pins - * that a CPU has. - * - * VARIABLES: - * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and - * digitalWrite commands and by M42. - * - does not contain port/pin info - * - is not in port/pin order - * - typically a variant will only assign Ard_num to port/pins that are actually used - * Index - M43 counter - only used to get Ard_num - * x - a parameter/argument used to search the pin_array to try to find a signal name - * associated with a Ard_num - * Port_pin - port number and pin number for use with CPU registers and printing reports - * - * Since M43 uses digitalRead and digitalWrite commands, only the Port_pins with an Ard_num - * are accessed and/or displayed. - * - * Three arrays are used. - * - * digitalPin[] is provided by the platform. It consists of the Port_pin numbers in - * Arduino pin number order. - * - * pin_array is a structure generated by the pins/pinsDebug.h header file. It is generated by - * the preprocessor. Only the signals associated with enabled options are in this table. - * It contains: - * - name of the signal - * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. - * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as an - * index into digitalPin[] to get the Port_pin number - * - if it is a digital or analog signal. PWMs are considered digital here. - * - * pin_xref is a structure generated by this header file. It is generated by the - * preprocessor. It is in port/pin order. It contains just the port/pin numbers defined by the - * platform for this variant. - * - Ard_num - * - printable version of Port_pin - * - * Routines with an "x" as a parameter/argument are used to search the pin_array to try to - * find a signal name associated with a port/pin. - * - * NOTE - the Arduino pin number is what is used by the M42 command, NOT the port/pin for that - * signal. The Arduino pin number is listed by the M43 I command. - */ - -extern const PinName digitalPin[]; // provided by the platform - -//////////////////////////////////////////////////////// -// -// make a list of the Arduino pin numbers in the Port/Pin order -// - -#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM }, -#define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM }, -#define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME) - -typedef struct { - char Port_pin_alpha[5]; - pin_t Ard_num; -} XrefInfo; - -const XrefInfo pin_xref[] PROGMEM = { - #include "pins_Xref.h" -}; - -//////////////////////////////////////////////////////////// - -#define MODE_PIN_INPUT 0 // Input mode (reset state) -#define MODE_PIN_OUTPUT 1 // General purpose output mode -#define MODE_PIN_ALT 2 // Alternate function mode -#define MODE_PIN_ANALOG 3 // Analog mode - -#define PIN_NUM(P) (P & 0x000F) -#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1') -#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 ) -#define PORT_NUM(P) ((P >> 4) & 0x0007) -#define PORT_ALPHA(P) ('A' + (P >> 4)) - -/** - * Translation of routines & variables used by pinsDebug.h - */ -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL) -#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads -#define PRINT_PIN(Q) -#define PRINT_PORT(ANUM) port_print(ANUM) -#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine -#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num - -// x is a variable used to search pin_array -#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital) -#define GET_ARRAY_PIN(x) ((pin_t) pin_array[x].pin) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin - -#ifndef M43_NEVER_TOUCH - #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP) - #ifdef KILL_PIN - #define M43_NEVER_TOUCH(Index) m43_never_touch(Index) - - bool m43_never_touch(const pin_t Index) { - static pin_t M43_kill_index = -1; - if (M43_kill_index < 0) - for (M43_kill_index = 0; M43_kill_index < NUMBER_PINS_TOTAL; M43_kill_index++) - if (KILL_PIN == GET_PIN_MAP_PIN_M43(M43_kill_index)) break; - return _M43_NEVER_TOUCH(Index) || Index == M43_kill_index; // KILL_PIN and SERIAL/USB - } - #else - #define M43_NEVER_TOUCH(Index) _M43_NEVER_TOUCH(Index) - #endif -#endif - -uint8_t get_pin_mode(const pin_t Ard_num) { - uint32_t mode_all = 0; - const PinName dp = digitalPin[Ard_num]; - switch (PORT_ALPHA(dp)) { - case 'A' : mode_all = GPIOA->MODER; break; - case 'B' : mode_all = GPIOB->MODER; break; - case 'C' : mode_all = GPIOC->MODER; break; - case 'D' : mode_all = GPIOD->MODER; break; - #ifdef PE_0 - case 'E' : mode_all = GPIOE->MODER; break; - #elif defined(PF_0) - case 'F' : mode_all = GPIOF->MODER; break; - #elif defined(PG_0) - case 'G' : mode_all = GPIOG->MODER; break; - #elif defined(PH_0) - case 'H' : mode_all = GPIOH->MODER; break; - #elif defined(PI_0) - case 'I' : mode_all = GPIOI->MODER; break; - #elif defined(PJ_0) - case 'J' : mode_all = GPIOJ->MODER; break; - #elif defined(PK_0) - case 'K' : mode_all = GPIOK->MODER; break; - #elif defined(PL_0) - case 'L' : mode_all = GPIOL->MODER; break; - #endif - } - return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03; -} - -bool GET_PINMODE(const pin_t Ard_num) { - const uint8_t pin_mode = get_pin_mode(Ard_num); - return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM -} - -int8_t digital_pin_to_analog_pin(pin_t Ard_num) { - Ard_num -= NUM_ANALOG_FIRST; - return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; -} - -bool IS_ANALOG(const pin_t Ard_num) { - return get_pin_mode(Ard_num) == MODE_PIN_ANALOG; -} - -bool is_digital(const pin_t x) { - const uint8_t pin_mode = get_pin_mode(pin_array[x].pin); - return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; -} - -void port_print(const pin_t Ard_num) { - char buffer[16]; - pin_t Index; - for (Index = 0; Index < NUMBER_PINS_TOTAL; Index++) - if (Ard_num == GET_PIN_MAP_PIN_M43(Index)) break; - - const char * ppa = pin_xref[Index].Port_pin_alpha; - sprintf_P(buffer, PSTR("%s"), ppa); - SERIAL_ECHO(buffer); - if (ppa[3] == '\0') SERIAL_CHAR(' '); - - // print analog pin number - const int8_t Port_pin = digital_pin_to_analog_pin(Ard_num); - if (Port_pin >= 0) { - sprintf_P(buffer, PSTR(" (A%d) "), Port_pin); - SERIAL_ECHO(buffer); - if (Port_pin < 10) SERIAL_CHAR(' '); - } - else - SERIAL_ECHO_SP(7); - - // Print number to be used with M42 - sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num); - SERIAL_ECHO(buffer); - if (Ard_num < 10) SERIAL_CHAR(' '); - if (Ard_num < 100) SERIAL_CHAR(' '); -} - -bool pwm_status(const pin_t Ard_num) { - return get_pin_mode(Ard_num) == MODE_PIN_ALT; -} - -void pwm_details(const pin_t Ard_num) { - if (pwm_status(Ard_num)) { - uint32_t alt_all = 0; - const PinName dp = digitalPin[Ard_num]; - pin_t pin_number = uint8_t(PIN_NUM(dp)); - const bool over_7 = pin_number >= 8; - const uint8_t ind = over_7 ? 1 : 0; - switch (PORT_ALPHA(dp)) { // get alt function - case 'A' : alt_all = GPIOA->AFR[ind]; break; - case 'B' : alt_all = GPIOB->AFR[ind]; break; - case 'C' : alt_all = GPIOC->AFR[ind]; break; - case 'D' : alt_all = GPIOD->AFR[ind]; break; - #ifdef PE_0 - case 'E' : alt_all = GPIOE->AFR[ind]; break; - #elif defined (PF_0) - case 'F' : alt_all = GPIOF->AFR[ind]; break; - #elif defined (PG_0) - case 'G' : alt_all = GPIOG->AFR[ind]; break; - #elif defined (PH_0) - case 'H' : alt_all = GPIOH->AFR[ind]; break; - #elif defined (PI_0) - case 'I' : alt_all = GPIOI->AFR[ind]; break; - #elif defined (PJ_0) - case 'J' : alt_all = GPIOJ->AFR[ind]; break; - #elif defined (PK_0) - case 'K' : alt_all = GPIOK->AFR[ind]; break; - #elif defined (PL_0) - case 'L' : alt_all = GPIOL->AFR[ind]; break; - #endif - } - if (over_7) pin_number -= 8; - - uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; - SERIAL_ECHOPAIR("Alt Function: ", alt_func); - if (alt_func < 10) SERIAL_CHAR(' '); - SERIAL_ECHOPGM(" - "); - switch (alt_func) { - case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; - case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; - case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; - case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; - case 4 : SERIAL_ECHOPGM("I2C1..3"); break; - case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; - case 6 : SERIAL_ECHOPGM("SPI3"); break; - case 7 : SERIAL_ECHOPGM("USART1..3"); break; - case 8 : SERIAL_ECHOPGM("USART4..6"); break; - case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; - case 10 : SERIAL_ECHOPGM("OTG"); break; - case 11 : SERIAL_ECHOPGM("ETH"); break; - case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; - case 13 : SERIAL_ECHOPGM("DCMI"); break; - case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; - case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; - } - } -} // pwm_details - -#endif // NUM_DIGITAL_PINS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pins_Xref.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pins_Xref.h deleted file mode 100644 index 84278c3916..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/pins_Xref.h +++ /dev/null @@ -1,612 +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 . - * - */ - -// -// make a list of the Arduino pin numbers in the Port/Pin order -// -#ifdef PA0 - PIN_ADD(PA0) -#endif -#ifdef PA1 - PIN_ADD(PA1) -#endif -#ifdef PA2 - PIN_ADD(PA2) -#endif -#ifdef PA3 - PIN_ADD(PA3) -#endif -#ifdef PA4 - PIN_ADD(PA4) -#endif -#ifdef PA5 - PIN_ADD(PA5) -#endif -#ifdef PA6 - PIN_ADD(PA6) -#endif -#ifdef PA7 - PIN_ADD(PA7) -#endif -#ifdef PA8 - PIN_ADD(PA8) -#endif -#ifdef PA9 - PIN_ADD(PA9) -#endif -#ifdef PA10 - PIN_ADD(PA10) -#endif -#ifdef PA11 - PIN_ADD(PA11) -#endif -#ifdef PA12 - PIN_ADD(PA12) -#endif -#ifdef PA13 - PIN_ADD(PA13) -#endif -#ifdef PA14 - PIN_ADD(PA14) -#endif -#ifdef PA15 - PIN_ADD(PA15) -#endif - -#ifdef PB0 - PIN_ADD(PB0) -#endif -#ifdef PB1 - PIN_ADD(PB1) -#endif -#ifdef PB2 - PIN_ADD(PB2) -#endif -#ifdef PB3 - PIN_ADD(PB3) -#endif -#ifdef PB4 - PIN_ADD(PB4) -#endif -#ifdef PB5 - PIN_ADD(PB5) -#endif -#ifdef PB6 - PIN_ADD(PB6) -#endif -#ifdef PB7 - PIN_ADD(PB7) -#endif -#ifdef PB8 - PIN_ADD(PB8) -#endif -#ifdef PB9 - PIN_ADD(PB9) -#endif -#ifdef PB10 - PIN_ADD(PB10) -#endif -#ifdef PB11 - PIN_ADD(PB11) -#endif -#ifdef PB12 - PIN_ADD(PB12) -#endif -#ifdef PB13 - PIN_ADD(PB13) -#endif -#ifdef PB14 - PIN_ADD(PB14) -#endif -#ifdef PB15 - PIN_ADD(PB15) -#endif - -#ifdef PC0 - PIN_ADD(PC0) -#endif -#ifdef PC1 - PIN_ADD(PC1) -#endif -#ifdef PC2 - PIN_ADD(PC2) -#endif -#ifdef PC3 - PIN_ADD(PC3) -#endif -#ifdef PC4 - PIN_ADD(PC4) -#endif -#ifdef PC5 - PIN_ADD(PC5) -#endif -#ifdef PC6 - PIN_ADD(PC6) -#endif -#ifdef PC7 - PIN_ADD(PC7) -#endif -#ifdef PC8 - PIN_ADD(PC8) -#endif -#ifdef PC9 - PIN_ADD(PC9) -#endif -#ifdef PC10 - PIN_ADD(PC10) -#endif -#ifdef PC11 - PIN_ADD(PC11) -#endif -#ifdef PC12 - PIN_ADD(PC12) -#endif -#ifdef PC13 - PIN_ADD(PC13) -#endif -#ifdef PC14 - PIN_ADD(PC14) -#endif -#ifdef PC15 - PIN_ADD(PC15) -#endif - -#ifdef PD0 - PIN_ADD(PD0) -#endif -#ifdef PD1 - PIN_ADD(PD1) -#endif -#ifdef PD2 - PIN_ADD(PD2) -#endif -#ifdef PD3 - PIN_ADD(PD3) -#endif -#ifdef PD4 - PIN_ADD(PD4) -#endif -#ifdef PD5 - PIN_ADD(PD5) -#endif -#ifdef PD6 - PIN_ADD(PD6) -#endif -#ifdef PD7 - PIN_ADD(PD7) -#endif -#ifdef PD8 - PIN_ADD(PD8) -#endif -#ifdef PD9 - PIN_ADD(PD9) -#endif -#ifdef PD10 - PIN_ADD(PD10) -#endif -#ifdef PD11 - PIN_ADD(PD11) -#endif -#ifdef PD12 - PIN_ADD(PD12) -#endif -#ifdef PD13 - PIN_ADD(PD13) -#endif -#ifdef PD14 - PIN_ADD(PD14) -#endif -#ifdef PD15 - PIN_ADD(PD15) -#endif - -#ifdef PE0 - PIN_ADD(PE0) -#endif -#ifdef PE1 - PIN_ADD(PE1) -#endif -#ifdef PE2 - PIN_ADD(PE2) -#endif -#ifdef PE3 - PIN_ADD(PE3) -#endif -#ifdef PE4 - PIN_ADD(PE4) -#endif -#ifdef PE5 - PIN_ADD(PE5) -#endif -#ifdef PE6 - PIN_ADD(PE6) -#endif -#ifdef PE7 - PIN_ADD(PE7) -#endif -#ifdef PE8 - PIN_ADD(PE8) -#endif -#ifdef PE9 - PIN_ADD(PE9) -#endif -#ifdef PE10 - PIN_ADD(PE10) -#endif -#ifdef PE11 - PIN_ADD(PE11) -#endif -#ifdef PE12 - PIN_ADD(PE12) -#endif -#ifdef PE13 - PIN_ADD(PE13) -#endif -#ifdef PE14 - PIN_ADD(PE14) -#endif -#ifdef PE15 - PIN_ADD(PE15) -#endif - -#ifdef PF0 - PIN_ADD(PF0) -#endif -#ifdef PF1 - PIN_ADD(PF1) -#endif -#ifdef PF2 - PIN_ADD(PF2) -#endif -#ifdef PF3 - PIN_ADD(PF3) -#endif -#ifdef PF4 - PIN_ADD(PF4) -#endif -#ifdef PF5 - PIN_ADD(PF5) -#endif -#ifdef PF6 - PIN_ADD(PF6) -#endif -#ifdef PF7 - PIN_ADD(PF7) -#endif -#ifdef PF8 - PIN_ADD(PF8) -#endif -#ifdef PF9 - PIN_ADD(PF9) -#endif -#ifdef PF10 - PIN_ADD(PF10) -#endif -#ifdef PF11 - PIN_ADD(PF11) -#endif -#ifdef PF12 - PIN_ADD(PF12) -#endif -#ifdef PF13 - PIN_ADD(PF13) -#endif -#ifdef PF14 - PIN_ADD(PF14) -#endif -#ifdef PF15 - PIN_ADD(PF15) -#endif - -#ifdef PG0 - PIN_ADD(PG0) -#endif -#ifdef PG1 - PIN_ADD(PG1) -#endif -#ifdef PG2 - PIN_ADD(PG2) -#endif -#ifdef PG3 - PIN_ADD(PG3) -#endif -#ifdef PG4 - PIN_ADD(PG4) -#endif -#ifdef PG5 - PIN_ADD(PG5) -#endif -#ifdef PG6 - PIN_ADD(PG6) -#endif -#ifdef PG7 - PIN_ADD(PG7) -#endif -#ifdef PG8 - PIN_ADD(PG8) -#endif -#ifdef PG9 - PIN_ADD(PG9) -#endif -#ifdef PG10 - PIN_ADD(PG10) -#endif -#ifdef PG11 - PIN_ADD(PG11) -#endif -#ifdef PG12 - PIN_ADD(PG12) -#endif -#ifdef PG13 - PIN_ADD(PG13) -#endif -#ifdef PG14 - PIN_ADD(PG14) -#endif -#ifdef PG15 - PIN_ADD(PG15) -#endif - -#ifdef PH0 - PIN_ADD(PH0) -#endif -#ifdef PH1 - PIN_ADD(PH1) -#endif -#ifdef PH2 - PIN_ADD(PH2) -#endif -#ifdef PH3 - PIN_ADD(PH3) -#endif -#ifdef PH4 - PIN_ADD(PH4) -#endif -#ifdef PH5 - PIN_ADD(PH5) -#endif -#ifdef PH6 - PIN_ADD(PH6) -#endif -#ifdef PH7 - PIN_ADD(PH7) -#endif -#ifdef PH8 - PIN_ADD(PH8) -#endif -#ifdef PH9 - PIN_ADD(PH9) -#endif -#ifdef PH10 - PIN_ADD(PH10) -#endif -#ifdef PH11 - PIN_ADD(PH11) -#endif -#ifdef PH12 - PIN_ADD(PH12) -#endif -#ifdef PH13 - PIN_ADD(PH13) -#endif -#ifdef PH14 - PIN_ADD(PH14) -#endif -#ifdef PH15 - PIN_ADD(PH15) -#endif - -#ifdef PI0 - PIN_ADD(PI0) -#endif -#ifdef PI1 - PIN_ADD(PI1) -#endif -#ifdef PI2 - PIN_ADD(PI2) -#endif -#ifdef PI3 - PIN_ADD(PI3) -#endif -#ifdef PI4 - PIN_ADD(PI4) -#endif -#ifdef PI5 - PIN_ADD(PI5) -#endif -#ifdef PI6 - PIN_ADD(PI6) -#endif -#ifdef PI7 - PIN_ADD(PI7) -#endif -#ifdef PI8 - PIN_ADD(PI8) -#endif -#ifdef PI9 - PIN_ADD(PI9) -#endif -#ifdef PI10 - PIN_ADD(PI10) -#endif -#ifdef PI11 - PIN_ADD(PI11) -#endif -#ifdef PI12 - PIN_ADD(PI12) -#endif -#ifdef PI13 - PIN_ADD(PI13) -#endif -#ifdef PI14 - PIN_ADD(PI14) -#endif -#ifdef PI15 - PIN_ADD(PI15) -#endif - -#ifdef PJ0 - PIN_ADD(PJ0) -#endif -#ifdef PJ1 - PIN_ADD(PJ1) -#endif -#ifdef PJ2 - PIN_ADD(PJ2) -#endif -#ifdef PJ3 - PIN_ADD(PJ3) -#endif -#ifdef PJ4 - PIN_ADD(PJ4) -#endif -#ifdef PJ5 - PIN_ADD(PJ5) -#endif -#ifdef PJ6 - PIN_ADD(PJ6) -#endif -#ifdef PJ7 - PIN_ADD(PJ7) -#endif -#ifdef PJ8 - PIN_ADD(PJ8) -#endif -#ifdef PJ9 - PIN_ADD(PJ9) -#endif -#ifdef PJ10 - PIN_ADD(PJ10) -#endif -#ifdef PJ11 - PIN_ADD(PJ11) -#endif -#ifdef PJ12 - PIN_ADD(PJ12) -#endif -#ifdef PJ13 - PIN_ADD(PJ13) -#endif -#ifdef PJ14 - PIN_ADD(PJ14) -#endif -#ifdef PJ15 - PIN_ADD(PJ15) -#endif - -#ifdef PK0 - PIN_ADD(PK0) -#endif -#ifdef PK1 - PIN_ADD(PK1) -#endif -#ifdef PK2 - PIN_ADD(PK2) -#endif -#ifdef PK3 - PIN_ADD(PK3) -#endif -#ifdef PK4 - PIN_ADD(PK4) -#endif -#ifdef PK5 - PIN_ADD(PK5) -#endif -#ifdef PK6 - PIN_ADD(PK6) -#endif -#ifdef PK7 - PIN_ADD(PK7) -#endif -#ifdef PK8 - PIN_ADD(PK8) -#endif -#ifdef PK9 - PIN_ADD(PK9) -#endif -#ifdef PK10 - PIN_ADD(PK10) -#endif -#ifdef PK11 - PIN_ADD(PK11) -#endif -#ifdef PK12 - PIN_ADD(PK12) -#endif -#ifdef PK13 - PIN_ADD(PK13) -#endif -#ifdef PK14 - PIN_ADD(PK14) -#endif -#ifdef PK15 - PIN_ADD(PK15) -#endif - -#ifdef PL0 - PIN_ADD(PL0) -#endif -#ifdef PL1 - PIN_ADD(PL1) -#endif -#ifdef PL2 - PIN_ADD(PL2) -#endif -#ifdef PL3 - PIN_ADD(PL3) -#endif -#ifdef PL4 - PIN_ADD(PL4) -#endif -#ifdef PL5 - PIN_ADD(PL5) -#endif -#ifdef PL6 - PIN_ADD(PL6) -#endif -#ifdef PL7 - PIN_ADD(PL7) -#endif -#ifdef PL8 - PIN_ADD(PL8) -#endif -#ifdef PL9 - PIN_ADD(PL9) -#endif -#ifdef PL10 - PIN_ADD(PL10) -#endif -#ifdef PL11 - PIN_ADD(PL11) -#endif -#ifdef PL12 - PIN_ADD(PL12) -#endif -#ifdef PL13 - PIN_ADD(PL13) -#endif -#ifdef PL14 - PIN_ADD(PL14) -#endif -#ifdef PL15 - PIN_ADD(PL15) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/spi_pins.h deleted file mode 100644 index f8c9546b63..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/spi_pins.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#ifndef SCK_PIN - #define SCK_PIN PIN_SPI_SCK -#endif -#ifndef MISO_PIN - #define MISO_PIN PIN_SPI_MISO -#endif -#ifndef MOSI_PIN - #define MOSI_PIN PIN_SPI_MOSI -#endif -#ifndef SS_PIN - #define SS_PIN PIN_SPI_SS -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.cpp deleted file mode 100644 index c2a4cbdc0e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "HAL.h" - -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 2 - -#define __TIMER_DEV(X) TIM##X -#define _TIMER_DEV(X) __TIMER_DEV(X) -#define STEP_TIMER_DEV _TIMER_DEV(STEP_TIMER) -#define TEMP_TIMER_DEV _TIMER_DEV(TEMP_TIMER) - -// ------------------------ -// Private Variables -// ------------------------ - -HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { NULL }; -bool timer_enabled[NUM_HARDWARE_TIMERS] = { false }; - -// ------------------------ -// Public functions -// ------------------------ - -// frequency is in Hertz -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - if (!HAL_timer_initialized(timer_num)) { - switch (timer_num) { - case STEP_TIMER_NUM: // STEPPER TIMER - use a 32bit timer if possible - timer_instance[timer_num] = new HardwareTimer(STEP_TIMER_DEV); - /* Set the prescaler to the final desired value. - * This will change the effective ISR callback frequency but when - * HAL_timer_start(timer_num=0) is called in the core for the first time - * the real frequency isn't important as long as, after boot, the ISR - * gets called with the correct prescaler and count register. So here - * we set the prescaler to the correct, final value and ignore the frequency - * asked. We will call back the ISR in 1 second to start at full speed. - * - * The proper fix, however, would be a correct initialization OR a - * HAL_timer_change(const uint8_t timer_num, const uint32_t frequency) - * which changes the prescaler when an IRQ frequency change is needed - * (for example when steppers are turned on) - */ - timer_instance[timer_num]->setPrescaleFactor(STEPPER_TIMER_PRESCALE); //the -1 is done internally - timer_instance[timer_num]->setOverflow(_MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE) /* /frequency */), TICK_FORMAT); - break; - case TEMP_TIMER_NUM: // TEMP TIMER - any available 16bit timer - timer_instance[timer_num] = new HardwareTimer(TEMP_TIMER_DEV); - // The prescale factor is computed automatically for HERTZ_FORMAT - timer_instance[timer_num]->setOverflow(frequency, HERTZ_FORMAT); - break; - } - - HAL_timer_enable_interrupt(timer_num); - - /* - * Initializes (and unfortunately starts) the timer. - * This is needed to set correct IRQ priority at the moment but causes - * no harm since every call to HAL_timer_start() is actually followed by - * a call to HAL_timer_enable_interrupt() which means that there isn't - * a case in which you want the timer to run without a callback. - */ - timer_instance[timer_num]->resume(); // First call to resume() MUST follow the attachInterrupt() - - // This is fixed in Arduino_Core_STM32 1.8. - // These calls can be removed and replaced with - // timer_instance[timer_num]->setInterruptPriority - switch (timer_num) { - case STEP_TIMER_NUM: - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, STEP_TIMER_IRQ_PRIO, 0); - break; - case TEMP_TIMER_NUM: - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_NAME, TEMP_TIMER_IRQ_PRIO, 0); - break; - } - } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - if (HAL_timer_initialized(timer_num) && !timer_enabled[timer_num]) { - timer_enabled[timer_num] = true; - switch (timer_num) { - case STEP_TIMER_NUM: - timer_instance[timer_num]->attachInterrupt(Step_Handler); - break; - case TEMP_TIMER_NUM: - timer_instance[timer_num]->attachInterrupt(Temp_Handler); - break; - } - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - if (HAL_timer_interrupt_enabled(timer_num)) { - timer_instance[timer_num]->detachInterrupt(); - timer_enabled[timer_num] = false; - } -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - return HAL_timer_initialized(timer_num) && timer_enabled[timer_num]; -} - -// Only for use within the HAL -TIM_TypeDef * HAL_timer_device(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: return STEP_TIMER_DEV; - case TEMP_TIMER_NUM: return TEMP_TIMER_DEV; - } - return nullptr; -} - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.h deleted file mode 100644 index 1d2c095f2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/timers.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -#include -#include "../../inc/MarlinConfig.h" - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -#define hal_timer_t uint32_t -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit - - -#ifdef STM32F0xx - - #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 16 - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 17 - #endif - -#elif defined(STM32F1xx) - - #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 4 - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 2 - #endif - -#elif defined(STM32F4xx) || defined(STM32F7xx) - - #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals - - #ifndef STEP_TIMER - #define STEP_TIMER 5 - #endif - - #ifndef TEMP_TIMER - #define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. - #endif - -#endif - -#ifndef SWSERIAL_TIMER_IRQ_PRIO - #define SWSERIAL_TIMER_IRQ_PRIO 1 -#endif - -#ifndef STEP_TIMER_IRQ_PRIO - #define STEP_TIMER_IRQ_PRIO 2 -#endif - -#ifndef TEMP_TIMER_IRQ_PRIO - #define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs -#endif - -#define STEP_TIMER_NUM 0 // index of timer to use for stepper -#define TEMP_TIMER_NUM 1 // index of timer to use for temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz - -//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp -#define STEPPER_TIMER_RATE 2000000 // 2 Mhz -#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE)) -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define __TIMER_IRQ_NAME(X) TIM##X##_IRQn -#define _TIMER_IRQ_NAME(X) __TIMER_IRQ_NAME(X) - -#define STEP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(STEP_TIMER) -#define TEMP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(TEMP_TIMER) - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -extern void Step_Handler(HardwareTimer *htim); -extern void Temp_Handler(HardwareTimer *htim); -#define HAL_STEP_TIMER_ISR() void Step_Handler(HardwareTimer *htim) -#define HAL_TEMP_TIMER_ISR() void Temp_Handler(HardwareTimer *htim) - -// ------------------------ -// Public Variables -// ------------------------ - -extern HardwareTimer *timer_instance[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -//TIM_TypeDef* HAL_timer_device(const uint8_t timer_num); no need to be public for now. not public = not used externally - -// FORCE_INLINE because these are used in performance-critical situations -FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) { - return timer_instance[timer_num] != NULL; -} -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0; -} - -// NOTE: Method name may be misleading. -// STM32 has an Auto-Reload Register (ARR) as opposed to a "compare" register -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t overflow) { - if (HAL_timer_initialized(timer_num)) { - timer_instance[timer_num]->setOverflow(overflow + 1, TICK_FORMAT); // Value decremented by setOverflow() - // wiki: "force all registers (Autoreload, prescaler, compare) to be taken into account" - // So, if the new overflow value is less than the count it will trigger a rollover interrupt. - if (overflow < timer_instance[timer_num]->getCount()) // Added 'if' here because reports say it won't boot without it - timer_instance[timer_num]->refresh(); - } -} - -#define HAL_timer_isr_prologue(TIMER_NUM) -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.cpp deleted file mode 100644 index 4defadaa77..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.cpp +++ /dev/null @@ -1,44 +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 . - * - */ - -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(USE_WATCHDOG) - - #include "../../inc/MarlinConfig.h" - - #include "watchdog.h" - #include - - void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout - - void HAL_watchdog_refresh() { - IWatchdog.reload(); - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } - -#endif // USE_WATCHDOG -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.h deleted file mode 100644 index 6855016737..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32/watchdog.h +++ /dev/null @@ -1,25 +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 - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.cpp deleted file mode 100644 index 9dcb77ae4f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 . - * - */ - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" - -#include - -// ------------------------ -// Types -// ------------------------ - -#define __I -#define __IO volatile - typedef struct { - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[5]; - __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ - } SCB_Type; - -// ------------------------ -// Local defines -// ------------------------ - -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -// ------------------------ -// Public Variables -// ------------------------ - -#if (defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE)) - USBSerial SerialUSB; -#endif - -uint16_t HAL_adc_result; - -// ------------------------ -// Private Variables -// ------------------------ -STM32ADC adc(ADC1); - -const uint8_t adc_pins[] = { - #if HAS_TEMP_ADC_0 - TEMP_0_PIN, - #endif - #if HAS_HEATED_BED - TEMP_BED_PIN, - #endif - #if HAS_HEATED_CHAMBER - TEMP_CHAMBER_PIN, - #endif - #if HAS_TEMP_ADC_1 - TEMP_1_PIN, - #endif - #if HAS_TEMP_ADC_2 - TEMP_2_PIN, - #endif - #if HAS_TEMP_ADC_3 - TEMP_3_PIN, - #endif - #if HAS_TEMP_ADC_4 - TEMP_4_PIN, - #endif - #if HAS_TEMP_ADC_5 - TEMP_5_PIN, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - FILWIDTH_PIN, - #endif - #if ENABLED(ADC_KEYPAD) - ADC_KEYPAD_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 { - #if HAS_TEMP_ADC_0 - TEMP_0, - #endif - #if HAS_HEATED_BED - TEMP_BED, - #endif - #if HAS_HEATED_CHAMBER - TEMP_CHAMBER, - #endif - #if HAS_TEMP_ADC_1 - TEMP_1, - #endif - #if HAS_TEMP_ADC_2 - TEMP_2, - #endif - #if HAS_TEMP_ADC_3 - TEMP_3, - #endif - #if HAS_TEMP_ADC_4 - TEMP_4, - #endif - #if HAS_TEMP_ADC_5 - TEMP_5, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - FILWIDTH, - #endif - #if ENABLED(ADC_KEYPAD) - ADC_KEY, - #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]; - -// ------------------------ -// Private functions -// ------------------------ -static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8)); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - -// ------------------------ -// Public functions -// ------------------------ - -// -// Leave PA11/PA12 intact if USBSerial is not used -// -#if SERIAL_USB - namespace wirish { namespace priv { - #if SERIAL_PORT > 0 - #if SERIAL_PORT2 - #if SERIAL_PORT2 > 0 - void board_setup_usb() {} - #endif - #else - void board_setup_usb() {} - #endif - #endif - } } -#endif - -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 - OUT_WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING); - #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. Unfortunately 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() { noInterrupts(); } - -// enable interrupts -void sei() { interrupts(); } -*/ - -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() { return 1; } - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -/** - * TODO: Change this to correct it for libmaple - */ - -// return free memory between end of heap (or end bss) and whatever is current - -/* -#include -//extern caddr_t _sbrk(int incr); -#ifndef CONFIG_HEAP_END -extern char _lm_heap_end; -#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) -#endif - -extern "C" { - static int freeMemory() { - char top = 't'; - return &top - reinterpret_cast(sbrk(0)); - } - int freeMemory() { - int free_memory; - int heap_end = (int)_sbrk(0); - free_memory = ((int)&free_memory) - ((int)heap_end); - return free_memory; - } -} -*/ - -// ------------------------ -// ADC -// ------------------------ -// Init the AD in continuous capture mode -void HAL_adc_init() { - // configure the ADC - adc.calibrate(); - #if F_CPU > 72000000 - adc.setSampleRate(ADC_SMPR_71_5); // 71.5 ADC cycles - #else - adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles - #endif - adc.setPins((uint8_t *)adc_pins, ADC_PIN_COUNT); - adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr); - adc.setScanMode(); - adc.setContinuous(); - adc.startConversion(); -} - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - TEMP_PINS pin_index; - switch (adc_pin) { - default: return; - #if HAS_TEMP_ADC_0 - case TEMP_0_PIN: pin_index = TEMP_0; break; - #endif - #if HAS_HEATED_BED - case TEMP_BED_PIN: pin_index = TEMP_BED; break; - #endif - #if HAS_HEATED_CHAMBER - case TEMP_CHAMBER_PIN: pin_index = TEMP_CHAMBER; break; - #endif - #if HAS_TEMP_ADC_1 - case TEMP_1_PIN: pin_index = TEMP_1; break; - #endif - #if HAS_TEMP_ADC_2 - case TEMP_2_PIN: pin_index = TEMP_2; break; - #endif - #if HAS_TEMP_ADC_3 - case TEMP_3_PIN: pin_index = TEMP_3; break; - #endif - #if HAS_TEMP_ADC_4 - case TEMP_4_PIN: pin_index = TEMP_4; break; - #endif - #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 - #if ENABLED(ADC_KEYPAD) - case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break; - #endif - } - HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only. -} - -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; - return is_analog ? analogRead(uint8_t(pin)) : 0; -} - -// Wrapper to maple unprotected analogWrite -void analogWrite(pin_t pin, int pwm_val8) { - if (PWM_PIN(pin)) - analogWrite(uint8_t(pin), pwm_val8); -} - -void flashFirmware(int16_t value) { nvic_sys_reset(); } - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.h deleted file mode 100644 index a88b72107e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#define CPU_32_BIT - -#include "../../core/macros.h" -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "watchdog.h" - -#include "timers.h" - -#include -#include - -#include "../../inc/MarlinConfigPre.h" - -#ifdef USE_USB_COMPOSITE - #include "msc_sd.h" -#endif - -// ------------------------ -// Defines -// ------------------------ - -#ifndef STM32_FLASH_SIZE - #ifdef MCU_STM32F103RE - #define STM32_FLASH_SIZE 512 - #else - #define STM32_FLASH_SIZE 256 - #endif -#endif - -#ifdef SERIAL_USB - #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 - #define MSerial1 Serial - #define MSerial2 Serial1 - #define MSerial3 Serial2 - #define MSerial4 Serial3 - #define MSerial5 Serial4 -#endif - -#if !WITHIN(SERIAL_PORT, -1, 5) - #error "SERIAL_PORT must be from -1 to 5" -#endif -#if SERIAL_PORT == -1 - #define MYSERIAL0 UsbSerial -#elif SERIAL_PORT == 0 - #error "Serial port 0 does not exist" -#elif SERIAL_PORT == 1 - #define MYSERIAL0 MSerial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 MSerial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 MSerial3 -#elif SERIAL_PORT == 4 - #define MYSERIAL0 MSerial4 -#elif SERIAL_PORT == 5 - #define MYSERIAL0 MSerial5 -#endif - -#ifdef SERIAL_PORT_2 - #if !WITHIN(SERIAL_PORT_2, -1, 5) - #error "SERIAL_PORT_2 must be from -1 to 5" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 UsbSerial - #elif SERIAL_PORT_2 == 0 - #error "Serial port 0 does not exist" - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 MSerial1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 MSerial2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 MSerial3 - #elif SERIAL_PORT_2 == 4 - #define MYSERIAL1 MSerial4 - #elif SERIAL_PORT_2 == 5 - #define MYSERIAL1 MSerial5 - #endif -#else - #define NUM_SERIAL 1 -#endif - -// Set interrupt grouping for this MCU -void HAL_init(); -#define HAL_IDLETASK 1 -void HAL_idletask(); - -/** - * TODO: review this to return 1 for pins that are not analog input - */ -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) (p) -#endif - -#ifndef digitalPinHasPWM - #define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); (void)__iCliRetVal() -#define CRITICAL_SECTION_END if (!primask) (void)__iSeiRetVal() -#define ISRS_ENABLED() (!__get_primask()) -#define ENABLE_ISRS() ((void)__iSeiRetVal()) -#define DISABLE_ISRS() ((void)__iCliRetVal()) - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -#define RST_POWER_ON 1 -#define RST_EXTERNAL 2 -#define RST_BROWN_OUT 4 -#define RST_WATCHDOG 8 -#define RST_JTAG 16 -#define RST_SOFTWARE 32 -#define RST_BACKUP 64 - -// ------------------------ -// Types -// ------------------------ - -typedef int8_t pin_t; - -// ------------------------ -// Public Variables -// ------------------------ - -// Result of last ADC conversion -extern uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// Disable interrupts -#define cli() noInterrupts() - -// Enable interrupts -#define sei() interrupts() - -// Memory related -#define __bss_end __bss_end__ - -// Clear reset reason -void HAL_clear_reset_source(); - -// Reset reason -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(); -} -*/ - -extern "C" char* _sbrk(int incr); - -/* -static int freeMemory() { - volatile int top; - top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); - return top; -} -*/ - -static int freeMemory() { - volatile char top; - return &top - reinterpret_cast(_sbrk(0)); -} - -#pragma GCC diagnostic pop - -// -// EEPROM -// - -/** - * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort. - * Wire library should work for i2c EEPROMs. - */ -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *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); - -// -// ADC -// - -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG); - -void HAL_adc_init(); - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#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(); - -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!? - -#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 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp deleted file mode 100644 index 9f3f34239d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp +++ /dev/null @@ -1,174 +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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * Adapted to the STM32F1 HAL - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" -#include - -// ------------------------ -// Public functions -// ------------------------ - -#if ENABLED(SOFTWARE_SPI) - - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for STM32F1. Use hardware SPI." - -#else - -// ------------------------ -// Hardware SPI -// ------------------------ - -/** - * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz - */ - -/** - * @brief Begin SPI port setup - * - * @return Nothing - * - * @details Only configures SS pin since libmaple creates and initialize the SPI object - */ -void spiBegin() { - #if PIN_EXISTS(SS) - OUT_WRITE(SS_PIN, HIGH); - #endif -} - -/** - * @brief Initialize SPI port to required speed rate and transfer mode (MSB, SPI MODE 0) - * - * @param spiRate Rate as declared in HAL.h (speed do not match AVR) - * @return Nothing - * - * @details - */ -void spiInit(uint8_t spiRate) { - /** - * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz - * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 - * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 - */ - #if SPI_DEVICE == 1 - #define SPI_CLOCK_MAX SPI_CLOCK_DIV4 - #else - #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 - #endif - uint8_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; - case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; - case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; - case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; - case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; - case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2; // Default from the SPI library - } - SPI.setModule(SPI_DEVICE); - SPI.begin(); - SPI.setClockDivider(clock); - SPI.setBitOrder(MSBFIRST); - SPI.setDataMode(SPI_MODE0); -} - -/** - * @brief Receive a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ -uint8_t spiRec() { - uint8_t returnByte = SPI.transfer(ff); - return returnByte; -} - -/** - * @brief Receive a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - * - * @details Uses DMA - */ -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.dmaTransfer(0, const_cast(buf), nbyte); -} - -/** - * @brief Send a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ -void spiSend(uint8_t b) { - SPI.send(b); -} - -/** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Use DMA - */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.send(token); - SPI.dmaSend(const_cast(buf), 512); -} - -#if ENABLED(SPI_EEPROM) - -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan) { return SPI.transfer(ff); } - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b) { SPI.send(b); } - -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n) { - for (size_t p = 0; p < n; p++) spiSend(chan, buf[p]); -} - -#endif // SPI_EEPROM - -#endif // SOFTWARE_SPI - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/README.md deleted file mode 100644 index b5bd5141fb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# STM32F1 - -This HAL is for STM32F103 boards used with [Arduino STM32](https://github.com/rogerclarkmelbourne/Arduino_STM32) framework. - -Currently has been tested in Malyan M200 (103CBT6), SKRmini (103RCT6), Chitu 3d (103ZET6), and various 103VET6 boards. - -### Main developers: -- Victorpv -- xC000005 -- thisiskeithb -- tpruvot diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.cpp deleted file mode 100644 index 8eb8f9aa88..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.cpp +++ /dev/null @@ -1,715 +0,0 @@ -/****************************************************************************** - * The MIT License - * - * Copyright (c) 2010 Perry Hung. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - *****************************************************************************/ - -/** - * @author Marti Bolivar - * @brief Wirish SPI implementation. - */ - -#ifdef __STM32F1__ - -#include - -#include -#include -#include - -#include -#include - -/** Time in ms for DMA receive timeout */ -#define DMA_TIMEOUT 100 - -#if CYCLES_PER_MICROSECOND != 72 - #warning "Unexpected clock speed; SPI frequency calculation will be incorrect" -#endif - -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); -static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq); - -#if BOARD_NR_SPI >= 3 && !defined(STM32_HIGH_DENSITY) - #error "The SPI library is misconfigured: 3 SPI ports only available on high density STM32 devices" -#endif - -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 }, - #endif - #if BOARD_NR_SPI >= 2 - { 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 }, - #endif -}; - -#if BOARD_NR_SPI >= 1 - static void *_spi1_this; -#endif -#if BOARD_NR_SPI >= 2 - static void *_spi2_this; -#endif -#if BOARD_NR_SPI >= 3 - 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 - - switch (spi_num) { - #if BOARD_NR_SPI >= 1 - case 1: - _currentSetting->spi_d = SPI1; - _spi1_this = (void*)this; - break; - #endif - #if BOARD_NR_SPI >= 2 - case 2: - _currentSetting->spi_d = SPI2; - _spi2_this = (void*)this; - break; - #endif - #if BOARD_NR_SPI >= 3 - case 3: - _currentSetting->spi_d = SPI3; - _spi3_this = (void*)this; - break; - #endif - default: ASSERT(0); - } - - // Init things specific to each SPI device - // clock divider setup is a bit of hack, and needs to be improved at a later date. - #if BOARD_NR_SPI >= 1 - _settings[0].spi_d = SPI1; - _settings[0].clockDivider = determine_baud_rate(_settings[0].spi_d, _settings[0].clock); - _settings[0].spiDmaDev = DMA1; - _settings[0].spiTxDmaChannel = DMA_CH3; - _settings[0].spiRxDmaChannel = DMA_CH2; - #endif - #if BOARD_NR_SPI >= 2 - _settings[1].spi_d = SPI2; - _settings[1].clockDivider = determine_baud_rate(_settings[1].spi_d, _settings[1].clock); - _settings[1].spiDmaDev = DMA1; - _settings[1].spiTxDmaChannel = DMA_CH5; - _settings[1].spiRxDmaChannel = DMA_CH4; - #endif - #if BOARD_NR_SPI >= 3 - _settings[2].spi_d = SPI3; - _settings[2].clockDivider = determine_baud_rate(_settings[2].spi_d, _settings[2].clock); - _settings[2].spiDmaDev = DMA2; - _settings[2].spiTxDmaChannel = DMA_CH2; - _settings[2].spiRxDmaChannel = DMA_CH1; - #endif - - // added for DMA callbacks. - _currentSetting->state = SPI_STATE_IDLE; -} - -/** - * Set up/tear down - */ -void SPIClass::updateSettings() { - uint32_t flags = ((_currentSetting->bitOrder == MSBFIRST ? SPI_FRAME_MSB : SPI_FRAME_LSB) | _currentSetting->dataSize | SPI_SW_SLAVE | SPI_SOFT_SS); - spi_master_enable(_currentSetting->spi_d, (spi_baud_rate)_currentSetting->clockDivider, (spi_mode)_currentSetting->dataMode, flags); -} - -void SPIClass::begin() { - spi_init(_currentSetting->spi_d); - configure_gpios(_currentSetting->spi_d, 1); - updateSettings(); - // added for DMA callbacks. - _currentSetting->state = SPI_STATE_READY; -} - -void SPIClass::beginSlave() { - spi_init(_currentSetting->spi_d); - configure_gpios(_currentSetting->spi_d, 0); - uint32_t flags = ((_currentSetting->bitOrder == MSBFIRST ? SPI_FRAME_MSB : SPI_FRAME_LSB) | _currentSetting->dataSize); - spi_slave_enable(_currentSetting->spi_d, (spi_mode)_currentSetting->dataMode, flags); - // added for DMA callbacks. - _currentSetting->state = SPI_STATE_READY; -} - -void SPIClass::end() { - if (!spi_is_enabled(_currentSetting->spi_d)) return; - - // Follows RM0008's sequence for disabling a SPI in master/slave - // full duplex mode. - while (spi_is_rx_nonempty(_currentSetting->spi_d)) { - // 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); - } - waitSpiTxEnd(_currentSetting->spi_d); - - spi_peripheral_disable(_currentSetting->spi_d); - // added for DMA callbacks. - // Need to add unsetting the callbacks for the DMA channels. - _currentSetting->state = SPI_STATE_IDLE; -} - -/* Roger Clark added 3 functions */ -void SPIClass::setClockDivider(uint32_t clockDivider) { - _currentSetting->clockDivider = clockDivider; - uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_BR); - _currentSetting->spi_d->regs->CR1 = cr1 | (clockDivider & SPI_CR1_BR); -} - -void SPIClass::setBitOrder(BitOrder bitOrder) { - _currentSetting->bitOrder = bitOrder; - uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_LSBFIRST); - if (bitOrder == LSBFIRST) cr1 |= SPI_CR1_LSBFIRST; - _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. - */ -void SPIClass::setDataSize(uint32_t datasize) { - _currentSetting->dataSize = datasize; - uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_DFF); - uint8_t en = spi_is_enabled(_currentSetting->spi_d); - spi_peripheral_disable(_currentSetting->spi_d); - _currentSetting->spi_d->regs->CR1 = cr1 | (datasize & SPI_CR1_DFF) | en; -} - -void SPIClass::setDataMode(uint8_t dataMode) { - /** - * 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)); -} - -void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) { - setBitOrder(settings.bitOrder); - setDataMode(settings.dataMode); - setDataSize(settings.dataSize); - setClockDivider(determine_baud_rate(_currentSetting->spi_d, settings.clock)); - begin(); -} - -void SPIClass::beginTransactionSlave(SPISettings settings) { - setBitOrder(settings.bitOrder); - setDataMode(settings.dataMode); - setDataSize(settings.dataSize); - beginSlave(); -} - -void SPIClass::endTransaction() { } - -/** - * I/O - */ - -uint16_t SPIClass::read() { - while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } - return (uint16)spi_rx_reg(_currentSetting->spi_d); -} - -void SPIClass::read(uint8_t *buf, uint32_t len) { - if (len == 0) return; - spi_rx_reg(_currentSetting->spi_d); // clear the RX buffer in case a byte is waiting on it. - spi_reg_map * regs = _currentSetting->spi_d->regs; - // start sequence: write byte 0 - regs->DR = 0x00FF; // write the first byte - // main loop - 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)) { /* 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)) { /* nada */ } // wait till data is available in the Rx register - *buf++ = (uint8)(regs->DR); // read and store the received byte -} - -void SPIClass::write(uint16_t data) { - /* Added for 16bit data Victor Perez. Roger Clark - * Improved speed by just directly writing the single byte to the SPI data reg and wait for completion, - * by taking the Tx code from transfer(byte) - * 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) - 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)) { /* nada */ } // Wait until TXE=1 - spi_tx_reg(_currentSetting->spi_d, data); // write low byte - 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--) { - 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)) { /* nada */ } // wait till Tx empty - } - 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 - 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 - waitSpiTxEnd(spi_d); - return (uint8)spi_rx_reg(spi_d); // "... and read the last received data." -} - -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 - 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. - */ -void SPIClass::dmaTransferSet(const void *transmitBuf, void *receiveBuf) { - dma_init(_currentSetting->spiDmaDev); - //spi_rx_dma_enable(_currentSetting->spi_d); - //spi_tx_dma_enable(_currentSetting->spi_d); - dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; - dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &_currentSetting->spi_d->regs->DR, - dma_bit_size, receiveBuf, dma_bit_size, (DMA_MINC_MODE | DMA_TRNS_CMPLT ));// receive buffer DMA - if (!transmitBuf) { - transmitBuf = &ff; - dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, - dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, (DMA_FROM_MEM));// Transmit FF repeatedly - } - else { - dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, - dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, (DMA_MINC_MODE | DMA_FROM_MEM ));// Transmit buffer DMA - } - dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, DMA_PRIORITY_LOW); - dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, DMA_PRIORITY_VERY_HIGH); -} - -uint8_t SPIClass::dmaTransferRepeat(uint16_t length) { - if (length == 0) return 0; - if (spi_is_rx_nonempty(_currentSetting->spi_d) == 1) spi_rx_reg(_currentSetting->spi_d); - _currentSetting->state = SPI_STATE_TRANSFER; - dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, length); - dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); - dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel);// enable receive - dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel);// enable transmit - spi_rx_dma_enable(_currentSetting->spi_d); - spi_tx_dma_enable(_currentSetting->spi_d); - if (_currentSetting->receiveCallback) - return 0; - - //uint32_t m = millis(); - uint8_t b = 0; - uint32_t m = millis(); - 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; } - } - - 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); - dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); - dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); - dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); - _currentSetting->state = SPI_STATE_READY; - return b; -} - -/** - * 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. - * Still in progress. - */ -uint8_t SPIClass::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length) { - dmaTransferSet(transmitBuf, receiveBuf); - return dmaTransferRepeat(length); -} - -/** - * 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. - * 2016 - stevstrong - reworked to automatically detect bit size from SPI setting - */ -void SPIClass::dmaSendSet(const void * transmitBuf, bool minc) { - uint32_t flags = ( (DMA_MINC_MODE*minc) | DMA_FROM_MEM | DMA_TRNS_CMPLT); - dma_init(_currentSetting->spiDmaDev); - dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; - dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, dma_bit_size, - (volatile void*)transmitBuf, dma_bit_size, flags);// Transmit buffer DMA - dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, DMA_PRIORITY_LOW); -} - -uint8_t SPIClass::dmaSendRepeat(uint16_t length) { - if (length == 0) return 0; - - 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 - spi_tx_dma_enable(_currentSetting->spi_d); - 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)) { - // Avoid interrupts and just loop waiting for the flag to be set. - if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } - } - 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); - _currentSetting->state = SPI_STATE_READY; - return b; -} - -uint8_t SPIClass::dmaSend(const void * transmitBuf, uint16_t length, bool minc) { - dmaSendSet(transmitBuf, minc); - return dmaSendRepeat(length); -} - -uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool minc) { - uint8_t b = 0; - - if (_currentSetting->state != SPI_STATE_READY) { - uint32_t m = millis(); - 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; } - } - 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; - } - - if (length == 0) return 0; - uint32_t flags = ( (DMA_MINC_MODE*minc) | DMA_FROM_MEM | DMA_TRNS_CMPLT); - - dma_init(_currentSetting->spiDmaDev); - // TX - dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; - dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, - dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, flags);// Transmit buffer DMA - dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); - dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); - dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel);// enable transmit - spi_tx_dma_enable(_currentSetting->spi_d); - - _currentSetting->state = SPI_STATE_TRANSMIT; - return b; -} - - -/** - * New functions added to manage callbacks. - * Victor Perez 2017 - */ -void SPIClass::onReceive(void(*callback)()) { - _currentSetting->receiveCallback = callback; - if (callback) { - switch (_currentSetting->spi_d->clk_id) { - #if BOARD_NR_SPI >= 1 - case RCC_SPI1: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi1EventCallback); - break; - #endif - #if BOARD_NR_SPI >= 2 - case RCC_SPI2: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi2EventCallback); - break; - #endif - #if BOARD_NR_SPI >= 3 - case RCC_SPI3: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi3EventCallback); - break; - #endif - default: - ASSERT(0); - } - } - else { - dma_detach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); - } -} - -void SPIClass::onTransmit(void(*callback)()) { - _currentSetting->transmitCallback = callback; - if (callback) { - switch (_currentSetting->spi_d->clk_id) { - #if BOARD_NR_SPI >= 1 - case RCC_SPI1: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi1EventCallback); - break; - #endif - #if BOARD_NR_SPI >= 2 - case RCC_SPI2: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi2EventCallback); - break; - #endif - #if BOARD_NR_SPI >= 3 - case RCC_SPI3: - dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi3EventCallback); - break; - #endif - default: - ASSERT(0); - } - } - else { - dma_detach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); - } -} - -/** - * TODO: check if better to first call the customer code, next disable the DMA requests. - * Also see if we need to check whether callbacks are set or not, may be better to be checked - * during the initial setup and only set the callback to EventCallback if they are set. - */ -void SPIClass::EventCallback() { - waitSpiTxEnd(_currentSetting->spi_d); - switch (_currentSetting->state) { - case SPI_STATE_TRANSFER: - 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); - //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); - //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); - if (_currentSetting->receiveCallback) - _currentSetting->receiveCallback(); - break; - case SPI_STATE_TRANSMIT: - _currentSetting->state = SPI_STATE_READY; - spi_tx_dma_disable(_currentSetting->spi_d); - //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); - if (_currentSetting->transmitCallback) - _currentSetting->transmitCallback(); - break; - default: - break; - } -} - -void SPIClass::attachInterrupt() { - // Should be enableInterrupt() -} - -void SPIClass::detachInterrupt() { - // Should be disableInterrupt() -} - -/** - * Pin accessors - */ - -uint8_t SPIClass::misoPin() { - return dev_to_spi_pins(_currentSetting->spi_d)->miso; -} - -uint8_t SPIClass::mosiPin() { - return dev_to_spi_pins(_currentSetting->spi_d)->mosi; -} - -uint8_t SPIClass::sckPin() { - return dev_to_spi_pins(_currentSetting->spi_d)->sck; -} - -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(); } - -/** - * DMA call back functions, one per port. - */ -#if BOARD_NR_SPI >= 1 - void SPIClass::_spi1EventCallback() { - reinterpret_cast(_spi1_this)->EventCallback(); - } -#endif -#if BOARD_NR_SPI >= 2 - void SPIClass::_spi2EventCallback() { - reinterpret_cast(_spi2_this)->EventCallback(); - } -#endif -#if BOARD_NR_SPI >= 3 - void SPIClass::_spi3EventCallback() { - reinterpret_cast(_spi3_this)->EventCallback(); - } -#endif - -/** - * Auxiliary functions - */ -static const spi_pins* dev_to_spi_pins(spi_dev *dev) { - switch (dev->clk_id) { - #if BOARD_NR_SPI >= 1 - case RCC_SPI1: return board_spi_pins; - #endif - #if BOARD_NR_SPI >= 2 - case RCC_SPI2: return board_spi_pins + 1; - #endif - #if BOARD_NR_SPI >= 3 - case RCC_SPI3: return board_spi_pins + 2; - #endif - default: return NULL; - } -} - -static void disable_pwm(const stm32_pin_info *i) { - if (i->timer_device) - timer_set_mode(i->timer_device, i->timer_channel, TIMER_DISABLED); -} - -static void configure_gpios(spi_dev *dev, bool as_master) { - const spi_pins *pins = dev_to_spi_pins(dev); - if (!pins) return; - - const stm32_pin_info *nssi = &PIN_MAP[pins->nss], - *scki = &PIN_MAP[pins->sck], - *misoi = &PIN_MAP[pins->miso], - *mosii = &PIN_MAP[pins->mosi]; - - disable_pwm(nssi); - disable_pwm(scki); - disable_pwm(misoi); - disable_pwm(mosii); - - spi_config_gpios(dev, as_master, nssi->gpio_device, nssi->gpio_bit, - scki->gpio_device, scki->gpio_bit, misoi->gpio_bit, - mosii->gpio_bit); -} - -static const spi_baud_rate baud_rates[8] __FLASH__ = { - SPI_BAUD_PCLK_DIV_2, - SPI_BAUD_PCLK_DIV_4, - SPI_BAUD_PCLK_DIV_8, - SPI_BAUD_PCLK_DIV_16, - SPI_BAUD_PCLK_DIV_32, - SPI_BAUD_PCLK_DIV_64, - SPI_BAUD_PCLK_DIV_128, - 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). - */ -static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq) { - uint32_t clock = 0; - switch (rcc_dev_clk(dev->clk_id)) { - case RCC_AHB: - case RCC_APB2: clock = STM32_PCLK2; break; // 72 Mhz - case RCC_APB1: clock = STM32_PCLK1; break; // 36 Mhz - } - clock >>= 1; - - uint8_t i = 0; - while (i < 7 && freq < clock) { clock >>= 1; i++; } - return baud_rates[i]; -} - -SPIClass SPI(1); - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.h deleted file mode 100644 index 0162ac13bb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SPI.h +++ /dev/null @@ -1,417 +0,0 @@ -/****************************************************************************** - * The MIT License - * - * Copyright (c) 2010 Perry Hung. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - *****************************************************************************/ -#pragma once - -#include -#include -#include - -#include -#include -#include - -// SPI_HAS_TRANSACTION means SPI has -// - beginTransaction() -// - endTransaction() -// - usingInterrupt() -// - SPISetting(clock, bitOrder, dataMode) -//#define SPI_HAS_TRANSACTION - -#define SPI_CLOCK_DIV2 SPI_BAUD_PCLK_DIV_2 -#define SPI_CLOCK_DIV4 SPI_BAUD_PCLK_DIV_4 -#define SPI_CLOCK_DIV8 SPI_BAUD_PCLK_DIV_8 -#define SPI_CLOCK_DIV16 SPI_BAUD_PCLK_DIV_16 -#define SPI_CLOCK_DIV32 SPI_BAUD_PCLK_DIV_32 -#define SPI_CLOCK_DIV64 SPI_BAUD_PCLK_DIV_64 -#define SPI_CLOCK_DIV128 SPI_BAUD_PCLK_DIV_128 -#define SPI_CLOCK_DIV256 SPI_BAUD_PCLK_DIV_256 - -/* - * Roger Clark. 20150106 - * Commented out redundant AVR defined - * -#define SPI_MODE_MASK 0x0C // CPOL = bit 3, CPHA = bit 2 on SPCR -#define SPI_CLOCK_MASK 0x03 // SPR1 = bit 1, SPR0 = bit 0 on SPCR -#define SPI_2XCLOCK_MASK 0x01 // SPI2X = bit 0 on SPSR - -// define SPI_AVR_EIMSK for AVR boards with external interrupt pins -#ifdef EIMSK - #define SPI_AVR_EIMSK EIMSK -#elif defined(GICR) - #define SPI_AVR_EIMSK GICR -#elif defined(GIMSK) - #define SPI_AVR_EIMSK GIMSK -#endif -*/ - -#ifndef STM32_LSBFIRST - #define STM32_LSBFIRST 0 -#endif -#ifndef STM32_MSBFIRST - #define STM32_MSBFIRST 1 -#endif - -// PC13 or PA4 -#define BOARD_SPI_DEFAULT_SS PA4 -//#define BOARD_SPI_DEFAULT_SS PC13 - -#define SPI_MODE0 SPI_MODE_0 -#define SPI_MODE1 SPI_MODE_1 -#define SPI_MODE2 SPI_MODE_2 -#define SPI_MODE3 SPI_MODE_3 - -#define DATA_SIZE_8BIT SPI_CR1_DFF_8_BIT -#define DATA_SIZE_16BIT SPI_CR1_DFF_16_BIT - -typedef enum { - SPI_STATE_IDLE, - SPI_STATE_READY, - SPI_STATE_RECEIVE, - SPI_STATE_TRANSMIT, - SPI_STATE_TRANSFER -} spi_mode_t; - -class SPISettings { -public: - 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(inClock, inBitOrder, inDataMode, DATA_SIZE_8BIT); - } - 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(inClock, inBitOrder, inDataMode, inDataSize); - } - SPISettings(uint32_t inClock) { - if (__builtin_constant_p(inClock)) - init_AlwaysInline(inClock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); - else - 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 inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) { - init_AlwaysInline(inClock, inBitOrder, inDataMode, inDataSize); - } - 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; - uint32_t clockDivider; - BitOrder bitOrder; - uint8_t dataMode; - uint8_t _SSPin; - volatile spi_mode_t state; - spi_dev *spi_d; - dma_channel spiRxDmaChannel, spiTxDmaChannel; - dma_dev* spiDmaDev; - void (*receiveCallback)() = NULL; - void (*transmitCallback)() = NULL; - - friend class SPIClass; -}; - -/* - * Kept for compat. - */ -static const uint8_t ff = 0xFF; - -/** - * @brief Wirish SPI interface. - * - * This implementation uses software slave management, so the caller - * is responsible for controlling the slave select line. - */ -class SPIClass { - -public: - /** - * @param spiPortNumber Number of the SPI port to manage. - */ - SPIClass(uint32_t spiPortNumber); - - /** - * @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0). - */ - void begin(); - - /** - * @brief Turn on a SPI port and set its GPIO pin modes for use as a slave. - * - * SPI port is enabled in full duplex mode, with software slave management. - * - * @param bitOrder Either LSBFIRST (little-endian) or MSBFIRST(big-endian) - * @param mode SPI mode to use - */ - void beginSlave(uint32_t bitOrder, uint32_t mode); - - /** - * @brief Equivalent to beginSlave(MSBFIRST, 0). - */ - void beginSlave(); - - /** - * @brief Disables the SPI port, but leaves its GPIO pin modes unchanged. - */ - void end(); - - void beginTransaction(SPISettings settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); } - void beginTransaction(uint8_t pin, SPISettings settings); - void endTransaction(); - - void beginTransactionSlave(SPISettings settings); - - void setClockDivider(uint32_t clockDivider); - void setBitOrder(BitOrder bitOrder); - void setDataMode(uint8_t dataMode); - - // SPI Configuration methods - void attachInterrupt(); - void detachInterrupt(); - - /* Victor Perez. Added to change 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. - * Requires an added function spi_data_size on STM32F1 / cores / maple / libmaple / spi.c - */ - void setDataSize(uint32_t ds); - - /* Victor Perez 2017. Added to set and clear callback functions for callback - * on DMA transfer completion. - * onReceive used to set the callback in case of dmaTransfer (tx/rx), once rx is completed - * 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 onTransmit(void(*)()); - - /* - * I/O - */ - - /** - * @brief Return the next unread byte/word. - * - * If there is no unread byte/word waiting, this function will block - * until one is received. - */ - uint16_t read(); - - /** - * @brief Read length bytes, storing them into buffer. - * @param buffer Buffer to store received bytes into. - * @param length Number of bytes to store in buffer. This - * function will block until the desired number of - * bytes have been read. - */ - void read(uint8_t *buffer, uint32_t length); - - /** - * @brief Transmit one byte/word. - * @param data to transmit. - */ - void write(uint16_t data); - void write16(uint16_t data); // write 2 bytes in 8 bit mode (DFF=0) - - /** - * @brief Transmit one byte/word a specified number of times. - * @param data to transmit. - */ - void write(uint16_t data, uint32_t n); - - /** - * @brief Transmit multiple bytes/words. - * @param buffer Bytes/words to transmit. - * @param length Number of bytes/words in buffer to transmit. - */ - void write(const void * buffer, uint32_t length); - - /** - * @brief Transmit a byte, then return the next unread byte. - * - * This function transmits before receiving. - * - * @param data Byte to transmit. - * @return Next unread byte. - */ - uint8_t transfer(uint8_t data) const; - uint16_t transfer16(uint16_t data) const; - - /** - * @brief Sets up a DMA Transfer for "length" bytes. - * The transfer mode (8 or 16 bit mode) is evaluated from the SPI peripheral setting. - * - * This function transmits and receives to buffers. - * - * @param transmitBuf buffer Bytes to transmit. If passed as 0, it sends FF repeatedly for "length" bytes - * @param receiveBuf buffer Bytes to save received data. - * @param length Number of bytes in buffer to transmit. - */ - uint8_t dmaTransfer(const void * transmitBuf, void * receiveBuf, uint16_t length); - void dmaTransferSet(const void *transmitBuf, void *receiveBuf); - uint8_t dmaTransferRepeat(uint16_t length); - - /** - * @brief Sets up a DMA Transmit for SPI 8 or 16 bit transfer mode. - * The transfer mode (8 or 16 bit mode) is evaluated from the SPI peripheral setting. - * - * This function only transmits and does not care about the RX fifo. - * - * @param data buffer half words to transmit, - * @param length Number of bytes in buffer to transmit. - * @param minc Set to use Memory Increment mode, clear to use Circular mode. - */ - uint8_t dmaSend(const void * transmitBuf, uint16_t length, bool minc = 1); - void dmaSendSet(const void * transmitBuf, bool minc); - uint8_t dmaSendRepeat(uint16_t length); - - uint8_t dmaSendAsync(const void * transmitBuf, uint16_t length, bool minc = 1); - /* - * Pin accessors - */ - - /** - * @brief Return the number of the MISO (master in, slave out) pin - */ - uint8_t misoPin(); - - /** - * @brief Return the number of the MOSI (master out, slave in) pin - */ - uint8_t mosiPin(); - - /** - * @brief Return the number of the SCK (serial clock) pin - */ - uint8_t sckPin(); - - /** - * @brief Return the number of the NSS (slave select) pin - */ - uint8_t nssPin(); - - /* Escape hatch */ - - /** - * @brief Get a pointer to the underlying libmaple spi_dev for - * this HardwareSPI instance. - */ - spi_dev* c_dev() { return _currentSetting->spi_d; } - - spi_dev* dev() { return _currentSetting->spi_d; } - - /** - * @brief Sets the number of the SPI peripheral to be used by - * this HardwareSPI instance. - * - * @param spi_num Number of the SPI port. 1-2 in low density devices - * 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 - } - - /* -- The following methods are deprecated --------------------------- */ - - /** - * @brief Deprecated. - * - * Use HardwareSPI::transfer() instead. - * - * @see HardwareSPI::transfer() - */ - uint8_t send(uint8_t data); - - /** - * @brief Deprecated. - * - * Use HardwareSPI::write() in combination with - * HardwareSPI::read() (or HardwareSPI::transfer()) instead. - * - * @see HardwareSPI::write() - * @see HardwareSPI::read() - * @see HardwareSPI::transfer() - */ - uint8_t send(uint8_t *data, uint32_t length); - - /** - * @brief Deprecated. - * - * Use HardwareSPI::read() instead. - * - * @see HardwareSPI::read() - */ - uint8_t recv(); - -private: - - SPISettings _settings[BOARD_NR_SPI]; - SPISettings *_currentSetting; - - void updateSettings(); - - /* - * Functions added for DMA transfers with Callback. - * Experimental. - */ - - void EventCallback(); - - #if BOARD_NR_SPI >= 1 - static void _spi1EventCallback(); - #endif - #if BOARD_NR_SPI >= 2 - static void _spi2EventCallback(); - #endif - #if BOARD_NR_SPI >= 3 - static void _spi3EventCallback(); - #endif - /* - spi_dev *spi_d; - uint8_t _SSPin; - uint32_t clockDivider; - uint8_t dataMode; - BitOrder bitOrder; - */ -}; - -/** - * @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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.cpp deleted file mode 100644 index 5dc2169154..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.cpp +++ /dev/null @@ -1,229 +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 . - * - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -uint8_t ServoCount = 0; - -#include "Servo.h" -#include "timers.h" - -//#include "Servo.h" - -#include -#include -#include -#include - -/** - * 20 millisecond period config. For a 1-based prescaler, - * - * (prescaler * overflow / CYC_MSEC) msec = 1 timer cycle = 20 msec - * => prescaler * overflow = 20 * CYC_MSEC - * - * This uses the smallest prescaler that allows an overflow < 2^16. - */ -#define MAX_OVERFLOW UINT16_MAX //((1 << 16) - 1) -#define CYC_MSEC (1000 * CYCLES_PER_MICROSECOND) -#define TAU_MSEC 20 -#define TAU_USEC (TAU_MSEC * 1000) -#define TAU_CYC (TAU_MSEC * CYC_MSEC) -#define SERVO_PRESCALER (TAU_CYC / MAX_OVERFLOW + 1) -#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), 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 inPin, uint16_t duty_cycle) { - #ifdef SERVO0_TIMER_NUM - if (servoIndex == 0) { - pwmSetDuty(duty_cycle); - return; - } - #endif - - 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() { - servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; -} - -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; - - minAngle = inMinAngle; - maxAngle = inMaxAngle; - angle = -1; - - #ifdef SERVO0_TIMER_NUM - if (servoIndex == 0 && setupSoftPWM(inPin)) { - pin = inPin; // set attached() - return true; - } - #endif - - if (!PWM_PIN(inPin)) return false; - - timer_dev *tdev = PIN_MAP[inPin].timer_device; - //uint8_t tchan = PIN_MAP[inPin].timer_channel; - - SET_PWM(inPin); - servoWrite(inPin, 0); - - timer_pause(tdev); - timer_set_prescaler(tdev, SERVO_PRESCALER - 1); // prescaler is 1-based - timer_set_reload(tdev, SERVO_OVERFLOW); - timer_generate_update(tdev); - timer_resume(tdev); - - pin = inPin; // set attached() - return true; -} - -bool libServo::detach() { - if (!attached()) return false; - angle = -1; - servoWrite(pin, 0); - return true; -} - -int32_t libServo::read() const { - if (attached()) { - #ifdef SERVO0_TIMER_NUM - if (servoIndex == 0) return angle; - #endif - 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; -} - -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 (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) - detach(); - #endif - } -} - -#ifdef SERVO0_TIMER_NUM - 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 - #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(SERVO0_PIN, 1); // off - #else - OUT_WRITE(SERVO0_PIN, 0); - #endif - timer_reset_status_bit(tdev, TIMER_SR_CC1IF_BIT); - } - if (SR & TIMER_SR_CC2IF) { // channel 2 resume - #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(SERVO0_PIN, 0); // on - #else - OUT_WRITE(SERVO0_PIN, 1); - #endif - timer_reset_status_bit(tdev, TIMER_SR_CC2IF_BIT); - } - } - - 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(inPin, 1); - #else - OUT_WRITE(inPin, 0); - #endif - - timer_pause(tdev); - timer_set_mode(tdev, 1, TIMER_OUTPUT_COMPARE); // counter with isr - timer_oc_set_mode(tdev, 1, TIMER_OC_MODE_FROZEN, 0); // no pin output change - timer_oc_set_mode(tdev, 2, TIMER_OC_MODE_FROZEN, 0); // no pin output change - timer_set_prescaler(tdev, SERVO_PRESCALER - 1); // prescaler is 1-based - timer_set_reload(tdev, SERVO_OVERFLOW); - timer_set_compare(tdev, 1, SERVO_OVERFLOW); - timer_set_compare(tdev, 2, SERVO_OVERFLOW); - timer_attach_interrupt(tdev, 1, Servo_IRQHandler); - timer_attach_interrupt(tdev, 2, Servo_IRQHandler); - timer_generate_update(tdev); - timer_resume(tdev); - - return true; - } - - void libServo::pwmSetDuty(const uint16_t duty_cycle) { - timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); - timer_set_compare(tdev, 1, duty_cycle); - timer_generate_update(tdev); - if (duty_cycle) { - timer_enable_irq(tdev, 1); - timer_enable_irq(tdev, 2); - } - else { - timer_disable_irq(tdev, 1); - timer_disable_irq(tdev, 2); - #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(pin, 1); // off - #else - OUT_WRITE(pin, 0); - #endif - } - } - - void libServo::pauseSoftPWM() { // detach - timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); - timer_pause(tdev); - pwmSetDuty(0); - } - -#else - - bool libServo::setupSoftPWM(const int32_t inPin) { return false; } - void libServo::pwmSetDuty(const uint16_t duty_cycle) {} - void libServo::pauseSoftPWM() {} - -#endif - -#endif // HAS_SERVOS - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.h deleted file mode 100644 index 92f4dd678d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/Servo.h +++ /dev/null @@ -1,60 +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 - -// Pin number of unattached pins -#define NOT_ATTACHED (-1) -#define INVALID_SERVO 255 - -#ifndef MAX_SERVOS - #define MAX_SERVOS 3 -#endif - -#define SERVO_DEFAULT_MIN_PW 544 -#define SERVO_DEFAULT_MAX_PW 2400 -#define SERVO_DEFAULT_MIN_ANGLE 0 -#define SERVO_DEFAULT_MAX_ANGLE 180 - -#define HAL_SERVO_LIB libServo - -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 pin != NOT_ATTACHED; } - bool detach(); - void move(const int32_t value); - int32_t read() const; - private: - void servoWrite(uint8_t pin, const uint16_t duty_cycle); - - uint8_t servoIndex; // index into the channel data for this servo - int32_t pin = NOT_ATTACHED; - int32_t minAngle; - int32_t maxAngle; - int32_t angle; - - bool setupSoftPWM(const int32_t pin); - void pauseSoftPWM(); - void pwmSetDuty(const uint16_t duty_cycle); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp deleted file mode 100644 index 99772a03c2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 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 . - * - */ -#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL) - -/** - * Empty class for Software Serial implementation (Custom RX/TX pins) - * - * TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted - */ - -#include "SoftwareSerial.h" - -// Constructor - -SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {} - -// Public - -void SoftwareSerial::begin(const uint32_t baudrate) { -} - -bool SoftwareSerial::available() { - return false; -} - -uint8_t SoftwareSerial::read() { - return 0; -} - -uint16_t SoftwareSerial::write(uint8_t byte) { - return 0; -} - -void SoftwareSerial::flush() {} - -void SoftwareSerial::listen() { - listening = true; -} - -void SoftwareSerial::stopListening() { - listening = false; -} - -#endif //__STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h deleted file mode 100644 index 330d7d632d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 - -#include - -#ifndef HAVE_SW_SERIAL - #define SW_SERIAL_PLACEHOLDER 1 -#endif - -class SoftwareSerial { -public: - SoftwareSerial(int8_t RX_pin, int8_t TX_pin); - - void begin(const uint32_t baudrate); - - bool available(); - - uint8_t read(); - uint16_t write(uint8_t byte); - void flush(); - - void listen(); - void stopListening(); - -protected: - bool listening; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/build_flags.py b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/build_flags.py deleted file mode 100644 index 6310740fe0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/build_flags.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import print_function -import sys - -#dynamic build flags for generic compile options -if __name__ == "__main__": - args = " ".join([ "-std=gnu11", - "-Os", - "-mcpu=cortex-m3", - "-mthumb", - - "-fsigned-char", - "-fno-move-loop-invariants", - "-fno-strict-aliasing", - - "--specs=nano.specs", - "--specs=nosys.specs", - - "-IMarlin/src/HAL/HAL_STM32F1", - - "-MMD", - "-MP", - "-DTARGET_STM32F1" - ]) - - for i in range(1, len(sys.argv)): - args += " " + sys.argv[i] - - print(args) - -# extra script for linker options -else: - from SCons.Script import DefaultEnvironment - env = DefaultEnvironment() - env.Append( - ARFLAGS=["rcs"], - - ASFLAGS=["-x", "assembler-with-cpp"], - - CXXFLAGS=[ - "-fabi-version=0", - "-fno-use-cxa-atexit", - "-fno-threadsafe-statics" - ], - LINKFLAGS=[ - "-Os", - "-mcpu=cortex-m3", - "-ffreestanding", - "-mthumb", - "--specs=nano.specs", - "--specs=nosys.specs", - "-u_printf_float", - ], - ) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp deleted file mode 100644 index 9d569772fa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp +++ /dev/null @@ -1,324 +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 . - * - */ - -/** - * u8g_com_stm32duino_fsmc.cpp - * - * Communication interface for FSMC - */ - -#include "../../../inc/MarlinConfig.h" - -#if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs - -#if HAS_GRAPHICAL_LCD - -#include -#include -#include -#include -#include - -#ifndef LCD_READ_ID - #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) -#endif - -/* Timing configuration */ -#define FSMC_ADDRESS_SETUP_TIME 15 // AddressSetupTime -#define FSMC_DATA_SETUP_TIME 15 // DataSetupTime - -void LCD_IO_Init(uint8_t cs, uint8_t rs); -void LCD_IO_WriteData(uint16_t RegValue); -void LCD_IO_WriteReg(uint16_t Reg); -uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); -#ifdef LCD_USE_DMA_FSMC - void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); - void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); -#endif - -static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT - -uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - if (msgInitCount) { - if (msg == U8G_COM_MSG_INIT) msgInitCount--; - if (msgInitCount) return -1; - } - - static uint8_t isCommand; - - switch (msg) { - case U8G_COM_MSG_STOP: break; - case U8G_COM_MSG_INIT: - u8g_SetPIOutput(u8g, U8G_PI_RESET); - - #ifdef LCD_USE_DMA_FSMC - dma_init(FSMC_DMA_DEV); - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); - #endif - - LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]); - u8g_Delay(50); - - if (arg_ptr) - *((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3); - isCommand = 0; - break; - - case U8G_COM_MSG_ADDRESS: // define cmd (arg_val = 0) or data mode (arg_val = 1) - isCommand = arg_val == 0 ? 1 : 0; - break; - - case U8G_COM_MSG_RESET: - u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); - break; - - case U8G_COM_MSG_WRITE_BYTE: - if (isCommand) - LCD_IO_WriteReg(arg_val); - else - LCD_IO_WriteData((uint16_t)arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: - for (uint8_t i = 0; i < arg_val; i += 2) - LCD_IO_WriteData(*(uint16_t *)(((uint32_t)arg_ptr) + i)); - break; - } - return 1; -} - -/** - * FSMC LCD IO - */ -#define __ASM __asm -#define __STATIC_INLINE static inline - -__attribute__((always_inline)) __STATIC_INLINE void __DSB() { - __ASM volatile ("dsb 0xF":::"memory"); -} - -#define FSMC_CS_NE1 PD7 - -#if ENABLED(STM32_XL_DENSITY) - #define FSMC_CS_NE2 PG9 - #define FSMC_CS_NE3 PG10 - #define FSMC_CS_NE4 PG12 - - #define FSMC_RS_A0 PF0 - #define FSMC_RS_A1 PF1 - #define FSMC_RS_A2 PF2 - #define FSMC_RS_A3 PF3 - #define FSMC_RS_A4 PF4 - #define FSMC_RS_A5 PF5 - #define FSMC_RS_A6 PF12 - #define FSMC_RS_A7 PF13 - #define FSMC_RS_A8 PF14 - #define FSMC_RS_A9 PF15 - #define FSMC_RS_A10 PG0 - #define FSMC_RS_A11 PG1 - #define FSMC_RS_A12 PG2 - #define FSMC_RS_A13 PG3 - #define FSMC_RS_A14 PG4 - #define FSMC_RS_A15 PG5 -#endif - -#define FSMC_RS_A16 PD11 -#define FSMC_RS_A17 PD12 -#define FSMC_RS_A18 PD13 -#define FSMC_RS_A19 PE3 -#define FSMC_RS_A20 PE4 -#define FSMC_RS_A21 PE5 -#define FSMC_RS_A22 PE6 -#define FSMC_RS_A23 PE2 - -#if ENABLED(STM32_XL_DENSITY) - #define FSMC_RS_A24 PG13 - #define FSMC_RS_A25 PG14 -#endif - -static uint8_t fsmcInit = 0; - -typedef struct { - __IO uint16_t REG; - __IO uint16_t RAM; -} LCD_CONTROLLER_TypeDef; - -LCD_CONTROLLER_TypeDef *LCD; - -void LCD_IO_Init(uint8_t cs, uint8_t rs) { - uint32_t controllerAddress; - - if (fsmcInit) return; - fsmcInit = 1; - - switch (cs) { - case FSMC_CS_NE1: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION1; break; - #if ENABLED(STM32_XL_DENSITY) - case FSMC_CS_NE2: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION2; break; - case FSMC_CS_NE3: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION3; break; - case FSMC_CS_NE4: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION4; break; - #endif - default: return; - } - - #define _ORADDR(N) controllerAddress |= (_BV32(N) - 2) - - switch (rs) { - #if ENABLED(STM32_XL_DENSITY) - case FSMC_RS_A0: _ORADDR( 1); break; - case FSMC_RS_A1: _ORADDR( 2); break; - case FSMC_RS_A2: _ORADDR( 3); break; - case FSMC_RS_A3: _ORADDR( 4); break; - case FSMC_RS_A4: _ORADDR( 5); break; - case FSMC_RS_A5: _ORADDR( 6); break; - case FSMC_RS_A6: _ORADDR( 7); break; - case FSMC_RS_A7: _ORADDR( 8); break; - case FSMC_RS_A8: _ORADDR( 9); break; - case FSMC_RS_A9: _ORADDR(10); break; - case FSMC_RS_A10: _ORADDR(11); break; - case FSMC_RS_A11: _ORADDR(12); break; - case FSMC_RS_A12: _ORADDR(13); break; - case FSMC_RS_A13: _ORADDR(14); break; - case FSMC_RS_A14: _ORADDR(15); break; - case FSMC_RS_A15: _ORADDR(16); break; - #endif - case FSMC_RS_A16: _ORADDR(17); break; - case FSMC_RS_A17: _ORADDR(18); break; - case FSMC_RS_A18: _ORADDR(19); break; - case FSMC_RS_A19: _ORADDR(20); break; - case FSMC_RS_A20: _ORADDR(21); break; - case FSMC_RS_A21: _ORADDR(22); break; - case FSMC_RS_A22: _ORADDR(23); break; - case FSMC_RS_A23: _ORADDR(24); break; - #if ENABLED(STM32_XL_DENSITY) - case FSMC_RS_A24: _ORADDR(25); break; - case FSMC_RS_A25: _ORADDR(26); break; - #endif - default: return; - } - - rcc_clk_enable(RCC_FSMC); - - gpio_set_mode(GPIOD, 14, GPIO_AF_OUTPUT_PP); // FSMC_D00 - gpio_set_mode(GPIOD, 15, GPIO_AF_OUTPUT_PP); // FSMC_D01 - gpio_set_mode(GPIOD, 0, GPIO_AF_OUTPUT_PP); // FSMC_D02 - gpio_set_mode(GPIOD, 1, GPIO_AF_OUTPUT_PP); // FSMC_D03 - gpio_set_mode(GPIOE, 7, GPIO_AF_OUTPUT_PP); // FSMC_D04 - gpio_set_mode(GPIOE, 8, GPIO_AF_OUTPUT_PP); // FSMC_D05 - gpio_set_mode(GPIOE, 9, GPIO_AF_OUTPUT_PP); // FSMC_D06 - gpio_set_mode(GPIOE, 10, GPIO_AF_OUTPUT_PP); // FSMC_D07 - gpio_set_mode(GPIOE, 11, GPIO_AF_OUTPUT_PP); // FSMC_D08 - gpio_set_mode(GPIOE, 12, GPIO_AF_OUTPUT_PP); // FSMC_D09 - gpio_set_mode(GPIOE, 13, GPIO_AF_OUTPUT_PP); // FSMC_D10 - gpio_set_mode(GPIOE, 14, GPIO_AF_OUTPUT_PP); // FSMC_D11 - gpio_set_mode(GPIOE, 15, GPIO_AF_OUTPUT_PP); // FSMC_D12 - gpio_set_mode(GPIOD, 8, GPIO_AF_OUTPUT_PP); // FSMC_D13 - gpio_set_mode(GPIOD, 9, GPIO_AF_OUTPUT_PP); // FSMC_D14 - gpio_set_mode(GPIOD, 10, GPIO_AF_OUTPUT_PP); // FSMC_D15 - - gpio_set_mode(GPIOD, 4, GPIO_AF_OUTPUT_PP); // FSMC_NOE - gpio_set_mode(GPIOD, 5, GPIO_AF_OUTPUT_PP); // FSMC_NWE - - gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx - gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax - - #if ENABLED(STM32_XL_DENSITY) - FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; - FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; - #else // PSRAM1 for STM32F103V (high density) - FSMC_NOR_PSRAM1_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; - FSMC_NOR_PSRAM1_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; - #endif - - afio_remap(AFIO_REMAP_FSMC_NADV); - - LCD = (LCD_CONTROLLER_TypeDef*)controllerAddress; -} - -void LCD_IO_WriteData(uint16_t RegValue) { - LCD->RAM = RegValue; - __DSB(); -} - -void LCD_IO_WriteReg(uint16_t Reg) { - LCD->REG = Reg; - __DSB(); -} - -uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { - volatile uint32_t data; - LCD->REG = RegValue; - __DSB(); - - data = LCD->RAM; // dummy read - data = LCD->RAM & 0x00FF; - - while (--ReadSize) { - data <<= 8; - data |= (LCD->RAM & 0x00FF); - } - return uint32_t(data); -} - -#if ENABLED(LCD_USE_DMA_FSMC) - -void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { - while (count > 0) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, &color, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, count > 65535 ? 65535 : count); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - count = count > 65535 ? count - 65535 : 0; - } -} - -void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -void LCD_IO_WaitSequence_Async() { - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -#endif // LCD_USE_DMA_FSMC - -#endif // HAS_GRAPHICAL_LCD -#endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp deleted file mode 100644 index 753a5d5e70..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/** - * 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 . - * - */ -#ifdef __STM32F1__ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_GRAPHICAL_LCD && ENABLED(FORCE_SOFT_SPI) - -#include "../HAL.h" -#include - -#undef SPI_SPEED -#define SPI_SPEED 0 // Fastest -//#define SPI_SPEED 2 // Slower - -static uint8_t SPI_speed = SPI_SPEED; - -static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) { - for (uint8_t i = 0; i < 8; i++) { - if (spi_speed == 0) { - WRITE(DOGLCD_MOSI, !!(b & 0x80)); - WRITE(DOGLCD_SCK, HIGH); - b <<= 1; - if (miso_pin >= 0 && READ(miso_pin)) b |= 1; - WRITE(DOGLCD_SCK, LOW); - } - else { - const uint8_t state = (b & 0x80) ? HIGH : LOW; - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(DOGLCD_MOSI, state); - - for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - WRITE(DOGLCD_SCK, HIGH); - - b <<= 1; - if (miso_pin >= 0 && READ(miso_pin)) b |= 1; - - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(DOGLCD_SCK, LOW); - } - } - return b; -} - -static inline uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) { - for (uint8_t i = 0; i < 8; i++) { - const uint8_t state = (b & 0x80) ? HIGH : LOW; - if (spi_speed == 0) { - WRITE(DOGLCD_SCK, LOW); - WRITE(DOGLCD_MOSI, state); - WRITE(DOGLCD_MOSI, state); // need some setup time - WRITE(DOGLCD_SCK, HIGH); - } - else { - for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - WRITE(DOGLCD_SCK, LOW); - - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(DOGLCD_MOSI, state); - - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(DOGLCD_SCK, HIGH); - } - b <<= 1; - if (miso_pin >= 0 && READ(miso_pin)) b |= 1; - } - return b; -} - -static void u8g_sw_spi_HAL_STM32F1_shift_out(uint8_t val) { - #if ENABLED(FYSETC_MINI_12864) - swSpiTransfer_mode_3(val, SPI_speed); - #else - swSpiTransfer_mode_0(val, SPI_speed); - #endif -} - -static uint8_t swSpiInit(const uint8_t spi_speed) { - #if PIN_EXISTS(LCD_RESET) - SET_OUTPUT(LCD_RESET_PIN); - #endif - SET_OUTPUT(DOGLCD_A0); - OUT_WRITE(DOGLCD_SCK, LOW); - OUT_WRITE(DOGLCD_MOSI, LOW); - OUT_WRITE(DOGLCD_CS, HIGH); - return spi_speed; -} - -uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { - case U8G_COM_MSG_INIT: - SPI_speed = swSpiInit(SPI_SPEED); - break; - - case U8G_COM_MSG_STOP: - break; - - case U8G_COM_MSG_RESET: - #if PIN_EXISTS(LCD_RESET) - WRITE(LCD_RESET_PIN, arg_val); - #endif - break; - - case U8G_COM_MSG_CHIP_SELECT: - #if ENABLED(FYSETC_MINI_12864) // This LCD SPI is running mode 3 while SD card is running mode 0 - if (arg_val) { // SCK idle state needs to be set to the proper idle state before - // the next chip select goes active - WRITE(DOGLCD_SCK, HIGH); // Set SCK to mode 3 idle state before CS goes active - WRITE(DOGLCD_CS, LOW); - } - else { - WRITE(DOGLCD_CS, HIGH); - WRITE(DOGLCD_SCK, LOW); // Set SCK to mode 0 idle state after CS goes inactive - } - #else - WRITE(DOGLCD_CS, !arg_val); - #endif - break; - - case U8G_COM_MSG_WRITE_BYTE: - u8g_sw_spi_HAL_STM32F1_shift_out(arg_val); - break; - - case U8G_COM_MSG_WRITE_SEQ: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - u8g_sw_spi_HAL_STM32F1_shift_out(*ptr++); - arg_val--; - } - } break; - - case U8G_COM_MSG_WRITE_SEQ_P: { - uint8_t *ptr = (uint8_t *)arg_ptr; - while (arg_val > 0) { - u8g_sw_spi_HAL_STM32F1_shift_out(u8g_pgm_read(ptr)); - ptr++; - arg_val--; - } - } break; - - case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - WRITE(DOGLCD_A0, arg_val); - break; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD -#endif // STM32F1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h deleted file mode 100644 index d043b3b8db..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h +++ /dev/null @@ -1,89 +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 - -/** - * Endstop interrupts for Libmaple STM32F1 based targets. - * - * On STM32F, all pins support external interrupt capability. - * Any pin can be used for external interrupts, but there are some restrictions. - * At most 16 different external interrupts can be used at one time. - * Further, you can’t just pick any 16 pins to use. This is because every pin on the STM32 - * connects to what is called an EXTI line, and only one pin per EXTI line can be used for external interrupts at a time - * Check the Reference Manual of the MCU to confirm which line is used by each pin - */ - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #if HAS_X_MAX - attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it - #endif - #if HAS_X_MIN - attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MAX - attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MIN - attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MAX - attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN - attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MAX - attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MIN - attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MAX - attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MIN - attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/fastio.h deleted file mode 100644 index 3aafb9de39..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/fastio.h +++ /dev/null @@ -1,186 +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 STM32F1 - * These use GPIO functions instead of Direct Port Manipulation, as on AVR. - */ - -#include - -#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & (1U << PIN_MAP[IO].gpio_bit) ? HIGH : LOW) -#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16)) -#define TOGGLE(IO) (PIN_MAP[IO].gpio_device->regs->ODR = PIN_MAP[IO].gpio_device->regs->ODR ^ (1U << PIN_MAP[IO].gpio_bit)) - -#define _GET_MODE(IO) gpio_get_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit) -#define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M) -#define _SET_OUTPUT(IO) _SET_MODE(IO, GPIO_OUTPUT_PP) -#define _SET_OUTPUT_OD(IO) _SET_MODE(IO, GPIO_OUTPUT_OD) - -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) -#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0) - -#define SET_INPUT(IO) _SET_MODE(IO, GPIO_INPUT_FLOATING) -#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, GPIO_INPUT_PU) -#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, GPIO_INPUT_PD) -#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) -#define SET_PWM(IO) pinMode(IO, PWM) // do{ gpio_set_mode(PIN_MAP[pin].gpio_device, PIN_MAP[pin].gpio_bit, GPIO_AF_OUTPUT_PP); timer_set_mode(PIN_MAP[pin].timer_device, PIN_MAP[pin].timer_channel, TIMER_PWM); }while(0) -#define SET_PWM_OD(IO) pinMode(IO, PWM_OPEN_DRAIN) - -#define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD) -#define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP || _GET_MODE(IO) == GPIO_OUTPUT_OD) - -#define PWM_PIN(IO) (PIN_MAP[IO].timer_device != nullptr) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -// -// Pins Definitions -// -#define PA0 0x00 -#define PA1 0x01 -#define PA2 0x02 -#define PA3 0x03 -#define PA4 0x04 -#define PA5 0x05 -#define PA6 0x06 -#define PA7 0x07 -#define PA8 0x08 -#define PA9 0x09 -#define PA10 0x0A -#define PA11 0x0B -#define PA12 0x0C -#define PA13 0x0D -#define PA14 0x0E -#define PA15 0x0F - -#define PB0 0x10 -#define PB1 0x11 -#define PB2 0x12 -#define PB3 0x13 -#define PB4 0x14 -#define PB5 0x15 -#define PB6 0x16 -#define PB7 0x17 // 36 pins (F103T) -#define PB8 0x18 -#define PB9 0x19 -#define PB10 0x1A -#define PB11 0x1B -#define PB12 0x1C -#define PB13 0x1D -#define PB14 0x1E -#define PB15 0x1F - -#if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8) - #define PC13 0x20 - #define PC14 0x21 - #define PC15 0x22 -#else - #define PC0 0x20 - #define PC1 0x21 - #define PC2 0x22 - #define PC3 0x23 - #define PC4 0x24 - #define PC5 0x25 - #define PC6 0x26 - #define PC7 0x27 - #define PC8 0x28 - #define PC9 0x29 - #define PC10 0x2A - #define PC11 0x2B - #define PC12 0x2C - #define PC13 0x2D - #define PC14 0x2E - #define PC15 0x2F -#endif - -#define PD0 0x30 -#define PD1 0x31 -#define PD2 0x32 // 64 pins (F103R) -#define PD3 0x33 -#define PD4 0x34 -#define PD5 0x35 -#define PD6 0x36 -#define PD7 0x37 -#define PD8 0x38 -#define PD9 0x39 -#define PD10 0x3A -#define PD11 0x3B -#define PD12 0x3C -#define PD13 0x3D -#define PD14 0x3E -#define PD15 0x3F - -#define PE0 0x40 -#define PE1 0x41 -#define PE2 0x42 -#define PE3 0x43 -#define PE4 0x44 -#define PE5 0x45 -#define PE6 0x46 -#define PE7 0x47 -#define PE8 0x48 -#define PE9 0x49 -#define PE10 0x4A -#define PE11 0x4B -#define PE12 0x4C -#define PE13 0x4D -#define PE14 0x4E -#define PE15 0x4F // 100 pins (F103V) - -#define PF0 0x50 -#define PF1 0x51 -#define PF2 0x52 -#define PF3 0x53 -#define PF4 0x54 -#define PF5 0x55 -#define PF6 0x56 -#define PF7 0x57 -#define PF8 0x58 -#define PF9 0x59 -#define PF10 0x5A -#define PF11 0x5B -#define PF12 0x5C -#define PF13 0x5D -#define PF14 0x5E -#define PF15 0x5F - -#define PG0 0x60 -#define PG1 0x61 -#define PG2 0x62 -#define PG3 0x63 -#define PG4 0x64 -#define PG5 0x65 -#define PG6 0x66 -#define PG7 0x67 -#define PG8 0x68 -#define PG9 0x69 -#define PG10 0x6A -#define PG11 0x6B -#define PG12 0x6C -#define PG13 0x6D -#define PG14 0x6E -#define PG15 0x6F // 144 pins (F103Z) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h deleted file mode 100644 index 69466a0a77..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h +++ /dev/null @@ -1,43 +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 - -/** - * Test STM32F1-specific configuration values for errors at compile-time. - */ - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(SDIO_SUPPORT) && DISABLED(SDSUPPORT) - #error "SDIO_SUPPORT requires SDSUPPORT. Enable SDSUPPORT to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif - -#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x - #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER." - #error "Missing SoftwareSerial implementation." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf deleted file mode 100644 index c39f4ce0ed..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf +++ /dev/null @@ -1,56 +0,0 @@ -; -; 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp deleted file mode 100644 index 81e430fa2a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.h deleted file mode 100644 index 9f06ca5fdb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/msc_sd.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp deleted file mode 100644 index c5b4f34cd2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp +++ /dev/null @@ -1,556 +0,0 @@ -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h deleted file mode 100644 index ec73162ba1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h +++ /dev/null @@ -1,96 +0,0 @@ -/*----------------------------------------------------------------------- -/ * 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp deleted file mode 100644 index babcdeaee3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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 . - * - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && EITHER(SPI_EEPROM, I2C_EEPROM) - -#include "../shared/persistent_store_api.h" - -bool PersistentStore::access_start() { - #if ENABLED(SPI_EEPROM) - #if SPI_CHAN_EEPROM1 == 1 - SET_OUTPUT(BOARD_SPI1_SCK_PIN); - SET_OUTPUT(BOARD_SPI1_MOSI_PIN); - SET_INPUT(BOARD_SPI1_MISO_PIN); - SET_OUTPUT(SPI_EEPROM1_CS); - #endif - spiInit(0); - #endif - return true; -} -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing && value) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS && EITHER(SPI_EEPROM, I2C_EEPROM) -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp deleted file mode 100644 index 8097a28487..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ - -/** - * persistent_store_flash.cpp - * HAL for stm32duino and compatible (STM32F1) - * Implementation of EEPROM settings in SDCard - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -// This is for EEPROM emulation in flash -#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION) - -#include "../shared/persistent_store_api.h" - -#include -#include - -// Store settings in the last two pages -// Flash pages must be erased before writing, so keep track. -bool firstWrite = false; - -bool PersistentStore::access_start() { - firstWrite = true; - return true; -} - -bool PersistentStore::access_finish() { - FLASH_Lock(); - firstWrite = false; - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - FLASH_Status status; - - if (firstWrite) { - FLASH_Unlock(); - status = FLASH_ErasePage(EEPROM_PAGE0_BASE); - if (status != FLASH_COMPLETE) return true; - status = FLASH_ErasePage(EEPROM_PAGE1_BASE); - if (status != FLASH_COMPLETE) return true; - firstWrite = false; - } - - for (size_t i = 0; i < size; i++) { - if (FLASH_ProgramHalfWord(EEPROM_PAGE0_BASE + (pos + i) * 2, value[i]) != FLASH_COMPLETE) - return true; - } - - crc16(crc, value, size); - pos += size; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - for (size_t i = 0; i < size; i++) { - uint8_t v = *(uint16_t *)(EEPROM_PAGE0_BASE + (pos + i) * 2); - if (writing) value[i] = v; - crc16(crc, &v, 1); - } - pos += size; - return false; -} - -size_t PersistentStore::capacity() { return size_t(E2END + 1); } - -#endif // EEPROM_SETTINGS && EEPROM FLASH -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp deleted file mode 100644 index 38d5803f58..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp +++ /dev/null @@ -1,105 +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 . - * - */ - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - * Implementation of EEPROM settings in SD Card - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) - -#include "../shared/persistent_store_api.h" - -#ifndef E2END - #define E2END 0xFFF // 4KB -#endif -#define HAL_EEPROM_SIZE (E2END + 1) - -#define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat. -static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; - -#if ENABLED(SDSUPPORT) - - #include "../../sd/cardreader.h" - - #define EEPROM_FILENAME "eeprom.dat" - - bool PersistentStore::access_start() { - if (!card.isMounted()) return false; - - SdFile file, root = card.getroot(); - if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) - return true; // false aborts the save - - int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE); - if (bytes_read < 0) return false; - for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++) - HAL_eeprom_data[bytes_read] = 0xFF; - file.close(); - return true; - } - - bool PersistentStore::access_finish() { - if (!card.isMounted()) return false; - - SdFile file, root = card.getroot(); - int bytes_written = 0; - if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { - bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE); - file.close(); - } - return (bytes_written == HAL_EEPROM_SIZE); - } - -#else // !SDSUPPORT - - #error "Please define SPI_EEPROM (in Configuration.h) or disable EEPROM_SETTINGS." - -#endif // !SDSUPPORT - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - for (size_t i = 0; i < size; i++) - HAL_eeprom_data[pos + i] = value[i]; - crc16(crc, value, size); - pos += size; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - for (size_t i = 0; i < size; i++) { - uint8_t c = HAL_eeprom_data[pos + i]; - if (writing) value[i] = c; - crc16(crc, &c, 1); - } - pos += size; - return false; -} - -size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } - -#endif // EEPROM_SETTINGS - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h deleted file mode 100644 index a8b632870a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 - -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "../HAL_STM32/pinsDebug_STM32duino.h" -#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "../HAL_STM32/pinsDebug_STM32GENERIC.h" -#else - #error "M43 not supported for this board" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.cpp deleted file mode 100644 index c1cab57a9e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.cpp +++ /dev/null @@ -1,288 +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 . - * - */ - -#ifdef ARDUINO_ARCH_STM32F1 - -#include - -#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density - -#if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY) - -#include "sdio.h" - -SDIO_CardInfoTypeDef SdCard; - -bool SDIO_Init() { - uint32_t count = 0U; - SdCard.CardType = SdCard.CardVersion = SdCard.Class = SdCard.RelCardAdd = SdCard.BlockNbr = SdCard.BlockSize = SdCard.LogBlockNbr = SdCard.LogBlockSize = 0; - - sdio_begin(); - sdio_set_dbus_width(SDIO_CLKCR_WIDBUS_1BIT); - - dma_init(SDIO_DMA_DEV); - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - dma_set_priority(SDIO_DMA_DEV, SDIO_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); - - if (!SDIO_CmdGoIdleState()) return false; - if (!SDIO_CmdGoIdleState()) return false; /* Hotplugged cards tends to miss first CMD0, so give them a second chance. */ - - SdCard.CardVersion = SDIO_CmdOperCond() ? CARD_V2_X : CARD_V1_X; - - do { - if (count++ == SDMMC_MAX_VOLT_TRIAL) return false; - SDIO_CmdAppOperCommand(SdCard.CardVersion == CARD_V2_X ? SDMMC_HIGH_CAPACITY : SDMMC_STD_CAPACITY); - } while ((SDIO_GetResponse(SDIO_RESP1) & 0x80000000) == 0); - - SdCard.CardType = (SDIO_GetResponse(SDIO_RESP1) & SDMMC_HIGH_CAPACITY) ? CARD_SDHC_SDXC : CARD_SDSC; - - if (!SDIO_CmdSendCID()) return false; - if (!SDIO_CmdSetRelAdd(&SdCard.RelCardAdd)) return false; /* Send CMD3 SET_REL_ADDR with argument 0. SD Card publishes its RCA. */ - if (!SDIO_CmdSendCSD(SdCard.RelCardAdd << 16U)) return false; - - SdCard.Class = (SDIO_GetResponse(SDIO_RESP2) >> 20U); - - if (SdCard.CardType == CARD_SDHC_SDXC) { - SdCard.LogBlockNbr = SdCard.BlockNbr = (((SDIO_GetResponse(SDIO_RESP2) & 0x0000003FU) << 26U) | ((SDIO_GetResponse(SDIO_RESP3) & 0xFFFF0000U) >> 6U)) + 1024; - SdCard.LogBlockSize = SdCard.BlockSize = 512U; - } - else { - SdCard.BlockNbr = ((((SDIO_GetResponse(SDIO_RESP2) & 0x000003FFU) << 2U ) | ((SDIO_GetResponse(SDIO_RESP3) & 0xC0000000U) >> 30U)) + 1U) * (4U << ((SDIO_GetResponse(SDIO_RESP3) & 0x00038000U) >> 15U)); - SdCard.BlockSize = 1U << ((SDIO_GetResponse(SDIO_RESP2) >> 16) & 0x0FU); - SdCard.LogBlockNbr = (SdCard.BlockNbr) * ((SdCard.BlockSize) / 512U); - SdCard.LogBlockSize = 512U; - } - - if (!SDIO_CmdSelDesel(SdCard.RelCardAdd << 16U)) return false; - if (!SDIO_CmdAppSetClearCardDetect(SdCard.RelCardAdd << 16U)) return false; - if (!SDIO_CmdAppSetBusWidth(SdCard.RelCardAdd << 16U, 2)) return false; - - sdio_set_dbus_width(SDIO_CLKCR_WIDBUS_4BIT); - sdio_set_clock(SDIO_CLOCK); - return true; -} - -bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) { - if (SDIO_GetCardState() != SDIO_CARD_TRANSFER) return false; - if (blockAddress >= SdCard.LogBlockNbr) return false; - if ((0x03 & (uint32_t)data)) return false; // misaligned data - - if (SdCard.CardType != CARD_SDHC_SDXC) { blockAddress *= 512U; } - - dma_setup_transfer(SDIO_DMA_DEV, SDIO_DMA_CHANNEL, &SDIO->FIFO, DMA_SIZE_32BITS, data, DMA_SIZE_32BITS, DMA_MINC_MODE); - dma_set_num_transfers(SDIO_DMA_DEV, SDIO_DMA_CHANNEL, 128); - dma_clear_isr_bits(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - dma_enable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - - sdio_setup_transfer(SDIO_DATA_TIMEOUT * (F_CPU / 1000U), 512, SDIO_BLOCKSIZE_512 | SDIO_DCTRL_DMAEN | SDIO_DCTRL_DTEN | SDIO_DIR_RX); - - if (!SDIO_CmdReadSingleBlock(blockAddress)) { - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - return false; - } - - while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {} - - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - - if (SDIO->STA & SDIO_STA_RXDAVL) { - while (SDIO->STA & SDIO_STA_RXDAVL) (void)SDIO->FIFO; - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - return false; - } - - if (SDIO_GET_FLAG(SDIO_STA_TRX_ERROR_FLAGS)) { - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - return false; - } - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - return true; -} - -bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) { - uint32_t retries = 3; - while (retries--) if (SDIO_ReadBlock_DMA(blockAddress, data)) return true; - return false; -} - -uint32_t millis(); - -bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) { - if (SDIO_GetCardState() != SDIO_CARD_TRANSFER) return false; - if (blockAddress >= SdCard.LogBlockNbr) return false; - if ((0x03 & (uint32_t)data)) return false; // misaligned data - - if (SdCard.CardType != CARD_SDHC_SDXC) { blockAddress *= 512U; } - - dma_setup_transfer(SDIO_DMA_DEV, SDIO_DMA_CHANNEL, &SDIO->FIFO, DMA_SIZE_32BITS, (volatile void *) data, DMA_SIZE_32BITS, DMA_MINC_MODE | DMA_FROM_MEM); - dma_set_num_transfers(SDIO_DMA_DEV, SDIO_DMA_CHANNEL, 128); - dma_clear_isr_bits(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - dma_enable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - - if (!SDIO_CmdWriteSingleBlock(blockAddress)) { - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - return false; - } - - sdio_setup_transfer(SDIO_DATA_TIMEOUT * (F_CPU / 1000U), 512U, SDIO_BLOCKSIZE_512 | SDIO_DCTRL_DMAEN | SDIO_DCTRL_DTEN); - - while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {} - - dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); - - if (SDIO_GET_FLAG(SDIO_STA_TRX_ERROR_FLAGS)) { - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - return false; - } - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); - - uint32_t timeout = millis() + SDIO_WRITE_TIMEOUT; - while (timeout > millis()) { - if (SDIO_GetCardState() == SDIO_CARD_TRANSFER) { - return true; - } - } - return false; -} - -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() { return (uint8_t)(SDIO->RESPCMD); } -uint32_t SDIO_GetResponse(uint32_t response) { return SDIO->RESP[response]; } - -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() { 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); } -bool SDIO_CmdWriteSingleBlock(uint32_t address) { SDIO_SendCommand(CMD24_WRITE_SINGLE_BLOCK, address); return SDIO_GetCmdResp1(SDMMC_CMD_WRITE_SINGLE_BLOCK); } -bool SDIO_CmdAppCommand(uint32_t rsa) { SDIO_SendCommand(CMD55_APP_CMD, rsa); return SDIO_GetCmdResp1(SDMMC_CMD_APP_CMD); } - -bool SDIO_CmdAppSetBusWidth(uint32_t rsa, uint32_t argument) { - if (!SDIO_CmdAppCommand(rsa)) return false; - SDIO_SendCommand(ACMD6_APP_SD_SET_BUSWIDTH, argument); - return SDIO_GetCmdResp2(); -} - -bool SDIO_CmdAppOperCommand(uint32_t sdType) { - if (!SDIO_CmdAppCommand(0)) return false; - SDIO_SendCommand(ACMD41_SD_APP_OP_COND , SDMMC_VOLTAGE_WINDOW_SD | sdType); - return SDIO_GetCmdResp3(); -} - -bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa) { - if (!SDIO_CmdAppCommand(rsa)) return false; - SDIO_SendCommand(ACMD42_SD_APP_SET_CLR_CARD_DETECT, 0); - return SDIO_GetCmdResp2(); -} - -// Wait until given flags are unset or till timeout -#define SDIO_WAIT(FLAGS) do{ \ - uint32_t count = 1 + (SDIO_CMDTIMEOUT) * ((F_CPU) / 8U / 1000U); \ - do { if (!--count) return false; } while (!SDIO_GET_FLAG(FLAGS)); \ -}while(0) - -bool SDIO_GetCmdError() { - SDIO_WAIT(SDIO_STA_CMDSENT); - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - return true; -} - -bool SDIO_GetCmdResp1(uint8_t command) { - SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); - - if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) { - SDIO_CLEAR_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT); - return false; - } - if (SDIO_GetCommandResponse() != command) return false; - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - return (SDIO_GetResponse(SDIO_RESP1) & SDMMC_OCR_ERRORBITS) == SDMMC_ALLZERO; -} - -bool SDIO_GetCmdResp2() { - SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); - - if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) { - SDIO_CLEAR_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT); - return false; - } - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - return true; -} - -bool SDIO_GetCmdResp3() { - SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); - - if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { - SDIO_CLEAR_FLAG(SDIO_STA_CTIMEOUT); - return false; - } - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - return true; -} - -bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca) { - SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); - - if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) { - SDIO_CLEAR_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT); - return false; - } - if (SDIO_GetCommandResponse() != command) return false; - - SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); - if (SDIO_GetResponse(SDIO_RESP1) & (SDMMC_R6_GENERAL_UNKNOWN_ERROR | SDMMC_R6_ILLEGAL_CMD | SDMMC_R6_COM_CRC_FAILED)) return false; - - *rca = SDIO_GetResponse(SDIO_RESP1) >> 16; - return true; -} - -bool SDIO_GetCmdResp7() { - SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); - - if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { - SDIO_CLEAR_FLAG(SDIO_STA_CTIMEOUT); - return false; - } - - if (SDIO_GET_FLAG(SDIO_STA_CMDREND)) { SDIO_CLEAR_FLAG(SDIO_STA_CMDREND); } - return true; -} - -#endif // STM32_HIGH_DENSITY || STM32_XL_DENSITY -#endif // ARDUINO_ARCH_STM32F1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.h deleted file mode 100644 index ca0aced695..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/sdio.h +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -#include "../shared/Marduino.h" - -#include -#include - -// ------------------------ -// Defines -// ------------------------ - -#define SDMMC_CMD_GO_IDLE_STATE ((uint8_t)0) /* Resets the SD memory card. */ -#define SDMMC_CMD_ALL_SEND_CID ((uint8_t)2) /* Asks any card connected to the host to send the CID numbers on the CMD line. */ -#define SDMMC_CMD_SET_REL_ADDR ((uint8_t)3) /* Asks the card to publish a new relative address (RCA). */ -#define SDMMC_CMD_SEL_DESEL_CARD ((uint8_t)7) /* Selects the card by its own relative address and gets deselected by any other address */ -#define SDMMC_CMD_HS_SEND_EXT_CSD ((uint8_t)8) /* Sends SD Memory Card interface condition, which includes host supply voltage information and asks the card whether card supports voltage. */ -#define SDMMC_CMD_SEND_CSD ((uint8_t)9) /* Addressed card sends its card specific data (CSD) on the CMD line. */ -#define SDMMC_CMD_SEND_STATUS ((uint8_t)13) /*!< Addressed card sends its status register. */ -#define SDMMC_CMD_READ_SINGLE_BLOCK ((uint8_t)17) /* Reads single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of fixed 512 bytes in case of SDHC and SDXC. */ -#define SDMMC_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24) /* Writes single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of fixed 512 bytes in case of SDHC and SDXC. */ -#define SDMMC_CMD_APP_CMD ((uint8_t)55) /* Indicates to the card that the next command is an application specific command rather than a standard command. */ - -#define SDMMC_ACMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /* (ACMD6) Defines the data bus width to be used for data transfer. The allowed data bus widths are given in SCR register. */ -#define SDMMC_ACMD_SD_APP_OP_COND ((uint8_t)41) /* (ACMD41) Sends host capacity support information (HCS) and asks the accessed card to send its operating condition register (OCR) content in the response on the CMD line. */ -#define SDMMC_ACMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) /* (ACMD42) Connect/Disconnect the 50 KOhm pull-up resistor on CD/DAT3 (pin 1) of the card */ - -#define CMD0_GO_IDLE_STATE (uint16_t)(SDMMC_CMD_GO_IDLE_STATE | SDIO_CMD_WAIT_NO_RESP) -#define CMD2_ALL_SEND_CID (uint16_t)(SDMMC_CMD_ALL_SEND_CID | SDIO_CMD_WAIT_LONG_RESP) -#define CMD3_SET_REL_ADDR (uint16_t)(SDMMC_CMD_SET_REL_ADDR | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD7_SEL_DESEL_CARD (uint16_t)(SDMMC_CMD_SEL_DESEL_CARD | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD8_HS_SEND_EXT_CSD (uint16_t)(SDMMC_CMD_HS_SEND_EXT_CSD | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD9_SEND_CSD (uint16_t)(SDMMC_CMD_SEND_CSD | SDIO_CMD_WAIT_LONG_RESP) -#define CMD13_SEND_STATUS (uint16_t)(SDMMC_CMD_SEND_STATUS | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD17_READ_SINGLE_BLOCK (uint16_t)(SDMMC_CMD_READ_SINGLE_BLOCK | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD24_WRITE_SINGLE_BLOCK (uint16_t)(SDMMC_CMD_WRITE_SINGLE_BLOCK | SDIO_CMD_WAIT_SHORT_RESP) -#define CMD55_APP_CMD (uint16_t)(SDMMC_CMD_APP_CMD | SDIO_CMD_WAIT_SHORT_RESP) - -#define ACMD6_APP_SD_SET_BUSWIDTH (uint16_t)(SDMMC_ACMD_APP_SD_SET_BUSWIDTH | SDIO_CMD_WAIT_SHORT_RESP) -#define ACMD41_SD_APP_OP_COND (uint16_t)(SDMMC_ACMD_SD_APP_OP_COND | SDIO_CMD_WAIT_SHORT_RESP) -#define ACMD42_SD_APP_SET_CLR_CARD_DETECT (uint16_t)(SDMMC_ACMD_SD_APP_SET_CLR_CARD_DETECT | SDIO_CMD_WAIT_SHORT_RESP) - - -#define SDMMC_ALLZERO 0x00000000U -#define SDMMC_OCR_ERRORBITS 0xFDFFE008U - -#define SDMMC_R6_GENERAL_UNKNOWN_ERROR 0x00002000U -#define SDMMC_R6_ILLEGAL_CMD 0x00004000U -#define SDMMC_R6_COM_CRC_FAILED 0x00008000U - -#define SDMMC_VOLTAGE_WINDOW_SD 0x80100000U -#define SDMMC_HIGH_CAPACITY 0x40000000U -#define SDMMC_STD_CAPACITY 0x00000000U -#define SDMMC_CHECK_PATTERN 0x000001AAU - -#define SDIO_TRANSFER_MODE_BLOCK 0x00000000U -#define SDIO_DPSM_ENABLE 0x00000001U -#define SDIO_TRANSFER_DIR_TO_CARD 0x00000000U -#define SDIO_DATABLOCK_SIZE_512B 0x00000090U -#define SDIO_TRANSFER_DIR_TO_SDIO 0x00000100U -#define SDIO_DMA_ENABLE 0x00001000U - -#define CARD_V1_X 0x00000000U -#define CARD_V2_X 0x00000001U -#define CARD_SDSC 0x00000000U -#define CARD_SDHC_SDXC 0x00000001U - -#define SDIO_RESP1 0 -#define SDIO_RESP2 1 -#define SDIO_RESP3 2 -#define SDIO_RESP4 3 - -#define SDIO_GET_FLAG(__FLAG__) !!((SDIO->STA) & (__FLAG__)) -#define SDIO_CLEAR_FLAG(__FLAG__) (SDIO->ICR = (__FLAG__)) - -#define SDMMC_MAX_VOLT_TRIAL 0x00000FFFU -#define SDIO_CARD_TRANSFER 0x00000004U /* Card is in transfer state */ -#define SDIO_CARD_ERROR 0x000000FFU /* Card response Error */ -#define SDIO_CMDTIMEOUT 200U /* Command send and response timeout */ -#define SDIO_DATA_TIMEOUT 100U /* Read data transfer timeout */ -#define SDIO_WRITE_TIMEOUT 200U /* Write data transfer timeout */ - -#define SDIO_CLOCK 18000000 /* 18 MHz */ - -// ------------------------ -// Types -// ------------------------ - -typedef struct { - uint32_t CardType; // Card Type - uint32_t CardVersion; // Card version - uint32_t Class; // Class of the card class - uint32_t RelCardAdd; // Relative Card Address - uint32_t BlockNbr; // Card Capacity in blocks - uint32_t BlockSize; // One block size in bytes - uint32_t LogBlockNbr; // Card logical Capacity in blocks - uint32_t LogBlockSize; // Logical block size in bytes -} SDIO_CardInfoTypeDef; - -// ------------------------ -// Public functions -// ------------------------ - -inline uint32_t SDIO_GetCardState(); - -bool SDIO_CmdGoIdleState(); -bool SDIO_CmdSendCID(); -bool SDIO_CmdSetRelAdd(uint32_t *rca); -bool SDIO_CmdSelDesel(uint32_t address); -bool SDIO_CmdOperCond(); -bool SDIO_CmdSendCSD(uint32_t argument); -bool SDIO_CmdSendStatus(uint32_t argument); -bool SDIO_CmdReadSingleBlock(uint32_t address); -bool SDIO_CmdWriteSingleBlock(uint32_t address); -bool SDIO_CmdAppCommand(uint32_t rsa); - -bool SDIO_CmdAppSetBusWidth(uint32_t rsa, uint32_t argument); -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(); -uint32_t SDIO_GetResponse(uint32_t response); -bool SDIO_GetCmdError(); -bool SDIO_GetCmdResp1(uint8_t command); -bool SDIO_GetCmdResp2(); -bool SDIO_GetCmdResp3(); -bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca); -bool SDIO_GetCmdResp7(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/spi_pins.h deleted file mode 100644 index edea89cc7d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/spi_pins.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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 - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -/** - * STM32F1 Default SPI Pins - * - * SS SCK MISO MOSI - * +-----------------------------+ - * SPI1 | PA4 PA5 PA6 PA7 | - * SPI2 | PB12 PB13 PB14 PB15 | - * SPI3 | PA15 PB3 PB4 PB5 | - * +-----------------------------+ - * Any pin can be used for Chip Select (SS_PIN) - * SPI1 is enabled by default - */ -#ifndef SCK_PIN - #define SCK_PIN PA5 -#endif -#ifndef MISO_PIN - #define MISO_PIN PA6 -#endif -#ifndef MOSI_PIN - #define MOSI_PIN PA7 -#endif -#ifndef SS_PIN - #define SS_PIN PA4 -#endif -#undef SDSS -#define SDSS SS_PIN - -#if ENABLED(ENABLE_SPI3) - #define SPI_DEVICE 3 -#elif ENABLED(ENABLE_SPI2) - #define SPI_DEVICE 2 -#else - #define SPI_DEVICE 1 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.cpp deleted file mode 100644 index 051f0323c6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -// ------------------------ -// Public functions -// ------------------------ - -/** - * Timer_clock1: Prescaler 2 -> 36 MHz - * Timer_clock2: Prescaler 8 -> 9 MHz - * Timer_clock3: Prescaler 32 -> 2.25 MHz - * Timer_clock4: Prescaler 128 -> 562.5 kHz - */ - -/** - * TODO: Calculate Timer prescale value, so we get the 32bit to adjust - */ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - nvic_irq_num irq_num; - switch (timer_num) { - case 1: irq_num = NVIC_TIMER1_CC; break; - case 2: irq_num = NVIC_TIMER2; break; - case 3: irq_num = NVIC_TIMER3; break; - case 4: irq_num = NVIC_TIMER4; break; - case 5: irq_num = NVIC_TIMER5; break; - #ifdef STM32_HIGH_DENSITY - // 6 & 7 are basic timers, avoid them - case 8: irq_num = NVIC_TIMER8_CC; break; - #endif - default: - /** - * This should never happen. Add a Sanitycheck for timer number. - * Should be a general timer since basic timers have no CC channels. - */ - break; - } - - /** - * Give the Stepper ISR a higher priority (lower number) - * so it automatically preempts the Temperature ISR. - */ - - switch (timer_num) { - case STEP_TIMER_NUM: - timer_pause(STEP_TIMER_DEV); - timer_set_mode(STEP_TIMER_DEV, STEP_TIMER_CHAN, TIMER_OUTPUT_COMPARE); // counter - timer_set_count(STEP_TIMER_DEV, 0); - timer_set_prescaler(STEP_TIMER_DEV, (uint16_t)(STEPPER_TIMER_PRESCALE - 1)); - timer_set_reload(STEP_TIMER_DEV, 0xFFFF); - timer_oc_set_mode(STEP_TIMER_DEV, STEP_TIMER_CHAN, TIMER_OC_MODE_FROZEN, TIMER_OC_NO_PRELOAD); // no output pin change - timer_set_compare(STEP_TIMER_DEV, STEP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (STEPPER_TIMER_RATE) / frequency)); - timer_no_ARR_preload_ARPE(STEP_TIMER_DEV); // Need to be sure no preload on ARR register - timer_attach_interrupt(STEP_TIMER_DEV, STEP_TIMER_CHAN, stepTC_Handler); - nvic_irq_set_priority(irq_num, STEP_TIMER_IRQ_PRIO); - timer_generate_update(STEP_TIMER_DEV); - timer_resume(STEP_TIMER_DEV); - break; - case TEMP_TIMER_NUM: - timer_pause(TEMP_TIMER_DEV); - timer_set_mode(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, TIMER_OUTPUT_COMPARE); - timer_set_count(TEMP_TIMER_DEV, 0); - timer_set_prescaler(TEMP_TIMER_DEV, (uint16_t)(TEMP_TIMER_PRESCALE - 1)); - timer_set_reload(TEMP_TIMER_DEV, 0xFFFF); - timer_set_compare(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (F_CPU) / (TEMP_TIMER_PRESCALE) / frequency)); - timer_attach_interrupt(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, tempTC_Handler); - nvic_irq_set_priority(irq_num, TEMP_TIMER_IRQ_PRIO); - timer_generate_update(TEMP_TIMER_DEV); - timer_resume(TEMP_TIMER_DEV); - break; - } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: ENABLE_STEPPER_DRIVER_INTERRUPT(); break; - case TEMP_TIMER_NUM: ENABLE_TEMPERATURE_INTERRUPT(); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: DISABLE_STEPPER_DRIVER_INTERRUPT(); break; - case TEMP_TIMER_NUM: DISABLE_TEMPERATURE_INTERRUPT(); break; - } -} - -static inline bool timer_irq_enabled(const timer_dev * const dev, const uint8_t interrupt) { - return bool(*bb_perip(&(dev->regs).gen->DIER, interrupt)); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: return timer_irq_enabled(STEP_TIMER_DEV, STEP_TIMER_CHAN); - case TEMP_TIMER_NUM: return timer_irq_enabled(TEMP_TIMER_DEV, TEMP_TIMER_CHAN); - } - return false; -} - -timer_dev* get_timer_dev(int number) { - switch (number) { - #if STM32_HAVE_TIMER(1) - case 1: return &timer1; - #endif - #if STM32_HAVE_TIMER(2) - case 2: return &timer2; - #endif - #if STM32_HAVE_TIMER(3) - case 3: return &timer3; - #endif - #if STM32_HAVE_TIMER(4) - case 4: return &timer4; - #endif - #if STM32_HAVE_TIMER(5) - case 5: return &timer5; - #endif - #if STM32_HAVE_TIMER(6) - case 6: return &timer6; - #endif - #if STM32_HAVE_TIMER(7) - case 7: return &timer7; - #endif - #if STM32_HAVE_TIMER(8) - case 8: return &timer8; - #endif - #if STM32_HAVE_TIMER(9) - case 9: return &timer9; - #endif - #if STM32_HAVE_TIMER(10) - case 10: return &timer10; - #endif - #if STM32_HAVE_TIMER(11) - case 11: return &timer11; - #endif - #if STM32_HAVE_TIMER(12) - case 12: return &timer12; - #endif - #if STM32_HAVE_TIMER(13) - case 13: return &timer13; - #endif - #if STM32_HAVE_TIMER(14) - case 14: return &timer14; - #endif - default: return nullptr; - } -} - -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.h deleted file mode 100644 index d5d02a3dc6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/timers.h +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#include -#include -#include "../../core/boards.h" - -// ------------------------ -// Defines -// ------------------------ - -/** - * TODO: Check and confirm what timer we will use for each Temps and stepper driving. - * We should probable drive temps with PWM. - */ -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint16_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFF - -#define HAL_TIMER_RATE uint32_t(F_CPU) // frequency of timers peripherals - -#define STEP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts -#define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts - -/** - * Note: Timers may be used by platforms and libraries - * - * FAN PWMs: - * With FAN_SOFT_PWM disabled the Temperature class uses - * FANx_PIN timers to generate FAN PWM signals. - * - * Speaker: - * When SPEAKER is enabled, one timer is allocated by maple/tone.cpp. - * - If BEEPER_PIN has a timer channel (and USE_PIN_TIMER is - * defined in tone.cpp) it uses the pin's own timer. - * - Otherwise it uses Timer 8 on boards with STM32_HIGH_DENSITY - * or Timer 4 on other boards. - */ -#if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8) - #define STEP_TIMER_NUM 4 // For C8/CB boards, use timer 4 -#else - #define STEP_TIMER_NUM 5 // for other boards, five is fine. -#endif -#define TEMP_TIMER_NUM 2 // index of timer to use for temperature -//#define TEMP_TIMER_NUM 4 // 2->4, Timer 2 for Stepper Current PWM -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#if MB(BTT_SKR_MINI_E3_V1_0, BIGTREE_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE) - // SKR Mini E3 boards use PA8 as FAN_PIN, so TIMER 1 is used for Fan PWM. - #ifdef STM32_HIGH_DENSITY - #define SERVO0_TIMER_NUM 8 // tone.cpp uses Timer 4 - #else - #define SERVO0_TIMER_NUM 3 // tone.cpp uses Timer 8 - #endif -#else - #define SERVO0_TIMER_NUM 1 // SERVO0 or BLTOUCH -#endif - -#define STEP_TIMER_IRQ_PRIO 1 -#define TEMP_TIMER_IRQ_PRIO 2 - -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_PRESCALE 18 // prescaler for setting stepper timer, 4Mhz -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -timer_dev* get_timer_dev(int number); -#define TIMER_DEV(num) get_timer_dev(num) -#define STEP_TIMER_DEV TIMER_DEV(STEP_TIMER_NUM) -#define TEMP_TIMER_DEV TIMER_DEV(TEMP_TIMER_NUM) - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() timer_enable_irq(STEP_TIMER_DEV, STEP_TIMER_CHAN) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() timer_disable_irq(STEP_TIMER_DEV, STEP_TIMER_CHAN) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() timer_enable_irq(TEMP_TIMER_DEV, TEMP_TIMER_CHAN) -#define DISABLE_TEMPERATURE_INTERRUPT() timer_disable_irq(TEMP_TIMER_DEV, TEMP_TIMER_CHAN) - -#define HAL_timer_get_count(timer_num) timer_get_count(TIMER_DEV(timer_num)) - -// TODO change this - -#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(); -extern "C" void stepTC_Handler(); - -// ------------------------ -// Public Variables -// ------------------------ - -//static HardwareTimer StepperTimer(STEP_TIMER_NUM); -//static HardwareTimer TempTimer(TEMP_TIMER_NUM); - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -/** - * NOTE: By default libmaple sets ARPE = 1, which means the Auto reload register is preloaded (will only update with an update event) - * Thus we have to pause the timer, update the value, refresh, resume the timer. - * That seems like a big waste of time and may be better to change the timer config to ARPE = 0, so ARR can be updated any time. - * We are using a Channel in each timer in Capture/Compare mode. We could also instead use the Time Update Event Interrupt, but need to disable ARPE - * so we can change the ARR value on the fly (without calling refresh), and not get an interrupt right there because we caused an UEV. - * This mode pretty much makes 2 timers unusable for PWM since they have their counts updated all the time on ISRs. - * The way Marlin manages timer interrupts doesn't make for an efficient usage in STM32F1 - * Todo: Look at that possibility later. - */ - -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { - switch (timer_num) { - case STEP_TIMER_NUM: - // NOTE: WE have set ARPE = 0, which means the Auto reload register is not preloaded - // and there is no need to use any compare, as in the timer mode used, setting ARR to the compare value - // will result in exactly the same effect, ie trigerring an interrupt, and on top, set counter to 0 - timer_set_reload(STEP_TIMER_DEV, compare); // We reload direct ARR as needed during counting up - break; - case TEMP_TIMER_NUM: - timer_set_compare(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, compare); - break; - } -} - -FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: - // No counter to clear - timer_generate_update(STEP_TIMER_DEV); - return; - case TEMP_TIMER_NUM: - timer_set_count(TEMP_TIMER_DEV, 0); - timer_generate_update(TEMP_TIMER_DEV); - return; - } -} - -#define HAL_timer_isr_epilogue(TIMER_NUM) - -// No command is available in framework to turn off ARPE bit, which is turned on by default in libmaple. -// Needed here to reset ARPE=0 for stepper timer -FORCE_INLINE static void timer_no_ARR_preload_ARPE(timer_dev *dev) { - bb_peri_set_bit(&(dev->regs).gen->CR1, TIMER_CR1_ARPE_BIT, 0); -} - -#define TIMER_OC_NO_PRELOAD 0 // Need to disable preload also on compare registers. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp deleted file mode 100644 index 17f5aa9725..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp +++ /dev/null @@ -1,59 +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 . - * - */ - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include -#include "watchdog.h" - -void HAL_watchdog_refresh() { - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - iwdg_feed(); -} - -void watchdogSetup() { - // do whatever. don't remove this function. -} - -/** - * @brief Initialized the independent hardware watchdog. - * - * @return No return - * - * @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() { - //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); -} - -#endif // USE_WATCHDOG -#endif // __STM32F1__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.h deleted file mode 100644 index 21f97dd7a1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32F1/watchdog.h +++ /dev/null @@ -1,44 +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 - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#include - -/** - * The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and - * 625 reload value (counts down to 0) - * use 1250 for 8 seconds - */ -#define STM32F1_WD_RELOAD 625 - -// Arduino STM32F1 core now has watchdog support - -// Initialize watchdog with a 4 second countdown time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or STM32F1 will reset. -void HAL_watchdog_refresh(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp deleted file mode 100644 index 5e6ae09bf1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 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 . - * - */ - -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -/** - * Description: Functions for a Flash emulated EEPROM - * Not platform dependent. - */ - -// Include configs and pins to get all EEPROM flags -#include "../../inc/MarlinConfig.h" - -#ifdef STM32F7 - #define HAS_EMULATED_EEPROM 1 -#else - #define HAS_EMULATED_EEPROM NONE(I2C_EEPROM, SPI_EEPROM) -#endif - -#if HAS_EMULATED_EEPROM && ENABLED(EEPROM_SETTINGS) - -// ------------------------ -// Includes -// ------------------------ - -#include "HAL.h" -#include "eeprom_emul.h" - -// ------------------------ -// Local defines -// ------------------------ - -// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to -// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4/7 - -#ifdef STM32F7 - #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR -#else - //#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR -#endif - -// ------------------------ -// Private Variables -// ------------------------ - -static bool eeprom_initialized = false; - -// ------------------------ -// Public functions -// ------------------------ - -void eeprom_init() { - if (!eeprom_initialized) { - HAL_FLASH_Unlock(); - - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - /* EEPROM Init */ - if (EE_Initialize() != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); - eeprom_initialized = true; - } -} - -void eeprom_write_byte(uint8_t *pos, unsigned char value) { - eeprom_init(); - - HAL_FLASH_Unlock(); - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - uint16_t eeprom_address = unsigned(pos); - if (EE_WriteVariable(eeprom_address, uint16_t(value)) != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); -} - -uint8_t eeprom_read_byte(uint8_t *pos) { - eeprom_init(); - - uint16_t data = 0xFF; - uint16_t eeprom_address = unsigned(pos); - (void)EE_ReadVariable(eeprom_address, &data); // Data unchanged on error - - return uint8_t(data); -} - -void eeprom_read_block(void *__dst, const void *__src, size_t __n) { - eeprom_init(); - - uint16_t data = 0xFF; - uint16_t eeprom_address = unsigned(__src); - for (uint8_t c = 0; c < __n; c++) { - EE_ReadVariable(eeprom_address+c, &data); - *((uint8_t*)__dst + c) = data; - } -} - -void eeprom_update_block(const void *__src, void *__dst, size_t __n) { - -} - -#endif // EEPROM_SETTINGS -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp deleted file mode 100644 index e24483f642..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 . - * - */ - -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "HAL.h" - -//#include - -// ------------------------ -// Public Variables -// ------------------------ - -uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -/* VGPV Done with defines -// disable interrupts -void cli() { noInterrupts(); } - -// enable interrupts -void sei() { interrupts(); } -*/ - -void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } - -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; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON; - return 0; -} - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// return free memory between end of heap (or end bss) and whatever is current - -/* -#include -//extern caddr_t _sbrk(int incr); -#ifndef CONFIG_HEAP_END -extern char _lm_heap_end; -#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) -#endif - -extern "C" { - static int freeMemory() { - char top = 't'; - return &top - reinterpret_cast(sbrk(0)); - } - int freeMemory() { - int free_memory; - int heap_end = (int)_sbrk(0); - free_memory = ((int)&free_memory) - ((int)heap_end); - return free_memory; - } -} -*/ - -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } - -uint16_t HAL_adc_get_result() { return HAL_adc_result; } - -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h deleted file mode 100644 index 0e44df4d11..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * 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 - -#define CPU_32_BIT - -#include "../../inc/MarlinConfigPre.h" - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "timers.h" -#include "watchdog.h" - -#include - -#if defined(STM32F4) && USBCON - #include -#endif - -// ------------------------ -// Defines -// ------------------------ - -//Serial override -//extern HalSerial usb_serial; - -#if defined(STM32F4) && SERIAL_PORT == 0 - #error "Serial port 0 does not exist" -#endif - -#if !WITHIN(SERIAL_PORT, -1, 6) - #error "SERIAL_PORT must be from -1 to 6" -#endif -#if SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif SERIAL_PORT == 1 - #define MYSERIAL0 SerialUART1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 SerialUART2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 SerialUART3 -#elif SERIAL_PORT == 4 - #define MYSERIAL0 SerialUART4 -#elif SERIAL_PORT == 5 - #define MYSERIAL0 SerialUART5 -#elif SERIAL_PORT == 6 - #define MYSERIAL0 SerialUART6 -#endif - -#ifdef SERIAL_PORT_2 - #if defined(STM32F4) && SERIAL_PORT_2 == 0 - #error "Serial port 0 does not exist" - #endif - #if !WITHIN(SERIAL_PORT_2, -1, 6) - #error "SERIAL_PORT_2 must be from -1 to 6" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 SerialUSB - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 SerialUART1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 SerialUART2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 SerialUART3 - #elif SERIAL_PORT_2 == 4 - #define MYSERIAL1 SerialUART4 - #elif SERIAL_PORT_2 == 5 - #define MYSERIAL1 SerialUART5 - #elif SERIAL_PORT_2 == 6 - #define MYSERIAL1 SerialUART6 - #endif -#else - #define NUM_SERIAL 1 -#endif - -/** - * TODO: review this to return 1 for pins that are not analog input - */ -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) (p) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() -#define cli() __disable_irq() -#define sei() __enable_irq() - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -// ------------------------ -// Types -// ------------------------ - -typedef int8_t pin_t; - -#ifdef STM32F4 - #define HAL_SERVO_LIB libServo -#endif - -// ------------------------ -// Public Variables -// ------------------------ - -// Result of last ADC conversion -extern uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// Memory related -#define __bss_end __bss_end__ - -inline void HAL_init() {} - -// Clear reset reason -void HAL_clear_reset_source(); - -// Reset reason -uint8_t HAL_get_reset_source(); - -void _delay_ms(const int delay); - -/* -extern "C" { - int freeMemory(); -} -*/ - -extern "C" char* _sbrk(int incr); - -/* -int freeMemory() { - volatile int top; - top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); - return top; -} -*/ - -#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 - -// -// EEPROM -// - -/** - * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort. - * Wire library should work for i2c EEPROMs. - */ -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *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); - -// -// ADC -// - -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) - -inline void HAL_adc_init() {} - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#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(); - -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -#ifdef STM32F4 - #define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) - #define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp deleted file mode 100644 index 2f85182e20..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp +++ /dev/null @@ -1,165 +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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * Adapted to the Marlin STM32F4/7 HAL - */ - -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#include -#include -#include "../shared/HAL_SPI.h" -#include "spi_pins.h" - -// ------------------------ -// Public Variables -// ------------------------ - -static SPISettings spiConfig; - -// ------------------------ -// Public functions -// ------------------------ - -#if ENABLED(SOFTWARE_SPI) - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for STM32F4/7. Use Hardware SPI." -#else - -// ------------------------ -// Hardware SPI -// ------------------------ - -/** - * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz - */ - -/** - * @brief Begin SPI port setup - * - * @return Nothing - * - * @details Only configures SS pin since libmaple creates and initialize the SPI object - */ -void spiBegin() { - #if !defined(SS_PIN) || SS_PIN < 0 - #error SS_PIN not defined! - #endif - - OUT_WRITE(SS_PIN, HIGH); -} - -/** Configure SPI for specified SPI speed */ -void spiInit(uint8_t spiRate) { - // Use datarates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 300000; break; - default: clock = 4000000; // Default from the SPI libarary - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -/** - * @brief Receives a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; -} - -/** - * @brief Receives a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - * - * @details Uses DMA - */ -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - #ifdef STM32GENERIC - SPI.dmaTransfer(0, const_cast(buf), nbyte); - #else - SPI.transfer((uint8_t*)buf, nbyte); - #endif - SPI.endTransaction(); -} - -/** - * @brief Sends a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); -} - -/** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Use DMA - */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPI.transfer(token); - #ifdef STM32GENERIC - SPI.dmaSend(const_cast(buf), 512); - #else - SPI.transfer((uint8_t*)buf, nullptr, 512); - #endif - SPI.endTransaction(); -} - -#endif // SOFTWARE_SPI -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/README.md deleted file mode 100644 index 3b5a9ab02e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# This HAL is for... - - - STM32F407 MCU with STM32Generic Arduino core by danieleff. - - STM32F765 board "The Borg" with STM32Generic. - -See the `README.md` files in HAL_STM32F4 and HAL_STM32F7 for the specifics of those hals. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md deleted file mode 100644 index 10396e875b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# This HAL is for the STM32F407 MCU used with STM32Generic Arduino core by danieleff. - -# Arduino core is located at: - -https://github.com/danieleff/STM32GENERIC - -Unzip it into [Arduino]/hardware folder - -# This HAL is in development. - -This HAL is a modified version of Chris Barr's Picoprint STM32F4 HAL. - diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp deleted file mode 100644 index 32219962ee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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(STM32GENERIC) && defined(STM32F4) - -#include "../HAL.h" -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 2 -#define STEP_TIMER_IRQ_ID TIM5_IRQn -#define TEMP_TIMER_IRQ_ID TIM7_IRQn - -// ------------------------ -// Private Variables -// ------------------------ - -stm32_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; - -// ------------------------ -// Public functions -// ------------------------ - -bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - constexpr uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1, - temp_prescaler = TEMP_TIMER_PRESCALE - 1; - switch (timer_num) { - case STEP_TIMER_NUM: - // STEPPER TIMER TIM5 - use a 32bit timer - __HAL_RCC_TIM5_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM5; - TimerHandle[timer_num].handle.Init.Prescaler = step_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC5_Handler; - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 1, 0); - break; - - case TEMP_TIMER_NUM: - // TEMP TIMER TIM7 - any available 16bit Timer (1 already used for PWM) - __HAL_RCC_TIM7_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM7; - TimerHandle[timer_num].handle.Init.Prescaler = temp_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC7_Handler; - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_ID, 2, 0); - break; - } - timers_initialized[timer_num] = true; - } - - TimerHandle[timer_num].handle.Init.Period = (((HAL_TIMER_RATE) / TimerHandle[timer_num].handle.Init.Prescaler) / frequency) - 1; - if (HAL_TIM_Base_Init(&TimerHandle[timer_num].handle) == HAL_OK) - HAL_TIM_Base_Start_IT(&TimerHandle[timer_num].handle); -} - -extern "C" void TIM5_IRQHandler() { - ((void(*)())TimerHandle[0].callback)(); -} -extern "C" void TIM7_IRQHandler() { - ((void(*)())TimerHandle[1].callback)(); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_EnableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_EnableIRQ(TEMP_TIMER_IRQ_ID); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_DisableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_DisableIRQ(TEMP_TIMER_IRQ_ID); break; - } - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)STEP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)STEP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - case TEMP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - } - return false; -} - -#endif // STM32GENERIC && STM32F4 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h deleted file mode 100644 index 726207fbcf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -#define hal_timer_t uint32_t // TODO: One is 16-bit, one 32-bit - does this need to be checked? -#define HAL_TIMER_TYPE_MAX 0xFFFF - -#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals - -#define STEP_TIMER_NUM 0 // index of timer to use for stepper -#define TEMP_TIMER_NUM 1 // index of timer to use for temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_PRESCALE 54 // was 40,prescaler for setting stepper timer, 2Mhz -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -// TODO change this - -#ifdef STM32GENERIC - extern void TC5_Handler(); - extern void TC7_Handler(); - #define HAL_STEP_TIMER_ISR() void TC5_Handler() - #define HAL_TEMP_TIMER_ISR() void TC7_Handler() -#else - extern void TC5_Handler(stimer_t *htim); - extern void TC7_Handler(stimer_t *htim); - #define HAL_STEP_TIMER_ISR() void TC5_Handler(stimer_t *htim) - #define HAL_TEMP_TIMER_ISR() void TC7_Handler(stimer_t *htim) -#endif - - -// ------------------------ -// Types -// ------------------------ - -#ifdef STM32GENERIC - typedef struct { - TIM_HandleTypeDef handle; - uint32_t callback; - } tTimerConfig; - typedef tTimerConfig stm32_timer_t; -#else - typedef stimer_t stm32_timer_t; -#endif - -// ------------------------ -// Public Variables -// ------------------------ - -extern stm32_timer_t TimerHandle[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -FORCE_INLINE static uint32_t HAL_timer_get_count(const uint8_t timer_num) { - return __HAL_TIM_GET_COUNTER(&TimerHandle[timer_num].handle); -} - -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { - __HAL_TIM_SET_AUTORELOAD(&TimerHandle[timer_num].handle, compare); - if (HAL_timer_get_count(timer_num) >= compare) - TimerHandle[timer_num].handle.Instance->EGR |= TIM_EGR_UG; // Generate an immediate update interrupt -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return __HAL_TIM_GET_AUTORELOAD(&TimerHandle[timer_num].handle); -} - -#ifdef STM32GENERIC - FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - if (__HAL_TIM_GET_FLAG(&TimerHandle[timer_num].handle, TIM_FLAG_UPDATE) == SET) - __HAL_TIM_CLEAR_FLAG(&TimerHandle[timer_num].handle, TIM_FLAG_UPDATE); - } -#else - #define HAL_timer_isr_prologue(TIMER_NUM) -#endif - -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md deleted file mode 100644 index 23155b425e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# This HAL is for the STM32F765 board "The Borg" used with STM32Generic Arduino core by danieleff. - -# Original core is located at: - -https://github.com/danieleff/STM32GENERIC - -but I haven't committed the changes needed for the Borg there yet, so please use: - -https://github.com/Spawn32/STM32GENERIC - -Unzip it into [Arduino]/hardware folder - - -Download the latest GNU ARM Embedded Toolchain: - -https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads - -(The one in Arduino doesn't support STM32F7). - -Change compiler.path in platform.txt to point to the one you downloaded. - -# This HAL is in development. -# Currently only tested on "The Borg". - -You will also need the latest Arduino 1.9.0-beta or newer. - -This HAL is a modified version of Chris Barr's Picoprint STM32F4 HAL, so shouldn't be to hard to get it to work on a F4. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp deleted file mode 100644 index 3117321ac7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp +++ /dev/null @@ -1,900 +0,0 @@ -/** - * TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino - * - * based on the stepper library by Tom Igoe, et. al. - * - * Copyright (c) 2011, Interactive Matter, Marcus Nowotny - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#if defined(STM32GENERIC) && defined(STM32F7) - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_DRIVER(TMC2660) - -#include -#include -#include "TMC2660.h" - -#include "../../../inc/MarlinConfig.h" -#include "../../../Marlin.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/printcounter.h" -#include "../../../libs/duration_t.h" -#include "../../../libs/hex_print_routines.h" - -//some default values used in initialization -#define DEFAULT_MICROSTEPPING_VALUE 32 - -//TMC26X register definitions -#define DRIVER_CONTROL_REGISTER 0x0ul -#define CHOPPER_CONFIG_REGISTER 0x80000ul -#define COOL_STEP_REGISTER 0xA0000ul -#define STALL_GUARD2_LOAD_MEASURE_REGISTER 0xC0000ul -#define DRIVER_CONFIG_REGISTER 0xE0000ul - -#define REGISTER_BIT_PATTERN 0xFFFFFul - -//definitions for the driver control register -#define MICROSTEPPING_PATTERN 0xFul -#define STEP_INTERPOLATION 0x200ul -#define DOUBLE_EDGE_STEP 0x100ul -#define VSENSE 0x40ul -#define READ_MICROSTEP_POSTION 0x0ul -#define READ_STALL_GUARD_READING 0x10ul -#define READ_STALL_GUARD_AND_COOL_STEP 0x20ul -#define READ_SELECTION_PATTERN 0x30ul - -//definitions for the chopper config register -#define CHOPPER_MODE_STANDARD 0x0ul -#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000ul -#define T_OFF_PATTERN 0xFul -#define RANDOM_TOFF_TIME 0x2000ul -#define BLANK_TIMING_PATTERN 0x18000ul -#define BLANK_TIMING_SHIFT 15 -#define HYSTERESIS_DECREMENT_PATTERN 0x1800ul -#define HYSTERESIS_DECREMENT_SHIFT 11 -#define HYSTERESIS_LOW_VALUE_PATTERN 0x780ul -#define HYSTERESIS_LOW_SHIFT 7 -#define HYSTERESIS_START_VALUE_PATTERN 0x78ul -#define HYSTERESIS_START_VALUE_SHIFT 4 -#define T_OFF_TIMING_PATERN 0xFul - -//definitions for cool step register -#define MINIMUM_CURRENT_FOURTH 0x8000ul -#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000ul -#define SE_MAX_PATTERN 0xF00ul -#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60ul -#define SE_MIN_PATTERN 0xFul - -//definitions for StallGuard2 current register -#define STALL_GUARD_FILTER_ENABLED 0x10000ul -#define STALL_GUARD_TRESHHOLD_VALUE_PATTERN 0x17F00ul -#define CURRENT_SCALING_PATTERN 0x1Ful -#define STALL_GUARD_CONFIG_PATTERN 0x17F00ul -#define STALL_GUARD_VALUE_PATTERN 0x7F00ul - -//definitions for the input from the TMC2660 -#define STATUS_STALL_GUARD_STATUS 0x1ul -#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2ul -#define STATUS_OVER_TEMPERATURE_WARNING 0x4ul -#define STATUS_SHORT_TO_GROUND_A 0x8ul -#define STATUS_SHORT_TO_GROUND_B 0x10ul -#define STATUS_OPEN_LOAD_A 0x20ul -#define STATUS_OPEN_LOAD_B 0x40ul -#define STATUS_STAND_STILL 0x80ul -#define READOUT_VALUE_PATTERN 0xFFC00ul - -#define CPU_32_BIT - -//default values -#define INITIAL_MICROSTEPPING 0x3ul //32th microstepping - -SPIClass SPI_6(SPI6, SPI6_MOSI_PIN, SPI6_MISO_PIN, SPI6_SCK_PIN); - -#define STEPPER_SPI SPI_6 - -//debuging output - -//#define TMC_DEBUG1 - -uint8_t current_scaling = 0; - -/** - * Constructor - * number_of_steps - the steps per rotation - * cs_pin - the SPI client select pin - * dir_pin - the pin where the direction pin is connected - * step_pin - the pin where the step pin is connected - */ -TMC26XStepper::TMC26XStepper(const int16_t in_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t current, uint16_t resistor) { - // We are not started yet - started = false; - - // By default cool step is not enabled - cool_step_enabled = false; - - // Save the pins for later use - this->cs_pin = cs_pin; - this->dir_pin = dir_pin; - this->step_pin = step_pin; - - // Store the current sense resistor value for later use - this->resistor = resistor; - - // Initizalize our status values - this->steps_left = 0; - this->direction = 0; - - // Initialize register values - driver_control_register_value = DRIVER_CONTROL_REGISTER | INITIAL_MICROSTEPPING; - chopper_config_register = CHOPPER_CONFIG_REGISTER; - - // Setting the default register values - driver_control_register_value = DRIVER_CONTROL_REGISTER|INITIAL_MICROSTEPPING; - microsteps = _BV(INITIAL_MICROSTEPPING); - chopper_config_register = CHOPPER_CONFIG_REGISTER; - cool_step_register_value = COOL_STEP_REGISTER; - stallguard2_current_register_value = STALL_GUARD2_LOAD_MEASURE_REGISTER; - driver_configuration_register_value = DRIVER_CONFIG_REGISTER | READ_STALL_GUARD_READING; - - // Set the current - setCurrent(current); - // Set to a conservative start value - setConstantOffTimeChopper(7, 54, 13,12,1); - // Set a nice microstepping value - setMicrosteps(DEFAULT_MICROSTEPPING_VALUE); - // Save the number of steps - number_of_steps = in_steps; -} - - -/** - * start & configure the stepper driver - * just must be called. - */ -void TMC26XStepper::start() { - - #ifdef TMC_DEBUG1 - SERIAL_ECHOLNPGM("\n TMC26X stepper library"); - SERIAL_ECHOPAIR("\n CS pin: ", cs_pin); - SERIAL_ECHOPAIR("\n DIR pin: ", dir_pin); - SERIAL_ECHOPAIR("\n STEP pin: ", step_pin); - SERIAL_PRINTF("\n current scaling: %d", current_scaling); - SERIAL_PRINTF("\n Resistor: %d", resistor); - //SERIAL_PRINTF("\n current: %d", current); - SERIAL_ECHOPAIR("\n Microstepping: ", microsteps); - #endif - - //set the pins as output & its initial value - pinMode(step_pin, OUTPUT); - pinMode(dir_pin, OUTPUT); - pinMode(cs_pin, OUTPUT); - extDigitalWrite(step_pin, LOW); - extDigitalWrite(dir_pin, LOW); - extDigitalWrite(cs_pin, HIGH); - - STEPPER_SPI.begin(); - STEPPER_SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE3)); - - //set the initial values - send262(driver_control_register_value); - send262(chopper_config_register); - send262(cool_step_register_value); - send262(stallguard2_current_register_value); - send262(driver_configuration_register_value); - - //save that we are in running mode - started = true; -} - -/** - * Mark the driver as unstarted to be able to start it again - */ -void TMC26XStepper::un_start() { started = false; } - - -/** - * Sets the speed in revs per minute - */ -void TMC26XStepper::setSpeed(uint16_t whatSpeed) { - this->speed = whatSpeed; - this->step_delay = 60UL * sq(1000UL) / ((uint32_t)this->number_of_steps * (uint32_t)whatSpeed * (uint32_t)this->microsteps); - #ifdef TMC_DEBUG0 // crashes - SERIAL_ECHOPAIR("\nStep delay in micros: ", this->step_delay); - #endif - // Update the next step time - this->next_step_time = this->last_step_time + this->step_delay; -} - -uint16_t TMC26XStepper::getSpeed() { return this->speed; } - -/** - * Moves the motor steps_to_move steps. - * Negative indicates the reverse direction. - */ -char TMC26XStepper::step(int16_t steps_to_move) { - if (this->steps_left == 0) { - this->steps_left = ABS(steps_to_move); // how many steps to take - - // determine direction based on whether steps_to_move is + or -: - if (steps_to_move > 0) - this->direction = 1; - else if (steps_to_move < 0) - this->direction = 0; - return 0; - } - return -1; -} - -char TMC26XStepper::move() { - // decrement the number of steps, moving one step each time: - if (this->steps_left > 0) { - uint32_t time = micros(); - // move only if the appropriate delay has passed: - - // rem if (time >= this->next_step_time) { - - if (ABS(time - this->last_step_time) > this->step_delay) { - // increment or decrement the step number, - // depending on direction: - if (this->direction == 1) - extDigitalWrite(step_pin, HIGH); - else { - extDigitalWrite(dir_pin, HIGH); - extDigitalWrite(step_pin, HIGH); - } - // get the timeStamp of when you stepped: - this->last_step_time = time; - this->next_step_time = time + this->step_delay; - // decrement the steps left: - steps_left--; - //disable the step & dir pins - extDigitalWrite(step_pin, LOW); - extDigitalWrite(dir_pin, LOW); - } - return -1; - } - return 0; -} - -char TMC26XStepper::isMoving() { return this->steps_left > 0; } - -uint16_t TMC26XStepper::getStepsLeft() { return this->steps_left; } - -char TMC26XStepper::stop() { - //note to self if the motor is currently moving - char state = isMoving(); - //stop the motor - this->steps_left = 0; - this->direction = 0; - //return if it was moving - return state; -} - -void TMC26XStepper::setCurrent(uint16_t current) { - uint8_t current_scaling = 0; - //calculate the current scaling from the max current setting (in mA) - float mASetting = (float)current, - resistor_value = (float)this->resistor; - // remove vsense flag - this->driver_configuration_register_value &= ~(VSENSE); - // Derived from I = (cs + 1) / 32 * (Vsense / Rsense) - // leading to cs = 32 * R * I / V (with V = 0,31V oder 0,165V and I = 1000 * current) - // with Rsense = 0,15 - // for vsense = 0,310V (VSENSE not set) - // or vsense = 0,165V (VSENSE set) - current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.31 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5 - - // Check if the current scalingis too low - if (current_scaling < 16) { - // Set the csense bit to get a use half the sense voltage (to support lower motor currents) - this->driver_configuration_register_value |= VSENSE; - // and recalculate the current setting - 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); - #endif - } - #ifdef TMC_DEBUG0 // crashes - else - SERIAL_ECHOPAIR("\nCS: ", current_scaling); - #endif - - // do some sanity checks - NOMORE(current_scaling, 31); - - // delete the old value - stallguard2_current_register_value &= ~(CURRENT_SCALING_PATTERN); - // set the new current scaling - stallguard2_current_register_value |= current_scaling; - // if started we directly send it to the motor - if (started) { - send262(driver_configuration_register_value); - send262(stallguard2_current_register_value); - } -} - -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), - resistor_value = (float)this->resistor, - voltage = (driver_configuration_register_value & VSENSE) ? 0.165 : 0.31; - result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); - return (uint16_t)result; -} - -void TMC26XStepper::setStallGuardThreshold(char stallguard_threshold, char stallguard_filter_enabled) { - // We just have 5 bits - LIMIT(stallguard_threshold, -64, 63); - - // Add trim down to 7 bits - stallguard_threshold &= 0x7F; - // Delete old StallGuard settings - stallguard2_current_register_value &= ~(STALL_GUARD_CONFIG_PATTERN); - if (stallguard_filter_enabled) - stallguard2_current_register_value |= STALL_GUARD_FILTER_ENABLED; - - // Set the new StallGuard threshold - stallguard2_current_register_value |= (((uint32_t)stallguard_threshold << 8) & STALL_GUARD_CONFIG_PATTERN); - // If started we directly send it to the motor - if (started) send262(stallguard2_current_register_value); -} - -char TMC26XStepper::getStallGuardThreshold() { - uint32_t stallguard_threshold = stallguard2_current_register_value & STALL_GUARD_VALUE_PATTERN; - //shift it down to bit 0 - stallguard_threshold >>= 8; - //convert the value to an int16_t to correctly handle the negative numbers - char result = stallguard_threshold; - //check if it is negative and fill it up with leading 1 for proper negative number representation - //rem if (result & _BV(6)) { - - if (TEST(result, 6)) result |= 0xC0; - return result; -} - -char TMC26XStepper::getStallGuardFilter() { - if (stallguard2_current_register_value & STALL_GUARD_FILTER_ENABLED) - return -1; - return 0; -} - -/** - * Set the number of microsteps per step. - * 0,2,4,8,16,32,64,128,256 is supported - * any value in between will be mapped to the next smaller value - * 0 and 1 set the motor in full step mode - */ -void TMC26XStepper::setMicrosteps(const int16_t in_steps) { - uint16_t setting_pattern; - - if (in_steps >= 256) setting_pattern = 0; - else if (in_steps >= 128) setting_pattern = 1; - else if (in_steps >= 64) setting_pattern = 2; - else if (in_steps >= 32) setting_pattern = 3; - else if (in_steps >= 16) setting_pattern = 4; - else if (in_steps >= 8) setting_pattern = 5; - else if (in_steps >= 4) setting_pattern = 6; - else if (in_steps >= 2) setting_pattern = 7; - else if (in_steps <= 1) setting_pattern = 8; // 1 and 0 lead to full step - - microsteps = _BV(8 - setting_pattern); - - #ifdef TMC_DEBUG0 // crashes - SERIAL_ECHOPAIR("\n Microstepping: ", microsteps); - #endif - - // Delete the old value - this->driver_control_register_value &= 0x000FFFF0UL; - - // Set the new value - this->driver_control_register_value |= setting_pattern; - - // If started we directly send it to the motor - if (started) send262(driver_control_register_value); - - // Recalculate the stepping delay by simply setting the speed again - this->setSpeed(this->speed); -} - -/** - * returns the effective number of microsteps at the moment - */ -int16_t TMC26XStepper::getMicrosteps() { return microsteps; } - -/** - * constant_off_time: The off time setting controls the minimum chopper frequency. - * For most applications an off time within the range of 5μs to 20μs will fit. - * 2...15: off time setting - * - * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the - * duration of the ringing on the sense resistor. For - * 0: min. setting 3: max. setting - * - * fast_decay_time_setting: Fast decay time setting. With CHM=1, these bits control the portion of fast decay for each chopper cycle. - * 0: slow decay only - * 1...15: duration of fast decay phase - * - * sine_wave_offset: Sine wave offset. With CHM=1, these bits control the sine wave offset. - * A positive offset corrects for zero crossing error. - * -3..-1: negative offset 0: no offset 1...12: positive offset - * - * use_current_comparator: Selects usage of the current comparator for termination of the fast decay cycle. - * If current comparator is enabled, it terminates the fast decay cycle in case the current - * reaches a higher negative value than the actual positive value. - * 1: enable comparator termination of fast decay cycle - * 0: end by time only - */ -void TMC26XStepper::setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, uint8_t use_current_comparator) { - // Perform some sanity checks - LIMIT(constant_off_time, 2, 15); - - // Save the constant off time - this->constant_off_time = constant_off_time; - - // Calculate the value acc to the clock cycles - const char blank_value = blank_time >= 54 ? 3 : - blank_time >= 36 ? 2 : - blank_time >= 24 ? 1 : 0; - - LIMIT(fast_decay_time_setting, 0, 15); - LIMIT(sine_wave_offset, -3, 12); - - // Shift the sine_wave_offset - sine_wave_offset += 3; - - // Calculate the register setting - // First of all delete all the values for this - chopper_config_register &= ~(_BV(12) | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN); - // Set the constant off pattern - chopper_config_register |= CHOPPER_MODE_T_OFF_FAST_DECAY; - // Set the blank timing value - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - // Setting the constant off time - chopper_config_register |= constant_off_time; - // Set the fast decay time - // Set msb - chopper_config_register |= (((uint32_t)(fast_decay_time_setting & 0x8)) << HYSTERESIS_DECREMENT_SHIFT); - // Other bits - chopper_config_register |= (((uint32_t)(fast_decay_time_setting & 0x7)) << HYSTERESIS_START_VALUE_SHIFT); - // Set the sine wave offset - chopper_config_register |= (uint32_t)sine_wave_offset << HYSTERESIS_LOW_SHIFT; - // Using the current comparator? - if (!use_current_comparator) - chopper_config_register |= _BV(12); - - // If started we directly send it to the motor - if (started) { - // rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -/** - * constant_off_time: The off time setting controls the minimum chopper frequency. - * For most applications an off time within the range of 5μs to 20μs will fit. - * 2...15: off time setting - * - * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the - * duration of the ringing on the sense resistor. For - * 0: min. setting 3: max. setting - * - * hysteresis_start: Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value HEND. - * 1...8 - * - * hysteresis_end: Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by HDEC. - * The sum HSTRT+HEND must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. - * -3..-1: negative HEND 0: zero HEND 1...12: positive HEND - * - * hysteresis_decrement: Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. - * 0: fast decrement 3: very slow decrement - */ - -void TMC26XStepper::setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement) { - // Perform some sanity checks - LIMIT(constant_off_time, 2, 15); - - // Save the constant off time - this->constant_off_time = constant_off_time; - - // Calculate the value acc to the clock cycles - const char blank_value = blank_time >= 54 ? 3 : - blank_time >= 36 ? 2 : - blank_time >= 24 ? 1 : 0; - - LIMIT(hysteresis_start, 1, 8); - hysteresis_start--; - - LIMIT(hysteresis_start, -3, 12); - - // Shift the hysteresis_end - hysteresis_end += 3; - - LIMIT(hysteresis_decrement, 0, 3); - - //first of all delete all the values for this - chopper_config_register &= ~(CHOPPER_MODE_T_OFF_FAST_DECAY | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN); - - //set the blank timing value - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - //setting the constant off time - chopper_config_register |= constant_off_time; - //set the hysteresis_start - chopper_config_register |= ((uint32_t)hysteresis_start) << HYSTERESIS_START_VALUE_SHIFT; - //set the hysteresis end - chopper_config_register |= ((uint32_t)hysteresis_end) << HYSTERESIS_LOW_SHIFT; - //set the hystereis decrement - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - //if started we directly send it to the motor - if (started) { - //rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -/** - * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. - * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. - * With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a - * few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. - * Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. - * Hint: A common factor, which can cause motor noise, is a bad PCB layout causing coupling of both sense resistor voltages - * (please refer to sense resistor layout hint in chapter 8.1). - * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. - * It modulates the slow decay time setting when switched on by the RNDTF bit. The RNDTF feature further spreads the chopper spectrum, - * reducing electromagnetic emission on single frequencies. - */ -void TMC26XStepper::setRandomOffTime(char value) { - if (value) - chopper_config_register |= RANDOM_TOFF_TIME; - else - chopper_config_register &= ~(RANDOM_TOFF_TIME); - //if started we directly send it to the motor - if (started) { - //rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -void TMC26XStepper::setCoolStepConfiguration( - uint16_t lower_SG_threshold, - uint16_t SG_hysteresis, - uint8_t current_decrement_step_size, - uint8_t current_increment_step_size, - uint8_t lower_current_limit -) { - // Sanitize the input values - NOMORE(lower_SG_threshold, 480); - // Divide by 32 - lower_SG_threshold >>= 5; - NOMORE(SG_hysteresis, 480); - // Divide by 32 - SG_hysteresis >>= 5; - NOMORE(current_decrement_step_size, 3); - NOMORE(current_increment_step_size, 3); - NOMORE(lower_current_limit, 1); - - // Store the lower level in order to enable/disable the cool step - this->cool_step_lower_threshold=lower_SG_threshold; - // If cool step is not enabled we delete the lower value to keep it disabled - if (!this->cool_step_enabled) lower_SG_threshold = 0; - // The good news is that we can start with a complete new cool step register value - // And simply set the values in the register - cool_step_register_value = ((uint32_t)lower_SG_threshold) - | (((uint32_t)SG_hysteresis) << 8) - | (((uint32_t)current_decrement_step_size) << 5) - | (((uint32_t)current_increment_step_size) << 13) - | (((uint32_t)lower_current_limit) << 15) - | COOL_STEP_REGISTER; // Register signature - - if (started) send262(cool_step_register_value); -} - -void TMC26XStepper::setCoolStepEnabled(boolean enabled) { - // Simply delete the lower limit to disable the cool step - cool_step_register_value &= ~SE_MIN_PATTERN; - // And set it to the proper value if cool step is to be enabled - if (enabled) - cool_step_register_value |= this->cool_step_lower_threshold; - // And save the enabled status - this->cool_step_enabled = enabled; - // Save the register value - if (started) send262(cool_step_register_value); -} - -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 - return this->cool_step_lower_threshold<<5; -} - -uint16_t TMC26XStepper::getCoolStepUpperSgThreshold() { - return uint8_t((cool_step_register_value & SE_MAX_PATTERN) >> 8) << 5; -} - -uint8_t TMC26XStepper::getCoolStepCurrentIncrementSize() { - return uint8_t((cool_step_register_value & CURRENT_DOWN_STEP_SPEED_PATTERN) >> 13); -} - -uint8_t TMC26XStepper::getCoolStepNumberOfSGReadings() { - return uint8_t((cool_step_register_value & SE_CURRENT_STEP_WIDTH_PATTERN) >> 5); -} - -uint8_t TMC26XStepper::getCoolStepLowerCurrentLimit() { - return uint8_t((cool_step_register_value & MINIMUM_CURRENT_FOURTH) >> 15); -} - -void TMC26XStepper::setEnabled(boolean enabled) { - //delete the t_off in the chopper config to get sure - chopper_config_register &= ~(T_OFF_PATTERN); - if (enabled) { - //and set the t_off time - chopper_config_register |= this->constant_off_time; - } - //if not enabled we don't have to do anything since we already delete t_off from the register - if (started) send262(chopper_config_register); -} - -boolean TMC26XStepper::isEnabled() { return !!(chopper_config_register & T_OFF_PATTERN); } - -/** - * reads a value from the TMC26X status register. The value is not obtained directly but can then - * be read by the various status routines. - * - */ -void TMC26XStepper::readStatus(char read_value) { - uint32_t old_driver_configuration_register_value = driver_configuration_register_value; - //reset the readout configuration - driver_configuration_register_value &= ~(READ_SELECTION_PATTERN); - //this now equals TMC26X_READOUT_POSITION - so we just have to check the other two options - if (read_value == TMC26X_READOUT_STALLGUARD) - driver_configuration_register_value |= READ_STALL_GUARD_READING; - else if (read_value == TMC26X_READOUT_CURRENT) - driver_configuration_register_value |= READ_STALL_GUARD_AND_COOL_STEP; - - //all other cases are ignored to prevent funny values - //check if the readout is configured for the value we are interested in - if (driver_configuration_register_value != old_driver_configuration_register_value) { - //because then we need to write the value twice - one time for configuring, second time to get the value, see below - send262(driver_configuration_register_value); - } - //write the configuration to get the last status - send262(driver_configuration_register_value); -} - -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(); -} - -//reads the StallGuard setting from last status -//returns -1 if StallGuard information is not present -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: - //first read out the StallGuard value - readStatus(TMC26X_READOUT_STALLGUARD); - return getReadoutValue(); -} - -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: - //first read out the StallGuard value - readStatus(TMC26X_READOUT_CURRENT); - return (getReadoutValue() & 0x1F); -} - -uint16_t TMC26XStepper::getCurrentCurrent() { - float result = (float)getCurrentCSReading(), - resistor_value = (float)this->resistor, - voltage = (driver_configuration_register_value & VSENSE)? 0.165 : 0.31; - result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); - return (uint16_t)result; -} - -/** - * Return true if the StallGuard threshold has been reached - */ -boolean TMC26XStepper::isStallGuardOverThreshold() { - if (!this->started) return false; - return (driver_status_result & STATUS_STALL_GUARD_STATUS); -} - -/** - * returns if there is any over temperature condition: - * OVER_TEMPERATURE_PREWARING if pre warning level has been reached - * 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() { - if (!this->started) return 0; - - if (driver_status_result & STATUS_OVER_TEMPERATURE_SHUTDOWN) - return TMC26X_OVERTEMPERATURE_SHUTDOWN; - - if (driver_status_result & STATUS_OVER_TEMPERATURE_WARNING) - return TMC26X_OVERTEMPERATURE_PREWARING; - - return 0; -} - -// Is motor channel A shorted to ground -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() { - if (!this->started) return false; - return (driver_status_result & STATUS_SHORT_TO_GROUND_B); -} - -// Is motor channel A connected -boolean TMC26XStepper::isOpenLoadA() { - if (!this->started) return false; - return (driver_status_result & STATUS_OPEN_LOAD_A); -} - -// Is motor channel B connected -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() { - 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() { - 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() { - return (int)(driver_status_result >> 10); -} - -int16_t TMC26XStepper::getResistor() { return this->resistor; } - -boolean TMC26XStepper::isCurrentScalingHalfed() { - return !!(this->driver_configuration_register_value & VSENSE); -} -/** - * version() returns the version of the library: - */ -int16_t TMC26XStepper::version() { return 1; } - -void TMC26XStepper::debugLastStatus() { - #ifdef TMC_DEBUG1 - if (this->started) { - if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_PREWARING) - SERIAL_ECHOLNPGM("\n WARNING: Overtemperature Prewarning!"); - else if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_SHUTDOWN) - SERIAL_ECHOLNPGM("\n ERROR: Overtemperature Shutdown!"); - - if (this->isShortToGroundA()) - SERIAL_ECHOLNPGM("\n ERROR: SHORT to ground on channel A!"); - - if (this->isShortToGroundB()) - SERIAL_ECHOLNPGM("\n ERROR: SHORT to ground on channel B!"); - - if (this->isOpenLoadA()) - SERIAL_ECHOLNPGM("\n ERROR: Channel A seems to be unconnected!"); - - if (this->isOpenLoadB()) - SERIAL_ECHOLNPGM("\n ERROR: Channel B seems to be unconnected!"); - - if (this->isStallGuardReached()) - SERIAL_ECHOLNPGM("\n INFO: Stall Guard level reached!"); - - if (this->isStandStill()) - SERIAL_ECHOLNPGM("\n INFO: Motor is standing still."); - - uint32_t readout_config = driver_configuration_register_value & READ_SELECTION_PATTERN; - const int16_t value = getReadoutValue(); - if (readout_config == READ_MICROSTEP_POSTION) { - SERIAL_ECHOPAIR("\n Microstep position phase A: ", value); - } - else if (readout_config == READ_STALL_GUARD_READING) { - SERIAL_ECHOPAIR("\n Stall Guard value:", value); - } - else if (readout_config == READ_STALL_GUARD_AND_COOL_STEP) { - SERIAL_ECHOPAIR("\n Approx Stall Guard: ", value & 0xF); - SERIAL_ECHOPAIR("\n Current level", value & 0x1F0); - } - } - #endif -} - -/** - * send register settings to the stepper driver via SPI - * returns the current status - */ -inline void TMC26XStepper::send262(uint32_t datagram) { - uint32_t i_datagram; - - //preserver the previous spi mode - //uint8_t oldMode = SPCR & SPI_MODE_MASK; - - //if the mode is not correct set it to mode 3 - //if (oldMode != SPI_MODE3) { - // SPI.setDataMode(SPI_MODE3); - //} - - //select the TMC driver - extDigitalWrite(cs_pin, LOW); - - //ensure that only valid bist are set (0-19) - //datagram &=REGISTER_BIT_PATTERN; - - #ifdef TMC_DEBUG1 - //SERIAL_PRINTF("Sending "); - //SERIAL_PRINTF("Sending ", datagram,HEX); - //SERIAL_ECHOPAIR("\n\nSending \n", print_hex_long(datagram)); - SERIAL_PRINTF("\n\nSending %x", datagram); - #endif - - //write/read the values - i_datagram = STEPPER_SPI.transfer((datagram >> 16) & 0xFF); - i_datagram <<= 8; - i_datagram |= STEPPER_SPI.transfer((datagram >> 8) & 0xFF); - i_datagram <<= 8; - i_datagram |= STEPPER_SPI.transfer((datagram) & 0xFF); - i_datagram >>= 4; - - #ifdef TMC_DEBUG1 - //SERIAL_PRINTF("Received "); - //SERIAL_PRINTF("Received ", i_datagram,HEX); - //SERIAL_ECHOPAIR("\n\nReceived \n", i_datagram); - SERIAL_PRINTF("\n\nReceived %x", i_datagram); - debugLastStatus(); - #endif - - //deselect the TMC chip - extDigitalWrite(cs_pin, HIGH); - - //restore the previous SPI mode if neccessary - //if the mode is not correct set it to mode 3 - //if (oldMode != SPI_MODE3) { - // SPI.setDataMode(oldMode); - //} - - //store the datagram as status result - driver_status_result = i_datagram; -} - -#endif // HAS_DRIVER(TMC2660) - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h deleted file mode 100644 index f1d0133a3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h +++ /dev/null @@ -1,594 +0,0 @@ -/** - * TMC26XStepper.h - - TMC26X Stepper library for Wiring/Arduino - * - * based on the stepper library by Tom Igoe, et. al. - * - * Copyright (c) 2011, Interactive Matter, Marcus Nowotny - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -#pragma once - -#include - -//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TMC chip -/*! - * This warning indicates that the TMC chip is too warm. - * It is still working but some parameters may be inferior. - * You should do something against it. - */ -#define TMC26X_OVERTEMPERATURE_PREWARING 1 -//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC chip -/*! - * This warning indicates that the TMC chip is too warm to operate and has shut down to prevent damage. - * It will stop working until it cools down again. - * If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout - * and/or heat management. - */ -#define TMC26X_OVERTEMPERATURE_SHUTDOWN 2 - -//which values can be read out -/*! - * Selects to readout the microstep position from the motor. - *\sa readStatus() - */ -#define TMC26X_READOUT_POSITION 0 -/*! - * Selects to read out the StallGuard value of the motor. - *\sa readStatus() - */ -#define TMC26X_READOUT_STALLGUARD 1 -/*! - * Selects to read out the current current setting (acc. to CoolStep) and the upper bits of the StallGuard value from the motor. - *\sa readStatus(), setCurrent() - */ -#define TMC26X_READOUT_CURRENT 3 - -/*! - * Define to set the minimum current for CoolStep operation to 1/2 of the selected CS minium. - *\sa setCoolStepConfiguration() - */ -#define COOL_STEP_HALF_CS_LIMIT 0 -/*! - * Define to set the minimum current for CoolStep operation to 1/4 of the selected CS minium. - *\sa setCoolStepConfiguration() - */ -#define COOL_STEP_QUARTDER_CS_LIMIT 1 - -/*! - * \class TMC26XStepper - * \brief Class representing a TMC26X stepper driver - * - * To use one of these drivers in your code create an object of its class: - * \code - * TMC26XStepper tmc_stepper = TMC26XStepper(200,1,2,3,500); - * \endcode - * see TMC26XStepper(int16_t number_of_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t rms_current) - * - * Keep in mind that you need to start the driver with start() in order to configure the TMC26X. - * - * The most important function is move(). It checks if the motor requires a step. It's important to call move() as - * often as possible in loop(). I suggest using a very fast loop routine and always call move() at the beginning or end. - * - * To move you must set a movement speed with setSpeed(). The speed is a positive value, setting the RPM. - * - * To really move the motor you have to call step() to tell the driver to move the motor the given number - * of steps in the given direction. Positive values move the motor in one direction, negative values in the other. - * - * You can check with isMoving() if the motor is still moving or stop it abruptly with stop(). - */ -class TMC26XStepper { - public: - /*! - * \brief Create a new representation of a stepper motor connected to a TMC26X stepper driver - * - * Main constructor. If in doubt use this. All parameters must be provided as described below. - * - * \param number_of_steps Number of steps the motor has per rotation. - * \param cs_pin Arduino pin connected to the Client Select Pin (!CS) of the TMC26X for SPI. - * \param dir_pin Arduino pin connected to the DIR input of the TMC26X. - * \param step_pin Arduino pin connected to the STEP pin of the TMC26X. - * \param rms_current Maximum current to provide to the motor in mA (!). A value of 200 will send up to 200mA to the motor. - * \param resistor Current sense resistor in milli-Ohm, defaults to 0.15 Ohm (or 150 milli-Ohm) as in the TMC260 Arduino Shield. - * - * You must also call TMC26XStepper.start() to configure the stepper driver for use. - * - * By default the Constant Off Time chopper is used. See TMC26XStepper.setConstantOffTimeChopper() for details. - * This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper. See setSpreadCycleChopper(). - * - * By default a microstepping of 1/32 is used to provide a smooth motor run while still giving a good progression per step. - * Change stepping by sending setMicrosteps() a different value. - * \sa start(), setMicrosteps() - */ - TMC26XStepper(const int16_t in_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t current, uint16_t resistor=100); //resistor=150 - - /*! - * \brief Configure and start the TMC26X stepper driver. Before this is called the stepper driver is nonfunctional. - * - * Configure the TMC26X stepper driver for the given values via SPI. - * Most member functions are non-functional if the driver has not been started, - * therefore it is best to call this in setup(). - */ - void start(); - - /*! - * \brief Reset the stepper in unconfigured mode. - * - * Allows start to be called again. It doesn't change the internal stepper - * configuration or the desired configuration. It just marks the stepper as - * not-yet-started. The stepper doesn't need to be reconfigured before - * starting again, and is not reset to any factory settings. - * It must be reset intentionally. - * (Hint: Normally you do not need this function) - */ - void un_start(); - - /*! - * \brief Set the rotation speed in RPM. - * \param whatSpeed the desired speed in RPM. - */ - void setSpeed(uint16_t whatSpeed); - - /*! - * \brief Report the currently selected speed in RPM. - * \sa setSpeed() - */ - uint16_t getSpeed(); - - /*! - * \brief Set the number of microsteps in 2^i values (rounded) up to 256 - * - * This method sets the number of microsteps per step in 2^i interval. - * It accepts 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps. - * Other values will be rounded down to the next smaller value (e.g., 3 gives a microstepping of 2). - * You can always check the current microstepping with getMicrosteps(). - */ - void setMicrosteps(const int16_t in_steps); - - /*! - * \brief Return the effective current number of microsteps selected. - * - * Always returns the effective number of microsteps. - * This may be different from the micro-steps set in setMicrosteps() since it is rounded to 2^i. - * - * \sa setMicrosteps() - */ - int16_t getMicrosteps(); - - /*! - * \brief Initiate a movement with the given number of steps. Positive values move in one direction, negative in the other. - * - * \param number_of_steps The number of steps to move the motor. - * \return 0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set. - * - * If the previous movement is incomplete the function returns -1 and doesn't change the steps to move the motor. - * If the motor does not move it returns 0. - * - * The movement direction is determined by the sign of the steps parameter. The motor direction in machine space - * cannot be determined, as it depends on the construction of the motor and how it functions in the drive system. - * - * For safety, verify with isMoving() or even use stop() to stop the motor before giving it new step directions. - * \sa isMoving(), getStepsLeft(), stop() - */ - char step(int16_t number_of_steps); - - /*! - * \brief Central movement method. Must be called as often as possible in the loop function and is very fast. - * - * Check if the motor still has to move and whether the wait-to-step interval has expired, and manages the - * number of steps remaining to fulfill the current move command. - * - * This function is implemented to be as fast as possible, so call it as often as possible in your loop. - * It should be invoked with as frequently and with as much regularity as possible. - * - * This can be called even when the motor is known not to be moving. It will simply return. - * - * The frequency with which this function is called determines the top stepping speed of the motor. - * It is recommended to call this using a hardware timer to ensure regular invocation. - * \sa step() - */ - char move(); - - /*! - * \brief Check whether the last movement command is done. - * \return 0 if the motor stops, -1 if the motor is moving. - * - * Used to determine if the motor is ready for new movements. - *\sa step(), move() - */ - 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(); - - /*! - * \brief Stop the motor immediately. - * \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all. - * - * This method directly and abruptly stops the motor and may be used as an emergency stop. - */ - char stop(); - - /*! - * \brief Set and configure the classical Constant Off Timer Chopper - * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) - * \param blank_time Comparator blank time. This duration needs to safely cover the duration of the switching event and the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting - * \param fast_decay_time_setting Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 1…15: duration of fast decay phase - * \param sine_wave_offset Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset - * \param use_curreent_comparator Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable). - * - * The classic constant off time chopper uses a fixed portion of fast decay following each on phase. - * While the duration of the on time is determined by the chopper comparator, the fast decay time needs - * to be set by the user in a way, that the current decay is enough for the driver to be able to follow - * the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize - * motor current ripple and power dissipation. This best can be tuned using an oscilloscope or - * trying out motor smoothness at different velocities. A good starting value is a fast decay time setting - * similar to the slow decay time setting. - * After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. - * This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower - * than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short - * moment during current zero crossing, if it is set too high, it makes a larger microstep. - * Typically, a positive offset setting is required for optimum operation. - * - * \sa setSpreadCycleChoper() for other alternatives. - * \sa setRandomOffTime() for spreading the noise over a wider spectrum - */ - void setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, uint8_t use_current_comparator); - - /*! - * \brief Sets and configures with spread cycle chopper. - * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) - * \param blank_time Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting - * \param hysteresis_start Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 … 8 - * \param hysteresis_end Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. - * \param hysteresis_decrement Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement). - * - * The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines - * the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver - * to the motor. - * Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase. - * The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. - * The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of - * current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. - * The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is - * disabled during this time. - * - * \sa setRandomOffTime() for spreading the noise over a wider spectrum - */ - void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement); - - /*! - * \brief Use random off time for noise reduction (0 for off, -1 for on). - * \param value 0 for off, -1 for on - * - * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. - * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, - * thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper - * frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within - * each quarter wave. - * This effect normally is not audible when compared to mechanical noise generated by ball bearings, - * etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. - * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. - * It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum, - * reducing electromagnetic emission on single frequencies. - */ - void setRandomOffTime(char value); - - /*! - * \brief set the maximum motor current in mA (1000 is 1 Amp) - * Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller - * by employing CoolStep. - * \param current the maximum motor current in mA - * \sa getCurrent(), getCurrentCurrent() - */ - void setCurrent(uint16_t current); - - /*! - * \brief readout the motor maximum current in mA (1000 is an Amp) - * This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent() - * \return the maximum motor current in milli amps - * \sa getCurrentCurrent() - */ - uint16_t getCurrent(); - - /*! - * \brief set the StallGuard threshold in order to get sensible StallGuard readings. - * \param stallguard_threshold -64 … 63 the StallGuard threshold - * \param stallguard_filter_enabled 0 if the filter is disabled, -1 if it is enabled - * - * The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at - * the maximum allowable load on the otor (but not before). = is a good starting point (and the default) - * If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value. - * If you get readings of 1023 even with load decrease the setting. - * - * If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the - * reading. - * - * \sa getCurrentStallGuardReading() to read out the current value. - */ - void setStallGuardThreshold(char stallguard_threshold, char stallguard_filter_enabled); - - /*! - * \brief reads out the StallGuard threshold - * \return a number between -64 and 63. - */ - char getStallGuardThreshold(); - - /*! - * \brief returns the current setting of the StallGuard filter - * \return 0 if not set, -1 if set - */ - 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. - * \param lower_SG_threshold Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480 - * \param SG_hysteresis Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480 - * \param current_decrement_step_size Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32 - * \param current_increment_step_size Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8 - * \param lower_current_limit Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - * The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load, - * read out by the StallGuard in order to provide the optimum torque with the minimal current consumption. - * You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the - * limit the current gets increased, below the limit the current gets decreased. - * You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of - * StallGuard readings neccessary above or below the limit to get a more stable current adjustement. - * The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current - * (1/2 or 1/4th otf the configured current). - * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - */ - void setCoolStepConfiguration(uint16_t lower_SG_threshold, uint16_t SG_hysteresis, uint8_t current_decrement_step_size, - uint8_t current_increment_step_size, uint8_t lower_current_limit); - - /*! - * \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. - * \param enabled true if CoolStep should be enabled, false if not. - * \sa setCoolStepConfiguration() - */ - void setCoolStepEnabled(boolean enabled); - - - /*! - * \brief check if the CoolStep feature is enabled - * \sa setCoolStepEnabled() - */ - boolean isCoolStepEnabled(); - - /*! - * \brief returns the lower StallGuard threshold for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint16_t getCoolStepLowerSgThreshold(); - - /*! - * \brief returns the upper StallGuard threshold for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint16_t getCoolStepUpperSgThreshold(); - - /*! - * \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current. - * \sa setCoolStepConfiguration() - */ - uint8_t getCoolStepNumberOfSGReadings(); - - /*! - * \brief returns the increment steps for the current for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint8_t getCoolStepCurrentIncrementSize(); - - /*! - * \brief returns the absolut minium current for the CoolStep operation - * \sa setCoolStepConfiguration() - * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - */ - uint8_t getCoolStepLowerCurrentLimit(); - - /*! - * \brief Get the current microstep position for phase A - * \return The current microstep position for phase A 0…255 - * - * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. - */ - int16_t getMotorPosition(); - - /*! - * \brief Reads the current StallGuard value. - * \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected. - * 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(); - - /*! - * \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(); - - - /*! - *\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. - *\return false if 0.13V is the reference voltage, true if 0.165V is used. - */ - boolean isCurrentScalingHalfed(); - - /*! - * \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). - * This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs - * the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it - * may not be the fastest. - * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent() - */ - uint16_t getCurrentCurrent(); - - /*! - * \brief checks if there is a StallGuard warning in the last status - * \return 0 if there was no warning, -1 if there was some warning. - * 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. - * - * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. - */ - boolean isStallGuardOverThreshold(); - - /*! - * \brief Return over temperature status of the last status readout - * return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. - * 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(); - - /*! - * \brief Is motor channel A shorted to ground detected in the last status 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 isShortToGroundA(); - - /*! - * \brief Is motor channel B shorted to ground detected in the last status 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 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(); - - /*! - * \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 isOpenLoadB(); - - /*! - * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s - * \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 isStandStill(); - - /*! - * \brief checks if there is a StallGuard warning in the last status - * \return 0 if there was no warning, -1 if there was some warning. - * 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. - * - * \sa isStallGuardOverThreshold() - * TODO why? - * - * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. - */ - boolean isStallGuardReached(); - - /*! - *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. - *\param enabled a boolean value true if the motor should be enabled, false otherwise. - */ - void setEnabled(boolean enabled); - - /*! - *\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely - *\return true if the bridges and by that the motor driver are enabled, false if not. - *\sa setEnabled() - */ - boolean isEnabled(); - - /*! - * \brief Manually read out the status register - * This function sends a byte to the motor driver in order to get the current readout. The parameter read_value - * seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method - * automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method - * may take time to send and read one or two bits - depending on the previous readout. - * \param read_value selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT - * \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT - */ - void readStatus(char read_value); - - /*! - * \brief Returns the current sense resistor value in milliohm. - * The default value of ,15 Ohm will return 150. - */ - int16_t getResistor(); - - /*! - * \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(); - - /*! - * \brief library version - * \return the version number as int. - */ - int16_t version(); - - private: - uint16_t steps_left; // The steps the motor has to do to complete the movement - int16_t direction; // Direction of rotation - uint32_t step_delay; // Delay between steps, in ms, based on speed - int16_t number_of_steps; // Total number of steps this motor can take - uint16_t speed; // Store the current speed in order to change the speed after changing microstepping - uint16_t resistor; // Current sense resitor value in milliohm - - uint32_t last_step_time, // Timestamp (ms) of the last step - next_step_time; // Timestamp (ms) of the next step - - // Driver control register copies to easily set & modify the registers - uint32_t driver_control_register_value, - chopper_config_register, - cool_step_register_value, - stallguard2_current_register_value, - driver_configuration_register_value, - driver_status_result; // The driver status result - - // Helper routione to get the top 10 bit of the readout - inline int16_t getReadoutValue(); - - // The pins for the stepper driver - uint8_t cs_pin, step_pin, dir_pin; - - // Status values - boolean started; // If the stepper has been started yet - int16_t microsteps; // The current number of micro steps - char constant_off_time; // We need to remember this value in order to enable and disable the motor - uint8_t cool_step_lower_threshold; // we need to remember the threshold to enable and disable the CoolStep feature - boolean cool_step_enabled; // We need to remember this to configure the coolstep if it si enabled - - // SPI sender - inline void send262(uint32_t datagram); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp deleted file mode 100644 index 5a3b32ef5b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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(STM32GENERIC) && defined(STM32F7) - -#include "../HAL.h" -#include "timers.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 2 - -//#define PRESCALER 1 - -// ------------------------ -// Private Variables -// ------------------------ - -tTimerConfig timerConfig[NUM_HARDWARE_TIMERS]; - -// ------------------------ -// Public functions -// ------------------------ - -bool timers_initialized[NUM_HARDWARE_TIMERS] = { false }; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - switch (timer_num) { - case STEP_TIMER_NUM: - //STEPPER TIMER TIM5 //use a 32bit timer - __HAL_RCC_TIM5_CLK_ENABLE(); - timerConfig[0].timerdef.Instance = TIM5; - timerConfig[0].timerdef.Init.Prescaler = (STEPPER_TIMER_PRESCALE); - timerConfig[0].timerdef.Init.CounterMode = TIM_COUNTERMODE_UP; - timerConfig[0].timerdef.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - timerConfig[0].IRQ_Id = TIM5_IRQn; - timerConfig[0].callback = (uint32_t)TC5_Handler; - HAL_NVIC_SetPriority(timerConfig[0].IRQ_Id, 1, 0); - #if PIN_EXISTS(STEPPER_ENABLE) - OUT_WRITE(STEPPER_ENABLE_PIN, HIGH); - #endif - break; - case TEMP_TIMER_NUM: - //TEMP TIMER TIM7 // any available 16bit Timer (1 already used for PWM) - __HAL_RCC_TIM7_CLK_ENABLE(); - timerConfig[1].timerdef.Instance = TIM7; - timerConfig[1].timerdef.Init.Prescaler = (TEMP_TIMER_PRESCALE); - timerConfig[1].timerdef.Init.CounterMode = TIM_COUNTERMODE_UP; - timerConfig[1].timerdef.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - timerConfig[1].IRQ_Id = TIM7_IRQn; - timerConfig[1].callback = (uint32_t)TC7_Handler; - HAL_NVIC_SetPriority(timerConfig[1].IRQ_Id, 2, 0); - break; - } - timers_initialized[timer_num] = true; - } - - timerConfig[timer_num].timerdef.Init.Period = (((HAL_TIMER_RATE) / timerConfig[timer_num].timerdef.Init.Prescaler) / frequency) - 1; - - if (HAL_TIM_Base_Init(&timerConfig[timer_num].timerdef) == HAL_OK) - HAL_TIM_Base_Start_IT(&timerConfig[timer_num].timerdef); -} - -//forward the interrupt -extern "C" void TIM5_IRQHandler() { - ((void(*)())timerConfig[0].callback)(); -} -extern "C" void TIM7_IRQHandler() { - ((void(*)())timerConfig[1].callback)(); -} - -void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { - __HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, compare); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - HAL_NVIC_EnableIRQ(timerConfig[timer_num].IRQ_Id); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - HAL_NVIC_DisableIRQ(timerConfig[timer_num].IRQ_Id); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return __HAL_TIM_GetAutoreload(&timerConfig[timer_num].timerdef); -} - -uint32_t HAL_timer_get_count(const uint8_t timer_num) { - return __HAL_TIM_GetCounter(&timerConfig[timer_num].timerdef); -} - -void HAL_timer_isr_prologue(const uint8_t timer_num) { - if (__HAL_TIM_GET_FLAG(&timerConfig[timer_num].timerdef, TIM_FLAG_UPDATE) == SET) { - __HAL_TIM_CLEAR_FLAG(&timerConfig[timer_num].timerdef, TIM_FLAG_UPDATE); - } -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - const uint32_t IRQ_Id = uint32_t(timerConfig[timer_num].IRQ_Id); - return NVIC->ISER[IRQ_Id >> 5] & _BV32(IRQ_Id & 0x1F); -} - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h deleted file mode 100644 index 38ecde30bb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -#define hal_timer_t uint32_t // TODO: One is 16-bit, one 32-bit - does this need to be checked? -#define HAL_TIMER_TYPE_MAX 0xFFFF - -#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals - -#define STEP_TIMER_NUM 0 // index of timer to use for stepper -#define TEMP_TIMER_NUM 1 // index of timer to use for temperature -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz - -#define STEPPER_TIMER_PRESCALE 54 // was 40,prescaler for setting stepper timer, 2Mhz -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) -#define TEMP_ISR_ENABLED() HAL_timer_interrupt_enabled(TEMP_TIMER_NUM) - -// TODO change this - -extern void TC5_Handler(); -extern void TC7_Handler(); -#define HAL_STEP_TIMER_ISR() void TC5_Handler() -#define HAL_TEMP_TIMER_ISR() void TC7_Handler() - -// ------------------------ -// Types -// ------------------------ - -typedef struct { - TIM_HandleTypeDef timerdef; - IRQn_Type IRQ_Id; - uint32_t callback; -} tTimerConfig; - -// ------------------------ -// Public Variables -// ------------------------ - -//extern const tTimerConfig timerConfig[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare); -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num); -uint32_t HAL_timer_get_count(const uint8_t timer_num); -void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp deleted file mode 100644 index b3aac77615..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp +++ /dev/null @@ -1,54 +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 . - * - */ - -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "Servo.h" - -int8_t libServo::attach(const int 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 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 (attach(0) >= 0) { - write(value); - safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif - } -} - -#endif // HAS_SERVOS -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h deleted file mode 100644 index 64fa05025c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h +++ /dev/null @@ -1,41 +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 - -//#ifdef STM32F7 -// #include <../../libraries/Servo/src/Servo.h> -//#else - #include -//#endif - -// Inherit and expand on the official library -class libServo : public Servo { - public: - int8_t attach(const int pin); - 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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp deleted file mode 100644 index 3358fa3df7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/** - ****************************************************************************** - * @file EEPROM/EEPROM_Emulation/src/eeprom.c - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file provides all the EEPROM emulation firmware functions. - ****************************************************************************** - * @attention - * - * Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -/** @addtogroup EEPROM_Emulation - * @{ - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -/* Includes ------------------------------------------------------------------*/ -#include "eeprom_emul.h" - -/* Private variables ---------------------------------------------------------*/ - -/* Global variable used to store variable value in read sequence */ -uint16_t DataVar = 0; - -/* Virtual address defined by the user: 0xFFFF value is prohibited */ -uint16_t VirtAddVarTab[NB_OF_VAR]; - -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ -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); -static uint16_t EE_VerifyPageFullyErased(uint32_t Address); - - /** - * @brief Restore the pages to a known good state in case of page's status - * corruption after a power loss. - * @param None. - * @retval - Flash error code: on write Flash error - * - FLASH_COMPLETE: on success - */ -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); - - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - HAL_StatusTypeDef FlashStatus; // = HAL_OK - - /* Check for invalid header states and repair if necessary */ - uint32_t SectorError; - switch (PageStatus0) { - case ERASED: - if (PageStatus1 == VALID_PAGE) { /* Page0 erased, Page1 valid */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - else if (PageStatus1 == RECEIVE_DATA) { /* Page0 erased, Page1 receive */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (fStat != HAL_OK) return fStat; - } - /* Mark Page1 as valid */ - /* As the last operation, simply return the result */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - } - else { /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) { /* Page0 receive, Page1 valid */ - /* Transfer data from Page1 to Page0 */ - int16_t x = -1; - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - if (VarIdx != x) { - /* Read the last variables' updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page0 */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page0 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - else if (PageStatus1 == ERASED) { /* Page0 receive, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (fStat != HAL_OK) return fStat; - } - /* Mark Page0 as valid */ - /* As the last operation, simply return the result */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - } - else { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - break; - - case VALID_PAGE: - if (PageStatus1 == VALID_PAGE) { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - else if (PageStatus1 == ERASED) { /* Page0 valid, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - else { /* Page0 valid, Page1 receive */ - /* Transfer data from Page0 to Page1 */ - int16_t x = -1; - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - - if (VarIdx != x) { - /* Read the last variables' updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page1 */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page1 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - break; - - default: /* Any other state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - - return HAL_OK; -} - -/** - * @brief Verify if specified page is fully erased. - * @param Address: page address - * This parameter can be one of the following values: - * @arg PAGE0_BASE_ADDRESS: Page0 base address - * @arg PAGE1_BASE_ADDRESS: Page1 base address - * @retval page fully erased status: - * - 0: if Page not erased - * - 1: if Page erased - */ -uint16_t EE_VerifyPageFullyErased(uint32_t Address) { - uint32_t ReadStatus = 1; - /* Check each active page address starting from end */ - while (Address <= PAGE0_END_ADDRESS) { - /* Get the current location content to be compared with virtual address */ - uint16_t AddressValue = (*(__IO uint16_t*)Address); - /* Compare the read address with the virtual address */ - if (AddressValue != ERASED) { - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - /* Next address location */ - Address += 4; - } - /* Return ReadStatus value: (0: Page not erased, 1: Sector erased) */ - return ReadStatus; -} - -/** - * @brief Returns the last stored variable data, if found, which correspond to - * the passed virtual address - * @param VirtAddress: Variable virtual address - * @param Data: Global variable contains the read variable value - * @retval Success or error status: - * - 0: if variable was found - * - 1: if the variable was not found - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) { - uint16_t ReadStatus = 1; - - /* Get active Page for read operation */ - uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start and end Addresses */ - uint32_t PageStartAddress = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), - Address = PageStartAddress + PAGE_SIZE - 2; - - /* Check each active page address starting from end */ - while (Address > PageStartAddress + 2) { - /* Get the current location content to be compared with virtual address */ - uint16_t AddressValue = (*(__IO uint16_t*)Address); - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) { - /* Get content of Address-2 which is variable value */ - *Data = (*(__IO uint16_t*)(Address - 2)); - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - else /* Next address location */ - Address -= 4; - } - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { - /* Write the variable virtual address and value in the EEPROM */ - uint16_t Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - - /* In case the EEPROM active page is full */ - if (Status == PAGE_FULL) /* Perform Page transfer */ - Status = EE_PageTransfer(VirtAddress, Data); - - /* Return last operation status */ - return Status; -} - -/** - * @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE - * @param None - * @retval Status of the last operation (Flash write or erase) done during - * EEPROM formating - */ -static HAL_StatusTypeDef EE_Format() { - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - HAL_StatusTypeDef FlashStatus; // = HAL_OK - - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - uint32_t SectorError; - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - pEraseInit.Sector = PAGE1_ID; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - /* As the last operation, just return the result code */ - uint32_t SectorError; - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - - return HAL_OK; -} - -/** - * @brief Find valid Page for write or read operation - * @param Operation: operation to achieve on the valid page. - * This parameter can be one of the following values: - * @arg READ_FROM_VALID_PAGE: read operation from valid page - * @arg WRITE_IN_VALID_PAGE: write operation from valid page - * @retval Valid page number (PAGE or PAGE1) or NO_VALID_PAGE in case - * of no valid page was found - */ -static uint16_t EE_FindValidPage(uint8_t Operation) { - /* Get Page0 and Page1 actual status */ - uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Write or read operation */ - switch (Operation) { - case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ - if (PageStatus1 == VALID_PAGE) { - /* Page0 receiving data */ - return (PageStatus0 == RECEIVE_DATA) ? PAGE0 : PAGE1; - } - else if (PageStatus0 == VALID_PAGE) { - /* Page1 receiving data */ - return (PageStatus1 == RECEIVE_DATA) ? PAGE1 : PAGE0; - } - else - return NO_VALID_PAGE; /* No valid Page */ - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - return PAGE0; /* Page0 valid */ - else if (PageStatus1 == VALID_PAGE) - return PAGE1; /* Page1 valid */ - else - return NO_VALID_PAGE; /* No valid Page */ - - default: - return PAGE0; /* Page0 valid */ - } -} - -/** - * @brief Verify if active page is full and Writes variable in EEPROM. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) { - /* Get valid Page for write operation */ - uint16_t ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start and end Addresses */ - uint32_t Address = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), - PageEndAddress = Address + PAGE_SIZE - 1; - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) { - /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ - if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) { - /* Set variable data */ - HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address, Data); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - /* Set variable virtual address, return status */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address + 2, VirtAddress); - } - else /* Next address location */ - Address += 4; - } - - /* Return PAGE_FULL in case the valid page is full */ - return PAGE_FULL; -} - -/** - * @brief Transfers last updated variables data from the full Page to - * an empty one. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { - /* Get active Page for read operation */ - uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - uint32_t NewPageAddress = EEPROM_START_ADDRESS; - uint16_t OldPageId = 0; - - if (ValidPage == PAGE1) { /* Page1 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE0_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE1_ID; - } - else if (ValidPage == PAGE0) { /* Page0 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE1_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE0_ID; - } - else - return NO_VALID_PAGE; /* No valid Page */ - - /* Set the new Page status to RECEIVE_DATA status */ - HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, RECEIVE_DATA); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Write the variable passed as parameter in the new active page */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - - /* Transfer process: transfer variables from old to the new active page */ - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (VirtAddVarTab[VarIdx] != VirtAddress) { /* Check each variable except the one passed as parameter */ - /* Read the other last variable updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = OldPageId; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - /* Erase the old Page: Set old Page status to ERASED status */ - uint32_t SectorError; - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Set new Page status to VALID_PAGE status */ - /* As the last operation, just return the result code */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); -} - -#endif // STM32GENERIC && (STM32F4 || STM32F7) - -/** - * @} - */ - -/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h deleted file mode 100644 index e4094f8e13..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** - * @file eeprom_emul.h - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file contains all the functions prototypes for the EEPROM - * emulation firmware library. - ****************************************************************************** - * @attention - * - * Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ******************************************************************************/ -#pragma once - -// ------------------------ -// Includes -// ------------------------ - -#include "../../inc/MarlinConfig.h" -#include "HAL.h" - -/* Exported constants --------------------------------------------------------*/ -/* EEPROM emulation firmware error codes */ -#define EE_OK uint32_t(HAL_OK) -#define EE_ERROR uint32_t(HAL_ERROR) -#define EE_BUSY uint32_t(HAL_BUSY) -#define EE_TIMEOUT uint32_t(HAL_TIMEOUT) - -/* Define the size of the sectors to be used */ -#define PAGE_SIZE uint32_t(0x4000) /* Page size = 16KByte */ - -/* Device voltage range supposed to be [2.7V to 3.6V], the operation will - be done by word */ -#define VOLTAGE_RANGE uint8_t(VOLTAGE_RANGE_3) - -/* EEPROM start address in Flash */ -#ifdef STM32F7 - #define EEPROM_START_ADDRESS uint32_t(0x08100000) /* EEPROM emulation start address: - from sector2 : after 16KByte of used - Flash memory */ -#else - #define EEPROM_START_ADDRESS uint32_t(0x08078000) /* EEPROM emulation start address: - after 480KByte of used Flash memory */ -#endif - -/* Pages 0 and 1 base and end addresses */ -#define PAGE0_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x0000) -#define PAGE0_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + PAGE_SIZE - 1) -#define PAGE0_ID FLASH_SECTOR_1 - -#define PAGE1_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x4000) -#define PAGE1_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + 2 * (PAGE_SIZE) - 1) -#define PAGE1_ID FLASH_SECTOR_2 - -/* Used Flash pages for EEPROM emulation */ -#define PAGE0 uint16_t(0x0000) -#define PAGE1 uint16_t(0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ - -/* No valid page define */ -#define NO_VALID_PAGE uint16_t(0x00AB) - -/* Page status definitions */ -#define ERASED uint16_t(0xFFFF) /* Page is empty */ -#define RECEIVE_DATA uint16_t(0xEEEE) /* Page is marked to receive data */ -#define VALID_PAGE uint16_t(0x0000) /* Page containing valid data */ - -/* Valid pages in read and write defines */ -#define READ_FROM_VALID_PAGE uint8_t(0x00) -#define WRITE_IN_VALID_PAGE uint8_t(0x01) - -/* Page full define */ -#define PAGE_FULL uint8_t(0x80) - -/* Variables' number */ -#define NB_OF_VAR uint16_t(4096) - -/* Exported functions ------------------------------------------------------- */ -uint16_t EE_Initialize(); -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h deleted file mode 100644 index d0aa731e89..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h +++ /dev/null @@ -1,64 +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 - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #if HAS_X_MAX - attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_X_MIN - attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MAX - attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MIN - attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MAX - attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN - attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MAX - attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MIN - attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MAX - attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MIN - attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h deleted file mode 100644 index 1e5ef2ef30..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h +++ /dev/null @@ -1,310 +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. - */ - -#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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h deleted file mode 100644 index 7b8d29aa7d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h +++ /dev/null @@ -1,37 +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 - -/** - * Test STM32F4/7-specific configuration values for errors at compile-time. - */ -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32F4/7. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp deleted file mode 100644 index 4bd86d225d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" - -bool PersistentStore::access_start() { return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h deleted file mode 100644 index 342b875561..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 - -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "../HAL_STM32/pinsDebug_STM32duino.h" -#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "../HAL_STM32/pinsDebug_STM32GENERIC.h" -#else - #error "M43 Pins Debugging not supported for this board." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h deleted file mode 100644 index 4aef289a77..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 - -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#ifndef SCK_PIN - #define SCK_PIN PA5 -#endif -#ifndef MISO_PIN - #define MISO_PIN PA6 -#endif -#ifndef MOSI_PIN - #define MOSI_PIN PA7 -#endif -#ifndef SS_PIN - #define SS_PIN PA8 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h deleted file mode 100644 index cf33205bdd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * 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 - -#ifdef STM32F4 - #include "STM32F4/timers.h" -#else - #include "STM32F7/timers.h" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp deleted file mode 100644 index 900d1ef6a6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp +++ /dev/null @@ -1,56 +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 . - * - */ - -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - - #include "watchdog.h" - - IWDG_HandleTypeDef hiwdg; - - void watchdog_init() { - hiwdg.Instance = IWDG; - hiwdg.Init.Prescaler = IWDG_PRESCALER_32; //32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock - hiwdg.Init.Reload = 4095; //4095 counts = 4 seconds at 1024Hz - if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { - //Error_Handler(); - } - else { - #if PIN_EXISTS(LED) && DISABLED(PINS_DEBUGGING) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } - } - - void HAL_watchdog_refresh() { - /* Refresh IWDG: reload counter */ - if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { - /* Refresh Error */ - //Error_Handler(); - } - } - -#endif // USE_WATCHDOG -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h deleted file mode 100644 index 9e2a2dc21c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h +++ /dev/null @@ -1,27 +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 - -extern IWDG_HandleTypeDef hiwdg; - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp deleted file mode 100644 index 2e15324e3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp +++ /dev/null @@ -1,92 +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 . - * - */ - - -/** - * Description: HAL for Teensy32 (MK20DX256) - */ - -#ifdef __MK20DX256__ - -#include "HAL.h" -#include "../shared/Delay.h" - -#include - -uint16_t HAL_adc_result; - -static const uint8_t pin2sc1a[] = { - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 0, 19, 3, 31, // 0-13, we treat them as A0-A13 - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9) - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, // 24-33 - 0+64, 19+64, 3+64, 31+64, // 34-37 (A10-A13) - 26, 22, 23, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14, bandgap, VREFH, VREFL. A14 isn't connected to anything in Teensy 3.0. -}; - -/* - // disable interrupts - void cli() { noInterrupts(); } - - // enable interrupts - void sei() { interrupts(); } -*/ - -void HAL_adc_init() { - analog_init(); - while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - NVIC_ENABLE_IRQ(IRQ_FTM1); -} - -void HAL_clear_reset_source() { } - -uint8_t HAL_get_reset_source() { - switch (RCM_SRS0) { - case 128: return RST_POWER_ON; break; - case 64: return RST_EXTERNAL; break; - case 32: return RST_WATCHDOG; break; - // case 8: return RST_LOSS_OF_LOCK; break; - // case 4: return RST_LOSS_OF_CLOCK; break; - // case 2: return RST_LOW_VOLTAGE; break; - } - return 0; -} - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} - -void HAL_adc_start_conversion(const uint8_t adc_pin) { ADC0_SC1A = pin2sc1a[adc_pin]; } - -uint16_t HAL_adc_get_result() { return ADC0_RA; } - -#endif // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h deleted file mode 100644 index 684afa58f4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -/** - * Description: HAL for Teensy 3.5 and Teensy 3.6 - */ - -#define CPU_32_BIT - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "watchdog.h" - -#include "timers.h" - -#include - -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) - -//#undef MOTHERBOARD -//#define MOTHERBOARD BOARD_TEENSY31_32 - -#define IS_32BIT_TEENSY defined(__MK20DX256__) -#define IS_TEENSY32 defined(__MK20DX256__) - -#define NUM_SERIAL 1 - -#if SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif SERIAL_PORT == 0 - #define MYSERIAL0 Serial -#elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 -#endif - -#define HAL_SERVO_LIB libServo - -typedef int8_t pin_t; - -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*((void**)(addr))) -// Add type-checking to pgm_read_word -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - -inline void HAL_init() {} - -// Clear the reset reason -void HAL_clear_reset_source(); - -// Get the reason for the reset -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(); -} -#pragma GCC diagnostic pop - -// ADC - -void HAL_adc_init(); - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true - -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_start_conversion(const uint8_t adc_pin); -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) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp deleted file mode 100644 index 4236f02b0f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp +++ /dev/null @@ -1,130 +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 . - * - */ -#ifdef __MK20DX256__ - -#include "HAL.h" -#include -#include -#include "spi_pins.h" -#include "../../core/macros.h" - -static SPISettings spiConfig; - -/** - * Standard SPI functions - */ - -// Initialize SPI bus -void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" - #endif - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); - - #if 0 && DISABLED(SOFTWARE_SPI) - // set SS high - may be chip select for another SPI device - #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); - #endif - // set a default rate - spiInit(SPI_HALF_SPEED); // 1 - #endif -} - -// Configure SPI for specified SPI speed -void spiInit(uint8_t spiRate) { - // Use data rates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 10000000; break; - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 312500; break; - default: clock = 4000000; // Default from the SPI libarary - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -// SPI receive a byte -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - const uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; - //SPDR = 0xFF; - //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - //return SPDR; -} - -// SPI read data -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - SPI.transfer(buf, nbyte); - SPI.endTransaction(); - //if (nbyte-- == 0) return; - // SPDR = 0xFF; - //for (uint16_t i = 0; i < nbyte; i++) { - // while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - // buf[i] = SPDR; - // SPDR = 0xFF; - //} - //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - //buf[nbyte] = SPDR; -} - -// SPI send a byte -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); - //SPDR = b; - //while (!TEST(SPSR, SPIF)) { /* nada */ } -} - -// SPI send block -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPDR = token; - for (uint16_t i = 0; i < 512; i += 2) { - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPDR = buf[i]; - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPDR = buf[i + 1]; - } - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPI.endTransaction(); -} - - -// Begin SPI transaction, set clock, bit order, data mode -void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - spiConfig = SPISettings(spiClock, bitOrder, dataMode); - SPI.beginTransaction(spiConfig); -} - -#endif // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp deleted file mode 100644 index 6451f6b172..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp +++ /dev/null @@ -1,57 +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 . - * - */ -#ifdef __MK20DX256__ - -#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 // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h deleted file mode 100644 index 3eb7d39b22..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h +++ /dev/null @@ -1,37 +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 - -#include - -// Inherit and expand on the official library -class libServo : public Servo { - public: - int8_t attach(const int pin); - 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; - uint16_t max_ticks; - uint8_t servoIndex; // index into the channel data for this servo -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h deleted file mode 100644 index 221b721b35..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h +++ /dev/null @@ -1,77 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -/** - * Endstop interrupts for Due based targets. - * On Due, all pins support external interrupt capability. - */ - -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) - #if HAS_X_MAX - _ATTACH(X_MAX_PIN); - #endif - #if HAS_X_MIN - _ATTACH(X_MIN_PIN); - #endif - #if HAS_Y_MAX - _ATTACH(Y_MAX_PIN); - #endif - #if HAS_Y_MIN - _ATTACH(Y_MIN_PIN); - #endif - #if HAS_Z_MAX - _ATTACH(Z_MAX_PIN); - #endif - #if HAS_Z_MIN - _ATTACH(Z_MIN_PIN); - #endif - #if HAS_Z2_MAX - _ATTACH(Z2_MAX_PIN); - #endif - #if HAS_Z2_MIN - _ATTACH(Z2_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h deleted file mode 100644 index d1b5f567d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h +++ /dev/null @@ -1,97 +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 - -/** - * Fast I/O Routines for Teensy 3.5 and Teensy 3.6 - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -#ifndef MASK - #define MASK(PIN) (1 << PIN) -#endif - -#define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) -#define GPIO_BITBAND(reg, bit) (*(uint32_t *)GPIO_BITBAND_ADDR((reg), (bit))) - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -#define _READ(P) bool(CORE_PIN ## P ## _PINREG & CORE_PIN ## P ## _BITMASK) - -#define _WRITE(P,V) do{ \ - if (V) CORE_PIN ## P ## _PORTSET = CORE_PIN ## P ## _BITMASK; \ - else CORE_PIN ## P ## _PORTCLEAR = CORE_PIN ## P ## _BITMASK; \ -}while(0) - -#define _TOGGLE(P) (*(&(CORE_PIN ## P ## _PORTCLEAR)+1) = CORE_PIN ## P ## _BITMASK) - -#define _SET_INPUT(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1); \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 0; \ -}while(0) - -#define _SET_OUTPUT(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1)|PORT_PCR_SRE|PORT_PCR_DSE; \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 1; \ -}while(0) - -#define _SET_INPUT_PULLUP(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1) | PORT_PCR_PE | PORT_PCR_PS; \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 0; \ -}while(0) - -#define _IS_INPUT(P) ((CORE_PIN ## P ## _DDRREG & CORE_PIN ## P ## _BITMASK) == 0) -#define _IS_OUTPUT(P) ((CORE_PIN ## P ## _DDRREG & CORE_PIN ## P ## _BITMASK) == 0) - -#define READ(IO) _READ(IO) - -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) - -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) -#define SET_PWM(IO) SET_OUTPUT(IO) - -#define IS_INPUT(IO) _IS_INPUT(IO) -#define IS_OUTPUT(IO) _IS_OUTPUT(IO) - -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -#define PWM_PIN(P) digitalPinHasPWM(P) - -/** - * Ports, functions, and pins - */ - -#define DIO0_PIN 8 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h deleted file mode 100644 index 389d27824e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h +++ /dev/null @@ -1,34 +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 - -/** - * Test TEENSY35_36 specific configuration values for errors at compile-time. - */ - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for Teensy 3.1/3.2. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp deleted file mode 100644 index 6da102638f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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 . - * - */ -#ifdef __MK20DX256__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" - -bool PersistentStore::access_start() { return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -#endif // EEPROM_SETTINGS -#endif // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/pinsDebug.h deleted file mode 100644 index d4a91ce801..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/pinsDebug.h +++ /dev/null @@ -1 +0,0 @@ -#error "PINS_DEBUGGING is not yet supported for Teensy 3.1 / 3.2!" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h deleted file mode 100644 index 8a0ab8f9a4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h +++ /dev/null @@ -1,27 +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 - -#define SCK_PIN 13 -#define MISO_PIN 12 -#define MOSI_PIN 11 -#define SS_PIN 20 //SDSS // A.28, A.29, B.21, C.26, C.29 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp deleted file mode 100644 index e4ccf33a4b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp +++ /dev/null @@ -1,114 +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 . - * - */ - -/** - * Teensy3.2 __MK20DX256__ - */ - -#ifdef __MK20DX256__ - -#include "HAL.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() { - __asm__ __volatile__("isb 0xF":::"memory"); -} - -/** \brief Data Synchronization Barrier - 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() { - __asm__ __volatile__("dsb 0xF":::"memory"); -} - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - switch (timer_num) { - case 0: - FTM0_MODE = FTM_MODE_WPDIS | FTM_MODE_FTMEN; - FTM0_SC = 0x00; // Set this to zero before changing the modulus - FTM0_CNT = 0x0000; // Reset the count to zero - FTM0_MOD = 0xFFFF; // max modulus = 65535 - FTM0_C0V = (FTM0_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value - FTM0_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM0_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 8 - FTM0_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; - break; - case 1: - FTM1_MODE = FTM_MODE_WPDIS | FTM_MODE_FTMEN; // Disable write protection, Enable FTM1 - FTM1_SC = 0x00; // Set this to zero before changing the modulus - FTM1_CNT = 0x0000; // Reset the count to zero - FTM1_MOD = 0xFFFF; // max modulus = 65535 - FTM1_C0V = (FTM1_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value 65535 - FTM1_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM1_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 4 - FTM1_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; - break; - } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_ENABLE_IRQ(IRQ_FTM0); break; - case 1: NVIC_ENABLE_IRQ(IRQ_FTM1); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_DISABLE_IRQ(IRQ_FTM0); break; - case 1: NVIC_DISABLE_IRQ(IRQ_FTM1); break; - } - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case 0: return NVIC_IS_ENABLED(IRQ_FTM0); - case 1: return NVIC_IS_ENABLED(IRQ_FTM1); - } - return false; -} - -void HAL_timer_isr_prologue(const uint8_t timer_num) { - switch (timer_num) { - case 0: - FTM0_CNT = 0x0000; - FTM0_SC &= ~FTM_SC_TOF; // Clear FTM Overflow flag - FTM0_C0SC &= ~FTM_CSC_CHF; // Clear FTM Channel Compare flag - break; - case 1: - FTM1_CNT = 0x0000; - FTM1_SC &= ~FTM_SC_TOF; // Clear FTM Overflow flag - FTM1_C0SC &= ~FTM_CSC_CHF; // Clear FTM Channel Compare flag - break; - } -} - -#endif // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.h deleted file mode 100644 index 6dff7701be..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/timers.h +++ /dev/null @@ -1,104 +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 - -/** - * Description: HAL for - * Teensy3.2 (__MK20DX256__) - */ - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define FTM0_TIMER_PRESCALE 8 -#define FTM1_TIMER_PRESCALE 4 -#define FTM0_TIMER_PRESCALE_BITS 0b011 -#define FTM1_TIMER_PRESCALE_BITS 0b010 - -#define FTM0_TIMER_RATE (F_BUS / (FTM0_TIMER_PRESCALE)) // 60MHz / 8 = 7500kHz -#define FTM1_TIMER_RATE (F_BUS / (FTM1_TIMER_PRESCALE)) // 60MHz / 4 = 15MHz - -#define HAL_TIMER_RATE (FTM0_TIMER_RATE) - -#define STEP_TIMER_NUM 0 -#define TEMP_TIMER_NUM 1 -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY 1000 - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#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 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); - -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { - switch (timer_num) { - case 0: FTM0_C0V = compare; break; - case 1: FTM1_C0V = compare; break; - } -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - switch (timer_num) { - case 0: return FTM0_C0V; - case 1: return FTM1_C0V; - } - return 0; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - switch (timer_num) { - case 0: return FTM0_CNT; - case 1: return FTM1_CNT; - } - return 0; -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp deleted file mode 100644 index d1313e1f5d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp +++ /dev/null @@ -1,39 +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 . - * - */ - -#ifdef __MK20DX256__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -void watchdog_init() { - WDOG_TOVALH = 0; - WDOG_TOVALL = 4000; - WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; -} - -#endif // USE_WATCHDOG - -#endif // __MK20DX256__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h deleted file mode 100644 index 861afcbc91..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h +++ /dev/null @@ -1,34 +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 - -#include "HAL.h" - -// Arduino Due core now has watchdog support - -void watchdog_init(); - -inline void HAL_watchdog_refresh() { - // Watchdog refresh sequence - WDOG_REFRESH = 0xA602; - WDOG_REFRESH = 0xB480; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp deleted file mode 100644 index 5848944792..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp +++ /dev/null @@ -1,120 +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 . - * - */ - -/** - * Description: HAL for Teensy35 (MK64FX512) - */ - -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "HAL.h" -#include "../shared/Delay.h" - -#include - -uint16_t HAL_adc_result, HAL_adc_select; - -static const uint8_t pin2sc1a[] = { - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 19+128, 14+128, 15+128, // 0-13 -> A0-A13 - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 are A0-A9 - 255, 255, 255, 255, 255, 255, 255, // 24-30 are digital only - 14+128, 15+128, 17, 18, 4+128, 5+128, 6+128, 7+128, 17+128, // 31-39 are A12-A20 - 255, 255, 255, 255, 255, 255, 255, 255, 255, // 40-48 are digital only - 10+128, 11+128, // 49-50 are A23-A24 - 255, 255, 255, 255, 255, 255, 255, // 51-57 are digital only - 255, 255, 255, 255, 255, 255, // 58-63 (sd card pins) are digital only - 3, 19+128, // 64-65 are A10-A11 - 23, 23+128,// 66-67 are A21-A22 (DAC pins) - 1, 1+128, // 68-69 are A25-A26 (unused USB host port on Teensy 3.5) - 26, // 70 is Temperature Sensor - 18+128 // 71 is Vref -}; - -/* - // disable interrupts - void cli() { noInterrupts(); } - - // enable interrupts - void sei() { interrupts(); } -*/ - -void HAL_adc_init() { - analog_init(); - while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - while (ADC1_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - NVIC_ENABLE_IRQ(IRQ_FTM1); -} - -void HAL_clear_reset_source() { } - -uint8_t HAL_get_reset_source() { - switch (RCM_SRS0) { - case 128: return RST_POWER_ON; break; - case 64: return RST_EXTERNAL; break; - case 32: return RST_WATCHDOG; break; - // case 8: return RST_LOSS_OF_LOCK; break; - // case 4: return RST_LOSS_OF_CLOCK; break; - // case 2: return RST_LOW_VOLTAGE; break; - } - return 0; -} - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - uint16_t pin = pin2sc1a[adc_pin]; - if (pin == 0xFF) { - // Digital only - HAL_adc_select = -1; - } - else if (pin & 0x80) { - HAL_adc_select = 1; - ADC1_SC1A = pin & 0x7F; - } - else { - HAL_adc_select = 0; - ADC0_SC1A = pin; - } -} - -uint16_t HAL_adc_get_result() { - switch (HAL_adc_select) { - case 0: return ADC0_RA; - case 1: return ADC1_RA; - } - return 0; -} - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h deleted file mode 100644 index 97763bf205..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -/** - * Description: HAL for Teensy 3.5 and Teensy 3.6 - */ - -#define CPU_32_BIT - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "watchdog.h" - -#include "timers.h" - -#include -#include - -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) - -// ------------------------ -// Defines -// ------------------------ - -#define IS_32BIT_TEENSY (defined(__MK64FX512__) || defined(__MK66FX1M0__)) -#define IS_TEENSY35 defined(__MK64FX512__) -#define IS_TEENSY36 defined(__MK66FX1M0__) - -#define NUM_SERIAL 1 - -#if SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif SERIAL_PORT == 0 - #define MYSERIAL0 Serial -#elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 -#endif - -#define HAL_SERVO_LIB libServo - -typedef int8_t pin_t; - -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_primask()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -#undef sq -#define sq(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*((void**)(addr))) -// Add type-checking to pgm_read_word -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - -inline void HAL_init() {} - -// Clear reset reason -void HAL_clear_reset_source(); - -// Reset reason -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(); -} -#pragma GCC diagnostic pop - -// ADC - -void HAL_adc_init(); - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true - -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_start_conversion(const uint8_t adc_pin); -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) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp deleted file mode 100644 index 44ab74cc9b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp +++ /dev/null @@ -1,120 +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 . - * - */ -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "HAL.h" -#include -#include -#include "spi_pins.h" -#include "../../core/macros.h" - -static SPISettings spiConfig; - -void spiBegin() { - #if !PIN_EXISTS(SS) - #error SS_PIN not defined! - #endif - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); - - #if 0 && DISABLED(SOFTWARE_SPI) - // set SS high - may be chip select for another SPI device - #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); - #endif - // set a default rate - spiInit(SPI_HALF_SPEED); // 1 - #endif -} - -void spiInit(uint8_t spiRate) { - // Use Marlin data-rates - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 10000000; break; - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 312500; break; - default: - clock = 4000000; // Default from the SPI libarary - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; - //SPDR = 0xFF; - //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - //return SPDR; -} - -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - SPI.transfer(buf, nbyte); - SPI.endTransaction(); - //if (nbyte-- == 0) return; - // SPDR = 0xFF; - //for (uint16_t i = 0; i < nbyte; i++) { - // while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - // buf[i] = SPDR; - // SPDR = 0xFF; - //} - //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } - //buf[nbyte] = SPDR; -} - -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); - //SPDR = b; - //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } -} - -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPDR = token; - for (uint16_t i = 0; i < 512; i += 2) { - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPDR = buf[i]; - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPDR = buf[i + 1]; - } - while (!TEST(SPSR, SPIF)) { /* nada */ }; - SPI.endTransaction(); -} - -// Begin SPI transaction, set clock, bit order, data mode -void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - spiConfig = SPISettings(spiClock, bitOrder, dataMode); - SPI.beginTransaction(spiConfig); -} - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp deleted file mode 100644 index d376b80a7d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp +++ /dev/null @@ -1,57 +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 . - * - */ -#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_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h deleted file mode 100644 index cafd323a38..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h +++ /dev/null @@ -1,37 +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 - -#include - -// Inherit and expand on core Servo library -class libServo : public Servo { - public: - int8_t attach(const int pin); - 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; - uint16_t max_ticks; - uint8_t servoIndex; // Index into the channel data for this servo -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h deleted file mode 100644 index 3862f2b5b8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h +++ /dev/null @@ -1,82 +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 - -/** - * Endstop Interrupts - * - * Without endstop interrupts the endstop pins must be polled continually in - * the temperature-ISR via endstops.update(), most of the time finding no change. - * With this feature endstops.update() is called only when we know that at - * least one endstop has changed state, saving valuable CPU cycles. - * - * This feature only works when all used endstop pins can generate an 'external interrupt'. - * - * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. - * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) - */ - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -/** - * Endstop interrupts for Due based targets. - * On Due, all pins support external interrupt capability. - */ -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) - #if HAS_X_MAX - _ATTACH(X_MAX_PIN); - #endif - #if HAS_X_MIN - _ATTACH(X_MIN_PIN); - #endif - #if HAS_Y_MAX - _ATTACH(Y_MAX_PIN); - #endif - #if HAS_Y_MIN - _ATTACH(Y_MIN_PIN); - #endif - #if HAS_Z_MAX - _ATTACH(Z_MAX_PIN); - #endif - #if HAS_Z_MIN - _ATTACH(Z_MIN_PIN); - #endif - #if HAS_Z2_MAX - _ATTACH(Z2_MAX_PIN); - #endif - #if HAS_Z2_MIN - _ATTACH(Z2_MIN_PIN); - #endif - #if HAS_Z3_MAX - _ATTACH(Z3_MAX_PIN); - #endif - #if HAS_Z3_MIN - _ATTACH(Z3_MIN_PIN); - #endif - #if HAS_Z_MIN_PROBE_PIN - _ATTACH(Z_MIN_PROBE_PIN); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h deleted file mode 100644 index d1b5f567d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h +++ /dev/null @@ -1,97 +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 - -/** - * Fast I/O Routines for Teensy 3.5 and Teensy 3.6 - * Use direct port manipulation to save scads of processor time. - * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. - */ - -#ifndef MASK - #define MASK(PIN) (1 << PIN) -#endif - -#define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) -#define GPIO_BITBAND(reg, bit) (*(uint32_t *)GPIO_BITBAND_ADDR((reg), (bit))) - -/** - * Magic I/O routines - * - * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); - * - * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html - */ - -#define _READ(P) bool(CORE_PIN ## P ## _PINREG & CORE_PIN ## P ## _BITMASK) - -#define _WRITE(P,V) do{ \ - if (V) CORE_PIN ## P ## _PORTSET = CORE_PIN ## P ## _BITMASK; \ - else CORE_PIN ## P ## _PORTCLEAR = CORE_PIN ## P ## _BITMASK; \ -}while(0) - -#define _TOGGLE(P) (*(&(CORE_PIN ## P ## _PORTCLEAR)+1) = CORE_PIN ## P ## _BITMASK) - -#define _SET_INPUT(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1); \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 0; \ -}while(0) - -#define _SET_OUTPUT(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1)|PORT_PCR_SRE|PORT_PCR_DSE; \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 1; \ -}while(0) - -#define _SET_INPUT_PULLUP(P) do{ \ - CORE_PIN ## P ## _CONFIG = PORT_PCR_MUX(1) | PORT_PCR_PE | PORT_PCR_PS; \ - GPIO_BITBAND(CORE_PIN ## P ## _DDRREG , CORE_PIN ## P ## _BIT) = 0; \ -}while(0) - -#define _IS_INPUT(P) ((CORE_PIN ## P ## _DDRREG & CORE_PIN ## P ## _BITMASK) == 0) -#define _IS_OUTPUT(P) ((CORE_PIN ## P ## _DDRREG & CORE_PIN ## P ## _BITMASK) == 0) - -#define READ(IO) _READ(IO) - -#define WRITE(IO,V) _WRITE(IO,V) -#define TOGGLE(IO) _TOGGLE(IO) - -#define SET_INPUT(IO) _SET_INPUT(IO) -#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO) -#define SET_OUTPUT(IO) _SET_OUTPUT(IO) -#define SET_PWM(IO) SET_OUTPUT(IO) - -#define IS_INPUT(IO) _IS_INPUT(IO) -#define IS_OUTPUT(IO) _IS_OUTPUT(IO) - -#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -#define PWM_PIN(P) digitalPinHasPWM(P) - -/** - * Ports, functions, and pins - */ - -#define DIO0_PIN 8 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h deleted file mode 100644 index 85f26f4016..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h +++ /dev/null @@ -1,22 +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 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h deleted file mode 100644 index 6a126b683e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h +++ /dev/null @@ -1,34 +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 - -/** - * Test TEENSY35_36 specific configuration values for errors at compile-time. - */ - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for Teensy 3.5/3.6. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp deleted file mode 100644 index 17934f71a3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" -#include - -bool PersistentStore::access_start() { return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h deleted file mode 100644 index db750cf6ec..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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 - -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin - -#define FTM0_CH0_PIN 22 -#define FTM0_CH1_PIN 23 -#define FTM0_CH2_PIN 9 -#define FTM0_CH3_PIN 10 -#define FTM0_CH4_PIN 6 -#define FTM0_CH5_PIN 20 -#define FTM0_CH6_PIN 21 -#define FTM0_CH7_PIN 5 -#define FTM1_CH0_PIN 3 -#define FTM1_CH1_PIN 4 -#define FTM2_CH0_PIN 29 -#define FTM2_CH1_PIN 30 -#define FTM3_CH0_PIN 2 -#define FTM3_CH1_PIN 14 -#define FTM3_CH2_PIN 7 -#define FTM3_CH3_PIN 8 -#define FTM3_CH4_PIN 35 -#define FTM3_CH5_PIN 36 -#define FTM3_CH6_PIN 37 -#define FTM3_CH7_PIN 38 -#ifdef __MK66FX1M0__ // Teensy3.6 - #define TPM1_CH0_PIN 16 - #define TPM1_CH1_PIN 17 -#endif - -#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(9)) || ((P) >= analogInputToDigitalPin(12) && (P) <= analogInputToDigitalPin(20)) - -void HAL_print_analog_pin(char buffer[], int8_t pin) { - if (pin <= 23) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 14)); - else if (pin <= 39) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 19)); -} - -void HAL_analog_pin_state(char buffer[], int8_t pin) { - if (pin <= 23) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 14)); - else if (pin <= 39) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 19)); -} - -#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), 22); SERIAL_ECHO(buffer); }while(0) -#define FTM_CASE(N,Z) \ - case FTM##N##_CH##Z##_PIN: \ - if (FTM##N##_C##Z##V) { \ - PWM_PRINT(FTM##N##_C##Z##V); \ - return true; \ - } else return false - -/** - * Print a pin's PWM status. - * Return true if it's currently a PWM pin. - */ -bool HAL_pwm_status(int8_t pin) { - char buffer[20]; // for the sprintf statements - switch (pin) { - FTM_CASE(0,0); - FTM_CASE(0,1); - FTM_CASE(0,2); - FTM_CASE(0,3); - FTM_CASE(0,4); - FTM_CASE(0,5); - FTM_CASE(0,6); - FTM_CASE(0,7); - FTM_CASE(1,0); - FTM_CASE(1,1); - FTM_CASE(2,0); - FTM_CASE(2,1); - FTM_CASE(3,0); - FTM_CASE(3,1); - FTM_CASE(3,2); - FTM_CASE(3,3); - FTM_CASE(3,4); - FTM_CASE(3,5); - FTM_CASE(3,6); - FTM_CASE(3,7); - - case NOT_ON_TIMER: - default: - return false; - } - SERIAL_ECHOPGM(" "); -} - -static void HAL_pwm_details(uint8_t pin) { /* TODO */ } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h deleted file mode 100644 index 9c6a83e3f8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h +++ /dev/null @@ -1,27 +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 - -#define SCK_PIN 13 -#define MISO_PIN 12 -#define MOSI_PIN 11 -#define SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp deleted file mode 100644 index 6bbc16dcb5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp +++ /dev/null @@ -1,115 +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 . - * - */ - -/** - * Teensy3.5 __MK64FX512__ - * Teensy3.6 __MK66FX1M0__ - */ - -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "HAL.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() { - __asm__ __volatile__("isb 0xF":::"memory"); -} - -/** \brief Data Synchronization Barrier - 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() { - __asm__ __volatile__("dsb 0xF":::"memory"); -} - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - switch (timer_num) { - case 0: - FTM0_MODE = FTM_MODE_WPDIS | FTM_MODE_FTMEN; - FTM0_SC = 0x00; // Set this to zero before changing the modulus - FTM0_CNT = 0x0000; // Reset the count to zero - FTM0_MOD = 0xFFFF; // max modulus = 65535 - FTM0_C0V = (FTM0_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value - FTM0_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM0_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 8 - FTM0_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; - break; - case 1: - FTM1_MODE = FTM_MODE_WPDIS | FTM_MODE_FTMEN; // Disable write protection, Enable FTM1 - FTM1_SC = 0x00; // Set this to zero before changing the modulus - FTM1_CNT = 0x0000; // Reset the count to zero - FTM1_MOD = 0xFFFF; // max modulus = 65535 - FTM1_C0V = (FTM1_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value 65535 - FTM1_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM1_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 4 - FTM1_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; - break; - } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_ENABLE_IRQ(IRQ_FTM0); break; - case 1: NVIC_ENABLE_IRQ(IRQ_FTM1); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case 0: NVIC_DISABLE_IRQ(IRQ_FTM0); break; - case 1: NVIC_DISABLE_IRQ(IRQ_FTM1); break; - } - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case 0: return NVIC_IS_ENABLED(IRQ_FTM0); - case 1: return NVIC_IS_ENABLED(IRQ_FTM1); - } - return false; -} - -void HAL_timer_isr_prologue(const uint8_t timer_num) { - switch (timer_num) { - case 0: - FTM0_CNT = 0x0000; - FTM0_SC &= ~FTM_SC_TOF; // Clear FTM Overflow flag - FTM0_C0SC &= ~FTM_CSC_CHF; // Clear FTM Channel Compare flag - break; - case 1: - FTM1_CNT = 0x0000; - FTM1_SC &= ~FTM_SC_TOF; // Clear FTM Overflow flag - FTM1_C0SC &= ~FTM_CSC_CHF; // Clear FTM Channel Compare flag - break; - } -} - -#endif // Teensy3.5 or Teensy3.6 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.h deleted file mode 100644 index 8ae51107c7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/timers.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 - -/** - * Description: HAL for - * Teensy3.5 (__MK64FX512__) - * Teensy3.6 (__MK66FX1M0__) - */ - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -typedef uint32_t hal_timer_t; -#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF - -#define FTM0_TIMER_PRESCALE 8 -#define FTM1_TIMER_PRESCALE 4 -#define FTM0_TIMER_PRESCALE_BITS 0b011 -#define FTM1_TIMER_PRESCALE_BITS 0b010 - -#define FTM0_TIMER_RATE (F_BUS / FTM0_TIMER_PRESCALE) // 60MHz / 8 = 7500kHz -#define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz - -#define HAL_TIMER_RATE (FTM0_TIMER_RATE) - -#define STEP_TIMER_NUM 0 -#define TEMP_TIMER_NUM 1 -#define PULSE_TIMER_NUM STEP_TIMER_NUM - -#define TEMP_TIMER_FREQUENCY 1000 - -#define STEPPER_TIMER_RATE HAL_TIMER_RATE -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) -#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#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 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); - -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { - switch (timer_num) { - case 0: FTM0_C0V = compare; break; - case 1: FTM1_C0V = compare; break; - } -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - switch (timer_num) { - case 0: return FTM0_C0V; - case 1: return FTM1_C0V; - } - return 0; -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { - switch (timer_num) { - case 0: return FTM0_CNT; - case 1: return FTM1_CNT; - } - return 0; -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp deleted file mode 100644 index f58217c750..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp +++ /dev/null @@ -1,39 +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 . - * - */ - -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -void watchdog_init() { - WDOG_TOVALH = 0; - WDOG_TOVALL = 4000; - WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; -} - -#endif // USE_WATCHDOG - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h deleted file mode 100644 index 7c27260906..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h +++ /dev/null @@ -1,30 +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 - -void watchdog_init(); - -inline void HAL_watchdog_refresh() { - // Watchdog refresh sequence - WDOG_REFRESH = 0xA602; - WDOG_REFRESH = 0xB480; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/platforms.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/platforms.h deleted file mode 100644 index e3e7f52cfa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/platforms.h +++ /dev/null @@ -1,52 +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 - -#ifdef __AVR__ - #define HAL_PLATFORM HAL_AVR -#elif defined(ARDUINO_ARCH_SAM) - #define HAL_PLATFORM HAL_DUE -#elif defined(__MK20DX256__) - #define HAL_PLATFORM HAL_TEENSY31_32 -#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) - #define HAL_PLATFORM HAL_TEENSY35_36 -#elif defined(TARGET_LPC1768) - #define HAL_PLATFORM HAL_LPC1768 -#elif defined(__STM32F1__) || defined(TARGET_STM32F1) - #define HAL_PLATFORM HAL_STM32F1 -#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - #define HAL_PLATFORM HAL_STM32_F4_F7 -#elif defined(ARDUINO_ARCH_STM32) - #define HAL_PLATFORM HAL_STM32 -#elif defined(ARDUINO_ARCH_ESP32) - #define HAL_PLATFORM HAL_ESP32 -#elif defined(__PLAT_LINUX__) - #define HAL_PLATFORM HAL_LINUX -#elif defined(__SAMD51__) - #define HAL_PLATFORM HAL_SAMD51 -#else - #error "Unsupported Platform!" -#endif - -#define XSTR_(M) #M -#define XSTR(M) XSTR_(M) -#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL_PLATFORM/NAME) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Delay.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Delay.h deleted file mode 100644 index b1dafbb0f5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Delay.h +++ /dev/null @@ -1,176 +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 - -/** - * Busy wait delay cycles routines: - * - * DELAY_CYCLES(count): Delay execution in cycles - * DELAY_NS(count): Delay execution in nanoseconds - * DELAY_US(count): Delay execution in microseconds - */ - -#include "../../core/millis_t.h" -#include "../../core/macros.h" - -#if defined(__arm__) || defined(__thumb__) - - #if __CORTEX_M == 7 - - // Cortex-M3 through M7 can use the cycle counter of the DWT unit - // http://www.anthonyvh.com/2017/05/18/cortex_m-cycle_counter/ - - FORCE_INLINE static void enableCycleCounter() { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - - #if __CORTEX_M == 7 - DWT->LAR = 0xC5ACCE55; // Unlock DWT on the M7 - #endif - - DWT->CYCCNT = 0; - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } - - FORCE_INLINE volatile uint32_t getCycleCount() { return DWT->CYCCNT; } - - FORCE_INLINE static void DELAY_CYCLES(const uint32_t x) { - const uint32_t endCycles = getCycleCount() + x; - while (PENDING(getCycleCount(), endCycles)) {} - } - - #else - - // https://blueprints.launchpad.net/gcc-arm-embedded/+spec/delay-cycles - - #define nop() __asm__ __volatile__("nop;\n\t":::) - - FORCE_INLINE static void __delay_4cycles(uint32_t cy) { // +1 cycle - #if ARCH_PIPELINE_RELOAD_CYCLES < 2 - #define EXTRA_NOP_CYCLES A("nop") - #else - #define EXTRA_NOP_CYCLES "" - #endif - - __asm__ __volatile__( - A(".syntax unified") // is to prevent CM0,CM1 non-unified syntax - L("1") - A("subs %[cnt],#1") - EXTRA_NOP_CYCLES - A("bne 1b") - : [cnt]"+r"(cy) // output: +r means input+output - : // input: - : "cc" // clobbers: - ); - } - - // Delay in cycles - FORCE_INLINE static void DELAY_CYCLES(uint32_t x) { - - if (__builtin_constant_p(x)) { - #define MAXNOPS 4 - - if (x <= (MAXNOPS)) { - switch (x) { case 4: nop(); case 3: nop(); case 2: nop(); case 1: nop(); } - } - else { // because of +1 cycle inside delay_4cycles - const uint32_t rem = (x - 1) % (MAXNOPS); - switch (rem) { case 3: nop(); case 2: nop(); case 1: nop(); } - if ((x = (x - 1) / (MAXNOPS))) - __delay_4cycles(x); // if need more then 4 nop loop is more optimal - } - #undef MAXNOPS - } - else if ((x >>= 2)) - __delay_4cycles(x); - } - #undef nop - - #endif - -#elif defined(__AVR__) - - #define nop() __asm__ __volatile__("nop;\n\t":::) - - FORCE_INLINE static void __delay_4cycles(uint8_t cy) { - __asm__ __volatile__( - L("1") - A("dec %[cnt]") - A("nop") - A("brne 1b") - : [cnt] "+r"(cy) // output: +r means input+output - : // input: - : "cc" // clobbers: - ); - } - - // Delay in cycles - FORCE_INLINE static void DELAY_CYCLES(uint16_t x) { - - if (__builtin_constant_p(x)) { - #define MAXNOPS 4 - - if (x <= (MAXNOPS)) { - switch (x) { case 4: nop(); case 3: nop(); case 2: nop(); case 1: nop(); } - } - else { - const uint32_t rem = (x) % (MAXNOPS); - switch (rem) { case 3: nop(); case 2: nop(); case 1: nop(); } - if ((x = (x) / (MAXNOPS))) - __delay_4cycles(x); // if need more then 4 nop loop is more optimal - } - - #undef MAXNOPS - } - else if ((x >>= 2)) - __delay_4cycles(x); - } - #undef nop - -#elif defined(ESP32) - - FORCE_INLINE static void DELAY_CYCLES(uint32_t x) { - unsigned long ccount, stop; - - __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) ); - - stop = ccount + x; // This can overflow - - while (ccount < stop) { // This doesn't deal with overflows - __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) ); - } - } - -#elif defined(__PLAT_LINUX__) - - // specified inside platform - -#else - - #error "Unsupported MCU architecture" - -#endif - -// Delay in nanoseconds -#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) / 1000UL ) - -// Delay in microseconds -#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) ) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_SPI.h deleted file mode 100644 index d805207047..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_SPI.h +++ /dev/null @@ -1,93 +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 - -/** - * HAL/shared/HAL_SPI.h - * Core Marlin definitions for SPI, implemented in the HALs - */ - -#include "Marduino.h" -#include - -/** - * SPI speed where 0 <= index <= 6 - * - * Approximate rates : - * - * 0 : 8 - 10 MHz - * 1 : 4 - 5 MHz - * 2 : 2 - 2.5 MHz - * 3 : 1 - 1.25 MHz - * 4 : 500 - 625 kHz - * 5 : 250 - 312 kHz - * 6 : 125 - 156 kHz - * - * On AVR, actual speed is F_CPU/2^(1 + index). - * On other platforms, speed should be in range given above where possible. - */ - -#define SPI_FULL_SPEED 0 // Set SCK to max rate -#define SPI_HALF_SPEED 1 // Set SCK rate to half of max rate -#define SPI_QUARTER_SPEED 2 // Set SCK rate to quarter of max rate -#define SPI_EIGHTH_SPEED 3 // Set SCK rate to 1/8 of max rate -#define SPI_SIXTEENTH_SPEED 4 // Set SCK rate to 1/16 of max rate -#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(); - -// Configure SPI for specified SPI speed -void spiInit(uint8_t spiRate); - -// Write single byte to SPI -void spiSend(uint8_t b); - -// 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) -void spiSendBlock(uint8_t token, const uint8_t* buf); - -// 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_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_ST7920.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_ST7920.h deleted file mode 100644 index de40ade5ab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_ST7920.h +++ /dev/null @@ -1,36 +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 - -/** - * HAL/HAL_ST7920.h - * For the HALs that provide direct access to the ST7920 display - * (bypassing U8G), it will allow the LIGHTWEIGHT_UI to operate. - */ - -#if HAS_GRAPHICAL_LCD && ENABLED(LIGHTWEIGHT_UI) - void ST7920_cs(); - void ST7920_ncs(); - void ST7920_set_cmd(); - void ST7920_set_dat(); - void ST7920_write_byte(const uint8_t data); -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_spi_L6470.cpp deleted file mode 100644 index 936acc7ce8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ /dev/null @@ -1,128 +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 . - * - */ - -/** - * Software L6470 SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "Delay.h" - -#include "../../core/serial.h" -#include "../../libs/L6470/L6470_Marlin.h" - -// Make sure GCC optimizes this file. -// Note that this line triggers a bug in GCC which is fixed by casting. -// See the note below. -#pragma GCC optimize (3) - -// run at ~4Mhz -uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0 - for (uint8_t bits = 8; bits--;) { - WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); - b <<= 1; // little setup time - - WRITE(L6470_CHAIN_SCK_PIN, HIGH); - DELAY_NS(125); // 10 cycles @ 84mhz - - b |= (READ(L6470_CHAIN_MISO_PIN) != 0); - - WRITE(L6470_CHAIN_SCK_PIN, LOW); - DELAY_NS(125); // 10 cycles @ 84mhz - } - return b; -} - -uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 - for (uint8_t bits = 8; bits--;) { - WRITE(L6470_CHAIN_SCK_PIN, LOW); - WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); - - DELAY_NS(125); // 10 cycles @ 84mhz - - WRITE(L6470_CHAIN_SCK_PIN, HIGH); - - b <<= 1; // little setup time - b |= (READ(L6470_CHAIN_MISO_PIN) != 0); - } - - DELAY_NS(125); // 10 cycles @ 84mhz - return b; -} - -/** - * The following are weak-linked and defined as do-nothing - * functions by the L6470-Arduino library. They must be - * defined by the client (Marlin) to provide an SPI interface. - */ - -uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) { - uint8_t data_out = 0; - - // first device in chain has data sent last - extDigitalWrite(ss_pin, LOW); - - for (uint8_t i = L6470::chain[0]; (i >= 1) && !spi_abort; i--) { // stop sending data if spi_abort is active - DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips) - uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP)); - ENABLE_ISRS(); // enable interrupts - if (i == chain_position) data_out = temp; - } - - extDigitalWrite(ss_pin, HIGH); - return data_out; -} - -void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) { - // first device in chain has data sent last - - if (spi_active) { // interrupted SPI transfer so need to - WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650nS - DELAY_US(1); - } - - WRITE(L6470_CHAIN_SS_PIN, LOW); - for (uint8_t i = length; i >= 1; i--) - L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i])); - WRITE(L6470_CHAIN_SS_PIN, HIGH); -} - -void L6470_spi_init() { - OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); - SET_INPUT(L6470_CHAIN_MISO_PIN); - - #if PIN_EXISTS(L6470_BUSY) - SET_INPUT(L6470_BUSY_PIN); - #endif - - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); -} - -#pragma GCC reset_options - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Marduino.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Marduino.h deleted file mode 100644 index a2de03a2b6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/Marduino.h +++ /dev/null @@ -1,85 +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 - -/** - * HAL/shared/Marduino.h - */ - -#undef DISABLED // Redefined by ESP32 -#undef M_PI // Redefined by all -#undef _BV // Redefined by some -#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 - -#undef DISABLED -#define DISABLED(V...) DO(DIS,&&,V) - -#undef _BV -#define _BV(b) (1UL << (b)) - -#undef sq -#define sq(x) ((x)*(x)) - -#ifndef SBI - #define SBI(A,B) (A |= (1 << (B))) -#endif - -#ifndef CBI - #define CBI(A,B) (A &= ~(1 << (B))) -#endif - -#ifndef __AVR__ - #ifndef strchr_P // Some platforms define a macro (DUE, teensy35) - inline const char* strchr_P(const char *s, int c) { return strchr(s,c); } - //#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 -#endif - -// Restart causes -#define RST_POWER_ON 1 -#define RST_EXTERNAL 2 -#define RST_BROWN_OUT 4 -#define RST_WATCHDOG 8 -#define RST_JTAG 16 -#define RST_SOFTWARE 32 -#define RST_BACKUP 64 - -#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_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/MarlinSerial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/MarlinSerial.h deleted file mode 100644 index afbd7d3443..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/MarlinSerial.h +++ /dev/null @@ -1,60 +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 - -/** - * HAL/shared/MarlinSerial.h - */ - -#include "../../inc/MarlinConfigPre.h" - -constexpr bool - bSERIAL_XON_XOFF = (false - #if ENABLED(SERIAL_XON_XOFF) - || true - #endif - ), - bEMERGENCY_PARSER = (false - #if ENABLED(EMERGENCY_PARSER) - || true - #endif - ), - bSERIAL_STATS_DROPPED_RX = (false - #if ENABLED(SERIAL_STATS_DROPPED_RX) - || true - #endif - ), - bSERIAL_STATS_RX_BUFFER_OVERRUNS = (false - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - || true - #endif - ), - bSERIAL_STATS_RX_FRAMING_ERRORS = (false - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - || true - #endif - ), - bSERIAL_STATS_MAX_RX_QUEUED = (false - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - || true - #endif - ); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.cpp deleted file mode 100644 index 7a8377f789..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ /dev/null @@ -1,99 +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 . - * - */ - -#if defined(__arm__) || defined(__thumb__) - -#include "backtrace.h" -#include "unwinder.h" -#include "unwmemaccess.h" - -#include "../../../core/serial.h" -#include - -// Dump a backtrace entry -static bool UnwReportOut(void* ctx, const UnwReport* bte) { - int *p = (int*)ctx; - - (*p)++; - - SERIAL_CHAR('#'); SERIAL_PRINT(*p,DEC); SERIAL_ECHOPGM(" : "); - SERIAL_ECHOPGM(bte->name ? bte->name : "unknown"); SERIAL_ECHOPGM("@0x"); SERIAL_PRINT(bte->function, HEX); - SERIAL_CHAR('+'); SERIAL_PRINT(bte->address - bte->function,DEC); - SERIAL_ECHOPGM(" PC:"); SERIAL_PRINT(bte->address,HEX); SERIAL_CHAR('\n'); - return true; -} - -#ifdef UNW_DEBUG - void UnwPrintf(const char* format, ...) { - char dest[256]; - va_list argptr; - va_start(argptr, format); - vsprintf(dest, format, argptr); - va_end(argptr); - TX(&dest[0]); - } -#endif - -/* Table of function pointers for passing to the unwinder */ -static const UnwindCallbacks UnwCallbacks = { - UnwReportOut, - UnwReadW, - UnwReadH, - UnwReadB - #ifdef UNW_DEBUG - , UnwPrintf - #endif -}; - -void backtrace() { - - UnwindFrame btf; - uint32_t sp = 0, lr = 0, pc = 0; - - // Capture the values of the registers to perform the traceback - __asm__ __volatile__ ( - " mov %[lrv],lr\n" - " mov %[spv],sp\n" - " mov %[pcv],pc\n" - : [spv]"+r"( sp ), - [lrv]"+r"( lr ), - [pcv]"+r"( pc ) - :: - ); - - // Fill the traceback structure - btf.sp = sp; - btf.fp = btf.sp; - btf.lr = lr; - btf.pc = pc | 1; // Force Thumb, as CORTEX only support it - - // Perform a backtrace - SERIAL_ERROR_MSG("Backtrace:"); - int ctr = 0; - UnwindStart(&btf, &UnwCallbacks, &ctr); -} - -#else // !__arm__ && !__thumb__ - -void backtrace() {} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.h deleted file mode 100644 index a2b8eae594..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/backtrace.h +++ /dev/null @@ -1,25 +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 - -// Perform a backtrace to the serial port -void backtrace(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.cpp deleted file mode 100644 index cdc9c06c61..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commercially or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Utility functions and glue for ARM unwinding sub-modules. - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) - -#define MODULE_NAME "UNWARM" - -#include -#include -#include -#include -#include "unwarm.h" -#include "unwarmmem.h" - -#ifdef UNW_DEBUG - -/** - * Printf wrapper. - * This is used such that alternative outputs for any output can be selected - * by modification of this wrapper function. - */ -void UnwPrintf(const char *format, ...) { - va_list args; - - va_start( args, format ); - vprintf(format, args ); -} -#endif - -/** - * Invalidate all general purpose registers. - */ -void UnwInvalidateRegisterFile(RegData *regFile) { - uint8_t t = 0; - do { - regFile[t].o = REG_VAL_INVALID; - t++; - } while (t < 13); -} - - -/** - * Initialize the data used for unwinding. - */ -void UnwInitState(UnwState * const state, /**< Pointer to structure to fill. */ - const UnwindCallbacks *cb, /**< Callbacks. */ - void *rptData, /**< Data to pass to report function. */ - uint32_t pcValue, /**< PC at which to start unwinding. */ - uint32_t spValue) { /**< SP at which to start unwinding. */ - - UnwInvalidateRegisterFile(state->regData); - - /* Store the pointer to the callbacks */ - state->cb = cb; - state->reportData = rptData; - - /* Setup the SP and PC */ - state->regData[13].v = spValue; - state->regData[13].o = REG_VAL_FROM_CONST; - state->regData[15].v = pcValue; - state->regData[15].o = REG_VAL_FROM_CONST; - - UnwPrintd3("\nInitial: PC=0x%08x SP=0x%08x\n", pcValue, spValue); - - /* Invalidate all memory addresses */ - memset(state->memData.used, 0, sizeof(state->memData.used)); -} - -// Detect if function names are available -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; -} - -/** - * Call the report function to indicate some return address. - * This returns the value of the report function, which if true - * indicates that unwinding may continue. - */ -bool UnwReportRetAddr(UnwState * const state, uint32_t addr) { - - UnwReport entry; - - // We found two acceptable values. - entry.name = nullptr; - entry.address = addr & 0xFFFFFFFE; // Remove Thumb bit - entry.function = 0; - - // If there are function names, try to solve name - if (has_function_names()) { - - // Lets find the function name, if possible - - // Align address to 4 bytes - uint32_t pf = addr & (-4); - - // Scan backwards until we find the function name - uint32_t v; - while (state->cb->readW(pf-4,&v)) { - - // Check if name descriptor is valid - if ((v & 0xFFFFFF00) == 0xFF000000 && (v & 0xFF) > 1) { - // Assume the name was found! - entry.name = ((const char*)pf) - 4 - (v & 0xFF); - entry.function = pf; - break; - } - - // Go backwards to the previous word - pf -= 4; - } - } - - /* Cast away const from reportData. - * The const is only to prevent the unw module modifying the data. - */ - return state->cb->report((void *)state->reportData, &entry); -} - - -/** - * Write some register to memory. - * This will store some register and meta data onto the virtual stack. - * The address for the write - * \param state [in/out] The unwinding state. - * \param wAddr [in] The address at which to write the data. - * \param reg [in] The register to store. - * \return true if the write was successful, false otherwise. - */ -bool UnwMemWriteRegister(UnwState * const state, const uint32_t addr, const RegData * const reg) { - return UnwMemHashWrite(&state->memData, addr, reg->v, M_IsOriginValid(reg->o)); -} - -/** - * Read a register from memory. - * This will read a register from memory, and setup the meta data. - * If the register has been previously written to memory using - * UnwMemWriteRegister, the local hash will be used to return the - * value while respecting whether the data was valid or not. If the - * register was previously written and was invalid at that point, - * REG_VAL_INVALID will be returned in *reg. - * \param state [in] The unwinding state. - * \param addr [in] The address to read. - * \param reg [out] The result, containing the data value and the origin - * which will be REG_VAL_FROM_MEMORY, or REG_VAL_INVALID. - * \return true if the address could be read and *reg has been filled in. - * false is the data could not be read. - */ -bool UnwMemReadRegister(UnwState * const state, const uint32_t addr, RegData * const reg) { - bool tracked; - - // Check if the value can be found in the hash - if (UnwMemHashRead(&state->memData, addr, ®->v, &tracked)) { - reg->o = tracked ? REG_VAL_FROM_MEMORY : REG_VAL_INVALID; - return true; - } - else if (state->cb->readW(addr, ®->v)) { // Not in the hash, so read from real memory - reg->o = REG_VAL_FROM_MEMORY; - return true; - } - else return false; // Not in the hash, and failed to read from memory -} - -#endif // __arm__ || __thumb__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.h deleted file mode 100644 index 3128e354cc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm.h +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Internal interface between the ARM unwinding sub-modules. - **************************************************************************/ - -#pragma once - -#include "unwinder.h" - -/** The maximum number of instructions to interpet in a function. - * Unwinding will be unconditionally stopped and UNWIND_EXHAUSTED returned - * if more than this number of instructions are interpreted in a single - * function without unwinding a stack frame. This prevents infinite loops - * or corrupted program memory from preventing unwinding from progressing. - */ -#define UNW_MAX_INSTR_COUNT 500 - -/** The size of the hash used to track reads and writes to memory. - * This should be a prime value for efficiency. - */ -#define MEM_HASH_SIZE 31 - -/*************************************************************************** - * Type Definitions - **************************************************************************/ - -typedef enum { - /** Invalid value. */ - REG_VAL_INVALID = 0x00, - REG_VAL_FROM_STACK = 0x01, - REG_VAL_FROM_MEMORY = 0x02, - REG_VAL_FROM_CONST = 0x04, - REG_VAL_ARITHMETIC = 0x80 -} RegValOrigin; - - -/** Type for tracking information about a register. - * This stores the register value, as well as other data that helps unwinding. - */ -typedef struct { - - /** The value held in the register. */ - uint32_t v; - - /** The origin of the register value. - * This is used to track how the value in the register was loaded. - */ - int o; /* (RegValOrigin) */ -} RegData; - - -/** Structure used to track reads and writes to memory. - * This structure is used as a hash to store a small number of writes - * to memory. - */ -typedef struct { - /** Memory contents. */ - uint32_t v[MEM_HASH_SIZE]; - - /** Address at which v[n] represents. */ - uint32_t a[MEM_HASH_SIZE]; - - /** Indicates whether the data in v[n] and a[n] is occupied. - * Each bit represents one hash value. - */ - uint8_t used[(MEM_HASH_SIZE + 7) / 8]; - - /** Indicates whether the data in v[n] is valid. - * This allows a[n] to be set, but for v[n] to be marked as invalid. - * Specifically this is needed for when an untracked register value - * is written to memory. - */ - uint8_t tracked[(MEM_HASH_SIZE + 7) / 8]; -} MemData; - - -/** Structure that is used to keep track of unwinding meta-data. - * This data is passed between all the unwinding functions. - */ -typedef struct { - /** The register values and meta-data. */ - RegData regData[16]; - - /** Memory tracking data. */ - MemData memData; - - /** Pointer to the callback functions */ - const UnwindCallbacks *cb; - - /** Pointer to pass to the report function. */ - const void *reportData; -} UnwState; - -/*************************************************************************** - * Macros - **************************************************************************/ - -#define M_IsOriginValid(v) !!((v) & 0x7F) -#define M_Origin2Str(v) ((v) ? "VALID" : "INVALID") - -#ifdef UNW_DEBUG -#define UnwPrintd1(a) state->cb->printf(a) -#define UnwPrintd2(a,b) state->cb->printf(a,b) -#define UnwPrintd3(a,b,c) state->cb->printf(a,b,c) -#define UnwPrintd4(a,b,c,d) state->cb->printf(a,b,c,d) -#define UnwPrintd5(a,b,c,d,e) state->cb->printf(a,b,c,d,e) -#define UnwPrintd6(a,b,c,d,e,f) state->cb->printf(a,b,c,d,e,f) -#define UnwPrintd7(a,b,c,d,e,f,g) state->cb->printf(a,b,c,d,e,f,g) -#define UnwPrintd8(a,b,c,d,e,f,g,h) state->cb->printf(a,b,c,d,e,f,g,h) -#else -#define UnwPrintd1(a) -#define UnwPrintd2(a,b) -#define UnwPrintd3(a,b,c) -#define UnwPrintd4(a,b,c,d) -#define UnwPrintd5(a,b,c,d,e) -#define UnwPrintd6(a,b,c,d,e,f) -#define UnwPrintd7(a,b,c,d,e,f,g) -#define UnwPrintd8(a,b,c,d,e,f,g,h) -#endif - -/*************************************************************************** - * Function Prototypes - **************************************************************************/ - -UnwResult UnwStartArm(UnwState * const state); -UnwResult UnwStartThumb(UnwState * const state); -void UnwInvalidateRegisterFile(RegData *regFile); -void UnwInitState(UnwState * const state, const UnwindCallbacks *cb, void *rptData, uint32_t pcValue, uint32_t spValue); -bool UnwReportRetAddr(UnwState * const state, uint32_t addr); -bool UnwMemWriteRegister(UnwState * const state, const uint32_t addr, const RegData * const reg); -bool UnwMemReadRegister(UnwState * const state, const uint32_t addr, RegData * const reg); -void UnwMemHashGC(UnwState * const state); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp deleted file mode 100644 index 0ec9bd56af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp +++ /dev/null @@ -1,535 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commercially or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Abstract interpreter for ARM mode. - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) - -#define MODULE_NAME "UNWARM_ARM" - -#include -#include "unwarm.h" - -/** Check if some instruction is a data-processing instruction. - * Decodes the passed instruction, checks if it is a data-processing and - * verifies that the parameters and operation really indicate a data- - * processing instruction. This is needed because some parts of the - * instruction space under this instruction can be extended or represent - * other operations such as MRS, MSR. - * - * \param[in] inst The instruction word. - * \retval true Further decoding of the instruction indicates that this is - * a valid data-processing instruction. - * \retval false This is not a data-processing instruction, - */ -static bool isDataProc(uint32_t instr) { - uint8_t opcode = (instr & 0x01E00000) >> 21; - if ((instr & 0xFC000000) != 0xE0000000) return false; - - /* TST, TEQ, CMP and CMN all require S to be set */ - bool S = !!(instr & 0x00100000); - if (!S && opcode >= 8 && opcode <= 11) return false; - - return true; -} - -UnwResult UnwStartArm(UnwState * const state) { - bool found = false; - uint16_t t = UNW_MAX_INSTR_COUNT; - - do { - uint32_t instr; - - /* Attempt to read the instruction */ - if (!state->cb->readW(state->regData[15].v, &instr)) - return UNWIND_IREAD_W_FAIL; - - UnwPrintd4("A %x %x %08x:", state->regData[13].v, state->regData[15].v, instr); - - /* Check that the PC is still on Arm alignment */ - if (state->regData[15].v & 0x3) { - UnwPrintd1("\nError: PC misalignment\n"); - return UNWIND_INCONSISTENT; - } - - /* Check that the SP and PC have not been invalidated */ - if (!M_IsOriginValid(state->regData[13].o) || !M_IsOriginValid(state->regData[15].o)) { - UnwPrintd1("\nError: PC or SP invalidated\n"); - return UNWIND_INCONSISTENT; - } - - /* Branch and Exchange (BX) - * This is tested prior to data processing to prevent - * mis-interpretation as an invalid TEQ instruction. - */ - if ((instr & 0xFFFFFFF0) == 0xE12FFF10) { - uint8_t rn = instr & 0xF; - - UnwPrintd4("BX r%d\t ; r%d %s\n", rn, rn, M_Origin2Str(state->regData[rn].o)); - - if (!M_IsOriginValid(state->regData[rn].o)) { - UnwPrintd1("\nUnwind failure: BX to untracked register\n"); - return UNWIND_FAILURE; - } - - /* Set the new PC value */ - state->regData[15].v = state->regData[rn].v; - - /* Check if the return value is from the stack */ - if (state->regData[rn].o == REG_VAL_FROM_STACK) { - - /* Now have the return address */ - UnwPrintd2(" Return PC=%x\n", state->regData[15].v & (~0x1)); - - /* Report the return address */ - if (!UnwReportRetAddr(state, state->regData[rn].v)) - return UNWIND_TRUNCATED; - } - - /* Determine the return mode */ - if (state->regData[rn].v & 0x1) /* Branching to THUMB */ - return UnwStartThumb(state); - - /* Branch to ARM */ - /* Account for the auto-increment which isn't needed */ - state->regData[15].v -= 4; - } - /* Branch */ - else if ((instr & 0xFF000000) == 0xEA000000) { - - int32_t offset = (instr & 0x00FFFFFF) << 2; - - /* Sign extend if needed */ - if (offset & 0x02000000) offset |= 0xFC000000; - - UnwPrintd2("B %d\n", offset); - - /* Adjust PC */ - state->regData[15].v += offset; - - /* Account for pre-fetch, where normally the PC is 8 bytes - * ahead of the instruction just executed. - */ - state->regData[15].v += 4; - } - - /* MRS */ - else if ((instr & 0xFFBF0FFF) == 0xE10F0000) { - uint8_t rd = (instr & 0x0000F000) >> 12; - #ifdef UNW_DEBUG - const bool R = !!(instr & 0x00400000); - UnwPrintd4("MRS r%d,%s\t; r%d invalidated", rd, R ? "SPSR" : "CPSR", rd); - #endif - - /* Status registers untracked */ - state->regData[rd].o = REG_VAL_INVALID; - } - /* MSR */ - else if ((instr & 0xFFB0F000) == 0xE120F000) { - #ifdef UNW_DEBUG - UnwPrintd2("MSR %s_?, ???", (instr & 0x00400000) ? "SPSR" : "CPSR"); - #endif - - /* Status registers untracked. - * Potentially this could change processor mode and switch - * banked registers r8-r14. Most likely is that r13 (sp) will - * be banked. However, invalidating r13 will stop unwinding - * when potentially this write is being used to disable/enable - * interrupts (a common case). Therefore no invalidation is - * performed. - */ - } - /* Data processing */ - else if (isDataProc(instr)) { - bool I = !!(instr & 0x02000000); - uint8_t opcode = (instr & 0x01E00000) >> 21; - #ifdef UNW_DEBUG - bool S = !!(instr & 0x00100000); - #endif - uint8_t rn = (instr & 0x000F0000) >> 16; - uint8_t rd = (instr & 0x0000F000) >> 12; - uint16_t operand2 = (instr & 0x00000FFF); - uint32_t op2val; - int op2origin; - - switch (opcode) { - case 0: UnwPrintd4("AND%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 1: UnwPrintd4("EOR%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 2: UnwPrintd4("SUB%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 3: UnwPrintd4("RSB%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 4: UnwPrintd4("ADD%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 5: UnwPrintd4("ADC%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 6: UnwPrintd4("SBC%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 7: UnwPrintd4("RSC%s r%d,r%d,", S ? "S" : "", rd, rn); break; - case 8: UnwPrintd3("TST%s r%d,", S ? "S" : "", rn); break; - case 9: UnwPrintd3("TEQ%s r%d,", S ? "S" : "", rn); break; - case 10: UnwPrintd3("CMP%s r%d,", S ? "S" : "", rn); break; - case 11: UnwPrintd3("CMN%s r%d,", S ? "S" : "", rn); break; - case 12: UnwPrintd3("ORR%s r%d,", S ? "S" : "", rn); break; - case 13: UnwPrintd3("MOV%s r%d,", S ? "S" : "", rd); break; - case 14: UnwPrintd4("BIC%s r%d,r%d", S ? "S" : "", rd, rn); break; - case 15: UnwPrintd3("MVN%s r%d,", S ? "S" : "", rd); break; - } - - /* Decode operand 2 */ - if (I) { - uint8_t shiftDist = (operand2 & 0x0F00) >> 8; - uint8_t shiftConst = (operand2 & 0x00FF); - - /* rotate const right by 2 * shiftDist */ - shiftDist *= 2; - op2val = (shiftConst >> shiftDist) | - (shiftConst << (32 - shiftDist)); - op2origin = REG_VAL_FROM_CONST; - - UnwPrintd2("#0x%x", op2val); - } - else { - - /* Register and shift */ - uint8_t rm = (operand2 & 0x000F); - uint8_t regShift = !!(operand2 & 0x0010); - uint8_t shiftType = (operand2 & 0x0060) >> 5; - uint32_t shiftDist; - #ifdef UNW_DEBUG - const char * const shiftMnu[4] = { "LSL", "LSR", "ASR", "ROR" }; - #endif - UnwPrintd2("r%d ", rm); - - /* Get the shift distance */ - if (regShift) { - uint8_t rs = (operand2 & 0x0F00) >> 8; - - if (operand2 & 0x00800) { - UnwPrintd1("\nError: Bit should be zero\n"); - return UNWIND_ILLEGAL_INSTR; - } - else if (rs == 15) { - UnwPrintd1("\nError: Cannot use R15 with register shift\n"); - return UNWIND_ILLEGAL_INSTR; - } - - /* Get shift distance */ - shiftDist = state->regData[rs].v; - op2origin = state->regData[rs].o; - - UnwPrintd7("%s r%d\t; r%d %s r%d %s", shiftMnu[shiftType], rs, rm, M_Origin2Str(state->regData[rm].o), rs, M_Origin2Str(state->regData[rs].o)); - } - else { - shiftDist = (operand2 & 0x0F80) >> 7; - op2origin = REG_VAL_FROM_CONST; - if (shiftDist) UnwPrintd3("%s #%d", shiftMnu[shiftType], shiftDist); - UnwPrintd3("\t; r%d %s", rm, M_Origin2Str(state->regData[rm].o)); - } - - /* Apply the shift type to the source register */ - switch (shiftType) { - case 0: /* logical left */ - op2val = state->regData[rm].v << shiftDist; - break; - - case 1: /* logical right */ - if (!regShift && shiftDist == 0) shiftDist = 32; - op2val = state->regData[rm].v >> shiftDist; - break; - - case 2: /* arithmetic right */ - if (!regShift && shiftDist == 0) shiftDist = 32; - - if (state->regData[rm].v & 0x80000000) { - /* Register shifts maybe greater than 32 */ - if (shiftDist >= 32) - op2val = 0xFFFFFFFF; - else - op2val = (state->regData[rm].v >> shiftDist) | (0xFFFFFFFF << (32 - shiftDist)); - } - else - op2val = state->regData[rm].v >> shiftDist; - break; - - case 3: /* rotate right */ - - if (!regShift && shiftDist == 0) { - /* Rotate right with extend. - * This uses the carry bit and so always has an - * untracked result. - */ - op2origin = REG_VAL_INVALID; - op2val = 0; - } - else { - /* Limit shift distance to 0-31 incase of register shift */ - shiftDist &= 0x1F; - - op2val = (state->regData[rm].v >> shiftDist) | - (state->regData[rm].v << (32 - shiftDist)); - } - break; - - default: - UnwPrintd2("\nError: Invalid shift type: %d\n", shiftType); - return UNWIND_FAILURE; - } - - /* Decide the data origin */ - if (M_IsOriginValid(op2origin) && M_IsOriginValid(state->regData[rm].o)) - op2origin = REG_VAL_ARITHMETIC | state->regData[rm].o; - else - op2origin = REG_VAL_INVALID; - } - - /* Propagate register validity */ - switch (opcode) { - case 0: /* AND: Rd := Op1 AND Op2 */ - case 1: /* EOR: Rd := Op1 EOR Op2 */ - case 2: /* SUB: Rd:= Op1 - Op2 */ - case 3: /* RSB: Rd:= Op2 - Op1 */ - case 4: /* ADD: Rd:= Op1 + Op2 */ - case 12: /* ORR: Rd:= Op1 OR Op2 */ - case 14: /* BIC: Rd:= Op1 AND NOT Op2 */ - if (!M_IsOriginValid(state->regData[rn].o) || - !M_IsOriginValid(op2origin)) { - state->regData[rd].o = REG_VAL_INVALID; - } - else { - state->regData[rd].o = state->regData[rn].o; - state->regData[rd].o = (RegValOrigin)(state->regData[rd].o | op2origin); - } - break; - - case 5: /* ADC: Rd:= Op1 + Op2 + C */ - case 6: /* SBC: Rd:= Op1 - Op2 + C */ - case 7: /* RSC: Rd:= Op2 - Op1 + C */ - /* CPSR is not tracked */ - state->regData[rd].o = REG_VAL_INVALID; - break; - - case 8: /* TST: set condition codes on Op1 AND Op2 */ - case 9: /* TEQ: set condition codes on Op1 EOR Op2 */ - case 10: /* CMP: set condition codes on Op1 - Op2 */ - case 11: /* CMN: set condition codes on Op1 + Op2 */ - break; - - case 13: /* MOV: Rd:= Op2 */ - case 15: /* MVN: Rd:= NOT Op2 */ - state->regData[rd].o = (RegValOrigin) op2origin; - break; - } - - /* Account for pre-fetch by temporarily adjusting PC */ - if (rn == 15) { - - /* If the shift amount is specified in the instruction, - * the PC will be 8 bytes ahead. If a register is used - * to specify the shift amount the PC will be 12 bytes - * ahead. - */ - state->regData[rn].v += ((!I && (operand2 & 0x0010)) ? 12 : 8); - } - - /* Compute values */ - switch (opcode) { - case 0: /* AND: Rd := Op1 AND Op2 */ - state->regData[rd].v = state->regData[rn].v & op2val; - break; - - case 1: /* EOR: Rd := Op1 EOR Op2 */ - state->regData[rd].v = state->regData[rn].v ^ op2val; - break; - - case 2: /* SUB: Rd:= Op1 - Op2 */ - state->regData[rd].v = state->regData[rn].v - op2val; - break; - case 3: /* RSB: Rd:= Op2 - Op1 */ - state->regData[rd].v = op2val - state->regData[rn].v; - break; - - case 4: /* ADD: Rd:= Op1 + Op2 */ - state->regData[rd].v = state->regData[rn].v + op2val; - break; - - case 5: /* ADC: Rd:= Op1 + Op2 + C */ - case 6: /* SBC: Rd:= Op1 - Op2 + C */ - case 7: /* RSC: Rd:= Op2 - Op1 + C */ - case 8: /* TST: set condition codes on Op1 AND Op2 */ - case 9: /* TEQ: set condition codes on Op1 EOR Op2 */ - case 10: /* CMP: set condition codes on Op1 - Op2 */ - case 11: /* CMN: set condition codes on Op1 + Op2 */ - UnwPrintd1("\t; ????"); - break; - - case 12: /* ORR: Rd:= Op1 OR Op2 */ - state->regData[rd].v = state->regData[rn].v | op2val; - break; - - case 13: /* MOV: Rd:= Op2 */ - state->regData[rd].v = op2val; - break; - - case 14: /* BIC: Rd:= Op1 AND NOT Op2 */ - state->regData[rd].v = state->regData[rn].v & (~op2val); - break; - - case 15: /* MVN: Rd:= NOT Op2 */ - state->regData[rd].v = ~op2val; - break; - } - - /* Remove the prefetch offset from the PC */ - if (rd != 15 && rn == 15) - state->regData[rn].v -= ((!I && (operand2 & 0x0010)) ? 12 : 8); - } - - /* Block Data Transfer - * LDM, STM - */ - else if ((instr & 0xFE000000) == 0xE8000000) { - - bool P = !!(instr & 0x01000000), - U = !!(instr & 0x00800000), - S = !!(instr & 0x00400000), - W = !!(instr & 0x00200000), - L = !!(instr & 0x00100000); - uint16_t baseReg = (instr & 0x000F0000) >> 16; - uint16_t regList = (instr & 0x0000FFFF); - uint32_t addr = state->regData[baseReg].v; - bool addrValid = M_IsOriginValid(state->regData[baseReg].o); - int8_t r; - - #ifdef UNW_DEBUG - /* Display the instruction */ - if (L) - UnwPrintd6("LDM%c%c r%d%s, {reglist}%s\n", P ? 'E' : 'F', U ? 'D' : 'A', baseReg, W ? "!" : "", S ? "^" : ""); - else - UnwPrintd6("STM%c%c r%d%s, {reglist}%s\n", !P ? 'E' : 'F', !U ? 'D' : 'A', baseReg, W ? "!" : "", S ? "^" : ""); - #endif - - /* S indicates that banked registers (untracked) are used, unless - * this is a load including the PC when the S-bit indicates that - * that CPSR is loaded from SPSR (also untracked, but ignored). - */ - if (S && (!L || (regList & (0x01 << 15)) == 0)) { - UnwPrintd1("\nError:S-bit set requiring banked registers\n"); - return UNWIND_FAILURE; - } - else if (baseReg == 15) { - UnwPrintd1("\nError: r15 used as base register\n"); - return UNWIND_FAILURE; - } - else if (regList == 0) { - UnwPrintd1("\nError: Register list empty\n"); - return UNWIND_FAILURE; - } - - /* Check if ascending or descending. - * Registers are loaded/stored in order of address. - * i.e. r0 is at the lowest address, r15 at the highest. - */ - r = U ? 0 : 15; - do { - - /* Check if the register is to be transferred */ - if (regList & (0x01 << r)) { - - if (P) addr += U ? 4 : -4; - - if (L) { - - if (addrValid) { - - if (!UnwMemReadRegister(state, addr, &state->regData[r])) - return UNWIND_DREAD_W_FAIL; - - /* Update the origin if read via the stack pointer */ - if (M_IsOriginValid(state->regData[r].o) && baseReg == 13) - state->regData[r].o = REG_VAL_FROM_STACK; - - UnwPrintd5(" R%d = 0x%08x\t; r%d %s\n",r,state->regData[r].v,r, M_Origin2Str(state->regData[r].o)); - } - else { - /* Invalidate the register as the base reg was invalid */ - state->regData[r].o = REG_VAL_INVALID; - UnwPrintd2(" R%d = ???\n", r); - } - } - else { - if (addrValid && !UnwMemWriteRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DWRITE_W_FAIL; - - UnwPrintd2(" R%d = 0x%08x\n", r); - } - - if (!P) addr += U ? 4 : -4; - } - - /* Check the next register */ - r += U ? 1 : -1; - - } while (r >= 0 && r <= 15); - - /* Check the writeback bit */ - if (W) state->regData[baseReg].v = addr; - - /* Check if the PC was loaded */ - if (L && (regList & (0x01 << 15))) { - if (!M_IsOriginValid(state->regData[15].o)) { - /* Return address is not valid */ - UnwPrintd1("PC popped with invalid address\n"); - return UNWIND_FAILURE; - } - else { - /* Store the return address */ - if (!UnwReportRetAddr(state, state->regData[15].v)) - return UNWIND_TRUNCATED; - - UnwPrintd2(" Return PC=0x%x", state->regData[15].v); - - /* Determine the return mode */ - if (state->regData[15].v & 0x1) { - /* Branching to THUMB */ - return UnwStartThumb(state); - } - else { - /* Branch to ARM */ - - /* Account for the auto-increment which isn't needed */ - state->regData[15].v -= 4; - } - } - } - } - else { - UnwPrintd1("????"); - - /* Unknown/undecoded. May alter some register, so invalidate file */ - UnwInvalidateRegisterFile(state->regData); - } - - UnwPrintd1("\n"); - - /* Should never hit the reset vector */ - if (state->regData[15].v == 0) return UNWIND_RESET; - - /* Check next address */ - state->regData[15].v += 4; - - /* Garbage collect the memory hash (used only for the stack) */ - UnwMemHashGC(state); - - if (--t == 0) return UNWIND_EXHAUSTED; - - } while (!found); - - return UNWIND_UNSUPPORTED; -} - -#endif // __arm__ || __thumb__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp deleted file mode 100644 index d5449f863e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp +++ /dev/null @@ -1,1067 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commercially or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Abstract interpretation for Thumb mode. - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) - -#define MODULE_NAME "UNWARM_THUMB" - -#include -#include "unwarm.h" - -/** Sign extend an 11 bit value. - * This function simply inspects bit 11 of the input \a value, and if - * set, the top 5 bits are set to give a 2's compliment signed value. - * \param value The value to sign extend. - * \return The signed-11 bit value stored in a 16bit data type. - */ -static int32_t signExtend11(const uint16_t value) { - return (value & 0x400) ? value | 0xFFFFF800 : value; -} - -UnwResult UnwStartThumb(UnwState * const state) { - bool found = false; - uint16_t t = UNW_MAX_INSTR_COUNT; - uint32_t lastJumpAddr = 0; // Last JUMP address, to try to detect infinite loops - bool loopDetected = false; // If a loop was detected - - do { - uint16_t instr; - - /* Attempt to read the instruction */ - if (!state->cb->readH(state->regData[15].v & (~0x1), &instr)) - return UNWIND_IREAD_H_FAIL; - - UnwPrintd4("T %x %x %04x:", state->regData[13].v, state->regData[15].v, instr); - - /* Check that the PC is still on Thumb alignment */ - if (!(state->regData[15].v & 0x1)) { - UnwPrintd1("\nError: PC misalignment\n"); - return UNWIND_INCONSISTENT; - } - - /* Check that the SP and PC have not been invalidated */ - if (!M_IsOriginValid(state->regData[13].o) || !M_IsOriginValid(state->regData[15].o)) { - UnwPrintd1("\nError: PC or SP invalidated\n"); - return UNWIND_INCONSISTENT; - } - - /* - * Detect 32bit thumb instructions - */ - if ((instr & 0xE000) == 0xE000 && (instr & 0x1800) != 0) { - uint16_t instr2; - - /* Check next address */ - state->regData[15].v += 2; - - /* Attempt to read the 2nd part of the instruction */ - if (!state->cb->readH(state->regData[15].v & (~0x1), &instr2)) - return UNWIND_IREAD_H_FAIL; - - UnwPrintd3(" %x %04x:", state->regData[15].v, instr2); - - /* - * Load/Store multiple: Only interpret - * PUSH and POP - */ - if ((instr & 0xFE6F) == 0xE82D) { - bool L = !!(instr & 0x10); - uint16_t rList = instr2; - - if (L) { - uint8_t r; - - /* Load from memory: POP */ - UnwPrintd1("POP {Rlist}\n"); - - /* Load registers from stack */ - for (r = 0; r < 16; r++) { - if (rList & (0x1 << r)) { - - /* Read the word */ - if (!UnwMemReadRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DREAD_W_FAIL; - - /* Alter the origin to be from the stack if it was valid */ - if (M_IsOriginValid(state->regData[r].o)) { - - state->regData[r].o = REG_VAL_FROM_STACK; - - /* If restoring the PC */ - if (r == 15) { - - /* The bottom bit should have been set to indicate that - * the caller was from Thumb. This would allow return - * by BX for interworking APCS. - */ - if ((state->regData[15].v & 0x1) == 0) { - UnwPrintd2("Warning: Return address not to Thumb: 0x%08x\n", state->regData[15].v); - - /* Pop into the PC will not switch mode */ - return UNWIND_INCONSISTENT; - } - - /* Store the return address */ - if (!UnwReportRetAddr(state, state->regData[15].v)) - return UNWIND_TRUNCATED; - - /* Now have the return address */ - UnwPrintd2(" Return PC=%x\n", state->regData[15].v); - - /* Compensate for the auto-increment, which isn't needed here */ - state->regData[15].v -= 2; - - } - - } else { - - if (r == 15) { - /* Return address is not valid */ - UnwPrintd1("PC popped with invalid address\n"); - return UNWIND_FAILURE; - } - } - - state->regData[13].v += 4; - - UnwPrintd3(" r%d = 0x%08x\n", r, state->regData[r].v); - } - } - } - else { - int8_t r; - - /* Store to memory: PUSH */ - UnwPrintd1("PUSH {Rlist}"); - - for (r = 15; r >= 0; r--) { - if (rList & (0x1 << r)) { - UnwPrintd4("\n r%d = 0x%08x\t; %s", r, state->regData[r].v, M_Origin2Str(state->regData[r].o)); - - state->regData[13].v -= 4; - - if (!UnwMemWriteRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DWRITE_W_FAIL; - } - } - } - } - /* - * PUSH register - */ - else if (instr == 0xF84D && (instr2 & 0x0FFF) == 0x0D04) { - uint8_t r = instr2 >> 12; - - /* Store to memory: PUSH */ - UnwPrintd2("PUSH {R%d}\n", r); - UnwPrintd4("\n r%d = 0x%08x\t; %s", r, state->regData[r].v, M_Origin2Str(state->regData[r].o)); - - state->regData[13].v -= 4; - - if (!UnwMemWriteRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DWRITE_W_FAIL; - } - /* - * POP register - */ - else if (instr == 0xF85D && (instr2 & 0x0FFF) == 0x0B04) { - uint8_t r = instr2 >> 12; - - /* Load from memory: POP */ - UnwPrintd2("POP {R%d}\n", r); - - /* Read the word */ - if (!UnwMemReadRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DREAD_W_FAIL; - - /* Alter the origin to be from the stack if it was valid */ - if (M_IsOriginValid(state->regData[r].o)) { - - state->regData[r].o = REG_VAL_FROM_STACK; - - /* If restoring the PC */ - if (r == 15) { - - /* The bottom bit should have been set to indicate that - * the caller was from Thumb. This would allow return - * by BX for interworking APCS. - */ - if ((state->regData[15].v & 0x1) == 0) { - UnwPrintd2("Warning: Return address not to Thumb: 0x%08x\n", state->regData[15].v); - - /* Pop into the PC will not switch mode */ - return UNWIND_INCONSISTENT; - } - - /* Store the return address */ - if (!UnwReportRetAddr(state, state->regData[15].v)) - return UNWIND_TRUNCATED; - - /* Now have the return address */ - UnwPrintd2(" Return PC=%x\n", state->regData[15].v); - - /* Compensate for the auto-increment, which isn't needed here */ - state->regData[15].v -= 2; - - } - - } else { - - if (r == 15) { - /* Return address is not valid */ - UnwPrintd1("PC popped with invalid address\n"); - return UNWIND_FAILURE; - } - } - - state->regData[13].v += 4; - - UnwPrintd3(" r%d = 0x%08x\n", r, state->regData[r].v); - } - /* - * TBB / TBH - */ - else if ((instr & 0xFFF0) == 0xE8D0 && (instr2 & 0xFFE0) == 0xF000) { - /* We are only interested in - * the forms - * TBB [PC, ...] - * TBH [PC, ..., LSL #1] - * as those are used by the C compiler to implement - * the switch clauses - */ - uint8_t rn = instr & 0xF; - bool H = !!(instr2 & 0x10); - - UnwPrintd5("TB%c [r%d,r%d%s]\n", H ? 'H' : 'B', rn, (instr2 & 0xF), H ? ",LSL #1" : ""); - - // We are only interested if the RN is the PC. Let's choose the 1st destination - if (rn == 15) { - if (H) { - uint16_t rv; - if (!state->cb->readH((state->regData[15].v & (~1)) + 2, &rv)) - return UNWIND_DREAD_H_FAIL; - state->regData[15].v += rv * 2; - } - else { - uint8_t rv; - if (!state->cb->readB((state->regData[15].v & (~1)) + 2, &rv)) - return UNWIND_DREAD_B_FAIL; - state->regData[15].v += rv * 2; - } - } - } - /* - * Unconditional branch - */ - else if ((instr & 0xF800) == 0xF000 && (instr2 & 0xD000) == 0x9000) { - uint32_t v; - - uint8_t S = (instr & 0x400) >> 10; - uint16_t imm10 = (instr & 0x3FF); - uint8_t J1 = (instr2 & 0x2000) >> 13; - uint8_t J2 = (instr2 & 0x0800) >> 11; - uint16_t imm11 = (instr2 & 0x7FF); - - uint8_t I1 = J1 ^ S ^ 1; - uint8_t I2 = J2 ^ S ^ 1; - uint32_t imm32 = (S << 24) | (I1 << 23) | (I2 << 22) |(imm10 << 12) | (imm11 << 1); - if (S) imm32 |= 0xFE000000; - - UnwPrintd2("B %d \n", imm32); - - /* Update PC */ - state->regData[15].v += imm32; - - /* Need to advance by a word to account for pre-fetch. - * Advance by a half word here, allowing the normal address - * advance to account for the other half word. - */ - state->regData[15].v += 2; - - /* Compute the jump address */ - v = state->regData[15].v + 2; - - /* Display PC of next instruction */ - UnwPrintd2(" New PC=%x", v); - - /* Did we detect an infinite loop ? */ - loopDetected = lastJumpAddr == v; - - /* Remember the last address we jumped to */ - lastJumpAddr = v; - } - - /* - * Branch with link - */ - else if ((instr & 0xF800) == 0xF000 && (instr2 & 0xD000) == 0xD000) { - - uint8_t S = (instr & 0x400) >> 10; - uint16_t imm10 = (instr & 0x3FF); - uint8_t J1 = (instr2 & 0x2000) >> 13; - uint8_t J2 = (instr2 & 0x0800) >> 11; - uint16_t imm11 = (instr2 & 0x7FF); - - uint8_t I1 = J1 ^ S ^ 1; - uint8_t I2 = J2 ^ S ^ 1; - uint32_t imm32 = (S << 24) | (I1 << 23) | (I2 << 22) |(imm10 << 12) | (imm11 << 1); - if (S) imm32 |= 0xFE000000; - - UnwPrintd2("BL %d \n", imm32); - - /* Never taken, as we are unwinding the stack */ - if (0) { - - /* Store return address in LR register */ - state->regData[14].v = state->regData[15].v + 2; - state->regData[14].o = REG_VAL_FROM_CONST; - - /* Update PC */ - state->regData[15].v += imm32; - - /* Need to advance by a word to account for pre-fetch. - * Advance by a half word here, allowing the normal address - * advance to account for the other half word. - */ - state->regData[15].v += 2; - - /* Display PC of next instruction */ - UnwPrintd2(" Return PC=%x", state->regData[15].v); - - /* Report the return address, including mode bit */ - if (!UnwReportRetAddr(state, state->regData[15].v)) - return UNWIND_TRUNCATED; - - /* Determine the new mode */ - if (state->regData[15].v & 0x1) { - /* Branching to THUMB */ - - /* Account for the auto-increment which isn't needed */ - state->regData[15].v -= 2; - } - else { - /* Branch to ARM */ - return UnwStartArm(state); - } - } - } - - /* - * Conditional branches. Usually not taken, unless infinite loop is detected - */ - else if ((instr & 0xF800) == 0xF000 && (instr2 & 0xD000) == 0x8000) { - - uint8_t S = (instr & 0x400) >> 10; - uint16_t imm6 = (instr & 0x3F); - uint8_t J1 = (instr2 & 0x2000) >> 13; - uint8_t J2 = (instr2 & 0x0800) >> 11; - uint16_t imm11 = (instr2 & 0x7FF); - - uint8_t I1 = J1 ^ S ^ 1; - uint8_t I2 = J2 ^ S ^ 1; - uint32_t imm32 = (S << 20) | (I1 << 19) | (I2 << 18) |(imm6 << 12) | (imm11 << 1); - if (S) imm32 |= 0xFFE00000; - - UnwPrintd2("Bcond %d\n", imm32); - - /* Take the jump only if a loop is detected */ - if (loopDetected) { - - /* Update PC */ - state->regData[15].v += imm32; - - /* Need to advance by a word to account for pre-fetch. - * Advance by a half word here, allowing the normal address - * advance to account for the other half word. - */ - state->regData[15].v += 2; - - /* Display PC of next instruction */ - UnwPrintd2(" New PC=%x", state->regData[15].v + 2); - } - } - /* - * PC-relative load - * LDR Rd,[PC, #+/-imm] - */ - else if ((instr & 0xFF7F) == 0xF85F) { - uint8_t rt = (instr2 & 0xF000) >> 12; - uint8_t imm12 = (instr2 & 0x0FFF); - bool A = !!(instr & 0x80); - uint32_t address; - - /* Compute load address, adding a word to account for prefetch */ - address = (state->regData[15].v & (~0x3)) + 4; - if (A) address += imm12; - else address -= imm12; - - UnwPrintd4("LDR r%d,[PC #%c0x%08x]", rt, A?'+':'-', address); - - if (!UnwMemReadRegister(state, address, &state->regData[rt])) - return UNWIND_DREAD_W_FAIL; - } - /* - * LDR immediate. - * We are only interested when destination is PC. - * LDR Rt,[Rn , #n] - */ - else if ((instr & 0xFFF0) == 0xF8D0) { - uint8_t rn = (instr & 0xF); - uint8_t rt = (instr2 & 0xF000) >> 12; - uint16_t imm12 = (instr2 & 0xFFF); - - /* If destination is PC and we don't know the source value, then fail */ - if (!M_IsOriginValid(state->regData[rn].o)) { - state->regData[rt].o = state->regData[rn].o; - } - else { - uint32_t address = state->regData[rn].v + imm12; - if (!UnwMemReadRegister(state, address, &state->regData[rt])) - return UNWIND_DREAD_W_FAIL; - } - } - /* - * LDR immediate - * We are only interested when destination is PC. - * LDR Rt,[Rn , #-n] - * LDR Rt,[Rn], #+/-n] - * LDR Rt,[Rn, #+/-n]! - */ - else if ((instr & 0xFFF0) == 0xF850 && (instr2 & 0x0800) == 0x0800) { - uint8_t rn = (instr & 0xF); - uint8_t rt = (instr2 & 0xF000) >> 12; - uint16_t imm8 = (instr2 & 0xFF); - bool P = !!(instr2 & 0x400); - bool U = !!(instr2 & 0x200); - bool W = !!(instr2 & 0x100); - - if (!M_IsOriginValid(state->regData[rn].o)) - state->regData[rt].o = state->regData[rn].o; - else { - uint32_t offaddress = state->regData[rn].v + (U ? imm8 + imm8 : 0), - address = P ? offaddress : state->regData[rn].v; - - if (!UnwMemReadRegister(state, address, &state->regData[rt])) - return UNWIND_DREAD_W_FAIL; - - if (W) state->regData[rn].v = offaddress; - } - } - /* - * LDR (register). - * We are interested in the form - * ldr Rt, [Rn, Rm, lsl #x] - * Where Rt is PC, Rn value is known, Rm is not known or unknown - */ - else if ((instr & 0xFFF0) == 0xF850 && (instr2 & 0x0FC0) == 0x0000) { - const uint8_t rn = (instr & 0xF), - rt = (instr2 & 0xF000) >> 12, - rm = (instr2 & 0xF), - imm2 = (instr2 & 0x30) >> 4; - - if (!M_IsOriginValid(state->regData[rn].o) || !M_IsOriginValid(state->regData[rm].o)) { - - /* If Rt is PC, and Rn is known, then do an exception and assume - Rm equals 0 => This takes the first case in a switch() */ - if (rt == 15 && M_IsOriginValid(state->regData[rn].o)) { - uint32_t address = state->regData[rn].v; - if (!UnwMemReadRegister(state, address, &state->regData[rt])) - return UNWIND_DREAD_W_FAIL; - } - else /* Propagate unknown value */ - state->regData[rt].o = state->regData[rn].o; - - } - else { - uint32_t address = state->regData[rn].v + (state->regData[rm].v << imm2); - if (!UnwMemReadRegister(state, address, &state->regData[rt])) - return UNWIND_DREAD_W_FAIL; - } - } - else { - UnwPrintd1("???? (32)"); - - /* Unknown/undecoded. May alter some register, so invalidate file */ - UnwInvalidateRegisterFile(state->regData); - } - /* End of thumb 32bit code */ - - } - /* Format 1: Move shifted register - * LSL Rd, Rs, #Offset5 - * LSR Rd, Rs, #Offset5 - * ASR Rd, Rs, #Offset5 - */ - else if ((instr & 0xE000) == 0x0000 && (instr & 0x1800) != 0x1800) { - bool signExtend; - const uint8_t op = (instr & 0x1800) >> 11, - offset5 = (instr & 0x07C0) >> 6, - rs = (instr & 0x0038) >> 3, - rd = (instr & 0x0007); - - switch (op) { - case 0: /* LSL */ - UnwPrintd6("LSL r%d, r%d, #%d\t; r%d %s", rd, rs, offset5, rs, M_Origin2Str(state->regData[rs].o)); - state->regData[rd].v = state->regData[rs].v << offset5; - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - - case 1: /* LSR */ - UnwPrintd6("LSR r%d, r%d, #%d\t; r%d %s", rd, rs, offset5, rs, M_Origin2Str(state->regData[rs].o)); - state->regData[rd].v = state->regData[rs].v >> offset5; - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - - case 2: /* ASR */ - UnwPrintd6("ASL r%d, r%d, #%d\t; r%d %s", rd, rs, offset5, rs, M_Origin2Str(state->regData[rs].o)); - - signExtend = !!(state->regData[rs].v & 0x8000); - state->regData[rd].v = state->regData[rs].v >> offset5; - if (signExtend) state->regData[rd].v |= 0xFFFFFFFF << (32 - offset5); - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - } - } - /* Format 2: add/subtract - * ADD Rd, Rs, Rn - * ADD Rd, Rs, #Offset3 - * SUB Rd, Rs, Rn - * SUB Rd, Rs, #Offset3 - */ - else if ((instr & 0xF800) == 0x1800) { - bool I = !!(instr & 0x0400); - bool op = !!(instr & 0x0200); - uint8_t rn = (instr & 0x01C0) >> 6; - uint8_t rs = (instr & 0x0038) >> 3; - uint8_t rd = (instr & 0x0007); - - /* Print decoding */ - UnwPrintd6("%s r%d, r%d, %c%d\t;",op ? "SUB" : "ADD",rd, rs,I ? '#' : 'r',rn); - UnwPrintd5("r%d %s, r%d %s",rd, M_Origin2Str(state->regData[rd].o),rs, M_Origin2Str(state->regData[rs].o)); - if (!I) { - - UnwPrintd3(", r%d %s", rn, M_Origin2Str(state->regData[rn].o)); - - /* Perform calculation */ - state->regData[rd].v = state->regData[rs].v + (op ? -state->regData[rn].v : state->regData[rn].v); - - /* Propagate the origin */ - if (M_IsOriginValid(state->regData[rs].o) && M_IsOriginValid(state->regData[rn].o)) { - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - } - else - state->regData[rd].o = REG_VAL_INVALID; - } - else { - /* Perform calculation */ - state->regData[rd].v = state->regData[rs].v + (op ? -rn : rn); - - /* Propagate the origin */ - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - } - } - /* Format 3: move/compare/add/subtract immediate - * MOV Rd, #Offset8 - * CMP Rd, #Offset8 - * ADD Rd, #Offset8 - * SUB Rd, #Offset8 - */ - else if ((instr & 0xE000) == 0x2000) { - - uint8_t op = (instr & 0x1800) >> 11; - uint8_t rd = (instr & 0x0700) >> 8; - uint8_t offset8 = (instr & 0x00FF); - - switch (op) { - case 0: /* MOV */ - UnwPrintd3("MOV r%d, #0x%x", rd, offset8); - state->regData[rd].v = offset8; - state->regData[rd].o = REG_VAL_FROM_CONST; - break; - - case 1: /* CMP */ - /* Irrelevant to unwinding */ - UnwPrintd1("CMP ???"); - break; - - case 2: /* ADD */ - UnwPrintd5("ADD r%d, #0x%x\t; r%d %s", rd, offset8, rd, M_Origin2Str(state->regData[rd].o)); - state->regData[rd].v += offset8; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - - case 3: /* SUB */ - UnwPrintd5("SUB r%d, #0x%d\t; r%d %s", rd, offset8, rd, M_Origin2Str(state->regData[rd].o)); - state->regData[rd].v -= offset8; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - } - } - /* Format 4: ALU operations - * AND Rd, Rs - * EOR Rd, Rs - * LSL Rd, Rs - * LSR Rd, Rs - * ASR Rd, Rs - * ADC Rd, Rs - * SBC Rd, Rs - * ROR Rd, Rs - * TST Rd, Rs - * NEG Rd, Rs - * CMP Rd, Rs - * CMN Rd, Rs - * ORR Rd, Rs - * MUL Rd, Rs - * BIC Rd, Rs - * MVN Rd, Rs - */ - else if ((instr & 0xFC00) == 0x4000) { - uint8_t op = (instr & 0x03C0) >> 6; - uint8_t rs = (instr & 0x0038) >> 3; - uint8_t rd = (instr & 0x0007); - -#ifdef UNW_DEBUG - static const char * const mnu[16] = { - "AND", "EOR", "LSL", "LSR", - "ASR", "ADC", "SBC", "ROR", - "TST", "NEG", "CMP", "CMN", - "ORR", "MUL", "BIC", "MVN" }; -#endif - /* Print the mnemonic and registers */ - switch (op) { - case 0: /* AND */ - case 1: /* EOR */ - case 2: /* LSL */ - case 3: /* LSR */ - case 4: /* ASR */ - case 7: /* ROR */ - case 9: /* NEG */ - case 12: /* ORR */ - case 13: /* MUL */ - case 15: /* MVN */ - UnwPrintd8("%s r%d ,r%d\t; r%d %s, r%d %s",mnu[op],rd, rs, rd, M_Origin2Str(state->regData[rd].o), rs, M_Origin2Str(state->regData[rs].o)); - break; - - case 5: /* ADC */ - case 6: /* SBC */ - UnwPrintd4("%s r%d, r%d", mnu[op], rd, rs); - break; - - case 8: /* TST */ - case 10: /* CMP */ - case 11: /* CMN */ - /* Irrelevant to unwinding */ - UnwPrintd2("%s ???", mnu[op]); - break; - - case 14: /* BIC */ - UnwPrintd5("r%d ,r%d\t; r%d %s", rd, rs, rs, M_Origin2Str(state->regData[rs].o)); - break; - } - - /* Perform operation */ - switch (op) { - case 0: /* AND */ - state->regData[rd].v &= state->regData[rs].v; - break; - - case 1: /* EOR */ - state->regData[rd].v ^= state->regData[rs].v; - break; - - case 2: /* LSL */ - state->regData[rd].v <<= state->regData[rs].v; - break; - - case 3: /* LSR */ - state->regData[rd].v >>= state->regData[rs].v; - break; - - case 4: /* ASR */ - if (state->regData[rd].v & 0x80000000) { - state->regData[rd].v >>= state->regData[rs].v; - state->regData[rd].v |= 0xFFFFFFFF << (32 - state->regData[rs].v); - } - else { - state->regData[rd].v >>= state->regData[rs].v; - } - - break; - - case 5: /* ADC */ - case 6: /* SBC */ - case 8: /* TST */ - case 10: /* CMP */ - case 11: /* CMN */ - break; - - case 7: /* ROR */ - state->regData[rd].v = (state->regData[rd].v >> state->regData[rs].v) | - (state->regData[rd].v << (32 - state->regData[rs].v)); - break; - - case 9: /* NEG */ - state->regData[rd].v = -state->regData[rs].v; - break; - - case 12: /* ORR */ - state->regData[rd].v |= state->regData[rs].v; - break; - - case 13: /* MUL */ - state->regData[rd].v *= state->regData[rs].v; - break; - - case 14: /* BIC */ - state->regData[rd].v &= ~state->regData[rs].v; - break; - - case 15: /* MVN */ - state->regData[rd].v = ~state->regData[rs].v; - break; - } - - /* Propagate data origins */ - switch (op) { - case 0: /* AND */ - case 1: /* EOR */ - case 2: /* LSL */ - case 3: /* LSR */ - case 4: /* ASR */ - case 7: /* ROR */ - case 12: /* ORR */ - case 13: /* MUL */ - case 14: /* BIC */ - if (M_IsOriginValid(state->regData[rd].o) && M_IsOriginValid(state->regData[rs].o)) { - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - } - else - state->regData[rd].o = REG_VAL_INVALID; - break; - - case 5: /* ADC */ - case 6: /* SBC */ - /* C-bit not tracked */ - state->regData[rd].o = REG_VAL_INVALID; - break; - - case 8: /* TST */ - case 10: /* CMP */ - case 11: /* CMN */ - /* Nothing propagated */ - break; - - case 9: /* NEG */ - case 15: /* MVN */ - state->regData[rd].o = state->regData[rs].o; - state->regData[rd].o |= REG_VAL_ARITHMETIC; - break; - } - } - /* Format 5: Hi register operations/branch exchange - * ADD Rd, Hs - * CMP Hd, Rs - * MOV Hd, Hs - */ - else if ((instr & 0xFC00) == 0x4400) { - uint8_t op = (instr & 0x0300) >> 8; - bool h1 = (instr & 0x0080) ? true: false; - bool h2 = (instr & 0x0040) ? true: false; - uint8_t rhs = (instr & 0x0038) >> 3; - uint8_t rhd = (instr & 0x0007); - - /* Adjust the register numbers */ - if (h2) rhs += 8; - if (h1) rhd += 8; - - switch (op) { - case 0: /* ADD */ - UnwPrintd5("ADD r%d, r%d\t; r%d %s", rhd, rhs, rhs, M_Origin2Str(state->regData[rhs].o)); - state->regData[rhd].v += state->regData[rhs].v; - state->regData[rhd].o = state->regData[rhs].o; - state->regData[rhd].o |= REG_VAL_ARITHMETIC; - break; - - case 1: /* CMP */ - /* Irrelevant to unwinding */ - UnwPrintd1("CMP ???"); - break; - - case 2: /* MOV */ - UnwPrintd5("MOV r%d, r%d\t; r%d %s", rhd, rhs, rhd, M_Origin2Str(state->regData[rhs].o)); - state->regData[rhd].v = state->regData[rhs].v; - state->regData[rhd].o = state->regData[rhd].o; - break; - - case 3: /* BX */ - UnwPrintd4("BX r%d\t; r%d %s\n", rhs, rhs, M_Origin2Str(state->regData[rhs].o)); - - /* Only follow BX if the data was from the stack or BX LR */ - if (rhs == 14 || state->regData[rhs].o == REG_VAL_FROM_STACK) { - UnwPrintd2(" Return PC=0x%x\n", state->regData[rhs].v & (~0x1)); - - /* Report the return address, including mode bit */ - if (!UnwReportRetAddr(state, state->regData[rhs].v)) - return UNWIND_TRUNCATED; - - /* Update the PC */ - state->regData[15].v = state->regData[rhs].v; - - /* Determine the new mode */ - if (state->regData[rhs].v & 0x1) { - /* Branching to THUMB */ - - /* Account for the auto-increment which isn't needed */ - state->regData[15].v -= 2; - } - else /* Branch to ARM */ - return UnwStartArm(state); - } - else { - UnwPrintd4("\nError: BX to invalid register: r%d = 0x%x (%s)\n", rhs, state->regData[rhs].o, M_Origin2Str(state->regData[rhs].o)); - return UNWIND_FAILURE; - } - } - } - /* Format 9: PC-relative load - * LDR Rd,[PC, #imm] - */ - else if ((instr & 0xF800) == 0x4800) { - uint8_t rd = (instr & 0x0700) >> 8; - uint8_t word8 = (instr & 0x00FF); - uint32_t address; - - /* Compute load address, adding a word to account for prefetch */ - address = (state->regData[15].v & (~0x3)) + 4 + (word8 << 2); - - UnwPrintd3("LDR r%d, 0x%08x", rd, address); - - if (!UnwMemReadRegister(state, address, &state->regData[rd])) - return UNWIND_DREAD_W_FAIL; - } - /* Format 13: add offset to Stack Pointer - * ADD sp,#+imm - * ADD sp,#-imm - */ - else if ((instr & 0xFF00) == 0xB000) { - uint8_t value = (instr & 0x7F) * 4; - - /* Check the negative bit */ - if ((instr & 0x80) != 0) { - UnwPrintd2("SUB sp,#0x%x", value); - state->regData[13].v -= value; - } - else { - UnwPrintd2("ADD sp,#0x%x", value); - state->regData[13].v += value; - } - } - /* Format 14: push/pop registers - * PUSH {Rlist} - * PUSH {Rlist, LR} - * POP {Rlist} - * POP {Rlist, PC} - */ - else if ((instr & 0xF600) == 0xB400) { - bool L = !!(instr & 0x0800); - bool R = !!(instr & 0x0100); - uint8_t rList = (instr & 0x00FF); - - if (L) { - uint8_t r; - - /* Load from memory: POP */ - UnwPrintd2("POP {Rlist%s}\n", R ? ", PC" : ""); - - for (r = 0; r < 8; r++) { - if (rList & (0x1 << r)) { - - /* Read the word */ - if (!UnwMemReadRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DREAD_W_FAIL; - - /* Alter the origin to be from the stack if it was valid */ - if (M_IsOriginValid(state->regData[r].o)) - state->regData[r].o = REG_VAL_FROM_STACK; - - state->regData[13].v += 4; - - UnwPrintd3(" r%d = 0x%08x\n", r, state->regData[r].v); - } - } - - /* Check if the PC is to be popped */ - if (R) { - /* Get the return address */ - if (!UnwMemReadRegister(state, state->regData[13].v, &state->regData[15])) - return UNWIND_DREAD_W_FAIL; - - /* Alter the origin to be from the stack if it was valid */ - if (!M_IsOriginValid(state->regData[15].o)) { - /* Return address is not valid */ - UnwPrintd1("PC popped with invalid address\n"); - return UNWIND_FAILURE; - } - else { - /* The bottom bit should have been set to indicate that - * the caller was from Thumb. This would allow return - * by BX for interworking APCS. - */ - if ((state->regData[15].v & 0x1) == 0) { - UnwPrintd2("Warning: Return address not to Thumb: 0x%08x\n", state->regData[15].v); - - /* Pop into the PC will not switch mode */ - return UNWIND_INCONSISTENT; - } - - /* Store the return address */ - if (!UnwReportRetAddr(state, state->regData[15].v)) - return UNWIND_TRUNCATED; - - /* Now have the return address */ - UnwPrintd2(" Return PC=%x\n", state->regData[15].v); - - /* Update the pc */ - state->regData[13].v += 4; - - /* Compensate for the auto-increment, which isn't needed here */ - state->regData[15].v -= 2; - } - } - } - else { - int8_t r; - - /* Store to memory: PUSH */ - UnwPrintd2("PUSH {Rlist%s}", R ? ", LR" : ""); - - /* Check if the LR is to be pushed */ - if (R) { - UnwPrintd3("\n lr = 0x%08x\t; %s", state->regData[14].v, M_Origin2Str(state->regData[14].o)); - - state->regData[13].v -= 4; - - /* Write the register value to memory */ - if (!UnwMemWriteRegister(state, state->regData[13].v, &state->regData[14])) - return UNWIND_DWRITE_W_FAIL; - } - - for (r = 7; r >= 0; r--) { - if (rList & (0x1 << r)) { - UnwPrintd4("\n r%d = 0x%08x\t; %s", r, state->regData[r].v, M_Origin2Str(state->regData[r].o)); - - state->regData[13].v -= 4; - - if (!UnwMemWriteRegister(state, state->regData[13].v, &state->regData[r])) - return UNWIND_DWRITE_W_FAIL; - } - } - } - } - - /* - * Conditional branches - * Bcond - */ - else if ((instr & 0xF000) == 0xD000) { - int32_t branchValue = (instr & 0xFF); - if (branchValue & 0x80) branchValue |= 0xFFFFFF00; - - /* Branch distance is twice that specified in the instruction. */ - branchValue *= 2; - - UnwPrintd2("Bcond %d \n", branchValue); - - /* Only take the branch if a loop was detected */ - if (loopDetected) { - - /* Update PC */ - state->regData[15].v += branchValue; - - /* Need to advance by a word to account for pre-fetch. - * Advance by a half word here, allowing the normal address - * advance to account for the other half word. - */ - state->regData[15].v += 2; - - /* Display PC of next instruction */ - UnwPrintd2(" New PC=%x", state->regData[15].v + 2); - } - } - - /* Format 18: unconditional branch - * B label - */ - else if ((instr & 0xF800) == 0xE000) { - uint32_t v; - int32_t branchValue = signExtend11(instr & 0x07FF); - - /* Branch distance is twice that specified in the instruction. */ - branchValue *= 2; - - UnwPrintd2("B %d \n", branchValue); - - /* Update PC */ - state->regData[15].v += branchValue; - - /* Need to advance by a word to account for pre-fetch. - * Advance by a half word here, allowing the normal address - * advance to account for the other half word. - */ - state->regData[15].v += 2; - - /* Compute the jump address */ - v = state->regData[15].v + 2; - - /* Display PC of next instruction */ - UnwPrintd2(" New PC=%x", v); - - /* Did we detect an infinite loop ? */ - loopDetected = lastJumpAddr == v; - - /* Remember the last address we jumped to */ - lastJumpAddr = v; - } - else { - UnwPrintd1("????"); - - /* Unknown/undecoded. May alter some register, so invalidate file */ - UnwInvalidateRegisterFile(state->regData); - } - - UnwPrintd1("\n"); - - /* Should never hit the reset vector */ - if (state->regData[15].v == 0) return UNWIND_RESET; - - /* Check next address */ - state->regData[15].v += 2; - - /* Garbage collect the memory hash (used only for the stack) */ - UnwMemHashGC(state); - - if (--t == 0) return UNWIND_EXHAUSTED; - - } while (!found); - - return UNWIND_SUCCESS; -} - -#endif // __arm__ || __thumb__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp deleted file mode 100644 index 207cd56aa8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Libbacktrace - * Copyright 2015 Stephen Street - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This library was modified, some bugs fixed, stack address validated - * and adapted to be used in Marlin 3D printer firmware as backtracer - * for exceptions for debugging purposes in 2018 by Eduardo José Tagle. - */ - -#if defined(__arm__) || defined(__thumb__) - -#include "unwarmbytab.h" - -#include -#include - -/* These symbols point to the unwind index and should be provide by the linker script */ -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 __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; - return ((uint32_t)prel31 + offset) & 0x7FFFFFFF; -} - -static const UnwTabEntry *UnwTabSearchIndex(const UnwTabEntry *start, const UnwTabEntry *end, uint32_t ip) { - const UnwTabEntry *middle; - - /* Perform a binary search of the unwind index */ - while (start < end - 1) { - middle = start + ((end - start + 1) >> 1); - if (ip < prel31_to_addr(&middle->addr_offset)) - end = middle; - else - start = middle; - } - return start; -} - -/* - * Get the function name or nullptr if not found - */ -static const char *UnwTabGetFunctionName(const UnwindCallbacks *cb, uint32_t address) { - uint32_t flag_word = 0; - if (!cb->readW(address-4,&flag_word)) - return nullptr; - - if ((flag_word & 0xFF000000) == 0xFF000000) { - return (const char *)(address - 4 - (flag_word & 0x00FFFFFF)); - } - return nullptr; -} - -/** - * Get the next frame unwinding instruction - * - * Return either the instruction or -1 to signal no more instructions - * are available - */ -static int UnwTabGetNextInstruction(const UnwindCallbacks *cb, UnwTabState *ucb) { - int instruction; - - /* Are there more instructions */ - if (ucb->remaining == 0) - return -1; - - /* Extract the current instruction */ - uint32_t v = 0; - if (!cb->readW(ucb->current, &v)) - return -1; - instruction = (v >> (ucb->byte << 3)) & 0xFF; - - /* Move the next byte */ - --ucb->byte; - if (ucb->byte < 0) { - ucb->current += 4; - ucb->byte = 3; - } - --ucb->remaining; - - return instruction; -} - -/** - * Initialize the frame unwinding state - */ -static UnwResult UnwTabStateInit(const UnwindCallbacks *cb, UnwTabState *ucb, uint32_t instructions, const UnwindFrame *frame) { - - /* Initialize control block */ - memset(ucb, 0, sizeof(UnwTabState)); - ucb->current = instructions; - - /* Is a short unwind description */ - uint32_t v = 0; - if (!cb->readW(instructions, &v)) - return UNWIND_DREAD_W_FAIL; - - if ((v & 0xFF000000) == 0x80000000) { - ucb->remaining = 3; - ucb->byte = 2; - /* Is a long unwind description */ - } else if ((v & 0xFF000000) == 0x81000000) { - ucb->remaining = ((v & 0x00FF0000) >> 14) + 2; - ucb->byte = 1; - } else - return UNWIND_UNSUPPORTED_DWARF_PERSONALITY; - - /* Initialize the virtual register set */ - ucb->vrs[7] = frame->fp; - ucb->vrs[13] = frame->sp; - ucb->vrs[14] = frame->lr; - ucb->vrs[15] = 0; - - /* All good */ - return UNWIND_SUCCESS; -} - -/* - * Execute unwinding instructions - */ -static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabState *ucb) { - - int instruction; - uint32_t mask; - uint32_t reg; - uint32_t vsp; - - /* Consume all instruction byte */ - while ((instruction = UnwTabGetNextInstruction(cb, ucb)) != -1) { - - if ((instruction & 0xC0) == 0x00) { // ARM_EXIDX_CMD_DATA_POP - /* vsp = vsp + (xxxxxx << 2) + 4 */ - ucb->vrs[13] += ((instruction & 0x3F) << 2) + 4; - } else - if ((instruction & 0xC0) == 0x40) { // ARM_EXIDX_CMD_DATA_PUSH - /* vsp = vsp - (xxxxxx << 2) - 4 */ - ucb->vrs[13] -= ((instruction & 0x3F) << 2) - 4; - } else - if ((instruction & 0xF0) == 0x80) { - /* pop under mask {r15-r12},{r11-r4} or refuse to unwind */ - instruction = instruction << 8 | UnwTabGetNextInstruction(cb, ucb); - - /* Check for refuse to unwind */ - if (instruction == 0x8000) // ARM_EXIDX_CMD_REFUSED - return UNWIND_REFUSED; - - /* Pop registers using mask */ // ARM_EXIDX_CMD_REG_POP - vsp = ucb->vrs[13]; - mask = instruction & 0xFFF; - - reg = 4; - while (mask) { - if ((mask & 1) != 0) { - uint32_t v; - if (!cb->readW(vsp,&v)) - return UNWIND_DREAD_W_FAIL; - ucb->vrs[reg] = v; - v += 4; - } - mask >>= 1; - ++reg; - } - - /* Patch up the vrs sp if it was in the mask */ - if ((instruction & (1 << (13 - 4))) != 0) - ucb->vrs[13] = vsp; - - } else - if ((instruction & 0xF0) == 0x90 && // ARM_EXIDX_CMD_REG_TO_SP - instruction != 0x9D && - instruction != 0x9F) { - /* vsp = r[nnnn] */ - ucb->vrs[13] = ucb->vrs[instruction & 0x0F]; - } else - if ((instruction & 0xF0) == 0xA0) { // ARM_EXIDX_CMD_REG_POP - /* pop r4-r[4+nnn] or pop r4-r[4+nnn], r14*/ - vsp = ucb->vrs[13]; - - for (reg = 4; reg <= uint32_t((instruction & 0x07) + 4); ++reg) { - uint32_t v; - if (!cb->readW(vsp,&v)) - return UNWIND_DREAD_W_FAIL; - - ucb->vrs[reg] = v; - vsp += 4; - } - - if (instruction & 0x08) { // ARM_EXIDX_CMD_REG_POP - uint32_t v; - if (!cb->readW(vsp,&v)) - return UNWIND_DREAD_W_FAIL; - ucb->vrs[14] = v; - vsp += 4; - } - - ucb->vrs[13] = vsp; - - } else - if (instruction == 0xB0) { // ARM_EXIDX_CMD_FINISH - /* finished */ - if (ucb->vrs[15] == 0) - ucb->vrs[15] = ucb->vrs[14]; - - /* All done unwinding */ - return UNWIND_SUCCESS; - - } else - if (instruction == 0xB1) { // ARM_EXIDX_CMD_REG_POP - /* pop register under mask {r3,r2,r1,r0} */ - vsp = ucb->vrs[13]; - mask = UnwTabGetNextInstruction(cb, ucb); - - reg = 0; - while (mask) { - if ((mask & 1) != 0) { - uint32_t v; - if (!cb->readW(vsp,&v)) - return UNWIND_DREAD_W_FAIL; - - ucb->vrs[reg] = v; - vsp += 4; - } - mask >>= 1; - ++reg; - } - ucb->vrs[13] = (uint32_t)vsp; - - } else - if (instruction == 0xB2) { // ARM_EXIDX_CMD_DATA_POP - /* vps = vsp + 0x204 + (uleb128 << 2) */ - ucb->vrs[13] += 0x204 + (UnwTabGetNextInstruction(cb, ucb) << 2); - - } else - if (instruction == 0xB3 || // ARM_EXIDX_CMD_VFP_POP - instruction == 0xC8 || - instruction == 0xC9) { - - /* pop VFP double-precision registers */ - vsp = ucb->vrs[13]; - - /* D[ssss]-D[ssss+cccc] */ - uint32_t v; - if (!cb->readW(vsp,&v)) - return UNWIND_DREAD_W_FAIL; - - ucb->vrs[14] = v; - vsp += 4; - - if (instruction == 0xC8) { - /* D[16+sssss]-D[16+ssss+cccc] */ - ucb->vrs[14] |= 1 << 16; - } - - if (instruction != 0xB3) { - /* D[sssss]-D[ssss+cccc] */ - ucb->vrs[14] |= 1 << 17; - } - - ucb->vrs[13] = vsp; - - } else - if ((instruction & 0xF8) == 0xB8 || - (instruction & 0xF8) == 0xD0) { - - /* Pop VFP double precision registers D[8]-D[8+nnn] */ - ucb->vrs[14] = 0x80 | (instruction & 0x07); - - if ((instruction & 0xF8) == 0xD0) { - ucb->vrs[14] = 1 << 17; - } - - } else - return UNWIND_UNSUPPORTED_DWARF_INSTR; - } - - return UNWIND_SUCCESS; -} - -static inline __attribute__((always_inline)) uint32_t read_psp() { - - /* Read the current PSP and return its value as a pointer */ - uint32_t psp; - - __asm__ volatile ( - " mrs %0, psp \n" - : "=r" (psp) : : - ); - - return psp; -} - -/* - * Unwind the specified frame and goto the previous one - */ -static UnwResult UnwTabUnwindFrame(const UnwindCallbacks *cb, UnwindFrame *frame) { - - UnwResult err; - UnwTabState ucb; - const UnwTabEntry *index; - uint32_t instructions; - - /* Search the unwind index for the matching unwind table */ - index = UnwTabSearchIndex(__exidx_start, __exidx_end, frame->pc); - - /* Make sure we can unwind this frame */ - if (index->insn == 0x00000001) - return UNWIND_SUCCESS; - - /* Get the pointer to the first unwind instruction */ - if (index->insn & 0x80000000) - instructions = (uint32_t)&index->insn; - else - instructions = prel31_to_addr(&index->insn); - - /* Initialize the unwind control block */ - if ((err = UnwTabStateInit(cb, &ucb, instructions, frame)) < 0) - return err; - - /* Execute the unwind instructions */ - err = UnwTabExecuteInstructions(cb, &ucb); - if (err < 0) - return err; - - /* Set the virtual pc to the virtual lr if this is the first unwind */ - if (ucb.vrs[15] == 0) - ucb.vrs[15] = ucb.vrs[14]; - - /* Check for exception return */ - /* TODO Test with other ARM processors to verify this method. */ - if ((ucb.vrs[15] & 0xF0000000) == 0xF0000000) { - /* According to the Cortex Programming Manual (p.44), the stack address is always 8-byte aligned (Cortex-M7). - Depending on where the exception came from (MSP or PSP), we need the right SP value to work with. - - ucb.vrs[7] contains the right value, so take it and align it by 8 bytes, store it as the current - SP to work with (ucb.vrs[13]) which is then saved as the current (virtual) frame's SP. - */ - uint32_t stack; - ucb.vrs[13] = (ucb.vrs[7] & ~7); - - /* If we need to start from the MSP, we need to go down X words to find the PC, where: - X=2 if it was a non-floating-point exception - X=20 if it was a floating-point (VFP) exception - - If we need to start from the PSP, we need to go up exactly 6 words to find the PC. - See the ARMv7-M Architecture Reference Manual p.594 and Cortex-M7 Processor Programming Manual p.44/p.45 for details. - */ - if ((ucb.vrs[15] & 0xC) == 0) { - /* Return to Handler Mode: MSP (0xFFFFFF-1) */ - stack = ucb.vrs[13]; - - /* The PC is always 2 words down from the MSP, if it was a non-floating-point exception */ - stack -= 2*4; - - /* If there was a VFP exception (0xFFFFFFE1), the PC is located another 18 words down */ - if ((ucb.vrs[15] & 0xF0) == 0xE0) { - stack -= 18*4; - } - } - else { - /* Return to Thread Mode: PSP (0xFFFFFF-d) */ - stack = read_psp(); - - /* The PC is always 6 words up from the PSP */ - stack += 6*4; - } - - /* Store the PC */ - uint32_t v; - if (!cb->readW(stack,&v)) - return UNWIND_DREAD_W_FAIL; - ucb.vrs[15] = v; - stack -= 4; - - /* Store the LR */ - if (!cb->readW(stack,&v)) - return UNWIND_DREAD_W_FAIL; - ucb.vrs[14] = v; - stack -= 4; - } - - /* We are done if current frame pc is equal to the virtual pc, prevent infinite loop */ - if (frame->pc == ucb.vrs[15]) - return UNWIND_SUCCESS; - - /* Update the frame */ - frame->fp = ucb.vrs[7]; - frame->sp = ucb.vrs[13]; - frame->lr = ucb.vrs[14]; - frame->pc = ucb.vrs[15]; - - /* All good - Continue unwinding */ - return UNWIND_MORE_AVAILABLE; -} - -UnwResult UnwindByTableStart(UnwindFrame* frame, const UnwindCallbacks *cb, void *data) { - - UnwResult err = UNWIND_SUCCESS; - UnwReport entry; - - /* Use DWARF unwind information to unwind frames */ - do { - if (frame->pc == 0) { - /* Reached __exidx_end. */ - break; - } - - if (frame->pc == 0x00000001) { - /* Reached .cantunwind instruction. */ - break; - } - - /* Find the unwind index of the current frame pc */ - const UnwTabEntry *index = UnwTabSearchIndex(__exidx_start, __exidx_end, frame->pc); - - /* Clear last bit (Thumb indicator) */ - frame->pc &= 0xFFFFFFFEU; - - /* Generate the backtrace information */ - entry.address = frame->pc; - entry.function = prel31_to_addr(&index->addr_offset); - entry.name = UnwTabGetFunctionName(cb, entry.function); - if (!cb->report(data,&entry)) - break; - - /* Unwind frame and repeat */ - } while ((err = UnwTabUnwindFrame(cb, frame)) == UNWIND_MORE_AVAILABLE); - - /* All done */ - return err; -} - -#endif // __arm__ || __thumb__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.h deleted file mode 100644 index 77a1c82dbd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmbytab.h +++ /dev/null @@ -1,31 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Interface to the memory tracking sub-system. - **************************************************************************/ - -#pragma once - -#include "unwarm.h" - -typedef struct { - uint32_t vrs[16]; - uint32_t current; /* Address of current byte */ - int remaining; - int byte; -} UnwTabState; - -typedef struct { - uint32_t addr_offset; - uint32_t insn; -} UnwTabEntry; - -UnwResult UnwindByTableStart(UnwindFrame* frame, const UnwindCallbacks *cb, void *data); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp deleted file mode 100644 index cf9ac414c4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Implementation of the memory tracking sub-system. - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) -#define MODULE_NAME "UNWARMMEM" - -#include -#include "unwarmmem.h" -#include "unwarm.h" - -#define M_IsIdxUsed(a, v) !!((a)[v >> 3] & (1 << (v & 0x7))) -#define M_SetIdxUsed(a, v) ((a)[v >> 3] |= (1 << (v & 0x7))) -#define M_ClrIdxUsed(a, v) ((a)[v >> 3] &= ~(1 << (v & 0x7))) - -/** Search the memory hash to see if an entry is stored in the hash already. - * This will search the hash and either return the index where the item is - * stored, or -1 if the item was not found. - */ -static int16_t memHashIndex(MemData * const memData, const uint32_t addr) { - - const uint16_t v = addr % MEM_HASH_SIZE; - uint16_t s = v; - - do { - /* Check if the element is occupied */ - if (M_IsIdxUsed(memData->used, s)) { - /* Check if it is occupied with the sought data */ - if (memData->a[s] == addr) return s; - } - else { - /* Item is free, this is where the item should be stored */ - return s; - } - - /* Search the next entry */ - s++; - if (s > MEM_HASH_SIZE) s = 0; - } while (s != v); - - /* Search failed, hash is full and the address not stored */ - return -1; -} - -bool UnwMemHashRead(MemData * const memData, uint32_t addr,uint32_t * const data, bool * const tracked) { - - const int16_t i = memHashIndex(memData, addr); - - if (i >= 0 && M_IsIdxUsed(memData->used, i) && memData->a[i] == addr) { - *data = memData->v[i]; - *tracked = M_IsIdxUsed(memData->tracked, i); - return true; - } - else { - /* Address not found in the hash */ - return false; - } -} - -bool UnwMemHashWrite(MemData * const memData, uint32_t addr, uint32_t val, bool valValid) { - const int16_t i = memHashIndex(memData, addr); - if (i < 0) return false; /* Hash full */ - - /* Store the item */ - memData->a[i] = addr; - M_SetIdxUsed(memData->used, i); - - if (valValid) { - memData->v[i] = val; - M_SetIdxUsed(memData->tracked, i); - } - else { - #ifdef UNW_DEBUG - memData->v[i] = 0xDEADBEEF; - #endif - M_ClrIdxUsed(memData->tracked, i); - } - - return true; -} - -void UnwMemHashGC(UnwState * const state) { - - const uint32_t minValidAddr = state->regData[13].v; - MemData * const memData = &state->memData; - uint16_t t; - - for (t = 0; t < MEM_HASH_SIZE; t++) { - if (M_IsIdxUsed(memData->used, t) && (memData->a[t] < minValidAddr)) { - UnwPrintd3("MemHashGC: Free elem %d, addr 0x%08x\n", t, memData->a[t]); - M_ClrIdxUsed(memData->used, t); - } - } -} - -#endif // __arm__ || __thumb__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.h deleted file mode 100644 index 588618b34f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwarmmem.h +++ /dev/null @@ -1,21 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Interface to the memory tracking sub-system. - **************************************************************************/ - -#pragma once - -#include "unwarm.h" - -bool UnwMemHashRead(MemData * const memData, uint32_t addr, uint32_t * const data, bool * const tracked); -bool UnwMemHashWrite(MemData * const memData, uint32_t addr, uint32_t val, bool valValid); -void UnwMemHashGC(UnwState * const state); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.cpp deleted file mode 100644 index e63af1ed25..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commercially or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Implementation of the interface into the ARM unwinder. - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) - -#define MODULE_NAME "UNWINDER" - -#include -#include -#include "unwinder.h" -#include "unwarm.h" -#include "unwarmbytab.h" - -/* These symbols point to the unwind index and should be provide by the linker script */ -extern "C" const UnwTabEntry __exidx_start[]; -extern "C" const UnwTabEntry __exidx_end[]; - -// Detect if unwind information is present or not -static int HasUnwindTableInfo() { - // > 16 because there are default entries we can't supress - return ((char*)(&__exidx_end) - (char*)(&__exidx_start)) > 16 ? 1 : 0; -} - -UnwResult UnwindStart(UnwindFrame* frame, const UnwindCallbacks *cb, void *data) { - if (HasUnwindTableInfo()) { - /* We have unwind information tables */ - return UnwindByTableStart(frame, cb, data); - } - else { - - /* We don't have unwind information tables */ - UnwState state; - - /* Initialize the unwinding state */ - UnwInitState(&state, cb, data, frame->pc, frame->sp); - - /* Check the Thumb bit */ - return (frame->pc & 0x1) ? UnwStartThumb(&state) : UnwStartArm(&state); - } -} -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.h deleted file mode 100644 index 604854ad0f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwinder.h +++ /dev/null @@ -1,172 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - **************************************************************************/ -/** \file - * Interface to the ARM stack unwinding module. - **************************************************************************/ - -#pragma once - -#include - -/** \def UNW_DEBUG - * If this define is set, additional information will be produced while - * unwinding the stack to allow debug of the unwind module itself. - */ -/* #define UNW_DEBUG 1 */ - -/*************************************************************************** - * Type Definitions - **************************************************************************/ - -/** Possible results for UnwindStart to return. - */ -typedef enum { - /** Unwinding was successful and complete. */ - UNWIND_SUCCESS = 0, - - /** Not an error: More frames are available. */ - UNWIND_MORE_AVAILABLE = 1, - - /** Unsupported DWARF unwind personality. */ - UNWIND_UNSUPPORTED_DWARF_PERSONALITY = -1, - - /** Refused to perform unwind. */ - UNWIND_REFUSED = -2, - - /** Reached an invalid SP. */ - UNWIND_INVALID_SP = -3, - - /** Reached an invalid PC */ - UNWIND_INVALID_PC = -4, - - /** Unsupported DWARF instruction */ - UNWIND_UNSUPPORTED_DWARF_INSTR = -5, - - /** More than UNW_MAX_INSTR_COUNT instructions were interpreted. */ - UNWIND_EXHAUSTED = -6, - - /** Unwinding stopped because the reporting func returned false. */ - UNWIND_TRUNCATED = -7, - - /** Read data was found to be inconsistent. */ - UNWIND_INCONSISTENT = -8, - - /** Unsupported instruction or data found. */ - UNWIND_UNSUPPORTED = -9, - - /** General failure. */ - UNWIND_FAILURE = -10, - - /** Illegal instruction. */ - UNWIND_ILLEGAL_INSTR = -11, - - /** Unwinding hit the reset vector. */ - UNWIND_RESET = -12, - - /** Failed read for an instruction word. */ - UNWIND_IREAD_W_FAIL = -13, - - /** Failed read for an instruction half-word. */ - UNWIND_IREAD_H_FAIL = -14, - - /** Failed read for an instruction byte. */ - UNWIND_IREAD_B_FAIL = -15, - - /** Failed read for a data word. */ - UNWIND_DREAD_W_FAIL = -16, - - /** Failed read for a data half-word. */ - UNWIND_DREAD_H_FAIL = -17, - - /** Failed read for a data byte. */ - UNWIND_DREAD_B_FAIL = -18, - - /** Failed write for a data word. */ - UNWIND_DWRITE_W_FAIL = -19 - -} UnwResult; - -/** A backtrace report */ -typedef struct { - uint32_t function; /** Starts address of function */ - const char *name; /** Function name, or null if not available */ - uint32_t address; /** PC on that function */ -} UnwReport; - -/** Type for function pointer for result callback. - * The function is passed two parameters, the first is a void * pointer, - * and the second is the return address of the function. The bottom bit - * of the passed address indicates the execution mode; if it is set, - * the execution mode at the return address is Thumb, otherwise it is - * ARM. - * - * The return value of this function determines whether unwinding should - * continue or not. If true is returned, unwinding will continue and the - * report function maybe called again in future. If false is returned, - * unwinding will stop with UnwindStart() returning UNWIND_TRUNCATED. - */ -typedef bool (*UnwindReportFunc)(void* data, const UnwReport* bte); - -/** Structure that holds memory callback function pointers. - */ -typedef struct { - - /** Report an unwind result. */ - UnwindReportFunc report; - - /** Read a 32 bit word from memory. - * The memory address to be read is passed as \a address, and - * \a *val is expected to be populated with the read value. - * If the address cannot or should not be read, false can be - * returned to indicate that unwinding should stop. If true - * is returned, \a *val is assumed to be valid and unwinding - * will continue. - */ - bool (*readW)(const uint32_t address, uint32_t *val); - - /** Read a 16 bit half-word from memory. - * This function has the same usage as for readW, but is expected - * to read only a 16 bit value. - */ - bool (*readH)(const uint32_t address, uint16_t *val); - - /** Read a byte from memory. - * This function has the same usage as for readW, but is expected - * to read only an 8 bit value. - */ - bool (*readB)(const uint32_t address, uint8_t *val); - - #ifdef UNW_DEBUG - /** Print a formatted line for debug. */ - void (*printf)(const char *format, ...); - #endif -} UnwindCallbacks; - -/* A frame */ -typedef struct { - uint32_t fp; - uint32_t sp; - uint32_t lr; - uint32_t pc; -} UnwindFrame; - -/** Start unwinding the current stack. - * This will unwind the stack starting at the PC value supplied to in the - * link register (i.e. not a normal register) and the stack pointer value - * supplied. - * - * -If the program was compiled with -funwind-tables , it will use them to - * perform the traceback. Otherwise, brute force will be employed - * -If the program was compiled with -mpoke-function-name, then you will - * get function names in the traceback. Otherwise, you will not. - */ -UnwResult UnwindStart(UnwindFrame* frame, const UnwindCallbacks *cb, void *data); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp deleted file mode 100644 index 8cf31cadf5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commercially or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Utility functions to access memory - **************************************************************************/ - -#if defined(__arm__) || defined(__thumb__) - -#include "unwmemaccess.h" -#include "../../../inc/MarlinConfig.h" - -/* Validate address */ - -#ifdef ARDUINO_ARCH_SAM -// For DUE, valid address ranges are -// SRAM (0x20070000 - 0x20088000) (96kb) -// FLASH (0x00080000 - 0x00100000) (512kb) -// -#define START_SRAM_ADDR 0x20070000 -#define END_SRAM_ADDR 0x20088000 -#define START_FLASH_ADDR 0x00080000 -#define END_FLASH_ADDR 0x00100000 -#endif - -#ifdef TARGET_LPC1768 -// For LPC1769: -// SRAM (0x10000000 - 0x10008000) (32kb) -// FLASH (0x00000000 - 0x00080000) (512kb) -// -#define START_SRAM_ADDR 0x10000000 -#define END_SRAM_ADDR 0x10008000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00080000 -#endif - -#if 0 -// For STM32F103CBT6 -// SRAM (0x20000000 - 0x20005000) (20kb) -// FLASH (0x00000000 - 0x00020000) (128kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20005000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00020000 -#endif - -#if defined(__STM32F1__) || defined(STM32F1xx) || defined(STM32F0xx) -// For STM32F103ZET6/STM32F103VET6/STM32F0xx -// SRAM (0x20000000 - 0x20010000) (64kb) -// FLASH (0x00000000 - 0x00080000) (512kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20010000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00080000 -#endif - -#if defined(STM32F4) || defined(STM32F4xx) -// For STM32F407VET -// SRAM (0x20000000 - 0x20030000) (192kb) -// FLASH (0x08000000 - 0x08080000) (512kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20030000 -#define START_FLASH_ADDR 0x08000000 -#define END_FLASH_ADDR 0x08080000 -#endif - -#if MB(THE_BORG) -// For STM32F765 in BORG -// SRAM (0x20000000 - 0x20080000) (512kb) -// FLASH (0x08000000 - 0x08100000) (1024kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20080000 -#define START_FLASH_ADDR 0x08000000 -#define END_FLASH_ADDR 0x08100000 -#endif - -#if MB(REMRAM_V1) -// For STM32F765VI in RemRam v1 -// SRAM (0x20000000 - 0x20080000) (512kb) -// FLASH (0x08000000 - 0x08200000) (2048kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20080000 -#define START_FLASH_ADDR 0x08000000 -#define END_FLASH_ADDR 0x08200000 -#endif - -#ifdef __MK20DX256__ -// For MK20DX256 in TEENSY 3.1 or TEENSY 3.2 -// SRAM (0x1FFF8000 - 0x20008000) (64kb) -// FLASH (0x00000000 - 0x00040000) (256kb) -// -#define START_SRAM_ADDR 0x1FFF8000 -#define END_SRAM_ADDR 0x20008000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00040000 -#endif - -#ifdef __MK64FX512__ -// For MK64FX512 in TEENSY 3.5 -// SRAM (0x1FFF0000 - 0x20020000) (192kb) -// FLASH (0x00000000 - 0x00080000) (512kb) -// -#define START_SRAM_ADDR 0x1FFF0000 -#define END_SRAM_ADDR 0x20020000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00080000 -#endif - -#ifdef __MK66FX1M0__ -// For MK66FX1M0 in TEENSY 3.6 -// SRAM (0x1FFF0000 - 0x20030000) (256kb) -// FLASH (0x00000000 - 0x00140000) (1.25Mb) -// -#define START_SRAM_ADDR 0x1FFF0000 -#define END_SRAM_ADDR 0x20030000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00140000 -#endif - -#ifdef __SAMD51P20A__ -// For SAMD51x20, valid address ranges are -// SRAM (0x20000000 - 0x20040000) (256kb) -// FLASH (0x00000000 - 0x00100000) (1024kb) -// -#define START_SRAM_ADDR 0x20000000 -#define END_SRAM_ADDR 0x20040000 -#define START_FLASH_ADDR 0x00000000 -#define END_FLASH_ADDR 0x00100000 -#endif - -static bool validate_addr(uint32_t addr) { - - // Address must be in SRAM range - if (addr >= START_SRAM_ADDR && addr < END_SRAM_ADDR) - return true; - - // Or in FLASH range - if (addr >= START_FLASH_ADDR && addr < END_FLASH_ADDR) - return true; - - return false; -} - -bool UnwReadW(const uint32_t a, uint32_t *v) { - if (!validate_addr(a)) - return false; - - *v = *(uint32_t *)a; - return true; -} - -bool UnwReadH(const uint32_t a, uint16_t *v) { - if (!validate_addr(a)) - return false; - - *v = *(uint16_t *)a; - return true; -} - -bool UnwReadB(const uint32_t a, uint8_t *v) { - if (!validate_addr(a)) - return false; - - *v = *(uint8_t *)a; - return true; -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.h deleted file mode 100644 index fe42bd9485..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/backtrace/unwmemaccess.h +++ /dev/null @@ -1,22 +0,0 @@ -/*************************************************************************** - * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk - * Updated, adapted and several bug fixes on 2018 by Eduardo José Tagle - * - * This program is PUBLIC DOMAIN. - * This means that there is no copyright and anyone is able to take a copy - * for free and use it as they wish, with or without modifications, and in - * any context, commerically or otherwise. The only limitation is that I - * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. - *************************************************************************** - * File Description: Utility functions to access memory - **************************************************************************/ - -#pragma once - -#include "unwarm.h" -#include - -bool UnwReadW(const uint32_t a, uint32_t *v); -bool UnwReadH(const uint32_t a, uint16_t *v); -bool UnwReadB(const uint32_t a, uint8_t *v); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_i2c.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_i2c.cpp deleted file mode 100644 index 2752b7d4cc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_i2c.cpp +++ /dev/null @@ -1,120 +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 . - * - */ - -/** - * Description: functions for I2C connected external EEPROM. - * Not platform dependent. - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(I2C_EEPROM) - -#include "../HAL.h" -#include - -// ------------------------ -// Private Variables -// ------------------------ - -static uint8_t eeprom_device_address = 0x50; - -// ------------------------ -// Public functions -// ------------------------ - -static void eeprom_init() { - Wire.begin(); -} - -void eeprom_write_byte(uint8_t *pos, unsigned char value) { - unsigned eeprom_address = (unsigned) pos; - - eeprom_init(); - - Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address)); - Wire.write((int)(eeprom_address >> 8)); // MSB - Wire.write((int)(eeprom_address & 0xFF)); // LSB - Wire.write(value); - Wire.endTransmission(); - - // wait for write cycle to complete - // this could be done more efficiently with "acknowledge polling" - delay(5); -} - -// WARNING: address is a page address, 6-bit end will wrap around -// also, data can be maximum of about 30 bytes, because the Wire library has a buffer of 32 bytes -void eeprom_update_block(const void *pos, void* eeprom_address, size_t n) { - eeprom_init(); - - Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address)); - Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB - Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB - Wire.endTransmission(); - - uint8_t *ptr = (uint8_t*)pos; - uint8_t flag = 0; - Wire.requestFrom(eeprom_device_address, (byte)n); - for (byte c = 0; c < n && Wire.available(); c++) - flag |= Wire.read() ^ ptr[c]; - - if (flag) { - Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address)); - Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB - Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB - Wire.write((uint8_t*)pos, n); - Wire.endTransmission(); - - // wait for write cycle to complete - // this could be done more efficiently with "acknowledge polling" - delay(5); - } -} - -uint8_t eeprom_read_byte(uint8_t *pos) { - unsigned eeprom_address = (unsigned)pos; - - eeprom_init(); - - Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address)); - Wire.write((int)(eeprom_address >> 8)); // MSB - Wire.write((int)(eeprom_address & 0xFF)); // LSB - Wire.endTransmission(); - Wire.requestFrom(eeprom_device_address, (byte)1); - return Wire.available() ? Wire.read() : 0xFF; -} - -// Don't read more than 30..32 bytes at a time! -void eeprom_read_block(void* pos, const void* eeprom_address, size_t n) { - eeprom_init(); - - Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address)); - Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB - Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB - Wire.endTransmission(); - Wire.requestFrom(eeprom_device_address, (byte)n); - for (byte c = 0; c < n; c++ ) - if (Wire.available()) *((uint8_t*)pos + c) = Wire.read(); -} - -#endif // I2C_EEPROM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_spi.cpp deleted file mode 100644 index 35e7d9b0a9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/eeprom_spi.cpp +++ /dev/null @@ -1,118 +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 . - * - */ - -/** - * Description: functions for SPI connected external EEPROM. - * Not platform dependent. - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SPI_EEPROM) - -#include "../HAL.h" - -#define CMD_WREN 6 // WREN -#define CMD_READ 2 // WRITE -#define CMD_WRITE 2 // WRITE - -uint8_t eeprom_read_byte(uint8_t* pos) { - uint8_t v; - uint8_t eeprom_temp[3]; - - // set read location - // begin transmission from device - eeprom_temp[0] = CMD_READ; - eeprom_temp[1] = ((unsigned)pos>>8) & 0xFF; // addr High - eeprom_temp[2] = (unsigned)pos& 0xFF; // addr Low - WRITE(SPI_EEPROM1_CS, HIGH); - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3); - - v = spiRec(SPI_CHAN_EEPROM1); - WRITE(SPI_EEPROM1_CS, HIGH); - return v; -} - -void eeprom_read_block(void* dest, const void* eeprom_address, size_t n) { - uint8_t eeprom_temp[3]; - - // set read location - // begin transmission from device - eeprom_temp[0] = CMD_READ; - eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF; // addr High - eeprom_temp[2] = (unsigned)eeprom_address& 0xFF; // addr Low - WRITE(SPI_EEPROM1_CS, HIGH); - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3); - - uint8_t *p_dest = (uint8_t *)dest; - while (n--) - *p_dest++ = spiRec(SPI_CHAN_EEPROM1); - WRITE(SPI_EEPROM1_CS, HIGH); -} - -void eeprom_write_byte(uint8_t* pos, uint8_t value) { - uint8_t eeprom_temp[3]; - - /*write enable*/ - eeprom_temp[0] = CMD_WREN; - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 1); - WRITE(SPI_EEPROM1_CS, HIGH); - delay(1); - - /*write addr*/ - eeprom_temp[0] = CMD_WRITE; - eeprom_temp[1] = ((unsigned)pos>>8) & 0xFF; //addr High - eeprom_temp[2] = (unsigned)pos & 0xFF; //addr Low - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3); - - spiSend(SPI_CHAN_EEPROM1, value); - WRITE(SPI_EEPROM1_CS, HIGH); - delay(7); // wait for page write to complete -} - -void eeprom_update_block(const void* src, void* eeprom_address, size_t n) { - uint8_t eeprom_temp[3]; - - /*write enable*/ - eeprom_temp[0] = CMD_WREN; - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 1); - WRITE(SPI_EEPROM1_CS, HIGH); - delay(1); - - /*write addr*/ - eeprom_temp[0] = CMD_WRITE; - eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF; //addr High - eeprom_temp[2] = (unsigned)eeprom_address & 0xFF; //addr Low - WRITE(SPI_EEPROM1_CS, LOW); - spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3); - - spiSend(SPI_CHAN_EEPROM1, (const uint8_t*)src, n); - WRITE(SPI_EEPROM1_CS, HIGH); - delay(7); // wait for page write to complete -} - -#endif // SPI_EEPROM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/math_32bit.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/math_32bit.h deleted file mode 100644 index a69992a655..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/math_32bit.h +++ /dev/null @@ -1,31 +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 - -#include "../../core/macros.h" - -/** - * Math helper functions for 32 bit CPUs - */ -static FORCE_INLINE uint32_t MultiU32X24toH32(uint32_t longIn1, uint32_t longIn2) { - return ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.cpp deleted file mode 100644 index 9aed03a0c8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ -#include "../../inc/MarlinConfigPre.h" - -#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) - - #include "persistent_store_api.h" - PersistentStore persistentStore; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.h deleted file mode 100644 index 02013120a7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/persistent_store_api.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 - -#include -#include - -#include "../../libs/crc16.h" - -class PersistentStore { -public: - static bool access_start(); - static bool access_finish(); - static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc); - static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true); - static size_t capacity(); - - static inline bool write_data(const int pos, const uint8_t* value, const size_t size=sizeof(uint8_t)) { - int data_pos = pos; - uint16_t crc = 0; - return write_data(data_pos, value, size, &crc); - } - - static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } - - static inline bool read_data(const int pos, uint8_t* value, const size_t size=1) { - int data_pos = pos; - uint16_t crc = 0; - return read_data(data_pos, value, size, &crc); - } -}; - -extern PersistentStore persistentStore; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.cpp deleted file mode 100644 index b5975e58e7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.cpp +++ /dev/null @@ -1,159 +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 . - * - */ - -/** - * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - */ - -/** - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin) - Attach a servo motor to an i/o pin. - * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds - * Default min is 544, max is 2400 - * - * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) - * writeMicroseconds() - Set the servo pulse width in microseconds. - * move(pin, angle) - Sequence of attach(pin), write(angle), safe_delay(servo_delay[servoIndex]). - * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after servo_delay[servoIndex]. - * read() - Get the last-written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Get the last-written servo pulse width in microseconds. - * attached() - Return true if a servo is attached. - * detach() - Stop an attached servo from pulsing its i/o pin. - * - */ - -#include "../../inc/MarlinConfig.h" - -#if SHARED_SERVOS - -#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 - -#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 ***********************/ - -static boolean isTimerActive(timer16_Sequence_t timer) { - // returns true if any servo is active on this timer - for (uint8_t channel = 0; channel < SERVOS_PER_TIMER; channel++) { - if (SERVO(timer, channel).Pin.isActive) - return true; - } - return false; -} - -/****************** end of static functions ******************************/ - -Servo::Servo() { - if (ServoCount < MAX_SERVOS) { - servoIndex = ServoCount++; // assign a servo index to this instance - servo_info[servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 - } - else - servoIndex = INVALID_SERVO; // too many servos -} - -int8_t Servo::attach(const int inPin) { - return attach(inPin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); -} - -int8_t Servo::attach(const int inPin, const int inMin, const int inMax) { - - if (servoIndex >= MAX_SERVOS) return -1; - - 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 - 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[servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive - - return servoIndex; -} - -void Servo::detach() { - 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(min), SERVO_MAX(max)); - writeMicroseconds(value); -} - -void Servo::writeMicroseconds(int value) { - // calculate and store the values for the given channel - byte channel = servoIndex; - if (channel < MAX_SERVOS) { // ensure channel is valid - // ensure pulse width is valid - 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; - servo_info[channel].ticks = value; - CRITICAL_SECTION_END; - } -} - -// return the value as degrees -int Servo::read() { return map(readMicroseconds() + 1, SERVO_MIN(min), SERVO_MAX(max), 0, 180); } - -int Servo::readMicroseconds() { - return (servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[servoIndex].ticks) + (TRIM_DURATION); -} - -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 (attach(0) >= 0) { - write(value); - safe_delay(servo_delay[servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - detach(); - #endif - } -} - -#endif // SHARED_SERVOS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.h deleted file mode 100644 index e4905b7295..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo.h +++ /dev/null @@ -1,116 +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 - -/** - * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * The sequence used to seize timers is defined in timers.h - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin ) - Attaches a servo motor to an i/o pin. - * attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds - * default min is 544, max is 2400 - * - * write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) - * writeMicroseconds() - Sets the servo pulse width in microseconds - * read() - Gets the last written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) - * attached() - Returns true if there is a servo attached. - * detach() - Stops an attached servos from pulsing its i/o pin. - * move(angle) - Sequence of attach(0), write(angle), - * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. - */ - -#if IS_TEENSY32 - #include "../HAL_TEENSY31_32/Servo.h" -#elif IS_TEENSY35 || IS_TEENSY36 - #include "../HAL_TEENSY35_36/Servo.h" -#elif defined(TARGET_LPC1768) - #include "../HAL_LPC1768/Servo.h" -#elif defined(__STM32F1__) || defined(TARGET_STM32F1) - #include "../HAL_STM32F1/Servo.h" -#elif defined(STM32GENERIC) && defined(STM32F4) - #include "../HAL_STM32_F4_F7/Servo.h" -#elif defined(ARDUINO_ARCH_STM32) - #include "../HAL_STM32/Servo.h" -#elif defined(ARDUINO_ARCH_ESP32) - #include "../HAL_ESP32/Servo.h" -#else - #include - - #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." - #endif - - #define Servo_VERSION 2 // software version of this library - - class Servo { - public: - Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - int8_t attach(const int pin, const int min, const int max); // as above but also sets min and max values for writes. - void detach(); - void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - void writeMicroseconds(int value); // write pulse width in microseconds - void move(const int value); // attach the servo, then move to value - // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach - int read(); // returns current pulse width as an angle between 0 and 180 degrees - int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) - bool attached(); // return true if this servo is attached, otherwise false - - private: - uint8_t servoIndex; // index into the channel data for this servo - int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH - int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH - }; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo_private.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo_private.h deleted file mode 100644 index 1d4cdc7e3e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/HAL/shared/servo_private.h +++ /dev/null @@ -1,98 +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 - -/** - * servo_private.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - * Copyright (c) 2009 Michael Margolis. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -// Architecture specific include -#ifdef __AVR__ - #include "../HAL_AVR/ServoTimers.h" -#elif defined(ARDUINO_ARCH_SAM) - #include "../HAL_DUE/ServoTimers.h" -#elif defined(__SAMD51__) - #include "../HAL_SAMD51/ServoTimers.h" -#else - #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor." -#endif - -// Macros - -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds - -#define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer -#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER) - -#define INVALID_SERVO 255 // flag indicating an invalid servo index - -// Convert microseconds to ticks and back (PRESCALER depends on architecture) -#define usToTicks(_us) (clockCyclesPerMicrosecond() * (_us) / (SERVO_TIMER_PRESCALER)) -#define ticksToUs(_ticks) (unsigned(_ticks) * (SERVO_TIMER_PRESCALER) / clockCyclesPerMicrosecond()) - -// convenience macros -#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo -#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // returns the index of the servo on this timer -#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // macro to access servo index by timer and channel -#define SERVO(_timer,_channel) (servo_info[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel - -// Types - -typedef struct { - uint8_t nbr : 7 ; // a pin number from 0 to 127 - uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false -} ServoPin_t; - -typedef struct { - ServoPin_t Pin; - unsigned int ticks; -} ServoInfo_t; - -// Global variables - -extern uint8_t ServoCount; -extern ServoInfo_t servo_info[MAX_SERVOS]; - -// Public functions - -extern void initISR(timer16_Sequence_t timer); -extern void finISR(timer16_Sequence_t timer); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.cpp deleted file mode 100644 index c6987f473a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.cpp +++ /dev/null @@ -1,1151 +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 . - * - */ - -/** - * About Marlin - * - * This firmware is a mashup between Sprinter and grbl. - * - https://github.com/kliment/Sprinter - * - https://github.com/grbl/grbl - */ - -#include "Marlin.h" - -#include "core/utility.h" -#include "lcd/ultralcd.h" -#include "module/motion.h" -#include "module/planner.h" -#include "module/stepper.h" -#include "module/endstops.h" -#include "module/probe.h" -#include "module/temperature.h" -#include "sd/cardreader.h" -#include "module/configuration_store.h" -#include "module/printcounter.h" // PrintCounter or Stopwatch -#include "feature/closedloop.h" - -#include "HAL/shared/Delay.h" - -#include "module/stepper/indirection.h" - -#ifdef ARDUINO - #include -#endif -#include -#include "libs/nozzle.h" - -#include "gcode/gcode.h" -#include "gcode/parser.h" -#include "gcode/queue.h" - -#if ENABLED(TOUCH_BUTTONS) - #include "feature/touch/xpt2046.h" -#endif - -#if ENABLED(HOST_ACTION_COMMANDS) - #include "feature/host_actions.h" -#endif - -#if USE_BEEPER - #include "libs/buzzer.h" -#endif - -#if ENABLED(DIGIPOT_I2C) - #include "feature/digipot/digipot.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "feature/mixing.h" -#endif - -#if ENABLED(MAX7219_DEBUG) - #include "feature/Max7219_Debug_LEDs.h" -#endif - -#if HAS_COLOR_LEDS - #include "feature/leds/leds.h" -#endif - -#if ENABLED(BLTOUCH) - #include "feature/bltouch.h" -#endif - -#if ENABLED(POLL_JOG) - #include "feature/joystick.h" -#endif - -#if HAS_SERVOS - #include "module/servo.h" -#endif - -#if ENABLED(DAC_STEPPER_CURRENT) - #include "feature/dac/stepper_dac.h" -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) - #include "feature/twibus.h" - TWIBus i2c; -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - #include "feature/I2CPositionEncoder.h" -#endif - -#if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF) - #include "feature/tmc_util.h" -#endif - -#if HAS_CUTTER - #include "feature/spindle_laser.h" -#endif - -#if ENABLED(SDSUPPORT) - CardReader card; -#endif - -#if ENABLED(G38_PROBE_TARGET) - uint8_t G38_move; // = 0 - bool G38_did_trigger; // = false -#endif - -#if ENABLED(DELTA) - #include "module/delta.h" -#elif IS_SCARA - #include "module/scara.h" -#endif - -#if HAS_LEVELING - #include "feature/bedlevel/bedlevel.h" -#endif - -#if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) - #include "feature/pause.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "feature/power_loss_recovery.h" -#endif - -#if ENABLED(CANCEL_OBJECTS) - #include "feature/cancel_object.h" -#endif - -#if HAS_FILAMENT_SENSOR - #include "feature/runout.h" -#endif - -#if ENABLED(TEMP_STAT_LEDS) - #include "feature/leds/tempstat.h" -#endif - -#if HAS_CASE_LIGHT - #include "feature/caselight.h" -#endif - -#if HAS_FANMUX - #include "feature/fanmux.h" -#endif - -#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #include "module/tool_change.h" -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - #include "feature/controllerfan.h" -#endif - -#if ENABLED(PRUSA_MMU2) - #include "feature/prusa_MMU2/mmu2.h" -#endif - -#if HAS_DRIVER(L6470) - #include "libs/L6470/L6470_Marlin.h" -#endif - -const char NUL_STR[] PROGMEM = "", - G28_STR[] PROGMEM = "G28", - M21_STR[] PROGMEM = "M21", - M23_STR[] PROGMEM = "M23 %s", - M24_STR[] PROGMEM = "M24", - SP_X_STR[] PROGMEM = " X", - SP_Y_STR[] PROGMEM = " Y", - SP_Z_STR[] PROGMEM = " Z", - SP_E_STR[] PROGMEM = " E"; - -bool Running = true; - -// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop -bool wait_for_heatup = true; - -// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop -#if HAS_RESUME_CONTINUE - bool wait_for_user; // = false; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - bool suspend_auto_report; // = false -#endif - -// Inactivity shutdown -millis_t max_inactive_time, // = 0 - stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL; - -#if PIN_EXISTS(CHDK) - extern millis_t chdk_timeout; -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - I2CPositionEncodersMgr I2CPEM; -#endif - -/** - * *************************************************************************** - * ******************************** FUNCTIONS ******************************** - * *************************************************************************** - */ - -void setup_killpin() { - #if HAS_KILL - SET_INPUT_PULLUP(KILL_PIN); - #endif -} - -void setup_powerhold() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); - #endif - #if ENABLED(PSU_CONTROL) - #if ENABLED(PSU_DEFAULT_OFF) - powersupply_on = true; PSU_OFF(); - #else - powersupply_on = false; PSU_ON(); - #endif - #endif -} - -/** - * Stepper Reset (RigidBoard, et.al.) - */ -#if HAS_STEPPER_RESET - void disableStepperDrivers() { OUT_WRITE(STEPPER_RESET_PIN, LOW); } // Drive down to keep motor driver chips in reset - void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); } // Set to input, allowing pullups to pull the pin high -#endif - -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - - void i2c_on_receive(int bytes) { // just echo all bytes received to serial - i2c.receive(bytes); - } - - void i2c_on_request() { // just send dummy data for now - i2c.reply("Hello World!\n"); - } - -#endif - -/** - * Sensitive pin test for M42, M226 - */ - -#include "pins/sensitive_pins.h" - -bool pin_is_protected(const pin_t pin) { - static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; - for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) { - pin_t sensitive_pin; - memcpy_P(&sensitive_pin, &sensitive_pins[i], sizeof(pin_t)); - if (pin == sensitive_pin) return true; - } - return false; -} - -void protected_pin_err() { - SERIAL_ERROR_MSG(MSG_ERR_PROTECTED_PIN); -} - -void quickstop_stepper() { - planner.quick_stop(); - planner.synchronize(); - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); -} - -void enable_e_steppers() { - #define _ENA_E(N) enable_E##N(); - REPEAT(E_STEPPERS, _ENA_E) -} - -void enable_all_steppers() { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - enable_X(); - enable_Y(); - enable_Z(); - enable_e_steppers(); -} - -void disable_e_steppers() { - #define _DIS_E(N) disable_E##N(); - REPEAT(E_STEPPERS, _DIS_E) -} - -void disable_e_stepper(const uint8_t e) { - #define _CASE_DIS_E(N) case N: disable_E##N(); break; - switch (e) { - REPEAT(EXTRUDERS, _CASE_DIS_E) - } -} - -void disable_all_steppers() { - disable_X(); - disable_Y(); - disable_Z(); - disable_e_steppers(); -} - -#if ENABLED(G29_RETRY_AND_RECOVER) - - void event_probe_failure() { - #ifdef ACTION_ON_G29_FAILURE - host_action(PSTR(ACTION_ON_G29_FAILURE)); - #endif - #ifdef G29_FAILURE_COMMANDS - gcode.process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS)); - #endif - #if ENABLED(G29_HALT_ON_FAILURE) - #ifdef ACTION_ON_CANCEL - host_action_cancel(); - #endif - kill(GET_TEXT(MSG_LCD_PROBING_FAILED)); - #endif - } - - void event_probe_recover() { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss")); - #endif - #ifdef ACTION_ON_G29_RECOVER - host_action(PSTR(ACTION_ON_G29_RECOVER)); - #endif - #ifdef G29_RECOVER_COMMANDS - gcode.process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS)); - #endif - } - -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "feature/pause.h" -#else - constexpr bool did_pause_print = false; -#endif - -/** - * Printing is active when the print job timer is running - */ -bool printingIsActive() { - return !did_pause_print && (print_job_timer.isRunning() || IS_SD_PRINTING()); -} - -/** - * Printing is paused according to SD or host indicators - */ -bool printingIsPaused() { - return did_pause_print || print_job_timer.isPaused() || IS_SD_PAUSED(); -} - -void startOrResumeJob() { - if (!printingIsPaused()) { - #if ENABLED(CANCEL_OBJECTS) - cancelable.reset(); - #endif - #if ENABLED(LCD_SHOW_E_TOTAL) - e_move_accumulator = 0; - #endif - #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - ui.reset_remaining_time(); - #endif - } - print_job_timer.start(); -} - -#if ENABLED(SDSUPPORT) - - void abortSDPrinting() { - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - queue.clear(); - quickstop_stepper(); - print_job_timer.stop(); - #if DISABLED(SD_ABORT_NO_COOLDOWN) - thermalManager.disable_all_heaters(); - #endif - thermalManager.zero_fan_speeds(); - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - #ifdef EVENT_GCODE_SD_STOP - queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); - #endif - } - -#endif - -/** - * Manage several activities: - * - Check for Filament Runout - * - Keep the command buffer full - * - Check for maximum inactive time between commands - * - Check for maximum inactive time between stepper commands - * - Check if CHDK_PIN needs to go LOW - * - Check for KILL button held down - * - Check for HOME button held down - * - Check if cooling fan needs to be switched on - * - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT) - * - Pulse FET_SAFETY_PIN if it exists - */ - -void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { - - #if HAS_FILAMENT_SENSOR - runout.run(); - #endif - - if (queue.length < BUFSIZE) queue.get_available_commands(); - - const millis_t ms = millis(); - - if (max_inactive_time && ELAPSED(ms, gcode.previous_move_ms + max_inactive_time)) { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); - kill(); - } - - // Prevent steppers timing-out in the middle of M600 - #if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) - #define MOVE_AWAY_TEST !did_pause_print - #else - #define MOVE_AWAY_TEST true - #endif - - if (stepper_inactive_time) { - static bool already_shutdown_steppers; // = false - if (planner.has_blocks_queued()) - gcode.reset_stepper_timeout(); - else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, gcode.previous_move_ms + stepper_inactive_time)) { - if (!already_shutdown_steppers) { - already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this - #if ENABLED(DISABLE_INACTIVE_X) - disable_X(); - #endif - #if ENABLED(DISABLE_INACTIVE_Y) - disable_Y(); - #endif - #if ENABLED(DISABLE_INACTIVE_Z) - disable_Z(); - #endif - #if ENABLED(DISABLE_INACTIVE_E) - disable_e_steppers(); - #endif - #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) - if (ubl.lcd_map_control) { - ubl.lcd_map_control = false; - ui.defer_status_screen(false); - } - #endif - } - } - else - already_shutdown_steppers = false; - } - - #if PIN_EXISTS(CHDK) // Check if pin should be set to LOW (after M240 set it HIGH) - if (chdk_timeout && ELAPSED(ms, chdk_timeout)) { - chdk_timeout = 0; - WRITE(CHDK_PIN, LOW); - } - #endif - - #if HAS_KILL - - // Check if the kill button was pressed and wait just in case it was an accidental - // key kill key press - // ------------------------------------------------------------------------------- - static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; - if (!READ(KILL_PIN)) - killCount++; - else if (killCount > 0) - killCount--; - - // Exceeded threshold and we can confirm that it was not accidental - // KILL the machine - // ---------------------------------------------------------------- - if (killCount >= KILL_DELAY) { - SERIAL_ERROR_MSG(MSG_KILL_BUTTON); - kill(); - } - #endif - - #if HAS_HOME - // Handle a standalone HOME button - constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL; - static millis_t next_home_key_ms; // = 0 - if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { // HOME_PIN goes LOW when pressed - const millis_t ms = millis(); - if (ELAPSED(ms, next_home_key_ms)) { - next_home_key_ms = ms + HOME_DEBOUNCE_DELAY; - LCD_MESSAGEPGM(MSG_AUTO_HOME); - queue.enqueue_now_P(G28_STR); - } - } - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down - #endif - - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.check(); - #endif - - #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP - && ELAPSED(ms, gcode.previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && !planner.has_blocks_queued() - ) { - #if ENABLED(SWITCHING_EXTRUDER) - bool oldstatus; - switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ(); enable_E0(); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break; - #if E_STEPPERS > 2 - case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - bool oldstatus; - switch (active_extruder) { - default: - #define _CASE_EN(N) case N: oldstatus = E##N_ENABLE_READ(); enable_E##N(); break; - REPEAT(E_STEPPERS, _CASE_EN); - } - #endif - - const float olde = current_position.e; - current_position.e += EXTRUDER_RUNOUT_EXTRUDE; - line_to_current_position(MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED)); - current_position.e = olde; - planner.set_e_position_mm(olde); - planner.synchronize(); - - #if ENABLED(SWITCHING_EXTRUDER) - switch (active_extruder) { - default: oldstatus = E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 4: case 5: oldstatus = E2_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - } - #else // !SWITCHING_EXTRUDER - switch (active_extruder) { - #define _CASE_RESTORE(N) case N: E##N##_ENABLE_WRITE(oldstatus); break; - REPEAT(E_STEPPERS, _CASE_RESTORE); - } - #endif // !SWITCHING_EXTRUDER - - gcode.reset_stepper_timeout(); - } - #endif // EXTRUDER_RUNOUT_PREVENT - - #if ENABLED(DUAL_X_CARRIAGE) - // handle delayed move timeout - if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) { - // travel moves have been received so enact them - delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - destination = current_position; - prepare_move_to_destination(); - } - #endif - - #if ENABLED(TEMP_STAT_LEDS) - handle_status_leds(); - #endif - - #if ENABLED(MONITOR_DRIVER_STATUS) - monitor_tmc_drivers(); - #endif - - #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L6470.monitor_driver(); - #endif - - // Limit check_axes_activity frequency to 10Hz - static millis_t next_check_axes_ms = 0; - if (ELAPSED(ms, next_check_axes_ms)) { - planner.check_axes_activity(); - next_check_axes_ms = ms + 100UL; - } - - #if PIN_EXISTS(FET_SAFETY) - static millis_t FET_next; - if (ELAPSED(ms, FET_next)) { - FET_next = ms + FET_SAFETY_DELAY; // 2uS pulse every FET_SAFETY_DELAY mS - OUT_WRITE(FET_SAFETY_PIN, !FET_SAFETY_INVERTED); - DELAY_US(2); - WRITE(FET_SAFETY_PIN, FET_SAFETY_INVERTED); - } - #endif -} - -/** - * Standard idle routine keeps the machine alive - */ -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - 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 - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - && ELAPSED(millis(), sg_guard_period) - #endif - ) { - for (uint8_t i = 4; i--;) // Read SGT 4 times per idle loop - if (endstops.tmc_spi_homing_check()) break; - } - #endif - - #if ENABLED(MAX7219_DEBUG) - max7219.idle_tasks(); - #endif - - ui.update(); - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - gcode.host_keepalive(); - #endif - - manage_inactivity( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - no_stepper_sleep - #endif - ); - - thermalManager.manage_heater(); - - #if ENABLED(PRINTCOUNTER) - print_job_timer.tick(); - #endif - - #if USE_BEEPER - buzzer.tick(); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - static millis_t i2cpem_next_update_ms; - if (planner.has_blocks_queued()) { - const millis_t ms = millis(); - if (ELAPSED(ms, i2cpem_next_update_ms)) { - I2CPEM.update(); - i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS; - } - } - #endif - - #ifdef HAL_IDLETASK - HAL_idletask(); - #endif - - #if HAS_AUTO_REPORTING - if (!suspend_auto_report) { - #if ENABLED(AUTO_REPORT_TEMPERATURES) - thermalManager.auto_report_temperatures(); - #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); - #endif - } - #endif - - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - Sd2Card::idle(); - #endif - - #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_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) { - thermalManager.disable_all_heaters(); - - SERIAL_ERROR_MSG(MSG_ERR_KILLED); - - #if HAS_DISPLAY - ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR); - #else - UNUSED(lcd_error); - UNUSED(lcd_component); - #endif - - #ifdef ACTION_ON_KILL - host_action_kill(); - #endif - - minkill(steppers_off); -} - -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); - - cli(); // Stop interrupts - - // Wait to ensure all interrupts stopped - for (int i = 1000; i--;) DELAY_US(250); - - // 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 ENABLED(PSU_CONTROL) - PSU_OFF(); - #endif - - #if HAS_SUICIDE - suicide(); - #endif - - #if HAS_KILL - - // Wait for kill to be released - while (!READ(KILL_PIN)) watchdog_refresh(); - - // Wait for kill to be pressed - while (READ(KILL_PIN)) watchdog_refresh(); - - void (*resetFunc)() = 0; // Declare resetFunc() at address 0 - resetFunc(); // Jump to address 0 - - #else // !HAS_KILL - - for (;;) watchdog_refresh(); // Wait for reset - - #endif // !HAS_KILL -} - -/** - * Turn off heaters and stop the print in progress - * After a stop the machine may be resumed with M999 - */ -void stop() { - thermalManager.disable_all_heaters(); // 'unpause' taken care of in here - print_job_timer.stop(); - - #if ENABLED(PROBING_FANS_OFF) - if (thermalManager.fans_paused) thermalManager.set_fans_paused(false); // put things back the way they were - #endif - - if (IsRunning()) { - queue.stop(); - SERIAL_ERROR_MSG(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - safe_delay(350); // allow enough time for messages to get out before stopping - Running = false; - } -} - -/** - * Marlin entry-point: Set up before the program loop - * - Set up the kill pin, filament runout, power hold - * - Start the serial port - * - Print startup messages and diagnostics - * - Get EEPROM or default settings - * - Initialize managers for: - * • temperature - * • planner - * • watchdog - * • stepper - * • photo pin - * • servos - * • LCD controller - * • Digipot I2C - * • Z probe sled - * • status LEDs - */ -void setup() { - - HAL_init(); - - #if HAS_DRIVER(L6470) - L6470.init(); // setup SPI and then init chips - #endif - - #if ENABLED(MAX7219_DEBUG) - max7219.init(); - #endif - - #if ENABLED(DISABLE_DEBUG) - // Disable any hardware debug to free up pins for IO - #ifdef JTAGSWD_DISABLE - JTAGSWD_DISABLE(); - #elif defined(JTAG_DISABLE) - JTAG_DISABLE(); - #else - #error "DISABLE_DEBUG is not supported for the selected MCU/Board" - #endif - #elif ENABLED(DISABLE_JTAG) - // Disable JTAG to free up pins for IO - #ifdef JTAG_DISABLE - JTAG_DISABLE(); - #else - #error "DISABLE_JTAG is not supported for the selected MCU/Board" - #endif - #endif - - #if HAS_FILAMENT_SENSOR - runout.setup(); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.setup(); - #endif - - setup_killpin(); - - #if HAS_TMC220x - tmc_serial_begin(); - #endif - - setup_powerhold(); - - #if HAS_STEPPER_RESET - disableStepperDrivers(); - #endif - - #if NUM_SERIAL > 0 - MYSERIAL0.begin(BAUDRATE); - #if NUM_SERIAL > 1 - MYSERIAL1.begin(BAUDRATE); - #endif - #endif - - #if NUM_SERIAL > 0 - uint32_t serial_connect_timeout = millis() + 1000UL; - while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - #if NUM_SERIAL > 1 - serial_connect_timeout = millis() + 1000UL; - while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - #endif - #endif - - SERIAL_ECHOLNPGM("start"); - SERIAL_ECHO_START(); - - #if TMC_HAS_SPI - #if DISABLED(TMC_USE_SW_SPI) - SPI.begin(); - #endif - tmc_init_cs_pins(); - #endif - - #ifdef BOARD_INIT - BOARD_INIT(); - #endif - - // Check startup - does nothing if bootloader sets MCUSR to 0 - byte mcu = HAL_get_reset_source(); - if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); - if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); - if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); - if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); - if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); - HAL_clear_reset_source(); - - SERIAL_ECHOPGM(MSG_MARLIN); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION); - SERIAL_EOL(); - - #if defined(STRING_DISTRIBUTION_DATE) && defined(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 - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_FREE_MEMORY, freeMemory(), MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE)); - - // 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(); - #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN) - ui.show_bootscreen(); - #endif - - #if ENABLED(SDSUPPORT) - card.mount(); // Mount the SD card before settings.first_load - #endif - - // Load data from EEPROM if available (or use defaults) - // This also updates variables in the planner, elsewhere - settings.first_load(); - - #if ENABLED(TOUCH_BUTTONS) - touch.init(); - #endif - - #if HAS_M206_COMMAND - // Initialize current position based on home_offset - current_position += home_offset; - #endif - - // Vital to init stepper/planner equivalent for current_position - sync_plan_position(); - - thermalManager.init(); // Initialize temperature loop - - print_job_timer.init(); // Initial setup of print job timer - - ui.reset_status(); // Print startup message after print statistics are loaded - - endstops.init(); // Init endstops and pullups - - stepper.init(); // Init stepper. This enables interrupts! - - #if HAS_SERVOS - servo_init(); - #endif - - #if HAS_Z_SERVO_PROBE - servo_probe_init(); - #endif - - #if HAS_PHOTOGRAPH - OUT_WRITE(PHOTOGRAPH_PIN, LOW); - #endif - - #if HAS_CUTTER - cutter.init(); - #endif - - #if ENABLED(COOLANT_MIST) - OUT_WRITE(COOLANT_MIST_PIN, COOLANT_MIST_INVERT); // Init Mist Coolant OFF - #endif - #if ENABLED(COOLANT_FLOOD) - OUT_WRITE(COOLANT_FLOOD_PIN, COOLANT_FLOOD_INVERT); // Init Flood Coolant OFF - #endif - - #if HAS_BED_PROBE - endstops.enable_z_probe(false); - #endif - - #if ENABLED(USE_CONTROLLER_FAN) - SET_OUTPUT(CONTROLLER_FAN_PIN); - #endif - - #if HAS_STEPPER_RESET - enableStepperDrivers(); - #endif - - #if ENABLED(DIGIPOT_I2C) - digipot_i2c_init(); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - dac_init(); - #endif - - #if EITHER(Z_PROBE_SLED, SOLENOID_PROBE) && HAS_SOLENOID_1 - OUT_WRITE(SOL1_PIN, LOW); // OFF - #endif - - #if HAS_HOME - SET_INPUT_PULLUP(HOME_PIN); - #endif - - #if PIN_EXISTS(STAT_LED_RED) - OUT_WRITE(STAT_LED_RED_PIN, LOW); // OFF - #endif - - #if PIN_EXISTS(STAT_LED_BLUE) - OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // OFF - #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); - #endif - update_case_light(); - #endif - - #if ENABLED(MK2_MULTIPLEXER) - SET_OUTPUT(E_MUX0_PIN); - SET_OUTPUT(E_MUX1_PIN); - SET_OUTPUT(E_MUX2_PIN); - #endif - - #if HAS_FANMUX - fanmux_init(); - #endif - - #if ENABLED(MIXING_EXTRUDER) - mixer.init(); - #endif - - #if ENABLED(BLTOUCH) - bltouch.init(/*set_voltage=*/true); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.init(); - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - i2c.onReceive(i2c_on_receive); - i2c.onRequest(i2c_on_request); - #endif - - #if DO_SWITCH_EXTRUDER - move_extruder_servo(0); // Initialize extruder servo - #endif - - #if ENABLED(SWITCHING_NOZZLE) - // Initialize nozzle servo(s) - #if SWITCHING_NOZZLE_TWO_SERVOS - lower_nozzle(0); - raise_nozzle(1); - #else - move_nozzle_servo(0); - #endif - #endif - - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - mpe_settings_init(); - #endif - - #if ENABLED(PARKING_EXTRUDER) - pe_solenoid_init(); - #endif - - #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - est_init(); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.check(); - #endif - - #if ENABLED(USE_WATCHDOG) - watchdog_init(); // Reinit watchdog after HAL_get_reset_source call - #endif - - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - init_closedloop(); - #endif - - #ifdef STARTUP_COMMANDS - queue.inject_P(PSTR(STARTUP_COMMANDS)); - #endif - - #if ENABLED(INIT_SDCARD_ON_BOOT) && !HAS_SPI_LCD - card.beginautostart(); - #endif - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_prompt_end(); - #endif - - #if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF) - test_tmc_connection(true, true, true, true); - #endif - - #if ENABLED(PRUSA_MMU2) - mmu2.init(); - #endif - - SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, 0), - " ii:", PID_PARAM(Ki, 0) , - " d:", PID_PARAM(Kd, 0) , - " PID_dT:", PID_dT); - -} - -/** - * The main Marlin program loop - * - * - Save or log commands to SD - * - Process available commands (if not saving) - * - Call endstop manager - * - Call inactivity manager - */ -void loop() { - - for (;;) { - - idle(); // Do an idle first so boot is slightly faster - - #if ENABLED(SDSUPPORT) - card.checkautostart(); - if (card.flag.abort_sd_printing) abortSDPrinting(); - #endif - - queue.advance(); - - endstops.event_handler(); - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.h deleted file mode 100644 index 8b44298a91..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/Marlin.h +++ /dev/null @@ -1,381 +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 - -#include "inc/MarlinConfig.h" - -#ifdef DEBUG_GCODE_PARSER - #include "gcode/parser.h" -#endif - -#include -#include -#include - -#if HAS_DRIVER(L6470) - #include "libs/L6470/L6470_Marlin.h" - extern uint8_t axis_known_position; -#endif - -void stop(); - -void idle( - #if ENABLED(ADVANCED_PAUSE_FEATURE) - bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout - #endif -); - -void manage_inactivity(const bool ignore_stepper_queue=false); - -// -// X, Y, Z Stepper enable / disable -// -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; - #define X_enable() NOOP - #define X_disable() stepperX.free() -#elif HAS_X_ENABLE - #define X_enable() X_ENABLE_WRITE( X_ENABLE_ON) - #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON) -#else - #define X_enable() NOOP - #define X_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; - #define X2_enable() NOOP - #define X2_disable() stepperX2.free() -#elif HAS_X2_ENABLE - #define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON) - #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON) -#else - #define X2_enable() NOOP - #define X2_disable() NOOP -#endif - -#define enable_X() do{ X_enable(); X2_enable(); }while(0) -#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0) - -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; - #define Y_enable() NOOP - #define Y_disable() stepperY.free() -#elif HAS_Y_ENABLE - #define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON) - #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON) -#else - #define Y_enable() NOOP - #define Y_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; - #define Y2_enable() NOOP - #define Y2_disable() stepperY2.free() -#elif HAS_Y2_ENABLE - #define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON) - #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON) -#else - #define Y2_enable() NOOP - #define Y2_disable() NOOP -#endif - -#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0) -#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0) - -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; - #define Z_enable() NOOP - #define Z_disable() stepperZ.free() -#elif HAS_Z_ENABLE - #define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON) - #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON) -#else - #define Z_enable() NOOP - #define Z_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; - #define Z2_enable() NOOP - #define Z2_disable() stepperZ2.free() -#elif HAS_Z2_ENABLE - #define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON) - #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON) -#else - #define Z2_enable() NOOP - #define Z2_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; - #define Z3_enable() NOOP - #define Z3_disable() stepperZ3.free() -#elif HAS_Z3_ENABLE - #define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON) - #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON) -#else - #define Z3_enable() NOOP - #define Z3_disable() NOOP -#endif - -#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); }while(0) -#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); CBI(axis_known_position, Z_AXIS); }while(0) - -// -// Extruder Stepper enable / disable -// - -// define the individual enables/disables -#if AXIS_DRIVER_TYPE_E0(L6470) - extern L6470 stepperE0; - #define E0_enable() NOOP - #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif HAS_E0_ENABLE - #define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON) - #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E0_enable() NOOP - #define E0_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_E1(L6470) - extern L6470 stepperE1; - #define E1_enable() NOOP - #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif E_STEPPERS > 1 && HAS_E1_ENABLE - #define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON) - #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E1_enable() NOOP - #define E1_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_E2(L6470) - extern L6470 stepperE2; - #define E2_enable() NOOP - #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif E_STEPPERS > 2 && HAS_E2_ENABLE - #define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON) - #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E2_enable() NOOP - #define E2_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_E3(L6470) - extern L6470 stepperE3; - #define E3_enable() NOOP - #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif E_STEPPERS > 3 && HAS_E3_ENABLE - #define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON) - #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E3_enable() NOOP - #define E3_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_E4(L6470) - extern L6470 stepperE4; - #define E4_enable() NOOP - #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif E_STEPPERS > 4 && HAS_E4_ENABLE - #define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON) - #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E4_enable() NOOP - #define E4_disable() NOOP -#endif - -#if AXIS_DRIVER_TYPE_E5(L6470) - extern L6470 stepperE5; - #define E5_enable() NOOP - #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) -#elif E_STEPPERS > 5 && HAS_E5_ENABLE - #define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON) - #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define E5_enable() NOOP - #define E5_disable() NOOP -#endif - -#if ENABLED(MIXING_EXTRUDER) - - /** - * Mixing steppers synchronize their enable (and direction) together - */ - #if MIXING_STEPPERS > 5 - #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); } - #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); } - #elif MIXING_STEPPERS > 4 - #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); } - #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); } - #elif MIXING_STEPPERS > 3 - #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); } - #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); } - #elif MIXING_STEPPERS > 2 - #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); } - #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); } - #else - #define enable_E0() { E0_enable(); E1_enable(); } - #define disable_E0() { E0_disable(); E1_disable(); } - #endif - #define enable_E1() NOOP - #define disable_E1() NOOP - #define enable_E2() NOOP - #define disable_E2() NOOP - #define enable_E3() NOOP - #define disable_E3() NOOP - #define enable_E4() NOOP - #define disable_E4() NOOP - #define enable_E5() NOOP - #define disable_E5() NOOP - -#else // !MIXING_EXTRUDER - - #if HAS_E0_ENABLE - #define enable_E0() E0_enable() - #define disable_E0() E0_disable() - #else - #define enable_E0() NOOP - #define disable_E0() NOOP - #endif - - #if E_STEPPERS > 1 && HAS_E1_ENABLE - #define enable_E1() E1_enable() - #define disable_E1() E1_disable() - #else - #define enable_E1() NOOP - #define disable_E1() NOOP - #endif - - #if E_STEPPERS > 2 && HAS_E2_ENABLE - #define enable_E2() E2_enable() - #define disable_E2() E2_disable() - #else - #define enable_E2() NOOP - #define disable_E2() NOOP - #endif - - #if E_STEPPERS > 3 && HAS_E3_ENABLE - #define enable_E3() E3_enable() - #define disable_E3() E3_disable() - #else - #define enable_E3() NOOP - #define disable_E3() NOOP - #endif - - #if E_STEPPERS > 4 && HAS_E4_ENABLE - #define enable_E4() E4_enable() - #define disable_E4() E4_disable() - #else - #define enable_E4() NOOP - #define disable_E4() NOOP - #endif - - #if E_STEPPERS > 5 && HAS_E5_ENABLE - #define enable_E5() E5_enable() - #define disable_E5() E5_disable() - #else - #define enable_E5() NOOP - #define disable_E5() NOOP - #endif - -#endif // !MIXING_EXTRUDER - -#if ENABLED(EXPERIMENTAL_I2CBUS) - #include "feature/twibus.h" - extern TWIBus i2c; -#endif - -#if ENABLED(G38_PROBE_TARGET) - extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type - extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed -#endif - -/** - * The axis order in all axis related arrays is X, Y, Z, E - */ -void enable_e_steppers(); -void enable_all_steppers(); -void disable_e_stepper(const uint8_t e); -void disable_e_steppers(); -void disable_all_steppers(); - -void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false); -void minkill(const bool steppers_off=false); - -void quickstop_stepper(); - -extern bool Running; -inline bool IsRunning() { return Running; } -inline bool IsStopped() { return !Running; } - -bool printingIsActive(); -bool printingIsPaused(); -void startOrResumeJob(); - -extern bool wait_for_heatup; - -#if HAS_RESUME_CONTINUE - extern bool wait_for_user; -#endif - -#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - extern bool suspend_auto_report; -#endif - -// Inactivity shutdown timer -extern millis_t max_inactive_time, stepper_inactive_time; - -#if ENABLED(USE_CONTROLLER_FAN) - extern uint8_t controllerfan_speed; -#endif - -#if ENABLED(PSU_CONTROL) - extern bool powersupply_on; - #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0) - #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0) - #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() - #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() - #endif -#endif - -bool pin_is_protected(const pin_t pin); -void protected_pin_err(); - -#if HAS_SUICIDE - inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); } -#endif - -#if ENABLED(G29_RETRY_AND_RECOVER) - void event_probe_recover(); - void event_probe_failure(); -#endif - -extern const char NUL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[], - SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[]; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/boards.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/boards.h deleted file mode 100644 index d5309ef9e2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/boards.h +++ /dev/null @@ -1,331 +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 - -#include "macros.h" - -#define BOARD_UNKNOWN -1 - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#define BOARD_RAMPS_OLD 1000 // MEGA/RAMPS up to 1.2 - -#define BOARD_RAMPS_13_EFB 1010 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_13_EEB 1011 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_13_EFF 1012 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_13_EEF 1013 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_13_SF 1014 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_14_EFB 1020 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_14_EEB 1021 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_14_EFF 1022 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_14_EEF 1023 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_14_SF 1024 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan) - -#define BOARD_RAMPS_PLUS_EFB 1030 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_PLUS_EEB 1031 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_PLUS_EFF 1032 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_PLUS_EEF 1033 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_PLUS_SF 1034 // RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan) - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#define BOARD_3DRAG 1100 // 3Drag Controller -#define BOARD_K8200 1101 // Velleman K8200 Controller (derived from 3Drag Controller) -#define BOARD_K8400 1102 // Velleman K8400 Controller (derived from 3Drag Controller) -#define BOARD_BAM_DICE 1103 // 2PrintBeta BAM&DICE with STK drivers -#define BOARD_BAM_DICE_DUE 1104 // 2PrintBeta BAM&DICE Due with STK drivers -#define BOARD_MKS_BASE 1105 // MKS BASE v1.0 -#define BOARD_MKS_BASE_14 1106 // MKS v1.4 with A4982 stepper drivers -#define BOARD_MKS_BASE_15 1107 // MKS v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 1108 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 1109 // MKS GEN v1.3 or 1.4 -#define BOARD_MKS_GEN_L 1110 // MKS GEN L -#define BOARD_KFB_2 1111 // Bigtreetech or BIQU KFB2.0 -#define BOARD_ZRIB_V20 1112 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 1113 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 1114 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 1115 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 1116 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 1117 // Ultimaker -#define BOARD_ULTIMAKER_OLD 1118 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 1119 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 1120 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 1121 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 1122 // Rumba -#define BOARD_RUMBA_RAISE3D 1123 // Raise3D N series Rumba derivative -#define BOARD_RL200 1124 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) -#define BOARD_FORMBOT_TREX2PLUS 1125 // Formbot T-Rex 2 Plus -#define BOARD_FORMBOT_TREX3 1126 // Formbot T-Rex 3 -#define BOARD_FORMBOT_RAPTOR 1127 // Formbot Raptor -#define BOARD_FORMBOT_RAPTOR2 1128 // Formbot Raptor 2 -#define BOARD_BQ_ZUM_MEGA_3D 1129 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 1130 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 1131 // TriGorilla Anycubic version 1.3-based on RAMPS EFB -#define BOARD_TRIGORILLA_14 1132 // ... Ver 1.4 -#define BOARD_TRIGORILLA_14_11 1133 // ... Rev 1.1 (new servo pin order) -#define BOARD_RAMPS_ENDER_4 1134 // Creality: Ender-4, CR-8 -#define BOARD_RAMPS_CREALITY 1135 // Creality: CR10S, CR20, CR-X -#define BOARD_RAMPS_DAGOMA 1136 // Dagoma F5 -#define BOARD_FYSETC_F6_13 1137 // FYSETC F6 -#define BOARD_DUPLICATOR_I3_PLUS 1138 // Wanhao Duplicator i3 Plus -#define BOARD_VORON 1139 // VORON Design -#define BOARD_TRONXY_V3_1_0 1140 // Tronxy TRONXY-V3-1.0 -#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 Gantry v1 -#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2 -#define BOARD_TANGO 1146 // BIQU Tango V1 -#define BOARD_MKS_GEN_L_V2 1147 // MKS GEN L V2 - -// -// RAMBo and derivatives -// - -#define BOARD_RAMBO 1200 // Rambo -#define BOARD_MINIRAMBO 1201 // Mini-Rambo -#define BOARD_MINIRAMBO_10A 1202 // Mini-Rambo 1.0a -#define BOARD_EINSY_RAMBO 1203 // Einsy Rambo -#define BOARD_EINSY_RETRO 1204 // Einsy Retro -#define BOARD_SCOOVO_X9H 1205 // abee Scoovo X9H - -// -// Other ATmega1280, ATmega2560 -// - -#define BOARD_CNCONTROLS_11 1300 // Cartesio CN Controls V11 -#define BOARD_CNCONTROLS_12 1301 // Cartesio CN Controls V12 -#define BOARD_CNCONTROLS_15 1302 // Cartesio CN Controls V15 -#define BOARD_CHEAPTRONIC 1303 // Cheaptronic v1.0 -#define BOARD_CHEAPTRONIC_V2 1304 // Cheaptronic v2.0 -#define BOARD_MIGHTYBOARD_REVE 1305 // Makerbot Mightyboard Revision E -#define BOARD_MEGATRONICS 1306 // Megatronics -#define BOARD_MEGATRONICS_2 1307 // Megatronics v2.0 -#define BOARD_MEGATRONICS_3 1308 // Megatronics v3.0 -#define BOARD_MEGATRONICS_31 1309 // Megatronics v3.1 -#define BOARD_MEGATRONICS_32 1310 // Megatronics v3.2 -#define BOARD_ELEFU_3 1311 // Elefu Ra Board (v3) -#define BOARD_LEAPFROG 1312 // Leapfrog -#define BOARD_MEGACONTROLLER 1313 // Mega controller -#define BOARD_GT2560_REV_A 1314 // Geeetech GT2560 Rev. A -#define BOARD_GT2560_REV_A_PLUS 1315 // Geeetech GT2560 Rev. A+ (with auto level probe) -#define BOARD_GT2560_V3 1316 // Geeetech GT2560 Rev B for A10(M/D) -#define BOARD_GT2560_V3_MC2 1317 // Geeetech GT2560 Rev B for Mecreator2 -#define BOARD_GT2560_V3_A20 1318 // Geeetech GT2560 Rev B for A20(M/D) -#define BOARD_EINSTART_S 1319 // Einstart retrofit -#define BOARD_WANHAO_ONEPLUS 1320 // Wanhao 0ne+ i3 Mini - -// -// ATmega1281, ATmega2561 -// - -#define BOARD_MINITRONICS 1400 // Minitronics v1.0/1.1 -#define BOARD_SILVER_GATE 1401 // Silvergate v1.0 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#define BOARD_SANGUINOLOLU_11 1500 // Sanguinololu < 1.2 -#define BOARD_SANGUINOLOLU_12 1501 // Sanguinololu 1.2 and above -#define BOARD_MELZI 1502 // Melzi -#define BOARD_MELZI_MAKR3D 1503 // Melzi with ATmega1284 (MaKr3d version) -#define BOARD_MELZI_CREALITY 1504 // Melzi Creality3D board (for CR-10 etc) -#define BOARD_MELZI_MALYAN 1505 // Melzi Malyan M150 board -#define BOARD_MELZI_TRONXY 1506 // Tronxy X5S -#define BOARD_STB_11 1507 // STB V1.1 -#define BOARD_AZTEEG_X1 1508 // Azteeg X1 -#define BOARD_ANET_10 1509 // Anet 1.0 (Melzi clone) - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#define BOARD_GEN3_MONOLITHIC 1600 // Gen3 Monolithic Electronics -#define BOARD_GEN3_PLUS 1601 // Gen3+ -#define BOARD_GEN6 1602 // Gen6 -#define BOARD_GEN6_DELUXE 1603 // Gen6 deluxe -#define BOARD_GEN7_CUSTOM 1604 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" -#define BOARD_GEN7_12 1605 // Gen7 v1.1, v1.2 -#define BOARD_GEN7_13 1606 // Gen7 v1.3 -#define BOARD_GEN7_14 1607 // Gen7 v1.4 -#define BOARD_OMCA_A 1608 // Alpha OMCA board -#define BOARD_OMCA 1609 // Final OMCA board -#define BOARD_SETHI 1610 // Sethi 3D_1 - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#define BOARD_TEENSYLU 1700 // Teensylu -#define BOARD_PRINTRBOARD 1701 // Printrboard (AT90USB1286) -#define BOARD_PRINTRBOARD_REVF 1702 // Printrboard Revision F (AT90USB1286) -#define BOARD_BRAINWAVE 1703 // Brainwave (AT90USB646) -#define BOARD_BRAINWAVE_PRO 1704 // Brainwave Pro (AT90USB1286) -#define BOARD_SAV_MKI 1705 // SAV Mk-I (AT90USB1286) -#define BOARD_TEENSY2 1706 // Teensy++2.0 (AT90USB1286) -#define BOARD_5DPRINT 1707 // 5DPrint D8 Driver Board - -// -// LPC1768 ARM Cortex M3 -// - -#define BOARD_RAMPS_14_RE_ARM_EFB 2000 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_14_RE_ARM_EEB 2001 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_14_RE_ARM_EFF 2002 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_14_RE_ARM_EEF 2003 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini -#define BOARD_AZTEEG_X5_GT 2007 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_BIQU_BQ111_A4 2008 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_SELENA_COMPACT 2009 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1) -#define BOARD_COHESION3D_REMIX 2010 // Cohesion3D ReMix -#define BOARD_COHESION3D_MINI 2011 // Cohesion3D Mini -#define BOARD_SMOOTHIEBOARD 2012 // Smoothieboard -#define BOARD_AZTEEG_X5_MINI_WIFI 2013 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan) -#define BOARD_BIGTREE_SKR_V1_1 2014 // BIGTREE SKR_V1.1 (Power outputs: Hotend0,Hotend1, Fan, Bed) -#define BOARD_BIQU_B300_V1_0 2015 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver) -#define BOARD_BIGTREE_SKR_V1_3 2016 // BIGTREE SKR_V1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_AZTEEG_X5_MINI 2017 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan) -#define BOARD_MKS_SGEN 2018 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_MKS_SGEN_L 2019 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_TH3D_EZBOARD 2020 // TH3D EZBoard v1.0 -#define BOARD_GMARSH_X6_REV1 2021 // GMARSH X6 board, revision 1 prototype - -// -// SAM3X8E ARM Cortex M3 -// - -#define BOARD_DUE3DOM 3000 // DUE3DOM for Arduino DUE -#define BOARD_DUE3DOM_MINI 3001 // DUE3DOM MINI for Arduino DUE -#define BOARD_RADDS 3002 // RADDS -#define BOARD_RAMPS_FD_V1 3003 // RAMPS-FD v1 -#define BOARD_RAMPS_FD_V2 3004 // RAMPS-FD v2 -#define BOARD_RAMPS_SMART_EFB 3005 // RAMPS-SMART (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_SMART_EEB 3006 // RAMPS-SMART (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_SMART_EFF 3007 // RAMPS-SMART (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_SMART_EEF 3008 // RAMPS-SMART (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_SMART_SF 3009 // RAMPS-SMART (Power outputs: Spindle, Controller Fan) -#define BOARD_RAMPS_DUO_EFB 3010 // RAMPS Duo (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS_DUO_EEB 3011 // RAMPS Duo (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS_DUO_EFF 3012 // RAMPS Duo (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS_DUO_EEF 3013 // RAMPS Duo (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS_DUO_SF 3014 // RAMPS Duo (Power outputs: Spindle, Controller Fan) -#define BOARD_RAMPS4DUE_EFB 3015 // RAMPS4DUE (Power outputs: Hotend, Fan, Bed) -#define BOARD_RAMPS4DUE_EEB 3016 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Bed) -#define BOARD_RAMPS4DUE_EFF 3017 // RAMPS4DUE (Power outputs: Hotend, Fan0, Fan1) -#define BOARD_RAMPS4DUE_EEF 3018 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Fan) -#define BOARD_RAMPS4DUE_SF 3019 // RAMPS4DUE (Power outputs: Spindle, Controller Fan) -#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) -#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) -#define BOARD_ULTRATRONICS_PRO 3022 // ReprapWorld Ultratronics Pro V1.0 -#define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers) -#define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers) -#define BOARD_ALLIGATOR 3025 // Alligator Board R2 - -// -// SAM3X8C ARM Cortex M3 -// - -#define BOARD_PRINTRBOARD_G2 3100 // PRINTRBOARD G2 -#define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK) - -// -// STM32 ARM Cortex-M3 -// - -#define BOARD_STM32F103RE 4000 // STM32F103RE Libmaple-based STM32F1 controller -#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller -#define BOARD_STM3R_MINI 4002 // STM32F103RE 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) -#define BOARD_MKS_ROBIN 4006 // MKS Robin (STM32F103ZET6) -#define BOARD_MKS_ROBIN_MINI 4007 // MKS Robin Mini (STM32F103VET6) -#define BOARD_MKS_ROBIN_NANO 4008 // MKS Robin Nano (STM32F103VET6) -#define BOARD_MKS_ROBIN_LITE 4009 // MKS Robin Lite/Lite2 (STM32F103RCT6) -#define BOARD_BIGTREE_SKR_MINI_V1_1 4010 // BigTreeTech SKR Mini v1.1 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_0 4011 // BigTreeTech SKR Mini E3 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_2 4012 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) -#define BOARD_BIGTREE_SKR_E3_DIP 4013 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) -#define BOARD_JGAURORA_A5S_A1 4014 // JGAurora A5S A1 (STM32F103ZET6) -#define BOARD_FYSETC_AIO_II 4015 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4016 // FYSETC Cheetah -#define BOARD_FYSETC_CHEETAH_V12 4017 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4018 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 -#define BOARD_GTM32_MINI 4019 // STM32F103VET6 controller -#define BOARD_GTM32_MINI_A30 4020 // STM32F103VET6 controller -#define BOARD_GTM32_REV_B 4021 // STM32F103VET6 controller - -// -// ARM Cortex-M4F -// - -#define BOARD_TEENSY31_32 4100 // Teensy3.1 and Teensy3.2 -#define BOARD_TEENSY35_36 4101 // Teensy3.5 and Teensy3.6 - -// -// STM32 ARM Cortex-M4F -// - -#define BOARD_BEAST 4200 // STM32F4xxVxT6 Libmaple-based STM32F4 controller -#define BOARD_GENERIC_STM32F4 4201 // STM32 STM32GENERIC-based STM32F4 controller -#define BOARD_ARMED 4202 // Arm'ed STM32F4-based controller -#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller -#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE -#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE -#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) -#define BOARD_VAKE403D 4211 // VAkE 403D (STM32F446VET6) -#define BOARD_FYSETC_S6 4212 // FYSETC S6 board - -// -// ARM Cortex M7 -// - -#define BOARD_THE_BORG 5000 // THE-BORG (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_REMRAM_V1 5001 // RemRam v1 - -// -// Espressif ESP32 WiFi -// -#define BOARD_ESPRESSIF_ESP32 6000 - -// -// Simulations -// - -#define BOARD_LINUX_RAMPS 9999 - -#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B) -#define MB(V...) DO(MB,||,V) - -#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/debug_out.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/debug_out.h deleted file mode 100644 index 07bdad7ff2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/debug_out.h +++ /dev/null @@ -1,103 +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 . - * - */ - -// -// Serial aliases for debugging. -// Include this header after defining DEBUG_OUT -// (or not) in a given .cpp file -// - -#undef DEBUG_PRINT_P -#undef DEBUG_ECHO_START -#undef DEBUG_ERROR_START -#undef DEBUG_CHAR -#undef DEBUG_ECHO -#undef DEBUG_ECHO_F -#undef DEBUG_ECHOLN -#undef DEBUG_ECHOPGM -#undef DEBUG_ECHOLNPGM -#undef DEBUG_ECHOPAIR -#undef DEBUG_ECHOPAIR_P -#undef DEBUG_ECHOPAIR_F -#undef DEBUG_ECHOPAIR_F_P -#undef DEBUG_ECHOLNPAIR -#undef DEBUG_ECHOLNPAIR_P -#undef DEBUG_ECHOLNPAIR_F -#undef DEBUG_ECHOLNPAIR_F_P -#undef DEBUG_ECHO_MSG -#undef DEBUG_ERROR_MSG -#undef DEBUG_EOL -#undef DEBUG_POS -#undef DEBUG_XYZ -#undef DEBUG_DELAY - -#if DEBUG_OUT - #define DEBUG_PRINT_P(P) serialprintPGM(P) - #define DEBUG_ECHO_START SERIAL_ECHO_START - #define DEBUG_ERROR_START SERIAL_ERROR_START - #define DEBUG_CHAR SERIAL_CHAR - #define DEBUG_ECHO SERIAL_ECHO - #define DEBUG_ECHO_F SERIAL_ECHO_F - #define DEBUG_ECHOLN SERIAL_ECHOLN - #define DEBUG_ECHOPGM SERIAL_ECHOPGM - #define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM - #define DEBUG_ECHOPAIR SERIAL_ECHOPAIR - #define DEBUG_ECHOPAIR_P SERIAL_ECHOPAIR_P - #define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F - #define DEBUG_ECHOPAIR_F_P SERIAL_ECHOPAIR_F_P - #define DEBUG_ECHOLNPAIR SERIAL_ECHOLNPAIR - #define DEBUG_ECHOLNPAIR_P SERIAL_ECHOLNPAIR_P - #define DEBUG_ECHOLNPAIR_F SERIAL_ECHOLNPAIR_F - #define DEBUG_ECHOLNPAIR_F_P SERIAL_ECHOLNPAIR_F_P - #define DEBUG_ECHO_MSG SERIAL_ECHO_MSG - #define DEBUG_ERROR_MSG SERIAL_ERROR_MSG - #define DEBUG_EOL SERIAL_EOL - #define DEBUG_POS SERIAL_POS - #define DEBUG_XYZ SERIAL_XYZ - #define DEBUG_DELAY(ms) serial_delay(ms) -#else - #define DEBUG_PRINT_P(P) NOOP - #define DEBUG_ECHO_START() NOOP - #define DEBUG_ERROR_START() NOOP - #define DEBUG_CHAR(...) NOOP - #define DEBUG_ECHO(...) NOOP - #define DEBUG_ECHO_F(...) NOOP - #define DEBUG_ECHOLN(...) NOOP - #define DEBUG_ECHOPGM(...) NOOP - #define DEBUG_ECHOLNPGM(...) NOOP - #define DEBUG_ECHOPAIR(...) NOOP - #define DEBUG_ECHOPAIR_P(...) NOOP - #define DEBUG_ECHOPAIR_F(...) NOOP - #define DEBUG_ECHOPAIR_F_P(...) NOOP - #define DEBUG_ECHOLNPAIR(...) NOOP - #define DEBUG_ECHOLNPAIR_P(...) NOOP - #define DEBUG_ECHOLNPAIR_F(...) NOOP - #define DEBUG_ECHOLNPAIR_F_P(...) NOOP - #define DEBUG_ECHO_MSG(...) NOOP - #define DEBUG_ERROR_MSG(...) NOOP - #define DEBUG_EOL() NOOP - #define DEBUG_POS(...) NOOP - #define DEBUG_XYZ(...) NOOP - #define DEBUG_DELAY(...) NOOP -#endif - -#undef DEBUG_OUT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/drivers.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/drivers.h deleted file mode 100644 index 44434581a5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/drivers.h +++ /dev/null @@ -1,144 +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 - -#include "../inc/MarlinConfigPre.h" - -#define _A4988 0x001 -#define _A5984 0x002 -#define _DRV8825 0x003 -#define _LV8729 0x004 -#define _L6470 0x105 -#define _TB6560 0x006 -#define _TB6600 0x007 -#define _TMC2100 0x008 -#define _TMC2130 2130 -#define _TMC2130_STANDALONE 0x009 -#define _TMC2160 2160 -#define _TMC2160_STANDALONE 2161 -#define _TMC2208 2208 -#define _TMC2208_STANDALONE 0x00A -#define _TMC2209 2209 -#define _TMC2209_STANDALONE 0x00D -#define _TMC26X 0x10B -#define _TMC26X_STANDALONE 0x00B -#define _TMC2660 2660 -#define _TMC2660_STANDALONE 0x00C -#define _TMC5130 5130 -#define _TMC5130_STANDALONE 5131 -#define _TMC5160 5160 -#define _TMC5160_STANDALONE 5161 - -#define _DRIVER_ID(V) _CAT(_, V) -#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _CAT(_, T)) - -#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T) -#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T) -#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T) -#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T)) -#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T)) -#define AXIS_DRIVER_TYPE_Z2(T) (Z_MULTI_STEPPER_DRIVERS && _AXIS_DRIVER_TYPE(Z2,T)) -#define AXIS_DRIVER_TYPE_Z3(T) (ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z3,T)) -#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T)) -#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T)) -#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T)) -#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T)) -#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T)) -#define AXIS_DRIVER_TYPE_E5(T) (E_STEPPERS > 5 && _AXIS_DRIVER_TYPE(E5,T)) - -#define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T) - -#define HAS_E_DRIVER(T) ( AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \ - || AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \ - || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) ) - -#define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) \ - || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) \ - || AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || AXIS_DRIVER_TYPE_Z3(T) \ - || HAS_E_DRIVER(T) ) - -// Test for supported TMC drivers that require advanced configuration -// Does not match standalone configurations -#define HAS_TRINAMIC ( HAS_DRIVER(TMC2130) \ - || HAS_DRIVER(TMC2160) \ - || HAS_DRIVER(TMC2208) \ - || HAS_DRIVER(TMC2209) \ - || HAS_DRIVER(TMC2660) \ - || HAS_DRIVER(TMC5130) \ - || HAS_DRIVER(TMC5160) ) - -#define HAS_TMC220x (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) - -#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \ - || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC2208) \ - || AXIS_DRIVER_TYPE(A,TMC2209) \ - || AXIS_DRIVER_TYPE(A,TMC2660) \ - || AXIS_DRIVER_TYPE(A,TMC5130) \ - || AXIS_DRIVER_TYPE(A,TMC5160) ) - -// Test for a driver that uses SPI - this allows checking whether a _CS_ pin -// is considered sensitive -#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \ - || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC2660) \ - || AXIS_DRIVER_TYPE(A,TMC5130) \ - || AXIS_DRIVER_TYPE(A,TMC5160) ) - -#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) \ - || AXIS_DRIVER_TYPE(A,TMC2209) ) - -#define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \ - || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC2209) \ - || AXIS_DRIVER_TYPE(A,TMC2660) \ - || AXIS_DRIVER_TYPE(A,TMC5130) \ - || AXIS_DRIVER_TYPE(A,TMC5160) ) - -#define AXIS_HAS_STEALTHCHOP(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \ - || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC2208) \ - || AXIS_DRIVER_TYPE(A,TMC2209) \ - || AXIS_DRIVER_TYPE(A,TMC5130) \ - || AXIS_DRIVER_TYPE(A,TMC5160) ) - -#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \ - || HAS_E_DRIVER(TMC2160) \ - || HAS_E_DRIVER(TMC2660) \ - || HAS_E_DRIVER(TMC2209) \ - || HAS_E_DRIVER(TMC5130) \ - || HAS_E_DRIVER(TMC5160) ) - -#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \ - || HAS_E_DRIVER(TMC2160_STANDALONE) \ - || HAS_E_DRIVER(TMC2660_STANDALONE) \ - || HAS_E_DRIVER(TMC2209_STANDALONE) \ - || HAS_E_DRIVER(TMC5130_STANDALONE) \ - || HAS_E_DRIVER(TMC5160_STANDALONE) ) -// -// Stretching 'drivers.h' to include LPC/SAMD51 SD options -// -#define _SDCARD_LCD 1 -#define _SDCARD_ONBOARD 2 -#define _SDCARD_CUSTOM_CABLE 3 -#define _SDCARD_ID(V) _CAT(_SDCARD_, V) -#define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/language.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/language.h deleted file mode 100644 index 45a6b590d6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/language.h +++ /dev/null @@ -1,395 +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 - -#include "../inc/MarlinConfig.h" - -#define _UxGT(a) a - -// Fallback if no language is set. DON'T CHANGE -#ifndef LCD_LANGUAGE - #define LCD_LANGUAGE en -#endif - -// For character-based LCD controllers (DISPLAY_CHARSET_HD44780) -#define JAPANESE 1 -#define WESTERN 2 -#define CYRILLIC 3 - -// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES -// -// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRA_LCD" / "SDSUPPORT" #define IN "Configuration.h" -// ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS -// See also http://marlinfw.org/docs/development/lcd_language.html - -// Languages -// an Aragonese -// bg Bulgarian -// ca Catalan -// cz Czech -// da Danish -// de German -// el Greek -// el_gr Greek (Greece) -// en English -// 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) - -#ifdef DEFAULT_SOURCE_CODE_URL - #undef SOURCE_CODE_URL - #define SOURCE_CODE_URL DEFAULT_SOURCE_CODE_URL -#endif - -#ifdef CUSTOM_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MACHINE_NAME -#else - #ifdef DEFAULT_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME DEFAULT_MACHINE_NAME - #endif -#endif - -#ifndef MACHINE_UUID - #define MACHINE_UUID DEFAULT_MACHINE_UUID -#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_CHARACTER_LCD - - // Custom characters defined in the first 8 characters of the LCD - #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_STR_DEGREE "\x01" - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_STR_UPLEVEL "\x03" - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_CLOCK "\x07" - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - -#else - // - // Custom characters from Marlin_symbols.fon which was merged into ISO10646-0-3.bdf - // \x00 intentionally skipped to avoid problems in strings - // - #define LCD_STR_REFRESH "\x01" - #define LCD_STR_FOLDER "\x02" - #define LCD_STR_ARROW_RIGHT "\x03" - #define LCD_STR_UPLEVEL "\x04" - #define LCD_STR_CLOCK "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_BEDTEMP "\x07" - #define LCD_STR_THERMOMETER "\x08" - #define LCD_STR_DEGREE "\x09" - - #define LCD_STR_SPECIAL_MAX '\x09' - // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin. - // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - - // Symbol characters - #define LCD_STR_FILAM_DIA "\xF8" - #define LCD_STR_FILAM_MUL "\xA4" - -#endif - -// Common LCD messages - - /* nothing here yet */ - -// Common serial messages -#define MSG_MARLIN "Marlin" - -// Serial Console Messages (do not translate those!) - -#define MSG_ENQUEUEING "enqueueing \"" -#define MSG_POWERUP "PowerUp" -#define MSG_EXTERNAL_RESET " External Reset" -#define MSG_BROWNOUT_RESET " Brown out Reset" -#define MSG_WATCHDOG_RESET " Watchdog Reset" -#define MSG_SOFTWARE_RESET " Software Reset" -#define MSG_AUTHOR " | Author: " -#define MSG_CONFIGURATION_VER " Last Updated: " -#define MSG_FREE_MEMORY " Free Memory: " -#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " -#define MSG_OK "ok" -#define MSG_WAIT "wait" -#define MSG_STATS "Stats: " -#define MSG_FILE_SAVED "Done saving file." -#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " -#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " -#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " -#define MSG_FILE_PRINTED "Done printing file" -#define MSG_BEGIN_FILE_LIST "Begin file list" -#define MSG_END_FILE_LIST "End file list" -#define MSG_INVALID_EXTRUDER "Invalid extruder" -#define MSG_INVALID_E_STEPPER "Invalid E stepper" -#define MSG_E_STEPPER_NOT_SPECIFIED "E stepper not specified" -#define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID -#define MSG_COUNT_X " Count X:" -#define MSG_COUNT_A " Count A:" -#define MSG_WATCHDOG_FIRED "Watchdog timeout. Reset required." -#define MSG_ERR_KILLED "Printer halted. kill() called!" -#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" -#define MSG_BUSY_PROCESSING "busy: processing" -#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user" -#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input" -#define MSG_Z_MOVE_COMP "Z_move_comp" -#define MSG_RESEND "Resend: " -#define MSG_UNKNOWN_COMMAND "Unknown command: \"" -#define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min" -#define MSG_X_MAX "x_max" -#define MSG_X2_MIN "x2_min" -#define MSG_X2_MAX "x2_max" -#define MSG_Y_MIN "y_min" -#define MSG_Y_MAX "y_max" -#define MSG_Y2_MIN "y2_min" -#define MSG_Y2_MAX "y2_max" -#define MSG_Z_MIN "z_min" -#define MSG_Z_MAX "z_max" -#define MSG_Z2_MIN "z2_min" -#define MSG_Z2_MAX "z2_max" -#define MSG_Z3_MIN "z3_min" -#define MSG_Z3_MAX "z3_max" -#define MSG_Z_PROBE "z_probe" -#define MSG_FILAMENT_RUNOUT_SENSOR "filament" -#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)" -#define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage" -#define MSG_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" -#define MSG_ERR_MESH_XY "Mesh point cannot be resolved" -#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters" -#define MSG_ERR_PROTECTED_PIN "Protected Pin" -#define MSG_ERR_M420_FAILED "Failed to enable Bed Leveling" -#define MSG_ERR_M428_TOO_FAR "Too far from reference point" -#define MSG_ERR_M303_DISABLED "PIDTEMP disabled" -#define MSG_M119_REPORT "Reporting endstop status" -#define MSG_ON "ON" -#define MSG_OFF "OFF" -#define MSG_ENDSTOP_HIT "TRIGGERED" -#define MSG_ENDSTOP_OPEN "open" -#define MSG_HOTEND_OFFSET "Hotend offsets:" -#define MSG_DUPLICATION_MODE "Duplication mode: " -#define MSG_SOFT_ENDSTOPS "Soft endstops: " -#define MSG_SOFT_MIN " Min: " -#define MSG_SOFT_MAX " Max: " - -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define MSG_SD_INIT_FAIL "SD init fail" -#define MSG_SD_VOL_INIT_FAIL "volume.init failed" -#define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" -#define MSG_SD_WORKDIR_FAIL "workDir open failed" -#define MSG_SD_OPEN_FILE_FAIL "open failed, File: " -#define MSG_SD_FILE_OPENED "File opened: " -#define MSG_SD_SIZE " Size: " -#define MSG_SD_FILE_SELECTED "File selected" -#define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" -#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_ERR_READ "SD read error" -#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " - -#define MSG_STEPPER_TOO_HIGH "Steprate too high: " -#define MSG_ENDSTOPS_HIT "endstops hit: " -#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" -#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_ERR_HOTEND_TOO_COLD "Hotend too cold" -#define MSG_ERR_Z_HOMING_SER "Home XY first" -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" -#define MSG_FILAMENT_CHANGE_WAIT_LCD "Press button to resume" -#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" -#define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume" - -#define MSG_STOP_BLTOUCH "STOP called because of BLTouch error - restart with M999" -#define MSG_STOP_UNHOMED "STOP called because of unhomed error - restart with M999" -#define MSG_KILL_INACTIVE_TIME "KILL caused by too much inactive time - current command: " -#define MSG_KILL_BUTTON "KILL caused by KILL button/pin" - -// temperature.cpp strings -#define MSG_PID_AUTOTUNE_PREFIX "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE_PREFIX " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE_PREFIX " failed!" -#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" -#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" -#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" -#define MSG_BIAS " bias: " -#define MSG_D " d: " -#define MSG_T_MIN " min: " -#define MSG_T_MAX " max: " -#define MSG_KU " Ku: " -#define MSG_TU " Tu: " -#define MSG_CLASSIC_PID " Classic PID " -#define MSG_KP " Kp: " -#define MSG_KI " Ki: " -#define MSG_KD " Kd: " -#define MSG_AT " @:" -#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" -#define MSG_PID_DEBUG " PID_DEBUG " -#define MSG_PID_DEBUG_INPUT ": Input " -#define MSG_PID_DEBUG_OUTPUT " Output " -#define MSG_PID_DEBUG_PTERM " pTerm " -#define MSG_PID_DEBUG_ITERM " iTerm " -#define MSG_PID_DEBUG_DTERM " dTerm " -#define MSG_PID_DEBUG_CTERM " cTerm " -#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" - -#define MSG_HEATER_BED "bed" -#define MSG_HEATER_CHAMBER "chamber" - -#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: " -#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" -#define MSG_T_HEATING_FAILED "Heating failed" -#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" -#define MSG_T_MAXTEMP "MAXTEMP triggered" -#define MSG_T_MINTEMP "MINTEMP triggered" -#define MSG_ERR_PROBING_FAILED "Probing Failed" -#define MSG_ZPROBE_OUT_SER "Z Probe Past Bed" - -// Debug -#define MSG_DEBUG_PREFIX "DEBUG:" -#define MSG_DEBUG_OFF "off" -#define MSG_DEBUG_ECHO "ECHO" -#define MSG_DEBUG_INFO "INFO" -#define MSG_DEBUG_ERRORS "ERRORS" -#define MSG_DEBUG_DRYRUN "DRYRUN" -#define MSG_DEBUG_COMMUNICATION "COMMUNICATION" -#define MSG_DEBUG_LEVELING "LEVELING" - -// LCD Menu Messages - -#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h) -#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M) - -#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h) -#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) - -// Never translate these strings -#define MSG_X "X" -#define MSG_Y "Y" -#define MSG_Z "Z" -#define MSG_E "E" -#if IS_KINEMATIC - #define MSG_A "A" - #define MSG_B "B" - #define MSG_C "C" -#else - #define MSG_A "X" - #define MSG_B "Y" - #define MSG_C "Z" -#endif -#define MSG_X2 "X2" -#define MSG_Y2 "Y2" -#define MSG_Z2 "Z2" -#define MSG_Z3 "Z3" - -#define LCD_STR_A MSG_A -#define LCD_STR_B MSG_B -#define LCD_STR_C MSG_C -#define LCD_STR_E MSG_E - -/** - * Tool indexes for LCD display only - * - * By convention the LCD shows "E1" for the first extruder. - * However, internal to Marlin E0/T0 is the first tool, and - * most board silkscreens say "E0." Zero-based labels will - * make these indexes consistent but this defies expectation. - * - */ -#if ENABLED(NUMBER_TOOLS_FROM_0) - #define LCD_FIRST_TOOL '0' - #define LCD_STR_N0 "0" - #define LCD_STR_N1 "1" - #define LCD_STR_N2 "2" - #define LCD_STR_N3 "3" - #define LCD_STR_N4 "4" - #define LCD_STR_N5 "5" -#else - #define LCD_FIRST_TOOL '1' - #define LCD_STR_N0 "1" - #define LCD_STR_N1 "2" - #define LCD_STR_N2 "3" - #define LCD_STR_N3 "4" - #define LCD_STR_N4 "5" - #define LCD_STR_N5 "6" -#endif - -#define LCD_STR_E0 "E" LCD_STR_N0 -#define LCD_STR_E1 "E" LCD_STR_N1 -#define LCD_STR_E2 "E" LCD_STR_N2 -#define LCD_STR_E3 "E" LCD_STR_N3 -#define LCD_STR_E4 "E" LCD_STR_N4 -#define LCD_STR_E5 "E" LCD_STR_N5 - -#include "multi_language.h" // Allow multiple languages - -#include "../lcd/language/language_en.h" -#include LANGUAGE_INCL(LCD_LANGUAGE) -#include LANGUAGE_INCL(LCD_LANGUAGE_2) -#include LANGUAGE_INCL(LCD_LANGUAGE_3) -#include LANGUAGE_INCL(LCD_LANGUAGE_4) -#include LANGUAGE_INCL(LCD_LANGUAGE_5) - -#if NONE(DISPLAY_CHARSET_ISO10646_1, \ - DISPLAY_CHARSET_ISO10646_5, \ - DISPLAY_CHARSET_ISO10646_KANA, \ - DISPLAY_CHARSET_ISO10646_GREEK, \ - DISPLAY_CHARSET_ISO10646_CN, \ - DISPLAY_CHARSET_ISO10646_TR, \ - DISPLAY_CHARSET_ISO10646_PL, \ - DISPLAY_CHARSET_ISO10646_CZ, \ - DISPLAY_CHARSET_ISO10646_SK) - #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/macros.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/macros.h deleted file mode 100644 index f3c9f3a818..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/macros.h +++ /dev/null @@ -1,448 +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 - -#define ABCE 4 -#define XYZE 4 -#define ABC 3 -#define XYZ 3 -#define XY 2 - -#define _AXIS(A) (A##_AXIS) - -#define _XMIN_ 100 -#define _YMIN_ 200 -#define _ZMIN_ 300 -#define _XMAX_ 101 -#define _YMAX_ 201 -#define _ZMAX_ 301 - -#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__ -#define FORCE_INLINE __attribute__((always_inline)) inline -#define _UNUSED __attribute__((unused)) -#define _O0 __attribute__((optimize("O0"))) -#define _Os __attribute__((optimize("Os"))) -#define _O1 __attribute__((optimize("O1"))) -#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 -#endif - -// Nanoseconds per cycle -#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) - -// 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 -#define STRINGIFY_(M) #M -#define STRINGIFY(M) STRINGIFY_(M) - -#define A(CODE) " " CODE "\n\t" -#define L(CODE) CODE ":\n\t" - -// Macros for bit masks -#undef _BV -#define _BV(n) (1<<(n)) -#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 - #define SBI(A,B) (A |= (1 << (B))) -#endif - -#ifndef CBI - #define CBI(A,B) (A &= ~(1 << (B))) -#endif - -#define _BV32(b) (1UL << (b)) -#define TEST32(n,b) !!((n)&_BV32(b)) -#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)) - -#define CIRCLE_AREA(R) (float(M_PI) * sq(float(R))) -#define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R)) - -#define SIGN(a) ((a>0)-(a<0)) -#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) - -// Macros to constrain values -#ifdef __cplusplus - - // C++11 solution that is standards compliant. - template static inline constexpr void NOLESS(V& v, const N n) { - if (n > v) v = n; - } - template static inline constexpr void NOMORE(V& v, const N n) { - if (n < v) v = n; - } - template static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { - if (n1 > v) v = n1; - else if (n2 < v) v = n2; - } - -#else - - // Using GCC extensions, but Travis GCC version does not like it and gives - // "error: statement-expressions are not allowed outside functions nor in template-argument lists" - #define NOLESS(v, n) \ - do{ \ - __typeof__(n) _n = (n); \ - if (_n > v) v = _n; \ - }while(0) - - #define NOMORE(v, n) \ - do{ \ - __typeof__(n) _n = (n); \ - if (_n < v) v = _n; \ - }while(0) - - #define LIMIT(v, n1, n2) \ - do{ \ - __typeof__(n1) _n1 = (n1); \ - __typeof__(n2) _n2 = (n2); \ - if (_n1 > v) v = _n1; \ - else if (_n2 < v) v = _n2; \ - }while(0) - -#endif - -// Macros to chain up to 12 conditions -#define _DO_1(W,C,A) (_##W##_1(A)) -#define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B)) -#define _DO_3(W,C,A,V...) (_##W##_1(A) C _DO_2(W,C,V)) -#define _DO_4(W,C,A,V...) (_##W##_1(A) C _DO_3(W,C,V)) -#define _DO_5(W,C,A,V...) (_##W##_1(A) C _DO_4(W,C,V)) -#define _DO_6(W,C,A,V...) (_##W##_1(A) C _DO_5(W,C,V)) -#define _DO_7(W,C,A,V...) (_##W##_1(A) C _DO_6(W,C,V)) -#define _DO_8(W,C,A,V...) (_##W##_1(A) C _DO_7(W,C,V)) -#define _DO_9(W,C,A,V...) (_##W##_1(A) C _DO_8(W,C,V)) -#define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V)) -#define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V)) -#define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V)) -#define __DO_N(W,C,N,V...) _DO_##N(W,C,V) -#define _DO_N(W,C,N,V...) __DO_N(W,C,N,V) -#define DO(W,C,V...) _DO_N(W,C,NUM_ARGS(V),V) - -// Macros to support option testing -#define _CAT(a,V...) a##V -#define CAT(a,V...) _CAT(a,V) -#define SWITCH_ENABLED_false 0 -#define SWITCH_ENABLED_true 1 -#define SWITCH_ENABLED_0 0 -#define SWITCH_ENABLED_1 1 -#define SWITCH_ENABLED_0x0 0 -#define SWITCH_ENABLED_0x1 1 -#define SWITCH_ENABLED_ 1 -#define _ENA_1(O) _CAT(SWITCH_ENABLED_, O) -#define _DIS_1(O) !_ENA_1(O) -#define ENABLED(V...) DO(ENA,&&,V) -#define DISABLED(V...) DO(DIS,&&,V) - -#define ANY(V...) !DISABLED(V) -#define NONE(V...) DISABLED(V) -#define ALL(V...) ENABLED(V) -#define BOTH(V1,V2) ALL(V1,V2) -#define EITHER(V1,V2) ANY(V1,V2) - -// Macros to support pins/buttons exist testing -#define _PINEX_1(PN) (defined(PN##_PIN) && PN##_PIN >= 0) -#define PIN_EXISTS(V...) DO(PINEX,&&,V) -#define ANY_PIN(V...) DO(PINEX,||,V) - -#define _BTNEX_1(BN) (defined(BTN_##BN) && BTN_##BN >= 0) -#define BUTTON_EXISTS(V...) DO(BTNEX,&&,V) -#define ANY_BUTTON(V...) DO(BTNEX,||,V) - -#define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H)) -#define NUMERIC(a) WITHIN(a, '0', '9') -#define DECIMAL(a) (NUMERIC(a) || a == '.') -#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') -#define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') -#define COUNT(a) (sizeof(a)/sizeof(*a)) -#define ZERO(a) memset(a,0,sizeof(a)) -#define COPY(a,b) do{ \ - static_assert(sizeof(a[0]) == sizeof(b[0]), "COPY: '" STRINGIFY(a) "' and '" STRINGIFY(b) "' types (sizes) don't match!"); \ - memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \ - }while(0) - -// Macros for initializing arrays -#define LIST_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 LIST_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 LIST_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 LIST_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 LIST_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 LIST_11(A,B,C,D,E,F,G,H,I,J,K,...) A,B,C,D,E,F,G,H,I,J,K -#define LIST_10(A,B,C,D,E,F,G,H,I,J,...) A,B,C,D,E,F,G,H,I,J -#define LIST_9( A,B,C,D,E,F,G,H,I,...) A,B,C,D,E,F,G,H,I -#define LIST_8( A,B,C,D,E,F,G,H,...) A,B,C,D,E,F,G,H -#define LIST_7( A,B,C,D,E,F,G,...) A,B,C,D,E,F,G -#define LIST_6( A,B,C,D,E,F,...) A,B,C,D,E,F -#define LIST_5( A,B,C,D,E,...) A,B,C,D,E -#define LIST_4( A,B,C,D,...) A,B,C,D -#define LIST_3( A,B,C,...) A,B,C -#define LIST_2( A,B,...) A,B -#define LIST_1( A,...) A - -#define _LIST_N(N,V...) LIST_##N(V) -#define LIST_N(N,V...) _LIST_N(N,V) -#define ARRAY_N(N,V...) { _LIST_N(N,V) } - -#define _JOIN_1(O) (O) -#define JOIN_N(N,C,V...) (DO(JOIN,C,LIST_N(N,V))) - -#define NOOP (void(0)) - -#define CEILING(x,y) (((x) + (y) - 1) / (y)) - -#undef ABS -#ifdef __cplusplus - template static inline constexpr const T ABS(const T v) { return v >= 0 ? v : -v; } -#else - #define ABS(a) ({__typeof__(a) _a = (a); _a >= 0 ? _a : -_a;}) -#endif - -#define UNEAR_ZERO(x) ((x) < 0.000001f) -#define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f) -#define NEAR(x,y) NEAR_ZERO((x)-(y)) - -#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0 : (1 / float(x))) -#define FIXFLOAT(f) (f + (f < 0 ? -0.00005f : 0.00005f)) - -// -// Maths macros that can be overridden by HAL -// -#define ACOS(x) acosf(x) -#define ATAN2(y, x) atan2f(y, x) -#define POW(x, y) powf(x, y) -#define SQRT(x) sqrtf(x) -#define RSQRT(x) (1.0f / sqrtf(x)) -#define CEIL(x) ceilf(x) -#define FLOOR(x) floorf(x) -#define LROUND(x) lroundf(x) -#define FMOD(x, y) fmodf(x, y) -#define HYPOT(x,y) SQRT(HYPOT2(x,y)) - -#ifdef TARGET_LPC1768 - #define I2C_ADDRESS(A) ((A) << 1) -#else - #define I2C_ADDRESS(A) A -#endif - -// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments -#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 - - #ifndef _MINMAX_H_ - #define _MINMAX_H_ - - extern "C++" { - - // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; - } - template static inline constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs > rhs ? lhs : rhs; - } - template static inline constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static inline constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } - - } - - #endif - -#else - - #define MIN_2(a,b) ((a)<(b)?(a):(b)) - #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,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 - -// Macros for adding -#define INC_0 1 -#define INC_1 2 -#define INC_2 3 -#define INC_3 4 -#define INC_4 5 -#define INC_5 6 -#define INC_6 7 -#define INC_7 8 -#define INC_8 9 -#define INCREMENT_(n) INC_##n -#define INCREMENT(n) INCREMENT_(n) - -#define ADD0(N) N -#define ADD1(N) INCREMENT_(N) -#define ADD2(N) ADD1(ADD1(N)) -#define ADD3(N) ADD1(ADD2(N)) -#define ADD4(N) ADD2(ADD2(N)) -#define ADD5(N) ADD2(ADD3(N)) -#define ADD6(N) ADD3(ADD3(N)) -#define ADD7(N) ADD3(ADD4(N)) -#define ADD8(N) ADD4(ADD4(N)) -#define ADD9(N) ADD4(ADD5(N)) -#define ADD10(N) ADD5(ADD5(N)) - -// Macros for subtracting -#define DEC_0 0 -#define DEC_1 0 -#define DEC_2 1 -#define DEC_3 2 -#define DEC_4 3 -#define DEC_5 4 -#define DEC_6 5 -#define DEC_7 6 -#define DEC_8 7 -#define DEC_9 8 -#define DECREMENT_(n) DEC_##n -#define DECREMENT(n) DECREMENT_(n) - -#define SUB0(N) N -#define SUB1(N) DECREMENT_(N) -#define SUB2(N) SUB1(SUB1(N)) -#define SUB3(N) SUB1(SUB2(N)) -#define SUB4(N) SUB2(SUB2(N)) -#define SUB5(N) SUB2(SUB3(N)) -#define SUB6(N) SUB3(SUB3(N)) -#define SUB7(N) SUB3(SUB4(N)) -#define SUB8(N) SUB4(SUB4(N)) -#define SUB9(N) SUB4(SUB5(N)) -#define SUB10(N) SUB5(SUB5(N)) - -// -// Primitives supporting precompiler REPEAT -// -#define FIRST(a,...) a -#define SECOND(a,b,...) b - -// Defer expansion -#define EMPTY() -#define DEFER(M) M EMPTY() -#define DEFER2(M) M EMPTY EMPTY()() -#define DEFER3(M) M EMPTY EMPTY EMPTY()()() -#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()() - -// Force define expansion -#define EVAL(V...) EVAL16(V) -#define EVAL1024(V...) EVAL512(EVAL512(V)) -#define EVAL512(V...) EVAL256(EVAL256(V)) -#define EVAL256(V...) EVAL128(EVAL128(V)) -#define EVAL128(V...) EVAL64(EVAL64(V)) -#define EVAL64(V...) EVAL32(EVAL32(V)) -#define EVAL32(V...) EVAL16(EVAL16(V)) -#define EVAL16(V...) EVAL8(EVAL8(V)) -#define EVAL8(V...) EVAL4(EVAL4(V)) -#define EVAL4(V...) EVAL2(EVAL2(V)) -#define EVAL2(V...) EVAL1(EVAL1(V)) -#define EVAL1(V...) V - -#define IS_PROBE(V...) SECOND(V, 0) // Get the second item passed, or 0 -#define PROBE() ~, 1 // Second item will be 1 if this is passed -#define _NOT_0 PROBE() -#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. -#define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. - -#define IF_ELSE(TF) _IF_ELSE(_BOOL(TF)) -#define _IF_ELSE(TF) _CAT(_IF_, TF) - -#define _IF_1(V...) V _IF_1_ELSE -#define _IF_0(...) _IF_0_ELSE - -#define _IF_1_ELSE(...) -#define _IF_0_ELSE(V...) V - -#define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)()) -#define _END_OF_ARGUMENTS_() 0 - -// -// REPEAT core macros. Recurse N times with ascending I. -// - -// Call OP(I) N times with ascending counter. -#define _REPEAT(_RPT_I,_RPT_N,_RPT_OP) \ - _RPT_OP(_RPT_I) \ - IF_ELSE(SUB1(_RPT_N)) \ - ( DEFER2(__REPEAT)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP) ) \ - ( /* Do nothing */ ) -#define __REPEAT() _REPEAT - -// Call OP(I, ...) N times with ascending counter. -#define _REPEAT2(_RPT_I,_RPT_N,_RPT_OP,V...) \ - _RPT_OP(_RPT_I,V) \ - IF_ELSE(SUB1(_RPT_N)) \ - ( DEFER2(__REPEAT2)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP,V) ) \ - ( /* Do nothing */ ) -#define __REPEAT2() _REPEAT2 - -// Repeat a macro passing S...N-1. -#define REPEAT_S(S,N,OP) EVAL(_REPEAT(S,SUB##S(N),OP)) -#define REPEAT(N,OP) REPEAT_S(0,N,OP) - -// Repeat a macro passing 0...N-1 plus additional arguments. -#define REPEAT2_S(S,N,OP,V...) EVAL(_REPEAT2(S,SUB##S(N),OP,V)) -#define REPEAT2(N,OP,V...) REPEAT2_S(0,N,OP,V) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/millis_t.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/millis_t.h deleted file mode 100644 index 7ff231f827..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/millis_t.h +++ /dev/null @@ -1,29 +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 - -#include - -typedef uint32_t millis_t; - -#define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0) -#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/multi_language.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/multi_language.cpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/multi_language.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/multi_language.h deleted file mode 100644 index 98020b1e8d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/multi_language.h +++ /dev/null @@ -1,79 +0,0 @@ -/******************** - * multi_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[]; - -#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 - -// Setting the unused languages equal to each other allows -// the compiler to optimize away the conditionals - -#ifndef LCD_LANGUAGE_2 - #define LCD_LANGUAGE_2 LCD_LANGUAGE -#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 - -#define _GET_LANG(LANG) Language_##LANG -#define GET_LANG(LANG) _GET_LANG(LANG) - -#if NUM_LANGUAGES > 1 - extern uint8_t lang; - #define GET_TEXT(MSG) ( \ - lang == 0 ? GET_LANG(LCD_LANGUAGE)::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 \ - ) - #define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_5)::CHARSIZE) -#else - #define GET_TEXT(MSG) GET_LANG(LCD_LANGUAGE)::MSG - #define MAX_LANG_CHARSIZE GET_LANG(LCD_LANGUAGE)::CHARSIZE -#endif -#define GET_TEXT_F(MSG) (const __FlashStringHelper*)GET_TEXT(MSG) - -#define MSG_CONCAT(A,B) pgm_p_pair_t(GET_TEXT(A),GET_TEXT(B)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.cpp deleted file mode 100644 index 4a5214f5c0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.cpp +++ /dev/null @@ -1,76 +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 . - * - */ - -#include "serial.h" -#include "language.h" - -uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; - -static const char errormagic[] PROGMEM = "Error:"; -static const char echomagic[] PROGMEM = "echo:"; - -#if NUM_SERIAL > 1 - int8_t serial_port_index = SERIAL_PORT; -#endif - -void serialprintPGM(PGM_P str) { - while (const char c = pgm_read_byte(str++)) SERIAL_CHAR(c); -} -void serial_echo_start() { serialprintPGM(echomagic); } -void serial_error_start() { serialprintPGM(errormagic); } - -void serial_echopair_PGM(PGM_P const s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } -void serial_echopair_PGM(PGM_P const s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, unsigned int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } - -void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } - -void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post/*=nullptr*/) { - if (pre) serialprintPGM(pre); - serialprintPGM(onoff ? on : off); - if (post) serialprintPGM(post); -} -void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) : PSTR(MSG_OFF)); } -void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); } -void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); } - -void print_bin(const uint16_t val) { - uint16_t mask = 0x8000; - for (uint8_t i = 16; i--;) { - if (i && !(i % 4)) SERIAL_CHAR(' '); - SERIAL_CHAR((val & mask) ? '1' : '0'); - mask >>= 1; - } -} - -extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; - -void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) { - serialprintPGM(prefix); - SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z); - if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.h deleted file mode 100644 index c2745e972b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/serial.h +++ /dev/null @@ -1,288 +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 - -#include "../inc/MarlinConfig.h" - -/** - * Define debug bit-masks - */ -enum MarlinDebugFlags : uint8_t { - MARLIN_DEBUG_NONE = 0, - MARLIN_DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed - MARLIN_DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output - MARLIN_DEBUG_ERRORS = _BV(2), ///< Not implemented - MARLIN_DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands - MARLIN_DEBUG_COMMUNICATION = _BV(4), ///< Not implemented - #if ENABLED(DEBUG_LEVELING_FEATURE) - MARLIN_DEBUG_LEVELING = _BV(5), ///< Print detailed output for homing and leveling - MARLIN_DEBUG_MESH_ADJUST = _BV(6), ///< UBL bed leveling - #else - MARLIN_DEBUG_LEVELING = 0, - MARLIN_DEBUG_MESH_ADJUST = 0, - #endif - MARLIN_DEBUG_ALL = 0xFF -}; - -extern uint8_t marlin_debug_flags; -#define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F)) - -#define SERIAL_BOTH 0x7F -#if NUM_SERIAL > 1 - extern int8_t serial_port_index; - #define _PORT_REDIRECT(n,p) REMEMBER(n,serial_port_index,p) - #define _PORT_RESTORE(n) RESTORE(n) - #define SERIAL_OUT(WHAT, V...) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \ - if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \ - }while(0) - #define SERIAL_ASSERT(P) if(serial_port_index!=(P)){ debugger(); } -#else - #define _PORT_REDIRECT(n,p) NOOP - #define _PORT_RESTORE(n) NOOP - #define SERIAL_OUT(WHAT, V...) (void)MYSERIAL0.WHAT(V) - #define SERIAL_ASSERT(P) NOOP -#endif - -#define PORT_REDIRECT(p) _PORT_REDIRECT(1,p) -#define PORT_RESTORE() _PORT_RESTORE(1) - -#define SERIAL_CHAR(x) SERIAL_OUT(write, x) -#define SERIAL_ECHO(x) SERIAL_OUT(print, x) -#define SERIAL_ECHO_F(V...) SERIAL_OUT(print, V) -#define SERIAL_ECHOLN(x) SERIAL_OUT(println, x) -#define SERIAL_PRINT(x,b) SERIAL_OUT(print, x, b) -#define SERIAL_PRINTLN(x,b) SERIAL_OUT(println, x, b) -#define SERIAL_PRINTF(V...) SERIAL_OUT(printf, V) -#define SERIAL_FLUSH() SERIAL_OUT(flush) - -#ifdef __STM32F1__ - #define SERIAL_FLUSHTX() SERIAL_OUT(flush) -#elif TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX() SERIAL_OUT(flushTX) -#else - #define SERIAL_FLUSHTX() -#endif - -// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR(). -#define __SEP_N(N,V...) _SEP_##N(V) -#define _SEP_N(N,V...) __SEP_N(N,V) -#define _SEP_1(PRE) SERIAL_ECHOPGM(PRE) -#define _SEP_2(PRE,V) serial_echopair_PGM(PSTR(PRE),V) -#define _SEP_3(a,b,c) do{ _SEP_2(a,b); SERIAL_ECHOPGM(c); }while(0) -#define _SEP_4(a,b,V...) do{ _SEP_2(a,b); _SEP_2(V); }while(0) -#define _SEP_5(a,b,V...) do{ _SEP_2(a,b); _SEP_3(V); }while(0) -#define _SEP_6(a,b,V...) do{ _SEP_2(a,b); _SEP_4(V); }while(0) -#define _SEP_7(a,b,V...) do{ _SEP_2(a,b); _SEP_5(V); }while(0) -#define _SEP_8(a,b,V...) do{ _SEP_2(a,b); _SEP_6(V); }while(0) -#define _SEP_9(a,b,V...) do{ _SEP_2(a,b); _SEP_7(V); }while(0) -#define _SEP_10(a,b,V...) do{ _SEP_2(a,b); _SEP_8(V); }while(0) -#define _SEP_11(a,b,V...) do{ _SEP_2(a,b); _SEP_9(V); }while(0) -#define _SEP_12(a,b,V...) do{ _SEP_2(a,b); _SEP_10(V); }while(0) -#define _SEP_13(a,b,V...) do{ _SEP_2(a,b); _SEP_11(V); }while(0) -#define _SEP_14(a,b,V...) do{ _SEP_2(a,b); _SEP_12(V); }while(0) -#define _SEP_15(a,b,V...) do{ _SEP_2(a,b); _SEP_13(V); }while(0) -#define _SEP_16(a,b,V...) do{ _SEP_2(a,b); _SEP_14(V); }while(0) -#define _SEP_17(a,b,V...) do{ _SEP_2(a,b); _SEP_15(V); }while(0) -#define _SEP_18(a,b,V...) do{ _SEP_2(a,b); _SEP_16(V); }while(0) -#define _SEP_19(a,b,V...) do{ _SEP_2(a,b); _SEP_17(V); }while(0) -#define _SEP_20(a,b,V...) do{ _SEP_2(a,b); _SEP_18(V); }while(0) -#define _SEP_21(a,b,V...) do{ _SEP_2(a,b); _SEP_19(V); }while(0) -#define _SEP_22(a,b,V...) do{ _SEP_2(a,b); _SEP_20(V); }while(0) -#define _SEP_23(a,b,V...) do{ _SEP_2(a,b); _SEP_21(V); }while(0) -#define _SEP_24(a,b,V...) do{ _SEP_2(a,b); _SEP_22(V); }while(0) - -#define SERIAL_ECHOPAIR(V...) _SEP_N(NUM_ARGS(V),V) - -// Print up to 12 pairs of values. Odd elements must be PSTR pointers. -#define __SEP_N_P(N,V...) _SEP_##N##_P(V) -#define _SEP_N_P(N,V...) __SEP_N_P(N,V) -#define _SEP_1_P(PRE) serialprintPGM(PRE) -#define _SEP_2_P(PRE,V) serial_echopair_PGM(PRE,V) -#define _SEP_3_P(a,b,c) do{ _SEP_2_P(a,b); serialprintPGM(c); }while(0) -#define _SEP_4_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_2_P(V); }while(0) -#define _SEP_5_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_3_P(V); }while(0) -#define _SEP_6_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_4_P(V); }while(0) -#define _SEP_7_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_5_P(V); }while(0) -#define _SEP_8_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_6_P(V); }while(0) -#define _SEP_9_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_7_P(V); }while(0) -#define _SEP_10_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_8_P(V); }while(0) -#define _SEP_11_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_9_P(V); }while(0) -#define _SEP_12_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_10_P(V); }while(0) -#define _SEP_13_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_11_P(V); }while(0) -#define _SEP_14_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_12_P(V); }while(0) -#define _SEP_15_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_13_P(V); }while(0) -#define _SEP_16_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_14_P(V); }while(0) -#define _SEP_17_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_15_P(V); }while(0) -#define _SEP_18_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_16_P(V); }while(0) -#define _SEP_19_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_17_P(V); }while(0) -#define _SEP_20_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_18_P(V); }while(0) -#define _SEP_21_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_19_P(V); }while(0) -#define _SEP_22_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_20_P(V); }while(0) -#define _SEP_23_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_21_P(V); }while(0) -#define _SEP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_22_P(V); }while(0) - -#define SERIAL_ECHOPAIR_P(V...) _SEP_N_P(NUM_ARGS(V),V) - -// Print up to 12 pairs of values followed by newline -#define __SELP_N(N,V...) _SELP_##N(V) -#define _SELP_N(N,V...) __SELP_N(N,V) -#define _SELP_1(PRE) SERIAL_ECHOLNPGM(PRE) -#define _SELP_2(PRE,V) do{ serial_echopair_PGM(PSTR(PRE),V); SERIAL_EOL(); }while(0) -#define _SELP_3(a,b,c) do{ _SEP_2(a,b); SERIAL_ECHOLNPGM(c); }while(0) -#define _SELP_4(a,b,V...) do{ _SEP_2(a,b); _SELP_2(V); }while(0) -#define _SELP_5(a,b,V...) do{ _SEP_2(a,b); _SELP_3(V); }while(0) -#define _SELP_6(a,b,V...) do{ _SEP_2(a,b); _SELP_4(V); }while(0) -#define _SELP_7(a,b,V...) do{ _SEP_2(a,b); _SELP_5(V); }while(0) -#define _SELP_8(a,b,V...) do{ _SEP_2(a,b); _SELP_6(V); }while(0) -#define _SELP_9(a,b,V...) do{ _SEP_2(a,b); _SELP_7(V); }while(0) -#define _SELP_10(a,b,V...) do{ _SEP_2(a,b); _SELP_8(V); }while(0) -#define _SELP_11(a,b,V...) do{ _SEP_2(a,b); _SELP_9(V); }while(0) -#define _SELP_12(a,b,V...) do{ _SEP_2(a,b); _SELP_10(V); }while(0) -#define _SELP_13(a,b,V...) do{ _SEP_2(a,b); _SELP_11(V); }while(0) -#define _SELP_14(a,b,V...) do{ _SEP_2(a,b); _SELP_12(V); }while(0) -#define _SELP_15(a,b,V...) do{ _SEP_2(a,b); _SELP_13(V); }while(0) -#define _SELP_16(a,b,V...) do{ _SEP_2(a,b); _SELP_14(V); }while(0) -#define _SELP_17(a,b,V...) do{ _SEP_2(a,b); _SELP_15(V); }while(0) -#define _SELP_18(a,b,V...) do{ _SEP_2(a,b); _SELP_16(V); }while(0) -#define _SELP_19(a,b,V...) do{ _SEP_2(a,b); _SELP_17(V); }while(0) -#define _SELP_20(a,b,V...) do{ _SEP_2(a,b); _SELP_18(V); }while(0) -#define _SELP_21(a,b,V...) do{ _SEP_2(a,b); _SELP_19(V); }while(0) -#define _SELP_22(a,b,V...) do{ _SEP_2(a,b); _SELP_20(V); }while(0) -#define _SELP_23(a,b,V...) do{ _SEP_2(a,b); _SELP_21(V); }while(0) -#define _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0) // Eat two args, pass the rest up - -#define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V) - -// Print up to 12 pairs of values followed by newline -#define __SELP_N_P(N,V...) _SELP_##N##_P(V) -#define _SELP_N_P(N,V...) __SELP_N_P(N,V) -#define _SELP_1_P(PRE) serialprintPGM(PRE) -#define _SELP_2_P(PRE,V) do{ serial_echopair_PGM(PRE,V); SERIAL_EOL(); }while(0) -#define _SELP_3_P(a,b,c) do{ _SEP_2_P(a,b); serialprintPGM(c); }while(0) -#define _SELP_4_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_2_P(V); }while(0) -#define _SELP_5_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_3_P(V); }while(0) -#define _SELP_6_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_4_P(V); }while(0) -#define _SELP_7_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_5_P(V); }while(0) -#define _SELP_8_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_6_P(V); }while(0) -#define _SELP_9_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_7_P(V); }while(0) -#define _SELP_10_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_8_P(V); }while(0) -#define _SELP_11_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_9_P(V); }while(0) -#define _SELP_12_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_10_P(V); }while(0) -#define _SELP_13_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_11_P(V); }while(0) -#define _SELP_14_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_12_P(V); }while(0) -#define _SELP_15_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_13_P(V); }while(0) -#define _SELP_16_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_14_P(V); }while(0) -#define _SELP_17_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_15_P(V); }while(0) -#define _SELP_18_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_16_P(V); }while(0) -#define _SELP_19_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_17_P(V); }while(0) -#define _SELP_20_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_18_P(V); }while(0) -#define _SELP_21_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_19_P(V); }while(0) -#define _SELP_22_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_20_P(V); }while(0) -#define _SELP_23_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_21_P(V); }while(0) -#define _SELP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_22_P(V); }while(0) // Eat two args, pass the rest up - -#define SERIAL_ECHOLNPAIR_P(V...) _SELP_N_P(NUM_ARGS(V),V) - -// Print up to 20 comma-separated pairs of values -#define __SLST_N(N,V...) _SLST_##N(V) -#define _SLST_N(N,V...) __SLST_N(N,V) -#define _SLST_1(a) SERIAL_ECHO(a) -#define _SLST_2(a,b) do{ SERIAL_ECHO(a); SERIAL_ECHOPAIR(", ",b); }while(0) -#define _SLST_3(a,b,c) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_1(c); }while(0) -#define _SLST_4(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_2(V); }while(0) -#define _SLST_5(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_3(V); }while(0) -#define _SLST_6(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_4(V); }while(0) -#define _SLST_7(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_5(V); }while(0) -#define _SLST_8(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_6(V); }while(0) -#define _SLST_9(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_7(V); }while(0) -#define _SLST_10(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_8(V); }while(0) -#define _SLST_11(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_9(V); }while(0) -#define _SLST_12(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_10(V); }while(0) -#define _SLST_13(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_11(V); }while(0) -#define _SLST_14(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_12(V); }while(0) -#define _SLST_15(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_13(V); }while(0) -#define _SLST_16(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_14(V); }while(0) -#define _SLST_17(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_15(V); }while(0) -#define _SLST_18(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_16(V); }while(0) -#define _SLST_19(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_17(V); }while(0) -#define _SLST_20(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_18(V); }while(0) // Eat two args, pass the rest up - -#define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0) -#define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V)) - -#define SERIAL_ECHO_P(P) (serialprintPGM(P)) - -#define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S))) -#define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n"))) - -#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0) -#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0) - -#define SERIAL_ECHOPAIR_F(S,V...) SERIAL_ECHOPAIR_F_P(PSTR(S),V) -#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() -#define SERIAL_EOL() SERIAL_CHAR('\n') - -#define SERIAL_ECHO_MSG(S) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(S); }while(0) -#define SERIAL_ERROR_MSG(S) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(S); }while(0) - -#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.) -// -void serial_echopair_PGM(PGM_P const s_P, const char *v); -void serial_echopair_PGM(PGM_P const s_P, char v); -void serial_echopair_PGM(PGM_P const s_P, int v); -void serial_echopair_PGM(PGM_P const s_P, long v); -void serial_echopair_PGM(PGM_P const s_P, float v); -void serial_echopair_PGM(PGM_P const s_P, double v); -void serial_echopair_PGM(PGM_P const s_P, unsigned int v); -void serial_echopair_PGM(PGM_P const s_P, unsigned long v); -inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } -inline void serial_echopair_PGM(PGM_P const s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } - -void serialprintPGM(PGM_P str); -void serial_echo_start(); -void serial_error_start(); -void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post=nullptr); -void serialprint_onoff(const bool onoff); -void serialprintln_onoff(const bool onoff); -void serialprint_truefalse(const bool tf); -void serial_spaces(uint8_t count); - -void print_bin(const uint16_t val); - -void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr); - -inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) { - print_xyz(xyz.x, xyz.y, xyz.z, prefix, suffix); -} - -#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(VAR, PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0) -#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(V, PSTR(PREFIX), nullptr); }while(0) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/types.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/types.h deleted file mode 100644 index 72578faaaf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/types.h +++ /dev/null @@ -1,489 +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 - -#include -#include - -#include "millis_t.h" - -class __FlashStringHelper; -typedef const __FlashStringHelper *progmem_str; - -// -// Enumerated axis indices -// -// - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space -// - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians -// - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics -// -enum AxisEnum : uint8_t { - X_AXIS = 0, A_AXIS = 0, - Y_AXIS = 1, B_AXIS = 1, - Z_AXIS = 2, C_AXIS = 2, - E_AXIS = 3, - X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6, - E0_AXIS = 3, - E1_AXIS = 4, - E2_AXIS = 5, - E3_AXIS = 6, - E4_AXIS = 7, - E5_AXIS = 8, - ALL_AXES = 0xFE, NO_AXIS = 0xFF -}; - -// -// Loop over XYZE axes -// - -#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) -#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N) - -#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS) -#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS) -#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N) -#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) - -// -// Conditional type assignment magic. For example... -// -// typename IF<(MYOPT==12), int, float>::type myvar; -// -template -struct IF { typedef R type; }; -template -struct IF { typedef L type; }; - -// -// feedRate_t is just a humble float -// -typedef float feedRate_t; - -// Conversion macros -#define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f) -#define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f) -#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage) - -// -// Coordinates structures for XY, XYZ, XYZE... -// - -// Helpers -#define _RECIP(N) ((N) ? 1.0f / float(N) : 0.0f) -#define _ABS(N) ((N) < 0 ? -(N) : (N)) -#define _LS(N) (N = (T)(uint32_t(N) << v)) -#define _RS(N) (N = (T)(uint32_t(N) >> v)) -#define FI FORCE_INLINE - -// Forward declarations -template struct XYval; -template struct XYZval; -template struct XYZEval; - -typedef struct XYval xy_bool_t; -typedef struct XYZval xyz_bool_t; -typedef struct XYZEval xyze_bool_t; - -typedef struct XYval xy_char_t; -typedef struct XYZval xyz_char_t; -typedef struct XYZEval xyze_char_t; - -typedef struct XYval xy_uchar_t; -typedef struct XYZval xyz_uchar_t; -typedef struct XYZEval xyze_uchar_t; - -typedef struct XYval xy_int8_t; -typedef struct XYZval xyz_int8_t; -typedef struct XYZEval xyze_int8_t; - -typedef struct XYval xy_uint8_t; -typedef struct XYZval xyz_uint8_t; -typedef struct XYZEval xyze_uint8_t; - -typedef struct XYval xy_int_t; -typedef struct XYZval xyz_int_t; -typedef struct XYZEval xyze_int_t; - -typedef struct XYval xy_uint_t; -typedef struct XYZval xyz_uint_t; -typedef struct XYZEval xyze_uint_t; - -typedef struct XYval xy_long_t; -typedef struct XYZval xyz_long_t; -typedef struct XYZEval xyze_long_t; - -typedef struct XYval xy_ulong_t; -typedef struct XYZval xyz_ulong_t; -typedef struct XYZEval xyze_ulong_t; - -typedef struct XYZval xyz_vlong_t; -typedef struct XYZEval xyze_vlong_t; - -typedef struct XYval xy_float_t; -typedef struct XYZval xyz_float_t; -typedef struct XYZEval xyze_float_t; - -typedef struct XYval xy_feedrate_t; -typedef struct XYZval xyz_feedrate_t; -typedef struct XYZEval xyze_feedrate_t; - -typedef xy_uint8_t xy_byte_t; -typedef xyz_uint8_t xyz_byte_t; -typedef xyze_uint8_t xyze_byte_t; - -typedef xyz_long_t abc_long_t; -typedef xyze_long_t abce_long_t; -typedef xyz_ulong_t abc_ulong_t; -typedef xyze_ulong_t abce_ulong_t; - -typedef xy_float_t xy_pos_t; -typedef xyz_float_t xyz_pos_t; -typedef xyze_float_t xyze_pos_t; - -typedef xy_float_t ab_float_t; -typedef xyz_float_t abc_float_t; -typedef xyze_float_t abce_float_t; - -typedef ab_float_t ab_pos_t; -typedef abc_float_t abc_pos_t; -typedef abce_float_t abce_pos_t; - -// External conversion methods -void toLogical(xy_pos_t &raw); -void toLogical(xyz_pos_t &raw); -void toLogical(xyze_pos_t &raw); -void toNative(xy_pos_t &raw); -void toNative(xyz_pos_t &raw); -void toNative(xyze_pos_t &raw); - -// -// XY coordinates, counters, etc. -// -template -struct XYval { - union { - struct { T x, y; }; - struct { T a, b; }; - T pos[2]; - }; - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void reset() { x = y = 0; } - FI T magnitude() const { return (T)sqrtf(x*x + y*y); } - FI operator T* () { return pos; } - FI operator bool() { return x || y; } - FI XYval copy() const { return *this; } - FI XYval ABS() const { return { T(_ABS(x)), T(_ABS(y)) }; } - FI XYval asInt() { return { int16_t(x), int16_t(y) }; } - FI XYval asInt() const { return { int16_t(x), int16_t(y) }; } - FI XYval asLong() { return { int32_t(x), int32_t(y) }; } - FI XYval asLong() const { return { int32_t(x), int32_t(y) }; } - FI XYval asFloat() { return { float(x), float(y) }; } - FI XYval asFloat() const { return { float(x), float(y) }; } - FI XYval reciprocal() const { return { _RECIP(x), _RECIP(y) }; } - FI XYval asLogical() const { XYval o = asFloat(); toLogical(o); return o; } - FI XYval asNative() const { XYval o = asFloat(); toNative(o); return o; } - FI operator XYZval() { return { x, y }; } - FI operator XYZval() const { return { x, y }; } - FI operator XYZEval() { return { x, y }; } - FI operator XYZEval() const { return { x, y }; } - FI T& operator[](const int i) { return pos[i]; } - FI const T& operator[](const int i) const { return pos[i]; } - FI XYval& operator= (const T v) { set(v, v ); return *this; } - FI XYval& operator= (const XYZval &rs) { set(rs.x, rs.y); return *this; } - FI XYval& operator= (const XYZEval &rs) { set(rs.x, rs.y); return *this; } - FI XYval operator+ (const XYval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator+ (const XYval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator- (const XYval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator- (const XYval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator* (const XYval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator* (const XYval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator/ (const XYval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator/ (const XYval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator+ (const XYZval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator+ (const XYZval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator- (const XYZval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator- (const XYZval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator* (const XYZval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator* (const XYZval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator/ (const XYZval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator/ (const XYZval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator+ (const XYZEval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator+ (const XYZEval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYval operator- (const XYZEval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator- (const XYZEval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYval operator* (const XYZEval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator* (const XYZEval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYval operator/ (const XYZEval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator/ (const XYZEval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYval operator* (const float &v) const { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } - FI XYval operator* (const float &v) { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } - FI XYval operator* (const int &v) const { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } - FI XYval operator* (const int &v) { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } - FI XYval operator/ (const float &v) const { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } - FI XYval operator/ (const float &v) { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } - FI XYval operator/ (const int &v) const { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } - FI XYval operator/ (const int &v) { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } - FI XYval operator>>(const int &v) const { XYval ls = *this; _RS(ls.x); _RS(ls.y); return ls; } - FI XYval operator>>(const int &v) { XYval ls = *this; _RS(ls.x); _RS(ls.y); return ls; } - FI XYval operator<<(const int &v) const { XYval ls = *this; _LS(ls.x); _LS(ls.y); return ls; } - FI XYval operator<<(const int &v) { XYval ls = *this; _LS(ls.x); _LS(ls.y); return ls; } - FI XYval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator*=(const float &v) { x *= v; y *= v; return *this; } - FI XYval& operator*=(const int &v) { x *= v; y *= v; return *this; } - FI XYval& operator>>=(const int &v) { _RS(x); _RS(y); return *this; } - FI XYval& operator<<=(const int &v) { _LS(x); _LS(y); return *this; } - FI bool operator==(const XYval &rs) { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZval &rs) { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZEval &rs) { return x == rs.x && y == rs.y; } - FI bool operator==(const XYval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator!=(const XYval &rs) { return !operator==(rs); } - FI bool operator!=(const XYZval &rs) { return !operator==(rs); } - FI bool operator!=(const XYZEval &rs) { return !operator==(rs); } - FI bool operator!=(const XYval &rs) const { return !operator==(rs); } - FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } - FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } - FI XYval operator-() { XYval o = *this; o.x = -x; o.y = -y; return o; } - FI const XYval operator-() const { XYval o = *this; o.x = -x; o.y = -y; return o; } -}; - -// -// XYZ coordinates, counters, etc. -// -template -struct XYZval { - union { - struct { T x, y, z; }; - struct { T a, b, c; }; - T pos[3]; - }; - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } - FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; } - FI void reset() { x = y = z = 0; } - FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z); } - FI operator T* () { return pos; } - FI operator bool() { return z || x || y; } - FI XYZval copy() const { XYZval o = *this; return o; } - FI XYZval ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)) }; } - FI XYZval asInt() { return { int16_t(x), int16_t(y), int16_t(z) }; } - FI XYZval asInt() const { return { int16_t(x), int16_t(y), int16_t(z) }; } - FI XYZval asLong() { return { int32_t(x), int32_t(y), int32_t(z) }; } - FI XYZval asLong() const { return { int32_t(x), int32_t(y), int32_t(z) }; } - FI XYZval asFloat() { return { float(x), float(y), float(z) }; } - FI XYZval asFloat() const { return { float(x), float(y), float(z) }; } - FI XYZval reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z) }; } - FI XYZval asLogical() const { XYZval o = asFloat(); toLogical(o); return o; } - FI XYZval asNative() const { XYZval o = asFloat(); toNative(o); return o; } - FI operator XYval&() { return *(XYval*)this; } - FI operator const XYval&() const { return *(const XYval*)this; } - FI operator XYZEval() const { return { x, y, z }; } - FI T& operator[](const int i) { return pos[i]; } - FI const T& operator[](const int i) const { return pos[i]; } - FI XYZval& operator= (const T v) { set(v, v, v ); return *this; } - FI XYZval& operator= (const XYval &rs) { set(rs.x, rs.y ); return *this; } - FI XYZval& operator= (const XYZEval &rs) { set(rs.x, rs.y, rs.z); return *this; } - FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYZval operator- (const XYval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYZval operator* (const XYval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYZval operator+ (const XYZval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZval operator+ (const XYZval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZval operator- (const XYZval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZval operator- (const XYZval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZval operator* (const XYZval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZval operator* (const XYZval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZval operator/ (const XYZval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZval operator/ (const XYZval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZval operator+ (const XYZEval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZval operator+ (const XYZEval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZval operator- (const XYZEval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZval operator- (const XYZEval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZval operator* (const XYZEval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator>>(const int &v) const { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } - FI XYZval operator>>(const int &v) { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } - FI XYZval operator<<(const int &v) const { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; } - FI XYZval operator<<(const int &v) { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; } - FI XYZval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYZval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYZval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYZval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } - FI XYZval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } - FI XYZval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } - FI XYZval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } - FI XYZval& operator/=(const XYZval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } - FI XYZval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } - FI XYZval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } - FI XYZval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } - FI XYZval& operator/=(const XYZEval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } - FI XYZval& operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; } - FI XYZval& operator*=(const int &v) { x *= v; y *= v; z *= v; return *this; } - FI XYZval& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); return *this; } - FI XYZval& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); return *this; } - FI bool operator==(const XYZEval &rs) { return x == rs.x && y == rs.y && z == rs.z; } - FI bool operator!=(const XYZEval &rs) { return !operator==(rs); } - FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y && z == rs.z; } - FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } - FI XYZval operator-() { XYZval o = *this; o.x = -x; o.y = -y; o.z = -z; return o; } - FI const XYZval operator-() const { XYZval o = *this; o.x = -x; o.y = -y; o.z = -z; return o; } -}; - -// -// XYZE coordinates, counters, etc. -// -template -struct XYZEval { - union { - struct{ T x, y, z, e; }; - struct{ T a, b, c; }; - T pos[4]; - }; - FI void reset() { x = y = z = e = 0; } - FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z + e*e); } - FI operator T* () { return pos; } - FI operator bool() { return e || z || x || y; } - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } - FI void set(const T px, const T py, const T pz, const T pe) { x = px; y = py; z = pz; e = pe; } - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; } - FI void set(const XYZval pxyz) { x = pxyz.x; y = pxyz.y; z = pxyz.z; } - FI void set(const XYval pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; } - FI void set(const XYval pxy, const XYval pze) { x = pxy.x; y = pxy.y; z = pze.z; e = pze.e; } - FI void set(const XYZval pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; e = pe; } - FI XYZEval copy() const { return *this; } - FI XYZEval ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(e)) }; } - FI XYZEval asInt() { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; } - FI XYZEval asInt() const { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; } - FI XYZEval asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; } - FI XYZEval asLong() { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; } - FI XYZEval asFloat() { return { float(x), float(y), float(z), float(e) }; } - FI XYZEval asFloat() const { return { float(x), float(y), float(z), float(e) }; } - FI XYZEval reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z), _RECIP(e) }; } - FI XYZEval asLogical() const { XYZEval o = asFloat(); toLogical(o); return o; } - FI XYZEval asNative() const { XYZEval o = asFloat(); toNative(o); return o; } - FI operator XYval&() { return *(XYval*)this; } - FI operator const XYval&() const { return *(const XYval*)this; } - FI operator XYZval&() { return *(XYZval*)this; } - FI operator const XYZval&() const { return *(const XYZval*)this; } - FI T& operator[](const int i) { return pos[i]; } - FI const T& operator[](const int i) const { return pos[i]; } - FI XYZEval& operator= (const T v) { set(v, v, v, v); return *this; } - FI XYZEval& operator= (const XYval &rs) { set(rs.x, rs.y); return *this; } - FI XYZEval& operator= (const XYZval &rs) { set(rs.x, rs.y, rs.z); return *this; } - FI XYZEval operator+ (const XYval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYZEval operator+ (const XYval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } - FI XYZEval operator- (const XYval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYZEval operator- (const XYval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } - FI XYZEval operator* (const XYval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYZEval operator* (const XYval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } - FI XYZEval operator/ (const XYval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYZEval operator/ (const XYval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } - FI XYZEval operator+ (const XYZval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZEval operator+ (const XYZval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } - FI XYZEval operator- (const XYZval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZEval operator- (const XYZval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } - FI XYZEval operator* (const XYZval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZEval operator* (const XYZval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } - FI XYZEval operator/ (const XYZval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZEval operator/ (const XYZval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZEval operator+ (const XYZEval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; } - FI XYZEval operator+ (const XYZEval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; } - FI XYZEval operator- (const XYZEval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; } - FI XYZEval operator- (const XYZEval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; } - FI XYZEval operator* (const XYZEval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; } - FI XYZEval operator* (const XYZEval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; } - FI XYZEval operator/ (const XYZEval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; } - FI XYZEval operator/ (const XYZEval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; } - FI XYZEval operator* (const float &v) const { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } - FI XYZEval operator* (const float &v) { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } - FI XYZEval operator* (const int &v) const { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } - FI XYZEval operator* (const int &v) { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } - FI XYZEval operator/ (const float &v) const { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } - FI XYZEval operator/ (const float &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } - FI XYZEval operator/ (const int &v) const { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } - FI XYZEval operator/ (const int &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } - FI XYZEval operator>>(const int &v) const { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; } - FI XYZEval operator>>(const int &v) { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; } - FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYZEval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } - FI XYZEval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } - FI XYZEval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } - FI XYZEval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } - FI XYZEval& operator/=(const XYZval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } - FI XYZEval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; z += rs.z; e += rs.e; return *this; } - FI XYZEval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; e -= rs.e; return *this; } - FI XYZEval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; e *= rs.e; return *this; } - FI XYZEval& operator/=(const XYZEval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; e /= rs.e; return *this; } - FI XYZEval& operator*=(const T &v) { x *= v; y *= v; z *= v; e *= v; return *this; } - FI XYZEval& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); _RS(e); return *this; } - FI XYZEval& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); _LS(e); return *this; } - FI bool operator==(const XYZval &rs) { return x == rs.x && y == rs.y && z == rs.z; } - FI bool operator!=(const XYZval &rs) { return !operator==(rs); } - FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y && z == rs.z; } - FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } - FI XYZEval operator-() { return { -x, -y, -z, -e }; } - FI const XYZEval operator-() const { return { -x, -y, -z, -e }; } -}; - -#undef _RECIP -#undef _ABS -#undef _LS -#undef _RS -#undef FI - -const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' }; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.cpp deleted file mode 100644 index 189a505cc3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.cpp +++ /dev/null @@ -1,190 +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 . - * - */ - -#include "utility.h" - -#include "../Marlin.h" -#include "../module/temperature.h" - -void safe_delay(millis_t ms) { - while (ms > 50) { - ms -= 50; - delay(50); - thermalManager.manage_heater(); - } - delay(ms); - thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made -} - -#if ENABLED(DEBUG_LEVELING_FEATURE) - - #include "../module/probe.h" - #include "../module/motion.h" - #include "../module/stepper.h" - #include "../libs/numtostr.h" - #include "../feature/bedlevel/bedlevel.h" - - void log_machine_info() { - SERIAL_ECHOLNPGM("Machine Type: " - #if ENABLED(DELTA) - "Delta" - #elif IS_SCARA - "SCARA" - #elif IS_CORE - "Core" - #else - "Cartesian" - #endif - ); - - SERIAL_ECHOLNPGM("Probe: " - #if ENABLED(PROBE_MANUALLY) - "PROBE_MANUALLY" - #elif ENABLED(FIX_MOUNTED_PROBE) - "FIX_MOUNTED_PROBE" - #elif ENABLED(BLTOUCH) - "BLTOUCH" - #elif HAS_Z_SERVO_PROBE - "SERVO PROBE" - #elif ENABLED(TOUCH_MI_PROBE) - "TOUCH_MI_PROBE" - #elif ENABLED(Z_PROBE_SLED) - "Z_PROBE_SLED" - #elif ENABLED(Z_PROBE_ALLEN_KEY) - "Z_PROBE_ALLEN_KEY" - #elif ENABLED(SOLENOID_PROBE) - "SOLENOID_PROBE" - #else - "NONE" - #endif - ); - - #if HAS_BED_PROBE - SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z); - if (probe_offset.x > 0) - SERIAL_ECHOPGM(" (Right"); - else if (probe_offset.x < 0) - SERIAL_ECHOPGM(" (Left"); - else if (probe_offset.y != 0) - SERIAL_ECHOPGM(" (Middle"); - else - SERIAL_ECHOPGM(" (Aligned With"); - - if (probe_offset.y > 0) { - #if IS_SCARA - SERIAL_ECHOPGM("-Distal"); - #else - SERIAL_ECHOPGM("-Back"); - #endif - } - else if (probe_offset.y < 0) { - #if IS_SCARA - SERIAL_ECHOPGM("-Proximal"); - #else - SERIAL_ECHOPGM("-Front"); - #endif - } - else if (probe_offset.x != 0) - SERIAL_ECHOPGM("-Center"); - - if (probe_offset.z < 0) - SERIAL_ECHOPGM(" & Below"); - else if (probe_offset.z > 0) - SERIAL_ECHOPGM(" & Above"); - else - SERIAL_ECHOPGM(" & Same Z as"); - SERIAL_ECHOLNPGM(" Nozzle)"); - #endif - - #if HAS_ABL_OR_UBL - SERIAL_ECHOLNPGM("Auto Bed Leveling: " - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - "LINEAR" - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - "BILINEAR" - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - "3POINT" - #elif ENABLED(AUTO_BED_LEVELING_UBL) - "UBL" - #endif - ); - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) - SERIAL_ECHOLNPAIR("Z Fade: ", planner.z_fade_height); - #endif - #if ABL_PLANAR - SERIAL_ECHOPGM("ABL Adjustment X"); - LOOP_XYZ(a) { - float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]; - SERIAL_CHAR(' '); - SERIAL_CHAR('X' + char(a)); - if (v > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(v); - } - #else - #if ENABLED(AUTO_BED_LEVELING_UBL) - SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = ubl.get_z_correction(current_position); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bilinear_z_offset(current_position); - #endif - SERIAL_ECHO(ftostr43sign(rz, '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position.z), '+')); - SERIAL_CHAR(')'); - } - #endif - #endif - } - else - SERIAL_ECHOLNPGM(" (disabled)"); - - SERIAL_EOL(); - - #elif ENABLED(MESH_BED_LEVELING) - - SERIAL_ECHOPGM("Mesh Bed Leveling"); - if (planner.leveling_active) { - SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+')); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (planner.z_fade_height) { - SERIAL_ECHOPAIR(" (", ftostr43sign( - mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' - )); - SERIAL_CHAR(')'); - } - #endif - } - else - SERIAL_ECHOPGM(" (disabled)"); - - SERIAL_EOL(); - - #endif // MESH_BED_LEVELING - } - -#endif // DEBUG_LEVELING_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.h deleted file mode 100644 index f430da50d6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/core/utility.h +++ /dev/null @@ -1,81 +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 - -#include "../inc/MarlinConfigPre.h" -#include "../core/types.h" - -// Delay that ensures heaters and watchdog are kept alive -void safe_delay(millis_t ms); - -// A delay to provide brittle hosts time to receive bytes -inline void serial_delay(const millis_t ms) { - #if ENABLED(SERIAL_OVERRUN_PROTECTION) - safe_delay(ms); - #else - UNUSED(ms); - #endif -} - -#if GRID_MAX_POINTS_X && GRID_MAX_POINTS_Y - - // 16x16 bit arrays - template - struct FlagBits { - typename IF<(W>8), uint16_t, uint8_t>::type bits[H]; - void fill() { memset(bits, 0xFF, sizeof(bits)); } - void reset() { memset(bits, 0x00, sizeof(bits)); } - void unmark(const uint8_t x, const uint8_t y) { CBI(bits[y], x); } - void mark(const uint8_t x, const uint8_t y) { SBI(bits[y], x); } - bool marked(const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } - inline void unmark(const xy_int8_t &xy) { unmark(xy.x, xy.y); } - inline void mark(const xy_int8_t &xy) { mark(xy.x, xy.y); } - inline bool marked(const xy_int8_t &xy) { return marked(xy.x, xy.y); } - }; - - typedef FlagBits MeshFlags; - -#endif - -#if ENABLED(DEBUG_LEVELING_FEATURE) - void log_machine_info(); -#else - #define log_machine_info() NOOP -#endif - -template -class restorer { - T& ref_; - T val_; -public: - restorer(T& perm) : ref_(perm), val_(perm) {} - restorer(T& perm, T temp_val) : ref_(perm), val_(perm) { perm = temp_val; } - ~restorer() { restore(); } - inline void restore() { ref_ = val_; } -}; - -#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 -// in the range 0-100 while avoiding rounding artifacts -constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127) / 255; } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.cpp deleted file mode 100644 index c3b182c72a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.cpp +++ /dev/null @@ -1,1140 +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 . - * - */ - -//todo: add support for multiple encoders on a single axis -//todo: add z axis auto-leveling -//todo: consolidate some of the related M codes? -//todo: add endstop-replacement mode? -//todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; -//todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial - - -#include "../inc/MarlinConfig.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - -#include "I2CPositionEncoder.h" - -#include "../module/temperature.h" -#include "../module/stepper.h" -#include "../gcode/parser.h" - -#include "../feature/babystep.h" - -#include - -void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) { - encoderAxis = axis; - i2cAddress = address; - - initialized++; - - SERIAL_ECHOLNPAIR("Setting up encoder on ", axis_codes[encoderAxis], " axis, addr = ", address); - - position = get_position(); -} - -void I2CPositionEncoder::update() { - if (!initialized || !homed || !active) return; //check encoder is set up and active - - position = get_position(); - - //we don't want to stop things just because the encoder missed a message, - //so we only care about responses that indicate bad magnetic strength - - if (!passes_test(false)) { //check encoder data is good - lastErrorTime = millis(); - /* - if (trusted) { //commented out as part of the note below - trusted = false; - SERIAL_ECHOLMPAIR("Fault detected on ", axis_codes[encoderAxis], " axis encoder. Disengaging error correction until module is trusted again."); - } - */ - return; - } - - if (!trusted) { - /** - * This is commented out because it introduces error and can cause bad print quality. - * - * This code is intended to manage situations where the encoder has reported bad magnetic strength. - * This indicates that the magnetic strip was too far away from the sensor to reliably track position. - * When this happens, this code resets the offset based on where the printer thinks it is. This has been - * shown to introduce errors in actual position which result in drifting prints and poor print quality. - * Perhaps a better method would be to disable correction on the axis with a problem, report it to the - * user via the status leds on the encoder module and prompt the user to re-home the axis at which point - * the encoder would be re-enabled. - */ - - /* - // If the magnetic strength has been good for a certain time, start trusting the module again - - if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) { - trusted = true; - - SERIAL_ECHOLNPAIR("Untrusted encoder module on ", axis_codes[encoderAxis], " axis has been fault-free for set duration, reinstating error correction."); - - //the encoder likely lost its place when the error occured, so we'll reset and use the printer's - //idea of where it the axis is to re-initialize - const float pos = planner.get_axis_position_mm(encoderAxis); - int32_t positionInTicks = pos * get_ticks_unit(); - - //shift position from previous to current position - zeroOffset -= (positionInTicks - get_position()); - - #ifdef I2CPE_DEBUG - SERIAL_ECHOLNPAIR("Current position is ", pos); - SERIAL_ECHOLNPAIR("Position in encoder ticks is ", positionInTicks); - SERIAL_ECHOLNPAIR("New zero-offset of ", zeroOffset); - SERIAL_ECHOPAIR("New position reads as ", get_position()); - SERIAL_CHAR('('); - SERIAL_ECHO(mm_from_count(get_position())); - SERIAL_ECHOLNPGM(")"); - #endif - } - */ - return; - } - - lastPosition = position; - const millis_t positionTime = millis(); - - //only do error correction if setup and enabled - if (ec && ecMethod != I2CPE_ECM_NONE) { - - #ifdef I2CPE_EC_THRESH_PROPORTIONAL - const millis_t deltaTime = positionTime - lastPositionTime; - const uint32_t distance = ABS(position - lastPosition), - speed = distance / deltaTime; - const float threshold = constrain((speed / 50), 1, 50) * ecThreshold; - #else - const float threshold = get_error_correct_threshold(); - #endif - - //check error - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - float sum = 0, diffSum = 0; - - errIdx = (errIdx >= I2CPE_ERR_ARRAY_SIZE - 1) ? 0 : errIdx + 1; - err[errIdx] = get_axis_error_steps(false); - - LOOP_L_N(i, I2CPE_ERR_ARRAY_SIZE) { - sum += err[i]; - if (i) diffSum += ABS(err[i-1] - err[i]); - } - - const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); //calculate average for error - - #else - const int32_t error = get_axis_error_steps(false); - #endif - - //SERIAL_ECHOLNPAIR("Axis error steps: ", error); - - #ifdef I2CPE_ERR_THRESH_ABORT - if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) { - //kill(PSTR("Significant Error")); - SERIAL_ECHOLNPAIR("Axis error over threshold, aborting!", error); - safe_delay(5000); - } - #endif - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - if (errIdx == 0) { - // In order to correct for "error" but avoid correcting for noise and non-skips - // it must be > threshold and have a difference average of < 10 and be < 2000 steps - if (ABS(error) > threshold * planner.settings.axis_steps_per_mm[encoderAxis] && - diffSum < 10 * (I2CPE_ERR_ARRAY_SIZE - 1) && ABS(error) < 2000) { // Check for persistent error (skip) - errPrst[errPrstIdx++] = error; // Error must persist for I2CPE_ERR_PRST_ARRAY_SIZE error cycles. This also serves to improve the average accuracy - 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 * 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)); - errPrstIdx = 0; - } - } - else - errPrstIdx = 0; - } - #else - if (ABS(error) > threshold * planner.settings.axis_steps_per_mm[encoderAxis]) { - //SERIAL_ECHOLN(error); - //SERIAL_ECHOLN(position); - babystep.add_steps(encoderAxis, -LROUND(error / 2)); - } - #endif - - if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) { - const millis_t ms = millis(); - if (ELAPSED(ms, nextErrorCountTime)) { - SERIAL_ECHOLNPAIR("Large error on ", axis_codes[encoderAxis], " axis. error: ", (int)error, "; diffSum: ", diffSum); - errorCount++; - nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS; - } - } - } - - lastPositionTime = positionTime; -} - -void I2CPositionEncoder::set_homed() { - if (active) { - reset(); // Reset module's offset to zero (so current position is homed / zero) - delay(10); - - zeroOffset = get_raw_count(); - homed++; - trusted++; - - #ifdef I2CPE_DEBUG - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPAIR(" axis encoder homed, offset of ", zeroOffset, " ticks."); - #endif - } -} - -void I2CPositionEncoder::set_unhomed() { - zeroOffset = 0; - homed = trusted = false; - - #ifdef I2CPE_DEBUG - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder unhomed."); - #endif -} - -bool I2CPositionEncoder::passes_test(const bool report) { - if (report) { - if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. "); - SERIAL_ECHO(axis_codes[encoderAxis]); - serial_ternary(H == I2CPE_MAG_SIG_BAD, PSTR(" axis "), PSTR("magnetic strip "), PSTR("encoder ")); - switch (H) { - case I2CPE_MAG_SIG_GOOD: - case I2CPE_MAG_SIG_MID: - SERIAL_ECHO_TERNARY(H == I2CPE_MAG_SIG_GOOD, "passes test; field strength ", "good", "fair", ".\n"); - break; - default: - SERIAL_ECHOLNPGM("not detected!"); - } - } - return (H == I2CPE_MAG_SIG_GOOD || H == I2CPE_MAG_SIG_MID); -} - -float I2CPositionEncoder::get_axis_error_mm(const bool report) { - float target, actual, error; - - target = planner.get_axis_position_mm(encoderAxis); - actual = mm_from_count(position); - error = actual - target; - - if (ABS(error) > 10000) error = 0; // ? - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", actual, ", error : ",error); - } - - return error; -} - -int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) { - if (!active) { - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPGM(" axis encoder not active!"); - } - return 0; - } - - float stepperTicksPerUnit; - int32_t encoderTicks = position, encoderCountInStepperTicksScaled; - //int32_t stepperTicks = stepper.position(encoderAxis); - - // With a rotary encoder we're concerned with ticks/rev; whereas with a linear we're concerned with ticks/mm - stepperTicksPerUnit = (type == I2CPE_ENC_TYPE_ROTARY) ? stepperTicks : planner.settings.axis_steps_per_mm[encoderAxis]; - - //convert both 'ticks' into same units / base - encoderCountInStepperTicksScaled = LROUND((stepperTicksPerUnit * encoderTicks) / encoderTicksPerUnit); - - int32_t target = stepper.position(encoderAxis), - error = (encoderCountInStepperTicksScaled - target); - - //suppress discontinuities (might be caused by bad I2C readings...?) - const bool suppressOutput = (ABS(error - errorPrev) > 100); - - if (report) { - SERIAL_ECHO(axis_codes[encoderAxis]); - SERIAL_ECHOLNPAIR(" axis target: ", target, ", actual: ", encoderCountInStepperTicksScaled, ", error : ", error); - if (suppressOutput) SERIAL_ECHOLNPGM("Discontinuity detected, suppressing error."); - } - - errorPrev = error; - - return (suppressOutput ? 0 : error); -} - -int32_t I2CPositionEncoder::get_raw_count() { - uint8_t index = 0; - i2cLong encoderCount; - - encoderCount.val = 0x00; - - if (Wire.requestFrom((int)i2cAddress, 3) != 3) { - //houston, we have a problem... - H = I2CPE_MAG_SIG_NF; - return 0; - } - - while (Wire.available()) - encoderCount.bval[index++] = (uint8_t)Wire.read(); - - //extract the magnetic strength - H = (B00000011 & (encoderCount.bval[2] >> 6)); - - //extract sign bit; sign = (encoderCount.bval[2] & B00100000); - //set all upper bits to the sign value to overwrite H - encoderCount.val = (encoderCount.bval[2] & B00100000) ? (encoderCount.val | 0xFFC00000) : (encoderCount.val & 0x003FFFFF); - - if (invert) encoderCount.val *= -1; - - return encoderCount.val; -} - -bool I2CPositionEncoder::test_axis() { - //only works on XYZ cartesian machines for the time being - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) return false; - - const float startPosition = soft_endstop.min[encoderAxis] + 10, - endPosition = soft_endstop.max[encoderAxis] - 10; - const feedRate_t fr_mm_s = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); - - ec = false; - - xyze_pos_t startCoord, endCoord; - LOOP_XYZ(a) { - startCoord[a] = planner.get_axis_position_mm((AxisEnum)a); - endCoord[a] = planner.get_axis_position_mm((AxisEnum)a); - } - startCoord[encoderAxis] = startPosition; - endCoord[encoderAxis] = endPosition; - - planner.synchronize(); - startCoord.e = planner.get_axis_position_mm(E_AXIS); - planner.buffer_line(startCoord, 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) - if (!trusted) { - int32_t startWaitingTime = millis(); - while (!trusted && millis() - startWaitingTime < I2CPE_TIME_TRUSTED) - safe_delay(500); - } - - if (trusted) { // if trusted, commence test - endCoord.e = planner.get_axis_position_mm(E_AXIS); - planner.buffer_line(endCoord, fr_mm_s, 0); - planner.synchronize(); - } - - return trusted; -} - -void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { - if (type != I2CPE_ENC_TYPE_LINEAR) { - SERIAL_ECHOLNPGM("Steps/mm calibration requires linear encoder."); - return; - } - - if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) { - SERIAL_ECHOLNPGM("Steps/mm calibration not supported for this axis."); - return; - } - - float old_steps_mm, new_steps_mm, - startDistance, endDistance, - travelDistance, travelledDistance, total = 0; - - int32_t startCount, stopCount; - - const feedRate_t fr_mm_s = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); - - bool oldec = ec; - ec = false; - - startDistance = 20; - endDistance = soft_endstop.max[encoderAxis] - 20; - travelDistance = endDistance - startDistance; - - xyze_pos_t startCoord, endCoord; - LOOP_XYZ(a) { - startCoord[a] = planner.get_axis_position_mm((AxisEnum)a); - endCoord[a] = planner.get_axis_position_mm((AxisEnum)a); - } - startCoord[encoderAxis] = startDistance; - endCoord[encoderAxis] = endDistance; - - planner.synchronize(); - - LOOP_L_N(i, iter) { - startCoord.e = planner.get_axis_position_mm(E_AXIS); - planner.buffer_line(startCoord, fr_mm_s, 0); - planner.synchronize(); - - delay(250); - startCount = get_position(); - - //do_blocking_move_to(endCoord); - - endCoord.e = planner.get_axis_position_mm(E_AXIS); - planner.buffer_line(endCoord, fr_mm_s, 0); - planner.synchronize(); - - //Read encoder distance - delay(250); - stopCount = get_position(); - - travelledDistance = mm_from_count(ABS(stopCount - startCount)); - - SERIAL_ECHOLNPAIR("Attempted travel: ", travelDistance, "mm"); - SERIAL_ECHOLNPAIR(" Actual travel: ", travelledDistance, "mm"); - - //Calculate new axis steps per unit - old_steps_mm = planner.settings.axis_steps_per_mm[encoderAxis]; - new_steps_mm = (old_steps_mm * travelDistance) / travelledDistance; - - SERIAL_ECHOLNPAIR("Old steps/mm: ", old_steps_mm); - SERIAL_ECHOLNPAIR("New steps/mm: ", new_steps_mm); - - //Save new value - planner.settings.axis_steps_per_mm[encoderAxis] = new_steps_mm; - - if (iter > 1) { - total += new_steps_mm; - - // swap start and end points so next loop runs from current position - const float tempCoord = startCoord[encoderAxis]; - startCoord[encoderAxis] = endCoord[encoderAxis]; - endCoord[encoderAxis] = tempCoord; - } - } - - if (iter > 1) { - total /= (float)iter; - SERIAL_ECHOLNPAIR("Average steps/mm: ", total); - } - - ec = oldec; - - SERIAL_ECHOLNPGM("Calculated steps/mm set. Use M500 to save to EEPROM."); -} - -void I2CPositionEncoder::reset() { - Wire.beginTransmission(I2C_ADDRESS(i2cAddress)); - Wire.write(I2CPE_RESET_COUNT); - Wire.endTransmission(); - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - ZERO(err); - #endif -} - - -bool I2CPositionEncodersMgr::I2CPE_anyaxis; -uint8_t I2CPositionEncodersMgr::I2CPE_addr, - I2CPositionEncodersMgr::I2CPE_idx; -I2CPositionEncoder I2CPositionEncodersMgr::encoders[I2CPE_ENCODER_CNT]; - -void I2CPositionEncodersMgr::init() { - Wire.begin(); - - #if I2CPE_ENCODER_CNT > 0 - uint8_t i = 0; - - encoders[i].init(I2CPE_ENC_1_ADDR, I2CPE_ENC_1_AXIS); - - #ifdef I2CPE_ENC_1_TYPE - encoders[i].set_type(I2CPE_ENC_1_TYPE); - #endif - #ifdef I2CPE_ENC_1_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_1_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_1_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_1_TICKS_REV); - #endif - #ifdef I2CPE_ENC_1_INVERT - encoders[i].set_inverted(I2CPE_ENC_1_INVERT); - #endif - #ifdef I2CPE_ENC_1_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_1_EC_METHOD); - #endif - #ifdef I2CPE_ENC_1_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_1_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_1_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 1 - i++; - - encoders[i].init(I2CPE_ENC_2_ADDR, I2CPE_ENC_2_AXIS); - - #ifdef I2CPE_ENC_2_TYPE - encoders[i].set_type(I2CPE_ENC_2_TYPE); - #endif - #ifdef I2CPE_ENC_2_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_2_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_2_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_2_TICKS_REV); - #endif - #ifdef I2CPE_ENC_2_INVERT - encoders[i].set_inverted(I2CPE_ENC_2_INVERT); - #endif - #ifdef I2CPE_ENC_2_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_2_EC_METHOD); - #endif - #ifdef I2CPE_ENC_2_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_2_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_2_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 2 - i++; - - encoders[i].init(I2CPE_ENC_3_ADDR, I2CPE_ENC_3_AXIS); - - #ifdef I2CPE_ENC_3_TYPE - encoders[i].set_type(I2CPE_ENC_3_TYPE); - #endif - #ifdef I2CPE_ENC_3_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_3_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_3_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_3_TICKS_REV); - #endif - #ifdef I2CPE_ENC_3_INVERT - encoders[i].set_inverted(I2CPE_ENC_3_INVERT); - #endif - #ifdef I2CPE_ENC_3_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_3_EC_METHOD); - #endif - #ifdef I2CPE_ENC_3_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_3_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_3_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 3 - i++; - - encoders[i].init(I2CPE_ENC_4_ADDR, I2CPE_ENC_4_AXIS); - - #ifdef I2CPE_ENC_4_TYPE - encoders[i].set_type(I2CPE_ENC_4_TYPE); - #endif - #ifdef I2CPE_ENC_4_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_4_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_4_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_4_TICKS_REV); - #endif - #ifdef I2CPE_ENC_4_INVERT - encoders[i].set_inverted(I2CPE_ENC_4_INVERT); - #endif - #ifdef I2CPE_ENC_4_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_4_EC_METHOD); - #endif - #ifdef I2CPE_ENC_4_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_4_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_4_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 4 - i++; - - encoders[i].init(I2CPE_ENC_5_ADDR, I2CPE_ENC_5_AXIS); - - #ifdef I2CPE_ENC_5_TYPE - encoders[i].set_type(I2CPE_ENC_5_TYPE); - #endif - #ifdef I2CPE_ENC_5_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_5_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_5_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_5_TICKS_REV); - #endif - #ifdef I2CPE_ENC_5_INVERT - encoders[i].set_inverted(I2CPE_ENC_5_INVERT); - #endif - #ifdef I2CPE_ENC_5_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_5_EC_METHOD); - #endif - #ifdef I2CPE_ENC_5_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_5_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_5_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif - - #if I2CPE_ENCODER_CNT > 5 - i++; - - encoders[i].init(I2CPE_ENC_6_ADDR, I2CPE_ENC_6_AXIS); - - #ifdef I2CPE_ENC_6_TYPE - encoders[i].set_type(I2CPE_ENC_6_TYPE); - #endif - #ifdef I2CPE_ENC_6_TICKS_UNIT - encoders[i].set_ticks_unit(I2CPE_ENC_6_TICKS_UNIT); - #endif - #ifdef I2CPE_ENC_6_TICKS_REV - encoders[i].set_stepper_ticks(I2CPE_ENC_6_TICKS_REV); - #endif - #ifdef I2CPE_ENC_6_INVERT - encoders[i].set_inverted(I2CPE_ENC_6_INVERT); - #endif - #ifdef I2CPE_ENC_6_EC_METHOD - encoders[i].set_ec_method(I2CPE_ENC_6_EC_METHOD); - #endif - #ifdef I2CPE_ENC_6_EC_THRESH - encoders[i].set_ec_threshold(I2CPE_ENC_6_EC_THRESH); - #endif - - encoders[i].set_active(encoders[i].passes_test(true)); - - #if I2CPE_ENC_6_AXIS == E_AXIS - encoders[i].set_homed(); - #endif - #endif -} - -void I2CPositionEncodersMgr::report_position(const int8_t idx, const bool units, const bool noOffset) { - CHECK_IDX(); - - if (units) - SERIAL_ECHOLN(noOffset ? encoders[idx].mm_from_count(encoders[idx].get_raw_count()) : encoders[idx].get_position_mm()); - else { - if (noOffset) { - const int32_t raw_count = encoders[idx].get_raw_count(); - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_CHAR(' '); - - for (uint8_t j = 31; j > 0; j--) - SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j))); - - SERIAL_ECHO((bool)(0x00000001 & raw_count)); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(raw_count); - } - else - SERIAL_ECHOLN(encoders[idx].get_position()); - } -} - -void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const uint8_t newaddr) { - // First check 'new' address is not in use - Wire.beginTransmission(I2C_ADDRESS(newaddr)); - if (!Wire.endTransmission()) { - SERIAL_ECHOLNPAIR("?There is already a device with that address on the I2C bus! (", newaddr, ")"); - return; - } - - // Now check that we can find the module on the oldaddr address - Wire.beginTransmission(I2C_ADDRESS(oldaddr)); - if (Wire.endTransmission()) { - SERIAL_ECHOLNPAIR("?No module detected at this address! (", oldaddr, ")"); - return; - } - - SERIAL_ECHOLNPAIR("Module found at ", oldaddr, ", changing address to ", newaddr); - - // Change the modules address - Wire.beginTransmission(I2C_ADDRESS(oldaddr)); - Wire.write(I2CPE_SET_ADDR); - Wire.write(newaddr); - Wire.endTransmission(); - - SERIAL_ECHOLNPGM("Address changed, resetting and waiting for confirmation.."); - - // Wait for the module to reset (can probably be improved by polling address with a timeout). - safe_delay(I2CPE_REBOOT_TIME); - - // Look for the module at the new address. - Wire.beginTransmission(I2C_ADDRESS(newaddr)); - if (Wire.endTransmission()) { - SERIAL_ECHOLNPGM("Address change failed! Check encoder module."); - return; - } - - SERIAL_ECHOLNPGM("Address change successful!"); - - // Now, if this module is configured, find which encoder instance it's supposed to correspond to - // and enable it (it will likely have failed initialization on power-up, before the address change). - const int8_t idx = idx_from_addr(newaddr); - if (idx >= 0 && !encoders[idx].get_active()) { - SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]); - SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again."); - encoders[idx].set_active(encoders[idx].passes_test(true)); - } -} - -void I2CPositionEncodersMgr::report_module_firmware(const uint8_t address) { - // First check there is a module - Wire.beginTransmission(I2C_ADDRESS(address)); - if (Wire.endTransmission()) { - SERIAL_ECHOLNPAIR("?No module detected at this address! (", address, ")"); - return; - } - - SERIAL_ECHOLNPAIR("Requesting version info from module at address ", address, ":"); - - Wire.beginTransmission(I2C_ADDRESS(address)); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_VERSION); - Wire.endTransmission(); - - // Read value - if (Wire.requestFrom((int)address, 32)) { - char c; - while (Wire.available() > 0 && (c = (char)Wire.read()) > 0) - SERIAL_ECHO(c); - SERIAL_EOL(); - } - - // Set module back to normal (distance) mode - Wire.beginTransmission(I2C_ADDRESS(address)); - Wire.write(I2CPE_SET_REPORT_MODE); - Wire.write(I2CPE_REPORT_DISTANCE); - Wire.endTransmission(); -} - -int8_t I2CPositionEncodersMgr::parse() { - I2CPE_addr = 0; - - if (parser.seen('A')) { - - if (!parser.has_value()) { - SERIAL_ECHOLNPGM("?A seen, but no address specified! [30-200]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_addr = parser.value_byte(); - if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 - SERIAL_ECHOLNPGM("?Address out of range. [30-200]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_idx = idx_from_addr(I2CPE_addr); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_ECHOLNPGM("?No device with this address!"); - return I2CPE_PARSE_ERR; - } - } - else if (parser.seenval('I')) { - - if (!parser.has_value()) { - SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]"); - return I2CPE_PARSE_ERR; - }; - - I2CPE_idx = parser.value_byte(); - if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1, "]"); - return I2CPE_PARSE_ERR; - } - - I2CPE_addr = encoders[I2CPE_idx].get_address(); - } - else - I2CPE_idx = 0xFF; - - I2CPE_anyaxis = parser.seen_axis(); - - return I2CPE_PARSE_OK; -}; - -/** - * M860: Report the position(s) of position encoder module(s). - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * O Include homed zero-offset in returned position. - * U Units in mm or raw step count. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ -void I2CPositionEncodersMgr::M860() { - if (parse()) return; - - const bool hasU = parser.seen('U'), hasO = parser.seen('O'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_position(idx, hasU, hasO); - } - } - } - else - report_position(I2CPE_idx, hasU, hasO); -} - -/** - * M861: Report the status of position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ -void I2CPositionEncodersMgr::M861() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_status(idx); - } - } - } - else - report_status(I2CPE_idx); -} - -/** - * M862: Perform an axis continuity test for position encoder - * modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ -void I2CPositionEncodersMgr::M862() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) test_axis(idx); - } - } - } - else - test_axis(I2CPE_idx); -} - -/** - * M863: Perform steps-per-mm calibration for - * position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * P Number of rePeats/iterations. - * - * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. - * - */ -void I2CPositionEncodersMgr::M863() { - if (parse()) return; - - const uint8_t iterations = constrain(parser.byteval('P', 1), 1, 10); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) calibrate_steps_mm(idx, iterations); - } - } - } - else - calibrate_steps_mm(I2CPE_idx, iterations); -} - -/** - * M864: Change position encoder module I2C address. - * - * A Module current/old I2C address. If not present, - * assumes default address (030). [30, 200]. - * S Module new I2C address. [30, 200]. - * - * If S is not specified: - * X Use I2CPE_PRESET_ADDR_X (030). - * Y Use I2CPE_PRESET_ADDR_Y (031). - * Z Use I2CPE_PRESET_ADDR_Z (032). - * E Use I2CPE_PRESET_ADDR_E (033). - */ -void I2CPositionEncodersMgr::M864() { - uint8_t newAddress; - - if (parse()) return; - - if (!I2CPE_addr) I2CPE_addr = I2CPE_PRESET_ADDR_X; - - if (parser.seen('S')) { - if (!parser.has_value()) { - SERIAL_ECHOLNPGM("?S seen, but no address specified! [30-200]"); - return; - }; - - newAddress = parser.value_byte(); - if (!WITHIN(newAddress, 30, 200)) { - SERIAL_ECHOLNPGM("?New address out of range. [30-200]"); - return; - } - } - else if (!I2CPE_anyaxis) { - SERIAL_ECHOLNPGM("?You must specify S or [XYZE]."); - return; - } - else { - if (parser.seen('X')) newAddress = I2CPE_PRESET_ADDR_X; - else if (parser.seen('Y')) newAddress = I2CPE_PRESET_ADDR_Y; - else if (parser.seen('Z')) newAddress = I2CPE_PRESET_ADDR_Z; - else if (parser.seen('E')) newAddress = I2CPE_PRESET_ADDR_E; - else return; - } - - SERIAL_ECHOLNPAIR("Changing module at address ", I2CPE_addr, " to address ", newAddress); - - change_module_address(I2CPE_addr, newAddress); -} - -/** - * M865: Check position encoder module firmware version. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A or I not specified: - * X Check X axis encoder, if present. - * Y Check Y axis encoder, if present. - * Z Check Z axis encoder, if present. - * E Check E axis encoder, if present. - */ -void I2CPositionEncodersMgr::M865() { - if (parse()) return; - - if (!I2CPE_addr) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_module_firmware(encoders[idx].get_address()); - } - } - } - else - report_module_firmware(I2CPE_addr); -} - -/** - * M866: Report or reset position encoder module error - * count. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * R Reset error counter. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ -void I2CPositionEncodersMgr::M866() { - if (parse()) return; - - const bool hasR = parser.seen('R'); - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (hasR) - reset_error_count(idx, AxisEnum(i)); - else - report_error_count(idx, AxisEnum(i)); - } - } - } - } - else if (hasR) - reset_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); - else - report_error_count(I2CPE_idx, encoders[I2CPE_idx].get_axis()); -} - -/** - * M867: Enable/disable or toggle error correction for position encoder modules. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * S<1|0> Enable/disable error correction. 1 enables, 0 disables. If not - * supplied, toggle. - * - * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ -void I2CPositionEncodersMgr::M867() { - if (parse()) return; - - const int8_t onoff = parser.seenval('S') ? parser.value_int() : -1; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(idx, ena, AxisEnum(i)); - } - } - } - } - else { - const bool ena = onoff == -1 ? !encoders[I2CPE_idx].get_ec_enabled() : !!onoff; - enable_ec(I2CPE_idx, ena, encoders[I2CPE_idx].get_axis()); - } -} - -/** - * M868: Report or set position encoder module error correction - * threshold. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * T New error correction threshold. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ -void I2CPositionEncodersMgr::M868() { - if (parse()) return; - - const float newThreshold = parser.seenval('T') ? parser.value_float() : -9999; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) { - if (newThreshold != -9999) - set_ec_threshold(idx, newThreshold, encoders[idx].get_axis()); - else - get_ec_threshold(idx, encoders[idx].get_axis()); - } - } - } - } - else if (newThreshold != -9999) - set_ec_threshold(I2CPE_idx, newThreshold, encoders[I2CPE_idx].get_axis()); - else - get_ec_threshold(I2CPE_idx, encoders[I2CPE_idx].get_axis()); -} - -/** - * M869: Report position encoder module error. - * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * - * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. - */ -void I2CPositionEncodersMgr::M869() { - if (parse()) return; - - if (I2CPE_idx == 0xFF) { - LOOP_XYZE(i) { - if (!I2CPE_anyaxis || parser.seen(axis_codes[i])) { - const uint8_t idx = idx_from_axis(AxisEnum(i)); - if ((int8_t)idx >= 0) report_error(idx); - } - } - } - else - report_error(I2CPE_idx); -} - -#endif // I2C_POSITION_ENCODERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.h deleted file mode 100644 index 25350b2787..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/I2CPositionEncoder.h +++ /dev/null @@ -1,320 +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 - -#include "../inc/MarlinConfig.h" - -#include "../module/planner.h" - -#include - -//=========== Advanced / Less-Common Encoder Configuration Settings ========== - -#define I2CPE_EC_THRESH_PROPORTIONAL // if enabled adjusts the error correction threshold - // proportional to the current speed of the axis allows - // for very small error margin at low speeds without - // stuttering due to reading latency at high speeds - -#define I2CPE_DEBUG // enable encoder-related debug serial echos - -#define I2CPE_REBOOT_TIME 5000 // time we wait for an encoder module to reboot - // after changing address. - -#define I2CPE_MAG_SIG_GOOD 0 -#define I2CPE_MAG_SIG_MID 1 -#define I2CPE_MAG_SIG_BAD 2 -#define I2CPE_MAG_SIG_NF 255 - -#define I2CPE_REQ_REPORT 0 -#define I2CPE_RESET_COUNT 1 -#define I2CPE_SET_ADDR 2 -#define I2CPE_SET_REPORT_MODE 3 -#define I2CPE_CLEAR_EEPROM 4 - -#define I2CPE_LED_PAR_MODE 10 -#define I2CPE_LED_PAR_BRT 11 -#define I2CPE_LED_PAR_RATE 14 - -#define I2CPE_REPORT_DISTANCE 0 -#define I2CPE_REPORT_STRENGTH 1 -#define I2CPE_REPORT_VERSION 2 - -// Default I2C addresses -#define I2CPE_PRESET_ADDR_X 30 -#define I2CPE_PRESET_ADDR_Y 31 -#define I2CPE_PRESET_ADDR_Z 32 -#define I2CPE_PRESET_ADDR_E 33 - -#define I2CPE_DEF_AXIS X_AXIS -#define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X - -// Error event counter; tracks how many times there is an error exceeding a certain threshold -#define I2CPE_ERR_CNT_THRESH 3.00 -#define I2CPE_ERR_CNT_DEBOUNCE_MS 2000 - -#if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - #define I2CPE_ERR_ARRAY_SIZE 32 - #define I2CPE_ERR_PRST_ARRAY_SIZE 10 -#endif - -// Error Correction Methods -#define I2CPE_ECM_NONE 0 -#define I2CPE_ECM_MICROSTEP 1 -#define I2CPE_ECM_PLANNER 2 -#define I2CPE_ECM_STALLDETECT 3 - -// Encoder types -#define I2CPE_ENC_TYPE_ROTARY 0 -#define I2CPE_ENC_TYPE_LINEAR 1 - -// Parser -#define I2CPE_PARSE_ERR 1 -#define I2CPE_PARSE_OK 0 - -#define LOOP_PE(VAR) LOOP_L_N(VAR, I2CPE_ENCODER_CNT) -#define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0) - -typedef union { - volatile int32_t val = 0; - uint8_t bval[4]; -} i2cLong; - -class I2CPositionEncoder { - private: - AxisEnum encoderAxis = I2CPE_DEF_AXIS; - - uint8_t i2cAddress = I2CPE_DEF_ADDR, - ecMethod = I2CPE_DEF_EC_METHOD, - type = I2CPE_DEF_TYPE, - H = I2CPE_MAG_SIG_NF; // Magnetic field strength - - int encoderTicksPerUnit = I2CPE_DEF_ENC_TICKS_UNIT, - stepperTicks = I2CPE_DEF_TICKS_REV, - errorCount = 0, - errorPrev = 0; - - float ecThreshold = I2CPE_DEF_EC_THRESH; - - bool homed = false, - trusted = false, - initialized = false, - active = false, - invert = false, - ec = true; - - int32_t zeroOffset = 0, - lastPosition = 0, - position; - - millis_t lastPositionTime = 0, - nextErrorCountTime = 0, - lastErrorTime; - - #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - uint8_t errIdx = 0, errPrstIdx = 0; - int err[I2CPE_ERR_ARRAY_SIZE] = { 0 }, - errPrst[I2CPE_ERR_PRST_ARRAY_SIZE] = { 0 }; - #endif - - public: - void init(const uint8_t address, const AxisEnum axis); - void reset(); - - void update(); - - void set_homed(); - void set_unhomed(); - - int32_t get_raw_count(); - - FORCE_INLINE float mm_from_count(const int32_t count) { - switch (type) { - default: return -1; - case I2CPE_ENC_TYPE_LINEAR: - return count / encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (count * stepperTicks) / (encoderTicksPerUnit * planner.settings.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); } - FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; } - - int32_t get_axis_error_steps(const bool report); - float get_axis_error_mm(const bool report); - - void calibrate_steps_mm(const uint8_t iter); - - bool passes_test(const bool report); - - bool test_axis(); - - 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() { return active; } - FORCE_INLINE void set_active(const bool a) { active = a; } - - FORCE_INLINE void set_inverted(const bool i) { invert = i; } - - FORCE_INLINE AxisEnum get_axis() { return encoderAxis; } - - FORCE_INLINE bool get_ec_enabled() { return ec; } - FORCE_INLINE void set_ec_enabled(const bool enabled) { ec = enabled; } - - FORCE_INLINE uint8_t get_ec_method() { return ecMethod; } - FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; } - - FORCE_INLINE float get_ec_threshold() { return ecThreshold; } - FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; } - - FORCE_INLINE int get_encoder_ticks_mm() { - switch (type) { - default: return 0; - case I2CPE_ENC_TYPE_LINEAR: - return encoderTicksPerUnit; - case I2CPE_ENC_TYPE_ROTARY: - return (int)((encoderTicksPerUnit / stepperTicks) * planner.settings.axis_steps_per_mm[encoderAxis]); - } - } - - FORCE_INLINE int get_ticks_unit() { return encoderTicksPerUnit; } - FORCE_INLINE void set_ticks_unit(const int ticks) { encoderTicksPerUnit = ticks; } - - FORCE_INLINE uint8_t get_type() { return type; } - FORCE_INLINE void set_type(const byte newType) { type = newType; } - - FORCE_INLINE int get_stepper_ticks() { return stepperTicks; } - FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; } -}; - -class I2CPositionEncodersMgr { - private: - static bool I2CPE_anyaxis; - static uint8_t I2CPE_addr, I2CPE_idx; - - public: - - static void init(); - - // consider only updating one endoder per call / tick if encoders become too time intensive - static void update() { LOOP_PE(i) encoders[i].update(); } - - static void homed(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) encoders[i].set_homed(); - } - - static void unhomed(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) encoders[i].set_unhomed(); - } - - static void report_position(const int8_t idx, const bool units, const bool noOffset); - - static void report_status(const int8_t idx) { - CHECK_IDX(); - SERIAL_ECHOLNPAIR("Encoder ", idx, ": "); - encoders[idx].get_raw_count(); - encoders[idx].passes_test(true); - } - - static void report_error(const int8_t idx) { - CHECK_IDX(); - encoders[idx].get_axis_error_steps(true); - } - - static void test_axis(const int8_t idx) { - CHECK_IDX(); - encoders[idx].test_axis(); - } - - static void calibrate_steps_mm(const int8_t idx, const int iterations) { - CHECK_IDX(); - encoders[idx].calibrate_steps_mm(iterations); - } - - static void change_module_address(const uint8_t oldaddr, const uint8_t newaddr); - static void report_module_firmware(const uint8_t address); - - static void report_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis is ", encoders[idx].get_error_count()); - } - - static void reset_error_count(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_error_count(0); - SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis has been reset."); - } - - static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) { - CHECK_IDX(); - encoders[idx].set_ec_enabled(enabled); - SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - 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) { - CHECK_IDX(); - encoders[idx].set_ec_threshold(newThreshold); - SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis set to ", FIXFLOAT(newThreshold), "mm."); - } - - static void get_ec_threshold(const int8_t idx, const AxisEnum axis) { - CHECK_IDX(); - const float threshold = encoders[idx].get_ec_threshold(); - SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis is ", FIXFLOAT(threshold), "mm."); - } - - static int8_t idx_from_axis(const AxisEnum axis) { - LOOP_PE(i) - if (encoders[i].get_axis() == axis) return i; - return -1; - } - - static int8_t idx_from_addr(const uint8_t addr) { - LOOP_PE(i) - if (encoders[i].get_address() == addr) return i; - return -1; - } - - static int8_t parse(); - - static void M860(); - static void M861(); - static void M862(); - static void M863(); - static void M864(); - static void M865(); - static void M866(); - static void M867(); - static void M868(); - static void M869(); - - static I2CPositionEncoder encoders[I2CPE_ENCODER_CNT]; -}; - -extern I2CPositionEncodersMgr I2CPEM; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.cpp deleted file mode 100644 index 9ba67d6caa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ /dev/null @@ -1,650 +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 . - * - */ - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * send() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(MAX7219_DEBUG) - -#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory - -#include "Max7219_Debug_LEDs.h" - -#include "../module/planner.h" -#include "../module/stepper.h" -#include "../Marlin.h" -#include "../HAL/shared/Delay.h" - -#define HAS_SIDE_BY_SIDE (ENABLED(MAX7219_SIDE_BY_SIDE) && MAX7219_NUMBER_UNITS > 1) - -#if _ROT == 0 || _ROT == 180 - #if HAS_SIDE_BY_SIDE - #define MAX7219_X_LEDS 8 - #define MAX7219_Y_LEDS MAX7219_LINES - #else - #define MAX7219_Y_LEDS 8 - #define MAX7219_X_LEDS MAX7219_LINES - #endif -#elif _ROT == 90 || _ROT == 270 - #if HAS_SIDE_BY_SIDE - #define MAX7219_Y_LEDS 8 - #define MAX7219_X_LEDS MAX7219_LINES - #else - #define MAX7219_X_LEDS 8 - #define MAX7219_Y_LEDS MAX7219_LINES - #endif -#else - #error "MAX7219_ROTATE must be a multiple of +/- 90°." -#endif - -Max7219 max7219; - -uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; - -#define LINE_REG(Q) (max7219_reg_digit0 + ((Q) & 0x7)) - -#if _ROT == 0 || _ROT == 270 - #define _LED_BIT(Q) (7 - ((Q) & 0x7)) -#else - #define _LED_BIT(Q) ((Q) & 0x7) -#endif -#if _ROT == 0 || _ROT == 180 - #define LED_BIT(X,Y) _LED_BIT(X) -#else - #define LED_BIT(X,Y) _LED_BIT(Y) -#endif -#if _ROT == 0 || _ROT == 90 - #define _LED_IND(P,Q) (_LED_TOP(P) + ((Q) & 0x7)) -#else - #define _LED_IND(P,Q) (_LED_TOP(P) + (7 - ((Q) & 0x7))) -#endif - -#if HAS_SIDE_BY_SIDE - #if (_ROT == 0 || _ROT == 90) == DISABLED(MAX7219_REVERSE_ORDER) - #define _LED_TOP(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) - #else - #define _LED_TOP(Q) ((Q) & ~0x7) - #endif - #if _ROT == 0 || _ROT == 180 - #define LED_IND(X,Y) _LED_IND(Y,Y) - #elif _ROT == 90 || _ROT == 270 - #define LED_IND(X,Y) _LED_IND(X,X) - #endif -#else - #if (_ROT == 0 || _ROT == 270) == DISABLED(MAX7219_REVERSE_ORDER) - #define _LED_TOP(Q) ((Q) & ~0x7) - #else - #define _LED_TOP(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) - #endif - #if _ROT == 0 || _ROT == 180 - #define LED_IND(X,Y) _LED_IND(X,Y) - #elif _ROT == 90 || _ROT == 270 - #define LED_IND(X,Y) _LED_IND(Y,X) - #endif -#endif - -#define XOR_7219(X,Y) do{ led_line[LED_IND(X,Y)] ^= _BV(LED_BIT(X,Y)); }while(0) -#define SET_7219(X,Y) do{ led_line[LED_IND(X,Y)] |= _BV(LED_BIT(X,Y)); }while(0) -#define CLR_7219(X,Y) do{ led_line[LED_IND(X,Y)] &= ~_BV(LED_BIT(X,Y)); }while(0) -#define BIT_7219(X,Y) TEST(led_line[LED_IND(X,Y)], LED_BIT(X,Y)) - -#ifdef CPU_32_BIT - #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM - #undef CRITICAL_SECTION_START - #undef CRITICAL_SECTION_END - #define CRITICAL_SECTION_START NOOP - #define CRITICAL_SECTION_END NOOP -#else - #define SIG_DELAY() DELAY_NS(188) // Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR) -#endif - -void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) { - #if ENABLED(MAX7219_ERRORS) - SERIAL_ECHOPGM("??? Max7219::"); - serialprintPGM(func); - SERIAL_CHAR('('); - SERIAL_ECHO(v1); - if (v2 > 0) SERIAL_ECHOPAIR(", ", v2); - SERIAL_CHAR(')'); - SERIAL_EOL(); - #else - UNUSED(func); UNUSED(v1); UNUSED(v2); - #endif -} - -/** - * Flip the lowest n_bytes of the supplied bits: - * flipped(x, 1) flips the low 8 bits of x. - * flipped(x, 2) flips the low 16 bits of x. - * flipped(x, 3) flips the low 24 bits of x. - * flipped(x, 4) flips the low 32 bits of x. - */ -inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { - uint32_t mask = 1, outbits = 0; - for (uint8_t b = 0; b < n_bytes * 8; b++) { - outbits <<= 1; - if (bits & mask) outbits |= 1; - mask <<= 1; - } - return outbits; -} - -void Max7219::noop() { - CRITICAL_SECTION_START; - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, LOW); - for (uint8_t i = 16; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); - SIG_DELAY(); - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); - SIG_DELAY(); - } - CRITICAL_SECTION_END; -} - -void Max7219::putbyte(uint8_t data) { - CRITICAL_SECTION_START; - for (uint8_t i = 8; i--;) { - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); // tick - SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit - SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); // tock - SIG_DELAY(); - data <<= 1; - } - CRITICAL_SECTION_END; -} - -void Max7219::pulse_load() { - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data - SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, HIGH); - SIG_DELAY(); -} - -void Max7219::send(const uint8_t reg, const uint8_t data) { - SIG_DELAY(); - CRITICAL_SECTION_START; - SIG_DELAY(); - putbyte(reg); // specify register - SIG_DELAY(); - putbyte(data); // put data - CRITICAL_SECTION_END; -} - -// Send out a single native row of bits to just one unit -void Max7219::refresh_unit_line(const uint8_t line) { - #if MAX7219_NUMBER_UNITS == 1 - send(LINE_REG(line), led_line[line]); - #else - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - if (u == (line >> 3)) send(LINE_REG(line), led_line[line]); else noop(); - #endif - pulse_load(); -} - -// Send out a single native row of bits to all units -void Max7219::refresh_line(const uint8_t line) { - #if MAX7219_NUMBER_UNITS == 1 - refresh_unit_line(line); - #else - for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) - send(LINE_REG(line), led_line[(u << 3) | (line & 0x7)]); - #endif - pulse_load(); -} - -void Max7219::set(const uint8_t line, const uint8_t bits) { - led_line[line] = bits; - refresh_unit_line(line); -} - -#if ENABLED(MAX7219_NUMERIC) - - // Draw an integer with optional leading zeros and optional decimal point - void Max7219::print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false) { - constexpr uint8_t led_numeral[10] = { 0x7E, 0x60, 0x6D, 0x79, 0x63, 0x5B, 0x5F, 0x70, 0x7F, 0x7A }, - led_decimal = 0x80, led_minus = 0x01; - - bool blank = false, neg = value < 0; - if (neg) value *= -1; - while (size--) { - const bool minus = neg && blank; - if (minus) neg = false; - send( - max7219_reg_digit0 + start + size, - minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) - ); - pulse_load(); // tell the chips to load the clocked out data - value /= 10; - if (!value && !leadzero) blank = true; - dec = false; - } - } - - // Draw a float with a decimal point and optional digits - void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) { - if (pre_size) print(start, value, pre_size, leadzero, !!post_size); - if (post_size) { - const int16_t after = ABS(value) * (10 ^ post_size); - print(start + pre_size, after, post_size, true); - } - } - -#endif // MAX7219_NUMERIC - -// Modify a single LED bit and send the changed line -void Max7219::led_set(const uint8_t x, const uint8_t y, const bool on) { - if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_set"), x, y); - if (BIT_7219(x, y) == on) return; - XOR_7219(x, y); - refresh_unit_line(LED_IND(x, y)); -} - -void Max7219::led_on(const uint8_t x, const uint8_t y) { - if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_on"), x, y); - led_set(x, y, true); -} - -void Max7219::led_off(const uint8_t x, const uint8_t y) { - if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_off"), x, y); - led_set(x, y, false); -} - -void Max7219::led_toggle(const uint8_t x, const uint8_t y) { - if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_toggle"), x, y); - led_set(x, y, !BIT_7219(x, y)); -} - -void Max7219::send_row(const uint8_t row) { - #if _ROT == 0 || _ROT == 180 // Native Lines are horizontal too - #if MAX7219_X_LEDS <= 8 - refresh_unit_line(LED_IND(0, row)); // A single unit line - #else - refresh_line(LED_IND(0, row)); // Same line, all units - #endif - #else // Native lines are vertical - UNUSED(row); - refresh(); // Actually a column - #endif -} - -void Max7219::send_column(const uint8_t col) { - #if _ROT == 90 || _ROT == 270 // Native Lines are vertical too - #if MAX7219_Y_LEDS <= 8 - refresh_unit_line(LED_IND(col, 0)); // A single unit line - #else - refresh_line(LED_IND(col, 0)); // Same line, all units - #endif - #else // Native lines are horizontal - UNUSED(col); - refresh(); // Actually a row - #endif -} - -void Max7219::clear() { - ZERO(led_line); - refresh(); -} - -void Max7219::fill() { - memset(led_line, 0xFF, sizeof(led_line)); - refresh(); -} - -void Max7219::clear_row(const uint8_t row) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("clear_row"), row); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) CLR_7219(x, row); - send_row(row); -} - -void Max7219::clear_column(const uint8_t col) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) CLR_7219(col, y); - send_column(col); -} - -/** - * Plot the low order bits of val to the specified row of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_row(const uint8_t row, const uint32_t val) { - if (row >= MAX7219_Y_LEDS) return error(PSTR("set_row"), row); - uint32_t mask = _BV32(MAX7219_X_LEDS - 1); - for (uint8_t x = 0; x < MAX7219_X_LEDS; x++) { - if (val & mask) SET_7219(x, row); else CLR_7219(x, row); - mask >>= 1; - } - send_row(row); -} - -/** - * Plot the low order bits of val to the specified column of the matrix. - * With 4 Max7219 units in the chain, it's possible to set 32 bits at once with - * one call to the function (if rotated 90° or 180°). - */ -void Max7219::set_column(const uint8_t col, const uint32_t val) { - if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col); - uint32_t mask = _BV32(MAX7219_Y_LEDS - 1); - for (uint8_t y = 0; y < MAX7219_Y_LEDS; y++) { - if (val & mask) SET_7219(col, y); else CLR_7219(col, y); - mask >>= 1; - } - send_column(col); -} - -void Max7219::set_rows_16bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_16bits"), y, val); - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #else // at least 16 bits on each row - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_16bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) { - #if MAX7219_X_LEDS == 8 - if (y > MAX7219_Y_LEDS - 4) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 3, val); val >>= 8; - set_row(y + 2, val); val >>= 8; - set_row(y + 1, val); val >>= 8; - set_row(y + 0, val); - #elif MAX7219_X_LEDS == 16 - if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_32bits"), y, val); - set_row(y + 1, val); val >>= 16; - set_row(y + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_32bits"), y, val); - set_row(y, val); - #endif -} - -void Max7219::set_columns_16bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_columns_16bits"), x, val); - set_column(x + 0, val); val >>= 8; - set_column(x + 1, val); - #else // at least 16 bits in each column - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_columns_16bits"), x, val); - set_column(x, val); - #endif -} - -void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { - #if MAX7219_Y_LEDS == 8 - if (x > MAX7219_X_LEDS - 4) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 3, val); val >>= 8; - set_column(x + 2, val); val >>= 8; - set_column(x + 1, val); val >>= 8; - set_column(x + 0, val); - #elif MAX7219_Y_LEDS == 16 - if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_rows_32bits"), x, val); - set_column(x + 1, val); val >>= 16; - set_column(x + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits - if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_rows_32bits"), x, val); - set_column(x, val); - #endif -} - -// Initialize the Max7219 -void Max7219::register_setup() { - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_scanLimit, 0x07); - pulse_load(); // Tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_decodeMode, 0x00); // Using an led matrix (not digits) - pulse_load(); // Tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_shutdown, 0x01); // Not in shutdown mode - pulse_load(); // Tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_displayTest, 0x00); // No display test - pulse_load(); // Tell the chips to load the clocked out data - - for (uint8_t i = 0; i < MAX7219_NUMBER_UNITS; i++) - send(max7219_reg_intensity, 0x01 & 0x0F); // The first 0x0F is the value you can set - // Range: 0x00 to 0x0F - pulse_load(); // Tell the chips to load the clocked out data -} - -#ifdef MAX7219_INIT_TEST -#if MAX7219_INIT_TEST == 2 - - void Max7219::spiral(const bool on, const uint16_t del) { - constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 }; - int8_t px = 0, py = 0, dir = 0; - for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) { - led_set(px, py, on); - delay(del); - const int8_t x = px + way[dir], y = py + way[dir + 1]; - if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7; - px += way[dir]; py += way[dir + 1]; - } - } - -#else - - void Max7219::sweep(const int8_t dir, const uint16_t ms, const bool on) { - uint8_t x = dir > 0 ? 0 : MAX7219_X_LEDS - 1; - for (uint8_t i = MAX7219_X_LEDS; i--; x += dir) { - set_column(x, on ? 0xFFFFFFFF : 0x00000000); - delay(ms); - } - } - -#endif -#endif // MAX7219_INIT_TEST - -void Max7219::init() { - SET_OUTPUT(MAX7219_DIN_PIN); - SET_OUTPUT(MAX7219_CLK_PIN); - OUT_WRITE(MAX7219_LOAD_PIN, HIGH); - delay(1); - - register_setup(); - - for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off - led_line[i] = 0x00; - send(max7219_reg_digit0 + i, 0); - pulse_load(); // Tell the chips to load the clocked out data - } - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - spiral(true, 8); - delay(150); - spiral(false, 8); - #else - // Do an aesthetically-pleasing pattern to fully test the Max7219 module and LEDs. - // Light up and turn off columns, both forward and backward. - sweep(1, 20, true); - sweep(1, 20, false); - delay(150); - sweep(-1, 20, true); - sweep(-1, 20, false); - #endif - #endif -} - -/** - * This code demonstrates some simple debugging using a single 8x8 LED Matrix. If your feature could - * benefit from matrix display, add its code here. Very little processing is required, so the 7219 is - * ideal for debugging when realtime feedback is important but serial output can't be used. - */ - -// Apply changes to update a marker -void Max7219::mark16(const uint8_t pos, const uint8_t v1, const uint8_t v2) { - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. - led_off(v1 & 0xF, pos); - led_on(v2 & 0xF, pos); - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. - led_off(pos, v1 & 0xF); - led_on(pos, v2 & 0xF); - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. - led_off(v1 & 0x7, pos + (v1 >= 8)); - led_on(v2 & 0x7, pos + (v2 >= 8)); - #endif -} - -// Apply changes to update a tail-to-head range -void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh) { - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0xF, y); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0xF, y); - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(y, n & 0xF); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(y, n & 0xF); - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. - if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) - led_off(n & 0x7, y + (n >= 8)); - if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) - led_on(n & 0x7, y + (n >= 8)); - #endif -} - -// Apply changes to update a quantity -void Max7219::quantity16(const uint8_t pos, const uint8_t ov, const uint8_t nv) { - for (uint8_t i = _MIN(nv, ov); i < _MAX(nv, ov); i++) - led_set( - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. - i, pos - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. - pos, i - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. - i >> 1, pos + (i & 1) - #endif - , nv >= ov - ); -} - -void Max7219::idle_tasks() { - #define MAX7219_USE_HEAD (defined(MAX7219_DEBUG_PLANNER_HEAD) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #define MAX7219_USE_TAIL (defined(MAX7219_DEBUG_PLANNER_TAIL) || defined(MAX7219_DEBUG_PLANNER_QUEUE)) - #if MAX7219_USE_HEAD || MAX7219_USE_TAIL - CRITICAL_SECTION_START; - #if MAX7219_USE_HEAD - const uint8_t head = planner.block_buffer_head; - #endif - #if MAX7219_USE_TAIL - const uint8_t tail = planner.block_buffer_tail; - #endif - CRITICAL_SECTION_END; - #endif - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - static uint8_t refresh_cnt; // = 0 - constexpr uint16_t refresh_limit = 5; - static millis_t next_blink = 0; - const millis_t ms = millis(); - const bool do_blink = ELAPSED(ms, next_blink); - #else - static uint16_t refresh_cnt; // = 0 - constexpr bool do_blink = true; - constexpr uint16_t refresh_limit = 50000; - #endif - - // Some Max7219 units are vulnerable to electrical noise, especially - // with long wires next to high current wires. If the display becomes - // corrupted, this will fix it within a couple seconds. - if (do_blink && ++refresh_cnt >= refresh_limit) { - refresh_cnt = 0; - register_setup(); - } - - #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE) - if (do_blink) { - led_toggle(MAX7219_X_LEDS - 1, MAX7219_Y_LEDS - 1); - next_blink = ms + 1000; - } - #endif - - #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL - - static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; - - if (last_head_cnt != head || last_tail_cnt != tail) { - range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head); - last_head_cnt = head; - last_tail_cnt = tail; - } - - #else - - #ifdef MAX7219_DEBUG_PLANNER_HEAD - static int16_t last_head_cnt = 0x1; - if (last_head_cnt != head) { - mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head); - last_head_cnt = head; - } - #endif - - #ifdef MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_tail_cnt = 0x1; - if (last_tail_cnt != tail) { - mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail); - last_tail_cnt = tail; - } - #endif - - #endif - - #ifdef MAX7219_DEBUG_PLANNER_QUEUE - static int16_t last_depth = 0; - const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF; - if (current_depth != last_depth) { - quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth); - last_depth = current_depth; - } - #endif -} - -#endif // MAX7219_DEBUG diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.h deleted file mode 100644 index 9462fb23d9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/Max7219_Debug_LEDs.h +++ /dev/null @@ -1,147 +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 - -/** - * This module is off by default, but can be enabled to facilitate the display of - * extra debug information during code development. - * - * Just connect up 5V and GND to give it power, then connect up the pins assigned - * in Configuration_adv.h. For example, on the Re-ARM you could use: - * - * #define MAX7219_CLK_PIN 77 - * #define MAX7219_DIN_PIN 78 - * #define MAX7219_LOAD_PIN 79 - * - * max7219.init() is called automatically at startup, and then there are a number of - * support functions available to control the LEDs in the 8x8 grid. - * - * If you are using the Max7219 matrix for firmware debug purposes in time sensitive - * areas of the code, please be aware that the orientation (rotation) of the display can - * affect the speed. The Max7219 can update a single column fairly fast. It is much - * faster to do a Max7219_Set_Column() with a rotation of 90 or 270 degrees than to do - * a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees. - */ - -#ifndef MAX7219_ROTATE - #define MAX7219_ROTATE 0 -#endif -#define _ROT ((MAX7219_ROTATE + 360) % 360) - -#ifndef MAX7219_NUMBER_UNITS - #define MAX7219_NUMBER_UNITS 1 -#endif -#define MAX7219_LINES (8 * (MAX7219_NUMBER_UNITS)) - -// -// MAX7219 registers -// -#define max7219_reg_noop 0x00 -#define max7219_reg_digit0 0x01 -#define max7219_reg_digit1 0x02 -#define max7219_reg_digit2 0x03 -#define max7219_reg_digit3 0x04 -#define max7219_reg_digit4 0x05 -#define max7219_reg_digit5 0x06 -#define max7219_reg_digit6 0x07 -#define max7219_reg_digit7 0x08 - -#define max7219_reg_decodeMode 0x09 -#define max7219_reg_intensity 0x0A -#define max7219_reg_scanLimit 0x0B -#define max7219_reg_shutdown 0x0C -#define max7219_reg_displayTest 0x0F - -class Max7219 { -public: - static uint8_t led_line[MAX7219_LINES]; - - Max7219() {} - - static void init(); - static void register_setup(); - static void putbyte(uint8_t data); - static void pulse_load(); - - // Set a single register (e.g., a whole native row) - static void send(const uint8_t reg, const uint8_t data); - - // Refresh all units - static inline void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } - - // Update a single native line on all units - static void refresh_line(const uint8_t line); - - // Update a single native line on just one unit - static void refresh_unit_line(const uint8_t line); - - // Set a single LED by XY coordinate - static void led_set(const uint8_t x, const uint8_t y, const bool on); - static void led_on(const uint8_t x, const uint8_t y); - static void led_off(const uint8_t x, const uint8_t y); - static void led_toggle(const uint8_t x, const uint8_t y); - - // Set all LEDs in a single column - static void set_column(const uint8_t col, const uint32_t val); - static void clear_column(const uint8_t col); - - // Set all LEDs in a single row - static void set_row(const uint8_t row, const uint32_t val); - static void clear_row(const uint8_t row); - - // 16 and 32 bit versions of Row and Column functions - // Multiple rows and columns will be used to display the value if - // the array of matrix LED's is too narrow to accomplish the goal - static void set_rows_16bits(const uint8_t y, uint32_t val); - static void set_rows_32bits(const uint8_t y, uint32_t val); - static void set_columns_16bits(const uint8_t x, uint32_t val); - static void set_columns_32bits(const uint8_t x, uint32_t val); - - // Quickly clear the whole matrix - static void clear(); - - // Quickly fill the whole matrix - static void fill(); - - // Apply custom code to update the matrix - static void idle_tasks(); - -private: - static void error(const char * const func, const int32_t v1, const int32_t v2=-1); - static void noop(); - static void set(const uint8_t line, const uint8_t bits); - static void send_row(const uint8_t row); - static void send_column(const uint8_t col); - static void mark16(const uint8_t y, const uint8_t v1, const uint8_t v2); - static void range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh); - static void quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv); - - #ifdef MAX7219_INIT_TEST - #if MAX7219_INIT_TEST == 2 - static void spiral(const bool on, const uint16_t del); - #else - static void sweep(const int8_t dir, const uint16_t ms, const bool on); - #endif - #endif -}; - -extern Max7219 max7219; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.cpp deleted file mode 100644 index 1fc2499110..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.cpp +++ /dev/null @@ -1,130 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(BABYSTEPPING) - -#include "babystep.h" -#include "../Marlin.h" -#include "../module/planner.h" -#include "../module/stepper.h" - -#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - #include "../gcode/gcode.h" -#endif - -Babystep babystep; - -volatile int16_t Babystep::steps[BS_TODO_AXIS(Z_AXIS) + 1]; -#if ENABLED(BABYSTEP_DISPLAY_TOTAL) - int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; -#endif -int16_t Babystep::accum; - -void Babystep::step_axis(const AxisEnum axis) { - 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) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++; - } -} - -void Babystep::task() { - #if EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS) - LOOP_XYZ(axis) step_axis((AxisEnum)axis); - #else - step_axis(Z_AXIS); - #endif -} - -void Babystep::add_mm(const AxisEnum axis, const float &mm) { - add_steps(axis, mm * planner.settings.axis_steps_per_mm[axis]); -} - -void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { - - #if ENABLED(BABYSTEP_WITHOUT_HOMING) - #define CAN_BABYSTEP(AXIS) true - #else - extern uint8_t axis_known_position; - #define CAN_BABYSTEP(AXIS) TEST(axis_known_position, AXIS) - #endif - - if (!CAN_BABYSTEP(axis)) return; - - accum += distance; // Count up babysteps for the UI - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - axis_total[BS_TOTAL_AXIS(axis)] += distance; - #endif - - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0) - #else - #define BSA_ENABLE(AXIS) NOOP - #endif - - #if IS_CORE - #if ENABLED(BABYSTEP_XY) - switch (axis) { - case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ - BSA_ENABLE(CORE_AXIS_1); - BSA_ENABLE(CORE_AXIS_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); - 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); - 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); - steps[CORE_AXIS_1] += CORESIGN(distance * 2); - steps[CORE_AXIS_2] -= CORESIGN(distance * 2); - #else - BSA_ENABLE(Z_AXIS); - steps[Z_AXIS] += distance; - #endif - #else - #if ENABLED(BABYSTEP_XY) - BSA_ENABLE(axis); - #else - BSA_ENABLE(Z_AXIS); - #endif - steps[BS_TODO_AXIS(axis)] += distance; - #endif - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - gcode.reset_stepper_timeout(); - #endif -} - -#endif // BABYSTEPPING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.h deleted file mode 100644 index fbf04a03f9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/babystep.h +++ /dev/null @@ -1,63 +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 - -#include "../inc/MarlinConfigPre.h" - -#if IS_CORE || EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS) - #define BS_TODO_AXIS(A) A -#else - #define BS_TODO_AXIS(A) 0 -#endif - -#if ENABLED(BABYSTEP_DISPLAY_TOTAL) - #if ENABLED(BABYSTEP_XY) - #define BS_TOTAL_AXIS(A) A - #else - #define BS_TOTAL_AXIS(A) 0 - #endif -#endif - -class Babystep { -public: - static volatile int16_t steps[BS_TODO_AXIS(Z_AXIS) + 1]; - 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 (true - #if ENABLED(BABYSTEP_XY) - && axis == Z_AXIS - #endif - ) axis_total[BS_TOTAL_AXIS(axis)] = 0; - } - #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(); -private: - static void step_axis(const AxisEnum axis); -}; - -extern Babystep babystep; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.cpp deleted file mode 100644 index 43e6d36bec..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.cpp +++ /dev/null @@ -1,146 +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 . - * - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(BACKLASH_COMPENSATION) - -#include "backlash.h" - -#include "../module/motion.h" -#include "../module/planner.h" - -#ifdef BACKLASH_DISTANCE_MM - #if ENABLED(BACKLASH_GCODE) - xyz_float_t Backlash::distance_mm = BACKLASH_DISTANCE_MM; - #else - const xyz_float_t Backlash::distance_mm = BACKLASH_DISTANCE_MM; - #endif -#endif - -#if ENABLED(BACKLASH_GCODE) - uint8_t Backlash::correction = (BACKLASH_CORRECTION) * 0xFF; - #ifdef BACKLASH_SMOOTHING_MM - float Backlash::smoothing_mm = BACKLASH_SMOOTHING_MM; - #endif -#endif - -#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - xyz_float_t Backlash::measured_mm{0}; - xyz_uint8_t Backlash::measured_count{0}; -#endif - -Backlash backlash; - -/** - * To minimize seams in the printed part, backlash correction only adds - * steps to the current segment (instead of creating a new segment, which - * causes discontinuities and print artifacts). - * - * With a non-zero BACKLASH_SMOOTHING_MM value the backlash correction is - * spread over multiple segments, smoothing out artifacts even more. - */ - -void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block) { - static uint8_t last_direction_bits; - uint8_t changed_dir = last_direction_bits ^ dm; - // Ignore direction change if no steps are taken in that direction - if (da == 0) CBI(changed_dir, X_AXIS); - if (db == 0) CBI(changed_dir, Y_AXIS); - if (dc == 0) CBI(changed_dir, Z_AXIS); - last_direction_bits ^= changed_dir; - - if (correction == 0) return; - - #ifdef BACKLASH_SMOOTHING_MM - // The segment proportion is a value greater than 0.0 indicating how much residual_error - // is corrected for in this segment. The contribution is based on segment length and the - // smoothing distance. Since the computation of this proportion involves a floating point - // division, defer computation until needed. - float segment_proportion = 0; - - // Residual error carried forward across multiple segments, so correction can be applied - // to segments where there is no direction change. - static xyz_long_t residual_error{0}; - #else - // No direction change, no correction. - if (!changed_dir) return; - // No leftover residual error from segment to segment - xyz_long_t residual_error{0}; - #endif - - const float f_corr = float(correction) / 255.0f; - - LOOP_XYZ(axis) { - if (distance_mm[axis]) { - const bool reversing = TEST(dm,axis); - - // When an axis changes direction, add axis backlash to the residual error - if (TEST(changed_dir, axis)) - residual_error[axis] += (reversing ? -f_corr : f_corr) * distance_mm[axis] * planner.settings.axis_steps_per_mm[axis]; - - // Decide how much of the residual error to correct in this segment - int32_t error_correction = residual_error[axis]; - #ifdef BACKLASH_SMOOTHING_MM - if (error_correction && smoothing_mm != 0) { - // Take up a portion of the residual_error in this segment, but only when - // the current segment travels in the same direction as the correction - if (reversing == (error_correction < 0)) { - if (segment_proportion == 0) - segment_proportion = _MIN(1.0f, block->millimeters / smoothing_mm); - error_correction = CEIL(segment_proportion * error_correction); - } - else - error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps - } - #endif - // Making a correction reduces the residual error and modifies delta_mm - if (error_correction) { - block->steps[axis] += ABS(error_correction); - residual_error[axis] -= error_correction; - } - } - } -} - -#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - #if HAS_CUSTOM_PROBE_PIN - #define TEST_PROBE_PIN (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define TEST_PROBE_PIN (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - - // Measure Z backlash by raising nozzle in increments until probe deactivates - void Backlash::measure_with_probe() { - if (measured_count.z == 255) return; - - const float start_height = current_position.z; - while (current_position.z < (start_height + BACKLASH_MEASUREMENT_LIMIT) && TEST_PROBE_PIN) - do_blocking_move_to_z(current_position.z + BACKLASH_MEASUREMENT_RESOLUTION, MMM_TO_MMS(BACKLASH_MEASUREMENT_FEEDRATE)); - - // The backlash from all probe points is averaged, so count the number of measurements - measured_mm.z += current_position.z - start_height; - measured_count.z++; - } -#endif - -#endif // BACKLASH_COMPENSATION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.h deleted file mode 100644 index 0ded86565b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/backlash.h +++ /dev/null @@ -1,87 +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 - -#include "../inc/MarlinConfigPre.h" -#include "../module/planner.h" - -constexpr uint8_t all_on = 0xFF, all_off = 0x00; - -class Backlash { -public: - #if ENABLED(BACKLASH_GCODE) - static xyz_float_t distance_mm; - 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 xyz_float_t distance_mm; - #ifdef BACKLASH_SMOOTHING_MM - static constexpr float smoothing_mm = BACKLASH_SMOOTHING_MM; - #endif - #endif - - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - private: - static xyz_float_t measured_mm; - static xyz_uint8_t measured_count; - public: - static void measure_with_probe(); - #endif - - static inline float get_measurement(const AxisEnum a) { - // Return the measurement averaged over all readings - return ( - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : - #endif - 0 - ); - #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(a); - #endif - } - - static inline bool has_measurement(const AxisEnum a) { - return (false - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - || (measured_count[a] > 0) - #endif - ); - #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(a); - #endif - } - - static inline bool has_any_measurement() { - return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); - } - - void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const uint8_t dm, block_t * const block); -}; - -extern Backlash backlash; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.cpp deleted file mode 100644 index 82e0a5f14f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.cpp +++ /dev/null @@ -1,32 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(BARICUDA) - -#include "baricuda.h" - -uint8_t baricuda_valve_pressure = 0, - baricuda_e_to_p_pressure = 0; - -#endif // BARICUDA diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.h deleted file mode 100644 index 778d2bef0a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/baricuda.h +++ /dev/null @@ -1,25 +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 - -extern uint8_t baricuda_valve_pressure, - baricuda_e_to_p_pressure; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.cpp deleted file mode 100644 index 738a9526f6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.cpp +++ /dev/null @@ -1,420 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - -#include "../bedlevel.h" - -#include "../../../module/motion.h" - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../../core/debug_out.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" -#endif - -xy_pos_t bilinear_grid_spacing, bilinear_start; -xy_float_t bilinear_grid_factor; -bed_mesh_t z_values; - -/** - * Extrapolate a single point from its neighbors - */ -static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPGM("Extrapolate ["); - if (x < 10) DEBUG_CHAR(' '); - DEBUG_ECHO((int)x); - DEBUG_CHAR(xdir ? (xdir > 0 ? '+' : '-') : ' '); - DEBUG_CHAR(' '); - if (y < 10) DEBUG_CHAR(' '); - DEBUG_ECHO((int)y); - DEBUG_CHAR(ydir ? (ydir > 0 ? '+' : '-') : ' '); - DEBUG_ECHOLNPGM("]"); - } - if (!isnan(z_values[x][y])) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(" (done)"); - return; // Don't overwrite good values. - } - - // Get X neighbors, Y neighbors, and XY neighbors - const uint8_t x1 = x + xdir, y1 = y + ydir, x2 = x1 + xdir, y2 = y1 + ydir; - float a1 = z_values[x1][y ], a2 = z_values[x2][y ], - b1 = z_values[x ][y1], b2 = z_values[x ][y2], - c1 = z_values[x1][y1], c2 = z_values[x2][y2]; - - // Treat far unprobed points as zero, near as equal to far - if (isnan(a2)) a2 = 0.0; - if (isnan(a1)) a1 = a2; - if (isnan(b2)) b2 = 0.0; - if (isnan(b1)) b1 = b2; - if (isnan(c2)) c2 = 0.0; - if (isnan(c1)) c1 = c2; - - const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2; - - // Take the average instead of the median - z_values[x][y] = (a + b + c) / 3.0; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - - // Median is robust (ignores outliers). - // z_values[x][y] = (a < b) ? ((b < c) ? b : (c < a) ? a : c) - // : ((c < b) ? b : (a < c) ? a : c); -} - -//Enable this if your SCARA uses 180° of total area -//#define EXTRAPOLATE_FROM_EDGE - -#if ENABLED(EXTRAPOLATE_FROM_EDGE) - #if GRID_MAX_POINTS_X < GRID_MAX_POINTS_Y - #define HALF_IN_X - #elif GRID_MAX_POINTS_Y < GRID_MAX_POINTS_X - #define HALF_IN_Y - #endif -#endif - -/** - * Fill in the unprobed points (corners of circular print surface) - * using linear extrapolation, away from the center. - */ -void extrapolate_unprobed_bed_level() { - #ifdef HALF_IN_X - constexpr uint8_t ctrx2 = 0, xlen = GRID_MAX_POINTS_X - 1; - #else - constexpr uint8_t ctrx1 = (GRID_MAX_POINTS_X - 1) / 2, // left-of-center - ctrx2 = (GRID_MAX_POINTS_X) / 2, // right-of-center - xlen = ctrx1; - #endif - - #ifdef HALF_IN_Y - constexpr uint8_t ctry2 = 0, ylen = GRID_MAX_POINTS_Y - 1; - #else - constexpr uint8_t ctry1 = (GRID_MAX_POINTS_Y - 1) / 2, // top-of-center - ctry2 = (GRID_MAX_POINTS_Y) / 2, // bottom-of-center - ylen = ctry1; - #endif - - for (uint8_t xo = 0; xo <= xlen; xo++) - for (uint8_t yo = 0; yo <= ylen; yo++) { - uint8_t x2 = ctrx2 + xo, y2 = ctry2 + yo; - #ifndef HALF_IN_X - const uint8_t x1 = ctrx1 - xo; - #endif - #ifndef HALF_IN_Y - const uint8_t y1 = ctry1 - yo; - #ifndef HALF_IN_X - extrapolate_one_point(x1, y1, +1, +1); // left-below + + - #endif - extrapolate_one_point(x2, y1, -1, +1); // right-below - + - #endif - #ifndef HALF_IN_X - extrapolate_one_point(x1, y2, +1, -1); // left-above + - - #endif - extrapolate_one_point(x2, y2, -1, -1); // right-above - - - } - -} - -void print_bilinear_leveling_grid() { - SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); -} - -#if ENABLED(ABL_BILINEAR_SUBDIVISION) - - #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) - #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) - float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; - xy_pos_t bilinear_grid_spacing_virt; - xy_float_t bilinear_grid_factor_virt; - - void print_bilinear_leveling_grid_virt() { - SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); - print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values_virt[ix][iy]; } - ); - } - - #define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I)) - float bed_level_virt_coord(const uint8_t x, const uint8_t y) { - uint8_t ep = 0, ip = 1; - if (!x || x == ABL_TEMP_POINTS_X - 1) { - if (x) { - ep = GRID_MAX_POINTS_X - 1; - ip = GRID_MAX_POINTS_X - 2; - } - if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2)) - return LINEAR_EXTRAPOLATION( - z_values[ep][y - 1], - z_values[ip][y - 1] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(ep + 1, y), - bed_level_virt_coord(ip + 1, y) - ); - } - if (!y || y == ABL_TEMP_POINTS_Y - 1) { - if (y) { - ep = GRID_MAX_POINTS_Y - 1; - ip = GRID_MAX_POINTS_Y - 2; - } - if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2)) - return LINEAR_EXTRAPOLATION( - z_values[x - 1][ep], - z_values[x - 1][ip] - ); - else - return LINEAR_EXTRAPOLATION( - bed_level_virt_coord(x, ep + 1), - bed_level_virt_coord(x, ip + 1) - ); - } - return z_values[x - 1][y - 1]; - } - - static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { - return ( - p[i-1] * -t * sq(1 - t) - + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) - + p[i+1] * t * (1 + 4 * t - 3 * sq(t)) - - p[i+2] * sq(t) * (1 - t) - ) * 0.5f; - } - - static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) { - float row[4], column[4]; - for (uint8_t i = 0; i < 4; i++) { - for (uint8_t j = 0; j < 4; j++) { - column[j] = bed_level_virt_coord(i + x - 1, j + y - 1); - } - row[i] = bed_level_virt_cmr(column, 1, ty); - } - return bed_level_virt_cmr(row, 1, tx); - } - - void bed_level_virt_interpolate() { - bilinear_grid_spacing_virt = bilinear_grid_spacing / (BILINEAR_SUBDIVISIONS); - bilinear_grid_factor_virt = bilinear_grid_spacing_virt.reciprocal(); - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) - for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { - if ((ty && y == GRID_MAX_POINTS_Y - 1) || (tx && x == GRID_MAX_POINTS_X - 1)) - continue; - z_values_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = - bed_level_virt_2cmr( - x + 1, - y + 1, - (float)tx / (BILINEAR_SUBDIVISIONS), - (float)ty / (BILINEAR_SUBDIVISIONS) - ); - } - } -#endif // ABL_BILINEAR_SUBDIVISION - -// Refresh after other values have been updated -void refresh_bed_level() { - bilinear_grid_factor = bilinear_grid_spacing.reciprocal(); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif -} - -#if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt.A - #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt.A - #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X - #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y - #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] -#else - #define ABL_BG_SPACING(A) bilinear_grid_spacing.A - #define ABL_BG_FACTOR(A) bilinear_grid_factor.A - #define ABL_BG_POINTS_X GRID_MAX_POINTS_X - #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y - #define ABL_BG_GRID(X,Y) z_values[X][Y] -#endif - -// Get the Z adjustment for non-linear bed leveling -float bilinear_z_offset(const xy_pos_t &raw) { - - static float z1, d2, z3, d4, L, D; - - static xy_pos_t prev { -999.999, -999.999 }, ratio; - - // Whole units for the grid line indices. Constrained within bounds. - static xy_int8_t thisg, nextg, lastg { -99, -99 }; - - // XY relative to the probed area - xy_pos_t rel = raw - bilinear_start.asFloat(); - - #if ENABLED(EXTRAPOLATE_BEYOND_GRID) - #define FAR_EDGE_OR_BOX 2 // Keep using the last grid box - #else - #define FAR_EDGE_OR_BOX 1 // Just use the grid far edge - #endif - - if (prev.x != rel.x) { - prev.x = rel.x; - ratio.x = rel.x * ABL_BG_FACTOR(x); - const float gx = constrain(FLOOR(ratio.x), 0, ABL_BG_POINTS_X - (FAR_EDGE_OR_BOX)); - ratio.x -= gx; // Subtract whole to get the ratio within the grid box - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio.x, 0); // Never <0 (>1 is ok when nextg.x==thisg.x) - #endif - - thisg.x = gx; - nextg.x = _MIN(thisg.x + 1, ABL_BG_POINTS_X - 1); - } - - if (prev.y != rel.y || lastg.x != thisg.x) { - - if (prev.y != rel.y) { - prev.y = rel.y; - ratio.y = rel.y * ABL_BG_FACTOR(y); - const float gy = constrain(FLOOR(ratio.y), 0, ABL_BG_POINTS_Y - (FAR_EDGE_OR_BOX)); - ratio.y -= gy; - - #if DISABLED(EXTRAPOLATE_BEYOND_GRID) - // Beyond the grid maintain height at grid edges - NOLESS(ratio.y, 0); // Never < 0.0. (> 1.0 is ok when nextg.y==thisg.y.) - #endif - - thisg.y = gy; - nextg.y = _MIN(thisg.y + 1, ABL_BG_POINTS_Y - 1); - } - - if (lastg != thisg) { - lastg = thisg; - // Z at the box corners - z1 = ABL_BG_GRID(thisg.x, thisg.y); // left-front - d2 = ABL_BG_GRID(thisg.x, nextg.y) - z1; // left-back (delta) - z3 = ABL_BG_GRID(nextg.x, thisg.y); // right-front - d4 = ABL_BG_GRID(nextg.x, nextg.y) - z3; // right-back (delta) - } - - // Bilinear interpolate. Needed since rel.y or thisg.x has changed. - L = z1 + d2 * ratio.y; // Linear interp. LF -> LB - const float R = z3 + d4 * ratio.y; // Linear interp. RF -> RB - - D = R - L; - } - - const float offset = L + ratio.x * D; // the offset almost always changes - - /* - static float last_offset = 0; - if (ABS(last_offset - offset) > 0.2) { - SERIAL_ECHOLNPAIR("Sudden Shift at x=", rel.x, " / ", bilinear_grid_spacing.x, " -> thisg.x=", thisg.x); - SERIAL_ECHOLNPAIR(" y=", rel.y, " / ", bilinear_grid_spacing.y, " -> thisg.y=", thisg.y); - SERIAL_ECHOLNPAIR(" ratio.x=", ratio.x, " ratio.y=", ratio.y); - SERIAL_ECHOLNPAIR(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4); - SERIAL_ECHOLNPAIR(" L=", L, " R=", R, " offset=", offset); - } - last_offset = offset; - //*/ - - return offset; -} - -#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - - #define CELL_INDEX(A,V) ((V - bilinear_start.A) * ABL_BG_FACTOR(A)) - - /** - * Prepare a bilinear-leveled linear move on Cartesian, - * splitting the move where it crosses grid borders. - */ - 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 - xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) }, - c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) }; - LIMIT(c1.x, 0, ABL_BG_POINTS_X - 2); - LIMIT(c1.y, 0, ABL_BG_POINTS_Y - 2); - LIMIT(c2.x, 0, ABL_BG_POINTS_X - 2); - LIMIT(c2.y, 0, ABL_BG_POINTS_Y - 2); - - // Start and end in the same cell? No split needed. - if (c1 == c2) { - current_position = destination; - line_to_current_position(scaled_fr_mm_s); - return; - } - - #define LINE_SEGMENT_END(A) (current_position.A + (destination.A - current_position.A) * normalized_dist) - - float normalized_dist; - xyze_pos_t end; - const xy_int8_t gc { _MAX(c1.x, c2.x), _MAX(c1.y, c2.y) }; - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (c2.x != c1.x && TEST(x_splits, gc.x)) { - // Split on the X grid line - CBI(x_splits, gc.x); - end = destination; - destination.x = bilinear_start.x + ABL_BG_SPACING(x) * gc.x; - normalized_dist = (destination.x - current_position.x) / (end.x - current_position.x); - destination.y = LINE_SEGMENT_END(y); - } - // Crosses on the Y and not already split on this Y? - else if (c2.y != c1.y && TEST(y_splits, gc.y)) { - // Split on the Y grid line - CBI(y_splits, gc.y); - end = destination; - destination.y = bilinear_start.y + ABL_BG_SPACING(y) * gc.y; - normalized_dist = (destination.y - current_position.y) / (end.y - current_position.y); - destination.x = LINE_SEGMENT_END(x); - } - else { - // Must already have been split on these border(s) - // This should be a rare case. - current_position = destination; - line_to_current_position(scaled_fr_mm_s); - return; - } - - destination.z = LINE_SEGMENT_END(z); - destination.e = LINE_SEGMENT_END(e); - - // Do the split and look for more borders - bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); - - // Restore destination from stack - destination = end; - bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); - } - -#endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES - -#endif // AUTO_BED_LEVELING_BILINEAR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.h deleted file mode 100644 index 15e988fe0a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/abl/abl.h +++ /dev/null @@ -1,45 +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 - -#include "../../../inc/MarlinConfigPre.h" - -extern xy_pos_t bilinear_grid_spacing, bilinear_start; -extern xy_float_t bilinear_grid_factor; -extern bed_mesh_t z_values; -float bilinear_z_offset(const xy_pos_t &raw); - -void extrapolate_unprobed_bed_level(); -void print_bilinear_leveling_grid(); -void refresh_bed_level(); -#if ENABLED(ABL_BILINEAR_SUBDIVISION) - void print_bilinear_leveling_grid_virt(); - void bed_level_virt_interpolate(); -#endif - -#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - 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) float(bilinear_start.x + (I) * bilinear_grid_spacing.x) -#define _GET_MESH_Y(J) float(bilinear_start.y + (J) * bilinear_grid_spacing.y) -#define Z_VALUES_ARR z_values diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.cpp deleted file mode 100644 index ef8cfd3455..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.cpp +++ /dev/null @@ -1,253 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_LEVELING - -#include "bedlevel.h" -#include "../../module/planner.h" - -#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY) - #include "../../module/motion.h" -#endif - -#if ENABLED(PROBE_MANUALLY) - bool g29_in_progress = false; -#endif - -#if ENABLED(LCD_BED_LEVELING) - #include "../../lcd/ultralcd.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../core/debug_out.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -bool leveling_is_valid() { - return - #if ENABLED(MESH_BED_LEVELING) - mbl.has_mesh() - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - !!bilinear_grid_spacing.x - #elif ENABLED(AUTO_BED_LEVELING_UBL) - ubl.mesh_is_valid() - #else // 3POINT, LINEAR - true - #endif - ; -} - -/** - * Turn bed leveling on or off, fixing the current - * position as-needed. - * - * Disable: Current position = physical position - * Enable: Current position = "unleveled" physical position - */ -void set_bed_leveling_enabled(const bool enable/*=true*/) { - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const bool can_change = (!enable || leveling_is_valid()); - #else - constexpr bool can_change = true; - #endif - - if (can_change && enable != planner.leveling_active) { - - planner.synchronize(); - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Force bilinear_z_offset to re-calculate next time - const xyz_pos_t reset { -9999.999, -9999.999, 0 }; - (void)bilinear_z_offset(reset); - #endif - - if (planner.leveling_active) { // leveling from on to off - // change unleveled current_position to physical current_position without moving steppers. - planner.apply_leveling(current_position); - planner.leveling_active = false; // disable only AFTER calling apply_leveling - } - else { // leveling from off to on - planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored - // change physical current_position to unleveled current_position without moving steppers. - planner.unapply_leveling(current_position); - } - - sync_plan_position(); - } -} - -TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved(planner.leveling_active) { - set_bed_leveling_enabled(enable); -} - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { - - if (planner.z_fade_height == zfh) return; - - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - - planner.set_z_fade_height(zfh); - - if (leveling_was_active) { - const xyz_pos_t oldpos = current_position; - set_bed_leveling_enabled(true); - if (do_report && oldpos != current_position) - report_current_position(); - } - } - -#endif // ENABLE_LEVELING_FADE_HEIGHT - -/** - * Reset calibration results to zero. - */ -void reset_bed_level() { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("reset_bed_level"); - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.reset(); - #else - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start.reset(); - bilinear_grid_spacing.reset(); - 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 -} - -#if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING) - - /** - * Enable to produce output in JSON format suitable - * for SCAD or JavaScript mesh visualizers. - * - * Visualize meshes in OpenSCAD using the included script. - * - * buildroot/shared/scripts/MarlinMesh.scad - */ - //#define SCAD_MESH_OUTPUT - - /** - * Print calibration results for plotting or manual frame adjustment. - */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, element_2d_fn fn) { - #ifndef SCAD_MESH_OUTPUT - for (uint8_t x = 0; x < sx; x++) { - serial_spaces(precision + (x < 10 ? 3 : 2)); - SERIAL_ECHO(int(x)); - } - SERIAL_EOL(); - #endif - #ifdef SCAD_MESH_OUTPUT - SERIAL_ECHOLNPGM("measured_z = ["); // open 2D array - #endif - for (uint8_t y = 0; y < sy; y++) { - #ifdef SCAD_MESH_OUTPUT - SERIAL_ECHOPGM(" ["); // open sub-array - #else - if (y < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(y)); - #endif - for (uint8_t x = 0; x < sx; x++) { - SERIAL_CHAR(' '); - const float offset = fn(x, y); - if (!isnan(offset)) { - if (offset >= 0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(offset, int(precision)); - } - else { - #ifdef SCAD_MESH_OUTPUT - for (uint8_t i = 3; i < precision + 3; i++) - SERIAL_CHAR(' '); - SERIAL_ECHOPGM("NAN"); - #else - for (uint8_t i = 0; i < precision + 3; i++) - SERIAL_CHAR(i ? '=' : ' '); - #endif - } - #ifdef SCAD_MESH_OUTPUT - if (x < sx - 1) SERIAL_CHAR(','); - #endif - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_CHAR(' '); - SERIAL_CHAR(']'); // close sub-array - if (y < sy - 1) SERIAL_CHAR(','); - #endif - SERIAL_EOL(); - } - #ifdef SCAD_MESH_OUTPUT - SERIAL_ECHOPGM("];"); // close 2D array - #endif - SERIAL_EOL(); - } - -#endif // AUTO_BED_LEVELING_BILINEAR || MESH_BED_LEVELING - -#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY) - - void _manual_goto_xy(const xy_pos_t &pos) { - - #ifdef MANUAL_PROBE_START_Z - constexpr float startz = _MAX(0, MANUAL_PROBE_START_Z); - #if MANUAL_PROBE_HEIGHT > 0 - do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(startz); - #else - do_blocking_move_to_xy_z(pos, startz); - #endif - #elif MANUAL_PROBE_HEIGHT > 0 - const float prev_z = current_position.z; - do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT); - do_blocking_move_to_z(prev_z); - #else - do_blocking_move_to_xy(pos); - #endif - - current_position = pos; - - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; - #endif - } - -#endif - -#endif // HAS_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.h deleted file mode 100644 index 6ba0948880..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/bedlevel.h +++ /dev/null @@ -1,98 +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 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; -#else - constexpr bool g29_in_progress = false; -#endif - -bool leveling_is_valid(); -void set_bed_leveling_enabled(const bool enable=true); -void reset_bed_level(); - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - void set_z_fade_height(const float zfh, const bool do_report=true); -#endif - -#if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY) - void _manual_goto_xy(const xy_pos_t &pos); -#endif - -/** - * A class to save and change the bed leveling state, - * then restore it when it goes out of scope. - */ -class TemporaryBedLevelingState { - bool saved; - public: - TemporaryBedLevelingState(const bool enable); - ~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); } -}; -#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]; - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #include "abl/abl.h" - #elif ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl/ubl.h" - #elif ENABLED(MESH_BED_LEVELING) - #include "mbl/mesh_bed_leveling.h" - #endif - - #define Z_VALUES(X,Y) Z_VALUES_ARR[X][Y] - #define _GET_MESH_POS(M) { _GET_MESH_X(M.a), _GET_MESH_Y(M.b) } - - #if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING) - - #include - - typedef float (*element_2d_fn)(const uint8_t, const uint8_t); - - /** - * Print calibration results for plotting or manual frame adjustment. - */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, element_2d_fn fn); - - #endif - - struct mesh_index_pair { - xy_int8_t pos; - float distance; // When populated, the distance from the search location - void invalidate() { pos = -1; } - bool valid() const { return pos.x >= 0 && pos.y >= 0; } - #if ENABLED(AUTO_BED_LEVELING_UBL) - xy_pos_t meshpos() { - return { ubl.mesh_index_to_xpos(pos.x), ubl.mesh_index_to_ypos(pos.y) }; - } - #endif - operator xy_int8_t&() { return pos; } - operator const xy_int8_t&() const { return pos; } - }; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp deleted file mode 100644 index af9c671d6a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ /dev/null @@ -1,135 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(MESH_BED_LEVELING) - - #include "../bedlevel.h" - - #include "../../../module/motion.h" - - #if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" - #endif - - mesh_bed_leveling mbl; - - float mesh_bed_leveling::z_offset, - mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X], - mesh_bed_leveling::index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling::mesh_bed_leveling() { - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; ++i) - index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; ++i) - index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST); - reset(); - } - - void mesh_bed_leveling::reset() { - z_offset = 0; - ZERO(z_values); - #if ENABLED(EXTENSIBLE_UI) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - ExtUI::onMeshUpdate(x, y, 0); - #endif - } - - #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - - /** - * 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 feedRate_t &scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { - // Get current and destination cells for this line - xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); - NOMORE(scel.x, GRID_MAX_POINTS_X - 2); - NOMORE(scel.y, GRID_MAX_POINTS_Y - 2); - NOMORE(ecel.x, GRID_MAX_POINTS_X - 2); - NOMORE(ecel.y, GRID_MAX_POINTS_Y - 2); - - // Start and end in the same cell? No split needed. - if (scel == ecel) { - line_to_destination(scaled_fr_mm_s); - current_position = destination; - return; - } - - #define MBL_SEGMENT_END(A) (current_position.A + (destination.A - current_position.A) * normalized_dist) - - float normalized_dist; - xyze_pos_t dest; - const int8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); - - // Crosses on the X and not already split on this X? - // The x_splits flags are insurance against rounding errors. - if (ecel.x != scel.x && TEST(x_splits, gcx)) { - // Split on the X grid line - CBI(x_splits, gcx); - dest = destination; - destination.x = index_to_xpos[gcx]; - normalized_dist = (destination.x - current_position.x) / (dest.x - current_position.x); - destination.y = MBL_SEGMENT_END(y); - } - // Crosses on the Y and not already split on this Y? - else if (ecel.y != scel.y && TEST(y_splits, gcy)) { - // Split on the Y grid line - CBI(y_splits, gcy); - dest = destination; - destination.y = index_to_ypos[gcy]; - normalized_dist = (destination.y - current_position.y) / (dest.y - current_position.y); - destination.x = MBL_SEGMENT_END(x); - } - else { - // Must already have been split on these border(s) - // This should be a rare case. - line_to_destination(scaled_fr_mm_s); - current_position = destination; - return; - } - - destination.z = MBL_SEGMENT_END(z); - destination.e = MBL_SEGMENT_END(e); - - // Do the split and look for more borders - line_to_destination(scaled_fr_mm_s, x_splits, y_splits); - - // Restore destination from stack - destination = dest; - line_to_destination(scaled_fr_mm_s, x_splits, y_splits); - } - - #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES - - void mesh_bed_leveling::report_mesh() { - SERIAL_ECHOPAIR_F(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ", z_offset, 5); - SERIAL_ECHOLNPGM("\nMeasured points:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); - } - -#endif // MESH_BED_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h deleted file mode 100644 index 3009f4aea4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ /dev/null @@ -1,129 +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 - -#include "../../../inc/MarlinConfig.h" - -enum MeshLevelingState : char { - MeshReport, // G29 S0 - MeshStart, // G29 S1 - MeshNext, // G29 S2 - MeshSet, // G29 S3 - MeshSetZOffset, // G29 S4 - MeshReset // G29 S5 -}; - -#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 - -class mesh_bed_leveling { -public: - static float z_offset, - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - index_to_xpos[GRID_MAX_POINTS_X], - index_to_ypos[GRID_MAX_POINTS_Y]; - - mesh_bed_leveling(); - - static void report_mesh(); - - static void reset(); - - FORCE_INLINE static bool has_mesh() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (z_values[x][y]) return true; - return false; - } - - static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { - px = index % (GRID_MAX_POINTS_X); - py = index / (GRID_MAX_POINTS_X); - if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag - } - - static void set_zigzag_z(const int8_t index, const float &z) { - int8_t px, py; - zigzag(index, px, py); - set_z(px, py, z); - } - - static int8_t cell_index_x(const float &x) { - 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)) * RECIPROCAL(MESH_Y_DIST); - return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); - } - static inline xy_int8_t cell_indexes(const float &x, const float &y) { - return { cell_index_x(x), cell_index_y(y) }; - } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } - - static int8_t probe_index_x(const float &x) { - 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)) * RECIPROCAL(MESH_Y_DIST); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; - } - static inline xy_int8_t probe_indexes(const float &x, const float &y) { - return { probe_index_x(x), probe_index_y(y) }; - } - static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } - - static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - const float delta_z = (z2 - z1) / (a2 - a1), - delta_a = a0 - a1; - return z1 + delta_a * delta_z; - } - - static float get_z(const xy_pos_t &pos - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , const float &factor=1.0f - #endif - ) { - #if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) - constexpr float factor = 1.0f; - #endif - const xy_int8_t ind = cell_indexes(pos); - const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1], - y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1], - z1 = calc_z0(pos.x, x1, z_values[ind.x][ind.y ], x2, z_values[ind.x+1][ind.y ]), - z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]); - - return z_offset + calc_z0(pos.y, y1, z1, y2, z2) * factor; - } - - #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF); - #endif -}; - -extern mesh_bed_leveling mbl; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.cpp deleted file mode 100644 index 66eff703c3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ /dev/null @@ -1,248 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "../bedlevel.h" - - unified_bed_leveling ubl; - - #include "../../../module/configuration_store.h" - #include "../../../module/planner.h" - #include "../../../module/motion.h" - #include "../../../module/probe.h" - - #if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" - #endif - - #include "math.h" - - void unified_bed_leveling::echo_name() { - SERIAL_ECHOPGM("Unified Bed Leveling"); - } - - void unified_bed_leveling::report_current_mesh() { - if (!leveling_is_valid()) return; - SERIAL_ECHO_MSG(" G29 I99"); - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" M421 I", int(x), " J", int(y)); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4); - serial_delay(75); // Prevent Printrun from exploding - } - } - - void unified_bed_leveling::report_state() { - echo_name(); - SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n"); - serial_delay(50); - } - - int8_t unified_bed_leveling::storage_slot; - - float unified_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - - #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; - #endif - - volatile int unified_bed_leveling::encoder_diff; - - unified_bed_leveling::unified_bed_leveling() { - reset(); - } - - void unified_bed_leveling::reset() { - const bool was_enabled = planner.leveling_active; - set_bed_leveling_enabled(false); - storage_slot = -1; - ZERO(z_values); - #if ENABLED(EXTENSIBLE_UI) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - ExtUI::onMeshUpdate(x, y, 0); - #endif - if (was_enabled) report_current_position(); - } - - void unified_bed_leveling::invalidate() { - set_bed_leveling_enabled(false); - set_all_mesh_points_to_value(NAN); - } - - void unified_bed_leveling::set_all_mesh_points_to_value(const float value) { - 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] = value; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, value); - #endif - } - } - } - - static void serial_echo_xy(const uint8_t sp, const int16_t x, const int16_t y) { - SERIAL_ECHO_SP(sp); - SERIAL_CHAR('('); - if (x < 100) { SERIAL_CHAR(' '); if (x < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(x); - SERIAL_CHAR(','); - if (y < 100) { SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(y); - SERIAL_CHAR(')'); - serial_delay(5); - } - - static void serial_echo_column_labels(const uint8_t sp) { - SERIAL_ECHO_SP(7); - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - if (i < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(i); - SERIAL_ECHO_SP(sp); - } - serial_delay(10); - } - - /** - * Produce one of these mesh maps: - * 0: Human-readable - * 1: CSV format for spreadsheet import - * 2: TODO: Display on Graphical LCD - * 4: Compact Human-Readable - */ - void unified_bed_leveling::display_map(const int map_type) { - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = true; - #endif - - constexpr uint8_t eachsp = 1 + 6 + 1, // [-3.567] - twixt = eachsp * (GRID_MAX_POINTS_X) - 9 * 2; // Leading 4sp, Coordinates 9sp each - - const bool human = !(map_type & 0x3), csv = map_type == 1, lcd = map_type == 2, comp = map_type & 0x4; - - SERIAL_ECHOPGM("\nBed Topography Report"); - if (human) { - SERIAL_ECHOLNPGM(":\n"); - serial_echo_xy(4, MESH_MIN_X, MESH_MAX_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MAX_Y); - SERIAL_EOL(); - serial_echo_column_labels(eachsp - 2); - } - else { - SERIAL_ECHOPGM(" for "); - serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); - } - - // 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 xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + xy_pos_t(probe_offset)); - - if (!lcd) SERIAL_EOL(); - for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { - - // Row Label (J index) - if (human) { - if (j < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(j); - SERIAL_ECHOPGM(" |"); - } - - // Row Values (I indexes) - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - - // Opening Brace or Space - const bool is_current = i == curr.x && j == curr.y; - if (human) SERIAL_CHAR(is_current ? '[' : ' '); - - // Z Value at current I, J - const float f = z_values[i][j]; - if (lcd) { - // TODO: Display on Graphical LCD - } - else if (isnan(f)) - serialprintPGM(human ? PSTR(" . ") : PSTR("NAN")); - else if (human || csv) { - if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Space for positive ('-' for negative) - SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits - } - if (csv && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR('\t'); - - // Closing Brace or Space - if (human) SERIAL_CHAR(is_current ? ']' : ' '); - - SERIAL_FLUSHTX(); - idle(); - } - if (!lcd) SERIAL_EOL(); - - // A blank line between rows (unless compact) - if (j && human && !comp) SERIAL_ECHOLNPGM(" |"); - } - - if (human) { - serial_echo_column_labels(eachsp - 2); - SERIAL_EOL(); - serial_echo_xy(4, MESH_MIN_X, MESH_MIN_Y); - serial_echo_xy(twixt, MESH_MAX_X, MESH_MIN_Y); - SERIAL_EOL(); - SERIAL_EOL(); - } - - #if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE) - suspend_auto_report = false; - #endif - } - - bool unified_bed_leveling::sanity_check() { - uint8_t error_flag = 0; - - if (settings.calc_num_meshes() < 1) { - SERIAL_ECHOLNPGM("?Mesh too big for EEPROM."); - error_flag++; - } - - return !!error_flag; - } - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.h deleted file mode 100644 index 2202bb6524..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl.h +++ /dev/null @@ -1,316 +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 - -//#define UBL_DEVEL_DEBUGGING - -#include "../../../module/motion.h" - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../../core/debug_out.h" - -#define UBL_VERSION "1.01" -#define UBL_OK false -#define UBL_ERR true - -enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; - -// External references - -struct mesh_index_pair; - -#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)) - -class unified_bed_leveling { - private: - - static int g29_verbose_level, - g29_phase_value, - g29_repetition_cnt, - g29_storage_slot, - g29_map_type; - static bool g29_c_flag; - static float g29_card_thickness, - g29_constant; - static xy_pos_t g29_pos; - static xy_bool_t xy_seen; - - #if HAS_BED_PROBE - static int g29_grid_size; - #endif - - #if ENABLED(NEWPANEL) - static void move_z_with_encoder(const float &multiplier); - static float measure_point_with_encoder(); - static float measure_business_card_thickness(float in_height); - static void manually_probe_remaining_mesh(const xy_pos_t&, const float&, const float&, const bool) _O0; - static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0; - #endif - - static bool g29_parameter_parsing() _O0; - static void shift_mesh_height(); - static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) _O0; - static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); - static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); - static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { - return smart_fill_one(pos.x, pos.y, dir.x, dir.y); - } - static void smart_fill_mesh(); - - #if ENABLED(UBL_DEVEL_DEBUGGING) - static void g29_what_command(); - static void g29_eeprom_dump(); - static void g29_compare_current_mesh_to_stored_mesh(); - #endif - - public: - - static void echo_name(); - static void report_current_mesh(); - static void report_state(); - static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); - static void display_map(const int) _O0; - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) _O0; - static mesh_index_pair find_furthest_invalid_mesh_point() _O0; - static void reset(); - static void invalidate(); - static void set_all_mesh_points_to_value(const float value); - static void adjust_mesh_to_mean(const bool cflag, const float value); - static bool sanity_check(); - - static void G29() _O0; // O0 for no optimization - static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560 - - static int8_t storage_slot; - - 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; - #endif - - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. - - 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 cell_index_x(const float &x) { - 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 cell_index_y(const float &y) { - 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 - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. - - static inline xy_int8_t cell_indexes(const float &x, const float &y) { - return { cell_index_x(x), cell_index_y(y) }; - } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } - - static int8_t closest_x_index(const float &x) { - 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 closest_y_index(const float &y) { - 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; - } - static inline xy_int8_t closest_indexes(const xy_pos_t &xy) { - return { closest_x_index(xy.x), closest_y_index(xy.y) }; - } - - /** - * z2 --| - * z0 | | - * | | + (z2-z1) - * z1 | | | - * ---+-------------+--------+-- --| - * a1 a0 a2 - * |<---delta_a---------->| - * - * calc_z0 is the basis for all the Mesh Based correction. It is used to - * find the expected Z Height at a position between two known Z-Height locations. - * - * It is fairly expensive with its 4 floating point additions and 2 floating point - * multiplications. - */ - FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); - } - - /** - * z_correction_for_x_on_horizontal_mesh_line is an optimization for - * the case where the printer is making a vertical line that only crosses horizontal mesh lines. - */ - static inline float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { - - if (DEBUGGING(LEVELING)) { - if (WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1)) DEBUG_ECHOPGM("yi"); else DEBUG_ECHOPGM("x1_i"); - DEBUG_ECHOLNPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(rx0=", rx0, ",x1_i=", x1_i, ",yi=", yi, ")"); - } - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - 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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - // - // See comments above for z_correction_for_x_on_horizontal_mesh_line - // - static inline float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { - - if (DEBUGGING(LEVELING)) { - if (WITHIN(xi, 0, GRID_MAX_POINTS_X - 1)) DEBUG_ECHOPGM("y1_i"); else DEBUG_ECHOPGM("xi"); - DEBUG_ECHOLNPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ry0=", ry0, ", xi=", xi, ", y1_i=", y1_i, ")"); - } - - // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); - } - - 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 - // If it is, it is clamped to the last element of the - // z_values[][] array and no correction is applied. - } - - /** - * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first - * does a linear interpolation along both of the bounding X-Mesh-Lines to find the - * Z-Height at both ends. Then it does a linear interpolation of these heights based - * on the Y position within the cell. - */ - static float get_z_correction(const float &rx0, const float &ry0) { - const int8_t cx = cell_index_x(rx0), cy = cell_index_y(ry0); // return values are clamped - - /** - * Check if the requested location is off the mesh. If so, and - * UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned. - */ - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - if (!WITHIN(rx0, MESH_MIN_X, MESH_MAX_X) || !WITHIN(ry0, MESH_MIN_Y, MESH_MAX_Y)) - return UBL_Z_RAISE_WHEN_OFF_MESH; - #endif - - const float z1 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][cy], - mesh_index_to_xpos(cx + 1), z_values[_MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]); - - const float z2 = calc_z0(rx0, - mesh_index_to_xpos(cx), z_values[cx][_MIN(cy, GRID_MAX_POINTS_Y - 2) + 1], - mesh_index_to_xpos(cx + 1), z_values[_MIN(cx, GRID_MAX_POINTS_X - 2) + 1][_MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]); - - float z0 = calc_z0(ry0, - mesh_index_to_ypos(cy), z1, - mesh_index_to_ypos(cy + 1), z2); - - if (DEBUGGING(MESH_ADJUST)) { - DEBUG_ECHOPAIR(" raw get_z_correction(", rx0); - DEBUG_CHAR(','); DEBUG_ECHO(ry0); - DEBUG_ECHOPAIR_F(") = ", z0, 6); - DEBUG_ECHOLNPAIR_F(" >>>---> ", z0, 6); - } - - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. - - if (DEBUGGING(MESH_ADJUST)) { - DEBUG_ECHOPAIR("??? Yikes! NAN in get_z_correction(", rx0); - DEBUG_CHAR(','); - DEBUG_ECHO(ry0); - DEBUG_CHAR(')'); - DEBUG_EOL(); - } - } - return z0; - } - static inline float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } - - static inline float mesh_index_to_xpos(const uint8_t i) { - return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); - } - static inline float mesh_index_to_ypos(const uint8_t i) { - return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); - } - - #if UBL_SEGMENTED - static bool line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s); - #else - static void line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t e); - #endif - - static inline bool mesh_is_valid() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) return false; - return true; - } - -}; // class unified_bed_leveling - -extern unified_bed_leveling ubl; - -#define _GET_MESH_X(I) ubl.mesh_index_to_xpos(I) -#define _GET_MESH_Y(J) ubl.mesh_index_to_ypos(J) -#define Z_VALUES_ARR ubl.z_values - -// Prevent debugging propagating to other files -#include "../../../core/debug_out.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp deleted file mode 100644 index 8b2e046e45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ /dev/null @@ -1,1847 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - #include "../bedlevel.h" - - #include "../../../Marlin.h" - #include "../../../HAL/shared/persistent_store_api.h" - #include "../../../libs/hex_print_routines.h" - #include "../../../module/configuration_store.h" - #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 "../../../libs/least_squares_fit.h" - - #if ENABLED(DUAL_X_CARRIAGE) - #include "../../../module/tool_change.h" - #endif - - #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) - #include "../../../core/debug_out.h" - - #if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" - #endif - - #include - - #define UBL_G29_P31 - - #if HAS_LCD_MENU - void _lcd_ubl_output_map_lcd(); - #endif - - #define SIZE_OF_LITTLE_RAISE 1 - #define BIG_RAISE_NOT_NEEDED 0 - - int unified_bed_leveling::g29_verbose_level, - unified_bed_leveling::g29_phase_value, - unified_bed_leveling::g29_repetition_cnt, - unified_bed_leveling::g29_storage_slot = 0, - unified_bed_leveling::g29_map_type; - bool unified_bed_leveling::g29_c_flag; - float unified_bed_leveling::g29_card_thickness = 0, - unified_bed_leveling::g29_constant = 0; - xy_bool_t unified_bed_leveling::xy_seen; - xy_pos_t unified_bed_leveling::g29_pos; - - #if HAS_BED_PROBE - int unified_bed_leveling::g29_grid_size; - #endif - - /** - * G29: Unified Bed Leveling by Roxy - * - * Parameters understood by this leveling system: - * - * A Activate Activate the Unified Bed Leveling system. - * - * B # Business Use the 'Business Card' mode of the Manual Probe subsystem with P2. - * Note: A non-compressible Spark Gap feeler gauge is recommended over a business card. - * In this mode of G29 P2, a business or index card is used as a shim that the nozzle can - * grab onto as it is lowered. In principle, the nozzle-bed distance is the same when the - * same resistance is felt in the shim. You can omit the numerical value on first invocation - * of G29 P2 B to measure shim thickness. Subsequent use of 'B' will apply the previously- - * measured thickness by default. - * - * C Continue G29 P1 C continues the generation of a partially-constructed Mesh without invalidating - * previous measurements. - * - * C G29 P2 C tells the Manual Probe subsystem to not use the current nozzle - * location in its search for the closest unmeasured Mesh Point. Instead, attempt to - * start at one end of the uprobed points and Continue sequentially. - * - * G29 P3 C specifies the Constant for the fill. Otherwise, uses a "reasonable" value. - * - * C Current G29 Z C uses the Current location (instead of bed center or nearest edge). - * - * D Disable Disable the Unified Bed Leveling system. - * - * E Stow_probe Stow the probe after each sampled point. - * - * F # Fade Fade the amount of Mesh Based Compensation over a specified height. At the - * specified height, no correction is applied and natural printer kenimatics take over. If no - * number is specified for the command, 10mm is assumed to be reasonable. - * - * H # Height With P2, 'H' specifies the Height to raise the nozzle after each manual probe of the bed. - * If omitted, the nozzle will raise by Z_CLEARANCE_BETWEEN_PROBES. - * - * H # Offset With P4, 'H' specifies the Offset above the mesh height to place the nozzle. - * If omitted, Z_CLEARANCE_BETWEEN_PROBES will be used. - * - * I # Invalidate Invalidate the specified number of Mesh Points near the given 'X' 'Y'. If X or Y are omitted, - * the nozzle location is used. If no 'I' value is given, only the point nearest to the location - * is invalidated. Use 'T' to produce a map afterward. This command is useful to invalidate a - * portion of the Mesh so it can be adjusted using other UBL tools. When attempting to invalidate - * an isolated bad mesh point, the 'T' option shows the nozzle position in the Mesh with (#). You - * can move the nozzle around and use this feature to select the center of the area (or cell) to - * invalidate. - * - * J # Grid Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side. - * Not specifying a grid size will invoke the 3-Point leveling function. - * - * L Load Load Mesh from the previously activated location in the EEPROM. - * - * L # Load Load Mesh from the specified location in the EEPROM. Set this location as activated - * for subsequent Load and Store operations. - * - * The P or Phase commands are used for the bulk of the work to setup a Mesh. In general, your Mesh will - * start off being initialized with a G29 P0 or a G29 P1. Further refinement of the Mesh happens with - * each additional Phase that processes it. - * - * P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System. This reverts the - * 3D Printer to the same state it was in before the Unified Bed Leveling Compensation - * was turned on. Setting the entire Mesh to Zero is a special case that allows - * a subsequent G or T leveling operation for backward compatibility. - * - * P1 Phase 1 Invalidate entire Mesh and continue with automatic generation of the Mesh data using - * the Z-Probe. Usually the probe can't reach all areas that the nozzle can reach. For delta - * printers only the areas where the probe and nozzle can both reach will be automatically probed. - * - * Unreachable points will be handled in Phase 2 and Phase 3. - * - * Use 'C' to leave the previous mesh intact and automatically probe needed points. This allows you - * to invalidate parts of the Mesh but still use Automatic Probing. - * - * The 'X' and 'Y' parameters prioritize where to try and measure points. If omitted, the current - * probe position is used. - * - * Use 'T' (Topology) to generate a report of mesh generation. - * - * P1 will suspend Mesh generation if the controller button is held down. Note that you may need - * to press and hold the switch for several seconds if moves are underway. - * - * P2 Phase 2 Probe unreachable points. - * - * Use 'H' to set the height between Mesh points. If omitted, Z_CLEARANCE_BETWEEN_PROBES is used. - * Smaller values will be quicker. Move the nozzle down till it barely touches the bed. Make sure the - * nozzle is clean and unobstructed. Use caution and move slowly. This can damage your printer! - * (Uses SIZE_OF_LITTLE_RAISE mm if the nozzle is moving less than BIG_RAISE_NOT_NEEDED mm.) - * - * The 'H' value can be negative if the Mesh dips in a large area. Press and hold the - * controller button to terminate the current Phase 2 command. You can then re-issue "G29 P 2" - * with an 'H' parameter more suitable for the area you're manually probing. Note that the command - * tries to start in a corner of the bed where movement will be predictable. Override the distance - * calculation location with the X and Y parameters. You can print a Mesh Map (G29 T) to see where - * the mesh is invalidated and where the nozzle needs to move to complete the command. Use 'C' to - * indicate that the search should be based on the current position. - * - * The 'B' parameter for this command is described above. It places the manual probe subsystem into - * Business Card mode where the thickness of a business card is measured and then used to accurately - * set the nozzle height in all manual probing for the duration of the command. A Business card can - * be used, but you'll get better results with a flexible Shim that doesn't compress. This makes it - * easier to produce similar amounts of force and get more accurate measurements. Google if you're - * not sure how to use a shim. - * - * The 'T' (Map) parameter helps track Mesh building progress. - * - * NOTE: P2 requires an LCD controller! - * - * P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths to - * go down: - * - * - If a 'C' constant is specified, the closest invalid mesh points to the nozzle will be filled, - * and a repeat count can then also be specified with 'R'. - * - * - Leaving out 'C' invokes Smart Fill, which scans the mesh from the edges inward looking for - * invalid mesh points. Adjacent points are used to determine the bed slope. If the bed is sloped - * upward from the invalid point, it takes the value of the nearest point. If sloped downward, it's - * replaced by a value that puts all three points in a line. This version of G29 P3 is a quick, easy - * and (usually) safe way to populate unprobed mesh regions before continuing to G26 Mesh Validation - * Pattern. Note that this populates the mesh with unverified values. Pay attention and use caution. - * - * P4 Phase 4 Fine tune the Mesh. The Delta Mesh Compensation System assumes the existence of - * an LCD Panel. It is possible to fine tune the mesh without an LCD Panel using - * G42 and M421. See the UBL documentation for further details. - * - * Phase 4 is meant to be used with G26 Mesh Validation to fine tune the mesh by direct editing - * of Mesh Points. Raise and lower points to fine tune the mesh until it gives consistently reliable - * adhesion. - * - * P4 moves to the closest Mesh Point (and/or the given X Y), raises the nozzle above the mesh height - * by the given 'H' offset (or default 0), and waits while the controller is used to adjust the nozzle - * height. On click the displayed height is saved in the mesh. - * - * Start Phase 4 at a specific location with X and Y. Adjust a specific number of Mesh Points with - * the 'R' (Repeat) parameter. (If 'R' is left out, the whole matrix is assumed.) This command can be - * terminated early (e.g., after editing the area of interest) by pressing and holding the encoder button. - * - * The general form is G29 P4 [R points] [X position] [Y position] - * - * The H [offset] parameter is useful if a shim is used to fine-tune the mesh. For a 0.4mm shim the - * command would be G29 P4 H0.4. The nozzle is moved to the shim height, you adjust height to the shim, - * and on click the height minus the shim thickness will be saved in the mesh. - * - * !!Use with caution, as a very poor mesh could cause the nozzle to crash into the bed!! - * - * NOTE: P4 is not available unless you have LCD support enabled! - * - * P5 Phase 5 Find Mean Mesh Height and Standard Deviation. Typically, it is easier to use and - * work with the Mesh if it is Mean Adjusted. You can specify a C parameter to - * Correct the Mesh to a 0.00 Mean Height. Adding a C parameter will automatically - * execute a G29 P6 C . - * - * P6 Phase 6 Shift Mesh height. The entire Mesh's height is adjusted by the height specified - * with the C parameter. Being able to adjust the height of a Mesh is useful tool. It - * can be used to compensate for poorly calibrated Z-Probes and other errors. Ideally, - * you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring - * 0.000 at the Z Home location. - * - * Q Test Load specified Test Pattern to assist in checking correct operation of system. This - * command is not anticipated to be of much value to the typical user. It is intended - * for developers to help them verify correct operation of the Unified Bed Leveling System. - * - * R # Repeat Repeat this command the specified number of times. If no number is specified the - * command will be repeated GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y times. - * - * S Store Store the current Mesh in the Activated area of the EEPROM. It will also store the - * current state of the Unified Bed Leveling system in the EEPROM. - * - * S # Store Store the current Mesh at the specified location in EEPROM. Activate this location - * for subsequent Load and Store operations. Valid storage slot numbers begin at 0 and - * extend to a limit related to the available EEPROM storage. - * - * S -1 Store Print the current Mesh as G-code that can be used to restore the mesh anytime. - * - * T Topology Display the Mesh Map Topology. - * 'T' can be used alone (e.g., G29 T) or in combination with most of the other commands. - * This option works with all Phase commands (e.g., G29 P4 R 5 T X 50 Y100 C -.1 O) - * This parameter can also specify a Map Type. T0 (the default) is user-readable. T1 - * is suitable to paste into a spreadsheet for a 3D graph of the mesh. - * - * U Unlevel Perform a probe of the outer perimeter to assist in physically leveling unlevel beds. - * Only used for G29 P1 T U. This speeds up the probing of the edge of the bed. Useful - * when the entire bed doesn't need to be probed because it will be adjusted. - * - * V # Verbosity Set the verbosity level (0-4) for extra details. (Default 0) - * - * X # X Location for this command - * - * Y # Y Location for this command - * - * With UBL_DEVEL_DEBUGGING: - * - * K # Kompare Kompare current Mesh with stored Mesh #, replacing current Mesh with the result. - * This command literally performs a diff between two Meshes. - * - * Q-1 Dump EEPROM Dump the UBL contents stored in EEPROM as HEX format. Useful for developers to help - * verify correct operation of the UBL. - * - * W What? Display valuable UBL data. - * - * - * Release Notes: - * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all - * kinds of problems. Enabling EEPROM Storage is required. - * - * When you do a G28 and G29 P1 to automatically build your first mesh, you are going to notice that - * UBL probes points increasingly further from the starting location. (The starting location defaults - * to the center of the bed.) In contrast, ABL and MBL follow a zigzag pattern. The spiral pattern is - * 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 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 - * the mesh just right. To prevent this valuable data from being destroyed as the EEPROM structure - * evolves, UBL stores all mesh data at the end of EEPROM. - * - * UBL is founded on Edward Patel's Mesh Bed Leveling code. A big 'Thanks!' to him and the creators of - * 3-Point and Grid Based leveling. Combining their contributions we now have the functionality and - * features of all three systems combined. - */ - - void unified_bed_leveling::G29() { - - bool probe_deployed = false; - if (g29_parameter_parsing()) return; // Abort on parameter error - - const int8_t p_val = parser.intval('P', -1); - const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'); - - // Check for commands that require the printer to be homed - if (may_move) { - planner.synchronize(); - if (axes_need_homing()) gcode.home_all_axes(); - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder != 0) tool_change(0); - #endif - } - - // Invalidate Mesh Points. This command is a little bit asymmetrical because - // it directly specifies the repetition count and does not use the 'R' parameter. - if (parser.seen('I')) { - uint8_t cnt = 0; - g29_repetition_cnt = parser.has_value() ? parser.value_int() : 1; - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(NAN); - } - else { - while (g29_repetition_cnt--) { - if (cnt > 20) { cnt = 0; idle(); } - const mesh_index_pair closest = find_closest_mesh_point_of_type(REAL, g29_pos); - const xy_int8_t &cpos = closest.pos; - if (cpos.x < 0) { - // No more REAL mesh points to invalidate, so we ASSUME the user - // meant to invalidate the ENTIRE mesh, which cannot be done with - // find_closest_mesh_point loop which only returns REAL points. - set_all_mesh_points_to_value(NAN); - SERIAL_ECHOLNPGM("Entire Mesh invalidated.\n"); - break; // No more invalid Mesh Points to populate - } - z_values[cpos.x][cpos.y] = NAN; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(cpos, 0.0f); - #endif - cnt++; - } - } - SERIAL_ECHOLNPGM("Locations invalidated.\n"); - } - - if (parser.seen('Q')) { - const int test_pattern = parser.has_value() ? parser.value_int() : -99; - if (!WITHIN(test_pattern, -1, 2)) { - SERIAL_ECHOLNPGM("Invalid test_pattern value. (-1 to 2)\n"); - return; - } - SERIAL_ECHOLNPGM("Loading test_pattern values.\n"); - switch (test_pattern) { - - #if ENABLED(UBL_DEVEL_DEBUGGING) - case -1: - g29_eeprom_dump(); - break; - #endif - - case 0: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. - const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x, - p2 = 0.5f * (GRID_MAX_POINTS_Y) - y; - z_values[x][y] += 2.0f * HYPOT(p1, p2); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - } - } - break; - - case 1: - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised - z_values[x][x] += 9.999f; - z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, x, z_values[x][x]); - ExtUI::onMeshUpdate(x, (x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1), z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1]); - #endif - - } - break; - - case 2: - // Allow the user to specify the height because 10mm is a little extreme in some cases. - for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in - for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) { // the center of the bed - z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - } - break; - } - } - - #if HAS_BED_PROBE - - if (parser.seen('J')) { - if (g29_grid_size) { // if not 0 it is a normal n x n grid being probed - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(false /* false says to do normal grid probing */ ); - restore_ubl_active_state_and_leave(); - } - else { // grid_size == 0 : A 3-Point leveling has been requested - save_ubl_active_state_and_disable(); - tilt_mesh_based_on_probed_grid(true /* true says to do 3-Point leveling */ ); - restore_ubl_active_state_and_leave(); - } - do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y))); - report_current_position(); - probe_deployed = true; - } - - #endif // HAS_BED_PROBE - - if (parser.seen('P')) { - if (WITHIN(g29_phase_value, 0, 1) && storage_slot == -1) { - storage_slot = 0; - SERIAL_ECHOLNPGM("Default storage slot 0 selected."); - } - - switch (g29_phase_value) { - case 0: - // - // Zero Mesh Data - // - reset(); - SERIAL_ECHOLNPGM("Mesh zeroed."); - break; - - #if HAS_BED_PROBE - - case 1: { - // - // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe - // - if (!parser.seen('C')) { - invalidate(); - SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh."); - } - if (g29_verbose_level > 1) { - SERIAL_ECHOPAIR("Probing around (", g29_pos.x); - SERIAL_CHAR(','); - SERIAL_ECHO(g29_pos.y); - SERIAL_ECHOLNPGM(").\n"); - } - const xy_pos_t near = g29_pos + probe_offset; - probe_entire_mesh(near, parser.seen('T'), parser.seen('E'), parser.seen('U')); - - report_current_position(); - probe_deployed = true; - } break; - - #endif // HAS_BED_PROBE - - case 2: { - #if HAS_LCD_MENU - // - // Manually Probe Mesh in areas that can't be reached by the probe - // - SERIAL_ECHOLNPGM("Manually probing unreachable mesh locations."); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - - if (parser.seen('C') && !xy_seen) { - /** - * Use a good default location for the path. - * The flipped > and < operators in these comparisons is intentional. - * It should cause the probed points to follow a nice path on Cartesian printers. - * It may make sense to have Delta printers default to the center of the bed. - * Until that is decided, this can be forced with the X and Y parameters. - */ - g29_pos.set( - #if IS_KINEMATIC - X_HOME_POS, Y_HOME_POS - #else - probe_offset.x > 0 ? X_BED_SIZE : 0, - probe_offset.y < 0 ? Y_BED_SIZE : 0 - #endif - ); - } - - if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); - if (ABS(g29_card_thickness) > 1.5f) { - SERIAL_ECHOLNPGM("?Error in Business Card measurement."); - return; - } - probe_deployed = true; - } - - if (!position_is_reachable(g29_pos)) { - SERIAL_ECHOLNPGM("XY outside printable radius."); - return; - } - - const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES); - manually_probe_remaining_mesh(g29_pos, height, g29_card_thickness, parser.seen('T')); - - SERIAL_ECHOLNPGM("G29 P2 finished."); - - report_current_position(); - - #else - - SERIAL_ECHOLNPGM("?P2 is only available when an LCD is present."); - return; - - #endif - } break; - - case 3: { - /** - * Populate invalid mesh areas. Proceed with caution. - * Two choices are available: - * - Specify a constant with the 'C' parameter. - * - Allow 'G29 P3' to choose a 'reasonable' constant. - */ - - if (g29_c_flag) { - if (g29_repetition_cnt >= GRID_MAX_POINTS) { - set_all_mesh_points_to_value(g29_constant); - } - else { - while (g29_repetition_cnt--) { // this only populates reachable mesh points near - const mesh_index_pair closest = find_closest_mesh_point_of_type(INVALID, g29_pos); - const xy_int8_t &cpos = closest.pos; - if (cpos.x < 0) { - // No more REAL INVALID mesh points to populate, so we ASSUME - // user meant to populate ALL INVALID mesh points to value - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (isnan(z_values[x][y])) z_values[x][y] = g29_constant; - break; // No more invalid Mesh Points to populate - } - else { - z_values[cpos.x][cpos.y] = g29_constant; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(cpos, g29_constant); - #endif - } - } - } - } - else { - const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 - #if ENABLED(UBL_G29_P31) - case 1: { - - // P3.1 use least squares fit to fill missing mesh values - // P3.10 zero weighting for distance, all grid points equal, best fit tilted plane - // P3.11 10X weighting for nearest grid points versus farthest grid points - // P3.12 100X distance weighting - // P3.13 1000X distance weighting, approaches simple average of nearest points - - const float weight_power = (cvf - 3.10f) * 100.0f, // 3.12345 -> 2.345 - weight_factor = weight_power ? POW(10.0f, weight_power) : 0; - smart_fill_wlsf(weight_factor); - } - break; - #endif - case 0: // P3 or P3.0 - default: // and anything P3.x that's not P3.1 - smart_fill_mesh(); // Do a 'Smart' fill using nearby known values - break; - } - } - break; - } - - case 4: // Fine Tune (i.e., Edit) the Mesh - #if HAS_LCD_MENU - fine_tune_mesh(g29_pos, parser.seen('T')); - #else - SERIAL_ECHOLNPGM("?P4 is only available when an LCD is present."); - return; - #endif - break; - - case 5: adjust_mesh_to_mean(g29_c_flag, g29_constant); break; - - case 6: shift_mesh_height(); break; - } - } - - #if ENABLED(UBL_DEVEL_DEBUGGING) - - // - // Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - // good to have the extra information. Soon... we prune this to just a few items - // - if (parser.seen('W')) g29_what_command(); - - // - // When we are fully debugged, this may go away. But there are some valid - // use cases for the users. So we can wait and see what to do with it. - // - - if (parser.seen('K')) // Kompare Current Mesh Data to Specified Stored Mesh - g29_compare_current_mesh_to_stored_mesh(); - - #endif // UBL_DEVEL_DEBUGGING - - - // - // Load a Mesh from the EEPROM - // - - if (parser.seen('L')) { // Load Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_ECHOLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_ECHOLNPGM("Done."); - } - - // - // Store a Mesh in the EEPROM - // - - if (parser.seen('S')) { // Store (or Save) Current Mesh Data - g29_storage_slot = parser.has_value() ? parser.value_int() : storage_slot; - - if (g29_storage_slot == -1) // Special case, the user wants to 'Export' the mesh to the - return report_current_mesh(); // host program to be saved on the user's computer - - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_ECHOLNPGM("?EEPROM storage not available."); - goto LEAVE; - } - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1); - goto LEAVE; - } - - settings.store_mesh(g29_storage_slot); - storage_slot = g29_storage_slot; - - SERIAL_ECHOLNPGM("Done."); - } - - if (parser.seen('T')) - display_map(g29_map_type); - - LEAVE: - - #if HAS_LCD_MENU - ui.reset_alert_level(); - ui.quick_feedback(); - ui.reset_status(); - ui.release(); - #endif - - #ifdef Z_PROBE_END_SCRIPT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); - if (probe_deployed) { - planner.synchronize(); - gcode.process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT)); - } - #else - UNUSED(probe_deployed); - #endif - - return; - } - - void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float value) { - float sum = 0; - int n = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - sum += z_values[x][y]; - n++; - } - - const float mean = sum / n; - - // - // Sum the squares of difference from mean - // - float sum_of_diff_squared = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) - sum_of_diff_squared += sq(z_values[x][y] - mean); - - SERIAL_ECHOLNPAIR("# of samples: ", n); - SERIAL_ECHOLNPAIR_F("Mean Mesh Height: ", mean, 6); - - const float sigma = SQRT(sum_of_diff_squared / (n + 1)); - SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6); - - if (cflag) - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - z_values[x][y] -= mean + value; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - } - } - - void unified_bed_leveling::shift_mesh_height() { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - if (!isnan(z_values[x][y])) { - z_values[x][y] += g29_constant; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - } - } - - #if HAS_BED_PROBE - /** - * Probe all invalidated locations of the mesh that can be reached by the probe. - * This attempts to fill in locations closest to the nozzle's start location first. - */ - void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { - DEPLOY_PROBE(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW - - #if HAS_LCD_MENU - ui.capture(); - #endif - - save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained - uint8_t count = GRID_MAX_POINTS; - - mesh_index_pair best; - do { - if (do_ubl_mesh_map) display_map(g29_map_type); - - 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(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)); - #endif - - #if HAS_LCD_MENU - if (ui.button_pressed()) { - ui.quick_feedback(false); // Preserve button state for click-and-hold - SERIAL_ECHOLNPGM("\nMesh only partially populated.\n"); - ui.wait_for_release(); - ui.quick_feedback(); - ui.release(); - STOW_PROBE(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW - return restore_ubl_active_state_and_leave(); - } - #endif - - best = do_furthest - ? find_furthest_invalid_mesh_point() - : find_closest_mesh_point_of_type(INVALID, near, true); - - if (best.pos.x >= 0) { // mesh point found and is reachable by probe - const float measured_z = probe_at_point( - best.meshpos(), - stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level - ); - z_values[best.pos.x][best.pos.y] = measured_z; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(best.pos, measured_z); - #endif - } - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - - } while (best.pos.x >= 0 && --count); - - #if HAS_LCD_MENU - ui.release(); - #endif - STOW_PROBE(); // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW - #if HAS_LCD_MENU - ui.capture(); - #endif - - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - restore_ubl_active_state_and_leave(); - - do_blocking_move_to_xy( - constrain(near.x - probe_offset.x, MESH_MIN_X, MESH_MAX_X), - constrain(near.y - probe_offset.y, MESH_MIN_Y, MESH_MAX_Y) - ); - } - - #endif // HAS_BED_PROBE - - #if HAS_LCD_MENU - - typedef void (*clickFunc_t)(); - - bool click_and_hold(const clickFunc_t func=nullptr) { - if (ui.button_pressed()) { - ui.quick_feedback(false); // Preserve button state for click-and-hold - const millis_t nxt = millis() + 1500UL; - while (ui.button_pressed()) { // Loop while the encoder is pressed. Uses hardware flag! - idle(); // idle, of course - if (ELAPSED(millis(), nxt)) { // After 1.5 seconds - ui.quick_feedback(); - if (func) (*func)(); - ui.wait_for_release(); - return true; - } - } - } - serial_delay(15); - return false; - } - - void unified_bed_leveling::move_z_with_encoder(const float &multiplier) { - ui.wait_for_release(); - while (!ui.button_pressed()) { - idle(); - gcode.reset_stepper_timeout(); // Keep steppers powered - if (encoder_diff) { - do_blocking_move_to_z(current_position.z + float(encoder_diff) * multiplier); - encoder_diff = 0; - } - } - } - - float unified_bed_leveling::measure_point_with_encoder() { - KEEPALIVE_STATE(PAUSED_FOR_USER); - move_z_with_encoder(0.01f); - return current_position.z; - } - - static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); } - - float unified_bed_leveling::measure_business_card_thickness(float in_height) { - #if HAS_LCD_MENU - ui.capture(); - #endif - save_ubl_active_state_and_disable(); // Disable bed level correction for probing - - do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); - //, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f); - planner.synchronize(); - - SERIAL_ECHOPGM("Place shim under nozzle"); - LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); - ui.return_to_status(); - echo_and_take_a_measurement(); - - const float z1 = measure_point_with_encoder(); - do_blocking_move_to_z(current_position.z + SIZE_OF_LITTLE_RAISE); - planner.synchronize(); - - SERIAL_ECHOPGM("Remove shim"); - LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE); - echo_and_take_a_measurement(); - - const float z2 = measure_point_with_encoder(); - - do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES); - - const float thickness = ABS(z1 - z2); - - if (g29_verbose_level > 1) { - SERIAL_ECHOPAIR_F("Business Card is ", thickness, 4); - SERIAL_ECHOLNPGM("mm thick."); - } - - ui.release(); - - restore_ubl_active_state_and_leave(); - - return thickness; - } - - void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { - #if HAS_LCD_MENU - ui.capture(); - #endif - - save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained - do_blocking_move_to_xy_z(current_position, z_clearance); - - ui.return_to_status(); - - mesh_index_pair location; - xy_int8_t &lpos = location.pos; - do { - location = find_closest_mesh_point_of_type(INVALID, pos); - // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. - if (!location.valid()) continue; - - const xyz_pos_t ppos = { - mesh_index_to_xpos(lpos.x), - mesh_index_to_ypos(lpos.y), - Z_CLEARANCE_BETWEEN_PROBES - }; - - if (!position_is_reachable(ppos)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) - - LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT); - - do_blocking_move_to(ppos); - do_blocking_move_to_z(z_clearance); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - #if HAS_LCD_MENU - ui.capture(); - #endif - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - serialprintPGM(parser.seen('B') ? GET_TEXT(MSG_UBL_BC_INSERT) : GET_TEXT(MSG_UBL_BC_INSERT2)); - - const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step - //const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click - - move_z_with_encoder(z_step); - - if (click_and_hold()) { - SERIAL_ECHOLNPGM("\nMesh only partially populated."); - do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - ui.release(); - return restore_ubl_active_state_and_leave(); - } - - z_values[lpos.x][lpos.y] = current_position.z - thick; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location, z_values[lpos.x][lpos.y]); - #endif - - if (g29_verbose_level > 2) - SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[lpos.x][lpos.y], 6); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.valid()); - - if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - - restore_ubl_active_state_and_leave(); - do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); - } - - inline void set_message_with_feedback(PGM_P const msg_P) { - ui.set_status_P(msg_P); - ui.quick_feedback(); - } - - void abort_fine_tune() { - ui.return_to_status(); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED)); - } - - void unified_bed_leveling::fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) { - if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified - g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; - if (!WITHIN(h_offset, 0, 10)) { - SERIAL_ECHOLNPGM("Offset out of bounds. (0 to 10mm)\n"); - return; - } - #endif - - mesh_index_pair location; - - if (!position_is_reachable(pos)) { - SERIAL_ECHOLNPGM("(X,Y) outside printable radius."); - return; - } - - save_ubl_active_state_and_disable(); - - LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - #if HAS_LCD_MENU - ui.capture(); // Take over control of the LCD encoder - #endif - do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif - - MeshFlags done_flags{0}; - xy_int8_t &lpos = location.pos; - do { - location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags); - - if (lpos.x < 0) break; // Stop when there are no more reachable points - - done_flags.mark(lpos); // Mark this location as 'adjusted' so a new - // location is used on the next loop - const xyz_pos_t raw = { - mesh_index_to_xpos(lpos.x), - mesh_index_to_ypos(lpos.y), - Z_CLEARANCE_BETWEEN_PROBES - }; - - if (!position_is_reachable(raw)) break; // SHOULD NOT OCCUR (find_closest_mesh_point_of_type only returns reachable) - - do_blocking_move_to(raw); // Move the nozzle to the edit point with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point - - ui.refresh(); - - float new_z = z_values[lpos.x][lpos.y]; - if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place - - lcd_mesh_edit_setup(new_z); - - do { - new_z = lcd_mesh_edit(); - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited - #endif - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (!ui.button_pressed()); - - if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status - - if (click_and_hold(abort_fine_tune)) break; // Button held down? Abort editing - - z_values[lpos.x][lpos.y] = new_z; // Save the updated Z value - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location, new_z); - #endif - - serial_delay(20); // No switch noise - ui.refresh(); - - } while (lpos.x >= 0 && --g29_repetition_cnt > 0); - - ui.release(); - - if (do_ubl_mesh_map) display_map(g29_map_type); - restore_ubl_active_state_and_leave(); - - do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); - - LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); - SERIAL_ECHOLNPGM("Done Editing Mesh"); - - if (lcd_map_control) - ui.goto_screen(_lcd_ubl_output_map_lcd); - else - ui.return_to_status(); - } - - #endif // HAS_LCD_MENU - - bool unified_bed_leveling::g29_parameter_parsing() { - bool err_flag = false; - - #if HAS_LCD_MENU - set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29)); - #endif - - g29_constant = 0; - g29_repetition_cnt = 0; - - if (parser.seen('R')) { - g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS; - NOMORE(g29_repetition_cnt, GRID_MAX_POINTS); - if (g29_repetition_cnt < 1) { - SERIAL_ECHOLNPGM("?(R)epetition count invalid (1+).\n"); - return UBL_ERR; - } - } - - g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; - if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4).\n"); - err_flag = true; - } - - if (parser.seen('P')) { - const int pv = parser.value_int(); - #if !HAS_BED_PROBE - if (pv == 1) { - SERIAL_ECHOLNPGM("G29 P1 requires a probe.\n"); - err_flag = true; - } - else - #endif - { - g29_phase_value = pv; - if (!WITHIN(g29_phase_value, 0, 6)) { - SERIAL_ECHOLNPGM("?(P)hase value invalid (0-6).\n"); - err_flag = true; - } - } - } - - if (parser.seen('J')) { - #if HAS_BED_PROBE - g29_grid_size = parser.has_value() ? parser.value_int() : 0; - if (g29_grid_size && !WITHIN(g29_grid_size, 2, 9)) { - SERIAL_ECHOLNPGM("?Invalid grid size (J) specified (2-9).\n"); - err_flag = true; - } - #else - SERIAL_ECHOLNPGM("G29 J action requires a probe.\n"); - err_flag = true; - #endif - } - - xy_seen.x = parser.seenval('X'); - float sx = xy_seen.x ? parser.value_float() : current_position.x; - xy_seen.y = parser.seenval('Y'); - float sy = xy_seen.y ? parser.value_float() : current_position.y; - - if (xy_seen.x != xy_seen.y) { - SERIAL_ECHOLNPGM("Both X & Y locations must be specified.\n"); - err_flag = true; - } - - // If X or Y are not valid, use center of the bed values - if (!WITHIN(sx, X_MIN_BED, X_MAX_BED)) sx = X_CENTER; - if (!WITHIN(sy, Y_MIN_BED, Y_MAX_BED)) sy = Y_CENTER; - - if (err_flag) return UBL_ERR; - - g29_pos.set(sx, sy); - - /** - * Activate or deactivate UBL - * Note: UBL's G29 restores the state set here when done. - * Leveling is being enabled here with old data, possibly - * none. Error handling should disable for safety... - */ - if (parser.seen('A')) { - if (parser.seen('D')) { - SERIAL_ECHOLNPGM("?Can't activate and deactivate at the same time.\n"); - return UBL_ERR; - } - set_bed_leveling_enabled(true); - report_state(); - } - else if (parser.seen('D')) { - set_bed_leveling_enabled(false); - report_state(); - } - - // Set global 'C' flag and its value - if ((g29_c_flag = parser.seen('C'))) - g29_constant = parser.value_float(); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seenval('F')) { - const float fh = parser.value_float(); - if (!WITHIN(fh, 0, 100)) { - SERIAL_ECHOLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); - return UBL_ERR; - } - set_z_fade_height(fh); - } - #endif - - g29_map_type = parser.intval('T'); - if (!WITHIN(g29_map_type, 0, 2)) { - SERIAL_ECHOLNPGM("Invalid map type.\n"); - return UBL_ERR; - } - return UBL_OK; - } - - static uint8_t ubl_state_at_invocation = 0; - - #if ENABLED(UBL_DEVEL_DEBUGGING) - static uint8_t ubl_state_recursion_chk = 0; - #endif - - void unified_bed_leveling::save_ubl_active_state_and_disable() { - #if ENABLED(UBL_DEVEL_DEBUGGING) - ubl_state_recursion_chk++; - if (ubl_state_recursion_chk != 1) { - SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); - #if HAS_LCD_MENU - set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR)); - #endif - return; - } - #endif - ubl_state_at_invocation = planner.leveling_active; - set_bed_leveling_enabled(false); - } - - void unified_bed_leveling::restore_ubl_active_state_and_leave() { - #if ENABLED(UBL_DEVEL_DEBUGGING) - if (--ubl_state_recursion_chk) { - SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); - #if HAS_LCD_MENU - set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR)); - #endif - return; - } - #endif - set_bed_leveling_enabled(ubl_state_at_invocation); - } - - mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { - - bool found_a_NAN = false, found_a_real = false; - - mesh_index_pair farthest { -1, -1, -99999.99 }; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if (isnan(z_values[i][j])) { // Invalid mesh point? - - // Skip points the probe can't reach - if (!position_is_reachable_by_probe(mesh_index_to_xpos(i), mesh_index_to_ypos(j))) - continue; - - found_a_NAN = true; - - xy_int8_t near { -1, -1 }; - float d1, d2 = 99999.9f; - for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { - for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { - if (!isnan(z_values[k][l])) { - found_a_real = true; - - // Add in a random weighting factor that scrambles the probing of the - // last half of the mesh (when every unprobed mesh point is one index - // from a probed location). - - d1 = HYPOT(i - k, j - l) + (1.0f / ((millis() % 47) + 13)); - - if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l) - d2 = d1; - near.set(i, j); - } - } - } - } - - // - // At this point d2 should have the near defined mesh point to invalid mesh point (i,j) - // - - if (found_a_real && near.x >= 0 && d2 > farthest.distance) { - farthest.pos = near; // Found an invalid location farther from the defined mesh point - farthest.distance = d2; - } - } - } // for j - } // for i - - if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing - farthest.pos.set(GRID_MAX_POINTS_X / 2, GRID_MAX_POINTS_Y / 2); - farthest.distance = 1; - } - return farthest; - } - - mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const xy_pos_t &pos, const bool probe_relative/*=false*/, MeshFlags *done_flags/*=nullptr*/) { - mesh_index_pair closest; - closest.invalidate(); - closest.distance = -99999.9f; - - // Get the reference position, either nozzle or probe - const xy_pos_t ref = probe_relative ? pos + probe_offset : pos; - - float best_so_far = 99999.99f; - - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if ( (type == (isnan(z_values[i][j]) ? INVALID : REAL)) - || (type == SET_IN_BITMAP && !done_flags->marked(i, j)) - ) { - // Found a Mesh Point of the specified type! - const xy_pos_t mpos = { mesh_index_to_xpos(i), mesh_index_to_ypos(j) }; - - // If using the probe as the reference there are some unreachable locations. - // Also for round beds, there are grid points outside the bed the nozzle can't reach. - // Prune them from the list and ignore them till the next Phase (manual nozzle probing). - - if (probe_relative ? !position_is_reachable_by_probe(mpos) : !position_is_reachable(mpos)) - continue; - - // Reachable. Check if it's the best_so_far location to the nozzle. - - const xy_pos_t diff = current_position - mpos; - const float distance = (ref - mpos).magnitude() + diff.magnitude() * 0.1f; - - // factor in the distance from the current location for the normal case - // so the nozzle isn't running all over the bed. - if (distance < best_so_far) { - best_so_far = distance; // Found a closer location with the desired value type. - closest.pos.set(i, j); - closest.distance = best_so_far; - } - } - } // for j - } // for i - - return closest; - } - - /** - * 'Smart Fill': Scan from the outward edges of the mesh towards the center. - * If an invalid location is found, use the next two points (if valid) to - * calculate a 'reasonable' value for the unprobed mesh point. - */ - - bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - const float v = z_values[x][y]; - if (isnan(v)) { // A NAN... - const int8_t dx = x + xdir, dy = y + ydir; - const float v1 = z_values[dx][dy]; - if (!isnan(v1)) { // ...next to a pair of real values? - const float v2 = z_values[dx + xdir][dy + ydir]; - if (!isnan(v2)) { - z_values[x][y] = v1 < v2 ? v1 : v1 + v1 - v2; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - return true; - } - } - } - return false; - } - - typedef struct { uint8_t sx, ex, sy, ey; bool yfirst; } smart_fill_info; - - void unified_bed_leveling::smart_fill_mesh() { - static const smart_fill_info - info0 PROGMEM = { 0, GRID_MAX_POINTS_X, 0, GRID_MAX_POINTS_Y - 2, false }, // Bottom of the mesh looking up - info1 PROGMEM = { 0, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - 1, 0, false }, // Top of the mesh looking down - info2 PROGMEM = { 0, GRID_MAX_POINTS_X - 2, 0, GRID_MAX_POINTS_Y, true }, // Left side of the mesh looking right - info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left - static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 }; - - for (uint8_t i = 0; i < COUNT(info); ++i) { - const smart_fill_info *f = (smart_fill_info*)pgm_read_ptr(&info[i]); - const int8_t sx = pgm_read_byte(&f->sx), sy = pgm_read_byte(&f->sy), - ex = pgm_read_byte(&f->ex), ey = pgm_read_byte(&f->ey); - if (pgm_read_byte(&f->yfirst)) { - const int8_t dir = ex > sx ? 1 : -1; - for (uint8_t y = sy; y != ey; ++y) - for (uint8_t x = sx; x != ex; x += dir) - if (smart_fill_one(x, y, dir, 0)) break; - } - else { - const int8_t dir = ey > sy ? 1 : -1; - for (uint8_t x = sx; x != ex; ++x) - for (uint8_t y = sy; y != ey; y += dir) - if (smart_fill_one(x, y, 0, dir)) break; - } - } - } - - #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) { - 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); - - xy_float_t points[3]; - get_three_probe_points(points); - - float measured_z; - bool abort_flag = false; - - #ifdef VALIDATE_MESH_TILT - float z1, z2, z3; // Needed for algorithm validation below - #endif - - struct linear_fit_data lsf_results; - incremental_LSF_reset(&lsf_results); - - if (do_3_pt_leveling) { - SERIAL_ECHOLNPGM("Tilting mesh (1/3)"); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); - #endif - - measured_z = probe_at_point(points[0], PROBE_PT_RAISE, g29_verbose_level); - if (isnan(measured_z)) - abort_flag = true; - else { - measured_z -= get_z_correction(points[0]); - #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, points[0], measured_z); - } - - if (!abort_flag) { - SERIAL_ECHOLNPGM("Tilting mesh (2/3)"); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); - #endif - - measured_z = probe_at_point(points[1], 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(points[1]); - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, points[1], measured_z); - } - } - - if (!abort_flag) { - SERIAL_ECHOLNPGM("Tilting mesh (3/3)"); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); - #endif - - measured_z = probe_at_point(points[2], 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(points[2]); - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, points[2], measured_z); - } - } - - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag) { - SERIAL_ECHOLNPGM("?Error probing point. Aborting operation."); - return; - } - } - else { // !do_3_pt_leveling - - bool zig_zag = false; - - uint16_t total_points = g29_grid_size * g29_grid_size, point_num = 1; - - xy_pos_t rpos; - for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - rpos.x = x_min + ix * dx; - for (int8_t iy = 0; iy < g29_grid_size; iy++) { - rpos.y = y_min + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); - - if (!abort_flag) { - SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n"); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points); - #endif - - measured_z = probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling - - abort_flag = isnan(measured_z); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - const xy_pos_t lpos = rpos.asLogical(); - DEBUG_CHAR('('); - DEBUG_ECHO_F(rpos.x, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(rpos.y, 7); - DEBUG_ECHOPAIR_F(") logical: (", lpos.x, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(lpos.y, 7); - DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7); - DEBUG_ECHOPAIR_F(" correction: ", get_z_correction(rpos), 7); - } - #endif - - measured_z -= get_z_correction(rpos) /* + probe_offset.z */ ; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7); - - if (g29_verbose_level > 3) { - serial_spaces(16); - SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); - } - incremental_LSF(&lsf_results, rpos, measured_z); - } - - point_num++; - } - - zig_zag ^= true; - } - } - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - - if (abort_flag || finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOPGM("Could not complete LSF!"); - return; - } - - vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); - - if (g29_verbose_level > 2) { - SERIAL_ECHOPAIR_F("bed plane normal = [", normal.x, 7); - SERIAL_CHAR(','); - SERIAL_ECHO_F(normal.y, 7); - SERIAL_CHAR(','); - SERIAL_ECHO_F(normal.z, 7); - SERIAL_ECHOLNPGM("]"); - } - - matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j), - mz = z_values[i][j]; - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(my, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(mz, 7); - DEBUG_ECHOPGM("] ---> "); - DEBUG_DELAY(20); - } - - apply_rotation_xyz(rotation, mx, my, mz); - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR_F("after rotation = [", mx, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(my, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(mz, 7); - DEBUG_ECHOLNPGM("]"); - DEBUG_DELAY(20); - } - - z_values[i][j] = mz - lsf_results.D; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(i, j, z_values[i][j]); - #endif - } - } - - if (DEBUGGING(LEVELING)) { - rotation.debug(PSTR("rotation matrix:\n")); - DEBUG_ECHOPAIR_F("LSF Results A=", lsf_results.A, 7); - DEBUG_ECHOPAIR_F(" B=", lsf_results.B, 7); - DEBUG_ECHOLNPAIR_F(" D=", lsf_results.D, 7); - DEBUG_DELAY(55); - - DEBUG_ECHOPAIR_F("bed plane normal = [", normal.x, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(normal.y, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(normal.z, 7); - DEBUG_ECHOLNPGM("]"); - DEBUG_EOL(); - - /** - * Use the code below to check the validity of the mesh tilting algorithm. - * 3-Point Mesh Tilt uses the same algorithm as grid-based tilting, but only - * three points are used in the calculation. This guarantees that each probed point - * has an exact match when get_z_correction() for that location is calculated. - * The Z error between the probed point locations and the get_z_correction() - * numbers for those locations should be 0. - */ - #ifdef VALIDATE_MESH_TILT - auto d_from = []() { DEBUG_ECHOPGM("D from "); }; - auto normed = [&](const xy_pos_t &pos, const float &zadd) { - return normal.x * pos.x + normal.y * pos.y + zadd; - }; - auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const float &zadd) { - d_from(); serialprintPGM(pre); - DEBUG_ECHO_F(normed(pos, zadd), 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", zadd - get_z_correction(pos), 6); - }; - debug_pt(PSTR("1st point: "), probe_pt[0], normal.z * z1); - debug_pt(PSTR("2nd point: "), probe_pt[1], normal.z * z2); - debug_pt(PSTR("3rd point: "), probe_pt[2], normal.z * z3); - d_from(); DEBUG_ECHOPGM("safe home with Z="); - DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6); - d_from(); DEBUG_ECHOPGM("safe home with Z="); - DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_homing_xy, get_z_correction(safe_homing_xy)), 6); - DEBUG_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT); - DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_homing_xy), 6); - #endif - } // DEBUGGING(LEVELING) - - } - - #endif // HAS_BED_PROBE - - #if ENABLED(UBL_G29_P31) - void unified_bed_leveling::smart_fill_wlsf(const float &weight_factor) { - - // For each undefined mesh point, compute a distance-weighted least squares fit - // from all the originally populated mesh points, weighted toward the point - // being extrapolated so that nearby points will have greater influence on - // the point being extrapolated. Then extrapolate the mesh point from WLSF. - - static_assert(GRID_MAX_POINTS_Y <= 16, "GRID_MAX_POINTS_Y too big"); - uint16_t bitmap[GRID_MAX_POINTS_X] = { 0 }; - struct linear_fit_data lsf_results; - - SERIAL_ECHOPGM("Extrapolating mesh..."); - - const float weight_scaled = weight_factor * _MAX(MESH_X_DIST, MESH_Y_DIST); - - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) - if (!isnan(z_values[jx][jy])) - SBI(bitmap[jx], jy); - - xy_pos_t ppos; - for (uint8_t ix = 0; ix < GRID_MAX_POINTS_X; ix++) { - ppos.x = mesh_index_to_xpos(ix); - for (uint8_t iy = 0; iy < GRID_MAX_POINTS_Y; iy++) { - ppos.y = mesh_index_to_ypos(iy); - if (isnan(z_values[ix][iy])) { - // undefined mesh point at (ppos.x,ppos.y), compute weighted LSF from original valid mesh points. - incremental_LSF_reset(&lsf_results); - xy_pos_t rpos; - for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) { - rpos.x = mesh_index_to_xpos(jx); - for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) { - if (TEST(bitmap[jx], jy)) { - rpos.y = mesh_index_to_ypos(jy); - const float rz = z_values[jx][jy], - w = 1.0f + weight_scaled / (rpos - ppos).magnitude(); - incremental_WLSF(&lsf_results, rpos, rz, w); - } - } - } - if (finish_incremental_LSF(&lsf_results)) { - SERIAL_ECHOLNPGM("Insufficient data"); - return; - } - const float ez = -lsf_results.D - lsf_results.A * ppos.x - lsf_results.B * ppos.y; - z_values[ix][iy] = ez; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]); - #endif - idle(); // housekeeping - } - } - } - - SERIAL_ECHOLNPGM("done"); - } - #endif // UBL_G29_P31 - - #if ENABLED(UBL_DEVEL_DEBUGGING) - /** - * Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - * good to have the extra information. Soon... we prune this to just a few items - */ - void unified_bed_leveling::g29_what_command() { - report_state(); - - if (storage_slot == -1) - SERIAL_ECHOPGM("No Mesh Loaded."); - else - SERIAL_ECHOPAIR("Mesh ", storage_slot, " Loaded."); - SERIAL_EOL(); - serial_delay(50); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - 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("Probe Offset M851 Z", probe_offset.z, 7); - #endif - - SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50); - SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); serial_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); serial_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); serial_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); serial_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); serial_delay(50); - SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); - SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); serial_delay(50); - - SERIAL_ECHOPGM("X-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - SERIAL_ECHO_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); - SERIAL_ECHOPGM(" "); - serial_delay(25); - } - SERIAL_EOL(); - - SERIAL_ECHOPGM("Y-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { - SERIAL_ECHO_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); - SERIAL_ECHOPGM(" "); - serial_delay(25); - } - SERIAL_EOL(); - - #if HAS_KILL - SERIAL_ECHOLNPAIR("Kill pin on :", int(KILL_PIN), " state:", READ(KILL_PIN)); - #endif - SERIAL_EOL(); - serial_delay(50); - - #if ENABLED(UBL_DEVEL_DEBUGGING) - SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation, "\nubl_state_recursion_chk :", ubl_state_recursion_chk); - serial_delay(50); - - SERIAL_ECHOLNPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()), " to ", hex_address((void*)settings.meshes_end_index())); - serial_delay(50); - - SERIAL_ECHOLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); SERIAL_EOL(); - SERIAL_ECHOLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); SERIAL_EOL(); - serial_delay(25); - - SERIAL_ECHOLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); - serial_delay(50); - - SERIAL_ECHOLNPAIR("EEPROM can hold ", settings.calc_num_meshes(), " meshes.\n"); - serial_delay(25); - #endif // UBL_DEVEL_DEBUGGING - - if (!sanity_check()) { - echo_name(); - SERIAL_ECHOLNPGM(" sanity checks passed."); - } - } - - /** - * When we are fully debugged, the EEPROM dump command will get deleted also. But - * right now, it is good to have the extra information. Soon... we prune this. - */ - void unified_bed_leveling::g29_eeprom_dump() { - uint8_t cccc; - - SERIAL_ECHO_MSG("EEPROM Dump:"); - persistentStore.access_start(); - for (uint16_t i = 0; i < persistentStore.capacity(); i += 16) { - if (!(i & 0x3)) idle(); - print_hex_word(i); - SERIAL_ECHOPGM(": "); - for (uint16_t j = 0; j < 16; j++) { - persistentStore.read_data(i + j, &cccc, sizeof(uint8_t)); - print_hex_byte(cccc); - SERIAL_CHAR(' '); - } - SERIAL_EOL(); - } - SERIAL_EOL(); - persistentStore.access_finish(); - } - - /** - * When we are fully debugged, this may go away. But there are some valid - * use cases for the users. So we can wait and see what to do with it. - */ - void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { - const int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_ECHOLNPGM("?EEPROM storage not available."); - return; - } - - if (!parser.has_value() || !WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1); - return; - } - - g29_storage_slot = parser.value_int(); - - float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - settings.load_mesh(g29_storage_slot, &tmp_z_values); - - SERIAL_ECHOLNPAIR("Subtracting mesh in slot ", g29_storage_slot, " from current mesh."); - - 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] -= tmp_z_values[x][y]; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - } - } - - #endif // UBL_DEVEL_DEBUGGING - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp deleted file mode 100644 index a0d5518c45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ /dev/null @@ -1,483 +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 . - * - */ -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - -#include "../bedlevel.h" -#include "../../../module/planner.h" -#include "../../../module/stepper.h" -#include "../../../module/motion.h" - -#if ENABLED(DELTA) - #include "../../../module/delta.h" -#endif - -#include "../../../Marlin.h" -#include - -#if !UBL_SEGMENTED - - 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 - * just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave - */ - #if HAS_POSITION_MODIFIERS - xyze_pos_t start = current_position, end = destination; - planner.apply_modifiers(start); - planner.apply_modifiers(end); - #else - const xyze_pos_t &start = current_position, &end = destination; - #endif - - const xy_int8_t istart = cell_indexes(start), iend = cell_indexes(end); - - // A move within the same cell needs no splitting - if (istart == iend) { - - // For a move off the bed, use a constant Z raise - if (!WITHIN(iend.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iend.y, 0, GRID_MAX_POINTS_Y - 1)) { - - // Note: There is no Z Correction in this case. We are off the grid and don't know what - // a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH - // value, that will be used instead of a calculated (Bi-Linear interpolation) correction. - - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - end.z += UBL_Z_RAISE_WHEN_OFF_MESH; - #endif - planner.buffer_segment(end, scaled_fr_mm_s, extruder); - current_position = destination; - return; - } - - FINAL_MOVE: - - // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end.x - mesh_index_to_xpos(iend.x)) * RECIPROCAL(MESH_X_DIST); - - float z1, z2; - if (iend.x >= GRID_MAX_POINTS_X - 1) - z1 = z2 = 0.0; - else { - z1 = z_values[iend.x ][iend.y ] + xratio * - (z_values[iend.x + 1][iend.y ] - z_values[iend.x][iend.y ]), - z2 = z_values[iend.x ][iend.y + 1] + xratio * - (z_values[iend.x + 1][iend.y + 1] - z_values[iend.x][iend.y + 1]); - } - - // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end.y - mesh_index_to_ypos(iend.y)) * RECIPROCAL(MESH_Y_DIST), - z0 = iend.y < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end.z) : 0.0; - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (!isnan(z0)) end.z += z0; - planner.buffer_segment(end, scaled_fr_mm_s, extruder); - current_position = destination; - return; - } - - /** - * Past this point the move is known to cross one or more mesh lines. Check for the most common - * case - crossing only one X or Y line - after details are worked out to reduce computation. - */ - - const xy_float_t dist = end - start; - const xy_bool_t neg { dist.x < 0, dist.y < 0 }; - const xy_int8_t ineg { int8_t(neg.x), int8_t(neg.y) }; - const xy_float_t sign { neg.x ? -1.0f : 1.0f, neg.y ? -1.0f : 1.0f }; - const xy_int8_t iadd { int8_t(iend.x == istart.x ? 0 : sign.x), int8_t(iend.y == istart.y ? 0 : sign.y) }; - - /** - * Compute the extruder scaling factor for each partial move, checking for - * zero-length moves that would result in an infinite scaling factor. - * A float divide is required for this, but then it just multiplies. - * Also select a scaling factor based on the larger of the X and Y - * components. The larger of the two is used to preserve precision. - */ - - const xy_float_t ad = sign * dist; - const bool use_x_dist = ad.x > ad.y; - - float on_axis_distance = use_x_dist ? dist.x : dist.y, - e_position = end.e - start.e, - z_position = end.z - start.z; - - const float e_normalized_dist = e_position / on_axis_distance, // Allow divide by zero - z_normalized_dist = z_position / on_axis_distance; - - xy_int8_t icell = istart; - - const float ratio = dist.y / dist.x, // Allow divide by zero - c = start.y - ratio * start.x; - - const bool inf_normalized_flag = isinf(e_normalized_dist), - inf_ratio_flag = isinf(ratio); - - /** - * Handle vertical lines that stay within one column. - * These need not be perfectly vertical. - */ - if (iadd.x == 0) { // Vertical line? - icell.y += ineg.y; // Line going down? Just go to the bottom. - while (icell.y != iend.y + ineg.y) { - icell.y += iadd.y; - const float next_mesh_line_y = mesh_index_to_ypos(icell.y); - - /** - * Skip the calculations for an infinite slope. - * For others the next X is the same so this can continue. - * Calculate X at the next Y mesh line. - */ - const float rx = inf_ratio_flag ? start.x : (next_mesh_line_y - c) / ratio; - - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x, icell.y) - * planner.fade_scaling_factor_for_z(end.z); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - const float ry = mesh_index_to_ypos(icell.y); - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading down, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (ry != start.y) { - if (!inf_normalized_flag) { // fall-through faster than branch - on_axis_distance = use_x_dist ? rx - start.x : ry - start.y; - e_position = start.e + on_axis_distance * e_normalized_dist; - z_position = start.z + on_axis_distance * z_normalized_dist; - } - else { - e_position = end.e; - z_position = end.z; - } - - planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder); - } //else printf("FIRST MOVE PRUNED "); - } - - // At the final destination? Usually not, but when on a Y Mesh Line it's completed. - if (xy_pos_t(current_position) != xy_pos_t(end)) - goto FINAL_MOVE; - - current_position = destination; - return; - } - - /** - * Handle horizontal lines that stay within one row. - * These need not be perfectly horizontal. - */ - if (iadd.y == 0) { // Horizontal line? - icell.x += ineg.x; // Heading left? Just go to the left edge of the cell for the first move. - while (icell.x != iend.x + ineg.x) { - icell.x += iadd.x; - const float rx = mesh_index_to_xpos(icell.x); - const float ry = ratio * rx + c; // Calculate Y at the next X mesh line - - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x, icell.y) - * planner.fade_scaling_factor_for_z(end.z); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - /** - * Without this check, it's possible to generate a zero length move, as in the case where - * the line is heading left, starting exactly on a mesh line boundary. Since this is rare - * it might be fine to remove this check and let planner.buffer_segment() filter it out. - */ - if (rx != start.x) { - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start.x : ry - start.y; - e_position = start.e + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move - z_position = start.z + on_axis_distance * z_normalized_dist; - } - else { - e_position = end.e; - z_position = end.z; - } - - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) - break; - } //else printf("FIRST MOVE PRUNED "); - } - - if (xy_pos_t(current_position) != xy_pos_t(end)) - goto FINAL_MOVE; - - current_position = destination; - return; - } - - /** - * - * Generic case of a line crossing both X and Y Mesh lines. - * - */ - - xy_int8_t cnt = (istart - iend).ABS(); - - icell += ineg; - - while (cnt) { - - const float next_mesh_line_x = mesh_index_to_xpos(icell.x + iadd.x), - next_mesh_line_y = mesh_index_to_ypos(icell.y + iadd.y), - ry = ratio * next_mesh_line_x + c, // Calculate Y at the next X mesh line - rx = (next_mesh_line_y - c) / ratio; // Calculate X at the next Y mesh line - // (No need to worry about ratio == 0. - // In that case, it was already detected - // as a vertical line move above.) - - if (neg.x == (rx > next_mesh_line_x)) { // Check if we hit the Y line first - // Yes! Crossing a Y Mesh Line next - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x - ineg.x, icell.y + iadd.y) - * planner.fade_scaling_factor_for_z(end.z); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start.x : next_mesh_line_y - start.y; - e_position = start.e + on_axis_distance * e_normalized_dist; - z_position = start.z + on_axis_distance * z_normalized_dist; - } - else { - e_position = end.e; - z_position = end.z; - } - if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, scaled_fr_mm_s, extruder)) - break; - icell.y += iadd.y; - cnt.y--; - } - else { - // Yes! Crossing a X Mesh Line next - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x + iadd.x, icell.y - ineg.y) - * planner.fade_scaling_factor_for_z(end.z); - - // Undefined parts of the Mesh in z_values[][] are NAN. - // Replace NAN corrections with 0.0 to prevent NAN propagation. - if (isnan(z0)) z0 = 0.0; - - if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? next_mesh_line_x - start.x : ry - start.y; - e_position = start.e + on_axis_distance * e_normalized_dist; - z_position = start.z + on_axis_distance * z_normalized_dist; - } - else { - e_position = end.e; - z_position = end.z; - } - - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) - break; - icell.x += iadd.x; - cnt.x--; - } - - if (cnt.x < 0 || cnt.y < 0) break; // Too far! Exit the loop and go to FINAL_MOVE - } - - if (xy_pos_t(current_position) != xy_pos_t(end)) - goto FINAL_MOVE; - - current_position = destination; - } - -#else // UBL_SEGMENTED - - #if IS_SCARA - #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm - #elif ENABLED(DELTA) - #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND) - #else // CARTESIAN - #ifdef LEVELED_SEGMENT_LENGTH - #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH - #else - #define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation) - #endif - #endif - - /** - * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics. - * This calls planner.buffer_segment multiple times for small incremental moves. - * Returns true if did NOT move, false if moved (requires current_position update). - */ - - bool _O2 unified_bed_leveling::line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s) { - - if (!position_is_reachable(destination)) // fail if moving outside reachable boundary - return true; // did not move, so current_position still accurate - - const xyze_pos_t total = destination - current_position; - - const float cart_xy_mm_2 = HYPOT2(total.x, total.y), - cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance - - #if IS_KINEMATIC - const float seconds = cart_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(cart_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(cart_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length - #endif - - NOLESS(segments, 1U); // Must have at least one segment - const float inv_segments = 1.0f / segments, // Reciprocal to save calculation - segment_xyz_mm = SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments; // Length of each segment - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = scaled_fr_mm_s / segment_xyz_mm; - #endif - - xyze_float_t diff = total * inv_segments; - - // Note that E segment distance could vary slightly as z mesh height - // changes for each segment, but small enough to ignore. - - xyze_pos_t raw = current_position; - - // 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)) { - while (--segments) { - raw += diff; - planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - } - planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, segment_xyz_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - return false; // Did not set current from destination - } - - // Otherwise perform per-segment leveling - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = planner.fade_scaling_factor_for_z(destination.z); - #endif - - // Move to first segment destination - raw += diff; - - for (;;) { // for each mesh cell encountered during the move - - // Compute mesh cell invariants that remain constant for all segments within cell. - // Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter) - // the bilinear interpolation from the adjacent cell within the mesh will still work. - // Inner loop will exit each time (because out of cell bounds) but will come back - // in top of loop and again re-find same adjacent cell and use it, just less efficient - // for mesh inset area. - - xy_int8_t icell = { - int8_t((raw.x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST)), - int8_t((raw.y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST)) - }; - LIMIT(icell.x, 0, (GRID_MAX_POINTS_X) - 1); - LIMIT(icell.y, 0, (GRID_MAX_POINTS_Y) - 1); - - float z_x0y0 = z_values[icell.x ][icell.y ], // z at lower left corner - z_x1y0 = z_values[icell.x+1][icell.y ], // z at upper left corner - z_x0y1 = z_values[icell.x ][icell.y+1], // z at lower right corner - z_x1y1 = z_values[icell.x+1][icell.y+1]; // z at upper right corner - - if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A) - if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points - if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell, - if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points - - const xy_pos_t pos = { mesh_index_to_xpos(icell.x), mesh_index_to_ypos(icell.y) }; - xy_pos_t cell = raw - pos; - - 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 * cell.x; // z height along y0 at cell.x (changes for each cell.x in cell) - - const float z_cxy1 = z_x0y1 + z_xmy1 * cell.x, // z height along y1 at cell.x - z_cxyd = z_cxy1 - z_cxy0; // z height difference along cell.x from y0 to y1 - - float z_cxym = z_cxyd * RECIPROCAL(MESH_Y_DIST); // z slope per y along cell.x from pos.y to y1 (changes for each cell.x in cell) - - // float z_cxcy = z_cxy0 + z_cxym * cell.y; // interpolated mesh z height along cell.x at cell.y (do inside the segment loop) - - // As subsequent segments step through this cell, the z_cxy0 intercept will change - // and the z_cxym slope will change, both as a function of cell.x within the cell, and - // each change by a constant for fixed segment lengths. - - const float z_sxy0 = z_xmy0 * diff.x, // per-segment adjustment to z_cxy0 - z_sxym = (z_xmy1 - z_xmy0) * RECIPROCAL(MESH_Y_DIST) * diff.x; // per-segment adjustment to z_cxym - - for (;;) { // for all segments within this mesh cell - - if (--segments == 0) raw = destination; // if this is last segment, use destination for exact - - const float z_cxcy = (z_cxy0 + z_cxym * cell.y) // interpolated mesh z height along cell.x at cell.y - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * fade_scaling_factor // apply fade factor to interpolated mesh height - #endif - ; - - planner.buffer_line(raw.x, raw.y, raw.z + z_cxcy, raw.e, scaled_fr_mm_s, active_extruder, segment_xyz_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - - if (segments == 0) // done with last segment - return false; // didn't set current from destination - - raw += diff; - cell += diff; - - if (!WITHIN(cell.x, 0, MESH_X_DIST) || !WITHIN(cell.y, 0, MESH_Y_DIST)) // done within this cell, break to next - break; - - // Next segment still within same mesh cell, adjust the per-segment - // slope and intercept to compute next z height. - - z_cxy0 += z_sxy0; // adjust z_cxy0 by per-segment z_sxy0 - z_cxym += z_sxym; // adjust z_cxym by per-segment z_sxym - - } // segment loop - } // cell loop - - return false; // caller will update current_position - } - -#endif // UBL_SEGMENTED - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.cpp deleted file mode 100644 index 81ccbfbe32..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.cpp +++ /dev/null @@ -1,36 +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 . - * - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(BINARY_FILE_TRANSFER) - -#include "../sd/cardreader.h" -#include "binary_protocol.h" - -char* SDFileTransferProtocol::Packet::Open::data = nullptr; -size_t SDFileTransferProtocol::data_waiting, SDFileTransferProtocol::transfer_timeout, SDFileTransferProtocol::idle_timeout; -bool SDFileTransferProtocol::transfer_active, SDFileTransferProtocol::dummy_transfer, SDFileTransferProtocol::compression; - -BinaryStream binaryStream[NUM_SERIAL]; - -#endif // BINARY_FILE_TRANSFER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.h deleted file mode 100644 index c558a3eeae..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/binary_protocol.h +++ /dev/null @@ -1,480 +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 - -#include "../inc/MarlinConfig.h" - -#define BINARY_STREAM_COMPRESSION - -#if ENABLED(BINARY_STREAM_COMPRESSION) - #include "../libs/heatshrink/heatshrink_decoder.h" -#endif - -inline bool bs_serial_data_available(const uint8_t index) { - switch (index) { - case 0: return MYSERIAL0.available(); - #if NUM_SERIAL > 1 - case 1: return MYSERIAL1.available(); - #endif - } - return false; -} - -inline int bs_read_serial(const uint8_t index) { - switch (index) { - case 0: return MYSERIAL0.read(); - #if NUM_SERIAL > 1 - case 1: return MYSERIAL1.read(); - #endif - } - return -1; -} - -#if ENABLED(BINARY_STREAM_COMPRESSION) - static heatshrink_decoder hsd; - static uint8_t decode_buffer[512] = {}; -#endif - -class SDFileTransferProtocol { -private: - struct Packet { - struct [[gnu::packed]] Open { - static bool validate(char* buffer, size_t length) { - return (length > sizeof(Open) && buffer[length - 1] == '\0'); - } - static Open& decode(char* buffer) { - data = &buffer[2]; - return *reinterpret_cast(buffer); - } - bool compression_enabled() { return compression & 0x1; } - bool dummy_transfer() { return dummy & 0x1; } - static char* filename() { return data; } - private: - uint8_t dummy, compression; - static char* data; // variable length strings complicate things - }; - }; - - static bool file_open(char* filename) { - if (!dummy_transfer) { - card.mount(); - card.openFile(filename, false); - if (!card.isFileOpen()) return false; - } - transfer_active = true; - data_waiting = 0; - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_reset(&hsd); - #endif - return true; - } - - static bool file_write(char* buffer, const size_t length) { - #if ENABLED(BINARY_STREAM_COMPRESSION) - if (compression) { - size_t total_processed = 0, processed_count = 0; - HSD_poll_res presult; - - while (total_processed < length) { - heatshrink_decoder_sink(&hsd, reinterpret_cast(&buffer[total_processed]), length - total_processed, &processed_count); - total_processed += processed_count; - do { - presult = heatshrink_decoder_poll(&hsd, &decode_buffer[data_waiting], sizeof(decode_buffer) - data_waiting, &processed_count); - data_waiting += processed_count; - if (data_waiting == sizeof(decode_buffer)) { - if (!dummy_transfer) - if (card.write(decode_buffer, data_waiting) < 0) { - return false; - } - data_waiting = 0; - } - } while (presult == HSDR_POLL_MORE); - } - return true; - } - #endif - return (dummy_transfer || card.write(buffer, length) >= 0); - } - - static bool file_close() { - if (!dummy_transfer) { - #if ENABLED(BINARY_STREAM_COMPRESSION) - // flush any buffered data - if (data_waiting) { - if (card.write(decode_buffer, data_waiting) < 0) return false; - data_waiting = 0; - } - #endif - card.closefile(); - card.release(); - } - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_finish(&hsd); - #endif - transfer_active = false; - return true; - } - - static void transfer_abort() { - if (!dummy_transfer) { - card.closefile(); - card.removeFile(card.filename); - card.release(); - #if ENABLED(BINARY_STREAM_COMPRESSION) - heatshrink_decoder_finish(&hsd); - #endif - } - transfer_active = false; - return; - } - - enum class FileTransfer : uint8_t { QUERY, OPEN, CLOSE, WRITE, ABORT }; - - static size_t data_waiting, transfer_timeout, idle_timeout; - static bool transfer_active, dummy_transfer, compression; - -public: - - static void idle() { - // If a transfer is interrupted and a file is left open, abort it after TIMEOUT ms - const millis_t ms = millis(); - if (transfer_active && ELAPSED(ms, idle_timeout)) { - idle_timeout = ms + IDLE_PERIOD; - if (ELAPSED(ms, transfer_timeout)) transfer_abort(); - } - } - - static void process(uint8_t packet_type, char* buffer, const uint16_t length) { - transfer_timeout = millis() + TIMEOUT; - switch (static_cast(packet_type)) { - case FileTransfer::QUERY: - SERIAL_ECHOPAIR("PFT:version:", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH); - #if ENABLED(BINARY_STREAM_COMPRESSION) - SERIAL_ECHOLNPAIR(":compresion:heatshrink,", HEATSHRINK_STATIC_WINDOW_BITS, ",", HEATSHRINK_STATIC_LOOKAHEAD_BITS); - #else - SERIAL_ECHOLNPGM(":compresion:none"); - #endif - break; - case FileTransfer::OPEN: - if (transfer_active) - SERIAL_ECHOLNPGM("PFT:busy"); - else { - if (Packet::Open::validate(buffer, length)) { - auto packet = Packet::Open::decode(buffer); - compression = packet.compression_enabled(); - dummy_transfer = packet.dummy_transfer(); - if (file_open(packet.filename())) { - SERIAL_ECHOLNPGM("PFT:success"); - break; - } - } - SERIAL_ECHOLNPGM("PFT:fail"); - } - break; - case FileTransfer::CLOSE: - if (transfer_active) { - if (file_close()) - SERIAL_ECHOLNPGM("PFT:success"); - else - SERIAL_ECHOLNPGM("PFT:ioerror"); - } - else SERIAL_ECHOLNPGM("PFT:invalid"); - break; - case FileTransfer::WRITE: - if (!transfer_active) - SERIAL_ECHOLNPGM("PFT:invalid"); - else if (!file_write(buffer, length)) - SERIAL_ECHOLNPGM("PFT:ioerror"); - break; - case FileTransfer::ABORT: - transfer_abort(); - SERIAL_ECHOLNPGM("PFT:success"); - break; - default: - SERIAL_ECHOLNPGM("PTF:invalid"); - break; - } - } - - static const uint16_t VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0, TIMEOUT = 10000, IDLE_PERIOD = 1000; -}; - -class BinaryStream { -public: - enum class Protocol : uint8_t { CONTROL, FILE_TRANSFER }; - - enum class ProtocolControl : uint8_t { SYNC = 1, CLOSE }; - - enum class StreamState : uint8_t { PACKET_RESET, PACKET_WAIT, PACKET_HEADER, PACKET_DATA, PACKET_FOOTER, - 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 - - 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]; - }; - - union Footer { - struct [[gnu::packed]] { - uint16_t checksum; // full packet checksum - }; - void reset() { checksum = 0; } - uint8_t data[1]; - }; - - Header header; - Footer footer; - uint32_t bytes_received; - uint16_t checksum, header_checksum; - millis_t timeout; - char* buffer; - - void reset() { - header.reset(); - footer.reset(); - bytes_received = 0; - checksum = 0; - header_checksum = 0; - timeout = millis() + PACKET_MAX_WAIT; - buffer = nullptr; - } - } packet{}; - - void reset() { - sync = 0; - packet_retries = 0; - buffer_next_index = 0; - } - - // fletchers 16 checksum - uint32_t checksum(uint32_t cs, uint8_t value) { - uint16_t cs_low = (((cs & 0xFF) + value) % 255); - return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; - } - - // read the next byte from the data stream keeping track of - // whether the stream times out from data starvation - // takes the data variable by reference in order to return status - bool stream_read(uint8_t& data) { - if (stream_state != StreamState::PACKET_WAIT && ELAPSED(millis(), packet.timeout)) { - stream_state = StreamState::PACKET_TIMEOUT; - return false; - } - if (!bs_serial_data_available(card.transfer_port_index)) return false; - data = bs_read_serial(card.transfer_port_index); - packet.timeout = millis() + PACKET_MAX_WAIT; - return true; - } - - template - void receive(char (&buffer)[buffer_size]) { - uint8_t data = 0; - millis_t transfer_window = millis() + RX_TIMESLICE; - - #if ENABLED(SDSUPPORT) - PORT_REDIRECT(card.transfer_port_index); - #endif - - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Warray-bounds" - - while (PENDING(millis(), transfer_window)) { - switch (stream_state) { - /** - * Data stream packet handling - */ - case StreamState::PACKET_RESET: - packet.reset(); - 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.bytes_received = 2; - stream_state = StreamState::PACKET_HEADER; - } - else { - // stream corruption drop data - packet.header.data[0] = data; - } - break; - case StreamState::PACKET_HEADER: - if (!stream_read(data)) break; - - 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) - packet.header_checksum = packet.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) { - SERIAL_ECHOLNPAIR("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH); - stream_state = StreamState::PACKET_RESET; - break; - } - if (packet.header.sync == sync) { - buffer_next_index = 0; - packet.bytes_received = 0; - 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 - stream_state = StreamState::PACKET_RESET; - } - else if (packet_retries) { - stream_state = StreamState::PACKET_RESET; // could be packets already buffered on flow controlled connections, drop them without ack - } - else { - SERIAL_ECHO_MSG("Datastream packet out of order"); - stream_state = StreamState::PACKET_RESEND; - } - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Packet header(", packet.header.sync, "?) corrupt"); - stream_state = StreamState::PACKET_RESEND; - } - } - break; - case StreamState::PACKET_DATA: - if (!stream_read(data)) break; - - if (buffer_next_index < buffer_size) - packet.buffer[buffer_next_index] = data; - else { - SERIAL_ECHO_MSG("Datastream packet data buffer overrun"); - stream_state = StreamState::PACKET_ERROR; - break; - } - - packet.checksum = checksum(packet.checksum, data); - packet.bytes_received++; - buffer_next_index++; - - if (packet.bytes_received == packet.header.size) { - stream_state = StreamState::PACKET_FOOTER; - packet.bytes_received = 0; - } - break; - 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) { - stream_state = StreamState::PACKET_PROCESS; - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Packet(", packet.header.sync, ") payload corrupt"); - stream_state = StreamState::PACKET_RESEND; - } - } - break; - case StreamState::PACKET_PROCESS: - sync++; - packet_retries = 0; - bytes_received += packet.header.size; - - SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received - dispatch(); - stream_state = StreamState::PACKET_RESET; - break; - case StreamState::PACKET_RESEND: - if (packet_retries < MAX_RETRIES || MAX_RETRIES == 0) { - packet_retries++; - stream_state = StreamState::PACKET_RESET; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Resend request ", int(packet_retries)); - SERIAL_ECHOLNPAIR("rs", sync); - } - else - stream_state = StreamState::PACKET_ERROR; - break; - case StreamState::PACKET_TIMEOUT: - SERIAL_ECHO_MSG("Datastream timeout"); - stream_state = StreamState::PACKET_RESEND; - break; - case StreamState::PACKET_ERROR: - SERIAL_ECHOLNPAIR("fe", packet.header.sync); - reset(); // reset everything, resync required - stream_state = StreamState::PACKET_RESET; - break; - } - } - - #pragma GCC diagnostic pop - } - - void dispatch() { - switch(static_cast(packet.header.protocol())) { - case Protocol::CONTROL: - switch(static_cast(packet.header.type())) { - case ProtocolControl::CLOSE: // revert back to ASCII mode - card.flag.binary_mode = false; - break; - default: - SERIAL_ECHO_MSG("Unknown BinaryProtocolControl Packet"); - } - break; - case Protocol::FILE_TRANSFER: - SDFileTransferProtocol::process(packet.header.type(), packet.buffer, packet.header.size); // send user data to be processed - break; - default: - SERIAL_ECHO_MSG("Unsupported Binary Protocol"); - } - } - - void idle() { - // Some Protocols may need periodic updates without new data - SDFileTransferProtocol::idle(); - } - - static const uint16_t PACKET_MAX_WAIT = 500, RX_TIMESLICE = 20, MAX_RETRIES = 0, VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0; - uint8_t packet_retries, sync; - uint16_t buffer_next_index; - uint32_t bytes_received; - StreamState stream_state = StreamState::PACKET_RESET; -}; - -extern BinaryStream binaryStream[NUM_SERIAL]; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.cpp deleted file mode 100644 index 64c052269b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.cpp +++ /dev/null @@ -1,216 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(BLTOUCH) - -#include "bltouch.h" - -BLTouch bltouch; - -bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain - -#include "../module/servo.h" - -void stop(); - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../core/debug_out.h" - -bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) { - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch Command :", cmd); - MOVE_SERVO(Z_PROBE_SERVO_NR, cmd); - safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay - return triggered(); -} - -// Init the class and device. Call from setup(). -void BLTouch::init(const bool set_voltage/*=false*/) { - // Voltage Setting (if enabled). At every Marlin initialization: - // BLTOUCH < V3.0 and clones: This will be ignored by the probe - // BLTOUCH V3.0: SET_5V_MODE or SET_OD_MODE (if enabled). - // OD_MODE is the default on power on, but setting it does not hurt - // This mode will stay active until manual SET_OD_MODE or power cycle - // BLTOUCH V3.1: SET_5V_MODE or SET_OD_MODE (if enabled). - // At power on, the probe will default to the eeprom settings configured by the user - _reset(); - _stow(); - - #if ENABLED(BLTOUCH_FORCE_MODE_SET) - - constexpr bool should_set = true; - - #else - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR("last_written_mode - ", (int)last_written_mode); - DEBUG_ECHOLNPGM("config mode - " - #if ENABLED(BLTOUCH_SET_5V_MODE) - "BLTOUCH_SET_5V_MODE" - #else - "OD" - #endif - ); - } - - const bool should_set = last_written_mode != (false - #if ENABLED(BLTOUCH_SET_5V_MODE) - || true - #endif - ); - - #endif - - if (should_set && set_voltage) - mode_conv_proc((false - #if ENABLED(BLTOUCH_SET_5V_MODE) - || true - #endif - )); -} - -void BLTouch::clear() { - _reset(); // RESET or RESET_SW will clear an alarm condition but... - // ...it will not clear a triggered condition in SW mode when the pin is currently up - // ANTClabs <-- CODE ERROR - _stow(); // STOW will pull up the pin and clear any triggered condition unless it fails, don't care - _deploy(); // DEPLOY to test the probe. Could fail, don't care - _stow(); // STOW to be ready for meaningful work. Could fail, don't care -} - -bool BLTouch::triggered() { - return ( - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING - #else - READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING - #endif - ); -} - -bool BLTouch::deploy_proc() { - // Do a DEPLOY - 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_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_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 - - return true; // Tell our caller we goofed in case he cares to know - } - } - - // One of the recommended ANTClabs ways to probe, using SW MODE - #if ENABLED(BLTOUCH_FORCE_SW_MODE) - _set_SW_mode(); - #endif - - // Now the probe is ready to issue a 10ms pulse when the pin goes up. - // 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_ECHOLNPGM("bltouch.deploy_proc() end"); - - return false; // report success to caller -} - -bool BLTouch::stow_proc() { - // Do a STOW - 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. - // So even though we know a STOW will be ignored if an ALARM condition is active, we will STOW. - // Note: If the probe is deployed AND in an ALARM condition, this STOW will not pull up the pin - // and the ALARM condition will still be there. --> ANTClabs should change this behavior maybe - - // Attempt to STOW, wait for STOW_DELAY or ALARM - if (_stow_query_alarm()) { - // The stow might have failed - 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 - // an ALARM condition though. - // But one more STOW will catch that - // Last attempt to STOW - if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition: - - 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 - - return true; // Tell our caller we goofed in case he cares to know - } - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.stow_proc() end"); - - return false; // report success to caller -} - -bool BLTouch::status_proc() { - /** - * Return a TRUE for "YES, it is DEPLOYED" - * This function will ensure switch state is reset after execution - */ - - 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 - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("BLTouch is ", (int)tr); - - if (tr) _stow(); else _deploy(); // Turn off SW mode, reset any trigger, honor pin state - return !tr; -} - -void BLTouch::mode_conv_proc(const bool M5V) { - /** - * BLTOUCH pre V3.0 and clones: No reaction at all to this sequence apart from a DEPLOY -> STOW - * BLTOUCH V3.0: This will set the mode (twice) and sadly, a STOW is needed at the end, because of the deploy - * BLTOUCH V3.1: This will set the mode and store it in the eeprom. The STOW is not needed but does not hurt - */ - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("BLTouch Set Mode - ", (int)M5V); - _deploy(); - if (M5V) _set_5V_mode(); else _set_OD_mode(); - _mode_store(); - if (M5V) _set_5V_mode(); else _set_OD_mode(); - _stow(); - last_written_mode = M5V; -} - -#endif // BLTOUCH diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.h deleted file mode 100644 index 9f27962229..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/bltouch.h +++ /dev/null @@ -1,110 +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 - -#include "../inc/MarlinConfigPre.h" - -// BLTouch commands are sent as servo angles -typedef unsigned char BLTCommand; - -#define BLTOUCH_DEPLOY 10 -#define BLTOUCH_SW_MODE 60 -#define BLTOUCH_STOW 90 -#define BLTOUCH_SELFTEST 120 -#define BLTOUCH_MODE_STORE 130 -#define BLTOUCH_5V_MODE 140 -#define BLTOUCH_OD_MODE 150 -#define BLTOUCH_RESET 160 - -/** - * The following commands require different minimum delays. - * - * 500ms required for a reliable Reset. - * - * 750ms required for Deploy/Stow, otherwise the alarm state - * will not be seen until the following move command. - */ - -#ifndef BLTOUCH_SET5V_DELAY - #define BLTOUCH_SET5V_DELAY 150 -#endif -#ifndef BLTOUCH_SETOD_DELAY - #define BLTOUCH_SETOD_DELAY 150 -#endif -#ifndef BLTOUCH_MODE_STORE_DELAY - #define BLTOUCH_MODE_STORE_DELAY 150 -#endif -#ifndef BLTOUCH_DEPLOY_DELAY - #define BLTOUCH_DEPLOY_DELAY 750 -#endif -#ifndef BLTOUCH_STOW_DELAY - #define BLTOUCH_STOW_DELAY 750 -#endif -#ifndef BLTOUCH_RESET_DELAY - #define BLTOUCH_RESET_DELAY 500 -#endif - -class BLTouch { -public: - static void init(const bool set_voltage=false); - static bool last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain - - // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing - FORCE_INLINE static bool deploy() { return deploy_proc(); } - FORCE_INLINE static bool stow() { return stow_proc(); } - FORCE_INLINE static bool status() { return status_proc(); } - - // Native BLTouch commands ("Underscore"...), used in lcd menus and internally - FORCE_INLINE static void _reset() { command(BLTOUCH_RESET, BLTOUCH_RESET_DELAY); } - - FORCE_INLINE static void _selftest() { command(BLTOUCH_SELFTEST, BLTOUCH_DELAY); } - - FORCE_INLINE static void _set_SW_mode() { command(BLTOUCH_SW_MODE, BLTOUCH_DELAY); } - FORCE_INLINE static void _reset_SW_mode() { if (triggered()) _stow(); else _deploy(); } - - FORCE_INLINE static void _set_5V_mode() { command(BLTOUCH_5V_MODE, BLTOUCH_SET5V_DELAY); } - FORCE_INLINE static void _set_OD_mode() { command(BLTOUCH_OD_MODE, BLTOUCH_SETOD_DELAY); } - FORCE_INLINE static void _mode_store() { command(BLTOUCH_MODE_STORE, BLTOUCH_MODE_STORE_DELAY); } - - FORCE_INLINE static void _deploy() { command(BLTOUCH_DEPLOY, BLTOUCH_DEPLOY_DELAY); } - FORCE_INLINE static void _stow() { command(BLTOUCH_STOW, BLTOUCH_STOW_DELAY); } - - FORCE_INLINE static void mode_conv_5V() { mode_conv_proc(true); } - FORCE_INLINE static void mode_conv_OD() { mode_conv_proc(false); } - -private: - FORCE_INLINE static bool _deploy_query_alarm() { return command(BLTOUCH_DEPLOY, BLTOUCH_DEPLOY_DELAY); } - FORCE_INLINE static bool _stow_query_alarm() { return command(BLTOUCH_STOW, BLTOUCH_STOW_DELAY); } - - static void clear(); - static bool command(const BLTCommand cmd, const millis_t &ms); - static bool triggered(); - static bool deploy_proc(); - static bool stow_proc(); - static bool status_proc(); - static void mode_conv_proc(const bool M5V); -}; - -// Deploy/stow angles for use by servo.cpp / servo.h -#define BLTOUCH_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } - -extern BLTouch bltouch; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.cpp deleted file mode 100644 index a066815e85..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.cpp +++ /dev/null @@ -1,83 +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 . - * - */ -#include "../inc/MarlinConfig.h" - -#if ENABLED(CANCEL_OBJECTS) - -#include "cancel_object.h" -#include "../gcode/gcode.h" -#include "../lcd/ultralcd.h" - -CancelObject cancelable; - -int8_t CancelObject::object_count, // = 0 - CancelObject::active_object = -1; -uint32_t CancelObject::canceled; // = 0x0000 -bool CancelObject::skipping; // = false - -void CancelObject::set_active_object(const int8_t obj) { - active_object = obj; - if (WITHIN(obj, 0, 31)) { - if (obj >= object_count) object_count = obj + 1; - skipping = TEST(canceled, obj); - } - else - skipping = false; - - #if HAS_DISPLAY - if (active_object >= 0) - ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object + 1)); - else - ui.reset_status(); - #endif -} - -void CancelObject::cancel_object(const int8_t obj) { - if (WITHIN(obj, 0, 31)) { - SBI(canceled, obj); - if (obj == active_object) skipping = true; - } -} - -void CancelObject::uncancel_object(const int8_t obj) { - if (WITHIN(obj, 0, 31)) { - CBI(canceled, obj); - if (obj == active_object) skipping = false; - } -} - -void CancelObject::report() { - if (active_object >= 0) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Active Object: ", int(active_object)); - } - - if (canceled) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Canceled:"); - for (int i = 0; i < object_count; i++) - if (TEST(canceled, i)) { SERIAL_CHAR(' '); SERIAL_ECHO(i); } - SERIAL_EOL(); - } -} - -#endif // CANCEL_OBJECTS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.h deleted file mode 100644 index f32283b46d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/cancel_object.h +++ /dev/null @@ -1,41 +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 - -#include - -class CancelObject { -public: - static bool skipping; - static int8_t object_count, active_object; - static uint32_t canceled; - static void set_active_object(const int8_t obj); - static void cancel_object(const int8_t obj); - static void uncancel_object(const int8_t obj); - static void report(); - static inline bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } - static inline void clear_active_object() { set_active_object(-1); } - static inline void cancel_active_object() { cancel_object(active_object); } - static inline void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } -}; - -extern CancelObject cancelable; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.cpp deleted file mode 100644 index 8c58d8452a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.cpp +++ /dev/null @@ -1,91 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_CASE_LIGHT - -uint8_t case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; -bool case_light_on = CASE_LIGHT_DEFAULT_ON; - -#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #include "leds/leds.h" - LEDColor case_light_color = - #ifdef CASE_LIGHT_NEOPIXEL_COLOR - CASE_LIGHT_NEOPIXEL_COLOR - #else - { 255, 255, 255, 255 } - #endif - ; -#endif - -/** - * The following are needed because ARM chips ignore a "WRITE(CASE_LIGHT_PIN,x)" command to the pins that - * are directly controlled by the PWM module. In order to turn them off the brightness level needs to be - * set to off. Since we can't use the pwm register to save the last brightness level we need a variable - * to save it. - */ -uint8_t case_light_brightness_sav; // saves brighness info so can restore when "M355 S1" received -bool case_light_arg_flag; // flag to notify if S or P argument type - -#ifndef INVERT_CASE_LIGHT - #define INVERT_CASE_LIGHT false -#endif - -void update_case_light() { - - if (!(case_light_arg_flag && !case_light_on)) - case_light_brightness_sav = case_light_brightness; // save brightness except if this is an S0 argument - if (case_light_arg_flag && case_light_on) - case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 argument - - const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i; - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) - - leds.set_color( - MakeLEDColor(case_light_color.r, case_light_color.g, case_light_color.b, case_light_color.w, n10ct), - false - ); - - #else // !CASE_LIGHT_USE_NEOPIXEL - - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - if (PWM_PIN(CASE_LIGHT_PIN)) - analogWrite(pin_t(CASE_LIGHT_PIN), - #if CASE_LIGHT_MAX_PWM == 255 - n10ct - #else - map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM) - #endif - ); - else - #endif - { - const bool s = case_light_on ? !INVERT_CASE_LIGHT : INVERT_CASE_LIGHT; - WRITE(CASE_LIGHT_PIN, s ? HIGH : LOW); - } - - #endif // !CASE_LIGHT_USE_NEOPIXEL -} - -#endif // HAS_CASE_LIGHT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.h deleted file mode 100644 index 322898d065..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/caselight.h +++ /dev/null @@ -1,29 +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 - -extern uint8_t case_light_brightness; -extern bool case_light_on; -extern uint8_t case_light_brightness_sav; // saves brighness info when case_light_on is false -extern bool case_light_arg_flag; // flag to notify if S or P argument type - -void update_case_light(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.cpp deleted file mode 100644 index e04014ba60..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.cpp +++ /dev/null @@ -1,41 +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 . - * - */ -#include "../inc/MarlinConfig.h" - -#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - -#if !PIN_EXISTS(CLOSED_LOOP_ENABLE) || !PIN_EXISTS(CLOSED_LOOP_MOVE_COMPLETE) - #error "CLOSED_LOOP_ENABLE_PIN and CLOSED_LOOP_MOVE_COMPLETE_PIN are required for EXTERNAL_CLOSED_LOOP_CONTROLLER." -#endif - -#include "closedloop.h" - -void init_closedloop() { - OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, LOW); - SET_INPUT_PULLUP(CLOSED_LOOP_MOVE_COMPLETE_PIN); -} - -void set_closedloop(const byte val) { - OUT_WRITE(CLOSED_LOOP_ENABLE_PIN, val); -} - -#endif // EXTERNAL_CLOSED_LOOP_CONTROLLER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.h deleted file mode 100644 index 952d3dcbec..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/closedloop.h +++ /dev/null @@ -1,25 +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 - -void init_closedloop(); -void set_closedloop(const byte val); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.cpp deleted file mode 100644 index 7e4312bab1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.cpp +++ /dev/null @@ -1,81 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(USE_CONTROLLER_FAN) - -#include "../module/stepper/indirection.h" -#include "../module/temperature.h" - -uint8_t controllerfan_speed; - -void controllerfan_update() { - static millis_t lastMotorOn = 0, // Last time a motor was turned on - nextMotorCheck = 0; // Last time the state was checked - const millis_t ms = millis(); - if (ELAPSED(ms, nextMotorCheck)) { - nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s - - const bool xory = X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON; - - // If any of the drivers or the bed are enabled... - if (xory || Z_ENABLE_READ() == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.temp_bed.soft_pwm_amount > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ() == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ() == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ() == Z_ENABLE_ON - #endif - #if HAS_Z3_ENABLE - || Z3_ENABLE_READ() == Z_ENABLE_ON - #endif - #if E_STEPPERS - #define _OR_ENABLED_E(N) || E##N##_ENABLE_READ() == E_ENABLE_ON - REPEAT(E_STEPPERS, _OR_ENABLED_E) - #endif - ) { - lastMotorOn = ms; //... set time to NOW so the fan will turn on - } - - // Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds - controllerfan_speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : ( - #ifdef CONTROLLERFAN_SPEED_Z_ONLY - xory ? CONTROLLERFAN_SPEED : CONTROLLERFAN_SPEED_Z_ONLY - #else - CONTROLLERFAN_SPEED - #endif - ); - - // Allow digital or PWM fan output (see M42 handling) - WRITE(CONTROLLER_FAN_PIN, controllerfan_speed); - analogWrite(pin_t(CONTROLLER_FAN_PIN), controllerfan_speed); - } -} - -#endif // USE_CONTROLLER_FAN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.h deleted file mode 100644 index d68393a4b0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/controllerfan.h +++ /dev/null @@ -1,24 +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 - -void controllerfan_update(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.cpp deleted file mode 100644 index eb3a67de2a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************** - * - * External DAC for Alligator Board - * - ****************************************************************/ - -#include "../../inc/MarlinConfig.h" - -#if MB(ALLIGATOR) - -#include "dac_dac084s085.h" - -#include "../../Marlin.h" -#include "../../module/stepper.h" -#include "../../HAL/shared/Delay.h" - -dac084s085::dac084s085() { } - -void dac084s085::begin() { - uint8_t externalDac_buf[] = { 0x20, 0x00 }; // all off - - // All SPI chip-select HIGH - SET_OUTPUT(DAC0_SYNC); - #if EXTRUDERS > 1 - SET_OUTPUT(DAC1_SYNC); - #endif - cshigh(); - spiBegin(); - - //init onboard DAC - DELAY_US(2); - WRITE(DAC0_SYNC, LOW); - DELAY_US(2); - WRITE(DAC0_SYNC, HIGH); - DELAY_US(2); - WRITE(DAC0_SYNC, LOW); - - spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf)); - WRITE(DAC0_SYNC, HIGH); - - #if EXTRUDERS > 1 - //init Piggy DAC - DELAY_US(2); - WRITE(DAC1_SYNC, LOW); - DELAY_US(2); - WRITE(DAC1_SYNC, HIGH); - DELAY_US(2); - WRITE(DAC1_SYNC, LOW); - - spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf)); - WRITE(DAC1_SYNC, HIGH); - #endif - - return; -} - -void dac084s085::setValue(const uint8_t channel, const uint8_t value) { - if (channel >= 7) return; // max channel (X,Y,Z,E0,E1,E2,E3) - - const uint8_t externalDac_buf[] = { - 0x10 | ((channel > 3 ? 7 : 3) - channel << 6) | (value >> 4), - 0x00 | (value << 4) - }; - - // All SPI chip-select HIGH - cshigh(); - - if (channel > 3) { // DAC Piggy E1,E2,E3 - WRITE(DAC1_SYNC, LOW); - DELAY_US(2); - WRITE(DAC1_SYNC, HIGH); - DELAY_US(2); - WRITE(DAC1_SYNC, LOW); - } - else { // DAC onboard X,Y,Z,E0 - WRITE(DAC0_SYNC, LOW); - DELAY_US(2); - WRITE(DAC0_SYNC, HIGH); - DELAY_US(2); - WRITE(DAC0_SYNC, LOW); - } - - DELAY_US(2); - spiSend(SPI_CHAN_DAC, externalDac_buf, COUNT(externalDac_buf)); -} - -void dac084s085::cshigh() { - WRITE(DAC0_SYNC, HIGH); - #if EXTRUDERS > 1 - WRITE(DAC1_SYNC, HIGH); - #endif - WRITE(SPI_EEPROM1_CS, HIGH); - WRITE(SPI_EEPROM2_CS, HIGH); - WRITE(SPI_FLASH_CS, HIGH); - WRITE(SS_PIN, HIGH); -} - -#endif // MB(ALLIGATOR) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.h deleted file mode 100644 index 09d5bb857d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_dac084s085.h +++ /dev/null @@ -1,31 +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 - -class dac084s085 { - public: - dac084s085(); - static void begin(); - static void setValue(const uint8_t channel, const uint8_t value); - private: - static void cshigh(); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.cpp deleted file mode 100644 index 19f8d5f643..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.cpp +++ /dev/null @@ -1,152 +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 . - * - */ - -/** - * mcp4728.cpp - Arduino library for MicroChip MCP4728 I2C D/A converter - * - * For implementation details, please take a look at the datasheet: - * http://ww1.microchip.com/downloads/en/DeviceDoc/22187a.pdf - * - * For discussion and feedback, please go to: - * http://arduino.cc/forum/index.php/topic,51842.0.html - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - -#include "dac_mcp4728.h" - -xyze_uint_t mcp4728_values; - -/** - * Begin I2C, get current values (input register and eeprom) of mcp4728 - */ -void mcp4728_init() { - Wire.begin(); - Wire.requestFrom(int(DAC_DEV_ADDRESS), 24); - while (Wire.available()) { - char deviceID = Wire.read(), - hiByte = Wire.read(), - loByte = Wire.read(); - - if (!(deviceID & 0x08)) - mcp4728_values[(deviceID & 0x30) >> 4] = word((hiByte & 0x0F), loByte); - } -} - -/** - * Write input resister value to specified channel using fastwrite method. - * Channel : 0-3, Values : 0-4095 - */ -uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value) { - mcp4728_values[channel] = value; - return mcp4728_fastWrite(); -} - -/** - * Write all input resistor values to EEPROM using SequencialWrite method. - * This will update both input register and EEPROM value - * This will also write current Vref, PowerDown, Gain settings to EEPROM - */ -uint8_t mcp4728_eepromWrite() { - Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); - Wire.write(SEQWRITE); - LOOP_XYZE(i) { - Wire.write(DAC_STEPPER_VREF << 7 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Write Voltage reference setting to all input regiters - */ -uint8_t mcp4728_setVref_all(const uint8_t value) { - Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); - Wire.write(VREFWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} -/** - * Write Gain setting to all input regiters - */ -uint8_t mcp4728_setGain_all(const uint8_t value) { - Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); - Wire.write(GAINWRITE | (value ? 0x0F : 0x00)); - return Wire.endTransmission(); -} - -/** - * Return Input Register value - */ -uint16_t mcp4728_getValue(const uint8_t channel) { return mcp4728_values[channel]; } - -#if 0 -/** - * Steph: Might be useful in the future - * Return Vout - */ -uint16_t mcp4728_getVout(const uint8_t channel) { - const uint32_t vref = 2048, - vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; - return _MIN(vOut, defaultVDD); -} -#endif - -/** - * Returns DAC values as a 0-100 percentage of drive strength - */ -uint8_t mcp4728_getDrvPct(const uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); } - -/** - * Receives all Drive strengths as 0-100 percent values, updates - * DAC Values array and calls fastwrite to update the DAC. - */ -void mcp4728_setDrvPct(xyze_uint8_t &pct) { - mcp4728_values *= 0.01 * pct * (DAC_STEPPER_MAX); - mcp4728_fastWrite(); -} - -/** - * FastWrite input register values - All DAC ouput update. refer to DATASHEET 5.6.1 - * DAC Input and PowerDown bits update. - * No EEPROM update - */ -uint8_t mcp4728_fastWrite() { - Wire.beginTransmission(I2C_ADDRESS(DAC_DEV_ADDRESS)); - LOOP_XYZE(i) { - Wire.write(highByte(mcp4728_values[i])); - Wire.write(lowByte(mcp4728_values[i])); - } - return Wire.endTransmission(); -} - -/** - * Common function for simple general commands - */ -uint8_t mcp4728_simpleCommand(const byte simpleCommand) { - Wire.beginTransmission(I2C_ADDRESS(GENERALCALL)); - Wire.write(simpleCommand); - return Wire.endTransmission(); -} - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.h deleted file mode 100644 index 92e28ffb2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/dac_mcp4728.h +++ /dev/null @@ -1,59 +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 - -/** - * Arduino library for MicroChip MCP4728 I2C D/A converter. - */ - -#include "../../core/types.h" - -#include - -#define defaultVDD DAC_STEPPER_MAX //was 5000 but differs with internal Vref -#define BASE_ADDR 0x60 -#define RESET 0b00000110 -#define WAKE 0b00001001 -#define UPDATE 0b00001000 -#define MULTIWRITE 0b01000000 -#define SINGLEWRITE 0b01011000 -#define SEQWRITE 0b01010000 -#define VREFWRITE 0b10000000 -#define GAINWRITE 0b11000000 -#define POWERDOWNWRITE 0b10100000 -#define GENERALCALL 0b00000000 -#define GAINWRITE 0b11000000 - -// This is taken from the original lib, makes it easy to edit if needed -// DAC_OR_ADDRESS defined in pins_BOARD.h file -#define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS) - -void mcp4728_init(); -uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value); -uint8_t mcp4728_eepromWrite(); -uint8_t mcp4728_setVref_all(const uint8_t value); -uint8_t mcp4728_setGain_all(const uint8_t value); -uint16_t mcp4728_getValue(const uint8_t channel); -uint8_t mcp4728_fastWrite(); -uint8_t mcp4728_simpleCommand(const byte simpleCommand); -uint8_t mcp4728_getDrvPct(const uint8_t channel); -void mcp4728_setDrvPct(xyze_uint8_t &pct); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.cpp deleted file mode 100644 index 565b62a392..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.cpp +++ /dev/null @@ -1,104 +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 . - * - */ - -/** - * stepper_dac.cpp - To set stepper current via DAC - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(DAC_STEPPER_CURRENT) - -#include "stepper_dac.h" - -bool dac_present = false; -constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; -xyze_uint8_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT; - -int dac_init() { - #if PIN_EXISTS(DAC_DISABLE) - OUT_WRITE(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC - #endif - - mcp4728_init(); - - if (mcp4728_simpleCommand(RESET)) return -1; - - dac_present = true; - - mcp4728_setVref_all(DAC_STEPPER_VREF); - mcp4728_setGain_all(DAC_STEPPER_GAIN); - - if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) { - mcp4728_setDrvPct(dac_channel_pct); - mcp4728_eepromWrite(); - } - - return 0; -} - -void dac_current_percent(uint8_t channel, float val) { - if (!dac_present) return; - - NOMORE(val, 100); - - mcp4728_analogWrite(dac_order[channel], val * 0.01 * (DAC_STEPPER_MAX)); - mcp4728_simpleCommand(UPDATE); -} - -void dac_current_raw(uint8_t channel, uint16_t val) { - if (!dac_present) return; - - NOMORE(val, DAC_STEPPER_MAX); - - mcp4728_analogWrite(dac_order[channel], val); - mcp4728_simpleCommand(UPDATE); -} - -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(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } -void dac_current_set_percents(xyze_uint8_t &pct) { - LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; - mcp4728_setDrvPct(dac_channel_pct); -} - -void dac_print_values() { - if (!dac_present) return; - - SERIAL_ECHO_MSG("Stepper current values in % (Amps):"); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR( - " X:", dac_perc(X_AXIS), " (", dac_amps(X_AXIS), ")" - " Y:", dac_perc(Y_AXIS), " (", dac_amps(Y_AXIS), ")" - " Z:", dac_perc(Z_AXIS), " (", dac_amps(Z_AXIS), ")" - " E:", dac_perc(E_AXIS), " (", dac_amps(E_AXIS), ")" - ); -} - -void dac_commit_eeprom() { - if (!dac_present) return; - mcp4728_eepromWrite(); -} - -#endif // DAC_STEPPER_CURRENT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.h deleted file mode 100644 index 3496ebec48..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/dac/stepper_dac.h +++ /dev/null @@ -1,36 +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_dac.h - To set stepper current via DAC - */ - -#include "dac_mcp4728.h" - -int dac_init(); -void dac_current_percent(uint8_t channel, float val); -void dac_current_raw(uint8_t channel, uint16_t val); -void dac_print_values(); -void dac_commit_eeprom(); -uint8_t dac_current_get_percent(AxisEnum axis); -void dac_current_set_percents(xyze_uint8_t &pct); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot.h deleted file mode 100644 index 03c9854153..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot.h +++ /dev/null @@ -1,25 +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 - -void digipot_i2c_set_current(const uint8_t channel, const float current); -void digipot_i2c_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4018.cpp deleted file mode 100644 index 86eeab63b4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ /dev/null @@ -1,103 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018) - -#include "Stream.h" -#include "utility/twi.h" -#include //https://github.com/stawel/SlowSoftI2CMaster - -// Settings for the I2C based DIGIPOT (MCP4018) based on WT150 - -#define DIGIPOT_A4988_Rsx 0.250 -#define DIGIPOT_A4988_Vrefmax 1.666 -#define DIGIPOT_A4988_MAX_VALUE 127 - -#define DIGIPOT_A4988_Itripmax(Vref) ((Vref)/(8.0*DIGIPOT_A4988_Rsx)) - -#define DIGIPOT_A4988_FACTOR ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax)) -#define DIGIPOT_A4988_MAX_CURRENT 2.0 - -static byte current_to_wiper(const float current) { - const int16_t value = ceil(float(DIGIPOT_A4988_FACTOR) * current); - return byte(constrain(value, 0, DIGIPOT_A4988_MAX_VALUE)); -} - -const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = { - DIGIPOTS_I2C_SDA_X - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , DIGIPOTS_I2C_SDA_Y - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , DIGIPOTS_I2C_SDA_Z - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , DIGIPOTS_I2C_SDA_E0 - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , DIGIPOTS_I2C_SDA_E1 - #endif - #endif - #endif - #endif -}; - -static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { - SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL } - #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL } - #endif - #endif - #endif - #endif -}; - -static void i2c_send(const uint8_t channel, const byte v) { - if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) { - pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS_A) << 1) | I2C_WRITE); - pots[channel].i2c_write(v); - pots[channel].i2c_stop(); - } -} - -// This is for the MCP4018 I2C based digipot -void digipot_i2c_set_current(const uint8_t channel, const float current) { - i2c_send(channel, current_to_wiper(_MIN(_MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT)))); -} - -void digipot_i2c_init() { - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - - for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++) - pots[i].i2c_init(); - - // setup initial currents as defined in Configuration_adv.h - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C && DIGIPOT_MCP4018 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4451.cpp deleted file mode 100644 index b04406f4be..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ /dev/null @@ -1,90 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018) - -#include "Stream.h" -#include - -#if MB(MKS_SBASE) - #include "digipot_mcp4451_I2C_routines.h" -#endif - -// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro -#if MB(5DPRINT) - #define DIGIPOT_I2C_FACTOR 117.96 - #define DIGIPOT_I2C_MAX_CURRENT 1.736 -#elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) - #define DIGIPOT_I2C_FACTOR 113.5 - #define DIGIPOT_I2C_MAX_CURRENT 2.0 -#else - #define DIGIPOT_I2C_FACTOR 106.7 - #define DIGIPOT_I2C_MAX_CURRENT 2.5 -#endif - -static byte current_to_wiper(const float current) { - return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current)))); -} - -static void i2c_send(const byte addr, const byte a, const byte b) { - #if MB(MKS_SBASE) - digipot_mcp4451_start(addr); - digipot_mcp4451_send_byte(a); - digipot_mcp4451_send_byte(b); - #else - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(a); - Wire.write(b); - Wire.endTransmission(); - #endif -} - -// This is for the MCP4451 I2C based digipot -void digipot_i2c_set_current(const uint8_t channel, const float current) { - // these addresses are specific to Azteeg X3 Pro, can be set to others, - // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 - const byte addr = channel < 4 ? DIGIPOT_I2C_ADDRESS_A : DIGIPOT_I2C_ADDRESS_B; // channel 0-3 vs 4-7 - - // Initial setup - i2c_send(addr, 0x40, 0xFF); - i2c_send(addr, 0xA0, 0xFF); - - // 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))); -} - -void digipot_i2c_init() { - #if MB(MKS_SBASE) - digipot_mcp4451_init(); - #else - Wire.begin(); - #endif - // setup initial currents as defined in Configuration_adv.h - static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS; - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) - digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i])); -} - -#endif // DIGIPOT_I2C diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.cpp deleted file mode 100644 index 97ab967028..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.cpp +++ /dev/null @@ -1,44 +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 . - * - */ - -/** - * emergency_parser.cpp - Intercept special commands directly in the serial stream - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(EMERGENCY_PARSER) - -#include "emergency_parser.h" - -// Static data members -bool EmergencyParser::killed_by_M112, // = false - EmergencyParser::enabled; - -#if ENABLED(HOST_PROMPT_SUPPORT) - uint8_t EmergencyParser::M876_reason; // = 0 -#endif - -// Global instance -EmergencyParser emergency_parser; - -#endif // EMERGENCY_PARSER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.h deleted file mode 100644 index e9ce0f6645..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/emergency_parser.h +++ /dev/null @@ -1,190 +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 - -/** - * emergency_parser.h - Intercept special commands directly in the serial stream - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "host_actions.h" -#endif - -// External references -extern bool wait_for_user, wait_for_heatup; -void quickstop_stepper(); - -class EmergencyParser { - -public: - - // Currently looking for: M108, M112, M410, M876 - enum State : char { - EP_RESET, - EP_N, - EP_M, - EP_M1, - EP_M10, - EP_M108, - EP_M11, - EP_M112, - EP_M4, - EP_M41, - EP_M410, - #if ENABLED(HOST_PROMPT_SUPPORT) - EP_M8, - EP_M87, - EP_M876, - EP_M876S, - EP_M876SN, - #endif - EP_IGNORE // to '\n' - }; - - static bool killed_by_M112; - - #if ENABLED(HOST_PROMPT_SUPPORT) - static uint8_t M876_reason; - #endif - - EmergencyParser() { enable(); } - - FORCE_INLINE static void enable() { enabled = true; } - - FORCE_INLINE static void disable() { enabled = false; } - - FORCE_INLINE static void update(State &state, const uint8_t c) { - switch (state) { - case EP_RESET: - switch (c) { - case ' ': break; - case 'N': state = EP_N; break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_N: - switch (c) { - case '0': case '1': case '2': - case '3': case '4': case '5': - case '6': case '7': case '8': - case '9': case '-': case ' ': break; - case 'M': state = EP_M; break; - default: state = EP_IGNORE; - } - break; - - case EP_M: - switch (c) { - case ' ': break; - case '1': state = EP_M1; break; - case '4': state = EP_M4; break; - #if ENABLED(HOST_PROMPT_SUPPORT) - case '8': state = EP_M8; break; - #endif - default: state = EP_IGNORE; - } - break; - - case EP_M1: - switch (c) { - case '0': state = EP_M10; break; - case '1': state = EP_M11; break; - default: state = EP_IGNORE; - } - break; - - case EP_M10: - state = (c == '8') ? EP_M108 : EP_IGNORE; - break; - - case EP_M11: - state = (c == '2') ? EP_M112 : EP_IGNORE; - break; - - case EP_M4: - state = (c == '1') ? EP_M41 : EP_IGNORE; - break; - - case EP_M41: - state = (c == '0') ? EP_M410 : EP_IGNORE; - break; - - #if ENABLED(HOST_PROMPT_SUPPORT) - case EP_M8: - state = (c == '7') ? EP_M87 : EP_IGNORE; - break; - - case EP_M87: - state = (c == '6') ? EP_M876 : EP_IGNORE; - break; - - case EP_M876: - switch (c) { - case ' ': break; - case 'S': state = EP_M876S; break; - default: state = EP_IGNORE; break; - } - break; - - case EP_M876S: - switch (c) { - case ' ': break; - case '0': case '1': case '2': - case '3': case '4': case '5': - case '6': case '7': case '8': - case '9': - state = EP_M876SN; - M876_reason = (uint8_t)(c - '0'); - break; - } - break; - #endif - - case EP_IGNORE: - if (c == '\n') state = EP_RESET; - break; - - default: - if (c == '\n') { - if (enabled) switch (state) { - case EP_M108: wait_for_user = wait_for_heatup = false; break; - case EP_M112: killed_by_M112 = true; break; - case EP_M410: quickstop_stepper(); break; - #if ENABLED(HOST_PROMPT_SUPPORT) - case EP_M876SN: host_response_handler(M876_reason); break; - #endif - default: break; - } - state = EP_RESET; - } - } - } - -private: - static bool enabled; -}; - -extern EmergencyParser emergency_parser; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.cpp deleted file mode 100644 index 6c7b56ac54..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.cpp +++ /dev/null @@ -1,55 +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 . - * - */ - -/** - * feature/pause.cpp - Pause feature support functions - * This may be combined with related G-codes if features are consolidated. - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_FANMUX - -#include "fanmux.h" - -void fanmux_switch(const uint8_t e) { - WRITE(FANMUX0_PIN, TEST(e, 0) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX1) - WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW); - #if PIN_EXISTS(FANMUX2) - WRITE(FANMUX2_PIN, TEST(e, 2) ? HIGH : LOW); - #endif - #endif -} - -void fanmux_init() { - SET_OUTPUT(FANMUX0_PIN); - #if PIN_EXISTS(FANMUX1) - SET_OUTPUT(FANMUX1_PIN); - #if PIN_EXISTS(FANMUX2) - SET_OUTPUT(FANMUX2_PIN); - #endif - #endif - fanmux_switch(0); -} - -#endif // HAS_FANMUX diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.h deleted file mode 100644 index 492b9fd785..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fanmux.h +++ /dev/null @@ -1,29 +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 - -/** - * feature/fanmux.h - Cooling Fan Multiplexer support functions - */ - -extern void fanmux_switch(const uint8_t e); -extern void fanmux_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.cpp deleted file mode 100644 index fb685bddc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.cpp +++ /dev/null @@ -1,49 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - -#include "filwidth.h" - -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_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.h deleted file mode 100644 index 7255428fdf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/filwidth.h +++ /dev/null @@ -1,120 +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 - -#include "../inc/MarlinConfig.h" -#include "../module/planner.h" -#include "../module/thermistor/thermistors.h" - -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(float(MAX_RAW_THERMISTOR_VALUE)); } - 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_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.cpp deleted file mode 100644 index 896e602950..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.cpp +++ /dev/null @@ -1,216 +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 . - * - */ - -/** - * fwretract.cpp - Implement firmware-based retraction - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(FWRETRACT) - -#include "fwretract.h" - -FWRetract fwretract; // Single instance - this calls the constructor - -#include "../module/motion.h" -#include "../module/planner.h" -#include "../module/stepper.h" - -#if ENABLED(RETRACT_SYNC_MIXING) - #include "mixing.h" -#endif - -// private: - -#if EXTRUDERS > 1 - bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted -#endif - -// public: - -fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F W R - -#if ENABLED(FWRETRACT_AUTORETRACT) - bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch -#endif - -bool FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted - -float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner - FWRetract::current_hop; - -void FWRetract::reset() { - #if ENABLED(FWRETRACT_AUTORETRACT) - autoretract_enabled = false; - #endif - settings.retract_length = RETRACT_LENGTH; - settings.retract_feedrate_mm_s = RETRACT_FEEDRATE; - settings.retract_zraise = RETRACT_ZRAISE; - settings.retract_recover_extra = RETRACT_RECOVER_LENGTH; - settings.retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; - settings.swap_retract_length = RETRACT_LENGTH_SWAP; - settings.swap_retract_recover_extra = RETRACT_RECOVER_LENGTH_SWAP; - settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; - current_hop = 0.0; - - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - retracted[i] = false; - #if EXTRUDERS > 1 - retracted_swap[i] = false; - #endif - current_retract[i] = 0.0; - } -} - -/** - * Retract or recover according to firmware settings - * - * This function handles retract/recover moves for G10 and G11, - * plus auto-retract moves sent from G0/G1 when E-only moves are done. - * - * To simplify the logic, doubled retract/recover moves are ignored. - * - * Note: Auto-retract will apply the set Z hop in addition to any Z hop - * included in the G-code. Use M207 Z0 to to prevent double hop. - */ -void FWRetract::retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping /* =false */ - #endif -) { - // Prevent two retracts or recovers in a row - if (retracted[active_extruder] == retracting) return; - - // Prevent two swap-retract or recovers in a row - #if EXTRUDERS > 1 - // Allow G10 S1 only after G11 - if (swapping && retracted_swap[active_extruder] == retracting) return; - // G11 priority to recover the long retract if activated - if (!retracting) swapping = retracted_swap[active_extruder]; - #else - constexpr bool swapping = false; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR( - "retracting ", retracting, - " swapping ", swapping, - " active extruder ", active_extruder - ); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position.z ", current_position.z); - SERIAL_ECHOLNPAIR("current_position.e ", current_position.e); - SERIAL_ECHOLNPAIR("current_hop ", current_hop); - //*/ - - const float base_retract = ( - (swapping ? settings.swap_retract_length : settings.retract_length) - #if ENABLED(RETRACT_SYNC_MIXING) - * (MIXING_STEPPERS) - #endif - ); - - // The current position will be the destination for E and Z moves - destination = current_position; - - #if ENABLED(RETRACT_SYNC_MIXING) - const uint8_t old_mixing_tool = mixer.get_current_vtool(); - 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 - 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 - ); - - // Is a Z hop set, and has the hop not yet been done? - 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; - // 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) { - current_position.e -= 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; - - 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_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 - - retracted[active_extruder] = retracting; // Active extruder now retracted / recovered - - // If swap retract/recover update the retracted_swap flag too - #if EXTRUDERS > 1 - if (swapping) retracted_swap[active_extruder] = retracting; - #endif - - /* // debugging - SERIAL_ECHOLNPAIR("retracting ", retracting); - SERIAL_ECHOLNPAIR("swapping ", swapping); - SERIAL_ECHOLNPAIR("active_extruder ", active_extruder); - for (uint8_t i = 0; i < EXTRUDERS; ++i) { - SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]); - #if EXTRUDERS > 1 - SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); - #endif - } - SERIAL_ECHOLNPAIR("current_position.z ", current_position.z); - SERIAL_ECHOLNPAIR("current_position.e ", current_position.e); - SERIAL_ECHOLNPAIR("current_hop ", current_hop); - //*/ -} - -#endif // FWRETRACT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.h deleted file mode 100644 index 374667513d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/fwretract.h +++ /dev/null @@ -1,86 +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 - -/** - * fwretract.h - Define firmware-based retraction interface - */ - -#include "../inc/MarlinConfigPre.h" - -typedef struct { - 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; - -#if ENABLED(FWRETRACT) - -class FWRetract { -private: - #if EXTRUDERS > 1 - static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted - #endif - -public: - static fwretract_settings_t settings; - - #if ENABLED(FWRETRACT_AUTORETRACT) - static bool autoretract_enabled; // M209 S - Autoretract switch - #else - static constexpr bool autoretract_enabled = false; - #endif - - static bool retracted[EXTRUDERS]; // Which extruders are currently retracted - static float current_retract[EXTRUDERS], // Retract value used by planner - current_hop; // Hop value used by planner - - FWRetract() { reset(); } - - static void reset(); - - static void refresh_autoretract() { - LOOP_L_N(i, EXTRUDERS) retracted[i] = false; - } - - static void enable_autoretract(const bool enable) { - #if ENABLED(FWRETRACT_AUTORETRACT) - autoretract_enabled = enable; - refresh_autoretract(); - #endif - } - - static void retract(const bool retracting - #if EXTRUDERS > 1 - , bool swapping = false - #endif - ); -}; - -extern FWRetract fwretract; - -#endif // FWRETRACT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.cpp deleted file mode 100644 index 30ec8bfb1d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.cpp +++ /dev/null @@ -1,176 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(HOST_ACTION_COMMANDS) - -#include "host_actions.h" - -//#define DEBUG_HOST_ACTIONS - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "pause.h" - #include "../gcode/queue.h" -#endif - -#if HAS_FILAMENT_SENSOR - #include "runout.h" -#endif - -void host_action(const char * const pstr, const bool eol) { - SERIAL_ECHOPGM("//action:"); - serialprintPGM(pstr); - if (eol) SERIAL_EOL(); -} - -#ifdef ACTION_ON_KILL - void host_action_kill() { host_action(PSTR(ACTION_ON_KILL)); } -#endif -#ifdef ACTION_ON_PAUSE - void host_action_pause(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSE), eol); } -#endif -#ifdef ACTION_ON_PAUSED - void host_action_paused(const bool eol/*=true*/) { host_action(PSTR(ACTION_ON_PAUSED), eol); } -#endif -#ifdef ACTION_ON_RESUME - void host_action_resume() { host_action(PSTR(ACTION_ON_RESUME)); } -#endif -#ifdef ACTION_ON_RESUMED - void host_action_resumed() { host_action(PSTR(ACTION_ON_RESUMED)); } -#endif -#ifdef ACTION_ON_CANCEL - void host_action_cancel() { host_action(PSTR(ACTION_ON_CANCEL)); } -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - - const char CONTINUE_STR[] PROGMEM = "Continue"; - - #if HAS_RESUME_CONTINUE - extern bool wait_for_user; - #endif - - PromptReason host_prompt_reason = PROMPT_NOT_DEFINED; - - void host_action_notify(const char * const message) { - host_action(PSTR("notification "), false); - serialprintPGM(message); - SERIAL_EOL(); - } - - void host_action_prompt(const char * const ptype, const bool eol=true) { - host_action(PSTR("prompt_"), false); - serialprintPGM(ptype); - if (eol) SERIAL_EOL(); - } - - void host_action_prompt_plus(const char * const ptype, const char * const pstr, const bool eol=true) { - host_action_prompt(ptype, false); - SERIAL_CHAR(' '); - serialprintPGM(pstr); - if (eol) SERIAL_EOL(); - } - void host_action_prompt_begin(const char * const pstr, const bool eol/*=true*/) { host_action_prompt_plus(PSTR("begin"), pstr, eol); } - void host_action_prompt_button(const char * const pstr) { host_action_prompt_plus(PSTR("button"), pstr); } - void host_action_prompt_end() { host_action_prompt(PSTR("end")); } - void host_action_prompt_show() { host_action_prompt(PSTR("show")); } - void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const pbtn/*=nullptr*/) { - host_prompt_reason = reason; - host_action_prompt_end(); - host_action_prompt_begin(pstr); - if (pbtn) host_action_prompt_button(pbtn); - host_action_prompt_show(); - } - - inline void say_m876_response(const char * const pstr) { - SERIAL_ECHOPGM("M876 Responding PROMPT_"); - serialprintPGM(pstr); - SERIAL_EOL(); - } - - void host_response_handler(const uint8_t response) { - #ifdef DEBUG_HOST_ACTIONS - SERIAL_ECHOLNPAIR("M876 Handle Reason: ", host_prompt_reason); - SERIAL_ECHOLNPAIR("M876 Handle Response: ", response); - #endif - const char *msg = PSTR("UNKNOWN STATE"); - const PromptReason hpr = host_prompt_reason; - host_prompt_reason = PROMPT_NOT_DEFINED; - switch (hpr) { - case PROMPT_FILAMENT_RUNOUT: - msg = PSTR("FILAMENT_RUNOUT"); - if (response == 0) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; - #endif - host_action_prompt_end(); // Close current prompt - host_action_prompt_begin(PSTR("Paused")); - host_action_prompt_button(PSTR("Purge More")); - if (false - #if HAS_FILAMENT_SENSOR - || runout.filament_ran_out - #endif - ) - host_action_prompt_button(PSTR("DisableRunout")); - else { - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_button(CONTINUE_STR); - } - host_action_prompt_show(); - } - else if (response == 1) { - #if HAS_FILAMENT_SENSOR - if (runout.filament_ran_out) { - runout.enabled = false; - runout.reset(); - } - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; - #endif - } - break; - case PROMPT_USER_CONTINUE: - #if HAS_RESUME_CONTINUE - wait_for_user = false; - #endif - msg = PSTR("FILAMENT_RUNOUT_CONTINUE"); - break; - case PROMPT_PAUSE_RESUME: - msg = PSTR("LCD_PAUSE_RESUME"); - #if ENABLED(ADVANCED_PAUSE_FEATURE) - extern const char M24_STR[]; - queue.inject_P(M24_STR); - #endif - break; - case PROMPT_INFO: - msg = PSTR("GCODE_INFO"); - break; - default: break; - } - say_m876_response(msg); - } - -#endif // HOST_PROMPT_SUPPORT - -#endif // HOST_ACTION_COMMANDS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.h deleted file mode 100644 index 57af59eb2e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/host_actions.h +++ /dev/null @@ -1,73 +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 - -#include "../inc/MarlinConfigPre.h" - -void host_action(const char * const pstr, const bool eol=true); - -#ifdef ACTION_ON_KILL - void host_action_kill(); -#endif -#ifdef ACTION_ON_PAUSE - void host_action_pause(const bool eol=true); -#endif -#ifdef ACTION_ON_PAUSED - void host_action_paused(const bool eol=true); -#endif -#ifdef ACTION_ON_RESUME - void host_action_resume(); -#endif -#ifdef ACTION_ON_RESUMED - void host_action_resumed(); -#endif -#ifdef ACTION_ON_CANCEL - void host_action_cancel(); -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - - extern const char CONTINUE_STR[]; - - enum PromptReason : uint8_t { - PROMPT_NOT_DEFINED, - PROMPT_FILAMENT_RUNOUT, - PROMPT_USER_CONTINUE, - PROMPT_FILAMENT_RUNOUT_REHEAT, - PROMPT_PAUSE_RESUME, - PROMPT_INFO - }; - - extern PromptReason host_prompt_reason; - - void host_response_handler(const uint8_t response); - void host_action_notify(const char * const message); - void host_action_prompt_begin(const char * const pstr, const bool eol=true); - void host_action_prompt_button(const char * const pstr); - void host_action_prompt_end(); - void host_action_prompt_show(); - void host_prompt_do(const PromptReason type, const char * const pstr, const char * const pbtn=nullptr); - inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const pbtn=nullptr) { - if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, pbtn); - } - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.cpp deleted file mode 100644 index abfd77f438..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.cpp +++ /dev/null @@ -1,170 +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 . - * - */ - -/** - * 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_P(SP_X_STR, x.raw); - #endif - #if HAS_JOY_ADC_Y - SERIAL_ECHOPAIR_P(SP_Y_STR, y.raw); - #endif - #if HAS_JOY_ADC_Z - SERIAL_ECHOPAIR_P(SP_Z_STR, 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(xyz_float_t &norm_jog) { - // 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 &axis_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]) - axis_jog = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); - else if (raw < joy_limits[1]) - axis_jog = (raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value - // Map normal to jog value via quadratic relationship - axis_jog = SIGN(axis_jog) * sq(axis_jog); - } - }; - - #if HAS_JOY_ADC_X - static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS; - _normalize_joy(norm_jog.x, 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, 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, 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 - xyz_float_t norm_jog{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 - - // norm_jog values of [-1 .. 1] maps linearly to [-feedrate .. feedrate] - xyz_float_t move_dist{0}; - float hypot2 = 0; - LOOP_XYZ(i) if (norm_jog[i]) { - move_dist[i] = seg_time * norm_jog[i] * - #if ENABLED(EXTENSIBLE_UI) - MMM_TO_MMS(manual_feedrate_mm_m[i]); - #else - planner.settings.max_feedrate_mm_s[i]; - #endif - hypot2 += sq(move_dist[i]); - } - - if (!UNEAR_ZERO(hypot2)) { - current_position += move_dist; - 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_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.h deleted file mode 100644 index 50196374a7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/joystick.h +++ /dev/null @@ -1,55 +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 - -/** - * joystick.h - joystick input / jogging - */ - -#include "../inc/MarlinConfigPre.h" -#include "../core/types.h" -#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(xyz_float_t &norm_jog); - static void inject_jog_moves(); -}; - -extern Joystick joystick; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.cpp deleted file mode 100644 index 0c5b15befd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.cpp +++ /dev/null @@ -1,46 +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 . - * - */ - -/** - * blinkm.cpp - Control a BlinkM over i2c - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(BLINKM) - -#include "blinkm.h" -#include "leds.h" -#include - -void blinkm_set_led_color(const LEDColor &color) { - Wire.begin(); - Wire.beginTransmission(I2C_ADDRESS(0x09)); - Wire.write('o'); //to disable ongoing script, only needs to be used once - Wire.write('n'); - Wire.write(color.r); - Wire.write(color.g); - Wire.write(color.b); - Wire.endTransmission(); -} - -#endif // BLINKM diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.h deleted file mode 100644 index 231dbe810e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/blinkm.h +++ /dev/null @@ -1,31 +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 - -/** - * blinkm.h - Control a BlinkM over i2c - */ - -struct LEDColor; -typedef LEDColor LEDColor; - -void blinkm_set_led_color(const LEDColor &color); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.cpp deleted file mode 100644 index 210aeef092..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.cpp +++ /dev/null @@ -1,172 +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 . - * - */ - -/** - * leds.cpp - Marlin RGB LED general support - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_COLOR_LEDS - -#include "leds.h" - -#if ENABLED(BLINKM) - #include "blinkm.h" -#endif - -#if ENABLED(PCA9632) - #include "pca9632.h" -#endif - -#if ENABLED(PCA9533) - #include -#endif - -#if ENABLED(LED_COLOR_PRESETS) - const LEDColor LEDLights::defaultLEDColor = MakeLEDColor( - LED_USER_PRESET_RED, - LED_USER_PRESET_GREEN, - LED_USER_PRESET_BLUE, - LED_USER_PRESET_WHITE, - LED_USER_PRESET_BRIGHTNESS - ); -#endif - -#if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS) - LEDColor LEDLights::color; - bool LEDLights::lights_on; -#endif - -LEDLights leds; - -void LEDLights::setup() { - #if EITHER(RGB_LED, RGBW_LED) - if (PWM_PIN(RGB_LED_R_PIN)) SET_PWM(RGB_LED_R_PIN); else SET_OUTPUT(RGB_LED_R_PIN); - if (PWM_PIN(RGB_LED_G_PIN)) SET_PWM(RGB_LED_G_PIN); else SET_OUTPUT(RGB_LED_G_PIN); - if (PWM_PIN(RGB_LED_B_PIN)) SET_PWM(RGB_LED_B_PIN); else SET_OUTPUT(RGB_LED_B_PIN); - #if ENABLED(RGBW_LED) - if (PWM_PIN(RGB_LED_W_PIN)) SET_PWM(RGB_LED_W_PIN); else SET_OUTPUT(RGB_LED_W_PIN); - #endif - #endif - #if ENABLED(NEOPIXEL_LED) - neo.init(); - #endif - #if ENABLED(PCA9533) - RGBinit(); - #endif - #if ENABLED(LED_USER_PRESET_STARTUP) - set_default(); - #endif -} - -void LEDLights::set_color(const LEDColor &incol - #if ENABLED(NEOPIXEL_LED) - , bool isSequence/*=false*/ - #endif -) { - - #if ENABLED(NEOPIXEL_LED) - - const uint32_t neocolor = LEDColorWhite() == incol - ? neo.Color(NEO_WHITE) - : neo.Color(incol.r, incol.g, incol.b, incol.w); - static uint16_t nextLed = 0; - - #ifdef NEOPIXEL_BKGD_LED_INDEX - if (NEOPIXEL_BKGD_LED_INDEX == nextLed) { - if (++nextLed >= neo.pixels()) nextLed = 0; - return; - } - #endif - - neo.set_brightness(incol.i); - - if (isSequence) { - neo.set_pixel_color(nextLed, neocolor); - neo.show(); - if (++nextLed >= neo.pixels()) nextLed = 0; - return; - } - - neo.set_color(neocolor); - - #endif - - #if ENABLED(BLINKM) - - // This variant uses i2c to send the RGB components to the device. - blinkm_set_led_color(incol); - - #endif - - #if EITHER(RGB_LED, RGBW_LED) - - // This variant uses 3-4 separate pins for the RGB(W) components. - // If the pins can do PWM then their intensity will be set. - #define UPDATE_RGBW(C,c) do { if (PWM_PIN(RGB_LED_##C##_PIN)) \ - analogWrite(pin_t(RGB_LED_##C##_PIN), incol.c); \ - else WRITE(RGB_LED_##C##_PIN, incol.c ? HIGH : LOW); }while(0) - UPDATE_RGBW(R,r); - UPDATE_RGBW(G,g); - UPDATE_RGBW(B,b); - #if ENABLED(RGBW_LED) - UPDATE_RGBW(W,w); - #endif - - #endif - - #if ENABLED(PCA9632) - // Update I2C LED driver - pca9632_set_led_color(incol); - #endif - - #if ENABLED(PCA9533) - RGBsetColor(incol.r, incol.g, incol.b, true); - #endif - - #if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS) - // Don't update the color when OFF - lights_on = !incol.is_off(); - if (lights_on) color = incol; - #endif -} - -#if ENABLED(LED_CONTROL_MENU) - void LEDLights::toggle() { if (lights_on) set_off(); else update(); } -#endif - -#ifdef LED_BACKLIGHT_TIMEOUT - - millis_t LEDLights::led_off_time; // = 0 - - void LEDLights::update_timeout(const bool power_on) { - const millis_t ms = millis(); - if (power_on) - reset_timeout(ms); - else if (ELAPSED(ms, led_off_time)) - set_off(); - } - -#endif - -#endif // HAS_COLOR_LEDS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.h deleted file mode 100644 index 14a50cb06f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/leds.h +++ /dev/null @@ -1,217 +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 - -/** - * leds.h - Marlin general RGB LED support - */ - -#include "../../inc/MarlinConfigPre.h" - -#include - -#if ENABLED(NEOPIXEL_LED) - #include "neopixel.h" -#endif - -#define HAS_WHITE_LED EITHER(RGBW_LED, NEOPIXEL_LED) - -/** - * LEDcolor type for use with leds.set_color - */ -typedef struct LEDColor { - uint8_t r, g, b - #if HAS_WHITE_LED - , w - #if ENABLED(NEOPIXEL_LED) - , i - #endif - #endif - ; - - LEDColor() : r(255), g(255), b(255) - #if HAS_WHITE_LED - , w(255) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - - LEDColor(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - ) : r(r), g(g), b(b) - #if HAS_WHITE_LED - , w(w) - #if ENABLED(NEOPIXEL_LED) - , i(i) - #endif - #endif - {} - - LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2]) - #if HAS_WHITE_LED - , w(rgbw[3]) - #if ENABLED(NEOPIXEL_LED) - , i(NEOPIXEL_BRIGHTNESS) - #endif - #endif - {} - - LEDColor& operator=(const uint8_t (&rgbw)[4]) { - r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; - #if HAS_WHITE_LED - w = rgbw[3]; - #endif - return *this; - } - - LEDColor& operator=(const LEDColor &right) { - if (this != &right) memcpy(this, &right, sizeof(LEDColor)); - return *this; - } - - bool operator==(const LEDColor &right) { - if (this == &right) return true; - return 0 == memcmp(this, &right, sizeof(LEDColor)); - } - - bool operator!=(const LEDColor &right) { return !operator==(right); } - - bool is_off() const { - return 3 > r + g + b - #if HAS_WHITE_LED - + w - #endif - ; - } -} LEDColor; - -/** - * Color helpers and presets - */ -#if HAS_WHITE_LED - #if ENABLED(NEOPIXEL_LED) - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I) - #else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W) - #endif -#else - #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B) -#endif - -#define LEDColorOff() LEDColor( 0, 0, 0) -#define LEDColorRed() LEDColor(255, 0, 0) -#if ENABLED(LED_COLORS_REDUCE_GREEN) - #define LEDColorOrange() LEDColor(255, 25, 0) - #define LEDColorYellow() LEDColor(255, 75, 0) -#else - #define LEDColorOrange() LEDColor(255, 80, 0) - #define LEDColorYellow() LEDColor(255, 255, 0) -#endif -#define LEDColorGreen() LEDColor( 0, 255, 0) -#define LEDColorBlue() LEDColor( 0, 0, 255) -#define LEDColorIndigo() LEDColor( 0, 255, 255) -#define LEDColorViolet() LEDColor(255, 0, 255) -#if HAS_WHITE_LED - #define LEDColorWhite() LEDColor( 0, 0, 0, 255) -#else - #define LEDColorWhite() LEDColor(255, 255, 255) -#endif - -class LEDLights { -public: - LEDLights() {} // ctor - - static void setup(); // init() - - static void set_color(const LEDColor &color - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ); - - inline void set_color(uint8_t r, uint8_t g, uint8_t b - #if HAS_WHITE_LED - , uint8_t w=0 - #if ENABLED(NEOPIXEL_LED) - , uint8_t i=NEOPIXEL_BRIGHTNESS - #endif - #endif - #if ENABLED(NEOPIXEL_LED) - , bool isSequence=false - #endif - ) { - set_color(MakeLEDColor(r, g, b, w, i) - #if ENABLED(NEOPIXEL_LED) - , isSequence - #endif - ); - } - - static inline void set_off() { set_color(LEDColorOff()); } - static inline void set_green() { set_color(LEDColorGreen()); } - static inline void set_white() { set_color(LEDColorWhite()); } - - #if ENABLED(LED_COLOR_PRESETS) - static const LEDColor defaultLEDColor; - static inline void set_default() { set_color(defaultLEDColor); } - static inline void set_red() { set_color(LEDColorRed()); } - static inline void set_orange() { set_color(LEDColorOrange()); } - static inline void set_yellow() { set_color(LEDColorYellow()); } - static inline void set_blue() { set_color(LEDColorBlue()); } - static inline void set_indigo() { set_color(LEDColorIndigo()); } - static inline void set_violet() { set_color(LEDColorViolet()); } - #endif - - #if ENABLED(PRINTER_EVENT_LEDS) - static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); } - #endif - - #if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS) - static LEDColor color; // last non-off color - static bool lights_on; // the last set color was "on" - #endif - - #if ENABLED(LED_CONTROL_MENU) - static void toggle(); // swap "off" with color - static inline void update() { set_color(color); } - #endif - - #ifdef LED_BACKLIGHT_TIMEOUT - private: - static millis_t led_off_time; - public: - static inline void reset_timeout(const millis_t &ms) { - led_off_time = ms + LED_BACKLIGHT_TIMEOUT; - if (!lights_on) set_default(); - } - static void update_timeout(const bool power_on); - #endif -}; - -extern LEDLights leds; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.cpp deleted file mode 100644 index a3ceacb42c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.cpp +++ /dev/null @@ -1,117 +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 . - * - */ - -/** - * Marlin RGB LED general support - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(NEOPIXEL_LED) - -#include "neopixel.h" - -#if ENABLED(NEOPIXEL_STARTUP_TEST) - #include "../../core/utility.h" -#endif - -Marlin_NeoPixel neo; - -Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800) - #if MULTIPLE_NEOPIXEL_TYPES - , Marlin_NeoPixel::adaneo2(NEOPIXEL_PIXELS, NEOPIXEL2_PIN, NEOPIXEL2_TYPE + NEO_KHZ800) - #endif -; - -#ifdef NEOPIXEL_BKGD_LED_INDEX - - void Marlin_NeoPixel::set_color_background() { - uint8_t background_color[4] = NEOPIXEL_BKGD_COLOR; - set_pixel_color(NEOPIXEL_BKGD_LED_INDEX, adaneo1.Color(background_color[0], background_color[1], background_color[2], background_color[3])); - } - -#endif - -void Marlin_NeoPixel::set_color(const uint32_t color) { - for (uint16_t i = 0; i < pixels(); ++i) { - #ifdef NEOPIXEL_BKGD_LED_INDEX - if (i == NEOPIXEL_BKGD_LED_INDEX && color != 0x000000) { - set_color_background(); - continue; - } - #endif - set_pixel_color(i, color); - } - show(); -} - -void Marlin_NeoPixel::set_color_startup(const uint32_t color) { - for (uint16_t i = 0; i < pixels(); ++i) - set_pixel_color(i, color); - show(); -} - -void Marlin_NeoPixel::init() { - SET_OUTPUT(NEOPIXEL_PIN); - set_brightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range - begin(); - show(); // initialize to all off - - #if ENABLED(NEOPIXEL_STARTUP_TEST) - safe_delay(1000); - set_color_startup(adaneo1.Color(255, 0, 0, 0)); // red - safe_delay(1000); - set_color_startup(adaneo1.Color(0, 255, 0, 0)); // green - safe_delay(1000); - set_color_startup(adaneo1.Color(0, 0, 255, 0)); // blue - safe_delay(1000); - #endif - - #ifdef NEOPIXEL_BKGD_LED_INDEX - set_color_background(); - #endif - - #if ENABLED(LED_USER_PRESET_STARTUP) - set_color(adaneo1.Color(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE)); - #else - set_color(adaneo1.Color(0, 0, 0, 0)); - #endif -} - -#if 0 -bool Marlin_NeoPixel::set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p) { - const uint32_t color = adaneo1.Color(r, g, b, w); - set_brightness(p); - #if DISABLED(NEOPIXEL_IS_SEQUENTIAL) - set_color(color); - return false; - #else - static uint16_t nextLed = 0; - set_pixel_color(nextLed, color); - show(); - if (++nextLed >= pixels()) nextLed = 0; - return true; - #endif -} -#endif - -#endif // NEOPIXEL_LED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.h deleted file mode 100644 index e0a3d7c389..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/neopixel.h +++ /dev/null @@ -1,120 +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 - -/** - * Neopixel support - */ - -// ------------------------ -// Includes -// ------------------------ - -#include "../../inc/MarlinConfig.h" - -#include -#include - -// ------------------------ -// Defines -// ------------------------ - -#define MULTIPLE_NEOPIXEL_TYPES (defined(NEOPIXEL2_TYPE) && (NEOPIXEL2_TYPE != NEOPIXEL_TYPE)) - -#define NEOPIXEL_IS_RGB (NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR) -#define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB - -#if NEOPIXEL_IS_RGB - #define NEO_WHITE 255, 255, 255, 0 -#else - #define NEO_WHITE 0, 0, 0, 255 -#endif - -// ------------------------ -// Function prototypes -// ------------------------ - -class Marlin_NeoPixel { -private: - static Adafruit_NeoPixel adaneo1 - #if MULTIPLE_NEOPIXEL_TYPES - , adaneo2 - #endif - ; - -public: - static void init(); - static void set_color_startup(const uint32_t c); - - static void set_color(const uint32_t c); - - #ifdef NEOPIXEL_BKGD_LED_INDEX - static void set_color_background(); - #endif - - static inline void begin() { - adaneo1.begin(); - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.begin(); - #endif - } - - static inline void set_pixel_color(const uint16_t n, const uint32_t c) { - adaneo1.setPixelColor(n, c); - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.setPixelColor(n, c); - #endif - } - - static inline void set_brightness(const uint8_t b) { - adaneo1.setBrightness(b); - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.setBrightness(b); - #endif - } - - static inline void show() { - adaneo1.show(); - #if PIN_EXISTS(NEOPIXEL2) - #if MULTIPLE_NEOPIXEL_TYPES - adaneo2.show(); - #else - adaneo1.setPin(NEOPIXEL2_PIN); - adaneo1.show(); - adaneo1.setPin(NEOPIXEL_PIN); - #endif - #endif - } - - #if 0 - bool set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p); - #endif - - // Accessors - static inline uint16_t pixels() { return adaneo1.numPixels(); } - static inline uint8_t brightness() { return adaneo1.getBrightness(); } - static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) { - return adaneo1.Color(r, g, b, w); - } -}; - -extern Marlin_NeoPixel neo; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.cpp deleted file mode 100644 index fc0da10f70..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.cpp +++ /dev/null @@ -1,150 +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 . - * - */ - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PCA9632) - -#include "pca9632.h" -#include "leds.h" -#include - -#define PCA9632_MODE1_VALUE 0b00000001 //(ALLCALL) -#define PCA9632_MODE2_VALUE 0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM) -#define PCA9632_LEDOUT_VALUE 0b00101010 - -/* Register addresses */ -#define PCA9632_MODE1 0x00 -#define PCA9632_MODE2 0x01 -#define PCA9632_PWM0 0x02 -#define PCA9632_PWM1 0x03 -#define PCA9632_PWM2 0x04 -#define PCA9632_PWM3 0x05 -#define PCA9632_GRPPWM 0x06 -#define PCA9632_GRPFREQ 0x07 -#define PCA9632_LEDOUT 0x08 -#define PCA9632_SUBADR1 0x09 -#define PCA9632_SUBADR2 0x0A -#define PCA9632_SUBADR3 0x0B -#define PCA9632_ALLCALLADDR 0x0C - -#define PCA9632_NO_AUTOINC 0x00 -#define PCA9632_AUTO_ALL 0x80 -#define PCA9632_AUTO_IND 0xA0 -#define PCA9632_AUTOGLO 0xC0 -#define PCA9632_AUTOGI 0xE0 - -// Red=LED0 Green=LED1 Blue=LED2 -#ifndef PCA9632_RED - #define PCA9632_RED 0x00 -#endif -#ifndef PCA9632_GRN - #define PCA9632_GRN 0x02 -#endif -#ifndef PCA9632_BLU - #define PCA9632_BLU 0x04 -#endif - -// If any of the color indexes are greater than 0x04 they can't use auto increment -#if !defined(PCA9632_NO_AUTO_INC) && (PCA9632_RED > 0x04 || PCA9632_GRN > 0x04 || PCA9632_BLU > 0x04) - #define PCA9632_NO_AUTO_INC -#endif - -#define LED_OFF 0x00 -#define LED_ON 0x01 -#define LED_PWM 0x02 - -#define PCA9632_ADDRESS 0b01100000 - -byte PCA_init = 0; - -static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte value) { - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(regadd); - Wire.write(value); - Wire.endTransmission(); -} - -static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte vr, const byte vg, const byte vb) { - #if DISABLED(PCA9632_NO_AUTO_INC) - uint8_t data[4], len = 4; - data[0] = PCA9632_AUTO_IND | regadd; - data[1 + (PCA9632_RED >> 1)] = vr; - data[1 + (PCA9632_GRN >> 1)] = vg; - data[1 + (PCA9632_BLU >> 1)] = vb; - #else - uint8_t data[6], len = 6; - data[0] = regadd + (PCA9632_RED >> 1); - data[1] = vr; - data[2] = regadd + (PCA9632_GRN >> 1); - data[3] = vg; - data[4] = regadd + (PCA9632_BLU >> 1); - data[5] = vb; - #endif - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(data, len); - Wire.endTransmission(); -} - -#if 0 - static byte PCA9632_ReadRegister(const byte addr, const byte regadd) { - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(regadd); - const byte value = Wire.read(); - Wire.endTransmission(); - return value; - } -#endif - -void pca9632_set_led_color(const LEDColor &color) { - Wire.begin(); - if (!PCA_init) { - PCA_init = 1; - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); - } - - const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0) - | (color.g ? LED_PWM << PCA9632_GRN : 0) - | (color.b ? LED_PWM << PCA9632_BLU : 0); - - PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b); - PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); -} - -#if ENABLED(PCA9632_BUZZER) - - void pca9632_buzz(const long, const uint16_t) { - uint8_t data[] = PCA9632_BUZZER_DATA; - Wire.beginTransmission(I2C_ADDRESS(PCA9632_ADDRESS)); - Wire.write(data, sizeof(data)); - Wire.endTransmission(); - } - -#endif // PCA9632_BUZZER - -#endif // PCA9632 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.h deleted file mode 100644 index 2abdf7c7af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/pca9632.h +++ /dev/null @@ -1,37 +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 - -/** - * Driver for the Philips PCA9632 LED driver. - * Written by Robert Mendon Feb 2017. - */ - -struct LEDColor; -typedef LEDColor LEDColor; - -void pca9632_set_led_color(const LEDColor &color); - -#if ENABLED(PCA9632_BUZZER) - #include - void pca9632_buzz(const long, const uint16_t); -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.cpp deleted file mode 100644 index 3ce7a1af21..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.cpp +++ /dev/null @@ -1,81 +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 . - * - */ - -/** - * printer_event_leds.cpp - LED color changing based on printer status - */ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(PRINTER_EVENT_LEDS) - -#include "printer_event_leds.h" - -PrinterEventLEDs printerEventLEDs; - -#if HAS_LEDS_OFF_FLAG - bool PrinterEventLEDs::leds_off_after_print; // = false -#endif - -#if HAS_TEMP_HOTEND || HAS_HEATED_BED - - uint8_t PrinterEventLEDs::old_intensity = 0; - - inline uint8_t pel_intensity(const float &start, const float ¤t, const float &target) { - return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f); - } - - inline void pel_set_rgb(const uint8_t r, const uint8_t g, const uint8_t b) { - leds.set_color( - MakeLEDColor(r, g, b, 0, neo.brightness()) - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif - ); - } - -#endif - -#if HAS_TEMP_HOTEND - - void PrinterEventLEDs::onHotendHeating(const float &start, const float ¤t, const float &target) { - const uint8_t blue = pel_intensity(start, current, target); - if (blue != old_intensity) { - old_intensity = blue; - pel_set_rgb(255, 0, 255 - blue); - } - } - -#endif - -#if HAS_HEATED_BED - - void PrinterEventLEDs::onBedHeating(const float &start, const float ¤t, const float &target) { - const uint8_t red = pel_intensity(start, current, target); - if (red != old_intensity) { - old_intensity = red; - pel_set_rgb(red, 0, 255); - } - } -#endif - -#endif // PRINTER_EVENT_LEDS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.h deleted file mode 100644 index f59d6c699c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/printer_event_leds.h +++ /dev/null @@ -1,87 +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 - -/** - * printer_event_leds.h - LED color changing based on printer status - */ - -#include "leds.h" -#include "../../inc/MarlinConfig.h" - -class PrinterEventLEDs { -private: - static uint8_t old_intensity; - - #if HAS_LEDS_OFF_FLAG - static bool leds_off_after_print; - #endif - - static inline void set_done() { - #if ENABLED(LED_COLOR_PRESETS) - leds.set_default(); - #else - leds.set_off(); - #endif - } - -public: - #if HAS_TEMP_HOTEND - static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } - static void onHotendHeating(const float &start, const float ¤t, const float &target); - #endif - - #if HAS_HEATED_BED - static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } - static void onBedHeating(const float &start, const float ¤t, const float &target); - #endif - - #if HAS_TEMP_HOTEND || HAS_HEATED_BED - static inline void onHeatingDone() { leds.set_color(LEDColorWhite()); } - static inline void onPidTuningDone(LEDColor c) { leds.set_color(c); } - #endif - - #if ENABLED(SDSUPPORT) - - static inline void onPrintCompleted() { - leds.set_green(); - #if HAS_LEDS_OFF_FLAG - leds_off_after_print = true; - #else - safe_delay(2000); - set_done(); - #endif - } - - static inline void onResumeAfterWait() { - #if HAS_LEDS_OFF_FLAG - if (leds_off_after_print) { - set_done(); - leds_off_after_print = false; - } - #endif - } - - #endif // SDSUPPORT -}; - -extern PrinterEventLEDs printerEventLEDs; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.cpp deleted file mode 100644 index f19ae0f092..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.cpp +++ /dev/null @@ -1,58 +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 . - * - */ - -/** - * Marlin RGB LED general support - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(TEMP_STAT_LEDS) - -#include "tempstat.h" -#include "../../module/temperature.h" - -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)) { - next_status_led_update_ms += 500; // Update every 0.5s - float max_temp = 0.0; - #if HAS_HEATED_BED - max_temp = _MAX(thermalManager.degTargetBed(), thermalManager.degBed()); - #endif - HOTEND_LOOP() - max_temp = _MAX(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e)); - const int8_t new_red = (max_temp > 55.0) ? HIGH : (max_temp < 54.0 || old_red < 0) ? LOW : old_red; - if (new_red != old_red) { - old_red = new_red; - #if PIN_EXISTS(STAT_LED_RED) - WRITE(STAT_LED_RED_PIN, new_red); - #endif - #if PIN_EXISTS(STAT_LED_BLUE) - WRITE(STAT_LED_BLUE_PIN, !new_red); - #endif - } - } -} - -#endif // TEMP_STAT_LEDS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.h deleted file mode 100644 index 834f2e491f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/leds/tempstat.h +++ /dev/null @@ -1,28 +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 - -/** - * Marlin general RGB LED support - */ - -void handle_status_leds(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.cpp deleted file mode 100644 index dbdd9558aa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.cpp +++ /dev/null @@ -1,192 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(MIXING_EXTRUDER) - -//#define MIXER_NORMALIZER_DEBUG - -#include "mixing.h" - -Mixer mixer; - -#ifdef MIXER_NORMALIZER_DEBUG - #include "../core/serial.h" -#endif - -// Used up to Planner level -uint_fast8_t Mixer::selected_vtool = 0; -float Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK. -mixer_comp_t Mixer::color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - -// Used in Stepper -int_fast8_t Mixer::runner = 0; -mixer_comp_t Mixer::s_color[MIXING_STEPPERS]; -mixer_accu_t Mixer::accu[MIXING_STEPPERS] = { 0 }; - -#if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX) - mixer_perc_t Mixer::mix[MIXING_STEPPERS]; -#endif - -void Mixer::normalize(const uint8_t tool_index) { - float cmax = 0; - #ifdef MIXER_NORMALIZER_DEBUG - float csum = 0; - #endif - MIXER_STEPPER_LOOP(i) { - const float v = collector[i]; - NOLESS(cmax, v); - #ifdef MIXER_NORMALIZER_DEBUG - csum += v; - #endif - } - #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOPGM("Mixer: Old relation : [ "); - MIXER_STEPPER_LOOP(i) { - SERIAL_ECHO_F(collector[i] / csum, 3); - SERIAL_CHAR(' '); - } - SERIAL_ECHOLNPGM("]"); - #endif - - // Scale all values so their maximum is COLOR_A_MASK - const float scale = float(COLOR_A_MASK) / cmax; - MIXER_STEPPER_LOOP(i) color[tool_index][i] = collector[i] * scale; - - #ifdef MIXER_NORMALIZER_DEBUG - csum = 0; - SERIAL_ECHOPGM("Mixer: Normalize to : [ "); - MIXER_STEPPER_LOOP(i) { - SERIAL_ECHO(uint16_t(color[tool_index][i])); - SERIAL_CHAR(' '); - csum += color[tool_index][i]; - } - SERIAL_ECHOLNPGM("]"); - SERIAL_ECHOPGM("Mixer: New relation : [ "); - MIXER_STEPPER_LOOP(i) { - SERIAL_ECHO_F(uint16_t(color[tool_index][i]) / csum, 3); - SERIAL_CHAR(' '); - } - SERIAL_ECHOLNPGM("]"); - #endif - - #if ENABLED(GRADIENT_MIX) - refresh_gradient(); - #endif -} - -void Mixer::reset_vtools() { - // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. - // Every virtual tool gets a pure filament - for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++) - MIXER_STEPPER_LOOP(i) - color[t][i] = (t == i) ? COLOR_A_MASK : 0; - - // Remaining virtual tools are 100% filament 1 - #if MIXING_VIRTUAL_TOOLS > MIXING_STEPPERS - for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++) - MIXER_STEPPER_LOOP(i) - color[t][i] = (i == 0) ? COLOR_A_MASK : 0; - #endif -} - -// called at boot -void Mixer::init() { - - reset_vtools(); - - #if ENABLED(RETRACT_SYNC_MIXING) - // AUTORETRACT_TOOL gets the same amount of all filaments - MIXER_STEPPER_LOOP(i) - color[MIXER_AUTORETRACT_TOOL][i] = COLOR_A_MASK; - #endif - - ZERO(collector); - - #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX) - update_mix_from_vtool(); - #endif - - #if ENABLED(GRADIENT_MIX) - update_gradient_for_planner_z(); - #endif -} - -void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=selected_vtool*/, float (&c)[MIXING_STEPPERS]/*=collector*/) { - float csum = 0, cmax = 0; - MIXER_STEPPER_LOOP(i) { - const float v = color[t][i]; - cmax = _MAX(cmax, v); - csum += v; - } - //SERIAL_ECHOPAIR("Mixer::refresh_collector(", proportion, ", ", int(t), ") cmax=", cmax, " csum=", csum, " color"); - const float inv_prop = proportion / csum; - MIXER_STEPPER_LOOP(i) { - c[i] = color[t][i] * inv_prop; - //SERIAL_ECHOPAIR(" [", int(t), "][", int(i), "] = ", int(color[t][i]), " (", c[i], ") "); - } - //SERIAL_EOL(); -} - -#if ENABLED(GRADIENT_MIX) - - #include "../module/motion.h" - #include "../module/planner.h" - - gradient_t Mixer::gradient = { - false, // enabled - {0}, // color (array) - 0, 0, // start_z, end_z - 0, 1, // start_vtool, end_vtool - {0}, {0} // start_mix[], end_mix[] - #if ENABLED(GRADIENT_VTOOL) - , -1 // vtool_index - #endif - }; - - float Mixer::prev_z; // = 0 - - void Mixer::update_gradient_for_z(const float z) { - if (z == prev_z) return; - prev_z = z; - - const float slice = gradient.end_z - gradient.start_z; - - float pct = (z - gradient.start_z) / slice; - NOLESS(pct, 0.0f); NOMORE(pct, 1.0f); - - MIXER_STEPPER_LOOP(i) { - const mixer_perc_t sm = gradient.start_mix[i]; - mix[i] = sm + (gradient.end_mix[i] - sm) * pct; - } - - copy_mix_to_color(gradient.color); - } - - void Mixer::update_gradient_for_planner_z() { - update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS)); - } - -#endif // GRADIENT_MIX - -#endif // MIXING_EXTRUDER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.h deleted file mode 100644 index 095f22d13b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/mixing.h +++ /dev/null @@ -1,277 +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 - -#include "../inc/MarlinConfig.h" - -//#define MIXER_NORMALIZER_DEBUG - -#ifndef __AVR__ // || DUAL_MIXING_EXTRUDER - // Use 16-bit (or fastest) data for the integer mix factors - typedef uint_fast16_t mixer_comp_t; - typedef uint_fast16_t mixer_accu_t; - #define COLOR_A_MASK 0x8000 - #define COLOR_MASK 0x7FFF -#else - // Use 8-bit data for the integer mix factors - // Exactness is sacrificed for speed - #define MIXER_ACCU_SIGNED - typedef uint8_t mixer_comp_t; - typedef int8_t mixer_accu_t; - #define COLOR_A_MASK 0x80 - #define COLOR_MASK 0x7F -#endif - -typedef int8_t mixer_perc_t; - -#ifndef MIXING_VIRTUAL_TOOLS - #define MIXING_VIRTUAL_TOOLS 1 -#endif - -enum MixTool { - FIRST_USER_VIRTUAL_TOOL = 0, - LAST_USER_VIRTUAL_TOOL = MIXING_VIRTUAL_TOOLS - 1, - NR_USER_VIRTUAL_TOOLS, - MIXER_DIRECT_SET_TOOL = NR_USER_VIRTUAL_TOOLS, - #if ENABLED(RETRACT_SYNC_MIXING) - MIXER_AUTORETRACT_TOOL, - #endif - NR_MIXING_VIRTUAL_TOOLS -}; - -#if ENABLED(RETRACT_SYNC_MIXING) - #define MAX_VTOOLS 254 -#else - #define MAX_VTOOLS 255 -#endif -static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must be <= " STRINGIFY(MAX_VTOOLS) "!"); - -#define MIXER_STEPPER_LOOP(VAR) \ - for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) - -#define MIXER_BLOCK_FIELD mixer_comp_t b_color[MIXING_STEPPERS] -#define MIXER_POPULATE_BLOCK() mixer.populate_block(block->b_color) -#define MIXER_STEPPER_SETUP() mixer.stepper_setup(current_block->b_color) - -#if ENABLED(GRADIENT_MIX) - - typedef struct { - bool enabled; // This gradient is enabled - mixer_comp_t color[MIXING_STEPPERS]; // The current gradient color - float start_z, end_z; // Region for gradient - int8_t start_vtool, end_vtool; // Start and end virtual tools - mixer_perc_t start_mix[MIXING_STEPPERS], // Start and end mixes from those tools - end_mix[MIXING_STEPPERS]; - #if ENABLED(GRADIENT_VTOOL) - int8_t vtool_index; // Use this virtual tool number as index - #endif - } gradient_t; - -#endif - -/** - * @brief Mixer class - * @details Contains data and behaviors for a Mixing Extruder - */ -class Mixer { - public: - - static float collector[MIXING_STEPPERS]; // M163 components, also editable from LCD - - static void init(); // Populate colors at boot time - - static void reset_vtools(); - static void refresh_collector(const float proportion=1.0, const uint8_t t=selected_vtool, float (&c)[MIXING_STEPPERS]=collector); - - // Used up to Planner level - FORCE_INLINE static void set_collector(const uint8_t c, const float f) { collector[c] = _MAX(f, 0.0f); } - - static void normalize(const uint8_t tool_index); - FORCE_INLINE static void normalize() { normalize(selected_vtool); } - - FORCE_INLINE static uint8_t get_current_vtool() { return selected_vtool; } - - FORCE_INLINE static void T(const uint_fast8_t c) { - selected_vtool = c; - #if ENABLED(GRADIENT_VTOOL) - refresh_gradient(); - #endif - #if DUAL_MIXING_EXTRUDER - update_mix_from_vtool(); - #endif - } - - // Used when dealing with blocks - FORCE_INLINE static void populate_block(mixer_comp_t b_color[MIXING_STEPPERS]) { - #if ENABLED(GRADIENT_MIX) - if (gradient.enabled) { - MIXER_STEPPER_LOOP(i) b_color[i] = gradient.color[i]; - return; - } - #endif - MIXER_STEPPER_LOOP(i) b_color[i] = color[selected_vtool][i]; - } - - FORCE_INLINE static void stepper_setup(mixer_comp_t b_color[MIXING_STEPPERS]) { - MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i]; - } - - #if DUAL_MIXING_EXTRUDER || ENABLED(GRADIENT_MIX) - - static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 - - static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { - // Scale each component to the largest one in terms of COLOR_A_MASK - // So the largest component will be COLOR_A_MASK and the other will be in proportion to it - const float scale = (COLOR_A_MASK) * RECIPROCAL(_MAX( - LIST_N(MIXING_STEPPERS, mix[0], mix[1], mix[2], mix[3], mix[4], mix[5]) - )); - - // Scale all values so their maximum is COLOR_A_MASK - MIXER_STEPPER_LOOP(i) tcolor[i] = mix[i] * scale; - - #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOPGM("Mix [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); - SERIAL_ECHOPGM(" ] to Color [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(tcolor[0]), int(tcolor[1]), int(tcolor[2]), int(tcolor[3]), int(tcolor[4]), int(tcolor[5])); - SERIAL_ECHOLNPGM(" ]"); - #endif - } - - static inline void update_mix_from_vtool(const uint8_t j=selected_vtool) { - float ctot = 0; - MIXER_STEPPER_LOOP(i) ctot += color[j][i]; - //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot; - MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot); - - #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOPAIR("V-tool ", int(j), " [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(color[j][0]), int(color[j][1]), int(color[j][2]), int(color[j][3]), int(color[j][4]), int(color[j][5])); - SERIAL_ECHOPGM(" ] to Mix [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); - SERIAL_ECHOLNPGM(" ]"); - #endif - } - - #endif // DUAL_MIXING_EXTRUDER || GRADIENT_MIX - - #if DUAL_MIXING_EXTRUDER - - // Update the virtual tool from an edited mix - static inline void update_vtool_from_mix() { - copy_mix_to_color(color[selected_vtool]); - #if ENABLED(GRADIENT_MIX) - refresh_gradient(); - #endif - // MIXER_STEPPER_LOOP(i) collector[i] = mix[i]; - // normalize(); - } - - #endif // DUAL_MIXING_EXTRUDER - - #if ENABLED(GRADIENT_MIX) - - static gradient_t gradient; - static float prev_z; - - // Update the current mix from the gradient for a given Z - static void update_gradient_for_z(const float z); - static void update_gradient_for_planner_z(); - static inline void gradient_control(const float z) { - if (gradient.enabled) { - if (z >= gradient.end_z) - T(gradient.end_vtool); - else - update_gradient_for_z(z); - } - } - - static inline void update_mix_from_gradient() { - float ctot = 0; - MIXER_STEPPER_LOOP(i) ctot += gradient.color[i]; - MIXER_STEPPER_LOOP(i) mix[i] = (mixer_perc_t)CEIL(100.0f * gradient.color[i] / ctot); - - #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOPGM("Gradient [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(gradient.color[0]), int(gradient.color[1]), int(gradient.color[2]), int(gradient.color[3]), int(gradient.color[4]), int(gradient.color[5])); - SERIAL_ECHOPGM(" ] to Mix [ "); - SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); - SERIAL_ECHOLNPGM(" ]"); - #endif - } - - // Refresh the gradient after a change - static void refresh_gradient() { - #if ENABLED(GRADIENT_VTOOL) - const bool is_grd = (gradient.vtool_index == -1 || selected_vtool == (uint8_t)gradient.vtool_index); - #else - constexpr bool is_grd = true; - #endif - gradient.enabled = is_grd && gradient.start_vtool != gradient.end_vtool && gradient.start_z < gradient.end_z; - if (gradient.enabled) { - mixer_perc_t mix_bak[MIXING_STEPPERS]; - COPY(mix_bak, mix); - update_mix_from_vtool(gradient.start_vtool); - COPY(gradient.start_mix, mix); - update_mix_from_vtool(gradient.end_vtool); - COPY(gradient.end_mix, mix); - update_gradient_for_planner_z(); - COPY(mix, mix_bak); - prev_z = -1; - } - } - - #endif // GRADIENT_MIX - - // Used in Stepper - FORCE_INLINE static uint8_t get_stepper() { return runner; } - FORCE_INLINE static uint8_t get_next_stepper() { - for (;;) { - if (--runner < 0) runner = MIXING_STEPPERS - 1; - accu[runner] += s_color[runner]; - if ( - #ifdef MIXER_ACCU_SIGNED - accu[runner] < 0 - #else - accu[runner] & COLOR_A_MASK - #endif - ) { - accu[runner] &= COLOR_MASK; - return runner; - } - } - } - - private: - - // Used up to Planner level - static uint_fast8_t selected_vtool; - static mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - - // Used in Stepper - static int_fast8_t runner; - static mixer_comp_t s_color[MIXING_STEPPERS]; - static mixer_accu_t accu[MIXING_STEPPERS]; -}; - -extern Mixer mixer; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.cpp deleted file mode 100644 index ce6c5a6261..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.cpp +++ /dev/null @@ -1,708 +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 . - * - */ - -/** - * feature/pause.cpp - Pause feature support functions - * This may be combined with related G-codes if features are consolidated. - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - -#include "../Marlin.h" -#include "../gcode/gcode.h" -#include "../module/motion.h" -#include "../module/planner.h" -#include "../module/stepper.h" -#include "../module/printcounter.h" -#include "../module/temperature.h" - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#if HAS_FILAMENT_SENSOR - #include "runout.h" -#endif - -#if ENABLED(HOST_ACTION_COMMANDS) - #include "host_actions.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -#include "../core/language.h" -#include "../lcd/ultralcd.h" - -#if HAS_BUZZER - #include "../libs/buzzer.h" -#endif - -#include "../libs/nozzle.h" -#include "pause.h" - -// private: - -static xyze_pos_t resume_position; - -PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT; - -PauseMenuResponse pause_menu_response; - -fil_change_settings_t fc_settings[EXTRUDERS]; - -#if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" -#endif - -#if ENABLED(EMERGENCY_PARSER) - #define _PMSG(L) L##_M108 -#else - #define _PMSG(L) L##_LCD -#endif - -#if HAS_BUZZER - static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { - if (pause_mode == PAUSE_MODE_PAUSE_PRINT) return; - static millis_t next_buzz = 0; - static int8_t runout_beep = 0; - - if (init) next_buzz = runout_beep = 0; - - const millis_t ms = millis(); - if (ELAPSED(ms, next_buzz)) { - if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to - next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500); - BUZZ(50, 880 - (runout_beep & 1) * 220); - runout_beep++; - } - } - } -#endif - -/** - * Ensure a safe temperature for extrusion - * - * - Fail if the TARGET temperature is too low - * - Display LCD placard with temperature status - * - Return when heating is done or aborted - * - * Returns 'true' if heating was completed, 'false' for abort - */ -static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { - - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); - return false; - } - #endif - - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_HEATING, mode); - #else - UNUSED(mode); - #endif - - return thermalManager.wait_for_hotend(active_extruder); -} - -void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) { - #if HAS_FILAMENT_SENSOR - runout.reset(); - #endif - current_position.e += length / planner.e_factor[active_extruder]; - line_to_current_position(fr_mm_s); - planner.synchronize(); -} - -/** - * Load filament into the hotend - * - * - Fail if the a safe temperature was not reached - * - If pausing for confirmation, wait for a click or M108 - * - Show "wait for load" placard - * - Load and purge filament - * - Show "Purge more" / "Continue" menu - * - Return when "Continue" is selected - * - * Returns 'true' if load was completed, 'false' for abort - */ -bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=0*/, const int8_t max_beep_count/*=0*/, - const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/, - const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/ - DXC_ARGS -) { - #if !HAS_LCD_MENU - UNUSED(show_lcd); - #endif - - if (!ensure_safe_temperature(mode)) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode); - #endif - return false; - } - - if (pause_for_user) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_INSERT, mode); - #endif - SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_INSERT)); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - #if ENABLED(HOST_PROMPT_SUPPORT) - const char tool = '0' - #if NUM_RUNOUT_SENSORS > 1 - + active_extruder - #endif - ; - host_prompt_reason = PROMPT_USER_CONTINUE; - host_action_prompt_end(); - host_action_prompt_begin(PSTR("Load Filament T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - host_action_prompt_button(CONTINUE_STR); - host_action_prompt_show(); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")); - #endif - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - idle(true); - } - } - - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_LOAD, mode); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - const int8_t saved_ext = active_extruder; - const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; - #endif - - // Slow Load filament - if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); - - // Fast Load Filament - if (fast_load_length) { - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - const float saved_acceleration = planner.settings.retract_acceleration; - planner.settings.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL; - #endif - - do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.settings.retract_acceleration = saved_acceleration; - #endif - } - - #if ENABLED(DUAL_X_CARRIAGE) // Tie the two extruders movement back together. - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); - #endif - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE); - #endif - - wait_for_user = true; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purge Running..."), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Filament Purge Running...")); - #endif - for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) - do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); - wait_for_user = false; - - #else - - do { - if (purge_length > 0) { - // "Wait for filament purge" - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE); - #endif - - // Extrude filament to get into hotend - do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); - } - - // Show "Purge More" / "Resume" menu and wait for reply - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_end(); // Close current prompt - host_action_prompt_begin(PSTR("Paused")); - host_action_prompt_button(PSTR("PurgeMore")); - if (false - #if HAS_FILAMENT_SENSOR - || runout.filament_ran_out - #endif - ) - host_action_prompt_button(PSTR("DisableRunout")); - else { - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_button(CONTINUE_STR); - } - host_action_prompt_show(); - #endif - - #if HAS_LCD_MENU - if (show_lcd) { - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = false; - lcd_pause_show_message(PAUSE_MESSAGE_OPTION); - while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle(true); - } - #endif - - // Keep looping if "Purge More" was selected - } while (false - #if HAS_LCD_MENU - || (show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE) - #endif - ); - - #endif - - return true; -} - -/** - * Unload filament from the hotend - * - * - Fail if the a safe temperature was not reached - * - Show "wait for unload" placard - * - Retract, pause, then unload filament - * - Disable E stepper (on most machines) - * - * Returns 'true' if unload was completed, 'false' for abort - */ -bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, - const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/ - #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) - , const float &mix_multiplier/*=1.0*/ - #endif -) { - #if !HAS_LCD_MENU - UNUSED(show_lcd); - #endif - - #if !BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) - constexpr float mix_multiplier = 1.0; - #endif - - if (!ensure_safe_temperature(mode)) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif - return false; - } - - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, mode); - #endif - - // Retract filament - do_pause_e_move(-(FILAMENT_UNLOAD_RETRACT_LENGTH) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier); - - // Wait for filament to cool - safe_delay(FILAMENT_UNLOAD_DELAY); - - // Quickly purge - do_pause_e_move((FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier, - planner.settings.max_feedrate_mm_s[E_AXIS] * mix_multiplier); - - // Unload filament - #if FILAMENT_CHANGE_UNLOAD_ACCEL > 0 - const float saved_acceleration = planner.settings.retract_acceleration; - planner.settings.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL; - #endif - - do_pause_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier); - - #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0 - planner.settings.retract_acceleration = saved_acceleration; - #endif - - // Disable E steppers for manual change - #if HAS_E_STEPPER_ENABLE - disable_e_stepper(active_extruder); - safe_delay(100); - #endif - - return true; -} - -// public: - -/** - * Pause procedure - * - * - Abort if already paused - * - Send host action for pause, if configured - * - Abort if TARGET temperature is too low - * - Display "wait for start of filament change" (if a length was specified) - * - Initial retract, if current temperature is hot enough - * - Park the nozzle at the given position - * - Call unload_filament (if a length was specified) - * - * Return 'true' if pause was completed, 'false' for abort - */ -uint8_t did_pause_print = 0; - -bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) { - - #if !HAS_LCD_MENU - UNUSED(show_lcd); - #endif - - if (did_pause_print) return false; // already paused - - #if ENABLED(HOST_ACTION_COMMANDS) - #ifdef ACTION_ON_PAUSED - host_action_paused(); - #elif defined(ACTION_ON_PAUSE) - host_action_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)) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); - - #if HAS_LCD_MENU - if (show_lcd) { // Show status screen - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - LCD_MESSAGEPGM(MSG_M600_TOO_COLD); - } - #endif - - return false; // unable to reach safe temperature - } - - // Indicate that the printer is paused - ++did_pause_print; - - // Pause the print job and timer - #if ENABLED(SDSUPPORT) - if (IS_SD_PRINTING()) { - card.pauseSDPrint(); - ++did_pause_print; // Indicate SD pause also - } - #endif - - print_job_timer.pause(); - - // Save current position - resume_position = current_position; - - // Wait for buffered blocks to complete - planner.synchronize(); - - #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0 - thermalManager.set_fans_paused(true); - #endif - - // Initial retract before move to filament change position - if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) - 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 (!axes_need_homing()) - nozzle.park(2, park_point); - - #if ENABLED(DUAL_X_CARRIAGE) - const int8_t saved_ext = active_extruder; - const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; - #endif - - if (unload_length) // Unload the filament - unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT); - - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); - #endif - - return true; -} - -/** - * For Paused Print: - * - Show "Press button (or M108) to resume" - * - * For Filament Change: - * - Show "Insert filament and press button to continue" - * - * - Wait for a click before returning - * - Heaters can time out and must reheat before continuing - * - * Used by M125 and M600 - */ - -void show_continue_prompt(const bool is_reload) { - #if HAS_LCD_MENU - lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); - #endif - SERIAL_ECHO_START(); - serialprintPGM(is_reload ? PSTR(_PMSG(MSG_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(MSG_FILAMENT_CHANGE_WAIT) "\n")); -} - -void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) { - bool nozzle_timed_out = false; - - show_continue_prompt(is_reload); - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #else - UNUSED(max_beep_count); - #endif - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() thermalManager.hotend_idle[e].start(nozzle_timeout); - - #if ENABLED(DUAL_X_CARRIAGE) - const int8_t saved_ext = active_extruder; - const bool saved_ext_dup_mode = extruder_duplication_enabled; - active_extruder = DXC_ext; - extruder_duplication_enabled = false; - #endif - - // Wait for filament insert by user and press button - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked")); - #endif - while (wait_for_user) { - #if HAS_BUZZER - filament_change_beep(max_beep_count); - #endif - - // If the nozzle has timed out... - if (!nozzle_timed_out) - HOTEND_LOOP() nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out; - - // Wait for the user to press the button to re-heat the nozzle, then - // re-heat the nozzle, re-show the continue prompt, restart idle timers, start over - if (nozzle_timed_out) { - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_HEAT); - #endif - SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_HEAT)); - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("HeaterTimeout"), PSTR("Reheat")); - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout")); - #endif - - // Wait for LCD click or M108 - while (wait_for_user) idle(true); - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("Reheating")); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onStatusChanged(PSTR("Reheating...")); - #endif - - // Re-enable the heaters if they timed out - HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e); - - // Wait for the heaters to reach the target temperatures - ensure_safe_temperature(); - - // Show the prompt to continue - show_continue_prompt(is_reload); - - // Start the heater idle timers - const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL; - - HOTEND_LOOP() thermalManager.hotend_idle[e].start(nozzle_timeout); - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheat Done"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Reheat finished.")); - #endif - wait_for_user = true; - nozzle_timed_out = false; - - #if HAS_BUZZER - filament_change_beep(max_beep_count, true); - #endif - } - - idle(true); - } - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder = saved_ext; - extruder_duplication_enabled = saved_ext_dup_mode; - stepper.set_directions(); - #endif -} - -/** - * Resume or Start print procedure - * - * - If not paused, do nothing and return - * - Reset heater idle timers - * - Load filament if specified, but only if: - * - a nozzle timed out, or - * - the nozzle is already heated. - * - Display "wait for print to resume" - * - Re-prime the nozzle... - * - FWRETRACT: Recover/prime from the prior G10. - * - !FWRETRACT: Retract by resume_position.e, if negative. - * Not sure how this logic comes into use. - * - Move the nozzle back to resume_position - * - Sync the planner E to resume_position.e - * - Send host action for resume, if configured - * - Resume the current SD print job, if any - */ -void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) { - /* - SERIAL_ECHOLNPAIR( - "start of resume_print()\ndual_x_carriage_mode:", dual_x_carriage_mode, - "\nextruder_duplication_enabled:", extruder_duplication_enabled, - "\nactive_extruder:", active_extruder, - "\n" - ); - //*/ - - if (!did_pause_print) return; - - // Re-enable the heaters if they timed out - bool nozzle_timed_out = false; - HOTEND_LOOP() { - nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out; - thermalManager.reset_heater_idle_timer(e); - } - - if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament - load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS); - - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_RESUME); - #endif - - // Intelligent resuming - #if ENABLED(FWRETRACT) - // If retracted before goto pause - if (fwretract.retracted[active_extruder]) - do_pause_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s); - #endif - - // If resume_position is negative - if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); - - // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); - - // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - - #if ADVANCED_PAUSE_RESUME_PRIME != 0 - 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 - // Set extruder to saved position - planner.set_e_position_mm((destination.e = current_position.e = resume_position.e)); - - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif - - #ifdef ACTION_ON_RESUMED - host_action_resumed(); - #elif defined(ACTION_ON_RESUME) - host_action_resume(); - #endif - - --did_pause_print; - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resuming"), PSTR("Dismiss")); - #endif - - #if ENABLED(SDSUPPORT) - if (did_pause_print) { - card.startFileprint(); - --did_pause_print; - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && FAN_COUNT > 0 - thermalManager.set_fans_paused(false); - #endif - - // Resume the print job timer if it was running - if (print_job_timer.isPaused()) print_job_timer.start(); - - #if HAS_DISPLAY - ui.reset_status(); - #if HAS_LCD_MENU - ui.return_to_status(); - #endif - #endif -} - -#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.h deleted file mode 100644 index 42f70cc601..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/pause.h +++ /dev/null @@ -1,102 +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 - -/** - * feature/pause.h - Pause feature support functions - * This may be combined with related G-codes if features are consolidated. - */ - -typedef struct { - float unload_length, load_length; -} fil_change_settings_t; - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - -#include "../libs/nozzle.h" - -enum PauseMode : char { - PAUSE_MODE_SAME, - PAUSE_MODE_PAUSE_PRINT, - PAUSE_MODE_CHANGE_FILAMENT, - PAUSE_MODE_LOAD_FILAMENT, - PAUSE_MODE_UNLOAD_FILAMENT -}; - -enum PauseMessage : char { - PAUSE_MESSAGE_PAUSING, - PAUSE_MESSAGE_CHANGING, - PAUSE_MESSAGE_WAITING, - PAUSE_MESSAGE_UNLOAD, - PAUSE_MESSAGE_INSERT, - PAUSE_MESSAGE_LOAD, - PAUSE_MESSAGE_PURGE, - PAUSE_MESSAGE_OPTION, - PAUSE_MESSAGE_RESUME, - PAUSE_MESSAGE_STATUS, - PAUSE_MESSAGE_HEAT, - PAUSE_MESSAGE_HEATING -}; - -enum PauseMenuResponse : char { - PAUSE_RESPONSE_WAIT_FOR, - PAUSE_RESPONSE_EXTRUDE_MORE, - PAUSE_RESPONSE_RESUME_PRINT -}; - -extern PauseMode pause_mode; -extern PauseMenuResponse pause_menu_response; - -extern fil_change_settings_t fc_settings[EXTRUDERS]; - -extern uint8_t did_pause_print; - -#if ENABLED(DUAL_X_CARRIAGE) - #define DXC_PARAMS , const int8_t DXC_ext=-1 - #define DXC_ARGS , const int8_t DXC_ext - #define DXC_PASS , DXC_ext -#else - #define DXC_PARAMS - #define DXC_ARGS - #define DXC_PASS -#endif - -void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s); - -bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS); - -void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS); - -void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0 DXC_PARAMS); - -bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, const bool show_lcd=false, - const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS); - -bool unload_filament(const float &unload_length, const bool show_lcd=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT - #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) - , const float &mix_multiplier=1.0 - #endif -); - -#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.cpp deleted file mode 100644 index 53b1c50912..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.cpp +++ /dev/null @@ -1,122 +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 . - * - */ - -/** - * power.cpp - power control - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - -#include "power.h" -#include "../module/temperature.h" -#include "../module/stepper/indirection.h" -#include "../Marlin.h" - -Power powerManager; - -millis_t Power::lastPowerOn; - -bool Power::is_power_needed() { - #if ENABLED(AUTO_POWER_FANS) - FANS_LOOP(i) if (thermalManager.fan_speed[i]) return true; - #endif - - #if ENABLED(AUTO_POWER_E_FANS) - HOTEND_LOOP() if (thermalManager.autofan_speed[e]) return true; - #endif - - #if ENABLED(AUTO_POWER_CONTROLLERFAN, USE_CONTROLLER_FAN) && HAS_CONTROLLER_FAN - if (controllerfan_speed) return true; - #endif - - #if ENABLED(AUTO_POWER_CHAMBER_FAN) - if (thermalManager.chamberfan_speed) return true; - #endif - - // If any of the drivers or the bed are enabled... - if (X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON || Z_ENABLE_READ() == Z_ENABLE_ON - #if HAS_HEATED_BED - || thermalManager.temp_bed.soft_pwm_amount > 0 - #endif - #if HAS_X2_ENABLE - || X2_ENABLE_READ() == X_ENABLE_ON - #endif - #if HAS_Y2_ENABLE - || Y2_ENABLE_READ() == Y_ENABLE_ON - #endif - #if HAS_Z2_ENABLE - || Z2_ENABLE_READ() == Z_ENABLE_ON - #endif - #if E_STEPPERS - #define _OR_ENABLED_E(N) || E##N##_ENABLE_READ() == E_ENABLE_ON - REPEAT(E_STEPPERS, _OR_ENABLED_E) - #endif - ) return true; - - HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; - - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) return true; - #endif - - #if HOTENDS && AUTO_POWER_E_TEMP - HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true; - #endif - - #if HAS_HEATED_CHAMBER && AUTO_POWER_CHAMBER_TEMP - if (thermalManager.degChamber() >= AUTO_POWER_CHAMBER_TEMP) return true; - #endif - - return false; -} - -void Power::check() { - static millis_t nextPowerCheck = 0; - millis_t ms = millis(); - if (ELAPSED(ms, nextPowerCheck)) { - nextPowerCheck = ms + 2500UL; - if (is_power_needed()) - power_on(); - else if (!lastPowerOn || ELAPSED(ms, lastPowerOn + (POWER_TIMEOUT) * 1000UL)) - power_off(); - } -} - -void Power::power_on() { - lastPowerOn = millis(); - if (!powersupply_on) { - PSU_PIN_ON(); - - #if HAS_TRINAMIC - delay(PSU_POWERUP_DELAY); // Wait for power to settle - restore_stepper_drivers(); - #endif - } -} - -void Power::power_off() { - if (powersupply_on) PSU_PIN_OFF(); -} - -#endif // AUTO_POWER_CONTROL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.h deleted file mode 100644 index 1e42365b45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power.h +++ /dev/null @@ -1,40 +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 - -/** - * power.h - power control - */ - -#include "../core/millis_t.h" - -class Power { - public: - static void check(); - static void power_on(); - static void power_off(); - private: - static millis_t lastPowerOn; - static bool is_power_needed(); -}; - -extern Power powerManager; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.cpp deleted file mode 100644 index 0cf0fc5885..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.cpp +++ /dev/null @@ -1,568 +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 . - * - */ - -/** - * power_loss_recovery.cpp - Resume an SD print after power-loss - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - -#include "power_loss_recovery.h" -#include "../core/macros.h" - -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" -#include "../gcode/queue.h" -#include "../gcode/gcode.h" -#include "../module/motion.h" -#include "../module/planner.h" -#include "../module/printcounter.h" -#include "../module/temperature.h" -#include "../core/serial.h" - -#if ENABLED(FWRETRACT) - #include "fwretract.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY) -#include "../core/debug_out.h" - -PrintJobRecovery recovery; - -#ifndef POWER_LOSS_PURGE_LEN - #define POWER_LOSS_PURGE_LEN 0 -#endif -#ifndef POWER_LOSS_RETRACT_LEN - #define POWER_LOSS_RETRACT_LEN 0 -#endif -#ifndef POWER_LOSS_ZRAISE - #define POWER_LOSS_ZRAISE 2 -#endif - -/** - * Clear the recovery info - */ -void PrintJobRecovery::init() { memset(&info, 0, sizeof(info)); } - -/** - * Enable or disable then call changed() - */ -void PrintJobRecovery::enable(const bool onoff) { - enabled = onoff; - changed(); -} - -/** - * The enabled state was changed: - * - Enabled: Purge the job recovery file - * - Disabled: Write the job recovery file - */ -void PrintJobRecovery::changed() { - if (!enabled) - purge(); - else if (IS_SD_PRINTING()) - save(true); -} - -/** - * Check for Print Job Recovery during setup() - * - * If a saved state exists send 'M1000 S' to initiate job recovery. - */ -void PrintJobRecovery::check() { - if (enabled) { - if (!card.isMounted()) card.mount(); - if (card.isMounted()) { - load(); - if (!valid()) return purge(); - queue.inject_P(PSTR("M1000 S")); - } - } -} - -/** - * Delete the recovery file and clear the recovery data - */ -void PrintJobRecovery::purge() { - init(); - card.removeJobRecoveryFile(); -} - -/** - * Load the recovery data, if it exists - */ -void PrintJobRecovery::load() { - if (exists()) { - open(true); - (void)file.read(&info, sizeof(info)); - close(); - } - 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 - */ -void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) { - - #if SAVE_INFO_INTERVAL_MS > 0 - static millis_t next_save_ms; // = 0 - millis_t ms = millis(); - #endif - - #ifndef POWER_LOSS_MIN_Z_CHANGE - #define POWER_LOSS_MIN_Z_CHANGE 0.05 // Vase-mode-friendly out of the box - #endif - - // Did Z change since the last call? - if (force - #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled - #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed - || ELAPSED(ms, next_save_ms) - #endif - // Save if Z is above the last-saved position by some minimum height - || current_position.z > info.current_position.z + POWER_LOSS_MIN_Z_CHANGE - #endif - ) { - - #if SAVE_INFO_INTERVAL_MS > 0 - next_save_ms = ms + SAVE_INFO_INTERVAL_MS; - #endif - - // Set Head and Foot to matching non-zero values - if (!++info.valid_head) ++info.valid_head; // non-zero in sequence - //if (!IS_SD_PRINTING()) info.valid_head = 0; - info.valid_foot = info.valid_head; - - // Machine state - info.current_position = current_position; - #if HAS_HOME_OFFSET - info.home_offset = home_offset; - #endif - #if HAS_POSITION_SHIFT - info.position_shift = position_shift; - #endif - info.feedrate = uint16_t(feedrate_mm_s * 60.0f); - - #if EXTRUDERS > 1 - info.active_extruder = active_extruder; - #endif - - #if DISABLED(NO_VOLUMETRICS) - info.volumetric_enabled = parser.volumetric_enabled; - #if EXTRUDERS > 1 - for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e]; - #else - if (parser.volumetric_enabled) info.filament_size = planner.filament_size[active_extruder]; - #endif - #endif - - #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; - #endif - - #if FAN_COUNT - COPY(info.fan_speed, thermalManager.fan_speed); - #endif - - #if HAS_LEVELING - info.leveling = planner.leveling_active; - info.fade = ( - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.z_fade_height - #else - 0 - #endif - ); - #endif - - #if ENABLED(GRADIENT_MIX) - memcpy(&info.gradient, &mixer.gradient, sizeof(info.gradient)); - #endif - - #if ENABLED(FWRETRACT) - COPY(info.retract, fwretract.current_retract); - info.retract_hop = fwretract.current_hop; - #endif - - // Relative axis modes - info.axis_relative = gcode.axis_relative; - - // Elapsed print job time - info.print_job_elapsed = print_job_timer.duration(); - - write(); - } -} - -#if PIN_EXISTS(POWER_LOSS) - - void PrintJobRecovery::_outage() { - #if ENABLED(BACKUP_POWER_SUPPLY) - static bool lock = false; - if (lock) return; // No re-entrance from idle() during raise_z() - lock = true; - #endif - if (IS_SD_PRINTING()) save(true); - #if ENABLED(BACKUP_POWER_SUPPLY) - raise_z(); - #endif - - kill(GET_TEXT(MSG_OUTAGE_RECOVERY)); - } - - #if ENABLED(BACKUP_POWER_SUPPLY) - - void PrintJobRecovery::raise_z() { - // Disable all heaters to reduce power loss - thermalManager.disable_all_heaters(); - quickstop_stepper(); - // Raise Z axis - gcode.process_subcommands_now_P(PSTR("G91\nG0 Z" STRINGIFY(POWER_LOSS_ZRAISE))); - planner.synchronize(); - } - - #endif - -#endif - -/** - * Save the recovery info the recovery file - */ -void PrintJobRecovery::write() { - - debug(PSTR("Write")); - - open(false); - file.seekSet(0); - const int16_t ret = file.write(&info, sizeof(info)); - if (ret == -1) DEBUG_ECHOLNPGM("Power-loss file write failed."); - if (!file.close()) DEBUG_ECHOLNPGM("Power-loss file close failed."); -} - -/** - * Resume the saved print job - */ -void PrintJobRecovery::resume() { - - 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")); - #endif - - // Reset E, raise Z, home XY... - gcode.process_subcommands_now_P(PSTR("G92.9 E0" - #if Z_HOME_DIR > 0 - - // If Z homing goes to max, just reset E and home all - "\n" - "G28R0" - #if ENABLED(MARLIN_DEV_MODE) - "S" - #endif - - #else // "G92.9 E0 ..." - - // Set Z to 0, raise Z by RECOVERY_ZRAISE, and Home (XY only for Cartesian) - // with no raise. (Only do simulated homing in Marlin Dev Mode.) - #if ENABLED(BACKUP_POWER_SUPPLY) - "Z" STRINGIFY(POWER_LOSS_ZRAISE) // Z-axis was already raised at outage - #else - "Z0\n" // Set Z=0 - "G1Z" STRINGIFY(POWER_LOSS_ZRAISE) // Raise Z - #endif - "\n" - - "G28R0" - #if ENABLED(MARLIN_DEV_MODE) - "S" - #elif !IS_KINEMATIC - "XY" - #endif - #endif - )); - - // Pretend that all axes are homed - axis_homed = axis_known_position = xyz_bits; - - char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16]; - - // Select the previously active tool (with no_move) - #if EXTRUDERS > 1 - sprintf_P(cmd, PSTR("T%i S"), info.active_extruder); - gcode.process_subcommands_now(cmd); - #endif - - // Recover volumetric extrusion state - #if DISABLED(NO_VOLUMETRICS) - #if EXTRUDERS > 1 - for (int8_t e = 0; e < EXTRUDERS; e++) { - dtostrf(info.filament_size[e], 1, 3, str_1); - sprintf_P(cmd, PSTR("M200 T%i D%s"), e, str_1); - gcode.process_subcommands_now(cmd); - } - if (!info.volumetric_enabled) { - sprintf_P(cmd, PSTR("M200 T%i D0"), info.active_extruder); - gcode.process_subcommands_now(cmd); - } - #else - if (info.volumetric_enabled) { - dtostrf(info.filament_size, 1, 3, str_1); - sprintf_P(cmd, PSTR("M200 D%s"), str_1); - gcode.process_subcommands_now(cmd); - } - #endif - #endif - - #if HAS_HEATED_BED - const int16_t bt = info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - gcode.process_subcommands_now(cmd); - } - #endif - - // Restore all hotend temperatures - #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 - - // Restore print cooling fan speeds - FANS_LOOP(i) { - uint8_t f = info.fan_speed[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - gcode.process_subcommands_now(cmd); - } - } - - // Restore retract and hop state - #if ENABLED(FWRETRACT) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - if (info.retract[e] != 0.0) { - fwretract.current_retract[e] = info.retract[e]; - fwretract.retracted[e] = true; - } - } - fwretract.current_hop = info.retract_hop; - #endif - - #if HAS_LEVELING - // Restore leveling state before 'G92 Z' to ensure - // the Z stepper count corresponds to the native Z. - if (info.fade || info.leveling) { - sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.leveling), dtostrf(info.fade, 1, 1, str_1)); - gcode.process_subcommands_now(cmd); - } - #endif - - #if ENABLED(GRADIENT_MIX) - memcpy(&mixer.gradient, &info.gradient, sizeof(info.gradient)); - #endif - - // Extrude and retract to clean the nozzle - #if POWER_LOSS_PURGE_LEN - //sprintf_P(cmd, PSTR("G1 E%d F200"), POWER_LOSS_PURGE_LEN); - //gcode.process_subcommands_now(cmd); - gcode.process_subcommands_now_P(PSTR("G1 E" STRINGIFY(POWER_LOSS_PURGE_LEN) " F200")); - #endif - - #if POWER_LOSS_RETRACT_LEN - sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN - (POWER_LOSS_RETRACT_LEN)); - gcode.process_subcommands_now(cmd); - #endif - - // Move back to the saved XY - sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"), - dtostrf(info.current_position.x, 1, 3, str_1), - dtostrf(info.current_position.y, 1, 3, str_2) - ); - gcode.process_subcommands_now(cmd); - - // Move back to the saved Z - dtostrf(info.current_position.z, 1, 3, str_1); - #if Z_HOME_DIR > 0 - sprintf_P(cmd, PSTR("G1 Z%s F200"), str_1); - #else - gcode.process_subcommands_now_P(PSTR("G1 Z0 F200")); - sprintf_P(cmd, PSTR("G92.9 Z%s"), str_1); - #endif - gcode.process_subcommands_now(cmd); - - // Un-retract - #if POWER_LOSS_PURGE_LEN - //sprintf_P(cmd, PSTR("G1 E%d F3000"), POWER_LOSS_PURGE_LEN); - //gcode.process_subcommands_now(cmd); - gcode.process_subcommands_now_P(PSTR("G1 E" STRINGIFY(POWER_LOSS_PURGE_LEN) " F3000")); - #endif - - // Restore the feedrate - sprintf_P(cmd, PSTR("G1 F%d"), info.feedrate); - gcode.process_subcommands_now(cmd); - - // Restore E position with G92.9 - sprintf_P(cmd, PSTR("G92.9 E%s"), dtostrf(info.current_position.e, 1, 3, str_1)); - gcode.process_subcommands_now(cmd); - - // Relative axis modes - gcode.axis_relative = info.axis_relative; - - #if HAS_HOME_OFFSET - home_offset = info.home_offset; - #endif - #if HAS_POSITION_SHIFT - position_shift = info.position_shift; - #endif - #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT - LOOP_XYZ(i) update_workspace_offset((AxisEnum)i); - #endif - - // Resume the SD file from the last position - char *fn = info.sd_filename; - extern const char M23_STR[]; - sprintf_P(cmd, M23_STR, fn); - gcode.process_subcommands_now(cmd); - sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed); - gcode.process_subcommands_now(cmd); -} - -#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - - void PrintJobRecovery::debug(PGM_P const prefix) { - DEBUG_PRINT_P(prefix); - DEBUG_ECHOLNPAIR(" Job Recovery Info...\nvalid_head:", int(info.valid_head), " valid_foot:", int(info.valid_foot)); - if (info.valid_head) { - if (info.valid_head == info.valid_foot) { - DEBUG_ECHOPGM("current_position: "); - LOOP_XYZE(i) { - if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.current_position[i]); - } - DEBUG_EOL(); - - #if HAS_HOME_OFFSET - DEBUG_ECHOPGM("home_offset: "); - LOOP_XYZ(i) { - if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.home_offset[i]); - } - DEBUG_EOL(); - #endif - - #if HAS_POSITION_SHIFT - DEBUG_ECHOPGM("position_shift: "); - LOOP_XYZ(i) { - if (i) DEBUG_CHAR(','); - DEBUG_ECHO(info.position_shift[i]); - } - DEBUG_EOL(); - #endif - - DEBUG_ECHOLNPAIR("feedrate: ", info.feedrate); - - #if EXTRUDERS > 1 - DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder)); - #endif - - #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); - #endif - - #if FAN_COUNT - DEBUG_ECHOPGM("fan_speed: "); - FANS_LOOP(i) { - DEBUG_ECHO(int(info.fan_speed[i])); - if (i < FAN_COUNT - 1) DEBUG_CHAR(','); - } - DEBUG_EOL(); - #endif - - #if HAS_LEVELING - DEBUG_ECHOLNPAIR("leveling: ", int(info.leveling), "\n fade: ", int(info.fade)); - #endif - #if ENABLED(FWRETRACT) - DEBUG_ECHOPGM("retract: "); - for (int8_t e = 0; e < EXTRUDERS; e++) { - DEBUG_ECHO(info.retract[e]); - if (e < EXTRUDERS - 1) DEBUG_CHAR(','); - } - DEBUG_EOL(); - DEBUG_ECHOLNPAIR("retract_hop: ", info.retract_hop); - #endif - DEBUG_ECHOLNPAIR("sd_filename: ", info.sd_filename); - DEBUG_ECHOLNPAIR("sdpos: ", info.sdpos); - DEBUG_ECHOLNPAIR("print_job_elapsed: ", info.print_job_elapsed); - } - else - DEBUG_ECHOLNPGM("INVALID DATA"); - } - DEBUG_ECHOLNPGM("---"); - } - -#endif // DEBUG_POWER_LOSS_RECOVERY - -#endif // POWER_LOSS_RECOVERY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.h deleted file mode 100644 index a2c2b0c6bd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/power_loss_recovery.h +++ /dev/null @@ -1,196 +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 - -/** - * power_loss_recovery.h - Resume an SD print after power-loss - */ - -#include "../sd/cardreader.h" -#include "../inc/MarlinConfig.h" - -#if ENABLED(MIXING_EXTRUDER) - #include "../feature/mixing.h" -#endif - -#if !defined(POWER_LOSS_STATE) && PIN_EXISTS(POWER_LOSS) - #define POWER_LOSS_STATE HIGH -#endif - -#define DEBUG_POWER_LOSS_RECOVERY -//#define SAVE_EACH_CMD_MODE -//#define SAVE_INFO_INTERVAL_MS 0 - -typedef struct { - uint8_t valid_head; - - // Machine state - xyze_pos_t current_position; - - #if HAS_HOME_OFFSET - xyz_pos_t home_offset; - #endif - #if HAS_POSITION_SHIFT - xyz_pos_t position_shift; - #endif - - uint16_t feedrate; - - #if EXTRUDERS > 1 - uint8_t active_extruder; - #endif - - #if DISABLED(NO_VOLUMETRICS) - bool volumetric_enabled; - #if EXTRUDERS > 1 - float filament_size[EXTRUDERS]; - #else - float filament_size; - #endif - #endif - - #if HOTENDS - int16_t target_temperature[HOTENDS]; - #endif - - #if HAS_HEATED_BED - int16_t target_temperature_bed; - #endif - - #if FAN_COUNT - uint8_t fan_speed[FAN_COUNT]; - #endif - - #if HAS_LEVELING - bool leveling; - float fade; - #endif - - #if ENABLED(FWRETRACT) - float retract[EXTRUDERS], retract_hop; - #endif - - // Mixing extruder and gradient - #if ENABLED(MIXING_EXTRUDER) - //uint_fast8_t selected_vtool; - //mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - #if ENABLED(GRADIENT_MIX) - gradient_t gradient; - #endif - #endif - - // Relative axis modes - uint8_t axis_relative; - - // SD Filename and position - char sd_filename[MAXPATHNAMELENGTH]; - volatile uint32_t sdpos; - - // Job elapsed time - millis_t print_job_elapsed; - - uint8_t valid_foot; - -} job_recovery_info_t; - -class PrintJobRecovery { - public: - static const char filename[5]; - - 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) - #if ENABLED(POWER_LOSS_PULL) - #if POWER_LOSS_STATE == LOW - SET_INPUT_PULLUP(POWER_LOSS_PIN); - #else - SET_INPUT_PULLDOWN(POWER_LOSS_PIN); - #endif - #else - SET_INPUT(POWER_LOSS_PIN); - #endif - #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(); - - static void check(); - static void resume(); - - static inline bool exists() { return card.jobRecoverFileExists(); } - static inline void open(const bool read) { card.openJobRecoveryFile(read); } - static inline void close() { file.close(); } - - static void purge(); - static void load(); - static void save(const bool force= - #if ENABLED(SAVE_EACH_CMD_MODE) - true - #else - false - #endif - , const bool save_queue=true - ); - - #if PIN_EXISTS(POWER_LOSS) - static inline void outage() { - if (enabled && 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) - static void debug(PGM_P const prefix); - #else - static inline void debug(PGM_P const) {} - #endif - - private: - static void write(); - - #if ENABLED(BACKUP_POWER_SUPPLY) - static void raise_z(); - #endif - - #if PIN_EXISTS(POWER_LOSS) - static void _outage(); - #endif -}; - -extern PrintJobRecovery recovery; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.cpp deleted file mode 100644 index 2fdd6c09c5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.cpp +++ /dev/null @@ -1,802 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PRUSA_MMU2) - -#include "mmu2.h" -#include "../../lcd/menu/menu_mmu2.h" - -MMU2 mmu2; - -#include "../../gcode/gcode.h" -#include "../../lcd/ultralcd.h" -#include "../../libs/buzzer.h" -#include "../../libs/nozzle.h" -#include "../../module/temperature.h" -#include "../../module/planner.h" -#include "../../module/stepper/indirection.h" -#include "../../Marlin.h" - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../../feature/host_actions.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -#define DEBUG_OUT ENABLED(MMU2_DEBUG) -#include "../../core/debug_out.h" - -#define MMU_TODELAY 100 -#define MMU_TIMEOUT 10 -#define MMU_CMD_TIMEOUT 60000ul // 5min timeout for mmu commands (except P0) -#define MMU_P0_TIMEOUT 3000ul // Timeout for P0 command: 3seconds - -#define MMU_CMD_NONE 0 -#define MMU_CMD_T0 0x10 -#define MMU_CMD_T1 0x11 -#define MMU_CMD_T2 0x12 -#define MMU_CMD_T3 0x13 -#define MMU_CMD_T4 0x14 -#define MMU_CMD_L0 0x20 -#define MMU_CMD_L1 0x21 -#define MMU_CMD_L2 0x22 -#define MMU_CMD_L3 0x23 -#define MMU_CMD_L4 0x24 -#define MMU_CMD_C0 0x30 -#define MMU_CMD_U0 0x40 -#define MMU_CMD_E0 0x50 -#define MMU_CMD_E1 0x51 -#define MMU_CMD_E2 0x52 -#define MMU_CMD_E3 0x53 -#define MMU_CMD_E4 0x54 -#define MMU_CMD_R0 0x60 -#define MMU_CMD_F0 0x70 -#define MMU_CMD_F1 0x71 -#define MMU_CMD_F2 0x72 -#define MMU_CMD_F3 0x73 -#define MMU_CMD_F4 0x74 - -#if ENABLED(MMU2_MODE_12V) - #define MMU_REQUIRED_FW_BUILDNR 132 -#else - #define MMU_REQUIRED_FW_BUILDNR 126 -#endif - -#define MMU2_NO_TOOL 99 -#define MMU_BAUD 115200 - -#define mmuSerial MMU2_SERIAL - -bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; -uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder; -int8_t MMU2::state = 0; -volatile int8_t MMU2::finda = 1; -volatile bool MMU2::finda_runout_valid; -int16_t MMU2::version = -1, MMU2::buildnr = -1; -millis_t MMU2::last_request, MMU2::next_P0_request; -char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; - -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) - - struct E_Step { - float extrude; //!< extrude distance in mm - feedRate_t feedRate; //!< feed rate in mm/s - }; - - static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }; - static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE }; - -#endif // MMU2_MENUS - -MMU2::MMU2() { - rx_buffer[0] = '\0'; -} - -void MMU2::init() { - - set_runout_valid(false); - - #if PIN_EXISTS(MMU2_RST) - // TODO use macros for this - WRITE(MMU2_RST_PIN, HIGH); - SET_OUTPUT(MMU2_RST_PIN); - #endif - - mmuSerial.begin(MMU_BAUD); - extruder = MMU2_NO_TOOL; - - safe_delay(10); - reset(); - rx_buffer[0] = '\0'; - state = -1; -} - -void MMU2::reset() { - DEBUG_ECHOLNPGM("MMU <= reset"); - - #if PIN_EXISTS(MMU2_RST) - WRITE(MMU2_RST_PIN, LOW); - safe_delay(20); - WRITE(MMU2_RST_PIN, HIGH); - #else - tx_str_P(PSTR("X0\n")); // Send soft reset - #endif -} - -uint8_t MMU2::get_current_tool() { - return extruder == MMU2_NO_TOOL ? -1 : extruder; -} - -void MMU2::mmu_loop() { - - switch (state) { - - case 0: break; - - case -1: - if (rx_start()) { - DEBUG_ECHOLNPGM("MMU => 'start'"); - DEBUG_ECHOLNPGM("MMU <= 'S1'"); - - // send "read version" request - tx_str_P(PSTR("S1\n")); - - state = -2; - } - else if (millis() > 3000000) { - SERIAL_ECHOLNPGM("MMU not responding - DISABLED"); - state = 0; - } - break; - - case -2: - if (rx_ok()) { - sscanf(rx_buffer, "%uok\n", &version); - - DEBUG_ECHOLNPAIR("MMU => ", version, "\nMMU <= 'S2'"); - - tx_str_P(PSTR("S2\n")); // read build number - state = -3; - } - break; - - case -3: - if (rx_ok()) { - sscanf(rx_buffer, "%uok\n", &buildnr); - - DEBUG_ECHOLNPAIR("MMU => ", buildnr); - - check_version(); - - #if ENABLED(MMU2_MODE_12V) - DEBUG_ECHOLNPGM("MMU <= 'M1'"); - - tx_str_P(PSTR("M1\n")); // switch to stealth mode - state = -5; - - #else - DEBUG_ECHOLNPGM("MMU <= 'P0'"); - - tx_str_P(PSTR("P0\n")); // read finda - state = -4; - #endif - } - break; - - #if ENABLED(MMU2_MODE_12V) - case -5: - // response to M1 - if (rx_ok()) { - DEBUG_ECHOLNPGM("MMU => ok"); - - DEBUG_ECHOLNPGM("MMU <= 'P0'"); - - tx_str_P(PSTR("P0\n")); // read finda - state = -4; - } - break; - #endif - - case -4: - if (rx_ok()) { - sscanf(rx_buffer, "%hhuok\n", &finda); - - DEBUG_ECHOLNPAIR("MMU => ", finda, "\nMMU - ENABLED"); - - enabled = true; - state = 1; - } - break; - - case 1: - if (cmd) { - if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T4)) { - // tool change - int filament = cmd - MMU_CMD_T0; - DEBUG_ECHOLNPAIR("MMU <= T", filament); - tx_printf_P(PSTR("T%d\n"), filament); - state = 3; // wait for response - } - else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L4)) { - // load - int filament = cmd - MMU_CMD_L0; - DEBUG_ECHOLNPAIR("MMU <= L", filament); - tx_printf_P(PSTR("L%d\n"), filament); - state = 3; // wait for response - } - else if (cmd == MMU_CMD_C0) { - // continue loading - DEBUG_ECHOLNPGM("MMU <= 'C0'"); - tx_str_P(PSTR("C0\n")); - state = 3; // wait for response - } - else if (cmd == MMU_CMD_U0) { - // unload current - DEBUG_ECHOLNPGM("MMU <= 'U0'"); - - tx_str_P(PSTR("U0\n")); - state = 3; // wait for response - } - else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E4)) { - // eject filament - int filament = cmd - MMU_CMD_E0; - DEBUG_ECHOLNPAIR("MMU <= E", filament); - tx_printf_P(PSTR("E%d\n"), filament); - state = 3; // wait for response - } - else if (cmd == MMU_CMD_R0) { - // recover after eject - DEBUG_ECHOLNPGM("MMU <= 'R0'"); - tx_str_P(PSTR("R0\n")); - state = 3; // wait for response - } - else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F4)) { - // filament type - int filament = cmd - MMU_CMD_F0; - DEBUG_ECHOPAIR("MMU <= F", filament, " "); - DEBUG_ECHO_F(cmd_arg, DEC); - DEBUG_EOL(); - tx_printf_P(PSTR("F%d %d\n"), filament, cmd_arg); - state = 3; // wait for response - } - - last_cmd = cmd; - cmd = MMU_CMD_NONE; - } - else if (ELAPSED(millis(), next_P0_request)) { - // read FINDA - tx_str_P(PSTR("P0\n")); - state = 2; // wait for response - } - break; - - case 2: // response to command P0 - if (rx_ok()) { - sscanf(rx_buffer, "%hhuok\n", &finda); - - // This is super annoying. Only activate if necessary - // if (finda_runout_valid) DEBUG_ECHOLNPAIR_F("MMU <= 'P0'\nMMU => ", finda, 6); - - state = 1; - - if (cmd == 0) ready = true; - - if (!finda && finda_runout_valid) filament_runout(); - } - else if (ELAPSED(millis(), last_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s) - state = 1; - - break; - - case 3: // response to mmu commands - if (rx_ok()) { - DEBUG_ECHOLNPGM("MMU => 'ok'"); - ready = true; - state = 1; - last_cmd = MMU_CMD_NONE; - } - else if (ELAPSED(millis(), last_request + MMU_CMD_TIMEOUT)) { - // resend request after timeout - if (last_cmd) { - DEBUG_ECHOLNPGM("MMU retry"); - cmd = last_cmd; - last_cmd = MMU_CMD_NONE; - } - state = 1; - } - break; - } -} - -/** - * Check if MMU was started - */ -bool MMU2::rx_start() { - // check for start message - if (rx_str_P(PSTR("start\n"))) { - next_P0_request = millis() + 300; - return true; - } - return false; -} - -/** - * Check if the data received ends with the given string. - */ -bool MMU2::rx_str_P(const char* str) { - uint8_t i = strlen(rx_buffer); - - while (mmuSerial.available()) { - rx_buffer[i++] = mmuSerial.read(); - rx_buffer[i] = '\0'; - - if (i == sizeof(rx_buffer) - 1) { - DEBUG_ECHOLNPGM("rx buffer overrun"); - break; - } - } - - uint8_t len = strlen_P(str); - - if (i < len) return false; - - str += len; - - while (len--) { - char c0 = pgm_read_byte(str--), c1 = rx_buffer[i--]; - if (c0 == c1) continue; - if (c0 == '\r' && c1 == '\n') continue; // match cr as lf - if (c0 == '\n' && c1 == '\r') continue; // match lf as cr - return false; - } - return true; -} - -/** - * Transfer data to MMU, no argument - */ -void MMU2::tx_str_P(const char* str) { - clear_rx_buffer(); - uint8_t len = strlen_P(str); - for (uint8_t i = 0; i < len; i++) mmuSerial.write(pgm_read_byte(str++)); - rx_buffer[0] = '\0'; - last_request = millis(); -} - -/** - * Transfer data to MMU, single argument - */ -void MMU2::tx_printf_P(const char* format, int argument = -1) { - clear_rx_buffer(); - uint8_t len = sprintf_P(tx_buffer, format, argument); - for (uint8_t i = 0; i < len; i++) mmuSerial.write(tx_buffer[i]); - rx_buffer[0] = '\0'; - last_request = millis(); -} - -/** - * Transfer data to MMU, two arguments - */ -void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { - clear_rx_buffer(); - uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2); - for (uint8_t i = 0; i < len; i++) mmuSerial.write(tx_buffer[i]); - rx_buffer[0] = '\0'; - last_request = millis(); -} - -/** - * Empty the rx buffer - */ -void MMU2::clear_rx_buffer() { - while (mmuSerial.available()) mmuSerial.read(); - rx_buffer[0] = '\0'; -} - -/** - * Check if we received 'ok' from MMU - */ -bool MMU2::rx_ok() { - if (rx_str_P(PSTR("ok\n"))) { - next_P0_request = millis() + 300; - return true; - } - return false; -} - -/** - * Check if MMU has compatible firmware - */ -void MMU2::check_version() { - if (buildnr < MMU_REQUIRED_FW_BUILDNR) { - SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required."); - kill(GET_TEXT(MSG_MMU2_WRONG_FIRMWARE)); - } -} - -/** - * Handle tool change - */ -void MMU2::tool_change(uint8_t index) { - - if (!enabled) return; - - set_runout_valid(false); - - if (index != extruder) { - - disable_E0(); - ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); - - command(MMU_CMD_T0 + index); - - manage_response(true, true); - - command(MMU_CMD_C0); - extruder = index; //filament change is finished - active_extruder = 0; - - enable_E0(); - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder)); - - ui.reset_status(); - } - - set_runout_valid(true); -} - -/** - * - * Handle special T?/Tx/Tc commands - * - * T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically - * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. - * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. - * - */ -void MMU2::tool_change(const char* special) { - - if (!enabled) return; - - #if ENABLED(MMU2_MENUS) - - set_runout_valid(false); - - switch (*special) { - case '?': { - uint8_t index = mmu2_choose_filament(); - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); - load_filament_to_nozzle(index); - } break; - - case 'x': { - planner.synchronize(); - uint8_t index = mmu2_choose_filament(); - disable_E0(); - command(MMU_CMD_T0 + index); - manage_response(true, true); - command(MMU_CMD_C0); - mmu_loop(); - - enable_E0(); - extruder = index; - active_extruder = 0; - } break; - - case 'c': { - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); - execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); - } break; - } - - set_runout_valid(true); - - #endif -} - -/** - * Set next command - */ -void MMU2::command(const uint8_t mmu_cmd) { - if (!enabled) return; - cmd = mmu_cmd; - ready = false; -} - -/** - * Wait for response from MMU - */ -bool MMU2::get_response() { - while (cmd != MMU_CMD_NONE) idle(); - - while (!ready) { - idle(); - if (state != 3) break; - } - - const bool ret = ready; - ready = false; - - return ret; -} - -/** - * Wait for response and deal with timeout if nexcessary - */ -void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { - - constexpr xyz_pos_t park_point = NOZZLE_PARK_POINT; - bool response = false; - mmu_print_saved = false; - xyz_pos_t resume_position; - int16_t resume_hotend_temp; - - KEEPALIVE_STATE(PAUSED_FOR_USER); - - while (!response) { - - response = get_response(); // wait for "ok" from mmu - - if (!response) { // No "ok" was received in reserved time frame, user will fix the issue on mmu unit - if (!mmu_print_saved) { // First occurrence. Save current position, park print head, disable nozzle heater. - - planner.synchronize(); - - mmu_print_saved = true; - - SERIAL_ECHOLNPGM("MMU not responding"); - - resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); - resume_position = current_position; - - if (move_axes && all_axes_homed()) - nozzle.park(2, park_point /*= NOZZLE_PARK_POINT*/); - - if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder); - - LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING); - BUZZ(100, 659); - BUZZ(200, 698); - BUZZ(100, 659); - BUZZ(300, 440); - BUZZ(100, 659); - } - } - else if (mmu_print_saved) { - SERIAL_ECHOLNPGM("MMU starts responding\n"); - - if (turn_off_nozzle && resume_hotend_temp) { - thermalManager.setTargetHotend(resume_hotend_temp, active_extruder); - LCD_MESSAGEPGM(MSG_HEATING); - BUZZ(200, 40); - - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000); - } - - if (move_axes && all_axes_homed()) { - LCD_MESSAGEPGM(MSG_MMU2_RESUMING); - BUZZ(200, 404); - BUZZ(200, 404); - - // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); - - // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - } - else { - BUZZ(200, 404); - BUZZ(200, 404); - LCD_MESSAGEPGM(MSG_MMU2_RESUMING); - } - } - } -} - -void MMU2::set_filament_type(uint8_t index, uint8_t filamentType) { - if (!enabled) return; - - cmd_arg = filamentType; - command(MMU_CMD_F0 + index); - - manage_response(true, true); -} - -void MMU2::filament_runout() { - queue.inject_P(PSTR(MMU2_FILAMENT_RUNOUT_SCRIPT)); - planner.synchronize(); -} - -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) - - // Load filament into MMU2 - void MMU2::load_filament(uint8_t index) { - if (!enabled) return; - command(MMU_CMD_L0 + index); - manage_response(false, false); - BUZZ(200, 404); - } - - /** - * - * Switch material and load to nozzle - * - */ - bool MMU2::load_filament_to_nozzle(uint8_t index) { - - if (!enabled) return false; - - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } - else { - command(MMU_CMD_T0 + index); - manage_response(true, true); - command(MMU_CMD_C0); - mmu_loop(); - - extruder = index; - active_extruder = 0; - - load_to_nozzle(); - - BUZZ(200, 404); - return true; - } - } - - /** - * - * Load filament to nozzle of multimaterial printer - * - * This function is used only only after T? (user select filament) and M600 (change filament). - * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading - * filament to nozzle. - */ - void MMU2::load_to_nozzle() { - if (!enabled) return; - execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); - } - - bool MMU2::eject_filament(uint8_t index, bool recover) { - - if (!enabled) return false; - - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } - - LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); - - enable_E0(); - current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; - line_to_current_position(2500 / 60); - planner.synchronize(); - command(MMU_CMD_E0 + index); - manage_response(false, false); - - if (recover) { - LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER); - BUZZ(200, 404); - wait_for_user = true; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")); - #endif - while (wait_for_user) idle(); - BUZZ(200, 404); - BUZZ(200, 404); - - command(MMU_CMD_R0); - manage_response(false, false); - } - - ui.reset_status(); - - // no active tool - extruder = MMU2_NO_TOOL; - - set_runout_valid(false); - - BUZZ(200, 404); - - disable_E0(); - - return true; - } - - /** - * - * unload from hotend and retract to MMU - * - */ - bool MMU2::unload() { - - if (!enabled) return false; - - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } - - filament_ramming(); - - command(MMU_CMD_U0); - manage_response(false, true); - - BUZZ(200, 404); - - // no active tool - extruder = MMU2_NO_TOOL; - - set_runout_valid(false); - - return true; - } - - /** - * Unload sequence to optimize shape of the tip of the unloaded filament - */ - void MMU2::filament_ramming() { - execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); - } - - void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { - - planner.synchronize(); - enable_E0(); - - const E_Step* step = sequence; - - for (uint8_t i = 0; i < steps; i++) { - 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_mm_m); - - current_position.e += es; - line_to_current_position(MMM_TO_MMS(fr_mm_m)); - planner.synchronize(); - - step++; - } - - disable_E0(); - } - -#endif // HAS_LCD_MENU && MMU2_MENUS - -#endif // PRUSA_MMU2 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.h deleted file mode 100644 index 9628c4be7f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/mmu2.h +++ /dev/null @@ -1,101 +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 - -#include "../../inc/MarlinConfig.h" - -#if HAS_FILAMENT_SENSOR - #include "../runout.h" -#endif - -#if SERIAL_USB - #define MMU_RX_SIZE 256 - #define MMU_TX_SIZE 256 -#else - #define MMU_RX_SIZE 16 - #define MMU_TX_SIZE 16 -#endif - -struct E_Step; - -class MMU2 { -public: - MMU2(); - - static void init(); - static void reset(); - static void mmu_loop(); - static void tool_change(uint8_t index); - static void tool_change(const char* special); - static uint8_t get_current_tool(); - static void set_filament_type(uint8_t index, uint8_t type); - - #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) - static bool unload(); - static void load_filament(uint8_t); - static void load_all(); - static bool load_filament_to_nozzle(uint8_t index); - static bool eject_filament(uint8_t index, bool recover); - #endif - -private: - static bool rx_str_P(const char* str); - static void tx_str_P(const char* str); - static void tx_printf_P(const char* format, int argument); - static void tx_printf_P(const char* format, int argument1, int argument2); - static void clear_rx_buffer(); - - static bool rx_ok(); - static bool rx_start(); - static void check_version(); - - static void command(const uint8_t cmd); - static bool get_response(); - static void manage_response(const bool move_axes, const bool turn_off_nozzle); - - #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) - static void load_to_nozzle(); - static void filament_ramming(); - static void execute_extruder_sequence(const E_Step * sequence, int steps); - #endif - - static void filament_runout(); - - static bool enabled, ready, mmu_print_saved; - static uint8_t cmd, cmd_arg, last_cmd, extruder; - static int8_t state; - static volatile int8_t finda; - static volatile bool finda_runout_valid; - static int16_t version, buildnr; - static millis_t last_request, next_P0_request; - static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE]; - - static inline void set_runout_valid(const bool valid) { - finda_runout_valid = valid; - #if HAS_FILAMENT_SENSOR - if (valid) runout.reset(); - #endif - } - -}; - -extern MMU2 mmu2; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/serial-protocol.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/serial-protocol.md deleted file mode 100644 index 936830e1dc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/prusa_MMU2/serial-protocol.md +++ /dev/null @@ -1,94 +0,0 @@ -Startup sequence -================ - -When initialized, MMU sends - -- MMU => 'start\n' - -We follow with - -- MMU <= 'S1\n' -- MMU => 'ok*Firmware version*\n' -- MMU <= 'S2\n' -- MMU => 'ok*Build number*\n' - -#if (12V_mode) - -- MMU <= 'M1\n' -- MMU => 'ok\n' - -#endif - -- MMU <= 'P0\n' -- MMU => '*FINDA status*\n' - -Now we are sure MMU is available and ready. If there was a timeout or other communication problem somewhere, printer will be killed. - -- *Firmware version* is an integer value, but we don't care about it -- *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled -- *FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise - - -*Build number* is checked against the required value, if it does not match, printer is halted. - - - -Toolchange -========== - -- MMU <= 'T*Filament index*\n' - -MMU sends - -- MMU => 'ok\n' - -as soon as the filament is fed down to the extruder. We follow with - -- MMU <= 'C0\n' - -MMU will feed a few more millimeters of filament for the extruder gears to grab. -When done, the MMU sends - -- MMU => 'ok\n' - -We don't wait for a response here but immediately continue with the next gcode which should -be one or more extruder moves to feed the filament into the hotend. - - -FINDA status -============ - -- MMU <= 'P0\n' -- MMU => '*FINDA status*\n' - -*FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly. - - - -Load filament -============= - -- MMU <= 'L*Filament index*\n' - -MMU will feed filament down to the extruder, when done - -- MMU => 'ok\n' - - -Unload filament -============= - -- MMU <= 'U0\n' - -MMU will retract current filament from the extruder, when done - -- MMU => 'ok\n' - - - -Eject filament -============== - -- MMU <= 'E*Filament index*\n' -- MMU => 'ok\n' - diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.cpp deleted file mode 100644 index 6b8905c3b9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.cpp +++ /dev/null @@ -1,136 +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 . - * - */ - -/** - * feature/runout.cpp - Runout sensor support - */ - -#include "../inc/MarlinConfigPre.h" - -#if HAS_FILAMENT_SENSOR - -#include "runout.h" - -FilamentMonitor runout; - -bool FilamentMonitorBase::enabled = true, - FilamentMonitorBase::filament_ran_out; // = false - -#if ENABLED(HOST_ACTION_COMMANDS) - bool FilamentMonitorBase::host_handling; // = false -#endif - -/** - * Called by FilamentSensorSwitch::run when filament is detected. - * Called by FilamentSensorEncoder::block_completed when motion is detected. - */ -void FilamentSensorBase::filament_present(const uint8_t extruder) { - runout.filament_present(extruder); // calls response.filament_present(extruder) -} - -#if ENABLED(FILAMENT_MOTION_SENSOR) - uint8_t FilamentSensorEncoder::motion_detected; -#endif - -#ifdef FILAMENT_RUNOUT_DISTANCE_MM - float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; - volatile float RunoutResponseDelayed::runout_mm_countdown[EXTRUDERS]; -#else - int8_t RunoutResponseDebounced::runout_count; // = 0 -#endif - -// -// Filament Runout event handler -// -#include "../Marlin.h" -#include "../gcode/queue.h" - -#if ENABLED(HOST_ACTION_COMMANDS) - #include "host_actions.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -void event_filament_runout() { - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFilamentRunout(ExtUI::getActiveTool()); - #endif - - #if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS) - const char tool = '0' - #if NUM_RUNOUT_SENSORS > 1 - + active_extruder - #endif - ; - #endif - - //action:out_of_filament - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_end(); - host_action_prompt_begin(PSTR("FilamentRunout T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - host_action_prompt_show(); - #endif - - const bool run_runout_script = !runout.host_handling; - - #if ENABLED(HOST_ACTION_COMMANDS) - if (run_runout_script - && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") - || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") - #endif - ) - ) { - host_action_paused(false); - } - else { - // Legacy Repetier command for use until newer version supports standard dialog - // To be removed later when pause command also triggers dialog - #ifdef ACTION_ON_FILAMENT_RUNOUT - host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif - - host_action_pause(false); - } - SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " "); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif // HOST_ACTION_COMMANDS - - if (run_runout_script) - queue.inject_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); -} - -#endif // HAS_FILAMENT_SENSOR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.h deleted file mode 100644 index 4fed18e359..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/runout.h +++ /dev/null @@ -1,379 +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 - -/** - * feature/runout.h - Runout sensor support - */ - -#include "../sd/cardreader.h" -#include "../module/printcounter.h" -#include "../module/planner.h" -#include "../module/stepper.h" // for block_t -#include "../gcode/queue.h" - -#include "../inc/MarlinConfig.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "pause.h" -#endif - -//#define FILAMENT_RUNOUT_SENSOR_DEBUG -#ifndef FILAMENT_RUNOUT_THRESHOLD - #define FILAMENT_RUNOUT_THRESHOLD 5 -#endif - -void event_filament_runout(); - -class FilamentMonitorBase { - public: - static bool enabled, filament_ran_out; - - #if ENABLED(HOST_ACTION_COMMANDS) - static bool host_handling; - #else - static constexpr bool host_handling = false; - #endif -}; - -template -class TFilamentMonitor : public FilamentMonitorBase { - private: - typedef RESPONSE_T response_t; - typedef SENSOR_T sensor_t; - static response_t response; - static sensor_t sensor; - - public: - static inline void setup() { - sensor.setup(); - reset(); - } - - static inline void reset() { - filament_ran_out = false; - response.reset(); - } - - // Call this method when filament is present, - // so the response can reset its counter. - static inline void filament_present(const uint8_t extruder) { - response.filament_present(extruder); - } - - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - static inline float& runout_distance() { return response.runout_distance_mm; } - static inline void set_runout_distance(const float &mm) { response.runout_distance_mm = mm; } - #endif - - // Handle a block completion. RunoutResponseDelayed uses this to - // add up the length of filament moved while the filament is out. - static inline void block_completed(const block_t* const b) { - if (enabled) { - response.block_completed(b); - sensor.block_completed(b); - } - } - - // Give the response a chance to update its counter. - static inline void run() { - if (enabled && !filament_ran_out && (printingIsActive() - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || did_pause_print - #endif - )) { - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here - #endif - response.run(); - sensor.run(); - const bool ran_out = response.has_run_out(); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - sei(); - #endif - if (ran_out) { - filament_ran_out = true; - event_filament_runout(); - planner.synchronize(); - } - } - } -}; - -/*************************** FILAMENT PRESENCE SENSORS ***************************/ - -class FilamentSensorBase { - protected: - static void filament_present(const uint8_t extruder); - - public: - static inline void setup() { - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #elif ENABLED(FIL_RUNOUT_PULLDOWN) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) - #endif - - INIT_RUNOUT_PIN(FIL_RUNOUT_PIN); - #if NUM_RUNOUT_SENSORS > 1 - INIT_RUNOUT_PIN(FIL_RUNOUT2_PIN); - #if NUM_RUNOUT_SENSORS > 2 - INIT_RUNOUT_PIN(FIL_RUNOUT3_PIN); - #if NUM_RUNOUT_SENSORS > 3 - INIT_RUNOUT_PIN(FIL_RUNOUT4_PIN); - #if NUM_RUNOUT_SENSORS > 4 - INIT_RUNOUT_PIN(FIL_RUNOUT5_PIN); - #if NUM_RUNOUT_SENSORS > 5 - INIT_RUNOUT_PIN(FIL_RUNOUT6_PIN); - #endif - #endif - #endif - #endif - #endif - } - - // Return a bitmask of runout pin states - static inline uint8_t poll_runout_pins() { - return ( - (READ(FIL_RUNOUT_PIN ) ? _BV(0) : 0) - #if NUM_RUNOUT_SENSORS > 1 - | (READ(FIL_RUNOUT2_PIN) ? _BV(1) : 0) - #if NUM_RUNOUT_SENSORS > 2 - | (READ(FIL_RUNOUT3_PIN) ? _BV(2) : 0) - #if NUM_RUNOUT_SENSORS > 3 - | (READ(FIL_RUNOUT4_PIN) ? _BV(3) : 0) - #if NUM_RUNOUT_SENSORS > 4 - | (READ(FIL_RUNOUT5_PIN) ? _BV(4) : 0) - #if NUM_RUNOUT_SENSORS > 5 - | (READ(FIL_RUNOUT6_PIN) ? _BV(5) : 0) - #endif - #endif - #endif - #endif - #endif - ); - } - - // Return a bitmask of runout flag states (1 bits always indicates runout) - static inline uint8_t poll_runout_states() { - return poll_runout_pins() ^ uint8_t( - #if DISABLED(FIL_RUNOUT_INVERTING) - _BV(NUM_RUNOUT_SENSORS) - 1 - #else - 0 - #endif - ); - } -}; - -#if ENABLED(FILAMENT_MOTION_SENSOR) - - /** - * This sensor uses a magnetic encoder disc and a Hall effect - * sensor (or a slotted disc and optical sensor). The state - * will toggle between 0 and 1 on filament movement. It can detect - * filament runout and stripouts or jams. - */ - class FilamentSensorEncoder : public FilamentSensorBase { - private: - static uint8_t motion_detected; - - static inline void poll_motion_sensor() { - static uint8_t old_state; - const uint8_t new_state = poll_runout_pins(), - change = old_state ^ new_state; - old_state = new_state; - - #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG - if (change) { - SERIAL_ECHOPGM("Motion detected:"); - for (uint8_t e = 0; e < NUM_RUNOUT_SENSORS; e++) - if (TEST(change, e)) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + e); } - SERIAL_EOL(); - } - #endif - - motion_detected |= change; - } - - public: - static inline void block_completed(const block_t* const b) { - // If the sensor wheel has moved since the last call to - // this method reset the runout counter for the extruder. - if (TEST(motion_detected, b->extruder)) - filament_present(b->extruder); - - // Clear motion triggers for next block - motion_detected = 0; - } - - static inline void run() { poll_motion_sensor(); } - }; - -#else - - /** - * This is a simple endstop switch in the path of the filament. - * It can detect filament runout, but not stripouts or jams. - */ - class FilamentSensorSwitch : public FilamentSensorBase { - private: - static inline bool poll_runout_state(const uint8_t extruder) { - const uint8_t runout_states = poll_runout_states(); - - #if NUM_RUNOUT_SENSORS == 1 - UNUSED(extruder); - #endif - - if (true - #if NUM_RUNOUT_SENSORS > 1 - #if ENABLED(DUAL_X_CARRIAGE) - && (dual_x_carriage_mode == DXC_DUPLICATION_MODE || dual_x_carriage_mode == DXC_MIRRORED_MODE) - #elif ENABLED(MULTI_NOZZLE_DUPLICATION) - && extruder_duplication_enabled - #else - && false - #endif - #endif - ) return runout_states; // Any extruder - - #if NUM_RUNOUT_SENSORS > 1 - return TEST(runout_states, extruder); // Specific extruder - #endif - } - - public: - static inline void block_completed(const block_t* const) {} - - static inline void run() { - const bool out = poll_runout_state(active_extruder); - if (!out) filament_present(active_extruder); - #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG - static bool was_out = false; - if (out != was_out) { - was_out = out; - SERIAL_ECHOPGM("Filament "); - serialprintPGM(out ? PSTR("OUT\n") : PSTR("IN\n")); - } - #endif - } - }; - - -#endif // !FILAMENT_MOTION_SENSOR - -/********************************* RESPONSE TYPE *********************************/ - -#ifdef FILAMENT_RUNOUT_DISTANCE_MM - - // RunoutResponseDelayed triggers a runout event only if the length - // of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed - // during a runout condition. - class RunoutResponseDelayed { - private: - static volatile float runout_mm_countdown[EXTRUDERS]; - - public: - static float runout_distance_mm; - - static inline void reset() { - LOOP_L_N(i, EXTRUDERS) filament_present(i); - } - - static inline void run() { - #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG - static millis_t t = 0; - const millis_t ms = millis(); - if (ELAPSED(ms, t)) { - t = millis() + 1000UL; - LOOP_L_N(i, EXTRUDERS) { - serialprintPGM(i ? PSTR(", ") : PSTR("Remaining mm: ")); - SERIAL_ECHO(runout_mm_countdown[i]); - } - SERIAL_EOL(); - } - #endif - } - - static inline bool has_run_out() { - return runout_mm_countdown[active_extruder] < 0; - } - - static inline void filament_present(const uint8_t extruder) { - runout_mm_countdown[extruder] = runout_distance_mm; - } - - static inline void block_completed(const block_t* const b) { - if (b->steps.x || b->steps.y || b->steps.z - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || did_pause_print // Allow pause purge move to re-trigger runout state - #endif - ) { - // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. - const uint8_t e = b->extruder; - const int32_t steps = b->steps.e; - runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.steps_to_mm[E_AXIS_N(e)]; - } - } - }; - -#else // !FILAMENT_RUNOUT_DISTANCE_MM - - // RunoutResponseDebounced triggers a runout event after a runout - // condition has been detected runout_threshold times in a row. - - class RunoutResponseDebounced { - private: - static constexpr int8_t runout_threshold = FILAMENT_RUNOUT_THRESHOLD; - static int8_t runout_count; - public: - static inline void reset() { runout_count = runout_threshold; } - static inline void run() { if (runout_count >= 0) runout_count--; } - static inline bool has_run_out() { return runout_count < 0; } - static inline void block_completed(const block_t* const) { } - static inline void filament_present(const uint8_t) { runout_count = runout_threshold; } - }; - -#endif // !FILAMENT_RUNOUT_DISTANCE_MM - -/********************************* TEMPLATE SPECIALIZATION *********************************/ - -typedef TFilamentMonitor< - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - RunoutResponseDelayed, - #if ENABLED(FILAMENT_MOTION_SENSOR) - FilamentSensorEncoder - #else - FilamentSensorSwitch - #endif - #else - RunoutResponseDebounced, FilamentSensorSwitch - #endif -> FilamentMonitor; - -extern FilamentMonitor runout; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.cpp deleted file mode 100644 index 8cfe3bf51a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.cpp +++ /dev/null @@ -1,38 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(MK2_MULTIPLEXER) - -#include "../module/stepper.h" - -void select_multiplexed_stepper(const uint8_t e) { - planner.synchronize(); - disable_e_steppers(); - WRITE(E_MUX0_PIN, TEST(e, 0) ? HIGH : LOW); - WRITE(E_MUX1_PIN, TEST(e, 1) ? HIGH : LOW); - WRITE(E_MUX2_PIN, TEST(e, 2) ? HIGH : LOW); - safe_delay(100); -} - -#endif // MK2_MULTIPLEXER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.h deleted file mode 100644 index f54211a21d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/snmm.h +++ /dev/null @@ -1,24 +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 - -void select_multiplexed_stepper(const uint8_t e); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.cpp deleted file mode 100644 index c25e2e5dab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.cpp +++ /dev/null @@ -1,98 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) - -#include "solenoid.h" - -#include "../module/motion.h" // for active_extruder - -#if ENABLED(MANUAL_SOLENOID_CONTROL) - #define HAS_SOLENOID(N) HAS_SOLENOID_##N -#else - #define HAS_SOLENOID(N) (HAS_SOLENOID_##N && EXTRUDERS > N) -#endif - -// Used primarily with MANUAL_SOLENOID_CONTROL -static void set_solenoid(const uint8_t num, const bool active) { - const uint8_t value = active ? HIGH : LOW; - switch (num) { - case 0: - OUT_WRITE(SOL0_PIN, value); - break; - #if HAS_SOLENOID(1) - case 1: - OUT_WRITE(SOL1_PIN, value); - break; - #endif - #if HAS_SOLENOID(2) - case 2: - OUT_WRITE(SOL2_PIN, value); - break; - #endif - #if HAS_SOLENOID(3) - case 3: - OUT_WRITE(SOL3_PIN, value); - break; - #endif - #if HAS_SOLENOID(4) - case 4: - OUT_WRITE(SOL4_PIN, value); - break; - #endif - #if HAS_SOLENOID(5) - case 5: - OUT_WRITE(SOL5_PIN, value); - break; - #endif - default: - SERIAL_ECHO_MSG(MSG_INVALID_SOLENOID); - break; - } -} - -void enable_solenoid(const uint8_t num) { set_solenoid(num, true); } -void disable_solenoid(const uint8_t num) { set_solenoid(num, false); } -void enable_solenoid_on_active_extruder() { enable_solenoid(active_extruder); } - -void disable_all_solenoids() { - disable_solenoid(0); - #if HAS_SOLENOID(1) - disable_solenoid(1); - #endif - #if HAS_SOLENOID(2) - disable_solenoid(2); - #endif - #if HAS_SOLENOID(3) - disable_solenoid(3); - #endif - #if HAS_SOLENOID(4) - disable_solenoid(4); - #endif - #if HAS_SOLENOID(5) - disable_solenoid(5); - #endif -} - -#endif // EXT_SOLENOID || MANUAL_SOLENOID_CONTROL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.h deleted file mode 100644 index db94c4fe2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/solenoid.h +++ /dev/null @@ -1,27 +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 - -void enable_solenoid_on_active_extruder(); -void disable_all_solenoids(); -void enable_solenoid(const uint8_t num); -void disable_solenoid(const uint8_t num); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.cpp deleted file mode 100644 index 775e7a864a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.cpp +++ /dev/null @@ -1,101 +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 . - * - */ - -/** - * feature/spindle_laser.cpp - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_CUTTER - -#include "spindle_laser.h" - -SpindleLaser cutter; - -cutter_power_t SpindleLaser::power; // = 0 - -#define SPINDLE_LASER_PWM_OFF ((SPINDLE_LASER_PWM_INVERT) ? 255 : 0) - -void SpindleLaser::init() { - OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Init spindle to off - #if ENABLED(SPINDLE_CHANGE_DIR) - OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3) - #endif - #if ENABLED(SPINDLE_LASER_PWM) - SET_PWM(SPINDLE_LASER_PWM_PIN); - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // set to lowest speed - #endif -} - -#if ENABLED(SPINDLE_LASER_PWM) - - /** - * ocr_val_mode() is used for debugging and to get the points needed to compute the RPM vs ocr_val line - * - * it accepts inputs of 0-255 - */ - void SpindleLaser::set_ocr(const uint8_t ocr) { - WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on (active low) - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); - } - -#endif - -void SpindleLaser::apply_power(const cutter_power_t inpow) { - static cutter_power_t last_power_applied = 0; - if (inpow == last_power_applied) return; - last_power_applied = inpow; - #if ENABLED(SPINDLE_LASER_PWM) - if (enabled()) { - #define _scaled(F) ((F - (SPEED_POWER_INTERCEPT)) * inv_slope) - constexpr float inv_slope = RECIPROCAL(SPEED_POWER_SLOPE), - min_ocr = _scaled(SPEED_POWER_MIN), - max_ocr = _scaled(SPEED_POWER_MAX); - int16_t ocr_val; - if (inpow <= SPEED_POWER_MIN) ocr_val = min_ocr; // Use minimum if set below - else if (inpow >= SPEED_POWER_MAX) ocr_val = max_ocr; // Use maximum if set above - else ocr_val = _scaled(inpow); // Use calculated OCR value - set_ocr(ocr_val & 0xFF); // ...limited to Atmel PWM max - } - else { - WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off (active low) - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Only write low byte - } - #else - WRITE(SPINDLE_LASER_ENA_PIN, (SPINDLE_LASER_ACTIVE_HIGH) ? enabled() : !enabled()); - #endif -} - -#if ENABLED(SPINDLE_CHANGE_DIR) - - void SpindleLaser::set_direction(const bool reverse) { - const bool dir_state = (reverse == SPINDLE_INVERT_DIR); // Forward (M3) HIGH when not inverted - #if ENABLED(SPINDLE_STOP_ON_DIR_CHANGE) - if (enabled() && READ(SPINDLE_DIR_PIN) != dir_state) disable(); - #endif - WRITE(SPINDLE_DIR_PIN, dir_state); - } - -#endif - -#endif // HAS_CUTTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.h deleted file mode 100644 index 26d7c301b4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/spindle_laser.h +++ /dev/null @@ -1,95 +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 - -/** - * feature/spindle_laser.h - * Support for Laser Power or Spindle Power & Direction - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SPINDLE_FEATURE) - #define _MSG_CUTTER(M) MSG_SPINDLE_##M -#else - #define _MSG_CUTTER(M) MSG_LASER_##M -#endif -#define MSG_CUTTER(M) _MSG_CUTTER(M) - -#if SPEED_POWER_MAX > 255 - typedef uint16_t cutter_power_t; - #define CUTTER_MENU_TYPE uint16_5 -#else - typedef uint8_t cutter_power_t; - #define CUTTER_MENU_TYPE uint8 -#endif - -class SpindleLaser { -public: - static cutter_power_t power; - static inline uint8_t powerPercent(const uint8_t pp) { return ui8_to_percent(pp); } // for display - - static void init(); - - static inline bool enabled() { return !!power; } - - static inline void set_power(const cutter_power_t pwr) { power = pwr; } - - static inline void refresh() { apply_power(power); } - - static inline void set_enabled(const bool enable) { - const bool was = enabled(); - set_power(enable ? 255 : 0); - if (was != enable) power_delay(); - } - - static void apply_power(const cutter_power_t inpow); - - //static bool active() { return READ(SPINDLE_LASER_ENA_PIN) == SPINDLE_LASER_ACTIVE_HIGH; } - - static void update_output(); - - #if ENABLED(SPINDLE_LASER_PWM) - static void set_ocr(const uint8_t ocr); - static inline void set_ocr_power(const cutter_power_t pwr) { power = pwr; set_ocr(pwr); } - #endif - - // Wait for spindle to spin up or spin down - static inline void power_delay() { - #if SPINDLE_LASER_POWERUP_DELAY || SPINDLE_LASER_POWERDOWN_DELAY - safe_delay(enabled() ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); - #endif - } - - #if ENABLED(SPINDLE_CHANGE_DIR) - static void set_direction(const bool reverse); - #else - static inline void set_direction(const bool) {} - #endif - - static inline void disable() { set_enabled(false); } - static inline void enable_forward() { set_direction(false); set_enabled(true); } - static inline void enable_reverse() { set_direction(true); set_enabled(true); } - -}; - -extern SpindleLaser cutter; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.cpp deleted file mode 100644 index f5c9509831..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.cpp +++ /dev/null @@ -1,1179 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "tmc_util.h" -#include "../Marlin.h" - -#include "../module/stepper/indirection.h" -#include "../module/printcounter.h" -#include "../libs/duration_t.h" -#include "../gcode/gcode.h" - -#if ENABLED(TMC_DEBUG) - #include "../module/planner.h" - #include "../libs/hex_print_routines.h" - #if ENABLED(MONITOR_DRIVER_STATUS) - static uint16_t report_tmc_status_interval; // = 0 - #endif -#endif - -#if HAS_LCD_MENU - #include "../module/stepper.h" -#endif - -/** - * Check for over temperature or short to ground error flags. - * Report and log warning of overtemperature condition. - * Reduce driver current in a persistent otpw condition. - * Keep track of otpw counter so we don't reduce current on a single instance, - * and so we don't repeatedly report warning before the condition is cleared. - */ -#if ENABLED(MONITOR_DRIVER_STATUS) - - struct TMC_driver_data { - uint32_t drv_status; - bool is_otpw:1, - is_ot:1, - is_s2g:1, - is_error:1 - #if ENABLED(TMC_DEBUG) - , is_stall:1 - , is_stealth:1 - , is_standstill:1 - #if HAS_STALLGUARD - , sg_result_reasonable:1 - #endif - #endif - ; - #if ENABLED(TMC_DEBUG) - #if HAS_TMCX1X0 || HAS_TMC220x - uint8_t cs_actual; - #endif - #if HAS_STALLGUARD - uint16_t sg_result; - #endif - #endif - }; - - #if HAS_TMCX1X0 - - #if ENABLED(TMC_DEBUG) - static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); } - #endif - - static TMC_driver_data get_driver_data(TMC2130Stepper &st) { - constexpr uint8_t OT_bp = 25, OTPW_bp = 26; - constexpr uint32_t S2G_bm = 0x18000000; - #if ENABLED(TMC_DEBUG) - constexpr uint16_t SG_RESULT_bm = 0x3FF; // 0:9 - constexpr uint8_t STEALTH_bp = 14; - constexpr uint32_t CS_ACTUAL_bm = 0x1F0000; // 16:20 - constexpr uint8_t STALL_GUARD_bp = 24; - constexpr uint8_t STST_bp = 31; - #endif - TMC_driver_data data; - const auto ds = data.drv_status = st.DRV_STATUS(); - #ifdef __AVR__ - - // 8-bit optimization saves up to 70 bytes of PROGMEM per axis - uint8_t spart; - #if ENABLED(TMC_DEBUG) - data.sg_result = ds & SG_RESULT_bm; - spart = ds >> 8; - data.is_stealth = TEST(spart, STEALTH_bp - 8); - spart = ds >> 16; - data.cs_actual = spart & (CS_ACTUAL_bm >> 16); - #endif - spart = ds >> 24; - data.is_ot = TEST(spart, OT_bp - 24); - data.is_otpw = TEST(spart, OTPW_bp - 24); - data.is_s2g = !!(spart & (S2G_bm >> 24)); - #if ENABLED(TMC_DEBUG) - data.is_stall = TEST(spart, STALL_GUARD_bp - 24); - data.is_standstill = TEST(spart, STST_bp - 24); - data.sg_result_reasonable = !data.is_standstill; // sg_result has no reasonable meaning while standstill - #endif - - #else // !__AVR__ - - data.is_ot = TEST(ds, OT_bp); - data.is_otpw = TEST(ds, OTPW_bp); - data.is_s2g = !!(ds & S2G_bm); - #if ENABLED(TMC_DEBUG) - constexpr uint8_t CS_ACTUAL_sb = 16; - data.sg_result = ds & SG_RESULT_bm; - data.is_stealth = TEST(ds, STEALTH_bp); - data.cs_actual = (ds & CS_ACTUAL_bm) >> CS_ACTUAL_sb; - data.is_stall = TEST(ds, STALL_GUARD_bp); - data.is_standstill = TEST(ds, STST_bp); - data.sg_result_reasonable = !data.is_standstill; // sg_result has no reasonable meaning while standstill - #endif - - #endif // !__AVR__ - - return data; - } - - #endif // HAS_TMCX1X0 - - #if HAS_TMC220x - - #if ENABLED(TMC_DEBUG) - static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } - #endif - - static TMC_driver_data get_driver_data(TMC2208Stepper &st) { - constexpr uint8_t OTPW_bp = 0, OT_bp = 1; - constexpr uint8_t S2G_bm = 0b11110; // 2..5 - TMC_driver_data data; - const auto ds = data.drv_status = st.DRV_STATUS(); - data.is_otpw = TEST(ds, OTPW_bp); - data.is_ot = TEST(ds, OT_bp); - data.is_s2g = !!(ds & S2G_bm); - #if ENABLED(TMC_DEBUG) - constexpr uint32_t CS_ACTUAL_bm = 0x1F0000; // 16:20 - constexpr uint8_t STEALTH_bp = 30, STST_bp = 31; - #ifdef __AVR__ - // 8-bit optimization saves up to 12 bytes of PROGMEM per axis - uint8_t spart = ds >> 16; - data.cs_actual = spart & (CS_ACTUAL_bm >> 16); - spart = ds >> 24; - data.is_stealth = TEST(spart, STEALTH_bp - 24); - data.is_standstill = TEST(spart, STST_bp - 24); - #else - constexpr uint8_t CS_ACTUAL_sb = 16; - data.cs_actual = (ds & CS_ACTUAL_bm) >> CS_ACTUAL_sb; - data.is_stealth = TEST(ds, STEALTH_bp); - data.is_standstill = TEST(ds, STST_bp); - #endif - #if HAS_STALLGUARD - data.sg_result_reasonable = false; - #endif - #endif - return data; - } - - #endif // TMC2208 || TMC2209 - - #if HAS_DRIVER(TMC2660) - - #if ENABLED(TMC_DEBUG) - static uint32_t get_pwm_scale(TMC2660Stepper) { return 0; } - #endif - - static TMC_driver_data get_driver_data(TMC2660Stepper &st) { - constexpr uint8_t OT_bp = 1, OTPW_bp = 2; - constexpr uint8_t S2G_bm = 0b11000; - TMC_driver_data data; - const auto ds = data.drv_status = st.DRVSTATUS(); - uint8_t spart = ds & 0xFF; - data.is_otpw = TEST(spart, OTPW_bp); - data.is_ot = TEST(spart, OT_bp); - data.is_s2g = !!(ds & S2G_bm); - #if ENABLED(TMC_DEBUG) - constexpr uint8_t STALL_GUARD_bp = 0; - constexpr uint8_t STST_bp = 7, SG_RESULT_sp = 10; - constexpr uint32_t SG_RESULT_bm = 0xFFC00; // 10:19 - data.is_stall = TEST(spart, STALL_GUARD_bp); - data.is_standstill = TEST(spart, STST_bp); - data.sg_result = (ds & SG_RESULT_bm) >> SG_RESULT_sp; - data.sg_result_reasonable = true; - #endif - return data; - } - - #endif // TMC2660 - - #if ENABLED(STOP_ON_ERROR) - void report_driver_error(const TMC_driver_data &data) { - SERIAL_ECHOPGM(" driver error detected: 0x"); - SERIAL_PRINTLN(data.drv_status, HEX); - if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature"); - if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit"); - #if ENABLED(TMC_DEBUG) - tmc_report_all(true, true, true, true); - #endif - kill(PSTR("Driver error")); - } - #endif - - template - void report_driver_otpw(TMC &st) { - char timestamp[14]; - duration_t elapsed = print_job_timer.duration(); - const bool has_days = (elapsed.value > 60*60*24L); - (void)elapsed.toDigital(timestamp, has_days); - SERIAL_EOL(); - SERIAL_ECHO(timestamp); - SERIAL_ECHOPGM(": "); - st.printLabel(); - SERIAL_ECHOLNPAIR(" driver overtemperature warning! (", st.getMilliamps(), "mA)"); - } - - template - void report_polled_driver_data(TMC &st, const TMC_driver_data &data) { - const uint32_t pwm_scale = get_pwm_scale(st); - st.printLabel(); - SERIAL_CHAR(':'); SERIAL_PRINT(pwm_scale, DEC); - #if ENABLED(TMC_DEBUG) - #if HAS_TMCX1X0 || HAS_TMC220x - SERIAL_CHAR('/'); SERIAL_PRINT(data.cs_actual, DEC); - #endif - #if HAS_STALLGUARD - SERIAL_CHAR('/'); - if (data.sg_result_reasonable) - SERIAL_ECHO(data.sg_result); - else - SERIAL_CHAR('-'); - #endif - #endif - SERIAL_CHAR('|'); - if (st.error_count) SERIAL_CHAR('E'); // Error - if (data.is_ot) SERIAL_CHAR('O'); // Over-temperature - if (data.is_otpw) SERIAL_CHAR('W'); // over-temperature pre-Warning - #if ENABLED(TMC_DEBUG) - if (data.is_stall) SERIAL_CHAR('G'); // stallGuard - if (data.is_stealth) SERIAL_CHAR('T'); // stealthChop - if (data.is_standstill) SERIAL_CHAR('I'); // standstIll - #endif - if (st.flag_otpw) SERIAL_CHAR('F'); // otpw Flag - SERIAL_CHAR('|'); - if (st.otpw_count > 0) SERIAL_PRINT(st.otpw_count, DEC); - SERIAL_CHAR('\t'); - } - - #if CURRENT_STEP_DOWN > 0 - - template - void step_current_down(TMC &st) { - if (st.isEnabled()) { - const uint16_t I_rms = st.getMilliamps() - (CURRENT_STEP_DOWN); - if (I_rms > 50) { - st.rms_current(I_rms); - #if ENABLED(REPORT_CURRENT_CHANGE) - st.printLabel(); - SERIAL_ECHOLNPAIR(" current decreased to ", I_rms); - #endif - } - } - } - - #endif - - template - bool monitor_tmc_driver(TMC &st, const bool need_update_error_counters, const bool need_debug_reporting) { - TMC_driver_data data = get_driver_data(st); - if (data.drv_status == 0xFFFFFFFF || data.drv_status == 0x0) return false; - - bool did_step_down = false; - - if (need_update_error_counters) { - if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; - else if (st.error_count > 0) st.error_count--; - - #if ENABLED(STOP_ON_ERROR) - if (st.error_count >= 10) { - SERIAL_EOL(); - st.printLabel(); - report_driver_error(data); - } - #endif - - // Report if a warning was triggered - if (data.is_otpw && st.otpw_count == 0) - report_driver_otpw(st); - - #if CURRENT_STEP_DOWN > 0 - // Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings - if (data.is_otpw && st.otpw_count > 4 && st.isEnabled()) { - step_current_down(st); - did_step_down = true; - } - #endif - - if (data.is_otpw) { - st.otpw_count++; - st.flag_otpw = true; - } - else if (st.otpw_count > 0) st.otpw_count = 0; - } - - #if ENABLED(TMC_DEBUG) - if (need_debug_reporting) report_polled_driver_data(st, data); - #endif - - return did_step_down; - } - - void monitor_tmc_drivers() { - const millis_t ms = millis(); - - // Poll TMC drivers at the configured interval - static millis_t next_poll = 0; - const bool need_update_error_counters = ELAPSED(ms, next_poll); - if (need_update_error_counters) next_poll = ms + MONITOR_DRIVER_STATUS_INTERVAL_MS; - - // Also poll at intervals for debugging - #if ENABLED(TMC_DEBUG) - static millis_t next_debug_reporting = 0; - const bool need_debug_reporting = report_tmc_status_interval && ELAPSED(ms, next_debug_reporting); - if (need_debug_reporting) next_debug_reporting = ms + report_tmc_status_interval; - #else - constexpr bool need_debug_reporting = false; - #endif - - if (need_update_error_counters || need_debug_reporting) { - #if AXIS_IS_TMC(X) - if (monitor_tmc_driver(stepperX, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(X2) - step_current_down(stepperX2); - #endif - } - #endif - #if AXIS_IS_TMC(X2) - if (monitor_tmc_driver(stepperX2, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(X) - step_current_down(stepperX); - #endif - } - #endif - #if AXIS_IS_TMC(Y) - if (monitor_tmc_driver(stepperY, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(Y2) - step_current_down(stepperY2); - #endif - } - #endif - #if AXIS_IS_TMC(Y2) - if (monitor_tmc_driver(stepperY2, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(Y) - step_current_down(stepperY); - #endif - } - #endif - #if AXIS_IS_TMC(Z) - if (monitor_tmc_driver(stepperZ, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(Z2) - step_current_down(stepperZ2); - #endif - #if AXIS_IS_TMC(Z3) - step_current_down(stepperZ3); - #endif - } - #endif - #if AXIS_IS_TMC(Z2) - if (monitor_tmc_driver(stepperZ2, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(Z) - step_current_down(stepperZ); - #endif - #if AXIS_IS_TMC(Z3) - step_current_down(stepperZ3); - #endif - } - #endif - #if AXIS_IS_TMC(Z3) - if (monitor_tmc_driver(stepperZ3, need_update_error_counters, need_debug_reporting)) { - #if AXIS_IS_TMC(Z) - step_current_down(stepperZ); - #endif - #if AXIS_IS_TMC(Z2) - step_current_down(stepperZ2); - #endif - } - #endif - #if AXIS_IS_TMC(E0) - (void)monitor_tmc_driver(stepperE0, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(E1) - (void)monitor_tmc_driver(stepperE1, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(E2) - (void)monitor_tmc_driver(stepperE2, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(E3) - (void)monitor_tmc_driver(stepperE3, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(E4) - (void)monitor_tmc_driver(stepperE4, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(E5) - (void)monitor_tmc_driver(stepperE5, need_update_error_counters, need_debug_reporting); - #endif - - #if ENABLED(TMC_DEBUG) - if (need_debug_reporting) SERIAL_EOL(); - #endif - } - } - -#endif // MONITOR_DRIVER_STATUS - -#if ENABLED(TMC_DEBUG) - - /** - * M122 [S<0|1>] [Pnnn] Enable periodic status reports - */ - #if ENABLED(MONITOR_DRIVER_STATUS) - void tmc_set_report_interval(const uint16_t update_interval) { - if ((report_tmc_status_interval = update_interval)) - SERIAL_ECHOLNPGM("axis:pwm_scale" - #if HAS_STEALTHCHOP - "/curr_scale" - #endif - #if HAS_STALLGUARD - "/mech_load" - #endif - "|flags|warncount" - ); - } - #endif - - enum TMC_debug_enum : char { - TMC_CODES, - TMC_UART_ADDR, - TMC_ENABLED, - TMC_CURRENT, - TMC_RMS_CURRENT, - TMC_MAX_CURRENT, - TMC_IRUN, - TMC_IHOLD, - TMC_GLOBAL_SCALER, - TMC_CS_ACTUAL, - TMC_PWM_SCALE, - TMC_VSENSE, - TMC_STEALTHCHOP, - TMC_MICROSTEPS, - TMC_TSTEP, - TMC_TPWMTHRS, - TMC_TPWMTHRS_MMS, - TMC_OTPW, - TMC_OTPW_TRIGGERED, - TMC_TOFF, - TMC_TBL, - TMC_HEND, - TMC_HSTRT, - TMC_SGT - }; - enum TMC_drv_status_enum : char { - TMC_DRV_CODES, - TMC_STST, - TMC_OLB, - TMC_OLA, - TMC_S2GB, - TMC_S2GA, - TMC_DRV_OTPW, - TMC_OT, - TMC_STALLGUARD, - TMC_DRV_CS_ACTUAL, - TMC_FSACTIVE, - TMC_SG_RESULT, - TMC_DRV_STATUS_HEX, - TMC_T157, - TMC_T150, - TMC_T143, - TMC_T120, - TMC_STEALTH, - TMC_S2VSB, - TMC_S2VSA - }; - enum TMC_get_registers_enum : char { - TMC_AXIS_CODES, - TMC_GET_GCONF, - TMC_GET_IHOLD_IRUN, - TMC_GET_GSTAT, - TMC_GET_IOIN, - TMC_GET_TPOWERDOWN, - TMC_GET_TSTEP, - TMC_GET_TPWMTHRS, - TMC_GET_TCOOLTHRS, - TMC_GET_THIGH, - TMC_GET_CHOPCONF, - TMC_GET_COOLCONF, - TMC_GET_PWMCONF, - TMC_GET_PWM_SCALE, - TMC_GET_DRV_STATUS, - TMC_GET_DRVCONF, - TMC_GET_DRVCTRL, - TMC_GET_DRVSTATUS, - TMC_GET_SGCSCONF, - TMC_GET_SMARTEN - }; - - template - static void print_vsense(TMC &st) { serialprintPGM(st.vsense() ? PSTR("1=.18") : PSTR("0=.325")); } - - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130) - static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; - case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; - case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; - default: break; - } - } - #endif - #if HAS_TMCX1X0 - static void _tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('*'); break; - case TMC_SG_RESULT: SERIAL_PRINT(st.sg_result(), DEC); break; - case TMC_FSACTIVE: if (st.fsactive()) SERIAL_CHAR('*'); break; - case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; - default: break; - } - } - #endif - - #if HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5160) - template - void print_vsense(TMCMarlin &) { } - - template - void print_vsense(TMCMarlin &) { } - - static void _tmc_status(TMC2160Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; - case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; - case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; - case TMC_GLOBAL_SCALER: - { - uint16_t value = st.GLOBAL_SCALER(); - SERIAL_PRINT(value ?: 256, DEC); - SERIAL_ECHOPGM("/256"); - } - break; - default: break; - } - } - #endif - - #if HAS_TMC220x - static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { - switch (i) { - case TMC_PWM_SCALE: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; - case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break; - case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break; - case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break; - default: break; - } - } - - #if HAS_DRIVER(TMC2209) - template - static void _tmc_status(TMCMarlin &st, const TMC_debug_enum i) { - switch (i) { - case TMC_SGT: SERIAL_PRINT(st.SGTHRS(), DEC); break; - case TMC_UART_ADDR: SERIAL_PRINT(st.get_address(), DEC); break; - default: - TMC2208Stepper *parent = &st; - _tmc_status(*parent, i); - break; - } - } - #endif - - static void _tmc_parse_drv_status(TMC2208Stepper &st, const TMC_drv_status_enum i) { - switch (i) { - case TMC_T157: if (st.t157()) SERIAL_CHAR('*'); break; - case TMC_T150: if (st.t150()) SERIAL_CHAR('*'); break; - case TMC_T143: if (st.t143()) SERIAL_CHAR('*'); break; - case TMC_T120: if (st.t120()) SERIAL_CHAR('*'); break; - case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; - default: break; - } - } - #endif - - #if HAS_DRIVER(TMC2660) - static void _tmc_parse_drv_status(TMC2660Stepper, const TMC_drv_status_enum) { } - #endif - - template - static void tmc_status(TMC &st, const TMC_debug_enum i) { - SERIAL_CHAR('\t'); - switch (i) { - case TMC_CODES: st.printLabel(); break; - case TMC_ENABLED: serialprint_truefalse(st.isEnabled()); break; - case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break; - case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; - case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; - case TMC_IRUN: - SERIAL_PRINT(st.irun(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_IHOLD: - SERIAL_PRINT(st.ihold(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_CS_ACTUAL: - SERIAL_PRINT(st.cs_actual(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_VSENSE: print_vsense(st); break; - case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; - case TMC_TSTEP: { - const uint32_t tstep_value = st.TSTEP(); - if (tstep_value != 0xFFFFF) SERIAL_ECHO(tstep_value); else SERIAL_ECHOPGM("max"); - } break; - #if ENABLED(HYBRID_THRESHOLD) - case TMC_TPWMTHRS: SERIAL_ECHO(uint32_t(st.TPWMTHRS())); break; - case TMC_TPWMTHRS_MMS: { - const uint32_t tpwmthrs_val = st.get_pwm_thrs(); - if (tpwmthrs_val) SERIAL_ECHO(tpwmthrs_val); else SERIAL_CHAR('-'); - } break; - #endif - case TMC_OTPW: serialprint_truefalse(st.otpw()); break; - #if ENABLED(MONITOR_DRIVER_STATUS) - case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break; - #endif - case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; - case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; - case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; - case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; - default: _tmc_status(st, i); break; - } - } - - #if HAS_DRIVER(TMC2660) - template - void tmc_status(TMCMarlin &st, const TMC_debug_enum i) { - SERIAL_CHAR('\t'); - switch (i) { - case TMC_CODES: st.printLabel(); break; - case TMC_ENABLED: serialprint_truefalse(st.isEnabled()); break; - case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break; - case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; - case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; - case TMC_IRUN: - SERIAL_PRINT(st.cs(), DEC); - SERIAL_ECHOPGM("/31"); - break; - case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break; - case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break; - //case TMC_OTPW: serialprint_truefalse(st.otpw()); break; - //case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break; - case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; - case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break; - case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break; - case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break; - case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break; - default: break; - } - } - #endif - - template - static void tmc_parse_drv_status(TMC &st, const TMC_drv_status_enum i) { - SERIAL_CHAR('\t'); - switch (i) { - case TMC_DRV_CODES: st.printLabel(); break; - case TMC_STST: if (st.stst()) SERIAL_CHAR('*'); break; - case TMC_OLB: if (st.olb()) SERIAL_CHAR('*'); break; - case TMC_OLA: if (st.ola()) SERIAL_CHAR('*'); break; - case TMC_S2GB: if (st.s2gb()) SERIAL_CHAR('*'); break; - case TMC_S2GA: if (st.s2ga()) SERIAL_CHAR('*'); break; - case TMC_DRV_OTPW: if (st.otpw()) SERIAL_CHAR('*'); break; - case TMC_OT: if (st.ot()) SERIAL_CHAR('*'); break; - case TMC_DRV_STATUS_HEX: { - const uint32_t drv_status = st.DRV_STATUS(); - SERIAL_CHAR('\t'); - st.printLabel(); - SERIAL_CHAR('\t'); - print_hex_long(drv_status, ':'); - if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!"); - SERIAL_EOL(); - break; - } - default: _tmc_parse_drv_status(st, i); break; - } - } - - static void tmc_debug_loop(const TMC_debug_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) { - if (print_x) { - #if AXIS_IS_TMC(X) - tmc_status(stepperX, i); - #endif - #if AXIS_IS_TMC(X2) - tmc_status(stepperX2, i); - #endif - } - - if (print_y) { - #if AXIS_IS_TMC(Y) - tmc_status(stepperY, i); - #endif - #if AXIS_IS_TMC(Y2) - tmc_status(stepperY2, i); - #endif - } - - if (print_z) { - #if AXIS_IS_TMC(Z) - tmc_status(stepperZ, i); - #endif - #if AXIS_IS_TMC(Z2) - tmc_status(stepperZ2, i); - #endif - #if AXIS_IS_TMC(Z3) - tmc_status(stepperZ3, i); - #endif - } - - if (print_e) { - #if AXIS_IS_TMC(E0) - tmc_status(stepperE0, i); - #endif - #if AXIS_IS_TMC(E1) - tmc_status(stepperE1, i); - #endif - #if AXIS_IS_TMC(E2) - tmc_status(stepperE2, i); - #endif - #if AXIS_IS_TMC(E3) - tmc_status(stepperE3, i); - #endif - #if AXIS_IS_TMC(E4) - tmc_status(stepperE4, i); - #endif - #if AXIS_IS_TMC(E5) - tmc_status(stepperE5, i); - #endif - } - - SERIAL_EOL(); - } - - static void drv_status_loop(const TMC_drv_status_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) { - if (print_x) { - #if AXIS_IS_TMC(X) - tmc_parse_drv_status(stepperX, i); - #endif - #if AXIS_IS_TMC(X2) - tmc_parse_drv_status(stepperX2, i); - #endif - } - - if (print_y) { - #if AXIS_IS_TMC(Y) - tmc_parse_drv_status(stepperY, i); - #endif - #if AXIS_IS_TMC(Y2) - tmc_parse_drv_status(stepperY2, i); - #endif - } - - if (print_z) { - #if AXIS_IS_TMC(Z) - tmc_parse_drv_status(stepperZ, i); - #endif - #if AXIS_IS_TMC(Z2) - tmc_parse_drv_status(stepperZ2, i); - #endif - #if AXIS_IS_TMC(Z3) - tmc_parse_drv_status(stepperZ3, i); - #endif - } - - if (print_e) { - #if AXIS_IS_TMC(E0) - tmc_parse_drv_status(stepperE0, i); - #endif - #if AXIS_IS_TMC(E1) - tmc_parse_drv_status(stepperE1, i); - #endif - #if AXIS_IS_TMC(E2) - tmc_parse_drv_status(stepperE2, i); - #endif - #if AXIS_IS_TMC(E3) - tmc_parse_drv_status(stepperE3, i); - #endif - #if AXIS_IS_TMC(E4) - tmc_parse_drv_status(stepperE4, i); - #endif - #if AXIS_IS_TMC(E5) - tmc_parse_drv_status(stepperE5, i); - #endif - } - - SERIAL_EOL(); - } - - /** - * M122 report functions - */ - - void tmc_report_all(bool print_x, const bool print_y, const bool print_z, const bool print_e) { - #define TMC_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_debug_loop(ITEM, print_x, print_y, print_z, print_e); }while(0) - #define DRV_REPORT(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); drv_status_loop(ITEM, print_x, print_y, print_z, print_e); }while(0) - TMC_REPORT("\t", TMC_CODES); - #if HAS_DRIVER(TMC2209) - TMC_REPORT("Address\t", TMC_UART_ADDR); - #endif - TMC_REPORT("Enabled\t", TMC_ENABLED); - TMC_REPORT("Set current", TMC_CURRENT); - TMC_REPORT("RMS current", TMC_RMS_CURRENT); - TMC_REPORT("MAX current", TMC_MAX_CURRENT); - TMC_REPORT("Run current", TMC_IRUN); - TMC_REPORT("Hold current", TMC_IHOLD); - #if HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5160) - TMC_REPORT("Global scaler", TMC_GLOBAL_SCALER); - #endif - TMC_REPORT("CS actual", TMC_CS_ACTUAL); - TMC_REPORT("PWM scale", TMC_PWM_SCALE); - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2224) || HAS_DRIVER(TMC2660) || HAS_TMC220x - TMC_REPORT("vsense\t", TMC_VSENSE); - #endif - TMC_REPORT("stealthChop", TMC_STEALTHCHOP); - TMC_REPORT("msteps\t", TMC_MICROSTEPS); - TMC_REPORT("tstep\t", TMC_TSTEP); - TMC_REPORT("pwm\nthreshold", TMC_TPWMTHRS); - TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS); - TMC_REPORT("OT prewarn", TMC_OTPW); - #if ENABLED(MONITOR_DRIVER_STATUS) - TMC_REPORT("OT prewarn has\n" - "been triggered", TMC_OTPW_TRIGGERED); - #endif - TMC_REPORT("off time", TMC_TOFF); - TMC_REPORT("blank time", TMC_TBL); - TMC_REPORT("hysteresis\n-end\t", TMC_HEND); - TMC_REPORT("-start\t", TMC_HSTRT); - TMC_REPORT("Stallguard thrs", TMC_SGT); - - DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); - #if HAS_TMCX1X0 - DRV_REPORT("stallguard\t", TMC_STALLGUARD); - DRV_REPORT("sg_result", TMC_SG_RESULT); - DRV_REPORT("fsactive\t", TMC_FSACTIVE); - #endif - DRV_REPORT("stst\t", TMC_STST); - DRV_REPORT("olb\t", TMC_OLB); - DRV_REPORT("ola\t", TMC_OLA); - DRV_REPORT("s2gb\t", TMC_S2GB); - DRV_REPORT("s2ga\t", TMC_S2GA); - DRV_REPORT("otpw\t", TMC_DRV_OTPW); - DRV_REPORT("ot\t", TMC_OT); - #if HAS_TMC220x - DRV_REPORT("157C\t", TMC_T157); - DRV_REPORT("150C\t", TMC_T150); - DRV_REPORT("143C\t", TMC_T143); - DRV_REPORT("120C\t", TMC_T120); - DRV_REPORT("s2vsa\t", TMC_S2VSA); - DRV_REPORT("s2vsb\t", TMC_S2VSB); - #endif - DRV_REPORT("Driver registers:\n",TMC_DRV_STATUS_HEX); - SERIAL_EOL(); - } - - #define PRINT_TMC_REGISTER(REG_CASE) case TMC_GET_##REG_CASE: print_hex_long(st.REG_CASE(), ':'); break - - #if HAS_TMCX1X0 - static void tmc_get_ic_registers(TMC2130Stepper &st, const TMC_get_registers_enum i) { - switch (i) { - PRINT_TMC_REGISTER(TCOOLTHRS); - PRINT_TMC_REGISTER(THIGH); - PRINT_TMC_REGISTER(COOLCONF); - default: SERIAL_CHAR('\t'); break; - } - } - #endif - #if HAS_TMC220x - static void tmc_get_ic_registers(TMC2208Stepper, const TMC_get_registers_enum) { SERIAL_CHAR('\t'); } - #endif - - #if HAS_TRINAMIC - template - static void tmc_get_registers(TMC &st, const TMC_get_registers_enum i) { - switch (i) { - case TMC_AXIS_CODES: SERIAL_CHAR('\t'); st.printLabel(); break; - PRINT_TMC_REGISTER(GCONF); - PRINT_TMC_REGISTER(IHOLD_IRUN); - PRINT_TMC_REGISTER(GSTAT); - PRINT_TMC_REGISTER(IOIN); - PRINT_TMC_REGISTER(TPOWERDOWN); - PRINT_TMC_REGISTER(TSTEP); - PRINT_TMC_REGISTER(TPWMTHRS); - PRINT_TMC_REGISTER(CHOPCONF); - PRINT_TMC_REGISTER(PWMCONF); - PRINT_TMC_REGISTER(PWM_SCALE); - PRINT_TMC_REGISTER(DRV_STATUS); - default: tmc_get_ic_registers(st, i); break; - } - SERIAL_CHAR('\t'); - } - #endif - #if HAS_DRIVER(TMC2660) - template - static void tmc_get_registers(TMCMarlin &st, const TMC_get_registers_enum i) { - switch (i) { - case TMC_AXIS_CODES: SERIAL_CHAR('\t'); st.printLabel(); break; - PRINT_TMC_REGISTER(DRVCONF); - PRINT_TMC_REGISTER(DRVCTRL); - PRINT_TMC_REGISTER(CHOPCONF); - PRINT_TMC_REGISTER(DRVSTATUS); - PRINT_TMC_REGISTER(SGCSCONF); - PRINT_TMC_REGISTER(SMARTEN); - default: SERIAL_CHAR('\t'); break; - } - SERIAL_CHAR('\t'); - } - #endif - - static void tmc_get_registers(TMC_get_registers_enum i, const bool print_x, const bool print_y, const bool print_z, const bool print_e) { - if (print_x) { - #if AXIS_IS_TMC(X) - tmc_get_registers(stepperX, i); - #endif - #if AXIS_IS_TMC(X2) - tmc_get_registers(stepperX2, i); - #endif - } - - if (print_y) { - #if AXIS_IS_TMC(Y) - tmc_get_registers(stepperY, i); - #endif - #if AXIS_IS_TMC(Y2) - tmc_get_registers(stepperY2, i); - #endif - } - - if (print_z) { - #if AXIS_IS_TMC(Z) - tmc_get_registers(stepperZ, i); - #endif - #if AXIS_IS_TMC(Z2) - tmc_get_registers(stepperZ2, i); - #endif - #if AXIS_IS_TMC(Z3) - tmc_get_registers(stepperZ3, i); - #endif - } - - if (print_e) { - #if AXIS_IS_TMC(E0) - tmc_get_registers(stepperE0, i); - #endif - #if AXIS_IS_TMC(E1) - tmc_get_registers(stepperE1, i); - #endif - #if AXIS_IS_TMC(E2) - tmc_get_registers(stepperE2, i); - #endif - #if AXIS_IS_TMC(E3) - tmc_get_registers(stepperE3, i); - #endif - #if AXIS_IS_TMC(E4) - tmc_get_registers(stepperE4, i); - #endif - #if AXIS_IS_TMC(E5) - tmc_get_registers(stepperE5, i); - #endif - } - - SERIAL_EOL(); - } - - void tmc_get_registers(bool print_x, bool print_y, bool print_z, bool print_e) { - #define _TMC_GET_REG(LABEL, ITEM) do{ SERIAL_ECHOPGM(LABEL); tmc_get_registers(ITEM, print_x, print_y, print_z, print_e); }while(0) - #define TMC_GET_REG(NAME, TABS) _TMC_GET_REG(STRINGIFY(NAME) TABS, TMC_GET_##NAME) - _TMC_GET_REG("\t", TMC_AXIS_CODES); - TMC_GET_REG(GCONF, "\t\t"); - TMC_GET_REG(IHOLD_IRUN, "\t"); - TMC_GET_REG(GSTAT, "\t\t"); - TMC_GET_REG(IOIN, "\t\t"); - TMC_GET_REG(TPOWERDOWN, "\t"); - TMC_GET_REG(TSTEP, "\t\t"); - TMC_GET_REG(TPWMTHRS, "\t"); - TMC_GET_REG(TCOOLTHRS, "\t"); - TMC_GET_REG(THIGH, "\t\t"); - TMC_GET_REG(CHOPCONF, "\t"); - TMC_GET_REG(COOLCONF, "\t"); - TMC_GET_REG(PWMCONF, "\t"); - TMC_GET_REG(PWM_SCALE, "\t"); - TMC_GET_REG(DRV_STATUS, "\t"); - } - -#endif // TMC_DEBUG - -#if USE_SENSORLESS - - bool tmc_enable_stallguard(TMC2130Stepper &st) { - bool stealthchop_was_enabled = st.en_pwm_mode(); - - st.TCOOLTHRS(0xFFFFF); - st.en_pwm_mode(false); - st.diag1_stall(true); - - return stealthchop_was_enabled; - } - void tmc_disable_stallguard(TMC2130Stepper &st, const bool restore_stealth) { - st.TCOOLTHRS(0); - st.en_pwm_mode(restore_stealth); - st.diag1_stall(false); - } - - bool tmc_enable_stallguard(TMC2209Stepper &st) { - st.TCOOLTHRS(0xFFFFF); - return true; - } - void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth _UNUSED) { - st.TCOOLTHRS(0); - } - - bool tmc_enable_stallguard(TMC2660Stepper) { - // TODO - return false; - } - void tmc_disable_stallguard(TMC2660Stepper, const bool) {}; - -#endif // USE_SENSORLESS - -#if TMC_HAS_SPI - #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) - void tmc_init_cs_pins() { - #if AXIS_HAS_SPI(X) - SET_CS_PIN(X); - #endif - #if AXIS_HAS_SPI(Y) - SET_CS_PIN(Y); - #endif - #if AXIS_HAS_SPI(Z) - SET_CS_PIN(Z); - #endif - #if AXIS_HAS_SPI(X2) - SET_CS_PIN(X2); - #endif - #if AXIS_HAS_SPI(Y2) - SET_CS_PIN(Y2); - #endif - #if AXIS_HAS_SPI(Z2) - SET_CS_PIN(Z2); - #endif - #if AXIS_HAS_SPI(Z3) - SET_CS_PIN(Z3); - #endif - #if AXIS_HAS_SPI(E0) - SET_CS_PIN(E0); - #endif - #if AXIS_HAS_SPI(E1) - SET_CS_PIN(E1); - #endif - #if AXIS_HAS_SPI(E2) - SET_CS_PIN(E2); - #endif - #if AXIS_HAS_SPI(E3) - SET_CS_PIN(E3); - #endif - #if AXIS_HAS_SPI(E4) - SET_CS_PIN(E4); - #endif - #if AXIS_HAS_SPI(E5) - SET_CS_PIN(E5); - #endif - } -#endif // TMC_HAS_SPI - -template -static bool test_connection(TMC &st) { - SERIAL_ECHOPGM("Testing "); - st.printLabel(); - SERIAL_ECHOPGM(" connection... "); - const uint8_t test_result = st.test_connection(); - - if (test_result > 0) SERIAL_ECHOPGM("Error: All "); - - const char *stat; - switch (test_result) { - default: - case 0: stat = PSTR("OK"); break; - case 1: stat = PSTR("HIGH"); break; - case 2: stat = PSTR("LOW"); break; - } - serialprintPGM(stat); - SERIAL_EOL(); - - return test_result; -} - -void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z, const bool test_e) { - uint8_t axis_connection = 0; - - if (test_x) { - #if AXIS_IS_TMC(X) - axis_connection += test_connection(stepperX); - #endif - #if AXIS_IS_TMC(X2) - axis_connection += test_connection(stepperX2); - #endif - } - - if (test_y) { - #if AXIS_IS_TMC(Y) - axis_connection += test_connection(stepperY); - #endif - #if AXIS_IS_TMC(Y2) - axis_connection += test_connection(stepperY2); - #endif - } - - if (test_z) { - #if AXIS_IS_TMC(Z) - axis_connection += test_connection(stepperZ); - #endif - #if AXIS_IS_TMC(Z2) - axis_connection += test_connection(stepperZ2); - #endif - #if AXIS_IS_TMC(Z3) - axis_connection += test_connection(stepperZ3); - #endif - } - - if (test_e) { - #if AXIS_IS_TMC(E0) - axis_connection += test_connection(stepperE0); - #endif - #if AXIS_IS_TMC(E1) - axis_connection += test_connection(stepperE1); - #endif - #if AXIS_IS_TMC(E2) - axis_connection += test_connection(stepperE2); - #endif - #if AXIS_IS_TMC(E3) - axis_connection += test_connection(stepperE3); - #endif - #if AXIS_IS_TMC(E4) - axis_connection += test_connection(stepperE4); - #endif - #if AXIS_IS_TMC(E5) - axis_connection += test_connection(stepperE5); - #endif - } - - if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC)); -} - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.h deleted file mode 100644 index 8fa143387a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/tmc_util.h +++ /dev/null @@ -1,414 +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 - -#include "../inc/MarlinConfig.h" -#include "../lcd/ultralcd.h" - -#if HAS_TRINAMIC - -#include -#include "../module/planner.h" - -#define TMC_X_LABEL 'X', '0' -#define TMC_Y_LABEL 'Y', '0' -#define TMC_Z_LABEL 'Z', '0' - -#define TMC_X2_LABEL 'X', '2' -#define TMC_Y2_LABEL 'Y', '2' -#define TMC_Z2_LABEL 'Z', '2' -#define TMC_Z3_LABEL 'Z', '3' - -#define TMC_E0_LABEL 'E', '0' -#define TMC_E1_LABEL 'E', '1' -#define TMC_E2_LABEL 'E', '2' -#define TMC_E3_LABEL 'E', '3' -#define TMC_E4_LABEL 'E', '4' -#define TMC_E5_LABEL 'E', '5' - -#define CHOPPER_DEFAULT_12V { 3, -1, 1 } -#define CHOPPER_DEFAULT_19V { 4, 1, 1 } -#define CHOPPER_DEFAULT_24V { 4, 2, 1 } -#define CHOPPER_DEFAULT_36V { 5, 2, 4 } -#define CHOPPER_PRUSAMK3_24V { 3, -2, 6 } -#define CHOPPER_MARLIN_119 { 5, 2, 3 } - -#if ENABLED(MONITOR_DRIVER_STATUS) && !defined(MONITOR_DRIVER_STATUS_INTERVAL_MS) - #define MONITOR_DRIVER_STATUS_INTERVAL_MS 500u -#endif - -constexpr uint16_t _tmc_thrs(const uint16_t msteps, const uint32_t thrs, const uint32_t spmm) { - return 12650000UL * msteps / (256 * thrs * spmm); -} - -template -class TMCStorage { - protected: - // Only a child class has access to constructor => Don't create on its own! "Poor man's abstract class" - TMCStorage() {} - - public: - uint16_t val_mA = 0; - - #if ENABLED(MONITOR_DRIVER_STATUS) - uint8_t otpw_count = 0, - error_count = 0; - bool flag_otpw = false; - inline bool getOTPW() { return flag_otpw; } - inline void clear_otpw() { flag_otpw = 0; } - #endif - - inline uint16_t getMilliamps() { return val_mA; } - - inline void printLabel() { - SERIAL_CHAR(AXIS_LETTER); - if (DRIVER_ID > '0') SERIAL_CHAR(DRIVER_ID); - } - - struct { - #if HAS_STEALTHCHOP - bool stealthChop_enabled = false; - #endif - #if ENABLED(HYBRID_THRESHOLD) - uint8_t hybrid_thrs = 0; - #endif - #if USE_SENSORLESS - int16_t homing_thrs = 0; - #endif - } stored; -}; - -template -class TMCMarlin : public TMC, public TMCStorage { - public: - TMCMarlin(const uint16_t cs_pin, const float RS) : - TMC(cs_pin, RS) - {} - TMCMarlin(const uint16_t cs_pin, const float RS, const uint8_t axis_chain_index) : - TMC(cs_pin, RS, axis_chain_index) - {} - TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK) : - TMC(CS, RS, pinMOSI, pinMISO, pinSCK) - {} - TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t axis_chain_index) : - TMC(CS, RS, pinMOSI, pinMISO, pinSCK, axis_chain_index) - {} - inline uint16_t rms_current() { return TMC::rms_current(); } - inline void rms_current(uint16_t mA) { - this->val_mA = mA; - TMC::rms_current(mA); - } - inline void rms_current(const uint16_t mA, const float mult) { - this->val_mA = mA; - TMC::rms_current(mA, mult); - } - - #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return this->en_pwm_mode(); } - #endif - #if ENABLED(HYBRID_THRESHOLD) - uint32_t get_pwm_thrs() { - return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); - } - void set_pwm_thrs(const uint32_t thrs) { - TMC::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - #if HAS_LCD_MENU - this->stored.hybrid_thrs = thrs; - #endif - } - #endif - #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC::sgt(); } - void homing_threshold(int16_t sgt_val) { - sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); - TMC::sgt(sgt_val); - #if HAS_LCD_MENU - this->stored.homing_thrs = sgt_val; - #endif - } - #if ENABLED(SPI_ENDSTOPS) - bool test_stall_status(); - #endif - #endif - - #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } - - #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif - #endif - - static constexpr int8_t sgt_min = -64, - sgt_max = 63; -}; -template -class TMCMarlin : public TMC2208Stepper, public TMCStorage { - public: - TMCMarlin(Stream * SerialPort, const float RS, const uint8_t) : - TMC2208Stepper(SerialPort, RS) - {} - TMCMarlin(const uint16_t RX, const uint16_t TX, const float RS, const uint8_t, const bool has_rx=true) : - TMC2208Stepper(RX, TX, RS, has_rx) - {} - uint16_t rms_current() { return TMC2208Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { - this->val_mA = mA; - TMC2208Stepper::rms_current(mA); - } - inline void rms_current(const uint16_t mA, const float mult) { - this->val_mA = mA; - TMC2208Stepper::rms_current(mA, mult); - } - - #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return !this->en_spreadCycle(); } - #endif - #if ENABLED(HYBRID_THRESHOLD) - uint32_t get_pwm_thrs() { - return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); - } - void set_pwm_thrs(const uint32_t thrs) { - TMC2208Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - #if HAS_LCD_MENU - this->stored.hybrid_thrs = thrs; - #endif - } - #endif - - #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } - - #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #endif -}; - -template -class TMCMarlin : public TMC2209Stepper, public TMCStorage { - public: - TMCMarlin(Stream * SerialPort, const float RS, const uint8_t addr) : - TMC2209Stepper(SerialPort, RS, addr) - {} - TMCMarlin(const uint16_t RX, const uint16_t TX, const float RS, const uint8_t addr, const bool) : - TMC2209Stepper(RX, TX, RS, addr) - {} - uint8_t get_address() { return slave_address; } - uint16_t rms_current() { return TMC2209Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { - this->val_mA = mA; - TMC2209Stepper::rms_current(mA); - } - inline void rms_current(const uint16_t mA, const float mult) { - this->val_mA = mA; - TMC2209Stepper::rms_current(mA, mult); - } - - #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return !this->en_spreadCycle(); } - #endif - #if ENABLED(HYBRID_THRESHOLD) - uint32_t get_pwm_thrs() { - return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); - } - void set_pwm_thrs(const uint32_t thrs) { - TMC2209Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - #if HAS_LCD_MENU - this->stored.hybrid_thrs = thrs; - #endif - } - #endif - #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); } - void homing_threshold(int16_t sgt_val) { - sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); - TMC2209Stepper::SGTHRS(sgt_val); - #if HAS_LCD_MENU - this->stored.homing_thrs = sgt_val; - #endif - } - #endif - - #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } - - #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif - #endif - - static constexpr uint8_t sgt_min = 0, - sgt_max = 255; -}; - -template -class TMCMarlin : public TMC2660Stepper, public TMCStorage { - public: - TMCMarlin(const uint16_t cs_pin, const float RS, const uint8_t) : - TMC2660Stepper(cs_pin, RS) - {} - TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t) : - TMC2660Stepper(CS, RS, pinMOSI, pinMISO, pinSCK) - {} - inline uint16_t rms_current() { return TMC2660Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { - this->val_mA = mA; - TMC2660Stepper::rms_current(mA); - } - - #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC2660Stepper::sgt(); } - void homing_threshold(int16_t sgt_val) { - sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); - TMC2660Stepper::sgt(sgt_val); - #if HAS_LCD_MENU - this->stored.homing_thrs = sgt_val; - #endif - } - #endif - - #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } - - #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif - #endif - - static constexpr int8_t sgt_min = -64, - sgt_max = 63; -}; - -template -void tmc_print_current(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPAIR(" driver current: ", st.getMilliamps()); -} - -#if ENABLED(MONITOR_DRIVER_STATUS) - template - void tmc_report_otpw(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" temperature prewarn triggered: "); - serialprint_truefalse(st.getOTPW()); - SERIAL_EOL(); - } - template - void tmc_clear_otpw(TMC &st) { - st.clear_otpw(); - st.printLabel(); - SERIAL_ECHOLNPGM(" prewarn flag cleared"); - } -#endif -#if ENABLED(HYBRID_THRESHOLD) - template - void tmc_print_pwmthrs(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPAIR(" stealthChop max speed: ", st.get_pwm_thrs()); - } -#endif -#if USE_SENSORLESS - template - void tmc_print_sgt(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" homing sensitivity: "); - SERIAL_PRINTLN(st.homing_threshold(), DEC); - } -#endif - -void monitor_tmc_drivers(); -void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z, const bool test_e); - -#if ENABLED(TMC_DEBUG) - #if ENABLED(MONITOR_DRIVER_STATUS) - void tmc_set_report_interval(const uint16_t update_interval); - #endif - void tmc_report_all(const bool print_x, const bool print_y, const bool print_z, const bool print_e); - void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e); -#endif - -/** - * TMC2130-specific sensorless homing using stallGuard2. - * stallGuard2 only works when in spreadCycle mode. - * spreadCycle and stealthChop are mutually-exclusive. - * - * Defined here because of limitations with templates and headers. - */ -#if USE_SENSORLESS - - // Track enabled status of stealthChop and only re-enable where applicable - struct sensorless_t { bool x, y, z, x2, y2, z2, z3; }; - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - extern millis_t sg_guard_period; - constexpr uint16_t default_sg_guard_duration = 400; - - struct slow_homing_t { - xy_ulong_t acceleration; - #if HAS_CLASSIC_JERK - xy_float_t jerk_xy; - #endif - }; - #endif - - bool tmc_enable_stallguard(TMC2130Stepper &st); - void tmc_disable_stallguard(TMC2130Stepper &st, const bool restore_stealth); - - bool tmc_enable_stallguard(TMC2209Stepper &st); - void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth); - - bool tmc_enable_stallguard(TMC2660Stepper); - void tmc_disable_stallguard(TMC2660Stepper, const bool); - - #if ENABLED(SPI_ENDSTOPS) - - template - bool TMCMarlin::test_stall_status() { - this->switchCSpin(LOW); - - // read stallGuard flag from TMC library, will handle HW and SW SPI - TMC2130_n::DRV_STATUS_t drv_status{0}; - drv_status.sr = this->DRV_STATUS(); - - this->switchCSpin(HIGH); - - return drv_status.stallGuard; - } - #endif // SPI_ENDSTOPS - -#endif // USE_SENSORLESS - -#if TMC_HAS_SPI - void tmc_init_cs_pins(); -#endif - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.cpp deleted file mode 100644 index b0ab10e7ce..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(TOUCH_BUTTONS) - -#include "xpt2046.h" -#include "../../inc/MarlinConfig.h" - -#ifndef TOUCH_INT_PIN - #define TOUCH_INT_PIN -1 -#endif -#ifndef TOUCH_MISO_PIN - #define TOUCH_MISO_PIN MISO_PIN -#endif -#ifndef TOUCH_MOSI_PIN - #define TOUCH_MOSI_PIN MOSI_PIN -#endif -#ifndef TOUCH_SCK_PIN - #define TOUCH_SCK_PIN SCK_PIN -#endif -#ifndef TOUCH_CS_PIN - #define TOUCH_CS_PIN CS_PIN -#endif - -XPT2046 touch; -extern int8_t encoderDiff; - -void XPT2046::init() { - SET_INPUT(TOUCH_MISO_PIN); - SET_OUTPUT(TOUCH_MOSI_PIN); - SET_OUTPUT(TOUCH_SCK_PIN); - OUT_WRITE(TOUCH_CS_PIN, HIGH); - - #if PIN_EXISTS(TOUCH_INT) - // Optional Pendrive interrupt pin - SET_INPUT(TOUCH_INT_PIN); - #endif - - // Read once to enable pendrive status pin - getInTouch(XPT2046_X); -} - -#include "../../lcd/ultralcd.h" // For EN_C bit mask - -uint8_t XPT2046::read_buttons() { - int16_t tsoffsets[4] = { 0 }; - - if (tsoffsets[0] + tsoffsets[1] == 0) { - // Not yet set, so use defines as fallback... - tsoffsets[0] = XPT2046_X_CALIBRATION; - tsoffsets[1] = XPT2046_X_OFFSET; - tsoffsets[2] = XPT2046_Y_CALIBRATION; - tsoffsets[3] = XPT2046_Y_OFFSET; - } - - // We rely on XPT2046 compatible mode to ADS7843, hence no Z1 and Z2 measurements possible. - - if (!isTouched()) return 0; - const uint16_t x = uint16_t(((uint32_t(getInTouch(XPT2046_X))) * tsoffsets[0]) >> 16) + tsoffsets[1], - y = uint16_t(((uint32_t(getInTouch(XPT2046_Y))) * tsoffsets[2]) >> 16) + tsoffsets[3]; - if (!isTouched()) return 0; // Fingers must still be on the TS for a valid read. - - if (y < 175 || y > 234) return 0; - - 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; -} - -bool XPT2046::isTouched() { - return ( - #if PIN_EXISTS(TOUCH_INT) - READ(TOUCH_INT_PIN) != HIGH - #else - getInTouch(XPT2046_Z1) >= XPT2046_Z1_THRESHOLD - #endif - ); -} - -uint16_t XPT2046::getInTouch(const XPTCoordinate coordinate) { - uint16_t data[3]; - - OUT_WRITE(TOUCH_CS_PIN, LOW); - - const uint8_t coord = uint8_t(coordinate) | XPT2046_CONTROL | XPT2046_DFR_MODE; - for (uint16_t i = 0; i < 3 ; i++) { - for (uint8_t j = 0x80; j; j >>= 1) { - WRITE(TOUCH_SCK_PIN, LOW); - WRITE(TOUCH_MOSI_PIN, bool(coord & j)); - WRITE(TOUCH_SCK_PIN, HIGH); - } - - data[i] = 0; - for (uint16_t j = 0x8000; j; j >>= 1) { - WRITE(TOUCH_SCK_PIN, LOW); - if (READ(TOUCH_MISO_PIN)) data[i] |= j; - WRITE(TOUCH_SCK_PIN, HIGH); - } - WRITE(TOUCH_SCK_PIN, LOW); - data[i] >>= 4; - } - - WRITE(TOUCH_CS_PIN, HIGH); - - uint16_t delta01 = _MAX(data[0], data[1]) - _MIN(data[0], data[1]), - delta02 = _MAX(data[0], data[2]) - _MIN(data[0], data[2]), - delta12 = _MAX(data[1], data[2]) - _MIN(data[1], data[2]); - - if (delta01 <= delta02 && delta01 <= delta12) - return (data[0] + data[1]) >> 1; - - if (delta02 <= delta12) - return (data[0] + data[2]) >> 1; - - 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_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.h deleted file mode 100644 index 384d7904bd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/touch/xpt2046.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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 - -#include - -// Relies on XPT2046-compatible mode of ADS7843, -// hence no Z1 / Z2 measurements are possible. - -#define XPT2046_DFR_MODE 0x00 -#define XPT2046_SER_MODE 0x04 -#define XPT2046_CONTROL 0x80 - -enum XPTCoordinate : uint8_t { - XPT2046_X = 0x10, - XPT2046_Y = 0x50, - XPT2046_Z1 = 0x30, - XPT2046_Z2 = 0x40 -}; - -#ifndef XPT2046_Z1_THRESHOLD - #define XPT2046_Z1_THRESHOLD 10 -#endif - -class XPT2046 { -public: - static void init(); - static uint8_t read_buttons(); - 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); -}; - -extern XPT2046 touch; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.cpp deleted file mode 100644 index f4fe512cdf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.cpp +++ /dev/null @@ -1,202 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(EXPERIMENTAL_I2CBUS) - -#include "twibus.h" - -#include - -TWIBus::TWIBus() { - #if I2C_SLAVE_ADDRESS == 0 - Wire.begin(); // No address joins the BUS as the master - #else - Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave - #endif - reset(); -} - -void TWIBus::reset() { - buffer_s = 0; - buffer[0] = 0x00; -} - -void TWIBus::address(const uint8_t adr) { - if (!WITHIN(adr, 8, 127)) { - SERIAL_ECHO_MSG("Bad I2C address (8-127)"); - } - - addr = adr; - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("address"), adr); - #endif -} - -void TWIBus::addbyte(const char c) { - if (buffer_s >= COUNT(buffer)) return; - buffer[buffer_s++] = c; - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbyte"), c); - #endif -} - -void TWIBus::addbytes(char src[], uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addbytes"), bytes); - #endif - while (bytes--) addbyte(*src++); -} - -void TWIBus::addstring(char str[]) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("addstring"), str); - #endif - while (char c = *str++) addbyte(c); -} - -void TWIBus::send() { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("send"), addr); - #endif - - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(buffer, buffer_s); - Wire.endTransmission(); - - reset(); -} - -// static -void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) { - SERIAL_ECHO_START(); - serialprintPGM(prefix); - SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:"); -} - -// static -void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) { - echoprefix(bytes, prefix, adr); - while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read()); - SERIAL_EOL(); -} - -void TWIBus::echobuffer(const char prefix[], uint8_t adr) { - 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 (!addr) return false; - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("request"), bytes); - #endif - - // requestFrom() is a blocking function - if (Wire.requestFrom(addr, bytes) == 0) { - #if ENABLED(DEBUG_TWIBUS) - debug("request fail", addr); - #endif - return false; - } - - return true; -} - -void TWIBus::relay(const uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("relay"), bytes); - #endif - - if (request(bytes)) - echodata(bytes, PSTR("i2c-reply"), addr); -} - -uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { - reset(); - uint8_t count = 0; - while (count < bytes && Wire.available()) - dst[count++] = Wire.read(); - - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("capture"), count); - #endif - - return count; -} - -// static -void TWIBus::flush() { - while (Wire.available()) Wire.read(); -} - -#if I2C_SLAVE_ADDRESS > 0 - - void TWIBus::receive(uint8_t bytes) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("receive"), bytes); - #endif - echodata(bytes, PSTR("i2c-receive"), 0); - } - - void TWIBus::reply(char str[]/*=nullptr*/) { - #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("reply"), str); - #endif - - if (str) { - reset(); - addstring(str); - } - - Wire.write(buffer, buffer_s); - - reset(); - } - -#endif - -#if ENABLED(DEBUG_TWIBUS) - - // static - void TWIBus::prefix(const char func[]) { - SERIAL_ECHOPGM("TWIBus::"); - serialprintPGM(func); - SERIAL_ECHOPGM(": "); - } - void TWIBus::debug(const char func[], uint32_t adr) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(adr); } - } - void TWIBus::debug(const char func[], char c) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(c); } - } - void TWIBus::debug(const char func[], char str[]) { - if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(str); } - } - -#endif - -#endif // EXPERIMENTAL_I2CBUS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.h deleted file mode 100644 index 211711ba85..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/feature/twibus.h +++ /dev/null @@ -1,238 +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 - -#include "../core/macros.h" - -#include - -// Print debug messages with M111 S2 (Uses 236 bytes of PROGMEM) -//#define DEBUG_TWIBUS - -typedef void (*twiReceiveFunc_t)(int bytes); -typedef void (*twiRequestFunc_t)(); - -#define TWIBUS_BUFFER_SIZE 32 - -/** - * TWIBUS class - * - * This class implements a wrapper around the two wire (I2C) bus, allowing - * Marlin to send and request data from any slave device on the bus. - * - * The two main consumers of this class are M260 and M261. M260 provides a way - * to send an I2C packet to a device (no repeated starts) by caching up to 32 - * bytes in a buffer and then sending the buffer. - * M261 requests data from a device. The received data is relayed to serial out - * for the host to interpret. - * - * For more information see - * - http://marlinfw.org/docs/gcode/M260.html - * - http://marlinfw.org/docs/gcode/M261.html - * - */ -class TWIBus { - private: - /** - * @brief Number of bytes on buffer - * @description Number of bytes in the buffer waiting to be flushed to the bus - */ - uint8_t buffer_s = 0; - - /** - * @brief Internal buffer - * @details A fixed buffer. TWI commands can be no longer than this. - */ - uint8_t buffer[TWIBUS_BUFFER_SIZE]; - - - public: - /** - * @brief Target device address - * @description The target device address. Persists until changed. - */ - uint8_t addr = 0; - - /** - * @brief Class constructor - * @details Initialize the TWI bus and clear the buffer - */ - TWIBus(); - - /** - * @brief Reset the buffer - * @details Set the buffer to a known-empty state - */ - void reset(); - - /** - * @brief Send the buffer data to the bus - * @details Flush the buffer to the target address - */ - void send(); - - /** - * @brief Add one byte to the buffer - * @details Add a byte to the end of the buffer. - * Silently fails if the buffer is full. - * - * @param c a data byte - */ - void addbyte(const char c); - - /** - * @brief Add some bytes to the buffer - * @details Add bytes to the end of the buffer. - * Concatenates at the buffer size. - * - * @param src source data address - * @param bytes the number of bytes to add - */ - void addbytes(char src[], uint8_t bytes); - - /** - * @brief Add a null-terminated string to the buffer - * @details Add bytes to the end of the buffer up to a nul. - * Concatenates at the buffer size. - * - * @param str source string address - */ - void addstring(char str[]); - - /** - * @brief Set the target slave address - * @details The target slave address for sending the full packet - * - * @param adr 7-bit integer address - */ - void address(const uint8_t adr); - - /** - * @brief Prefix for echo to serial - * @details Echo a label, length, address, and "data:" - * - * @param bytes the number of bytes to request - */ - static void echoprefix(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data on the bus to serial - * @details Echo some number of bytes from the bus - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - static void echodata(uint8_t bytes, const char prefix[], uint8_t adr); - - /** - * @brief Echo data in the buffer to serial - * @details Echo the entire buffer to serial - * to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void echobuffer(const char prefix[], uint8_t adr); - - /** - * @brief Request data from the slave device and wait. - * @details Request a number of bytes from a slave device. - * Wait for the data to arrive, and return true - * on success. - * - * @param bytes the number of bytes to request - * @return status of the request: true=success, false=fail - */ - bool request(const uint8_t bytes); - - /** - * @brief Capture data from the bus into the buffer. - * @details Capture data after a request has succeeded. - * - * @param bytes the number of bytes to request - * @return the number of bytes captured to the buffer - */ - uint8_t capture(char *dst, const uint8_t bytes); - - /** - * @brief Flush the i2c bus. - * @details Get all bytes on the bus and throw them away. - */ - static void flush(); - - /** - * @brief Request data from the slave device, echo to serial. - * @details Request a number of bytes from a slave device and output - * the returned data to serial in a parser-friendly format. - * - * @param bytes the number of bytes to request - */ - void relay(const uint8_t bytes); - - #if I2C_SLAVE_ADDRESS > 0 - - /** - * @brief Register a slave receive handler - * @details Set a handler to receive data addressed to us - * - * @param handler A function to handle receiving bytes - */ - inline void onReceive(const twiReceiveFunc_t handler) { Wire.onReceive(handler); } - - /** - * @brief Register a slave request handler - * @details Set a handler to send data requested from us - * - * @param handler A function to handle receiving bytes - */ - inline void onRequest(const twiRequestFunc_t handler) { Wire.onRequest(handler); } - - /** - * @brief Default handler to receive - * @details Receive bytes sent to our slave address - * and simply echo them to serial. - */ - void receive(uint8_t bytes); - - /** - * @brief Send a reply to the bus - * @details Send the buffer and clear it. - * If a string is passed, write it into the buffer first. - */ - void reply(char str[]=nullptr); - inline void reply(const char str[]) { reply((char*)str); } - - #endif - - #if ENABLED(DEBUG_TWIBUS) - - /** - * @brief Prints a debug message - * @details Prints a simple debug message "TWIBus::function: value" - */ - static void prefix(const char func[]); - static void debug(const char func[], uint32_t adr); - static void debug(const char func[], char c); - static void debug(const char func[], char adr[]); - static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); } - - #endif -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G26.cpp deleted file mode 100644 index 71fecb837e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G26.cpp +++ /dev/null @@ -1,860 +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 . - * - */ - -/** - * Marlin Firmware -- G26 - Mesh Validation Tool - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(G26_MESH_VALIDATION) - -#define G26_OK false -#define G26_ERR true - -#include "../../gcode/gcode.h" -#include "../../feature/bedlevel/bedlevel.h" - -#include "../../Marlin.h" -#include "../../module/planner.h" -#include "../../module/stepper.h" -#include "../../module/motion.h" -#include "../../module/tool_change.h" -#include "../../module/temperature.h" -#include "../../lcd/ultralcd.h" - -#define EXTRUSION_MULTIPLIER 1.0 -#define RETRACTION_MULTIPLIER 1.0 -#define PRIME_LENGTH 10.0 -#define OOZE_AMOUNT 0.3 - -#define INTERSECTION_CIRCLE_RADIUS 5 -#define CROSSHAIRS_SIZE 3 - -#ifndef G26_XY_FEEDRATE - #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE() / 3.0) -#endif - -#if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS - #error "CROSSHAIRS_SIZE must be less than INTERSECTION_CIRCLE_RADIUS." -#endif - -#define G26_OK false -#define G26_ERR true - -#if ENABLED(ARC_SUPPORT) - void plan_arc(const xyze_pos_t &cart, const ab_float_t &offset, const uint8_t clockwise); -#endif - -/** - * G26 Mesh Validation Tool - * - * G26 is a Mesh Validation Tool intended to provide support for the Marlin Unified Bed Leveling System. - * In order to fully utilize and benefit from the Marlin Unified Bed Leveling System an accurate Mesh must - * be defined. G29 is designed to allow the user to quickly validate the correctness of her Mesh. It will - * first heat the bed and nozzle. It will then print lines and circles along the Mesh Cell boundaries and - * the intersections of those lines (respectively). - * - * This action allows the user to immediately see where the Mesh is properly defined and where it needs to - * be edited. The command will generate the Mesh lines closest to the nozzle's starting position. Alternatively - * the user can specify the X and Y position of interest with command parameters. This allows the user to - * focus on a particular area of the Mesh where attention is needed. - * - * B # Bed Set the Bed Temperature. If not specified, a default of 60 C. will be assumed. - * - * C Current When searching for Mesh Intersection points to draw, use the current nozzle location - * as the base for any distance comparison. - * - * D Disable Disable the Unified Bed Leveling System. In the normal case the user is invoking this - * command to see how well a Mesh as been adjusted to match a print surface. In order to do - * this the Unified Bed Leveling System is turned on by the G26 command. The D parameter - * alters the command's normal behavior and disables the Unified Bed Leveling System even if - * it is on. - * - * H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed. - * - * F # Filament Used to specify the diameter of the filament being used. If not specified - * 1.75mm filament is assumed. If you are not getting acceptable results by using the - * 'correct' numbers, you can scale this number up or down a little bit to change the amount - * of filament that is being extruded during the printing of the various lines on the bed. - * - * K Keep-On Keep the heaters turned on at the end of the command. - * - * L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used. - * - * O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This - * is over kill, but using this parameter will let you get the very first 'circle' perfect - * so you have a trophy to peel off of the bed and hang up to show how perfectly you have your - * Mesh calibrated. If not specified, a filament length of .3mm is assumed. - * - * P # Prime Prime the nozzle with specified length of filament. If this parameter is not - * given, no prime action will take place. If the parameter specifies an amount, that much - * will be purged before continuing. If no amount is specified the command will start - * purging filament until the user provides an LCD Click and then it will continue with - * printing the Mesh. You can carefully remove the spent filament with a needle nose - * pliers while holding the LCD Click wheel in a depressed state. If you do not have - * an LCD, you must specify a value if you use P. - * - * Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and - * un-retraction is at 1.2mm These numbers will be scaled by the specified amount - * - * R # Repeat Prints the number of patterns given as a parameter, starting at the current location. - * If a parameter isn't given, every point will be printed unless G26 is interrupted. - * This works the same way that the UBL G29 P4 R parameter works. - * - * NOTE: If you do not have an LCD, you -must- specify R. This is to ensure that you are - * aware that there's some risk associated with printing without the ability to abort in - * cases where mesh point Z value may be inaccurate. As above, if you do not include a - * parameter, every point will be printed. - * - * S # Nozzle Used to control the size of nozzle diameter. If not specified, a .4mm nozzle is assumed. - * - * U # Random Randomize the order that the circles are drawn on the bed. The search for the closest - * un-drawn circle is still done. But the distance to the location for each circle has a - * random number of the specified size added to it. Specifying S50 will give an interesting - * deviation from the normal behavior on a 10 x 10 Mesh. - * - * X # X Coord. Specify the starting location of the drawing activity. - * - * Y # Y Coord. Specify the starting location of the drawing activity. - */ - -// External references - -// Private functions - -static MeshFlags circle_flags, horizontal_mesh_line_flags, vertical_mesh_line_flags; -float g26_e_axis_feedrate = 0.025, - random_deviation = 0.0; - -static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched - // retracts/recovers won't result in a bad state. - -float g26_extrusion_multiplier, - g26_retraction_multiplier, - g26_layer_height, - g26_prime_length; - -xy_pos_t g26_pos; // = { 0, 0 } - -int16_t g26_bed_temp, - g26_hotend_temp; - -int8_t g26_prime_flag; - -#if HAS_LCD_MENU - - /** - * If the LCD is clicked, cancel, wait for release, return true - */ - bool user_canceled() { - if (!ui.button_pressed()) return false; // Return if the button isn't pressed - ui.set_status_P(GET_TEXT(MSG_G26_CANCELED), 99); - #if HAS_LCD_MENU - ui.quick_feedback(); - #endif - ui.wait_for_release(); - return true; - } - -#endif - -mesh_index_pair find_closest_circle_to_print(const xy_pos_t &pos) { - float closest = 99999.99; - mesh_index_pair out_point; - - out_point.pos = -1; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (!circle_flags.marked(i, j)) { - // We found a circle that needs to be printed - const xy_pos_t m = { _GET_MESH_X(i), _GET_MESH_Y(j) }; - - // Get the distance to this intersection - float f = (pos - m).magnitude(); - - // It is possible that we are being called with the values - // to let us find the closest circle to the start position. - // But if this is not the case, add a small weighting to the - // distance calculation to help it choose a better place to continue. - f += (g26_pos - m).magnitude() / 15.0f; - - // Add the specified amount of Random Noise to our search - if (random_deviation > 1.0) f += random(0.0, random_deviation); - - if (f < closest) { - closest = f; // Found a closer un-printed location - out_point.pos.set(i, j); // Save its data - out_point.distance = closest; - } - } - } - } - circle_flags.mark(out_point); // Mark this location as done. - return out_point; -} - -void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) { - static float last_z = -999.99; - - const xy_pos_t dest = { rx, ry }; - - const bool has_xy_component = dest != current_position; // Check if X or Y is involved in the movement. - - destination = current_position; - - if (z != last_z) { - last_z = destination.z = z; - const feedRate_t feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS] * 0.5f; // Use half of the Z_AXIS max feed rate - prepare_internal_move_to_destination(feed_value); - destination = current_position; - } - - // If X or Y is involved do a 'normal' move. Otherwise retract/recover/hop. - destination = dest; - destination.e += e_delta; - const feedRate_t feed_value = has_xy_component ? feedRate_t(G26_XY_FEEDRATE) : planner.settings.max_feedrate_mm_s[E_AXIS] * 0.666f; - prepare_internal_move_to_destination(feed_value); - destination = current_position; -} - -FORCE_INLINE void move_to(const xyz_pos_t &where, const float &de) { move_to(where.x, where.y, where.z, de); } - -void retract_filament(const xyz_pos_t &where) { - if (!g26_retracted) { // Only retract if we are not already retracted! - g26_retracted = true; - move_to(where, -1.0f * g26_retraction_multiplier); - } -} - -// TODO: Parameterize the Z lift with a define -void retract_lift_move(const xyz_pos_t &s) { - retract_filament(destination); - move_to(current_position.x, current_position.y, current_position.z + 0.5f, 0.0); // Z lift to minimize scraping - move_to(s.x, s.y, s.z + 0.5f, 0.0); // Get to the starting point with no extrusion while lifted -} - -void recover_filament(const xyz_pos_t &where) { - if (g26_retracted) { // Only un-retract if we are retracted. - move_to(where, 1.2f * g26_retraction_multiplier); - g26_retracted = false; - } -} - -/** - * print_line_from_here_to_there() takes two cartesian coordinates and draws a line from one - * to the other. But there are really three sets of coordinates involved. The first coordinate - * is the present location of the nozzle. We don't necessarily want to print from this location. - * We first need to move the nozzle to the start of line segment where we want to print. Once - * there, we can use the two coordinates supplied to draw the line. - * - * Note: Although we assume the first set of coordinates is the start of the line and the second - * set of coordinates is the end of the line, it does not always work out that way. This function - * optimizes the movement to minimize the travel distance before it can start printing. This saves - * a lot of time and eliminates a lot of nonsensical movement of the nozzle. However, it does - * cause a lot of very little short retracement of th nozzle when it draws the very first line - * segment of a 'circle'. The time this requires is very short and is easily saved by the other - * cases where the optimization comes into play. - */ -void print_line_from_here_to_there(const xyz_pos_t &s, const xyz_pos_t &e) { - - // Distances to the start / end of the line - xy_float_t svec = current_position - s, evec = current_position - e; - - const float dist_start = HYPOT2(svec.x, svec.y), - dist_end = HYPOT2(evec.x, evec.y), - line_length = HYPOT(e.x - s.x, e.y - s.y); - - // If the end point of the line is closer to the nozzle, flip the direction, - // moving from the end to the start. On very small lines the optimization isn't worth it. - if (dist_end < dist_start && (INTERSECTION_CIRCLE_RADIUS) < ABS(line_length)) - return print_line_from_here_to_there(e, s); - - // Decide whether to retract & lift - if (dist_start > 2.0) retract_lift_move(s); - - move_to(s, 0.0); // Get to the starting point with no extrusion / un-Z lift - - const float e_pos_delta = line_length * g26_e_axis_feedrate * g26_extrusion_multiplier; - - recover_filament(destination); - move_to(e, e_pos_delta); // Get to the ending point with an appropriate amount of extrusion -} - -inline bool look_for_lines_to_connect() { - xyz_pos_t s, e; - s.z = e.z = g26_layer_height; - - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - #if HAS_LCD_MENU - if (user_canceled()) return true; - #endif - - if (i < GRID_MAX_POINTS_X) { // Can't connect to anything farther to the right than GRID_MAX_POINTS_X. - // Already a half circle at the edge of the bed. - - if (circle_flags.marked(i, j) && circle_flags.marked(i + 1, j)) { // Test whether a leftward line can be done - if (!horizontal_mesh_line_flags.marked(i, j)) { - // Two circles need a horizontal line to connect them - s.x = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge - e.x = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // left edge - - LIMIT(s.x, X_MIN_POS + 1, X_MAX_POS - 1); - s.y = e.y = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1); - LIMIT(e.x, X_MIN_POS + 1, X_MAX_POS - 1); - - if (position_is_reachable(s.x, s.y) && position_is_reachable(e.x, e.y)) - print_line_from_here_to_there(s, e); - - horizontal_mesh_line_flags.mark(i, j); // Mark done, even if skipped - } - } - - if (j < GRID_MAX_POINTS_Y) { // Can't connect to anything further back than GRID_MAX_POINTS_Y. - // Already a half circle at the edge of the bed. - - if (circle_flags.marked(i, j) && circle_flags.marked(i, j + 1)) { // Test whether a downward line can be done - if (!vertical_mesh_line_flags.marked(i, j)) { - // Two circles that need a vertical line to connect them - s.y = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge - e.y = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // bottom edge - - s.x = e.x = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1); - LIMIT(s.y, Y_MIN_POS + 1, Y_MAX_POS - 1); - LIMIT(e.y, Y_MIN_POS + 1, Y_MAX_POS - 1); - - if (position_is_reachable(s.x, s.y) && position_is_reachable(e.x, e.y)) - print_line_from_here_to_there(s, e); - - vertical_mesh_line_flags.mark(i, j); // Mark done, even if skipped - } - } - } - } - } - } - return false; -} - -/** - * Turn on the bed and nozzle heat and - * wait for them to get up to temperature. - */ -inline bool turn_on_heaters() { - - SERIAL_ECHOLNPGM("Waiting for heatup."); - - #if HAS_HEATED_BED - - if (g26_bed_temp > 25) { - #if HAS_SPI_LCD - ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99); - ui.quick_feedback(); - #if HAS_LCD_MENU - ui.capture(); - #endif - #endif - thermalManager.setTargetBed(g26_bed_temp); - - // Wait for the temperature to stabilize - if (!thermalManager.wait_for_bed(true - #if G26_CLICK_CAN_CANCEL - , true - #endif - ) - ) return G26_ERR; - } - - #endif // HAS_HEATED_BED - - // Start heating the active nozzle - #if HAS_SPI_LCD - ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99); - ui.quick_feedback(); - #endif - thermalManager.setTargetHotend(g26_hotend_temp, active_extruder); - - // Wait for the temperature to stabilize - if (!thermalManager.wait_for_hotend(active_extruder, true - #if G26_CLICK_CAN_CANCEL - , true - #endif - ) - ) return G26_ERR; - - #if HAS_SPI_LCD - ui.reset_status(); - ui.quick_feedback(); - #endif - - return G26_OK; -} - -/** - * Prime the nozzle if needed. Return true on error. - */ -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; - #endif - - if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged - #if HAS_LCD_MENU - ui.capture(); - #endif - ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99); - ui.chirp(); - - destination = current_position; - - recover_filament(destination); // Make sure G26 doesn't think the filament is retracted(). - - while (!ui.button_pressed()) { - ui.chirp(); - destination.e += 0.25; - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - Total_Prime += 0.25; - if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; - #endif - prepare_internal_move_to_destination(fr_slow_e); - destination = current_position; - planner.synchronize(); // Without this synchronize, the purge is more consistent, - // but because the planner has a buffer, we won't be able - // to stop as quickly. So we put up with the less smooth - // action to give the user a more responsive 'Stop'. - } - - ui.wait_for_release(); - - ui.set_status_P(GET_TEXT(MSG_G26_PRIME_DONE), 99); - ui.quick_feedback(); - ui.release(); - } - else - #endif - { - #if HAS_SPI_LCD - ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99); - ui.quick_feedback(); - #endif - destination = current_position; - destination.e += g26_prime_length; - prepare_internal_move_to_destination(fr_slow_e); - destination.e -= g26_prime_length; - retract_filament(destination); - } - - return G26_OK; -} - -/** - * G26: Mesh Validation Pattern generation. - * - * Used to interactively edit the mesh by placing the - * nozzle in a problem area and doing a G29 P4 R command. - * - * Parameters: - * - * B Bed Temperature - * C Continue from the Closest mesh point - * D Disable leveling before starting - * F Filament diameter - * H Hotend Temperature - * K Keep heaters on when completed - * L Layer Height - * O Ooze extrusion length - * P Prime length - * Q Retraction multiplier - * R Repetitions (number of grid points) - * S Nozzle Size (diameter) in mm - * T Tool index to change to, if included - * U Random deviation (50 if no value given) - * X X position - * Y Y position - */ -void GcodeSuite::G26() { - SERIAL_ECHOLNPGM("G26 starting..."); - - // Don't allow Mesh Validation without homing first, - // or if the parameter parsing did not go OK, abort - if (axis_unhomed_error()) return; - - // Change the tool first, if specified - if (parser.seenval('T')) tool_change(parser.value_int()); - - g26_extrusion_multiplier = EXTRUSION_MULTIPLIER; - g26_retraction_multiplier = RETRACTION_MULTIPLIER; - g26_layer_height = MESH_TEST_LAYER_HEIGHT; - g26_prime_length = PRIME_LENGTH; - g26_bed_temp = MESH_TEST_BED_TEMP; - g26_hotend_temp = MESH_TEST_HOTEND_TEMP; - g26_prime_flag = 0; - - float g26_nozzle = MESH_TEST_NOZZLE_SIZE, - g26_filament_diameter = DEFAULT_NOMINAL_FILAMENT_DIA, - g26_ooze_amount = parser.linearval('O', OOZE_AMOUNT); - - bool g26_continue_with_closest = parser.boolval('C'), - g26_keep_heaters_on = parser.boolval('K'); - - #if HAS_HEATED_BED - if (parser.seenval('B')) { - g26_bed_temp = parser.value_celsius(); - if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, (BED_MAXTEMP - 10))) { - SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAXTEMP - 10), "C)."); - return; - } - } - #endif - - if (parser.seenval('L')) { - g26_layer_height = parser.value_linear_units(); - if (!WITHIN(g26_layer_height, 0.0, 2.0)) { - SERIAL_ECHOLNPGM("?Specified layer height not plausible."); - return; - } - } - - if (parser.seen('Q')) { - if (parser.has_value()) { - g26_retraction_multiplier = parser.value_float(); - if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) { - SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible."); - return; - } - } - else { - SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified."); - return; - } - } - - if (parser.seenval('S')) { - g26_nozzle = parser.value_float(); - if (!WITHIN(g26_nozzle, 0.1, 2.0)) { - SERIAL_ECHOLNPGM("?Specified nozzle size not plausible."); - return; - } - } - - if (parser.seen('P')) { - if (!parser.has_value()) { - #if HAS_LCD_MENU - g26_prime_flag = -1; - #else - SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); - return; - #endif - } - else { - g26_prime_flag++; - g26_prime_length = parser.value_linear_units(); - if (!WITHIN(g26_prime_length, 0.0, 25.0)) { - SERIAL_ECHOLNPGM("?Specified prime length not plausible."); - return; - } - } - } - - if (parser.seenval('F')) { - g26_filament_diameter = parser.value_linear_units(); - if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) { - SERIAL_ECHOLNPGM("?Specified filament size not plausible."); - return; - } - } - g26_extrusion_multiplier *= sq(1.75) / sq(g26_filament_diameter); // If we aren't using 1.75mm filament, we need to - // scale up or down the length needed to get the - // same volume of filament - - g26_extrusion_multiplier *= g26_filament_diameter * sq(g26_nozzle) / sq(0.3); // Scale up by nozzle size - - if (parser.seenval('H')) { - g26_hotend_temp = parser.value_celsius(); - if (!WITHIN(g26_hotend_temp, 165, (HEATER_0_MAXTEMP - 15))) { - SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); - return; - } - } - - if (parser.seen('U')) { - randomSeed(millis()); - // This setting will persist for the next G26 - random_deviation = parser.has_value() ? parser.value_float() : 50.0; - } - - int16_t g26_repeats; - #if HAS_LCD_MENU - g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); - #else - if (!parser.seen('R')) { - SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD."); - return; - } - else - g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; - #endif - if (g26_repeats < 1) { - SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1."); - return; - } - - g26_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x, - parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y); - if (!position_is_reachable(g26_pos.x, g26_pos.y)) { - SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); - return; - } - - /** - * Wait until all parameters are verified before altering the state! - */ - set_bed_leveling_enabled(!parser.seen('D')); - - if (current_position.z < Z_CLEARANCE_BETWEEN_PROBES) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - current_position = destination; - } - - #if DISABLED(NO_VOLUMETRICS) - bool volumetric_was_enabled = parser.volumetric_enabled; - parser.volumetric_enabled = false; - planner.calculate_volumetric_multipliers(); - #endif - - if (turn_on_heaters() != G26_OK) goto LEAVE; - - current_position.e = 0.0; - sync_plan_position_e(); - - if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE; - - /** - * Bed is preheated - * - * Nozzle is at temperature - * - * Filament is primed! - * - * It's "Show Time" !!! - */ - - circle_flags.reset(); - horizontal_mesh_line_flags.reset(); - vertical_mesh_line_flags.reset(); - - // Move nozzle to the specified height for the first layer - destination = current_position; - destination.z = g26_layer_height; - move_to(destination, 0.0); - move_to(destination, g26_ooze_amount); - - #if HAS_LCD_MENU - ui.capture(); - #endif - - #if DISABLED(ARC_SUPPORT) - - /** - * Pre-generate radius offset values at 30 degree intervals to reduce CPU load. - */ - #define A_INT 30 - #define _ANGS (360 / A_INT) - #define A_CNT (_ANGS / 2) - #define _IND(A) ((A + _ANGS * 8) % _ANGS) - #define _COS(A) (trig_table[_IND(A) % A_CNT] * (_IND(A) >= A_CNT ? -1 : 1)) - #define _SIN(A) (-_COS((A + A_CNT / 2) % _ANGS)) - #if A_CNT & 1 - #error "A_CNT must be a positive value. Please change A_INT." - #endif - float trig_table[A_CNT]; - for (uint8_t i = 0; i < A_CNT; i++) - trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * A_INT)); - - #endif // !ARC_SUPPORT - - mesh_index_pair location; - do { - // Find the nearest confluence - location = find_closest_circle_to_print(g26_continue_with_closest ? xy_pos_t(current_position) : g26_pos); - - if (location.valid()) { - const xy_pos_t circle = _GET_MESH_POS(location.pos); - - // If this mesh location is outside the printable_radius, skip it. - if (!position_is_reachable(circle)) continue; - - // Determine where to start and end the circle, - // which is always drawn counter-clockwise. - const xy_int8_t st = location; - const bool f = st.y == 0, - r = st.x >= GRID_MAX_POINTS_X - 1, - b = st.y >= GRID_MAX_POINTS_Y - 1; - - #if ENABLED(ARC_SUPPORT) - - #define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2) - #define INTERSECTION_CIRCLE_DIAM ((INTERSECTION_CIRCLE_RADIUS) * 2) - - xy_float_t e = { circle.x + INTERSECTION_CIRCLE_RADIUS, circle.y }; - xyz_float_t s = e; - - // Figure out where to start and end the arc - we always print counterclockwise - float arc_length = ARC_LENGTH(4); - if (st.x == 0) { // left edge - if (!f) { s.x = circle.x; s.y -= INTERSECTION_CIRCLE_RADIUS; } - if (!b) { e.x = circle.x; e.y += INTERSECTION_CIRCLE_RADIUS; } - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (r) { // right edge - if (b) s.set(circle.x - (INTERSECTION_CIRCLE_RADIUS), circle.y); - else s.set(circle.x, circle.y + INTERSECTION_CIRCLE_RADIUS); - if (f) e.set(circle.x - (INTERSECTION_CIRCLE_RADIUS), circle.y); - else e.set(circle.x, circle.y - (INTERSECTION_CIRCLE_RADIUS)); - arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); - } - else if (f) { - e.x -= INTERSECTION_CIRCLE_DIAM; - arc_length = ARC_LENGTH(2); - } - else if (b) { - s.x -= INTERSECTION_CIRCLE_DIAM; - arc_length = ARC_LENGTH(2); - } - - const ab_float_t arc_offset = circle - s; - const xy_float_t dist = current_position - s; // Distance from the start of the actual circle - const float dist_start = HYPOT2(dist.x, dist.y); - const xyze_pos_t endpoint = { - e.x, e.y, g26_layer_height, - current_position.e + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier) - }; - - if (dist_start > 2.0) { - s.z = g26_layer_height + 0.5f; - retract_lift_move(s); - } - - s.z = g26_layer_height; - move_to(s, 0.0); // Get to the starting point with no extrusion / un-Z lift - - recover_filament(destination); - - 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 = old_feedrate; - destination = current_position; - - #if HAS_LCD_MENU - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - #else // !ARC_SUPPORT - - int8_t start_ind = -2, end_ind = 9; // Assume a full circle (from 5:00 to 5:00) - if (st.x == 0) { // Left edge? Just right half. - start_ind = f ? 0 : -3; // 03:00 to 12:00 for front-left - end_ind = b ? 0 : 2; // 06:00 to 03:00 for back-left - } - else if (r) { // Right edge? Just left half. - start_ind = b ? 6 : 3; // 12:00 to 09:00 for front-right - end_ind = f ? 5 : 8; // 09:00 to 06:00 for back-right - } - else if (f) { // Front edge? Just back half. - start_ind = 0; // 03:00 - end_ind = 5; // 09:00 - } - else if (b) { // Back edge? Just front half. - start_ind = 6; // 09:00 - end_ind = 11; // 03:00 - } - - for (int8_t ind = start_ind; ind <= end_ind; ind++) { - - #if HAS_LCD_MENU - if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation - #endif - - xyz_float_t p = { circle.x + _COS(ind ), circle.y + _SIN(ind ), g26_layer_height }, - q = { circle.x + _COS(ind + 1), circle.y + _SIN(ind + 1), g26_layer_height }; - - #if IS_KINEMATIC - // Check to make sure this segment is entirely on the bed, skip if not. - if (!position_is_reachable(p) || !position_is_reachable(q)) continue; - #else - LIMIT(p.x, X_MIN_POS + 1, X_MAX_POS - 1); // Prevent hitting the endstops - LIMIT(p.y, Y_MIN_POS + 1, Y_MAX_POS - 1); - LIMIT(q.x, X_MIN_POS + 1, X_MAX_POS - 1); - LIMIT(q.y, Y_MIN_POS + 1, Y_MAX_POS - 1); - #endif - - print_line_from_here_to_there(p, q); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - - #endif // !ARC_SUPPORT - - if (look_for_lines_to_connect()) goto LEAVE; - } - - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - - } while (--g26_repeats && location.valid()); - - LEAVE: - ui.set_status_P(GET_TEXT(MSG_G26_LEAVING), -1); - - retract_filament(destination); - destination.z = Z_CLEARANCE_BETWEEN_PROBES; - - move_to(destination, 0); // Raise the nozzle - - destination.set(g26_pos.x, g26_pos.y); // Move back to the starting position - //destination.z = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is - - move_to(destination, 0); // Move back to the starting position - - #if DISABLED(NO_VOLUMETRICS) - parser.volumetric_enabled = volumetric_was_enabled; - planner.calculate_volumetric_multipliers(); - #endif - - #if HAS_LCD_MENU - ui.release(); // Give back control of the LCD - #endif - - if (!g26_keep_heaters_on) { - #if HAS_HEATED_BED - thermalManager.setTargetBed(0); - #endif - thermalManager.setTargetHotend(active_extruder, 0); - } -} - -#endif // G26_MESH_VALIDATION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G42.cpp deleted file mode 100644 index 424e5a6995..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/G42.cpp +++ /dev/null @@ -1,72 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_MESH - -#include "../gcode.h" -#include "../../Marlin.h" // for IsRunning() -#include "../../module/motion.h" -#include "../../module/probe.h" // for probe_offset -#include "../../feature/bedlevel/bedlevel.h" - -/** - * G42: Move X & Y axes to mesh coordinates (I & J) - */ -void GcodeSuite::G42() { - if (MOTION_CONDITIONS) { - const bool hasI = parser.seenval('I'); - const int8_t ix = hasI ? parser.value_int() : 0; - const bool hasJ = parser.seenval('J'); - const int8_t iy = hasJ ? parser.value_int() : 0; - - if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { - SERIAL_ECHOLNPGM(MSG_ERR_MESH_XY); - return; - } - - destination = current_position; - - if (hasI) destination.x = _GET_MESH_X(ix); - if (hasJ) destination.y = _GET_MESH_Y(iy); - - #if HAS_BED_PROBE - if (parser.boolval('P')) { - if (hasI) destination.x -= probe_offset.x; - if (hasJ) destination.y -= probe_offset.y; - } - #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_internal_fast_move_to_destination(fr_mm_s); - #else - prepare_internal_move_to_destination(fr_mm_s); - #endif - } -} - -#endif // HAS_MESH diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/M420.cpp deleted file mode 100644 index 9e96b456e3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/M420.cpp +++ /dev/null @@ -1,258 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_LEVELING - -#include "../gcode.h" -#include "../../feature/bedlevel/bedlevel.h" -#include "../../module/planner.h" -#include "../../module/probe.h" - -#if ENABLED(EEPROM_SETTINGS) - #include "../../module/configuration_store.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -//#define M420_C_USE_MEAN - -/** - * M420: Enable/Disable Bed Leveling and/or set the Z fade height. - * - * S[bool] Turns leveling on or off - * Z[height] Sets the Z fade height (0 or none to disable) - * V[bool] Verbose - Print the leveling grid - * - * With AUTO_BED_LEVELING_UBL only: - * - * L[index] Load UBL mesh from index (0 is default) - * T[map] 0:Human-readable 1:CSV 2:"LCD" 4:Compact - * - * With mesh-based leveling only: - * - * C Center mesh on the mean of the lowest and highest - * - * With MARLIN_DEV_MODE: - * S2 Create a simple random mesh and enable - */ -void GcodeSuite::M420() { - const bool seen_S = parser.seen('S'), - to_enable = seen_S ? parser.value_bool() : planner.leveling_active; - - #if ENABLED(MARLIN_DEV_MODE) - if (parser.intval('S') == 2) { - const float x_min = probe_min_x(), x_max = probe_max_x(), - y_min = probe_min_y(), y_max = probe_max_y(); - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start.set(x_min, y_min); - bilinear_grid_spacing.set((x_max - x_min) / (GRID_MAX_POINTS_X - 1), - (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++) { - Z_VALUES(x, y) = 0.001 * random(-200, 200); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); - #endif - } - 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 - - // If disabling leveling do it right away - // (Don't disable for just M420 or M420 V) - if (seen_S && !to_enable) set_bed_leveling_enabled(false); - - xyz_pos_t oldpos = current_position; - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - // L to load a mesh from the EEPROM - if (parser.seen('L')) { - - set_bed_leveling_enabled(false); - - #if ENABLED(EEPROM_SETTINGS) - const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.storage_slot; - const int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_ECHOLNPGM("?EEPROM storage not available."); - return; - } - - if (!WITHIN(storage_slot, 0, a - 1)) { - SERIAL_ECHOLNPGM("?Invalid storage slot."); - SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); - return; - } - - settings.load_mesh(storage_slot); - ubl.storage_slot = storage_slot; - - #else - - SERIAL_ECHOLNPGM("?EEPROM storage not available."); - return; - - #endif - } - - // L or V display the map info - if (parser.seen("LV")) { - ubl.display_map(parser.byteval('T')); - SERIAL_ECHOPGM("Mesh is "); - if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPAIR("valid\nStorage slot: ", ubl.storage_slot); - } - - #endif // AUTO_BED_LEVELING_UBL - - const bool seenV = parser.seen('V'); - - #if HAS_MESH - - if (leveling_is_valid()) { - - // Subtract the given value or the mean from all mesh values - if (parser.seen('C')) { - const float cval = parser.value_float(); - #if ENABLED(AUTO_BED_LEVELING_UBL) - - set_bed_leveling_enabled(false); - ubl.adjust_mesh_to_mean(true, cval); - - #else - - #if ENABLED(M420_C_USE_MEAN) - - // Get the sum and average of all mesh values - float mesh_sum = 0; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) - mesh_sum += Z_VALUES(x, y); - const float zmean = mesh_sum / float(GRID_MAX_POINTS); - - #else - - // Find the low and high mesh values - float lo_val = 100, hi_val = -100; - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { - const float z = Z_VALUES(x, y); - NOMORE(lo_val, z); - NOLESS(hi_val, z); - } - // Take the mean of the lowest and highest - const float zmean = (lo_val + hi_val) / 2.0 + cval; - - #endif - - // If not very close to 0, adjust the mesh - if (!NEAR_ZERO(zmean)) { - set_bed_leveling_enabled(false); - // Subtract the mean from all values - for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { - Z_VALUES(x, y) -= zmean; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); - #endif - } - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - - #endif - } - - } - else if (to_enable || seenV) { - SERIAL_ECHO_MSG("Invalid mesh."); - goto EXIT_M420; - } - - #endif // HAS_MESH - - // V to print the matrix or mesh - if (seenV) { - #if ABL_PLANAR - planner.bed_level_matrix.debug(PSTR("Bed Level Correction Matrix:")); - #else - if (leveling_is_valid()) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - print_bilinear_leveling_grid(); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - #elif ENABLED(MESH_BED_LEVELING) - SERIAL_ECHOLNPGM("Mesh Bed Level data:"); - mbl.report_mesh(); - #endif - } - #endif - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - if (parser.seen('Z')) set_z_fade_height(parser.value_linear_units(), false); - #endif - - // Enable leveling if specified, or if previously active - set_bed_leveling_enabled(to_enable); - - #if HAS_MESH - EXIT_M420: - #endif - - // Error if leveling failed to enable or reenable - if (to_enable && !planner.leveling_active) - SERIAL_ERROR_MSG(MSG_ERR_M420_FAILED); - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Bed Leveling "); - serialprintln_onoff(planner.leveling_active); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Fade Height "); - if (planner.z_fade_height > 0.0) - SERIAL_ECHOLN(planner.z_fade_height); - else - SERIAL_ECHOLNPGM(MSG_OFF); - #endif - - // Report change in position - if (oldpos != current_position) - report_current_position(); -} - -#endif // HAS_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/G29.cpp deleted file mode 100644 index 41e5fce4d2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ /dev/null @@ -1,968 +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 . - * - */ - -/** - * G29.cpp - Auto Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_ABL_NOT_UBL - -#include "../../gcode.h" -#include "../../../feature/bedlevel/bedlevel.h" -#include "../../../module/motion.h" -#include "../../../module/planner.h" -#include "../../../module/stepper.h" -#include "../../../module/probe.h" -#include "../../queue.h" - -#if HAS_DISPLAY - #include "../../../lcd/ultralcd.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_LINEAR) - #include "../../../libs/least_squares_fit.h" -#endif - -#if ABL_PLANAR - #include "../../../libs/vector_3.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../../core/debug_out.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" -#endif - -#if HOTENDS > 1 - #include "../../../module/tool_change.h" -#endif - -#if ABL_GRID - #if ENABLED(PROBE_Y_FIRST) - #define PR_OUTER_VAR meshCount.x - #define PR_OUTER_END abl_grid_points.x - #define PR_INNER_VAR meshCount.y - #define PR_INNER_END abl_grid_points.y - #else - #define PR_OUTER_VAR meshCount.y - #define PR_OUTER_END abl_grid_points.y - #define PR_INNER_VAR meshCount.x - #define PR_INNER_END abl_grid_points.x - #endif -#endif - -#if ENABLED(G29_RETRY_AND_RECOVER) - #define G29_RETURN(b) return b; -#else - #define G29_RETURN(b) return; -#endif - -/** - * G29: Detailed Z probe, probes the bed at 3 or more points. - * Will fail if the printer has not been homed with G28. - * - * Enhanced G29 Auto Bed Leveling Probe Routine - * - * O Auto-level only if needed - * - * D Dry-Run mode. Just evaluate the bed Topology - Don't apply - * or alter the bed level data. Useful to check the topology - * after a first run of G29. - * - * J Jettison current bed leveling data - * - * V Set the verbose level (0-4). Example: "G29 V3" - * - * Parameters With LINEAR leveling only: - * - * P Set the size of the grid that will be probed (P x P points). - * Example: "G29 P4" - * - * X Set the X size of the grid that will be probed (X x Y points). - * Example: "G29 X7 Y5" - * - * Y Set the Y size of the grid that will be probed (X x Y points). - * - * T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report. - * This is useful for manual bed leveling and finding flaws in the bed (to - * assist with part placement). - * Not supported by non-linear delta printer bed leveling. - * - * Parameters With LINEAR and BILINEAR leveling only: - * - * S Set the XY travel speed between probe points (in units/min) - * - * H Set bounds to a centered square H x H units in size - * - * -or- - * - * F Set the Front limit of the probing grid - * B Set the Back limit of the probing grid - * L Set the Left limit of the probing grid - * R Set the Right limit of the probing grid - * - * Parameters with DEBUG_LEVELING_FEATURE only: - * - * C Make a totally fake grid with no actual probing. - * For use in testing when no probing is possible. - * - * Parameters with BILINEAR leveling only: - * - * Z Supply an additional Z probe offset - * - * Extra parameters with PROBE_MANUALLY: - * - * To do manual probing simply repeat G29 until the procedure is complete. - * The first G29 accepts parameters. 'G29 Q' for status, 'G29 A' to abort. - * - * Q Query leveling and G29 state - * - * A Abort current leveling procedure - * - * Extra parameters with BILINEAR only: - * - * W Write a mesh point. (If G29 is idle.) - * I X index for mesh point - * J Y index for mesh point - * X X for mesh point, overrides I - * Y Y for mesh point, overrides J - * Z Z for mesh point. Otherwise, raw current Z. - * - * Without PROBE_MANUALLY: - * - * E By default G29 will engage the Z probe, test the bed, then disengage. - * Include "E" to engage/disengage the Z probe for each sample. - * There's no extra effect if you have a fixed Z probe. - * - */ -G29_TYPE GcodeSuite::G29() { - - #if EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) - const bool seenQ = parser.seen('Q'); - #else - constexpr bool seenQ = false; - #endif - - // G29 Q is also available if debugging - #if ENABLED(DEBUG_LEVELING_FEATURE) - const uint8_t old_debug_flags = marlin_debug_flags; - if (seenQ) marlin_debug_flags |= MARLIN_DEBUG_LEVELING; - if (DEBUGGING(LEVELING)) { - DEBUG_POS(">>> G29", current_position); - log_machine_info(); - } - marlin_debug_flags = old_debug_flags; - #if DISABLED(PROBE_MANUALLY) - if (seenQ) G29_RETURN(false); - #endif - #endif - - #if ENABLED(PROBE_MANUALLY) - const bool seenA = parser.seen('A'); - #else - constexpr bool seenA = false; - #endif - - const bool no_action = seenA || seenQ, - faux = - #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) - parser.boolval('C') - #else - no_action - #endif - ; - - // Don't allow auto-leveling without homing first - if (axis_unhomed_error()) G29_RETURN(false); - - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip\n<<< G29"); - G29_RETURN(false); - } - - // Define local vars 'static' for manual probing, 'auto' otherwise - #if ENABLED(PROBE_MANUALLY) - #define ABL_VAR static - #else - #define ABL_VAR - #endif - - ABL_VAR int verbose_level; - ABL_VAR xy_pos_t probePos; - ABL_VAR float measured_z; - ABL_VAR bool dryrun, abl_should_enable; - - #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) - ABL_VAR int abl_probe_index; - #endif - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(PROBE_MANUALLY) - ABL_VAR bool saved_soft_endstops_state = true; - #endif - - #if ABL_GRID - - #if ENABLED(PROBE_MANUALLY) - ABL_VAR xy_int8_t meshCount; - #endif - - ABL_VAR xy_float_t probe_position_lf, probe_position_rb; - ABL_VAR xy_float_t gridSpacing = { 0, 0 }; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR bool do_topography_map; - ABL_VAR xy_uint8_t abl_grid_points; - #else // Bilinear - constexpr xy_uint8_t abl_grid_points = { GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y }; - #endif - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int abl_points; - #elif ENABLED(PROBE_MANUALLY) // Bilinear - int constexpr abl_points = GRID_MAX_POINTS; - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - ABL_VAR float zoffset; - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - - ABL_VAR float eqnAMatrix[(GRID_MAX_POINTS) * 3], // "A" matrix of the linear system of equations - eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points - mean; - #endif - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - #if ENABLED(PROBE_MANUALLY) - int constexpr abl_points = 3; // used to show total points - #endif - - vector_3 points[3]; - get_three_probe_points(points); - - #endif // AUTO_BED_LEVELING_3POINT - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - struct linear_fit_data lsf_results; - incremental_LSF_reset(&lsf_results); - #endif - - /** - * On the initial G29 fetch command parameters. - */ - if (!g29_in_progress) { - - #if HOTENDS > 1 - if (active_extruder != 0) tool_change(0); - #endif - - #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) - abl_probe_index = -1; - #endif - - abl_should_enable = planner.leveling_active; - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - const bool seen_w = parser.seen('W'); - if (seen_w) { - if (!leveling_is_valid()) { - SERIAL_ERROR_MSG("No bilinear grid"); - G29_RETURN(false); - } - - const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position.z; - if (!WITHIN(rz, -10, 10)) { - SERIAL_ERROR_MSG("Bad Z value"); - G29_RETURN(false); - } - - const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), - ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); - int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1); - - if (!isnan(rx) && !isnan(ry)) { - // Get nearest i / j from rx / ry - i = (rx - bilinear_start.x + 0.5 * gridSpacing.x) / gridSpacing.x; - j = (ry - bilinear_start.y + 0.5 * gridSpacing.y) / gridSpacing.y; - LIMIT(i, 0, GRID_MAX_POINTS_X - 1); - LIMIT(j, 0, GRID_MAX_POINTS_Y - 1); - } - if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) { - set_bed_leveling_enabled(false); - z_values[i][j] = rz; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(i, j, rz); - #endif - set_bed_leveling_enabled(abl_should_enable); - if (abl_should_enable) report_current_position(); - } - G29_RETURN(false); - } // parser.seen('W') - - #else - - constexpr bool seen_w = false; - - #endif - - // Jettison bed leveling data - if (!seen_w && parser.seen('J')) { - reset_bed_level(); - G29_RETURN(false); - } - - verbose_level = parser.intval('V'); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); - G29_RETURN(false); - } - - dryrun = parser.boolval('D') - #if ENABLED(PROBE_MANUALLY) - || no_action - #endif - ; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - do_topography_map = verbose_level > 2 || parser.boolval('T'); - - // X and Y specify points in each direction, overriding the default - // These values may be saved with the completed mesh - abl_grid_points.set( - parser.byteval('X', GRID_MAX_POINTS_X), - parser.byteval('Y', GRID_MAX_POINTS_Y) - ); - 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) 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) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - G29_RETURN(false); - } - - abl_points = abl_grid_points.x * abl_grid_points.y; - mean = 0; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - zoffset = parser.linearval('Z'); - - #endif - - #if ABL_GRID - - 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(); - probe_position_lf.set( - _MAX(X_CENTER - size / 2, x_min), - _MAX(Y_CENTER - size / 2, y_min) - ); - probe_position_rb.set( - _MIN(probe_position_lf.x + size, x_max), - _MIN(probe_position_lf.y + size, y_max) - ); - } - else { - probe_position_lf.set( - parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - (X_BED_SIZE) / 2, x_min), - parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - (Y_BED_SIZE) / 2, y_min) - ); - probe_position_rb.set( - parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.x + X_BED_SIZE, x_max), - parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.y + Y_BED_SIZE, y_max) - ); - } - - if ( - #if IS_SCARA || ENABLED(DELTA) - !position_is_reachable_by_probe(probe_position_lf.x, 0) - || !position_is_reachable_by_probe(probe_position_rb.x, 0) - || !position_is_reachable_by_probe(0, probe_position_lf.y) - || !position_is_reachable_by_probe(0, probe_position_rb.y) - #else - !position_is_reachable_by_probe(probe_position_lf) - || !position_is_reachable_by_probe(probe_position_rb) - #endif - ) { - SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); - G29_RETURN(false); - } - - // probe at the points of a lattice grid - gridSpacing.set((probe_position_rb.x - probe_position_lf.x) / (abl_grid_points.x - 1), - (probe_position_rb.y - probe_position_lf.y) / (abl_grid_points.y - 1)); - - #endif // ABL_GRID - - if (verbose_level > 0) { - SERIAL_ECHOPGM("G29 Auto Bed Leveling"); - if (dryrun) SERIAL_ECHOPGM(" (DRYRUN)"); - SERIAL_EOL(); - } - - planner.synchronize(); - - // Disable auto bed leveling during G29. - // Be formal so G29 can be done successively without G28. - if (!no_action) set_bed_leveling_enabled(false); - - #if HAS_BED_PROBE - // Deploy the probe. Probe will raise if needed. - if (DEPLOY_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - G29_RETURN(false); - } - #endif - - if (!faux) remember_feedrate_scaling_off(); - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - #if ENABLED(PROBE_MANUALLY) - if (!no_action) - #endif - if (gridSpacing != bilinear_grid_spacing || probe_position_lf != bilinear_start) { - // Reset grid to 0.0 or "not probed". (Also disables ABL) - reset_bed_level(); - - // Initialize a grid with the given dimensions - bilinear_grid_spacing = gridSpacing; - bilinear_start = probe_position_lf; - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_BILINEAR - - #if ENABLED(AUTO_BED_LEVELING_3POINT) - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); - - // Probe at 3 arbitrary points - points[0].z = points[1].z = points[2].z = 0; - - #endif // AUTO_BED_LEVELING_3POINT - - } // !g29_in_progress - - #if ENABLED(PROBE_MANUALLY) - - // For manual probing, get the next index to probe now. - // On the first probe this will be incremented to 0. - if (!no_action) { - ++abl_probe_index; - g29_in_progress = true; - } - - // Abort current G29 procedure, go back to idle state - if (seenA && g29_in_progress) { - SERIAL_ECHOLNPGM("Manual G29 aborted"); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = saved_soft_endstops_state; - #endif - set_bed_leveling_enabled(abl_should_enable); - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; - #endif - } - - // Query G29 status - if (verbose_level || seenQ) { - SERIAL_ECHOPGM("Manual G29 "); - if (g29_in_progress) { - SERIAL_ECHOPAIR("point ", _MIN(abl_probe_index + 1, abl_points)); - SERIAL_ECHOLNPAIR(" of ", abl_points); - } - else - SERIAL_ECHOLNPGM("idle"); - } - - if (no_action) G29_RETURN(false); - - if (abl_probe_index == 0) { - // For the initial G29 S2 save software endstop state - #if HAS_SOFTWARE_ENDSTOPS - saved_soft_endstops_state = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - - #if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) - const uint16_t index = abl_probe_index - 1; - #endif - - // For G29 after adjusting Z. - // Save the previous Z before going to the next point - measured_z = current_position.z; - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[index] = measured_z; - eqnAMatrix[index + 0 * abl_points] = probePos.x; - eqnAMatrix[index + 1 * abl_points] = probePos.y; - eqnAMatrix[index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, probePos, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - points[index].z = measured_z; - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - const float newz = measured_z + zoffset; - z_values[meshCount.x][meshCount.y] = newz; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(meshCount, newz); - #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_P(PSTR("Save X"), meshCount.x, SP_Y_STR, meshCount.y, SP_Z_STR, measured_z + zoffset); - - #endif - } - - // - // If there's another point to sample, move there with optional lift. - // - - #if ABL_GRID - - // Skip any unreachable points - while (abl_probe_index < abl_points) { - - // Set meshCount.x, meshCount.y based on abl_probe_index, with zig-zag - PR_OUTER_VAR = abl_probe_index / PR_INNER_END; - PR_INNER_VAR = abl_probe_index - (PR_OUTER_VAR * PR_INNER_END); - - // Probe in reverse order for every other row/column - bool zig = (PR_OUTER_VAR & 1); // != ((PR_OUTER_END) & 1); - - if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR; - - probePos = probe_position_lf + gridSpacing * meshCount.asFloat(); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index; - #endif - - // Keep looping till a reachable point is found - if (position_is_reachable(probePos)) break; - ++abl_probe_index; - } - - // Is there a next point to move to? - if (abl_probe_index < abl_points) { - _manual_goto_xy(probePos); // Can be used here too! - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - G29_RETURN(false); - } - else { - - // Leveling done! Fall through to G29 finishing code below - - SERIAL_ECHOLNPGM("Grid probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = saved_soft_endstops_state; - #endif - } - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - if (abl_probe_index < abl_points) { - probePos = points[abl_probe_index]; - _manual_goto_xy(probePos); - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - G29_RETURN(false); - } - else { - - SERIAL_ECHOLNPGM("3-point probing done."); - - // Re-enable software endstops, if needed - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = saved_soft_endstops_state; - #endif - - if (!dryrun) { - vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); - 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 - abl_should_enable = false; - } - - } - - #endif // AUTO_BED_LEVELING_3POINT - - #else // !PROBE_MANUALLY - { - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - measured_z = 0; - - #if ABL_GRID - - bool zig = PR_OUTER_END & 1; // Always end at RIGHT and BACK_PROBE_BED_POSITION - - measured_z = 0; - - xy_int8_t meshCount; - - // Outer loop is X with PROBE_Y_FIRST enabled - // Outer loop is Y with PROBE_Y_FIRST disabled - for (PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { - - int8_t inStart, inStop, inInc; - - if (zig) { // Zig away from origin - inStart = 0; // Left or front - inStop = PR_INNER_END; // Right or back - inInc = 1; // Zig right - } - else { // Zag towards origin - inStart = PR_INNER_END - 1; // Right or back - inStop = -1; // Left or front - inInc = -1; // Zag left - } - - zig ^= true; // zag - - // An index to print current state - uint8_t pt_index = (PR_OUTER_VAR) * (PR_INNER_END) + 1; - - // Inner loop is Y with PROBE_Y_FIRST enabled - // Inner loop is X with PROBE_Y_FIRST disabled - for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) { - - probePos = probe_position_lf + gridSpacing * meshCount.asFloat(); - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0... - #endif - - #if IS_KINEMATIC - // Avoid probing outside the round or hexagonal area - if (!position_is_reachable_by_probe(probePos)) continue; - #endif - - if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), "."); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(GRID_MAX_POINTS)); - #endif - - measured_z = faux ? 0.001f * random(-100, 101) : probe_at_point(probePos, raise_after, verbose_level); - - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; // Breaks out of both loops - } - - #if ENABLED(AUTO_BED_LEVELING_LINEAR) - - mean += measured_z; - eqnBVector[abl_probe_index] = measured_z; - eqnAMatrix[abl_probe_index + 0 * abl_points] = probePos.x; - eqnAMatrix[abl_probe_index + 1 * abl_points] = probePos.y; - eqnAMatrix[abl_probe_index + 2 * abl_points] = 1; - - incremental_LSF(&lsf_results, probePos, measured_z); - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - z_values[meshCount.x][meshCount.y] = measured_z + zoffset; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y]); - #endif - - #endif - - abl_should_enable = false; - idle(); - - } // inner - } // outer - - #elif ENABLED(AUTO_BED_LEVELING_3POINT) - - // Probe at 3 arbitrary points - - for (uint8_t i = 0; i < 3; ++i) { - if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3."); - #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i)); - #endif - - // Retain the last probe position - probePos = points[i]; - measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(probePos, raise_after, verbose_level); - if (isnan(measured_z)) { - set_bed_leveling_enabled(abl_should_enable); - break; - } - points[i].z = measured_z; - } - - 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 *= -1; - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - // Can't re-enable (on error) until the new grid is written - abl_should_enable = false; - } - - #endif // AUTO_BED_LEVELING_3POINT - - #if HAS_DISPLAY - ui.reset_status(); - #endif - - // Stow the probe. No raise for FIX_MOUNTED_PROBE. - if (STOW_PROBE()) { - set_bed_leveling_enabled(abl_should_enable); - measured_z = NAN; - } - } - #endif // !PROBE_MANUALLY - - // - // G29 Finishing Code - // - // Unless this is a dry run, auto bed leveling will - // definitely be enabled after this point. - // - // If code above wants to continue leveling, it should - // return or loop before this point. - // - - if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); - - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; - #endif - #endif - - // Calculate leveling, print reports, correct the position - if (!isnan(measured_z)) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) extrapolate_unprobed_bed_level(); - print_bilinear_leveling_grid(); - - refresh_bed_level(); - - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - print_bilinear_leveling_grid_virt(); - #endif - - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - - // For LINEAR leveling calculate matrix, print reports, correct the position - - /** - * solve the plane equation ax + by + d = z - * A is the matrix with rows [x y 1] for all the probed points - * B is the vector of the Z positions - * the normal vector to the plane is formed by the coefficients of the - * plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 - * so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z - */ - struct { float a, b, d; } plane_equation_coefficients; - - finish_incremental_LSF(&lsf_results); - plane_equation_coefficients.a = -lsf_results.A; // We should be able to eliminate the '-' on these three lines and down below - plane_equation_coefficients.b = -lsf_results.B; // but that is not yet tested. - plane_equation_coefficients.d = -lsf_results.D; - - mean /= abl_points; - - if (verbose_level) { - SERIAL_ECHOPAIR_F("Eqn coefficients: a: ", plane_equation_coefficients.a, 8); - SERIAL_ECHOPAIR_F(" b: ", plane_equation_coefficients.b, 8); - SERIAL_ECHOPAIR_F(" d: ", plane_equation_coefficients.d, 8); - if (verbose_level > 2) - SERIAL_ECHOPAIR_F("\nMean of sampled points: ", mean, 8); - SERIAL_EOL(); - } - - // Create the matrix but don't correct the position yet - if (!dryrun) - planner.bed_level_matrix = matrix_3x3::create_look_at( - vector_3(-plane_equation_coefficients.a, -plane_equation_coefficients.b, 1) // We can eliminate the '-' here and up above - ); - - // Show the Topography map if enabled - if (do_topography_map) { - - float min_diff = 999; - - auto print_topo_map = [&](PGM_P const title, const bool get_min) { - serialprintPGM(title); - for (int8_t yy = abl_grid_points.y - 1; yy >= 0; yy--) { - for (uint8_t xx = 0; xx < abl_grid_points.x; xx++) { - const int ind = indexIntoAB[xx][yy]; - xyz_float_t tmp = { eqnAMatrix[ind + 0 * abl_points], - eqnAMatrix[ind + 1 * abl_points], 0 }; - apply_rotation_xyz(planner.bed_level_matrix, tmp); - if (get_min) NOMORE(min_diff, eqnBVector[ind] - tmp.z); - const float subval = get_min ? mean : tmp.z + min_diff, - diff = eqnBVector[ind] - subval; - SERIAL_CHAR(' '); if (diff >= 0.0) SERIAL_CHAR('+'); // Include + for column alignment - SERIAL_ECHO_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - }; - - print_topo_map(PSTR("\nBed Height Topography:\n" - " +--- BACK --+\n" - " | |\n" - " L | (+) | R\n" - " E | | I\n" - " F | (-) N (+) | G\n" - " T | | H\n" - " | (-) | T\n" - " | |\n" - " O-- FRONT --+\n" - " (0,0)\n"), true); - if (verbose_level > 3) - print_topo_map(PSTR("\nCorrected Bed Height vs. Bed Topology:\n"), false); - - } //do_topography_map - - #endif // AUTO_BED_LEVELING_LINEAR - - #if ABL_PLANAR - - // For LINEAR and 3POINT leveling correct the current position - - if (verbose_level > 0) - planner.bed_level_matrix.debug(PSTR("\n\nBed Level Correction Matrix:")); - - if (!dryrun) { - // - // Correct the current XYZ position based on the tilted plane. - // - - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 uncorrected XYZ", current_position); - - xyze_pos_t converted = current_position; - planner.force_unapply_leveling(converted); // use conversion machinery - - // Use the last measured distance to the bed, if possible - if ( NEAR(current_position.x, probePos.x - probe_offset.x) - && NEAR(current_position.y, probePos.y - probe_offset.y) - ) { - const float simple_z = current_position.z - measured_z; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, " Matrix Z", converted.z, " Discrepancy ", simple_z - converted.z); - converted.z = simple_z; - } - - // The rotated XY and corrected Z are now current_position - current_position = converted; - - if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position); - } - - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (!dryrun) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("G29 uncorrected Z:", current_position.z); - - // Unapply the offset because it is going to be immediately applied - // and cause compensation movement in Z - current_position.z -= bilinear_z_offset(current_position); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position.z); - } - - #endif // ABL_PLANAR - - // Auto Bed Leveling is complete! Enable if possible. - planner.leveling_active = dryrun ? abl_should_enable : true; - } // !isnan(measured_z) - - // Restore state after probing - if (!faux) restore_feedrate_and_scaling(); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29"); - - if (planner.leveling_active) - sync_plan_position(); - - #if HAS_BED_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - #ifdef Z_PROBE_END_SCRIPT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); - planner.synchronize(); - process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT)); - #endif - - report_current_position(); - - G29_RETURN(isnan(measured_z)); -} - -#endif // HAS_ABL_NOT_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/M421.cpp deleted file mode 100644 index b9470528a1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ /dev/null @@ -1,67 +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 . - * - */ - -/** - * M421.cpp - Auto Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) - -#include "../../gcode.h" -#include "../../../feature/bedlevel/bedlevel.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" -#endif - -/** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - */ -void GcodeSuite::M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (!hasI || !hasJ || !(hasZ || hasQ)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); - else { - z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0); - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]); - #endif - } -} - -#endif // AUTO_BED_LEVELING_BILINEAR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/G29.cpp deleted file mode 100644 index 944e8d3a69..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ /dev/null @@ -1,210 +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 . - * - */ - -/** - * G29.cpp - Mesh Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(MESH_BED_LEVELING) - -#include "../../../feature/bedlevel/bedlevel.h" - -#include "../../gcode.h" -#include "../../queue.h" - -#include "../../../libs/buzzer.h" -#include "../../../lcd/ultralcd.h" -#include "../../../module/motion.h" -#include "../../../module/stepper.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" -#endif - -// Save 130 bytes with non-duplication of PSTR -inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); } - -/** - * G29: Mesh-based Z probe, probes a grid and produces a - * mesh to compensate for variable bed height - * - * Parameters With MESH_BED_LEVELING: - * - * S0 Report the current mesh values - * S1 Start probing mesh points - * S2 Probe the next mesh point - * S3 In Jn Zn.nn Manually modify a single point - * S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed. - * S5 Reset and disable mesh - * - */ -void GcodeSuite::G29() { - - static int mbl_probe_index = -1; - #if HAS_SOFTWARE_ENDSTOPS - static bool saved_soft_endstops_state; - #endif - - MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); - if (!WITHIN(state, 0, 5)) { - SERIAL_ECHOLNPGM("S out of range (0-5)."); - return; - } - - int8_t ix, iy; - - switch (state) { - case MeshReport: - SERIAL_ECHOPGM("Mesh Bed Leveling "); - if (leveling_is_valid()) { - serialprintln_onoff(planner.leveling_active); - mbl.report_mesh(); - } - else - SERIAL_ECHOLNPGM("has no data."); - break; - - case MeshStart: - mbl.reset(); - mbl_probe_index = 0; - if (!ui.wait_for_bl_move) { - queue.inject_P(PSTR("G28\nG29 S2")); - return; - } - state = MeshNext; - - case MeshNext: - if (mbl_probe_index < 0) { - SERIAL_ECHOLNPGM("Start mesh probing with \"G29 S1\" first."); - return; - } - // For each G29 S2... - if (mbl_probe_index == 0) { - #if HAS_SOFTWARE_ENDSTOPS - // For the initial G29 S2 save software endstop state - saved_soft_endstops_state = soft_endstops_enabled; - #endif - // Move close to the bed before the first point - do_blocking_move_to_z(0); - } - else { - // Save Z for the previous mesh position - mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z); - #if HAS_SOFTWARE_ENDSTOPS - soft_endstops_enabled = saved_soft_endstops_state; - #endif - } - // If there's another point to sample, move there with optional lift. - if (mbl_probe_index < GRID_MAX_POINTS) { - #if HAS_SOFTWARE_ENDSTOPS - // Disable software endstops to allow manual adjustment - // If G29 is not completed, they will not be re-enabled - soft_endstops_enabled = false; - #endif - - mbl.zigzag(mbl_probe_index++, ix, iy); - _manual_goto_xy({ mbl.index_to_xpos[ix], mbl.index_to_ypos[iy] }); - } - else { - // One last "return to the bed" (as originally coded) at completion - current_position.z = MANUAL_PROBE_HEIGHT; - line_to_current_position(); - planner.synchronize(); - - // After recording the last point, activate home and activate - mbl_probe_index = -1; - SERIAL_ECHOLNPGM("Mesh probing done."); - BUZZ(100, 659); - BUZZ(100, 698); - - home_all_axes(); - set_bed_leveling_enabled(true); - - #if ENABLED(MESH_G28_REST_ORIGIN) - current_position.z = 0; - line_to_current_position(homing_feedrate(Z_AXIS)); - planner.synchronize(); - #endif - - #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; - #endif - } - break; - - case MeshSet: - if (parser.seenval('I')) { - ix = parser.value_int(); - if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) { - SERIAL_ECHOPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1)); - SERIAL_ECHOLNPGM(")"); - return; - } - } - else - return echo_not_entered('J'); - - if (parser.seenval('J')) { - iy = parser.value_int(); - if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ECHOPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1)); - SERIAL_ECHOLNPGM(")"); - return; - } - } - else - return echo_not_entered('J'); - - if (parser.seenval('Z')) { - mbl.z_values[ix][iy] = parser.value_linear_units(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(ix, iy, mbl.z_values[ix][iy]); - #endif - } - else - return echo_not_entered('Z'); - break; - - case MeshSetZOffset: - if (parser.seenval('Z')) - mbl.z_offset = parser.value_linear_units(); - else - return echo_not_entered('Z'); - break; - - case MeshReset: - reset_bed_level(); - break; - - } // switch(state) - - if (state == MeshNext) { - SERIAL_ECHOPAIR("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS)); - SERIAL_ECHOLNPAIR(" of ", int(GRID_MAX_POINTS)); - } - - report_current_position(); -} - -#endif // MESH_BED_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/M421.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/M421.cpp deleted file mode 100644 index f07cafebf8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/mbl/M421.cpp +++ /dev/null @@ -1,59 +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 . - * - */ - -/** - * M421.cpp - Mesh Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(MESH_BED_LEVELING) - -#include "../../gcode.h" -#include "../../../module/motion.h" -#include "../../../feature/bedlevel/mbl/mesh_bed_leveling.h" - -/** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 X Y Z - * M421 X Y Q - * M421 I J Z - * M421 I J Q - */ -void GcodeSuite::M421() { - const bool hasX = parser.seen('X'), hasI = parser.seen('I'); - const int8_t ix = hasI ? parser.value_int() : hasX ? mbl.probe_index_x(RAW_X_POSITION(parser.value_linear_units())) : -1; - const bool hasY = parser.seen('Y'), hasJ = parser.seen('J'); - const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1; - const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - - if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); - else if (ix < 0 || iy < 0) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); - else - mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); -} - -#endif // MESH_BED_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/G29.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/G29.cpp deleted file mode 100644 index c0f8f20439..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/G29.cpp +++ /dev/null @@ -1,36 +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 . - * - */ - -/** - * G29.cpp - Unified Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - -#include "../../gcode.h" -#include "../../../feature/bedlevel/bedlevel.h" - -void GcodeSuite::G29() { ubl.G29(); } - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/M421.cpp deleted file mode 100644 index 153e6018aa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ /dev/null @@ -1,72 +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 . - * - */ - -/** - * unified.cpp - Unified Bed Leveling - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_BED_LEVELING_UBL) - -#include "../../gcode.h" -#include "../../../feature/bedlevel/bedlevel.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../../../lcd/extensible_ui/ui_api.h" -#endif - -/** - * M421: Set a single Mesh Bed Leveling Z coordinate - * - * Usage: - * M421 I J Z - * M421 I J Q - * M421 I J N - * M421 C Z - * M421 C Q - */ -void GcodeSuite::M421() { - xy_int8_t ij = { int8_t(parser.intval('I', -1)), int8_t(parser.intval('J', -1)) }; - const bool hasI = ij.x >= 0, - hasJ = ij.y >= 0, - hasC = parser.seen('C'), - hasN = parser.seen('N'), - hasZ = parser.seen('Z'), - hasQ = !hasZ && parser.seen('Q'); - - if (hasC) ij = ubl.find_closest_mesh_point_of_type(REAL, current_position); - - if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); - else if (!WITHIN(ij.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ij.y, 0, GRID_MAX_POINTS_Y - 1)) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); - else { - float &zval = ubl.z_values[ij.x][ij.y]; - zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(ij.x, ij.y, zval); - #endif - } -} - -#endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G28.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G28.cpp deleted file mode 100644 index b7af871b11..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G28.cpp +++ /dev/null @@ -1,546 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#include "../gcode.h" - -#include "../../module/stepper.h" -#include "../../module/endstops.h" - -#if HOTENDS > 1 - #include "../../module/tool_change.h" -#endif - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(SENSORLESS_HOMING) - #include "../../feature/tmc_util.h" -#endif - -#include "../../module/probe.h" - -#if ENABLED(BLTOUCH) - #include "../../feature/bltouch.h" -#endif - -#include "../../lcd/ultralcd.h" - -#if HAS_DRIVER(L6470) // set L6470 absolute position registers to counts - #include "../../libs/L6470/L6470_Marlin.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../core/debug_out.h" - -#if ENABLED(QUICK_HOME) - - static void quick_home_xy() { - - // Pretend the current position is 0,0 - current_position.set(0.0, 0.0); - sync_plan_position(); - - const int x_axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - x_home_dir(active_extruder) - #else - home_dir(X_AXIS) - #endif - ; - - const float mlx = max_length(X_AXIS), - mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_s = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); - - #if ENABLED(SENSORLESS_HOMING) - sensorless_t stealth_states { - tmc_enable_stallguard(stepperX) - , tmc_enable_stallguard(stepperY) - , false - , false - #if AXIS_HAS_STALLGUARD(X2) - || tmc_enable_stallguard(stepperX2) - #endif - , false - #if AXIS_HAS_STALLGUARD(Y2) - || tmc_enable_stallguard(stepperY2) - #endif - }; - #endif - - do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s); - - endstops.validate_homing_move(); - - current_position.set(0.0, 0.0); - - #if ENABLED(SENSORLESS_HOMING) - tmc_disable_stallguard(stepperX, stealth_states.x); - tmc_disable_stallguard(stepperY, stealth_states.y); - #if AXIS_HAS_STALLGUARD(X2) - tmc_disable_stallguard(stepperX2, stealth_states.x2); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - tmc_disable_stallguard(stepperY2, stealth_states.y2); - #endif - #endif - } - -#endif // QUICK_HOME - -#if ENABLED(Z_SAFE_HOMING) - - inline void home_z_safely() { - - // Disallow Z homing if X or Y are unknown - if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { - LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING_SER); - return; - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("home_z_safely >>>"); - - sync_plan_position(); - - /** - * Move the Z probe (or just the nozzle) to the safe homing point - * (Z is already at the right height) - */ - destination.set(safe_homing_xy, current_position.z); - - #if HOMING_Z_WITH_PROBE - destination -= probe_offset; - #endif - - if (position_is_reachable(destination)) { - - if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination); - - // This causes the carriage on Dual X to unpark - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - - #if ENABLED(SENSORLESS_HOMING) - safe_delay(500); // Short delay needed to settle - #endif - - do_blocking_move_to_xy(destination); - homeaxis(Z_AXIS); - } - else { - LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_MSG(MSG_ZPROBE_OUT_SER); - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely"); - } - -#endif // Z_SAFE_HOMING - -#if ENABLED(IMPROVE_HOMING_RELIABILITY) - - slow_homing_t begin_slow_homing() { - slow_homing_t slow_homing{0}; - slow_homing.acceleration.set(planner.settings.max_acceleration_mm_per_s2[X_AXIS], - planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); - planner.settings.max_acceleration_mm_per_s2[X_AXIS] = 100; - planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = 100; - #if HAS_CLASSIC_JERK - slow_homing.jerk_xy = planner.max_jerk; - planner.max_jerk.set(0, 0); - #endif - planner.reset_acceleration_rates(); - return slow_homing; - } - - void end_slow_homing(const slow_homing_t &slow_homing) { - planner.settings.max_acceleration_mm_per_s2[X_AXIS] = slow_homing.acceleration.x; - planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = slow_homing.acceleration.y; - #if HAS_CLASSIC_JERK - planner.max_jerk = slow_homing.jerk_xy; - #endif - planner.reset_acceleration_rates(); - } - -#endif // IMPROVE_HOMING_RELIABILITY - -/** - * G28: Home all axes according to settings - * - * Parameters - * - * None Home to all axes with no parameters. - * With QUICK_HOME enabled XY will home together, then Z. - * - * O Home only if position is unknown - * - * Rn Raise by n mm/inches before homing - * - * Cartesian/SCARA parameters - * - * X Home to the X endstop - * Y Home to the Y endstop - * Z Home to the Z endstop - * - */ -void GcodeSuite::G28(const bool always_home_all) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM(">>> G28"); - log_machine_info(); - } - - #if ENABLED(DUAL_X_CARRIAGE) - bool IDEX_saved_duplication_state = extruder_duplication_enabled; - DualXMode IDEX_saved_mode = dual_x_carriage_mode; - #endif - - #if ENABLED(MARLIN_DEV_MODE) - if (parser.seen('S')) { - LOOP_XYZ(a) set_axis_is_at_home((AxisEnum)a); - sync_plan_position(); - SERIAL_ECHOLNPGM("Simulated Homing"); - report_current_position(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); - return; - } - #endif - - // Home (O)nly if position is unknown - if (!homing_needed() && parser.boolval('O')) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip\n<<< G28"); - return; - } - - // Wait for planner moves to finish! - planner.synchronize(); - - // Disable the leveling matrix before homing - #if HAS_LEVELING - - // Cancel the active G29 session - #if ENABLED(PROBE_MANUALLY) - g29_in_progress = false; - #endif - - #if ENABLED(RESTORE_LEVELING_AFTER_G28) - const bool leveling_was_active = planner.leveling_active; - #endif - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif - - #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) - #define HAS_HOMING_CURRENT (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2)) - - #if HAS_HOMING_CURRENT - auto debug_current = [](const char * const s, const int16_t a, const int16_t b){ - DEBUG_ECHO(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); - }; - #if HAS_CURRENT_HOME(X) - const int16_t tmc_save_current_X = stepperX.getMilliamps(); - stepperX.rms_current(X_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current("X", tmc_save_current_X, X_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(X2) - const int16_t tmc_save_current_X2 = stepperX2.getMilliamps(); - stepperX2.rms_current(X2_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current("X2", tmc_save_current_X2, X2_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(Y) - const int16_t tmc_save_current_Y = stepperY.getMilliamps(); - stepperY.rms_current(Y_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current("Y", tmc_save_current_Y, Y_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(Y2) - const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps(); - stepperY2.rms_current(Y2_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current("Y2", tmc_save_current_Y2, Y2_CURRENT_HOME); - #endif - #endif - - #if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to spreadCycle..."); - process_subcommands_now_P(PSTR("M569S0XY")); - #endif - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - slow_homing_t slow_homing = begin_slow_homing(); - #endif - - // Always home with tool 0 active - #if HOTENDS > 1 - #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) - const uint8_t old_tool_index = active_extruder; - #endif - tool_change(0, true); - #endif - - #if HAS_DUPLICATION_MODE - extruder_duplication_enabled = false; - #endif - - remember_feedrate_scaling_off(); - - endstops.enable(true); // Enable endstops for next homing move - - #if ENABLED(DELTA) - - home_delta(); - UNUSED(always_home_all); - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif - - #else // NOT DELTA - - const bool homeX = parser.seen('X'), homeY = parser.seen('Y'), homeZ = parser.seen('Z'), - home_all = always_home_all || (homeX == homeY && homeX == homeZ), - doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ; - - destination = current_position; - - #if Z_HOME_DIR > 0 // If homing away from BED do Z first - - if (doZ) homeaxis(Z_AXIS); - - #endif - - const float z_homing_height = ( - #if ENABLED(UNKNOWN_Z_NO_RAISE) - !TEST(axis_known_position, Z_AXIS) ? 0 : - #endif - (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) - ); - - if (z_homing_height && (doX || doY)) { - // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination.z = z_homing_height + (TEST(axis_known_position, Z_AXIS) ? 0.0f : current_position.z); - if (destination.z > current_position.z) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) to ", destination.z); - do_blocking_move_to_z(destination.z); - } - } - - #if ENABLED(QUICK_HOME) - - if (doX && doY) quick_home_xy(); - - #endif - - // Home Y (before X) - #if ENABLED(HOME_Y_BEFORE_X) - - if (doY - #if ENABLED(CODEPENDENT_XY_HOMING) - || doX - #endif - ) homeaxis(Y_AXIS); - - #endif - - // Home X - if (doX - #if ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X) - || doY - #endif - ) { - - #if ENABLED(DUAL_X_CARRIAGE) - - // Always home the 2nd (right) extruder first - active_extruder = 1; - homeaxis(X_AXIS); - - // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position.x; - - // Home the 1st (left) extruder - active_extruder = 0; - homeaxis(X_AXIS); - - // Consider the active extruder to be parked - raised_parked_position = current_position; - delayed_move_time = 0; - active_extruder_parked = true; - - #else - - homeaxis(X_AXIS); - - #endif - } - - // Home Y (after X) - #if DISABLED(HOME_Y_BEFORE_X) - if (doY) homeaxis(Y_AXIS); - #endif - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif - - // Home Z last if homing towards the bed - #if Z_HOME_DIR < 0 - if (doZ) { - #if ENABLED(BLTOUCH) - bltouch.init(); - #endif - #if ENABLED(Z_SAFE_HOMING) - home_z_safely(); - #else - homeaxis(Z_AXIS); - #endif - - #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING) - move_z_after_probing(); - #endif - - } // doZ - #endif // Z_HOME_DIR < 0 - - sync_plan_position(); - - #endif // !DELTA (G28) - - /** - * Preserve DXC mode across a G28 for IDEX printers in DXC_DUPLICATION_MODE. - * This is important because it lets a user use the LCD Panel to set an IDEX Duplication mode, and - * then print a standard GCode file that contains a single print that does a G28 and has no other - * IDEX specific commands in it. - */ - #if ENABLED(DUAL_X_CARRIAGE) - - if (dxc_is_duplicating()) { - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - slow_homing = begin_slow_homing(); - #endif - - // Always home the 2nd (right) extruder first - active_extruder = 1; - homeaxis(X_AXIS); - - // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position.x; - - // Home the 1st (left) extruder - active_extruder = 0; - homeaxis(X_AXIS); - - // Consider the active extruder to be parked - raised_parked_position = current_position; - delayed_move_time = 0; - active_extruder_parked = true; - extruder_duplication_enabled = IDEX_saved_duplication_state; - dual_x_carriage_mode = IDEX_saved_mode; - stepper.set_directions(); - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - end_slow_homing(slow_homing); - #endif - } - - #endif // DUAL_X_CARRIAGE - - endstops.not_homing(); - - // Clear endstop state for polled stallGuard endstops - #if ENABLED(SPI_ENDSTOPS) - endstops.clear_endstop_state(); - #endif - - #if BOTH(DELTA, DELTA_HOME_TO_SAFE_ZONE) - // move to a height where we can use the full xy-area - do_blocking_move_to_z(delta_clip_start_height); - #endif - - #if HAS_LEVELING && ENABLED(RESTORE_LEVELING_AFTER_G28) - set_bed_leveling_enabled(leveling_was_active); - #endif - - restore_feedrate_and_scaling(); - - // Restore the active tool after homing - #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) - #if EITHER(PARKING_EXTRUDER, DUAL_X_CARRIAGE) - #define NO_FETCH false // fetch the previous toolhead - #else - #define NO_FETCH true - #endif - tool_change(old_tool_index, NO_FETCH); - #endif - - #if HAS_HOMING_CURRENT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore driver current..."); - #if HAS_CURRENT_HOME(X) - stepperX.rms_current(tmc_save_current_X); - #endif - #if HAS_CURRENT_HOME(X2) - stepperX2.rms_current(tmc_save_current_X2); - #endif - #if HAS_CURRENT_HOME(Y) - stepperY.rms_current(tmc_save_current_Y); - #endif - #if HAS_CURRENT_HOME(Y2) - stepperY2.rms_current(tmc_save_current_Y2); - #endif - #endif - - #if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to StealthChop..."); - process_subcommands_now_P(PSTR("M569S1XY")); - #endif - - 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. - #else - #define _HOME_SYNC doZ // Only for Z-axis - #endif - if (_HOME_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); - - #if HAS_DRIVER(L6470) - // Set L6470 absolute position registers to counts - for (uint8_t j = 1; j <= L6470::chain[0]; j++) { - const uint8_t cv = L6470::chain[j]; - L6470.set_param(cv, L6470_ABS_POS, stepper.position((AxisEnum)L6470.axis_xref[cv])); - } - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G33.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G33.cpp deleted file mode 100644 index 1931d226af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G33.cpp +++ /dev/null @@ -1,667 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(DELTA_AUTO_CALIBRATION) - -#include "../gcode.h" -#include "../../module/delta.h" -#include "../../module/motion.h" -#include "../../module/stepper.h" -#include "../../module/endstops.h" -#include "../../lcd/ultralcd.h" - -#if HAS_BED_PROBE - #include "../../module/probe.h" -#endif - -#if HOTENDS > 1 - #include "../../module/tool_change.h" -#endif - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -constexpr uint8_t _7P_STEP = 1, // 7-point step - to change number of calibration points - _4P_STEP = _7P_STEP * 2, // 4-point step - NPP = _7P_STEP * 6; // number of calibration points on the radius -enum CalEnum : char { // the 7 main calibration points - add definitions if needed - CEN = 0, - __A = 1, - _AB = __A + _7P_STEP, - __B = _AB + _7P_STEP, - _BC = __B + _7P_STEP, - __C = _BC + _7P_STEP, - _CA = __C + _7P_STEP, -}; - -#define LOOP_CAL_PT(VAR, S, N) for (uint8_t VAR=S; VAR<=NPP; VAR+=N) -#define F_LOOP_CAL_PT(VAR, S, N) for (float VAR=S; VARCEN+0.9999; VAR-=N) -#define LOOP_CAL_ALL(VAR) LOOP_CAL_PT(VAR, CEN, 1) -#define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP) -#define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP) - -#if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - #define AC_CLEANUP() ac_cleanup(old_tool_index) -#else - #define AC_CLEANUP() ac_cleanup() -#endif - -float lcd_probe_pt(const xy_pos_t &xy); - -void ac_home() { - endstops.enable(true); - home_delta(); - endstops.not_homing(); -} - -void ac_setup(const bool reset_bed) { - #if HOTENDS > 1 - tool_change(0, true); - #endif - - planner.synchronize(); - remember_feedrate_scaling_off(); - - #if HAS_LEVELING - if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid - #endif -} - -void ac_cleanup( - #if HOTENDS > 1 - const uint8_t old_tool_index - #endif -) { - #if ENABLED(DELTA_HOME_TO_SAFE_ZONE) - do_blocking_move_to_z(delta_clip_start_height); - #endif - #if HAS_BED_PROBE - STOW_PROBE(); - #endif - restore_feedrate_and_scaling(); - #if HOTENDS > 1 - tool_change(old_tool_index, true); - #endif -} - -void print_signed_float(PGM_P const prefix, const float &f) { - SERIAL_ECHOPGM(" "); - serialprintPGM(prefix); - SERIAL_CHAR(':'); - if (f >= 0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(f, 2); -} - -/** - * - Print the delta settings - */ -static void print_calibration_settings(const bool end_stops, const bool tower_angles) { - SERIAL_ECHOPAIR(".Height:", delta_height); - if (end_stops) { - print_signed_float(PSTR("Ex"), delta_endstop_adj.a); - print_signed_float(PSTR("Ey"), delta_endstop_adj.b); - print_signed_float(PSTR("Ez"), delta_endstop_adj.c); - } - if (end_stops && tower_angles) { - SERIAL_ECHOPAIR(" Radius:", delta_radius); - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_ECHO_SP(13); - } - if (tower_angles) { - print_signed_float(PSTR("Tx"), delta_tower_angle_trim.a); - print_signed_float(PSTR("Ty"), delta_tower_angle_trim.b); - print_signed_float(PSTR("Tz"), delta_tower_angle_trim.c); - } - if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR - SERIAL_ECHOPAIR(" Radius:", delta_radius); - } - SERIAL_EOL(); -} - -/** - * - Print the probe results - */ -static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { - SERIAL_ECHOPGM(". "); - print_signed_float(PSTR("c"), z_pt[CEN]); - if (tower_points) { - print_signed_float(PSTR(" x"), z_pt[__A]); - print_signed_float(PSTR(" y"), z_pt[__B]); - print_signed_float(PSTR(" z"), z_pt[__C]); - } - if (tower_points && opposite_points) { - SERIAL_EOL(); - SERIAL_CHAR('.'); - SERIAL_ECHO_SP(13); - } - if (opposite_points) { - print_signed_float(PSTR("yz"), z_pt[_BC]); - print_signed_float(PSTR("zx"), z_pt[_CA]); - print_signed_float(PSTR("xy"), z_pt[_AB]); - } - SERIAL_EOL(); -} - -/** - * - Calculate the standard deviation from the zero plane - */ -static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) { - if (!_0p_cal) { - float S2 = sq(z_pt[CEN]); - int16_t N = 1; - if (!_1p_cal) { // std dev from zero plane - LOOP_CAL_ACT(rad, _4p_cal, _4p_opp) { - S2 += sq(z_pt[rad]); - N++; - } - return LROUND(SQRT(S2 / N) * 1000.0f) / 1000.0f + 0.00001f; - } - } - return 0.00001f; -} - -/** - * - Probe a point - */ -static float calibration_probe(const xy_pos_t &xy, const bool stow) { - #if HAS_BED_PROBE - return probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true); - #else - UNUSED(stow); - return lcd_probe_pt(xy); - #endif -} - -/** - * - Probe a grid - */ -static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const bool towers_set, const bool stow_after_each) { - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_calibration = probe_points >= 3, - _7p_no_intermediates = probe_points == 3, - _7p_1_intermediates = probe_points == 4, - _7p_2_intermediates = probe_points == 5, - _7p_4_intermediates = probe_points == 6, - _7p_6_intermediates = probe_points == 7, - _7p_8_intermediates = probe_points == 8, - _7p_11_intermediates = probe_points == 9, - _7p_14_intermediates = probe_points == 10, - _7p_intermed_points = probe_points >= 4, - _7p_6_center = probe_points >= 5 && probe_points <= 7, - _7p_9_center = probe_points >= 8; - - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0f; - - if (!_0p_calibration) { - - const float dcr = delta_calibration_radius(); - - if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center - const xy_pos_t center{0}; - z_pt[CEN] += calibration_probe(center, stow_after_each); - if (isnan(z_pt[CEN])) return false; - } - - if (_7p_calibration) { // probe extra center points - 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 = dcr * 0.1; - const xy_pos_t vec = { cos(a), sin(a) }; - z_pt[CEN] += calibration_probe(vec * r, stow_after_each); - if (isnan(z_pt[CEN])) return false; - } - z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); - } - - if (!_1p_calibration) { // probe the radius - const CalEnum start = _4p_opposite_points ? _AB : __A; - 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; - F_LOOP_CAL_PT(rad, start, _7p_9_center ? steps * 3 : steps) { - const int8_t offset = _7p_9_center ? 2 : 0; - for (int8_t circle = 0; circle <= offset; circle++) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = dcr * (1 - 0.1 * (zig_zag ? offset - circle : circle)), - interpol = FMOD(rad, 1); - const xy_pos_t vec = { cos(a), sin(a) }; - const float z_temp = calibration_probe(vec * r, stow_after_each); - if (isnan(z_temp)) return false; - // split probe point to neighbouring calibration points - z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); - z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); - } - zig_zag = !zig_zag; - } - if (_7p_intermed_points) - LOOP_CAL_RAD(rad) - z_pt[rad] /= _7P_STEP / steps; - - do_blocking_move_to_xy(0.0f, 0.0f); - } - } - return true; -} - -/** - * kinematics routines and auto tune matrix scaling parameters: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - formulae for approximative forward kinematics in the end-stop displacement matrix - * - definition of the matrix scaling parameters - */ -static void reverse_kinematics_probe_points(float z_pt[NPP + 1], abc_float_t mm_at_pt_axis[NPP + 1]) { - xyz_pos_t pos{0}; - - const float dcr = delta_calibration_radius(); - LOOP_CAL_ALL(rad) { - const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = (rad == CEN ? 0.0f : dcr); - pos.set(cos(a) * r, sin(a) * r, z_pt[rad]); - inverse_kinematics(pos); - mm_at_pt_axis[rad] = delta; - } -} - -static void forward_kinematics_probe_points(abc_float_t mm_at_pt_axis[NPP + 1], float z_pt[NPP + 1]) { - const float r_quot = delta_calibration_radius() / delta_radius; - - #define ZPP(N,I,A) (((1.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) - #define Zp2(I, A) ZPP(+2, I, A) - #define Zm2(I, A) ZPP(-2, I, A) - - z_pt[CEN] = Z00(CEN, a) + Z00(CEN, b) + Z00(CEN, c); - z_pt[__A] = Zp2(__A, a) + Zm1(__A, b) + Zm1(__A, c); - z_pt[__B] = Zm1(__B, a) + Zp2(__B, b) + Zm1(__B, c); - z_pt[__C] = Zm1(__C, a) + Zm1(__C, b) + Zp2(__C, c); - z_pt[_BC] = Zm2(_BC, a) + Zp1(_BC, b) + Zp1(_BC, c); - z_pt[_CA] = Zp1(_CA, a) + Zm2(_CA, b) + Zp1(_CA, c); - z_pt[_AB] = Zp1(_AB, a) + Zp1(_AB, b) + Zm2(_AB, c); -} - -static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], abc_float_t delta_e, const float delta_r, abc_float_t delta_t) { - const float z_center = z_pt[CEN]; - abc_float_t diff_mm_at_pt_axis[NPP + 1], new_mm_at_pt_axis[NPP + 1]; - - reverse_kinematics_probe_points(z_pt, diff_mm_at_pt_axis); - - delta_radius += delta_r; - delta_tower_angle_trim += delta_t; - recalc_delta_settings(); - reverse_kinematics_probe_points(z_pt, new_mm_at_pt_axis); - - LOOP_CAL_ALL(rad) diff_mm_at_pt_axis[rad] -= new_mm_at_pt_axis[rad] + delta_e; - forward_kinematics_probe_points(diff_mm_at_pt_axis, z_pt); - - LOOP_CAL_RAD(rad) z_pt[rad] -= z_pt[CEN] - z_center; - z_pt[CEN] = z_center; - - delta_radius -= delta_r; - delta_tower_angle_trim -= delta_t; - recalc_delta_settings(); -} - -static float auto_tune_h() { - const float r_quot = delta_calibration_radius() / delta_radius; - return RECIPROCAL(r_quot / (2.0f / 3.0f)); // (2/3)/CR -} - -static float auto_tune_r() { - constexpr float diff = 0.01f, delta_r = diff; - float r_fac = 0.0f, z_pt[NPP + 1] = { 0.0f }; - abc_float_t delta_e = { 0.0f }, delta_t = { 0.0f }; - - 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.0f; - r_fac = diff / r_fac / 3.0f; // 1/(3*delta_Z) - return r_fac; -} - -static float auto_tune_a() { - constexpr float diff = 0.01f, delta_r = 0.0f; - float a_fac = 0.0f, z_pt[NPP + 1] = { 0.0f }; - abc_float_t delta_e = { 0.0f }, delta_t = { 0.0f }; - - delta_t.reset(); - LOOP_XYZ(axis) { - delta_t[axis] = diff; - calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); - 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.0f; // 1/(3*delta_Z) - return a_fac; -} - -/** - * G33 - Delta '1-4-7-point' Auto-Calibration - * Calibrate height, z_offset, endstops, delta radius, and tower angles. - * - * Parameters: - * - * Pn Number of probe points: - * P0 Normalizes calibration. - * P1 Calibrates height only with center probe. - * P2 Probe center and towers. Calibrate height, endstops and delta radius. - * P3 Probe all positions: center, towers and opposite towers. Calibrate all. - * P4-P10 Probe all positions at different intermediate locations and average them. - * - * T Don't calibrate tower angle corrections - * - * Cn.nn Calibration precision; when omitted calibrates to maximum precision - * - * Fn Force to run at least n iterations and take the best result - * - * Vn Verbose level: - * V0 Dry-run mode. Report settings and probe results. No calibration. - * V1 Report start and end settings only - * V2 Report settings at each iteration - * V3 Report settings and probe results - * - * E Engage the probe for each point - */ -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 implausible (0-10)."); - return; - } - - const bool towers_set = !parser.seen('T'); - - const float calibration_precision = parser.floatval('C', 0.0f); - if (calibration_precision < 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 implausible (0-30)."); - return; - } - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); - return; - } - - const bool stow_after_each = parser.seen('E'); - - const bool _0p_calibration = probe_points == 0, - _1p_calibration = probe_points == 1 || probe_points == -1, - _4p_calibration = probe_points == 2, - _4p_opposite_points = _4p_calibration && !towers_set, - _7p_9_center = probe_points >= 8, - _tower_results = (_4p_calibration && towers_set) || probe_points >= 3, - _opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3, - _endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0, - _angle_results = probe_points >= 3 && towers_set; - 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.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, r_factor, a_factor, - r_old = delta_radius, - h_old = delta_height; - - abc_pos_t e_old = delta_endstop_adj, a_old = delta_tower_angle_trim; - - SERIAL_ECHOLNPGM("G33 Auto Calibrate"); - - const float dcr = delta_calibration_radius(); - - if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable - LOOP_CAL_RAD(axis) { - const float a = RADIANS(210 + (360 / NPP) * (axis - 1)); - if (!position_is_reachable(cos(a) * dcr, sin(a) * dcr)) { - SERIAL_ECHOLNPGM("?Bed calibration radius implausible."); - return; - } - } - } - - // Report settings - PGM_P checkingac = PSTR("Checking... AC"); - serialprintPGM(checkingac); - if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)"); - SERIAL_EOL(); - ui.set_status_P(checkingac); - - print_calibration_settings(_endstop_results, _angle_results); - - ac_setup(!_0p_calibration && !_1p_calibration); - - if (!_0p_calibration) ac_home(); - - do { // start iterations - - float z_at_pt[NPP + 1] = { 0.0f }; - - test_precision = zero_std_dev_old != 999.0f ? (zero_std_dev + zero_std_dev_old) / 2.0f : zero_std_dev; - iterations++; - - // Probe the points - zero_std_dev_old = zero_std_dev; - if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each)) { - SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666"); - return AC_CLEANUP(); - } - zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); - - // Solve matrices - - if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { - - #if !HAS_BED_PROBE - test_precision = 0.0f; // forced end - #endif - - if (zero_std_dev < zero_std_dev_min) { - // set roll-back point - e_old = delta_endstop_adj; - r_old = delta_radius; - h_old = delta_height; - a_old = delta_tower_angle_trim; - } - - abc_float_t e_delta = { 0.0f }, t_delta = { 0.0f }; - float r_delta = 0.0f; - - /** - * convergence matrices: - * see https://github.com/LVD-AC/Marlin-AC/tree/1.1.x-AC/documentation for - * - definition of the matrix scaling parameters - * - matrices for 4 and 7 point calibration - */ - #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) - #define Z1(I) ZP(1, I) - #define Z0(I) ZP(0, I) - - // calculate factors - if (_7p_9_center) calibration_radius_factor = 0.9f; - h_factor = auto_tune_h(); - r_factor = auto_tune_r(); - a_factor = auto_tune_a(); - calibration_radius_factor = 1.0f; - - switch (probe_points) { - case 0: - test_precision = 0.0f; // forced end - break; - - case 1: - test_precision = 0.0f; // forced end - LOOP_XYZ(axis) e_delta[axis] = +Z4(CEN); - break; - - case 2: - if (towers_set) { // see 4 point calibration (towers) matrix - e_delta.set((+Z4(__A) -Z2(__B) -Z2(__C)) * h_factor +Z4(CEN), - (-Z2(__A) +Z4(__B) -Z2(__C)) * h_factor +Z4(CEN), - (-Z2(__A) -Z2(__B) +Z4(__C)) * h_factor +Z4(CEN)); - r_delta = (+Z4(__A) +Z4(__B) +Z4(__C) -Z12(CEN)) * r_factor; - } - else { // see 4 point calibration (opposites) matrix - e_delta.set((-Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor +Z4(CEN), - (+Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor +Z4(CEN), - (+Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor +Z4(CEN)); - r_delta = (+Z4(_BC) +Z4(_CA) +Z4(_AB) -Z12(CEN)) * r_factor; - } - break; - - default: // see 7 point calibration (towers & opposites) matrix - e_delta.set((+Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor +Z4(CEN), - (-Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor +Z4(CEN), - (-Z1(__A) -Z1(__B) +Z2(__C) +Z1(_BC) +Z1(_CA) -Z2(_AB)) * h_factor +Z4(CEN)); - r_delta = (+Z2(__A) +Z2(__B) +Z2(__C) +Z2(_BC) +Z2(_CA) +Z2(_AB) -Z12(CEN)) * r_factor; - - if (towers_set) { // see 7 point tower angle calibration (towers & opposites) matrix - t_delta.set((+Z0(__A) -Z4(__B) +Z4(__C) +Z0(_BC) -Z4(_CA) +Z4(_AB) +Z0(CEN)) * a_factor, - (+Z4(__A) +Z0(__B) -Z4(__C) +Z4(_BC) +Z0(_CA) -Z4(_AB) +Z0(CEN)) * a_factor, - (-Z4(__A) +Z4(__B) +Z0(__C) -Z4(_BC) +Z4(_CA) +Z0(_AB) +Z0(CEN)) * a_factor); - } - break; - } - delta_endstop_adj += e_delta; - delta_radius += r_delta; - delta_tower_angle_trim += t_delta; - } - else if (zero_std_dev >= test_precision) { - // roll back - delta_endstop_adj = e_old; - delta_radius = r_old; - delta_height = h_old; - delta_tower_angle_trim = a_old; - } - - if (verbose_level != 0) { // !dry run - - // Normalize angles to least-squares - if (_angle_results) { - 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.0f; - } - - // adjust delta_height and endstops by the max amount - const float z_temp = _MAX(delta_endstop_adj.a, delta_endstop_adj.b, delta_endstop_adj.c); - delta_height -= z_temp; - LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; - } - recalc_delta_settings(); - NOMORE(zero_std_dev_min, zero_std_dev); - - // print report - - if (verbose_level == 3) - print_calibration_results(z_at_pt, _tower_results, _opposite_results); - - if (verbose_level != 0) { // !dry run - if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations - SERIAL_ECHOPGM("Calibration OK"); - SERIAL_ECHO_SP(32); - #if HAS_BED_PROBE - if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration) - SERIAL_ECHOPGM("rolling back."); - else - #endif - { - SERIAL_ECHOPAIR_F("std dev:", zero_std_dev_min, 3); - } - SERIAL_EOL(); - 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.0f)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); - ui.set_status(mess); - print_calibration_settings(_endstop_results, _angle_results); - serialprintPGM(save_message); - SERIAL_EOL(); - } - else { // !end iterations - char mess[15]; - if (iterations < 31) - sprintf_P(mess, PSTR("Iteration : %02i"), (unsigned int)iterations); - else - strcpy_P(mess, PSTR("No convergence")); - SERIAL_ECHO(mess); - SERIAL_ECHO_SP(32); - SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); - ui.set_status(mess); - if (verbose_level > 1) - print_calibration_settings(_endstop_results, _angle_results); - } - } - else { // dry run - PGM_P enddryrun = PSTR("End DRY-RUN"); - serialprintPGM(enddryrun); - SERIAL_ECHO_SP(35); - SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); - - char mess[21]; - 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.0f)); - else - sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); - ui.set_status(mess); - } - ac_home(); - } - while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - - AC_CLEANUP(); -} - -#endif // DELTA_AUTO_CALIBRATION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G34_M422.cpp deleted file mode 100644 index 704d370c4f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G34_M422.cpp +++ /dev/null @@ -1,442 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(Z_STEPPER_AUTO_ALIGN) - -#include "../gcode.h" -#include "../../module/planner.h" -#include "../../module/stepper.h" -#include "../../module/motion.h" -#include "../../module/probe.h" - -#if HOTENDS > 1 - #include "../../module/tool_change.h" -#endif - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #include "../../libs/least_squares_fit.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../core/debug_out.h" - -// Sanity-check the count of Z_STEPPER_ALIGN_XY points -constexpr xy_pos_t sanity_arr_z_align[] = Z_STEPPER_ALIGN_XY; -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - static_assert(COUNT(sanity_arr_z_align) >= Z_STEPPER_COUNT, - "Z_STEPPER_ALIGN_XY requires at least three {X,Y} entries (Z, Z2, Z3, ...)." - ); -#else - static_assert(COUNT(sanity_arr_z_align) == Z_STEPPER_COUNT, - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - "Z_STEPPER_ALIGN_XY requires three {X,Y} entries (Z, Z2, and Z3)." - #else - "Z_STEPPER_ALIGN_XY requires two {X,Y} entries (Z and Z2)." - #endif - ); -#endif - -static xy_pos_t z_auto_align_pos[Z_STEPPER_COUNT] = Z_STEPPER_ALIGN_XY; - -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - static xy_pos_t z_stepper_pos[] = Z_STEPPER_ALIGN_STEPPER_XY; -#endif - -#define G34_PROBE_COUNT COUNT(z_auto_align_pos) - -inline void set_all_z_lock(const bool lock) { - stepper.set_z_lock(lock); - stepper.set_z2_lock(lock); - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - stepper.set_z3_lock(lock); - #endif -} - -/** - * G34: Z-Stepper automatic alignment - * - * I - * T - * A - */ -void GcodeSuite::G34() { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM(">>> G34"); - log_machine_info(); - } - - do { // break out on error - - const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); - if (!WITHIN(z_auto_align_iterations, 1, 30)) { - SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); - break; - } - - const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); - if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { - SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); - break; - } - - const float z_auto_align_amplification = - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - Z_STEPPER_ALIGN_AMP; - #else - parser.floatval('A', Z_STEPPER_ALIGN_AMP); - if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { - SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); - break; - } - #endif - - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - // Wait for planner moves to finish! - planner.synchronize(); - - // Disable the leveling matrix before auto-aligning - #if HAS_LEVELING - #if ENABLED(RESTORE_LEVELING_AFTER_G34) - const bool leveling_was_active = planner.leveling_active; - #endif - set_bed_leveling_enabled(false); - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif - - // Always home with tool 0 active - #if HOTENDS > 1 - const uint8_t old_tool_index = active_extruder; - tool_change(0, true); - #endif - - #if HAS_DUPLICATION_MODE - extruder_duplication_enabled = false; - #endif - - #if BOTH(BLTOUCH, BLTOUCH_HS_MODE) - // In BLTOUCH HS mode, the probe travels in a deployed state. - // Users of G34 might have a badly misaligned bed, so raise Z by the - // length of the deployed pin (BLTOUCH stroke < 7mm) - #define Z_BASIC_CLEARANCE Z_CLEARANCE_BETWEEN_PROBES + 7.0f - #else - #define Z_BASIC_CLEARANCE Z_CLEARANCE_BETWEEN_PROBES - #endif - - // Compute a worst-case clearance height to probe from. After the first - // iteration this will be re-calculated based on the actual bed position - float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * ( - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - SQRT(_MAX(HYPOT2(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y), - HYPOT2(z_auto_align_pos[1].x - z_auto_align_pos[1].y, z_auto_align_pos[2].x - z_auto_align_pos[2].y), - HYPOT2(z_auto_align_pos[2].x - z_auto_align_pos[2].y, z_auto_align_pos[0].x - z_auto_align_pos[0].y))) - #else - HYPOT(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y) - #endif - ); - - // Home before the alignment procedure - if (!all_axes_known()) home_all_axes(); - - // Move the Z coordinate realm towards the positive - dirty trick - current_position.z -= z_probe * 0.5f; - - float last_z_align_move[Z_STEPPER_COUNT] = ARRAY_N(Z_STEPPER_COUNT, 10000.0f, 10000.0f, 10000.0f), - z_measured[G34_PROBE_COUNT] = { 0 }, - z_maxdiff = 0.0f, - amplification = z_auto_align_amplification; - - uint8_t iteration; - bool err_break = false; - for (iteration = 0; iteration < z_auto_align_iterations; ++iteration) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> probing all positions."); - - SERIAL_ECHOLNPAIR("\nITERATION: ", int(iteration + 1)); - - // Initialize minimum value - float z_measured_min = 100000.0f, - z_measured_max = -100000.0f; - - // Probe all positions (one per Z-Stepper) - for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) { - // iteration odd/even --> downward / upward stepper sequence - const uint8_t iprobe = (iteration & 1) ? G34_PROBE_COUNT - 1 - i : i; - - // Safe clearance even on an incline - if (iteration == 0 || i > 0) do_blocking_move_to_z(z_probe); - - // Probe a Z height for each stepper. - const float z_probed_height = probe_at_point(z_auto_align_pos[iprobe], raise_after, 0, true); - if (isnan(z_probed_height)) { - SERIAL_ECHOLNPGM("Probing failed."); - err_break = true; - break; - } - - // Add height to each value, to provide a more useful target height for - // the next iteration of probing. This allows adjustments to be made away from the bed. - z_measured[iprobe] = z_probed_height + Z_CLEARANCE_BETWEEN_PROBES; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(iprobe + 1), " measured position is ", z_measured[iprobe]); - - // Remember the minimum measurement to calculate the correction later on - z_measured_min = _MIN(z_measured_min, z_measured[iprobe]); - z_measured_max = _MAX(z_measured_max, z_measured[iprobe]); - } // for (i) - - if (err_break) break; - - // Adapt the next probe clearance height based on the new measurements. - // Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment. - z_maxdiff = z_measured_max - z_measured_min; - z_probe = Z_BASIC_CLEARANCE + z_measured_max + z_maxdiff; - - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Replace the initial values in z_measured with calculated heights at - // each stepper position. This allows the adjustment algorithm to be - // shared between both possible probing mechanisms. - - // This must be done after the next z_probe height is calculated, so that - // the height is calculated from actual print area positions, and not - // extrapolated motor movements. - - // Compute the least-squares fit for all probed points. - // Calculate the Z position of each stepper and store it in z_measured. - // This allows the actual adjustment logic to be shared by both algorithms. - linear_fit_data lfd; - incremental_LSF_reset(&lfd); - for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) { - SERIAL_ECHOLNPAIR("PROBEPT_", int(i + 1), ": ", z_measured[i]); - incremental_LSF(&lfd, z_auto_align_pos[i], z_measured[i]); - } - finish_incremental_LSF(&lfd); - - z_measured_min = 100000.0f; - for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i) { - z_measured[i] = -(lfd.A * z_stepper_pos[i].x + lfd.B * z_stepper_pos[i].y); - z_measured_min = _MIN(z_measured_min, z_measured[i]); - } - - SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]); - #endif - - SERIAL_ECHOLNPAIR("\n" - "DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1]) - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - , " Z2-Z3=", ABS(z_measured[1] - z_measured[2]) - , " Z3-Z1=", ABS(z_measured[2] - z_measured[0]) - #endif - ); - - // The following correction actions are to be enabled for select Z-steppers only - stepper.set_separate_multi_axis(true); - - bool success_break = true; - // Correct the individual stepper offsets - for (uint8_t zstepper = 0; zstepper < Z_STEPPER_COUNT; ++zstepper) { - // Calculate current stepper move - const float z_align_move = z_measured[zstepper] - z_measured_min, - z_align_abs = ABS(z_align_move); - - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Optimize one iteration's correction based on the first measurements - if (z_align_abs > 0.0f) amplification = iteration == 1 ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; - #endif - - // Check for less accuracy compared to last move - if (last_z_align_move[zstepper] < z_align_abs - 1.0) { - SERIAL_ECHOLNPGM("Decreasing accuracy detected."); - err_break = true; - break; - } - - // Remember the alignment for the next iteration - last_z_align_move[zstepper] = z_align_abs; - - // Stop early if all measured points achieve accuracy target - if (z_align_abs > z_auto_align_accuracy) success_break = false; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", z_align_move); - - // Lock all steppers except one - set_all_z_lock(true); - switch (zstepper) { - case 0: stepper.set_z_lock(false); break; - case 1: stepper.set_z2_lock(false); break; - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - case 2: stepper.set_z3_lock(false); break; - #endif - } - - // Do a move to correct part of the misalignment for the current stepper - do_blocking_move_to_z(amplification * z_align_move + current_position.z); - } // for (zstepper) - - // Back to normal stepper operations - set_all_z_lock(false); - stepper.set_separate_multi_axis(false); - - if (err_break) break; - - if (success_break) { SERIAL_ECHOLNPGM("Target accuracy achieved."); break; } - - } // for (iteration) - - if (err_break) { SERIAL_ECHOLNPGM("G34 aborted."); break; } - - SERIAL_ECHOLNPAIR("Did ", int(iteration + (iteration != z_auto_align_iterations)), " iterations of ", int(z_auto_align_iterations)); - SERIAL_ECHOLNPAIR_F("Accuracy: ", z_maxdiff); - - // Restore the active tool after homing - #if HOTENDS > 1 - tool_change(old_tool_index, ( - #if ENABLED(PARKING_EXTRUDER) - false // Fetch the previous toolhead - #else - true - #endif - )); - #endif - - #if HAS_LEVELING && ENABLED(RESTORE_LEVELING_AFTER_G34) - set_bed_leveling_enabled(leveling_was_active); - #endif - - // 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_at_point(...) left - // the probe deployed if it was successful. - STOW_PROBE(); - - // Home Z after the alignment procedure - process_subcommands_now_P(PSTR("G28 Z")); - - }while(0); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G34"); -} - -/** - * M422: Set a Z-Stepper automatic alignment XY point. - * Use repeatedly to set multiple points. - * - * S : Index of the probe point to set - * - * With Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS: - * W : Index of the Z stepper position to set - * The W and S parameters may not be combined. - * - * S and W require an X and/or Y parameter - * X : X position to set (Unchanged if omitted) - * Y : Y position to set (Unchanged if omitted) - */ -void GcodeSuite::M422() { - if (!parser.seen_any()) { - for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) - SERIAL_ECHOLNPAIR_P(PSTR("M422 S"), i + 1, SP_X_STR, z_auto_align_pos[i].x, SP_Y_STR, z_auto_align_pos[i].y); - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i) - SERIAL_ECHOLNPAIR_P(PSTR("M422 W"), i + 1, SP_X_STR, z_stepper_pos[i].x, SP_Y_STR, z_stepper_pos[i].y); - #endif - return; - } - - const bool is_probe_point = parser.seen('S'); - - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - if (is_probe_point && parser.seen('W')) { - SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); - return; - } - #endif - - xy_pos_t *pos_dest = ( - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - !is_probe_point ? z_stepper_pos : - #endif - z_auto_align_pos - ); - - if (!is_probe_point - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - && !parser.seen('W') - #endif - ) { - SERIAL_ECHOLNPGM( - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - "?(S) or (W) is required." - #else - "?(S) is required." - #endif - ); - return; - } - - // Get the Probe Position Index or Z Stepper Index - int8_t position_index; - if (is_probe_point) { - position_index = parser.intval('S') - 1; - if (!WITHIN(position_index, 0, int8_t(G34_PROBE_COUNT) - 1)) { - SERIAL_ECHOLNPGM("?(S) Z-ProbePosition index invalid."); - return; - } - } - else { - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - position_index = parser.intval('W') - 1; - if (!WITHIN(position_index, 0, Z_STEPPER_COUNT - 1)) { - SERIAL_ECHOLNPGM("?(W) Z-Stepper index invalid."); - return; - } - #endif - } - - const xy_pos_t pos = { - parser.floatval('X', pos_dest[position_index].x), - parser.floatval('Y', pos_dest[position_index].y) - }; - - if (is_probe_point) { - if (!position_is_reachable_by_probe(pos.x, Y_CENTER)) { - SERIAL_ECHOLNPGM("?(X) out of bounds."); - return; - } - if (!position_is_reachable_by_probe(pos)) { - SERIAL_ECHOLNPGM("?(Y) out of bounds."); - return; - } - } - - pos_dest[position_index] = pos; -} - -#endif // Z_STEPPER_AUTO_ALIGN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G425.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G425.cpp deleted file mode 100644 index d251e89f8a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/G425.cpp +++ /dev/null @@ -1,608 +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 . - * - */ - -#include "../../Marlin.h" - -#if ENABLED(CALIBRATION_GCODE) - -#include "../gcode.h" - -#if ENABLED(BACKLASH_GCODE) - #include "../../feature/backlash.h" -#endif - -#include "../../lcd/ultralcd.h" -#include "../../module/motion.h" -#include "../../module/planner.h" -#include "../../module/tool_change.h" -#include "../../module/endstops.h" -#include "../../feature/bedlevel/bedlevel.h" - -/** - * G425 backs away from the calibration object by various distances - * depending on the confidence level: - * - * UNKNOWN - No real notion on where the calibration object is on the bed - * UNCERTAIN - Measurement may be uncertain due to backlash - * CERTAIN - Measurement obtained with backlash compensation - */ - -#ifndef CALIBRATION_MEASUREMENT_UNKNOWN - #define CALIBRATION_MEASUREMENT_UNKNOWN 5.0 // mm -#endif -#ifndef CALIBRATION_MEASUREMENT_UNCERTAIN - #define CALIBRATION_MEASUREMENT_UNCERTAIN 1.0 // mm -#endif -#ifndef CALIBRATION_MEASUREMENT_CERTAIN - #define CALIBRATION_MEASUREMENT_CERTAIN 0.5 // mm -#endif - -#define HAS_X_CENTER BOTH(CALIBRATION_MEASURE_LEFT, CALIBRATION_MEASURE_RIGHT) -#define HAS_Y_CENTER BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK) - -enum side_t : uint8_t { TOP, RIGHT, FRONT, LEFT, BACK, NUM_SIDES }; - -static constexpr xyz_pos_t true_center CALIBRATION_OBJECT_CENTER; -static constexpr xyz_float_t dimensions CALIBRATION_OBJECT_DIMENSIONS; -static constexpr xy_float_t nod = { CALIBRATION_NOZZLE_OUTER_DIAMETER, CALIBRATION_NOZZLE_OUTER_DIAMETER }; - -struct measurements_t { - xyz_pos_t obj_center = true_center; // Non-static must be assigned from xyz_pos_t - - float obj_side[NUM_SIDES], backlash[NUM_SIDES]; - xyz_float_t pos_error; - - xy_float_t nozzle_outer_dimension = nod; -}; - -#define TEMPORARY_SOFT_ENDSTOP_STATE(enable) REMEMBER(tes, soft_endstops_enabled, enable); - -#if ENABLED(BACKLASH_GCODE) - #define TEMPORARY_BACKLASH_CORRECTION(value) REMEMBER(tbst, backlash.correction, value) -#else - #define TEMPORARY_BACKLASH_CORRECTION(value) -#endif - -#if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) - #define TEMPORARY_BACKLASH_SMOOTHING(value) REMEMBER(tbsm, backlash.smoothing_mm, value) -#else - #define TEMPORARY_BACKLASH_SMOOTHING(value) -#endif - -inline void calibration_move() { - do_blocking_move_to(current_position, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL)); -} - -/** - * Move to the exact center above the calibration object - * - * m in - Measurement record - * uncertainty in - How far away from the object top to park - */ -inline void park_above_object(measurements_t &m, const float uncertainty) { - // Move to safe distance above calibration object - current_position.z = m.obj_center.z + dimensions.z / 2 + uncertainty; - calibration_move(); - - // Move to center of calibration object in XY - current_position = xy_pos_t(m.obj_center); - calibration_move(); -} - -#if HOTENDS > 1 - inline void set_nozzle(measurements_t &m, const uint8_t extruder) { - if (extruder != active_extruder) { - park_above_object(m, CALIBRATION_MEASUREMENT_UNKNOWN); - tool_change(extruder); - } - } -#endif - -#if HAS_HOTEND_OFFSET - - inline void normalize_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) - hotend_offset[e] -= hotend_offset[0]; - hotend_offset[0].reset(); - } - -#endif - -inline bool read_calibration_pin() { - #if HAS_CALIBRATION_PIN - return (READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING); - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - return (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - #else - return (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - #endif -} - -/** - * Move along axis in the specified dir until the probe value becomes stop_state, - * then return the axis value. - * - * axis in - Axis along which the measurement will take place - * dir in - Direction along that axis (-1 or 1) - * stop_state in - Move until probe pin becomes this value - * 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 feedRate_t mms = fast ? MMM_TO_MMS(CALIBRATION_FEEDRATE_FAST) : MMM_TO_MMS(CALIBRATION_FEEDRATE_SLOW); - const float limit = fast ? 50 : 5; - - destination = current_position; - 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; - } - return destination[axis]; -} - -/** - * Move along axis until the probe is triggered. Move toolhead to its starting - * point and return the measured value. - * - * axis in - Axis along which the measurement will take place - * dir in - Direction along that axis (-1 or 1) - * stop_state in - Move until probe pin becomes this value - * backlash_ptr in/out - When not nullptr, measure and record axis backlash - * uncertainty in - If uncertainty is CALIBRATION_MEASUREMENT_UNKNOWN, do a fast probe. - */ -inline float measure(const AxisEnum axis, const int dir, const bool stop_state, float * const backlash_ptr, const float uncertainty) { - const bool fast = uncertainty == CALIBRATION_MEASUREMENT_UNKNOWN; - - // Save position - destination = current_position; - const float start_pos = destination[axis]; - const float measured_pos = measuring_movement(axis, dir, stop_state, fast); - // Measure backlash - if (backlash_ptr && !fast) { - const float release_pos = measuring_movement(axis, -dir, !stop_state, fast); - *backlash_ptr = ABS(release_pos - measured_pos); - } - // Return to starting position - destination[axis] = start_pos; - do_blocking_move_to(destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL)); - return measured_pos; -} - -/** - * Probe one side of the calibration object - * - * m in/out - Measurement record, m.obj_center and m.obj_side will be updated. - * uncertainty in - How far away from the calibration object to begin probing - * side in - Side of probe where probe will occur - * probe_top_at_edge in - When probing sides, probe top of calibration object nearest edge - * to find out height of edge - */ -inline void probe_side(measurements_t &m, const float uncertainty, const side_t side, const bool probe_top_at_edge=false) { - const xyz_float_t dimensions = CALIBRATION_OBJECT_DIMENSIONS; - AxisEnum axis; - float dir; - - park_above_object(m, uncertainty); - - switch (side) { - case TOP: { - const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty); - m.obj_center.z = measurement - dimensions.z / 2; - m.obj_side[TOP] = measurement; - return; - } - case RIGHT: axis = X_AXIS; dir = -1; break; - case FRONT: axis = Y_AXIS; dir = 1; break; - case LEFT: axis = X_AXIS; dir = 1; break; - case BACK: axis = Y_AXIS; dir = -1; break; - default: return; - } - - if (probe_top_at_edge) { - // Probe top nearest the side we are probing - current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]); - calibration_move(); - m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty); - m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2; - } - - // Move to safe distance to the side of the calibration object - current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty); - calibration_move(); - - // Plunge below the side of the calibration object and measure - current_position.z = m.obj_side[TOP] - CALIBRATION_NOZZLE_TIP_HEIGHT * 0.7; - calibration_move(); - const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty); - m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2); - m.obj_side[side] = measurement; -} - -/** - * Probe all sides of the calibration calibration object - * - * m in/out - Measurement record: center, backlash and error values be updated. - * uncertainty in - How far away from the calibration object to begin probing - */ -inline void probe_sides(measurements_t &m, const float uncertainty) { - #ifdef CALIBRATION_MEASURE_AT_TOP_EDGES - constexpr bool probe_top_at_edge = true; - #else - // Probing at the exact center only works if the center is flat. Probing on a washer - // or bolt will require probing the top near the side edges, away from the center. - constexpr bool probe_top_at_edge = false; - probe_side(m, uncertainty, TOP); - #endif - - #ifdef CALIBRATION_MEASURE_RIGHT - probe_side(m, uncertainty, RIGHT, probe_top_at_edge); - #endif - - #ifdef CALIBRATION_MEASURE_FRONT - probe_side(m, uncertainty, FRONT, probe_top_at_edge); - #endif - - #ifdef CALIBRATION_MEASURE_LEFT - probe_side(m, uncertainty, LEFT, probe_top_at_edge); - #endif - #ifdef CALIBRATION_MEASURE_BACK - probe_side(m, uncertainty, BACK, probe_top_at_edge); - #endif - - // Compute the measured center of the calibration object. - #if HAS_X_CENTER - m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2; - #endif - #if HAS_Y_CENTER - m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2; - #endif - - // Compute the outside diameter of the nozzle at the height - // at which it makes contact with the calibration object - #if HAS_X_CENTER - m.nozzle_outer_dimension.x = m.obj_side[RIGHT] - m.obj_side[LEFT] - dimensions.x; - #endif - #if HAS_Y_CENTER - m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y; - #endif - - park_above_object(m, uncertainty); - - // The difference between the known and the measured location - // of the calibration object is the positional error - m.pos_error.x = (0 - #if HAS_X_CENTER - + true_center.x - m.obj_center.x - #endif - ); - m.pos_error.y = (0 - #if HAS_Y_CENTER - + true_center.y - m.obj_center.y - #endif - ); - m.pos_error.z = true_center.z - m.obj_center.z; -} - -#if ENABLED(CALIBRATION_REPORTING) - inline void report_measured_faces(const measurements_t &m) { - SERIAL_ECHOLNPGM("Sides:"); - SERIAL_ECHOLNPAIR(" Top: ", m.obj_side[TOP]); - #if ENABLED(CALIBRATION_MEASURE_LEFT) - SERIAL_ECHOLNPAIR(" Left: ", m.obj_side[LEFT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_RIGHT) - SERIAL_ECHOLNPAIR(" Right: ", m.obj_side[RIGHT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_FRONT) - SERIAL_ECHOLNPAIR(" Front: ", m.obj_side[FRONT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_BACK) - SERIAL_ECHOLNPAIR(" Back: ", m.obj_side[BACK]); - #endif - SERIAL_EOL(); - } - - inline void report_measured_center(const measurements_t &m) { - SERIAL_ECHOLNPGM("Center:"); - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR_P(SP_X_STR, m.obj_center.x); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.obj_center.y); - #endif - SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.obj_center.z); - SERIAL_EOL(); - } - - inline void report_measured_backlash(const measurements_t &m) { - SERIAL_ECHOLNPGM("Backlash:"); - #if ENABLED(CALIBRATION_MEASURE_LEFT) - SERIAL_ECHOLNPAIR(" Left: ", m.backlash[LEFT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_RIGHT) - SERIAL_ECHOLNPAIR(" Right: ", m.backlash[RIGHT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_FRONT) - SERIAL_ECHOLNPAIR(" Front: ", m.backlash[FRONT]); - #endif - #if ENABLED(CALIBRATION_MEASURE_BACK) - SERIAL_ECHOLNPAIR(" Back: ", m.backlash[BACK]); - #endif - SERIAL_ECHOLNPAIR(" Top: ", m.backlash[TOP]); - SERIAL_EOL(); - } - - inline void report_measured_positional_error(const measurements_t &m) { - SERIAL_CHAR('T'); - SERIAL_ECHO(int(active_extruder)); - SERIAL_ECHOLNPGM(" Positional Error:"); - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR_P(SP_X_STR, m.pos_error.x); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y); - #endif - SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z); - SERIAL_EOL(); - } - - inline void report_measured_nozzle_dimensions(const measurements_t &m) { - SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:"); - #if HAS_X_CENTER || HAS_Y_CENTER - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR_P(SP_X_STR, m.nozzle_outer_dimension.x); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.nozzle_outer_dimension.y); - #endif - #else - UNUSED(m); - #endif - SERIAL_EOL(); - } - - #if HAS_HOTEND_OFFSET - // - // This function requires normalize_hotend_offsets() to be called - // - inline void report_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) - SERIAL_ECHOLNPAIR_P(PSTR("T"), int(e), PSTR(" Hotend Offset X"), hotend_offset[e].x, SP_Y_STR, hotend_offset[e].y, SP_Z_STR, hotend_offset[e].z); - } - #endif - -#endif // CALIBRATION_REPORTING - -/** - * Probe around the calibration object to measure backlash - * - * m in/out - Measurement record, updated with new readings - * uncertainty in - How far away from the object to begin probing - */ -inline void calibrate_backlash(measurements_t &m, const float uncertainty) { - // Backlash compensation should be off while measuring backlash - - { - // New scope for TEMPORARY_BACKLASH_CORRECTION - TEMPORARY_BACKLASH_CORRECTION(all_off); - TEMPORARY_BACKLASH_SMOOTHING(0.0f); - - probe_sides(m, uncertainty); - - #if ENABLED(BACKLASH_GCODE) - #if HAS_X_CENTER - backlash.distance_mm.x = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2; - #elif ENABLED(CALIBRATION_MEASURE_LEFT) - backlash.distance_mm.x = m.backlash[LEFT]; - #elif ENABLED(CALIBRATION_MEASURE_RIGHT) - backlash.distance_mm.x = m.backlash[RIGHT]; - #endif - - #if HAS_Y_CENTER - backlash.distance_mm.y = (m.backlash[FRONT] + m.backlash[BACK]) / 2; - #elif ENABLED(CALIBRATION_MEASURE_FRONT) - backlash.distance_mm.y = m.backlash[FRONT]; - #elif ENABLED(CALIBRATION_MEASURE_BACK) - backlash.distance_mm.y = m.backlash[BACK]; - #endif - - backlash.distance_mm.z = m.backlash[TOP]; - #endif - } - - #if ENABLED(BACKLASH_GCODE) - // Turn on backlash compensation and move in all - // directions to take up any backlash - { - // New scope for TEMPORARY_BACKLASH_CORRECTION - TEMPORARY_BACKLASH_CORRECTION(all_on); - TEMPORARY_BACKLASH_SMOOTHING(0.0f); - const xyz_float_t move = { 3, 3, 3 }; - current_position += move; calibration_move(); - current_position -= move; calibration_move(); - } - #endif -} - -inline void update_measurements(measurements_t &m, const AxisEnum axis) { - current_position[axis] += m.pos_error[axis]; - m.obj_center[axis] = true_center[axis]; - m.pos_error[axis] = 0; -} - -/** - * Probe around the calibration object. Adjust the position and toolhead offset - * using the deviation from the known position of the calibration object. - * - * m in/out - Measurement record, updated with new readings - * uncertainty in - How far away from the object to begin probing - * extruder in - What extruder to probe - * - * Prerequisites: - * - Call calibrate_backlash() beforehand for best accuracy - */ -inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const uint8_t extruder) { - TEMPORARY_BACKLASH_CORRECTION(all_on); - TEMPORARY_BACKLASH_SMOOTHING(0.0f); - - #if HOTENDS > 1 - set_nozzle(m, extruder); - #else - UNUSED(extruder); - #endif - - probe_sides(m, uncertainty); - - // Adjust the hotend offset - #if HAS_HOTEND_OFFSET - #if HAS_X_CENTER - hotend_offset[extruder].x += m.pos_error.x; - #endif - #if HAS_Y_CENTER - hotend_offset[extruder].y += m.pos_error.y; - #endif - hotend_offset[extruder].z += m.pos_error.z; - normalize_hotend_offsets(); - #endif - - // Correct for positional error, so the object - // is at the known actual spot - planner.synchronize(); - #if HAS_X_CENTER - update_measurements(m, X_AXIS); - #endif - #if HAS_Y_CENTER - update_measurements(m, Y_AXIS); - #endif - update_measurements(m, Z_AXIS); - - sync_plan_position(); -} - -/** - * Probe around the calibration object for all toolheads, adjusting the coordinate - * system for the first nozzle and the nozzle offset for subsequent nozzles. - * - * m in/out - Measurement record, updated with new readings - * uncertainty in - How far away from the object to begin probing - */ -inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) { - TEMPORARY_BACKLASH_CORRECTION(all_on); - TEMPORARY_BACKLASH_SMOOTHING(0.0f); - - HOTEND_LOOP() calibrate_toolhead(m, uncertainty, e); - - #if HAS_HOTEND_OFFSET - normalize_hotend_offsets(); - #endif - - #if HOTENDS > 1 - set_nozzle(m, 0); - #endif -} - -/** - * Perform a full auto-calibration routine: - * - * 1) For each nozzle, touch top and sides of object to determine object position and - * nozzle offsets. Do a fast but rough search over a wider area. - * 2) With the first nozzle, touch top and sides of object to determine backlash values - * for all axis (if BACKLASH_GCODE is enabled) - * 3) For each nozzle, touch top and sides of object slowly to determine precise - * position of object. Adjust coordinate system and nozzle offsets so probed object - * location corresponds to known object location with a high degree of precision. - */ -inline void calibrate_all() { - measurements_t m; - - #if HAS_HOTEND_OFFSET - reset_hotend_offsets(); - #endif - - TEMPORARY_BACKLASH_CORRECTION(all_on); - TEMPORARY_BACKLASH_SMOOTHING(0.0f); - - // Do a fast and rough calibration of the toolheads - calibrate_all_toolheads(m, CALIBRATION_MEASUREMENT_UNKNOWN); - - #if ENABLED(BACKLASH_GCODE) - calibrate_backlash(m, CALIBRATION_MEASUREMENT_UNCERTAIN); - #endif - - // Cycle the toolheads so the servos settle into their "natural" positions - #if HOTENDS > 1 - HOTEND_LOOP() set_nozzle(m, e); - #endif - - // Do a slow and precise calibration of the toolheads - calibrate_all_toolheads(m, CALIBRATION_MEASUREMENT_UNCERTAIN); - - current_position.x = X_CENTER; - calibration_move(); // Park nozzle away from calibration object -} - -/** - * G425: Perform calibration with calibration object. - * - * B - Perform calibration of backlash only. - * T - Perform calibration of toolhead only. - * V - Probe object and print position, error, backlash and hotend offset. - * U - Uncertainty, how far to start probe away from the object (mm) - * - * no args - Perform entire calibration sequence (backlash + position on all toolheads) - */ -void GcodeSuite::G425() { - TEMPORARY_SOFT_ENDSTOP_STATE(false); - TEMPORARY_BED_LEVELING_STATE(false); - - if (axis_unhomed_error()) return; - - measurements_t m; - - float uncertainty = parser.seenval('U') ? parser.value_float() : CALIBRATION_MEASUREMENT_UNCERTAIN; - - if (parser.seen('B')) - calibrate_backlash(m, uncertainty); - else if (parser.seen('T')) - calibrate_toolhead(m, uncertainty, parser.has_value() ? parser.value_int() : active_extruder); - #if ENABLED(CALIBRATION_REPORTING) - else if (parser.seen('V')) { - probe_sides(m, uncertainty); - SERIAL_EOL(); - report_measured_faces(m); - report_measured_center(m); - report_measured_backlash(m); - report_measured_nozzle_dimensions(m); - report_measured_positional_error(m); - #if HAS_HOTEND_OFFSET - normalize_hotend_offsets(); - report_hotend_offsets(); - #endif - } - #endif - else - calibrate_all(); -} - -#endif // CALIBRATION_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M100.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M100.cpp deleted file mode 100644 index a6f4f8f5d2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M100.cpp +++ /dev/null @@ -1,373 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(M100_FREE_MEMORY_WATCHER) - -#include "../gcode.h" -#include "../queue.h" -#include "../../libs/hex_print_routines.h" - -#include "../../Marlin.h" // for idle() - -/** - * M100 Free Memory Watcher - * - * This code watches the free memory block between the bottom of the heap and the top of the stack. - * This memory block is initialized and watched via the M100 command. - * - * M100 I Initializes the free memory block and prints vitals statistics about the area - * - * M100 F Identifies how much of the free memory block remains free and unused. It also - * detects and reports any corruption within the free memory block that may have - * happened due to errant firmware. - * - * M100 D Does a hex display of the free memory block along with a flag for any errant - * data that does not match the expected value. - * - * M100 C x Corrupts x locations within the free memory block. This is useful to check the - * correctness of the M100 F and M100 D commands. - * - * Also, there are two support functions that can be called from a developer's C code. - * - * uint16_t check_for_free_memory_corruption(PGM_P const free_memory_start); - * void M100_dump_routine(PGM_P const title, char *start, char *end); - * - * Initial version by Roxy-3D - */ -#define M100_FREE_MEMORY_DUMPER // Enable for the `M100 D` Dump sub-command -#define M100_FREE_MEMORY_CORRUPTOR // Enable for the `M100 C` Corrupt sub-command - -#define TEST_BYTE ((char) 0xE5) - -#if defined(__AVR__) || IS_32BIT_TEENSY - - extern char __bss_end; - char *end_bss = &__bss_end, - *free_memory_start = end_bss, *free_memory_end = 0, - *stacklimit = 0, *heaplimit = 0; - - #define MEMORY_END_CORRECTION 0 - -#elif defined(TARGET_LPC1768) - - extern char __bss_end__, __StackLimit, __HeapLimit; - - char *end_bss = &__bss_end__, - *stacklimit = &__StackLimit, - *heaplimit = &__HeapLimit; - - #define MEMORY_END_CORRECTION 0x200 - - char *free_memory_start = heaplimit, - *free_memory_end = stacklimit - MEMORY_END_CORRECTION; - -#elif defined(__SAM3X8E__) - - extern char _ebss; - - char *end_bss = &_ebss, - *free_memory_start = end_bss, - *free_memory_end = 0, - *stacklimit = 0, - *heaplimit = 0; - - #define MEMORY_END_CORRECTION 0x10000 // need to stay well below 0x20080000 or M100 F crashes - -#elif defined(__SAMD51__) - - extern unsigned int __bss_end__, __StackLimit, __HeapLimit; - extern "C" void * _sbrk(int incr); - - void *end_bss = &__bss_end__, - *stacklimit = &__StackLimit, - *heaplimit = &__HeapLimit; - - #define MEMORY_END_CORRECTION 0x400 - - char *free_memory_start = (char *)_sbrk(0) + 0x200, // Leave some heap space - *free_memory_end = (char *)stacklimit - MEMORY_END_CORRECTION; - -#else - #error "M100 - unsupported CPU" -#endif - -// -// Utility functions -// - -// Location of a variable on its stack frame. Returns a value above -// the stack (once the function returns to the caller). -char* top_of_stack() { - char x; - return &x + 1; // x is pulled on return; -} - -// Count the number of test bytes at the specified location. -inline int32_t count_test_bytes(const char * const start_free_memory) { - for (uint32_t i = 0; i < 32000; i++) - if (char(start_free_memory[i]) != TEST_BYTE) - return i - 1; - - return -1; -} - -// -// M100 sub-commands -// - -#if ENABLED(M100_FREE_MEMORY_DUMPER) - /** - * M100 D - * Dump the free memory block from brkval to the stack pointer. - * malloc() eats memory from the start of the block and the stack grows - * up from the bottom of the block. Solid test bytes indicate nothing has - * used that memory yet. There should not be anything but test bytes within - * the block. If so, it may indicate memory corruption due to a bad pointer. - * Unexpected bytes are flagged in the right column. - */ - inline void dump_free_memory(char *start_free_memory, char *end_free_memory) { - // - // Start and end the dump on a nice 16 byte boundary - // (even though the values are not 16-byte aligned). - // - start_free_memory = (char*)((ptr_int_t)((uint32_t)start_free_memory & 0xFFFFFFF0)); // Align to 16-byte boundary - end_free_memory = (char*)((ptr_int_t)((uint32_t)end_free_memory | 0x0000000F)); // Align end_free_memory to the 15th byte (at or above end_free_memory) - - // Dump command main loop - while (start_free_memory < end_free_memory) { - print_hex_address(start_free_memory); // Print the address - SERIAL_CHAR(':'); - for (uint8_t i = 0; i < 16; i++) { // and 16 data bytes - if (i == 8) SERIAL_CHAR('-'); - print_hex_byte(start_free_memory[i]); - SERIAL_CHAR(' '); - } - serial_delay(25); - SERIAL_CHAR('|'); // Point out non test bytes - for (uint8_t i = 0; i < 16; i++) { - char ccc = (char)start_free_memory[i]; // cast to char before automatically casting to char on assignment, in case the compiler is broken - ccc = (ccc == TEST_BYTE) ? ' ' : '?'; - SERIAL_CHAR(ccc); - } - SERIAL_EOL(); - start_free_memory += 16; - serial_delay(25); - idle(); - } - } - - void M100_dump_routine(PGM_P const title, char *start, char *end) { - serialprintPGM(title); - SERIAL_EOL(); - // - // Round the start and end locations to produce full lines of output - // - start = (char*)((ptr_int_t)((uint32_t)start & 0xFFFFFFF0)); // Align to 16-byte boundary - end = (char*)((ptr_int_t)((uint32_t)end | 0x0000000F)); // Align end_free_memory to the 15th byte (at or above end_free_memory) - dump_free_memory(start, end); - } - -#endif // M100_FREE_MEMORY_DUMPER - -inline int check_for_free_memory_corruption(PGM_P const title) { - serialprintPGM(title); - - char *start_free_memory = free_memory_start, *end_free_memory = free_memory_end; - int n = end_free_memory - start_free_memory; - - SERIAL_ECHOPAIR("\nfmc() n=", n); - SERIAL_ECHOPAIR("\nfree_memory_start=", hex_address(free_memory_start)); - SERIAL_ECHOLNPAIR(" end_free_memory=", hex_address(end_free_memory)); - - if (end_free_memory < start_free_memory) { - SERIAL_ECHOPGM(" end_free_memory < Heap "); - // SET_INPUT_PULLUP(63); // if the developer has a switch wired up to their controller board - // safe_delay(5); // this code can be enabled to pause the display as soon as the - // while ( READ(63)) // malfunction is detected. It is currently defaulting to a switch - // idle(); // being on pin-63 which is unassigend and available on most controller - // safe_delay(20); // boards. - // while ( !READ(63)) - // idle(); - serial_delay(20); - #if ENABLED(M100_FREE_MEMORY_DUMPER) - M100_dump_routine(PSTR(" Memory corruption detected with end_free_memory 8) { - // SERIAL_ECHOPAIR("Found ", j); - // SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(start_free_memory + i)); - i += j; - block_cnt++; - SERIAL_ECHOPAIR(" (", block_cnt); - SERIAL_ECHOPAIR(") found=", j); - SERIAL_ECHOLNPGM(" "); - } - } - } - SERIAL_ECHOPAIR(" block_found=", block_cnt); - - if (block_cnt != 1) - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - - if (block_cnt == 0) // Make sure the special case of no free blocks shows up as an - block_cnt = -1; // error to the calling code! - - SERIAL_ECHOPGM(" return="); - if (block_cnt == 1) { - SERIAL_CHAR('0'); // if the block_cnt is 1, nothing has broken up the free memory - SERIAL_EOL(); // area and it is appropriate to say 'no corruption'. - return 0; - } - SERIAL_ECHOLNPGM("true"); - return block_cnt; -} - -/** - * M100 F - * Return the number of free bytes in the memory pool, - * with other vital statistics defining the pool. - */ -inline void free_memory_pool_report(char * const start_free_memory, const int32_t size) { - int32_t max_cnt = -1, block_cnt = 0; - char *max_addr = nullptr; - // Find the longest block of test bytes in the buffer - for (int32_t i = 0; i < size; i++) { - char *addr = start_free_memory + i; - if (*addr == TEST_BYTE) { - const int32_t j = count_test_bytes(addr); - if (j > 8) { - SERIAL_ECHOPAIR("Found ", j); - SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr)); - if (j > max_cnt) { - max_cnt = j; - max_addr = addr; - } - i += j; - block_cnt++; - } - } - } - if (block_cnt > 1) { - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - SERIAL_ECHOPAIR("\nLargest free block is ", max_cnt); - SERIAL_ECHOLNPAIR(" bytes at ", hex_address(max_addr)); - } - SERIAL_ECHOLNPAIR("check_for_free_memory_corruption() = ", check_for_free_memory_corruption(PSTR("M100 F "))); -} - -#if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - /** - * M100 C - * Corrupt locations in the free memory pool and report the corrupt addresses. - * This is useful to check the correctness of the M100 D and the M100 F commands. - */ - inline void corrupt_free_memory(char *start_free_memory, const uint32_t size) { - start_free_memory += 8; - const uint32_t near_top = top_of_stack() - start_free_memory - 250, // -250 to avoid interrupt activity that's altered the stack. - j = near_top / (size + 1); - - SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); - for (uint32_t i = 1; i <= size; i++) { - char * const addr = start_free_memory + i * j; - *addr = i; - SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr)); - } - SERIAL_EOL(); - } -#endif // M100_FREE_MEMORY_CORRUPTOR - -/** - * M100 I - * Init memory for the M100 tests. (Automatically applied on the first M100.) - */ -inline void init_free_memory(char *start_free_memory, int32_t size) { - SERIAL_ECHOLNPGM("Initializing free memory block.\n\n"); - - size -= 250; // -250 to avoid interrupt activity that's altered the stack. - if (size < 0) { - SERIAL_ECHOLNPGM("Unable to initialize.\n"); - return; - } - - start_free_memory += 8; // move a few bytes away from the heap just because we don't want - // to be altering memory that close to it. - memset(start_free_memory, TEST_BYTE, size); - - SERIAL_ECHO(size); - SERIAL_ECHOLNPGM(" bytes of memory initialized.\n"); - - for (int32_t i = 0; i < size; i++) { - if (start_free_memory[i] != TEST_BYTE) { - SERIAL_ECHOPAIR("? address : ", hex_address(start_free_memory + i)); - SERIAL_ECHOLNPAIR("=", hex_byte(start_free_memory[i])); - SERIAL_EOL(); - } - } -} - -/** - * M100: Free Memory Check - */ -void GcodeSuite::M100() { - - char *sp = top_of_stack(); - if (!free_memory_end) free_memory_end = sp - MEMORY_END_CORRECTION; - SERIAL_ECHOPAIR("\nbss_end : ", hex_address(end_bss)); - if (heaplimit) SERIAL_ECHOPAIR("\n__heaplimit : ", hex_address(heaplimit)); - SERIAL_ECHOPAIR("\nfree_memory_start : ", hex_address(free_memory_start)); - if (stacklimit) SERIAL_ECHOPAIR("\n__stacklimit : ", hex_address(stacklimit)); - SERIAL_ECHOPAIR("\nfree_memory_end : ", hex_address(free_memory_end)); - if (MEMORY_END_CORRECTION) SERIAL_ECHOPAIR("\nMEMORY_END_CORRECTION: ", MEMORY_END_CORRECTION); - SERIAL_ECHOLNPAIR("\nStack Pointer : ", hex_address(sp)); - - // Always init on the first invocation of M100 - static bool m100_not_initialized = true; - if (m100_not_initialized || parser.seen('I')) { - m100_not_initialized = false; - init_free_memory(free_memory_start, free_memory_end - free_memory_start); - } - - #if ENABLED(M100_FREE_MEMORY_DUMPER) - if (parser.seen('D')) - return dump_free_memory(free_memory_start, free_memory_end); - #endif - - if (parser.seen('F')) - return free_memory_pool_report(free_memory_start, free_memory_end - free_memory_start); - - #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - - if (parser.seen('C')) - return corrupt_free_memory(free_memory_start, parser.value_int()); - - #endif -} - -#endif // M100_FREE_MEMORY_WATCHER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M12.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M12.cpp deleted file mode 100644 index 2474c4bc41..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M12.cpp +++ /dev/null @@ -1,36 +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 . - * - */ -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - -#include "../gcode.h" -#include "../../module/planner.h" -#include "../../feature/closedloop.h" - -void GcodeSuite::M12() { - planner.synchronize(); - if (parser.seenval('S')) - set_closedloop(parser.value_int()); // Force a CLC set -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M425.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M425.cpp deleted file mode 100644 index a15287a5e6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M425.cpp +++ /dev/null @@ -1,104 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(BACKLASH_GCODE) - -#include "../../feature/backlash.h" -#include "../../module/planner.h" - -#include "../gcode.h" - -/** - * M425: Enable and tune backlash correction. - * - * F Enable/disable/fade-out backlash correction (0.0 to 1.0) - * S Distance over which backlash correction is spread - * X Set the backlash distance on X (0 to disable) - * Y ... on Y - * Z ... on Z - * X If a backlash measurement was done on X, copy that value - * Y ... on Y - * Z ... on Z - * - * Type M425 without any arguments to show active values. - */ -void GcodeSuite::M425() { - bool noArgs = true; - - LOOP_XYZ(a) { - if (parser.seen(axis_codes[a])) { - planner.synchronize(); - backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); - noArgs = false; - } - } - - if (parser.seen('F')) { - planner.synchronize(); - backlash.set_correction(parser.value_float()); - noArgs = false; - } - - #ifdef BACKLASH_SMOOTHING_MM - if (parser.seen('S')) { - planner.synchronize(); - backlash.smoothing_mm = parser.value_linear_units(); - noArgs = false; - } - #endif - - if (noArgs) { - SERIAL_ECHOPGM("Backlash Correction "); - if (!backlash.correction) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPGM("active:"); - SERIAL_ECHOLNPAIR(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)"); - SERIAL_ECHOPGM(" Backlash Distance (mm): "); - LOOP_XYZ(a) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[a]); - SERIAL_ECHO(backlash.distance_mm[a]); - SERIAL_EOL(); - } - - #ifdef BACKLASH_SMOOTHING_MM - SERIAL_ECHOLNPAIR(" Smoothing (mm): S", backlash.smoothing_mm); - #endif - - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - SERIAL_ECHOPGM(" Average measured backlash (mm):"); - if (backlash.has_any_measurement()) { - LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[a]); - SERIAL_ECHO(backlash.get_measurement(AxisEnum(a))); - } - } - else - SERIAL_ECHOPGM(" (Not yet measured)"); - SERIAL_EOL(); - #endif - } -} - -#endif // BACKLASH_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M48.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M48.cpp deleted file mode 100644 index 86b25d8240..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M48.cpp +++ /dev/null @@ -1,269 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/probe.h" - -#include "../../feature/bedlevel/bedlevel.h" - -#if HAS_SPI_LCD - #include "../../lcd/ultralcd.h" -#endif - -#if HAS_LEVELING - #include "../../module/planner.h" -#endif - -/** - * M48: Z probe repeatability measurement function. - * - * Usage: - * M48 - * P = Number of sampled points (4-50, default 10) - * X = Sample X position - * Y = Sample Y position - * V = Verbose level (0-4, default=1) - * E = Engage Z probe for each reading - * L = Number of legs of movement before probe - * S = Schizoid (Or Star if you prefer) - * - * This function requires the machine to be homed before invocation. - */ -void GcodeSuite::M48() { - - if (axis_unhomed_error()) return; - - const int8_t verbose_level = parser.byteval('V', 1); - if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); - return; - } - - if (verbose_level > 0) - SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test"); - - const int8_t n_samples = parser.byteval('P', 10); - if (!WITHIN(n_samples, 4, 50)) { - SERIAL_ECHOLNPGM("?Sample size not plausible (4-50)."); - return; - } - - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - - xy_float_t next_pos = current_position; - - const xy_pos_t probe_pos = { - parser.linearval('X', next_pos.x + probe_offset.x), - parser.linearval('Y', next_pos.y + probe_offset.y) - }; - - if (!position_is_reachable_by_probe(probe_pos)) { - SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); - return; - } - - bool seen_L = parser.seen('L'); - uint8_t n_legs = seen_L ? parser.value_byte() : 0; - if (n_legs > 15) { - SERIAL_ECHOLNPGM("?Number of legs in movement not plausible (0-15)."); - return; - } - if (n_legs == 1) n_legs = 2; - - const bool schizoid_flag = parser.boolval('S'); - if (schizoid_flag && !seen_L) n_legs = 7; - - /** - * Now get everything to the specified probe point So we can safely do a - * probe to get us close to the bed. If the Z-Axis is far from the bed, - * we don't want to use that as a starting point for each probe. - */ - if (verbose_level > 2) - SERIAL_ECHOLNPGM("Positioning the probe..."); - - // Disable bed level correction in M48 because we want the raw data when we probe - - #if HAS_LEVELING - const bool was_enabled = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - 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_at_point(probe_pos, raise_after, verbose_level); - bool probing_good = !isnan(t); - - if (probing_good) { - randomSeed(millis()); - - for (uint8_t n = 0; n < n_samples; n++) { - #if HAS_SPI_LCD - // Display M48 progress in the status bar - ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples)); - #endif - if (n_legs) { - const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - float angle = random(0, 360); - const float radius = random( - #if ENABLED(DELTA) - int(0.1250000000 * (DELTA_PRINTABLE_RADIUS)), - int(0.3333333333 * (DELTA_PRINTABLE_RADIUS)) - #else - int(5), int(0.125 * _MIN(X_BED_SIZE, Y_BED_SIZE)) - #endif - ); - - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Start radius:", radius, " angle:", angle, " dir:"); - if (dir > 0) SERIAL_CHAR('C'); - SERIAL_ECHOLNPGM("CW"); - } - - for (uint8_t l = 0; l < n_legs - 1; l++) { - float delta_angle; - - if (schizoid_flag) { - // The points of a 5 point star are 72 degrees apart. We need to - // skip a point and go to the next one on the star. - delta_angle = dir * 2.0 * 72.0; - } - else { - // If we do this line, we are just trying to move further - // around the circle. - delta_angle = dir * (float) random(25, 45); - } - - angle += delta_angle; - while (angle > 360.0) angle -= 360.0; // We probably do not need to keep the angle between 0 and 2*PI, but the - // Arduino documentation says the trig functions should not be given values - 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. - - next_pos.set(probe_pos.x - probe_offset.x + cos(RADIANS(angle)) * radius, - probe_pos.y - probe_offset.y + sin(RADIANS(angle)) * radius); - - #if DISABLED(DELTA) - LIMIT(next_pos.x, X_MIN_POS, X_MAX_POS); - LIMIT(next_pos.y, Y_MIN_POS, Y_MAX_POS); - #else - // If we have gone out too far, we can do a simple fix and scale the numbers - // back in closer to the origin. - while (!position_is_reachable_by_probe(next_pos)) { - next_pos *= 0.8f; - if (verbose_level > 3) - SERIAL_ECHOLNPAIR_P(PSTR("Moving inward: X"), next_pos.x, SP_Y_STR, next_pos.y); - } - #endif - - if (verbose_level > 3) - SERIAL_ECHOLNPAIR_P(PSTR("Going to: X"), next_pos.x, SP_Y_STR, next_pos.y); - - do_blocking_move_to_xy(next_pos); - } // n_legs loop - } // n_legs - - // Probe a single point - sample_set[n] = probe_at_point(probe_pos, raise_after, 0); - - // Break the loop if the probe fails - probing_good = !isnan(sample_set[n]); - if (!probing_good) break; - - /** - * Get the current mean for the data points we have so far - */ - float sum = 0.0; - for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; - mean = sum / (n + 1); - - NOMORE(min, sample_set[n]); - NOLESS(max, sample_set[n]); - - /** - * Now, use that mean to calculate the standard deviation for the - * data points we have so far - */ - sum = 0.0; - for (uint8_t j = 0; j <= n; j++) - sum += sq(sample_set[j] - mean); - - sigma = SQRT(sum / (n + 1)); - if (verbose_level > 0) { - if (verbose_level > 1) { - SERIAL_ECHO(n + 1); - SERIAL_ECHOPAIR(" of ", int(n_samples)); - SERIAL_ECHOPAIR_F(": z: ", sample_set[n], 3); - if (verbose_level > 2) { - SERIAL_ECHOPAIR_F(" mean: ", mean, 4); - SERIAL_ECHOPAIR_F(" sigma: ", sigma, 6); - SERIAL_ECHOPAIR_F(" min: ", min, 3); - SERIAL_ECHOPAIR_F(" max: ", max, 3); - SERIAL_ECHOPAIR_F(" range: ", max-min, 3); - } - SERIAL_EOL(); - } - } - - } // n_samples loop - } - - STOW_PROBE(); - - if (probing_good) { - SERIAL_ECHOLNPGM("Finished!"); - - if (verbose_level > 0) { - SERIAL_ECHOPAIR_F("Mean: ", mean, 6); - SERIAL_ECHOPAIR_F(" Min: ", min, 3); - SERIAL_ECHOPAIR_F(" Max: ", max, 3); - SERIAL_ECHOLNPAIR_F(" Range: ", max-min, 3); - } - - SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6); - SERIAL_EOL(); - - #if HAS_SPI_LCD - // Display M48 results in the status bar - char sigma_str[8]; - ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str)); - #endif - } - - restore_feedrate_and_scaling(); - - // Re-enable bed level correction if it had been on - #if HAS_LEVELING - set_bed_leveling_enabled(was_enabled); - #endif - - report_current_position(); -} - -#endif // Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M665.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M665.cpp deleted file mode 100644 index 6234265b3d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M665.cpp +++ /dev/null @@ -1,106 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if IS_KINEMATIC - -#include "../gcode.h" -#include "../../module/motion.h" - -#if ENABLED(DELTA) - - #include "../../module/delta.h" - /** - * M665: Set delta configurations - * - * H = delta height - * L = diagonal rod - * R = delta radius - * S = segments per second - * X = Alpha (Tower 1) angle trim - * Y = Beta (Tower 2) angle trim - * Z = Gamma (Tower 3) angle trim - */ - void GcodeSuite::M665() { - if (parser.seen('H')) delta_height = parser.value_linear_units(); - if (parser.seen('L')) delta_diagonal_rod = parser.value_linear_units(); - if (parser.seen('R')) delta_radius = parser.value_linear_units(); - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - if (parser.seen('X')) delta_tower_angle_trim.a = parser.value_float(); - if (parser.seen('Y')) delta_tower_angle_trim.b = parser.value_float(); - if (parser.seen('Z')) delta_tower_angle_trim.c = parser.value_float(); - recalc_delta_settings(); - } - -#elif IS_SCARA - - #include "../../module/scara.h" - - /** - * M665: Set SCARA settings - * - * Parameters: - * - * S[segments-per-second] - Segments-per-second - * P[theta-psi-offset] - Theta-Psi offset, added to the shoulder (A/X) angle - * T[theta-offset] - Theta offset, added to the elbow (B/Y) angle - * Z[z-offset] - Z offset, added to Z - * - * A, P, and X are all aliases for the shoulder angle - * B, T, and Y are all aliases for the elbow angle - */ - void GcodeSuite::M665() { - if (parser.seenval('S')) delta_segments_per_second = parser.value_float(); - - #if HAS_SCARA_OFFSET - - if (parser.seenval('Z')) scara_home_offset.z = parser.value_linear_units(); - - const bool hasA = parser.seenval('A'), hasP = parser.seenval('P'), hasX = parser.seenval('X'); - const uint8_t sumAPX = hasA + hasP + hasX; - if (sumAPX) { - if (sumAPX == 1) - scara_home_offset.a = parser.value_float(); - else { - SERIAL_ERROR_MSG("Only one of A, P, or X is allowed."); - return; - } - } - - const bool hasB = parser.seenval('B'), hasT = parser.seenval('T'), hasY = parser.seenval('Y'); - const uint8_t sumBTY = hasB + hasT + hasY; - if (sumBTY) { - if (sumBTY == 1) - scara_home_offset.b = parser.value_float(); - else { - SERIAL_ERROR_MSG("Only one of B, T, or Y is allowed."); - return; - } - } - - #endif // HAS_SCARA_OFFSET - } - -#endif - -#endif // IS_KINEMATIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M666.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M666.cpp deleted file mode 100644 index 3b55fb770d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M666.cpp +++ /dev/null @@ -1,102 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS - -#include "../gcode.h" - -#if ENABLED(DELTA) - - #include "../../module/delta.h" - #include "../../module/motion.h" - - #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) - #include "../../core/debug_out.h" - - /** - * M666: Set delta endstop adjustment - */ - void GcodeSuite::M666() { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> M666"); - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { - const float v = parser.value_linear_units(); - if (v * Z_HOME_DIR <= 0) delta_endstop_adj[i] = v; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("delta_endstop_adj[", axis_codes[i], "] = ", delta_endstop_adj[i]); - } - } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< M666"); - } - -#elif HAS_EXTRA_ENDSTOPS - - #include "../../module/endstops.h" - - /** - * M666: Set Dual Endstops offsets for X, Y, and/or Z. - * With no parameters report current offsets. - * - * For Triple Z Endstops: - * Set Z2 Only: M666 S2 Z - * Set Z3 Only: M666 S3 Z - * Set Both: M666 Z - */ - void GcodeSuite::M666() { - #if ENABLED(X_DUAL_ENDSTOPS) - if (parser.seenval('X')) endstops.x2_endstop_adj = parser.value_linear_units(); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (parser.seenval('Y')) endstops.y2_endstop_adj = parser.value_linear_units(); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - if (parser.seenval('Z')) { - const float z_adj = parser.value_linear_units(); - const int ind = parser.intval('S'); - if (!ind || ind == 2) endstops.z2_endstop_adj = z_adj; - if (!ind || ind == 3) endstops.z3_endstop_adj = z_adj; - } - #elif Z_MULTI_ENDSTOPS - if (parser.seen('Z')) endstops.z2_endstop_adj = parser.value_linear_units(); - #endif - if (!parser.seen("XYZ")) { - SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X2:", endstops.x2_endstop_adj); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y2:", endstops.y2_endstop_adj); - #endif - #if Z_MULTI_ENDSTOPS - SERIAL_ECHOPAIR(" Z2:", endstops.z2_endstop_adj); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - SERIAL_ECHOPAIR(" Z3:", endstops.z3_endstop_adj); - #endif - SERIAL_EOL(); - } - } - -#endif // HAS_EXTRA_ENDSTOPS - -#endif // DELTA || HAS_EXTRA_ENDSTOPS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M852.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M852.cpp deleted file mode 100644 index 4bb068e5b2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/calibrate/M852.cpp +++ /dev/null @@ -1,106 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SKEW_CORRECTION_GCODE) - -#include "../gcode.h" -#include "../../module/planner.h" - -/** - * M852: Get or set the machine skew factors. Reports current values with no arguments. - * - * S[xy_factor] - Alias for 'I' - * I[xy_factor] - New XY skew factor - * J[xz_factor] - New XZ skew factor - * K[yz_factor] - New YZ skew factor - */ -void GcodeSuite::M852() { - uint8_t ijk = 0, badval = 0, setval = 0; - - if (parser.seen('I') || parser.seen('S')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.skew_factor.xy != value) { - planner.skew_factor.xy = value; - ++setval; - } - } - else - ++badval; - } - - #if ENABLED(SKEW_CORRECTION_FOR_Z) - - if (parser.seen('J')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.skew_factor.xz != value) { - planner.skew_factor.xz = value; - ++setval; - } - } - else - ++badval; - } - - if (parser.seen('K')) { - ++ijk; - const float value = parser.value_linear_units(); - if (WITHIN(value, SKEW_FACTOR_MIN, SKEW_FACTOR_MAX)) { - if (planner.skew_factor.yz != value) { - planner.skew_factor.yz = value; - ++setval; - } - } - else - ++badval; - } - - #endif - - if (badval) - SERIAL_ECHOLNPGM(MSG_SKEW_MIN " " STRINGIFY(SKEW_FACTOR_MIN) " " MSG_SKEW_MAX " " STRINGIFY(SKEW_FACTOR_MAX)); - - // When skew is changed the current position changes - if (setval) { - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); - report_current_position(); - } - - if (!ijk) { - SERIAL_ECHO_START(); - serialprintPGM(GET_TEXT(MSG_SKEW_FACTOR)); - SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6); - SERIAL_ECHOPAIR_F(" YZ: ", planner.skew_factor.yz, 6); - #endif - SERIAL_EOL(); - } -} - -#endif // SKEW_CORRECTION_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M200-M205.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M200-M205.cpp deleted file mode 100644 index aeeb38c913..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M200-M205.cpp +++ /dev/null @@ -1,166 +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 . - * - */ - -#include "../gcode.h" -#include "../../Marlin.h" -#include "../../module/planner.h" - -#if DISABLED(NO_VOLUMETRICS) - - /** - * M200: Set filament diameter and set E axis units to cubic units - * - * T - Optional extruder number. Current extruder if omitted. - * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. - */ - void GcodeSuite::M200() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - if (parser.seen('D')) { - // setting any extruder filament size disables volumetric on the assumption that - // slicers either generate in extruder values as cubic mm or as as filament feeds - // for all extruders - if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0)) ) - planner.set_filament_size(target_extruder, parser.value_linear_units()); - } - planner.calculate_volumetric_multipliers(); - } - -#endif // !NO_VOLUMETRICS - -/** - * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) - * - * With multiple extruders use T to specify which one. - */ -void GcodeSuite::M201() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - LOOP_XYZE(i) { - if (parser.seen(axis_codes[i])) { - const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i); - planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a)); - } - } -} - -/** - * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec - * - * With multiple extruders use T to specify which one. - */ -void GcodeSuite::M203() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - LOOP_XYZE(i) - if (parser.seen(axis_codes[i])) { - const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i); - planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a)); - } -} - -/** - * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) - * - * P = Printing moves - * R = Retract only (no X, Y, Z) moves - * T = Travel (non printing) moves - */ -void GcodeSuite::M204() { - if (!parser.seen("PRST")) { - SERIAL_ECHOPAIR("Acceleration: P", planner.settings.acceleration); - SERIAL_ECHOPAIR(" R", planner.settings.retract_acceleration); - SERIAL_ECHOLNPAIR(" T", planner.settings.travel_acceleration); - } - else { - //planner.synchronize(); - // 'S' for legacy compatibility. Should NOT BE USED for new development - if (parser.seenval('S')) planner.settings.travel_acceleration = planner.settings.acceleration = parser.value_linear_units(); - if (parser.seenval('P')) planner.settings.acceleration = parser.value_linear_units(); - if (parser.seenval('R')) planner.settings.retract_acceleration = parser.value_linear_units(); - if (parser.seenval('T')) planner.settings.travel_acceleration = parser.value_linear_units(); - } -} - -/** - * M205: Set Advanced Settings - * - * B = Min Segment Time (µs) - * S = Min Feed Rate (units/s) - * T = Min Travel Feed Rate (units/s) - * X = Max X Jerk (units/sec^2) - * Y = Max Y Jerk (units/sec^2) - * Z = Max Z Jerk (units/sec^2) - * E = Max E Jerk (units/sec^2) - * J = Junction Deviation (mm) (If not using CLASSIC_JERK) - */ -void GcodeSuite::M205() { - #if DISABLED(CLASSIC_JERK) - #define J_PARAM "J" - #else - #define J_PARAM - #endif - #if HAS_CLASSIC_JERK - #define XYZE_PARAM "XYZE" - #else - #define XYZE_PARAM - #endif - if (!parser.seen("BST" J_PARAM XYZE_PARAM)) return; - - //planner.synchronize(); - if (parser.seen('B')) planner.settings.min_segment_time_us = parser.value_ulong(); - if (parser.seen('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units(); - if (parser.seen('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units(); - #if DISABLED(CLASSIC_JERK) - if (parser.seen('J')) { - const float junc_dev = parser.value_linear_units(); - if (WITHIN(junc_dev, 0.01f, 0.3f)) { - planner.junction_deviation_mm = junc_dev; - #if ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif - } - else - SERIAL_ERROR_MSG("?J out of range (0.01 to 0.3)"); - } - #endif - #if HAS_CLASSIC_JERK - if (parser.seen('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units()); - if (parser.seen('Y')) planner.set_max_jerk(Y_AXIS, parser.value_linear_units()); - if (parser.seen('Z')) { - planner.set_max_jerk(Z_AXIS, parser.value_linear_units()); - #if HAS_MESH && DISABLED(LIMITED_JERK_EDITING) - if (planner.max_jerk.z <= 0.1f) - SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); - #endif - } - #if HAS_CLASSIC_E_JERK - if (parser.seen('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units()); - #endif - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M217.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M217.cpp deleted file mode 100644 index 3fe3feb0de..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M217.cpp +++ /dev/null @@ -1,105 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if EXTRUDERS > 1 - -#include "../gcode.h" -#include "../../module/tool_change.h" - -#include "../../Marlin.h" // for SP_X_STR, etc. - -extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; - -void M217_report(const bool eeprom=false) { - - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:")); - SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length)); - SERIAL_ECHOPAIR_P(SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime)); - SERIAL_ECHOPAIR(" P", LINEAR_UNIT(toolchange_settings.prime_speed)); - SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed)); - - #if ENABLED(TOOLCHANGE_PARK) - SERIAL_ECHOPAIR_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)); - SERIAL_ECHOPAIR_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)); - #endif - - #else - - UNUSED(eeprom); - - #endif - - SERIAL_ECHOPAIR_P(SP_Z_STR, LINEAR_UNIT(toolchange_settings.z_raise)); - SERIAL_EOL(); -} - -/** - * M217 - Set SINGLENOZZLE toolchange parameters - * - * S[linear] Swap length - * E[linear] Purge length - * P[linear/m] Prime speed - * R[linear/m] Retract speed - * X[linear] Park X (Requires TOOLCHANGE_PARK) - * Y[linear] Park Y (Requires TOOLCHANGE_PARK) - * Z[linear] Z Raise - */ -void GcodeSuite::M217() { - - #define SPR_PARAM - #define XY_PARAM - - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - - #undef SPR_PARAM - #define SPR_PARAM "SPRE" - - static constexpr float max_extrude = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 500 - #endif - ; - - if (parser.seenval('S')) { const float v = parser.value_linear_units(); toolchange_settings.swap_length = constrain(v, 0, max_extrude); } - if (parser.seenval('E')) { const float v = parser.value_linear_units(); toolchange_settings.extra_prime = constrain(v, 0, max_extrude); } - if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); } - if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); } - #endif - - #if ENABLED(TOOLCHANGE_PARK) - #undef XY_PARAM - #define XY_PARAM "XY" - if (parser.seenval('X')) { toolchange_settings.change_point.x = parser.value_linear_units(); } - if (parser.seenval('Y')) { toolchange_settings.change_point.y = parser.value_linear_units(); } - #endif - - if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } - - if (!parser.seen(SPR_PARAM XY_PARAM "Z")) M217_report(); -} - -#endif // EXTRUDERS > 1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M218.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M218.cpp deleted file mode 100644 index 790d7714a3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M218.cpp +++ /dev/null @@ -1,71 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_HOTEND_OFFSET - -#include "../gcode.h" -#include "../../module/motion.h" - -#if ENABLED(DELTA) - #include "../../module/planner.h" -#endif - -/** - * M218 - set hotend offset (in linear units) - * - * T - * X - * Y - * Z - */ -void GcodeSuite::M218() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - if (parser.seenval('X')) hotend_offset[target_extruder].x = parser.value_linear_units(); - if (parser.seenval('Y')) hotend_offset[target_extruder].y = parser.value_linear_units(); - if (parser.seenval('Z')) hotend_offset[target_extruder].z = parser.value_linear_units(); - - if (!parser.seen("XYZ")) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - HOTEND_LOOP() { - SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[e].x); - SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[e].y); - SERIAL_CHAR(','); - SERIAL_ECHO_F(hotend_offset[e].z, 3); - } - SERIAL_EOL(); - } - - #if ENABLED(DELTA) - if (target_extruder == active_extruder) - do_blocking_move_to_xy(current_position, planner.settings.max_feedrate_mm_s[X_AXIS]); - #endif -} - -#endif // HAS_HOTEND_OFFSET diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M220.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M220.cpp deleted file mode 100644 index 3710a30ab9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M220.cpp +++ /dev/null @@ -1,46 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/motion.h" - -/** - * M220: Set speed percentage factor, aka "Feed Rate" - * - * Parameters - * S : Set the feed rate percentage factor - * - * With PRUSA_MMU2... - * B : Flag to back up the current factor - * R : Flag to restore the last-saved factor - */ -void GcodeSuite::M220() { - - #if ENABLED(PRUSA_MMU2) - static int16_t backup_feedrate_percentage = 100; - if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; - if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; - #endif - - if (parser.seenval('S')) feedrate_percentage = parser.value_int(); - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M221.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M221.cpp deleted file mode 100644 index 116ce776b2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M221.cpp +++ /dev/null @@ -1,50 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/planner.h" - -#if EXTRUDERS - -/** - * M221: Set extrusion percentage (M221 T0 S95) - */ -void GcodeSuite::M221() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - if (parser.seenval('S')) { - planner.flow_percentage[target_extruder] = parser.value_int(); - planner.refresh_e_factor(target_extruder); - } - else { - SERIAL_ECHO_START(); - SERIAL_CHAR('E'); - SERIAL_CHAR('0' + target_extruder); - SERIAL_ECHOPAIR(" Flow: ", planner.flow_percentage[target_extruder]); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } -} - -#endif // EXTRUDERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M281.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M281.cpp deleted file mode 100644 index a694cb2df4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M281.cpp +++ /dev/null @@ -1,55 +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 . - * - */ -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EDITABLE_SERVO_ANGLES) - -#include "../gcode.h" -#include "../../module/servo.h" - -void GcodeSuite::M281() { - if (!parser.seenval('P')) return; - const int servo_index = parser.value_int(); - if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) { - bool angle_change = false; - if (parser.seen('L')) { - servo_angles[servo_index][0] = parser.value_int(); - angle_change = true; - } - if (parser.seen('U')) { - servo_angles[servo_index][1] = parser.value_int(); - angle_change = true; - } - if (!angle_change) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(" Servo ", servo_index, - " L", servo_angles[servo_index][0], - " U", servo_angles[servo_index][1]); - } - } - else { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); - } -} - -#endif // EDITABLE_SERVO_ANGLES diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M301.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M301.cpp deleted file mode 100644 index 0449293bf5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M301.cpp +++ /dev/null @@ -1,88 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PIDTEMP) - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M301: Set PID parameters P I D (and optionally C, L) - * - * P[float] Kp term - * I[float] Ki term (unscaled) - * D[float] Kd term (unscaled) - * - * With PID_EXTRUSION_SCALING: - * - * C[float] Kc term - * L[int] LPQ length - * - * With PID_FAN_SCALING: - * - * F[float] Kf term - */ -void GcodeSuite::M301() { - - // multi-extruder PID patch: M301 updates or prints a single extruder's PID values - // default behavior (omitting E parameter) is to update for extruder 0 only - const uint8_t e = parser.byteval('E'); // extruder being updated - - if (e < HOTENDS) { // catch bad input value - if (parser.seen('P')) PID_PARAM(Kp, e) = parser.value_float(); - if (parser.seen('I')) PID_PARAM(Ki, e) = scalePID_i(parser.value_float()); - if (parser.seen('D')) PID_PARAM(Kd, e) = scalePID_d(parser.value_float()); - #if ENABLED(PID_EXTRUSION_SCALING) - if (parser.seen('C')) PID_PARAM(Kc, e) = parser.value_float(); - if (parser.seenval('L')) thermalManager.lpq_len = parser.value_int(); - NOMORE(thermalManager.lpq_len, LPQ_MAX_LEN); - NOLESS(thermalManager.lpq_len, 0); - #endif - - #if ENABLED(PID_FAN_SCALING) - if (parser.seen('F')) PID_PARAM(Kf, e) = parser.value_float(); - #endif - - thermalManager.updatePID(); - SERIAL_ECHO_START(); - #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), - " i:", unscalePID_i(PID_PARAM(Ki, e)), - " d:", unscalePID_d(PID_PARAM(Kd, e))); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); - #endif - #if ENABLED(PID_FAN_SCALING) - SERIAL_ECHOPAIR(" f:", PID_PARAM(Kf, e)); - #endif - - SERIAL_EOL(); - } - else - SERIAL_ERROR_MSG(MSG_INVALID_EXTRUDER); -} - -#endif // PIDTEMP diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M302.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M302.cpp deleted file mode 100644 index 891f3c8258..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M302.cpp +++ /dev/null @@ -1,63 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PREVENT_COLD_EXTRUSION) - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M302: Allow cold extrudes, or set the minimum extrude temperature - * - * S sets the minimum extrude temperature - * P enables (1) or disables (0) cold extrusion - * - * Examples: - * - * M302 ; report current cold extrusion state - * M302 P0 ; enable cold extrusion checking - * M302 P1 ; disables cold extrusion checking - * M302 S0 ; always allow extrusion (disables checking) - * M302 S170 ; only allow extrusion above 170 - * M302 S170 P1 ; set min extrude temp to 170 but leave disabled - */ -void GcodeSuite::M302() { - const bool seen_S = parser.seen('S'); - if (seen_S) { - thermalManager.extrude_min_temp = parser.value_celsius(); - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); - } - - if (parser.seen('P')) - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); - else if (!seen_S) { - // Report current state - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Cold extrudes are "); - serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)"); - } -} - -#endif // PREVENT_COLD_EXTRUSION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M304.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M304.cpp deleted file mode 100644 index 3048c228d5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M304.cpp +++ /dev/null @@ -1,41 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PIDTEMPBED) - -#include "../gcode.h" -#include "../../module/temperature.h" - -void GcodeSuite::M304() { - if (parser.seen('P')) thermalManager.temp_bed.pid.Kp = parser.value_float(); - if (parser.seen('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float()); - if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); - - SERIAL_ECHO_START(); - 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_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M305.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M305.cpp deleted file mode 100644 index b697540986..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M305.cpp +++ /dev/null @@ -1,81 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_USER_THERMISTORS - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M305: Set (or report) custom thermistor parameters - * - * P[index] Thermistor table index - * R[ohms] Pullup resistor value - * T[ohms] Resistance at 25C - * B[beta] Thermistor "beta" value - * C[coeff] Steinhart-Hart Coefficient 'C' - * - * Format: M305 P[tbl_index] R[pullup_resistor_val] T[therm_25C_resistance] B[therm_beta] C[Steinhart_Hart_C_coeff] - * - * Examples: M305 P0 R4700 T100000 B3950 C0.0 - * M305 P0 R4700 - * M305 P0 T100000 - * M305 P0 B3950 - * M305 P0 C0.0 - */ -void GcodeSuite::M305() { - const int8_t t_index = parser.intval('P', -1); - const bool do_set = parser.seen("BCRT"); - - // A valid P index is required - if (t_index >= (USER_THERMISTORS) || (do_set && t_index < 0)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("!Invalid index. (0 <= P <= ", int(USER_THERMISTORS - 1), ")"); - } - else if (do_set) { - if (parser.seen('R')) // Pullup resistor value - if (!thermalManager.set_pull_up_res(t_index, parser.value_float())) - SERIAL_ECHO_MSG("!Invalid series resistance. (0 < R < 1000000)"); - - if (parser.seen('T')) // Resistance at 25C - if (!thermalManager.set_res25(t_index, parser.value_float())) - SERIAL_ECHO_MSG("!Invalid 25C resistance. (0 < T < 10000000)"); - - if (parser.seen('B')) // Beta value - if (!thermalManager.set_beta(t_index, parser.value_float())) - SERIAL_ECHO_MSG("!Invalid beta. (0 < B < 1000000)"); - - if (parser.seen('C')) // Steinhart-Hart C coefficient - if (!thermalManager.set_sh_coeff(t_index, parser.value_float())) - SERIAL_ECHO_MSG("!Invalid Steinhart-Hart C coeff. (-0.01 < C < +0.01)"); - } // If not setting then report parameters - else if (t_index < 0) { // ...all user thermistors - for (uint8_t i = 0; i < USER_THERMISTORS; i++) - thermalManager.log_user_thermistor(i); - } - else // ...one user thermistor - thermalManager.log_user_thermistor(t_index); -} - -#endif // HAS_USER_THERMISTORS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M43.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M43.cpp deleted file mode 100644 index 29fc0bdff1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M43.cpp +++ /dev/null @@ -1,375 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(PINS_DEBUGGING) - -#include "../gcode.h" -#include "../../Marlin.h" // for pin_is_protected -#include "../../pins/pinsDebug.h" -#include "../../module/endstops.h" - -#if HAS_Z_SERVO_PROBE - #include "../../module/probe.h" - #include "../../module/servo.h" -#endif - -#if ENABLED(BLTOUCH) - #include "../../feature/bltouch.h" -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../../feature/host_actions.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -#ifndef GET_PIN_MAP_PIN_M43 - #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q) -#endif - -inline void toggle_pins() { - const bool ignore_protection = parser.boolval('I'); - const int repeat = parser.intval('R', 1), - start = PARSED_PIN_INDEX('S', 0), - end = PARSED_PIN_INDEX('L', NUM_DIGITAL_PINS - 1), - wait = parser.intval('W', 500); - - for (uint8_t i = start; i <= end; i++) { - pin_t pin = GET_PIN_MAP_PIN_M43(i); - if (!VALID_PIN(pin)) continue; - if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) { - report_pin_state_extended(pin, ignore_protection, true, "Untouched "); - SERIAL_EOL(); - } - else { - watchdog_refresh(); - 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) { - SET_OUTPUT(TEENSY_E2); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E2, LOW); safe_delay(wait); - WRITE(TEENSY_E2, HIGH); safe_delay(wait); - WRITE(TEENSY_E2, LOW); safe_delay(wait); - } - } - else if (pin == TEENSY_E3) { - SET_OUTPUT(TEENSY_E3); - for (int16_t j = 0; j < repeat; j++) { - WRITE(TEENSY_E3, LOW); safe_delay(wait); - WRITE(TEENSY_E3, HIGH); safe_delay(wait); - WRITE(TEENSY_E3, LOW); safe_delay(wait); - } - } - else - #endif - { - pinMode(pin, OUTPUT); - for (int16_t j = 0; j < repeat; j++) { - watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_refresh(); extDigitalWrite(pin, 1); safe_delay(wait); - watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_refresh(); - } - } - } - SERIAL_EOL(); - } - SERIAL_ECHOLNPGM("Done."); - -} // toggle_pins - -inline void servo_probe_test() { - - #if !(NUM_SERVOS > 0 && HAS_SERVO_0) - - SERIAL_ERROR_MSG("SERVO not set up."); - - #elif !HAS_Z_SERVO_PROBE - - SERIAL_ERROR_MSG("Z_PROBE_SERVO_NR not set up."); - - #else // HAS_Z_SERVO_PROBE - - const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR); - - SERIAL_ECHOLNPAIR("Servo probe test\n" - ". using index: ", int(probe_index), - ", deploy angle: ", servo_angles[probe_index][0], - ", stow angle: ", servo_angles[probe_index][1] - ); - - bool deploy_state = false, stow_state; - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - - #define PROBE_TEST_PIN Z_MIN_PIN - constexpr bool probe_inverting = Z_MIN_ENDSTOP_INVERTING; - - SERIAL_ECHOLNPAIR(". Probe Z_MIN_PIN: ", int(PROBE_TEST_PIN)); - SERIAL_ECHOPGM(". Z_MIN_ENDSTOP_INVERTING: "); - - #else - - #define PROBE_TEST_PIN Z_MIN_PROBE_PIN - constexpr bool probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING; - - SERIAL_ECHOLNPAIR(". Probe Z_MIN_PROBE_PIN: ", int(PROBE_TEST_PIN)); - SERIAL_ECHOPGM( ". Z_MIN_PROBE_ENDSTOP_INVERTING: "); - - #endif - - serialprint_truefalse(probe_inverting); - SERIAL_EOL(); - - SET_INPUT_PULLUP(PROBE_TEST_PIN); - - // First, check for a probe that recognizes an advanced BLTouch sequence. - // In addition to STOW and DEPLOY, it uses SW MODE (and RESET in the beginning) - // to see if this is one of the following: BLTOUCH Classic 1.2, 1.3, or - // BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1. But only if the user has actually - // configured a BLTouch as being present. If the user has not configured this, - // the BLTouch will be detected in the last phase of these tests (see further on). - bool blt = false; - // This code will try to detect a BLTouch probe or clone - #if ENABLED(BLTOUCH) - SERIAL_ECHOLNPGM(". Check for BLTOUCH"); - bltouch._reset(); - bltouch._stow(); - if (probe_inverting == READ(PROBE_TEST_PIN)) { - bltouch._set_SW_mode(); - if (probe_inverting != READ(PROBE_TEST_PIN)) { - bltouch._deploy(); - if (probe_inverting == READ(PROBE_TEST_PIN)) { - bltouch._stow(); - SERIAL_ECHOLNPGM("= BLTouch Classic 1.2, 1.3, Smart 1.0, 2.0, 2.2, 3.0, 3.1 detected."); - // Check for a 3.1 by letting the user trigger it, later - blt = true; - } - } - } - #endif - - // The following code is common to all kinds of servo probes. - // Since it could be a real servo or a BLTouch (any kind) or a clone, - // use only "common" functions - i.e. SERVO_MOVE. No bltouch.xxxx stuff. - - // If it is already recognised as a being a BLTouch, no need for this test - if (!blt) { - // DEPLOY and STOW 4 times and see if the signal follows - // Then it is a mechanical switch - uint8_t i = 0; - SERIAL_ECHOLNPGM(". Deploy & stow 4 times"); - do { - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy - safe_delay(500); - deploy_state = READ(PROBE_TEST_PIN); - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow - safe_delay(500); - stow_state = READ(PROBE_TEST_PIN); - } while (++i < 4); - - if (probe_inverting != deploy_state) SERIAL_ECHOLNPGM("WARNING: INVERTING setting probably backwards."); - - if (deploy_state != stow_state) { - SERIAL_ECHOLNPGM("= Mechanical Switch detected"); - if (deploy_state) { - SERIAL_ECHOLNPAIR(" DEPLOYED state: HIGH (logic 1)", - " STOWED (triggered) state: LOW (logic 0)"); - } - else { - SERIAL_ECHOLNPAIR(" DEPLOYED state: LOW (logic 0)", - " STOWED (triggered) state: HIGH (logic 1)"); - } - #if ENABLED(BLTOUCH) - SERIAL_ECHOLNPGM("FAIL: BLTOUCH enabled - Set up this device as a Servo Probe with INVERTING set to 'true'."); - #endif - return; - } - } - - // Ask the user for a trigger event and measure the pulse width. - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy - safe_delay(500); - SERIAL_ECHOLNPGM("** Please trigger probe within 30 sec **"); - uint16_t probe_counter = 0; - - // Wait 30 seconds for user to trigger probe - for (uint16_t j = 0; j < 500 * 30 && probe_counter == 0 ; j++) { - safe_delay(2); - - if (0 == j % (500 * 1)) gcode.reset_stepper_timeout(); // Keep steppers powered - - if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered - for (probe_counter = 0; probe_counter < 15 && deploy_state != READ(PROBE_TEST_PIN); ++probe_counter) safe_delay(2); - - SERIAL_ECHOPGM(". Pulse width"); - if (probe_counter == 15) - SERIAL_ECHOLNPGM(": 30ms or more"); - else - SERIAL_ECHOLNPAIR(" (+/- 4ms): ", probe_counter * 2); - - if (probe_counter >= 4) { - if (probe_counter == 15) { - if (blt) SERIAL_ECHOPGM("= BLTouch V3.1"); - else SERIAL_ECHOPGM("= Z Servo Probe"); - } - else SERIAL_ECHOPGM("= BLTouch pre V3.1 (or compatible)"); - SERIAL_ECHOLNPGM(" detected."); - } - else SERIAL_ECHOLNPGM("FAIL: Noise detected - please re-run test"); - - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow - return; - } - } - - if (!probe_counter) SERIAL_ECHOLNPGM("FAIL: No trigger detected"); - - #endif // HAS_Z_SERVO_PROBE - -} // servo_probe_test - -/** - * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report - * - * M43 - report name and state of pin(s) - * P Pin to read or watch. If omitted, reads all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 W - Watch pins -reporting changes- until reset, click, or M108. - * P Pin to read or watch. If omitted, read/watch all pins. - * I Flag to ignore Marlin's pin protection. - * - * M43 E - Enable / disable background endstop monitoring - * - Machine continues to operate - * - Reports changes to endstops - * - Toggles LED_PIN when an endstop changes - * - Cannot reliably catch the 5mS pulse from BLTouch type probes - * - * M43 T - Toggle pin(s) and report which pin is being toggled - * S - Start Pin number. If not given, will default to 0 - * L - End Pin number. If not given, will default to last pin defined for this board - * I - Flag to ignore Marlin's pin protection. Use with caution!!!! - * R - Repeat pulses on each pin this number of times before continueing to next pin - * W - Wait time (in miliseconds) between pulses. If not given will default to 500 - * - * M43 S - Servo probe test - * P - Probe index (optional - defaults to 0 - */ -void GcodeSuite::M43() { - - // 'T' must be first. It uses 'S' and 'E' differently. - if (parser.seen('T')) return toggle_pins(); - - // 'E' Enable or disable endstop monitoring and return - if (parser.seen('E')) { - endstops.monitor_flag = parser.value_bool(); - SERIAL_ECHOPGM("endstop monitor "); - serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOLNPGM("abled"); - return; - } - - // 'S' Run servo probe test and return - if (parser.seen('S')) return servo_probe_test(); - - // 'P' Get the range of pins to test or watch - uint8_t first_pin = PARSED_PIN_INDEX('P', 0), - last_pin = parser.seenval('P') ? first_pin : NUMBER_PINS_TOTAL - 1; - - if (first_pin > last_pin) return; - - // 'I' to ignore protected pins - const bool ignore_protection = parser.boolval('I'); - - // 'W' Watch until click, M108, or reset - if (parser.boolval('W')) { - SERIAL_ECHOLNPGM("Watching pins"); - #ifdef ARDUINO_ARCH_SAM - NOLESS(first_pin, 2); // Don't hijack the UART pins - #endif - uint8_t pin_state[last_pin - first_pin + 1]; - for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN_M43(i); - if (!VALID_PIN(pin)) continue; - if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue; - pinMode(pin, INPUT_PULLUP); - delay(1); - /* - if (IS_ANALOG(pin)) - pin_state[pin - first_pin] = analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)); // int16_t pin_state[...] - else - //*/ - pin_state[i - first_pin] = extDigitalRead(pin); - } - - #if HAS_RESUME_CONTINUE - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called")); - #endif - #endif - - for (;;) { - for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN_M43(i); - if (!VALID_PIN(pin)) continue; - if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue; - const byte val = - /* - IS_ANALOG(pin) - ? analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)) : // int16_t val - : - //*/ - extDigitalRead(pin); - if (val != pin_state[i - first_pin]) { - report_pin_state_extended(pin, ignore_protection, false); - pin_state[i - first_pin] = val; - } - } - - #if HAS_RESUME_CONTINUE - if (!wait_for_user) break; - #endif - - safe_delay(200); - } - } - else { - // Report current state of selected pin(s) - for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN_M43(i); - if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true); - } - } -} - -#endif // PINS_DEBUGGING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M540.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M540.cpp deleted file mode 100644 index fa04fa059d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M540.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - -#include "../gcode.h" -#include "../../module/stepper.h" - -/** - * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) - */ -void GcodeSuite::M540() { - - if (parser.seen('S')) - planner.abort_on_endstop_hit = parser.value_bool(); - -} - -#endif // SD_ABORT_ON_ENDSTOP_HIT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M575.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M575.cpp deleted file mode 100644 index 0abc8f9fea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M575.cpp +++ /dev/null @@ -1,74 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(BAUD_RATE_GCODE) - -#include "../gcode.h" - -/** - * M575 - Change serial baud rate - * - * P - Serial port index. Omit for all. - * B - Baud rate (bits per second) - */ -void GcodeSuite::M575() { - const int32_t baud = parser.ulongval('B'); - switch (baud) { - case 2400: case 9600: case 19200: case 38400: case 57600: - case 115200: case 250000: case 500000: case 1000000: { - const int8_t port = parser.intval('P', -99); - const bool set0 = (port == -99 || port == 0); - if (set0) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(" Serial " - #if NUM_SERIAL > 1 - , '0', - #else - "0" - #endif - " baud rate set to ", baud - ); - } - #if NUM_SERIAL > 1 - const bool set1 = (port == -99 || port == 1); - if (set1) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(" Serial ", '1', " baud rate set to ", baud); - } - #endif - - SERIAL_FLUSH(); - - if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); } - - #if NUM_SERIAL > 1 - if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); } - #endif - - } break; - default: SERIAL_ECHO_MSG("?(B)aud rate implausible."); - } -} - -#endif // NUM_SERIAL > 0 && BAUD_RATE_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M92.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M92.cpp deleted file mode 100644 index 212b6f83b7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/config/M92.cpp +++ /dev/null @@ -1,114 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/planner.h" - -void report_M92(const bool echo=true, const int8_t e=-1) { - if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOPAIR_P(PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]), - SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]), - SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); - #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR_P(SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS])); - #endif - SERIAL_EOL(); - - #if ENABLED(DISTINCT_E_FACTORS) - for (uint8_t i = 0; i < E_STEPPERS; i++) { - if (e >= 0 && i != e) continue; - if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOLNPAIR_P(PSTR(" M92 T"), (int)i, - SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); - } - #endif - - UNUSED_E(e); -} - -/** - * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E. - * (Follows the same syntax as G92) - * - * With multiple extruders use T to specify which one. - * - * If no argument is given print the current values. - * - * With MAGIC_NUMBERS_GCODE: - * Use 'H' and/or 'L' to get ideal layer-height information. - * 'H' specifies micro-steps to use. We guess if it's not supplied. - * 'L' specifies a desired layer height. Nearest good heights are shown. - */ -void GcodeSuite::M92() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - // No arguments? Show M92 report. - if (!parser.seen("XYZE" - #if ENABLED(MAGIC_NUMBERS_GCODE) - "HL" - #endif - )) return report_M92(true, target_extruder); - - LOOP_XYZE(i) { - if (parser.seenval(axis_codes[i])) { - if (i == E_AXIS) { - const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder))); - if (value < 20) { - float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab. - #if HAS_CLASSIC_JERK && HAS_CLASSIC_E_JERK - planner.max_jerk.e *= factor; - #endif - planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor; - planner.max_acceleration_steps_per_s2[E_AXIS_N(target_extruder)] *= factor; - } - planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] = value; - } - else { - planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i); - } - } - } - planner.refresh_positioning(); - - #if ENABLED(MAGIC_NUMBERS_GCODE) - #ifndef Z_MICROSTEPS - #define Z_MICROSTEPS 16 - #endif - const float wanted = parser.floatval('L'); - if (parser.seen('H') || wanted) { - const uint16_t argH = parser.ushortval('H'), - micro_steps = 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, ", 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_ECHOPAIR(", best:[", best); - if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); } - SERIAL_CHAR(']'); - } - SERIAL_ECHOLNPGM(" }"); - } - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M108_M112_M410.cpp deleted file mode 100644 index 50feb8276f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M108_M112_M410.cpp +++ /dev/null @@ -1,57 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if DISABLED(EMERGENCY_PARSER) - -#include "../gcode.h" -#include "../../Marlin.h" // for wait_for_heatup, kill, quickstop_stepper - -/** - * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. - */ -void GcodeSuite::M108() { - #if HAS_RESUME_CONTINUE - wait_for_user = false; - #endif - wait_for_heatup = false; -} - -/** - * M112: Full Shutdown - */ -void GcodeSuite::M112() { - kill(PSTR("M112 Shutdown"), nullptr, true); -} - -/** - * M410: Quickstop - Abort all planned moves - * - * This will stop the carriages mid-move, so most likely they - * will be out of sync with the stepper position after this. - */ -void GcodeSuite::M410() { - quickstop_stepper(); -} - -#endif // !EMERGENCY_PARSER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M111.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M111.cpp deleted file mode 100644 index 1c608408f3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M111.cpp +++ /dev/null @@ -1,80 +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 . - * - */ - -#include "../gcode.h" - -/** - * M111: Set the debug level - */ -void GcodeSuite::M111() { - if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - - static const char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, - str_debug_2[] PROGMEM = MSG_DEBUG_INFO, - str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS, - str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN, - str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_lvl[] PROGMEM = MSG_DEBUG_LEVELING - #endif - ; - - static PGM_P const debug_strings[] PROGMEM = { - str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16 - #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_lvl - #endif - }; - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DEBUG_PREFIX); - if (marlin_debug_flags) { - uint8_t comma = 0; - for (uint8_t i = 0; i < COUNT(debug_strings); i++) { - if (TEST(marlin_debug_flags, i)) { - if (comma++) SERIAL_CHAR(','); - serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); - } - } - } - else { - SERIAL_ECHOPGM(MSG_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) - #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) - SERIAL_ECHOPAIR("\nBuffer Overruns: ", MYSERIAL0.buffer_overruns()); - #endif - - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) - SERIAL_ECHOPAIR("\nFraming Errors: ", MYSERIAL0.framing_errors()); - #endif - - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOPAIR("\nDropped bytes: ", MYSERIAL0.dropped()); - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOPAIR("\nMax RX Queue Size: ", MYSERIAL0.rxMaxEnqueued()); - #endif - #endif // !defined(__AVR__) || !defined(USBCON) - } - SERIAL_EOL(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M120_M121.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M120_M121.cpp deleted file mode 100644 index 7ee6a83fbf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M120_M121.cpp +++ /dev/null @@ -1,34 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/endstops.h" - -/** - * M120: Enable endstops and set non-homing endstop state to "enabled" - */ -void GcodeSuite::M120() { endstops.enable_globally(true); } - -/** - * M121: Disable endstops and set non-homing endstop state to "disabled" - */ -void GcodeSuite::M121() { endstops.enable_globally(false); } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M17_M18_M84.cpp deleted file mode 100644 index de6eab4f74..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M17_M18_M84.cpp +++ /dev/null @@ -1,77 +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 . - * - */ - -#include "../gcode.h" -#include "../../Marlin.h" // for stepper_inactive_time, disable_e_steppers -#include "../../lcd/ultralcd.h" -#include "../../module/stepper.h" - -#if BOTH(AUTO_BED_LEVELING_UBL, ULTRA_LCD) - #include "../../feature/bedlevel/bedlevel.h" -#endif - -/** - * M17: Enable stepper motors - */ -void GcodeSuite::M17() { - if (parser.seen("XYZE")) { - if (parser.seen('X')) enable_X(); - if (parser.seen('Y')) enable_Y(); - if (parser.seen('Z')) enable_Z(); - #if HAS_E_STEPPER_ENABLE - if (parser.seen('E')) enable_e_steppers(); - #endif - } - else { - LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_all_steppers(); - } -} - -/** - * M18, M84: Disable stepper motors - */ -void GcodeSuite::M18_M84() { - if (parser.seenval('S')) { - stepper_inactive_time = parser.value_millis_from_seconds(); - } - else { - if (parser.seen("XYZE")) { - planner.synchronize(); - if (parser.seen('X')) disable_X(); - if (parser.seen('Y')) disable_Y(); - if (parser.seen('Z')) disable_Z(); - #if HAS_E_STEPPER_ENABLE - if (parser.seen('E')) disable_e_steppers(); - #endif - } - else - planner.finish_and_disable(); - - #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) - if (ubl.lcd_map_control) { - ubl.lcd_map_control = false; - ui.defer_status_screen(false); - } - #endif - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M211.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M211.cpp deleted file mode 100644 index 432ab1379a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M211.cpp +++ /dev/null @@ -1,46 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_SOFTWARE_ENDSTOPS - -#include "../gcode.h" -#include "../../module/motion.h" - -/** - * M211: Enable, Disable, and/or Report software endstops - * - * Usage: M211 S1 to enable, M211 S0 to disable, M211 alone for report - */ -void GcodeSuite::M211() { - const xyz_pos_t l_soft_min = soft_endstop.min.asLogical(), - l_soft_max = soft_endstop.max.asLogical(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); - serialprint_onoff(soft_endstops_enabled); - print_xyz(l_soft_min, PSTR(MSG_SOFT_MIN), PSTR(" ")); - print_xyz(l_soft_max, PSTR(MSG_SOFT_MAX)); -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M226.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M226.cpp deleted file mode 100644 index 5bcf55b2f7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M226.cpp +++ /dev/null @@ -1,52 +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 . - * - */ - -#include "../gcode.h" -#include "../../Marlin.h" // for pin_is_protected and idle() -#include "../../module/stepper.h" - -/** - * M226: Wait until the specified pin reaches the state required (M226 P S) - */ -void GcodeSuite::M226() { - if (parser.seen('P')) { - const int pin_number = PARSED_PIN_INDEX('P', 0), - pin_state = parser.intval('S', -1); // required pin state - default is inverted - const pin_t pin = GET_PIN_MAP_PIN(pin_number); - - if (WITHIN(pin_state, -1, 1) && pin > -1) { - if (pin_is_protected(pin)) - protected_pin_err(); - else { - int target = LOW; - planner.synchronize(); - pinMode(pin, INPUT); - switch (pin_state) { - case 1: target = HIGH; break; - case 0: target = LOW; break; - case -1: target = !extDigitalRead(pin); break; - } - while (int(extDigitalRead(pin)) != target) idle(); - } - } // pin_state -1 0 1 && pin > -1 - } // parser.seen('P') -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M280.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M280.cpp deleted file mode 100644 index 6b65e9b753..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M280.cpp +++ /dev/null @@ -1,55 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "../gcode.h" -#include "../../module/servo.h" - -/** - * M280: Get or set servo position. P [S] - */ -void GcodeSuite::M280() { - if (!parser.seen('P')) return; - const int servo_index = parser.value_int(); - if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) { - if (parser.seen('S')) { - const int a = parser.value_int(); - if (a == -1) - servo[servo_index].detach(); - else - MOVE_SERVO(servo_index, a); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read()); - } - } - else { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); - } -} - -#endif // HAS_SERVOS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M3-M5.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M3-M5.cpp deleted file mode 100644 index 81e1645193..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M3-M5.cpp +++ /dev/null @@ -1,100 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_CUTTER - -#include "../gcode.h" -#include "../../feature/spindle_laser.h" -#include "../../module/stepper.h" - -/** - * Laser: - * - * M3 - Laser ON/Power (Ramped power) - * M4 - Laser ON/Power (Continuous power) - * - * S - Set power. S0 will turn the laser off. - * O - Set power and OCR - * - * Spindle: - * - * M3 - Spindle ON (Clockwise) - * M4 - Spindle ON (Counter-clockwise) - * - * S - Set power. S0 will turn the spindle off. - * O - Set power and OCR - * - * If no PWM pin is defined then M3/M4 just turns it on. - * - * At least 12.8KHz (50Hz * 256) is needed for Spindle PWM. - * Hardware PWM is required on AVR. ISRs are too slow. - * - * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. - * No other settings give a PWM signal that goes from 0 to 5 volts. - * - * The system automatically sets WGM to Mode 1, so no special - * initialization is needed. - * - * WGM bits for timer 2 are automatically set by the system to - * Mode 1. This produces an acceptable 0 to 5 volt signal. - * No special initialization is needed. - * - * NOTE: A minimum PWM frequency of 50 Hz is needed. All prescaler - * factors for timers 2, 3, 4, and 5 are acceptable. - * - * SPINDLE_LASER_ENA_PIN needs an external pullup or it may power on - * the spindle/laser during power-up or when connecting to the host - * (usually goes through a reset which sets all I/O pins to tri-state) - * - * PWM duty cycle goes from 0 (off) to 255 (always on). - */ -void GcodeSuite::M3_M4(const bool is_M4) { - - #if ENABLED(SPINDLE_FEATURE) - planner.synchronize(); // Wait for movement to complete before changing power - #endif - - cutter.set_direction(is_M4); - - #if ENABLED(SPINDLE_LASER_PWM) - if (parser.seenval('O')) - cutter.set_ocr_power(parser.value_byte()); // The OCR is a value from 0 to 255 (uint8_t) - else - cutter.set_power(parser.intval('S', 255)); - #else - cutter.set_enabled(true); - #endif -} - -/** - * M5 - Cutter OFF - */ -void GcodeSuite::M5() { - #if ENABLED(SPINDLE_FEATURE) - planner.synchronize(); - #endif - cutter.set_enabled(false); -} - -#endif // HAS_CUTTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M350_M351.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M350_M351.cpp deleted file mode 100644 index 44a2dd4943..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M350_M351.cpp +++ /dev/null @@ -1,64 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_MICROSTEPS - -#include "../gcode.h" -#include "../../module/stepper.h" - -/** - * M350: Set axis microstepping modes. S sets mode for all drivers. - * - * Warning: Steps-per-unit remains unchanged. - */ -void GcodeSuite::M350() { - if (parser.seen('S')) for (uint8_t i = 0; i <= 4; i++) stepper.microstep_mode(i, parser.value_byte()); - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte()); - if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte()); - stepper.microstep_readings(); -} - -/** - * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B - * S# determines MS1, MS2 or MS3, X# sets the pin high/low. - */ -void GcodeSuite::M351() { - if (parser.seenval('S')) switch (parser.value_byte()) { - case 1: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1); - if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1); - break; - case 2: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1); - if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1); - break; - case 3: - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte()); - if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte()); - break; - } - stepper.microstep_readings(); -} - -#endif // HAS_MICROSTEPS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M380_M381.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M380_M381.cpp deleted file mode 100644 index 58d0431698..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M380_M381.cpp +++ /dev/null @@ -1,56 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) - -#include "../gcode.h" -#include "../../feature/solenoid.h" -#include "../../module/motion.h" - -/** - * M380: Enable solenoid on the active extruder - * - * S to specify a solenoid (Requires MANUAL_SOLENOID_CONTROL) - */ -void GcodeSuite::M380() { - #if ENABLED(MANUAL_SOLENOID_CONTROL) - enable_solenoid(parser.intval('S', active_extruder)); - #else - enable_solenoid_on_active_extruder(); - #endif -} - -/** - * M381: Disable all solenoids if EXT_SOLENOID - * Disable selected/active solenoid if MANUAL_SOLENOID_CONTROL - */ -void GcodeSuite::M381() { - #if ENABLED(MANUAL_SOLENOID_CONTROL) - disable_solenoid(parser.intval('S', active_extruder)); - #else - disable_all_solenoids(); - #endif -} - -#endif // EXT_SOLENOID || MANUAL_SOLENOID_CONTROL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M400.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M400.cpp deleted file mode 100644 index 445aa9c979..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M400.cpp +++ /dev/null @@ -1,33 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/stepper.h" - -/** - * M400: Finish all moves - */ -void GcodeSuite::M400() { - - planner.synchronize(); - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M42.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M42.cpp deleted file mode 100644 index 0ee2ef7079..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M42.cpp +++ /dev/null @@ -1,69 +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 . - * - */ - -#include "../gcode.h" -#include "../../Marlin.h" // for pin_is_protected -#include "../../inc/MarlinConfig.h" - -#if FAN_COUNT > 0 - #include "../../module/temperature.h" -#endif - -/** - * M42: Change pin status via GCode - * - * P Pin number (LED if omitted) - * For LPC1768 specify pin P1_02 as M42 P102, - * P1_20 as M42 P120, etc. - * - * S Pin status from 0 - 255 - * I Flag to ignore Marlin's pin protection - */ -void GcodeSuite::M42() { - if (!parser.seenval('S')) return; - const byte pin_status = parser.value_byte(); - - const int pin_index = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN)); - if (pin_index < 0) return; - - const pin_t pin = GET_PIN_MAP_PIN(pin_index); - - if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err(); - - pinMode(pin, OUTPUT); - extDigitalWrite(pin, pin_status); - analogWrite(pin, pin_status); - - #if FAN_COUNT > 0 - switch (pin) { - #if HAS_FAN0 - case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; break; - #endif - #if HAS_FAN1 - case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; break; - #endif - #if HAS_FAN2 - case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; break; - #endif - } - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M605.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M605.cpp deleted file mode 100644 index 007c6fc6b8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M605.cpp +++ /dev/null @@ -1,182 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_DUPLICATION_MODE - -//#define DEBUG_DXC_MODE - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/stepper.h" -#include "../../module/tool_change.h" -#include "../../module/planner.h" - -#define DEBUG_OUT ENABLED(DEBUG_DXC_MODE) -#include "../../core/debug_out.h" - -#if ENABLED(DUAL_X_CARRIAGE) - - /** - * M605: Set dual x-carriage movement mode - * - * M605 S0 : (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 S1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so that - * additional slicer support is not required. - * - * M605 S2 X R : (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. For example, use "M605 S2 X100 R2" to - * make a copy 100mm to the right with E1 2° hotter than E0. - * - * M605 S3 : (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. - * The temperature differential and initial X offset must be set with "M605 S2 X[offs] R[deg]", - * then followed by "M605 S3" to initiate mirrored movement. - * - * M605 W : IDEX What? command. - * - * Note: the X axis should be homed after changing Dual X-carriage mode. - */ - void GcodeSuite::M605() { - planner.synchronize(); - - if (parser.seen('S')) { - const DualXMode previous_mode = dual_x_carriage_mode; - - dual_x_carriage_mode = (DualXMode)parser.value_byte(); - mirrored_duplication_mode = false; - - if (dual_x_carriage_mode == DXC_MIRRORED_MODE) { - if (previous_mode != DXC_DUPLICATION_MODE) { - SERIAL_ECHOLNPGM("Printer must be in DXC_DUPLICATION_MODE prior to "); - SERIAL_ECHOLNPGM("specifying DXC_MIRRORED_MODE."); - dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - return; - } - mirrored_duplication_mode = true; - stepper.set_directions(); - float x_jog = current_position.x - .1; - for (uint8_t i = 2; --i;) { - planner.buffer_line(x_jog, current_position.y, current_position.z, current_position.e, feedrate_mm_s, 0); - x_jog += .1; - } - return; - } - - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - case DXC_AUTO_PARK_MODE: - break; - case DXC_DUPLICATION_MODE: - if (parser.seen('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), X2_MIN_POS - x_home_pos(0)); - if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); - if (active_extruder != 0) tool_change(0); - break; - default: - dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - break; - } - active_extruder_parked = false; - extruder_duplication_enabled = false; - stepper.set_directions(); - delayed_move_time = 0; - } - else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default - dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - - #ifdef DEBUG_DXC_MODE - - if (parser.seen('W')) { - DEBUG_ECHO_START(); - DEBUG_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: DEBUG_ECHOPGM("FULL_CONTROL"); break; - case DXC_AUTO_PARK_MODE: DEBUG_ECHOPGM("AUTO_PARK"); break; - case DXC_DUPLICATION_MODE: DEBUG_ECHOPGM("DUPLICATION"); break; - case DXC_MIRRORED_MODE: DEBUG_ECHOPGM("MIRRORED"); break; - } - DEBUG_ECHOPAIR("\nActive Ext: ", int(active_extruder)); - if (!active_extruder_parked) DEBUG_ECHOPGM(" NOT "); - DEBUG_ECHOPGM(" parked."); - DEBUG_ECHOPAIR("\nactive_extruder_x_pos: ", current_position.x); - DEBUG_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos); - DEBUG_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled)); - DEBUG_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset); - DEBUG_ECHOPAIR("\nduplicate_extruder_temp_offset: ", duplicate_extruder_temp_offset); - DEBUG_ECHOPAIR("\ndelayed_move_time: ", delayed_move_time); - DEBUG_ECHOPAIR("\nX1 Home X: ", x_home_pos(0), "\nX1_MIN_POS=", int(X1_MIN_POS), "\nX1_MAX_POS=", int(X1_MAX_POS)); - DEBUG_ECHOPAIR("\nX2 Home X: ", x_home_pos(1), "\nX2_MIN_POS=", int(X2_MIN_POS), "\nX2_MAX_POS=", int(X2_MAX_POS)); - DEBUG_ECHOPAIR("\nX2_HOME_DIR=", int(X2_HOME_DIR), "\nX2_HOME_POS=", int(X2_HOME_POS)); - DEBUG_ECHOPAIR("\nDEFAULT_DUAL_X_CARRIAGE_MODE=", STRINGIFY(DEFAULT_DUAL_X_CARRIAGE_MODE)); - DEBUG_ECHOPAIR("\toolchange_settings.z_raise=", toolchange_settings.z_raise); - DEBUG_ECHOPAIR("\nDEFAULT_DUPLICATION_X_OFFSET=", int(DEFAULT_DUPLICATION_X_OFFSET)); - DEBUG_EOL(); - - HOTEND_LOOP() { - DEBUG_ECHOPAIR(" T", int(e)); - LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", int(e), "].", axis_codes[a] | 0x20, "=", hotend_offset[e][a]); - DEBUG_EOL(); - } - DEBUG_EOL(); - } - #endif // DEBUG_DXC_MODE - } - -#elif ENABLED(MULTI_NOZZLE_DUPLICATION) - - /** - * M605: Set multi-nozzle duplication mode - * - * S2 - Enable duplication mode - * P[mask] - Bit-mask of nozzles to include in the duplication set. - * A value of 0 disables duplication. - * E[index] - Last nozzle index to include in the duplication set. - * A value of 0 disables duplication. - */ - void GcodeSuite::M605() { - bool ena = false; - if (parser.seen("EPS")) { - planner.synchronize(); - if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly - else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index - ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0)); - extruder_duplication_enabled = ena && (duplication_e_mask >= 3); - } - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DUPLICATION_MODE); - serialprint_onoff(extruder_duplication_enabled); - if (ena) { - SERIAL_ECHOPGM(" ( "); - HOTEND_LOOP() if (TEST(duplication_e_mask, e)) { SERIAL_ECHO(e); SERIAL_CHAR(' '); } - SERIAL_CHAR(')'); - } - SERIAL_EOL(); - } - -#endif // MULTI_NOZZLE_DUPLICATION - -#endif // HAS_DUPICATION_MODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M7-M9.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M7-M9.cpp deleted file mode 100644 index 91898374fd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M7-M9.cpp +++ /dev/null @@ -1,63 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(COOLANT_CONTROL) - -#include "../gcode.h" -#include "../../module/planner.h" - -#if ENABLED(COOLANT_MIST) - /** - * M7: Mist Coolant On - */ - void GcodeSuite::M7() { - planner.synchronize(); // Wait for move to arrive - WRITE(COOLANT_MIST_PIN, !(COOLANT_MIST_INVERT)); // Turn on Mist coolant - } -#endif - -#if ENABLED(COOLANT_FLOOD) - /** - * M8: Flood Coolant On - */ - void GcodeSuite::M8() { - planner.synchronize(); // Wait for move to arrive - WRITE(COOLANT_FLOOD_PIN, !(COOLANT_FLOOD_INVERT)); // Turn on Flood coolant - } -#endif - -/** - * M9: Coolant OFF - */ -void GcodeSuite::M9() { - planner.synchronize(); // Wait for move to arrive - #if ENABLED(COOLANT_MIST) - WRITE(COOLANT_MIST_PIN, COOLANT_MIST_INVERT); // Turn off Mist coolant - #endif - #if ENABLED(COOLANT_FLOOD) - WRITE(COOLANT_FLOOD_PIN, COOLANT_FLOOD_INVERT); // Turn off Flood coolant - #endif -} - -#endif // COOLANT_CONTROL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M80_M81.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M80_M81.cpp deleted file mode 100644 index 56533d45b8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M80_M81.cpp +++ /dev/null @@ -1,115 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/temperature.h" -#include "../../module/stepper.h" -#include "../../module/printcounter.h" // for print_job_timer - -#include "../../inc/MarlinConfig.h" - -#if HAS_LCD_MENU - #include "../../lcd/ultralcd.h" -#endif - -#if HAS_SUICIDE - #include "../../Marlin.h" -#endif - -#if ENABLED(PSU_CONTROL) - - #if ENABLED(AUTO_POWER_CONTROL) - #include "../../feature/power.h" - #endif - - // Could be moved to a feature, but this is all the data - bool powersupply_on; - - #if HAS_TRINAMIC - #include "../../feature/tmc_util.h" - #endif - - /** - * M80 : Turn on the Power Supply - * M80 S : Report the current state and exit - */ - void GcodeSuite::M80() { - - // S: Report the current power supply state and exit - if (parser.seen('S')) { - serialprintPGM(powersupply_on ? PSTR("PS:1\n") : PSTR("PS:0\n")); - return; - } - - PSU_ON(); - - /** - * If you have a switch on suicide pin, this is useful - * if you want to start another print with suicide feature after - * a print without suicide... - */ - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); - #endif - - #if DISABLED(AUTO_POWER_CONTROL) - delay(PSU_POWERUP_DELAY); // Wait for power to settle - restore_stepper_drivers(); - #endif - - #if HAS_LCD_MENU - ui.reset_status(); - #endif - } - -#endif // ENABLED(PSU_CONTROL) - -/** - * M81: Turn off Power, including Power Supply, if there is one. - * - * This code should ALWAYS be available for FULL SHUTDOWN! - */ -void GcodeSuite::M81() { - thermalManager.disable_all_heaters(); - print_job_timer.stop(); - planner.finish_and_disable(); - - #if FAN_COUNT > 0 - thermalManager.zero_fan_speeds(); - #if ENABLED(PROBING_FANS_OFF) - thermalManager.fans_paused = false; - ZERO(thermalManager.saved_fan_speed); - #endif - #endif - - safe_delay(1000); // Wait 1 second before switching off - - #if HAS_SUICIDE - suicide(); - #elif ENABLED(PSU_CONTROL) - PSU_OFF(); - #endif - - #if HAS_LCD_MENU - LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " MSG_OFF ".")); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M85.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M85.cpp deleted file mode 100644 index bc5a91c375..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M85.cpp +++ /dev/null @@ -1,33 +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 . - * - */ - -#include "../gcode.h" -#include "../../Marlin.h" // for max_inactive_time - -/** - * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default) - */ -void GcodeSuite::M85() { - - if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds(); - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M997.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M997.cpp deleted file mode 100644 index 369bba044f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M997.cpp +++ /dev/null @@ -1,34 +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 . - * - */ - -#include "../gcode.h" - -#if ENABLED(PLATFORM_M997_SUPPORT) - -/** - * M997: Perform in-application firmware update - */ -void GcodeSuite::M997() { - flashFirmware(parser.intval('S')); -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M999.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M999.cpp deleted file mode 100644 index 2972e086d1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/M999.cpp +++ /dev/null @@ -1,46 +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 . - * - */ - -#include "../gcode.h" - -#include "../../lcd/ultralcd.h" // for lcd_reset_alert_level -#include "../../Marlin.h" // for Running -#include "../queue.h" // for flush_and_request_resend - -/** - * M999: Restart after being stopped - * - * Default behavior is to flush the serial buffer and request - * a resend to the host starting on the last N line received. - * - * Sending "M999 S1" will resume printing without flushing the - * existing command buffer. - * - */ -void GcodeSuite::M999() { - Running = true; - ui.reset_alert_level(); - - if (parser.boolval('S')) return; - - queue.flush_and_request_resend(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/T.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/T.cpp deleted file mode 100644 index db6c173071..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/control/T.cpp +++ /dev/null @@ -1,80 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/tool_change.h" - -#if ENABLED(DEBUG_LEVELING_FEATURE) || EXTRUDERS > 1 - #include "../../module/motion.h" -#endif - -#if ENABLED(PRUSA_MMU2) - #include "../../feature/prusa_MMU2/mmu2.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../core/debug_out.h" - -/** - * T0-T: Switch tool, usually switching extruders - * - * F[units/min] Set the movement feedrate - * S1 Don't move the tool in XY after change - * - * For PRUSA_MMU2: - * T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. - * T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically. - * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load. - * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated. - */ -void GcodeSuite::T(const uint8_t tool_index) { - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR(">>> T(", tool_index, ")"); - DEBUG_POS("BEFORE", current_position); - } - - #if ENABLED(PRUSA_MMU2) - if (parser.string_arg) { - mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc - return; - } - #endif - - #if EXTRUDERS < 2 - - tool_change(tool_index); - - #else - - tool_change( - tool_index, - (tool_index == active_extruder) || parser.boolval('S') - ); - - #endif - - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - DEBUG_ECHOLNPGM("<<< T()"); - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/eeprom/M500-M504.cpp deleted file mode 100644 index 79bacf0662..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/eeprom/M500-M504.cpp +++ /dev/null @@ -1,68 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/configuration_store.h" -#include "../../core/serial.h" -#include "../../inc/MarlinConfig.h" - -/** - * M500: Store settings in EEPROM - */ -void GcodeSuite::M500() { - (void)settings.save(); -} - -/** - * M501: Read settings from EEPROM - */ -void GcodeSuite::M501() { - (void)settings.load(); -} - -/** - * M502: Revert to default settings - */ -void GcodeSuite::M502() { - (void)settings.reset(); -} - -#if DISABLED(DISABLE_M503) - - /** - * M503: print settings currently in memory - */ - void GcodeSuite::M503() { - (void)settings.report(!parser.boolval('S', true)); - } - -#endif // !DISABLE_M503 - -#if ENABLED(EEPROM_SETTINGS) - /** - * M504: Validate EEPROM Contents - */ - void GcodeSuite::M504() { - if (settings.validate()) - SERIAL_ECHO_MSG("EEPROM OK"); - } -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M122.cpp deleted file mode 100644 index 1fbb72aacf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M122.cpp +++ /dev/null @@ -1,115 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "../../gcode.h" -#include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper/indirection.h" - -inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } - -void L6470_status_decode(const uint16_t status, const uint8_t axis) { - if (L6470.spi_abort) return; // don't do anything if set_directions() has occurred - L6470.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - char temp_buf[20]; - sprintf_P(temp_buf, PSTR(" status: %4x "), status); - SERIAL_ECHO(temp_buf); - print_bin(status); - #endif - SERIAL_ECHOPGM("\n...OUTPUT: "); - serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); - SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); - SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); - SERIAL_ECHOPGM(" Last Command: "); - if (status & STATUS_WRONG_CMD) SERIAL_ECHOPGM("IN"); - SERIAL_ECHOPGM("VALID "); - serialprintPGM(status & STATUS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); - SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & STATUS_TH_SD) ? "SHUTDOWN" : !(status & STATUS_TH_WRN) ? "WARNING " : "OK "); - SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(status & STATUS_OCD)); - SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(status & STATUS_STEP_LOSS_A) || !(status & STATUS_STEP_LOSS_B)); - SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(status & STATUS_SCK_MOD); - SERIAL_EOL(); -} - -/** - * M122: Debug L6470 drivers - */ -void GcodeSuite::M122() { - - L6470.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - - #define L6470_SAY_STATUS(Q) L6470_status_decode(stepper##Q.getStatus(), Q) - - //if (parser.seen('S')) - // tmc_set_report_interval(parser.value_bool()); - //else - - #if AXIS_DRIVER_TYPE_X(L6470) - L6470_SAY_STATUS(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - L6470_SAY_STATUS(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - L6470_SAY_STATUS(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - L6470_SAY_STATUS(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - L6470_SAY_STATUS(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - L6470_SAY_STATUS(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - L6470_SAY_STATUS(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - L6470_SAY_STATUS(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - L6470_SAY_STATUS(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - L6470_SAY_STATUS(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - L6470_SAY_STATUS(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - L6470_SAY_STATUS(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - L6470_SAY_STATUS(E5); - #endif - - L6470.spi_active = false; // done with all SPI transfers - clear handshake flags - L6470.spi_abort = false; -} - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M906.cpp deleted file mode 100644 index 72de90fc50..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M906.cpp +++ /dev/null @@ -1,284 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "../../gcode.h" -#include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/planner.h" - -#define DEBUG_OUT ENABLED(L6470_CHITCHAT) -#include "../../../core/debug_out.h" - -/** - * - * M906: report or set KVAL_HOLD which sets the maximum effective voltage provided by the - * PWMs to the steppers - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z or E1 - * 2 - monitor only X2, Y2, Z2 or E2 - * 3 - monitor only Z3 or E3 - * 4 - monitor only E4 - * 5 - monitor only E5 - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * I - over current threshold - * optional - will report current value from driver if not specified - * - * K - value for KVAL_HOLD (0 - 255) (optional) - * optional - will report current value from driver if not specified - * - */ - -/** - * Sets KVAL_HOLD wich affects the current being driven through the stepper. - * - * L6470 is used in the STEP-CLOCK mode. KVAL_HOLD is the only KVAL_xxx - * that affects the effective voltage seen by the stepper. - * - */ - -/** - * MACRO to fetch information on the items associated with current limiting - * and maximum voltage output. - * - * L6470 can be setup to shutdown if either current threshold is exceeded. - * - * L6470 output current can not be set directly. It is set indirectly by - * setting the maximum effective output voltage. - * - * Effective output voltage is set by PWM duty cycle. - * - * Maximum effective output voltage is affected by MANY variables. The main ones are: - * KVAL_HOLD - * KVAL_RUN - * KVAL_ACC - * KVAL_DEC - * Vs compensation (if enabled) - */ - -void L6470_report_current(L6470 &motor, const uint8_t axis) { - if (L6470.spi_abort) return; // don't do anything if set_directions() has occurred - const uint16_t status = motor.getStatus() ; - const uint8_t overcurrent_threshold = (uint8_t)motor.GetParam(L6470_OCD_TH), - stall_threshold = (uint8_t)motor.GetParam(L6470_STALL_TH), - motor_status = (status & (STATUS_MOT_STATUS)) >> 13, - adc_out = motor.GetParam(L6470_ADC_OUT), - adc_out_limited = constrain(adc_out, 8, 24); - const float comp_coef = 1600.0f / adc_out_limited; - const int microsteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); - char temp_buf[80]; - L6470.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - sprintf_P(temp_buf, PSTR(" status: %4x "), status); - DEBUG_ECHO(temp_buf); - print_bin(status); - #endif - sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%4d mA)"), overcurrent_threshold, (overcurrent_threshold + 1) * 375); - SERIAL_ECHO(temp_buf); - - char numstr[11]; - dtostrf((stall_threshold + 1) * 31.25, 1, 2, numstr); - sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%s mA)"), stall_threshold, numstr); - SERIAL_ECHO(temp_buf); - - SERIAL_ECHOPGM(" Motor Status: "); - const char *stat_str; - switch (motor_status) { - default: - case 0: stat_str = PSTR("stopped"); break; - case 1: stat_str = PSTR("accelerating"); break; - case 2: stat_str = PSTR("decelerating"); break; - case 3: stat_str = PSTR("at constant speed"); break; - } - serialprintPGM(stat_str); - SERIAL_EOL(); - - SERIAL_ECHOPAIR("...microsteps: ", microsteps); - SERIAL_ECHOPAIR(" ADC_OUT: ", adc_out); - SERIAL_ECHOPGM(" Vs_compensation: "); - serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); - - SERIAL_ECHOLNPAIR(" Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr)); - SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD)); - SERIAL_ECHOPAIR(" KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN)); - SERIAL_ECHOPAIR(" KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC)); - SERIAL_ECHOPAIR(" KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC)); - SERIAL_ECHOPGM(" V motor max = "); - float val; - PGM_P suf; - switch (motor_status) { - case 0: - val = motor.GetParam(L6470_KVAL_HOLD); - suf = PSTR("(KVAL_HOLD)"); - break; - case 1: - val = motor.GetParam(L6470_KVAL_RUN); - suf = PSTR("(KVAL_RUN)"); - break; - case 2: - val = motor.GetParam(L6470_KVAL_ACC); - suf = PSTR("(KVAL_ACC)"); - break; - case 3: - val = motor.GetParam(L6470_KVAL_DEC); - suf = PSTR("(KVAL_DEC)"); - break; - } - SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr)); - SERIAL_ECHOPGM("%% "); - serialprintPGM(suf); - SERIAL_EOL(); -} - -void GcodeSuite::M906() { - #define L6470_SET_KVAL_HOLD(Q) stepper##Q.SetParam(L6470_KVAL_HOLD, value) - - DEBUG_ECHOLNPGM("M906"); - - bool report_current = true; - - #if HAS_DRIVER(L6470) - const uint8_t index = parser.byteval('I'); - #endif - - LOOP_XYZE(i) if (uint8_t value = parser.byteval(axis_codes[i])) { - - report_current = false; - - if (planner.has_blocks_queued() || planner.cleaning_buffer_counter) { - SERIAL_ECHOLNPGM("!Can't set KVAL_HOLD with steppers moving"); - return; - } - - switch (i) { - case X_AXIS: - #if AXIS_DRIVER_TYPE_X(L6470) - if (index == 0) L6470_SET_KVAL_HOLD(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - if (index == 1) L6470_SET_KVAL_HOLD(X2); - #endif - break; - case Y_AXIS: - #if AXIS_DRIVER_TYPE_Y(L6470) - if (index == 0) L6470_SET_KVAL_HOLD(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - if (index == 1) L6470_SET_KVAL_HOLD(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_DRIVER_TYPE_Z(L6470) - if (index == 0) L6470_SET_KVAL_HOLD(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - if (index == 1) L6470_SET_KVAL_HOLD(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - if (index == 2) L6470_SET_KVAL_HOLD(Z3); - #endif - break; - case E_AXIS: { - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - switch (target_extruder) { - #if AXIS_DRIVER_TYPE_E0(L6470) - case 0: L6470_SET_KVAL_HOLD(E0); break; - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 1: L6470_SET_KVAL_HOLD(E1); break; - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 2: L6470_SET_KVAL_HOLD(E2); break; - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 3: L6470_SET_KVAL_HOLD(E3); break; - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 4: L6470_SET_KVAL_HOLD(E4); break; - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 5: L6470_SET_KVAL_HOLD(E5); break; - #endif - } - } break; - } - } - - if (report_current) { - #define L6470_REPORT_CURRENT(Q) L6470_report_current(stepper##Q, Q) - - L6470.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - - #if AXIS_DRIVER_TYPE_X(L6470) - L6470_REPORT_CURRENT(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - L6470_REPORT_CURRENT(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - L6470_REPORT_CURRENT(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - L6470_REPORT_CURRENT(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - L6470_REPORT_CURRENT(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - L6470_REPORT_CURRENT(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - L6470_REPORT_CURRENT(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - L6470_REPORT_CURRENT(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - L6470_REPORT_CURRENT(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - L6470_REPORT_CURRENT(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - L6470_REPORT_CURRENT(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - L6470_REPORT_CURRENT(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - L6470_REPORT_CURRENT(E5); - #endif - - L6470.spi_active = false; // done with all SPI transfers - clear handshake flags - L6470.spi_abort = false; - } -} - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M916-918.cpp deleted file mode 100644 index 96a27f3330..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ /dev/null @@ -1,529 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "../../gcode.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 feedRate_t &fr_mm_m) { - char gcode_string[30], str1[11], str2[11]; - - // Turn the motor(s) both directions - sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(fr_mm_m, 1, 3, str2)); - gcode.process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(max, 1, 3, str1), str2); - gcode.process_subcommands_now(gcode_string); - - planner.synchronize(); -} - -/** - * - * M916: Increase KVAL_HOLD until thermal warning - * - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * 3 - monitor only Z3, E3 - * - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * F - feedrate - * optional - will use default max feedrate from configuration.h if not specified - * - * K - starting value for KVAL_HOLD (0 - 255) - * optional - will use & report current value from driver if not specified - * - */ - -/** - * This routine is also useful for determining the approximate KVAL_HOLD - * where the stepper stops losing steps. The sound will get noticeably quieter - * as it stops losing steps. - */ - -void GcodeSuite::M916() { - - DEBUG_ECHOLNPGM("M916"); - - // Variables used by L6470_get_user_input function - some may not be used - char axis_mon[3][3] = { " ", " ", " " }; // list of Axes to be monitored - uint8_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max; - float position_min; - feedRate_t final_fr_mm_m; - uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; - uint16_t over_current_threshold; - constexpr bool over_current_flag = false; // M916 doesn't play with the overcurrent thresholds - - uint8_t j; // general purpose counter - - 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_fr_mm_m); - - planner.synchronize(); // Wait for moves to finish - - for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear out error flags - - uint16_t status_composite = 0; - - DEBUG_ECHOLNPGM(".\n."); - - do { - - DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); // set & report KVAL_HOLD for this run - - for (j = 0; j < driver_count; j++) - 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_fr_mm_m); - - status_composite = 0; // clear out the old bits - - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low - status_composite |= axis_status[j] ; - } - - if (status_composite && (status_composite & STATUS_UVLO)) { - DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } - return; - } - - // increment KVAL_HOLD if not yet at thermal warning/shutdown - if (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) - kval_hold++; - - } while (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) && kval_hold); // exit when kval_hold == 0 (rolls over) - - DEBUG_ECHOPGM(".\n.\nThermal warning/shutdown "); - if ((status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) { - DEBUG_ECHOLNPGM("has occurred"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } - } - else - DEBUG_ECHOLNPGM("(Unable to get)"); - - DEBUG_ECHOLNPGM("."); -} - -/** - * - * M917: Find minimum current thresholds - * - * Decrease OCD current until overcurrent error - * Increase OCD until overcurrent error goes away - * Decrease stall threshold until stall - * Increase stall until stall error goes away - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * F - feedrate - * optional - will use default max feedrate from Configuration.h if not specified - * - * I - starting over-current threshold - * optional - will report current value from driver if not specified - * if there are multiple drivers on the axis then all will be set the same - * - * K - value for KVAL_HOLD (0 - 255) - * optional - will report current value from driver if not specified - * - */ -void GcodeSuite::M917() { - - DEBUG_ECHOLNPGM("M917"); - - char axis_mon[3][3] = { " ", " ", " " }; // list of axes to be monitored - uint8_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max; - float position_min; - feedRate_t final_fr_mm_m; - uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; - uint16_t over_current_threshold; - constexpr bool over_current_flag = true; - - uint8_t j; // general purpose counter - - 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_fr_mm_m); - - planner.synchronize(); // Wait for moves to finish - for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear out error flags - uint16_t status_composite = 0; - uint8_t test_phase = 0; - // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL) - // 1 - increasing OCD - exit when OCD warning stops (ignore STALL) - - // 2 - OCD finalized - decreasing STALL - exit when STALL warning happens - // 3 - OCD finalized - increasing STALL - exit when STALL warning stop - // 4 - all testing completed - DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (ocd_th_val + 1) * 375); // first status display - DEBUG_ECHOPAIR(" (OCD_TH: : ", ocd_th_val); - DEBUG_ECHOPAIR(") Stall threshold: ", (stall_th_val + 1) * 31.25); - DEBUG_ECHOPAIR(" (STALL_TH: ", stall_th_val); - DEBUG_ECHOLNPGM(")"); - - do { - - 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_fr_mm_m); - - status_composite = 0; // clear out the old bits - - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low - status_composite |= axis_status[j]; - } - - if (status_composite && (status_composite & STATUS_UVLO)) { - DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } - return; - } - - if (status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) { - DEBUG_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down "); - uint16_t status_composite_temp = 0; - uint8_t k = 0; - do { - k++; - if (!(k % 4)) { - kval_hold *= 0.95; - L6470_EOL(); - DEBUG_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold); - for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - } - DEBUG_ECHOLNPGM("."); - reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered - watchdog_refresh(); - safe_delay(5000); - status_composite_temp = 0; - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low - status_composite_temp |= axis_status[j]; - } - } - while (status_composite_temp & (STATUS_TH_WRN | STATUS_TH_SD)); - L6470_EOL(); - } - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B | STATUS_OCD)) { - switch (test_phase) { - - case 0: { - if (status_composite & STATUS_OCD) { - // phase 0 with OCD warning - time to go to next phase - if (ocd_th_val >=15) { - ocd_th_val = 15; // limit to max - test_phase = 2; // at highest value so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2"); - } - else { - ocd_th_val++; // normal exit to next phase - test_phase = 1; // setup for first pass of phase 1 - DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD & go to 1"); - } - } - else { // phase 0 without OCD warning - keep on decrementing if can - if (ocd_th_val) { - ocd_th_val--; // try lower value - DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD"); - } - else { - test_phase = 2; // at lowest value without warning so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2"); - } - } - } break; - - case 1: { - if (status_composite & STATUS_OCD) { - // phase 1 with OCD warning - increment if can - if (ocd_th_val >= 15) { - ocd_th_val = 15; // limit to max - test_phase = 2; // at highest value so go to next phase - DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); - } - else { - ocd_th_val++; // try a higher value - DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD"); - } - } - else { // phase 1 without OCD warning - normal exit to phase 2 - test_phase = 2; - DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1"); - } - } break; - - case 2: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { - // phase 2 with stall warning - time to go to next phase - if (stall_th_val >= 127) { - stall_th_val = 127; // limit to max - DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); - DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); - test_phase = 4; - } - else { - test_phase = 3; // normal exit to next phase (found failing value of STALL) - stall_th_val++; // setup for first pass of phase 3 - DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3"); - } - } - else { // phase 2 without stall warning - decrement if can - if (stall_th_val) { - stall_th_val--; // try a lower value - DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); - } - else { - DEBUG_ECHOLNPGM("finished - STALL at lowest value but still do NOT have stall warning"); - test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit"); - } - } - } break; - - case 3: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { - // phase 3 with stall warning - increment if can - if (stall_th_val >= 127) { - stall_th_val = 127; // limit to max - DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); - test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit"); - } - else { - stall_th_val++; // still looking for passing value - DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); - } - } - else { //phase 3 without stall warning but have OCD warning - DEBUG_ECHOLNPGM("Hardware problem - OCD warning without STALL warning"); - test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)"); - } - } break; - - } - - } - else { - switch (test_phase) { - case 0: { // phase 0 without OCD warning - keep on decrementing if can - if (ocd_th_val) { - ocd_th_val--; // try lower value - DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD"); - } - else { - test_phase = 2; // at lowest value without warning so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)"); - } - } break; - - case 1: DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2 - - case 2: { // phase 2 without stall warning - keep on decrementing if can - if (stall_th_val) { - stall_th_val--; // try a lower value (stay in phase 2) - DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL"); - } - else { - DEBUG_ECHOLNPGM("finished - STALL at lowest value but still no stall warning"); - test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)"); - } - } break; - - case 3: { test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC N3 - finished!"); - } break; // phase 3 without any warnings - desired exit - } // - } // end of status checks - - if (test_phase != 4) { - for (j = 0; j < driver_count; j++) { // update threshold(s) - L6470.set_param(axis_index[j], L6470_OCD_TH, ocd_th_val); - L6470.set_param(axis_index[j], L6470_STALL_TH, stall_th_val); - if (L6470.get_param(axis_index[j], L6470_OCD_TH) != ocd_th_val) DEBUG_ECHOLNPGM("OCD mismatch"); - if (L6470.get_param(axis_index[j], L6470_STALL_TH) != stall_th_val) DEBUG_ECHOLNPGM("STALL mismatch"); - } - } - - } while (test_phase != 4); - - if (status_composite) { - DEBUG_ECHOLNPGM("Completed with errors"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } - } - else - DEBUG_ECHOLNPGM("Completed with no errors"); - -} // M917 - -/** - * - * M918: increase speed until error or max feedrate achieved (as shown in configuration.h)) - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * I - over current threshold - * optional - will report current value from driver if not specified - * - * K - value for KVAL_HOLD (0 - 255) (optional) - * optional - will report current value from driver if not specified - * - */ -void GcodeSuite::M918() { - - DEBUG_ECHOLNPGM("M918"); - - char axis_mon[3][3] = { " ", " ", " " }; // List of axes to monitor - uint8_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max, position_min; - feedRate_t final_fr_mm_m; - uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; - uint16_t over_current_threshold; - constexpr bool over_current_flag = true; - - uint8_t j; // general purpose counter - - 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'); - LIMIT(m_steps, 0, 128); - DEBUG_ECHOLNPAIR("M = ", m_steps); - - int8_t m_bits = -1; - if (m_steps > 85) m_bits = 7; // 128 (no synch output) - else if (m_steps > 42) m_bits = 6; // 64 (no synch output) - else if (m_steps > 22) m_bits = 5; // 32 (no synch output) - else if (m_steps > 12) m_bits = 4; // 16 (no synch output) - else if (m_steps > 5) m_bits = 3; // 8 (no synch output) - else if (m_steps > 2) m_bits = 2; // 4 (no synch output) - else if (m_steps == 2) m_bits = 1; // 2 (no synch output) - else if (m_steps == 1) m_bits = 0; // 1 (no synch output) - else if (m_steps == 0) m_bits = 7; // 128 (no synch output) - - if (m_bits >= 0) { - const int micros = _BV(m_bits); - if (micros < 100) { DEBUG_CHAR(' '); if (micros < 10) DEBUG_CHAR(' '); } - DEBUG_ECHO(micros); - DEBUG_ECHOPGM(" uSTEPS"); - } - - 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_fr_mm_m); - - planner.synchronize(); // Wait for moves to finish - - for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear all error flags - - uint16_t status_composite = 0; - DEBUG_ECHOLNPGM(".\n.\n."); // Make the feedrate prints easier to see - - 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, 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 - } - - DEBUG_ECHOPGM("Completed with errors"); - if (status_composite) { - DEBUG_ECHOLNPGM("errors"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } - } - else - DEBUG_ECHOLNPGM("no errors"); - -} // M918 - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/advance/M900.cpp deleted file mode 100644 index f030511422..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/advance/M900.cpp +++ /dev/null @@ -1,142 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(LIN_ADVANCE) - -#include "../../gcode.h" -#include "../../../module/planner.h" -#include "../../../module/stepper.h" - -#if ENABLED(EXTRA_LIN_ADVANCE_K) - float saved_extruder_advance_K[EXTRUDERS]; - uint8_t lin_adv_slot = 0; -#endif - - -/** - * M900: Get or Set Linear Advance K-factor - * T Which tool to address - * K Set current advance K factor (Slot 0). - * L Set secondary advance K factor (Slot 1). Requires EXTRA_LIN_ADVANCE_K. - * S<0/1> Activate slot 0 or 1. Requires EXTRA_LIN_ADVANCE_K. - */ -void GcodeSuite::M900() { - - #if EXTRUDERS < 2 - constexpr uint8_t tool_index = 0; - #else - const uint8_t tool_index = parser.intval('T', active_extruder); - if (tool_index >= EXTRUDERS) { - SERIAL_ECHOLNPGM("?T value out of range."); - return; - } - #endif - - #if ENABLED(EXTRA_LIN_ADVANCE_K) - - bool ext_slot = TEST(lin_adv_slot, tool_index); - - if (parser.seenval('S')) { - const bool slot = parser.value_bool(); - if (ext_slot != slot) { - ext_slot = slot; - SET_BIT_TO(lin_adv_slot, tool_index, slot); - planner.synchronize(); - const float temp = planner.extruder_advance_K[tool_index]; - planner.extruder_advance_K[tool_index] = saved_extruder_advance_K[tool_index]; - saved_extruder_advance_K[tool_index] = temp; - } - } - - if (parser.seenval('K')) { - const float newK = parser.value_float(); - if (WITHIN(newK, 0, 10)) { - if (ext_slot) - saved_extruder_advance_K[tool_index] = newK; - else { - planner.synchronize(); - planner.extruder_advance_K[tool_index] = newK; - } - } - else - SERIAL_ECHOLNPGM("?K value out of range (0-10)."); - } - - if (parser.seenval('L')) { - const float newL = parser.value_float(); - if (WITHIN(newL, 0, 10)) { - if (!ext_slot) - saved_extruder_advance_K[tool_index] = newL; - else { - planner.synchronize(); - planner.extruder_advance_K[tool_index] = newL; - } - } - else - SERIAL_ECHOLNPGM("?L value out of range (0-10)."); - } - - if (!parser.seen_any()) { - #if EXTRUDERS < 2 - 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], - "(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); - SERIAL_EOL(); - } - #endif - } - - #else - - if (parser.seenval('K')) { - const float newK = parser.value_float(); - if (WITHIN(newK, 0, 10)) { - planner.synchronize(); - planner.extruder_advance_K[tool_index] = newK; - } - else - SERIAL_ECHOLNPGM("?K value out of range (0-10)."); - } - else { - SERIAL_ECHO_START(); - #if EXTRUDERS < 2 - SERIAL_ECHOLNPAIR("Advance K=", planner.extruder_advance_K[0]); - #else - SERIAL_ECHOPGM("Advance K"); - LOOP_L_N(i, EXTRUDERS) { - SERIAL_CHAR(' '); SERIAL_ECHO(int(i)); - SERIAL_CHAR('='); SERIAL_ECHO(planner.extruder_advance_K[i]); - } - SERIAL_EOL(); - #endif - } - - #endif -} - -#endif // LIN_ADVANCE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/baricuda/M126-M129.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/baricuda/M126-M129.cpp deleted file mode 100644 index 3c1588d806..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/baricuda/M126-M129.cpp +++ /dev/null @@ -1,58 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(BARICUDA) - -#include "../../gcode.h" -#include "../../../feature/baricuda.h" - -#if HAS_HEATER_1 - - /** - * M126: Heater 1 valve open - */ - void GcodeSuite::M126() { baricuda_valve_pressure = parser.byteval('S', 255); } - - /** - * M127: Heater 1 valve close - */ - void GcodeSuite::M127() { baricuda_valve_pressure = 0; } - -#endif // HAS_HEATER_1 - -#if HAS_HEATER_2 - - /** - * M128: Heater 2 valve open - */ - void GcodeSuite::M128() { baricuda_e_to_p_pressure = parser.byteval('S', 255); } - - /** - * M129: Heater 2 valve close - */ - void GcodeSuite::M129() { baricuda_e_to_p_pressure = 0; } - -#endif // HAS_HEATER_2 - -#endif // BARICUDA diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/camera/M240.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/camera/M240.cpp deleted file mode 100644 index 50b47f3978..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/camera/M240.cpp +++ /dev/null @@ -1,177 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(PHOTO_GCODE) - -#include "../../gcode.h" -#include "../../../module/motion.h" // for active_extruder and current_position - -#if PIN_EXISTS(CHDK) - millis_t chdk_timeout; // = 0 -#endif - -#ifdef PHOTO_POSITION && PHOTO_DELAY_MS > 0 - #include "../../../Marlin.h" // for idle() -#endif - -#ifdef PHOTO_RETRACT_MM - - #define _PHOTO_RETRACT_MM (PHOTO_RETRACT_MM + 0) - - #include "../../../module/planner.h" - #include "../../../module/temperature.h" - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../../../feature/pause.h" - #endif - - #ifdef PHOTO_RETRACT_MM - 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); - #else - current_position.e += length / planner.e_factor[active_extruder]; - line_to_current_position(fr_mm_s); - #endif - } - } - #endif - -#endif - -#if PIN_EXISTS(PHOTOGRAPH) - constexpr uint8_t NUM_PULSES = 16; - constexpr float PULSE_LENGTH = 0.01524; - inline void set_photo_pin(const uint8_t state) { WRITE(PHOTOGRAPH_PIN, state); _delay_ms(PULSE_LENGTH); } - inline void tweak_photo_pin() { set_photo_pin(HIGH); set_photo_pin(LOW); } - inline void spin_photo_pin() { for (uint8_t i = NUM_PULSES; i--;) tweak_photo_pin(); } -#endif - -/** - * M240: Trigger a camera by... - * - * - CHDK : Emulate a Canon RC-1 with a configurable ON duration. - * http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ - * - PHOTOGRAPH_PIN : Pulse a digital pin 16 times. - * See http://www.doc-diy.net/photo/rc-1_hacked/ - * - PHOTO_SWITCH_POSITION : Bump a physical switch with the X-carriage using a - * configured position, delay, and retract length. - * - * PHOTO_POSITION parameters: - * A - X offset to the return position - * B - Y offset to the return position - * F - Override the XY movement feedrate - * R - Retract/recover length (current units) - * S - Retract/recover feedrate (mm/m) - * X - Move to X before triggering the shutter - * Y - Move to Y before triggering the shutter - * Z - Raise Z by a distance before triggering the shutter - * - * PHOTO_SWITCH_POSITION parameters: - * D - Duration (ms) to hold down switch (Requires PHOTO_SWITCH_MS) - * P - Delay (ms) after triggering the shutter (Requires PHOTO_SWITCH_MS) - * I - Switch trigger position override X - * J - Switch trigger position override Y - */ -void GcodeSuite::M240() { - - #ifdef PHOTO_POSITION - - if (axis_unhomed_error()) return; - - const xyz_pos_t old_pos = { - current_position.x + parser.linearval('A'), - current_position.y + parser.linearval('B'), - current_position.z - }; - - #ifdef PHOTO_RETRACT_MM - 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) - RETRACT_FEEDRATE - #else - 45 - #endif - ); - if (parser.seenval('S')) sval = parser.value_feedrate(); - e_move_m240(-rval, sval); - #endif - - feedRate_t fr_mm_s = MMM_TO_MMS(parser.linearval('F')); - if (fr_mm_s) NOLESS(fr_mm_s, 10.0f); - - constexpr xyz_pos_t photo_position = PHOTO_POSITION; - xyz_pos_t raw = { - parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : photo_position.x, - parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_position.y, - (parser.seenval('Z') ? parser.value_linear_units() : photo_position.z) + current_position.z - }; - apply_motion_limits(raw); - do_blocking_move_to(raw, fr_mm_s); - - #ifdef PHOTO_SWITCH_POSITION - constexpr xy_pos_t photo_switch_position = PHOTO_SWITCH_POSITION; - const xy_pos_t sraw = { - parser.seenval('I') ? RAW_X_POSITION(parser.value_linear_units()) : photo_switch_position.x, - parser.seenval('J') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_switch_position.y - }; - do_blocking_move_to_xy(sraw, get_homing_bump_feedrate(X_AXIS)); - #if PHOTO_SWITCH_MS > 0 - safe_delay(parser.intval('D', PHOTO_SWITCH_MS)); - #endif - do_blocking_move_to(raw); - #endif - - #endif - - #if PIN_EXISTS(CHDK) - - OUT_WRITE(CHDK_PIN, HIGH); - chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS); - - #elif HAS_PHOTOGRAPH - - spin_photo_pin(); - delay(7.33); - spin_photo_pin(); - - #endif - - #ifdef PHOTO_POSITION - #if PHOTO_DELAY_MS > 0 - const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS); - while (PENDING(millis(), timeout)) idle(); - #endif - do_blocking_move_to(old_pos, fr_mm_s); - #ifdef PHOTO_RETRACT_MM - e_move_m240(rval, sval); - #endif - #endif -} - -#endif // PHOTO_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/cancel/M486.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/cancel/M486.cpp deleted file mode 100644 index 2fcb4840f6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/cancel/M486.cpp +++ /dev/null @@ -1,57 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(CANCEL_OBJECTS) - -#include "../../gcode.h" -#include "../../../feature/cancel_object.h" - -/** - * M486: A simple interface to cancel objects - * - * T[count] : Reset objects and/or set the count - * S : Start an object with the given index - * P : Cancel the object with the given index - * U : Un-cancel object with the given index - * C : Cancel the current object (the last index given by S) - * S-1 : Start a non-object like a brim or purge tower that should always print - */ -void GcodeSuite::M486() { - - if (parser.seen('T')) { - cancelable.reset(); - cancelable.object_count = parser.intval('T', 1); - } - - if (parser.seen('S')) - cancelable.set_active_object(parser.value_int()); - - if (parser.seen('C')) cancelable.cancel_active_object(); - - if (parser.seen('P')) cancelable.cancel_object(parser.value_int()); - - if (parser.seen('U')) cancelable.uncancel_object(parser.value_int()); -} - -#endif // CANCEL_OBJECTS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/caselight/M355.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/caselight/M355.cpp deleted file mode 100644 index e9ee0a4977..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/caselight/M355.cpp +++ /dev/null @@ -1,64 +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 . - * - */ - -#include "../../gcode.h" - -#include "../../../inc/MarlinConfig.h" - -#if HAS_CASE_LIGHT - #include "../../../feature/caselight.h" - - /** - * M355: Turn case light on/off and set brightness - * - * P Set case light brightness (PWM pin required - ignored otherwise) - * - * S Set case light on/off - * - * When S turns on the light on a PWM pin then the current brightness level is used/restored - * - * M355 P200 S0 turns off the light & sets the brightness level - * M355 S1 turns on the light with a brightness of 200 (assuming a PWM pin) - */ - void GcodeSuite::M355() { - uint8_t args = 0; - if (parser.seenval('P')) { - ++args, case_light_brightness = parser.value_byte(); - case_light_arg_flag = false; - } - if (parser.seenval('S')) { - ++args, case_light_on = parser.value_bool(); - case_light_arg_flag = true; - } - if (args) update_case_light(); - - // always report case light status - SERIAL_ECHO_START(); - if (!case_light_on) { - SERIAL_ECHOLNPGM("Case light: off"); - } - else { - if (!PWM_PIN(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on"); - else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness); - } - } -#endif // HAS_CASE_LIGHT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/clean/G12.cpp deleted file mode 100644 index 30c71264eb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/clean/G12.cpp +++ /dev/null @@ -1,66 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - -#include "../../../libs/nozzle.h" - -#include "../../gcode.h" -#include "../../parser.h" -#include "../../../module/motion.h" - -#if HAS_LEVELING - #include "../../../module/planner.h" - #include "../../../feature/bedlevel/bedlevel.h" -#endif - -/** - * G12: Clean the nozzle - */ -void GcodeSuite::G12() { - // Don't allow nozzle cleaning without homing first - if (axis_unhomed_error()) return; - - const uint8_t pattern = parser.ushortval('P', 0), - strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), - objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); - const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); - - const bool seenxyz = parser.seen("XYZ"); - const uint8_t cleans = (!seenxyz || parser.boolval('X') ? _BV(X_AXIS) : 0) - | (!seenxyz || parser.boolval('Y') ? _BV(Y_AXIS) : 0) - #if DISABLED(NOZZLE_CLEAN_NO_Z) - | (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0) - #endif - ; - - #if HAS_LEVELING - // Disable bed leveling if cleaning Z - TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); - #endif - - nozzle.clean(pattern, strokes, radius, objects, cleans); -} - -#endif // NOZZLE_CLEAN_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/digipot/M907-M910.cpp deleted file mode 100644 index a7546b2833..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ /dev/null @@ -1,106 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) - -#include "../../gcode.h" - -#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - #include "../../../module/stepper.h" -#endif - -#if ENABLED(DIGIPOT_I2C) - #include "../../../feature/digipot/digipot.h" -#endif - -#if ENABLED(DAC_STEPPER_CURRENT) - #include "../../../feature/dac/stepper_dac.h" -#endif - -/** - * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S - */ -void GcodeSuite::M907() { - #if HAS_DIGIPOTSS - - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.digipot_current(i, parser.value_int()); - if (parser.seenval('B')) stepper.digipot_current(4, parser.value_int()); - if (parser.seenval('S')) for (uint8_t i = 0; i <= 4; i++) stepper.digipot_current(i, parser.value_int()); - - #elif HAS_MOTOR_CURRENT_PWM - - #if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY) - if (parser.seenval('X') || parser.seenval('Y')) stepper.digipot_current(0, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - if (parser.seenval('Z')) stepper.digipot_current(1, parser.value_int()); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - if (parser.seenval('E')) stepper.digipot_current(2, parser.value_int()); - #endif - - #endif - - #if ENABLED(DIGIPOT_I2C) - // this one uses actual amps in floating point - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float()); - // Additional extruders use B,C,D for channels 4,5,6. - // TODO: Change these parameters because 'E' is used. B? - for (uint8_t i = E_AXIS + 1; i < DIGIPOT_I2C_NUM_CHANNELS; i++) - if (parser.seenval('B' + i - (E_AXIS + 1))) digipot_i2c_set_current(i, parser.value_float()); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - if (parser.seenval('S')) { - const float dac_percent = parser.value_float(); - for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent); - } - LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) dac_current_percent(i, parser.value_float()); - #endif -} - -#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - - /** - * M908: Control digital trimpot directly (M908 P S) - */ - void GcodeSuite::M908() { - #if HAS_DIGIPOTSS - stepper.digitalPotWrite(parser.intval('P'), parser.intval('S')); - #endif - #if ENABLED(DAC_STEPPER_CURRENT) - dac_current_raw(parser.byteval('P', -1), parser.ushortval('S', 0)); - #endif - } - -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT - -#if ENABLED(DAC_STEPPER_CURRENT) - - void GcodeSuite::M909() { dac_print_values(); } - void GcodeSuite::M910() { dac_commit_eeprom(); } - -#endif // DAC_STEPPER_CURRENT - -#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT || HAS_MOTOR_CURRENT_PWM || DIGIPOT_I2C diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/filwidth/M404-M407.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/filwidth/M404-M407.cpp deleted file mode 100644 index 5b58416b43..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ /dev/null @@ -1,72 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - -#include "../../../feature/filwidth.h" -#include "../../../module/planner.h" -#include "../../../module/temperature.h" -#include "../../../Marlin.h" -#include "../../gcode.h" - -/** - * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> - */ -void GcodeSuite::M404() { - 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):", filwidth.nominal_mm); -} - -/** - * M405: Turn on filament sensor for control - */ -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.seenval('D')) - filwidth.set_delay_cm(parser.value_byte()); - - filwidth.enable(true); -} - -/** - * M406: Turn off filament sensor for control - */ -void GcodeSuite::M406() { - filwidth.enable(false); - planner.calculate_volumetric_multipliers(); // Restore correct 'volumetric_multiplier' value -} - -/** - * M407: Get measured filament diameter on serial output - */ -void GcodeSuite::M407() { - SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filwidth.measured_mm); -} - -#endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/G10_G11.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/G10_G11.cpp deleted file mode 100644 index 2b2f2f1c65..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/G10_G11.cpp +++ /dev/null @@ -1,51 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(FWRETRACT) - -#include "../../../feature/fwretract.h" -#include "../../gcode.h" -#include "../../../module/motion.h" - -/** - * G10 - Retract filament according to settings of M207 - * TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings - */ -void GcodeSuite::G10() { - #if EXTRUDERS > 1 - const bool rs = parser.boolval('S'); - #endif - fwretract.retract(true - #if EXTRUDERS > 1 - , rs - #endif - ); -} - -/** - * G11 - Recover filament according to settings of M208 - */ -void GcodeSuite::G11() { fwretract.retract(false); } - -#endif // FWRETRACT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/M207-M209.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/M207-M209.cpp deleted file mode 100644 index 316433fa46..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/fwretract/M207-M209.cpp +++ /dev/null @@ -1,74 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(FWRETRACT) - -#include "../../../feature/fwretract.h" -#include "../../gcode.h" - -/** - * M207: Set firmware retraction values - * - * S[+units] retract_length - * W[+units] swap_retract_length (multi-extruder) - * F[units/min] retract_feedrate_mm_s - * Z[units] retract_zraise - */ -void GcodeSuite::M207() { - if (parser.seen('S')) fwretract.settings.retract_length = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('Z')) fwretract.settings.retract_zraise = parser.value_linear_units(); - if (parser.seen('W')) fwretract.settings.swap_retract_length = parser.value_axis_units(E_AXIS); -} - -/** - * M208: Set firmware un-retraction values - * - * S[+units] retract_recover_extra (in addition to M207 S*) - * W[+units] swap_retract_recover_extra (multi-extruder) - * F[units/min] retract_recover_feedrate_mm_s - * R[units/min] swap_retract_recover_feedrate_mm_s - */ -void GcodeSuite::M208() { - if (parser.seen('S')) fwretract.settings.retract_recover_extra = parser.value_axis_units(E_AXIS); - if (parser.seen('F')) fwretract.settings.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('R')) fwretract.settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('W')) fwretract.settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS); -} - -#if ENABLED(FWRETRACT_AUTORETRACT) - - /** - * M209: Enable automatic retract (M209 S1) - * For slicers that don't support G10/11, reversed extrude-only - * moves will be classified as retraction. - */ - void GcodeSuite::M209() { - if (MIN_AUTORETRACT <= MAX_AUTORETRACT && parser.seen('S')) - fwretract.enable_autoretract(parser.value_bool()); - } - -#endif // FWRETRACT_AUTORETRACT - -#endif // FWRETRACT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/i2c/M260_M261.cpp deleted file mode 100644 index 48ab48959a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ /dev/null @@ -1,77 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(EXPERIMENTAL_I2CBUS) - -#include "../../gcode.h" - -#include "../../../Marlin.h" // for i2c - -/** - * M260: Send data to a I2C slave device - * - * This is a PoC, the formating and arguments for the GCODE will - * change to be more compatible, the current proposal is: - * - * M260 A ; Sets the I2C slave address the data will be sent to - * - * M260 B - * M260 B - * M260 B - * - * M260 S1 ; Send the buffered data and reset the buffer - * M260 R1 ; Reset the buffer without sending data - * - */ -void GcodeSuite::M260() { - // Set the target address - if (parser.seen('A')) i2c.address(parser.value_byte()); - - // Add a new byte to the buffer - if (parser.seen('B')) i2c.addbyte(parser.value_byte()); - - // Flush the buffer to the bus - if (parser.seen('S')) i2c.send(); - - // Reset and rewind the buffer - else if (parser.seen('R')) i2c.reset(); -} - -/** - * M261: Request X bytes from I2C slave device - * - * Usage: M261 A B - */ -void GcodeSuite::M261() { - if (parser.seen('A')) i2c.address(parser.value_byte()); - - uint8_t bytes = parser.byteval('B', 1); - - if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) - i2c.relay(bytes); - else - SERIAL_ERROR_MSG("Bad i2c request"); -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M150.cpp deleted file mode 100644 index 405be898ae..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M150.cpp +++ /dev/null @@ -1,57 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_COLOR_LEDS - -#include "../../gcode.h" -#include "../../../feature/leds/leds.h" - -/** - * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W - * and Brightness - Use P (for NEOPIXEL only) - * - * Always sets all 3 or 4 components. If a component is left out, set to 0. - * If brightness is left out, no value changed - * - * Examples: - * - * M150 R255 ; Turn LED red - * M150 R255 U127 ; Turn LED orange (PWM only) - * M150 ; Turn LED off - * M150 R U B ; Turn LED white - * M150 W ; Turn LED white using a white LED - * M150 P127 ; Set LED 50% brightness - * M150 P ; Set LED full brightness - */ -void GcodeSuite::M150() { - leds.set_color(MakeLEDColor( - parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : neo.brightness() - )); -} - -#endif // HAS_COLOR_LEDS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M7219.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M7219.cpp deleted file mode 100644 index c3d2643535..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/leds/M7219.cpp +++ /dev/null @@ -1,93 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(MAX7219_GCODE) - -#include "../../gcode.h" -#include "../../../feature/Max7219_Debug_LEDs.h" - -/** - * M7219: Control the Max7219 LED matrix - * - * I - Initialize (clear) the matrix - * F - Fill the matrix (set all bits) - * P - Dump the led_line[] array values - * C - Set a column to the bitmask given by 'V' (Units 0-3 in portrait layout) - * R - Set a row to the bitmask given by 'V' (Units 0-3 in landscape layout) - * X - X index of an LED to set or toggle - * Y - Y index of an LED to set or toggle - * V - LED on/off state or row/column bitmask (8, 16, 24, or 32-bits) - * ('C' / 'R' can be used to update up to 4 units at once) - * - * Directly set a native matrix row to the 8-bit value 'V': - * D - Display line (0..7) - * U - Unit index (0..MAX7219_NUMBER_UNITS-1) - */ -void GcodeSuite::M7219() { - if (parser.seen('I')) { - max7219.register_setup(); - max7219.clear(); - } - - if (parser.seen('F')) max7219.fill(); - - const uint32_t v = parser.ulongval('V'); - - if (parser.seenval('R')) { - const uint8_t r = parser.value_byte(); - max7219.set_row(r, v); - } - else if (parser.seenval('C')) { - const uint8_t c = parser.value_byte(); - max7219.set_column(c, v); - } - else if (parser.seenval('X') || parser.seenval('Y')) { - const uint8_t x = parser.byteval('X'), y = parser.byteval('Y'); - if (parser.seenval('V')) - max7219.led_set(x, y, v > 0); - else - max7219.led_toggle(x, y); - } - else if (parser.seen('D')) { - const uint8_t uline = parser.value_byte() & 0x7, - line = uline + (parser.byteval('U') << 3); - if (line < MAX7219_LINES) { - max7219.led_line[line] = v; - return max7219.refresh_line(line); - } - } - - if (parser.seen('P')) { - for (uint8_t r = 0; r < MAX7219_LINES; r++) { - SERIAL_ECHOPGM("led_line["); - if (r < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(int(r)); - SERIAL_ECHOPGM("]="); - for (uint8_t b = 8; b--;) SERIAL_CHAR('0' + TEST(max7219.led_line[r], b)); - SERIAL_EOL(); - } - } -} - -#endif // MAX7219_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/macro/M810-M819.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/macro/M810-M819.cpp deleted file mode 100644 index ea90229c38..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/macro/M810-M819.cpp +++ /dev/null @@ -1,65 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(GCODE_MACROS) - -#include "../../gcode.h" -#include "../../queue.h" -#include "../../parser.h" - -char gcode_macros[GCODE_MACROS_SLOTS][GCODE_MACROS_SLOT_SIZE + 1] = {{ 0 }}; - -/** - * M810_819: Set/execute a G-code macro. - * - * Usage: - * M810 |... Set Macro 0 to the given commands, separated by the pipe character - * M810 Execute Macro 0 - */ -void GcodeSuite::M810_819() { - const uint8_t index = parser.codenum - 810; - if (index >= GCODE_MACROS_SLOTS) return; - - const size_t len = strlen(parser.string_arg); - - if (len) { - // Set a macro - if (len > GCODE_MACROS_SLOT_SIZE) - SERIAL_ERROR_MSG("Macro too long."); - else { - char c, *s = parser.string_arg, *d = gcode_macros[index]; - do { - c = *s++; - *d++ = c == '|' ? '\n' : c; - } while (c); - } - } - else { - // Execute a macro - char * const cmd = gcode_macros[index]; - if (strlen(cmd)) process_subcommands_now(cmd); - } -} - -#endif // GCODE_MACROS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M163-M165.cpp deleted file mode 100644 index cc0a468366..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ /dev/null @@ -1,101 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(MIXING_EXTRUDER) - -#include "../../gcode.h" -#include "../../../feature/mixing.h" - -/** - * M163: Set a single mix factor for a mixing extruder - * This is called "weight" by some systems. - * Must be followed by M164 to normalize and commit them. - * - * S[index] The channel index to set - * P[float] The mix value - */ -void GcodeSuite::M163() { - const int mix_index = parser.intval('S'); - if (mix_index < MIXING_STEPPERS) - mixer.set_collector(mix_index, parser.floatval('P')); -} - -/** - * M164: Normalize and commit the mix. - * - * S[index] The virtual tool to store - * If 'S' is omitted update the active virtual tool. - */ -void GcodeSuite::M164() { - #if MIXING_VIRTUAL_TOOLS > 1 - const int tool_index = parser.intval('S', -1); - #else - constexpr int tool_index = 0; - #endif - if (tool_index >= 0) { - if (tool_index < MIXING_VIRTUAL_TOOLS) - mixer.normalize(tool_index); - } - else - mixer.normalize(); -} - -#if ENABLED(DIRECT_MIXING_IN_G1) - - /** - * M165: Set multiple mix factors for a mixing extruder. - * Omitted factors will be set to 0. - * The mix is normalized and stored in the current virtual tool. - * - * A[factor] Mix factor for extruder stepper 1 - * B[factor] Mix factor for extruder stepper 2 - * C[factor] Mix factor for extruder stepper 3 - * D[factor] Mix factor for extruder stepper 4 - * H[factor] Mix factor for extruder stepper 5 - * I[factor] Mix factor for extruder stepper 6 - */ - void GcodeSuite::M165() { - // Get mixing parameters from the GCode - // The total "must" be 1.0 (but it will be normalized) - // If no mix factors are given, the old mix is preserved - const char mixing_codes[] = { LIST_N(MIXING_STEPPERS, 'A', 'B', 'C', 'D', 'H', 'I') }; - uint8_t mix_bits = 0; - MIXER_STEPPER_LOOP(i) { - if (parser.seenval(mixing_codes[i])) { - SBI(mix_bits, i); - mixer.set_collector(i, parser.value_float()); - } - } - // If any mixing factors were included, clear the rest - // If none were included, preserve the last mix - if (mix_bits) { - MIXER_STEPPER_LOOP(i) - if (!TEST(mix_bits, i)) mixer.set_collector(i, 0.0f); - mixer.normalize(); - } - } - -#endif // DIRECT_MIXING_IN_G1 - -#endif // MIXING_EXTRUDER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M166.cpp deleted file mode 100644 index cb3541eb8f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/mixing/M166.cpp +++ /dev/null @@ -1,96 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(GRADIENT_MIX) - -#include "../../gcode.h" -#include "../../../module/motion.h" -#include "../../../module/planner.h" -#include "../../../feature/mixing.h" - -inline void echo_mix() { - 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_P(SP_Z_STR, z, PSTR(" T"), t); - echo_mix(); -} - -/** - * M166: Set a simple gradient mix for a two-component mixer - * based on the Geeetech A10M implementation by Jone Liu. - * - * S[bool] - Enable / disable gradients - * A[float] - Starting Z for the gradient - * Z[float] - Ending Z for the gradient. (Must be greater than the starting Z.) - * I[index] - V-Tool to use as the starting mix. - * J[index] - V-Tool to use as the ending mix. - * - * T[index] - A V-Tool index to use as an alias for the Gradient (Requires GRADIENT_VTOOL) - * T with no index clears the setting. Note: This can match the I or J value. - * - * Example: M166 S1 A0 Z20 I0 J1 - */ -void GcodeSuite::M166() { - if (parser.seenval('A')) mixer.gradient.start_z = parser.value_float(); - if (parser.seenval('Z')) mixer.gradient.end_z = parser.value_float(); - if (parser.seenval('I')) mixer.gradient.start_vtool = (uint8_t)constrain(parser.value_int(), 0, MIXING_VIRTUAL_TOOLS); - if (parser.seenval('J')) mixer.gradient.end_vtool = (uint8_t)constrain(parser.value_int(), 0, MIXING_VIRTUAL_TOOLS); - - #if ENABLED(GRADIENT_VTOOL) - if (parser.seen('T')) mixer.gradient.vtool_index = parser.byteval('T', -1); - #endif - - if (parser.seen('S')) mixer.gradient.enabled = parser.value_bool(); - - mixer.refresh_gradient(); - - SERIAL_ECHOPGM("Gradient Mix "); - serialprint_onoff(mixer.gradient.enabled); - if (mixer.gradient.enabled) { - - #if ENABLED(GRADIENT_VTOOL) - if (mixer.gradient.vtool_index >= 0) { - SERIAL_ECHOPAIR(" (T", int(mixer.gradient.vtool_index)); - SERIAL_CHAR(')'); - } - #endif - - SERIAL_ECHOPGM(" ; Start"); - echo_zt(mixer.gradient.start_vtool, mixer.gradient.start_z); - - SERIAL_ECHOPGM(" ; End"); - echo_zt(mixer.gradient.end_vtool, mixer.gradient.end_z); - - mixer.update_mix_from_gradient(); - SERIAL_ECHOPAIR(" ; Current Z", planner.get_axis_position_mm(Z_AXIS)); - echo_mix(); - } - - SERIAL_EOL(); -} - -#endif // GRADIENT_MIX diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/G27.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/G27.cpp deleted file mode 100644 index 4f4c9e4698..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/G27.cpp +++ /dev/null @@ -1,41 +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 . - * - */ - - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(NOZZLE_PARK_FEATURE) - -#include "../../gcode.h" -#include "../../../libs/nozzle.h" -#include "../../../module/motion.h" - -/** - * G27: Park the nozzle - */ -void GcodeSuite::G27() { - // Don't allow nozzle parking without homing first - if (axis_unhomed_error()) return; - nozzle.park(parser.ushortval('P')); -} - -#endif // NOZZLE_PARK_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M125.cpp deleted file mode 100644 index 22aaf2c446..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M125.cpp +++ /dev/null @@ -1,95 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(PARK_HEAD_ON_PAUSE) - -#include "../../gcode.h" -#include "../../parser.h" -#include "../../../feature/pause.h" -#include "../../../module/motion.h" -#include "../../../sd/cardreader.h" -#include "../../../module/printcounter.h" - -#if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" -#endif - -/** - * M125: Store current position and move to parking position. - * Called on pause (by M25) to prevent material leaking onto the - * object. On resume (M24) the head will be moved back and the - * print will resume. - * - * When not actively SD printing, M125 simply moves to the park - * position and waits, resuming with a button click or M108. - * Without PARK_HEAD_ON_PAUSE the M125 command does nothing. - * - * L = override retract length - * X = override X - * Y = override Y - * Z = override Z raise - */ -void GcodeSuite::M125() { - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - xyz_pos_t park_point = NOZZLE_PARK_POINT; - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')); - if (parser.seenval('Y')) park_point.y = RAW_X_POSITION(parser.linearval('Y')); - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) - park_point += hotend_offset[active_extruder]; - #endif - - #if ENABLED(SDSUPPORT) - const bool sd_printing = IS_SD_PRINTING(); - #else - constexpr bool sd_printing = false; - #endif - - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_PAUSING, PAUSE_MODE_PAUSE_PRINT); - const bool show_lcd = parser.seenval('P'); - #else - constexpr bool show_lcd = false; - #endif - - if (pause_print(retract, park_point, 0, show_lcd)) { - if (!sd_printing || show_lcd) { - wait_for_confirmation(false, 0); - resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0); - } - } -} - -#endif // PARK_HEAD_ON_PAUSE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M600.cpp deleted file mode 100644 index 4056a398e4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M600.cpp +++ /dev/null @@ -1,181 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - -#include "../../gcode.h" -#include "../../../feature/pause.h" -#include "../../../module/motion.h" -#include "../../../module/printcounter.h" - -#if EXTRUDERS > 1 - #include "../../../module/tool_change.h" -#endif - -#if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" -#endif - -#if ENABLED(MMU2_MENUS) - #include "../../../lcd/menu/menu_mmu2.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../../../feature/mixing.h" -#endif - -/** - * M600: Pause for filament change - * - * E[distance] - Retract the filament this far - * Z[distance] - Move the Z axis by this distance - * X[position] - Move to this X position, with Y - * Y[position] - Move to this Y position, with X - * U[distance] - Retract distance for removal (manual reload) - * L[distance] - Extrude distance for insertion (manual reload) - * B[count] - Number of times to beep, -1 for indefinite (if equipped with a buzzer) - * T[toolhead] - Select extruder for filament change - * - * Default values are used for omitted arguments. - */ -void GcodeSuite::M600() { - - #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; - - const uint8_t old_mixing_tool = mixer.get_current_vtool(); - mixer.T(MIXER_DIRECT_SET_TOOL); - - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(target_e_stepper) ? 1.0 : 0.0); - mixer.normalize(); - - const int8_t target_extruder = active_extruder; - #else - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - int8_t DXC_ext = target_extruder; - if (!parser.seen('T')) { // If no tool index is specified, M600 was (probably) sent in response to filament runout. - // In this case, for duplicating modes set DXC_ext to the extruder that ran out. - #if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1 - if (dxc_is_duplicating()) - DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING) ? 1 : 0; - #else - DXC_ext = active_extruder; - #endif - } - #endif - - // Show initial "wait for start" message - #if HAS_LCD_MENU && DISABLED(MMU2_MENUS) - lcd_pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder); - #endif - - #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) - // Don't allow filament change without homing first - if (axes_need_homing()) home_all_axes(); - #endif - - #if EXTRUDERS > 1 - // Change toolhead if specified - const uint8_t active_extruder_before_filament_change = active_extruder; - if ( - active_extruder != target_extruder - #if ENABLED(DUAL_X_CARRIAGE) - && dual_x_carriage_mode != DXC_DUPLICATION_MODE && dual_x_carriage_mode != DXC_MIRRORED_MODE - #endif - ) tool_change(target_extruder, false); - #endif - - // Initial retract before move to filament change position - const float retract = -ABS(parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 - #ifdef PAUSE_PARK_RETRACT_LENGTH - + (PAUSE_PARK_RETRACT_LENGTH) - #endif - ); - - xyz_pos_t park_point NOZZLE_PARK_POINT; - - // Lift Z axis - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); - - #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) - park_point += hotend_offset[active_extruder]; - #endif - - #if ENABLED(MMU2_MENUS) - // For MMU2 reset retract and load/unload values so they don't mess with MMU filament handling - constexpr float unload_length = 0.5f, - slow_load_length = 0.0f, - fast_load_length = 0.0f; - #else - // Unload filament - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].unload_length); - - // Slow load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - - // Fast load filament - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].load_length); - #endif - - const int beep_count = parser.intval('B', - #ifdef FILAMENT_CHANGE_ALERT_BEEPS - FILAMENT_CHANGE_ALERT_BEEPS - #else - -1 - #endif - ); - - if (pause_print(retract, park_point, unload_length, true DXC_PASS)) { - #if ENABLED(MMU2_MENUS) - mmu2_M600(); - resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS); - #else - wait_for_confirmation(true, beep_count DXC_PASS); - resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS); - #endif - } - - #if EXTRUDERS > 1 - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, false); - #endif - - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif -} - -#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M603.cpp deleted file mode 100644 index 60070821d8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M603.cpp +++ /dev/null @@ -1,66 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - -#include "../../gcode.h" -#include "../../../feature/pause.h" -#include "../../../module/motion.h" -#include "../../../module/printcounter.h" - -#if EXTRUDERS > 1 - #include "../../../module/tool_change.h" -#endif - -/** - * M603: Configure filament change - * - * T[toolhead] - Select extruder to configure, active extruder if not specified - * U[distance] - Retract distance for removal, for the specified extruder - * L[distance] - Extrude distance for insertion, for the specified extruder - * - */ -void GcodeSuite::M603() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - // Unload length - if (parser.seen('U')) { - fc_settings[target_extruder].unload_length = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(fc_settings[target_extruder].unload_length, EXTRUDE_MAXLENGTH); - #endif - } - - // Load length - if (parser.seen('L')) { - fc_settings[target_extruder].load_length = ABS(parser.value_axis_units(E_AXIS)); - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - NOMORE(fc_settings[target_extruder].load_length, EXTRUDE_MAXLENGTH); - #endif - } -} - -#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M701_M702.cpp deleted file mode 100644 index ffc04915da..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ /dev/null @@ -1,252 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - -#include "../../gcode.h" -#include "../../../Marlin.h" -#include "../../../module/motion.h" -#include "../../../module/temperature.h" -#include "../../../feature/pause.h" - -#if EXTRUDERS > 1 - #include "../../../module/tool_change.h" -#endif - -#if HAS_LCD_MENU - #include "../../../lcd/ultralcd.h" -#endif - -#if ENABLED(PRUSA_MMU2) - #include "../../../feature/prusa_MMU2/mmu2.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../../../feature/mixing.h" -#endif - -/** - * M701: Load filament - * - * T - Extruder number. Required for mixing extruder. - * For non-mixing, current extruder if omitted. - * Z - Move the Z axis by this distance - * L - Extrude distance for insertion (positive value) (manual reload) - * - * Default values are used for omitted arguments. - */ -void GcodeSuite::M701() { - xyz_pos_t park_point = NOZZLE_PARK_POINT; - - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Don't raise Z if the machine isn't homed - if (axes_need_homing()) park_point.z = 0; - #endif - - #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; - - const uint8_t old_mixing_tool = mixer.get_current_vtool(); - mixer.T(MIXER_DIRECT_SET_TOOL); - - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); - mixer.normalize(); - - const int8_t target_extruder = active_extruder; - #else - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - #endif - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial "wait for load" message - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, false); - #endif - - // Lift Z axis - if (park_point.z > 0) - do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - - // Load filament - #if ENABLED(PRUSA_MMU2) - mmu2.load_filament_to_nozzle(target_extruder); - #else - constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH, - slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].load_length); - load_filament( - slow_load_length, fast_load_length, purge_length, - FILAMENT_CHANGE_ALERT_BEEPS, - true, // show_lcd - thermalManager.still_heating(target_extruder), // pause_for_user - PAUSE_MODE_LOAD_FILAMENT // pause_mode - #if ENABLED(DUAL_X_CARRIAGE) - , target_extruder // Dual X target - #endif - ); - #endif - - // Restore Z axis - if (park_point.z > 0) - do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - - #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, false); - #endif - - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif - - // Show status screen - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif -} - -/** - * M702: Unload filament - * - * T - Extruder number. Required for mixing extruder. - * For non-mixing, if omitted, current extruder - * (or ALL extruders with FILAMENT_UNLOAD_ALL_EXTRUDERS). - * Z - Move the Z axis by this distance - * U - Retract distance for removal (manual reload) - * - * Default values are used for omitted arguments. - */ -void GcodeSuite::M702() { - xyz_pos_t park_point = NOZZLE_PARK_POINT; - - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Don't raise Z if the machine isn't homed - if (axes_need_homing()) park_point.z = 0; - #endif - - #if ENABLED(MIXING_EXTRUDER) - const uint8_t old_mixing_tool = mixer.get_current_vtool(); - - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - float mix_multiplier = 1.0; - if (!parser.seenval('T')) { - mixer.T(MIXER_AUTORETRACT_TOOL); - mix_multiplier = MIXING_STEPPERS; - } - else - #endif - { - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; - - mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); - mixer.normalize(); - } - - const int8_t target_extruder = active_extruder; - #else - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - #endif - - // Z axis lift - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - - // Show initial "wait for unload" message - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); - #endif - - #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) - // Change toolhead if specified - uint8_t active_extruder_before_filament_change = active_extruder; - if (active_extruder != target_extruder) - tool_change(target_extruder, false); - #endif - - // Lift Z axis - if (park_point.z > 0) - do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - - // Unload filament - #if ENABLED(PRUSA_MMU2) - mmu2.unload(); - #else - #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (!parser.seenval('T')) { - HOTEND_LOOP() { - if (e != active_extruder) tool_change(e, false); - unload_filament(-fc_settings[e].unload_length, true, PAUSE_MODE_UNLOAD_FILAMENT); - } - } - else - #endif - { - // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) - : fc_settings[target_extruder].unload_length); - - unload_filament(unload_length, true, PAUSE_MODE_UNLOAD_FILAMENT - #if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) - , mix_multiplier - #endif - ); - } - #endif - - // Restore Z axis - if (park_point.z > 0) - do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - - #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) - // Restore toolhead if it was changed - if (active_extruder_before_filament_change != active_extruder) - tool_change(active_extruder_before_filament_change, false); - #endif - - #if ENABLED(MIXING_EXTRUDER) - mixer.T(old_mixing_tool); // Restore original mixing tool - #endif - - // Show status screen - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif -} - -#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M1000.cpp deleted file mode 100644 index f14dc60685..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ /dev/null @@ -1,70 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - -#include "../../gcode.h" -#include "../../../feature/power_loss_recovery.h" -#include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" - -#define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY) -#include "../../../core/debug_out.h" - -void menu_job_recovery(); - -inline void plr_error(PGM_P const prefix) { - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - DEBUG_ECHO_START(); - serialprintPGM(prefix); - DEBUG_ECHOLNPGM(" Power-Loss Recovery Data"); - #else - UNUSED(prefix); - #endif -} - -/** - * M1000: Resume from power-loss (undocumented) - * - With 'S' go to the Resume/Cancel menu - * - With no parameters, run recovery commands - */ -void GcodeSuite::M1000() { - - if (recovery.valid()) { - if (parser.seen('S')) { - #if HAS_LCD_MENU - ui.goto_screen(menu_job_recovery); - #else - SERIAL_ECHO_MSG("Resume requires LCD."); - #endif - } - else - recovery.resume(); - } - else - plr_error(recovery.info.valid_head ? PSTR("No") : PSTR("Invalid")); - -} - -#endif // POWER_LOSS_RECOVERY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M413.cpp deleted file mode 100644 index cd1dd801b9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/powerloss/M413.cpp +++ /dev/null @@ -1,58 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - -#include "../../gcode.h" -#include "../../../feature/power_loss_recovery.h" -#include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" - -/** - * M413: Enable / Disable power-loss recovery - * - * Parameters - * S[bool] - Flag to enable / disable. - * If omitted, report current state. - */ -void GcodeSuite::M413() { - - if (parser.seen('S')) - recovery.enable(parser.value_bool()); - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Power-loss recovery "); - serialprintln_onoff(recovery.enabled); - } - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - 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")); - if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n")); - #endif -} - -#endif // POWER_LOSS_RECOVERY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp deleted file mode 100644 index 9ebdcd2070..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp +++ /dev/null @@ -1,49 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(PRUSA_MMU2) - -#include "../../gcode.h" -#include "../../../feature/prusa_MMU2/mmu2.h" - -/** - * M403: Set filament type for MMU2 - * - * Valid filament type values: - * - * 0 Default - * 1 Flexible - * 2 PVA - */ -void GcodeSuite::M403() { - int8_t index = parser.intval('E', -1), - type = parser.intval('F', -1); - - if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2)) - mmu2.set_filament_type(index, type); - else - SERIAL_ECHO_MSG("M403 - bad arguments."); -} - -#endif // PRUSA_MMU2 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/runout/M412.cpp deleted file mode 100644 index 7a5dd65e0e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/runout/M412.cpp +++ /dev/null @@ -1,62 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_FILAMENT_SENSOR - -#include "../../gcode.h" -#include "../../../feature/runout.h" - -/** - * M412: Enable / Disable filament runout detection - */ -void GcodeSuite::M412() { - if (parser.seen("RS" - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - "D" - #endif - #if ENABLED(HOST_ACTION_COMMANDS) - "H" - #endif - )) { - #if ENABLED(HOST_ACTION_COMMANDS) - if (parser.seen('H')) runout.host_handling = parser.value_bool(); - #endif - const bool seenR = parser.seen('R'), seenS = parser.seen('S'); - if (seenR || seenS) runout.reset(); - if (seenS) runout.enabled = parser.value_bool(); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - if (parser.seen('D')) runout.set_runout_distance(parser.value_linear_units()); - #endif - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Filament runout "); - serialprintln_onoff(runout.enabled); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - SERIAL_ECHOLNPAIR("Filament runout distance (mm): ", runout.runout_distance()); - #endif - } -} - -#endif // HAS_FILAMENT_SENSOR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M122.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M122.cpp deleted file mode 100644 index a7e6d65172..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M122.cpp +++ /dev/null @@ -1,56 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "../../gcode.h" -#include "../../../feature/tmc_util.h" - -/** - * M122: Debug TMC drivers - */ -void GcodeSuite::M122() { - xyze_bool_t print_axis = { false, false, false, false }; - bool print_all = true; - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { print_axis[i] = true; print_all = false; } - - if (print_all) LOOP_XYZE(i) print_axis[i] = true; - - #if ENABLED(TMC_DEBUG) - #if ENABLED(MONITOR_DRIVER_STATUS) - const bool sflag = parser.seen('S'), s0 = sflag && !parser.value_bool(); - if (sflag) tmc_set_report_interval(s0 ? 0 : MONITOR_DRIVER_STATUS_INTERVAL_MS); - if (!s0 && parser.seenval('P')) tmc_set_report_interval(_MIN(parser.value_ushort(), MONITOR_DRIVER_STATUS_INTERVAL_MS)); - #endif - - if (parser.seen('V')) - tmc_get_registers(print_axis.x, print_axis.y, print_axis.z, print_axis.e); - else - tmc_report_all(print_axis.x, print_axis.y, print_axis.z, print_axis.e); - #endif - - test_tmc_connection(print_axis.x, print_axis.y, print_axis.z, print_axis.e); -} - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M569.cpp deleted file mode 100644 index e8239838d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M569.cpp +++ /dev/null @@ -1,165 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_STEALTHCHOP - -#include "../../gcode.h" -#include "../../../feature/tmc_util.h" -#include "../../../module/stepper/indirection.h" - -template -void tmc_say_stealth_status(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" driver mode:\t"); - serialprintPGM(st.get_stealthChop_status() ? PSTR("stealthChop") : PSTR("spreadCycle")); - SERIAL_EOL(); -} -template -void tmc_set_stealthChop(TMC &st, const bool enable) { - st.stored.stealthChop_enabled = enable; - st.refresh_stepping_mode(); -} - -static void set_stealth_status(const bool enable, const int8_t target_extruder) { - #define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable) - - #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z) || AXIS_HAS_STEALTHCHOP(Z2) || AXIS_HAS_STEALTHCHOP(Z3) - const uint8_t index = parser.byteval('I'); - #endif - - LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { - switch (i) { - case X_AXIS: - #if AXIS_HAS_STEALTHCHOP(X) - if (index == 0) TMC_SET_STEALTH(X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - if (index == 1) TMC_SET_STEALTH(X2); - #endif - break; - case Y_AXIS: - #if AXIS_HAS_STEALTHCHOP(Y) - if (index == 0) TMC_SET_STEALTH(Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - if (index == 1) TMC_SET_STEALTH(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_HAS_STEALTHCHOP(Z) - if (index == 0) TMC_SET_STEALTH(Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - if (index == 1) TMC_SET_STEALTH(Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - if (index == 2) TMC_SET_STEALTH(Z3); - #endif - break; - case E_AXIS: { - if (target_extruder < 0) return; - switch (target_extruder) { - #if AXIS_HAS_STEALTHCHOP(E0) - case 0: TMC_SET_STEALTH(E0); break; - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - case 1: TMC_SET_STEALTH(E1); break; - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - case 2: TMC_SET_STEALTH(E2); break; - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - case 3: TMC_SET_STEALTH(E3); break; - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - case 4: TMC_SET_STEALTH(E4); break; - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - case 5: TMC_SET_STEALTH(E5); break; - #endif - } - } break; - } - } -} - -static void say_stealth_status() { - #define TMC_SAY_STEALTH_STATUS(Q) tmc_say_stealth_status(stepper##Q) - - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SAY_STEALTH_STATUS(X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SAY_STEALTH_STATUS(X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SAY_STEALTH_STATUS(Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SAY_STEALTH_STATUS(Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SAY_STEALTH_STATUS(Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SAY_STEALTH_STATUS(Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_SAY_STEALTH_STATUS(Z3); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_SAY_STEALTH_STATUS(E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_SAY_STEALTH_STATUS(E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_SAY_STEALTH_STATUS(E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_SAY_STEALTH_STATUS(E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_SAY_STEALTH_STATUS(E4); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - TMC_SAY_STEALTH_STATUS(E5); - #endif -} - -/** - * M569: Enable stealthChop on an axis - * - * S[1|0] to enable or disable - * XYZE to target an axis - * No arguments reports the stealthChop status of all capable drivers. - */ -void GcodeSuite::M569() { - if (parser.seen('S')) - set_stealth_status(parser.value_bool(), get_target_extruder_from_command()); - else - say_stealth_status(); -} - -#endif // HAS_STEALTHCHOP diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M906.cpp deleted file mode 100644 index 072f7ba1fd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M906.cpp +++ /dev/null @@ -1,155 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "../../gcode.h" -#include "../../../feature/tmc_util.h" -#include "../../../module/stepper/indirection.h" - -/** - * M906: Set motor current in milliamps. - * - * Parameters: - * X[current] - Set mA current for X driver(s) - * Y[current] - Set mA current for Y driver(s) - * Z[current] - Set mA current for Z driver(s) - * E[current] - Set mA current for E driver(s) - * - * I[index] - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3.) - * T[index] - Extruder index (Zero-based. Omit for E0 only.) - * - * With no parameters report driver currents. - */ -void GcodeSuite::M906() { - #define TMC_SAY_CURRENT(Q) tmc_print_current(stepper##Q) - #define TMC_SET_CURRENT(Q) stepper##Q.rms_current(value) - - bool report = true; - - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) - const uint8_t index = parser.byteval('I'); - #endif - - LOOP_XYZE(i) if (uint16_t value = parser.intval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_IS_TMC(X) - if (index == 0) TMC_SET_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - if (index == 1) TMC_SET_CURRENT(X2); - #endif - break; - case Y_AXIS: - #if AXIS_IS_TMC(Y) - if (index == 0) TMC_SET_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - if (index == 1) TMC_SET_CURRENT(Y2); - #endif - break; - case Z_AXIS: - #if AXIS_IS_TMC(Z) - if (index == 0) TMC_SET_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - if (index == 1) TMC_SET_CURRENT(Z2); - #endif - #if AXIS_IS_TMC(Z3) - if (index == 2) TMC_SET_CURRENT(Z3); - #endif - break; - case E_AXIS: { - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - switch (target_extruder) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - #if AXIS_IS_TMC(E5) - case 5: TMC_SET_CURRENT(E5); break; - #endif - } - } break; - } - } - - if (report) { - #if AXIS_IS_TMC(X) - TMC_SAY_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - TMC_SAY_CURRENT(X2); - #endif - #if AXIS_IS_TMC(Y) - TMC_SAY_CURRENT(Y); - #endif - #if AXIS_IS_TMC(Y2) - TMC_SAY_CURRENT(Y2); - #endif - #if AXIS_IS_TMC(Z) - TMC_SAY_CURRENT(Z); - #endif - #if AXIS_IS_TMC(Z2) - TMC_SAY_CURRENT(Z2); - #endif - #if AXIS_IS_TMC(Z3) - TMC_SAY_CURRENT(Z3); - #endif - #if AXIS_IS_TMC(E0) - TMC_SAY_CURRENT(E0); - #endif - #if AXIS_IS_TMC(E1) - TMC_SAY_CURRENT(E1); - #endif - #if AXIS_IS_TMC(E2) - TMC_SAY_CURRENT(E2); - #endif - #if AXIS_IS_TMC(E3) - TMC_SAY_CURRENT(E3); - #endif - #if AXIS_IS_TMC(E4) - TMC_SAY_CURRENT(E4); - #endif - #if AXIS_IS_TMC(E5) - TMC_SAY_CURRENT(E5); - #endif - } -} - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M911-M914.cpp deleted file mode 100644 index feb891544d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ /dev/null @@ -1,387 +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 . - * - */ - -#include "../../../inc/MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "../../gcode.h" -#include "../../../feature/tmc_util.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/planner.h" -#include "../../queue.h" - -#if ENABLED(MONITOR_DRIVER_STATUS) - - #define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2160) || AXIS_DRIVER_TYPE(ST, TMC2208) || AXIS_DRIVER_TYPE(ST, TMC2209) || AXIS_DRIVER_TYPE(ST, TMC2660) || AXIS_DRIVER_TYPE(ST, TMC5130) || AXIS_DRIVER_TYPE(ST, TMC5160)) - #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N)) - - #define M91x_SOME_X (M91x_USE(X) || M91x_USE(X2)) - #define M91x_SOME_Y (M91x_USE(Y) || M91x_USE(Y2)) - #define M91x_SOME_Z (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3)) - #define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5)) - - #if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E - #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160." - #endif - - /** - * M911: Report TMC stepper driver overtemperature pre-warn flag - * This flag is held by the library, persisting until cleared by M912 - */ - void GcodeSuite::M911() { - #if M91x_USE(X) - tmc_report_otpw(stepperX); - #endif - #if M91x_USE(X2) - tmc_report_otpw(stepperX2); - #endif - #if M91x_USE(Y) - tmc_report_otpw(stepperY); - #endif - #if M91x_USE(Y2) - tmc_report_otpw(stepperY2); - #endif - #if M91x_USE(Z) - tmc_report_otpw(stepperZ); - #endif - #if M91x_USE(Z2) - tmc_report_otpw(stepperZ2); - #endif - #if M91x_USE(Z3) - tmc_report_otpw(stepperZ3); - #endif - #if M91x_USE_E(0) - tmc_report_otpw(stepperE0); - #endif - #if M91x_USE_E(1) - tmc_report_otpw(stepperE1); - #endif - #if M91x_USE_E(2) - tmc_report_otpw(stepperE2); - #endif - #if M91x_USE_E(3) - tmc_report_otpw(stepperE3); - #endif - #if M91x_USE_E(4) - tmc_report_otpw(stepperE4); - #endif - #if M91x_USE_E(5) - tmc_report_otpw(stepperE5); - #endif - } - - /** - * M912: Clear TMC stepper driver overtemperature pre-warn flag held by the library - * Specify one or more axes with X, Y, Z, X1, Y1, Z1, X2, Y2, Z2, Z3 and E[index]. - * If no axes are given, clear all. - * - * Examples: - * M912 X ; clear X and X2 - * M912 X1 ; clear X1 only - * M912 X2 ; clear X2 only - * M912 X E ; clear X, X2, and all E - * M912 E1 ; clear E1 only - */ - void GcodeSuite::M912() { - #if M91x_SOME_X - const bool hasX = parser.seen(axis_codes.x); - #else - constexpr bool hasX = false; - #endif - - #if M91x_SOME_Y - const bool hasY = parser.seen(axis_codes.y); - #else - constexpr bool hasY = false; - #endif - - #if M91x_SOME_Z - const bool hasZ = parser.seen(axis_codes.z); - #else - constexpr bool hasZ = false; - #endif - - #if M91x_SOME_E - const bool hasE = parser.seen(axis_codes.e); - #else - constexpr bool hasE = false; - #endif - - const bool hasNone = !hasX && !hasY && !hasZ && !hasE; - - #if M91x_SOME_X - const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF)); - #if M91x_USE(X) - if (hasNone || xval == 1 || (hasX && xval < 0)) tmc_clear_otpw(stepperX); - #endif - #if M91x_USE(X2) - if (hasNone || xval == 2 || (hasX && xval < 0)) tmc_clear_otpw(stepperX2); - #endif - #endif - - #if M91x_SOME_Y - const int8_t yval = int8_t(parser.byteval(axis_codes.y, 0xFF)); - #if M91x_USE(Y) - if (hasNone || yval == 1 || (hasY && yval < 0)) tmc_clear_otpw(stepperY); - #endif - #if M91x_USE(Y2) - if (hasNone || yval == 2 || (hasY && yval < 0)) tmc_clear_otpw(stepperY2); - #endif - #endif - - #if M91x_SOME_Z - const int8_t zval = int8_t(parser.byteval(axis_codes.z, 0xFF)); - #if M91x_USE(Z) - if (hasNone || zval == 1 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ); - #endif - #if M91x_USE(Z2) - if (hasNone || zval == 2 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ2); - #endif - #if M91x_USE(Z3) - if (hasNone || zval == 3 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ3); - #endif - #endif - - #if M91x_SOME_E - const int8_t eval = int8_t(parser.byteval(axis_codes.e, 0xFF)); - #if M91x_USE_E(0) - if (hasNone || eval == 0 || (hasE && eval < 0)) tmc_clear_otpw(stepperE0); - #endif - #if M91x_USE_E(1) - if (hasNone || eval == 1 || (hasE && eval < 0)) tmc_clear_otpw(stepperE1); - #endif - #if M91x_USE_E(2) - if (hasNone || eval == 2 || (hasE && eval < 0)) tmc_clear_otpw(stepperE2); - #endif - #if M91x_USE_E(3) - if (hasNone || eval == 3 || (hasE && eval < 0)) tmc_clear_otpw(stepperE3); - #endif - #if M91x_USE_E(4) - if (hasNone || eval == 4 || (hasE && eval < 0)) tmc_clear_otpw(stepperE4); - #endif - #if M91x_USE_E(5) - if (hasNone || eval == 5 || (hasE && eval < 0)) tmc_clear_otpw(stepperE5); - #endif - #endif - } - -#endif // MONITOR_DRIVER_STATUS - -/** - * M913: Set HYBRID_THRESHOLD speed. - */ -#if ENABLED(HYBRID_THRESHOLD) - void GcodeSuite::M913() { - #define TMC_SAY_PWMTHRS(A,Q) tmc_print_pwmthrs(stepper##Q) - #define TMC_SET_PWMTHRS(A,Q) stepper##Q.set_pwm_thrs(value) - #define TMC_SAY_PWMTHRS_E(E) tmc_print_pwmthrs(stepperE##E) - #define TMC_SET_PWMTHRS_E(E) stepperE##E.set_pwm_thrs(value) - - bool report = true; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) - const uint8_t index = parser.byteval('I'); - #endif - LOOP_XYZE(i) if (int32_t value = parser.longval(axis_codes[i])) { - report = false; - switch (i) { - case X_AXIS: - #if AXIS_HAS_STEALTHCHOP(X) - if (index < 2) TMC_SET_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); - #endif - break; - case Y_AXIS: - #if AXIS_HAS_STEALTHCHOP(Y) - if (index < 2) TMC_SET_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); - #endif - break; - case Z_AXIS: - #if AXIS_HAS_STEALTHCHOP(Z) - if (index < 2) TMC_SET_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3); - #endif - break; - case E_AXIS: { - #if E_STEPPERS - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - switch (target_extruder) { - #if AXIS_HAS_STEALTHCHOP(E0) - case 0: TMC_SET_PWMTHRS_E(0); break; - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - case 1: TMC_SET_PWMTHRS_E(1); break; - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - case 2: TMC_SET_PWMTHRS_E(2); break; - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - case 3: TMC_SET_PWMTHRS_E(3); break; - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - case 4: TMC_SET_PWMTHRS_E(4); break; - #endif - #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5) - case 5: TMC_SET_PWMTHRS_E(5); break; - #endif - } - #endif // E_STEPPERS - } break; - } - } - - if (report) { - #if AXIS_HAS_STEALTHCHOP(X) - TMC_SAY_PWMTHRS(X,X); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_SAY_PWMTHRS(X,X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_SAY_PWMTHRS(Y,Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_SAY_PWMTHRS(Y,Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_SAY_PWMTHRS(Z,Z); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_SAY_PWMTHRS(Z,Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_SAY_PWMTHRS(Z,Z3); - #endif - #if E_STEPPERS && AXIS_HAS_STEALTHCHOP(E0) - TMC_SAY_PWMTHRS_E(0); - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - TMC_SAY_PWMTHRS_E(1); - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - TMC_SAY_PWMTHRS_E(2); - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - TMC_SAY_PWMTHRS_E(3); - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - TMC_SAY_PWMTHRS_E(4); - #endif - #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5) - TMC_SAY_PWMTHRS_E(5); - #endif - } - } -#endif // HYBRID_THRESHOLD - -/** - * M914: Set StallGuard sensitivity. - */ -#if USE_SENSORLESS - void GcodeSuite::M914() { - - bool report = true; - const uint8_t index = parser.byteval('I'); - LOOP_XYZ(i) if (parser.seen(axis_codes[i])) { - const int16_t value = parser.value_int(); - report = false; - switch (i) { - #if X_SENSORLESS - case X_AXIS: - #if AXIS_HAS_STALLGUARD(X) - if (index < 2) stepperX.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(X2) - if (!(index & 1)) stepperX2.homing_threshold(value); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - #if AXIS_HAS_STALLGUARD(Y) - if (index < 2) stepperY.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - if (!(index & 1)) stepperY2.homing_threshold(value); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - #if AXIS_HAS_STALLGUARD(Z) - if (index < 2) stepperZ.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - if (index == 0 || index == 2) stepperZ2.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - if (index == 0 || index == 3) stepperZ3.homing_threshold(value); - #endif - break; - #endif - } - } - - if (report) { - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - tmc_print_sgt(stepperX); - #endif - #if AXIS_HAS_STALLGUARD(X2) - tmc_print_sgt(stepperX2); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_HAS_STALLGUARD(Y) - tmc_print_sgt(stepperY); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - tmc_print_sgt(stepperY2); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - tmc_print_sgt(stepperZ); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - tmc_print_sgt(stepperZ2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - tmc_print_sgt(stepperZ3); - #endif - #endif - } - } -#endif // USE_SENSORLESS - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.cpp deleted file mode 100644 index 92928cf8b3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.cpp +++ /dev/null @@ -1,940 +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 . - * - */ - -/** - * gcode.cpp - Temporary container for all gcode handlers - * Most will migrate to classes, by feature. - */ - -#include "gcode.h" -GcodeSuite gcode; - -#include "parser.h" -#include "queue.h" -#include "../module/motion.h" - -#if ENABLED(PRINTCOUNTER) - #include "../module/printcounter.h" -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../feature/host_actions.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../sd/cardreader.h" - #include "../feature/power_loss_recovery.h" -#endif - -#if ENABLED(CANCEL_OBJECTS) - #include "../feature/cancel_object.h" -#endif - -#include "../Marlin.h" // for idle() and suspend_auto_report - -millis_t GcodeSuite::previous_move_ms; - -// Relative motion mode for each logical axis -static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES; -uint8_t GcodeSuite::axis_relative = ( - (ar_init.x ? _BV(REL_X) : 0) - | (ar_init.y ? _BV(REL_Y) : 0) - | (ar_init.z ? _BV(REL_Z) : 0) - | (ar_init.e ? _BV(REL_E) : 0) -); - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - GcodeSuite::MarlinBusyState GcodeSuite::busy_state = NOT_BUSY; - uint8_t GcodeSuite::host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL; -#endif - -#if ENABLED(CNC_WORKSPACE_PLANES) - GcodeSuite::WorkspacePlane GcodeSuite::workspace_plane = PLANE_XY; -#endif - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - int8_t GcodeSuite::active_coordinate_system = -1; // machine space - xyz_pos_t GcodeSuite::coordinate_system[MAX_COORDINATE_SYSTEMS]; -#endif - -/** - * Get the target extruder from the T parameter or the active_extruder - * Return -1 if the T parameter is out of range - */ -int8_t GcodeSuite::get_target_extruder_from_command() { - if (parser.seenval('T')) { - const int8_t e = parser.value_byte(); - if (e < EXTRUDERS) return e; - SERIAL_ECHO_START(); - SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); - SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", int(e)); - return -1; - } - return active_extruder; -} - -/** - * Get the target e stepper from the T parameter - * Return -1 if the T parameter is out of range or unspecified - */ -int8_t GcodeSuite::get_target_e_stepper_from_command() { - const int8_t e = parser.intval('T', -1); - if (WITHIN(e, 0, E_STEPPERS - 1)) return e; - - SERIAL_ECHO_START(); - SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); - if (e == -1) - SERIAL_ECHOLNPGM(" " MSG_E_STEPPER_NOT_SPECIFIED); - else - SERIAL_ECHOLNPAIR(" " MSG_INVALID_E_STEPPER " ", int(e)); - return -1; -} - -/** - * Set XYZE destination and feedrate from the current GCode command - * - * - Set destination from included axis codes - * - Set to current for missing axis codes - * - Set the feedrate, if included - */ -void GcodeSuite::get_destination_from_command() { - xyze_bool_t seen = { false, false, false, false }; - - #if ENABLED(CANCEL_OBJECTS) - const bool &skip_move = cancelable.skipping; - #else - constexpr bool skip_move = false; - #endif - - // Get new XYZ position, whether absolute or relative - LOOP_XYZ(i) { - if ( (seen[i] = parser.seenval(axis_codes[i])) ) { - const float v = parser.value_axis_units((AxisEnum)i); - if (skip_move) - destination[i] = current_position[i]; - else - destination[i] = axis_is_relative(AxisEnum(i)) ? current_position[i] + v : LOGICAL_TO_NATIVE(v, i); - } - else - destination[i] = current_position[i]; - } - - // Get new E position, whether absolute or relative - if ( (seen.e = parser.seenval('E')) ) { - const float v = parser.value_axis_units(E_AXIS); - destination.e = axis_is_relative(E_AXIS) ? current_position.e + v : v; - } - else - destination.e = current_position.e; - - #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 && (seen.x || seen.y)) - recovery.save(); - #endif - - if (parser.linearval('F') > 0) - feedrate_mm_s = parser.value_feedrate(); - - #if ENABLED(PRINTCOUNTER) - if (!DEBUGGING(DRYRUN) && !skip_move) - print_job_timer.incFilamentUsed(destination.e - current_position.e); - #endif - - // Get ABCDHI mixing factors - #if BOTH(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1) - M165(); - #endif -} - -/** - * Dwell waits immediately. It does not synchronize. Use M400 instead of G4 - */ -void GcodeSuite::dwell(millis_t time) { - time += millis(); - while (PENDING(millis(), time)) idle(); -} - -/** - * When G29_RETRY_AND_RECOVER is enabled, call G29() in - * a loop with recovery and retry handling. - */ -#if HAS_LEVELING && ENABLED(G29_RETRY_AND_RECOVER) - - #ifndef G29_MAX_RETRIES - #define G29_MAX_RETRIES 0 - #endif - - void GcodeSuite::G29_with_retry() { - uint8_t retries = G29_MAX_RETRIES; - while (G29()) { // G29 should return true for failed probes ONLY - if (retries--) event_probe_recover(); - else { - event_probe_failure(); - return; - } - } - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_prompt_end(); - #endif - - #ifdef G29_SUCCESS_COMMANDS - process_subcommands_now_P(PSTR(G29_SUCCESS_COMMANDS)); - #endif - } - -#endif // HAS_LEVELING && G29_RETRY_AND_RECOVER - -// -// Placeholders for non-migrated codes -// -#if ENABLED(M100_FREE_MEMORY_WATCHER) - extern void M100_dump_routine(PGM_P const title, char *start, char *end); -#endif - -/** - * Process the parsed command and dispatch it to its handler - */ -void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { - KEEPALIVE_STATE(IN_HANDLER); - - // Handle a known G, M, or T - switch (parser.command_letter) { - case 'G': switch (parser.codenum) { - - case 0: case 1: G0_G1( // G0: Fast Move, G1: Linear Move - #if IS_SCARA || defined(G0_FEEDRATE) - parser.codenum == 0 - #endif - ); - break; - - #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) - case 2: case 3: G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC - #endif - - case 4: G4(); break; // G4: Dwell - - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: G5(); break; // G5: Cubic B_spline - #endif - - #if ENABLED(FWRETRACT) - case 10: G10(); break; // G10: Retract / Swap Retract - case 11: G11(); break; // G11: Recover / Swap Recover - #endif - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 12: G12(); break; // G12: Nozzle Clean - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - case 17: G17(); break; // G17: Select Plane XY - case 18: G18(); break; // G18: Select Plane ZX - case 19: G19(); break; // G19: Select Plane YZ - #endif - - #if ENABLED(INCH_MODE_SUPPORT) - case 20: G20(); break; // G20: Inch Mode - case 21: G21(); break; // G21: MM Mode - #else - case 21: NOOP; break; // No error on unknown G21 - #endif - - #if ENABLED(G26_MESH_VALIDATION) - case 26: G26(); break; // G26: Mesh Validation Pattern generation - #endif - - #if ENABLED(NOZZLE_PARK_FEATURE) - case 27: G27(); break; // G27: Nozzle Park - #endif - - case 28: G28(false); break; // G28: Home all axes, one at a time - - #if HAS_LEVELING - case 29: // G29: Bed leveling calibration - #if ENABLED(G29_RETRY_AND_RECOVER) - G29_with_retry(); - #else - G29(); - #endif - break; - #endif // HAS_LEVELING - - #if HAS_BED_PROBE - case 30: G30(); break; // G30: Single Z probe - #if ENABLED(Z_PROBE_SLED) - case 31: G31(); break; // G31: dock the sled - case 32: G32(); break; // G32: undock the sled - #endif - #endif - - #if ENABLED(DELTA_AUTO_CALIBRATION) - case 33: G33(); break; // G33: Delta Auto-Calibration - #endif - - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - case 34: G34(); break; // G34: Z Stepper automatic alignment using probe - #endif - - #if ENABLED(G38_PROBE_TARGET) - case 38: // G38.2, G38.3: Probe towards target - if (WITHIN(parser.subcode, 2, - #if ENABLED(G38_PROBE_AWAY) - 5 - #else - 3 - #endif - )) G38(parser.subcode); // G38.4, G38.5: Probe away from target - break; - #endif - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - case 53: G53(); break; - case 54: G54(); break; - case 55: G55(); break; - case 56: G56(); break; - case 57: G57(); break; - case 58: G58(); break; - case 59: G59(); break; - #endif - - #if ENABLED(GCODE_MOTION_MODES) - case 80: G80(); break; // G80: Reset the current motion mode - #endif - - 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) - - #if HAS_MESH - case 42: G42(); break; // G42: Coordinated move to a mesh point - #endif - - #if ENABLED(CALIBRATION_GCODE) - case 425: G425(); break; // G425: Perform calibration with calibration cube - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G - #endif - - default: parser.unknown_command_error(); break; - } - break; - - case 'M': switch (parser.codenum) { - - #if HAS_RESUME_CONTINUE - case 0: // M0: Unconditional stop - Wait for user button press on LCD - case 1: M0_M1(); break; // M1: Conditional stop - Wait for user button press on LCD - #endif - - #if HAS_CUTTER - case 3: M3_M4(false); break; // M3: Turn ON Laser | Spindle (clockwise), set Power | Speed - case 4: M3_M4(true ); break; // M4: Turn ON Laser | Spindle (counter-clockwise), set Power | Speed - case 5: M5(); break; // M5: Turn OFF Laser | Spindle - #endif - - #if ENABLED(COOLANT_CONTROL) - #if ENABLED(COOLANT_MIST) - case 7: M7(); break; // M7: Mist coolant ON - #endif - #if ENABLED(COOLANT_FLOOD) - case 8: M8(); break; // M8: Flood coolant ON - #endif - case 9: M9(); break; // M9: Coolant OFF - #endif - - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - case 12: M12(); break; // M12: Synchronize and optionally force a CLC set - #endif - - #if ENABLED(EXPECTED_PRINTER_CHECK) - case 16: M16(); break; // M16: Expected printer check - #endif - - case 17: M17(); break; // M17: Enable all stepper motors - - #if ENABLED(SDSUPPORT) - case 20: M20(); break; // M20: List SD card - case 21: M21(); break; // M21: Init SD card - case 22: M22(); break; // M22: Release SD card - case 23: M23(); break; // M23: Select file - case 24: M24(); break; // M24: Start SD print - case 25: M25(); break; // M25: Pause SD print - case 26: M26(); break; // M26: Set SD index - case 27: M27(); break; // M27: Get SD status - case 28: M28(); break; // M28: Start SD write - case 29: M29(); break; // M29: Stop SD write - case 30: M30(); break; // M30 Delete File - case 32: M32(); break; // M32: Select file and start SD print - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - case 33: M33(); break; // M33: Get the long full path to a file or folder - #endif - - #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) - case 34: M34(); break; // M34: Set SD card sorting options - #endif - - case 928: M928(); break; // M928: Start SD write - #endif // SDSUPPORT - - case 31: M31(); break; // M31: Report time since the start of SD print or last M109 - case 42: M42(); break; // M42: Change pin state - - #if ENABLED(PINS_DEBUGGING) - case 43: M43(); break; // M43: Read pin state - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - case 48: M48(); break; // M48: Z probe repeatability test - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - case 73: M73(); break; // M73: Set progress percentage (for display on LCD) - #endif - - case 75: M75(); break; // M75: Start print timer - case 76: M76(); break; // M76: Pause print timer - case 77: M77(); break; // M77: Stop print timer - - #if ENABLED(PRINTCOUNTER) - case 78: M78(); break; // M78: Show print statistics - #endif - - #if ENABLED(M100_FREE_MEMORY_WATCHER) - case 100: M100(); break; // M100: Free Memory Report - #endif - - #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: 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 - #endif - #else - case 108: case 112: case 410: - #if ENABLED(HOST_PROMPT_SUPPORT) - case 876: - #endif - break; - #endif - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - case 113: M113(); break; // M113: Set Host Keepalive interval - #endif - - #if HAS_HEATED_BED - case 140: M140(); break; // M140: Set bed temperature - case 190: M190(); break; // M190: Wait for bed temperature to reach target - #endif - - #if HAS_HEATED_CHAMBER - case 141: M141(); break; // M141: Set chamber temperature - case 191: M191(); break; // M191: Wait for chamber temperature to reach target - #endif - - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR - case 155: M155(); break; // M155: Set temperature auto-report interval - #endif - - #if ENABLED(PARK_HEAD_ON_PAUSE) - case 125: M125(); break; // M125: Store current position and move to filament change position - #endif - - #if ENABLED(BARICUDA) - // PWM for HEATER_1_PIN - #if HAS_HEATER_1 - case 126: M126(); break; // M126: valve open - case 127: M127(); break; // M127: valve closed - #endif - - // PWM for HEATER_2_PIN - #if HAS_HEATER_2 - case 128: M128(); break; // M128: valve open - case 129: M129(); break; // M129: valve closed - #endif - #endif // BARICUDA - - #if ENABLED(PSU_CONTROL) - case 80: M80(); break; // M80: Turn on Power Supply - #endif - case 81: M81(); break; // M81: Turn off Power, including Power Supply, if possible - - case 82: M82(); break; // M82: Set E axis normal mode (same as other axes) - case 83: M83(); break; // M83: Set E axis relative mode - case 18: case 84: M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout - case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout - case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes - case 114: M114(); break; // M114: Report current position - case 115: M115(); break; // M115: Report capabilities - case 117: M117(); break; // M117: Set LCD message text, if possible - case 118: M118(); break; // M118: Display a message in the host console - case 119: M119(); break; // M119: Report endstop states - case 120: M120(); break; // M120: Enable endstops - case 121: M121(); break; // M121: Disable endstops - - #if HOTENDS && HAS_LCD_MENU - case 145: M145(); break; // M145: Set material heatup parameters - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - case 149: M149(); break; // M149: Set temperature units - #endif - - #if HAS_COLOR_LEDS - case 150: M150(); break; // M150: Set Status LED Color - #endif - - #if ENABLED(MIXING_EXTRUDER) - case 163: M163(); break; // M163: Set a component weight for mixing extruder - case 164: M164(); break; // M164: Save current mix as a virtual extruder - #if ENABLED(DIRECT_MIXING_IN_G1) - case 165: M165(); break; // M165: Set multiple mix weights - #endif - #if ENABLED(GRADIENT_MIX) - case 166: M166(); break; // M166: Set Gradient Mix - #endif - #endif - - #if DISABLED(NO_VOLUMETRICS) - case 200: M200(); break; // M200: Set filament diameter, E to cubic units - #endif - - case 201: M201(); break; // M201: Set max acceleration for print moves (units/s^2) - - #if 0 - case 202: M202(); break; // M202: Not used for Sprinter/grbl gen6 - #endif - - case 203: M203(); break; // M203: Set max feedrate (units/sec) - case 204: M204(); break; // M204: Set acceleration - case 205: M205(); break; // M205: Set advanced settings - - #if HAS_M206_COMMAND - case 206: M206(); break; // M206: Set home offsets - #endif - - #if ENABLED(DELTA) - case 665: M665(); break; // M665: Set delta configurations - #endif - - #if ANY(DELTA, X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_DUAL_ENDSTOPS) - case 666: M666(); break; // M666: Set delta or dual endstop adjustment - #endif - - #if ENABLED(FWRETRACT) - case 207: M207(); break; // M207: Set Retract Length, Feedrate, and Z lift - case 208: M208(); break; // M208: Set Recover (unretract) Additional Length and Feedrate - #if ENABLED(FWRETRACT_AUTORETRACT) - case 209: - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209(); // M209: Turn Automatic Retract Detection on/off - break; - #endif - #endif - - #if HAS_SOFTWARE_ENDSTOPS - case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops - #endif - - #if EXTRUDERS > 1 - case 217: M217(); break; // M217: Set filament swap parameters - #endif - - #if HAS_HOTEND_OFFSET - case 218: M218(); break; // M218: Set a tool offset - #endif - - case 220: M220(); break; // M220: Set Feedrate Percentage: S ("FR" on your LCD) - - #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 - case 280: M280(); break; // M280: Set servo position absolute - #if ENABLED(EDITABLE_SERVO_ANGLES) - case 281: M281(); break; // M281: Set servo angles - #endif - #endif - - #if ENABLED(BABYSTEPPING) - case 290: M290(); break; // M290: Babystepping - #endif - - #if HAS_BUZZER - case 300: M300(); break; // M300: Play beep tone - #endif - - #if ENABLED(PIDTEMP) - case 301: M301(); break; // M301: Set hotend PID parameters - #endif - - #if ENABLED(PIDTEMPBED) - case 304: M304(); break; // M304: Set bed PID parameters - #endif - - #if ENABLED(PHOTO_GCODE) - case 240: M240(); break; // M240: Trigger a camera - #endif - - #if HAS_LCD_CONTRAST - case 250: M250(); break; // M250: Set LCD contrast - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) - case 260: M260(); break; // M260: Send data to an i2c slave - case 261: M261(); break; // M261: Request data from an i2c slave - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - case 302: M302(); break; // M302: Allow cold extrudes (set the minimum extrude temperature) - #endif - - #if HAS_PID_HEATING - case 303: M303(); break; // M303: PID autotune - #endif - - #if HAS_USER_THERMISTORS - case 305: M305(); break; // M305: Set user thermistor parameters - #endif - - #if ENABLED(MORGAN_SCARA) - case 360: if (M360()) return; break; // M360: SCARA Theta pos1 - case 361: if (M361()) return; break; // M361: SCARA Theta pos2 - case 362: if (M362()) return; break; // M362: SCARA Psi pos1 - case 363: if (M363()) return; break; // M363: SCARA Psi pos2 - case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) - #endif - - #if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) - case 380: M380(); break; // M380: Activate solenoid on active (or specified) extruder - case 381: M381(); break; // M381: Disable all solenoids or, if MANUAL_SOLENOID_CONTROL, active (or specified) solenoid - #endif - - case 400: M400(); break; // M400: Finish all moves - - #if HAS_BED_PROBE - case 401: M401(); break; // M401: Deploy probe - case 402: M402(); break; // M402: Stow probe - #endif - - #if ENABLED(PRUSA_MMU2) - case 403: M403(); break; - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - case 404: M404(); break; // M404: Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width - case 405: M405(); break; // M405: Turn on filament sensor for control - case 406: M406(); break; // M406: Turn off filament sensor for control - case 407: M407(); break; // M407: Display measured filament diameter - #endif - - #if HAS_FILAMENT_SENSOR - case 412: M412(); break; // M412: Enable/Disable filament runout detection - #endif - - #if HAS_LEVELING - case 420: M420(); break; // M420: Enable/Disable Bed Leveling - #endif - - #if HAS_MESH - case 421: M421(); break; // M421: Set a Mesh Bed Leveling Z coordinate - #endif - - #if ENABLED(BACKLASH_GCODE) - case 425: M425(); break; // M425: Tune backlash compensation - #endif - - #if HAS_M206_COMMAND - case 428: M428(); break; // M428: Apply current_position to home_offset - #endif - - #if ENABLED(CANCEL_OBJECTS) - case 486: M486(); break; // M486: Identify and cancel objects - #endif - - case 500: M500(); break; // M500: Store settings in EEPROM - case 501: M501(); break; // M501: Read settings from EEPROM - case 502: M502(); break; // M502: Revert to default settings - #if DISABLED(DISABLE_M503) - case 503: M503(); break; // M503: print settings currently in memory - #endif - #if ENABLED(EEPROM_SETTINGS) - case 504: M504(); break; // M504: Validate EEPROM contents - #endif - - #if ENABLED(SDSUPPORT) - case 524: M524(); break; // M524: Abort the current SD print job - #endif - - #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - case 540: M540(); break; // M540: Set abort on endstop hit for SD printing - #endif - - #if ENABLED(BAUD_RATE_GCODE) - case 575: M575(); break; // M575: Set serial baudrate - #endif - - #if HAS_BED_PROBE - case 851: M851(); break; // M851: Set Z Probe Z Offset - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - case 852: M852(); break; // M852: Set Skew factors - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case 600: M600(); break; // M600: Pause for Filament Change - case 603: M603(); break; // M603: Configure Filament Change - #endif - - #if HAS_DUPLICATION_MODE - case 605: M605(); break; // M605: Set Dual X Carriage movement mode - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - case 701: M701(); break; // M701: Load Filament - case 702: M702(); break; // M702: Unload Filament - #endif - - #if ENABLED(MAX7219_GCODE) - case 7219: M7219(); break; // M7219: Set LEDs, columns, and rows - #endif - - #if ENABLED(GCODE_MACROS) - case 810: case 811: case 812: case 813: case 814: - case 815: case 816: case 817: case 818: case 819: - M810_819(); break; // M810-M819: Define/execute G-code macro - #endif - - #if ENABLED(LIN_ADVANCE) - case 900: M900(); break; // M900: Set advance K factor. - #endif - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) - case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes. - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - case 908: M908(); break; // M908: Control digital trimpot directly. - #if ENABLED(DAC_STEPPER_CURRENT) - case 909: M909(); break; // M909: Print digipot/DAC current value - case 910: M910(); break; // M910: Commit digipot/DAC value to external EEPROM - #endif - #endif - #endif - - #if HAS_TRINAMIC - case 122: M122(); break; // M122: Report driver configuration and status - case 906: M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E - #if HAS_STEALTHCHOP - case 569: M569(); break; // M569: Enable stealthChop on an axis. - #endif - #if ENABLED(MONITOR_DRIVER_STATUS) - case 911: M911(); break; // M911: Report TMC2130 prewarn triggered flags - case 912: M912(); break; // M912: Clear TMC2130 prewarn triggered flags - #endif - #if ENABLED(HYBRID_THRESHOLD) - case 913: M913(); break; // M913: Set HYBRID_THRESHOLD speed. - #endif - #if USE_SENSORLESS - case 914: M914(); break; // M914: Set StallGuard sensitivity. - #endif - #endif - - #if HAS_DRIVER(L6470) - case 122: M122(); break; // M122: Report status - case 906: M906(); break; // M906: Set or get motor drive level - case 916: M916(); break; // M916: L6470 tuning: Increase drive level until thermal warning - case 917: M917(); break; // M917: L6470 tuning: Find minimum current thresholds - case 918: M918(); break; // M918: L6470 tuning: Increase speed until max or error - #endif - - #if HAS_MICROSTEPS - case 350: M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - case 351: M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - #endif - - #if HAS_CASE_LIGHT - case 355: M355(); break; // M355: Set case light brightness - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - case 860: M860(); break; // M860: Report encoder module position - case 861: M861(); break; // M861: Report encoder module status - case 862: M862(); break; // M862: Perform axis test - case 863: M863(); break; // M863: Calibrate steps/mm - case 864: M864(); break; // M864: Change module address - case 865: M865(); break; // M865: Check module firmware version - case 866: M866(); break; // M866: Report axis error count - case 867: M867(); break; // M867: Toggle error correction - case 868: M868(); break; // M868: Set error correction threshold - case 869: M869(); break; // M869: Report axis error - #endif - - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - case 951: M951(); break; // M951: Set Magnetic Parking Extruder parameters - #endif - - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe - #endif - - #if ENABLED(PLATFORM_M997_SUPPORT) - case 997: M997(); break; // M997: Perform in-application firmware update - #endif - - case 999: M999(); break; // M999: Restart after being Stopped - - #if ENABLED(POWER_LOSS_RECOVERY) - case 413: M413(); break; // M413: Enable/disable/query Power-Loss Recovery - case 1000: M1000(); break; // M1000: Resume from power-loss - #endif - - default: parser.unknown_command_error(); break; - } - break; - - case 'T': T(parser.codenum); break; // Tn: Tool Change - - default: parser.unknown_command_error(); - } - - if (!no_ok) queue.ok_to_send(); -} - -/** - * Process a single command and dispatch it to its handler - * This is called from the main loop() - */ -void GcodeSuite::process_next_command() { - 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.command_buffer, queue.command_buffer + sizeof(queue.command_buffer)); - #endif - } - - // Parse the next command in the queue - parser.parse(current_command); - process_parsed_command(); -} - -/** - * Run a series of commands, bypassing the command queue to allow - * G-code "macros" to be called from within other G-code handlers. - */ - -void GcodeSuite::process_subcommands_now_P(PGM_P pgcode) { - char * const saved_cmd = parser.command_ptr; // Save the parser state - for (;;) { - PGM_P const delim = strchr_P(pgcode, '\n'); // Get address of next newline - const size_t len = delim ? delim - pgcode : strlen_P(pgcode); // Get the command length - char cmd[len + 1]; // Allocate a stack buffer - strncpy_P(cmd, pgcode, len); // Copy the command to the stack - cmd[len] = '\0'; // End with a nul - parser.parse(cmd); // Parse the command - process_parsed_command(true); // Process it - if (!delim) break; // Last command? - pgcode = delim + 1; // Get the next command - } - parser.parse(saved_cmd); // Restore the parser state -} - -void GcodeSuite::process_subcommands_now(char * gcode) { - char * const saved_cmd = parser.command_ptr; // Save the parser state - for (;;) { - char * const delim = strchr(gcode, '\n'); // Get address of next newline - if (delim) *delim = '\0'; // Replace with nul - parser.parse(gcode); // Parse the current command - process_parsed_command(true); // Process it - if (!delim) break; // Last command? - gcode = delim + 1; // Get the next command - } - parser.parse(saved_cmd); // Restore the parser state -} - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - - /** - * Output a "busy" message at regular intervals - * while the machine is not accepting commands. - */ - void GcodeSuite::host_keepalive() { - const millis_t ms = millis(); - static millis_t next_busy_signal_ms = 0; - if (!suspend_auto_report && host_keepalive_interval && busy_state != NOT_BUSY) { - if (PENDING(ms, next_busy_signal_ms)) return; - switch (busy_state) { - case IN_HANDLER: - case IN_PROCESS: - SERIAL_ECHO_MSG(MSG_BUSY_PROCESSING); - break; - case PAUSED_FOR_USER: - SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_USER); - break; - case PAUSED_FOR_INPUT: - SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_INPUT); - break; - default: - break; - } - } - next_busy_signal_ms = ms + host_keepalive_interval * 1000UL; - } - -#endif // HOST_KEEPALIVE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.h deleted file mode 100644 index 9f4675291f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/gcode.h +++ /dev/null @@ -1,945 +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 - -/** - * gcode.h - Temporary container for all gcode handlers - */ - -/** - * ----------------- - * G-Codes in Marlin - * ----------------- - * - * Helpful G-code references: - * - http://marlinfw.org/meta/gcode - * - https://reprap.org/wiki/G-code - * - http://linuxcnc.org/docs/html/gcode.html - * - * Help to document Marlin's G-codes online: - * - https://github.com/MarlinFirmware/MarlinDocumentation - * - * ----------------- - * - * "G" Codes - * - * G0 -> G1 - * G1 - Coordinated Movement X Y Z E - * G2 - CW ARC - * G3 - CCW ARC - * G4 - Dwell S or P - * G5 - Cubic B-spline with XYZE destination and IJPQ offsets - * G10 - Retract filament according to settings of M207 (Requires FWRETRACT) - * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT) - * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE) - * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES) - * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES) - * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES) - * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT) - * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT) - * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION) - * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE) - * G28 - Home one or more axes - * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling) - * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location) - * G31 - Dock sled (Z_PROBE_SLED only) - * G32 - Undock sled (Z_PROBE_SLED only) - * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION) - * G34 - Z Stepper automatic alignment using probe: I T A (Requires Z_STEPPER_AUTO_ALIGN) - * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET) - * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL) - * G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES) - * G90 - Use Absolute Coordinates - * G91 - Use Relative Coordinates - * G92 - Set current position to coordinates given - * - * "M" Codes - * - * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) - * M1 -> M0 - * M3 - Turn ON Laser | Spindle (clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE) - * M4 - Turn ON Laser | Spindle (counter-clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE) - * M5 - Turn OFF Laser | Spindle. (Requires SPINDLE_FEATURE or LASER_FEATURE) - * M7 - Turn mist coolant ON. (Requires COOLANT_CONTROL) - * M8 - Turn flood coolant ON. (Requires COOLANT_CONTROL) - * M9 - Turn coolant OFF. (Requires COOLANT_CONTROL) - * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER) - * M16 - Expected printer check. (Requires EXPECTED_PRINTER_CHECK) - * M17 - Enable/Power all stepper motors - * M18 - Disable all stepper motors; same as M84 - * M20 - List SD card. (Requires SDSUPPORT) - * M21 - Init SD card. (Requires SDSUPPORT) - * M22 - Release SD card. (Requires SDSUPPORT) - * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT) - * M24 - Start/resume SD print. (Requires SDSUPPORT) - * M25 - Pause SD print. (Requires SDSUPPORT) - * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT) - * M27 - Report SD print status. (Requires SDSUPPORT) - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT) - * M29 - Stop SD write. (Requires SDSUPPORT) - * M30 - Delete file from SD: "M30 /path/file.gco" - * M31 - Report time since last M109 or SD card start to serial. - * M32 - Select file and start SD print: "M32 [S] !/path/file.gco#". (Requires SDSUPPORT) - * Use P to run other files as sub-programs: "M32 P !filename#" - * The '#' is necessary when calling from within sd files, as it stops buffer prereading - * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT) - * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) - * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. - * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) - * M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY) - * M75 - Start the print job timer. - * M76 - Pause the print job timer. - * M77 - Stop the print job timer. - * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER) - * M80 - Turn on Power Supply. (Requires PSU_CONTROL) - * M81 - Turn off Power Supply. (Requires PSU_CONTROL) - * M82 - Set E codes absolute (default). - * M83 - Set E codes relative while in Absolute (G90) mode. - * M84 - Disable steppers until next move, or use S to specify an idle - * duration after which steppers should turn off. S0 disables the timeout. - * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) - * M92 - Set planner.settings.axis_steps_per_mm for one or more axes. - * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER) - * M104 - Set extruder target temp. - * M105 - Report current temperatures. - * M106 - Set print fan speed. - * M107 - Print fan off. - * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER) - * M109 - S Wait for extruder current temp to reach target temp. ** Wait only when heating! ** - * R Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. ** - * 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 - 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) - * M117 - Display a message on the controller screen. (Requires an LCD) - * M118 - Display a message in the host console. - * M119 - Report endstops status. - * M120 - Enable endstops detection. - * M121 - Disable endstops detection. - * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) - * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) - * M126 - Solenoid Air Valve Open. (Requires BARICUDA) - * M127 - Solenoid Air Valve Closed. (Requires BARICUDA) - * M128 - EtoP Open. (Requires BARICUDA) - * M129 - EtoP Closed. (Requires BARICUDA) - * M140 - Set bed target temp. S - * M141 - Set heated chamber target temp. S (Requires a chamber heater) - * M145 - Set heatup values for materials on the LCD. H B F for S (0=PLA, 1=ABS) - * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT) - * M150 - Set Status LED Color as R U B P. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632). - * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) - * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) - * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER) - * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1) - * M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX) - * M190 - S Wait for bed current temp to reach target temp. ** Wait only when heating! ** - * R Wait for bed current temp to reach target temp. ** Wait for heating or cooling. ** - * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) - * M201 - Set max acceleration in units/s^2 for print moves: "M201 X Y Z E" - * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X Y Z E" ** UNUSED IN MARLIN! ** - * M203 - Set maximum feedrate: "M203 X Y Z E" in units/sec. - * M204 - Set default acceleration in units/sec^2: P R T - * M205 - Set advanced settings. Current units apply: - S T minimum speeds - B - X, Y, Z, E - * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z. (Requires FWRETRACT) - * M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F. (Requires FWRETRACT) - * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT) - Every normal extrude-only move will be classified as retract depending on the direction. - * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS) - * M217 - Set filament swap parameters: "M217 S P R". (Requires SINGLENOZZLE) - * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) - * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) - * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires PRUSA_MMU2) - * M221 - Set Flow Percentage: "M221 S" - * M226 - Wait until a pin is in a given state: "M226 P S" - * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE) - * M250 - Set LCD contrast: "M250 C" (0-63). (Requires LCD support) - * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS) - * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS) - * M280 - Set servo position absolute: "M280 P S". (Requires servos) - * M281 - Set servo min|max position: "M281 P L U". (Requires EDITABLE_SERVO_ANGLES) - * M290 - Babystepping (Requires BABYSTEPPING) - * M300 - Play beep sound S P - * M301 - Set PID parameters P I and D. (Requires PIDTEMP) - * M302 - Allow cold extrudes, or set the minimum extrude S. (Requires PREVENT_COLD_EXTRUSION) - * M303 - PID relay autotune S sets the target temperature. Default 150C. (Requires PIDTEMP) - * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED) - * M305 - Set user thermistor parameters R T and P. (Requires TEMP_SENSOR_x 1000) - * M350 - Set microstepping mode. (Requires digital microstepping pins.) - * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.) - * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN) - * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID) - * M381 - Disable all solenoids. (Requires EXT_SOLENOID) - * M400 - Finish all moves. - * M401 - Deploy and activate Z probe. (Requires a probe) - * M402 - Deactivate and stow Z probe. (Requires a probe) - * M403 - Set filament type for PRUSA MMU2 - * M404 - Display or set the Nominal Filament Width: "W". (Requires FILAMENT_WIDTH_SENSOR) - * M405 - Enable Filament Sensor flow control. "M405 D". (Requires FILAMENT_WIDTH_SENSOR) - * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) - * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) - * M410 - Quickstop. Abort all planned moves. - * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR) - * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY) - * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) - * M422 - Set Z Stepper automatic alignment position using probe. X Y A (Requires Z_STEPPER_AUTO_ALIGN) - * M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE) - * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) - * M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS) - * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) - * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) - * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** - * M503 - Print the current settings (in memory): "M503 S". S0 specifies compact output. - * M504 - Validate EEPROM contents. (Requires EEPROM_SETTINGS) - * M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT) - * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires SD_ABORT_ON_ENDSTOP_HIT) - * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160) - * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) - * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) - * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) - * M665 - Set delta configurations: "M665 H L R S B X Y Z (Requires DELTA) - * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). - * 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 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. - * M862 - Perform an axis continuity test for position encoder modules. - * M863 - Perform steps-per-mm calibration for position encoder modules. - * M864 - Change position encoder module I2C address. - * M865 - Check position encoder module firmware version. - * M866 - Report or reset position encoder module error count. - * M867 - Enable/disable or toggle error correction for position encoder modules. - * M868 - Report or set position encoder module error correction threshold. - * M869 - Report position encoder module error. - * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER) - * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) - * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) - * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN) - * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT) - * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT) - * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) - * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) - * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) - * M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING) - * M916 - L6470 tuning: Increase KVAL_HOLD until thermal warning. (Requires at least one _DRIVER_TYPE L6470) - * M917 - L6470 tuning: Find minimum current thresholds. (Requires at least one _DRIVER_TYPE L6470) - * M918 - L6470 tuning: Increase speed until max or error. (Requires at least one _DRIVER_TYPE L6470) - * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER) - * M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE) - * - * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) - * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) - * - * ************ Custom codes - This can change to suit future G-code regulations - * G425 - Calibrate using a conductive object. (Requires CALIBRATION_GCODE) - * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT) - * M997 - Perform in-application firmware update - * M999 - Restart after being stopped by error - * - * "T" Codes - * - * T0-T3 - Select an extruder (tool) by index: "T F" - * - */ - -#include "../inc/MarlinConfig.h" -#include "parser.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - #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: - - static uint8_t axis_relative; - - 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) - /** - * Workspace planes only apply to G2/G3 moves - * (and "canned cycles" - not a current feature) - */ - enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ }; - static WorkspacePlane workspace_plane; - #endif - - #define MAX_COORDINATE_SYSTEMS 9 - #if ENABLED(CNC_COORDINATE_SYSTEMS) - static int8_t active_coordinate_system; - static xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; - static bool select_coordinate_system(const int8_t _new); - #endif - - static millis_t previous_move_ms; - FORCE_INLINE static void reset_stepper_timeout() { previous_move_ms = millis(); } - - static int8_t get_target_extruder_from_command(); - static int8_t get_target_e_stepper_from_command(); - static void get_destination_from_command(); - - static void process_parsed_command(const bool no_ok=false); - static void process_next_command(); - - // Execute G-code in-place, preserving current G-code parameters - static void process_subcommands_now_P(PGM_P pgcode); - static void process_subcommands_now(char * gcode); - - static inline void home_all_axes() { - extern const char G28_STR[]; - process_subcommands_now_P(G28_STR); - } - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - /** - * States for managing Marlin and host communication - * Marlin sends messages if blocked or busy - */ - enum MarlinBusyState : char { - NOT_BUSY, // Not in a handler - IN_HANDLER, // Processing a GCode - IN_PROCESS, // Known to be blocking command input (as in G29) - PAUSED_FOR_USER, // Blocking pending any input - PAUSED_FOR_INPUT // Blocking pending text input (concept) - }; - - static MarlinBusyState busy_state; - static uint8_t host_keepalive_interval; - - static void host_keepalive(); - - #define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N) - #else - #define KEEPALIVE_STATE(N) NOOP - #endif - - static void dwell(millis_t time); - -private: - - static void G0_G1( - #if IS_SCARA || defined(G0_FEEDRATE) - const bool fast_move=false - #endif - ); - - #if ENABLED(ARC_SUPPORT) - static void G2_G3(const bool clockwise); - #endif - - static void G4(); - - #if ENABLED(BEZIER_CURVE_SUPPORT) - static void G5(); - #endif - - #if ENABLED(FWRETRACT) - static void G10(); - static void G11(); - #endif - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - static void G12(); - #endif - - #if ENABLED(CNC_WORKSPACE_PLANES) - static void G17(); - static void G18(); - static void G19(); - #endif - - #if ENABLED(INCH_MODE_SUPPORT) - static void G20(); - static void G21(); - #endif - - #if ENABLED(G26_MESH_VALIDATION) - static void G26(); - #endif - - #if ENABLED(NOZZLE_PARK_FEATURE) - static void G27(); - #endif - - static void G28(const bool always_home_all); - - #if HAS_LEVELING - #if ENABLED(G29_RETRY_AND_RECOVER) - static void G29_with_retry(); - #define G29_TYPE bool - #else - #define G29_TYPE void - #endif - static G29_TYPE G29(); - #endif - - #if HAS_BED_PROBE - static void G30(); - #if ENABLED(Z_PROBE_SLED) - static void G31(); - static void G32(); - #endif - #endif - - #if ENABLED(DELTA_AUTO_CALIBRATION) - static void G33(); - #endif - - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - static void G34(); - static void M422(); - #endif - - #if ENABLED(G38_PROBE_TARGET) - static void G38(const int8_t subcode); - #endif - - #if HAS_MESH - static void G42(); - #endif - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - static void G53(); - static void G54(); - static void G55(); - static void G56(); - static void G57(); - static void G58(); - static void G59(); - #endif - - #if ENABLED(GCODE_MOTION_MODES) - static void G80(); - #endif - - static void G92(); - - #if ENABLED(CALIBRATION_GCODE) - static void G425(); - #endif - - #if HAS_RESUME_CONTINUE - static void M0_M1(); - #endif - - #if HAS_CUTTER - static void M3_M4(const bool is_M4); - static void M5(); - #endif - - #if ENABLED(COOLANT_CONTROL) - #if ENABLED(COOLANT_MIST) - static void M7(); - #endif - #if ENABLED(COOLANT_FLOOD) - static void M8(); - #endif - static void M9(); - #endif - - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - static void M12(); - #endif - - #if ENABLED(EXPECTED_PRINTER_CHECK) - static void M16(); - #endif - - static void M17(); - - static void M18_M84(); - - #if ENABLED(SDSUPPORT) - static void M20(); - static void M21(); - static void M22(); - static void M23(); - static void M24(); - static void M25(); - static void M26(); - static void M27(); - static void M28(); - static void M29(); - static void M30(); - #endif - - static void M31(); - - #if ENABLED(SDSUPPORT) - static void M32(); - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - static void M33(); - #endif - #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) - static void M34(); - #endif - #endif - - static void M42(); - - #if ENABLED(PINS_DEBUGGING) - static void M43(); - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - static void M48(); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - static void M73(); - #endif - - static void M75(); - static void M76(); - static void M77(); - - #if ENABLED(PRINTCOUNTER) - static void M78(); - #endif - - #if ENABLED(PSU_CONTROL) - static void M80(); - #endif - - static void M81(); - static void M82(); - static void M83(); - static void M85(); - static void M92(); - - #if ENABLED(M100_FREE_MEMORY_WATCHER) - static void M100(); - #endif - - #if EXTRUDERS - static void M104(); - static void M109(); - #endif - - static void M105(); - - #if FAN_COUNT > 0 - static void M106(); - static void M107(); - #endif - - #if DISABLED(EMERGENCY_PARSER) - static void M108(); - static void M112(); - static void M410(); - #if ENABLED(HOST_PROMPT_SUPPORT) - static void M876(); - #endif - #endif - - static void M110(); - static void M111(); - - #if ENABLED(HOST_KEEPALIVE_FEATURE) - static void M113(); - #endif - - static void M114(); - static void M115(); - static void M117(); - static void M118(); - static void M119(); - static void M120(); - static void M121(); - - #if ENABLED(PARK_HEAD_ON_PAUSE) - static void M125(); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - static void M126(); - static void M127(); - #endif - #if HAS_HEATER_2 - static void M128(); - static void M129(); - #endif - #endif - - #if HAS_HEATED_BED - static void M140(); - static void M190(); - #endif - - #if HAS_HEATED_CHAMBER - static void M141(); - static void M191(); - #endif - - #if HOTENDS && HAS_LCD_MENU - static void M145(); - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static void M149(); - #endif - - #if HAS_COLOR_LEDS - static void M150(); - #endif - - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR - static void M155(); - #endif - - #if ENABLED(MIXING_EXTRUDER) - static void M163(); - static void M164(); - #if ENABLED(DIRECT_MIXING_IN_G1) - static void M165(); - #endif - #if ENABLED(GRADIENT_MIX) - static void M166(); - #endif - #endif - - static void M200(); - static void M201(); - - #if 0 - static void M202(); // Not used for Sprinter/grbl gen6 - #endif - - static void M203(); - static void M204(); - static void M205(); - - #if HAS_M206_COMMAND - static void M206(); - #endif - - #if ENABLED(FWRETRACT) - static void M207(); - static void M208(); - #if ENABLED(FWRETRACT_AUTORETRACT) - static void M209(); - #endif - #endif - - static void M211(); - - #if EXTRUDERS > 1 - static void M217(); - #endif - - #if HAS_HOTEND_OFFSET - static void M218(); - #endif - - static void M220(); - - #if EXTRUDERS - static void M221(); - #endif - - static void M226(); - - #if ENABLED(PHOTO_GCODE) - static void M240(); - #endif - - #if HAS_LCD_CONTRAST - static void M250(); - #endif - - #if ENABLED(EXPERIMENTAL_I2CBUS) - static void M260(); - static void M261(); - #endif - - #if HAS_SERVOS - static void M280(); - #if ENABLED(EDITABLE_SERVO_ANGLES) - static void M281(); - #endif - #endif - - #if ENABLED(BABYSTEPPING) - static void M290(); - #endif - - #if HAS_BUZZER - static void M300(); - #endif - - #if ENABLED(PIDTEMP) - static void M301(); - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - static void M302(); - #endif - - #if HAS_PID_HEATING - static void M303(); - #endif - - #if ENABLED(PIDTEMPBED) - static void M304(); - #endif - - #if HAS_USER_THERMISTORS - static void M305(); - #endif - - #if HAS_MICROSTEPS - static void M350(); - static void M351(); - #endif - - #if HAS_CASE_LIGHT - static void M355(); - #endif - - #if ENABLED(MORGAN_SCARA) - static bool M360(); - static bool M361(); - static bool M362(); - static bool M363(); - static bool M364(); - #endif - - #if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) - static void M380(); - static void M381(); - #endif - - static void M400(); - - #if HAS_BED_PROBE - static void M401(); - static void M402(); - #endif - - #if ENABLED(PRUSA_MMU2) - static void M403(); - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static void M404(); - static void M405(); - static void M406(); - static void M407(); - #endif - - #if HAS_FILAMENT_SENSOR - static void M412(); - #endif - - #if HAS_LEVELING - static void M420(); - static void M421(); - #endif - - #if ENABLED(BACKLASH_GCODE) - static void M425(); - #endif - - #if HAS_M206_COMMAND - static void M428(); - #endif - - #if ENABLED(CANCEL_OBJECTS) - static void M486(); - #endif - - static void M500(); - static void M501(); - static void M502(); - #if DISABLED(DISABLE_M503) - static void M503(); - #endif - #if ENABLED(EEPROM_SETTINGS) - static void M504(); - #endif - - #if ENABLED(SDSUPPORT) - static void M524(); - #endif - - #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - static void M540(); - #endif - - #if ENABLED(BAUD_RATE_GCODE) - static void M575(); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void M600(); - static void M603(); - #endif - - #if HAS_DUPLICATION_MODE - static void M605(); - #endif - - #if IS_KINEMATIC - static void M665(); - #endif - - #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS - static void M666(); - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - static void M701(); - static void M702(); - #endif - - #if ENABLED(GCODE_MACROS) - static void M810_819(); - #endif - - #if HAS_BED_PROBE - static void M851(); - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - static void M852(); - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - FORCE_INLINE static void M860() { I2CPEM.M860(); } - FORCE_INLINE static void M861() { I2CPEM.M861(); } - FORCE_INLINE static void M862() { I2CPEM.M862(); } - FORCE_INLINE static void M863() { I2CPEM.M863(); } - FORCE_INLINE static void M864() { I2CPEM.M864(); } - FORCE_INLINE static void M865() { I2CPEM.M865(); } - FORCE_INLINE static void M866() { I2CPEM.M866(); } - FORCE_INLINE static void M867() { I2CPEM.M867(); } - FORCE_INLINE static void M868() { I2CPEM.M868(); } - FORCE_INLINE static void M869() { I2CPEM.M869(); } - #endif - - #if ENABLED(LIN_ADVANCE) - static void M900(); - #endif - - #if HAS_TRINAMIC - static void M122(); - static void M906(); - #if HAS_STEALTHCHOP - static void M569(); - #endif - #if ENABLED(MONITOR_DRIVER_STATUS) - static void M911(); - static void M912(); - #endif - #if ENABLED(HYBRID_THRESHOLD) - static void M913(); - #endif - #if USE_SENSORLESS - static void M914(); - #endif - #endif - - #if HAS_DRIVER(L6470) - static void M122(); - static void M906(); - static void M916(); - static void M917(); - static void M918(); - #endif - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT) - static void M907(); - #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) - static void M908(); - #if ENABLED(DAC_STEPPER_CURRENT) - static void M909(); - static void M910(); - #endif - #endif - #endif - - #if ENABLED(SDSUPPORT) - static void M928(); - #endif - - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - static void M951(); - #endif - - #if ENABLED(PLATFORM_M997_SUPPORT) - static void M997(); - #endif - - static void M999(); - - #if ENABLED(POWER_LOSS_RECOVERY) - static void M413(); - static void M1000(); - #endif - - #if ENABLED(MAX7219_GCODE) - static void M7219(); - #endif - - static void T(const uint8_t tool_index); - -}; - -extern GcodeSuite gcode; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G17-G19.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G17-G19.cpp deleted file mode 100644 index bd0192fabf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G17-G19.cpp +++ /dev/null @@ -1,53 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(CNC_WORKSPACE_PLANES) - -#include "../gcode.h" - -inline void report_workspace_plane() { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Workspace Plane "); - serialprintPGM( - gcode.workspace_plane == GcodeSuite::PLANE_YZ ? PSTR("YZ\n") - : gcode.workspace_plane == GcodeSuite::PLANE_ZX ? PSTR("ZX\n") - : PSTR("XY\n") - ); -} - -inline void set_workspace_plane(const GcodeSuite::WorkspacePlane plane) { - gcode.workspace_plane = plane; - if (DEBUGGING(INFO)) report_workspace_plane(); -} - -/** - * G17: Select Plane XY - * G18: Select Plane ZX - * G19: Select Plane YZ - */ -void GcodeSuite::G17() { set_workspace_plane(PLANE_XY); } -void GcodeSuite::G18() { set_workspace_plane(PLANE_ZX); } -void GcodeSuite::G19() { set_workspace_plane(PLANE_YZ); } - -#endif // CNC_WORKSPACE_PLANES diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G53-G59.cpp deleted file mode 100644 index 38f72ae62e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G53-G59.cpp +++ /dev/null @@ -1,101 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/motion.h" - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - -#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; - active_coordinate_system = _new; - xyz_float_t new_offset{0}; - if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1)) - new_offset = coordinate_system[_new]; - LOOP_XYZ(i) { - if (position_shift[i] != new_offset[i]) { - position_shift[i] = new_offset[i]; - update_workspace_offset((AxisEnum)i); - } - } - return true; -} - -/** - * G53: Apply native workspace to the current move - * - * In CNC G-code G53 is a modifier. - * It precedes a movement command (or other modifiers) on the same line. - * This is the first command to use parser.chain() to make this possible. - * - * Marlin also uses G53 on a line by itself to go back to native space. - */ -void GcodeSuite::G53() { - 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 - } -} - -/** - * G54-G59.3: Select a new workspace - * - * A workspace is an XYZ offset to the machine native space. - * All workspaces default to 0,0,0 at start, or with EEPROM - * support they may be restored from a previous session. - * - * G92 is used to set the current workspace's offset. - */ -void G54_59(uint8_t subcode=0) { - const int8_t _space = parser.codenum - 54 + subcode; - if (gcode.select_coordinate_system(_space)) { - SERIAL_ECHOLNPAIR("Select workspace ", _space); - report_current_position(); - } -} -void GcodeSuite::G54() { G54_59(); } -void GcodeSuite::G55() { G54_59(); } -void GcodeSuite::G56() { G54_59(); } -void GcodeSuite::G57() { G54_59(); } -void GcodeSuite::G58() { G54_59(); } -void GcodeSuite::G59() { G54_59(parser.subcode); } - -#endif // CNC_COORDINATE_SYSTEMS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G92.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G92.cpp deleted file mode 100644 index 2f69654b0e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/G92.cpp +++ /dev/null @@ -1,103 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/stepper.h" - -#if ENABLED(I2C_POSITION_ENCODERS) - #include "../../feature/I2CPositionEncoder.h" -#endif - -/** - * G92: Set current position to given X Y Z E - */ -void GcodeSuite::G92() { - - bool sync_E = false, sync_XYZ = false; - - #if USE_GCODE_SUBCODES - const uint8_t subcode_G92 = parser.subcode; - #else - constexpr uint8_t subcode_G92 = 0; - #endif - - switch (subcode_G92) { - default: break; - #if ENABLED(CNC_COORDINATE_SYSTEMS) - case 1: { - // Zero the G92 values and restore current position - #if !IS_SCARA - LOOP_XYZ(i) if (position_shift[i]) { - position_shift[i] = 0; - update_workspace_offset((AxisEnum)i); - } - #endif // Not SCARA - } return; - #endif - #if ENABLED(POWER_LOSS_RECOVERY) - case 9: { - LOOP_XYZE(i) { - if (parser.seenval(axis_codes[i])) { - current_position[i] = parser.value_axis_units((AxisEnum)i); - if (i == E_AXIS) sync_E = true; else sync_XYZ = true; - } - } - } break; - #endif - case 0: { - LOOP_XYZE(i) { - if (parser.seenval(axis_codes[i])) { - const float l = parser.value_axis_units((AxisEnum)i), - v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i), - d = v - current_position[i]; - if (!NEAR_ZERO(d)) { - #if IS_SCARA || !HAS_POSITION_SHIFT - if (i == E_AXIS) sync_E = true; else sync_XYZ = true; - current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior - #elif HAS_POSITION_SHIFT - if (i == E_AXIS) { - sync_E = true; - current_position.e = v; // When using coordinate spaces, only E is set directly - } - else { - position_shift[i] += d; // Other axes simply offset the coordinate space - update_workspace_offset((AxisEnum)i); - } - #endif - } - } - } - } break; - } - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Apply workspace offset to the active coordinate system - if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - coordinate_system[active_coordinate_system] = position_shift; - #endif - - if (sync_XYZ) sync_plan_position(); - else if (sync_E) sync_plan_position_e(); - - report_current_position(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/M206_M428.cpp deleted file mode 100644 index 6e2b46081c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/geometry/M206_M428.cpp +++ /dev/null @@ -1,86 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_M206_COMMAND - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../lcd/ultralcd.h" -#include "../../libs/buzzer.h" - -/** - * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y - * - * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665. - * *** M206 for SCARA will remain enabled in 1.1.x for compatibility. - * *** In the 2.0 release, it will simply be disabled by default. - */ -void GcodeSuite::M206() { - LOOP_XYZ(i) - if (parser.seen(axis_codes[i])) - set_home_offset((AxisEnum)i, parser.value_linear_units()); - - #if ENABLED(MORGAN_SCARA) - if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta - if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi - #endif - - report_current_position(); -} - -/** - * M428: Set home_offset based on the distance between the - * current_position and the nearest "reference point." - * If an axis is past center its endstop position - * is the reference-point. Otherwise it uses 0. This allows - * the Z offset to be set near the bed when using a max endstop. - * - * M428 can't be used more than 2cm away from 0 or an endstop. - * - * Use M206 to set these values directly. - */ -void GcodeSuite::M428() { - if (axis_unhomed_error()) return; - - xyz_float_t diff; - LOOP_XYZ(i) { - diff[i] = base_home_pos((AxisEnum)i) - current_position[i]; - if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) - diff[i] = -current_position[i]; - if (!WITHIN(diff[i], -20, 20)) { - SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!")); - BUZZ(200, 40); - return; - } - } - - LOOP_XYZ(i) set_home_offset((AxisEnum)i, diff[i]); - report_current_position(); - LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); - BUZZ(100, 659); - BUZZ(100, 698); -} - -#endif // HAS_M206_COMMAND diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M110.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M110.cpp deleted file mode 100644 index 4bdafb403a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M110.cpp +++ /dev/null @@ -1,31 +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 . - * - */ - -#include "../gcode.h" -#include "../queue.h" // for last_N - -/** - * M110: Set Current Line Number - */ -void GcodeSuite::M110() { - if (parser.seenval('N')) queue.last_N = parser.value_long(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M113.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M113.cpp deleted file mode 100644 index 6881837a5b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M113.cpp +++ /dev/null @@ -1,45 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(HOST_KEEPALIVE_FEATURE) - -#include "../gcode.h" - -/** - * M113: Get or set Host Keepalive interval (0 to disable) - * - * S Optional. Set the keepalive interval. - */ -void GcodeSuite::M113() { - if (parser.seenval('S')) { - host_keepalive_interval = parser.value_byte(); - NOMORE(host_keepalive_interval, 60); - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval); - } -} - -#endif // HOST_KEEPALIVE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M114.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M114.cpp deleted file mode 100644 index 68cbd2b8a4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M114.cpp +++ /dev/null @@ -1,199 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/stepper.h" - -#if ENABLED(M114_DETAIL) - - #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 "../../libs/L6470/L6470_Marlin.h" - #define DEBUG_OUT ENABLED(L6470_CHITCHAT) - #include "../../core/debug_out.h" - #endif - - void report_xyze(const xyze_pos_t &pos, const uint8_t n=4, const uint8_t precision=3) { - char str[12]; - for (uint8_t a = 0; a < n; a++) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[a]); - SERIAL_CHAR(':'); - SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); - } - SERIAL_EOL(); - } - - void report_xyz(const xyz_pos_t &pos, const uint8_t precision=3) { - char str[12]; - for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[a]); - SERIAL_CHAR(':'); - SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); - } - SERIAL_EOL(); - } - inline void report_xyz(const xyze_pos_t &pos) { report_xyze(pos, 3); } - - void report_current_position_detail() { - - SERIAL_ECHOPGM("\nLogical:"); - report_xyz(current_position.asLogical()); - - SERIAL_ECHOPGM("Raw: "); - report_xyz(current_position); - - xyze_pos_t leveled = current_position; - - #if HAS_LEVELING - SERIAL_ECHOPGM("Leveled:"); - planner.apply_leveling(leveled); - report_xyz(leveled); - - SERIAL_ECHOPGM("UnLevel:"); - xyze_pos_t unleveled = leveled; - planner.unapply_leveling(unleveled); - report_xyz(unleveled); - #endif - - #if IS_KINEMATIC - #if IS_SCARA - SERIAL_ECHOPGM("ScaraK: "); - #else - SERIAL_ECHOPGM("DeltaK: "); - #endif - inverse_kinematics(leveled); // writes delta[] - report_xyz(delta); - #endif - - planner.synchronize(); - - #if HAS_DRIVER(L6470) - char temp_buf[80]; - int32_t temp; - //#define ABS_POS_SIGN_MASK 0b1111 1111 1110 0000 0000 0000 0000 0000 - #define ABS_POS_SIGN_MASK 0b11111111111000000000000000000000 - #define REPORT_ABSOLUTE_POS(Q) do{ \ - L6470.say_axis(Q, false); \ - temp = L6470_GETPARAM(L6470_ABS_POS,Q); \ - if (temp & ABS_POS_SIGN_MASK) temp |= ABS_POS_SIGN_MASK; \ - sprintf_P(temp_buf, PSTR(":%8ld "), temp); \ - DEBUG_ECHO(temp_buf); \ - }while(0) - - DEBUG_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) - REPORT_ABSOLUTE_POS(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - REPORT_ABSOLUTE_POS(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - REPORT_ABSOLUTE_POS(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - REPORT_ABSOLUTE_POS(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - REPORT_ABSOLUTE_POS(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - REPORT_ABSOLUTE_POS(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - REPORT_ABSOLUTE_POS(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - REPORT_ABSOLUTE_POS(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - REPORT_ABSOLUTE_POS(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - REPORT_ABSOLUTE_POS(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - REPORT_ABSOLUTE_POS(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - REPORT_ABSOLUTE_POS(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - REPORT_ABSOLUTE_POS(E5); - #endif - SERIAL_EOL(); - #endif // HAS_DRIVER(L6470) - - SERIAL_ECHOPGM("Stepper:"); - LOOP_XYZE(i) { - SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); - SERIAL_CHAR(':'); - SERIAL_ECHO(stepper.position((AxisEnum)i)); - } - SERIAL_EOL(); - - #if IS_SCARA - const xy_float_t deg = { - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - }; - SERIAL_ECHOPGM("Degrees:"); - report_xyze(deg, 2); - #endif - - SERIAL_ECHOPGM("FromStp:"); - get_cartesian_from_steppers(); // writes 'cartes' (with forward kinematics) - xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.get_axis_position_mm(E_AXIS) }; - report_xyze(from_steppers); - - const xyze_float_t diff = from_steppers - leveled; - SERIAL_ECHOPGM("Diff: "); - report_xyze(diff); - } - -#endif // M114_DETAIL - -/** - * M114: Report current position to host - */ -void GcodeSuite::M114() { - - #if ENABLED(M114_DETAIL) - if (parser.seen('D')) { - report_current_position_detail(); - return; - } - if (parser.seen('E')) { - SERIAL_ECHOLNPAIR("Count E:", stepper.position(E_AXIS)); - return; - } - #endif - - planner.synchronize(); - report_current_position(); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M115.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M115.cpp deleted file mode 100644 index 8871644ff1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M115.cpp +++ /dev/null @@ -1,176 +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 . - * - */ - -#include "../gcode.h" -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EXTENDED_CAPABILITIES_REPORT) - static void cap_line(PGM_P const name, bool ena=false) { - SERIAL_ECHOPGM("Cap:"); - serialprintPGM(name); - SERIAL_CHAR(':'); - SERIAL_ECHOLN(int(ena ? 1 : 0)); - } -#endif - -/** - * M115: Capabilities string - */ -void GcodeSuite::M115() { - - SERIAL_ECHOLNPGM(MSG_M115_REPORT); - - #if ENABLED(EXTENDED_CAPABILITIES_REPORT) - - // SERIAL_XON_XOFF - cap_line(PSTR("SERIAL_XON_XOFF") - #if ENABLED(SERIAL_XON_XOFF) - , true - #endif - ); - - // BINARY_FILE_TRANSFER (M28 B1) - cap_line(PSTR("BINARY_FILE_TRANSFER") - #if ENABLED(BINARY_FILE_TRANSFER) - , true - #endif - ); - - // EEPROM (M500, M501) - cap_line(PSTR("EEPROM") - #if ENABLED(EEPROM_SETTINGS) - , true - #endif - ); - - // Volumetric Extrusion (M200) - cap_line(PSTR("VOLUMETRIC") - #if DISABLED(NO_VOLUMETRICS) - , true - #endif - ); - - // AUTOREPORT_TEMP (M155) - cap_line(PSTR("AUTOREPORT_TEMP") - #if ENABLED(AUTO_REPORT_TEMPERATURES) - , true - #endif - ); - - // PROGRESS (M530 S L, M531 , M532 X L) - cap_line(PSTR("PROGRESS")); - - // Print Job timer M75, M76, M77 - cap_line(PSTR("PRINT_JOB"), true); - - // AUTOLEVEL (G29) - cap_line(PSTR("AUTOLEVEL") - #if HAS_AUTOLEVEL - , true - #endif - ); - - // Z_PROBE (G30) - cap_line(PSTR("Z_PROBE") - #if HAS_BED_PROBE - , true - #endif - ); - - // MESH_REPORT (M420 V) - cap_line(PSTR("LEVELING_DATA") - #if HAS_LEVELING - , true - #endif - ); - - // BUILD_PERCENT (M73) - cap_line(PSTR("BUILD_PERCENT") - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - , true - #endif - ); - - // SOFTWARE_POWER (M80, M81) - cap_line(PSTR("SOFTWARE_POWER") - #if ENABLED(PSU_CONTROL) - , true - #endif - ); - - // CASE LIGHTS (M355) - cap_line(PSTR("TOGGLE_LIGHTS") - #if HAS_CASE_LIGHT - , true - #endif - ); - cap_line(PSTR("CASE_LIGHT_BRIGHTNESS") - #if HAS_CASE_LIGHT - , PWM_PIN(CASE_LIGHT_PIN) - #endif - ); - - // EMERGENCY_PARSER (M108, M112, M410, M876) - cap_line(PSTR("EMERGENCY_PARSER") - #if ENABLED(EMERGENCY_PARSER) - , true - #endif - ); - - // PROMPT SUPPORT (M876) - cap_line(PSTR("PROMPT_SUPPORT") - #if ENABLED(HOST_PROMPT_SUPPORT) - , true - #endif - ); - - // AUTOREPORT_SD_STATUS (M27 extension) - cap_line(PSTR("AUTOREPORT_SD_STATUS") - #if ENABLED(AUTO_REPORT_SD_STATUS) - , true - #endif - ); - - // THERMAL_PROTECTION - cap_line(PSTR("THERMAL_PROTECTION") - #if ENABLED(THERMAL_PROTECTION_HOTENDS) && (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) && (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER) - , true - #endif - ); - - // MOTION_MODES (M80-M89) - cap_line(PSTR("MOTION_MODES") - #if ENABLED(GCODE_MOTION_MODES) - , true - #endif - ); - - // CHAMBER_TEMPERATURE (M141, M191) - cap_line(PSTR("CHAMBER_TEMPERATURE") - #if HAS_HEATED_CHAMBER - , true - #endif - ); - - - #endif // EXTENDED_CAPABILITIES_REPORT -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M118.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M118.cpp deleted file mode 100644 index 3d8a84fb5f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M118.cpp +++ /dev/null @@ -1,75 +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 . - * - */ - -#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 = 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_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M119.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M119.cpp deleted file mode 100644 index a13fa67b79..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M119.cpp +++ /dev/null @@ -1,33 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/endstops.h" - -/** - * M119: Output endstop states to serial output - */ -void GcodeSuite::M119() { - - endstops.report_states(); - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M16.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M16.cpp deleted file mode 100644 index 9219155011..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M16.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(EXPECTED_PRINTER_CHECK) - -#include "../gcode.h" -#include "../../Marlin.h" - -/** - * M16: Expected Printer Check - */ -void GcodeSuite::M16() { - - if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME))) - kill(GET_TEXT(MSG_EXPECTED_PRINTER)); - -} - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M876.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M876.cpp deleted file mode 100644 index e3360ac95d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/host/M876.cpp +++ /dev/null @@ -1,37 +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 . - * - */ -#include "../../inc/MarlinConfig.h" - -#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) - -#include "../../feature/host_actions.h" -#include "../gcode.h" -#include "../../Marlin.h" - -/** - * M876: Handle Prompt Response - */ -void GcodeSuite::M876() { - if (parser.seenval('S')) host_response_handler((uint8_t)parser.value_int()); -} - -#endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M0_M1.cpp deleted file mode 100644 index 5bf9e94325..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M0_M1.cpp +++ /dev/null @@ -1,122 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_RESUME_CONTINUE - -#include "../gcode.h" -#include "../../module/stepper.h" - -#if HAS_LCD_MENU - #include "../../lcd/ultralcd.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -#include "../../sd/cardreader.h" - -#if HAS_LEDS_OFF_FLAG - #include "../../feature/leds/printer_event_leds.h" -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../../feature/host_actions.h" -#endif - -/** - * M0: Unconditional stop - Wait for user button press on LCD - * M1: Conditional stop - Wait for user button press on LCD - */ -void GcodeSuite::M0_M1() { - const char * const args = parser.string_arg; - - millis_t ms = 0; - bool hasP = false, hasS = false; - if (parser.seenval('P')) { - ms = parser.value_millis(); // milliseconds to wait - hasP = ms > 0; - } - if (parser.seenval('S')) { - ms = parser.value_millis_from_seconds(); // seconds to wait - hasS = ms > 0; - } - - const bool has_message = !hasP && !hasS && args && *args; - - planner.synchronize(); - - #if HAS_LCD_MENU - - if (has_message) - ui.set_status(args, true); - else { - LCD_MESSAGEPGM(MSG_USERWAIT); - #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - ui.reset_progress_bar_timeout(); - #endif - } - - #elif ENABLED(EXTENSIBLE_UI) - - if (has_message) - ExtUI::onUserConfirmRequired(args); // Can this take an SRAM string?? - else - ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT)); - - #else - - if (has_message) { - SERIAL_ECHO_START(); - SERIAL_ECHOLN(args); - } - - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), CONTINUE_STR); - #endif - - if (ms > 0) { - ms += millis(); // wait until this time for a click - while (PENDING(millis(), ms) && wait_for_user) idle(); - } - else - while (wait_for_user) idle(); - - #if HAS_LEDS_OFF_FLAG - printerEventLEDs.onResumeAfterWait(); - #endif - - #if HAS_LCD_MENU - ui.reset_status(); - #endif - - wait_for_user = false; -} - -#endif // HAS_RESUME_CONTINUE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M117.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M117.cpp deleted file mode 100644 index 118b55fe37..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M117.cpp +++ /dev/null @@ -1,36 +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 . - * - */ - -#include "../gcode.h" -#include "../../lcd/ultralcd.h" - -/** - * M117: Set LCD Status Message - */ -void GcodeSuite::M117() { - - if (parser.string_arg && parser.string_arg[0]) - ui.set_status(parser.string_arg); - else - ui.reset_status(); - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M145.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M145.cpp deleted file mode 100644 index 297ece268e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M145.cpp +++ /dev/null @@ -1,61 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HOTENDS && HAS_LCD_MENU - -#include "../gcode.h" -#include "../../lcd/ultralcd.h" - -/** - * M145: Set the heatup state for a material in the LCD menu - * - * S - * H - * B - * F - */ -void GcodeSuite::M145() { - const uint8_t material = (uint8_t)parser.intval('S'); - if (material >= COUNT(ui.preheat_hotend_temp)) - SERIAL_ERROR_MSG(MSG_ERR_MATERIAL_INDEX); - else { - int v; - if (parser.seenval('H')) { - v = parser.value_int(); - ui.preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); - } - if (parser.seenval('F')) { - v = parser.value_int(); - ui.preheat_fan_speed[material] = (uint8_t)constrain(v, 0, 255); - } - #if TEMP_SENSOR_BED != 0 - if (parser.seenval('B')) { - v = parser.value_int(); - ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 10); - } - #endif - } -} - -#endif // HOTENDS && HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M250.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M250.cpp deleted file mode 100644 index 68c46fcfdd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M250.cpp +++ /dev/null @@ -1,38 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_LCD_CONTRAST - -#include "../gcode.h" -#include "../../lcd/ultralcd.h" - -/** - * M250: Read and optionally set the LCD contrast - */ -void GcodeSuite::M250() { - if (parser.seen('C')) ui.set_contrast(parser.value_int()); - SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast); -} - -#endif // HAS_LCD_CONTRAST diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M300.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M300.cpp deleted file mode 100644 index ec2024ae2f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M300.cpp +++ /dev/null @@ -1,45 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_BUZZER - -#include "../gcode.h" - -#include "../../lcd/ultralcd.h" // i2c-based BUZZ -#include "../../libs/buzzer.h" // Buzzer, if possible - -/** - * M300: Play beep sound S P - */ -void GcodeSuite::M300() { - uint16_t const frequency = parser.ushortval('S', 260); - uint16_t duration = parser.ushortval('P', 1000); - - // Limits the tone duration to 0-5 seconds. - NOMORE(duration, 5000U); - - BUZZ(duration, frequency); -} - -#endif // HAS_BUZZER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M73.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M73.cpp deleted file mode 100644 index 14d4d63813..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/lcd/M73.cpp +++ /dev/null @@ -1,51 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(LCD_SET_PROGRESS_MANUALLY) - -#include "../gcode.h" -#include "../../lcd/ultralcd.h" -#include "../../sd/cardreader.h" - -/** - * M73: Set percentage complete (for display on LCD) - * - * Example: - * M73 P25 ; Set progress to 25% - * - * Notes: - * This has no effect during an SD print job - */ -void GcodeSuite::M73() { - if (parser.seen('P')) - ui.set_progress((PROGRESS_SCALE) > 1 - ? parser.value_float() * (PROGRESS_SCALE) - : parser.value_byte() - ); - #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - if (parser.seen('R')) ui.set_remaining_time(60 * parser.value_ulong()); - #endif -} - -#endif // LCD_SET_PROGRESS_MANUALLY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G0_G1.cpp deleted file mode 100644 index 36bc29026e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G0_G1.cpp +++ /dev/null @@ -1,125 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/motion.h" - -#include "../../Marlin.h" - -#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - #include "../../feature/fwretract.h" -#endif - -#include "../../sd/cardreader.h" - -#if ENABLED(NANODLP_Z_SYNC) - #include "../../module/stepper.h" -#endif - -extern xyze_pos_t destination; - -#if ENABLED(VARIABLE_G0_FEEDRATE) - feedRate_t fast_move_feedrate = MMM_TO_MMS(G0_FEEDRATE); -#endif - -/** - * G0, G1: Coordinated movement of X Y Z E axes - */ -void GcodeSuite::G0_G1( - #if IS_SCARA || defined(G0_FEEDRATE) - const bool fast_move/*=false*/ - #endif -) { - - if (IsRunning() - #if ENABLED(NO_MOTION_BEFORE_HOMING) - && !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 - feedRate_t old_feedrate; - #if ENABLED(VARIABLE_G0_FEEDRATE) - if (fast_move) { - 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(); // Process X Y Z E F parameters - - #ifdef G0_FEEDRATE - if (fast_move) { - #if ENABLED(VARIABLE_G0_FEEDRATE) - fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0 - #else - 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 - } - #endif - - #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - - if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { - // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves - if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { - const float echange = destination.e - current_position.e; - // Is this a retract or recover move? - if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) { - current_position.e = destination.e; // Hide a G1-based retract/recover from calculations - sync_plan_position_e(); // AND from the planner - return fwretract.retract(echange < 0.0); // Firmware-based retract/recover (double-retract ignored) - } - } - } - - #endif // FWRETRACT - - #if IS_SCARA - 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 = old_feedrate; - #endif - - #if ENABLED(NANODLP_Z_SYNC) - #if ENABLED(NANODLP_ALL_AXIS) - #define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message - #else - #define _MOVE_SYNC parser.seenval('Z') // Only for Z move - #endif - if (_MOVE_SYNC) { - planner.synchronize(); - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - } - #endif - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G2_G3.cpp deleted file mode 100644 index 6fecbdc0cc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G2_G3.cpp +++ /dev/null @@ -1,335 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(ARC_SUPPORT) - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/planner.h" -#include "../../module/temperature.h" - -#if ENABLED(DELTA) - #include "../../module/delta.h" -#elif ENABLED(SCARA) - #include "../../module/scara.h" -#endif - -#if N_ARC_CORRECTION < 1 - #undef N_ARC_CORRECTION - #define N_ARC_CORRECTION 1 -#endif - -/** - * Plan an arc in 2 dimensions - * - * The arc is approximated by generating many small linear segments. - * The length of each segment is configured in MM_PER_ARC_SEGMENT (Default 1mm) - * Arcs should only be made relatively large (over 5mm), as larger arcs with - * larger segments will tend to be more efficient. Your slicer should have - * options for G2/G3 arc generation. In future these options may be GCode tunable. - */ -void plan_arc( - const xyze_pos_t &cart, // Destination position - const ab_float_t &offset, // Center of rotation relative to current_position - const uint8_t clockwise // Clockwise? -) { - #if ENABLED(CNC_WORKSPACE_PLANES) - AxisEnum p_axis, q_axis, l_axis; - switch (gcode.workspace_plane) { - default: - case GcodeSuite::PLANE_XY: p_axis = X_AXIS; q_axis = Y_AXIS; l_axis = Z_AXIS; break; - case GcodeSuite::PLANE_YZ: p_axis = Y_AXIS; q_axis = Z_AXIS; l_axis = X_AXIS; break; - case GcodeSuite::PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; - } - #else - constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS, l_axis = Z_AXIS; - #endif - - // Radius vector from center to current location - ab_float_t rvec = -offset; - - const float radius = HYPOT(rvec.a, rvec.b), - #if ENABLED(AUTO_BED_LEVELING_UBL) - start_L = current_position[l_axis], - #endif - center_P = current_position[p_axis] - rvec.a, - center_Q = current_position[q_axis] - rvec.b, - rt_X = cart[p_axis] - center_P, - rt_Y = cart[q_axis] - center_Q, - linear_travel = cart[l_axis] - current_position[l_axis], - extruder_travel = cart.e - current_position.e; - - // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. - float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); - if (angular_travel < 0) angular_travel += RADIANS(360); - #ifdef MIN_ARC_SEGMENTS - uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * (angular_travel / RADIANS(360))); - NOLESS(min_segments, 1U); - #else - constexpr uint16_t min_segments = 1; - #endif - if (clockwise) angular_travel -= RADIANS(360); - - // Make a circle if the angular rotation is 0 and the target is current position - if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) { - angular_travel = RADIANS(360); - #ifdef MIN_ARC_SEGMENTS - min_segments = MIN_ARC_SEGMENTS; - #endif - } - - const float flat_mm = radius * angular_travel, - mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm); - if (mm_of_travel < 0.001f) return; - - uint16_t segments = FLOOR(mm_of_travel / (MM_PER_ARC_SEGMENT)); - NOLESS(segments, min_segments); - - /** - * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector, - * and phi is the angle of rotation. Based on the solution approach by Jens Geisler. - * r_T = [cos(phi) -sin(phi); - * sin(phi) cos(phi)] * r ; - * - * For arc generation, the center of the circle is the axis of rotation and the radius vector is - * defined from the circle center to the initial position. Each line segment is formed by successive - * vector rotations. This requires only two cos() and sin() computations to form the rotation - * matrix for the duration of the entire arc. Error may accumulate from numerical round-off, since - * all double numbers are single precision on the Arduino. (True double precision will not have - * round off issues for CNC applications.) Single precision error can accumulate to be greater than - * tool precision in some cases. Therefore, arc path correction is implemented. - * - * Small angle approximation may be used to reduce computation overhead further. This approximation - * holds for everything, but very small circles and large MM_PER_ARC_SEGMENT values. In other words, - * theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large - * to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for - * numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an - * issue for CNC machines with the single precision Arduino calculations. - * - * This approximation also allows plan_arc to immediately insert a line segment into the planner - * without the initial overhead of computing cos() or sin(). By the time the arc needs to be applied - * a correction, the planner should have caught up to the lag caused by the initial plan_arc overhead. - * This is important when there are successive arc motions. - */ - // Vector rotation matrix values - xyze_pos_t raw; - const float theta_per_segment = angular_travel / segments, - linear_per_segment = linear_travel / segments, - extruder_per_segment = extruder_travel / segments, - sin_T = theta_per_segment, - cos_T = 1 - 0.5f * sq(theta_per_segment); // Small angle approximation - - // Initialize the linear axis - raw[l_axis] = current_position[l_axis]; - - // Initialize the extruder axis - raw.e = current_position.e; - - const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = scaled_fr_mm_s / MM_PER_ARC_SEGMENT; - #endif - - millis_t next_idle_ms = millis() + 200UL; - - #if N_ARC_CORRECTION > 1 - int8_t arc_recalc_count = N_ARC_CORRECTION; - #endif - - for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times - - thermalManager.manage_heater(); - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - #if N_ARC_CORRECTION > 1 - if (--arc_recalc_count) { - // Apply vector rotation matrix to previous rvec.a / 1 - const float r_new_Y = rvec.a * sin_T + rvec.b * cos_T; - rvec.a = rvec.a * cos_T - rvec.b * sin_T; - rvec.b = r_new_Y; - } - else - #endif - { - #if N_ARC_CORRECTION > 1 - arc_recalc_count = N_ARC_CORRECTION; - #endif - - // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments. - // Compute exact location by applying transformation matrix from initial radius vector(=-offset). - // To reduce stuttering, the sin and cos could be computed at different times. - // For now, compute both at the same time. - const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); - rvec.a = -offset[0] * cos_Ti + offset[1] * sin_Ti; - rvec.b = -offset[0] * sin_Ti - offset[1] * cos_Ti; - } - - // Update raw location - raw[p_axis] = center_P + rvec.a; - raw[q_axis] = center_Q + rvec.b; - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[l_axis] = start_L; - UNUSED(linear_per_segment); - #else - raw[l_axis] += linear_per_segment; - #endif - raw.e += extruder_per_segment; - - apply_motion_limits(raw); - - #if HAS_LEVELING && !PLANNER_LEVELING - planner.apply_leveling(raw); - #endif - - if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - )) - break; - } - - // Ensure last segment arrives at target location. - raw = cart; - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[l_axis] = start_L; - #endif - - apply_motion_limits(raw); - - #if HAS_LEVELING && !PLANNER_LEVELING - planner.apply_leveling(raw); - #endif - - planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[l_axis] = start_L; - #endif - current_position = raw; -} // plan_arc - -/** - * G2: Clockwise Arc - * G3: Counterclockwise Arc - * - * This command has two forms: IJ-form (JK, KI) and R-form. - * - * - Depending on the current Workspace Plane orientation, - * use parameters IJ/JK/KI to specify the XY/YZ/ZX offsets. - * At least one of the IJ/JK/KI parameters is required. - * XY/YZ/ZX can be omitted to do a complete circle. - * The given XY/YZ/ZX is not error-checked. The arc ends - * based on the angle of the destination. - * Mixing IJ/JK/KI with R will throw an error. - * - * - R specifies the radius. X or Y (Y or Z / Z or X) is required. - * Omitting both XY/YZ/ZX will throw an error. - * XY/YZ/ZX must differ from the current XY/YZ/ZX. - * Mixing R with IJ/JK/KI will throw an error. - * - * - P specifies the number of full circles to do - * before the specified arc move. - * - * Examples: - * - * G2 I10 ; CW circle centered at X+10 - * G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12 - */ -void GcodeSuite::G2_G3(const bool clockwise) { - if (MOTION_CONDITIONS) { - - #if ENABLED(SF_ARC_FIX) - const bool relative_mode_backup = relative_mode; - relative_mode = true; - #endif - - get_destination_from_command(); - - #if ENABLED(SF_ARC_FIX) - relative_mode = relative_mode_backup; - #endif - - ab_float_t arc_offset = { 0, 0 }; - if (parser.seenval('R')) { - const float r = parser.value_linear_units(); - if (r) { - const xy_pos_t p1 = current_position, p2 = destination; - if (p1 != p2) { - const xy_pos_t d2 = (p2 - p1) * 0.5f; // XY vector to midpoint of move from current - const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 - len = d2.magnitude(), // Distance to mid-point of move from current - h2 = (r - len) * (r + len), // factored to reduce rounding error - h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint - const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.) - arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len) - } - } - } - else { - #if ENABLED(CNC_WORKSPACE_PLANES) - char achar, bchar; - switch (gcode.workspace_plane) { - default: - case GcodeSuite::PLANE_XY: achar = 'I'; bchar = 'J'; break; - case GcodeSuite::PLANE_YZ: achar = 'J'; bchar = 'K'; break; - case GcodeSuite::PLANE_ZX: achar = 'K'; bchar = 'I'; break; - } - #else - constexpr char achar = 'I', bchar = 'J'; - #endif - if (parser.seenval(achar)) arc_offset.a = parser.value_linear_units(); - if (parser.seenval(bchar)) arc_offset.b = parser.value_linear_units(); - } - - if (arc_offset) { - - #if ENABLED(ARC_P_CIRCLES) - // P indicates number of circles to do - int8_t circles_to_do = parser.byteval('P'); - if (!WITHIN(circles_to_do, 0, 100)) - SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); - - while (circles_to_do--) - plan_arc(current_position, arc_offset, clockwise); - #endif - - // Send the arc to the planner - plan_arc(destination, arc_offset, clockwise); - reset_stepper_timeout(); - } - else - SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); - } -} - -#endif // ARC_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G4.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G4.cpp deleted file mode 100644 index 50606689a1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G4.cpp +++ /dev/null @@ -1,44 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/stepper.h" -#include "../../lcd/ultralcd.h" - -/** - * G4: Dwell S or P - */ -void GcodeSuite::G4() { - millis_t dwell_ms = 0; - - if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait - if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait - - planner.synchronize(); - #if ENABLED(NANODLP_Z_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); - #endif - - if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL); - - dwell(dwell_ms); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G5.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G5.cpp deleted file mode 100644 index 7125532e9b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G5.cpp +++ /dev/null @@ -1,65 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(BEZIER_CURVE_SUPPORT) - -#include "../../module/motion.h" -#include "../../module/planner_bezier.h" - -/** - * Parameters interpreted according to: - * http://linuxcnc.org/docs/2.6/html/gcode/parser.html#sec:G5-Cubic-Spline - * However I, J omission is not supported at this point; all - * parameters can be omitted and default to zero. - */ - -#include "../gcode.h" -#include "../../Marlin.h" // for IsRunning() - -/** - * G5: Cubic B-spline - */ -void GcodeSuite::G5() { - if (MOTION_CONDITIONS) { - - #if ENABLED(CNC_WORKSPACE_PLANES) - if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_MSG(MSG_ERR_BAD_PLANE_MODE); - return; - } - #endif - - get_destination_from_command(); - - const xy_pos_t offsets[2] = { - { parser.linearval('I'), parser.linearval('J') }, - { parser.linearval('P'), parser.linearval('Q') } - }; - - cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder); - current_position = destination; - } -} - -#endif // BEZIER_CURVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G80.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G80.cpp deleted file mode 100644 index e6bc537eca..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/G80.cpp +++ /dev/null @@ -1,38 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(GCODE_MOTION_MODES) - -#include "../gcode.h" - -/** - * G80: Cancel current motion mode - */ -void GcodeSuite::G80() { - - parser.cancel_motion_mode(); - -} - -#endif // GCODE_MOTION_MODES diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/M290.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/M290.cpp deleted file mode 100644 index e5b5b7e76d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/motion/M290.cpp +++ /dev/null @@ -1,141 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(BABYSTEPPING) - -#include "../gcode.h" -#include "../../feature/babystep.h" -#include "../../module/probe.h" -#include "../../module/temperature.h" -#include "../../module/planner.h" - -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - #include "../../core/serial.h" -#endif - -#if ENABLED(MESH_BED_LEVELING) - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - - FORCE_INLINE void mod_probe_offset(const float &offs) { - if (true - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - && active_extruder == 0 - #endif - ) { - probe_offset.z += offs; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", probe_offset.z); - } - else { - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - hotend_offset[active_extruder].z -= offs; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", hotend_offset[active_extruder].z); - #endif - } - } - -#endif - -/** - * M290: Babystepping - * - * Send 'R' or no parameters for a report. - * - * X - Distance to step X - * Y - Distance to step Y - * Z - Distance to step Z - * S - Distance to step Z (alias for Z) - * - * With BABYSTEP_ZPROBE_OFFSET: - * P0 - Don't adjust the Z probe offset - */ -void GcodeSuite::M290() { - #if ENABLED(BABYSTEP_XY) - for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) - if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) { - const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2); - babystep.add_mm((AxisEnum)a, offs); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_probe_offset(offs); - #endif - } - #else - if (parser.seenval('Z') || parser.seenval('S')) { - const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2); - babystep.add_mm(Z_AXIS, offs); - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (!parser.seen('P') || parser.value_bool()) mod_probe_offset(offs); - #endif - } - #endif - - if (!parser.seen("XYZ") || parser.seen('R')) { - SERIAL_ECHO_START(); - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " " MSG_Z, probe_offset.z); - #endif - - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - { - SERIAL_ECHOLNPAIR_P( - PSTR("Hotend "), int(active_extruder) - #if ENABLED(BABYSTEP_XY) - , PSTR("Offset X"), hotend_offset[active_extruder].x - , SP_Y_STR, hotend_offset[active_extruder].y - , SP_Z_STR - #else - , PSTR("Offset Z") - #endif - , hotend_offset[active_extruder].z - ); - } - #endif - - #if ENABLED(MESH_BED_LEVELING) - SERIAL_ECHOLNPAIR("MBL Adjust Z", mbl.z_offset); - #endif - - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - { - SERIAL_ECHOLNPAIR_P( - #if ENABLED(BABYSTEP_XY) - PSTR("Babystep X"), babystep.axis_total[X_AXIS] - , SP_Y_STR, babystep.axis_total[Y_AXIS] - , SP_Z_STR - #else - PSTR("Babystep Z") - #endif - , babystep.axis_total[BS_TODO_AXIS(Z_AXIS)] - ); - } - #endif - } -} - -#endif // BABYSTEPPING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.cpp deleted file mode 100644 index bcb3e69e3d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.cpp +++ /dev/null @@ -1,381 +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 . - * - */ - -/** - * parser.cpp - Parser for a GCode line, providing a parameter interface. - */ - -#include "parser.h" - -#include "../Marlin.h" - -#if NUM_SERIAL > 1 - #include "queue.h" -#endif - -// Must be declared for allocation and to satisfy the linker -// Zero values need no initialization. - -bool GCodeParser::volumetric_enabled; - -#if ENABLED(INCH_MODE_SUPPORT) - float GCodeParser::linear_unit_factor, GCodeParser::volumetric_unit_factor; -#endif - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - TempUnit GCodeParser::input_temp_units = TEMPUNIT_C; -#endif - -char *GCodeParser::command_ptr, - *GCodeParser::string_arg, - *GCodeParser::value_ptr; -char GCodeParser::command_letter; -int GCodeParser::codenum; - -#if USE_GCODE_SUBCODES - uint8_t GCodeParser::subcode; -#endif - -#if ENABLED(GCODE_MOTION_MODES) - int16_t GCodeParser::motion_mode_codenum = -1; - #if USE_GCODE_SUBCODES - uint8_t GCodeParser::motion_mode_subcode; - #endif -#endif - -#if ENABLED(FASTER_GCODE_PARSER) - // Optimized Parameters - uint32_t GCodeParser::codebits; // found bits - uint8_t GCodeParser::param[26]; // parameter offsets from command_ptr -#else - char *GCodeParser::command_args; // start of parameters -#endif - -// Create a global instance of the GCode parser singleton -GCodeParser parser; - -/** - * Clear all code-seen (and value pointers) - * - * Since each param is set/cleared on seen codes, - * this may be optimized by commenting out ZERO(param) - */ -void GCodeParser::reset() { - string_arg = nullptr; // No whole line argument - command_letter = '?'; // No command letter - codenum = 0; // No command code - #if USE_GCODE_SUBCODES - subcode = 0; // No command sub-code - #endif - #if ENABLED(FASTER_GCODE_PARSER) - codebits = 0; // No codes yet - //ZERO(param); // No parameters (should be safe to comment out this line) - #endif -} - -// Populate all fields by parsing a single line of GCode -// 58 bytes of SRAM are used to speed up seen/value -void GCodeParser::parse(char *p) { - - reset(); // No codes to report - - // Skip spaces - while (*p == ' ') ++p; - - // Skip N[-0-9] if included in the command line - if (*p == 'N' && NUMERIC_SIGNED(p[1])) { - #if ENABLED(FASTER_GCODE_PARSER) - //set('N', p + 1); // (optional) Set the 'N' parameter value - #endif - p += 2; // skip N[-0-9] - while (NUMERIC(*p)) ++p; // skip [0-9]* - while (*p == ' ') ++p; // skip [ ]* - } - - // *p now points to the current command, which should be G, M, or T - command_ptr = p; - - // Get the command letter, which must be G, M, or T - const char letter = *p++; - - // Nullify asterisk and trailing whitespace - char *starpos = strchr(p, '*'); - if (starpos) { - --starpos; // * - while (*starpos == ' ') --starpos; // spaces... - starpos[1] = '\0'; - } - - #if ENABLED(GCODE_MOTION_MODES) - #if ENABLED(ARC_SUPPORT) - #define GTOP 3 - #else - #define GTOP 1 - #endif - #endif - - // Bail if the letter is not G, M, or T - // (or a valid parameter for the current motion mode) - switch (letter) { - - case 'G': case 'M': case 'T': - #if ENABLED(CANCEL_OBJECTS) - case 'O': - #endif - // Skip spaces to get the numeric part - while (*p == ' ') p++; - - #if ENABLED(PRUSA_MMU2) - if (letter == 'T') { - // check for special MMU2 T?/Tx/Tc commands - if (*p == '?' || *p == 'x' || *p == 'c') { - command_letter = letter; - string_arg = p; - return; - } - } - #endif - - // Bail if there's no command code number - if (!NUMERIC(*p)) return; - - // Save the command letter at this point - // A '?' signifies an unknown command - command_letter = letter; - - // Get the code number - integer digits only - codenum = 0; - do { codenum *= 10, codenum += *p++ - '0'; } while (NUMERIC(*p)); - - // Allow for decimal point in command - #if USE_GCODE_SUBCODES - if (*p == '.') { - p++; - while (NUMERIC(*p)) - subcode *= 10, subcode += *p++ - '0'; - } - #endif - - // Skip all spaces to get to the first argument, or nul - while (*p == ' ') p++; - - #if ENABLED(GCODE_MOTION_MODES) - if (letter == 'G' && (codenum <= GTOP || codenum == 5 - #if ENABLED(G38_PROBE_TARGET) - || codenum == 38 - #endif - ) - ) { - motion_mode_codenum = codenum; - #if USE_GCODE_SUBCODES - motion_mode_subcode = subcode; - #endif - } - #endif - - break; - - #if ENABLED(GCODE_MOTION_MODES) - #if ENABLED(ARC_SUPPORT) - case 'I': case 'J': case 'R': - if (motion_mode_codenum != 2 && motion_mode_codenum != 3) return; - #endif - case 'P': case 'Q': - if (motion_mode_codenum != 5) return; - case 'X': case 'Y': case 'Z': case 'E': case 'F': - if (motion_mode_codenum < 0) return; - command_letter = 'G'; - codenum = motion_mode_codenum; - #if USE_GCODE_SUBCODES - subcode = motion_mode_subcode; - #endif - p--; // Back up one character to use the current parameter - break; - #endif // GCODE_MOTION_MODES - - default: return; - } - - // The command parameters (if any) start here, for sure! - - #if DISABLED(FASTER_GCODE_PARSER) - command_args = p; // Scan for parameters in seen() - #endif - - // Only use string_arg for these M codes - if (letter == 'M') switch (codenum) { - #if ENABLED(GCODE_MACROS) - case 810 ... 819: - #endif - #if ENABLED(EXPECTED_PRINTER_CHECK) - case 16: - #endif - case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; - default: break; - } -/* - #if ENABLED(CANCEL_OBJECTS) - if (letter == 'O') switch (codenum) { - case 1: string_arg = p; return; - default: break; - } - #endif -*/ - #if ENABLED(DEBUG_GCODE_PARSER) - const bool debug = codenum == 800; - #endif - - /** - * Find all parameters, set flags and pointers for fast parsing - * - * Most codes ignore 'string_arg', but those that want a string will get the right pointer. - * The following loop assigns the first "parameter" having no numeric value to 'string_arg'. - * This allows M0/M1 with expire time to work: "M0 S5 You Win!" - * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' - */ - string_arg = nullptr; - while (const char code = *p++) { // Get the next parameter. A NUL ends the loop - - // Special handling for M32 [P] !/path/to/file.g# - // The path must be the last parameter - if (code == '!' && letter == 'M' && codenum == 32) { - string_arg = p; // Name starts after '!' - char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering) - if (lb) *lb = '\0'; // Safe to mark the end of the filename - return; - } - - // Arguments MUST be uppercase for fast GCode parsing - #if ENABLED(FASTER_GCODE_PARSER) - #define PARAM_TEST WITHIN(code, 'A', 'Z') - #else - #define PARAM_TEST true - #endif - - if (PARAM_TEST) { - - while (*p == ' ') p++; // Skip spaces between parameters & values - - const bool has_num = valid_float(p); - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) { - SERIAL_ECHOPAIR("Got letter ", code, " at index ", (int)(p - command_ptr - 1)); - if (has_num) SERIAL_ECHOPGM(" (has_num)"); - } - #endif - - if (!has_num && !string_arg) { // No value? First time, keep as string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_EOL(); - #endif - - #if ENABLED(FASTER_GCODE_PARSER) - set(code, has_num ? p : nullptr); // Set parameter exists and pointer (nullptr for no number) - #endif - } - else if (!string_arg) { // Not A-Z? First time, keep as the string_arg - string_arg = p - 1; - #if ENABLED(DEBUG_GCODE_PARSER) - if (debug) SERIAL_ECHOPAIR(" string_arg: ", hex_address((void*)string_arg)); // DEBUG - #endif - } - - if (!WITHIN(*p, 'A', 'Z')) { // Another parameter right away? - while (*p && DECIMAL_SIGNED(*p)) p++; // Skip over the value section of a parameter - while (*p == ' ') p++; // Skip over all spaces - } - } -} - -#if ENABLED(CNC_COORDINATE_SYSTEMS) - - // Parse the next parameter as a new command - bool GCodeParser::chain() { - #if ENABLED(FASTER_GCODE_PARSER) - char *next_command = command_ptr; - if (next_command) { - while (*next_command && *next_command != ' ') ++next_command; - while (*next_command == ' ') ++next_command; - if (!*next_command) next_command = nullptr; - } - #else - const char *next_command = command_args; - #endif - if (next_command) parse(next_command); - return !!next_command; - } - -#endif // CNC_COORDINATE_SYSTEMS - -void GCodeParser::unknown_command_error() { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_UNKNOWN_COMMAND, command_ptr, "\""); -} - -#if ENABLED(DEBUG_GCODE_PARSER) - - void GCodeParser::debug() { - SERIAL_ECHOPAIR("Command: ", command_ptr, " (", command_letter); - SERIAL_ECHO(codenum); - SERIAL_ECHOLNPGM(")"); - #if ENABLED(FASTER_GCODE_PARSER) - SERIAL_ECHOPGM(" args: { "); - for (char c = 'A'; c <= 'Z'; ++c) if (seen(c)) { SERIAL_CHAR(c); SERIAL_CHAR(' '); } - SERIAL_CHAR('}'); - #else - SERIAL_ECHOPAIR(" args: { ", command_args, " }"); - #endif - if (string_arg) SERIAL_ECHOPAIR(" string: \"", string_arg, "\""); - SERIAL_ECHOLNPGM("\n"); - for (char c = 'A'; c <= 'Z'; ++c) { - if (seen(c)) { - SERIAL_ECHOPAIR("Code '", c); SERIAL_ECHOPGM("':"); - if (has_value()) { - SERIAL_ECHOPAIR( - "\n float: ", value_float(), - "\n long: ", value_long(), - "\n ulong: ", value_ulong(), - "\n millis: ", value_millis(), - "\n sec-ms: ", value_millis_from_seconds(), - "\n int: ", value_int(), - "\n ushort: ", value_ushort(), - "\n byte: ", (int)value_byte(), - "\n bool: ", (int)value_bool(), - "\n linear: ", value_linear_units(), - "\n celsius: ", value_celsius() - ); - } - else - SERIAL_ECHOPGM(" (no value)"); - SERIAL_ECHOLNPGM("\n"); - } - } - } - -#endif // DEBUG_GCODE_PARSER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.h deleted file mode 100644 index 2e91216a64..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/parser.h +++ /dev/null @@ -1,384 +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 - -/** - * parser.h - Parser for a GCode line, providing a parameter interface. - * Codes like M149 control the way the GCode parser behaves, - * so settings for these codes are located in this class. - */ - -#include "../inc/MarlinConfig.h" - -//#define DEBUG_GCODE_PARSER -#if ENABLED(DEBUG_GCODE_PARSER) - #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 - * - * - Parse a single gcode line for its letter, code, subcode, and parameters - * - FASTER_GCODE_PARSER: - * - Flags existing params (1 bit each) - * - Stores value offsets (1 byte each) - * - Provide accessors for parameters: - * - Parameter exists - * - Parameter has value - * - Parameter value in different units and types - */ -class GCodeParser { - -private: - static char *value_ptr; // Set by seen, used to fetch the value - - #if ENABLED(FASTER_GCODE_PARSER) - static uint32_t codebits; // Parameters pre-scanned - static uint8_t param[26]; // For A-Z, offsets into command args - #else - static char *command_args; // Args start here, for slow scan - #endif - -public: - - // Global states for GCode-level units features - - static bool volumetric_enabled; - - #if ENABLED(INCH_MODE_SUPPORT) - static float linear_unit_factor, volumetric_unit_factor; - #endif - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static TempUnit input_temp_units; - #endif - - // Command line state - static char *command_ptr, // The command, so it can be echoed - *string_arg, // string of command line - command_letter; // G, M, or T - static int codenum; // 123 - #if USE_GCODE_SUBCODES - static uint8_t subcode; // .1 - #endif - - #if ENABLED(GCODE_MOTION_MODES) - static int16_t motion_mode_codenum; - #if USE_GCODE_SUBCODES - static uint8_t motion_mode_subcode; - #endif - FORCE_INLINE static void cancel_motion_mode() { motion_mode_codenum = -1; } - #endif - - #if ENABLED(DEBUG_GCODE_PARSER) - static void debug(); - #endif - - // Reset is done before parsing - static void reset(); - - #define LETTER_BIT(N) ((N) - 'A') - - FORCE_INLINE static bool valid_signless(const char * const p) { - return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9] - } - - FORCE_INLINE static bool valid_float(const char * const p) { - return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9] - } - - #if ENABLED(FASTER_GCODE_PARSER) - - FORCE_INLINE static bool valid_int(const char * const p) { - return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9] - } - - // Set the flag and pointer for a parameter - static inline void set(const char c, char * const ptr) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return; // Only A-Z - SBI32(codebits, ind); // parameter exists - param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0 - #if ENABLED(DEBUG_GCODE_PARSER) - if (codenum == 800) { - SERIAL_ECHOPAIR("Set bit ", (int)ind, " of codebits (", hex_address((void*)(codebits >> 16))); - print_hex_word((uint16_t)(codebits & 0xFFFF)); - SERIAL_ECHOLNPAIR(") | param = ", (int)param[ind]); - } - #endif - } - - // Code seen bit was set. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { - const uint8_t ind = LETTER_BIT(c); - if (ind >= COUNT(param)) return false; // Only A-Z - const bool b = TEST32(codebits, ind); - if (b) { - char * const ptr = command_ptr + param[ind]; - value_ptr = param[ind] && valid_float(ptr) ? ptr : nullptr; - } - return b; - } - - FORCE_INLINE static constexpr uint32_t letter_bits(const char * const str) { - return (str[0] ? _BV32(LETTER_BIT(str[0])) | - (str[1] ? _BV32(LETTER_BIT(str[1])) | - (str[2] ? _BV32(LETTER_BIT(str[2])) | - (str[3] ? _BV32(LETTER_BIT(str[3])) | - (str[4] ? _BV32(LETTER_BIT(str[4])) | - (str[5] ? _BV32(LETTER_BIT(str[5])) | - (str[6] ? _BV32(LETTER_BIT(str[6])) | - (str[7] ? _BV32(LETTER_BIT(str[7])) | - (str[8] ? _BV32(LETTER_BIT(str[8])) | - (str[9] ? _BV32(LETTER_BIT(str[9])) - : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0); - } - - // At least one of a list of code letters was seen - #ifdef CPU_32_BIT - FORCE_INLINE static bool seen(const char * const str) { return !!(codebits & letter_bits(str)); } - #else - // At least one of a list of code letters was seen - FORCE_INLINE static bool seen(const char * const str) { - const uint32_t letrbits = letter_bits(str); - const uint8_t * const cb = (uint8_t*)&codebits; - const uint8_t * const lb = (uint8_t*)&letrbits; - return (cb[0] & lb[0]) || (cb[1] & lb[1]) || (cb[2] & lb[2]) || (cb[3] & lb[3]); - } - #endif - - static inline bool seen_any() { return !!codebits; } - - #define SEEN_TEST(L) TEST32(codebits, LETTER_BIT(L)) - - #else // !FASTER_GCODE_PARSER - - // Code is found in the string. If not found, value_ptr is unchanged. - // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { - char *p = strchr(command_args, c); - const bool b = !!p; - if (b) value_ptr = valid_float(&p[1]) ? &p[1] : nullptr; - return b; - } - - static inline bool seen_any() { return *command_args == '\0'; } - - #define SEEN_TEST(L) !!strchr(command_args, L) - - // At least one of a list of code letters was seen - static inline bool seen(const char * const str) { - for (uint8_t i = 0; const char c = str[i]; i++) - if (SEEN_TEST(c)) return true; - return false; - } - - #endif // !FASTER_GCODE_PARSER - - // Seen any axis parameter - static inline bool seen_axis() { - return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E'); - } - - // Populate all fields by parsing a single line of GCode - // This uses 54 bytes of SRAM to speed up seen/value - static void parse(char * p); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - // Parse the next parameter as a new command - static bool chain(); - #endif - - // The code value pointer was set - FORCE_INLINE static bool has_value() { return value_ptr != nullptr; } - - // Seen a parameter with a value - static inline bool seenval(const char c) { return seen(c) && has_value(); } - - // Float removes 'E' to prevent scientific notation interpretation - static inline float value_float() { - if (value_ptr) { - char *e = value_ptr; - for (;;) { - const char c = *e; - if (c == '\0' || c == ' ') break; - if (c == 'E' || c == 'e') { - *e = '\0'; - const float ret = strtof(value_ptr, nullptr); - *e = c; - return ret; - } - ++e; - } - return strtof(value_ptr, nullptr); - } - return 0; - } - - // Code value as a long or ulong - static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } - static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; } - - // Code value for use as time - static inline millis_t value_millis() { return value_ulong(); } - static inline millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); } - - // Reduce to fewer bits - static inline int16_t value_int() { return (int16_t)value_long(); } - static inline uint16_t value_ushort() { return (uint16_t)value_long(); } - static inline uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } - - // Bool is true with no value or non-zero - static inline bool value_bool() { return !has_value() || !!value_byte(); } - - // 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); } - - // Init linear units by constructor - GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } - - static inline void set_input_linear_units(const LinearUnit units) { - switch (units) { - default: - 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); - } - - static inline float axis_unit_factor(const AxisEnum axis) { - return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); - } - - static inline float linear_value_to_mm(const float v) { return v * linear_unit_factor; } - static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } - static inline float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } - - #else - - static inline float mm_to_linear_unit(const float mm) { return mm; } - static inline float mm_to_volumetric_unit(const float mm) { return mm; } - - static inline float linear_value_to_mm(const float v) { return v; } - static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; } - static inline float per_axis_value(const AxisEnum, const float v) { return v; } - - #endif - - #define LINEAR_UNIT(V) parser.mm_to_linear_unit(V) - #define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V) - - static inline float value_linear_units() { return linear_value_to_mm(value_float()); } - static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } - static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } - - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - - static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; } - - #if HAS_LCD_MENU && DISABLED(DISABLE_M503) - - static inline char temp_units_code() { - return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; - } - static inline PGM_P temp_units_name() { - return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius"); - } - static inline float to_temp_units(const float &f) { - switch (input_temp_units) { - case TEMPUNIT_F: - return f * 0.5555555556f + 32; - case TEMPUNIT_K: - return f + 273.15f; - case TEMPUNIT_C: - default: - return f; - } - } - - #endif // HAS_LCD_MENU && !DISABLE_M503 - - static inline float value_celsius() { - const float f = value_float(); - switch (input_temp_units) { - case TEMPUNIT_F: - return (f - 32) * 0.5555555556f; - case TEMPUNIT_K: - return f - 273.15f; - case TEMPUNIT_C: - default: - return f; - } - } - - static inline float value_celsius_diff() { - switch (input_temp_units) { - case TEMPUNIT_F: - return value_float() * 0.5555555556f; - case TEMPUNIT_C: - case TEMPUNIT_K: - default: - return value_float(); - } - } - - #define TEMP_UNIT(N) parser.to_temp_units(N) - - #else // !TEMPERATURE_UNITS_SUPPORT - - static inline float value_celsius() { return value_float(); } - static inline float value_celsius_diff() { return value_float(); } - - #define TEMP_UNIT(N) (N) - - #endif // !TEMPERATURE_UNITS_SUPPORT - - static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } - - void unknown_command_error(); - - // Provide simple value accessors with default option - static inline float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - static inline bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - static inline uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - static inline int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - static inline uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - static inline int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - static inline uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } - static inline float celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; } - -}; - -extern GCodeParser parser; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G30.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G30.cpp deleted file mode 100644 index e91e3e9d8b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G30.cpp +++ /dev/null @@ -1,68 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/probe.h" -#include "../../feature/bedlevel/bedlevel.h" - -/** - * G30: Do a single Z probe at the current XY - * - * Parameters: - * - * X Probe X position (default current X) - * Y Probe Y position (default current Y) - * E Engage the probe for each probe (default 1) - */ -void GcodeSuite::G30() { - const xy_pos_t pos = { parser.linearval('X', current_position.x + probe_offset.x), - parser.linearval('Y', current_position.y + probe_offset.y) }; - - if (!position_is_reachable_by_probe(pos)) return; - - // Disable leveling so the planner won't mess with us - #if HAS_LEVELING - set_bed_leveling_enabled(false); - #endif - - remember_feedrate_scaling_off(); - - const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_at_point(pos, raise_after, 1); - if (!isnan(measured_z)) - SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(pos.x), " Y: ", FIXFLOAT(pos.y), " Z: ", FIXFLOAT(measured_z)); - - restore_feedrate_and_scaling(); - - #ifdef Z_AFTER_PROBING - if (raise_after == PROBE_PT_STOW) move_z_after_probing(); - #endif - - report_current_position(); -} - -#endif // HAS_BED_PROBE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G31_G32.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G31_G32.cpp deleted file mode 100644 index 06c3c3adf1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G31_G32.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(Z_PROBE_SLED) - -#include "../gcode.h" -#include "../../module/probe.h" - -/** - * G31: Deploy the Z probe - */ -void GcodeSuite::G31() { DEPLOY_PROBE(); } - -/** - * G32: Stow the Z probe - */ -void GcodeSuite::G32() { STOW_PROBE(); } - -#endif // Z_PROBE_SLED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G38.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G38.cpp deleted file mode 100644 index cb298bcccb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/G38.cpp +++ /dev/null @@ -1,133 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(G38_PROBE_TARGET) - -#include "../gcode.h" - -#include "../../module/endstops.h" -#include "../../module/motion.h" -#include "../../module/stepper.h" -#include "../../module/probe.h" - -inline void G38_single_probe(const uint8_t move_value) { - endstops.enable(true); - G38_move = move_value; - prepare_move_to_destination(); - planner.synchronize(); - G38_move = 0; - endstops.hit_on_purpose(); - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); -} - -inline bool G38_run_probe() { - - bool G38_pass_fail = false; - - #if MULTIPLE_PROBING > 1 - // Get direction of move and retract - xyz_float_t retract_mm; - LOOP_XYZ(i) { - const float dist = destination[i] - current_position[i]; - retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1); - } - #endif - - planner.synchronize(); // wait until the machine is idle - - // Move flag value - #if ENABLED(G38_PROBE_AWAY) - const uint8_t move_value = parser.subcode; - #else - constexpr uint8_t move_value = 1; - #endif - - G38_did_trigger = false; - - // Move until destination reached or target hit - G38_single_probe(move_value); - - if (G38_did_trigger) { - - G38_pass_fail = true; - - #if MULTIPLE_PROBING > 1 - // Move away by the retract distance - destination = current_position + retract_mm; - endstops.enable(false); - prepare_move_to_destination(); - planner.synchronize(); - - REMEMBER(fr, feedrate_mm_s, feedrate_mm_s * 0.25); - - // Bump the target more slowly - destination -= retract_mm * 2; - - G38_single_probe(move_value); - #endif - } - - endstops.not_homing(); - return G38_pass_fail; -} - -/** - * G38 Probe Target - * - * G38.2 - Probe toward workpiece, stop on contact, signal error if failure - * G38.3 - Probe toward workpiece, stop on contact - * - * With G38_PROBE_AWAY: - * - * G38.4 - Probe away from workpiece, stop on contact break, signal error if failure - * G38.5 - Probe away from workpiece, stop on contact break - */ -void GcodeSuite::G38(const int8_t subcode) { - // Get X Y Z E F - get_destination_from_command(); - - remember_feedrate_scaling_off(); - - const bool error_on_fail = - #if ENABLED(G38_PROBE_AWAY) - !TEST(subcode, 0) - #else - (subcode == 2) - #endif - ; - - // If any axis has enough movement, do the move - LOOP_XYZ(i) - if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { - if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i); - // If G38.2 fails throw an error - if (!G38_run_probe() && error_on_fail) SERIAL_ERROR_MSG("Failed to reach target"); - break; - } - - restore_feedrate_and_scaling(); -} - -#endif // G38_PROBE_TARGET diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M401_M402.cpp deleted file mode 100644 index aa63a7ea71..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M401_M402.cpp +++ /dev/null @@ -1,50 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/probe.h" - -/** - * M401: Deploy and activate the Z probe - */ -void GcodeSuite::M401() { - DEPLOY_PROBE(); - report_current_position(); -} - -/** - * M402: Deactivate and stow the Z probe - */ -void GcodeSuite::M402() { - STOW_PROBE(); - #ifdef Z_AFTER_PROBING - move_z_after_probing(); - #endif - report_current_position(); -} - -#endif // HAS_BED_PROBE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M851.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M851.cpp deleted file mode 100644 index 431fe6fa09..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M851.cpp +++ /dev/null @@ -1,82 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - -#include "../gcode.h" -#include "../../feature/bedlevel/bedlevel.h" -#include "../../module/probe.h" - -extern const char SP_Y_STR[], SP_Z_STR[]; - -/** - * M851: Set the nozzle-to-probe offsets in current units - */ -void GcodeSuite::M851() { - - // Show usage with no parameters - if (!parser.seen("XYZ")) { - SERIAL_ECHOLNPAIR_P(PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z); - return; - } - - xyz_pos_t offs = probe_offset; - - bool ok = true; - - if (parser.seenval('X')) { - const float x = parser.value_float(); - if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) - offs.x = 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 = 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 = 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) probe_offset = offs; -} - -#endif // HAS_BED_PROBE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M951.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M951.cpp deleted file mode 100644 index d8d2e8f8e0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/probe/M951.cpp +++ /dev/null @@ -1,75 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(MAGNETIC_PARKING_EXTRUDER) - -#include "../gcode.h" -#include "../../module/tool_change.h" -#include "../../module/motion.h" - -mpe_settings_t mpe_settings; - -inline void mpe_settings_report() { - 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); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("D: Distance trav.:", mpe_settings.travel_distance); - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("C: Compenstion :", mpe_settings.compensation_factor); -} - -void mpe_settings_init() { - constexpr float pex[2] = PARKING_EXTRUDER_PARKING_X; - mpe_settings.parking_xpos[0] = pex[0]; // M951 L - mpe_settings.parking_xpos[1] = pex[1]; // M951 R - mpe_settings.grab_distance = PARKING_EXTRUDER_GRAB_DISTANCE; // M951 I - #if HAS_HOME_OFFSET - set_home_offset(X_AXIS, mpe_settings.grab_distance * -1); - #endif - mpe_settings.slow_feedrate = MMM_TO_MMS(MPE_SLOW_SPEED); // M951 J - mpe_settings.fast_feedrate = MMM_TO_MMS(MPE_FAST_SPEED); // M951 H - mpe_settings.travel_distance = MPE_TRAVEL_DISTANCE; // M951 D - mpe_settings.compensation_factor = MPE_COMPENSATION; // M951 C - mpe_settings_report(); -} - -void GcodeSuite::M951() { - if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units(); - if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units(); - if (parser.seenval('I')) { - mpe_settings.grab_distance = parser.value_linear_units(); - #if HAS_HOME_OFFSET - set_home_offset(X_AXIS, mpe_settings.grab_distance * -1); - #endif - } - if (parser.seenval('J')) mpe_settings.slow_feedrate = MMM_TO_MMS(parser.value_linear_units()); - if (parser.seenval('H')) mpe_settings.fast_feedrate = MMM_TO_MMS(parser.value_linear_units()); - if (parser.seenval('D')) mpe_settings.travel_distance = parser.value_linear_units(); - if (parser.seenval('C')) mpe_settings.compensation_factor = parser.value_float(); - if (!parser.seen("CDHIJLR")) mpe_settings_report(); -} - -#endif // MAGNETIC_PARKING_EXTRUDER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.cpp deleted file mode 100644 index a9bd714c1e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.cpp +++ /dev/null @@ -1,665 +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 . - * - */ - -/** - * queue.cpp - The G-code command queue - */ - -#include "queue.h" -GCodeQueue queue; - -#include "gcode.h" - -#include "../lcd/ultralcd.h" -#include "../sd/cardreader.h" -#include "../module/planner.h" -#include "../module/temperature.h" -#include "../Marlin.h" - -#if ENABLED(PRINTER_EVENT_LEDS) - #include "../feature/leds/printer_event_leds.h" -#endif - -#if ENABLED(BINARY_FILE_TRANSFER) - #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 - * sending commands to Marlin, and lines will be checked for sequentiality. - * M110 N sets the current line number. - */ -long gcode_N, GCodeQueue::last_N, GCodeQueue::stopped_N = 0; - -/** - * GCode Command Queue - * A simple ring buffer of BUFSIZE command strings. - * - * Commands are copied into this buffer by the command injectors - * (immediate, serial, sd card) and they are processed sequentially by - * the main loop. The gcode.process_next_command method parses the next - * command and hands off execution to individual handler functions. - */ -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::command_buffer[BUFSIZE][MAX_CMD_SIZE]; - -/* - * The port that the command was received on - */ -#if NUM_SERIAL > 1 - int16_t GCodeQueue::port[BUFSIZE]; -#endif - -/** - * Serial command injection - */ - -// Number of characters read in the current line of serial input -static int serial_count[NUM_SERIAL] = { 0 }; - -bool send_ok[BUFSIZE]; - -/** - * Next Injected Command pointer. nullptr if no commands are being injected. - * Used by Marlin internally to ensure that commands initiated from within - * are enqueued ahead of any pending serial or sd card commands. - */ -static PGM_P injected_commands_P = nullptr; - -GCodeQueue::GCodeQueue() { - // Send "ok" after commands by default - for (uint8_t i = 0; i < COUNT(send_ok); i++) send_ok[i] = true; -} - -/** - * Check whether there are any commands yet to be executed - */ -bool GCodeQueue::has_commands_queued() { - return queue.length || injected_commands_P; -} - -/** - * Clear the Marlin command queue - */ -void GCodeQueue::clear() { - index_r = index_w = length = 0; -} - -/** - * Once a new command is in the ring buffer, call this to commit it - */ -void GCodeQueue::_commit_command(bool say_ok - #if NUM_SERIAL > 1 - , int16_t p/*=-1*/ - #endif -) { - send_ok[index_w] = 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++; -} - -/** - * Copy a command from RAM into the main command buffer. - * Return true if the command was successfully added. - * Return false for a full buffer, or if the 'command' is a comment. - */ -bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ - #if NUM_SERIAL > 1 - , int16_t pn/*=-1*/ - #endif -) { - if (*cmd == ';' || length >= BUFSIZE) return false; - strcpy(command_buffer[index_w], cmd); - _commit_command(say_ok - #if NUM_SERIAL > 1 - , pn - #endif - ); - return true; -} - -/** - * Enqueue with Serial Echo - * Return true if the command was consumed - */ -bool GCodeQueue::enqueue_one(const char* cmd) { - - //SERIAL_ECHOPGM("enqueue_one(\""); - //SERIAL_ECHO(cmd); - //SERIAL_ECHOPGM("\") \n"); - - if (*cmd == 0 || *cmd == '\n' || *cmd == '\r') return true; - - if (_enqueue(cmd)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ENQUEUEING, cmd, "\""); - return true; - } - return false; -} - -/** - * Process the next "immediate" command. - * Return 'true' if any commands were processed, - * or remain to process. - */ -bool GCodeQueue::process_injected_command() { - if (injected_commands_P == nullptr) return false; - - char c; - size_t i = 0; - while ((c = pgm_read_byte(&injected_commands_P[i])) && c != '\n') i++; - - // Extract current command and move pointer to next command - char cmd[i + 1]; - memcpy_P(cmd, injected_commands_P, i); - cmd[i] = '\0'; - injected_commands_P = c ? injected_commands_P + i + 1 : nullptr; - - // Execute command if non-blank - if (i) { - parser.parse(cmd); - PORT_REDIRECT(SERIAL_PORT); - gcode.process_parsed_command(); - } - return true; -} - -/** - * Enqueue one or many commands to run from program memory. - * Do not inject a comment or use leading spaces! - * Aborts the current queue, if any. - * Note: process_injected_command() will be called to drain any commands afterwards - */ -void GCodeQueue::inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } - -/** - * Enqueue and return only when commands are actually enqueued. - * Never call this from a G-code handler! - */ -void GCodeQueue::enqueue_one_now(const char* cmd) { while (!enqueue_one(cmd)) idle(); } - -/** - * Enqueue from program memory and return only when commands are actually enqueued - * Never call this from a G-code handler! - */ -void GCodeQueue::enqueue_now_P(PGM_P const pgcode) { - size_t i = 0; - PGM_P p = pgcode; - for (;;) { - char c; - while ((c = pgm_read_byte(&p[i])) && c != '\n') i++; - char cmd[i + 1]; - memcpy_P(cmd, p, i); - cmd[i] = '\0'; - enqueue_one_now(cmd); - if (!c) break; - p += i + 1; - } -} - -/** - * Send an "ok" message to the host, indicating - * that a command was successfully processed. - * - * If ADVANCED_OK is enabled also include: - * N Line number of the command, if any - * P Planner space remaining - * B Block queue space remaining - */ -void GCodeQueue::ok_to_send() { - #if NUM_SERIAL > 1 - const int16_t pn = port[index_r]; - if (pn < 0) return; - PORT_REDIRECT(pn); - #endif - if (!send_ok[index_r]) return; - SERIAL_ECHOPGM(MSG_OK); - #if ENABLED(ADVANCED_OK) - char* p = command_buffer[index_r]; - if (*p == 'N') { - SERIAL_ECHO(' '); - SERIAL_ECHO(*p++); - while (NUMERIC_SIGNED(*p)) - SERIAL_ECHO(*p++); - } - SERIAL_ECHOPGM(" P"); SERIAL_ECHO(int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); - SERIAL_ECHOPGM(" B"); SERIAL_ECHO(BUFSIZE - length); - #endif - SERIAL_EOL(); -} - -/** - * Send a "Resend: nnn" message to the host to - * indicate that a command needs to be re-sent. - */ -void GCodeQueue::flush_and_request_resend() { - #if NUM_SERIAL > 1 - const int16_t p = port[index_r]; - if (p < 0) return; - PORT_REDIRECT(p); - #endif - SERIAL_FLUSH(); - SERIAL_ECHOPGM(MSG_RESEND); - SERIAL_ECHOLN(last_N + 1); - ok_to_send(); -} - -inline bool serial_data_available() { - return false - || MYSERIAL0.available() - #if NUM_SERIAL > 1 - || MYSERIAL1.available() - #endif - ; -} - -inline int read_serial(const uint8_t index) { - switch (index) { - case 0: return MYSERIAL0.read(); - #if NUM_SERIAL > 1 - case 1: return MYSERIAL1.read(); - #endif - default: return -1; - } -} - -void GCodeQueue::gcode_line_error(PGM_P const err, const int8_t port) { - PORT_REDIRECT(port); - SERIAL_ERROR_START(); - serialprintPGM(err); - SERIAL_ECHOLN(last_N); - while (read_serial(port) != -1); // clear out the RX buffer - flush_and_request_resend(); - serial_count[port] = 0; -} - -FORCE_INLINE bool is_M29(const char * const cmd) { // matches "M29" & "M29 ", but not "M290", etc - const char * const m29 = strstr_P(cmd, PSTR("M29")); - return m29 && !NUMERIC(m29[3]); -} - -/** - * Get all commands waiting on the serial port and queue them. - * Exit when the buffer is full or when no more characters are - * left on the serial port. - */ -void GCodeQueue::get_serial_commands() { - static char serial_line_buffer[NUM_SERIAL][MAX_CMD_SIZE]; - static bool serial_comment_mode[NUM_SERIAL] = { false } - #if ENABLED(PAREN_COMMENTS) - , serial_comment_paren_mode[NUM_SERIAL] = { false } - #endif - ; - - #if ENABLED(BINARY_FILE_TRANSFER) - if (card.flag.binary_mode) { - /** - * For binary stream file transfer, use serial_line_buffer as the working - * receive buffer (which limits the packet size to MAX_CMD_SIZE). - * The receive buffer also limits the packet size for reliable transmission. - */ - binaryStream[card.transfer_port_index].receive(serial_line_buffer[card.transfer_port_index]); - return; - } - #endif - - // If the command buffer is empty for too long, - // send "wait" to indicate Marlin is still waiting. - #if NO_TIMEOUTS > 0 - static millis_t last_command_time = 0; - const millis_t ms = millis(); - if (length == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { - SERIAL_ECHOLNPGM(MSG_WAIT); - last_command_time = ms; - } - #endif - - /** - * Loop while serial characters are incoming and the queue is not full - */ - while (length < BUFSIZE && serial_data_available()) { - for (uint8_t i = 0; i < NUM_SERIAL; ++i) { - int c; - if ((c = read_serial(i)) < 0) continue; - - char serial_char = c; - - /** - * If the character ends the line - */ - if (serial_char == '\n' || serial_char == '\r') { - - // Start with comment mode off - serial_comment_mode[i] = false; - #if ENABLED(PAREN_COMMENTS) - serial_comment_paren_mode[i] = false; - #endif - - // Skip empty lines and comments - if (!serial_count[i]) { thermalManager.manage_heater(); continue; } - - serial_line_buffer[i][serial_count[i]] = 0; // Terminate string - serial_count[i] = 0; // Reset buffer - - char* command = serial_line_buffer[i]; - - while (*command == ' ') command++; // Skip leading spaces - char *npos = (*command == 'N') ? command : nullptr; // Require the N parameter to start the line - - if (npos) { - - bool M110 = strstr_P(command, PSTR("M110")) != nullptr; - - if (M110) { - char* n2pos = strchr(command + 4, 'N'); - if (n2pos) npos = n2pos; - } - - gcode_N = strtol(npos + 1, nullptr, 10); - - if (gcode_N != last_N + 1 && !M110) - return gcode_line_error(PSTR(MSG_ERR_LINE_NO), i); - - char *apos = strrchr(command, '*'); - if (apos) { - uint8_t checksum = 0, count = uint8_t(apos - command); - while (count) checksum ^= command[--count]; - if (strtol(apos + 1, nullptr, 10) != checksum) - return gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH), i); - } - else - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); - - last_N = gcode_N; - } - #if ENABLED(SDSUPPORT) - // Pronterface "M29" and "M29 " has no line number - else if (card.flag.saving && !is_M29(command)) - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); - #endif - - // Movement commands alert when stopped - if (IsStopped()) { - char* gpos = strchr(command, 'G'); - if (gpos) { - switch (strtol(gpos + 1, nullptr, 10)) { - case 0: - case 1: - #if ENABLED(ARC_SUPPORT) - case 2: - case 3: - #endif - #if ENABLED(BEZIER_CURVE_SUPPORT) - case 5: - #endif - SERIAL_ECHOLNPGM(MSG_ERR_STOPPED); - LCD_MESSAGEPGM(MSG_STOPPED); - break; - } - } - } - - #if DISABLED(EMERGENCY_PARSER) - // Process critical commands early - if (strcmp(command, "M108") == 0) { - wait_for_heatup = false; - #if HAS_LCD_MENU - wait_for_user = false; - #endif - } - if (strcmp(command, "M112") == 0) kill(); - if (strcmp(command, "M410") == 0) quickstop_stepper(); - #endif - - #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 - last_command_time = ms; - #endif - - // Add the command to the queue - _enqueue(serial_line_buffer[i], true - #if NUM_SERIAL > 1 - , i - #endif - ); - } - else if (serial_count[i] >= MAX_CMD_SIZE - 1) { - // Keep fetching, but ignore normal characters beyond the max length - // The command will be injected when EOL is reached - } - else if (serial_char == '\\') { // Handle escapes - // if we have one more character, copy it over - if ((c = read_serial(i)) >= 0 && !serial_comment_mode[i] - #if ENABLED(PAREN_COMMENTS) - && !serial_comment_paren_mode[i] - #endif - ) - serial_line_buffer[i][serial_count[i]++] = (char)c; - } - else { // it's not a newline, carriage return or escape char - if (serial_char == ';') serial_comment_mode[i] = true; - #if ENABLED(PAREN_COMMENTS) - else if (serial_char == '(') serial_comment_paren_mode[i] = true; - else if (serial_char == ')') serial_comment_paren_mode[i] = false; - #endif - else if (!serial_comment_mode[i] - #if ENABLED(PAREN_COMMENTS) - && ! serial_comment_paren_mode[i] - #endif - ) serial_line_buffer[i][serial_count[i]++] = serial_char; - } - } // for NUM_SERIAL - } // queue has space, serial has data -} - -#if ENABLED(SDSUPPORT) - - /** - * Get commands from the SD Card until the command buffer is full - * or until the end of the file is reached. The special character '#' - * can also interrupt buffering. - */ - inline void GCodeQueue::get_sdcard_commands() { - static bool stop_buffering = false, - sd_comment_mode = false - #if ENABLED(PAREN_COMMENTS) - , sd_comment_paren_mode = false - #endif - ; - - if (!IS_SD_PRINTING()) return; - - /** - * '#' stops reading from SD to the buffer prematurely, so procedural - * macro calls are possible. If it occurs, stop_buffering is triggered - * and the buffer is run dry; this character _can_ occur in serial com - * due to checksums, however, no checksums are used in SD printing. - */ - - if (length == 0) stop_buffering = false; - - uint16_t sd_count = 0; - bool card_eof = card.eof(); - while (length < BUFSIZE && !card_eof && !stop_buffering) { - const int16_t n = card.get(); - char sd_char = (char)n; - card_eof = card.eof(); - if (card_eof || n == -1 - || sd_char == '\n' || sd_char == '\r' - || ((sd_char == '#' || sd_char == ':') && !sd_comment_mode - #if ENABLED(PAREN_COMMENTS) - && !sd_comment_paren_mode - #endif - ) - ) { - if (card_eof) { - - card.printingHasFinished(); - - if (IS_SD_PRINTING()) - sd_count = 0; // If a sub-file was printing, continue from call point - else { - SERIAL_ECHOLNPGM(MSG_FILE_PRINTED); - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPrintCompleted(); - #if HAS_RESUME_CONTINUE - inject_P(PSTR("M0 S" - #if HAS_LCD_MENU - "1800" - #else - "60" - #endif - )); - #endif - #endif // PRINTER_EVENT_LEDS - } - } - else if (n == -1) - SERIAL_ERROR_MSG(MSG_SD_ERR_READ); - - if (sd_char == '#') stop_buffering = true; - - sd_comment_mode = false; // for new command - #if ENABLED(PAREN_COMMENTS) - sd_comment_paren_mode = false; - #endif - - // Skip empty lines and comments - if (!sd_count) { thermalManager.manage_heater(); continue; } - - 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) { - /** - * Keep fetching, but ignore normal characters beyond the max length - * The command will be injected when EOL is reached - */ - } - else { - if (sd_char == ';') sd_comment_mode = true; - #if ENABLED(PAREN_COMMENTS) - else if (sd_char == '(') sd_comment_paren_mode = true; - else if (sd_char == ')') sd_comment_paren_mode = false; - #endif - else if (!sd_comment_mode - #if ENABLED(PAREN_COMMENTS) - && ! sd_comment_paren_mode - #endif - ) command_buffer[index_w][sd_count++] = sd_char; - } - } - } - -#endif // SDSUPPORT - -/** - * Add to the circular command queue the next command from: - * - The command-injection queue (injected_commands_P) - * - The active serial input (usually USB) - * - The SD card file being actively printed - */ -void GCodeQueue::get_available_commands() { - - get_serial_commands(); - - #if ENABLED(SDSUPPORT) - get_sdcard_commands(); - #endif -} - -/** - * Get the next command in the queue, optionally log it to SD, then dispatch it - */ -void GCodeQueue::advance() { - - // Process immediate commands - if (process_injected_command()) return; - - // Return if the G-code buffer is empty - if (!length) return; - - #if ENABLED(SDSUPPORT) - - if (card.flag.saving) { - char* command = command_buffer[index_r]; - if (is_M29(command)) { - // M29 closes the file - card.closefile(); - SERIAL_ECHOLNPGM(MSG_FILE_SAVED); - - #if !defined(__AVR__) || !defined(USBCON) - #if ENABLED(SERIAL_STATS_DROPPED_RX) - SERIAL_ECHOLNPAIR("Dropped bytes: ", MYSERIAL0.dropped()); - #endif - - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - SERIAL_ECHOLNPAIR("Max RX Queue Size: ", MYSERIAL0.rxMaxEnqueued()); - #endif - #endif // !defined(__AVR__) || !defined(USBCON) - - ok_to_send(); - } - else { - // Write the string from the read buffer to SD - card.write_command(command); - if (card.flag.logging) - gcode.process_next_command(); // The card is saving because it's logging - else - ok_to_send(); - } - } - else - gcode.process_next_command(); - - #else - - gcode.process_next_command(); - - #endif // SDSUPPORT - - // The queue may be reset by a command handler or by code invoked by idle() within a handler - if (length) { - --length; - if (++index_r >= BUFSIZE) index_r = 0; - } - -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.h deleted file mode 100644 index 173cadc68e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/queue.h +++ /dev/null @@ -1,157 +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 - -/** - * queue.h - The G-code command queue, which holds commands before they - * go to the parser and dispatcher. - */ - -#include "../inc/MarlinConfig.h" - -class GCodeQueue { -public: - /** - * GCode line number handling. Hosts may include line numbers when sending - * commands to Marlin, and lines will be checked for sequentiality. - * M110 N sets the current line number. - */ - static long last_N, stopped_N; - - static inline void stop() { stopped_N = last_N; } - - /** - * GCode Command Queue - * A simple ring buffer of BUFSIZE command strings. - * - * Commands are copied into this buffer by the command injectors - * (immediate, serial, sd card) and they are processed sequentially by - * the main loop. The gcode.process_next_command method parses the next - * command and hands off execution to individual handler functions. - */ - static uint8_t length, // Count of commands in the queue - index_r; // Ring buffer read position - - static char command_buffer[BUFSIZE][MAX_CMD_SIZE]; - - /* - * The port that the command was received on - */ - #if NUM_SERIAL > 1 - static int16_t port[BUFSIZE]; - #endif - - GCodeQueue(); - - /** - * Clear the Marlin command queue - */ - static void clear(); - - /** - * Enqueue one or many commands to run from program memory. - * Aborts the current queue, if any. - * Note: process_injected_command() will process them. - */ - static void inject_P(PGM_P const pgcode); - - /** - * Enqueue and return only when commands are actually enqueued - */ - static void enqueue_one_now(const char* cmd); - - /** - * Enqueue from program memory and return only when commands are actually enqueued - */ - static void enqueue_now_P(PGM_P const cmd); - - /** - * Check whether there are any commands yet to be executed - */ - static bool has_commands_queued(); - - /** - * Get the next command in the queue, optionally log it to SD, then dispatch it - */ - static void advance(); - - /** - * Add to the circular command queue the next command from: - * - The command-injection queue (injected_commands_P) - * - The active serial input (usually USB) - * - The SD card file being actively printed - */ - static void get_available_commands(); - - /** - * Send an "ok" message to the host, indicating - * that a command was successfully processed. - * - * If ADVANCED_OK is enabled also include: - * N Line number of the command, if any - * P Planner space remaining - * B Block queue space remaining - */ - static void ok_to_send(); - - /** - * Clear the serial line and request a resend of - * the next expected line number. - */ - static void flush_and_request_resend(); - -private: - - static uint8_t index_w; // Ring buffer write position - - static void get_serial_commands(); - - #if ENABLED(SDSUPPORT) - static void get_sdcard_commands(); - #endif - - static void _commit_command(bool say_ok - #if NUM_SERIAL > 1 - , int16_t p=-1 - #endif - ); - - static bool _enqueue(const char* cmd, bool say_ok=false - #if NUM_SERIAL > 1 - , int16_t p=-1 - #endif - ); - - // Process the next "immediate" command - static bool process_injected_command(); - - /** - * Enqueue with Serial Echo - * Return true on success - */ - static bool enqueue_one(const char* cmd); - - static void gcode_line_error(PGM_P const err, const int8_t port); - -}; - -extern GCodeQueue queue; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/scara/M360-M364.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/scara/M360-M364.cpp deleted file mode 100644 index 0e6f51b628..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/scara/M360-M364.cpp +++ /dev/null @@ -1,81 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(MORGAN_SCARA) - -#include "../gcode.h" -#include "../../module/scara.h" -#include "../../module/motion.h" -#include "../../Marlin.h" // for IsRunning() - -inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) { - if (IsRunning()) { - forward_kinematics_SCARA(delta_a, delta_b); - do_blocking_move_to_xy(cartes); - return true; - } - return false; -} - -/** - * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - */ -bool GcodeSuite::M360() { - SERIAL_ECHOLNPGM(" Cal: Theta 0"); - return SCARA_move_to_cal(0, 120); -} - -/** - * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) - */ -bool GcodeSuite::M361() { - SERIAL_ECHOLNPGM(" Cal: Theta 90"); - return SCARA_move_to_cal(90, 130); -} - -/** - * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) - */ -bool GcodeSuite::M362() { - SERIAL_ECHOLNPGM(" Cal: Psi 0"); - return SCARA_move_to_cal(60, 180); -} - -/** - * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) - */ -bool GcodeSuite::M363() { - SERIAL_ECHOLNPGM(" Cal: Psi 90"); - return SCARA_move_to_cal(50, 90); -} - -/** - * M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position) - */ -bool GcodeSuite::M364() { - SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90"); - return SCARA_move_to_cal(45, 135); -} - -#endif // MORGAN_SCARA diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M20.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M20.cpp deleted file mode 100644 index 79f2fd8008..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M20.cpp +++ /dev/null @@ -1,39 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M20: List SD card to serial output - */ -void GcodeSuite::M20() { - SERIAL_ECHOLNPGM(MSG_BEGIN_FILE_LIST); - card.ls(); - SERIAL_ECHOLNPGM(MSG_END_FILE_LIST); -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M21_M22.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M21_M22.cpp deleted file mode 100644 index 9362db0808..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M21_M22.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M21: Init SD Card - */ -void GcodeSuite::M21() { card.mount(); } - -/** - * M22: Release SD Card - */ -void GcodeSuite::M22() { card.release(); } - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M23.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M23.cpp deleted file mode 100644 index f170345c57..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M23.cpp +++ /dev/null @@ -1,46 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" -#include "../../lcd/ultralcd.h" - -/** - * M23: Open a file - * - * The path is relative to the root directory - */ -void GcodeSuite::M23() { - // Simplify3D includes the size, so zero out all spaces (#7227) - for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; - card.openFile(parser.string_arg, true); - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.set_progress(0); - #endif -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M24_M25.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M24_M25.cpp deleted file mode 100644 index d1a9c2f23f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M24_M25.cpp +++ /dev/null @@ -1,115 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" -#include "../../module/printcounter.h" -#include "../../lcd/ultralcd.h" - -#if ENABLED(PARK_HEAD_ON_PAUSE) - #include "../../feature/pause.h" - #include "../queue.h" -#endif - -#if ENABLED(HOST_ACTION_COMMANDS) - #include "../../feature/host_actions.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../../feature/power_loss_recovery.h" -#endif - -#include "../../Marlin.h" // for startOrResumeJob - -/** - * M24: Start or Resume SD Print - */ -void GcodeSuite::M24() { - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('S')) card.setIndex(parser.value_long()); - if (parser.seenval('T')) print_job_timer.resume(parser.value_long()); - #endif - - #if ENABLED(PARK_HEAD_ON_PAUSE) - if (did_pause_print) { - resume_print(); // will call print_job_timer.start() - return; - } - #endif - - if (card.isFileOpen()) { - card.startFileprint(); // SD card will now be read for commands - startOrResumeJob(); // Start (or resume) the print job timer - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - } - - #if ENABLED(HOST_ACTION_COMMANDS) - #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(); -} - -/** - * M25: Pause SD Print - */ -void GcodeSuite::M25() { - - // Set initial pause flag to prevent more commands from landing in the queue while we try to pause - #if ENABLED(SDSUPPORT) - if (IS_SD_PRINTING()) card.pauseSDPrint(); - #endif - - #if ENABLED(PARK_HEAD_ON_PAUSE) - - M125(); - - #else - - print_job_timer.pause(); - ui.reset_status(); - - #if ENABLED(HOST_ACTION_COMMANDS) - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("Pause SD"), PSTR("Resume")); - #endif - #ifdef ACTION_ON_PAUSE - host_action_pause(); - #endif - #endif - - #endif -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M26.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M26.cpp deleted file mode 100644 index 0003758804..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M26.cpp +++ /dev/null @@ -1,38 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M26: Set SD Card file index - */ -void GcodeSuite::M26() { - if (card.isMounted() && parser.seenval('S')) - card.setIndex(parser.value_long()); -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M27.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M27.cpp deleted file mode 100644 index 64eb91876b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M27.cpp +++ /dev/null @@ -1,50 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M27: Get SD Card status - * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) - * OR, with 'C' get the current filename. - */ -void GcodeSuite::M27() { - if (parser.seen('C')) { - SERIAL_ECHOPGM("Current file: "); - card.printFilename(); - } - - #if ENABLED(AUTO_REPORT_SD_STATUS) - else if (parser.seenval('S')) - card.set_auto_report_interval(parser.value_byte()); - #endif - - else - card.report_status(); -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M28_M29.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M28_M29.cpp deleted file mode 100644 index e23b0b4a14..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M28_M29.cpp +++ /dev/null @@ -1,74 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -#if NUM_SERIAL > 1 - #include "../queue.h" -#endif - -/** - * M28: Start SD Write - */ -void GcodeSuite::M28() { - - #if ENABLED(BINARY_FILE_TRANSFER) - - bool binary_mode = false; - char *p = parser.string_arg; - if (p[0] == 'B' && NUMERIC(p[1])) { - binary_mode = p[1] > '0'; - p += 2; - while (*p == ' ') ++p; - } - - // Binary transfer mode - if ((card.flag.binary_mode = binary_mode)) { - SERIAL_ECHO_MSG("Switching to Binary Protocol"); - #if NUM_SERIAL > 1 - card.transfer_port_index = queue.port[queue.index_r]; - #endif - } - else - card.openFile(p, false); - - #else - - card.openFile(parser.string_arg, false); - - #endif -} - -/** - * M29: Stop SD Write - * (Processed in write-to-file routine) - */ -void GcodeSuite::M29() { - card.flag.saving = false; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M30.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M30.cpp deleted file mode 100644 index 2f318687ad..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M30.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M30 : Delete SD Card file - */ -void GcodeSuite::M30() { - if (card.isMounted()) { - card.closefile(); - card.removeFile(parser.string_arg); - } -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M32.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M32.cpp deleted file mode 100644 index 7b180f4415..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M32.cpp +++ /dev/null @@ -1,61 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" -#include "../../module/printcounter.h" -#include "../../module/planner.h" - -#include "../../Marlin.h" // for startOrResumeJob - -/** - * M32: Select file and start SD Print - * - * Examples: - * - * M32 !PATH/TO/FILE.GCO# ; Start FILE.GCO - * M32 P !PATH/TO/FILE.GCO# ; Start FILE.GCO as a procedure - * M32 S60 !PATH/TO/FILE.GCO# ; Start FILE.GCO at byte 60 - * - */ -void GcodeSuite::M32() { - if (IS_SD_PRINTING()) planner.synchronize(); - - if (card.isMounted()) { - const bool call_procedure = parser.boolval('P'); - - card.openFile(parser.string_arg, true, call_procedure); - - if (parser.seenval('S')) card.setIndex(parser.value_long()); - - card.startFileprint(); - - // Procedure calls count as normal print time. - if (!call_procedure) startOrResumeJob(); - } -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M33.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M33.cpp deleted file mode 100644 index 409467cd25..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M33.cpp +++ /dev/null @@ -1,48 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(LONG_FILENAME_HOST_SUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M33: Get the long full path of a file or folder - * - * Parameters: - * Case-insensitive DOS-style path to a file or folder - * - * Example: - * M33 miscel~1/armchair/armcha~1.gco - * - * Output: - * /Miscellaneous/Armchair/Armchair.gcode - */ -void GcodeSuite::M33() { - - card.printLongPath(parser.string_arg); - -} - -#endif // LONG_FILENAME_HOST_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M34.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M34.cpp deleted file mode 100644 index 832b827f3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M34.cpp +++ /dev/null @@ -1,42 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M34: Set SD Card Sorting Options - */ -void GcodeSuite::M34() { - if (parser.seen('S')) card.setSortOn(parser.value_bool()); - if (parser.seenval('F')) { - const int v = parser.value_long(); - card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0); - } - //if (parser.seen('R')) card.setSortReverse(parser.value_bool()); -} - -#endif // SDCARD_SORT_ALPHA && SDSORT_GCODE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M524.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M524.cpp deleted file mode 100644 index 4d4394b4cb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M524.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M524: Abort the current SD print job (started with M24) - */ -void GcodeSuite::M524() { - - if (IS_SD_PRINTING()) - card.flag.abort_sd_printing = true; - -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M928.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M928.cpp deleted file mode 100644 index 87f5af692b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/sdcard/M928.cpp +++ /dev/null @@ -1,39 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "../gcode.h" -#include "../../sd/cardreader.h" - -/** - * M928: Start SD Logging - */ -void GcodeSuite::M928() { - - card.openLogFile(parser.string_arg); - -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M31.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M31.cpp deleted file mode 100644 index fdad76e99a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M31.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../gcode.h" -#include "../../core/serial.h" -#include "../../module/printcounter.h" -#include "../../libs/duration_t.h" -#include "../../lcd/ultralcd.h" - -/** - * M31: Get the time since the start of SD Print (or last M109) - */ -void GcodeSuite::M31() { - char buffer[21]; - duration_t(print_job_timer.duration()).toString(buffer); - - ui.set_status(buffer); - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Print time: ", buffer); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M75-M78.cpp deleted file mode 100644 index 8fcc440285..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/stats/M75-M78.cpp +++ /dev/null @@ -1,73 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/printcounter.h" -#include "../../lcd/ultralcd.h" - -#include "../../Marlin.h" // for startOrResumeJob - -/** - * M75: Start print timer - */ -void GcodeSuite::M75() { - startOrResumeJob(); -} - -/** - * M76: Pause print timer - */ -void GcodeSuite::M76() { - print_job_timer.pause(); -} - -/** - * M77: Stop print timer - */ -void GcodeSuite::M77() { - print_job_timer.stop(); -} - -#if ENABLED(PRINTCOUNTER) - -/** - * M78: Show print statistics - */ -void GcodeSuite::M78() { - if (parser.intval('S') == 78) { // "M78 S78" will reset the statistics - print_job_timer.initStats(); - ui.reset_status(); - return; - } - - #if HAS_SERVICE_INTERVALS - if (parser.seenval('R')) { - print_job_timer.resetServiceInterval(parser.value_int()); - ui.reset_status(); - return; - } - #endif - - print_job_timer.showStats(); -} - -#endif // PRINTCOUNTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M104_M109.cpp deleted file mode 100644 index 59394dabfa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M104_M109.cpp +++ /dev/null @@ -1,150 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if EXTRUDERS - -#include "../gcode.h" -#include "../../module/temperature.h" -#include "../../module/motion.h" -#include "../../module/planner.h" -#include "../../lcd/ultralcd.h" - -#include "../../Marlin.h" // for startOrResumeJob, etc. - -#if ENABLED(PRINTJOB_TIMER_AUTOSTART) - #include "../../module/printcounter.h" - #if ENABLED(CANCEL_OBJECTS) - #include "../../feature/cancel_object.h" - #endif -#endif - -#if ENABLED(SINGLENOZZLE) - #include "../../module/tool_change.h" -#endif - -/** - * M104: Set hot end temperature - */ -void GcodeSuite::M104() { - - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - constexpr int8_t target_extruder = 0; - #else - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - #endif - - if (parser.seenval('S')) { - const int16_t temp = parser.value_celsius(); - #if ENABLED(SINGLENOZZLE) - singlenozzle_temp[target_extruder] = temp; - if (target_extruder != active_extruder) return; - #endif - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Stop the timer at the end of print. Start is managed by 'heat and wait' M109. - * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot - * standby mode, for instance in a dual extruder setup, without affecting - * the running print timer. - */ - if (temp <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - ui.reset_status(); - } - #endif - } - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif -} - -/** - * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. - * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. - */ -void GcodeSuite::M109() { - - if (DEBUGGING(DRYRUN)) return; - - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - constexpr int8_t target_extruder = 0; - #else - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - #endif - - const bool no_wait_for_cooling = parser.seenval('S'), - set_temp = no_wait_for_cooling || parser.seenval('R'); - if (set_temp) { - const int16_t temp = parser.value_celsius(); - #if ENABLED(SINGLENOZZLE) - singlenozzle_temp[target_extruder] = temp; - if (target_extruder != active_extruder) return; - #endif - thermalManager.setTargetHotend(temp, target_extruder); - - #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && target_extruder == 0) - thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); - #endif - - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Use half EXTRUDE_MINTEMP to allow nozzles to be put into hot - * standby mode, (e.g., in a dual extruder setup) without affecting - * the running print timer. - */ - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { - print_job_timer.stop(); - ui.reset_status(); - } - else - startOrResumeJob(); - #endif - - #if HAS_DISPLAY - if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling) - thermalManager.set_heating_message(target_extruder); - #endif - } - - #if ENABLED(AUTOTEMP) - planner.autotemp_M104_M109(); - #endif - - if (set_temp) - (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); -} - -#endif // EXTRUDERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M105.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M105.cpp deleted file mode 100644 index 3dbbb5eb7b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M105.cpp +++ /dev/null @@ -1,51 +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 . - * - */ - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M105: Read hot end and bed temperature - */ -void GcodeSuite::M105() { - - const int8_t target_extruder = get_target_extruder_from_command(); - if (target_extruder < 0) return; - - SERIAL_ECHOPGM(MSG_OK); - - #if HAS_TEMP_SENSOR - - thermalManager.print_heater_states(target_extruder - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - , parser.boolval('R') - #endif - ); - - SERIAL_EOL(); - - #else - - SERIAL_ECHOLNPGM(" T:0"); // Some hosts send M105 to test the serial connection - - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M106_M107.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M106_M107.cpp deleted file mode 100644 index ede826a3f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M106_M107.cpp +++ /dev/null @@ -1,77 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if FAN_COUNT > 0 - -#include "../gcode.h" -#include "../../module/motion.h" -#include "../../module/temperature.h" - -#if ENABLED(SINGLENOZZLE) - #define _ALT_P active_extruder - #define _CNT_P EXTRUDERS -#else - #define _ALT_P _MIN(active_extruder, FAN_COUNT - 1) - #define _CNT_P FAN_COUNT -#endif - -/** - * M106: Set Fan Speed - * - * S Speed between 0-255 - * P Fan index, if more than one fan - * - * With EXTRA_FAN_SPEED enabled: - * - * T Restore/Use/Set Temporary Speed: - * 1 = Restore previous speed after T2 - * 2 = Use temporary speed set with T3-255 - * 3-255 = Set the speed for use with T2 - */ -void GcodeSuite::M106() { - const uint8_t p = parser.byteval('P', _ALT_P); - - if (p < _CNT_P) { - - #if ENABLED(EXTRA_FAN_SPEED) - const uint16_t t = parser.intval('T'); - if (t > 0) return thermalManager.set_temp_fan_speed(p, t); - #endif - uint16_t d = parser.seen('A') ? thermalManager.fan_speed[active_extruder] : 255; - uint16_t s = parser.ushortval('S', d); - NOMORE(s, 255U); - - thermalManager.set_fan_speed(p, s); - } -} - -/** - * M107: Fan Off - */ -void GcodeSuite::M107() { - const uint8_t p = parser.byteval('P', _ALT_P); - thermalManager.set_fan_speed(p, 0); -} - -#endif // FAN_COUNT > 0 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M140_M190.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M140_M190.cpp deleted file mode 100644 index 67a423a2de..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M140_M190.cpp +++ /dev/null @@ -1,72 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_HEATED_BED - -#include "../gcode.h" -#include "../../module/temperature.h" -#include "../../module/motion.h" -#include "../../lcd/ultralcd.h" - -#if ENABLED(PRINTJOB_TIMER_AUTOSTART) - #include "../../module/printcounter.h" -#endif - -#if ENABLED(PRINTER_EVENT_LEDS) - #include "../../feature/leds/leds.h" -#endif - -#include "../../Marlin.h" // for wait_for_heatup, idle, startOrResumeJob - -/** - * M140: Set bed temperature - */ -void GcodeSuite::M140() { - if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); -} - -/** - * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating - * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling - */ -void GcodeSuite::M190() { - if (DEBUGGING(DRYRUN)) return; - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - thermalManager.setTargetBed(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if (parser.value_celsius() > BED_MINTEMP) - startOrResumeJob(); - #endif - } - else return; - - ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING)); - - thermalManager.wait_for_bed(no_wait_for_cooling); -} - -#endif // HAS_HEATED_BED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M141_M191.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M141_M191.cpp deleted file mode 100644 index 65cd7b0280..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M141_M191.cpp +++ /dev/null @@ -1,75 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_HEATED_CHAMBER - -#include "../gcode.h" -#include "../../module/temperature.h" - -#include "../../module/motion.h" -#include "../../lcd/ultralcd.h" - -#if ENABLED(PRINTJOB_TIMER_AUTOSTART) - #include "../../module/printcounter.h" -#endif - -#if ENABLED(PRINTER_EVENT_LEDS) - #include "../../feature/leds/leds.h" -#endif - -#include "../../Marlin.h" // for wait_for_heatup, idle, startOrResumeJob - -/** - * M141: Set chamber temperature - */ -void GcodeSuite::M141() { - if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetChamber(parser.value_celsius()); -} - -/** - * M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating - * Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling - */ -void GcodeSuite::M191() { - if (DEBUGGING(DRYRUN)) return; - - const bool no_wait_for_cooling = parser.seenval('S'); - if (no_wait_for_cooling || parser.seenval('R')) { - thermalManager.setTargetChamber(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if (parser.value_celsius() > CHAMBER_MINTEMP) - startOrResumeJob(); - #endif - } - else return; - - const bool is_heating = thermalManager.isHeatingChamber(); - if (is_heating || !no_wait_for_cooling) { - ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING)); - thermalManager.wait_for_chamber(false); - } -} - -#endif // HAS_HEATED_CHAMBER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M155.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M155.cpp deleted file mode 100644 index 12403114e9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M155.cpp +++ /dev/null @@ -1,40 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M155: Set temperature auto-report interval. M155 S - */ -void GcodeSuite::M155() { - - if (parser.seenval('S')) - thermalManager.set_auto_report_interval(parser.value_byte()); - -} - -#endif // AUTO_REPORT_TEMPERATURES && HAS_TEMP_SENSOR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M303.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M303.cpp deleted file mode 100644 index 2765dc64b4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/temperature/M303.cpp +++ /dev/null @@ -1,66 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_PID_HEATING - -#include "../gcode.h" -#include "../../module/temperature.h" - -/** - * M303: PID relay autotune - * - * S sets the target temperature. (default 150C / 70C) - * E (-1 for the bed) (default 0) - * C Minimum 3. Default 5. - * U with a non-zero value will apply the result to current settings - */ -void GcodeSuite::M303() { - #if ENABLED(PIDTEMPBED) - #define SI H_BED - #else - #define SI H_E0 - #endif - #if ENABLED(PIDTEMP) - #define EI HOTENDS - 1 - #else - #define EI H_BED - #endif - const heater_ind_t e = (heater_ind_t)parser.intval('E'); - if (!WITHIN(e, SI, EI)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); - return; - } - - const int c = parser.intval('C', 5); - const bool u = parser.boolval('U'); - const int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150); - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - thermalManager.PID_autotune(temp, e, c, u); -} - -#endif // HAS_PID_HEATING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/G20_G21.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/G20_G21.cpp deleted file mode 100644 index 53eac4e9be..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/G20_G21.cpp +++ /dev/null @@ -1,39 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(INCH_MODE_SUPPORT) - -#include "../gcode.h" - -/** - * G20: Set input mode to inches - */ -void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } - -/** - * G21: Set input mode to millimeters - */ -void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); } - -#endif // INCH_MODE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M149.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M149.cpp deleted file mode 100644 index b21e376f71..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M149.cpp +++ /dev/null @@ -1,38 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(TEMPERATURE_UNITS_SUPPORT) - -#include "../gcode.h" - -/** - * M149: Set temperature units - */ -void GcodeSuite::M149() { - if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C); - else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K); - else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F); -} - -#endif // TEMPERATURE_UNITS_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M82_M83.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M82_M83.cpp deleted file mode 100644 index 11868b6ddc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/gcode/units/M82_M83.cpp +++ /dev/null @@ -1,33 +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 . - * - */ - -#include "../gcode.h" - -/** - * M82: Set E codes absolute (default) - */ -void GcodeSuite::M82() { set_e_absolute(); } - -/** - * M83: Set E codes relative while in Absolute Coordinates (G90) mode - */ -void GcodeSuite::M83() { set_e_relative(); } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_LCD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_LCD.h deleted file mode 100644 index 543aa7122c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_LCD.h +++ /dev/null @@ -1,572 +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 - -/** - * Conditionals_LCD.h - * Conditionals that need to be set before Configuration_adv.h or pins.h - */ - -#if ENABLED(CARTESIO_UI) - - #define DOGLCD - #define IS_ULTIPANEL - -#elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD - #define IS_RRW_KEYPAD - #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 - #define ADC_KEY_NUM 8 - #define IS_ULTIPANEL - - // This helps to implement ADC_KEYPAD menus - #define REVERSE_MENU_DIRECTION - #define ENCODER_PULSES_PER_STEP 1 - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #define ENCODER_FEEDRATE_DEADZONE 2 - -#elif ENABLED(RADDS_DISPLAY) - #define IS_ULTIPANEL - #define ENCODER_PULSES_PER_STEP 2 - -#elif EITHER(ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER) - - #define IS_RRD_FG_SC - -#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) - - #define IS_ULTRA_LCD - #define DOGLCD - #define IS_ULTIPANEL - - #if ENABLED(miniVIKI) - #define U8GLIB_ST7565_64128N - #elif ENABLED(VIKI2) - #define U8GLIB_ST7565_64128N - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define U8GLIB_LM6059_AF - #define SD_DETECT_INVERTED - #elif ENABLED(AZSMZ_12864) - #define U8GLIB_ST7565_64128N - #endif - -#elif ENABLED(OLED_PANEL_TINYBOY2) - - #define IS_U8GLIB_SSD1306 - #define IS_ULTIPANEL - -#elif ENABLED(RA_CONTROL_PANEL) - - #define LCD_I2C_TYPE_PCA8574 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define IS_ULTIPANEL - -#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define DOGLCD - #define U8GLIB_ST7920 - #define IS_ULTIPANEL - -#elif ENABLED(CR10_STOCKDISPLAY) - - #define IS_RRD_FG_SC - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) - #endif - -#elif ENABLED(MKS_12864OLED) - - #define IS_RRD_SC - #define U8GLIB_SH1106 - -#elif ENABLED(MKS_12864OLED_SSD1306) - - #define IS_RRD_SC - #define IS_U8GLIB_SSD1306 - -#elif ENABLED(MKS_MINI_12864) - - #define MINIPANEL - -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) - - #define FYSETC_MINI_12864 - #define DOGLCD - #define IS_ULTIPANEL - #define LED_COLORS_REDUCE_GREEN - #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) - #define LED_BACKLIGHT_TIMEOUT 10000 - #endif - - // Require LED backlighting enabled - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #define RGB_LED - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LED_CONTROL_MENU - #define NEOPIXEL_LED - #undef NEOPIXEL_TYPE - #define NEOPIXEL_TYPE NEO_RGB - #if NEOPIXEL_PIXELS < 3 - #undef NEOPIXELS_PIXELS - #define NEOPIXEL_PIXELS 3 - #endif - #ifndef NEOPIXEL_BRIGHTNESS - #define NEOPIXEL_BRIGHTNESS 127 - #endif - //#define NEOPIXEL_STARTUP_TEST - #endif - -#elif ENABLED(ULTI_CONTROLLER) - - #define IS_ULTIPANEL - #define U8GLIB_SSD1309 - #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define ENCODER_PULSES_PER_STEP 2 - #define ENCODER_STEPS_PER_MENU_ITEM 2 - -#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) - - #define IS_RRD_SC - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - -#endif - -#if ENABLED(IS_RRD_FG_SC) - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -#endif - -#if EITHER(MAKRPANEL, MINIPANEL) - #define IS_ULTIPANEL - #define DOGLCD - #if ENABLED(MAKRPANEL) - #define U8GLIB_ST7565_64128N - #endif -#endif - -#if ENABLED(IS_U8GLIB_SSD1306) - #define U8GLIB_SSD1306 -#endif - -#if ENABLED(OVERLORD_OLED) - #define IS_ULTIPANEL - #define U8GLIB_SH1106 - /** - * PCA9632 for buzzer and LEDs via i2c - * No auto-inc, red and green leds switched, buzzer - */ - #define PCA9632 - #define PCA9632_NO_AUTO_INC - #define PCA9632_GRN 0x00 - #define PCA9632_RED 0x02 - #define PCA9632_BUZZER - #define PCA9632_BUZZER_DATA { 0x09, 0x02 } - - #define ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons - #define ENCODER_STEPS_PER_MENU_ITEM 1 -#endif - -// 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106 -#define HAS_SSD1306_OLED_I2C ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106) -#if HAS_SSD1306_OLED_I2C - #define IS_ULTRA_LCD - #define DOGLCD -#endif - -// ST7920-based graphical displays -#if ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER) - #define DOGLCD - #define U8GLIB_ST7920 - #define IS_RRD_SC -#endif - -// RepRapDiscount LCD or Graphical LCD with rotary click encoder -#if ENABLED(IS_RRD_SC) - #define REPRAP_DISCOUNT_SMART_CONTROLLER -#endif - -/** - * SPI Ultipanels - */ - -// Basic Ultipanel-like displays -#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106) - #define IS_ULTIPANEL -#endif - -// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h -#if ENABLED(U8GLIB_SH1106_EINSTART) - #define DOGLCD - #define IS_ULTIPANEL -#endif - -// FSMC/SPI TFT Panels -#if ENABLED(FSMC_GRAPHICAL_TFT) - #define DOGLCD - #define IS_ULTIPANEL - #define DELAYED_BACKLIGHT_INIT -#endif - -/** - * I2C Panels - */ - -#if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) - - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - - #if ENABLED(LCD_SAINSMART_I2C_2004) - #define LCD_WIDTH 20 - #define LCD_HEIGHT 4 - #endif - -#elif ENABLED(LCD_I2C_PANELOLU2) - - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define IS_ULTIPANEL - -#elif ENABLED(LCD_I2C_VIKI) - - /** - * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - * - * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) - * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. - * Note: The pause/stop/resume LCD button pin should be connected to the Arduino - * BTN_ENC pin (or set BTN_ENC to -1 if not used) - */ - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define IS_ULTIPANEL - - #define ENCODER_FEEDRATE_DEADZONE 4 - - #define STD_ENCODER_PULSES_PER_STEP 1 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 2 - -#elif ENABLED(G3D_PANEL) - - #define STD_ENCODER_PULSES_PER_STEP 2 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - -#elif ANY(REPRAP_DISCOUNT_SMART_CONTROLLER, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2) - - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - -#endif - -#ifndef STD_ENCODER_PULSES_PER_STEP - #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 -#endif -#ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP -#endif -#ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM -#endif -#ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 6 -#endif - -// Shift register panels -// --------------------- -// 2 wire Non-latching LCD SR from: -// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection -#if ENABLED(FF_INTERFACEBOARD) - #define SR_LCD_3W_NL // Non latching 3 wire shift register - #define IS_ULTIPANEL -#elif ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define IS_ULTIPANEL -#endif - -#if ENABLED(IS_ULTIPANEL) - #define ULTIPANEL -#endif -#if ENABLED(ULTIPANEL) - #define IS_ULTRA_LCD - #ifndef NEWPANEL - #define NEWPANEL - #endif -#endif - -#if ENABLED(IS_ULTRA_LCD) - #define ULTRA_LCD -#endif - -#if ENABLED(IS_RRW_KEYPAD) - #define REPRAPWORLD_KEYPAD -#endif - -// Keypad needs a move step -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL - #ifndef REPRAPWORLD_KEYPAD_MOVE_STEP - #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 - #endif -#endif - -// Extensible UI serial touch screens. (See src/lcd/extensible_ui) -#if ANY(MALYAN_LCD, DGUS_LCD, TOUCH_UI_FTDI_EVE) - #define IS_EXTUI - #define EXTENSIBLE_UI -#endif - -// Aliases for LCD features -#define HAS_SPI_LCD ENABLED(ULTRA_LCD) -#define HAS_DISPLAY (HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI)) -#define HAS_GRAPHICAL_LCD ENABLED(DOGLCD) -#define HAS_CHARACTER_LCD (HAS_SPI_LCD && !HAS_GRAPHICAL_LCD) -#define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS)) -#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD) - -/** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * E_MANUAL - Number of E steppers for LCD move options - * - */ - -#if EXTRUDERS == 0 - #undef DISTINCT_E_FACTORS - #undef SINGLENOZZLE - #undef SWITCHING_EXTRUDER - #undef SWITCHING_NOZZLE - #undef MIXING_EXTRUDER - #undef MK2_MULTIPLEXER - #undef PRUSA_MMU2 -#endif - -#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 - #else - #define E_STEPPERS 1 - #endif - #if DISABLED(SWITCHING_NOZZLE) - #define HOTENDS E_STEPPERS - #endif -#elif ENABLED(MIXING_EXTRUDER) - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 - #define DUAL_MIXING_EXTRUDER (MIXING_STEPPERS == 2) -#elif ENABLED(SWITCHING_TOOLHEAD) - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS -#elif ENABLED(PRUSA_MMU2) - #define E_STEPPERS 1 -#endif - -// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE -#if EITHER(MK2_MULTIPLEXER, SWITCHING_NOZZLE) - #undef DISABLE_INACTIVE_EXTRUDER -#endif - -// Prusa MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE -#if EITHER(MK2_MULTIPLEXER, PRUSA_MMU2) - #define SINGLENOZZLE -#endif - -#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset - #undef HOTENDS - #define HOTENDS 1 - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y -#endif - -#ifndef HOTENDS - #define HOTENDS EXTRUDERS -#endif - -#ifndef E_STEPPERS - #define E_STEPPERS EXTRUDERS -#endif - -#ifndef E_MANUAL - #define E_MANUAL EXTRUDERS -#endif - -#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) - -#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) -#define SWITCHING_NOZZLE_TWO_SERVOS defined(SWITCHING_NOZZLE_E1_SERVO_NR) - -#define HAS_HOTEND_OFFSET (HOTENDS > 1) -#define HAS_DUPLICATION_MODE EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION) - -/** - * DISTINCT_E_FACTORS affects how some E factors are accessed - */ -#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define XYZE_N (XYZ + E_STEPPERS) - #define E_AXIS_N(E) AxisEnum(E_AXIS + E) - #define UNUSED_E(E) NOOP -#else - #undef DISTINCT_E_FACTORS - #define XYZE_N XYZE - #define E_AXIS_N(E) E_AXIS - #define UNUSED_E(E) UNUSED(E) -#endif - -/** - * The BLTouch Probe emulates a servo probe - * and uses "special" angles for its state. - */ -#if ENABLED(BLTOUCH) - #ifndef Z_PROBE_SERVO_NR - #define Z_PROBE_SERVO_NR 0 - #endif - #ifndef NUM_SERVOS - #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1) - #endif - #undef DEACTIVATE_SERVOS_AFTER_MOVE - #if NUM_SERVOS == 1 - #undef SERVO_DELAY - #define SERVO_DELAY { 50 } - #endif - - // Always disable probe pin inverting for BLTouch - #undef Z_MIN_PROBE_ENDSTOP_INVERTING - #define Z_MIN_PROBE_ENDSTOP_INVERTING false - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #undef Z_MIN_ENDSTOP_INVERTING - #define Z_MIN_ENDSTOP_INVERTING false - #endif -#endif - -#ifndef PREHEAT_1_LABEL - #define PREHEAT_1_LABEL "PLA" -#endif - -#ifndef PREHEAT_2_LABEL - #define PREHEAT_2_LABEL "ABS" -#endif - -/** - * Set a flag for a servo probe - */ -#define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) - -/** - * Set flags for enabled probes - */ -#define HAS_BED_PROBE (HAS_Z_SERVO_PROBE || ANY(FIX_MOUNTED_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE)) -#define PROBE_SELECTED (HAS_BED_PROBE || EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) - -#if HAS_BED_PROBE - #define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN) - #ifndef Z_PROBE_LOW_POINT - #define Z_PROBE_LOW_POINT -5 - #endif - #if ENABLED(Z_PROBE_ALLEN_KEY) - #define PROBE_TRIGGERED_WHEN_STOWED_TEST // Extra test for Allen Key Probe - #endif - #ifdef MULTIPLE_PROBING - #if EXTRA_PROBING - #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) - #else - #define TOTAL_PROBING MULTIPLE_PROBING - #endif - #endif -#else - // Clear probe pin settings when no probe is selected - #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -#endif - -#ifdef GRID_MAX_POINTS_X - #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) -#endif - -#define HAS_SOFTWARE_ENDSTOPS EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) -#define HAS_RESUME_CONTINUE ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER) -#define HAS_COLOR_LEDS ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) -#define HAS_LEDS_OFF_FLAG (BOTH(PRINTER_EVENT_LEDS, SDSUPPORT) && HAS_RESUME_CONTINUE) -#define HAS_PRINT_PROGRESS EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) -#define HAS_PRINT_PROGRESS_PERMYRIAD (HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)) -#define HAS_SERVICE_INTERVALS (ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)) -#define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR) - -#define Z_MULTI_STEPPER_DRIVERS EITHER(Z_DUAL_STEPPER_DRIVERS, Z_TRIPLE_STEPPER_DRIVERS) -#define Z_MULTI_ENDSTOPS EITHER(Z_DUAL_ENDSTOPS, Z_TRIPLE_ENDSTOPS) -#define HAS_EXTRA_ENDSTOPS (EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS) - -#define HAS_GAMES ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE) -#define HAS_GAME_MENU (1 < ENABLED(MARLIN_BRICKOUT) + ENABLED(MARLIN_INVADERS) + ENABLED(MARLIN_SNAKE) + ENABLED(MARLIN_MAZE)) - -#define IS_SCARA ENABLED(MORGAN_SCARA) -#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA) -#define IS_CARTESIAN !IS_KINEMATIC - -#ifndef INVERT_X_DIR - #define INVERT_X_DIR false -#endif -#ifndef INVERT_Y_DIR - #define INVERT_Y_DIR false -#endif -#ifndef INVERT_Z_DIR - #define INVERT_Z_DIR false -#endif -#ifndef INVERT_E_DIR - #define INVERT_E_DIR false -#endif - -#if ENABLED(SLIM_LCD_MENUS) - #define BOOT_MARLIN_LOGO_SMALL -#endif - -#define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) - -#define HAS_SDCARD_CONNECTION EITHER(TARGET_LPC1768, ADAFRUIT_GRAND_CENTRAL_M4) - -#define HAS_LINEAR_E_JERK (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE)) - -#ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_adv.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_adv.h deleted file mode 100644 index 0f62a7b577..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_adv.h +++ /dev/null @@ -1,137 +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 - -/** - * Conditionals_adv.h - * 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) - // Define constants and variables for buffering serial data. - // Use only 0 or powers of 2 greater than 1 - // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...] - #ifndef RX_BUFFER_SIZE - #define RX_BUFFER_SIZE 128 - #endif - // 256 is the max TX buffer limit due to uint8_t head and tail - // : [0, 4, 8, 16, 32, 64, 128, 256] - #ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 32 - #endif -#else - // SERIAL_XON_XOFF not supported on USB-native devices - #undef SERIAL_XON_XOFF -#endif - -#if ENABLED(HOST_ACTION_COMMANDS) - #ifndef ACTION_ON_PAUSE - #define ACTION_ON_PAUSE "pause" - #endif - #ifndef ACTION_ON_PAUSED - #define ACTION_ON_PAUSED "paused" - #endif - #ifndef ACTION_ON_RESUME - #define ACTION_ON_RESUME "resume" - #endif - #ifndef ACTION_ON_RESUMED - #define ACTION_ON_RESUMED "resumed" - #endif - #ifndef ACTION_ON_CANCEL - #define ACTION_ON_CANCEL "cancel" - #endif - #ifndef ACTION_ON_KILL - #define ACTION_ON_KILL "poweroff" - #endif - #if HAS_FILAMENT_SENSOR - #ifndef ACTION_ON_FILAMENT_RUNOUT - #define ACTION_ON_FILAMENT_RUNOUT "filament_runout" - #endif - #ifndef ACTION_REASON_ON_FILAMENT_RUNOUT - #define ACTION_REASON_ON_FILAMENT_RUNOUT "filament_runout" - #endif - #endif - #if ENABLED(G29_RETRY_AND_RECOVER) - #ifndef ACTION_ON_G29_RECOVER - #define ACTION_ON_G29_RECOVER "probe_rewipe" - #endif - #ifndef ACTION_ON_G29_FAILURE - #define ACTION_ON_G29_FAILURE "probe_failed" - #endif - #endif -#endif - -#if ENABLED(FYSETC_MINI_12864_2_1) - #define LED_CONTROL_MENU - #define LED_USER_PRESET_STARTUP - #define LED_COLOR_PRESETS - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 128 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 0 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS 255 - #endif -#endif - -// Extensible UI pin mapping for RepRapDiscount -#define TOUCH_UI_ULTIPANEL ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP) - -// Poll-based jogging for joystick and other devices -#if ENABLED(JOYSTICK) - #define POLL_JOG -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_post.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_post.h deleted file mode 100644 index 1a6a33d387..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Conditionals_post.h +++ /dev/null @@ -1,1793 +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 - -/** - * Conditionals_post.h - * Defines that depend on configuration but are not editable. - */ - -#define AVR_ATmega2560_FAMILY_PLUS_70 ( \ - MB(BQ_ZUM_MEGA_3D) \ - || MB(MIGHTYBOARD_REVE) \ - || MB(MINIRAMBO) \ - || MB(SCOOVO_X9H) \ -) - -#ifdef TEENSYDUINO - #undef max - #define max(a,b) ((a)>(b)?(a):(b)) - #undef min - #define min(a,b) ((a)<(b)?(a):(b)) - - #undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around - #define NOT_A_PIN 0 // For PINS_DEBUGGING -#endif - -#define HAS_CLASSIC_JERK (ENABLED(CLASSIC_JERK) || IS_KINEMATIC) -#define HAS_CLASSIC_E_JERK (ENABLED(CLASSIC_JERK) || DISABLED(LIN_ADVANCE)) - -/** - * Axis lengths and center - */ -#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS)) -#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) -#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS)) - -// Defined only if the sanity-check is bypassed -#ifndef X_BED_SIZE - #define X_BED_SIZE X_MAX_LENGTH -#endif -#ifndef Y_BED_SIZE - #define Y_BED_SIZE Y_MAX_LENGTH -#endif - -// Require 0,0 bed center for Delta and SCARA -#if IS_KINEMATIC - #define BED_CENTER_AT_0_0 -#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_HALF_BED - #define Y_CENTER _Y_HALF_BED -#endif - -// Get the linear boundaries of the bed -#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 - */ -#if ENABLED(DUAL_X_CARRIAGE) - #ifndef X1_MIN_POS - #define X1_MIN_POS X_MIN_POS - #endif - #ifndef X1_MAX_POS - #define X1_MAX_POS X_BED_SIZE - #endif -#endif - -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#define CORE_IS_XY EITHER(COREXY, COREYX) -#define CORE_IS_XZ EITHER(COREXZ, COREZX) -#define CORE_IS_YZ EITHER(COREYZ, COREZY) -#define IS_CORE (CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ) -#if IS_CORE - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS - #endif - #if ANY(COREYX, COREZX, COREZY) - #define CORESIGN(n) (-(n)) - #else - #define CORESIGN(n) (n) - #endif -#endif - -/** - * No adjustable bed on non-cartesians - */ -#if IS_KINEMATIC - #undef LEVEL_BED_CORNERS -#endif - -/** - * SCARA cannot use SLOWDOWN and requires QUICKHOME - * Printable radius assumes joints can fully extend - */ -#if IS_SCARA - #undef SLOWDOWN - #define QUICK_HOME - #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) -#endif - -/** - * Set the home position based on settings or manual overrides - */ -#ifdef MANUAL_X_HOME_POS - #define X_HOME_POS MANUAL_X_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define X_HOME_POS 0 - #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) - #endif -#else - #if ENABLED(DELTA) - #define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5) - #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Y_HOME_POS - #define Y_HOME_POS MANUAL_Y_HOME_POS -#elif ENABLED(BED_CENTER_AT_0_0) - #if ENABLED(DELTA) - #define Y_HOME_POS 0 - #else - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) - #endif -#else - #if ENABLED(DELTA) - #define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 0.5) - #else - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) - #endif -#endif - -#ifdef MANUAL_Z_HOME_POS - #define Z_HOME_POS MANUAL_Z_HOME_POS -#else - #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS) -#endif - -/** - * If DELTA_HEIGHT isn't defined use the old setting - */ -#if ENABLED(DELTA) && !defined(DELTA_HEIGHT) - #define DELTA_HEIGHT Z_HOME_POS -#endif - -/** - * Z Sled Probe requires Z_SAFE_HOMING - */ -#if ENABLED(Z_PROBE_SLED) - #define Z_SAFE_HOMING -#endif - -/** - * DELTA should ignore Z_SAFE_HOMING and SLOWDOWN - */ -#if ENABLED(DELTA) - #undef Z_SAFE_HOMING - #undef SLOWDOWN -#endif - -#ifndef MESH_INSET - #define MESH_INSET 0 -#endif - -/** - * Safe Homing Options - */ -#if ENABLED(Z_SAFE_HOMING) - #if ENABLED(AUTO_BED_LEVELING_UBL) - // Home close to center so grid points have z heights very close to 0 - #define _SAFE_POINT(A) (((GRID_MAX_POINTS_##A) / 2) * (A##_BED_SIZE - 2 * (MESH_INSET)) / (GRID_MAX_POINTS_##A - 1) + MESH_INSET) - #else - #define _SAFE_POINT(A) A##_CENTER - #endif - #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT _SAFE_POINT(X) - #endif - #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT _SAFE_POINT(Y) - #endif -#endif - -/** - * Host keep alive - */ -#ifndef DEFAULT_KEEPALIVE_INTERVAL - #define DEFAULT_KEEPALIVE_INTERVAL 2 -#endif - -/** - * Provide a MAX_AUTORETRACT for older configs - */ -#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT) - #define MAX_AUTORETRACT 99 -#endif - -/** - * LCD Contrast for Graphical Displays - */ -#if ENABLED(CARTESIO_UI) - #define _LCD_CONTRAST_MIN 60 - #define _LCD_CONTRAST_INIT 90 - #define _LCD_CONTRAST_MAX 140 -#elif ENABLED(miniVIKI) - #define _LCD_CONTRAST_MIN 75 - #define _LCD_CONTRAST_INIT 95 - #define _LCD_CONTRAST_MAX 115 -#elif ENABLED(VIKI2) - #define _LCD_CONTRAST_INIT 140 -#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define _LCD_CONTRAST_MIN 90 - #define _LCD_CONTRAST_INIT 110 - #define _LCD_CONTRAST_MAX 130 -#elif ENABLED(AZSMZ_12864) - #define _LCD_CONTRAST_MIN 120 - #define _LCD_CONTRAST_INIT 190 -#elif ENABLED(MKS_MINI_12864) - #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) - #define _LCD_CONTRAST_INIT 127 - #define _LCD_CONTRAST_MAX 254 -#elif EITHER(MAKRPANEL, MINIPANEL) - #define _LCD_CONTRAST_INIT 17 -#endif - -#define HAS_LCD_CONTRAST defined(_LCD_CONTRAST_INIT) -#if HAS_LCD_CONTRAST - #ifndef LCD_CONTRAST_MIN - #ifdef _LCD_CONTRAST_MIN - #define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN - #else - #define LCD_CONTRAST_MIN 0 - #endif - #endif - #ifndef LCD_CONTRAST_INIT - #define LCD_CONTRAST_INIT _LCD_CONTRAST_INIT - #endif - #ifndef LCD_CONTRAST_MAX - #ifdef _LCD_CONTRAST_MAX - #define LCD_CONTRAST_MAX _LCD_CONTRAST_MAX - #elif _LCD_CONTRAST_INIT > 63 - #define LCD_CONTRAST_MAX 255 - #else - #define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast - #endif - #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT - #endif -#endif - -/** - * Override here because this is set in Configuration_adv.h - */ -#if HAS_LCD_MENU && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #undef SD_DETECT_INVERTED -#endif - -/** - * Set defaults for missing (newer) options - */ -#ifndef DISABLE_INACTIVE_X - #define DISABLE_INACTIVE_X DISABLE_X -#endif -#ifndef DISABLE_INACTIVE_Y - #define DISABLE_INACTIVE_Y DISABLE_Y -#endif -#ifndef DISABLE_INACTIVE_Z - #define DISABLE_INACTIVE_Z DISABLE_Z -#endif -#ifndef DISABLE_INACTIVE_E - #define DISABLE_INACTIVE_E DISABLE_E -#endif - -/** - * Power Supply - */ -#ifndef PSU_NAME - #if DISABLED(PSU_CONTROL) - #define PSU_NAME "Generic" // No control - #elif PSU_ACTIVE_HIGH - #define PSU_NAME "XBox" // X-Box 360 (203W) - #else - #define PSU_NAME "ATX" // ATX style - #endif -#endif - -#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) - #define PSU_POWERUP_DELAY 100 -#endif - -/** - * Temp Sensor defines - */ - -#define ANY_TEMP_SENSOR_IS(n) (TEMP_SENSOR_0 == (n) || TEMP_SENSOR_1 == (n) || TEMP_SENSOR_2 == (n) || TEMP_SENSOR_3 == (n) || TEMP_SENSOR_4 == (n) || TEMP_SENSOR_5 == (n) || TEMP_SENSOR_BED == (n) || TEMP_SENSOR_CHAMBER == (n)) - -#define HAS_USER_THERMISTORS ANY_TEMP_SENSOR_IS(1000) - -#if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 - #if TEMP_SENSOR_0 == -3 - #define HEATER_0_MAX6675_TMIN -270 - #define HEATER_0_MAX6675_TMAX 1800 - #else - #define HEATER_0_MAX6675_TMIN 0 - #define HEATER_0_MAX6675_TMAX 1024 - #endif - #if TEMP_SENSOR_0 == -5 - #define MAX6675_IS_MAX31865 - #elif TEMP_SENSOR_0 == -3 - #define MAX6675_IS_MAX31855 - #endif -#elif TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 -#elif TEMP_SENSOR_0 == -1 - #define HEATER_0_USES_AD595 -#elif TEMP_SENSOR_0 > 0 - #define THERMISTOR_HEATER_0 TEMP_SENSOR_0 - #define HEATER_0_USES_THERMISTOR - #if TEMP_SENSOR_0 == 1000 - #define HEATER_0_USER_THERMISTOR - #endif -#else - #undef HEATER_0_MINTEMP - #undef HEATER_0_MAXTEMP -#endif - -#if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2 - #define HEATER_1_USES_MAX6675 - #if TEMP_SENSOR_1 == -3 - #define HEATER_1_MAX6675_TMIN -270 - #define HEATER_1_MAX6675_TMAX 1800 - #else - #define HEATER_1_MAX6675_TMIN 0 - #define HEATER_1_MAX6675_TMAX 1024 - #endif - #if TEMP_SENSOR_1 != TEMP_SENSOR_0 - #if TEMP_SENSOR_1 == -5 - #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." - #elif TEMP_SENSOR_1 == -3 - #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." - #elif TEMP_SENSOR_1 == -2 - #error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." - #endif - #endif -#elif TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 -#elif TEMP_SENSOR_1 == -1 - #define HEATER_1_USES_AD595 -#elif TEMP_SENSOR_1 > 0 - #define THERMISTOR_HEATER_1 TEMP_SENSOR_1 - #define HEATER_1_USES_THERMISTOR - #if TEMP_SENSOR_1 == 1000 - #define HEATER_1_USER_THERMISTOR - #endif -#else - #undef HEATER_1_MINTEMP - #undef HEATER_1_MAXTEMP -#endif - -#if TEMP_SENSOR_2 == -4 - #define HEATER_2_USES_AD8495 -#elif TEMP_SENSOR_2 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2." -#elif TEMP_SENSOR_2 == -1 - #define HEATER_2_USES_AD595 -#elif TEMP_SENSOR_2 > 0 - #define THERMISTOR_HEATER_2 TEMP_SENSOR_2 - #define HEATER_2_USES_THERMISTOR - #if TEMP_SENSOR_2 == 1000 - #define HEATER_2_USER_THERMISTOR - #endif -#else - #undef HEATER_2_MINTEMP - #undef HEATER_2_MAXTEMP -#endif - -#if TEMP_SENSOR_3 == -4 - #define HEATER_3_USES_AD8495 -#elif TEMP_SENSOR_3 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." -#elif TEMP_SENSOR_3 == -1 - #define HEATER_3_USES_AD595 -#elif TEMP_SENSOR_3 > 0 - #define THERMISTOR_HEATER_3 TEMP_SENSOR_3 - #define HEATER_3_USES_THERMISTOR - #if TEMP_SENSOR_3 == 1000 - #define HEATER_3_USER_THERMISTOR - #endif -#else - #undef HEATER_3_MINTEMP - #undef HEATER_3_MAXTEMP -#endif - -#if TEMP_SENSOR_4 == -4 - #define HEATER_4_USES_AD8495 -#elif TEMP_SENSOR_4 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." -#elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 -#elif TEMP_SENSOR_4 > 0 - #define THERMISTOR_HEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR - #if TEMP_SENSOR_4 == 1000 - #define HEATER_4_USER_THERMISTOR - #endif -#else - #undef HEATER_4_MINTEMP - #undef HEATER_4_MAXTEMP -#endif - -#if TEMP_SENSOR_5 == -4 - #define HEATER_5_USES_AD8495 -#elif TEMP_SENSOR_5 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5." -#elif TEMP_SENSOR_5 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5." -#elif TEMP_SENSOR_5 == -1 - #define HEATER_5_USES_AD595 -#elif TEMP_SENSOR_5 > 0 - #define THERMISTOR_HEATER_5 TEMP_SENSOR_5 - #define HEATER_5_USES_THERMISTOR - #if TEMP_SENSOR_5 == 1000 - #define HEATER_5_USER_THERMISTOR - #endif -#else - #undef HEATER_5_MINTEMP - #undef HEATER_5_MAXTEMP -#endif - -#if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 -#elif TEMP_SENSOR_BED == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." -#elif TEMP_SENSOR_BED == -1 - #define HEATER_BED_USES_AD595 -#elif TEMP_SENSOR_BED > 0 - #define THERMISTORBED TEMP_SENSOR_BED - #define HEATER_BED_USES_THERMISTOR - #if TEMP_SENSOR_BED == 1000 - #define HEATER_BED_USER_THERMISTOR - #endif -#else - #undef BED_MINTEMP - #undef BED_MAXTEMP -#endif - -#if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 -#elif TEMP_SENSOR_CHAMBER == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." -#elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 -#elif TEMP_SENSOR_CHAMBER > 0 - #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR - #if TEMP_SENSOR_CHAMBER == 1000 - #define HEATER_CHAMBER_USER_THERMISTOR - #endif -#else - #undef CHAMBER_MINTEMP - #undef CHAMBER_MAXTEMP -#endif - -#define HOTEND_USES_THERMISTOR ANY(HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, HEATER_4_USES_THERMISTOR) - -/** - * Default hotend offsets, if not defined - */ -#if HAS_HOTEND_OFFSET - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Z - #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder - #endif -#endif - -/** - * ARRAY_BY_EXTRUDERS based on EXTRUDERS - */ -#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(V...) ARRAY_N(HOTENDS, V) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) - -/** - * Driver Timings - * NOTE: Driver timing order is longest-to-shortest duration. - * Preserve this ordering when adding new drivers. - */ - -#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_POST_DIR_DELAY - #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_POST_DIR_DELAY 15000 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_POST_DIR_DELAY 1500 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_POST_DIR_DELAY 650 - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_POST_DIR_DELAY 500 - #elif HAS_DRIVER(A5984) - #define MINIMUM_STEPPER_POST_DIR_DELAY 400 - #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_POST_DIR_DELAY 200 - #elif TRINAMICS - #define MINIMUM_STEPPER_POST_DIR_DELAY 20 - #else - #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 - #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_PULSE 3 - #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_PULSE 2 - #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984) - #define MINIMUM_STEPPER_PULSE 1 - #elif TRINAMICS - #if ENABLED(LIN_ADVANCE) && (HAS_TMC_STANDALONE_E_DRIVER || (HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING))) - #define MINIMUM_STEPPER_PULSE 1 - #else - #define MINIMUM_STEPPER_PULSE 0 - #endif - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_PULSE 0 - #else - #define MINIMUM_STEPPER_PULSE 2 - #endif -#endif - -#ifndef MAXIMUM_STEPPER_RATE - #if HAS_DRIVER(TB6560) - #define MAXIMUM_STEPPER_RATE 15000 - #elif HAS_DRIVER(TB6600) - #define MAXIMUM_STEPPER_RATE 150000 - #elif HAS_DRIVER(LV8729) - #define MAXIMUM_STEPPER_RATE 200000 - #elif HAS_DRIVER(DRV8825) - #define MAXIMUM_STEPPER_RATE 250000 - #elif TRINAMICS - #define MAXIMUM_STEPPER_RATE 400000 - #elif HAS_DRIVER(A4988) - #define MAXIMUM_STEPPER_RATE 500000 - #else - #define MAXIMUM_STEPPER_RATE 250000 - #endif -#endif - -/** - * X_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(X_DUAL_ENDSTOPS) - #if X_HOME_DIR > 0 - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MAX_PIN Z_MAX_PIN - #else - #define X2_MAX_ENDSTOP_INVERTING false - #endif - #define X2_MIN_ENDSTOP_INVERTING false - #else - #if X2_USE_ENDSTOP == _XMIN_ - #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MIN_PIN - #elif X2_USE_ENDSTOP == _XMAX_ - #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN X_MAX_PIN - #elif X2_USE_ENDSTOP == _YMIN_ - #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MIN_PIN - #elif X2_USE_ENDSTOP == _YMAX_ - #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Y_MAX_PIN - #elif X2_USE_ENDSTOP == _ZMIN_ - #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MIN_PIN - #elif X2_USE_ENDSTOP == _ZMAX_ - #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define X2_MIN_PIN Z_MAX_PIN - #else - #define X2_MIN_ENDSTOP_INVERTING false - #endif - #define X2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the X2 endstop? -#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) - -/** - * Y_DUAL_ENDSTOPS endstop reassignment - */ -#if ENABLED(Y_DUAL_ENDSTOPS) - #if Y_HOME_DIR > 0 - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MAX_PIN Z_MAX_PIN - #else - #define Y2_MAX_ENDSTOP_INVERTING false - #endif - #define Y2_MIN_ENDSTOP_INVERTING false - #else - #if Y2_USE_ENDSTOP == _XMIN_ - #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MIN_PIN - #elif Y2_USE_ENDSTOP == _XMAX_ - #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN X_MAX_PIN - #elif Y2_USE_ENDSTOP == _YMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MIN_PIN - #elif Y2_USE_ENDSTOP == _YMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Y_MAX_PIN - #elif Y2_USE_ENDSTOP == _ZMIN_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MIN_PIN - #elif Y2_USE_ENDSTOP == _ZMAX_ - #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Y2_MIN_PIN Z_MAX_PIN - #else - #define Y2_MIN_ENDSTOP_INVERTING false - #endif - #define Y2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Y2 endstop or the bed probe? -#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) - -/** - * Z_DUAL_ENDSTOPS endstop reassignment - */ -#if Z_MULTI_ENDSTOPS - #if Z_HOME_DIR > 0 - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MAX_PIN - #else - #define Z2_MAX_ENDSTOP_INVERTING false - #endif - #define Z2_MIN_ENDSTOP_INVERTING false - #else - #if Z2_USE_ENDSTOP == _XMIN_ - #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MIN_PIN - #elif Z2_USE_ENDSTOP == _XMAX_ - #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN X_MAX_PIN - #elif Z2_USE_ENDSTOP == _YMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MIN_PIN - #elif Z2_USE_ENDSTOP == _YMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Y_MAX_PIN - #elif Z2_USE_ENDSTOP == _ZMIN_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MIN_PIN - #elif Z2_USE_ENDSTOP == _ZMAX_ - #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z2_MIN_PIN Z_MAX_PIN - #else - #define Z2_MIN_ENDSTOP_INVERTING false - #endif - #define Z2_MAX_ENDSTOP_INVERTING false - #endif -#endif - -#if ENABLED(Z_TRIPLE_ENDSTOPS) - #if Z_HOME_DIR > 0 - #if Z3_USE_ENDSTOP == _XMIN_ - #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z3_MAX_PIN X_MIN_PIN - #elif Z3_USE_ENDSTOP == _XMAX_ - #define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z3_MAX_PIN X_MAX_PIN - #elif Z3_USE_ENDSTOP == _YMIN_ - #define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z3_MAX_PIN Y_MIN_PIN - #elif Z3_USE_ENDSTOP == _YMAX_ - #define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z3_MAX_PIN Y_MAX_PIN - #elif Z3_USE_ENDSTOP == _ZMIN_ - #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z3_MAX_PIN Z_MIN_PIN - #elif Z3_USE_ENDSTOP == _ZMAX_ - #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z3_MAX_PIN Z_MAX_PIN - #else - #define Z3_MAX_ENDSTOP_INVERTING false - #endif - #define Z3_MIN_ENDSTOP_INVERTING false - #else - #if Z3_USE_ENDSTOP == _XMIN_ - #define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING - #define Z3_MIN_PIN X_MIN_PIN - #elif Z3_USE_ENDSTOP == _XMAX_ - #define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING - #define Z3_MIN_PIN X_MAX_PIN - #elif Z3_USE_ENDSTOP == _YMIN_ - #define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING - #define Z3_MIN_PIN Y_MIN_PIN - #elif Z3_USE_ENDSTOP == _YMAX_ - #define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING - #define Z3_MIN_PIN Y_MAX_PIN - #elif Z3_USE_ENDSTOP == _ZMIN_ - #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING - #define Z3_MIN_PIN Z_MIN_PIN - #elif Z3_USE_ENDSTOP == _ZMAX_ - #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING - #define Z3_MIN_PIN Z_MAX_PIN - #else - #define Z3_MIN_ENDSTOP_INVERTING false - #endif - #define Z3_MAX_ENDSTOP_INVERTING false - #endif -#endif - -// Is an endstop plug used for the Z2 endstop or the bed probe? -#define IS_Z2_OR_PROBE(A,M) ( \ - (Z_MULTI_ENDSTOPS && Z2_USE_ENDSTOP == _##A##M##_) \ - || (HAS_CUSTOM_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) - -// Is an endstop plug used for the Z3 endstop or the bed probe? -#define IS_Z3_OR_PROBE(A,M) ( \ - (ENABLED(Z_TRIPLE_ENDSTOPS) && Z3_USE_ENDSTOP == _##A##M##_) \ - || (HAS_CUSTOM_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) - -/** - * Set ENDSTOPPULLUPS for active endstop switches - */ -#if ENABLED(ENDSTOPPULLUPS) - #if ENABLED(USE_XMAX_PLUG) - #define ENDSTOPPULLUP_XMAX - #endif - #if ENABLED(USE_YMAX_PLUG) - #define ENDSTOPPULLUP_YMAX - #endif - #if ENABLED(USE_ZMAX_PLUG) - #define ENDSTOPPULLUP_ZMAX - #endif - #if ENABLED(USE_XMIN_PLUG) - #define ENDSTOPPULLUP_XMIN - #endif - #if ENABLED(USE_YMIN_PLUG) - #define ENDSTOPPULLUP_YMIN - #endif - #if ENABLED(USE_ZMIN_PLUG) - #define ENDSTOPPULLUP_ZMIN - #endif -#endif - -/** - * Set ENDSTOPPULLDOWNS for active endstop switches - */ -#if ENABLED(ENDSTOPPULLDOWNS) - #if ENABLED(USE_XMAX_PLUG) - #define ENDSTOPPULLDOWN_XMAX - #endif - #if ENABLED(USE_YMAX_PLUG) - #define ENDSTOPPULLDOWN_YMAX - #endif - #if ENABLED(USE_ZMAX_PLUG) - #define ENDSTOPPULLDOWN_ZMAX - #endif - #if ENABLED(USE_XMIN_PLUG) - #define ENDSTOPPULLDOWN_XMIN - #endif - #if ENABLED(USE_YMIN_PLUG) - #define ENDSTOPPULLDOWN_YMIN - #endif - #if ENABLED(USE_ZMIN_PLUG) - #define ENDSTOPPULLDOWN_ZMIN - #endif -#endif - -/** - * Shorthand for pin tests, used wherever needed - */ - -// Steppers -#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X))) -#define HAS_X_DIR (PIN_EXISTS(X_DIR)) -#define HAS_X_STEP (PIN_EXISTS(X_STEP)) -#define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) - -#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2))) -#define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) -#define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) -#define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1)) - -#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))) -#define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) -#define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) -#define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) - -#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2))) -#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) -#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) -#define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1)) - -#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z))) -#define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) -#define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) -#define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) - -#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2))) -#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) -#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) -#define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1)) - -#define HAS_Z3_ENABLE (PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3))) -#define HAS_Z3_DIR (PIN_EXISTS(Z3_DIR)) -#define HAS_Z3_STEP (PIN_EXISTS(Z3_STEP)) -#define HAS_Z3_MICROSTEPS (PIN_EXISTS(Z3_MS1)) - -// Extruder steppers and solenoids -#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0))) -#define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) -#define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) -#define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) -#define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) - -#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1))) -#define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) -#define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) -#define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) -#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) - -#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2))) -#define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) -#define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) -#define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) -#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) - -#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3))) -#define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) -#define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) -#define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) -#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) - -#define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4))) -#define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) -#define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) -#define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) -#define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) - -#define HAS_E5_ENABLE (PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5))) -#define HAS_E5_DIR (PIN_EXISTS(E5_DIR)) -#define HAS_E5_STEP (PIN_EXISTS(E5_STEP)) -#define HAS_E5_MICROSTEPS (PIN_EXISTS(E5_MS1)) -#define HAS_SOLENOID_5 (PIN_EXISTS(SOL5)) - -// Trinamic Stepper Drivers -#if HAS_TRINAMIC - #define HAS_TMCX1X0 (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160)) - #define TMC_HAS_SPI (HAS_TMCX1X0 || HAS_DRIVER(TMC2660)) - #define HAS_STALLGUARD (HAS_TMCX1X0 || HAS_DRIVER(TMC2209) || HAS_DRIVER(TMC2660)) - #define HAS_STEALTHCHOP (HAS_TMCX1X0 || HAS_TMC220x) - - #define STEALTHCHOP_ENABLED ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E) - #define USE_SENSORLESS EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) - // Disable Z axis sensorless homing if a probe is used to home the Z axis - #if HOMING_Z_WITH_PROBE - #undef Z_STALL_SENSITIVITY - #endif - #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 Y2_SENSORLESS (AXIS_HAS_STALLGUARD(Y2) && defined(Y2_STALL_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY)) - #define Z2_SENSORLESS (AXIS_HAS_STALLGUARD(Z2) && defined(Z2_STALL_SENSITIVITY)) - #define Z3_SENSORLESS (AXIS_HAS_STALLGUARD(Z3) && defined(Z3_STALL_SENSITIVITY)) - #if ENABLED(SPI_ENDSTOPS) - #define X_SPI_SENSORLESS X_SENSORLESS - #define Y_SPI_SENSORLESS Y_SENSORLESS - #define Z_SPI_SENSORLESS Z_SENSORLESS - #endif -#endif - -#define HAS_E_STEPPER_ENABLE (HAS_E_DRIVER(TMC2660) \ - || ( E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != X_ENABLE_PIN \ - && E0_ENABLE_PIN != Y_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN ) \ -) - -// Endstops and bed probe -#define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_OR_PROBE(A,M)) -#define HAS_X_MIN _HAS_STOP(X,MIN) -#define HAS_X_MAX _HAS_STOP(X,MAX) -#define HAS_Y_MIN _HAS_STOP(Y,MIN) -#define HAS_Y_MAX _HAS_STOP(Y,MAX) -#define HAS_Z_MIN _HAS_STOP(Z,MIN) -#define HAS_Z_MAX _HAS_STOP(Z,MAX) -#define HAS_X2_MIN (PIN_EXISTS(X2_MIN)) -#define HAS_X2_MAX (PIN_EXISTS(X2_MAX)) -#define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN)) -#define HAS_Y2_MAX (PIN_EXISTS(Y2_MAX)) -#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) -#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) -#define HAS_Z3_MIN (PIN_EXISTS(Z3_MIN)) -#define HAS_Z3_MAX (PIN_EXISTS(Z3_MAX)) -#define HAS_Z_MIN_PROBE_PIN (HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE)) -#define HAS_CALIBRATION_PIN (PIN_EXISTS(CALIBRATION)) - -// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) -#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) -#define HAS_TEMP_ADC_0 HAS_ADC_TEST(0) -#define HAS_TEMP_ADC_1 HAS_ADC_TEST(1) -#define HAS_TEMP_ADC_2 HAS_ADC_TEST(2) -#define HAS_TEMP_ADC_3 HAS_ADC_TEST(3) -#define HAS_TEMP_ADC_4 HAS_ADC_TEST(4) -#define HAS_TEMP_ADC_5 HAS_ADC_TEST(5) -#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) -#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) - -#define HAS_TEMP_HOTEND (HOTENDS > 0 && (HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675))) -#define HAS_TEMP_BED HAS_TEMP_ADC_BED -#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)) -#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2)) -#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) -#define HAS_HEATER_4 (PIN_EXISTS(HEATER_4)) -#define HAS_HEATER_5 (PIN_EXISTS(HEATER_5)) -#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) - -// Shorthand for common combinations -#define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED) -#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 - #undef PIDTEMPBED -#endif -#define HAS_PID_HEATING EITHER(PIDTEMP, PIDTEMPBED) -#define HAS_PID_FOR_BOTH BOTH(PIDTEMP, PIDTEMPBED) - -// Thermal protection -#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED)) -#define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) -#define WATCH_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) -#define WATCH_CHAMBER (HAS_HEATED_CHAMBER && ENABLED(THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0) - -// Auto fans -#define HAS_AUTO_FAN_0 (HOTENDS > 0 && PIN_EXISTS(E0_AUTO_FAN)) -#define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) -#define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) -#define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) -#define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) -#define HAS_AUTO_FAN_5 (HOTENDS > 5 && PIN_EXISTS(E5_AUTO_FAN)) -#define HAS_AUTO_CHAMBER_FAN (HAS_TEMP_CHAMBER && PIN_EXISTS(CHAMBER_AUTO_FAN)) - -#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_FAN_4 || HAS_AUTO_FAN_5 || HAS_AUTO_CHAMBER_FAN) -#define _FANOVERLAP(A,B) (A##_AUTO_FAN_PIN == E##B##_AUTO_FAN_PIN) -#if HAS_AUTO_FAN - #define AUTO_CHAMBER_IS_E (_FANOVERLAP(CHAMBER,0) || _FANOVERLAP(CHAMBER,1) || _FANOVERLAP(CHAMBER,2) || _FANOVERLAP(CHAMBER,3) || _FANOVERLAP(CHAMBER,4) || _FANOVERLAP(CHAMBER,5)) -#endif - -#if !HAS_AUTO_CHAMBER_FAN || AUTO_CHAMBER_IS_E - #undef AUTO_POWER_CHAMBER_FAN -#endif - -// Other fans -#define HAS_FAN0 (PIN_EXISTS(FAN)) -#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN && E4_AUTO_FAN_PIN != FAN1_PIN && E5_AUTO_FAN_PIN != FAN1_PIN) -#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN && E4_AUTO_FAN_PIN != FAN2_PIN && E5_AUTO_FAN_PIN != FAN2_PIN) -#define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) - -// Servos -#define HAS_SERVO_0 (PIN_EXISTS(SERVO0) && NUM_SERVOS > 0) -#define HAS_SERVO_1 (PIN_EXISTS(SERVO1) && NUM_SERVOS > 1) -#define HAS_SERVO_2 (PIN_EXISTS(SERVO2) && NUM_SERVOS > 2) -#define HAS_SERVO_3 (PIN_EXISTS(SERVO3) && NUM_SERVOS > 3) -#define HAS_SERVOS (NUM_SERVOS > 0) - -#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR -1 -#endif - -#define HAS_SERVO_ANGLES (EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) || (HAS_Z_SERVO_PROBE && defined(Z_PROBE_SERVO_NR))) - -#if !HAS_SERVO_ANGLES || ENABLED(BLTOUCH) - #undef EDITABLE_SERVO_ANGLES -#endif - -// Sensors -#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) - -// User Interface -#define HAS_HOME (PIN_EXISTS(HOME)) -#define HAS_KILL (PIN_EXISTS(KILL)) -#define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) -#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH)) -#define HAS_BUZZER (PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)) -#define USE_BEEPER (HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)) -#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) - -// Digital control -#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) -#define HAS_MOTOR_CURRENT_PWM ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E) - -#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS) - -#if HAS_MICROSTEPS - - // MS1 MS2 MS3 Stepper Driver Microstepping mode table - #ifndef MICROSTEP1 - #define MICROSTEP1 LOW,LOW,LOW - #endif - #if ENABLED(HEROIC_STEPPER_DRIVERS) - #ifndef MICROSTEP128 - #define MICROSTEP128 LOW,HIGH,LOW - #endif - #else - #ifndef MICROSTEP2 - #define MICROSTEP2 HIGH,LOW,LOW - #endif - #ifndef MICROSTEP4 - #define MICROSTEP4 LOW,HIGH,LOW - #endif - #endif - #ifndef MICROSTEP8 - #define MICROSTEP8 HIGH,HIGH,LOW - #endif - #ifdef __SAM3X8E__ - #if MB(ALLIGATOR) - #ifndef MICROSTEP16 - #define MICROSTEP16 LOW,LOW,LOW - #endif - #ifndef MICROSTEP32 - #define MICROSTEP32 HIGH,HIGH,LOW - #endif - #else - #ifndef MICROSTEP16 - #define MICROSTEP16 HIGH,HIGH,LOW - #endif - #endif - #else - #ifndef MICROSTEP16 - #define MICROSTEP16 HIGH,HIGH,LOW - #endif - #endif - - #define HAS_MICROSTEP1 defined(MICROSTEP1) - #define HAS_MICROSTEP2 defined(MICROSTEP2) - #define HAS_MICROSTEP4 defined(MICROSTEP4) - #define HAS_MICROSTEP8 defined(MICROSTEP8) - #define HAS_MICROSTEP16 defined(MICROSTEP16) - #define HAS_MICROSTEP32 defined(MICROSTEP32) - #define HAS_MICROSTEP64 defined(MICROSTEP64) - #define HAS_MICROSTEP128 defined(MICROSTEP128) - -#endif // HAS_MICROSTEPS - -#if !HAS_TEMP_SENSOR - #undef AUTO_REPORT_TEMPERATURES -#endif - -#define HAS_AUTO_REPORTING EITHER(AUTO_REPORT_TEMPERATURES, AUTO_REPORT_SD_STATUS) - -/** - * This setting is also used by M109 when trying to calculate - * a ballpark safe margin to prevent wait-forever situation. - */ -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif - -/** - * Heater signal inversion defaults - */ - -#if HAS_HEATER_0 && !defined(HEATER_0_INVERTING) - #define HEATER_0_INVERTING false -#endif - -#if HAS_HEATER_1 && !defined(HEATER_1_INVERTING) - #define HEATER_1_INVERTING false -#endif - -#if HAS_HEATER_2 && !defined(HEATER_2_INVERTING) - #define HEATER_2_INVERTING false -#endif - -#if HAS_HEATER_3 && !defined(HEATER_3_INVERTING) - #define HEATER_3_INVERTING false -#endif - -#if HAS_HEATER_4 && !defined(HEATER_4_INVERTING) - #define HEATER_4_INVERTING false -#endif - -#if HAS_HEATER_5 && !defined(HEATER_5_INVERTING) - #define HEATER_5_INVERTING false -#endif - -/** - * Helper Macros for heaters and extruder fan - */ - -#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ HEATER_0_INVERTING) -#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, (v) ^ HEATER_1_INVERTING) - #if HOTENDS > 2 - #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, (v) ^ HEATER_2_INVERTING) - #if HOTENDS > 3 - #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, (v) ^ HEATER_3_INVERTING) - #if HOTENDS > 4 - #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ HEATER_4_INVERTING) - #if HOTENDS > 5 - #define WRITE_HEATER_5(v) WRITE(HEATER_5_PIN, (v) ^ HEATER_5_INVERTING) - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 -#endif // HOTENDS > 1 -#if ENABLED(HEATERS_PARALLEL) - #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } -#else - #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) -#endif - -#ifndef MIN_POWER - #define MIN_POWER 0 -#endif - -/** - * Heated bed requires settings - */ -#if HAS_HEATED_BED - #ifndef MIN_BED_POWER - #define MIN_BED_POWER 0 - #endif - #ifndef MAX_BED_POWER - #define MAX_BED_POWER 255 - #endif - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING false - #endif - #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) -#endif - -/** - * Heated chamber requires settings - */ -#if HAS_HEATED_CHAMBER - #ifndef MAX_CHAMBER_POWER - #define MAX_CHAMBER_POWER 255 - #endif - #ifndef HEATER_CHAMBER_INVERTING - #define HEATER_CHAMBER_INVERTING false - #endif - #define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ HEATER_CHAMBER_INVERTING) -#endif - -/** - * Up to 3 PWM fans - */ -#ifndef FAN_INVERTING - #define FAN_INVERTING false -#endif - -#if HAS_FAN2 - #define FAN_COUNT 3 -#elif HAS_FAN1 - #define FAN_COUNT 2 -#elif HAS_FAN0 - #define FAN_COUNT 1 -#else - #define FAN_COUNT 0 -#endif - -#if FAN_COUNT > 0 - #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING) -#endif - -/** - * Part Cooling fan multipliexer - */ -#define HAS_FANMUX PIN_EXISTS(FANMUX0) - -/** - * MIN/MAX fan PWM scaling - */ -#ifndef FAN_OFF_PWM - #define FAN_OFF_PWM 0 -#endif -#ifndef FAN_MIN_PWM - #if FAN_OFF_PWM > 0 - #define FAN_MIN_PWM (FAN_OFF_PWM + 1) - #else - #define FAN_MIN_PWM 0 - #endif -#endif -#ifndef FAN_MAX_PWM - #define FAN_MAX_PWM 255 -#endif -#if FAN_MIN_PWM < 0 || FAN_MIN_PWM > 255 - #error "FAN_MIN_PWM must be a value from 0 to 255." -#elif FAN_MAX_PWM < 0 || FAN_MAX_PWM > 255 - #error "FAN_MAX_PWM must be a value from 0 to 255." -#elif FAN_MIN_PWM > FAN_MAX_PWM - #error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM." -#elif FAN_OFF_PWM > FAN_MIN_PWM - #error "FAN_OFF_PWM must be less than or equal to FAN_MIN_PWM." -#endif - -/** - * FAST PWM FAN Settings - */ -#if ENABLED(FAST_PWM_FAN) && !defined(FAST_PWM_FAN_FREQUENCY) - #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) // Fan frequency default -#endif - -/** - * MIN/MAX case light PWM scaling - */ -#if HAS_CASE_LIGHT - #ifndef CASE_LIGHT_MAX_PWM - #define CASE_LIGHT_MAX_PWM 255 - #elif !WITHIN(CASE_LIGHT_MAX_PWM, 1, 255) - #error "CASE_LIGHT_MAX_PWM must be a value from 1 to 255." - #endif -#endif - -/** - * Bed Probe dependencies - */ -#if HAS_BED_PROBE - #if ENABLED(ENDSTOPPULLUPS) && HAS_Z_MIN_PROBE_PIN - #define ENDSTOPPULLUP_ZMIN_PROBE - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MIN - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #endif - #ifndef Z_PROBE_OFFSET_RANGE_MAX - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif - #ifndef XY_PROBE_SPEED - #ifdef HOMING_FEEDRATE_XY - #define XY_PROBE_SPEED HOMING_FEEDRATE_XY - #else - #define XY_PROBE_SPEED 4000 - #endif - #endif - #ifndef NOZZLE_TO_PROBE_OFFSET - #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } - #endif -#else - #undef NOZZLE_TO_PROBE_OFFSET -#endif - -/** - * XYZ Bed Skew Correction - */ -#if ENABLED(SKEW_CORRECTION) - #define SKEW_FACTOR_MIN -1 - #define SKEW_FACTOR_MAX 1 - - #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) - #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) - #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) - - #ifndef XY_SKEW_FACTOR - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - #define XY_SKEW_FACTOR _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - #define XY_SKEW_FACTOR 0.0 - #endif - #endif - #ifndef XZ_SKEW_FACTOR - #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) - #define XZ_SIDE_AD XY_SIDE_AD - #endif - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - #define XZ_SKEW_FACTOR _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - #define XZ_SKEW_FACTOR 0.0 - #endif - #endif - #ifndef YZ_SKEW_FACTOR - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - #define YZ_SKEW_FACTOR _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - #define YZ_SKEW_FACTOR 0.0 - #endif - #endif -#endif // SKEW_CORRECTION - -/** - * Set granular options based on the specific type of leveling - */ -#define UBL_SEGMENTED BOTH(AUTO_BED_LEVELING_UBL, DELTA) -#define ABL_PLANAR EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) -#define ABL_GRID EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) -#define HAS_ABL_NOT_UBL (ABL_PLANAR || ABL_GRID) -#define HAS_ABL_OR_UBL (HAS_ABL_NOT_UBL || ENABLED(AUTO_BED_LEVELING_UBL)) -#define HAS_LEVELING (HAS_ABL_OR_UBL || ENABLED(MESH_BED_LEVELING)) -#define HAS_AUTOLEVEL (HAS_ABL_OR_UBL && DISABLED(PROBE_MANUALLY)) -#define HAS_MESH ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) -#define PLANNER_LEVELING (HAS_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)) -#define HAS_PROBING_PROCEDURE (HAS_ABL_OR_UBL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) -#define HAS_POSITION_MODIFIERS (ENABLED(FWRETRACT) || HAS_LEVELING || ENABLED(SKEW_CORRECTION)) -#define NEEDS_THREE_PROBE_POINTS EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #undef LCD_BED_LEVELING -#endif - -/** - * Heater, Fan, and Probe interactions - */ -#if FAN_COUNT == 0 - #undef PROBING_FANS_OFF - #undef ADAPTIVE_FAN_SLOWING - #undef NO_FAN_SLOWING_IN_PID_TUNING -#endif - -#define QUIET_PROBING (HAS_BED_PROBE && (EITHER(PROBING_HEATERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)) -#define HEATER_IDLE_HANDLER EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF) - -#if ENABLED(ADVANCED_PAUSE_FEATURE) && !defined(FILAMENT_CHANGE_SLOW_LOAD_LENGTH) - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 -#endif - -#if EXTRUDERS > 1 && !defined(TOOLCHANGE_FIL_EXTRA_PRIME) - #define TOOLCHANGE_FIL_EXTRA_PRIME 0 -#endif - -/** - * Only constrain Z on DELTA / SCARA machines - */ -#if IS_KINEMATIC - #undef MIN_SOFTWARE_ENDSTOP_X - #undef MIN_SOFTWARE_ENDSTOP_Y - #undef MAX_SOFTWARE_ENDSTOP_X - #undef MAX_SOFTWARE_ENDSTOP_Y -#endif - -/** - * Bed Probing bounds - */ - -#ifndef MIN_PROBE_EDGE - #define MIN_PROBE_EDGE 0 -#endif - -#if IS_KINEMATIC - #undef MIN_PROBE_EDGE_LEFT - #undef MIN_PROBE_EDGE_RIGHT - #undef MIN_PROBE_EDGE_FRONT - #undef MIN_PROBE_EDGE_BACK -#else - #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 -#endif - -#if ENABLED(DELTA) - /** - * Delta radius/rod trimmers/angle trimmers - */ - #ifndef DELTA_ENDSTOP_ADJ - #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } - #endif - #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } - #endif - #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER { 0, 0, 0 } - #endif - #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0, 0, 0 } - #endif -#endif - -#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) - #define LEVELED_SEGMENT_LENGTH 5 -#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 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!") - // so that may be added to SanityCheck.h in the future. - #define _MESH_MIN_X (X_MIN_BED + MESH_INSET) - #define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET) - #define _MESH_MAX_X (X_MAX_BED - (MESH_INSET)) - #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) - #else - // Boundaries for Cartesian probing based on set limits - #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 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)) - #endif - - // These may be overridden in Configuration.h if a smaller area is desired - #ifndef MESH_MIN_X - #define MESH_MIN_X _MESH_MIN_X - #endif - #ifndef MESH_MIN_Y - #define MESH_MIN_Y _MESH_MIN_Y - #endif - #ifndef MESH_MAX_X - #define MESH_MAX_X _MESH_MAX_X - #endif - #ifndef MESH_MAX_Y - #define MESH_MAX_Y _MESH_MAX_Y - #endif -#else - #undef MESH_MIN_X - #undef MESH_MIN_Y - #undef MESH_MAX_X - #undef MESH_MAX_Y -#endif - -#if (defined(PROBE_PT_1_X) && defined(PROBE_PT_2_X) && defined(PROBE_PT_3_X) && defined(PROBE_PT_1_Y) && defined(PROBE_PT_2_Y) && defined(PROBE_PT_3_Y)) - #define HAS_FIXED_3POINT -#endif - - -/** - * Buzzer/Speaker - */ -#if ENABLED(LCD_USE_I2C_BUZZER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 1000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 - #endif -#elif HAS_BUZZER - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 5000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 - #endif -#endif - -/** - * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. - */ -#if HAS_GRAPHICAL_LCD - #ifndef DOGLCD_SCK - #define DOGLCD_SCK SCK_PIN - #endif - #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI MOSI_PIN - #endif -#endif - -/** - * Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES - */ -#ifndef Z_HOMING_HEIGHT - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_HOMING_HEIGHT 0 - #else - #define Z_HOMING_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #endif -#endif - -#if PROBE_SELECTED - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_HOMING_HEIGHT - #endif - #if Z_CLEARANCE_BETWEEN_PROBES > Z_HOMING_HEIGHT - #define MANUAL_PROBE_HEIGHT Z_CLEARANCE_BETWEEN_PROBES - #else - #define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT - #endif - #ifndef Z_CLEARANCE_MULTI_PROBE - #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES - #endif - #if ENABLED(BLTOUCH) && !defined(BLTOUCH_DELAY) - #define BLTOUCH_DELAY 500 - #endif -#endif - -#ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation - #undef UI_VOLTAGE_LEVEL - #undef RADDS_DISPLAY - #undef MOTOR_CURRENT -#endif - -// Updated G92 behavior shifts the workspace -#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS) -// The home offset also shifts the coordinate space -#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && IS_CARTESIAN) -// The SCARA home offset applies only on G28 -#define HAS_SCARA_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && IS_SCARA) -// Cumulative offset to workspace to save some calculation -#define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT && HAS_HOME_OFFSET) -// M206 sets the home offset for Cartesian machines -#define HAS_M206_COMMAND (HAS_HOME_OFFSET && !IS_SCARA) - -// LCD timeout to status screen default is 15s -#ifndef LCD_TIMEOUT_TO_STATUS - #define LCD_TIMEOUT_TO_STATUS 15000 -#endif - -// Add commands that need sub-codes to this list -#define USE_GCODE_SUBCODES ANY(G38_PROBE_TARGET, CNC_COORDINATE_SYSTEMS, POWER_LOSS_RECOVERY) - -// Parking Extruder -#if ENABLED(PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_GRAB_DISTANCE - #define PARKING_EXTRUDER_GRAB_DISTANCE 0 - #endif - #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH - #endif -#endif - -// Number of VFAT entries used. Each entry has 13 UTF-16 characters -#if ENABLED(SCROLL_LONG_FILENAMES) - #define MAX_VFAT_ENTRIES (5) -#else - #define MAX_VFAT_ENTRIES (2) -#endif - -// Set defaults for unspecified LED user colors -#if ENABLED(LED_CONTROL_MENU) - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 255 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 255 - #endif - #ifndef LED_USER_PRESET_WHITE - #define LED_USER_PRESET_WHITE 0 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #ifdef NEOPIXEL_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS - #else - #define LED_USER_PRESET_BRIGHTNESS 255 - #endif - #endif -#endif - -// Nozzle park for Delta -#if BOTH(NOZZLE_PARK_FEATURE, DELTA) - #undef NOZZLE_PARK_Z_FEEDRATE - #define NOZZLE_PARK_Z_FEEDRATE NOZZLE_PARK_XY_FEEDRATE -#endif - -// Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768 -// on boards where SD card and LCD display share the same SPI bus -// because of a bug in the shared SPI implementation. (See #8122) -#if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && (SCK_PIN == LCD_PINS_D4) - #define SDCARD_SORT_ALPHA // Keeps one directory level in RAM. Changing - // directory levels still glitches the screen, - // but the following LCD update cleans it up. - #undef SDSORT_LIMIT - #undef SDSORT_USES_RAM - #undef SDSORT_USES_STACK - #undef SDSORT_CACHE_NAMES - #define SDSORT_LIMIT 64 - #define SDSORT_USES_RAM true - #define SDSORT_USES_STACK false - #define SDSORT_CACHE_NAMES true - #ifndef FOLDER_SORTING - #define FOLDER_SORTING -1 - #endif - #ifndef SDSORT_GCODE - #define SDSORT_GCODE false - #endif - #ifndef SDSORT_DYNAMIC_RAM - #define SDSORT_DYNAMIC_RAM false - #endif - #ifndef SDSORT_CACHE_VFATS - #define SDSORT_CACHE_VFATS 2 - #endif -#endif - -// Defined here to catch the above defines -#if ENABLED(SDCARD_SORT_ALPHA) - #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) -#endif - -// If platform requires early initialization of watchdog to properly boot -#define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)) - -#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - #define Z_STEPPER_COUNT 3 -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define Z_STEPPER_COUNT 2 -#else - #define Z_STEPPER_COUNT 1 -#endif - -#if HAS_SPI_LCD - // Get LCD character width/height, which may be overridden by pins, configs, etc. - #ifndef LCD_WIDTH - #if HAS_GRAPHICAL_LCD - #define LCD_WIDTH 21 - #elif ENABLED(ULTIPANEL) - #define LCD_WIDTH 20 - #else - #define LCD_WIDTH 16 - #endif - #endif - #ifndef LCD_HEIGHT - #if HAS_GRAPHICAL_LCD - #define LCD_HEIGHT 5 - #elif ENABLED(ULTIPANEL) - #define LCD_HEIGHT 4 - #else - #define LCD_HEIGHT 2 - #endif - #endif -#endif - -#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 - #if DISABLED(SHARED_SD_CARD) - #define INIT_SDCARD_ON_BOOT - #endif -#endif - -#if !NUM_SERIAL - #undef BAUD_RATE_GCODE -#endif - -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #undef Z_STEPPER_ALIGN_AMP -#endif -#ifndef Z_STEPPER_ALIGN_AMP - #define Z_STEPPER_ALIGN_AMP 1.0 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfig.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfig.h deleted file mode 100644 index fc26862853..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfig.h +++ /dev/null @@ -1,45 +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 - -// -// Prefix header for all Marlin sources -// - -#include "MarlinConfigPre.h" - -#include "../HAL/HAL.h" - -#include "../pins/pins.h" -#include HAL_PATH(../HAL, spi_pins.h) - -#include "Conditionals_post.h" -#include HAL_PATH(../HAL, inc/Conditionals_post.h) - -#include "SanityCheck.h" -#include HAL_PATH(../HAL, inc/SanityCheck.h) - -// Include all core headers -#include "../core/types.h" -#include "../core/language.h" -#include "../core/utility.h" -#include "../core/serial.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfigPre.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfigPre.h deleted file mode 100644 index e11f171c6e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/MarlinConfigPre.h +++ /dev/null @@ -1,58 +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 - -#ifndef __MARLIN_FIRMWARE__ -#define __MARLIN_FIRMWARE__ -#endif - -// -// Prefix header to acquire configurations -// -#include - -#include "../HAL/platforms.h" - -#include "../core/boards.h" -#include "../core/macros.h" -#include "../../Configuration.h" - -#ifdef CUSTOM_VERSION_FILE - #if defined(__has_include) - #if __has_include(XSTR(../../CUSTOM_VERSION_FILE)) - #include XSTR(../../CUSTOM_VERSION_FILE) - #endif - #else - #include XSTR(../../CUSTOM_VERSION_FILE) - #endif -#endif - -#include "Version.h" - -#include "Conditionals_LCD.h" -#include HAL_PATH(../HAL, inc/Conditionals_LCD.h) - -#include "../core/drivers.h" -#include "../../Configuration_adv.h" - -#include "Conditionals_adv.h" -#include HAL_PATH(../HAL, inc/Conditionals_adv.h) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/SanityCheck.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/SanityCheck.h deleted file mode 100644 index fc75fed545..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/SanityCheck.h +++ /dev/null @@ -1,2568 +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 - -/** - * SanityCheck.h - * - * Test configuration values for errors at compile-time. - */ - -/** - * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features. - */ -#if __cplusplus < 201103L - #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain." -#endif - -/** - * We try our best to include sanity checks for all changed configuration - * directives because users have a tendency to use outdated config files with - * the bleeding-edge source code, but sometimes this is not enough. This check - * forces a minimum config file revision. Otherwise Marlin will not build. - */ -#define HEXIFY(H) _CAT(0x,H) -#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION) - #error "You are using an old Configuration.h file, update it before building Marlin." -#endif - -#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION) - #error "You are using an old Configuration_adv.h file, update it before building Marlin." -#endif -#undef HEXIFY - -/** - * Warnings for old configurations - */ -#ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." -#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) - #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." -#elif WATCH_TEMP_PERIOD > 500 - #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." -#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) - #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." -#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) - #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." -#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE) - #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY." -#elif defined(X_HOME_RETRACT_MM) - #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration." -#elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." -#elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." -#elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." -#elif defined(USE_AUTOMATIC_VERSIONING) - #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." -#elif defined(SDSLOW) - #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." -#elif defined(SDEXTRASLOW) - #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." -#elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." -#elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." -#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) - #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." -#elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." -#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) - #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." -#elif defined(PID_PARAMS_PER_EXTRUDER) - #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." -#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) - #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." -#elif defined(SERVO_ENDSTOP_ANGLES) - #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." -#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) - #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." -#elif defined(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." -#elif defined(DEFAULT_XYJERK) - #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." -#elif defined(XY_TRAVEL_SPEED) - #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." -#elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." -#elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_FEATURE) - #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS) - #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_ADD) - #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_XY_FEEDRATE) - #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_Z_FEEDRATE) - #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS) - #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_Z_ADD) - #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." -#elif defined(PAUSE_PARK_XY_FEEDRATE) - #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(PAUSE_PARK_Z_FEEDRATE) - #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE) - #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) - #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." -#elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) - #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." -#elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) - #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." -#elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." -#elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." -#elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." -#elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." -#elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." -#elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." -#elif defined(ENDSTOPS_ONLY_FOR_HOMING) - #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." -#elif defined(HOMING_FEEDRATE) - #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." -#elif defined(MANUAL_HOME_POSITIONS) - #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." -#elif defined(PID_ADD_EXTRUSION_RATE) - #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." -#elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(MIN_Z_HEIGHT_FOR_HOMING) - #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." -#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." -#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) - #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) - #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." -#elif defined(MANUAL_BED_LEVELING) - #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration." -#elif defined(MESH_HOME_SEARCH_Z) - #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif defined(MANUAL_PROBE_Z_RANGE) - #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." -#elif !defined(MIN_STEPS_PER_SEGMENT) - #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. -#elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." -#elif defined(PREVENT_DANGEROUS_EXTRUDE) - #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." -#elif defined(SCARA) - #error "SCARA is now MORGAN_SCARA. Please update your configuration." -#elif defined(ENABLE_AUTO_BED_LEVELING) - #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(AUTO_BED_LEVELING_FEATURE) - #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." -#elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." -#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) - #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) - #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) - #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." -#elif defined(UBL_G26_MESH_VALIDATION) - #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDIT_ENABLED) - #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(UBL_MESH_EDITING) - #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration." -#elif defined(BLTOUCH_HEATERS_OFF) - #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration." -#elif defined(BLTOUCH_V3) - #error "BLTOUCH_V3 is obsolete. Please update your configuration." -#elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE) - #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete. Please update your configuration." -#elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." -#elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." -#elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE) - #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_BL) - #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions." -#elif defined(LCD_PIN_RESET) - #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." -#elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) - #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." -#elif defined(PID_FAN_SCALING) && FAN_COUNT <= 0 - #error "PID_FAN_SCALING needs at least one fan enabled." -#elif defined(min_software_endstops) || defined(max_software_endstops) - #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." -#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) - #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." -#elif defined(CONTROLLERFAN_PIN) - #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." -#elif defined(MIN_RETRACT) - #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." -#elif defined(ADVANCE) - #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." -#elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." -#elif defined(NEOPIXEL_RGBW_LED) - #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." -#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) - #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead." -#elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS) - #error "Remove DELTA_CALIBRATION_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead." -#elif defined(UBL_MESH_INSET) - #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." -#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 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 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 update your configuration." -#elif defined(RIGHT_PROBE_BED_POSITION) - #error "RIGHT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_RIGHT. Please update your configuration." -#elif defined(FRONT_PROBE_BED_POSITION) - #error "FRONT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_FRONT. Please update your configuration." -#elif defined(BACK_PROBE_BED_POSITION) - #error "BACK_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_BACK. Please 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) - #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." -#elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) - #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." -#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) - #error "K1 is now PID_K1. Please update your configuration." -#elif defined(PROBE_DOUBLE_TOUCH) - #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." -#elif defined(ANET_KEYPAD_LCD) - #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." -#elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." -#elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) - #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." -#elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(STEALTHCHOP) - #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h." -#elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(HAVE_TMC2208) - #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." -#elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \ - || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \ - || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." -#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \ - || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." -#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) || defined(Z3_IS_TMC2208) \ - || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." -#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) || defined(Z3_IS_L6470) \ - || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." -#elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." -#elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." -#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET) - #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h." -#elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." -#elif DISABLED(CLASSIC_JERK) && defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." -#elif defined(JUNCTION_ACCELERATION_FACTOR) - #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." -#elif defined(JUNCTION_ACCELERATION) - #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." -#elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." -#elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." -#elif defined(ENDSTOP_NOISE_FILTER) - #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration." -#elif defined(RETRACT_ZLIFT) - #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h." -#elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT) - #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration." -#elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE) - #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." -#elif defined(SINGLENOZZLE_SWAP_LENGTH) - #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration." -#elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED) - #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration." -#elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED) - #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration." -#elif defined(SINGLENOZZLE_SWAP_PARK) - #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration." -#elif defined(SINGLENOZZLE_TOOLCHANGE_XY) - #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration." -#elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE) - #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration." -#elif defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." -#elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE) - #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." -#elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0 - #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration." -#elif defined(MBL_Z_STEP) - #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration." -#elif defined(CHDK) - #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h." -#elif defined(MAX6675_SS) - #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." -#elif defined(MAX6675_SS2) - #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." -#elif defined(SPINDLE_LASER_ENABLE) - #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h." -#elif defined(SPINDLE_LASER_ENABLE_PIN) - #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins." -#elif defined(SPINDLE_DIR_CHANGE) - #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h." -#elif defined(SPINDLE_STOP_ON_DIR_CHANGE) - #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h." -#elif defined(SPINDLE_LASER_ENABLE_INVERT) - #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_HIGH. Please update your Configuration_adv.h." -#elif defined(CHAMBER_HEATER_PIN) - #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins." -#elif defined(TMC_Z_CALIBRATION) - #error "TMC_Z_CALIBRATION has been deprecated in favor of Z_STEPPER_AUTO_ALIGN. Please update your configuration." -#elif defined(Z_MIN_PROBE_ENDSTOP) - #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h." -#elif defined(DUAL_NOZZLE_DUPLICATION_MODE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration." -#elif defined(MENU_ITEM_CASE_LIGHT) - #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU. Please update your configuration." -#elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT. Please update your Configuration_adv.h." -#elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE) - #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION. Please update your Configuration_adv.h." -#elif defined(USB_SD_DISABLED) - #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE. Please update your Configuration_adv.h." -#elif defined(USB_SD_ONBOARD) - #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead." -#elif POWER_SUPPLY == 1 - #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'false'." -#elif POWER_SUPPLY == 2 - #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'true'." -#elif defined(POWER_SUPPLY) - #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h." -#elif defined(MKS_ROBIN_TFT) - #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." -#elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X) - #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY. Please update your Configuration_adv.h." -#elif defined(JUNCTION_DEVIATION) - #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it from Configuration.h." -#elif defined(BABYSTEP_MULTIPLICATOR) - #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]. Please update Configuration_adv.h." -#elif defined(LULZBOT_TOUCH_UI) - #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE. Please update your configuration." -#elif defined(PS_DEFAULT_OFF) - #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF. Please update your configuration." -#endif - -#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 -#define BOARD_STM32F103R -1006 -#define BOARD_ESP32 -1007 -#define BOARD_BIGTREE_SKR_MINI_E3 -1008 -#if MB(MKS_13) - #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." -#elif MB(TRIGORILLA) - #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration." -#elif MB(RURAMPS4D) - #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(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_STM32F103RE. Please update your configuration." -#elif MB(STM32F103R) - #error "BOARD_STM32F103R has been renamed BOARD_STM32F103RE. Please update your configuration." -#elif MOTHERBOARD == BOARD_ESP32 - #error "BOARD_ESP32 has been renamed BOARD_ESPRESSIF_ESP32. Please update your configuration." -#elif MOTHERBOARD == BOARD_BIGTREE_SKR_MINI_E3 - #error "BOARD_BIGTREE_SKR_MINI_E3 has been renamed BOARD_BTT_SKR_MINI_E3_V1_0. 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 -#undef BOARD_STM32F103R -#undef BOARD_ESP32 -#undef BOARD_BIGTREE_SKR_MINI_E3 - -/** - * Marlin release, version and default string - */ -#ifndef SHORT_BUILD_VERSION - #error "SHORT_BUILD_VERSION must be specified." -#elif !defined(DETAILED_BUILD_VERSION) - #error "BUILD_VERSION must be specified." -#elif !defined(STRING_DISTRIBUTION_DATE) - #error "STRING_DISTRIBUTION_DATE must be specified." -#elif !defined(PROTOCOL_VERSION) - #error "PROTOCOL_VERSION must be specified." -#elif !defined(MACHINE_NAME) - #error "MACHINE_NAME must be specified." -#elif !defined(SOURCE_CODE_URL) - #error "SOURCE_CODE_URL must be specified." -#elif !defined(DEFAULT_MACHINE_UUID) - #error "DEFAULT_MACHINE_UUID must be specified." -#elif !defined(WEBSITE_URL) - #error "WEBSITE_URL must be specified." -#endif - -/** - * Serial - */ -#if !(defined(__AVR__) && defined(USBCON)) - #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 - #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." - #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) - #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." - #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) - #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256." - #endif -#elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX) - #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." -#endif - -#if SERIAL_PORT > 7 - #error "Set SERIAL_PORT to the port on your board. Usually this is 0." -#endif - -#if defined(SERIAL_PORT_2) && NUM_SERIAL < 2 - #error "SERIAL_PORT_2 is not supported for your MOTHERBOARD. Disable it to continue." -#endif - -/** - * Dual / Triple Stepper Drivers - */ -#if BOTH(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." -#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR) - #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." -#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && !(HAS_Y2_ENABLE && HAS_Y2_STEP && HAS_Y2_DIR) - #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - #error "Please select either Z_TRIPLE_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS, not both." - #elif !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR) - #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." - #endif -#elif ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR && HAS_Z3_ENABLE && HAS_Z3_STEP && HAS_Z3_DIR) - #error "Z_TRIPLE_STEPPER_DRIVERS requires Z3 pins (and two extra E plugs)." -#endif - -/** - * Validate that the bed size fits - */ -static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE."); -static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE."); - -/** - * Granular software endstops (Marlin >= 1.1.7) - */ -#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z." - #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y) - #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z) - #if IS_KINEMATIC - #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z." - #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y) - #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options." - #endif -#endif - -#if !defined(TARGET_LPC1768) && ANY( \ - ENDSTOPPULLDOWNS, \ - ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \ - ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \ - ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \ - ) - #error "PULLDOWN pin mode is not available on the selected board." -#endif - -#if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) - #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." -#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) - #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN." -#elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX) - #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX." -#elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX) - #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX." -#elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX) - #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX." -#elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN) - #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN." -#elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN) - #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN." -#elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN) - #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN." -#endif - -/** - * LCD Info Screen Style - */ -#if LCD_INFO_SCREEN_STYLE > 0 - #if HAS_GRAPHICAL_LCD || LCD_WIDTH < 20 || LCD_HEIGHT < 4 - #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD." - #elif LCD_INFO_SCREEN_STYLE > 1 - #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time." - #endif -#endif - -/** - * Progress Bar - */ -#if ENABLED(LCD_PROGRESS_BAR) - #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) - #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." - #elif !HAS_CHARACTER_LCD - #error "LCD_PROGRESS_BAR requires a character LCD." - #elif HAS_GRAPHICAL_LCD - #error "LCD_PROGRESS_BAR does not apply to graphical displays." - #elif ENABLED(FILAMENT_LCD_DISPLAY) - #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." - #elif PROGRESS_MSG_EXPIRE < 0 - #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0." - #endif -#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD && DISABLED(EXTENSIBLE_UI) - #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 - */ -#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && !(HAS_GRAPHICAL_LCD || ENABLED(TOUCH_UI_FTDI_EVE)) - #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." -#elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_GRAPHICAL_LCD - #error "CUSTOM_STATUS_SCREEN_IMAGE requires a Graphical LCD." -#endif - -/** - * LCD Lightweight Screen Style - */ -#if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920) - #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display." -#endif - -/** - * SD File Sorting - */ -#if ENABLED(SDCARD_SORT_ALPHA) - #if SDSORT_LIMIT > 256 - #error "SDSORT_LIMIT must be 256 or smaller." - #elif SDSORT_LIMIT < 10 - #error "SDSORT_LIMIT should be greater than 9 to be useful." - #elif DISABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." - #elif ENABLED(SDSORT_CACHE_NAMES) - #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." - #endif - #endif - - #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #if SDSORT_CACHE_VFATS < 2 - #error "SDSORT_CACHE_VFATS must be 2 or greater!" - #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES - #undef SDSORT_CACHE_VFATS - #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES - #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!" - #endif - #endif -#endif - -#if defined(EVENT_GCODE_SD_STOP) && DISABLED(NOZZLE_PARK_FEATURE) - static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP."); -#endif - -/** - * I2C Position Encoders - */ -#if ENABLED(I2C_POSITION_ENCODERS) - #if !BOTH(BABYSTEPPING, BABYSTEP_XY) - #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." - #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) - #error "I2CPE_ENCODER_CNT must be between 1 and 5." - #endif -#endif - -/** - * Babystepping - */ -#if ENABLED(BABYSTEPPING) - #if ENABLED(SCARA) - #error "BABYSTEPPING is not implemented for SCARA yet." - #elif BOTH(DELTA, BABYSTEP_XY) - #error "BABYSTEPPING only implemented for Z axis on deltabots." - #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING) - #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" - #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE - #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_GRAPHICAL_LCD - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." - #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET - #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS." - #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE) - #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible." - #endif -#endif - -/** - * Filament Runout needs one or more pins and either SD Support or Auto print start detection - */ -#if HAS_FILAMENT_SENSOR - #if !PIN_EXISTS(FIL_RUNOUT) - #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif NUM_RUNOUT_SENSORS > E_STEPPERS - #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." - #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN." - #elif NONE(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." - #elif FILAMENT_RUNOUT_DISTANCE_MM < 0 - #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero." - #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); - #endif -#endif - -/** - * Advanced Pause - */ -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #if !HAS_RESUME_CONTINUE - #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER." - #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) - #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." - #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, NEWPANEL, EMERGENCY_PARSER) - #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." - #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) - #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." - #elif DISABLED(NOZZLE_PARK_FEATURE) - #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH - #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH." - #endif -#endif - -#if ENABLED(NOZZLE_PARK_FEATURE) - constexpr float npp[] = NOZZLE_PARK_POINT; - static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values."); -#endif - -/** - * Individual axis homing is useless for DELTAS - */ -#if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." -#endif - -/** - * Options only for EXTRUDERS > 1 - */ -#if EXTRUDERS > 1 - - #if EXTRUDERS > 6 - #error "Marlin supports a maximum of 6 EXTRUDERS." - #endif - - #if ENABLED(HEATERS_PARALLEL) - #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." - #endif - - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - #ifndef TOOLCHANGE_FIL_SWAP_LENGTH - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_LENGTH. Please update your Configuration." - #elif !defined(TOOLCHANGE_FIL_SWAP_RETRACT_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your Configuration." - #elif !defined(TOOLCHANGE_FIL_SWAP_PRIME_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your Configuration." - #endif - #endif - #if ENABLED(TOOLCHANGE_PARK) - #ifndef TOOLCHANGE_PARK_XY - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration." - #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE) - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration." - #endif - #endif - - #ifndef TOOLCHANGE_ZRAISE - #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration_adv.h." - #endif - -#elif ENABLED(MK2_MULTIPLEXER) - #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS." -#elif ENABLED(SINGLENOZZLE) - #error "SINGLENOZZLE requires 2 or more EXTRUDERS." -#endif - -/** - * Sanity checking for the Průša MK2 Multiplexer - */ -#ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." -#endif - -/** - * A Dual Nozzle carriage with switching servo - */ -#if ENABLED(SWITCHING_NOZZLE) - #if ENABLED(DUAL_X_CARRIAGE) - #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible." - #elif ENABLED(SINGLENOZZLE) - #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible." - #elif EXTRUDERS != 2 - #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS." - #elif NUM_SERVOS < 1 - #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1." - #endif - - #ifndef SWITCHING_NOZZLE_SERVO_NR - #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR." - #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE." - #endif - - #ifdef SWITCHING_NOZZLE_E1_SERVO_NR - #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR - #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR." - #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE." - #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE." - #endif - #endif -#endif - -/** - * Single Stepper Dual Extruder with switching servo - */ -#if ENABLED(SWITCHING_EXTRUDER) - #if NUM_SERVOS < 1 - #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." - #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER." - #endif - #if EXTRUDERS > 3 - #if NUM_SERVOS < 2 - #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2." - #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER." - #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR - #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR." - #endif - #endif -#endif - -/** - * Mixing Extruder requirements - */ -#if ENABLED(MIXING_EXTRUDER) - #if EXTRUDERS > 1 - #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) - #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both." - #elif ENABLED(SINGLENOZZLE) - #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." - #endif -#endif - -/** - * Linear Advance 1.5 - Check K value range - */ -#if ENABLED(LIN_ADVANCE) - static_assert( - WITHIN(LIN_ADVANCE_K, 0, 10), - "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)." - ); -#endif - -/** - * Special tool-changing options - */ -#if 1 < 0 \ - + ENABLED(SINGLENOZZLE) \ - + ENABLED(DUAL_X_CARRIAGE) \ - + ENABLED(PARKING_EXTRUDER) \ - + ENABLED(MAGNETIC_PARKING_EXTRUDER) \ - + ENABLED(SWITCHING_TOOLHEAD) \ - + ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) \ - + ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD." -#endif - -/** - * (Magnetic) Parking Extruder requirements - */ -#if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) - #if ENABLED(EXT_SOLENOID) - #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)" - #elif EXTRUDERS != 2 - #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS." - #elif !defined(PARKING_EXTRUDER_PARKING_X) - #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X." - #elif !defined(TOOLCHANGE_ZRAISE) - #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE." - #elif TOOLCHANGE_ZRAISE < 0 - #error "TOOLCHANGE_ZRAISE must be 0 or higher." - #elif ENABLED(PARKING_EXTRUDER) - #if !PIN_EXISTS(SOL0, SOL1) - #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH) - #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW." - #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000) - #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)." - #endif - #endif -#endif - -/** - * Switching Toolhead requirements - */ -#if ENABLED(SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_SERVO_NR - #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR." - #elif EXTRUDERS < 2 - #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS." - #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1) - #if SWITCHING_TOOLHEAD_SERVO_NR == 0 - #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1." - #elif SWITCHING_TOOLHEAD_SERVO_NR == 1 - #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2." - #elif SWITCHING_TOOLHEAD_SERVO_NR == 2 - #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3." - #elif SWITCHING_TOOLHEAD_SERVO_NR == 3 - #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4." - #endif - #elif !defined(TOOLCHANGE_ZRAISE) - #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE." - #elif TOOLCHANGE_ZRAISE < 0 - #error "TOOLCHANGE_ZRAISE must be 0 or higher." - #endif -#endif - -/** - * (Electro)magnetic Switching Toolhead requirements - */ -#if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_Y_POS - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS" - #elif !defined(SWITCHING_TOOLHEAD_X_POS) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS" - #elif !defined(SWITCHING_TOOLHEAD_Z_HOP) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP." - #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR." - #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #if ENABLED(EXT_SOLENOID) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)" - #elif !PIN_EXISTS(SOL0) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN." - #endif - #endif -#endif - -/** - * Part-Cooling Fan Multiplexer requirements - */ -#if PIN_EXISTS(FANMUX1) - #if !HAS_FANMUX - #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set." - #endif -#elif PIN_EXISTS(FANMUX2) - #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set." -#endif - -/** - * Limited number of servos - */ -#if NUM_SERVOS > NUM_SERVO_PLUGS - #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS." -#endif - -/** - * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder - */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR) - #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE." -#endif - -/** - * Required LCD language - */ -#if HAS_CHARACTER_LCD && !defined(DISPLAY_CHARSET_HD44780) - #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." -#endif - -/** - * Bed Heating Options - PID vs Limit Switching - */ -#if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING) - #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED." -#endif - -/** - * Kinematics - */ - -/** - * Allow only one kinematic type to be defined - */ -#if 1 < 0 \ - + ENABLED(DELTA) \ - + ENABLED(MORGAN_SCARA) \ - + ENABLED(COREXY) \ - + ENABLED(COREXZ) \ - + ENABLED(COREYZ) \ - + ENABLED(COREYX) \ - + ENABLED(COREZX) \ - + ENABLED(COREZY) - #error "Please enable only one of DELTA, MORGAN_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY." -#endif - -/** - * Delta requirements - */ -#if ENABLED(DELTA) - #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG) - #error "You probably want to use Max Endstops for DELTA!" - #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED - #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." - #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU) - #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller." - #elif ABL_GRID - #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers." - #elif GRID_MAX_POINTS_X < 3 - #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher." - #endif - #endif -#endif - -/** - * Junction deviation is incompatible with kinematic systems. - */ -#if DISABLED(CLASSIC_JERK) && IS_KINEMATIC - #error "CLASSIC_JERK is required for DELTA and SCARA." -#endif - -/** - * Probes - */ - -/** - * Allow only one probe option to be defined - */ -#if 1 < 0 \ - + ENABLED(PROBE_MANUALLY) \ - + ENABLED(FIX_MOUNTED_PROBE) \ - + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \ - + ENABLED(BLTOUCH) \ - + ENABLED(TOUCH_MI_PROBE) \ - + ENABLED(SOLENOID_PROBE) \ - + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) \ - + 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 - - /** - * Z_PROBE_SLED is incompatible with DELTA - */ - #if BOTH(Z_PROBE_SLED, DELTA) - #error "You cannot use Z_PROBE_SLED with DELTA." - #endif - - /** - * SOLENOID_PROBE requirements - */ - #if ENABLED(SOLENOID_PROBE) - #if ENABLED(EXT_SOLENOID) - #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." - #elif !HAS_SOLENOID_1 - #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." - #endif - #endif - - /** - * NUM_SERVOS is required for a Z servo probe - */ - #if HAS_Z_SERVO_PROBE - #ifndef NUM_SERVOS - #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)." - #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) - #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) - #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2) - #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3) - #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe." - #elif Z_PROBE_SERVO_NR >= NUM_SERVOS - #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS." - #endif - #endif - - #if ENABLED(BLTOUCH) - #if BLTOUCH_DELAY < 200 - #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported." - #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE) - #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE." - #endif - #endif - - #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X)) - #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X." - #endif - - /** - * Touch-MI probe requirements - */ - #if ENABLED(TOUCH_MI_PROBE) - #if DISABLED(Z_SAFE_HOMING) - #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING." - #elif !defined(TOUCH_MI_RETRACT_Z) - #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z." - #elif defined(Z_AFTER_PROBING) - #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled." - #elif Z_HOMING_HEIGHT < 10 - #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10." - #elif Z_MIN_PROBE_ENDSTOP_INVERTING - #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 - - /** - * Require pin options and pins to be defined - */ - #if ENABLED(SENSORLESS_PROBING) - #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z)) - #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z." - #elif !AXIS_HAS_STALLGUARD(Z) - #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z." - #endif - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if DISABLED(USE_ZMIN_PLUG) - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled." - #elif !HAS_Z_MIN - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined." - #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING - #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING." - #endif - #elif !HAS_Z_MIN_PROBE_PIN - #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled." - #endif - - /** - * Make sure Z raise values are set - */ - #ifndef Z_CLEARANCE_DEPLOY_PROBE - #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration." - #elif !defined(Z_CLEARANCE_BETWEEN_PROBES) - #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration." - #elif Z_CLEARANCE_DEPLOY_PROBE < 0 - #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." - #elif Z_CLEARANCE_BETWEEN_PROBES < 0 - #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." - #endif - - #if MULTIPLE_PROBING || EXTRA_PROBING - #if !MULTIPLE_PROBING - #error "EXTRA_PROBING requires MULTIPLE_PROBING." - #elif MULTIPLE_PROBING < 2 - #error "MULTIPLE_PROBING must be 2 or more." - #elif MULTIPLE_PROBING <= EXTRA_PROBING - #error "EXTRA_PROBING must be less than MULTIPLE_PROBING." - #endif - #endif - - #if Z_PROBE_LOW_POINT > 0 - #error "Z_PROBE_LOW_POINT must be less than or equal to 0." - #endif - -#else - - /** - * Require some kind of probe for bed leveling and probe testing - */ - #if HAS_ABL_NOT_UBL && !PROBE_SELECTED - #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo." - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." - #endif - -#endif - -/** - * Allow only one bed leveling option to be defined - */ -#if 1 < 0 \ - + ENABLED(AUTO_BED_LEVELING_LINEAR) \ - + ENABLED(AUTO_BED_LEVELING_3POINT) \ - + ENABLED(AUTO_BED_LEVELING_BILINEAR) \ - + ENABLED(AUTO_BED_LEVELING_UBL) \ - + ENABLED(MESH_BED_LEVELING) - #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." -#endif - -/** - * Bed Leveling Requirements - */ - -#if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * Unified Bed Leveling - */ - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - #if IS_SCARA - #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." - #elif DISABLED(EEPROM_SETTINGS) - #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." - #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) - #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) - #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." - #endif - -#elif HAS_ABL_NOT_UBL - - /** - * Auto Bed Leveling - */ - - /** - * Delta and SCARA have limited bed leveling options - */ - #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR) - #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option." - #endif - -#elif ENABLED(MESH_BED_LEVELING) - - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - /** - * Mesh Bed Leveling - */ - - #if ENABLED(DELTA) - #error "MESH_BED_LEVELING is not compatible with DELTA printers." - #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9 - #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL." - #endif - -#endif - -#if HAS_MESH - #if HAS_CLASSIC_JERK - static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); - #endif -#elif ENABLED(G26_MESH_VALIDATION) - #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." -#endif - -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !(ENABLED(AUTO_BED_LEVELING_UBL) && HAS_GRAPHICAL_LCD) - #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." -#endif - -#if ENABLED(G29_RETRY_AND_RECOVER) - #if ENABLED(AUTO_BED_LEVELING_UBL) - #error "G29_RETRY_AND_RECOVER is not compatible with UBL." - #elif ENABLED(MESH_BED_LEVELING) - #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING." - #endif -#endif - -/** - * LCD_BED_LEVELING requirements - */ -#if ENABLED(LCD_BED_LEVELING) - #if !HAS_LCD_MENU - #error "LCD_BED_LEVELING requires a programmable LCD controller." - #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL) - #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." - #endif -#endif - -/** - * Homing - */ -#if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0 - #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0." -#endif - -#if ENABLED(CODEPENDENT_XY_HOMING) - #if ENABLED(QUICK_HOME) - #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING." - #elif IS_KINEMATIC - #error "CODEPENDENT_XY_HOMING requires a Cartesian setup." - #endif -#endif - -/** - * Make sure Z_SAFE_HOMING point is reachable - */ -#if ENABLED(Z_SAFE_HOMING) - #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."); - #endif -#endif // Z_SAFE_HOMING - -/** - * Make sure DISABLE_[XYZ] compatible with selected homing options - */ -#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z) - #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING) - #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING." - #endif -#endif - -/** - * Filament Width Sensor - */ -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #if !HAS_FILAMENT_WIDTH_SENSOR - #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." - #elif ENABLED(NO_VOLUMETRICS) - #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled." - #endif -#endif - -/** - * ULTIPANEL encoder - */ -#if ENABLED(ULTIPANEL) && NONE(NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK) - #error "ULTIPANEL requires some kind of encoder." -#endif - -#if ENCODER_PULSES_PER_STEP < 0 - #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." -#endif - -/** - * SAV_3DGLCD display options - */ -#if ENABLED(SAV_3DGLCD) - #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106) - #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106) - #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." - #endif -#endif - -/** - * Allen Key - * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. - */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" -#endif - -/** - * Dual X Carriage requirements - */ -#if ENABLED(DUAL_X_CARRIAGE) - #if EXTRUDERS < 2 - #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." - #elif CORE_IS_XY || CORE_IS_XZ - #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX." - #elif !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR) - #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." - #elif !HAS_X_MAX - #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." - #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) - #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." - #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 - #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." - #endif -#endif - -/** - * Make sure auto fan pins don't conflict with the fan pin - */ -#if HAS_AUTO_FAN - #if HAS_FAN0 - #if E0_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN." - #elif E1_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN." - #elif E2_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN." - #elif E3_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN." - #endif - #endif -#endif - -#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN - #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." -#endif - -#if ENABLED(USE_CONTROLLER_FAN) - #if !HAS_CONTROLLER_FAN - #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h." - #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN - #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN." - #endif -#endif - -/** - * Case Light requirements - */ -#if ENABLED(CASE_LIGHT_ENABLE) - #if !PIN_EXISTS(CASE_LIGHT) - #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN to be defined." - #elif CASE_LIGHT_PIN == FAN_PIN - #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing." - #endif -#endif - -/** - * Required custom thermistor settings - */ -#if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA)) - #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA)) - #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA)) - #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA)) - #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA)) - #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) - #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) - #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) - #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h." -#endif - -/** - * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. - */ -#if !HAS_HEATER_0 - #error "HEATER_0_PIN not defined for this board." -#elif !ANY_PIN(TEMP_0, MAX6675_SS) - #error "TEMP_0_PIN not defined for this board." -#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PIN_EXISTS(E0_STEP, E0_DIR)) - #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 EXTRUDERS && TEMP_SENSOR_0 == 0 - #error "TEMP_SENSOR_0 is required with any extruders." -#endif - -// Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS) - #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1 - #error "HEATER_1_PIN not defined for this board." -#endif - -#if HOTENDS > 1 - #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2) - #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." - #elif TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !ANY_PIN(TEMP_1, MAX6675_SS2) - #error "TEMP_1_PIN not defined for this board." - #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." - #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 == 0 - #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." - #elif !HAS_HEATER_2 - #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) - #error "TEMP_2_PIN not defined for this board." - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." - #elif !HAS_HEATER_3 - #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) - #error "TEMP_3_PIN not defined for this board." - #endif - #if HOTENDS > 4 - #if TEMP_SENSOR_4 == 0 - #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS." - #elif !HAS_HEATER_4 - #error "HEATER_4_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_4) - #error "TEMP_4_PIN not defined for this board." - #endif - #if HOTENDS > 5 - #if TEMP_SENSOR_5 == 0 - #error "TEMP_SENSOR_5 is required with 6 HOTENDS." - #elif !HAS_HEATER_5 - #error "HEATER_5_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_5) - #error "TEMP_5_PIN not defined for this board." - #endif - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS." - #endif - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS." - #endif - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS." - #endif - #elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS." - #endif -#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND." -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." -#endif - -/** - * Temperature status LEDs - */ -#if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE) - #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both." -#endif - -/** - * LED Control Menu - */ -#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS - #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED." -#endif - -/** - * LED Backlight Timeout - */ -#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)) - #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch." -#endif - -/** - * Basic multi hotend duplication mode - */ -#if ENABLED(MULTI_NOZZLE_DUPLICATION) - #if HOTENDS < 2 - #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends." - #elif ENABLED(DUAL_X_CARRIAGE) - #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE." - #elif ENABLED(SINGLENOZZLE) - #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE." - #elif ENABLED(MIXING_EXTRUDER) - #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER." - #endif -#endif - -/** - * Test Extruder Stepper Pins - */ -#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only - #if E_STEPPERS - #if !(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." - #endif - #if E_STEPPERS > 1 - #if !(PIN_EXISTS(E1_STEP, E1_DIR) && HAS_E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." - #endif - #if E_STEPPERS > 2 - #if !(PIN_EXISTS(E2_STEP, E2_DIR) && HAS_E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." - #endif - #if E_STEPPERS > 3 - #if !(PIN_EXISTS(E3_STEP, E3_DIR) && HAS_E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." - #endif - #if E_STEPPERS > 4 - #if !(PIN_EXISTS(E4_STEP, E4_DIR) && HAS_E4_ENABLE) - #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." - #endif - #if E_STEPPERS > 5 - #if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE) - #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board." - #endif - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - #endif // E_STEPPERS -#endif - -/** - * Endstop Tests - */ - -#define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG, USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_))) -#define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z)) - -// At least 3 endstop plugs must be used -#if _AXIS_PLUG_UNUSED_TEST(X) - #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Y) - #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG." -#endif -#if _AXIS_PLUG_UNUSED_TEST(Z) - #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." -#endif - -// Delta and Cartesian use 3 homing endstops -#if !IS_SCARA - #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) - #error "Enable USE_XMIN_PLUG when homing X to MIN." - #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) - #error "Enable USE_XMAX_PLUG when homing X to MAX." - #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG) - #error "Enable USE_YMIN_PLUG when homing Y to MIN." - #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG) - #error "Enable USE_YMAX_PLUG when homing Y to MAX." - #endif -#endif -#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG) - #error "Enable USE_ZMIN_PLUG when homing Z to MIN." -#elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) - #error "Enable USE_ZMAX_PLUG when homing Z to MAX." -#endif - -// Dual endstops requirements -#if ENABLED(X_DUAL_ENDSTOPS) - #if !X2_USE_ENDSTOP - #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS." - #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_." - #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_." - #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_." - #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_." - #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_." - #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_X2_MIN && !HAS_X2_MAX - #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "X_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - #if !Y2_USE_ENDSTOP - #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS." - #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_." - #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_." - #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_." - #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_." - #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_." - #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Y2_MIN && !HAS_Y2_MAX - #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Y_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - #if !Z2_USE_ENDSTOP - #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS." - #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_." - #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_." - #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_." - #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_." - #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_." - #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Z2_MIN && !HAS_Z2_MAX - #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Z_DUAL_ENDSTOPS is not compatible with DELTA." - #endif -#endif -#if ENABLED(Z_TRIPLE_ENDSTOPS) - #if !Z2_USE_ENDSTOP - #error "You must set Z2_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS." - #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_." - #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_." - #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_." - #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_." - #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_." - #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Z2_MIN && !HAS_Z2_MAX - #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA." - #endif - #if !Z3_USE_ENDSTOP - #error "You must set Z3_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS." - #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG) - #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_." - #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG) - #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_." - #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG) - #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_." - #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG) - #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_." - #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG) - #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_." - #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG) - #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_." - #elif !HAS_Z3_MIN && !HAS_Z3_MAX - #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!" - #elif ENABLED(DELTA) - #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA." - #endif -#endif - -#if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7) - #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7." -#endif - -/** - * emergency-command parser - */ -#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON) - #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." -#endif - -/** - * I2C bus - */ -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - #if I2C_SLAVE_ADDRESS < 8 - #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)" - #elif I2C_SLAVE_ADDRESS > 127 - #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)" - #endif -#endif - -/** - * G38 Probe Target - */ -#if ENABLED(G38_PROBE_TARGET) - #if !HAS_BED_PROBE - #error "G38_PROBE_TARGET requires a bed probe." - #elif !IS_CARTESIAN - #error "G38_PROBE_TARGET requires a Cartesian machine." - #endif -#endif - -/** - * RGB_LED Requirements - */ -#define _RGB_TEST (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B)) -#if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS - #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED." -#elif ENABLED(RGB_LED) - #if !_RGB_TEST - #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN." - #elif ENABLED(RGBW_LED) - #error "Please enable only one of RGB_LED and RGBW_LED." - #endif -#elif ENABLED(RGBW_LED) - #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W)) - #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN." - #endif -#elif ENABLED(NEOPIXEL_LED) - #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0) - #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS." - #endif -#endif -#undef _RGB_TEST - -/** - * Auto Fan check for PWM pins - */ -#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 - #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255." - #if HAS_AUTO_FAN_0 - static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_1 - static_assert(PWM_PIN(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_2 - static_assert(PWM_PIN(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF); - #elif HAS_AUTO_FAN_3 - static_assert(PWM_PIN(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF); - #endif -#endif - -/** - * Make sure only one display is enabled - */ -#if 1 < 0 \ - + (ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(IS_RRD_SC)) \ - + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(IS_RRD_FG_SC)) \ - + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \ - + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \ - + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ - + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(IS_RRW_KEYPAD)) \ - + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \ - + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \ - + ENABLED(RADDS_DISPLAY) \ - + ENABLED(ULTIMAKERCONTROLLER) \ - + ENABLED(PANEL_ONE) \ - + ENABLED(G3D_PANEL) \ - + ENABLED(RIGIDBOT_PANEL) \ - + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(RA_CONTROL_PANEL) \ - + ENABLED(LCD_SAINSMART_I2C_1602) \ - + ENABLED(LCD_SAINSMART_I2C_2004) \ - + ENABLED(LCM1602) \ - + ENABLED(LCD_I2C_PANELOLU2) \ - + ENABLED(LCD_I2C_VIKI) \ - + ENABLED(SAV_3DLCD) \ - + ENABLED(FF_INTERFACEBOARD) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(BQ_LCD_SMART_CONTROLLER) \ - + ENABLED(CARTESIO_UI) \ - + ENABLED(LCD_FOR_MELZI) \ - + ENABLED(ULTI_CONTROLLER) \ - + ENABLED(MKS_MINI_12864) \ - + ENABLED(FYSETC_MINI_12864_X_X) \ - + ENABLED(FYSETC_MINI_12864_1_2) \ - + ENABLED(FYSETC_MINI_12864_2_0) \ - + ENABLED(FYSETC_MINI_12864_2_1) \ - + ENABLED(CR10_STOCKDISPLAY) \ - + ENABLED(ANET_FULL_GRAPHICS_LCD) \ - + ENABLED(AZSMZ_12864) \ - + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \ - + ENABLED(SAV_3DGLCD) \ - + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(MKS_12864OLED) \ - + ENABLED(MKS_12864OLED_SSD1306) \ - + ENABLED(U8GLIB_SH1106_EINSTART) \ - + ENABLED(OVERLORD_OLED) \ - + ENABLED(DGUS_LCD) \ - + ENABLED(MALYAN_LCD) \ - + ENABLED(TOUCH_UI_FTDI_EVE) \ - + ENABLED(FSMC_GRAPHICAL_TFT) - #error "Please select no more than one LCD controller option." -#endif - -#undef IS_RRD_SC -#undef IS_RRD_FG_SC -#undef IS_ULTRA_LCD -#undef IS_U8GLIB_SSD1306 -#undef IS_RRW_KEYPAD -#undef IS_EXTUI -#undef IS_ULTIPANEL - -/** - * FYSETC Mini 12864 RGB backlighting required - */ -#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) - #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0." -#elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP) - #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays." -#endif - -/** - * Check existing CS pins against enabled TMC SPI drivers. - */ -#define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI && !PIN_EXISTS(ST##_CS)) -#if INVALID_TMC_SPI(X) - #error "An SPI driven TMC driver on X requires X_CS_PIN." -#elif INVALID_TMC_SPI(X2) - #error "An SPI driven TMC driver on X2 requires X2_CS_PIN." -#elif INVALID_TMC_SPI(Y) - #error "An SPI driven TMC driver on Y requires Y_CS_PIN." -#elif INVALID_TMC_SPI(Y2) - #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN." -#elif INVALID_TMC_SPI(Z) - #error "An SPI driven TMC driver on Z requires Z_CS_PIN." -#elif INVALID_TMC_SPI(Z2) - #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN." -#elif INVALID_TMC_SPI(Z3) - #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN." -#elif INVALID_TMC_SPI(E0) - #error "An SPI driven TMC driver on E0 requires E0_CS_PIN." -#elif INVALID_TMC_SPI(E1) - #error "An SPI driven TMC driver on E1 requires E1_CS_PIN." -#elif INVALID_TMC_SPI(E2) - #error "An SPI driven TMC driver on E2 requires E2_CS_PIN." -#elif INVALID_TMC_SPI(E3) - #error "An SPI driven TMC driver on E3 requires E3_CS_PIN." -#elif INVALID_TMC_SPI(E4) - #error "An SPI driven TMC driver on E4 requires E4_CS_PIN." -#elif INVALID_TMC_SPI(E5) - #error "An SPI driven TMC driver on E5 requires E5_CS_PIN." -#endif -#undef INVALID_TMC_SPI - -/** - * Check existing RX/TX pins against enable TMC UART drivers. - */ -#define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX)))) -#if INVALID_TMC_UART(X) - #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(X2) - #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(Y) - #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(Y2) - #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(Z) - #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(Z2) - #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(Z3) - #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E0) - #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E1) - #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E2) - #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E3) - #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E4) - #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN." -#elif INVALID_TMC_UART(E5) - #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN." -#endif -#undef INVALID_TMC_UART - -/** - * TMC2209 slave address values - */ -#define INVALID_TMC_ADDRESS(ST) static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3") -#if AXIS_DRIVER_TYPE_X(TMC2209) - INVALID_TMC_ADDRESS(X); -#elif AXIS_DRIVER_TYPE_X2(TMC2209) - INVALID_TMC_ADDRESS(X2); -#elif AXIS_DRIVER_TYPE_Y(TMC2209) - INVALID_TMC_ADDRESS(Y); -#elif AXIS_DRIVER_TYPE_Y2(TMC2209) - INVALID_TMC_ADDRESS(Y2); -#elif AXIS_DRIVER_TYPE_Z(TMC2209) - INVALID_TMC_ADDRESS(Z); -#elif AXIS_DRIVER_TYPE_Z2(TMC2209) - INVALID_TMC_ADDRESS(Z2); -#elif AXIS_DRIVER_TYPE_Z3(TMC2209) - INVALID_TMC_ADDRESS(Z3); -#elif AXIS_DRIVER_TYPE_E0(TMC2209) - INVALID_TMC_ADDRESS(E0); -#elif AXIS_DRIVER_TYPE_E1(TMC2209) - INVALID_TMC_ADDRESS(E1); -#elif AXIS_DRIVER_TYPE_E2(TMC2209) - INVALID_TMC_ADDRESS(E2); -#elif AXIS_DRIVER_TYPE_E3(TMC2209) - INVALID_TMC_ADDRESS(E3); -#elif AXIS_DRIVER_TYPE_E4(TMC2209) - INVALID_TMC_ADDRESS(E4); -#elif AXIS_DRIVER_TYPE_E5(TMC2209) - INVALID_TMC_ADDRESS(E5); -#endif -#undef INVALID_TMC_ADDRESS - -/** - * 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(E5_HARDWARE_SERIAL) ) - #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." -#endif - -/** - * 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(E5_HARDWARE_SERIAL) ) - #error "TMC2208 Software Serial is supported only on AVR, LPC1768, STM32F1 and STM32F4 platforms." -#endif - -#if ENABLED(SENSORLESS_HOMING) - // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop - // is necessary in order to reset the stallGuard indication between the initial movement of all three - // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of - // clearing the stallGuard activated status is found. - - // Stall detection DIAG = HIGH : TMC2209 - // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160 - #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209) - #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209) - #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209) - - #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 && 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) - #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes." - #endif - - #undef X_ENDSTOP_INVERTING - #undef Y_ENDSTOP_INVERTING - #undef Z_ENDSTOP_INVERTING -#endif - -// Sensorless probing requirements -#if ENABLED(SENSORLESS_PROBING) - #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS) - #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes." - #elif !Z_SENSORLESS - #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z." - #endif -#endif - -// Sensorless homing is required for both combined steppers in an H-bot -#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS - #error "CoreXY requires both X and Y to use sensorless homing if either does." -#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS - #error "CoreXZ requires both X and Z to use sensorless homing if either does." -#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS - #error "CoreYZ requires both Y and Z to use sensorless homing if either does." -#endif - -// Other TMC feature requirements -#if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED - #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD." -#elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD - #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers." -#elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD - #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers." -#elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP - #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers." -#endif - -#define IN_CHAIN(A) (A##_CHAIN_POS > 0) -// TMC SPI Chaining -#if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) - #if (IN_CHAIN(X) && !PIN_EXISTS(X_CS) ) || (IN_CHAIN(Y) && !PIN_EXISTS(Y_CS) ) \ - || (IN_CHAIN(Z) && !PIN_EXISTS(Z_CS) ) || (IN_CHAIN(X2) && !PIN_EXISTS(X2_CS)) \ - || (IN_CHAIN(Y2) && !PIN_EXISTS(Y2_CS)) || (IN_CHAIN(Z2) && !PIN_EXISTS(Z2_CS)) \ - || (IN_CHAIN(Z3) && !PIN_EXISTS(Z3_CS)) || (IN_CHAIN(E0) && !PIN_EXISTS(E0_CS)) \ - || (IN_CHAIN(E1) && !PIN_EXISTS(E1_CS)) || (IN_CHAIN(E2) && !PIN_EXISTS(E2_CS)) \ - || (IN_CHAIN(E3) && !PIN_EXISTS(E3_CS)) || (IN_CHAIN(E4) && !PIN_EXISTS(E4_CS)) \ - || (IN_CHAIN(E5) && !PIN_EXISTS(E5_CS)) - #error "All chained TMC drivers need a CS pin." - #else - #if IN_CHAIN(X) - #define CS_COMPARE X_CS_PIN - #elif IN_CHAIN(Y) - #define CS_COMPARE Y_CS_PIN - #elif IN_CHAIN(Z) - #define CS_COMPARE Z_CS_PIN - #elif IN_CHAIN(X2) - #define CS_COMPARE X2_CS_PIN - #elif IN_CHAIN(Y2) - #define CS_COMPARE Y2_CS_PIN - #elif IN_CHAIN(Z2) - #define CS_COMPARE Z2_CS_PIN - #elif IN_CHAIN(Z3) - #define CS_COMPARE Z3_CS_PIN - #elif IN_CHAIN(E0) - #define CS_COMPARE E0_CS_PIN - #elif IN_CHAIN(E1) - #define CS_COMPARE E1_CS_PIN - #elif IN_CHAIN(E2) - #define CS_COMPARE E2_CS_PIN - #elif IN_CHAIN(E3) - #define CS_COMPARE E3_CS_PIN - #elif IN_CHAIN(E4) - #define CS_COMPARE E4_CS_PIN - #elif IN_CHAIN(E5) - #define CS_COMPARE E5_CS_PIN - #endif - #if (IN_CHAIN(X) && X_CS_PIN != CS_COMPARE) || (IN_CHAIN(Y) && Y_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(Z) && Z_CS_PIN != CS_COMPARE) || (IN_CHAIN(X2) && X2_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(Y2) && Y2_CS_PIN != CS_COMPARE) || (IN_CHAIN(Z2) && Z2_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(Z3) && Z3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E0) && E0_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(E1) && E1_CS_PIN != CS_COMPARE) || (IN_CHAIN(E2) && E2_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(E3) && E3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E4) && E4_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(E5) && E5_CS_PIN != CS_COMPARE) - #error "All chained TMC drivers must use the same CS pin." - #endif - #endif - #undef CS_COMPARE -#endif -#undef IN_CHAIN - -#if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z)) - #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA." -#endif - -/** - * Digipot requirement - */ -#if ENABLED(DIGIPOT_MCP4018) - #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \ - || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1) - #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined." - #endif -#endif - -/** - * Check per-axis initializers for errors - */ -constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT, - sanity_arr_2[] = DEFAULT_MAX_FEEDRATE, - sanity_arr_3[] = DEFAULT_MAX_ACCELERATION; - -#define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0) - -static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements."); -static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); -static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2) - && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5) - && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8), - "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive."); - -static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements."); -static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); -static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2) - && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5) - && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8), - "DEFAULT_MAX_FEEDRATE values must be positive."); - -static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements."); -static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); -static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) - && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5) - && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8), - "DEFAULT_MAX_ACCELERATION values must be positive."); - -#if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #ifdef MAX_ACCEL_EDIT_VALUES - constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES; - static_assert(COUNT(sanity_arr_4) >= XYZE, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements."); - static_assert(COUNT(sanity_arr_4) <= XYZE, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); - static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2) - && _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5) - && _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8), - "MAX_ACCEL_EDIT_VALUES values must be positive."); - #endif -#endif - -#if ENABLED(LIMITED_MAX_FR_EDITING) - #ifdef MAX_FEEDRATE_EDIT_VALUES - constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES; - static_assert(COUNT(sanity_arr_5) >= XYZE, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements."); - static_assert(COUNT(sanity_arr_5) <= XYZE, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); - static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2) - && _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5) - && _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8), - "MAX_FEEDRATE_EDIT_VALUES values must be positive."); - #endif -#endif - -#if ENABLED(LIMITED_JERK_EDITING) - #ifdef MAX_JERK_EDIT_VALUES - constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES; - static_assert(COUNT(sanity_arr_6) >= XYZE, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements."); - static_assert(COUNT(sanity_arr_6) <= XYZE, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); - static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2) - && _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5) - && _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8), - "MAX_JERK_EDIT_VALUES values must be positive."); - #endif -#endif - -#undef _ARR_TEST - -#if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS) - #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS." -#endif - -#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) - #error "BLOCK_BUFFER_SIZE must be a power of 2." -#endif - -#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL) - #error "LED_CONTROL_MENU requires an LCD controller." -#endif - -#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED) - #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED." -#endif - -#if ENABLED(SKEW_CORRECTION) - #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)) - #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD." - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD)) - #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD." - #endif - #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD)) - #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD." - #endif - #endif -#endif - -#if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS) - #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." -#endif - -#if ENABLED(Z_STEPPER_AUTO_ALIGN) - - #if !Z_MULTI_STEPPER_DRIVERS - #error "Z_STEPPER_AUTO_ALIGN requires Z_DUAL_STEPPER_DRIVERS or Z_TRIPLE_STEPPER_DRIVERS." - #elif !HAS_BED_PROBE - #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe." - #endif - - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - #if DISABLED(Z_TRIPLE_STEPPER_DRIVERS) - #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires Z_TRIPLE_STEPPER_DRIVERS." - #endif - constexpr float sanity_arr_screw_xy[][2] = Z_STEPPER_ALIGN_STEPPER_XY; - static_assert( - COUNT(sanity_arr_screw_xy) == Z_STEPPER_COUNT, - "Z_STEPPER_ALIGN_STEPPER_XY requires three {X,Y} entries (one per Z stepper)." - ); - #endif - -#endif - -#if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) - #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration." -#endif - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PIN_EXISTS(USB_CS, USB_INTR) - #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT." -#endif - -#if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__) - #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board." -#endif - -#if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10) - #error "GCODE_MACROS_SLOTS must be a number from 1 to 10." -#endif - -#if ENABLED(CUSTOM_USER_MENUS) - #ifdef USER_GCODE_1 - constexpr char _chr1 = USER_GCODE_1[strlen(USER_GCODE_1) - 1]; - static_assert(_chr1 != '\n' && _chr1 != '\r', "USER_GCODE_1 cannot have a newline at the end. Please remove it."); - #endif - #ifdef USER_GCODE_2 - constexpr char _chr2 = USER_GCODE_2[strlen(USER_GCODE_2) - 1]; - static_assert(_chr2 != '\n' && _chr2 != '\r', "USER_GCODE_2 cannot have a newline at the end. Please remove it."); - #endif - #ifdef USER_GCODE_3 - constexpr char _chr3 = USER_GCODE_3[strlen(USER_GCODE_3) - 1]; - static_assert(_chr3 != '\n' && _chr3 != '\r', "USER_GCODE_3 cannot have a newline at the end. Please remove it."); - #endif - #ifdef USER_GCODE_4 - constexpr char _chr4 = USER_GCODE_4[strlen(USER_GCODE_4) - 1]; - static_assert(_chr4 != '\n' && _chr4 != '\r', "USER_GCODE_4 cannot have a newline at the end. Please remove it."); - #endif - #ifdef USER_GCODE_5 - constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1]; - static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it."); - #endif -#endif - -#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 - #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS." -#endif - -/** - * Photo G-code requirements - */ -#if ENABLED(PHOTO_GCODE) - #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1 - #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION." - #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION) - #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h." - #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY) - #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h." - #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS) - #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h." - #elif defined(PHOTO_RETRACT_MM) - static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0."); - #endif -#endif - -/** - * Prusa MMU2 requirements - */ -#if ENABLED(PRUSA_MMU2) - #if DISABLED(NOZZLE_PARK_FEATURE) - #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE." - #elif EXTRUDERS != 5 - #error "PRUSA_MMU2 requires EXTRUDERS = 5." - #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2."); - #endif -#endif - -/** - * Advanced PRINTCOUNTER settings - */ -#if ENABLED(PRINTCOUNTER) - #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1) - #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required." - #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2) - #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required." - #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3) - #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required." - #endif -#endif - -/** - * Require soft endstops for certain setups - */ -#if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) - #if ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS." - #elif HAS_HOTEND_OFFSET - #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends." - #endif -#endif - -/** - * Ensure this option is set intentionally - */ -#if ENABLED(PSU_CONTROL) - #ifndef PSU_ACTIVE_HIGH - #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'." - #elif !PIN_EXISTS(PS_ON) - #error "PSU_CONTROL requires PS_ON_PIN." - #endif -#elif ENABLED(AUTO_POWER_CONTROL) - #error "AUTO_POWER_CONTROL requires PSU_CONTROL." -#endif - -#if HAS_CUTTER - #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN) - #if BOTH(SPINDLE_FEATURE, LASER_FEATURE) - #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE." - #elif !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN." - #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR." - #elif ENABLED(SPINDLE_LASER_PWM) - #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0 - #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM." - #elif !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif SPINDLE_LASER_POWERUP_DELAY < 1 - #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0." - #elif SPINDLE_LASER_POWERDOWN_DELAY < 1 - #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0." - #elif !defined(SPINDLE_LASER_PWM_INVERT) - #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif _PIN_CONFLICT(X_MIN) - #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN." - #elif _PIN_CONFLICT(X_MAX) - #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN." - #elif _PIN_CONFLICT(Z_STEP) - #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN." - #elif _PIN_CONFLICT(CASE_LIGHT) - #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN." - #elif _PIN_CONFLICT(E0_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(E1_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(E2_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(E3_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(E4_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(E5_AUTO_FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN." - #elif _PIN_CONFLICT(FAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN." - #elif _PIN_CONFLICT(FAN1) - #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN." - #elif _PIN_CONFLICT(FAN2) - #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN." - #elif _PIN_CONFLICT(CONTROLLERFAN) - #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN." - #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY) - #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY." - #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z) - #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z." - #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E) - #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E." - #endif - #endif - #undef _PIN_CONFLICT -#endif - -#if !HAS_GRAPHICAL_LCD - #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) - #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." - #elif ENABLED(SHOW_REMAINING_TIME) - #error "SHOW_REMAINING_TIME currently requires a Graphical LCD." - #endif -#endif - -#if ENABLED(LIN_ADVANCE) && MINIMUM_STEPPER_PULSE < 1 - #if HAS_TMC_STANDALONE_E_DRIVER - #error "LIN_ADVANCE with TMC standalone driver on extruder requires MIMIMUM_STEPPER_PULSE >= 1" - #elif HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING) - #error "LIN_ADVANCE with TMC driver on extruder requires SQUARE_WAVE_STEPPING or MINIMUM_STEPPER_PULSE >= 1" - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Version.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Version.h deleted file mode 100644 index ad3115ad60..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/inc/Version.h +++ /dev/null @@ -1,122 +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 - -/** - * Release version. Leave the Marlin version or apply a custom scheme. - */ -#ifndef SHORT_BUILD_VERSION - #define SHORT_BUILD_VERSION "2.0.x" -#endif - -/** - * Verbose version identifier containing a unique identifier, such as the - * vendor name, download location, GitHub account, etc. - */ -#ifndef DETAILED_BUILD_VERSION - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (GitHub)" -#endif - -/** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ -#ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2019-12-01" -#endif - -/** - * Minimum Configuration.h and Configuration_adv.h file versions. - * Set based on the release version number. Used to catch an attempt to use - * older configurations. Override these if using a custom versioning scheme - * to alert users to major changes. - */ - -#define MARLIN_HEX_VERSION 020000 -#ifndef REQUIRED_CONFIGURATION_H_VERSION - #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION -#endif -#ifndef REQUIRED_CONFIGURATION_ADV_H_VERSION - #define REQUIRED_CONFIGURATION_ADV_H_VERSION MARLIN_HEX_VERSION -#endif - -/** - * The protocol for communication to the host. Protocol indicates communication - * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. - * (Other behaviors are given by the firmware version and capabilities report.) - */ -#ifndef PROTOCOL_VERSION - #define PROTOCOL_VERSION "1.0" -#endif - -/** - * Define a generic printer name to be output to the LCD after booting Marlin. - */ -#ifndef MACHINE_NAME - #define MACHINE_NAME "3D Printer" -#endif - -/** - * Website where users can find Marlin source code for the binary installed on the - * device. Override this if you provide public source code download. (GPLv3 requires - * providing the source code to your customers.) - */ -#ifndef SOURCE_CODE_URL - #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" -#endif - -/** - * Default generic printer UUID. - */ -#ifndef DEFAULT_MACHINE_UUID - #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" -#endif - - /** - * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. Displayed in the Info Menu. - */ -#ifndef WEBSITE_URL - #define WEBSITE_URL "http://marlinfw.org" -#endif - -/** - * Set the vendor info the serial USB interface, if changable - * Currently only supported by DUE platform - */ -#ifndef USB_DEVICE_VENDOR_ID - #define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */ -#endif -#ifndef USB_DEVICE_PRODUCT_ID - #define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */ -#endif -//! USB Device string definitions (Optional) -#ifndef USB_DEVICE_MANUFACTURE_NAME - #define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL -#endif -#ifdef CUSTOM_MACHINE_NAME - #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME -#else - #define USB_DEVICE_PRODUCT_NAME MACHINE_NAME -#endif -#define USB_DEVICE_SERIAL_NAME "123985739853" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp deleted file mode 100644 index af1fa56460..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ /dev/null @@ -1,1035 +0,0 @@ -/** - * @file lcdprint_hd44780.cpp - * @brief LCD print api for HD44780 - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2016-08-19 - * @copyright GPL/BSD - */ - -/** - * Due to the limitation of the HD44780 hardware, the current available LCD modules can only support - * Western(English), Cyrillic(Russian), Kana(Japanese) charsets. - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_CHARACTER_LCD - -#include "../ultralcd.h" -#include "../../Marlin.h" - -#include "ultralcd_HD44780.h" - -#include - -#ifndef LCD_CLASS - #include - #define LCD_CLASS LiquidCrystal -#endif -extern LCD_CLASS lcd; - -int lcd_glyph_height() { return 1; } - -typedef struct _hd44780_charmap_t { - wchar_t uchar; // the unicode char - uint8_t idx; // the glyph of the char in the ROM - uint8_t idx2; // the char used to be combined with the idx to simulate a single char -} hd44780_charmap_t; - -#ifdef __AVR__ - #define IV(a) U##a -#else - #define IV(a) L##a -#endif - -static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { - // sorted by uchar: - #if DISPLAY_CHARSET_HD44780 == JAPANESE - - {IV('¢'), 0xEC, 0}, // A2 - {IV('°'), 0xDF, 0}, // B0, Marlin special: '°' LCD_STR_DEGREE (0x09) - {IV('ä'), 0xE1, 0}, // E4 - {IV('ö'), 0xEF, 0}, // F6 - {IV('÷'), 0xFD, 0}, // 00F7 - {IV('ü'), 0xF5, 0}, // 00FC - {IV('ˣ'), 0xEB, 0}, // 02E3 - - {IV('·'), 0xA5, 0}, // 0387 - {IV('Ώ'), 0xF4, 0}, // 038F - {IV('Θ'), 0xF2, 0}, // 0398, Theta - {IV('Ξ'), 0xE3, 0}, // 039E, Xi - {IV('Σ'), 0xF6, 0}, // 03A3, Sigma - {IV('Ω'), 0xF4, 0}, // 03A9, Omega - {IV('ά'), 0xE0, 0}, // 03AC - {IV('έ'), 0xE3, 0}, // 03AD - {IV('α'), 0xE0, 0}, // 03B1, alpha - {IV('β'), 0xE2, 0}, // 03B2, beta - {IV('ε'), 0xE3, 0}, // 03B5, epsilon - {IV('θ'), 0xF2, 0}, // 03B8, theta - {IV('μ'), 0xE4, 0}, // 03BC, mu - {IV('ξ'), 0xE3, 0}, // 03BE, xi - {IV('π'), 0xF7, 0}, // 03C0, pi - {IV('ρ'), 0xE6, 0}, // 03C1, rho - {IV('σ'), 0xE5, 0}, // 03C3, sigma - - {IV('←'), 0x7F, 0}, // 2190 - {IV('→'), 0x7E, 0}, // 2192, Marlin special: '⮈⮉⮊⮋➤→' LCD_STR_ARROW_RIGHT (0x03) - {IV('√'), 0xE8, 0}, // 221A - {IV('∞'), 0xF3, 0}, // 221E - {IV('█'), 0xFF, 0}, // 2588 - - //{IV(''), 0xA0, 0}, - {IV('。'), 0xA1, 0}, - {IV('「'), 0xA2, 0}, - {IV('」'), 0xA3, 0}, - {IV('゛'), 0xDE, 0}, // ‶ - {IV('゜'), 0xDF, 0}, // '〫' - {IV('゠'), '=', 0}, - {IV('ァ'), 0xA7, 0}, - {IV('ア'), 0xB1, 0}, - {IV('ィ'), 0xA8, 0}, - {IV('イ'), 0xB2, 0}, - {IV('ゥ'), 0xA9, 0}, - {IV('ウ'), 0xB3, 0}, - {IV('ェ'), 0xAA, 0}, - {IV('エ'), 0xB4, 0}, - {IV('ォ'), 0xAB, 0}, - - {IV('オ'), 0xB5, 0}, - {IV('カ'), 0xB6, 0}, - {IV('ガ'), 0xB6, 0xDE}, - {IV('キ'), 0xB7, 0}, - {IV('ギ'), 0xB7, 0xDE}, // - {IV('ク'), 0xB8, 0}, - {IV('グ'), 0xB8, 0xDE}, - {IV('ケ'), 0xB9, 0}, - {IV('ゲ'), 0xB9, 0xDE}, - {IV('コ'), 0xBA, 0}, - {IV('ゴ'), 0xBA, 0xDE}, - {IV('サ'), 0xBB, 0}, - {IV('ザ'), 0xBB, 0xDE}, - {IV('シ'), 0xBC, 0}, - {IV('ジ'), 0xBC, 0xDE}, - {IV('ス'), 0xBD, 0}, - {IV('ズ'), 0xBD, 0xDE}, - {IV('セ'), 0xBE, 0}, - {IV('ゼ'), 0xBE, 0xDE}, - {IV('ソ'), 0xBF, 0}, - {IV('ゾ'), 0xBF, 0xDE}, - - {IV('タ'), 0xC0, 0}, - {IV('ダ'), 0xC0, 0xDE}, - {IV('チ'), 0xC1, 0}, - {IV('ヂ'), 0xC1, 0xDE}, - {IV('ッ'), 0xAF, 0}, - {IV('ツ'), 0xC2, 0}, - {IV('ヅ'), 0xC2, 0xDE}, - {IV('テ'), 0xC3, 0}, - {IV('デ'), 0xC3, 0xDE}, - {IV('ト'), 0xC4, 0}, - {IV('ド'), 0xC4, 0xDE}, - {IV('ナ'), 0xC5, 0}, - {IV('ニ'), 0xC6, 0}, - {IV('ヌ'), 0xC7, 0}, - {IV('ネ'), 0xC8, 0}, - {IV('ノ'), 0xC9, 0}, - {IV('ハ'), 0xCA, 0}, - {IV('バ'), 0xCA, 0xDE}, - {IV('パ'), 0xCA, 0xDF}, - {IV('ヒ'), 0xCB, 0}, - {IV('ビ'), 0xCB, 0xDE}, - {IV('ピ'), 0xCB, 0xDF}, - {IV('フ'), 0xCC, 0}, - {IV('ブ'), 0xCC, 0xDE}, - {IV('プ'), 0xCC, 0xDF}, - {IV('ヘ'), 0xCD, 0}, - {IV('ベ'), 0xCD, 0xDE}, - {IV('ペ'), 0xCD, 0xDF}, - {IV('ホ'), 0xCE, 0}, - {IV('ボ'), 0xCE, 0xDE}, - {IV('ポ'), 0xCE, 0xDF}, - {IV('マ'), 0xCF, 0}, - - {IV('ミ'), 0xD0, 0}, - {IV('ム'), 0xD1, 0}, - {IV('メ'), 0xD2, 0}, - {IV('モ'), 0xD3, 0}, - {IV('ャ'), 0xAC, 0}, - {IV('ヤ'), 0xD4, 0}, - {IV('ュ'), 0xAD, 0}, - {IV('ユ'), 0xD5, 0}, - {IV('ョ'), 0xAE, 0}, - {IV('ヨ'), 0xD6, 0}, - {IV('ラ'), 0xD7, 0}, - {IV('リ'), 0xD8, 0}, - {IV('ル'), 0xD9, 0}, - {IV('レ'), 0xDA, 0}, - {IV('ロ'), 0xDB, 0}, - {IV('ワ'), 0xDC, 0}, - {IV('ヲ'), 0xA6, 0}, - {IV('ン'), 0xDD, 0}, - {IV('ヴ'), 0xB3, 0xDE}, - {IV('ヷ'), 0xDC, 0xDE}, - {IV('ヺ'), 0xA6, 0xDE}, - {IV('・'), 0xA5, 0}, - {IV('ー'), 0xB0, 0}, - {IV('ヽ'), 0xA4, 0}, - - //{IV('g'), 0xE7, 0}, // error - //{IV(''), 0xE9, 0}, - //{IV('j'), 0xEA, 0}, // error - //{IV(''), 0xED, 0}, - //{IV(''), 0xEE, 0}, - - //{IV('p'), 0xF0, 0}, // error - //{IV('q'), 0xF1, 0}, // error - //{IV(''), 0xF8, 0}, - //{IV('y'), 0xF9, 0}, // error - {IV('万'), 0xFB, 0}, - {IV('円'), 0xFC, 0}, - {IV('千'), 0xFA, 0}, - //{IV(''), 0xFE, 0}, - - //、・ヲァィゥェォャュョッー - {IV('、'), 0xA4, 0}, //ヽ - {IV('・'), 0xA5, 0}, //・ - {IV('ヲ'), 0xA6, 0}, //ヲ - {IV('ァ'), 0xA7, 0}, //ァ - {IV('ィ'), 0xA8, 0}, //ィ - {IV('ゥ'), 0xA9, 0}, //ゥ - {IV('ェ'), 0xAA, 0}, //ェ - {IV('ォ'), 0xAB, 0}, //ォ - {IV('ャ'), 0xAC, 0}, //ャ - {IV('ュ'), 0xAD, 0}, //ュ - {IV('ョ'), 0xAE, 0}, //ョ - {IV('ッ'), 0xAF, 0}, //ッ - {IV('ー'), 0xB0, 0}, //ー - - //アイウエオカキクケコサシスセ - {IV('ア'), 0xB1, 0}, //ア - {IV('イ'), 0xB2, 0}, //イ - {IV('ウ'), 0xB3, 0}, //ウ - {IV('エ'), 0xB4, 0}, //エ - {IV('オ'), 0xB5, 0}, //オ - {IV('カ'), 0xB6, 0}, //カ - {IV('キ'), 0xB7, 0}, //キ - {IV('ク'), 0xB8, 0}, //ク - {IV('ケ'), 0xB9, 0}, //ケ - {IV('コ'), 0xBA, 0}, //コ - {IV('サ'), 0xBB, 0}, //サ - {IV('シ'), 0xBC, 0}, //シ - {IV('ス'), 0xBD, 0}, //ス - {IV('セ'), 0xBE, 0}, //セ - - //ソタチツテトナニヌネノハヒフ - {IV('ソ'), 0xBF, 0}, //ソ - {IV('タ'), 0xC0, 0}, //タ - {IV('チ'), 0xC1, 0}, //チ - {IV('ツ'), 0xC2, 0}, //ツ - {IV('テ'), 0xC3, 0}, //テ - {IV('ト'), 0xC4, 0}, //ト - {IV('ナ'), 0xC5, 0}, //ナ - {IV('ニ'), 0xC6, 0}, //ニ - {IV('ヌ'), 0xC7, 0}, //ヌ - {IV('ネ'), 0xC8, 0}, //ネ - {IV('ノ'), 0xC9, 0}, //ノ - {IV('ハ'), 0xCA, 0}, //ハ - {IV('ヒ'), 0xCB, 0}, //ヒ - {IV('フ'), 0xCC, 0}, //フ - - //ヘホマミムメモヤユヨラリルレロワン゙゚ - {IV('ヘ'), 0xCD, 0}, //ヘ - {IV('ホ'), 0xCE, 0}, //ホ - {IV('マ'), 0xCF, 0}, //マ - {IV('ミ'), 0xD0, 0}, //ミ - {IV('ム'), 0xD1, 0}, //ム - {IV('メ'), 0xD2, 0}, //メ - {IV('モ'), 0xD3, 0}, //モ - {IV('ヤ'), 0xD4, 0}, //ヤ - {IV('ユ'), 0xD5, 0}, //ユ - {IV('ヨ'), 0xD6, 0}, //ヨ - {IV('ラ'), 0xD7, 0}, //ラ - {IV('リ'), 0xD8, 0}, //リ - {IV('ル'), 0xD9, 0}, //ル - {IV('レ'), 0xDA, 0}, //レ - {IV('ロ'), 0xDB, 0}, //ロ - {IV('ワ'), 0xDC, 0}, //ワ - {IV('ン'), 0xDD, 0}, //ン - {IV('゙'), 0xDE, 0}, // ゛ - {IV('゚'), 0xDF, 0}, // ゜ - - {IV('¥'), 0x5C, 0}, - - #elif DISPLAY_CHARSET_HD44780 == WESTERN - // 0x10 -- 0x1F (except 0x1C) - // 0x80 -- 0xFF (except 0xA7,0xB0,0xB1,0xB3,0xB4,0xBF,0xD1,0xF8,0xFA,0xFC-0xFF) - - {IV('¡'), 0xA9, 0}, - {IV('¢'), 0xA4, 0}, - {IV('£'), 0xA5, 0}, - {IV('¥'), 0xA6, 0}, - {IV('§'), 0xD2, 0}, // section sign - {IV('©'), 0xCF, 0}, - - {IV('ª'), 0x9D, 0}, - {IV('«'), 0xBB, 0}, - {IV('®'), 0xCE, 0}, - - {IV('°'), 0xB2, 0}, // Marlin special: '°' LCD_STR_DEGREE (0x09) - //{IV(''), 0xD1, 0}, - {IV('±'), 0x10, 0}, //∓± - //{'='), 0x1C, 0}, // error - {IV('²'), 0x1E, 0}, - {IV('³'), 0x1F, 0}, - {IV('¶'), 0xD3, 0}, // pilcrow sign - {IV('º'), 0x9E, 0}, - {IV('»'), 0xBC, 0}, // 00BB - //{IV(''), 0xB3, 0}, // error - //{IV(''), 0xB4, 0}, // error - {IV('¼'), 0xB6, 0}, // 00BC - {IV('½'), 0xB5, 0}, // 00BD - //{IV('¾'), '3', 0}, // 00BE - {IV('¿'), 0x9F, 0}, // 00BF - - {IV('Â'), 0x8F, 0}, - {IV('Ã'), 0xAA, 0}, - {IV('Ä'), 0x8E, 0}, - {IV('Æ'), 0x92, 0}, - {IV('Ç'), 0x80, 0}, - {IV('É'), 0x90, 0}, - {IV('Ñ'), 0x9C, 0}, - {IV('Õ'), 0xAC, 0}, - {IV('Ö'), 0x99, 0}, - {IV('×'), 0xB7, 0}, - {IV('Ø'), 0xAE, 0}, - {IV('Ü'), 0x9A, 0}, - {IV('à'), 0x85, 0}, - {IV('á'), 0xA0, 0}, - {IV('â'), 0x83, 0}, - {IV('ã'), 0xAB, 0}, - {IV('ä'), 0x84, 0}, - {IV('å'), 0x86, 0}, - {IV('æ'), 0x91, 0}, - {IV('ç'), 0x87, 0}, - {IV('è'), 0x8A, 0}, - {IV('é'), 0x82, 0}, - {IV('ê'), 0x88, 0}, - {IV('ë'), 0x89, 0}, - {IV('ì'), 0x8D, 0}, - {IV('í'), 0xA1, 0}, - {IV('î'), 0x8C, 0}, - {IV('ï'), 0x8B, 0}, - - {IV('ñ'), 0x9B, 0}, - {IV('ò'), 0x95, 0}, - {IV('ó'), 0xA2, 0}, - {IV('ô'), 0x93, 0}, - {IV('õ'), 0xAD, 0}, - {IV('ö'), 0x94, 0}, - {IV('÷'), 0xB8, 0}, - {IV('ø'), 0xAF, 0}, - {IV('ù'), 0x97, 0}, - {IV('ú'), 0xA3, 0}, - {IV('û'), 0x96, 0}, - {IV('ü'), 0x81, 0}, - {IV('ÿ'), 0x98, 0}, - - //{IV(''), 0xB0, 0}, // error - //{IV(''), 0xB1, 0}, // error - {IV('ƒ'), 0xA8, 0}, // 0192 - - {IV('Ύ'), 0xDB, 0}, // 038E - {IV('Ώ'), 0xDE, 0}, // 038F - {IV('ΐ'), 0xE7, 0}, // 0390 - - {IV('Γ'), 0xD4, 0}, // 0393, Gamma - {IV('Δ'), 0xD5, 0}, // 0394, Delta, ◿ - {IV('Θ'), 0xD6, 0}, // 0398, Theta - {IV('Λ'), 0xD7, 0}, // 039B, Lambda - {IV('Ξ'), 0xD8, 0}, // 039E, Xi - {IV('Π'), 0xD9, 0}, // Pi - {IV('Σ'), 0xDA, 0}, // Sigma - {IV('Υ'), 0xDB, 0}, // Upsilon - {IV('Φ'), 0xDC, 0}, // Phi - {IV('Ψ'), 0xDD, 0}, // Psi - {IV('Ω'), 0xDE, 0}, // Omega - - {IV('ά'), 0xDF, 0}, // 03AC - {IV('έ'), 0xE3, 0}, // 03AD - {IV('ή'), 0xE5, 0}, // 03AE - {IV('ί'), 0xE7, 0}, // 03AF - {IV('ΰ'), 0xF1, 0}, // 03B0 - - {IV('α'), 0xDF, 0}, // alpha - {IV('β'), 0xE0, 0}, // beta - {IV('γ'), 0xE1, 0}, // gamma - {IV('δ'), 0xE2, 0}, // delta - {IV('ε'), 0xE3, 0}, // epsilon - {IV('ζ'), 0xE4, 0}, // zeta - {IV('η'), 0xE5, 0}, // eta - {IV('θ'), 0xE6, 0}, // theta - {IV('ι'), 0xE7, 0}, // lota - {IV('κ'), 0xE8, 0}, // kappa - {IV('λ'), 0xE9, 0}, // lambda - {IV('μ'), 0xEA, 0}, // mu - {IV('ν'), 0xEB, 0}, // nu - {IV('ξ'), 0xEC, 0}, // xi - {IV('π'), 0xED, 0}, // pi - {IV('ρ'), 0xEE, 0}, // rho - {IV('σ'), 0xEF, 0}, // sigma - - {IV('τ'), 0xF0, 0}, // tau - {IV('υ'), 0xF1, 0}, // upsilon - {IV('χ'), 0xF2, 0}, // chi - {IV('ψ'), 0xF3, 0}, // psi - {IV('ω'), 0xF4, 0}, // 03C9, omega - {IV('ϊ'), 0xE7, 0}, // 03CA - {IV('ϋ'), 0xF1, 0}, // 03CB - {IV('ύ'), 0xF1, 0}, // 03CD - {IV('ώ'), 0xF4, 0}, // 03CE - - {IV('•'), 0xCD, 0}, // · - {IV('℞'), 0xA7, 0}, // ℞ Pt ASCII 158 - {IV('™'), 0xD0, 0}, - {IV('↤'), 0xF9, 0}, // ⟻ - {IV('↵'), 0xC4, 0}, - {IV('↻'), 0x04, 0}, // Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01) - {IV('⇥'), 0xFB, 0}, - {IV('√'), 0xBE, 0}, // √ - {IV('∞'), 0xC2, 0}, // infinity - {IV('∫'), 0x1B, 0}, - {IV('∼'), 0x1D, 0}, - {IV('≈'), 0x1A, 0}, - {IV('≠'), 0xBD, 0}, - {IV('≡'), 0x11, 0}, - {IV('≤'), 0xB9, 0},// ≤≥ ⩽⩾ - {IV('≥'), 0xBA, 0}, - //{IV(''), 0xBF, 0}, // error - - {IV('⌠'), 0xC0, 0}, - {IV('⌡'), 0xC1, 0}, - - {IV('⎧'), 0x14, 0}, - {IV('⎩'), 0x15, 0}, - {IV('⎫'), 0x16, 0}, - {IV('⎭'), 0x17, 0}, - {IV('⎰'), 0x18, 0}, - {IV('⎱'), 0x19, 0}, - {IV('⎲'), 0x12, 0}, - {IV('⎳'), 0x13, 0}, - - {IV('⏱'), 0x07, 0}, // Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05) - {IV('┌'), 0xC9, 0}, - {IV('┐'), 0xCA, 0}, - {IV('└'), 0xCB, 0}, - {IV('┘'), 0xCC, 0}, - {IV('◸'), 0xC3, 0}, // ◿ - {IV('⭠'), 0xC8, 0}, - {IV('⭡'), 0xC5, 0}, - {IV('⭢'), 0xC7, 0}, - {IV('⭣'), 0xC6, 0}, - - - {IV('⯆'), 0xF5, 0}, - {IV('⯇'), 0xF7, 0}, // ⯅ - {IV('⯈'), 0xF6, 0}, - //{IV(''), 0xF8, 0}, // error - //{IV(''), 0xFA, 0}, // error - //{IV(''), 0xFC, 0}, // error - //{IV(''), 0xFD, 0}, // error - //{IV(''), 0xFE, 0}, // error - //{IV(''), 0xFF, 0}, // error - - #elif DISPLAY_CHARSET_HD44780 == CYRILLIC - - {IV('¢'), 0x5C, 0}, // 00A2 - {IV('£'), 0xCF, 0}, // 00A3 - {IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09) - - //{IV(''), 0x80, 0}, - //{IV(''), 0x81, 0}, - //{IV(''), 0x82, 0}, - //{IV(''), 0x83, 0}, - //{IV(''), 0x84, 0}, - //{IV(''), 0x85, 0}, - //{IV(''), 0x86, 0}, - //{IV(''), 0x87, 0}, - //{IV(''), 0x88, 0}, - //{IV(''), 0x89, 0}, - //{IV(''), 0x8A, 0}, - //{IV(''), 0x8B, 0}, - //{IV(''), 0x8C, 0}, - //{IV(''), 0x8D, 0}, - //{IV(''), 0x8E, 0}, - //{IV(''), 0x8F, 0}, - - //{IV(''), 0x90, 0}, - //{IV(''), 0x91, 0}, - //{IV(''), 0x92, 0}, - //{IV(''), 0x93, 0}, - //{IV(''), 0x94, 0}, - //{IV(''), 0x95, 0}, - //{IV(''), 0x96, 0}, - //{IV(''), 0x97, 0}, - //{IV(''), 0x98, 0}, - //{IV(''), 0x99, 0}, - //{IV(''), 0x9A, 0}, - //{IV(''), 0x9B, 0}, - //{IV(''), 0x9C, 0}, - //{IV(''), 0x9D, 0}, - //{IV(''), 0x9E, 0}, - //{IV(''), 0x9F, 0}, - - - {IV('¼'), 0xF0, 0}, // 00BC - {IV('⅓'), 0xF1, 0}, - {IV('½'), 0xF2, 0}, // 00BD - {IV('¾'), 0xF3, 0}, // 00BE - {IV('¿'), 0xCD, 0}, // 00BF - - {IV('Ё'), 0xA2, 0}, // 0401 - {IV('А'), 'A', 0}, // 0410 - {IV('Б'), 0xA0, 0}, - {IV('В'), 'B', 0}, - {IV('Г'), 0xA1, 0}, - {IV('Д'), 0xE0, 0}, - {IV('Е'), 'E', 0}, - {IV('Ж'), 0xA3, 0}, - {IV('З'), 0xA4, 0}, - {IV('И'), 0xA5, 0}, - {IV('Й'), 0xA6, 0}, - {IV('К'), 'K', 0}, - {IV('Л'), 0xA7, 0}, - {IV('М'), 'M', 0}, - {IV('Н'), 'H', 0}, - {IV('О'), 'O', 0}, - {IV('П'), 0xA8, 0}, - {IV('Р'), 'P', 0}, - {IV('С'), 'C', 0}, - {IV('Т'), 'T', 0}, - {IV('У'), 0xA9, 0}, - {IV('Ф'), 0xAA, 0}, - {IV('Х'), 'X', 0}, - {IV('Ц'), 0xE1, 0}, - {IV('Ч'), 0xAB, 0}, - {IV('Ш'), 0xAC, 0}, - {IV('Щ'), 0xE2, 0}, - {IV('Ъ'), 0xAD, 0}, - {IV('Ы'), 0xAE, 0}, - {IV('Ь'), 'b', 0}, - {IV('Э'), 0xAF, 0}, - {IV('Ю'), 0xB0, 0}, - {IV('Я'), 0xB1, 0}, - {IV('а'), 'a', 0}, - - {IV('б'), 0xB2, 0}, - {IV('в'), 0xB3, 0}, - {IV('г'), 0xB4, 0}, - {IV('д'), 0xE3, 0}, - {IV('е'), 'e', 0}, - {IV('ж'), 0xB6, 0}, - {IV('з'), 0xB7, 0}, - {IV('и'), 0xB8, 0}, - {IV('й'), 0xB9, 0}, - {IV('к'), 0xBA, 0}, //клмноп - {IV('л'), 0xBB, 0}, - {IV('м'), 0xBC, 0}, - {IV('н'), 0xBD, 0}, - {IV('о'), 'o', 0}, - {IV('п'), 0xBE, 0}, - {IV('р'), 'p', 0}, - {IV('с'), 'c', 0}, - {IV('т'), 0xBF, 0}, - - {IV('у'), 'y', 0}, - {IV('ф'), 0xE4, 0}, - {IV('х'), 'x', 0}, - {IV('ц'), 0xE5, 0}, - {IV('ч'), 0xC0, 0}, - {IV('ш'), 0xC1, 0}, - {IV('щ'), 0xE6, 0}, - {IV('ъ'), 0xC2, 0}, - {IV('ы'), 0xC3, 0}, - {IV('ь'), 0xC4, 0}, - {IV('э'), 0xC5, 0}, - {IV('ю'), 0xC6, 0}, - {IV('я'), 0xC7, 0}, // 044F - {IV('ё'), 0xB5, 0}, // 0451 - //{IV(''), 0xC8, 0}, - //{IV(''), 0xC9, 0}, - //{IV(''), 0xCA, 0}, - //{IV(''), 0xCB, 0}, - //{IV(''), 0xCC, 0}, - //{IV(''), 0xCD, 0}, - //{IV(''), 0xCE, 0}, - - //{IV(''), 0xD0, 0}, - //{IV(''), 0xD1, 0}, - //{IV(''), 0xD2, 0}, - //{IV(''), 0xD3, 0}, - //{IV(''), 0xD4, 0}, - //{IV(''), 0xD5, 0}, - //{IV(''), 0xD6, 0}, - //{IV(''), 0xD7, 0}, - //{IV(''), 0xD8, 0}, - //{IV(''), 0xDB, 0}, - //{IV(''), 0xDC, 0}, - //{IV(''), 0xDD, 0}, - //{IV(''), 0xDE, 0}, - //{IV(''), 0xDF, 0}, - - //{IV(''), 0xE7, 0}, - //{IV(''), 0xE8, 0}, - //{IV(''), 0xE9, 0}, - //{IV(''), 0xEA, 0}, - //{IV(''), 0xEB, 0}, - //{IV(''), 0xEC, 0}, - //{IV(''), 0xED, 0}, - //{IV(''), 0xEE, 0}, - //{IV(''), 0xEF, 0}, - - //{IV(''), 0xF4, 0}, - //{IV(''), 0xF5, 0}, - //{IV(''), 0xF6, 0}, - //{IV(''), 0xF7, 0}, - //{IV(''), 0xF8, 0}, - //{IV(''), 0xF9, 0}, - //{IV(''), 0xFA, 0}, - //{IV(''), 0xFB, 0}, - //{IV(''), 0xFC, 0}, - //{IV(''), 0xFD, 0}, - //{IV(''), 0xFE, 0}, - //{IV(''), 0xFF, 0}, - - {IV('↑'), 0xD9, 0}, // 2191 ←↑→↓ - {IV('↓'), 0xDA, 0}, // 2193 - #endif -}; - -// the plain ASCII replacement for various char -static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { - {IV('¡'), 'i', 0}, // A1 - {IV('¢'), 'c', 0}, // A2 - {IV('°'), 0x09, 0}, // B0 Marlin special: '°' LCD_STR_DEGREE (0x09) - - // map WESTERN code to the plain ASCII - {IV('Á'), 'A', 0}, // C1 - {IV('Â'), 'A', 0}, // C2 - {IV('Ã'), 'A', 0}, // C3 - {IV('Ä'), 'A', 0}, // C4 - {IV('Å'), 'A', 0}, // C5 - {IV('Æ'), 'A', 'E'}, // C6 - {IV('Ç'), 'C', 0}, // C7 - {IV('È'), 'E', 0}, // C8 - {IV('É'), 'E', 0}, // C9 - {IV('Í'), 'I', 0}, // CD - {IV('Ñ'), 'N', 0}, // D1 - {IV('Õ'), 'O', 0}, // D5 - {IV('Ö'), 'O', 0}, // D6 - {IV('×'), 'x', 0}, // D7 - {IV('Ü'), 'U', 0}, // DC - {IV('Ý'), 'Y', 0}, // DD - {IV('à'), 'a', 0}, // E0 - {IV('á'), 'a', 0}, - {IV('â'), 'a', 0}, - {IV('ã'), 'a', 0}, - {IV('ä'), 'a', 0}, - {IV('å'), 'a', 0}, - {IV('æ'), 'a', 'e'}, - {IV('ç'), 'c', 0}, - {IV('è'), 'e', 0}, // 00E8 - {IV('é'), 'e', 0}, - {IV('ê'), 'e', 0}, - {IV('ë'), 'e', 0}, - {IV('ì'), 'i', 0}, // 00EC - {IV('í'), 'i', 0}, - {IV('î'), 'i', 0}, - {IV('ï'), 'i', 0}, // 00EF - - {IV('ñ'), 'n', 0}, // 00F1 - {IV('ò'), 'o', 0}, - {IV('ó'), 'o', 0}, - {IV('ô'), 'o', 0}, - {IV('õ'), 'o', 0}, - {IV('ö'), 'o', 0}, - //{IV('÷'), 0xB8, 0}, - {IV('ø'), 'o', 0}, - {IV('ù'), 'u', 0}, - {IV('ú'), 'u', 0}, - {IV('û'), 'u', 0}, - {IV('ü'), 'u', 0}, // FC - {IV('ý'), 'y', 0}, // FD - {IV('ÿ'), 'y', 0}, // FF - - {IV('Ą'), 'A', 0}, // 0104 - {IV('ą'), 'a', 0}, // 0105 - {IV('Ć'), 'C', 0}, // 0106 - {IV('ć'), 'c', 0}, // 0107 - {IV('Č'), 'C', 0}, // 010C - {IV('č'), 'c', 0}, // 010D - {IV('Ď'), 'D', 0}, // 010E - {IV('ď'), 'd', 0}, // 010F - {IV('đ'), 'd', 0}, // 0111 - {IV('ę'), 'e', 0}, // 0119 - {IV('ğ'), 'g', 0}, // 011F - {IV('İ'), 'I', 0}, // 0130 - {IV('ı'), 'i', 0}, // 0131 - - {IV('Ł'), 'L', 0}, // 0141 - {IV('ł'), 'l', 0}, // 0142 - {IV('Ń'), 'N', 0}, // 0143 - {IV('ń'), 'n', 0}, // 0144 - {IV('ň'), 'n', 0}, // 0148 - - {IV('ř'), 'r', 0}, // 0159 - {IV('Ś'), 'S', 0}, // 015A - {IV('ś'), 's', 0}, // 015B - {IV('ş'), 's', 0}, // 015F - {IV('Š'), 'S', 0}, // 0160 - {IV('š'), 's', 0}, // 0161 - {IV('ť'), 't', 0}, // 0165 - {IV('ů'), 'u', 0}, // 016F - {IV('ż'), 'z', 0}, // 017C - {IV('Ž'), 'Z', 0}, // 017D - {IV('ž'), 'z', 0}, // 017E - {IV('ƒ'), 'f', 0}, // 0192 - - {IV('ˣ'), 'x', 0}, // 02E3 - - {IV('΄'), '\'', 0}, // 0384 - {IV('΅'), '\'', 0}, // 0385 - {IV('Ά'), 'A', 0}, // 0386 - {IV('·'), '.', 0}, // 0387 - {IV('Έ'), 'E', 0}, // 0388 - {IV('Ή'), 'H', 0}, // 0389 - {IV('Ί'), 'I', 0}, // 038A - {IV('Ό'), 'O', 0}, // 038C - {IV('Ύ'), 'Y', 0}, // 038E - {IV('Ώ'), 'O', 0}, // 038F - {IV('ΐ'), 'i', 0}, // 0390 - {IV('Α'), 'A', 0}, // 0391 - {IV('Β'), 'B', 0}, // 0392 - {IV('Γ'), 'T', 0}, // 0393, Gamma - {IV('Δ'), '4', 0}, // 0394, Delta, ◿ - {IV('Ε'), 'E', 0}, // 0395 - {IV('Ζ'), 'Z', 0}, // 0396 - {IV('Η'), 'H', 0}, // 0397 - {IV('Θ'), '0', 0}, // 0398, Theta - {IV('Ι'), 'I', 0}, // 0399 - {IV('Κ'), 'K', 0}, // 039A - {IV('Λ'), '^', 0}, // 039B, Lambda - {IV('Μ'), 'M', 0}, // 039C - {IV('Ν'), 'N', 0}, // 039D - {IV('Ξ'), '3', 0}, // 039E, Xi - {IV('Ο'), 'O', 0}, // 039F - {IV('Π'), 'n', 0}, // 03A0, Pi - {IV('Ρ'), 'P', 0}, // 03A1 - {IV('Σ'), 'E', 0}, // 03A3, Sigma - {IV('Τ'), 'T', 0}, // 03A4 - {IV('Υ'), 'Y', 0}, // 03A5, Upsilon - {IV('Φ'), 'p', 0}, // 03A6, Phi - {IV('Χ'), 'X', 0}, // 03A7 - {IV('Ψ'), 'P', 0}, // 03A8, Psi - {IV('Ω'), 'O', 0}, // 03A9, Omega - {IV('Ϊ'), 'I', 0}, // 03AA - {IV('Ϋ'), 'Y', 0}, // 03AB - {IV('ά'), 'a', 0}, // 03AC - {IV('έ'), 'e', 0}, // 03AD - {IV('ή'), 'n', 0}, // 03AE - {IV('ί'), 'i', 0}, // 03AF - {IV('ΰ'), 'v', 0}, // 03B0 - {IV('α'), 'a', 0}, // 03B1, alpha - {IV('β'), 'B', 0}, // 03B2, beta - {IV('γ'), 'v', 0}, // 03B3, gamma - {IV('δ'), 'd', 0}, // 03B4, delta - {IV('ε'), 'e', 0}, // 03B5, epsilon - {IV('ζ'), 'Z', 0}, // 03B6, zeta - {IV('η'), 'n', 0}, // 03B7, eta - {IV('θ'), '0', 0}, // 03B8, theta - {IV('ι'), 'i', 0}, // 03B9, lota - {IV('κ'), 'k', 0}, // 03BA, kappa - {IV('λ'), 'L', 0}, // 03BB, lambda - {IV('μ'), 'u', 0}, // 03BC, mu - {IV('ν'), 'v', 0}, // 03BD, nu - {IV('ξ'), 'e', 0}, // 03BE, xi - {IV('ο'), 'o', 0}, // 03BF - {IV('π'), 'n', 0}, // 03C0, pi - {IV('ρ'), 'p', 0}, // 03C1, rho - {IV('ς'), 'c', 0}, // 03C2 - {IV('σ'), 'o', 0}, // 03C3, sigma - {IV('τ'), 't', 0}, // 03C4, tau - {IV('υ'), 'v', 0}, // 03C5, upsilon - {IV('φ'), 'p', 0}, // 03C6 - {IV('χ'), 'X', 0}, // 03C7, chi - {IV('ψ'), 'W', 0}, // 03C8, psi - {IV('ω'), 'w', 0}, // 03C9, omega - {IV('ϊ'), 'i', 0}, // 03CA - {IV('ϋ'), 'v', 0}, // 03CB - {IV('ό'), 'o', 0}, // 03CC - {IV('ύ'), 'v', 0}, // 03CD - {IV('ώ'), 'w', 0}, // 03CE - - // map CYRILLIC code to the plain ASCII - {IV('Ё'), 'E', 0}, // 0401 - {IV('А'), 'A', 0}, // 0410 - {IV('Б'), 'b', 0}, // 0411 - {IV('В'), 'B', 0}, // 0412 - {IV('Г'), 'T', 0}, // 0413 - {IV('Д'), 'Q', 0}, // 0414 - {IV('Е'), 'E', 0}, // 0415 - {IV('Ж'), '*', 0}, // 0416 - {IV('З'), 'E', 0}, // 0417 - {IV('И'), 'N', 0}, // 0418 - {IV('Й'), 'N', 0}, // 0419 - {IV('К'), 'K', 0}, // 041A - {IV('Л'), 'T', 0}, // 041B - {IV('М'), 'M', 0}, // 041C - {IV('Н'), 'H', 0}, // 041D - {IV('О'), 'O', 0}, // 041E - {IV('П'), 'n', 0}, // 041F - {IV('Р'), 'P', 0}, // 0420 - {IV('С'), 'C', 0}, // 0421 - {IV('Т'), 'T', 0}, // 0422 - {IV('У'), 'Y', 0}, - {IV('Ф'), 'o', 0}, - {IV('Х'), 'X', 0}, - {IV('Ц'), 'U', 0}, - {IV('Ч'), 'y', 0}, - {IV('Ш'), 'W', 0}, - {IV('Щ'), 'W', 0}, - {IV('Ъ'), 'b', 0}, - {IV('Ы'), 'b', '|'}, - {IV('Ь'), 'b'}, - {IV('Э'), 'e'}, - {IV('Ю'), '|', 'O'}, - {IV('Я'), '9', '|'}, // 042F - - {IV('а'), 'a', 0}, // 0430 - {IV('б'), '6', 0}, // 0431 - {IV('в'), 'B', 0}, // 0432, - {IV('г'), 'r', 0}, // 0433 - {IV('д'), 'a', 0}, // 0434, - {IV('е'), 'e', 0}, // 0435 - {IV('ж'), '*', 0}, // 0436 - {IV('з'), 'e', 0}, // 0437, - {IV('и'), 'u', 0}, // 0438 - {IV('й'), 'u', 0}, // 0439, - {IV('к'), 'k', 0}, // 043A - {IV('л'), 'n', 0}, - {IV('м'), 'm', 0}, - {IV('н'), 'H', 0}, - {IV('о'), 'o', 0}, - {IV('п'), 'n', 0}, - {IV('р'), 'p', 0}, - {IV('с'), 'c', 0}, - {IV('т'), 't', 0}, - {IV('у'), 'y', 0}, - {IV('ф'), 'q', 'p'}, - {IV('х'), 'x', 0}, - {IV('ц'), 'u', 0}, - {IV('ч'), 'y', 0}, - {IV('ш'), 'w', 0}, - {IV('щ'), 'w', 0}, - {IV('ъ'), 'b', 0}, - {IV('ы'), 'b', '|'}, - {IV('ь'), 'b', 0}, - {IV('э'), 'e', 0}, - {IV('ю'), '|', 'o'}, - {IV('я'), 'g', 0}, // 044F - {IV('ё'), 'e', 0}, // 0451 - - {IV('•'), '.', 0}, // 2022 · - {IV('℞'), 'P', 'x'}, // 211E ℞ Pt ASCII 158 - {IV('™'), 'T', 'M'}, // 2122 - {IV('←'), '<', '-'}, // 2190 - {IV('→'), '-', '>'}, // 2192, Marlin special: '⮈⮉⮊⮋➤→⏵➟➠➡' LCD_STR_ARROW_RIGHT (0x03) - //{IV('↰'), '<', 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04) - {IV('↰'), 0x03, 0}, // 21B0, Marlin special: '⮥⮭⮉⇧↑↰⤴' LCD_STR_UPLEVEL (0x04) - {IV('↻'), 0x04, 0}, // 21BB Marlin special: '↻↺⟳⟲' LCD_STR_REFRESH (0x01) - {IV('∼'), '~', 0}, // 223C - {IV('≈'), '~', '='}, // 2248 - {IV('≠'), '!', '='}, // 2260 - {IV('≡'), '=', 0}, // 2261 - {IV('≤'), '<', '='},// 2264, ≤≥ ⩽⩾ - {IV('≥'), '>', '='}, // 2265 - {IV('⏱'), 0x07, 0}, // 23F1, Marlin special: '🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧 ⌚⌛⏰⏱⏳⧖⧗' LCD_STR_CLOCK (0x05) - - {IV('゠'), '=', 0}, // 30A0 - - // ⏰⏱⏲⏳◴◵◶◷ - // ⏻⏼♁♂ - //{IV(''), 0x00, 0}, // Marlin special: '' LCD_STR_BEDTEMP (0x07) - {IV('🌡'), 0x02, 0}, // D83CDF21 Marlin special: '🌡' LCD_STR_THERMOMETER (0x08) - {IV('📂'), 0x05, 0}, // D83DDCC2 Marlin special: '📁📂' LCD_STR_FOLDER (0x02) - //{IV(''), 0x06, 0}, // Marlin special: '' LCD_STR_FEEDRATE (0x06) -}; - -/* return v1 - v2 */ -static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) { - return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0; -} - -static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) { - hd44780_charmap_t localval; - hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata; - memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval)); - return hd44780_charmap_compare(&localval, (hd44780_charmap_t *)data_pin); -} - -void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd.setCursor(col, row); } - -void lcd_put_int(const int i) { lcd.print(i); } - -// return < 0 on error -// return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { - - // find the HD44780 internal ROM first - int ret; - size_t idx = 0; - hd44780_charmap_t pinval; - hd44780_charmap_t *copy_address = nullptr; - pinval.uchar = c; - pinval.idx = -1; - - if (max_length < 1) return 0; - - // TODO: fix the '\\' that doesnt exist in the HD44870 - if (c < 128) { - lcd.write((uint8_t)c); - return 1; - } - copy_address = nullptr; - ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); - if (ret >= 0) { - copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx); - } - else { - ret = pf_bsearch_r((void *)g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); - if (ret >= 0) copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_common + idx); - } - - if (ret >= 0) { - hd44780_charmap_t localval; - // found - memcpy_P(&localval, copy_address, sizeof(localval)); - lcd.write(localval.idx); - if (max_length >= 2 && localval.idx2 > 0) { - lcd.write(localval.idx2); - return 2; - } - return 1; - } - - // Not found, print '?' instead - lcd.write((uint8_t)'?'); - return 1; -} - -/** - * @brief Draw a UTF-8 string - * - * @param utf8_str : the UTF-8 string - * @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM) - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) - * - * @return the number of pixels advanced - * - * Draw a UTF-8 string - */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { - pixel_len_t ret = 0; - uint8_t *p = (uint8_t *)utf8_str; - while (ret < max_length) { - wchar_t ch = 0; - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - ret += lcd_put_wchar_max(ch, max_length - ret); - } - return (int)ret; -} - -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { - return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); -} - -int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { - return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length); -} - -#if ENABLED(DEBUG_LCDPRINT) - - int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) { - int ret; - size_t idx = 0; - hd44780_charmap_t preval = {0, 0, 0}; - hd44780_charmap_t pinval = {0, 0, 0}; - char flg_error = 0; - - int i; - - TRACE("Test %s\n", name); - - for (i = 0; i < size; i ++) { - memcpy_P(&pinval, &(data[i]), sizeof(pinval)); - - if (flg_show_contents) { - #if 1 - TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR")); - #else - TRACE("[% 4d]", i); - TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar); - TRACE("0x%02X,", (unsigned int)(pinval.idx)); - TRACE("0x%02X,", (unsigned int)(pinval.idx2)); - TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR")); - #endif - } - if (preval.uchar >= pinval.uchar) { - flg_error = 1; - //TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - //return -1; - } - memcpy(&preval, &pinval, sizeof(pinval)); - - ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); - if (ret < 0) { - flg_error = 1; - TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - //return -1; - } - if (idx != i) { - flg_error = 1; - TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - //return -1; - } - } - if (flg_error) { - TRACE("\nError: in array %s\n\n", name); - return -1; - } - TRACE("\nPASS array %s\n\n", name); - return 0; - } - - 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; - test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 1); - } - if (test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 0) < 0) { - flg_error = 1; - test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 1); - } - if (flg_error) { - TRACE("\nFAILED in hd44780 tests!\n"); - return -1; - } - TRACE("\nPASS in hd44780 tests.\n"); - return 0; - } - -#endif // DEBUG_LCDPRINT - -#endif // HAS_CHARACTER_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp deleted file mode 100644 index d6ce8bfdd6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ /dev/null @@ -1,1529 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_CHARACTER_LCD - -/** - * ultralcd_HD44780.cpp - * - * LCD display implementations for Hitachi HD44780. - * These are the most common LCD character displays. - */ - -#include "ultralcd_HD44780.h" -#include "../ultralcd.h" -#include "../../libs/numtostr.h" - -#include "../../sd/cardreader.h" -#include "../../module/temperature.h" -#include "../../module/printcounter.h" -#include "../../module/planner.h" -#include "../../module/motion.h" - -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - #include "../../feature/filwidth.h" - #include "../../gcode/parser.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/bedlevel.h" -#endif - -// -// Create LCD instance and chipset-specific information -// - -#if ENABLED(LCD_I2C_TYPE_PCF8575) - - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_I2C_PIN_EN, LCD_I2C_PIN_RW, LCD_I2C_PIN_RS, LCD_I2C_PIN_D4, LCD_I2C_PIN_D5, LCD_I2C_PIN_D6, LCD_I2C_PIN_D7); - -#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) - - LCD_CLASS lcd(LCD_I2C_ADDRESS - #ifdef DETECT_DEVICE - , 1 - #endif - ); - -#elif ENABLED(LCD_I2C_TYPE_PCA8574) - - LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT); - -#elif ENABLED(SR_LCD_2W_NL) - - // 2 wire Non-latching LCD SR from: - // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection - - LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN - #if PIN_EXISTS(SR_STROBE) - , SR_STROBE_PIN - #endif - ); - -#elif ENABLED(SR_LCD_3W_NL) - - // NewLiquidCrystal was not working - // https://github.com/mikeshub/SailfishLCD - // uses the code directly from Sailfish - - LCD_CLASS lcd(SR_STROBE_PIN, SR_DATA_PIN, SR_CLK_PIN); - -#elif ENABLED(LCM1602) - - LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); - -#else - - // Standard direct-connected LCD implementations - LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); - -#endif - -static void createChar_P(const char c, const byte * const ptr) { - byte temp[8]; - for (uint8_t i = 0; i < 8; i++) - temp[i] = pgm_read_byte(&ptr[i]); - lcd.createChar(c, temp); -} - -#if ENABLED(LCD_PROGRESS_BAR) - #define LCD_STR_PROGRESS "\x03\x04\x05" -#endif - -#if ENABLED(LCD_USE_I2C_BUZZER) - void MarlinUI::buzz(const long duration, const uint16_t freq) { - lcd.buzz(duration, freq); - } -#endif - -void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) { - #if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN) - UNUSED(screen_charset); - #endif - - // CHARSET_BOOT - #if ENABLED(SHOW_BOOTSCREEN) - const static PROGMEM byte corner[4][8] = { { - B00000, - B00000, - B00000, - B00000, - B00001, - B00010, - B00100, - B00100 - }, { - B00000, - B00000, - B00000, - B11100, - B11100, - B01100, - B00100, - B00100 - }, { - B00100, - B00010, - B00001, - B00000, - B00000, - B00000, - B00000, - B00000 - }, { - B00100, - B01000, - B10000, - B00000, - B00000, - B00000, - B00000, - B00000 - } }; - #endif // SHOW_BOOTSCREEN - - // CHARSET_INFO - const static PROGMEM byte bedTemp[8] = { - B00000, - B11111, - B10101, - B10001, - B10101, - B11111, - B00000, - B00000 - }; - - const static PROGMEM byte degree[8] = { - B01100, - B10010, - B10010, - B01100, - B00000, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte thermometer[8] = { - B00100, - B01010, - B01010, - B01010, - B01010, - B10001, - B10001, - B01110 - }; - - const static PROGMEM byte uplevel[8] = { - B00100, - B01110, - B11111, - B00100, - B11100, - B00000, - B00000, - B00000 - }; - - const static PROGMEM byte feedrate[8] = { - #if LCD_INFO_SCREEN_STYLE == 1 - B00000, - B00100, - B10010, - B01001, - B10010, - B00100, - B00000, - B00000 - #else - B11100, - B10000, - B11000, - B10111, - B00101, - B00110, - B00101, - B00000 - #endif - }; - - const static PROGMEM byte clock[8] = { - B00000, - B01110, - B10011, - B10101, - B10001, - B01110, - B00000, - B00000 - }; - - #if ENABLED(LCD_PROGRESS_BAR) - - // CHARSET_INFO - const static PROGMEM byte progress[3][8] = { { - B00000, - B10000, - B10000, - B10000, - B10000, - B10000, - B10000, - B00000 - }, { - B00000, - B10100, - B10100, - B10100, - B10100, - B10100, - B10100, - B00000 - }, { - B00000, - B10101, - B10101, - B10101, - B10101, - B10101, - B10101, - B00000 - } }; - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(SDSUPPORT) && HAS_LCD_MENU - - // CHARSET_MENU - const static PROGMEM byte refresh[8] = { - B00000, - B00110, - B11001, - B11000, - B00011, - B10011, - B01100, - B00000, - }; - const static PROGMEM byte folder[8] = { - B00000, - B11100, - B11111, - B10001, - B10001, - B11111, - B00000, - B00000 - }; - - #endif // SDSUPPORT - - #if ENABLED(SHOW_BOOTSCREEN) - // Set boot screen corner characters - if (screen_charset == CHARSET_BOOT) { - for (uint8_t i = 4; i--;) - createChar_P(i, corner[i]); - } - else - #endif - { // Info Screen uses 5 special characters - createChar_P(LCD_STR_BEDTEMP[0], bedTemp); - createChar_P(LCD_STR_DEGREE[0], degree); - createChar_P(LCD_STR_THERMOMETER[0], thermometer); - createChar_P(LCD_STR_FEEDRATE[0], feedrate); - createChar_P(LCD_STR_CLOCK[0], clock); - - #if ENABLED(LCD_PROGRESS_BAR) - if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen - for (int16_t i = 3; i--;) - createChar_P(LCD_STR_PROGRESS[i], progress[i]); - } - else - #endif - { - createChar_P(LCD_STR_UPLEVEL[0], uplevel); - #if ENABLED(SDSUPPORT) && HAS_LCD_MENU - // SD Card sub-menu special characters - createChar_P(LCD_STR_REFRESH[0], refresh); - createChar_P(LCD_STR_FOLDER[0], folder); - #endif - } - } - -} - -void MarlinUI::init_lcd() { - - #if ENABLED(LCD_I2C_TYPE_PCF8575) - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #ifdef LCD_I2C_PIN_BL - lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE); - lcd.setBacklight(HIGH); - #endif - - #elif ENABLED(LCD_I2C_TYPE_MCP23017) - lcd.setMCPType(LTI_TYPE_MCP23017); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - update_indicators(); - - #elif ENABLED(LCD_I2C_TYPE_MCP23008) - lcd.setMCPType(LTI_TYPE_MCP23008); - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - - #elif ENABLED(LCD_I2C_TYPE_PCA8574) - lcd.init(); - lcd.backlight(); - - #else - lcd.begin(LCD_WIDTH, LCD_HEIGHT); - #endif - - set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU); - - lcd.clear(); -} - -bool MarlinUI::detected() { - return true - #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) - && lcd.LcdDetected() == 1 - #endif - ; -} - -#if HAS_SLOW_BUTTONS - uint8_t MarlinUI::read_slow_buttons() { - #if ENABLED(LCD_I2C_TYPE_MCP23017) - // 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 - #endif - ; - #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 - return slow_bits; - #endif // LCD_I2C_TYPE_MCP23017 - } -#endif - -void MarlinUI::clear_lcd() { lcd.clear(); } - -#if ENABLED(SHOW_BOOTSCREEN) - - void lcd_erase_line(const lcd_uint_t line) { - lcd_moveto(0, line); - for (uint8_t i = LCD_WIDTH + 1; --i;) - lcd_put_wchar(' '); - } - - // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line - void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, PGM_P const text, const uint8_t len, const int16_t time) { - uint8_t slen = utf8_strlen_P(text); - if (slen < len) { - lcd_put_u8str_max_P(col, line, text, len); - for (; slen < len; ++slen) lcd_put_wchar(' '); - safe_delay(time); - } - else { - PGM_P p = text; - int dly = time / _MAX(slen, 1); - for (uint8_t i = 0; i <= slen; i++) { - - // Print the text at the correct place - lcd_put_u8str_max_P(col, line, p, len); - - // Fill with spaces - for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_wchar(' '); - - // Delay - safe_delay(dly); - - // Advance to the next UTF8 valid position - p++; - while (!START_OF_UTF8_CHAR(pgm_read_byte(p))) p++; - } - } - } - - static void logo_lines(PGM_P const extra) { - int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; - lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x01'); - lcd_put_u8str_P(indent, 1, PSTR("|Marlin|")); lcd_put_u8str_P(extra); - lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x03'); - } - - void MarlinUI::show_bootscreen() { - set_custom_characters(CHARSET_BOOT); - lcd.clear(); - - #define LCD_EXTRA_SPACE (LCD_WIDTH-8) - - #define CENTER_OR_SCROLL(STRING,DELAY) \ - lcd_erase_line(3); \ - if (utf8_strlen(STRING) <= LCD_WIDTH) { \ - lcd_put_u8str_P((LCD_WIDTH - utf8_strlen_P(PSTR(STRING))) / 2, 3, PSTR(STRING)); \ - safe_delay(DELAY); \ - } \ - else { \ - lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \ - } - - // - // Show the Marlin logo with splash line 1 - // - if (LCD_EXTRA_SPACE >= utf8_strlen(SHORT_BUILD_VERSION) + 1) { - // - // Show the Marlin logo, splash line1, and splash line 2 - // - logo_lines(PSTR(" " SHORT_BUILD_VERSION)); - CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000); - } - else { - // - // Show the Marlin logo and short build version - // After a delay show the website URL - // - extern const char NUL_STR[]; - logo_lines(NUL_STR); - 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); - set_custom_characters(CHARSET_INFO); - lcd.clear(); - } - -#endif // SHOW_BOOTSCREEN - -void MarlinUI::draw_kill_screen() { - lcd_put_u8str(0, 0, status_message); - lcd_uint_t y = 2; - #if LCD_HEIGHT >= 4 - lcd_put_u8str_P(0, y++, GET_TEXT(MSG_HALTED)); - #endif - lcd_put_u8str_P(0, y, GET_TEXT(MSG_PLEASE_RESET)); -} - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - lcd_put_wchar('X' + uint8_t(axis)); - if (blink) - lcd_put_u8str(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); - else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_put_u8str(value); - } - } -} - -FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char prefix, const bool blink) { - #if HAS_HEATED_BED - const bool isBed = heater < 0; - const float t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), - t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); - #else - const float t1 = thermalManager.degHotend(heater), t2 = thermalManager.degTargetHotend(heater); - #endif - - if (prefix >= 0) lcd_put_wchar(prefix); - - lcd_put_u8str(i16tostr3(t1 + 0.5)); - lcd_put_wchar('/'); - - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #else - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.bed_idle.timed_out : - #endif - thermalManager.hotend_idle[heater].timed_out - ); - - if (!blink && is_idle) { - lcd_put_wchar(' '); - if (t2 >= 10) lcd_put_wchar(' '); - if (t2 >= 100) lcd_put_wchar(' '); - } - else - #endif - lcd_put_u8str(i16tostr3left(t2 + 0.5)); - - if (prefix >= 0) { - lcd_put_wchar(LCD_STR_DEGREE[0]); - lcd_put_wchar(' '); - if (t2 < 10) lcd_put_wchar(' '); - } -} - -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_PRINT_PROGRESS - - FORCE_INLINE void _draw_print_progress() { - const uint8_t progress = ui.get_progress_percent(); - lcd_put_u8str_P(PSTR( - #if ENABLED(SDSUPPORT) - "SD" - #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) - "P:" - #endif - )); - if (progress) - lcd_put_u8str(ui8tostr3(progress)); - else - lcd_put_u8str_P(PSTR("---")); - lcd_put_wchar('%'); - } - -#endif - -#if ENABLED(LCD_PROGRESS_BAR) - - void MarlinUI::draw_progress_bar(const uint8_t percent) { - const int16_t tix = (int16_t)(percent * (LCD_WIDTH) * 3) / 100, - cel = tix / 3, - rem = tix % 3; - uint8_t i = LCD_WIDTH; - char msg[LCD_WIDTH + 1], b = ' '; - msg[LCD_WIDTH] = '\0'; - while (i--) { - if (i == cel - 1) - b = LCD_STR_PROGRESS[2]; - else if (i == cel && rem != 0) - b = LCD_STR_PROGRESS[rem - 1]; - msg[i] = b; - } - lcd_put_u8str(msg); - } - -#endif // LCD_PROGRESS_BAR - -void MarlinUI::draw_status_message(const bool blink) { - - lcd_moveto(0, LCD_HEIGHT - 1); - - #if ENABLED(LCD_PROGRESS_BAR) - - // Draw the progress bar if the message has shown long enough - // or if there is no message set. - if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !has_status()) { - const uint8_t progress = get_progress_percent(); - if (progress > 2) return draw_progress_bar(progress); - } - - #elif BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - - // Alternate Status message and Filament display - if (ELAPSED(millis(), next_filament_display)) { - lcd_put_u8str_P(PSTR("Dia ")); - lcd_put_u8str(ftostr12ns(filwidth.measured_mm)); - lcd_put_u8str_P(PSTR(" V")); - lcd_put_u8str(i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); - lcd_put_wchar('%'); - return; - } - - #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_put_u8str(status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { lcd_put_wchar(' '); ++slen; } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - // and the string remaining length - uint8_t rlen; - const char *stat = status_and_len(rlen); - lcd_put_u8str_max(stat, LCD_WIDTH); // The string leaves space - - // If the remaining string doesn't completely fill the screen - if (rlen < LCD_WIDTH) { - lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - if (--chars) { // Draw a second dot if there's space - lcd_put_wchar('.'); - if (--chars) - lcd_put_u8str_max(status_message, chars); // Print a second copy of the message - } - } - if (last_blink != blink) { - last_blink = blink; - advance_status_scroll(); - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(status_message); - - // Just print the string to the LCD - lcd_put_u8str_max(status_message, LCD_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - lcd_put_wchar(' '); - ++slen; - } - #endif -} - -/** - * LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen - * - * 16x2 |000/000 B000/000| - * |0123456789012345| - * - * 16x4 |000/000 B000/000| - * |SD---% Z 000.00| - * |F---% T--:--| - * |0123456789012345| - * - * 20x2 |T000/000° B000/000° | - * |01234567890123456789| - * - * 20x4 |T000/000° B000/000° | - * |X 000 Y 000 Z000.000| - * |F---% SD---% T--:--| - * |01234567890123456789| - * - * LCD_INFO_SCREEN_STYLE 1 : Průša-style Status Screen - * - * |T000/000° Z 000.00 | - * |B000/000° F---% | - * |SD---% T--:-- | - * |01234567890123456789| - * - * |T000/000° Z 000.00 | - * |T000/000° F---% | - * |B000/000° SD---% | - * |01234567890123456789| - */ - -void MarlinUI::draw_status_screen() { - - const bool blink = get_blink(); - lcd_moveto(0, 0); - - #if LCD_INFO_SCREEN_STYLE == 0 - - // ========== Line 1 ========== - - #if LCD_WIDTH < 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(H_E0, -1, blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 - lcd_moveto(8, 0); - _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); - #elif HAS_HEATED_BED - lcd_moveto(8, 0); - _draw_bed_status(blink); - #endif - - #else // LCD_WIDTH >= 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 - lcd_moveto(10, 0); - _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); - #elif HAS_HEATED_BED - lcd_moveto(10, 0); - _draw_bed_status(blink); - #endif - - #endif // LCD_WIDTH >= 20 - - // ========== Line 2 ========== - - #if LCD_HEIGHT > 2 - - #if LCD_WIDTH < 20 - - #if HAS_PRINT_PROGRESS - lcd_moveto(0, 2); - _draw_print_progress(); - #endif - - #else // LCD_WIDTH >= 20 - - lcd_moveto(0, 1); - - // If the first line has two extruder temps, - // show more temperatures on the next line - - #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) - - #if HOTENDS > 2 - _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink); - lcd_moveto(10, 1); - #endif - - _draw_bed_status(blink); - - #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - #if DUAL_MIXING_EXTRUDER - - // Two-component mix / gradient instead of XY - - char mixer_messages[12]; - const char *mix_label; - #if ENABLED(GRADIENT_MIX) - if (mixer.gradient.enabled) { - mixer.update_mix_from_gradient(); - mix_label = "Gr"; - } - else - #endif - { - mixer.update_mix_from_vtool(); - mix_label = "Mx"; - } - sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); - lcd_put_u8str(mixer_messages); - - #else // !DUAL_MIXING_EXTRUDER - - if (true - #if ENABLED(LCD_SHOW_E_TOTAL) - && !printingIsActive() - #endif - ) { - xy_pos_t lpos = current_position; toLogical(lpos); - _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); - lcd_put_wchar(' '); - _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); - } - else { - #if ENABLED(LCD_SHOW_E_TOTAL) - char tmp[20]; - const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm - sprintf_P(tmp, PSTR("E %ld%cm "), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm - lcd_put_u8str(tmp); - #endif - } - - #endif // !DUAL_MIXING_EXTRUDER - - #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - #endif // LCD_WIDTH >= 20 - - lcd_moveto(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); - - #if HAS_LEVELING && !HAS_HEATED_BED - lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); - #endif - - #endif // LCD_HEIGHT > 2 - - // ========== Line 3 ========== - - #if LCD_HEIGHT > 3 - - lcd_put_wchar(0, 2, LCD_STR_FEEDRATE[0]); - lcd_put_u8str(i16tostr3(feedrate_percentage)); - lcd_put_wchar('%'); - - char buffer[14]; - duration_t elapsed = print_job_timer.duration(); - const uint8_t len = elapsed.toDigital(buffer), - timepos = LCD_WIDTH - len - 1; - lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]); - lcd_put_u8str(buffer); - - #if LCD_WIDTH >= 20 - lcd_moveto(timepos - 7, 2); - #if HAS_PRINT_PROGRESS - _draw_print_progress(); - #else - char c; - uint16_t per; - #if HAS_FAN0 - if (true - #if EXTRUDERS && ENABLED(ADAPTIVE_FAN_SLOWING) - && (blink || thermalManager.fan_speed_scaler[0] < 128) - #endif - ) { - uint16_t spd = thermalManager.fan_speed[0]; - if (blink) c = 'F'; - #if ENABLED(ADAPTIVE_FAN_SLOWING) - else { c = '*'; spd = thermalManager.scaledFanSpeed(0, spd); } - #endif - per = thermalManager.fanPercent(spd); - } - else - #endif - { - #if EXTRUDERS - c = 'E'; - per = planner.flow_percentage[0]; - #endif - } - lcd_put_wchar(c); - lcd_put_u8str(i16tostr3(per)); - lcd_put_wchar('%'); - #endif - #endif - - #endif // LCD_HEIGHT > 3 - - #elif LCD_INFO_SCREEN_STYLE == 1 - - // ========== Line 1 ========== - - // - // Hotend 0 Temperature - // - _draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink); - - // - // Z Coordinate - // - lcd_moveto(LCD_WIDTH - 9, 0); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); - - #if HAS_LEVELING && (HOTENDS > 1 || !HAS_HEATED_BED) - lcd_put_wchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); - #endif - - // ========== Line 2 ========== - - // - // Hotend 1 or Bed Temperature - // - lcd_moveto(0, 1); - #if HOTENDS > 1 - _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink); - #elif HAS_HEATED_BED - _draw_bed_status(blink); - #endif - - lcd_put_wchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]); - lcd_put_u8str(i16tostr3(feedrate_percentage)); - lcd_put_wchar('%'); - - // ========== Line 3 ========== - - // - // SD Percent, Hotend 2, or Bed - // - lcd_moveto(0, 2); - #if HOTENDS > 2 - _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink); - #elif HOTENDS > 1 && HAS_HEATED_BED - _draw_bed_status(blink); - #elif HAS_PRINT_PROGRESS - #define DREW_PRINT_PROGRESS - _draw_print_progress(); - #endif - - // - // Elapsed Time or SD Percent - // - lcd_moveto(LCD_WIDTH - 9, 2); - #if HAS_PRINT_PROGRESS && !defined(DREW_PRINT_PROGRESS) - _draw_print_progress(); - #else - duration_t elapsed = print_job_timer.duration(); - char buffer[14]; - (void)elapsed.toDigital(buffer); - lcd_put_wchar(LCD_STR_CLOCK[0]); - lcd_put_u8str(buffer); - #endif - - #endif // LCD_INFO_SCREEN_STYLE 1 - - // ========= Last Line ======== - - // - // Status Message (which may be a Progress Bar or Filament display) - // - draw_status_message(blink); -} - -#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) { - if (row < LCD_HEIGHT) { - lcd_moveto(LCD_WIDTH - 9, row); - _draw_heater_status((heater_ind_t)extruder, LCD_STR_THERMOMETER[0], get_blink()); - } - } - - #endif // ADVANCED_PAUSE_FEATURE - - // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { - int8_t n = LCD_WIDTH; - lcd_moveto(0, row); - if ((style & SS_CENTER) && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd_put_wchar(' '); n--; } - } - n = lcd_put_u8str_ind_P(pstr, itemIndex, n); - if (valstr) n -= lcd_put_u8str_max(valstr, n); - for (; n > 0; --n) lcd_put_wchar(' '); - } - - // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { - lcd_put_wchar(0, row, sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2); - for (; n; --n) lcd_put_wchar(' '); - lcd_put_wchar(post_char); - } - - // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { - const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; - lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vlen); - if (vlen) { - lcd_put_wchar(':'); - for (; n; --n) lcd_put_wchar(' '); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); - } - } - - // Low-level draw_edit_screen can be used to draw an edit screen from anyplace - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { - ui.encoder_direction_normal(); - - uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, LCD_WIDTH - 1); - if (value != nullptr) { - lcd_put_wchar(':'); - int len = utf8_strlen(value); - const lcd_uint_t valrow = (n < len + 1) ? 2 : 1; // Value on the next row if it won't fit - lcd_put_wchar((LCD_WIDTH - 1) - (len + 1), valrow, ' '); // Right-justified, padded, leading space - lcd_put_u8str(value); - } - } - - // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(pref, string, suff); - SETCURSOR(0, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); - SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' '); - } - - #if ENABLED(SDSUPPORT) - - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { - lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - constexpr uint8_t maxlen = LCD_WIDTH - 2; - uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); - for (; n; --n) lcd_put_wchar(' '); - lcd_put_wchar(isDir ? LCD_STR_FOLDER[0] : ' '); - } - - #endif - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - - void MarlinUI::update_indicators() { - // Set the LEDS - referred to as backlights by the LiquidTWI2 library - static uint8_t ledsprev = 0; - uint8_t leds = 0; - - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() > 0) leds |= LED_A; - #endif - - #if HOTENDS - if (thermalManager.degTargetHotend(0) > 0) leds |= LED_B; - #endif - - #if FAN_COUNT > 0 - if (0 - #if HAS_FAN0 - || thermalManager.fan_speed[0] - #endif - #if HAS_FAN1 - || thermalManager.fan_speed[1] - #endif - #if HAS_FAN2 - || thermalManager.fan_speed[2] - #endif - ) leds |= LED_C; - #endif // FAN_COUNT > 0 - - #if HOTENDS > 1 - if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C; - #endif - - if (leds != ledsprev) { - lcd.setBacklight(leds); - ledsprev = leds; - } - } - - #endif // LCD_HAS_STATUS_INDICATORS - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - #define HD44780_CHAR_WIDTH 5 - #define HD44780_CHAR_HEIGHT 8 - #define MESH_MAP_COLS 7 - #define MESH_MAP_ROWS 4 - - #define CHAR_LINE_TOP 0 - #define CHAR_LINE_BOT 1 - #define CHAR_EDGE_L 2 - #define CHAR_EDGE_R 3 - #define CHAR_UL_UL 4 - #define CHAR_LR_UL 5 - #define CHAR_UL_LR 6 - #define CHAR_LR_LR 7 - - #define TOP_LEFT _BV(0) - #define TOP_RIGHT _BV(1) - #define LOWER_LEFT _BV(2) - #define LOWER_RIGHT _BV(3) - - /** - * Possible map screens: - * - * 16x2 |X000.00 Y000.00| - * |(00,00) Z00.000| - * - * 20x2 | X:000.00 Y:000.00 | - * | (00,00) Z:00.000 | - * - * 16x4 |+-------+(00,00)| - * || |X000.00| - * || |Y000.00| - * |+-------+Z00.000| - * - * 20x4 | +-------+ (00,00) | - * | | | X:000.00| - * | | | Y:000.00| - * | +-------+ Z:00.000| - */ - - typedef struct { - uint8_t custom_char_bits[HD44780_CHAR_HEIGHT]; - } custom_char; - - typedef struct { - lcd_uint_t column, row, - x_pixel_offset, y_pixel_offset; - uint8_t x_pixel_mask; - } coordinate; - - void add_edges_to_custom_char(custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location); - FORCE_INLINE static void clear_custom_char(custom_char * const cc) { ZERO(cc->custom_char_bits); } - - coordinate pixel_location(int16_t x, int16_t y) { - coordinate ret_val; - int16_t xp, yp, r, c; - - x++; y++; // +1 because lines on the left and top - - c = x / (HD44780_CHAR_WIDTH); - r = y / (HD44780_CHAR_HEIGHT); - - ret_val.column = c; - ret_val.row = r; - - xp = x - c * (HD44780_CHAR_WIDTH); // Get the pixel offsets into the character cell - xp = HD44780_CHAR_WIDTH - 1 - xp; // Column within relevant character cell (0 on the right) - yp = y - r * (HD44780_CHAR_HEIGHT); - - ret_val.x_pixel_mask = _BV(xp); - ret_val.x_pixel_offset = xp; - ret_val.y_pixel_offset = yp; - return ret_val; - } - - inline coordinate pixel_location(const lcd_uint_t x, const lcd_uint_t y) { return pixel_location((int16_t)x, (int16_t)y); } - - void prep_and_put_map_char(custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const lcd_uint_t x, const lcd_uint_t y) { - add_edges_to_custom_char(chrdata, ul, lr, brc, cl); - lcd.createChar(c, (uint8_t*)&chrdata); - lcd_put_wchar(x, y, c); - } - - void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { - - #if LCD_WIDTH >= 20 - #define _LCD_W_POS 12 - #define _PLOT_X 1 - #define _MAP_X 3 - #define _LABEL(C,X,Y) lcd_put_u8str(X, Y, C) - #define _XLABEL(X,Y) _LABEL("X:",X,Y) - #define _YLABEL(X,Y) _LABEL("Y:",X,Y) - #define _ZLABEL(X,Y) _LABEL("Z:",X,Y) - #else - #define _LCD_W_POS 8 - #define _PLOT_X 0 - #define _MAP_X 1 - #define _LABEL(X,Y,C) lcd_put_wchar(X, Y, C) - #define _XLABEL(X,Y) _LABEL('X',X,Y) - #define _YLABEL(X,Y) _LABEL('Y',X,Y) - #define _ZLABEL(X,Y) _LABEL('Z',X,Y) - #endif - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Show X and Y positions - */ - _XLABEL(_PLOT_X, 0); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); - _YLABEL(_LCD_W_POS, 0); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); - - lcd_moveto(_PLOT_X, 0); - - #else // 16x4 or 20x4 display - - coordinate upper_left, lower_right, bottom_right_corner; - custom_char new_char; - uint8_t i, n, n_rows, n_cols; - lcd_uint_t j, k, l, m, bottom_line, right_edge, - x_map_pixels, y_map_pixels, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt, - suppress_x_offset = 0, suppress_y_offset = 0; - - const uint8_t y_plot_inv = (GRID_MAX_POINTS_Y - 1) - y_plot; - - upper_left.column = 0; - upper_left.row = 0; - lower_right.column = 0; - lower_right.row = 0; - - clear_lcd(); - - x_map_pixels = (HD44780_CHAR_WIDTH) * (MESH_MAP_COLS) - 2; // Minus 2 because we are drawing a box around the map - y_map_pixels = (HD44780_CHAR_HEIGHT) * (MESH_MAP_ROWS) - 2; - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X); - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y); - - if (pixels_per_x_mesh_pnt >= HD44780_CHAR_WIDTH) { // There are only 2 custom characters available, so the X - pixels_per_x_mesh_pnt = HD44780_CHAR_WIDTH; // Size of the mesh point needs to fit within them independent - suppress_x_offset = 1; // Of where the starting pixel is located. - } - - if (pixels_per_y_mesh_pnt >= HD44780_CHAR_HEIGHT) { // There are only 2 custom characters available, so the Y - pixels_per_y_mesh_pnt = HD44780_CHAR_HEIGHT; // Size of the mesh point needs to fit within them independent - suppress_y_offset = 1; // Of where the starting pixel is located. - } - - x_map_pixels = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X); // Now we have the right number of pixels to make both - y_map_pixels = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y); // Directions fit nicely - - right_edge = pixels_per_x_mesh_pnt * (GRID_MAX_POINTS_X) + 1; // Find location of right edge within the character cell - bottom_line = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 1; // Find location of bottome line within the character cell - - n_rows = bottom_line / (HD44780_CHAR_HEIGHT) + 1; - n_cols = right_edge / (HD44780_CHAR_WIDTH) + 1; - - for (i = 0; i < n_cols; i++) { - lcd_put_wchar(i, 0, CHAR_LINE_TOP); // Box Top line - lcd_put_wchar(i, n_rows - 1, CHAR_LINE_BOT); // Box Bottom line - } - - for (j = 0; j < n_rows; j++) { - lcd_put_wchar(0, j, CHAR_EDGE_L); // Box Left edge - lcd_put_wchar(n_cols - 1, j, CHAR_EDGE_R); // Box Right edge - } - - /** - * If the entire 4th row is not in use, do not put vertical bars all the way down to the bottom of the display - */ - - k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2; - l = (HD44780_CHAR_HEIGHT) * n_rows; - if (l > k && l - k >= (HD44780_CHAR_HEIGHT) / 2) { - lcd_put_wchar(0, n_rows - 1, ' '); // Box Left edge - lcd_put_wchar(n_cols - 1, n_rows - 1, ' '); // Box Right edge - } - - clear_custom_char(&new_char); - new_char.custom_char_bits[0] = 0b11111U; // Char #0 is used for the box top line - lcd.createChar(CHAR_LINE_TOP, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - k = (GRID_MAX_POINTS_Y) * pixels_per_y_mesh_pnt + 1; // Row of pixels for the bottom box line - l = k % (HD44780_CHAR_HEIGHT); // Row within relevant character cell - new_char.custom_char_bits[l] = 0b11111U; // Char #1 is used for the box bottom line - lcd.createChar(CHAR_LINE_BOT, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - for (j = 0; j < HD44780_CHAR_HEIGHT; j++) - new_char.custom_char_bits[j] = 0b10000U; // Char #2 is used for the box left edge - lcd.createChar(CHAR_EDGE_L, (uint8_t*)&new_char); - - clear_custom_char(&new_char); - m = (GRID_MAX_POINTS_X) * pixels_per_x_mesh_pnt + 1; // Column of pixels for the right box line - n = m % (HD44780_CHAR_WIDTH); // Column within relevant character cell - i = HD44780_CHAR_WIDTH - 1 - n; // Column within relevant character cell (0 on the right) - for (j = 0; j < HD44780_CHAR_HEIGHT; j++) - new_char.custom_char_bits[j] = (uint8_t)_BV(i); // Char #3 is used for the box right edge - lcd.createChar(CHAR_EDGE_R, (uint8_t*)&new_char); - - i = x_plot * pixels_per_x_mesh_pnt - suppress_x_offset; - j = y_plot_inv * pixels_per_y_mesh_pnt - suppress_y_offset; - upper_left = pixel_location(i, j); - - k = (x_plot + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset; - l = (y_plot_inv + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset; - lower_right = pixel_location(k, l); - - bottom_right_corner = pixel_location(x_map_pixels, y_map_pixels); - - /** - * First, handle the simple case where everything is within a single character cell. - * If part of the Mesh Plot is outside of this character cell, we will follow up - * and deal with that next. - */ - - clear_custom_char(&new_char); - const lcd_uint_t ypix = _MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = upper_left.x_pixel_mask; - for (k = 0; k < pixels_per_x_mesh_pnt; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - - prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, TOP_LEFT, CHAR_UL_UL, upper_left.column, upper_left.row); - - /** - * Next, check for two side by side character cells being used to display the Mesh Point - * If found... do the right hand character cell next. - */ - if (upper_left.column == lower_right.column - 1) { - l = upper_left.x_pixel_offset; - clear_custom_char(&new_char); - for (j = upper_left.y_pixel_offset; j < ypix; j++) { - i = _BV(HD44780_CHAR_WIDTH - 1); // Fill in the left side of the right character cell - for (k = 0; k < pixels_per_x_mesh_pnt - 1 - l; k++) { - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, TOP_RIGHT, CHAR_LR_UL, lower_right.column, upper_left.row); - } - - /** - * Next, check for two character cells stacked on top of each other being used to display the Mesh Point - */ - if (upper_left.row == lower_right.row - 1) { - l = HD44780_CHAR_HEIGHT - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - i = upper_left.x_pixel_mask; - for (m = 0; m < pixels_per_x_mesh_pnt; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - if (!(i >>= 1)) break; - } - } - prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, LOWER_LEFT, CHAR_UL_LR, upper_left.column, lower_right.row); - } - - /** - * Next, check for four character cells being used to display the Mesh Point. If that is - * what is here, we work to fill in the character cell that is down one and to the right one - * from the upper_left character cell. - */ - - if (upper_left.column == lower_right.column - 1 && upper_left.row == lower_right.row - 1) { - l = HD44780_CHAR_HEIGHT - upper_left.y_pixel_offset; // Number of pixel rows in top character cell - k = pixels_per_y_mesh_pnt - l; // Number of pixel rows in bottom character cell - clear_custom_char(&new_char); - for (j = 0; j < k; j++) { - l = upper_left.x_pixel_offset; - i = _BV(HD44780_CHAR_WIDTH - 1); // Fill in the left side of the right character cell - for (m = 0; m < pixels_per_x_mesh_pnt - 1 - l; m++) { // Fill in the top side of the bottom character cell - new_char.custom_char_bits[j] |= i; - i >>= 1; - } - } - prep_and_put_map_char(new_char, upper_left, lower_right, bottom_right_corner, LOWER_RIGHT, CHAR_LR_LR, lower_right.column, lower_right.row); - } - - #endif - - /** - * Print plot position - */ - lcd_put_wchar(_LCD_W_POS, 0, '('); - lcd_put_u8str(ui8tostr3(x_plot)); - lcd_put_wchar(','); - lcd_put_u8str(ui8tostr3(y_plot)); - lcd_put_wchar(')'); - - #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display - - /** - * Print Z values - */ - _ZLABEL(_LCD_W_POS, 1); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); - else - lcd_put_u8str_P(PSTR(" -----")); - - #else // 16x4 or 20x4 display - - /** - * Show all values at right of screen - */ - _XLABEL(_LCD_W_POS, 1); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); - _YLABEL(_LCD_W_POS, 2); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); - - /** - * Show the location value - */ - _ZLABEL(_LCD_W_POS, 3); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); - else - lcd_put_u8str_P(PSTR(" -----")); - - #endif // LCD_HEIGHT > 3 - } - - void add_edges_to_custom_char(custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location) { - uint8_t i, k; - int16_t n_rows = lr.row - ul.row + 1, - n_cols = lr.column - ul.column + 1; - - /** - * Check if Top line of box needs to be filled in - */ - - if (ul.row == 0 && (cell_location & (TOP_LEFT|TOP_RIGHT))) { // Only fill in the top line for the top character cells - - if (n_cols == 1) { - if (ul.column != brc.column) - custom.custom_char_bits[0] = 0xFF; // Single column in middle - else - for (i = brc.x_pixel_offset; i < HD44780_CHAR_WIDTH; i++) // Single column on right side - SBI(custom.custom_char_bits[0], i); - } - else if ((cell_location & TOP_LEFT) || lr.column != brc.column) // Multiple column in the middle or with right cell in middle - custom.custom_char_bits[0] = 0xFF; - else - for (i = brc.x_pixel_offset; i < HD44780_CHAR_WIDTH; i++) - SBI(custom.custom_char_bits[0], i); - } - - /** - * Check if left line of box needs to be filled in - */ - if (cell_location & (TOP_LEFT|LOWER_LEFT)) { - if (ul.column == 0) { // Left column of characters on LCD Display - k = ul.row == brc.row ? brc.y_pixel_offset : HD44780_CHAR_HEIGHT; // If it isn't the last row... do the full character cell - for (i = 0; i < k; i++) - SBI(custom.custom_char_bits[i], HD44780_CHAR_WIDTH - 1); - } - } - - /** - * Check if bottom line of box needs to be filled in - */ - - // Single row of mesh plot cells - if (n_rows == 1 /* && (cell_location & (TOP_LEFT|TOP_RIGHT)) */ && ul.row == brc.row) { - if (n_cols == 1) // Single row, single column case - k = ul.column == brc.column ? brc.x_pixel_mask : 0x01; - else if (cell_location & TOP_RIGHT) // Single row, multiple column case - k = lr.column == brc.column ? brc.x_pixel_mask : 0x01; - else // Single row, left of multiple columns - k = 0x01; - while (k < _BV(HD44780_CHAR_WIDTH)) { - custom.custom_char_bits[brc.y_pixel_offset] |= k; - k <<= 1; - } - } - - // Double row of characters on LCD Display - // And this is a bottom custom character - if (n_rows == 2 && (cell_location & (LOWER_LEFT|LOWER_RIGHT)) && lr.row == brc.row) { - if (n_cols == 1) // Double row, single column case - k = ul.column == brc.column ? brc.x_pixel_mask : 0x01; - else if (cell_location & LOWER_RIGHT) // Double row, multiple column case - k = lr.column == brc.column ? brc.x_pixel_mask : 0x01; - else // Double row, left of multiple columns - k = 0x01; - while (k < _BV(HD44780_CHAR_WIDTH)) { - custom.custom_char_bits[brc.y_pixel_offset] |= k; - k <<= 1; - } - } - - /** - * Check if right line of box needs to be filled in - */ - - // Nothing to do if the lower right part of the mesh pnt isn't in the same column as the box line - if (lr.column == brc.column) { - // This mesh point is in the same character cell as the right box line - if (ul.column == brc.column || (cell_location & (TOP_RIGHT|LOWER_RIGHT))) { - // If not the last row... do the full character cell - k = ul.row == brc.row ? brc.y_pixel_offset : HD44780_CHAR_HEIGHT; - for (i = 0; i < k; i++) custom.custom_char_bits[i] |= brc.x_pixel_mask; - } - } - } - - #endif // AUTO_BED_LEVELING_UBL - -#endif // HAS_LCD_MENU - -#endif // HAS_CHARACTER_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.h deleted file mode 100644 index d600dd3c2d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/HD44780/ultralcd_HD44780.h +++ /dev/null @@ -1,109 +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 - -/** - * Implementation of the LCD display routines for a Hitachi HD44780 display. - * These are the most common LCD character displays. - */ - -#include "../../inc/MarlinConfig.h" - -#if LCD_HEIGHT > 3 - #include "../../libs/duration_t.h" -#endif - -//////////////////////////////////// -// Setup button and encode mappings for each panel (into 'buttons' variable -// -// This is just to map common functions (across different panels) onto the same -// macro name. The mapping is independent of whether the button is directly connected or -// via a shift/i2c register. - -//////////////////////////////////// -// Create LCD class instance and chipset-specific information -#if ENABLED(LCD_I2C_TYPE_PCF8575) - // NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins. - #define LCD_I2C_PIN_BL 3 - #define LCD_I2C_PIN_EN 2 - #define LCD_I2C_PIN_RW 1 - #define LCD_I2C_PIN_RS 0 - #define LCD_I2C_PIN_D4 4 - #define LCD_I2C_PIN_D5 5 - #define LCD_I2C_PIN_D6 6 - #define LCD_I2C_PIN_D7 7 - - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - -#elif ENABLED(LCD_I2C_TYPE_MCP23017) - // For the LED indicators (which may be mapped to different events in update_indicators()) - #define LCD_HAS_STATUS_INDICATORS - #define LED_A 0x04 //100 - #define LED_B 0x02 //010 - #define LED_C 0x01 //001 - - #include - #include - #define LCD_CLASS LiquidTWI2 - -#elif ENABLED(LCD_I2C_TYPE_MCP23008) - #include - #include - #define LCD_CLASS LiquidTWI2 - -#elif ENABLED(LCD_I2C_TYPE_PCA8574) - #include - #define LCD_CLASS LiquidCrystal_I2C - -#elif ENABLED(SR_LCD_2W_NL) - // 2 wire Non-latching LCD SR from: - // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection -// extern "C" void __cxa_pure_virtual() { while (1); } - #include - #include - #define LCD_CLASS LiquidCrystal_SR -#elif ENABLED(SR_LCD_3W_NL) - -//NewLiquidCrystal was not working for me, but this worked first try -//https://github.com/mikeshub/SailfishLCD -//uses the code directly from Sailfish - - #include - #define LCD_CLASS LiquidCrystalSerial - -#elif ENABLED(LCM1602) - #include - #include - #include - #define LCD_CLASS LiquidCrystal_I2C - -#else - // Standard directly connected LCD implementations - #include - #define LCD_CLASS LiquidCrystal -#endif - -#include "../fontutils.h" -#include "../lcdprint.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h deleted file mode 100644 index b7b1717e1b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ /dev/null @@ -1,109 +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 - -#include "../../inc/MarlinConfig.h" - -// use this file to create the public interface for device drivers that are NOT in the U8G library - -extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi; -extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi; - -class U8GLIB_64128N_2X_HAL : public U8GLIB { -public: - U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) - { } - U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) - { } -}; - -extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi; -extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi; - -class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB { -public: - U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } - U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } -}; - -// -// AVR version uses ultralcd_st7920_u8glib_rrd_AVR.cpp -// HAL version uses u8g_dev_st7920_128x64_HAL.cpp -// -extern u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi; - -class U8GLIB_ST7920_128X64_RRD : public U8GLIB { -public: - U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } -}; - -extern u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire; - -class U8GLIB_SH1106_128X64_2X_I2C_2_WIRE : public U8GLIB { -public: - U8GLIB_SH1106_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) - : U8GLIB(&u8g_dev_sh1106_128x64_2x_i2c_2_wire, options) - { } -}; - -extern u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire; - -class U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE : public U8GLIB { -public: - U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) - : U8GLIB(&u8g_dev_ssd1306_128x64_2x_i2c_2_wire, options) - { } -}; - -// -// Very basic support for 320x240 TFT screen -// Tested on MKS Robin TFT_V2.0 with ST7789V controller -// -extern u8g_dev_t u8g_dev_tft_320x240_upscale_from_128x64; - -class U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 : public U8GLIB { -public: - U8GLIB_TFT_320X240_UPSCALE_FROM_128X64(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset) - { } -}; - - -extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi; - -class U8GLIB_MINI12864_2X_HAL : public U8GLIB { -public: - U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset) - { } - U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset) - { } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h deleted file mode 100644 index 427685cadb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ /dev/null @@ -1,121 +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 - -// 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); - uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - 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 - - #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); - 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_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 - - #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 - - #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 - - #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 - #endif - -#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); - uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - 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_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 - -#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_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Bootscreen.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Bootscreen.h deleted file mode 100644 index ea8ce5e38a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Bootscreen.h +++ /dev/null @@ -1,521 +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 - -/** - * Standard Marlin Boot Screen bitmaps - * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - #include "../../../_Bootscreen.h" - - #ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8) - #endif - #ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT - #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) - #endif - -#endif - -#if ENABLED(BOOT_MARLIN_LOGO_SMALL) - - #define START_BMPWIDTH 56 - - const unsigned char start_bmp[] 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,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(BOOT_MARLIN_LOGO_ANIMATED) - - const unsigned char start_bmp1[] 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, - 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 start_bmp2[] 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,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 start_bmp3[] 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,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 start_bmp4[] 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,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 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 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 - }; - - #endif - -#else - - #define START_BMPWIDTH 112 - - const unsigned char start_bmp[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - #if ENABLED(BOOT_MARLIN_LOGO_ANIMATED) - - const unsigned char start_bmp1[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - const unsigned char start_bmp2[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - const unsigned char start_bmp3[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - const unsigned char start_bmp4[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B00000000,B00000000,B00000000,B00000000,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B00000000,B00000000,B00000000,B00000000,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B00000000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - const unsigned char start_bmp5[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00000000,B00000000,B00000000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00000000,B00000000,B00000000,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00000000,B00000000,B00000000,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00000000,B00000000,B00000000,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00000000,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B00000000,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - const unsigned char start_bmp6[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000000,B00000000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000000,B00000000,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00000000,B00000000,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00000000,B00000000,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00000000,B00000000,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B00000000,B00000000,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B00000000,B00000000,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - #endif - -#endif - -#if ENABLED(BOOT_MARLIN_LOGO_ANIMATED) - #ifndef MARLIN_BOOTSCREEN_FRAME_TIME - #define MARLIN_BOOTSCREEN_FRAME_TIME 100 // (ms) - #endif - const unsigned char * const marlin_bootscreen_animation[] PROGMEM = { - start_bmp1, start_bmp2, start_bmp3, start_bmp4, start_bmp5, start_bmp6, start_bmp - }; -#endif - -#ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH CEILING(START_BMPWIDTH, 8) -#endif -#ifndef START_BMPHEIGHT - #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) -#endif - -static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Statusscreen.h deleted file mode 100644 index 96f68e2b2d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ /dev/null @@ -1,1728 +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 - -/** - * Standard Marlin Status Screen bitmaps - * - * Use the Marlin Bitmap Converter to make your own: - * http://marlinfw.org/tools/u8glib/converter.html - */ - -#include "../../inc/MarlinConfig.h" -#include "ultralcd_DOGM.h" - -#define BW(N) ((N + 7) / 8) - -#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 - * - A custom heater bitmap - * - A custom fan bitmap / animation - * - * See the included examples for guidance - */ - #include "../../../_Statusscreen.h" - - #ifdef STATUS_SCREENWIDTH - #error "Your custom _Statusscreen.h needs to be converted for Marlin 2.0." - #endif - -#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 <= 4 - - #if HOTENDS == 0 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - 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 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #elif HOTENDS == 2 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #elif HOTENDS == 3 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, - 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 == 0 - - #define STATUS_HEATERS_WIDTH 0 - - #elif HOTENDS == 1 - - #define STATUS_HEATERS_WIDTH 12 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00011111,B11100000, - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #elif HOTENDS == 2 - - #define STATUS_HEATERS_WIDTH 36 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000, - B00111110,B11110000,B00000000,B00111011,B11110000, - B00111110,B11110000,B00000000,B00111000,B01110000, - B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #elif HOTENDS == 3 - - #define STATUS_HEATERS_WIDTH 60 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #elif HOTENDS == 4 - - #define STATUS_HEATERS_WIDTH 84 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, - 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 - - #else // !STATUS_COMBINE_HEATERS - - // - // Status Screen Hotends bitmaps - // - #if HOTENDS - - #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) - - const unsigned char status_hotend_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00011111,B11100000, - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100000,B00010000, - B00100000,B00010000, - B00010000,B00100000, - B00010000,B00100000, - B00100000,B00010000, - B00100000,B00010000, - B00110000,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #endif - - #elif HOTENDS >= 2 - - #ifdef STATUS_HOTEND_ANIM - - 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_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_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_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 - }; - - #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 - - #if STATUS_HOTEND_BITMAPS >= 3 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend3_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011100,B11100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend3_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010011,B00100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend3_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011100,B11100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #if STATUS_HOTEND_BITMAPS >= 4 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend4_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011011,B01100000, - B00111000,B00110000, - B00111111,B01110000, - B00111111,B01110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend4_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100100,B10010000, - B00100100,B10010000, - B00010100,B10100000, - B00010100,B10100000, - B00100111,B11010000, - B00100000,B10010000, - B00110000,B10110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend4_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111011,B01110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011000,B00100000, - B00111111,B01110000, - B00111111,B01110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #if STATUS_HOTEND_BITMAPS >= 5 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend5_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111000,B01110000, - B00111011,B11110000, - B00011000,B11100000, - B00011111,B01100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend5_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100111,B10010000, - B00100100,B00010000, - B00010111,B00100000, - B00010000,B10100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend5_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111000,B01110000, - B00111011,B11110000, - B00111000,B11110000, - B00011111,B01100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #endif - - #else - #define STATUS_HEATERS_HEIGHT 20 - #endif - - #endif - -#endif // !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH - -// LASER / SPINDLE -#if !STATUS_CUTTER_WIDTH && HAS_CUTTER - #define STATUS_CUTTER_WIDTH 24 - #define STATUS_CUTTER_X 80 - #if ENABLED(LASER_FEATURE) - #ifdef STATUS_CUTTER_ANIM - const unsigned char status_cutter_on_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B11000011,B00000000, - B00000001,B10011001,B10000000, - B00000011,B00100100,B11000000, - B00000000,B01000010,B00000000, - B00000000,B01000010,B00000000, - B00000011,B00100100,B11000000, - B00000001,B10011001,B10000000, - B00000000,B11000011,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00000000,B00000000, - B00000001,B00000000,B10000000, - B00000011,B00000000,B11000000, - B00000000,B00011000,B00000000, - B00000000,B00011000,B00000000, - B00000011,B00000000,B11000000, - B00000001,B00000000,B10000000, - B00000000,B00000000,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - #else - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B11000011,B00000000, - B00000001,B10000001,B10000000, - B00000011,B00000000,B11000000, - B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000, - B00000011,B00000000,B11000000, - B00000001,B10000001,B10000000, - B00000000,B11000011,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - #endif - #else - #ifdef STATUS_CUTTER_ANIM - const unsigned char status_cutter_on_bmp[] PROGMEM = { - B00000001,B11111110,B10000000, - B00000000,B11000000,B00000000, - B00000001,B10000000,B10000000, - B00000001,B00000000,B10000000, - B00000001,B11111100,B10000000, - B00000000,B11100000,B00000000, - B00000001,B11000000,B10000000, - B00000000,B10000001,B00000000, - B00000000,B01111010,B00000000, - B00000000,B00110100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000001,B11111110,B10000000, - B00000000,B11000000,B00000000, - B00000001,B10000000,B10000000, - B00000001,B00000000,B10000000, - B00000001,B11111100,B10000000, - B00000000,B11100000,B00000000, - B00000001,B11000000,B10000000, - B00000000,B10000001,B00000000, - B00000000,B01111010,B00000000, - B00000000,B00110100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - #else - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000001,B11000010,B10000000, - B00000001,B00011100,B10000000, - B00000000,B11100001,B00000000, - B00000001,B00001110,B10000000, - B00000001,B01110000,B10000000, - B00000000,B10000111,B10000000, - B00000001,B00111111,B10000000, - B00000000,B11111111,B00000000, - B00000000,B01111110,B00000000, - B00000000,B00111100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - #endif - #endif -#endif // LASER / SPINDLE - -// -// Default Status Screen Bed bitmaps -// -#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 (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #endif - #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) - - const unsigned char status_bed_bmp[] PROGMEM = { - B11111111,B11111111,B11000000, - B01000000,B00000000,B00100000, - B00100000,B00000000,B00010000, - B00010000,B00000000,B00001000, - B00001000,B00000000,B00000100, - B00000100,B00000000,B00000010, - B00000011,B11111111,B11111111 - }; - - const unsigned char status_bed_on_bmp[] PROGMEM = { - B00000010,B00100010,B00000000, - B00000100,B01000100,B00000000, - B00000100,B01000100,B00000000, - B00000010,B00100010,B00000000, - B00000001,B00010001,B00000000, - B11111111,B11111111,B11000000, - B01000000,B10001000,B10100000, - B00100001,B00010001,B00010000, - B00010010,B00100010,B00001000, - B00001000,B00000000,B00000100, - B00000100,B00000000,B00000010, - B00000011,B11111111,B11111111 - }; - - #else - - #define STATUS_BED_WIDTH 21 - #ifndef STATUS_BED_X - #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #endif - - #ifdef STATUS_BED_ANIM - - const unsigned char status_bed_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - const unsigned char status_bed_on_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 - }; - - #else - - const unsigned char status_bed_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 - }; - - #endif - - #endif -#else - #define STATUS_BED_WIDTH 0 -#endif - -#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 = { - 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 = { - 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 = { - 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 - -#define BED_OR_CHAMBER_OR_FAN (BED_OR_CHAMBER || HAS_FAN0) - -// 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 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || (ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_CHAMBER)) - #undef 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 !STATUS_FAN_WIDTH && STATUS_FAN_FRAMES > 0 - - // Provide a fan animation if none exists - - #if STATUS_FAN_FRAMES <= 2 - - #define STATUS_FAN_Y 2 - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111110,B00000000, - B00000110,B00000001,B10000000, - B00001000,B11111100,B01000000, - B00010000,B11111100,B00100000, - B00010000,B01111000,B00100000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00010000,B01111000,B00100000, - B00010000,B11111100,B00100000, - B00001000,B11111100,B01000000, - B00000110,B00000001,B10000000, - B00000001,B11111110,B00000000 - }; - - #if STATUS_FAN_FRAMES == 2 - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111110,B00000000, - B00000110,B00000001,B10000000, - B00001001,B10000110,B01000000, - B00010011,B10000111,B00100000, - B00010111,B10000111,B10100000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00010111,B10000111,B10100000, - B00010011,B10000111,B00100000, - B00001001,B10000110,B01000000, - B00000110,B00000001,B10000000, - B00000001,B11111110,B00000000 - }; - #endif - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000 - }; - - #if STATUS_FAN_FRAMES == 2 - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000 - }; - #endif - - #endif // !STATUS_ALT_FAN_BITMAP - - #elif STATUS_FAN_FRAMES == 3 - - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001001,B00000001,B00100000, - B00010111,B10000011,B11010000, - B00010111,B10000011,B11010000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00010111,B10000011,B11010000, - B00010111,B10000011,B11010000, - B00001001,B00000001,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00110000,B11000000, - B00001001,B11110000,B00100000, - B00010001,B11110000,B00010000, - B00010000,B11110000,B00010000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00010000,B00011110,B00010000, - B00010000,B00011111,B00010000, - B00001000,B00011111,B00100000, - B00000110,B00011000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00011000,B11000000, - B00001000,B00011111,B00100000, - B00010000,B00011111,B10010000, - B00010100,B00011111,B00010000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00010001,B11110000,B01010000, - B00010011,B11110000,B00010000, - B00001001,B11110000,B00100000, - B00000110,B00110000,B11000000, - B00000001,B11111111,B00000000 - }; - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - - #endif // !STATUS_ALT_FAN_BITMAP - - #elif STATUS_FAN_FRAMES == 4 - - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001000,B00111111,B00100000, - B00010000,B01111110,B00010000, - B00010000,B01111100,B00010000, - B00101000,B01111100,B00001000, - B00101100,B00111000,B00001000, - B00101111,B00111001,B11001000, - B00101111,B11111111,B11101000, - B00101111,B11000111,B11101000, - B00101111,B11111111,B11101000, - B00100111,B00111001,B11101000, - B00100000,B00111000,B01101000, - B00100000,B01111100,B00101000, - B00010000,B01111100,B00010000, - B00010000,B11111100,B00010000, - B00001001,B11111000,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001000,B00001111,B00100000, - B00010100,B00011111,B11010000, - B00010110,B00011111,B10010000, - B00101111,B00011111,B00001000, - B00101111,B10011110,B00001000, - B00101111,B11111100,B00001000, - B00101111,B11011100,B00001000, - B00100111,B11101111,B11001000, - B00100000,B01110111,B11101000, - B00100000,B01111111,B11101000, - B00100000,B11110011,B11101000, - B00100001,B11110001,B11101000, - B00010011,B11110000,B11010000, - B00010111,B11110000,B01010000, - B00001001,B11100000,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B10000000,B11000000, - B00001001,B10000000,B00100000, - B00010111,B10000001,B11010000, - B00010111,B11000011,B11010000, - B00100111,B11000111,B11101000, - B00100011,B11000111,B11111000, - B00100001,B11111111,B10001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100011,B11111111,B00001000, - B00111111,B11000111,B10001000, - B00101111,B11000111,B11001000, - B00010111,B10000111,B11010000, - B00010111,B00000011,B11010000, - B00001000,B00000011,B00100000, - B00000110,B00000010,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan3_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001001,B11110000,B00100000, - B00010001,B11100000,B00010000, - B00010001,B11100000,B00010000, - B00100001,B11100001,B11101000, - B00100000,B11110011,B11101000, - B00100000,B01111111,B11101000, - B00100000,B01110111,B11101000, - B00101000,B11101110,B00101000, - B00101111,B11011100,B00001000, - B00101111,B11111100,B00001000, - B00101111,B10011110,B00001000, - B00101111,B00001111,B00001000, - B00010000,B00001111,B00010000, - B00010000,B00001111,B00010000, - B00001000,B00011111,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111000,B00111111,B00111000, - B00110000,B01111110,B00011000, - B00110000,B01111100,B00011000, - B00101000,B01111100,B00001000, - B00101100,B00111000,B00001000, - B00101111,B00111001,B11001000, - B00101111,B11111111,B11101000, - B00101111,B11000111,B11101000, - B00101111,B11111111,B11101000, - B00100111,B00111001,B11101000, - B00100000,B00111000,B01101000, - B00100000,B01111100,B00101000, - B00110000,B01111100,B00011000, - B00110000,B11111100,B00011000, - B00111001,B11111000,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111000,B00001111,B00111000, - B00110100,B00011111,B11011000, - B00110110,B00011111,B10011000, - B00101111,B00011111,B00001000, - B00101111,B10011110,B00001000, - B00101111,B11111100,B00001000, - B00101111,B11011100,B00001000, - B00100111,B11101111,B11001000, - B00100000,B01110111,B11101000, - B00100000,B01111111,B11101000, - B00100000,B11110011,B11101000, - B00100001,B11110001,B11101000, - B00110011,B11110000,B11011000, - B00110111,B11110000,B01011000, - B00111001,B11100000,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B10000000,B11111000, - B00111001,B10000000,B00111000, - B00110111,B10000001,B11011000, - B00110111,B11000011,B11011000, - B00100111,B11000111,B11101000, - B00100011,B11000111,B11111000, - B00100001,B11111111,B10001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100011,B11111111,B00001000, - B00111111,B11000111,B10001000, - B00101111,B11000111,B11001000, - B00110111,B10000111,B11011000, - B00110111,B00000011,B11011000, - B00111000,B00000011,B00111000, - B00111110,B00000010,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan3_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11100000,B00011000, - B00110001,B11100000,B00011000, - B00100001,B11100001,B11101000, - B00100000,B11110011,B11101000, - B00100000,B01111111,B11101000, - B00100000,B01110111,B11101000, - B00101000,B11101110,B00101000, - B00101111,B11011100,B00001000, - B00101111,B11111100,B00001000, - B00101111,B10011110,B00001000, - B00101111,B00001111,B00001000, - B00110000,B00001111,B00011000, - B00110000,B00001111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - - #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 - #elif HOTENDS - #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 - -// -// Custom Logo Bitmap Properties -// -#ifndef STATUS_LOGO_WIDTH - #define STATUS_LOGO_WIDTH 0 -#endif -#ifndef STATUS_LOGO_BYTEWIDTH - #define STATUS_LOGO_BYTEWIDTH BW(STATUS_LOGO_WIDTH) -#endif -#if STATUS_LOGO_WIDTH - #ifndef STATUS_LOGO_X - #define STATUS_LOGO_X 0 - #endif - #ifndef STATUS_LOGO_Y - #define STATUS_LOGO_Y _MIN(0, 10 - (STATUS_LOGO_HEIGHT) / 2) - #endif - #ifndef STATUS_LOGO_HEIGHT - #define STATUS_LOGO_HEIGHT (sizeof(status_logo_bmp) / (STATUS_LOGO_BYTEWIDTH)) - #endif - static_assert( - sizeof(status_logo_bmp) == (STATUS_LOGO_BYTEWIDTH) * (STATUS_LOGO_HEIGHT), - "Status logo bitmap (status_logo_bmp) dimensions don't match data." - ); -#endif - -// -// Hotend Heater Bitmap starting X position -// -#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 - - // - // Hotend images. A base hotend image and optional "ON" state image. - // - #ifndef STATUS_HOTEND_BITMAPS - #define STATUS_HOTEND_BITMAPS 1 - #endif - - #ifndef STATUS_HOTEND2_WIDTH - #define STATUS_HOTEND2_WIDTH STATUS_HOTEND1_WIDTH - #endif - #ifndef STATUS_HOTEND3_WIDTH - #define STATUS_HOTEND3_WIDTH STATUS_HOTEND2_WIDTH - #endif - #ifndef STATUS_HOTEND4_WIDTH - #define STATUS_HOTEND4_WIDTH STATUS_HOTEND3_WIDTH - #endif - #ifndef STATUS_HOTEND5_WIDTH - #define STATUS_HOTEND5_WIDTH STATUS_HOTEND4_WIDTH - #endif - #ifndef STATUS_HOTEND6_WIDTH - #define STATUS_HOTEND6_WIDTH STATUS_HOTEND5_WIDTH - #endif - - constexpr uint8_t status_hotend_width[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_WIDTH, STATUS_HOTEND2_WIDTH, STATUS_HOTEND3_WIDTH, STATUS_HOTEND4_WIDTH, STATUS_HOTEND5_WIDTH, STATUS_HOTEND6_WIDTH); - #define STATUS_HOTEND_WIDTH(N) status_hotend_width[N] - - #ifndef STATUS_HOTEND1_BYTEWIDTH - #define STATUS_HOTEND1_BYTEWIDTH BW(STATUS_HOTEND1_WIDTH) - #endif - #ifndef STATUS_HOTEND2_BYTEWIDTH - #define STATUS_HOTEND2_BYTEWIDTH BW(STATUS_HOTEND2_WIDTH) - #endif - #ifndef STATUS_HOTEND3_BYTEWIDTH - #define STATUS_HOTEND3_BYTEWIDTH BW(STATUS_HOTEND3_WIDTH) - #endif - #ifndef STATUS_HOTEND4_BYTEWIDTH - #define STATUS_HOTEND4_BYTEWIDTH BW(STATUS_HOTEND4_WIDTH) - #endif - #ifndef STATUS_HOTEND5_BYTEWIDTH - #define STATUS_HOTEND5_BYTEWIDTH BW(STATUS_HOTEND5_WIDTH) - #endif - #ifndef STATUS_HOTEND6_BYTEWIDTH - #define STATUS_HOTEND6_BYTEWIDTH BW(STATUS_HOTEND6_WIDTH) - #endif - - constexpr uint8_t status_hotend_bytewidth[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_BYTEWIDTH, STATUS_HOTEND2_BYTEWIDTH, STATUS_HOTEND3_BYTEWIDTH, STATUS_HOTEND4_BYTEWIDTH, STATUS_HOTEND5_BYTEWIDTH, STATUS_HOTEND6_BYTEWIDTH); - #define STATUS_HOTEND_BYTEWIDTH(N) status_hotend_bytewidth[N] - - #ifndef STATUS_HOTEND1_X - #define STATUS_HOTEND1_X STATUS_HEATERS_X - #endif - #ifndef STATUS_HOTEND2_X - #define STATUS_HOTEND2_X STATUS_HOTEND1_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 - #define STATUS_HOTEND_X(N) ((N) ? STATUS_HOTEND2_X : STATUS_HOTEND1_X) - #else - #define STATUS_HOTEND_X(N) STATUS_HOTEND1_X - #endif - - #ifndef STATUS_HOTEND_TEXT_X - #ifdef STATUS_HOTEND1_TEXT_X - #ifndef STATUS_HOTEND2_TEXT_X - #define STATUS_HOTEND2_TEXT_X STATUS_HOTEND1_TEXT_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND3_TEXT_X - #define STATUS_HOTEND3_TEXT_X STATUS_HOTEND2_TEXT_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND4_TEXT_X - #define STATUS_HOTEND4_TEXT_X STATUS_HOTEND3_TEXT_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND5_TEXT_X - #define STATUS_HOTEND5_TEXT_X STATUS_HOTEND4_TEXT_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND6_TEXT_X - #define STATUS_HOTEND6_TEXT_X STATUS_HOTEND5_TEXT_X + STATUS_HEATERS_XSPACE - #endif - constexpr uint8_t status_hotend_text_x[] = ARRAY_N(HOTENDS, STATUS_HOTEND1_TEXT_X, STATUS_HOTEND2_TEXT_X, STATUS_HOTEND3_TEXT_X, STATUS_HOTEND4_TEXT_X, STATUS_HOTEND5_TEXT_X, STATUS_HOTEND6_TEXT_X); - #define STATUS_HOTEND_TEXT_X(N) status_hotend_text_x[N] - #else - #define STATUS_HOTEND_TEXT_X(N) (STATUS_HOTEND1_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) - #endif - #endif - - #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 - #define TEST_BITMAP_OFF status_hotend_a_bmp - #define TEST_BITMAP_ON status_hotend_b_bmp - #endif - #ifndef STATUS_HEATERS_HEIGHT - #define STATUS_HEATERS_HEIGHT (sizeof(TEST_BITMAP_OFF) / (STATUS_HOTEND1_BYTEWIDTH)) - #endif - #ifndef STATUS_HEATERS_Y - #define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT)) - #endif - - #define HOTEND0_BITMAP_SIZE (STATUS_HOTEND1_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT) - static_assert( - sizeof(TEST_BITMAP_OFF) == HOTEND0_BITMAP_SIZE, - "Status hotend bitmap (" STRINGIFY(TEST_BITMAP_OFF) ") dimensions don't match data." - ); - #ifdef STATUS_HOTEND_ANIM - static_assert( - sizeof(TEST_BITMAP_ON) == HOTEND0_BITMAP_SIZE, - "Status hotend bitmaps (" STRINGIFY(TEST_BITMAP_OFF) " and " STRINGIFY(TEST_BITMAP_ON) ") dimensions don't match." - ); - #endif - -#elif STATUS_HEATERS_WIDTH - - #ifndef STATUS_HEATERS_XSPACE - #define STATUS_HEATERS_XSPACE 24 - #endif - #ifndef STATUS_HOTEND_WIDTH - #define STATUS_HOTEND_WIDTH(N) 10 - #endif - #ifndef STATUS_HOTEND_X - #define STATUS_HOTEND_X(N) (STATUS_HEATERS_X + 2 + (N) * (STATUS_HEATERS_XSPACE)) - #endif - #ifndef STATUS_HOTEND_TEXT_X - #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) - #endif - #ifndef STATUS_HEATERS_HEIGHT - #define STATUS_HEATERS_HEIGHT (sizeof(status_heaters_bmp) / (STATUS_HEATERS_BYTEWIDTH)) - #endif - #ifndef STATUS_HEATERS_Y - #define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT)) - #endif - - static_assert( - sizeof(status_heaters_bmp) == (STATUS_HEATERS_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT), - "Status heaters bitmap (status_heaters_bmp) dimensions don't match data." - ); - -#else // HOTENDS == 0 - - #define STATUS_HOTEND_TEXT_X(N) 0 - #define STATUS_HEATERS_Y 0 - -#endif - -// -// Cutter Bitmap Properties -// -#ifndef STATUS_CUTTER_BYTEWIDTH - #define STATUS_CUTTER_BYTEWIDTH BW(STATUS_CUTTER_WIDTH) -#endif -#if STATUS_CUTTER_WIDTH - - #ifndef STATUS_CUTTER_X - #define STATUS_CUTTER_X (LCD_PIXEL_WIDTH - (STATUS_CUTTER_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH) * 8) - #endif - - #ifndef STATUS_CUTTER_HEIGHT - #ifdef STATUS_CUTTER_ANIM - #define STATUS_CUTTER_HEIGHT(S) ((S) ? sizeof(status_cutter_on_bmp) / (STATUS_CUTTER_BYTEWIDTH) : sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH)) - #else - #define STATUS_CUTTER_HEIGHT(S) (sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH)) - #endif - #endif - - #ifndef STATUS_CUTTER_Y - #define STATUS_CUTTER_Y(S) 4 - #endif - - #ifndef STATUS_CUTTER_TEXT_X - #define STATUS_CUTTER_TEXT_X (STATUS_CUTTER_X -1) - #endif - - #ifndef STATUS_CUTTER_TEXT_Y - #define STATUS_CUTTER_TEXT_Y 28 - #endif - - static_assert( - sizeof(status_cutter_bmp) == (STATUS_CUTTER_BYTEWIDTH) * (STATUS_CUTTER_HEIGHT(0)), - "Status cutter bitmap (status_cutter_bmp) dimensions don't match data." - ); - #ifdef STATUS_CUTTER_ANIM - static_assert( - sizeof(status_cutter_on_bmp) == (STATUS_CUTTER_BYTEWIDTH) * (STATUS_CUTTER_HEIGHT(1)), - "Status cutter bitmap (status_cutter_on_bmp) dimensions don't match data." - ); - #endif - -#endif - -// -// Chamber Bitmap Properties -// -#ifndef STATUS_CHAMBER_BYTEWIDTH - #define STATUS_CHAMBER_BYTEWIDTH BW(STATUS_CHAMBER_WIDTH) -#endif -#if STATUS_CHAMBER_WIDTH - - #ifndef STATUS_CHAMBER_X - #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #endif - - #ifndef STATUS_CHAMBER_HEIGHT - #ifdef STATUS_CHAMBER_ANIM - #define STATUS_CHAMBER_HEIGHT(S) ((S) ? sizeof(status_chamber_on_bmp) / (STATUS_CHAMBER_BYTEWIDTH) : sizeof(status_chamber_bmp) / (STATUS_CHAMBER_BYTEWIDTH)) - #else - #define STATUS_CHAMBER_HEIGHT(S) (sizeof(status_chamber_bmp) / (STATUS_CHAMBER_BYTEWIDTH)) - #endif - #endif - - #ifndef STATUS_CHAMBER_Y - #define STATUS_CHAMBER_Y(S) (20 - STATUS_CHAMBER_HEIGHT(S)) - #endif - - #ifndef STATUS_CHAMBER_TEXT_X - #define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 11) - #endif - - static_assert( - sizeof(status_chamber_bmp) == (STATUS_CHAMBER_BYTEWIDTH) * (STATUS_CHAMBER_HEIGHT(0)), - "Status chamber bitmap (status_chamber_bmp) dimensions don't match data." - ); - #ifdef STATUS_CHAMBER_ANIM - static_assert( - sizeof(status_chamber_on_bmp) == (STATUS_CHAMBER_BYTEWIDTH) * (STATUS_CHAMBER_HEIGHT(1)), - "Status chamber bitmap (status_chamber_on_bmp) dimensions don't match data." - ); - #endif - -#endif - -// -// Bed Bitmap Properties -// -#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 (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) - #endif - - #ifndef STATUS_BED_HEIGHT - #ifdef STATUS_BED_ANIM - #define STATUS_BED_HEIGHT(S) ((S) ? sizeof(status_bed_on_bmp) / (STATUS_BED_BYTEWIDTH) : sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH)) - #else - #define STATUS_BED_HEIGHT(S) (sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH)) - #endif - #endif - - #ifndef STATUS_BED_Y - #define STATUS_BED_Y(S) (20 - STATUS_BED_HEIGHT(S)) - #endif - - #ifndef STATUS_BED_TEXT_X - #define STATUS_BED_TEXT_X (STATUS_BED_X + 9) - #endif - - static_assert( - sizeof(status_bed_bmp) == (STATUS_BED_BYTEWIDTH) * (STATUS_BED_HEIGHT(0)), - "Status bed bitmap (status_bed_bmp) dimensions don't match data." - ); - #ifdef STATUS_BED_ANIM - static_assert( - sizeof(status_bed_on_bmp) == (STATUS_BED_BYTEWIDTH) * (STATUS_BED_HEIGHT(1)), - "Status bed bitmap (status_bed_on_bmp) dimensions don't match data." - ); - #endif -#endif - -// -// Fan Bitmap Properties -// -#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 (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 (STATUS_FAN_X - 1) - #endif - #ifndef STATUS_FAN_TEXT_Y - #define STATUS_FAN_TEXT_Y 28 - #endif - #ifndef STATUS_FAN_HEIGHT - #define STATUS_FAN_HEIGHT (sizeof(status_fan0_bmp) / (STATUS_FAN_BYTEWIDTH)) - #endif - #define FAN_BMP_SIZE (STATUS_FAN_BYTEWIDTH) * (STATUS_FAN_HEIGHT) - static_assert(sizeof(status_fan0_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan0_bmp) dimensions don't match data."); - #if STATUS_FAN_FRAMES > 1 - static_assert(sizeof(status_fan1_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan1_bmp) dimensions don't match data."); - #if STATUS_FAN_FRAMES > 2 - static_assert(sizeof(status_fan2_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan2_bmp) dimensions don't match data."); - #if STATUS_FAN_FRAMES > 3 - static_assert(sizeof(status_fan3_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan3_bmp) dimensions don't match data."); - #endif - #endif - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h deleted file mode 100644 index 42f1606763..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h +++ /dev/null @@ -1,181 +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 - -/** - Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1 - Copyright: Public domain font. Share and enjoy. - Capital A Height: 6, '1' Height: 6 - Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9 - Font Bounding box w= 6 h= 9 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 6 descent=-2 - X Font ascent = 6 descent=-2 - Max Font ascent = 7 descent=-2 -*/ -#include -const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = { - 0, 6, 9, 0, 254, 6, 1, 137, 2, 254, 32, 255, 254, 7, 254, 6, - 254, 0, 0, 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 128, 128, - 128, 0, 128, 3, 3, 3, 6, 1, 3, 160, 160, 160, 5, 7, 7, 6, - 0, 255, 80, 80, 248, 80, 248, 80, 80, 5, 9, 9, 6, 0, 254, 32, - 112, 168, 160, 112, 40, 168, 112, 32, 6, 8, 8, 6, 0, 255, 64, 168, - 72, 16, 32, 72, 84, 8, 5, 7, 7, 6, 0, 255, 96, 144, 144, 96, - 152, 144, 104, 1, 3, 3, 6, 2, 3, 128, 128, 128, 2, 7, 7, 6, - 2, 255, 64, 128, 128, 128, 128, 128, 64, 2, 7, 7, 6, 2, 255, 128, - 64, 64, 64, 64, 64, 128, 5, 5, 5, 6, 0, 0, 136, 80, 248, 80, - 136, 5, 5, 5, 6, 0, 0, 32, 32, 248, 32, 32, 2, 4, 4, 6, - 2, 254, 192, 64, 64, 128, 5, 1, 1, 6, 0, 2, 248, 2, 2, 2, - 6, 2, 0, 192, 192, 4, 6, 6, 6, 1, 0, 16, 16, 32, 64, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 144, 144, 144, 96, 3, 6, 6, - 6, 1, 0, 64, 192, 64, 64, 64, 224, 4, 6, 6, 6, 1, 0, 96, - 144, 16, 32, 64, 240, 4, 6, 6, 6, 1, 0, 240, 32, 96, 16, 16, - 224, 5, 6, 6, 6, 0, 0, 16, 48, 80, 144, 248, 16, 4, 6, 6, - 6, 1, 0, 240, 128, 224, 16, 16, 224, 4, 6, 6, 6, 1, 0, 96, - 128, 224, 144, 144, 96, 4, 6, 6, 6, 1, 0, 240, 16, 16, 32, 64, - 64, 4, 6, 6, 6, 1, 0, 96, 144, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 96, 144, 144, 112, 16, 96, 2, 5, 5, 6, 2, 0, 192, - 192, 0, 192, 192, 2, 7, 7, 6, 2, 254, 192, 192, 0, 192, 64, 64, - 128, 5, 5, 5, 6, 0, 0, 24, 96, 128, 96, 24, 5, 3, 3, 6, - 0, 1, 248, 0, 248, 5, 5, 5, 6, 0, 0, 192, 48, 8, 48, 192, - 4, 7, 7, 6, 1, 0, 96, 144, 16, 96, 64, 0, 64, 5, 6, 6, - 6, 0, 0, 112, 144, 168, 176, 128, 112, 5, 6, 6, 6, 0, 0, 32, - 80, 136, 248, 136, 136, 5, 6, 6, 6, 0, 0, 240, 136, 240, 136, 136, - 240, 4, 6, 6, 6, 1, 0, 96, 144, 128, 128, 144, 96, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 144, 144, 224, 4, 6, 6, 6, 1, 0, 240, - 128, 224, 128, 128, 240, 4, 6, 6, 6, 1, 0, 240, 128, 224, 128, 128, - 128, 4, 6, 6, 6, 1, 0, 96, 144, 128, 176, 144, 96, 4, 6, 6, - 6, 1, 0, 144, 144, 240, 144, 144, 144, 3, 6, 6, 6, 1, 0, 224, - 64, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, 56, 16, 16, 16, 144, - 96, 4, 6, 6, 6, 1, 0, 144, 160, 192, 160, 144, 144, 4, 6, 6, - 6, 1, 0, 128, 128, 128, 128, 128, 240, 5, 6, 6, 6, 0, 0, 136, - 216, 168, 168, 136, 136, 4, 6, 6, 6, 1, 0, 144, 208, 176, 144, 144, - 144, 5, 6, 6, 6, 0, 0, 112, 136, 136, 136, 136, 112, 4, 6, 6, - 6, 1, 0, 224, 144, 144, 224, 128, 128, 4, 7, 7, 6, 1, 255, 96, - 144, 144, 208, 176, 96, 16, 4, 6, 6, 6, 1, 0, 224, 144, 144, 224, - 144, 144, 4, 6, 6, 6, 1, 0, 96, 144, 64, 32, 144, 96, 5, 6, - 6, 6, 0, 0, 248, 32, 32, 32, 32, 32, 4, 6, 6, 6, 1, 0, - 144, 144, 144, 144, 144, 96, 4, 6, 6, 6, 1, 0, 144, 144, 144, 240, - 96, 96, 5, 6, 6, 6, 0, 0, 136, 136, 168, 168, 216, 136, 5, 6, - 6, 6, 0, 0, 136, 80, 32, 32, 80, 136, 5, 6, 6, 6, 0, 0, - 136, 136, 80, 32, 32, 32, 4, 6, 6, 6, 1, 0, 240, 16, 32, 64, - 128, 240, 3, 6, 6, 6, 1, 0, 224, 128, 128, 128, 128, 224, 4, 6, - 6, 6, 1, 0, 128, 128, 64, 32, 16, 16, 3, 6, 6, 6, 1, 0, - 224, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 3, 32, 80, 136, 5, - 1, 1, 6, 0, 254, 248, 2, 2, 2, 6, 2, 4, 128, 64, 4, 4, - 4, 6, 1, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, 128, 128, - 224, 144, 144, 224, 4, 4, 4, 6, 1, 0, 112, 128, 128, 112, 4, 6, - 6, 6, 1, 0, 16, 16, 112, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 96, 176, 192, 112, 4, 6, 6, 6, 1, 0, 32, 80, 64, 224, 64, 64, - 4, 6, 6, 6, 1, 254, 96, 144, 144, 112, 16, 96, 4, 6, 6, 6, - 1, 0, 128, 128, 224, 144, 144, 144, 3, 6, 6, 6, 1, 0, 64, 0, - 192, 64, 64, 224, 3, 8, 8, 6, 1, 254, 32, 0, 96, 32, 32, 32, - 160, 64, 4, 6, 6, 6, 1, 0, 128, 128, 160, 192, 160, 144, 3, 6, - 6, 6, 1, 0, 192, 64, 64, 64, 64, 224, 5, 4, 4, 6, 0, 0, - 208, 168, 168, 136, 4, 4, 4, 6, 1, 0, 224, 144, 144, 144, 4, 4, - 4, 6, 1, 0, 96, 144, 144, 96, 4, 6, 6, 6, 1, 254, 224, 144, - 144, 224, 128, 128, 4, 6, 6, 6, 1, 254, 112, 144, 144, 112, 16, 16, - 4, 4, 4, 6, 1, 0, 160, 208, 128, 128, 4, 4, 4, 6, 1, 0, - 112, 192, 48, 224, 4, 6, 6, 6, 1, 0, 64, 64, 224, 64, 80, 32, - 4, 4, 4, 6, 1, 0, 144, 144, 144, 112, 4, 4, 4, 6, 1, 0, - 144, 144, 96, 96, 5, 4, 4, 6, 0, 0, 136, 168, 168, 80, 4, 4, - 4, 6, 1, 0, 144, 96, 96, 144, 4, 6, 6, 6, 1, 254, 144, 144, - 144, 112, 144, 96, 4, 4, 4, 6, 1, 0, 240, 32, 64, 240, 3, 7, - 7, 6, 1, 0, 32, 64, 64, 128, 64, 64, 32, 1, 7, 7, 6, 2, - 255, 128, 128, 128, 128, 128, 128, 128, 3, 7, 7, 6, 1, 0, 128, 64, - 64, 32, 64, 64, 128, 4, 2, 2, 6, 1, 3, 80, 160, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, - 0, 6, 0, 7, 1, 6, 6, 6, 2, 0, 128, 0, 128, 128, 128, 128, - 4, 6, 6, 6, 1, 255, 32, 112, 160, 160, 112, 32, 5, 7, 7, 6, - 0, 255, 48, 72, 64, 240, 64, 64, 248, 5, 5, 5, 6, 0, 0, 168, - 80, 136, 80, 168, 5, 6, 6, 6, 0, 0, 136, 80, 248, 32, 248, 32, - 1, 7, 7, 6, 2, 255, 128, 128, 128, 0, 128, 128, 128, 4, 7, 7, - 6, 1, 255, 112, 128, 96, 144, 96, 16, 224, 3, 1, 1, 6, 1, 5, - 160, 6, 7, 7, 6, 0, 0, 120, 132, 148, 164, 148, 132, 120, 3, 5, - 5, 6, 1, 1, 96, 160, 96, 0, 224, 5, 5, 5, 6, 0, 0, 40, - 80, 160, 80, 40, 4, 3, 3, 6, 1, 0, 240, 16, 16, 4, 1, 1, - 6, 1, 2, 240, 6, 7, 7, 6, 0, 0, 120, 132, 180, 164, 164, 132, - 120, 4, 1, 1, 6, 1, 5, 240, 4, 3, 3, 6, 1, 2, 96, 144, - 96, 5, 7, 7, 6, 0, 255, 32, 32, 248, 32, 32, 0, 248, 3, 5, - 5, 6, 1, 1, 64, 160, 32, 64, 224, 3, 5, 5, 6, 1, 1, 192, - 32, 64, 32, 192, 2, 2, 2, 6, 2, 4, 64, 128, 4, 5, 5, 6, - 1, 255, 144, 144, 176, 208, 128, 5, 6, 6, 6, 0, 0, 120, 232, 232, - 104, 40, 40, 1, 1, 1, 6, 2, 2, 128, 2, 2, 2, 6, 2, 254, - 64, 128, 3, 5, 5, 6, 1, 1, 64, 192, 64, 64, 224, 3, 5, 5, - 6, 1, 1, 64, 160, 64, 0, 224, 5, 5, 5, 6, 0, 0, 160, 80, - 40, 80, 160, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 112, 48, 120, - 16, 5, 8, 8, 6, 0, 255, 64, 192, 64, 80, 104, 8, 16, 56, 5, - 8, 8, 6, 0, 255, 192, 32, 64, 48, 240, 48, 120, 16, 4, 7, 7, - 6, 1, 0, 32, 0, 32, 96, 128, 144, 96, 5, 7, 7, 6, 0, 0, - 64, 32, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 16, 32, 32, - 80, 112, 136, 136, 5, 7, 7, 6, 0, 0, 32, 80, 32, 80, 112, 136, - 136, 5, 7, 7, 6, 0, 0, 40, 80, 32, 80, 112, 136, 136, 5, 7, - 7, 6, 0, 0, 80, 0, 32, 80, 112, 136, 136, 5, 7, 7, 6, 0, - 0, 32, 80, 32, 80, 112, 136, 136, 5, 6, 6, 6, 0, 0, 120, 160, - 240, 160, 160, 184, 4, 8, 8, 6, 1, 254, 96, 144, 128, 128, 144, 96, - 32, 64, 4, 7, 7, 6, 1, 0, 64, 32, 240, 128, 224, 128, 240, 4, - 7, 7, 6, 1, 0, 32, 64, 240, 128, 224, 128, 240, 4, 7, 7, 6, - 1, 0, 32, 80, 240, 128, 224, 128, 240, 4, 7, 7, 6, 1, 0, 80, - 0, 240, 128, 224, 128, 240, 3, 7, 7, 6, 1, 0, 128, 64, 224, 64, - 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, 64, 224, 64, 64, 64, 224, - 3, 7, 7, 6, 1, 0, 64, 160, 224, 64, 64, 64, 224, 3, 7, 7, - 6, 1, 0, 160, 0, 224, 64, 64, 64, 224, 5, 6, 6, 6, 0, 0, - 112, 72, 232, 72, 72, 112, 4, 7, 7, 6, 1, 0, 80, 160, 144, 208, - 176, 144, 144, 4, 7, 7, 6, 1, 0, 64, 32, 96, 144, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 32, 64, 96, 144, 144, 144, 96, 4, 7, 7, - 6, 1, 0, 32, 80, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 80, 160, 96, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 96, - 144, 144, 144, 96, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 4, - 8, 8, 6, 1, 255, 16, 112, 176, 176, 208, 208, 224, 128, 4, 7, 7, - 6, 1, 0, 64, 32, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, - 32, 64, 144, 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 144, - 144, 144, 144, 96, 4, 7, 7, 6, 1, 0, 80, 0, 144, 144, 144, 144, - 96, 5, 7, 7, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32, 4, 6, - 6, 6, 1, 0, 128, 224, 144, 144, 224, 128, 4, 6, 6, 6, 1, 0, - 96, 144, 160, 160, 144, 160, 4, 7, 7, 6, 1, 0, 64, 32, 0, 112, - 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 112, 144, 144, 112, - 4, 7, 7, 6, 1, 0, 32, 80, 0, 112, 144, 144, 112, 4, 7, 7, - 6, 1, 0, 80, 160, 0, 112, 144, 144, 112, 4, 6, 6, 6, 1, 0, - 80, 0, 112, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, 32, 112, - 144, 144, 112, 5, 4, 4, 6, 0, 0, 112, 168, 176, 120, 4, 6, 6, - 6, 1, 254, 112, 128, 128, 112, 32, 64, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 176, 192, 112, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 176, 192, 112, - 4, 6, 6, 6, 1, 0, 80, 0, 96, 176, 192, 112, 3, 7, 7, 6, - 1, 0, 128, 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 32, - 64, 0, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0, 64, 160, 0, 192, - 64, 64, 224, 3, 6, 6, 6, 1, 0, 160, 0, 192, 64, 64, 224, 4, - 7, 7, 6, 1, 0, 48, 96, 16, 112, 144, 144, 96, 4, 7, 7, 6, - 1, 0, 80, 160, 0, 224, 144, 144, 144, 4, 7, 7, 6, 1, 0, 64, - 32, 0, 96, 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 64, 0, 96, - 144, 144, 96, 4, 7, 7, 6, 1, 0, 32, 80, 0, 96, 144, 144, 96, - 4, 7, 7, 6, 1, 0, 80, 160, 0, 96, 144, 144, 96, 4, 6, 6, - 6, 1, 0, 80, 0, 96, 144, 144, 96, 5, 5, 5, 6, 0, 0, 32, - 0, 248, 0, 32, 4, 4, 4, 6, 1, 0, 112, 176, 208, 224, 4, 7, - 7, 6, 1, 0, 64, 32, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, - 0, 32, 64, 0, 144, 144, 144, 112, 4, 7, 7, 6, 1, 0, 32, 80, - 0, 144, 144, 144, 112, 4, 6, 6, 6, 1, 0, 80, 0, 144, 144, 144, - 112, 4, 9, 9, 6, 1, 254, 32, 64, 0, 144, 144, 144, 112, 144, 96, - 4, 8, 8, 6, 1, 254, 128, 128, 224, 144, 144, 224, 128, 128, 4, 8, - 8, 6, 1, 254, 80, 0, 144, 144, 144, 112, 144, 96 -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h deleted file mode 100644 index be304b1a14..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h +++ /dev/null @@ -1,301 +0,0 @@ -/** - * 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 . - * - */ -#include - -#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7) - // reduced font (only symbols 1 - 127) - saves about 1278 bytes of FLASH - -/* - Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1 - Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 5 h=10 x= 5 y= 5 dx= 6 dy= 0 ascent= 8 len=10 - Font Bounding box w=12 h=13 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-2 - X Font ascent = 8 descent=-2 - Max Font ascent = 8 descent=-2 -*/ -const u8g_fntpgm_uint8_t ISO10646_1_5x7[1325] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0x7f,0xfe,0x08,0xfe,0x08, - 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, - 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, - 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, - 0xf8,0x20,0x20,0x20,0x20,0xe0,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8,0xa8, - 0xb8,0x88,0x88,0x70,0x20,0x05,0x06,0x06,0x06,0x00,0x01,0xe0,0x8c,0xea,0x8c,0x8a, - 0x0a,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88,0x88,0xa8,0xf8, - 0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8,0xa8,0x88,0x70, - 0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00, - 0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80, - 0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06,0x06,0x06,0x00, - 0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8, - 0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8,0xc8,0x10,0x20, - 0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40,0xa8,0x90,0x68, - 0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x20, - 0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40, - 0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xa8,0x70, - 0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8,0x20,0x20,0x02, - 0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xf8,0x02, - 0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10, - 0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xa8,0xc8,0x88, - 0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, - 0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30, - 0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0xf0,0x08,0x08, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0,0xc0,0x00,0xc0, - 0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80,0x03,0x05,0x05, - 0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xf8,0x00, - 0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8, - 0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, - 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80, - 0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88, - 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x03,0x07, - 0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00, - 0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90, - 0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80, - 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf0, - 0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88, - 0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90,0x88, - 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00, - 0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, - 0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xa8,0xa8, - 0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40, - 0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06, - 0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06, - 0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0, - 0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06, - 0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40, - 0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88,0x88,0x78,0x08, - 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x03,0x07, - 0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09,0x09,0x06,0x01, - 0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xc0,0x40,0x40, - 0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0x05, - 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00, - 0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0, - 0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05, - 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, - 0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, - 0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05, - 0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88, - 0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07, - 0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00, - 0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20,0x40,0x40,0x40, - 0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40,0x40,0x20,0x40, - 0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,0xff}; -#else - // extended (original) font (symbols 1 - 255) - -/* - Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1 - Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 - Capital A Height: 7, '1' Height: 7 - Calculated Max Values w= 6 h=10 x= 5 y= 7 dx= 6 dy= 0 ascent=10 len=10 - Font Bounding box w=12 h=13 x= 0 y=-2 - Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 - Pure Font ascent = 7 descent=-2 - X Font ascent = 8 descent=-2 - Max Font ascent =10 descent=-2 -*/ -const u8g_fntpgm_uint8_t ISO10646_1_5x7[2648] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0xff,0xfe,0x0a,0xfe,0x08, - 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, - 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, - 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, - 0xf8,0x20,0x20,0x20,0x20,0xe0,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8,0xa8, - 0xb8,0x88,0x88,0x70,0x20,0x05,0x06,0x06,0x06,0x00,0x01,0xe0,0x8c,0xea,0x8c,0x8a, - 0x0a,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88,0x88,0xa8,0xf8, - 0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8,0xa8,0x88,0x70, - 0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00, - 0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80, - 0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06,0x06,0x06,0x00, - 0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8, - 0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8,0xc8,0x10,0x20, - 0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40,0xa8,0x90,0x68, - 0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x20, - 0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40, - 0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xa8,0x70, - 0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8,0x20,0x20,0x02, - 0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xf8,0x02, - 0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10, - 0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xa8,0xc8,0x88, - 0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, - 0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30, - 0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0xf0,0x08,0x08, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0,0xc0,0x00,0xc0, - 0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80,0x03,0x05,0x05, - 0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xf8,0x00, - 0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8, - 0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, - 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80, - 0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88, - 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x03,0x07, - 0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00, - 0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90, - 0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80, - 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf0, - 0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88, - 0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90,0x88, - 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00, - 0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, - 0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xa8,0xa8, - 0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40, - 0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06, - 0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06, - 0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0, - 0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06, - 0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40, - 0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88,0x88,0x78,0x08, - 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x03,0x07, - 0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09,0x09,0x06,0x01, - 0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xc0,0x40,0x40, - 0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0x05, - 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00, - 0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0, - 0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05, - 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, - 0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, - 0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05, - 0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88, - 0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07, - 0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00, - 0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20,0x40,0x40,0x40, - 0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40,0x40,0x20,0x40, - 0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00, - 0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80, - 0x05,0x07,0x07,0x06,0x00,0xff,0x20,0x70,0xa8,0xa0,0xa8,0x70,0x20,0x05,0x07,0x07, - 0x06,0x00,0x00,0x30,0x48,0x40,0xe0,0x40,0x48,0xb0,0x05,0x05,0x05,0x06,0x00,0x00, - 0xa8,0x50,0x88,0x50,0xa8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x50,0xf8,0x20,0xf8, - 0x20,0x20,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x04, - 0x08,0x08,0x06,0x01,0x00,0x70,0x80,0x60,0x90,0x90,0x60,0x10,0xe0,0x03,0x01,0x01, - 0x06,0x01,0x07,0xa0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xb4,0xa4,0xb4,0x84, - 0x78,0x03,0x05,0x05,0x06,0x01,0x04,0x60,0xa0,0x60,0x00,0xe0,0x05,0x05,0x05,0x06, - 0x00,0x00,0x28,0x50,0xa0,0x50,0x28,0x05,0x03,0x03,0x06,0x00,0x01,0xf8,0x08,0x08, - 0x03,0x01,0x01,0x06,0x01,0x03,0xe0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xb4, - 0xa4,0xa4,0x84,0x78,0x05,0x01,0x01,0x06,0x00,0x07,0xf8,0x04,0x04,0x04,0x06,0x01, - 0x05,0x60,0x90,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, - 0x00,0xf8,0x03,0x05,0x05,0x06,0x01,0x04,0x40,0xa0,0x20,0x40,0xe0,0x03,0x05,0x05, - 0x06,0x01,0x04,0xc0,0x20,0x40,0x20,0xc0,0x03,0x03,0x03,0x06,0x01,0x05,0x20,0x40, - 0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x08, - 0x08,0x06,0x00,0x00,0x78,0xe8,0xe8,0xe8,0x68,0x28,0x28,0x28,0x02,0x02,0x02,0x06, - 0x02,0x03,0xc0,0xc0,0x03,0x02,0x02,0x06,0x01,0xfe,0x20,0xc0,0x03,0x05,0x05,0x06, - 0x01,0x04,0x40,0xc0,0x40,0x40,0xe0,0x03,0x05,0x05,0x06,0x01,0x05,0x40,0xa0,0x40, - 0x00,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xa0,0x50,0x28,0x50,0xa0,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xb0,0x50,0x78,0x10,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xa8,0x08,0x10,0x38,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0xc0,0x20,0x48,0x30,0xe0,0x50,0xb0,0x50,0x78,0x10,0x05,0x07,0x07, - 0x06,0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00, - 0x40,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, - 0x10,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, - 0x20,0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, - 0x68,0xb0,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00, - 0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20, - 0x50,0x20,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x78, - 0xa0,0xa0,0xf0,0xa0,0xa0,0xb8,0x05,0x09,0x09,0x06,0x00,0xfe,0x70,0x88,0x80,0x80, - 0x80,0x88,0x70,0x10,0x60,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0xf8,0x80, - 0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0xf8,0x80, - 0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50,0x00,0xf8,0x80, - 0x80,0xf0,0x80,0x80,0xf8,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0xf8,0x80,0x80, - 0xf0,0x80,0x80,0xf8,0x03,0x0a,0x0a,0x06,0x01,0x00,0x80,0x40,0x00,0xe0,0x40,0x40, - 0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x20,0x40,0x00,0xe0,0x40,0x40, - 0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x40,0xa0,0x00,0xe0,0x40,0x40, - 0x40,0x40,0x40,0xe0,0x03,0x09,0x09,0x06,0x01,0x00,0xa0,0x00,0xe0,0x40,0x40,0x40, - 0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x48,0x48,0xe8,0x48,0x48,0x70, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, - 0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05, - 0x05,0x05,0x06,0x00,0x01,0x88,0x50,0x20,0x50,0x88,0x05,0x09,0x09,0x06,0x00,0xff, - 0x08,0x70,0x98,0xa8,0xa8,0xa8,0xc8,0x70,0x80,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40, - 0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10, - 0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20, - 0x50,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x50, - 0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20, - 0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x04,0x07,0x07,0x06,0x01,0x00,0x80,0xe0, - 0x90,0x90,0x90,0xe0,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x90,0xa0,0x90, - 0x88,0xb0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x08,0x78,0x88,0x78, - 0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08, - 0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06, - 0x00,0x00,0x68,0xb0,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00, - 0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x20, - 0x70,0x08,0x78,0x88,0x78,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x28,0x70,0xa0,0x78, - 0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x80,0x88,0x70,0x10,0x60,0x05,0x08,0x08, - 0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08,0x08,0x06,0x00, - 0x00,0x10,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20, - 0x50,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70, - 0x88,0xf0,0x80,0x70,0x03,0x08,0x08,0x06,0x01,0x00,0x80,0x40,0x00,0xc0,0x40,0x40, - 0x40,0xe0,0x03,0x08,0x08,0x06,0x01,0x00,0x20,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0, - 0x03,0x08,0x08,0x06,0x01,0x00,0x40,0xa0,0x00,0xc0,0x40,0x40,0x40,0xe0,0x03,0x07, - 0x07,0x06,0x01,0x00,0xa0,0x00,0xc0,0x40,0x40,0x40,0xe0,0x05,0x09,0x09,0x06,0x00, - 0x00,0x50,0x20,0x50,0x08,0x78,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00, - 0x68,0xb0,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20, - 0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70, - 0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88, - 0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05, - 0x06,0x00,0x01,0x20,0x00,0xf8,0x00,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x98, - 0xa8,0xc8,0xf0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x70,0x05, - 0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07, - 0x06,0x00,0x00,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0xfe, - 0x10,0x20,0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x09,0x09,0x06,0x00,0xfe, - 0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x05,0x09,0x09,0x06,0x00,0xfe,0x50, - 0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80}; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_an.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_an.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_an.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_bg.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_bg.h deleted file mode 100644 index 81444d9969..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_bg.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_8_144_149[96] U8G_FONT_SECTION("fontpage_8_144_149") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x95,0x00,0x07,0xff,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf0,0x80,0x80,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80, - 0x80,0x80,0x80,0x80,0x80,0x05,0x08,0x08,0x06,0x00,0xff,0x30,0x50,0x50,0x50,0x50, - 0x50,0xf8,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8 - }; -const u8g_fntpgm_uint8_t fontpage_8_151_152[43] U8G_FONT_SECTION("fontpage_8_151_152") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x98,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x70,0x08,0x88,0x70,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_8_154_164[160] U8G_FONT_SECTION("fontpage_8_154_164") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0xa4,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x48,0x48,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88, - 0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8, - 0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88, - 0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0xa8,0xa8,0xa8,0x70,0x20 - }; -const u8g_fntpgm_uint8_t fontpage_8_166_166[32] U8G_FONT_SECTION("fontpage_8_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x09,0x09,0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0x90,0x90,0xf8,0x08,0x08 - }; -const u8g_fntpgm_uint8_t fontpage_8_175_195[260] U8G_FONT_SECTION("fontpage_8_175_195") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xc3,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x78,0x88,0x88,0x78,0x28,0x48,0x88,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x80,0xf0,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf0,0x88,0xf0,0x88, - 0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x80,0x80,0x80,0x80,0x05,0x06,0x06,0x06, - 0x00,0xff,0x30,0x50,0x50,0x50,0xf8,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88, - 0xf0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0x70,0x20,0x70,0xa8,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x88,0x30,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x88, - 0x98,0xa8,0xc8,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x88,0x98,0xa8, - 0xc8,0x88,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05,0x05,0x05, - 0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0xd8, - 0xa8,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xf8,0x88,0x88,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8, - 0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0,0x80, - 0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88, - 0x88,0x78,0x08,0x70}; -const u8g_fntpgm_uint8_t fontpage_8_197_200[63] U8G_FONT_SECTION("fontpage_8_197_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc8,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07,0x07,0x06, - 0x00,0xfe,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0x88, - 0x88,0x78,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0xa8,0xa8,0xa8,0xf8}; -const u8g_fntpgm_uint8_t fontpage_8_202_202[28] U8G_FONT_SECTION("fontpage_8_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xc0,0x40,0x70,0x48,0x70}; -const u8g_fntpgm_uint8_t fontpage_8_206_207[39] U8G_FONT_SECTION("fontpage_8_206_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xce,0xcf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xa8,0xe8,0xa8,0x90,0x04,0x05,0x05,0x06, - 0x01,0x00,0x70,0x90,0x70,0x50,0x90}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(8, 144, 149, fontpage_8_144_149), // 'А' -- 'Е' - FONTDATA_ITEM(8, 151, 152, fontpage_8_151_152), // 'З' -- 'И' - FONTDATA_ITEM(8, 154, 164, fontpage_8_154_164), // 'К' -- 'Ф' - FONTDATA_ITEM(8, 166, 166, fontpage_8_166_166), // 'Ц' -- 'Ц' - FONTDATA_ITEM(8, 175, 195, fontpage_8_175_195), // 'Я' -- 'у' - FONTDATA_ITEM(8, 197, 200, fontpage_8_197_200), // 'х' -- 'ш' - FONTDATA_ITEM(8, 202, 202, fontpage_8_202_202), // 'ъ' -- 'ъ' - FONTDATA_ITEM(8, 206, 207, fontpage_8_206_207), // 'ю' -- 'я' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ca.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ca.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ca.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_cz.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_cz.h deleted file mode 100644 index e132dc8160..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_cz.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_140_141[47] U8G_FONT_SECTION("fontpage_2_140_141") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8d,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x80,0x80,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_143_143[33] U8G_FONT_SECTION("fontpage_2_143_143") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8f,0x8f,0x00,0x0a,0x00,0x00, - 0x00,0x06,0x0a,0x0a,0x06,0x00,0x00,0x14,0x08,0x00,0x08,0x08,0x78,0x88,0x88,0x88, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_2_155_155[31] U8G_FONT_SECTION("fontpage_2_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0xf0,0x80,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_200_200[31] U8G_FONT_SECTION("fontpage_2_200_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_2_216_217[47] U8G_FONT_SECTION("fontpage_2_216_217") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd9,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90, - 0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xb0,0xc8,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_2_225_225[31] U8G_FONT_SECTION("fontpage_2_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x78,0x80,0x70,0x08,0xf0}; -const u8g_fntpgm_uint8_t fontpage_2_229_229[33] U8G_FONT_SECTION("fontpage_2_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x20,0x20,0xf8,0x20,0x20,0x20, - 0x18}; -const u8g_fntpgm_uint8_t fontpage_2_239_239[31] U8G_FONT_SECTION("fontpage_2_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x20,0x88,0x88,0x88,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253_254") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfe,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x08,0x10,0x20,0x40,0x80, - 0xf8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č' - FONTDATA_ITEM(2, 143, 143, fontpage_2_143_143), // 'ď' -- 'ď' - FONTDATA_ITEM(2, 155, 155, fontpage_2_155_155), // 'ě' -- 'ě' - FONTDATA_ITEM(2, 200, 200, fontpage_2_200_200), // 'ň' -- 'ň' - FONTDATA_ITEM(2, 216, 217, fontpage_2_216_217), // 'Ř' -- 'ř' - FONTDATA_ITEM(2, 225, 225, fontpage_2_225_225), // 'š' -- 'š' - FONTDATA_ITEM(2, 229, 229, fontpage_2_229_229), // 'ť' -- 'ť' - FONTDATA_ITEM(2, 239, 239, fontpage_2_239_239), // 'ů' -- 'ů' - FONTDATA_ITEM(2, 253, 254, fontpage_2_253_254), // 'Ž' -- 'ž' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_da.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_da.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_da.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_de.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_de.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_de.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el.h deleted file mode 100644 index 858ec0f84f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x80,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80, - 0xf8}; -const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_145_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x9d,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20, - 0x50,0x50,0x88,0x88,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80, - 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x05, - 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0xe0, - 0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xa0,0xc0, - 0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,0x88,0x88, - 0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05,0x07,0x07, - 0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_159_161[56] U8G_FONT_SECTION("fontpage_7_159_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0xa1,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_7_163_167[82] U8G_FONT_SECTION("fontpage_7_163_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa7,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x40,0x20,0x10,0x20,0x40,0xf8,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70, - 0xa8,0xa8,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50, - 0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_169_169[30] U8G_FONT_SECTION("fontpage_7_169_169") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x50,0xd8}; -const u8g_fntpgm_uint8_t fontpage_7_172_175[75] U8G_FONT_SECTION("fontpage_7_172_175") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xaf,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x68,0x90,0x90,0x90,0x68,0x05, - 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x60,0x88,0x70,0x05,0x0a,0x0a, - 0x06,0x00,0xfe,0x10,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x03,0x08,0x08, - 0x06,0x01,0x00,0x40,0x80,0x00,0x80,0x80,0x80,0xa0,0x40}; -const u8g_fntpgm_uint8_t fontpage_7_177_181[80] U8G_FONT_SECTION("fontpage_7_177_181") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb5,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x68,0x90,0x90,0x90,0x68,0x05,0x09,0x09,0x06, - 0x00,0xfe,0x60,0x90,0x90,0xb0,0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00, - 0xfe,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x80, - 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_183_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xc7,0x00,0x09,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07, - 0x07,0x06,0x01,0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02, - 0x00,0x80,0x80,0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0, - 0x90,0x05,0x09,0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88, - 0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05, - 0x06,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20, - 0x40,0x70,0x80,0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88, - 0x88,0x70,0x06,0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07, - 0x06,0x00,0xfe,0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe, - 0x70,0x88,0x80,0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88, - 0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05, - 0x06,0x00,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8, - 0xa8,0xa8,0x70,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50, - 0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_201_201[28] U8G_FONT_SECTION("fontpage_7_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x50,0x88,0xa8,0xa8,0x50}; -const u8g_fntpgm_uint8_t fontpage_7_204_206[59] U8G_FONT_SECTION("fontpage_7_204_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xce,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x70,0x05, - 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x08,0x08, - 0x06,0x00,0x00,0x10,0x20,0x00,0x50,0x88,0xa8,0xa8,0x50}; -const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x01,0x00,0x00, - 0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xa8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ' - FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν' - FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ' - FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ' - FONTDATA_ITEM(7, 169, 169, fontpage_7_169_169), // 'Ω' -- 'Ω' - FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί' - FONTDATA_ITEM(7, 177, 181, fontpage_7_177_181), // 'α' -- 'ε' - FONTDATA_ITEM(7, 183, 199, fontpage_7_183_199), // 'η' -- 'χ' - FONTDATA_ITEM(7, 201, 201, fontpage_7_201_201), // 'ω' -- 'ω' - FONTDATA_ITEM(7, 204, 206, fontpage_7_204_206), // 'ό' -- 'ώ' - FONTDATA_ITEM(64, 166, 166, fontpage_64_166_166), // '…' -- '…' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h deleted file mode 100644 index 76a5c66cd9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x80,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80, - 0xf8}; -const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_145_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x9d,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20, - 0x50,0x50,0x88,0x88,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80, - 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x05, - 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0xe0, - 0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xa0,0xc0, - 0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,0x88,0x88, - 0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05,0x07,0x07, - 0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_159_161[56] U8G_FONT_SECTION("fontpage_7_159_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0xa1,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_7_163_167[82] U8G_FONT_SECTION("fontpage_7_163_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa7,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x40,0x20,0x10,0x20,0x40,0xf8,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70, - 0xa8,0xa8,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50, - 0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_172_175[75] U8G_FONT_SECTION("fontpage_7_172_175") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xaf,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x68,0x90,0x90,0x90,0x68,0x05, - 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x60,0x88,0x70,0x05,0x0a,0x0a, - 0x06,0x00,0xfe,0x10,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x03,0x08,0x08, - 0x06,0x01,0x00,0x40,0x80,0x00,0x80,0x80,0x80,0xa0,0x40}; -const u8g_fntpgm_uint8_t fontpage_7_177_181[80] U8G_FONT_SECTION("fontpage_7_177_181") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb5,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x68,0x90,0x90,0x90,0x68,0x05,0x09,0x09,0x06, - 0x00,0xfe,0x60,0x90,0x90,0xb0,0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00, - 0xfe,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x80, - 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_183_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xc7,0x00,0x09,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07, - 0x07,0x06,0x01,0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02, - 0x00,0x80,0x80,0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0, - 0x90,0x05,0x09,0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88, - 0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05, - 0x06,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20, - 0x40,0x70,0x80,0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88, - 0x88,0x70,0x06,0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07, - 0x06,0x00,0xfe,0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe, - 0x70,0x88,0x80,0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88, - 0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05, - 0x06,0x00,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8, - 0xa8,0xa8,0x70,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50, - 0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_7_201_201[28] U8G_FONT_SECTION("fontpage_7_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x50,0x88,0xa8,0xa8,0x50}; -const u8g_fntpgm_uint8_t fontpage_7_204_206[59] U8G_FONT_SECTION("fontpage_7_204_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xce,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x70,0x05, - 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x08,0x08, - 0x06,0x00,0x00,0x10,0x20,0x00,0x50,0x88,0xa8,0xa8,0x50}; -const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x01,0x00,0x00, - 0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xa8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ' - FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν' - FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ' - FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ' - FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί' - FONTDATA_ITEM(7, 177, 181, fontpage_7_177_181), // 'α' -- 'ε' - FONTDATA_ITEM(7, 183, 199, fontpage_7_183_199), // 'η' -- 'χ' - FONTDATA_ITEM(7, 201, 201, fontpage_7_201_201), // 'ω' -- 'ω' - FONTDATA_ITEM(7, 204, 206, fontpage_7_204_206), // 'ό' -- 'ώ' - FONTDATA_ITEM(64, 166, 166, fontpage_64_166_166), // '…' -- '…' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_en.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_en.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_en.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_es.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_es.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_es.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_eu.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_eu.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_eu.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fi.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fi.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fr.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_fr.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_gl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_gl.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_gl.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_hr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_hr.h deleted file mode 100644 index 63fea945b2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_hr.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_135_135[31] U8G_FONT_SECTION("fontpage_2_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x80,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_140_141[47] U8G_FONT_SECTION("fontpage_2_140_141") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8d,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x80,0x80,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_145_145[31] U8G_FONT_SECTION("fontpage_2_145_145") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x08,0x00,0x00, - 0x00,0x06,0x08,0x08,0x06,0x00,0x00,0x08,0x1c,0x08,0x78,0x88,0x88,0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_2_225_225[31] U8G_FONT_SECTION("fontpage_2_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x78,0x80,0x70,0x08,0xf0}; -const u8g_fntpgm_uint8_t fontpage_2_254_254[31] U8G_FONT_SECTION("fontpage_2_254_254") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć' - FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č' - FONTDATA_ITEM(2, 145, 145, fontpage_2_145_145), // 'đ' -- 'đ' - FONTDATA_ITEM(2, 225, 225, fontpage_2_225_225), // 'š' -- 'š' - FONTDATA_ITEM(2, 254, 254, fontpage_2_254_254), // 'ž' -- 'ž' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_it.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_it.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_it.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h deleted file mode 100644 index 97d82c0293..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_97_161_164[65] U8G_FONT_SECTION("fontpage_97_161_164") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa4,0x00,0x07,0x00,0x00, - 0x00,0x04,0x05,0x05,0x06,0x00,0x00,0xf0,0x10,0x60,0x40,0x80,0x05,0x07,0x07,0x06, - 0x00,0x00,0xf8,0x08,0x28,0x30,0x20,0x20,0x40,0x04,0x05,0x05,0x06,0x00,0x00,0x10, - 0x20,0x60,0xa0,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x20,0x60,0xa0,0x20, - 0x20}; -const u8g_fntpgm_uint8_t fontpage_97_166_166[30] U8G_FONT_SECTION("fontpage_97_166_166") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xf8,0x88,0x88,0x08,0x10,0x60}; -const u8g_fntpgm_uint8_t fontpage_97_168_168[29] U8G_FONT_SECTION("fontpage_97_168_168") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x06,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0xf8}; -const u8g_fntpgm_uint8_t fontpage_97_170_187[268] U8G_FONT_SECTION("fontpage_97_170_187") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xbb,0x00,0x0d,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0xf8,0x10,0x30,0x50,0x90,0x10,0x05,0x07, - 0x07,0x06,0x00,0x00,0x40,0xf8,0x48,0x48,0x48,0x48,0x98,0x05,0x09,0x09,0x06,0x00, - 0x00,0x28,0x08,0x40,0xf8,0x48,0x48,0x48,0x48,0x98,0x05,0x07,0x07,0x06,0x00,0x00, - 0x20,0xf8,0x20,0x20,0xf8,0x10,0x10,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x20, - 0xf8,0x20,0x20,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x78,0x48,0x88, - 0x08,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x40,0x78,0x48,0x88,0x08, - 0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0xf8,0x90,0x90,0x10,0x10,0x20,0x05, - 0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x80,0xf8,0x90,0x90,0x10,0x10,0x20,0x05,0x06, - 0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x08,0xf8,0x05,0x09,0x09,0x06,0x00,0x00, - 0x28,0x28,0x00,0xf8,0x08,0x08,0x08,0x08,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x50, - 0xf8,0x50,0x50,0x50,0x10,0x20,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x50,0xf8, - 0x50,0x50,0x50,0x10,0x20,0x05,0x06,0x06,0x06,0x00,0x00,0xc0,0x08,0xc8,0x08,0x10, - 0xe0,0x07,0x0d,0x0d,0x06,0x00,0x00,0x02,0x00,0x00,0x00,0x28,0x28,0x00,0xc0,0x08, - 0xc8,0x08,0x10,0xe0,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x10,0x10,0x20,0x50,0x88, - 0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0x70,0x10,0x10,0x20,0x50,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0x40,0x40,0xf8,0x48,0x50,0x40,0x38}; -const u8g_fntpgm_uint8_t fontpage_97_189_193[85] U8G_FONT_SECTION("fontpage_97_189_193") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xc1,0x00,0x09,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x88,0x48,0x48,0x10,0x10,0x20,0x05,0x09,0x09, - 0x06,0x00,0x00,0x28,0x28,0x00,0x88,0x48,0x48,0x10,0x10,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x40,0x78,0x48,0xa8,0x18,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28, - 0x08,0x40,0x78,0x48,0xa8,0x18,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x60, - 0x20,0xf8,0x20,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_97_195_211[241] U8G_FONT_SECTION("fontpage_97_195_211") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xd3,0x00,0x09,0x00,0x00, - 0x00,0x05,0x04,0x04,0x06,0x00,0x00,0xa8,0xa8,0x08,0x30,0x05,0x06,0x06,0x06,0x00, - 0x00,0xa8,0xa8,0xa8,0x08,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00, - 0xa8,0xa8,0xa8,0x08,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x00,0xf8,0x20, - 0x20,0x20,0x40,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x70,0x00,0xf8,0x20,0x20, - 0x20,0x40,0x04,0x07,0x07,0x06,0x01,0x00,0x80,0x80,0xc0,0xa0,0x90,0x80,0x80,0x04, - 0x09,0x09,0x06,0x01,0x00,0x50,0x10,0x80,0x80,0xc0,0xa0,0x90,0x80,0x80,0x05,0x07, - 0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x40,0x80,0x05,0x06,0x06,0x06,0x00, - 0x00,0x70,0x00,0x00,0x00,0x00,0xf8,0x05,0x06,0x06,0x06,0x00,0x00,0x78,0x08,0x28, - 0x10,0x28,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0x10,0x20,0x70,0xa8,0x20, - 0x03,0x06,0x06,0x06,0x01,0x00,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x06,0x06,0x06, - 0x00,0x00,0x10,0x50,0x50,0x48,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28, - 0x00,0x10,0x50,0x50,0x48,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00,0x18,0x18,0x00, - 0x10,0x50,0x50,0x48,0x88,0x88,0x04,0x06,0x06,0x06,0x00,0x00,0x80,0x90,0xe0,0x80, - 0x80,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0x80,0x90,0xe0,0x80,0x80, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_97_213_217[84] U8G_FONT_SECTION("fontpage_97_213_217") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd9,0x00,0x09,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x09,0x09, - 0x06,0x00,0x00,0x28,0x28,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x09,0x09,0x06, - 0x00,0x00,0x18,0x18,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x05,0x05,0x06,0x00, - 0x01,0x60,0xa0,0x10,0x10,0x08,0x05,0x08,0x08,0x06,0x00,0x01,0x28,0x28,0x00,0x60, - 0xa0,0x10,0x10,0x08}; -const u8g_fntpgm_uint8_t fontpage_97_219_220[45] U8G_FONT_SECTION("fontpage_97_219_220") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdc,0x00,0x09,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xf8,0x20,0xa8,0xa8,0xa8,0x20,0x05,0x09, - 0x09,0x06,0x00,0x00,0x28,0x08,0x20,0xf8,0x20,0xa8,0xa8,0xa8,0x20}; -const u8g_fntpgm_uint8_t fontpage_97_222_223[41] U8G_FONT_SECTION("fontpage_97_222_223") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xdf,0x00,0x06,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x50,0x20,0x10,0x04,0x06,0x06, - 0x06,0x01,0x00,0xe0,0x00,0xe0,0x00,0xc0,0x30}; -const u8g_fntpgm_uint8_t fontpage_97_225_237[174] U8G_FONT_SECTION("fontpage_97_225_237") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xed,0x00,0x07,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x08,0x48,0x30,0x10,0x28,0xc0,0x05,0x06,0x06, - 0x06,0x00,0x00,0xf0,0x40,0xf8,0x40,0x40,0x38,0x05,0x05,0x05,0x06,0x00,0x00,0x40, - 0xf8,0x48,0x50,0x40,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x40,0xf8,0x48,0x50,0x40, - 0x40,0x04,0x05,0x05,0x06,0x00,0x00,0x60,0x20,0x20,0x20,0xf0,0x05,0x06,0x06,0x06, - 0x00,0x00,0x70,0x10,0x10,0x10,0x10,0xf8,0x04,0x05,0x05,0x06,0x00,0x00,0xf0,0x10, - 0xf0,0x10,0xf0,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x08,0xf8,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x00,0xf8,0x08,0x08,0x10,0x60,0x04,0x07,0x07,0x06, - 0x00,0x00,0x10,0x90,0x90,0x90,0x90,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20, - 0x20,0xa0,0xa0,0xa8,0xa8,0xb0,0x05,0x06,0x06,0x06,0x00,0x00,0x80,0x80,0x80,0x88, - 0xb0,0xc0,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0xf8}; -const u8g_fntpgm_uint8_t fontpage_97_242_243[41] U8G_FONT_SECTION("fontpage_97_242_243") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf3,0x00,0x06,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x10,0x60,0x05,0x06,0x06, - 0x06,0x00,0x00,0xc0,0x08,0x08,0x08,0x10,0xe0}; -const u8g_fntpgm_uint8_t fontpage_97_252_252[25] U8G_FONT_SECTION("fontpage_97_252_252") = { - 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x05,0x00,0x00, - 0x00,0x05,0x02,0x02,0x06,0x00,0x03,0x80,0x78}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(97, 161, 164, fontpage_97_161_164), // 'ァ' -- 'イ' - FONTDATA_ITEM(97, 166, 166, fontpage_97_166_166), // 'ウ' -- 'ウ' - FONTDATA_ITEM(97, 168, 168, fontpage_97_168_168), // 'エ' -- 'エ' - FONTDATA_ITEM(97, 170, 187, fontpage_97_170_187), // 'オ' -- 'セ' - FONTDATA_ITEM(97, 189, 193, fontpage_97_189_193), // 'ソ' -- 'チ' - FONTDATA_ITEM(97, 195, 211, fontpage_97_195_211), // 'ッ' -- 'ビ' - FONTDATA_ITEM(97, 213, 217, fontpage_97_213_217), // 'フ' -- 'ベ' - FONTDATA_ITEM(97, 219, 220, fontpage_97_219_220), // 'ホ' -- 'ボ' - FONTDATA_ITEM(97, 222, 223, fontpage_97_222_223), // 'マ' -- 'ミ' - FONTDATA_ITEM(97, 225, 237, fontpage_97_225_237), // 'メ' -- 'ロ' - FONTDATA_ITEM(97, 242, 243, fontpage_97_242_243), // 'ヲ' -- 'ン' - FONTDATA_ITEM(97, 252, 252, fontpage_97_252_252), // 'ー' -- 'ー' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h deleted file mode 100644 index 9f20e7b401..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h +++ /dev/null @@ -1,532 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_344_240_240[34] U8G_FONT_SECTION("fontpage_344_240_240") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x09,0x11,0x17,0x21,0x41,0x81,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_345_224_224[41] U8G_FONT_SECTION("fontpage_345_224_224") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x08, - 0x80,0x08,0x80,0x09,0x00,0x08,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_347_248_248[41] U8G_FONT_SECTION("fontpage_347_248_248") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00, - 0x80,0x01,0x00,0x01,0x00,0x01,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_348_137_137[45] U8G_FONT_SECTION("fontpage_348_137_137") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x00,0x80,0x00,0x80,0x01,0x00,0xff, - 0xc0,0x00,0x00,0x20,0x80,0x20,0x80,0x3f,0x00,0x20,0x80,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_348_176_176[34] U8G_FONT_SECTION("fontpage_348_176_176") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x09,0x11,0x11,0x21,0x41,0x81,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_348_197_197[34] U8G_FONT_SECTION("fontpage_348_197_197") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x09,0x11,0x21,0xc1,0x1e,0x21,0x41, - 0x21,0x1e}; -const u8g_fntpgm_uint8_t fontpage_352_196_196[41] U8G_FONT_SECTION("fontpage_352_196_196") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x7f,0x80,0x08,0x80,0x08,0x80,0x08,0x80,0x08, - 0x80,0x08,0x80,0x10,0x80,0x11,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_353_180_180[34] U8G_FONT_SECTION("fontpage_353_180_180") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x85,0x85,0x85,0x85,0x87,0x85,0x85,0xfd,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_354_248_248[41] U8G_FONT_SECTION("fontpage_354_248_248") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x3f, - 0x80,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_356_132_132[43] U8G_FONT_SECTION("fontpage_356_132_132") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x09,0xff,0x00, - 0x00,0x0a,0x0a,0x14,0x0a,0x00,0xff,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x3f, - 0x80,0x00,0x00,0xff,0xc0,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_356_244_244[43] U8G_FONT_SECTION("fontpage_356_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0xff,0x00, - 0x00,0x0a,0x0a,0x14,0x0a,0x00,0xff,0x20,0x00,0x20,0x00,0x20,0x00,0x3f,0x80,0x00, - 0x00,0x00,0x00,0xff,0xc0,0x12,0x00,0x12,0x00,0x12,0x00}; -const u8g_fntpgm_uint8_t fontpage_357_200_200[34] U8G_FONT_SECTION("fontpage_357_200_200") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x7d,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_357_228_228[45] U8G_FONT_SECTION("fontpage_357_228_228") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xe4,0xe4,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x81,0x00,0x81,0x00,0x81,0x00,0x81, - 0x80,0x81,0x00,0x81,0x00,0xfd,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_357_249_249[45] U8G_FONT_SECTION("fontpage_357_249_249") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x81,0x00,0x81,0x00,0x81,0x80,0x81, - 0x00,0xfd,0x00,0x00,0x00,0x3e,0x00,0x41,0x00,0x41,0x00,0x3e,0x00}; -const u8g_fntpgm_uint8_t fontpage_359_196_196[41] U8G_FONT_SECTION("fontpage_359_196_196") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x20,0x00,0x20,0x00,0x20,0x00,0x3f, - 0x80,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_359_204_204[45] U8G_FONT_SECTION("fontpage_359_204_204") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x20,0x00,0x3f,0x80,0x04,0x00,0xff, - 0xc0,0x00,0x00,0x3f,0x00,0x00,0x80,0x3f,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_359_217_217[45] U8G_FONT_SECTION("fontpage_359_217_217") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x20,0x00,0x20,0x00,0x3f,0x80,0x04, - 0x00,0xff,0xc0,0x00,0x00,0x1f,0x00,0x20,0x80,0x20,0x80,0x1f,0x00}; -const u8g_fntpgm_uint8_t fontpage_360_152_152[45] U8G_FONT_SECTION("fontpage_360_152_152") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x7c,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x7e, - 0x80,0x10,0x80,0x10,0x80,0xff,0x80,0x00,0x80,0x00,0x80,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_360_168_168[34] U8G_FONT_SECTION("fontpage_360_168_168") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x81,0x81,0xf9,0x21,0xff,0x00,0x7f,0x41, - 0x41,0x7f}; -const u8g_fntpgm_uint8_t fontpage_360_208_208[43] U8G_FONT_SECTION("fontpage_360_208_208") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x09,0xff,0x00, - 0x00,0x0a,0x0a,0x14,0x0a,0x00,0xff,0x3f,0x80,0x20,0x00,0x20,0x00,0x20,0x00,0x3f, - 0x80,0x00,0x00,0xff,0xc0,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_361_164_164[45] U8G_FONT_SECTION("fontpage_361_164_164") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x7c,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x7c, - 0x80,0x00,0x80,0xfe,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80}; -const u8g_fntpgm_uint8_t fontpage_361_220_220[41] U8G_FONT_SECTION("fontpage_361_220_220") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x20,0x00,0x20,0x00,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_362_148_148[34] U8G_FONT_SECTION("fontpage_362_148_148") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x94,0x94,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x81,0x81,0x81,0x81,0x81,0x81,0xfd,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_366_252_252[45] U8G_FONT_SECTION("fontpage_366_252_252") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x09,0x00,0x09,0x00,0xf9,0x00,0x81, - 0x80,0x81,0x00,0x81,0x00,0xfd,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_368_136_136[34] U8G_FONT_SECTION("fontpage_368_136_136") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf5,0x15,0x15,0xf5,0x8d,0x85,0x85,0xfd,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_368_165_165[34] U8G_FONT_SECTION("fontpage_368_165_165") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf1,0x17,0xf1,0x87,0x81,0xf9,0x00,0x7f,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_368_220_220[41] U8G_FONT_SECTION("fontpage_368_220_220") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x00,0x80,0x3f,0x80,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_369_204_204[41] U8G_FONT_SECTION("fontpage_369_204_204") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x00,0x80,0x3f,0x80,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x12,0x00,0x12,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_370_244_244[41] U8G_FONT_SECTION("fontpage_370_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x00,0x80,0x3f,0x80,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_371_172_172[34] U8G_FONT_SECTION("fontpage_371_172_172") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x09,0xf9,0x81,0x81,0x81,0xfd,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_371_189_189[34] U8G_FONT_SECTION("fontpage_371_189_189") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xbd,0xbd,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0xf9,0x81,0x81,0xfd,0x00,0x41,0x3f, - 0x41,0x3f}; -const u8g_fntpgm_uint8_t fontpage_371_193_193[34] U8G_FONT_SECTION("fontpage_371_193_193") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc1,0xc1,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0xf9,0x81,0x81,0xfd,0x01,0x3e,0x21, - 0x21,0x3e}; -const u8g_fntpgm_uint8_t fontpage_371_204_204[45] U8G_FONT_SECTION("fontpage_371_204_204") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x89,0x00,0x89,0x00,0x89,0x80,0x89, - 0x00,0xf9,0x00,0x01,0x00,0x41,0x00,0x40,0x00,0x40,0x00,0x7f,0x00}; -const u8g_fntpgm_uint8_t fontpage_372_200_200[34] U8G_FONT_SECTION("fontpage_372_200_200") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x89,0x89,0x8f,0x89,0xf9,0x00,0x3f,0x41, - 0x41,0x3f}; -const u8g_fntpgm_uint8_t fontpage_372_212_212[34] U8G_FONT_SECTION("fontpage_372_212_212") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf5,0x95,0x95,0x9d,0x95,0x95,0x95,0xf5,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_372_244_244[34] U8G_FONT_SECTION("fontpage_372_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x89,0x8f,0x89,0x8f,0xf9,0x01,0x21,0x20, - 0x20,0x3f}; -const u8g_fntpgm_uint8_t fontpage_373_168_168[41] U8G_FONT_SECTION("fontpage_373_168_168") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x20,0x80,0x3f, - 0x80,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_376_128_128[34] U8G_FONT_SECTION("fontpage_376_128_128") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x89,0x89,0x89,0xf9,0x00,0x3f,0x01,0x3f, - 0x40,0x3f}; -const u8g_fntpgm_uint8_t fontpage_376_148_148[45] U8G_FONT_SECTION("fontpage_376_148_148") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x94,0x94,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x89,0x00,0x89,0x00,0x89,0x00,0xf9,0x00,0x89, - 0x80,0x89,0x00,0x89,0x00,0xf9,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_377_132_132[34] U8G_FONT_SECTION("fontpage_377_132_132") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x89,0x89,0x89,0xff,0x89,0x89,0x89,0xf9,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_377_160_160[34] U8G_FONT_SECTION("fontpage_377_160_160") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x95,0x95,0x95,0xf5,0x9d,0x95,0x95,0xf5,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_377_168_168[34] U8G_FONT_SECTION("fontpage_377_168_168") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x95,0x95,0xfd,0x95,0xf5,0x00,0x3f,0x01,0x3f, - 0x40,0x3f}; -const u8g_fntpgm_uint8_t fontpage_380_140_140[41] U8G_FONT_SECTION("fontpage_380_140_140") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x20,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x20, - 0x80,0x3f,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_380_196_196[34] U8G_FONT_SECTION("fontpage_380_196_196") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x89,0x89,0x89,0xf9,0x89,0x89,0x89,0xf9,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_385_189_189[45] U8G_FONT_SECTION("fontpage_385_189_189") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xbd,0xbd,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x21,0x00,0x21,0x00,0x21,0x00,0x51,0x80,0xd9, - 0x00,0x89,0x00,0x00,0x00,0x41,0x00,0x7e,0x00,0x41,0x00,0x7e,0x00}; -const u8g_fntpgm_uint8_t fontpage_385_200_200[34] U8G_FONT_SECTION("fontpage_385_200_200") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x25,0x25,0x25,0x45,0x67,0x65,0x95,0x95,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_386_164_164[34] U8G_FONT_SECTION("fontpage_386_164_164") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x21,0x21,0x27,0x51,0x89,0x00,0x3f,0x01,0x3f, - 0x40,0x3f}; -const u8g_fntpgm_uint8_t fontpage_386_216_216[34] U8G_FONT_SECTION("fontpage_386_216_216") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x21,0x27,0x21,0x67,0xd1,0x89,0x01,0x21,0x20, - 0x20,0x3f}; -const u8g_fntpgm_uint8_t fontpage_387_140_141[69] U8G_FONT_SECTION("fontpage_387_140_141") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x8c,0x8d,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x04,0x00,0x0c,0x00,0x0c,0x00,0x12,0x00,0x31, - 0x00,0x44,0x80,0x04,0x00,0x04,0x00,0xff,0xc0,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x04, - 0x00,0x0c,0x00,0x13,0x00,0x65,0x80,0x04,0x00,0xff,0xc0,0x00,0x00,0x3f,0x00,0x00, - 0x80,0x00,0x80,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_389_164_164[41] U8G_FONT_SECTION("fontpage_389_164_164") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x04,0x00,0x0c,0x00,0x0c,0x00,0x12,0x00,0x31, - 0x00,0x40,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_389_172_172[45] U8G_FONT_SECTION("fontpage_389_172_172") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x04,0x00,0x1a,0x00,0x61,0x80,0x00,0x00,0xff, - 0xc0,0x00,0x00,0x3f,0x00,0x00,0x80,0x3f,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_389_220_221[51] U8G_FONT_SECTION("fontpage_389_220_221") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xdc,0xdd,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x21,0x21,0x21,0x21,0x21,0x51,0xc9,0x89,0x01, - 0x01,0x01,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x21,0x21,0x21,0x51,0xd9,0x89,0x00,0x7f, - 0x01,0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_395_180_180[34] U8G_FONT_SECTION("fontpage_395_180_180") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x89,0x89,0x8f,0x89,0x89,0x89,0x71,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_395_198_198[45] U8G_FONT_SECTION("fontpage_395_198_198") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x71,0x00,0x89,0x00,0x8f,0x00,0x89,0x00,0x89, - 0x00,0x71,0x00,0x00,0x00,0x4a,0x00,0x72,0x00,0x4d,0x00,0x74,0x80}; -const u8g_fntpgm_uint8_t fontpage_395_209_209[34] U8G_FONT_SECTION("fontpage_395_209_209") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x65,0x95,0x95,0x9d,0x95,0x65,0x00,0x7f,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_395_212_212[45] U8G_FONT_SECTION("fontpage_395_212_212") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x65,0x00,0x95,0x00,0x95,0x00,0x9d,0x00,0x95, - 0x00,0x65,0x00,0x05,0x00,0x25,0x00,0x20,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_395_244_244[34] U8G_FONT_SECTION("fontpage_395_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x8f,0x89,0x8f,0x71,0x00,0x3f,0x01,0x3f, - 0x40,0x3f}; -const u8g_fntpgm_uint8_t fontpage_396_136_136[34] U8G_FONT_SECTION("fontpage_396_136_136") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x65,0x95,0x9d,0x95,0x95,0x9d,0x95,0x65,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_396_164_164[41] U8G_FONT_SECTION("fontpage_396_164_164") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x1e,0x00,0x21,0x00,0x20,0x80,0x20,0x80,0x21, - 0x00,0x1e,0x00,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_396_168_168[45] U8G_FONT_SECTION("fontpage_396_168_168") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x1f,0x00,0x20,0x80,0x20,0x80,0x1f,0x00,0x04, - 0x00,0x04,0x00,0xff,0xc0,0x00,0x00,0x20,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_396_196_196[45] U8G_FONT_SECTION("fontpage_396_196_196") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x38,0x80,0x44,0x80,0x44,0x80,0x44,0x80,0x38, - 0xc0,0x10,0x80,0xfe,0x80,0x00,0x80,0x20,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_397_208_208[34] U8G_FONT_SECTION("fontpage_397_208_208") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x89,0x89,0x71,0x01,0xff,0x21,0x27,0x41, - 0x40,0x7f}; -const u8g_fntpgm_uint8_t fontpage_398_132_132[45] U8G_FONT_SECTION("fontpage_398_132_132") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x38,0x80,0x44,0x80,0x42,0x80,0x44,0x80,0x38, - 0x80,0x00,0x80,0xfe,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80}; -const u8g_fntpgm_uint8_t fontpage_398_188_188[41] U8G_FONT_SECTION("fontpage_398_188_188") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x1e,0x00,0x21,0x00,0x20,0x80,0x20,0x80,0x21, - 0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_398_204_204[45] U8G_FONT_SECTION("fontpage_398_204_204") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x1e,0x00,0x21,0x00,0x21,0x00,0x1e,0x00,0x00, - 0x00,0xff,0xc0,0x00,0x00,0x3f,0x00,0x20,0x80,0x20,0x80,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_398_244_244[34] U8G_FONT_SECTION("fontpage_398_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x49,0x89,0x89,0x89,0x89,0x49,0x71,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_398_252_253[51] U8G_FONT_SECTION("fontpage_398_252_253") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xfc,0xfd,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x89,0x89,0x89,0x71,0x00,0x3f,0x01,0x3f, - 0x40,0x3f,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x89,0x89,0x89,0x71,0x00,0x77,0x11, - 0x71,0x41,0x79}; -const u8g_fntpgm_uint8_t fontpage_399_133_133[34] U8G_FONT_SECTION("fontpage_399_133_133") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x89,0x89,0x89,0x89,0x71,0x00,0x41,0x3f, - 0x41,0x3f}; -const u8g_fntpgm_uint8_t fontpage_399_144_145[73] U8G_FONT_SECTION("fontpage_399_144_145") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x90,0x91,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x09,0x00,0x11,0x00,0x11,0x00,0x21, - 0x80,0x71,0x00,0xc9,0x00,0x85,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x09,0x0b,0x16, - 0x0a,0x01,0xfe,0xf9,0x00,0x09,0x00,0x11,0x00,0x31,0x80,0x49,0x00,0x85,0x00,0x00, - 0x00,0x7e,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_399_165_165[45] U8G_FONT_SECTION("fontpage_399_165_165") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x09,0x00,0x11,0x00,0x31,0x80,0x79, - 0x00,0x85,0x00,0x00,0x00,0x3e,0x00,0x41,0x00,0x41,0x00,0x3e,0x00}; -const u8g_fntpgm_uint8_t fontpage_399_172_172[45] U8G_FONT_SECTION("fontpage_399_172_172") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x7a,0x80,0x0a,0x80,0x0a,0x80,0x12,0x80,0x13, - 0x80,0x2a,0x80,0x6a,0x80,0xc6,0x80,0x02,0x80,0x02,0x80,0x02,0x80}; -const u8g_fntpgm_uint8_t fontpage_400_128_128[34] U8G_FONT_SECTION("fontpage_400_128_128") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x11,0x17,0x31,0x71,0xc9,0x85,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_400_132_132[34] U8G_FONT_SECTION("fontpage_400_132_132") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x17,0x31,0x49,0x85,0x01,0x21,0x20, - 0x20,0x3f}; -const u8g_fntpgm_uint8_t fontpage_400_149_149[34] U8G_FONT_SECTION("fontpage_400_149_149") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x95,0x95,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x17,0x31,0x49,0x85,0x00,0x3e,0x21, - 0x21,0x3e}; -const u8g_fntpgm_uint8_t fontpage_400_156_156[45] U8G_FONT_SECTION("fontpage_400_156_156") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x7a,0x80,0x0a,0x80,0x0a,0x80,0x16,0x80,0x12, - 0x80,0x2a,0x80,0x4a,0x80,0x86,0x80,0x02,0x80,0x02,0x80,0x02,0x80}; -const u8g_fntpgm_uint8_t fontpage_401_253_253[45] U8G_FONT_SECTION("fontpage_401_253_253") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x01,0x00,0x0e,0x00,0x71,0x80,0x00, - 0x00,0xff,0xc0,0x04,0x00,0x3f,0x00,0x00,0x80,0x00,0x80,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_402_128_128[45] U8G_FONT_SECTION("fontpage_402_128_128") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x01,0x00,0x0e,0x00,0x71,0x80,0x00, - 0x00,0xff,0xc0,0x04,0x00,0x24,0x00,0x24,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_402_145_145[45] U8G_FONT_SECTION("fontpage_402_145_145") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x01,0x00,0x0e,0x00,0x71,0x80,0x00, - 0x00,0xff,0xc0,0x04,0x00,0x1f,0x00,0x20,0x80,0x20,0x80,0x1f,0x00}; -const u8g_fntpgm_uint8_t fontpage_403_144_144[45] U8G_FONT_SECTION("fontpage_403_144_144") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x3f,0x00,0x0e,0x00,0x71,0x80,0x00,0x00,0xff, - 0xc0,0x00,0x00,0x3f,0x00,0x00,0x80,0x3f,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_403_192_192[34] U8G_FONT_SECTION("fontpage_403_192_192") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x09,0x11,0x31,0x31,0xc9,0x85,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_409_152_152[34] U8G_FONT_SECTION("fontpage_409_152_152") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x01,0xf9,0x11,0x17,0x31,0x49,0x85,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_410_136_136[41] U8G_FONT_SECTION("fontpage_410_136_136") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x1e,0x00,0x00,0x00,0x3f,0x00,0x02,0x00,0x0e, - 0x00,0x71,0x80,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_411_149_149[45] U8G_FONT_SECTION("fontpage_411_149_149") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x95,0x95,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x1e,0x00,0x00,0x00,0x3f,0x00,0x0c,0x00,0x73, - 0x80,0x00,0x00,0xff,0xc0,0x04,0x00,0x3f,0x00,0x00,0x80,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_411_156_156[47] U8G_FONT_SECTION("fontpage_411_156_156") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x09,0xfd,0x00, - 0x00,0x0a,0x0c,0x18,0x0a,0x00,0xfd,0x1e,0x00,0x00,0x00,0x3f,0x00,0x1a,0x00,0x21, - 0x00,0xff,0xc0,0x04,0x00,0x3f,0x00,0x00,0x80,0x3f,0x00,0x20,0x00,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_411_164_164[45] U8G_FONT_SECTION("fontpage_411_164_164") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x1e,0x00,0x00,0x00,0x3f,0x00,0x0c,0x00,0x73, - 0x80,0x00,0x00,0xff,0xc0,0x04,0x00,0x3f,0x00,0x20,0x80,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_411_232_232[45] U8G_FONT_SECTION("fontpage_411_232_232") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x00,0xfe,0x38,0x80,0x00,0x80,0x7c,0x80,0x18,0x80,0x66, - 0x80,0x00,0x80,0xfe,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80}; -const u8g_fntpgm_uint8_t fontpage_412_216_216[34] U8G_FONT_SECTION("fontpage_412_216_216") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x01,0xf9,0x09,0x11,0x31,0x49,0x85,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_412_232_232[34] U8G_FONT_SECTION("fontpage_412_232_232") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x01,0xf9,0x09,0x31,0xcd,0x00,0x3f,0x41, - 0x41,0x3f}; -const u8g_fntpgm_uint8_t fontpage_412_244_244[45] U8G_FONT_SECTION("fontpage_412_244_244") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x09,0x00,0x09,0x00,0xf1,0x00,0x11, - 0x80,0x21,0x00,0x41,0x00,0x81,0x00,0x01,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_413_152_152[34] U8G_FONT_SECTION("fontpage_413_152_152") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf5,0x15,0xf7,0x25,0xc5,0x00,0x3f,0x01,0x3f, - 0x40,0x3f}; -const u8g_fntpgm_uint8_t fontpage_414_156_156[34] U8G_FONT_SECTION("fontpage_414_156_156") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x09,0x0f,0xf1,0x11,0x2f,0x41,0x81,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_417_209_209[45] U8G_FONT_SECTION("fontpage_417_209_209") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0xf9,0x00,0x81,0x00,0xf9,0x80,0x81,0x00,0x81, - 0x00,0xfd,0x00,0x00,0x00,0x41,0x00,0x7e,0x00,0x41,0x00,0x7e,0x00}; -const u8g_fntpgm_uint8_t fontpage_418_176_176[34] U8G_FONT_SECTION("fontpage_418_176_176") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf9,0x81,0x81,0xf7,0x81,0x81,0x81,0xf9,0x01, - 0x01,0x01}; -const u8g_fntpgm_uint8_t fontpage_418_204_204[34] U8G_FONT_SECTION("fontpage_418_204_204") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0xf5,0x85,0x85,0xed,0x85,0x85,0x85,0xfd,0x05, - 0x05,0x05}; -const u8g_fntpgm_uint8_t fontpage_419_160_160[41] U8G_FONT_SECTION("fontpage_419_160_160") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x20,0x00,0x3f,0x00,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x04,0x00,0x04,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_421_184_184[41] U8G_FONT_SECTION("fontpage_421_184_184") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xb8,0xb8,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x20,0x00,0x3f,0x00,0x20,0x00,0x20, - 0x00,0x3f,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_423_156_156[45] U8G_FONT_SECTION("fontpage_423_156_156") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0xfa,0x80,0x4a,0x80,0x4e,0x80,0x4a,0x80,0x4a, - 0x80,0xfe,0x80,0x02,0x80,0x12,0x80,0x10,0x00,0x10,0x00,0x1f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_426_132_132[41] U8G_FONT_SECTION("fontpage_426_132_132") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x09,0x00,0x00, - 0x00,0x0a,0x09,0x12,0x0a,0x00,0x00,0x3f,0x80,0x12,0x00,0x12,0x00,0x12,0x00,0x12, - 0x00,0x7f,0x80,0x00,0x00,0x00,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_426_216_216[45] U8G_FONT_SECTION("fontpage_426_216_216") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x71,0x00,0x01,0x00,0xfd,0x00,0x01,0x00,0x71, - 0x80,0x89,0x00,0x89,0x00,0x89,0x00,0x71,0x00,0x01,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_426_233_233[45] U8G_FONT_SECTION("fontpage_426_233_233") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x09,0xfe,0x00, - 0x00,0x09,0x0b,0x16,0x0a,0x01,0xfe,0x71,0x00,0x01,0x00,0xfd,0x00,0x49,0x80,0x89, - 0x00,0x79,0x00,0x00,0x00,0x41,0x00,0x7e,0x00,0x41,0x00,0x7e,0x00}; -const u8g_fntpgm_uint8_t fontpage_428_200_200[45] U8G_FONT_SECTION("fontpage_428_200_200") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x0e,0x00,0x00,0x00,0x7f,0x80,0x21,0x00,0x1e, - 0x00,0x04,0x00,0xff,0xc0,0x00,0x00,0x3f,0x00,0x20,0x80,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_428_212_212[45] U8G_FONT_SECTION("fontpage_428_212_212") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x09,0xfe,0x00, - 0x00,0x0a,0x0b,0x16,0x0a,0x00,0xfe,0x38,0x80,0x00,0x80,0x7e,0x80,0x00,0x80,0x38, - 0x80,0x44,0xc0,0x3c,0x80,0x10,0x80,0xfe,0x80,0x00,0x80,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_431_136_136[34] U8G_FONT_SECTION("fontpage_431_136_136") = { - 0x00,0x0b,0x0d,0x00,0xfd,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x09,0xfe,0x00, - 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x01,0xfd,0x01,0x71,0x49,0x89,0x49,0x71, - 0x01,0x01}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(344, 240, 240, fontpage_344_240_240), // '거' -- '거' - FONTDATA_ITEM(345, 224, 224, fontpage_345_224_224), // '고' -- '고' - FONTDATA_ITEM(347, 248, 248, fontpage_347_248_248), // '그' -- '그' - FONTDATA_ITEM(348, 137, 137, fontpage_348_137_137), // '급' -- '급' - FONTDATA_ITEM(348, 176, 176, fontpage_348_176_176), // '기' -- '기' - FONTDATA_ITEM(348, 197, 197, fontpage_348_197_197), // '깅' -- '깅' - FONTDATA_ITEM(352, 196, 196, fontpage_352_196_196), // '끄' -- '끄' - FONTDATA_ITEM(353, 180, 180, fontpage_353_180_180), // '내' -- '내' - FONTDATA_ITEM(354, 248, 248, fontpage_354_248_248), // '노' -- '노' - FONTDATA_ITEM(356, 132, 132, fontpage_356_132_132), // '누' -- '누' - FONTDATA_ITEM(356, 244, 244, fontpage_356_244_244), // '뉴' -- '뉴' - FONTDATA_ITEM(357, 200, 200, fontpage_357_200_200), // '니' -- '니' - FONTDATA_ITEM(357, 228, 228, fontpage_357_228_228), // '다' -- '다' - FONTDATA_ITEM(357, 249, 249, fontpage_357_249_249), // '당' -- '당' - FONTDATA_ITEM(359, 196, 196, fontpage_359_196_196), // '도' -- '도' - FONTDATA_ITEM(359, 204, 204, fontpage_359_204_204), // '돌' -- '돌' - FONTDATA_ITEM(359, 217, 217, fontpage_359_217_217), // '동' -- '동' - FONTDATA_ITEM(360, 152, 152, fontpage_360_152_152), // '되' -- '되' - FONTDATA_ITEM(360, 168, 168, fontpage_360_168_168), // '됨' -- '됨' - FONTDATA_ITEM(360, 208, 208, fontpage_360_208_208), // '두' -- '두' - FONTDATA_ITEM(361, 164, 164, fontpage_361_164_164), // '뒤' -- '뒤' - FONTDATA_ITEM(361, 220, 220, fontpage_361_220_220), // '드' -- '드' - FONTDATA_ITEM(362, 148, 148, fontpage_362_148_148), // '디' -- '디' - FONTDATA_ITEM(366, 252, 252, fontpage_366_252_252), // '라' -- '라' - FONTDATA_ITEM(368, 136, 136, fontpage_368_136_136), // '레' -- '레' - FONTDATA_ITEM(368, 165, 165, fontpage_368_165_165), // '력' -- '력' - FONTDATA_ITEM(368, 220, 220, fontpage_368_220_220), // '로' -- '로' - FONTDATA_ITEM(369, 204, 204, fontpage_369_204_204), // '료' -- '료' - FONTDATA_ITEM(370, 244, 244, fontpage_370_244_244), // '르' -- '르' - FONTDATA_ITEM(371, 172, 172, fontpage_371_172_172), // '리' -- '리' - FONTDATA_ITEM(371, 189, 189, fontpage_371_189_189), // '립' -- '립' - FONTDATA_ITEM(371, 193, 193, fontpage_371_193_193), // '링' -- '링' - FONTDATA_ITEM(371, 204, 204, fontpage_371_204_204), // '만' -- '만' - FONTDATA_ITEM(372, 200, 200, fontpage_372_200_200), // '멈' -- '멈' - FONTDATA_ITEM(372, 212, 212, fontpage_372_212_212), // '메' -- '메' - FONTDATA_ITEM(372, 244, 244, fontpage_372_244_244), // '면' -- '면' - FONTDATA_ITEM(373, 168, 168, fontpage_373_168_168), // '모' -- '모' - FONTDATA_ITEM(376, 128, 128, fontpage_376_128_128), // '밀' -- '밀' - FONTDATA_ITEM(376, 148, 148, fontpage_376_148_148), // '바' -- '바' - FONTDATA_ITEM(377, 132, 132, fontpage_377_132_132), // '버' -- '버' - FONTDATA_ITEM(377, 160, 160, fontpage_377_160_160), // '베' -- '베' - FONTDATA_ITEM(377, 168, 168, fontpage_377_168_168), // '벨' -- '벨' - FONTDATA_ITEM(380, 140, 140, fontpage_380_140_140), // '브' -- '브' - FONTDATA_ITEM(380, 196, 196, fontpage_380_196_196), // '비' -- '비' - FONTDATA_ITEM(385, 189, 189, fontpage_385_189_189), // '삽' -- '삽' - FONTDATA_ITEM(385, 200, 200, fontpage_385_200_200), // '새' -- '새' - FONTDATA_ITEM(386, 164, 164, fontpage_386_164_164), // '설' -- '설' - FONTDATA_ITEM(386, 216, 216, fontpage_386_216_216), // '션' -- '션' - FONTDATA_ITEM(387, 140, 141, fontpage_387_140_141), // '소' -- '속' - FONTDATA_ITEM(389, 164, 164, fontpage_389_164_164), // '스' -- '스' - FONTDATA_ITEM(389, 172, 172, fontpage_389_172_172), // '슬' -- '슬' - FONTDATA_ITEM(389, 220, 221, fontpage_389_220_221), // '시' -- '식' - FONTDATA_ITEM(395, 180, 180, fontpage_395_180_180), // '어' -- '어' - FONTDATA_ITEM(395, 198, 198, fontpage_395_198_198), // '없' -- '없' - FONTDATA_ITEM(395, 209, 209, fontpage_395_209_209), // '엑' -- '엑' - FONTDATA_ITEM(395, 212, 212, fontpage_395_212_212), // '엔' -- '엔' - FONTDATA_ITEM(395, 244, 244, fontpage_395_244_244), // '열' -- '열' - FONTDATA_ITEM(396, 136, 136, fontpage_396_136_136), // '예' -- '예' - FONTDATA_ITEM(396, 164, 164, fontpage_396_164_164), // '오' -- '오' - FONTDATA_ITEM(396, 168, 168, fontpage_396_168_168), // '온' -- '온' - FONTDATA_ITEM(396, 196, 196, fontpage_396_196_196), // '완' -- '완' - FONTDATA_ITEM(397, 208, 208, fontpage_397_208_208), // '원' -- '원' - FONTDATA_ITEM(398, 132, 132, fontpage_398_132_132), // '위' -- '위' - FONTDATA_ITEM(398, 188, 188, fontpage_398_188_188), // '으' -- '으' - FONTDATA_ITEM(398, 204, 204, fontpage_398_204_204), // '음' -- '음' - FONTDATA_ITEM(398, 244, 244, fontpage_398_244_244), // '이' -- '이' - FONTDATA_ITEM(398, 252, 253, fontpage_398_252_253), // '일' -- '읽' - FONTDATA_ITEM(399, 133, 133, fontpage_399_133_133), // '입' -- '입' - FONTDATA_ITEM(399, 144, 145, fontpage_399_144_145), // '자' -- '작' - FONTDATA_ITEM(399, 165, 165, fontpage_399_165_165), // '장' -- '장' - FONTDATA_ITEM(399, 172, 172, fontpage_399_172_172), // '재' -- '재' - FONTDATA_ITEM(400, 128, 128, fontpage_400_128_128), // '저' -- '저' - FONTDATA_ITEM(400, 132, 132, fontpage_400_132_132), // '전' -- '전' - FONTDATA_ITEM(400, 149, 149, fontpage_400_149_149), // '정' -- '정' - FONTDATA_ITEM(400, 156, 156, fontpage_400_156_156), // '제' -- '제' - FONTDATA_ITEM(401, 253, 253, fontpage_401_253_253), // '죽' -- '죽' - FONTDATA_ITEM(402, 128, 128, fontpage_402_128_128), // '준' -- '준' - FONTDATA_ITEM(402, 145, 145, fontpage_402_145_145), // '중' -- '중' - FONTDATA_ITEM(403, 144, 144, fontpage_403_144_144), // '즐' -- '즐' - FONTDATA_ITEM(403, 192, 192, fontpage_403_192_192), // '지' -- '지' - FONTDATA_ITEM(409, 152, 152, fontpage_409_152_152), // '처' -- '처' - FONTDATA_ITEM(410, 136, 136, fontpage_410_136_136), // '초' -- '초' - FONTDATA_ITEM(411, 149, 149, fontpage_411_149_149), // '축' -- '축' - FONTDATA_ITEM(411, 156, 156, fontpage_411_156_156), // '출' -- '출' - FONTDATA_ITEM(411, 164, 164, fontpage_411_164_164), // '춤' -- '춤' - FONTDATA_ITEM(411, 232, 232, fontpage_411_232_232), // '취' -- '취' - FONTDATA_ITEM(412, 216, 216, fontpage_412_216_216), // '치' -- '치' - FONTDATA_ITEM(412, 232, 232, fontpage_412_232_232), // '침' -- '침' - FONTDATA_ITEM(412, 244, 244, fontpage_412_244_244), // '카' -- '카' - FONTDATA_ITEM(413, 152, 152, fontpage_413_152_152), // '캘' -- '캘' - FONTDATA_ITEM(414, 156, 156, fontpage_414_156_156), // '켜' -- '켜' - FONTDATA_ITEM(417, 209, 209, fontpage_417_209_209), // '탑' -- '탑' - FONTDATA_ITEM(418, 176, 176, fontpage_418_176_176), // '터' -- '터' - FONTDATA_ITEM(418, 204, 204, fontpage_418_204_204), // '테' -- '테' - FONTDATA_ITEM(419, 160, 160, fontpage_419_160_160), // '토' -- '토' - FONTDATA_ITEM(421, 184, 184, fontpage_421_184_184), // '트' -- '트' - FONTDATA_ITEM(423, 156, 156, fontpage_423_156_156), // '펜' -- '펜' - FONTDATA_ITEM(426, 132, 132, fontpage_426_132_132), // '프' -- '프' - FONTDATA_ITEM(426, 216, 216, fontpage_426_216_216), // '하' -- '하' - FONTDATA_ITEM(426, 233, 233, fontpage_426_233_233), // '합' -- '합' - FONTDATA_ITEM(428, 200, 200, fontpage_428_200_200), // '홈' -- '홈' - FONTDATA_ITEM(428, 212, 212, fontpage_428_212_212), // '화' -- '화' - FONTDATA_ITEM(431, 136, 136, fontpage_431_136_136), // '히' -- '히' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_nl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_nl.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_nl.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pl.h deleted file mode 100644 index 0cc607468e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pl.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_133_133[30] U8G_FONT_SECTION("fontpage_2_133_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x08,0x78,0x88,0x78,0x20,0x30}; -const u8g_fntpgm_uint8_t fontpage_2_135_135[31] U8G_FONT_SECTION("fontpage_2_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x80,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_2_153_153[30] U8G_FONT_SECTION("fontpage_2_153_153") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0xf0,0x80,0x70,0x20,0x30}; -const u8g_fntpgm_uint8_t fontpage_2_193_196[73] U8G_FONT_SECTION("fontpage_2_193_196") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xc4,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x40,0x60,0xc0,0x40,0x40,0x78,0x03,0x07, - 0x07,0x06,0x01,0x00,0xc0,0x40,0x60,0xc0,0x40,0x40,0xe0,0x05,0x0a,0x0a,0x06,0x00, - 0x00,0x10,0x20,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05,0x08,0x08,0x06,0x00, - 0x00,0x10,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_2_218_219[47] U8G_FONT_SECTION("fontpage_2_218_219") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xda,0xdb,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x80,0x70,0x08,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x78,0x80,0x70,0x08,0xf0}; -const u8g_fntpgm_uint8_t fontpage_2_252_252[30] U8G_FONT_SECTION("fontpage_2_252_252") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 133, 133, fontpage_2_133_133), // 'ą' -- 'ą' - FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć' - FONTDATA_ITEM(2, 153, 153, fontpage_2_153_153), // 'ę' -- 'ę' - FONTDATA_ITEM(2, 193, 196, fontpage_2_193_196), // 'Ł' -- 'ń' - FONTDATA_ITEM(2, 218, 219, fontpage_2_218_219), // 'Ś' -- 'ś' - FONTDATA_ITEM(2, 252, 252, fontpage_2_252_252), // 'ż' -- 'ż' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h deleted file mode 100644 index ffda82764f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ru.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ru.h deleted file mode 100644 index 85a0bde3ab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_ru.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_8_144_152[135] U8G_FONT_SECTION("fontpage_8_144_152") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x98,0x00,0x07,0xff,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf0,0x80,0x80,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80, - 0x80,0x80,0x80,0x80,0x80,0x05,0x08,0x08,0x06,0x00,0xff,0x30,0x50,0x50,0x50,0x50, - 0x50,0xf8,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8, - 0x05,0x07,0x07,0x06,0x00,0x00,0xa8,0xa8,0x70,0x20,0x70,0xa8,0xa8,0x05,0x07,0x07, - 0x06,0x00,0x00,0x70,0x88,0x08,0x70,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x88,0x88,0x98,0xa8,0xc8,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_8_154_168[214] U8G_FONT_SECTION("fontpage_8_154_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0xa8,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x48,0x48,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88, - 0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8, - 0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88, - 0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0xa8,0xa8,0xa8,0x70,0x20, - 0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x09,0x09, - 0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x07,0x07,0x06, - 0x00,0x00,0x88,0x88,0x88,0x78,0x08,0x08,0x08,0x05,0x07,0x07,0x06,0x00,0x00,0xa8, - 0xa8,0xa8,0xa8,0xa8,0xa8,0xf8}; -const u8g_fntpgm_uint8_t fontpage_8_171_173[56] U8G_FONT_SECTION("fontpage_8_171_173") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xad,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xc8,0xa8,0xa8,0xc8,0x04,0x07, - 0x07,0x06,0x01,0x00,0x80,0x80,0x80,0xe0,0x90,0x90,0xe0,0x05,0x07,0x07,0x06,0x00, - 0x00,0x70,0x88,0x08,0x78,0x08,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_8_175_201[334] U8G_FONT_SECTION("fontpage_8_175_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xc9,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x78,0x88,0x88,0x78,0x28,0x48,0x88,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x80,0xf0,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf0,0x88,0xf0,0x88, - 0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x80,0x80,0x80,0x80,0x05,0x06,0x06,0x06, - 0x00,0xff,0x30,0x50,0x50,0x50,0xf8,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88, - 0xf0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0x70,0x20,0x70,0xa8,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x88,0x30,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x88, - 0x98,0xa8,0xc8,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x88,0x98,0xa8, - 0xc8,0x88,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05,0x05,0x05, - 0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0xd8, - 0xa8,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xf8,0x88,0x88,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8, - 0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0,0x80, - 0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88, - 0x88,0x78,0x08,0x70,0x05,0x09,0x09,0x06,0x00,0xfe,0x20,0x20,0x70,0xa8,0xa8,0xa8, - 0x70,0x20,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07, - 0x07,0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0x88,0x78,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0xa8,0xa8,0xa8, - 0xf8,0x05,0x07,0x07,0x06,0x00,0xfe,0xa8,0xa8,0xa8,0xa8,0xf8,0x08,0x08}; -const u8g_fntpgm_uint8_t fontpage_8_203_207[72] U8G_FONT_SECTION("fontpage_8_203_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0xc8,0x04,0x05,0x05,0x06, - 0x01,0x00,0x80,0x80,0xe0,0x90,0xe0,0x04,0x05,0x05,0x06,0x01,0x00,0xe0,0x10,0x70, - 0x10,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xa8,0xe8,0xa8,0x90,0x04,0x05,0x05, - 0x06,0x01,0x00,0x70,0x90,0x70,0x50,0x90}; -const u8g_fntpgm_uint8_t fontpage_8_209_209[30] U8G_FONT_SECTION("fontpage_8_209_209") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0xf0,0x80,0x70}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(8, 144, 152, fontpage_8_144_152), // 'А' -- 'И' - FONTDATA_ITEM(8, 154, 168, fontpage_8_154_168), // 'К' -- 'Ш' - FONTDATA_ITEM(8, 171, 173, fontpage_8_171_173), // 'Ы' -- 'Э' - FONTDATA_ITEM(8, 175, 201, fontpage_8_175_201), // 'Я' -- 'щ' - FONTDATA_ITEM(8, 203, 207, fontpage_8_203_207), // 'ы' -- 'я' - FONTDATA_ITEM(8, 209, 209, fontpage_8_209_209), // 'ё' -- 'ё' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_sk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_sk.h deleted file mode 100644 index a75fa2c926..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_sk.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_140_143[79] U8G_FONT_SECTION("fontpage_2_140_143") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8f,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x80,0x80,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x88,0x70,0x05, - 0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x06, - 0x0a,0x0a,0x06,0x00,0x00,0x14,0x08,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_2_185_186[49] U8G_FONT_SECTION("fontpage_2_185_186") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xba,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0x80,0x80,0x80,0x80,0x80,0x80, - 0xf8,0x03,0x0a,0x0a,0x06,0x01,0x00,0x20,0x40,0x00,0xc0,0x40,0x40,0x40,0x40,0x40, - 0xe0}; -const u8g_fntpgm_uint8_t fontpage_2_189_190[49] U8G_FONT_SECTION("fontpage_2_189_190") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xbe,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x80,0x80,0x80,0x80,0x80,0x80, - 0xf8,0x03,0x0a,0x0a,0x06,0x01,0x00,0xa0,0x40,0x00,0xc0,0x40,0x40,0x40,0x40,0x40, - 0xe0}; -const u8g_fntpgm_uint8_t fontpage_2_199_200[47] U8G_FONT_SECTION("fontpage_2_199_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc8,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88, - 0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88}; -const u8g_fntpgm_uint8_t fontpage_2_212_213[47] U8G_FONT_SECTION("fontpage_2_212_213") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd5,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90, - 0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0xb0,0xc8,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_2_224_225[47] U8G_FONT_SECTION("fontpage_2_224_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe1,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x70,0x88,0x80,0x70,0x08,0x88, - 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0x78,0x80,0x70,0x08,0xf0}; -const u8g_fntpgm_uint8_t fontpage_2_228_229[49] U8G_FONT_SECTION("fontpage_2_228_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe5,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x20,0x20,0x20,0x20,0x20, - 0x20,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x20,0x20,0xf8,0x20,0x20,0x20, - 0x18}; -const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253_254") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfe,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x08,0x10,0x20,0x40,0x80, - 0xf8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 140, 143, fontpage_2_140_143), // 'Č' -- 'ď' - FONTDATA_ITEM(2, 185, 186, fontpage_2_185_186), // 'Ĺ' -- 'ĺ' - FONTDATA_ITEM(2, 189, 190, fontpage_2_189_190), // 'Ľ' -- 'ľ' - FONTDATA_ITEM(2, 199, 200, fontpage_2_199_200), // 'Ň' -- 'ň' - FONTDATA_ITEM(2, 212, 213, fontpage_2_212_213), // 'Ŕ' -- 'ŕ' - FONTDATA_ITEM(2, 224, 225, fontpage_2_224_225), // 'Š' -- 'š' - FONTDATA_ITEM(2, 228, 229, fontpage_2_228_229), // 'Ť' -- 'ť' - FONTDATA_ITEM(2, 253, 254, fontpage_2_253_254), // 'Ž' -- 'ž' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_test.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_test.h deleted file mode 100644 index 033188359d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_test.h +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_8_128_255[1677] U8G_FONT_SECTION("fontpage_8_128_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x00,0x0a,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80, - 0xf8,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8, - 0x05,0x09,0x09,0x06,0x00,0xfe,0xe0,0x40,0x40,0x70,0x48,0x48,0x48,0x08,0x30,0x05, - 0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0xf0,0x80,0x88,0x70,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0xe0, - 0x40,0x40,0x40,0x40,0x40,0xe0,0x03,0x09,0x09,0x06,0x01,0x00,0xa0,0x00,0xe0,0x40, - 0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x38,0x10,0x10,0x10,0x10, - 0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x60,0xa0,0xa0,0xb0,0xa8,0xa8,0xb0,0x05, - 0x07,0x07,0x06,0x00,0x00,0xa0,0xa0,0xa0,0xf0,0xa8,0xa8,0xb0,0x05,0x07,0x07,0x06, - 0x00,0x00,0xe0,0x40,0x40,0x70,0x48,0x48,0x48,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10, - 0x20,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40, - 0x20,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00,0x88, - 0x70,0x00,0x88,0x88,0x88,0x88,0x78,0x08,0x70,0x05,0x09,0x09,0x06,0x00,0xfe,0x88, - 0x88,0x88,0x88,0x88,0x88,0xf8,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88, - 0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x80,0x80,0xf0,0x88, - 0x88,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x05,0x08,0x08,0x06, - 0x00,0xff,0x30,0x50,0x50,0x50,0x50,0x50,0xf8,0x88,0x05,0x07,0x07,0x06,0x00,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xa8,0xa8,0x70, - 0x20,0x70,0xa8,0xa8,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x70,0x08,0x88, - 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x05,0x0a, - 0x0a,0x06,0x00,0x00,0x88,0x70,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0x38,0x48,0x48,0x48,0x48,0x48,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8, - 0xa8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88, - 0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20, - 0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0x78,0x08,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0xa8,0xa8,0xa8,0x70,0x20,0x05,0x07,0x07, - 0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0xfe, - 0x90,0x90,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x07,0x07,0x06,0x00,0x00,0x88, - 0x88,0x88,0x78,0x08,0x08,0x08,0x05,0x07,0x07,0x06,0x00,0x00,0xa8,0xa8,0xa8,0xa8, - 0xa8,0xa8,0xf8,0x05,0x09,0x09,0x06,0x00,0xfe,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xf8, - 0x08,0x08,0x05,0x07,0x07,0x06,0x00,0x00,0xc0,0x40,0x40,0x70,0x48,0x48,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xc8,0xa8,0xa8,0xc8,0x04,0x07,0x07,0x06, - 0x01,0x00,0x80,0x80,0x80,0xe0,0x90,0x90,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x08,0x78,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x90,0xa8,0xa8,0xe8, - 0xa8,0xa8,0x90,0x05,0x07,0x07,0x06,0x00,0x00,0x78,0x88,0x88,0x78,0x28,0x48,0x88, - 0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00, - 0x00,0x70,0x80,0xf0,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf0,0x88, - 0xf0,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x80,0x80,0x80,0x80,0x05,0x06, - 0x06,0x06,0x00,0xff,0x30,0x50,0x50,0x50,0xf8,0x88,0x05,0x05,0x05,0x06,0x00,0x00, - 0x70,0x88,0xf0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0x70,0x20,0x70,0xa8, - 0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x30,0x88,0x70,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0x98,0xa8,0xc8,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x88, - 0x98,0xa8,0xc8,0x88,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05, - 0x05,0x05,0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x88,0x05,0x05,0x05,0x06,0x00,0x00, - 0x88,0xd8,0xa8,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xf8,0x88,0x88, - 0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00, - 0x00,0xf8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88, - 0xf0,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x05,0x05, - 0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88, - 0x88,0x88,0x88,0x78,0x08,0x70,0x05,0x09,0x09,0x06,0x00,0xfe,0x20,0x20,0x70,0xa8, - 0xa8,0xa8,0x70,0x20,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88, - 0x05,0x07,0x07,0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x05,0x05, - 0x06,0x00,0x00,0x88,0x88,0x78,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0xa8, - 0xa8,0xa8,0xf8,0x05,0x07,0x07,0x06,0x00,0xfe,0xa8,0xa8,0xa8,0xa8,0xf8,0x08,0x08, - 0x05,0x05,0x05,0x06,0x00,0x00,0xc0,0x40,0x70,0x48,0x70,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0x88,0xc8,0xa8,0xc8,0x04,0x05,0x05,0x06,0x01,0x00,0x80,0x80,0xe0,0x90, - 0xe0,0x04,0x05,0x05,0x06,0x01,0x00,0xe0,0x10,0x70,0x10,0xe0,0x05,0x05,0x05,0x06, - 0x00,0x00,0x90,0xa8,0xe8,0xa8,0x90,0x04,0x05,0x05,0x06,0x01,0x00,0x70,0x90,0x70, - 0x50,0x90,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xf0,0x80,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x09,0x09, - 0x06,0x00,0xfe,0x40,0xe0,0x40,0x70,0x48,0x48,0x48,0x08,0x10,0x05,0x08,0x08,0x06, - 0x00,0x00,0x10,0x20,0x00,0xf8,0x80,0x80,0x80,0x80,0x04,0x05,0x05,0x06,0x01,0x00, - 0x70,0x80,0xe0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x80,0x70,0x08,0xf0, - 0x03,0x06,0x06,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0xe0,0x03,0x06,0x06,0x06, - 0x01,0x00,0xa0,0x00,0xc0,0x40,0x40,0xe0,0x04,0x08,0x08,0x06,0x01,0xfe,0x10,0x00, - 0x30,0x10,0x10,0x10,0x90,0x60,0x05,0x05,0x05,0x06,0x00,0x00,0x60,0xa0,0xb0,0xa8, - 0xb0,0x05,0x05,0x05,0x06,0x00,0x00,0xa0,0xa0,0xf0,0xa8,0xb0,0x05,0x07,0x07,0x06, - 0x00,0x00,0x40,0xe0,0x40,0x70,0x48,0x48,0x48,0x04,0x08,0x08,0x06,0x01,0x00,0x20, - 0x40,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00, - 0x88,0x98,0xa8,0xc8,0x88,0x05,0x0a,0x0a,0x06,0x00,0xfe,0x88,0x70,0x00,0x88,0x88, - 0x88,0x88,0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x88,0xf8, - 0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x88,0x88,0xa8,0xa8,0xa8,0x50,0x05, - 0x05,0x05,0x06,0x00,0x00,0x50,0x88,0xa8,0xa8,0x50,0x05,0x07,0x07,0x06,0x00,0x00, - 0x40,0xf0,0x40,0x70,0x48,0x48,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x40,0xf0, - 0x40,0x70,0x48,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x98,0xa0,0xa0,0xf8,0xa0,0xa0, - 0x98,0x05,0x05,0x05,0x06,0x00,0x00,0x98,0xa0,0xf8,0xa0,0x98,0x05,0x07,0x07,0x06, - 0x00,0x00,0x20,0x50,0x50,0x88,0xf8,0xa8,0xa8,0x05,0x06,0x06,0x06,0x00,0x00,0x20, - 0x50,0x50,0x88,0xf8,0xa8,0x05,0x07,0x07,0x06,0x00,0x00,0x90,0x90,0xb8,0xf8,0xb8, - 0xb8,0xb8,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0x90,0xf8,0xb8,0xb8,0x05,0x08,0x08, - 0x06,0x00,0x00,0xf8,0x88,0x50,0x50,0x70,0xa8,0xa8,0xa8,0x05,0x06,0x06,0x06,0x00, - 0x00,0xf8,0x88,0x50,0x70,0xa8,0xa8,0x06,0x08,0x08,0x06,0x00,0x00,0xfc,0xc4,0xa8, - 0x90,0xf8,0xb8,0xb8,0xa8,0x06,0x06,0x06,0x06,0x00,0x00,0xfc,0xa8,0x90,0xf8,0xb8, - 0xa8,0x05,0x0c,0x0c,0x06,0x00,0xfe,0x50,0x20,0x00,0x70,0x88,0x08,0x30,0x08,0x08, - 0x70,0x80,0x70,0x05,0x0a,0x0a,0x06,0x00,0xfe,0x50,0x20,0x00,0x70,0x88,0x30,0x08, - 0x70,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xa8,0xa8,0xa8,0x70,0x20,0x20,0x20, - 0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0xa8,0x70,0x20,0x20,0x05,0x07,0x07,0x06,0x00, - 0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88, - 0xf8,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0x90,0x50,0x50,0x50,0x20, - 0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x90,0x50,0x50,0x20,0x05,0x0a,0x0a,0x06,0x00, - 0x00,0x90,0x48,0x00,0x88,0x90,0x90,0x50,0x50,0x50,0x20,0x05,0x08,0x08,0x06,0x00, - 0x00,0x90,0x48,0x00,0x88,0x90,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0x40, - 0xa0,0xa0,0xb8,0xb8,0xb8,0x58,0x08,0x10,0x05,0x07,0x07,0x06,0x00,0xfe,0x58,0xb8, - 0xb8,0xb8,0x58,0x08,0x10,0x05,0x0a,0x0a,0x06,0x00,0xff,0x20,0x70,0xa8,0x88,0x88, - 0x88,0x88,0xa8,0x70,0x20,0x05,0x08,0x08,0x06,0x00,0xff,0x20,0x70,0xa8,0x88,0x88, - 0xa8,0x70,0x20,0x05,0x09,0x09,0x06,0x00,0x00,0x70,0x00,0x20,0x20,0x88,0x88,0x88, - 0xa8,0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x00,0x20,0xa8,0x88,0xa8,0x50,0x05, - 0x0a,0x0a,0x06,0x00,0x00,0xf8,0xa8,0x00,0x50,0x88,0x88,0xa8,0xa8,0xa8,0x50,0x05, - 0x08,0x08,0x06,0x00,0x00,0xf8,0xa8,0x00,0x50,0x88,0xa8,0xa8,0x50}; -const u8g_fntpgm_uint8_t fontpage_97_129_191[870] U8G_FONT_SECTION("fontpage_97_129_191") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x81,0xbf,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x04,0x00,0x4e,0x00,0x55,0x00,0x64, - 0x80,0x48,0x40,0xa8,0x40,0x90,0x40,0x90,0x80,0x61,0x00,0x06,0x00,0x08,0x0b,0x0b, - 0x0c,0x01,0xff,0x20,0x10,0x70,0x1c,0x28,0xe2,0x39,0x21,0x21,0x12,0x0c,0x08,0x07, - 0x07,0x0c,0x02,0xff,0x28,0x2e,0xf5,0x21,0x16,0x10,0x10,0x0b,0x0b,0x16,0x0c,0x00, - 0xff,0x02,0x00,0x37,0x00,0x20,0x00,0x13,0xc0,0x9c,0x20,0x70,0x20,0x09,0xc0,0x08, - 0x00,0x08,0x00,0x04,0x00,0x04,0x00,0x07,0x07,0x07,0x0c,0x03,0xff,0x10,0x9c,0xb2, - 0xd2,0x9c,0x10,0x20,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x82,0x00,0x47,0x80, - 0x4a,0x40,0x52,0x20,0x62,0x20,0x6a,0x40,0x47,0x80,0x42,0x00,0x04,0x00,0x08,0x00, - 0x07,0x07,0x07,0x0c,0x02,0xff,0x10,0x1c,0x10,0x10,0x78,0x96,0x60,0x09,0x0b,0x16, - 0x0c,0x01,0xff,0x10,0x00,0x08,0x00,0x09,0x80,0x0e,0x00,0x08,0x00,0x08,0x00,0x08, - 0x00,0x78,0x00,0x8e,0x00,0x89,0x80,0x70,0x00,0x07,0x0b,0x0b,0x0c,0x02,0xff,0x20, - 0x18,0x40,0x80,0x80,0xbc,0xc2,0x82,0x02,0x0c,0x70,0x07,0x0b,0x0b,0x0c,0x02,0xff, - 0x88,0x54,0x52,0x62,0x62,0x42,0x42,0x04,0x04,0x08,0x10,0x08,0x0a,0x0a,0x0c,0x01, - 0xff,0x4e,0x34,0x08,0x10,0x3e,0x61,0x81,0x19,0x26,0x1c,0x0b,0x0b,0x16,0x0c,0x00, - 0xff,0x20,0x00,0x10,0x00,0x13,0x00,0x34,0x80,0xd8,0x80,0x10,0x80,0x10,0x80,0x30, - 0x80,0x50,0x80,0xb0,0x60,0x10,0x00,0x08,0x0a,0x0a,0x0c,0x01,0xff,0x4e,0x34,0x08, - 0x10,0x3e,0x61,0x81,0x01,0x06,0x18,0x08,0x07,0x07,0x0c,0x02,0xff,0x40,0x30,0xee, - 0x31,0x61,0xa2,0x24,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x10,0x00,0x10,0x00, - 0x9b,0x80,0x7c,0x40,0x10,0x20,0x10,0x20,0x30,0x20,0x50,0x40,0xb1,0x80,0x10,0x00, - 0x0a,0x0a,0x14,0x0c,0x01,0xff,0x4e,0x00,0x34,0x00,0x04,0x00,0x1f,0x00,0x28,0x80, - 0x48,0x40,0x90,0x40,0x96,0x40,0x69,0x80,0x47,0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff, - 0x20,0x00,0x1f,0x00,0x04,0x00,0x1f,0x00,0x20,0x80,0x4c,0x80,0x13,0x00,0x0c,0x00, - 0x00,0x00,0x59,0x80,0x86,0x40,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00, - 0x9e,0x00,0x70,0x00,0x21,0x80,0x72,0x00,0x8c,0x00,0x14,0x00,0x24,0x00,0x20,0x00, - 0x1f,0x00,0x0a,0x0a,0x14,0x0c,0x01,0xff,0x10,0x00,0x08,0x00,0x08,0x00,0x10,0x00, - 0x10,0x00,0x38,0x00,0x24,0x00,0x44,0x40,0x44,0x80,0x83,0x00,0x0a,0x0b,0x16,0x0c, - 0x00,0xff,0x10,0x00,0x0c,0x80,0x00,0x40,0x1d,0x00,0xe2,0x80,0x02,0x00,0x02,0x00, - 0x04,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0xff,0xff,0xff,0xff,0x04,0x03,0x03,0x0c, - 0x00,0x07,0x20,0x90,0x40,0xff,0x04,0x03,0x03,0x0c,0x00,0x06,0x20,0x90,0x40,0x03, - 0x03,0x03,0x0c,0x00,0x06,0x40,0xa0,0x40,0xff,0xff,0xff,0x05,0x03,0x03,0x06,0x00, - 0x01,0xf8,0x00,0xf8,0x04,0x04,0x04,0x06,0x00,0x00,0xf0,0x10,0x60,0x40,0x05,0x06, - 0x06,0x06,0x00,0x00,0xf8,0x08,0x28,0x30,0x20,0x40,0x03,0x04,0x04,0x06,0x01,0x00, - 0x20,0x40,0xc0,0x40,0x04,0x06,0x06,0x06,0x00,0x00,0x10,0x20,0x60,0xa0,0x20,0x20, - 0x04,0x04,0x04,0x06,0x00,0x00,0x20,0xf0,0x90,0x20,0x05,0x06,0x06,0x06,0x00,0x00, - 0x20,0xf8,0x88,0x08,0x10,0x20,0x03,0x04,0x04,0x06,0x01,0x00,0xe0,0x40,0x40,0xe0, - 0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0xf8,0x04,0x04,0x04,0x06,0x00, - 0x00,0x20,0xf0,0x60,0xa0,0x05,0x06,0x06,0x06,0x00,0x00,0x10,0xf8,0x30,0x50,0x90, - 0x10,0x05,0x06,0x06,0x06,0x00,0x00,0x40,0xf8,0x48,0x48,0x48,0x90,0x05,0x08,0x08, - 0x06,0x00,0x00,0x28,0x00,0x40,0xf8,0x48,0x48,0x48,0x90,0x05,0x06,0x06,0x06,0x00, - 0x00,0x20,0xf8,0x20,0xf8,0x20,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x28,0x00,0x20, - 0xf8,0x20,0xf8,0x20,0x20,0x04,0x05,0x05,0x06,0x00,0x00,0x70,0x90,0x10,0x20,0xc0, - 0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0x70,0x90,0x10,0x20,0xc0,0x05,0x06,0x06, - 0x06,0x00,0x00,0x40,0x78,0x90,0x10,0x10,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x28, - 0x00,0x40,0x78,0x90,0x10,0x10,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x08, - 0x08,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xf8,0x08,0x08,0x08,0xf8,0x05, - 0x06,0x06,0x06,0x00,0x00,0x50,0xf8,0x50,0x10,0x20,0x40,0x05,0x08,0x08,0x06,0x00, - 0x00,0x28,0x00,0x50,0xf8,0x50,0x10,0x20,0x40,0x05,0x05,0x05,0x06,0x00,0x00,0xc0, - 0x08,0xc8,0x10,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xc0,0x08,0xc8,0x10, - 0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x10,0x20,0x50,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0xf8,0x10,0x20,0x50,0x88,0x05,0x06,0x06,0x06,0x00,0x00,0x40, - 0xf8,0x48,0x50,0x40,0x38,0x05,0x08,0x08,0x06,0x00,0x00,0x28,0x00,0x40,0xf8,0x48, - 0x50,0x40,0x38,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x48,0x10,0x60,0x05,0x07, - 0x07,0x06,0x00,0x00,0x28,0x00,0x88,0x88,0x48,0x10,0x60,0x05,0x05,0x05,0x06,0x00, - 0x00,0x78,0x48,0xa8,0x10,0x60}; -const u8g_fntpgm_uint8_t fontpage_97_193_255[753] U8G_FONT_SECTION("fontpage_97_193_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xff,0x00,0x08,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x10,0xe0,0x20,0xf8,0x20,0x40,0x05,0x08,0x08, - 0x06,0x00,0x00,0x28,0x00,0x10,0xe0,0x20,0xf8,0x20,0x40,0x05,0x04,0x04,0x06,0x00, - 0x00,0xa8,0xa8,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0xa8,0x08,0x10,0x20, - 0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xa8,0xa8,0x08,0x10,0x20,0x05,0x06,0x06, - 0x06,0x00,0x00,0x70,0x00,0xf8,0x20,0x20,0x40,0x05,0x08,0x08,0x06,0x00,0x00,0x28, - 0x00,0x70,0x00,0xf8,0x20,0x20,0x40,0x03,0x06,0x06,0x06,0x01,0x00,0x80,0x80,0xc0, - 0xa0,0x80,0x80,0x04,0x08,0x08,0x06,0x01,0x00,0x50,0x00,0x80,0x80,0xc0,0xa0,0x80, - 0x80,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x20,0x20,0x40,0x80,0x05,0x05,0x05, - 0x06,0x00,0x00,0x70,0x00,0x00,0x00,0xf8,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08, - 0x50,0x20,0xd0,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x10,0x20,0x70,0xa8,0x03, - 0x06,0x06,0x06,0x01,0x00,0x20,0x20,0x20,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00, - 0x00,0x10,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0x10,0x88, - 0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x18,0x18,0x00,0x10,0x88,0x88,0x88, - 0x88,0x05,0x06,0x06,0x06,0x00,0x00,0x80,0x80,0xf8,0x80,0x80,0x78,0x05,0x07,0x07, - 0x06,0x00,0x00,0x28,0x80,0x80,0xf8,0x80,0x80,0x78,0x05,0x07,0x07,0x06,0x00,0x00, - 0x18,0x98,0x80,0xf8,0x80,0x80,0x78,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x08, - 0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xf8,0x08,0x08,0x10,0x60,0x05, - 0x08,0x08,0x06,0x00,0x00,0x18,0x18,0x00,0xf8,0x08,0x08,0x10,0x60,0x05,0x04,0x04, - 0x06,0x00,0x01,0x40,0xa0,0x10,0x08,0x05,0x06,0x06,0x06,0x00,0x01,0x28,0x00,0x40, - 0xa0,0x10,0x08,0x05,0x06,0x06,0x06,0x00,0x01,0x18,0x18,0x40,0xa0,0x10,0x08,0x05, - 0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x20,0xa8,0xa8,0x20,0x05,0x08,0x08,0x06,0x00, - 0x00,0x28,0x00,0x20,0xf8,0x20,0xa8,0xa8,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x18, - 0x18,0x20,0xf8,0x20,0xa8,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x50, - 0x20,0x10,0x04,0x05,0x05,0x06,0x01,0x00,0xe0,0x00,0xe0,0x00,0xf0,0x05,0x05,0x05, - 0x06,0x00,0x00,0x20,0x40,0x88,0xf8,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x28, - 0x10,0x28,0xc0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x40,0xf8,0x40,0x38,0x05,0x04, - 0x04,0x06,0x00,0x00,0x40,0xf8,0x50,0x40,0x05,0x06,0x06,0x06,0x00,0x00,0x40,0xf8, - 0x48,0x50,0x40,0x40,0x04,0x04,0x04,0x06,0x00,0x00,0x60,0x20,0x20,0xf0,0x05,0x05, - 0x05,0x06,0x00,0x00,0x70,0x10,0x10,0x10,0xf8,0x04,0x05,0x05,0x06,0x00,0x00,0xf0, - 0x10,0xf0,0x10,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf8,0x05, - 0x06,0x06,0x06,0x00,0x00,0x70,0x00,0xf8,0x08,0x10,0x20,0x04,0x06,0x06,0x06,0x00, - 0x00,0x90,0x90,0x90,0x90,0x10,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x20,0xa0,0xa8, - 0xa8,0xb0,0x04,0x05,0x05,0x06,0x00,0x00,0x80,0x80,0x90,0xa0,0xc0,0x05,0x05,0x05, - 0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0xf8,0x04,0x04,0x04,0x06,0x00,0x00,0xf0,0x90, - 0x10,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x88,0x08,0x10,0x20,0x05,0x06,0x06, - 0x06,0x00,0x00,0x10,0xf8,0x50,0x50,0xf8,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0xf8, - 0x08,0x30,0x20,0xf8,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x30,0x05, - 0x05,0x05,0x06,0x00,0x00,0xc0,0x08,0x08,0x10,0xe0,0x05,0x08,0x08,0x06,0x00,0x00, - 0x28,0x00,0x20,0xf8,0x88,0x08,0x10,0x20,0x04,0x04,0x04,0x06,0x00,0x00,0x40,0xf0, - 0x50,0xa0,0x04,0x04,0x04,0x06,0x00,0x00,0x40,0xf0,0x20,0x40,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0xf8,0x88,0x08,0x10,0x60,0x05,0x08,0x08,0x06,0x00,0x00,0x28, - 0x00,0x10,0xf8,0x50,0x50,0xf8,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xf8, - 0x08,0x30,0x20,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xf8,0x08,0xf8,0x08, - 0x30,0x02,0x02,0x02,0x06,0x02,0x02,0xc0,0xc0,0x05,0x01,0x01,0x06,0x00,0x02,0xf8, - 0x05,0x04,0x04,0x06,0x00,0x01,0x80,0x60,0x10,0x08,0x05,0x05,0x05,0x06,0x00,0x01, - 0x28,0x80,0x60,0x10,0x08,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x08, - 0x08}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(8, 128, 255, fontpage_8_128_255), // 'Ѐ' -- 'ѿ' - FONTDATA_ITEM(97, 129, 191, fontpage_97_129_191), // 'め' -- 'タ' - FONTDATA_ITEM(97, 193, 255, fontpage_97_193_255), // 'チ' -- 'ヿ' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_tr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_tr.h deleted file mode 100644 index b85a19f547..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_tr.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_159_159[33] U8G_FONT_SECTION("fontpage_2_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x06,0x00,0xfe,0x88,0x70,0x00,0x70,0x88,0x88,0x88,0x78,0x08, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_2_176_177[43] U8G_FONT_SECTION("fontpage_2_176_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb1,0x00,0x09,0x00,0x00, - 0x00,0x03,0x09,0x09,0x06,0x01,0x00,0x40,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0, - 0x03,0x05,0x05,0x06,0x01,0x00,0xc0,0x40,0x40,0x40,0xe0}; -const u8g_fntpgm_uint8_t fontpage_2_222_223[45] U8G_FONT_SECTION("fontpage_2_222_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xdf,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x09,0x09,0x06,0x00,0xfe,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x10,0x60, - 0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x80,0x70,0x08,0xf0,0x10,0x60}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 159, 159, fontpage_2_159_159), // 'ğ' -- 'ğ' - FONTDATA_ITEM(2, 176, 177, fontpage_2_176_177), // 'İ' -- 'ı' - FONTDATA_ITEM(2, 222, 223, fontpage_2_222_223), // 'Ş' -- 'ş' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_uk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_uk.h deleted file mode 100644 index d6e8337fd8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_uk.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_8_134_134[30] U8G_FONT_SECTION("fontpage_8_134_134") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x07,0x00,0x00, - 0x00,0x03,0x07,0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0}; -const u8g_fntpgm_uint8_t fontpage_8_144_146[56] U8G_FONT_SECTION("fontpage_8_144_146") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x92,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf0,0x80,0x80,0xf0,0x88,0x88,0xf0,0x05,0x07,0x07,0x06,0x00, - 0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0}; -const u8g_fntpgm_uint8_t fontpage_8_148_149[44] U8G_FONT_SECTION("fontpage_8_148_149") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x94,0x95,0x00,0x07,0xff,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0xff,0x30,0x50,0x50,0x50,0x50,0x50,0xf8,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8}; -const u8g_fntpgm_uint8_t fontpage_8_151_154[72] U8G_FONT_SECTION("fontpage_8_151_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x9a,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x70,0x08,0x88,0x70,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00, - 0x00,0x88,0x70,0x00,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88}; -const u8g_fntpgm_uint8_t fontpage_8_156_164[134] U8G_FONT_SECTION("fontpage_8_156_164") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9c,0xa4,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05,0x07, - 0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00, - 0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x88, - 0x88,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0x80, - 0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05, - 0x07,0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x88,0x88,0x88,0x88,0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x20, - 0x70,0xa8,0xa8,0xa8,0x70,0x20}; -const u8g_fntpgm_uint8_t fontpage_8_166_166[32] U8G_FONT_SECTION("fontpage_8_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x09,0x09,0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0x90,0x90,0xf8,0x08,0x08 - }; -const u8g_fntpgm_uint8_t fontpage_8_168_168[30] U8G_FONT_SECTION("fontpage_8_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xf8}; -const u8g_fntpgm_uint8_t fontpage_8_176_201[321] U8G_FONT_SECTION("fontpage_8_176_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xc9,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x80,0xf0,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf0, - 0x88,0xf0,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x80,0x80,0x80,0x80,0x05, - 0x06,0x06,0x06,0x00,0xff,0x30,0x50,0x50,0x50,0xf8,0x88,0x05,0x05,0x05,0x06,0x00, - 0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xa8,0x70,0x20,0x70, - 0xa8,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x30,0x88,0x70,0x05,0x05,0x05,0x06, - 0x00,0x00,0x88,0x98,0xa8,0xc8,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00, - 0x88,0x98,0xa8,0xc8,0x88,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90, - 0x05,0x05,0x05,0x06,0x00,0x00,0x38,0x48,0x48,0x48,0x88,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0xd8,0xa8,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0xf8,0x88, - 0x88,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88, - 0x88,0xf0,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x05, - 0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe, - 0x88,0x88,0x88,0x88,0x78,0x08,0x70,0x05,0x09,0x09,0x06,0x00,0xfe,0x20,0x20,0x70, - 0xa8,0xa8,0xa8,0x70,0x20,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50, - 0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0x90,0x90,0x90,0x90,0xf8,0x08,0x08,0x05,0x05, - 0x05,0x06,0x00,0x00,0x88,0x88,0x78,0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xa8, - 0xa8,0xa8,0xa8,0xf8,0x05,0x07,0x07,0x06,0x00,0xfe,0xa8,0xa8,0xa8,0xa8,0xf8,0x08, - 0x08}; -const u8g_fntpgm_uint8_t fontpage_8_204_204[28] U8G_FONT_SECTION("fontpage_8_204_204") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x05,0x00,0x00, - 0x00,0x04,0x05,0x05,0x06,0x01,0x00,0x80,0x80,0xe0,0x90,0xe0}; -const u8g_fntpgm_uint8_t fontpage_8_206_207[39] U8G_FONT_SECTION("fontpage_8_206_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xce,0xcf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xa8,0xe8,0xa8,0x90,0x04,0x05,0x05,0x06, - 0x01,0x00,0x70,0x90,0x70,0x50,0x90}; -const u8g_fntpgm_uint8_t fontpage_8_212_212[28] U8G_FONT_SECTION("fontpage_8_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x05,0x00,0x00, - 0x00,0x04,0x05,0x05,0x06,0x01,0x00,0x70,0x80,0xe0,0x80,0x70}; -const u8g_fntpgm_uint8_t fontpage_8_214_214[29] U8G_FONT_SECTION("fontpage_8_214_214") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0x00,0x06,0x00,0x00, - 0x00,0x03,0x06,0x06,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0xe0}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(8, 134, 134, fontpage_8_134_134), // 'І' -- 'І' - FONTDATA_ITEM(8, 144, 146, fontpage_8_144_146), // 'А' -- 'В' - FONTDATA_ITEM(8, 148, 149, fontpage_8_148_149), // 'Д' -- 'Е' - FONTDATA_ITEM(8, 151, 154, fontpage_8_151_154), // 'З' -- 'К' - FONTDATA_ITEM(8, 156, 164, fontpage_8_156_164), // 'М' -- 'Ф' - FONTDATA_ITEM(8, 166, 166, fontpage_8_166_166), // 'Ц' -- 'Ц' - FONTDATA_ITEM(8, 168, 168, fontpage_8_168_168), // 'Ш' -- 'Ш' - FONTDATA_ITEM(8, 176, 201, fontpage_8_176_201), // 'а' -- 'щ' - FONTDATA_ITEM(8, 204, 204, fontpage_8_204_204), // 'ь' -- 'ь' - FONTDATA_ITEM(8, 206, 207, fontpage_8_206_207), // 'ю' -- 'я' - FONTDATA_ITEM(8, 212, 212, fontpage_8_212_212), // 'є' -- 'є' - FONTDATA_ITEM(8, 214, 214, fontpage_8_214_214), // 'і' -- 'і' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_vi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_vi.h deleted file mode 100644 index 7c309907cd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_vi.h +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_2_131_131[31] U8G_FONT_SECTION("fontpage_2_131_131") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x70,0x08,0x78,0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_2_144_145[44] U8G_FONT_SECTION("fontpage_2_144_145") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x91,0x00,0x08,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0xe8,0x48,0x48,0xf0,0x06,0x08, - 0x08,0x06,0x00,0x00,0x08,0x1c,0x08,0x78,0x88,0x88,0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_2_169_169[31] U8G_FONT_SECTION("fontpage_2_169_169") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x08,0x00,0x00, - 0x00,0x04,0x08,0x08,0x06,0x00,0x00,0x50,0xa0,0x00,0x60,0x20,0x20,0x20,0x70}; -const u8g_fntpgm_uint8_t fontpage_3_161_161[30] U8G_FONT_SECTION("fontpage_3_161_161") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x07,0x00,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x70,0x88,0x88,0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_3_175_176[43] U8G_FONT_SECTION("fontpage_3_175_176") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xb0,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x08,0x98,0x90,0x90,0x90,0x90,0x90,0x60,0x05, - 0x06,0x06,0x06,0x00,0x00,0x08,0x98,0x90,0x90,0xb0,0x50}; -const u8g_fntpgm_uint8_t fontpage_6_131_131[25] U8G_FONT_SECTION("fontpage_6_131_131") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x02,0x02,0x06,0x00,0x08,0x68,0xb0}; -const u8g_fntpgm_uint8_t fontpage_6_137_137[26] U8G_FONT_SECTION("fontpage_6_137_137") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0x00,0x00, - 0x00,0x03,0x03,0x03,0x06,0x01,0x07,0xc0,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_6_163_163[24] U8G_FONT_SECTION("fontpage_6_163_163") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa3,0x00,0x00,0xfe,0x00, - 0x00,0x01,0x01,0x01,0x06,0x02,0xfe,0x80}; -const u8g_fntpgm_uint8_t fontpage_6_192_193[33] U8G_FONT_SECTION("fontpage_6_192_193") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc1,0x00,0x0a,0x00,0x00, - 0x00,0x02,0x02,0x02,0x06,0x01,0x08,0x80,0x40,0x02,0x02,0x02,0x06,0x02,0x08,0x40, - 0x80}; -const u8g_fntpgm_uint8_t fontpage_61_161_161[30] U8G_FONT_SECTION("fontpage_61_161_161") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x70,0x08,0x78,0x88,0x78,0x00,0x20}; -const u8g_fntpgm_uint8_t fontpage_61_163_163[32] U8G_FONT_SECTION("fontpage_61_163_163") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa3,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x78 - }; -const u8g_fntpgm_uint8_t fontpage_61_165_165[33] U8G_FONT_SECTION("fontpage_61_165_165") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0x00,0x00, - 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x30,0x48,0x00,0x70,0x08,0x78,0x88, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_167_167[33] U8G_FONT_SECTION("fontpage_61_167_167") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x30,0x48,0x00,0x70,0x08,0x78,0x88, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_169_169[34] U8G_FONT_SECTION("fontpage_61_169_169") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x0b,0x00,0x00, - 0x00,0x06,0x0b,0x0b,0x07,0x00,0x00,0x0c,0x04,0x08,0x30,0x48,0x00,0x70,0x08,0x78, - 0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_61_173_173[33] U8G_FONT_SECTION("fontpage_61_173_173") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x30,0x48,0x00,0x70,0x08,0x78,0x88,0x78,0x00, - 0x20}; -const u8g_fntpgm_uint8_t fontpage_61_175_175[33] U8G_FONT_SECTION("fontpage_61_175_175") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x08,0x10,0x48,0x30,0x00,0x70,0x08,0x78,0x88, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_177_177[33] U8G_FONT_SECTION("fontpage_61_177_177") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x40,0x20,0x48,0x30,0x00,0x70,0x08,0x78,0x88, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_179_179[34] U8G_FONT_SECTION("fontpage_61_179_179") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb3,0xb3,0x00,0x0b,0x00,0x00, - 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x18,0x08,0x10,0x48,0x30,0x00,0x70,0x08,0x78, - 0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_61_181_181[34] U8G_FONT_SECTION("fontpage_61_181_181") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb5,0xb5,0x00,0x0b,0x00,0x00, - 0x00,0x06,0x0b,0x0b,0x07,0x00,0x00,0x14,0x28,0x00,0x48,0x30,0x00,0x70,0x08,0x78, - 0x88,0x78}; -const u8g_fntpgm_uint8_t fontpage_61_183_183[33] U8G_FONT_SECTION("fontpage_61_183_183") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x48,0x30,0x00,0x70,0x08,0x78,0x88,0x78,0x00, - 0x20}; -const u8g_fntpgm_uint8_t fontpage_61_187_187[32] U8G_FONT_SECTION("fontpage_61_187_187") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x88,0xf0,0x80,0x78 - }; -const u8g_fntpgm_uint8_t fontpage_61_191_191[33] U8G_FONT_SECTION("fontpage_61_191_191") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0x00,0x00, - 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x20,0x50,0x00,0x70,0x88,0xf0,0x80, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_193_193[33] U8G_FONT_SECTION("fontpage_61_193_193") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xc1,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x20,0x50,0x00,0x70,0x88,0xf0,0x80, - 0x78}; -const u8g_fntpgm_uint8_t fontpage_61_195_195[34] U8G_FONT_SECTION("fontpage_61_195_195") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0x00,0x0b,0x00,0x00, - 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x18,0x08,0x10,0x60,0x90,0x00,0x60,0x90,0xf0, - 0x80,0x70}; -const u8g_fntpgm_uint8_t fontpage_61_199_199[33] U8G_FONT_SECTION("fontpage_61_199_199") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x20,0x50,0x00,0x70,0x88,0xf0,0x80,0x78,0x00, - 0x20}; -const u8g_fntpgm_uint8_t fontpage_61_201_201[32] U8G_FONT_SECTION("fontpage_61_201_201") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x09,0x00,0x00, - 0x00,0x03,0x09,0x09,0x07,0x02,0x00,0x60,0x20,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0 - }; -const u8g_fntpgm_uint8_t fontpage_61_203_203[32] U8G_FONT_SECTION("fontpage_61_203_203") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x07,0xfe,0x00, - 0x00,0x03,0x09,0x09,0x07,0x02,0xfe,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x00,0x40 - }; -const u8g_fntpgm_uint8_t fontpage_61_205_205[30] U8G_FONT_SECTION("fontpage_61_205_205") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x70,0x88,0x88,0x88,0x70,0x00,0x20}; -const u8g_fntpgm_uint8_t fontpage_61_207_207[32] U8G_FONT_SECTION("fontpage_61_207_207") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_209_209[33] U8G_FONT_SECTION("fontpage_61_209_209") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0x00,0x00, - 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x20,0x50,0x00,0x70,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_211_211[33] U8G_FONT_SECTION("fontpage_61_211_211") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x20,0x50,0x00,0x70,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_213_213[33] U8G_FONT_SECTION("fontpage_61_213_213") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd5,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x18,0x08,0x30,0x50,0x00,0x70,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_215_215[34] U8G_FONT_SECTION("fontpage_61_215_215") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd7,0xd7,0x00,0x0b,0x00,0x00, - 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x28,0x50,0x00,0x20,0x50,0x00,0x70,0x88,0x88, - 0x88,0x70}; -const u8g_fntpgm_uint8_t fontpage_61_217_217[33] U8G_FONT_SECTION("fontpage_61_217_217") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x08,0xfe,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x20,0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x00, - 0x20}; -const u8g_fntpgm_uint8_t fontpage_61_219_219[32] U8G_FONT_SECTION("fontpage_61_219_219") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdb,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x20,0x40,0x10,0x08,0x70,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_221_221[32] U8G_FONT_SECTION("fontpage_61_221_221") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x80,0x40,0x10,0x08,0x70,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_223_223[33] U8G_FONT_SECTION("fontpage_61_223_223") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x60,0x20,0x40,0x10,0x08,0x70,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_225_225[32] U8G_FONT_SECTION("fontpage_61_225_225") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x09,0x00,0x00, - 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x50,0xa0,0x10,0x08,0x70,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_227_227[32] U8G_FONT_SECTION("fontpage_61_227_227") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe3,0xe3,0x00,0x07,0xfe,0x00, - 0x00,0x05,0x09,0x09,0x00,0x00,0xfe,0x10,0x08,0x70,0x88,0x88,0x88,0x70,0x00,0x20 - }; -const u8g_fntpgm_uint8_t fontpage_61_229_229[30] U8G_FONT_SECTION("fontpage_61_229_229") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x88,0x88,0x88,0x88,0x70,0x00,0x20}; -const u8g_fntpgm_uint8_t fontpage_61_231_231[33] U8G_FONT_SECTION("fontpage_61_231_231") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xe7,0x00,0x0a,0x00,0x00, - 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x00,0x88,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_233_233[32] U8G_FONT_SECTION("fontpage_61_233_233") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x09,0x00,0x00, - 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x10,0x20,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_235_235[32] U8G_FONT_SECTION("fontpage_61_235_235") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xeb,0xeb,0x00,0x09,0x00,0x00, - 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x40,0x20,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_237_237[33] U8G_FONT_SECTION("fontpage_61_237_237") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x0a,0x00,0x00, - 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x30,0x10,0x20,0x0c,0x04,0x88,0x88,0x88,0x88, - 0x70}; -const u8g_fntpgm_uint8_t fontpage_61_239_239[32] U8G_FONT_SECTION("fontpage_61_239_239") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x09,0x00,0x00, - 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x28,0x50,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 - }; -const u8g_fntpgm_uint8_t fontpage_61_241_241[32] U8G_FONT_SECTION("fontpage_61_241_241") = { - 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x07,0xfe,0x00, - 0x00,0x06,0x09,0x09,0x07,0x00,0xfe,0x0c,0x04,0x88,0x88,0x88,0x88,0x70,0x00,0x20 - }; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(2, 131, 131, fontpage_2_131_131), // 'ă' -- 'ă' - FONTDATA_ITEM(2, 144, 145, fontpage_2_144_145), // 'Đ' -- 'đ' - FONTDATA_ITEM(2, 169, 169, fontpage_2_169_169), // 'ĩ' -- 'ĩ' - FONTDATA_ITEM(3, 161, 161, fontpage_3_161_161), // 'ơ' -- 'ơ' - FONTDATA_ITEM(3, 175, 176, fontpage_3_175_176), // 'Ư' -- 'ư' - FONTDATA_ITEM(6, 131, 131, fontpage_6_131_131), // '̃' -- '̃' - FONTDATA_ITEM(6, 137, 137, fontpage_6_137_137), // '̉' -- '̉' - FONTDATA_ITEM(6, 163, 163, fontpage_6_163_163), // '̣' -- '̣' - FONTDATA_ITEM(6, 192, 193, fontpage_6_192_193), // '̀' -- '́' - FONTDATA_ITEM(61, 161, 161, fontpage_61_161_161), // 'ạ' -- 'ạ' - FONTDATA_ITEM(61, 163, 163, fontpage_61_163_163), // 'ả' -- 'ả' - FONTDATA_ITEM(61, 165, 165, fontpage_61_165_165), // 'ấ' -- 'ấ' - FONTDATA_ITEM(61, 167, 167, fontpage_61_167_167), // 'ầ' -- 'ầ' - FONTDATA_ITEM(61, 169, 169, fontpage_61_169_169), // 'ẩ' -- 'ẩ' - FONTDATA_ITEM(61, 173, 173, fontpage_61_173_173), // 'ậ' -- 'ậ' - FONTDATA_ITEM(61, 175, 175, fontpage_61_175_175), // 'ắ' -- 'ắ' - FONTDATA_ITEM(61, 177, 177, fontpage_61_177_177), // 'ằ' -- 'ằ' - FONTDATA_ITEM(61, 179, 179, fontpage_61_179_179), // 'ẳ' -- 'ẳ' - FONTDATA_ITEM(61, 181, 181, fontpage_61_181_181), // 'ẵ' -- 'ẵ' - FONTDATA_ITEM(61, 183, 183, fontpage_61_183_183), // 'ặ' -- 'ặ' - FONTDATA_ITEM(61, 187, 187, fontpage_61_187_187), // 'ẻ' -- 'ẻ' - FONTDATA_ITEM(61, 191, 191, fontpage_61_191_191), // 'ế' -- 'ế' - FONTDATA_ITEM(61, 193, 193, fontpage_61_193_193), // 'ề' -- 'ề' - FONTDATA_ITEM(61, 195, 195, fontpage_61_195_195), // 'ể' -- 'ể' - FONTDATA_ITEM(61, 199, 199, fontpage_61_199_199), // 'ệ' -- 'ệ' - FONTDATA_ITEM(61, 201, 201, fontpage_61_201_201), // 'ỉ' -- 'ỉ' - FONTDATA_ITEM(61, 203, 203, fontpage_61_203_203), // 'ị' -- 'ị' - FONTDATA_ITEM(61, 205, 205, fontpage_61_205_205), // 'ọ' -- 'ọ' - FONTDATA_ITEM(61, 207, 207, fontpage_61_207_207), // 'ỏ' -- 'ỏ' - FONTDATA_ITEM(61, 209, 209, fontpage_61_209_209), // 'ố' -- 'ố' - FONTDATA_ITEM(61, 211, 211, fontpage_61_211_211), // 'ồ' -- 'ồ' - FONTDATA_ITEM(61, 213, 213, fontpage_61_213_213), // 'ổ' -- 'ổ' - FONTDATA_ITEM(61, 215, 215, fontpage_61_215_215), // 'ỗ' -- 'ỗ' - FONTDATA_ITEM(61, 217, 217, fontpage_61_217_217), // 'ộ' -- 'ộ' - FONTDATA_ITEM(61, 219, 219, fontpage_61_219_219), // 'ớ' -- 'ớ' - FONTDATA_ITEM(61, 221, 221, fontpage_61_221_221), // 'ờ' -- 'ờ' - FONTDATA_ITEM(61, 223, 223, fontpage_61_223_223), // 'ở' -- 'ở' - FONTDATA_ITEM(61, 225, 225, fontpage_61_225_225), // 'ỡ' -- 'ỡ' - FONTDATA_ITEM(61, 227, 227, fontpage_61_227_227), // 'ợ' -- 'ợ' - FONTDATA_ITEM(61, 229, 229, fontpage_61_229_229), // 'ụ' -- 'ụ' - FONTDATA_ITEM(61, 231, 231, fontpage_61_231_231), // 'ủ' -- 'ủ' - FONTDATA_ITEM(61, 233, 233, fontpage_61_233_233), // 'ứ' -- 'ứ' - FONTDATA_ITEM(61, 235, 235, fontpage_61_235_235), // 'ừ' -- 'ừ' - FONTDATA_ITEM(61, 237, 237, fontpage_61_237_237), // 'ử' -- 'ử' - FONTDATA_ITEM(61, 239, 239, fontpage_61_239_239), // 'ữ' -- 'ữ' - FONTDATA_ITEM(61, 241, 241, fontpage_61_241_241), // 'ự' -- 'ự' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h deleted file mode 100644 index 87183cd5df..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h +++ /dev/null @@ -1,1293 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x07,0x00,0x00, - 0x00,0x05,0x03,0x03,0x06,0x00,0x04,0xd8,0x48,0x90}; -const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x18,0x28,0x48,0xf8}; -const u8g_fntpgm_uint8_t fontpage_156_128_128[27] U8G_FONT_SECTION("fontpage_156_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x06,0x00,0x00, - 0x00,0x0b,0x02,0x04,0x0c,0x00,0x04,0x00,0x40,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_137_139[97] U8G_FONT_SECTION("fontpage_156_137_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xe0,0x0b,0x0b,0x16,0x0c,0x00, - 0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x07,0xc0,0x04,0x00,0x04,0x00,0x04, - 0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x0b,0x0a,0x14,0x0c,0x00,0xff,0xff,0xe0,0x04, - 0x00,0x04,0x00,0x06,0x00,0x05,0x00,0x04,0x80,0x04,0x80,0x04,0x00,0x04,0x00,0x04, - 0x00}; -const u8g_fntpgm_uint8_t fontpage_156_157_157[45] U8G_FONT_SECTION("fontpage_156_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x29,0x40,0x4a,0x40,0xf7, - 0x80,0x10,0x80,0x21,0x00,0x42,0x00,0xf7,0xc0,0x00,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_170_170[45] U8G_FONT_SECTION("fontpage_156_170_170") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xaa,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x49, - 0x00,0x88,0xc0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_156_173_173[45] U8G_FONT_SECTION("fontpage_156_173_173") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0xff,0x80,0x88,0x80,0x88, - 0x80,0x88,0x80,0xff,0x80,0x88,0x80,0x08,0x00,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_156_187_187[45] U8G_FONT_SECTION("fontpage_156_187_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04, - 0x00,0x04,0x00,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_203_203[45] U8G_FONT_SECTION("fontpage_156_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0x7f,0xc0,0x00,0x80,0x01, - 0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x30,0x00,0x48,0x00,0x87,0xe0}; -const u8g_fntpgm_uint8_t fontpage_157_134_134[45] U8G_FONT_SECTION("fontpage_157_134_134") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0xff,0x80,0x01,0x00,0x02,0x00,0x0c,0x00,0x08, - 0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x28,0x00,0x10,0x00}; -const u8g_fntpgm_uint8_t fontpage_157_142_142[45] U8G_FONT_SECTION("fontpage_157_142_142") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8e,0x8e,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff, - 0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x1c,0x00}; -const u8g_fntpgm_uint8_t fontpage_157_174_174[45] U8G_FONT_SECTION("fontpage_157_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x11,0x00,0x1f,0x00,0x00, - 0x00,0xff,0xe0,0x80,0x20,0x1f,0x00,0x11,0x00,0x21,0x20,0xc0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_157_206_206[45] U8G_FONT_SECTION("fontpage_157_206_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xce,0xce,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x11,0x00,0x11,0x00,0x11, - 0x00,0x11,0x00,0x2a,0x80,0x2a,0x80,0x44,0x40,0x88,0x40,0x10,0x20}; -const u8g_fntpgm_uint8_t fontpage_157_228_228[45] U8G_FONT_SECTION("fontpage_157_228_228") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x0a,0x00,0x11,0x00,0x24, - 0x80,0xc2,0x60,0x3f,0x80,0x01,0x00,0x0a,0x00,0x04,0x00,0x02,0x00}; -const u8g_fntpgm_uint8_t fontpage_157_253_253[45] U8G_FONT_SECTION("fontpage_157_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x80,0x12,0x80,0x22,0x40,0x24,0x40,0x68, - 0x20,0xa7,0xc0,0x22,0x40,0x22,0x40,0x22,0x40,0x24,0x40,0x28,0xc0}; -const u8g_fntpgm_uint8_t fontpage_158_145_145[45] U8G_FONT_SECTION("fontpage_158_145_145") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x21,0x00,0x3f,0xe0,0x61, - 0x00,0xa3,0x80,0x23,0x80,0x25,0x40,0x29,0x20,0x31,0x00,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_158_205_206[73] U8G_FONT_SECTION("fontpage_158_205_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xce,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x11,0x00,0x20,0x00,0x2f,0xe0,0x60, - 0x00,0xa4,0x40,0x22,0x40,0x22,0x80,0x20,0x80,0x21,0x00,0x2f,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x10,0xc0,0x1f,0x00,0x29,0x00,0x29,0x00,0x69,0x00,0xaf,0xe0,0x29, - 0x00,0x29,0x20,0x2a,0xa0,0x2d,0x60,0x28,0xa0}; -const u8g_fntpgm_uint8_t fontpage_158_220_220[45] U8G_FONT_SECTION("fontpage_158_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x14,0x00,0x14,0x00,0x27,0xe0,0x2a,0x00,0x72, - 0x00,0xa3,0xc0,0x22,0x00,0x22,0x00,0x23,0xe0,0x22,0x00,0x22,0x00}; -const u8g_fntpgm_uint8_t fontpage_159_155_155[45] U8G_FONT_SECTION("fontpage_159_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x14,0x80,0x14,0x80,0x24,0x80,0x2f,0xe0,0x64, - 0x80,0xa4,0x80,0x3f,0xe0,0x20,0x00,0x24,0x80,0x28,0x40,0x30,0x20}; -const u8g_fntpgm_uint8_t fontpage_159_221_221[45] U8G_FONT_SECTION("fontpage_159_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x17,0xc0,0x14,0x40,0x24,0x40,0x27,0xc0,0x61, - 0x00,0xaf,0xe0,0x21,0x00,0x23,0x80,0x25,0x40,0x29,0x20,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_159_225_225[45] U8G_FONT_SECTION("fontpage_159_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x11,0x00,0x2f,0xe0,0x20,0x00,0x67, - 0xc0,0xa0,0x00,0x27,0xc0,0x20,0x00,0x27,0xc0,0x24,0x40,0x27,0xc0}; -const u8g_fntpgm_uint8_t fontpage_160_188_188[45] U8G_FONT_SECTION("fontpage_160_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x1f,0xe0,0x22,0x00,0x27,0xc0,0x64, - 0x40,0xa7,0xc0,0x24,0x40,0x27,0x40,0x25,0xc0,0x24,0x40,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_160_207_207[45] U8G_FONT_SECTION("fontpage_160_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x28,0x20,0x2f,0xe0,0x68, - 0x00,0xaf,0xe0,0x2a,0xa0,0x2f,0xe0,0x2a,0xa0,0x3a,0xa0,0x28,0x60}; -const u8g_fntpgm_uint8_t fontpage_160_220_220[45] U8G_FONT_SECTION("fontpage_160_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x3f,0xe0,0x20,0x00,0x4f,0xc0,0x48, - 0x40,0xdf,0xe0,0x50,0x20,0x4f,0xc0,0x41,0x00,0x41,0x00,0x47,0x00}; -const u8g_fntpgm_uint8_t fontpage_161_168_168[45] U8G_FONT_SECTION("fontpage_161_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x61,0x20,0x57,0xc0,0x41,0x40,0x77,0xe0,0xd1, - 0x00,0x53,0xc0,0x56,0x40,0x53,0xc0,0x5a,0x40,0x52,0x40,0x43,0xc0}; -const u8g_fntpgm_uint8_t fontpage_162_197_197[45] U8G_FONT_SECTION("fontpage_162_197_197") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x04,0x00,0xff,0xc0,0x08,0x00,0x11,0x00,0x7f, - 0x80,0x12,0x80,0x12,0x00,0x12,0x00,0x22,0x40,0x22,0x40,0xc1,0xc0}; -const u8g_fntpgm_uint8_t fontpage_162_200_200[45] U8G_FONT_SECTION("fontpage_162_200_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x84, - 0x00,0xff,0xe0,0x12,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0xc1,0xe0}; -const u8g_fntpgm_uint8_t fontpage_162_229_229[45] U8G_FONT_SECTION("fontpage_162_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x18,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0a, - 0x00,0x0a,0x00,0x11,0x00,0x11,0x00,0x20,0x80,0x40,0x40,0x80,0x20}; -const u8g_fntpgm_uint8_t fontpage_162_232_232[45] U8G_FONT_SECTION("fontpage_162_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xdf, - 0x60,0x04,0x00,0x04,0x00,0x1f,0x00,0x04,0x00,0x04,0x00,0x7f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_162_241_241[45] U8G_FONT_SECTION("fontpage_162_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x7f,0xc0,0x11,0x00,0x11, - 0x00,0x11,0x00,0xff,0xe0,0x00,0x00,0x11,0x00,0x20,0x80,0x40,0x40}; -const u8g_fntpgm_uint8_t fontpage_162_243_243[45] U8G_FONT_SECTION("fontpage_162_243_243") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf3,0xf3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x11,0x00,0x7f,0xc0,0x04,0x00,0x04, - 0x00,0xff,0xc0,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60}; -const u8g_fntpgm_uint8_t fontpage_162_247_247[45] U8G_FONT_SECTION("fontpage_162_247_247") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f, - 0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff,0xe0,0x11,0x00,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_163_183_183[45] U8G_FONT_SECTION("fontpage_163_183_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x82,0x00,0x42,0x00,0x05,0x00,0x28,0x80,0x32, - 0x60,0x41,0x00,0x4f,0xc0,0x80,0x80,0x87,0x00,0x81,0x00,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_163_198_198[45] U8G_FONT_SECTION("fontpage_163_198_198") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0a,0x00,0x89,0x00,0x4f,0xe0,0x59,0x00,0x09, - 0x00,0x2f,0xc0,0x29,0x00,0xcf,0xc0,0x49,0x00,0x49,0x00,0x4f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_163_201_201[45] U8G_FONT_SECTION("fontpage_163_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x81,0x00,0x4f,0xe0,0x40,0x00,0x07,0xc0,0x24, - 0x40,0x24,0x40,0x27,0xc0,0xc1,0x00,0x45,0x40,0x49,0x20,0x53,0x20}; -const u8g_fntpgm_uint8_t fontpage_163_250_251[73] U8G_FONT_SECTION("fontpage_163_250_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x44,0x40,0x44,0x40,0x7f, - 0xc0,0x04,0x00,0x84,0x20,0x84,0x20,0x84,0x20,0x84,0x20,0xff,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x7f,0xc0,0x04,0x00,0x04,0x00,0xff,0xe0,0x04, - 0x00,0x44,0x40,0x44,0x40,0x44,0x40,0x7f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_164_134_134[45] U8G_FONT_SECTION("fontpage_164_134_134") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x20,0x80,0x20,0x80,0x40, - 0x40,0xbf,0xa0,0x08,0x80,0x08,0x80,0x10,0x80,0x20,0x80,0xc3,0x00}; -const u8g_fntpgm_uint8_t fontpage_164_155_155[45] U8G_FONT_SECTION("fontpage_164_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x20,0x18,0x20,0x24,0xa0,0x42,0xa0,0xbc, - 0xa0,0x24,0xa0,0x24,0xa0,0x38,0xa0,0x22,0x20,0x22,0x20,0x1e,0x60}; -const u8g_fntpgm_uint8_t fontpage_164_157_157[45] U8G_FONT_SECTION("fontpage_164_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x27,0xe0,0xf9,0x20,0x11,0x20,0x21, - 0x20,0x69,0x20,0xb1,0x20,0x29,0x20,0x22,0x20,0x24,0x20,0x28,0xc0}; -const u8g_fntpgm_uint8_t fontpage_164_176_176[45] U8G_FONT_SECTION("fontpage_164_176_176") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfe,0x20,0x10,0x20,0x20,0xa0,0x44,0xa0,0xfe, - 0xa0,0x10,0xa0,0x7c,0xa0,0x10,0xa0,0x10,0x20,0x1e,0x20,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_164_182_183[73] U8G_FONT_SECTION("fontpage_164_182_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb6,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x20,0x50,0xa0,0x7e,0xa0,0x90,0xa0,0xfe, - 0xa0,0x10,0xa0,0x7e,0xa0,0x52,0xa0,0x52,0x20,0x56,0x20,0x10,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x7e,0x20,0x42,0x20,0x7e,0xa0,0x48,0xa0,0x48,0xa0,0x7e,0xa0,0x6a, - 0xa0,0xaa,0xa0,0xaa,0xa0,0x2e,0x20,0x08,0xe0}; -const u8g_fntpgm_uint8_t fontpage_165_155_155[45] U8G_FONT_SECTION("fontpage_165_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0x08,0x00,0xff,0x80,0x08, - 0x80,0x08,0x80,0x10,0x80,0x10,0x80,0x20,0x80,0x40,0x80,0x87,0x00}; -const u8g_fntpgm_uint8_t fontpage_165_160_160[45] U8G_FONT_SECTION("fontpage_165_160_160") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x20,0x00,0xfd,0xe0,0x25,0x20,0x25, - 0x20,0x25,0x20,0x25,0x20,0x25,0x20,0x45,0x20,0x55,0xe0,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_165_168_168[45] U8G_FONT_SECTION("fontpage_165_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0x79,0x00,0x01,0x00,0x03,0xe0,0xfd, - 0x20,0x21,0x20,0x21,0x20,0x49,0x20,0xfa,0x20,0x0a,0x20,0x04,0xc0}; -const u8g_fntpgm_uint8_t fontpage_166_150_150[45] U8G_FONT_SECTION("fontpage_166_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x12,0x00,0x22,0x40,0x22,0x80,0x63, - 0x00,0xa2,0x00,0x26,0x00,0x2a,0x00,0x22,0x20,0x22,0x20,0x21,0xe0}; -const u8g_fntpgm_uint8_t fontpage_166_202_202[45] U8G_FONT_SECTION("fontpage_166_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x24,0x80,0x15,0x00,0x7f, - 0xc0,0x04,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_207_207[45] U8G_FONT_SECTION("fontpage_166_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x42,0x00,0x4f,0x80,0xe2,0x80,0x42, - 0x80,0x4a,0xc0,0x52,0xa0,0x44,0x80,0x44,0x80,0x4a,0x80,0x51,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_213_213[45] U8G_FONT_SECTION("fontpage_166_213_213") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x0a,0x00,0x7f,0xc0,0x44,0x40,0x7f, - 0xc0,0x44,0x40,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_225_225[45] U8G_FONT_SECTION("fontpage_166_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x0f,0x80,0x08,0x00,0x08,0x00,0xff, - 0xe0,0x08,0x00,0x0a,0x00,0x09,0x00,0x08,0x80,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_240_240[45] U8G_FONT_SECTION("fontpage_166_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x10,0x00,0xe7,0xc0,0x84,0x40,0x84,0x40,0xf4, - 0x40,0x84,0x40,0x84,0x40,0x94,0x40,0xe5,0x80,0x84,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_248_248[45] U8G_FONT_SECTION("fontpage_166_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x7d,0xe0,0x91,0x20,0x11,0x20,0xff, - 0x20,0x11,0x20,0x5d,0x20,0x51,0x20,0x51,0xa0,0x5d,0x40,0xe1,0x00}; -const u8g_fntpgm_uint8_t fontpage_167_159_159[45] U8G_FONT_SECTION("fontpage_167_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xe0,0x22,0x00,0x2f,0xc0,0x28,0x40,0x2f, - 0xc0,0x28,0x40,0x2f,0xc0,0x22,0x00,0x2a,0x80,0x52,0x60,0xa6,0x20}; -const u8g_fntpgm_uint8_t fontpage_167_204_204[43] U8G_FONT_SECTION("fontpage_167_204_204") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x09,0xff,0x00, - 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0xff,0xe0,0x0a,0x40,0x4a,0x40,0x2a,0x40,0x11, - 0x40,0x11,0x40,0x28,0x80,0x45,0x80,0x82,0x40,0x04,0x20}; -const u8g_fntpgm_uint8_t fontpage_167_214_214[45] U8G_FONT_SECTION("fontpage_167_214_214") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfc,0x00,0x4b,0xe0,0x4a,0x20,0x7a,0x20,0x49, - 0x40,0x79,0x40,0x48,0x80,0x4c,0x80,0xf9,0x40,0x0a,0x40,0x0c,0x20}; -const u8g_fntpgm_uint8_t fontpage_167_216_216[45] U8G_FONT_SECTION("fontpage_167_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0xff,0xc0,0x12,0x00,0x52,0x80,0x92, - 0x40,0x00,0x00,0x7f,0x80,0x12,0x00,0x0c,0x00,0x12,0x00,0xe1,0xc0}; -const u8g_fntpgm_uint8_t fontpage_167_240_240[45] U8G_FONT_SECTION("fontpage_167_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x10,0x00,0x22,0x00,0x41,0x00,0xff, - 0x80,0x00,0x80,0x7f,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7f,0x00}; -const u8g_fntpgm_uint8_t fontpage_168_136_136[45] U8G_FONT_SECTION("fontpage_168_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xdf, - 0x60,0x00,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x3f,0x80,0x20,0x80}; -const u8g_fntpgm_uint8_t fontpage_168_142_142[45] U8G_FONT_SECTION("fontpage_168_142_142") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8e,0x8e,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0xc0,0x3e,0x00,0x20,0x00,0x3f,0xe0,0x20, - 0x00,0x20,0x00,0x2f,0xc0,0x28,0x40,0x48,0x40,0x4f,0xc0,0x88,0x40}; -const u8g_fntpgm_uint8_t fontpage_168_175_175[45] U8G_FONT_SECTION("fontpage_168_175_175") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x3f,0xc0,0x20,0x40,0x20,0x40,0x3f, - 0xc0,0x20,0x00,0x3f,0xc0,0x30,0x40,0x50,0x40,0x5f,0xc0,0x90,0x40}; -const u8g_fntpgm_uint8_t fontpage_168_253_253[45] U8G_FONT_SECTION("fontpage_168_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0xee,0xe0,0x00, - 0x00,0x7b,0xc0,0x4a,0x40,0x4a,0x40,0x7a,0x40,0x4a,0xc0,0x02,0x00}; -const u8g_fntpgm_uint8_t fontpage_169_140_140[45] U8G_FONT_SECTION("fontpage_169_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0c,0x00,0x70,0x00,0x11,0xe0,0xfd,0x20,0x11, - 0x20,0x39,0x20,0x35,0x20,0x55,0x20,0x91,0x20,0x11,0xe0,0x10,0x00}; -const u8g_fntpgm_uint8_t fontpage_171_183_183[45] U8G_FONT_SECTION("fontpage_171_183_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xef,0xe0,0xa5,0x40,0xaf,0xe0,0xa4, - 0x40,0xaf,0xe0,0xe8,0x20,0xa9,0x20,0x09,0x20,0x02,0x80,0x0c,0x60}; -const u8g_fntpgm_uint8_t fontpage_172_180_180[45] U8G_FONT_SECTION("fontpage_172_180_180") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0xa0,0xeb,0xc0,0xaa,0xa0,0xbf,0xe0,0xa4, - 0x80,0xaf,0xe0,0xf9,0x20,0x0f,0xe0,0x09,0x20,0x0f,0xe0,0x11,0x20}; -const u8g_fntpgm_uint8_t fontpage_172_244_244[45] U8G_FONT_SECTION("fontpage_172_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xef,0xe0,0xa5,0x40,0xaf,0xe0,0xa4, - 0x40,0xa7,0xc0,0xe4,0x40,0x07,0xc0,0x04,0x40,0x07,0xc0,0x0c,0x60}; -const u8g_fntpgm_uint8_t fontpage_173_222_222[45] U8G_FONT_SECTION("fontpage_173_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x80,0x40,0x80,0x40,0x9e,0x40,0x92, - 0x40,0x92,0x40,0x9e,0x40,0x92,0x40,0x80,0x40,0xff,0xc0,0x80,0x40}; -const u8g_fntpgm_uint8_t fontpage_173_224_224[45] U8G_FONT_SECTION("fontpage_173_224_224") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x84,0x20,0x84,0x20,0xbf,0xa0,0x84, - 0x20,0x84,0x20,0x8a,0x20,0x91,0x20,0xa0,0xa0,0x80,0x20,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_173_254_254[45] U8G_FONT_SECTION("fontpage_173_254_254") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x90,0x40,0x9f,0x40,0xb2,0x40,0xcc, - 0x40,0x92,0x40,0xe9,0xc0,0x84,0x40,0x88,0x40,0x84,0x40,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_174_168_168[45] U8G_FONT_SECTION("fontpage_174_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0xff,0xc0,0x10,0x00,0x22, - 0x00,0x62,0x00,0xaf,0x80,0x22,0x00,0x22,0x00,0x22,0x00,0x3f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_174_215_215[45] U8G_FONT_SECTION("fontpage_174_215_215") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd7,0xd7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x27,0xc0,0xf9,0x40,0x21, - 0x40,0x21,0x40,0x2f,0xe0,0x31,0x00,0xc2,0x80,0x04,0x40,0x18,0x20}; -const u8g_fntpgm_uint8_t fontpage_175_139_139[45] U8G_FONT_SECTION("fontpage_175_139_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8b,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7e,0x40,0x29,0x40,0x29,0x40,0xff,0x40,0x29, - 0x40,0x28,0x40,0x4c,0xc0,0x04,0x00,0x3f,0x80,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_175_171_171[45] U8G_FONT_SECTION("fontpage_175_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0xff,0x80,0x22,0x80,0x36,0xa0,0xe3, - 0xa0,0x2c,0xe0,0x64,0x00,0x04,0x00,0x3f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_176_235_235[45] U8G_FONT_SECTION("fontpage_176_235_235") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xeb,0xeb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x21,0x00,0xf7,0xc0,0x24, - 0x40,0x27,0x40,0x25,0xc0,0x34,0x40,0xef,0xe0,0x02,0x80,0x0c,0x60}; -const u8g_fntpgm_uint8_t fontpage_177_243_243[45] U8G_FONT_SECTION("fontpage_177_243_243") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf3,0xf3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x04,0x00,0x3f,0xc0,0x00, - 0x00,0xff,0xe0,0x80,0x20,0x1f,0x00,0x11,0x20,0x21,0x20,0xc0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_178_135_135[45] U8G_FONT_SECTION("fontpage_178_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x1f,0x80,0x31,0x00,0x4e,0x00,0x0b, - 0x00,0x30,0xe0,0xff,0x80,0x24,0x80,0x3f,0x80,0x24,0x80,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_178_141_141[45] U8G_FONT_SECTION("fontpage_178_141_141") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x3f,0xe0,0x60,0x80,0xbf,0x80,0x20, - 0x80,0x3f,0x80,0x10,0x00,0x3f,0x80,0xc9,0x00,0x06,0x00,0xf9,0xe0}; -const u8g_fntpgm_uint8_t fontpage_178_150_150[45] U8G_FONT_SECTION("fontpage_178_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x3d,0x00,0x25,0x00,0x45, - 0x80,0xa5,0x40,0x19,0x20,0x09,0x00,0x11,0x00,0x21,0x00,0x41,0x00}; -const u8g_fntpgm_uint8_t fontpage_178_154_154[45] U8G_FONT_SECTION("fontpage_178_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x1f,0x00,0x21,0x00,0x52,0x00,0x0c, - 0x00,0x34,0x00,0xcf,0x80,0x10,0x80,0x69,0x00,0x06,0x00,0xf8,0x00}; -const u8g_fntpgm_uint8_t fontpage_178_167_167[45] U8G_FONT_SECTION("fontpage_178_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x04, - 0x00,0x04,0x00,0x0a,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60}; -const u8g_fntpgm_uint8_t fontpage_178_169_170[73] U8G_FONT_SECTION("fontpage_178_169_170") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xaa,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff, - 0xe0,0x04,0x00,0x0a,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x0a,0x00,0x0a, - 0x00,0x11,0x00,0x19,0x00,0x24,0x80,0xc4,0x60}; -const u8g_fntpgm_uint8_t fontpage_178_177_177[45] U8G_FONT_SECTION("fontpage_178_177_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60}; -const u8g_fntpgm_uint8_t fontpage_179_203_203[45] U8G_FONT_SECTION("fontpage_179_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0xfa,0x40,0x2a,0x20,0x2f, - 0xe0,0x48,0x00,0x53,0xe0,0x32,0x20,0x2a,0x20,0x4b,0xe0,0x82,0x20}; -const u8g_fntpgm_uint8_t fontpage_182_208_208[45] U8G_FONT_SECTION("fontpage_182_208_208") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x01,0x00,0x02,0x00,0x04,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x14,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_182_216_216[45] U8G_FONT_SECTION("fontpage_182_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0xff,0xe0,0x10,0x00,0x2f,0xc0,0x20, - 0x80,0x61,0x00,0xbf,0xe0,0x21,0x00,0x21,0x00,0x21,0x00,0x27,0x00}; -const u8g_fntpgm_uint8_t fontpage_183_137_137[45] U8G_FONT_SECTION("fontpage_183_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x88,0x40,0x08, - 0x00,0xff,0xe0,0x11,0x00,0x31,0x00,0x0e,0x00,0x09,0x80,0x70,0x60}; -const u8g_fntpgm_uint8_t fontpage_183_140_140[45] U8G_FONT_SECTION("fontpage_183_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x9f,0x40,0x00, - 0x00,0x7f,0xe0,0x0a,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0x41,0xe0}; -const u8g_fntpgm_uint8_t fontpage_183_154_154[45] U8G_FONT_SECTION("fontpage_183_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x80,0x40,0x3f, - 0xc0,0x04,0x00,0x24,0x00,0x27,0x80,0x24,0x00,0x54,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_183_162_162[45] U8G_FONT_SECTION("fontpage_183_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0xff,0xc0,0x90,0x40,0x3f,0x00,0x52, - 0x00,0x8c,0x00,0x33,0x00,0xff,0xc0,0x21,0x00,0x21,0x00,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_183_185_185[45] U8G_FONT_SECTION("fontpage_183_185_185") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x91,0x20,0x24,0x80,0x4a, - 0x40,0x11,0x00,0x20,0x80,0xdf,0x60,0x11,0x00,0x11,0x00,0x1f,0x00}; -const u8g_fntpgm_uint8_t fontpage_183_249_249[45] U8G_FONT_SECTION("fontpage_183_249_249") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x00,0x80,0xf0,0x80,0x1f,0xe0,0x90,0x80,0x50, - 0x80,0x24,0x80,0x22,0x80,0x50,0x80,0x50,0x80,0x82,0x80,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_184_143_143[45] U8G_FONT_SECTION("fontpage_184_143_143") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8f,0x8f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x24,0x80,0x24, - 0x40,0x44,0x40,0x44,0x20,0x84,0x20,0x04,0x00,0x14,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_184_177_177[45] U8G_FONT_SECTION("fontpage_184_177_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xfd,0x40,0x01,0x20,0x7f,0xe0,0x4a, - 0x80,0x7a,0x80,0x12,0x80,0x5a,0xa0,0x56,0xa0,0x92,0xa0,0x34,0x60}; -const u8g_fntpgm_uint8_t fontpage_184_207_207[45] U8G_FONT_SECTION("fontpage_184_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xe0,0x20,0x20,0x3f,0xe0,0x28,0x40,0x24, - 0x80,0x3f,0xe0,0x24,0x80,0x3f,0xe0,0x24,0x80,0x48,0x80,0x90,0x80}; -const u8g_fntpgm_uint8_t fontpage_187_229_229[41] U8G_FONT_SECTION("fontpage_187_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x09,0x00,0x00, - 0x00,0x0b,0x09,0x12,0x0c,0x00,0x00,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0x04, - 0x00,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_187_242_242[43] U8G_FONT_SECTION("fontpage_187_242_242") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x09,0xff,0x00, - 0x00,0x0a,0x0a,0x14,0x0c,0x01,0xff,0xff,0x00,0x01,0x00,0x01,0x00,0x81,0x00,0xff, - 0x00,0x80,0x00,0x80,0x40,0x80,0x40,0x80,0x40,0x7f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_188_243_243[45] U8G_FONT_SECTION("fontpage_188_243_243") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf3,0xf3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x24,0x80,0x15,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_188_246_246[45] U8G_FONT_SECTION("fontpage_188_246_246") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf6,0xf6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x11,0x00,0x7f,0xc0,0x11,0x00,0x11, - 0x00,0x11,0x00,0xff,0xe0,0x11,0x00,0x11,0x00,0x21,0x00,0x41,0x00}; -const u8g_fntpgm_uint8_t fontpage_189_138_138[45] U8G_FONT_SECTION("fontpage_189_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0x7f,0xe0,0x42,0x00,0x42,0x00,0x7f, - 0xe0,0x42,0x00,0x47,0x00,0x4a,0x80,0x52,0x40,0xa2,0x20,0x82,0x00}; -const u8g_fntpgm_uint8_t fontpage_189_148_148[45] U8G_FONT_SECTION("fontpage_189_148_148") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x94,0x94,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x02,0x00,0x7f,0xe0,0x40,0x00,0x44, - 0x40,0x52,0x40,0x4a,0x40,0x48,0x80,0x40,0x80,0x81,0x00,0x9f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_189_159_159[45] U8G_FONT_SECTION("fontpage_189_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0x3f,0xe0,0x2a,0x80,0x2a,0x40,0x3f, - 0xe0,0x24,0x00,0x27,0xc0,0x2a,0x40,0x31,0x80,0x42,0x40,0x8c,0x20}; -const u8g_fntpgm_uint8_t fontpage_189_166_166[45] U8G_FONT_SECTION("fontpage_189_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x49,0x00,0x7f,0xc0,0x49, - 0x00,0x4f,0x00,0x40,0x00,0x5f,0x80,0x49,0x00,0x86,0x00,0xb9,0xc0}; -const u8g_fntpgm_uint8_t fontpage_190_128_128[45] U8G_FONT_SECTION("fontpage_190_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x11,0x00,0x11,0x00,0x11,0x00,0x11, - 0x00,0xff,0xe0,0x11,0x00,0x21,0x00,0x21,0x00,0x41,0x00,0x81,0x00}; -const u8g_fntpgm_uint8_t fontpage_190_210_210[45] U8G_FONT_SECTION("fontpage_190_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x10,0x00,0x17,0xc0,0x90,0x40,0x90,0x40,0x90, - 0x40,0x97,0xc0,0x90,0x40,0x90,0x40,0x20,0x40,0x4f,0xc0,0x80,0x40}; -const u8g_fntpgm_uint8_t fontpage_191_132_133[73] U8G_FONT_SECTION("fontpage_191_132_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x85,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x17,0xc0,0x20,0x80,0x49,0x00,0x92,0x80,0x24, - 0x40,0x68,0x20,0xa7,0xc0,0x21,0x00,0x21,0x00,0x21,0x00,0x2f,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x11,0x00,0x21,0x00,0x47,0xc0,0x91,0x00,0x1f,0xe0,0x20,0x80,0x6f, - 0xe0,0xa4,0x80,0x22,0x80,0x20,0x80,0x21,0x80}; -const u8g_fntpgm_uint8_t fontpage_191_174_174[45] U8G_FONT_SECTION("fontpage_191_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2a,0x80,0x6a,0x80,0xbe,0x80,0x01,0xe0,0x5d, - 0x40,0xc3,0x40,0x5d,0x40,0x54,0x80,0x56,0x80,0x55,0x40,0x62,0x20}; -const u8g_fntpgm_uint8_t fontpage_191_195_195[45] U8G_FONT_SECTION("fontpage_191_195_195") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x02,0x00,0x12,0x00,0x12,0x00,0x10, - 0x40,0x50,0x20,0x50,0x20,0x50,0xa0,0x90,0x80,0x10,0x80,0x0f,0x80}; -const u8g_fntpgm_uint8_t fontpage_192_167_167[45] U8G_FONT_SECTION("fontpage_192_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x25,0x00,0xb5,0x00,0xaf,0xe0,0xa9, - 0x00,0xb1,0x00,0x27,0xc0,0x21,0x00,0x21,0x00,0x21,0x00,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_192_187_187[45] U8G_FONT_SECTION("fontpage_192_187_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x0a,0x00,0x3f,0x80,0x20,0x80,0x20, - 0x80,0x3f,0x80,0x20,0x80,0x04,0x40,0x52,0xa0,0x50,0xa0,0x8f,0x80}; -const u8g_fntpgm_uint8_t fontpage_192_226_226[45] U8G_FONT_SECTION("fontpage_192_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x2f,0xe0,0xb2,0x00,0xaa,0x80,0xa4, - 0x80,0xa5,0xa0,0x2a,0xc0,0x30,0x80,0x21,0x40,0x22,0x40,0x24,0x20}; -const u8g_fntpgm_uint8_t fontpage_192_239_239[45] U8G_FONT_SECTION("fontpage_192_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20, - 0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x54,0x40,0x52,0xa0,0x8f,0x80}; -const u8g_fntpgm_uint8_t fontpage_196_144_144[45] U8G_FONT_SECTION("fontpage_196_144_144") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x80,0x02,0x40,0x7f,0xe0,0x42,0x00,0x42, - 0x00,0x7a,0x40,0x4a,0x40,0x4a,0x80,0x49,0x20,0x52,0xa0,0x84,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_183_183[45] U8G_FONT_SECTION("fontpage_196_183_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x02,0x00,0x3f,0xc0,0x20,0x40,0x20, - 0x40,0x3f,0xc0,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x80,0x00}; -const u8g_fntpgm_uint8_t fontpage_196_192_192[45] U8G_FONT_SECTION("fontpage_196_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x18,0x60,0x63,0x80,0x42,0x00,0x7a,0x00,0x4b, - 0xe0,0x4a,0x40,0x7a,0x40,0x42,0x40,0x42,0x40,0x44,0x40,0x88,0x40}; -const u8g_fntpgm_uint8_t fontpage_196_199_199[45] U8G_FONT_SECTION("fontpage_196_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x7f,0xe0,0x40, - 0x00,0x7d,0xe0,0x44,0x20,0x54,0xa0,0x4c,0x60,0x54,0xa0,0xa9,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_203_203[45] U8G_FONT_SECTION("fontpage_196_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x03,0xc0,0x7c,0x00,0x04,0x00,0x7f,0xc0,0x04, - 0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x0c,0x00}; -const u8g_fntpgm_uint8_t fontpage_196_211_211[45] U8G_FONT_SECTION("fontpage_196_211_211") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xe0,0xf8,0x80,0x20,0x80,0x28, - 0x80,0x30,0x80,0x60,0x80,0xa0,0x80,0x20,0x80,0x20,0x80,0xe3,0x80}; -const u8g_fntpgm_uint8_t fontpage_196_231_231[45] U8G_FONT_SECTION("fontpage_196_231_231") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xe7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x22,0x00,0xff,0x80,0x22,0x80,0x2a, - 0x80,0x36,0x80,0x62,0x80,0xa7,0xa0,0x24,0xa0,0xa8,0xa0,0x50,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_249_249[45] U8G_FONT_SECTION("fontpage_196_249_249") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x80,0x24,0x80,0xfc,0x80,0x24,0xa0,0x2f, - 0xc0,0x34,0x80,0x64,0x80,0xa4,0x80,0x25,0xa0,0x26,0xa0,0xe4,0x60}; -const u8g_fntpgm_uint8_t fontpage_197_150_150[45] U8G_FONT_SECTION("fontpage_197_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x40,0x22,0x40,0xf9,0x40,0x20,0x40,0x2a, - 0x40,0x31,0x40,0x60,0xe0,0xaf,0x40,0x20,0x40,0x20,0x40,0xe0,0x40}; -const u8g_fntpgm_uint8_t fontpage_197_189_189[45] U8G_FONT_SECTION("fontpage_197_189_189") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xbd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x20,0x80,0xf8,0x80,0x27,0xe0,0x2c, - 0xa0,0x34,0xa0,0x67,0xe0,0xa4,0xa0,0x24,0xa0,0x27,0xe0,0xe4,0x20}; -const u8g_fntpgm_uint8_t fontpage_197_212_212[45] U8G_FONT_SECTION("fontpage_197_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x22,0x40,0xff,0xe0,0x22,0x00,0x2b, - 0xc0,0x32,0x40,0x65,0x40,0xa4,0x80,0x28,0x80,0x29,0x40,0xe6,0x20}; -const u8g_fntpgm_uint8_t fontpage_197_233_233[45] U8G_FONT_SECTION("fontpage_197_233_233") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xe0,0x22,0x40,0xf9,0x80,0x22,0x40,0x2c, - 0x20,0x31,0x00,0x67,0xc0,0xa1,0x00,0x2f,0xe0,0x21,0x00,0xe1,0x00}; -const u8g_fntpgm_uint8_t fontpage_198_137_137[45] U8G_FONT_SECTION("fontpage_198_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x20,0x80,0xff,0xe0,0x25,0x20,0x29, - 0x00,0x37,0xe0,0x62,0x40,0xa6,0x40,0x21,0x80,0x22,0x80,0xec,0x60}; -const u8g_fntpgm_uint8_t fontpage_198_161_161[45] U8G_FONT_SECTION("fontpage_198_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x25,0x20,0xfb,0x40,0x21,0x00,0x2f, - 0xe0,0x30,0x20,0x60,0x20,0xa7,0xe0,0x20,0x20,0x20,0x20,0xef,0xe0}; -const u8g_fntpgm_uint8_t fontpage_198_164_164[45] U8G_FONT_SECTION("fontpage_198_164_164") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xe0,0xfa,0x40,0x21,0x80,0x2e, - 0x60,0x30,0x00,0x62,0x40,0xa2,0x40,0x22,0x40,0x24,0x40,0xe8,0x40}; -const u8g_fntpgm_uint8_t fontpage_198_226_226[45] U8G_FONT_SECTION("fontpage_198_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0xfc,0x80,0x27,0xc0,0x2d, - 0x40,0x35,0x40,0x6f,0xe0,0xa1,0x00,0x22,0x80,0x24,0x40,0xe8,0x20}; -const u8g_fntpgm_uint8_t fontpage_199_137_137[45] U8G_FONT_SECTION("fontpage_199_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0xe0,0xf9,0x00,0x27,0xc0,0x2c, - 0x40,0x37,0xc0,0x64,0x40,0xa7,0xc0,0x21,0x00,0x2f,0xe0,0xe1,0x00}; -const u8g_fntpgm_uint8_t fontpage_199_162_162[45] U8G_FONT_SECTION("fontpage_199_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xe0,0x28,0x20,0xf2,0x80,0x24,0x40,0x29, - 0x20,0x31,0x00,0x6f,0xe0,0xa1,0x00,0x25,0x80,0x29,0x40,0xf1,0x20}; -const u8g_fntpgm_uint8_t fontpage_199_167_167[45] U8G_FONT_SECTION("fontpage_199_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0xf8,0x20,0x22,0x80,0x24, - 0x40,0x38,0x20,0x67,0xc0,0xa1,0x00,0x21,0x00,0x21,0x00,0xef,0xe0}; -const u8g_fntpgm_uint8_t fontpage_199_210_210[45] U8G_FONT_SECTION("fontpage_199_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0xc0,0x27,0x00,0xf1,0x00,0x2f,0xe0,0x21, - 0x00,0x35,0x60,0x69,0x20,0xad,0x60,0x29,0x20,0x29,0x20,0xef,0xe0}; -const u8g_fntpgm_uint8_t fontpage_202_182_182[45] U8G_FONT_SECTION("fontpage_202_182_182") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb6,0xb6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x12,0x00,0x93,0xe0,0x94,0x40,0x9a, - 0x40,0x92,0x40,0xb2,0x80,0xd1,0x00,0x91,0x80,0x12,0x40,0x14,0x20}; -const u8g_fntpgm_uint8_t fontpage_202_190_190[45] U8G_FONT_SECTION("fontpage_202_190_190") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x11,0x00,0xfd,0xe0,0x22,0x40,0x25, - 0x40,0x39,0x40,0x29,0x40,0x28,0x80,0x49,0x80,0x4a,0x40,0x94,0x20}; -const u8g_fntpgm_uint8_t fontpage_202_240_240[45] U8G_FONT_SECTION("fontpage_202_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x95,0x00,0x59,0x00,0xfd,0xe0,0x33,0x40,0x59, - 0x40,0x95,0x40,0xfd,0x40,0x29,0x40,0x68,0x80,0x11,0x40,0xee,0x20}; -const u8g_fntpgm_uint8_t fontpage_202_244_244[45] U8G_FONT_SECTION("fontpage_202_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x55,0x40,0x7c,0x80,0x39, - 0x40,0x56,0x20,0x7f,0xc0,0x04,0x00,0x27,0x80,0x24,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_203_153_153[45] U8G_FONT_SECTION("fontpage_203_153_153") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0xac,0x80,0x72,0x80,0x20,0x80,0xfc, - 0x80,0x22,0x80,0x30,0xe0,0x6f,0x80,0xa0,0x80,0x20,0x80,0x20,0x80}; -const u8g_fntpgm_uint8_t fontpage_203_156_156[45] U8G_FONT_SECTION("fontpage_203_156_156") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x40,0x29,0x40,0x44,0xc0,0xb8,0x40,0x12, - 0x40,0x7d,0x40,0x10,0x60,0x55,0xc0,0x52,0x40,0x92,0x40,0x30,0x40}; -const u8g_fntpgm_uint8_t fontpage_203_176_176[45] U8G_FONT_SECTION("fontpage_203_176_176") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x60,0xfd,0x80,0x45,0x00,0x29,0x00,0xfd, - 0xe0,0x11,0x40,0xfd,0x40,0x11,0x40,0x55,0x40,0x92,0x40,0x34,0x40}; -const u8g_fntpgm_uint8_t fontpage_203_224_224[45] U8G_FONT_SECTION("fontpage_203_224_224") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff, - 0xe0,0x0a,0x00,0x0a,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0xc1,0xe0}; -const u8g_fntpgm_uint8_t fontpage_203_246_246[45] U8G_FONT_SECTION("fontpage_203_246_246") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf6,0xf6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x00,0x80,0xf0,0x80,0x9f,0xe0,0x90,0x80,0x94, - 0x80,0xf2,0x80,0x92,0x80,0x90,0x80,0x90,0x80,0xf0,0x80,0x03,0x80}; -const u8g_fntpgm_uint8_t fontpage_204_142_142[45] U8G_FONT_SECTION("fontpage_204_142_142") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8e,0x8e,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x03,0xe0,0xf2,0x20,0x92,0x20,0x93,0xe0,0xf2, - 0x20,0x92,0x20,0x93,0xe0,0xf2,0x20,0x04,0x20,0x08,0xa0,0x30,0x40}; -const u8g_fntpgm_uint8_t fontpage_205_130_130[45] U8G_FONT_SECTION("fontpage_205_130_130") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x40,0xfb,0x80,0x52,0x00,0xfb,0xe0,0x12, - 0x80,0xf4,0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f,0x80}; -const u8g_fntpgm_uint8_t fontpage_205_171_171[45] U8G_FONT_SECTION("fontpage_205_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0xe0,0xff,0x00,0x55,0xe0,0x7d,0x40,0x55, - 0x40,0xff,0xc0,0x10,0x40,0x1f,0xc0,0x10,0x40,0x1f,0xc0,0x10,0x40}; -const u8g_fntpgm_uint8_t fontpage_205_244_244[45] U8G_FONT_SECTION("fontpage_205_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xe0,0x02,0x00,0x3f,0xc0,0x22,0x40,0x3f, - 0xc0,0x22,0x40,0x3f,0xc0,0x0a,0x00,0x04,0x00,0x1b,0x00,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_206_128_128[45] U8G_FONT_SECTION("fontpage_206_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff, - 0xe0,0x48,0x00,0x7f,0xc0,0x4a,0x40,0x79,0x80,0xc9,0x80,0x0e,0x60}; -const u8g_fntpgm_uint8_t fontpage_206_137_137[45] U8G_FONT_SECTION("fontpage_206_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0xff,0xe0,0x10,0x00,0x1f,0x80,0x30, - 0x80,0x5f,0x80,0x90,0x80,0x1f,0x80,0x10,0x80,0x10,0x80,0x11,0x80}; -const u8g_fntpgm_uint8_t fontpage_206_186_186[45] U8G_FONT_SECTION("fontpage_206_186_186") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xba,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0x80,0x24,0x80,0xfc,0x80,0x24, - 0x80,0x74,0x80,0x6c,0x80,0xa4,0x80,0xa4,0x80,0x28,0xa0,0x30,0xe0}; -const u8g_fntpgm_uint8_t fontpage_206_192_192[45] U8G_FONT_SECTION("fontpage_206_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x19,0x00,0x06,0x00,0x19,0x00,0x64, - 0xc0,0x04,0x00,0xff,0xe0,0x15,0x00,0x24,0x80,0xc4,0x60,0x0c,0x00}; -const u8g_fntpgm_uint8_t fontpage_206_225_225[45] U8G_FONT_SECTION("fontpage_206_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x1f,0x80,0x29,0x00,0x46,0x00,0x0a, - 0x00,0x35,0x80,0xc4,0x60,0x3f,0x80,0x15,0x00,0x24,0x80,0xdc,0x40}; -const u8g_fntpgm_uint8_t fontpage_206_229_229[45] U8G_FONT_SECTION("fontpage_206_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x24,0x80,0x15,0x00,0xff, - 0xe0,0x04,0x00,0x0e,0x00,0x15,0x00,0x24,0x80,0xc4,0x60,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_206_255_255[45] U8G_FONT_SECTION("fontpage_206_255_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0xc0,0x27,0x00,0xfc,0x00,0x24,0x00,0x27, - 0xc0,0x74,0x40,0x6e,0x40,0xa5,0x80,0x28,0x80,0x29,0x40,0x36,0x20}; -const u8g_fntpgm_uint8_t fontpage_207_241_241[45] U8G_FONT_SECTION("fontpage_207_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x21,0x00,0xff,0xe0,0x21,0x00,0x71, - 0x00,0x69,0x00,0xa7,0xc0,0xa1,0x00,0x21,0x00,0x21,0x00,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_208_161_161[45] U8G_FONT_SECTION("fontpage_208_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x21,0x00,0x2f,0xe0,0xf0,0x00,0x22, - 0x80,0x74,0x40,0x6a,0xa0,0xa2,0x80,0x21,0x00,0x22,0x80,0x2c,0x60}; -const u8g_fntpgm_uint8_t fontpage_208_188_188[45] U8G_FONT_SECTION("fontpage_208_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0xf4,0x40,0x2a,0x80,0x21, - 0x00,0x72,0x80,0x6c,0x60,0xa7,0xc0,0x24,0x40,0x24,0x40,0x27,0xc0}; -const u8g_fntpgm_uint8_t fontpage_209_192_192[45] U8G_FONT_SECTION("fontpage_209_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x22,0x80,0xfc,0x40,0x28,0x20,0x27, - 0xc0,0x70,0x00,0x69,0x20,0xa4,0xa0,0x22,0x40,0x22,0x80,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_211_253_253[45] U8G_FONT_SECTION("fontpage_211_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x2f,0xe0,0xfa,0xa0,0x2f,0xe0,0x2a, - 0xa0,0x3f,0xe0,0x64,0x40,0xa7,0xc0,0x24,0x40,0x27,0xc0,0x24,0x40}; -const u8g_fntpgm_uint8_t fontpage_212_217_217[45] U8G_FONT_SECTION("fontpage_212_217_217") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0x40,0x2a,0xa0,0xf4,0x40,0x27,0xc0,0x38, - 0x20,0x27,0xc0,0x64,0x40,0xa7,0xc0,0x24,0x40,0x22,0x80,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_214_226_226[45] U8G_FONT_SECTION("fontpage_214_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x24,0x00,0x27, - 0x80,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_214_229_229[45] U8G_FONT_SECTION("fontpage_214_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x27,0xc0,0x24,0x00,0x24,0x00,0xff, - 0xe0,0x04,0x00,0x14,0x40,0x24,0x80,0x41,0x00,0x06,0x00,0xf8,0x00}; -const u8g_fntpgm_uint8_t fontpage_215_212_212[45] U8G_FONT_SECTION("fontpage_215_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x84,0x00,0x84,0x00,0x84,0x80,0x85,0x00,0xf6, - 0x00,0x84,0x00,0x84,0x00,0x84,0x00,0xb4,0x40,0xc4,0x40,0x83,0xc0}; -const u8g_fntpgm_uint8_t fontpage_217_161_161[45] U8G_FONT_SECTION("fontpage_217_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0x80,0x24,0x80,0x84,0x80,0x48,0xe0,0x10, - 0x00,0x2f,0xc0,0x24,0x80,0x42,0x80,0xc3,0x00,0x44,0x80,0x58,0x60}; -const u8g_fntpgm_uint8_t fontpage_217_226_226[45] U8G_FONT_SECTION("fontpage_217_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x21,0x00,0x8f,0xe0,0x49,0x20,0x19, - 0x00,0x2f,0xc0,0x28,0x40,0xca,0x80,0x49,0x00,0x52,0x80,0x6c,0x60}; -const u8g_fntpgm_uint8_t fontpage_218_187_187[45] U8G_FONT_SECTION("fontpage_218_187_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0xc0,0x27,0x00,0x81,0x00,0x5f,0xe0,0x11, - 0x00,0x21,0x00,0x27,0xc0,0xc4,0x40,0x44,0x40,0x47,0xc0,0x44,0x40}; -const u8g_fntpgm_uint8_t fontpage_218_203_203[45] U8G_FONT_SECTION("fontpage_218_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xbe,0x20,0x62,0xa0,0x2a,0xa0,0xaa,0xa0,0x6a, - 0xa0,0x2a,0xa0,0x2a,0xa0,0xc8,0xa0,0x54,0x20,0x62,0x20,0x40,0xe0}; -const u8g_fntpgm_uint8_t fontpage_219_136_136[45] U8G_FONT_SECTION("fontpage_219_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x49,0x20,0x25,0x40,0x81,0x00,0x57,0xe0,0x14, - 0x20,0x27,0xe0,0x24,0x20,0xc7,0xe0,0x44,0x20,0x44,0x20,0x44,0x60}; -const u8g_fntpgm_uint8_t fontpage_219_225_225[45] U8G_FONT_SECTION("fontpage_219_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x25,0x40,0x09,0x80,0x82,0x80,0x54, - 0x40,0x29,0x20,0x25,0x40,0xc5,0x80,0x49,0x00,0x42,0x80,0x5c,0x60}; -const u8g_fntpgm_uint8_t fontpage_220_133_133[45] U8G_FONT_SECTION("fontpage_220_133_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x2f,0xe0,0x01,0x00,0x97,0xc0,0x51, - 0x00,0x2f,0xe0,0x24,0x40,0xc7,0x40,0x45,0xc0,0x44,0x40,0x44,0xc0}; -const u8g_fntpgm_uint8_t fontpage_220_169_169[45] U8G_FONT_SECTION("fontpage_220_169_169") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0x24,0x40,0x07,0xc0,0x94,0x40,0x57, - 0xc0,0x20,0x00,0x2f,0xe0,0xca,0xa0,0x4a,0xa0,0x4a,0xa0,0x5f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_221_144_144[45] U8G_FONT_SECTION("fontpage_221_144_144") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x28,0x80,0x8b,0xe0,0x4a,0x20,0x1b, - 0xe0,0x2a,0x20,0x2b,0xe0,0xc8,0x80,0x4a,0xc0,0x54,0xa0,0x69,0xa0}; -const u8g_fntpgm_uint8_t fontpage_223_192_192[45] U8G_FONT_SECTION("fontpage_223_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x80,0x3e,0x80,0x12,0xe0,0x9e,0xa0,0x53, - 0xa0,0x3e,0xa0,0x28,0xa0,0xdf,0xa0,0x4a,0x40,0x52,0xa0,0x65,0x20}; -const u8g_fntpgm_uint8_t fontpage_224_239_239[45] U8G_FONT_SECTION("fontpage_224_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x17,0xe0,0x54,0x80,0x58,0x80,0x50, - 0x80,0x90,0x80,0x10,0x80,0x10,0x80,0x28,0x80,0x44,0x80,0x81,0x80}; -const u8g_fntpgm_uint8_t fontpage_225_185_185[45] U8G_FONT_SECTION("fontpage_225_185_185") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x07,0xc0,0x04,0x00,0x3f, - 0x80,0x20,0x80,0x20,0x80,0x3f,0x80,0x00,0x00,0x52,0x40,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_225_237_237[45] U8G_FONT_SECTION("fontpage_225_237_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0xf7,0x80,0x22,0x80,0x32,0x80,0x66, - 0x80,0xa3,0x80,0x24,0xa0,0x68,0x60,0x00,0x00,0x52,0x40,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_228_199_199[45] U8G_FONT_SECTION("fontpage_228_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x21,0x00,0x3f,0xe0,0x20, - 0x00,0x20,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_228_249_249[45] U8G_FONT_SECTION("fontpage_228_249_249") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xa7,0xc0,0xf1,0x00,0xa1,0x00,0xaf, - 0xe0,0x30,0x80,0x6f,0xe0,0xa4,0x80,0x22,0x80,0x20,0x80,0x23,0x80}; -const u8g_fntpgm_uint8_t fontpage_231_135_135[45] U8G_FONT_SECTION("fontpage_231_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x88,0x40,0x52,0x80,0x0c, - 0x00,0x2a,0x80,0xdf,0x40,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_234_168_168[45] U8G_FONT_SECTION("fontpage_234_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x44,0x40,0x44,0x40,0x7f,0xc0,0x44, - 0x40,0x44,0x40,0x7f,0xc0,0x44,0x40,0x44,0x40,0x84,0x40,0x84,0xc0}; -const u8g_fntpgm_uint8_t fontpage_234_181_181[45] U8G_FONT_SECTION("fontpage_234_181_181") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb5,0xb5,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0xff,0x80,0x88,0x80,0xff, - 0x80,0x88,0x80,0x88,0x80,0xff,0x80,0x08,0x40,0x08,0x40,0x07,0xc0}; -const u8g_fntpgm_uint8_t fontpage_236_253_253[34] U8G_FONT_SECTION("fontpage_236_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x08,0x0b,0x0b,0x0c,0x02,0xff,0x10,0x20,0xff,0x81,0x81,0xff,0x81,0x81,0x81, - 0xff,0x81}; -const u8g_fntpgm_uint8_t fontpage_237_132_132[45] U8G_FONT_SECTION("fontpage_237_132_132") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x22,0x00,0x42,0x00,0xf7,0xc0,0x98,0x40,0x90, - 0x40,0xf4,0x40,0x92,0x40,0x92,0x40,0x90,0x40,0xf0,0x40,0x91,0x80}; -const u8g_fntpgm_uint8_t fontpage_237_244_244[45] U8G_FONT_SECTION("fontpage_237_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x04,0x00,0x3f,0x80,0x20, - 0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x20,0x80,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_238_129_129[45] U8G_FONT_SECTION("fontpage_238_129_129") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x81,0x81,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x14,0x80,0x25,0x60,0x46,0x20,0x1f, - 0x80,0x30,0x80,0xdf,0x80,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f,0x80}; -const u8g_fntpgm_uint8_t fontpage_238_160_160[45] U8G_FONT_SECTION("fontpage_238_160_160") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x07,0xe0,0xf4,0x20,0x97,0xe0,0xf4,0x80,0x94, - 0x80,0x97,0xe0,0xf4,0x80,0x94,0x80,0xf4,0xa0,0x96,0x60,0x04,0x20}; -const u8g_fntpgm_uint8_t fontpage_243_239_239[45] U8G_FONT_SECTION("fontpage_243_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x18,0x00,0xe3,0xe0,0x22,0x20,0xfa,0x20,0x22, - 0x20,0x73,0xe0,0x68,0x00,0xa2,0x40,0xa2,0x40,0x24,0x20,0x28,0x20}; -const u8g_fntpgm_uint8_t fontpage_243_251_251[45] U8G_FONT_SECTION("fontpage_243_251_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xe3,0xe0,0x24,0x20,0xfa,0x40,0x21, - 0x80,0x36,0x80,0x29,0xe0,0x62,0x20,0xa5,0x40,0x20,0x80,0x27,0x00}; -const u8g_fntpgm_uint8_t fontpage_245_239_239[45] U8G_FONT_SECTION("fontpage_245_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x81,0x00,0x45,0x20,0xf7,0xe0,0x00,0x00,0xaf, - 0xe0,0xa1,0x00,0xaf,0xe0,0x4a,0xa0,0x6a,0xa0,0x8a,0xa0,0x08,0x60}; -const u8g_fntpgm_uint8_t fontpage_246_201_201[45] U8G_FONT_SECTION("fontpage_246_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x7b,0xe0,0x94,0x80,0x7f,0xc0,0x04, - 0x00,0xff,0xe0,0x01,0x00,0x7f,0xc0,0x11,0x00,0x09,0x00,0x03,0x00}; -const u8g_fntpgm_uint8_t fontpage_247_161_161[45] U8G_FONT_SECTION("fontpage_247_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x3d,0xe0,0x52,0x80,0xff,0xe0,0x80, - 0x20,0x3f,0x80,0x20,0x80,0x3f,0xc0,0x20,0x40,0x20,0x40,0x3f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_248_251_251[45] U8G_FONT_SECTION("fontpage_248_251_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x80,0x15,0x00,0xff,0xe0,0x15,0x00,0x24, - 0x80,0x40,0x40,0x04,0x00,0xff,0xe0,0x0a,0x00,0x11,0x00,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_250_171_171[45] U8G_FONT_SECTION("fontpage_250_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x51,0x40,0x5d,0x80,0x51,0x20,0xfd, - 0xe0,0x08,0x80,0x3f,0x00,0x08,0x80,0x7f,0xc0,0x24,0x80,0xcc,0x60}; -const u8g_fntpgm_uint8_t fontpage_253_162_162[45] U8G_FONT_SECTION("fontpage_253_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xc0,0x41,0x00,0x51,0x00,0xe1, - 0x00,0x21,0x00,0x41,0x00,0xf1,0x00,0x01,0x00,0x31,0x00,0xcf,0xe0}; -const u8g_fntpgm_uint8_t fontpage_253_191_191[45] U8G_FONT_SECTION("fontpage_253_191_191") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x22,0x40,0x43,0xc0,0x4e,0x00,0xe3, - 0xe0,0x2e,0x00,0x42,0x40,0xf2,0x80,0x09,0x20,0x32,0xa0,0xcc,0x60}; -const u8g_fntpgm_uint8_t fontpage_253_198_198[45] U8G_FONT_SECTION("fontpage_253_198_198") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xe0,0x44,0xa0,0x54,0xa0,0xe4, - 0xa0,0x27,0xe0,0x44,0xa0,0xf4,0xa0,0x04,0xa0,0x37,0xe0,0xc4,0x20}; -const u8g_fntpgm_uint8_t fontpage_253_200_200[45] U8G_FONT_SECTION("fontpage_253_200_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0x54,0x40,0xea,0x80,0x21, - 0x00,0x42,0x80,0xec,0x60,0x01,0x00,0x30,0xc0,0xc3,0x00,0x00,0xc0}; -const u8g_fntpgm_uint8_t fontpage_253_223_223[45] U8G_FONT_SECTION("fontpage_253_223_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x42,0x00,0x54,0x40,0xef, - 0xe0,0x22,0xa0,0x42,0x80,0xf2,0x80,0x02,0xa0,0x34,0xa0,0xc8,0xe0}; -const u8g_fntpgm_uint8_t fontpage_253_231_231[45] U8G_FONT_SECTION("fontpage_253_231_231") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xe7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x80,0x26,0xa0,0x45,0xc0,0x54,0x80,0xe7, - 0xe0,0x24,0x80,0x45,0xc0,0xf6,0xa0,0x04,0x80,0x34,0x80,0xc7,0xe0}; -const u8g_fntpgm_uint8_t fontpage_253_234_234[45] U8G_FONT_SECTION("fontpage_253_234_234") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xea,0xea,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xa0,0x49,0x40,0x57,0xe0,0xe1, - 0x00,0x23,0xe0,0x46,0x20,0xf3,0xe0,0x0a,0x20,0x33,0xe0,0xc2,0x20}; -const u8g_fntpgm_uint8_t fontpage_253_237_237[45] U8G_FONT_SECTION("fontpage_253_237_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xc0,0x41,0x00,0x57,0xe0,0xe4, - 0xa0,0x2a,0x80,0x44,0x80,0xef,0xe0,0x01,0x00,0x32,0xc0,0xcc,0x20}; -const u8g_fntpgm_uint8_t fontpage_253_255_255[45] U8G_FONT_SECTION("fontpage_253_255_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x20,0x40,0x43,0xc0,0xf0,0x40,0x2f, - 0xe0,0x41,0x20,0xf5,0x40,0x03,0x80,0x35,0x40,0xc9,0x20,0x03,0x00}; -const u8g_fntpgm_uint8_t fontpage_254_150_150[45] U8G_FONT_SECTION("fontpage_254_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x48,0x20,0x5f,0xe0,0xe8, - 0x00,0x2f,0xe0,0x4a,0xa0,0xff,0xe0,0x0a,0xa0,0x3a,0xa0,0xc8,0x60}; -const u8g_fntpgm_uint8_t fontpage_254_186_186[45] U8G_FONT_SECTION("fontpage_254_186_186") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xba,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x41,0x00,0x7b,0xc0,0xa1,0x40,0x21, - 0x40,0xff,0xe0,0x21,0x00,0xa9,0x00,0xaa,0x80,0xfa,0x40,0x04,0x20}; -const u8g_fntpgm_uint8_t fontpage_254_209_209[45] U8G_FONT_SECTION("fontpage_254_209_209") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x80,0x40,0x91,0x40,0xd5,0x40,0xa2, - 0x40,0x92,0x40,0xad,0x40,0xc5,0x40,0x88,0x40,0x80,0x40,0x81,0xc0}; -const u8g_fntpgm_uint8_t fontpage_254_238_238[45] U8G_FONT_SECTION("fontpage_254_238_238") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x4a,0x40,0x7f,0xc0,0x04,0x00,0xff, - 0xe0,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_254_242_242[45] U8G_FONT_SECTION("fontpage_254_242_242") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xe0,0x49,0x20,0x7f,0xe0,0x04,0x40,0x3f, - 0x80,0x05,0x00,0xff,0xe0,0x30,0x80,0xdf,0x80,0x10,0x80,0x1f,0x80}; -const u8g_fntpgm_uint8_t fontpage_256_234_234[45] U8G_FONT_SECTION("fontpage_256_234_234") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xea,0xea,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x40,0xfa,0x80,0x57,0xc0,0x54,0x40,0x74, - 0x40,0x57,0xc0,0x71,0x00,0x5a,0xa0,0xf6,0xa0,0x1a,0x40,0x11,0xc0}; -const u8g_fntpgm_uint8_t fontpage_259_234_234[34] U8G_FONT_SECTION("fontpage_259_234_234") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xea,0xea,0x00,0x0a,0xff,0x00, - 0x00,0x07,0x0b,0x0b,0x0c,0x02,0xff,0x20,0xfe,0x82,0x82,0xfe,0x82,0xfe,0x82,0x82, - 0xfe,0x82}; -const u8g_fntpgm_uint8_t fontpage_263_220_220[45] U8G_FONT_SECTION("fontpage_263_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x11,0x00,0x01,0xc0,0x7e, - 0x80,0x28,0x80,0x15,0x00,0xff,0xe0,0x15,0x00,0x24,0x80,0xc4,0x60}; -const u8g_fntpgm_uint8_t fontpage_265_221_221[45] U8G_FONT_SECTION("fontpage_265_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x11,0x00,0x52,0x00,0x53, - 0xc0,0x55,0x00,0x10,0x80,0x7f,0xc0,0x4a,0x40,0x4a,0x40,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_272_204_204[45] U8G_FONT_SECTION("fontpage_272_204_204") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x40,0x00,0x80,0x00,0x10,0x00,0x2f, - 0xe0,0x60,0x80,0xa0,0x80,0x20,0x80,0x20,0x80,0x20,0x80,0x23,0x80}; -const u8g_fntpgm_uint8_t fontpage_273_171_171[45] U8G_FONT_SECTION("fontpage_273_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x80,0x20,0x80,0xff,0xe0,0x14,0xa0,0x2c, - 0x80,0x77,0xe0,0xad,0x40,0x25,0x40,0x24,0x80,0x29,0x40,0x36,0x20}; -const u8g_fntpgm_uint8_t fontpage_273_197_197[45] U8G_FONT_SECTION("fontpage_273_197_197") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x9f,0xe0,0x51,0x00,0x31,0x00,0xd7, - 0xc0,0x12,0x00,0xff,0xe0,0x0c,0x40,0x32,0x80,0xd1,0x00,0x18,0xe0}; -const u8g_fntpgm_uint8_t fontpage_275_210_210[45] U8G_FONT_SECTION("fontpage_275_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x1f,0x00,0x22,0x00,0x7f,0xc0,0xa4, - 0x40,0x3f,0xc0,0x24,0x40,0x3f,0xc0,0x24,0x40,0x45,0x40,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_279_161_161[45] U8G_FONT_SECTION("fontpage_279_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x21,0x00,0x01,0x00,0x0f,0xe0,0xe1, - 0x00,0x21,0x00,0x21,0x00,0x29,0x00,0x31,0x00,0x21,0x00,0x01,0x00}; -const u8g_fntpgm_uint8_t fontpage_279_174_174[45] U8G_FONT_SECTION("fontpage_279_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x21,0x40,0x05,0x40,0x04,0x40,0xe4, - 0x40,0x22,0x80,0x22,0x80,0x29,0x00,0x32,0x80,0x24,0x40,0x08,0x20}; -const u8g_fntpgm_uint8_t fontpage_279_190_190[45] U8G_FONT_SECTION("fontpage_279_190_190") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0x80,0x24,0x80,0x04,0x80,0x08,0xe0,0xe0, - 0x00,0x2f,0xc0,0x24,0x40,0x22,0x80,0x31,0x00,0x22,0x80,0x1c,0x60}; -const u8g_fntpgm_uint8_t fontpage_279_213_213[45] U8G_FONT_SECTION("fontpage_279_213_213") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x40,0x21,0x20,0x1f,0xe0,0x01,0x00,0xef, - 0x00,0x25,0x00,0x25,0x00,0x24,0xa0,0x26,0xa0,0x38,0x60,0x20,0x20}; -const u8g_fntpgm_uint8_t fontpage_279_239_239[45] U8G_FONT_SECTION("fontpage_279_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0x24,0x40,0x04,0x40,0x07,0xc0,0xe0, - 0x00,0x27,0xc0,0x21,0x00,0x2f,0xe0,0x32,0x80,0x24,0x40,0x08,0x20}; -const u8g_fntpgm_uint8_t fontpage_279_247_247[45] U8G_FONT_SECTION("fontpage_279_247_247") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x2f,0xe0,0x21,0x00,0x07,0xc0,0xe1, - 0x00,0x2f,0xe0,0x24,0x40,0x27,0xc0,0x24,0x40,0x37,0xc0,0x24,0x40}; -const u8g_fntpgm_uint8_t fontpage_280_131_131[45] U8G_FONT_SECTION("fontpage_280_131_131") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x29,0x20,0x0b,0xa0,0xe9,0x20,0x2f, - 0xe0,0x28,0x20,0x2b,0xa0,0x2a,0xa0,0x3b,0xa0,0x28,0x20,0x10,0xe0}; -const u8g_fntpgm_uint8_t fontpage_282_165_165[45] U8G_FONT_SECTION("fontpage_282_165_165") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf9,0x00,0x89,0x00,0xa9,0xe0,0xa9,0x40,0xab, - 0x40,0xad,0x40,0xa9,0x40,0x21,0x40,0x50,0x80,0x49,0x40,0x8a,0x20}; -const u8g_fntpgm_uint8_t fontpage_286_244_244[45] U8G_FONT_SECTION("fontpage_286_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0xf8,0x80,0x47,0xe0,0x64,0xa0,0xa4, - 0xa0,0xfc,0xa0,0x27,0xe0,0x3c,0xa0,0xe4,0xa0,0x27,0xe0,0x24,0x20}; -const u8g_fntpgm_uint8_t fontpage_286_253_253[45] U8G_FONT_SECTION("fontpage_286_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x7d,0x40,0x11,0x20,0xff,0xe0,0x21, - 0x00,0xfd,0x20,0x51,0x40,0x7c,0x80,0x10,0xa0,0xfd,0x60,0x12,0x20}; -const u8g_fntpgm_uint8_t fontpage_287_145_145[45] U8G_FONT_SECTION("fontpage_287_145_145") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xc0,0xfa,0x40,0x43,0xc0,0x60,0x00,0xa7, - 0xe0,0xfa,0x40,0x23,0x40,0x3a,0xc0,0xe2,0x60,0x2f,0xc0,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_287_147_147[45] U8G_FONT_SECTION("fontpage_287_147_147") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x93,0x93,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x42,0x80,0xf4,0x40,0x4b,0xa0,0xa0, - 0x00,0xfe,0x20,0x2a,0xa0,0x3e,0xa0,0xea,0xa0,0x2e,0xa0,0x2a,0x60}; -const u8g_fntpgm_uint8_t fontpage_287_185_185[45] U8G_FONT_SECTION("fontpage_287_185_185") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x21,0x00,0x2f,0xe0,0x01,0x20,0xe1, - 0x20,0x21,0x20,0x22,0x20,0x24,0x20,0x28,0xc0,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_287_208_209[73] U8G_FONT_SECTION("fontpage_287_208_209") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0x20,0x00,0x20,0x00,0x0f,0xe0,0xe2, - 0x00,0x22,0x80,0x24,0x40,0x2f,0xa0,0x24,0x20,0x50,0x00,0x8f,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x40,0xc0,0x27,0x00,0x24,0x00,0x07,0xe0,0xe4,0x80,0x24,0x80,0x24, - 0x80,0x24,0x80,0x28,0x80,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_287_212_212[45] U8G_FONT_SECTION("fontpage_287_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x60,0x27,0x80,0x24,0x00,0x07,0xe0,0xe6, - 0x20,0x25,0x40,0x24,0x80,0x29,0x40,0x26,0x20,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_287_216_216[45] U8G_FONT_SECTION("fontpage_287_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x20,0x80,0x21,0x00,0x01,0x00,0xe3, - 0x40,0x25,0x20,0x29,0x20,0x21,0x00,0x21,0x00,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_287_219_219[45] U8G_FONT_SECTION("fontpage_287_219_219") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x80,0x24,0x80,0x2f,0xc0,0x04,0x80,0xe4, - 0x80,0x3f,0xe0,0x24,0x80,0x24,0x80,0x28,0x80,0x50,0x80,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_128_128[45] U8G_FONT_SECTION("fontpage_288_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x8f,0xc0,0x48,0x40,0x4f,0xc0,0x08,0x40,0xcf, - 0xc0,0x48,0x00,0x4b,0x40,0x48,0x80,0x4e,0x40,0xb0,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_137_137[45] U8G_FONT_SECTION("fontpage_288_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x45,0x00,0x25,0x00,0x27,0xc0,0x09,0x00,0xef, - 0xe0,0x22,0x80,0x22,0xa0,0x24,0xa0,0x28,0x60,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_159_159[45] U8G_FONT_SECTION("fontpage_288_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x3f,0xe0,0x21,0x00,0x0f,0xe0,0xe9, - 0x20,0x2f,0xe0,0x23,0x80,0x25,0x40,0x29,0x20,0x51,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_289_232_232[45] U8G_FONT_SECTION("fontpage_289_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0xe0,0xff,0x20,0x45,0x20,0x29,0x40,0xff, - 0x80,0x01,0x40,0x7d,0x20,0x45,0x20,0x45,0xa0,0x7d,0x40,0x45,0x00}; -const u8g_fntpgm_uint8_t fontpage_291_202_202[45] U8G_FONT_SECTION("fontpage_291_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0xc0,0xe2,0x80,0xa9,0x00,0x72,0x80,0xfd, - 0x60,0x31,0x00,0x6f,0xc0,0xa1,0x00,0xaf,0xe0,0x21,0x00,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_291_205_205[45] U8G_FONT_SECTION("fontpage_291_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x24,0x80,0x3f, - 0x80,0x24,0x80,0x3f,0x80,0x04,0x00,0x7f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_291_207_207[45] U8G_FONT_SECTION("fontpage_291_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff, - 0xe0,0x24,0x80,0x3f,0x80,0x24,0x80,0x7f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_297_136_136[45] U8G_FONT_SECTION("fontpage_297_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x80,0x40,0x80,0x78,0x80,0x80,0x80,0xfb, - 0xe0,0x20,0x80,0xf8,0x80,0x20,0x80,0x28,0x80,0x30,0x80,0x20,0x80}; -const u8g_fntpgm_uint8_t fontpage_297_174_174[45] U8G_FONT_SECTION("fontpage_297_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x47,0xc0,0x79,0x40,0x81,0x40,0xf9, - 0x40,0x27,0xc0,0xfa,0x40,0x22,0x40,0x2a,0x40,0x32,0x40,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_298_153_153[45] U8G_FONT_SECTION("fontpage_298_153_153") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x80,0x4f,0xe0,0x72,0x80,0x82,0x80,0xef, - 0xe0,0x40,0x00,0xf7,0xc0,0x44,0x40,0x47,0xc0,0x54,0x40,0x67,0xc0}; -const u8g_fntpgm_uint8_t fontpage_298_174_174[45] U8G_FONT_SECTION("fontpage_298_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x5c,0x80,0x47,0xe0,0x68,0xa0,0x8b,0xe0,0xfc, - 0xa0,0x47,0xe0,0xe4,0x80,0x57,0xe0,0x48,0x80,0x6c,0x80,0x53,0xe0}; -const u8g_fntpgm_uint8_t fontpage_298_255_255[45] U8G_FONT_SECTION("fontpage_298_255_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x21,0x00,0x22,0x00,0x24,0x00,0x28,0x00,0x30, - 0x00,0xff,0xc0,0x28,0x00,0x24,0x00,0x22,0x00,0x29,0x00,0x30,0xc0}; -const u8g_fntpgm_uint8_t fontpage_299_237_237[45] U8G_FONT_SECTION("fontpage_299_237_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xe0,0x20,0x20,0x82,0x20,0x82,0x20,0xbf, - 0xa0,0x86,0x20,0x8a,0x20,0x92,0x20,0xa2,0x20,0x86,0x20,0x80,0xe0}; -const u8g_fntpgm_uint8_t fontpage_299_244_244[45] U8G_FONT_SECTION("fontpage_299_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x4f,0xc0,0x20,0x40,0x80,0x40,0x9e,0x40,0x92, - 0x40,0x9e,0x40,0x92,0x40,0x92,0x40,0x9e,0x40,0x80,0x40,0x81,0xc0}; -const u8g_fntpgm_uint8_t fontpage_300_205_205[45] U8G_FONT_SECTION("fontpage_300_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf2,0x00,0x93,0xe0,0xa6,0x40,0xc1,0x80,0xa6, - 0x60,0x91,0x00,0x97,0xe0,0xd5,0x00,0xaf,0xe0,0x81,0x00,0x81,0x00}; -const u8g_fntpgm_uint8_t fontpage_300_228_228[45] U8G_FONT_SECTION("fontpage_300_228_228") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf1,0x00,0x92,0x80,0xa4,0x40,0xcb,0xa0,0xa1, - 0x00,0x9f,0xe0,0x91,0x00,0xe5,0x40,0x89,0x20,0x91,0x20,0x83,0x00}; -const u8g_fntpgm_uint8_t fontpage_302_210_210[45] U8G_FONT_SECTION("fontpage_302_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0x3f,0x80,0x04, - 0x00,0xff,0xe0,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f,0x80,0x10,0x80}; -const u8g_fntpgm_uint8_t fontpage_302_222_222[45] U8G_FONT_SECTION("fontpage_302_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0a,0x00,0x0a,0x00,0xfb,0xe0,0x0a,0x00,0x0a, - 0x00,0x7b,0xc0,0x0a,0x00,0x0a,0x00,0xfb,0xe0,0x0a,0x00,0x0a,0x00}; -const u8g_fntpgm_uint8_t fontpage_304_249_249[45] U8G_FONT_SECTION("fontpage_304_249_249") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x07,0xe0,0xf9,0x00,0x27,0xe0,0x24,0x20,0x25, - 0x20,0x25,0x20,0x25,0x20,0x3d,0x20,0xc1,0x80,0x02,0x40,0x0c,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_132_132[45] U8G_FONT_SECTION("fontpage_305_132_132") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x10,0x80,0x63,0xe0,0x22,0x20,0xfa, - 0xa0,0x2a,0xa0,0x22,0xa0,0x22,0xa0,0x22,0xa0,0x21,0x40,0x66,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_157_157[45] U8G_FONT_SECTION("fontpage_305_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xe0,0xfc,0x80,0x87,0xe0,0x7a,0x20,0xca, - 0xa0,0x32,0xa0,0x4a,0xa0,0xfe,0xa0,0x4a,0xa0,0x79,0x40,0x4e,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_206_206[45] U8G_FONT_SECTION("fontpage_305_206_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xce,0xce,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0x80,0x40,0x80,0x42,0x80,0x52,0x80,0x4c, - 0x80,0x44,0x80,0x4c,0x80,0x52,0x80,0x62,0xa0,0x80,0x60,0x80,0x20}; -const u8g_fntpgm_uint8_t fontpage_306_241_241[45] U8G_FONT_SECTION("fontpage_306_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x00,0x47,0xc0,0x7c,0x40,0x97,0x40,0xad, - 0x40,0x25,0x40,0x27,0x40,0x24,0xc0,0x2c,0x20,0x34,0x20,0x23,0xe0}; -const u8g_fntpgm_uint8_t fontpage_308_241_241[45] U8G_FONT_SECTION("fontpage_308_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf3,0xe0,0x12,0x00,0x52,0x20,0x53,0x20,0x52, - 0xa0,0x7a,0x40,0x0a,0x40,0xea,0xa0,0x0b,0x20,0x0a,0x00,0x33,0xe0}; -const u8g_fntpgm_uint8_t fontpage_309_216_216[45] U8G_FONT_SECTION("fontpage_309_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x00,0x00,0x1f,0x00,0x11, - 0x00,0x7f,0xc0,0x40,0x40,0x5f,0x40,0x51,0x40,0x5f,0x40,0x40,0xc0}; -const u8g_fntpgm_uint8_t fontpage_317_196_196[45] U8G_FONT_SECTION("fontpage_317_196_196") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x7f,0xc0,0x11,0x00,0xff,0xe0,0x04, - 0x00,0x3f,0x80,0x24,0x80,0x3f,0x80,0x24,0x80,0x3f,0x80,0x60,0xc0}; -const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x08,0x00,0x00, - 0x00,0x02,0x07,0x07,0x0c,0x06,0x01,0xc0,0xc0,0x00,0x00,0x00,0xc0,0xc0}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”' - FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿' - FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一' - FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下' - FONTDATA_ITEM(156, 157, 157, fontpage_156_157_157), // '丝' -- '丝' - FONTDATA_ITEM(156, 170, 170, fontpage_156_170_170), // '个' -- '个' - FONTDATA_ITEM(156, 173, 173, fontpage_156_173_173), // '中' -- '中' - FONTDATA_ITEM(156, 187, 187, fontpage_156_187_187), // '主' -- '主' - FONTDATA_ITEM(156, 203, 203, fontpage_156_203_203), // '之' -- '之' - FONTDATA_ITEM(157, 134, 134, fontpage_157_134_134), // '了' -- '了' - FONTDATA_ITEM(157, 142, 142, fontpage_157_142_142), // '于' -- '于' - FONTDATA_ITEM(157, 174, 174, fontpage_157_174_174), // '亮' -- '亮' - FONTDATA_ITEM(157, 206, 206, fontpage_157_206_206), // '从' -- '从' - FONTDATA_ITEM(157, 228, 228, fontpage_157_228_228), // '令' -- '令' - FONTDATA_ITEM(157, 253, 253, fontpage_157_253_253), // '份' -- '份' - FONTDATA_ITEM(158, 145, 145, fontpage_158_145_145), // '休' -- '休' - FONTDATA_ITEM(158, 205, 206, fontpage_158_205_206), // '位' -- '低' - FONTDATA_ITEM(158, 220, 220, fontpage_158_220_220), // '作' -- '作' - FONTDATA_ITEM(159, 155, 155, fontpage_159_155_155), // '供' -- '供' - FONTDATA_ITEM(159, 221, 221, fontpage_159_221_221), // '保' -- '保' - FONTDATA_ITEM(159, 225, 225, fontpage_159_225_225), // '信' -- '信' - FONTDATA_ITEM(160, 188, 188, fontpage_160_188_188), // '值' -- '值' - FONTDATA_ITEM(160, 207, 207, fontpage_160_207_207), // '偏' -- '偏' - FONTDATA_ITEM(160, 220, 220, fontpage_160_220_220), // '停' -- '停' - FONTDATA_ITEM(161, 168, 168, fontpage_161_168_168), // '储' -- '储' - FONTDATA_ITEM(162, 197, 197, fontpage_162_197_197), // '充' -- '充' - FONTDATA_ITEM(162, 200, 200, fontpage_162_200_200), // '先' -- '先' - FONTDATA_ITEM(162, 229, 229, fontpage_162_229_229), // '入' -- '入' - FONTDATA_ITEM(162, 232, 232, fontpage_162_232_232), // '全' -- '全' - FONTDATA_ITEM(162, 241, 241, fontpage_162_241_241), // '共' -- '共' - FONTDATA_ITEM(162, 243, 243, fontpage_162_243_243), // '关' -- '关' - FONTDATA_ITEM(162, 247, 247, fontpage_162_247_247), // '具' -- '具' - FONTDATA_ITEM(163, 183, 183, fontpage_163_183_183), // '冷' -- '冷' - FONTDATA_ITEM(163, 198, 198, fontpage_163_198_198), // '准' -- '准' - FONTDATA_ITEM(163, 201, 201, fontpage_163_201_201), // '凉' -- '凉' - FONTDATA_ITEM(163, 250, 251, fontpage_163_250_251), // '出' -- '击' - FONTDATA_ITEM(164, 134, 134, fontpage_164_134_134), // '分' -- '分' - FONTDATA_ITEM(164, 155, 155, fontpage_164_155_155), // '创' -- '创' - FONTDATA_ITEM(164, 157, 157, fontpage_164_157_157), // '初' -- '初' - FONTDATA_ITEM(164, 176, 176, fontpage_164_176_176), // '到' -- '到' - FONTDATA_ITEM(164, 182, 183, fontpage_164_182_183), // '制' -- '刷' - FONTDATA_ITEM(165, 155, 155, fontpage_165_155_155), // '力' -- '力' - FONTDATA_ITEM(165, 160, 160, fontpage_165_160_160), // '加' -- '加' - FONTDATA_ITEM(165, 168, 168, fontpage_165_168_168), // '动' -- '动' - FONTDATA_ITEM(166, 150, 150, fontpage_166_150_150), // '化' -- '化' - FONTDATA_ITEM(166, 202, 202, fontpage_166_202_202), // '半' -- '半' - FONTDATA_ITEM(166, 207, 207, fontpage_166_207_207), // '协' -- '协' - FONTDATA_ITEM(166, 213, 213, fontpage_166_213_213), // '单' -- '单' - FONTDATA_ITEM(166, 225, 225, fontpage_166_225_225), // '卡' -- '卡' - FONTDATA_ITEM(166, 240, 240, fontpage_166_240_240), // '印' -- '印' - FONTDATA_ITEM(166, 248, 248, fontpage_166_248_248), // '卸' -- '卸' - FONTDATA_ITEM(167, 159, 159, fontpage_167_159_159), // '原' -- '原' - FONTDATA_ITEM(167, 204, 204, fontpage_167_204_204), // '双' -- '双' - FONTDATA_ITEM(167, 214, 214, fontpage_167_214_214), // '取' -- '取' - FONTDATA_ITEM(167, 216, 216, fontpage_167_216_216), // '变' -- '变' - FONTDATA_ITEM(167, 240, 240, fontpage_167_240_240), // '台' -- '台' - FONTDATA_ITEM(168, 136, 136, fontpage_168_136_136), // '合' -- '合' - FONTDATA_ITEM(168, 142, 142, fontpage_168_142_142), // '后' -- '后' - FONTDATA_ITEM(168, 175, 175, fontpage_168_175_175), // '启' -- '启' - FONTDATA_ITEM(168, 253, 253, fontpage_168_253_253), // '命' -- '命' - FONTDATA_ITEM(169, 140, 140, fontpage_169_140_140), // '和' -- '和' - FONTDATA_ITEM(171, 183, 183, fontpage_171_183_183), // '喷' -- '喷' - FONTDATA_ITEM(172, 180, 180, fontpage_172_180_180), // '嘴' -- '嘴' - FONTDATA_ITEM(172, 244, 244, fontpage_172_244_244), // '噴' -- '噴' - FONTDATA_ITEM(173, 222, 222, fontpage_173_222_222), // '回' -- '回' - FONTDATA_ITEM(173, 224, 224, fontpage_173_224_224), // '因' -- '因' - FONTDATA_ITEM(173, 254, 254, fontpage_173_254_254), // '图' -- '图' - FONTDATA_ITEM(174, 168, 168, fontpage_174_168_168), // '在' -- '在' - FONTDATA_ITEM(174, 215, 215, fontpage_174_215_215), // '块' -- '块' - FONTDATA_ITEM(175, 139, 139, fontpage_175_139_139), // '型' -- '型' - FONTDATA_ITEM(175, 171, 171, fontpage_175_171_171), // '垫' -- '垫' - FONTDATA_ITEM(176, 235, 235, fontpage_176_235_235), // '填' -- '填' - FONTDATA_ITEM(177, 243, 243, fontpage_177_243_243), // '壳' -- '壳' - FONTDATA_ITEM(178, 135, 135, fontpage_178_135_135), // '备' -- '备' - FONTDATA_ITEM(178, 141, 141, fontpage_178_141_141), // '复' -- '复' - FONTDATA_ITEM(178, 150, 150, fontpage_178_150_150), // '外' -- '外' - FONTDATA_ITEM(178, 154, 154, fontpage_178_154_154), // '多' -- '多' - FONTDATA_ITEM(178, 167, 167, fontpage_178_167_167), // '大' -- '大' - FONTDATA_ITEM(178, 169, 170, fontpage_178_169_170), // '天' -- '太' - FONTDATA_ITEM(178, 177, 177, fontpage_178_177_177), // '失' -- '失' - FONTDATA_ITEM(179, 203, 203, fontpage_179_203_203), // '始' -- '始' - FONTDATA_ITEM(182, 208, 208, fontpage_182_208_208), // '子' -- '子' - FONTDATA_ITEM(182, 216, 216, fontpage_182_216_216), // '存' -- '存' - FONTDATA_ITEM(183, 137, 137, fontpage_183_137_137), // '安' -- '安' - FONTDATA_ITEM(183, 140, 140, fontpage_183_140_140), // '完' -- '完' - FONTDATA_ITEM(183, 154, 154, fontpage_183_154_154), // '定' -- '定' - FONTDATA_ITEM(183, 162, 162, fontpage_183_162_162), // '客' -- '客' - FONTDATA_ITEM(183, 185, 185, fontpage_183_185_185), // '容' -- '容' - FONTDATA_ITEM(183, 249, 249, fontpage_183_249_249), // '对' -- '对' - FONTDATA_ITEM(184, 143, 143, fontpage_184_143_143), // '小' -- '小' - FONTDATA_ITEM(184, 177, 177, fontpage_184_177_177), // '就' -- '就' - FONTDATA_ITEM(184, 207, 207, fontpage_184_207_207), // '屏' -- '屏' - FONTDATA_ITEM(187, 229, 229, fontpage_187_229_229), // '工' -- '工' - FONTDATA_ITEM(187, 242, 242, fontpage_187_242_242), // '已' -- '已' - FONTDATA_ITEM(188, 243, 243, fontpage_188_243_243), // '平' -- '平' - FONTDATA_ITEM(188, 246, 246, fontpage_188_246_246), // '并' -- '并' - FONTDATA_ITEM(189, 138, 138, fontpage_189_138_138), // '床' -- '床' - FONTDATA_ITEM(189, 148, 148, fontpage_189_148_148), // '应' -- '应' - FONTDATA_ITEM(189, 159, 159, fontpage_189_159_159), // '废' -- '废' - FONTDATA_ITEM(189, 166, 166, fontpage_189_166_166), // '度' -- '度' - FONTDATA_ITEM(190, 128, 128, fontpage_190_128_128), // '开' -- '开' - FONTDATA_ITEM(190, 210, 210, fontpage_190_210_210), // '归' -- '归' - FONTDATA_ITEM(191, 132, 133, fontpage_191_132_133), // '径' -- '待' - FONTDATA_ITEM(191, 174, 174, fontpage_191_174_174), // '微' -- '微' - FONTDATA_ITEM(191, 195, 195, fontpage_191_195_195), // '心' -- '心' - FONTDATA_ITEM(192, 167, 167, fontpage_192_167_167), // '性' -- '性' - FONTDATA_ITEM(192, 187, 187, fontpage_192_187_187), // '总' -- '总' - FONTDATA_ITEM(192, 226, 226, fontpage_192_226_226), // '恢' -- '恢' - FONTDATA_ITEM(192, 239, 239, fontpage_192_239_239), // '息' -- '息' - FONTDATA_ITEM(196, 144, 144, fontpage_196_144_144), // '成' -- '成' - FONTDATA_ITEM(196, 183, 183, fontpage_196_183_183), // '户' -- '户' - FONTDATA_ITEM(196, 192, 192, fontpage_196_192_192), // '所' -- '所' - FONTDATA_ITEM(196, 199, 199, fontpage_196_199_199), // '扇' -- '扇' - FONTDATA_ITEM(196, 203, 203, fontpage_196_203_203), // '手' -- '手' - FONTDATA_ITEM(196, 211, 211, fontpage_196_211_211), // '打' -- '打' - FONTDATA_ITEM(196, 231, 231, fontpage_196_231_231), // '执' -- '执' - FONTDATA_ITEM(196, 249, 249, fontpage_196_249_249), // '批' -- '批' - FONTDATA_ITEM(197, 150, 150, fontpage_197_150_150), // '抖' -- '抖' - FONTDATA_ITEM(197, 189, 189, fontpage_197_189_189), // '抽' -- '抽' - FONTDATA_ITEM(197, 212, 212, fontpage_197_212_212), // '拔' -- '拔' - FONTDATA_ITEM(197, 233, 233, fontpage_197_233_233), // '择' -- '择' - FONTDATA_ITEM(198, 137, 137, fontpage_198_137_137), // '按' -- '按' - FONTDATA_ITEM(198, 161, 161, fontpage_198_161_161), // '挡' -- '挡' - FONTDATA_ITEM(198, 164, 164, fontpage_198_164_164), // '挤' -- '挤' - FONTDATA_ITEM(198, 226, 226, fontpage_198_226_226), // '换' -- '换' - FONTDATA_ITEM(199, 137, 137, fontpage_199_137_137), // '掉' -- '掉' - FONTDATA_ITEM(199, 162, 162, fontpage_199_162_162), // '探' -- '探' - FONTDATA_ITEM(199, 167, 167, fontpage_199_167_167), // '控' -- '控' - FONTDATA_ITEM(199, 210, 210, fontpage_199_210_210), // '插' -- '插' - FONTDATA_ITEM(202, 182, 182, fontpage_202_182_182), // '收' -- '收' - FONTDATA_ITEM(202, 190, 190, fontpage_202_190_190), // '放' -- '放' - FONTDATA_ITEM(202, 240, 240, fontpage_202_240_240), // '数' -- '数' - FONTDATA_ITEM(202, 244, 244, fontpage_202_244_244), // '整' -- '整' - FONTDATA_ITEM(203, 153, 153, fontpage_203_153_153), // '料' -- '料' - FONTDATA_ITEM(203, 156, 156, fontpage_203_156_156), // '斜' -- '斜' - FONTDATA_ITEM(203, 176, 176, fontpage_203_176_176), // '新' -- '新' - FONTDATA_ITEM(203, 224, 224, fontpage_203_224_224), // '无' -- '无' - FONTDATA_ITEM(203, 246, 246, fontpage_203_246_246), // '时' -- '时' - FONTDATA_ITEM(204, 142, 142, fontpage_204_142_142), // '明' -- '明' - FONTDATA_ITEM(205, 130, 130, fontpage_205_130_130), // '暂' -- '暂' - FONTDATA_ITEM(205, 171, 171, fontpage_205_171_171), // '暫' -- '暫' - FONTDATA_ITEM(205, 244, 244, fontpage_205_244_244), // '更' -- '更' - FONTDATA_ITEM(206, 128, 128, fontpage_206_128_128), // '最' -- '最' - FONTDATA_ITEM(206, 137, 137, fontpage_206_137_137), // '有' -- '有' - FONTDATA_ITEM(206, 186, 186, fontpage_206_186_186), // '机' -- '机' - FONTDATA_ITEM(206, 192, 192, fontpage_206_192_192), // '杀' -- '杀' - FONTDATA_ITEM(206, 225, 225, fontpage_206_225_225), // '条' -- '条' - FONTDATA_ITEM(206, 229, 229, fontpage_206_229_229), // '来' -- '来' - FONTDATA_ITEM(206, 255, 255, fontpage_206_255_255), // '板' -- '板' - FONTDATA_ITEM(207, 241, 241, fontpage_207_241_241), // '柱' -- '柱' - FONTDATA_ITEM(208, 161, 161, fontpage_208_161_161), // '校' -- '校' - FONTDATA_ITEM(208, 188, 188, fontpage_208_188_188), // '格' -- '格' - FONTDATA_ITEM(209, 192, 192, fontpage_209_192_192), // '检' -- '检' - FONTDATA_ITEM(211, 253, 253, fontpage_211_253_253), // '槽' -- '槽' - FONTDATA_ITEM(212, 217, 217, fontpage_212_217_217), // '橙' -- '橙' - FONTDATA_ITEM(214, 226, 226, fontpage_214_226_226), // '止' -- '止' - FONTDATA_ITEM(214, 229, 229, fontpage_214_229_229), // '步' -- '步' - FONTDATA_ITEM(215, 212, 212, fontpage_215_212_212), // '比' -- '比' - FONTDATA_ITEM(217, 161, 161, fontpage_217_161_161), // '没' -- '没' - FONTDATA_ITEM(217, 226, 226, fontpage_217_226_226), // '波' -- '波' - FONTDATA_ITEM(218, 187, 187, fontpage_218_187_187), // '活' -- '活' - FONTDATA_ITEM(218, 203, 203, fontpage_218_203_203), // '测' -- '测' - FONTDATA_ITEM(219, 136, 136, fontpage_219_136_136), // '消' -- '消' - FONTDATA_ITEM(219, 225, 225, fontpage_219_225_225), // '淡' -- '淡' - FONTDATA_ITEM(220, 133, 133, fontpage_220_133_133), // '清' -- '清' - FONTDATA_ITEM(220, 169, 169, fontpage_220_169_169), // '温' -- '温' - FONTDATA_ITEM(221, 144, 144, fontpage_221_144_144), // '源' -- '源' - FONTDATA_ITEM(223, 192, 192, fontpage_223_192_192), // '激' -- '激' - FONTDATA_ITEM(224, 239, 239, fontpage_224_239_239), // '灯' -- '灯' - FONTDATA_ITEM(225, 185, 185, fontpage_225_185_185), // '点' -- '点' - FONTDATA_ITEM(225, 237, 237, fontpage_225_237_237), // '热' -- '热' - FONTDATA_ITEM(228, 199, 199, fontpage_228_199_199), // '片' -- '片' - FONTDATA_ITEM(228, 249, 249, fontpage_228_249_249), // '特' -- '特' - FONTDATA_ITEM(231, 135, 135, fontpage_231_135_135), // '率' -- '率' - FONTDATA_ITEM(234, 168, 168, fontpage_234_168_168), // '用' -- '用' - FONTDATA_ITEM(234, 181, 181, fontpage_234_181_181), // '电' -- '电' - FONTDATA_ITEM(236, 253, 253, fontpage_236_253_253), // '白' -- '白' - FONTDATA_ITEM(237, 132, 132, fontpage_237_132_132), // '的' -- '的' - FONTDATA_ITEM(237, 244, 244, fontpage_237_244_244), // '直' -- '直' - FONTDATA_ITEM(238, 129, 129, fontpage_238_129_129), // '省' -- '省' - FONTDATA_ITEM(238, 160, 160, fontpage_238_160_160), // '眠' -- '眠' - FONTDATA_ITEM(243, 239, 239, fontpage_243_239_239), // '积' -- '积' - FONTDATA_ITEM(243, 251, 251, fontpage_243_251_251), // '移' -- '移' - FONTDATA_ITEM(245, 239, 239, fontpage_245_239_239), // '端' -- '端' - FONTDATA_ITEM(246, 201, 201, fontpage_246_201_201), // '等' -- '等' - FONTDATA_ITEM(247, 161, 161, fontpage_247_161_161), // '管' -- '管' - FONTDATA_ITEM(248, 251, 251, fontpage_248_251_251), // '类' -- '类' - FONTDATA_ITEM(250, 171, 171, fontpage_250_171_171), // '紫' -- '紫' - FONTDATA_ITEM(253, 162, 162, fontpage_253_162_162), // '红' -- '红' - FONTDATA_ITEM(253, 191, 191, fontpage_253_191_191), // '线' -- '线' - FONTDATA_ITEM(253, 198, 198, fontpage_253_198_198), // '细' -- '细' - FONTDATA_ITEM(253, 200, 200, fontpage_253_200_200), // '终' -- '终' - FONTDATA_ITEM(253, 223, 223, fontpage_253_223_223), // '统' -- '统' - FONTDATA_ITEM(253, 231, 231, fontpage_253_231_231), // '继' -- '继' - FONTDATA_ITEM(253, 234, 234, fontpage_253_234_234), // '绪' -- '绪' - FONTDATA_ITEM(253, 237, 237, fontpage_253_237_237), // '续' -- '续' - FONTDATA_ITEM(253, 255, 255, fontpage_253_255_255), // '绿' -- '绿' - FONTDATA_ITEM(254, 150, 150, fontpage_254_150_150), // '编' -- '编' - FONTDATA_ITEM(254, 186, 186, fontpage_254_186_186), // '缺' -- '缺' - FONTDATA_ITEM(254, 209, 209, fontpage_254_209_209), // '网' -- '网' - FONTDATA_ITEM(254, 238, 238, fontpage_254_238_238), // '置' -- '置' - FONTDATA_ITEM(254, 242, 242, fontpage_254_242_242), // '署' -- '署' - FONTDATA_ITEM(256, 234, 234, fontpage_256_234_234), // '聪' -- '聪' - FONTDATA_ITEM(259, 234, 234, fontpage_259_234_234), // '自' -- '自' - FONTDATA_ITEM(263, 220, 220, fontpage_263_220_220), // '菜' -- '菜' - FONTDATA_ITEM(265, 221, 221, fontpage_265_221_221), // '蓝' -- '蓝' - FONTDATA_ITEM(272, 204, 204, fontpage_272_204_204), // '行' -- '行' - FONTDATA_ITEM(273, 171, 171, fontpage_273_171_171), // '被' -- '被' - FONTDATA_ITEM(273, 197, 197, fontpage_273_197_197), // '装' -- '装' - FONTDATA_ITEM(275, 210, 210, fontpage_275_210_210), // '角' -- '角' - FONTDATA_ITEM(279, 161, 161, fontpage_279_161_161), // '计' -- '计' - FONTDATA_ITEM(279, 174, 174, fontpage_279_174_174), // '议' -- '议' - FONTDATA_ITEM(279, 190, 190, fontpage_279_190_190), // '设' -- '设' - FONTDATA_ITEM(279, 213, 213, fontpage_279_213_213), // '试' -- '试' - FONTDATA_ITEM(279, 239, 239, fontpage_279_239_239), // '误' -- '误' - FONTDATA_ITEM(279, 247, 247, fontpage_279_247_247), // '请' -- '请' - FONTDATA_ITEM(280, 131, 131, fontpage_280_131_131), // '调' -- '调' - FONTDATA_ITEM(282, 165, 165, fontpage_282_165_165), // '败' -- '败' - FONTDATA_ITEM(286, 244, 244, fontpage_286_244_244), // '轴' -- '轴' - FONTDATA_ITEM(286, 253, 253, fontpage_286_253_253), // '载' -- '载' - FONTDATA_ITEM(287, 145, 145, fontpage_287_145_145), // '辑' -- '辑' - FONTDATA_ITEM(287, 147, 147, fontpage_287_147_147), // '输' -- '输' - FONTDATA_ITEM(287, 185, 185, fontpage_287_185_185), // '边' -- '边' - FONTDATA_ITEM(287, 208, 209, fontpage_287_208_209), // '运' -- '近' - FONTDATA_ITEM(287, 212, 212, fontpage_287_212_212), // '返' -- '返' - FONTDATA_ITEM(287, 216, 216, fontpage_287_216_216), // '还' -- '还' - FONTDATA_ITEM(287, 219, 219, fontpage_287_219_219), // '进' -- '进' - FONTDATA_ITEM(288, 128, 128, fontpage_288_128_128), // '退' -- '退' - FONTDATA_ITEM(288, 137, 137, fontpage_288_137_137), // '选' -- '选' - FONTDATA_ITEM(288, 159, 159, fontpage_288_159_159), // '速' -- '速' - FONTDATA_ITEM(289, 232, 232, fontpage_289_232_232), // '部' -- '部' - FONTDATA_ITEM(291, 202, 202, fontpage_291_202_202), // '释' -- '释' - FONTDATA_ITEM(291, 205, 205, fontpage_291_205_205), // '重' -- '重' - FONTDATA_ITEM(291, 207, 207, fontpage_291_207_207), // '量' -- '量' - FONTDATA_ITEM(297, 136, 136, fontpage_297_136_136), // '针' -- '针' - FONTDATA_ITEM(297, 174, 174, fontpage_297_174_174), // '钮' -- '钮' - FONTDATA_ITEM(298, 153, 153, fontpage_298_153_153), // '错' -- '错' - FONTDATA_ITEM(298, 174, 174, fontpage_298_174_174), // '键' -- '键' - FONTDATA_ITEM(298, 255, 255, fontpage_298_255_255), // '长' -- '长' - FONTDATA_ITEM(299, 237, 237, fontpage_299_237_237), // '闭' -- '闭' - FONTDATA_ITEM(299, 244, 244, fontpage_299_244_244), // '间' -- '间' - FONTDATA_ITEM(300, 205, 205, fontpage_300_205_205), // '降' -- '降' - FONTDATA_ITEM(300, 228, 228, fontpage_300_228_228), // '除' -- '除' - FONTDATA_ITEM(302, 210, 210, fontpage_302_210_210), // '青' -- '青' - FONTDATA_ITEM(302, 222, 222, fontpage_302_222_222), // '非' -- '非' - FONTDATA_ITEM(304, 249, 249, fontpage_304_249_249), // '项' -- '项' - FONTDATA_ITEM(305, 132, 132, fontpage_305_132_132), // '预' -- '预' - FONTDATA_ITEM(305, 157, 157, fontpage_305_157_157), // '额' -- '额' - FONTDATA_ITEM(305, 206, 206, fontpage_305_206_206), // '风' -- '风' - FONTDATA_ITEM(306, 241, 241, fontpage_306_241_241), // '饱' -- '饱' - FONTDATA_ITEM(308, 241, 241, fontpage_308_241_241), // '驱' -- '驱' - FONTDATA_ITEM(309, 216, 216, fontpage_309_216_216), // '高' -- '高' - FONTDATA_ITEM(317, 196, 196, fontpage_317_196_196), // '黄' -- '黄' - FONTDATA_ITEM(510, 154, 154, fontpage_510_154_154), // ':' -- ':' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h deleted file mode 100644 index e1bb97ea3d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h +++ /dev/null @@ -1,1366 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x07,0x00,0x00, - 0x00,0x05,0x03,0x03,0x06,0x00,0x04,0xd8,0x48,0x90}; -const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x18,0x28,0x48,0xf8}; -const u8g_fntpgm_uint8_t fontpage_156_128_128[27] U8G_FONT_SECTION("fontpage_156_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x06,0x00,0x00, - 0x00,0x0b,0x02,0x04,0x0c,0x00,0x04,0x00,0x40,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_137_139[97] U8G_FONT_SECTION("fontpage_156_137_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xe0,0x0b,0x0b,0x16,0x0c,0x00, - 0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x07,0xc0,0x04,0x00,0x04,0x00,0x04, - 0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x0b,0x0a,0x14,0x0c,0x00,0xff,0xff,0xe0,0x04, - 0x00,0x04,0x00,0x06,0x00,0x05,0x00,0x04,0x80,0x04,0x80,0x04,0x00,0x04,0x00,0x04, - 0x00}; -const u8g_fntpgm_uint8_t fontpage_156_166_166[45] U8G_FONT_SECTION("fontpage_156_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x11,0x00,0xff,0xe0,0x0a,0x00,0x4a, - 0x40,0x4a,0x40,0x2a,0x40,0x2a,0x80,0x0a,0x00,0x0a,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_170_170[45] U8G_FONT_SECTION("fontpage_156_170_170") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xaa,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x49, - 0x00,0x88,0xc0,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_156_173_173[45] U8G_FONT_SECTION("fontpage_156_173_173") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0xff,0x80,0x88,0x80,0x88, - 0x80,0x88,0x80,0xff,0x80,0x88,0x80,0x08,0x00,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_156_187_187[45] U8G_FONT_SECTION("fontpage_156_187_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04, - 0x00,0x04,0x00,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_156_203_203[45] U8G_FONT_SECTION("fontpage_156_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x04,0x00,0x7f,0xc0,0x00,0x80,0x01, - 0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x30,0x00,0x48,0x00,0x87,0xe0}; -const u8g_fntpgm_uint8_t fontpage_157_174_174[45] U8G_FONT_SECTION("fontpage_157_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x11,0x00,0x1f,0x00,0x00, - 0x00,0xff,0xe0,0x80,0x20,0x1f,0x00,0x11,0x00,0x21,0x20,0xc0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_157_228_228[45] U8G_FONT_SECTION("fontpage_157_228_228") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x0a,0x00,0x11,0x00,0x24, - 0x80,0xc2,0x60,0x3f,0x80,0x01,0x00,0x0a,0x00,0x04,0x00,0x02,0x00}; -const u8g_fntpgm_uint8_t fontpage_157_253_253[45] U8G_FONT_SECTION("fontpage_157_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x80,0x12,0x80,0x22,0x40,0x24,0x40,0x68, - 0x20,0xa7,0xc0,0x22,0x40,0x22,0x40,0x22,0x40,0x24,0x40,0x28,0xc0}; -const u8g_fntpgm_uint8_t fontpage_158_145_145[45] U8G_FONT_SECTION("fontpage_158_145_145") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x21,0x00,0x3f,0xe0,0x61, - 0x00,0xa3,0x80,0x23,0x80,0x25,0x40,0x29,0x20,0x31,0x00,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_158_205_206[73] U8G_FONT_SECTION("fontpage_158_205_206") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xce,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x11,0x00,0x20,0x00,0x2f,0xe0,0x60, - 0x00,0xa4,0x40,0x22,0x40,0x22,0x80,0x20,0x80,0x21,0x00,0x2f,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x10,0xc0,0x1f,0x00,0x29,0x00,0x29,0x00,0x69,0x00,0xaf,0xe0,0x29, - 0x00,0x29,0x20,0x2a,0xa0,0x2d,0x60,0x28,0xa0}; -const u8g_fntpgm_uint8_t fontpage_158_220_220[45] U8G_FONT_SECTION("fontpage_158_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x14,0x00,0x14,0x00,0x27,0xe0,0x2a,0x00,0x72, - 0x00,0xa3,0xc0,0x22,0x00,0x22,0x00,0x23,0xe0,0x22,0x00,0x22,0x00}; -const u8g_fntpgm_uint8_t fontpage_159_134_134[45] U8G_FONT_SECTION("fontpage_159_134_134") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x04,0x00,0x24,0x80,0x24, - 0x80,0x55,0x40,0x8e,0x20,0x15,0x00,0x24,0x80,0xc4,0x60,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_159_155_155[45] U8G_FONT_SECTION("fontpage_159_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x14,0x80,0x14,0x80,0x24,0x80,0x2f,0xe0,0x64, - 0x80,0xa4,0x80,0x3f,0xe0,0x20,0x00,0x24,0x80,0x28,0x40,0x30,0x20}; -const u8g_fntpgm_uint8_t fontpage_159_221_221[45] U8G_FONT_SECTION("fontpage_159_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x17,0xc0,0x14,0x40,0x24,0x40,0x27,0xc0,0x61, - 0x00,0xaf,0xe0,0x21,0x00,0x23,0x80,0x25,0x40,0x29,0x20,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_159_225_225[45] U8G_FONT_SECTION("fontpage_159_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x11,0x00,0x2f,0xe0,0x20,0x00,0x67, - 0xc0,0xa0,0x00,0x27,0xc0,0x20,0x00,0x27,0xc0,0x24,0x40,0x27,0xc0}; -const u8g_fntpgm_uint8_t fontpage_160_139_139[45] U8G_FONT_SECTION("fontpage_160_139_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8b,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xe0,0x29,0x20,0x29,0x20,0x2f,0xe0,0x69, - 0x20,0xab,0xa0,0x2a,0xa0,0x2b,0xa0,0x28,0x20,0x2f,0xe0,0x28,0x20}; -const u8g_fntpgm_uint8_t fontpage_160_188_188[45] U8G_FONT_SECTION("fontpage_160_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x1f,0xe0,0x22,0x00,0x27,0xc0,0x64, - 0x40,0xa7,0xc0,0x24,0x40,0x27,0x40,0x25,0xc0,0x24,0x40,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_160_207_207[45] U8G_FONT_SECTION("fontpage_160_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x28,0x20,0x2f,0xe0,0x68, - 0x00,0xaf,0xe0,0x2a,0xa0,0x2f,0xe0,0x2a,0xa0,0x3a,0xa0,0x28,0x60}; -const u8g_fntpgm_uint8_t fontpage_160_220_220[45] U8G_FONT_SECTION("fontpage_160_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x3f,0xe0,0x20,0x00,0x4f,0xc0,0x48, - 0x40,0xdf,0xe0,0x50,0x20,0x4f,0xc0,0x41,0x00,0x41,0x00,0x47,0x00}; -const u8g_fntpgm_uint8_t fontpage_161_153_153[45] U8G_FONT_SECTION("fontpage_161_153_153") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x80,0x2f,0xc0,0x24,0x80,0x3f,0xe0,0x64, - 0x00,0xaf,0xe0,0x29,0x20,0x3f,0xe0,0x29,0x20,0x2f,0xe0,0x29,0x20}; -const u8g_fntpgm_uint8_t fontpage_161_179_179[45] U8G_FONT_SECTION("fontpage_161_179_179") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb3,0xb3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x3f,0xe0,0x2a,0x40,0x2f,0xc0,0x6a, - 0x40,0xbf,0xc0,0x22,0x80,0x3f,0xe0,0x28,0x80,0x24,0x80,0x21,0x80}; -const u8g_fntpgm_uint8_t fontpage_162_178_178[45] U8G_FONT_SECTION("fontpage_162_178_178") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb2,0xb2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x28,0x80,0x3d,0xe0,0x40,0xa0,0x5d,0xe0,0xc0, - 0x80,0x5d,0xe0,0x43,0x20,0x5d,0xe0,0x55,0x20,0x5d,0xe0,0x55,0x20}; -const u8g_fntpgm_uint8_t fontpage_162_197_197[45] U8G_FONT_SECTION("fontpage_162_197_197") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x04,0x00,0xff,0xc0,0x08,0x00,0x11,0x00,0x7f, - 0x80,0x12,0x80,0x12,0x00,0x12,0x00,0x22,0x40,0x22,0x40,0xc1,0xc0}; -const u8g_fntpgm_uint8_t fontpage_162_200_200[45] U8G_FONT_SECTION("fontpage_162_200_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x84, - 0x00,0xff,0xe0,0x12,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0xc1,0xe0}; -const u8g_fntpgm_uint8_t fontpage_162_229_229[45] U8G_FONT_SECTION("fontpage_162_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x18,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0a, - 0x00,0x0a,0x00,0x11,0x00,0x11,0x00,0x20,0x80,0x40,0x40,0x80,0x20}; -const u8g_fntpgm_uint8_t fontpage_162_232_232[45] U8G_FONT_SECTION("fontpage_162_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xdf, - 0x60,0x04,0x00,0x04,0x00,0x1f,0x00,0x04,0x00,0x04,0x00,0x7f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_162_241_241[45] U8G_FONT_SECTION("fontpage_162_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x7f,0xc0,0x11,0x00,0x11, - 0x00,0x11,0x00,0xff,0xe0,0x00,0x00,0x11,0x00,0x20,0x80,0x40,0x40}; -const u8g_fntpgm_uint8_t fontpage_162_247_247[45] U8G_FONT_SECTION("fontpage_162_247_247") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f, - 0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff,0xe0,0x11,0x00,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_163_183_183[45] U8G_FONT_SECTION("fontpage_163_183_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x82,0x00,0x42,0x00,0x05,0x00,0x28,0x80,0x32, - 0x60,0x41,0x00,0x4f,0xc0,0x80,0x80,0x87,0x00,0x81,0x00,0x00,0x80}; -const u8g_fntpgm_uint8_t fontpage_163_198_198[45] U8G_FONT_SECTION("fontpage_163_198_198") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0a,0x00,0x89,0x00,0x4f,0xe0,0x59,0x00,0x09, - 0x00,0x2f,0xc0,0x29,0x00,0xcf,0xc0,0x49,0x00,0x49,0x00,0x4f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_163_250_250[45] U8G_FONT_SECTION("fontpage_163_250_250") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfa,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x44,0x40,0x44,0x40,0x7f, - 0xc0,0x04,0x00,0x84,0x20,0x84,0x20,0x84,0x20,0x84,0x20,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_164_134_134[45] U8G_FONT_SECTION("fontpage_164_134_134") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x11,0x00,0x20,0x80,0x20,0x80,0x40, - 0x40,0xbf,0xa0,0x08,0x80,0x08,0x80,0x10,0x80,0x20,0x80,0xc3,0x00}; -const u8g_fntpgm_uint8_t fontpage_164_151_151[45] U8G_FONT_SECTION("fontpage_164_151_151") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x97,0x97,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7e,0x20,0x10,0x20,0x11,0x20,0x3d,0x20,0x25, - 0x20,0x65,0x20,0x99,0x20,0x09,0x20,0x10,0x20,0x20,0x20,0xc0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_164_157_157[45] U8G_FONT_SECTION("fontpage_164_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x27,0xe0,0xf9,0x20,0x11,0x20,0x21, - 0x20,0x69,0x20,0xb1,0x20,0x29,0x20,0x22,0x20,0x24,0x20,0x28,0xc0}; -const u8g_fntpgm_uint8_t fontpage_164_176_176[45] U8G_FONT_SECTION("fontpage_164_176_176") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfe,0x20,0x10,0x20,0x20,0xa0,0x44,0xa0,0xfe, - 0xa0,0x10,0xa0,0x7c,0xa0,0x10,0xa0,0x10,0x20,0x1e,0x20,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_164_182_183[73] U8G_FONT_SECTION("fontpage_164_182_183") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb6,0xb7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x20,0x50,0xa0,0x7e,0xa0,0x90,0xa0,0xfe, - 0xa0,0x10,0xa0,0x7e,0xa0,0x52,0xa0,0x52,0x20,0x56,0x20,0x10,0xe0,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x7e,0x20,0x42,0x20,0x7e,0xa0,0x48,0xa0,0x48,0xa0,0x7e,0xa0,0x6a, - 0xa0,0xaa,0xa0,0xaa,0xa0,0x2e,0x20,0x08,0xe0}; -const u8g_fntpgm_uint8_t fontpage_164_245_245[45] U8G_FONT_SECTION("fontpage_164_245_245") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf5,0xf5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x20,0x28,0x20,0x54,0xa0,0xfe,0xa0,0x44, - 0xa0,0x7c,0xa0,0x44,0xa0,0x7c,0xa0,0xc4,0x20,0x44,0x20,0x7c,0xe0}; -const u8g_fntpgm_uint8_t fontpage_165_155_155[45] U8G_FONT_SECTION("fontpage_165_155_155") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9b,0x9b,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0x08,0x00,0xff,0x80,0x08, - 0x80,0x08,0x80,0x10,0x80,0x10,0x80,0x20,0x80,0x40,0x80,0x87,0x00}; -const u8g_fntpgm_uint8_t fontpage_165_160_160[45] U8G_FONT_SECTION("fontpage_165_160_160") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x20,0x00,0xfd,0xe0,0x25,0x20,0x25, - 0x20,0x25,0x20,0x25,0x20,0x25,0x20,0x45,0x20,0x55,0xe0,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_165_168_168[45] U8G_FONT_SECTION("fontpage_165_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0x79,0x00,0x01,0x00,0x03,0xe0,0xfd, - 0x20,0x21,0x20,0x21,0x20,0x49,0x20,0xfa,0x20,0x0a,0x20,0x04,0xc0}; -const u8g_fntpgm_uint8_t fontpage_165_213_213[45] U8G_FONT_SECTION("fontpage_165_213_213") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x78,0x80,0x10,0x80,0xfe,0x80,0x55,0xe0,0x7c, - 0xa0,0x54,0xa0,0x7c,0xa0,0x10,0xa0,0x7d,0x20,0x11,0x20,0xfe,0x60}; -const u8g_fntpgm_uint8_t fontpage_166_150_150[45] U8G_FONT_SECTION("fontpage_166_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x12,0x00,0x22,0x40,0x22,0x80,0x63, - 0x00,0xa2,0x00,0x26,0x00,0x2a,0x00,0x22,0x20,0x22,0x20,0x21,0xe0}; -const u8g_fntpgm_uint8_t fontpage_166_202_202[45] U8G_FONT_SECTION("fontpage_166_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x44,0x40,0x24,0x80,0x15,0x00,0x7f, - 0xc0,0x04,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_212_212[45] U8G_FONT_SECTION("fontpage_166_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x27,0xc0,0x22,0x40,0xfa,0x40,0x24, - 0x80,0x24,0x80,0x3f,0xe0,0x2a,0xa0,0x2a,0xa0,0x33,0x20,0x24,0x40}; -const u8g_fntpgm_uint8_t fontpage_166_225_225[45] U8G_FONT_SECTION("fontpage_166_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x0f,0x80,0x08,0x00,0x08,0x00,0xff, - 0xe0,0x08,0x00,0x0a,0x00,0x09,0x00,0x08,0x80,0x08,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_240_240[45] U8G_FONT_SECTION("fontpage_166_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x10,0x00,0xe7,0xc0,0x84,0x40,0x84,0x40,0xf4, - 0x40,0x84,0x40,0x84,0x40,0x94,0x40,0xe5,0x80,0x84,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_166_248_248[45] U8G_FONT_SECTION("fontpage_166_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x7d,0xe0,0x91,0x20,0x11,0x20,0xff, - 0x20,0x11,0x20,0x5d,0x20,0x51,0x20,0x51,0xa0,0x5d,0x40,0xe1,0x00}; -const u8g_fntpgm_uint8_t fontpage_167_159_159[45] U8G_FONT_SECTION("fontpage_167_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xe0,0x22,0x00,0x2f,0xc0,0x28,0x40,0x2f, - 0xc0,0x28,0x40,0x2f,0xc0,0x22,0x00,0x2a,0x80,0x52,0x60,0xa6,0x20}; -const u8g_fntpgm_uint8_t fontpage_167_214_214[45] U8G_FONT_SECTION("fontpage_167_214_214") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfc,0x00,0x4b,0xe0,0x4a,0x20,0x7a,0x20,0x49, - 0x40,0x79,0x40,0x48,0x80,0x4c,0x80,0xf9,0x40,0x0a,0x40,0x0c,0x20}; -const u8g_fntpgm_uint8_t fontpage_167_240_240[45] U8G_FONT_SECTION("fontpage_167_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x10,0x00,0x22,0x00,0x41,0x00,0xff, - 0x80,0x00,0x80,0x7f,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7f,0x00}; -const u8g_fntpgm_uint8_t fontpage_168_136_136[45] U8G_FONT_SECTION("fontpage_168_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xdf, - 0x60,0x00,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x3f,0x80,0x20,0x80}; -const u8g_fntpgm_uint8_t fontpage_168_253_253[45] U8G_FONT_SECTION("fontpage_168_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x0a,0x00,0x11,0x00,0xee,0xe0,0x00, - 0x00,0x7b,0xc0,0x4a,0x40,0x4a,0x40,0x7a,0x40,0x4a,0xc0,0x02,0x00}; -const u8g_fntpgm_uint8_t fontpage_169_140_140[45] U8G_FONT_SECTION("fontpage_169_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0c,0x00,0x70,0x00,0x11,0xe0,0xfd,0x20,0x11, - 0x20,0x39,0x20,0x35,0x20,0x55,0x20,0x91,0x20,0x11,0xe0,0x10,0x00}; -const u8g_fntpgm_uint8_t fontpage_170_223_223[45] U8G_FONT_SECTION("fontpage_170_223_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x7d,0x00,0x45,0xe0,0x7d,0x40,0x43, - 0x40,0x5d,0x40,0x55,0x40,0x54,0x80,0x94,0x80,0x9d,0x40,0x82,0x20}; -const u8g_fntpgm_uint8_t fontpage_171_174_174[45] U8G_FONT_SECTION("fontpage_171_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xf3,0xc0,0x92,0x40,0x92,0x40,0xff,0xc0,0x44, - 0x80,0x7f,0x80,0x44,0x80,0x7f,0x80,0x04,0x00,0xff,0xc0,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_172_180_180[45] U8G_FONT_SECTION("fontpage_172_180_180") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0xa0,0xeb,0xc0,0xaa,0xa0,0xbf,0xe0,0xa4, - 0x80,0xaf,0xe0,0xf9,0x20,0x0f,0xe0,0x09,0x20,0x0f,0xe0,0x11,0x20}; -const u8g_fntpgm_uint8_t fontpage_172_244_244[45] U8G_FONT_SECTION("fontpage_172_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xef,0xe0,0xa5,0x40,0xaf,0xe0,0xa4, - 0x40,0xa7,0xc0,0xe4,0x40,0x07,0xc0,0x04,0x40,0x07,0xc0,0x0c,0x60}; -const u8g_fntpgm_uint8_t fontpage_173_222_222[45] U8G_FONT_SECTION("fontpage_173_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x80,0x40,0x80,0x40,0x9e,0x40,0x92, - 0x40,0x92,0x40,0x9e,0x40,0x92,0x40,0x80,0x40,0xff,0xc0,0x80,0x40}; -const u8g_fntpgm_uint8_t fontpage_173_224_224[45] U8G_FONT_SECTION("fontpage_173_224_224") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x84,0x20,0x84,0x20,0xbf,0xa0,0x84, - 0x20,0x84,0x20,0x8a,0x20,0x91,0x20,0xa0,0xa0,0x80,0x20,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_174_150_150[45] U8G_FONT_SECTION("fontpage_174_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x91,0x20,0x9f,0x20,0x84,0x20,0xff, - 0xe0,0xaa,0xa0,0xae,0xa0,0xa0,0xa0,0xbf,0xa0,0x80,0x20,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_174_168_168[45] U8G_FONT_SECTION("fontpage_174_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x08,0x00,0xff,0xc0,0x10,0x00,0x22, - 0x00,0x62,0x00,0xaf,0x80,0x22,0x00,0x22,0x00,0x22,0x00,0x3f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_175_139_139[45] U8G_FONT_SECTION("fontpage_175_139_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8b,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7e,0x40,0x29,0x40,0x29,0x40,0xff,0x40,0x29, - 0x40,0x28,0x40,0x4c,0xc0,0x04,0x00,0x3f,0x80,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_176_202_202[45] U8G_FONT_SECTION("fontpage_176_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x2f,0xe0,0x29,0x20,0xff,0xe0,0x29, - 0x20,0x2f,0xe0,0x21,0x40,0x33,0xa0,0xe5,0xe0,0x09,0x20,0x10,0xe0}; -const u8g_fntpgm_uint8_t fontpage_176_235_235[45] U8G_FONT_SECTION("fontpage_176_235_235") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xeb,0xeb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x21,0x00,0xf7,0xc0,0x24, - 0x40,0x27,0x40,0x25,0xc0,0x34,0x40,0xef,0xe0,0x02,0x80,0x0c,0x60}; -const u8g_fntpgm_uint8_t fontpage_177_138_138[45] U8G_FONT_SECTION("fontpage_177_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf9,0x00,0x23,0xc0,0xf9,0x40,0x51,0x40,0xfb, - 0x40,0x22,0xc0,0xfc,0x20,0x24,0x20,0x7f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_178_150_150[45] U8G_FONT_SECTION("fontpage_178_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x3d,0x00,0x25,0x00,0x45, - 0x80,0xa5,0x40,0x19,0x20,0x09,0x00,0x11,0x00,0x21,0x00,0x41,0x00}; -const u8g_fntpgm_uint8_t fontpage_178_154_154[45] U8G_FONT_SECTION("fontpage_178_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0x1f,0x00,0x21,0x00,0x52,0x00,0x0c, - 0x00,0x34,0x00,0xcf,0x80,0x10,0x80,0x69,0x00,0x06,0x00,0xf8,0x00}; -const u8g_fntpgm_uint8_t fontpage_178_167_167[45] U8G_FONT_SECTION("fontpage_178_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x04, - 0x00,0x04,0x00,0x0a,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60}; -const u8g_fntpgm_uint8_t fontpage_178_169_170[73] U8G_FONT_SECTION("fontpage_178_169_170") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xaa,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0xff, - 0xe0,0x04,0x00,0x0a,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x0a,0x00,0x0a, - 0x00,0x11,0x00,0x19,0x00,0x24,0x80,0xc4,0x60}; -const u8g_fntpgm_uint8_t fontpage_178_177_177[45] U8G_FONT_SECTION("fontpage_178_177_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x24,0x00,0x3f,0xc0,0x44,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x0a,0x00,0x11,0x00,0x20,0x80,0xc0,0x60}; -const u8g_fntpgm_uint8_t fontpage_179_203_203[45] U8G_FONT_SECTION("fontpage_179_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0xfa,0x40,0x2a,0x20,0x2f, - 0xe0,0x48,0x00,0x53,0xe0,0x32,0x20,0x2a,0x20,0x4b,0xe0,0x82,0x20}; -const u8g_fntpgm_uint8_t fontpage_182_208_208[45] U8G_FONT_SECTION("fontpage_182_208_208") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd0,0xd0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x01,0x00,0x02,0x00,0x04,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x14,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_182_216_216[45] U8G_FONT_SECTION("fontpage_182_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0xff,0xe0,0x10,0x00,0x2f,0xc0,0x20, - 0x80,0x61,0x00,0xbf,0xe0,0x21,0x00,0x21,0x00,0x21,0x00,0x27,0x00}; -const u8g_fntpgm_uint8_t fontpage_183_137_137[45] U8G_FONT_SECTION("fontpage_183_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x88,0x40,0x08, - 0x00,0xff,0xe0,0x11,0x00,0x31,0x00,0x0e,0x00,0x09,0x80,0x70,0x60}; -const u8g_fntpgm_uint8_t fontpage_183_140_140[45] U8G_FONT_SECTION("fontpage_183_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x9f,0x40,0x00, - 0x00,0x7f,0xe0,0x0a,0x00,0x12,0x00,0x12,0x20,0x22,0x20,0x41,0xe0}; -const u8g_fntpgm_uint8_t fontpage_183_154_154[45] U8G_FONT_SECTION("fontpage_183_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x80,0x40,0x3f, - 0xc0,0x04,0x00,0x24,0x00,0x27,0x80,0x24,0x00,0x54,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_183_162_162[45] U8G_FONT_SECTION("fontpage_183_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x08,0x00,0xff,0xc0,0x90,0x40,0x3f,0x00,0x52, - 0x00,0x8c,0x00,0x33,0x00,0xff,0xc0,0x21,0x00,0x21,0x00,0x3f,0x00}; -const u8g_fntpgm_uint8_t fontpage_183_185_185[45] U8G_FONT_SECTION("fontpage_183_185_185") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb9,0xb9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x91,0x20,0x24,0x80,0x4a, - 0x40,0x11,0x00,0x20,0x80,0xdf,0x60,0x11,0x00,0x11,0x00,0x1f,0x00}; -const u8g_fntpgm_uint8_t fontpage_184_141_141[45] U8G_FONT_SECTION("fontpage_184_141_141") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x28,0x40,0xaa,0x40,0x6c,0x40,0xff,0xe0,0x28, - 0x40,0x7d,0x40,0x10,0xc0,0x7c,0x40,0x10,0x40,0x1d,0x40,0xe0,0x80}; -const u8g_fntpgm_uint8_t fontpage_184_143_143[45] U8G_FONT_SECTION("fontpage_184_143_143") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8f,0x8f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x24,0x80,0x24, - 0x40,0x44,0x40,0x44,0x20,0x84,0x20,0x04,0x00,0x14,0x00,0x08,0x00}; -const u8g_fntpgm_uint8_t fontpage_184_177_177[45] U8G_FONT_SECTION("fontpage_184_177_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xfd,0x40,0x01,0x20,0x7f,0xe0,0x4a, - 0x80,0x7a,0x80,0x12,0x80,0x5a,0xa0,0x56,0xa0,0x92,0xa0,0x34,0x60}; -const u8g_fntpgm_uint8_t fontpage_187_229_229[41] U8G_FONT_SECTION("fontpage_187_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x09,0x00,0x00, - 0x00,0x0b,0x09,0x12,0x0c,0x00,0x00,0x7f,0xc0,0x04,0x00,0x04,0x00,0x04,0x00,0x04, - 0x00,0x04,0x00,0x04,0x00,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_187_242_242[43] U8G_FONT_SECTION("fontpage_187_242_242") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x09,0xff,0x00, - 0x00,0x0a,0x0a,0x14,0x0c,0x01,0xff,0xff,0x00,0x01,0x00,0x01,0x00,0x81,0x00,0xff, - 0x00,0x80,0x00,0x80,0x40,0x80,0x40,0x80,0x40,0x7f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_188_243_243[45] U8G_FONT_SECTION("fontpage_188_243_243") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf3,0xf3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0x24,0x80,0x15,0x00,0x04, - 0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_189_138_138[45] U8G_FONT_SECTION("fontpage_189_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0x7f,0xe0,0x42,0x00,0x42,0x00,0x7f, - 0xe0,0x42,0x00,0x47,0x00,0x4a,0x80,0x52,0x40,0xa2,0x20,0x82,0x00}; -const u8g_fntpgm_uint8_t fontpage_189_166_166[45] U8G_FONT_SECTION("fontpage_189_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x49,0x00,0x7f,0xc0,0x49, - 0x00,0x4f,0x00,0x40,0x00,0x5f,0x80,0x49,0x00,0x86,0x00,0xb9,0xc0}; -const u8g_fntpgm_uint8_t fontpage_189_226_226[45] U8G_FONT_SECTION("fontpage_189_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x55,0x40,0x48,0xa0,0x7d, - 0xc0,0x45,0x20,0x5e,0x00,0x51,0xc0,0x5d,0x40,0x84,0x80,0x9b,0x60}; -const u8g_fntpgm_uint8_t fontpage_189_250_250[45] U8G_FONT_SECTION("fontpage_189_250_250") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfa,0xfa,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0xef,0xc0,0x22,0x40,0x5f,0xe0,0xe2, - 0x40,0x2f,0xc0,0xa2,0x00,0x6f,0xe0,0x22,0x00,0x52,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_191_133_133[45] U8G_FONT_SECTION("fontpage_191_133_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x21,0x00,0x47,0xc0,0x91,0x00,0x1f, - 0xe0,0x20,0x80,0x6f,0xe0,0xa4,0x80,0x22,0x80,0x20,0x80,0x21,0x80}; -const u8g_fntpgm_uint8_t fontpage_191_140_140[45] U8G_FONT_SECTION("fontpage_191_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x00,0x24,0x80,0x47,0x00,0x92,0x40,0x2f, - 0xe0,0x64,0x20,0xa7,0xc0,0x2c,0x40,0x32,0x80,0x23,0x80,0x2c,0x60}; -const u8g_fntpgm_uint8_t fontpage_191_145_145[45] U8G_FONT_SECTION("fontpage_191_145_145") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x91,0x91,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0xe0,0x25,0x40,0x45,0x40,0x9a,0x80,0x25, - 0x40,0x65,0x40,0xa0,0x00,0x27,0xc0,0x21,0x00,0x21,0x00,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_191_158_158[45] U8G_FONT_SECTION("fontpage_191_158_158") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9e,0x9e,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x12,0x40,0x22,0x40,0x45,0xa0,0x99,0x20,0x20, - 0x00,0x65,0x00,0xa5,0x00,0x25,0xe0,0x25,0x00,0x2b,0x00,0x31,0xe0}; -const u8g_fntpgm_uint8_t fontpage_191_169_169[45] U8G_FONT_SECTION("fontpage_191_169_169") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x14,0x00,0x27,0xe0,0x4c,0x40,0x97,0xc0,0x24, - 0x40,0x67,0xc0,0xa4,0x00,0x27,0xc0,0x2c,0x80,0x33,0x00,0x2c,0xe0}; -const u8g_fntpgm_uint8_t fontpage_191_174_174[45] U8G_FONT_SECTION("fontpage_191_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2a,0x80,0x6a,0x80,0xbe,0x80,0x01,0xe0,0x5d, - 0x40,0xc3,0x40,0x5d,0x40,0x54,0x80,0x56,0x80,0x55,0x40,0x62,0x20}; -const u8g_fntpgm_uint8_t fontpage_191_195_195[45] U8G_FONT_SECTION("fontpage_191_195_195") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x02,0x00,0x12,0x00,0x12,0x00,0x10, - 0x40,0x50,0x20,0x50,0x20,0x50,0xa0,0x90,0x80,0x10,0x80,0x0f,0x80}; -const u8g_fntpgm_uint8_t fontpage_192_167_167[45] U8G_FONT_SECTION("fontpage_192_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x25,0x00,0xb5,0x00,0xaf,0xe0,0xa9, - 0x00,0xb1,0x00,0x27,0xc0,0x21,0x00,0x21,0x00,0x21,0x00,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_192_226_226[45] U8G_FONT_SECTION("fontpage_192_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x2f,0xe0,0xb2,0x00,0xaa,0x80,0xa4, - 0x80,0xa5,0xa0,0x2a,0xc0,0x30,0x80,0x21,0x40,0x22,0x40,0x24,0x20}; -const u8g_fntpgm_uint8_t fontpage_192_239_239[45] U8G_FONT_SECTION("fontpage_192_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20, - 0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x54,0x40,0x52,0xa0,0x8f,0x80}; -const u8g_fntpgm_uint8_t fontpage_195_182_182[45] U8G_FONT_SECTION("fontpage_195_182_182") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb6,0xb6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xe0,0xb2,0x80,0xaf,0xe0,0xa4, - 0x40,0x27,0xc0,0x24,0x40,0x27,0xc0,0x25,0x40,0x2c,0xa0,0x33,0xa0}; -const u8g_fntpgm_uint8_t fontpage_195_201_201[45] U8G_FONT_SECTION("fontpage_195_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0x7f,0xe0,0x4a,0x80,0x57,0xe0,0x7c, - 0x80,0x57,0xc0,0x54,0x80,0x57,0xe0,0x4a,0x40,0xa8,0xa0,0x4f,0xa0}; -const u8g_fntpgm_uint8_t fontpage_196_144_144[45] U8G_FONT_SECTION("fontpage_196_144_144") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x80,0x02,0x40,0x7f,0xe0,0x42,0x00,0x42, - 0x00,0x7a,0x40,0x4a,0x40,0x4a,0x80,0x49,0x20,0x52,0xa0,0x84,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_182_182[45] U8G_FONT_SECTION("fontpage_196_182_182") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb6,0xb6,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x01,0xc0,0x3e,0x00,0x20,0x00,0x3f,0xc0,0x20, - 0x40,0x20,0x40,0x3f,0xc0,0x20,0x00,0x20,0x00,0x40,0x00,0x80,0x00}; -const u8g_fntpgm_uint8_t fontpage_196_192_192[45] U8G_FONT_SECTION("fontpage_196_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x18,0x60,0x63,0x80,0x42,0x00,0x7a,0x00,0x4b, - 0xe0,0x4a,0x40,0x7a,0x40,0x42,0x40,0x42,0x40,0x44,0x40,0x88,0x40}; -const u8g_fntpgm_uint8_t fontpage_196_199_199[45] U8G_FONT_SECTION("fontpage_196_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xe0,0x40,0x20,0x7f,0xe0,0x40, - 0x00,0x7d,0xe0,0x44,0x20,0x54,0xa0,0x4c,0x60,0x54,0xa0,0xa9,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_203_203[45] U8G_FONT_SECTION("fontpage_196_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x03,0xc0,0x7c,0x00,0x04,0x00,0x7f,0xc0,0x04, - 0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00,0x04,0x00,0x0c,0x00}; -const u8g_fntpgm_uint8_t fontpage_196_211_211[45] U8G_FONT_SECTION("fontpage_196_211_211") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xe0,0xf8,0x80,0x20,0x80,0x28, - 0x80,0x30,0x80,0x60,0x80,0xa0,0x80,0x20,0x80,0x20,0x80,0xe3,0x80}; -const u8g_fntpgm_uint8_t fontpage_196_231_231[45] U8G_FONT_SECTION("fontpage_196_231_231") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xe7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x22,0x00,0xff,0x80,0x22,0x80,0x2a, - 0x80,0x36,0x80,0x62,0x80,0xa7,0xa0,0x24,0xa0,0xa8,0xa0,0x50,0x60}; -const u8g_fntpgm_uint8_t fontpage_196_249_249[45] U8G_FONT_SECTION("fontpage_196_249_249") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf9,0xf9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x80,0x24,0x80,0xfc,0x80,0x24,0xa0,0x2f, - 0xc0,0x34,0x80,0x64,0x80,0xa4,0x80,0x25,0xa0,0x26,0xa0,0xe4,0x60}; -const u8g_fntpgm_uint8_t fontpage_197_150_150[45] U8G_FONT_SECTION("fontpage_197_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x40,0x22,0x40,0xf9,0x40,0x20,0x40,0x2a, - 0x40,0x31,0x40,0x60,0xe0,0xaf,0x40,0x20,0x40,0x20,0x40,0xe0,0x40}; -const u8g_fntpgm_uint8_t fontpage_197_189_189[45] U8G_FONT_SECTION("fontpage_197_189_189") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xbd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x20,0x80,0xf8,0x80,0x27,0xe0,0x2c, - 0xa0,0x34,0xa0,0x67,0xe0,0xa4,0xa0,0x24,0xa0,0x27,0xe0,0xe4,0x20}; -const u8g_fntpgm_uint8_t fontpage_197_212_212[45] U8G_FONT_SECTION("fontpage_197_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x22,0x40,0xff,0xe0,0x22,0x00,0x2b, - 0xc0,0x32,0x40,0x65,0x40,0xa4,0x80,0x28,0x80,0x29,0x40,0xe6,0x20}; -const u8g_fntpgm_uint8_t fontpage_198_137_137[45] U8G_FONT_SECTION("fontpage_198_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x20,0x80,0xff,0xe0,0x25,0x20,0x29, - 0x00,0x37,0xe0,0x62,0x40,0xa6,0x40,0x21,0x80,0x22,0x80,0xec,0x60}; -const u8g_fntpgm_uint8_t fontpage_199_137_137[45] U8G_FONT_SECTION("fontpage_199_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0xe0,0xf9,0x00,0x27,0xc0,0x2c, - 0x40,0x37,0xc0,0x64,0x40,0xa7,0xc0,0x21,0x00,0x2f,0xe0,0xe1,0x00}; -const u8g_fntpgm_uint8_t fontpage_199_162_162[45] U8G_FONT_SECTION("fontpage_199_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xe0,0x28,0x20,0xf2,0x80,0x24,0x40,0x29, - 0x20,0x31,0x00,0x6f,0xe0,0xa1,0x00,0x25,0x80,0x29,0x40,0xf1,0x20}; -const u8g_fntpgm_uint8_t fontpage_199_167_167[45] U8G_FONT_SECTION("fontpage_199_167_167") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0xf8,0x20,0x22,0x80,0x24, - 0x40,0x38,0x20,0x67,0xc0,0xa1,0x00,0x21,0x00,0x21,0x00,0xef,0xe0}; -const u8g_fntpgm_uint8_t fontpage_199_210_210[45] U8G_FONT_SECTION("fontpage_199_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0xc0,0x27,0x00,0xf1,0x00,0x2f,0xe0,0x21, - 0x00,0x35,0x60,0x69,0x20,0xad,0x60,0x29,0x20,0x29,0x20,0xef,0xe0}; -const u8g_fntpgm_uint8_t fontpage_199_219_219[45] U8G_FONT_SECTION("fontpage_199_219_219") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0xf4,0x80,0x2f,0xe0,0x2a, - 0xa0,0x3a,0xa0,0x6c,0x60,0xa1,0x00,0x2f,0xe0,0x22,0x80,0xec,0x60}; -const u8g_fntpgm_uint8_t fontpage_201_199_199[45] U8G_FONT_SECTION("fontpage_201_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xe0,0x2a,0xa0,0xff,0xe0,0x21,0x00,0x2f, - 0xe0,0x32,0x80,0xe7,0xc0,0x21,0x00,0x2f,0xe0,0xa1,0x00,0x61,0x00}; -const u8g_fntpgm_uint8_t fontpage_201_202_203[73] U8G_FONT_SECTION("fontpage_201_202_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfd,0xc0,0xa9,0x40,0xf9,0x60,0xab,0xc0,0xfd, - 0x40,0xa9,0x80,0xab,0x60,0xfe,0x00,0x04,0x00,0xff,0xe0,0x04,0x00,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x29,0x20,0x25,0x40,0xff,0xe0,0x2a,0xa0,0x2b,0x80,0x30,0x00,0xef, - 0xe0,0x29,0x20,0x2f,0xe0,0xa9,0x20,0x6f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_201_224_224[45] U8G_FONT_SECTION("fontpage_201_224_224") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0xfa,0xa0,0x25,0x40,0x2d, - 0x60,0x35,0x40,0xe4,0x40,0x27,0xc0,0x24,0x40,0xa7,0xc0,0x68,0x40}; -const u8g_fntpgm_uint8_t fontpage_202_190_190[45] U8G_FONT_SECTION("fontpage_202_190_190") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbe,0xbe,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x11,0x00,0xfd,0xe0,0x22,0x40,0x25, - 0x40,0x39,0x40,0x29,0x40,0x28,0x80,0x49,0x80,0x4a,0x40,0x94,0x20}; -const u8g_fntpgm_uint8_t fontpage_202_215_215[45] U8G_FONT_SECTION("fontpage_202_215_215") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd7,0xd7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7d,0x00,0x45,0x00,0x7d,0xe0,0x47,0x40,0x7d, - 0x40,0x45,0x40,0x7d,0x40,0x45,0x40,0x28,0x80,0x45,0x40,0x86,0x20}; -const u8g_fntpgm_uint8_t fontpage_202_244_244[45] U8G_FONT_SECTION("fontpage_202_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x55,0x40,0x7c,0x80,0x39, - 0x40,0x56,0x20,0x7f,0xc0,0x04,0x00,0x27,0x80,0x24,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_202_248_248[45] U8G_FONT_SECTION("fontpage_202_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x7d,0x00,0x55,0xe0,0xff,0x40,0x55, - 0x40,0xfd,0x40,0x95,0x40,0xff,0x40,0x28,0x80,0x19,0x40,0xe6,0x20}; -const u8g_fntpgm_uint8_t fontpage_203_153_153[45] U8G_FONT_SECTION("fontpage_203_153_153") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0xac,0x80,0x72,0x80,0x20,0x80,0xfc, - 0x80,0x22,0x80,0x30,0xe0,0x6f,0x80,0xa0,0x80,0x20,0x80,0x20,0x80}; -const u8g_fntpgm_uint8_t fontpage_203_156_156[45] U8G_FONT_SECTION("fontpage_203_156_156") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9c,0x9c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x40,0x29,0x40,0x44,0xc0,0xb8,0x40,0x12, - 0x40,0x7d,0x40,0x10,0x60,0x55,0xc0,0x52,0x40,0x92,0x40,0x30,0x40}; -const u8g_fntpgm_uint8_t fontpage_203_176_176[45] U8G_FONT_SECTION("fontpage_203_176_176") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x60,0xfd,0x80,0x45,0x00,0x29,0x00,0xfd, - 0xe0,0x11,0x40,0xfd,0x40,0x11,0x40,0x55,0x40,0x92,0x40,0x34,0x40}; -const u8g_fntpgm_uint8_t fontpage_203_188_188[45] U8G_FONT_SECTION("fontpage_203_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x10,0x80,0xfd,0x40,0x21,0x40,0x3a, - 0x20,0x2c,0x80,0x28,0x40,0x28,0x40,0x49,0x00,0x48,0x80,0x98,0x40}; -const u8g_fntpgm_uint8_t fontpage_204_142_142[45] U8G_FONT_SECTION("fontpage_204_142_142") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8e,0x8e,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x03,0xe0,0xf2,0x20,0x92,0x20,0x93,0xe0,0xf2, - 0x20,0x92,0x20,0x93,0xe0,0xf2,0x20,0x04,0x20,0x08,0xa0,0x30,0x40}; -const u8g_fntpgm_uint8_t fontpage_204_194_194[45] U8G_FONT_SECTION("fontpage_204_194_194") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc2,0xc2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xf7,0xc0,0x91,0x00,0x91,0x00,0xff, - 0xe0,0x90,0x80,0x9f,0xe0,0x94,0x80,0xf2,0x80,0x00,0x80,0x03,0x80}; -const u8g_fntpgm_uint8_t fontpage_205_171_171[45] U8G_FONT_SECTION("fontpage_205_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0xe0,0xff,0x00,0x55,0xe0,0x7d,0x40,0x55, - 0x40,0xff,0xc0,0x10,0x40,0x1f,0xc0,0x10,0x40,0x1f,0xc0,0x10,0x40}; -const u8g_fntpgm_uint8_t fontpage_205_244_244[45] U8G_FONT_SECTION("fontpage_205_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xe0,0x02,0x00,0x3f,0xc0,0x22,0x40,0x3f, - 0xc0,0x22,0x40,0x3f,0xc0,0x0a,0x00,0x04,0x00,0x1b,0x00,0xe0,0xe0}; -const u8g_fntpgm_uint8_t fontpage_206_128_128[45] U8G_FONT_SECTION("fontpage_206_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff, - 0xe0,0x48,0x00,0x7f,0xc0,0x4a,0x40,0x79,0x80,0xc9,0x80,0x0e,0x60}; -const u8g_fntpgm_uint8_t fontpage_206_137_137[45] U8G_FONT_SECTION("fontpage_206_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x08,0x00,0xff,0xe0,0x10,0x00,0x1f,0x80,0x30, - 0x80,0x5f,0x80,0x90,0x80,0x1f,0x80,0x10,0x80,0x10,0x80,0x11,0x80}; -const u8g_fntpgm_uint8_t fontpage_206_255_255[45] U8G_FONT_SECTION("fontpage_206_255_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0xc0,0x27,0x00,0xfc,0x00,0x24,0x00,0x27, - 0xc0,0x74,0x40,0x6e,0x40,0xa5,0x80,0x28,0x80,0x29,0x40,0x36,0x20}; -const u8g_fntpgm_uint8_t fontpage_207_241_241[45] U8G_FONT_SECTION("fontpage_207_241_241") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x21,0x00,0xff,0xe0,0x21,0x00,0x71, - 0x00,0x69,0x00,0xa7,0xc0,0xa1,0x00,0x21,0x00,0x21,0x00,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_208_161_161[45] U8G_FONT_SECTION("fontpage_208_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x21,0x00,0x2f,0xe0,0xf0,0x00,0x22, - 0x80,0x74,0x40,0x6a,0xa0,0xa2,0x80,0x21,0x00,0x22,0x80,0x2c,0x60}; -const u8g_fntpgm_uint8_t fontpage_208_188_188[45] U8G_FONT_SECTION("fontpage_208_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0xf4,0x40,0x2a,0x80,0x21, - 0x00,0x72,0x80,0x6c,0x60,0xa7,0xc0,0x24,0x40,0x24,0x40,0x27,0xc0}; -const u8g_fntpgm_uint8_t fontpage_209_157_157[45] U8G_FONT_SECTION("fontpage_209_157_157") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x24,0x00,0x27,0xe0,0x5a,0x40,0x51,0x80,0xde, - 0x60,0x51,0x00,0x5f,0xe0,0x51,0x00,0x45,0x40,0x49,0x20,0x53,0x20}; -const u8g_fntpgm_uint8_t fontpage_211_253_253[45] U8G_FONT_SECTION("fontpage_211_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x80,0x2f,0xe0,0xfa,0xa0,0x2f,0xe0,0x2a, - 0xa0,0x3f,0xe0,0x64,0x40,0xa7,0xc0,0x24,0x40,0x27,0xc0,0x24,0x40}; -const u8g_fntpgm_uint8_t fontpage_212_217_217[45] U8G_FONT_SECTION("fontpage_212_217_217") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0x40,0x2a,0xa0,0xf4,0x40,0x27,0xc0,0x38, - 0x20,0x27,0xc0,0x64,0x40,0xa7,0xc0,0x24,0x40,0x22,0x80,0x2f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_212_223_223[45] U8G_FONT_SECTION("fontpage_212_223_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x25,0x40,0x29,0xa0,0xff,0x40,0x25,0x20,0x6f, - 0xe0,0x75,0x40,0xaf,0xe0,0xa5,0x40,0x26,0xa0,0x29,0x60,0x32,0x20}; -const u8g_fntpgm_uint8_t fontpage_213_162_162[45] U8G_FONT_SECTION("fontpage_213_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x22,0x80,0xf4,0x40,0x2b,0xa0,0x60, - 0x00,0x7e,0xe0,0xaa,0xa0,0xae,0xe0,0x24,0x40,0x2a,0xc0,0x31,0x20}; -const u8g_fntpgm_uint8_t fontpage_214_226_226[45] U8G_FONT_SECTION("fontpage_214_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x04,0x00,0x04,0x00,0x04,0x00,0x24,0x00,0x27, - 0x80,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0x24,0x00,0xff,0xc0}; -const u8g_fntpgm_uint8_t fontpage_214_229_229[45] U8G_FONT_SECTION("fontpage_214_229_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x27,0xc0,0x24,0x00,0x24,0x00,0xff, - 0xe0,0x04,0x00,0x14,0x40,0x24,0x80,0x41,0x00,0x06,0x00,0xf8,0x00}; -const u8g_fntpgm_uint8_t fontpage_214_248_248[45] U8G_FONT_SECTION("fontpage_214_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x43,0xc0,0xf0,0x40,0x93,0xc0,0xf8,0x40,0x8f, - 0xe0,0xfc,0xa0,0x20,0x80,0xbb,0xe0,0xa2,0xa0,0xba,0xe0,0xe0,0x80}; -const u8g_fntpgm_uint8_t fontpage_215_188_188[45] U8G_FONT_SECTION("fontpage_215_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0xc0,0xfd,0x40,0x11,0x40,0xff,0x60,0x84, - 0x00,0x7b,0xe0,0x01,0x40,0x79,0x40,0x4a,0x80,0x4d,0x40,0x82,0x20}; -const u8g_fntpgm_uint8_t fontpage_215_212_212[45] U8G_FONT_SECTION("fontpage_215_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x84,0x00,0x84,0x00,0x84,0x80,0x85,0x00,0xf6, - 0x00,0x84,0x00,0x84,0x00,0x84,0x00,0xb4,0x40,0xc4,0x40,0x83,0xc0}; -const u8g_fntpgm_uint8_t fontpage_217_146_146[45] U8G_FONT_SECTION("fontpage_217_146_146") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x23,0xc0,0x84,0x40,0x59,0x40,0x10, - 0x80,0x27,0xc0,0x24,0x40,0xc2,0x80,0x41,0x00,0x46,0x80,0x58,0x60}; -const u8g_fntpgm_uint8_t fontpage_218_187_187[45] U8G_FONT_SECTION("fontpage_218_187_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0xc0,0x27,0x00,0x81,0x00,0x5f,0xe0,0x11, - 0x00,0x21,0x00,0x27,0xc0,0xc4,0x40,0x44,0x40,0x47,0xc0,0x44,0x40}; -const u8g_fntpgm_uint8_t fontpage_219_136_136[45] U8G_FONT_SECTION("fontpage_219_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x49,0x20,0x25,0x40,0x81,0x00,0x57,0xe0,0x14, - 0x20,0x27,0xe0,0x24,0x20,0xc7,0xe0,0x44,0x20,0x44,0x20,0x44,0x60}; -const u8g_fntpgm_uint8_t fontpage_219_188_188[45] U8G_FONT_SECTION("fontpage_219_188_188") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbc,0xbc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x21,0x00,0x8f,0xe0,0x50,0x00,0x17, - 0xc0,0x24,0x40,0x27,0xc0,0xc1,0x00,0x45,0x40,0x49,0x20,0x53,0x20}; -const u8g_fntpgm_uint8_t fontpage_219_225_225[45] U8G_FONT_SECTION("fontpage_219_225_225") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x25,0x40,0x09,0x80,0x82,0x80,0x54, - 0x40,0x29,0x20,0x25,0x40,0xc5,0x80,0x49,0x00,0x42,0x80,0x5c,0x60}; -const u8g_fntpgm_uint8_t fontpage_220_133_133[45] U8G_FONT_SECTION("fontpage_220_133_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x2f,0xe0,0x01,0x00,0x97,0xc0,0x51, - 0x00,0x2f,0xe0,0x24,0x40,0xc7,0x40,0x45,0xc0,0x44,0x40,0x44,0xc0}; -const u8g_fntpgm_uint8_t fontpage_220_172_172[45] U8G_FONT_SECTION("fontpage_220_172_172") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4e,0x20,0x2a,0xa0,0x0a,0xa0,0x8e,0xa0,0x5a, - 0xa0,0x2e,0xa0,0x2a,0xa0,0xca,0xa0,0x4e,0x20,0x4a,0x20,0x51,0x60}; -const u8g_fntpgm_uint8_t fontpage_221_144_144[45] U8G_FONT_SECTION("fontpage_221_144_144") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x28,0x80,0x8b,0xe0,0x4a,0x20,0x1b, - 0xe0,0x2a,0x20,0x2b,0xe0,0xc8,0x80,0x4a,0xc0,0x54,0xa0,0x69,0xa0}; -const u8g_fntpgm_uint8_t fontpage_221_150_150[45] U8G_FONT_SECTION("fontpage_221_150_150") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x85,0x00,0x4f,0xe0,0x99,0x00,0x4f,0xc0,0x49, - 0x00,0xcf,0xc0,0x49,0x00,0x4f,0xe0,0x04,0x00,0xff,0xe0,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_221_171_171[45] U8G_FONT_SECTION("fontpage_221_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0x25,0x40,0x06,0xc0,0x84,0x40,0x47, - 0xc0,0x20,0x00,0x2f,0xe0,0xca,0xa0,0x4a,0xa0,0x4a,0xa0,0x5f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_223_192_192[45] U8G_FONT_SECTION("fontpage_223_192_192") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x80,0x3e,0x80,0x12,0xe0,0x9e,0xa0,0x53, - 0xa0,0x3e,0xa0,0x28,0xa0,0xdf,0xa0,0x4a,0x40,0x52,0xa0,0x65,0x20}; -const u8g_fntpgm_uint8_t fontpage_224_239_239[45] U8G_FONT_SECTION("fontpage_224_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x17,0xe0,0x54,0x80,0x58,0x80,0x50, - 0x80,0x90,0x80,0x10,0x80,0x10,0x80,0x28,0x80,0x44,0x80,0x81,0x80}; -const u8g_fntpgm_uint8_t fontpage_226_161_161[45] U8G_FONT_SECTION("fontpage_226_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0x7f,0xe0,0xaa,0x80,0x2a,0x80,0xff, - 0xe0,0x2a,0x80,0x2a,0x80,0xff,0xe0,0x12,0x40,0x49,0x20,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_227_177_177[45] U8G_FONT_SECTION("fontpage_227_177_177") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xf9,0x00,0x23,0xc0,0xfd,0x40,0x53, - 0x40,0xa9,0x40,0xfa,0xe0,0x22,0x20,0xfa,0x40,0x49,0x20,0x89,0x20}; -const u8g_fntpgm_uint8_t fontpage_227_200_200[45] U8G_FONT_SECTION("fontpage_227_200_200") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc8,0xc8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2f,0xa0,0x2b,0x40,0xac,0x80,0xb7,0xc0,0xa8, - 0x20,0x37,0xc0,0x24,0x40,0x27,0xc0,0x52,0x80,0x49,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_228_199_199[45] U8G_FONT_SECTION("fontpage_228_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x21,0x00,0x3f,0xe0,0x20, - 0x00,0x20,0x00,0x3f,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_231_135_135[45] U8G_FONT_SECTION("fontpage_231_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x88,0x40,0x52,0x80,0x0c, - 0x00,0x2a,0x80,0xdf,0x40,0x04,0x00,0xff,0xe0,0x04,0x00,0x04,0x00}; -const u8g_fntpgm_uint8_t fontpage_234_168_168[45] U8G_FONT_SECTION("fontpage_234_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x44,0x40,0x44,0x40,0x7f,0xc0,0x44, - 0x40,0x44,0x40,0x7f,0xc0,0x44,0x40,0x44,0x40,0x84,0x40,0x84,0xc0}; -const u8g_fntpgm_uint8_t fontpage_234_204_204[45] U8G_FONT_SECTION("fontpage_234_204_204") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x44,0x40,0x7f,0xc0,0x44,0x40,0x7f, - 0xc0,0x0a,0x00,0x31,0x80,0xd1,0x60,0x11,0x00,0x21,0x00,0x41,0x00}; -const u8g_fntpgm_uint8_t fontpage_236_253_253[34] U8G_FONT_SECTION("fontpage_236_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x08,0x0b,0x0b,0x0c,0x02,0xff,0x10,0x20,0xff,0x81,0x81,0xff,0x81,0x81,0x81, - 0xff,0x81}; -const u8g_fntpgm_uint8_t fontpage_237_132_132[45] U8G_FONT_SECTION("fontpage_237_132_132") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x22,0x00,0x42,0x00,0xf7,0xc0,0x98,0x40,0x90, - 0x40,0xf4,0x40,0x92,0x40,0x92,0x40,0x90,0x40,0xf0,0x40,0x91,0x80}; -const u8g_fntpgm_uint8_t fontpage_237_244_244[45] U8G_FONT_SECTION("fontpage_237_244_244") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x04,0x00,0x3f,0x80,0x20, - 0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0x20,0x80,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_238_129_129[45] U8G_FONT_SECTION("fontpage_238_129_129") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x81,0x81,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x14,0x80,0x25,0x60,0x46,0x20,0x1f, - 0x80,0x30,0x80,0xdf,0x80,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f,0x80}; -const u8g_fntpgm_uint8_t fontpage_238_160_160[45] U8G_FONT_SECTION("fontpage_238_160_160") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa0,0xa0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x07,0xe0,0xf4,0x20,0x97,0xe0,0xf4,0x80,0x94, - 0x80,0x97,0xe0,0xf4,0x80,0x94,0x80,0xf4,0xa0,0x96,0x60,0x04,0x20}; -const u8g_fntpgm_uint8_t fontpage_240_141_141[45] U8G_FONT_SECTION("fontpage_240_141_141") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8d,0x8d,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0x00,0xfa,0x00,0x23,0xe0,0x24,0x20,0x79, - 0x40,0xc9,0x00,0x49,0x00,0x49,0x00,0x7a,0x80,0x4c,0x40,0x08,0x20}; -const u8g_fntpgm_uint8_t fontpage_243_251_251[45] U8G_FONT_SECTION("fontpage_243_251_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xe3,0xe0,0x24,0x20,0xfa,0x40,0x21, - 0x80,0x36,0x80,0x29,0xe0,0x62,0x20,0xa5,0x40,0x20,0x80,0x27,0x00}; -const u8g_fntpgm_uint8_t fontpage_244_205_205[45] U8G_FONT_SECTION("fontpage_244_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xef,0xe0,0x21,0x00,0xff,0xc0,0x21, - 0x00,0x2f,0xe0,0x34,0x40,0x6f,0xc0,0xa4,0x40,0x27,0xc0,0x2c,0x60}; -const u8g_fntpgm_uint8_t fontpage_245_239_239[45] U8G_FONT_SECTION("fontpage_245_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x81,0x00,0x45,0x20,0xf7,0xe0,0x00,0x00,0xaf, - 0xe0,0xa1,0x00,0xaf,0xe0,0x4a,0xa0,0x6a,0xa0,0x8a,0xa0,0x08,0x60}; -const u8g_fntpgm_uint8_t fontpage_246_201_201[45] U8G_FONT_SECTION("fontpage_246_201_201") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x7b,0xe0,0x94,0x80,0x7f,0xc0,0x04, - 0x00,0xff,0xe0,0x01,0x00,0x7f,0xc0,0x11,0x00,0x09,0x00,0x03,0x00}; -const u8g_fntpgm_uint8_t fontpage_247_161_161[45] U8G_FONT_SECTION("fontpage_247_161_161") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x3d,0xe0,0x52,0x80,0xff,0xe0,0x80, - 0x20,0x3f,0x80,0x20,0x80,0x3f,0xc0,0x20,0x40,0x20,0x40,0x3f,0xc0}; -const u8g_fntpgm_uint8_t fontpage_249_251_251[45] U8G_FONT_SECTION("fontpage_249_251_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x09,0x0b,0x16,0x0c,0x01,0xff,0x03,0x80,0xfc,0x00,0x11,0x00,0x7e,0x00,0x08, - 0x00,0x11,0x00,0xff,0x80,0x08,0x80,0x2a,0x00,0x49,0x00,0x98,0x80}; -const u8g_fntpgm_uint8_t fontpage_250_171_171[45] U8G_FONT_SECTION("fontpage_250_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x51,0x40,0x5d,0x80,0x51,0x20,0xfd, - 0xe0,0x08,0x80,0x3f,0x00,0x08,0x80,0x7f,0xc0,0x24,0x80,0xcc,0x60}; -const u8g_fntpgm_uint8_t fontpage_250_176_176[45] U8G_FONT_SECTION("fontpage_250_176_176") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xe0,0x55,0x20,0xf5,0x20,0x25, - 0x20,0x57,0xe0,0xed,0x20,0x05,0x20,0x55,0x20,0xaf,0xe0,0xac,0x20}; -const u8g_fntpgm_uint8_t fontpage_250_194_194[45] U8G_FONT_SECTION("fontpage_250_194_194") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc2,0xc2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x23,0xc0,0x54,0x40,0xf2,0x80,0x21, - 0x00,0x52,0x80,0xec,0x60,0x01,0x00,0x50,0x80,0xab,0x00,0x80,0xc0}; -const u8g_fntpgm_uint8_t fontpage_250_241_242[73] U8G_FONT_SECTION("fontpage_250_241_242") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x20,0x80,0x57,0xe0,0xf1,0x00,0x22, - 0x40,0x57,0xa0,0xe8,0x00,0x02,0x80,0x52,0xa0,0xac,0xa0,0xa8,0x60,0x0b,0x0b,0x16, - 0x0c,0x00,0xff,0x21,0x00,0x21,0x00,0x52,0x40,0xf7,0x80,0x21,0x40,0x57,0xe0,0xe8, - 0x80,0x02,0xc0,0x54,0xa0,0xa8,0xa0,0xa9,0x80}; -const u8g_fntpgm_uint8_t fontpage_251_178_178[45] U8G_FONT_SECTION("fontpage_251_178_178") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb2,0xb2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xe0,0x24,0x20,0x55,0x60,0xf4,0xa0,0x27, - 0xe0,0x54,0xa0,0xef,0xe0,0x05,0x20,0x55,0xe0,0xac,0x20,0xac,0x60}; -const u8g_fntpgm_uint8_t fontpage_251_210_210[45] U8G_FONT_SECTION("fontpage_251_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x20,0x27,0xa0,0x51,0x40,0xff,0xe0,0x21, - 0x00,0x53,0xe0,0xee,0x20,0x03,0xe0,0x52,0x20,0xab,0xe0,0xaa,0x20}; -const u8g_fntpgm_uint8_t fontpage_251_218_218[45] U8G_FONT_SECTION("fontpage_251_218_218") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xda,0xda,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xc0,0x54,0x40,0xf7,0xc0,0x24, - 0x40,0x57,0xc0,0xe9,0x20,0x07,0x40,0x53,0x80,0xad,0x40,0xab,0x20}; -const u8g_fntpgm_uint8_t fontpage_251_232_232[45] U8G_FONT_SECTION("fontpage_251_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x2f,0xe0,0x58,0x20,0xff,0xe0,0x28, - 0x00,0x5f,0xe0,0xea,0xa0,0x0f,0xe0,0x5a,0xa0,0xaa,0xa0,0xaa,0x60}; -const u8g_fntpgm_uint8_t fontpage_252_174_174[45] U8G_FONT_SECTION("fontpage_252_174_174") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xae,0xae,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xe0,0x44,0x20,0xfb,0xe0,0x24, - 0x80,0x5d,0xe0,0xf5,0x20,0x05,0xe0,0x55,0x20,0xad,0xe0,0xa5,0x20}; -const u8g_fntpgm_uint8_t fontpage_252_189_189[45] U8G_FONT_SECTION("fontpage_252_189_189") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xbd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0x27,0xe0,0x55,0x60,0xf6,0xa0,0x25, - 0x20,0x56,0xa0,0xef,0xe0,0x01,0x40,0x56,0xa0,0xaa,0x60,0xa9,0xc0}; -const u8g_fntpgm_uint8_t fontpage_252_252_252[45] U8G_FONT_SECTION("fontpage_252_252_252") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4a,0x40,0x4d,0xa0,0x8a,0x40,0xfd,0xa0,0x28, - 0x00,0x4f,0xe0,0xfa,0x40,0x0d,0xa0,0x5a,0x40,0xad,0xa0,0xaf,0xe0}; -const u8g_fntpgm_uint8_t fontpage_253_140_140[45] U8G_FONT_SECTION("fontpage_253_140_140") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8c,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x4f,0xe0,0x91,0x00,0xef,0xe0,0x2a, - 0xa0,0x5f,0xe0,0xf4,0x40,0x07,0xc0,0x54,0x40,0xaf,0xc0,0xac,0x60}; -const u8g_fntpgm_uint8_t fontpage_253_162_162[45] U8G_FONT_SECTION("fontpage_253_162_162") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa2,0xa2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x00,0x27,0xc0,0x41,0x00,0x51,0x00,0xe1, - 0x00,0x21,0x00,0x41,0x00,0xf1,0x00,0x01,0x00,0x31,0x00,0xcf,0xe0}; -const u8g_fntpgm_uint8_t fontpage_253_255_255[45] U8G_FONT_SECTION("fontpage_253_255_255") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x20,0x40,0x43,0xc0,0xf0,0x40,0x2f, - 0xe0,0x41,0x20,0xf5,0x40,0x03,0x80,0x35,0x40,0xc9,0x20,0x03,0x00}; -const u8g_fntpgm_uint8_t fontpage_254_186_186[45] U8G_FONT_SECTION("fontpage_254_186_186") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xba,0xba,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x41,0x00,0x7b,0xc0,0xa1,0x40,0x21, - 0x40,0xff,0xe0,0x21,0x00,0xa9,0x00,0xaa,0x80,0xfa,0x40,0x04,0x20}; -const u8g_fntpgm_uint8_t fontpage_254_209_209[45] U8G_FONT_SECTION("fontpage_254_209_209") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x80,0x40,0x91,0x40,0xd5,0x40,0xa2, - 0x40,0x92,0x40,0xad,0x40,0xc5,0x40,0x88,0x40,0x80,0x40,0x81,0xc0}; -const u8g_fntpgm_uint8_t fontpage_254_238_238[45] U8G_FONT_SECTION("fontpage_254_238_238") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x4a,0x40,0x7f,0xc0,0x04,0x00,0xff, - 0xe0,0x20,0x80,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_254_242_242[45] U8G_FONT_SECTION("fontpage_254_242_242") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xe0,0x49,0x20,0x7f,0xe0,0x04,0x40,0x3f, - 0x80,0x05,0x00,0xff,0xe0,0x30,0x80,0xdf,0x80,0x10,0x80,0x1f,0x80}; -const u8g_fntpgm_uint8_t fontpage_256_240_240[45] U8G_FONT_SECTION("fontpage_256_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf9,0x00,0x57,0xe0,0x56,0xa0,0x75,0x20,0x56, - 0xa0,0x77,0xe0,0x51,0x00,0x52,0xc0,0xfe,0x20,0x12,0x60,0x11,0xc0}; -const u8g_fntpgm_uint8_t fontpage_259_234_234[34] U8G_FONT_SECTION("fontpage_259_234_234") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xea,0xea,0x00,0x0a,0xff,0x00, - 0x00,0x07,0x0b,0x0b,0x0c,0x02,0xff,0x20,0xfe,0x82,0x82,0xfe,0x82,0xfe,0x82,0x82, - 0xfe,0x82}; -const u8g_fntpgm_uint8_t fontpage_265_221_221[45] U8G_FONT_SECTION("fontpage_265_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0xff,0xe0,0x11,0x00,0x52,0x00,0x53, - 0xc0,0x55,0x00,0x10,0x80,0x7f,0xc0,0x4a,0x40,0x4a,0x40,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_272_204_204[45] U8G_FONT_SECTION("fontpage_272_204_204") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x40,0x00,0x80,0x00,0x10,0x00,0x2f, - 0xe0,0x60,0x80,0xa0,0x80,0x20,0x80,0x20,0x80,0x20,0x80,0x23,0x80}; -const u8g_fntpgm_uint8_t fontpage_272_232_232[45] U8G_FONT_SECTION("fontpage_272_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0x3f,0x80,0x04, - 0x00,0xff,0xe0,0x0a,0x40,0x12,0x80,0x31,0x00,0xd4,0x80,0x18,0x60}; -const u8g_fntpgm_uint8_t fontpage_273_171_171[45] U8G_FONT_SECTION("fontpage_273_171_171") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xab,0xab,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x80,0x20,0x80,0xff,0xe0,0x14,0xa0,0x2c, - 0x80,0x77,0xe0,0xad,0x40,0x25,0x40,0x24,0x80,0x29,0x40,0x36,0x20}; -const u8g_fntpgm_uint8_t fontpage_273_197_197[45] U8G_FONT_SECTION("fontpage_273_197_197") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x9f,0xe0,0x51,0x00,0x31,0x00,0xd7, - 0xc0,0x12,0x00,0xff,0xe0,0x0c,0x40,0x32,0x80,0xd1,0x00,0x18,0xe0}; -const u8g_fntpgm_uint8_t fontpage_273_221_221[45] U8G_FONT_SECTION("fontpage_273_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x51,0x00,0x7f,0xe0,0x11,0x00,0xf1,0x00,0x57, - 0xc0,0x84,0x00,0xff,0xe0,0x14,0x80,0x33,0x00,0xd5,0x80,0x18,0x60}; -const u8g_fntpgm_uint8_t fontpage_274_135_135[45] U8G_FONT_SECTION("fontpage_274_135_135") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x00,0x27,0xe0,0xf8,0x00,0x17,0xc0,0x2c, - 0x40,0x77,0xc0,0xac,0x40,0x27,0xc0,0x2c,0x40,0x33,0x80,0x2c,0x60}; -const u8g_fntpgm_uint8_t fontpage_275_210_210[45] U8G_FONT_SECTION("fontpage_275_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x1f,0x00,0x22,0x00,0x7f,0xc0,0xa4, - 0x40,0x3f,0xc0,0x24,0x40,0x3f,0xc0,0x24,0x40,0x45,0x40,0x80,0x80}; -const u8g_fntpgm_uint8_t fontpage_276_136_136[45] U8G_FONT_SECTION("fontpage_276_136_136") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x10,0x80,0xfc,0x80,0x00,0x80,0x7f, - 0xe0,0x00,0x80,0x78,0x80,0x00,0x80,0x78,0x80,0x48,0x80,0x78,0x80}; -const u8g_fntpgm_uint8_t fontpage_276_138_138[45] U8G_FONT_SECTION("fontpage_276_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xc0,0xf2,0x40,0x02,0x40,0xf2,0x40,0x02, - 0x40,0xff,0xc0,0x02,0x40,0xf2,0x40,0x92,0x60,0xf2,0x60,0x92,0x20}; -const u8g_fntpgm_uint8_t fontpage_276_152_152[45] U8G_FONT_SECTION("fontpage_276_152_152") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x98,0x98,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x00,0xf7,0xc0,0x00,0x40,0xf0,0x40,0x07, - 0xc0,0xf4,0x40,0x04,0x00,0xf4,0x00,0x94,0x20,0xf4,0x20,0x93,0xe0}; -const u8g_fntpgm_uint8_t fontpage_276_173_173[45] U8G_FONT_SECTION("fontpage_276_173_173") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0x80,0xf4,0x80,0x04,0x80,0xf4,0xe0,0x08, - 0x00,0xf7,0xc0,0x04,0x40,0xf2,0x80,0x91,0x00,0xf2,0x80,0x9c,0x60}; -const u8g_fntpgm_uint8_t fontpage_276_230_230[45] U8G_FONT_SECTION("fontpage_276_230_230") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe6,0xe6,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0xc0,0xf0,0xa0,0x0f,0xe0,0xf0,0x80,0x07, - 0x80,0xf2,0x80,0x02,0x80,0xf2,0x80,0x93,0xa0,0xfc,0x60,0x90,0x20}; -const u8g_fntpgm_uint8_t fontpage_277_164_164[45] U8G_FONT_SECTION("fontpage_277_164_164") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa4,0xa4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xc0,0xf4,0x40,0x04,0x40,0xf7,0xc0,0x00, - 0x00,0xf7,0xc0,0x01,0x00,0xff,0xe0,0x92,0x80,0xf4,0x40,0x98,0x20}; -const u8g_fntpgm_uint8_t fontpage_277_191_191[45] U8G_FONT_SECTION("fontpage_277_191_191") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x47,0xe0,0xf4,0x20,0x05,0x20,0xf7,0xa0,0x05, - 0x20,0xf7,0xe0,0x04,0x20,0xf7,0xa0,0x96,0xa0,0xf7,0xa0,0x98,0x60}; -const u8g_fntpgm_uint8_t fontpage_277_203_203[45] U8G_FONT_SECTION("fontpage_277_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0xff,0xe0,0x01,0x00,0xf7,0xc0,0x01, - 0x00,0xff,0xe0,0x04,0x40,0xf7,0xc0,0x94,0x40,0xf7,0xc0,0x94,0x40}; -const u8g_fntpgm_uint8_t fontpage_278_240_240[45] U8G_FONT_SECTION("fontpage_278_240_240") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x40,0xff,0xe0,0x01,0x00,0xf7,0xc0,0x01, - 0x00,0xff,0xe0,0x04,0xa0,0xff,0xe0,0x94,0xa0,0xfe,0x40,0x95,0xa0}; -const u8g_fntpgm_uint8_t fontpage_279_138_138[45] U8G_FONT_SECTION("fontpage_279_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x40,0xae,0xa0,0x40,0x40,0xae,0xa0,0xea, - 0xe0,0x5e,0x40,0xa0,0xa0,0x1f,0xc0,0x69,0x00,0x06,0x00,0x79,0xe0}; -const u8g_fntpgm_uint8_t fontpage_281_199_199[45] U8G_FONT_SECTION("fontpage_281_199_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x88,0x00,0x5f,0xc0,0x22,0x40,0xff,0x00,0x61, - 0xc0,0x3f,0x00,0x21,0x00,0x3f,0x00,0x21,0x00,0x3f,0x00,0xe1,0xc0}; -const u8g_fntpgm_uint8_t fontpage_285_248_248[45] U8G_FONT_SECTION("fontpage_285_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0xf8,0x80,0x23,0xe0,0xfa,0xa0,0xaa, - 0xa0,0xfa,0xa0,0xab,0xe0,0xfa,0xa0,0x22,0xa0,0xfb,0xe0,0x22,0x20}; -const u8g_fntpgm_uint8_t fontpage_286_137_137[45] U8G_FONT_SECTION("fontpage_286_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x80,0x7d,0x40,0x11,0x00,0xff,0xe0,0x11, - 0x00,0xff,0x20,0x55,0x40,0x7c,0x80,0x54,0xa0,0xff,0x60,0x12,0x20}; -const u8g_fntpgm_uint8_t fontpage_286_175_175[45] U8G_FONT_SECTION("fontpage_286_175_175") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xc0,0xfa,0x40,0x23,0xc0,0xf8,0x00,0xaf, - 0xe0,0xfa,0x40,0xab,0xc0,0xfa,0x40,0x22,0xe0,0xff,0x40,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_286_184_184[45] U8G_FONT_SECTION("fontpage_286_184_184") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb8,0xb8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x21,0x00,0xfa,0x80,0x24,0x60,0xfb,0x80,0xae, - 0x20,0xfa,0xa0,0xae,0xa0,0xfa,0xa0,0x2e,0xa0,0xfa,0x20,0x2a,0x60}; -const u8g_fntpgm_uint8_t fontpage_287_209_209[45] U8G_FONT_SECTION("fontpage_287_209_209") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0xc0,0x27,0x00,0x24,0x00,0x07,0xe0,0xe4, - 0x80,0x24,0x80,0x24,0x80,0x24,0x80,0x28,0x80,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_287_212_212[45] U8G_FONT_SECTION("fontpage_287_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x40,0x60,0x27,0x80,0x24,0x00,0x07,0xe0,0xe6, - 0x20,0x25,0x40,0x24,0x80,0x29,0x40,0x26,0x20,0x50,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_128_128[45] U8G_FONT_SECTION("fontpage_288_128_128") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x8f,0xc0,0x48,0x40,0x4f,0xc0,0x08,0x40,0xcf, - 0xc0,0x48,0x00,0x4b,0x40,0x48,0x80,0x4e,0x40,0xb0,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_159_159[45] U8G_FONT_SECTION("fontpage_288_159_159") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x3f,0xe0,0x21,0x00,0x0f,0xe0,0xe9, - 0x20,0x2f,0xe0,0x23,0x80,0x25,0x40,0x29,0x20,0x51,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_178_178[45] U8G_FONT_SECTION("fontpage_288_178_178") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb2,0xb2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x43,0x00,0x24,0x80,0x27,0xe0,0x0c,0x80,0xf7, - 0xe0,0x24,0x80,0x27,0xe0,0x24,0x80,0x27,0xe0,0x54,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_203_203[45] U8G_FONT_SECTION("fontpage_288_203_203") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4f,0xe0,0x29,0x20,0x2f,0xe0,0x05,0x40,0xe7, - 0xc0,0x25,0x40,0x27,0xc0,0x21,0x00,0x2f,0xe0,0x51,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_212_212[45] U8G_FONT_SECTION("fontpage_288_212_212") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd4,0xd4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x41,0x00,0x27,0xc0,0x21,0x00,0x0f,0xe0,0xe2, - 0x80,0x2f,0xe0,0x21,0x00,0x2f,0xe0,0x21,0x00,0x51,0x00,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_288_248_248[45] U8G_FONT_SECTION("fontpage_288_248_248") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf8,0xf8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x4e,0xe0,0x2a,0xa0,0x2e,0xe0,0x08,0x80,0xea, - 0xa0,0x2f,0xe0,0x22,0x80,0x2f,0xe0,0x22,0x40,0x54,0x20,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_289_132_132[45] U8G_FONT_SECTION("fontpage_289_132_132") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x9f,0xc0,0x55,0x40,0x5f,0xc0,0x00,0x00,0xff, - 0xe0,0x28,0x80,0x2f,0xa0,0x27,0x40,0x2a,0x80,0x52,0x40,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_289_138_138[45] U8G_FONT_SECTION("fontpage_289_138_138") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8a,0x8a,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x42,0x00,0x2f,0xc0,0x28,0x40,0x1f,0xe0,0xf4, - 0xa0,0x29,0x40,0x3f,0xe0,0x22,0x00,0x27,0xc0,0x58,0xc0,0x8f,0xe0}; -const u8g_fntpgm_uint8_t fontpage_289_232_232[45] U8G_FONT_SECTION("fontpage_289_232_232") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe8,0xe8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0xe0,0xff,0x20,0x45,0x20,0x29,0x40,0xff, - 0x80,0x01,0x40,0x7d,0x20,0x45,0x20,0x45,0xa0,0x7d,0x40,0x45,0x00}; -const u8g_fntpgm_uint8_t fontpage_291_202_202[45] U8G_FONT_SECTION("fontpage_291_202_202") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xca,0xca,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x1f,0xc0,0xe2,0x80,0xa9,0x00,0x72,0x80,0xfd, - 0x60,0x31,0x00,0x6f,0xc0,0xa1,0x00,0xaf,0xe0,0x21,0x00,0x21,0x00}; -const u8g_fntpgm_uint8_t fontpage_291_205_205[45] U8G_FONT_SECTION("fontpage_291_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0xff,0xe0,0x24,0x80,0x3f, - 0x80,0x24,0x80,0x3f,0x80,0x04,0x00,0x7f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_291_207_207[45] U8G_FONT_SECTION("fontpage_291_207_207") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0x80,0x20,0x80,0x3f,0x80,0x20,0x80,0xff, - 0xe0,0x24,0x80,0x3f,0x80,0x24,0x80,0x7f,0xc0,0x04,0x00,0xff,0xe0}; -const u8g_fntpgm_uint8_t fontpage_291_221_221[45] U8G_FONT_SECTION("fontpage_291_221_221") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x20,0x80,0x50,0x80,0x88,0x80,0x78,0x80,0x27, - 0xe0,0xf8,0x80,0x20,0x80,0xa8,0x80,0x70,0x80,0x38,0x80,0xc0,0x80}; -const u8g_fntpgm_uint8_t fontpage_292_149_149[45] U8G_FONT_SECTION("fontpage_292_149_149") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x95,0x95,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x27,0xc0,0x31,0x40,0x49,0x40,0xf9,0x40,0x21, - 0x40,0xff,0xc0,0x22,0x40,0xaa,0x40,0x72,0x40,0x3a,0x40,0xc7,0xe0}; -const u8g_fntpgm_uint8_t fontpage_294_175_175[45] U8G_FONT_SECTION("fontpage_294_175_175") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x40,0x57,0xe0,0x8a,0x40,0x7a,0x40,0x27, - 0xe0,0xf8,0x00,0x23,0xe0,0xaa,0x20,0x73,0xe0,0x3a,0x20,0xe3,0xe0}; -const u8g_fntpgm_uint8_t fontpage_294_245_245[45] U8G_FONT_SECTION("fontpage_294_245_245") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf5,0xf5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2c,0x80,0x25,0xe0,0x54,0xa0,0xfb,0xe0,0x2c, - 0xa0,0xf7,0xe0,0x24,0x80,0xb7,0xe0,0x6c,0x80,0x34,0x80,0xcb,0xe0}; -const u8g_fntpgm_uint8_t fontpage_298_247_247[45] U8G_FONT_SECTION("fontpage_298_247_247") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf7,0xf7,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0x3f,0x80,0x20,0x00,0x3f,0x00,0x20,0x00,0x3f, - 0x00,0x20,0x00,0xff,0xc0,0x24,0x80,0x23,0x00,0x29,0x00,0x30,0xc0}; -const u8g_fntpgm_uint8_t fontpage_299_137_137[45] U8G_FONT_SECTION("fontpage_299_137_137") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x8a,0x20,0xfb,0xe0,0x8a,0x20,0xfb, - 0xe0,0x82,0x20,0xbf,0xa0,0x8a,0x20,0x92,0x20,0xa2,0x20,0x86,0xe0}; -const u8g_fntpgm_uint8_t fontpage_299_139_139[45] U8G_FONT_SECTION("fontpage_299_139_139") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8b,0x8b,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x8a,0x20,0xfb,0xe0,0x8a,0x20,0xfb, - 0xe0,0x80,0x20,0x9f,0x20,0x8a,0x20,0xbf,0xa0,0x8a,0x20,0x92,0xe0}; -const u8g_fntpgm_uint8_t fontpage_299_147_147[45] U8G_FONT_SECTION("fontpage_299_147_147") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x93,0x93,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x8a,0x20,0xfb,0xe0,0x8a,0x20,0xfb, - 0xe0,0x9f,0x20,0x91,0x20,0x9f,0x20,0x91,0x20,0x9f,0x20,0x80,0xe0}; -const u8g_fntpgm_uint8_t fontpage_299_220_220[45] U8G_FONT_SECTION("fontpage_299_220_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdc,0xdc,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x8a,0x20,0xfb,0xe0,0x8a,0x20,0xf5, - 0xe0,0xaa,0xa0,0xbb,0xa0,0xaa,0xa0,0xbb,0xa0,0x8a,0x20,0xb2,0x60}; -const u8g_fntpgm_uint8_t fontpage_300_205_205[45] U8G_FONT_SECTION("fontpage_300_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf2,0x00,0x93,0xe0,0xa6,0x40,0xc1,0x80,0xa6, - 0x60,0x91,0x00,0x97,0xe0,0xd5,0x00,0xaf,0xe0,0x81,0x00,0x81,0x00}; -const u8g_fntpgm_uint8_t fontpage_300_228_228[45] U8G_FONT_SECTION("fontpage_300_228_228") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf1,0x00,0x92,0x80,0xa4,0x40,0xcb,0xa0,0xa1, - 0x00,0x9f,0xe0,0x91,0x00,0xe5,0x40,0x89,0x20,0x91,0x20,0x83,0x00}; -const u8g_fntpgm_uint8_t fontpage_301_217_217[45] U8G_FONT_SECTION("fontpage_301_217_217") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x2a,0x80,0x3f,0xe0,0x6a,0x80,0xbf,0xc0,0x2a, - 0x80,0x3f,0xe0,0x00,0x00,0x3f,0xc0,0x08,0x80,0x07,0x00,0x78,0xe0}; -const u8g_fntpgm_uint8_t fontpage_301_251_251[45] U8G_FONT_SECTION("fontpage_301_251_251") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfb,0xfb,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xc0,0x04,0x00,0xff,0xe0,0xa4,0xa0,0x7f, - 0xc0,0x44,0x40,0x7f,0xc0,0x44,0x40,0x7f,0xc0,0x04,0x20,0x07,0xe0}; -const u8g_fntpgm_uint8_t fontpage_302_210_210[45] U8G_FONT_SECTION("fontpage_302_210_210") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd2,0xd2,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0x7f,0xc0,0x04,0x00,0x3f,0x80,0x04, - 0x00,0xff,0xe0,0x10,0x80,0x1f,0x80,0x10,0x80,0x1f,0x80,0x10,0x80}; -const u8g_fntpgm_uint8_t fontpage_302_222_222[45] U8G_FONT_SECTION("fontpage_302_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x0a,0x00,0x0a,0x00,0xfb,0xe0,0x0a,0x00,0x0a, - 0x00,0x7b,0xc0,0x0a,0x00,0x0a,0x00,0xfb,0xe0,0x0a,0x00,0x0a,0x00}; -const u8g_fntpgm_uint8_t fontpage_302_226_226[45] U8G_FONT_SECTION("fontpage_302_226_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe2,0xe2,0x00,0x0a,0xff,0x00, - 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x08,0x00,0x10,0x00,0xff,0xc0,0x92, - 0x40,0x9e,0x40,0x92,0x40,0x9e,0x40,0x92,0x40,0xff,0xc0,0x80,0x40}; -const u8g_fntpgm_uint8_t fontpage_304_133_133[45] U8G_FONT_SECTION("fontpage_304_133_133") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x07,0xe0,0xf9,0x00,0x27,0xe0,0x24,0x20,0x27, - 0xe0,0x24,0x20,0x3f,0xe0,0xc4,0x20,0x07,0xe0,0x02,0x40,0x0c,0x20}; -const u8g_fntpgm_uint8_t fontpage_304_144_144[45] U8G_FONT_SECTION("fontpage_304_144_144") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xff,0xe0,0x91,0x00,0x67,0xc0,0x24,0x40,0xff, - 0xc0,0x24,0x40,0x27,0xc0,0x24,0x40,0x27,0xc0,0x22,0x80,0xec,0x60}; -const u8g_fntpgm_uint8_t fontpage_304_205_205[45] U8G_FONT_SECTION("fontpage_304_205_205") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x23,0xe0,0xfc,0x80,0xa7,0xe0,0x3a,0x20,0x4b, - 0xe0,0xb2,0x20,0x4b,0xe0,0xfe,0x20,0x4b,0xe0,0x79,0x40,0x4e,0x20}; -const u8g_fntpgm_uint8_t fontpage_304_222_222[45] U8G_FONT_SECTION("fontpage_304_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xab,0xe0,0x70,0x80,0x23,0xe0,0xfa,0x20,0x73, - 0xe0,0xaa,0x20,0x23,0xe0,0xfa,0x20,0x23,0xe0,0x51,0x40,0x8e,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_132_132[45] U8G_FONT_SECTION("fontpage_305_132_132") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xfb,0xe0,0x10,0x80,0x63,0xe0,0x22,0x20,0xfa, - 0xa0,0x2a,0xa0,0x22,0xa0,0x22,0xa0,0x22,0xa0,0x21,0x40,0x66,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_168_168[45] U8G_FONT_SECTION("fontpage_305_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xc0,0x21,0x40,0x2e,0x40,0x24,0x40,0x3f, - 0x40,0x35,0x40,0x3f,0x40,0x25,0x40,0x27,0x60,0x5c,0xa0,0x88,0x20}; -const u8g_fntpgm_uint8_t fontpage_305_253_253[45] U8G_FONT_SECTION("fontpage_305_253_253") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfd,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x22,0x00,0x52,0x00,0xab,0xe0,0xfc,0x20,0x8b, - 0xa0,0xfa,0xa0,0x8b,0xa0,0xfa,0x40,0x92,0x20,0xaa,0x20,0xc9,0xe0}; -const u8g_fntpgm_uint8_t fontpage_307_172_172[45] U8G_FONT_SECTION("fontpage_307_172_172") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xac,0xac,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x3f,0xc0,0x24,0x00,0x3f,0x80,0x24,0x00,0x3f, - 0x80,0x24,0x00,0x3f,0xe0,0x00,0x20,0x55,0x20,0x4a,0xa0,0x8a,0xc0}; -const u8g_fntpgm_uint8_t fontpage_308_197_197[45] U8G_FONT_SECTION("fontpage_308_197_197") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc5,0xc5,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x7f,0xe0,0x54,0x00,0x7d,0xc0,0x55,0x40,0x7d, - 0xc0,0x54,0x00,0x7f,0xe0,0x5e,0xa0,0xaf,0xe0,0xac,0x00,0x17,0xe0}; -const u8g_fntpgm_uint8_t fontpage_309_216_216[45] U8G_FONT_SECTION("fontpage_309_216_216") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x04,0x00,0xff,0xe0,0x00,0x00,0x1f,0x00,0x11, - 0x00,0x7f,0xc0,0x40,0x40,0x5f,0x40,0x51,0x40,0x5f,0x40,0x40,0xc0}; -const u8g_fntpgm_uint8_t fontpage_317_196_196[45] U8G_FONT_SECTION("fontpage_317_196_196") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc4,0xc4,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x11,0x00,0x7f,0xc0,0x11,0x00,0xff,0xe0,0x04, - 0x00,0x3f,0x80,0x24,0x80,0x3f,0x80,0x24,0x80,0x3f,0x80,0x60,0xc0}; -const u8g_fntpgm_uint8_t fontpage_317_222_222[45] U8G_FONT_SECTION("fontpage_317_222_222") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, - 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0xf8,0x80,0xa8,0x80,0xf8,0xe0,0xa8,0x80,0xf8, - 0x80,0x23,0xe0,0xfa,0x20,0x22,0x20,0xfa,0x20,0x52,0x20,0xab,0xe0}; -const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510_154_154") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x08,0x00,0x00, - 0x00,0x02,0x07,0x07,0x0c,0x06,0x01,0xc0,0xc0,0x00,0x00,0x00,0xc0,0xc0}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”' - FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿' - FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一' - FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下' - FONTDATA_ITEM(156, 166, 166, fontpage_156_166_166), // '並' -- '並' - FONTDATA_ITEM(156, 170, 170, fontpage_156_170_170), // '个' -- '个' - FONTDATA_ITEM(156, 173, 173, fontpage_156_173_173), // '中' -- '中' - FONTDATA_ITEM(156, 187, 187, fontpage_156_187_187), // '主' -- '主' - FONTDATA_ITEM(156, 203, 203, fontpage_156_203_203), // '之' -- '之' - FONTDATA_ITEM(157, 174, 174, fontpage_157_174_174), // '亮' -- '亮' - FONTDATA_ITEM(157, 228, 228, fontpage_157_228_228), // '令' -- '令' - FONTDATA_ITEM(157, 253, 253, fontpage_157_253_253), // '份' -- '份' - FONTDATA_ITEM(158, 145, 145, fontpage_158_145_145), // '休' -- '休' - FONTDATA_ITEM(158, 205, 206, fontpage_158_205_206), // '位' -- '低' - FONTDATA_ITEM(158, 220, 220, fontpage_158_220_220), // '作' -- '作' - FONTDATA_ITEM(159, 134, 134, fontpage_159_134_134), // '來' -- '來' - FONTDATA_ITEM(159, 155, 155, fontpage_159_155_155), // '供' -- '供' - FONTDATA_ITEM(159, 221, 221, fontpage_159_221_221), // '保' -- '保' - FONTDATA_ITEM(159, 225, 225, fontpage_159_225_225), // '信' -- '信' - FONTDATA_ITEM(160, 139, 139, fontpage_160_139_139), // '個' -- '個' - FONTDATA_ITEM(160, 188, 188, fontpage_160_188_188), // '值' -- '值' - FONTDATA_ITEM(160, 207, 207, fontpage_160_207_207), // '偏' -- '偏' - FONTDATA_ITEM(160, 220, 220, fontpage_160_220_220), // '停' -- '停' - FONTDATA_ITEM(161, 153, 153, fontpage_161_153_153), // '備' -- '備' - FONTDATA_ITEM(161, 179, 179, fontpage_161_179_179), // '傳' -- '傳' - FONTDATA_ITEM(162, 178, 178, fontpage_162_178_178), // '儲' -- '儲' - FONTDATA_ITEM(162, 197, 197, fontpage_162_197_197), // '充' -- '充' - FONTDATA_ITEM(162, 200, 200, fontpage_162_200_200), // '先' -- '先' - FONTDATA_ITEM(162, 229, 229, fontpage_162_229_229), // '入' -- '入' - FONTDATA_ITEM(162, 232, 232, fontpage_162_232_232), // '全' -- '全' - FONTDATA_ITEM(162, 241, 241, fontpage_162_241_241), // '共' -- '共' - FONTDATA_ITEM(162, 247, 247, fontpage_162_247_247), // '具' -- '具' - FONTDATA_ITEM(163, 183, 183, fontpage_163_183_183), // '冷' -- '冷' - FONTDATA_ITEM(163, 198, 198, fontpage_163_198_198), // '准' -- '准' - FONTDATA_ITEM(163, 250, 250, fontpage_163_250_250), // '出' -- '出' - FONTDATA_ITEM(164, 134, 134, fontpage_164_134_134), // '分' -- '分' - FONTDATA_ITEM(164, 151, 151, fontpage_164_151_151), // '列' -- '列' - FONTDATA_ITEM(164, 157, 157, fontpage_164_157_157), // '初' -- '初' - FONTDATA_ITEM(164, 176, 176, fontpage_164_176_176), // '到' -- '到' - FONTDATA_ITEM(164, 182, 183, fontpage_164_182_183), // '制' -- '刷' - FONTDATA_ITEM(164, 245, 245, fontpage_164_245_245), // '創' -- '創' - FONTDATA_ITEM(165, 155, 155, fontpage_165_155_155), // '力' -- '力' - FONTDATA_ITEM(165, 160, 160, fontpage_165_160_160), // '加' -- '加' - FONTDATA_ITEM(165, 168, 168, fontpage_165_168_168), // '动' -- '动' - FONTDATA_ITEM(165, 213, 213, fontpage_165_213_213), // '動' -- '動' - FONTDATA_ITEM(166, 150, 150, fontpage_166_150_150), // '化' -- '化' - FONTDATA_ITEM(166, 202, 202, fontpage_166_202_202), // '半' -- '半' - FONTDATA_ITEM(166, 212, 212, fontpage_166_212_212), // '協' -- '協' - FONTDATA_ITEM(166, 225, 225, fontpage_166_225_225), // '卡' -- '卡' - FONTDATA_ITEM(166, 240, 240, fontpage_166_240_240), // '印' -- '印' - FONTDATA_ITEM(166, 248, 248, fontpage_166_248_248), // '卸' -- '卸' - FONTDATA_ITEM(167, 159, 159, fontpage_167_159_159), // '原' -- '原' - FONTDATA_ITEM(167, 214, 214, fontpage_167_214_214), // '取' -- '取' - FONTDATA_ITEM(167, 240, 240, fontpage_167_240_240), // '台' -- '台' - FONTDATA_ITEM(168, 136, 136, fontpage_168_136_136), // '合' -- '合' - FONTDATA_ITEM(168, 253, 253, fontpage_168_253_253), // '命' -- '命' - FONTDATA_ITEM(169, 140, 140, fontpage_169_140_140), // '和' -- '和' - FONTDATA_ITEM(170, 223, 223, fontpage_170_223_223), // '啟' -- '啟' - FONTDATA_ITEM(171, 174, 174, fontpage_171_174_174), // '單' -- '單' - FONTDATA_ITEM(172, 180, 180, fontpage_172_180_180), // '嘴' -- '嘴' - FONTDATA_ITEM(172, 244, 244, fontpage_172_244_244), // '噴' -- '噴' - FONTDATA_ITEM(173, 222, 222, fontpage_173_222_222), // '回' -- '回' - FONTDATA_ITEM(173, 224, 224, fontpage_173_224_224), // '因' -- '因' - FONTDATA_ITEM(174, 150, 150, fontpage_174_150_150), // '圖' -- '圖' - FONTDATA_ITEM(174, 168, 168, fontpage_174_168_168), // '在' -- '在' - FONTDATA_ITEM(175, 139, 139, fontpage_175_139_139), // '型' -- '型' - FONTDATA_ITEM(176, 202, 202, fontpage_176_202_202), // '塊' -- '塊' - FONTDATA_ITEM(176, 235, 235, fontpage_176_235_235), // '填' -- '填' - FONTDATA_ITEM(177, 138, 138, fontpage_177_138_138), // '墊' -- '墊' - FONTDATA_ITEM(178, 150, 150, fontpage_178_150_150), // '外' -- '外' - FONTDATA_ITEM(178, 154, 154, fontpage_178_154_154), // '多' -- '多' - FONTDATA_ITEM(178, 167, 167, fontpage_178_167_167), // '大' -- '大' - FONTDATA_ITEM(178, 169, 170, fontpage_178_169_170), // '天' -- '太' - FONTDATA_ITEM(178, 177, 177, fontpage_178_177_177), // '失' -- '失' - FONTDATA_ITEM(179, 203, 203, fontpage_179_203_203), // '始' -- '始' - FONTDATA_ITEM(182, 208, 208, fontpage_182_208_208), // '子' -- '子' - FONTDATA_ITEM(182, 216, 216, fontpage_182_216_216), // '存' -- '存' - FONTDATA_ITEM(183, 137, 137, fontpage_183_137_137), // '安' -- '安' - FONTDATA_ITEM(183, 140, 140, fontpage_183_140_140), // '完' -- '完' - FONTDATA_ITEM(183, 154, 154, fontpage_183_154_154), // '定' -- '定' - FONTDATA_ITEM(183, 162, 162, fontpage_183_162_162), // '客' -- '客' - FONTDATA_ITEM(183, 185, 185, fontpage_183_185_185), // '容' -- '容' - FONTDATA_ITEM(184, 141, 141, fontpage_184_141_141), // '對' -- '對' - FONTDATA_ITEM(184, 143, 143, fontpage_184_143_143), // '小' -- '小' - FONTDATA_ITEM(184, 177, 177, fontpage_184_177_177), // '就' -- '就' - FONTDATA_ITEM(187, 229, 229, fontpage_187_229_229), // '工' -- '工' - FONTDATA_ITEM(187, 242, 242, fontpage_187_242_242), // '已' -- '已' - FONTDATA_ITEM(188, 243, 243, fontpage_188_243_243), // '平' -- '平' - FONTDATA_ITEM(189, 138, 138, fontpage_189_138_138), // '床' -- '床' - FONTDATA_ITEM(189, 166, 166, fontpage_189_166_166), // '度' -- '度' - FONTDATA_ITEM(189, 226, 226, fontpage_189_226_226), // '廢' -- '廢' - FONTDATA_ITEM(189, 250, 250, fontpage_189_250_250), // '建' -- '建' - FONTDATA_ITEM(191, 133, 133, fontpage_191_133_133), // '待' -- '待' - FONTDATA_ITEM(191, 140, 140, fontpage_191_140_140), // '後' -- '後' - FONTDATA_ITEM(191, 145, 145, fontpage_191_145_145), // '徑' -- '徑' - FONTDATA_ITEM(191, 158, 158, fontpage_191_158_158), // '從' -- '從' - FONTDATA_ITEM(191, 169, 169, fontpage_191_169_169), // '復' -- '復' - FONTDATA_ITEM(191, 174, 174, fontpage_191_174_174), // '微' -- '微' - FONTDATA_ITEM(191, 195, 195, fontpage_191_195_195), // '心' -- '心' - FONTDATA_ITEM(192, 167, 167, fontpage_192_167_167), // '性' -- '性' - FONTDATA_ITEM(192, 226, 226, fontpage_192_226_226), // '恢' -- '恢' - FONTDATA_ITEM(192, 239, 239, fontpage_192_239_239), // '息' -- '息' - FONTDATA_ITEM(195, 182, 182, fontpage_195_182_182), // '憶' -- '憶' - FONTDATA_ITEM(195, 201, 201, fontpage_195_201_201), // '應' -- '應' - FONTDATA_ITEM(196, 144, 144, fontpage_196_144_144), // '成' -- '成' - FONTDATA_ITEM(196, 182, 182, fontpage_196_182_182), // '戶' -- '戶' - FONTDATA_ITEM(196, 192, 192, fontpage_196_192_192), // '所' -- '所' - FONTDATA_ITEM(196, 199, 199, fontpage_196_199_199), // '扇' -- '扇' - FONTDATA_ITEM(196, 203, 203, fontpage_196_203_203), // '手' -- '手' - FONTDATA_ITEM(196, 211, 211, fontpage_196_211_211), // '打' -- '打' - FONTDATA_ITEM(196, 231, 231, fontpage_196_231_231), // '执' -- '执' - FONTDATA_ITEM(196, 249, 249, fontpage_196_249_249), // '批' -- '批' - FONTDATA_ITEM(197, 150, 150, fontpage_197_150_150), // '抖' -- '抖' - FONTDATA_ITEM(197, 189, 189, fontpage_197_189_189), // '抽' -- '抽' - FONTDATA_ITEM(197, 212, 212, fontpage_197_212_212), // '拔' -- '拔' - FONTDATA_ITEM(198, 137, 137, fontpage_198_137_137), // '按' -- '按' - FONTDATA_ITEM(199, 137, 137, fontpage_199_137_137), // '掉' -- '掉' - FONTDATA_ITEM(199, 162, 162, fontpage_199_162_162), // '探' -- '探' - FONTDATA_ITEM(199, 167, 167, fontpage_199_167_167), // '控' -- '控' - FONTDATA_ITEM(199, 210, 210, fontpage_199_210_210), // '插' -- '插' - FONTDATA_ITEM(199, 219, 219, fontpage_199_219_219), // '換' -- '換' - FONTDATA_ITEM(201, 199, 199, fontpage_201_199_199), // '擇' -- '擇' - FONTDATA_ITEM(201, 202, 203, fontpage_201_202_203), // '擊' -- '擋' - FONTDATA_ITEM(201, 224, 224, fontpage_201_224_224), // '擠' -- '擠' - FONTDATA_ITEM(202, 190, 190, fontpage_202_190_190), // '放' -- '放' - FONTDATA_ITEM(202, 215, 215, fontpage_202_215_215), // '敗' -- '敗' - FONTDATA_ITEM(202, 244, 244, fontpage_202_244_244), // '整' -- '整' - FONTDATA_ITEM(202, 248, 248, fontpage_202_248_248), // '數' -- '數' - FONTDATA_ITEM(203, 153, 153, fontpage_203_153_153), // '料' -- '料' - FONTDATA_ITEM(203, 156, 156, fontpage_203_156_156), // '斜' -- '斜' - FONTDATA_ITEM(203, 176, 176, fontpage_203_176_176), // '新' -- '新' - FONTDATA_ITEM(203, 188, 188, fontpage_203_188_188), // '於' -- '於' - FONTDATA_ITEM(204, 142, 142, fontpage_204_142_142), // '明' -- '明' - FONTDATA_ITEM(204, 194, 194, fontpage_204_194_194), // '時' -- '時' - FONTDATA_ITEM(205, 171, 171, fontpage_205_171_171), // '暫' -- '暫' - FONTDATA_ITEM(205, 244, 244, fontpage_205_244_244), // '更' -- '更' - FONTDATA_ITEM(206, 128, 128, fontpage_206_128_128), // '最' -- '最' - FONTDATA_ITEM(206, 137, 137, fontpage_206_137_137), // '有' -- '有' - FONTDATA_ITEM(206, 255, 255, fontpage_206_255_255), // '板' -- '板' - FONTDATA_ITEM(207, 241, 241, fontpage_207_241_241), // '柱' -- '柱' - FONTDATA_ITEM(208, 161, 161, fontpage_208_161_161), // '校' -- '校' - FONTDATA_ITEM(208, 188, 188, fontpage_208_188_188), // '格' -- '格' - FONTDATA_ITEM(209, 157, 157, fontpage_209_157_157), // '條' -- '條' - FONTDATA_ITEM(211, 253, 253, fontpage_211_253_253), // '槽' -- '槽' - FONTDATA_ITEM(212, 217, 217, fontpage_212_217_217), // '橙' -- '橙' - FONTDATA_ITEM(212, 223, 223, fontpage_212_223_223), // '機' -- '機' - FONTDATA_ITEM(213, 162, 162, fontpage_213_162_162), // '檢' -- '檢' - FONTDATA_ITEM(214, 226, 226, fontpage_214_226_226), // '止' -- '止' - FONTDATA_ITEM(214, 229, 229, fontpage_214_229_229), // '步' -- '步' - FONTDATA_ITEM(214, 248, 248, fontpage_214_248_248), // '歸' -- '歸' - FONTDATA_ITEM(215, 188, 188, fontpage_215_188_188), // '殼' -- '殼' - FONTDATA_ITEM(215, 212, 212, fontpage_215_212_212), // '比' -- '比' - FONTDATA_ITEM(217, 146, 146, fontpage_217_146_146), // '沒' -- '沒' - FONTDATA_ITEM(218, 187, 187, fontpage_218_187_187), // '活' -- '活' - FONTDATA_ITEM(219, 136, 136, fontpage_219_136_136), // '消' -- '消' - FONTDATA_ITEM(219, 188, 188, fontpage_219_188_188), // '涼' -- '涼' - FONTDATA_ITEM(219, 225, 225, fontpage_219_225_225), // '淡' -- '淡' - FONTDATA_ITEM(220, 133, 133, fontpage_220_133_133), // '清' -- '清' - FONTDATA_ITEM(220, 172, 172, fontpage_220_172_172), // '測' -- '測' - FONTDATA_ITEM(221, 144, 144, fontpage_221_144_144), // '源' -- '源' - FONTDATA_ITEM(221, 150, 150, fontpage_221_150_150), // '準' -- '準' - FONTDATA_ITEM(221, 171, 171, fontpage_221_171_171), // '溫' -- '溫' - FONTDATA_ITEM(223, 192, 192, fontpage_223_192_192), // '激' -- '激' - FONTDATA_ITEM(224, 239, 239, fontpage_224_239_239), // '灯' -- '灯' - FONTDATA_ITEM(226, 161, 161, fontpage_226_161_161), // '無' -- '無' - FONTDATA_ITEM(227, 177, 177, fontpage_227_177_177), // '熱' -- '熱' - FONTDATA_ITEM(227, 200, 200, fontpage_227_200_200), // '燈' -- '燈' - FONTDATA_ITEM(228, 199, 199, fontpage_228_199_199), // '片' -- '片' - FONTDATA_ITEM(231, 135, 135, fontpage_231_135_135), // '率' -- '率' - FONTDATA_ITEM(234, 168, 168, fontpage_234_168_168), // '用' -- '用' - FONTDATA_ITEM(234, 204, 204, fontpage_234_204_204), // '界' -- '界' - FONTDATA_ITEM(236, 253, 253, fontpage_236_253_253), // '白' -- '白' - FONTDATA_ITEM(237, 132, 132, fontpage_237_132_132), // '的' -- '的' - FONTDATA_ITEM(237, 244, 244, fontpage_237_244_244), // '直' -- '直' - FONTDATA_ITEM(238, 129, 129, fontpage_238_129_129), // '省' -- '省' - FONTDATA_ITEM(238, 160, 160, fontpage_238_160_160), // '眠' -- '眠' - FONTDATA_ITEM(240, 141, 141, fontpage_240_141_141), // '砍' -- '砍' - FONTDATA_ITEM(243, 251, 251, fontpage_243_251_251), // '移' -- '移' - FONTDATA_ITEM(244, 205, 205, fontpage_244_205_205), // '積' -- '積' - FONTDATA_ITEM(245, 239, 239, fontpage_245_239_239), // '端' -- '端' - FONTDATA_ITEM(246, 201, 201, fontpage_246_201_201), // '等' -- '等' - FONTDATA_ITEM(247, 161, 161, fontpage_247_161_161), // '管' -- '管' - FONTDATA_ITEM(249, 251, 251, fontpage_249_251_251), // '系' -- '系' - FONTDATA_ITEM(250, 171, 171, fontpage_250_171_171), // '紫' -- '紫' - FONTDATA_ITEM(250, 176, 176, fontpage_250_176_176), // '細' -- '細' - FONTDATA_ITEM(250, 194, 194, fontpage_250_194_194), // '終' -- '終' - FONTDATA_ITEM(250, 241, 242, fontpage_250_241_242), // '統' -- '絲' - FONTDATA_ITEM(251, 178, 178, fontpage_251_178_178), // '網' -- '網' - FONTDATA_ITEM(251, 210, 210, fontpage_251_210_210), // '緒' -- '緒' - FONTDATA_ITEM(251, 218, 218, fontpage_251_218_218), // '線' -- '線' - FONTDATA_ITEM(251, 232, 232, fontpage_251_232_232), // '編' -- '編' - FONTDATA_ITEM(252, 174, 174, fontpage_252_174_174), // '縮' -- '縮' - FONTDATA_ITEM(252, 189, 189, fontpage_252_189_189), // '總' -- '總' - FONTDATA_ITEM(252, 252, 252, fontpage_252_252_252), // '繼' -- '繼' - FONTDATA_ITEM(253, 140, 140, fontpage_253_140_140), // '續' -- '續' - FONTDATA_ITEM(253, 162, 162, fontpage_253_162_162), // '红' -- '红' - FONTDATA_ITEM(253, 255, 255, fontpage_253_255_255), // '绿' -- '绿' - FONTDATA_ITEM(254, 186, 186, fontpage_254_186_186), // '缺' -- '缺' - FONTDATA_ITEM(254, 209, 209, fontpage_254_209_209), // '网' -- '网' - FONTDATA_ITEM(254, 238, 238, fontpage_254_238_238), // '置' -- '置' - FONTDATA_ITEM(254, 242, 242, fontpage_254_242_242), // '署' -- '署' - FONTDATA_ITEM(256, 240, 240, fontpage_256_240_240), // '聰' -- '聰' - FONTDATA_ITEM(259, 234, 234, fontpage_259_234_234), // '自' -- '自' - FONTDATA_ITEM(265, 221, 221, fontpage_265_221_221), // '蓝' -- '蓝' - FONTDATA_ITEM(272, 204, 204, fontpage_272_204_204), // '行' -- '行' - FONTDATA_ITEM(272, 232, 232, fontpage_272_232_232), // '表' -- '表' - FONTDATA_ITEM(273, 171, 171, fontpage_273_171_171), // '被' -- '被' - FONTDATA_ITEM(273, 197, 197, fontpage_273_197_197), // '装' -- '装' - FONTDATA_ITEM(273, 221, 221, fontpage_273_221_221), // '裝' -- '裝' - FONTDATA_ITEM(274, 135, 135, fontpage_274_135_135), // '複' -- '複' - FONTDATA_ITEM(275, 210, 210, fontpage_275_210_210), // '角' -- '角' - FONTDATA_ITEM(276, 136, 136, fontpage_276_136_136), // '計' -- '計' - FONTDATA_ITEM(276, 138, 138, fontpage_276_138_138), // '訊' -- '訊' - FONTDATA_ITEM(276, 152, 152, fontpage_276_152_152), // '記' -- '記' - FONTDATA_ITEM(276, 173, 173, fontpage_276_173_173), // '設' -- '設' - FONTDATA_ITEM(276, 230, 230, fontpage_276_230_230), // '試' -- '試' - FONTDATA_ITEM(277, 164, 164, fontpage_277_164_164), // '誤' -- '誤' - FONTDATA_ITEM(277, 191, 191, fontpage_277_191_191), // '調' -- '調' - FONTDATA_ITEM(277, 203, 203, fontpage_277_203_203), // '請' -- '請' - FONTDATA_ITEM(278, 240, 240, fontpage_278_240_240), // '議' -- '議' - FONTDATA_ITEM(279, 138, 138, fontpage_279_138_138), // '變' -- '變' - FONTDATA_ITEM(281, 199, 199, fontpage_281_199_199), // '資' -- '資' - FONTDATA_ITEM(285, 248, 248, fontpage_285_248_248), // '軸' -- '軸' - FONTDATA_ITEM(286, 137, 137, fontpage_286_137_137), // '載' -- '載' - FONTDATA_ITEM(286, 175, 175, fontpage_286_175_175), // '輯' -- '輯' - FONTDATA_ITEM(286, 184, 184, fontpage_286_184_184), // '輸' -- '輸' - FONTDATA_ITEM(287, 209, 209, fontpage_287_209_209), // '近' -- '近' - FONTDATA_ITEM(287, 212, 212, fontpage_287_212_212), // '返' -- '返' - FONTDATA_ITEM(288, 128, 128, fontpage_288_128_128), // '退' -- '退' - FONTDATA_ITEM(288, 159, 159, fontpage_288_159_159), // '速' -- '速' - FONTDATA_ITEM(288, 178, 178, fontpage_288_178_178), // '進' -- '進' - FONTDATA_ITEM(288, 203, 203, fontpage_288_203_203), // '運' -- '運' - FONTDATA_ITEM(288, 212, 212, fontpage_288_212_212), // '達' -- '達' - FONTDATA_ITEM(288, 248, 248, fontpage_288_248_248), // '選' -- '選' - FONTDATA_ITEM(289, 132, 132, fontpage_289_132_132), // '還' -- '還' - FONTDATA_ITEM(289, 138, 138, fontpage_289_138_138), // '邊' -- '邊' - FONTDATA_ITEM(289, 232, 232, fontpage_289_232_232), // '部' -- '部' - FONTDATA_ITEM(291, 202, 202, fontpage_291_202_202), // '释' -- '释' - FONTDATA_ITEM(291, 205, 205, fontpage_291_205_205), // '重' -- '重' - FONTDATA_ITEM(291, 207, 207, fontpage_291_207_207), // '量' -- '量' - FONTDATA_ITEM(291, 221, 221, fontpage_291_221_221), // '針' -- '針' - FONTDATA_ITEM(292, 149, 149, fontpage_292_149_149), // '鈕' -- '鈕' - FONTDATA_ITEM(294, 175, 175, fontpage_294_175_175), // '錯' -- '錯' - FONTDATA_ITEM(294, 245, 245, fontpage_294_245_245), // '鍵' -- '鍵' - FONTDATA_ITEM(298, 247, 247, fontpage_298_247_247), // '長' -- '長' - FONTDATA_ITEM(299, 137, 137, fontpage_299_137_137), // '閉' -- '閉' - FONTDATA_ITEM(299, 139, 139, fontpage_299_139_139), // '開' -- '開' - FONTDATA_ITEM(299, 147, 147, fontpage_299_147_147), // '間' -- '間' - FONTDATA_ITEM(299, 220, 220, fontpage_299_220_220), // '關' -- '關' - FONTDATA_ITEM(300, 205, 205, fontpage_300_205_205), // '降' -- '降' - FONTDATA_ITEM(300, 228, 228, fontpage_300_228_228), // '除' -- '除' - FONTDATA_ITEM(301, 217, 217, fontpage_301_217_217), // '雙' -- '雙' - FONTDATA_ITEM(301, 251, 251, fontpage_301_251_251), // '電' -- '電' - FONTDATA_ITEM(302, 210, 210, fontpage_302_210_210), // '青' -- '青' - FONTDATA_ITEM(302, 222, 222, fontpage_302_222_222), // '非' -- '非' - FONTDATA_ITEM(302, 226, 226, fontpage_302_226_226), // '面' -- '面' - FONTDATA_ITEM(304, 133, 133, fontpage_304_133_133), // '項' -- '項' - FONTDATA_ITEM(304, 144, 144, fontpage_304_144_144), // '預' -- '預' - FONTDATA_ITEM(304, 205, 205, fontpage_304_205_205), // '額' -- '額' - FONTDATA_ITEM(304, 222, 222, fontpage_304_222_222), // '類' -- '類' - FONTDATA_ITEM(305, 132, 132, fontpage_305_132_132), // '预' -- '预' - FONTDATA_ITEM(305, 168, 168, fontpage_305_168_168), // '風' -- '風' - FONTDATA_ITEM(305, 253, 253, fontpage_305_253_253), // '飽' -- '飽' - FONTDATA_ITEM(307, 172, 172, fontpage_307_172_172), // '馬' -- '馬' - FONTDATA_ITEM(308, 197, 197, fontpage_308_197_197), // '驅' -- '驅' - FONTDATA_ITEM(309, 216, 216, fontpage_309_216_216), // '高' -- '高' - FONTDATA_ITEM(317, 196, 196, fontpage_317_196_196), // '黄' -- '黄' - FONTDATA_ITEM(317, 222, 222, fontpage_317_222_222), // '點' -- '點' - FONTDATA_ITEM(510, 154, 154, fontpage_510_154_154), // ':' -- ':' -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/lcdprint_u8g.cpp deleted file mode 100644 index 0ad5e998ab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lcdprint_u8g.cpp - * @brief LCD print api for u8glib - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2016-08-19 - * @copyright GPL/BSD - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "ultralcd_DOGM.h" - -#include "../ultralcd.h" -#include "../../Marlin.h" - -#include "../fontutils.h" -#include "u8g_fontutf8.h" -#include "../lcdprint.h" - -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); } - -void lcd_put_int(const int i) { u8g.print(i); } - -// return < 0 on error -// return the advanced pixels -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { - if (c < 256) { - u8g.print((char)c); - return u8g_GetFontBBXWidth(u8g.getU8g()); - } - u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), - ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length); - u8g.setPrintPos(x + ret, y); - return ret; -} - -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { - u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), - ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); - u8g.setPrintPos(x + ret, y); - return ret; -} - -int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { - u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), - ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length); - u8g.setPrintPos(x + ret, y); - return ret; -} - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_DOGM.cpp deleted file mode 100644 index 6607c37876..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ /dev/null @@ -1,890 +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 . - * - */ - -// -// status_screen_DOGM.cpp -// Standard Status Screen for Graphical Display -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD && DISABLED(LIGHTWEIGHT_UI) - -#include "dogm_Statusscreen.h" -#include "ultralcd_DOGM.h" -#include "../ultralcd.h" -#include "../lcdprint.h" -#include "../../libs/numtostr.h" - -#include "../../module/motion.h" -#include "../../module/temperature.h" - -#if ENABLED(FILAMENT_LCD_DISPLAY) - #include "../../feature/filwidth.h" - #include "../../module/planner.h" - #include "../../gcode/parser.h" -#endif - -#if HAS_CUTTER - #include "../../feature/spindle_laser.h" -#endif - -#if ENABLED(SDSUPPORT) - #include "../../sd/cardreader.h" -#endif - -#if HAS_PRINT_PROGRESS - #include "../../module/printcounter.h" -#endif - -#if DUAL_MIXING_EXTRUDER - #include "../../feature/mixing.h" -#endif - -#define X_LABEL_POS 3 -#define X_VALUE_POS 11 -#define XYZ_SPACING 37 -#define XYZ_BASELINE (30 + INFO_FONT_ASCENT) -#define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT) -#define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) - -#define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) -#define DO_DRAW_HOTENDS (HOTENDS > 0) -#define DO_DRAW_CUTTER (HAS_CUTTER) -#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 (DO_DRAW_CHAMBER && ENABLED(STATUS_CHAMBER_ANIM)) -#define ANIM_CUTTER (DO_DRAW_CUTTER && ENABLED(STATUS_CUTTER_ANIM)) - -#define ANIM_HBCC (ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER || ANIM_CUTTER) - -#if ANIM_HBCC - enum HeatBits : uint8_t { - HEATBIT_HOTEND, - HEATBIT_BED = HOTENDS, - HEATBIT_CHAMBER, - HEATBIT_CUTTER - }; - IF<(HEATBIT_CUTTER > 7), uint16_t, uint8_t>::type heat_bits; -#endif -#if ANIM_HOTEND - #define HOTEND_ALT(N) TEST(heat_bits, HEATBIT_HOTEND + N) -#else - #define HOTEND_ALT(N) false -#endif -#if ANIM_BED - #define BED_ALT() TEST(heat_bits, HEATBIT_BED) -#else - #define BED_ALT() false -#endif -#if ANIM_CHAMBER - #define CHAMBER_ALT() TEST(heat_bits, HEATBIT_CHAMBER) -#else - #define CHAMBER_ALT() false -#endif -#if ANIM_CUTTER - #define CUTTER_ALT(N) TEST(heat_bits, HEATBIT_CUTTER) -#else - #define CUTTER_ALT() false -#endif - -#if DO_DRAW_HOTENDS - #define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) - #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) -#endif - -#define PROGRESS_BAR_X 54 -#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - -FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) { - const char *str = i16tostr3(temp); - const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; - lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); - lcd_put_wchar(LCD_STR_DEGREE[0]); -} - -#if DO_DRAW_HOTENDS - - // Draw hotend bitmap with current and target temperatures - FORCE_INLINE void _draw_hotend_status(const heater_ind_t heater, const bool blink) { - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif - - const bool isHeat = HOTEND_ALT(heater); - - const uint8_t tx = STATUS_HOTEND_TEXT_X(heater); - - const float temp = thermalManager.degHotend(heater), - target = thermalManager.degTargetHotend(heater); - - #if DISABLED(STATUS_HOTEND_ANIM) - #define STATIC_HOTEND true - #define HOTEND_DOT isHeat - #else - #define STATIC_HOTEND false - #define HOTEND_DOT false - #endif - - #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 - #define OFF_BMP(N) status_hotend##N##_a_bmp - #define ON_BMP(N) status_hotend##N##_b_bmp - #endif - - #if STATUS_HOTEND_BITMAPS > 1 - static const unsigned char* const status_hotend_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, OFF_BMP(1), OFF_BMP(2), OFF_BMP(3), OFF_BMP(4), OFF_BMP(5), OFF_BMP(6)); - #if ANIM_HOTEND - static const unsigned char* const status_hotend_on_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, ON_BMP(1), ON_BMP(2), ON_BMP(3), ON_BMP(4), ON_BMP(5), ON_BMP(6)); - #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr((S) ? &status_hotend_on_gfx[(N) % (STATUS_HOTEND_BITMAPS)] : &status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) - #else - #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr(&status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) - #endif - #elif ANIM_HOTEND - #define HOTEND_BITMAP(N,S) ((S) ? ON_BMP() : OFF_BMP()) - #else - #define HOTEND_BITMAP(N,S) status_hotend_a_bmp - #endif - - if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { - - #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - - const float prop = target - 20, - perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; - uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); - NOMORE(tall, BAR_TALL); - - #if ANIM_HOTEND - // Draw hotend bitmap, either whole or split by the heating percent - 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; - u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(heater, false)); - u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(heater, true) + ph * bw); - } - else - #endif - u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater, isHeat)); - #endif - - // Draw a heating progress bar, if specified - #if DO_DRAW_BED && ENABLED(STATUS_HEAT_PERCENT) - - if (STATIC_HOTEND && isHeat) { - const uint8_t bx = 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; - if (PAGE_OVER(STATUS_HEATERS_Y + ph)) - u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); - } - } - - #endif - - } // PAGE_CONTAINS - - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool dodraw = (blink || !thermalManager.hotend_idle[heater].timed_out); - #else - constexpr bool dodraw = true; - #endif - if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); - } - - if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) - _draw_centered_temp(temp + 0.5f, tx, 28); - - if (STATIC_HOTEND && HOTEND_DOT && PAGE_CONTAINS(17, 19)) { - u8g.setColorIndex(0); // set to white on black - u8g.drawBox(tx, 20 - 3, 2, 2); - u8g.setColorIndex(1); // restore black on white - } - - } - -#endif // DO_DRAW_HOTENDS - -#if DO_DRAW_BED - - // Draw bed bitmap with current and target temperatures - FORCE_INLINE void _draw_bed_status(const bool blink) { - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif - - const bool isHeat = BED_ALT(); - - const uint8_t tx = STATUS_BED_TEXT_X; - - const float temp = thermalManager.degBed(), - target = thermalManager.degTargetBed(); - - #if DO_DRAW_BED && DISABLED(STATUS_BED_ANIM) - #define STATIC_BED true - #define BED_DOT isHeat - #else - #define STATIC_BED false - #define BED_DOT false - #endif - - if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { - - #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - - const float prop = target - 20, - perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; - uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); - NOMORE(tall, BAR_TALL); - - // Draw a heating progress bar, if specified - #if ENABLED(STATUS_HEAT_PERCENT) - - if (isHeat) { - const uint8_t bx = STATUS_BED_X + STATUS_BED_WIDTH; - u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); - if (tall) { - const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; - if (PAGE_OVER(STATUS_HEATERS_Y + ph)) - u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); - } - } - - #endif - - } // PAGE_CONTAINS - - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool dodraw = (blink || !thermalManager.bed_idle.timed_out); - #else - constexpr bool dodraw = true; - #endif - if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); - } - - if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) - _draw_centered_temp(temp + 0.5f, tx, 28); - - if (STATIC_BED && BED_DOT && PAGE_CONTAINS(17, 19)) { - u8g.setColorIndex(0); // set to white on black - u8g.drawBox(tx, 20 - 2, 2, 2); - u8g.setColorIndex(1); // restore black on white - } - - } - -#endif // DO_DRAW_BED - -#if DO_DRAW_CHAMBER - - FORCE_INLINE void _draw_chamber_status() { - #if HAS_HEATED_CHAMBER - if (PAGE_UNDER(7)) - _draw_centered_temp(thermalManager.degTargetChamber() + 0.5f, STATUS_CHAMBER_TEXT_X, 7); - #endif - - if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) - _draw_centered_temp(thermalManager.degChamber() + 0.5f, STATUS_CHAMBER_TEXT_X, 28); - } - -#endif // DO_DRAW_CHAMBER - -// -// Before homing, blink '123' <-> '???'. -// Homed but unknown... '123' <-> ' '. -// Homed and known, display constantly. -// -FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - const AxisEnum a = ( - #if ENABLED(LCD_SHOW_E_TOTAL) - axis == E_AXIS ? X_AXIS : - #endif - axis - ); - const uint8_t offs = (XYZ_SPACING) * a; - lcd_put_wchar(X_LABEL_POS + offs, XYZ_BASELINE, axis_codes[axis]); - lcd_moveto(X_VALUE_POS + offs, XYZ_BASELINE); - if (blink) - lcd_put_u8str(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); - else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_put_u8str(value); - } - } -} - -void MarlinUI::draw_status_screen() { - - static char xstring[5 - #if ENABLED(LCD_SHOW_E_TOTAL) - + 7 - #endif - ], ystring[5], zstring[8]; - #if ENABLED(FILAMENT_LCD_DISPLAY) - static char wstring[5], mstring[4]; - #endif - - #if HAS_PRINT_PROGRESS - #if DISABLED(DOGM_SD_PERCENT) - #define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2) - #else - #define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH)) - #endif - - #if ENABLED(DOGM_SD_PERCENT) - static char progress_string[5]; - #endif - static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF; - static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0; - static char elapsed_string[16]; - #if ENABLED(SHOW_REMAINING_TIME) - static u8g_uint_t estimation_x_pos = 0; - static char estimation_string[10]; - #if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) - static u8g_uint_t progress_x_pos = 0; - static uint8_t progress_state = 0; - static bool prev_blink = 0; - #endif - #endif - #endif - - const bool showxy = (true - #if ENABLED(LCD_SHOW_E_TOTAL) - && !printingIsActive() - #endif - ); - - // At the first page, generate new display values - if (first_page) { - #if ANIM_HBCC - uint8_t new_bits = 0; - #if ANIM_HOTEND - HOTEND_LOOP() if (thermalManager.isHeatingHotend(e)) SBI(new_bits, HEATBIT_HOTEND + e); - #endif - #if ANIM_BED - if (thermalManager.isHeatingBed()) SBI(new_bits, HEATBIT_BED); - #endif - #if DO_DRAW_CHAMBER && HAS_HEATED_CHAMBER - if (thermalManager.isHeatingChamber()) SBI(new_bits, HEATBIT_CHAMBER); - #endif - #if ANIM_CUTTER - if (cutter.enabled()) SBI(new_bits, HEATBIT_CUTTER); - #endif - heat_bits = new_bits; - #endif - - const xyz_pos_t lpos = current_position.asLogical(); - strcpy(zstring, ftostr52sp(lpos.z)); - - if (showxy) { - strcpy(xstring, ftostr4sign(lpos.x)); - strcpy(ystring, ftostr4sign(lpos.y)); - } - else { - #if ENABLED(LCD_SHOW_E_TOTAL) - const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm - sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm - #endif - } - - #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filwidth.measured_mm)); - strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); - #endif - - // Progress / elapsed / estimation updates and string formatting to avoid float math on each LCD draw - #if HAS_PRINT_PROGRESS - const progress_t progress = - #if HAS_PRINT_PROGRESS_PERMYRIAD - get_progress_permyriad() - #else - get_progress_percent() - #endif - ; - duration_t elapsed = print_job_timer.duration(); - const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF; - if (p != lastProgress) { - lastProgress = p; - - progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * progress / (PROGRESS_SCALE) * 0.01f); - - #if ENABLED(DOGM_SD_PERCENT) - if (progress == 0) { - progress_string[0] = '\0'; - #if ENABLED(SHOW_REMAINING_TIME) - estimation_string[0] = '\0'; - estimation_x_pos = _SD_INFO_X(0); - #endif - } - else { - strcpy(progress_string, ( - #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) - permyriadtostr4(progress) - #else - ui8tostr3(progress / (PROGRESS_SCALE)) - #endif - )); - } - #if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode - progress_x_pos = _SD_INFO_X(strlen(progress_string) + 1); - #endif - #endif - } - - if (ev != lastElapsed) { - lastElapsed = ev; - const bool has_days = (elapsed.value >= 60*60*24L); - const uint8_t len = elapsed.toDigital(elapsed_string, has_days); - elapsed_x_pos = _SD_INFO_X(len); - - #if ENABLED(SHOW_REMAINING_TIME) - if (!(ev & 0x3)) { - uint32_t timeval = (0 - #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - + get_remaining_time() - #endif - ); - if (!timeval && progress > 0) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress; - if (!timeval) { - estimation_string[0] = '\0'; - estimation_x_pos = _SD_INFO_X(0); - } - else { - duration_t estimation = timeval; - const bool has_days = (estimation.value >= 60*60*24L); - const uint8_t len = estimation.toDigital(estimation_string, has_days); - estimation_x_pos = _SD_INFO_X(len - #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) - + 1 - #endif - ); - } - } - #endif - } - #endif - } - - const bool blink = get_blink(); - - // Status Menu Font - set_font(FONT_STATUSMENU); - - #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 - - #if STATUS_HEATERS_WIDTH - // Draw all heaters (and maybe the bed) in one go - if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)) - u8g.drawBitmapP(STATUS_HEATERS_X, STATUS_HEATERS_Y, STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT, status_heaters_bmp); - #endif - - #if DO_DRAW_CUTTER - #if ANIM_CUTTER - #define CUTTER_BITMAP(S) ((S) ? status_cutter_on_bmp : status_cutter_bmp) - #else - #define CUTTER_BITMAP(S) status_cutter_bmp - #endif - const uint8_t cuttery = STATUS_CUTTER_Y(CUTTER_ALT()), - cutterh = STATUS_CUTTER_HEIGHT(CUTTER_ALT()); - if (PAGE_CONTAINS(cuttery, cuttery + cutterh - 1)) - u8g.drawBitmapP(STATUS_CUTTER_X, cuttery, STATUS_CUTTER_BYTEWIDTH, cutterh, CUTTER_BITMAP(CUTTER_ALT())); - #endif - - #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()); - if (PAGE_CONTAINS(bedy, bedy + bedh - 1)) - u8g.drawBitmapP(STATUS_BED_X, bedy, STATUS_BED_BYTEWIDTH, bedh, BED_BITMAP(BED_ALT())); - #endif - - #if DO_DRAW_CHAMBER - #if ANIM_CHAMBER - #define CHAMBER_BITMAP(S) ((S) ? status_chamber_on_bmp : status_chamber_bmp) - #else - #define CHAMBER_BITMAP(S) status_chamber_bmp - #endif - 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 - #if STATUS_FAN_FRAMES > 2 - static bool old_blink; - static uint8_t fan_frame; - if (old_blink != blink) { - old_blink = blink; - if (!thermalManager.fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0; - } - #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, - #if STATUS_FAN_FRAMES > 2 - fan_frame == 1 ? status_fan1_bmp : - fan_frame == 2 ? status_fan2_bmp : - #if STATUS_FAN_FRAMES > 3 - fan_frame == 3 ? status_fan3_bmp : - #endif - #elif STATUS_FAN_FRAMES > 1 - blink && thermalManager.fan_speed[0] ? status_fan1_bmp : - #endif - status_fan0_bmp - ); - #endif - - // - // Temperature Graphics and Info - // - if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) { - // Extruders - #if DO_DRAW_HOTENDS - for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) - _draw_hotend_status((heater_ind_t)e, blink); - #endif - - // Laser / Spindle - #if DO_DRAW_CUTTER - if (cutter.power && PAGE_CONTAINS(STATUS_CUTTER_TEXT_Y - INFO_FONT_ASCENT, STATUS_CUTTER_TEXT_Y - 1)) { - lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, i16tostr3(cutter.powerPercent(cutter.power))); - lcd_put_wchar('%'); - } - #endif - - // Heated Bed - #if DO_DRAW_BED - _draw_bed_status(blink); - #endif - - // Heated Chamber - #if DO_DRAW_CHAMBER - _draw_chamber_status(); - #endif - - // Fan, if a bitmap was provided - #if DO_DRAW_FAN - if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y - 1)) { - char c = '%'; - uint16_t spd = thermalManager.fan_speed[0]; - if (spd) { - #if ENABLED(ADAPTIVE_FAN_SLOWING) - if (!blink && thermalManager.fan_speed_scaler[0] < 128) { - spd = thermalManager.scaledFanSpeed(0, spd); - c = '*'; - } - #endif - lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3(thermalManager.fanPercent(spd))); - lcd_put_wchar(c); - } - } - #endif - } - - #if ENABLED(SDSUPPORT) - // - // SD Card Symbol - // - if (card.isFileOpen() && PAGE_CONTAINS(42, 51)) { - // Upper box - u8g.drawBox(42, 42, 8, 7); // 42-48 (or 41-47) - // Right edge - u8g.drawBox(50, 44, 2, 5); // 44-48 (or 43-47) - // Bottom hollow box - u8g.drawFrame(42, 49, 10, 4); // 49-52 (or 48-51) - // Corner pixel - u8g.drawPixel(50, 43); // 43 (or 42) - } - #endif // SDSUPPORT - - #if HAS_PRINT_PROGRESS - // - // Progress bar frame - // - - if (PAGE_CONTAINS(49, 52)) - u8g.drawFrame(PROGRESS_BAR_X, 49, PROGRESS_BAR_WIDTH, 4); - - // - // Progress bar solid part - // - - if (PAGE_CONTAINS(50, 51)) // 50-51 (or just 50) - u8g.drawBox(PROGRESS_BAR_X + 1, 50, progress_bar_solid_width, 2); - - if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { - - #if ALL(DOGM_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) - - if (prev_blink != blink) { - prev_blink = blink; - if (++progress_state >= 3) progress_state = 0; - } - - if (progress_state == 0) { - if (progress_string[0]) { - lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string); - lcd_put_wchar('%'); - } - } - else if (progress_state == 2 && estimation_string[0]) { - lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "R:"); - lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string); - } - else if (elapsed_string[0]) { - lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "E:"); - lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); - } - - #else // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY - - // - // SD Percent Complete - // - - #if ENABLED(DOGM_SD_PERCENT) - if (progress_string[0]) { - lcd_put_u8str(55, 48, progress_string); // Percent complete - lcd_put_wchar('%'); - } - #endif - - // - // Elapsed Time - // - - #if ENABLED(SHOW_REMAINING_TIME) - if (blink && estimation_string[0]) { - lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, 'R'); - lcd_put_u8str(estimation_string); - } - else - #endif - lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); - - #endif // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY - } - - #endif // HAS_PRINT_PROGRESS - - // - // XYZ Coordinates - // - - #if ENABLED(XYZ_HOLLOW_FRAME) - #define XYZ_FRAME_TOP 29 - #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3 - #else - #define XYZ_FRAME_TOP 30 - #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 1 - #endif - - if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { - - #if ENABLED(XYZ_HOLLOW_FRAME) - u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39 - #else - u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37 - #endif - - if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_ASCENT - 1), XYZ_BASELINE)) { - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(0); // white on black - #endif - - #if DUAL_MIXING_EXTRUDER - - // Two-component mix / gradient instead of XY - - char mixer_messages[12]; - const char *mix_label; - #if ENABLED(GRADIENT_MIX) - if (mixer.gradient.enabled) { - mixer.update_mix_from_gradient(); - mix_label = "Gr"; - } - else - #endif - { - mixer.update_mix_from_vtool(); - mix_label = "Mx"; - } - sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); - lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages); - - #else - - if (showxy) { - _draw_axis_value(X_AXIS, xstring, blink); - _draw_axis_value(Y_AXIS, ystring, blink); - } - else { - _draw_axis_value(E_AXIS, xstring, true); - lcd_put_u8str_P(PSTR(" ")); - } - - #endif - - _draw_axis_value(Z_AXIS, zstring, blink); - - #if DISABLED(XYZ_HOLLOW_FRAME) - u8g.setColorIndex(1); // black on white - #endif - } - } - - // - // Feedrate - // - #define EXTRAS_2_BASELINE (EXTRAS_BASELINE + 3) - - if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) { - set_font(FONT_MENU); - lcd_put_wchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]); - - set_font(FONT_STATUSMENU); - lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3(feedrate_percentage)); - lcd_put_wchar('%'); - - // - // Filament sensor display if SD is disabled - // - #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) - lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring); - lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); - lcd_put_wchar('%'); - set_font(FONT_MENU); - lcd_put_wchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); - lcd_put_wchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]); - #endif - } - - // - // Status line - // - if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) { - lcd_moveto(0, STATUS_BASELINE); - - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - // Alternate Status message and Filament display - if (ELAPSED(millis(), next_filament_display)) { - lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); - lcd_put_wchar(':'); - lcd_put_u8str(wstring); - lcd_put_u8str_P(PSTR(" " LCD_STR_FILAM_MUL)); - lcd_put_wchar(':'); - lcd_put_u8str(mstring); - lcd_put_wchar('%'); - } - else - #endif - draw_status_message(blink); - } -} - -void MarlinUI::draw_status_message(const bool blink) { - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(status_message); - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - - static bool last_blink = false; - - if (slen <= LCD_WIDTH) { - // The string fits within the line. Print with no scrolling - lcd_put_u8str(status_message); - while (slen < LCD_WIDTH) { lcd_put_wchar(' '); ++slen; } - } - else { - // String is longer than the available space - - // Get a pointer to the next valid UTF8 character - // and the string remaining length - uint8_t rlen; - const char *stat = status_and_len(rlen); - lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); - - // If the remaining string doesn't completely fill the screen - if (rlen < LCD_WIDTH) { - lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - if (--chars) { // Draw a second dot if there's space - lcd_put_wchar('.'); - if (--chars) { // Print a second copy of the message - lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH - (rlen + 2) * (MENU_FONT_WIDTH)); - lcd_put_wchar(' '); - } - } - } - if (last_blink != blink) { - last_blink = blink; - advance_status_scroll(); - } - } - - #else // !STATUS_MESSAGE_SCROLLING - - UNUSED(blink); - - // Just print the string to the LCD - lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH); - - // Fill the rest with spaces - for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' '); - - #endif // !STATUS_MESSAGE_SCROLLING -} - -#endif // HAS_GRAPHICAL_LCD && !LIGHTWEIGHT_UI diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp deleted file mode 100644 index 439078b51e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ /dev/null @@ -1,941 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -/** - * Implementation of a Status Screen for the RepRapDiscount - * Full Graphics Smart Controller using native ST7920 commands - * instead of U8Glib. - * - * This alternative Status Screen makes use of the built-in character - * generation capabilities of the ST7920 to update the Status Screen - * with less SPI traffic and CPU use. In particular: - * - * - The fan and bed animations are handled using custom characters - * that are stored in CGRAM. This allows for the animation to be - * updated by writing a single character to the text-buffer (DDRAM). - * - * - All the information in the Status Screen is text that is written - * to DDRAM, so the work of generating the bitmaps is offloaded to - * the ST7920 rather than being render by U8Glib on the MCU. - * - * - The graphics buffer (GDRAM) is only used for static graphics - * elements (nozzle and feedrate bitmaps) and for the progress - * bar, so updates are sporadic. - */ - -// -// status_screen_lite_ST7920.cpp -// Lightweight Status Screen for Graphical Display -// - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(LIGHTWEIGHT_UI) - -#include "status_screen_lite_ST7920.h" - -#include "../ultralcd.h" -#include "../fontutils.h" -#include "../lcdprint.h" -#include "../../libs/duration_t.h" -#include "../../module/motion.h" -#include "../../module/printcounter.h" -#include "../../module/temperature.h" - -#if ENABLED(SDSUPPORT) - #include "../../sd/cardreader.h" -#endif - -#if ENABLED(LCD_SHOW_E_TOTAL) - #include "../../Marlin.h" // for printingIsActive -#endif - -#define TEXT_MODE_LCD_WIDTH 16 - -#define BUFFER_WIDTH 256 -#define BUFFER_HEIGHT 32 - -#define DDRAM_LINE_1 0x00 -#define DDRAM_LINE_2 0x10 -#define DDRAM_LINE_3 0x08 -#define DDRAM_LINE_4 0x18 - -ST7920_Lite_Status_Screen::st7920_state_t ST7920_Lite_Status_Screen::current_bits; - -void ST7920_Lite_Status_Screen::cmd(const uint8_t cmd) { - if (!current_bits.synced || !current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = true; - sync_cmd(); - } - write_byte(cmd); -} - -void ST7920_Lite_Status_Screen::begin_data() { - if (!current_bits.synced || current_bits.cmd) { - current_bits.synced = true; - current_bits.cmd = false; - sync_dat(); - } -} - -void ST7920_Lite_Status_Screen::write_str(const char *str) { - while (*str) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str(const char *str, uint8_t len) { - while (*str && len--) write_byte(*str++); -} - -void ST7920_Lite_Status_Screen::write_str_P(PGM_P const str) { - PGM_P p_str = (PGM_P)str; - while (char c = pgm_read_byte(p_str++)) write_byte(c); -} - -void ST7920_Lite_Status_Screen::write_number(const int16_t value, const uint8_t digits/*=3*/) { - char str[7]; - PGM_P fmt; - switch (digits) { - case 6: fmt = PSTR("%6d"); break; - case 5: fmt = PSTR("%5d"); break; - case 4: fmt = PSTR("%4d"); break; - case 3: fmt = PSTR("%3d"); break; - case 2: fmt = PSTR("%2d"); break; - case 1: fmt = PSTR("%1d"); break; - default: return; - } - sprintf_P(str, fmt, value); - write_str(str); -} - -void ST7920_Lite_Status_Screen::display_status(const bool display_on, const bool cursor_on, const bool blink_on) { - extended_function_set(false); - cmd(0b00001000 | - (display_on ? 0b0100 : 0) | - (cursor_on ? 0b0010 : 0) | - (blink_on ? 0b0001 : 0) - ); -} - -// Sets the extended and graphics bits simultaneously, regardless of -// the current state. This is a helper function for extended_function_set() -// and graphics() -void ST7920_Lite_Status_Screen::_extended_function_set(const bool extended, const bool graphics) { - cmd( 0b00100000 | - (extended ? 0b00000100 : 0) | - (graphics ? 0b00000010 : 0) - ); - current_bits.extended = extended; - current_bits.graphics = graphics; -} - -void ST7920_Lite_Status_Screen::extended_function_set(const bool extended) { - if (extended != current_bits.extended) - _extended_function_set(extended, current_bits.graphics); -} - -void ST7920_Lite_Status_Screen::graphics(const bool graphics) { - if (graphics != current_bits.graphics) - _extended_function_set(current_bits.extended, graphics); -} - -void ST7920_Lite_Status_Screen::entry_mode_select(const bool ac_increase, const bool shift) { - extended_function_set(false); - cmd(0b00000100 | - (ac_increase ? 0b00000010 : 0) | - (shift ? 0b00000001 : 0) - ); -} - -// Sets the sa bit regardless of the current state. This is a helper -// function for scroll_or_addr_select() -void ST7920_Lite_Status_Screen::_scroll_or_addr_select(const bool sa) { - extended_function_set(true); - cmd(0b00000010 | (sa ? 0b00000001 : 0)); - current_bits.sa = sa; -} - -void ST7920_Lite_Status_Screen::scroll_or_addr_select(const bool sa) { - if (sa != current_bits.sa) - _scroll_or_addr_select(sa); -} - -void ST7920_Lite_Status_Screen::set_ddram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b10000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_cgram_address(const uint8_t addr) { - extended_function_set(false); - cmd(0b01000000 | (addr & 0b00111111)); -} - -void ST7920_Lite_Status_Screen::set_gdram_address(const uint8_t x, const uint8_t y) { - extended_function_set(true); - cmd(0b10000000 | (y & 0b01111111)); - cmd(0b10000000 | (x & 0b00001111)); -} - -void ST7920_Lite_Status_Screen::clear() { - extended_function_set(false); - cmd(0x00000001); - delay(15); //delay for CGRAM clear -} - -void ST7920_Lite_Status_Screen::home() { - extended_function_set(false); - cmd(0x00000010); -} - -/* This fills the entire text buffer with spaces */ -void ST7920_Lite_Status_Screen::clear_ddram() { - set_ddram_address(DDRAM_LINE_1); - begin_data(); - for (uint8_t i = 64; i--;) write_byte(' '); -} - -/* This fills the entire graphics buffer with zeros */ -void ST7920_Lite_Status_Screen::clear_gdram() { - for (uint8_t y = 0; y < BUFFER_HEIGHT; y++) { - set_gdram_address(0, y); - begin_data(); - for (uint8_t i = (BUFFER_WIDTH) / 16; i--;) write_word(0); - } -} - -void ST7920_Lite_Status_Screen::load_cgram_icon(const uint16_t addr, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - set_cgram_address(addr); - begin_data(); - for (uint8_t i = 16; i--;) - write_word(pgm_read_word(p_word++)); -} - -/** - * Draw an icon in GDRAM. Position specified in DDRAM - * coordinates. i.e., X from 1 to 8, Y from 1 to 4. - */ -void ST7920_Lite_Status_Screen::draw_gdram_icon(uint8_t x, uint8_t y, const void *data) { - const uint16_t *p_word = (const uint16_t *)data; - // Handle display folding - if (y > 1) y -= 2, x += 8; - for (int i = 0; i < 16; i++) { - set_gdram_address(x, i + y * 16); - begin_data(); - write_word(pgm_read_word(p_word++)); - } -} - -/************************** ICON DEFINITIONS *************************************/ - -#define CGRAM_ICON_1_ADDR 0x00 -#define CGRAM_ICON_2_ADDR 0x10 -#define CGRAM_ICON_3_ADDR 0x20 -#define CGRAM_ICON_4_ADDR 0x30 - -#define CGRAM_ICON_1_WORD 0x00 -#define CGRAM_ICON_2_WORD 0x02 -#define CGRAM_ICON_3_WORD 0x04 -#define CGRAM_ICON_4_WORD 0x06 - -const uint8_t degree_symbol_y_top = 1; -PROGMEM const uint8_t degree_symbol[] = { - 0b00110000, - 0b01001000, - 0b01001000, - 0b00110000, -}; - -const uint16_t nozzle_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000111111110000, - 0b0000111111110000, - 0b0001111111111000, - 0b0001111111111000, - 0b0001111111111000, - 0b0000011111100000, - 0b0000001111000000, - 0b0000000110000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t bed_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0111111111111110, - 0b0111111111111110, - 0b0110000000000110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t heat2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0010001000100000, - 0b0010001000100000, - 0b0001000100010000, - 0b0000100010001000, - 0b0000100010001000, - 0b0001000100010000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan1_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110001111000110, - 0b0100001111000010, - 0b0100000110000010, - 0b0101100000011010, - 0b0101110110111010, - 0b0101100000011010, - 0b0100000110000010, - 0b0100001111000010, - 0b0110001111000110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t fan2_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111111111110, - 0b0111000000001110, - 0b0110010000100110, - 0b0100111001110010, - 0b0101111001111010, - 0b0100110000110010, - 0b0100000110000010, - 0b0100110000110010, - 0b0101111001111010, - 0b0100111001110010, - 0b0110010000100110, - 0b0111000000001110, - 0b0111111111111110, - 0b0000000000000000, - 0b0000000000000000 -}; - -const uint16_t feedrate_icon[] PROGMEM = { - 0b0000000000000000, - 0b0111111000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0110000000000000, - 0b0111111011111000, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011001100, - 0b0110000011111000, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000011001100, - 0b0000000000000000, - 0b0000000000000000 -}; - -/************************** MAIN SCREEN *************************************/ - -/** - * The ST7920 has no degree character, so draw it to GDRAM. - * This function takes character position xy - * i.e., x is [0-15], while the y position is [0-3] - */ -void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, const bool draw) { - const uint8_t *p_bytes = degree_symbol; - // Handle display folding - if (y > 1) y -= 2, x += 16; - const bool oddChar = x & 1; - const uint8_t x_word = x >> 1, - y_top = degree_symbol_y_top, - y_bot = y_top + COUNT(degree_symbol); - for (uint8_t i = y_top; i < y_bot; i++) { - uint8_t byte = pgm_read_byte(p_bytes++); - set_gdram_address(x_word, i + y * 16); - begin_data(); - if (draw) { - write_byte(oddChar ? 0x00 : byte); - write_byte(oddChar ? byte : 0x00); - } - else - write_word(0x0000); - } -} - -void ST7920_Lite_Status_Screen::draw_static_elements() { - scroll_or_addr_select(0); - - // Load the animated bed and fan icons - load_cgram_icon(CGRAM_ICON_1_ADDR, heat1_icon); - load_cgram_icon(CGRAM_ICON_2_ADDR, heat2_icon); - load_cgram_icon(CGRAM_ICON_3_ADDR, fan1_icon); - load_cgram_icon(CGRAM_ICON_4_ADDR, fan2_icon); - - // Draw the static icons in GDRAM - draw_gdram_icon(0, 0, nozzle_icon); - #if HOTENDS > 1 - draw_gdram_icon(0, 1, nozzle_icon); - draw_gdram_icon(0, 2, bed_icon); - #else - draw_gdram_icon(0, 1, bed_icon); - #endif - draw_gdram_icon(5, 1, feedrate_icon); - - // Draw the initial fan icon - draw_fan_icon(false); -} - -/** - * Although this is undocumented, the ST7920 allows the character - * data buffer (DDRAM) to be used in conjunction with the graphics - * bitmap buffer (CGRAM). The contents of the graphics buffer is - * XORed with the data from the character generator. This allows - * us to make the progess bar out of graphical data (the bar) and - * text data (the percentage). - */ -void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) { - #if HOTENDS == 1 - // If we have only one extruder, draw a long progress bar on the third line - constexpr uint8_t top = 1, // Top in pixels - bottom = 13, // Bottom in pixels - left = 12, // Left edge, in 16-bit words - width = 4; // Width of progress bar, in 16-bit words - #else - constexpr uint8_t top = 16 + 1, - bottom = 16 + 13, - left = 5, - width = 3; - #endif - const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent? - - // Draw the progress bar as a bitmap in CGRAM - for (uint8_t y = top; y <= bottom; y++) { - set_gdram_address(left, y); - begin_data(); - for (uint8_t x = 0; x < width; x++) { - uint16_t gfx_word = 0x0000; - if ((x + 1) * char_pcnt <= value) - gfx_word = 0xFFFF; // Draw completely filled bytes - else if ((x * char_pcnt) < value) - gfx_word = int(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes - - // Draw the frame around the progress bar - if (y == top || y == bottom) - gfx_word = 0xFFFF; // Draw top/bottom border - else if (x == width - 1) - gfx_word |= 0x0001; // Draw right border - else if (x == 0) - gfx_word |= 0x8000; // Draw left border - write_word(gfx_word); - } - } - - // Draw the percentage as text in DDRAM - #if HOTENDS == 1 - set_ddram_address(DDRAM_LINE_3 + 4); - begin_data(); - write_byte(' '); - #else - set_ddram_address(DDRAM_LINE_2 + left); - begin_data(); - #endif - - // Draw centered - if (value > 9) { - write_number(value, 4); - write_str_P(PSTR("% ")); - } - else { - write_number(value, 3); - write_str_P(PSTR("% ")); - } -} - -void ST7920_Lite_Status_Screen::draw_fan_icon(const bool whichIcon) { - set_ddram_address(DDRAM_LINE_1 + 5); - begin_data(); - write_word(whichIcon ? CGRAM_ICON_3_WORD : CGRAM_ICON_4_WORD); -} - -void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool heating) { - set_ddram_address( - #if HOTENDS == 1 - DDRAM_LINE_2 - #else - DDRAM_LINE_3 - #endif - ); - begin_data(); - if (heating) - write_word(whichIcon ? CGRAM_ICON_1_WORD : CGRAM_ICON_2_WORD); - else { - write_byte(' '); - write_byte(' '); - } -} - -#define FAR(a,b) (((a > b) ? (a-b) : (b-a)) > 2) - -static struct { - bool E1_show_target : 1; - bool E2_show_target : 1; - #if HAS_HEATED_BED - bool bed_show_target : 1; - #endif -} display_state = { - true, true - #if HAS_HEATED_BED - , true - #endif -}; - -void ST7920_Lite_Status_Screen::draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange) { - switch (line) { - case 0: set_ddram_address(DDRAM_LINE_1 + 1); break; - case 1: set_ddram_address(DDRAM_LINE_2 + 1); break; - case 2: set_ddram_address(DDRAM_LINE_3 + 1); break; - case 3: set_ddram_address(DDRAM_LINE_3 + 1); break; - } - begin_data(); - write_number(temp); - - if (showTarget) { - write_byte('\x1A'); - write_number(target); - }; - - if (targetStateChange) { - if (!showTarget) write_str_P(PSTR(" ")); - draw_degree_symbol(5, line, !showTarget); - draw_degree_symbol(9, line, showTarget); - } -} - -void ST7920_Lite_Status_Screen::draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(0, temp, target, show_target, display_state.E1_show_target != show_target || forceUpdate); - display_state.E1_show_target = show_target; -} - -void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(1, temp, target, show_target, display_state.E2_show_target != show_target || forceUpdate); - display_state.E2_show_target = show_target; -} - -#if HAS_HEATED_BED - void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) { - const bool show_target = target && FAR(temp, target); - draw_temps(HOTENDS > 1 ? 2 : 1, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate); - display_state.bed_show_target = show_target; - } -#endif - -void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) { - set_ddram_address(DDRAM_LINE_1 + 6); - begin_data(); - write_number(value, 3); - write_byte('%'); -} - -void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) { - #if HOTENDS == 1 - set_ddram_address(DDRAM_LINE_3); - #else - set_ddram_address(DDRAM_LINE_3 + 5); - #endif - char str[7]; - str[elapsed.toDigital(str)] = ' '; - begin_data(); - write_str(str, 6); -} - -void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) { - // We only have enough room for the feedrate when - // we have one extruder - #if HOTENDS == 1 - set_ddram_address(DDRAM_LINE_2 + 6); - begin_data(); - write_number(percentage, 3); - write_byte('%'); - #else - UNUSED(percentage); - #endif -} - -void ST7920_Lite_Status_Screen::draw_status_message() { - const char *str = ui.status_message; - - set_ddram_address(DDRAM_LINE_4); - begin_data(); - #if ENABLED(STATUS_MESSAGE_SCROLLING) - uint8_t slen = utf8_strlen(str); - - if (slen <= TEXT_MODE_LCD_WIDTH) { - // String fits the LCD, so just print it - write_str(str); - while (slen < TEXT_MODE_LCD_WIDTH) { write_byte(' '); ++slen; } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - // and the string remaining length - uint8_t rlen; - const char *stat = ui.status_and_len(rlen); - write_str(stat, TEXT_MODE_LCD_WIDTH); - - // If the remaining string doesn't completely fill the screen - if (rlen < TEXT_MODE_LCD_WIDTH) { - write_byte('.'); // Always at 1+ spaces left, draw a dot - uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters - if (--chars) { // Draw a second dot if there's space - write_byte('.'); - if (--chars) write_str(str, chars); // Print a second copy of the message - } - } - ui.advance_status_scroll(); - } - - #else - - uint8_t slen = utf8_strlen(str); - write_str(str, TEXT_MODE_LCD_WIDTH); - for (; slen < TEXT_MODE_LCD_WIDTH; ++slen) write_byte(' '); - - #endif -} - -void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool position_known) { - char str[7]; - set_ddram_address(DDRAM_LINE_4); - begin_data(); - - // If position is unknown, flash the labels. - const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); - - if (true - #if ENABLED(LCD_SHOW_E_TOTAL) - && !printingIsActive() - #endif - ) { - write_byte(alt_label ? alt_label : 'X'); - write_str(dtostrf(pos.x, -4, 0, str), 4); - - write_byte(alt_label ? alt_label : 'Y'); - write_str(dtostrf(pos.y, -4, 0, str), 4); - } - else { - #if ENABLED(LCD_SHOW_E_TOTAL) - char tmp[15]; - const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm - sprintf_P(tmp, PSTR("E%-7ld%cm "), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm - write_str(tmp); - #endif - } - - write_byte(alt_label ? alt_label : 'Z'); - write_str(dtostrf(pos.z, -5, 1, str), 5); -} - -bool ST7920_Lite_Status_Screen::indicators_changed() { - // We only add the target temperatures to the checksum - // because the actual temps fluctuate so by updating - // them only during blinks we gain a bit of stability. - const bool blink = ui.get_blink(); - const uint16_t feedrate_perc = feedrate_percentage; - const uint16_t fs = thermalManager.scaledFanSpeed(0); - const int16_t extruder_1_target = thermalManager.degTargetHotend(0); - #if HOTENDS > 1 - const int16_t extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_target = thermalManager.degTargetBed(); - #endif - static uint16_t last_checksum = 0; - const uint16_t checksum = blink ^ feedrate_perc ^ fs ^ extruder_1_target - #if HOTENDS > 1 - ^ extruder_2_target - #endif - #if HAS_HEATED_BED - ^ bed_target - #endif - ; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; -} - -void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { - if (forceUpdate || indicators_changed()) { - const bool blink = ui.get_blink(); - const duration_t elapsed = print_job_timer.duration(); - const uint16_t feedrate_perc = feedrate_percentage; - const int16_t extruder_1_temp = thermalManager.degHotend(0), - extruder_1_target = thermalManager.degTargetHotend(0); - #if HOTENDS > 1 - const int16_t extruder_2_temp = thermalManager.degHotend(1), - extruder_2_target = thermalManager.degTargetHotend(1); - #endif - #if HAS_HEATED_BED - const int16_t bed_temp = thermalManager.degBed(), - bed_target = thermalManager.degTargetBed(); - #endif - - draw_extruder_1_temp(extruder_1_temp, extruder_1_target, forceUpdate); - #if HOTENDS > 1 - draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate); - #endif - #if HAS_HEATED_BED - draw_bed_temp(bed_temp, bed_target, forceUpdate); - #endif - - uint16_t spd = thermalManager.fan_speed[0]; - - #if ENABLED(ADAPTIVE_FAN_SLOWING) - if (!blink && thermalManager.fan_speed_scaler[0] < 128) - spd = thermalManager.scaledFanSpeed(0, spd); - #endif - - draw_fan_speed(thermalManager.fanPercent(spd)); - draw_print_time(elapsed); - draw_feedrate_percentage(feedrate_perc); - - // Update the fan and bed animations - if (spd) draw_fan_icon(blink); - #if HAS_HEATED_BED - draw_heat_icon(bed_target > 0 && blink, bed_target > 0); - #endif - } -} - -bool ST7920_Lite_Status_Screen::position_changed() { - const xyz_pos_t pos = current_position; - const uint8_t checksum = uint8_t(pos.x) ^ uint8_t(pos.y) ^ uint8_t(pos.z); - static uint8_t last_checksum = 0, changed = last_checksum != checksum; - if (changed) last_checksum = checksum; - return changed; -} - -bool ST7920_Lite_Status_Screen::status_changed() { - uint8_t checksum = 0; - for (const char *p = ui.status_message; *p; p++) checksum ^= *p; - static uint8_t last_checksum = 0; - bool changed = last_checksum != checksum; - if (changed) last_checksum = checksum; - return changed; -} - -bool ST7920_Lite_Status_Screen::blink_changed() { - static uint8_t last_blink = 0; - const bool blink = ui.get_blink(), changed = last_blink != blink; - if (changed) last_blink = blink; - return changed; -} - -#ifndef STATUS_EXPIRE_SECONDS - #define STATUS_EXPIRE_SECONDS 20 -#endif - -void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { - - #if STATUS_EXPIRE_SECONDS - static uint8_t countdown = 0; - #endif - - /** - * There's only enough room for either the status message or the position, - * so draw one or the other. When the status message changes, show it for - * a few seconds, then return to the position display once the head moves. - * - * countdown > 1 -- Show status - * countdown = 1 -- Show status, until movement - * countdown = 0 -- Show position - * - * If STATUS_EXPIRE_SECONDS is zero, only the status is shown. - */ - if (forceUpdate || status_changed()) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - ui.status_scroll_offset = 0; - #endif - #if STATUS_EXPIRE_SECONDS - countdown = ui.status_message[0] ? STATUS_EXPIRE_SECONDS : 0; - #endif - draw_status_message(); - blink_changed(); // Clear changed flag - } - #if !STATUS_EXPIRE_SECONDS - #if ENABLED(STATUS_MESSAGE_SCROLLING) - else if (blink_changed()) - draw_status_message(); - #endif - #else - else if (blink_changed()) { - if (countdown > 1) { - countdown--; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(); - #endif - } - else if (countdown > 0) { - if (position_changed()) { - countdown--; - forceUpdate = true; - } - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(); - #endif - } - } - - if (countdown == 0 && (forceUpdate || position_changed() - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - || blink_changed() - #endif - )) { - draw_position(current_position, true - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - && all_axes_known() - #endif - ); - } - #endif -} - -void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { - #if EITHER(LCD_SET_PROGRESS_MANUALLY, SDSUPPORT) - - // Since the progress bar involves writing - // quite a few bytes to GDRAM, only do this - // when an update is actually necessary. - - static uint8_t last_progress = 0; - const uint8_t progress = ui.get_progress_percent(); - if (forceUpdate || last_progress != progress) { - last_progress = progress; - draw_progress_bar(progress); - } - - #else - - UNUSED(forceUpdate); - - #endif // LCD_SET_PROGRESS_MANUALLY || SDSUPPORT -} - -void ST7920_Lite_Status_Screen::update(const bool forceUpdate) { - cs(); - update_indicators(forceUpdate); - update_status_or_position(forceUpdate); - update_progress(forceUpdate); - ncs(); -} - -void ST7920_Lite_Status_Screen::reset_state_from_unknown() { - _extended_function_set(true, true); // Do it twice as only one bit - _extended_function_set(true, true); // get set at a time. - _scroll_or_addr_select(false); -} - -void ST7920_Lite_Status_Screen::on_entry() { - cs(); - reset_state_from_unknown(); - clear(); - clear_gdram(); - draw_static_elements(); - update(true); - ncs(); -} - -void ST7920_Lite_Status_Screen::on_exit() { - cs(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -// This is called prior to the KILL screen to -// clear the screen, preventing a garbled display. -void ST7920_Lite_Status_Screen::clear_text_buffer() { - cs(); - reset_state_from_unknown(); - clear(); - _extended_function_set(true, true); // Restore state to what u8g expects. - ncs(); -} - -void MarlinUI::draw_status_screen() { - ST7920_Lite_Status_Screen::update(false); -} - -// This method is called before each screen update and -// fires on_entry() and on_exit() events upon entering -// or exiting the Status Screen. -void MarlinUI::lcd_in_status(const bool inStatus) { - static bool lastInStatus = false; - if (lastInStatus == inStatus) return; - if ((lastInStatus = inStatus)) - ST7920_Lite_Status_Screen::on_entry(); - else - ST7920_Lite_Status_Screen::on_exit(); -} - -#endif // LIGHTWEIGHT_UI diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h deleted file mode 100644 index bc18c43f10..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ -#pragma once - -#include "../../HAL/shared/HAL_ST7920.h" - -#include "../../core/types.h" -#include "../../core/macros.h" -#include "../../libs/duration_t.h" - -class ST7920_Lite_Status_Screen { - private: - static struct st7920_state_t { - uint8_t synced : 1; // Whether a sync has been sent - uint8_t cmd : 1; // Whether the sync was cmd or data - uint8_t extended : 1; - uint8_t graphics : 1; - uint8_t sa : 1; - } current_bits; - - static void cs() { ST7920_cs(); current_bits.synced = false; } - static void ncs() { ST7920_cs(); current_bits.synced = false; } - static void sync_cmd() { ST7920_set_cmd(); } - static void sync_dat() { ST7920_set_dat(); } - static void write_byte(const uint8_t w) { ST7920_write_byte(w); } - - FORCE_INLINE static void write_word(const uint16_t w) { - write_byte((w >> 8) & 0xFF); - write_byte((w >> 0) & 0xFF); - } - - static void cmd(const uint8_t cmd); - static void begin_data(); - - static void write_str(const char *str); - static void write_str(const char *str, const uint8_t len); - static void write_str_P(PGM_P const str); - static void write_number(const int16_t value, const uint8_t digits=3); - - static void _extended_function_set(const bool extended, const bool graphics); - static void _scroll_or_addr_select(const bool sa); - static void reset_state_from_unknown(); - - static void home(); - static void display_status(const bool display_on, const bool cursor_on, const bool blink_on); - static void extended_function_set(const bool extended); - static void graphics(const bool graphics); - static void entry_mode_select(const bool ac_increase, const bool shift); - static void scroll_or_addr_select(const bool sa); - static void set_ddram_address(const uint8_t addr); - static void set_cgram_address(const uint8_t addr); - static void set_gdram_address(const uint8_t x, const uint8_t y); - - static void clear(); - static void clear_ddram(); - static void clear_gdram(); - - static void load_cgram_icon(const uint16_t addr, const void *data); - static void draw_gdram_icon(uint8_t x, uint8_t y, const void *data); - - static uint8_t string_checksum(const char *str); - - protected: - static void draw_degree_symbol(uint8_t x, uint8_t y, const bool draw); - static void draw_static_elements(); - static void draw_progress_bar(const uint8_t value); - static void draw_fan_icon(const bool whichIcon); - static void draw_heat_icon(const bool whichIcon, const bool heating); - static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange); - static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_fan_speed(const uint8_t value); - 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 xyze_pos_t &pos, bool position_known = true); - - static bool indicators_changed(); - static bool position_changed(); - static bool blink_changed(); - static bool status_changed(); - - static void update_indicators(const bool forceUpdate); - static void update_position(const bool forceUpdate, bool resetChecksum); - static void update_status_or_position(bool forceUpdate); - static void update_progress(const bool forceUpdate); - - public: - static void update(const bool forceUpdate); - static void on_entry(); - static void on_exit(); - static void clear_text_buffer(); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp deleted file mode 100644 index d1d740e235..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ /dev/null @@ -1,303 +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 . - * - */ - -/** - * Based on u8g_dev_ssd1306_128x64.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2015, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * These routines are meant for two wire I2C interfaces. - * - * Three and four wire I2C interfaces have an A0 line. That line is - * used to switch between command and data modes. - * - * The two wire LCDs use an instruction byte to signal if data or - * command info is to follow. The command stream needs the instruction - * byte between eack command byte. The data stream needs one at the - * beginning. - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "HAL_LCD_com_defines.h" - -#define WIDTH 128 -#define HEIGHT 64 -#define PAGE_HEIGHT 8 - -uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_seq); - -// The sh1106 is compatible to the ssd1306, but is 132x64. 128x64 display area is centered within -// the 132x64. - -static const uint8_t u8g_dev_sh1106_128x64_data_start_2_wire[] PROGMEM = { - 0x010, // set upper 4 bit of the col adr to 0 - 0x002, // set lower 4 bit of the col adr to 2 (centered display with ssd1306) - U8G_ESC_END // end of sequence -}; - -#define SH1106_PAGE_ADR(N) (0x20), (N) -#define SH1106_COLUMN_RANGE(N) (0x21), (((N) >> 8) & 0xFF), ((N) & 0xFF) -#define SH1106_PAGE_RANGE(N,O) (0x22), (N), (O) -#define SH1106_SCROLL(N) ((N) ? 0x2F : 0x2E) -#define SH1106_START_LINE(N) (0x40 | (N)) -#define SH1106_CONTRAST(N) (0x81), (N) -#define SH1106_CHARGE_PUMP(N) (0x8D), ((N) ? 0x14 : 0x10) -#define SH1106_ADC_REVERSE(N) ((N) ? 0xA1 : 0xA0) -#define SH1106_ALL_PIX(N) ((N) ? 0xA5 : 0xA4) -#define SH1106_INVERTED(N) ((N) ? 0xA7 : 0xA6) -#define SH1106_MUX_RATIO(N) (0xA8), (N) -#define SH1106_ON(N) ((N) ? 0xAF : 0xAE) -#define SH1106_OUT_MODE(N) ((N) ? 0xC8 : 0xC0) -#define SH1106_DISP_OFFS(N) (0xD3), (N) -#define SH1106_OSC_FREQ(R,F) (0xD5), ((F) << 4 | (R)) -#define SH1106_CHARGE_PER(P,D) (0xD9), ((D) << 4 | (P)) -#define SH1106_COM_CONFIG(N) (0xDA), ((N) ? 0x12 : 0x02) -#define SH1106_VCOM_DESEL(N) (0xDB), (N) -#define SH1106_NOOP() (0xE3) - -static const uint8_t u8g_dev_sh1106_128x64_init_seq_2_wire[] PROGMEM = { - U8G_ESC_ADR(0), // Initiate command mode - SH1106_ON(0), // Display off, sleep mode - SH1106_MUX_RATIO(0x3F), // Mux ratio - SH1106_DISP_OFFS(0), // Display offset - SH1106_START_LINE(0), // Start line - SH1106_ADC_REVERSE(1), // Segment remap A0/A1 - SH1106_OUT_MODE(1), // C0: scan dir normal, C8: reverse - SH1106_COM_CONFIG(1), // Com pin HW config, sequential com pin config (bit 4), disable left/right remap (bit 5) - SH1106_CONTRAST(0xCF), // [2] set contrast control - SH1106_PAGE_ADR(0x02), // 2012-05-27: page addressing mode - SH1106_COLUMN_RANGE(0x281), // Set column range from 0 through 131 - SH1106_PAGE_RANGE(0, 7), // Set page range from 0 through 7 - SH1106_CHARGE_PER(0x1, 0xF), // [2] pre-charge period 0x22/F1 - SH1106_VCOM_DESEL(0x40), // Vcomh deselect level - SH1106_ALL_PIX(0), // Output ram to display - SH1106_INVERTED(0), // Normal display mode - SH1106_OSC_FREQ(0, 8), // Clock divide ratio (0:1) and oscillator frequency (8) - SH1106_CHARGE_PUMP(1), // [2] charge pump setting (P62): 0x14 enable, 0x10 disable - SH1106_SCROLL(0), // 2012-05-27: Deactivate scroll - SH1106_ON(1), // Display on - U8G_ESC_END // End of sequence -}; - -uint8_t u8g_dev_sh1106_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_sh1106_128x64_init_seq_2_wire); - break; - case U8G_DEV_MSG_STOP: - break; - case U8G_DEV_MSG_PAGE_NEXT: { - u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - u8g_SetAddress(u8g, dev, 0); // instruction mode - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_sh1106_128x64_data_start_2_wire); - u8g_WriteByte(u8g, dev, 0x0B0 | (pb->p.page*2)); // 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_SetAddress(u8g, dev, 0); // instruction mode - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_sh1106_128x64_data_start_2_wire); - u8g_WriteByte(u8g, dev, 0x0B0 | (pb->p.page*2+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_SLEEP_ON: - return 1; - case U8G_DEV_MSG_SLEEP_OFF: - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_sh1106_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ; -u8g_pb_t u8g_dev_sh1106_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_sh1106_128x64_2x_i2c_2_wire_buf}; -u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire = { u8g_dev_sh1106_128x64_2x_2_wire_fn, &u8g_dev_sh1106_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL }; - -///////////////////////////////////////////////////////////////////////////////////////////// - -static const uint8_t u8g_dev_ssd1306_128x64_data_start_2_wire[] PROGMEM = { - 0x010, // set upper 4 bit of the col adr to 0 - 0x000, // set lower 4 bit of the col adr to 0 - U8G_ESC_END // end of sequence -}; - -static const uint8_t u8g_dev_ssd1306_128x64_init_seq_2_wire[] PROGMEM = { - U8G_ESC_ADR(0), // initiate command mode - 0x0AE, // display off, sleep mode - 0x0A8, 0x03F, // mux ratio - 0x0D3, 0x00, // display offset - 0x040, // start line - 0x0A1, // segment remap a0/a1 - 0x0C8, // c0: scan dir normal, c8: reverse - 0x0DA, 0x012, // com pin HW config, sequential com pin config (bit 4), disable left/right remap (bit 5) - 0x081, 0x0CF, // [2] set contrast control - 0x020, 0x002, // 2012-05-27: page addressing mode - 0x21, 0, 0x7F, // set column range from 0 through 127 - 0x22, 0, 7, // set page range from 0 through 7 - 0x0D9, 0x0F1, // [2] pre-charge period 0x022/f1 - 0x0DB, 0x040, // vcomh deselect level - 0x0A4, // output ram to display - 0x0A6, // none inverted normal display mode - 0x0D5, 0x080, // clock divide ratio (0x00=1) and oscillator frequency (0x8) - 0x08D, 0x014, // [2] charge pump setting (p62): 0x014 enable, 0x010 disable - 0x02E, // 2012-05-27: Deactivate scroll - 0x0AF, // display on - U8G_ESC_END // end of sequence -}; - -uint8_t u8g_dev_ssd1306_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_ssd1306_128x64_init_seq_2_wire); - break; - case U8G_DEV_MSG_STOP: - break; - case U8G_DEV_MSG_PAGE_NEXT: { - u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - u8g_SetAddress(u8g, dev, 0); // instruction mode - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_ssd1306_128x64_data_start_2_wire); - u8g_WriteByte(u8g, dev, 0x0B0 | (pb->p.page*2)); // 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_SetAddress(u8g, dev, 0); // instruction mode - u8g_WriteEscSeqP_2_wire(u8g, dev, u8g_dev_ssd1306_128x64_data_start_2_wire); - u8g_WriteByte(u8g, dev, 0x0B0 | (pb->p.page*2+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_SLEEP_ON: - return 1; - case U8G_DEV_MSG_SLEEP_OFF: - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - - -uint8_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ; -u8g_pb_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf}; -u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire = { u8g_dev_ssd1306_128x64_2x_2_wire_fn, &u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL }; - - -///////////////////////////////////////////////////////////////////////////////////////////// - -// This routine adds the instruction byte in between the command bytes. This makes the init -// sequences a lot easier to read. - -#define I2C_CMD_MODE 0x080 - -uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_seq) { - uint8_t is_escape = 0; - uint8_t value; - for (;;) { - value = u8g_pgm_read(esc_seq); - if (is_escape == 0) { - if (value != 255) { - if (u8g_WriteByte(u8g, dev, value) == 0 ) - return 0; - if (u8g_WriteByte(u8g, dev, I2C_CMD_MODE) == 0 ) - return 0; - } - else { - is_escape = 1; - } - } - else { - if (value == 255) { - if (u8g_WriteByte(u8g, dev, value) == 0 ) - return 0; - if (u8g_WriteByte(u8g, dev, I2C_CMD_MODE) == 0 ) - return 0; - } - else if (value == 254) { - break; - } - else if (value >= 0x0F0) { - /* not yet used, do nothing */ - } - else if (value >= 0xE0 ) { - u8g_SetAddress(u8g, dev, value & 0x0F); - } - else if (value >= 0xD0) { - u8g_SetChipSelect(u8g, dev, value & 0x0F); - } - else if (value >= 0xC0) { - u8g_SetResetLow(u8g, dev); - value &= 0x0F; - value <<= 4; - value+=2; - u8g_Delay(value); - u8g_SetResetHigh(u8g, dev); - u8g_Delay(value); - } - else if (value >= 0xBE) { /* not yet implemented */ - /* u8g_SetVCC(u8g, dev, value & 0x01); */ - } - else if (value <= 127) { - u8g_Delay(value); - } - is_escape = 0; - } - esc_seq++; - } - return 1; -} - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp deleted file mode 100644 index 8db341293a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ /dev/null @@ -1,236 +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 . - * - */ - -/** - * Based on u8g_dev_st7565_64128n_HAL.c (Displaytech) - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_GRAPHICAL_LCD - -#include -#include "HAL_LCD_com_defines.h" - -#define WIDTH 128 -#define HEIGHT 64 -#define PAGE_HEIGHT 8 - -#define ST7565_ADC_REVERSE(N) ((N) ? 0xA1 : 0xA0) -#define ST7565_BIAS_MODE(N) ((N) ? 0xA3 : 0xA2) -#define ST7565_ALL_PIX(N) ((N) ? 0xA5 : 0xA4) -#define ST7565_INVERTED(N) ((N) ? 0xA7 : 0xA6) -#define ST7565_ON(N) ((N) ? 0xAF : 0xAE) -#define ST7565_OUT_MODE(N) ((N) ? 0xC8 : 0xC0) -#define ST7565_POWER_CONTROL(N) (0x28 | (N)) -#define ST7565_V0_RATIO(N) (0x10 | ((N) & 0x7)) -#define ST7565_V5_RATIO(N) (0x20 | ((N) & 0x7)) -#define ST7565_CONTRAST(N) (0x81), (N) - -#define ST7565_COLUMN_ADR(N) (0x10 | (((N) >> 4) & 0xF)), ((N) & 0xF) -#define ST7565_PAGE_ADR(N) (0xB0 | (N)) -#define ST7565_START_LINE(N) (0x40 | (N)) -#define ST7565_SLEEP_MODE() (0xAC) // ,(N) needed? -#define ST7565_NOOP() (0xE3) - -/* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */ -static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = { - U8G_ESC_CS(0), // disable chip - U8G_ESC_ADR(0), // instruction mode - U8G_ESC_CS(1), // enable chip - U8G_ESC_RST(15), // do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ - - ST7565_BIAS_MODE(0), // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet) - ST7565_ADC_REVERSE(0), // Normal ADC Select (according to Displaytech 64128N datasheet) - - ST7565_OUT_MODE(1), // common output mode: set scan direction - ST7565_START_LINE(0), // Display start line for Displaytech 64128N - - ST7565_POWER_CONTROL(0x4), // power control: turn on voltage converter - U8G_ESC_DLY(50), // delay 50 ms - - ST7565_POWER_CONTROL(0x6), // power control: turn on voltage regulator - U8G_ESC_DLY(50), // delay 50 ms - - ST7565_POWER_CONTROL(0x7), // power control: turn on voltage follower - U8G_ESC_DLY(50), // delay 50 ms - - ST7565_V0_RATIO(0), // Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N - - ST7565_INVERTED(0), // display normal, bit val 0: LCD pixel off. - - ST7565_CONTRAST(0x1E), // Contrast value. Setting for controlling brightness of Displaytech 64128N - - ST7565_ON(1), // display on - - U8G_ESC_DLY(100), // delay 100 ms - ST7565_ALL_PIX(1), // display all points, ST7565 - U8G_ESC_DLY(100), // delay 100 ms - U8G_ESC_DLY(100), // delay 100 ms - ST7565_ALL_PIX(0), // normal display - U8G_ESC_CS(0), // disable chip - U8G_ESC_END // end of sequence -}; - -static const uint8_t u8g_dev_st7565_64128n_HAL_data_start[] PROGMEM = { - U8G_ESC_ADR(0), // instruction mode - U8G_ESC_CS(1), // enable chip - ST7565_COLUMN_ADR(0x00), // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N - U8G_ESC_END // end of sequence -}; - -static const uint8_t u8g_dev_st7565_64128n_HAL_sleep_on[] PROGMEM = { - U8G_ESC_ADR(0), // instruction mode - U8G_ESC_CS(1), // enable chip - ST7565_SLEEP_MODE(), // static indicator off - //0x00, // indicator register set (not sure if this is required) - ST7565_ON(0), // display off - ST7565_ALL_PIX(1), // all points on - U8G_ESC_CS(0), // disable chip, bugfix 12 nov 2014 - U8G_ESC_END // end of sequence - }; - -static const uint8_t u8g_dev_st7565_64128n_HAL_sleep_off[] PROGMEM = { - U8G_ESC_ADR(0), // instruction mode - U8G_ESC_CS(1), // enable chip - ST7565_ALL_PIX(0), // all points off - ST7565_ON(1), // display on - U8G_ESC_DLY(50), // delay 50 ms - U8G_ESC_CS(0), // disable chip, bugfix 12 nov 2014 - U8G_ESC_END // end of sequence -}; - -uint8_t u8g_dev_st7565_64128n_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, const uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_init_seq); - 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_st7565_64128n_HAL_data_start); - u8g_WriteByte(u8g, dev, ST7565_PAGE_ADR(pb->p.page)); /* select current page (ST7565R) */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ - if (!u8g_pb_WriteBuffer(pb, u8g, dev)) return 0; - u8g_SetChipSelect(u8g, dev, 0); - } - break; - case U8G_DEV_MSG_CONTRAST: - u8g_SetChipSelect(u8g, dev, 1); - u8g_SetAddress(u8g, dev, 0); /* instruction mode */ - u8g_WriteByte(u8g, dev, 0x81); - u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2); - u8g_SetChipSelect(u8g, dev, 0); - return 1; - case U8G_DEV_MSG_SLEEP_ON: - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_sleep_on); - return 1; - case U8G_DEV_MSG_SLEEP_OFF: - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_sleep_off); - return 1; - } - return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_st7565_64128n_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, const uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_init_seq); - 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_st7565_64128n_HAL_data_start); - u8g_WriteByte(u8g, dev, ST7565_PAGE_ADR(2 * pb->p.page)); /* select current page (ST7565R) */ - 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_st7565_64128n_HAL_data_start); - u8g_WriteByte(u8g, dev, ST7565_PAGE_ADR(2 * pb->p.page + 1)); /* select current page (ST7565R) */ - 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 */ - u8g_WriteByte(u8g, dev, 0x81); - u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2); - u8g_SetChipSelect(u8g, dev, 0); - return 1; - case U8G_DEV_MSG_SLEEP_ON: - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_sleep_on); - return 1; - case U8G_DEV_MSG_SLEEP_OFF: - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7565_64128n_HAL_sleep_off); - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - -U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_sw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_SW_SPI_FN); - -uint8_t u8g_dev_st7565_64128n_HAL_2x_buf[WIDTH*2] U8G_NOCOMMON ; -u8g_pb_t u8g_dev_st7565_64128n_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_st7565_64128n_HAL_2x_buf}; -u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN }; - - -U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN); -u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN }; - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp deleted file mode 100644 index 1b9a80f9d2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ /dev/null @@ -1,210 +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 . - * - */ - -/** - * Based on u8g_dev_st7920_128x64.c - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "HAL_LCD_com_defines.h" - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 -#define PAGE_HEIGHT 8 - -/* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */ -static const uint8_t u8g_dev_st7920_128x64_HAL_init_seq[] PROGMEM = { - U8G_ESC_CS(0), // disable chip - U8G_ESC_ADR(0), // instruction mode - U8G_ESC_RST(15), // do reset low pulse with (15*16)+2 milliseconds (=maximum delay) - U8G_ESC_DLY(100), // 8 Dez 2012: additional delay 100 ms because of reset - U8G_ESC_CS(1), // enable chip - U8G_ESC_DLY(50), // delay 50 ms - - 0x038, // 8 Bit interface (DL=1), basic instruction set (RE=0) - 0x00C, // display on, cursor & blink off; 0x08: all off - 0x006, // Entry mode: Cursor move to right ,DDRAM address counter (AC) plus 1, no shift - 0x002, // disable scroll, enable CGRAM adress - 0x001, // clear RAM, needs 1.6 ms - U8G_ESC_DLY(100), // delay 100 ms - - U8G_ESC_CS(0), // disable chip - U8G_ESC_END // end of sequence -}; - -void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) { - u8g_SetChipSelect(u8g, dev, 1); - u8g_Delay(1); - u8g_SetAddress(u8g, dev, 0); // cmd mode - u8g_WriteByte(u8g, dev, 0x08); //display off, cursor+blink off - u8g_WriteByte(u8g, dev, 0x3E); //extended mode + GDRAM active - for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM - u8g_WriteByte(u8g, dev, 0x80 | y); //set y - u8g_WriteByte(u8g, dev, 0x80); //set x = 0 - u8g_SetAddress(u8g, dev, 1); /* data mode */ - for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) //2x width clears both segments - u8g_WriteByte(u8g, dev, 0); - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ - } - - u8g_WriteByte(u8g, dev, 0x0C); //display on, cursor+blink off - - u8g_SetChipSelect(u8g, dev, 0); -} - -uint8_t u8g_dev_st7920_128x64_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7920_128x64_HAL_init_seq); - clear_graphics_DRAM(u8g, dev); - break; - case U8G_DEV_MSG_STOP: - break; - case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t y, i; - uint8_t *ptr; - u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ - u8g_SetChipSelect(u8g, dev, 1); - y = pb->p.page_y0; - ptr = (uint8_t *)pb->buf; - for (i = 0; i < 8; i ++) { - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ - u8g_WriteByte(u8g, dev, 0x03E ); /* enable extended mode */ - - if (y < 32) { - u8g_WriteByte(u8g, dev, 0x080 | y ); /* y pos */ - u8g_WriteByte(u8g, dev, 0x080 ); /* set x pos to 0*/ - } - else { - u8g_WriteByte(u8g, dev, 0x080 | (y-32) ); /* y pos */ - u8g_WriteByte(u8g, dev, 0x080 | 8); /* set x pos to 64*/ - } - - u8g_SetAddress(u8g, dev, 1); /* data mode */ - u8g_WriteSequence(u8g, dev, (LCD_PIXEL_WIDTH) / 8, ptr); - ptr += (LCD_PIXEL_WIDTH) / 8; - y++; - } - u8g_SetChipSelect(u8g, dev, 0); - } - break; - } - return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_st7920_128x64_HAL_4x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - case U8G_DEV_MSG_INIT: - u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7920_128x64_HAL_init_seq); - clear_graphics_DRAM(u8g, dev); - break; - - case U8G_DEV_MSG_STOP: - break; - - case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t y, i; - uint8_t *ptr; - u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ - u8g_SetChipSelect(u8g, dev, 1); - y = pb->p.page_y0; - ptr = (uint8_t *)pb->buf; - for (i = 0; i < 32; i ++) { - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ - u8g_WriteByte(u8g, dev, 0x03E ); /* enable extended mode */ - - if (y < 32) { - u8g_WriteByte(u8g, dev, 0x080 | y ); /* y pos */ - u8g_WriteByte(u8g, dev, 0x080 ); /* set x pos to 0*/ - } - else { - u8g_WriteByte(u8g, dev, 0x080 | (y-32) ); /* y pos */ - u8g_WriteByte(u8g, dev, 0x080 | 8); /* set x pos to 64*/ - } - - u8g_SetAddress(u8g, dev, 1); /* data mode */ - u8g_WriteSequence(u8g, dev, (LCD_PIXEL_WIDTH) / 8, ptr); - ptr += (LCD_PIXEL_WIDTH) / 8; - y++; - } - u8g_SetChipSelect(u8g, dev, 0); - } - break; - } - return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg); -} - -U8G_PB_DEV(u8g_dev_st7920_128x64_HAL_sw_spi, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_HAL_fn, U8G_COM_ST7920_HAL_SW_SPI); - -#define QWIDTH ((LCD_PIXEL_WIDTH) * 4) -uint8_t u8g_dev_st7920_128x64_HAL_4x_buf[QWIDTH] U8G_NOCOMMON ; -u8g_pb_t u8g_dev_st7920_128x64_HAL_4x_pb = { { 32, LCD_PIXEL_HEIGHT, 0, 0, 0 }, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_HAL_4x_buf}; -u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI }; - -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 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 }; -#endif - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp deleted file mode 100644 index 8c1dfa3ffe..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ /dev/null @@ -1,553 +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 . - * - */ - -/* - - u8g_dev_tft_320x240_upscale_from_128x64.cpp - - Universal 8bit Graphics Library - - Copyright (c) 2011, olikraus@gmail.com - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include "../../inc/MarlinConfig.h" - -#if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS) - -#include "HAL_LCD_com_defines.h" -#include "ultralcd_DOGM.h" - -#include - -#if ENABLED(LCD_USE_DMA_FSMC) - extern void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); - extern void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length); - extern void LCD_IO_WaitSequence_Async(); - extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); -#endif - -#define WIDTH LCD_PIXEL_WIDTH -#define HEIGHT LCD_PIXEL_HEIGHT -#define PAGE_HEIGHT 8 - -#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) - -#define LCD_COLUMN 0x2A /* Colomn address register */ -#define LCD_ROW 0x2B /* Row address register */ -#define LCD_WRITE_RAM 0x2C - -// see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html - -#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 -#endif -#ifndef TFT_MARLINBG_COLOR - #define TFT_MARLINBG_COLOR COLOR_BLACK -#endif -#ifndef TFT_DISABLED_COLOR - #define TFT_DISABLED_COLOR COLOR_DARK -#endif -#ifndef TFT_BTCANCEL_COLOR - #define TFT_BTCANCEL_COLOR COLOR_RED -#endif -#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; - -#define U8G_ESC_DATA(x) (uint8_t)(x >> 8), (uint8_t)(x & 0xFF) - -static const uint8_t page_first_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(X_LO), U8G_ESC_DATA(X_HI), - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(Y_LO), U8G_ESC_DATA(Y_HI), - U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), - U8G_ESC_END -}; - -static const uint8_t clear_screen_sequence[] = { - 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 -}; - -#if ENABLED(TOUCH_BUTTONS) - - static const uint8_t separation_line_sequence_left[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(10), U8G_ESC_DATA(159), - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(170), U8G_ESC_DATA(173), - U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), - U8G_ESC_END - }; - - static const uint8_t separation_line_sequence_right[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(160), U8G_ESC_DATA(309), - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(170), U8G_ESC_DATA(173), - U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), - U8G_ESC_END - }; - - 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 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 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 - }; - -#endif - -static const uint8_t st7789v_init_sequence[] = { // 0x8552 - ST7789V - U8G_ESC_ADR(0), - 0x10, - U8G_ESC_DLY(10), - 0x01, - U8G_ESC_DLY(100), U8G_ESC_DLY(100), - 0x11, - U8G_ESC_DLY(120), - 0x36, U8G_ESC_ADR(1), 0xA0, - U8G_ESC_ADR(0), 0x3A, U8G_ESC_ADR(1), 0x05, - 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), 0xB2, U8G_ESC_ADR(1), 0x0C, 0x0C, 0x00, 0x33, 0x33, - U8G_ESC_ADR(0), 0xB7, U8G_ESC_ADR(1), 0x35, - U8G_ESC_ADR(0), 0xBB, U8G_ESC_ADR(1), 0x1F, - U8G_ESC_ADR(0), 0xC0, U8G_ESC_ADR(1), 0x2C, - U8G_ESC_ADR(0), 0xC2, U8G_ESC_ADR(1), 0x01, 0xC3, - U8G_ESC_ADR(0), 0xC4, U8G_ESC_ADR(1), 0x20, - U8G_ESC_ADR(0), 0xC6, U8G_ESC_ADR(1), 0x0F, - U8G_ESC_ADR(0), 0xD0, U8G_ESC_ADR(1), 0xA4, 0xA1, - U8G_ESC_ADR(0), 0xE0, U8G_ESC_ADR(1), 0xD0, 0x08, 0x11, 0x08, 0x0C, 0x15, 0x39, 0x33, 0x50, 0x36, 0x13, 0x14, 0x29, 0x2D, - U8G_ESC_ADR(0), 0xE1, U8G_ESC_ADR(1), 0xD0, 0x08, 0x10, 0x08, 0x06, 0x06, 0x39, 0x44, 0x51, 0x0B, 0x16, 0x14, 0x2F, 0x31, - U8G_ESC_ADR(0), 0x29, 0x11, 0x35, U8G_ESC_ADR(1), 0x00, - U8G_ESC_END -}; - -static const uint8_t ili9341_init_sequence[] = { // 0x9341 - ILI9341 - U8G_ESC_ADR(0), - 0x10, - U8G_ESC_DLY(10), - 0x01, - U8G_ESC_DLY(100), U8G_ESC_DLY(100), - 0x36, U8G_ESC_ADR(1), 0xE8, - U8G_ESC_ADR(0), 0x3A, U8G_ESC_ADR(1), 0x55, - 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), 0xC5, U8G_ESC_ADR(1), 0x3E, 0x28, - U8G_ESC_ADR(0), 0xC7, U8G_ESC_ADR(1), 0x86, - U8G_ESC_ADR(0), 0xB1, U8G_ESC_ADR(1), 0x00, 0x18, - U8G_ESC_ADR(0), 0xC0, U8G_ESC_ADR(1), 0x23, - U8G_ESC_ADR(0), 0xC1, U8G_ESC_ADR(1), 0x10, - U8G_ESC_ADR(0), 0x29, - U8G_ESC_ADR(0), 0x11, - U8G_ESC_DLY(100), - U8G_ESC_END -}; - -#if ENABLED(TOUCH_BUTTONS) - - 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, - }; - - #if ENABLED(REVERSE_MENU_DIRECTION) - - 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[128]; - - for (uint16_t i = 0; i < height; i++) { - uint16_t k = 0; - for (uint16_t j = 0; j < length; j++) { - uint16_t v = TFT_MARLINBG_COLOR; - if (*(data + (i * (length >> 3) + (j >> 3))) & (0x80 >> (j & 7))) - v = color; - else - v = TFT_MARLINBG_COLOR; - buffer[k++] = v; buffer[k++] = v; - } - #ifdef LCD_USE_DMA_FSMC - if (k <= 80) { // generally is... for our buttons - memcpy(&buffer[k], &buffer[0], k * sizeof(uint16_t)); - LCD_IO_WriteSequence(buffer, k * sizeof(uint16_t)); - } - else { - LCD_IO_WriteSequence(buffer, k); - LCD_IO_WriteSequence(buffer, k); - } - #else - u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); - u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); - #endif - } - } - -#endif // TOUCH_BUTTONS - -// 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++; } -} - -static bool preinit = true; -static uint8_t page; - -uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - #ifdef LCD_USE_DMA_FSMC - static uint16_t bufferA[512], bufferB[512]; - uint16_t* buffer = &bufferA[0]; - bool allow_async = true; - #else - uint16_t buffer[WIDTH*2]; // 16-bit RGB 565 pixel line buffer - #endif - switch (msg) { - case U8G_DEV_MSG_INIT: - dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id); - if (lcd_id == 0x040404) return 0; // No connected display on FSMC - if (lcd_id == 0xFFFFFF) return 0; // No connected display on SPI - - if ((lcd_id & 0xFFFF) == 0x8552) // ST7789V - u8g_WriteEscSeqP(u8g, dev, st7789v_init_sequence); - if ((lcd_id & 0xFFFF) == 0x9341) // ILI9341 - u8g_WriteEscSeqP(u8g, dev, ili9341_init_sequence); - - if (preinit) { - preinit = false; - 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)); - #else - memset2(buffer, TFT_MARLINBG_COLOR, 160); - for (uint16_t i = 0; i < 960; i++) - u8g_WriteSequence(u8g, dev, 160, (uint8_t *)buffer); - #endif - - // bottom line and buttons - #if ENABLED(TOUCH_BUTTONS) - - #ifdef LCD_USE_DMA_FSMC - u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_left); - LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 300); - u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_right); - LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 300); - #else - memset2(buffer, TFT_DISABLED_COLOR, 150); - u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_left); - for (uint8_t i = 4; i--;) - u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); - u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_right); - for (uint8_t i = 4; i--;) - u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); - #endif - - u8g_WriteEscSeqP(u8g, dev, buttonD_sequence); - drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR); - - u8g_WriteEscSeqP(u8g, dev, buttonA_sequence); - drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_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; - - case U8G_DEV_MSG_STOP: preinit = true; break; - - case U8G_DEV_MSG_PAGE_FIRST: - page = 0; - u8g_WriteEscSeqP(u8g, dev, page_first_sequence); - break; - - case U8G_DEV_MSG_PAGE_NEXT: - if (++page > (HEIGHT / PAGE_HEIGHT)) return 1; - - for (uint8_t y = 0; y < PAGE_HEIGHT; y++) { - uint32_t k = 0; - #ifdef LCD_USE_DMA_FSMC - buffer = (y & 1) ? bufferB : bufferA; - #endif - for (uint16_t i = 0; i < (uint32_t)pb->width; i++) { - const uint8_t b = *(((uint8_t *)pb->buf) + i); - const uint16_t c = TEST(b, y) ? TFT_MARLINUI_COLOR : TFT_MARLINBG_COLOR; - buffer[k++] = c; buffer[k++] = c; - } - #ifdef LCD_USE_DMA_FSMC - memcpy(&buffer[256], &buffer[0], 512); - if (allow_async) { - if (y > 0 || page > 1) LCD_IO_WaitSequence_Async(); - if (y == 7 && page == 8) - LCD_IO_WriteSequence(buffer, 512); // last line of last page - else - LCD_IO_WriteSequence_Async(buffer, 512); - } - else - LCD_IO_WriteSequence(buffer, 512); - #else - uint8_t* bufptr = (uint8_t*) buffer; - for (uint8_t i = 2; i--;) { - 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 - } - break; - - case U8G_DEV_MSG_SLEEP_ON: - // Enter Sleep Mode (10h) - return 1; - case U8G_DEV_MSG_SLEEP_OFF: - // Sleep Out (11h) - return 1; - } - return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); -} - -U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_tft_320x240_upscale_from_128x64_fn, U8G_COM_HAL_FSMC_FN); - -#endif // HAS_GRAPHICAL_LCD && FSMC_CS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp deleted file mode 100644 index 1e12ba84d0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ /dev/null @@ -1,212 +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 . - * - */ - -/** - * Based on u8g_dev_uc1701_mini12864.c (dealextreme) - * - * Universal 8bit Graphics Library - * - * Copyright (c) 2011, olikraus@gmail.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "HAL_LCD_com_defines.h" - -#define WIDTH 128 -#define HEIGHT 64 -#define PAGE_HEIGHT 8 - -#define UC1701_ADC_REVERSE(N) ((N) ? 0xA1 : 0xA0) -#define UC1701_BIAS_MODE(N) ((N) ? 0xA3 : 0xA2) -#define UC1701_ALL_PIX(N) ((N) ? 0xA5 : 0xA4) -#define UC1701_INVERTED(N) ((N) ? 0xA7 : 0xA6) -#define UC1701_ON(N) ((N) ? 0xAF : 0xAE) -#define UC1701_OUT_MODE(N) ((N) ? 0xC8 : 0xC0) -#define UC1701_POWER_CONTROL(N) (0x28 | (N)) -#define UC1701_V5_RATIO(N) (0x20 | ((N) & 0x7)) -#define UC1701_CONTRAST(N) (0x81), (N) - -#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) -#define UC1701_RESET() (0xE2) -#define UC1701_NOOP() (0xE3) -#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 - - 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 - - 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 - #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 - U8G_ESC_END, // end of sequence - U8G_ESC_DLY(5) // delay 5 ms - #else - UC1701_COLUMN_ADR(0), // address 0 - U8G_ESC_END // end of sequence - #endif -}; - -uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - 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); - 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 | pb->p.page); /* select current page */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ - if (!u8g_pb_WriteBuffer(pb, u8g, dev)) return 0; - u8g_SetChipSelect(u8g, dev, 0); - } break; - - case U8G_DEV_MSG_CONTRAST: - u8g_SetChipSelect(u8g, dev, 1); - 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); - return 1; - } - return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); -} - -uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - switch (msg) { - 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); - 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 */ - 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 */ - 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 */ - u8g_WriteByte(u8g, dev, 0x081); - u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2); - u8g_SetChipSelect(u8g, dev, 0); - return 1; - } - return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); -} - -U8G_PB_DEV(u8g_dev_uc1701_mini12864_HAL_sw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_uc1701_mini12864_HAL_fn, U8G_COM_HAL_SW_SPI_FN); -U8G_PB_DEV(u8g_dev_uc1701_mini12864_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_uc1701_mini12864_HAL_fn, U8G_COM_HAL_HW_SPI_FN); - -uint8_t u8g_dev_uc1701_mini12864_HAL_2x_buf[WIDTH*2] U8G_NOCOMMON ; -u8g_pb_t u8g_dev_uc1701_mini12864_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_uc1701_mini12864_HAL_2x_buf}; -u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN }; -u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_hw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN }; - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.cpp deleted file mode 100644 index b976e2777c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/** - * @file u8g_fontutf8.cpp - * @brief font api for u8g lib - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2015-02-19 - * @copyright GPL/BSD - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include -#include "../fontutils.h" -#include "u8g_fontutf8.h" - -typedef void font_t; - -/** - * @brief the callback function to draw something - * - * @param userdata : User's data - * @param msg : the u8g's string - * @param fnt_current : the font - * - * @return 0 on success, 1 to force quit, <0 on error - * - * Get the screen pixel width of a ROM UTF-8 string - */ -typedef int (* fontgroup_cb_draw_t)(void *userdata, const font_t *fnt_current, const char *msg); - -/* return v1 - v2 */ -static int fontinfo_compare(uxg_fontinfo_t * v1, uxg_fontinfo_t * v2) { - if (v1->page < v2->page) return -1; - else if (v1->page > v2->page) return 1; - - if (v1->end < v2->begin) return -1; - else if (v1->begin > v2->end) return 1; - - return 0; -} - -/*"data_list[idx] - *data_pin"*/ -static int pf_bsearch_cb_comp_fntifo_pgm (void *userdata, size_t idx, void *data_pin) { - uxg_fontinfo_t *fntinfo = (uxg_fontinfo_t*)userdata; - uxg_fontinfo_t localval; - memcpy_P(&localval, fntinfo + idx, sizeof(localval)); - return fontinfo_compare(&localval, (uxg_fontinfo_t*)data_pin); -} - -typedef struct _font_group_t { - const uxg_fontinfo_t * m_fntifo; - int m_fntinfo_num; -} font_group_t; - -static int fontgroup_init(font_group_t * root, const uxg_fontinfo_t * fntinfo, int number) { - root->m_fntifo = fntinfo; - root->m_fntinfo_num = number; - return 0; -} - -static const font_t* fontgroup_find(font_group_t * root, wchar_t val) { - uxg_fontinfo_t vcmp = {(uint16_t)(val / 128), (uint8_t)(val % 128 + 128), (uint8_t)(val % 128 + 128), 0, 0}; - size_t idx = 0; - - if (val < 256) return nullptr; - - if (pf_bsearch_r((void*)root->m_fntifo, root->m_fntinfo_num, pf_bsearch_cb_comp_fntifo_pgm, (void*)&vcmp, &idx) < 0) - return nullptr; - - memcpy_P(&vcmp, root->m_fntifo + idx, sizeof(vcmp)); - return vcmp.fntdata; -} - -static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, wchar_t val, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { - uint8_t buf[2] = {0, 0}; - const font_t * fntpqm = (font_t*)fontgroup_find(group, val); - if (!fntpqm) { - // Unknown char, use default font - buf[0] = (uint8_t)(val & 0xFF); - fntpqm = fnt_default; - } - if (fnt_default != fntpqm) { - buf[0] = (uint8_t)(val & 0x7F); - buf[0] |= 0x80; // use upper page to avoid 0x00 error in C. you may want to generate the font data - } - - cb_draw_ram (userdata, fntpqm, (char*) buf); -} - -/** - * @brief try to process a utf8 string - * - * @param pu8g : U8G pointer - * @param fnt_default : the default font - * @param utf8_msg : the UTF-8 string - * @param cb_read_byte : how to read the utf8_msg, from RAM or ROM (call read_byte_ram or pgm_read_byte) - * @param userdata : User's data - * @param cb_draw_ram : the callback function of userdata to draw a !RAM! string (actually it is to draw a one byte string in RAM) - * - * @return N/A - * - * Get the screen pixel width of a ROM UTF-8 string - */ -static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { - uint8_t *p = (uint8_t*)utf8_msg; - for (;;) { - wchar_t val = 0; - p = get_utf8_value_cb(p, cb_read_byte, &val); - if (!val) break; - fontgroup_drawwchar(group, fnt_default, val, userdata, cb_draw_ram); - } -} - -static bool flag_fontgroup_was_inited = false; -static font_group_t g_fontgroup_root = { nullptr, 0 }; - -/** - * @brief check if font is loaded - */ -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; - return fontgroup_init(&g_fontgroup_root, fntinfo, number); -} - -struct _uxg_drawu8_data_t { - u8g_t *pu8g; - unsigned int x; - unsigned int y; - unsigned int adv; - unsigned int max_width; // the max pixel width of the string allowed - const void * fnt_prev; -}; - -static int fontgroup_cb_draw_u8g(void *userdata, const font_t *fnt_current, const char *msg) { - struct _uxg_drawu8_data_t * pdata = (_uxg_drawu8_data_t*)userdata; - - if (pdata->fnt_prev != fnt_current) { - u8g_SetFont(pdata->pu8g, (const u8g_fntpgm_uint8_t*)fnt_current); - //u8g_SetFontPosBottom(pdata->pu8g); - pdata->fnt_prev = fnt_current; - } - if ((pdata->max_width != PIXEL_LEN_NOLIMIT) && (pdata->adv + u8g_GetStrPixelWidth(pdata->pu8g, (char*)msg) > pdata->max_width)) - return 1; - pdata->adv += u8g_DrawStr(pdata->pu8g, pdata->x + pdata->adv, pdata->y, (char*) msg); - return 0; -} - -/** - * @brief Draw a wchar_t at the specified position - * - * @param pu8g : U8G pointer - * @param x : position x axis - * @param y : position y axis - * @param ch : the wchar_t - * @param max_width : the pixel width of the string allowed - * - * @return number of pixels advanced - * - * Draw a UTF-8 string at the specified position - */ -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_width) { - struct _uxg_drawu8_data_t data; - font_group_t *group = &g_fontgroup_root; - const font_t *fnt_default = uxg_GetFont(pu8g); - - if (!uxg_Utf8FontIsInited()) { - u8g_DrawStrP(pu8g, x, y, (const u8g_pgm_uint8_t *)PSTR("Err: utf8 font not initialized.")); - return 0; - } - data.pu8g = pu8g; - data.x = x; - data.y = y; - data.adv = 0; - data.max_width = max_width; - data.fnt_prev = nullptr; - fontgroup_drawwchar(group, fnt_default, ch, (void*)&data, fontgroup_cb_draw_u8g); - u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); - - return data.adv; -} - -/** - * @brief Draw a UTF-8 string at the specified position - * - * @param pu8g : U8G pointer - * @param x : position x axis - * @param y : position y axis - * @param utf8_msg : the UTF-8 string - * @param max_width : the pixel width of the string allowed - * - * @return number of pixels advanced - * - * Draw a UTF-8 string at the specified position - */ -unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_width) { - struct _uxg_drawu8_data_t data; - font_group_t *group = &g_fontgroup_root; - const font_t *fnt_default = uxg_GetFont(pu8g); - - if (!uxg_Utf8FontIsInited()) { - u8g_DrawStrP(pu8g, x, y, (const u8g_pgm_uint8_t *)PSTR("Err: utf8 font not initialized.")); - return 0; - } - data.pu8g = pu8g; - data.x = x; - data.y = y; - data.adv = 0; - data.max_width = max_width; - data.fnt_prev = nullptr; - fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_ram, (void*)&data, fontgroup_cb_draw_u8g); - u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); - - return data.adv; -} - -/** - * @brief Draw a ROM UTF-8 string at the specified position - * - * @param pu8g : U8G pointer - * @param x : position x axis - * @param y : position y axis - * @param utf8_msg : the UTF-8 string - * @param max_width : the pixel width of the string allowed - * - * @return number of pixels advanced - * - * Draw a ROM UTF-8 string at the specified position - */ -unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_width) { - struct _uxg_drawu8_data_t data; - font_group_t *group = &g_fontgroup_root; - const font_t *fnt_default = uxg_GetFont(pu8g); - - if (!uxg_Utf8FontIsInited()) { - u8g_DrawStrP(pu8g, x, y, (const u8g_pgm_uint8_t *)PSTR("Err: utf8 font not initialized.")); - return 0; - } - data.pu8g = pu8g; - data.x = x; - data.y = y; - data.adv = 0; - data.max_width = max_width; - data.fnt_prev = nullptr; - fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_rom, (void*)&data, fontgroup_cb_draw_u8g); - u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); - - return data.adv; -} - -static int fontgroup_cb_draw_u8gstrlen(void *userdata, const font_t *fnt_current, const char *msg) { - struct _uxg_drawu8_data_t * pdata = (_uxg_drawu8_data_t*)userdata; - - if (pdata->fnt_prev != fnt_current) { - u8g_SetFont(pdata->pu8g, (const u8g_fntpgm_uint8_t*)fnt_current); - u8g_SetFontPosBottom(pdata->pu8g); - pdata->fnt_prev = fnt_current; - } - pdata->adv += u8g_GetStrPixelWidth(pdata->pu8g, (char*)msg); - return 0; -} - -/** - * @brief Get the screen pixel width of a UTF-8 string - * - * @param pu8g : U8G pointer - * @param utf8_msg : the UTF-8 string - * - * @return the pixel width - * - * Get the screen pixel width of a UTF-8 string - */ -int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg) { - struct _uxg_drawu8_data_t data; - font_group_t *group = &g_fontgroup_root; - const font_t *fnt_default = uxg_GetFont(pu8g); - - if (!uxg_Utf8FontIsInited()) return -1; - - memset(&data, 0, sizeof(data)); - data.pu8g = pu8g; - data.adv = 0; - fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_ram, (void*)&data, fontgroup_cb_draw_u8gstrlen); - u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); - - return data.adv; -} - -/** - * @brief Get the screen pixel width of a ROM UTF-8 string - * - * @param pu8g : U8G pointer - * @param utf8_msg : the UTF-8 string - * - * @return the pixel width - * - * Get the screen pixel width of a ROM UTF-8 string - */ -int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg) { - struct _uxg_drawu8_data_t data; - font_group_t *group = &g_fontgroup_root; - const font_t *fnt_default = uxg_GetFont(pu8g); - - if (!uxg_Utf8FontIsInited()) return -1; - - memset(&data, 0, sizeof(data)); - data.pu8g = pu8g; - data.adv = 0; - fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_rom, (void*)&data, fontgroup_cb_draw_u8gstrlen); - u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); - return data.adv; -} - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.h deleted file mode 100644 index 34e365cf95..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/u8g_fontutf8.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file fontutf8.h - * @brief font api for u8g lib - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2015-02-19 - * @copyright GPL/BSD - */ -#pragma once - -#include -#include "../fontutils.h" - -// the macro to indicate a UTF-8 string -// You should to save the C/C++ source in UTF-8 encoding! -// Once you change your UTF-8 strings, you need to call the script uxggenpages.sh to create the font data file fontutf8-data.h -#define _UxGT(a) a - -typedef struct _uxg_fontinfo_t { - uint16_t page; - uint8_t begin; - uint8_t end; - uint16_t size; - const u8g_fntpgm_uint8_t *fntdata; -} uxg_fontinfo_t; - -int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM - -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length); - -unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length); -unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length); - -int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg); -int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg); - -#define uxg_GetFont(puxg) ((puxg)->font) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp deleted file mode 100644 index 5c26112b5d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp +++ /dev/null @@ -1,703 +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 . - * - */ - -/** - * 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. - * - * Demonstrator: http://www.reprap.org/wiki/STB_Electronics - * 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 - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GRAPHICAL_LCD - -#include "ultralcd_DOGM.h" -#include "u8g_fontutf8.h" - -#if ENABLED(SHOW_BOOTSCREEN) - #include "dogm_Bootscreen.h" -#endif - -#include "../lcdprint.h" -#include "../fontutils.h" -#include "../../libs/numtostr.h" -#include "../ultralcd.h" - -#include "../../sd/cardreader.h" -#include "../../module/temperature.h" -#include "../../module/printcounter.h" - -#if ENABLED(SDSUPPORT) - #include "../../libs/duration_t.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/bedlevel.h" -#endif - -/** - * Include all needed font files - * (See http://marlinfw.org/docs/development/fonts.html) - */ -#include "fontdata/fontdata_ISO10646_1.h" -#if ENABLED(USE_SMALL_INFOFONT) - #include "fontdata/fontdata_6x9_marlin.h" - #define FONT_STATUSMENU_NAME u8g_font_6x9 -#else - #define FONT_STATUSMENU_NAME MENU_FONT_NAME -#endif - -U8G_CLASS u8g(U8G_PARAM); - -#include LANGUAGE_DATA_INCL(LCD_LANGUAGE) - -#if HAS_LCD_CONTRAST - - int16_t MarlinUI::contrast = DEFAULT_LCD_CONTRAST; - - void MarlinUI::set_contrast(const int16_t value) { - contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(contrast); - } - -#endif - -void MarlinUI::set_font(const MarlinFont font_nr) { - static char currentfont = 0; - if (font_nr != currentfont) { - switch ((currentfont = font_nr)) { - case FONT_STATUSMENU : u8g.setFont(FONT_STATUSMENU_NAME); break; - case FONT_EDIT : u8g.setFont(EDIT_FONT_NAME); break; - default: - case FONT_MENU : u8g.setFont(MENU_FONT_NAME); break; - } - } -} - -bool MarlinUI::detected() { return true; } - -#if ENABLED(SHOW_BOOTSCREEN) - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - // Draws a slice of a particular frame of the custom bootscreen, without the u8g loop - void MarlinUI::draw_custom_bootscreen(const uint8_t frame/*=0*/) { - constexpr u8g_uint_t left = u8g_uint_t((LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2), - top = u8g_uint_t((LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2); - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - constexpr u8g_uint_t right = left + CUSTOM_BOOTSCREEN_BMPWIDTH, - bottom = top + CUSTOM_BOOTSCREEN_BMPHEIGHT; - #endif - - const u8g_pgm_uint8_t * const bmp = - #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) - (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame]) - #else - custom_start_bmp - #endif - ; - - u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp); - - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - if (frame == 0) { - u8g.setColorIndex(1); - if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); - if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); - } - #endif - } - - // Shows the custom bootscreen, with the u8g loop, animations and delays - void MarlinUI::show_custom_bootscreen() { - #if DISABLED(CUSTOM_BOOTSCREEN_ANIMATED) - constexpr millis_t d = 0; - constexpr uint8_t f = 0; - #else - constexpr millis_t d = CUSTOM_BOOTSCREEN_FRAME_TIME; - LOOP_L_N(f, COUNT(custom_bootscreen_animation)) - #endif - { - u8g.firstPage(); - do { draw_custom_bootscreen(f); } while (u8g.nextPage()); - if (d) safe_delay(d); - } - - #ifndef CUSTOM_BOOTSCREEN_TIMEOUT - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #endif - safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); - } - #endif // SHOW_CUSTOM_BOOTSCREEN - - // 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 - 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; - - // Can the text fit to the right of the bitmap? - if (text_max_width < rspace) { - constexpr int8_t inter = (width - text_max_width - (START_BMPWIDTH)) / 3; // Evenly distribute horizontal space - offx = inter; // First the boot logo... - offy = (height - (START_BMPHEIGHT)) / 2; // ...V-aligned in the full height - txt_offx_1 = txt_offx_2 = inter + (START_BMPWIDTH) + inter; // Text right of the bitmap - txt_base = (height + MENU_FONT_ASCENT + text_total_height - (MENU_FONT_HEIGHT)) / 2; // Text vertical center - } - else { - constexpr int8_t inter = (height - text_total_height - (START_BMPHEIGHT)) / 3; // Evenly distribute vertical space - 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 - } - NOLESS(offx, 0); - NOLESS(offy, 0); - - auto _draw_bootscreen_bmp = [&](const uint8_t *bitmap) { - u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap); - set_font(FONT_MENU); - 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) - draw_bootscreen_bmp(start_bmp); - #else - constexpr millis_t d = MARLIN_BOOTSCREEN_FRAME_TIME; - LOOP_L_N(f, COUNT(marlin_bootscreen_animation)) { - draw_bootscreen_bmp((uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f])); - if (d) safe_delay(d); - } - #endif - } - - // Show the Marlin bootscreen, with the u8g loop and delays - void MarlinUI::show_marlin_bootscreen() { - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 2500 - #endif - 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() { - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - show_custom_bootscreen(); - #endif - show_marlin_bootscreen(); - } - -#endif // SHOW_BOOTSCREEN - -#if ENABLED(LIGHTWEIGHT_UI) - #include "status_screen_lite_ST7920.h" -#endif - -// Initialize or re-initialize the LCD -void MarlinUI::init_lcd() { - - #if PIN_EXISTS(LCD_BACKLIGHT) - OUT_WRITE(LCD_BACKLIGHT_PIN, ( - #if ENABLED(DELAYED_BACKLIGHT_INIT) - LOW // Illuminate after reset - #else - HIGH // Illuminate right away - #endif - )); - #endif - - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - SET_OUTPUT(LCD_PINS_DC); - #ifndef LCD_RESET_PIN - #define LCD_RESET_PIN LCD_PINS_RS - #endif - #endif - - #if PIN_EXISTS(LCD_RESET) - // Perform a clean hardware reset with needed delays - OUT_WRITE(LCD_RESET_PIN, LOW); - _delay_ms(5); - WRITE(LCD_RESET_PIN, HIGH); - _delay_ms(5); - u8g.begin(); - #endif - - #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) - WRITE(LCD_BACKLIGHT_PIN, HIGH); - #endif - - #if HAS_LCD_CONTRAST - refresh_contrast(); - #endif - - #if ENABLED(LCD_SCREEN_ROT_90) - u8g.setRot90(); - #elif ENABLED(LCD_SCREEN_ROT_180) - u8g.setRot180(); - #elif ENABLED(LCD_SCREEN_ROT_270) - u8g.setRot270(); - #endif - - uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo)); -} - -// The kill screen is displayed for unrecoverable conditions -void MarlinUI::draw_kill_screen() { - #if ENABLED(LIGHTWEIGHT_UI) - ST7920_Lite_Status_Screen::clear_text_buffer(); - #endif - const u8g_uint_t h4 = u8g.getHeight() / 4; - u8g.firstPage(); - do { - set_font(FONT_MENU); - lcd_put_u8str(0, h4 * 1, status_message); - lcd_put_u8str_P(0, h4 * 2, GET_TEXT(MSG_HALTED)); - lcd_put_u8str_P(0, h4 * 3, GET_TEXT(MSG_PLEASE_RESET)); - } while (u8g.nextPage()); -} - -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) - - void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { - row_y1 = row * (MENU_FONT_HEIGHT) + 1; - row_y2 = row_y1 + MENU_FONT_HEIGHT - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - - lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), row_y2, 'E'); - lcd_put_wchar((char)('1' + extruder)); - lcd_put_wchar(' '); - lcd_put_u8str(i16tostr3(thermalManager.degHotend(extruder))); - lcd_put_wchar('/'); - - if (get_blink() || !thermalManager.hotend_idle[extruder].timed_out) - lcd_put_u8str(i16tostr3(thermalManager.degTargetHotend(extruder))); - } - - #endif // ADVANCED_PAUSE_FEATURE - - // Set the colors for a menu item based on whether it is selected - static bool mark_as_selected(const uint8_t row, const bool sel) { - row_y1 = row * (MENU_FONT_HEIGHT) + 1; - row_y2 = row_y1 + MENU_FONT_HEIGHT - 1; - - if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false; - - if (sel) { - #if ENABLED(MENU_HOLLOW_FRAME) - u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH); - u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH); - #else - u8g.setColorIndex(1); // black on white - u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, MENU_FONT_HEIGHT - 1); - u8g.setColorIndex(0); // white on black - #endif - } - #if DISABLED(MENU_HOLLOW_FRAME) - else { - u8g.setColorIndex(1); // unmarked text is black on white - } - #endif - - if (!PAGE_CONTAINS(row_y1, row_y2)) return false; - - lcd_moveto(0, row_y2); - return true; - } - - // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { - - if (mark_as_selected(row, style & SS_INVERT)) { - - u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - - if ((style & SS_CENTER) && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd_put_wchar(' '); n--; } - } - n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH) * (MENU_FONT_WIDTH); - if (valstr) n -= lcd_put_u8str_max(valstr, n); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - } - } - - // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) { - if (mark_as_selected(row, sel)) { - u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2) * (MENU_FONT_WIDTH); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); - lcd_put_wchar(' '); - } - } - - // Draw a menu item with an editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { - if (mark_as_selected(row, sel)) { - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); - u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH); - if (vallen) { - lcd_put_wchar(':'); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH) * vallen, row_y2); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str((char*)data); - } - } - } - - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { - ui.encoder_direction_normal(); - - const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); - bool extra_row = labellen > LCD_WIDTH - 2 - vallen; - - #if ENABLED(USE_BIG_EDIT_FONT) - // Use the menu font if the label won't fit on a single line - constexpr u8g_uint_t lcd_edit_width = (LCD_PIXEL_WIDTH) / (EDIT_FONT_WIDTH); - u8g_uint_t lcd_chr_fit, one_chr_width; - if (labellen <= lcd_edit_width - 1) { - if (labellen + vallen + 1 > lcd_edit_width) extra_row = true; - lcd_chr_fit = lcd_edit_width + 1; - one_chr_width = EDIT_FONT_WIDTH; - ui.set_font(FONT_EDIT); - } - else { - lcd_chr_fit = LCD_WIDTH; - one_chr_width = MENU_FONT_WIDTH; - ui.set_font(FONT_MENU); - } - #else - constexpr u8g_uint_t lcd_chr_fit = LCD_WIDTH, - one_chr_width = MENU_FONT_WIDTH; - #endif - - // Center the label and value lines on the middle line - u8g_uint_t baseline = extra_row ? (LCD_PIXEL_HEIGHT) / 2 - 1 - : (LCD_PIXEL_HEIGHT + EDIT_FONT_ASCENT) / 2; - - // Assume the label is alpha-numeric (with a descender) - bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT); - if (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex); - - // If a value is included, print a colon, then print the value right-justified - if (value != nullptr) { - lcd_put_wchar(':'); - if (extra_row) { - // Assume that value is numeric (with no descender) - baseline += EDIT_FONT_ASCENT + 2; - onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline); - } - if (onpage) { - lcd_put_wchar(((lcd_chr_fit - 1) - (vallen + 1)) * one_chr_width, baseline, ' '); // Right-justified, padded, add a leading space - lcd_put_u8str(value); - } - } - } - - inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) { - const u8g_uint_t len = utf8_strlen_P(pstr), bw = len * (MENU_FONT_WIDTH), - bx = x * (MENU_FONT_WIDTH), by = (y + 1) * (MENU_FONT_HEIGHT); - if (inv) { - u8g.setColorIndex(1); - u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1); - u8g.setColorIndex(0); - } - lcd_put_u8str_P(bx, by, pstr); - if (inv) u8g.setColorIndex(1); - } - - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(pref, string, suff); - draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); - draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) + 1), LCD_HEIGHT - 1, yes, yesno); - } - - #if ENABLED(SDSUPPORT) - - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { - if (mark_as_selected(row, sel)) { - if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); - constexpr uint8_t maxlen = LCD_WIDTH - 1; - const u8g_uint_t pixw = maxlen * (MENU_FONT_WIDTH); - u8g_uint_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - } - } - - #endif // SDSUPPORT - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * UBL LCD "radar" map data - */ - #define MAP_UPPER_LEFT_CORNER_X 35 // These probably should be moved to the .h file But for now, - #define MAP_UPPER_LEFT_CORNER_Y 8 // it is easier to play with things having them here - #define MAP_MAX_PIXELS_X 53 - #define MAP_MAX_PIXELS_Y 49 - - void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { - // Scale the box pixels appropriately - u8g_uint_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), - y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), - - pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X), - pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y), - - x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2, - y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2; - - // Clear the Mesh Map - - if (PAGE_CONTAINS(y_offset - 2, y_offset + y_map_pixels + 4)) { - u8g.setColorIndex(1); // First draw the bigger box in White so we have a border around the mesh map box - u8g.drawBox(x_offset - 2, y_offset - 2, x_map_pixels + 4, y_map_pixels + 4); - if (PAGE_CONTAINS(y_offset, y_offset + y_map_pixels)) { - u8g.setColorIndex(0); // Now actually clear the mesh map box - u8g.drawBox(x_offset, y_offset, x_map_pixels, y_map_pixels); - } - } - - // Display Mesh Point Locations - - u8g.setColorIndex(1); - const u8g_uint_t sx = x_offset + pixels_per_x_mesh_pnt / 2; - u8g_uint_t y = y_offset + pixels_per_y_mesh_pnt / 2; - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) - if (PAGE_CONTAINS(y, y)) - for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) - u8g.drawBox(x, y, 1, 1); - - // Fill in the Specified Mesh Point - - const uint8_t y_plot_inv = (GRID_MAX_POINTS_Y - 1) - y_plot; // The origin is typically in the lower right corner. We need to - // invert the Y to get it to plot in the right location. - - const u8g_uint_t by = y_offset + y_plot_inv * pixels_per_y_mesh_pnt; - if (PAGE_CONTAINS(by, by + pixels_per_y_mesh_pnt)) - u8g.drawBox( - x_offset + x_plot * pixels_per_x_mesh_pnt, by, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt - ); - - // Put Relevant Text on Display - - // Show X and Y positions at top of screen - u8g.setColorIndex(1); - if (PAGE_UNDER(7)) { - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, - lpos = pos.asLogical(); - lcd_put_u8str(5, 7, "X:"); - lcd_put_u8str(ftostr52(lpos.x)); - lcd_put_u8str(74, 7, "Y:"); - lcd_put_u8str(ftostr52(lpos.y)); - } - - // Print plot position - if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - lcd_put_wchar(5, LCD_PIXEL_HEIGHT, '('); - u8g.print(x_plot); - lcd_put_wchar(','); - u8g.print(y_plot); - lcd_put_wchar(')'); - - // Show the location value - lcd_put_u8str(74, LCD_PIXEL_HEIGHT, "Z:"); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); - else - lcd_put_u8str_P(PSTR(" -----")); - } - - } - - #endif // AUTO_BED_LEVELING_UBL - - #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) - - const unsigned char cw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B11000111,B11000000, - B00000111,B00000001,B11100000, - B00000000,B00000000,B11100000, - B00000000,B00000000,B11110000, - B00000000,B00000000,B01110000, - B00000100,B00000000,B01110000, - B00001110,B00000000,B01110000, - B00011111,B00000000,B01110000, - B00111111,B10000000,B11110000, - B00001110,B00000000,B11100000, - B00001111,B00000001,B11100000, - B00000111,B11000111,B11000000, - B00000011,B11111111,B10000000, - B00000000,B11111110,B00000000 - }; - - const unsigned char ccw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B11000111,B11000000, - B00001111,B00000001,B11100000, - B00001110,B00000000,B11100000, - B00111111,B10000000,B11110000, - B00011111,B00000000,B01110000, - B00001110,B00000000,B01110000, - B00000100,B00000000,B01110000, - B00000000,B00000000,B01110000, - B00000000,B00000000,B11110000, - B00000000,B00000000,B11100000, - B00000111,B00000001,B11100000, - B00000111,B11000111,B11000000, - B00000011,B11111111,B10000000, - B00000000,B11111110,B00000000 - }; - - const unsigned char up_arrow_bmp[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00011111,B00000000, - B00111111,B10000000, - B01111111,B11000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000 - }; - - const unsigned char down_arrow_bmp[] PROGMEM = { - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B00111111,B10000000, - B00011111,B00000000, - B00001110,B00000000, - B00000100,B00000000 - }; - - const unsigned char offset_bedline_bmp[] PROGMEM = { - B11111111,B11111111,B11111111 - }; - - const unsigned char nozzle_bmp[] PROGMEM = { - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B01111111,B10000000, - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B00111111,B00000000, - B00011110,B00000000, - B00001100,B00000000 - }; - - void _lcd_zoffset_overlay_gfx(const float zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } - - #if ENABLED(OVERLAY_GFX_REVERSE) - const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp; - #else - const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp; - #endif - - #if ENABLED(USE_BIG_EDIT_FONT) - const int left = 0, right = 45, nozzle = 95; - #else - const int left = 5, right = 90, nozzle = 60; - #endif - - // Draw a representation of the nozzle - if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); - if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); - - // Draw cw/ccw indicator and up/down arrows. - if (PAGE_CONTAINS(47, 62)) { - u8g.drawBitmapP(right + 0, 48 - dir, 2, 13, up_arrow_bmp); - u8g.drawBitmapP(left + 0, 49 - dir, 2, 13, down_arrow_bmp); - u8g.drawBitmapP(left + 13, 47, 3, 16, rot_down); - u8g.drawBitmapP(right + 13, 47, 3, 16, rot_up); - } - } - - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - -#endif // HAS_LCD_MENU - -#endif // HAS_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.h deleted file mode 100644 index 8ff2dbc85b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ /dev/null @@ -1,256 +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 - -/** - * lcd/dogm/ultralcd_DOGM.h - */ - -#include "../../inc/MarlinConfigPre.h" - -#include -#include "HAL_LCD_class_defines.h" - -//#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) - #define U8G_PARAM LCD_PINS_RS - #else - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS - #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 // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.) - #define U8G_PARAM LCD_PINS_RS - #else - #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) - - // 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) - - #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) - - // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller - - #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) - #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 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 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 FORCE_SOFT_SPI // SW-SPI - - #if ENABLED(ALTERNATIVE_LCD) - #define U8G_CLASS U8GLIB_SH1106_128X64_2X // 4 stripes - #else - #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 - - #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 - #define LCD_PIXEL_WIDTH 128 -#endif -#ifndef LCD_PIXEL_HEIGHT - #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? -#define PAGE_CONTAINS(ya, yb) ((yb) >= u8g.getU8g()->current_page.y0 && (ya) <= u8g.getU8g()->current_page.y1) // Do two vertical regions overlap? - -// Only Western languages support big / small fonts -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT -#endif - -#define MENU_FONT_NAME ISO10646_1_5x7 -#define MENU_FONT_WIDTH 6 -#define MENU_FONT_ASCENT 10 -#define MENU_FONT_DESCENT 2 -#define MENU_FONT_HEIGHT (MENU_FONT_ASCENT + MENU_FONT_DESCENT) - -#if ENABLED(USE_BIG_EDIT_FONT) - #define EDIT_FONT_NAME u8g_font_9x18 - #define EDIT_FONT_WIDTH 9 - #define EDIT_FONT_ASCENT 10 - #define EDIT_FONT_DESCENT 3 -#else - #define EDIT_FONT_NAME MENU_FONT_NAME - #define EDIT_FONT_WIDTH MENU_FONT_WIDTH - #define EDIT_FONT_ASCENT MENU_FONT_ASCENT - #define EDIT_FONT_DESCENT MENU_FONT_DESCENT -#endif -#define EDIT_FONT_HEIGHT (EDIT_FONT_ASCENT + EDIT_FONT_DESCENT) - -// Get the Ascent, Descent, and total Height for the Info Screen font -#if ENABLED(USE_SMALL_INFOFONT) - extern const u8g_fntpgm_uint8_t u8g_font_6x9[]; - #define INFO_FONT_ASCENT 7 -#else - #define INFO_FONT_ASCENT 8 -#endif -#define INFO_FONT_DESCENT 2 -#define INFO_FONT_HEIGHT (INFO_FONT_ASCENT + INFO_FONT_DESCENT) -#define INFO_FONT_WIDTH 6 - -extern U8G_CLASS u8g; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp deleted file mode 100644 index 2187185146..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ /dev/null @@ -1,157 +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 . - * - */ - -// 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) - -#include "ultralcd_st7920_u8glib_rrd_AVR.h" - -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 -#endif - -// Optimize this code with -O3 -#pragma GCC optimize (3) - - -#ifdef ARDUINO_ARCH_STM32F1 - #define ST7920_DAT(V) !!((V) & 0x80) -#else - #define ST7920_DAT(V) ((V) & 0x80) -#endif -#define ST7920_SND_BIT do{ \ - WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ - WRITE(ST7920_DAT_PIN, ST7920_DAT(val)); ST7920_DELAY_2; \ - WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ - val <<= 1; }while(0) - -// Optimize this code with -O3 -#pragma GCC optimize (3) - -void ST7920_SWSPI_SND_8BIT(uint8_t val) { - ST7920_SND_BIT; // 1 - ST7920_SND_BIT; // 2 - ST7920_SND_BIT; // 3 - ST7920_SND_BIT; // 4 - ST7920_SND_BIT; // 5 - ST7920_SND_BIT; // 6 - ST7920_SND_BIT; // 7 - ST7920_SND_BIT; // 8 -} - -uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { - uint8_t i, y; - switch (msg) { - case U8G_DEV_MSG_INIT: { - OUT_WRITE(ST7920_CS_PIN, LOW); - OUT_WRITE(ST7920_DAT_PIN, LOW); - OUT_WRITE(ST7920_CLK_PIN, HIGH); - - ST7920_CS(); - u8g_Delay(120); // Initial delay for boot up - ST7920_SET_CMD(); - ST7920_WRITE_BYTE(0x20); // Non-extended mode - ST7920_WRITE_BYTE(0x08); // Display off, cursor+blink off - ST7920_WRITE_BYTE(0x01); // Clear DDRAM ram - u8g_Delay(15); // Delay for DDRAM clear - ST7920_WRITE_BYTE(0x24); // Extended mode - ST7920_WRITE_BYTE(0x26); // Extended mode + GDRAM active - for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { // Clear GDRAM - ST7920_WRITE_BYTE(0x80 | y); // Set y - ST7920_WRITE_BYTE(0x80); // Set x = 0 - ST7920_SET_DAT(); - for (i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) // 2x width clears both segments - ST7920_WRITE_BYTE(0); - ST7920_SET_CMD(); - } - ST7920_WRITE_BYTE(0x0C); // Display on, cursor+blink off - ST7920_NCS(); - } - break; - - case U8G_DEV_MSG_STOP: break; - - case U8G_DEV_MSG_PAGE_NEXT: { - uint8_t* ptr; - u8g_pb_t* pb = (u8g_pb_t*)(dev->dev_mem); - y = pb->p.page_y0; - ptr = (uint8_t*)pb->buf; - - ST7920_CS(); - for (i = 0; i < PAGE_HEIGHT; i ++) { - ST7920_SET_CMD(); - if (y < 32) { - ST7920_WRITE_BYTE(0x80 | y); // y - ST7920_WRITE_BYTE(0x80); // x = 0 - } - else { - ST7920_WRITE_BYTE(0x80 | (y - 32)); // y - ST7920_WRITE_BYTE(0x80 | 8); // x = 64 - } - ST7920_SET_DAT(); - ST7920_WRITE_BYTES(ptr, (LCD_PIXEL_WIDTH) / 8); // ptr incremented inside of macro! - y++; - } - ST7920_NCS(); - } - break; - } - #if PAGE_HEIGHT == 8 - return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg); - #elif PAGE_HEIGHT == 16 - return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg); - #else - return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg); - #endif -} - -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 }; - -#pragma GCC reset_options - -#if ENABLED(LIGHTWEIGHT_UI) - #include "../../HAL/shared/HAL_ST7920.h" - void ST7920_cs() { ST7920_CS(); } - void ST7920_ncs() { ST7920_NCS(); } - void ST7920_set_cmd() { ST7920_SET_CMD(); } - void ST7920_set_dat() { ST7920_SET_DAT(); } - void ST7920_write_byte(const uint8_t val) { ST7920_WRITE_BYTE(val); } -#endif - -#endif // U8GLIB_ST7920 -#endif // __AVR__ && !U8G_HAL_LINKS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h deleted file mode 100644 index 858cbe8824..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ /dev/null @@ -1,93 +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 - -// 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/MarlinConfig.h" -#include "../../HAL/shared/Delay.h" - -#define ST7920_CLK_PIN LCD_PINS_D4 -#define ST7920_DAT_PIN LCD_PINS_ENABLE -#define ST7920_CS_PIN LCD_PINS_RS - -//#define PAGE_HEIGHT 8 //128 byte framebuffer -#define PAGE_HEIGHT 16 //256 byte framebuffer -//#define PAGE_HEIGHT 32 //512 byte framebuffer - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 - -#include - -// If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) - -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG, K8200, K8400, SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif defined(ARDUINO_ARCH_STM32) - #define CPU_ST7920_DELAY_1 DELAY_NS(300) - #define CPU_ST7920_DELAY_2 DELAY_NS(40) - #define CPU_ST7920_DELAY_3 DELAY_NS(340) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" -#endif - -void ST7920_SWSPI_SND_8BIT(uint8_t val); - -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() DELAY_US(10) -#endif - -#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } -#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } -#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } -#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(); } diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp deleted file mode 100644 index c669294125..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp +++ /dev/null @@ -1,1094 +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 . - * - */ - -/* DGUS implementation written by coldtobi in 2019 for Marlin */ - -#include "../../../../inc/MarlinConfigPre.h" - -#if ENABLED(DGUS_LCD) - -#include "DGUSDisplay.h" -#include "DGUSVPVariable.h" -#include "DGUSDisplayDefinition.h" - -#include "../../ui_api.h" - -#include "../../../../Marlin.h" -#include "../../../../module/temperature.h" -#include "../../../../module/motion.h" -#include "../../../../gcode/queue.h" -#include "../../../../module/planner.h" -#include "../../../../sd/cardreader.h" -#include "../../../../libs/duration_t.h" -#include "../../../../module/printcounter.h" - -// Preamble... 2 Bytes, usually 0x5A 0xA5, but configurable -constexpr uint8_t DGUS_HEADER1 = 0x5A; -constexpr uint8_t DGUS_HEADER2 = 0xA5; - -constexpr uint8_t DGUS_CMD_WRITEVAR = 0x82; -constexpr uint8_t DGUS_CMD_READVAR = 0x83; - -#if ENABLED(DEBUG_DGUSLCD) - bool dguslcd_local_debug; // = false; -#endif - -uint16_t DGUSScreenVariableHandler::ConfirmVP; - -#if ENABLED(SDSUPPORT) - int16_t DGUSScreenVariableHandler::top_file = 0; - int16_t DGUSScreenVariableHandler::file_to_print = 0; - static ExtUI::FileList filelist; -#endif - -void (*DGUSScreenVariableHandler::confirm_action_cb)() = nullptr; - -//DGUSScreenVariableHandler ScreenHandler; - -DGUSLCD_Screens DGUSScreenVariableHandler::current_screen; -DGUSLCD_Screens DGUSScreenVariableHandler::past_screens[NUM_PAST_SCREENS]; -uint8_t DGUSScreenVariableHandler::update_ptr; -uint16_t DGUSScreenVariableHandler::skipVP; -bool DGUSScreenVariableHandler::ScreenComplete; - -//DGUSDisplay dgusdisplay; - -rx_datagram_state_t DGUSDisplay::rx_datagram_state = DGUS_IDLE; -uint8_t DGUSDisplay::rx_datagram_len = 0; -bool DGUSDisplay::Initialized = false; -bool DGUSDisplay::no_reentrance = false; - -#if DGUS_RX_BUFFER_SIZE > 256 - typedef uint16_t r_ring_buffer_pos_t; -#else - typedef uint8_t r_ring_buffer_pos_t; -#endif - -#if DGUS_TX_BUFFER_SIZE > 256 - typedef uint16_t t_ring_buffer_pos_t; -#else - typedef uint8_t t_ring_buffer_pos_t; -#endif - -class DGUSSerial { -public: - DGUSSerial(); - ~DGUSSerial(); - - r_ring_buffer_pos_t available(); - t_ring_buffer_pos_t GetTxBufferFree(); - void write(const uint8_t c); - - int read(); - - // ISR for Rx - void store_rxd_char(); - // ISR for Tx (UDRE vector) - void tx_udr_empty_irq(); - - inline volatile bool is_rx_overrun() { - return dgus_rx_overrun; - } - - inline void reset_rx_overun() { - dgus_rx_overrun = false; - } - -private: - r_ring_buffer_pos_t atomic_read_rx_head(); - void atomic_set_rx_tail(r_ring_buffer_pos_t value); - r_ring_buffer_pos_t atomic_read_rx_tail(); - - volatile bool dgus_rx_overrun = false; - - struct ring_buffer_r { - volatile r_ring_buffer_pos_t head, tail; - unsigned char buffer[DGUS_RX_BUFFER_SIZE]; - } rx_buffer = { 0, 0, { 0 } }; - - struct ring_buffer_t { - volatile t_ring_buffer_pos_t head, tail; - unsigned char buffer[DGUS_TX_BUFFER_SIZE]; - } tx_buffer = { 0, 0, { 0 } }; - - #if DGUS_RX_BUFFER_SIZE > 256 - volatile bool rx_tail_value_not_stable = false; - volatile uint16_t rx_tail_value_backup = 0; - #endif - -}; - -static DGUSSerial dgusserial; - -// endianness swap -uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); } - -bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) { - // DEBUG_ECHOPAIR("populate_VPVar ", VP); - const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP); - // DEBUG_ECHOLNPAIR(" pvp ", (uint16_t )pvp); - if (!pvp) return false; - memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable)); - return true; -} - -void DGUSScreenVariableHandler::sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { - DGUS_VP_Variable ramcopy; - if (populate_VPVar(VP_MSGSTR1, &ramcopy)) { - ramcopy.memadr = (void*) line1; - l1inflash ? DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay(ramcopy); - } - if (populate_VPVar(VP_MSGSTR2, &ramcopy)) { - ramcopy.memadr = (void*) line2; - l2inflash ? DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay(ramcopy); - } - if (populate_VPVar(VP_MSGSTR3, &ramcopy)) { - ramcopy.memadr = (void*) line3; - l3inflash ? DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay(ramcopy); - } - if (populate_VPVar(VP_MSGSTR4, &ramcopy)) { - ramcopy.memadr = (void*) line4; - l4inflash ? DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay(ramcopy); - } -} - -void DGUSScreenVariableHandler::HandleUserConfirmationPopUp(uint16_t VP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1, bool l2, bool l3, bool l4) { - if (current_screen == DGUSLCD_SCREEN_CONFIRM) { - // Already showing a pop up, so we need to cancel that first. - PopToOldScreen(); - } - - ConfirmVP = VP; - sendinfoscreen(line1, line2, line3, line4, l1, l2, l3, l4); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_CONFIRM); -} - -void DGUSScreenVariableHandler::setstatusmessage(const char *msg) { - DGUS_VP_Variable ramcopy; - if (populate_VPVar(VP_M117, &ramcopy)) { - ramcopy.memadr = (void*) msg; - DGUSLCD_SendStringToDisplay(ramcopy); - } -} - -void DGUSScreenVariableHandler::setstatusmessagePGM(PGM_P const msg) { - DGUS_VP_Variable ramcopy; - if (populate_VPVar(VP_M117, &ramcopy)) { - ramcopy.memadr = (void*) msg; - DGUSLCD_SendStringToDisplayPGM(ramcopy); - } -} - -// Send an 8 bit or 16 bit value to the display. -void DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP); - //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr); - uint8_t *tmp = (uint8_t *) var.memadr; - uint16_t data_to_send = (tmp[0] << 8); - if (var.size >= 1) data_to_send |= tmp[1]; - dgusdisplay.WriteVariable(var.VP, data_to_send); - } -} - -// Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100) -void DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP); - //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr); - uint16_t tmp = *(uint8_t *) var.memadr +1 ; // +1 -> avoid rounding issues for the display. - tmp = map(tmp, 0, 255, 0, 100); - uint16_t data_to_send = swap16(tmp); - dgusdisplay.WriteVariable(var.VP, data_to_send); - } -} - -// Send the current print time to the display. -// It is using a hex display for that: It expects BSD coded data in the format xxyyzz -void DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) { - duration_t elapsed = print_job_timer.duration(); - - uint8_t days = elapsed.day(), - hours = elapsed.hour() % 24, - minutes = elapsed.minute() % 60, - seconds = elapsed.second() % 60; - - char buf[14], *p = buf; // that two extra bytes saves us some flash... - - if (days) { *p++ = days / 10 + '0'; *p++ = days % 10 + '0'; *p++ = 'd'; } - *p++ = hours / 10 + '0'; *p++ = hours % 10 + '0'; *p++ = 'h'; - *p++ = minutes / 10 + '0'; *p++ = minutes % 10 + '0'; *p++ = 'm'; - *p++ = seconds / 10 + '0'; *p++ = seconds % 10 + '0'; *p++ = 's'; - *p = '\0'; - - dgusdisplay.WriteVariable(VP_PrintTime, buf, var.size, true); -} - - - -// Send an uint8_t between 0 and 100 to a variable scale to 0..255 -void DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr) { - if (var.memadr) { - uint16_t value = swap16(*(uint16_t*)val_ptr); - *(uint8_t*)var.memadr = map(constrain(value, 0, 100), 0, 100, 0, 255); - } -} - -// Sends a (RAM located) string to the DGUS Display -// (Note: The DGUS Display does not clear after the \0, you have to -// overwrite the remainings with spaces.// var.size has the display buffer size! -void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var) { - char *tmp = (char*) var.memadr; - dgusdisplay.WriteVariable(var.VP, tmp, var.size, true); -} - -// Sends a (flash located) string to the DGUS Display -// (Note: The DGUS Display does not clear after the \0, you have to -// overwrite the remainings with spaces.// var.size has the display buffer size! -void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { - char *tmp = (char*) var.memadr; - dgusdisplay.WriteVariablePGM(var.VP, tmp, var.size, true); -} - -#if ENABLED(SDSUPPORT) - - void DGUSScreenVariableHandler::ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) { - // default action executed when there is a SD card, but not printing - if (ExtUI::isMediaInserted() && !ExtUI::isPrintingFromMedia()) { - ScreenChangeHook(var, val_ptr); - dgusdisplay.RequestScreen(current_screen); - return; - } - - // if we are printing, we jump to two screens after the requested one. - // This should host e.g a print pause / print abort / print resume dialog. - // This concept allows to recycle this hook for other file - if (ExtUI::isPrintingFromMedia() && !card.flag.abort_sd_printing) { - GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION); - return; - } - - // Don't let the user in the dark why there is no reaction. - if (!ExtUI::isMediaInserted()) { - setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA)); - return; - } - if (card.flag.abort_sd_printing) { - setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING)); - return; - } - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable& var, void *val_ptr) { - auto old_top = top_file; - int16_t scroll = (int16_t)swap16(*(uint16_t*)val_ptr); - if (scroll == 0) { - if (!filelist.isAtRootDir()) { - filelist.upDir(); - top_file = 0; - ForceCompleteUpdate(); - } - } - else { - top_file += scroll; - DEBUG_ECHOPAIR("new topfile calculated:", top_file); - if (top_file < 0) { - top_file = 0; - DEBUG_ECHOLNPGM("Top of filelist reached"); - } - else { - int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN; - NOLESS(max_top, 0); - NOMORE(top_file, max_top); - } - DEBUG_ECHOPAIR("new topfile adjusted:", top_file); - } - - if (old_top != top_file) ForceCompleteUpdate(); - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; - if (touched_nr > filelist.count()) return; - if (!filelist.seek(touched_nr)) return; - if (filelist.isDir()) { - filelist.changeDir(filelist.filename()); - top_file = 0; - ForceCompleteUpdate(); - return; - } - - // Setup Confirmation screen - file_to_print = touched_nr; - HandleUserConfirmationPopUp(VP_SD_FileSelectConfirm, nullptr, PSTR("Print file"), filelist.filename(), PSTR("from SD Card?"), true, true, false, true); - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr) { - if (!filelist.seek(file_to_print)) return; - ExtUI::printFile(filelist.filename()); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_STATUS); - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr) { - if (!ExtUI::isPrintingFromMedia()) return; // avoid race condition when user stays in this menu and printer finishes. - switch (swap16(*(uint16_t*)val_ptr)) { - case 0: // Resume - if (ExtUI::isPrintingFromMediaPaused()) ExtUI::resumePrint(); - break; - case 1: // Pause - if (!ExtUI::isPrintingFromMediaPaused()) ExtUI::pausePrint(); - break; - case 2: // Abort - ScreenHandler.HandleUserConfirmationPopUp(VP_SD_AbortPrintConfirmed, nullptr, PSTR("Abort printing"), filelist.filename(), PSTR("?"), true, true, false, true); - break; - } - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr) { - ExtUI::stopPrint(); - GotoScreen(DGUSLCD_SCREEN_MAIN); - } - - void DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename(DGUS_VP_Variable& var) { - uint16_t target_line = (var.VP - VP_SD_FileName0) / VP_SD_FileName_LEN; - if (target_line > DGUS_SD_FILESPERSCREEN) return; - char tmpfilename[VP_SD_FileName_LEN + 1] = ""; - var.memadr = (void*)tmpfilename; - if (filelist.seek(top_file + target_line)) - snprintf_P(tmpfilename, VP_SD_FileName_LEN, PSTR("%s%c"), filelist.filename(), filelist.isDir() ? '/' : 0); - DGUSLCD_SendStringToDisplay(var); - } - - - void DGUSScreenVariableHandler::SDCardInserted() { - top_file = 0; - auto cs = ScreenHandler.getCurrentScreen(); - if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS) - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST); - } - - void DGUSScreenVariableHandler::SDCardRemoved() { - if (current_screen == DGUSLCD_SCREEN_SDFILELIST - || (current_screen == DGUSLCD_SCREEN_CONFIRM && (ConfirmVP == VP_SD_AbortPrintConfirmed || ConfirmVP == VP_SD_FileSelectConfirm)) - || current_screen == DGUSLCD_SCREEN_SDPRINTMANIPULATION - ) ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN); - } - - void DGUSScreenVariableHandler::SDCardError() { - DGUSScreenVariableHandler::SDCardRemoved(); - ScreenHandler.sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("SD card error"), nullptr, true, true, true, true); - ScreenHandler.SetupConfirmAction(nullptr); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP); - } - -#endif // SDSUPPORT - -void DGUSScreenVariableHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr) { - DGUS_VP_Variable ramcopy; - if (!populate_VPVar(ConfirmVP, &ramcopy)) return; - if (ramcopy.set_by_display_handler) ramcopy.set_by_display_handler(ramcopy, val_ptr); -} - -const uint16_t* DGUSLCD_FindScreenVPMapList(uint8_t screen) { - const uint16_t *ret; - const struct VPMapping *map = VPMap; - while (ret = (uint16_t*) pgm_read_word(&(map->VPList))) { - if (pgm_read_byte(&(map->screen)) == screen) return ret; - map++; - } - return nullptr; -} - -const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp) { - const DGUS_VP_Variable *ret = ListOfVP; - do { - const uint16_t vpcheck = pgm_read_word(&(ret->VP)); - if (vpcheck == 0) break; - if (vpcheck == vp) return ret; - ++ret; - } while (1); - - DEBUG_ECHOLNPAIR("FindVPVar NOT FOUND ", vp); - return nullptr; -} - -void DGUSScreenVariableHandler::ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr) { - if (!ExtUI::isPrinting()) { - ScreenChangeHook(var, val_ptr); - dgusdisplay.RequestScreen(current_screen); - } -} - -void DGUSScreenVariableHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { - uint8_t *tmp = (uint8_t*)val_ptr; - - // The keycode in target is coded as , so 0x0100A means - // from screen 1 (main) to 10 (temperature). DGUSLCD_SCREEN_POPUP is special, - // meaning "return to previous screen" - DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1]; - - if (target == DGUSLCD_SCREEN_POPUP) { - // special handling for popup is to return to previous menu - if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb(); - PopToOldScreen(); - return; - } - - UpdateNewScreen(target); - - #ifdef DEBUG_DGUSLCD - if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPAIR("WARNING: No screen Mapping found for ", x); - #endif -} - -void DGUSScreenVariableHandler::HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr) { - thermalManager.disable_all_heaters(); - ScreenHandler.ForceCompleteUpdate(); // hint to send all data. -} - -void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t newvalue = swap16(*(uint16_t*)val_ptr); - uint16_t acceptedvalue; - - switch (var.VP) { - default: return; - #if HOTENDS >= 1 - case VP_T_E0_Set: - thermalManager.setTargetHotend(newvalue, 0); - acceptedvalue = thermalManager.temp_hotend[0].target; - break; - #endif - #if HOTENDS >= 2 - case VP_T_E1_Set: - thermalManager.setTargetHotend(newvalue, 1); - acceptedvalue = thermalManager.temp_hotend[1].target; - break; - #endif - #if HAS_HEATED_BED - case VP_T_Bed_Set: - thermalManager.setTargetBed(newvalue); - acceptedvalue = thermalManager.temp_bed.target; - break; - #endif - } - - // reply to display the new value to update the view if the new value was rejected by the Thermal Manager. - if (newvalue != acceptedvalue && var.send_to_display_handler) var.send_to_display_handler(var); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel -} - -void DGUSScreenVariableHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr) { - #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_E0: target_extruder = 0; break; - #endif - #if (HOTENDS >= 2) - case VP_Flowrate_E1: 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 - #else - UNUSED(var); UNUSED(val_ptr); - #endif -} - -void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - - int16_t movevalue = swap16(*(uint16_t*)val_ptr); - float target = movevalue * 0.01f; - ExtUI::extruder_t target_extruder; - - switch (var.VP) { - #if HOTENDS >= 1 - case VP_MOVE_E0: target_extruder = ExtUI::extruder_t::E0; break; - #endif - #if HOTENDS >= 2 - case VP_MOVE_E1: target_extruder = ExtUI::extruder_t::E1; break - #endif - default: return; - } - - target += ExtUI::getAxisPosition_mm(target_extruder); - ExtUI::setAxisPosition_mm(target, target_extruder); - skipVP = var.VP; -} - -void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - - int16_t movevalue = swap16(*(uint16_t*)val_ptr); - char axiscode; - unsigned int speed = 1500; //FIXME: get default feedrate for manual moves, dont hardcode. - - switch (var.VP) { - case VP_MOVE_X: - axiscode = 'X'; - if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove; - break; - - case VP_MOVE_Y: - axiscode = 'Y'; - if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; - break; - - case VP_MOVE_Z: - axiscode = 'Z'; - speed = 300; // default to 5mm/s - if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; - break; - - case VP_HOME_ALL: // only used for homing - axiscode = '\0'; - movevalue = 0; // ignore value sent from display, this VP is _ONLY_ for homing. - break; - - default: return; - } - - if (!movevalue) { - // homing - DEBUG_ECHOPAIR(" homing ", axiscode); - char buf[6] = "G28 X"; - buf[4] = axiscode; - //DEBUG_ECHOPAIR(" ", buf); - while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓"); - ScreenHandler.ForceCompleteUpdate(); - return; - } - else { - //movement - DEBUG_ECHOPAIR(" move ", axiscode); - bool old_relative_mode = relative_mode; - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - while (!enqueue_and_echo_command("G91")) idle(); - //DEBUG_ECHOPGM(" ✓ "); - } - char buf[32]; // G1 X9999.99 F12345 - unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s); - char sign[]="\0"; - int16_t value = movevalue / 100; - if (movevalue < 0) { value = -value; sign[0] = '-'; } - int16_t fraction = ABS(movevalue) % 100; - 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_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_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - while (!enqueue_and_echo_command("G90")) idle(); - //DEBUG_ECHOPGM(" ✓ "); - } - } - - ScreenHandler.ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; - - cannotmove: - DEBUG_ECHOLNPAIR(" cannot move ", axiscode); - return; -} - -void DGUSScreenVariableHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) { - DEBUG_ECHOLNPAIR("SetNewScreen: ", newscreen); - - if (!popup) { - memmove(&past_screens[1], &past_screens[0], sizeof(past_screens) - 1); - past_screens[0] = current_screen; - } - - current_screen = newscreen; - skipVP = 0; - ForceCompleteUpdate(); -} - -void DGUSScreenVariableHandler::PopToOldScreen() { - DEBUG_ECHOLNPAIR("PopToOldScreen s=", past_screens[0]); - GotoScreen(past_screens[0], true); - memmove(&past_screens[0], &past_screens[1], sizeof(past_screens) - 1); - past_screens[sizeof(past_screens) - 1] = DGUSLCD_SCREEN_MAIN; -} - -void DGUSScreenVariableHandler::UpdateScreenVPData() { - DEBUG_ECHOPAIR(" UpdateScreenVPData Screen: ", current_screen); - - const uint16_t *VPList = DGUSLCD_FindScreenVPMapList(current_screen); - if (!VPList) { - DEBUG_ECHOLNPAIR(" NO SCREEN FOR: ", current_screen); - ScreenComplete = true; - return; // nothing to do, likely a bug or boring screen. - } - - // Round-Robbin updating of all VPs. - VPList += update_ptr; - - bool sent_one = false; - do { - uint16_t VP = pgm_read_word(VPList); - DEBUG_ECHOPAIR(" VP: ", VP); - if (!VP) { - update_ptr = 0; - DEBUG_ECHOLNPGM(" UpdateScreenVPData done"); - ScreenComplete = true; - return; // Screen completed. - } - - if (VP == skipVP) { - skipVP = 0; - continue; - } - - DGUS_VP_Variable rcpy; - if (populate_VPVar(VP, &rcpy)) { - uint8_t expected_tx = 6 + rcpy.size; // expected overhead is 6 bytes + payload. - // Send the VP to the display, but try to avoid overruning the Tx Buffer. - // But send at least one VP, to avoid getting stalled. - if (rcpy.send_to_display_handler && (!sent_one || expected_tx <= dgusdisplay.GetFreeTxBuffer())) { - //DEBUG_ECHOPAIR(" calling handler for ", rcpy.VP); - sent_one = true; - rcpy.send_to_display_handler(rcpy); - } - else { - //auto x=dgusdisplay.GetFreeTxBuffer(); - //DEBUG_ECHOLNPAIR(" tx almost full: ", x); - //DEBUG_ECHOPAIR(" update_ptr ", update_ptr); - ScreenComplete = false; - return; // please call again! - } - } - - } while (++update_ptr, ++VPList, true); -} - -void DGUSDisplay::loop() { - // protection against recursion… ProcessRx() might call indirectly idle() when trying to injecting gcode commands if the queue is full. - if (!no_reentrance) { - no_reentrance = true; - ProcessRx(); - no_reentrance = false; - } -} - -void DGUSDisplay::InitDisplay() { - RequestScreen( - #if ENABLED(SHOW_BOOTSCREEN) - DGUSLCD_SCREEN_BOOT - #else - DGUSLCD_SCREEN_MAIN - #endif - ); -} - -void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) { - const char* myvalues = static_cast(values); - bool strend = myvalues ? false : true; - WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen); - while (valueslen--) { - char x; - if (!strend) x = *myvalues++; - if ((isstr && !x) || strend) { - strend = true; - x = ' '; - } - dgusserial.write(x); - } -} - -void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) { - const char* myvalues = static_cast(values); - bool strend = myvalues ? false : true; - WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen); - while (valueslen--) { - char x; - if (!strend) x = pgm_read_byte(myvalues++); - if ((isstr && !x) || strend) { - strend = true; - x = ' '; - } - dgusserial.write(x); - } -} - -void DGUSScreenVariableHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) { - dgusdisplay.RequestScreen(screen); - UpdateNewScreen(screen, ispopup); -} - -bool DGUSScreenVariableHandler::loop() { - dgusdisplay.loop(); - - const millis_t ms = millis(); - static millis_t next_event_ms = 0; - - if (!IsScreenComplete() || ELAPSED(ms, next_event_ms)) { - next_event_ms = ms + DGUS_UPDATE_INTERVAL_MS; - UpdateScreenVPData(); - } - - #if ENABLED(SHOW_BOOTSCREEN) - static bool booted = false; - if (!booted && ELAPSED(ms, BOOTSCREEN_TIMEOUT)) { - booted = true; - GotoScreen(DGUSLCD_SCREEN_MAIN); - } - #endif - return IsScreenComplete(); -} - -void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) { - DEBUG_ECHOLNPAIR("GotoScreen ", screen); - const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) }; - WriteVariable(0x84, gotoscreen, sizeof(gotoscreen)); -} - -void DGUSDisplay::ProcessRx() { - - if (!dgusserial.available() && dgusserial.is_rx_overrun()) { - // if we've got an overrun, but reset the flag only when we've emptied the buffer - // We want to extract as many as valid datagrams possible... - DEBUG_ECHOPGM("OVFL"); - rx_datagram_state = DGUS_IDLE; - dgusserial.reset_rx_overun(); - } - - uint8_t receivedbyte; - while (dgusserial.available()) { - switch (rx_datagram_state) { - - case DGUS_IDLE: // Waiting for the first header byte - receivedbyte = dgusserial.read(); - //DEBUG_ECHOPAIR("< ",x); - if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN; - break; - - case DGUS_HEADER1_SEEN: // Waiting for the second header byte - receivedbyte = dgusserial.read(); - //DEBUG_ECHOPAIR(" ",x); - rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE; - break; - - case DGUS_HEADER2_SEEN: // Waiting for the length byte - rx_datagram_len = dgusserial.read(); - DEBUG_ECHOPAIR(" (", rx_datagram_len); - DEBUG_ECHOPGM(") "); - - // Telegram min len is 3 (command and one word of payload) - rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE; - break; - - case DGUS_WAIT_TELEGRAM: // wait for complete datagram to arrive. - if (dgusserial.available() < rx_datagram_len) return; - - Initialized = true; // We've talked to it, so we defined it as initialized. - uint8_t command = dgusserial.read(); - - DEBUG_ECHOPAIR("# ", command); - - uint8_t readlen = rx_datagram_len - 1; // command is part of len. - unsigned char tmp[rx_datagram_len - 1]; - unsigned char *ptmp = tmp; - while (readlen--) { - receivedbyte = dgusserial.read(); - DEBUG_ECHOPAIR(" ", receivedbyte); - *ptmp++ = receivedbyte; - } - DEBUG_ECHOPGM(" # "); - // mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it. - if (command == DGUS_CMD_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) { - DEBUG_ECHOLNPGM(">"); - rx_datagram_state = DGUS_IDLE; - break; - } - - /* AutoUpload, (and answer to) Command 0x83 : - | tmp[0 1 2 3 4 ... ] - | Example 5A A5 06 83 20 01 01 78 01 …… - | / / | | \ / | \ \ - | Header | | | | \_____\_ DATA (Words!) - | DatagramLen / VPAdr | - | Command DataLen (in Words) */ - if (command == DGUS_CMD_READVAR) { - const uint16_t vp = tmp[0] << 8 | tmp[1]; - const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words) - //DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen); - DGUS_VP_Variable ramcopy; - if (populate_VPVar(vp, &ramcopy)) { - if (!(dlen == ramcopy.size || (dlen == 2 && ramcopy.size == 1))) - DEBUG_ECHOLNPGM("SIZE MISMATCH"); - else if (ramcopy.set_by_display_handler) { - ramcopy.set_by_display_handler(ramcopy, &tmp[3]); - } - else - DEBUG_ECHOLNPGM(" VPVar found, no handler."); - } - else - DEBUG_ECHOLNPAIR(" VPVar not found:", vp); - - rx_datagram_state = DGUS_IDLE; - break; - } - - // discard what we do not understand. - rx_datagram_state = DGUS_IDLE; - } - } -} - -size_t DGUSDisplay::GetFreeTxBuffer() { return dgusserial.GetTxBufferFree(); } - -void DGUSDisplay::WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen) { - dgusserial.write(DGUS_HEADER1); - dgusserial.write(DGUS_HEADER2); - dgusserial.write(payloadlen + 3); - dgusserial.write(cmd); - dgusserial.write(adr >> 8); - dgusserial.write(adr & 0xFF); -} - -void DGUSDisplay::WritePGM(const char str[], uint8_t len) { - while (len--) dgusserial.write(pgm_read_byte(str++)); -} - -// Serial implementation stolen from MarlinSerial.cpp -- but functinality reduced to our use case -// (no XON/XOFF, no Emergency Parser, no error statistics, no support to send from interrupts ...) - -// Define all UART registers -#define _TNAME(X,Y,Z) X##Y##Z -#define TNAME(X,Y,Z) _TNAME(X,Y,Z) -#define DGUS_SERIAL_RX_VECT TNAME(USART,DGUS_SER_PORT,_RX_vect) -#define DGUS_SERIAL_UDRE_VECT TNAME(USART,DGUS_SER_PORT,_UDRE_vect) -#define DGUS_UCSRxA TNAME(UCSR,DGUS_SER_PORT,A) -#define DGUS_UCSRxB TNAME(UCSR,DGUS_SER_PORT,B) -#define DGUS_UCSRxC TNAME(UCSR,DGUS_SER_PORT,C) -#define DGUS_UBRRxH TNAME(UBRR,DGUS_SER_PORT,H) -#define DGUS_UBRRxL TNAME(UBRR,DGUS_SER_PORT,L) -#define DGUS_UDRx TNAME(UDR,DGUS_SER_PORT,) - -#define U2Xx TNAME(U2X,DGUS_SER_PORT,) -#define RXENx TNAME(RXEN,DGUS_SER_PORT,) -#define TXENx TNAME(TXEN,DGUS_SER_PORT,) -#define TXCx TNAME(TXC,DGUS_SER_PORT,) -#define RXCIEx TNAME(RXCIE,DGUS_SER_PORT,) -#define UDRIEx TNAME(UDRIE,DGUS_SER_PORT,) -#define UDREx TNAME(UDRE,DGUS_SER_PORT,) - -// A SW memory barrier, to ensure GCC does not overoptimize loops -#define sw_barrier() asm volatile("": : :"memory"); - -DGUSSerial::DGUSSerial() { - // Initialize UART - DGUS_UCSRxA = 1 << U2Xx; - const uint16_t baud_setting = (F_CPU / 4 / DGUS_BAUDRATE - 1) / 2; - DGUS_UBRRxH = baud_setting >> 8; - DGUS_UBRRxL = baud_setting; - DGUS_UCSRxC = 0x06; - DGUS_UCSRxB = 1 << RXCIEx | 1 << TXENx | 1 << RXENx; // Enable TX,RX and the RX interrupts. -} - -DGUSSerial::~DGUSSerial() { DGUS_UCSRxB = 0; } - -// "Atomically" read the RX head index value without disabling interrupts: -// This MUST be called with RX interrupts enabled, and CAN'T be called -// from the RX ISR itself! -FORCE_INLINE r_ring_buffer_pos_t DGUSSerial::atomic_read_rx_head() { - #if RX_BUFFER_SIZE > 256 - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because serial RX interrupts happen at a slower rate - // than successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - r_ring_buffer_pos_t vold, vnew = rx_buffer.head; - sw_barrier(); - do { - vold = vnew; - vnew = rx_buffer.head; - sw_barrier(); - } while (vold != vnew); - return vnew; - #else - // With an 8bit index, reads are always atomic. No need for special handling - return rx_buffer.head; - #endif -} - -// Set RX tail index, taking into account the RX ISR could interrupt -// the write to this variable in the middle - So a backup strategy -// is used to ensure reads of the correct values. -// -Must NOT be called from the RX ISR - -FORCE_INLINE void DGUSSerial::atomic_set_rx_tail(r_ring_buffer_pos_t value) { - #if RX_BUFFER_SIZE > 256 - // Store the new value in the backup - rx_tail_value_backup = value; - sw_barrier(); - // Flag we are about to change the true value - rx_tail_value_not_stable = true; - sw_barrier(); - // Store the new value - rx_buffer.tail = value; - sw_barrier(); - // Signal the new value is completely stored into the value - rx_tail_value_not_stable = false; - sw_barrier(); - #else - rx_buffer.tail = value; - #endif -} - -// Get the RX tail index, taking into account the read could be -// interrupting in the middle of the update of that index value -// -Called from the RX ISR - -FORCE_INLINE r_ring_buffer_pos_t DGUSSerial::atomic_read_rx_tail() { - #if RX_BUFFER_SIZE > 256 - // If the true index is being modified, return the backup value - if (rx_tail_value_not_stable) return rx_tail_value_backup; - #endif - // The true index is stable, return it - return rx_buffer.tail; -} - -// (called with RX interrupts disabled) -FORCE_INLINE void DGUSSerial::store_rxd_char() { - // Get the tail - Nothing can alter its value while this ISR is executing, but there's - // a chance that this ISR interrupted the main process while it was updating the index. - // The backup mechanism ensures the correct value is always returned. - const r_ring_buffer_pos_t t = atomic_read_rx_tail(); - - // Get the head pointer - This ISR is the only one that modifies its value, so it's safe to read here - r_ring_buffer_pos_t h = rx_buffer.head; - - // Get the next element - r_ring_buffer_pos_t i = (r_ring_buffer_pos_t) (h + 1) & (r_ring_buffer_pos_t) (DGUS_RX_BUFFER_SIZE - 1); - - // Read the character from the USART - uint8_t c = DGUS_UDRx; - - // If the character is to be stored at the index just before the tail - // (such that the head would advance to the current tail), the RX FIFO is - // full, so don't write the character or advance the head. - if (i != t) { - rx_buffer.buffer[h] = c; - h = i; - } - else - dgus_rx_overrun = true; - - // Store the new head value - The main loop will retry until the value is stable - rx_buffer.head = h; -} - -// (called with TX irqs disabled) -FORCE_INLINE void DGUSSerial::tx_udr_empty_irq() { - // Read positions - uint8_t t = tx_buffer.tail; - const uint8_t h = tx_buffer.head; - // If nothing to transmit, just disable TX interrupts. This could - // happen as the result of the non atomicity of the disabling of RX - // interrupts that could end reenabling TX interrupts as a side effect. - if (h == t) { - CBI(DGUS_UCSRxB, UDRIEx); // (Non-atomic, could be reenabled by the main program, but eventually this will succeed) - return; - } - - // There is something to TX, Send the next byte - const uint8_t c = tx_buffer.buffer[t]; - t = (t + 1) & (DGUS_TX_BUFFER_SIZE - 1); - DGUS_UDRx = c; - tx_buffer.tail = t; - - // Clear the TXC bit (by writing a one to its bit location). - // Ensures flush() won't return until the bytes are actually written/ - SBI(DGUS_UCSRxA, TXCx); - - // Disable interrupts if there is nothing to transmit following this byte - if (h == t) CBI(DGUS_UCSRxB, UDRIEx); -} - -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); -} - -int DGUSSerial::read() { - const r_ring_buffer_pos_t h = atomic_read_rx_head(); - - // Read the tail. Main thread owns it, so it is safe to directly read it - r_ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - // Get the next char - const int v = rx_buffer.buffer[t]; - t = (r_ring_buffer_pos_t) (t + 1) & (DGUS_RX_BUFFER_SIZE - 1); - - // Advance tail - Making sure the RX ISR will always get an stable value, even - // if it interrupts the writing of the value of that variable in the middle. - atomic_set_rx_tail(t); - return v; -} - -void DGUSSerial::write(const uint8_t c) { - // are we currently tranmitting? If not, we can just place the byte in UDR. - if (!TEST(DGUS_UCSRxB, UDRIEx) && TEST(DGUS_UCSRxA, UDREx)) { - DGUS_UDRx = c; - SBI(DGUS_UCSRxA, TXCx); - return; - } - - const uint8_t i = (tx_buffer.head + 1) & (DGUS_TX_BUFFER_SIZE - 1); - while (i == tx_buffer.tail) sw_barrier(); - - // Store new char. head is always safe to move - tx_buffer.buffer[tx_buffer.head] = c; - tx_buffer.head = i; - SBI(DGUS_UCSRxB, UDRIEx); // Enable Interrupts to finish off. -} - -t_ring_buffer_pos_t DGUSSerial::GetTxBufferFree() { - const t_ring_buffer_pos_t t = tx_buffer.tail, // next byte to send. - h = tx_buffer.head; // next pos for queue. - int ret = t - h - 1; - if (ret < 0) ret += DGUS_TX_BUFFER_SIZE + 1; - return ret; -} - -ISR(DGUS_SERIAL_UDRE_VECT) { dgusserial.tx_udr_empty_irq(); } -ISR(DGUS_SERIAL_RX_VECT) { dgusserial.store_rxd_char(); } - -#endif // DGUS_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.h deleted file mode 100644 index 46d451a1d9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.h +++ /dev/null @@ -1,236 +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 - -/* DGUS implementation written by coldtobi in 2019 for Marlin */ - -#include "../../../../inc/MarlinConfigPre.h" - -#include "../../../../Marlin.h" -#include "DGUSVPVariable.h" - -enum DGUSLCD_Screens : uint8_t; - -#define DEBUG_OUT ENABLED(DEBUG_DGUSLCD) -#include "../../../../core/debug_out.h" - -typedef enum : uint8_t { - DGUS_IDLE, //< waiting for DGUS_HEADER1. - DGUS_HEADER1_SEEN, //< DGUS_HEADER1 received - DGUS_HEADER2_SEEN, //< DGUS_HEADER2 received - DGUS_WAIT_TELEGRAM, //< LEN received, Waiting for to receive all bytes. -} rx_datagram_state_t; - -// Low-Level access to the display. -class DGUSDisplay { -public: - - DGUSDisplay() = default; - - static void InitDisplay(); - - // Variable access. - static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false); - static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false); - template - static void WriteVariable(uint16_t adr, T value) { - WriteVariable(adr, static_cast(&value), sizeof(T)); - } - - // Until now I did not need to actively read from the display. That's why there is no ReadVariable - // (I extensively use the auto upload of the display) - - // Force display into another screen. - // (And trigger update of containing VPs) - // (to implement a pop up message, which may not be nested) - static void RequestScreen(DGUSLCD_Screens screen); - - // Periodic tasks, eg. Rx-Queue handling. - static void loop(); - -public: - // Helper for users of this class to estimate if an interaction would be blocking. - static size_t GetFreeTxBuffer(); - - // Checks two things: Can we confirm the presence of the display and has we initiliazed it. - // (both boils down that the display answered to our chatting) - static inline bool isInitialized() { return Initialized; } - -private: - static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen); - static void WritePGM(const char str[], uint8_t len); - static void ProcessRx(); - - static rx_datagram_state_t rx_datagram_state; - static uint8_t rx_datagram_len; - static bool Initialized, no_reentrance; -}; - -extern DGUSDisplay dgusdisplay; - -// compile-time x^y -constexpr float cpow(const float x, const int y) { return y == 0 ? 1.0 : x * cpow(x, y - 1); } - -class DGUSScreenVariableHandler { -public: - DGUSScreenVariableHandler() = default; - - static bool loop(); - - /// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen - /// The bools specifing whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - - /// "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char* msg); - /// The same for messages from Flash - static void setstatusmessagePGM(PGM_P const msg); - // Callback for VP "Display wants to change screen on idle printer" - static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "Screen has been changed" - static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "All Heaters Off" - static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change this temperature" - static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change Flowrate" - static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual move. - static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual extrude. - static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); - - #if ENABLED(SDSUPPORT) - // Callback for VP "Display wants to change screen when there is a SD card" - static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); - /// Scroll buttons on the file listing screen. - static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); - /// File touched. - static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); - /// start print after confirmation received. - static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); - /// User hit the pause, resume or abort button. - static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); - /// User confirmed the abort action - static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); - /// Send a single filename to the display. - static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); - /// Marlin informed us that a new SD has been inserted. - static void SDCardInserted(); - /// Marlin informed us that the SD Card has been removed(). - static void SDCardRemoved(); - /// Marlin informed us about a bad SD Card. - static void SDCardError(); - #endif - - // OK Button the Confirm screen. - static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); - - // Update data after went to new screen (by display or by GotoScreen) - // remember: store the last-displayed screen, so it can get returned to. - // (e.g for pop up messages) - static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); - - // Recall the remembered screen. - static void PopToOldScreen(); - - // Make the display show the screen and update all VPs in it. - static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); - - static void UpdateScreenVPData(); - - // Helpers to convert and transfer data to the display. - static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - - /// Send a value from 0..100 to a variable with a range from 0..255 - static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); - - template - static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { - if (!var.memadr) return; - union { unsigned char tmp[sizeof(T)]; T t; } x; - unsigned char *ptr = (unsigned char*)val_ptr; - for (uint8_t i = 0; i < sizeof(T); i++) x.tmp[i] = ptr[sizeof(T) - i - 1]; - *(T*)var.memadr = x.t; - } - - /// Send a float value to the display. - /// Display will get a 4-byte integer scaled to the number of digits: - /// Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - f *= cpow(10, decimals); - union { long l; char lb[4]; } endian; - - char tmp[4]; - endian.l = f; - tmp[0] = endian.lb[3]; - tmp[1] = endian.lb[2]; - tmp[2] = endian.lb[1]; - tmp[3] = endian.lb[0]; - dgusdisplay.WriteVariable(var.VP, tmp, 4); - } - } - - /// Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } - /// Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } - - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } - - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } - -private: - static DGUSLCD_Screens current_screen; ///< currently on screen - static constexpr uint8_t NUM_PAST_SCREENS = 4; - static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; ///< LIFO with past screens for the "back" button. - - static uint8_t update_ptr; ///< Last sent entry in the VPList for the actual screen. - static uint16_t skipVP; ///< When updating the screen data, skip this one, because the user is interacting with it. - static bool ScreenComplete; ///< All VPs sent to screen? - - static uint16_t ConfirmVP; ///< context for confirm screen (VP that will be emulated-sent on "OK"). - - #if ENABLED(SDSUPPORT) - static int16_t top_file; ///< file on top of file chooser - static int16_t file_to_print; ///< touched file to be confirmed - #endif - - static void (*confirm_action_cb)(); -}; - -extern DGUSScreenVariableHandler ScreenHandler; - -/// Find the flash address of a DGUS_VP_Variable for the VP. -extern const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp); - -/// Helper to populate a DGUS_VP_Variable for a given VP. Return false if not found. -extern bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp deleted file mode 100644 index de15d54597..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp +++ /dev/null @@ -1,231 +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 . - * - */ - -/* DGUS implementation written by coldtobi in 2019 for Marlin */ - -#include "../../../../inc/MarlinConfigPre.h" - -#if ENABLED(DGUS_LCD) - -#include "DGUSDisplayDefinition.h" -#include "DGUSDisplay.h" - -#include "../../../../module/temperature.h" -#include "../../../../module/motion.h" - -#include "../../../ultralcd.h" - -const uint16_t VPList_Boot[] PROGMEM = { - VP_MARLIN_VERSION, - 0x0000 -}; - -const uint16_t VPList_Main[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded. */ - 0x0000 -}; - -const uint16_t VPList_Temp[] PROGMEM = { - #if HOTENDS >= 1 - VP_T_E0_Is, VP_T_E0_Set, - #endif - #if HOTENDS >= 2 - VP_T_E1_I, VP_T_E1_S, - #endif - #if HAS_HEATED_BED - VP_T_Bed_Is, VP_T_Bed_Set, - #endif - 0x0000 -}; - -const uint16_t VPList_Status[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ - #if HOTENDS >= 1 - VP_T_E0_Is, VP_T_E0_Set, - #endif - #if HOTENDS >= 2 - VP_T_E1_I, VP_T_E1_S, - #endif - #if HAS_HEATED_BED - VP_T_Bed_Is, VP_T_Bed_Set, - #endif - #if FAN_COUNT > 0 - VP_Fan_Percentage, - #endif - VP_XPos, VP_YPos, VP_ZPos, - VP_Fan_Percentage, - VP_Feedrate_Percentage, - VP_PrintProgress_Percentage, - 0x0000 -}; - -const uint16_t VPList_Status2[] PROGMEM = { - /* VP_M117, for completeness, but it cannot be auto-uploaded */ - #if HOTENDS >= 1 - VP_Flowrate_E0, - #endif - #if HOTENDS >= 2 - VP_Flowrate_E1, - #endif - VP_PrintProgress_Percentage, - VP_PrintTime, - 0x0000 -}; - -const uint16_t VPList_ManualMove[] PROGMEM = { - VP_XPos, VP_YPos, VP_ZPos, - 0x0000 -}; - -const uint16_t VPList_ManualExtrude[] PROGMEM = { - VP_EPos, - 0x0000 -}; - -const uint16_t VPList_FanAndFeedrate[] PROGMEM = { - VP_Feedrate_Percentage, VP_Fan_Percentage, - 0x0000 -}; - -const uint16_t VPList_SD_FlowRates[] PROGMEM = { - VP_Flowrate_E0, VP_Flowrate_E1, - 0x0000 -}; - -const uint16_t VPList_SDFileList[] PROGMEM = { - VP_SD_FileName0, VP_SD_FileName1, VP_SD_FileName2, VP_SD_FileName3, VP_SD_FileName4, - 0x0000 -}; - -const uint16_t VPList_SD_PrintManipulation[] PROGMEM = { - VP_PrintProgress_Percentage, VP_PrintTime, - 0x0000 -}; - -const struct VPMapping VPMap[] PROGMEM = { - { DGUSLCD_SCREEN_BOOT, VPList_Boot }, - { DGUSLCD_SCREEN_MAIN, VPList_Main }, - { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp }, - { DGUSLCD_SCREEN_STATUS, VPList_Status }, - { DGUSLCD_SCREEN_STATUS2, VPList_Status2 }, - { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove }, - { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude }, - { DGUSLCD_SCREEN_FANANDFEEDRATE, VPList_FanAndFeedrate }, - { DGUSLCD_SCREEN_FLOWRATES, VPList_SD_FlowRates }, - { DGUSLCD_SCREEN_SDPRINTMANIPULATION, VPList_SD_PrintManipulation }, - { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList }, - { 0 , nullptr } // List is terminated with an nullptr as table entry. -}; - -const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION; - -// Helper to define a DGUS_VP_Variable for common use cases. -#define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=sizeof(VPADRVAR), \ - .set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR } - -// Helper to define a DGUS_VP_Variable when the sizeo of the var cannot be determined automaticalyl (eg. a string) -#define VPHELPER_STR(VPADR, VPADRVAR, STRLEN, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=STRLEN, \ - .set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR } - -const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { - // Helper to detect touch events - VPHELPER(VP_SCREENCHANGE, nullptr, DGUSScreenVariableHandler::ScreenChangeHook, nullptr), - VPHELPER(VP_SCREENCHANGE_ASK, nullptr, DGUSScreenVariableHandler::ScreenChangeHookIfIdle, nullptr), - VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, DGUSScreenVariableHandler::ScreenChangeHookIfSD, nullptr), - VPHELPER(VP_CONFIRMED, nullptr, DGUSScreenVariableHandler::ScreenConfirmedOK, nullptr), - - VPHELPER(VP_TEMP_ALL_OFF, nullptr, &DGUSScreenVariableHandler::HandleAllHeatersOff, nullptr), - - VPHELPER(VP_MOVE_X, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Y, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_MOVE_Z, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - VPHELPER(VP_HOME_ALL, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr), - - { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, - // M117 LCD String (We don't need the string in memory but "just" push it to the display on demand, hence the nullptr - { .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay }, - - // Temperature Data - #if HOTENDS >= 1 - VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Flowrate_E0, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), - #endif - #if HOTENDS >= 2 - VPHELPER(VP_T_E1_I, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E1_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), - #endif - #if HOTENDS >= 3 - #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.celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - #endif - - // Fan Data. - #if FAN_COUNT > 0 - VPHELPER(VP_Fan_Percentage, &thermalManager.fan_speed[0], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), - #endif - - // Feedrate. - VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), - - // Position Data. - VPHELPER(VP_XPos, ¤t_position.x, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_YPos, ¤t_position.y, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_ZPos, ¤t_position.z, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - - // Print Progress. - VPHELPER(VP_PrintProgress_Percentage, &ui.progress_override, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), - - // Print Time - VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay ), - - // SDCard File listing. - #if ENABLED(SDSUPPORT) - VPHELPER(VP_SD_ScrollEvent, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ScrollFilelist, nullptr), - VPHELPER(VP_SD_FileSelected, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_FileSelected, nullptr), - VPHELPER(VP_SD_FileSelectConfirm, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_StartPrint, nullptr), - VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename ), - VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename ), - VPHELPER(VP_SD_ResumePauseAbort, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ResumePauseAbort, nullptr), - VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ReallyAbort, nullptr), - #endif - - // Messages for the User, shared by the popup and the kill screen. They cant be autouploaded as we do not buffer content. - { .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, - { .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, - { .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, - { .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM }, - - VPHELPER(0, 0, 0, 0) // must be last entry. -}; - -#endif // DGUS_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h deleted file mode 100644 index f90cfa948b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h +++ /dev/null @@ -1,192 +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 - -/* DGUS implementation written by coldtobi in 2019 for Marlin */ - -#include "DGUSVPVariable.h" - -// This file defines the interaction between Marlin and the display firmware. - -// information on which screen which VP is displayed -// As this is a sparse table, two arrays are needed: -// one to list the VPs of one screen and one to map screens to the lists. -// (Strictly this would not be necessary, but allows to only send data the display needs and reducing load on Marlin) -struct VPMapping { - const uint8_t screen; - const uint16_t *VPList; // The list is null-terminated. -}; - -extern const struct VPMapping VPMap[]; - -enum DGUSLCD_Screens : uint8_t { - DGUSLCD_SCREEN_BOOT = 0, - DGUSLCD_SCREEN_MAIN = 10, - DGUSLCD_SCREEN_TEMPERATURE = 20, - DGUSLCD_SCREEN_STATUS = 30, - DGUSLCD_SCREEN_STATUS2 = 32, - DGUSLCD_SCREEN_MANUALMOVE = 40, - DGUSLCD_SCREEN_MANUALEXTRUDE=42, - DGUSLCD_SCREEN_FANANDFEEDRATE = 44, - DGUSLCD_SCREEN_FLOWRATES = 46, - DGUSLCD_SCREEN_SDFILELIST = 50, - DGUSLCD_SCREEN_SDPRINTMANIPULATION = 52, - DGUSLCD_SCREEN_CONFIRM = 240, - DGUSLCD_SCREEN_KILL = 250, ///< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") - DGUSLCD_SCREEN_POPUP = 252, ///< special target, popup screen will also return this code to say "return to previous screen" - DGUSLDC_SCREEN_UNUSED = 255 -}; - -// Display Memory layout used (T5UID) -// Except system variables this is arbitrary, just to organize stuff.... - -// 0x0000 .. 0x0FFF -- System variables and reserved by the display -// 0x1000 .. 0x1FFF -- Variables to never change location, regardless of UI Version -// 0x2000 .. 0x2FFF -- Controls (VPs that will trigger some action) -// 0x3000 .. 0x4FFF -- Marlin Data to be displayed -// 0x5000 .. -- SPs (if we want to modify display elements, e.g change color or like) -- currently unused - -// As there is plenty of space (at least most displays have >8k RAM), we do not pack them too tight, -// so that we can keep variables nicely together in the address space. - -// UI Version always on 0x1000...0x1002 so that the firmware can check this and bail out. -constexpr uint16_t VP_UI_VERSION_MAJOR = 0x1000; // Major -- incremented when incompatible -constexpr uint16_t VP_UI_VERSION_MINOR = 0x1001; // Minor -- incremented on new features, but compatible -constexpr uint16_t VP_UI_VERSION_PATCH = 0x1002; // Patch -- fixed which do not change functionality. -constexpr uint16_t VP_UI_FLAVOUR = 0x1010; // lets reserve 16 bytes here to determine if UI is suitable for this Marlin. tbd. - -// Storage space for the Killscreen messages. 0x1100 - 0x1200 . Reused for the popup. -constexpr uint16_t VP_MSGSTR1 = 0x1100; -constexpr uint8_t VP_MSGSTR1_LEN = 0x20; // might be more place for it... -constexpr uint16_t VP_MSGSTR2 = 0x1140; -constexpr uint8_t VP_MSGSTR2_LEN = 0x20; -constexpr uint16_t VP_MSGSTR3 = 0x1180; -constexpr uint8_t VP_MSGSTR3_LEN = 0x20; -constexpr uint16_t VP_MSGSTR4 = 0x11C0; -constexpr uint8_t VP_MSGSTR4_LEN = 0x20; - -// Screenchange request for screens that only make sense when printer is idle. -// e.g movement is only allowed if printer is not printing. -// Marlin must confirm by setting the screen manually. -constexpr uint16_t VP_SCREENCHANGE_ASK = 0x2000; -constexpr uint16_t VP_SCREENCHANGE = 0x2001; // Key-Return button to new menu pressed. Data contains target screen in low byte and info in high byte. -constexpr uint16_t VP_TEMP_ALL_OFF = 0x2002; // Turn all heaters off. Value arbitrary ;)= -constexpr uint16_t VP_SCREENCHANGE_WHENSD = 0x2003; // "Print" Button touched -- go only there if there is an SD Card. - -constexpr uint16_t VP_CONFIRMED = 0x2010; // OK on confirm screen. - -// Buttons on the SD-Card File listing. -constexpr uint16_t VP_SD_ScrollEvent = 0x2020; // Data: 0 for "up a directory", numbers are the amount to scroll, e.g -1 one up, 1 one down -constexpr uint16_t VP_SD_FileSelected = 0x2022; // Number of file field selected. -constexpr uint16_t VP_SD_FileSelectConfirm = 0x2024; // (This is a virtual VP and emulated by the Confirm Screen when a file has been confirmed) - -constexpr uint16_t VP_SD_ResumePauseAbort = 0x2026; // Resume(Data=0), Pause(Data=1), Abort(Data=2) SD Card prints -constexpr uint16_t VP_SD_AbortPrintConfirmed = 0x2028; // Abort print confirmation (virtual, will be injected by the confirm dialog) - -// Controls for movement (we can't use the incremental / decremental feature of the display at this feature works only with 16 bit values -// (which would limit us to 655.35mm, which is likely not a problem for common setups, but i don't want to rule out hangprinters support) -// A word about the coding: The VP will be per axis and the return code will be an signed 16 bit value in 0.01 mm resolution, telling us -// the relative travel amount t he user wants to do. So eg. if the display sends us VP=2100 with value 100, the user wants us to move X by +1 mm. -constexpr uint16_t VP_MOVE_X = 0x2100; -constexpr uint16_t VP_MOVE_Y = 0x2102; -constexpr uint16_t VP_MOVE_Z = 0x2104; -constexpr uint16_t VP_MOVE_E0 = 0x2110; -constexpr uint16_t VP_MOVE_E1 = 0x2112; -//constexpr uint16_t VP_MOVE_E2 = 0x2114; -//constexpr uint16_t VP_MOVE_E3 = 0x2116; -//constexpr uint16_t VP_MOVE_E4 = 0x2118; -//constexpr uint16_t VP_MOVE_E5 = 0x211A; -constexpr uint16_t VP_HOME_ALL = 0x2120; - -// Firmware version on the boot screen. -constexpr uint16_t VP_MARLIN_VERSION = 0x3000; -constexpr uint8_t VP_MARLIN_VERSION_LEN = 16; // there is more space on the display, if needed. - -// Place for status messages. -constexpr uint16_t VP_M117 = 0x3020; -constexpr uint8_t VP_M117_LEN = 0x20; - -// Temperatures. -constexpr uint16_t VP_T_E0_Is = 0x3060; // 4 Byte Integer -constexpr uint16_t VP_T_E0_Set = 0x3062; // 2 Byte Integer -constexpr uint16_t VP_T_E1_Is = 0x3064; // 4 Byte Integer - -// reserved to support up to 6 Extruders: -//constexpr uint16_t VP_T_E1_Set = 0x3066; // 2 Byte Integer -//constexpr uint16_t VP_T_E2_Is = 0x3068; // 4 Byte Integer -//constexpr uint16_t VP_T_E2_Set = 0x306A; // 2 Byte Integer -//constexpr uint16_t VP_T_E3_Is = 0x306C; // 4 Byte Integer -//constexpr uint16_t VP_T_E3_Set = 0x306E; // 2 Byte Integer -//constexpr uint16_t VP_T_E4_Is = 0x3070; // 4 Byte Integer -//constexpr uint16_t VP_T_E4_Set = 0x3072; // 2 Byte Integer -//constexpr uint16_t VP_T_E4_Is = 0x3074; // 4 Byte Integer -//constexpr uint16_t VP_T_E4_Set = 0x3076; // 2 Byte Integer -//constexpr uint16_t VP_T_E5_Is = 0x3078; // 4 Byte Integer -//constexpr uint16_t VP_T_E5_Set = 0x307A; // 2 Byte Integer - -constexpr uint16_t VP_T_Bed_Is = 0x3080; // 4 Byte Integer -constexpr uint16_t VP_T_Bed_Set = 0x3082; // 2 Byte Integer - -constexpr uint16_t VP_Flowrate_E0 = 0x3090; // 2 Byte Integer -constexpr uint16_t VP_Flowrate_E1 = 0x3092; // 2 Byte Integer - -// reserved for up to 6 Extruders: -//constexpr uint16_t VP_Flowrate_E2 = 0x3094; -//constexpr uint16_t VP_Flowrate_E3 = 0x3096; -//constexpr uint16_t VP_Flowrate_E4 = 0x3098; -//constexpr uint16_t VP_Flowrate_E5 = 0x309A; - -constexpr uint16_t VP_Fan_Percentage = 0x3100; // 2 Byte Integer (0..100) -constexpr uint16_t VP_Feedrate_Percentage = 0x3102; // 2 Byte Integer (0..100) -constexpr uint16_t VP_PrintProgress_Percentage = 0x3104; // 2 Byte Integer (0..100) - -constexpr uint16_t VP_PrintTime = 0x3106; -constexpr uint16_t VP_PrintTime_LEN = 10; - -// Actual Position -constexpr uint16_t VP_XPos = 0x3110; // 4 Byte Fixed point number; format xxx.yy -constexpr uint16_t VP_YPos = 0x3112; // 4 Byte Fixed point number; format xxx.yy -constexpr uint16_t VP_ZPos = 0x3114; // 4 Byte Fixed point number; format xxx.yy - -constexpr uint16_t VP_EPos = 0x3120; // 4 Byte Fixed point number; format xxx.yy - -// SDCard File Listing -constexpr uint16_t VP_SD_FileName_LEN = 32; // LEN is shared for all entries. -constexpr uint16_t DGUS_SD_FILESPERSCREEN = 5; // FIXME move that info to the display and read it from there. -constexpr uint16_t VP_SD_FileName0 = 0x3200; -constexpr uint16_t VP_SD_FileName1 = 0x3220; -constexpr uint16_t VP_SD_FileName2 = 0x3240; -constexpr uint16_t VP_SD_FileName3 = 0x3260; -constexpr uint16_t VP_SD_FileName4 = 0x3280; - -// SPs for certain variables... -// located at 0x5000 and up -// Not used yet! -// This can be used e.g to make controls / data display invisible -constexpr uint16_t SP_T_E0_Is = 0x5000; -constexpr uint16_t SP_T_E0_Set = 0x5010; -constexpr uint16_t SP_T_E1_Is = 0x5020; -constexpr uint16_t SP_T_Bed_Is = 0x5030; -constexpr uint16_t SP_T_Bed_Set = 0x5040; - -// List of VPs handled by Marlin / The Display. -extern const struct DGUS_VP_Variable ListOfVP[]; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSVPVariable.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSVPVariable.h deleted file mode 100644 index 8a2172f554..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSVPVariable.h +++ /dev/null @@ -1,47 +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 - -/** - * DGUSVPVariable.h - * - * Created on: Feb 9, 2019 - * Author: tobi - */ - -struct DGUS_VP_Variable { - uint16_t VP; - void* memadr; // If nullptr, the value cannot be uploaded to the display. - uint8_t size; - - // Callback that will be called if the display modified the value. - // nullptr makes it readonly for the display. - void (*set_by_display_handler)(DGUS_VP_Variable &var, void *val_ptr); - void (*send_to_display_handler)(DGUS_VP_Variable &var); - - template - DGUS_VP_Variable& operator =(T &o) { - *(T*)memadr = o; // warning this is not typesafe. - // TODO: Call out the display or mark as dirty for the next update. - return *this; - } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp deleted file mode 100644 index c8cc6e8e9d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ /dev/null @@ -1,559 +0,0 @@ -/********************* - * flash_storage.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 "../compat.h" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "../ftdi_eve_lib/ftdi_eve_lib.h" - -#include "media_file_reader.h" -#include "flash_storage.h" - -// The following must be changed whenever the layout of the flash -// data is changed in a manner that would render the data invalid. - -constexpr uint32_t flash_eeprom_version = 1; - -/* SPI Flash Memory Map: - * - * The following offsets and sizes are specified in 4k erase units: - * - * Page Size Description - * 0 16 DATA STORAGE AREA - * 16 1 VERSIONING DATA - * 17 inf MEDIA STORAGE AREA - * - */ - -#define DATA_STORAGE_SIZE_64K - -using namespace FTDI::SPI; -using namespace FTDI::SPI::most_significant_byte_first; - -bool UIFlashStorage::is_present = false; - -#ifdef SPI_FLASH_SS -/************************** SPI Flash Chip Interface **************************/ - - void SPIFlash::wait_while_busy() { - uint8_t status; - safe_delay(1); - do { - spi_flash_select(); - spi_write_8(READ_STATUS_1); - status = spi_read_8(); - spi_flash_deselect(); - safe_delay(1); - } while (status & 1); - } - - void SPIFlash::erase_sector_4k(uint32_t addr) { - spi_flash_select(); - spi_write_8(WRITE_ENABLE); - spi_flash_deselect(); - - spi_flash_select(); - spi_write_8(ERASE_4K); - spi_write_24(addr); - spi_flash_deselect(); - - wait_while_busy(); - } - - void SPIFlash::erase_sector_64k(uint32_t addr) { - spi_flash_select(); - spi_write_8(WRITE_ENABLE); - spi_flash_deselect(); - - spi_flash_select(); - spi_write_8(ERASE_64K); - spi_write_24(addr); - spi_flash_deselect(); - - wait_while_busy(); - } - - void SPIFlash::spi_write_begin(uint32_t addr) { - spi_flash_select(); - spi_write_8(WRITE_ENABLE); - spi_flash_deselect(); - - spi_flash_select(); - spi_write_8(PAGE_PROGRAM); - spi_write_24(addr); - } - - void SPIFlash::spi_write_end() { - spi_flash_deselect(); - wait_while_busy(); - } - - void SPIFlash::spi_read_begin(uint32_t addr) { - spi_flash_select(); - spi_write_8(READ_DATA); - spi_write_24(addr); - } - - void SPIFlash::spi_read_end() { - spi_flash_deselect(); - } - - void SPIFlash::erase_chip() { - spi_flash_select(); - spi_write_8(WRITE_ENABLE); - spi_flash_deselect(); - - spi_flash_select(); - spi_write_8(ERASE_CHIP); - spi_flash_deselect(); - wait_while_busy(); - } - - void SPIFlash::read_jedec_id(uint8_t &manufacturer_id, uint8_t &device_type, uint8_t &capacity) { - spi_flash_select(); - spi_write_8(READ_JEDEC_ID); - manufacturer_id = spi_recv(); - device_type = spi_recv(); - capacity = spi_recv(); - spi_flash_deselect (); - } - - /* This function writes "size" bytes from "data" starting at addr, while properly - * taking into account the special case of writing across a 256 byte page boundary. - * Returns the addr directly after the write. - */ - uint32_t SPIFlash::write(uint32_t addr, const void *_data, size_t size) { - const uint8_t *data = (const uint8_t*) _data; - while (size) { - const uint32_t page_start = addr & 0xFFFF00ul; - const uint32_t page_end = page_start + 256; - const uint32_t write_size = min(page_end - addr, size); - spi_write_begin(addr); - spi_write_bulk(data, write_size); - spi_write_end(); - addr += write_size; - size -= write_size; - data += write_size; - } - return addr; - } - - uint32_t SPIFlash::read(uint32_t addr, void *data, size_t size) { - spi_read_begin(addr); - spi_read_bulk(data, size); - spi_read_end(); - return addr + size; - } - - /********************************** UTILITY ROUTINES *********************************/ - - bool UIFlashStorage::check_known_device() { - uint8_t manufacturer_id, device_type, capacity; - read_jedec_id(manufacturer_id, device_type, capacity); - - const bool is_known = - ((manufacturer_id == 0xEF) && (device_type == 0x40) && (capacity == 0x15)) || // unknown - ((manufacturer_id == 0x01) && (device_type == 0x40) && (capacity == 0x15)) || // Cypress S25FL116K - ((manufacturer_id == 0xEF) && (device_type == 0x14) && (capacity == 0x15)) || // Winbond W25Q16JV - ((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ; // Adesto AT255F161 - - if (!is_known) { - 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); - } - - return is_known; - } - - void UIFlashStorage::initialize() { - for(uint8_t i = 0; i < 10; i++) { - if (check_known_device()) { - is_present = true; - break; - } - safe_delay(1000); - } - } - - /**************************** DATA STORAGE AREA (first 4K or 64k) ********************/ - - #ifdef DATA_STORAGE_SIZE_64K - constexpr uint32_t data_storage_area_size = 64 * 1024; // Large erase unit - #else - constexpr uint32_t data_storage_area_size = 4 * 1024; // Small erase unit - #endif - - /* In order to provide some degree of wear leveling, each data write to the - * SPI Flash chip is appended to data that was already written before, until - * the data storage area is completely filled. New data is written preceeded - * with a 32-bit delimiter 'LULZ', so that we can distinguish written and - * unwritten data: - * - * 'LULZ' <--- 1st record delimiter - * - * - * - * 'LULZ' <--- 2nd record delimiter - * - * - * - * ... - * 'LULZ' <--- Last record delimiter - * - * - * - * 0xFF <--- Start of free space - * 0xFF - * ... - * - * This function walks down the data storage area, verifying that the - * delimiters are either 'LULZ' or 0xFFFFFFFF. In the case that an invalid - * delimiter is found, this function returns -1, indicating that the Flash - * data is invalid (this will happen if the block_size changed with respect - * to earlier firmware). Otherwise, it returns the offset of the last - * valid delimiter 'LULZ', indicating the most recently written data. - */ - int32_t UIFlashStorage::get_config_read_offset(uint32_t block_size) { - uint16_t stride = 4 + block_size; - int32_t read_offset = -1; - - for(uint32_t offset = 0; offset < (data_storage_area_size - stride); offset += stride) { - uint32_t delim; - spi_read_begin(offset); - spi_read_bulk (&delim, sizeof(delim)); - spi_read_end(); - switch (delim) { - case 0xFFFFFFFFul: return read_offset; - case delimiter: read_offset = offset; break; - default: - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Invalid delimiter in Flash: ", delim); - return -1; - } - } - SERIAL_ECHO_MSG("No LULZ delimiter found."); - return -1; - } - - /* This function returns the offset at which new data should be - * appended, or -1 if the Flash needs to be erased */ - int32_t UIFlashStorage::get_config_write_offset(uint32_t block_size) { - int32_t read_offset = get_config_read_offset(block_size); - if (read_offset == -1) return -1; // The SPI flash is invalid - - int32_t write_offset = read_offset + 4 + block_size; - if ((write_offset + 4 + block_size) > data_storage_area_size) { - SERIAL_ECHO_MSG("Not enough free space in Flash."); - return -1; // Not enough free space - } - return write_offset; - } - - bool UIFlashStorage::verify_config_data(const void *data, size_t size) { - if (!is_present) return false; - - int32_t read_addr = get_config_read_offset(size); - if (read_addr == -1) return false; - - uint32_t delim; - spi_read_begin(read_addr); - spi_read_bulk (&delim, sizeof(delim)); - bool ok = spi_verify_bulk(data,size); - spi_read_end(); - return ok && delim == delimiter; - } - - bool UIFlashStorage::read_config_data(void *data, size_t size) { - if (!is_present) return false; - - int32_t read_addr = get_config_read_offset(size); - if (read_addr == -1) return false; - - uint32_t delim; - spi_read_begin(read_addr); - spi_read_bulk (&delim, sizeof(delim)); - spi_read_bulk (data, size); - spi_read_end(); - return delim == delimiter; - } - - void UIFlashStorage::write_config_data(const void *data, size_t size) { - if (!is_present) { - SERIAL_ECHO_MSG("SPI Flash chip not present. Not saving UI settings."); - return; - } - - // Since Flash storage has a limited number of write cycles, - // make sure that the data is different before rewriting. - - if (verify_config_data(data, size)) { - SERIAL_ECHO_MSG("UI settings already written, skipping write."); - return; - } - - int16_t write_addr = get_config_write_offset(size); - if (write_addr == -1) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Erasing UI settings from SPI Flash... "); - #ifdef DATA_STORAGE_SIZE_64K - erase_sector_64k(0); - #else - erase_sector_4k(0); - #endif - write_addr = 0; - SERIAL_ECHOLNPGM("DONE"); - } - - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Writing UI settings to SPI Flash (offset ", write_addr); - SERIAL_ECHOPGM(")..."); - - const uint32_t delim = delimiter; - write_addr = write(write_addr, &delim, sizeof(delim)); - write_addr = write(write_addr, data, size); - - SERIAL_ECHOLNPGM("DONE"); - } - - /************************** VERSIONING INFO AREA ************************/ - - /* The version info area follows the data storage area. If the version - * is incorrect, the data on the chip is invalid and format_flash should - * be called. - */ - - typedef struct { - uint32_t magic; - uint32_t version; - } flash_version_info; - - constexpr uint32_t version_info_addr = data_storage_area_size; - constexpr uint32_t version_info_size = 4 * 1024; // Small erase unit - - bool UIFlashStorage::is_valid() { - flash_version_info info; - - spi_read_begin(version_info_addr); - spi_read_bulk (&info, sizeof(flash_version_info)); - spi_read_end(); - - return info.magic == delimiter && info.version == flash_eeprom_version; - } - - void UIFlashStorage::write_version_info() { - flash_version_info info; - - info.magic = delimiter; - info.version = flash_eeprom_version; - - spi_write_begin(version_info_addr); - spi_write_bulk(&info, sizeof(flash_version_info)); - spi_write_end(); - } - - /**************************** MEDIA STORAGE AREA *****************************/ - - /* The media storage area follows the versioning info area. It consists - * of a file index followed by the data for one or more media files. - * - * The file index consists of an array of 32-bit file sizes. If a file - * is not present, the file's size will be set to 0xFFFFFFFF - */ - - constexpr uint32_t media_storage_addr = version_info_addr + version_info_size; - constexpr uint8_t media_storage_slots = 4; - - void UIFlashStorage::format_flash() { - SERIAL_ECHO_START(); SERIAL_ECHOPGM("Erasing SPI Flash..."); - SPIFlash::erase_chip(); - SERIAL_ECHOLNPGM("DONE"); - - write_version_info(); - } - - uint32_t UIFlashStorage::get_media_file_start(uint8_t slot) { - uint32_t addr = media_storage_addr + sizeof(uint32_t) * media_storage_slots; - spi_read_begin(media_storage_addr); - for(uint8_t i = 0; i < slot; i++) { - addr += spi_read_32(); - } - spi_read_end(); - return addr; - } - - void UIFlashStorage::set_media_file_size(uint8_t slot, uint32_t size) { - spi_write_begin(media_storage_addr + sizeof(uint32_t) * slot); - spi_write_32(size); - spi_write_end(); - } - - uint32_t UIFlashStorage::get_media_file_size(uint8_t slot) { - spi_read_begin(media_storage_addr + sizeof(uint32_t) * slot); - uint32_t size = spi_read_32(); - spi_read_end(); - return size; - } - - /* Writes a media file from the SD card/USB flash drive into a slot on the SPI Flash. Media - * files must be written sequentially following by a chip erase and it is not possible to - * overwrite files. */ - UIFlashStorage::error_t UIFlashStorage::write_media_file(progmem_str filename, uint8_t slot) { - #if ENABLED(SDSUPPORT) - uint32_t addr; - uint8_t buff[write_page_size]; - - strcpy_P( (char*) buff, (const char*) filename); - - MediaFileReader reader; - if (!reader.open((char*) buff)) { - SERIAL_ECHO_MSG("Unable to find media file"); - return FILE_NOT_FOUND; - } - - if (get_media_file_size(slot) != 0xFFFFFFFFUL) { - SERIAL_ECHO_MSG("Media file already exists"); - return WOULD_OVERWRITE; - } - - SERIAL_ECHO_START(); SERIAL_ECHOPGM("Writing SPI Flash..."); - - set_media_file_size(slot, reader.size()); - addr = get_media_file_start(slot); - - // Write out the file itself - for(;;) { - const int16_t nBytes = reader.read(buff, write_page_size); - if (nBytes == -1) { - SERIAL_ECHOLNPGM("Failed to read from file"); - return READ_ERROR; - } - - addr = write(addr, buff, nBytes); - if (nBytes != write_page_size) - break; - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::yield(); - #endif - } - - SERIAL_ECHOLNPGM("DONE"); - - SERIAL_ECHO_START(); SERIAL_ECHOPGM("Verifying SPI Flash..."); - - bool verifyOk = true; - - // Verify the file index - - if (get_media_file_start(slot+1) != (get_media_file_start(slot) + reader.size())) { - SERIAL_ECHOLNPGM("File index verification failed. "); - verifyOk = false; - } - - // Verify the file itself - addr = get_media_file_start(slot); - reader.rewind(); - - while (verifyOk) { - const int16_t nBytes = reader.read(buff, write_page_size); - if (nBytes == -1) { - SERIAL_ECHOPGM("Failed to read from file"); - verifyOk = false; - break; - } - - spi_read_begin(addr); - if (!spi_verify_bulk(buff, nBytes)) { - verifyOk = false; - spi_read_end(); - break; - } - spi_read_end(); - - addr += nBytes; - if (nBytes != write_page_size) break; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::yield(); - #endif - }; - - if (verifyOk) { - SERIAL_ECHOLNPGM("DONE"); - return SUCCESS; - } else { - SERIAL_ECHOLNPGM("FAIL"); - return VERIFY_ERROR; - } - #else - return VERIFY_ERROR; - #endif // ENABLED(SDSUPPORT) - } - - bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) { - if (!is_present) return false; - - bytes_remaining = get_media_file_size(slot); - if (bytes_remaining != 0xFFFFFFFFUL) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining); - addr = get_media_file_start(slot); - return true; - } - return false; - } - - int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) { - if (bytes_remaining == 0xFFFFFFFFUL) return -1; - - if (size > bytes_remaining) - return read(data, bytes_remaining); - - if (size > 0) { - spi_read_begin(addr); - spi_read_bulk(data, size); - spi_read_end(); - addr += size; - bytes_remaining -= size; - } - - return size; - } - - int16_t UIFlashStorage::BootMediaReader::read(void *obj, void *data, const size_t size) { - return reinterpret_cast(obj)->read(data, size); - } - -#else - void UIFlashStorage::initialize() {} - bool UIFlashStorage::is_valid() {return true;} - void UIFlashStorage::write_config_data(const void *, size_t) {} - bool UIFlashStorage::verify_config_data(const void *, size_t) {return false;} - bool UIFlashStorage::read_config_data(void *, size_t ) {return false;} - UIFlashStorage::error_t UIFlashStorage::write_media_file(progmem_str, uint8_t) {return FILE_NOT_FOUND;} - void UIFlashStorage::format_flash() {} - - bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t) {return false;} - int16_t UIFlashStorage::BootMediaReader::read(void *, const size_t) {return -1;} - int16_t UIFlashStorage::BootMediaReader::read(void *, void *, const size_t) {return -1;} -#endif // SPI_FLASH_SS -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h deleted file mode 100644 index 2917cb0b1e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h +++ /dev/null @@ -1,106 +0,0 @@ -/******************* - * flash_storage.h * - *******************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -class SPIFlash { - public: - static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit - static constexpr uint32_t write_page_size = 256; // Minimum page write unit - - enum { - READ_STATUS_1 = 0x05, - READ_STATUS_2 = 0x35, - READ_STATUS_3 = 0x33, - WRITE_ENABLE = 0x06, - WRITE_DISABLE = 0x04, - READ_ID = 0x90, - READ_JEDEC_ID = 0x9F, - READ_DATA = 0x03, - PAGE_PROGRAM = 0x02, - ERASE_4K = 0x20, - ERASE_64K = 0xD8, - ERASE_CHIP = 0xC7 - }; - - static void wait_while_busy(); - static void erase_sector_4k(uint32_t addr); - static void erase_sector_64k(uint32_t addr); - static void erase_chip (); - - static void read_jedec_id(uint8_t &manufacturer_id, uint8_t &device_type, uint8_t &capacity); - - static void spi_read_begin(uint32_t addr); - static void spi_read_end(); - - static void spi_write_begin(uint32_t addr); - static void spi_write_end(); - - static uint32_t write(uint32_t addr, const void *data, size_t size); - static uint32_t read(uint32_t addr, void *data, size_t size); -}; - -class UIFlashStorage : private SPIFlash { - private: - - static bool is_present; - static int32_t get_config_read_offset(uint32_t block_size); - static int32_t get_config_write_offset(uint32_t block_size); - - static uint32_t get_media_file_start(uint8_t slot); - static void set_media_file_size(uint8_t slot, uint32_t size); - static uint32_t get_media_file_size(uint8_t slot); - - static constexpr uint32_t delimiter = 0x4D524C4E; // 'MRLN' - public: - enum error_t { - SUCCESS, - FILE_NOT_FOUND, - READ_ERROR, - VERIFY_ERROR, - WOULD_OVERWRITE - }; - - static void initialize (); - static void format_flash (); - static bool check_known_device(); - - static bool is_valid (); - static void write_version_info(); - - static void write_config_data (const void *data, size_t size); - static bool verify_config_data (const void *data, size_t size); - static bool read_config_data (void *data, size_t size); - static error_t write_media_file (progmem_str filename, uint8_t slot = 0); - - class BootMediaReader; -}; - -class UIFlashStorage::BootMediaReader { - private: - uint32_t addr; - uint32_t bytes_remaining; - - public: - bool isAvailable(uint32_t slot = 0); - int16_t read(void *buffer, size_t const size); - - static int16_t read(void *obj, void *buffer, const size_t size); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp deleted file mode 100644 index 68886166c2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/************************ - * media_filereader.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 "../compat.h" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - #include "media_file_reader.h" - - #if ENABLED(SDSUPPORT) - bool MediaFileReader::open(const char* filename) { - card.init(SPI_SPEED, SDSS); - volume.init(&card); - root.openRoot(&volume); - return file.open(&root, filename, O_READ); - } - - int16_t MediaFileReader::read(void *buff, size_t bytes) { - return file.read(buff, bytes); - } - - void MediaFileReader::close() { - file.close(); - } - - uint32_t MediaFileReader::size() { - return file.fileSize(); - } - - void MediaFileReader::rewind() { - file.rewind(); - } - - int16_t MediaFileReader::read(void *obj, void *buff, size_t bytes) { - return reinterpret_cast(obj)->read(buff, bytes); - } - #else - bool MediaFileReader::open(const char*) {return -1;} - int16_t MediaFileReader::read(void *, size_t) {return 0;} - void MediaFileReader::close() {} - uint32_t MediaFileReader::size() {return 0;} - void MediaFileReader::rewind() {} - int16_t MediaFileReader::read(void *, void *, size_t) {return 0;} - #endif -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h deleted file mode 100644 index d64182fd5b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ /dev/null @@ -1,48 +0,0 @@ -/********************** - * media_filereader.h * - **********************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#include "../../../../../inc/MarlinConfigPre.h" - -#if ENABLED(SDSUPPORT) - #include "../../../../../sd/SdFile.h" - #include "../../../../../sd/cardreader.h" -#endif - -class MediaFileReader { - private: - #if ENABLED(SDSUPPORT) - Sd2Card card; - SdVolume volume; - SdFile root, file; - #endif - - public: - bool open(const char* filename); - int16_t read(void *buff, size_t bytes); - uint32_t size(); - void rewind(); - void close(); - - static int16_t read(void *obj, void *buff, size_t bytes); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h deleted file mode 100644 index 90fd615a5d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h +++ /dev/null @@ -1,48 +0,0 @@ -/************ - * compat.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 - -/** - * This following provides compatibility whether compiling - * as a part of Marlin or outside it - */ - -#ifdef __has_include - #if __has_include("../../ui_api.h") - #include "../../ui_api.h" - #endif -#else - #include "../../ui_api.h" -#endif - -#ifdef __MARLIN_FIRMWARE__ - // __MARLIN_FIRMWARE__ exists when compiled within Marlin. - #include "pin_mappings.h" -#else - namespace UI { - static inline uint32_t safe_millis() {return millis();}; - static inline void yield() {}; - }; -#endif - -class __FlashStringHelper; -typedef const __FlashStringHelper *progmem_str; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h deleted file mode 100644 index 458c901206..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h +++ /dev/null @@ -1,124 +0,0 @@ -/************ - * config.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 - -#include "compat.h" - -// Define the display board used (see "ftdi_eve_boards.h" for definitions) - -//#define LCD_FTDI_VM800B35A // FTDI 3.5" 320x240 with FT800 -//#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 User Interface - -// Leave the following commented out to use a board's default resolution. -// If you have changed the LCD panel, you may override the resolution -// below (see "ftdi_eve_resolutions.h" for definitions): - -//#define TOUCH_UI_320x240 -//#define TOUCH_UI_480x272 -//#define TOUCH_UI_800x480 - -// Define the printer interface or pins used (see "ui_pin_mappings.h" for definitions): - -//#define CR10_TFT_PINMAP -//#define AO_EXP1_DEPRECATED_PINMAP // UltraLCD EXP1 connector, old AlephObject's wiring -//#define AO_EXP1_PINMAP // UltraLCD EXP1 connector, new AlephObject's wiring -//#define AO_EXP2_PINMAP // UltraLCD EXP2 connector, new AlephObject's wiring -//#define OTHER_PIN_LAYOUT - -// Otherwise. Define all the pins manually: - -#ifdef OTHER_PIN_LAYOUT - // Select interfacing pins, the following pin specifiers are supported: - // - // ARDUINO_DIGITAL_1 - Arduino pin via digitalWrite/digitalRead - // AVR_A1 - Fast AVR port access via PORTA/PINA/DDRA - // 1 - When compiling Marlin, use Marlin pin IDs. - - // 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 - #ifdef CLCD_USE_SOFT_SPI - #define CLCD_SOFT_SPI_MOSI 11 - #define CLCD_SOFT_SPI_MISO 12 - #define CLCD_SOFT_SPI_SCLK 13 - #endif -#endif - -// Defines how to orient the display. An inverted (i.e. upside-down) display -// is supported on the FT800. The FT810 or better also support a portrait -// and mirrored orientation. -//#define TOUCH_UI_INVERTED -//#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 - -// The timeout (in ms) to return to the status screen from sub-menus -//#define LCD_TIMEOUT_TO_STATUS 15000 - -// Enable this to debug the event framework -//#define TOUCH_UI_DEBUG - -// Enable the developer's menu and screens -//#define DEVELOPER_SCREENS - -// Sets the SPI speed in Hz - -#define SPI_FREQUENCY 8000000 >> SPI_SPEED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt deleted file mode 100644 index 94a9ed024d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md deleted file mode 100644 index 6ba985d600..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md +++ /dev/null @@ -1,28 +0,0 @@ -FTDI EVE Library ----------------- - -The FTDI EVE Library is a fully open-source library and UI framework for the FTDI -FT800 and FT810 graphics processor. - -Although the library has been developed within Lulzbot for providing a user interface -for Marlin, the library has been written so that it can be used in any Arduino sketch. - -The library is split into two parts. The "basic" API provides a shallow interface to -the underlying FTDI hardware and command FIFO and provides low-level access to the -hardware as closely as possible to the API described in the FTDI Programmer's Guide. - -The "extended" API builds on top of the "basic" API to provide a GUI framework for -handling common challenges in building a usable GUI. The GUI framework provides the -following features: - -- Macros for a resolution-independent placement of widgets based on a grid. -- Class-based UI screens, with press and unpress touch events, as well as touch repeat. -- Event loop with button debouncing and button push visual and auditory feedback. -- Easy screen-to-screen navigation including a navigation stack for going backwards. -- Visual feedback for disabled vs enabled buttons, and custom button styles. -- A sound player class for playing individual notes or complete sound sequences. -- Display list caching, for storing static background elements of a screen in RAM_G. - -See the "examples" folder for Arduino sketches. Modify the "src/config.h" file in -each to suit your particular setup. The "sample_configs" contain sample configuration -files for running the sketches on our 3D printer boards. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h deleted file mode 100644 index 1863d0ec29..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h +++ /dev/null @@ -1,183 +0,0 @@ -/************ - * boards.h * - ************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#define HAS_RESOLUTION (defined(TOUCH_UI_320x240) || defined(TOUCH_UI_480x272) || defined(TOUCH_UI_800x480)) - -#define IS_FT800 \ - constexpr uint16_t ftdi_chip = 800; \ - using namespace FTDI_FT800; \ - namespace DL { \ - using namespace FTDI_FT800_DL; \ - } \ - typedef ft800_memory_map ftdi_memory_map; \ - typedef ft800_registers ftdi_registers; - -#define IS_FT810 \ - constexpr uint16_t ftdi_chip = 810; \ - using namespace FTDI_FT810; \ - namespace DL { \ - using namespace FTDI_FT800_DL; \ - using namespace FTDI_FT810_DL; \ - } \ - typedef ft810_memory_map ftdi_memory_map; \ - typedef ft810_registers ftdi_registers; - - -#ifdef LCD_FTDI_VM800B35A - #if !HAS_RESOLUTION - #define TOUCH_UI_320x240 - #endif - #ifndef FTDI_API_LEVEL - #define FTDI_API_LEVEL 800 - #endif - namespace FTDI { - IS_FT800 - constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated - constexpr bool GPIO_0_Audio_Enable = false; /* 1 = does use GPIO00 for amplifier control, 0 = not in use for Audio */ - constexpr bool GPIO_1_Audio_Shutdown = true; /* 1 = does use GPIO01 for amplifier control, 0 = not in use for Audio */ - constexpr uint8_t Swizzle = 2; - constexpr uint8_t CSpread = 1; - - constexpr uint16_t touch_threshold = 1200; /* touch-sensitivity */ - } - -/* - * Settings for the Haoyu Electronics, 4.3" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY43B) - * Haoyu Electronics, 5" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY50B) - * - * http://www.hotmcu.com/43-graphical-lcd-touchscreen-480x272-spi-ft800-p-111.html?cPath=6_16 - * http://www.hotmcu.com/5-graphical-lcd-touchscreen-480x272-spi-ft800-p-124.html?cPath=6_16 - * - * Datasheet: - * - * http://www.hantronix.com/files/data/1278363262430-3.pdf - * http://www.haoyuelectronics.com/Attachment/HY43-LCD/LCD%20DataSheet.pdf - * http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf - * - */ - -#elif defined(LCD_HAOYU_FT800CB) - #if !HAS_RESOLUTION - #define TOUCH_UI_480x272 - #endif - #ifndef FTDI_API_LEVEL - #define FTDI_API_LEVEL 800 - #endif - namespace FTDI { - IS_FT800 - constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated - constexpr bool GPIO_0_Audio_Enable = false; - constexpr bool GPIO_1_Audio_Shutdown = false; - constexpr uint8_t Swizzle = 0; - constexpr uint8_t CSpread = 1; - constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ - } - -/* - * Settings for the Haoyu Electronics, 5" Graphical LCD Touchscreen, 800x480, SPI, FT810 - * - * http://www.hotmcu.com/5-graphical-lcd-touchscreen-800x480-spi-ft810-p-286.html - * - * Datasheet: - * - * http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf - * - */ - -#elif defined(LCD_HAOYU_FT810CB) - #if !HAS_RESOLUTION - #define TOUCH_UI_800x480 - #endif - #ifndef FTDI_API_LEVEL - #define FTDI_API_LEVEL 810 - #endif - namespace FTDI { - IS_FT810 - constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated - constexpr bool GPIO_0_Audio_Enable = false; - constexpr bool GPIO_1_Audio_Shutdown = false; - constexpr uint8_t Swizzle = 0; - constexpr uint8_t CSpread = 1; - constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ - } - -/* - * Settings for the 4D Systems, 4.3" Embedded SPI Display 480x272, SPI, FT800 (4DLCD-FT843) - * - * http://www.4dsystems.com.au/product/4DLCD_FT843/ - * - * Datasheet: - * - * http://www.4dsystems.com.au/productpages/4DLCD-FT843/downloads/FT843-4.3-Display_datasheet_R_1_2.pdf - * - */ - -#elif defined(LCD_4DSYSTEMS_4DLCD_FT843) - #if !HAS_RESOLUTION - #define TOUCH_UI_480x272 - #endif - #ifndef FTDI_API_LEVEL - #define FTDI_API_LEVEL 800 - #endif - namespace FTDI { - IS_FT800 - constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated - constexpr bool GPIO_0_Audio_Enable = false; - constexpr bool GPIO_1_Audio_Shutdown = true; - constexpr uint8_t Swizzle = 0; - constexpr uint8_t CSpread = 1; - constexpr uint16_t touch_threshold = 1200; /* touch-sensitivity */ - } - -/* - * Settings for the Aleph Objects Color LCD User Interface - * - * https://code.alephobjects.com/source/aotctl/ - * - * Datasheet: - * - * http://www.hantronix.com/files/data/s1501799605s500-gh7.pdf - * - */ -#elif defined(LCD_ALEPHOBJECTS_CLCD_UI) - #if !HAS_RESOLUTION - #define TOUCH_UI_800x480 - #endif - #ifndef FTDI_API_LEVEL - #define FTDI_API_LEVEL 810 - #endif - namespace FTDI { - IS_FT810 - constexpr bool Use_Crystal = false; // 0 = use internal oscillator, 1 = module has a crystal populated - constexpr bool GPIO_0_Audio_Enable = true; // The AO CLCD uses GPIO0 to enable audio - constexpr bool GPIO_1_Audio_Shutdown = false; - constexpr uint8_t Swizzle = 0; - constexpr uint8_t CSpread = 0; - constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ - } - -#else - - #error Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify "ftdi_eve_boards.h" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp deleted file mode 100644 index d21511856f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ /dev/null @@ -1,1188 +0,0 @@ -/**************** - * commands.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 "ftdi_basic.h" - -#ifdef FTDI_BASIC - -#define MULTIPLE_OF_4(val) ((((val)+3)>>2)<<2) - -using namespace FTDI; -using namespace FTDI::SPI; - -void CLCD::enable() { - mem_write_8(REG::PCLK, Pclk); -} - -void CLCD::disable() { - mem_write_8(REG::PCLK, 0x00); -} - -void CLCD::set_brightness(uint8_t brightness) { - mem_write_8(REG::PWM_DUTY, min(128,brightness)); -} - -uint8_t CLCD::get_brightness() { - return mem_read_8(REG::PWM_DUTY); -} - -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); -} - -uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const { - uint16_t width = 0; - const uint8_t *p = (const uint8_t *) str; - for(;;) { - const uint8_t val = *p++; n--; - if (!val || n == 0) break; - width += val < 128 ? char_widths[val] : 0; - } - return width; -} - -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(;;) { - const uint8_t val = pgm_read_byte(p++); n--; - if (!val || n == 0) break; - width += val < 128 ? char_widths[val] : 0; - } - return width; -} - -/************************** HOST COMMAND FUNCTION *********************************/ - -void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) { // Sends 24-Bit Host Command to LCD - if (host_command != ACTIVE) { - host_command |= 0x40; - } - spi_ftdi_select(); - spi_send(host_command); - spi_send(byte2); - spi_send(0x00); - spi_ftdi_deselect(); -} - -/************************** MEMORY READ FUNCTIONS *********************************/ - -void CLCD::spi_read_addr (uint32_t reg_address) { - spi_send((reg_address >> 16) & 0x3F); // Address [21:16] - spi_send((reg_address >> 8 ) & 0xFF); // Address [15:8] - spi_send((reg_address >> 0) & 0xFF); // Address [7:0] - spi_send(0x00); // Dummy Byte -} - -// Write 4-Byte Address, Read Multiple Bytes -void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) { - spi_ftdi_select(); - spi_read_addr(reg_address); - spi_read_bulk (data, len); - spi_ftdi_deselect(); -} - -// Write 4-Byte Address, Read 1-Byte Data -uint8_t CLCD::mem_read_8 (uint32_t reg_address) { - spi_ftdi_select(); - spi_read_addr(reg_address); - uint8_t r_data = spi_read_8(); - spi_ftdi_deselect(); - return r_data; -} - -// Write 4-Byte Address, Read 2-Bytes Data -uint16_t CLCD::mem_read_16 (uint32_t reg_address) { - using namespace SPI::least_significant_byte_first; - spi_ftdi_select(); - spi_read_addr(reg_address); - uint16_t r_data = spi_read_16(); - spi_ftdi_deselect(); - return r_data; -} - -// Write 4-Byte Address, Read 4-Bytes Data -uint32_t CLCD::mem_read_32 (uint32_t reg_address) { - using namespace SPI::least_significant_byte_first; - spi_ftdi_select(); - spi_read_addr(reg_address); - uint32_t r_data = spi_read_32(); - spi_ftdi_deselect(); - return r_data; -} - -/************************** MEMORY WRITE FUNCTIONS *********************************/ - -// Generic operations for transforming a byte, for use with _mem_write_bulk: -static inline uint8_t reverse_byte(uint8_t a) { - return ((a & 0x1) << 7) | ((a & 0x2) << 5) | - ((a & 0x4) << 3) | ((a & 0x8) << 1) | - ((a & 0x10) >> 1) | ((a & 0x20) >> 3) | - ((a & 0x40) >> 5) | ((a & 0x80) >> 7); -} -static inline uint8_t xbm_write(const uint8_t *p) {return reverse_byte(pgm_read_byte(p));} - -void CLCD::spi_write_addr (uint32_t reg_address) { - spi_send((reg_address >> 16) | 0x80); // Address [21:16] - spi_send((reg_address >> 8 ) & 0xFF); // Address [15:8] - spi_send((reg_address >> 0) & 0xFF); // Address [7:0] -} - -// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from RAM -void CLCD::mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_bulk(data, len, padding); - spi_ftdi_deselect(); -} - -// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM -void CLCD::mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding) { - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_bulk(str, len, padding); - spi_ftdi_deselect(); -} - - // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM -void CLCD::mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_bulk(data, len, padding); - spi_ftdi_deselect(); -} - -// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) -void CLCD::mem_write_xbm (uint32_t reg_address, progmem_str data, uint16_t len, uint8_t padding) { - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_bulk(data, len, padding); - spi_ftdi_deselect(); -} - -// Write 3-Byte Address, Write 1-Byte Data -void CLCD::mem_write_8 (uint32_t reg_address, uint8_t data) { - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_8(data); - spi_ftdi_deselect(); -} - -// Write 3-Byte Address, Write 2-Bytes Data -void CLCD::mem_write_16 (uint32_t reg_address, uint16_t data) { - using namespace SPI::least_significant_byte_first; - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_32(data); - spi_ftdi_deselect(); -} - -// Write 3-Byte Address, Write 4-Bytes Data -void CLCD::mem_write_32 (uint32_t reg_address, uint32_t data) { - using namespace SPI::least_significant_byte_first; - spi_ftdi_select(); - spi_write_addr(reg_address); - spi_write_32(data); - spi_ftdi_deselect(); -} - -/******************* FT800/810 Co-processor Commands *********************************/ - -#if FTDI_API_LEVEL == 800 -uint32_t CLCD::CommandFifo::command_write_ptr = 0xFFFFFFFFul; -#endif - -void CLCD::CommandFifo::cmd(uint32_t cmd32) { - write((void*)&cmd32, sizeof(uint32_t)); -} - -void CLCD::CommandFifo::cmd(void* data, uint16_t len) { - write(data, len); -} - -void CLCD::CommandFifo::bgcolor(uint32_t rgb) { - cmd(CMD_BGCOLOR); - cmd(rgb); -} - -void CLCD::CommandFifo::fgcolor(uint32_t rgb) { - cmd(CMD_FGCOLOR); - cmd(rgb); -} - -void CLCD::CommandFifo::gradcolor(uint32_t rgb) { - cmd(CMD_GRADCOLOR); - cmd(rgb); -} - -// This sends the a text command to the command preprocessor, must be followed by str() -void CLCD::CommandFifo::button(int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t option) { - struct { - int32_t type = CMD_BUTTON; - int16_t x; - int16_t y; - int16_t w; - int16_t h; - int16_t font; - uint16_t option; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.font = font; - cmd_data.option = option; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -// This sends the a text command to the command preprocessor, must be followed by str() -void CLCD::CommandFifo::text(int16_t x, int16_t y, int16_t font, uint16_t options) { - struct { - int32_t type = CMD_TEXT; - int16_t x; - int16_t y; - int16_t font; - uint16_t options; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.font = font; - cmd_data.options = options; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -// This sends the a toggle command to the command preprocessor, must be followed by str() -void CLCD::CommandFifo::toggle (int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state) { - struct { - int32_t type = CMD_TOGGLE; - int16_t x; - int16_t y; - int16_t w; - int16_t font; - uint16_t options; - uint16_t state; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.font = font; - cmd_data.options = options; - cmd_data.state = state ? 65535 : 0; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -// This sends the a keys command to the command preprocessor, must be followed by str() -void CLCD::CommandFifo::keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options) { - struct { - int32_t type = CMD_KEYS; - int16_t x; - int16_t y; - int16_t w; - int16_t h; - int16_t font; - uint16_t options; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.font = font; - cmd_data.options = options; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::clock (int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms) -{ - struct { - int32_t type = CMD_CLOCK; - int16_t x; - int16_t y; - int16_t r; - uint16_t options; - int16_t h; - int16_t m; - int16_t s; - int16_t ms; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.r = r; - cmd_data.options = options; - cmd_data.h = h; - cmd_data.m = m; - cmd_data.s = s; - cmd_data.ms = ms; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::gauge (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range) -{ - struct { - int32_t type = CMD_GAUGE; - int16_t x; - int16_t y; - int16_t r; - uint16_t options; - uint16_t major; - uint16_t minor; - uint16_t val; - uint16_t range; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.r = r; - cmd_data.options = options; - cmd_data.major = major; - cmd_data.minor = minor; - cmd_data.val = val; - cmd_data.range = range; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::dial (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val) -{ - struct { - int32_t type = CMD_DIAL; - int16_t x; - int16_t y; - int16_t r; - uint16_t options; - uint16_t val; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.r = r; - cmd_data.options = options; - cmd_data.val = val; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range) { - struct { - int32_t type = CMD_SCROLLBAR; - int16_t x; - int16_t y; - int16_t w; - uint16_t h; - uint16_t options; - uint16_t val; - uint16_t size; - uint16_t range; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.options = options; - cmd_data.val = val; - cmd_data.size = size; - cmd_data.range = range; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::progress (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) { - struct { - int32_t type = CMD_PROGRESS; - int16_t x; - int16_t y; - int16_t w; - int16_t h; - uint16_t options; - uint16_t val; - uint16_t range; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.options = options; - cmd_data.val = val; - cmd_data.range = range; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::slider (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) { - struct { - int32_t type = CMD_SLIDER; - int16_t x; - int16_t y; - int16_t w; - int16_t h; - uint16_t options; - uint16_t val; - uint16_t range; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.options = options; - cmd_data.val = val; - cmd_data.range = range; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) { - struct { - int32_t type = CMD_GRADIENT; - int16_t x0; - int16_t y0; - uint32_t rgb0; - int16_t x1; - int16_t y1; - uint32_t rgb1; - } cmd_data; - - cmd_data.x0 = x0; - cmd_data.y0 = y0; - cmd_data.rgb0 = rgb0; - cmd_data.x1 = x1; - cmd_data.y1 = y1; - cmd_data.rgb1 = rgb1; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::number (int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n) { - struct { - int32_t type = CMD_NUMBER; - int16_t x; - int16_t y; - int16_t font; - uint16_t options; - int16_t n; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.font = font; - cmd_data.options = options; - cmd_data.n = n; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) { - struct { - uint32_t type = CMD_MEMZERO; - uint32_t ptr; - uint32_t size; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.size = size; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) { - struct { - uint32_t type = CMD_MEMSET; - uint32_t ptr; - uint32_t val; - uint32_t size; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.val = val; - cmd_data.size = size; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) { - struct { - uint32_t type = CMD_MEMCPY; - uint32_t dst; - uint32_t src; - uint32_t size; - } cmd_data; - - cmd_data.dst = dst; - cmd_data.src = src; - cmd_data.size = size; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) { - struct { - uint32_t type = CMD_MEMCRC; - uint32_t ptr; - uint32_t num; - uint32_t result; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.num = num; - cmd_data.result = result; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) { - struct { - uint32_t type = CMD_MEMWRITE; - uint32_t ptr; - uint32_t num; - uint32_t value; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.num = 4; - cmd_data.value = value; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) { - struct { - uint32_t type = CMD_APPEND; - uint32_t ptr; - uint32_t size; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.size = size; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::inflate (uint32_t ptr) { - struct { - uint32_t type = CMD_INFLATE; - uint32_t ptr; - } cmd_data; - - cmd_data.ptr = ptr; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::getptr (uint32_t result) { - struct { - uint32_t type = CMD_GETPTR; - uint32_t result; - } cmd_data; - - cmd_data.result = result; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::track(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t tag) { - struct { - uint32_t type = CMD_TRACK; - int16_t x; - int16_t y; - int16_t w; - int16_t h; - int16_t tag; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.tag = tag; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::sketch(int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format) { - struct { - uint32_t type = CMD_SKETCH; - int16_t x; - int16_t y; - uint16_t w; - uint16_t h; - uint32_t ptr; - uint16_t format; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.ptr = ptr; - cmd_data.format = format; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::snapshot(uint32_t ptr) { - struct { - uint32_t type = CMD_SNAPSHOT; - uint32_t ptr; - } cmd_data; - - cmd_data.ptr = ptr; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::spinner(int16_t x, int16_t y, uint16_t style, uint16_t scale) { - struct { - uint32_t type = CMD_SPINNER; - uint16_t x; - uint16_t y; - uint16_t style; - uint16_t scale; - } cmd_data; - - cmd_data.x = x; - cmd_data.y = y; - cmd_data.style = style; - cmd_data.scale = scale; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::loadimage(uint32_t ptr, uint32_t options) { - struct { - uint32_t type = CMD_LOADIMAGE; - uint32_t ptr; - uint32_t options; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.options = options; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::getprops (uint32_t ptr, uint32_t width, uint32_t height) { - struct { - uint32_t type = CMD_GETPROPS; - uint32_t ptr; - uint32_t width; - uint32_t height; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.width = width; - cmd_data.height = height; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::scale(int32_t sx, int32_t sy) { - struct { - uint32_t type = CMD_SCALE; - int32_t sx; - int32_t sy; - } cmd_data; - - cmd_data.sx = sx; - cmd_data.sy = sy; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::rotate(int32_t a) { - struct { - uint32_t type = CMD_ROTATE; - int32_t a; - } cmd_data; - - cmd_data.a = a; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) { - struct { - uint32_t type = CMD_TRANSLATE; - int32_t tx; - int32_t ty; - } cmd_data; - - cmd_data.tx = tx; - cmd_data.ty = ty; - - cmd( &cmd_data, sizeof(cmd_data) ); -} - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::setbase (uint8_t base) { - struct { - int32_t type = CMD_SETBASE; - uint32_t base; - } cmd_data; - - cmd_data.base = base; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::setbitmap(uint32_t addr, uint16_t fmt, uint16_t w, uint16_t h) { - struct { - uint32_t type = CMD_SETBITMAP; - uint32_t addr; - uint16_t fmt; - uint16_t w; - uint16_t h; - uint16_t dummy; - } cmd_data; - - cmd_data.addr = addr; - cmd_data.fmt = fmt; - cmd_data.w = w; - cmd_data.h = h; - cmd_data.dummy = 0; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::snapshot2(uint32_t format, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h) { - struct { - uint32_t type = CMD_SNAPSHOT2; - uint32_t format; - uint32_t ptr; - int16_t x; - int16_t y; - uint16_t w; - uint16_t h; - } cmd_data; - - cmd_data.format = format; - cmd_data.ptr = ptr; - cmd_data.x = x; - cmd_data.y = y; - cmd_data.w = w; - cmd_data.h = h; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::mediafifo(uint32_t ptr, uint32_t size) { - struct { - uint32_t type = CMD_MEDIAFIFO; - uint32_t ptr; - uint32_t size; - } cmd_data; - - cmd_data.ptr = ptr; - cmd_data.size = size; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::videostart() { - cmd( CMD_VIDEOSTART ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::videoframe(uint32_t dst, uint32_t ptr) { - struct { - uint32_t type = CMD_VIDEOFRAME; - uint32_t dst; - uint32_t ptr; - } cmd_data; - - cmd_data.dst = dst; - cmd_data.ptr = ptr; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::playvideo(uint32_t options) { - struct { - uint32_t type = CMD_PLAYVIDEO; - uint32_t options; - } cmd_data; - - cmd_data.options = options; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#endif - -#if FTDI_API_LEVEL >= 810 -void CLCD::CommandFifo::setrotate (uint8_t rotation) { - struct { - uint32_t type = CMD_SETROTATE; - uint32_t rotation; - } cmd_data; - - cmd_data.rotation = rotation; - - cmd( &cmd_data, sizeof(cmd_data) ); -} -#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() { - return (mem_read_32(REG::CMD_READ) & 0x0FFF) != (mem_read_32(REG::CMD_WRITE) & 0x0FFF); -} - -bool CLCD::CommandFifo::has_fault() { - uint16_t Cmd_Read_Reg = mem_read_32(REG::CMD_READ) & 0x0FFF; - return Cmd_Read_Reg == 0x0FFF; -} - -#if FTDI_API_LEVEL == 800 -void CLCD::CommandFifo::start() { - if (command_write_ptr == 0xFFFFFFFFul) { - command_write_ptr = mem_read_32(REG::CMD_WRITE) & 0x0FFF; - } -} - -void CLCD::CommandFifo::execute() { - if (command_write_ptr != 0xFFFFFFFFul) { - mem_write_32(REG::CMD_WRITE, command_write_ptr); - } -} - -void CLCD::CommandFifo::reset() { - safe_delay(100); - mem_write_32(REG::CPURESET, 0x00000001); - mem_write_32(REG::CMD_WRITE, 0x00000000); - mem_write_32(REG::CMD_READ, 0x00000000); - mem_write_32(REG::CPURESET, 0x00000000); - safe_delay(300); - command_write_ptr = 0xFFFFFFFFul; -}; - -template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len) { - const char *ptr = (const char*)data; - uint32_t bytes_tail, bytes_head; - uint32_t command_read_ptr; - - #if ENABLED(TOUCH_UI_DEBUG) - if (command_write_ptr == 0xFFFFFFFFul) { - SERIAL_ECHO_MSG("Attempt to write to FIFO before CommandFifo::Cmd_Start()."); - } - #endif - - /* Wait until there is enough space in the circular buffer for the transfer */ - do { - command_read_ptr = mem_read_32(REG::CMD_READ) & 0x0FFF; - if (command_read_ptr <= command_write_ptr) { - bytes_tail = 4096U - command_write_ptr; - bytes_head = command_read_ptr; - } else { - bytes_tail = command_read_ptr - command_write_ptr; - bytes_head = 0; - } - // Check for faults which can lock up the command processor - if (has_fault()) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHOLNPGM("Fault waiting for space in the command processor"); - #endif - return false; - } - } while ((bytes_tail + bytes_head) < len); - - /* Write as many bytes as possible following REG::CMD_WRITE */ - uint16_t bytes_to_write = min(len, bytes_tail); - mem_write_bulk (MAP::RAM_CMD + command_write_ptr, T(ptr), bytes_to_write); - command_write_ptr += bytes_to_write; - ptr += bytes_to_write; - len -= bytes_to_write; - - if (len > 0) { - /* Write remaining bytes at start of circular buffer */ - mem_write_bulk (MAP::RAM_CMD, T(ptr), len); - command_write_ptr = len; - } - - if (command_write_ptr == 4096U) { - command_write_ptr = 0; - } - return true; -} - -// Writes len bytes into the FIFO, if len is not -// divisible by four, zero bytes will be written -// to align to the boundary. - -template bool CLCD::CommandFifo::write(T data, uint16_t len) { - const uint8_t padding = MULTIPLE_OF_4(len) - len; - - uint8_t pad_bytes[] = {0, 0, 0, 0}; - return _write_unaligned(data, len) && - _write_unaligned(pad_bytes, padding); -} -#else -void CLCD::CommandFifo::start() { -} - -void CLCD::CommandFifo::execute() { -} - -void CLCD::CommandFifo::reset() { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHOLNPGM("Resetting command processor"); - #endif - safe_delay(100); - mem_write_32(REG::CPURESET, 0x00000001); - mem_write_32(REG::CMD_WRITE, 0x00000000); - mem_write_32(REG::CMD_READ, 0x00000000); - mem_write_32(REG::CPURESET, 0x00000000); - safe_delay(300); -}; - -// Writes len bytes into the FIFO, if len is not -// divisible by four, zero bytes will be written -// to align to the boundary. - -template bool CLCD::CommandFifo::write(T data, uint16_t len) { - const uint8_t padding = MULTIPLE_OF_4(len) - len; - - if (has_fault()) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHOLNPGM("Faulted... ignoring write."); - #endif - return false; - } - // The FT810 provides a special register that can be used - // for writing data without us having to do our own FIFO - // management. - uint16_t Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; - if (Command_Space < (len + padding)) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Waiting for ", len + padding); - SERIAL_ECHOLNPAIR(" bytes in command queue, now free: ", Command_Space); - #endif - do { - Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; - if (has_fault()) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHOLNPGM("... fault"); - #endif - return false; - } - } while (Command_Space < len + padding); - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHOLNPGM("... done"); - #endif - } - mem_write_bulk(REG::CMDB_WRITE, data, len, padding); - return true; -} -#endif - -template bool CLCD::CommandFifo::write(const void*, uint16_t); -template bool CLCD::CommandFifo::write(progmem_str, uint16_t); - -// CO_PROCESSOR COMMANDS - -void CLCD::CommandFifo::str(const char * data) { - write(data, strlen(data)+1); -} - -void CLCD::CommandFifo::str(progmem_str data) { - write(data, strlen_P((const char*)data)+1); -} - -/******************* LCD INITIALIZATION ************************/ - -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 - - if (Use_Crystal == 1) { - host_cmd(CLKEXT, 0); - } - else { - host_cmd(CLKINT, 0); - } - - host_cmd(ACTIVE, 0); // Activate the System Clock - - /* read the device-id until it returns 0x7c or times out, should take less than 150ms */ - uint8_t counter; - 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) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_MSG("FTDI chip initialized "); - #endif - break; - } - else { - delay(1); - } - if (counter == 249) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Timeout waiting for device ID, should be 124, got ", device_id); - #endif - } - } - - mem_write_8(REG::PWM_DUTY, 0); // turn off Backlight, Frequency already is set to 250Hz default - - /* Configure the FT8xx Registers */ - mem_write_16(REG::HCYCLE, FTDI::Hcycle); - mem_write_16(REG::HOFFSET, FTDI::Hoffset); - mem_write_16(REG::HSYNC0, FTDI::Hsync0); - mem_write_16(REG::HSYNC1, FTDI::Hsync1); - mem_write_16(REG::VCYCLE, FTDI::Vcycle); - mem_write_16(REG::VOFFSET, FTDI::Voffset); - mem_write_16(REG::VSYNC0, FTDI::Vsync0); - mem_write_16(REG::VSYNC1, FTDI::Vsync1); - mem_write_16(REG::HSIZE, FTDI::Hsize); - mem_write_16(REG::VSIZE, FTDI::Vsize); - mem_write_8(REG::SWIZZLE, FTDI::Swizzle); - mem_write_8(REG::PCLK_POL, FTDI::Pclkpol); - 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_8(REG::DLSWAP, 0x02); // activate display list, Bad Magic Cookie 2 = switch to new list after current frame is scanned out - - //mem_write_8(REG::TOUCH_MODE, 0x03); // Configure the Touch Screen, Bad Magic Cookie, 3 = CONTINUOUS = Reset Default - //mem_write_8(REG::TOUCH_ADC_MODE, 0x01); // Bad Magic Cookie, 1 = single touch = Reset Default - //mem_write_8(REG::TOUCH_OVERSAMPLE, 0x0F); // Reset Default = 7 - why 15? - mem_write_16(REG::TOUCH_RZTHRESH, touch_threshold); /* setup touch sensitivity */ - mem_write_8(REG::VOL_SOUND, 0x00); // Turn Synthesizer Volume Off - - /* turn on the display by setting DISP high */ - /* turn on the Audio Amplifier by setting GPIO_1 high for the select few modules supporting this */ - /* no need to use GPIOX here since DISP/GPIO_0 and GPIO_1 are on REG::GPIO for FT81x as well */ - if (GPIO_1_Audio_Shutdown) { - mem_write_8(REG::GPIO_DIR, GPIO_DISP | GPIO_GP1); - mem_write_8(REG::GPIO, GPIO_DISP | GPIO_GP1); - } else if (GPIO_0_Audio_Enable) { - mem_write_8(REG::GPIO_DIR, GPIO_DISP | GPIO_GP0); - mem_write_8(REG::GPIO, GPIO_DISP | GPIO_GP0); - } - else { - mem_write_8(REG::GPIO, GPIO_DISP); /* REG::GPIO_DIR is set to output for GPIO_DISP by default */ - } - - mem_write_8(REG::PCLK, Pclk); // Turns on Clock by setting PCLK Register to the value necessary for the module - - mem_write_16(REG::PWM_HZ, 0x00FA); - - // Turning off dithering seems to help prevent horizontal line artifacts on certain colors - mem_write_8(REG::DITHER, 0); - - // Initialize the command FIFO - CommandFifo::reset(); - - default_touch_transform(); - default_display_orientation(); -} - -void CLCD::default_touch_transform() { - // Set Initial Values for Touch Transform Registers - mem_write_32(REG::ROTATE, 0); - mem_write_32(REG::TOUCH_TRANSFORM_A, FTDI::default_transform_a); - mem_write_32(REG::TOUCH_TRANSFORM_B, FTDI::default_transform_b); - mem_write_32(REG::TOUCH_TRANSFORM_C, FTDI::default_transform_c); - mem_write_32(REG::TOUCH_TRANSFORM_D, FTDI::default_transform_d); - mem_write_32(REG::TOUCH_TRANSFORM_E, FTDI::default_transform_e); - mem_write_32(REG::TOUCH_TRANSFORM_F, FTDI::default_transform_f); -} - -void CLCD::default_display_orientation() { - #if FTDI_API_LEVEL >= 810 - // Set the initial display orientation. On the FT810, we use the command - // processor to do this since it will also update the transform matrices. - if (FTDI::ftdi_chip >= 810) { - CommandFifo cmd; - cmd.setrotate(0 - #if ENABLED(TOUCH_UI_MIRRORED) - + 4 - #endif - #if ENABLED(TOUCH_UI_PORTRAIT) - + 2 - #endif - #if ENABLED(TOUCH_UI_INVERTED) - + 1 - #endif - ); - cmd.execute(); - } - else { - #if ENABLED(TOUCH_UI_INVERTED) - mem_write_32(REG::ROTATE, 1); - #endif - } - #elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) - #error PORTRAIT or MIRRORED orientation not supported on the FT800 - #elif ENABLED(TOUCH_UI_INVERTED) - mem_write_32(REG::ROTATE, 1); - #endif -} - -#endif // FTDI_BASIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h deleted file mode 100644 index 0426911edb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ /dev/null @@ -1,260 +0,0 @@ -/**************** - * commands.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: . * - ****************************************************************************/ - - /**************************************************************************** - * FUNCTION MAP * - * * - * SPI and FT800/810 Commands * - * * - * CLCD::spi_select() Set CS line to 0 * - * CLCD::spi_deselect() Set CS Line to 1 * - * CLCD::reset() Toggle FT800/810 Power Down Line 50 ms * - * CLCD::spi_init() Configure I/O Lines for SPI * - * CLCD::spi_transfer() Send/Receive 1 SPI Byte * - * CLCD::init() Set FT800/810 Registers * - * CLCD::enable() Turn On FT800/810 PCLK * - * CLCD::disable() Turn Off FT8880/810 PCLK * - * CLCD::set_backlight() Set LCD Backlight Level * - * * - * MEMORY READ FUNCTIONS * - * * - * CLCD::mem_read_addr() Send 32-Bit Address * - * CLCD::mem_read_8() Read 1 Byte * - * CLCD::mem_read_16() Read 2 Bytes * - * CLCD::mem_read_32() Read 4 Bytes * - * * - * MEMORY WRITE FUNCTIONS * - * * - * CLCD::mem_write_addr() Send 24-Bit Address * - * CLCD::mem_write_8() Write 1 Byte * - * CLCD::mem_write_16() Write 2 Bytes * - * CLCD::mem_write_32() Write 4 Bytes * - * * - * HOST COMMAND FUNCTION * - * * - * CLCD::host_cmd() Send 24-Bit Host Command * - * * - * COMMAND BUFFER FUNCTIONS * - * * - * CLCD::cmd() Send 32-Bit Value(4 Bytes)CMD Buffer * - * CLCD::cmd() Send Data Structure with 32-Bit Cmd * - * CLCD::str() Send Text String in 32-Bit Multiples * - - * * - * FT800/810 GRAPHIC COMMANDS * - * * - * class CLCD:CommandFifo {} Class to control Cmd FIFO * - - * CommandFifo::start() Wait for CP finish - Set FIFO Ptr * - * CommandFifo::execute() Set REG_CMD_WRITE and start CP * - * CommandFifo::reset() Set Cmd Buffer Pointers to 0 * - * - * CommandFifo::fgcolor Set Graphic Item Foreground Color * - * CommandFifo::bgcolor Set Graphic Item Background Color * - * CommandFifo::begin() Begin Drawing a Primative * - * CommandFifo::mem_copy() Copy a Block of Memory * - * CommandFifo::append() Append Commands to Current DL * - * CommandFifo::gradient_color() Set 3D Button Highlight Color * - * CommandFifo::button() Draw Button with Bulk Write * - * CommandFifo::text() Draw Text with Bulk Write * - *****************************************************************************/ - - /************************************************** - * RAM_G Graphics RAM Allocation * - * * - * Address Use * - * * - * 8000 Extruder Bitmap * - * 8100 Bed Heat Bitmap * - * 8200 Fan Bitmap * - * 8300 Thumb Drive Symbol Bitmap * - * 35000 Static DL Space (FT800) * - * F5000 Static DL Space (FT810) * - **************************************************/ - -#pragma once - -typedef const __FlashStringHelper *progmem_str; - -class UIStorage; - -class CLCD { - friend class UIStorage; - - public: - typedef FTDI::ftdi_registers REG; - typedef FTDI::ftdi_memory_map MAP; - - static void spi_write_addr (uint32_t reg_address); - static void spi_read_addr (uint32_t reg_address); - - static uint8_t mem_read_8 (uint32_t reg_address); - static uint16_t mem_read_16 (uint32_t reg_address); - static uint32_t mem_read_32 (uint32_t reg_address); - static void mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len); - - static void mem_write_8 (uint32_t reg_address, uint8_t w_data); - static void mem_write_16 (uint32_t reg_address, uint16_t w_data); - static void mem_write_32 (uint32_t reg_address, uint32_t w_data); - static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); - static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); - static void mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding = 0); - static void mem_write_xbm (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding = 0); - - public: - class CommandFifo; - class FontMetrics; - - 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); - - static void get_font_metrics (uint8_t font, struct FontMetrics &fm); - static uint16_t get_text_width(const uint8_t font, const char *str); - static uint16_t get_text_width_P(const uint8_t font, const char *str); - - static uint8_t get_tag () {return mem_read_8(REG::TOUCH_TAG);} - static bool is_touching () {return (mem_read_32(REG::TOUCH_DIRECT_XY) & 0x80000000) == 0;} - - static uint8_t get_tracker (uint16_t &value) { - uint32_t tracker = mem_read_32(REG::TRACKER); - value = tracker >> 16; - return tracker & 0xFF; - } -}; - -/*************************** FT800/810 Font Metrics ****************************/ - -class CLCD::FontMetrics { - public: - uint8_t char_widths[128]; - uint32_t format; - uint32_t stride; - uint32_t width; - 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(progmem_str str, size_t n = SIZE_MAX) const; -}; - -/******************* FT800/810 Graphic Commands *********************************/ - -class CLCD::CommandFifo { - protected: - #if FTDI_API_LEVEL >= 810 - uint32_t getRegCmdBSpace(); - #else - static uint32_t command_write_ptr; - template bool _write_unaligned(T data, uint16_t len); - #endif - void start(); - - public: - template bool write(T data, uint16_t len); - - public: - CommandFifo() {start();} - - static void reset(); - static bool is_processing(); - static bool has_fault(); - - void execute(); - - void cmd(uint32_t cmd32); - void cmd(void* data, uint16_t len); - - void dlstart() {cmd(FTDI::CMD_DLSTART);} - void swap() {cmd(FTDI::CMD_SWAP);} - void coldstart() {cmd(FTDI::CMD_COLDSTART);} - void screensaver() {cmd(FTDI::CMD_SCREENSAVER);} - void stop() {cmd(FTDI::CMD_STOP);} - void loadidentity() {cmd(FTDI::CMD_LOADIDENTITY);} - void setmatrix() {cmd(FTDI::CMD_SETMATRIX);} - - void fgcolor (uint32_t rgb); - void bgcolor (uint32_t rgb); - void gradcolor (uint32_t rgb); - - void track (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t tag); - void clock (int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms); - void gauge (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range); - void dial (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val); - void slider (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range); - void progress (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range); - void scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range); - void number (int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n); - void spinner (int16_t x, int16_t y, uint16_t style, uint16_t scale); - void sketch (int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format); - void gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1); - void snapshot (uint32_t ptr); - void loadimage (uint32_t ptr, uint32_t options); - void getprops (uint32_t ptr, uint32_t width, uint32_t height); - - void scale (int32_t sx, int32_t sy); - void rotate (int32_t a); - void translate (int32_t tx, int32_t ty); - - #if FTDI_API_LEVEL >= 810 - void setbase (uint8_t base); - void setrotate (uint8_t rotation); - void setbitmap (uint32_t ptr, uint16_t fmt, uint16_t w, uint16_t h); - void snapshot2 (uint32_t fmt, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h); - void mediafifo (uint32_t ptr, uint32_t size); - 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() - void text (int16_t x, int16_t y, int16_t font, uint16_t options); - void button (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t option); - void toggle (int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state); - void keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options); - - // Sends the string portion of text, button, toggle and keys. - void str (const char * data); - void str (progmem_str data); - - void memzero (uint32_t ptr, uint32_t size); - void memset (uint32_t ptr, uint32_t value, uint32_t size); - void memcpy (uint32_t dst, uint32_t src, uint32_t size); - void memcrc (uint32_t ptr, uint32_t num, uint32_t result); - void memwrite (uint32_t ptr, uint32_t value); - void inflate (uint32_t ptr); - void getptr (uint32_t result); - void append (uint32_t ptr, uint32_t size); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h deleted file mode 100644 index 5f60881bdd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h +++ /dev/null @@ -1,414 +0,0 @@ -/*************** - * constants.h * - ***************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/**************************************************************************** - * This header defines constants and commands for the FTDI FT810 LCD Driver * - * chip. * - ****************************************************************************/ - -#pragma once - -// OPTIONS - -namespace FTDI { - constexpr uint16_t OPT_3D = 0x0000; - constexpr uint16_t OPT_RGB565 = 0x0000; - constexpr uint16_t OPT_MONO = 0x0001; - constexpr uint16_t OPT_NODL = 0x0002; - constexpr uint16_t OPT_FLAT = 0x0100; - constexpr uint16_t OPT_SIGNED = 0x0100; - constexpr uint16_t OPT_CENTERX = 0x0200; - constexpr uint16_t OPT_CENTERY = 0x0400; - constexpr uint16_t OPT_CENTER = (OPT_CENTERX | OPT_CENTERY); - constexpr uint16_t OPT_RIGHTX = 0x0800; - constexpr uint16_t OPT_NOBACK = 0x1000; - constexpr uint16_t OPT_NOTICKS = 0x2000; - constexpr uint16_t OPT_NOHM = 0x4000; - constexpr uint16_t OPT_NOPOINTER = 0x4000; - constexpr uint16_t OPT_NOSECS = 0x8000; - constexpr uint16_t OPT_NOHANDS = (OPT_NOPOINTER | OPT_NOSECS); -} - -namespace FTDI_FT810 { - constexpr uint16_t OPT_NOTEAR = 0x0004; - constexpr uint16_t OPT_FULLSCREEN = 0x0008; - constexpr uint16_t OPT_MEDIAFIFO = 0x0010; - constexpr uint16_t OPT_SOUND = 0x0020; -} - -// GPIO Bits - -namespace FTDI { - constexpr uint8_t GPIO_GP0 = 1 << 0; - constexpr uint8_t GPIO_GP1 = 1 << 1; - constexpr uint8_t GPIO_DISP = 1 << 7; -} - -namespace FTDI_FT810 { - constexpr uint16_t GPIOX_GP0 = 1 << 0; - constexpr uint16_t GPIOX_GP1 = 1 << 1; - constexpr uint16_t GPIOX_DISP = 1 << 15; -} - -// HOST COMMANDS - -namespace FTDI { - constexpr uint8_t ACTIVE = 0x00; - constexpr uint8_t STANDBY = 0x41; - constexpr uint8_t SLEEP = 0x42; - constexpr uint8_t PWRDOWN = 0x50; - constexpr uint8_t CLKEXT = 0x44; - constexpr uint8_t CLKINT = 0x48; - constexpr uint8_t CORESET = 0x68; -} - -namespace FTDI_FT800 { - constexpr uint8_t CLK48M = 0x62; - constexpr uint8_t CLK36M = 0x61; -} - -namespace FTDI_FT810 { - constexpr uint8_t CLKSEL = 0x61; -} - -// DISPLAY LIST COMMANDS - -namespace FTDI { - constexpr uint8_t ARGB1555 = 0; - constexpr uint8_t L1 = 1; - constexpr uint8_t L4 = 2; - constexpr uint8_t L8 = 3; - constexpr uint8_t RGB332 = 4; - constexpr uint8_t ARGB2 = 5; - constexpr uint8_t ARGB4 = 6; - constexpr uint8_t RGB565 = 7; - constexpr uint8_t PALETTED = 8; - constexpr uint8_t TEXT8X8 = 9; - constexpr uint8_t TEXTVGA = 10; - constexpr uint8_t BARGRAPH = 11; - - constexpr uint8_t ALPHA_FUNC_NEVER = 0; - constexpr uint8_t ALPHA_FUNC_LESS = 1; - constexpr uint8_t ALPHA_FUNC_LEQUAL = 2; - constexpr uint8_t ALPHA_FUNC_GREATER = 3; - constexpr uint8_t ALPHA_FUNC_GEQUAL = 4; - constexpr uint8_t ALPHA_FUNC_EQUAL = 5; - constexpr uint8_t ALPHA_FUNC_NOTEQUAL = 6; - constexpr uint8_t ALPHA_FUNC_ALWAYS = 7; - - constexpr uint8_t NEAREST = 0; - constexpr uint8_t BILINEAR = 1; - constexpr uint8_t BORDER = 0; - constexpr uint8_t REPEAT = 1; - - constexpr uint8_t BLEND_FUNC_ZERO = 0; - constexpr uint8_t BLEND_FUNC_ONE = 1; - constexpr uint8_t BLEND_FUNC_SRC_ALPHA = 2; - constexpr uint8_t BLEND_FUNC_DST_ALPHA = 3; - constexpr uint8_t BLEND_FUNC_ONE_MINUS_SRC_ALPHA = 4; - constexpr uint8_t BLEND_FUNC_ONE_MINUS_DST_ALPHA = 5; - - constexpr uint32_t COLOR_MASK_RED = 8; - constexpr uint32_t COLOR_MASK_GRN = 4; - constexpr uint32_t COLOR_MASK_BLU = 2; - constexpr uint32_t COLOR_MASK_ALPHA = 1; - - constexpr uint8_t STENCIL_FUNC_NEVER = 0; - constexpr uint8_t STENCIL_FUNC_LESS = 1; - constexpr uint8_t STENCIL_FUNC_LEQUAL = 2; - constexpr uint8_t STENCIL_FUNC_GREATER = 3; - constexpr uint8_t STENCIL_FUNC_GEQUAL = 4; - constexpr uint8_t STENCIL_FUNC_EQUAL = 5; - constexpr uint8_t STENCIL_FUNC_NOTEQUAL = 6; - constexpr uint8_t STENCIL_FUNC_ALWAYS = 7; - - constexpr uint8_t STENCIL_OP_ZERO = 0; - constexpr uint8_t STENCIL_OP_KEEP = 1; - constexpr uint8_t STENCIL_OP_REPLACE = 2; - constexpr uint8_t STENCIL_OP_INCR = 3; - constexpr uint8_t STENCIL_OP_DECR = 4; - constexpr uint8_t STENCIL_OP_INVERT = 5; - - typedef enum : uint32_t { - BITMAPS = 1, - POINTS = 2, - LINES = 3, - LINE_STRIP = 4, - EDGE_STRIP_R = 5, - EDGE_STRIP_L = 6, - EDGE_STRIP_A = 7, - EDGE_STRIP_B = 8, - RECTS = 9 - } begin_t; -} - -namespace FTDI_FT800_DL { - constexpr uint32_t ALPHA_FUNC = 0x09000000; - constexpr uint32_t BEGIN = 0x1F000000; - constexpr uint32_t BITMAP_HANDLE = 0x05000000; - constexpr uint32_t BITMAP_LAYOUT = 0x07000000; - constexpr uint32_t BITMAP_SIZE = 0x08000000; - constexpr uint32_t BITMAP_SOURCE = 0x01000000; - constexpr uint32_t BITMAP_TRANSFORM_A = 0x15000000; - constexpr uint32_t BITMAP_TRANSFORM_B = 0x16000000; - constexpr uint32_t BITMAP_TRANSFORM_C = 0x17000000; - constexpr uint32_t BITMAP_TRANSFORM_D = 0x18000000; - constexpr uint32_t BITMAP_TRANSFORM_E = 0x19000000; - constexpr uint32_t BITMAP_TRANSFORM_F = 0x1A000000; - constexpr uint32_t BLEND_FUNC = 0x0B000000; - constexpr uint32_t CALL = 0x1D000000; - constexpr uint32_t CELL = 0x06000000; - constexpr uint32_t CLEAR = 0x26000000; - constexpr uint32_t CLEAR_COLOR_BUFFER = 0x00000004; - constexpr uint32_t CLEAR_STENCIL_BUFFER = 0x00000002; - constexpr uint32_t CLEAR_TAG_BUFFER = 0x00000001; - constexpr uint32_t CLEAR_COLOR_A = 0x0F000000; - constexpr uint32_t CLEAR_COLOR_RGB = 0x02000000; - constexpr uint32_t CLEAR_STENCIL = 0x11000000; - constexpr uint32_t CLEAR_TAG = 0x12000000; - constexpr uint32_t COLOR_A = 0x10000000; - constexpr uint32_t COLOR_MASK = 0x20000000; - constexpr uint32_t COLOR_RGB = 0x04000000; - constexpr uint32_t DL_DISPLAY = 0x00000000; - constexpr uint32_t END = 0x21000000; - constexpr uint32_t JUMP = 0x1E000000; - constexpr uint32_t LINE_WIDTH = 0x0E000000; - constexpr uint32_t MACRO = 0x25000000; - constexpr uint32_t POINT_SIZE = 0x0D000000; - constexpr uint32_t RESTORE_CONTEXT = 0x23000000; - constexpr uint32_t RETURN = 0x24000000; - constexpr uint32_t SAVE_CONTEXT = 0x22000000; - constexpr uint32_t SCISSOR_SIZE = 0x1C000000; - constexpr uint32_t SCISSOR_XY = 0x1B000000; - constexpr uint32_t STENCIL_FUNC = 0x0A000000; - constexpr uint32_t STENCIL_MASK = 0x13000000; - constexpr uint32_t STENCIL_OP = 0x0C000000; - constexpr uint32_t TAG = 0x03000000; - constexpr uint32_t TAG_MASK = 0x14000000; - constexpr uint32_t VERTEX2F = 0x40000000; - constexpr uint32_t VERTEX2II = 0x80000000; -} - -namespace FTDI_FT810_DL { - constexpr uint32_t NOP = 0x25000000; - constexpr uint32_t BITMAP_LAYOUT_H = 0x28000000; - constexpr uint32_t BITMAP_SIZE_H = 0x29000000; - constexpr uint32_t VERTEX_FORMAT = 0x27000000; - constexpr uint32_t VERTEX_TRANSLATE_X = 0x2B000000; - constexpr uint32_t VERTEX_TRANSLATE_Y = 0x2C000000; -} - -// CO-PROCESSOR ENGINE COMMANDS -namespace FTDI { - constexpr uint32_t CMD_DLSTART = 0xFFFFFF00; - constexpr uint32_t CMD_SWAP = 0xFFFFFF01; - constexpr uint32_t CMD_COLDSTART = 0xFFFFFF32; - constexpr uint32_t CMD_INTERRUPT = 0xFFFFFF02; - constexpr uint32_t CMD_APPEND = 0xFFFFFF1E; - constexpr uint32_t CMD_REGREAD = 0xFFFFFF19; - constexpr uint32_t CMD_MEMWRITE = 0xFFFFFF1A; - constexpr uint32_t CMD_INFLATE = 0xFFFFFF22; - constexpr uint32_t CMD_LOADIMAGE = 0xFFFFFF24; - constexpr uint32_t CMD_MEMCRC = 0xFFFFFF18; - constexpr uint32_t CMD_MEMZERO = 0xFFFFFF1C; - constexpr uint32_t CMD_MEMSET = 0xFFFFFF1B; - constexpr uint32_t CMD_MEMCPY = 0xFFFFFF1D; - constexpr uint32_t CMD_BUTTON = 0xFFFFFF0D; - constexpr uint32_t CMD_CLOCK = 0xFFFFFF14; - constexpr uint32_t CMD_FGCOLOR = 0xFFFFFF0A; - constexpr uint32_t CMD_BGCOLOR = 0xFFFFFF09; - constexpr uint32_t CMD_GRADCOLOR = 0xFFFFFF34; - constexpr uint32_t CMD_GAUGE = 0xFFFFFF13; - constexpr uint32_t CMD_GRADIENT = 0xFFFFFF0B; - constexpr uint32_t CMD_KEYS = 0xFFFFFF0E; - constexpr uint32_t CMD_PROGRESS = 0xFFFFFF0F; - constexpr uint32_t CMD_SCROLLBAR = 0xFFFFFF11; - constexpr uint32_t CMD_SLIDER = 0xFFFFFF10; - constexpr uint32_t CMD_DIAL = 0xFFFFFF2D; - constexpr uint32_t CMD_TOGGLE = 0xFFFFFF12; - constexpr uint32_t CMD_TEXT = 0xFFFFFF0C; - constexpr uint32_t CMD_NUMBER = 0xFFFFFF2E; - constexpr uint32_t CMD_LOADIDENTITY = 0xFFFFFF26; - constexpr uint32_t CMD_SETMATRIX = 0xFFFFFF2A; - constexpr uint32_t CMD_GETMATRIX = 0xFFFFFF33; - constexpr uint32_t CMD_GETPTR = 0xFFFFFF23; - constexpr uint32_t CMD_GETPROPS = 0xFFFFFF25; - constexpr uint32_t CMD_SCALE = 0xFFFFFF28; - constexpr uint32_t CMD_ROTATE = 0xFFFFFF29; - constexpr uint32_t CMD_TRANSLATE = 0xFFFFFF27; - constexpr uint32_t CMD_CALIBRATE = 0xFFFFFF15; - constexpr uint32_t CMD_SPINNER = 0xFFFFFF16; - constexpr uint32_t CMD_SCREENSAVER = 0xFFFFFF2F; - constexpr uint32_t CMD_SKETCH = 0xFFFFFF30; - constexpr uint32_t CMD_STOP = 0xFFFFFF17; - constexpr uint32_t CMD_SETFONT = 0xFFFFFF2B; - constexpr uint32_t CMD_TRACK = 0xFFFFFF2C; - constexpr uint32_t CMD_SNAPSHOT = 0xFFFFFF1F; - constexpr uint32_t CMD_LOGO = 0xFFFFFF31; -} - -namespace FTDI_FT810 { - constexpr uint32_t CMD_SETROTATE = 0xFFFFFF36; - constexpr uint32_t CMD_SNAPSHOT2 = 0xFFFFFF37; - 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 : unsigned char { - SILENCE = 0x00, - SQUARE_WAVE = 0x01, - SINE_WAVE = 0x02, - SAWTOOTH_WAVE = 0x03, - TRIANGLE_WAVE = 0x04, - BEEPING = 0x05, - ALARM = 0x06, - WARBLE = 0x07, - CAROUSEL = 0x08, - SHORT_PIPS_1 = 0x10, - SHORT_PIPS_2 = 0x11, - SHORT_PIPS_3 = 0x12, - SHORT_PIPS_4 = 0x13, - SHORT_PIPS_5 = 0x14, - SHORT_PIPS_6 = 0x15, - SHORT_PIPS_7 = 0x16, - SHORT_PIPS_8 = 0x17, - SHORT_PIPS_9 = 0x18, - SHORT_PIPS_10 = 0x19, - SHORT_PIPS_11 = 0x1A, - SHORT_PIPS_12 = 0x1B, - SHORT_PIPS_13 = 0x1C, - SHORT_PIPS_14 = 0x1D, - SHORT_PIPS_15 = 0x1E, - SHORT_PIPS_16 = 0x1F, - DTMF_POUND = 0x23, - DTMF_STAR = 0x2C, - DTMF_0 = 0x30, - DTMF_1 = 0x31, - DTMF_2 = 0x32, - DTMF_3 = 0x33, - DTMF_4 = 0x34, - DTMF_5 = 0x35, - DTMF_6 = 0x36, - DTMF_7 = 0x37, - DTMF_8 = 0x38, - DTMF_9 = 0x39, - HARP = 0x40, - XYLOPHONE = 0x41, - TUBA = 0x42, - GLOCKENSPIEL = 0x43, - ORGAN = 0x44, - TRUMPET = 0x45, - PIANO = 0x46, - CHIMES = 0x47, - MUSIC_BOX = 0x48, - BELL = 0x49, - CLICK = 0x50, - SWITCH = 0x51, - COWBELL = 0x52, - NOTCH = 0x53, - HIHAT = 0x54, - KICKDRUM = 0x55, - POP = 0x56, - CLACK = 0x57, - CHACK = 0x58, - MUTE = 0x60, - UNMUTE = 0x61 - }; - - enum note_t : unsigned char { - END_SONG = 0xFF, - REST = 0x00, - - NOTE_C1 = 0x18, // 24 - NOTE_C1S = 0x19, - NOTE_D1 = 0x1A, - NOTE_D1S = 0x1B, - NOTE_E1 = 0x1C, - NOTE_F1 = 0x1D, - NOTE_F1S = 0x1E, - NOTE_G1 = 0x1F, - NOTE_G1S = 0x20, - NOTE_A1 = 0x21, - NOTE_A1S = 0x22, - NOTE_B1 = 0x23, - - NOTE_C2 = 0x24, //36 - NOTE_C2S = 0x25, - NOTE_D2 = 0x26, - NOTE_D2S = 0x27, - NOTE_E2 = 0x28, - NOTE_F2 = 0x29, - NOTE_F2S = 0x2A, - NOTE_G2 = 0x2B, - NOTE_G2S = 0x2C, - NOTE_A2 = 0x2D, - NOTE_A2S = 0x2E, - NOTE_B2 = 0x2F, - - NOTE_C3 = 0x30, - NOTE_C3S = 0x31, - NOTE_D3 = 0x32, - NOTE_D3S = 0x33, - NOTE_E3 = 0x34, - NOTE_F3 = 0x35, - NOTE_F3S = 0x36, - NOTE_G3 = 0x37, - NOTE_G3S = 0x38, - NOTE_A3 = 0x39, - NOTE_A3S = 0x3A, - NOTE_B3 = 0x3B, - - NOTE_C4 = 0x3C, - NOTE_C4S = 0x3D, - NOTE_D4 = 0x3E, - NOTE_D4S = 0x3F, - NOTE_E4 = 0x40, - NOTE_F4 = 0x41, - NOTE_F4S = 0x42, - NOTE_G4 = 0x43, - NOTE_G4S = 0x44, - NOTE_A4 = 0x45, - NOTE_A4S = 0x46, - NOTE_B4 = 0x47, - - NOTE_C5 = 0x48, - NOTE_C5S = 0x49, - NOTE_D5 = 0x4A, - NOTE_D5S = 0x4B, - NOTE_E5 = 0x4C, - NOTE_F5 = 0x4D, - NOTE_F5S = 0x4E, - NOTE_G5 = 0x4F, - NOTE_G5S = 0x50, - NOTE_A5 = 0x51, - NOTE_A5S = 0x52, - NOTE_B5 = 0x53, - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h deleted file mode 100644 index 99a9e0e810..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h +++ /dev/null @@ -1,118 +0,0 @@ -/****************** - * display_list.h * - *****************/ - -/********************************************************************************** - * Adapted from: * - * https://github.com/RudolphRiedel/FT800-FT813 * - * By Rudolph Riedel * - * * - * MIT License * - * * - * Copyright (c) 2017 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy * - * of this software and associated documentation files (the "Software"), to deal * - * in the Software without restriction, including without limitation the rights * - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included in all * - * copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * - * SOFTWARE. * - * * - **********************************************************************************/ - -#pragma once - -namespace FTDI { - /* FT8xx graphics engine specific macros useful for static display list generation */ - 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);} - 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);} - - inline uint32_t BITMAP_SIZE(uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height) - {return DL::BITMAP_SIZE|((filter&1UL)<<20)|((wrapx&1UL)<<19)|((wrapy&1UL)<<18)|((width&511UL)<<9)|(height&511UL);} - #if FTDI_API_LEVEL >= 810 - inline uint32_t BITMAP_LAYOUT_H(uint8_t linestride, uint8_t height) - {return DL::BITMAP_LAYOUT_H|((linestride&3UL)<<2)|(height&3UL);} - inline uint32_t BITMAP_SIZE_H(uint8_t width, uint8_t height) - {return DL::BITMAP_SIZE_H|((width&3UL)<<2)|(height&3UL);} - #endif - inline uint32_t BITMAP_TRANSFORM_A(uint16_t a) {return DL::BITMAP_TRANSFORM_A|(a&131071UL);} - inline uint32_t BITMAP_TRANSFORM_B(uint16_t b) {return DL::BITMAP_TRANSFORM_B|(b&131071UL);} - inline uint32_t BITMAP_TRANSFORM_C(uint32_t c) {return DL::BITMAP_TRANSFORM_C|(c&16777215UL);} - inline uint32_t BITMAP_TRANSFORM_D(uint16_t d) {return DL::BITMAP_TRANSFORM_D|(d&131071UL);} - inline uint32_t BITMAP_TRANSFORM_E(uint16_t e) {return DL::BITMAP_TRANSFORM_E|(e&131071UL);} - inline uint32_t BITMAP_TRANSFORM_F(uint32_t f) {return DL::BITMAP_TRANSFORM_F|(f&16777215UL);} - inline uint32_t BLEND_FUNC(uint8_t src,uint8_t dst) {return DL::BLEND_FUNC|((src&7UL)<<3)|(dst&7UL);} - inline uint32_t CALL(uint16_t dest) {return DL::CALL|(dest&65535UL);} - inline uint32_t CELL(uint8_t cell) {return DL::CELL|(cell&127UL);} - inline uint32_t CLEAR(bool c,bool s,bool t) {return DL::CLEAR|((c?1UL:0UL)<<2)|((s?1UL:0UL)<<1)|(t?1UL:0UL);} - inline uint32_t CLEAR_COLOR_A(uint8_t alpha) {return DL::CLEAR_COLOR_A|(alpha&255UL);} - inline uint32_t CLEAR_COLOR_RGB(uint8_t red, uint8_t green, uint8_t blue) - {return DL::CLEAR_COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);} - inline uint32_t CLEAR_COLOR_RGB(uint32_t rgb) {return DL::CLEAR_COLOR_RGB|rgb;} - inline uint32_t CLEAR_STENCIL(uint8_t s) {return DL::CLEAR_STENCIL|(s&255UL);} - inline uint32_t CLEAR_TAG(uint8_t s) {return DL::CLEAR_TAG|(s&255UL);} - inline uint32_t COLOR_A(uint8_t alpha) {return DL::COLOR_A|(alpha&255UL);} - inline uint32_t COLOR_MASK(bool r, bool g, bool b, bool a) {return DL::COLOR_MASK|((r?1UL:0UL)<<3)|((g?1UL:0UL)<<2)|((b?1UL:0UL)<<1)|(a?1UL:0UL);} - inline uint32_t COLOR_RGB(uint8_t red,uint8_t green,uint8_t blue) - {return DL::COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);} - inline uint32_t COLOR_RGB(uint32_t rgb) {return DL::COLOR_RGB|rgb;} - /* inline uint32_t DISPLAY() {return (0UL<<24)) */ - inline uint32_t END() {return DL::END;} - inline uint32_t JUMP(uint16_t dest) {return DL::JUMP|(dest&65535UL);} - inline uint32_t LINE_WIDTH(uint16_t width) {return DL::LINE_WIDTH|(width&4095UL);} - inline uint32_t MACRO(uint8_t m) {return DL::MACRO|(m&1UL);} - inline uint32_t POINT_SIZE(uint16_t size) {return DL::POINT_SIZE|(size&8191UL);} - inline uint32_t RESTORE_CONTEXT() {return DL::RESTORE_CONTEXT;} - inline uint32_t RETURN () {return DL::RETURN;} - inline uint32_t SAVE_CONTEXT() {return DL::SAVE_CONTEXT;} - inline uint32_t SCISSOR_XY(uint16_t x,uint16_t y) { - return DL::SCISSOR_XY | - (FTDI::ftdi_chip >= 810 - ? ((x&2047UL)<<11)|(y&2047UL) - : ((x& 511UL)<<10)|(y&511UL)); - } - inline uint32_t SCISSOR_SIZE(uint16_t w,uint16_t h) { - return DL::SCISSOR_SIZE | - (FTDI::ftdi_chip >= 810 - ? ((w&4095UL)<<12)|(h&4095UL) - : ((w&1023UL)<<10)|(h&1023UL)); - } - inline uint32_t SCISSOR_XY() {return DL::SCISSOR_XY;} - inline uint32_t SCISSOR_SIZE() { - return DL::SCISSOR_SIZE | - (FTDI::ftdi_chip >= 810 - ? (2048UL<<12)|(2048UL) - : ( 512UL<<10)|( 512UL)); - } - inline uint32_t STENCIL_FUNC(uint16_t func, uint8_t ref, uint8_t mask) - {return DL::STENCIL_FUNC|((func&7UL)<<16)|((ref&255UL)<<8)|(mask&255UL);} - inline uint32_t STENCIL_MASK(uint8_t mask) {return DL::STENCIL_MASK|(mask&255UL);} - inline uint32_t STENCIL_OP(uint8_t sfail, uint8_t spass) {return DL::STENCIL_OP|(((sfail)&7UL)<<3)|(spass&7UL);} - inline uint32_t TAG(uint8_t s) {return DL::TAG|(s&255UL);} - inline uint32_t TAG_MASK(bool mask) {return DL::TAG_MASK|(mask?1:0);} - inline uint32_t VERTEX2F(uint16_t x, uint16_t y) {return DL::VERTEX2F|((x&32767UL)<<15)|(y&32767UL);} - inline uint32_t VERTEX2II(uint16_t x,uint16_t y, uint8_t handle = 0, uint8_t cell = 0) - {return DL::VERTEX2II|((x&511UL)<<21)|((y&511UL)<<12)|((handle&31UL)<<7)|(cell&127UL);} - - #if FTDI_API_LEVEL >= 810 - inline uint32_t VERTEX_FORMAT(uint8_t frac) {return DL::VERTEX_FORMAT|(frac&7UL);} - inline uint32_t VERTEX_TRANSLATE_X(int32_t x) {return DL::VERTEX_TRANSLATE_X|(x&131071UL);} - inline uint32_t VERTEX_TRANSLATE_Y(int32_t y) {return DL::VERTEX_TRANSLATE_Y|(y&131071UL);} - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h deleted file mode 100644 index e8f9f424d0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************** - * ftdi_basic.h * - ****************/ - -/**************************************************************************** - * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * - * 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 "../compat.h" - -#ifndef __MARLIN_FIRMWARE__ - #define FTDI_BASIC -#endif - -#ifdef FTDI_BASIC - #include "registers_ft800.h" - #include "registers_ft810.h" - #include "constants.h" - #include "boards.h" - #include "commands.h" - #include "spi.h" - #include "display_list.h" - #include "resolutions.h" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h deleted file mode 100644 index ff17d019d7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h +++ /dev/null @@ -1,150 +0,0 @@ -/********************* - * registers_ft800.h * - *********************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/**************************************************************************** - * This header defines registers for the FTDI FT800 LCD Driver chip. * - ****************************************************************************/ - -/******************************************************************************* - * FT810 * - * * - * START END ADDR SIZE NAME DESCRIPTION * - * * - * 0x000000 0x03FFFF 256 kB RAM_G Main Graphics RAM * - * * - * 0x0C0000 0x0C0003 4 B ROM_CHIPID [0:1] 0x800 Chip Id * - * [1:2] 0x0100 Vers ID * - * * - * 0x0BB23C 0x0FFFFB 275 kB ROM_FONT Font table and bitmap * - * * - * 0x0FFFFC 0x0FFFFF 4 B ROM_FONT_ADDR Font table pointer address * - * * - * 0x100000 0x101FFF 8 kB RAM_DL Display List RAM * - * * - * 0x102000 0x1023FF 1 kB RAM_PAL Palette RAM * - * * - * 0x102400 0x10257F 380 B * Registers * - * * - * 0x108000 0x108FFF 4 kB RAM_CMD Command Buffer * - * * - *******************************************************************************/ - -#pragma once - -namespace FTDI { - struct ft800_memory_map { - - // MEMORY LOCATIONS FT800 - static constexpr uint32_t RAM_G = 0x000000; // Main Graphics RAM - static constexpr uint32_t ROM_CHIPID = 0x0C0000; // Chip ID/Version ID - static constexpr uint32_t ROM_FONT = 0x0BB23C; // Font ROM - static constexpr uint32_t ROM_FONT_ADDR = 0x0FFFFC; // Font Table Pointer - static constexpr uint32_t RAM_DL = 0x100000; // Display List RAM - static constexpr uint32_t RAM_PAL = 0x102000; // Palette RAM - static constexpr uint32_t RAM_REG = 0x102400; // Registers - static constexpr uint32_t RAM_CMD = 0x108000; // Command Buffer - - static constexpr uint32_t RAM_G_SIZE = 256*1024l; // 256k - }; - - struct ft800_registers { - // REGISTERS AND ADDRESSES FT800 - - // REGISTER ADDRESS SIZE RESET VALUE TYPE DESCRIPTION - - static constexpr uint32_t ID = 0x102400; // 8 0x7C r Identification Register, Always 0x7C - static constexpr uint32_t FRAMES = 0x102404; // 32 0x00000000 r Frame Counter, Since Reset - static constexpr uint32_t CLOCK = 0x102408; // 32 0x00000000 r Clock cycles, Since Reset - static constexpr uint32_t FREQUENCY = 0x10240C; // 28 0x03938700 r/w Main Clock Frequency - static constexpr uint32_t RENDERMODE = 0x102410; // 1 0x00 r/w Rendering Mode: 0 = normal, 1 = single-line - static constexpr uint32_t SNAPY = 0x102414; // 11 0x0000 r/w Scan Line Select for RENDERMODE 1 - static constexpr uint32_t SNAPSHOT = 0x102418; // 1 - r Trigger for RENDERMODE 1 - static constexpr uint32_t CPURESET = 0x10241C; // 3 0x02 r/w RESET Bit2 Audio - Bit1 Touch - Bit0 Graphics - static constexpr uint32_t TAP_CRC = 0x102420; // 32 - r Live Video Tap - static constexpr uint32_t TAP_MASK = 0x102424; // 32 0xFFFFFFFF r/w Live Video Tap Mask - static constexpr uint32_t HCYCLE = 0x102428; // 12 0x224 r/w Horizontal Total Cycle Count - static constexpr uint32_t HOFFSET = 0x10242C; // 12 0x02B r/w Horizontal Display Start Offset - static constexpr uint32_t HSIZE = 0x102430; // 12 0x1E0 r/w Horizontal Display Pixel Count - static constexpr uint32_t HSYNC0 = 0x102434; // 12 0x000 r/w Horizontal Sync Fall Offset - static constexpr uint32_t HSYNC1 = 0x102438; // 12 0x029 r/w Horizontal Sync Rise Offset - static constexpr uint32_t VCYCLE = 0x10243C; // 12 0x124 r/w Vertical Total Cycle Count - static constexpr uint32_t VOFFSET = 0x102440; // 12 0x00C r/w Vertical Display Start Offset - static constexpr uint32_t VSIZE = 0x102444; // 12 0x110 r/w Vertical Display Line Count - static constexpr uint32_t VSYNC0 = 0x102448; // 10 0x000 r/w Vertical Sync Fall Offset - static constexpr uint32_t VSYNC1 = 0x10244C; // 10 0x00A r/w Vertical Sync Rise Offset - static constexpr uint32_t DLSWAP = 0x102450; // 2 0x00 r/w Display List Swap Control - static constexpr uint32_t ROTATE = 0x102454; // 3 0x00 r/w Screen 90,180, 270 degree rotate - static constexpr uint32_t OUTBITS = 0x102458; // 9 0x1B6 r/w Output Resolution, 3x3x3 Bits - static constexpr uint32_t DITHER = 0x10245C; // 1 0x01 r/w Output Dither Enable - static constexpr uint32_t SWIZZLE = 0x102460; // 4 0x00 r/w Output RGB Swizzle, Pin Change for PCB Routing - static constexpr uint32_t CSPREAD = 0x102464; // 1 0x01 r/w Output Clock Spreading Enable - static constexpr uint32_t PCLK_POL = 0x102468; // 1 0x00 r/w PCLK Polarity: 0 = Rising Edge, 1 = Falling Edge - static constexpr uint32_t PCLK = 0x10246C; // 8 0x00 r/w PCLK Frequency Divider, 0 = Disable Clock - static constexpr uint32_t TAG_X = 0x102470; // 11 0x000 r/w Tag Query X Coordinate - static constexpr uint32_t TAG_Y = 0x102474; // 11 0x000 r/w Tag Query Y Coordinate - static constexpr uint32_t TAG = 0x102478; // 8 0x00 r Tag Query Result - static constexpr uint32_t VOL_PB = 0x10247C; // 8 0xFF r/w Audio Playback Volume - static constexpr uint32_t VOL_SOUND = 0x102480; // 8 0xFF r/w Audio Synthesizer Volume - static constexpr uint32_t SOUND = 0x102484; // 16 0x0000 r/w Audio Sound Effect Select - static constexpr uint32_t PLAY = 0x102488; // 1 0x00 r/w Audio Start Effect Playback - static constexpr uint32_t GPIO_DIR = 0x10248C; // 8 0x80 r/w GPIO Pin Direction: 0 = Input , 1 = Output - static constexpr uint32_t GPIO = 0x102490; // 8 0x00 r/w GPIO Pin Values for 0, 1, 7 Drive Strength 2, 3, 4, 5, 6 - static constexpr uint32_t INT_FLAGS = 0x102498; // 8 0x00 r Interrupt Flags, Clear by Reading - static constexpr uint32_t INT_EN = 0x10249C; // 1 0x00 r/w Global Interrupt Enable - static constexpr uint32_t INT_MASK = 0x1024A0; // 8 0xFF r/w Interrupt Enable Mask - static constexpr uint32_t PLAYBACK_START = 0x1024A4; // 20 0x00000 r/w Audio Playback RAM Start Address - static constexpr uint32_t PLAYBACK_LENGTH = 0x1024A8; // 20 0x00000 r/w Audio Playback Sample Length (Bytes) - static constexpr uint32_t PLAYBACK_READPTR = 0x1024AC; // 20 - r Audio Playback Read Pointer - static constexpr uint32_t PLAYBACK_FREQ = 0x1024B0; // 16 0x1F40 r/w Audio Playback Frequency (Hz) - static constexpr uint32_t PLAYBACK_FORMAT = 0x1024B4; // 2 0x00 r/w Audio Playback Format - static constexpr uint32_t PLAYBACK_LOOP = 0x1024B8; // 1 0x00 r/w Audio Playback Loop Enable - static constexpr uint32_t PLAYBACK_PLAY = 0x1024BC; // 1 0x00 r Audio Start Playback - static constexpr uint32_t PWM_HZ = 0x1024C0; // 14 0x00FA r/w Backlight PWM Frequency (Hz) - static constexpr uint32_t PWM_DUTY = 0x1024C4; // 8 0x80 r/w Backlight PWM Duty Cycle: 0 = 0%, 128 = 100% - static constexpr uint32_t MACRO_0 = 0x1024C8; // 32 0x00000000 r/w Display List Macro Command 0 - static constexpr uint32_t MACRO_1 = 0x1024CC; // 32 0x00000000 r/w Display List Macro Command 1 - static constexpr uint32_t CMD_READ = 0x1024E4; // 12 0x000 r/w Command Buffer Read Pointer - static constexpr uint32_t CMD_WRITE = 0x1024E8; // 12 0x000 r/w Command Buffer Write Pointer - static constexpr uint32_t CMD_DL = 0x1024EC; // 13 0x0000 r/w Command Display List Offset - static constexpr uint32_t TOUCH_MODE = 0x1024F0; // 2 0x03 r/w Touch-Screen Sampling Mode - static constexpr uint32_t TOUCH_ADC_MODE = 0x1024F4; // 1 0x01 r/w Select Single Ended or Differential Sampling - static constexpr uint32_t TOUCH_CHARGE = 0x1024F8; // 16 0x1770 r/w Touch Screen Charge Time, n x 6 Clocks - static constexpr uint32_t TOUCH_SETTLE = 0x1024FC; // 4 0x03 r/w Touch-Screen Settle Time, n x 6 Clocks - static constexpr uint32_t TOUCH_OVERSAMPLE = 0x102500; // 4 0x07 r/w Touch-Screen Oversample Factor - static constexpr uint32_t TOUCH_RZTHRESH = 0x102504; // 16 0xFFFF r/w Touch-Screen Resistance Threshold - static constexpr uint32_t TOUCH_RAW_XY = 0x102508; // 32 - r Touch-Screen Raw (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_RZ = 0x10250C; // 16 - r Touch-Screen Resistance - static constexpr uint32_t TOUCH_SCREEN_XY = 0x102510; // 32 - r Touch-Screen Screen (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_TAG_XY = 0x102514; // 32 - r Touch-Screen Tag 0 Lookup (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_TAG = 0x102518; // 8 - r Touch-Screen Tag 0 Result - static constexpr uint32_t TOUCH_TRANSFORM_A = 0x10251C; // 32 0x00010000 r/w Touch-Screen Transform Coefficient A (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_B = 0x102520; // 32 0x00000000 r/w Touch-Screen Transform Coefficient B (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_C = 0x102524; // 32 0x00000000 r/w Touch-Screen Transform Coefficient C (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_D = 0x102528; // 32 0x00000000 r/w Touch-Screen Transform Coefficient D (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_E = 0x10252C; // 32 0x00010000 r/w Touch-Screen Transform Coefficient E (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_F = 0x102530; // 32 0x00000000 r/w Touch-Screen Transform Coefficient F (s15.16) - // Reserved Addresses 0x102434 - 0x102470 - static constexpr uint32_t TOUCH_DIRECT_XY = 0x102574; // 32 - r Touch-Screen Direct Conversions XY (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_DIRECT_Z1Z2 = 0x102578; // 32 - r Touch-Screen Direct Conversions Z (z1-MSB16; z2-LSB16) - static constexpr uint32_t TRACKER = 0x109000; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h deleted file mode 100644 index 3e4044e194..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h +++ /dev/null @@ -1,187 +0,0 @@ -/********************* - * registers_ft810.h * - *********************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/**************************************************************************** - * This header defines registers for the FTDI FT810 LCD Driver chip. * - ****************************************************************************/ - -/******************************************************************************* - * FT810 * - * * - * START END ADDR SIZE NAME DESCRIPTION * - * * - * 0x000000 0x0FFFFF 1024 kB RAM_G Main Graphics RAM (0 to 1048572) * - * * - * 0x0C0000 0x0C0003 4 B ROM_CHIPID [0:1] 0x800 Chip Id * - * [1:2] 0x0100 Vers ID * - * * - * 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 * - * * - * 0x302000 0x302FFF 4 kB * Registers * - * * - * 0x308000 0x308FFF 4 kB RAM_CMD Command Buffer * - * * - *******************************************************************************/ - -#pragma once - -namespace FTDI { - struct ft810_memory_map { - // MEMORY LOCATIONS FT810 - static constexpr uint32_t RAM_G = 0x000000; // Main Graphics RAM - static constexpr uint32_t ROM_CHIPID = 0x0C0000; // Chip ID/Version ID - static constexpr uint32_t ROM_FONT = 0x1E0000; // Font ROM - static constexpr uint32_t ROM_FONT_ADDR = 0x2FFFFC; // Font Table Pointer - static constexpr uint32_t RAM_DL = 0x300000; // Display List RAM - static constexpr uint32_t RAM_REG = 0x302000; // Registers - static constexpr uint32_t RAM_CMD = 0x308000; // Command Buffer - - static constexpr uint32_t RAM_G_SIZE = 1024*1024l; // 1024k - }; - - struct ft810_registers { - // REGISTERS AND ADDRESSES FT810 - - // REGISTER ADDRESS SIZE RESET VALUE TYPE DESCRIPTION - - static constexpr uint32_t ID = 0x302000; // 8 0x7C r Identification Register, Always 0x7C - static constexpr uint32_t FRAMES = 0x302004; // 32 0x00000000 r Frame Counter, Since Reset - static constexpr uint32_t CLOCK = 0x302008; // 32 0x00000000 r Clock cycles, Since Reset - static constexpr uint32_t FREQUENCY = 0x30200C; // 28 0x03938700 r/w Main Clock Frequency - static constexpr uint32_t RENDERMODE = 0x302010; // 1 0x00 r/w Rendering Mode: 0 = normal, 1 = single-line - static constexpr uint32_t SNAPY = 0x302014; // 11 0x0000 r/w Scan Line Select for RENDERMODE 1 - static constexpr uint32_t SNAPSHOT = 0x302018; // 1 - r Trigger for RENDERMODE 1 - static constexpr uint32_t SNAPFORMAT = 0x30201C; // 6 0x20 r/w Pixel Format for Scanline Readout - static constexpr uint32_t CPURESET = 0x302020; // 3 0x02 r/w RESET Bit2 Audio - Bit1 Touch - Bit0 Graphics - static constexpr uint32_t TAP_CRC = 0x302024; // 32 - r Live Video Tap - static constexpr uint32_t TAP_MASK = 0x302028; // 32 0xFFFFFFFF r/w Live Video Tap Mask - static constexpr uint32_t HCYCLE = 0x30202C; // 12 0x224 r/w Horizontal Total Cycle Count - static constexpr uint32_t HOFFSET = 0x302030; // 12 0x02B r/w Horizontal Display Start Offset - static constexpr uint32_t HSIZE = 0x302034; // 12 0x1E0 r/w Horizontal Display Pixel Count - static constexpr uint32_t HSYNC0 = 0x302038; // 12 0x000 r/w Horizontal Sync Fall Offset - static constexpr uint32_t HSYNC1 = 0x30203C; // 12 0x029 r/w Horizontal Sync Rise Offset - static constexpr uint32_t VCYCLE = 0x302040; // 12 0x124 r/w Vertical Total Cycle Count - static constexpr uint32_t VOFFSET = 0x302044; // 12 0x00C r/w Vertical Display Start Offset - static constexpr uint32_t VSIZE = 0x302048; // 12 0x110 r/w Vertical Display Line Count - static constexpr uint32_t VSYNC0 = 0x30204C; // 10 0x000 r/w Vertical Sync Fall Offset - static constexpr uint32_t VSYNC1 = 0x302050; // 10 0x00A r/w Vertical Sync Rise Offset - static constexpr uint32_t DLSWAP = 0x302054; // 2 0x00 r/w Display List Swap Control - static constexpr uint32_t ROTATE = 0x302058; // 3 0x00 r/w Screen 90,180, 270 degree rotate - static constexpr uint32_t OUTBITS = 0x30205C; // 9 0x1B6 r/w Output Resolution, 3x3x3 Bits - static constexpr uint32_t DITHER = 0x302060; // 1 0x01 r/w Output Dither Enable - static constexpr uint32_t SWIZZLE = 0x302064; // 4 0x00 r/w Output RGB Swizzle, Pin Change for PCB Routing - static constexpr uint32_t CSPREAD = 0x302068; // 1 0x01 r/w Output Clock Spreading Enable - static constexpr uint32_t PCLK_POL = 0x30206C; // 1 0x00 r/w PCLK Polarity: 0 = Rising Edge, 1 = Falling Edge - static constexpr uint32_t PCLK = 0x302070; // 8 0x00 r/w PCLK Frequency Divider, 0 = Disable Clock - static constexpr uint32_t TAG_X = 0x302074; // 11 0x000 r/w Tag Query X Coordinate - static constexpr uint32_t TAG_Y = 0x302078; // 11 0x000 r/w Tag Query Y Coordinate - static constexpr uint32_t TAG = 0x30207C; // 8 0x00 r Tag Query Result - static constexpr uint32_t VOL_PB = 0x302080; // 8 0xFF r/w Audio Playback Volume - static constexpr uint32_t VOL_SOUND = 0x302084; // 8 0xFF r/w Audio Synthesizer Volume - static constexpr uint32_t SOUND = 0x302088; // 16 0x0000 r/w Audio Sound Effect Select - static constexpr uint32_t PLAY = 0x30208C; // 1 0x00 r/w Audio Start Effect Playback - static constexpr uint32_t GPIO_DIR = 0x302090; // 8 0x80 r/w GPIO Pin Direction: 0 = Input , 1 = Output - static constexpr uint32_t GPIO = 0x302094; // 8 0x00 r/w GPIO Pin Values for 0, 1, 7 Drive Strength 2, 3, 4, 5, 6 - static constexpr uint32_t GPIOX_DIR = 0x302098; // 16 0x8000 r/w Extended GPIO Pin Direction - static constexpr uint32_t GPIOX = 0x30209C; // 16 0x0080 r/w Extended GPIO Pin Values - // Reserved Addr 0x3020A0 - // Reserved Addr 0x3020A4 - static constexpr uint32_t INT_FLAGS = 0x3020A8; // 8 0x00 r Interrupt Flags, Clear by Reading - static constexpr uint32_t INT_EN = 0x3020AC; // 1 0x00 r/w Global Interrupt Enable - static constexpr uint32_t INT_MASK = 0x3020B0; // 8 0xFF r/w Interrupt Enable Mask - static constexpr uint32_t PLAYBACK_START = 0x3020B4; // 20 0x00000 r/w Audio Playback RAM Start Address - static constexpr uint32_t PLAYBACK_LENGTH = 0x3020B8; // 20 0x00000 r/w Audio Playback Sample Length (Bytes) - static constexpr uint32_t PLAYBACK_READPTR = 0x3020BC; // 20 - r Audio Playback Read Pointer - static constexpr uint32_t PLAYBACK_FREQ = 0x3020C0; // 16 0x1F40 r/w Audio Playback Frequency (Hz) - static constexpr uint32_t PLAYBACK_FORMAT = 0x3020C4; // 2 0x00 r/w Audio Playback Format - static constexpr uint32_t PLAYBACK_LOOP = 0x3020C8; // 1 0x00 r/w Audio Playback Loop Enable - static constexpr uint32_t PLAYBACK_PLAY = 0x3020CC; // 1 0x00 r Audio Start Playback - static constexpr uint32_t PWM_HZ = 0x3020D0; // 14 0x00FA r/w Backlight PWM Frequency (Hz) - static constexpr uint32_t PWM_DUTY = 0x3020D4; // 8 0x80 r/w Backlight PWM Duty Cycle: 0 = 0%, 128 = 100% - static constexpr uint32_t MACRO_0 = 0x3020D8; // 32 0x00000000 r/w Display List Macro Command 0 - static constexpr uint32_t MACRO_1 = 0x3020DC; // 32 0x00000000 r/w Display List Macro Command 1 - // Reserved Addr 0x3020E0 - // Reserved Addr 0x3020E4 - // Reserved Addr 0x3020E8 - // Reserved Addr 0x3020EC - // Reserved Addr 0x3020F0 - // Reserved Addr 0x3020F4 - static constexpr uint32_t CMD_READ = 0x3020F8; // 12 0x000 r/w Command Buffer Read Pointer - static constexpr uint32_t CMD_WRITE = 0x3020FC; // 12 0x000 r/w Command Buffer Write Pointer - static constexpr uint32_t CMD_DL = 0x302100; // 13 0x0000 r/w Command Display List Offset - static constexpr uint32_t TOUCH_MODE = 0x302104; // 2 0x03 r/w Touch-Screen Sampling Mode - static constexpr uint32_t TOUCH_ADC_MODE = 0x302108; // 1 0x01 r/w Select Single Ended or Differential Sampling - static constexpr uint32_t TOUCH_CHARGE = 0x30210C; // 16 0x1770 r/w Touch Screen Charge Time, n x 6 Clocks - static constexpr uint32_t TOUCH_SETTLE = 0x302110; // 4 0x03 r/w Touch-Screen Settle Time, n x 6 Clocks - static constexpr uint32_t TOUCH_OVERSAMPLE = 0x302114; // 4 0x07 r/w Touch-Screen Oversample Factor - static constexpr uint32_t TOUCH_RZTHRESH = 0x302118; // 16 0xFFFF r/w Touch-Screen Resistance Threshold - static constexpr uint32_t TOUCH_RAW_XY = 0x30211C; // 32 - r Touch-Screen Raw (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_RZ = 0x302120; // 16 - r Touch-Screen Resistance - static constexpr uint32_t TOUCH_SCREEN_XY = 0x302124; // 32 - r Touch-Screen Screen (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_TAG_XY = 0x302128; // 32 - r Touch-Screen Tag 0 Lookup (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_TAG = 0x30212C; // 8 - r Touch-Screen Tag 0 Result - static constexpr uint32_t TOUCH_TAG1_XY = 0x302130; // 32 - r Touch-Screen Tag 1 Lookup - static constexpr uint32_t TOUCH_TAG1 = 0x302134; // 8 - r Touch-Screen Tag 1 Result - static constexpr uint32_t TOUCH_TAG2_XY = 0x302138; // 32 - r Touch-Screen Tag 2 Lookup - static constexpr uint32_t TOUCH_TAG2 = 0x30213C; // 8 - r Touch-Screen Tag 2 Result - static constexpr uint32_t TOUCH_TAG3_XY = 0x302140; // 32 - r Touch-Screen Tag 3 Lookup - static constexpr uint32_t TOUCH_TAG3 = 0x302144; // 8 - r Touch-Screen Tag 3 Result - static constexpr uint32_t TOUCH_TAG4_XY = 0x302148; // 32 - r Touch-Screen Tag 4 Lookup - static constexpr uint32_t TOUCH_TAG4 = 0x30214C; // 8 - r Touch-Screen Tag 4 Result - static constexpr uint32_t TOUCH_TRANSFORM_A = 0x302150; // 32 0x00010000 r/w Touch-Screen Transform Coefficient A (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_B = 0x302154; // 32 0x00000000 r/w Touch-Screen Transform Coefficient B (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_C = 0x302158; // 32 0x00000000 r/w Touch-Screen Transform Coefficient C (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_D = 0x30215C; // 32 0x00000000 r/w Touch-Screen Transform Coefficient D (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_E = 0x302160; // 32 0x00010000 r/w Touch-Screen Transform Coefficient E (s15.16) - static constexpr uint32_t TOUCH_TRANSFORM_F = 0x302164; // 32 0x00000000 r/w Touch-Screen Transform Coefficient F (s15.16) - static constexpr uint32_t TOUCH_CONFIG = 0x302168; // 16 0x8381 r/w Touch Configuration - static constexpr uint32_t CTOUCH_TOUCH4_X = 0x30216C; // 16 - r Extended Mode Touch Screen - // Reserved Addresses 0x302170 - static constexpr uint32_t BIST_EN = 0x302174; // 1 0 r/w BIST Memory Mapping Enable - // Reserved Addr 0x302178 - // Reserved Addr 0x30217C - static constexpr uint32_t TRIM = 0x302180; // 8 0 r/w Internal Clock Trimming - static constexpr uint32_t ANA_COMP = 0x302184; // 8 0 r/w Analog Control Register - static constexpr uint32_t SPI_WIDTH = 0x302188; // 3 0 r/w QSPI Bus Width Setting - static constexpr uint32_t TOUCH_DIRECT_XY = 0x30218C; // 32 - r Touch-Screen Direct Conversions XY (x-MSB16; y-LSB16) - static constexpr uint32_t TOUCH_DIRECT_Z1Z2 = 0x302190; // 32 - r Touch-Screen Direct Conversions Z (z1-MSB16; z2-LSB16) - // Reserved Addresses 0x302194 - 0x302560 - static constexpr uint32_t DATESTAMP = 0x320564; // 128 - r Stamp Date Code - static constexpr uint32_t CMDB_SPACE = 0x302574; // 12 0xFFC r/w Command DL Space Available - static constexpr uint32_t CMDB_WRITE = 0x302578; // 32 0 w Command DL Write - - static constexpr uint32_t TRACKER = 0x309000; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - static constexpr uint32_t TRACKER_1 = 0x309004; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - static constexpr uint32_t TRACKER_2 = 0x309008; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - static constexpr uint32_t TRACKER_3 = 0x30900C; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - static constexpr uint32_t TRACKER_4 = 0x309010; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) - - static constexpr uint32_t MEDIAFIFO_READ = 0x309014; // 32 0x00000000 r/w Media FIFO read pointer - static constexpr uint32_t MEDIAFIFO_WRITE = 0x309018; // 32 0x00000000 r/w Media FIFO write pointer - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h deleted file mode 100644 index e1439a75c6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h +++ /dev/null @@ -1,128 +0,0 @@ -/***************** - * resolutions.h * - *****************/ - -/**************************************************************************** - * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * - * 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 - -/*** - * The FT8xx has odd registers that don't correspond to timing values in - * display datasheets. This macro computes the register values using the - * formulas given in the document: - * - * Bridgetek Application Note - * AN_336 FT8xx - * Selecting an LCD Display - * Version 2.1 - * Issue Date: 2017-11-14 - * - */ -#define COMPUTE_REGS_FROM_DATASHEET \ - constexpr uint16_t Hoffset = thfp + thb - 1; \ - constexpr uint16_t Hcycle = th; \ - constexpr uint16_t Hsync0 = thfp - 1 ; \ - constexpr uint16_t Hsync1 = thfp + thpw - 1; \ - constexpr uint16_t Voffset = tvfp + tvb - 1; \ - constexpr uint16_t Vcycle = tv; \ - constexpr uint16_t Vsync0 = tvfp - 1; \ - constexpr uint16_t Vsync1 = tvfp + tvpw - 1; \ - static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \ - static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv"); - -#ifdef TOUCH_UI_320x240 - namespace FTDI { - constexpr uint8_t Pclk = 8; - constexpr uint8_t Pclkpol = 0; - constexpr uint16_t Hsize = 320; - constexpr uint16_t Vsize = 240; - constexpr uint16_t Vsync0 = 0; - constexpr uint16_t Vsync1 = 2; - constexpr uint16_t Voffset = 13; - constexpr uint16_t Vcycle = 263; - constexpr uint16_t Hsync0 = 0; - constexpr uint16_t Hsync1 = 10; - constexpr uint16_t Hoffset = 70; - constexpr uint16_t Hcycle = 408; - - constexpr uint32_t default_transform_a = 0x000054ad; - constexpr uint32_t default_transform_b = 0xffffff52; - constexpr uint32_t default_transform_c = 0xfff7f6e4; - constexpr uint32_t default_transform_d = 0x00000065; - constexpr uint32_t default_transform_e = 0xffffbe3b; - constexpr uint32_t default_transform_f = 0x00f68e75; - } - -#elif defined(TOUCH_UI_480x272) - namespace FTDI { - constexpr uint8_t Pclk = 7; - constexpr uint8_t Pclkpol = 1; - constexpr uint16_t Hsize = 480; - constexpr uint16_t Vsize = 272; - - constexpr uint16_t th = 525; // One horizontal line - constexpr uint16_t thfp = 43; // HS Front porch - constexpr uint16_t thb = 2; // HS Back porch (blanking) - constexpr uint16_t thpw = 41; // HS pulse width - - constexpr uint16_t tv = 286; // Vertical period time - constexpr uint16_t tvfp = 12; // VS Front porch - constexpr uint16_t tvb = 2; // VS Back porch (blanking) - constexpr uint16_t tvpw = 10; // VS pulse width - - COMPUTE_REGS_FROM_DATASHEET - - constexpr uint32_t default_transform_a = 0x00008100; - constexpr uint32_t default_transform_b = 0x00000000; - constexpr uint32_t default_transform_c = 0xFFF18000; - constexpr uint32_t default_transform_d = 0x00000000; - constexpr uint32_t default_transform_e = 0xFFFFB100; - constexpr uint32_t default_transform_f = 0x0120D000; - } - -#elif defined(TOUCH_UI_800x480) - namespace FTDI { - constexpr uint8_t Pclk = 3; - constexpr uint8_t Pclkpol = 1; - constexpr uint16_t Hsize = 800; - constexpr uint16_t Vsize = 480; - - constexpr uint16_t th = 1056; // One horizontal line - constexpr uint16_t thfp = 210; // HS Front porch - constexpr uint16_t thb = 46; // HS Back porch (blanking) - constexpr uint16_t thpw = 23; // HS pulse width - - constexpr uint16_t tv = 525; // Vertical period time - constexpr uint16_t tvfp = 22; // VS Front porch - constexpr uint16_t tvb = 23; // VS Back porch (blanking) - constexpr uint16_t tvpw = 10; // VS pulse width - - COMPUTE_REGS_FROM_DATASHEET - - constexpr uint32_t default_transform_a = 0x0000D8B9; - constexpr uint32_t default_transform_b = 0x00000124; - constexpr uint32_t default_transform_c = 0xFFE23926; - constexpr uint32_t default_transform_d = 0xFFFFFF51; - constexpr uint32_t default_transform_e = 0xFFFF7E4F; - constexpr uint32_t default_transform_f = 0x01F0AF70; - } - -#else - #error Unknown or no TOUCH_UI_FTDI_EVE display resolution specified. To add a display resolution, modify "ftdi_eve_resolutions.h" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp deleted file mode 100644 index 7f666be45b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/*********** - * spi.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 "ftdi_basic.h" - -#ifdef FTDI_BASIC - -/********************************* SPI Functions *********************************/ - -namespace FTDI { - #ifndef CLCD_USE_SOFT_SPI - SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0); - #endif - - 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 - - SET_OUTPUT(CLCD_SPI_CS); - WRITE(CLCD_SPI_CS, 1); - - #ifdef SPI_FLASH_SS - SET_OUTPUT(SPI_FLASH_SS); - WRITE(SPI_FLASH_SS, 1); - #endif - - #ifdef CLCD_USE_SOFT_SPI - SET_OUTPUT(CLCD_SOFT_SPI_MOSI); - WRITE(CLCD_SOFT_SPI_MOSI, 1); - - SET_OUTPUT(CLCD_SOFT_SPI_SCLK); - WRITE(CLCD_SOFT_SPI_SCLK, 0); - - SET_INPUT_PULLUP(CLCD_SOFT_SPI_MISO); - #else - ::SPI.begin(); - #endif - } - - #ifdef CLCD_USE_SOFT_SPI - uint8_t SPI::_soft_spi_xfer (uint8_t spiOutByte) { - uint8_t spiIndex = 0x80; - uint8_t spiInByte = 0; - uint8_t k; - - noInterrupts(); - 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; - spiIndex >>= 1; - } - interrupts(); - return spiInByte; - } - #endif - - #ifdef CLCD_USE_SOFT_SPI - void SPI::_soft_spi_send (uint8_t spiOutByte) { - uint8_t k, spiIndex = 0x80; - - noInterrupts(); - 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(); - } - #endif - - void SPI::spi_read_bulk (void *data, uint16_t len) { - uint8_t* p = (uint8_t *)data; - #ifndef CLCD_USE_SOFT_SPI - ::SPI.transfer(p, len); - #else - while (len--) *p++ = spi_recv(); - #endif - } - - bool SPI::spi_verify_bulk (const void *data, uint16_t len) { - const uint8_t* p = (const uint8_t *)data; - while (len--) if (*p++ != spi_recv()) return false; - return true; - } - - // CLCD SPI - Chip Select - void SPI::spi_ftdi_select() { - #ifndef CLCD_USE_SOFT_SPI - ::SPI.beginTransaction(spi_settings); - #endif - WRITE(CLCD_SPI_CS, 0); - delayMicroseconds(1); - } - - // CLCD SPI - Chip Deselect - void SPI::spi_ftdi_deselect() { - WRITE(CLCD_SPI_CS, 1); - #ifndef CLCD_USE_SOFT_SPI - ::SPI.endTransaction(); - #endif - } - - #ifdef SPI_FLASH_SS - // Serial SPI Flash SPI - Chip Select - void SPI::spi_flash_select () { - #ifndef CLCD_USE_SOFT_SPI - ::SPI.beginTransaction(spi_settings); - #endif - WRITE(SPI_FLASH_SS, 0); - delayMicroseconds(1); - } - - // Serial SPI Flash SPI - Chip Deselect - void SPI::spi_flash_deselect () { - WRITE(SPI_FLASH_SS, 1); - #ifndef CLCD_USE_SOFT_SPI - ::SPI.endTransaction(); - #endif - } - #endif - - // Not really a SPI signal... - void SPI::ftdi_reset() { - WRITE(CLCD_MOD_RESET, 0); - delay(6); /* minimum time for power-down is 5ms */ - WRITE(CLCD_MOD_RESET, 1); - delay(21); /* minimum time to allow from rising PD_N to first access is 20ms */ - } - - // Not really a SPI signal... - void SPI::test_pulse() { - #ifdef CLCD_AUX_0 - WRITE(CLCD_AUX_0, 1); - delayMicroseconds(10); - WRITE(CLCD_AUX_0, 0); - #endif - } -} -#endif // FTDI_BASIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h deleted file mode 100644 index 38f0e35d5a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h +++ /dev/null @@ -1,128 +0,0 @@ -/********* - * spi.h * - *********/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#ifndef CLCD_USE_SOFT_SPI - #include -#endif - -namespace FTDI { - namespace SPI { - #ifndef CLCD_USE_SOFT_SPI - extern SPISettings spi_settings; - #endif - - uint8_t _soft_spi_xfer (uint8_t val); - void _soft_spi_send (uint8_t val); - - void spi_init (); - - void spi_ftdi_select (); - void spi_ftdi_deselect (); - - void spi_flash_select (); - void spi_flash_deselect (); - - inline uint8_t spi_recv() { - #ifdef CLCD_USE_SOFT_SPI - return _soft_spi_xfer(0x00); - #else - return ::SPI.transfer(0x00); - #endif - }; - - inline void spi_send (uint8_t val) { - #ifdef CLCD_USE_SOFT_SPI - _soft_spi_send(val); - #else - ::SPI.transfer(val); - #endif - }; - - inline void spi_write_8 (uint8_t val) {spi_send(val);}; - inline uint8_t spi_read_8 () {return spi_recv();}; - - namespace least_significant_byte_first { - inline void spi_write_16 (uint16_t val) {spi_send(val >> 0); - spi_send(val >> 8);}; - inline void spi_write_32 (uint32_t val) {spi_send(val >> 0); - spi_send(val >> 8); - spi_send(val >> 16); - spi_send(val >> 24);}; - - inline uint8_t spi_read_8 () {return spi_recv();}; - inline uint16_t spi_read_16 () {return (((uint16_t) spi_recv()) << 0) | - (((uint16_t) spi_recv()) << 8);}; - inline uint32_t spi_read_32 () {return (((uint32_t) spi_recv()) << 0) | - (((uint32_t) spi_recv()) << 8) | - (((uint32_t) spi_recv()) << 16) | - (((uint32_t) spi_recv()) << 24);}; - } - - namespace most_significant_byte_first { - inline void spi_write_16 (uint16_t val) {spi_send(val >> 8); - spi_send(val >> 0);}; - inline void spi_write_24 (uint32_t val) {spi_send(val >> 16); - spi_send(val >> 8); - spi_send(val >> 0);}; - inline void spi_write_32 (uint32_t val) {spi_send(val >> 24); - spi_send(val >> 16); - spi_send(val >> 8); - spi_send(val >> 0);}; - - inline uint16_t spi_read_16 () {return (((uint16_t) spi_recv()) << 8) | - (((uint16_t) spi_recv()) << 0);}; - inline uint32_t spi_read_32 () {return (((uint32_t) spi_recv()) << 24) | - (((uint32_t) spi_recv()) << 16) | - (((uint32_t) spi_recv()) << 8) | - (((uint32_t) spi_recv()) << 0);}; - } - - inline uint8_t ram_write(const uint8_t *p) {return *p;} - inline uint8_t pgm_write(const uint8_t *p) {return pgm_read_byte(p);} - - typedef uint8_t (*bulk_write_op)(const uint8_t*); - - // Generic template for function for writing multiple bytes, plus padding bytes. - // The template parameter op is an inlineable function which is applied to each byte. - - template - void spi_write_bulk(const void *data, uint16_t len, uint8_t padding) { - const uint8_t* p = (const uint8_t *)data; - while (len--) spi_send(byte_op(p++)); - while (padding--) spi_send(0); - } - - template - void spi_write_bulk(const void *data, uint16_t len) { - const uint8_t* p = (const uint8_t *)data; - while (len--) spi_send(byte_op(p++)); - } - - void spi_read_bulk( void *data, uint16_t len); - bool spi_verify_bulk(const void *data, uint16_t len); - - void ftdi_reset(); - void test_pulse(); - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h deleted file mode 100644 index 0ef9779c71..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** - * 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 - -#include "../config.h" - -#ifdef __MARLIN_FIRMWARE__ - - // Marlin will define the I/O functions for us - #if ENABLED(TOUCH_UI_FTDI_EVE) - #define FTDI_BASIC - #define FTDI_EXTENDED - #endif - -#else // !__MARLIN_FIRMWARE__ - - #include - - #ifndef CLCD_USE_SOFT_SPI - #include - #endif - - namespace fast_io { - - template - struct port_pin { - typedef port_t port; - static inline void set_high() {port::port() = (port::port() | bits);} - static inline void set_low() {port::port() = (port::port() & (~bits));} - static inline void set_input() {port::ddr() = (port::ddr() & (~bits));} - static inline void set_input_pullup() {set_input(); set_high();} - static inline void set_output() {port::ddr() = (port::ddr() | bits);} - static inline uint8_t read() {return port::pin() & bits;} - static inline void write(bool v) {if (v) set_high(); else set_low();} - }; - - #define MAKE_AVR_PORT_PINS(ID) \ - struct port_##ID { \ - static volatile uint8_t &pin() {return PIN##ID;}; \ - static volatile uint8_t &port() {return PORT##ID;}; \ - static volatile uint8_t &ddr() {return DDR##ID;}; \ - }; \ - typedef port_pin AVR_##ID##0; \ - typedef port_pin AVR_##ID##1; \ - typedef port_pin AVR_##ID##2; \ - typedef port_pin AVR_##ID##3; \ - typedef port_pin AVR_##ID##4; \ - typedef port_pin AVR_##ID##5; \ - typedef port_pin AVR_##ID##6; \ - typedef port_pin AVR_##ID##7; - - #ifdef PORTA - MAKE_AVR_PORT_PINS(A); - #endif - #ifdef PORTB - MAKE_AVR_PORT_PINS(B); - #endif - #ifdef PORTC - MAKE_AVR_PORT_PINS(C); - #endif - #ifdef PORTD - MAKE_AVR_PORT_PINS(D); - #endif - #ifdef PORTE - MAKE_AVR_PORT_PINS(E); - #endif - #ifdef PORTF - MAKE_AVR_PORT_PINS(F); - #endif - #ifdef PORTG - MAKE_AVR_PORT_PINS(G); - #endif - #ifdef PORTH - MAKE_AVR_PORT_PINS(H); - #endif - #ifdef PORTJ - MAKE_AVR_PORT_PINS(J); - #endif - #ifdef PORTK - MAKE_AVR_PORT_PINS(K); - #endif - #ifdef PORTL - MAKE_AVR_PORT_PINS(L); - #endif - #ifdef PORTQ - MAKE_AVR_PORT_PINS(Q); - #endif - #ifdef PORTR - MAKE_AVR_PORT_PINS(R); - #endif - - #undef MAKE_AVR_PORT_PINS - - template - struct arduino_digital_pin { - static constexpr uint8_t pin = p; - static inline void set_high() {digitalWrite(p, HIGH);} - static inline void set_low() {digitalWrite(p, LOW);} - static inline void set_input() {pinMode(p, INPUT);} - static inline void set_input_pullup() {pinMode(p, INPUT_PULLUP);} - static inline void set_output() {pinMode(p, OUTPUT);} - static inline uint8_t read() {return digitalRead(p);} - static inline void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} - }; - - #define MAKE_ARDUINO_PINS(ID) typedef arduino_digital_pin ARDUINO_DIGITAL_##ID; - MAKE_ARDUINO_PINS( 0); - MAKE_ARDUINO_PINS( 1); - MAKE_ARDUINO_PINS( 2); - MAKE_ARDUINO_PINS( 3); - MAKE_ARDUINO_PINS( 4); - MAKE_ARDUINO_PINS( 5); - MAKE_ARDUINO_PINS( 6); - MAKE_ARDUINO_PINS( 7); - MAKE_ARDUINO_PINS( 8); - MAKE_ARDUINO_PINS( 9); - MAKE_ARDUINO_PINS(10); - MAKE_ARDUINO_PINS(11); - MAKE_ARDUINO_PINS(12); - MAKE_ARDUINO_PINS(13); - MAKE_ARDUINO_PINS(14); - MAKE_ARDUINO_PINS(15); - MAKE_ARDUINO_PINS(16); - MAKE_ARDUINO_PINS(17); - MAKE_ARDUINO_PINS(18); - MAKE_ARDUINO_PINS(19); - MAKE_ARDUINO_PINS(10); - MAKE_ARDUINO_PINS(21); - MAKE_ARDUINO_PINS(22); - MAKE_ARDUINO_PINS(23); - MAKE_ARDUINO_PINS(24); - MAKE_ARDUINO_PINS(25); - MAKE_ARDUINO_PINS(26); - MAKE_ARDUINO_PINS(27); - MAKE_ARDUINO_PINS(28); - MAKE_ARDUINO_PINS(29); - MAKE_ARDUINO_PINS(30); - MAKE_ARDUINO_PINS(31); - MAKE_ARDUINO_PINS(32); - MAKE_ARDUINO_PINS(33); - MAKE_ARDUINO_PINS(34); - MAKE_ARDUINO_PINS(35); - MAKE_ARDUINO_PINS(36); - MAKE_ARDUINO_PINS(37); - MAKE_ARDUINO_PINS(38); - MAKE_ARDUINO_PINS(39); - MAKE_ARDUINO_PINS(40); - MAKE_ARDUINO_PINS(41); - MAKE_ARDUINO_PINS(42); - MAKE_ARDUINO_PINS(43); - MAKE_ARDUINO_PINS(44); - MAKE_ARDUINO_PINS(45); - MAKE_ARDUINO_PINS(46); - MAKE_ARDUINO_PINS(47); - MAKE_ARDUINO_PINS(48); - MAKE_ARDUINO_PINS(49); - MAKE_ARDUINO_PINS(50); - MAKE_ARDUINO_PINS(51); - MAKE_ARDUINO_PINS(52); - MAKE_ARDUINO_PINS(53); - #undef MAKE_ARDUINO_PINS - } // namespace fast_io - - #define SET_INPUT(pin) fast_io::pin::set_input() - #define SET_INPUT_PULLUP(pin) fast_io::pin::set_input(); fast_io::pin::set_high() - #define SET_OUTPUT(pin) fast_io::pin::set_output() - #define READ(pin) fast_io::pin::read() - #define WRITE(pin, value) fast_io::pin::write(value) - - #ifndef pgm_read_word_far - #define pgm_read_word_far pgm_read_word - #endif - - #ifndef pgm_read_dword_far - #define pgm_read_dword_far pgm_read_dword - #endif - - #ifndef pgm_read_ptr_far - #define pgm_read_ptr_far pgm_read_ptr - #endif - - #define SERIAL_ECHO_START() - #define SERIAL_ECHOLNPGM(str) Serial.println(F(str)) - #define SERIAL_ECHOPGM(str) Serial.print(F(str)) - #define SERIAL_ECHO_MSG(str) Serial.println(str) - #define SERIAL_ECHOLNPAIR(str, val) {Serial.print(F(str)); Serial.println(val);} - #define SERIAL_ECHOPAIR(str, val) {Serial.print(F(str)); Serial.print(val);} - - #define safe_delay delay - - // Define macros for compatibility - - #define _CAT(a, ...) a ## __VA_ARGS__ - #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 BOTH(A,B) (ENABLED(A) && ENABLED(B)) - - // 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 - #endif - -#endif // !__MARLIN_FIRMWARE__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h deleted file mode 100644 index 2a095c3445..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h +++ /dev/null @@ -1,49 +0,0 @@ -/***************** - * bitmap_info.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 - -#ifndef FORCEDINLINE - #define FORCEDINLINE __attribute__((always_inline)) inline -#endif - -namespace FTDI { - // The following functions *must* be inlined since we are relying on the compiler to do - // substitution of the constants from the data structure rather than actually storing - // it in PROGMEM (which would fail, since we are not using pgm_read to read them). - // Plus, by inlining, all the equations are evaluated at compile-time as everything - // should be a constant. - - typedef struct { - const uint8_t format; - const uint16_t linestride; - const uint8_t filter; - const uint8_t wrapx; - const uint8_t wrapy; - const uint32_t RAMG_offset; - const uint16_t width; - const uint16_t height; - } bitmap_info_t; - - FORCEDINLINE uint32_t BITMAP_SOURCE (const bitmap_info_t& info) {return BITMAP_SOURCE (ftdi_memory_map::RAM_G + info.RAMG_offset);}; - FORCEDINLINE uint32_t BITMAP_LAYOUT (const bitmap_info_t& info) {return BITMAP_LAYOUT (info.format, info.linestride, info.height);}; - FORCEDINLINE uint32_t BITMAP_SIZE (const bitmap_info_t& info) {return BITMAP_SIZE (info.filter, info.wrapx, info.wrapy, info.width, info.height);} -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp deleted file mode 100644 index 08d2082020..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/************************* - * command_processor.cpp * - *************************/ - -/**************************************************************************** - * Written By Marcio Teixeira 2018 * - * * - * 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 - -CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func; -bool CommandProcessor::is_tracking = false; - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h deleted file mode 100644 index b045ca203a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ /dev/null @@ -1,434 +0,0 @@ -/*********************** - * command_processor.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 - -typedef struct { - uint32_t bg; - uint32_t grad; - uint32_t fg; - 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 - * defining user interfaces much easier. - * - * - Implements chaining on all methods - * - Automatically adds text to button, toggle, text and keys. - * - Constrains all widgets to fit inside a box for ease of layout. - * - Font size is specified using a chained modifier. - * - Option argument is given the default OPT_3D value. - */ - -class CommandProcessor : public CLCD::CommandFifo { - public: - static constexpr uint8_t STYLE_DISABLED = 0x80; - - private: - static bool default_button_style_func(CommandProcessor &, uint8_t tag, uint8_t & /*style*/, uint16_t &options, bool) { - if (tag != 0 && FTDI::EventLoop::get_pressed_tag() == tag) { - options = FTDI::OPT_FLAT; - } - return false; - } - - typedef bool btn_style_func_t(CommandProcessor &cmd, uint8_t tag, uint8_t &style, uint16_t &options, bool post); - - static btn_style_func_t *_btn_style_callback; - static bool is_tracking; - int8_t _font = 26, _tag = 0; - uint8_t _style = 0; - - protected: - // Returns the cannonical thickness of a widget (i.e. the height of a toggle element) - uint16_t widget_thickness() { - CLCD::FontMetrics fm(_font); - return fm.height * 20.0/16; - } - - 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; - if (w > h) { - x += tracker ? th * 2.5 : th; - y += (h - th) / 2; - w -= tracker ? th * 5.0 : th * 2; - h = th; - } else { - x += (w - th) / 2; - y += tracker ? th * 2.5 : th; - w = th; - h -= tracker ? th * 5.0 : th * 2; - } - } - - 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; - w = 1; - h = 1; - return r; - } - - public: - // Helper method for setting all colors at once - inline CommandProcessor& colors(const btn_colors &colors) { - cmd(FTDI::COLOR_RGB(colors.rgb)) - .gradcolor(colors.grad) - .fgcolor(colors.fg) - .bgcolor(colors.bg); - return *this; - } - - inline CommandProcessor& bitmap_size(uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height) { - cmd(FTDI::BITMAP_SIZE(filter, wrapx, wrapy, width, height)); - #if FTDI_API_LEVEL >= 810 - if (FTDI::ftdi_chip >= 810) - cmd(FTDI::BITMAP_SIZE_H(width >> 9, height >> 9)); - #endif - return *this; - } - - inline CommandProcessor& bitmap_layout(uint8_t format, uint16_t linestride, uint16_t height) { - cmd(FTDI::BITMAP_LAYOUT(format, linestride, height)); - #if FTDI_API_LEVEL >= 810 - if (FTDI::ftdi_chip >= 810) - cmd(FTDI::BITMAP_LAYOUT_H(linestride >> 10, height >> 9)); - #endif - return *this; - } - - inline CommandProcessor& set_button_style_callback(const btn_style_func_t *func) { - _btn_style_callback = func ? func : default_button_style_func; - return *this; - } - - inline CommandProcessor& tag (uint8_t tag) {_tag = tag; cmd(FTDI::TAG(tag)); return *this;} - - inline CommandProcessor& font (int16_t font) {_font = font; return *this;} - - inline CommandProcessor& enabled (bool enabled=false) { - if (enabled) - _style &= ~STYLE_DISABLED; - else - _style |= STYLE_DISABLED; - return *this; - } - - inline CommandProcessor& style (uint8_t style) { - _style = (_style & STYLE_DISABLED) | style; - return *this; - } - - // Wrap all the CommandFifo routines to allow method chaining - - inline CommandProcessor& cmd (uint32_t cmd32) {CLCD::CommandFifo::cmd(cmd32); return *this;} - inline CommandProcessor& cmd (void* data, uint16_t len) {CLCD::CommandFifo::cmd(data, len); return *this;} - inline CommandProcessor& execute() {CLCD::CommandFifo::execute(); return *this;} - - inline CommandProcessor& fgcolor (uint32_t rgb) {CLCD::CommandFifo::fgcolor(rgb); return *this;} - inline CommandProcessor& bgcolor (uint32_t rgb) {CLCD::CommandFifo::bgcolor(rgb); return *this;} - inline CommandProcessor& gradcolor(uint32_t rgb) {CLCD::CommandFifo::gradcolor(rgb); return *this;} - - inline CommandProcessor& snapshot (uint32_t ptr) {CLCD::CommandFifo::snapshot(ptr); return *this;} - - inline CommandProcessor& loadimage(uint32_t ptr, uint32_t options) - {CLCD::CommandFifo::loadimage(ptr, options); return *this;} - inline CommandProcessor& sketch (int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format) - {CLCD::CommandFifo::sketch(x, y, w, h, ptr, format); return *this;} - inline CommandProcessor& screensaver () {CLCD::CommandFifo::screensaver(); return *this;} - #if FTDI_API_LEVEL >= 810 - inline CommandProcessor& setbase (uint8_t base) {CLCD::CommandFifo::setbase(base); return *this;} - #endif - inline CommandProcessor& loadidentity () {CLCD::CommandFifo::loadidentity(); return *this;} - inline CommandProcessor& scale (int32_t sx, int32_t sy) {CLCD::CommandFifo::scale(sx,sy); return *this;} - inline CommandProcessor& rotate (int32_t a) {CLCD::CommandFifo::rotate(a); return *this;} - inline CommandProcessor& translate(int32_t tx, int32_t ty) {CLCD::CommandFifo::translate(tx,ty); return *this;} - inline CommandProcessor& setmatrix () {CLCD::CommandFifo::setmatrix(); return *this;} - inline CommandProcessor& stop () {CLCD::CommandFifo::stop(); return *this;} - - inline CommandProcessor& memzero (uint32_t ptr, uint32_t size) - {CLCD::CommandFifo::memzero(ptr, size); return *this;} - inline CommandProcessor& memset (uint32_t ptr, uint32_t val, uint32_t size) - {CLCD::CommandFifo::memset(ptr, val, size); return *this;} - inline CommandProcessor& memcpy (uint32_t src, uint32_t dst, uint32_t size) - {CLCD::CommandFifo::memcpy(src, dst, size); return *this;} - inline CommandProcessor& memcrc (uint32_t ptr, uint32_t num, uint32_t result) - {CLCD::CommandFifo::memcrc(ptr, num, result); return *this;} - inline CommandProcessor& memwrite (uint32_t ptr, uint32_t value) - {CLCD::CommandFifo::memwrite(ptr, value); return *this;} - inline CommandProcessor& inflate (uint32_t ptr) - {CLCD::CommandFifo::inflate(ptr); return *this;} - inline CommandProcessor& getptr (uint32_t result) - {CLCD::CommandFifo::getptr(result); return *this;} - inline CommandProcessor& getprops (uint32_t ptr, uint32_t width, uint32_t height) - {CLCD::CommandFifo::getprops(ptr, width, height); return *this;} - - #if FTDI_API_LEVEL >= 810 - inline CommandProcessor& setbitmap (uint32_t ptr, uint16_t fmt, uint16_t w, uint16_t h) - {CLCD::CommandFifo::setbitmap(ptr,fmt,w,h); return *this;} - inline CommandProcessor& snapshot2 (uint32_t fmt, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h) - {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) - {CLCD::CommandFifo::gradient(x0,y0,rgb0,x1,y1,rgb1); return *this;} - - 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)); - 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 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 - 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. - - FORCEDINLINE CommandProcessor& track_linear(int16_t x, int16_t y, int16_t w, int16_t h, int16_t tag) { - linear_widget_box(x, y, w, h, true); - CLCD::CommandFifo::track(x, y, w, h, tag); - is_tracking = true; - return *this; - } - - FORCEDINLINE CommandProcessor& track_circular(int16_t x, int16_t y, int16_t w, int16_t h, int16_t tag) { - circular_widget_box(x,y, w, h); - CLCD::CommandFifo::track(x, y, w, h, tag); - is_tracking = true; - return *this; - } - - uint8_t track_tag (uint16_t &value) { - if (is_tracking) { - if (FTDI::EventLoop::is_touch_held()) { - return CLCD::get_tracker(value); - } else { - CLCD::CommandFifo::track(0, 0, 0, 0, 0); - CLCD::CommandFifo::execute(); - is_tracking = false; - } - } - return 0; - } - - FORCEDINLINE CommandProcessor& clock(int16_t x, int16_t y, int16_t w, int16_t h, int16_t hr, int16_t m, int16_t s, int16_t ms, uint16_t options = FTDI::OPT_3D) { - const uint16_t r = circular_widget_box(x, y, w, h); - CLCD::CommandFifo::clock(x, y, r, options, hr, m, s, ms); - return *this; - } - - FORCEDINLINE CommandProcessor& gauge(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t major, uint16_t minor, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { - const uint16_t r = circular_widget_box(x, y, w, h); - CLCD::CommandFifo::gauge(x, y, r, options, major, minor, val, range); - return *this; - } - - FORCEDINLINE CommandProcessor& dial(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t options = FTDI::OPT_3D) { - const uint16_t r = circular_widget_box(x, y, w, h); - CLCD::CommandFifo::dial(x, y, r, options, val); - return *this; - } - - FORCEDINLINE CommandProcessor& slider(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { - linear_widget_box(x, y, w, h); - CLCD::CommandFifo::slider(x, y, w, h, options, val, range); - return *this; - } - - FORCEDINLINE CommandProcessor& progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { - linear_widget_box(x, y, w, h); - CLCD::CommandFifo::progress(x, y, w, h, options, val, range); - return *this; - } - - FORCEDINLINE CommandProcessor& scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t size, uint16_t range, uint16_t options = 0) { - linear_widget_box(x, y, w, h); - CLCD::CommandFifo::scrollbar(x, y, w, h, options, val, size, range); - 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; - #ifdef TOUCH_UI_USE_UTF8 - const bool is_utf8 = has_utf8_chars(text); - #endif - 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; - apply_text_alignment(x, y, w, h, options); - CLCD::CommandFifo::number(x, y, _font, options, n); - return *this; - } - - 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; - 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; - } - - FORCEDINLINE CommandProcessor& icon(int16_t x, int16_t y, int16_t w, int16_t h, const FTDI::bitmap_info_t& info, const float scale = 1) { - using namespace FTDI; - cmd(BEGIN(BITMAPS)); - if (scale != 1) { - cmd(BITMAP_TRANSFORM_A(uint32_t(float(256)/scale))); - cmd(BITMAP_TRANSFORM_E(uint32_t(float(256)/scale))); - } - cmd(BITMAP_SIZE(info.filter, info.wrapx, info.wrapy, info.width*scale, info.height*scale)); - cmd(VERTEX2F((x + w/2 - info.width*scale/2)*16, (y + h/2 - info.height*scale/2)*16)); - if (scale != 1) { - cmd(BITMAP_TRANSFORM_A(256)); - cmd(BITMAP_TRANSFORM_E(256)); - } - return *this; - } - - template - CommandProcessor& button(int16_t x, int16_t y, int16_t w, int16_t h, T text, uint16_t options = FTDI::OPT_3D) { - using namespace FTDI; - bool styleModified = false; - if (_btn_style_callback) styleModified = _btn_style_callback(*this, _tag, _style, options, false); - #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; - } - - template - CommandProcessor& keys(int16_t x, int16_t y, int16_t w, int16_t h, T keys, uint16_t options = FTDI::OPT_3D) { - CLCD::CommandFifo::keys(x, y, w, h, _font, options); - CLCD::CommandFifo::str(keys); - return *this; - } - - FORCEDINLINE CommandProcessor& spinner(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t style = 0, uint16_t scale = 0) { - circular_widget_box(x, y, w, h); - CLCD::CommandFifo::spinner(x, y, style, scale); - return *this; - } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp deleted file mode 100644 index 9a55c55ae6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/**************** - * dl_cache.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 "ftdi_extended.h" - -#ifdef FTDI_EXTENDED - -/* The Display List Cache mechanism stores the display list corresponding - * to a menu into RAM_G so that on subsequent calls drawing the menu does - * not require as much SPI traffic. - * - * Layout of Cache memory: - * - * The cache memory begins with a table at - * DL_CACHE_START: each table entry contains - * an address and size for a cached DL slot. - * - * Immediately following the table is the - * DL_FREE_ADDR, which points to free cache - * space; following this is occupied DL space, - * and after that free space that is yet to - * be used. - * - * location data sizeof - * - * DL_CACHE_START slot0_addr 4 - * slot0_size 4 - * slot1_addr 4 - * slot1_size 4 - * ... - * slotN_addr 4 - * slotN_size 4 - * DL_FREE_ADDR dl_free_ptr 4 - * cached data - * ... - * dl_free_ptr empty space - * ... - */ - -#define DL_CACHE_START MAP::RAM_G_SIZE - 0xFFFF -#define DL_FREE_ADDR DL_CACHE_START + DL_CACHE_SLOTS * 8 - -using namespace FTDI; - -// The init function ensures all cache locations are marked as empty - -void DLCache::init() { - CLCD::mem_write_32(DL_FREE_ADDR, DL_FREE_ADDR + 4); - for(uint8_t slot = 0; slot < DL_CACHE_SLOTS; slot++) { - save_slot(slot, 0, 0); - } -} - -bool DLCache::has_data() { - return dl_size != 0; -} - -bool DLCache::wait_until_idle() { - const unsigned long startTime = millis(); - do { - if ((millis() - startTime) > 250) { - SERIAL_ECHO_MSG("Timeout on DL_Cache::Wait_Until_Idle()"); - CLCD::CommandFifo::reset(); - return false; - } - #ifdef __MARLIN_FIRMWARE__ - ExtUI::yield(); - #endif - } while (CLCD::CommandFifo::is_processing()); - return true; -} - -/* This caches the current display list in RAMG so - * that it can be appended later. The memory is - * dynamically allocated following DL_FREE_ADDR. - * - * If num_bytes is provided, then that many bytes - * will be reserved so that the cache may be re-written - * later with potentially a bigger DL. - */ - -bool DLCache::store(uint32_t num_bytes /* = 0*/) { - CLCD::CommandFifo cmd; - - // Execute any commands already in the FIFO - cmd.execute(); - if (!wait_until_idle()) - return false; - - // Figure out how long the display list is - uint32_t new_dl_size = CLCD::mem_read_32(REG::CMD_DL) & 0x1FFF; - uint32_t free_space = 0; - uint32_t dl_alloc = 0; - - if (dl_addr == 0) { - // If we are allocating new space... - dl_addr = CLCD::mem_read_32(DL_FREE_ADDR); - free_space = MAP::RAM_G_SIZE - dl_addr; - dl_alloc = num_bytes ?: new_dl_size; - dl_size = new_dl_size; - } else { - // Otherwise, we can only store as much space - // as was previously allocated. - free_space = num_bytes ?: dl_size; - dl_alloc = 0; - dl_size = new_dl_size; - } - - if (dl_size > free_space) { - // Not enough memory to cache the display list. - #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); - #endif - return false; - } else { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR ("Saving DL to RAMG cache, bytes: ", dl_size); - SERIAL_ECHOLNPAIR(" Free space: ", free_space); - #endif - cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size); - cmd.execute(); - save_slot(dl_slot, dl_addr, dl_size); - if (dl_alloc > 0) { - // If we allocated space dynamically, then adjust dl_free_addr. - CLCD::mem_write_32(DL_FREE_ADDR, dl_addr + dl_alloc); - } - return true; - } -} - -void DLCache::save_slot(uint8_t dl_slot, uint32_t dl_addr, uint32_t dl_size) { - CLCD::mem_write_32(DL_CACHE_START + dl_slot * 8 + 0, dl_addr); - CLCD::mem_write_32(DL_CACHE_START + dl_slot * 8 + 4, dl_size); -} - -void DLCache::load_slot() { - dl_addr = CLCD::mem_read_32(DL_CACHE_START + dl_slot * 8 + 0); - dl_size = CLCD::mem_read_32(DL_CACHE_START + dl_slot * 8 + 4); -} - -void DLCache::append() { - CLCD::CommandFifo cmd; - cmd.append(dl_addr, dl_size); - #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)); - #endif -} - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h deleted file mode 100644 index f025b6a18d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h +++ /dev/null @@ -1,69 +0,0 @@ -/************** - * dl_cache.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 - -/******************* DISPLAY LIST CACHE MANAGEMENT ************************/ -/* The Display List Cache mechanism stores the display list corresponding - * to a menu into RAM_G so that on subsequent calls drawing the menu does - * not require as much SPI traffic. Dynamic content, such as indicators, - * should not be cached. - * - * The DLCache can be used like so: - * - * void some_function() { - * DLCache dlcache(UNIQUE_ID); - * - * if (dlcache.hasData()) { - * dlcache.append(); - * } else { - * // Add stuff to the DL - * dlcache.store(); - * } - */ -class DLCache { - private: - typedef FTDI::ftdi_registers REG; - typedef FTDI::ftdi_memory_map MAP; - - uint8_t dl_slot; - uint32_t dl_addr; - uint16_t dl_size; - - void load_slot(); - static void save_slot(uint8_t dl_slot, uint32_t dl_addr, uint32_t dl_size); - - bool wait_until_idle(); - - public: - static void init(); - - DLCache(uint8_t slot) { - dl_slot = slot; - load_slot(); - } - - bool has_data(); - bool store(uint32_t num_bytes = 0); - void append(); -}; - -#define DL_CACHE_SLOTS 250 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp deleted file mode 100644 index f0f693bfd8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/****************** - * event_loop.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 "ftdi_extended.h" - -#ifdef FTDI_EXTENDED -using namespace FTDI; - -enum { - UNPRESSED = 0x00 -}; - -tiny_timer_t touch_timer; -UIData::flags_t UIData::flags; -uint8_t pressed_tag = UNPRESSED; - -uint8_t UIData::get_persistent_data_mask() { - // A bit mask for flags that should be stored to the EEPROM. - // Others are considered temporarily values that need not be - // saved. - constexpr flags_t persistent_flags = { - bits: { - touch_start_sound: true, - touch_end_sound: true, - touch_repeat_sound: true, - show_animations: true - } - }; - return persistent_flags.value; -} - -void UIData::reset_persistent_data() { - // Default values for persistent data - constexpr flags_t default_flags = { - bits: { - touch_start_sound: true, - touch_end_sound: true, - touch_repeat_sound: true, - show_animations: true, - touch_debouncing: false, - ignore_unpress: false - } - }; - flags.value = default_flags.value; -} - -uint8_t UIData::get_persistent_data() { - return flags.value & get_persistent_data_mask(); -} - -void UIData::set_persistent_data(uint8_t value) { - flags.value = value & get_persistent_data_mask(); -} - - -void UIData::enable_touch_sounds(bool enabled) { - UIData::flags.bits.touch_start_sound = enabled; - UIData::flags.bits.touch_end_sound = enabled; - UIData::flags.bits.touch_repeat_sound = enabled; -} - -bool UIData::touch_sounds_enabled() { - return UIData::flags.bits.touch_start_sound || UIData::flags.bits.touch_end_sound || UIData::flags.bits.touch_repeat_sound; -} - -void UIData::enable_animations(bool enabled) { - UIData::flags.bits.show_animations = enabled; -} - -bool UIData::animations_enabled() { - return UIData::flags.bits.show_animations; -} - -namespace FTDI { - uint8_t EventLoop::get_pressed_tag() { - return pressed_tag; - } - - bool EventLoop::is_touch_held() { - return pressed_tag != 0; - } - - /** - * process_events(): Process events from the touch panel. - * - * This function consists of a state machine that accomplishes the following: - * - * - Reads the tag register from the touch panel - * - Dispatches onTouchStart and onTouchEnd events to the active screen. - * - Handles auto-repetition by sending onTouchHeld to the active screen periodically. - * - Plays touch feedback "click" sounds when appropriate. - * - Performs debouncing to supress spurious touch events. - * - */ - void EventLoop::process_events() { - // If the LCD is processing commands, don't check - // for tags since they may be changing and could - // cause spurious events. - if (!touch_timer.elapsed(TOUCH_UPDATE_INTERVAL) || CLCD::CommandFifo::is_processing()) { - return; - } - - const uint8_t tag = CLCD::get_tag(); - - switch (pressed_tag) { - case UNPRESSED: - if (tag != 0) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Touch start: ", tag); - #endif - - pressed_tag = tag; - current_screen.onRefresh(); - - // When the user taps on a button, activate the onTouchStart handler - const uint8_t lastScreen = current_screen.getScreen(); - - if (current_screen.onTouchStart(tag)) { - touch_timer.start(); - if (UIData::flags.bits.touch_start_sound) sound.play(press_sound); - } - - if (lastScreen != current_screen.getScreen()) { - // In the case in which a touch event triggered a new screen to be - // drawn, we don't issue a touchEnd since it would be sent to the - // wrong screen. - UIData::flags.bits.ignore_unpress = true; - } else { - UIData::flags.bits.ignore_unpress = false; - } - } else { - touch_timer.start(); - } - break; - default: // PRESSED - 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)) { - if (current_screen.onTouchHeld(tag)) { - current_screen.onRefresh(); - if (UIData::flags.bits.touch_repeat_sound) sound.play(repeat_sound); - } - touch_timer.start(); - } - } - else if (tag == 0) { - touch_timer.start(); - UIData::flags.bits.touch_debouncing = true; - } - } - - else { - // Debouncing... - - if (tag == pressed_tag) { - // If while debouncing, we detect a press, then cancel debouncing. - UIData::flags.bits.touch_debouncing = false; - } - - else if (touch_timer.elapsed(DEBOUNCE_PERIOD)) { - UIData::flags.bits.touch_debouncing = false; - - if (UIData::flags.bits.ignore_unpress) { - UIData::flags.bits.ignore_unpress = false; - pressed_tag = UNPRESSED; - break; - } - - if (UIData::flags.bits.touch_end_sound) sound.play(unpress_sound); - - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Touch end: ", tag); - #endif - - const uint8_t saved_pressed_tag = pressed_tag; - pressed_tag = UNPRESSED; - current_screen.onTouchEnd(saved_pressed_tag); - current_screen.onRefresh(); - } - } - break; - } // switch (pressed_tag) - - } // processEvents() - - void EventLoop::setup() { - CLCD::init(); - DLCache::init(); - UIData::reset_persistent_data(); - current_screen.start(); - } - - void EventLoop::loop() { - sound.onIdle(); - - /** - * Guard against re-entry of UI methods, which can - * crash. Re-entry can happen because some functions - * (e.g. planner.synchronize) call idle(). - */ - if (!UIData::flags.bits.prevent_reentry) { - UIData::flags.bits.prevent_reentry = true; - current_screen.onIdle(); - process_events(); - UIData::flags.bits.prevent_reentry = false; - } - } -} // namespace FTDI - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h deleted file mode 100644 index 7eeea9c815..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************** - * event_loop.h * - ****************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#define STATUS_UPDATE_INTERVAL 1000 -#define TOUCH_UPDATE_INTERVAL 50 -#define TOUCH_REPEATS_PER_SECOND 4 -#define DEBOUNCE_PERIOD 150 - -class UIData { - private: - typedef union { - struct { - uint8_t touch_start_sound : 1; - uint8_t touch_end_sound : 1; - uint8_t touch_repeat_sound : 1; - uint8_t show_animations : 1; - uint8_t touch_debouncing : 1; - uint8_t ignore_unpress : 1; - uint8_t prevent_reentry : 1; - } bits; - uint8_t value; - } flags_t; - - public: - static flags_t flags; - - static uint8_t get_persistent_data_mask(); - static uint8_t get_persistent_data(); - static void set_persistent_data(uint8_t value); - static void reset_persistent_data(); - - static void enable_touch_sounds(bool enabled); - static bool touch_sounds_enabled(); - static void enable_animations(bool enabled); - static bool animations_enabled(); -}; - -namespace FTDI { - class EventLoop { - private: - static constexpr FTDI::effect_t press_sound = FTDI::CHACK; - static constexpr FTDI::effect_t repeat_sound = FTDI::CHACK; - static constexpr FTDI::effect_t unpress_sound = FTDI::POP; - static void process_events(); - - public: - static void setup(); - static void loop(); - - static uint8_t get_pressed_tag(); - static bool is_touch_held(); - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h deleted file mode 100644 index 329bea46f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ /dev/null @@ -1,50 +0,0 @@ -/******************* - * ftdi_extended.h * - *******************/ - -/**************************************************************************** - * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 201( - 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 "../compat.h" -#include "../basic/ftdi_basic.h" - -#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 "event_loop.h" - #include "command_processor.h" - #include "screen_types.h" - #include "sound_player.h" - #include "sound_list.h" - #include "polygon.h" - #include "text_box.h" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h deleted file mode 100644 index ec8154b22f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h +++ /dev/null @@ -1,98 +0,0 @@ -/***************** - * grid_layout.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 - -/* The grid layout macros allow buttons to be arranged on a grid so - * that their locations become independent of the display size. The - * layout model is similar to that of HTML TABLEs. - * - * These macros are meant to be evaluated into constants at compile - * time, so resolution independence can be as efficient as using - * hard-coded coordinates. - */ - -// Margin defines the margin (in pixels) on each side of a button in -// the layout - -#ifdef TOUCH_UI_800x480 - #define MARGIN_L 5 - #define MARGIN_R 5 - #define MARGIN_T 5 - #define MARGIN_B 5 - #define MARGIN_DEFAULT 5 -#else - #define MARGIN_L 3 - #define MARGIN_R 3 - #define MARGIN_T 3 - #define MARGIN_B 3 - #define MARGIN_DEFAULT 3 -#endif - -// EDGE_R adds some black space on the right edge of the display -// This shifts some of the screens left to visually center them. - -#define EDGE_R 0 - -// GRID_X and GRID_Y computes the positions of the divisions on -// the layout grid. -#define GRID_X(x) ((x)*(FTDI::display_width-EDGE_R)/GRID_COLS) -#define GRID_Y(y) ((y)*FTDI::display_height/GRID_ROWS) - -// BTN_X, BTN_Y, BTN_W and BTN_X returns the top-left and width -// and height of a button, taking into account the button margins. - -#define BTN_X(x) (GRID_X((x)-1) + MARGIN_L) -#define BTN_Y(y) (GRID_Y((y)-1) + MARGIN_T) -#define BTN_W(w) (GRID_X(w) - MARGIN_L - MARGIN_R) -#define BTN_H(h) (GRID_Y(h) - MARGIN_T - MARGIN_B) - -// Abbreviations for common phrases, to allow a button to be -// defined in one line of source. -#define BTN_POS(x,y) BTN_X(x), BTN_Y(y) -#define BTN_SIZE(w,h) BTN_W(w), BTN_H(h) - -// Draw a reference grid for ease of spacing out widgets. -#define DRAW_LAYOUT_GRID \ - { \ - cmd.cmd(LINE_WIDTH(4)); \ - for(int i = 1; i <= GRID_COLS; i++) { \ - cmd.cmd(BEGIN(LINES)); \ - cmd.cmd(VERTEX2F(GRID_X(i) *16, 0 *16)); \ - cmd.cmd(VERTEX2F(GRID_X(i) *16, FTDI::display_height *16)); \ - } \ - for(int i = 1; i < GRID_ROWS; i++) { \ - cmd.cmd(BEGIN(LINES)); \ - cmd.cmd(VERTEX2F(0 *16, GRID_Y(i) *16)); \ - cmd.cmd(VERTEX2F(FTDI::display_width *16, GRID_Y(i) *16)); \ - } \ - cmd.cmd(LINE_WIDTH(16)); \ - } - -namespace FTDI { - #ifdef TOUCH_UI_PORTRAIT - constexpr uint16_t display_width = Vsize; - constexpr uint16_t display_height = Hsize; - #else - constexpr uint16_t display_width = Hsize; - constexpr uint16_t display_height = Vsize; - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h deleted file mode 100644 index 4560996da7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h +++ /dev/null @@ -1,96 +0,0 @@ -/************* - * polygon.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 - -/** - * The Polygon class helps drawing filled or stroked polygons on the FTDI EVE: - * - * CommandProcessor cmd; - * cmd.cmd(COLOR_RGB(0x00FF00)); - * - * Polygon p(cmd); - * p.begin_fill(); - * p.begin_loop(); - * p(10,10); - * p(20,10); - * p(20,20); - * p(10,20); - * p.end_loop(); - * p.begin_loop(); - * ... // Additional closed paths - * p.end_loop(); - * ... - * p.end_fill(); - * - * Based on the example from "Applicaton Note AN_334, FT801 Polygon Application": - * - * https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/AN_334-FT801_Polygon_Application.pdf - */ - -namespace FTDI { - class Polygon { - private: - FTDI::begin_t path_initiator = FTDI::LINE_STRIP; - - public: - CommandProcessor &cmd; - - Polygon(CommandProcessor &c) : cmd(c) {} - - void begin_fill() { - using namespace FTDI; - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(TAG_MASK(0)); - cmd.cmd(CLEAR(0,1,0)); - cmd.cmd(COLOR_MASK(0,0,0,0)); - cmd.cmd(STENCIL_OP(STENCIL_OP_KEEP, STENCIL_OP_INVERT)); - cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); - // Drawing the edge strip along scan lines - // seems to yield the best performance - #ifdef TOUCH_UI_PORTRAIT - path_initiator = EDGE_STRIP_B; - #else - path_initiator = EDGE_STRIP_R; - #endif - } - - // Specify a clipping rectangle to paint fewer pixels and reduce rendering time, otherwise all pixels will be painted. - void end_fill(const int16_t x1 = 0, const int16_t y1 = 0, const int16_t x2 = display_width * 16, const int16_t y2 = display_height * 16) { - using namespace FTDI; - cmd.cmd(RESTORE_CONTEXT()); - - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_NOTEQUAL, 0, 255)); - cmd.cmd(BEGIN(RECTS)); - cmd.cmd(VERTEX2F(x1, y1)); - cmd.cmd(VERTEX2F(x2, y2)); - cmd.cmd(RESTORE_CONTEXT()); - } - - void begin_stroke() {path_initiator = FTDI::LINE_STRIP;} - void begin_loop() {cmd.cmd(FTDI::BEGIN(path_initiator));} - void end_stroke() {} - void end_loop() {} - - void operator()(const uint16_t x, const uint16_t y) {cmd.cmd(FTDI::VERTEX2F(x, y));} - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h deleted file mode 100644 index fde5052873..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h +++ /dev/null @@ -1,84 +0,0 @@ -/*********** - * rgb_t.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 - -/** - * Implementation of hsl_to_rgb as constexpr functions based on: - * - * https://www.rapidtables.com/convert/color/hsl-to-rgb.html - */ - -constexpr float _hsl_fmod(float x, float y) { - return x - int(x/y)*y; -} - -constexpr float _hsl_c(float, float S, float L) { - return (1.0f - fabs(2*L-1.0f)) * S; -} - -constexpr float _hsl_x(float H, float S, float L) { - return _hsl_c(H,S,L) * (1.0f - fabs(_hsl_fmod(H/60, 2) - 1)); -} - -constexpr float _hsl_m(float H, float S, float L) { - return L - _hsl_c(H,S,L)/2; -} - -constexpr float _hsl_rgb(float H, float S, float L, float r, float g, float b) { - return ((uint32_t((r + _hsl_m(H,S,L))*255+0.5) << 16) | - (uint32_t((g + _hsl_m(H,S,L))*255+0.5) << 8) | - (uint32_t((b + _hsl_m(H,S,L))*255+0.5) << 0)); -} - -constexpr uint32_t hsl_to_rgb(float H, float S, float L) { - return (H < 60) ? _hsl_rgb(H,S,L,_hsl_c(H,S,L), _hsl_x(H,S,L), 0) : - (H < 120) ? _hsl_rgb(H,S,L,_hsl_x(H,S,L), _hsl_c(H,S,L), 0) : - (H < 180) ? _hsl_rgb(H,S,L, 0, _hsl_c(H,S,L), _hsl_x(H,S,L)) : - (H < 240) ? _hsl_rgb(H,S,L, 0, _hsl_x(H,S,L), _hsl_c(H,S,L)) : - (H < 300) ? _hsl_rgb(H,S,L,_hsl_x(H,S,L), 0, _hsl_c(H,S,L)) : - _hsl_rgb(H,S,L,_hsl_c(H,S,L), 0, _hsl_x(H,S,L)); -} - -/** - * Structure for RGB colors - */ -struct rgb_t { - union { - struct { - uint8_t b,g,r,a; - }; - uint32_t packed; - }; - - rgb_t() : packed(0) {} - rgb_t(uint32_t rgb) : packed(rgb) {} - rgb_t(uint8_t r, uint8_t g, uint8_t b) : b(b), g(g), r(r), a(0) {} - operator uint32_t() const {return packed;}; - - static void lerp(float t, const rgb_t a, const rgb_t b, rgb_t &c) { - c.r = a.r + t * (b.r - a.r); - c.g = a.g + t * (b.g - a.g); - c.b = a.b + t * (b.b - a.b); - } - - uint8_t luminance() const {return 0.299*r + 0.587*g + 0.114*b;} -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp deleted file mode 100644 index ec1c0d1cbb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/****************** - * screen_types.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: . * - ****************************************************************************/ - -#include "ftdi_extended.h" - -#ifdef FTDI_EXTENDED - -/********************** VIRTUAL DISPATCH DATA TYPE ******************************/ - -uint8_t ScreenRef::lookupScreen(onRedraw_func_t onRedraw_ptr) { - for(uint8_t type = 0; type < functionTableSize; type++) { - if (GET_METHOD(type, onRedraw) == onRedraw_ptr) { - return type; - } - } - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Screen not found: ", (uintptr_t) onRedraw_ptr); - #endif - return 0xFF; -} - -void ScreenRef::setScreen(onRedraw_func_t onRedraw_ptr) { - uint8_t type = lookupScreen(onRedraw_ptr); - if (type != 0xFF) { - setType(type); - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("New screen: ", type); - #endif - } -} - -void ScreenRef::initializeAll() { - for(uint8_t type = 0; type < functionTableSize; type++) { - GET_METHOD(type, onStartup)(); - } -} - -/********************** SCREEN STACK ******************************/ - -void ScreenStack::start() { - initializeAll(); - onEntry(); -} - -void ScreenStack::push(onRedraw_func_t onRedraw_ptr) { - stack[3] = stack[2]; - stack[2] = stack[1]; - stack[1] = stack[0]; - stack[0] = lookupScreen(onRedraw_ptr); -} - -void ScreenStack::push() { - stack[3] = stack[2]; - stack[2] = stack[1]; - stack[1] = stack[0]; - stack[0] = getType(); -} - -void ScreenStack::pop() { - setType(stack[0]); - forget(); -} - -void ScreenStack::forget() { - stack[0] = stack[1]; - stack[1] = stack[2]; - stack[2] = stack[3]; - stack[3] = 0; -} - -void ScreenStack::goTo(onRedraw_func_t s) { - push(); - onExit(); - setScreen(s); - onEntry(); -} - -void ScreenStack::goBack() { - onExit(); - pop(); - onEntry(); -} - -ScreenStack current_screen; - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h deleted file mode 100644 index f1ec4fc476..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h +++ /dev/null @@ -1,229 +0,0 @@ -/******************** - * screen_types.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: . * - ****************************************************************************/ - -#pragma once - -typedef enum { - BACKGROUND = 1, - FOREGROUND = 2, - BOTH = 3 -} draw_mode_t; - - /********************** VIRTUAL DISPATCH DATA TYPE ******************************/ - -// True virtual classes are extremely expensive on the Arduino -// as the compiler stores the virtual function tables in RAM. -// We invent a data type called ScreenRef that gives us -// polymorphism by mapping an ID to virtual methods on various -// classes. This works by keeping a table in PROGMEM of pointers -// to static methods. - -#define DECL_SCREEN(className) { \ - className::onStartup, \ - className::onEntry, \ - className::onExit, \ - className::onIdle, \ - className::onRefresh, \ - className::onRedraw, \ - className::onTouchStart, \ - className::onTouchHeld, \ - className::onTouchEnd \ -} - -#define GET_METHOD(type, method) reinterpret_cast(pgm_read_ptr_far(&functionTable[type].method##_ptr)) -#define SCREEN_TABLE PROGMEM const ScreenRef::table_t ScreenRef::functionTable[] = -#define SCREEN_TABLE_POST const uint8_t ScreenRef::functionTableSize = sizeof(ScreenRef::functionTable)/sizeof(ScreenRef::functionTable[0]); - -class ScreenRef { - protected: - 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); - typedef bool onTouchEnd_func_t(uint8_t); - - private: - typedef struct { - onStartup_func_t *onStartup_ptr; - onEntry_func_t *onEntry_ptr; - onExit_func_t *onExit_ptr; - onIdle_func_t *onIdle_ptr; - onRefresh_func_t *onRefresh_ptr; - onRedraw_func_t *onRedraw_ptr; - onTouchStart_func_t *onTouchStart_ptr; - onTouchHeld_func_t *onTouchHeld_ptr; - onTouchEnd_func_t *onTouchEnd_ptr; - } table_t; - - uint8_t type = 0; - static PROGMEM const table_t functionTable[]; - static const uint8_t functionTableSize; - - public: - uint8_t getType() {return type;} - - void setType(uint8_t t) { - type = t; - } - - uint8_t lookupScreen(onRedraw_func_t onRedraw_ptr); - - void setScreen(onRedraw_func_t onRedraw_ptr); - - void onStartup() {GET_METHOD(type, onStartup)();} - void onEntry() {GET_METHOD(type, onEntry)();} - void onExit() {GET_METHOD(type, onExit)();} - void onIdle() {GET_METHOD(type, onIdle)();} - void onRefresh() {GET_METHOD(type, onRefresh)();} - void onRedraw(draw_mode_t dm) {GET_METHOD(type, onRedraw)(dm);} - bool onTouchStart(uint8_t tag) {return GET_METHOD(type, onTouchStart)(tag);} - bool onTouchHeld(uint8_t tag) {return GET_METHOD(type, onTouchHeld)(tag);} - bool onTouchEnd(uint8_t tag) {return GET_METHOD(type, onTouchEnd)(tag);} - - void initializeAll(); -}; - -/********************** SCREEN STACK ******************************/ - -// To conserve dynamic memory, the screen stack is hard-coded to -// have four values, allowing a menu of up to four levels. - -class ScreenStack : public ScreenRef { - private: - uint8_t stack[4]; - - public: - void start(); - void push(onRedraw_func_t); - void push(); - void pop(); - void forget(); - void goTo(onRedraw_func_t); - void goBack(); - - uint8_t peek() {return stack[0];} - uint8_t getScreen() {return getType();} -}; - -extern ScreenStack current_screen; - -/********************** BASE SCREEN CLASS ******************************/ - -/* UIScreen is the base class for all user interface screens. - */ -class UIScreen { - public: - static void onStartup() {} - static void onEntry() {current_screen.onRefresh();} - static void onExit() {} - static void onIdle() {} - static bool onTouchStart(uint8_t) {return true;} - static bool onTouchHeld(uint8_t) {return false;} - static bool onTouchEnd(uint8_t) {return true;} -}; - -#define PUSH_SCREEN(screen) current_screen.push(screen::onRedraw); -#define GOTO_SCREEN(screen) current_screen.goTo(screen::onRedraw); -#define GOTO_PREVIOUS() current_screen.goBack(); -#define AT_SCREEN(screen) (current_screen.getType() == current_screen.lookupScreen(screen::onRedraw)) -#define IS_PARENT_SCREEN(screen) (current_screen.peek() == current_screen.lookupScreen(screen::onRedraw)) - -/************************** CACHED VS UNCHACHED SCREENS ***************************/ - -class UncachedScreen { - public: - static void onRefresh() { - using namespace FTDI; - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART); - #ifdef TOUCH_UI_USE_UTF8 - load_utf8_bitmaps(cmd); - #endif - - current_screen.onRedraw(BOTH); - - cmd.cmd(DL::DL_DISPLAY); - cmd.cmd(CMD_SWAP); - cmd.execute(); - } -}; - -template -class CachedScreen { - protected: - static bool storeBackground() { - DLCache dlcache(DL_SLOT); - if (!dlcache.store(DL_SIZE)) { - SERIAL_ECHO_MSG("CachedScreen::storeBackground() failed: not enough DL cache space"); - return false; - } - return true; - } - - static void repaintBackground() { - using namespace FTDI; - DLCache dlcache(DL_SLOT); - 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() { - #if ENABLED(TOUCH_UI_DEBUG) - const uint32_t start_time = millis(); - #endif - using namespace FTDI; - DLCache dlcache(DL_SLOT); - 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); - } - - current_screen.onRedraw(FOREGROUND); - - 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h deleted file mode 100644 index a53ed95159..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************** - * sound_list.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 - -class SoundList { - private: - static PROGMEM const struct list_t { - const char *const PROGMEM name; - const FTDI::SoundPlayer::sound_t* data; - } list[]; - public: - static const uint8_t n; - static inline const char* name(uint8_t val) { - return (const char* ) pgm_read_ptr_near(&list[val].name); - } - static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) { - return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_near(&list[val].data); - } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp deleted file mode 100644 index a6d84dde5f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/******************** - * sound_player.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 "ftdi_extended.h" - -#ifdef FTDI_EXTENDED - -namespace FTDI { - SoundPlayer sound; // Global sound player object - - void SoundPlayer::set_volume(uint8_t vol) { - CLCD::mem_write_8(REG::VOL_SOUND, vol); - } - - uint8_t SoundPlayer::get_volume() { - return CLCD::mem_read_8(REG::VOL_SOUND); - } - - void SoundPlayer::play(effect_t effect, note_t note) { - - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR ("Playing note ", int(note)); - SERIAL_ECHOLNPAIR(", instrument ", int(effect)); - #endif - - // Play the note - CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ? note : NOTE_C4) << 8) | effect)); - CLCD::mem_write_8(REG::PLAY, 1); - } - - note_t SoundPlayer::frequency_to_midi_note(const uint16_t frequency_hz) { - const float f0 = 440; - return note_t(NOTE_A4 + (log(frequency_hz)-log(f0))*12/log(2) + 0.5); - } - - // Plays a tone of a given frequency and duration. Since the FTDI FT810 only - // supports MIDI notes, we round down to the nearest note. - - void SoundPlayer::play_tone(const uint16_t frequency_hz, const uint16_t duration_ms) { - play(ORGAN, frequency_to_midi_note(frequency_hz)); - - // Schedule silence to squelch the note after the duration expires. - sequence = silence; - wait = duration_ms; - timer.start(); - } - - void SoundPlayer::play(const sound_t* seq, play_mode_t mode) { - sequence = seq; - wait = 250; // Adding this delay causes the note to not be clipped, not sure why. - timer.start(); - - if (mode == PLAY_ASYNCHRONOUS) return; - - // If playing synchronously, then play all the notes here - - while (has_more_notes()) { - onIdle(); - #ifdef EXTENSIBLE_UI - ExtUI::yield(); - #endif - } - } - - bool SoundPlayer::is_sound_playing() { - return CLCD::mem_read_8( REG::PLAY ) & 0x1; - } - - void SoundPlayer::onIdle() { - if (!sequence) return; - - const bool ready_for_next_note = (wait == 0) ? !is_sound_playing() : timer.elapsed(wait); - - if (ready_for_next_note) { - const effect_t fx = effect_t(pgm_read_byte(&sequence->effect)); - const note_t nt = note_t(pgm_read_byte(&sequence->note)); - const uint32_t ms = uint32_t(pgm_read_byte(&sequence->sixteenths)) * 1000 / 16; - - if (ms == 0 && fx == SILENCE && nt == END_SONG) { - sequence = 0; - play(SILENCE, REST); - } else { - wait = ms; - timer.start(); - play(fx, nt); - sequence++; - } - } - } -} // namespace FTDI - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h deleted file mode 100644 index e177ec57df..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h +++ /dev/null @@ -1,70 +0,0 @@ -/****************** - * sound_player.h * - ******************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -namespace FTDI { - typedef enum { - PLAY_ASYNCHRONOUS, - PLAY_SYNCHRONOUS - } play_mode_t; - - class SoundPlayer { - typedef FTDI::ftdi_registers REG; - typedef FTDI::ftdi_memory_map MAP; - - public: - struct sound_t { - effect_t effect; // The sound effect number - note_t note; // The MIDI note value - uint16_t sixteenths; // Duration of note, in sixteeths of a second, or zero to play to completion - }; - - const uint8_t WAIT = 0; - - private: - const sound_t *sequence; - tiny_timer_t timer; - tiny_time_t wait; - - note_t frequency_to_midi_note(const uint16_t frequency); - - public: - static void set_volume(uint8_t volume); - static uint8_t get_volume(); - - static void play(effect_t effect, note_t note = NOTE_C4); - static bool is_sound_playing(); - - void play(const sound_t* seq, play_mode_t mode = PLAY_SYNCHRONOUS); - void play_tone(const uint16_t frequency_hz, const uint16_t duration_ms); - bool has_more_notes() {return sequence != 0;}; - - void onIdle(); - }; - - extern SoundPlayer sound; - - const PROGMEM SoundPlayer::sound_t silence[] = { - {SILENCE, END_SONG, 0} - }; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp deleted file mode 100644 index 75a445a926..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/**************** - * text_box.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 { - /** - * Given a str, end will be set to the position at which a line needs to - * 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 FontMetrics &fm, uint16_t w, const char *str, const char *&end) { - w -= fm.get_char_width(' '); - const char *p = str; - end = str; - uint16_t lw = 0, result = 0; - for(;;) { - 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; - } - 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 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; - width = height = 0; - for(;;) { - 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.get_height(); - line_start = line_end; - } - } - - /** - * 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) { - 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); - if (box_width <= (uint16_t)w && box_height <= (uint16_t)h) break; - fm.load(--font); - if (font == 26) break; - } - - const uint16_t dx = (options & OPT_RIGHTX) ? w : (options & OPT_CENTERX) ? w/2 : 0; - const uint16_t dy = (options & OPT_CENTERY) ? (h - box_height)/2 : 0; - - const char *line_start = str; - const char *line_end; - for(;;) { - find_line_break(fm, w, line_start, line_end); - if (line_end == line_start) break; - - const size_t line_len = line_end - line_start; - if (line_len) { - char line[line_len + 1]; - strncpy(line, line_start, line_len); - line[line_len] = 0; - if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') - line[line_len - 1] = 0; - - #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.get_height(); - - line_start = line_end; - } - } - - void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, progmem_str pstr, uint16_t options, uint8_t font) { - char str[strlen_P((const char*)pstr) + 1]; - strcpy_P(str, (const char*)pstr); - draw_text_box(cmd, x, y, w, h, (const char*) str, options, font); - } -} // namespace FTDI - -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h deleted file mode 100644 index a0f99c6b08..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h +++ /dev/null @@ -1,30 +0,0 @@ -/************** - * text_box.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 function draws text inside a bounding box, doing word wrapping and using the largest font that will fit. - */ -namespace FTDI { - void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, progmem_str str, uint16_t options = 0, uint8_t font = 31); - void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, const char *str, uint16_t options = 0, uint8_t font = 31); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp deleted file mode 100644 index c7b35e92df..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************** - * tiny_timer.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 "ftdi_extended.h" - -#ifdef FTDI_EXTENDED - -bool tiny_timer_t::elapsed(tiny_time_t duration) { - uint8_t now = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif - ); - uint8_t elapsed = now - _start; - if (elapsed >= duration._duration) { - return true; - } else { - return false; - } -} - -void tiny_timer_t::start() { - _start = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif - ); -} -#endif // FTDI_EXTENDED diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h deleted file mode 100644 index 9db9127529..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************** - * tiny_timer.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 - -/* Helpful Reference: - * - * https://arduino.stackexchange.com/questions/12587/how-can-i-handle-the-millis-rollover - */ - -/* tiny_interval_t downsamples a 32-bit millis() value - into a 8-bit value which can record periods of - a few seconds with a rougly 1/16th of second - resolution. This allows us to measure small - intervals without needing to use four-byte counters. - */ -class tiny_time_t { - private: - friend class tiny_timer_t; - uint8_t _duration; - - static uint8_t tiny_time(uint32_t ms) {return ceil(float(ms) / 64);}; - - public: - tiny_time_t() : _duration(0) {} - tiny_time_t(uint32_t ms) : _duration(tiny_time(ms)) {} - tiny_time_t & operator= (uint32_t ms) {_duration = tiny_time(ms); return *this;} - bool operator == (uint32_t ms) {return _duration == tiny_time(ms);} -}; - -class tiny_timer_t { - private: - uint8_t _start; - - public: - void start(); - bool elapsed(tiny_time_t interval); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt deleted file mode 100644 index 818bf08cea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt +++ /dev/null @@ -1,40 +0,0 @@ - -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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp deleted file mode 100644 index 87baeb6d20..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/******************* - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h deleted file mode 100644 index 85ece6b774..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h +++ /dev/null @@ -1,30 +0,0 @@ -/****************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm deleted file mode 100644 index 39cb67034f..0000000000 Binary files a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm and /dev/null differ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png deleted file mode 100644 index ef681923db..0000000000 Binary files a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png and /dev/null differ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg deleted file mode 100644 index f803126c2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg +++ /dev/null @@ -1,443 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - ̀ ́ ̂ ̃ ̈ ̊ ̧ıßØøÆæÐðÞþ«»¡¿¢£¤¥¹²³ºª©®±×÷¼½¾µ¦§¬ - - - - - - - - diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp deleted file mode 100644 index c449f11537..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/******************* - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h deleted file mode 100644 index 9cf6c181f5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h +++ /dev/null @@ -1,55 +0,0 @@ -/***************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp deleted file mode 100644 index fb049aee3b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/************************* - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h deleted file mode 100644 index 17ccfe6e30..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h +++ /dev/null @@ -1,30 +0,0 @@ -/*********************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp deleted file mode 100644 index d717f7f154..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/*************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h deleted file mode 100644 index fedb89d172..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ /dev/null @@ -1,111 +0,0 @@ -/************* - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp deleted file mode 100644 index 688b68ae0c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/************************ - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h deleted file mode 100644 index 704de95088..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h deleted file mode 100644 index 64a14121d9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h +++ /dev/null @@ -1,1315 +0,0 @@ -/******************************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py deleted file mode 100644 index c295dfc5b8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h deleted file mode 100644 index da6a2bc325..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h +++ /dev/null @@ -1,105 +0,0 @@ -/*********************** - * circular_progress.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 function draws a circular progress "ring" */ - -void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, char *text, uint32_t bgcolor, uint32_t fgcolor) { - using namespace FTDI; - - const float rim = 0.3; - const float a = percent/100.0*2.0*PI; - const float a1 = min(PI/2, a); - const float a2 = min(PI/2, a-a1); - const float a3 = min(PI/2, a-a1-a2); - const float a4 = min(PI/2, a-a1-a2-a3); - - const int ro = min(w,h) * 8; - const int rr = ro * rim; - const int cx = x * 16 + w * 8; - const int cy = y * 16 + h * 8; - - // Load a rim shape into stencil buffer - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(TAG_MASK(0)); - cmd.cmd(CLEAR(0,1,0)); - cmd.cmd(COLOR_MASK(0,0,0,0)); - cmd.cmd(STENCIL_OP(STENCIL_OP_KEEP, STENCIL_OP_INVERT)); - cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); - cmd.cmd(BEGIN(POINTS)); - cmd.cmd(POINT_SIZE(ro)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(POINT_SIZE(ro - rr)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(RESTORE_CONTEXT()); - - // Mask further drawing by stencil buffer - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_NOTEQUAL, 0, 255)); - - // Fill the background - cmd.cmd(COLOR_RGB(bgcolor)); - cmd.cmd(BEGIN(POINTS)); - cmd.cmd(POINT_SIZE(ro)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(COLOR_RGB(fgcolor)); - - // Paint upper-right quadrant - cmd.cmd(BEGIN(EDGE_STRIP_A)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(VERTEX2F(cx + ro*sin(a1) + 16,cy - ro*cos(a1) + 8)); - - // Paint lower-right quadrant - if (a > PI/2) { - cmd.cmd(BEGIN(EDGE_STRIP_R)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(VERTEX2F(cx + ro*cos(a2),cy + ro*sin(a2) + 16)); - } - - // Paint lower-left quadrant - if (a > PI) { - cmd.cmd(BEGIN(EDGE_STRIP_B)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(VERTEX2F(cx - ro*sin(a3) - 8,cy + ro*cos(a3))); - } - - // Paint upper-left quadrant - if (a > 1.5*PI) { - cmd.cmd(BEGIN(EDGE_STRIP_L)); - cmd.cmd(VERTEX2F(cx, cy)); - cmd.cmd(VERTEX2F(cx - ro*cos(a4),cy - ro*sin(a4))); - } - cmd.cmd(RESTORE_CONTEXT()); - - // Draw the text - - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(COLOR_RGB(fgcolor)); - cmd.text(x,y,w,h,text, OPT_CENTERX | OPT_CENTERY); - cmd.cmd(RESTORE_CONTEXT()); -} - -void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, uint32_t bgcolor, uint32_t fgcolor) { - char str[5]; - sprintf(str,"%d\%%",int(percent)); - draw_circular_progress(cmd, x, y, w, h, percent, str, bgcolor, fgcolor); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h deleted file mode 100644 index 9f531146e1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h +++ /dev/null @@ -1,396 +0,0 @@ -/************* - * poly_ui.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 - -/** - * The PolyReader class iterates over an array of (x,y) pairs. - * For supporting polygons with holes an end-of-loop marker may - * be embedded into the data stream: - * - * const PROGMEM uint16_t data[] = { - * x, y, x, y, ..., eol, - * ... - * x, y, x, y, ..., eol - * } - * - * The PolyReader object can be used to iterate over the points. - * - * PolyReader r(data, N_ELEMENTS(data)); - * - * for(r.start();r.has_more(); r.next()) { - * uint16_t x = r.x; - * uint16_t y = r.y; - * - * // Do something with the point - * ... - * - * // Do something else if this point - * // closes a loop. - * if (r.end_of_loop()) { - * ... - * } - * } - * - */ - -class PolyReader { - public: - typedef uint16_t type_t; - - private: - static constexpr type_t eol = 0xFFFF; - - const type_t *p, *top, *end; - type_t start_x, start_y; - - void close_loop() { - x = start_x; - y = start_y; - start_x = eol; - start_y = eol; - } - - public: - type_t x, y; - - // Begin reading a polygon data structure - PolyReader(const uint16_t data[], const size_t n_elements) : top(data), end(data + n_elements) { - start(); - } - - void start() { - p = top; - start_x = eol; - next(); - } - - // Reads the next point in the polygon data structure - void next() { - if (!p) return; - - if (p == end) { - if (start_x != eol) - close_loop(); - else - p = NULL; - } else { - x = pgm_read_word_far(p++); - if (x == eol) - close_loop(); - else { - y = pgm_read_word_far(p++); - if (start_x == eol) { - start_x = x; - start_y = y; - } - } - } - } - - bool has_more() {return p != NULL;} - bool end_of_loop() {return start_x == eol;} -}; - -/** - * The TransformedPolyReader class works like the PolyReader, - * but the (x,y) input is assumed to be normalized onto a - * unit square and then mapped to the full 16-bits, i.e. - * (0.0,1.0) => (0x0000,0xFFFE). This class will scale the - * data to fit the entire display, a bounding box, or apply - * some arbitrary affine transform. - * - * This class is suitable for reading data from "svg2cpp.py" - */ -class TransformedPolyReader : public PolyReader { - private: - /** - * Fixed point type for fast transformations, supports - * values from 0 to 1024, with 1/32 precision. - */ - static constexpr uint8_t fract_bits = 5; - typedef int16_t fix_t; - fix_t makefix(float f) {return f * (1 << fract_bits);} - - // First two rows of 3x3 transformation matrix - fix_t a, b, c; - fix_t d, e, f; - - void transform() { - /** - * Values from PolyReader vary from 0 to FFFE. - * As an approximation to dividing by FFFE, - * we perform a bit shift right by 16. - */ - const int32_t px = PolyReader::x; - const int32_t py = PolyReader::y; - const int32_t round = 1 << (fract_bits-1); - x = (((((a * px) + (b * py)) >> 16) + c) + round) >> fract_bits; - y = (((((d * px) + (e * py)) >> 16) + f) + round) >> fract_bits; - } - - void set_transform( - fix_t A, fix_t B, fix_t C, - fix_t D, fix_t E, fix_t F - ) { - a = A; b = B; c = C; - d = D; e = E; f = F; - } - - public: - typedef int16_t type_t; - - type_t x, y; - - TransformedPolyReader(const uint16_t data[], const size_t n) : PolyReader(data, n) { - scale_to_fit(); - transform(); - } - - // Set an arbitrary affine transform - void set_transform( - float A, float B, float C, - float D, float E, float F - ) { - set_transform( - makefix(A), makefix(B), makefix(C), - makefix(D), makefix(E), makefix(F) - ); - } - - // Scale the data to fit a specified bounding box - void scale_to_fit(type_t x_min, type_t y_min, type_t x_max, type_t y_max) { - fix_t sx = makefix(x_max - x_min); - fix_t sy = makefix(y_max - y_min); - fix_t tx = makefix(x_min); - fix_t ty = makefix(y_min); - set_transform( - sx, 0, tx, - 0, sy, ty - ); - } - - // Scale to fit the entire display (default) - void scale_to_fit() { - scale_to_fit(0, 0, FTDI::display_width, FTDI::display_height); - } - - void next() { - PolyReader::next(); - transform(); - } -}; - -/** - * The DeduplicatedPolyReader wraps around another PolyReader - * class to remove repeated points from the data. This could - * happen when scaling down using TransformedPolyReader, for - * example. - */ -template -class DeduplicatedPolyReader : public POLY_READER { - private: - typename POLY_READER::type_t last_x, last_y; - - static constexpr typename POLY_READER::type_t eol = 0xFFFF; - - public: - DeduplicatedPolyReader(const uint16_t data[], const size_t n) : POLY_READER(data, n) { - last_x = POLY_READER::x; - last_y = POLY_READER::y; - } - - void next() { - do { - if (!POLY_READER::has_more()) return; - POLY_READER::next(); - } while (POLY_READER::x == last_x && POLY_READER::y == last_y && !POLY_READER::end_of_loop()); - if (POLY_READER::end_of_loop()) { - last_x = last_y = eol; - } else { - last_x = POLY_READER::x; - last_y = POLY_READER::y; - } - } -}; - -/** - * The helper class allows you to build an interface based on arbitrary - * shapes. - */ -template> -class GenericPolyUI { - private: - CommandProcessor &cmd; - - // Attributes used to paint buttons - - uint32_t btn_fill_color = 0x000000; - uint32_t btn_shadow_color = 0xF3E0E0; - uint8_t btn_shadow_depth = 5; - uint32_t btn_stroke_color = 0x000000; - uint8_t btn_stroke_width = 28; - - draw_mode_t mode; - - public: - typedef POLY_READER poly_reader_t; - - GenericPolyUI(CommandProcessor &c, draw_mode_t what = BOTH) : cmd(c), mode(what) {} - - // Fills a polygon with the current COLOR_RGB - void fill(poly_reader_t r, bool clip = true) { - using namespace FTDI; - int16_t x, y, w, h; - - if (clip) { - // Clipping reduces the number of pixels that are - // filled, allowing more complex shapes to be drawn - // in the alloted time. - bounds(r, x, y, w, h); - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(SCISSOR_XY(x, y)); - cmd.cmd(SCISSOR_SIZE(w, h)); - } - - Polygon p(cmd); - p.begin_fill(); - p.begin_loop(); - for(r.start();r.has_more();r.next()) { - p(r.x * 16, r.y * 16); - if (r.end_of_loop()) { - p.end_loop(); - p.begin_loop(); - } - } - p.end_loop(); - p.end_fill(); - if (clip) - cmd.cmd(RESTORE_CONTEXT()); - } - - void shadow(poly_reader_t r, uint8_t offset) { - #if FTDI_API_LEVEL >= 810 - using namespace FTDI; - cmd.cmd(VERTEX_TRANSLATE_X(offset * 16)); - cmd.cmd(VERTEX_TRANSLATE_Y(offset * 16)); - fill(r, false); - cmd.cmd(VERTEX_TRANSLATE_X(0)); - cmd.cmd(VERTEX_TRANSLATE_Y(0)); - #endif - } - - // Strokes a polygon with the current COLOR_RGB - void stroke(poly_reader_t r) { - using namespace FTDI; - Polygon p(cmd); - p.begin_stroke(); - p.begin_loop(); - for(r.start();r.has_more(); r.next()) { - p(r.x * 16, r.y * 16); - if (r.end_of_loop()) { - p.end_loop(); - p.begin_loop(); - } - } - p.end_loop(); - p.end_stroke(); - } - - // Compute the bounds of a polygon - void bounds(poly_reader_t r, int16_t &x, int16_t &y, int16_t &w, int16_t &h) { - int16_t x_min = INT16_MAX; - int16_t y_min = INT16_MAX; - int16_t x_max = INT16_MIN; - int16_t y_max = INT16_MIN; - for(r.start(); r.has_more(); r.next()) { - x_min = min(x_min, int16_t(r.x)); - x_max = max(x_max, int16_t(r.x)); - y_min = min(y_min, int16_t(r.y)); - y_max = max(y_max, int16_t(r.y)); - } - x = x_min; - y = y_min; - w = x_max - x_min; - h = y_max - y_min; - } - - /** - * Draw shaped buttons. Buttons are drawn out of a polygon which is - * filled and stroked on top of a drop shadow. The button will - * become "pushed" when touched. - */ - - void button_fill(const uint32_t color) { - btn_fill_color = color; - } - - void button_stroke(const uint32_t color, const uint8_t width) { - btn_stroke_color = color; - btn_stroke_width = width; - } - - void button_shadow(const uint32_t color, const uint8_t depth) { - btn_shadow_color = color; - btn_shadow_depth = depth; - } - - void button(const uint8_t tag, poly_reader_t r) { - using namespace FTDI; - // Draw the shadow - #if FTDI_API_LEVEL >= 810 - if (mode & BACKGROUND) { - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(TAG(tag)); - cmd.cmd(VERTEX_TRANSLATE_X(btn_shadow_depth * 16)); - cmd.cmd(VERTEX_TRANSLATE_Y(btn_shadow_depth * 16)); - cmd.cmd(COLOR_RGB(btn_shadow_color)); - fill(r, false); - cmd.cmd(RESTORE_CONTEXT()); - } - #endif - - if (mode & FOREGROUND) { - cmd.cmd(SAVE_CONTEXT()); - #if FTDI_API_LEVEL >= 810 - if (EventLoop::get_pressed_tag() == tag) { - // "Push" the button - cmd.cmd(VERTEX_TRANSLATE_X(btn_shadow_depth * 16)); - cmd.cmd(VERTEX_TRANSLATE_Y(btn_shadow_depth * 16)); - } - #endif - // Draw the fill and stroke - cmd.cmd(TAG(tag)); - cmd.cmd(COLOR_RGB(btn_fill_color)); - fill(r, false); - cmd.cmd(COLOR_RGB(btn_stroke_color)); - cmd.cmd(LINE_WIDTH(btn_stroke_width)); - stroke(r); - cmd.cmd(RESTORE_CONTEXT()); - } - } - - void color(const uint32_t color) { - cmd.cmd(FTDI::COLOR_RGB(color)); - } -}; - -typedef GenericPolyUI<> PolyUI; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py deleted file mode 100644 index 2778f94d98..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/python - -# 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: . - -from __future__ import print_function -import argparse, re, sys - -usage = ''' -This program extracts line segments from a SVG file and writes -them as coordinates in a C array. The x and y values will be -scaled from 0x0000 to 0xFFFE. 0xFFFF is used as path separator. - -This program can only interpret straight segments, not curves. -It also cannot handle SVG transform attributes. To convert an -SVG file into the proper format, use the following procedure: - - - Load SVG file into Inkscape - - Convert all Objects to Paths (Path -> Object to Path) - - Convert all Strokes to Paths (Path -> Stroke to Path) - - Combine all paths into one (Path -> Combine) [1] - - Convert all curves into short line segments - (Extensions -> Modify Paths -> Flatten Beziers...) - - Save as new SVG - - Convert into a header file using this utility - - To give paths individual names, break apart paths and - use the XML Editor to set the "id" attributes. - -[1] Combining paths is necessary to remove transforms. You -could also use inkscape-applytransforms Inkscape extension. - -''' - -header = ''' -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ - -#pragma once -''' - -class ComputeBoundingBox: - def reset(self): - self.x_min = float(" inf") - self.y_min = float(" inf") - self.x_max = float("-inf") - self.y_max = float("-inf") - self.n_points = 0 - self.n_paths = 0 - - def command(self, type, x, y): - self.x_min = min(self.x_min, x) - self.x_max = max(self.x_max, x) - self.y_min = min(self.y_min, y) - self.y_max = max(self.y_max, y) - - if type == "M": - self.n_paths += 1 - self.n_points += 1 - - def scale(self, x, y): - x -= self.x_min - y -= self.y_min - x /= self.x_max - self.x_min - y /= self.y_max - self.y_min - #y = 1 - y # Flip upside down - return (x, y) - - def path_finished(self, id): - pass - - def write(self): - print("constexpr float x_min = %f;" % self.x_min) - print("constexpr float x_max = %f;" % self.x_max) - print("constexpr float y_min = %f;" % self.y_min) - print("constexpr float y_max = %f;" % self.y_max) - print() - - def from_svg_view_box(self, svg): - s = re.search(']+>', svg); - if s: - m = re.search('viewBox="([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)"', svg) - if m: - self.x_min = float(m.group(1)) - self.y_min = float(m.group(2)) - self.x_max = float(m.group(3)) - self.y_max = float(m.group(4)) - return True - return False - -# op -class WriteDataStructure: - def __init__(self, bounding_box): - self.bounds = bounding_box - - def reset(self, ): - self.hex_words = [] - - def push(self, value): - self.hex_words.append("0x%04X" % (0xFFFF & int(value))) - - def command(self, type, x, y): - if type == "M": - self.push(0xFFFF) - x, y = self.bounds.scale(x,y) - self.push(x * 0xFFFE) - self.push(y * 0xFFFE) - - def path_finished(self, id): - if self.hex_words and self.hex_words[0] == "0xFFFF": - self.hex_words.pop(0) - print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};") - self.hex_words = [] - -class Parser: - def __init__(self, op): - self.op = op - self.reset() - - def reset(self): - self.last_x = 0 - self.last_y = 0 - self.initial_x = 0 - self.initial_y = 0 - - def process_svg_path_L_or_M(self, cmd, x, y): - self.op.command(cmd, x, y) - self.last_x = x - self.last_y = y - if cmd == "M": - self.initial_x = x - self.initial_y = y - - def process_svg_path_data_cmd(self, id, cmd, a, b): - """Converts the various types of moves into L or M commands - and dispatches to process_svg_path_L_or_M for futher processing.""" - if cmd == "Z" or cmd == "z": - self.process_svg_path_L_or_M("L", self.initial_x, self.initial_y) - elif cmd == "H": - self.process_svg_path_L_or_M("L", a, self.last_y) - elif cmd == "V": - self.process_svg_path_L_or_M("L", self.last_x, a) - elif cmd == "h": - self.process_svg_path_L_or_M("L", self.last_x + a, self.last_y) - elif cmd == "v": - self.process_svg_path_L_or_M("L", self.last_x, self.last_y + a) - elif cmd == "L": - self.process_svg_path_L_or_M("L", a, b) - elif cmd == "l": - self.process_svg_path_L_or_M("L", self.last_x + a, self.last_y + b) - elif cmd == "M": - self.process_svg_path_L_or_M("M", a, b) - elif cmd == "m": - self.process_svg_path_L_or_M("M", self.last_x + a, self.last_y + b) - else: - print("Unsupported path data command:", cmd, "in path", id, "\n", file=sys.stderr) - quit() - - def eat_token(self, regex): - """Looks for a token at the start of self.d. - If found, the token is removed.""" - self.m = re.match(regex,self.d) - if self.m: - self.d = self.d[self.m.end():] - return self.m - - def process_svg_path_data(self, id, d): - """Breaks up the "d" attribute into individual commands - and calls "process_svg_path_data_cmd" for each""" - - self.d = d - while (self.d): - if self.eat_token('\s+'): - pass # Just eat the spaces - - elif self.eat_token('([LMHVZlmhvz])'): - cmd = self.m.group(1) - # The following commands take no arguments - if cmd == "Z" or cmd == "z": - self.process_svg_path_data_cmd(id, cmd, 0, 0) - - elif self.eat_token('([CScsQqTtAa])'): - print("Unsupported path data command:", self.m.group(1), "in path", id, "\n", file=sys.stderr) - quit() - - elif self.eat_token('([ ,]*[-0-9e.]+)+'): - # Process list of coordinates following command - coords = re.split('[ ,]+', self.m.group(0)) - # The following commands take two arguments - if cmd == "L" or cmd == "l": - while coords: - self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) - elif cmd == "M": - while coords: - self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) - # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO - cmd = "L" - elif cmd == "m": - while coords: - self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) - # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO - cmd = "l" - # Assume all other commands are single argument - else: - while coords: - self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), 0) - else: - print("Syntax error:", d, "in path", id, "\n", file=sys.stderr) - quit() - - def process_svg_paths(self, svg): - self.op.reset() - for path in re.findall(']+>', svg): - id = "" - m = re.search(' id="(.*)"', path) - if m: - id = m.group(1) - - m = re.search(' transform="(.*)"', path) - if m: - print("Found transform in path", id, "! Cannot process file!", file=sys.stderr) - quit() - - m = re.search(' d="(.*)"', path) - if m: - self.process_svg_path_data(id, m.group(1)) - self.op.path_finished(id) - self.reset() - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("filename") - args = parser.parse_args() - - f = open(args.filename, "r") - data = f.read() - - print(header) - - b = ComputeBoundingBox() - if not b.from_svg_view_box(data): - # Can't find the view box, so use the bounding box of the elements themselves. - p = Parser(b) - p.process_svg_paths(data) - b.write() - - w = WriteDataStructure(b) - p = Parser(w) - p.process_svg_paths(data) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h deleted file mode 100644 index 5a7d3c960b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************** - * ftdi_eve_lib.h * - ******************/ - -/**************************************************************************** - * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * - * 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 "compat.h" -#include "basic/ftdi_basic.h" -#include "extended/ftdi_extended.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp deleted file mode 100644 index 5d33fc850f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************** - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h deleted file mode 100644 index 54f8439933..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h +++ /dev/null @@ -1,23 +0,0 @@ -/************** - * 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 - -#include "language_en.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h deleted file mode 100644 index e59e1d9468..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h +++ /dev/null @@ -1,164 +0,0 @@ -/***************** - * 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" - -#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) - #define COPYRIGHT_SIGN u8"©" -#else - #define COPYRIGHT_SIGN u8"(c)" -#endif - -#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) - #define SUPERSCRIPT_TWO u8"²" -#else - #define SUPERSCRIPT_TWO u8"^2" -#endif - -#if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) - #define DEGREE_SIGN u8"°" -#else - #define DEGREE_SIGN u8" " -#endif - -namespace Language_en { - PROGMEM Language_Str MSG_BUTTON_OKAY = u8"Okay"; - PROGMEM Language_Str MSG_BUTTON_MENU = u8"Menu"; - PROGMEM Language_Str MSG_BUTTON_MEDIA = u8"Media"; - PROGMEM Language_Str MSG_BUTTON_OPEN = u8"Open"; - PROGMEM Language_Str MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; - PROGMEM Language_Str MSG_VMAX_X = u8"Vmax X"; - PROGMEM Language_Str MSG_VMAX_Y = u8"Vmax Y"; - PROGMEM Language_Str MSG_VMAX_Z = u8"Vmax Z"; - PROGMEM Language_Str MSG_ACCEL_PRINTING = u8"Printing"; - PROGMEM Language_Str MSG_ACCEL_TRAVEL = u8"Travel"; - PROGMEM Language_Str MSG_ACCEL_RETRACT = u8"Retraction"; - PROGMEM Language_Str MSG_AMAX_X = u8"Amax X"; - PROGMEM Language_Str MSG_AMAX_Y = u8"Amax Y"; - PROGMEM Language_Str MSG_AMAX_Z = u8"Amax Z"; - PROGMEM Language_Str MSG_AXIS_X = u8"X"; - PROGMEM Language_Str MSG_AXIS_Y = u8"Y"; - PROGMEM Language_Str MSG_AXIS_Z = u8"Z"; - PROGMEM Language_Str MSG_AXIS_E = u8"E"; - PROGMEM Language_Str MSG_AXIS_E1 = u8"E1"; - PROGMEM Language_Str MSG_AXIS_E2 = u8"E2"; - PROGMEM Language_Str MSG_AXIS_E3 = u8"E3"; - PROGMEM Language_Str MSG_AXIS_E4 = u8"E4"; - PROGMEM Language_Str MSG_AXIS_ALL = u8"All"; - PROGMEM Language_Str MSG_HOME = u8"Home"; - PROGMEM Language_Str MSG_PRINT_STARTING = u8"Print starting"; - PROGMEM Language_Str MSG_PRINT_FINISHED = u8"Print finished"; - PROGMEM Language_Str MSG_PRINT_ERROR = u8"Print error"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = u8"Portions " COPYRIGHT_SIGN " 2019 Aleph Objects, Inc.\n" - "Portions " COPYRIGHT_SIGN " 2019 Cocoa Press"; - PROGMEM Language_Str MSG_FIRMWARE_FOR_TOOLHEAD = u8"Firmware for toolhead:\n%s\n\n"; - PROGMEM Language_Str MSG_RUNOUT_1 = u8"Runout 1"; - PROGMEM Language_Str MSG_RUNOUT_2 = u8"Runout 2"; - PROGMEM Language_Str MSG_DISPLAY_MENU = u8"Display"; - PROGMEM Language_Str MSG_INTERFACE_SETTINGS = u8"Interface Settings"; - PROGMEM Language_Str MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; - PROGMEM Language_Str MSG_H_OFFSET = u8"H Offset"; - PROGMEM Language_Str MSG_V_OFFSET = u8"V Offset"; - PROGMEM Language_Str MSG_TOUCH_SCREEN = u8"Touch Screen"; - PROGMEM Language_Str MSG_CALIBRATE = u8"Calibrate"; - PROGMEM Language_Str MSG_UNITS_MILLIAMP = u8"mA"; - PROGMEM Language_Str MSG_UNITS_MM = u8"mm"; - PROGMEM Language_Str MSG_UNITS_MM_S = u8"mm/s"; - PROGMEM Language_Str MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; - PROGMEM Language_Str MSG_UNITS_STEP_MM = u8"st/mm"; - PROGMEM Language_Str MSG_UNITS_PERCENT = u8"%"; - PROGMEM Language_Str MSG_UNITS_C = DEGREE_SIGN u8"C"; - PROGMEM Language_Str MSG_MATERIAL_PLA = u8"PLA"; - PROGMEM Language_Str MSG_MATERIAL_ABS = u8"ABS"; - PROGMEM Language_Str MSG_MATERIAL_HIGH_TEMP = u8"High"; - PROGMEM Language_Str MSG_IDLE = u8"idle"; - PROGMEM Language_Str MSG_SET_MAXIMUM = u8"Set Maximum"; - PROGMEM Language_Str MSG_PRINT_SPEED = u8"Print Speed"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE = u8"Linear Advance"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K = u8"K"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K1 = u8"K E1"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K2 = u8"K E2"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K3 = u8"K E3"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K4 = u8"K E4"; - PROGMEM Language_Str MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; - PROGMEM Language_Str MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; - PROGMEM Language_Str MSG_SHOW_OFFSETS = u8"Show Offsets"; - PROGMEM Language_Str MSG_INCREMENT = u8"Increment"; - PROGMEM Language_Str MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; - PROGMEM Language_Str MSG_ERASING = u8"Erasing..."; - PROGMEM Language_Str MSG_ERASED = u8"SPI flash erased"; - PROGMEM Language_Str MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; - PROGMEM Language_Str MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; - PROGMEM Language_Str MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; - PROGMEM Language_Str MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; - PROGMEM Language_Str MSG_CURRENT_TEMPERATURE = u8"Current Temp"; - PROGMEM Language_Str MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; - PROGMEM Language_Str MSG_CAUTION = u8"Caution:"; - PROGMEM Language_Str MSG_HOT = u8"Hot!"; - PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; - PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extruder"; - PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; - PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; - PROGMEM Language_Str MSG_PLEASE_WAIT = u8"Please wait..."; - PROGMEM Language_Str MSG_PRINT_MENU = u8"Print Menu"; - PROGMEM Language_Str MSG_FINE_MOTION = u8"Fine motion"; - PROGMEM Language_Str MSG_ENABLE_MEDIA = u8"Enable Media"; - PROGMEM Language_Str MSG_INSERT_MEDIA = u8"Insert Media..."; - PROGMEM Language_Str MSG_LCD_BRIGHTNESS = u8"LCD brightness"; - PROGMEM Language_Str MSG_SOUND_VOLUME = u8"Sound volume"; - PROGMEM Language_Str MSG_SCREEN_LOCK = u8"Screen lock"; - PROGMEM Language_Str MSG_BOOT_SCREEN = u8"Boot screen"; - PROGMEM Language_Str MSG_INTERFACE_SOUNDS = u8"Interface Sounds"; - PROGMEM Language_Str MSG_CLICK_SOUNDS = u8"Click sounds"; - PROGMEM Language_Str MSG_EEPROM_RESTORED = u8"Settings restored from backup"; - PROGMEM Language_Str MSG_EEPROM_RESET = u8"Settings restored to default"; - PROGMEM Language_Str MSG_EEPROM_SAVED = u8"Settings saved!"; - PROGMEM Language_Str MSG_EEPROM_SAVE_PROMPT = u8"Do you wish to save these settings as defaults?"; - PROGMEM Language_Str MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; - - PROGMEM Language_Str MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; - PROGMEM Language_Str MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; - PROGMEM Language_Str MSG_PASSCODE_SELECT = u8"Select Passcode:"; - PROGMEM Language_Str MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; - - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; - - #ifdef TOUCH_UI_LULZBOT_BIO - PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; - PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; - PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; - PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS = u8"Auto-level X Axis"; - PROGMEM Language_Str MSG_BED_TEMPERATURE = u8"Bed Temperature"; - PROGMEM Language_Str MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; - PROGMEM Language_Str MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; - #endif - - #ifdef TOUCH_UI_COCOA_PRESS - PROGMEM Language_Str MSG_ZONE_1 = u8"Zone 1:"; - PROGMEM Language_Str MSG_ZONE_2 = u8"Zone 2:"; - PROGMEM Language_Str MSG_ZONE_3 = u8"Zone 3:"; - PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished"; - #endif -}; // namespace Language_en diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp deleted file mode 100644 index cd5cda4a71..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/********************* - * marlin_events.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 "compat.h" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens/screens.h" - -namespace ExtUI { - using namespace Theme; - using namespace FTDI; - - void onStartup() { - EventLoop::setup(); - } - - void onIdle() { - EventLoop::loop(); - } - - void onPrinterKilled(PGM_P const error, PGM_P const component) { - char str[strlen_P(error) + strlen_P(component) + 3]; - sprintf_P(str, PSTR(S_FMT ": " S_FMT), error, component); - KillScreen::show(str); - } - - void onMediaInserted() { - if (AT_SCREEN(StatusScreen)) - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED)); - sound.play(media_inserted, PLAY_ASYNCHRONOUS); - } - - void onMediaRemoved() { - if (AT_SCREEN(StatusScreen)) - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_REMOVED)); - sound.play(media_removed, PLAY_ASYNCHRONOUS); - if (AT_SCREEN(FilesScreen)) { - GOTO_SCREEN(StatusScreen) - } - } - - void onMediaError() { - sound.play(sad_trombone, PLAY_ASYNCHRONOUS); - AlertDialogBox::showError(F("Unable to read media.")); - } - - void onStatusChanged(const char* lcd_msg) { - StatusScreen::setStatusMessage(lcd_msg); - } - - void onStatusChanged(progmem_str lcd_msg) { - StatusScreen::setStatusMessage(lcd_msg); - } - - void onPrintTimerStarted() { - InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED); - } - - void onPrintTimerStopped() { - InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED); - } - - void onPrintTimerPaused() { - } - - void onFilamentRunout(const extruder_t extruder) { - char lcd_msg[30]; - sprintf_P(lcd_msg, PSTR("Extruder %d Filament Error"), extruder + 1); - StatusScreen::setStatusMessage(lcd_msg); - InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED); - } - - void onFactoryReset() { - InterfaceSettingsScreen::defaultSettings(); - } - - void onStoreSettings(char *buff) { - InterfaceSettingsScreen::saveSettings(buff); - } - - void onLoadSettings(const char *buff) { - InterfaceSettingsScreen::loadSettings(buff); - } - - void onConfigurationStoreWritten(bool success) { - #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - if (success && InterfaceSettingsScreen::backupEEPROM()) { - SERIAL_ECHOLNPGM("Made backup of EEPROM to SPI Flash"); - } - #else - UNUSED(success); - #endif - } - - void onConfigurationStoreRead(bool) { - } - - void onPlayTone(const uint16_t frequency, const uint16_t duration) { - sound.play_tone(frequency, duration); - } - - void onUserConfirmRequired(const char * const msg) { - if (msg) - ConfirmUserRequestAlertBox::show(msg); - else - ConfirmUserRequestAlertBox::hide(); - } - - #if HAS_LEVELING && HAS_MESH - void onMeshUpdate(const int8_t, const int8_t, const float) { - } - #endif -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h deleted file mode 100644 index c2818570f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ /dev/null @@ -1,142 +0,0 @@ -/****************** - * pin_mappings.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 - -/* This file defines mappings from the ULTRA_LCD pins functions to new - * functions for the FTDI display. These mappings allows any board that - * support ULTRA_LCD via EXP1 and EXP2 connectors to use FTDI modules - * without adding new pin definitions to the board. - */ - -#ifdef CR10_TFT_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error This pin mapping requires Marlin. - #endif - - #define CLCD_USE_SOFT_SPI - #define CLCD_SOFT_SPI_SCLK LCD_PINS_D4 // PORTA1 Pin 6 - #define CLCD_SOFT_SPI_MOSI LCD_PINS_ENABLE // PORTC1 Pin 8 - #define CLCD_SPI_CS LCD_PINS_RS // PORTA3 Pin 7 - #define CLCD_SOFT_SPI_MISO 16 // PORTC0 BTN_ENC Pin 2 - #define CLCD_MOD_RESET 11 // PORTD3 BTN_EN1 Pin 3 - #define CLCD_AUX_0 10 // PORTD2 BTN_EN2 Pin 5 - #define CLCD_AUX_1 BEEPER_PIN // PORTA4 Pin 1 -#endif - -/** - * The AlephObjects pinout for re-purposing the UltraLCD - * connector EXP1 for software SPI (rev B, obsolete) - */ - -#ifdef AO_EXP1_DEPRECATED_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error This pin mapping requires Marlin. - #endif - - #define CLCD_MOD_RESET LCD_PINS_D4 - #define CLCD_SPI_CS LCD_PINS_D5 - - #define CLCD_AUX_0 LCD_PINS_ENABLE - #define CLCD_AUX_1 BTN_ENC - #define CLCD_AUX_2 BEEPER_PIN - - #define CLCD_USE_SOFT_SPI - #define CLCD_SOFT_SPI_SCLK LCD_PINS_D7 - #define CLCD_SOFT_SPI_MOSI LCD_PINS_D6 - #define CLCD_SOFT_SPI_MISO LCD_PINS_RS -#endif - -/** - * AO_EXP1_PINMAP - * - * The AlephObjects mapping for re-purposing the UltraLCD - * connector EXP1 for software SPI for display (rev C): - * - * EXP2: FTDI: SD -or- USB [1]: ULTRA_LCD: - * 1 MISO MISO MISO --> BEEPER - * 2 SCLK SCLK SCLK --> BTN_ENC - * 3 PD_N - - --> LCDE - * 4 - CS_N CS_N --> LCDRS - * 5 CS_N - - --> LCD4 - * 6 MOSI MOSI MOSI --> LCD5 - * 7 - SD_DET INT --> LCD6 - * 8 RESET - RESET --> LCD4 - * 9 GND GND GND --> GND - * 10 5V 5V 5V --> 5V - * - * [1] At the moment, Marlin does not support SD or USB - * functionality over software SPI. - */ - -#ifdef AO_EXP1_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error This pin mapping requires Marlin. - #endif - - #define CLCD_MOD_RESET LCD_PINS_ENABLE - #define CLCD_SPI_CS LCD_PINS_D4 - - #define CLCD_USE_SOFT_SPI - #define CLCD_SOFT_SPI_SCLK BTN_ENC - #define CLCD_SOFT_SPI_MOSI LCD_PINS_D5 - #define CLCD_SOFT_SPI_MISO BEEPER_PIN -#endif - -/** - * AO_EXP2_PINMAP - * - * The AlephObjects mapping for re-purposing the UltraLCD - * connector EXP2 for hardware SPI for display and SD card - * or USB (rev C): - * - * EXP2: FTDI: SD -or- USB: ULTRA_LCD: - * 1 MISO MISO MISO --> MISO - * 2 SCLK SCLK SCLK --> SCLK - * 3 PD_N - - --> BTN_EN2 - * 4 - CS_N CS_N --> SD_CSEL - * 5 CS_N - - --> BTN_EN1 - * 6 MOSI MOSI MOSI --> MOSI - * 7 - SD_DET INT --> SD_DET - * 8 RESET - RESET --> RESET - * 9 GND GND GND --> GND - * 10 5V 5V 5V --> KILL [3] - * - * [1] This configuration is not compatible with the - * EinsyRetro 1.1a because there is a level shifter - * on MISO enabled by SD/USB chip select. - * - * [2] This configuration allows daisy-chaining of the - * display and SD/USB on EXP2. - * - * [3] Archim Rambo provides 5V on this pin. On any other - * board, divert this wire from the ribbon cable and - * connect it to 5V at an endstop. - */ - -#ifdef AO_EXP2_PINMAP - #ifndef __MARLIN_FIRMWARE__ - #error This pin mapping requires Marlin. - #endif - - #define CLCD_SPI_CS BTN_EN1 - #define CLCD_MOD_RESET BTN_EN2 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp deleted file mode 100644 index afd4402fc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/******************** - * about_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -#define GRID_COLS 4 -#define GRID_ROWS 9 - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void AboutScreen::onEntry() { - BaseScreen::onEntry(); - sound.play(chimes, PLAY_ASYNCHRONOUS); -} - -void AboutScreen::onRedraw(draw_mode_t) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - - draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(4,1), - #ifdef CUSTOM_MACHINE_NAME - F(CUSTOM_MACHINE_NAME) - #else - GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) - #endif - , OPT_CENTER, font_xlarge - ); - - #ifdef TOOLHEAD_NAME - char about_str[ - strlen_P(GET_TEXT(FIRMWARE_FOR_TOOLHEAD)) + - strlen_P(TOOLHEAD_NAME) + - strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + 1 - ]; - - sprintf_P(about_str, GET_TEXT(MSG_FIRMWARE_FOR_TOOLHEAD), TOOLHEAD_NAME); - strcat_P (about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)); - #endif - - cmd.tag(2); - draw_text_box(cmd, BTN_POS(1,3), BTN_SIZE(4,3), - #ifdef TOOLHEAD_NAME - about_str - #else - GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_2) - #endif - , 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), GET_TEXT_F(MSG_BUTTON_OKAY)); -} - -bool AboutScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; -#if ENABLED(TOUCH_UI_DEVELOPER_MENU) - case 2: GOTO_SCREEN(DeveloperMenu); return true; -#endif - default: return false; - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp deleted file mode 100644 index b2fc2790a0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/***************************** - * advance_settings_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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(Theme::font_medium) - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 10 - #define GRID_COLS 2 - .enabled( - #if HAS_BED_PROBE - 1 - #endif - ) - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - .enabled( - #if HAS_CASE_LIGHT - 1 - #endif - ) - .tag(16).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) - .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(13).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(14).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) - .enabled( - #if HOTENDS > 1 - 1 - #endif - ) - .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) - .enabled( - #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) - .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) - .tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) - .tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) - .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) - .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) - #if DISABLED(CLASSIC_JERK) - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) - #else - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) - #endif - .enabled( - #if ENABLED(BACKLASH_GCODE) - 1 - #endif - ) - .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) - .colors(action_btn) - .tag(1) .button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #undef GRID_COLS - #undef GRID_ROWS - #else - #define GRID_ROWS 6 - #define GRID_COLS 3 - .enabled( - #if HAS_BED_PROBE - 1 - #endif - ) - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - .enabled( - #if HAS_CASE_LIGHT - 1 - #endif - ) - .tag(16).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) - .enabled(1) - .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) - .enabled( - #if ENABLED(BACKLASH_GCODE) - 1 - #endif - ) - .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) - .enabled( - #if HOTENDS > 1 - 1 - #endif - ) - .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) - .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) - .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) - #if DISABLED(CLASSIC_JERK) - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) - #else - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) - #endif - .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) - .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) - .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) - .colors(action_btn) - .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); - #endif - } -} - -bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - #if HAS_BED_PROBE - case 2: GOTO_SCREEN(ZOffsetScreen); break; - #endif - case 3: GOTO_SCREEN(StepsScreen); break; - #if HOTENDS > 1 - case 4: GOTO_SCREEN(NozzleOffsetScreen); break; - #endif - case 5: GOTO_SCREEN(MaxVelocityScreen); break; - case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; - case 7: - #if DISABLED(CLASSIC_JERK) - GOTO_SCREEN(JunctionDeviationScreen); - #else - GOTO_SCREEN(JerkScreen); - #endif - break; - #if ENABLED(BACKLASH_GCODE) - case 8: GOTO_SCREEN(BacklashCompensationScreen); break; - #endif - case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; - case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; - #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - case 11: GOTO_SCREEN(FilamentMenu); break; - #endif - case 12: GOTO_SCREEN(EndstopStatesScreen); break; - #if HAS_TRINAMIC - case 13: GOTO_SCREEN(StepperCurrentScreen); break; - case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break; - #endif - case 15: GOTO_SCREEN(DisplayTuningScreen); break; - #if HAS_CASE_LIGHT - case 16: GOTO_SCREEN(CaseLightScreen); break; - #endif - default: return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp deleted file mode 100644 index 17750c02ec..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************ - * alert_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace Theme; - -void AlertDialogBox::onEntry() { - BaseScreen::onEntry(); - sound.play(screen_data.AlertDialogBox.isError ? sad_trombone : twinkle, PLAY_ASYNCHRONOUS); -} - -void AlertDialogBox::onRedraw(draw_mode_t what) { - if (what & FOREGROUND) { - drawOkayButton(); - } -} - -template -void AlertDialogBox::show(const T message) { - drawMessage(message); - storeBackground(); - screen_data.AlertDialogBox.isError = false; - GOTO_SCREEN(AlertDialogBox); -} - -template -void AlertDialogBox::showError(const T message) { - drawMessage(message); - storeBackground(); - screen_data.AlertDialogBox.isError = true; - GOTO_SCREEN(AlertDialogBox); -} - -void AlertDialogBox::hide() { - if (AT_SCREEN(AlertDialogBox)) - GOTO_PREVIOUS(); -} - -template void AlertDialogBox::show(const char *); -template void AlertDialogBox::show(const progmem_str); -template void AlertDialogBox::showError(const char *); -template void AlertDialogBox::showError(const progmem_str); - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp deleted file mode 100644 index 0d6b97d46a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/************************************ - * backlash_compensation_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, BACKLASH_GCODE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void BacklashCompensationScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2).units( GET_TEXT_F(MSG_UNITS_MM)); - w.heading( GET_TEXT_F(MSG_BACKLASH)); - w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), getAxisBacklash_mm(X)); - w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), getAxisBacklash_mm(Y)); - w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), getAxisBacklash_mm(Z)); - #if ENABLED(CALIBRATION_GCODE) - w.button(12, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY)); - #endif - #ifdef BACKLASH_SMOOTHING_MM - w.color(other).adjuster(8, GET_TEXT_F(MSG_BACKLASH_SMOOTHING), getBacklashSmoothing_mm()); - #endif - w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)) - .adjuster(10, GET_TEXT_F(MSG_BACKLASH_CORRECTION), getBacklashCorrection_percent()); - w.precision(2).increments(); -} - -bool BacklashCompensationScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisBacklash_mm, X); break; - case 3: UI_INCREMENT(AxisBacklash_mm, X); break; - case 4: UI_DECREMENT(AxisBacklash_mm, Y); break; - case 5: UI_INCREMENT(AxisBacklash_mm, Y); break; - case 6: UI_DECREMENT(AxisBacklash_mm, Z); break; - case 7: UI_INCREMENT(AxisBacklash_mm, Z); break; - #ifdef BACKLASH_SMOOTHING_MM - case 8: UI_DECREMENT(BacklashSmoothing_mm); break; - case 9: UI_INCREMENT(BacklashSmoothing_mm); break; - #endif - case 10: UI_DECREMENT_BY(BacklashCorrection_percent, increment*100); break; - case 11: UI_INCREMENT_BY(BacklashCorrection_percent, increment*100); break; - #if ENABLED(CALIBRATION_GCODE) - case 12: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true; - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp deleted file mode 100644 index 97e399a403..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/************************************** - * base_numeric_adjustment_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -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) { - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .colors(normal_btn) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - } - - cmd.font(font_medium); - _button(cmd, 1, - #ifdef TOUCH_UI_PORTRAIT - BTN_POS(1,10), BTN_SIZE(13,1), - #else - BTN_POS(15,7), BTN_SIZE(4,1), - #endif - GET_TEXT_F(MSG_BACK), true, true - ); - - _line = 1; - _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) || - (_style == TEXT_LABEL && style != TEXT_LABEL) || - (_style != TEXT_LABEL && style == TEXT_LABEL); - 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(style == TEXT_LABEL ? bg_text_enabled : 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) { - _decimals = decimals; - if (screen_data.BaseNumericAdjustmentScreen.increment == 0) { - screen_data.BaseNumericAdjustmentScreen.increment = 243 + (initial - DEFAULT_LOWEST) - _decimals; - } - return *this; -} - -void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { - if (_what & BACKGROUND) { - CommandProcessor cmd; - _button_style(cmd, TEXT_LABEL); - cmd.font(font_medium) - .tag(0) - .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++; -} - -#ifdef TOUCH_UI_PORTRAIT - #ifdef TOUCH_UI_800x480 - #undef EDGE_R - #define EDGE_R 20 - #else - #undef EDGE_R - #define EDGE_R 10 - #endif -#endif - -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; - - if (increment == 0) { - increment = tag; // Set the default value to be the first. - } - - switch (tag) { - case 240: label = PSTR( ".001"); pos = _decimals - 3; break; - case 241: label = PSTR( ".01" ); pos = _decimals - 2; break; - case 242: label = PSTR( "0.1" ); pos = _decimals - 1; break; - case 243: label = PSTR( "1" ); pos = _decimals + 0; break; - case 244: label = PSTR( "10" ); pos = _decimals + 1; break; - default: label = PSTR("100" ); pos = _decimals + 2; break; - } - - const bool highlight = (_what & FOREGROUND) && (increment == tag); - - switch (pos) { - #ifdef TOUCH_UI_PORTRAIT - 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: _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 - } -} - -void BaseNumericAdjustmentScreen::widgets_t::increments() { - CommandProcessor cmd; - - cmd.font(LAYOUT_FONT); - - if (_what & BACKGROUND) { - _button_style(cmd, TEXT_LABEL); - cmd.tag(0).text( - #ifdef TOUCH_UI_PORTRAIT - BTN_POS(1, _line), BTN_SIZE(4,1), - #else - BTN_POS(15, 1), BTN_SIZE(4,1), - #endif - GET_TEXT_F(MSG_INCREMENT) - ); - } - - _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++; - #endif -} - -void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { - CommandProcessor cmd; - - if (_what & BACKGROUND) { - _button_style(cmd, TEXT_LABEL); - cmd.tag(0) - .font(font_small) - .text( BTN_POS(1,_line), BTN_SIZE(4,1), label); - _button_style(cmd, TEXT_AREA); - cmd.fgcolor(_color).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT); - } - - 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, progmem_str label, const char *value, bool is_enabled) { - if (_what & BACKGROUND) { - adjuster_sram_val(tag, label, nullptr); - } - - if (_what & FOREGROUND) { - char b[strlen_P(value)+1]; - strcpy_P(b,value); - adjuster_sram_val(tag, label, b, 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); - } - - if (_what & FOREGROUND) { - char b[32]; - dtostrf(value, 5, _decimals, b); - strcat_P(b, PSTR(" ")); - strcat_P(b, (const char*) _units); - adjuster_sram_val(tag, label, b, is_enabled); - } -} - -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, progmem_str label, const char *value, bool is_enabled) { - CommandProcessor cmd; - - if (_what & BACKGROUND) { - _button_style(cmd, TEXT_LABEL); - cmd.enabled(1) - .tag(0) - .font(font_small) - .text( BTN_POS(1,_line), BTN_SIZE(4,1), label); - _button_style(cmd, TEXT_AREA); - cmd.fgcolor(_color) - .tag(tag) - .button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT); - } - - if (_what & FOREGROUND) { - 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) { - _button_style(cmd, TEXT_LABEL); - 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) - .toggle2( - #ifdef TOUCH_UI_PORTRAIT - BTN_POS( 9,_line), BTN_SIZE(5,1), - #else - BTN_POS(10,_line), BTN_SIZE(4,1), - #endif - GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), value - ); - } - - _line++; -} - -void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) { - CommandProcessor cmd; - - if (_what & BACKGROUND) { - _button_style(cmd, TEXT_LABEL); - cmd.font(font_small) - .text(BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXT_F(MSG_HOME)); - } - - cmd.font(LAYOUT_FONT); - _button(cmd, tag+0, BTN_POS(5,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_X)); - _button(cmd, tag+1, BTN_POS(7,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Y)); - _button(cmd, tag+2, BTN_POS(9,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Z)); - _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXT_F(MSG_AXIS_ALL)); - - _line++; -} - -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 240 ... 245: screen_data.BaseNumericAdjustmentScreen.increment = tag; break; - default: return current_screen.onTouchHeld(tag); - } - return true; -} - -float BaseNumericAdjustmentScreen::getIncrement() { - switch (screen_data.BaseNumericAdjustmentScreen.increment) { - case 240: return 0.001; - case 241: return 0.01; - case 242: return 0.1; - case 243: return 1.0; - case 244: return 10.0; - case 245: return 100.0; - default: return 0.0; - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp deleted file mode 100644 index 77cadabcd7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/******************* - * base_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -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); - return false; - } - - #ifdef LCD_TIMEOUT_TO_STATUS - if (EventLoop::get_pressed_tag() != 0) { - reset_menu_timeout(); - } - #endif - - if (buttonIsPressed(tag)) { - options = OPT_FLAT; - } - - if (style & cmd.STYLE_DISABLED) { - cmd.tag(0); - style &= ~cmd.STYLE_DISABLED; - cmd.colors(disabled_btn); - return true; // Call me again to reset the colors - } - return false; -} - -void BaseScreen::onIdle() { - #ifdef 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 -} - -void BaseScreen::reset_menu_timeout() { - #ifdef LCD_TIMEOUT_TO_STATUS - last_interaction = millis(); - #endif -} - -#ifdef LCD_TIMEOUT_TO_STATUS - uint32_t BaseScreen::last_interaction; -#endif - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp deleted file mode 100644 index c2cbf70ae2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/***************************** - * bio_advanced_settings.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(Theme::font_medium) - #define GRID_ROWS 9 - #define GRID_COLS 2 - - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled( - #if HAS_TRINAMIC - 1 - #endif - ) - .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) - .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .enabled( - #if HOTENDS > 1 - 1 - #endif - ) - .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) - - - .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) - .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) - .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) - #if DISABLED(CLASSIC_JERK) - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) - #else - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) - #endif - .enabled( - #if ENABLED(BACKLASH_GCODE) - 1 - #endif - ) - .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) - .enabled( - #if ENABLED(LIN_ADVANCE) - 1 - #endif - ) - .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) - .colors(action_btn) - .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #undef GRID_COLS - #undef GRID_ROWS - } -} - -bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { - using namespace ExtUI; - - switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - case 2: GOTO_SCREEN(DisplayTuningScreen); break; - #if HAS_TRINAMIC - case 3: GOTO_SCREEN(StepperCurrentScreen); break; - case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break; - #endif - case 5: GOTO_SCREEN(EndstopStatesScreen); break; - #if HOTENDS > 1 - case 6: GOTO_SCREEN(NozzleOffsetScreen); break; - #endif - - case 7: GOTO_SCREEN(StepsScreen); break; - case 8: GOTO_SCREEN(MaxVelocityScreen); break; - case 9: GOTO_SCREEN(DefaultAccelerationScreen); break; - case 10: - #if DISABLED(CLASSIC_JERK) - GOTO_SCREEN(JunctionDeviationScreen); - #else - GOTO_SCREEN(JerkScreen); - #endif - break; - #if ENABLED(BACKLASH_GCODE) - case 11: GOTO_SCREEN(BacklashCompensationScreen); break; - #endif - #if ENABLED(LIN_ADVANCE) - case 12: GOTO_SCREEN(LinearAdvanceScreen); break; - #endif - case 13: GOTO_SCREEN(InterfaceSettingsScreen); break; - case 14: GOTO_SCREEN(RestoreFailsafeDialogBox); break; - - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp deleted file mode 100644 index a3254bae9a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************** - * bio_confirm_home_xyz.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; - -void BioConfirmHomeE::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_HOME_E_WARNING)); - drawYesNoButtons(1); -} - -bool BioConfirmHomeE::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - SpinnerDialogBox::enqueueAndWait_P(F( - "G28 E\n" - AXIS_LEVELING_COMMANDS "\n" - PARK_AND_RELEASE_COMMANDS - )); - current_screen.forget(); - break; - case 2: - GOTO_SCREEN(StatusScreen); - break; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } - return true; -} -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp deleted file mode 100644 index 883a446b3e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************** - * bio_confirm_home_xyz.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; - -void BioConfirmHomeXYZ::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_HOME_XYZ_WARNING)); - drawYesNoButtons(1); -} - -bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - SpinnerDialogBox::enqueueAndWait_P(F( - "G28\n" - PARK_AND_RELEASE_COMMANDS - )); - current_screen.forget(); - break; - case 2: - GOTO_SCREEN(StatusScreen); - break; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } - return true; -} -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp deleted file mode 100644 index 40ed8479ee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/********************* - * bio_main_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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void MainMenu::onRedraw(draw_mode_t what) { - #define GRID_ROWS 10 - #define GRID_COLS 2 - - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN)) - .colors(normal_btn) - .font(font_medium) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) - .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) - .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) - .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(8).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .tag(9).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) - .colors(action_btn) - .tag(1).button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - } - - #undef GRID_COLS - #undef GRID_ROWS -} - -bool MainMenu::onTouchEnd(uint8_t tag) { - using namespace ExtUI; - - const bool e_homed = isAxisPositionKnown(E0); - - switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break; - case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? F("G0 E0 F120") : F("G112")); break; - case 4: StatusScreen::unlockMotors(); break; - case 5: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break; - case 6: GOTO_SCREEN(TemperatureScreen); break; - case 7: GOTO_SCREEN(InterfaceSettingsScreen); break; - case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; - case 9: GOTO_SCREEN(AboutScreen); break; - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h deleted file mode 100644 index 1c7c02093d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h +++ /dev/null @@ -1,59 +0,0 @@ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ - -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 480.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 272.000000; - -const PROGMEM uint16_t z_neg[] = {0x7950, 0x51EA, 0x824E, 0x51EA, 0x824E, 0x71E2, 0x86CD, 0x71E2, 0x7DCF, 0x81DF, 0x74D1, 0x71E2, 0x7950, 0x71E2, 0x7950, 0x51EA}; -const PROGMEM uint16_t z_pos[] = {0x7950, 0x41EE, 0x824E, 0x41EE, 0x824E, 0x21F5, 0x86CD, 0x21F5, 0x7DCF, 0x11F9, 0x74D0, 0x21F5, 0x7950, 0x21F5, 0x7950, 0x41EE}; -const PROGMEM uint16_t y_neg[] = {0x3479, 0x56CF, 0x3EC6, 0x56CF, 0x3747, 0x7281, 0x3C6D, 0x7281, 0x2E61, 0x8059, 0x27D4, 0x7281, 0x2CFA, 0x7281, 0x3479, 0x56CF}; -const PROGMEM uint16_t y_pos[] = {0x3BF9, 0x3B1D, 0x4645, 0x3B1D, 0x4DC4, 0x1F6B, 0x52EB, 0x1F6B, 0x4C5E, 0x1192, 0x3E52, 0x1F6B, 0x4378, 0x1F6B, 0x3BF9, 0x3B1D}; -const PROGMEM uint16_t x_neg[] = {0x350E, 0x4209, 0x314E, 0x4FE2, 0x1CB5, 0x4FE2, 0x1AD6, 0x56CF, 0x1449, 0x48F6, 0x2255, 0x3B1D, 0x2075, 0x4209, 0x350E, 0x4209}; -const PROGMEM uint16_t x_pos[] = {0x498C, 0x4209, 0x45CC, 0x4FE2, 0x5A65, 0x4FE2, 0x5885, 0x56CF, 0x6691, 0x48F6, 0x6004, 0x3B1D, 0x5E25, 0x4209, 0x498C, 0x4209}; -const PROGMEM uint16_t syringe_fluid[] = {0xB4E9, 0x78BE, 0xBB12, 0x7C44, 0xBDE3, 0x7C44, 0xC426, 0x78BE, 0xC426, 0x250D, 0xB4E9, 0x250D, 0xB4E9, 0x78BE}; -const PROGMEM uint16_t syringe[] = {0xB8AD, 0x6BB1, 0xB8AD, 0x6E0C, 0xBE02, 0x6E0C, 0xBE02, 0x6BB1, 0xFFFF, 0xB8AD, 0x6248, 0xB8AD, 0x64A2, 0xBE02, 0x64A2, 0xBE02, 0x6248, 0xFFFF, 0xB8AD, 0x58DF, 0xB8AD, 0x5B39, 0xBE02, 0x5B39, 0xBE02, 0x58DF, 0xFFFF, 0xB8AD, 0x4F75, 0xB8AD, 0x51D0, 0xBE02, 0x51D0, 0xBE02, 0x4F75, 0xFFFF, 0xB8AD, 0x460C, 0xB8AD, 0x4866, 0xBE02, 0x4866, 0xBE02, 0x460C, 0xFFFF, 0xB8AD, 0x3CA3, 0xB8AD, 0x3EFD, 0xBE02, 0x3EFD, 0xBE02, 0x3CA3, 0xFFFF, 0xB8AD, 0x3339, 0xB8AD, 0x3594, 0xBE02, 0x3594, 0xBE02, 0x3339, 0xFFFF, 0xB396, 0x110A, 0xB396, 0x1818, 0xB995, 0x1818, 0xB995, 0x22AD, 0xB396, 0x22AD, 0xB396, 0x7ADA, 0xB995, 0x7E61, 0xB995, 0x88F5, 0xBB95, 0x88F5, 0xBB95, 0xA8B4, 0xBD94, 0xAC3B, 0xBD94, 0x88F5, 0xBF94, 0x88F5, 0xBF94, 0x7E61, 0xC593, 0x7ADA, 0xC593, 0x22AD, 0xBF94, 0x22AD, 0xBF94, 0x1818, 0xC593, 0x1818, 0xC593, 0x110A, 0xFFFF, 0xBB95, 0x1818, 0xBD94, 0x1818, 0xBD94, 0x22AD, 0xBB95, 0x22AD, 0xBB95, 0x1818, 0xFFFF, 0xB596, 0x2634, 0xC393, 0x2634, 0xC393, 0x7753, 0xBD94, 0x7ADA, 0xBB95, 0x7ADA, 0xB596, 0x7753, 0xB596, 0x2634}; -const PROGMEM uint16_t syringe_outline[] = {0xB396, 0x110A, 0xB396, 0x1818, 0xB995, 0x1818, 0xB995, 0x22AD, 0xB396, 0x22AD, 0xB396, 0x7ADA, 0xB995, 0x7E61, 0xB995, 0x88F5, 0xBB95, 0x88F5, 0xBB95, 0xA8B4, 0xBD94, 0xAC3B, 0xBD94, 0x88F5, 0xBF94, 0x88F5, 0xBF94, 0x7E61, 0xC593, 0x7ADA, 0xC593, 0x22AD, 0xBF94, 0x22AD, 0xBF94, 0x1818, 0xC593, 0x1818, 0xC593, 0x110A, 0xB396, 0x110A}; -const PROGMEM uint16_t padlock[] = {0x3FE3, 0x2A04, 0x3D34, 0x2AF9, 0x3AFF, 0x2D93, 0x397D, 0x316D, 0x38E8, 0x3626, 0x38E8, 0x3A14, 0x39B3, 0x3C8F, 0x3B50, 0x3C8F, 0x3C1C, 0x3A14, 0x3C1C, 0x363C, 0x3C6B, 0x33A9, 0x3D3A, 0x3193, 0x3E6C, 0x302D, 0x3FE3, 0x2FAA, 0x415A, 0x302D, 0x428C, 0x3192, 0x435B, 0x33A8, 0x43AB, 0x363C, 0x43AB, 0x4492, 0x38C3, 0x4492, 0x3741, 0x45AC, 0x36A1, 0x4856, 0x36A1, 0x5C41, 0x3741, 0x5EEC, 0x38C3, 0x6005, 0x4703, 0x6005, 0x4886, 0x5EEC, 0x4925, 0x5C41, 0x4925, 0x4856, 0x4886, 0x45AC, 0x4703, 0x4492, 0x46DE, 0x362B, 0x4649, 0x316D, 0x44C7, 0x2D92, 0x4292, 0x2AF9}; -const PROGMEM uint16_t home_z[] = {0x80BB, 0x2B43, 0x712C, 0x46B9, 0x750F, 0x46B9, 0x750F, 0x622F, 0x7CD7, 0x622F, 0x7CD7, 0x5474, 0x849F, 0x5474, 0x849F, 0x622F, 0x8C67, 0x622F, 0x8C67, 0x46B9, 0x904B, 0x46B9, 0x8A48, 0x3C1D, 0x8A48, 0x2ECD, 0x8664, 0x2ECD, 0x8664, 0x3540}; -const PROGMEM uint16_t usb_btn[] = {0x0558, 0xC0D6, 0x3BDB, 0xC0D6, 0x3BDB, 0xF431, 0x0558, 0xF431, 0x0558, 0xC0D6}; -const PROGMEM uint16_t menu_btn[] = {0x416B, 0xC0D6, 0x77EE, 0xC0D6, 0x77EE, 0xF431, 0x416B, 0xF431, 0x416B, 0xC0D6}; -const PROGMEM uint16_t e_pos[] = {0xE04E, 0x5E7B, 0xE94C, 0x5E7B, 0xE94C, 0x7E74, 0xEDCB, 0x7E74, 0xE4CD, 0x8E70, 0xDBCF, 0x7E74, 0xE04E, 0x7E74, 0xE04E, 0x5E7B}; -const PROGMEM uint16_t e_neg[] = {0xE04E, 0x4E7F, 0xE94C, 0x4E7F, 0xE94C, 0x2E87, 0xEDCB, 0x2E87, 0xE4CD, 0x1E8A, 0xDBCF, 0x2E87, 0xE04E, 0x2E87, 0xE04E, 0x4E7F}; -const PROGMEM uint16_t home_e[] = {0xD705, 0x3885, 0xC775, 0x53FB, 0xCB59, 0x53FB, 0xCB59, 0x6F71, 0xD321, 0x6F71, 0xD321, 0x61B6, 0xDAE9, 0x61B6, 0xDAE9, 0x6F71, 0xE2B1, 0x6F71, 0xE2B1, 0x53FB, 0xE695, 0x53FB, 0xE092, 0x495F, 0xE092, 0x3C0E, 0xDCAE, 0x3C0E, 0xDCAE, 0x4281}; -const PROGMEM uint16_t fine_label[] = {0x0D92, 0x9444, 0x5211, 0x9444, 0x5211, 0xA9EA, 0x0D92, 0xA9EA}; -const PROGMEM uint16_t fine_toggle[] = {0x56E7, 0x9444, 0x8007, 0x9444, 0x8007, 0xA9EA, 0x56E7, 0xA9EA}; -const PROGMEM uint16_t h1_temp[] = {0x9C2B, 0xDD3B, 0xBBDE, 0xDD3B, 0xBBDE, 0xFA57, 0x9C2B, 0xFA57}; -const PROGMEM uint16_t h1_label[] = {0x9C2B, 0xBE8F, 0xBBDC, 0xBE8F, 0xBBDC, 0xDBAA, 0x9C2B, 0xDBAA}; -const PROGMEM uint16_t h0_temp[] = {0x7BD0, 0xDD3B, 0x9B83, 0xDD3B, 0x9B83, 0xFA57, 0x7BD0, 0xFA57}; -const PROGMEM uint16_t h0_label[] = {0x7BD0, 0xBE8F, 0x9B83, 0xBE8F, 0x9B83, 0xDBAA, 0x7BD0, 0xDBAA}; -const PROGMEM uint16_t h2_temp[] = {0xBC86, 0xDD3B, 0xDC39, 0xDD3B, 0xDC39, 0xFA57, 0xBC86, 0xFA57}; -const PROGMEM uint16_t h2_label[] = {0xBC86, 0xBE8F, 0xDC37, 0xBE8F, 0xDC37, 0xDBAA, 0xBC86, 0xDBAA}; -const PROGMEM uint16_t h3_temp[] = {0xDCE2, 0xDD0D, 0xFC95, 0xDD0D, 0xFC95, 0xFA28, 0xDCE2, 0xFA28}; -const PROGMEM uint16_t h3_label[] = {0xDCE2, 0xBE60, 0xFC92, 0xBE60, 0xFC92, 0xDB7C, 0xDCE2, 0xDB7C}; -const PROGMEM uint16_t actual_temp[] = {0xCDF6, 0xD037, 0xF7CA, 0xD037, 0xF7CA, 0xF424, 0xCDF6, 0xF424}; -const PROGMEM uint16_t bed_icon[] = {0xCDF6, 0xA5CC, 0xF7CA, 0xA5CC, 0xF7CA, 0xC9B9, 0xCDF6, 0xC9B9}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h deleted file mode 100644 index 32f52f8e46..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h +++ /dev/null @@ -1,52 +0,0 @@ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ - -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 272.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 480.000000; - -const PROGMEM uint16_t z_neg[] = {0xC9B1, 0x96B3, 0xD990, 0x96B3, 0xD990, 0xA8D0, 0xE17F, 0xA8D0, 0xD1A0, 0xB1DF, 0xC1C2, 0xA8D0, 0xC9B1, 0xA8D0, 0xC9B1, 0x96B3}; -const PROGMEM uint16_t z_pos[] = {0xC9B1, 0x8DA4, 0xD990, 0x8DA4, 0xD990, 0x7B86, 0xE17F, 0x7B86, 0xD1A0, 0x7277, 0xC1C2, 0x7B86, 0xC9B1, 0x7B86, 0xC9B1, 0x8DA4}; -const PROGMEM uint16_t y_neg[] = {0x5037, 0x9979, 0x6264, 0x9979, 0x5529, 0xA92A, 0x5E3F, 0xA92A, 0x4575, 0xB103, 0x39E6, 0xA92A, 0x42FC, 0xA92A, 0x5037, 0x9979}; -const PROGMEM uint16_t y_pos[] = {0x5D72, 0x89C7, 0x6F9F, 0x89C7, 0x7CDA, 0x7A15, 0x85F0, 0x7A15, 0x7A61, 0x723D, 0x6197, 0x7A15, 0x6AAD, 0x7A15, 0x5D72, 0x89C7}; -const PROGMEM uint16_t x_neg[] = {0x513D, 0x8DB3, 0x4AA0, 0x958C, 0x2647, 0x958C, 0x22F8, 0x9979, 0x1769, 0x91A0, 0x3033, 0x89C7, 0x2CE4, 0x8DB3, 0x513D, 0x8DB3}; -const PROGMEM uint16_t x_pos[] = {0x7566, 0x8DB3, 0x6EC9, 0x958C, 0x9322, 0x958C, 0x8FD4, 0x9979, 0xA89E, 0x91A0, 0x9D0E, 0x89C7, 0x99C0, 0x8DB3, 0x7566, 0x8DB3}; -const PROGMEM uint16_t syringe_fluid[] = {0x7D1D, 0x4A0F, 0x87FC, 0x4C0E, 0x8CF4, 0x4C0E, 0x9801, 0x4A0F, 0x9801, 0x1AA2, 0x7D1D, 0x1AA2, 0x7D1D, 0x4A0F}; -const PROGMEM uint16_t syringe[] = {0x83C2, 0x42AA, 0x83C2, 0x43FF, 0x8D2C, 0x43FF, 0x8D2C, 0x42AA, 0xFFFF, 0x83C2, 0x3D54, 0x83C2, 0x3EAA, 0x8D2C, 0x3EAA, 0x8D2C, 0x3D54, 0xFFFF, 0x83C2, 0x37FF, 0x83C2, 0x3954, 0x8D2C, 0x3954, 0x8D2C, 0x37FF, 0xFFFF, 0x83C2, 0x32AA, 0x83C2, 0x33FF, 0x8D2C, 0x33FF, 0x8D2C, 0x32AA, 0xFFFF, 0x83C2, 0x2D54, 0x83C2, 0x2EAA, 0x8D2C, 0x2EAA, 0x8D2C, 0x2D54, 0xFFFF, 0x83C2, 0x27FF, 0x83C2, 0x2955, 0x8D2C, 0x2955, 0x8D2C, 0x27FF, 0xFFFF, 0x83C2, 0x22AA, 0x83C2, 0x23FF, 0x8D2C, 0x23FF, 0x8D2C, 0x22AA, 0xFFFF, 0x7AC7, 0x0F4B, 0x7AC7, 0x134A, 0x855B, 0x134A, 0x855B, 0x1949, 0x7AC7, 0x1949, 0x7AC7, 0x4B40, 0x855B, 0x4D40, 0x855B, 0x533F, 0x88E2, 0x533F, 0x88E2, 0x653C, 0x8C69, 0x673C, 0x8C69, 0x533F, 0x8FF0, 0x533F, 0x8FF0, 0x4D40, 0x9A85, 0x4B40, 0x9A85, 0x1949, 0x8FF0, 0x1949, 0x8FF0, 0x134A, 0x9A85, 0x134A, 0x9A85, 0x0F4B, 0xFFFF, 0x88E2, 0x134A, 0x8C69, 0x134A, 0x8C69, 0x1949, 0x88E2, 0x1949, 0x88E2, 0x134A, 0xFFFF, 0x7E4D, 0x1B49, 0x96FE, 0x1B49, 0x96FE, 0x4941, 0x8C69, 0x4B40, 0x88E2, 0x4B40, 0x7E4D, 0x4941, 0x7E4D, 0x1B49}; -const PROGMEM uint16_t syringe_outline[] = {0x7AC7, 0x0F4B, 0x7AC7, 0x134A, 0x855B, 0x134A, 0x855B, 0x1949, 0x7AC7, 0x1949, 0x7AC7, 0x4B40, 0x855B, 0x4D40, 0x855B, 0x533F, 0x88E2, 0x533F, 0x88E2, 0x653C, 0x8C69, 0x673C, 0x8C69, 0x533F, 0x8FF0, 0x533F, 0x8FF0, 0x4D40, 0x9A85, 0x4B40, 0x9A85, 0x1949, 0x8FF0, 0x1949, 0x8FF0, 0x134A, 0x9A85, 0x134A, 0x9A85, 0x0F4B, 0x7AC7, 0x0F4B}; -const PROGMEM uint16_t padlock[] = {0x645A, 0x8017, 0x5F9E, 0x80A1, 0x5BBA, 0x821B, 0x5911, 0x844A, 0x580A, 0x86F7, 0x580A, 0x8931, 0x5970, 0x8A98, 0x5C49, 0x8A98, 0x5DB0, 0x8931, 0x5DB0, 0x8703, 0x5E3C, 0x858E, 0x5FAA, 0x845F, 0x61C5, 0x8394, 0x645A, 0x834A, 0x66F0, 0x8394, 0x690C, 0x845F, 0x6A7A, 0x858D, 0x6B07, 0x8703, 0x6B07, 0x8F23, 0x57C8, 0x8F23, 0x551E, 0x8FC3, 0x5404, 0x9145, 0x5404, 0x9C8F, 0x551E, 0x9E11, 0x57C8, 0x9EB1, 0x70EE, 0x9EB1, 0x7398, 0x9E11, 0x74B2, 0x9C8F, 0x74B2, 0x9145, 0x7398, 0x8FC3, 0x70EE, 0x8F23, 0x70AC, 0x86FA, 0x6FA5, 0x844A, 0x6CFD, 0x821B, 0x6917, 0x80A1}; -const PROGMEM uint16_t home_z[] = {0xD6C9, 0x80CC, 0xBB53, 0x905B, 0xC231, 0x905B, 0xC231, 0x9FEB, 0xCFEC, 0x9FEB, 0xCFEC, 0x9823, 0xDDA7, 0x9823, 0xDDA7, 0x9FEB, 0xEB62, 0x9FEB, 0xEB62, 0x905B, 0xF240, 0x905B, 0xE7A3, 0x8A58, 0xE7A3, 0x82CD, 0xE0C6, 0x82CD, 0xE0C6, 0x8674}; -const PROGMEM uint16_t home_e[] = {0xB94F, 0x25AA, 0x9DD8, 0x353A, 0xA4B6, 0x353A, 0xA4B6, 0x44C9, 0xB271, 0x44C9, 0xB271, 0x3D02, 0xC02C, 0x3D02, 0xC02C, 0x44C9, 0xCDE7, 0x44C9, 0xCDE7, 0x353A, 0xD4C5, 0x353A, 0xCA28, 0x2F36, 0xCA28, 0x27AB, 0xC34B, 0x27AB, 0xC34B, 0x2B53}; -const PROGMEM uint16_t bed_icon[] = {0x1764, 0x2C4C, 0x6135, 0x2C4C, 0x6135, 0x40A8, 0x1764, 0x40A8}; -const PROGMEM uint16_t actual_temp[] = {0x1764, 0x466F, 0x6135, 0x466F, 0x6135, 0x5ACB, 0x1764, 0x5ACB}; -const PROGMEM uint16_t target_temp[] = {0x1764, 0x1228, 0x6135, 0x1228, 0x6135, 0x2684, 0x1764, 0x2684}; -const PROGMEM uint16_t fine_label[] = {0x1AA7, 0xC6D2, 0x9387, 0xC6D2, 0x9387, 0xD316, 0x1AA7, 0xD316}; -const PROGMEM uint16_t fine_toggle[] = {0x9C10, 0xC6D2, 0xE4A3, 0xC6D2, 0xE4A3, 0xD316, 0x9C10, 0xD316}; -const PROGMEM uint16_t usb_btn[] = {0x0B68, 0xE880, 0x7B1A, 0xE880, 0x7B1A, 0xF94B, 0x0B68, 0xF94B, 0x0B68, 0xE880}; -const PROGMEM uint16_t menu_btn[] = {0x84E3, 0xE880, 0xF495, 0xE880, 0xF495, 0xF94B, 0x84E3, 0xF94B, 0x84E3, 0xE880}; -const PROGMEM uint16_t e_pos[] = {0xC9B1, 0x3B2D, 0xD990, 0x3B2D, 0xD990, 0x4D4B, 0xE17F, 0x4D4B, 0xD1A0, 0x565A, 0xC1C2, 0x4D4B, 0xC9B1, 0x4D4B, 0xC9B1, 0x3B2D}; -const PROGMEM uint16_t e_neg[] = {0xC9B1, 0x321E, 0xD990, 0x321E, 0xD990, 0x2000, 0xE17F, 0x2000, 0xD1A0, 0x16F1, 0xC1C2, 0x2000, 0xC9B1, 0x2000, 0xC9B1, 0x321E}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp deleted file mode 100644 index 4013065086..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/******************************* - * bio_printing_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -#include "../ftdi_eve_lib/extras/circular_progress.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -#define GRID_COLS 2 -#define GRID_ROWS 9 - -void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char* message) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(2,2), message, OPT_CENTER, font_large); - } -} - -void BioPrintingDialogBox::draw_progress(draw_mode_t what) { - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.font(font_large) - .text(BTN_POS(1,1), BTN_SIZE(2,2), isPrinting() ? F("Printing...") : F("Finished.")) - .tag(1) - .font(font_xlarge); - - draw_circular_progress(cmd, BTN_POS(1,4), BTN_SIZE(2,3), getProgress_percent(), theme_dark, theme_darkest); - } -} - -void BioPrintingDialogBox::draw_time_remaining(draw_mode_t what) { - if (what & FOREGROUND) { - const uint32_t elapsed = getProgress_seconds_elapsed(); - const uint8_t hrs = elapsed/3600; - const uint8_t min = (elapsed/60)%60; - - char time_str[10]; - sprintf_P(time_str, PSTR("%02dh %02dm"), hrs, min); - - CommandProcessor cmd; - cmd.font(font_large) - .text(BTN_POS(1,7), BTN_SIZE(2,2), time_str); - } -} - -void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) { - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(font_medium) - .colors(isPrinting() ? action_btn : normal_btn) - .tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu")) - #if ENABLED(SDSUPPORT) - .enabled(isPrinting() ? isPrintingFromMedia() : 1) - #else - .enabled(isPrinting() ? 0 : 1) - #endif - .tag(3) - .colors(isPrinting() ? normal_btn : action_btn) - .button( BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); - } -} - -void BioPrintingDialogBox::onRedraw(draw_mode_t what) { - if (what & FOREGROUND) { - draw_progress(FOREGROUND); - draw_time_remaining(FOREGROUND); - draw_interaction_buttons(FOREGROUND); - } -} - -bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_SCREEN(FeedratePercentScreen); break; - case 2: GOTO_SCREEN(TuneMenu); break; - case 3: - if (isPrinting()) { - GOTO_SCREEN(ConfirmAbortPrintDialogBox); - } else { - GOTO_SCREEN(StatusScreen); - } - break; - default: return false; - } - return true; -} - -void BioPrintingDialogBox::setStatusMessage(progmem_str message) { - char buff[strlen_P((const char*)message)+1]; - strcpy_P(buff, (const char*) message); - setStatusMessage(buff); -} - -void BioPrintingDialogBox::setStatusMessage(const char* message) { - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)); - - draw_status_message(BACKGROUND, message); - draw_progress(BACKGROUND); - draw_time_remaining(BACKGROUND); - draw_interaction_buttons(BACKGROUND); - storeBackground(); - - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("New status message: ", message); - #endif - - if (AT_SCREEN(BioPrintingDialogBox)) { - current_screen.onRefresh(); - } -} - -void BioPrintingDialogBox::onIdle() { - reset_menu_timeout(); - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - } - BaseScreen::onIdle(); -} - -void BioPrintingDialogBox::show() { - GOTO_SCREEN(BioPrintingDialogBox); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp deleted file mode 100644 index ec7f2bcffb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/************************* - * bio_status_screen.cpp * - *************************/ - -/**************************************************************************** - * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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(TOUCH_UI_FTDI_EVE) && ANY(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS) - -#include "screens.h" - -#include "../ftdi_eve_lib/extras/poly_ui.h" - -#ifdef TOUCH_UI_PORTRAIT - #include "bio_printer_ui_portrait.h" -#else - #include "bio_printer_ui_landscape.h" -#endif - -#define GRID_COLS 2 -#define GRID_ROWS 9 - -#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) - -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; -using namespace ExtUI; - -float StatusScreen::increment; -bool StatusScreen::jog_xy; -bool StatusScreen::fine_motion; - -void StatusScreen::unlockMotors() { - injectCommands_P(PSTR("M84 XY")); - jog_xy = false; -} - -void StatusScreen::draw_temperature(draw_mode_t what) { - CommandProcessor cmd; - PolyUI ui(cmd, what); - - int16_t x, y, h, v; - - cmd.tag(15); - - if (what & BACKGROUND) { - cmd.cmd(COLOR_RGB(bg_color)); - - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - // The LulzBot Bio shows the temperature for - // the bed. - - #ifdef TOUCH_UI_PORTRAIT - // Draw touch surfaces - ui.bounds(POLY(target_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - ui.bounds(POLY(actual_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - #else - ui.bounds(POLY(bed_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - #endif - ui.bounds(POLY(bed_icon), x, y, h, v); - cmd.rectangle(x, y, h, v); - - // Draw bed icon - cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) - .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) - .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) - .cmd(COLOR_RGB(shadow_rgb)) - .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); - #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) - // The CocoaPress shows the temperature for two - // heating zones, but has no bed temperature - - cmd.cmd(COLOR_RGB(bg_text_enabled)); - cmd.font(font_medium); - - ui.bounds(POLY(h0_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_1)); - - ui.bounds(POLY(h1_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_2)); - - ui.bounds(POLY(h2_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_3)); - - ui.bounds(POLY(h3_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); - #else - UNUSED(x); - UNUSED(y); - UNUSED(h); - UNUSED(v); - #endif - - #ifdef TOUCH_UI_USE_UTF8 - load_utf8_bitmaps(cmd); // Restore font bitmap handles - #endif - } - - if (what & FOREGROUND) { - char str[15]; - cmd.cmd(COLOR_RGB(bg_text_enabled)); - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - cmd.font(font_medium); - - #ifdef TOUCH_UI_PORTRAIT - if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) - format_temp(str, getTargetTemp_celsius(BED)); - else - strcpy_P(str, GET_TEXT(MSG_BED)); - - ui.bounds(POLY(target_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - format_temp(str, getActualTemp_celsius(BED)); - ui.bounds(POLY(actual_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - #else - if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) - format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); - else - format_temp_and_idle(str, getActualTemp_celsius(BED)); - - ui.bounds(POLY(bed_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - #endif - - #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) - // The CocoaPress shows the temperature for two - // heating zones, but has no bed temperature - - cmd.font(font_large); - - if (!isHeaterIdle(E0) && getTargetTemp_celsius(E0) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E0), getTargetTemp_celsius(E0)); - else - format_temp_and_idle(str, getActualTemp_celsius(E0)); - - ui.bounds(POLY(h0_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E1), getTargetTemp_celsius(E1)); - else - format_temp_and_idle(str, getActualTemp_celsius(E1)); - - ui.bounds(POLY(h1_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - if (!isHeaterIdle(E2) && getTargetTemp_celsius(E2) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E2), getTargetTemp_celsius(E2)); - else - format_temp_and_idle(str, getActualTemp_celsius(E2)); - - ui.bounds(POLY(h2_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - if (!isHeaterIdle(CHAMBER) && getTargetTemp_celsius(CHAMBER) > 0) - format_temp_and_temp(str, getActualTemp_celsius(CHAMBER), getTargetTemp_celsius(CHAMBER)); - else - format_temp_and_idle(str, getActualTemp_celsius(CHAMBER)); - - ui.bounds(POLY(h3_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - #else - UNUSED(str); - #endif - } -} - -void StatusScreen::draw_syringe(draw_mode_t what) { - int16_t x, y, h, v; - #ifdef E_MAX_POS - const float fill_level = 1.0 - min(1.0, max(0.0, getAxisPosition_mm(E0) / E_MAX_POS)); - #else - const float fill_level = 0.75; - #endif - const bool e_homed = (true - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - && isAxisPositionKnown(E0) - #endif - ); - - CommandProcessor cmd; - PolyUI ui(cmd, what); - - if (what & BACKGROUND) { - // Paint the shadow for the syringe - ui.color(shadow_rgb); - ui.shadow(POLY(syringe_outline), shadow_depth); - } - - if (what & FOREGROUND && e_homed) { - // Paint the syringe icon - ui.color(syringe_rgb); - ui.fill(POLY(syringe_outline)); - - ui.color(fill_rgb); - ui.bounds(POLY(syringe_fluid), x, y, h, v); - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(SCISSOR_XY(x,y + v * (1.0 - fill_level))); - cmd.cmd(SCISSOR_SIZE(h, v * fill_level)); - ui.fill(POLY(syringe_fluid), false); - cmd.cmd(RESTORE_CONTEXT()); - - ui.color(stroke_rgb); - ui.fill(POLY(syringe)); - } -} - -void StatusScreen::draw_arrows(draw_mode_t what) { - const bool e_homed = (true - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - && isAxisPositionKnown(E0) - #endif - ); - const bool z_homed = isAxisPositionKnown(Z); - - CommandProcessor cmd; - PolyUI ui(cmd, what); - - ui.button_fill (fill_rgb); - ui.button_stroke(stroke_rgb, 28); - ui.button_shadow(shadow_rgb, shadow_depth); - - if ((what & BACKGROUND) || jog_xy) { - ui.button(1, POLY(x_neg)); - ui.button(2, POLY(x_pos)); - ui.button(3, POLY(y_neg)); - ui.button(4, POLY(y_pos)); - } - - if ((what & BACKGROUND) || z_homed) { - ui.button(5, POLY(z_neg)); - ui.button(6, POLY(z_pos)); - } - - if ((what & BACKGROUND) || e_homed) { - #if DISABLED(TOUCH_UI_COCOA_PRESS) - ui.button(7, POLY(e_neg)); - #endif - ui.button(8, POLY(e_pos)); - } -} - -void StatusScreen::draw_fine_motion(draw_mode_t what) { - int16_t x, y, h, v; - CommandProcessor cmd; - PolyUI ui(cmd, what); - - cmd.font( - #ifdef TOUCH_UI_PORTRAIT - font_medium - #else - font_small - #endif - ) - .tag(16); - - if (what & BACKGROUND) { - ui.bounds(POLY(fine_label), x, y, h, v); - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .text(x, y, h, v, GET_TEXT_F(MSG_FINE_MOTION)); - } - - if (what & FOREGROUND) { - ui.bounds(POLY(fine_toggle), x, y, h, v); - cmd.colors(ui_toggle) - .toggle2(x, y, h, v, GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), fine_motion); - } -} - -void StatusScreen::draw_overlay_icons(draw_mode_t what) { - const bool e_homed = (true - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - && isAxisPositionKnown(E0) - #endif - ); - const bool z_homed = isAxisPositionKnown(Z); - - CommandProcessor cmd; - PolyUI ui(cmd, what); - - if (what & FOREGROUND) { - ui.button_fill (fill_rgb); - 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)); - } -} - -void StatusScreen::draw_buttons(draw_mode_t what) { - int16_t x, y, h, v; - - const bool has_media = isMediaInserted() && !isPrintingFromMedia(); - - CommandProcessor cmd; - PolyUI ui(cmd, what); - - ui.bounds(POLY(usb_btn), x, y, h, v); - cmd.font(font_medium) - .colors(normal_btn) - .enabled(has_media) - .colors(has_media ? action_btn : normal_btn) - .tag(9).button(x, y, h, v, - isPrintingFromMedia() ? - GET_TEXT_F(MSG_PRINTING) : - GET_TEXT_F(MSG_BUTTON_MEDIA) - ); - - ui.bounds(POLY(menu_btn), x, y, h, v); - cmd.colors(!has_media ? action_btn : normal_btn).tag(10).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_MENU)); -} - -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) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); - } - - draw_syringe(what); - draw_temperature(what); - draw_arrows(what); - draw_overlay_icons(what); - draw_buttons(what); - draw_fine_motion(what); -} - -bool StatusScreen::onTouchStart(uint8_t) { - increment = 0; - return true; -} - -bool StatusScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - case 2: - case 3: - case 4: - case 12: - if (!jog_xy) { - jog_xy = true; - injectCommands_P(PSTR("M17")); - } - jog({ 0, 0, 0 }); - break; - case 5: - case 6: - jog({ 0, 0, 0 }); - break; - case 9: GOTO_SCREEN(FilesScreen); break; - case 10: GOTO_SCREEN(MainMenu); break; - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - case 13: GOTO_SCREEN(BioConfirmHomeE); break; - #endif - case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; - case 15: GOTO_SCREEN(TemperatureScreen); break; - case 16: fine_motion = !fine_motion; break; - default: return false; - } - // If a passcode is enabled, the LockScreen will prevent the - // user from proceeding. - LockScreen::check_passcode(); - return true; -} - -bool StatusScreen::onTouchHeld(uint8_t tag) { - if (tag >= 1 && tag <= 4 && !jog_xy) return false; - const float s = min_speed + (fine_motion ? 0 : (max_speed - min_speed) * sq(increment)); - switch (tag) { - 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; - } - increment = min(1.0f, increment + 0.1f); - return false; -} - -void StatusScreen::setStatusMessage(progmem_str pstr) { - #ifdef TOUCH_UI_LULZBOT_BIO - BioPrintingDialogBox::setStatusMessage(pstr); - #else - UNUSED(pstr); - #endif -} - -void StatusScreen::setStatusMessage(const char * const str) { - #ifdef TOUCH_UI_LULZBOT_BIO - BioPrintingDialogBox::setStatusMessage(str); - #else - UNUSED(str); - #endif -} - -void StatusScreen::onIdle() { - reset_menu_timeout(); - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - if (!EventLoop::is_touch_held()) - onRefresh(); - #ifdef TOUCH_UI_LULZBOT_BIO - if (isPrintingFromMedia()) - BioPrintingDialogBox::show(); - #endif - refresh_timer.start(); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp deleted file mode 100644 index 27312c733f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/********************* - * bio_tune_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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void TuneMenu::onRedraw(draw_mode_t what) { - #define GRID_ROWS 8 - #define GRID_COLS 2 - - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0) - .font(font_large) - .text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_MENU)); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(font_medium) - .enabled( isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) - .enabled( - #if ENABLED(BABYSTEPPING) - true - #endif - ) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) - .enabled(!isPrinting()).tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) - .enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) - .enabled(!isPrinting()).tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) - .colors(action_btn) .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - } - #undef GRID_COLS - #undef GRID_ROWS -} - -bool TuneMenu::onTouchEnd(uint8_t tag) { - switch (tag) { - 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: SpinnerDialogBox::enqueueAndWait_P(F("G0 E0 F120")); break; - case 7: StatusScreen::unlockMotors(); break; - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp deleted file mode 100644 index 996c12cf23..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/******************* - * boot_screen.cpp * - *******************/ - -/**************************************************************************** - * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -#include "../ftdi_eve_lib/extras/poly_ui.h" -#include "../archim2-flash/flash_storage.h" - -#ifdef SHOW_CUSTOM_BOOTSCREEN - #ifdef TOUCH_UI_PORTRAIT - #include "../theme/_bootscreen_portrait.h" - #else - #include "../theme/_bootscreen_landscape.h" - #endif -#else - #ifdef TOUCH_UI_PORTRAIT - #include "../theme/marlin_bootscreen_portrait.h" - #else - #include "../theme/marlin_bootscreen_landscape.h" - #endif -#endif - -using namespace FTDI; -using namespace Theme; - -void BootScreen::onRedraw(draw_mode_t) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(0x000000)); - cmd.cmd(CLEAR(true,true,true)); - - CLCD::turn_on_backlight(); - SoundPlayer::set_volume(255); -} - -void BootScreen::onIdle() { - if (CLCD::is_touching()) { - // If the user is touching the screen at startup, then - // assume the user wants to re-calibrate the screen. - // This gives the user the ability to recover a - // miscalibration that has been stored to EEPROM. - - // Also reset display parameters to defaults, just - // in case the display is borked. - InterfaceSettingsScreen::failSafeSettings(); - - StatusScreen::loadBitmaps(); - GOTO_SCREEN(TouchCalibrationScreen); - current_screen.forget(); - PUSH_SCREEN(StatusScreen); - StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); - } else { - if (!UIFlashStorage::is_valid()) { - StatusScreen::loadBitmaps(); - SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT)); - UIFlashStorage::format_flash(); - SpinnerDialogBox::hide(); - } - - if (UIData::animations_enabled()) { - // If there is a startup video in the flash SPI, play - // that, otherwise show a static splash screen. - if (!MediaPlayerScreen::playBootMedia()) - showSplashScreen(); - } - - StatusScreen::loadBitmaps(); - - #ifdef TOUCH_UI_LULZBOT_BIO - GOTO_SCREEN(BioConfirmHomeXYZ); - current_screen.forget(); - PUSH_SCREEN(StatusScreen); - PUSH_SCREEN(BioConfirmHomeE); - #elif NUM_LANGUAGES > 1 - StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); - GOTO_SCREEN(LanguageMenu); - #else - StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); - GOTO_SCREEN(StatusScreen); - #endif - } -} - -void BootScreen::showSplashScreen() { - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART); - cmd.cmd(CLEAR_COLOR_RGB(LOGO_BACKGROUND)); - cmd.cmd(CLEAR(true,true,true)); - - #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) - #define LOGO_PAINT_PATH(rgb, path) cmd.cmd(COLOR_RGB(rgb)); ui.fill(POLY(path)); - - PolyUI ui(cmd); - - LOGO_PAINT_PATHS - - cmd.cmd(DL::DL_DISPLAY); - cmd.cmd(CMD_SWAP); - cmd.execute(); - - ExtUI::delay_ms(2500); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp deleted file mode 100644 index b82149c859..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/************************* - * case_light_screen.cpp * - *************************/ - -/**************************************************************************** - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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 BOTH(TOUCH_UI_FTDI_EVE, CASE_LIGHT_ENABLE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void CaseLightScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.heading( GET_TEXT_F(MSG_CASE_LIGHT)); - w.toggle( 2, GET_TEXT_F(MSG_LEDS), getCaseLightState()); - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)) - .adjuster(10, GET_TEXT_F(MSG_CASE_LIGHT_BRIGHTNESS), getCaseLightBrightness_percent()); - w.precision(0).increments(); - #endif -} - -bool CaseLightScreen::onTouchHeld(uint8_t tag) { - using namespace ExtUI; - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - const float increment = getIncrement(); - #endif - switch (tag) { - case 2: setCaseLightState(!getCaseLightState()); break; - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - case 10: UI_DECREMENT(CaseLightBrightness_percent); break; - case 11: UI_INCREMENT(CaseLightBrightness_percent); break; - #endif - default: - return false; - } - - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp deleted file mode 100644 index 2d1e0d6627..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/****************************** - * change_filament_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace ExtUI; -using namespace FTDI; -using namespace Theme; - -#define COOL_TEMP 40 -#define LOW_TEMP 180 -#define MED_TEMP 200 -#define HIGH_TEMP 220 - -/****************** COLOR SCALE ***********************/ - -uint32_t getWarmColor(uint16_t temp, uint16_t cool, uint16_t low, uint16_t med, uint16_t high) { - rgb_t R0, R1, mix; - - float t; - if (temp < cool) { - R0 = cool_rgb; - R1 = low_rgb; - t = 0; - } - else if (temp < low) { - R0 = cool_rgb; - R1 = low_rgb; - t = (float(temp)-cool)/(low-cool); - } - else if (temp < med) { - R0 = low_rgb; - R1 = med_rgb; - t = (float(temp)-low)/(med-low); - } - else if (temp < high) { - R0 = med_rgb; - R1 = high_rgb; - t = (float(temp)-med)/(high-med); - } - else if (temp >= high) { - R0 = med_rgb; - R1 = high_rgb; - t = 1; - } - rgb_t::lerp(t, R0, R1, mix); - return mix; -} - -void ChangeFilamentScreen::drawTempGradient(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { - CommandProcessor cmd; - cmd.cmd(SCISSOR_XY (x, y)) - .cmd(SCISSOR_SIZE (w, h/2)) - .gradient (x, y, high_rgb, x, y+h/2, med_rgb) - .cmd(SCISSOR_XY (x, y+h/2)) - .cmd(SCISSOR_SIZE (w, h/2)) - .gradient (x, y+h/2, med_rgb, x, y+h, low_rgb) - .cmd(SCISSOR_XY ()) - .cmd(SCISSOR_SIZE ()); -} - -void ChangeFilamentScreen::onEntry() { - screen_data.ChangeFilamentScreen.e_tag = ExtUI::getActiveTool() + 10; - screen_data.ChangeFilamentScreen.t_tag = 0; - screen_data.ChangeFilamentScreen.repeat_tag = 0; - screen_data.ChangeFilamentScreen.saved_extruder = getActiveTool(); - #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - screen_data.ChangeFilamentScreen.need_purge = true; - #endif -} - -void ChangeFilamentScreen::onExit() { - setActiveTool(screen_data.ChangeFilamentScreen.saved_extruder, true); -} - -void ChangeFilamentScreen::onRedraw(draw_mode_t what) { - CommandProcessor cmd; - - #ifdef TOUCH_UI_PORTRAIT - #define GRID_COLS 2 - #define GRID_ROWS 11 - #else - #define GRID_COLS 4 - #define GRID_ROWS 6 - #endif - - if (what & BACKGROUND) { - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0) - #ifdef TOUCH_UI_PORTRAIT - .font(font_large) - #else - .font(font_medium) - #endif - .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) - #ifdef TOUCH_UI_PORTRAIT - .text(BTN_POS(1,7), BTN_SIZE(1,1), F("")) - #else - .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) - .font(font_small) - #endif - .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_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 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 - .rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) - #else - .rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) - #endif - .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) - .font(font_medium) - #ifdef TOUCH_UI_PORTRAIT - .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) - #else - .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) - #endif - .colors(normal_btn); - - 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), GET_TEXT_F(MSG_HEATING)); - } else if (getActualTemp_celsius(e) > 100) { - cmd.cmd(COLOR_RGB(0xFF0000)) - .text(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CAUTION)) - .colors(normal_btn) - .text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_HOT)); - } - - #define TOG_STYLE(A) colors(A ? action_btn : normal_btn) - - const bool tog2 = screen_data.ChangeFilamentScreen.t_tag == 2; - const bool tog3 = screen_data.ChangeFilamentScreen.t_tag == 3; - const bool tog4 = screen_data.ChangeFilamentScreen.t_tag == 4; - const bool tog10 = screen_data.ChangeFilamentScreen.e_tag == 10; - #if HOTENDS > 1 - const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; - #endif - - #ifdef TOUCH_UI_PORTRAIT - cmd.font(font_large) - #else - cmd.font(font_medium) - #endif - .TOG_STYLE(tog10) - .tag(10) .button (BTN_POS(1,2), BTN_SIZE(1,1), F("1")) - #if HOTENDS < 2 - .enabled(false) - #else - .TOG_STYLE(tog11) - #endif - .tag(11) .button (BTN_POS(2,2), BTN_SIZE(1,1), F("2")); - - if (!t_ok) reset_menu_timeout(); - - const bool tog7 = screen_data.ChangeFilamentScreen.repeat_tag == 7; - const bool tog8 = screen_data.ChangeFilamentScreen.repeat_tag == 8; - - - cmd.font( - #ifdef TOUCH_UI_PORTRAIT - font_large - #else - font_small - #endif - ); - - { - char str[30]; - - format_temp_and_material(str, LOW_TEMP, GET_TEXT(MSG_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(MSG_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(MSG_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)) - .tag(2) .rectangle(BTN_POS(1,6), BTN_SIZE(1,1)) - .tag(3) .rectangle(BTN_POS(1,5), BTN_SIZE(1,1)) - .tag(4) .rectangle(BTN_POS(1,4), BTN_SIZE(1,1)) - .cmd(COLOR_MASK(1,1,1,1)) - - .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), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) - .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) - .tag(5) .enabled(t_ok).button (BTN_POS(1,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(6) .enabled(t_ok).button (BTN_POS(2,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(1,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(2,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(1).colors(action_btn) .button (BTN_POS(1,11), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #else - .font(font_small) - .tag(0) .text (BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) - .text (BTN_POS(4,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) - .tag(5) .enabled(t_ok).button (BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(6) .enabled(t_ok).button (BTN_POS(4,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(4,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .font(font_medium) - .tag(1).colors(action_btn) .button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #endif - } - #undef GRID_COLS - #undef GRID_ROWS -} - -uint8_t ChangeFilamentScreen::getSoftenTemp() { - switch (screen_data.ChangeFilamentScreen.t_tag) { - case 2: return LOW_TEMP; - case 3: return MED_TEMP; - case 4: return HIGH_TEMP; - default: return EXTRUDE_MINTEMP; - } -} - -ExtUI::extruder_t ChangeFilamentScreen::getExtruder() { - switch (screen_data.ChangeFilamentScreen.e_tag) { - case 13: return ExtUI::E3; - case 12: return ExtUI::E2; - case 11: return ExtUI::E1; - default: return ExtUI::E0; - } -} - -void ChangeFilamentScreen::doPurge() { - #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - constexpr float purge_distance_mm = FILAMENT_UNLOAD_PURGE_LENGTH; - if (screen_data.ChangeFilamentScreen.need_purge) { - screen_data.ChangeFilamentScreen.need_purge = false; - MoveAxisScreen::setManualFeedrate(getExtruder(), purge_distance_mm); - ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(getExtruder()) + purge_distance_mm, getExtruder()); - } - #endif -} - -bool ChangeFilamentScreen::onTouchStart(uint8_t tag) { - // Make the Momentary and Continuous buttons slightly more responsive - switch (tag) { - case 5: case 6: case 7: case 8: - #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - if (tag == 5 || tag == 7) doPurge(); - #endif - return ChangeFilamentScreen::onTouchHeld(tag); - default: - return false; - } -} - -bool ChangeFilamentScreen::onTouchEnd(uint8_t tag) { - using namespace ExtUI; - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - case 2: - case 3: - case 4: - // Change temperature - screen_data.ChangeFilamentScreen.t_tag = tag; - setTargetTemp_celsius(getSoftenTemp(), getExtruder()); - break; - case 7: - screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 7) ? 0 : 7; - break; - case 8: - screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 8) ? 0 : 8; - break; - case 10: - case 11: - // Change extruder - screen_data.ChangeFilamentScreen.e_tag = tag; - screen_data.ChangeFilamentScreen.t_tag = 0; - screen_data.ChangeFilamentScreen.repeat_tag = 0; - #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - screen_data.ChangeFilamentScreen.need_purge = true; - #endif - setActiveTool(getExtruder(), true); - break; - case 15: GOTO_SCREEN(TemperatureScreen); break; - } - return true; -} - -bool ChangeFilamentScreen::onTouchHeld(uint8_t tag) { - if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate - constexpr float increment = 1; - #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); - #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); - switch (tag) { - case 5: case 7: UI_DECREMENT_AXIS(getExtruder()); break; - case 6: case 8: UI_INCREMENT_AXIS(getExtruder()); break; - default: return false; - } - #undef UI_DECREMENT_AXIS - #undef UI_INCREMENT_AXIS - return false; -} - -void ChangeFilamentScreen::onIdle() { - reset_menu_timeout(); - if (screen_data.ChangeFilamentScreen.repeat_tag) onTouchHeld(screen_data.ChangeFilamentScreen.repeat_tag); - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp deleted file mode 100644 index 933894259e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/************************************** - * confirm_abort_print_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace ExtUI; - -void ConfirmAbortPrintDialogBox::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_ABORT_WARNING)); - drawYesNoButtons(); -} - -bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - GOTO_PREVIOUS(); - stopPrint(); - return true; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp deleted file mode 100644 index deae90fe93..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************* - * confirm_auto_calibration_dialog_box.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, CALIBRATION_GCODE) - -#include "screens.h" - -using namespace ExtUI; -using namespace Theme; - -void ConfirmAutoCalibrationDialogBox::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_CALIBRATION_WARNING)); - drawYesNoButtons(); -} - -bool ConfirmAutoCalibrationDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - GOTO_SCREEN(StatusScreen); - injectCommands_P(PSTR(CALIBRATION_COMMANDS)); - return true; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp deleted file mode 100644 index 1e16546003..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/************************************** - * confirm_erase_flash_dialog_box.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) - -#include "screens.h" - -#include "../archim2-flash/flash_storage.h" - -using namespace FTDI; - -void ConfirmEraseFlashDialogBox::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_ERASE_FLASH_WARNING)); - drawYesNoButtons(); -} - -bool ConfirmEraseFlashDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - SpinnerDialogBox::show(GET_TEXT_F(MSG_ERASING)); - UIFlashStorage::format_flash(); - SpinnerDialogBox::hide(); - AlertDialogBox::show(GET_TEXT_F(MSG_ERASED)); - // Remove ConfirmEraseFlashDialogBox from the stack - // so the alert box doesn't return to me. - current_screen.forget(); - return true; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp deleted file mode 100644 index 5c691cb9a1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************************** - * confirm_start_print_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void ConfirmStartPrintDialogBox::onEntry() { - BaseScreen::onEntry(); - sound.play(twinkle, PLAY_ASYNCHRONOUS); -} - -void ConfirmStartPrintDialogBox::onRedraw(draw_mode_t) { - const char *filename = getLongFilename(); - char buffer[strlen_P(GET_TEXT(MSG_START_PRINT_CONFIRMATION)) + strlen(filename) + 1]; - sprintf_P(buffer, GET_TEXT(MSG_START_PRINT_CONFIRMATION), filename); - drawMessage((const char *)buffer); - drawYesNoButtons(1); -} - -bool ConfirmStartPrintDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - printFile(getShortFilename()); - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PRINT_STARTING)); - GOTO_SCREEN(StatusScreen); - return true; - case 2: GOTO_PREVIOUS(); return true; - default: return false; - } -} - -const char *ConfirmStartPrintDialogBox::getFilename(bool longName) { - FileList files; - files.seek(screen_data.ConfirmStartPrintDialogBox.file_index, true); - return longName ? files.longFilename() : files.shortFilename(); -} - -void ConfirmStartPrintDialogBox::show(uint8_t file_index) { - screen_data.ConfirmStartPrintDialogBox.file_index = file_index; - GOTO_SCREEN(ConfirmStartPrintDialogBox); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp deleted file mode 100644 index cc132064ec..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/************************************** - * confirm_user_request_alert_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; - -void ConfirmUserRequestAlertBox::onRedraw(draw_mode_t mode) { - AlertDialogBox::onRedraw(mode); // Required for the GOTO_SCREEN function to work -} - -bool ConfirmUserRequestAlertBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - ExtUI::setUserConfirmed(); - GOTO_PREVIOUS(); - return true; - case 2: GOTO_PREVIOUS(); return true; - default: return false; - } -} - -void ConfirmUserRequestAlertBox::show(const char* msg) { - drawMessage(msg); - storeBackground(); - screen_data.AlertDialogBox.isError = false; - GOTO_SCREEN(ConfirmUserRequestAlertBox); -} - -void ConfirmUserRequestAlertBox::hide() { - if (AT_SCREEN(ConfirmUserRequestAlertBox)) - GOTO_PREVIOUS(); -} -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp deleted file mode 100644 index 21be095f96..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*********************************** - * default_acceleration_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void DefaultAccelerationScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0); - w.units(GET_TEXT_F(MSG_UNITS_MM_S2)); - w.heading( GET_TEXT_F(MSG_ACCELERATION)); - w.color(other); - w.adjuster( 2, GET_TEXT_F(MSG_ACCEL_PRINTING), getPrintingAcceleration_mm_s2() ); - w.adjuster( 4, GET_TEXT_F(MSG_ACCEL_TRAVEL), getTravelAcceleration_mm_s2() ); - w.adjuster( 6, GET_TEXT_F(MSG_ACCEL_RETRACT), getRetractAcceleration_mm_s2() ); - w.increments(); - w.button( 8, GET_TEXT_F(MSG_SET_MAXIMUM)); -} - -bool DefaultAccelerationScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(PrintingAcceleration_mm_s2); break; - case 3: UI_INCREMENT(PrintingAcceleration_mm_s2); break; - case 4: UI_DECREMENT(TravelAcceleration_mm_s2); break; - case 5: UI_INCREMENT(TravelAcceleration_mm_s2); break; - case 6: UI_DECREMENT(RetractAcceleration_mm_s2); break; - case 7: UI_INCREMENT(RetractAcceleration_mm_s2); break; - case 8: GOTO_SCREEN(MaxAccelerationScreen); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp deleted file mode 100644 index b3b674ebd3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/********************** - * developer_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" - -#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) - -#include "screens.h" - -#include "../archim2-flash/flash_storage.h" - -using namespace FTDI; -using namespace Theme; - -void DeveloperMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .font(font_medium) - .tag(0); - - #ifdef SPI_FLASH_SS - constexpr bool has_flash = true; - #else - constexpr bool has_flash = false; - #endif - - #if ENABLED(SDSUPPORT) - constexpr bool has_media = true; - #else - constexpr bool has_media = false; - #endif - - cmd.cmd(COLOR_RGB(bg_text_enabled)); - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 10 - #define GRID_COLS 1 - cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) - .colors(normal_btn) - .tag(2).font(font_medium) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) - .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Stress Test")) - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Touch Registers")) - .tag(5) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) - .tag(6).enabled(has_media).button( BTN_POS(1,6), BTN_SIZE(1,1), F("Play Video from Media")) - .tag(7).enabled(has_flash).button( BTN_POS(1,7), BTN_SIZE(1,1), F("Play Video from SPI Flash")) - .tag(8).enabled(has_flash).button( BTN_POS(1,8), BTN_SIZE(1,1), F("Load Video to SPI Flash")) - .tag(9).enabled(has_flash).button( BTN_POS(1,9), BTN_SIZE(1,1), F("Erase SPI Flash")) - - .tag(1).colors(action_btn) - .button( BTN_POS(1,10), BTN_SIZE(1,1), F("Back")); - #else - #define GRID_ROWS 6 - #define GRID_COLS 2 - cmd.font(font_medium) .text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Developer Menu")) - .colors(normal_btn) - .tag(2).font(font_small) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) - .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Show Touch Registers")) - .tag(9) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Pin States")) - .tag(4) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) - .tag(5).enabled(has_media).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Play Video from Media")) - .tag(6).enabled(has_flash).button( BTN_POS(2,3), BTN_SIZE(1,1), F("Play Video from SPI Flash")) - .tag(7).enabled(has_flash).button( BTN_POS(2,4), BTN_SIZE(1,1), F("Load Video to SPI Flash")) - .tag(8).enabled(has_flash).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Erase SPI Flash")) - .tag(1).colors(action_btn) - .button( BTN_POS(1,6), BTN_SIZE(2,1), F("Back")); - #endif - } -} - -bool DeveloperMenu::onTouchEnd(uint8_t tag) { - using namespace Theme; - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - case 2: GOTO_SCREEN(WidgetsScreen); break; - case 3: - PUSH_SCREEN(StressTestScreen); - AlertDialogBox::show(F("Please do not run this test unattended as it may cause your printer to malfunction.")); - current_screen.forget(); - break; - case 4: GOTO_SCREEN(TouchRegistersScreen); break; - case 5: sound.play(js_bach_joy, PLAY_ASYNCHRONOUS); break; - #if ENABLED(SDSUPPORT) - case 6: - if (!MediaPlayerScreen::playCardMedia()) - AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); - break; - #endif - #ifdef SPI_FLASH_SS - case 7: - if (!MediaPlayerScreen::playBootMedia()) - AlertDialogBox::showError(F("No boot media available")); - break; - case 8: - { - SpinnerDialogBox::show(F("Saving...")); - UIFlashStorage::error_t res = UIFlashStorage::write_media_file(F("STARTUP.AVI")); - SpinnerDialogBox::hide(); - reset_menu_timeout(); - switch (res) { - case UIFlashStorage::SUCCESS: - AlertDialogBox::show(F("File copied!")); - break; - - case UIFlashStorage::READ_ERROR: - AlertDialogBox::showError(F("Failed to read file")); - break; - - case UIFlashStorage::VERIFY_ERROR: - AlertDialogBox::showError(F("Failed to verify file")); - break; - - case UIFlashStorage::FILE_NOT_FOUND: - AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); - break; - - case UIFlashStorage::WOULD_OVERWRITE: - AlertDialogBox::showError(F("Cannot overwrite existing media.")); - break; - } - break; - } - case 9: GOTO_SCREEN(ConfirmEraseFlashDialogBox); break; - #endif - case 10: GOTO_SCREEN(EndstopStatesScreen); break; - default: return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp deleted file mode 100644 index 7f3a27e9e8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/***************************** - * dialog_box_base_class.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -#define GRID_COLS 2 -#define GRID_ROWS 8 - -template -void DialogBoxBaseClass::drawMessage(const T message, int16_t font) { - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,3), message, OPT_CENTER, font ? font : font_large); - cmd.colors(normal_btn); -} - -template void DialogBoxBaseClass::drawMessage(const char *, 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), GET_TEXT_F(MSG_YES)) - .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button( BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_NO)); -} - -void DialogBoxBaseClass::drawOkayButton() { - CommandProcessor cmd; - cmd.font(font_medium) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY)); -} - -void DialogBoxBaseClass::drawButton(const progmem_str label) { - CommandProcessor cmd; - cmd.font(font_medium) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), label); -} - -void DialogBoxBaseClass::drawSpinner() { - CommandProcessor cmd; - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .spinner(BTN_POS(1,4), BTN_SIZE(2,3)).execute(); -} - -bool DialogBoxBaseClass::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; - case 2: GOTO_PREVIOUS(); return true; - default: return false; - } -} - -void DialogBoxBaseClass::onIdle() { - reset_menu_timeout(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp deleted file mode 100644 index b449634b1a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/***************************** - * display_tuning_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void DisplayTuningScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); - w.units(F("")); - w.heading(GET_TEXT_F(MSG_DISPLAY_MENU)); - w.color(other); - w.adjuster( 2, GET_TEXT_F(MSG_H_OFFSET), CLCD::mem_read_16(CLCD::REG::HOFFSET) ); - w.adjuster( 4, GET_TEXT_F(MSG_V_OFFSET), CLCD::mem_read_16(CLCD::REG::VOFFSET) ); - w.increments(); - w.heading( GET_TEXT_F(MSG_TOUCH_SCREEN)); - w.button(6, GET_TEXT_F(MSG_CALIBRATE)); -} - -bool DisplayTuningScreen::onTouchHeld(uint8_t tag) { - #define REG_INCREMENT(a,i) CLCD::mem_write_16(CLCD::REG::a, CLCD::mem_read_16(CLCD::REG::a) + i) - const float increment = getIncrement(); - switch (tag) { - case 2: REG_INCREMENT(HOFFSET, -increment); break; - case 3: REG_INCREMENT(HOFFSET, increment); break; - case 4: REG_INCREMENT(VOFFSET, -increment); break; - case 5: REG_INCREMENT(VOFFSET, increment); break; - case 6: GOTO_SCREEN(TouchCalibrationScreen); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp deleted file mode 100644 index 9901bbf45b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************** - * endstop_state_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void EndstopStatesScreen::onEntry() { - BaseScreen::onEntry(); -} - -void EndstopStatesScreen::onExit() { - BaseScreen::onExit(); -} - -void EndstopStatesScreen::onRedraw(draw_mode_t) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(COLOR_RGB(bg_text_enabled)) - .cmd(CLEAR(true,true,true)) - .tag(0); - - #define GRID_ROWS 7 - #define GRID_COLS 6 - - #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) - #define PIN_ENABLED(X,Y,LABEL,PIN,INV) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); - #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); - - cmd.font( - #ifdef TOUCH_UI_PORTRAIT - font_large - #else - font_medium - #endif - ) - .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .font(font_tiny); - #if PIN_EXISTS(X_MAX) - PIN_ENABLED (1, 2, PSTR(MSG_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING) - #else - PIN_DISABLED(1, 2, PSTR(MSG_X_MAX), X_MAX) - #endif - #if PIN_EXISTS(Y_MAX) - PIN_ENABLED (3, 2, PSTR(MSG_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING) - #else - PIN_DISABLED(3, 2, PSTR(MSG_Y_MAX), Y_MAX) - #endif - #if PIN_EXISTS(Z_MAX) - PIN_ENABLED (5, 2, PSTR(MSG_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING) - #else - PIN_DISABLED(5, 2, PSTR(MSG_Z_MAX), Z_MAX) - #endif - #if PIN_EXISTS(X_MIN) - PIN_ENABLED (1, 3, PSTR(MSG_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING) - #else - PIN_DISABLED(1, 3, PSTR(MSG_X_MIN), X_MIN) - #endif - #if PIN_EXISTS(Y_MIN) - PIN_ENABLED (3, 3, PSTR(MSG_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING) - #else - PIN_DISABLED(3, 3, PSTR(MSG_Y_MIN), Y_MIN) - #endif - #if PIN_EXISTS(Z_MIN) - PIN_ENABLED (5, 3, PSTR(MSG_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING) - #else - PIN_DISABLED(5, 3, PSTR(MSG_Z_MIN), Z_MIN) - #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) - PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_INVERTING) - #else - PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) - #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) - PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_INVERTING) - #else - PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) - #endif - #if PIN_EXISTS(Z_MIN_PROBE) - PIN_ENABLED (5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE, Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - PIN_DISABLED(5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE) - #endif - - #if HAS_SOFTWARE_ENDSTOPS - #undef EDGE_R - #define EDGE_R 30 - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .font(font_small) - .text (BTN_POS(1,5), BTN_SIZE(3,1), GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS), OPT_RIGHTX | OPT_CENTERY) - .colors(ui_toggle) - .tag(2).toggle2(BTN_POS(4,5), BTN_SIZE(3,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_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), GET_TEXT_F(MSG_BACK)); - #undef GRID_COLS - #undef GRID_ROWS -} - -bool EndstopStatesScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - #if HAS_SOFTWARE_ENDSTOPS - case 2: setSoftEndstopState(!getSoftEndstopState()); - #endif - default: - return false; - } - return true; -} - -void EndstopStatesScreen::onIdle() { - constexpr uint32_t DIAGNOSTICS_UPDATE_INTERVAL = 100; - - if (refresh_timer.elapsed(DIAGNOSTICS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - reset_menu_timeout(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp deleted file mode 100644 index bd8e648e11..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/******************************* - * feedrate_percent_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; - -void FeedratePercentScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)); - - w.heading(GET_TEXT_F(MSG_PRINT_SPEED)); - w.adjuster(4, GET_TEXT_F(MSG_SPEED), getFeedrate_percent()); - w.increments(); -} - -bool FeedratePercentScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 4: UI_DECREMENT(Feedrate_percent); break; - case 5: UI_INCREMENT(Feedrate_percent); break; - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp deleted file mode 100644 index 3972a14ef9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/********************* - * filament_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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void FilamentMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.font(font_large) - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 9 - #define GRID_COLS 2 - .text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT)) - .font(font_medium).colors(normal_btn) - .enabled( - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_RUNOUT_SENSOR)) - .enabled( - #if ENABLED(LIN_ADVANCE) - 1 - #endif - ) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .colors(action_btn) - .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_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), GET_TEXT_F(MSG_FILAMENT)) - .font(font_medium).colors(normal_btn) - .enabled( - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(3,1), GET_TEXT_F(MSG_RUNOUT_SENSOR)) - .enabled( - #if ENABLED(LIN_ADVANCE) - 1 - #endif - ) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(3,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .colors(action_btn) - .tag(1) .button( BTN_POS(1,6), BTN_SIZE(3,1), GET_TEXT_F(MSG_BACK)); - #endif - } -} - -bool FilamentMenu::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - case 2: GOTO_SCREEN(FilamentRunoutScreen); break; - #endif - #if ENABLED(LIN_ADVANCE) - case 3: GOTO_SCREEN(LinearAdvanceScreen); break; - #endif - default: return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp deleted file mode 100644 index 9830123abb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************** - * filament_runout_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, FILAMENT_RUNOUT_SENSOR) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void FilamentRunoutScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.heading( GET_TEXT_F(MSG_FILAMENT)); - w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled()); - - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - extern const char NUL_STR[]; - w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM)); - w.units(GET_TEXT_F(MSG_UNITS_MM)); - w.precision(0); - w.color(e_axis); - w.adjuster( 10, progmem_str(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled()); - w.increments(); - #endif -} - -bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { - using namespace ExtUI; - const float increment = getIncrement(); - switch (tag) { - case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break; - case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break; - #endif - default: - return false; - } - - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp deleted file mode 100644 index d32ec4d07f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/******************** - * files_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void FilesScreen::onEntry() { - screen_data.FilesScreen.cur_page = 0; - screen_data.FilesScreen.selected_tag = 0xFF; - #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) - CLCD::mem_write_32(CLCD::REG::MACRO_0,DL::NOP); - #endif - gotoPage(0); - BaseScreen::onEntry(); -} - -const char *FilesScreen::getSelectedFilename(bool longName) { - FileList files; - files.seek(getSelectedFileIndex(), true); - return longName ? files.longFilename() : files.shortFilename(); -} - -void FilesScreen::drawSelectedFile() { - FileList files; - files.seek(getSelectedFileIndex(), true); - screen_data.FilesScreen.flags.is_dir = files.isDir(); - drawFileButton( - files.filename(), - screen_data.FilesScreen.selected_tag, - screen_data.FilesScreen.flags.is_dir, - true - ); -} - -uint16_t FilesScreen::getSelectedFileIndex() { - return getFileForTag(screen_data.FilesScreen.selected_tag); -} - -uint16_t FilesScreen::getFileForTag(uint8_t tag) { - return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; -} - -#ifdef TOUCH_UI_PORTRAIT - #define GRID_COLS 6 - #define GRID_ROWS (files_per_page + header_h + footer_h) -#else - #define GRID_COLS 6 - #define GRID_ROWS (files_per_page + header_h + footer_h) -#endif - -void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted) { - const uint8_t line = getLineForTag(tag)+1; - CommandProcessor cmd; - cmd.tag(tag); - cmd.cmd(COLOR_RGB(is_highlighted ? fg_action : bg_color)); - cmd.font(font_medium) - .rectangle( 0, BTN_Y(header_h+line), display_width, BTN_H(1)); - cmd.cmd(COLOR_RGB(is_highlighted ? normal_btn.rgb : bg_text_enabled)); - #if ENABLED(SCROLL_LONG_FILENAMES) - if (is_highlighted) { - cmd.cmd(SAVE_CONTEXT()); - cmd.cmd(MACRO(0)); - } - #endif - 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); - } - #if ENABLED(SCROLL_LONG_FILENAMES) - if (is_highlighted) { - cmd.cmd(RESTORE_CONTEXT()); - } - #endif -} - -void FilesScreen::drawFileList() { - FileList files; - screen_data.FilesScreen.num_page = max(1,(ceil)(float(files.count()) / files_per_page)); - screen_data.FilesScreen.cur_page = min(screen_data.FilesScreen.cur_page, screen_data.FilesScreen.num_page-1); - screen_data.FilesScreen.flags.is_root = files.isAtRootDir(); - - #undef MARGIN_T - #undef MARGIN_B - #define MARGIN_T 0 - #define MARGIN_B 0 - uint16_t fileIndex = screen_data.FilesScreen.cur_page * files_per_page; - for(uint8_t i = 0; i < files_per_page; i++, fileIndex++) { - if (files.seek(fileIndex)) { - drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false); - } else { - break; - } - } -} - -void FilesScreen::drawHeader() { - const bool prev_enabled = screen_data.FilesScreen.cur_page > 0; - const bool next_enabled = screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page - 1); - - #undef MARGIN_T - #undef MARGIN_B - #define MARGIN_T 0 - #define MARGIN_B 2 - - char str[16]; - sprintf_P(str, PSTR("Page %d of %d"), - screen_data.FilesScreen.cur_page + 1, screen_data.FilesScreen.num_page); - - - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(font_small) - .tag(0).button( BTN_POS(2,1), BTN_SIZE(4,header_h), str, OPT_CENTER | OPT_FLAT) - .font(font_medium) - .colors(action_btn) - .tag(241).enabled(prev_enabled).button( BTN_POS(1,1), BTN_SIZE(1,header_h), F("<")) - .tag(242).enabled(next_enabled).button( BTN_POS(6,1), BTN_SIZE(1,header_h), F(">")); -} - -void FilesScreen::drawFooter() { - #undef MARGIN_T - #undef MARGIN_B - #ifdef TOUCH_UI_PORTRAIT - #define MARGIN_T 15 - #define MARGIN_B 5 - #else - #define MARGIN_T 5 - #define MARGIN_B 5 - #endif - const bool has_selection = screen_data.FilesScreen.selected_tag != 0xFF; - const uint8_t back_tag = screen_data.FilesScreen.flags.is_root ? 240 : 245; - const uint8_t y = GRID_ROWS - footer_h + 1; - const uint8_t h = footer_h; - - CommandProcessor cmd; - 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), GET_TEXT_F(MSG_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), GET_TEXT_F(MSG_BUTTON_OPEN)); - } else { - cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT)); - } -} - -void FilesScreen::onRedraw(draw_mode_t what) { - if (what & FOREGROUND) { - drawHeader(); - drawSelectedFile(); - drawFooter(); - } -} - -void FilesScreen::gotoPage(uint8_t page) { - screen_data.FilesScreen.selected_tag = 0xFF; - screen_data.FilesScreen.cur_page = page; - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .colors(normal_btn); - drawFileList(); - storeBackground(); -} - -bool FilesScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 240: GOTO_PREVIOUS(); return true; - case 241: - if (screen_data.FilesScreen.cur_page > 0) { - gotoPage(screen_data.FilesScreen.cur_page-1); - } - break; - case 242: - if (screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page-1)) { - gotoPage(screen_data.FilesScreen.cur_page+1); - } - break; - case 243: - ConfirmStartPrintDialogBox::show(getSelectedFileIndex()); - return true; - case 244: - { - FileList files; - files.changeDir(getSelectedShortFilename()); - gotoPage(0); - } - break; - case 245: - { - FileList files; - files.upDir(); - gotoPage(0); - } - break; - default: - if (tag < 240) { - screen_data.FilesScreen.selected_tag = tag; - #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) - if (FTDI::ftdi_chip >= 810) { - const char *longFilename = getSelectedLongFilename(); - if (longFilename[0]) { - 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; - else - screen_data.FilesScreen.scroll_max = 0; - } - } - #endif - } - break; - } - return true; -} - -void FilesScreen::onIdle() { - #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) - if (FTDI::ftdi_chip >= 810) { - CLCD::mem_write_32(CLCD::REG::MACRO_0, - VERTEX_TRANSLATE_X(-int32_t(screen_data.FilesScreen.scroll_pos))); - if (screen_data.FilesScreen.scroll_pos < screen_data.FilesScreen.scroll_max * 16) - screen_data.FilesScreen.scroll_pos++; - } - #endif -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp deleted file mode 100644 index 61875c52f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/********************************* - * interface_settings_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -#include "../archim2-flash/flash_storage.h" - -#include "../../../../../module/configuration_store.h" - -#if ENABLED(LULZBOT_PRINTCOUNTER) - #include "../../../../../module/printcounter.h" -#endif - -bool restoreEEPROM(); - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -constexpr bool PERSISTENT_STORE_SUCCESS = false; // persistentStore uses true for error - -void InterfaceSettingsScreen::onStartup() { -} - -void InterfaceSettingsScreen::onEntry() { - screen_data.InterfaceSettingsScreen.brightness = CLCD::get_brightness(); - screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); - BaseScreen::onEntry(); -} - -void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { - CommandProcessor cmd; - - if (what & BACKGROUND) { - - #define GRID_COLS 4 - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 7 - #else - #define GRID_ROWS 6 - #endif - - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0) - .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - #undef EDGE_R - #define EDGE_R 30 - .font(font_small) - .tag(0) - .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_SCREEN_LOCK), OPT_RIGHTX | OPT_CENTERY); - cmd.text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BOOT_SCREEN), OPT_RIGHTX | OPT_CENTERY); - #undef EDGE_R - } - - if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT - constexpr uint8_t w = 2; - #else - constexpr uint8_t w = 1; - #endif - - cmd.font(font_medium) - #define EDGE_R 30 - .colors(ui_slider) - .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).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), LockScreen::is_enabled()) - .tag(5).toggle2(BTN_POS(3,5), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_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), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) - .colors(action_btn) - .tag(1).button (BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK)); - #else - .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) - .colors(action_btn) - .tag(1).button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #endif - } -} - -bool InterfaceSettingsScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; - case 4: - if (!LockScreen::is_enabled()) - LockScreen::enable(); - else - LockScreen::disable(); - break; - case 5: UIData::enable_animations(!UIData::animations_enabled());; break; - case 6: GOTO_SCREEN(InterfaceSoundsScreen); return true; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -bool InterfaceSettingsScreen::onTouchStart(uint8_t tag) { - #undef EDGE_R - #define EDGE_R 30 - CommandProcessor cmd; - switch (tag) { - case 2: cmd.track_linear(BTN_POS(3,3), BTN_SIZE(2,1), 2).execute(); break; - case 3: cmd.track_linear(BTN_POS(3,4), BTN_SIZE(2,1), 3).execute(); break; - default: break; - } - #undef EDGE_R - #define EDGE_R 0 - #undef GRID_COLS - #undef GRID_ROWS - return true; -} - -void InterfaceSettingsScreen::onIdle() { - if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { - refresh_timer.start(); - - uint16_t value; - CommandProcessor cmd; - switch (cmd.track_tag(value)) { - case 2: - screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF; - CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness); - SaveSettingsDialogBox::settingsChanged(); - break; - case 3: - screen_data.InterfaceSettingsScreen.volume = value >> 8; - SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); - SaveSettingsDialogBox::settingsChanged(); - break; - default: - return; - } - onRefresh(); - } - BaseScreen::onIdle(); -} - -void InterfaceSettingsScreen::failSafeSettings() { - // Reset settings that may make the printer interface - // unusable. - CLCD::mem_write_32(CLCD::REG::ROTATE, 0); - CLCD::default_touch_transform(); - CLCD::default_display_orientation(); - CLCD::set_brightness(255); - UIData::reset_persistent_data(); - CLCD::mem_write_16(CLCD::REG::HOFFSET, FTDI::Hoffset); - CLCD::mem_write_16(CLCD::REG::VOFFSET, FTDI::Voffset); -} - -void InterfaceSettingsScreen::defaultSettings() { - LockScreen::passcode = 0; - SoundPlayer::set_volume(255); - CLCD::set_brightness(255); - UIData::reset_persistent_data(); - InterfaceSoundsScreen::defaultSettings(); - CLCD::mem_write_16(CLCD::REG::HOFFSET, FTDI::Hoffset); - CLCD::mem_write_16(CLCD::REG::VOFFSET, FTDI::Voffset); -} - -void InterfaceSettingsScreen::saveSettings(char *buff) { - static_assert( - ExtUI::eeprom_data_size >= sizeof(persistent_data_t), - "Insufficient space in EEPROM for UI parameters" - ); - - SERIAL_ECHOLNPGM("Writing setting to EEPROM"); - - persistent_data_t eeprom; - - eeprom.passcode = LockScreen::passcode; - eeprom.sound_volume = SoundPlayer::get_volume(); - eeprom.display_brightness = CLCD::get_brightness(); - eeprom.bit_flags = UIData::get_persistent_data(); - eeprom.touch_transform_a = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_A); - eeprom.touch_transform_b = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_B); - eeprom.touch_transform_c = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_C); - eeprom.touch_transform_d = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_D); - eeprom.touch_transform_e = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_E); - eeprom.touch_transform_f = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_F); - eeprom.display_h_offset_adj = CLCD::mem_read_16(CLCD::REG::HOFFSET) - FTDI::Hoffset; - eeprom.display_v_offset_adj = CLCD::mem_read_16(CLCD::REG::VOFFSET) - FTDI::Voffset; - for(uint8_t i = 0; i < InterfaceSoundsScreen::NUM_EVENTS; i++) - eeprom.event_sounds[i] = InterfaceSoundsScreen::event_sounds[i]; - - memcpy(buff, &eeprom, sizeof(eeprom)); -} - -void InterfaceSettingsScreen::loadSettings(const char *buff) { - static_assert( - ExtUI::eeprom_data_size >= sizeof(persistent_data_t), - "Insufficient space in EEPROM for UI parameters" - ); - - persistent_data_t eeprom; - memcpy(&eeprom, buff, sizeof(eeprom)); - - SERIAL_ECHOLNPGM("Loading setting from EEPROM"); - - LockScreen::passcode = eeprom.passcode; - SoundPlayer::set_volume(eeprom.sound_volume); - UIData::set_persistent_data(eeprom.bit_flags); - CLCD::set_brightness(eeprom.display_brightness); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_A, eeprom.touch_transform_a); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_B, eeprom.touch_transform_b); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_C, eeprom.touch_transform_c); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_D, eeprom.touch_transform_d); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_E, eeprom.touch_transform_e); - CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_F, eeprom.touch_transform_f); - CLCD::mem_write_16(CLCD::REG::HOFFSET, eeprom.display_h_offset_adj + FTDI::Hoffset); - CLCD::mem_write_16(CLCD::REG::VOFFSET, eeprom.display_v_offset_adj + FTDI::Voffset); - for(uint8_t i = 0; i < InterfaceSoundsScreen::NUM_EVENTS; i++) - InterfaceSoundsScreen::event_sounds[i] = eeprom.event_sounds[i]; - - #if ENABLED(TOUCH_UI_DEVELOPER_MENU) - StressTestScreen::startupCheck(); - #endif -} - -#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - #include "../../../../../HAL/shared/persistent_store_api.h" - - bool restoreEEPROM() { - uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE]; - - bool success = UIFlashStorage::read_config_data(data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE); - - if (success) - success = persistentStore.write_data(0, data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE) == PERSISTENT_STORE_SUCCESS; - - if (success) - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_EEPROM_RESTORED)); - else - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_EEPROM_RESET)); - - return success; - } - - bool InterfaceSettingsScreen::backupEEPROM() { - uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE]; - - if (persistentStore.read_data(0, data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE) != PERSISTENT_STORE_SUCCESS) - return false; - - UIFlashStorage::write_config_data(data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE); - - return true; - } -#endif - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp deleted file mode 100644 index 57f520e8ab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/******************************* - * interface_sounds_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -uint8_t InterfaceSoundsScreen::event_sounds[]; - -const char* InterfaceSoundsScreen::getSoundSelection(event_t event) { - return SoundList::name(event_sounds[event]); -} - -void InterfaceSoundsScreen::toggleSoundSelection(event_t event) { - event_sounds[event] = (event_sounds[event]+1) % SoundList::n; - playEventSound(event); -} - -void InterfaceSoundsScreen::setSoundSelection(event_t event, const SoundPlayer::sound_t* sound) { - for(uint8_t i = 0; i < SoundList::n; i++) - if (SoundList::data(i) == sound) - event_sounds[event] = i; -} - -void InterfaceSoundsScreen::playEventSound(event_t event, play_mode_t mode) { - sound.play(SoundList::data(event_sounds[event]), mode); -} - -void InterfaceSoundsScreen::defaultSettings() { - setSoundSelection(PRINTING_STARTED, twinkle); - setSoundSelection(PRINTING_FINISHED, fanfare); - setSoundSelection(PRINTING_FAILED, sad_trombone); -} - -void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { - CommandProcessor cmd; - - if (what & BACKGROUND) { - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0) - - #define GRID_COLS 4 - #define GRID_ROWS 9 - - .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) - #undef EDGE_R - #define EDGE_R 30 - .font(font_small) - .tag(0).text (BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_CLICK_SOUNDS), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_STARTING), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_FINISHED), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_ERROR), OPT_RIGHTX | OPT_CENTERY); - #undef EDGE_R - } - - if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT - constexpr uint8_t w = 2; - #else - constexpr uint8_t w = 1; - #endif - - cmd.font(font_medium) - .colors(ui_slider) - #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).toggle2 (BTN_POS(3,3), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), UIData::touch_sounds_enabled()) - #undef EDGE_R - .colors(normal_btn) - #define EDGE_R 0 - .tag(4).button (BTN_POS(3,5), BTN_SIZE(2,1), getSoundSelection(PRINTING_STARTED)) - .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), GET_TEXT_F(MSG_BACK)); - } -} - -void InterfaceSoundsScreen::onEntry() { - screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); - BaseScreen::onEntry(); -} - -bool InterfaceSoundsScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; - case 3: UIData::enable_touch_sounds(!UIData::touch_sounds_enabled()); break; - case 4: toggleSoundSelection(PRINTING_STARTED); break; - case 5: toggleSoundSelection(PRINTING_FINISHED); break; - case 6: toggleSoundSelection(PRINTING_FAILED); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -bool InterfaceSoundsScreen::onTouchStart(uint8_t tag) { - CommandProcessor cmd; - #undef EDGE_R - #define EDGE_R 30 - switch (tag) { - case 2: cmd.track_linear(BTN_POS(3,2), BTN_SIZE(2,1), 2).execute(); break; - default: break; - } - return true; -} - -void InterfaceSoundsScreen::onIdle() { - if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { - refresh_timer.start(); - - uint16_t value; - CommandProcessor cmd; - switch (cmd.track_tag(value)) { - case 2: - screen_data.InterfaceSettingsScreen.volume = value >> 8; - SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); - SaveSettingsDialogBox::settingsChanged(); - break; - default: - return; - } - onRefresh(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp deleted file mode 100644 index c208014cc7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/******************* - * jerk_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, CLASSIC_JERK) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void JerkScreen::onRedraw(draw_mode_t what) { - - widgets_t w(what); - w.precision(1); - w.units(GET_TEXT_F(MSG_UNITS_MM_S)); - w.heading(GET_TEXT_F(MSG_JERK)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisMaxJerk_mm_s(X) ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisMaxJerk_mm_s(Y) ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisMaxJerk_mm_s(Z) ); - w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisMaxJerk_mm_s(E0) ); - w.increments(); -} - -bool JerkScreen::onTouchHeld(uint8_t tag) { - using namespace ExtUI; - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisMaxJerk_mm_s, X); break; - case 3: UI_INCREMENT(AxisMaxJerk_mm_s, X); break; - case 4: UI_DECREMENT(AxisMaxJerk_mm_s, Y); break; - case 5: UI_INCREMENT(AxisMaxJerk_mm_s, Y); break; - case 6: UI_DECREMENT(AxisMaxJerk_mm_s, Z); break; - case 7: UI_INCREMENT(AxisMaxJerk_mm_s, Z); break; - case 8: UI_DECREMENT(AxisMaxJerk_mm_s, E0); break; - case 9: UI_INCREMENT(AxisMaxJerk_mm_s, E0); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE && CLASSIC_JERK diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp deleted file mode 100644 index 034ac15c42..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/******************* - * boot_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(CLASSIC_JERK) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void JunctionDeviationScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2); - w.units(GET_TEXT_F(MSG_UNITS_MM)); - w.heading(GET_TEXT_F(MSG_JUNCTION_DEVIATION)); - w.color(other) .adjuster( 2, F(""), getJunctionDeviation_mm() ); - w.increments(); -} - -bool JunctionDeviationScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(JunctionDeviation_mm); break; - case 3: UI_INCREMENT(JunctionDeviation_mm); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE && !CLASSIC_JERK diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp deleted file mode 100644 index 9c27ae6af5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/******************* - * kill_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; - -// The kill screen is an oddball that happens after Marlin has killed the events -// loop. So we only have a show() method rather than onRedraw(). The KillScreen -// should not be used as a model for other UI screens as it is an exception. - -void KillScreen::show(const char *message) { - CommandProcessor cmd; - - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); - - #define GRID_COLS 4 - #define GRID_ROWS 8 - - 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), GET_TEXT_F(MSG_HALTED)) - .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_PLEASE_RESET)); - - #undef GRID_COLS - #undef GRID_ROWS - - cmd.cmd(DL::DL_DISPLAY) - .cmd(CMD_SWAP) - .execute(); - - InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, PLAY_SYNCHRONOUS); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp deleted file mode 100644 index 8906a14cf0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/********************* - * 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(TOUCH_UI_FTDI_EVE) && 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 // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp deleted file mode 100644 index 0e35b45475..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/***************************** - * linear_advance_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, LIN_ADVANCE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void LinearAdvanceScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2, DEFAULT_LOWEST).color(e_axis); - w.heading( GET_TEXT_F(MSG_LINEAR_ADVANCE)); - #if EXTRUDERS == 1 - w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K), getLinearAdvance_mm_mm_s(E0) ); - #else - w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K1), getLinearAdvance_mm_mm_s(E0) ); - w.adjuster( 4, GET_TEXT_F(MSG_LINEAR_ADVANCE_K2), getLinearAdvance_mm_mm_s(E1) ); - #if EXTRUDERS > 2 - w.adjuster( 6, GET_TEXT_F(MSG_LINEAR_ADVANCE_K3), getLinearAdvance_mm_mm_s(E2) ); - #if EXTRUDERS > 3 - w.adjuster( 8, GET_TEXT_F(MSG_LINEAR_ADVANCE_K4), getLinearAdvance_mm_mm_s(E3) ); - #endif - #endif - #endif - w.increments(); -} - -bool LinearAdvanceScreen::onTouchHeld(uint8_t tag) { - using namespace ExtUI; - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(LinearAdvance_mm_mm_s, E0); break; - case 3: UI_INCREMENT(LinearAdvance_mm_mm_s, E0); break; - #if EXTRUDERS > 1 - case 4: UI_DECREMENT(LinearAdvance_mm_mm_s, E1); break; - case 5: UI_INCREMENT(LinearAdvance_mm_mm_s, E1); break; - #if EXTRUDERS > 2 - case 6: UI_DECREMENT(LinearAdvance_mm_mm_s, E2); break; - case 7: UI_INCREMENT(LinearAdvance_mm_mm_s, E2); break; - #if EXTRUDERS > 3 - case 8: UI_DECREMENT(LinearAdvance_mm_mm_s, E3); break; - case 9: UI_INCREMENT(LinearAdvance_mm_mm_s, E3); break; - #endif - #endif - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp deleted file mode 100644 index f012a2218b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/******************* - * lock_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace Theme; - -uint16_t LockScreen::passcode = 0; - -void LockScreen::onEntry() { - const uint8_t siz = sizeof(screen_data.LockScreen.passcode); - memset(screen_data.LockScreen.passcode, '_', siz-1); - screen_data.LockScreen.passcode[siz-1] = '\0'; - BaseScreen::onEntry(); -} - -void LockScreen::onRedraw(draw_mode_t what) { - CommandProcessor cmd; - - if (what & BACKGROUND) { - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - } - - if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT - #define GRID_COLS 1 - #define GRID_ROWS 10 - #else - #define GRID_COLS 1 - #define GRID_ROWS 7 - #endif - - #undef MARGIN_T - #undef MARGIN_B - #define MARGIN_T 3 - #define MARGIN_B 3 - - progmem_str message; - switch (message_style()) { - case 'w': - message = GET_TEXT_F(MSG_PASSCODE_REJECTED); - break; - case 'g': - message = GET_TEXT_F(MSG_PASSCODE_ACCEPTED); - break; - default: - if (passcode == 0) { - message = GET_TEXT_F(MSG_PASSCODE_SELECT); - } else { - message = GET_TEXT_F(MSG_PASSCODE_REQUEST); - } - } - message_style() = '\0'; // Terminate the string. - - #ifdef TOUCH_UI_PORTRAIT - constexpr uint8_t l = 6; - #else - constexpr uint8_t l = 3; - #endif - - const uint8_t pressed = EventLoop::get_pressed_tag(); - - cmd.font(font_large) - #ifdef TOUCH_UI_PORTRAIT - .text(BTN_POS(1,2), BTN_SIZE(1,1), message) - .font(font_xlarge) - .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode) - #else - .text(BTN_POS(1,1), BTN_SIZE(1,1), message) - .font(font_xlarge) - .text(BTN_POS(1,2), BTN_SIZE(1,1), screen_data.LockScreen.passcode) - #endif - .font(font_large) - .colors(normal_btn) - #ifdef TOUCH_UI_PASSCODE - .keys(BTN_POS(1,l+1), BTN_SIZE(1,1), F("123"), pressed) - .keys(BTN_POS(1,l+2), BTN_SIZE(1,1), F("456"), pressed) - .keys(BTN_POS(1,l+3), BTN_SIZE(1,1), F("789"), pressed) - .keys(BTN_POS(1,l+4), BTN_SIZE(1,1), F("0.<"), pressed); - #else - .keys(BTN_POS(1,l+1), BTN_SIZE(1,1), F("1234567890"), pressed) - .keys(BTN_POS(1,l+2), BTN_SIZE(1,1), F("qwertyuiop"), pressed) - .keys(BTN_POS(1,l+3), BTN_SIZE(1,1), F("asdfghjkl "), pressed) - .keys(BTN_POS(1,l+4), BTN_SIZE(1,1), F("zxcvbnm!?<"), pressed); - #endif - - #undef MARGIN_T - #undef MARGIN_B - #define MARGIN_T MARGIN_DEFAULT - #define MARGIN_B MARGIN_DEFAULT - - #undef GRID_COLS - #undef GRID_ROWS - } -} - -char &LockScreen::message_style() { - // We use the last byte of the passcode string as a flag to indicate, - // which message to show. - constexpr uint8_t last_char = sizeof(screen_data.LockScreen.passcode)-1; - return screen_data.LockScreen.passcode[last_char]; -} - -void LockScreen::onPasscodeEntered() { - if (passcode == 0) { - // We are defining a passcode - message_style() = 0; - onRefresh(); - sound.play(twinkle, PLAY_SYNCHRONOUS); - passcode = compute_checksum(); - GOTO_PREVIOUS(); - } else { - // We are verifying a passcode - if (passcode == compute_checksum()) { - message_style() = 'g'; - onRefresh(); - sound.play(twinkle, PLAY_SYNCHRONOUS); - GOTO_PREVIOUS(); - } else { - message_style() = 'w'; - onRefresh(); - sound.play(sad_trombone, PLAY_SYNCHRONOUS); - current_screen.forget(); // Discard the screen the user was trying to go to. - GOTO_PREVIOUS(); - } - } -} - -bool LockScreen::onTouchEnd(uint8_t tag) { - char *c = strchr(screen_data.LockScreen.passcode,'_'); - if (c) { - if (tag == '<') { - if (c != screen_data.LockScreen.passcode) { - // Backspace deletes previous entered characters. - *--c = '_'; - } - } else { - // Append character to passcode - *c++ = tag; - if (*c == '\0') { - // If at last character, then process the code. - onPasscodeEntered(); - } - } - } - return true; -} - -uint16_t LockScreen::compute_checksum() { - uint16_t checksum = 0; - const char* c = screen_data.LockScreen.passcode; - while (*c) { - checksum = (checksum << 2) ^ *c++; - } - if (checksum == 0) checksum = 0xFFFF; // Prevent a zero checksum - return checksum; -} - -// This function should be called *after* calling GOTO_SCREEN -// to move to new screen. If a passcode is enabled, it will -// immediately jump to the keypad screen, pushing the previous -// screen onto the stack. If the code is entered correctly, -// the stack will be popped, allowing the user to proceed to -// the new screen. Otherwise it will be popped twice, taking -// the user back to where they were before. -void LockScreen::check_passcode() { - if (passcode == 0) return; - message_style() = 0; - GOTO_SCREEN(LockScreen); -} - -bool LockScreen::is_enabled() { - return passcode != 0; -} - -void LockScreen::disable() { - passcode = 0; -} - -void LockScreen::enable() { - message_style() = 0; - passcode = 0; - GOTO_SCREEN(LockScreen); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp deleted file mode 100644 index 58a545937c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/***************** - * main_menu.cpp * - *****************/ - -/**************************************************************************** - * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void MainMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)); - } - - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(Theme::font_medium) - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 8 - #define GRID_COLS 2 - .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME)) - .enabled( - #if ENABLED(NOZZLE_CLEAN_FEATURE) - 1 - #endif - ) - .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE)) - .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS)) - .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS)) - .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE)) - .enabled( - #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) - 1 - #endif - ) - .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) - .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .enabled( - #ifdef PRINTCOUNTER - 1 - #endif - ) - .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) - .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) - .colors(action_btn) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_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), GET_TEXT_F(MSG_AUTO_HOME)) - #if ENABLED(TOUCH_UI_COCOA_PRESS) - .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_PREHEAT_1)) - #else - .enabled( - #if ENABLED(NOZZLE_CLEAN_FEATURE) - 1 - #endif - ) - .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE)) - #endif - .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS)) - .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS)) - .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE)) - #if ENABLED(TOUCH_UI_COCOA_PRESS) - .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) - #else - .enabled( - #if DISABLED(TOUCH_UI_LULZBOT_BIO) - 1 - #endif - ) - .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) - #endif - .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .enabled( - #ifdef PRINTCOUNTER - 1 - #endif - ) - .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) - .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_MENU)) - .colors(action_btn) - .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); - #undef GRID_COLS - #undef GRID_ROWS - #endif - } -} - -bool MainMenu::onTouchEnd(uint8_t tag) { - using namespace ExtUI; - - switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; - #if ENABLED(TOUCH_UI_COCOA_PRESS) - case 3: GOTO_SCREEN(PreheatTimerScreen); break; - #elif ENABLED(NOZZLE_CLEAN_FEATURE) - case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; - #endif - case 4: GOTO_SCREEN(MoveAxisScreen); break; - case 5: injectCommands_P(PSTR("M84")); break; - case 6: GOTO_SCREEN(TemperatureScreen); break; - #if ENABLED(TOUCH_UI_COCOA_PRESS) - case 7: GOTO_SCREEN(CaseLightScreen); break; - #else - case 7: GOTO_SCREEN(ChangeFilamentScreen); break; - #endif - case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; -#if ENABLED(PRINTCOUNTER) - case 9: GOTO_SCREEN(StatisticsScreen); break; -#endif - case 10: GOTO_SCREEN(AboutScreen); break; - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp deleted file mode 100644 index 8f7af4b81e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/******************************* - * max_acceleration_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void MaxAccelerationScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0); - w.units(GET_TEXT_F(MSG_UNITS_MM_S2)); - w.heading(GET_TEXT_F(MSG_ACCELERATION)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AMAX_X), getAxisMaxAcceleration_mm_s2(X) ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) ); - #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E), getAxisMaxAcceleration_mm_s2(E0) ); - #elif EXTRUDERS > 1 - w.heading(GET_TEXT_F(MSG_AMAX_E)); - w.color(e_axis).adjuster( 8, F(LCD_STR_E0), getAxisMaxAcceleration_mm_s2(E0) ); - w.color(e_axis).adjuster(10, F(LCD_STR_E1), getAxisMaxAcceleration_mm_s2(E1) ); - #if EXTRUDERS > 2 - w.color(e_axis).adjuster(12, F(LCD_STR_E2), getAxisMaxAcceleration_mm_s2(E2) ); - #endif - #if EXTRUDERS > 3 - w.color(e_axis).adjuster(14, F(LCD_STR_E3), getAxisMaxAcceleration_mm_s2(E3) ); - #endif - #endif - w.increments(); -} - -bool MaxAccelerationScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisMaxAcceleration_mm_s2, X ); break; - case 3: UI_INCREMENT(AxisMaxAcceleration_mm_s2, X ); break; - case 4: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Y ); break; - case 5: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Y ); break; - case 6: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Z ); break; - case 7: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Z ); break; - case 8: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E0); break; - case 9: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E0); break; - #if EXTRUDERS > 1 && ENABLED(DISTINCT_E_FACTORS) - case 10: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E1); break; - case 11: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E1); break; - #endif - #if EXTRUDERS > 2 && ENABLED(DISTINCT_E_FACTORS) - case 12: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E2); break; - case 13: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E2); break; - #endif - #if EXTRUDERS > 3 && ENABLED(DISTINCT_E_FACTORS) - case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break; - case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break; - #endif - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp deleted file mode 100644 index 864f6b735d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/*************************** - * max_velocity_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void MaxVelocityScreen::onRedraw(draw_mode_t what) { - using namespace ExtUI; - widgets_t w(what); - w.precision(0); - w.units(GET_TEXT_F(MSG_UNITS_MM_S)); - w.heading( GET_TEXT_F(MSG_VELOCITY)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_VMAX_X), getAxisMaxFeedrate_mm_s(X) ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); - #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) ); - #elif EXTRUDERS > 1 - w.heading(GET_TEXT_F(MSG_VMAX_E)); - w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) ); - w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) ); - #if EXTRUDERS > 2 - w.color(e_axis).adjuster( 12, F(LCD_STR_E2), getAxisMaxFeedrate_mm_s(E2) ); - #endif - #if EXTRUDERS > 3 - w.color(e_axis).adjuster( 14, F(LCD_STR_E3), getAxisMaxFeedrate_mm_s(E3) ); - #endif - #endif - w.increments(); -} - -bool MaxVelocityScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisMaxFeedrate_mm_s, X); break; - case 3: UI_INCREMENT(AxisMaxFeedrate_mm_s, X); break; - case 4: UI_DECREMENT(AxisMaxFeedrate_mm_s, Y); break; - case 5: UI_INCREMENT(AxisMaxFeedrate_mm_s, Y); break; - case 6: UI_DECREMENT(AxisMaxFeedrate_mm_s, Z); break; - case 7: UI_INCREMENT(AxisMaxFeedrate_mm_s, Z); break; - case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break; - case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break; - #if EXTRUDERS > 1 && ENABLED(DISTINCT_E_FACTORS) - case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break; - case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break; - #endif - #if EXTRUDERS > 2 && ENABLED(DISTINCT_E_FACTORS) - case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break; - case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break; - #endif - #if EXTRUDERS > 3 && ENABLED(DISTINCT_E_FACTORS) - case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break; - case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break; - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp deleted file mode 100644 index 95a4e6b44a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/*************************** - * media_player_screen.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" - -/** - * The MediaPlayerScreen allows an AVI to be played. - * - * It requires a special AVI file. The following video - * and audio codecs must be used: - * - * -vcodec mjpeg -pix_fmt yuvj420p - * -acodec adpcm_ima_wav - * - * To generate a 2 second static screen from a png file: - * - * ffmpeg -i startup.png -vcodec mjpeg -pix_fmt yuvj420p -r 1 video.avi - * sox -n -r 44100 -b 8 -c 2 -L silence.wav trim 0.0 2.000 - * ffmpeg -i silence.wav -acodec adpcm_ima_wav silence.avi - * ffmpeg -i video.avi -i silence.wav -c copy -map 0:v:0 -map 1:a:0 startup.avi - */ - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -#include "../archim2-flash/flash_storage.h" -#include "../archim2-flash/media_file_reader.h" - -using namespace FTDI; - -void MediaPlayerScreen::onEntry() { - BaseScreen::onEntry(); - CLCD::turn_on_backlight(); - SoundPlayer::set_volume(255); -} - -void MediaPlayerScreen::onRedraw(draw_mode_t) { -} - -bool MediaPlayerScreen::playCardMedia() { - #if ENABLED(SDSUPPORT) - char fname[15]; - strcpy_P(fname, PSTR("STARTUP.AVI")); - - MediaFileReader reader; - if (!reader.open(fname)) - return false; - - SERIAL_ECHO_MSG("Starting to play STARTUP.AVI"); - playStream(&reader, MediaFileReader::read); - reader.close(); - #endif - return true; -} - -// Attempt to play media from the onboard SPI flash chip -bool MediaPlayerScreen::playBootMedia() { - UIFlashStorage::BootMediaReader reader; - if (!reader.isAvailable()) return false; - - SERIAL_ECHO_MSG("Starting to play boot video"); - playStream(&reader, UIFlashStorage::BootMediaReader::read); - return true; -} - -void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream) { - #if FTDI_API_LEVEL >= 810 - if (FTDI::ftdi_chip >= 810) { - // Set up the media FIFO on the end of RAMG, as the top of RAMG - // will be used as the framebuffer. - - uint8_t buf[512]; - const uint32_t block_size = 512; - const uint32_t fifo_size = block_size * 2; - const uint32_t fifo_start = CLCD::MAP::RAM_G + CLCD::MAP::RAM_G_SIZE - fifo_size; - - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(0x000000)) - .cmd(CLEAR(true,true,true)) - .cmd(DL::DL_DISPLAY) - .cmd(CMD_SWAP) - .execute() - .cmd(CMD_DLSTART) - .mediafifo(fifo_start, fifo_size) - .playvideo(OPT_FULLSCREEN | OPT_MEDIAFIFO | OPT_NOTEAR | OPT_SOUND) - .cmd(DL::DL_DISPLAY) - .cmd(CMD_SWAP) - .execute(); - - uint32_t writePtr = 0; - int16_t nBytes; - - uint32_t t = millis(); - uint8_t timeouts; - - spiInit(SPI_HALF_SPEED); // Boost SPI speed for video playback - - do { - // Write block n - nBytes = (*data_stream)(obj, buf, block_size); - if (nBytes == -1) break; - - if (millis() - t > 10) { - ExtUI::yield(); - t = millis(); - } - - CLCD::mem_write_bulk (fifo_start + writePtr, buf, nBytes); - - // Wait for FTDI810 to finish playing block n-1 - timeouts = 20; - do { - if (millis() - t > 10) { - ExtUI::yield(); - t = millis(); - timeouts--; - if (timeouts == 0) { - SERIAL_ECHO_MSG("Timeout playing video"); - cmd.reset(); - goto exit; - } - } - } while (CLCD::mem_read_32(CLCD::REG::MEDIAFIFO_READ) != writePtr); - - // Start playing block n - writePtr = (writePtr + nBytes) % fifo_size; - CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr); - } while (nBytes == block_size); - - SERIAL_ECHO_MSG("Done playing video"); - - exit: - spiInit(SPI_SPEED); // Restore default speed - - // Since playing media overwrites RAMG, we need to reinitialize - // everything that is stored in RAMG. - cmd.cmd(CMD_DLSTART).execute(); - DLCache::init(); - StatusScreen::loadBitmaps(); - } - #else - UNUSED(obj); - UNUSED(data_stream); - #endif // FTDI_API_LEVEL >= 810 -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp deleted file mode 100644 index 8513c79f84..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/************************ - * move_axis_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace ExtUI; - -void MoveAxisScreen::onEntry() { - // Since Marlin keeps only one absolute position for all the extruders, - // we have to keep track of the relative motion of individual extruders - // ourselves. The relative distances are reset to zero whenever this - // screen is entered. - - for (uint8_t i = 0; i < ExtUI::extruderCount; i++) { - screen_data.MoveAxisScreen.e_rel[i] = 0; - } - BaseNumericAdjustmentScreen::onEntry(); -} - -void MoveAxisScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(1); - w.units(GET_TEXT_F(MSG_UNITS_MM)); - w.heading( GET_TEXT_F(MSG_MOVE_AXIS)); - w.home_buttons(20); - w.color(Theme::x_axis).adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisPosition_mm(X), canMove(X)); - w.color(Theme::y_axis).adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisPosition_mm(Y), canMove(Y)); - w.color(Theme::z_axis).adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisPosition_mm(Z), canMove(Z)); - - w.color(Theme::e_axis); - #if EXTRUDERS == 1 - w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); - #elif EXTRUDERS > 1 - w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); - w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); - #if EXTRUDERS > 2 - w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxisScreen.e_rel[2], canMove(E2)); - #endif - #if EXTRUDERS > 3 - w.adjuster( 14, GET_TEXT_F(MSG_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) 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; - case 3: UI_INCREMENT_AXIS(X); break; - case 4: UI_DECREMENT_AXIS(Y); break; - case 5: UI_INCREMENT_AXIS(Y); break; - case 6: UI_DECREMENT_AXIS(Z); break; - case 7: UI_INCREMENT_AXIS(Z); break; - // For extruders, also update relative distances. - case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] -= increment; break; - case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] += increment; break; - #if EXTRUDERS > 1 - case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] -= increment; break; - case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] += increment; break; - #endif - #if EXTRUDERS > 2 - case 12: UI_DECREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] -= increment; break; - case 13: UI_INCREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] += increment; break; - #endif - #if EXTRUDERS > 3 - 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: 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; - } - #undef UI_DECREMENT_AXIS - #undef UI_INCREMENT_AXIS - return true; -} - -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 xyze_feedrate_t max_manual_feedrate = MANUAL_FEEDRATE; - return min(max_manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f)); -} - -void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { - ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); -} - -void MoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { - ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); -} - -void MoveAxisScreen::onIdle() { - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp deleted file mode 100644 index ae224e9c11..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/***************************** - * nozzle_offsets_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && HOTENDS > 1 - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; - -void NozzleOffsetScreen::onEntry() { - // Since we don't allow the user to edit the offsets for E0, - // make sure they are all zero. - normalizeNozzleOffset(X); - normalizeNozzleOffset(Y); - normalizeNozzleOffset(Z); -} - -void NozzleOffsetScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2).units(GET_TEXT_F(MSG_UNITS_MM)); - - w.heading( GET_TEXT_F(MSG_OFFSETS_MENU)); - w.color(Theme::x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), ExtUI::getNozzleOffset_mm(X, E1)); - w.color(Theme::y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), ExtUI::getNozzleOffset_mm(Y, E1)); - w.color(Theme::z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), ExtUI::getNozzleOffset_mm(Z, E1)); - #if ENABLED(CALIBRATION_GCODE) - w.button(8, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY), !isPrinting()); - #endif - w.increments(); -} - -bool NozzleOffsetScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(NozzleOffset_mm, X, E1); break; - case 3: UI_INCREMENT(NozzleOffset_mm, X, E1); break; - case 4: UI_DECREMENT(NozzleOffset_mm, Y, E1); break; - case 5: UI_INCREMENT(NozzleOffset_mm, Y, E1); break; - case 6: UI_DECREMENT(NozzleOffset_mm, Z, E1); break; - case 7: UI_INCREMENT(NozzleOffset_mm, Z, E1); break; - #if ENABLED(CALIBRATION_GCODE) - case 8: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true; - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp deleted file mode 100644 index 6964a468a9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/******************** - * nudge_nozzle.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, BABYSTEPPING) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void NudgeNozzleScreen::onEntry() { - screen_data.NudgeNozzleScreen.show_offsets = false; - #if EXTRUDERS > 1 - screen_data.NudgeNozzleScreen.link_nozzles = true; - #endif - screen_data.NudgeNozzleScreen.rel.reset(); - - BaseNumericAdjustmentScreen::onEntry(); -} - -void NudgeNozzleScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); - - w.heading( GET_TEXT_F(MSG_NUDGE_NOZZLE)); - #if ENABLED(BABYSTEP_XY) - w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X)); - w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y)); - #endif - w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z)); - w.increments(); - #if EXTRUDERS > 1 - w.toggle (8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles); - #endif - - #if EXTRUDERS > 1 || HAS_BED_PROBE - w.toggle (9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets); - - if (screen_data.NudgeNozzleScreen.show_offsets) { - char str[19]; - - w.draw_mode(BOTH); - w.color(other); - - #if HAS_BED_PROBE - dtostrf(getZOffset_mm(), 4, 2, str); - strcat(str, " "); - strcat_P(str, GET_TEXT(MSG_UNITS_MM)); - w.text_field (0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str); - #endif - - #if EXTRUDERS > 1 - format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1)); - w.text_field (0, GET_TEXT_F(MSG_OFFSETS_MENU), str); - #endif - } - #endif -} - -bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) { - const float inc = getIncrement(); - #if EXTRUDERS > 1 - const bool link = screen_data.NudgeNozzleScreen.link_nozzles; - #else - constexpr bool link = true; - #endif - int16_t steps; - switch (tag) { - case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break; - case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break; - case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break; - case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break; - case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break; - case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break; - #if EXTRUDERS > 1 - case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break; - #endif - case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break; - default: - return false; - } - #if EXTRUDERS > 1 || HAS_BED_PROBE - SaveSettingsDialogBox::settingsChanged(); - #endif - return true; -} - -bool NudgeNozzleScreen::onTouchEnd(uint8_t tag) { - if (tag == 1) { - SaveSettingsDialogBox::promptToSaveSettings(); - return true; - } else { - return BaseNumericAdjustmentScreen::onTouchEnd(tag); - } -} - -void NudgeNozzleScreen::onIdle() { - reset_menu_timeout(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp deleted file mode 100644 index 0a24c30082..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************** - * preheat_timer_screen.cpp * - ****************************/ - -/**************************************************************************** - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS) - -#include "screens.h" -#include "screen_data.h" - -#include "../ftdi_eve_lib/extras/circular_progress.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -#define GRID_COLS 2 -#define GRID_ROWS 5 - -void PreheatTimerScreen::draw_message(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - draw_text_box(cmd, BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large); - } -} - -uint16_t PreheatTimerScreen::secondsRemaining() { - const uint32_t elapsed_sec = (millis() - screen_data.PreheatTimerScreen.start_ms) / 1000; - return (COCOA_PRESS_PREHEAT_SECONDS > elapsed_sec) ? COCOA_PRESS_PREHEAT_SECONDS - elapsed_sec : 0; -} - -void PreheatTimerScreen::draw_time_remaining(draw_mode_t what) { - if (what & FOREGROUND) { - const uint16_t elapsed_sec = secondsRemaining(); - const uint8_t min = elapsed_sec / 60, - sec = elapsed_sec % 60; - - char str[10]; - sprintf_P(str, PSTR("%02d:%02d"), min, sec); - - CommandProcessor cmd; - cmd.font(font_xlarge); - draw_circular_progress(cmd, BTN_POS(1,1), BTN_SIZE(1,5), float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest); - } -} - -void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) { - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(font_medium) - .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Cancel")); - } -} - -void PreheatTimerScreen::onEntry() { - screen_data.PreheatTimerScreen.start_ms = millis(); - #ifdef COCOA_PRESS_PREHEAT_SCRIPT - injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_SCRIPT)); - #endif -} - -void PreheatTimerScreen::onRedraw(draw_mode_t what) { - draw_message(what); - draw_time_remaining(what); - draw_interaction_buttons(what); -} - -bool PreheatTimerScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; - default: break; - } - return false; -} - -void PreheatTimerScreen::onIdle() { - if (secondsRemaining() == 0) { - AlertDialogBox::show(GET_TEXT_F(MSG_PREHEAT_FINISHED)); - // Remove SaveSettingsDialogBox from the stack - // so the alert box doesn't return to me. - current_screen.forget(); - } - - reset_menu_timeout(); - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp deleted file mode 100644 index a5fe95490f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*********************************** - * restore_failsafe_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace ExtUI; - -void RestoreFailsafeDialogBox::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_EEPROM_RESET_WARNING)); - drawYesNoButtons(); -} - -bool RestoreFailsafeDialogBox::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: - ExtUI::injectCommands_P(PSTR("M502")); - AlertDialogBox::show(GET_TEXT_F(MSG_EEPROM_RESET)); - // Remove RestoreFailsafeDialogBox from the stack - // so the alert box doesn't return to it. - current_screen.forget(); - SaveSettingsDialogBox::settingsChanged(); - return true; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp deleted file mode 100644 index 5ffe20cce1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/******************************** - * save_settings_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace ExtUI; - -bool SaveSettingsDialogBox::needs_save = false; - -void SaveSettingsDialogBox::onRedraw(draw_mode_t) { - drawMessage(GET_TEXT_F(MSG_EEPROM_SAVE_PROMPT)); - drawYesNoButtons(); -} - -bool SaveSettingsDialogBox::onTouchEnd(uint8_t tag) { - needs_save = false; - switch (tag) { - case 1: - injectCommands_P(PSTR("M500")); - AlertDialogBox::show(GET_TEXT_F(MSG_EEPROM_SAVED)); - // Remove SaveSettingsDialogBox from the stack - // so the alert box doesn't return to me. - current_screen.forget(); - return true; - default: - return DialogBoxBaseClass::onTouchEnd(tag); - } -} - -void SaveSettingsDialogBox::promptToSaveSettings() { - if (needs_save) { - // Remove current screen from the stack - // so SaveSettingsDialogBox doesn't return here. - GOTO_SCREEN(SaveSettingsDialogBox); - current_screen.forget(); - } else { - // No save needed. - GOTO_PREVIOUS(); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h deleted file mode 100644 index 6e2cb97a98..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h +++ /dev/null @@ -1,86 +0,0 @@ -/***************** - * screen_data.h * - *****************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#include "../ftdi_eve_lib/ftdi_eve_lib.h" - -// To save RAM, store state information related to a particular screen -// in a union. The values should be initialized in the onEntry method. - -struct base_numeric_adjustment_t {uint8_t increment;}; - -union screen_data_t { - struct base_numeric_adjustment_t BaseNumericAdjustmentScreen; - struct {uint8_t volume; uint8_t brightness;} InterfaceSettingsScreen; - struct {char passcode[5];} LockScreen; - struct {bool isError;} AlertDialogBox; - struct {bool auto_hide;} SpinnerDialogBox; - struct {uint8_t file_index;} ConfirmStartPrintDialogBox; - struct { - uint8_t e_tag, t_tag, repeat_tag; - ExtUI::extruder_t saved_extruder; - #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - bool need_purge; - #endif - } ChangeFilamentScreen; - struct { - struct { - uint8_t is_dir : 1; - uint8_t is_root : 1; - } flags; - uint8_t selected_tag; - uint8_t num_page; - uint8_t cur_page; - #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) - uint16_t scroll_pos; - uint16_t scroll_max; - #endif - } FilesScreen; - struct { - struct base_numeric_adjustment_t placeholder; - float e_rel[ExtUI::extruderCount]; - } MoveAxisScreen; -#if ENABLED(TOUCH_UI_DEVELOPER_MENU) - struct { - uint32_t next_watchdog_trigger; - const char* message; - } StressTestScreen; -#endif -#if ENABLED(TOUCH_UI_COCOA_PRESS) - struct { - uint32_t start_ms; - } PreheatTimerScreen; -#endif -#if ENABLED(BABYSTEPPING) - struct { - struct base_numeric_adjustment_t placeholder; - xyz_int_t rel; - #if EXTRUDERS > 1 - bool link_nozzles; - #endif - bool show_offsets; - } NudgeNozzleScreen; -#endif -}; - -extern screen_data_t screen_data; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp deleted file mode 100644 index bc92800054..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/*************** - * screens.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) -#include "screens.h" -#include "screen_data.h" - -tiny_timer_t refresh_timer; -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), - DECL_SCREEN(TuneMenu), - DECL_SCREEN(AdvancedSettingsMenu), - DECL_SCREEN(AlertDialogBox), - DECL_SCREEN(ConfirmUserRequestAlertBox), - DECL_SCREEN(RestoreFailsafeDialogBox), - DECL_SCREEN(SaveSettingsDialogBox), - DECL_SCREEN(ConfirmStartPrintDialogBox), - DECL_SCREEN(ConfirmAbortPrintDialogBox), -#if ENABLED(CALIBRATION_GCODE) - DECL_SCREEN(ConfirmAutoCalibrationDialogBox), -#endif - DECL_SCREEN(SpinnerDialogBox), - DECL_SCREEN(AboutScreen), -#if ENABLED(PRINTCOUNTER) - DECL_SCREEN(StatisticsScreen), -#endif -#if ENABLED(BABYSTEPPING) - DECL_SCREEN(NudgeNozzleScreen), -#endif - DECL_SCREEN(MoveAxisScreen), - DECL_SCREEN(StepsScreen), -#if HAS_TRINAMIC - DECL_SCREEN(StepperCurrentScreen), - DECL_SCREEN(StepperBumpSensitivityScreen), -#endif -#if HAS_BED_PROBE - DECL_SCREEN(ZOffsetScreen), -#endif -#if HOTENDS > 1 - DECL_SCREEN(NozzleOffsetScreen), -#endif -#if ENABLED(BACKLASH_GCODE) - DECL_SCREEN(BacklashCompensationScreen), -#endif - DECL_SCREEN(FeedratePercentScreen), - DECL_SCREEN(MaxVelocityScreen), - DECL_SCREEN(MaxAccelerationScreen), - DECL_SCREEN(DefaultAccelerationScreen), -#if DISABLED(CLASSIC_JERK) - DECL_SCREEN(JunctionDeviationScreen), -#else - DECL_SCREEN(JerkScreen), -#endif -#if HAS_CASE_LIGHT - DECL_SCREEN(CaseLightScreen), -#endif -#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - DECL_SCREEN(FilamentMenu), -#endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - DECL_SCREEN(FilamentRunoutScreen), -#endif -#if ENABLED(LIN_ADVANCE) - DECL_SCREEN(LinearAdvanceScreen), -#endif - DECL_SCREEN(TemperatureScreen), - DECL_SCREEN(ChangeFilamentScreen), - DECL_SCREEN(InterfaceSettingsScreen), - DECL_SCREEN(InterfaceSoundsScreen), - DECL_SCREEN(LockScreen), - DECL_SCREEN(FilesScreen), - DECL_SCREEN(EndstopStatesScreen), -#if ENABLED(TOUCH_UI_LULZBOT_BIO) - DECL_SCREEN(BioPrintingDialogBox), - DECL_SCREEN(BioConfirmHomeXYZ), - DECL_SCREEN(BioConfirmHomeE), -#endif -#if ENABLED(TOUCH_UI_COCOA_PRESS) - DECL_SCREEN(PreheatTimerScreen), -#endif -#if ENABLED(TOUCH_UI_DEVELOPER_MENU) - DECL_SCREEN(DeveloperMenu), - DECL_SCREEN(ConfirmEraseFlashDialogBox), - DECL_SCREEN(WidgetsScreen), - DECL_SCREEN(TouchRegistersScreen), - DECL_SCREEN(StressTestScreen), -#endif - DECL_SCREEN(MediaPlayerScreen), - DECL_SCREEN(DisplayTuningScreen) -}; - -SCREEN_TABLE_POST - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h deleted file mode 100644 index 4e6d8d3e2d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h +++ /dev/null @@ -1,783 +0,0 @@ -/************* - * screens.h * - *************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#include "../ftdi_eve_lib/ftdi_eve_lib.h" -#include "../language/language.h" -#include "../theme/theme.h" -#include "string_format.h" - -extern tiny_timer_t refresh_timer; - -/********************************* DL CACHE SLOTS ******************************/ - -// In order to reduce SPI traffic, we cache display lists (DL) in RAMG. This -// is done using the CLCD::DLCache class, which takes a unique ID for each -// cache location. These IDs are defined here: - -enum { - STATUS_SCREEN_CACHE, - MENU_SCREEN_CACHE, - TUNE_SCREEN_CACHE, - ADJUST_OFFSETS_SCREEN_CACHE, - ALERT_BOX_CACHE, - SPINNER_CACHE, - ADVANCED_SETTINGS_SCREEN_CACHE, - MOVE_AXIS_SCREEN_CACHE, - TEMPERATURE_SCREEN_CACHE, - STEPS_SCREEN_CACHE, - STEPPER_CURRENT_SCREEN_CACHE, - STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE, - ZOFFSET_SCREEN_CACHE, - NOZZLE_OFFSET_SCREEN_CACHE, - BACKLASH_COMPENSATION_SCREEN_CACHE, - MAX_FEEDRATE_SCREEN_CACHE, - MAX_VELOCITY_SCREEN_CACHE, - MAX_ACCELERATION_SCREEN_CACHE, - DEFAULT_ACCELERATION_SCREEN_CACHE, -#if DISABLED(CLASSIC_JERK) - JUNC_DEV_SCREEN_CACHE, -#else - JERK_SCREEN_CACHE, -#endif -#if HAS_CASE_LIGHT - CASE_LIGHT_SCREEN_CACHE, -#endif -#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - FILAMENT_MENU_CACHE, -#endif -#if ENABLED(LIN_ADVANCE) - LINEAR_ADVANCE_SCREEN_CACHE, -#endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - FILAMENT_RUNOUT_SCREEN_CACHE, -#endif -#if ENABLED(TOUCH_UI_LULZBOT_BIO) - PRINTING_SCREEN_CACHE, -#endif -#if ENABLED(TOUCH_UI_COCOA_PRESS) - PREHEAT_TIMER_SCREEN_CACHE, -#endif - CHANGE_FILAMENT_SCREEN_CACHE, - INTERFACE_SETTINGS_SCREEN_CACHE, - INTERFACE_SOUNDS_SCREEN_CACHE, - LOCK_SCREEN_CACHE, - FILES_SCREEN_CACHE, - DISPLAY_TIMINGS_SCREEN_CACHE -}; - -// To save MCU RAM, the status message is "baked" in to the status screen -// cache, so we reserve a large chunk of memory for the DL cache - -#define STATUS_SCREEN_DL_SIZE 2048 -#define ALERT_BOX_DL_SIZE 3072 -#define SPINNER_DL_SIZE 3072 -#define FILE_SCREEN_DL_SIZE 3072 -#define PRINTING_SCREEN_DL_SIZE 2048 - -/************************* MENU SCREEN DECLARATIONS *************************/ - -class BaseScreen : public UIScreen { - protected: - #ifdef LCD_TIMEOUT_TO_STATUS - static uint32_t last_interaction; - #endif - - static bool buttonIsPressed(uint8_t tag); - - public: - static bool buttonStyleCallback(CommandProcessor &, uint8_t, uint8_t &, uint16_t &, bool); - - static void reset_menu_timeout(); - - static void onEntry(); - static void onIdle(); -}; - -class BootScreen : public BaseScreen, public UncachedScreen { - private: - static void showSplashScreen(); - public: - static void onRedraw(draw_mode_t); - static void onIdle(); -}; - -class AboutScreen : public BaseScreen, public UncachedScreen { - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -#if ENABLED(PRINTCOUNTER) - class StatisticsScreen : public BaseScreen, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; -#endif - -class KillScreen { - // The KillScreen is behaves differently than the - // others, so we do not bother extending UIScreen. - public: - static void show(const char*); -}; - -class DialogBoxBaseClass : public BaseScreen { - protected: - template static void drawMessage(const T, int16_t font = 0); - static void drawYesNoButtons(uint8_t default_btn = 0); - static void drawOkayButton(); - static void drawSpinner(); - static void drawButton(const progmem_str); - - static void onRedraw(draw_mode_t) {}; - public: - static bool onTouchEnd(uint8_t tag); - static void onIdle(); -}; - -class AlertDialogBox : public DialogBoxBaseClass, public CachedScreen { - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - template static void show(T); - template static void showError(T); - static void hide(); -}; - -class RestoreFailsafeDialogBox : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class SaveSettingsDialogBox : public DialogBoxBaseClass, public UncachedScreen { - private: - static bool needs_save; - - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - - static void promptToSaveSettings(); - static void settingsChanged() {needs_save = true;} -}; - -class ConfirmStartPrintDialogBox : public DialogBoxBaseClass, public UncachedScreen { - private: - inline static const char *getShortFilename() {return getFilename(false);} - inline static const char *getLongFilename() {return getFilename(true);} - - static const char *getFilename(bool longName); - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t); - - static void show(uint8_t file_index); -}; - -class ConfirmAbortPrintDialogBox : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -#if ENABLED(CALIBRATION_GCODE) -class ConfirmAutoCalibrationDialogBox : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; -#endif - -class ConfirmUserRequestAlertBox : public AlertDialogBox { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t); - static void hide(); - static void show(const char*); -}; - -class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static void onIdle(); - - static void show(const progmem_str); - static void hide(); - static void enqueueAndWait_P(const progmem_str commands); - static void enqueueAndWait_P(const progmem_str message, const progmem_str commands); -}; - -#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) -class StatusScreen : public BaseScreen, public CachedScreen { - private: - static void draw_axis_position(draw_mode_t); - static void draw_temperature(draw_mode_t); - static void draw_progress(draw_mode_t); - static void draw_interaction_buttons(draw_mode_t); - static void draw_status_message(draw_mode_t, const char * const); - - public: - static void loadBitmaps(); - static void setStatusMessage(const char *); - static void setStatusMessage(progmem_str); - static void onRedraw(draw_mode_t); - static void onStartup(); - static void onEntry(); - static void onIdle(); - static bool onTouchEnd(uint8_t tag); -}; -#else - class StatusScreen : public BaseScreen, public CachedScreen { - private: - static float increment; - static bool jog_xy; - static bool fine_motion; - - static void draw_temperature(draw_mode_t what); - static void draw_syringe(draw_mode_t what); - static void draw_arrows(draw_mode_t what); - static void draw_overlay_icons(draw_mode_t what); - static void draw_fine_motion(draw_mode_t what); - static void draw_buttons(draw_mode_t what); - public: - static void loadBitmaps(); - static void unlockMotors(); - - static void setStatusMessage(const char *); - static void setStatusMessage(progmem_str); - - static void onRedraw(draw_mode_t); - - static bool onTouchStart(uint8_t tag); - static bool onTouchHeld(uint8_t tag); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); - - }; -#endif - -#if ENABLED(TOUCH_UI_LULZBOT_BIO) - class BioPrintingDialogBox : public BaseScreen, public CachedScreen { - private: - static void draw_status_message(draw_mode_t, const char * const); - static void draw_progress(draw_mode_t); - static void draw_time_remaining(draw_mode_t); - static void draw_interaction_buttons(draw_mode_t); - public: - static void onRedraw(draw_mode_t); - - static void show(); - - static void setStatusMessage(const char *); - static void setStatusMessage(progmem_str); - - static void onIdle(); - static bool onTouchEnd(uint8_t tag); - }; - - class BioConfirmHomeXYZ : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; - - class BioConfirmHomeE : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; -#endif - -#if ENABLED(TOUCH_UI_COCOA_PRESS) - class PreheatTimerScreen : public BaseScreen, public CachedScreen { - private: - static uint16_t secondsRemaining(); - - static void draw_message(draw_mode_t); - static void draw_time_remaining(draw_mode_t); - static void draw_interaction_buttons(draw_mode_t); - public: - static void onRedraw(draw_mode_t); - - static void onEntry(); - static void onIdle(); - static bool onTouchEnd(uint8_t tag); - }; -#endif - -class MainMenu : public BaseScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class TuneMenu : public BaseScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class TouchCalibrationScreen : public BaseScreen, public UncachedScreen { - public: - static void onRefresh(); - static void onEntry(); - static void onRedraw(draw_mode_t); - static void onIdle(); -}; - -class TouchRegistersScreen : public BaseScreen, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class AdvancedSettingsMenu : public BaseScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class ChangeFilamentScreen : public BaseScreen, public CachedScreen { - private: - static uint8_t getSoftenTemp(); - static ExtUI::extruder_t getExtruder(); - static void drawTempGradient(uint16_t x, uint16_t y, uint16_t w, uint16_t h); - static uint32_t getTempColor(uint32_t temp); - static void doPurge(); - public: - static void onEntry(); - static void onExit(); - static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); - static bool onTouchEnd(uint8_t tag); - static bool onTouchHeld(uint8_t tag); - static void onIdle(); -}; - -class BaseNumericAdjustmentScreen : public BaseScreen { - public: - enum precision_default_t { - DEFAULT_LOWEST, - DEFAULT_MIDRANGE, - DEFAULT_HIGHEST - }; - - protected: - class widgets_t { - private: - draw_mode_t _what; - uint8_t _line; - uint32_t _color; - uint8_t _decimals; - progmem_str _units; - enum style_t { - BTN_NORMAL, - BTN_ACTION, - BTN_TOGGLE, - BTN_DISABLED, - TEXT_AREA, - TEXT_LABEL - } _style; - - protected: - void _draw_increment_btn(CommandProcessor &, uint8_t line, const uint8_t tag); - void _button(CommandProcessor &, uint8_t tag, int16_t x, int16_t y, int16_t w, int16_t h, progmem_str, bool enabled = true, bool highlight = false); - void _button_style(CommandProcessor &cmd, style_t style); - public: - widgets_t(draw_mode_t); - - widgets_t &color(uint32_t color) {_color = color; return *this;} - widgets_t &units(progmem_str units) {_units = units; return *this;} - widgets_t &draw_mode(draw_mode_t what) {_what = what; return *this;} - widgets_t &precision(uint8_t decimals, precision_default_t = DEFAULT_HIGHEST); - - void heading (progmem_str label); - void adjuster_sram_val (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); - void adjuster (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); - void adjuster (uint8_t tag, progmem_str label, float value=0, bool is_enabled = true); - void button (uint8_t tag, progmem_str label, bool is_enabled = true); - void text_field (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); - void two_buttons (uint8_t tag1, progmem_str label1, - uint8_t tag2, progmem_str label2, bool is_enabled = true); - void toggle (uint8_t tag, progmem_str label, bool value, bool is_enabled = true); - void home_buttons (uint8_t tag); - void increments (); - }; - - static float getIncrement(); - - public: - static void onEntry(); - static bool onTouchEnd(uint8_t tag); -}; - -class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - private: - static float getManualFeedrate(uint8_t axis, float increment_mm); - public: - static void setManualFeedrate(ExtUI::axis_t, float increment_mm); - static void setManualFeedrate(ExtUI::extruder_t, float increment_mm); - - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - static void onIdle(); -}; - -class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -#if HAS_TRINAMIC - class StepperCurrentScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; - - class StepperBumpSensitivityScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if HAS_BED_PROBE - class ZOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if HOTENDS > 1 - class NozzleOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if ENABLED(BABYSTEPPING) - class NudgeNozzleScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - static bool onTouchHeld(uint8_t tag); - static void onIdle(); - }; -#endif - -#if ENABLED(BACKLASH_GCODE) - class BacklashCompensationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -class FeedratePercentScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -class MaxVelocityScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -class MaxAccelerationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -#if DISABLED(CLASSIC_JERK) - class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#else - class JerkScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if HAS_CASE_LIGHT - class CaseLightScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - class FilamentMenu : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - class FilamentRunoutScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -#if ENABLED(LIN_ADVANCE) - class LinearAdvanceScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); - }; -#endif - -class TemperatureScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -class InterfaceSoundsScreen : public BaseScreen, public CachedScreen { - public: - enum event_t { - PRINTING_STARTED = 0, - PRINTING_FINISHED = 1, - PRINTING_FAILED = 2, - - NUM_EVENTS - }; - - private: - friend class InterfaceSettingsScreen; - - static uint8_t event_sounds[NUM_EVENTS]; - - static const char* getSoundSelection(event_t); - static void toggleSoundSelection(event_t); - static void setSoundSelection(event_t, const FTDI::SoundPlayer::sound_t*); - - public: - static void playEventSound(event_t, FTDI::play_mode_t = FTDI::PLAY_ASYNCHRONOUS); - - static void defaultSettings(); - - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); -}; - -class InterfaceSettingsScreen : public BaseScreen, public CachedScreen { - private: - struct persistent_data_t { - uint32_t touch_transform_a; - uint32_t touch_transform_b; - uint32_t touch_transform_c; - uint32_t touch_transform_d; - uint32_t touch_transform_e; - uint32_t touch_transform_f; - uint16_t passcode; - uint8_t display_brightness; - int8_t display_h_offset_adj; - int8_t display_v_offset_adj; - uint8_t sound_volume; - uint8_t bit_flags; - uint8_t event_sounds[InterfaceSoundsScreen::NUM_EVENTS]; - }; - - public: - #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - static bool backupEEPROM(); - #endif - - static void saveSettings(char *); - static void loadSettings(const char *); - static void defaultSettings(); - static void failSafeSettings(); - - static void onStartup(); - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); -}; - -class LockScreen : public BaseScreen, public CachedScreen { - private: - friend InterfaceSettingsScreen; - - static uint16_t passcode; - - static char & message_style(); - static uint16_t compute_checksum(); - static void onPasscodeEntered(); - public: - static bool is_enabled(); - static void check_passcode(); - static void enable(); - static void disable(); - - static void set_hash(uint16_t pass) {passcode = pass;}; - static uint16_t get_hash() {return passcode;}; - - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); -}; - -class FilesScreen : public BaseScreen, public CachedScreen { - private: - #ifdef TOUCH_UI_PORTRAIT - static constexpr uint8_t header_h = 2; - static constexpr uint8_t footer_h = 2; - static constexpr uint8_t files_per_page = 11; - #else - static constexpr uint8_t header_h = 1; - static constexpr uint8_t footer_h = 1; - static constexpr uint8_t files_per_page = 6; - #endif - - static uint8_t getTagForLine(uint8_t line) {return line + 2;} - static uint8_t getLineForTag(uint8_t tag) {return tag - 2;} - static uint16_t getFileForTag(uint8_t tag); - static uint16_t getSelectedFileIndex(); - - inline static const char *getSelectedShortFilename() {return getSelectedFilename(false);} - inline static const char *getSelectedLongFilename() {return getSelectedFilename(true);} - static const char *getSelectedFilename(bool longName); - - static void drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted); - static void drawFileList(); - static void drawHeader(); - static void drawFooter(); - static void drawSelectedFile(); - - static void gotoPage(uint8_t); - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); -}; - -class EndstopStatesScreen : public BaseScreen, public UncachedScreen { - public: - static void onEntry(); - static void onExit(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); -}; - -class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchHeld(uint8_t tag); -}; - -#if ENABLED(TOUCH_UI_DEVELOPER_MENU) - class DeveloperMenu : public BaseScreen, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; - - class ConfirmEraseFlashDialogBox : public DialogBoxBaseClass, public UncachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; - - class WidgetsScreen : public BaseScreen, public UncachedScreen { - public: - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); - static void onIdle(); - }; - - class StressTestScreen : public BaseScreen, public UncachedScreen { - private: - static void drawDots(uint16_t x, uint16_t y, uint16_t h, uint16_t v); - static bool watchDogTestNow(); - static void recursiveLockup(); - static void iterativeLockup(); - static void runTestOnBootup(bool enable); - - public: - static void startupCheck(); - - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - static void onIdle(); - }; -#endif - -class MediaPlayerScreen : public BaseScreen, public UncachedScreen { - private: - typedef int16_t media_streamer_func_t(void *obj, void *buff, size_t bytes); - - public: - static bool playCardMedia(); - static bool playBootMedia(); - - static void onEntry(); - static void onRedraw(draw_mode_t); - - 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp deleted file mode 100644 index 05df0f3995..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/************************** - * spinner_dialog_box.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" -#include "screen_data.h" - -using namespace FTDI; -using namespace ExtUI; - -void SpinnerDialogBox::onRedraw(draw_mode_t) { -} - -void SpinnerDialogBox::show(const progmem_str message) { - drawMessage(message); - drawSpinner(); - storeBackground(); - screen_data.SpinnerDialogBox.auto_hide = false; -} - -void SpinnerDialogBox::hide() { - CommandProcessor cmd; - cmd.stop().execute(); -} - -void SpinnerDialogBox::enqueueAndWait_P(const progmem_str commands) { - enqueueAndWait_P(GET_TEXT_F(MSG_PLEASE_WAIT), commands); -} - -void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem_str commands) { - show(message); - GOTO_SCREEN(SpinnerDialogBox); - ExtUI::injectCommands_P((const char*)commands); - screen_data.SpinnerDialogBox.auto_hide = true; -} - -void SpinnerDialogBox::onIdle() { - reset_menu_timeout(); - if (screen_data.SpinnerDialogBox.auto_hide && !commandsInQueue()) { - screen_data.SpinnerDialogBox.auto_hide = false; - hide(); - GOTO_PREVIOUS(); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp deleted file mode 100644 index e28e5d9b81..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/************************* - * statistics_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, PRINTCOUNTER) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -#define GRID_COLS 4 -#define GRID_ROWS 7 - -void StatisticsScreen::onRedraw(draw_mode_t what) { - CommandProcessor cmd; - - if (what & BACKGROUND) { - char buffer[21]; - - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0) - - .font(Theme::font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) - .font(Theme::font_small) - .tag(0) - .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_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)); - cmd.text(BTN_POS(3,4), BTN_SIZE(2,1), getTotalPrintTime_str(buffer)); - cmd.text(BTN_POS(3,5), BTN_SIZE(2,1), getLongestPrint_str(buffer)); - cmd.text(BTN_POS(3,6), BTN_SIZE(2,1), getFilamentUsed_str(buffer)); - } - - if (what & FOREGROUND) { - cmd.font(Theme::font_medium) - .colors(action_btn) - .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK)); - } -} - -bool StatisticsScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); return true; - default: return false; - } -} - -#endif // TOUCH_UI_FTDI_EVE && PRINTCOUNTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp deleted file mode 100644 index bc2cce2ff6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/********************* - * status_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) - -#include "screens.h" -#include "screen_data.h" - -#include "../archim2-flash/flash_storage.h" - -using namespace FTDI; -using namespace Theme; - -#ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 8 -#else - #define GRID_ROWS 8 -#endif - -void StatusScreen::draw_axis_position(draw_mode_t what) { - CommandProcessor cmd; - - #define GRID_COLS 3 - - if (what & BACKGROUND) { - cmd.tag(6) - #ifdef TOUCH_UI_PORTRAIT - .fgcolor(Theme::axis_label) - .font(Theme::font_large) - .button( BTN_POS(1,5), BTN_SIZE(2,1), F(""), OPT_FLAT) - .button( BTN_POS(1,6), BTN_SIZE(2,1), F(""), OPT_FLAT) - .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), GET_TEXT_F(MSG_AXIS_X)) - .text ( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y)) - .text ( BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z)) - - .font(Theme::font_medium) - .fgcolor(Theme::x_axis) .button( BTN_POS(2,5), BTN_SIZE(2,1), F(""), OPT_FLAT) - .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(2,1), F(""), OPT_FLAT) - .fgcolor(Theme::z_axis) .button( BTN_POS(2,7), BTN_SIZE(2,1), F(""), OPT_FLAT); - #else - .fgcolor(Theme::axis_label) - .font(Theme::font_large) - .button( BTN_POS(1,5), BTN_SIZE(1,2), F(""), OPT_FLAT) - .button( BTN_POS(2,5), BTN_SIZE(1,2), F(""), OPT_FLAT) - .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), GET_TEXT_F(MSG_AXIS_X)) - .text ( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y)) - .text ( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z)) - .font(Theme::font_medium) - - .fgcolor(Theme::x_axis) .button( BTN_POS(1,6), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(Theme::z_axis) .button( BTN_POS(3,6), BTN_SIZE(1,1), F(""), OPT_FLAT); - #endif - } - - if (what & FOREGROUND) { - using namespace ExtUI; - char x_str[15]; - char y_str[15]; - char z_str[15]; - - if (isAxisPositionKnown(X)) - format_position(x_str, getAxisPosition_mm(X)); - else - strcpy_P(x_str, PSTR("?")); - - if (isAxisPositionKnown(Y)) - format_position(y_str, getAxisPosition_mm(Y)); - else - strcpy_P(y_str, PSTR("?")); - - 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 - .text ( BTN_POS(2,5), BTN_SIZE(2,1), x_str) - .text ( BTN_POS(2,6), BTN_SIZE(2,1), y_str) - .text ( BTN_POS(2,7), BTN_SIZE(2,1), z_str); - #else - .text ( BTN_POS(1,6), BTN_SIZE(1,1), x_str) - .text ( BTN_POS(2,6), BTN_SIZE(1,1), y_str) - .text ( BTN_POS(3,6), BTN_SIZE(1,1), z_str); - #endif - } - - #undef GRID_COLS -} - -#ifdef TOUCH_UI_PORTRAIT - #define GRID_COLS 8 -#else - #define GRID_COLS 12 -#endif - -void StatusScreen::draw_temperature(draw_mode_t what) { - using namespace Theme; - - CommandProcessor cmd; - - if (what & BACKGROUND) { - cmd.font(Theme::font_small) - #ifdef TOUCH_UI_PORTRAIT - .tag(5) - .fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT) - .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT) - .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT) - .tag(0) - .fgcolor(progress) .button( BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT) - .button( BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT); - #else - .tag(5) - .fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT) - .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT) - .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT) - .tag(0) - .fgcolor(progress) .button( BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT) - .button( BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT); - #endif - - // Draw Extruder Bitmap on Extruder Temperature Button - - cmd.tag(5) - .cmd(BITMAP_SOURCE(Extruder_Icon_Info)) - .cmd(BITMAP_LAYOUT(Extruder_Icon_Info)) - .cmd(BITMAP_SIZE (Extruder_Icon_Info)) - .icon (BTN_POS(1,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale) - .icon (BTN_POS(5,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale); - - // Draw Bed Heat Bitmap on Bed Heat Button - cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) - .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) - .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) - .icon (BTN_POS(1,2), BTN_SIZE(1,1), Bed_Heat_Icon_Info, icon_scale); - - // Draw Fan Percent Bitmap on Bed Heat Button - - cmd.cmd(BITMAP_SOURCE(Fan_Icon_Info)) - .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[20]; - char e1_str[20]; - char bed_str[20]; - char fan_str[20]; - - sprintf_P( - fan_str, - PSTR("%-3d %%"), - int8_t(getActualFan_percent(FAN0)) - ); - - 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)); - - 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)); - - - #if EXTRUDERS == 2 - 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, - PSTR("-") - ); - #endif - - cmd.tag(5) - .font(font_medium) - .text(BTN_POS(2,1), BTN_SIZE(3,1), e0_str) - .text(BTN_POS(6,1), BTN_SIZE(3,1), e1_str) - .text(BTN_POS(2,2), BTN_SIZE(3,1), bed_str) - .text(BTN_POS(6,2), BTN_SIZE(3,1), fan_str); - } -} - -void StatusScreen::draw_progress(draw_mode_t what) { - using namespace ExtUI; - using namespace Theme; - - CommandProcessor cmd; - - if (what & BACKGROUND) { - cmd.tag(0).font(font_medium) - #ifdef TOUCH_UI_PORTRAIT - .fgcolor(progress) .button(BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT) - .button(BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT); - #else - .fgcolor(progress) .button(BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT) - .button(BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT); - #endif - } - - if (what & FOREGROUND) { - const uint32_t elapsed = getProgress_seconds_elapsed(); - const uint8_t hrs = elapsed/3600; - const uint8_t min = (elapsed/60)%60; - - char time_str[10]; - char progress_str[10]; - - sprintf_P(time_str, PSTR(" %02d : %02d"), hrs, min); - sprintf_P(progress_str, PSTR("%-3d %%"), getProgress_percent() ); - - cmd.font(font_medium) - #ifdef TOUCH_UI_PORTRAIT - .tag(0).text(BTN_POS(1,3), BTN_SIZE(4,1), time_str) - .text(BTN_POS(5,3), BTN_SIZE(4,1), progress_str); - #else - .tag(0).text(BTN_POS(9,1), BTN_SIZE(4,1), time_str) - .text(BTN_POS(9,2), BTN_SIZE(4,1), progress_str); - #endif - } -} - -#undef GRID_COLS - - -void StatusScreen::draw_interaction_buttons(draw_mode_t what) { - #define GRID_COLS 4 - if (what & FOREGROUND) { - using namespace ExtUI; - - const bool has_media = isMediaInserted() && !isPrintingFromMedia(); - - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(Theme::font_medium) - .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_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA) - ).colors(!has_media ? action_btn : normal_btn) - #ifdef TOUCH_UI_PORTRAIT - .tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_MENU)); - #else - .tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), GET_TEXT_F(MSG_BUTTON_MENU)); - #endif - } - #undef GRID_COLS -} - -void StatusScreen::draw_status_message(draw_mode_t what, const char* message) { - #define GRID_COLS 1 - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.fgcolor(Theme::status_msg) - .tag(0) - #ifdef TOUCH_UI_PORTRAIT - .button( BTN_POS(1,4), BTN_SIZE(1,1), F(""), OPT_FLAT); - #else - .button( BTN_POS(1,3), BTN_SIZE(1,2), F(""), OPT_FLAT); - #endif - - draw_text_box(cmd, - #ifdef TOUCH_UI_PORTRAIT - BTN_POS(1,4), BTN_SIZE(1,1), - #else - BTN_POS(1,3), BTN_SIZE(1,2), - #endif - message, OPT_CENTER, font_large); - } - #undef GRID_COLS -} - -void StatusScreen::setStatusMessage(progmem_str message) { - char buff[strlen_P((const char * const)message)+1]; - strcpy_P(buff, (const char * const) message); - setStatusMessage((const char *) buff); -} - -void StatusScreen::setStatusMessage(const char* message) { - CommandProcessor cmd; - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(Theme::bg_color)) - .cmd(CLEAR(true,true,true)); - - draw_temperature(BACKGROUND); - draw_progress(BACKGROUND); - draw_axis_position(BACKGROUND); - draw_status_message(BACKGROUND, message); - draw_interaction_buttons(BACKGROUND); - - storeBackground(); - - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("New status message: ", message); - #endif - - if (AT_SCREEN(StatusScreen)) { - current_screen.onRefresh(); - } -} - -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)); - CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); - 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)); - - // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 - load_utf8_data(base + UTF8_FONT_OFFSET); - #endif -} - -void StatusScreen::onStartup() { - UIFlashStorage::initialize(); -} - -void StatusScreen::onRedraw(draw_mode_t what) { - if (what & FOREGROUND) { - draw_temperature(FOREGROUND); - draw_progress(FOREGROUND); - draw_axis_position(FOREGROUND); - draw_interaction_buttons(FOREGROUND); - } -} - -void StatusScreen::onEntry() { - onRefresh(); -} - -void StatusScreen::onIdle() { - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); - refresh_timer.start(); - } - BaseScreen::onIdle(); -} - -bool StatusScreen::onTouchEnd(uint8_t tag) { - using namespace ExtUI; - - switch (tag) { - case 3: GOTO_SCREEN(FilesScreen); break; - case 4: - if (isPrinting()) { - GOTO_SCREEN(TuneMenu); - } else { - GOTO_SCREEN(MainMenu); - } - break; - case 5: GOTO_SCREEN(TemperatureScreen); break; - case 6: - if (!isPrinting()) { - GOTO_SCREEN(MoveAxisScreen); - } - break; - default: - return true; - } - // If a passcode is enabled, the LockScreen will prevent the - // user from proceeding. - LockScreen::check_passcode(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp deleted file mode 100644 index 9aa28aff39..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/************************************** - * stepper_bump_sensiivity_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); - w.heading( GET_TEXT_F(MSG_TMC_HOMING_THRS)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getTMCBumpSensitivity(X), - #if X_SENSORLESS - true - #else - false - #endif - ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getTMCBumpSensitivity(Y), - #if Y_SENSORLESS - true - #else - false - #endif - ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getTMCBumpSensitivity(Z), - #if Z_SENSORLESS - true - #else - false - #endif - ); - w.increments(); -} - -bool StepperBumpSensitivityScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(TMCBumpSensitivity, X ); break; - case 3: UI_INCREMENT(TMCBumpSensitivity, X ); break; - case 4: UI_DECREMENT(TMCBumpSensitivity, Y ); break; - case 5: UI_INCREMENT(TMCBumpSensitivity, Y ); break; - case 6: UI_DECREMENT(TMCBumpSensitivity, Z ); break; - case 7: UI_INCREMENT(TMCBumpSensitivity, Z ); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE && HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp deleted file mode 100644 index acc94684e0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/****************************** - * stepper_current_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void StepperCurrentScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0); - w.units(GET_TEXT_F(MSG_UNITS_MILLIAMP)); - w.heading( GET_TEXT_F(MSG_TMC_CURRENT)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisCurrent_mA(X) ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisCurrent_mA(Y) ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisCurrent_mA(Z) ); - #if EXTRUDERS == 1 - w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisCurrent_mA(E0) ); - #elif EXTRUDERS > 1 - w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisCurrent_mA(E0) ); - w.color(e_axis).adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisCurrent_mA(E1) ); - #if EXTRUDERS > 2 - w.color(e_axis).adjuster(12, GET_TEXT_F(MSG_AXIS_E3), getAxisCurrent_mA(E2) ); - #endif - #if EXTRUDERS > 3 - w.color(e_axis).adjuster(14, GET_TEXT_F(MSG_AXIS_E4), getAxisCurrent_mA(E3) ); - #endif - #endif - w.increments(); -} - -bool StepperCurrentScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisCurrent_mA, X ); break; - case 3: UI_INCREMENT(AxisCurrent_mA, X ); break; - case 4: UI_DECREMENT(AxisCurrent_mA, Y ); break; - case 5: UI_INCREMENT(AxisCurrent_mA, Y ); break; - case 6: UI_DECREMENT(AxisCurrent_mA, Z ); break; - case 7: UI_INCREMENT(AxisCurrent_mA, Z ); break; - case 8: UI_DECREMENT(AxisCurrent_mA, E0); break; - case 9: UI_INCREMENT(AxisCurrent_mA, E0); break; - #if EXTRUDERS > 1 - case 10: UI_DECREMENT(AxisCurrent_mA, E1); break; - case 11: UI_INCREMENT(AxisCurrent_mA, E1); break; - #endif - #if EXTRUDERS > 2 - case 12: UI_DECREMENT(AxisCurrent_mA, E2); break; - case 13: UI_INCREMENT(AxisCurrent_mA, E2); break; - #endif - #if EXTRUDERS > 3 - case 14: UI_DECREMENT(AxisCurrent_mA, E3); break; - case 15: UI_INCREMENT(AxisCurrent_mA, E3); break; - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp deleted file mode 100644 index f47707f965..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/******************** - * steps_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void StepsScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(0); - w.units(GET_TEXT_F(MSG_UNITS_STEP_MM)); - w.heading( GET_TEXT_F(MSG_STEPS_PER_MM)); - w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisSteps_per_mm(X) ); - w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisSteps_per_mm(Y) ); - w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisSteps_per_mm(Z) ); - #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisSteps_per_mm(E0) ); - #elif EXTRUDERS > 1 - w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisSteps_per_mm(E0) ); - w.color(e_axis) .adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisSteps_per_mm(E1) ); - #if EXTRUDERS > 2 - w.color(e_axis) .adjuster(12, GET_TEXT_F(MSG_AXIS_E3), getAxisSteps_per_mm(E2) ); - #endif - #if EXTRUDERS > 3 - w.color(e_axis) .adjuster(14, GET_TEXT_F(MSG_AXIS_E4), getAxisSteps_per_mm(E3) ); - #endif - #endif - w.increments(); -} - -bool StepsScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 2: UI_DECREMENT(AxisSteps_per_mm, X); break; - case 3: UI_INCREMENT(AxisSteps_per_mm, X); break; - case 4: UI_DECREMENT(AxisSteps_per_mm, Y); break; - case 5: UI_INCREMENT(AxisSteps_per_mm, Y); break; - case 6: UI_DECREMENT(AxisSteps_per_mm, Z); break; - case 7: UI_INCREMENT(AxisSteps_per_mm, Z); break; - case 8: UI_DECREMENT(AxisSteps_per_mm, E0); break; - case 9: UI_INCREMENT(AxisSteps_per_mm, E0); break; - #if EXTRUDERS > 1 - case 10: UI_DECREMENT(AxisSteps_per_mm, E1); break; - case 11: UI_INCREMENT(AxisSteps_per_mm, E1); break; - #endif - #if EXTRUDERS > 2 - case 12: UI_DECREMENT(AxisSteps_per_mm, E2); break; - case 13: UI_INCREMENT(AxisSteps_per_mm, E2); break; - #endif - #if EXTRUDERS > 3 - case 14: UI_DECREMENT(AxisSteps_per_mm, E3); break; - case 15: UI_INCREMENT(AxisSteps_per_mm, E3); break; - #endif - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp deleted file mode 100644 index b5e9263efa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/************************** - * stress_test_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) - -#include "screens.h" -#include "screen_data.h" - -#define STRESS_TEST_CHANGE_INTERVAL 6000 - -#define GRID_COLS 4 -#define GRID_ROWS 9 - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void StressTestScreen::drawDots(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { - CommandProcessor cmd; - for(uint8_t i = 0; i < 100; i++) { - cmd.cmd(BEGIN(POINTS)) - .cmd(POINT_SIZE(20*16)) - .cmd(COLOR_RGB(random(0xFFFFFF))) - .cmd(VERTEX2F((x + random(w)) * 16,(y + random(h)) * 16)); - } -} - -bool StressTestScreen::watchDogTestNow() { - return screen_data.StressTestScreen.next_watchdog_trigger && - ELAPSED(millis(), screen_data.StressTestScreen.next_watchdog_trigger); -} - -void StressTestScreen::onRedraw(draw_mode_t) { - using namespace ExtUI; - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), progmem_str(screen_data.StressTestScreen.message)); - - drawDots(BTN_POS(1,3), BTN_SIZE(4,4)); - - cmd.font(font_medium).enabled(!watchDogTestNow()).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), F("Exit")); -} - -bool StressTestScreen::onTouchEnd(uint8_t tag) { - CommandProcessor cmd; - switch (tag) { - case 1: - runTestOnBootup(false); - GOTO_SCREEN(StatusScreen); - break; - default: - return false; - } - return true; -} - -void StressTestScreen::runTestOnBootup(bool enable) { - // Use a magic value in passcode to indicate - // whether or not we need to re-run the test - // at startup. - LockScreen::set_hash(enable ? 0xDEAD : 0); - injectCommands_P(PSTR("M500")); -} - -void StressTestScreen::startupCheck() { - if (LockScreen::get_hash() == 0xDEAD) { - GOTO_SCREEN(StressTestScreen); - } -} - -void StressTestScreen::onEntry() { - screen_data.StressTestScreen.next_watchdog_trigger = millis() + 10000 + random(40000); - screen_data.StressTestScreen.message = PSTR("Test 1: Stress testing..."); - - // Turn off heaters. - setTargetTemp_celsius(0, E0); - setTargetTemp_celsius(0, E1); - setTargetTemp_celsius(0, BED); - - runTestOnBootup(true); -} - -void StressTestScreen::recursiveLockup() { - screen_data.StressTestScreen.message = PSTR("Test 2: Printer will restart."); - current_screen.onRefresh(); - recursiveLockup(); -} - -void StressTestScreen::iterativeLockup() { - screen_data.StressTestScreen.message = PSTR("Test 3: Printer will restart."); - for(;;) current_screen.onRefresh(); -} - -void StressTestScreen::onIdle() { - current_screen.onRefresh(); - reset_menu_timeout(); - - if (!commandsInQueue()) { - if (!isPositionKnown()) { - extern const char G28_STR[]; - injectCommands_P(G28_STR); - } else { - injectCommands_P(PSTR( - "G0 X100 Y100 Z100 F6000\n" - "T0\nG4 S1" - #if EXTRUDERS > 1 - "\nT1\nG4 S1" - #endif - "\nG0 X150 Y150 Z150" - )); - } - } - - if (refresh_timer.elapsed(STRESS_TEST_CHANGE_INTERVAL)) { - setTargetFan_percent(random(100),FAN0); - } - - if (watchDogTestNow()) { - if (random(2) % 2) - iterativeLockup(); - else - recursiveLockup(); - } - - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp deleted file mode 100644 index ca4fdad3ce..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/********************* - * 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(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -#define ROUND(val) uint16_t((val)+0.5) - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wno-format" - -/** - * 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(MSG_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(MSG_UNITS_C), GET_TEXT(MSG_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(MSG_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(MSG_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(MSG_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(MSG_UNITS_MM)); -} - -#pragma GCC diagnostic pop - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h deleted file mode 100644 index d6e26fb5cb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h +++ /dev/null @@ -1,29 +0,0 @@ -/******************* - * 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp deleted file mode 100644 index f969f47979..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/******************* - * boot_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; -using namespace ExtUI; - -void TemperatureScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - #if TOUCH_UI_LCD_TEMP_SCALING == 10 - w.precision(1) - #else - w.precision(0) - #endif - .color(temp).units(GET_TEXT_F(MSG_UNITS_C)); - w.heading(GET_TEXT_F(MSG_TEMPERATURE)); - w.button(30, GET_TEXT_F(MSG_COOLDOWN)); - #ifndef NO_TOOLHEAD_HEATER_GCODE - #if HOTENDS == 1 - w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); - #else - w.adjuster( 2, F(LCD_STR_E0), getTargetTemp_celsius(E0)); - w.adjuster( 4, F(LCD_STR_E1), getTargetTemp_celsius(E1)); - #if HOTENDS > 2 - w.adjuster( 6, F(LCD_STR_E2), getTargetTemp_celsius(E2)); - #endif - #if HOTENDS > 3 - w.adjuster( 8, F(LCD_STR_E3), getTargetTemp_celsius(E3)); - #endif - #endif - #endif - #if HAS_HEATED_BED - w.adjuster( 20, GET_TEXT_F(MSG_BED), getTargetTemp_celsius(BED)); - #endif - #if HAS_HEATED_CHAMBER - w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); - #endif - #if FAN_COUNT > 0 - w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); - w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); - #endif - w.increments(); -} - -bool TemperatureScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 20: UI_DECREMENT(TargetTemp_celsius, BED); break; - case 21: UI_INCREMENT(TargetTemp_celsius, BED); break; - case 22: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; - case 23: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; - #ifndef NO_TOOLHEAD_HEATER_GCODE - case 2: UI_DECREMENT(TargetTemp_celsius, E0); break; - case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; - #endif - #if HOTENDS > 1 - case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; - case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; - #endif - #if HOTENDS > 2 - case 6: UI_DECREMENT(TargetTemp_celsius, E2); break; - case 7: UI_INCREMENT(TargetTemp_celsius, E2); break; - #endif - #if HOTENDS > 3 - case 8: UI_DECREMENT(TargetTemp_celsius, E3); break; - 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; - #endif - case 30: - #define _HOTEND_OFF(N) setTargetTemp_celsius(0,E##N); - REPEAT(HOTENDS, _HOTEND_OFF); - #if HAS_HEATED_BED - setTargetTemp_celsius(0,BED); - #endif - #if HAS_HEATED_CHAMBER - setTargetTemp_celsius(0,CHAMBER); - #endif - #if FAN_COUNT > 0 - setTargetFan_percent(0,FAN0); - #endif - break; - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp deleted file mode 100644 index b6c5ecae3d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/******************************** - * touch_calibration_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -#define GRID_COLS 4 -#define GRID_ROWS 16 - -void TouchCalibrationScreen::onEntry() { - CommandProcessor cmd; - - BaseScreen::onEntry(); - - if (CLCD::is_touching()) { - // Ask the user to release the touch before starting, - // as otherwise the first calibration point could - // be misinterpreted. - cmd.cmd(CMD_DLSTART) - .cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)); - draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXT_F(MSG_TOUCH_CALIBRATION_START), OPT_CENTER, font_large); - cmd.cmd(DL::DL_DISPLAY) - .cmd(CMD_SWAP) - .execute(); - - while (CLCD::is_touching()) { - #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_MSG("Waiting for touch release"); - #endif - } - } - - // Force a refresh - cmd.cmd(CMD_DLSTART); - onRedraw(FOREGROUND); - cmd.cmd(DL::DL_DISPLAY); - cmd.execute(); -} - -void TouchCalibrationScreen::onRefresh() { - // Don't do the regular refresh, as this would - // cause the calibration be restarted on every - // touch. -} - -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)); - - draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXT_F(MSG_TOUCH_CALIBRATION_PROMPT), OPT_CENTER, font_large); - cmd.cmd(CMD_CALIBRATE); -} - -void TouchCalibrationScreen::onIdle() { - if (!CLCD::is_touching() && !CommandProcessor::is_processing()) { - GOTO_PREVIOUS(); - } -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp deleted file mode 100644 index 4d7477b300..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/****************************** - * touch_registers_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void TouchRegistersScreen::onRedraw(draw_mode_t) { - const uint32_t T_Transform_A = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_A); - const uint32_t T_Transform_B = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_B); - const uint32_t T_Transform_C = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_C); - const uint32_t T_Transform_D = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_D); - const uint32_t T_Transform_E = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_E); - const uint32_t T_Transform_F = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_F); - char b[20]; - - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); - - #define GRID_ROWS 7 - #define GRID_COLS 2 - cmd.tag(0) - .font(font_xsmall) - .fgcolor(transformA) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("TOUCH_XFORM_A")) - .fgcolor(transformB) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("TOUCH_XFORM_B")) - .fgcolor(transformC) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("TOUCH_XFORM_C")) - .fgcolor(transformD) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("TOUCH_XFORM_D")) - .fgcolor(transformE) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("TOUCH_XFORM_E")) - .fgcolor(transformF) .button( BTN_POS(1,6), BTN_SIZE(1,1), F("TOUCH_XFORM_F")) - - .fgcolor(transformVal).button( BTN_POS(2,1), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,2), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,3), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,4), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,5), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT); - - sprintf_P(b, PSTR("0x%08lX"), T_Transform_A); cmd.text( BTN_POS(2,1), BTN_SIZE(1,1), b); - sprintf_P(b, PSTR("0x%08lX"), T_Transform_B); cmd.text( BTN_POS(2,2), BTN_SIZE(1,1), b); - sprintf_P(b, PSTR("0x%08lX"), T_Transform_C); cmd.text( BTN_POS(2,3), BTN_SIZE(1,1), b); - sprintf_P(b, PSTR("0x%08lX"), T_Transform_D); cmd.text( BTN_POS(2,4), BTN_SIZE(1,1), b); - sprintf_P(b, PSTR("0x%08lX"), T_Transform_E); cmd.text( BTN_POS(2,5), BTN_SIZE(1,1), b); - sprintf_P(b, PSTR("0x%08lX"), T_Transform_F); cmd.text( BTN_POS(2,6), BTN_SIZE(1,1), b); - - cmd.colors(action_btn).font(font_medium) - .tag(1).button( BTN_POS(2,7), BTN_SIZE(1,1), F("Back")); - #undef GRID_COLS - #undef GRID_ROWS - } - - bool TouchRegistersScreen::onTouchEnd(uint8_t tag) { - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - default: - return false; - } - return true; - } - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp deleted file mode 100644 index 8b4f0942fb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/******************* - * tune_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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) - -#include "screens.h" - -using namespace FTDI; -using namespace Theme; - -void TuneMenu::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)); - } - - #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 8 - #define GRID_COLS 2 - #else - #define GRID_ROWS 4 - #define GRID_COLS 2 - #endif - - if (what & FOREGROUND) { - using namespace ExtUI; - - CommandProcessor cmd; - cmd.colors(normal_btn) - .font(font_medium) - #ifdef TOUCH_UI_PORTRAIT - .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE)) - .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) - .enabled( - #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) - .tag(9).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT)) - #if ENABLED(BABYSTEPPING) - .tag(4).enabled(1) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) - #else - .enabled( - #if HAS_BED_PROBE - 1 - #endif - ) - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - #endif - .tag(5).enabled(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(isPrintingFromMediaPaused() ? 7 : 6) - .enabled( - #if ENABLED(SDSUPPORT) - isPrintingFromMedia() - #endif - ) - .button( BTN_POS(1,6), BTN_SIZE(2,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) - .enabled( - #if ENABLED(SDSUPPORT) - isPrintingFromMedia() - #endif - ) - .tag(8) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_STOP_PRINT)) - .tag(1).colors(action_btn) - .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #else // TOUCH_UI_PORTRAIT - .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE)) - .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) - .enabled( - #if ENABLED(BABYSTEPPING) - isPrintingFromMedia() - #endif - ) - #if ENABLED(BABYSTEPPING) - .tag(4) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) - #else - .enabled( - #if HAS_BED_PROBE - isPrintingFromMedia() - #endif - ) - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - #endif - .tag(5).enabled(1) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(isPrintingFromMediaPaused() ? 7 : 6) - .enabled( - #if ENABLED(SDSUPPORT) - isPrintingFromMedia() - #endif - ) - .button( BTN_POS(1,3), BTN_SIZE(1,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) - .enabled( - #if ENABLED(SDSUPPORT) - isPrintingFromMedia() - #endif - ) - .tag(8). button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_STOP_PRINT)) - .enabled( - #if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - 1 - #endif - ) - .tag(9).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) - .tag(1).colors(action_btn) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); - #endif - } - #undef GRID_COLS - #undef GRID_ROWS -} - -bool TuneMenu::onTouchEnd(uint8_t tag) { - using namespace Theme; - using namespace ExtUI; - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - case 2: GOTO_SCREEN(TemperatureScreen); break; - case 3: GOTO_SCREEN(ChangeFilamentScreen); break; - case 4: - #if ENABLED(BABYSTEPPING) - GOTO_SCREEN(NudgeNozzleScreen); - #elif HAS_BED_PROBE - GOTO_SCREEN(ZOffsetScreen); - #endif - break; - case 5: GOTO_SCREEN(FeedratePercentScreen); break; - case 6: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::pausePrint(); GOTO_SCREEN(StatusScreen); break; - case 7: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::resumePrint(); GOTO_SCREEN(StatusScreen); break; - case 8: - GOTO_SCREEN(ConfirmAbortPrintDialogBox); - current_screen.forget(); - PUSH_SCREEN(StatusScreen); - break; - #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - case 9: GOTO_SCREEN(FilamentMenu); break; - #endif - default: - return false; - } - return true; -} - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp deleted file mode 100644 index b77cb5143e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/************************** - * widget_demo_screen.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" - -#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -uint16_t slider_val; -bool show_grid; - -void WidgetsScreen::onEntry() { - BaseScreen::onEntry(); - CLCD::turn_on_backlight(); - SoundPlayer::set_volume(255); -} - -void WidgetsScreen::onRedraw(draw_mode_t) { - using namespace ExtUI; - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - .tag(0); - - const uint16_t hrs = (slider_val*12/0xFFFFU); - const uint16_t m = (slider_val*12*60/0xFFFFU)%60; - const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60; - - #ifdef TOUCH_UI_PORTRAIT - #define GRID_COLS 3 - #define GRID_ROWS 8 - cmd.font(font_large) - .cmd(COLOR_RGB(bg_text_enabled)) - .text (BTN_POS(1,1), BTN_SIZE(3,1), F("Sample Widgets")) - .tag(0).text (BTN_POS(2,6), BTN_SIZE(1,1), F("Show grid:")) - .colors(ui_toggle) - .tag(2).dial (BTN_POS(1,2), BTN_SIZE(1,2), slider_val) - .tag(0).clock (BTN_POS(1,4), BTN_SIZE(1,2), hrs, m, s, 0) - .gauge (BTN_POS(1,6), BTN_SIZE(1,2), 5, 4, slider_val, 0xFFFFU) - .font(font_medium) - .colors(ui_slider) - .tag(4).slider (BTN_POS(2,3), BTN_SIZE(2,1), slider_val, 0xFFFFU) - .tag(5).progress (BTN_POS(2,4), BTN_SIZE(2,1), slider_val, 0xFFFFU) - .tag(6).scrollbar (BTN_POS(2,5), BTN_SIZE(2,1), slider_val, 1000, 0xFFFFU) - .font(font_small) - .colors(ui_toggle) - .tag(7).toggle (BTN_POS(3,6), BTN_SIZE(1,1), F("no\xFFyes"), show_grid) - .colors(normal_btn) - .font(font_medium) - .tag(1) - .button (BTN_POS(2, 8), BTN_SIZE(1,1), F("1")) - .button (BTN_POS(3, 8), BTN_SIZE(1,1), F("2")) - .colors(action_btn) - .button (BTN_POS(1, 8), BTN_SIZE(1,1), F("Back")); - #else - #define GRID_COLS 4 - #define GRID_ROWS 8 - - cmd.font(font_large) - .text (BTN_POS(1,1), BTN_SIZE(4,1), F("Sample Widgets")) - .tag(0).text (BTN_POS(3,6), BTN_SIZE(1,1), F("Show grid:")) - .colors(ui_toggle) - .tag(2).dial (BTN_POS(1,2), BTN_SIZE(1,3), slider_val) - .tag(3).dial (BTN_POS(1,5), BTN_SIZE(1,3), slider_val) - .tag(0).clock (BTN_POS(2,2), BTN_SIZE(1,3), hrs, m, s, 0) - .gauge (BTN_POS(2,5), BTN_SIZE(1,3), 5, 4, slider_val, 0xFFFFU) - .font(font_medium) - .colors(ui_slider) - .tag(4).slider (BTN_POS(3,3), BTN_SIZE(2,1), slider_val, 0xFFFFU) - .tag(5).progress (BTN_POS(3,4), BTN_SIZE(2,1), slider_val, 0xFFFFU) - .tag(6).scrollbar (BTN_POS(3,5), BTN_SIZE(2,1), slider_val, 1000, 0xFFFFU) - .font(font_small) - .colors(ui_toggle) - .tag(7).toggle (BTN_POS(4,6), BTN_SIZE(1,1), F("no\xFFyes"), show_grid) - .colors(normal_btn) - .font(font_medium) - .tag(1).button (BTN_POS(3, 8), BTN_SIZE(1,1), F("1")) - .button (BTN_POS(4, 8), BTN_SIZE(1,1), F("2")) - .colors(action_btn) - .button (BTN_POS(1, 8), BTN_SIZE(2,1), F("Back")); - #endif - - cmd.cmd(COLOR_RGB(bg_text_enabled)); - if (show_grid) DRAW_LAYOUT_GRID -} - -bool WidgetsScreen::onTouchStart(uint8_t tag) { - CommandProcessor cmd; - switch (tag) { - case 1: GOTO_PREVIOUS(); break; - #ifdef TOUCH_UI_PORTRAIT - case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break; - case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break; - case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break; - case 6: cmd.track_linear (BTN_POS(2,5), BTN_SIZE(2,1), 6).execute(); break; - #else - case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,3), 2).execute(); break; - case 3: cmd.track_circular (BTN_POS(1,5), BTN_SIZE(1,3), 3).execute(); break; - case 4: cmd.track_linear (BTN_POS(3,3), BTN_SIZE(2,1), 4).execute(); break; - case 5: cmd.track_linear (BTN_POS(3,4), BTN_SIZE(2,1), 5).execute(); break; - case 6: cmd.track_linear (BTN_POS(3,5), BTN_SIZE(2,1), 6).execute(); break; - #endif - case 7: show_grid = !show_grid; break; - default: - return false; - } - - return true; -} - -void WidgetsScreen::onIdle() { - if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { - refresh_timer.start(); - - uint16_t value; - CommandProcessor cmd; - switch (cmd.track_tag(value)) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - slider_val = value; break; - default: - return; - } - onRefresh(); - } - BaseScreen::onIdle(); -} - -#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_DEVELOPER_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp deleted file mode 100644 index 65a2ad0e8e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/*********************** - * z_offset_screen.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" - -#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_BED_PROBE - -#include "screens.h" - -using namespace FTDI; -using namespace ExtUI; -using namespace Theme; - -void ZOffsetScreen::onRedraw(draw_mode_t what) { - widgets_t w(what); - w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); - - w.heading( GET_TEXT_F(MSG_ZPROBE_ZOFFSET)); - w.color(z_axis).adjuster(4, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), getZOffset_mm()); - w.increments(); -} - -bool ZOffsetScreen::onTouchHeld(uint8_t tag) { - const float increment = getIncrement(); - switch (tag) { - case 4: UI_DECREMENT(ZOffset_mm); break; - case 5: UI_INCREMENT(ZOffset_mm); break; - default: - return false; - } - SaveSettingsDialogBox::settingsChanged(); - return true; -} - -#endif // TOUCH_UI_FTDI_EVE && HAS_BED_PROBE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h deleted file mode 100644 index 00952cfc5b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h +++ /dev/null @@ -1,183 +0,0 @@ -/************* - * bitmaps.h * - *************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -namespace Theme { - using namespace FTDI; - - constexpr PROGMEM bitmap_info_t Extruder_Icon_Info = { - .format = L1, - .linestride = 3, - .filter = BILINEAR, - .wrapx = BORDER, - .wrapy = BORDER, - .RAMG_offset = 8000, - .width = 24, - .height = 23, - }; - - constexpr PROGMEM unsigned char Extruder_Icon[] = { - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x3F, 0xFF, 0xFC, - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x7F, 0xFF, 0xFE, - 0x07, 0xFF, 0xE0, - 0x03, 0xFF, 0xC0, - 0x01, 0x81, 0x80, - 0x00, 0xC3, 0x00, - 0x00, 0x66, 0x00, - 0x00, 0x3C, 0x00, - 0x00, 0x3C, 0x00 - }; - - constexpr PROGMEM bitmap_info_t Bed_Heat_Icon_Info = { - .format = L1, - .linestride = 4, - .filter = BILINEAR, - .wrapx = BORDER, - .wrapy = BORDER, - .RAMG_offset = 8100, - .width = 32, - .height = 23, - }; - - constexpr PROGMEM unsigned char Bed_Heat_Icon[] = { - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xC0, 0x00, 0x00, 0x03, - 0xFF, 0xFF, 0xFF, 0xFF - }; - - constexpr PROGMEM bitmap_info_t Fan_Icon_Info = { - .format = L1, - .linestride = 4, - .filter = BILINEAR, - .wrapx = BORDER, - .wrapy = BORDER, - .RAMG_offset = 8300, - .width = 32, - .height = 32, - }; - - constexpr PROGMEM unsigned char Fan_Icon[] = { - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xF8, 0x00, 0x00, 0x1F, - 0xF0, 0x03, 0xF8, 0x0F, - 0xE0, 0x07, 0xF0, 0x07, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x07, 0xE0, 0x03, - 0xC0, 0x03, 0xC0, 0x03, - 0xD0, 0x00, 0x00, 0xC3, - 0xD8, 0x03, 0xC1, 0xE3, - 0xDF, 0xC7, 0xE3, 0xF3, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xCF, 0xC7, 0xE3, 0xFB, - 0xC7, 0x83, 0xC0, 0x1B, - 0xC3, 0x00, 0x00, 0x0B, - 0xC0, 0x03, 0xC0, 0x03, - 0xC0, 0x07, 0xE0, 0x03, - 0xC0, 0x07, 0xF0, 0x03, - 0xC0, 0x07, 0xF8, 0x03, - 0xC0, 0x07, 0xF8, 0x03, - 0xC0, 0x07, 0xF0, 0x03, - 0xE0, 0x0F, 0xE0, 0x07, - 0xF0, 0x1F, 0xC0, 0x0F, - 0xF8, 0x00, 0x00, 0x1F, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF - }; - - constexpr PROGMEM bitmap_info_t TD_Icon_Info = { - .format = L1, - .linestride = 7, - .filter = BILINEAR, - .wrapx = BORDER, - .wrapy = BORDER, - .RAMG_offset = 9000, - .width = 50, - .height = 20, - }; - - constexpr PROGMEM unsigned char TD_Icon[] = { - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, // Thumb Drive Widget - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 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_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h deleted file mode 100644 index 95494bbae8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h +++ /dev/null @@ -1,149 +0,0 @@ -/************ - * colors.h * - ************/ - -/**************************************************************************** - * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * - * Written By Marcio Teixeira 2019 - Cocoa Press * - * * - * 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 Theme { - #ifdef TOUCH_UI_LULZBOT_BIO - // The Lulzbot Bio uses the color PANTONE 2175C on the case silkscreen. - // This translates to HSL(208°, 100%, 39%) as an accent color on the GUI. - - constexpr int accent_hue = 208; - constexpr float accent_sat = 0.5; - - constexpr uint32_t logo_bg_rgb = 0xffffff; - constexpr uint32_t logo_fill_rgb = 0xffffff; - constexpr uint32_t logo_stroke_rgb = hsl_to_rgb(accent_hue, 1.0, 0.39); - #else - // The Lulzbot logo uses the color PANTONE 382c. - // This translates to HSL(68°, 68%, 52%) as an accent color on the GUI. - - constexpr int accent_hue = 68; - constexpr float accent_sat = 0.68; - - constexpr uint32_t logo_bg_rgb = hsl_to_rgb(accent_hue, 0.77, 0.64); - constexpr uint32_t logo_fill_rgb = hsl_to_rgb(accent_hue, 0.68, 0.52); // Lulzbot Green - constexpr uint32_t logo_stroke_rgb = 0x000000; - #endif - - // Shades of accent color - - #ifdef TOUCH_UI_COCOA_PRESS - constexpr uint32_t accent_color_1 = hsl_to_rgb(12.8,0.597,0.263); // Darkest - constexpr uint32_t accent_color_2 = hsl_to_rgb(12.8,0.597,0.263); - constexpr uint32_t accent_color_3 = hsl_to_rgb( 9.6,0.664,0.443); - constexpr uint32_t accent_color_4 = hsl_to_rgb(16.3,0.873,0.537); - constexpr uint32_t accent_color_5 = hsl_to_rgb(23.0,0.889,0.539); - constexpr uint32_t accent_color_6 = hsl_to_rgb(23.0,0.889,0.539); // Lightest - #else - constexpr uint32_t accent_color_1 = hsl_to_rgb(accent_hue, accent_sat, 0.26); // Darkest - constexpr uint32_t accent_color_2 = hsl_to_rgb(accent_hue, accent_sat, 0.39); - constexpr uint32_t accent_color_3 = hsl_to_rgb(accent_hue, accent_sat, 0.52); - constexpr uint32_t accent_color_4 = hsl_to_rgb(accent_hue, accent_sat, 0.65); - constexpr uint32_t accent_color_5 = hsl_to_rgb(accent_hue, accent_sat, 0.78); - constexpr uint32_t accent_color_6 = hsl_to_rgb(accent_hue, accent_sat, 0.91); // Lightest - #endif - - // Shades of gray - - constexpr float gray_sat = 0.14; - - constexpr uint32_t gray_color_1 = hsl_to_rgb(accent_hue, gray_sat, 0.26); // Darkest - constexpr uint32_t gray_color_2 = hsl_to_rgb(accent_hue, gray_sat, 0.39); - constexpr uint32_t gray_color_3 = hsl_to_rgb(accent_hue, gray_sat, 0.52); - constexpr uint32_t gray_color_4 = hsl_to_rgb(accent_hue, gray_sat, 0.65); - constexpr uint32_t gray_color_5 = hsl_to_rgb(accent_hue, gray_sat, 0.78); - constexpr uint32_t gray_color_6 = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest - - #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) - // Lulzbot TAZ Pro - constexpr uint32_t theme_darkest = gray_color_1; - constexpr uint32_t theme_dark = gray_color_2; - - constexpr uint32_t bg_color = theme_darkest; - constexpr uint32_t bg_text_disabled = theme_dark; - constexpr uint32_t bg_text_enabled = 0xFFFFFF; - constexpr uint32_t bg_normal = theme_darkest; - - constexpr uint32_t fg_normal = theme_dark; - constexpr uint32_t fg_action = accent_color_2; - constexpr uint32_t fg_disabled = theme_darkest; - #else - // Lulzbot Bio - constexpr uint32_t theme_darkest = accent_color_1; - constexpr uint32_t theme_dark = accent_color_4; - - constexpr uint32_t bg_color = 0xFFFFFF; - constexpr uint32_t bg_text_disabled = gray_color_1; - constexpr uint32_t bg_text_enabled = accent_color_1; - constexpr uint32_t bg_normal = accent_color_4; - - constexpr uint32_t fg_normal = accent_color_1; - constexpr uint32_t fg_action = accent_color_4; - constexpr uint32_t fg_disabled = gray_color_6; - - constexpr uint32_t shadow_rgb = gray_color_6; - constexpr uint32_t stroke_rgb = accent_color_1; - constexpr uint32_t fill_rgb = accent_color_3; - constexpr uint32_t syringe_rgb = accent_color_5; - #endif - - constexpr uint32_t x_axis = 0xFF0000; - constexpr uint32_t y_axis = 0x00BB00; - constexpr uint32_t z_axis = 0x0000BF; - constexpr uint32_t e_axis = gray_color_2; - constexpr uint32_t feedrate = gray_color_2; - constexpr uint32_t other = gray_color_2; - - // Status screen - constexpr uint32_t progress = gray_color_2; - constexpr uint32_t status_msg = gray_color_2; - constexpr uint32_t fan_speed = 0x377198; - constexpr uint32_t temp = 0x892c78; - constexpr uint32_t axis_label = gray_color_2; - - constexpr uint32_t disabled_icon = gray_color_1; - - // Calibration Registers Screen - constexpr uint32_t transformA = 0x3010D0; - constexpr uint32_t transformB = 0x4010D0; - constexpr uint32_t transformC = 0x5010D0; - constexpr uint32_t transformD = 0x6010D0; - constexpr uint32_t transformE = 0x7010D0; - constexpr uint32_t transformF = 0x8010D0; - constexpr uint32_t transformVal = 0x104010; - - constexpr btn_colors disabled_btn = {.bg = bg_color, .grad = fg_disabled, .fg = fg_disabled, .rgb = fg_disabled }; - constexpr btn_colors normal_btn = {.bg = fg_action, .grad = 0xFFFFFF, .fg = fg_normal, .rgb = 0xFFFFFF }; - constexpr btn_colors action_btn = {.bg = bg_color, .grad = 0xFFFFFF, .fg = fg_action, .rgb = 0xFFFFFF }; - constexpr btn_colors red_btn = {.bg = 0xFF5555, .grad = 0xFFFFFF, .fg = 0xFF0000, .rgb = 0xFFFFFF }; - constexpr btn_colors ui_slider = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = accent_color_3 }; - constexpr btn_colors ui_toggle = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = 0xFFFFFF }; - - // Temperature color scale - - const rgb_t cool_rgb ( 0, 0, 0); - const rgb_t low_rgb (128, 0, 0); - const rgb_t med_rgb (255, 128, 0); - const rgb_t high_rgb (255, 255, 128); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h deleted file mode 100644 index 3e5a985cc3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h +++ /dev/null @@ -1,80 +0,0 @@ -/*********** - * fonts.h * - ***********/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -namespace Theme { - #ifdef TOUCH_UI_800x480 - #ifdef TOUCH_UI_PORTRAIT - constexpr int16_t font_tiny = 26; - constexpr int16_t font_xsmall = 28; - constexpr int16_t font_small = 29; - constexpr int16_t font_medium = 30; - constexpr int16_t font_large = 30; - constexpr int16_t font_xlarge = 31; - #else - constexpr int16_t font_tiny = 27; - constexpr int16_t font_xsmall = 29; - constexpr int16_t font_small = 30; - constexpr int16_t font_medium = 30; - constexpr int16_t font_large = 31; - constexpr int16_t font_xlarge = 31; - #endif - constexpr float icon_scale = 1.0; - #elif defined(TOUCH_UI_480x272) - #ifdef TOUCH_UI_PORTRAIT - constexpr int16_t font_tiny = 26; - constexpr int16_t font_xsmall = 26; - constexpr int16_t font_small = 26; - constexpr int16_t font_medium = 27; - constexpr int16_t font_large = 28; - constexpr int16_t font_xlarge = 29; - constexpr float icon_scale = 0.7; - #else - constexpr int16_t font_tiny = 26; - constexpr int16_t font_xsmall = 26; - constexpr int16_t font_small = 27; - constexpr int16_t font_medium = 28; - constexpr int16_t font_large = 30; - constexpr int16_t font_xlarge = 31; - constexpr float icon_scale = 0.6; - #endif - #elif defined(TOUCH_UI_320x240) - #ifdef TOUCH_UI_PORTRAIT - constexpr int16_t font_tiny = 26; - constexpr int16_t font_xsmall = 26; - constexpr int16_t font_small = 26; - constexpr int16_t font_medium = 27; - constexpr int16_t font_large = 27; - constexpr int16_t font_xlarge = 28; - constexpr float icon_scale = 0.6; - #else - constexpr int16_t font_tiny = 26; - constexpr int16_t font_xsmall = 26; - constexpr int16_t font_small = 26; - constexpr int16_t font_medium = 27; - constexpr int16_t font_large = 29; - constexpr int16_t font_xlarge = 30; - constexpr float icon_scale = 0.5; - #endif - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h deleted file mode 100644 index 5e01f0471c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h +++ /dev/null @@ -1,39 +0,0 @@ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ - -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 480.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 272.000000; - -const PROGMEM uint16_t logo_fill[] = {0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0x419D, 0x546F}; - -const PROGMEM uint16_t logo_stroke[] = {0xADF3, 0x546C, 0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0xADF3, 0x546C, 0xFFFF, 0x419D, 0x5913, 0xB08C, 0x5913, 0xC794, 0x8250, 0xC794, 0x96B0, 0xC6DA, 0x9CFF, 0xC4E1, 0xA229, 0xC1F4, 0xA5A5, 0xBE60, 0xA6ED, 0x419D, 0xA6ED, 0x3E09, 0xA5A5, 0x3B1C, 0xA229, 0x3923, 0x9CFF, 0x3869, 0x96B0, 0x3869, 0x6950, 0x3923, 0x6301, 0x3B1C, 0x5DD7, 0x3E09, 0x5A5B, 0x419D, 0x5913, 0xFFFF, 0xAC7A, 0x8620, 0xAC7A, 0x9373, 0xA767, 0x9373, 0xA767, 0x75CB, 0xA1C6, 0x75CB, 0xA1C6, 0x9373, 0xA1C6, 0x9C8E, 0xA767, 0x9C8E, 0xAC7A, 0x9C8E, 0xB21C, 0x9C8E, 0xB21C, 0x9373, 0xB21C, 0x85E7, 0xB350, 0x8093, 0xB65F, 0x7E86, 0xB9D5, 0x8165, 0xBA83, 0x85E7, 0xBA83, 0x9C8E, 0xBEFE, 0x9C8E, 0xC024, 0x99E1, 0xC024, 0x8620, 0xBF7B, 0x7F22, 0xBD8F, 0x79A9, 0xBA7E, 0x7617, 0xB65F, 0x74D0, 0xB24F, 0x7622, 0xAF30, 0x79C6, 0xAD2F, 0x7F43, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xFFFF, 0x8179, 0x9C8E, 0x7CE9, 0x9C8E, 0x7747, 0x9C8E, 0x7747, 0x92EC, 0x7747, 0x8949, 0x75A2, 0x81A3, 0x71A6, 0x7E73, 0x6DAB, 0x818B, 0x6C05, 0x88FC, 0x6DAF, 0x9019, 0x71C7, 0x92EC, 0x7505, 0x92EC, 0x7505, 0x9C8E, 0x7118, 0x9C8E, 0x6CD3, 0x9B06, 0x696B, 0x96D6, 0x6729, 0x909E, 0x6658, 0x88FC, 0x672D, 0x8133, 0x6980, 0x7AC7, 0x6D13, 0x766C, 0x71A6, 0x74D0, 0x7632, 0x766D, 0x79C2, 0x7AD1, 0x7C14, 0x8153, 0x7CE9, 0x8949, 0x7CE9, 0x92EC, 0x8179, 0x92EC, 0x8179, 0x8620, 0x822E, 0x7F43, 0x842E, 0x79C6, 0x874E, 0x7622, 0x8B5E, 0x74D0, 0x8F7C, 0x7617, 0x928E, 0x79A9, 0x9479, 0x7F22, 0x9523, 0x8620, 0x9523, 0x87DB, 0x8F81, 0x87DB, 0x8F81, 0x85E7, 0x8ED4, 0x8165, 0x8B5E, 0x7E86, 0x884F, 0x8093, 0x871A, 0x85E7, 0x871A, 0x92EC, 0x871A, 0x9C8F, 0x8179, 0x9C8F, 0x8179, 0x9C8E, 0x8179, 0x9C8E, 0xFFFF, 0x6515, 0x79DB, 0x644C, 0x7281, 0x6218, 0x6C86, 0x5EB2, 0x6882, 0x5A56, 0x670A, 0x55D9, 0x68E0, 0x5272, 0x6DD0, 0x4F0B, 0x68E0, 0x4A8E, 0x670A, 0x4638, 0x6882, 0x42D5, 0x6C86, 0x40A2, 0x7281, 0x3FD9, 0x79DB, 0x3FD9, 0x9AC9, 0x40E4, 0x9C8E, 0x456F, 0x9C8E, 0x456F, 0x79B5, 0x46D4, 0x735D, 0x4A8E, 0x70C0, 0x4E3E, 0x735D, 0x4FA1, 0x79B5, 0x4FA1, 0x9C8E, 0x554D, 0x9C8E, 0x554D, 0x79B5, 0x56A7, 0x735D, 0x5A56, 0x70C0, 0x5E0C, 0x735D, 0x5F74, 0x79B5, 0x5F74, 0x9C8E, 0x6515, 0x9C8E, 0x6515, 0x79DB, 0x6515, 0x79DB, 0x6515, 0x79DB, 0xFFFF, 0x9672, 0x8C4C, 0x9714, 0x9379, 0x98F5, 0x98D2, 0x9C0B, 0x9BF4, 0xA04C, 0x9C7B, 0xA04C, 0x9373, 0x9D2B, 0x920C, 0x9C1E, 0x8C4C, 0x9C1E, 0x648E, 0x9672, 0x648E, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0xFFFF, 0xA767, 0x7194, 0xA767, 0x6C02, 0xA692, 0x687A, 0xA496, 0x670A, 0xA291, 0x687A, 0xA1BB, 0x6C02, 0xA1BB, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194}; - -#define LOGO_BACKGROUND logo_bg_rgb -#define LOGO_PAINT_PATHS \ - LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \ - LOGO_PAINT_PATH(logo_fill_rgb, logo_fill) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h deleted file mode 100644 index a5af7a14cd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h +++ /dev/null @@ -1,39 +0,0 @@ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ - -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 272.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 480.000000; - -const PROGMEM uint16_t logo_fill[] = {0x3C19, 0x70C5, 0x371A, 0x7159, 0x3302, 0x72EA, 0x303D, 0x753C, 0x2F39, 0x7811, 0x2F39, 0x87ED, 0x303D, 0x8AC2, 0x3302, 0x8D14, 0x371A, 0x8EA5, 0x3C19, 0x8F39, 0xC3E4, 0x8F39, 0xC8E3, 0x8EA5, 0xCCFB, 0x8D14, 0xCFC0, 0x8AC2, 0xD0C4, 0x87ED, 0xD0C0, 0x70C4, 0x3C19, 0x70C5}; - -const PROGMEM uint16_t logo_stroke[] = {0x3C19, 0x70C5, 0x371A, 0x7159, 0x3302, 0x72EA, 0x303D, 0x753C, 0x2F39, 0x7811, 0x2F39, 0x87ED, 0x303D, 0x8AC2, 0x3302, 0x8D14, 0x371A, 0x8EA5, 0x3C19, 0x8F39, 0xC3E4, 0x8F39, 0xC8E3, 0x8EA5, 0xCCFB, 0x8D14, 0xCFC0, 0x8AC2, 0xD0C4, 0x87ED, 0xD0C0, 0x70C4, 0x3C19, 0x70C5, 0xFFFF, 0x3C19, 0x7264, 0xB4D6, 0x7264, 0xCDE7, 0x80CE, 0xCDE7, 0x87ED, 0xCD1D, 0x8A21, 0xCAF7, 0x8BEF, 0xC7C8, 0x8D27, 0xC3E4, 0x8D9A, 0x3C19, 0x8D9A, 0x3835, 0x8D27, 0x3506, 0x8BEF, 0x32E0, 0x8A21, 0x3216, 0x87ED, 0x3216, 0x7811, 0x32E0, 0x75DD, 0x3506, 0x740F, 0x3835, 0x72D7, 0x3C19, 0x7264, 0xFFFF, 0xB069, 0x8223, 0xB069, 0x86CB, 0xAAE2, 0x86CB, 0xAAE2, 0x7C6E, 0xA4C2, 0x7C6E, 0xA4C2, 0x86CB, 0xA4C2, 0x89FA, 0xAAE2, 0x89FA, 0xB069, 0x89FA, 0xB689, 0x89FA, 0xB689, 0x86CB, 0xB689, 0x820F, 0xB7D9, 0x8033, 0xBB2E, 0x7F7B, 0xBEF2, 0x807C, 0xBFAE, 0x820F, 0xBFAE, 0x89FA, 0xC48F, 0x89FA, 0xC5CF, 0x890A, 0xC5CF, 0x8223, 0xC517, 0x7FB2, 0xC300, 0x7DC8, 0xBFA9, 0x7C88, 0xBB2E, 0x7C16, 0xB6C1, 0x7C8C, 0xB35B, 0x7DD2, 0xB12D, 0x7FBD, 0xB069, 0x8223, 0xB069, 0x8223, 0xB069, 0x8223, 0xFFFF, 0x819B, 0x89FA, 0x7CA3, 0x89FA, 0x7682, 0x89FA, 0x7682, 0x869C, 0x7682, 0x833E, 0x74B7, 0x8092, 0x7062, 0x7F74, 0x6C0C, 0x8089, 0x6A41, 0x8323, 0x6C10, 0x859F, 0x7085, 0x869C, 0x740C, 0x869C, 0x740C, 0x89FA, 0x6FC7, 0x89FA, 0x6B21, 0x8971, 0x676C, 0x87FA, 0x64F8, 0x85CE, 0x6414, 0x8323, 0x64FC, 0x806A, 0x6784, 0x7E2C, 0x6B67, 0x7CA6, 0x7062, 0x7C16, 0x7555, 0x7CA6, 0x7935, 0x7E2F, 0x7BBC, 0x8076, 0x7CA3, 0x833E, 0x7CA3, 0x869C, 0x819A, 0x869C, 0x819A, 0x8223, 0x825F, 0x7FBD, 0x848D, 0x7DD2, 0x87F3, 0x7C8C, 0x8C60, 0x7C16, 0x90DB, 0x7C88, 0x9432, 0x7DC8, 0x9648, 0x7FB2, 0x9701, 0x8223, 0x9701, 0x82BE, 0x90E0, 0x82BE, 0x90E0, 0x820F, 0x9024, 0x807C, 0x8C60, 0x7F7B, 0x890B, 0x8033, 0x87BB, 0x820F, 0x87BB, 0x869C, 0x87BB, 0x89FA, 0x819B, 0x89FA, 0x819B, 0x89FA, 0x819B, 0x89FA, 0xFFFF, 0x62B5, 0x7DD9, 0x61DA, 0x7B47, 0x5F73, 0x7931, 0x5BC1, 0x77C9, 0x5702, 0x7746, 0x521F, 0x77EA, 0x4E6B, 0x79A4, 0x4AB8, 0x77EA, 0x45D5, 0x7746, 0x411D, 0x77C9, 0x3D6E, 0x7931, 0x3B09, 0x7B47, 0x3A2E, 0x7DD9, 0x3A2E, 0x895C, 0x3B51, 0x89FA, 0x4043, 0x89FA, 0x4043, 0x7DCC, 0x41C6, 0x7B95, 0x45D5, 0x7AAB, 0x49D9, 0x7B95, 0x4B5B, 0x7DCC, 0x4B5B, 0x89FA, 0x5188, 0x89FA, 0x5188, 0x7DCC, 0x52FF, 0x7B95, 0x5702, 0x7AAB, 0x5B0C, 0x7B95, 0x5C94, 0x7DCC, 0x5C94, 0x89FA, 0x62B5, 0x89FA, 0x62B5, 0x7DD9, 0x62B5, 0x7DD9, 0x62B5, 0x7DD9, 0xFFFF, 0x986E, 0x844B, 0x991E, 0x86CD, 0x9B2A, 0x88AC, 0x9E85, 0x89C4, 0xA327, 0x89F3, 0xA327, 0x86CB, 0x9FBF, 0x864E, 0x9E9A, 0x844B, 0x9E9A, 0x7668, 0x986E, 0x7668, 0x986E, 0x844B, 0x986E, 0x844B, 0x986E, 0x844B, 0xFFFF, 0xAAE2, 0x7AF5, 0xAAE2, 0x7902, 0xA9FB, 0x77C7, 0xA7D2, 0x7746, 0xA59F, 0x77C7, 0xA4B6, 0x7902, 0xA4B6, 0x7AF5, 0xAAE2, 0x7AF5, 0xAAE2, 0x7AF5, 0xAAE2, 0x7AF5}; - -#define LOGO_BACKGROUND logo_bg_rgb -#define LOGO_PAINT_PATHS \ - LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \ - LOGO_PAINT_PATH(logo_fill_rgb, logo_fill) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp deleted file mode 100644 index e08373390f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/************** - * sounds.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 "../compat.h" - -#if ENABLED(TOUCH_UI_FTDI_EVE) - -#include "../ftdi_eve_lib/ftdi_eve_lib.h" - -#include "sounds.h" - -namespace Theme { - using namespace FTDI; - - const PROGMEM SoundPlayer::sound_t chimes[] = { - {CHIMES, NOTE_G3, 5}, - {CHIMES, NOTE_E4, 5}, - {CHIMES, NOTE_C4, 5}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t sad_trombone[] = { - {TRUMPET, NOTE_A3S, 10}, - {TRUMPET, NOTE_A3 , 10}, - {TRUMPET, NOTE_G3S, 10}, - {TRUMPET, NOTE_G3, 20}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t twinkle[] = { - {GLOCKENSPIEL, NOTE_C4, 1}, - {GLOCKENSPIEL, NOTE_E4, 1}, - {GLOCKENSPIEL, NOTE_G4, 16}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t fanfare[] = { - {TRUMPET, NOTE_A3, 4}, - {SILENCE, REST, 1}, - {TRUMPET, NOTE_A3, 2}, - {SILENCE, REST, 1}, - {TRUMPET, NOTE_A3, 2}, - {SILENCE, REST, 1}, - {TRUMPET, NOTE_E4, 10}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t media_inserted[] = { - {MUSIC_BOX, NOTE_C4, 2}, - {MUSIC_BOX, NOTE_E4, 2}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t media_removed[] = { - {MUSIC_BOX, NOTE_E4, 2}, - {MUSIC_BOX, NOTE_C4, 2}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t js_bach_toccata[] = { - {ORGAN, NOTE_A4, 2}, - {ORGAN, NOTE_G4, 2}, - {ORGAN, NOTE_A4, 35}, - {SILENCE, REST, 12}, - {ORGAN, NOTE_G4, 4}, - {ORGAN, NOTE_F4, 4}, - {ORGAN, NOTE_E4, 4}, - {ORGAN, NOTE_D4, 4}, - {ORGAN, NOTE_C4S, 16}, - {ORGAN, NOTE_D4, 32}, - {SILENCE, REST, 42}, - - {ORGAN, NOTE_A3, 2}, - {ORGAN, NOTE_G3, 2}, - {ORGAN, NOTE_A3, 35}, - {SILENCE, REST, 9}, - {ORGAN, NOTE_E3, 8}, - {ORGAN, NOTE_F3, 8}, - {ORGAN, NOTE_C3S, 16}, - {ORGAN, NOTE_D3, 27}, - {SILENCE, REST, 42}, - - {ORGAN, NOTE_A2, 2}, - {ORGAN, NOTE_G2, 2}, - {ORGAN, NOTE_A2, 35}, - {SILENCE, REST, 12}, - {ORGAN, NOTE_G2, 4}, - {ORGAN, NOTE_F2, 4}, - {ORGAN, NOTE_E2, 4}, - {ORGAN, NOTE_D2, 4}, - {ORGAN, NOTE_C2S, 16}, - {ORGAN, NOTE_D2, 32}, - {SILENCE, REST, 52}, - - //{ORGAN, NOTE_D1, 28}, - {ORGAN, NOTE_C3S, 9}, - {ORGAN, NOTE_E3, 9}, - {ORGAN, NOTE_G3, 9}, - {ORGAN, NOTE_A3S, 9}, - {ORGAN, NOTE_C4S, 9}, - {ORGAN, NOTE_E4, 9}, - {ORGAN, NOTE_D4, 20}, - {SILENCE, REST, 30}, - - {ORGAN, NOTE_C4S, 4}, - {ORGAN, NOTE_D4, 2}, - {ORGAN, NOTE_E4, 2}, - - {ORGAN, NOTE_C4S, 2}, - {ORGAN, NOTE_D4, 2}, - {ORGAN, NOTE_E4, 2}, - - {ORGAN, NOTE_C4S, 2}, - {ORGAN, NOTE_D4, 2}, - {ORGAN, NOTE_E4, 2}, - - {ORGAN, NOTE_C4S, 2}, - {ORGAN, NOTE_D4, 4}, - {ORGAN, NOTE_E4, 4}, - {ORGAN, NOTE_F4, 2}, - {ORGAN, NOTE_G4, 2}, - - {ORGAN, NOTE_E4, 2}, - {ORGAN, NOTE_F4, 2}, - {ORGAN, NOTE_G4, 2}, - - {ORGAN, NOTE_E4, 2}, - {ORGAN, NOTE_F4, 2}, - {ORGAN, NOTE_G4, 2}, - - {ORGAN, NOTE_E4, 2}, - {ORGAN, NOTE_F4, 4}, - {ORGAN, NOTE_G4, 4}, - {ORGAN, NOTE_A4, 2}, - {ORGAN, NOTE_A4S, 2}, - - {ORGAN, NOTE_G4, 2}, - {ORGAN, NOTE_A4, 2}, - {ORGAN, NOTE_A4S, 2}, - - {ORGAN, NOTE_G4, 2}, - {ORGAN, NOTE_A4, 2}, - {ORGAN, NOTE_A4S, 2}, - - {ORGAN, NOTE_G4, 2}, - {ORGAN, NOTE_A4, 4}, - {SILENCE, REST, 36}, - - - {ORGAN, NOTE_C5S, 4}, - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_E5, 2}, - - {ORGAN, NOTE_C5S, 2}, - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_E5, 2}, - - {ORGAN, NOTE_C5S, 2}, - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_E5, 2}, - - {ORGAN, NOTE_C5S, 2}, - {ORGAN, NOTE_D5, 4}, - {ORGAN, NOTE_E5, 4}, - {ORGAN, NOTE_F5, 2}, - {ORGAN, NOTE_G5, 2}, - - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_F5, 2}, - {ORGAN, NOTE_G5, 2}, - - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_F5, 2}, - {ORGAN, NOTE_G5, 2}, - - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_F5, 4}, - {ORGAN, NOTE_G5, 4}, - {ORGAN, NOTE_A5, 2}, - {ORGAN, NOTE_A5S, 2}, - - {ORGAN, NOTE_G5, 2}, - {ORGAN, NOTE_A5, 2}, - {ORGAN, NOTE_A5S, 2}, - - {ORGAN, NOTE_G5, 2}, - {ORGAN, NOTE_A5, 2}, - {ORGAN, NOTE_A5S, 2}, - - {ORGAN, NOTE_G5, 2}, - {ORGAN, NOTE_A5, 4}, - {SILENCE, REST, 32}, - - {ORGAN, NOTE_A5, 4}, - {ORGAN, NOTE_G5, 2}, - {ORGAN, NOTE_A5S, 2}, - - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_G5, 2}, - {ORGAN, NOTE_A5S, 2}, - - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_F5, 2}, - {ORGAN, NOTE_A5, 2}, - - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_F5, 2}, - {ORGAN, NOTE_G5, 2}, - - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_A5, 2}, - - {ORGAN, NOTE_C5, 2}, - {ORGAN, NOTE_E5, 2}, - {ORGAN, NOTE_A5, 2}, - - {ORGAN, NOTE_C5, 2}, - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_F5, 2}, - - {ORGAN, NOTE_A4S, 2}, - {ORGAN, NOTE_D5, 2}, - {ORGAN, NOTE_E5, 2}, - - {ORGAN, NOTE_A4S, 2}, - {ORGAN, NOTE_C5, 2}, - {ORGAN, NOTE_E5, 2}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t js_bach_joy[] = { - {PIANO, NOTE_G3, 4}, - {PIANO, NOTE_A3, 4}, - {PIANO, NOTE_B3, 4}, - {PIANO, NOTE_D4, 3}, - {SILENCE, REST, 1}, - - {PIANO, NOTE_C4, 3}, - {SILENCE, REST, 1}, - {PIANO, NOTE_C4, 4}, - {PIANO, NOTE_E4, 3}, - {SILENCE, REST, 1}, - {PIANO, NOTE_D4, 2}, - {SILENCE, REST, 2}, - - {PIANO, NOTE_D4, 4}, - {PIANO, NOTE_G4 , 3}, - {SILENCE, REST, 1}, - {PIANO, NOTE_F4S, 4}, - {PIANO, NOTE_G4, 4}, - - {PIANO, NOTE_D4, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_B3, 3}, - {SILENCE, REST, 1}, - {PIANO, NOTE_G3, 4}, - {PIANO, NOTE_A3, 2}, - {SILENCE, REST, 2}, - - {PIANO, NOTE_B3, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_C4, 4}, - {PIANO, NOTE_D4, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_E4, 2}, - {SILENCE, REST, 2}, - - {PIANO, NOTE_D4, 4}, - {PIANO, NOTE_C4, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_B3, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_A3, 4}, - - {PIANO, NOTE_B3, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_G3, 2}, - {SILENCE, REST, 2}, - {PIANO, NOTE_G3, 8}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t big_band[] = { - {XYLOPHONE, NOTE_F4, 3}, - {XYLOPHONE, NOTE_G4, 3}, - {XYLOPHONE, NOTE_F4, 3}, - {XYLOPHONE, NOTE_D4, 3}, - {XYLOPHONE, NOTE_A3S, 3}, - {SILENCE, REST, 3}, - - {TRUMPET, NOTE_F4, 3}, - {TRUMPET, NOTE_G4, 3}, - {TRUMPET, NOTE_F4, 3}, - {TRUMPET, NOTE_D4, 3}, - {TRUMPET, NOTE_A3S, 3}, - {SILENCE, REST, 3}, - - {TUBA, NOTE_A2S, 6}, - {TUBA, NOTE_A2S, 6}, - {TUBA, NOTE_A2S, 4}, - {TUBA, NOTE_A2S, 6}, - {TUBA, NOTE_A2S, 6}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t beats[] = { - {SILENCE, REST, 8}, - {NOTCH, NOTE_C4, 8}, - {KICKDRUM, NOTE_C4, 8}, - {HIHAT, NOTE_C4, 8}, - {COWBELL, NOTE_C4, 8}, - {SILENCE, REST, 8}, - {NOTCH, NOTE_C4, 8}, - {KICKDRUM, NOTE_C4, 8}, - {HIHAT, NOTE_C4, 8}, - {COWBELL, NOTE_C4, 8}, - {SILENCE, REST, 8}, - {NOTCH, NOTE_C4, 8}, - {KICKDRUM, NOTE_C4, 8}, - {HIHAT, NOTE_C4, 8}, - {COWBELL, NOTE_C4, 8}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t beeping[] = { - {BEEPING, NOTE_C4, 64}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t alarm[] = { - {ALARM, NOTE_C4, 64}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t warble[] = { - {WARBLE, NOTE_C4, 64}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t carousel[] = { - {CAROUSEL, NOTE_C4, 64}, - {SILENCE, END_SONG, 0} - }; - - const PROGMEM SoundPlayer::sound_t all_instruments[] = { - {HARP}, - {XYLOPHONE}, - {TUBA}, - {GLOCKENSPIEL}, - {ORGAN}, - {TRUMPET}, - {PIANO}, - {CHIMES}, - {MUSIC_BOX}, - {BELL}, - {CLICK}, - {SWITCH}, - {COWBELL}, - {NOTCH}, - {HIHAT}, - {KICKDRUM}, - {SWITCH}, - {POP}, - {CLACK}, - {CHACK}, - {SILENCE, END_SONG, 0} - }; -}; // namespace Theme - -#define N_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) - -const SoundList::list_t SoundList::list[] = { - {"Silence", FTDI::silence}, - {"Twinkle", Theme::twinkle}, - {"Chimes", Theme::chimes}, - {"Fanfare", Theme::fanfare}, - {"Sad Trombone", Theme::sad_trombone}, - {"Big Band", Theme::big_band}, - {"Beeping", Theme::beeping}, - {"Alarm", Theme::alarm}, - {"Warble", Theme::warble}, - {"Carousel", Theme::carousel}, - {"Beats", Theme::beats}, - {"Bach Joy", Theme::js_bach_joy}, - {"Bach Toccata", Theme::js_bach_toccata} -}; - -const uint8_t SoundList::n = N_ELEMENTS(SoundList::list); - -#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h deleted file mode 100644 index c728d0012f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h +++ /dev/null @@ -1,43 +0,0 @@ -/************ - * sounds.h * - ************/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -namespace Theme { - using namespace FTDI; - - extern const PROGMEM SoundPlayer::sound_t chimes[]; - extern const PROGMEM SoundPlayer::sound_t sad_trombone[]; - extern const PROGMEM SoundPlayer::sound_t twinkle[]; - extern const PROGMEM SoundPlayer::sound_t fanfare[]; - extern const PROGMEM SoundPlayer::sound_t media_inserted[]; - extern const PROGMEM SoundPlayer::sound_t media_removed[]; - extern const PROGMEM SoundPlayer::sound_t js_bach_toccata[]; - extern const PROGMEM SoundPlayer::sound_t js_bach_joy[]; - extern const PROGMEM SoundPlayer::sound_t big_band[]; - extern const PROGMEM SoundPlayer::sound_t beats[]; - extern const PROGMEM SoundPlayer::sound_t beeping[]; - extern const PROGMEM SoundPlayer::sound_t alarm[]; - extern const PROGMEM SoundPlayer::sound_t warble[]; - extern const PROGMEM SoundPlayer::sound_t carousel[]; - extern const PROGMEM SoundPlayer::sound_t all_instruments[]; -}; // namespace Theme diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h deleted file mode 100644 index 6a73a07163..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h +++ /dev/null @@ -1,28 +0,0 @@ -/*********** - * theme.h * - ***********/ - -/**************************************************************************** - * 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: . * - ****************************************************************************/ - -#pragma once - -#include "bitmaps.h" -#include "colors.h" -#include "fonts.h" -#include "sounds.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.cpp deleted file mode 100644 index 42e807b8bb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ /dev/null @@ -1,1102 +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 . - * - */ - -/************** - * ui_api.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 "../../inc/MarlinConfigPre.h" - -#if ENABLED(EXTENSIBLE_UI) - -#include "../ultralcd.h" -#include "../../gcode/queue.h" -#include "../../module/motion.h" -#include "../../module/planner.h" -#include "../../module/probe.h" -#include "../../module/temperature.h" -#include "../../module/printcounter.h" -#include "../../libs/duration_t.h" -#include "../../HAL/shared/Delay.h" - -#if ENABLED(PRINTCOUNTER) - #include "../../core/utility.h" - #include "../../libs/numtostr.h" -#endif - -#if EXTRUDERS > 1 - #include "../../module/tool_change.h" -#endif - -#if ENABLED(EMERGENCY_PARSER) - #include "../../feature/emergency_parser.h" -#endif - -#if ENABLED(SDSUPPORT) - #include "../../sd/cardreader.h" - #define IFSD(A,B) (A) -#else - #define IFSD(A,B) (B) -#endif - -#if HAS_TRINAMIC - #include "../../feature/tmc_util.h" - #include "../../module/stepper/indirection.h" -#endif - -#include "ui_api.h" - -#if ENABLED(BACKLASH_GCODE) - #include "../../feature/backlash.h" -#endif - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if HAS_FILAMENT_SENSOR - #include "../../feature/runout.h" -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) - #include "../../feature/caselight.h" -#endif - -#if ENABLED(BABYSTEPPING) - #include "../../feature/babystep.h" -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../../feature/host_actions.h" -#endif - -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 - * within an ISR (such as when the printer is killed). - * - * To keep proper time, must be called at least every 1s. - */ - uint32_t safe_millis() { - // Not killed? Just call millis() - if (!flags.printer_killed) return millis(); - - static uint32_t currTimeHI = 0; /* Current time */ - - // Machine was killed, reinit SysTick so we are able to compute time without ISRs - if (currTimeHI == 0) { - // Get the last time the Arduino time computed (from CMSIS) and convert it to SysTick - currTimeHI = (uint32_t)((GetTickCount() * (uint64_t)(F_CPU / 8000)) >> 24); - - // Reinit the SysTick timer to maximize its period - SysTick->LOAD = SysTick_LOAD_RELOAD_Msk; // get the full range for the systick timer - SysTick->VAL = 0; // Load the SysTick Counter Value - SysTick->CTRL = // MCLK/8 as source - // No interrupts - SysTick_CTRL_ENABLE_Msk; // Enable SysTick Timer - } - - // Check if there was a timer overflow from the last read - if (SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) { - // There was. This means (SysTick_LOAD_RELOAD_Msk * 1000 * 8)/F_CPU ms has elapsed - currTimeHI++; - } - - // Calculate current time in milliseconds - uint32_t currTimeLO = SysTick_LOAD_RELOAD_Msk - SysTick->VAL; // (in MCLK/8) - uint64_t currTime = ((uint64_t)currTimeLO) | (((uint64_t)currTimeHI) << 24); - - // The ms count is - return (uint32_t)(currTime / (F_CPU / 8000)); - } - #endif // __SAM3X8E__ - - void delay_us(unsigned long us) { DELAY_US(us); } - - void delay_ms(unsigned long ms) { - if (flags.printer_killed) - DELAY_US(ms * 1000); - else - safe_delay(ms); - } - - void yield() { - if (!flags.printer_killed) - thermalManager.manage_heater(); - } - - void enableHeater(const extruder_t extruder) { - #if HOTENDS && HEATER_IDLE_HANDLER - thermalManager.reset_heater_idle_timer(extruder - E0); - #else - UNUSED(extruder); - #endif - } - - void enableHeater(const heater_t heater) { - #if HEATER_IDLE_HANDLER - switch (heater) { - #if HAS_HEATED_BED - case BED: - thermalManager.reset_bed_idle_timer(); - return; - #endif - #if HAS_HEATED_CHAMBER - case CHAMBER: return; // Chamber has no idle timer - #endif - 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(const xyz_float_t &dir) { - // 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 = dir; - flags.jogging = !NEAR_ZERO(dir.x) || !NEAR_ZERO(dir.y) || !NEAR_ZERO(dir.z); - } - - // Called by the polling routine in "joystick.cpp" - void _joystick_update(xyz_float_t &norm_jog) { - if (flags.jogging) { - #define OUT_OF_RANGE(VALUE) (VALUE < -1.0f || VALUE > 1.0f) - - if (OUT_OF_RANGE(destination.x) || OUT_OF_RANGE(destination.y) || OUT_OF_RANGE(destination.z)) { - // 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 = destination; - } - } - #endif - - bool isHeaterIdle(const extruder_t extruder) { - return false - #if HOTENDS && HEATER_IDLE_HANDLER - || thermalManager.hotend_idle[extruder - E0].timed_out - #else - ; UNUSED(extruder) - #endif - ; - } - - bool isHeaterIdle(const heater_t heater) { - #if HEATER_IDLE_HANDLER - switch (heater) { - #if HAS_HEATED_BED - case BED: return thermalManager.bed_idle.timed_out; - #endif - #if HAS_HEATED_CHAMBER - case CHAMBER: return false; // Chamber has no idle timer - #endif - default: - #if HOTENDS - return thermalManager.hotend_idle[heater - H0].timed_out; - #else - return false; - #endif - } - #else - UNUSED(heater); - return false; - #endif - } - - #ifdef TOUCH_UI_LCD_TEMP_SCALING - #define GET_TEMP_ADJUSTMENT(A) float(A)/TOUCH_UI_LCD_TEMP_SCALING - #else - #define GET_TEMP_ADJUSTMENT(A) A - #endif - - float getActualTemp_celsius(const heater_t heater) { - switch (heater) { - #if HAS_HEATED_BED - case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed()); - #endif - #if HAS_HEATED_CHAMBER - case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber()); - #endif - default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0)); - } - } - - float getActualTemp_celsius(const extruder_t extruder) { - return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(extruder - E0)); - } - - float getTargetTemp_celsius(const heater_t heater) { - switch (heater) { - #if HAS_HEATED_BED - case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed()); - #endif - #if HAS_HEATED_CHAMBER - case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber()); - #endif - default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0)); - } - } - - float getTargetTemp_celsius(const extruder_t extruder) { - return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(extruder - E0)); - } - - float getTargetFan_percent(const fan_t fan) { - #if FAN_COUNT > 0 - return thermalManager.fanPercent(thermalManager.fan_speed[fan - FAN0]); - #else - UNUSED(fan); - return 0; - #endif - } - - float getActualFan_percent(const fan_t fan) { - #if FAN_COUNT > 0 - return thermalManager.fanPercent(thermalManager.scaledFanSpeed(fan - FAN0)); - #else - UNUSED(fan); - return 0; - #endif - } - - float getAxisPosition_mm(const axis_t 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 epos = ( - #if ENABLED(JOYSTICK) - flags.jogging ? destination.e : - #endif - current_position.e - ); - setActiveTool(old_tool, true); - return epos; - } - - void setAxisPosition_mm(const float position, const axis_t axis) { - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if HAS_SOFTWARE_ENDSTOPS - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop.min.x; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop.max.x; - #endif - break; - case Y_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop.min.y; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop.max.y; - #endif - break; - case Z_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop.min.z; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop.max.z; - #endif - default: break; - } - #endif // HAS_SOFTWARE_ENDSTOPS - - // Delta limits XY based on the current offset from center - // This assumes the center is 0,0 - #if ENABLED(DELTA) - if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis - min = -max; - } - #endif - - 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); - - current_position.e = position; - line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.e)); - } - - void setActiveTool(const extruder_t extruder, bool no_move) { - #if EXTRUDERS > 1 - const uint8_t e = extruder - E0; - if (e != active_extruder) tool_change(e, no_move); - active_extruder = e; - #else - UNUSED(extruder); - UNUSED(no_move); - #endif - } - - extruder_t getActiveTool() { - switch (active_extruder) { - case 5: return E5; - case 4: return E4; - case 3: return E3; - case 2: return E2; - case 1: return E1; - default: return E0; - } - } - - bool isMoving() { return planner.has_blocks_queued(); } - - bool canMove(const axis_t axis) { - switch (axis) { - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - case X: return TEST(axis_homed, X_AXIS); - case Y: return TEST(axis_homed, Y_AXIS); - case Z: return TEST(axis_homed, Z_AXIS); - #else - case X: case Y: case Z: return true; - #endif - default: return false; - } - } - - bool canMove(const extruder_t extruder) { - return !thermalManager.tooColdToExtrude(extruder - E0); - } - - #if HAS_SOFTWARE_ENDSTOPS - bool getSoftEndstopState() { return soft_endstops_enabled; } - void setSoftEndstopState(const bool value) { soft_endstops_enabled = value; } - #endif - - #if HAS_TRINAMIC - float getAxisCurrent_mA(const axis_t axis) { - switch (axis) { - #if AXIS_IS_TMC(X) - case X: return stepperX.getMilliamps(); - #endif - #if AXIS_IS_TMC(Y) - case Y: return stepperY.getMilliamps(); - #endif - #if AXIS_IS_TMC(Z) - case Z: return stepperZ.getMilliamps(); - #endif - default: return NAN; - }; - } - - float getAxisCurrent_mA(const extruder_t extruder) { - switch (extruder) { - #if AXIS_IS_TMC(E0) - case E0: return stepperE0.getMilliamps(); - #endif - #if AXIS_IS_TMC(E1) - case E1: return stepperE1.getMilliamps(); - #endif - #if AXIS_IS_TMC(E2) - case E2: return stepperE2.getMilliamps(); - #endif - #if AXIS_IS_TMC(E3) - case E3: return stepperE3.getMilliamps(); - #endif - #if AXIS_IS_TMC(E4) - case E4: return stepperE4.getMilliamps(); - #endif - #if AXIS_IS_TMC(E5) - case E5: return stepperE5.getMilliamps(); - #endif - default: return NAN; - }; - } - - void setAxisCurrent_mA(const float mA, const axis_t axis) { - switch (axis) { - #if AXIS_IS_TMC(X) - case X: stepperX.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(Y) - case Y: stepperY.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(Z) - case Z: stepperZ.rms_current(constrain(mA, 500, 1500)); break; - #endif - default: break; - }; - } - - void setAxisCurrent_mA(const float mA, const extruder_t extruder) { - switch (extruder) { - #if AXIS_IS_TMC(E0) - case E0: stepperE0.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(E1) - case E1: stepperE1.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(E2) - case E2: stepperE2.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(E3) - case E3: stepperE3.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(E4) - case E4: stepperE4.rms_current(constrain(mA, 500, 1500)); break; - #endif - #if AXIS_IS_TMC(E5) - case E5: stepperE5.rms_current(constrain(mA, 500, 1500)); break; - #endif - default: break; - }; - } - - int getTMCBumpSensitivity(const axis_t axis) { - switch (axis) { - #if X_SENSORLESS - case X: return stepperX.homing_threshold(); - #endif - #if Y_SENSORLESS - case Y: return stepperY.homing_threshold(); - #endif - #if Z_SENSORLESS - case Z: return stepperZ.homing_threshold(); - #endif - default: return 0; - } - } - - void setTMCBumpSensitivity(const float value, const axis_t axis) { - switch (axis) { - #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS - #if X_SENSORLESS - case X: stepperX.homing_threshold(value); break; - #endif - #if Y_SENSORLESS - case Y: stepperY.homing_threshold(value); break; - #endif - #if Z_SENSORLESS - case Z: stepperZ.homing_threshold(value); break; - #endif - #else - UNUSED(value); - #endif - default: break; - } - } - #endif - - float getAxisSteps_per_mm(const axis_t axis) { - return planner.settings.axis_steps_per_mm[axis]; - } - - float getAxisSteps_per_mm(const extruder_t extruder) { - UNUSED_E(extruder); - return planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)]; - } - - void setAxisSteps_per_mm(const float value, const axis_t axis) { - planner.settings.axis_steps_per_mm[axis] = value; - } - - void setAxisSteps_per_mm(const float value, const extruder_t extruder) { - UNUSED_E(extruder); - planner.settings.axis_steps_per_mm[E_AXIS_N(axis - E0)] = value; - } - - feedRate_t getAxisMaxFeedrate_mm_s(const axis_t axis) { - return planner.settings.max_feedrate_mm_s[axis]; - } - - 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 feedRate_t value, const axis_t axis) { - planner.set_max_feedrate(axis, value); - } - - void setAxisMaxFeedrate_mm_s(const feedRate_t value, const extruder_t extruder) { - UNUSED_E(extruder); - planner.set_max_feedrate(E_AXIS_N(extruder - E0), value); - } - - float getAxisMaxAcceleration_mm_s2(const axis_t axis) { - return planner.settings.max_acceleration_mm_per_s2[axis]; - } - - float getAxisMaxAcceleration_mm_s2(const extruder_t extruder) { - UNUSED_E(extruder); - return planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)]; - } - - void setAxisMaxAcceleration_mm_s2(const float value, const axis_t axis) { - planner.set_max_acceleration(axis, value); - } - - void setAxisMaxAcceleration_mm_s2(const float value, const extruder_t extruder) { - UNUSED_E(extruder); - planner.set_max_acceleration(E_AXIS_N(extruder - E0), value); - } - - #if HAS_FILAMENT_SENSOR - bool getFilamentRunoutEnabled() { return runout.enabled; } - void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; } - - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - float getFilamentRunoutDistance_mm() { return runout.runout_distance(); } - void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(constrain(value, 0, 999)); } - #endif - #endif - - #if HAS_CASE_LIGHT - bool getCaseLightState() { return case_light_on; } - void setCaseLightState(const bool value) { - case_light_on = value; - update_case_light(); - } - - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - float getCaseLightBrightness_percent() { return ui8_to_percent(case_light_brightness); } - void setCaseLightBrightness_percent(const float value) { - case_light_brightness = map(constrain(value, 0, 100), 0, 100, 0, 255); - update_case_light(); - } - #endif - #endif - - #if ENABLED(LIN_ADVANCE) - float getLinearAdvance_mm_mm_s(const extruder_t extruder) { - return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0; - } - - void setLinearAdvance_mm_mm_s(const float value, const extruder_t extruder) { - if (extruder < EXTRUDERS) - planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 999); - } - #endif - - #if DISABLED(CLASSIC_JERK) - - float getJunctionDeviation_mm() { - return planner.junction_deviation_mm; - } - - void setJunctionDeviation_mm(const float value) { - planner.junction_deviation_mm = constrain(value, 0.01, 0.3); - #if ENABLED(LIN_ADVANCE) - planner.recalculate_max_e_jerk(); - #endif - } - - #else - - float getAxisMaxJerk_mm_s(const axis_t axis) { - return planner.max_jerk[axis]; - } - - float getAxisMaxJerk_mm_s(const extruder_t) { - return planner.max_jerk.e; - } - - void setAxisMaxJerk_mm_s(const float value, const axis_t axis) { - planner.set_max_jerk((AxisEnum)axis, value); - } - - void setAxisMaxJerk_mm_s(const float value, const extruder_t) { - planner.set_max_jerk(E_AXIS, value); - } - #endif - - feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; } - int16_t getFlowPercentage(const extruder_t extr) { return planner.flow_percentage[extr]; } - 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 feedRate_t fr) { feedrate_mm_s = fr; } - void setFlow_percent(const int16_t flow, const extruder_t extr) { - planner.flow_percentage[extr] = flow; - planner.refresh_e_factor(extr); - } - 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; } - - #if ENABLED(BABYSTEPPING) - bool babystepAxis_steps(const int16_t steps, const axis_t axis) { - switch (axis) { - #if ENABLED(BABYSTEP_XY) - case X: babystep.add_steps(X_AXIS, steps); break; - case Y: babystep.add_steps(Y_AXIS, steps); break; - #endif - case Z: babystep.add_steps(Z_AXIS, steps); break; - default: return false; - }; - return true; - } - - /** - * This function adjusts an axis during a print. - * - * When linked_nozzles is false, each nozzle in a multi-nozzle - * printer can be babystepped independently of the others. This - * lets the user to fine tune the Z-offset and Nozzle Offsets - * while observing the first layer of a print, regardless of - * what nozzle is printing. - */ - void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles) { - const float mm = steps * planner.steps_to_mm[axis]; - - if (!babystepAxis_steps(steps, axis)) return; - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - // Make it so babystepping in Z adjusts the Z probe offset. - if (axis == Z - #if EXTRUDERS > 1 - && (linked_nozzles || active_extruder == 0) - #endif - ) probe_offset.z += mm; - #else - UNUSED(mm); - #endif - - #if EXTRUDERS > 1 && HAS_HOTEND_OFFSET - /** - * When linked_nozzles is false, as an axis is babystepped - * adjust the hotend offsets so that the other nozzles are - * unaffected by the babystepping of the active nozzle. - */ - if (!linked_nozzles) { - HOTEND_LOOP() - if (e != active_extruder) - hotend_offset[e][axis] += mm; - - normalizeNozzleOffset(X); - normalizeNozzleOffset(Y); - normalizeNozzleOffset(Z); - } - #else - UNUSED(linked_nozzles); - UNUSED(mm); - #endif - } - - /** - * Converts a mm displacement to a number of whole number of - * steps that is at least mm long. - */ - int16_t mmToWholeSteps(const float mm, const axis_t axis) { - const float steps = mm / planner.steps_to_mm[axis]; - return steps > 0 ? ceil(steps) : floor(steps); - } - #endif - - float getZOffset_mm() { - #if HAS_BED_PROBE - return probe_offset.z; - #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) - return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; - #else - return 0.0; - #endif - } - - void setZOffset_mm(const float value) { - #if HAS_BED_PROBE - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) - probe_offset.z = value; - #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) - babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1])); - #else - UNUSED(value); - #endif - } - - #if HAS_HOTEND_OFFSET - - float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) { - if (extruder - E0 >= HOTENDS) return 0; - return hotend_offset[extruder - E0][axis]; - } - - void setNozzleOffset_mm(const float value, const axis_t axis, const extruder_t extruder) { - if (extruder - E0 >= HOTENDS) return; - hotend_offset[extruder - E0][axis] = value; - } - - /** - * The UI should call this if needs to guarantee the first - * nozzle offset is zero (such as when it doesn't allow the - * user to edit the offset the first nozzle). - */ - void normalizeNozzleOffset(const axis_t axis) { - const float offs = hotend_offset[0][axis]; - HOTEND_LOOP() hotend_offset[e][axis] -= offs; - } - - #endif // HAS_HOTEND_OFFSET - - #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] = constrain(value,0,5); } - - float getBacklashCorrection_percent() { return ui8_to_percent(backlash.correction); } - 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 = constrain(value, 0, 999); } - #endif - #endif - - uint8_t getProgress_percent() { - return ui.get_progress_percent(); - } - - uint32_t getProgress_seconds_elapsed() { - const duration_t elapsed = print_job_timer.duration(); - return elapsed.value; - } - - #if HAS_LEVELING - bool getLevelingActive() { return planner.leveling_active; } - 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; } - float getMeshPoint(const xy_uint8_t &pos) { return Z_VALUES(pos.x, pos.y); } - void setMeshPoint(const xy_uint8_t &pos, const float zoff) { - if (WITHIN(pos.x, 0, GRID_MAX_POINTS_X) && WITHIN(pos.y, 0, GRID_MAX_POINTS_Y)) { - Z_VALUES(pos.x, pos.y) = zoff; - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - bed_level_virt_interpolate(); - #endif - } - } - #endif - #endif - - #if ENABLED(HOST_PROMPT_SUPPORT) - void setHostResponse(const uint8_t response) { host_response_handler(response); } - #endif - - #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]) { 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); - return buffer; - } - #endif - - float getFeedrate_percent() { return feedrate_percentage; } - - void injectCommands_P(PGM_P const gcode) { - queue.inject_P(gcode); - } - - bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); } - - bool isAxisPositionKnown(const axis_t axis) { - return TEST(axis_known_position, axis); - } - - bool isAxisPositionKnown(const extruder_t) { - return TEST(axis_known_position, E_AXIS); - } - - bool isPositionKnown() { return all_axes_known(); } - bool isMachineHomed() { return all_axes_homed(); } - - PGM_P getFirmwareName_str() { - static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION; - return firmware_name; - } - - void setTargetTemp_celsius(float value, const heater_t heater) { - #ifdef TOUCH_UI_LCD_TEMP_SCALING - value *= TOUCH_UI_LCD_TEMP_SCALING; - #endif - enableHeater(heater); - #if HAS_HEATED_CHAMBER - if (heater == CHAMBER) - thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10))); - else - #endif - #if HAS_HEATED_BED - if (heater == BED) - thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAXTEMP - 10))); - else - #endif - { - #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, HEATER_5_MAXTEMP); - const int16_t e = heater - H0; - thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); - #endif - } - } - - void setTargetTemp_celsius(float value, const extruder_t extruder) { - #ifdef TOUCH_UI_LCD_TEMP_SCALING - value *= TOUCH_UI_LCD_TEMP_SCALING; - #endif - #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, HEATER_5_MAXTEMP); - const int16_t e = extruder - E0; - enableHeater(extruder); - thermalManager.setTargetHotend(LROUND(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(constrain(value, 0, 100), 0, 100, 0, 255)); - #else - UNUSED(value); - UNUSED(fan); - #endif - } - - void setFeedrate_percent(const float value) { - feedrate_percentage = constrain(value, 10, 500); - } - - void setUserConfirmed() { - #if HAS_RESUME_CONTINUE - wait_for_user = false; - #endif - } - - void printFile(const char *filename) { - UNUSED(filename); - IFSD(card.openAndPrintFile(filename), NOOP); - } - - bool isPrintingFromMediaPaused() { - return IFSD(isPrintingFromMedia() && !IS_SD_PRINTING(), false); - } - - bool isPrintingFromMedia() { - return IFSD(card.isFileOpen(), false); - } - - bool isPrinting() { - return (planner.movesplanned() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)); - } - - bool isMediaInserted() { - return IFSD(IS_SD_INSERTED() && card.isMounted(), false); - } - - void pausePrint() { - ui.pause_print(); - } - - void resumePrint() { - ui.resume_print(); - } - - void stopPrint() { - ui.abort_print(); - } - - void onUserConfirmRequired_P(PGM_P const pstr) { - char msg[strlen_P(pstr) + 1]; - strcpy_P(msg, pstr); - onUserConfirmRequired(msg); - } - - FileList::FileList() { refresh(); } - - void FileList::refresh() { num_files = 0xFFFF; } - - bool FileList::seek(const uint16_t pos, const bool skip_range_check) { - #if ENABLED(SDSUPPORT) - if (!skip_range_check && (pos + 1) > count()) return false; - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - count() - 1 - - #endif - pos; - - card.getfilename_sorted(nr); - return card.filename[0] != '\0'; - #else - UNUSED(pos); - UNUSED(skip_range_check); - return false; - #endif - } - - const char* FileList::filename() { - return IFSD(card.longFilename[0] ? card.longFilename : card.filename, ""); - } - - const char* FileList::shortFilename() { - return IFSD(card.filename, ""); - } - - const char* FileList::longFilename() { - return IFSD(card.longFilename, ""); - } - - bool FileList::isDir() { - return IFSD(card.flag.filenameIsDir, false); - } - - uint16_t FileList::count() { - return IFSD((num_files = (num_files == 0xFFFF ? card.get_num_Files() : num_files)), 0); - } - - bool FileList::isAtRootDir() { - return (true - #if ENABLED(SDSUPPORT) - && card.flag.workDirIsRoot - #endif - ); - } - - void FileList::upDir() { - #if ENABLED(SDSUPPORT) - card.cdup(); - num_files = 0xFFFF; - #endif - } - - void FileList::changeDir(const char * const dirname) { - #if ENABLED(SDSUPPORT) - card.cd(dirname); - num_files = 0xFFFF; - #else - UNUSED(dirname); - #endif - } - -} // namespace ExtUI - -// At the moment, we piggy-back off the ultralcd calls, but this could be cleaned up in the future - -void MarlinUI::init() { - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - SET_INPUT_PULLUP(SD_DETECT_PIN); - #endif - - ExtUI::onStartup(); -} - -void MarlinUI::update() { - #if ENABLED(SDSUPPORT) - static bool last_sd_status; - const bool sd_status = IS_SD_INSERTED(); - if (sd_status != last_sd_status) { - last_sd_status = sd_status; - if (sd_status) { - card.mount(); - if (card.isMounted()) - ExtUI::onMediaInserted(); - else - ExtUI::onMediaError(); - } - else { - const bool ok = card.isMounted(); - card.release(); - if (ok) ExtUI::onMediaRemoved(); - } - } - #endif // SDSUPPORT - ExtUI::onIdle(); -} - -void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) { - using namespace ExtUI; - if (!flags.printer_killed) { - flags.printer_killed = true; - onPrinterKilled(error, component); - } -} - -#endif // EXTENSIBLE_UI diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.h deleted file mode 100644 index ea5eaa8b74..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extensible_ui/ui_api.h +++ /dev/null @@ -1,343 +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 - -/************ - * ui_api.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: . * - ****************************************************************************/ - -#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. - - static constexpr size_t eeprom_data_size = 48; - - enum axis_t : uint8_t { X, Y, Z }; - enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5 }; - enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER }; - enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5 }; - - constexpr uint8_t extruderCount = EXTRUDERS; - constexpr uint8_t hotendCount = HOTENDS; - constexpr uint8_t fanCount = FAN_COUNT; - - #if HAS_MESH - typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - #endif - - bool isMoving(); - bool isAxisPositionKnown(const axis_t); - bool isAxisPositionKnown(const extruder_t); - bool isPositionKnown(); // Axis position guaranteed, steppers active since homing - bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated - bool canMove(const axis_t); - bool canMove(const extruder_t); - void injectCommands_P(PGM_P const); - bool commandsInQueue(); - - bool isHeaterIdle(const heater_t); - bool isHeaterIdle(const extruder_t); - void enableHeater(const heater_t); - void enableHeater(const extruder_t); - - #if ENABLED(JOYSTICK) - void jog(const xyz_float_t &dir); - void _joystick_update(xyz_float_t &norm_jog); - #endif - - /** - * Getters and setters - * Should be used by the EXTENSIBLE_UI to query or change Marlin's state. - */ - PGM_P getFirmwareName_str(); - - #if HAS_SOFTWARE_ENDSTOPS - bool getSoftEndstopState(); - void setSoftEndstopState(const bool); - #endif - - #if HAS_TRINAMIC - float getAxisCurrent_mA(const axis_t); - float getAxisCurrent_mA(const extruder_t); - void setAxisCurrent_mA(const float, const axis_t); - void setAxisCurrent_mA(const float, const extruder_t); - - int getTMCBumpSensitivity(const axis_t); - void setTMCBumpSensitivity(const float, const axis_t); - #endif - - float getActualTemp_celsius(const heater_t); - float getActualTemp_celsius(const extruder_t); - float getTargetTemp_celsius(const heater_t); - float getTargetTemp_celsius(const extruder_t); - float getTargetFan_percent(const fan_t); - float getActualFan_percent(const fan_t); - float getAxisPosition_mm(const axis_t); - float getAxisPosition_mm(const extruder_t); - float getAxisSteps_per_mm(const axis_t); - float getAxisSteps_per_mm(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); - feedRate_t getMinFeedrate_mm_s(); - feedRate_t getMinTravelFeedrate_mm_s(); - float getPrintingAcceleration_mm_s2(); - float getRetractAcceleration_mm_s2(); - float getTravelAcceleration_mm_s2(); - float getFeedrate_percent(); - int16_t getFlowPercentage(const extruder_t); - uint8_t getProgress_percent(); - uint32_t getProgress_seconds_elapsed(); - - #if HAS_LEVELING - bool getLevelingActive(); - void setLevelingActive(const bool); - bool getMeshValid(); - #if HAS_MESH - bed_mesh_t& getMeshArray(); - float getMeshPoint(const xy_uint8_t &pos); - void setMeshPoint(const xy_uint8_t &pos, const float zval); - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval); - inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); } - #endif - #endif - - #if ENABLED(HOST_PROMPT_SUPPORT) - void setHostResponse(const uint8_t); - #endif - - #if ENABLED(PRINTCOUNTER) - char* getTotalPrints_str(char buffer[21]); - char* getFinishedPrints_str(char buffer[21]); - char* getTotalPrintTime_str(char buffer[21]); - char* getLongestPrint_str(char buffer[21]); - char* getFilamentUsed_str(char buffer[21]); - #endif - - void setTargetTemp_celsius(const float, const heater_t); - void setTargetTemp_celsius(const float, const extruder_t); - void setTargetFan_percent(const float, const fan_t); - void setAxisPosition_mm(const float, const axis_t); - 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 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 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 setFlow_percent(const int16_t, const extruder_t); - void setUserConfirmed(); - - #if ENABLED(LIN_ADVANCE) - float getLinearAdvance_mm_mm_s(const extruder_t); - void setLinearAdvance_mm_mm_s(const float, const extruder_t); - #endif - - #if DISABLED(CLASSIC_JERK) - float getJunctionDeviation_mm(); - void setJunctionDeviation_mm(const float); - #else - float getAxisMaxJerk_mm_s(const axis_t); - float getAxisMaxJerk_mm_s(const extruder_t); - void setAxisMaxJerk_mm_s(const float, const axis_t); - void setAxisMaxJerk_mm_s(const float, const extruder_t); - #endif - - extruder_t getActiveTool(); - void setActiveTool(const extruder_t, bool no_move); - - #if ENABLED(BABYSTEPPING) - int16_t mmToWholeSteps(const float mm, const axis_t axis); - - bool babystepAxis_steps(const int16_t steps, const axis_t axis); - void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles); - #endif - - #if HAS_HOTEND_OFFSET - float getNozzleOffset_mm(const axis_t, const extruder_t); - void setNozzleOffset_mm(const float, const axis_t, const extruder_t); - void normalizeNozzleOffset(const axis_t axis); - #endif - - float getZOffset_mm(); - void setZOffset_mm(const float); - - #if ENABLED(BACKLASH_GCODE) - float getAxisBacklash_mm(const axis_t); - void setAxisBacklash_mm(const float, const axis_t); - - float getBacklashCorrection_percent(); - void setBacklashCorrection_percent(const float); - - #ifdef BACKLASH_SMOOTHING_MM - float getBacklashSmoothing_mm(); - void setBacklashSmoothing_mm(const float); - #endif - #endif - - #if HAS_FILAMENT_SENSOR - bool getFilamentRunoutEnabled(); - void setFilamentRunoutEnabled(const bool); - - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - float getFilamentRunoutDistance_mm(); - void setFilamentRunoutDistance_mm(const float); - #endif - #endif - - #if ENABLED(CASE_LIGHT_ENABLE) - bool getCaseLightState(); - void setCaseLightState(const bool); - - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - float getCaseLightBrightness_percent(); - void setCaseLightBrightness_percent(const float); - #endif - #endif - - /** - * Delay and timing routines - * Should be used by the EXTENSIBLE_UI to safely pause or measure time - * safe_millis must be called at least every 1 sec to guarantee time - * yield should be called within lengthy loops - */ - #ifdef __SAM3X8E__ - uint32_t safe_millis(); - #else - FORCE_INLINE uint32_t safe_millis() { return millis(); } // TODO: Implement for AVR - #endif - - void delay_us(unsigned long us); - void delay_ms(unsigned long ms); - void yield(); - - /** - * Media access routines - * - * Should be used by the EXTENSIBLE_UI to operate on files - */ - bool isMediaInserted(); - bool isPrintingFromMediaPaused(); - bool isPrintingFromMedia(); - bool isPrinting(); - - void printFile(const char *filename); - void stopPrint(); - void pausePrint(); - void resumePrint(); - - class FileList { - private: - uint16_t num_files; - - public: - FileList(); - void refresh(); - bool seek(const uint16_t, const bool skip_range_check = false); - - const char *longFilename(); - const char *shortFilename(); - const char *filename(); - bool isDir(); - - void changeDir(const char * const dirname); - void upDir(); - bool isAtRootDir(); - uint16_t count(); - }; - - /** - * Event callback routines - * - * Should be declared by EXTENSIBLE_UI and will be called by Marlin - */ - void onStartup(); - void onIdle(); - void onMediaInserted(); - void onMediaError(); - void onMediaRemoved(); - void onPlayTone(const uint16_t frequency, const uint16_t duration); - void onPrinterKilled(PGM_P const error, PGM_P const component); - void onPrintTimerStarted(); - void onPrintTimerPaused(); - void onPrintTimerStopped(); - void onFilamentRunout(const extruder_t extruder); - void onUserConfirmRequired(const char * const msg); - void onUserConfirmRequired_P(PGM_P const pstr); - void onStatusChanged(const char * const msg); - void onFactoryReset(); - void onStoreSettings(char *); - void onLoadSettings(const char *); - void onConfigurationStoreWritten(bool success); - void onConfigurationStoreRead(bool success); -}; - -/** - * Helper macros to increment or decrement a value. For example: - * - * UI_INCREMENT_BY(TargetTemp_celsius, 10, E0) - * - * Expands to: - * - * setTargetTemp_celsius(getTargetTemp_celsius(E0) + 10, E0); - * - * Or, in the case where a constant increment is desired: - * - * constexpr float increment = 10; - * - * UI_INCREMENT(TargetTemp_celsius, E0) - * - */ -#define UI_INCREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) + inc, ##__VA_ARGS__) -#define UI_DECREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) - inc, ##__VA_ARGS__) - -#define UI_INCREMENT(method, ...) UI_INCREMENT_BY(method, increment, ##__VA_ARGS__) -#define UI_DECREMENT(method, ...) UI_DECREMENT_BY(method, increment, ##__VA_ARGS__) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_dgus_lcd.cpp deleted file mode 100644 index c2daacd70a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_dgus_lcd.cpp +++ /dev/null @@ -1,82 +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 . - * - */ - -/** - * extui_dgus_lcd.cpp - * - * DGUS implementation for Marlin by coldtobi, Feb-May 2019 - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(DGUS_LCD) - -#include "extensible_ui/ui_api.h" -#include "extensible_ui/lib/dgus/DGUSDisplay.h" -#include "extensible_ui/lib/dgus/DGUSDisplayDefinition.h" - -namespace ExtUI { - - void onStartup() { - dgusdisplay.InitDisplay(); - ScreenHandler.UpdateScreenVPData(); - } - - void onIdle() { ScreenHandler.loop(); } - - void onPrinterKilled(PGM_P error, PGM_P component) { - extern const char NUL_STR[]; - ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL); - while (!ScreenHandler.loop()); // Wait while anything is left to be sent - } - - void onMediaInserted() { ScreenHandler.SDCardInserted(); } - void onMediaError() { ScreenHandler.SDCardError(); } - void onMediaRemoved() { ScreenHandler.SDCardRemoved(); } - - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} - void onPrintTimerStarted() {} - void onPrintTimerPaused() {} - void onPrintTimerStopped() {} - void onFilamentRunout(const extruder_t extruder) {} - - void onUserConfirmRequired(const char * const msg) { - if (msg) { - ScreenHandler.sendinfoscreen(PSTR("Please confirm."), nullptr, msg, nullptr, true, true, false, true); - ScreenHandler.SetupConfirmAction(ExtUI::setUserConfirmed); - ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP); - } - else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP ) { - ScreenHandler.SetupConfirmAction(nullptr); - ScreenHandler.PopToOldScreen(); - } - } - - void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); } - - void onFactoryReset() {} - void onLoadSettings() {} - void onStoreSettings() {} -} - -#endif // DGUS_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_example.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_example.cpp deleted file mode 100644 index 9a00db5f80..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_example.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/********************* - * extui_example.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 "../inc/MarlinConfigPre.h" - -#if BOTH(EXTUI_EXAMPLE, EXTENSIBLE_UI) - -#include "extensible_ui/ui_api.h" - -// To implement a new UI, complete the functions below and -// read or update Marlin's state using the methods in the -// ExtUI methods in "../ui_api.h" -// -// Although it may be possible to access other state -// variables from Marlin, using the API here possibly -// helps ensure future compatibility. - -namespace ExtUI { - void onStartup() { - /* Initialize the display module here. The following - * routines are available for access to the GPIO pins: - * - * SET_OUTPUT(pin) - * SET_INPUT_PULLUP(pin) - * SET_INPUT(pin) - * WRITE(pin,value) - * READ(pin) - */ - } - void onIdle() {} - void onPrinterKilled(PGM_P const error, PGM_P const component) {} - void onMediaInserted() {}; - void onMediaError() {}; - void onMediaRemoved() {}; - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} - void onPrintTimerStarted() {} - void onPrintTimerPaused() {} - void onPrintTimerStopped() {} - void onFilamentRunout(const extruder_t extruder) {} - void onUserConfirmRequired(const char * const msg) {} - void onStatusChanged(const char * const msg) {} - void onFactoryReset() {} - - void onStoreSettings(char *buff) { - // This is called when saving to EEPROM (i.e. M500). If the ExtUI needs - // permanent data to be stored, it can write up to eeprom_data_size bytes - // into buff. - - // Example: - // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size); - // memcpy(buff, &myDataStruct, sizeof(myDataStruct)); - } - - void onLoadSettings(const char *buff) { - // This is called while loading settings from EEPROM. If the ExtUI - // needs to retrieve data, it should copy up to eeprom_data_size bytes - // from buff - - // Example: - // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size); - // memcpy(&myDataStruct, buff, sizeof(myDataStruct)); - } - - void onConfigurationStoreWritten(bool success) { - // This is called after the entire EEPROM has been written, - // whether successful or not. - } - - void onConfigurationStoreRead(bool success) { - // This is called after the entire EEPROM has been read, - // whether successful or not. - } - - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { - // This is called when any mesh points are updated - } -} - -#endif // EXTUI_EXAMPLE && EXTENSIBLE_UI diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_malyan_lcd.cpp deleted file mode 100644 index a578c2c1e0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/extui_malyan_lcd.cpp +++ /dev/null @@ -1,488 +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 . - * - */ - -/** - * extui_malyan_lcd.cpp - * - * LCD implementation for Malyan's LCD, a separate ESP8266 MCU running - * on Serial1 for the M200 board. This module outputs a pseudo-gcode - * wrapped in curly braces which the LCD implementation translates into - * actual G-code commands. - * - * Added to Marlin for Mini/Malyan M200 - * Unknown commands as of Jan 2018: {H:} - * Not currently implemented: - * {E:} when sent by LCD. Meaning unknown. - * - * Notes for connecting to boards that are not Malyan: - * The LCD is 3.3v, so if powering from a RAMPS 1.4 board or - * other 5v/12v board, use a buck converter to power the LCD and - * the 3.3v side of a logic level shifter. Aux1 on the RAMPS board - * has Serial1 and 12v, making it perfect for this. - * Copyright (c) 2017 Jason Nelson (xC0000005) - */ - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(MALYAN_LCD) - -#define DEBUG_MALYAN_LCD - -#include "extensible_ui/ui_api.h" - -#include "ultralcd.h" -#include "../sd/cardreader.h" -#include "../module/temperature.h" -#include "../module/stepper.h" -#include "../module/motion.h" -#include "../libs/duration_t.h" -#include "../module/printcounter.h" -#include "../gcode/queue.h" - -#define DEBUG_OUT ENABLED(DEBUG_MALYAN_LCD) -#include "../core/debug_out.h" - -// On the Malyan M200, this will be Serial1. On a RAMPS board, -// it might not be. -#define LCD_SERIAL Serial1 - -// This is based on longest sys command + a filename, plus some buffer -// in case we encounter some data we don't recognize -// There is no evidence a line will ever be this long, but better safe than sorry -#define MAX_CURLY_COMMAND (32 + LONG_FILENAME_LENGTH) * 2 - -// Track incoming command bytes from the LCD -int inbound_count; - -// For sending print completion messages -bool last_printing_status = false; - -// Everything written needs the high bit set. -void write_to_lcd_P(PGM_P const message) { - char encoded_message[MAX_CURLY_COMMAND]; - uint8_t message_length = _MIN(strlen_P(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = pgm_read_byte(&message[i]) | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -void write_to_lcd(const char * const message) { - char encoded_message[MAX_CURLY_COMMAND]; - const uint8_t message_length = _MIN(strlen(message), sizeof(encoded_message)); - - for (uint8_t i = 0; i < message_length; i++) - encoded_message[i] = message[i] | 0x80; - - LCD_SERIAL.Print::write(encoded_message, message_length); -} - -/** - * Process an LCD 'C' command. - * These are currently all temperature commands - * {C:T0190} - * Set temp for hotend to 190 - * {C:P050} - * Set temp for bed to 50 - * - * {C:S09} set feedrate to 90 %. - * {C:S12} set feedrate to 120 %. - * - * the command portion begins after the : - */ -void process_lcd_c_command(const char* command) { - const int target_val = command[1] ? atoi(command + 1) : -1; - if (target_val < 0) { - DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command); - return; - } - switch (command[0]) { - case 'C': // Cope with both V1 early rev and later LCDs. - case 'S': - feedrate_percentage = target_val * 10; - LIMIT(feedrate_percentage, 10, 999); - break; - - case 'T': - // Sometimes the LCD will send commands to turn off both extruder and bed, though - // this should not happen since the printing screen is up. Better safe than sorry. - if (!print_job_timer.isRunning() || target_val > 0) - ExtUI::setTargetTemp_celsius(target_val, ExtUI::extruder_t::E0); - break; - - #if HAS_HEATED_BED - case 'P': ExtUI::setTargetTemp_celsius(target_val, ExtUI::heater_t::BED); break; - #endif - - default: DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command); - } -} - -/** - * Process an LCD 'B' command. - * {B:0} results in: {T0:008/195}{T1:000/000}{TP:000/000}{TQ:000C}{TT:000000} - * T0/T1 are hot end temperatures, TP is bed, TQ is percent, and TT is probably - * time remaining (HH:MM:SS). The UI can't handle displaying a second hotend, - * but the stock firmware always sends it, and it's always zero. - */ -void process_lcd_eb_command(const char* command) { - char elapsed_buffer[10]; - static uint8_t iteration = 0; - duration_t elapsed; - switch (command[0]) { - case '0': { - elapsed = print_job_timer.duration(); - sprintf_P(elapsed_buffer, PSTR("%02u%02u%02u"), uint16_t(elapsed.hour()), uint16_t(elapsed.minute()) % 60, uint16_t(elapsed.second()) % 60); - - char message_buffer[MAX_CURLY_COMMAND]; - uint8_t done_pct = print_job_timer.isRunning() ? (iteration * 10) : 100; - iteration = (iteration + 1) % 10; // Provide progress animation - #if ENABLED(SDSUPPORT) - if (ExtUI::isPrintingFromMedia() || ExtUI::isPrintingFromMediaPaused()) - done_pct = card.percentDone(); - #endif - - sprintf_P(message_buffer, - PSTR("{T0:%03i/%03i}{T1:000/000}{TP:%03i/%03i}{TQ:%03i}{TT:%s}"), - int(thermalManager.degHotend(0)), thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - int(thermalManager.degBed()), thermalManager.degTargetBed(), - #else - 0, 0, - #endif - #if ENABLED(SDSUPPORT) - done_pct, - #else - 0, - #endif - elapsed_buffer - ); - write_to_lcd(message_buffer); - } break; - - default: DEBUG_ECHOLNPAIR("UNKNOWN E/B COMMAND ", command); - } -} - -/** - * Process an LCD 'J' command. - * These are currently all movement commands. - * The command portion begins after the : - * Move X Axis - * - * {J:E}{J:X-200}{J:E} - * {J:E}{J:X+200}{J:E} - * X, Y, Z, A (extruder) - */ -void process_lcd_j_command(const char* command) { - auto move_axis = [command](const auto axis) { - const float dist = atof(command + 1) / 10.0; - ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); - }; - - switch (command[0]) { - case 'E': break; - case 'A': move_axis(ExtUI::extruder_t::E0); break; - case 'Y': move_axis(ExtUI::axis_t::Y); break; - case 'Z': move_axis(ExtUI::axis_t::Z); break; - case 'X': move_axis(ExtUI::axis_t::X); break; - default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); - } -} - -/** - * Process an LCD 'P' command, related to homing and printing. - * Cancel: - * {P:X} - * - * Home all axes: - * {P:H} - * - * Print a file: - * {P:000} - * The File number is specified as a three digit value. - * Printer responds with: - * {PRINTFILE:Mini_SNES_Bottom.gcode} - * {SYS:BUILD}echo:Now fresh file: Mini_SNES_Bottom.gcode - * File opened: Mini_SNES_Bottom.gcode Size: 5805813 - * File selected - * {SYS:BUILD} - * T:-2526.8 E:0 - * T:-2533.0 E:0 - * T:-2537.4 E:0 - * Note only the curly brace stuff matters. - */ -void process_lcd_p_command(const char* command) { - - switch (command[0]) { - case 'P': - ExtUI::pausePrint(); - write_to_lcd_P(PSTR("{SYS:PAUSED}")); - break; - case 'R': - ExtUI::resumePrint(); - write_to_lcd_P(PSTR("{SYS:RESUMED}")); - break; - case 'X': - write_to_lcd_P(PSTR("{SYS:CANCELING}")); - ExtUI::stopPrint(); - write_to_lcd_P(PSTR("{SYS:STARTED}")); - break; - case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes - default: { - #if ENABLED(SDSUPPORT) - // Print file 000 - a three digit number indicating which - // file to print in the SD card. If it's a directory, - // then switch to the directory. - - // Find the name of the file to print. - // It's needed to echo the PRINTFILE option. - // The {S:L} command should've ensured the SD card was mounted. - card.selectFileByIndex(atoi(command)); - - // There may be a difference in how V1 and V2 LCDs handle subdirectory - // prints. Investigate more. This matches the V1 motion controller actions - // but the V2 LCD switches to "print" mode on {SYS:DIR} response. - if (card.flag.filenameIsDir) { - card.cd(card.filename); - write_to_lcd_P(PSTR("{SYS:DIR}")); - } - else { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{PRINTFILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - write_to_lcd_P(PSTR("{SYS:BUILD}")); - card.openAndPrintFile(card.filename); - } - #endif - } break; // default - } // switch -} - -/** - * Handle an lcd 'S' command - * {S:I} - Temperature request - * {T0:999/000}{T1:000/000}{TP:004/000} - * - * {S:L} - File Listing request - * Printer Response: - * {FILE:buttons.gcode} - * {FILE:update.bin} - * {FILE:nupdate.bin} - * {FILE:fcupdate.flg} - * {SYS:OK} - */ -void process_lcd_s_command(const char* command) { - switch (command[0]) { - case 'I': { - // temperature information - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{T0:%03i/%03i}{T1:000/000}{TP:%03i/%03i}"), - int(thermalManager.degHotend(0)), thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - int(thermalManager.degBed()), thermalManager.degTargetBed() - #else - 0, 0 - #endif - ); - write_to_lcd(message_buffer); - } break; - - case 'L': { - #if ENABLED(SDSUPPORT) - if (!card.isMounted()) card.mount(); - - // A more efficient way to do this would be to - // implement a callback in the ls_SerialPrint code, but - // that requires changes to the core cardreader class that - // would not benefit the majority of users. Since one can't - // select a file for printing during a print, there's - // little reason not to do it this way. - char message_buffer[MAX_CURLY_COMMAND]; - uint16_t file_count = card.get_num_Files(); - for (uint16_t i = 0; i < file_count; i++) { - card.selectFileByIndex(i); - sprintf_P(message_buffer, card.flag.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); - write_to_lcd(message_buffer); - } - - write_to_lcd_P(PSTR("{SYS:OK}")); - #endif - } break; - - default: DEBUG_ECHOLNPAIR("UNKNOWN S COMMAND ", command); - } -} - -/** - * Receive a curly brace command and translate to G-code. - * Currently {E:0} is not handled. Its function is unknown, - * but it occurs during the temp window after a sys build. - */ -void process_lcd_command(const char* command) { - const char *current = command; - - byte command_code = *current++; - if (*current == ':') { - - current++; // skip the : - - switch (command_code) { - case 'S': process_lcd_s_command(current); break; - case 'J': process_lcd_j_command(current); break; - case 'P': process_lcd_p_command(current); break; - case 'C': process_lcd_c_command(current); break; - case 'B': - case 'E': process_lcd_eb_command(current); break; - default: DEBUG_ECHOLNPAIR("UNKNOWN COMMAND ", command); - } - } - else - DEBUG_ECHOLNPAIR("UNKNOWN COMMAND FORMAT ", command); -} - -// Parse LCD commands mixed with G-Code -void parse_lcd_byte(byte b) { - static bool parsing_lcd_cmd = false; - static char inbound_buffer[MAX_CURLY_COMMAND]; - - if (!parsing_lcd_cmd) { - if (b == '{' || b == '\n' || b == '\r') { // A line-ending or opening brace - parsing_lcd_cmd = b == '{'; // Brace opens an LCD command - if (inbound_count) { // Looks like a G-code is in the buffer - inbound_buffer[inbound_count] = '\0'; // Reset before processing - inbound_count = 0; - queue.enqueue_one_now(inbound_buffer); // Handle the G-code command - } - } - } - else if (b == '}') { // Closing brace on an LCD command - parsing_lcd_cmd = false; // Unflag and... - inbound_buffer[inbound_count] = '\0'; // reset before processing - inbound_count = 0; - process_lcd_command(inbound_buffer); // Handle the LCD command - } - else if (inbound_count < MAX_CURLY_COMMAND - 2) - inbound_buffer[inbound_count++] = b; // Buffer only if space remains -} - -/** - * UC means connected. - * UD means disconnected - * The stock firmware considers USB initialized as "connected." - */ -void update_usb_status(const bool forceUpdate) { - static bool last_usb_connected_status = false; - // This is mildly different than stock, which - // appears to use the usb discovery status. - // This is more logical. - if (last_usb_connected_status != SerialUSB || forceUpdate) { - last_usb_connected_status = SerialUSB; - write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n")); - } -} - -namespace ExtUI { - void onStartup() { - /** - * The Malyan LCD actually runs as a separate MCU on Serial 1. - * This code's job is to siphon the weird curly-brace commands from - * it and translate into ExtUI operations where possible. - */ - inbound_count = 0; - LCD_SERIAL.begin(500000); - - // Signal init - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - - // send a version that says "unsupported" - write_to_lcd_P(PSTR("{VER:99}\r\n")); - - // No idea why it does this twice. - write_to_lcd_P(PSTR("{SYS:STARTED}\r\n")); - update_usb_status(true); - } - - void onIdle() { - /** - * - from printer on startup: - * {SYS:STARTED}{VER:29}{SYS:STARTED}{R:UD} - */ - - // First report USB status. - update_usb_status(false); - - // now drain commands... - while (LCD_SERIAL.available()) { - parse_lcd_byte((byte)LCD_SERIAL.read() & 0x7F); - } - - #if ENABLED(SDSUPPORT) - // The way last printing status works is simple: - // The UI needs to see at least one TQ which is not 100% - // and then when the print is complete, one which is. - static uint8_t last_percent_done = 100; - - // If there was a print in progress, we need to emit the final - // print status as {TQ:100}. Reset last percent done so a new print will - // issue a percent of 0. - const uint8_t percent_done = (ExtUI::isPrinting() || ExtUI::isPrintingFromMediaPaused()) ? ExtUI::getProgress_percent() : last_printing_status ? 100 : 0; - if (percent_done != last_percent_done) { - char message_buffer[16]; - sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); - write_to_lcd(message_buffer); - last_percent_done = percent_done; - last_printing_status = ExtUI::isPrinting(); - } - #endif - } - - // {E:} is for error states. - void onPrinterKilled(PGM_P error, PGM_P component) { - write_to_lcd_P(PSTR("{E:")); - write_to_lcd_P(error); - write_to_lcd_P(PSTR(" ")); - write_to_lcd_P(component); - write_to_lcd_P("}"); - } - - void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); } - void onPrintTimerPaused() {} - void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); } - - // Not needed for Malyan LCD - void onStatusChanged(const char * const) {} - void onMediaInserted() {}; - void onMediaError() {}; - void onMediaRemoved() {}; - void onPlayTone(const uint16_t, const uint16_t) {} - void onFilamentRunout(const extruder_t extruder) {} - void onUserConfirmRequired(const char * const) {} - void onFactoryReset() {} - void onStoreSettings(char*) {} - void onLoadSettings(const char*) {} - void onConfigurationStoreWritten(bool) {} - void onConfigurationStoreRead(bool) {} -} - -#endif // MALYAN_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.cpp deleted file mode 100644 index fdccd082c3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/** - * @file fontutils.cpp - * @brief help functions for font and char - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2016-08-19 - * @copyright GPL/BSD - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_SPI_LCD - #include "ultralcd.h" - #include "../Marlin.h" -#endif - -#include "fontutils.h" - -uint8_t read_byte_ram(uint8_t * str) { - return *str; -} - -uint8_t read_byte_rom(uint8_t * str) { - return pgm_read_byte(str); -} - -/** - * @brief Using binary search to find the position by data_pin - * - * @param userdata : User's data - * @param num_data : the item number of the sorted data - * @param cb_comp : the callback function to compare the user's data and pin - * @param data_pin : The reference data to be found - * @param ret_idx : the position of the required data; If failed, then it is the failed position, which is the insert position if possible. - * - * @return 0 on found, <0 on failed(fail position is saved by ret_idx) - * - * Using binary search to find the position by data_pin. The user's data should be sorted. - */ -int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx) { - int retcomp; - - if (num_data < 1) { - *ret_idx = 0; - return -1; - } - - size_t i = 0, ileft = 1, iright = num_data; - bool flg_found = false; - for (; ileft <= iright;) { - i = (ileft + iright) / 2 - 1; - /* cb_comp should return the *userdata[i] - *data_pinpoint */ - retcomp = cb_comp (userdata, i, data_pinpoint); - if (retcomp > 0) - iright = i; - else if (retcomp < 0) - ileft = i + 2; - else { - /* found ! */ - flg_found = true; - break; - } - } - - if (flg_found) { - *ret_idx = i; - return 0; - } - if (iright <= i) - *ret_idx = i; - else if (ileft >= i + 2) - *ret_idx = i + 1; - return -1; -} - -/* This function gets the character at the pstart position, interpreting UTF8 multybyte sequences - and returns the pointer to the next character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { - uint32_t val = 0; - uint8_t *p = pstart; - - uint8_t valcur = cb_read_byte(p); - if (0 == (0x80 & valcur)) { - val = valcur; - p++; - } - else if (0xC0 == (0xE0 & valcur)) { - val = valcur & 0x1F; - val <<= 6; - p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xE0 == (0xF0 & valcur)) { - val = valcur & 0x0F; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF0 == (0xF8 & valcur)) { - val = valcur & 0x07; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF8 == (0xFC & valcur)) { - val = valcur & 0x03; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xFC == (0xFE & valcur)) { - val = valcur & 0x01; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0x80 == (0xC0 & valcur)) - for (; 0x80 == (0xC0 & valcur); ) { p++; valcur = cb_read_byte(p); } - else - for (; ((0xFE & valcur) > 0xFC); ) { p++; valcur = cb_read_byte(p); } - - if (pval) *pval = val; - - return p; -} - -static inline uint8_t utf8_strlen_cb(const char *pstart, read_byte_cb_t cb_read_byte) { - - uint8_t cnt = 0; - uint8_t *pnext = (uint8_t *)pstart; - for (;;) { - wchar_t ch; - pnext = get_utf8_value_cb(pnext, cb_read_byte, &ch); - if (!ch) break; - cnt++; - } - return cnt; -} - -uint8_t utf8_strlen(const char *pstart) { - return utf8_strlen_cb(pstart, read_byte_ram); -} - -uint8_t utf8_strlen_P(PGM_P pstart) { - return utf8_strlen_cb(pstart, read_byte_rom); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.h deleted file mode 100644 index 8839e36a2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/fontutils.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file fontutils.h - * @brief help functions for font and char - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2016-08-19 - * @copyright GPL/BSD - */ -#pragma once - -#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); - -uint8_t read_byte_ram(uint8_t * str); -uint8_t read_byte_rom(uint8_t * str); - -// there's overflow of the wchar_t due to the 2-byte size in Arduino -// sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4; -// sizeof(int)=2; sizeof(long)=4; sizeof(unsigned)=2; -//#undef wchar_t -#define wchar_t uint32_t -//typedef uint32_t wchar_t; - -typedef uint16_t pixel_len_t; -#define PIXEL_LEN_NOLIMIT ((pixel_len_t)(-1)) - -/* Perform binary search */ -typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin); /*"data_list[idx] - *data_pin"*/ -int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx); - -/* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); - -/* Returns lenght of string in CHARACTERS, NOT BYTES */ -uint8_t utf8_strlen(const char *pstart); -uint8_t utf8_strlen_P(PGM_P pstart); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_an.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_an.h deleted file mode 100644 index a5c0d0ab80..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_an.h +++ /dev/null @@ -1,232 +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 - -/** - * Aragonese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -namespace Language_an { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Aragonese"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" parada."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tarcheta mesa"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarcheta sacada"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu prencipal"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automatico"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Amortar motors"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Levar a l'orichen"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Orichen X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Orichen Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Orichen Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Orichen XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Encetar (pretar)"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Vinient punto"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivelacion feita!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Achustar desfases"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicau"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Establir orichen"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Boquilla"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Boquilla ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Tot"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Base"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Precalentar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Precalentar ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Precal. ") PREHEAT_2_LABEL _UxGT(" Boquilla"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Precal. ") PREHEAT_2_LABEL _UxGT(" Boquilla ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Tot"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Base"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Conf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Enchegar Fuent"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Amortar Fuent"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruir"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover Eixes"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelar base"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar base"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidat"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Boquilla"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Boquilla ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Base"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ixoriador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ixoriador ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temperatura Auto."); - PROGMEM Language_Str MSG_SELECT = _UxGT("Trigar"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Trigar *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Aceleracion"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vel. viache min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Acel. max") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Acel. max") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Acel. max") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Acel. max") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Acel. max *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acel. retrac."); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acel. Viaje"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Trangos/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" trangos/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" trangos/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" trangos/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E trangos/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* trangos/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Alzar memoria"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurar memoria"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Tornar a cargar"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Informacion"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Achustar"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impresion"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Contin. impresion"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Detener Impresion"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Menu de SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No i hai tarcheta"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Reposo..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Aguardand ordines"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impres. cancelada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sin movimiento"); - PROGMEM Language_Str MSG_KILLED = _UxGT("Aturada d'emerch."); - PROGMEM Language_Str MSG_STOPPED = _UxGT("Aturada."); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraer mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Retraer mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraer F"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Devantar mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet F"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retraccion auto."); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambear filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambear filamento *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Encetan. tarcheta"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar tarcheta"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fuera"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desfase Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Error: en calentar"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Error: temperatura"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Error de temperatura"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Error: Temp Max"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Error: Temp Min"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY first"); - PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESORA ATURADA"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Per favor reinic."); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Calentando..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Calentando base..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibracion Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); - - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Inf. Impresora"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Inf. Impresora"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadisticas Imp."); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Inf. Controlador"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistors"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusors"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Conteo de impresion"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tiempo total d'imp."); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impresion mas larga"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total d'extrusion"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impresions"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Mas larga"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrusion"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temperatura menima"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temperatura maxima"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fuente de aliment"); - - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Fuerza d'o driver"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escri. DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Resumir imp."); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Aguardand iniciar", "d'o filamento", "cambear")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Meta o filamento", "y prete lo boton", "pa continar...")); - #else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Aguardand iniciar", "d'o fil. cambear")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("Meta o filamento", "y prete lo boton")); - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Aguardando a", "expulsar filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Aguardando a", "cargar filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Aguardando impre.", "pa continar")); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_bg.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_bg.h deleted file mode 100644 index ca8735b043..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_bg.h +++ /dev/null @@ -1,153 +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 - -/** - * Bulgarian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_5 - -namespace Language_bg { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Bulgarian"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Готов."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Картата е поставена"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Картата е извадена"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Изкл. двигатели"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Паркиране"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Задай Начало"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Изходна точка"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Подгряване ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Подгряване ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Подгряване ") PREHEAT_1_LABEL _UxGT(" Дюза"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Подгряване ") PREHEAT_1_LABEL _UxGT(" Дюза ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Подгр. ") PREHEAT_1_LABEL _UxGT(" Всички"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Подгр. ") PREHEAT_1_LABEL _UxGT(" Легло"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Настройки ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Подгряване ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Подгряване ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Подгряване ") PREHEAT_2_LABEL _UxGT(" Дюза"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Подгряване ") PREHEAT_2_LABEL _UxGT(" Дюза ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Подгр. ") PREHEAT_2_LABEL _UxGT(" Всички"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Подгр. ") PREHEAT_2_LABEL _UxGT(" Легло"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Настройки ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждане"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Вкл. захранване"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Изкл. захранване"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Екструзия"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Откат"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Движение по ос"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Нивелиране"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Нивелиране"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Движение по X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Движение по Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Движение по Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Премести с %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Премести с 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Премести с 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Премести с 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Скорост"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); - PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Дюза"); - PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Дюза ~"); - PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Легло"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Вентилатор"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Вентилатор ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Поток"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Поток ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Управление"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Минимум"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Максимум"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Авто-темп."); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Вкл."); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Изкл."); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-откат"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-travel"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Стъпки/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("стъпки/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("стъпки/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("стъпки/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E стъпки/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* стъпки/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Нишка"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. нишка"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диам. нишка *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD контраст"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Запази в EPROM"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зареди от EPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Фабрични настройки"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Обнови"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Преглед"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Действия"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Настройка"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Пауза"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Възобнови печата"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Спри печата"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Меню карта"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Няма карта"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Почивка..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Изчакване"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Печатът е прекъснат"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Няма движение"); - PROGMEM Language_Str MSG_KILLED = _UxGT("УБИТО."); - PROGMEM Language_Str MSG_STOPPED = _UxGT("СПРЯНО."); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Откат mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Смяна Откат mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Откат V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Скок mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Възврат mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Смяна Възврат mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Възврат V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автоoткат"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Смяна нишка"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Смяна нишка *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Иниц. SD-Карта"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Смяна SD-Карта"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z-сондата е извадена"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Отстояние"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Министъпка X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Министъпка Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Министъпка Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Стоп Кр.Изключватели"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Делта Калибровка"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калибровка X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калибровка Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калибровка Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калибровка Център"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неправилен принтер"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ca.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ca.h deleted file mode 100644 index 7c6a94b145..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ca.h +++ /dev/null @@ -1,233 +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 - -/** - * Catalan - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_ca { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Catalan"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" preparada."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Targeta detectada."); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Targeta extreta."); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inici automatic"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desactiva motors"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu de depuracio"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra progres"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ves a l'origen"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X a origen"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y a origen"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z a origen"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origen XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premeu per iniciar"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Següent punt"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Anivellament fet!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ajusta decalatge"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Decalatge aplicat"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Estableix origen"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preescalfa ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preescalfa ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Tot"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Llit"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Conf."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preescalfa ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preescalfa ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Tot"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Llit"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Conf."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Refreda"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch power on"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Switch power off"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudeix"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retreu"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mou eixos"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Anivella llit"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Anivella llit"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Movent.."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY lliures"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mou X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mou Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mou Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mou %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mou 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mou 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mou 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocitat"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Llit Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Llit"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventilador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventilador ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VViatge min"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Accel. max ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Accel. max ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Accel. max ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Accel. max ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Accel. max *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Accel. retracc"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Accel. Viatge"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passos/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("passos/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("passos/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("passos/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Epassos/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*passos/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Moviment"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. Fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. Fil. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrast de LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Desa memoria"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carrega memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaura valors"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Actualitza"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Pantalla Info."); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Ajusta"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausa impressio"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Repren impressio"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Atura impressio."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimeix de SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No hi ha targeta"); - PROGMEM Language_Str MSG_DWELL = _UxGT("En repos..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Esperant usuari.."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Imp. cancelada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sense moviment."); - PROGMEM Language_Str MSG_KILLED = _UxGT("MATAT."); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ATURADA."); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retreu mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Retreure mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retreu V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Aixeca mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet +mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap DesRet +mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto retraccio"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Canvia filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Canvia filament *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inicialitza SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Canvia SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fora"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reinicia BLTouch"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s primer"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Decalatge Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropas X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropas Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropas Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancel. Endstop"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Error al escalfar"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP REDUNDANT"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MAXIMA"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY primer"); - PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESSORA PARADA"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reinicieu"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Escalfant..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Escalfant llit..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibratge Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibra X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibra Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibra Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra el centre"); - - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Quant a la impr."); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info Impressora"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadistiques"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info placa"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistors"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusors"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Llum"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total impressions"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Acabades"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Temps imprimint"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Treball mes llarg"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total extrudit"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impressions"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Acabades"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Mes llarg"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudit"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp. mínima"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp. màxima"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Font alimentacio"); - - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Força motor"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Repren impressió"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora incorrecta"); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperant per", "iniciar el canvi", "de filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Esperant per", "treure filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Poseu filament", "i premeu el boto", "per continuar...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Premeu boto per", "escalfar nozzle.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Escalfant nozzle", "Espereu...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Esperant carrega", "de filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperant per", "reprendre")); - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Espereu...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Expulsant...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insereix i prem")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Escalfant...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Carregant...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reprenent...")); - #endif // LCD_HEIGHT < 4 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_cz.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_cz.h deleted file mode 100644 index 6e374ae578..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_cz.h +++ /dev/null @@ -1,526 +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 - -/** - * Czech - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Petr Zahradnik, Computer Laboratory - * Blog and video blog Zahradnik se bavi - * http://www.zahradniksebavi.cz - * - */ - -#define DISPLAY_CHARSET_ISO10646_CZ - -namespace Language_cz { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Czech"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" připraven."); - PROGMEM Language_Str MSG_YES = _UxGT("ANO"); - PROGMEM Language_Str MSG_NO = _UxGT("NE"); - PROGMEM Language_Str MSG_BACK = _UxGT("Zpět"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta vložena"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta vyjmuta"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopy"); // max 8 znaku - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstopy"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavní nabídka"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Další nastavení"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurace"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolnit motory"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Nabídka ladění"); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test ukaz. průběhu"); - #else - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. průběhu"); - #endif - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Domovská pozice"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Domů osa X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Domů osa Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domů osa Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto srovnání Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Měření podložky"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím spusťte"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Další bod"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Měření hotovo!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Výška srovnávání"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastavit ofsety"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastaveny"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nastavit počátek"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Zahřát ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Zahřát ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" end"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" end ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" vše"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" podlož"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" nast"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Zahřát ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Zahřát ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" end"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" end ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" vše"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" podlož"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" nast"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Zahřát vlastní"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Zchladit"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Ovládání laseru"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnout laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnout laser"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon laseru"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Vřeteno opačně"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnout napájení"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Vypnout napájení"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Vytlačit (extr.)"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Zatlačit (retr.)"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Posunout osy"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Vyrovnat podložku"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Vyrovnat podložku"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Vyrovnat rohy"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Další roh"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Upravit síť bodů"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Konec úprav sítě"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Hodnota Z"); - - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Vlastní příkazy"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Režim IDEX"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Ofsety nástrojů"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikace"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrcadlení"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z"); - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Provádím G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL nástroje"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manuální síť bodů"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Vložte kartu, změřte"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Změřte"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Odstraňte a změřte"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Přesun na další"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktivovat UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deaktivovat UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Teplota podložky"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Teplota podložky"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Teplota hotendu"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Teplota hotendu"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Úprava sítě bodů"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Upravit vlastní síť"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Doladit síť bodů"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Konec úprav sítě"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Vlastní síť"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Vytvořit síť"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Síť bodů ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Síť bodů ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Studená síť bodů"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Upravit výšku sítě"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Výška"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Zkontrolovat síť"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Kontrola sítě ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Kontrola sítě ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Kontrola vlast. sítě"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Pokračovat v síťi"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Síťové rovnání"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-bodové rovnání"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Mřížkové rovnání"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Srovnat podložku"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Postranní body"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Typ sítě bodu"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Exportovat síť"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Exportovat do PC"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Exportovat do CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Záloha do PC"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info o UBL do PC"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Hustota mřížky"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ruční hustota"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Chytrá hustota"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Zaplnit mřížku"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušit všechno"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušit poslední"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Upravit všechny"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Upravit poslední"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Uložiště sítí"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Paměťový slot"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Načíst síť bodů"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Uložit síť bodů"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Síť %i načtena"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Síť %i uložena"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nedostatek místa"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Ch.: Uložit UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Ch.: Obnovit UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Konec Z-Offsetu"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Postupně"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Studená síť bodů"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Chytrá hustota"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Zkontrolovat síť"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Upravit všechny"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Zkontrolovat síť"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Upravit všechny"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Uložit síť bodů"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Nastavení LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Světla"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Světla Předvolby"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Červená"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Oranžová"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Žlutá"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zelená"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Modrá"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fialová"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Bílá"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Výchozí"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Vlastní světla"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Červená intenzita"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zelená intezita"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Modrá intenzita"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Bílá intenzita"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jas"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Posouvání..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Uvolnit XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Posunout X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Posunout Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Posunout Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunout o %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunout o 0,1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunout o 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunout o 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Rychlost"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Výška podl."); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Tryska"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Tryska ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rychlost vent."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rychlost vent. ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rychlost ex. vent."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rychlost ex. vent. ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Průtok"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Průtok ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládaní"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autoteplota"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Zap"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrat"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrat *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Zrychl"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Odchylka spoje"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Rychlost"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Akcelerace"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-přejezd"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Kroků/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("kroků/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("kroků/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("kroků/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Ekroků/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*kroků/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Prum."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Prum. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Vysunout mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Zavést mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K pro posun"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K pro posun *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložit nastavení"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načíst nastavení"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnovit výchozí"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inic. EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizace z SD"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset tiskárny"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnovit"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info obrazovka"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Připrava tisku"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Doladění tisku"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Spustit tisk"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Tisk"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Zrušit"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pozastavit tisk"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Obnovit tisk"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zastavit tisk"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Obnova výpadku"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tisknout z SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Žádná SD karta"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Uspáno..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Čekání na uživ..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Tisk pozastaven"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Tisknu..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Tisk zrušen"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Žádný pohyb."); - PROGMEM Language_Str MSG_KILLED = _UxGT("PŘERUSENO. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ZASTAVENO. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrakt mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Výměna Re.mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraktovat V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Zvednuti Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Délka retrakce"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Výměna nástroje"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvih Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Rychlost primár."); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Rychlost retrak."); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Tryska standby"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Vyměnit filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Vyměnit filament *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Zavést filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Zavést filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Vysunout filament"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Vysunout filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunout vše"); - - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Načíst SD kartu"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Vyměnit SD kartu"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Faktor zkosení"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch self-test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch reset"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch vysunout"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW výsun BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch 5V režim"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch OD režim"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch zasunout"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Vysunout Z-sondu"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Zasunout Z-sondu"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Domů %s%s%s první"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Celkem"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop abort"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Chyba zahřívání"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Chyba zahř.podl."); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEPLOTA"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÍ ÚNIK"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPL. ÚNIK PODL."); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("VYSOKÁ TEPLOTA"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("NÍZKA TEPLOTA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("VYS. TEPL. PODL."); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("NÍZ. TEPL. PODL."); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: MAXTEMP KOMORA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: MINTEMP KOMORA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Domů XY první"); - PROGMEM Language_Str MSG_HALTED = _UxGT("TISK. ZASTAVENA"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Proveďte reset"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Zahřívání..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Chlazení..."); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Zahřívání podložky"); - #else - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Zahřívání podl."); - #endif - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chlazení podložky"); - #else - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chlazení podl."); - #endif - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrace"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrovat X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrovat Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrovat Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovat Střed"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta nastavení"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autokalibrace"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast.výšku delty"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Nast. Z-ofset"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag rameno"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Výška"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Poloměr"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O tiskárně"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info o tiskárně"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-bodové rovnání"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineárni rovnání"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineární rovnání"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mřížkové rovnání"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistika"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info o desce"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Rychlost"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvětlení"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas světla"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tisků"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončeno"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Nejdelší tisk"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Celkem vytlačeno"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Tisky"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Hotovo"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Čas"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Nejdelší"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačeno"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Nap. zdroj"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Buzení motorů"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Motor %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Uložit do EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMĚNA FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("TISK POZASTAVEN"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAVEDENÍ FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("VYSUNUTÍ FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI OBNOVENÍ:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačit víc"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnovit tisk"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Parkování selhalo"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Kalibrace selhala"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Moc studený"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("VYBERTE FILAMENT"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Aktual. MMU firmware!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU potř. pozornost."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Obnovit tisk"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Obnovování..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Zavést filament"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Zavést všechny"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Zavést do trysky"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Vysunout filament"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Vysun. filament ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Vytáhnout filament"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Zavádění fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Vytahování fil. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Vysouvání fil...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Všechny"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Resetovat MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetování MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Vytáhněte, klikněte"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponenta ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mixér"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Přechod"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Celý přechod"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Přepnout mix"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Střídat mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Přechod mix"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Opačný přechod"); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktivní V-nástroj"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Spustit V-nástroj"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Ukončit V-nástroj"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-nástroje"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Resetovat V-nástroj"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložit V-nástroj mix"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-nástroj resetovat"); - #else - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktivní V-nástr."); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Spustit V-nástr."); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Ukončit V-nástr."); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-nástr."); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset. V-nástr."); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložit V-nás. mix"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-nástr. reset."); - #endif - PROGMEM Language_Str MSG_START_Z = _UxGT("Počáteční Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" Koncové Z:"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Bludiště"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Nesprávná tiskárna"); - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stikněte tlačítko", "pro obnovení tisku")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkování...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čekejte prosím", "na zahájení", "výměny filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Vložte filament", "a stiskněte", "tlačítko...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klikněte pro", "nahřátí trysky")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Čekejte prosím", "na nahřátí tr.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Čekejte prosím", "na vysunuti", "filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Čekejte prosím", "na zavedení", "filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Vyčkejte na", "vytlačení")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Klikněte pro", "ukončení", "vytlačování")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Čekejte prosím", "na pokračování", "tisku")); - #else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stikněte tlač.", "pro obnovení")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkování...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Čekejte...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Vložte, klikněte")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klikněte pro", "nahřátí")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Nahřívání...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Vysouvání...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Zavádění...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Vytlačování...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Klikněte pro", "ukončení")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Pokračování...")); - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC budiče"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Proud budičů"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybridní práh"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Domů bez senzorů"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Režim kroků"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop povolen"); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" za:"); - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Vůle"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korekce"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Vyhlazení"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_da.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_da.h deleted file mode 100644 index 4e6dd2b0d9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_da.h +++ /dev/null @@ -1,199 +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 - -/** - * Danish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_da { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Danish"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" er klar"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kort isat"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kort fjernet"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Slå alle steppere fra"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); // G28 - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik når du er klar"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Næste punkt"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Bed level er færdig!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Sæt forsk. af home"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Forsk. er nu aktiv"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Sæt origin"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Forvarm ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Forvarm ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" end") - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" end ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" Alle"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Forvarm ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Forvarm ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" end") - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" end ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" Alle"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Afkøl"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Slå strøm til"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Slå strøm fra"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruder"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Flyt akser"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Juster bed"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Juster bed"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Flyt X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Flyt Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Flyt Z"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Flyt %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Flyt 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Flyt 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Flyt 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Hastighed"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Plade Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dyse"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dyse ~"); - - PROGMEM Language_Str MSG_BED = _UxGT("Plade"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Blæser hastighed"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Blæser hastighed ="); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); - PROGMEM Language_Str MSG_MIN = _UxGT(" \002 Min"); - PROGMEM Language_Str MSG_MAX = _UxGT(" \002 Max"); - PROGMEM Language_Str MSG_FACTOR = _UxGT(" \002 Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Til"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Fra"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Vælg"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vælg *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retract"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-rejse"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Bevægelse"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E i mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrast"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gem i EEPROM"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hent fra EEPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Gendan failsafe"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Genopfrisk"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info skærm"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Forbered"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause printet"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Forsæt printet"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop printet"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print fra SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Intet SD kort"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Dvale..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Venter på bruger..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print annulleret"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Ingen bevægelse."); - PROGMEM Language_Str MSG_KILLED = _UxGT("DRÆBT. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPET. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Tilbagetræk mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Skift Re.mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Tilbagetræk V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Skift UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Skift filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Skift filament *"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Skift SD kort"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Probe udenfor plade"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selv-Test"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s først"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Opvarmning fejlet"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Fejl: reserve temp"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Fejl: Maks temp"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Fejl: Min temp"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Fejl: Maks Plade temp"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Fejl: Min Plade temp"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY først"); - PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER STOPPET"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reset Venligst"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // Kun et bogstav - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // Kun et bogstav - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // Kun et bogstav - PROGMEM Language_Str MSG_HEATING = _UxGT("Opvarmer..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Opvarmer plade..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrering"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrer X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrer Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrer Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrerings Center"); - - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Om Printer"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Kort Info"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Ant. Prints"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Færdige"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total print tid"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Længste print"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extruderet"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Prints"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Færdige"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Længste"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruderet"); - #endif - - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Strømfors."); - - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Driv Styrke"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driv %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Forsæt print"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Forkert printer"); - - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Vent på start", "af filament", "skift")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Vent på", "filament udskyd.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Indsæt filament", "og tryk på knap", "for at fortsætte...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Vent på", "filament indtag")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Vent på at print", "fortsætter")); - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Vent venligst...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Udskyder...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Indsæt og klik")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Indtager...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Fortsætter...")); - #endif // LCD_HEIGHT < 4 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_de.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_de.h deleted file mode 100644 index 52a8c205f2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_de.h +++ /dev/null @@ -1,564 +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 - -/** - * German - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -namespace Language_de { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Deutsche"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" bereit"); - - PROGMEM Language_Str MSG_YES = _UxGT("JA"); - PROGMEM Language_Str MSG_NO = _UxGT("NEIN"); - PROGMEM Language_Str MSG_BACK = _UxGT("Zurück"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Abbruch..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Medium erkannt"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Medium entfernt"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Medium freigegeben"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Warten auf Medium"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Medium Lesefehler"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB Gerät entfernt"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB Start fehlge."); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopp"); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Software-Endstopp"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Hauptmenü"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Erw. Einstellungen"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren deaktivieren"); // M84 :: Max length 19 characters - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug-Menü"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Statusbalken-Test"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Z-Achsen ausgleichen"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klick zum Starten"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Nächste Koordinate"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivellieren fertig!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Ausblendhöhe"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in ultralcd.cpp - PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" Vorwärmen") " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" Extr. Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" Extr. Vorwärm. ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" Alles Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" Bett Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" Einstellungen"); - PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" Vorwärmen") " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" Extr. Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" Extr. Vorwärm. ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" Alles Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" Bett Vorwärmen"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" Einstellungen"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("benutzerdef. Heizen"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Abkühlen"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser aus"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser an"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laserleistung"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindel-Steuerung"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindel aus"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindel an"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindelleistung"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindelrichtung"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Netzteil ein"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Netzteil aus"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudieren"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Einzug"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Achsen bewegen"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bett-Nivellierung"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Bett nivellieren"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Ecken nivellieren"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Nächste Ecke"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Netz Editor"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Netz bearbeiten"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Netzbearb. angeh."); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Messpunkt"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z-Wert"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Benutzer-Menü"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Berührungspunkt"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Sondentest"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punkt"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Abweichung"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX-Modus"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Werkzeugversätze"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Autom. parken"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplizieren"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Spiegelkopie"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("vollstä. Kontrolle"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. Düse X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. Düse Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. Düse Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 ausführen"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL-Werkzeuge"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Netz manuell erst."); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Unterlegen & messen"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Messen"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Entfernen & messen"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Nächster Punkt..."); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL aktivieren"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL deaktivieren"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Betttemperatur"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Betttemperatur"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Hotend-Temp."); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend-Temp."); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Netz bearbeiten"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Eigenes Netz bearb."); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Feineinstellung..."); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Bearbeitung beendet"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Eigenes Netz erst."); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Netz erstellen"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = PREHEAT_1_LABEL _UxGT(" Netz erstellen"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = PREHEAT_2_LABEL _UxGT(" Netz erstellen"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Netz erstellen kalt"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Netzhöhe einst."); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Höhe"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Netz validieren"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = PREHEAT_1_LABEL _UxGT(" Netz validieren"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = PREHEAT_2_LABEL _UxGT(" Netz validieren"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Eig. Netz validieren"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Heating Nozzle"); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 heizt Bett"); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Feste Länge Prime"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Priming fertig"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 abgebrochen"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("G26 verlassen"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Netzerst. forts."); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Netz-Nivellierung"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Punkt-Nivell."); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Gitternetz-Nivell."); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Netz nivellieren"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Eckpunkte"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Kartentyp"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Karte ausgeben"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Ausgabe für Host"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Ausgabe für CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Externe Sicherung"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL-Info ausgeben"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Menge an Füllung"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manuelles Füllen"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Cleveres Füllen"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Netz Füllen"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Alles annullieren"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Nächstlieg. ann."); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Feineinst. Alles"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Feineinst. Nächstl."); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Netz-Speicherplatz"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Speicherort"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Bettnetz laden"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Bettnetz speichern"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Netz %i geladen"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Netz %i gespeichert"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Kein Speicher"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err:UBL speichern"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err:UBL wiederherst."); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Versatz: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Versatz angehalten"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Schrittweises UBL"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Netz erstellen kalt"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Cleveres Füllen"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Netz validieren"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Feineinst. Alles"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Netz validieren"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Feineinst. Alles"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Bettnetz speichern"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Licht-Steuerung"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Licht"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Licht-Einstellung"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rot"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Gelb"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Grün"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blau"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violett"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Weiß"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Standard"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Benutzerdefiniert"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensität Rot"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensität Grün"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensität Blau"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensität Weiß"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Helligkeit"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("In Bewegung..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Abstand XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Bewege X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Bewege Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Bewege Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Bewege Extruder"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Bewege Extruder *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT(" %s mm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT(" 0,1 mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1,0 mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10,0 mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Geschw."); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Bett Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Düse"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Düse ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Bett"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Gehäuse"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Lüfter"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Lüfter ~"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Geschw. Extralüfter"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Geschw. Extralüfter ~"); - PROGMEM Language_Str MSG_FLOW = _UxGT("Flussrate"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flussrate ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Einstellungen"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Faktor"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto Temperatur"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("an"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("aus"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Auswählen"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Auswählen *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Beschleunigung"); - PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V ") LCD_STR_A _UxGT(" Jerk"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V ") LCD_STR_B _UxGT(" Jerk"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V ") LCD_STR_C _UxGT(" Jerk"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("V E Jerk"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Geschwindigkeit"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("V max ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("V max ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("V max ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("V max ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("V max *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("V min "); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("V min Leerfahrt"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Beschleunigung"); - PROGMEM Language_Str MSG_AMAX = _UxGT("A max "); // space intentional - PROGMEM Language_Str MSG_AMAX_A = _UxGT("A max ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("A max ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("A max ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("A max ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("A max *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A Einzug"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A Leerfahrt"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Steps/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" Steps/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" Steps/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" Steps/mm"); - PROGMEM Language_Str MSG_E_STEPS = LCD_STR_E _UxGT(" Steps/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* Steps/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Bewegung"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filamentdurchmesser"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filamentdurchmesser *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Entladen mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Laden mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Vorschubfaktor"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD-Kontrast"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Standardwerte laden"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Werkseinstellungen"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("FW Update vom Medium"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Drucker neustarten"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aktualisieren"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Vorbereitung"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Justierung"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Starte Druck"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Weiter"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Bestätigen"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Drucken"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reseten"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Abbrechen"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Fertig"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("SD-Druck pausieren"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("SD-Druck fortsetzen"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("SD-Druck abbrechen"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Wiederh. n. Stroma."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Druck vom Medium"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Kein Medium"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Warten..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Klick zum Fortsetzen"); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Druck pausiert..."); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Druckt..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Druck abgebrochen"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Motoren angeschaltet"); - PROGMEM Language_Str MSG_KILLED = _UxGT("ABGEBROCHEN"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ANGEHALTEN"); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Einzug mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Wechs. Einzug mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("V Einzug"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Z-Sprung mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Wechs. UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Autom. Einzug"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Einzugslänge"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Entladelänge"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Werkzeugwechsel"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z anheben"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime-Geschwin."); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Einzug-Geschwin."); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Düsen-Standby"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Filament wechseln"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Filament wechseln *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Filament laden"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Filament laden *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Filament entladen"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Filament entladen *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Alles entladen"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Medium initial."); // Manually initialize the SD-card via user interface - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Medium getauscht"); // SD-card changed by user. For machines with no autocarddetect. Both send "M21" - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Medium freigeben"); // if Marlin gets confused - M22 - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z-Sonde außerhalb"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Korrekturfaktor"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selbsttest"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch zurücks."); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch ausfahren"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("BLTouch SW-Modus"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch 5V-Modus"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch OD-Modus"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("BLTouch Mode Store"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("BLTouch auf 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("BLTouch auf OD"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch einfahren"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("BLTouch Modus: "); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("ACHTUNG: Falsche Einstellung - kann zu Beschädigung führen! Fortfahren?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("TouchMI initial."); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z-Versatz"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Speichern"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI ausfahren"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Sonde ausfahren"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Sonde einfahren"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Vorher %s%s%s homen"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Sondenversatz Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Bett heizen fehlge."); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Geh. heizen fehlge."); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEMP-ABWEI."); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("BETT") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("GEH.") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = " " LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); - PROGMEM Language_Str MSG_ERR_MINTEMP = " " LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err:Gehäuse max Temp"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err:Gehäuse min Temp"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Vorher XY homen"); - PROGMEM Language_Str MSG_HALTED = _UxGT("DRUCKER GESTOPPT"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Bitte neustarten"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("t"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("heizt..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("kühlt..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bett heizt..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Bett kühlt..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Gehäuse heizt..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Gehäuse kühlt..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta kalibrieren"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibriere X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibriere Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibriere Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibriere Mitte"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Einst. anzeig."); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autom. Kalibrierung"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Höhe setzen"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Sondenversatz Z"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Höhe"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Über den Drucker"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Drucker-Info"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Punkt-Nivellierung"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineare Nivellierung"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineare Nivell."); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Netz-Nivellierung"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Drucker-Statistik"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board-Info"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistoren"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruder"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudrate"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoll"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Beleuchtung"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Helligkeit"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette Drucke"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Gesamte Druckzeit"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längste Druckzeit"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Gesamt Extrudiert"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Drucke"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Gesamte"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längste"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Netzteil"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Motorleistung"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Treiber %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC Verbindungsfehler"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Werte speichern"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT WECHSEL"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("DRUCK PAUSIERT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("FILAMENT LADEN"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("FILAMENT ENTLADEN"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("FORTS. OPTIONEN:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Mehr entladen"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Druck weiter"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Düse: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout-Sensor"); - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout-Weg mm"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Homing gescheitert"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing gescheitert"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: zu kalt"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("FILAMENT WÄHLEN"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Update MMU Firmware!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU handeln erfor."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Druck fortsetzen"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Fortfahren..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Filament laden"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Lade alle"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Düse laden"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Filament auswerfen"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Filament ~ auswerfen"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Filament entladen "); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Lade Fila. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Fila. auswerfen..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Fila. entladen..."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Alle"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("setze MMU zurück"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU zurücksetzen..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Entfernen, klicken"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponente ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mixer"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); // equal Farbverlauf - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Volle Gradient"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Mix umschalten"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Zyklus Mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Umgekehrte Gradient"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktives V-Tool"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("V-Tool Start"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT("V-Tool Ende"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("V-Tool Alias"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("V-Tools Reseten"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("V-Tool Mix sichern"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-Tools ist resetet"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Z Start:"); - PROGMEM Language_Str MSG_END_Z = _UxGT("Z Ende:"); - PROGMEM Language_Str MSG_GAMES = _UxGT("Spiele"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - - // - // Die Filament-Change-Bildschirme können bis zu 3 Zeilen auf einem 4-Zeilen-Display anzeigen - // ...oder 2 Zeilen auf einem 3-Zeilen-Display. - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Knopf drücken um", "Druck fortzusetzen")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_2_LINE("Druck ist", "pausiert...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Warte auf den", "Start des", "Filamentwechsels...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Filament einlegen", "und Knopf drücken", "um fortzusetzen")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Knopf drücken um", "Düse aufzuheizen")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Düse heizt auf", "bitte warten...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Warte auf", "Herausnahme", "des Filaments...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Warte auf", "Laden des", "Filaments...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Warte auf", "Entladen des", "Filaments...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Klicke um", "die Fila-Entladung", "zu beenden")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Warte auf", "Fortsetzen des", "Drucks...")); - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Klick zum Fortsetzen")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Pausiert...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Bitte warten...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Laden und Klick")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Klick zum Heizen")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Heizen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Entladen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Laden...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Entladen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Klick zum beenden", "der Fila-Entladung")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Fortsetzen...")); - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Treiber"); // Max length 18 characters - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Treiber Strom"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid threshold"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorloses Homing"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Schrittmodus"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop einsch."); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" im:"); - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Spiel"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korrektur"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Glätten"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el.h deleted file mode 100644 index 411c8cf666..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el.h +++ /dev/null @@ -1,192 +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 - -/** - * Greek - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_GREEK - -namespace Language_el { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Greek"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" έτοιμο."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Εισαγωγή κάρτας"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση Μοτέρ"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); //SHORTEN - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Αρχικό σημείο Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Αρχικό σημείο Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Επαναφορά Επ. Εκτύπωσης"); //SHORTEN - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει"); //SHORTEN - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Επόμενο σημείο"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Ολοκλήρωση επιπεδοποίησης!"); //SHORTEN - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων"); //SHORTEN - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις"); //SHORTEN - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" όλα"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" bed"); //SHORTEN - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" επιβεβαίωση"); //SHORTEN - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H0 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" όλα"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" bed"); //SHORTEN - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" επιβεβαίωση"); //SHORTEN - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Εξώθηση"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Ανάσυρση"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Μετακίνηση άξονα"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης"); //SHORTEN - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης"); //SHORTEN - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Μετακίνηση X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Μετακίνηση Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Ταχύτητα"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Επ. Εκτύπωσης Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ακροφύσιο"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Αυτομ ρύθμιση θερ/σίας"); //SHORTEN - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ενεργοποιημένο"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Απενεργοποιημένο"); - PROGMEM Language_Str MSG_ACC = _UxGT("Επιτάχυνση"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("Vαντίδραση ") LCD_STR_A; - PROGMEM Language_Str MSG_VB_JERK = _UxGT("Vαντίδραση ") LCD_STR_B; - PROGMEM Language_Str MSG_VC_JERK = _UxGT("Vαντίδραση ") LCD_STR_C; - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Vαντίδραση E"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("V Μέγιστο") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("V Μέγιστο") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("V Μέγιστο") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("V Μέγιστο") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("V Μέγιστο *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("V Ελάχιστο"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aμεγ ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aμεγ ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aμεγ ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aμεγ ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aμεγ *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bήματα ανά μμ"); - PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bήματα ") LCD_STR_A _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bήματα ") LCD_STR_B _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bήματα ") LCD_STR_C _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); //SHORTEN - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Οθόνη πληροφόρησης"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Συντονισμός"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Παύση εκτύπωσης"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Συνέχιση εκτύπωσης"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Διακοπή εκτύπωσης"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Εκτύπωση από SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Δεν βρέθηκε SD"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Αναστολή λειτουργίας"); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Αναμονή για χρήστη"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Διακόπτεται η εκτύπωση"); //SHORTEN - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Καμία κίνηση."); - PROGMEM Language_Str MSG_KILLED = _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ΔΙΑΚΟΠΗ. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ανάσυρση μμ"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Εναλλαγή ανάσυρσης μμ"); //SHORTEN - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ανάσυρση V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Μεταπήδηση μμ"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Αυτόματη ανάσυρση"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Αλλαγή νήματος"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Αλλαγή νήματος *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Προετοιμασία κάρτας SD"); //SHORTEN - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Αλλαγή κάρτας SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης"); //SHORTEN - PROGMEM Language_Str MSG_YX_UNHOMED = _UxGT("Επαναφορά Χ/Υ πριν από Ζ"); //SHORTEN - PROGMEM Language_Str MSG_XYZ_UNHOMED = _UxGT("Επαναφορά ΧΥΖ πρώτα"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Μετατόπιση Ζ"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Μικρό βήμα Χ"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Ακύρωση endstop "); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Ανεπιτυχής θέρμανση"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ"); //SHORTEN - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ"); //SHORTEN - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ"); //SHORTEN - PROGMEM Language_Str MSG_HALTED = _UxGT("H εκτύπωση διακόπηκε"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Θερμαίνεται…"); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Θέρμανση ΕΠ. Εκτύπωσης"); //SHORTEN - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Βαθμονόμηση Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Βαθμονόμηση X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Βαθμονόμηση Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el_gr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el_gr.h deleted file mode 100644 index d4067f4c06..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_el_gr.h +++ /dev/null @@ -1,201 +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 - -/** - * Greek (Greece) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_GREEK - -namespace Language_el_gr { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Greek (Greece)"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" έτοιμο."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Εισαγωγή κάρτας"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση βηματιστή"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Αρχικό σημείο Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Αρχικό σημείο Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Κάντε κλικ για να ξεκινήσετε"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Επόμενο σημείο"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Ολοκλήρωση επιπεδοποίησης!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" όλα"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" κλίνη"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" επιβεβαίωση"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" όλα"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" κλίνη"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" επιβεβαίωση"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Εξώθηση"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Ανάσυρση"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Μετακίνηση άξονα"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Επιπεδοποίηση κλίνης"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Επιπεδοποίηση κλίνης"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Μετακίνηση X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Μετακίνηση Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Ταχύτητα"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Κλίνη Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ακροφύσιο"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Αυτομ. ρύθμιση θερμοκρασίας"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ενεργοποιημένο"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Απενεργοποιημένο"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Επιτάχυνση"); - PROGMEM Language_Str MSG_JERK = _UxGT("Vαντίδραση"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("Vαντίδραση ") LCD_STR_A; - PROGMEM Language_Str MSG_VB_JERK = _UxGT("Vαντίδραση ") LCD_STR_B; - PROGMEM Language_Str MSG_VC_JERK = _UxGT("Vαντίδραση ") LCD_STR_C; - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Vαντίδραση E"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vμεγ ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vμεγ ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vμεγ ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vμεγ ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vμεγ *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vελαχ"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aμεγ ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aμεγ ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aμεγ ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aμεγ ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aμεγ *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bήματα ανά μμ"); - PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bήματα ") LCD_STR_A _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bήματα ") LCD_STR_B _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bήματα ") LCD_STR_C _UxGT(" ανά μμ"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Οθόνη πληροφόρησης"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Συντονισμός"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Παύση εκτύπωσης"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Συνέχιση εκτύπωσης"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Διακοπή εκτύπωσης"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Εκτύπωση από SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Δεν βρέθηκε SD"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Αναστολή λειτουργίας…"); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Αναμονή για χρήστη…"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Διακόπτεται η εκτύπωση"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Καμία κίνηση."); - PROGMEM Language_Str MSG_KILLED = _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ΔΙΑΚΟΠΗ. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ανάσυρση μμ"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Εναλλαγή ανάσυρσης μμ"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ανάσυρση V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Μεταπήδηση μμ"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Αυτόματη ανάσυρση"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Αλλαγή νήματος"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Αλλαγή νήματος *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Προετοιμασία κάρτας SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Αλλαγή κάρτας SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Διερεύνηση Z εκτός κλίνης"); - PROGMEM Language_Str MSG_YX_UNHOMED = _UxGT("Επαναφορά Χ/Υ πριν από Ζ"); - PROGMEM Language_Str MSG_XYZ_UNHOMED = _UxGT("Επαναφορά ΧΥΖ πρώτα"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Μετατόπιση Ζ"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Μικρό βήμα Χ"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Ματαίωση endstop "); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Ανεπιτυχής θέρμανση"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Θερμαίνεται…"); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Θέρμανση κλίνης…"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Βαθμονόμηση Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Βαθμονόμηση X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Βαθμονόμηση Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_en.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_en.h deleted file mode 100644 index 0f41726a94..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_en.h +++ /dev/null @@ -1,601 +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 - -/** - * English - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define en 1234 -#if LCD_LANGUAGE == en - #define NOT_EXTENDED_ISO10646_1_5X7 -#endif -#undef en - -namespace Language_en { - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("English"); - - #ifdef NOT_EXTENDED_ISO10646_1_5X7 - PROGMEM Language_Str MSG_CUBED = _UxGT("^3"); - #else - PROGMEM Language_Str MSG_CUBED = _UxGT("³"); - #endif - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Ready."); - PROGMEM Language_Str MSG_YES = _UxGT("YES"); - PROGMEM Language_Str MSG_NO = _UxGT("NO"); - PROGMEM Language_Str MSG_BACK = _UxGT("Back"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Aborting..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Inserted"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Removed"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Media Released"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Waiting for media"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Media read error"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB device removed"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start failed"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Advanced Settings"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disable Steppers"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Progress Bar Test"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click to Begin"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Next Point"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Leveling Done!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Set Home Offsets"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Set Origin"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preheat ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preheat ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" All"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preheat ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preheat ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" All"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Conf"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preheat Custom"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Cooldown"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser Control"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindle Control"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Off"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle On"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Power"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Reverse"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch Power On"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Switch Power Off"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrude"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retract"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Move Axis"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bed Leveling"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Level Bed"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Level Corners"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Next Corner"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Mesh Editor"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Edit Mesh"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Mesh Editing Stopped"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Probing Point"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z Value"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Custom Commands"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Probe Test"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Point"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Deviation"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Mode"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Tool Offsets"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Doing G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Tools"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Tilting Point"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manually Build Mesh"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Place Shim & Measure"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Measure"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Remove & Measure Bed"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Moving to next"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activate UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deactivate UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Mesh Edit"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edit Custom Mesh"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Fine Tuning Mesh"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Done Editing Mesh"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Build Custom Mesh"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Build Mesh"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Build Mesh (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Build Mesh (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Build Cold Mesh"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Adjust Mesh Height"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Height Amount"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validate Mesh"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Validate Mesh (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Validate Mesh (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validate Custom Mesh"); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Heating Bed"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Heating Nozzle"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Manual priming..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Fixed Length Prime"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Done Priming"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Canceled"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Leaving G26"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continue Bed Mesh"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Mesh Leveling"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Point Leveling"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Grid Mesh Leveling"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Level Mesh"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Side Points"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Map Type"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Output Mesh Map"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Output for Host"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Output for CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Off Printer Backup"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Output UBL Info"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Fill-in Amount"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manual Fill-in"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Smart Fill-in"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Fill-in Mesh"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidate All"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidate Closest"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Fine Tune All"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Fine Tune Closest"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Storage"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Memory Slot"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Load Bed Mesh"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Save Bed Mesh"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i Loaded"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i Saved"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("No Storage"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: UBL Save"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: UBL Restore"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Stopped"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Step-By-Step UBL"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Build Cold Mesh"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Smart Fill-in"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Validate Mesh"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Fine Tune All"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Validate Mesh"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Fine Tune All"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Save Bed Mesh"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Control"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Lights"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Light Presets"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Red"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Yellow"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Green"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blue"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violet"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("White"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Default"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Custom Lights"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Red Intensity"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Green Intensity"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Blue Intensity"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("White Intensity"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brightness"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Moving..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Free XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Move X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Move Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Move Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Move %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Speed"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Bed"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Enclosure"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Speed"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Speed ="); - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Stored Fan ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra Fan Speed"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fan Speed ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("On"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off"); - PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); - PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Select"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Select *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); - PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-Jerk"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-Jerk"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-Jerk"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-Jerk"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocity"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VTrav Min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Acceleration"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-Retract"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-Travel"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Steps/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("steps/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("steps/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("steps/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Esteps/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*steps/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Motion"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Unload mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Load mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Contrast"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Store Settings"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Load Settings"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restore failsafe"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialize EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Media Update"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset Printer"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info Screen"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepare"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Tune"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start Print"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Next"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Init"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Print"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Cancel"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Done"); - PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Back"); - PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceed"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause Print"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resume Print"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop Print"); - PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Printing Object"); - PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); - PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancel Object ="); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Outage Recovery"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print from Media"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No Media"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Sleep..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Click to Resume..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Print Paused"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Printing..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print Aborted"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("No Move."); - PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPED. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retract mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retract V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Swap Length"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Purge Length"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Tool Change"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Raise"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime Speed"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Retract Speed"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Nozzle Standby"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Change Filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Load Filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load Filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload Filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. Media"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Change Media"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Release Media"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z Probe Past Bed"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Skew Factor"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Stow"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Deploy"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: SW-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: 5V-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: OD-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Mode-Store"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Set BLTouch to 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Set BLTouch to OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Report Drain"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("DANGER: Bad settings can cause damage! Proceed anyway?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Test"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Save"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Probe Z Offset"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Bed Heating Failed"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Chamber Heating Fail"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: REDUNDANT TEMP"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("BED THERMAL RUNAWAY"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("CHAMBER T. RUNAWAY"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: MAXTEMP"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: MAXTEMP BED"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: MINTEMP BED"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: MAXTEMP CHAMBER"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: MINTEMP CHAMBER"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY First"); - PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER HALTED"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Please Reset"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Heating..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Cooling..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bed Heating..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Bed Cooling..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Chamber Heating..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Chamber Cooling..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Calibration"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrate X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrate Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrate Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrate Center"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Settings"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibration"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Set Delta Height"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Probe Z-offset"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Height"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("About Printer"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Printer Info"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Point Leveling"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Linear Leveling"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilinear Leveling"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mesh Leveling"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Printer Stats"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board Info"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruders"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Runaway Watch: OFF"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Runaway Watch: ON"); - - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Case Light"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total Print time"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Prints"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Longest"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("PRINT PAUSED"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("LOAD FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("UNLOAD FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("RESUME OPTIONS:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purge more"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continue"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout Sensor"); - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout Dist mm"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Homing Failed"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing Failed"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Too Cold"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("CHOOSE FILAMENT"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Update MMU Firmware!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Needs Attention."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Resume Print"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Resuming..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Load Filament"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Load All"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Load to Nozzle"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Eject Filament"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Eject Filament ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Unload Filament"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Loading Fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Ejecting Fil. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Unloading Fil...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("All"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reset MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetting MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Component ="); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mixer"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Full Gradient"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Toggle Mix"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle Mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Reverse Gradient"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Start V-tool"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" End V-tool"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset V-tools"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit V-tool Mix"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools Were Reset"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Start Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" End Z:"); - - PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - - #define MSG_1_LINE(A) A "\0" "\0" - #define MSG_2_LINE(A,B) A "\0" B "\0" - #define MSG_3_LINE(A,B,C) A "\0" B "\0" C - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Press Button", "to resume print")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Wait for", "filament change", "to start")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Insert filament", "and press button", "to continue")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Press button", "to heat nozzle")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozzle heating", "Please wait...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Wait for", "filament unload")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Wait for", "filament load")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Wait for", "filament purge")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Click to finish", "filament purge")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Wait for print", "to resume...")); - #else - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Click to continue")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Please wait...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insert and Click")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Click to heat")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Heating...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Ejecting...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Loading...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purging...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Click to finish")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Resuming...")); - #endif - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Drivers"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver Current"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid Threshold"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorless Homing"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stepping Mode"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Enabled"); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" in:"); - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Backlash"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); -} - -#if FAN_COUNT == 1 - #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED - #define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED -#else - #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_N - #define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED_N -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_es.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_es.h deleted file mode 100644 index 2ff190e41f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_es.h +++ /dev/null @@ -1,544 +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 - -/** - * Spanish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_es { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Spanish"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" lista"); - PROGMEM Language_Str MSG_YES = _UxGT("SI"); - PROGMEM Language_Str MSG_NO = _UxGT("NO"); - PROGMEM Language_Str MSG_BACK = _UxGT("Atrás"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Cancelando..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD/USB insertado"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD/USB retirado"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("SD/USB lanzado"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Esperando al SD/USB"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Error lectura SD/USB"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Disp. USB retirado"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Inicio USB fallido"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ajustes avanzados"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuración"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automático"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menú depuración"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prob. barra progreso"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Llevar al origen"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Origen X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Origen Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Origen Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto alineado Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origen XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Pulsar para comenzar"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Siguiente punto"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("¡Nivelación lista!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Compensación Altura"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ajustar desfases"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicada"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Establecer origen"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Fin"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Fin ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Todo"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Cama"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Ajuste"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Precalentar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Precalentar ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Fin"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Fin ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Todo"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Cama"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Ajuste"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Precalen. Personali."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Láser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Láser Apagado"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Láser Encendido"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potencia Láser"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Control Mandrino"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Mandrino Apagado"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Mandrino Encendido"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potencia Mandrino"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Invertir giro"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Encender Fuente"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Apagar Fuente"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruir"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover ejes"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelando Cama"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar Cama"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivelar Esquinas"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Siguente Esquina"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mallado"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editar Mallado"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Ed. Mallado parada"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Sondear Punto"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Índice X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Índice Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valor Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comandos Personaliz."); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Probar Sonda"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punto"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Desviación"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Desfase Boquillas"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Aparcado"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicar"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia Reflejada"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Control Total"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2ª Boquilla X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2ª Boquilla Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2ª Boquilla Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Hacer G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Herramientas UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Nivel.Cama.Uni.(UBL)"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto de inclinación"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Crear Mallado man."); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Colocar cuña y Medir"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Medir"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Retirar y Medir Cama"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Mover al Siguente"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activar UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Desactivar UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Cama"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT ("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editar Mallado"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edit. Mallado perso."); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ajuste fino Mallado"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Term. edici. Mallado"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crear Mallado Perso."); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Crear Mallado"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Crear Mallado (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Crear Mallado (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Crear Mallado Frío"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajustar alt. Mallado"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Cantidad de altura"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validar Mallado"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Validar Mallado (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Validar Mallado (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Vali. Mallado perso."); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Calentando Cama"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Calent. Boquilla"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Imprimado manual..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Impri. longit. fija"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Imprimación Lista"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Cancelado"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Dejando G26"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Contin. Mallado cama"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nivelando Mallado"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Nivelando 3Puntos"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Nivel. Mallado cuad."); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivel de Mallado"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Puntos Laterales"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo de mapa "); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Salida Mapa mallado"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Salida para el host"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Salida para CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Off Printer Backup"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Salida Info. UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Cantidad de relleno"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Relleno manual"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Relleno inteligente"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Mallado de relleno"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidar todo"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidar proximos"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ajustar Fino Todo"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ajustar Fino proxi."); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Almacen de Mallado"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Huecos de memoria"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Cargar Mallado cama"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Guardar Mallado cama"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mallado %i Cargado"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mallado %i Guardado"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Sin guardar"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Error: Guardar UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Error: Restaurar UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Desfase de Z: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Desfase de Z Parado"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Paso a Paso"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crear Mallado Frío"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Relleno inteligente"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Validar Mallado"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ajustar Fino Todo"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Validar Mallado"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ajustar Fino Todo"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Guardar Mallado cama"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Control LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Luzes"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Luz predefinida"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rojo"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Naranja"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Amarillo"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Verde"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Azul"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Índigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violeta"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Blanco"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Por defecto"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luces personalizadas"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensidad Rojo"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensidad Verde"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensidad Azul"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensidad Blanco"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brillo"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Moviendo..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Libre XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend muy frio"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidad"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Cama Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Boquilla"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Boquilla ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Cama"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Recinto"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ventilador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ventilador ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Vel. Ext. ventilador"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Ext. ventilador ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Flujo"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flujo ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temperatura Auto."); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Encender"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Apagar"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Seleccionar"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleccionar *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Aceleración"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidad"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vel. viaje min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Acel. max") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Acel. max") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Acel. max") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Acel. max") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Acel. max *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acel. retrac."); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acel. Viaje"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pasos/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pasos/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pasos/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarga mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carga mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avance K"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avance K *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar EEPROM"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar EEPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. fábrica"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializar EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/USB"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetear Impresora"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Recargar"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Pantalla de Inf."); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Ajustar"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Iniciar impresión"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Siguinte"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Iniciar"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Parar"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Imprimir"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reiniciar"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Cancelar"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Listo"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impresión"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Reanudar impresión"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Detener impresión"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Recuper. por interr."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprim. desde SD/USB"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD/USB no presente"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Reposo..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Pulsar para Reanudar"); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impresión Pausada"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Imprimiendo..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impresión cancelada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sin movimiento"); - PROGMEM Language_Str MSG_KILLED = _UxGT("MUERTA"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("DETENIDA"); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraer mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Interc. Retraer mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraer V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Levantar mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Interc. DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retracción Auto."); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Inter. longitud"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Purgar longitud"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Cambiar Herramienta"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Aumentar Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime Speed"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Vel. de retracción"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Colocar boquilla"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambiar filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambiar filamento *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Cargar filamento"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Cargar filamento *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Descargar filamento"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Descargar fil. *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descargar todo"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciar SD/USB"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar SD/USB"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Lanzar SD/USB"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fuera cama"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Factor de desviación"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Auto-Prueba"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reiniciar"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Bajar pistón"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Subir pistón"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Modo Software"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Modo 5V"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Modo OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Modo almacenar"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Poner BLTouch a 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Poner BLTouch a OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Informe de drenaje"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PELIGRO: ¡Una mala configuración puede producir daños! ¿Proceder igualmente?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Iniciar TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test de desfase Z"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Guardar"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Subir TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Subir Sonda Z"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Bajar Sonda Z"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Origen %s%s%s Primero"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desfase Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Calent. fallido"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Calent. cama fallido"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Calent. Cám. fallido"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP. REDUN."); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("FUGA TÉRMICA CAMA"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("FUGA TÉRMICA CAMARA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err:TEMP. MÁX"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err:TEMP. MIN"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err:TEMP. MÁX CAMA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err:TEMP. MIN CAMA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err:TEMP. MÁX CÁMARA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err:TEMP. MIN CÁMARA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Origen XY Primero"); - PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESORA DETENIDA"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Por favor, reinicie"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Calentando..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Enfriando..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Calentando Cama..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Enfriando Cama..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Calentando Cámara..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Enfriando Cámara..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibración Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Configuración Delta"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibración"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Est. Altura Delta"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ajustar Sonda Z"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonal"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altura"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radio"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Acerca de Impresora"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. Impresora"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelando 3puntos"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelando Lineal"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelando Bilineal"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelando UBL"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelando en Mallado"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadísticas Imp."); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. Controlador"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusores"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz cabina"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Brillo cabina"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Cont. de impresión"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tiempo total de imp."); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impresión más larga"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extruido"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impresiones"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Más larga"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruido"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp. Mínima"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp. Máxima"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fuente alimentación"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Fuerza de empuje"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERROR CONEX. TMC"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPRESIÓN PAUSADA"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARGAR FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DESCARGAR FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPC. REINICIO:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purgar más"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continuar imp."); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Boquilla: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sensor de sección"); - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist de secc. mm"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Ir a origen Fallado"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondeo Fallado"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Muy Frio"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ELIJE FILAMENTO"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("¡Actu. MMU Firmware!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Necesita Cuidado"); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Continuar imp."); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Resumiendo..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Cargar Filamento"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Cargar Todo"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Cargar hasta boqui."); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Expulsar Filamento"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Expulsar Filamento ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Descargar Filamento"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Cargando Fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Expulsando Fil. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Descargando Fil...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Todo"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filamento ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reiniciar MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Reiniciando MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Retirar, y pulsar"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Mezcla"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Componente ="); - PROGMEM Language_Str MSG_MIXER = _UxGT("Miezclador"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Degradado"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Degradado Total"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Mezcla Conmutada"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Mezcla Cíclica"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Mezcla de Degradado"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Degradado inverso"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Activar Herr.V"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Inicio Herr.V"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Fin Herr.V"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias Herr.V"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reiniciar Herr.V"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Cometer mezc. Herr.V"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("Herr.V reiniciados"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Inicio Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" Fin Z:"); - - PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Pulsar el botón para", "reanudar impresión")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Aparcando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperando para", "iniciar el cambio", "de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Inserte el filamento", "y pulse el botón", "para continuar...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Pulse el botón para", "calentar la boquilla")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Calentando boquilla", "Espere por favor...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Espere para", "liberar el filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Espere para", "purgar el filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Pulse para finalizar", "la purga de filamen.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperando impresora", "para reanudar...")); - #else - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Pulse para continuar")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Aparcando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Por Favor espere...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Inserte y Pulse")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Pulse para Calentar")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Calentando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Liberando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Cargando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purgando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Pulse para finalizar")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reanudando...")); - #endif - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Controladores TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Amperaje Controlador"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Límite Hibrido"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Origen sin sensores"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo de pasos"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Habilit."); - - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reiniciar"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" dentro:"); - - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Suavizado"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_eu.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_eu.h deleted file mode 100644 index 12483c78da..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_eu.h +++ /dev/null @@ -1,321 +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 - -/** - * Basque-Euskera - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -namespace Language_eu { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Basque-Euskera"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" prest."); - PROGMEM Language_Str MSG_BACK = _UxGT("Atzera"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Txartela sartuta"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Txartela kenduta"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu nagusia"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto hasiera"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Itzali motoreak"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Arazketa Menua"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prog. Barra Proba"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Hasierara joan"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X jatorrira"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y jatorrira"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z jatorrira"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ hasieraratzen"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik egin hasteko"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Hurrengo Puntua"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Berdintzea eginda"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Etxe. offset eza."); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsetak ezarrita"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Hasiera ipini"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Berotu ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Berotu ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Amaia"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Amaia ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Guztia"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Ohea"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Ezarp."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Berotu ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Berotu ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Amaia"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Amaia ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Guztia"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Ohea"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Ezarp."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Hoztu"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Energia piztu"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Energia itzali"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Estruitu"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Atzera eragin"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Ardatzak mugitu"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Ohe berdinketa"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Ohea berdindu"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Ertzak berdindu"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Hurrengo ertza"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Sarea editatu"); - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 exekutatzen"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Tresnak"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Sarea eskuz sortu"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Neurtu"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL aktibatu"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL desaktibatu"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Ohearen tenperatura"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Mutur beroaren tenp."); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Sarea editatu"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Sarea editatzea eginda"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Sarea sortu"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = PREHEAT_1_LABEL _UxGT(" sarea sortu"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = PREHEAT_2_LABEL _UxGT(" sarea sortu"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Sare hotza sortu"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Sarearen altuera doitu"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Sarea balioetsi"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = PREHEAT_1_LABEL _UxGT(" sarea balioetsi"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = PREHEAT_2_LABEL _UxGT(" sarea balioetsi"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Ohe sarea balioetsi"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Sare berdinketa"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3 puntuko berdinketa"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Lauki-sare berdinketa"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Sarea berdindu"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Mapa mota"); - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED ezarpenak"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Argiak"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Argi aurrehautaketak"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Gorria"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Laranja"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Horia"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Berdea"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Urdina"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Bioleta"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Zuria"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Lehenetsia"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Argi pertsonalizatuak"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intentsitate gorria"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intentsitate berdea"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intentsitate urdina"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intentsitate zuria"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Distira"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Mugitzen..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Askatu XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mugitu X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mugitu Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mugitu Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusorea"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusorea *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mugitu %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mugitu 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mugitu 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mugitu 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Abiadura"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Ohea"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Pita"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Pita ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Ohea"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Haizagailu abiadura"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Haizagailu abiadura ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Haiz.gehig. abiadura"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Haiz.gehig. abiadura ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxua"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxua ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrola"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto tenperatura"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Aukeratu"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Aukeratu *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Azelerazioa"); - PROGMEM Language_Str MSG_JERK = _UxGT("Astindua"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-astindua"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-astindua"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-astindua"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-astindua"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VBidaia min"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-bidaia"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pausoak/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pausoak/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pausoak/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pausoak/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pausoak/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pausoak/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Tenperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Mugimendua"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Harizpia"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E mm3-tan"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Hariz. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Hariz. Dia. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Deskargatu mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Kargatu mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Aurrerapena"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Aurrerapena *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrastea"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gorde memoria"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Kargatu memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Larri. berriz."); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM-a hasieratu"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Berriz kargatu"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Pantaila info"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Prestatu"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Doitu"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausatu inprimak."); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Jarraitu inprima."); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Gelditu inprima."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD-tik inprimatu"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Ez dago SD-rik"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Lo egin..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Aginduak zain..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Inprim. geldi."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Inprim. deusezta."); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Mugimendu gabe."); - PROGMEM Language_Str MSG_KILLED = _UxGT("AKABATUTA. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("GELDITUTA. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Atzera egin mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Atzera mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Atzera egin V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Igo mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Atzera egin mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap Atzera mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Atzera egin V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Atzera egin"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Aldatu harizpia"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Aldatu harizpia *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Harizpia kargatu"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Harizpia kargatu *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Harizpia deskargatu"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Harizpia deskargatu *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Erabat deskargatu"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Hasieratu SD-a"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Aldatu txartela"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z zunda kanpora"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Okertze faktorea"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch AutoProba"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch berrabia."); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch jaitsi/luzatu"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch igo/jaso"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Etxera %s%s%s lehenengo"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Konpentsatu"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Mikro-urratsa Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop deusezta."); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Err: Beroketa"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: Tenperatura"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TENP. KONTROL EZA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: Tenp Maximoa"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: Tenp Minimoa"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: Ohe Tenp Max"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: Ohe Tenp Min"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Etxera XY lehenengo"); - PROGMEM Language_Str MSG_HALTED = _UxGT("INPRIMA. GELDIRIK"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Berrabia. Mesedez"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Berotzen..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ohea Berotzen..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibraketa"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibratu X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibratu Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibratu Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibratu Zentrua"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta ezarpenak"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibraketa"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Alt. Ezar."); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra diagonala"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altuera"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Erradioa"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Inprimagailu Inf."); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Inprimagailu Inf."); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3 puntuko berdinketa"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Berdinketa lineala"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Berdinketa bilinearra"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Sare berdinketa"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Inprima. estatis."); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Txartelaren Info."); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistoreak"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Estrusoreak"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudioak"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoloa"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Kabina Argia"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS - = ; - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Inprim. Zenbaketa"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Burututa"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Inprim. denbora"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Imprimatze luzeena"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estruituta guztira"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Inprimatze"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Burututa"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Guztira"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Luzeena"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estrusio"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Tenp. Minimoa"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Tenp. Maximoa"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Elikadura-iturria"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Driver-aren potentzia"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Idatzi DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("HARIZPIA ALDATU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("HARIZPIA KARGATU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("HARIZPIA DESKARGATU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ALDAKETA AUKERAK:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Inprima. jarraitu"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Pita: "); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Hasi. huts egin du"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Neurketak huts egin du"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: hotzegi"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Inprimagailu okerra"); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Mesedez, itxaron...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Deskargatzen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Sartu eta click egin")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Berotzen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Kargatzen...")); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fi.h deleted file mode 100644 index f262eee2b4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fi.h +++ /dev/null @@ -1,128 +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 - -/** - * Finnish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_fi { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Finnish"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" valmis."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kortti asetettu"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kortti poistettu"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Palaa"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Automaatti"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Vapauta moottorit"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Aja referenssiin"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Aseta origo"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Esilämmitä ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Esilämmitä ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT("Suutin"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT("Suutin ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT(" Kaikki"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT(" Alusta"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Esilämm. ") PREHEAT_1_LABEL _UxGT(" konf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Esilämmitä ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Esilämmitä ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT("Suutin"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT("Suutin ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT(" Kaikki"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT(" Alusta"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Esilämm. ") PREHEAT_2_LABEL _UxGT(" konf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Jäähdytä"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Virta päälle"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Virta pois"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Pursota"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Vedä takaisin"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Liikuta akseleita"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Liikuta X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Liikuta Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Liikuta Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Liikuta %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Liikuta 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Liikuta 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Liikuta 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Nopeus"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Suutin"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Suutin ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Alusta"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tuul. nopeus"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tuul. nopeus ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Virtaus"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Virtaus ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrolli"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Kerr"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); - PROGMEM Language_Str MSG_ACC = _UxGT("Kiihtyv"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VLiike min"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-peruuta"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Lämpötila"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Liike"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrasti"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Tallenna muistiin"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Lataa muistista"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Palauta oletus"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Päivitä"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Seuraa"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Valmistele"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Säädä"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Keskeytä tulostus"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Jatka tulostusta"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Pysäytä tulostus"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Korttivalikko"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Ei korttia"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Nukkumassa..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Odotet. valintaa"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Ei liiketta."); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Vedä mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Va. Vedä mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Vedä V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Va. UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoVeto."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrointi"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibroi X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibroi Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibroi Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibroi Center"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Väärä tulostin"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fr.h deleted file mode 100644 index bf583c8e8f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_fr.h +++ /dev/null @@ -1,528 +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 - -/** - * French - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_fr { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Français"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" prête."); - PROGMEM Language_Str MSG_YES = _UxGT("Oui"); - PROGMEM Language_Str MSG_NO = _UxGT("Non"); - PROGMEM Language_Str MSG_BACK = _UxGT("Retour"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Annulation..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Média inséré"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Média retiré"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Média libéré"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Attente média"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Err lecture média"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB débranché"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Erreur média USB"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Butées"); - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Butées SW"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. avancée"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Exéc. auto#.gcode"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Arrêter moteurs"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu debug"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barre progress."); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Origine auto"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Origine X auto"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Origine Y auto"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Origine Z auto"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Align. Z auto"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origine XYZ..."); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Clic pour commencer"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Point suivant"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Mise à niveau OK!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Hauteur lissée"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Régl. décal origine"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Régler origine"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Préchauffage ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Préchauffage ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" buse"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" buse ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" Tout"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" lit"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Régler préch. ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Préchauffage ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Préchauffage ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" buse"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" buse ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" Tout"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" lit"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Régler préch. ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Préchauffage perso"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Refroidir"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Contrôle Laser"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Puissance"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverser broches"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Allumer alim."); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Eteindre alim."); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusion"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétractation"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Déplacer un axe"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Régler Niv. lit"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveau du lit"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Niveau des coins"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Coin suivant"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Edition Maillage"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifier maille"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Arrêt édit. maillage"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Mesure point"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valeur Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Commandes perso"); - - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Touche point"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("Ecart sonde Z M48"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Ecart"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("Point M48"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Mode IDEX"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copie miroir"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Contrôle complet"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Offsets Outil"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("Buse 2 X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("Buse 2 Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("Buse 2 Z"); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Chauffe lit"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Chauffe buse"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Amorce manuelle..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Amorce longueur fixe"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Amorce terminée"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 annulé"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Sortie G26"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 en cours"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Outils UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Niveau lit unifié"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Maillage manuel"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Poser câle & mesurer"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Mesure"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("ôter et mesurer lit"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Aller au suivant"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activer l'UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Désactiver l'UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Température lit"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Température lit"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Température buse"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Température buse"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editer maille"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Editer maille perso"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Réglage fin maille"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Terminer maille"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Créer maille perso"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Créer maille"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Créer maille ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Créer maille ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Créer maille froide"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajuster haut. maille"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Hauteur"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valider maille"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Valider maille ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Valider maille ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valider maille perso"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuer maille"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Niveau par maille"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Niveau à 3 points"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Niveau grille"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Maille de niveau"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Point latéral"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Type de carte"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Voir maille"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Voir pour hôte"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Voir pour CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Voir pour sauveg."); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Voir info UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Taux de remplissage"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Remplissage manuel"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Remplissage auto"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Maille remplissage"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Tout annuler"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Annuler le plus près"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Réglage fin (tous)"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Réglage fin (proche)"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Stockage maille"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot mémoire"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Charger maille"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Sauver maille"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Maille %i chargée"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Maille %i enreg."); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Pas de mémoire"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: Enreg. UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ouvrir UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Décal. Z arrêté"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Pas à pas"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Créer maille froide"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Remplissage auto"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valider maille"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Réglage fin (tous)"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valider maille"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Réglage fin (tous)"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Sauver maille"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Contrôle LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Lumière"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Préregl. LED"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rouge"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Jaune"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Vert"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Bleu"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violet"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Blanc"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Defaut"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("LEDs perso."); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensité rouge"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensité vert"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensité bleu"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensité blanc"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Luminosité"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Déplacement..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Débloquer XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Déplacer X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Déplacer Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Déplacer Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudeur"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudeur *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Buse trop froide"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Déplacer %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Déplacer 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Déplacer 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Déplacer 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Vitesse"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Lit Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Buse"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Buse ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Lit"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Caisson"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vit. ventil. "); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vit. ventil. ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra ventil. "); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra ventil. ="); - - PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Contrôler"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Facteur"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temp. Auto."); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Marche"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Arrêt"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Sélectionner"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Sélectionner *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Accélération"); - PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT(" jerk"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT(" jerk"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT(" jerk"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve jerk"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Vélocité"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Déviat. jonct."); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("V dépl. min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accélération"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A retrait"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A dépl."); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pas/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pas/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pas/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pas/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pas/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pas/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Température"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Mouvement"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diamètre fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diamètre fil. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Retrait mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Charger mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avance K"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avance K *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Enregistrer config."); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Charger config."); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurer défauts"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialiser EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("MaJ Firmware SD"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("RaZ imprimante"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Actualiser"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Surveiller"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Préparer"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Régler"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Démarrer impression"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Suivant"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Init."); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Imprimer"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Annuler"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Terminé"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause impression"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Reprendre impr."); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Arrêter impr."); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Récupér. coupure"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Impression SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Pas de média"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Repos..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Attente utilis."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impr. en pause"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Impression"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impr. annulée"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Moteurs bloqués"); - PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPÉ"); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrait mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ech. Retr. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retrait V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saut Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Rappel mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Ech. Rappel mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Rappel V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Ech. Rappel V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retrait auto"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Changement outil"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Augmenter Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Vitesse primaire"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Vitesse retrait"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Attente buse"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Distance retrait"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Longueur de purge"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Changer filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Changer filament *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Charger filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Charger filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Retrait filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Décharger tout"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Charger le média"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Actualiser média"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Retirer le média"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonde Z hors lit"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Facteur écart"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Ranger"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Déployer"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Mode SW"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Mode 5V"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Mode OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Appliquer Mode"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Mise en 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Mise en OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Afficher Mode"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init. TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test décalage Z"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Sauvegarde"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Déployer TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Déployer Sonde Z"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Ranger Sonde Z"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Origine %s%s%s Premier"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Décalage Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Butée abandon"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err TEMP. REDONDANTE"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err TEMP. MAX"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err TEMP. MIN"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Origine XY Premier"); - - PROGMEM Language_Str MSG_HALTED = _UxGT("IMPR. STOPPÉE"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Redémarrer SVP"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("j"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - - PROGMEM Language_Str MSG_HEATING = _UxGT("En chauffe..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Refroidissement"); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Lit en chauffe..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Refroid. du lit..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Chauffe caisson..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Refroid. caisson..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibration Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrer X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrer Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrer Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrer centre"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Réglages Delta"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Calibration Auto"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Hauteur Delta"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Delta Z sonde"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diagonale"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Hauteur"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Rayon"); - - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Infos imprimante"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Infos imprimante"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Niveau à 3 points"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Niveau linéaire"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Niveau bilinéaire"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Niveau lit unifié"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Niveau maillage"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Stats. imprimante"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Infos carte"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistances"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudeurs"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Bauds"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocole"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Lumière caisson"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosité"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Imprimante incorrecte"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Nbre impressions"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Terminées"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tps impr. total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impr. la + longue"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total filament"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impressions"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Terminées"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("+ long"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Filament"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp Min"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp Max"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Alimentation"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Puiss. moteur "); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM sauv."); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERREUR CONNEXION TMC"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CHANGER FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPR. PAUSE"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CHARGER FIL"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DECHARGER FIL"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPTIONS REPRISE:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purger encore"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Reprendre impr."); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Buse: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Capteur fil."); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Echec origine"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Echec sonde"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Trop froid"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("CHOISIR FILAMENT"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU ne répond plus"); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Continuer impr."); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Reprise..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Charger filament"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Charger tous"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Charger dans buse"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Ejecter filament"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Ejecter fil. ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Retrait filament"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Chargem. fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Ejection fil..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Retrait fil...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Tous"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Réinit. MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Réinit. MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Retrait, click"); - - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Composante ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mixeur"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Dégradé"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Dégradé complet"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Toggle mix"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Mix dégradé"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Inverser dégradé"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Début V-tool"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Fin V-tool"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Réinit. V-tools"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Valider Mix V-tool"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools réinit. ok"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Début Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" Fin Z:"); - PROGMEM Language_Str MSG_GAMES = _UxGT("Jeux"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Casse-briques"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Labyrinthe"); - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Presser bouton", "pour reprendre")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Attente filament", "pour démarrer")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Insérer filament", "et app. bouton", "pour continuer...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Presser le bouton", "pour chauffer...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Buse en chauffe", "Patienter SVP...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Attente", "retrait du filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Attente", "chargement filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Attente", "Purge filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Presser pour finir", "la purge du filament")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Attente reprise", "impression")); - #else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Clic pour continuer")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Patience...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insérer fil.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Chauffer ?")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Chauffage...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Retrait fil...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Chargement...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purge...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Terminer ?")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reprise...")); - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Courant driver"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Seuil hybride"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Home sans capteur"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Mode pas à pas"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop activé"); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Réinit."); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" dans:"); - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Lissage"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_gl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_gl.h deleted file mode 100644 index c9c80d1b27..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_gl.h +++ /dev/null @@ -1,215 +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 - -/** - * Galician language (ISO "gl") - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -namespace Language_gl { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Galician"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" lista."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tarxeta inserida"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarxeta retirada"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("FinCarro"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoarranque"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir a orixe"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir orixe X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir orixe Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir orixe Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Ir orixes XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Prema pulsador"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Seguinte punto"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivelado feito"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Offsets na orixe"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets fixados"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Fixar orixe"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Prequentar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Prequentar ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Bico"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Bico ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Todo"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Cama"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Prequentar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Prequentar ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Bico"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Bico ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Todo"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Cama"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefriar"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Acender"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Apagar"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudir"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixe"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelar cama"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar cama"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Cama Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Bico"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Bico ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Cama"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Velocidade vent."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Velocidade vent. ~"); - PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Escolla"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Escolla *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Acel"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pasos/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pasos/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pasos/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pasos/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movemento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. fil. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Constraste LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gardar en memo."); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar de memo."); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Cargar de firm."); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Volver a cargar"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Monitorizacion"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Axustar"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impres."); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Seguir impres."); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Deter impres."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tarxeta SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sen tarxeta SD"); - PROGMEM Language_Str MSG_DWELL = _UxGT("En repouso..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("A espera..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impre. cancelada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sen movemento."); - PROGMEM Language_Str MSG_KILLED = _UxGT("PROGRAMA MORTO"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("PROGRAMA PARADO"); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraccion mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Cambio retra. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraccion V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Alzar Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Recup. retra. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Cambio recup. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Recuperacion V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retraccion auto."); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambiar filamen."); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambiar filamen. *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciando SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda-Z sen cama"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Comprobar BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Iniciar BLTouch"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Erro fin carro"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Fallo quentando"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro temperatura"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Temp. excesiva"); - PROGMEM Language_Str MSG_HALTED = _UxGT("SISTEMA MORTO"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Debe reiniciar!"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Quentando..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Quentando cama..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibracion Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Acerca de..."); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Informacion"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadisticas"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Placa nai"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusores"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz"); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total traballos"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Total completos"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo impresion"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Traballo +longo"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total extruido"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Traballos"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completos"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("O +longo"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruido"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fonte alime."); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Potencia motor"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Garda DAC EEPROM"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Segue traballo"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Agarde para", "iniciar troco", "de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Agarde pola", "descarga do", "filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Introduza o", "filamento e", "faga click")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Agarde pola", "carga do", "filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Agarde para", "seguir co", "traballo")); - #else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Agarde...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Descargando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Introduza e click")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Cargando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Seguindo...")); - #endif // LCD_HEIGHT < 4 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_hr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_hr.h deleted file mode 100644 index 7cf694750d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_hr.h +++ /dev/null @@ -1,168 +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 - -/** - * Croatian (Hrvatski) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. - -namespace Language_hr { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Croatian"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" spreman."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD kartica umetnuta"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD kartica uklonjena"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto pokretanje"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Ugasi steppere"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Automatski homing"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home-aj X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home-aj Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home-aj Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home-aj XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klikni za početak"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Sljedeća točka"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Niveliranje gotovo!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Postavi home offsete"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets postavljeni"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Postavi ishodište"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Predgrij ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Predgrij ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Dizna"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Dizna ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Sve"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Predgrij ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Predgrij ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Dizna"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Dizna ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Sve"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Bed"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Hlađenje"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Uključi napajanje"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Isključi napajanje"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Miči os"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Niveliraj bed"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveliraj bed"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Miči X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Miči Y"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Miči %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Miči 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Miči 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Miči 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Brzina"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dizna"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dizna ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Bed"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Brzina ventilatora"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Brzina ventilatora ~"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Odaberi"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Odaberi *"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Gibanje"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD-a"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Pohrani u memoriju"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Učitaj memoriju"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Učitaj failsafe"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Osvježi"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info screen"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Pripremi"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pauziraj print"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Nastavi print"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zaustavi print"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Printaj s SD kartice"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Nema SD kartice"); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Čekaj korisnika..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print otkazan"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ZAUSTAVLJEN. "); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Promijeni filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Promijeni filament *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. SD karticu"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Promijeni SD karticu"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Grijanje neuspješno"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Grijanje..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Grijanje Bed-a..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibracija"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibriraj X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibriraj Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibriraj Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibriraj Središte"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O printeru"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Podaci o printeru"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistika printera"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Podaci o elektronici"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruderi"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvjetljenje"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Neispravan pisač"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Broj printova"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Završeni"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Ukupno printanja"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najduži print"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudirano ukupno"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Printovi"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Završeni"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Ukupno"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najduži"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudirano"); - #endif - - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Napajanje"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Nastavi print"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Čekaj", "filament unload")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Pričekaj", "filament load")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Nastavljam...")); - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čekaj početak", "filamenta", "promijeni")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Umetni filament", "i pritisni tipku", "za nastavak...")); - #else - // Up to 2 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT("Pričekaj..."); - //PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("?", "?")); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_it.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_it.h deleted file mode 100644 index 97c30bff7f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_it.h +++ /dev/null @@ -1,579 +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 - -/** - * Italian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_it { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Italian"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); - PROGMEM Language_Str MSG_YES = _UxGT("SI"); - PROGMEM Language_Str MSG_NO = _UxGT("NO"); - PROGMEM Language_Str MSG_BACK = _UxGT("Indietro"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Annullando..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media inserito"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media rimosso"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Media rilasciato"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Aspettando media"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo media"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Dispos.USB rimosso"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Avvio USB fallito"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Finecor."); // Max 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principale"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Impostaz. avanzate"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configurazione"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu di debug"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home asse X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home asse Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home assi XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Livel. terminato!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Imp. offset home"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Imposta Origine"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preriscalda ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preriscalda ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Tutto"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Piatto"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preriscalda ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preriscalda ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Ugello"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Ugello ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Tutto"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Piatto"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" conf"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Raffredda"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Controllo laser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potenza laser"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Controllo mandrino"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Mandrino Off"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Mandrino On"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potenza mandrino"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverti mandrino"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Accendi aliment."); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Spegni aliment."); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Estrudi"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Ritrai"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Muovi Asse"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Livella piano"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Livella piano"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Livella spigoli"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Prossimo spigolo"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mesh"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifica Mesh"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punto sondato"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Indice X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Indice Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valore di Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comandi personaliz."); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("Test sonda M48"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("Punto M48"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Deviazione"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Strumenti Offsets"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicazione"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia speculare"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pieno controllo"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2° ugello X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2° ugello Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2° ugello Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 in corso"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Strumenti UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Mesh Manuale"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Metti spes. e misura"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Misura"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Rimuovi e mis.piatto"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Spostamento succes."); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Attiva UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Disattiva UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Piatto"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temp. Piatto"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Ugello"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp. Ugello"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Modifica Mesh"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Modif.Mesh personal."); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ritocca Mesh"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Modif.Mesh fatta"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crea Mesh personal."); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Crea Mesh"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Crea Mesh ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Crea Mesh ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Crea Mesh a freddo"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Aggiusta Alt. Mesh"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Altezza"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valida Mesh"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Valida Mesh ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Valida Mesh ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 riscald.letto"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 riscald.ugello"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Priming manuale..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Prime a lung.fissa"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Priming terminato"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Annullato"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Uscita da G26"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valida Mesh pers."); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continua Mesh"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Livell. Mesh"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Livell. 3 Punti"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Livell. Griglia Mesh"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Livella Mesh"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Punti laterali"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo di Mappa"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Esporta Mappa"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Esporta per Host"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Esporta in CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Backup esterno"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Esporta Info UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Riempimento"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Riempimento Manuale"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Riempimento Smart"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Riempimento Mesh"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida Tutto"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.Punto Vicino"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca All"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ritocca Punto Vicino"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Salvate"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot di memoria"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Carica Mesh Piatto"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Salva Mesh Piatto"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i caricata"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i salvata"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nessuna memoria"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: Salvataggio UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ripristino UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Fermato"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL passo passo"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crea Mesh a freddo"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Riempimento Smart"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valida Mesh"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ritocca All"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valida Mesh"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ritocca All"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Salva Mesh Piatto"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Controllo LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Luci"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Preset luce"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rosso"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Arancione"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Giallo"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Verde"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blu"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indaco"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Viola"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Bianco"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Predefinito"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luci personalizzate"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensità rosso"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensità verde"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensità blu"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensità bianco"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Luminosità"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("In movimento..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY liberi"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Muovi X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Muovi Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Muovi Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusore"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusore *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Muovi di %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocità"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Piatto Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ugello"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ugello ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Piatto"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Camera"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventola"); // Max 15 characters - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventola ="); // Max 15 characters - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra vel.vent."); // Max 15 characters - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra v.vent. ="); // Max 15 characters - PROGMEM Language_Str MSG_FLOW = _UxGT("Flusso"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flusso ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Controllo"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("On"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off"); - PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); - PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Seleziona"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleziona *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); - PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-jerk"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-jerk"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-jerk"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-jerk"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocità"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VTrav min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accelerazione"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-Ritrazione"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-Spostamento"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passi/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("passi/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("passi/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("passi/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Epassi/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*passi/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. filo"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. filo *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Rimuovi mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carica mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Avanzamento"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Avanzamento *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrasto LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salva impostazioni"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carica impostazioni"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ripristina imp."); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inizializza EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aggiorna media"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetta stampante"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aggiorna"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Schermata info"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Regola"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Avvia stampa"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Prossimo"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inizializza"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Stampa"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Resetta"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Annulla"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Fatto"); - PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Indietro"); - PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procedi"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Riprendi stampa"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Arresta stampa"); - PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Stampa Oggetto"); - PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancella Oggetto"); - PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto ="); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Stampa da media"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Media non presente"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Sospensione..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Premi tasto.."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Stampa sospesa"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Stampa..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Stampa annullata"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Nessun Movimento"); - PROGMEM Language_Str MSG_KILLED = _UxGT("UCCISO. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ARRESTATO. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ritrai mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Scamb. Ritrai mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ritrai V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Salta mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Scamb. UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRitrai"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Dist. ritrazione"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Lunghezza spurgo"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Cambio utensile"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Risalita Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Velocità innesco"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Velocità retrazione"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Standby ugello"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambia filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambia filamento *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Carica filamento"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Carica filamento *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Rimuovi filamento"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filamento *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inizializ. media"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambia media"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Fattore distorsione"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Autotest BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Resetta BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Estendi BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("BLTouch modo SW"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch modo 5V"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch modo OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("BLTouch modo mem."); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Metti BLTouch a 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Metti BLTouch a OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Segnala modo"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PERICOLO: Impostazioni errate possono cause danni! Procedo comunque?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inizializ.TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z offset"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Memorizzare"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estendi TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Estendi Sonda-Z"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s prima"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset sonda Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Totali"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Finecorsa annullati"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Riscald. Fallito"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Risc. piatto fallito"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Risc. camera fallito"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP RIDONDANTE"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEMP PIAT.FUORI CTRL"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("T.CAMERA FUORI CTRL"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MASSIMA"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: TEMP MAX PIATTO"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: TEMP MIN PIATTO"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: TEMP MAX CAMERA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: TEMP MIN CAMERA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY prima"); - PROGMEM Language_Str MSG_HALTED = _UxGT("STAMPANTE FERMATA"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Riavviare prego"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("g"); // Un solo carattere - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // Un solo carattere - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // Un solo carattere - PROGMEM Language_Str MSG_HEATING = _UxGT("Riscaldamento..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Raffreddamento.."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Risc. piatto..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Raffr. piatto..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Risc. camera..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Raffr. camera..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibraz. Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibra X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibra Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibra Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra centro"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Impostaz. Delta"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto calibrazione"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Imp. altezza Delta"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Offset sonda-Z"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonale"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altezza"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Raggio"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Riguardo stampante"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. stampante"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Livel. a 3 punti"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Livel. Lineare"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Livel. Bilineare"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Livel.piatto unific."); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Livel. Mesh"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistiche"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. scheda"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Estrusori"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocollo"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Controllo fuga: OFF"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Controllo fuga: ON"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luci Case"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Contat. stampa"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Stampe"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Durata"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Più lungo"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estruso"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp min"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp max"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Alimentatore"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Potenza Drive"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIO FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("STAMPA IN PAUSA"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARICA FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("RIMUOVI FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPZIONI RIPRESA:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Spurga di più"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Riprendi stampa"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Ugello: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sens.filo termin."); // Max 17 characters - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist mm filo term."); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Home fallito"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondaggio fallito"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600:Troppo freddo"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("SCELTA FILAMENTO"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Agg.firmware MMU!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU chiede attenz."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Riprendi stampa"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Ripresa..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Carica filamento"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Carica tutto"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Carica fino ugello"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Espelli filamento"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Espelli filam.~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Scarica filamento"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Caric.fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Esplus.filam. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Scaric.filam. ..."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Tutto"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filamento ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Azzera MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Azzeramento MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Rimuovi, click"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Miscela"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Componente ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Miscelatore"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradiente"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Gradiente pieno"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Alterna miscela"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Ciclo miscela"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Miscela gradiente"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Inverti gradiente"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("V-tool attivo"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("V-tool iniziale"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT("V-tool finale"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("V-tool alias"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Ripristina V-tools"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit mix V-tool"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools ripristin."); - PROGMEM Language_Str MSG_START_Z = _UxGT("Z inizio:"); - PROGMEM Language_Str MSG_END_Z = _UxGT("Z fine:"); - - PROGMEM Language_Str MSG_GAMES = _UxGT("Giochi"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Stampante errata"); - - // - // Le schermate di Cambio Filamento possono visualizzare fino a 3 linee su un display a 4 righe - // ...o fino a 2 linee su un display a 3 righe. - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_3_LINE("Premi per", "riprendere", "la stampa")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parcheggiando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Attendere avvio", "del cambio", "di filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Inserisci il", "filamento e premi", "per continuare")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Premi per", "riscaldare ugello")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Riscaldam. ugello", "Attendere prego...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Attendere", "l'espulsione", "del filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Attendere", "il caricamento", "del filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Attendere", "lo spurgo", "del filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Premi x terminare", "lo spurgo", "del filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Attendere", "la ripresa", "della stampa...")); - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Premi x continuare")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Attendere...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Inserisci e premi")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Riscalda ugello")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Riscaldamento...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Espulsione...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Caricamento...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Spurgo filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Premi x terminare")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Ripresa...")); - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Drivers TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver in uso"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Soglia modo ibrido"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Azzer. sensorless"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo stepping"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil."); - - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Resetta"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" tra:"); - - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Gioco"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correzione"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_jp_kana.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_jp_kana.h deleted file mode 100644 index ae030dab78..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_jp_kana.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 . - * - */ -#pragma once - -/** - * Japanese (Kana) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -//#define DISPLAY_CHARSET_ISO10646_KANA - -namespace Language_jp_kana { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 3; - PROGMEM Language_Str LANGUAGE = _UxGT("Japanese"); - - // This is just to show the potential benefit of Unicode. - // This translation can be improved by using the full charset of unicode codeblock U+30A0 to U+30FF. - - // 片仮名表示定義 - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" ジュンビカンリョウ"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("メディアガソウニュウサレマシタ"); // "Card inserted" - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("メディアガアリマセン"); // "Card removed" - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("メディアノトリダシ"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("メディアガアリマセン"); // "Card removed" - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("エンドストップ"); // "Endstops" // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("メイン"); // "Main" - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("ジドウカイシ"); // "Autostart" - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("モーターデンゲン オフ"); // "Disable steppers" - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("デバッグメニュー"); // "Debug Menu" - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("プログレスバー テスト"); // "Progress Bar Test" - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("ゲンテンフッキ"); // "Auto home" - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Xジク ゲンテンフッキ"); // "Home X" - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Yジク ゲンテンフッキ"); // "Home Y" - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Zジク ゲンテンフッキ"); // "Home Z" - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("ゲンテンフッキチュウ"); // "Homing XYZ" - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("レベリングカイシ"); // "Click to Begin" - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("ツギノソクテイテンヘ"); // "Next Point" - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("レベリングカンリョウ"); // "Leveling Done!" - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("キジュンオフセットセッテイ"); // "Set home offsets" - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("オフセットガテキヨウサレマシタ"); // "Offsets applied" - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("キジュンセット"); // "Set origin" - PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" ヨネツ"); // "Preheat " PREHEAT_1_LABEL - PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL - PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" ヨネツノズル"); // " Nozzle" - PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" ヨネツノズル ~"); // " Nozzle" - PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" スベテヨネツ"); // " All" - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" ベッドヨネツ"); // " Bed" - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" ヨネツセッテイ"); // " conf" - PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" ヨネツ"); // "Preheat " PREHEAT_1_LABEL - PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL - PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" ヨネツノズル"); // " Nozzle" - PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" ヨネツノズル ~"); // " Nozzle" - PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" スベテヨネツ"); // " All" - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" ベッドヨネツ"); // " Bed" - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" ヨネツセッテイ"); // " conf" - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("カネツテイシ"); // "Cooldown" - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("デンゲン オン"); // "Switch power on" - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("デンゲン オフ"); // "Switch power off" - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("オシダシ"); // "Extrude" - PROGMEM Language_Str MSG_RETRACT = _UxGT("ヒキコミセッテイ"); // "Retract" - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("ジクイドウ"); // "Move axis" - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("ベッドレベリング"); // "Bed leveling" - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("ベッドレベリング"); // "Level bed" - - PROGMEM Language_Str MSG_MOVING = _UxGT("イドウチュウ"); // "Moving..." - PROGMEM Language_Str MSG_FREE_XY = _UxGT("XYジク カイホウ"); // "Free XY" - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Xジク イドウ"); // "Move X" - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Yジク イドウ"); // "Move Y" - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Zジク イドウ"); // "Move Z" - PROGMEM Language_Str MSG_MOVE_E = _UxGT("エクストルーダー"); // "Extruder" - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm イドウ"); // "Move 0.025mm" - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm イドウ"); // "Move 0.1mm" - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1mm イドウ"); // "Move 1mm" - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT(" 10mm イドウ"); // "Move 10mm" - PROGMEM Language_Str MSG_SPEED = _UxGT("ソクド"); // "Speed" - PROGMEM Language_Str MSG_BED_Z = _UxGT("Zオフセット"); // "Bed Z" - PROGMEM Language_Str MSG_NOZZLE = _UxGT("ノズル"); // "Nozzle" - PROGMEM Language_Str MSG_BED = _UxGT("ベッド"); // "Bed" - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("ファンソクド"); // "Fan speed" - PROGMEM Language_Str MSG_FLOW = _UxGT("トシュツリョウ"); // "Flow" - PROGMEM Language_Str MSG_CONTROL = _UxGT("セイギョ"); // "Control" - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" サイテイ"); // " Min" - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" サイコウ"); // " Max" - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" ファクター"); // " Fact" - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("ジドウオンドセイギョ"); // "Autotemp" - PROGMEM Language_Str MSG_LCD_ON = _UxGT("オン"); // "On" - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("オフ"); // "Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("センタク"); // "Select" - PROGMEM Language_Str MSG_SELECT_E = _UxGT("センタク *"); - PROGMEM Language_Str MSG_ACC = _UxGT("カソクド mm/s²"); // "Accel" - PROGMEM Language_Str MSG_JERK = _UxGT("ヤクドウ mm/s"); // "Jerk" - PROGMEM Language_Str MSG_VA_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_A; // "Va-jerk" - PROGMEM Language_Str MSG_VB_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_B; // "Vb-jerk" - PROGMEM Language_Str MSG_VC_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_C; // "Vc-jerk" - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("ステップ/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("ステップ/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("ステップ/mm"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("エクストルーダー ヤクド"); // "Ve-jerk" - PROGMEM Language_Str MSG_VMAX_A = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax A" - PROGMEM Language_Str MSG_VMAX_B = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax B" - PROGMEM Language_Str MSG_VMAX_C = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax C" - PROGMEM Language_Str MSG_VMAX_E = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax E" - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("サイダイオクリソクド *"); // "Vmax E1" - PROGMEM Language_Str MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("カソクド mm/s²"); // "Accel" - PROGMEM Language_Str MSG_AMAX = _UxGT("サイダイカソクド "); // "Amax " - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("ヒキコミカソクド"); // "A-retract" - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("イドウカソクド"); // "A-travel" - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("オンド"); // "Temperature" - PROGMEM Language_Str MSG_MOTION = _UxGT("ウゴキセッテイ"); // "Motion" - PROGMEM Language_Str MSG_FILAMENT = _UxGT("フィラメント"); // "Filament" - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("フィラメントチョッケイ"); // "Fil. Dia." - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("フィラメントチョッケイ *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCDコントラスト"); // "LCD contrast" - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("EEPROMヘホゾン"); // "Store memory" - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("EEPROMカラヨミコミ"); // "Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("セッテイリセット"); // "Restore failsafe" - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("リフレッシュ"); // "Refresh" - PROGMEM Language_Str MSG_WATCH = _UxGT("ジョウホウガメン"); // "Info screen" - PROGMEM Language_Str MSG_PREPARE = _UxGT("ジュンビセッテイ"); // "Prepare" - PROGMEM Language_Str MSG_TUNE = _UxGT("チョウセイ"); // "Tune" - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("イチジテイシ"); // "Pause print" - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("プリントサイカイ"); // "Resume print" - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("プリントテイシ"); // "Stop print" - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("メディアカラプリント"); // "Print from SD" - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("メディアガアリマセン"); // "Card removed" - PROGMEM Language_Str MSG_DWELL = _UxGT("キュウシ"); // "Sleep..." - PROGMEM Language_Str MSG_USERWAIT = _UxGT("ツヅケルニハクリックシテクダサイ"); // "Wait for user..." - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("プリントガチュウシサレマシタ"); // "Print aborted" - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("ウゴキマセン"); // "No move." - PROGMEM Language_Str MSG_KILLED = _UxGT("ヒジョウテイシ"); // "KILLED. " - PROGMEM Language_Str MSG_STOPPED = _UxGT("テイシシマシタ"); // "STOPPED. " - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("ヒキコミリョウ mm"); // "Retract mm" - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("ヒキコミリョウS mm"); // "Swap Re.mm" - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("ヒキコミソクド mm/s"); // "Retract V" - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("ノズルタイヒ mm"); // "Hop mm" - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("ホショウリョウ mm"); // "UnRet mm" - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("ホショウリョウS mm"); // "S UnRet mm" - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("ホショウソクド mm/s"); // "UnRet V" - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("ジドウヒキコミ"); // "AutoRetr." - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("フィラメントコウカン"); // "Change filament" - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("メディアサイヨミコミ"); // "Init. SD card" - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("メディアコウカン"); // "Change SD card" - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Zプローブ ベッドガイ"); // "Z probe out. bed" - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch ジコシンダン"); // "BLTouch Self-Test" - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch リセット"); // "Reset BLTouch" - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("サキニ %s%s%s ヲフッキサセテクダサイ"); // "Home ... first" - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Zオフセット"); // "Z Offset" - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Xジク ビドウ"); // "Babystep X" - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Yジク ビドウ"); // "Babystep Y" - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Zジク ビドウ"); // "Babystep Z" - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("イドウゲンカイケンチキノウ"); // "Endstop abort" - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("カネツシッパイ"); // "Heating failed" - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("エラー:ジョウチョウサーミスターキノウ"); // "Err: REDUNDANT TEMP" - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ネツボウソウ"); // "THERMAL RUNAWAY" - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("エラー:サイコウオンチョウカ"); // "Err: MAXTEMP" - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("エラー:サイテイオンミマン"); // "Err: MINTEMP" - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("エラー:ベッド サイコウオンチョウカ"); // "Err: MAXTEMP BED" - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("エラー:ベッド サイテイオンミマン"); // "Err: MINTEMP BED" - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("サキニ XY ヲフッキサセテクダサイ"); // "Home XY first" - PROGMEM Language_Str MSG_HALTED = _UxGT("プリンターハテイシシマシタ"); // "PRINTER HALTED" - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("リセットシテクダサイ"); // "Please reset" - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("カネツチュウ"); // "Heating..." - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("ベッド カネツチュウ"); // "Bed Heating..." - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("デルタ コウセイ"); // "Delta Calibration" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Xジク コウセイ"); // "Calibrate X" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Yジク コウセイ"); // "Calibrate Y" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Zジク コウセイ"); // "Calibrate Z" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("チュウシン コウセイ"); // "Calibrate Center" - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("コノプリンターニツイテ"); // "About Printer" - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("プリンタージョウホウ"); // "Printer Info" - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("プリントジョウキョウ"); // "Printer Stats" - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("セイギョケイジョウホウ"); // "Board Info" - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("サーミスター"); // "Thermistors" - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("エクストルーダースウ"); // "Extruders" - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("ボーレート"); // "Baud" - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("プロトコル"); // "Protocol" - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("キョウタイナイショウメイ"); // "Case light" - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("プリントスウ "); // "Print Count" - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("カンリョウスウ"); // "Completed" - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("プリントジカンルイケイ"); // "Total print time" - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("サイチョウプリントジカン"); // "Longest job time" - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("フィラメントシヨウリョウルイケイ"); // "Extruded total" - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("セッテイサイテイオン"); // "Min Temp" - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("セッテイサイコウオン"); // "Max Temp" - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("デンゲンシュベツ"); // "Power Supply" - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("モータークドウリョク"); // "Drive Strength" - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("DACシュツリョク %"); // "Driver %" - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("EEPROMヘホゾン"); // "Store memory" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("イチジテイシ"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("プリントサイカイ"); // "Resume print" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("コウカンヲカイシシマス", "シバラクオマチクダサイ")); // "Wait for start of the filament" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("フィラメントヌキダシチュウ", "シバラクオマチクダサイ")); // "Wait for filament unload" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("フィラメントヲソウニュウシ,", "クリックスルトゾッコウシマス")); // "Insert filament and press button" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("フィラメントソウテンチュウ", "シバラクオマチクダサイ")); // "Wait for filament load" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("プリントヲサイカイシマス", "シバラクオマチクダサイ")); // "Wait for print to resume" - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("マチガッタプリンター"); // "Wrong printer" - - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("セッテイカンリ"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("ショウサイセッテイ"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("コショカイフク"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROMショキカ"); - - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("ツギヘ"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("ショキカ"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("ストップ"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("プリント"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("リセット"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("キャンセル"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("カンリョウ"); - - PROGMEM Language_Str MSG_YES = _UxGT("ハイ"); - PROGMEM Language_Str MSG_NO = _UxGT("イイエ"); - PROGMEM Language_Str MSG_BACK = _UxGT("モドリ"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("ソクド"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("ステップ/mm"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("ユーザーコマンド"); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("プリントガイチジテイシサレマシタ"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("プリントチュウ..."); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ko_KR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ko_KR.h deleted file mode 100644 index ac2b7b68f7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ko_KR.h +++ /dev/null @@ -1,104 +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 - -/** - * Korean - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_ko_KR { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Korean"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" 준비."); - PROGMEM Language_Str MSG_BACK = _UxGT("뒤로"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("카드 삽입됨"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("카드 제거됨"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("엔드스탑"); - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("소프트 엔드스탑"); - PROGMEM Language_Str MSG_MAIN = _UxGT("뒤로"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("고급 설정"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("설정"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("자동 시작"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("모터 정지"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("디버깅 메뉴"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("프로그레스바 테스트"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("오토홈"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X 홈으로"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y 홈으로"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z 홈으로"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ 홈으로"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("누르면 시작합니다"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("다음 Point"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("레벨링 완료!"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("예열하기 - ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("예열하기 - ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("예열하기 - ") PREHEAT_1_LABEL _UxGT(" 노즐"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("예열하기 - ") PREHEAT_1_LABEL _UxGT(" 노즐 ~"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("예열하기 - ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("예열하기 - ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("예열하기 - ") PREHEAT_2_LABEL _UxGT(" 노즐"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("예열하기 - ") PREHEAT_2_LABEL _UxGT(" 노즐 ~"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Custom 예열"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("식히기"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("스위치 전원 켜기"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("스위치 전원 끄기"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("밀어내기"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("당기기"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("축 이동"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("베드 레벨링"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("미러 사본"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("오토레벨링 하기"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("노즐"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("노즐 ~"); - PROGMEM Language_Str MSG_BED = _UxGT("베드"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("펜 속도"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("펜 속도 ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("엑스트라 펜 속도"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("엑스트라 펜 속도 ="); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("온도"); - PROGMEM Language_Str MSG_MOTION = _UxGT("동작"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("설정 저장하기"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("설정 읽어오기"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("설정 되돌리기"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM 초기화"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("새로고침"); - PROGMEM Language_Str MSG_WATCH = _UxGT("처음으로"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("준비하기"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("일시정지"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("재시작"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("출력중지"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD 카드출력"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD 카드없음"); - PROGMEM Language_Str MSG_DWELL = _UxGT("슬립모드..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("일시 정지됨"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("출력중..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("취소됨"); - PROGMEM Language_Str MSG_KILLED = _UxGT("죽음. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("멈춤. "); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("잘못된 프린터"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_nl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_nl.h deleted file mode 100644 index 9ea1ca9598..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_nl.h +++ /dev/null @@ -1,244 +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 - -/** - * Dutch - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_1 -#define NOT_EXTENDED_ISO10646_1_5X7 - -namespace Language_nl { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Dutch"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" gereed."); - PROGMEM Language_Str MSG_BACK = _UxGT("Terug"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kaart ingestoken"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kaart verwijderd"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("Hoofdmenu"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren uit"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); //accepted English terms - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Vooruitgang Test"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto home"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik voor begin"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Volgende Plaats"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Bed level kompl."); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Zet home offsets"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("H offset toegep."); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nulpunt instellen"); - PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" voorverwarmen"); - PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" voorverw. ~"); - PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" voorverw. Einde"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" voorverw. Einde ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" voorverw. aan"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" voorverw. Bed"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" verw. conf"); - PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" voorverwarmen"); - PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" voorverw. ~"); - PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" voorverw. Einde"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" voorverw. Einde ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" voorverw. aan"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" voorverw. Bed"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" verw. conf"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Afkoelen"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Stroom aan"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Stroom uit"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrude"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retract"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("As verplaatsen"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bed Leveling"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Level bed"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Verplaatsen..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Vrij XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Verplaats X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Verplaats Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Verplaats Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Verplaats %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Verplaats 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Verplaats 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Snelheid"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Bed"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan snelheid"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan snelheid ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Aan"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Uit"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Selecteer"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Selecteer *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Versn"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatuur"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Beweging"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); //accepted english dutch - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); //accepted english dutch - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD contrast"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Geheugen opslaan"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Geheugen laden"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Noodstop reset"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ververs"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info scherm"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Voorbereiden"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Afstellen"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Print pauzeren"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Print hervatten"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Print stoppen"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print van SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Geen SD kaart"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Slapen..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Wachten..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print afgebroken"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Geen beweging."); - PROGMEM Language_Str MSG_KILLED = _UxGT("Afgebroken. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("Gestopt. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retract mm"); //accepted English term in Dutch - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ruil Retract mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retract F"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Ruil UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet F"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Verv. Filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Verv. Filament *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. SD kaart"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Verv. SD Kaart"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z probe uit. bed"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Zelf-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s Eerst"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Offset"); //accepted English term in Dutch - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystap X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystap Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystap Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop afbr."); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Voorverw. fout"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Redun. temp fout"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Therm. wegloop"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: Max. temp"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: Min. temp"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: Max.tmp bed"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: Min.tmp bed"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY Eerst"); - PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER GESTOPT"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reset A.U.B."); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only. Keep English standard - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Voorwarmen..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bed voorverw..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Calibratie"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibreer X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibreer Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibreer Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibreer Midden"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibratie"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Zet Delta Hoogte"); - - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Printer Stats"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board Info"); //accepted English term in Dutch - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruders"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Over Printer"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Printer Info"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Case licht"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Onjuiste printer"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Printed Aantal"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Totaal Voltooid"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Totale Printtijd"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Langste Printtijd"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Totaal Extrudeert"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Aantal"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Voltooid"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Printtijd "); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Langste"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); //accepted English term in Dutch - - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Motorstroom"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Driver %"); //accepted English term in Dutch - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC Opslaan"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Hervat print"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); //accepeted English term - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - // Up to 3 lines - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Wacht voor start", "filament te", "verwisselen")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Wacht voor", "filament uit", "te laden")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klik knop om...", "verw. nozzle.")); //nozzle accepted English term - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozzle verw.", "Wacht a.u.b.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Laad filament", "en druk knop", "om verder...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Wacht voor", "filament te", "laden")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Wacht voor print", "om verder", "te gaan")); - #else - // Up to 2 lines - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Wacht voor", "start...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Wacht voor", "uitladen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klik knop om...", "verw. nozzle.")); //nozzle accepted English term - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Verwarmen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("Laad filament", "en druk knop")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Wacht voor", "inladen...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Wacht voor", "printing...")); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pl.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pl.h deleted file mode 100644 index 50196a1cef..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pl.h +++ /dev/null @@ -1,578 +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 - -/** - * Polish - includes accented characters - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_PL - -namespace Language_pl { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Polish"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" gotowy."); - PROGMEM Language_Str MSG_YES = _UxGT("TAK"); - PROGMEM Language_Str MSG_NO = _UxGT("NIE"); - PROGMEM Language_Str MSG_BACK = _UxGT("Wstecz"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Przerywanie..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta włożona"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta usunięta"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Karta zwolniona"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Oczekiwanie na kartę"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Bład odczytu karty"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Urządzenie USB usunięte"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Błąd uruchomienia USB"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Krańców."); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Progr. Krańcówki"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu główne"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ustawienie zaawansowane"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguracja"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Wyłącz silniki"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debugowania"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testowy pasek postępu"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Pozycja zerowa"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Zeruj X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Zeruj Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Zeruj Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Autowyrównanie Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Pozycja zerowa"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknij by rozp."); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Następny punkt"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Wypoziomowano!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Wys. zanikania"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ust. poz. zer."); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Poz. zerowa ust."); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ustaw punkt zero"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Rozgrzej ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Rozgrzej ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" Dysza"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" Dysza ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" wsz."); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" stół"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" ustaw."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Rozgrzej ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Rozgrzej ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" Dysza"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" Dysza ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" wsz."); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" stół"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" ustaw."); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Rozgrzej własne ust."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Chłodzenie"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Sterowanie Lasera"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Wyłącz Laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Włącz Laser"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Zasilanie Lasera"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Sterowanie wrzeciona"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Wyłącz wrzeciono"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Włącz wrzeciono"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Zasilanie wrzeciona"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Rewers wrzeciona"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Włącz zasilacz"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Wyłącz zasilacz"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ekstruzja"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Wycofanie"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Ruch osi"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Poziomowanie stołu"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Wypoziomuj stół"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Narożniki poziomowania"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Nastepny narożnik"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Edytor siatki"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Edycja siatki"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Edycja siatki zatrzymana"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punkt pomiarowy"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Indeks X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Indeks Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Wartość Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Własne Polecenia"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Test sondy"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punky"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Odchylenie"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Tryb IDEX"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Przesunięcie narzędzia"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Parkowanie"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikowanie"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Kopia lustrzana"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pełne sterowanie"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2ga dysza X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2ga dysza Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2ga dysza Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Wykonywanie G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Narzędzia UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punkt pochylenia"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ręczne Budowanie Siatki"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Umieść podkładkę i zmierz"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Zmierz"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Usuń & Zmierz Stół"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Przesuwanie do następnego"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktywacja UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Dezaktywacja UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temperatura stołu"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temperatura stołu"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temperatura dyszy"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temperatura dyszy"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Edycja siatki"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edycja własnej siatki"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Dostrajanie siatki"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Koniec edycji siati"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Buduj własna siatkę"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Buduj siatkę"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Buduj siatkę (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Buduj siatkę (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Buduj siatkę na zimno"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Dostrojenie wysokości siatki"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Wartość wysokości"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Sprawdzenie siatki"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Sprawdzenie siatki (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Sprawdzenie siatki (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Sprawdzenie własnej siatki"); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Nagrzewanie stołu"); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Nagrzewanie dyszy"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Napełnianie ręczne..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Napełnij kreśloną długością"); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Napełianie zakończone"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Przewane"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Opuszczanie G26"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Kontynuuj tworzenie siatki"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Poziomowanie siatką"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Poziomowaie 3-punktowe"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Poziomowaie według siatki"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Poziomuj siatkę"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Punkty boczne"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Rodzaj mapy"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Wyslij mapę siatki"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Wyslij do Hosta"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Wyslij do CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Kopia poza drukarką"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Wyslij info UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Stopień wypełnienia"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ręczne wypełnienie"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Inteligentne wypełnienie"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Wypełnienie siatki"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Unieważnij wszystko"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Unieważnij najbliższy"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Dostrajaj wszystko"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Dostrajaj najbliższy"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Przechowywanie siatki"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot Pamięci"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Załaduj siatke stołu"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Zapisz siatke stołu"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Siatka %i załadowana"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Siatka %i Zapisana"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Brak magazynu"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Błąd: Zapis UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Bład: Odczyt UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Przesunięcie Z: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Przesunięcie Z zatrzymane"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Krok po kroku"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Tworzeni ezimnej siatki"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Inteligentne wypełnienie"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Sprawdzenie siatki"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Dostrojenie wszystkiego"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Sprawdzenie siatki"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Dostrojenie wszystkiego"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Zapis siatki stołu"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Sterowanie LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Światła"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Ustawienia świateł"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Czerwony"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Pomarańczowy"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Zółty"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zielony"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Niebieski"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indygo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fioletowy"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Biały"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Domyślny"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Własne światła"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Czerwony"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zielony"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Niebieski"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Biały"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jasność"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Ruch..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Swobodne XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Przesuń w X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Przesuń w Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Przesuń w Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruzja (os E)"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruzja (os E) *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Dysza za zimna"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Przesuń co %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Przesuń co .1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Przesuń co 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Przesuń co 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Predkość"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Stół Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dysza"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dysza ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Stół"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Obudowa"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Obroty wiatraka"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Obroty wiatraka ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Obroty dodatkowego wiatraka"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Obroty dodatkowego wiatraka ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Przepływ"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Przepływ ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Ustawienia"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Mnożnik"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto. temperatura"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Wł."); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Wył."); - PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autostrojenie"); - PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autostrojenie *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Wybierz"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Wybierz *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Przyspieszenie"); - PROGMEM Language_Str MSG_JERK = _UxGT("Zryw"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("Zryw V") LCD_STR_A; - PROGMEM Language_Str MSG_VB_JERK = _UxGT("Zryw V") LCD_STR_B; - PROGMEM Language_Str MSG_VC_JERK = _UxGT("Zryw V") LCD_STR_C; - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Zryw Ve"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Prędkość (V)"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vskok min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Przyspieszenie (A)"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-wycofanie"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-przesuń."); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("kroki/mm"); - PROGMEM Language_Str MSG_A_STEPS = _UxGT("kroki") LCD_STR_A _UxGT("/mm"); - PROGMEM Language_Str MSG_B_STEPS = _UxGT("kroki") LCD_STR_B _UxGT("/mm"); - PROGMEM Language_Str MSG_C_STEPS = _UxGT("kroki") LCD_STR_C _UxGT("/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("krokiE/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("kroki */mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Ruch"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E w mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Śr. fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Śr. fil. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Wyładuj mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Załaduj mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Zapisz w pamięci"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Wczytaj z pamięci"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ustaw. fabryczne"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initializuj EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Uaktualnij kartę"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetuj drukarkę"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Odswież"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Ekran główny"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Przygotuj"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Strojenie"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start wydruku"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Następny"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inic."); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Drukuj"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Resetuj"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Przerwij"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Gotowe"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Wstrzymaj druk"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Wznowienie"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Odzyskiwanie po awarii"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Karta SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Brak karty"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Uśpij..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Oczekiwanie..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Druk wstrzymany"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Drukowanie..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Druk przerwany"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Brak ruchu"); - PROGMEM Language_Str MSG_KILLED = _UxGT("Ubity. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("Zatrzymany. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Wycofaj mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Z Wycof. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Wycofaj V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Skok Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Cof. wycof. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Z Cof. wyc. mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Cof. wycof. V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto. wycofanie"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Długość zmiany"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Długość oczyszczania"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Zmiana narzędzia"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Podniesienie Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prędkość napełniania"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Prędkość wycofania"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Dysza w oczekiwaniu"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Zmień filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Zmień filament *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Załaduj Filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Załaduj Filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Wyładuj Filament"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Wyładuj Filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Wyładuj wszystkie"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inicjal. karty SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Zmiana karty SD"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Zwolnienie karty"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z za stołem"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Współczynik skrzywienia"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Stow"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Deploy"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: SW-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: 5V-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: OD-Mode"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Mode-Store"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Set BLTouch to 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Set BLTouch to OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Report Drain"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("NIEBEZPIECZNE: Złe ustawienia mogą uszkodzić drukarkę. Kontynuować?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Test"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Save"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Najpierw Home %s%s%s"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Łącznie"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Błąd krańcówki"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Rozgrz. nieudane"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Rozgrz. stołu nieudane"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Rozgrz. komory nieudane"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Błąd temperatury"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ZANIK TEMPERATURY"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ZANIK TEMP. STOŁU"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ZANIK TEMP.KOMORY"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Błąd: MAXTEMP"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Błąd: MINTEMP"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Błąd: MAXTEMP STÓŁ"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Błąd: MINTEMP STÓŁ"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Błąd: MAXTEMP KOMORA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Błąd: MINTEMP KOMORA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Najpierw Home XY"); - PROGMEM Language_Str MSG_HALTED = _UxGT("Drukarka zatrzym."); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Proszę zresetować"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("g"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Rozgrzewanie..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Chłodzenie..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Rozgrzewanie stołu..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chłodzenie stołu..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Rozgrzewanie komory..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Chłodzenie komory..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Kalibrowanie Delty"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibruj X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibruj Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibruj Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibruj środek"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Ustawienia delty"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto kalibrowanie"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Ustaw wysokość delty"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Przesun. Z sondy"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Ukośne ramię"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Wysokość"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Promień"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O drukarce"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info drukarki"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Poziomowanie 3-punktowe"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Poziomowanie liniowe"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Poziomowanie biliniowe"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Poziomowanie siatką"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statystyki"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info płyty"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Ekstrudery"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Predkość USB"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokół"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Zegar pracy: OFF"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Zegar pracy: ON"); - - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Oświetlenie obudowy"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jasność oświetlenia"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Niepoprawna drukarka"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Ukończono"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Czas druku"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdł. druk"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Użyty fil."); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Ukończono"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Razem"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdł. druk"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Użyty fil."); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Zasilacz"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Siła silnika"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Siła %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC BŁĄD POŁĄCZENIA"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Zapisz DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("ZMIEŃ FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("WYDRUK WSTRZYMANY"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAŁADUJ FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("WYŁADUJ FILAMENT"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPCJE WZNOWIENIA:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Oczyść więcej"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Kontynuuj"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Dysza: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Czujnik filamentu"); - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dystans do czujnika mm"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Zerowanie nieudane"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondowanie nieudane"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: za zimne"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("WYBIERZ FILAMENT"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Uaktualnij firmware MMU!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU wymaga uwagi."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Wznów wydruk"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Wznawianie..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Załaduj filament"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Załaduj wszystko"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Załaduj do dyszy"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Wysuń filament"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Wysuń filament ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Wyładuj filament"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Ładowanie fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Wysuwanie fil. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Wyładowywanie fil...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Wszystko"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Resetuj MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetowanie MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Usuń, kliknij"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Miks"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponent ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mikser"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Pełny gradient"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Przełacz miks"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle Mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Odwrotny gradient"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Start V-tool"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" End V-tool"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset V-tools"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit V-tool Mix"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools Were Reset"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Start Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" End Z:"); - - PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); - - #define MSG_1_LINE(A) A "\0" "\0" - #define MSG_2_LINE(A,B) A "\0" B "\0" - #define MSG_3_LINE(A,B,C) A "\0" B "\0" C - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Nacisnik przycisk", "by wznowić drukowanie")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkowanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Czekam na", "zmianę filamentu", "by wystartować")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Włóż filament", "i naciśnij przycisk", "by kontynuować")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Naciśnij przycisk", "by nagrzać dyszę")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nagrzewanie dyszy", "Proszę czekać...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Czekam na", "wyjęcie filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Czekam na", "włożenie filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Czekam na", "oczyszczenie filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Kliknij by zakończyć", "oczyszczanie filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Czekam na", "wznowienie wydruku...")); - #else - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Kliknij by kontynuować")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkowanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Proszę czekać...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Włóż i kliknij")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Kliknij by nagrzać")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Nagrzewanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Wysuwanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Ładowanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Oczyszczanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Kliknij by zakończyć")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Wznawianie...")); - #endif - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Drivers"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver Current"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid Threshold"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorless Homing"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stepping Mode"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Enabled"); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" in:"); - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Backlash"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt.h deleted file mode 100644 index 992e78c2d4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt.h +++ /dev/null @@ -1,163 +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 - -/** - * Portuguese - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - - #define DISPLAY_CHARSET_ISO10646_1 - -namespace Language_pt { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Portuguese"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronta."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Cartão inserido"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Cartão removido"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desactivar motores"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir para origem"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir para origem X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir para origem Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir para origem Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Indo para origem"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click para iniciar"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Próximo ponto"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Pronto !"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Definir desvio"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets aplicados"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Definir origem"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL _UxGT(" Bico"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL _UxGT(" Bico ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Pre-aq. ") PREHEAT_1_LABEL _UxGT(" Tudo"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Pre-aq. ") PREHEAT_1_LABEL _UxGT(" ") LCD_STR_THERMOMETER _UxGT("Base"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Definições ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL _UxGT(" Bico"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL _UxGT(" Bico ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Pre-aq. ") PREHEAT_2_LABEL _UxGT(" Tudo"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Pre-aq. ") PREHEAT_2_LABEL _UxGT(" ") LCD_STR_THERMOMETER _UxGT("Base"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Definições ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefecer"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ligar"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Desligar"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudir"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retrair"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixo"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); - PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Bico"); - PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Bico ~"); - PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Base"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventoinha"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventoinha ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Controlo"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retracção"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-movimento"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passo/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" passo/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" passo/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" passo/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E passo/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* passo/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E em mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Diam."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Diam. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar na memoria"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carregar da memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. de emergen."); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT(" Recarregar"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Monitorizar"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Afinar"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impressão"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Retomar impressão"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Parar impressão"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimir do SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sem cartão SD"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Em espera..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Á espera de ordem"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impressão cancelada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sem movimento"); - PROGMEM Language_Str MSG_KILLED = _UxGT("EMERGÊNCIA. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("PARADO. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT(" Retrair mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Troca Retrair mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT(" Retrair V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT(" Levantar mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT(" DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Troca DesRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT(" DesRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT(" AutoRetr."); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Trocar filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Trocar filamento *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inici. cartão SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Trocar cartão SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sensor fora/base"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desvio Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Fim de curso"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: T Máxima"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: T Mínima"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: T Base Máxima"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: T Base Mínima"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Aquecendo..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Aquecendo base..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibração Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); - - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fim de curso"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt_br.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt_br.h deleted file mode 100644 index a2a13b3049..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_pt_br.h +++ /dev/null @@ -1,418 +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 - -/** - * Portuguese (Brazil) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_pt_br { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Portuguese (BR)"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); - - PROGMEM Language_Str MSG_BACK = _UxGT("Voltar"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Cartão inserido"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Cartão removido"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fins de curso"); - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Fins curso"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. Avançada"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuração"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Início automático"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desabilit. motores"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debug"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testar Barra Progres"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir a origem XYZ"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir na origem X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir na origem Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir na origem Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto alinhar Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Indo para origem"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Clique para Iniciar"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Próximo Ponto"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Fim nivelação!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Suavizar altura"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Compensar origem"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Alteração aplicada"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ajustar Origem"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Extrusora ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Extrusora ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Pre-aq.Todo ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Pre-aq.Mesa ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Ajustar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Extrusora ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Extrusora ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Pre-aq.Todo ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Pre-aq.Mesa ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Ajustar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Customizar Pre-aq."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Esfriar"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ligar"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Desligar"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusar"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Retrair"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixo"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelação Mesa"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar Mesa"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivelar Cantos"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Próximo Canto"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editar Malha"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Fim da Edição"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Índice X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Índice Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valor Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comando customizado"); - - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Estacionar"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicação"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Cópia espelhada"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Controle Total"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2o bico X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2o bico Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2o bico Z"); - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Executando G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Ferramentas UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Nivel. Mesa Unif."); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Fazer malha manual"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Calçar e calibrar"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Medir"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Remover e calibrar"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Movendo para Próximo"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Ativar UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Desativar UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Mesa"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Extrusora"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editar Malha"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Editar Malha Custom"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ajuste Fino da Malha"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Fim da Edição"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Montar Malha Custom"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Montar "); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Montar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Montar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Montar Malha fria"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajustar Altura"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Quant. de Altura"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validar Malha"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Checar ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Checar ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validar Malha Custom"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuar Malha"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nivelação da Malha"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Nivelação 3 pontos"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Nivelação Grid"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivelar Malha"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Cantos"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo de Mapa"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Salvar Mapa da Malha"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Enviar Para Host"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Salvar Malha CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Salvar Backup"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Informação do UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Qtd de Enchimento"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Enchimento Manual"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Enchimento Smart"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Preencher malha"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidar tudo"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidar próximo"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ajuste Fino de Todos"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ajustar Mais Próximo"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Armazenamento Malha"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot de Memória"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Ler Malha"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Salvar Malha"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Malha %i carregada"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Malha %i salva"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Sem armazenamento"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Erro ao salvar UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Erro no restauro UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Compensação Z parou"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL passo a passo"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Montar Malha fria"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Enchimento Smart"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Validar Malha"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ajuste Fino de Todos"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Validar Malha"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ajuste Fino de Todos"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Salvar Malha"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Controle do LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Luz"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Configuração da Luz"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Luz Vermelha"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Luz Laranja"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Luz Amarela"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Luz Verde"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Luz Azul"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Luz Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Luz Violeta"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Luz Branca"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Luz Padrão"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luz Customizada"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensidade Vermelho"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensidade Verde"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensidade Azul"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensidade Branco"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brilho"); - PROGMEM Language_Str MSG_MOVING = _UxGT("Movendo..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Liberar XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Extrus. mto fria"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Bocal"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Bocal ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Mesa"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventoinha"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventoinha ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("+Vel. Ventoinha"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("+Vel. Ventoinha ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Vazão"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Vazão ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Controle"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Máx"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fator"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temp. Automática"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ligado"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Desligado"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Selecionar"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Selecionar *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Acel."); - PROGMEM Language_Str MSG_JERK = _UxGT("Arrancada"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("arrancada V") LCD_STR_A; - PROGMEM Language_Str MSG_VB_JERK = _UxGT("arrancada V") LCD_STR_B; - PROGMEM Language_Str MSG_VC_JERK = _UxGT("arrancada V") LCD_STR_C; - PROGMEM Language_Str MSG_VE_JERK = _UxGT("arrancada VE"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Desv. Junção"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidade"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VDeslocamento min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Aceleração"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Retrair A"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Movimento A"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passo/mm"); - PROGMEM Language_Str MSG_A_STEPS = _UxGT("Passo ") LCD_STR_A _UxGT("/mm"); - PROGMEM Language_Str MSG_B_STEPS = _UxGT("Passo ") LCD_STR_B _UxGT("/mm"); - PROGMEM Language_Str MSG_C_STEPS = _UxGT("Passo ") LCD_STR_C _UxGT("/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Extrusão em mm3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diâmetro Fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diâmetro Fil. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarr. mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carregar mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avanço K"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avanço K *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salvar Configuração"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Ler Configuração"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restauro seguro"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Iniciar EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Atualiz. SD"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetar Impressora"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Atualização"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Informações"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Ajustar"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impressão"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resumir impressão"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Parar impressão"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Recuperar Impressão"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimir do SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sem cartão SD"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Dormindo..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Clique para retomar"); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impressão Pausada"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Imprimindo..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impressão Abortada"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sem movimento"); - PROGMEM Language_Str MSG_KILLED = _UxGT("PARADA DE EMERGÊNCIA"); - PROGMEM Language_Str MSG_STOPPED = _UxGT("PAROU. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrair mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Retrair Troca mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retrair V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saltar mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Des-Retrair mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Des-RetTroca mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Des-Retrair V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Des-RetTroca V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retração Automática"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Distancia Retração"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Mudar Ferramenta"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Levantar Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Preparar Veloc."); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Veloc. Retração"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Trocar Filamento"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Trocar Filamento *"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Carregar Filamento *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Descarreg. Filamento *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descarregar Todos"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciar SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Trocar SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda fora da mesa"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Fator de Cisalho"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Testar BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reiniciar BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Estender BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Recolher BLTouch"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda-Z"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Recolher Sonda-Z"); - - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s Primeiro"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Compensar Sonda em Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Passinho X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Passinho Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Passinho Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Abortar Fim de Curso"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Aquecer mesa falhou"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro:Temp Redundante"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ESCAPE TÉRMICO"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ESCAPE TÉRMICO MESA"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Erro:Temp Máxima"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Erro:Temp Mínima"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Erro:Temp Mesa Máx"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Erro:Temp Mesa Mín"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY Primeiro"); - PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESSORA PAROU"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Favor resetar"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Aquecendo..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Resfriando..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Aquecendo mesa..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Esfriando mesa..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibrar Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); - - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Configuração Delta"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-Calibração"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Calibrar Altura"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Desloc. Sonda Z"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Haste Diagonal"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altura"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Raio"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Sobre"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Impressora"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelamento 3 pontos"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelamento Linear"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelamento Bilinear"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelamento UBL"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelamento da Malha"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estatísticas"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. da Placa"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusoras"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Taxa de Transmissão"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz da Impressora"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Intensidade Brilho"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total de Impressões"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Realizadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo de Impressão"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Trabalho Mais longo"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total de Extrusão"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Qtd de Impressões"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Realizadas"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo de Impressão"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Maior trabalho"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("T. Extrusão"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp Mín"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp Máx"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Força do Motor"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escrever EEPROM DAC"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPRESSÃO PAUSADA"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARREGAR FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DESCARREG. FILAMENTO"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Config. de Retomada"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purgar mais"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continuar Impressão"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Bocal: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sensor filamento"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Falha ao ir à origem"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Falha ao sondar"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Muito frio"); - - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Aperte o botão para", "continuar impressão")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperando o", "inicio da", "troca de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Coloque filamento", "pressione o botão", "para continuar...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Pressione o botão", "p/ aquecer o bocal")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Aquecendo o bocal", "Aguarde...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Esperando", "remoção de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Esperando", "filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Espere pela", "purga de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Clique para finaliz.", "purga de filamento")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperando impressão", "continuar")); - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Clique p. continuar")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Aguarde...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insira e Clique")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Aquecendo...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Ejetando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Carregando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purgando...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Clique p. finalizar")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Continuando...")); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ru.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ru.h deleted file mode 100644 index 3dd71b6e9e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_ru.h +++ /dev/null @@ -1,467 +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 - -/** - * Russian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -#define DISPLAY_CHARSET_ISO10646_5 - -namespace Language_ru { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Russian"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" готов."); - PROGMEM Language_Str MSG_BACK = _UxGT("Назад"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Карта вставлена"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Карта извлечена"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("SD карта не активна"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Эндстопы"); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Прогр. эндстопы"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Другие настройки"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Настройки"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Выкл. двигатели"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Меню отладки"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест индикатора"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Авто парковка"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Парковка X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Парковка Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Парковка Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Нулевое положение"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Нажмите чтобы начать"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Следующая точка"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Выравнивание готово!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Высота спада"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Запомнить парковку"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Коррекции применены"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Запомнить ноль"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Преднагрев ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Преднагрев ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" сопло"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" сопло ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" всё"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" стол"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" настр."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Преднагрев ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Преднагрев ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" сопло"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" сопло ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" всё"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" стол"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" настр."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждение"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Включить питание"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Выключить питание"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Экструзия"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Втягивание"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Движение по осям"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Калибровка стола"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Калибровать стол"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Выровнять углы"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Следующий угол"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Редактировать сетку"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Ред. сетки завершено"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Свои команды"); - - PROGMEM Language_Str MSG_M48_TEST = _UxGT("Проверка датчика Z"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Отклонение"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("Измерение"); - - // TODO: IDEX Menu - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Размещение сопел"); - - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2-е сопло X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2-е сопло Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2-е сопло Z"); - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Выполняем G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Утилиты UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Калибровка UBL"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Постр. сетку от руки"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Пост. шимм и измер."); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Измерение"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Удал. и измер. стол"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Двигаемся дальше"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Активировать UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Деактивировать UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура стола"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Редактор сеток"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редакт. свою сетку"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Точная настр. сетки"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Ред. сетки завершено"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Построить свою сетку"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Построить сетку"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Построить сетку ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Построить сетку ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Построить хол. сетку"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Устан. высоту сетки"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Высота"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Проверить сетку"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Проверить сетку ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Проверить сетку ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Проверить свою сетку"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Продолжить сетку"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Калибровка сетки"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Калибровка 3-х точек"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Калибровка растера"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Выровнить сетку"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Крайние точки"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Тип карты"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Вывести карту сетки"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Вывести на хост"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Вывести в CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Забекапить сетку"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Вывод информации UBL"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Кол-во заполнителя"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ручное заполнение"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Умное заполнение"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Заполнить сетку"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Аннулировать всё"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Аннулир. ближ. точку"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Точная настр. всего"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Настр. ближ. точки"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Хранилище сетей"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Слот памяти"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Загрузить сетку стола"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Сохранить сетку стола"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Сетка %i загружена"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Сетка %i сохранена"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Нет хранилища"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Ошибка: Сохран. UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Ошибка: Восстан. UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Смещение Z останов."); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Пошаговое UBL"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Построить хол. сетку"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Умное заполнение"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Проверить сетку"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Точная настр. всего"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Проверить сетку"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Точная настр. всего"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Сохранить сетку стола"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Настройки LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Подсветку"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Предустановки света"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Красный свет"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Оранжевый свет"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Жёлтый свет"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Зелёный свет"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Синий свет"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Индиго свет"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Фиолетовый свет"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Белый свет"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Свет по умолчанию"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Свои настр. света"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Интенсивн. красного"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Интенсивн. зелёного"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Интенсивн. синего"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Интенсивн. белого"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Яркость"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Движемся..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Освобождаем XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Движение по X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Движение по Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Движение по Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Экструдер"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Экструдер *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Движение %sмм"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Движение 0.1мм"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Движение 1мм"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Движение 10мм"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Скорость"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Z стола"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Сопло"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Стол"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Кулер"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Кулер ~"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Кулер доп."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Кулер доп. ~"); - PROGMEM Language_Str MSG_FLOW = _UxGT("Поток"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Поток ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Настройки"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Мин"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Макс"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпература"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Вкл."); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Выкл."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Выбор"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Выбор *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Ускорение"); - PROGMEM Language_Str MSG_JERK = _UxGT("Рывок"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-рывок"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-рывок"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-рывок"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-рывок"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Быстрота"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vмакс ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vмакс ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vмакс ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vмакс ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vмакс *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vмин"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vпутеш. мин"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Ускорение"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aмакс ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aмакс ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aмакс ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aмакс ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aмакс *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-втягивание"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-путеш."); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Шаг/мм"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("шаг/мм"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("шаг/мм"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("шаг/мм"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Eшаг/мм"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*шаг/мм"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Филамент"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диаметр филамента"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диаметр филамента *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Загрузка мм"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Выгрузка мм"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K продвижения"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K продвижения *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Контраст LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Сохранить настройки"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Загрузить настройки"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Вернуть настройки"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Инициализация EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Обновление прошивки"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Сброс принтера"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Обновить"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Информационный экран"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Подготовить"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Настроить"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Начало печати"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Дальше"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Инициализация"); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Остановить"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Печать"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Сброс"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Отмена"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Пауза печати"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Продолжить печать"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Остановить печать"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Восстановение сбоя"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Печать с SD карты"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Нет SD карты"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Сон..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Продолжить..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Печать на паузе"); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Печать отменена"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Нет движения."); - PROGMEM Language_Str MSG_KILLED = _UxGT("УБИТО. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ОСТАНОВЛЕНО. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягивание мм"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Втягивание смены мм"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Втягивание V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Втяг. прыжка мм"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Возврат мм"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Возврат смены мм"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Возврат V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Возврат смены V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Авто Втягивание"); - - // TODO: Filament Change Swap / Purge Length - - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Смена сопел"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Поднятие по Z"); - - // TODO: Singlenozzle, nozzle standby - - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Смена филамента"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Смена филамента *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Загрузка филамента"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Загрузка филамента *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Выгрузка филамента *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Выгрузить всё"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Активировать SD"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Сменить SD карту"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Деактивировать SD"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z датчик вне стола"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Фактор наклона"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Тестирование BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Сброс BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Установка BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Набивка BLTouch"); - - // TODO: TouchMI Probe, Manual deploy/stow - - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Паркуй %s%s%s сначала"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Смещение Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Микрошаг X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Микрошаг Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Микрошаг Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Сработал концевик"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Разогрев не удался"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Неудача нагрева стола"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Ошибка: Избыточная Т"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("УБЕГАНИЕ ТЕПЛА"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("УБЕГАНИЕ ТЕПЛА СТОЛА"); - // TODO: Heated chamber - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Ошибка: Т макс."); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Ошибка: Т мин."); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Ошибка: Т стола макс"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Ошибка: Т стола мин."); - // TODO: Heated chamber - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Паркуй XY сначала"); - PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ОСТАНОВЛЕН"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Сделайте сброс"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("д"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("ч"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("м"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрев..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Охлаждение..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрев стола..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охлаждение стола..."); - // TODO: Heated chamber - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калибровка Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калибровать X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калибровать Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калибровать Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калибровать центр"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Настройки Delta"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Авто калибровка"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Задать высоту Delta"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Задать Z-смещение"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Диаг. стержень"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Высота"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Радиус"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("О принтере"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Инф. о принтере"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Калибровка 3-х точек"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Линейная калибровка"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Билинейная калибр."); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Калибровка UBL"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Калибровка сетки"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Статистика принтера"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Информация о плате"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Термисторы"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Экструдеры"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Бод"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Подсветка корпуса"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яркость подсветки"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неверный принтер"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Счётчик печати"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Закончено"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Общее время печати"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Наидольшее задание"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Длина филамента"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Отпечатков"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Закончено"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Всего"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Наидольшее"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Выдавлено"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Мин. Т"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс. Т"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("БП"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила привода"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Привод %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("ПЕЧАТЬ НА ПАУЗЕ"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ЗАГРУЗКА ФИЛАМЕНТА"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("ВЫГРУЗКА ФИЛАМЕНТА"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Выдавить ещё"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Возобновить печать"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Сопла: "); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Возврат не удался"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Не удалось прощупать"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Низкая Т"); - - // TODO: MMU2 - - // TODO: Mixing - - PROGMEM Language_Str MSG_GAMES = _UxGT("Игры"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Кирпичи"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Вторжение"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Змейка"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Лабиринт"); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Ожидайте", "начала смены", "филамента")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Ожидайте", "выгрузки", "филамента")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставьте пруток", "и нажмите кнопку", "для продолжения")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Нажмите кнопку для", "нагрева сопла...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Нагрев сопла", "Ждите...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Ожидайте", "загрузки прутка")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Ожидайте", "экструзии", "филамента")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Ожидайте", "возобновления", "печати")); - #else - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Ожидайте...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Выгрузка...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Вставь и нажми")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Нагрев...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Загрузка...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Выдавливание...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Возобновление...")); - #endif - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Драйвера TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Текущие настройки"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Гибридный режим"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Режим без эндстопов"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Режим шага"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Тихий режим вкл"); - - // TODO: Service - - // TODO: Backlash -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_sk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_sk.h deleted file mode 100644 index bc0cd6e660..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_sk.h +++ /dev/null @@ -1,583 +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 - -/** - * Slovak - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Translated by Michal Holeš, Farma MaM - * http://www.facebook.com/farmamam - * - */ -#define DISPLAY_CHARSET_ISO10646_SK - -namespace Language_sk { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Slovak"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pripravená."); - PROGMEM Language_Str MSG_YES = _UxGT("ÁNO"); - PROGMEM Language_Str MSG_NO = _UxGT("NIE"); - PROGMEM Language_Str MSG_BACK = _UxGT("Naspäť"); - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Ruším..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta vložená"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta vybraná"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Karta odpojená"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Čakám na kartu"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Chyba čítania karty"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB zaria. odstrán."); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Chyba spúšťania USB"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopy"); // max 8 znakov - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft. endstopy"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavná ponuka"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Pokročilé nastav."); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurácia"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto-štart"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolniť motory"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Ponuka ladenia"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. priebehu"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Domovská pozícia"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Domov os X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto-zarovn. Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Parkovanie XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím spusťte"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Ďalší bod"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Meranie hotové!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Výška rovnania"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastaviť ofsety"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nastaviť začiatok"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Zahriať ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Zahriať ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" hotend"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" hotend ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" všetko"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" podlož"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" nast."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Zahriať ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Zahriať ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" hotend"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" hotend ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" všetko"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" podlož"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" nast."); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Vlastná teplota"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Schladiť"); - PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Nastavenie lasera"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnúť laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnúť laser"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon lasera"); - PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Nastavenie vretena"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Vypnúť vreteno"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Zapnúť vreteno"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Výkon vretena"); - PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spätný chod"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnúť napájanie"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Vypnúť napájanie"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Vytlačiť (extr.)"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Vytiahnuť (retr.)"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Posunúť osy"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Vyrovnanie podložky"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Vyrovnať podložku"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Vyrovnať rohy"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Ďalší roh"); - PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor sieťe bodov"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Upraviť sieť bodov"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Koniec úprav siete"); - PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Skúšam bod"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Hodnota Z"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Vlastné príkazy"); - PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Test sondy"); - PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Bod"); - PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Odchýlka"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX režim"); - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Ofset nástrojov"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-parkovanie"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikácia"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrkadlená kópia"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Vykonávam G29"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Nástroje UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("UBL rovnanie"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Vyrovnávam bod"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manuálna sieť bodov"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Položte a zmerajte"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Zmerajte"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Odstráňte a zmerajte"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Presun na ďalší"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktivovať UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deaktivovať UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Teplota podložky"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Teplota podložky"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Teplota hotendu"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Teplota hotendu"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Úprava siete bodov"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Upraviť vlastnú sieť"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Doladiť sieť bodov"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Koniec úprav siete"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Vlastná sieť"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Vytvoriť sieť"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Sieť bodov ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Sieť bodov ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Studená sieť bodov"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Upraviť výšku siete"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Výška"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Skontrolovať sieť"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Kontrola siete ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Kontrola siete ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Kontrola vlast.siete"); - PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 ohrev podlž."); - PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 ohrev trysky"); - PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Ručné čistenie..."); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Čistenie pevn. dĺž."); - PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Čistenie dokončené"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 zrušený"); - PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Opúšťam G26"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Pokračovať v sieti"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Sieťové rovnanie"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-bodové rovnanie"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Vyrovnať podložku"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Postranné body"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Typ siete bodov"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Exportovať sieť"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Exportovať do PC"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Exportovať do CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Záloha do PC"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info. o UBL do PC"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Hustota mriežky"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ručné vyplnenie"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Vyplniť mriežku"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušiť všetko"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušiť najbližší"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Upraviť všetky"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Upraviť najbližší"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Úložisko sietí"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Pamäťový slot"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Načítať sieť bodov"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Uložiť sieť bodov"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Sieť %i načítaná"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Sieť %i uložená"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nedostatok miesta"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Chyba: Ukladanie UBL"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Chyba: Obnovenie UBL"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Ofset: "); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Koniec kompenz. Z"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Postupné UBL"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Studená sieť bodov"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Chytré vyplnenie"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Skontrolovať sieť"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Upraviť všetky"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Skontrolovať sieť"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Upraviť všetky"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Uložiť sieť bodov"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Nastavenie LED"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Svetlo"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Prednastavené farby"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Červená"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Oranžová"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Žltá"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zelená"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Modrá"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fialová"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Biela"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Obnoviť nastavenie"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Vlastná farba"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Inten. červenej"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Inten. zelenej"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Inten. modrej"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Inten. bielej"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jas"); - - PROGMEM Language_Str MSG_MOVING = _UxGT("Posúvam..."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Uvolniť XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Posunúť X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Posunúť Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Posunúť Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunúť o %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Rýchlosť"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Výška podl."); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Tryska"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Tryska ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); - PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rýchlosť ex. vent."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Prietok ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládanie"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto-teplota"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Zap"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); - PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID kalibrácia"); - PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID kalibrácia *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrať"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrať *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Zrýchlenie"); - PROGMEM Language_Str MSG_JERK = _UxGT("Skok"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-skok"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-skok"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-skok"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-skok"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Rýchlosť"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VPrej Min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Akcelerácia"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-prejazd"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Kroky/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("krokov/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("krokov/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("krokov/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Ekrokov/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*krokov/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Priem. fil."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Priem. fil. *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Vysunúť mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Zaviesť mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K pre posun"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K pre posun *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložiť nastavenie"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načítať nastavenie"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnoviť nastavenie"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializ. EEPROM"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizovať z SD"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Info. obrazovka"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Príprava tlače"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Doladenie tlače"); - PROGMEM Language_Str MSG_START_PRINT = _UxGT("Spustiť tlač"); - PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Ďalší"); - PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inicial."); - PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Zastaviť"); - PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Tlačiť"); - PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Vynulovať"); - PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Zrušiť"); - PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Hotovo"); - PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Naspäť"); - PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Pokračovať"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Obnoviť tlač"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zastaviť tlač"); - PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); - PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); - PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Obnova po výp. nap."); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tlačiť z SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Žiadna SD karta"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Spím..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Pokrač. kliknutím..."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Tlačím..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Žiadny pohyb."); - PROGMEM Language_Str MSG_KILLED = _UxGT("PRERUŠENÉ. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ZASTAVENÉ. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrakt mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Výmena Re.mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraktovať V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Zdvih Z mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Dĺžka výmeny"); - PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Dĺžka vytlačenia"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Výmena nástroja"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvihnúť Z"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Primárna rýchl."); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Rýchl. retrakcie"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Záložná tryska"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Vymeniť filament"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Vymeniť filament *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Zaviesť filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Zaviesť filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Vysunúť filament"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Vysunúť filament *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunúť všetko"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Načítať SD kartu"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Vymeniť SD kartu"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Odpojiť SD kartu"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl."); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Faktor skosenia"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Zasunúť"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Vysunúť"); - PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Režim SW"); - PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Režim 5V"); - PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Režim OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Ulož. režim"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Prepnúť do 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Prepnúť do OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Zobraziť režim"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("POZOR: Zlé nastav. môže spôsobiť poškoden. Pokračovať?"); - PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inicializ. TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test ofsetu Z"); - PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Uložiť"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Zasunúť TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Zasunúť sondu Z"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Vysunúť sondu Z"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Najskôr os %s%s%s domov"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Ofset sondy Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Celkom"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Zastavenie Endstop"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Chyba ohrevu podl."); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Chyba ohrevu komory"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Chyba: REDUND. TEP."); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÝ SKOK"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPLOTNÝ SKOK PODL."); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("TEPLOTNÝ SKOK KOMO."); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Chyba: MAXTEMP"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Chyba: MINTEMP"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Chyba: MAXTEMP PODL."); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Chyba: MINTEMP PODL."); - PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Chyba: MAXTEMP KOMO."); - PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Chyba: MINTEMP KOMO."); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Najskôr os XY domov"); - PROGMEM Language_Str MSG_HALTED = _UxGT("TLAČIAREŇ ZASTAVENÁ"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reštartuje ju"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); - PROGMEM Language_Str MSG_HEATING = _UxGT("Ohrev..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Ochladzovanie..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ohrev podložky..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Ochladz. podložky..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Ohrev komory..."); - PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Ochladz. komory..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta kalibrácia"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrovať X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrovať Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrovať Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovať stred"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta nastavenia"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-kalibrácia"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast. výšku delty"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ofset sondy Z"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag. rameno"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Výška"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Polomer"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O tlačiarni"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. o tlačiarni"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-bodové rovnanie"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineárne rovnanie"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineárne rovnanie"); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("UBL rovnanie"); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Štatistika"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. o doske"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Rýchlosť"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Tepl. ochrana: VYP"); - PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Tepl. ochrana: ZAP"); - - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvetlenie"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas svetla"); - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončené"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia tlač"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Celkom vytlačené"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Tlače"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Hotovo"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Čas"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačené"); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Nap. zdroj"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Budenie motorov"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Motor %"); - PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("CHYBA KOMUNIKÁ. TMC"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Uložiť do EEPROM"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMENA FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("PAUZA TLAČE"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAVEDENIE FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("VYSUNUTIE FILAMENTU"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI POKRAČ.:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačiť viacej"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnoviť tlač"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); - PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Vzd. mm fil. senz."); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Parkovanie zlyhalo"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Kalibrácia zlyhala"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Príliš studený"); - - PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("VYBERTE FILAMENT"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU2"); - PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Aktualizujte FW MMU!"); - PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU potrebuje zásah."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Obnoviť tlač"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Obnovovanie..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Zaviesť filament"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Zaviesť všetky"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Zaviesť po trysku"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Vysunúť filament"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Vysunúť filament ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Vyňať filament"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Zavádzanie fil. %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Vysúvanie fil. ..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Vysúvanie fil. ..."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Všetky"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reštartovať MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Reštart MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Odstráňte, kliknite"); - - PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); - PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Zložka ~"); - PROGMEM Language_Str MSG_MIXER = _UxGT("Mixér"); - PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Plný gradient"); - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Prepnúť mix"); - PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cyklický mix"); - PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradientný mix"); - PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Otočiť gradient"); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktívny V-tool"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Počiat. V-tool"); - PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Konečn. V-tool"); - PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); - PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Vynulovať V-tools"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložiť V-tool Mix"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools vynulované"); - PROGMEM Language_Str MSG_START_Z = _UxGT("Počiat.Z:"); - PROGMEM Language_Str MSG_END_Z = _UxGT("Konečn.Z:"); - - PROGMEM Language_Str MSG_GAMES = _UxGT("Hry"); - PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); - PROGMEM Language_Str MSG_INVADERS = _UxGT("Nájazdníci"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Had"); - PROGMEM Language_Str MSG_MAZE = _UxGT("Bludisko"); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stlačte tlačidlo", "pre obnovu tlače")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkovanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čakajte prosím", "na spustenie", "výmeny filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Vložte filament", "a stlačte tlačidlo", "pre pokračovanie")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Stlačte tlačidlo", "pre ohrev trysky")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Ohrev trysky", "Čakajte prosím...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Čakajte prosím", "na vysunutie", "filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Čakajte prosím", "na zavedenie", "filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Čakajte prosím", "na vytlačenie", "filamentu")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Stlačte tlačidlo", "pre dokončenie", "vytláčania filam.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Čakajte prosím na", "obnovenie tlače...")); - #else - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Kliknite pre pokr.")); - PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkovanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Čakajte prosím...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Vložte a kliknite")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Kliknite pre ohrev")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Ohrev...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Vysúvanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Zavádzanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Vytlačovanie...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Klik. pre dokonč.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Pokračovanie...")); - #endif - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Ovládače TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Prúd ovládača"); - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybridný prah"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Bezsenzor. domov"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Režim krokovania"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop zapnutý"); - PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Vynulovať"); - PROGMEM Language_Str MSG_SERVICE_IN = _UxGT("za:"); - PROGMEM Language_Str MSG_BACKLASH = _UxGT("Kompenz. vôle"); - PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; - PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; - PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; - PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korekcia"); - PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Vyhladzovanie"); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_test.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_test.h deleted file mode 100644 index b03d92039a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_test.h +++ /dev/null @@ -1,237 +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 - -/** - * TEST - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -// Select ONE of the following Mappers. -// They decide what to do with a symbol in the area of [0x80:0xFF]. They take a symbol of this language file and make them point -// into an array with 128 cells, where they'll find the place of the symbol of the font in use. -// -// a.)For ASCII coded Language_xx.h files like (en) there are no occurrences of symbols above 0x7F so no mapper is needed. -// If such a symbol appears it is mapped directly into the font. This is the case for the language files we used until now, with all the STR_XX or -// "\xxx" symbols. All Symbols are only one byte long. -// b.) For Unicoded Language_xx.h files (currently ru, de and kana_utf8 ) the non ASCII [0x00-0x7F] symbols are represented by more than one byte. -// In the case of two bytes the first is pointing to a 'codepage' and the second to a place in the codepage. These codepages contain 64 symbols. -// So two of them can be mapped. For most of the European languages the necessary symbols are contained in the pages C2 and C3. Cyrillic uses D0 -// and D1. -// c.) For katakana (one of the Japanese symbol sets) Unicode uses 3 bytes. Here the second byte also points to a codepage and byte 3 to the symbol. -// I hope the pages E282 and E283 are sufficient to write katakana. -// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not -// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). - - -// Select the better font for full graphic displays. -//#define DISPLAY_CHARSET_ISO10646_1 -//#define DISPLAY_CHARSET_ISO10646_5 -//#define DISPLAY_CHARSET_ISO10646_GREEK -//#define DISPLAY_CHARSET_ISO10646_KANA - - - -// next 5 lines select variants in this file only -#define DISPLAYTEST -//#define WEST -//#define CYRIL -//#define KANA - - -// TESTSTRINGS - -#define STRG_ASCII_2 _UxGT(" !\"#$%&'()*+,-./") -#define STRG_ASCII_3 _UxGT("0123456789:;<=>?") -#define STRG_ASCII_4 _UxGT("@ABCDEFGHIJKLMNO") -#define STRG_ASCII_5 _UxGT("PQRSTUVWXYZ[\\]^_") -#define STRG_ASCII_6 _UxGT("`abcdefghijklmno") -#define STRG_ASCII_7 _UxGT("pqrstuvwxyz{|}~") - -#define STRG_C2_8 _UxGT("") -#define STRG_C2_9 _UxGT("") -#define STRG_C2_a _UxGT(" ¡¢£¤¥¦§¨©ª«¬­®¯") -#define STRG_C2_b _UxGT("°±²³´µ¶·¸¹º»¼½¾¿") -#define STRG_C3_8 _UxGT("ÈÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ") -#define STRG_C3_9 _UxGT("ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß") -#define STRG_C3_a _UxGT("àáâãäåæçèéêëìíîï") -#define STRG_C3_b _UxGT("ðñòóôõö÷øùúûüýþÿ") - -#define STRG_D0_8 _UxGT("ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ") -#define STRG_D0_9 _UxGT("АБВГДЕЖЗИЙКЛМНОП") -#define STRG_D0_a _UxGT("РСТУФХЦЧШЩЪЫЬЭЮЯ") -#define STRG_D0_b _UxGT("абвгдежзийклмноп") -#define STRG_D1_8 _UxGT("рстуфхцчшщъыьэюя") -#define STRG_D1_9 _UxGT("ѐёђѓєѕіїјљњћќѝўџ") -#define STRG_D1_a _UxGT("ѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯ") -#define STRG_D1_b _UxGT("ѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿ") - -#define STRG_E382_8 _UxGT("よめもゃやゅゆょよらりるれろゎわ") -#define STRG_E382_9 _UxGT("ゐゑをんゔゕゖ゗゘゙゚゛ ゜ゝゞゟ") -#define STRG_E382_a _UxGT("゠ァアィイゥウェエォオカガキギク") -#define STRG_E382_b _UxGT("グケゲコゴサザシジスズセゼソゾタ") -#define STRG_E383_8 _UxGT("トチヂッツヅテデトドナニヌネノハ") -#define STRG_E383_9 _UxGT("バパヒビピフブプヘベペホボポマミ") -#define STRG_E383_a _UxGT("ムメモャヤュユョヨラリルレロヮワ") -#define STRG_E383_b _UxGT("ヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿ") - -#define STRG_OKTAL_0 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" -#define STRG_OKTAL_1 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define STRG_OKTAL_2 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" -#define STRG_OKTAL_3 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" -#define STRG_OKTAL_4 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" -#define STRG_OKTAL_5 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" -#define STRG_OKTAL_6 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" -#define STRG_OKTAL_7 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" -#define STRG_OKTAL_8 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217" -#define STRG_OKTAL_9 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237" -#define STRG_OKTAL_a "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" -#define STRG_OKTAL_b "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" -#define STRG_OKTAL_c "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" -#define STRG_OKTAL_d "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" -#define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" -#define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" - -namespace Language_test { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 1; - - #if ENABLED(DISPLAYTEST) - PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); - - PROGMEM Language_Str MSG_WATCH = _UxGT("Display test"); - PROGMEM Language_Str MSG_PREPARE = STRG_OKTAL_b; - PROGMEM Language_Str MSG_CONTROL = STRG_OKTAL_c; - #endif - - #if ENABLED(WEST) - PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); - - PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); - - PROGMEM Language_Str MSG_MAIN = _UxGT(".."); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_C2_8; - PROGMEM Language_Str MSG_AUTO_HOME = STRG_C2_9; - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_C2_a; - PROGMEM Language_Str MSG_PREHEAT_1 = STRG_C2_b; - PROGMEM Language_Str MSG_PREHEAT_2 = STRG_C3_8; - PROGMEM Language_Str MSG_COOLDOWN = STRG_C3_9; - PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_C3_a; - PROGMEM Language_Str MSG_MOVE_AXIS = STRG_C3_b; - - PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; - PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; - PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; - PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; - PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; - - PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; - PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; - PROGMEM Language_Str MSG_FAN_SPEED = STRG_OKTAL_9; - PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; - PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; - PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; - PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; - PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; - PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; - PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; - - #endif - - #if ENABLED(CYRIL) - PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); - - PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); - - PROGMEM Language_Str MSG_MAIN = _UxGT(".."); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_D0_8; - PROGMEM Language_Str MSG_AUTO_HOME = STRG_D0_9; - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_D0_a; - PROGMEM Language_Str MSG_PREHEAT_1 = STRG_D0_b; - PROGMEM Language_Str MSG_PREHEAT_2 = STRG_D1_8; - PROGMEM Language_Str MSG_COOLDOWN = STRG_D1_9; - PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_D1_a; - PROGMEM Language_Str MSG_MOVE_AXIS = STRG_D1_b; - - PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; - PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; - PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; - PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; - PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; - - PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; - PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; - PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; - PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; - PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; - PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; - PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; - PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; - PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; - - #endif - - #if ENABLED(KANA) - PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); - - PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); - - PROGMEM Language_Str MSG_MAIN = _UxGT(".."); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_E382_8; - PROGMEM Language_Str MSG_AUTO_HOME = STRG_E382_9; - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_E382_a; - PROGMEM Language_Str MSG_PREHEAT_1 = STRG_E382_b; - PROGMEM Language_Str MSG_PREHEAT_2 = STRG_E383_8; - PROGMEM Language_Str MSG_COOLDOWN = STRG_E383_9; - PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_E383_a; - PROGMEM Language_Str MSG_MOVE_AXIS = STRG_E383_b; - - PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; - PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; - PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; - PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; - PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; - - PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; - PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; - PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; - PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; - PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; - PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; - PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; - PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; - PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_tr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_tr.h deleted file mode 100644 index 68b93f18af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_tr.h +++ /dev/null @@ -1,435 +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 - -/** - * Turkish - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - * Bu çeviri dosyasındaki sorunlar ve düzeltmeler için iletişim; - * Contact for issues and corrections in this translation file; - * Yücel Temel - (info@elektromanyetix.com) - https://elektromanyetix.com/ - * - */ - -#define DISPLAY_CHARSET_ISO10646_TR - -namespace Language_tr { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Turkish"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" hazır."); - PROGMEM Language_Str MSG_BACK = _UxGT("Geri"); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD K. Yerleştirildi."); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD Kart Çıkarıldı."); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Enstops"); // Max length 8 characters - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Yazılımsal Endstops"); - PROGMEM Language_Str MSG_MAIN = _UxGT("Ana"); - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Gelişmiş Ayarlar"); - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Yapılandırma"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Oto. Başlat"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motorları Durdur"); - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hata Ayıklama"); - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Durum Çubuğu Testi"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Eksenleri Sıfırla"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X Sıfırla"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y Sıfırla"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z Sıfırla"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Oto. Z-Hizalama"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ Sıfırlanıyor"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Başlatmak için tıkla"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Sonraki Nokta"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Hizalama Tamam!"); - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Kaçınma Yüksekliği"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Offset Ayarla"); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset Tamam"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Sıfır Belirle"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Ön Isınma ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Ön Isınma ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tüm"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tabla"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Ayarlar"); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Ön Isınma ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Ön Isınma ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Nozul"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Nozul ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Tüm"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Tabla"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Ayarlar"); - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isınma"); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Soğut"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Gücü Aç"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Gücü Kapat"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ekstrüzyon"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Geri Çek"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Eksen Hareketleri"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Tabla Hizalama"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Tabla Hizası"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Hizalama Köşeleri"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Sonraki Köşe"); - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Mesh Düzenle"); - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Mesh Düzenleme Durdu"); - PROGMEM Language_Str MSG_MESH_X = _UxGT("İndeks X"); - PROGMEM Language_Str MSG_MESH_Y = _UxGT("İndeks Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z Değeri"); - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Özel Komutlar"); - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Modu"); - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Oto-Park"); - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Kopyala"); - PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Yansıtılmış kopya"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Tam Kontrol"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. nozul X"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. nozul Y"); - PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. nozul Z"); - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 Çalışıyor"); - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Araçları"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("UBL Yatak Hizalama"); - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Elle Mesh Oluştur"); - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Altlık & Ölçü Ver"); - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Ölçü"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Yataktan Ölçü Kaldır"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Sonrakine Git"); - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL'yi Etkinleştir"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL'yi Etkisizleştir"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Yatak Sıcaklığı"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Yatak Sıcaklığı"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Nozul Sıcaklığı"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Nozul Sıcaklığı"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Mesh Düzenleme"); - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Özel Mesh Düzenleme"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("İnce Ayar Mesh"); - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Mesh Düzenleme Tamam"); - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Özel Mesh Oluştur"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Mesh Oluştur"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Mesh Oluştur (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Mesh Oluştur (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Soğuk Mesh Oluştur"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Mesh Yükseklik Ayarı"); - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Yükseklik miktarı"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Doğrulama Mesh"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Doğrulama Mesh (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Doğrulama Mesh (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Özel Mesh Doğrulama"); - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Tabla Mesh Devam et"); - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Mesh Hizalama"); - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Nokta Hizalama"); - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Kafes Mesh Hizalama"); - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Mesh Seviyesi"); - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Yan Noktalar"); - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Haritalama Türü"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Mesh Çıkış Haritası"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Host için Çıktı"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("CSV için Çıktı"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Yazıcıda Yedek Kpalı"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL Çıkış Bilgisi"); - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Dolgu Miktarı"); - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manuel Dolgu"); - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Akıllı Dogu"); - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Mesh Dolgu"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Tümünü Geçersiz Kıl"); - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Yakını Geçersiz Kıl"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Tümünü İnce Ayarla"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Yakını İnce Ayarla"); - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Depolama"); - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Bellek Yuvası"); - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Yatak Mesh Yükle"); - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Yatak Mesh Kayıt Et"); - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i yüklendi"); - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i kayıtlandı"); - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Depolama Yok"); - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Hata: UBL Kayıt"); - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Hata: UBL Yenileme"); - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Ofset Durduruldu"); - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Adım Adım UBL"); - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Soğuk Mesh Oluştur"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Akıllı Dogu"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Doğrulama Mesh"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Tümünü İnce Ayarla"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Doğrulama Mesh"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Tümünü İnce Ayarla"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Yatak Mesh Kayıt Et"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Kontrolü"); - PROGMEM Language_Str MSG_LEDS = _UxGT("Işıklar"); - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Işık Hazır Ayarları"); - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Kırmızı"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Turuncu"); - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Sarı"); - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Yeşil"); - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Mavi"); - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Lacivert"); - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Menekşe"); - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Beyaz"); - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Varsayılan"); - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Özel Işıklar"); - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Kırmızı Şiddeti"); - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Yeşil Şiddeti"); - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Mavi Şiddeti"); - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Beyaz Şiddeti"); - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Parlaklık"); - PROGMEM Language_Str MSG_MOVING = _UxGT("Hareket Ediyor.."); - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Durdur XY"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("X Hareketi"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Y Hareketi"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Z Hareketi"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruder"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruder *"); - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Nozul Çok Soğuk"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Hız"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Mesafesi"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozul"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozul ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Tabla"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Hızı"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Hızı ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Ekstra Fan Hızı"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Ekstra Fan Hızı ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Akış"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Akış ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Çarpan"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Oto. Sıcaklık"); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Açık"); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Kapalı"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Seç"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seç *"); - PROGMEM Language_Str MSG_ACC = _UxGT("İvme"); - PROGMEM Language_Str MSG_JERK = _UxGT("Sarsım"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-Sarsım"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-Sarsım"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-Sarsım"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-Sarsım"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Jonksiyon Sapması"); - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Hız Vektörü"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("HızVektör.max ") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("HızVektör.max ") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("HızVektör.max ") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("HızVektör.max ") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("HızVektör.max *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("HızVektör.min"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("HV.gezinme min"); - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Ivme"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Max. ivme ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Max. ivme ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Max. ivme ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Max. ivme ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Max. ivme *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Ivme-geri çekme"); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Ivme-gezinme"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Adım/mm"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" adım/mm"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" adım/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" adım/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("E adım/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* adım/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Sıcaklık"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Hareket"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filaman"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ekstrüzyon/mm³"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filaman Çapı"); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filaman Çapı *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Çıkart mm"); - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Yükle mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K İlerlet"); - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K İlerlet *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Kontrast"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Hafızaya Al"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hafızadan Yükle"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Fabrika Ayarları"); - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM'u başlat"); - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("SD Güncellemesi"); - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Yazıcıyı Resetle"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Yenile"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Bilgi Ekranı"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Hazırlık"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Ayar"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Duraklat"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Sürdür"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Durdur"); - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Kesinti Kurtarma"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD Karttan Yazdır"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD Kart Yok!"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Uyku..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Operatör bekleniyor."); - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Baskı Duraklatıldı"); - PROGMEM Language_Str MSG_PRINTING = _UxGT("Baskı Yapılıyor..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Baskı Durduruldu!"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("İşlem yok."); - PROGMEM Language_Str MSG_KILLED = _UxGT("Kilitlendi. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("Durdu. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Geri Çek mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Geri Çekme V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Atlama mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Oto. Geri Çekme"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("G.Çekme Boyu"); - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Takım Değişimi"); - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Yükselt"); - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Birincil Hız"); - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Geri Çekme Hızı"); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Filaman Değiştir"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Filaman Değiştir *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Filaman Yükle"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Filaman Yükle *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Filaman Çıkart"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Filaman Çıkart *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Tümünü Çıkart"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("SD Kart Başlatılıyor"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("SD Kart Değiştir"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z Prob Açık. Tabla"); - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Çarpıklık Faktörü"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Sıfırla BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch Aç"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch Kapat"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Prob Aç"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Sensör Kapat"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Sıfırla %s%s%s Önce"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Miniadım X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Miniadım Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Miniadım Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop iptal"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Isınma başarısız"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Yatak Isınma Başrsız"); - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Hata: Sıcaklık Aşımı"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TERMAL PROBLEM"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TABLA TERMAL PROBLEM"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Hata: MAX.SICAKLIK"); - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Hata: MIN.SICAKLIK"); - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Hata: MAX.SIC. TABLA"); - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Hata: MIN.SIC. TABLA"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Önce XY Sıfırla"); - PROGMEM Language_Str MSG_HALTED = _UxGT("YAZICI DURDURULDU"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Lütfen Resetleyin"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("G"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("S"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("D"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Isınıyor..."); - PROGMEM Language_Str MSG_COOLING = _UxGT("Soğuyor..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Tabla Isınıyor..."); - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Tabla Soğuyor..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrasyonu"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Ayarla X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Ayarla Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Ayarla Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Ayarla Merkez"); - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Ayarları"); - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Oto Kalibrasyon"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Yük. Ayarla"); - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z Prob Ofseti"); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Çapral Mil"); - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Yükseklik"); - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Yarıçap"); - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Yazıcı Hakkında"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Yazıcı Bilgisi"); - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Nokta Hizalama"); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Doğrusal Hizalama"); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("İki Yönlü Doğ. Hiza."); - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Birleşik Tabla Hiza."); - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mesh Hizalama"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("İstatistikler"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Kontrolcü Bilgisi"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistörler"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Ekstruderler"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("İletişim Hızı"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Aydınlatmayı Aç"); - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Aydınlatma Parlaklğı"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Yanlış Yazıcı"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Baskı Sayısı"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Toplam Baskı Süresi"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun Baskı Süresi"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Toplam Filaman"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Baskı"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Süre"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Filaman"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Sıc."); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Sıc."); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Güç Kaynağı"); - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Sürücü Gücü"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("Sürücü %"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Yaz"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("BASKI DURAKLATILDI"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("FILAMAN YüKLE"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("FILAMAN ÇIKART"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Seçenekler:"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Daha Fazla Tasviye"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Baskıyı sürdür"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozul: "); - PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout Sensörü"); - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Sıfırlama Başarısız"); - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing Başarısız"); - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Çok Soğuk"); - // - // Filament Değiştirme ekranları, 4 satırlı bir ekranda 3 satıra kadar gösterilir - // ...veya 3 satırlı ekranda 2 satıra kadar - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Baskıya devam etmek", "için Butona bas")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Filaman değişimi", "için başlama", "bekleniyor")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Filamanı yükle", "ve devam için", "tuşa bas...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Nozulü Isıtmak için", "Butona Bas.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozul Isınıyor", "Lütfen Bekleyin...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Filamanın çıkması", "bekleniyor")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Filamanın yüklenmesi", "bekleniyor..")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Filaman Temizlemesi", "için bekle")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Filaman Temizlemesi", "bitirmek için tıkla")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Baskının devam ", "etmesi için bekle")); - #else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Sürdürmek İçin Tıkla")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Lütfen bekleyiniz...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Yükle ve bas")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Isıtmak için Tıkla")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Isınıyor...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Çıkartılıyor...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Yüklüyor...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Temizleniyor...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Bitirmek için Tıkla")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Sürdürülüyor...")); - #endif // LCD_HEIGHT < 4 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_uk.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_uk.h deleted file mode 100644 index 71a48c6445..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_uk.h +++ /dev/null @@ -1,246 +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 - -/** - * Ukrainian - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_5 - -namespace Language_uk { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Ukranian"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" готовий."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Картка вставлена"); - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Картка видалена"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Кінцевик"); // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Вимк. двигуни"); - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Авто паркування"); - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Паркування X"); - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Паркування Y"); - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Паркування Z"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Паркування XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Почати"); - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Слідуюча Точка"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Завершено!"); - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Зберегти паркув."); - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення застос."); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Встанов. початок"); - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Нагрів ") PREHEAT_1_LABEL; - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Нагрів ") PREHEAT_1_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Сопло"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Сопло ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Все"); - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Стіл"); - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" нал."); - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Нагрів ") PREHEAT_2_LABEL; - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Нагрів ") PREHEAT_2_LABEL " ~"; - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Сопло"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Сопло ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Все"); - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Стіл"); - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" нал."); - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охолодження"); - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Увімкнути живлення"); - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Вимкнути живлення"); - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Екструзія"); - PROGMEM Language_Str MSG_RETRACT = _UxGT("Втягування"); - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Рух по осям"); - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Нівелювання столу"); - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Нівелювання столу"); - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Рух по X"); - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Рух по Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Рух по Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Рух по %smm"); - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Рух по 0.1mm"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Рух по 1mm"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Рух по 10mm"); - PROGMEM Language_Str MSG_SPEED = _UxGT("Швидкість"); - PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Столу"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Сопло"); - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); - PROGMEM Language_Str MSG_BED = _UxGT("Стіл"); - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Охолодж."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодж. ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("Потік"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Потік ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Налаштування"); - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Мін"); - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Макс"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Факт"); - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпер."); - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Увімк."); - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Вимк."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Вибрати"); - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Вибрати *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Приск."); - PROGMEM Language_Str MSG_JERK = _UxGT("Ривок"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-ривок"); - PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-ривок"); - PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-ривок"); - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-ривок"); - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vмакс") LCD_STR_A; - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vмакс") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vмакс") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vмакс") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vмакс *"); - PROGMEM Language_Str MSG_VMIN = _UxGT("Vмін"); - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vруху мін"); - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aмакс ") LCD_STR_A; - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aмакс ") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aмакс ") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aмакс ") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aмакс *"); - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-втягув."); - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-руху"); - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Кроків/мм"); - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("кроків/мм"); - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("кроків/мм"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("кроків/мм"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("Eкроків/мм"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*кроків/мм"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); - PROGMEM Language_Str MSG_MOTION = _UxGT("Рух"); - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Волокно"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм3"); - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Діам. волок."); - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Діам. волок. *"); - PROGMEM Language_Str MSG_CONTRAST = _UxGT("контраст LCD"); - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Зберегти в ПЗП"); - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зчитати з ПЗП"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Відновити базові"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Поновити"); - PROGMEM Language_Str MSG_WATCH = _UxGT("Інформація"); - PROGMEM Language_Str MSG_PREPARE = _UxGT("Підготувати"); - PROGMEM Language_Str MSG_TUNE = _UxGT("Підлаштування"); - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Призупинити друк"); - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Відновити друк"); - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Скасувати друк"); - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Друкувати з SD"); - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Відсутня SD карт."); - PROGMEM Language_Str MSG_DWELL = _UxGT("Сплячка..."); - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Очікування дій..."); - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Друк скасовано"); - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Немає руху."); - PROGMEM Language_Str MSG_KILLED = _UxGT("ПЕРЕРВАНО. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ЗУПИНЕНО. "); - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Зміна волокна"); - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Зміна волокна *"); - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Старт SD картки"); - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Заміна SD карти"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z дет. не в межах"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Само-Тест"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Скинути BLTouch"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Дім %s%s%s перший"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Зміщення Z"); - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Мікрокрок X"); - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Мікрокрок Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Мікрокрок Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("невдача кінцевика"); - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Невдалий нагрів"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ЗБІЙ ТЕМПЕРАТУРИ"); - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Дім XY перший"); - PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ЗУПИНЕНО"); - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Перезавантажте"); - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("д"); // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("г"); // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("х"); // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрівання..."); - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрівання столу..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібр. Delta"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калібрування X"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калібрування Y"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калібрування Z"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калібр. Центру"); - - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Про принтер"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Інформація"); - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Статистика"); - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Про плату"); - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Термістори"); - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Екструдери"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("біт/с"); - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Підсвітка"); - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неправильний принтер"); - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("К-сть друків"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Весь час друку"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший час"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Друків"); - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Загалом"); - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший"); - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Ексдруд."); - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Мін Темп."); - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс Темп."); - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Джерело жив."); - - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("% мотору"); - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП на ПЗП"); - - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Відновити друк"); - - #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Зачекайте на", "початок заміни", "волокна")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Зачекайте на", "вивід волокна")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставте волокно", "та натисніть для", "продовження...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Зачекайте на", "ввід волокна")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Зачекайте на", "відновлення", "друку")); - #else - // Up to 2 lines allowed - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Зачекайте...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Вивід...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Вставте і нат.")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Ввід...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Відновлення...")); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_vi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_vi.h deleted file mode 100644 index be3f12b330..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_vi.h +++ /dev/null @@ -1,449 +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 - -/** - * Vietnamese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_vi { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 2; - PROGMEM Language_Str LANGUAGE = _UxGT("Vietnamese"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Sẵn sàng."); // Ready - PROGMEM Language_Str MSG_BACK = _UxGT("Trở lại"); // Back - PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Đang hủy bỏ..."); - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Phương tiện được cắm vào"); // Media inserted - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Phương tiện được rút ra"); - PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Phương tiện đã phát hành"); - PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Chờ đợi phương tiện"); - PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Lỗi đọc phương tiện"); - PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB được rút ra"); - PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB khởi thất bại"); - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Công tắc"); // Endstops - công tắc hành trình - PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Công tắc mềm"); // soft Endstops - PROGMEM Language_Str MSG_MAIN = _UxGT("Chính"); // Main - PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Thiết lập cấp cao"); // Advanced Settings - PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Cấu hình"); // Configuration - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Khởi chạy tự động"); // Autostart - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Tắt động cơ bước"); // Disable steppers - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu gỡ lỗi"); // Debug Menu - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Kiểm tra tiến độ"); // Progress bar test - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Về nhà tự động"); // Auto home - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Về nhà X"); // home x - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Về nhà Y"); // home y - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Về nhà Z"); - PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Chỉnh canh Z tự động"); - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Đang về nhà XYZ"); // Homing XYZ - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Nhấn để bắt đầu"); // Click to Begin - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Điểm tiếp theo"); // Next Point - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("San lấp được hoàn thành"); // Leveling Done! - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Chiều cao mờ dần"); // Fade Height - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Đặt bù đắp nhà"); // Set home offsets - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Bù đắp được áp dụng"); // Offsets applied - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Đặt nguồn gốc"); // Set origin - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước"); // Preheat - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước ~"); // Preheat - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Đầu"); - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Đầu ~"); - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Tất cả"); // all - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Bàn"); // bed -- using vietnamese term for 'table' instead - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Cấu hình"); // conf - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" trước"); // Preheat - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" trước ~"); // Preheat - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Đầu"); - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Đầu ~"); - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Tất cả"); // all - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Bàn"); // bed -- using vietnamese term for 'table' instead - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Cấu hình"); // conf - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Sự nóng trước tự chọn"); // Preheat Custom - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Nguội xuống"); // Cooldown - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Bật nguồn"); // Switch power on - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Tắt nguồn"); // Switch power off - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ép đùn"); // Extrude - PROGMEM Language_Str MSG_RETRACT = _UxGT("Rút lại"); // Retract - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Di chuyển trục"); // Move axis - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("San Lấp Bàn"); // Bed Leveling - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Làm bằng mặt bàn"); // Level bed - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Làm bằng góc bàn"); // Level corners - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Góc tiếp theo"); // Next corner - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Chỉnh lưới đã dừng"); // Mesh Editing Stopped - PROGMEM Language_Str MSG_MESH_X = _UxGT("Mục lục X"); // Index X - PROGMEM Language_Str MSG_MESH_Y = _UxGT("Mục lục Y"); - PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Giá trị Z"); // Z Value - PROGMEM Language_Str MSG_USER_MENU = _UxGT("Các lệnh tự chọn"); // Custom Commands - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Đang chạy G29"); // Doing G29 - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Công cụ UBL"); // UBL tools - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("San Lấp Bàn Thống Nhất (UBL)"); // Unified Bed Leveling - PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("chế độ IDEX"); // IDEX Mode - PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Đậu tự động"); // Auto-Park - PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Sự gấp đôi"); // Duplication - PROGMEM Language_Str MSG_IDEX_MODE_SCALED_COPY = _UxGT("Bản sao thu nhỏ"); - PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Toàn quyền điều khiển"); // Full control - PROGMEM Language_Str MSG_IDEX_X_OFFSET = _UxGT("Đầu phun X nhì"); // 2nd nozzle X - PROGMEM Language_Str MSG_IDEX_Y_OFFSET = _UxGT("Đầu phun Y nhì"); - PROGMEM Language_Str MSG_IDEX_Z_OFFSET = _UxGT("Đầu phun Z nhì"); - PROGMEM Language_Str MSG_IDEX_SAVE_OFFSETS = _UxGT("Lưu bù đắp"); // Save offsets - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Tự xây dựng lưới"); // Manually Build Mesh - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Đặt chêm và đo"); // Place shim & measure - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Đo"); // Measure - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Tháo và đo bàn"); // Remove & measure bed - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Chuyển sang tiếp theo"); // moving to next - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Bật UBL"); - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Tắt UBL"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Nhiệt độ bàn"); // Bed Temp - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Nhiệt độ đầu phun"); // Hotend Temp - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Chỉnh sửa lưới"); // Mesh Edit - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Chỉnh sửa lưới tự chọn"); // Edit Custom Mesh - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Chỉnh lưới chính xác"); // Fine tuning mesh - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Chỉnh sửa xong lưới"); // Done Editing Mesh - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Xây dựng lưới tự chọn"); // Build Custom Mesh - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Xây dựng lưới"); // Build Mesh - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Xây dựng lưới (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Xây dựng lưới (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Xây dựng lưới lạnh"); // Build cold mesh - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Điều chỉnh chiều cao lưới"); // Adjust Mesh Height - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Số lượng chiều cao"); // Height Amount - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Thẩm tra lưới"); // Validate Mesh - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Thẩm tra lưới (") PREHEAT_1_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Thẩm tra lưới (") PREHEAT_2_LABEL _UxGT(")"); - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Thẩm tra lưới tự chọn"); // validate custom mesh - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Tiếp tục xây lưới bàn"); // Continue Bed Mesh - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Đang san lấp lưới"); // Mesh Leveling - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Đang san lấp 3-điểm"); // 3-Point Leveling - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Đang san lấp lưới phẳng"); // Grid (planar) Mesh Leveling - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Làm bằng lưới"); // Level Mesh - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Điểm bên cạnh"); // Side Points - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Loại bản đồ"); // Map Type - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Đầu ra bản đồ lưới"); // Output Mesh Map - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Đầu ra cho máy chủ"); // Output for Host - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Đầu ra cho CSV"); // Output for CSV - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Hỗ trợ lưới"); // Off Printer Backup | backup mesh - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Đầu ra thông tin UBL"); // Output UBL Info - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Chỉnh sửa lưới"); // Edit mesh - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Số lượng lấp đầy"); // Fill-in Amount - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Tự lấp đầy"); // Manual Fill-in - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Lấp đầy thông minh"); // Smart Fill-in - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Lưới lấp đầy"); // Fill-in Mesh - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Bác bỏ tất cả"); // Invalidate All - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Bác bỏ gần nhất"); // Invalidate Closest - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Chỉnh chính xác tất cả"); // Fine Tune ALl - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Chỉnh chính xác gần nhất"); // Fine Tune Closest - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Lưu trữ lưới"); // Mesh Storage - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Khe nhớ"); // Memory Slot - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Tải lưới bàn"); // Load Bed Mesh - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Lưu lưới bàn"); // Save Bed Mesh - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 %i lưới được nạp"); // Mesh %i loaded - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 %i lưới đã lưu"); - PROGMEM Language_Str MSG_NO_STORAGE = _UxGT("Không lưu trữ"); // No Storage - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Điều sai: Lưu UBL"); // Err: UBL Save - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Điều Sai: Khôi Phục UBL"); // Err: UBL Restore - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Đầu Dò-Z Đã Ngừng"); // Z-Offset Stopped - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Bước-Từng-Bước UBL"); // Step-By-Step UBL - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Xây dựng lưới lạnh"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Lấp đầy thông minh"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Thẩm tra lưới"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Chỉnh chính xác tất cả"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Thẩm tra lưới"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Chỉnh chính xác tất cả"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Lưu lưới bàn"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Điều khiển LED"); // LED Control - PROGMEM Language_Str MSG_LEDS = _UxGT("Đèn"); // Lights - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Đèn định sẵn"); // Light Presets - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Đỏ"); // Red - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Cam"); // Orange - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Vàng"); // Yellow - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Xanh Lá"); // Green - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Xanh"); // Blue - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Xanh Đậm"); // Indigo - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Tím"); // Violet - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Trắng"); // White - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Mặc định"); // Default - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Đèn Tự Chọn"); // Custom Lights - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Cường Độ Đỏ"); // Red Intensity - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Cường Độ Xanh Lá"); // Green Intensity - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Cường Độ Xanh"); // Blue Intensity - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Cường Độ Trắng"); // White Intensity - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("độ sáng"); // Brightness - - PROGMEM Language_Str MSG_MOVING = _UxGT("Di chuyển..."); // Moving - PROGMEM Language_Str MSG_FREE_XY = _UxGT("Giải phóng XY"); // Free XY - PROGMEM Language_Str MSG_MOVE_X = _UxGT("Di chuyển X"); // Move X - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Di chuyển Y"); - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Di chuyển Z"); - PROGMEM Language_Str MSG_MOVE_E = _UxGT("Máy đùn"); // Extruder - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Máy đùn *"); // Extruder - PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Đầu nóng quá lạnh"); // Hotend too cold - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Di chuyển 0.1mm"); // Move 0.1mm - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Di chuyển 1mm"); // Move 1mm - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Di chuyển 10mm"); // Move 10mm - PROGMEM Language_Str MSG_SPEED = _UxGT("Tốc độ"); // Speed - PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Bàn"); - PROGMEM Language_Str MSG_NOZZLE = _UxGT("Đầu phun"); // Nozzle - PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Đầu phun ~"); // Nozzle - PROGMEM Language_Str MSG_BED = _UxGT("Bàn"); // bed - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tốc độ quạt"); // fan speed - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tốc độ quạt ="); // fan speed - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Tốc độ quạt phụ"); // Extra fan speed - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Tốc độ quạt phụ ="); // Extra fan speed - PROGMEM Language_Str MSG_FLOW = _UxGT("Lưu Lượng"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("Lưu Lượng ~"); - PROGMEM Language_Str MSG_CONTROL = _UxGT("Điều khiển"); // Control - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Đa"); // min - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Thiểu"); - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Hệ Số"); // factor - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Nhiệt độ tự động"); // Autotemp - PROGMEM Language_Str MSG_LCD_ON = _UxGT("Bật"); // on - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Tắt"); // off - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("Lựa"); // Select - PROGMEM Language_Str MSG_SELECT_E = _UxGT("Lựa *"); - PROGMEM Language_Str MSG_ACC = _UxGT("Tăng Tốc"); - PROGMEM Language_Str MSG_JERK = _UxGT("Giật"); - PROGMEM Language_Str MSG_VA_JERK = _UxGT("Giật-V") LCD_STR_A; - PROGMEM Language_Str MSG_VB_JERK = _UxGT("Giật-V") LCD_STR_B; - PROGMEM Language_Str MSG_VC_JERK = _UxGT("Giật-V") LCD_STR_C; - PROGMEM Language_Str MSG_VE_JERK = _UxGT("Giật-Ve"); - PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Độ Lệch Chỗ Giao"); // Junction Dev - PROGMEM Language_Str MSG_VELOCITY = _UxGT("Vận tốc"); // velocity - PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vđa") LCD_STR_A; // Vmax - PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vđa") LCD_STR_B; // Vmax - PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vđa") LCD_STR_C; // Vmax - PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vđa") LCD_STR_E; // Vmax - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vđa *"); // Vmax - PROGMEM Language_Str MSG_VMIN = _UxGT("Vthiểu"); // Vmin - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vchuyển thiểu"); // VTrav min - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Sự tăng tốc"); // Acceleration - PROGMEM Language_Str MSG_AMAX_A = _UxGT("Tăng tốc ca") LCD_STR_A; // Amax - PROGMEM Language_Str MSG_AMAX_B = _UxGT("Tăng tốc ca") LCD_STR_B; // Amax - PROGMEM Language_Str MSG_AMAX_C = _UxGT("Tăng tốc ca") LCD_STR_C; // Amax - PROGMEM Language_Str MSG_AMAX_E = _UxGT("Tăng tốc ca") LCD_STR_E; // Amax - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Tăng tốc ca *"); // Amax - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("TT-Rút"); // A-retract - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("TT-Chuyển"); // A-travel - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bước/mm"); // Steps - PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bước") LCD_STR_A _UxGT("/mm"); // Asteps/mm - PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bước") LCD_STR_B _UxGT("/mm"); - PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bước") LCD_STR_C _UxGT("/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("BướcE/mm"); - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bước */mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Nhiệt độ"); // Temperature - PROGMEM Language_Str MSG_MOTION = _UxGT("Chuyển động"); // Motion - PROGMEM Language_Str MSG_FILAMENT = _UxGT("Vật liệu in"); // dây nhựa - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E bằng mm³"); // E in mm - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Đường kính nhựa"); // Fil. Dai. - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Đường kính nhựa *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Dỡ mm"); // unload mm - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Nạp mm"); - PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Cấp Cao"); // Advance K - PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Cấp Cao *"); // Advance K - PROGMEM Language_Str MSG_CONTRAST = _UxGT("Độ tương phản LCD"); // LCD contrast - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Lưu các thiết lập"); // Store settings - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Tải các cài đặt"); // Load settings - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Khôi phục phòng hư"); // Restore failsafe - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Khởi Tạo EEPROM"); // Initialize EEPROM - PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Cập Nhật phương tiện"); // Update media - PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Bặt Lại Máy In"); - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Cập Nhật"); // Refresh - PROGMEM Language_Str MSG_WATCH = _UxGT("Màn Hình Thông Tin"); // Info screen - PROGMEM Language_Str MSG_PREPARE = _UxGT("Chuẩn bị"); // Prepare - PROGMEM Language_Str MSG_TUNE = _UxGT("Điều Chỉnh"); // Tune - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Tạm dừng in"); // Pause print - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Tiếp tục in"); // Resume print - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Ngừng in"); // Stop print - PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Phục Hồi Mất Điện"); // Outage Recovery - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("In từ phương tiện"); // Print from media - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Không có phương tiện"); // No media - PROGMEM Language_Str MSG_DWELL = _UxGT("Ngủ..."); // Sleep - PROGMEM Language_Str MSG_USERWAIT = _UxGT("Nhấn để tiếp tục..."); // Click to resume (same as 'continue') - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("In tạm dừng"); // print paused - PROGMEM Language_Str MSG_PRINTING = _UxGT("Đang in..."); // printing - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("In đã hủy bỏ"); // Print aborted - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Không di chuyển."); // No move. - PROGMEM Language_Str MSG_KILLED = _UxGT("ĐÃ CHẾT. "); - PROGMEM Language_Str MSG_STOPPED = _UxGT("ĐÃ NGỪNG. "); - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rút mm"); // Retract mm - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Rút Trao.mm"); // Swap Re.mm - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Rút V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Nhảy mm"); // hop - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("BỏRút mm"); // UnRet mm - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("BỏRút T mm"); // S UnRet mm - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("BỏRút V"); // UnRet V - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("BỏRút T V"); // S UnRet V - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("RútTựĐộng"); // AutoRetr. - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Khoảng Cách Rút"); // Retract Distance - PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Thay Đổi Công Cụ"); // Tool Change - PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Đưa Lên Z"); // Z Raise - PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Tốc Độ Tuôn Ra"); // Prime Speed - PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Tốc Độ Rút Lại"); // Retract Speed - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Thay dây nhựa"); // change filament - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Thay dây nhựa *"); // change filament - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Nạp dây nhựa"); // load filament - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Nạp dây nhựa *"); // load filament - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Dỡ dây nhựa"); // unload filament - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Dỡ dây nhựa *"); // unload filament - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Dỡ tất cả"); // Unload All - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Khởi tạo phương tiện"); // Init. media - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Thay phương tiện"); // Change midea - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Phát hành phương tiện"); - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Đầu Dò Z qua bàn"); // Z Probe past bed - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Hệ số nghiêng"); // Skew Factor - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTOUCH"); // BLTouch - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Tự kiểm tra BLTOUCH "); // BLTouch Self-Test - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Bặt lại BLTouch"); // Reset BLTouch - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Đem BLTouch"); // Deploy BLTouch - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cất BLTouch"); // Stow BLTouch - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Đem Đầu Dò-Z"); // Deploy Z-Probe - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Cất Đầu Dò-Z"); // Stow Z-Probe - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Về nhà %s%s%s Trước"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Đầu Dò Bù Đắp Z"); // Probe Z Offset - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Nhít Y"); - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Nhít Z"); - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Hủy bỏ công tắc"); // Endstop abort - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Sưởi đầu phun không thành công"); // Heating failed - PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Sưởi bàn không thành công"); // Bed heating failed - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Điều sai: nhiệt độ dư"); // Err: REDUNDANT TEMP - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Vấn đề nhiệt"); // THERMAL RUNAWAY | problem - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("Vấn đề nhiệt bàn"); // BED THERMAL RUNAWAY - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Điều sai: nhiệt độ tối đa"); // Err: MAXTEMP - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Điều sai: nhiệt độ tối thiểu"); // Err: MINTEMP - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Điều sai: nhiệt độ bàn tối đa"); // Err: MAXTEMP BED - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Điều sai: nhiệt độ bàn tối thiểu"); // Err: MINTEMP BED - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Về nhà XY Trước"); // Home XY First - PROGMEM Language_Str MSG_HALTED = _UxGT("MÁY IN ĐÃ DỪNG LẠI"); // PRINTER HALTED - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Xin bặt lại"); // Please reset - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("n"); // d - ngày - One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("g"); // h - giờ - One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("p"); // m - phút - One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("Đang sưởi nóng..."); // heating - PROGMEM Language_Str MSG_COOLING = _UxGT("Đang làm nguội..."); // cooling - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Đang sưởi nong bàn..."); // bed heating - PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Đang làm nguội bàn..."); // bed cooling - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Cân Chỉnh Delta"); // Delta calibration - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Chỉnh X lại"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Chỉnh Y lại"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Chỉnh Z lại"); - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Chỉnh Z Center"); // Calibrate Center - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Cài Đặt Delta"); // Delta Settings - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Cân Chỉnh Tự Động"); // Auto Calibration - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Đặt Chiều Cao Delta"); // Set Delta Height - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Đầu Dò Z-Bù Đắp"); // Probe Z-offset - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Gậy Chéo"); // Diag Rod - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Chiều Cao"); // Height - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Bán Kính"); // Radius - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Về Máy In"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Thông Tin Máy In"); // Printer Info - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("San lấp 3-Điểm"); // 3-Point Leveling - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("San Lấp Tuyến Tính"); // Linear Leveling - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("San Lấp Song Tuyến"); // Bilinear Leveling - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("San Lấp Bàn Thống Nhất"); // Unified Bed Leveling - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Lưới San Lấp"); // Mesh Leveling - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Thống Kê Máy In"); // Printer Stats - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Thông Tin Bo Mạch"); // Board Info - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Điện Trở Nhiệt"); // Thermistors - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Máy đùn"); // Extruders - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); // Baud - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Giao Thức"); // Protocol - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Đèn Khuông"); // Case light - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Độ Sáng"); // Light Brightness - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Số In"); // Print Count - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Đã hoàn thành"); - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tổng số thời gian in"); // Total print time - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Thời gian việc lâu nhất"); // Longest job time - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Tổng số đùn"); // Extruded total - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("In"); // prints - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Đã hoàn thành"); // Completed - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tổng số"); // total - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Dài nhất"); // Longest - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Đã ép đùn"); - #endif - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Nhiệt độ tối thiểu"); // Min Temp - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Nhiệt độ tối đa"); // Max temp - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Bộ nguồn"); // PSU - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Sức mạnh ổ đĩa"); // Drive Strength - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("% trình điều khiển"); // Driver % - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Ghi DAC EEPROM"); // DAC EEPROM Write - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("In tạm dừng"); // PRINT PAUSED - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("Nạp dây nhựa"); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("Dỡ dây nhựa"); // unload filament - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Tùy chọn hồi phục:"); // RESUME OPTIONS - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Xả thêm"); // Purge more - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Tiếp tục"); // continue - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Đầu Phun: "); // Nozzle - PROGMEM Language_Str MSG_RUNOUT_SENSOR_ENABLE = _UxGT("Cảm Biến Hết"); // Runout Sensor - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Sự nhà không thành công"); // Homing failed - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT(" không thành công"); // Probing failed - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Quá lạnh"); - - // - // Filament Change screens show up to 3 lines on a 4-line display - // ...or up to 2 lines on a 3-line display - // - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Nhấn nút", "để tiếp tục in")); // Press button to resume print - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Chờ cho sự", "thay đổi dây nhựa", "bắt đầu")); // wait for filament change to start - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Đút dây nhựa vào", "và nhấn nút", "để tiếp tục")); // insert filament and press button to continue // - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Nhấn nút", "để làm nóng đầu phun")); // Press button to heat nozzle - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Đầu phun đang nóng lên", "Xin chờ...")); // Nozzle heating Please wait - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Chờ tro", "dây nhựa ra")); // Wait for filament unload - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Chờ tro", "dây nhựa vào")); // Wait for filament load - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Chờ tro", "xả dây nhựa")); // wait for filament purge - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Nhấn nút để kết thúc", "xả dây nhựa")); // Click to finish dây nhựa purge - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Chờ tro in", "tiếp tục...")); // Wait for print to resume - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Nhấn nút để tiếp tục")); // Click to continue - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Xin chờ...")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Chèn và nhấn")); // Insert and Click - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Nhấn để sưởi")); // Click to heat - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Đang sưởi nóng")); // Heating - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Đang dỡ ra...")); // Ejecting - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Đang nạp...")); // Loading - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Đang xả...")); // Purging - PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Nhấn nút để kết thúc")); // Click to finish - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Đang tiếp tục...")); // Resuming - #endif // LCD_HEIGHT < 4 - - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Trình điều khiển TMC"); // TMC drivers - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Dòng điện trình điều khiển"); // Driver current - PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Ngưỡng Hỗn Hợp"); // Hybrid threshold - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Vô cảm biến"); // Sensorless homing - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Chế độ từng bước"); // Stepping mode - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("CắtTàngHình được kích hoạt"); // StealthChop enabled -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_CN.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_CN.h deleted file mode 100644 index e17d473a9e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_CN.h +++ /dev/null @@ -1,393 +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 - -/** - * Simplified Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_zh_CN { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 3; - PROGMEM Language_Str LANGUAGE = _UxGT("Simplified Chinese"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就绪."); //" ready." - PROGMEM Language_Str MSG_BACK = _UxGT("返回"); // ”Back“ - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("存储卡已插入"); //"Card inserted" - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("存储卡被拔出"); //"Card removed" - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("挡块"); //"Endstops" // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("主菜单"); //"Main" - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自动开始"); //"Autostart" - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("关闭步进电机"); //"Disable steppers" - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("调试菜单"); // "Debug Menu" - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("进度条测试"); // "Progress Bar Test" - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("回原点"); //"Auto home" - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("回X原位"); //"Home X" - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("回Y原位"); //"Home Y" - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("回Z原位"); //"Home Z" - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("平台调平XYZ归原位"); //"Homing XYZ" - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("单击开始热床调平"); //"Click to Begin" - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("下个热床调平点"); //"Next Point" - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("完成热床调平"); //"Leveling Done!" - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("设置原点偏移"); //"Set home offsets" - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已启用"); //"Offsets applied" - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("设置原点"); //"Set origin" - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("预热 ") PREHEAT_1_LABEL; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("预热 ") PREHEAT_1_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 喷嘴"); //MSG_PREHEAT_1 " " - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 喷嘴 ~"); //MSG_PREHEAT_1 " " - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 全部"); //MSG_PREHEAT_1 " All" - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 热床"); //MSG_PREHEAT_1 " Bed" - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 设置"); //MSG_PREHEAT_1 " conf" - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("预热 ") PREHEAT_2_LABEL; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("预热 ") PREHEAT_2_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 喷嘴"); //MSG_PREHEAT_2 " " - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 喷嘴 ~"); //MSG_PREHEAT_2 " " - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 全部"); //MSG_PREHEAT_2 " All" - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 热床"); //MSG_PREHEAT_2 " Bed" - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 设置"); //MSG_PREHEAT_2 " conf" - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降温"); //"Cooldown" - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("电源打开"); //"Switch power on" - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("电源关闭"); //"Switch power off" - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("挤出"); //"Extrude" - PROGMEM Language_Str MSG_RETRACT = _UxGT("回抽"); //"Retract" - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("移动轴"); //"Move axis" - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("调平热床"); //"Bed leveling" - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("调平热床"); //"Level bed" - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("调平边角"); // "Level corners" - - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("下个边角"); // "Next corner" - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("编辑网格"); // "Edit Mesh" - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("网格编辑已停止"); // "Mesh Editing Stopped" - PROGMEM Language_Str MSG_USER_MENU = _UxGT("定制命令"); // "Custom Commands" - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("执行G29"); // "Doing G29" - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools" - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("统一热床调平(UBL)"); // "Unified Bed Leveling" - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("手工创设网格"); // "Manually Build Mesh" - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("放置垫片并测量"); // "Place shim & measure" - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("测量"); // "Measure" - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("移除并测量热床"); // "Remove & measure bed" - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("移动到下一个"); // "Moving to next" - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("激活UBL"); // "Activate UBL" - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("关闭UBL"); // "Deactivate UBL" - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("设置热床温度"); // "Bed Temp" - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("热端温度"); // "Hotend Temp" - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("网格编辑"); // "Mesh Edit" - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("编辑客户网格"); // "Edit Custom Mesh" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("细调网格"); // "Fine Tuning Mesh" - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("完成编辑网格"); // "Done Editing Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("创设客户网格"); // "Build Custom Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("创设网格"); // "Build Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("创设 ") PREHEAT_1_LABEL _UxGT(" 网格"); // "Build PREHEAT_1_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("创设 ") PREHEAT_2_LABEL _UxGT(" 网格"); // "Build PREHEAT_2_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("创设冷网格"); // "Build Cold Mesh" - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("调整网格高度"); // "Adjust Mesh Height" - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("高度合计"); // "Height Amount" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("批准网格"); // "Validate Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("批准 ") PREHEAT_1_LABEL _UxGT(" 网格"); // "Validate PREHEAT_1_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("批准 ") PREHEAT_2_LABEL _UxGT(" 网格"); // "Validate PREHEAT_2_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("批准客户网格"); // "Validate Custom Mesh" - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("继续热床网格"); // "Continue Bed Mesh" - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("网格调平"); // "Mesh Leveling" - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("三点调平"); // "3-Point Leveling" - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("格子网格调平"); // "Grid Mesh Leveling" - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("调平网格"); // "Level Mesh" - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("边点"); // "Side Points" - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("图类型"); // "Map Type" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("输出网格图"); // "Output Mesh Map" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("输出到主机"); // "Output for Host" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("输出到CSV"); // "Output for CSV" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("输出到备份"); // "Off Printer Backup" - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("输出UBL信息"); // "Output UBL Info" - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("填充合计"); // "Fill-in Amount" - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("手工填充"); // "Manual Fill-in" - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("聪明填充"); // "Smart Fill-in" - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("填充网格"); // "Fill-in Mesh" - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("作废所有的"); // "Invalidate All" - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("作废最近的"); // "Invalidate Closest" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("细调所有的"); // "Fine Tune All" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("细调最近的"); // "Fine Tune Closest" - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("网格存储"); // "Mesh Storage" - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("存储槽"); // "Memory Slot" - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("装载热床网格"); // "Load Bed Mesh" - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("保存热床网格"); // "Save Bed Mesh" - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 网格 %i 已装载"); // "Mesh %i loaded" - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 网格 %i 已保存"); // "Mesh %i saved" - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("没有存储"); // "No storage" - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("错误: UBL保存"); // "Err: UBL Save" - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("错误: UBL还原"); // "Err: UBL Restore" - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z偏移已停止"); // "Z-Offset Stopped" - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("一步步UBL"); // "Step-By-Step UBL" - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. 创设冷网格"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. 聪明填充"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. 批准网格"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. 细调所有的"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. 批准网格"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. 细调所有的"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. 保存热床网格"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("灯管控制"); // "LED Control") - PROGMEM Language_Str MSG_LEDS = _UxGT("灯"); // "Lights") - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("灯预置"); // "Light Presets") - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("红"); // "Red") - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("橙"); // "Orange") - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("黄"); // "Yellow") - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("绿"); // "Green") - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("蓝"); // "Blue") - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("青"); // "Indigo") - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("紫"); // "Violet") - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("白"); // "White") - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("缺省"); // "Default") - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("定制灯"); // "Custom Lights") - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("红饱和度"); // "Red Intensity") - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("绿饱和度"); // "Green Intensity") - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("蓝饱和度"); // "Blue Intensity") - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("白饱和度"); // "White Intensity") - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("亮度"); // "Brightness") - - PROGMEM Language_Str MSG_MOVING = _UxGT("移动 ..."); // "Moving...") - PROGMEM Language_Str MSG_FREE_XY = _UxGT("释放 XY"); // "Free XY") - PROGMEM Language_Str MSG_MOVE_X = _UxGT("移动X"); //"Move X" - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("移动Y"); //"Move Y" - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("移动Z"); //"Move Z" - PROGMEM Language_Str MSG_MOVE_E = _UxGT("挤出机"); //"Extruder" - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("挤出机 *"); //"Extruder" - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移动 %s mm"); //"Move 0.025mm" - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移动 0.1 mm"); //"Move 0.1mm" - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移动 1 mm"); //"Move 1mm" - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移动 10 mm"); //"Move 10mm" - PROGMEM Language_Str MSG_SPEED = _UxGT("速率"); //"Speed" - PROGMEM Language_Str MSG_BED_Z = _UxGT("热床Z"); //"Bed Z" - PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 喷嘴"); //"Nozzle" 噴嘴 - PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 喷嘴 ~"); //"Nozzle" 噴嘴 - PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 热床"); //"Bed" - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("风扇速率"); //"Fan speed" - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("风扇速率 ="); //"Fan speed" - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("额外风扇速率"); // "Extra fan speed" - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("额外风扇速率 ="); // "Extra fan speed" - PROGMEM Language_Str MSG_FLOW = _UxGT("挤出速率"); //"Flow" - PROGMEM Language_Str MSG_FLOW_N = _UxGT("挤出速率 ~"); //"Flow" - PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" 最小"); //" " LCD_STR_THERMOMETER " Min" - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" 最大"); //" " LCD_STR_THERMOMETER " Max" - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" 因数"); //" " LCD_STR_THERMOMETER " Fact" - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自动控温"); //"Autotemp" - PROGMEM Language_Str MSG_LCD_ON = _UxGT("开"); //"On" - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("关"); //"Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("选择"); //"Select" - PROGMEM Language_Str MSG_SELECT_E = _UxGT("选择 *"); - PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration - PROGMEM Language_Str MSG_JERK = _UxGT("抖动速率"); // "Jerk" - PROGMEM Language_Str MSG_VA_JERK = _UxGT("轴抖动速率") LCD_STR_A; //"Va-jerk" - PROGMEM Language_Str MSG_VB_JERK = _UxGT("轴抖动速率") LCD_STR_B; //"Vb-jerk" - PROGMEM Language_Str MSG_VC_JERK = _UxGT("轴抖动速率") LCD_STR_C; //"Vc-jerk" - PROGMEM Language_Str MSG_VE_JERK = _UxGT("挤出机抖动速率"); //"Ve-jerk" - PROGMEM Language_Str MSG_VELOCITY = _UxGT("速度"); // "Velocity" - PROGMEM Language_Str MSG_VMAX_A = _UxGT("最大进料速率") LCD_STR_A; //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMAX_B = _UxGT("最大进料速率") LCD_STR_B; //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMAX_C = _UxGT("最大进料速率") LCD_STR_C; //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMAX_E = _UxGT("最大进料速率") LCD_STR_E; //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("最大进料速率 *"); //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMIN = _UxGT("最小进料速率"); //"Vmin" min_feedrate_mm_s - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("最小移动速率"); //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("加速度"); // "Acceleration" - PROGMEM Language_Str MSG_AMAX_A = _UxGT("最大打印加速度") LCD_STR_A; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_AMAX_B = _UxGT("最大打印加速度") LCD_STR_B; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_AMAX_C = _UxGT("最大打印加速度") LCD_STR_C; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_AMAX_E = _UxGT("最大打印加速度") LCD_STR_E; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("最大打印加速度 *"); //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("收进加速度"); //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("非打印移动加速度"); //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("轴步数/mm"); //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("轴步数/mm"); //"Asteps/mm" - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("轴步数/mm"); //"Bsteps/mm" - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("轴步数/mm"); //"Csteps/mm" - PROGMEM Language_Str MSG_E_STEPS = _UxGT("挤出机步数/mm"); //"Esteps/mm" - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("挤出机~步数/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("温度"); //"Temperature" - PROGMEM Language_Str MSG_MOTION = _UxGT("运动"); //"Motion" - PROGMEM Language_Str MSG_FILAMENT = _UxGT("丝料测容"); //"Filament" menu_advanced_filament - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("测容积mm³"); //"E in mm3" volumetric_enabled - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("丝料直径"); //"Fil. Dia." - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("丝料直径 *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("卸载 mm"); // "Unload mm" - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("装载 mm"); // "Load mm" - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD对比度"); //"LCD contrast" - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存设置"); //"Store memory" - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("装载设置"); //"Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢复安全值"); //"Restore failsafe" - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化设置"); // "Initialize EEPROM" - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" - PROGMEM Language_Str MSG_WATCH = _UxGT("信息屏"); //"Info screen" - PROGMEM Language_Str MSG_PREPARE = _UxGT("准备"); //"Prepare" - PROGMEM Language_Str MSG_TUNE = _UxGT("调整"); //"Tune" - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("暂停打印"); //"Pause print" - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("恢复打印"); //"Resume print" - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("停止打印"); //"Stop print" - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("从存储卡上打印"); //"Print from SD" - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("无存储卡"); //"No SD card" - PROGMEM Language_Str MSG_DWELL = _UxGT("休眠中 ..."); //"Sleep..." - PROGMEM Language_Str MSG_USERWAIT = _UxGT("点击继续 ..."); //"Click to resume..." - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("暫停打印"); // "Print paused" - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("已取消打印"); //"Print aborted" - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("无移动"); //"No move." - PROGMEM Language_Str MSG_KILLED = _UxGT("已杀掉"); //"KILLED. " - PROGMEM Language_Str MSG_STOPPED = _UxGT("已停止"); //"STOPPED. " - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("回抽长度mm"); //"Retract mm" retract_length, retract length (positive mm) - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("换手回抽长度mm"); //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("回抽速率mm/s"); //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); //"Hop mm" retract_zraise, retract Z-lift - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("回抽恢复长度mm"); //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("换手回抽恢复长度mm"); //"S UnRet+mm" swap_retract_recover_extra, additional swap recover length (mm, added to retract length when recovering from extruder change) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("回抽恢复后进料速率mm/s"); //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); // "S UnRet V" - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("自动抽回"); //"AutoRetr." autoretract_enabled, - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("更换丝料"); //"Change filament" - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("更换丝料 *"); //"Change filament" - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("装载丝料"); // "Load filament" - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("装载丝料 *"); // "Load filament" - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("卸载丝料"); // "Unload filament" - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("卸载丝料 *"); // "Unload filament" - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("卸载全部"); // "Unload All" - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("初始化存储卡"); //"Init. SD card" - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("更换存储卡"); //"Change SD card" - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z探针在热床之外"); //"Z probe out. bed" Z probe is not within the physical limits - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("偏斜因数"); // "Skew Factor" - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); // "BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch 自检"); // "BLTouch Self-Test" - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("重置BLTouch"); // "Reset BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("装载BLTouch"); // "Stow BLTouch" - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("归位 %s%s%s 先"); //"Home ... first" - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z偏移"); //"Z Offset" - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("微量调整X轴"); //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("微量调整Y轴"); //"Babystep Y" - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("微量调整Z轴"); //"Babystep Z" - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("挡块终止"); //"Endstop abort" - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("加热失败"); //"Heating failed" - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("错误:REDUNDANT TEMP"); //"Err: REDUNDANT TEMP" - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("温控失控"); //"THERMAL RUNAWAY" - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("错误:最高温度"); //"Err: MAXTEMP" - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("错误:最低温度"); //"Err: MINTEMP" - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("错误:最高热床温度"); //"Err: MAXTEMP BED" - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("错误:最低热床温度"); //"Err: MINTEMP BED" - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("归位 XY 先"); // "Home XY First" - PROGMEM Language_Str MSG_HALTED = _UxGT("打印停机"); //"PRINTER HALTED" - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("请重置"); //"Please reset" - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("天"); //"d" // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("时"); //"h" // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("分"); //"m" // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("加热中 ..."); //"Heating..." - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("加热热床中 ..."); //"Bed Heating..." - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("⊿校准"); //"Delta Calibration" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("⊿校准X"); //"Calibrate X" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("⊿校准Y"); //"Calibrate Y" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("⊿校准Z"); //"Calibrate Z" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校准中心"); //"Calibrate Center" - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("⊿设置"); // "Delta Settings" - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自动校准"); // "Auto Calibration" - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("设置⊿高度"); // "Set Delta Height" - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("⊿半径"); // "Radius" - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("关于打印机"); //"About Printer" - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("打印机信息"); //"Printer Info" - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("三点调平"); // "3-Point Leveling" - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("线性调平"); // "Linear Leveling" - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("双线性调平"); // "Bilinear Leveling" - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("统一热床调平(UBL)"); // "Unified Bed Leveling" - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("网格调平"); // "Mesh Leveling" - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("打印机统计"); //"Printer Stats" - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("主板信息"); //"Board Info" - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("温度计"); //"Thermistors" - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("挤出机"); //"Extruders" - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("波特率"); //"Baud" - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("协议"); //"Protocol" - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("外壳灯"); // "Case light" - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("灯亮度"); // "Light BRIGHTNESS" - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("打印机不正确"); // "The printer is incorrect" - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("打印计数"); //"Print Count" - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成了"); //"Completed" - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("总打印时间"); //"Total print time" - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最长工作时间"); //"Longest job time" - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("总计挤出"); //"Extruded total" - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("打印数"); //"Prints" - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成"); //"Completed" - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("总共"); //"Total" - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最长"); //"Longest" - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("已挤出"); //"Extruded" - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("最低温度"); //"Min Temp" - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("最高温度"); //"Max Temp" - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("电源供应"); //"Power Supply" - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("驱动力度"); // "Drive Strength" - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("驱动 %"); // "Driver %" - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("保存驱动设置"); // "DAC EEPROM Write" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("打印已暂停"); // "PRINT PAUSED" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("装载丝料"); // "LOAD FILAMENT" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("卸载丝料"); // "UNLOAD FILAMENT" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("恢复选项:"); // "RESUME OPTIONS:" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("清除更多"); // "Purge more" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("恢复打印"); //"Resume print" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" 喷嘴: "); // " Nozzle: " - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("归原位失败"); // "Homing failed" - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("探针探测失败"); // "Probing failed" - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: 太凉"); // "M600: Too cold" - - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("等待开始", "丝料", "变更")); // "Wait for start of the filament change" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("等待", "卸下丝料")); // "Wait for filament unload" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("插入丝料", "并按键", "来继续 ...")); // "Insert filament and press button to continue..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("按下按钮来", "加热喷嘴.")); // "Press button to heat nozzle." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("加热喷嘴", "请等待 ...")); // "Heating nozzle Please wait..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("等待", "进料")); // "Wait for filament load" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("等待", "丝料清除")); // "Wait for filament purge" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("等待打印", "恢复")); // "Wait for print to resume" - #else - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("请等待 ...")); //"Please wait..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("退出中 ...")); //"Ejecting..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("插入并单击")); //"Insert and Click" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("加热中 ...")); // "Heating..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("装载中 ...")); //"Loading..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("清除中 ...")); // "Purging..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("恢复中 ...")); //"Resuming..." - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_TW.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_TW.h deleted file mode 100644 index 1042f841e9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/language/language_zh_TW.h +++ /dev/null @@ -1,393 +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 - -/** - * Traditional Chinese - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ -namespace Language_zh_TW { - using namespace Language_en; // Inherit undefined strings from English - - constexpr uint8_t CHARSIZE = 3; - PROGMEM Language_Str LANGUAGE = _UxGT("Traditional Chinese"); - - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就緒."); //" ready." - PROGMEM Language_Str MSG_BACK = _UxGT("返回"); // ”Back“ - PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("記憶卡已插入"); //"Card inserted" - PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("記憶卡被拔出"); //"Card removed" - PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("擋塊"); //"Endstops" // Max length 8 characters - PROGMEM Language_Str MSG_MAIN = _UxGT("主選單"); //"Main" - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自動開始"); //"Autostart" - PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("關閉步進馬達"); //"Disable steppers" - PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("除錯選單"); // "Debug Menu" - PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("進度條測試"); // "Progress Bar Test" - PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("自動回原點"); //"Auto home" - PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("回X原點"); //"Home X" - PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("回Y原點"); //"Home Y" - PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("回Z原點"); //"Home Z" - PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("平台調平XYZ歸原點"); //"Homing XYZ" - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("單擊開始熱床調平"); //"Click to Begin" - PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("下個熱床調平點"); //"Next Point" - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("完成熱床調平"); //"Leveling Done!" - PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("設置原點偏移"); //"Set home offsets" - PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已啟用"); //"Offsets applied" - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("設置原點"); //"Set origin" - PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("預熱 ") PREHEAT_1_LABEL; //"Preheat PREHEAT_1_LABEL" - PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("預熱 ") PREHEAT_1_LABEL " ~"; //"Preheat PREHEAT_1_LABEL" - PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 噴嘴"); //MSG_PREHEAT_1 " " - PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 噴嘴 ~"); //MSG_PREHEAT_1 " " - PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 全部"); //MSG_PREHEAT_1 " All" - PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 熱床"); //MSG_PREHEAT_1 " Bed" - PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 設置"); //MSG_PREHEAT_1 " conf" - PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("預熱 ") PREHEAT_2_LABEL; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("預熱 ") PREHEAT_2_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" - PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 噴嘴"); //MSG_PREHEAT_2 " " - PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 噴嘴 ~"); //MSG_PREHEAT_2 " " - PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 全部"); //MSG_PREHEAT_2 " All" - PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 熱床"); //MSG_PREHEAT_2 " Bed" - PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 設置"); //MSG_PREHEAT_2 " conf" - PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降溫"); //"Cooldown" - PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("電源打開"); //"Switch power on" - PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("電源關閉"); //"Switch power off" - PROGMEM Language_Str MSG_EXTRUDE = _UxGT("擠出"); //"Extrude" - PROGMEM Language_Str MSG_RETRACT = _UxGT("回縮"); //"Retract" - PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("移動軸"); //"Move axis" - PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("調平熱床"); //"Bed leveling" - PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("調平熱床"); //"Level bed" - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("調平邊角"); // "Level corners" - - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("下個邊角"); // "Next corner" - PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("編輯網格"); // "Edit Mesh" - PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("網格編輯已停止"); // "Mesh Editing Stopped" - PROGMEM Language_Str MSG_USER_MENU = _UxGT("客制命令"); // "Custom Commands" - - PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("執行G29"); // "Doing G29" - PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools" - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("統一熱床調平(UBL)"); // "Unified Bed Leveling" - PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("手工建網"); // "Manually Build Mesh" - PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("放置墊片並測量"); // "Place shim & measure" - PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("測量"); // "Measure" - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("移除並測量熱床"); // "Remove & measure bed" - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("移動到下一個"); // "Moving to next" - PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("啟動UBL"); // "Activate UBL" - PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("關閉UBL"); // "Deactivate UBL" - PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("設置熱床溫度"); // "Bed Temp" - PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("熱端溫度"); // "Hotend Temp" - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("網格編輯"); // "Mesh Edit" - PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("編輯客戶網格"); // "Edit Custom Mesh" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("細調網格"); // "Fine Tuning Mesh" - PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("完成編輯網格"); // "Done Editing Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("創設客戶網格"); // "Build Custom Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("創設網格"); // "Build Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("創設 ") PREHEAT_1_LABEL _UxGT(" 網格"); // "Build PREHEAT_1_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("創設 ") PREHEAT_2_LABEL _UxGT(" 網格"); // "Build PREHEAT_2_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("創設冷網格"); // "Build Cold Mesh" - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("調整網格高度"); // "Adjust Mesh Height" - PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("高度合計"); // "Height Amount" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("批准網格"); // "Validate Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("批准 ") PREHEAT_1_LABEL _UxGT(" 網格"); // "Validate PREHEAT_1_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("批准 ") PREHEAT_2_LABEL _UxGT(" 網格"); // "Validate PREHEAT_2_LABEL Mesh" - PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("批准客戶網格"); // "Validate Custom Mesh" - PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("繼續熱床網格"); // "Continue Bed Mesh" - PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("網格調平"); // "Mesh Leveling" - PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("三點調平"); // "3-Point Leveling" - PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("格子網格調平"); // "Grid Mesh Leveling" - PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("調平網格"); // "Level Mesh" - PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("邊點"); // "Side Points" - PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("圖類型"); // "Map Type" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("輸出網格圖"); // "Output Mesh Map" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("輸出到主機"); // "Output for Host" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("輸出到CSV"); // "Output for CSV" - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("輸出到備份"); // "Off Printer Backup" - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("輸出UBL信息"); // "Output UBL Info" - PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("填充合計"); // "Fill-in Amount" - PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("手工填充"); // "Manual Fill-in" - PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("聰明填充"); // "Smart Fill-in" - PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("填充網格"); // "Fill-in Mesh" - PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("作廢所有的"); // "Invalidate All" - PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("作廢最近的"); // "Invalidate Closest" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("細調所有的"); // "Fine Tune All" - PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("細調最近的"); // "Fine Tune Closest" - PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("網格存儲"); // "Mesh Storage" - PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("存儲槽"); // "Memory Slot" - PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("裝載熱床網格"); // "Load Bed Mesh" - PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("保存熱床網格"); // "Save Bed Mesh" - PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 網格 %i 已裝載"); // "Mesh %i loaded" - PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 網格 %i 已保存"); // "Mesh %i saved" - PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("沒有存儲"); // "No storage" - PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("錯誤: UBL保存"); // "Err: UBL Save" - PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("錯誤: UBL還原"); // "Err: UBL Restore" - PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z偏移已停止"); // "Z-Offset Stopped" - PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("一步步UBL"); // "Step-By-Step UBL" - PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. 創設冷網格"); - PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. 聰明填充"); - PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. 批准網格"); - PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. 細調所有的"); - PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. 批准網格"); - PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. 細調所有的"); - PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. 保存熱床網格"); - - PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("燈管控制"); // "LED Control") - PROGMEM Language_Str MSG_LEDS = _UxGT("燈"); // "Lights") - PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("燈預置"); // "Light Presets") - PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("红"); // "Red") - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("橙"); // "Orange") - PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("黃"); // "Yellow") - PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("綠"); // "Green") - PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("藍"); // "Blue") - PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("青"); // "Indigo") - PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("紫"); // "Violet") - PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("白"); // "White") - PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("缺省"); // "Default") - PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("定制燈"); // "Custom Lights") - PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("紅飽和度"); // "Red Intensity") - PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("綠飽和度"); // "Green Intensity") - PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("藍飽和度"); // "Blue Intensity") - PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("白飽和度"); // "White Intensity") - PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("亮度"); // "Brightness") - - PROGMEM Language_Str MSG_MOVING = _UxGT("移動 ..."); // "Moving...") - PROGMEM Language_Str MSG_FREE_XY = _UxGT("釋放 XY"); // "Free XY") - PROGMEM Language_Str MSG_MOVE_X = _UxGT("移動X"); //"Move X" - PROGMEM Language_Str MSG_MOVE_Y = _UxGT("移動Y"); //"Move Y" - PROGMEM Language_Str MSG_MOVE_Z = _UxGT("移動Z"); //"Move Z" - PROGMEM Language_Str MSG_MOVE_E = _UxGT("擠出機"); //"Extruder" - PROGMEM Language_Str MSG_MOVE_EN = _UxGT("擠出機 *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移動 %s mm"); //"Move 0.025mm" - PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移動 0.1 mm"); //"Move 0.1mm" - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移動 1 mm"); //"Move 1mm" - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移動 10 mm"); //"Move 10mm" - PROGMEM Language_Str MSG_SPEED = _UxGT("速率"); //"Speed" - PROGMEM Language_Str MSG_BED_Z = _UxGT("熱床Z"); //"Bed Z" - PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴"); //"Nozzle" 噴嘴 - PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴 ~"); - PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 熱床"); //"Bed" - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("風扇速率"); //"Fan speed" - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("風扇速率 ="); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("額外風扇速率"); // "Extra fan speed" - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("額外風扇速率 ="); - PROGMEM Language_Str MSG_FLOW = _UxGT("擠出速率"); - PROGMEM Language_Str MSG_FLOW_N = _UxGT("擠出速率 ~"); //"Flow" - PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" - PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" 最小"); //" " LCD_STR_THERMOMETER " Min" - PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" 最大"); //" " LCD_STR_THERMOMETER " Max" - PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" 系數"); //" " LCD_STR_THERMOMETER " Fact" - PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自動控溫"); //"Autotemp" - PROGMEM Language_Str MSG_LCD_ON = _UxGT("開"); //"On" - PROGMEM Language_Str MSG_LCD_OFF = _UxGT("關"); //"Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_SELECT = _UxGT("選擇"); //"Select" - PROGMEM Language_Str MSG_SELECT_E = _UxGT("選擇 *"); - PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration - PROGMEM Language_Str MSG_JERK = _UxGT("抖動速率"); //"Jerk" - PROGMEM Language_Str MSG_VA_JERK = _UxGT("軸抖動速率") LCD_STR_A; //"Va-jerk" - PROGMEM Language_Str MSG_VB_JERK = _UxGT("軸抖動速率") LCD_STR_B; //"Vb-jerk" - PROGMEM Language_Str MSG_VC_JERK = _UxGT("軸抖動速率") LCD_STR_C; //"Vc-jerk" - PROGMEM Language_Str MSG_VE_JERK = _UxGT("擠出機抖動速率"); //"Ve-jerk" - PROGMEM Language_Str MSG_VELOCITY = _UxGT("速度"); // "Velocity" - PROGMEM Language_Str MSG_VMAX_A = _UxGT("最大進料速率") LCD_STR_A; //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMAX_B = _UxGT("最大進料速率") LCD_STR_B; - PROGMEM Language_Str MSG_VMAX_C = _UxGT("最大進料速率") LCD_STR_C; - PROGMEM Language_Str MSG_VMAX_E = _UxGT("最大進料速率") LCD_STR_E; - PROGMEM Language_Str MSG_VMAX_EN = _UxGT("最大進料速率 *"); //"Vmax " max_feedrate_mm_s - PROGMEM Language_Str MSG_VMIN = _UxGT("最小進料速率"); //"Vmin" min_feedrate_mm_s - PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("最小移動速率"); //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("加速度"); // "Acceleration" - PROGMEM Language_Str MSG_AMAX_A = _UxGT("最大列印加速度") LCD_STR_A; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_AMAX_B = _UxGT("最大列印加速度") LCD_STR_B; - PROGMEM Language_Str MSG_AMAX_C = _UxGT("最大列印加速度") LCD_STR_C; - PROGMEM Language_Str MSG_AMAX_E = _UxGT("最大列印加速度") LCD_STR_E; - PROGMEM Language_Str MSG_AMAX_EN = _UxGT("最大列印加速度 *"); //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves - PROGMEM Language_Str MSG_A_RETRACT = _UxGT("回縮加速度"); //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts - PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("非列印移動加速度"); //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves - PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("軸步數/mm"); //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 - PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("軸步數/mm"); //"Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 - PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("軸步數/mm"); - PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("軸步數/mm"); - PROGMEM Language_Str MSG_E_STEPS = _UxGT("擠出機步數/mm"); //"Esteps/mm" - PROGMEM Language_Str MSG_EN_STEPS = _UxGT("擠出機~步數/mm"); - PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("溫度"); //"Temperature" - PROGMEM Language_Str MSG_MOTION = _UxGT("運作"); //"Motion" - PROGMEM Language_Str MSG_FILAMENT = _UxGT("絲料測容"); //"Filament" menu_control_volumetric - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("測容積mm³"); //"E in mm3" volumetric_enabled - PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("絲料直徑"); //"Fil. Dia." - PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("絲料直徑 *"); - PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("卸載 mm"); // "Unload mm" - PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("装載 mm"); // "Load mm" - PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD對比度"); //"LCD contrast" - PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存設置"); //"Store memory" - PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("載入設置"); //"Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢復安全值"); //"Restore failsafe" - PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化設置"); // "Initialize EEPROM" - PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" - PROGMEM Language_Str MSG_WATCH = _UxGT("資訊界面"); //"Info screen" - PROGMEM Language_Str MSG_PREPARE = _UxGT("準備"); //"Prepare" - PROGMEM Language_Str MSG_TUNE = _UxGT("調整"); //"Tune" - PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("暫停列印"); //"Pause print" - PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("恢復列印"); //"Resume print" - PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("停止列印"); //"Stop print" - PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("從記憶卡上列印"); //"Print from SD" - PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("無記憶卡"); //"No SD card" - PROGMEM Language_Str MSG_DWELL = _UxGT("休眠 ..."); //"Sleep..." - PROGMEM Language_Str MSG_USERWAIT = _UxGT("點擊繼續 ..."); //"Click to resume..." - PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("列印已暫停"); // "Print paused" - PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("已取消列印"); //"Print aborted" - PROGMEM Language_Str MSG_NO_MOVE = _UxGT("無移動"); //"No move." - PROGMEM Language_Str MSG_KILLED = _UxGT("已砍掉"); //"KILLED. " - PROGMEM Language_Str MSG_STOPPED = _UxGT("已停止"); //"STOPPED. " - PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("回縮長度mm"); //"Retract mm" retract_length, retract length (positive mm) - PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("換手回抽長度mm"); //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change - PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("回縮速率mm/s"); //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) - PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); //"Hop mm" retract_zraise, retract Z-lift - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("回縮恢復長度mm"); //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("換手回縮恢復長度mm"); //"S UnRet+mm" swap_retract_recover_extra, additional swap recover length (mm, added to retract length when recovering from extruder change) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("回縮恢復後進料速率mm/s"); //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); // "S UnRet V" - PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("自動回縮"); //"AutoRetr." autoretract_enabled, - PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("更換絲料"); //"Change filament" - PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("更換絲料 *"); - PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("裝載絲料"); // "Load filament" - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("裝載絲料 *"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("卸載絲料"); // "Unload filament" - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("卸載絲料 *"); // "Unload filament" - PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("卸載全部"); // "Unload All" - PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("初始化記憶卡"); //"Init. SD card" - PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("更換記憶卡"); //"Change SD card" - PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z探針在熱床之外"); //"Z probe out. bed" Z probe is not within the physical limits - PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("偏斜因數"); // "Skew Factor" - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); // "BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch 自檢"); // "BLTouch Self-Test" - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("重置BLTouch"); // "Reset BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("裝載BLTouch"); // "Stow BLTouch" - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("歸位 %s%s%s 先"); //"Home ... first" - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z偏移"); //"Z Offset" - PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("微量調整X軸"); //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts - PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("微量調整Y軸"); //"Babystep Y" - PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("微量調整Z軸"); //"Babystep Z" - PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("擋塊終止"); //"Endstop abort" - PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("加熱失敗"); //"Heating failed" - PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("錯誤:REDUNDANT TEMP"); //"Err: REDUNDANT TEMP" - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("溫控失控"); //"THERMAL RUNAWAY" - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("錯誤:最高溫度"); //"Err: MAXTEMP" - PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("錯誤:最低溫度"); //"Err: MINTEMP" - PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("錯誤:最高熱床溫度"); //"Err: MAXTEMP BED" - PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("錯誤:最低熱床溫度"); //"Err: MINTEMP BED" - PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("歸位 XY 先"); //"Home XY First" - PROGMEM Language_Str MSG_HALTED = _UxGT("印表機停機"); //"PRINTER HALTED" - PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("請重置"); //"Please reset" - PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("天"); //"d" // One character only - PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("時"); //"h" // One character only - PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("分"); //"m" // One character only - PROGMEM Language_Str MSG_HEATING = _UxGT("加熱中 ..."); //"Heating..." - PROGMEM Language_Str MSG_BED_HEATING = _UxGT("加熱熱床中 ..."); //"Bed Heating..." - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("⊿校準"); //"Delta Calibration" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("⊿校準X"); //"Calibrate X" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("⊿校準Y"); //"Calibrate Y" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("⊿校準Z"); //"Calibrate Z" - PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校準中心"); //"Calibrate Center" - PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("⊿設置"); // "Delta Settings" - PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自動校準"); // "Auto Calibration" - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("設置⊿高度"); // "Set Delta Height" - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" - PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" - PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("⊿半徑"); // "Radius" - PROGMEM Language_Str MSG_INFO_MENU = _UxGT("關於印表機"); //"About Printer" - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("印表機訊息"); //"Printer Info" - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("三點調平"); // "3-Point Leveling" - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("線性調平"); // "Linear Leveling" - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("雙線性調平"); // "Bilinear Leveling" - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("統一熱床調平(UBL)"); // "Unified Bed Leveling" - PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("網格調平"); // "Mesh Leveling" - PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("印表機統計"); //"Printer Stats" - PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("主板訊息"); //"Board Info" - PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("溫度計"); //"Thermistors" - PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("擠出機"); //"Extruders" - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("傳輸率"); //"Baud" - PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("協議"); //"Protocol" - PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("外殼燈"); // "Case light" - PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("燈亮度"); // "Light BRIGHTNESS" - - PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("打印機不正確"); // "The printer is incorrect" - - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("列印計數"); //"Print Count" - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("已完成"); //"Completed" - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("總列印時間"); //"Total print time" - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最長工作時間"); //"Longest job time" - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("總計擠出"); //"Extruded total" - #else - PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("列印數"); //"Prints" - PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成"); //"Completed" - PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("總共"); //"Total" - PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最長"); //"Longest" - PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("已擠出"); //"Extruded" - #endif - - PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("最低溫度"); //"Min Temp" - PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("最高溫度"); //"Max Temp" - PROGMEM Language_Str MSG_INFO_PSU = _UxGT("電源供應"); //"Power Supply" - PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("驅動力度"); // "Drive Strength" - PROGMEM Language_Str MSG_DAC_PERCENT = _UxGT("驅動 %"); // "Driver %" - PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("保存驅動設置"); // "DAC EEPROM Write" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("列印已暫停"); // "PRINT PAUSED" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("裝載絲料"); // "LOAD FILAMENT" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("卸載絲料"); // "UNLOAD FILAMENT" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("恢複選項:"); // "RESUME OPTIONS:" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("清除更多"); // "Purge more" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("恢復列印"); //"Resume print" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" 噴嘴: "); // " Nozzle: " - PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("歸原位失敗"); // "Homing failed" - PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("探針探測失敗"); // "Probing failed" - PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: 太冷"); // "M600: Too cold" - - #if LCD_HEIGHT >= 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("等待開始", "絲料", "變更")); //"Wait for start of the filament change" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("等待", "卸下絲料")); //"Wait for filament unload" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("插入絲料", "並按鍵", "繼續 ...")); //"Insert filament and press button to continue..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("按下按鈕來", "加熱噴嘴.")); // "Press button to heat nozzle." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("加熱噴嘴", "請等待 ...")); // "Heating nozzle Please wait..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("等待", "進料")); //"Wait for filament load" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("等待", "絲料清除")); // "Wait for filament purge" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("等待列印", "恢復")); //"Wait for print to resume" - #else // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("請等待 ...")); //"Please wait..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("退出中 ...")); //"Ejecting..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("插入並點擊")); //"Insert and Click" - PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("加熱中 ...")); // "Heating..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("載入中 ...")); //"Loading..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("清除中 ...")); // "Purging..." - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("恢復中 ...")); //"Resuming..." - #endif // LCD_HEIGHT < 4 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.cpp deleted file mode 100644 index 9f28e14080..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.cpp +++ /dev/null @@ -1,63 +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 . - * - */ - -/** - * lcdprint.cpp - */ - -#include "../inc/MarlinConfigPre.h" - -#if HAS_SPI_LCD - -#include "lcdprint.h" -#include "../core/language.h" - -/** - * lcd_put_u8str_ind_P - * Print a string with an index substituted within it - */ -lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { - uint8_t *p = (uint8_t*)pstr; - lcd_uint_t n = maxlen; - for (; n; n--) { - wchar_t ch; - p = get_utf8_value_cb(p, read_byte_rom, &ch); - if (!ch) break; - if (ch == '=' || ch == '~' || ch == '*') { - if (ch == '*') { lcd_put_wchar('E'); n--; } - // lcd_put_int(ind); n--; if (ind >= 10) n--; - // if (ind >= 0) - { - lcd_put_wchar(ind + ((ch == '=') ? '0' : LCD_FIRST_TOOL)); - n--; - } - // else if (ind == -1) { PGM_P const b = GET_TEXT(MSG_BED); lcd_put_u8str_P(b); n -= utf8_strlen_P(b); } - // else if (ind == -2) { PGM_P const c = GET_TEXT(MSG_CHAMBER); lcd_put_u8str_P(c); n -= utf8_strlen_P(c); } - if (n) n -= lcd_put_u8str_max_P((PGM_P)p, n); - break; - } - lcd_put_wchar(ch); - } - return n; -} - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.h deleted file mode 100644 index 7128d79c57..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/lcdprint.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file lcdprint.h - * @brief LCD print api - * @author Yunhui Fu (yhfudev@gmail.com) - * @version 1.0 - * @date 2016-08-19 - * @copyright GPL/BSD - */ -#pragma once - -#include "fontutils.h" - -#include "../inc/MarlinConfig.h" - -#if HAS_GRAPHICAL_LCD - #include "dogm/u8g_fontutf8.h" - typedef u8g_uint_t lcd_uint_t; -#else - #define _UxGT(a) a - typedef uint8_t lcd_uint_t; -#endif - -#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) - -int lcd_glyph_height(); - -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); - -/** - * @brief Draw a UTF-8 string - * - * @param utf8_str : the UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) - * - * @return the pixel width - * - * Draw a UTF-8 string - */ -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); - -/** - * Set the print baseline position - */ -void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row); - -/** - * @brief Draw a ROM UTF-8 string - * - * @param utf8_str_P : the ROM UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) - * - * @return the pixel width - * - * Draw a ROM UTF-8 string - */ -int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length); -inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_str_P, pixel_len_t max_length) { - lcd_moveto(col, row); - return lcd_put_u8str_max_P(utf8_str_P, max_length); -} - -void lcd_put_int(const int i); -inline void lcd_put_int(const lcd_uint_t col, const lcd_uint_t row, const int i) { - lcd_moveto(col, row); - lcd_put_int(i); -} - -inline int lcd_put_u8str_P(PGM_P const pstr) { return lcd_put_u8str_max_P(pstr, PIXEL_LEN_NOLIMIT); } -inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr) { - lcd_moveto(col, row); - return lcd_put_u8str_P(pstr); -} - -lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen=LCD_WIDTH); -inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen=LCD_WIDTH) { - lcd_moveto(col, row); - return lcd_put_u8str_ind_P(pstr, ind, maxlen); -} - -inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } -inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, PGM_P const str) { - lcd_moveto(col, row); - return lcd_put_u8str(str); -} - -inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } -inline int lcd_put_wchar(const lcd_uint_t col, const lcd_uint_t row, const wchar_t c) { - lcd_moveto(col, row); - return lcd_put_wchar(c); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.cpp deleted file mode 100644 index 921a6f6e30..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.cpp +++ /dev/null @@ -1,207 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(MARLIN_BRICKOUT) - -#include "game.h" - -#define BRICK_H 5 -#define BRICK_TOP MENU_FONT_ASCENT - -#define PADDLE_H 2 -#define PADDLE_VEL 3 -#define PADDLE_W ((LCD_PIXEL_WIDTH) / 8) -#define PADDLE_Y (LCD_PIXEL_HEIGHT - 1 - PADDLE_H) - -#define BRICK_W ((LCD_PIXEL_WIDTH) / (BRICK_COLS)) -#define BRICK_BOT (BRICK_TOP + BRICK_H * BRICK_ROWS - 1) - -#define BRICK_COL(X) ((X) / (BRICK_W)) -#define BRICK_ROW(Y) ((Y - (BRICK_TOP)) / (BRICK_H)) - -brickout_data_t &bdat = marlin_game_data.brickout; - -inline void reset_bricks(const uint16_t v) { - bdat.brick_count = (BRICK_COLS) * (BRICK_ROWS); - LOOP_L_N(i, BRICK_ROWS) bdat.bricks[i] = v; -} - -void reset_ball() { - constexpr uint8_t ball_dist = 24; - bdat.bally = BTOF(PADDLE_Y - ball_dist); - bdat.ballv = FTOP(1.3f); - bdat.ballh = -FTOP(1.25f); - uint8_t bx = bdat.paddle_x + (PADDLE_W) / 2 + ball_dist; - if (bx >= LCD_PIXEL_WIDTH - 10) { bx -= ball_dist * 2; bdat.ballh = -bdat.ballh; } - bdat.ballx = BTOF(bx); - bdat.hit_dir = -1; -} - -void BrickoutGame::game_screen() { - if (game_frame()) { // Run logic twice for finer resolution - // Update Paddle Position - bdat.paddle_x = constrain(int8_t(ui.encoderPosition), 0, (LCD_PIXEL_WIDTH - (PADDLE_W)) / (PADDLE_VEL)); - ui.encoderPosition = bdat.paddle_x; - bdat.paddle_x *= (PADDLE_VEL); - - // Run the ball logic - if (game_state) do { - - // Provisionally update the ball position - const fixed_t newx = bdat.ballx + bdat.ballh, newy = bdat.bally + bdat.ballv; // current next position - if (!WITHIN(newx, 0, BTOF(LCD_PIXEL_WIDTH - 1))) { // out in x? - bdat.ballh = -bdat.ballh; _BUZZ(5, 220); // bounce x - } - if (newy < 0) { // out in y? - bdat.ballv = -bdat.ballv; _BUZZ(5, 280); // bounce v - bdat.hit_dir = 1; - } - // Did the ball go below the bottom? - else if (newy > BTOF(LCD_PIXEL_HEIGHT)) { - _BUZZ(500, 75); - if (--bdat.balls_left) reset_ball(); else game_state = 0; - break; // done - } - - // Is the ball colliding with a brick? - if (WITHIN(newy, BTOF(BRICK_TOP), BTOF(BRICK_BOT))) { - const int8_t bit = BRICK_COL(FTOB(newx)), row = BRICK_ROW(FTOB(newy)); - const uint16_t mask = _BV(bit); - if (bdat.bricks[row] & mask) { - // Yes. Remove it! - bdat.bricks[row] &= ~mask; - // Score! - score += BRICK_ROWS - row; - // If bricks are gone, go to reset state - if (!--bdat.brick_count) game_state = 2; - // Bounce the ball cleverly - if ((bdat.ballv < 0) == (bdat.hit_dir < 0)) { bdat.ballv = -bdat.ballv; bdat.ballh += fixed_t(random(-16, 16)); _BUZZ(5, 880); } - else { bdat.ballh = -bdat.ballh; bdat.ballv += fixed_t(random(-16, 16)); _BUZZ(5, 640); } - } - } - // Is the ball moving down and in paddle range? - else if (bdat.ballv > 0 && WITHIN(newy, BTOF(PADDLE_Y), BTOF(PADDLE_Y + PADDLE_H))) { - // Ball actually hitting paddle - const int8_t diff = FTOB(newx) - bdat.paddle_x; - if (WITHIN(diff, 0, PADDLE_W - 1)) { - - // Reverse Y direction - bdat.ballv = -bdat.ballv; _BUZZ(3, 880); - bdat.hit_dir = -1; - - // Near edges affects X velocity - const bool is_left_edge = (diff <= 1); - if (is_left_edge || diff >= PADDLE_W-1 - 1) { - if ((bdat.ballh > 0) == is_left_edge) bdat.ballh = -bdat.ballh; - } - else if (diff <= 3) { - bdat.ballh += fixed_t(random(-64, 0)); - NOLESS(bdat.ballh, BTOF(-2)); - NOMORE(bdat.ballh, BTOF(2)); - } - else if (diff >= PADDLE_W-1 - 3) { - bdat.ballh += fixed_t(random( 0, 64)); - NOLESS(bdat.ballh, BTOF(-2)); - NOMORE(bdat.ballh, BTOF(2)); - } - - // Paddle hit after clearing the board? Reset the board. - if (game_state == 2) { reset_bricks(0xFFFF); game_state = 1; } - } - } - - bdat.ballx += bdat.ballh; bdat.bally += bdat.ballv; // update with new velocity - - } while (false); - } - - u8g.setColorIndex(1); - - // Draw bricks - if (PAGE_CONTAINS(BRICK_TOP, BRICK_BOT)) { - for (uint8_t y = 0; y < BRICK_ROWS; ++y) { - const uint8_t yy = y * BRICK_H + BRICK_TOP; - if (PAGE_CONTAINS(yy, yy + BRICK_H - 1)) { - for (uint8_t x = 0; x < BRICK_COLS; ++x) { - if (TEST(bdat.bricks[y], x)) { - const uint8_t xx = x * BRICK_W; - for (uint8_t v = 0; v < BRICK_H - 1; ++v) - if (PAGE_CONTAINS(yy + v, yy + v)) - u8g.drawHLine(xx, yy + v, BRICK_W - 1); - } - } - } - } - } - - // Draw paddle - if (PAGE_CONTAINS(PADDLE_Y-1, PADDLE_Y)) { - u8g.drawHLine(bdat.paddle_x, PADDLE_Y, PADDLE_W); - #if PADDLE_H > 1 - u8g.drawHLine(bdat.paddle_x, PADDLE_Y-1, PADDLE_W); - #if PADDLE_H > 2 - u8g.drawHLine(bdat.paddle_x, PADDLE_Y-2, PADDLE_W); - #endif - #endif - } - - // Draw ball while game is running - if (game_state) { - const uint8_t by = FTOB(bdat.bally); - if (PAGE_CONTAINS(by, by+1)) - u8g.drawFrame(FTOB(bdat.ballx), by, 2, 2); - } - // Or draw GAME OVER - else - draw_game_over(); - - if (PAGE_UNDER(MENU_FONT_ASCENT)) { - // Score Digits - //const uint8_t sx = (LCD_PIXEL_WIDTH - (score >= 10 ? score >= 100 ? score >= 1000 ? 4 : 3 : 2 : 1) * MENU_FONT_WIDTH) / 2; - constexpr uint8_t sx = 0; - lcd_put_int(sx, MENU_FONT_ASCENT - 1, score); - - // Balls Left - lcd_moveto(LCD_PIXEL_WIDTH - MENU_FONT_WIDTH * 3, MENU_FONT_ASCENT - 1); - PGM_P const ohs = PSTR("ooo\0\0"); - lcd_put_u8str_P(ohs + 3 - bdat.balls_left); - } - - // A click always exits this game - if (ui.use_click()) exit_game(); -} - -#define SCREEN_M ((LCD_PIXEL_WIDTH) / 2) - -void BrickoutGame::enter_game() { - init_game(2, game_screen); // 2 = reset bricks on paddle hit - constexpr uint8_t paddle_start = SCREEN_M - (PADDLE_W) / 2; - bdat.paddle_x = paddle_start; - bdat.balls_left = 3; - reset_bricks(0x0000); - reset_ball(); - ui.encoderPosition = paddle_start / (PADDLE_VEL); -} - -#endif // MARLIN_BRICKOUT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.h deleted file mode 100644 index 9037e53830..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/brickout.h +++ /dev/null @@ -1,38 +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 - -#include "types.h" - -#define BRICK_ROWS 4 -#define BRICK_COLS 16 - -typedef struct { - uint8_t balls_left, brick_count; - uint16_t bricks[BRICK_ROWS]; - int8_t paddle_x, hit_dir; - fixed_t ballx, bally, ballh, ballv; -} brickout_data_t; - -class BrickoutGame : MarlinGame { public: static void enter_game(), game_screen(); }; - -extern BrickoutGame brickout; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.cpp deleted file mode 100644 index 6f8d247692..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.cpp +++ /dev/null @@ -1,66 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_GAMES - -#include "game.h" - -int MarlinGame::score; -uint8_t MarlinGame::game_state; -millis_t MarlinGame::next_frame; - -MarlinGameData marlin_game_data; - -bool MarlinGame::game_frame() { - static int8_t slew; - if (ui.first_page) slew = 2; - ui.refresh(LCDVIEW_CALL_NO_REDRAW); // Refresh as often as possible - return (game_state && slew-- > 0); -} - -void MarlinGame::draw_game_over() { - constexpr int8_t gowide = (MENU_FONT_WIDTH) * 9, - gohigh = MENU_FONT_ASCENT - 3, - lx = (LCD_PIXEL_WIDTH - gowide) / 2, - ly = (LCD_PIXEL_HEIGHT + gohigh) / 2; - if (PAGE_CONTAINS(ly - gohigh - 1, ly + 1)) { - u8g.setColorIndex(0); - u8g.drawBox(lx - 1, ly - gohigh - 1, gowide + 2, gohigh + 2); - u8g.setColorIndex(1); - if (ui.get_blink()) lcd_put_u8str_P(lx, ly, PSTR("GAME OVER")); - } -} - -void MarlinGame::init_game(const uint8_t init_state, const screenFunc_t screen) { - score = 0; - game_state = init_state; - ui.goto_screen(screen); - ui.defer_status_screen(); -} - -void MarlinGame::exit_game() { - ui.goto_previous_screen_no_defer(); -} - -#endif // HAS_GAMES diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.h deleted file mode 100644 index f168ccec79..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/game.h +++ /dev/null @@ -1,70 +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 - -#include "../../../inc/MarlinConfigPre.h" -#include "../../dogm/ultralcd_DOGM.h" -#include "../../lcdprint.h" -#include "../../ultralcd.h" - -//#define MUTE_GAMES - -#if ENABLED(MUTE_GAMES) || !HAS_BUZZER - #define _BUZZ(D,F) NOOP -#else - #define _BUZZ(D,F) BUZZ(D,F) -#endif - -#if HAS_GAME_MENU - void menu_game(); -#endif - -#if ENABLED(MARLIN_BRICKOUT) - #include "brickout.h" -#endif -#if ENABLED(MARLIN_INVADERS) - #include "invaders.h" -#endif -#if ENABLED(MARLIN_MAZE) - #include "maze.h" -#endif -#if ENABLED(MARLIN_SNAKE) - #include "snake.h" -#endif - -// Pool game data to save SRAM -union MarlinGameData { - #if ENABLED(MARLIN_BRICKOUT) - brickout_data_t brickout; - #endif - #if ENABLED(MARLIN_INVADERS) - invaders_data_t invaders; - #endif - #if ENABLED(MARLIN_SNAKE) - snake_data_t snake; - #endif - #if ENABLED(MARLIN_MAZE) - maze_data_t maze; - #endif -}; - -extern MarlinGameData marlin_game_data; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.cpp deleted file mode 100644 index 4517c5f43c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.cpp +++ /dev/null @@ -1,438 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(MARLIN_INVADERS) - -#include "game.h" - -#define CANNON_W 11 -#define CANNON_H 8 -#define CANNON_VEL 4 -#define CANNON_Y (LCD_PIXEL_HEIGHT - 1 - CANNON_H) - -#define INVADER_VEL 3 - -#define INVADER_TOP MENU_FONT_ASCENT -#define INVADERS_WIDE ((INVADER_COL_W) * (INVADER_COLS)) -#define INVADERS_HIGH ((INVADER_ROW_H) * (INVADER_ROWS)) - -#define UFO_H 5 -#define UFO_W 13 - -#define LASER_H 4 -#define SHOT_H 3 -#define EXPL_W 11 -#define LIFE_W 8 -#define LIFE_H 5 - -#define INVADER_RIGHT ((INVADER_COLS) * (INVADER_COL_W)) - -// 11x8 -const unsigned char invader[3][2][16] PROGMEM = { - { { B00000110,B00000000, - B00001111,B00000000, - B00011111,B10000000, - B00110110,B11000000, - B00111111,B11000000, - B00001001,B00000000, - B00010110,B10000000, - B00101001,B01000000 - }, { - B00000110,B00000000, - B00001111,B00000000, - B00011111,B10000000, - B00110110,B11000000, - B00111111,B11000000, - B00010110,B10000000, - B00100000,B01000000, - B00010000,B10000000 - } - }, { - { B00010000,B01000000, - B00001000,B10000000, - B00011111,B11000000, - B00110111,B01100000, - B01111111,B11110000, - B01011111,B11010000, - B01010000,B01010000, - B00001101,B10000000 - }, { - B00010000,B01000000, - B01001000,B10010000, - B01011111,B11010000, - B01110111,B01110000, - B01111111,B11110000, - B00011111,B11000000, - B00010000,B01000000, - B00100000,B00100000 - } - }, { - { B00001111,B00000000, - B01111111,B11100000, - B11111111,B11110000, - B11100110,B01110000, - B11111111,B11110000, - B00011001,B10000000, - B00110110,B11000000, - B11000000,B00110000 - }, { - B00001111,B00000000, - B01111111,B11100000, - B11111111,B11110000, - B11100110,B01110000, - B11111111,B11110000, - B00011001,B10000000, - B00110110,B11000000, - B00011001,B10000000 - } - } -}; -const unsigned char cannon[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B11111111,B11100000, - B11111111,B11100000, - B11111111,B11100000, - B11111111,B11100000 -}; -const unsigned char life[] PROGMEM = { - B00010000, - B01111100, - B11111110, - B11111110, - B11111110 -}; -const unsigned char explosion[] PROGMEM = { - B01000100,B01000000, - B00100100,B10000000, - B00000000,B00000000, - B00110001,B10000000, - B00000000,B00000000, - B00100100,B10000000, - B01000100,B01000000 -}; -const unsigned char ufo[] PROGMEM = { - B00011111,B11000000, - B01111111,B11110000, - B11011101,B11011000, - B11111111,B11111000, - B01111111,B11110000 -}; - -constexpr uint8_t inv_type[] = { - #if INVADER_ROWS == 5 - 0, 1, 1, 2, 2 - #elif INVADER_ROWS == 4 - 0, 1, 1, 2 - #elif INVADER_ROWS == 3 - 0, 1, 2 - #else - #error "INVASION_SIZE must be 3, 4, or 5." - #endif -}; - -invaders_data_t &idat = marlin_game_data.invaders; - -#define INV_X_LEFT(C,T) (idat.pos.x + (C) * (INVADER_COL_W) + inv_off[T]) -#define INV_X_CTR(C,T) (INV_X_LEFT(C,T) + inv_wide[T] / 2) -#define INV_Y_BOT(R) (idat.pos.y + (R + 1) * (INVADER_ROW_H) - 2) - -constexpr uint8_t inv_off[] = { 2, 1, 0 }, inv_wide[] = { 8, 11, 12 }; - -inline void update_invader_data() { - uint8_t inv_mask = 0; - // Get a list of all active invaders - uint8_t sc = 0; - LOOP_L_N(y, INVADER_ROWS) { - uint8_t m = idat.bugs[y]; - if (m) idat.botmost = y + 1; - inv_mask |= m; - for (uint8_t x = 0; x < INVADER_COLS; ++x) - if (TEST(m, x)) idat.shooters[sc++] = (y << 4) | x; - } - idat.leftmost = 0; - LOOP_L_N(i, INVADER_COLS) { if (TEST(inv_mask, i)) break; idat.leftmost -= INVADER_COL_W; } - idat.rightmost = LCD_PIXEL_WIDTH - (INVADERS_WIDE); - for (uint8_t i = INVADER_COLS; i--;) { if (TEST(inv_mask, i)) break; idat.rightmost += INVADER_COL_W; } - if (idat.count == 2) idat.dir = idat.dir > 0 ? INVADER_VEL + 1 : -(INVADER_VEL + 1); -} - -inline void reset_bullets() { - LOOP_L_N(i, COUNT(idat.bullet)) idat.bullet[i].v = 0; -} - -inline void reset_invaders() { - idat.pos.x = 0; idat.pos.y = INVADER_TOP; - idat.dir = INVADER_VEL; - idat.count = (INVADER_COLS) * (INVADER_ROWS); - LOOP_L_N(i, INVADER_ROWS) idat.bugs[i] = _BV(INVADER_COLS) - 1; - update_invader_data(); - reset_bullets(); -} - - -inline void spawn_ufo() { - idat.ufov = random(0, 2) ? 1 : -1; - idat.ufox = idat.ufov > 0 ? -(UFO_W) : LCD_PIXEL_WIDTH - 1; -} - -inline void reset_player() { - idat.cannon_x = 0; - ui.encoderPosition = 0; -} - -inline void fire_cannon() { - idat.laser.x = idat.cannon_x + CANNON_W / 2; - idat.laser.y = LCD_PIXEL_HEIGHT - CANNON_H - (LASER_H); - idat.laser.v = -(LASER_H); -} - -inline void explode(const int8_t x, const int8_t y, const int8_t v=4) { - idat.explod.x = x - (EXPL_W) / 2; - idat.explod.y = y; - idat.explod.v = v; -} - -inline void kill_cannon(uint8_t &game_state, const uint8_t st) { - reset_bullets(); - explode(idat.cannon_x + (CANNON_W) / 2, CANNON_Y, 6); - _BUZZ(1000, 10); - if (--idat.cannons_left) { - idat.laser.v = 0; - game_state = st; - reset_player(); - } - else - game_state = 0; -} - -void InvadersGame::game_screen() { - ui.refresh(LCDVIEW_CALL_NO_REDRAW); // Call as often as possible - - // Run game logic once per full screen - if (ui.first_page) { - - // Update Cannon Position - int16_t ep = constrain(int16_t(ui.encoderPosition), 0, (LCD_PIXEL_WIDTH - (CANNON_W)) / (CANNON_VEL)); - ui.encoderPosition = ep; - - ep *= (CANNON_VEL); - if (ep > idat.cannon_x) { idat.cannon_x += CANNON_VEL - 1; if (ep - idat.cannon_x < 2) idat.cannon_x = ep; } - if (ep < idat.cannon_x) { idat.cannon_x -= CANNON_VEL - 1; if (idat.cannon_x - ep < 2) idat.cannon_x = ep; } - - // Run the game logic - if (game_state) do { - - // Move the UFO, if any - if (idat.ufov) { idat.ufox += idat.ufov; if (!WITHIN(idat.ufox, -(UFO_W), LCD_PIXEL_WIDTH - 1)) idat.ufov = 0; } - - if (game_state > 1) { if (--game_state == 2) { reset_invaders(); } else if (game_state == 100) { game_state = 1; } break; } - - const bool did_blink = (++idat.blink_count > idat.count >> 1); - if (did_blink) { - idat.game_blink = !idat.game_blink; - idat.blink_count = 0; - } - - if (idat.count && did_blink) { - const int8_t newx = idat.pos.x + idat.dir; - if (!WITHIN(newx, idat.leftmost, idat.rightmost)) { // Invaders reached the edge? - idat.dir *= -1; // Invaders change direction - idat.pos.y += (INVADER_ROW_H) / 2; // Invaders move down - idat.pos.x -= idat.dir; // ...and only move down this time. - if (idat.pos.y + idat.botmost * (INVADER_ROW_H) - 2 >= CANNON_Y) // Invaders reached the bottom? - kill_cannon(game_state, 20); // Kill the cannon. Reset invaders. - } - - idat.pos.x += idat.dir; // Invaders take one step left/right - - // Randomly shoot if invaders are listed - if (idat.count && !random(0, 20)) { - - // Find a free bullet - laser_t *b = nullptr; - LOOP_L_N(i, COUNT(idat.bullet)) if (!idat.bullet[i].v) { b = &idat.bullet[i]; break; } - if (b) { - // Pick a random shooter and update the bullet - //SERIAL_ECHOLNPGM("free bullet found"); - const uint8_t inv = idat.shooters[random(0, idat.count + 1)], col = inv & 0x0F, row = inv >> 4, type = inv_type[row]; - b->x = INV_X_CTR(col, type); - b->y = INV_Y_BOT(row); - b->v = 2 + random(0, 2); - } - } - } - - // Update the laser position - if (idat.laser.v) { - idat.laser.y += idat.laser.v; - if (idat.laser.y < 0) idat.laser.v = 0; - } - - // Did the laser collide with an invader? - if (idat.laser.v && WITHIN(idat.laser.y, idat.pos.y, idat.pos.y + INVADERS_HIGH - 1)) { - const int8_t col = idat.laser_col(); - if (WITHIN(col, 0, INVADER_COLS - 1)) { - const int8_t row = idat.laser_row(); - if (WITHIN(row, 0, INVADER_ROWS - 1)) { - const uint8_t mask = _BV(col); - if (idat.bugs[row] & mask) { - const uint8_t type = inv_type[row]; - const int8_t invx = INV_X_LEFT(col, type); - if (WITHIN(idat.laser.x, invx, invx + inv_wide[type] - 1)) { - // Turn off laser - idat.laser.v = 0; - // Remove the invader! - idat.bugs[row] &= ~mask; - // Score! - score += INVADER_ROWS - row; - // Explode sound! - _BUZZ(40, 10); - // Explosion bitmap! - explode(invx + inv_wide[type] / 2, idat.pos.y + row * (INVADER_ROW_H)); - // If invaders are gone, go to reset invaders state - if (--idat.count) update_invader_data(); else { game_state = 20; reset_bullets(); } - } // laser x hit - } // invader exists - } // good row - } // good col - } // laser in invader zone - - // Handle alien bullets - LOOP_L_N(s, COUNT(idat.bullet)) { - laser_t *b = &idat.bullet[s]; - if (b->v) { - // Update alien bullet position - b->y += b->v; - if (b->y >= LCD_PIXEL_HEIGHT) - b->v = 0; // Offscreen - else if (b->y >= CANNON_Y && WITHIN(b->x, idat.cannon_x, idat.cannon_x + CANNON_W - 1)) - kill_cannon(game_state, 120); // Hit the cannon - } - } - - // Randomly spawn a UFO - if (!idat.ufov && !random(0,500)) spawn_ufo(); - - // Did the laser hit a ufo? - if (idat.laser.v && idat.ufov && idat.laser.y < UFO_H + 2 && WITHIN(idat.laser.x, idat.ufox, idat.ufox + UFO_W - 1)) { - // Turn off laser and UFO - idat.laser.v = idat.ufov = 0; - // Score! - score += 10; - // Explode! - _BUZZ(40, 10); - // Explosion bitmap - explode(idat.ufox + (UFO_W) / 2, 1); - } - - } while (false); - - } - - // Click-and-hold to abort - if (ui.button_pressed()) --idat.quit_count; else idat.quit_count = 10; - - // Click to fire or exit - if (ui.use_click()) { - if (!game_state) - idat.quit_count = 0; - else if (game_state == 1 && !idat.laser.v) - fire_cannon(); - } - - if (!idat.quit_count) exit_game(); - - u8g.setColorIndex(1); - - // Draw invaders - if (PAGE_CONTAINS(idat.pos.y, idat.pos.y + idat.botmost * (INVADER_ROW_H) - 2 - 1)) { - int8_t yy = idat.pos.y; - for (uint8_t y = 0; y < INVADER_ROWS; ++y) { - const uint8_t type = inv_type[y]; - if (PAGE_CONTAINS(yy, yy + INVADER_H - 1)) { - int8_t xx = idat.pos.x; - for (uint8_t x = 0; x < INVADER_COLS; ++x) { - if (TEST(idat.bugs[y], x)) - u8g.drawBitmapP(xx, yy, 2, INVADER_H, invader[type][idat.game_blink]); - xx += INVADER_COL_W; - } - } - yy += INVADER_ROW_H; - } - } - - // Draw UFO - if (idat.ufov && PAGE_UNDER(UFO_H + 2)) - u8g.drawBitmapP(idat.ufox, 2, 2, UFO_H, ufo); - - // Draw cannon - if (game_state && PAGE_CONTAINS(CANNON_Y, CANNON_Y + CANNON_H - 1) && (game_state < 2 || (game_state & 0x02))) - u8g.drawBitmapP(idat.cannon_x, CANNON_Y, 2, CANNON_H, cannon); - - // Draw laser - if (idat.laser.v && PAGE_CONTAINS(idat.laser.y, idat.laser.y + LASER_H - 1)) - u8g.drawVLine(idat.laser.x, idat.laser.y, LASER_H); - - // Draw invader bullets - LOOP_L_N (i, COUNT(idat.bullet)) { - if (idat.bullet[i].v && PAGE_CONTAINS(idat.bullet[i].y - (SHOT_H - 1), idat.bullet[i].y)) - u8g.drawVLine(idat.bullet[i].x, idat.bullet[i].y - (SHOT_H - 1), SHOT_H); - } - - // Draw explosion - if (idat.explod.v && PAGE_CONTAINS(idat.explod.y, idat.explod.y + 7 - 1)) { - u8g.drawBitmapP(idat.explod.x, idat.explod.y, 2, 7, explosion); - --idat.explod.v; - } - - // Blink GAME OVER when game is over - if (!game_state) draw_game_over(); - - if (PAGE_UNDER(MENU_FONT_ASCENT - 1)) { - // Draw Score - //const uint8_t sx = (LCD_PIXEL_WIDTH - (score >= 10 ? score >= 100 ? score >= 1000 ? 4 : 3 : 2 : 1) * MENU_FONT_WIDTH) / 2; - constexpr uint8_t sx = 0; - lcd_put_int(sx, MENU_FONT_ASCENT - 1, score); - - // Draw lives - if (idat.cannons_left) - for (uint8_t i = 1; i <= idat.cannons_left; ++i) - u8g.drawBitmapP(LCD_PIXEL_WIDTH - i * (LIFE_W), 6 - (LIFE_H), 1, LIFE_H, life); - } - -} - -void InvadersGame::enter_game() { - init_game(20, game_screen); // countdown to reset invaders - idat.cannons_left = 3; - idat.quit_count = 10; - idat.laser.v = 0; - reset_invaders(); - reset_player(); -} - -#endif // MARLIN_INVADERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.h deleted file mode 100644 index f04e91da64..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/invaders.h +++ /dev/null @@ -1,62 +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 - -#include "types.h" - -#define INVASION_SIZE 3 - -#if INVASION_SIZE == 3 - #define INVADER_COLS 5 -#elif INVASION_SIZE == 4 - #define INVADER_COLS 6 -#else - #define INVADER_COLS 8 - #undef INVASION_SIZE - #define INVASION_SIZE 5 -#endif - -#define INVADER_ROWS INVASION_SIZE - -#define INVADER_COL_W 14 -#define INVADER_H 8 -#define INVADER_ROW_H (INVADER_H + 2) - -typedef struct { int8_t x, y, v; } laser_t; - -typedef struct { - pos_t pos; - uint8_t cannons_left; - int8_t cannon_x; - laser_t bullet[10], laser, explod; - int8_t dir, leftmost, rightmost, botmost; - uint8_t count, quit_count, blink_count; - uint8_t bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)]; - int8_t ufox, ufov; - bool game_blink; - int8_t laser_col() { return ((laser.x - pos.x) / (INVADER_COL_W)); }; - int8_t laser_row() { return ((laser.y - pos.y + 2) / (INVADER_ROW_H)); }; -} invaders_data_t; - -class InvadersGame : MarlinGame { public: static void enter_game(), game_screen(); }; - -extern InvadersGame invaders; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.cpp deleted file mode 100644 index 13784f0d76..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.cpp +++ /dev/null @@ -1,134 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(MARLIN_MAZE) - -#include "game.h" - -int8_t move_dir, last_move_dir, // NESW0 - prizex, prizey, prize_cnt, old_encoder; -fixed_t playerx, playery; - -// Up to 50 lines, then you win! -typedef struct { int8_t x, y; } pos_t; -uint8_t head_ind; -pos_t maze_walls[50] = { - { 0, 0 } -}; - -// Turn the player cw or ccw -inline void turn_player(const bool cw) { - if (move_dir == 4) move_dir = last_move_dir; - move_dir += cw ? 1 : -1; - move_dir &= 0x03; - last_move_dir = move_dir; -} - -// Reset the player for a new game -void player_reset() { - // Init position - playerx = BTOF(1); - playery = BTOF(GAME_H / 2); - - // Init motion with a ccw turn - move_dir = 0; - turn_player(false); - - // Clear prize flag - prize_cnt = 255; - - // Clear the controls - ui.encoderPosition = 0; - old_encoder = 0; -} - -void MazeGame::game_screen() { - // Run the sprite logic - if (game_frame()) do { // Run logic twice for finer resolution - - // Move the man one unit in the current direction - // Direction index 4 is for the stopped man - const int8_t oldx = FTOB(playerx), oldy = FTOB(playery); - pos_t dir_add[] = { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, 0 } }; - playerx += dir_add[move_dir].x; - playery += dir_add[move_dir].y; - const int8_t x = FTOB(playerx), y = FTOB(playery); - - } while(0); - - u8g.setColorIndex(1); - - // Draw Score - if (PAGE_UNDER(HEADER_H)) lcd_put_int(0, HEADER_H - 1, score); - - // Draw the maze - // for (uint8_t n = 0; n < head_ind; ++n) { - // const pos_t &p = maze_walls[n], &q = maze_walls[n + 1]; - // if (p.x == q.x) { - // const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y)); - // if (PAGE_CONTAINS(y1, y2)) - // u8g.drawVLine(GAMEX(p.x), y1, y2 - y1 + 1); - // } - // else if (PAGE_CONTAINS(GAMEY(p.y), GAMEY(p.y))) { - // const int8_t x1 = GAMEX(_MIN(p.x, q.x)), x2 = GAMEX(_MAX(p.x, q.x)); - // u8g.drawHLine(x1, GAMEY(p.y), x2 - x1 + 1); - // } - // } - - // Draw Man - // const int8_t fy = GAMEY(foody); - // if (PAGE_CONTAINS(fy, fy + FOOD_WH - 1)) { - // const int8_t fx = GAMEX(foodx); - // u8g.drawFrame(fx, fy, FOOD_WH, FOOD_WH); - // if (FOOD_WH == 5) u8g.drawPixel(fx + 2, fy + 2); - // } - - // Draw Ghosts - // const int8_t fy = GAMEY(foody); - // if (PAGE_CONTAINS(fy, fy + FOOD_WH - 1)) { - // const int8_t fx = GAMEX(foodx); - // u8g.drawFrame(fx, fy, FOOD_WH, FOOD_WH); - // if (FOOD_WH == 5) u8g.drawPixel(fx + 2, fy + 2); - // } - - // Draw Prize - // if (PAGE_CONTAINS(prizey, prizey + PRIZE_WH - 1)) { - // u8g.drawFrame(prizex, prizey, PRIZE_WH, PRIZE_WH); - // if (PRIZE_WH == 5) u8g.drawPixel(prizex + 2, prizey + 2); - // } - - // Draw GAME OVER - if (!game_state) draw_game_over(); - - // A click always exits this game - if (ui.use_click()) exit_game(); -} - -void MazeGame::enter_game() { - init_game(1, game_screen); // Game running - reset_player(); - reset_enemies(); -} - -#endif // MARLIN_MAZE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.h deleted file mode 100644 index 5d7fff66af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/maze.h +++ /dev/null @@ -1,30 +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 - -#include "types.h" - -typedef struct { pos_t pos; } maze_data_t; - -class MazeGame : MarlinGame { public: static void enter_game(), game_screen(); }; - -extern MazeGame maze; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.cpp deleted file mode 100644 index 713c2ddd74..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.cpp +++ /dev/null @@ -1,323 +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 . - * - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(MARLIN_SNAKE) - -#include "game.h" - -#define SNAKE_BOX 4 - -#define HEADER_H (MENU_FONT_ASCENT - 2) -#define SNAKE_WH (SNAKE_BOX + 1) - -#define IDEAL_L 2 -#define IDEAL_R (LCD_PIXEL_WIDTH - 1 - 2) -#define IDEAL_T (HEADER_H + 2) -#define IDEAL_B (LCD_PIXEL_HEIGHT - 1 - 2) -#define IDEAL_W (IDEAL_R - (IDEAL_L) + 1) -#define IDEAL_H (IDEAL_B - (IDEAL_T) + 1) - -#define GAME_W int((IDEAL_W) / (SNAKE_WH)) -#define GAME_H int((IDEAL_H) / (SNAKE_WH)) - -#define BOARD_W ((SNAKE_WH) * (GAME_W) + 1) -#define BOARD_H ((SNAKE_WH) * (GAME_H) + 1) -#define BOARD_L ((LCD_PIXEL_WIDTH - (BOARD_W) + 1) / 2) -#define BOARD_R (BOARD_L + BOARD_W - 1) -#define BOARD_T (((LCD_PIXEL_HEIGHT + IDEAL_T) - (BOARD_H)) / 2) -#define BOARD_B (BOARD_T + BOARD_H - 1) - -#define GAMEX(X) (BOARD_L + ((X) * (SNAKE_WH))) -#define GAMEY(Y) (BOARD_T + ((Y) * (SNAKE_WH))) - -#if SNAKE_BOX > 2 - #define FOOD_WH SNAKE_BOX -#else - #define FOOD_WH 2 -#endif - -#if SNAKE_BOX < 1 - #define SNAKE_SIZ 1 -#else - #define SNAKE_SIZ SNAKE_BOX -#endif - -constexpr fixed_t snakev = FTOP(0.20); - -snake_data_t &sdat = marlin_game_data.snake; - -// Remove the first pixel from the tail. -// If needed, shift out the first segment. -void shorten_tail() { - pos_t &p = sdat.snake_tail[0], &q = sdat.snake_tail[1]; - bool shift = false; - if (p.x == q.x) { - // Vertical line - p.y += (q.y > p.y) ? 1 : -1; - shift = p.y == q.y; - } - else { - // Horizontal line - p.x += (q.x > p.x) ? 1 : -1; - shift = p.x == q.x; - } - if (shift) { - sdat.head_ind--; - for (uint8_t i = 0; i <= sdat.head_ind; ++i) - sdat.snake_tail[i] = sdat.snake_tail[i + 1]; - } -} - -// The food is on a line -inline bool food_on_line() { - for (uint8_t n = 0; n < sdat.head_ind; ++n) { - pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.x == q.x) { - if ((sdat.foodx == p.x - 1 || sdat.foodx == p.x) && WITHIN(sdat.foody, _MIN(p.y, q.y), _MAX(p.y, q.y))) - return true; - } - else if ((sdat.foody == p.y - 1 || sdat.foody == p.y) && WITHIN(sdat.foodx, _MIN(p.x, q.x), _MAX(p.x, q.x))) - return true; - } - return false; -} - -// Add a new food blob -void food_reset() { - do { - sdat.foodx = random(0, GAME_W); - sdat.foody = random(0, GAME_H); - } while (food_on_line()); -} - -// Turn the snake cw or ccw -inline void turn_snake(const bool cw) { - sdat.snake_dir += cw ? 1 : -1; - sdat.snake_dir &= 0x03; - sdat.head_ind++; - sdat.snake_tail[sdat.head_ind].x = FTOB(sdat.snakex); - sdat.snake_tail[sdat.head_ind].y = FTOB(sdat.snakey); -} - -// Reset the snake for a new game -void snake_reset() { - // Init the head and velocity - sdat.snakex = BTOF(1); - sdat.snakey = BTOF(GAME_H / 2); - //snakev = FTOP(0.25); - - // Init the tail with a cw turn - sdat.snake_dir = 0; - sdat.head_ind = 0; - sdat.snake_tail[0].x = 0; - sdat.snake_tail[0].y = GAME_H / 2; - turn_snake(true); - - // Clear food flag - sdat.food_cnt = 5; - - // Clear the controls - ui.encoderPosition = 0; - sdat.old_encoder = 0; -} - -// Check if head segment overlaps another -bool snake_overlap() { - // 4 lines must exist before a collision is possible - if (sdat.head_ind < 4) return false; - // Is the last segment crossing any others? - const pos_t &h1 = sdat.snake_tail[sdat.head_ind - 1], &h2 = sdat.snake_tail[sdat.head_ind]; - // VERTICAL head segment? - if (h1.x == h2.x) { - // Loop from oldest to segment two away from head - for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) { - // Segment p to q - const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.x != q.x) { - // Crossing horizontal segment - if (WITHIN(h1.x, _MIN(p.x, q.x), _MAX(p.x, q.x)) && (h1.y <= p.y) == (h2.y >= p.y)) return true; - } // Overlapping vertical segment - else if (h1.x == p.x && _MIN(h1.y, h2.y) <= _MAX(p.y, q.y) && _MAX(h1.y, h2.y) >= _MIN(p.y, q.y)) return true; - } - } - else { - // Loop from oldest to segment two away from head - for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) { - // Segment p to q - const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.y != q.y) { - // Crossing vertical segment - if (WITHIN(h1.y, _MIN(p.y, q.y), _MAX(p.y, q.y)) && (h1.x <= p.x) == (h2.x >= p.x)) return true; - } // Overlapping horizontal segment - else if (h1.y == p.y && _MIN(h1.x, h2.x) <= _MAX(p.x, q.x) && _MAX(h1.x, h2.x) >= _MIN(p.x, q.x)) return true; - } - } - return false; -} - -void SnakeGame::game_screen() { - // Run the snake logic - if (game_frame()) do { // Run logic twice for finer resolution - - // Move the snake's head one unit in the current direction - const int8_t oldx = FTOB(sdat.snakex), oldy = FTOB(sdat.snakey); - switch (sdat.snake_dir) { - case 0: sdat.snakey -= snakev; break; - case 1: sdat.snakex += snakev; break; - case 2: sdat.snakey += snakev; break; - case 3: sdat.snakex -= snakev; break; - } - const int8_t x = FTOB(sdat.snakex), y = FTOB(sdat.snakey); - - // If movement took place... - if (oldx != x || oldy != y) { - - if (!WITHIN(x, 0, GAME_W - 1) || !WITHIN(y, 0, GAME_H - 1)) { - game_state = 0; // Game Over - _BUZZ(400, 40); // Bzzzt! - break; // ...out of do-while - } - - sdat.snake_tail[sdat.head_ind].x = x; - sdat.snake_tail[sdat.head_ind].y = y; - - // Change snake direction if set - const int8_t enc = int8_t(ui.encoderPosition), diff = enc - sdat.old_encoder; - if (diff) { - sdat.old_encoder = enc; - turn_snake(diff > 0); - } - - if (sdat.food_cnt) --sdat.food_cnt; else shorten_tail(); - - // Did the snake collide with itself or go out of bounds? - if (snake_overlap()) { - game_state = 0; // Game Over - _BUZZ(400, 40); // Bzzzt! - } - // Is the snake at the food? - else if (x == sdat.foodx && y == sdat.foody) { - _BUZZ(5, 220); - _BUZZ(5, 280); - score++; - sdat.food_cnt = 2; - food_reset(); - } - } - - } while(0); - - u8g.setColorIndex(1); - - // Draw Score - if (PAGE_UNDER(HEADER_H)) lcd_put_int(0, HEADER_H - 1, score); - - // DRAW THE PLAYFIELD BORDER - u8g.drawFrame(BOARD_L - 2, BOARD_T - 2, BOARD_R - BOARD_L + 4, BOARD_B - BOARD_T + 4); - - // Draw the snake (tail) - #if SNAKE_WH < 2 - - // At this scale just draw a line - for (uint8_t n = 0; n < sdat.head_ind; ++n) { - const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.x == q.x) { - const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y)); - if (PAGE_CONTAINS(y1, y2)) - u8g.drawVLine(GAMEX(p.x), y1, y2 - y1 + 1); - } - else if (PAGE_CONTAINS(GAMEY(p.y), GAMEY(p.y))) { - const int8_t x1 = GAMEX(_MIN(p.x, q.x)), x2 = GAMEX(_MAX(p.x, q.x)); - u8g.drawHLine(x1, GAMEY(p.y), x2 - x1 + 1); - } - } - - #elif SNAKE_WH == 2 - - // At this scale draw two lines - for (uint8_t n = 0; n < sdat.head_ind; ++n) { - const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.x == q.x) { - const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y)); - if (PAGE_CONTAINS(y1, y2 + 1)) - u8g.drawFrame(GAMEX(p.x), y1, 2, y2 - y1 + 1 + 1); - } - else { - const int8_t py = GAMEY(p.y); - if (PAGE_CONTAINS(py, py + 1)) { - const int8_t x1 = GAMEX(_MIN(p.x, q.x)), x2 = GAMEX(_MAX(p.x, q.x)); - u8g.drawFrame(x1, py, x2 - x1 + 1 + 1, 2); - } - } - } - - #else - - // Draw a series of boxes - for (uint8_t n = 0; n < sdat.head_ind; ++n) { - const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; - if (p.x == q.x) { - const int8_t y1 = _MIN(p.y, q.y), y2 = _MAX(p.y, q.y); - if (PAGE_CONTAINS(GAMEY(y1), GAMEY(y2) + SNAKE_SIZ - 1)) { - for (int8_t i = y1; i <= y2; ++i) { - const int8_t y = GAMEY(i); - if (PAGE_CONTAINS(y, y + SNAKE_SIZ - 1)) - u8g.drawBox(GAMEX(p.x), y, SNAKE_SIZ, SNAKE_SIZ); - } - } - } - else { - const int8_t py = GAMEY(p.y); - if (PAGE_CONTAINS(py, py + SNAKE_SIZ - 1)) { - const int8_t x1 = _MIN(p.x, q.x), x2 = _MAX(p.x, q.x); - for (int8_t i = x1; i <= x2; ++i) - u8g.drawBox(GAMEX(i), py, SNAKE_SIZ, SNAKE_SIZ); - } - } - } - - #endif - - // Draw food - const int8_t fy = GAMEY(sdat.foody); - if (PAGE_CONTAINS(fy, fy + FOOD_WH - 1)) { - const int8_t fx = GAMEX(sdat.foodx); - u8g.drawFrame(fx, fy, FOOD_WH, FOOD_WH); - if (FOOD_WH == 5) u8g.drawPixel(fx + 2, fy + 2); - } - - // Draw GAME OVER - if (!game_state) draw_game_over(); - - // A click always exits this game - if (ui.use_click()) exit_game(); -} - -void SnakeGame::enter_game() { - init_game(1, game_screen); // 1 = Game running - snake_reset(); - food_reset(); -} - -#endif // MARLIN_SNAKE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.h deleted file mode 100644 index ec8524f2ef..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/snake.h +++ /dev/null @@ -1,38 +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 - -#include "types.h" - -typedef struct { - int8_t snake_dir, // NESW - foodx, foody, - food_cnt, - old_encoder; - pos_t snake_tail[50]; - fixed_t snakex, snakey; - uint8_t head_ind; -} snake_data_t; - -class SnakeGame : MarlinGame { public: static void enter_game(), game_screen(); }; - -extern SnakeGame snake; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/types.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/types.h deleted file mode 100644 index 872d034dca..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/game/types.h +++ /dev/null @@ -1,46 +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 - -#include - -typedef struct { int8_t x, y; } pos_t; - -// Simple 8:8 fixed-point -typedef int16_t fixed_t; -#define FTOP(F) fixed_t((F)*256.0f) -#define PTOF(P) (float(P)*(1.0f/256.0f)) -#define BTOF(X) (fixed_t(X)<<8) -#define FTOB(X) int8_t(fixed_t(X)>>8) - -class MarlinGame { -protected: - static int score; - static uint8_t game_state; - static millis_t next_frame; - - static bool game_frame(); - static void draw_game_over(); - static void exit_game(); -public: - static void init_game(const uint8_t init_state, const screenFunc_t screen); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.cpp deleted file mode 100644 index f4a2e6cbbd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.cpp +++ /dev/null @@ -1,509 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "../../module/planner.h" -#include "../../module/motion.h" -#include "../../module/printcounter.h" -#include "../../gcode/queue.h" - -#if HAS_BUZZER - #include "../../libs/buzzer.h" -#endif - -#if ENABLED(EEPROM_SETTINGS) - #include "../../module/configuration_store.h" -#endif - -#if WATCH_HOTENDS || WATCH_BED - #include "../../module/temperature.h" -#endif - -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - #include "../../module/probe.h" -#endif - -#if EITHER(ENABLE_LEVELING_FADE_HEIGHT, AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/bedlevel.h" -#endif - -//////////////////////////////////////////// -///////////// Global Variables ///////////// -//////////////////////////////////////////// - -// Menu Navigation -int8_t encoderTopLine, encoderLine, screen_items; - -typedef struct { - screenFunc_t menu_function; - uint32_t encoder_position; - int8_t top_line, items; -} menuPosition; -menuPosition screen_history[6]; -uint8_t screen_history_depth = 0; - -uint8_t MenuItemBase::itemIndex; // Index number for draw and action -chimera_t editable; // Value Editing - -// Menu Edit Items -PGM_P MenuEditItemBase::editLabel; -void* MenuEditItemBase::editValue; -int32_t MenuEditItemBase::minEditValue, - MenuEditItemBase::maxEditValue; -screenFunc_t MenuEditItemBase::callbackFunc; -bool MenuEditItemBase::liveEdit; - -// Prevent recursion into screen handlers -bool no_reentry = false; - -//////////////////////////////////////////// -//////// Menu Navigation & History ///////// -//////////////////////////////////////////// - -void MarlinUI::return_to_status() { goto_screen(status_screen); } - -void MarlinUI::save_previous_screen() { - if (screen_history_depth < COUNT(screen_history)) - screen_history[screen_history_depth++] = { currentScreen, encoderPosition, encoderTopLine, screen_items }; -} - -void MarlinUI::_goto_previous_screen( - #if ENABLED(TURBO_BACK_MENU_ITEM) - const bool is_back/*=false*/ - #endif -) { - #if DISABLED(TURBO_BACK_MENU_ITEM) - constexpr bool is_back = false; - #endif - if (screen_history_depth > 0) { - menuPosition &sh = screen_history[--screen_history_depth]; - goto_screen(sh.menu_function, - is_back ? 0 : sh.encoder_position, - is_back ? 0 : sh.top_line, - sh.items - ); - } - else - return_to_status(); -} - -//////////////////////////////////////////// -/////////// Common Menu Actions //////////// -//////////////////////////////////////////// - -void MenuItem_gcode::action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pgcode); } - -//////////////////////////////////////////// -/////////// Menu Editing Actions /////////// -//////////////////////////////////////////// - -/** - * Functions for editing single values - * - * The "DEFINE_MENU_EDIT_ITEM" macro generates the classes needed to edit a numerical value. - * - * The prerequisite is that in the header the type was already declared: - * - * DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int3, i16tostr3, 1) - * - * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into: - * - * template class TMenuEditItem - * - * You can then use one of the menu macros to present the edit interface: - * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * - * This expands into a more primitive menu item: - * _MENU_ITEM_P(int3, false, GET_TEXT(MSG_SPEED), &feedrate_percentage, 10, 999) - * - * ...which calls: - * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) - * MenuItem_int3::draw(encoderLine == _thisItemNr, _lcdLineNr, plabel, &feedrate_percentage, 10, 999) - */ -void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { - #if ENABLED(TOUCH_BUTTONS) - ui.repeat_delay = BUTTON_DELAY_EDIT; - #endif - if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; - if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; - if (ui.should_draw()) - draw_edit_screen(strfunc(ui.encoderPosition + minEditValue)); - if (ui.lcd_clicked || (liveEdit && ui.should_draw())) { - if (editValue != nullptr) loadfunc(editValue, ui.encoderPosition + minEditValue); - if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)(); - if (ui.use_click()) ui.goto_previous_screen(); - } -} - -void MenuEditItemBase::goto_edit_screen( - PGM_P const el, // Edit label - void * const ev, // Edit value pointer - const int32_t minv, // Encoder minimum - const int32_t maxv, // Encoder maximum - const uint16_t ep, // Initial encoder value - const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit() - const screenFunc_t cb, // Callback after edit - const bool le // Flag to call cb() during editing -) { - ui.screen_changed = true; - ui.save_previous_screen(); - ui.refresh(); - editLabel = el; - editValue = ev; - minEditValue = minv; - maxEditValue = maxv; - ui.encoderPosition = ep; - ui.currentScreen = cs; - callbackFunc = cb; - liveEdit = le; -} - -// TODO: Remove these but test build size with and without -#define DEFINE_MENU_EDIT_ITEM(NAME) template class TMenuEditItem - -DEFINE_MENU_EDIT_ITEM(percent); // 100% right-justified -DEFINE_MENU_EDIT_ITEM(int3); // 123, -12 right-justified -DEFINE_MENU_EDIT_ITEM(int4); // 1234, -123 right-justified -DEFINE_MENU_EDIT_ITEM(int8); // 123, -12 right-justified -DEFINE_MENU_EDIT_ITEM(uint8); // 123 right-justified -DEFINE_MENU_EDIT_ITEM(uint16_3); // 123 right-justified -DEFINE_MENU_EDIT_ITEM(uint16_4); // 1234 right-justified -DEFINE_MENU_EDIT_ITEM(uint16_5); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM(float3); // 123 right-justified -DEFINE_MENU_EDIT_ITEM(float52); // _2.34, 12.34, -2.34 or 123.45, -23.45 -DEFINE_MENU_EDIT_ITEM(float43); // 1.234 -DEFINE_MENU_EDIT_ITEM(float5); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM(float5_25); // 12345 right-justified (25 increment) -DEFINE_MENU_EDIT_ITEM(float51); // 1234.5 right-justified -DEFINE_MENU_EDIT_ITEM(float41sign); // +123.4 -DEFINE_MENU_EDIT_ITEM(float51sign); // +1234.5 -DEFINE_MENU_EDIT_ITEM(float52sign); // +123.45 -DEFINE_MENU_EDIT_ITEM(long5); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM(long5_25); // 12345 right-justified (25 increment) - -void MenuItem_bool::action(PGM_P const, bool * const ptr, screenFunc_t callback) { - *ptr ^= true; ui.refresh(); - if (callback) (*callback)(); -} - -//////////////////////////////////////////// -///////////////// Menu Tree //////////////// -//////////////////////////////////////////// - -#include "../../Marlin.h" - -bool printer_busy() { - return planner.movesplanned() || printingIsActive(); -} - -/** - * General function to go directly to a screen - */ -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(LCD_SET_PROGRESS_MANUALLY) - progress_reset(); - #endif - - #if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING) - static millis_t doubleclick_expire_ms = 0; - // Going to menu_main from status screen? Remember first click time. - // Going back to status screen within a very short time? Go to Z babystepping. - if (screen == menu_main) { - if (on_status_screen()) - doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; - } - else if (screen == status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) { - - #if ENABLED(BABYSTEP_WITHOUT_HOMING) - constexpr bool can_babystep = true; - #else - const bool can_babystep = all_axes_known(); - #endif - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - constexpr bool should_babystep = true; - #else - const bool should_babystep = printer_busy(); - #endif - - if (should_babystep && can_babystep) { - screen = - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - lcd_babystep_zoffset - #else - lcd_babystep_z - #endif - ; - } - #if ENABLED(MOVE_Z_WHEN_IDLE) - else { - move_menu_scale = MOVE_Z_IDLE_MULTIPLICATOR; - screen = lcd_move_z; - } - #endif - } - #endif - - currentScreen = screen; - encoderPosition = encoder; - encoderTopLine = top; - screen_items = items; - if (screen == status_screen) { - defer_status_screen(false); - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.lcd_map_control = false; - #endif - screen_history_depth = 0; - } - - clear_lcd(); - - // Re-initialize custom characters that may be re-used - #if HAS_CHARACTER_LCD - if (true - #if ENABLED(AUTO_BED_LEVELING_UBL) - && !ubl.lcd_map_control - #endif - ) set_custom_characters(screen == status_screen ? CHARSET_INFO : CHARSET_MENU); - #endif - - refresh(LCDVIEW_CALL_REDRAW_NEXT); - screen_changed = true; - #if HAS_GRAPHICAL_LCD - drawing_screen = false; - #endif - - #if HAS_LCD_MENU - encoder_direction_normal(); - #endif - - set_selection(false); - } -} - -//////////////////////////////////////////// -///////////// Manual Movement ////////////// -//////////////////////////////////////////// - -// -// Display the synchronize screen until moves are -// finished, and don't return to the caller until -// done. ** This blocks the command queue! ** -// -static PGM_P sync_message; - -void MarlinUI::_synchronize() { - if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); - if (no_reentry) return; - // Make this the current handler till all moves are done - no_reentry = true; - const screenFunc_t old_screen = currentScreen; - goto_screen(_synchronize); - planner.synchronize(); // idle() is called until moves complete - no_reentry = false; - goto_screen(old_screen); -} - -// Display the synchronize screen with a custom message -// ** This blocks the command queue! ** -void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { - sync_message = msg ?: GET_TEXT(MSG_MOVING); - _synchronize(); -} - -/** - * Scrolling for menus and other line-based screens - * - * encoderLine is the position based on the encoder - * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM - * screen_items is the total number of items in the menu (after one call) - */ -void scroll_screen(const uint8_t limit, const bool is_menu) { - ui.encoder_direction_menus(); - ENCODER_RATE_MULTIPLY(false); - if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; - if (ui.first_page) { - encoderLine = ui.encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); - ui.screen_changed = false; - } - if (screen_items > 0 && encoderLine >= screen_items - limit) { - encoderLine = _MAX(0, screen_items - limit); - ui.encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); - } - if (is_menu) { - NOMORE(encoderTopLine, encoderLine); - if (encoderLine >= encoderTopLine + LCD_HEIGHT) - encoderTopLine = encoderLine - LCD_HEIGHT + 1; - } - else - encoderTopLine = encoderLine; -} - -#if HAS_BUZZER - void MarlinUI::completion_feedback(const bool good/*=true*/) { - if (good) { - BUZZ(100, 659); - BUZZ(100, 698); - } - else BUZZ(20, 440); - } -#endif - -#if HAS_LINE_TO_Z - - void line_to_z(const float &z) { - current_position.z = z; - line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.z)); - } - -#endif - -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - - #include "../../feature/babystep.h" - - void lcd_babystep_zoffset() { - if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - ui.defer_status_screen(); - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - const bool do_probe = (active_extruder == 0); - #else - constexpr bool do_probe = true; - #endif - if (ui.encoderPosition) { - const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z); - ui.encoderPosition = 0; - - const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, - new_probe_offset = probe_offset.z + diff, - new_offs = - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff - #else - new_probe_offset - #endif - ; - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - - babystep.add_steps(Z_AXIS, babystep_increment); - - if (do_probe) probe_offset.z = new_offs; - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - else hotend_offset[active_extruder].z = new_offs; - #endif - - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - } - } - if (ui.should_draw()) { - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - if (!do_probe) - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr43sign(hotend_offset[active_extruder].z)); - else - #endif - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset.z)); - - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset.z); - #endif - } - } - -#endif // BABYSTEP_ZPROBE_OFFSET - -#if ANY(AUTO_BED_LEVELING_UBL, PID_AUTOTUNE_MENU, ADVANCED_PAUSE_FEATURE) - - void lcd_enqueue_one_now(const char * const cmd) { - no_reentry = true; - queue.enqueue_one_now(cmd); - no_reentry = false; - } - - void lcd_enqueue_one_now_P(PGM_P const cmd) { - no_reentry = true; - queue.enqueue_now_P(cmd); - no_reentry = false; - } - -#endif - -#if ENABLED(EEPROM_SETTINGS) - void lcd_store_settings() { - const bool saved = settings.save(); - #if HAS_BUZZER - ui.completion_feedback(saved); - #endif - UNUSED(saved); - } - void lcd_load_settings() { - const bool loaded = settings.load(); - #if HAS_BUZZER - ui.completion_feedback(loaded); - #endif - UNUSED(loaded); - } -#endif - -void _lcd_draw_homing() { - constexpr uint8_t line = (LCD_HEIGHT - 1) / 2; - if (ui.should_draw()) MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING)); -} - -#if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - #include "../../feature/bedlevel/bedlevel.h" - void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } -#endif - -// -// Selection screen presents a prompt and two options -// -bool MarlinUI::selection; // = false -bool MarlinUI::update_selection() { - encoder_direction_select(); - if (encoderPosition) { - selection = int16_t(encoderPosition) > 0; - encoderPosition = 0; - } - return selection; -} - -void MenuItem_confirm::select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - const bool ui_selection = ui.update_selection(), got_click = ui.use_click(); - if (got_click || ui.should_draw()) { - draw_select_screen(yes, no, ui_selection, pref, string, suff); - if (got_click) { ui_selection ? yesFunc() : noFunc(); } - } -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.h deleted file mode 100644 index ce821d0dd2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu.h +++ /dev/null @@ -1,565 +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 - -#include "../ultralcd.h" -#include "../../libs/numtostr.h" -#include "../../inc/MarlinConfig.h" - -#include "limits.h" - -extern int8_t encoderLine, encoderTopLine, screen_items; - -#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, HEATER_5_MAXTEMP); -#endif - -void scroll_screen(const uint8_t limit, const bool is_menu); -bool printer_busy(); - -typedef void (*selectFunc_t)(); - -#define SS_LEFT 0x00 -#define SS_CENTER 0x01 -#define SS_INVERT 0x02 -#define SS_DEFAULT SS_CENTER - -#if HAS_GRAPHICAL_LCD && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) - void _lcd_zoffset_overlay_gfx(const float zvalue); -#endif - -//////////////////////////////////////////// -///////////// Base Menu Items ////////////// -//////////////////////////////////////////// - -class MenuItemBase { - public: - // An index to interject in the item label and for - // use by the action - static uint8_t itemIndex; - - // Store the index of the item ahead of use by indexed items - FORCE_INLINE static void init(const uint8_t ind) { itemIndex = ind; } - - // Draw an item either selected (pre_char) or not (space) with post_char - static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); - - // Draw an item either selected ('>') or not (space) with post_char - FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) { - _draw(sel, row, pstr, '>', post_char); - } -}; - -class MenuItem_static : public MenuItemBase { - public: - static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const valstr=nullptr); -}; - -// CONFIRM_ITEM(LABEL,Y,N,FY,FN,V...), -// YESNO_ITEM(LABEL,FY,FN,V...) -class MenuItem_confirm : public MenuItemBase { - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); - } - // Implemented for HD44780 and DOGM - // Draw the prompt, buttons, and state - static void draw_select_screen( - PGM_P const yes, // Right option label - PGM_P const no, // Left option label - const bool yesno, // Is "yes" selected? - PGM_P const pref, // Prompt prefix - const char * const string, // Prompt runtime string - PGM_P const suff // Prompt suffix - ); - static void select_screen( - PGM_P const yes, PGM_P const no, - selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr - ); - static inline void select_screen( - PGM_P const yes, PGM_P const no, - selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const progmem_str string, PGM_P const suff=nullptr - ) { - char str[strlen_P((PGM_P)string) + 1]; - strcpy_P(str, (PGM_P)string); - select_screen(yes, no, yesFunc, noFunc, pref, str, suff); - } - // Shortcut for prompt with "NO"/ "YES" labels - FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) { - select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff); - } -}; - -// BACK_ITEM(LABEL) -class MenuItem_back : public MenuItemBase { - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) { - _draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); - } - // Back Item action goes back one step in history - FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); } -}; - -// SUBMENU(LABEL, screen_handler) -class MenuItem_submenu : public MenuItemBase { - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); - } - static inline void action(PGM_P const, const screenFunc_t func) { ui.save_previous_screen(); ui.goto_screen(func); } -}; - -// Any menu item that invokes an immediate action -class MenuItem_button : public MenuItemBase { - public: - // Button-y Items are selectable lines with no other indicator - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); - } -}; - -// GCODES_ITEM(LABEL, GCODES) -class MenuItem_gcode : public MenuItem_button { - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); - } - static void action(PGM_P const, const char * const pgcode); - static inline void action(PGM_P const pstr, const uint8_t, const char * const pgcode) { action(pstr, pgcode); } -}; - -// ACTION_ITEM(LABEL, FUNC) -class MenuItem_function : public MenuItem_button { - public: - //static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; - static inline void action(PGM_P const, const menuAction_t func) { (*func)(); }; -}; - -#if ENABLED(SDSUPPORT) - class CardReader; - class MenuItem_sdbase { - public: - // Implemented for HD44780 and DOGM - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); - }; -#endif - -//////////////////////////////////////////// -///////////// Edit Menu Items ////////////// -//////////////////////////////////////////// - -// The Menu Edit shadow value -typedef union { - bool state; - float decimal; - int8_t int8; - int16_t int16; - int32_t int32; - uint8_t uint8; - uint16_t uint16; - uint32_t uint32; -} chimera_t; -extern chimera_t editable; - -// Base class for Menu Edit Items -class MenuEditItemBase : public MenuItemBase { - private: - // These values are statically constructed by init() via action() - // The action() method acts like the instantiator. The entire lifespan - // of a menu item is within its declaration, so all these values decompose - // into behavior and unused items get optimized out. - static PGM_P editLabel; - static void *editValue; - static int32_t minEditValue, maxEditValue; // Encoder value range - static screenFunc_t callbackFunc; - static bool liveEdit; - protected: - typedef const char* (*strfunc_t)(const int32_t); - typedef void (*loadfunc_t)(void *, const int32_t); - static void goto_edit_screen( - PGM_P const el, // Edit label - void * const ev, // Edit value pointer - const int32_t minv, // Encoder minimum - const int32_t maxv, // Encoder maximum - const uint16_t ep, // Initial encoder value - const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit() - const screenFunc_t cb, // Callback after edit - const bool le // Flag to call cb() during editing - ); - static void edit_screen(strfunc_t, loadfunc_t); // Edit value handler - public: - // Implemented for HD44780 and DOGM - // Draw the current item at specified row with edit data - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm=false); - - // Implemented for HD44780 and DOGM - // This low-level method is good to draw from anywhere - static void draw_edit_screen(PGM_P const pstr, const char* const value); - - // This method is for the current menu item - static inline void draw_edit_screen(const char* const value) { draw_edit_screen(editLabel, value); } -}; - -// Template for specific Menu Edit Item Types -template -class TMenuEditItem : MenuEditItemBase { - private: - typedef typename NAME::type_t type_t; - static inline float unscale(const float value) { return value * (1.0f / NAME::scale); } - static inline float scale(const float value) { return value * NAME::scale; } - static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } - static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data))); - } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget())); - } - // Edit screen for this type of item - static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); } - static void action( - PGM_P const pstr, // Edit label - type_t * const ptr, // Value pointer - const type_t minValue, // Value range - const type_t maxValue, - const screenFunc_t callback=nullptr, // Value update callback - const bool live=false // Callback during editing - ) { - // Make sure minv and maxv fit within int32_t - const int32_t minv = _MAX(scale(minValue), INT32_MIN), - maxv = _MIN(scale(maxValue), INT32_MAX); - goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, - edit_screen, callback, live); - } -}; - -// Provide a set of Edit Item Types which encompass a primitive -// type, a string function, and a scale factor for edit and display. -// These items call the Edit Item draw method passing the prepared string. -#define DEFINE_MENU_EDIT_ITEM_TYPE(TYPE, NAME, STRFUNC, SCALE) \ - struct MenuEditItemInfo_##NAME { \ - typedef TYPE type_t; \ - static constexpr float scale = SCALE; \ - static inline const char* strfunc(const float value) { return STRFUNC((TYPE)value); } \ - }; \ - typedef TMenuEditItem MenuItem_##NAME - -// TYPE NAME STRFUNC SCALE -DEFINE_MENU_EDIT_ITEM_TYPE(uint8_t, percent, ui8tostr4pct, 100.0/255); // 100% right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int3, i16tostr3, 1 ); // 123, -12 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int4, i16tostr4sign, 1 ); // 1234, -123 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(int8_t, int8, i8tostr3, 1 ); // 123, -12 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(uint8_t, uint8, ui8tostr3, 1 ); // 123 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_3, ui16tostr3, 1 ); // 123 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_4, ui16tostr4, 0.1 ); // 1234 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_5, ui16tostr5, 0.01 ); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(float, float3, ftostr3, 1 ); // 123 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(float, float52, ftostr42_52, 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 -DEFINE_MENU_EDIT_ITEM_TYPE(float, float43, ftostr43sign, 1000 ); // 1.234 -DEFINE_MENU_EDIT_ITEM_TYPE(float, float5, ftostr5rj, 1 ); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(float, float5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) -DEFINE_MENU_EDIT_ITEM_TYPE(float, float51, ftostr51rj, 10 ); // 1234.5 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(float, float41sign, ftostr41sign, 10 ); // +123.4 -DEFINE_MENU_EDIT_ITEM_TYPE(float, float51sign, ftostr51sign, 10 ); // +1234.5 -DEFINE_MENU_EDIT_ITEM_TYPE(float, float52sign, ftostr52sign, 100 ); // +123.45 -DEFINE_MENU_EDIT_ITEM_TYPE(uint32_t, long5, ftostr5rj, 0.01f ); // 12345 right-justified -DEFINE_MENU_EDIT_ITEM_TYPE(uint32_t, long5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) - -class MenuItem_bool : public MenuEditItemBase { - public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) { - MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true); - } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) { - draw(sel, row, pstr, *data); - } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) { - draw(sel, row, pstr, pget()); - } - static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr); -}; - -//////////////////////////////////////////// -//////////// Menu System Macros //////////// -//////////////////////////////////////////// - -/** - * SCREEN_OR_MENU_LOOP generates init code for a screen or menu - * - * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM - */ -#define SCREEN_OR_MENU_LOOP(IS_MENU) \ - scroll_screen(IS_MENU ? 1 : LCD_HEIGHT, IS_MENU); \ - int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ - bool _skipStatic = IS_MENU; \ - for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ - _thisItemNr = 0 - -/** - * START_SCREEN Opening code for a screen having only static items. - * Do simplified scrolling of the entire screen. - * - * START_MENU Opening code for a screen with menu items. - * Scroll as-needed to keep the selected line in view. - */ -#define START_SCREEN() SCREEN_OR_MENU_LOOP(false) -#define START_MENU() SCREEN_OR_MENU_LOOP(true) -#define NEXT_ITEM() (++_thisItemNr) -#define SKIP_ITEM() NEXT_ITEM() -#define END_SCREEN() } screen_items = _thisItemNr -#define END_MENU() END_SCREEN(); UNUSED(_skipStatic) - -#if ENABLED(ENCODER_RATE_MULTIPLIER) - #define ENCODER_RATE_MULTIPLY(F) (ui.encoderRateMultiplierEnabled = F) - #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) do{ if (USE_MULTIPLIER) ui.enable_encoder_multiplier(true); }while(0) - //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value -#else - #define ENCODER_RATE_MULTIPLY(F) NOOP - #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) -#endif - -/** - * MENU_ITEM generates draw & handler code for a menu item, potentially calling: - * - * MenuItem_::draw(sel, row, label, arg3...) - * MenuItem_::action(arg3...) - * - * Examples: - * BACK_ITEM(MSG_WATCH) - * MenuItem_back::action(plabel, ...) - * MenuItem_back::draw(sel, row, plabel, ...) - * - * ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause) - * MenuItem_function::action(plabel, lcd_sdcard_pause) - * MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause) - * - * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) - * MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999) - */ - -#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \ - PGM_P const plabel = PLABEL; \ - if (encoderLine == _thisItemNr && ui.use_click()) { \ - _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - MenuItem_##TYPE::action(plabel, ##V); \ - if (ui.screen_changed) return; \ - } \ - if (ui.should_draw()) \ - MenuItem_##TYPE::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \ -}while(0) - -#define _MENU_ITEM_P(TYPE, V...) do { \ - _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) \ - _MENU_INNER_P(TYPE, ##V); \ - NEXT_ITEM(); \ -}while(0) - -// Indexed items set a global index value -#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \ - _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) { \ - MenuItemBase::init(N); \ - _MENU_INNER_P(TYPE, ##V); \ - } \ - NEXT_ITEM(); \ -}while(0) - -// STATIC_ITEM draws a styled string with no highlight. -// Parameters: label [, style [, char *value] ] - -#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - if (ui.should_draw()) \ - MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \ -} while(0) - -#define STATIC_ITEM_P(PLABEL, V...) do{ \ - if (_menuLineNr == _thisItemNr) \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ - NEXT_ITEM(); \ -} while(0) - -#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ - MenuItemBase::init(N); \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ - } \ - NEXT_ITEM(); \ -}while(0) - -#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P( GET_TEXT(LABEL), ##V) -#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_P(GET_TEXT(LABEL), ##V) - -#define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, false, PLABEL, ##V) -#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) - -#define MENU_ITEM_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, false, PLABEL, ##V) -#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) - -#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) - -#define ACTION_ITEM_P(PLABEL, ACTION) MENU_ITEM_P(function, PLABEL, ACTION) -#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_P(GET_TEXT(LABEL), ACTION) - -#define ACTION_ITEM_N_P(N, PLABEL, ACTION) MENU_ITEM_N_P(function, N, PLABEL, ACTION) -#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_P(N, GET_TEXT(LABEL), ACTION) - -#define GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES) -#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES) - -#define GCODES_ITEM_N_P(N, PLABEL, GCODES) MENU_ITEM_N_P(gcode, N, PLABEL, GCODES) -#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_P(N, GET_TEXT(LABEL), GCODES) - -#define SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST) -#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST) - -#define SUBMENU_N_P(N, PLABEL, DEST) MENU_ITEM_N_P(submenu, N, PLABEL, DEST) -#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_P(N, GET_TEXT(LABEL), DEST) - -#define EDIT_ITEM_P(TYPE, PLABEL, V...) MENU_ITEM_P(TYPE, PLABEL, ##V) -#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) - -#define EDIT_ITEM_N_P(TYPE, N, PLABEL, V...) MENU_ITEM_N_P(TYPE, N, PLABEL, ##V) -#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) - -#define EDIT_ITEM_FAST_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, true, PLABEL, ##V) -#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_P(TYPE, GET_TEXT(LABEL), ##V) - -#define EDIT_ITEM_FAST_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, true, PLABEL, ##V) -#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_P(TYPE, N, GET_TEXT(LABEL), ##V) - -#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \ - if (encoderLine == _thisItemNr && ui.use_click()) { \ - ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ - return; \ - } \ - if (ui.should_draw()) MenuItem_confirm::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \ -}while(0) - -#define _CONFIRM_ITEM_P(PLABEL, V...) do { \ - _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) \ - _CONFIRM_ITEM_INNER_P(PLABEL, ##V); \ - NEXT_ITEM(); \ -}while(0) - -// Indexed items set a global index value -#define _CONFIRM_ITEM_N_P(N, V...) do{ \ - _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) { \ - MenuItemBase::init(N); \ - _CONFIRM_ITEM_INNER_P(TYPE, ##V); \ - } \ - NEXT_ITEM(); \ -}while(0) - -#define CONFIRM_ITEM_P(PLABEL,A,B,V...) _CONFIRM_ITEM_P(PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) -#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V) - -#define YESNO_ITEM_P(PLABEL, V...) _CONFIRM_ITEM_P(PLABEL, ##V) -#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(GET_TEXT(LABEL), ##V) - -#define CONFIRM_ITEM_N_P(N,PLABEL,A,B,V...) _CONFIRM_ITEM_N_P(N, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) -#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_P(N, GET_TEXT(LABEL), ##V) - -#define YESNO_ITEM_N_P(N,PLABEL, V...) _CONFIRM_ITEM_N_P(N, PLABEL, ##V) -#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V) - -//////////////////////////////////////////// -/////////////// Menu Screens /////////////// -//////////////////////////////////////////// - -void menu_main(); -void menu_move(); - -#if ENABLED(SDSUPPORT) - void menu_media(); -#endif - -// First Fan Speed title in "Tune" and "Control>Temperature" menus -#if FAN_COUNT > 0 && HAS_FAN0 - #if FAN_COUNT > 1 - #define FAN_SPEED_1_SUFFIX " 1" - #else - #define FAN_SPEED_1_SUFFIX "" - #endif -#endif - -//////////////////////////////////////////// -//////// Menu Item Helper Functions //////// -//////////////////////////////////////////// - -void lcd_move_z(); -void _lcd_draw_homing(); - -#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS) - -#if HAS_LINE_TO_Z - void line_to_z(const float &z); -#endif - -#if ANY(AUTO_BED_LEVELING_UBL, PID_AUTOTUNE_MENU, ADVANCED_PAUSE_FEATURE) - void lcd_enqueue_one_now(const char * const cmd); - void lcd_enqueue_one_now_P(PGM_P const cmd); -#endif - -#if HAS_GRAPHICAL_LCD && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) - void _lcd_zoffset_overlay_gfx(const float zvalue); -#endif - -#if ENABLED(LEVEL_BED_CORNERS) - void _lcd_level_bed_corners(); -#endif - -#if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - void _lcd_toggle_bed_leveling(); -#endif - -#if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - void lcd_babystep_zoffset(); - #else - void lcd_babystep_z(); - #endif -#endif - -#if ENABLED(EEPROM_SETTINGS) - void lcd_store_settings(); - void lcd_load_settings(); -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - void menu_job_recovery(); -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_addon.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_addon.h deleted file mode 100644 index e7553293a1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_addon.h +++ /dev/null @@ -1,33 +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 - -#include "../lcdprint.h" -#if HAS_GRAPHICAL_LCD - #include "../dogm/ultralcd_DOGM.h" -#endif - -#define MENU_ITEM_ADDON_START(X) do{ \ - if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \ - SETCURSOR(X, _lcdLineNr) - -#define MENU_ITEM_ADDON_END() } }while(0) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_advanced.cpp deleted file mode 100644 index 85cd0ccf61..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_advanced.cpp +++ /dev/null @@ -1,618 +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 . - * - */ - -// -// Advanced Settings Menus -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "../../module/planner.h" - -#if DISABLED(NO_VOLUMETRICS) - #include "../../gcode/parser.h" -#endif - -#if HAS_BED_PROBE - #include "../../module/probe.h" -#endif - -#if ENABLED(PIDTEMP) - #include "../../module/temperature.h" -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM - #include "../../feature/runout.h" - float lcd_runout_distance_mm; -#endif - -#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - #include "../../module/configuration_store.h" -#endif - -void menu_tmc(); -void menu_backlash(); -void menu_cancelobject(); - -#if ENABLED(DAC_STEPPER_CURRENT) - - #include "../../feature/dac/stepper_dac.h" - - void menu_dac() { - static xyze_uint8_t driverPercent; - LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_DAC_PERCENT(A) EDIT_ITEM_P(uint8, PSTR(MSG_##A " " MSG_DAC_PERCENT), &driverPercent[_AXIS(A)], 0, 100, []{ dac_current_set_percents(driverPercent); }) - EDIT_DAC_PERCENT(X); - EDIT_DAC_PERCENT(Y); - EDIT_DAC_PERCENT(Z); - EDIT_DAC_PERCENT(E); - ACTION_ITEM(MSG_DAC_EEPROM_WRITE, dac_commit_eeprom); - END_MENU(); - } - -#endif - -#if HAS_MOTOR_CURRENT_PWM - - #include "../../module/stepper.h" - - void menu_pwm() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - EDIT_CURRENT_PWM(MSG_X MSG_Y, 0); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - EDIT_CURRENT_PWM(MSG_Z, 1); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - EDIT_CURRENT_PWM(MSG_E, 2); - #endif - END_MENU(); - } - -#endif - -#if ENABLED(SD_FIRMWARE_UPDATE) - #include "../../module/configuration_store.h" -#endif - -#if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - // - // Advanced Settings > Filament - // - void menu_advanced_filament() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - - #if ENABLED(LIN_ADVANCE) - #if EXTRUDERS == 1 - EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); - #elif EXTRUDERS > 1 - #define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999) - for (uint8_t n = 0; n < EXTRUDERS; n++) - EDIT_ADVANCE_K(n); - #endif - #endif - - #if DISABLED(NO_VOLUMETRICS) - EDIT_ITEM(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); - - if (parser.volumetric_enabled) { - #if EXTRUDERS == 1 - EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #elif EXTRUDERS > 1 - #define EDIT_FIL_DIAM(N) EDIT_ITEM_FAST_N(float43, N, MSG_FILAMENT_DIAM_E, &planner.filament_size[N], 1.5f, 3.25f, planner.calculate_volumetric_multipliers) - EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_DIAM(n); - #endif - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - constexpr float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; - - #if EXTRUDERS == 1 - EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); - #elif EXTRUDERS > 1 - #define EDIT_FIL_UNLOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTUNLOAD_E, &fc_settings[N].unload_length, 0, extrude_maxlength) - EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); - for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_UNLOAD(n); - #endif - - #if EXTRUDERS == 1 - EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); - #elif EXTRUDERS > 1 - #define EDIT_FIL_LOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTLOAD_E, &fc_settings[N].load_length, 0, extrude_maxlength) - EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); - for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_LOAD(n); - #endif - #endif - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM - EDIT_ITEM(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ - runout.set_runout_distance(lcd_runout_distance_mm); - }); - #endif - - END_MENU(); - } - -#endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE - -// -// Advanced Settings > Temperature helpers -// - -#if ENABLED(PID_AUTOTUNE_MENU) - - #if ENABLED(PIDTEMP) - int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); - #endif - - #if ENABLED(PIDTEMPBED) - int16_t autotune_temp_bed = 70; - #endif - - void _lcd_autotune(const int16_t e) { - char cmd[30]; - sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, - #if HAS_PID_FOR_BOTH - e < 0 ? autotune_temp_bed : autotune_temp[e] - #elif ENABLED(PIDTEMPBED) - autotune_temp_bed - #else - autotune_temp[e] - #endif - ); - lcd_enqueue_one_now(cmd); - } - -#endif // PID_AUTOTUNE_MENU - -#if ENABLED(PID_EDIT_MENU) - - float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits - - // Helpers for editing PID Ki & Kd values - // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); - } - void copy_and_scalePID_d(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); - } - - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); } - -#else - - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) // - -#endif - -#if ENABLED(PID_AUTOTUNE_MENU) - #define DEFINE_PIDTEMP_FUNCS(N) \ - _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E##N() { _lcd_autotune(N); } // -#else - #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); // -#endif - -#if HOTENDS - DEFINE_PIDTEMP_FUNCS(0); - #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) - DEFINE_PIDTEMP_FUNCS(1); - #if HOTENDS > 2 - DEFINE_PIDTEMP_FUNCS(2); - #if HOTENDS > 3 - DEFINE_PIDTEMP_FUNCS(3); - #if HOTENDS > 4 - DEFINE_PIDTEMP_FUNCS(4); - #if HOTENDS > 5 - DEFINE_PIDTEMP_FUNCS(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 && PID_PARAMS_PER_HOTEND -#endif // HOTENDS - -#define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)) - -// -// Advanced Settings > Temperature -// -#if SHOW_MENU_ADVANCED_TEMPERATURE - - void menu_advanced_temperature() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - // - // Autotemp, Min, Max, Fact - // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND - EDIT_ITEM(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - EDIT_ITEM(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); - EDIT_ITEM(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); - EDIT_ITEM(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 10); - #endif - - // - // PID-P, PID-I, PID-D, PID-C, PID Autotune - // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 - // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 - // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 - // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 - // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 - // - - #if ENABLED(PID_EDIT_MENU) - #define __PID_BASE_MENU_ITEMS(N) \ - raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \ - raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \ - EDIT_ITEM_N(float52sign, N, MSG_PID_P_E, &PID_PARAM(Kp, N), 1, 9990); \ - EDIT_ITEM_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \ - EDIT_ITEM_N(float52sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); }) - - #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_BASE_MENU_ITEMS(N) \ - __PID_BASE_MENU_ITEMS(N); \ - EDIT_ITEM_N(float3, N, MSG_PID_C_E, &PID_PARAM(Kc, N), 1, 9990) - #else - #define _PID_BASE_MENU_ITEMS(N) __PID_BASE_MENU_ITEMS(N) - #endif - - #if ENABLED(PID_FAN_SCALING) - #define _PID_EDIT_MENU_ITEMS(N) \ - _PID_BASE_MENU_ITEMS(N); \ - EDIT_ITEM(float3, PID_LABEL(MSG_PID_F,N), &PID_PARAM(Kf, N), 1, 9990) - #else - #define _PID_EDIT_MENU_ITEMS(N) _PID_BASE_MENU_ITEMS(N) - #endif - - #else - - #define _PID_EDIT_MENU_ITEMS(N) NOOP - - #endif - - #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_EDIT_MENU_ITEMS(N) \ - _PID_EDIT_MENU_ITEMS(N); \ - EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, heater_maxtemp[N] - 15, []{ _lcd_autotune(MenuItemBase::itemIndex); }) - #else - #define PID_EDIT_MENU_ITEMS(N) _PID_EDIT_MENU_ITEMS(N) - #endif - - PID_EDIT_MENU_ITEMS(0); - #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) - PID_EDIT_MENU_ITEMS(1); - #if HOTENDS > 2 - PID_EDIT_MENU_ITEMS(2); - #if HOTENDS > 3 - PID_EDIT_MENU_ITEMS(3); - #if HOTENDS > 4 - PID_EDIT_MENU_ITEMS(4); - #if HOTENDS > 5 - PID_EDIT_MENU_ITEMS(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 && PID_PARAMS_PER_HOTEND - - END_MENU(); - } - -#endif // SHOW_MENU_ADVANCED_TEMPERATURE - -#if DISABLED(SLIM_LCD_MENUS) - - #if ENABLED(DISTINCT_E_FACTORS) - inline void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) planner.reset_acceleration_rates(); } - inline void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - planner.refresh_positioning(); - else - planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; - } - #endif - - // M203 / M205 Velocity options - void menu_advanced_velocity() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - - // M203 Max Feedrate - constexpr xyze_feedrate_t max_fr_edit = - #ifdef MAX_FEEDRATE_EDIT_VALUES - MAX_FEEDRATE_EDIT_VALUES - #elif ENABLED(LIMITED_MAX_FR_EDITING) - DEFAULT_MAX_FEEDRATE - #else - { 999, 999, 999, 999 } - #endif - ; - #if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES) - const xyze_feedrate_t max_fr_edit_scaled = max_fr_edit * 2; - #else - const xyze_feedrate_t &max_fr_edit_scaled = max_fr_edit; - #endif - #define EDIT_VMAX(N) EDIT_ITEM_FAST(float3, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) - EDIT_VMAX(A); - EDIT_VMAX(B); - EDIT_VMAX(C); - - #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_VMAX_E(N) EDIT_ITEM_FAST_N(float3, N, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], 1, max_fr_edit_scaled.e) - EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); - for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_VMAX_E(n); - #elif E_STEPPERS - EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, max_fr_edit_scaled.e); - #endif - - // M205 S Min Feedrate - EDIT_ITEM_FAST(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); - - // M205 T Min Travel Feedrate - EDIT_ITEM_FAST(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); - - END_MENU(); - } - - // M201 / M204 Accelerations - void menu_advanced_acceleration() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - - static float max_accel = _MAX(planner.settings.max_acceleration_mm_per_s2[A_AXIS], planner.settings.max_acceleration_mm_per_s2[B_AXIS], planner.settings.max_acceleration_mm_per_s2[C_AXIS]); - // M204 P Acceleration - EDIT_ITEM_FAST(float5_25, MSG_ACC, &planner.settings.acceleration, 25, max_accel); - - // M204 R Retract Acceleration - EDIT_ITEM_FAST(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, max_accel); - - // M204 T Travel Acceleration - EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel); - - // M201 settings - constexpr xyze_ulong_t max_accel_edit = - #ifdef MAX_ACCEL_EDIT_VALUES - MAX_ACCEL_EDIT_VALUES - #elif ENABLED(LIMITED_MAX_ACCEL_EDITING) - DEFAULT_MAX_ACCELERATION - #else - { 99000, 99000, 99000, 99000 } - #endif - ; - #if ENABLED(LIMITED_MAX_ACCEL_EDITING) && !defined(MAX_ACCEL_EDIT_VALUES) - const xyze_ulong_t max_accel_edit_scaled = max_accel_edit * 2; - #else - const xyze_ulong_t &max_accel_edit_scaled = max_accel_edit; - #endif - - #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST(long5_25, MSG_AMAX_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); }) - - EDIT_AMAX(A,100); - EDIT_AMAX(B,100); - EDIT_AMAX(C, 10); - - #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_AMAX_E(N) EDIT_ITEM_FAST_N(long5_25, N, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); }) - EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); - for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_AMAX_E(n); - #elif E_STEPPERS - EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); - #endif - - END_MENU(); - } - - // M205 Jerk - void menu_advanced_jerk() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - - #if DISABLED(CLASSIC_JERK) - #if ENABLED(LIN_ADVANCE) - EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk); - #else - EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.5f); - #endif - #endif - #if HAS_CLASSIC_JERK - constexpr xyze_float_t max_jerk_edit = - #ifdef MAX_ACCEL_EDIT_VALUES - MAX_JERK_EDIT_VALUES - #elif ENABLED(LIMITED_JERK_EDITING) - { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } - #else - { 990, 990, 990, 990 } - #endif - ; - #define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)]) - EDIT_JERK(A); - EDIT_JERK(B); - #if ENABLED(DELTA) - EDIT_JERK(C); - #else - EDIT_ITEM_FAST(float52sign, MSG_VC_JERK, &planner.max_jerk.c, 0.1f, max_jerk_edit.c); - #endif - #if HAS_CLASSIC_E_JERK - EDIT_ITEM_FAST(float52sign, MSG_VE_JERK, &planner.max_jerk.e, 0.1f, max_jerk_edit.e); - #endif - #endif - - END_MENU(); - } - - // M92 Steps-per-mm - void menu_advanced_steps_per_mm() { - START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); - - #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) - EDIT_QSTEPS(A); - EDIT_QSTEPS(B); - EDIT_QSTEPS(C); - - #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_ESTEPS(N) EDIT_ITEM_FAST_N(float51, N, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(N)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); }) - EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); }); - for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ESTEPS(n); - #elif E_STEPPERS - EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); - #endif - - END_MENU(); - } - -#endif // !SLIM_LCD_MENUS - -void menu_advanced_settings() { - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM - lcd_runout_distance_mm = runout.runout_distance(); - #endif - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - - #if DISABLED(SLIM_LCD_MENUS) - - #if HAS_M206_COMMAND - // - // Set Home Offsets - // - ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject_P(PSTR("M428")); ui.return_to_status(); }); - #endif - - // M203 / M205 - Feedrate items - SUBMENU(MSG_VELOCITY, menu_advanced_velocity); - - // M201 - Acceleration items - SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration); - - // M205 - Max Jerk - SUBMENU(MSG_JERK, menu_advanced_jerk); - - if (!printer_busy()) { - // M92 - Steps Per mm - SUBMENU(MSG_STEPS_PER_MM, menu_advanced_steps_per_mm); - } - #endif // !SLIM_LCD_MENUS - - #if ENABLED(BACKLASH_GCODE) - SUBMENU(MSG_BACKLASH, menu_backlash); - #endif - - #if ENABLED(CANCEL_OBJECTS) - SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); }); - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - SUBMENU(MSG_DRIVE_STRENGTH, menu_dac); - #endif - #if HAS_MOTOR_CURRENT_PWM - SUBMENU(MSG_DRIVE_STRENGTH, menu_pwm); - #endif - - #if HAS_TRINAMIC - SUBMENU(MSG_TMC_DRIVERS, menu_tmc); - #endif - - #if SHOW_MENU_ADVANCED_TEMPERATURE - SUBMENU(MSG_TEMPERATURE, menu_advanced_temperature); - #endif - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - SUBMENU(MSG_FILAMENT, menu_advanced_filament); - #elif ENABLED(LIN_ADVANCE) - #if EXTRUDERS == 1 - EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); - #elif EXTRUDERS > 1 - #define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999) - for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ADVANCE_K(n); - #endif - #endif - - // M540 S - Abort on endstop hit when SD printing - #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - EDIT_ITEM(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); - #endif - - #if ENABLED(SD_FIRMWARE_UPDATE) - bool sd_update_state = settings.sd_update_status(); - EDIT_ITEM(bool, MSG_MEDIA_UPDATE, &sd_update_state, []{ - // - // Toggle the SD Firmware Update state in EEPROM - // - const bool new_state = !settings.sd_update_status(), - didset = settings.set_sd_update_status(new_state); - #if HAS_BUZZER - ui.completion_feedback(didset); - #endif - ui.return_to_status(); - if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status(); - }); - #endif - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - CONFIRM_ITEM(MSG_INIT_EEPROM, - MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, - []{ - const bool inited = settings.init_eeprom(); - #if HAS_BUZZER - ui.completion_feedback(inited); - #endif - UNUSED(inited); - }, - ui.goto_previous_screen, - GET_TEXT(MSG_INIT_EEPROM), (PGM_P)nullptr, PSTR("?") - ); - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_backlash.cpp deleted file mode 100644 index cc0b3a2c99..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_backlash.cpp +++ /dev/null @@ -1,53 +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 . - * - */ - -// -// Backlash Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(BACKLASH_GCODE) - -#include "menu.h" - -#include "../../feature/backlash.h" - -void menu_backlash() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on); - - #define EDIT_BACKLASH_DISTANCE(N) EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f); - EDIT_BACKLASH_DISTANCE(A); - EDIT_BACKLASH_DISTANCE(B); - EDIT_BACKLASH_DISTANCE(C); - - #ifdef BACKLASH_SMOOTHING_MM - EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f); - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU && BACKLASH_COMPENSATION diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_corners.cpp deleted file mode 100644 index a7fffb1e02..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ /dev/null @@ -1,131 +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 . - * - */ - -// -// Level Bed Corners menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(LEVEL_BED_CORNERS) - -#include "menu.h" -#include "../../module/motion.h" -#include "../../module/planner.h" - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#ifndef LEVEL_CORNERS_Z_HOP - #define LEVEL_CORNERS_Z_HOP 4.0 -#endif - -#ifndef LEVEL_CORNERS_HEIGHT - #define LEVEL_CORNERS_HEIGHT 0.0 -#endif - -static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); - -#if HAS_LEVELING - static bool leveling_was_active = false; -#endif - -/** - * Level corners, starting in the front-left corner. - */ -static int8_t bed_corner; -static inline void _lcd_goto_next_corner() { - line_to_z(LEVEL_CORNERS_Z_HOP); - switch (bed_corner) { - case 0: - current_position.set(X_MIN_BED + LEVEL_CORNERS_INSET, Y_MIN_BED + LEVEL_CORNERS_INSET); - break; - case 1: - current_position.x = X_MAX_BED - (LEVEL_CORNERS_INSET); - break; - case 2: - current_position.y = Y_MAX_BED - (LEVEL_CORNERS_INSET); - break; - case 3: - current_position.x = X_MIN_BED + LEVEL_CORNERS_INSET; - break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: - current_position.set(X_CENTER, Y_CENTER); - break; - #endif - } - line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.x)); - line_to_z(LEVEL_CORNERS_HEIGHT); - if (++bed_corner > 3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - ) bed_corner = 0; -} - -static inline void _lcd_level_bed_corners_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) { - bed_corner = 0; - ui.goto_screen([]{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE), - _lcd_goto_next_corner, - []{ - #if HAS_LEVELING - set_bed_leveling_enabled(leveling_was_active); - #endif - ui.goto_previous_screen_no_defer(); - }, - GET_TEXT( - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - ), (PGM_P)nullptr, PSTR("?") - ); - }); - ui.set_selection(true); - _lcd_goto_next_corner(); - } -} - -void _lcd_level_bed_corners() { - ui.defer_status_screen(); - if (!all_axes_known()) { - set_all_unhomed(); - queue.inject_P(G28_STR); - } - - // Disable leveling so the planner won't mess with us - #if HAS_LEVELING - leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif - - ui.goto_screen(_lcd_level_bed_corners_homing); -} - -#endif // HAS_LCD_MENU && LEVEL_BED_CORNERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_leveling.cpp deleted file mode 100644 index f4fbf59a42..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ /dev/null @@ -1,298 +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 . - * - */ - -// -// Bed Leveling Menus -// - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(LCD_BED_LEVELING) - -#include "menu.h" -#include "../../module/planner.h" -#include "../../feature/bedlevel/bedlevel.h" - -#if HAS_BED_PROBE && DISABLED(BABYSTEP_ZPROBE_OFFSET) - #include "../../module/probe.h" -#endif - -#if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) - - #include "../../module/motion.h" - #include "../../gcode/queue.h" - - // - // Motion > Level Bed handlers - // - - static uint8_t manual_probe_index; - - // LCD probed points are from defaults - constexpr uint8_t total_probe_points = ( - #if ENABLED(AUTO_BED_LEVELING_3POINT) - 3 - #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) - GRID_MAX_POINTS - #endif - ); - - bool MarlinUI::wait_for_bl_move; // = false - - // - // Bed leveling is done. Wait for G29 to complete. - // A flag is used so that this can release control - // and allow the command queue to be processed. - // - // When G29 finishes the last move: - // - Raise Z to the "manual probe height" - // - Don't return until done. - // - // ** This blocks the command queue! ** - // - void _lcd_level_bed_done() { - if (!ui.wait_for_bl_move) { - #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) - // Display "Done" screen and wait for moves to complete - line_to_z(MANUAL_PROBE_HEIGHT); - ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); - #endif - ui.goto_previous_screen_no_defer(); - #if HAS_BUZZER - ui.completion_feedback(); - #endif - } - if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - } - - void _lcd_level_goto_next_point(); - - // - // Step 7: Get the Z coordinate, click goes to the next point or exits - // - void _lcd_level_bed_get_z() { - - if (ui.use_click()) { - - // - // Save the current Z position and move - // - - // If done... - if (++manual_probe_index >= total_probe_points) { - // - // The last G29 records the point and enables bed leveling - // - ui.wait_for_bl_move = true; - ui.goto_screen(_lcd_level_bed_done); - #if ENABLED(MESH_BED_LEVELING) - queue.inject_P(PSTR("G29 S2")); - #elif ENABLED(PROBE_MANUALLY) - queue.inject_P(PSTR("G29 V1")); - #endif - } - else - _lcd_level_goto_next_point(); - - return; - } - - // - // Encoder knob or keypad buttons adjust the Z position - // - if (ui.encoderPosition) { - const float z = current_position.z + float(int32_t(ui.encoderPosition)) * (MESH_EDIT_Z_STEP); - line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - ui.encoderPosition = 0; - } - - // - // Draw on first display, then only on Z change - // - if (ui.should_draw()) { - const float v = current_position.z; - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); - } - } - - // - // Step 6: Display "Next point: 1 / 9" while waiting for move to finish - // - void _lcd_level_bed_moving() { - if (ui.should_draw()) { - char msg[10]; - sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points); - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); - } - ui.refresh(LCDVIEW_CALL_NO_REDRAW); - if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z); - } - - // - // Step 5: Initiate a move to the next point - // - void _lcd_level_goto_next_point() { - ui.goto_screen(_lcd_level_bed_moving); - - // G29 Records Z, moves, and signals when it pauses - ui.wait_for_bl_move = true; - #if ENABLED(MESH_BED_LEVELING) - queue.inject_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); - #elif ENABLED(PROBE_MANUALLY) - queue.inject_P(PSTR("G29 V1")); - #endif - } - - // - // Step 4: Display "Click to Begin", wait for click - // Move to the first probe position - // - void _lcd_level_bed_homing_done() { - if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); - if (ui.use_click()) { - manual_probe_index = 0; - _lcd_level_goto_next_point(); - } - } - - // - // Step 3: Display "Homing XYZ" - Wait for homing to finish - // - void _lcd_level_bed_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) ui.goto_screen(_lcd_level_bed_homing_done); - } - - #if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; - #endif - - // - // Step 2: Continue Bed Leveling... - // - void _lcd_level_bed_continue() { - ui.defer_status_screen(); - set_all_unhomed(); - ui.goto_screen(_lcd_level_bed_homing); - queue.inject_P(G28_STR); - } - -#endif // PROBE_MANUALLY || MESH_BED_LEVELING - -#if ENABLED(MESH_EDIT_MENU) - - inline void refresh_planner() { - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); - } - - void menu_edit_mesh() { - static uint8_t xind, yind; // =0 - START_MENU(); - BACK_ITEM(MSG_BED_LEVELING); - EDIT_ITEM(uint8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1); - EDIT_ITEM(uint8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1); - EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner); - END_MENU(); - } - -#endif // MESH_EDIT_MENU - -/** - * Step 1: Bed Level entry-point - * - * << Motion - * Auto Home (if homing needed) - * Leveling On/Off (if data exists, and homed) - * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) - * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) - * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) - * Level Bed > - * Level Corners > (if homed) - * Load Settings (Req: EEPROM_SETTINGS) - * Save Settings (Req: EEPROM_SETTINGS) - */ -void menu_bed_leveling() { - START_MENU(); - BACK_ITEM(MSG_MOTION); - - const bool is_homed = all_axes_known(); - - // Auto Home if not using manual probing - #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING) - if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR); - #endif - - // Level Bed - #if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) - // Manual leveling uses a guided procedure - SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue); - #else - // Automatic leveling can just run the G-code - GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); - #endif - - #if ENABLED(MESH_EDIT_MENU) - if (leveling_is_valid()) - SUBMENU(MSG_EDIT_MESH, menu_edit_mesh); - #endif - - // Homed and leveling is valid? Then leveling can be toggled. - if (is_homed && leveling_is_valid()) { - bool show_state = planner.leveling_active; - EDIT_ITEM(bool, MSG_BED_LEVELING, &show_state, _lcd_toggle_bed_leveling); - } - - // Z Fade Height - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - editable.decimal = planner.z_fade_height; - EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); - #endif - - // - // Mesh Bed Leveling Z-Offset - // - #if ENABLED(MESH_BED_LEVELING) - EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #elif HAS_BED_PROBE - EDIT_ITEM(float52, MSG_ZPROBE_ZOFFSET, &probe_offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - SUBMENU(MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); -} - -#endif // LCD_BED_LEVELING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_cancelobject.cpp deleted file mode 100644 index 162578a0c4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ /dev/null @@ -1,74 +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 . - * - */ - -// -// Cancel Object Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS) - -#include "menu.h" -#include "menu_addon.h" - -#include "../../feature/cancel_object.h" - -static void lcd_cancel_object_confirm() { - const int8_t v = MenuItemBase::itemIndex; - const char item_num[] = { - ' ', - char((v > 9) ? '0' + (v / 10) : ' '), - char('0' + (v % 10)), - '\0' - }; - MenuItem_confirm::confirm_screen( - []{ - cancelable.cancel_object(MenuItemBase::itemIndex - 1); - #if HAS_BUZZER - ui.completion_feedback(); - #endif - ui.goto_previous_screen(); - }, - ui.goto_previous_screen, - GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?") - ); -} - -void menu_cancelobject() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - // Draw cancelable items in a loop - int8_t a = cancelable.active_object; - for (int8_t i = -1; i < cancelable.object_count; i++) { - if (i == a) continue; - int8_t j = i < 0 ? a : i; - if (!cancelable.is_canceled(j)) - SUBMENU_N(j, MSG_CANCEL_OBJECT_N, lcd_cancel_object_confirm); - if (i < 0) SKIP_ITEM(); - } - - END_MENU(); -} - -#endif // HAS_LCD_MENU && CANCEL_OBJECTS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_configuration.cpp deleted file mode 100644 index 5199f90ea0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_configuration.cpp +++ /dev/null @@ -1,406 +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 . - * - */ - -// -// Configuration Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" - -#include "../../module/configuration_store.h" - -#if HAS_FILAMENT_SENSOR - #include "../../feature/runout.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../../feature/power_loss_recovery.h" -#endif - -#if HAS_BED_PROBE - #include "../../module/probe.h" - #if ENABLED(BLTOUCH) - #include "../../feature/bltouch.h" - #endif -#endif - -#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) - -void menu_advanced_settings(); -#if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) - void menu_delta_calibrate(); -#endif - -#if ENABLED(LCD_PROGRESS_BAR_TEST) - - #include "../lcdprint.h" - - static void progress_bar_test() { - static int8_t bar_percent = 0; - if (ui.use_click()) { - ui.goto_previous_screen(); - ui.set_custom_characters(CHARSET_MENU); - return; - } - bar_percent += (int8_t)ui.encoderPosition; - LIMIT(bar_percent, 0, 100); - ui.encoderPosition = 0; - MenuItem_static::draw(0, GET_TEXT(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); - } - - void _progress_bar_test() { - ui.goto_screen(progress_bar_test); - ui.set_custom_characters(CHARSET_INFO); - } - -#endif // LCD_PROGRESS_BAR_TEST - -#if HAS_DEBUG_MENU - - void menu_debug() { - START_MENU(); - - BACK_ITEM(MSG_CONFIGURATION); - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - SUBMENU(MSG_PROGRESS_BAR_TEST, _progress_bar_test); - #endif - - END_MENU(); - } - -#endif - -#if EXTRUDERS > 1 - - #include "../../module/tool_change.h" - - void menu_tool_change() { - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - static constexpr float max_extrude = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 500 - #endif - ; - EDIT_ITEM(float3, MSG_FILAMENT_SWAP_LENGTH, &toolchange_settings.swap_length, 0, max_extrude); - EDIT_ITEM(float3, MSG_FILAMENT_PURGE_LENGTH, &toolchange_settings.extra_prime, 0, max_extrude); - EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_RETRACT_SPD, &toolchange_settings.retract_speed, 10, 5400); - EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPD, &toolchange_settings.prime_speed, 10, 5400); - #endif - EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); - END_MENU(); - } - -#endif - -#if HAS_HOTEND_OFFSET - #include "../../module/motion.h" - #include "../../gcode/queue.h" - - void menu_tool_offsets() { - - auto _recalc_offsets = []{ - if (active_extruder && all_axes_known()) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. - queue.inject_P(G28_STR); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. - active_extruder = 0; - } - }; - - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - #if ENABLED(DUAL_X_CARRIAGE) - EDIT_ITEM_FAST(float51, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets); - #else - EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets); - #endif - EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets); - EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_Z, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets); - #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } -#endif - -#if ENABLED(DUAL_X_CARRIAGE) - - void menu_idex() { - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - - GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); - const bool need_g28 = !(TEST(axis_known_position, Y_AXIS) && TEST(axis_known_position, Z_AXIS)); - GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28 - ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first - : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100") - ); - GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28 - ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first - : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") - ); - GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); - END_MENU(); - } - -#endif - -#if ENABLED(BLTOUCH) - - #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) - void bltouch_report() { - SERIAL_ECHOLNPAIR("EEPROM Last BLTouch Mode - ", (int)bltouch.last_written_mode); - SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " - #if ENABLED(BLTOUCH_SET_5V_MODE) - "5V" - #else - "OD" - #endif - ); - char mess[21]; - strcpy_P(mess, PSTR("BLTouch Mode - ")); - strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD")); - ui.set_status(mess); - ui.return_to_status(); - } - #endif - - void menu_bltouch() { - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - ACTION_ITEM(MSG_BLTOUCH_RESET, bltouch._reset); - ACTION_ITEM(MSG_BLTOUCH_SELFTEST, bltouch._selftest); - ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy); - ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow); - ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode); - #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) - CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report); - #endif - END_MENU(); - } - -#endif - -#if ENABLED(TOUCH_MI_PROBE) - void menu_touchmi() { - START_MENU(); - ui.defer_status_screen(); - BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); - SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10")); - GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); - END_MENU(); - } -#endif - -#if ENABLED(CASE_LIGHT_MENU) - - #include "../../feature/caselight.h" - - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - - void menu_case_light() { - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); - EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - END_MENU(); - } - - #endif - -#endif - -#if ENABLED(FWRETRACT) - - #include "../../feature/fwretract.h" - - void menu_config_retract() { - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - #if ENABLED(FWRETRACT_AUTORETRACT) - EDIT_ITEM(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); - #endif - EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); - #if EXTRUDERS > 1 - EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); - #endif - EDIT_ITEM(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); - EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999); - EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_extra, -100, 100); - #if EXTRUDERS > 1 - EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_extra, -100, 100); - #endif - EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); - #if EXTRUDERS > 1 - EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); - #endif - END_MENU(); - } - -#endif - -#if DISABLED(SLIM_LCD_MENUS) - - void _menu_configuration_preheat_settings(const uint8_t material) { - #define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP, - #define _MAXTEMP_ITEM(N) HEATER_##N##_MAXTEMP, - #define MINTEMP_ALL _MIN(REPEAT(HOTENDS, _MINTEMP_ITEM) 999) - #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0) - START_MENU(); - BACK_ITEM(MSG_CONFIGURATION); - EDIT_ITEM(percent, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); - #if HAS_TEMP_HOTEND - EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); - #endif - #if HAS_HEATED_BED - EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 10); - #endif - #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - void menu_preheat_material1_settings() { _menu_configuration_preheat_settings(0); } - void menu_preheat_material2_settings() { _menu_configuration_preheat_settings(1); } - -#endif - -void menu_configuration() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - // - // Debug Menu when certain options are enabled - // - #if HAS_DEBUG_MENU - SUBMENU(MSG_DEBUG_MENU, menu_debug); - #endif - - SUBMENU(MSG_ADVANCED_SETTINGS, menu_advanced_settings); - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #elif HAS_BED_PROBE - EDIT_ITEM(float52, MSG_ZPROBE_ZOFFSET, &probe_offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - - const bool busy = printer_busy(); - if (!busy) { - // - // Delta Calibration - // - #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) - SUBMENU(MSG_DELTA_CALIBRATE, menu_delta_calibrate); - #endif - - #if HAS_HOTEND_OFFSET - SUBMENU(MSG_OFFSETS_MENU, menu_tool_offsets); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - SUBMENU(MSG_IDEX_MENU, menu_idex); - #endif - - #if ENABLED(BLTOUCH) - SUBMENU(MSG_BLTOUCH, menu_bltouch); - #endif - - #if ENABLED(TOUCH_MI_PROBE) - SUBMENU(MSG_TOUCHMI_PROBE, menu_touchmi); - #endif - } - - // - // Set single nozzle filament retract and prime length - // - #if EXTRUDERS > 1 - SUBMENU(MSG_TOOL_CHANGE, menu_tool_change); - #endif - - // - // Set Case light on/off/brightness - // - #if ENABLED(CASE_LIGHT_MENU) - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) - if (PWM_PIN(CASE_LIGHT_PIN)) - SUBMENU(MSG_CASE_LIGHT, menu_case_light); - else - #endif - EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - #endif - - #if HAS_LCD_CONTRAST - EDIT_ITEM(int3, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); - #endif - #if ENABLED(FWRETRACT) - SUBMENU(MSG_RETRACT, menu_config_retract); - #endif - - #if HAS_FILAMENT_SENSOR - EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); - #endif - - #if DISABLED(SLIM_LCD_MENUS) - // Preheat configurations - SUBMENU(MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings); - SUBMENU(MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings); - #endif - - #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - if (!busy) - ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); - #endif - - if (!busy) - ACTION_ITEM(MSG_RESTORE_FAILSAFE, []{ - settings.reset(); - #if HAS_BUZZER - ui.completion_feedback(); - #endif - }); - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_custom.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_custom.cpp deleted file mode 100644 index f6178133be..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_custom.cpp +++ /dev/null @@ -1,71 +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 . - * - */ - -// -// Custom User Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(CUSTOM_USER_MENUS) - -#include "menu.h" -#include "../../gcode/queue.h" - -#ifdef USER_SCRIPT_DONE - #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE -#else - #define _DONE_SCRIPT "" -#endif - -void _lcd_user_gcode(PGM_P const cmd) { - queue.inject_P(cmd); - #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) && HAS_BUZZER - ui.completion_feedback(); - #endif - #if ENABLED(USER_SCRIPT_RETURN) - ui.return_to_status(); - #endif -} - -void menu_user() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - ACTION_ITEM_P(PSTR(USER_DESC_1), []{ _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); }); - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - ACTION_ITEM_P(PSTR(USER_DESC_2), []{ _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); }); - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - ACTION_ITEM_P(PSTR(USER_DESC_3), []{ _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); }); - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - ACTION_ITEM_P(PSTR(USER_DESC_4), []{ _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); }); - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - ACTION_ITEM_P(PSTR(USER_DESC_5), []{ _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); }); - #endif - END_MENU(); -} - -#endif // HAS_LCD_MENU && CUSTOM_USER_MENUS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_delta_calibrate.cpp deleted file mode 100644 index 75c427bafa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ /dev/null @@ -1,151 +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 . - * - */ - -// -// Delta Calibrate Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) - -#include "menu.h" -#include "../../module/delta.h" -#include "../../module/motion.h" - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - -void _man_probe_pt(const xy_pos_t &xy) { - do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES); - ui.synchronize(); - move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - ui.goto_screen(lcd_move_z); -} - -#if ENABLED(DELTA_AUTO_CALIBRATION) - - #include "../../gcode/gcode.h" - - #if ENABLED(HOST_PROMPT_SUPPORT) - #include "../../feature/host_actions.h" // for host_prompt_do - #endif - - float lcd_probe_pt(const xy_pos_t &xy) { - _man_probe_pt(xy); - KEEPALIVE_STATE(PAUSED_FOR_USER); - ui.defer_status_screen(); - wait_for_user = true; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")); - #endif - while (wait_for_user) idle(); - ui.goto_previous_screen_no_defer(); - return current_position.z; - } - -#endif - -#if ENABLED(DELTA_CALIBRATION_MENU) - - #include "../../gcode/queue.h" - - void _lcd_calibrate_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) ui.goto_previous_screen(); - } - - void _lcd_delta_calibrate_home() { - queue.inject_P(G28_STR); - ui.goto_screen(_lcd_calibrate_homing); - } - - void _goto_tower_a(const float &a) { - xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) }; - _man_probe_pt(tower_vec * delta_calibration_radius()); - } - void _goto_tower_x() { _goto_tower_a(210); } - void _goto_tower_y() { _goto_tower_a(330); } - void _goto_tower_z() { _goto_tower_a( 90); } - void _goto_center() { xy_pos_t ctr{0}; _man_probe_pt(ctr); } - -#endif - -void lcd_delta_settings() { - auto _recalc_delta_settings = []() { - #if HAS_LEVELING - reset_bed_level(); // After changing kinematics bed-level data is no longer valid - #endif - recalc_delta_settings(); - }; - START_MENU(); - BACK_ITEM(MSG_DELTA_CALIBRATE); - EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 5, _recalc_delta_settings) - EDIT_ENDSTOP_ADJ("Ex", a); - EDIT_ENDSTOP_ADJ("Ey", b); - EDIT_ENDSTOP_ADJ("Ez", c); - EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) - EDIT_ANGLE_TRIM("Tx", a); - EDIT_ANGLE_TRIM("Ty", b); - EDIT_ANGLE_TRIM("Tz", c); - EDIT_ITEM(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); - END_MENU(); -} - -void menu_delta_calibrate() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - #if ENABLED(DELTA_AUTO_CALIBRATION) - GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); - #if ENABLED(EEPROM_SETTINGS) - ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); - ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); - #endif - #endif - - SUBMENU(MSG_DELTA_SETTINGS, lcd_delta_settings); - - #if ENABLED(DELTA_CALIBRATION_MENU) - SUBMENU(MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { - SUBMENU(MSG_DELTA_CALIBRATE_X, _goto_tower_x); - SUBMENU(MSG_DELTA_CALIBRATE_Y, _goto_tower_y); - SUBMENU(MSG_DELTA_CALIBRATE_Z, _goto_tower_z); - SUBMENU(MSG_DELTA_CALIBRATE_CENTER, _goto_center); - } - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_filament.cpp deleted file mode 100644 index 51f96677fc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_filament.cpp +++ /dev/null @@ -1,319 +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 . - * - */ - -// -// Filament Change Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE) - -#include "menu.h" -#include "../../module/temperature.h" -#include "../../feature/pause.h" -#if HAS_FILAMENT_SENSOR - #include "../../feature/runout.h" -#endif - -// -// Change Filament > Change/Unload/Load Filament -// -static PauseMode _change_filament_temp_mode; // =PAUSE_MODE_PAUSE_PRINT -static int8_t _change_filament_temp_extruder; // =0 - -inline PGM_P _change_filament_temp_command() { - switch (_change_filament_temp_mode) { - case PAUSE_MODE_LOAD_FILAMENT: - return PSTR("M701 T%d"); - case PAUSE_MODE_UNLOAD_FILAMENT: - return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); - case PAUSE_MODE_CHANGE_FILAMENT: - case PAUSE_MODE_PAUSE_PRINT: - default: - return PSTR("M600 B0 T%d"); - } - return GET_TEXT(MSG_FILAMENTCHANGE); -} - -// Initiate Filament Load/Unload/Change at the specified temperature -static void _change_filament_temp(const uint16_t temperature) { - char cmd[11]; - sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); - thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder); - lcd_enqueue_one_now(cmd); -} - -// -// Menu to choose the temperature and start Filament Change -// - -inline PGM_P change_filament_header(const PauseMode mode) { - switch (mode) { - case PAUSE_MODE_LOAD_FILAMENT: - return GET_TEXT(MSG_FILAMENTLOAD); - case PAUSE_MODE_UNLOAD_FILAMENT: - return GET_TEXT(MSG_FILAMENTUNLOAD); - default: break; - } - return GET_TEXT(MSG_FILAMENTCHANGE); -} - -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), SS_CENTER|SS_INVERT); - BACK_ITEM(MSG_BACK); - ACTION_ITEM(MSG_PREHEAT_1, []{ _change_filament_temp(ui.preheat_hotend_temp[0]); }); - ACTION_ITEM(MSG_PREHEAT_2, []{ _change_filament_temp(ui.preheat_hotend_temp[1]); }); - EDIT_ITEM_FAST(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_temp_extruder].target, EXTRUDE_MINTEMP, heater_maxtemp[extruder] - 15, []{ - _change_filament_temp(thermalManager.temp_hotend[_change_filament_temp_extruder].target); - }); - END_MENU(); -} - -/** - * - * "Change Filament" submenu - * - */ -#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void menu_change_filament() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - // Say "filament change" when no print is active - editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT; - - // Change filament - #if E_STEPPERS == 1 - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); - else - GCODES_ITEM_P(msg, PSTR("M600 B0")); - #else - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E); - for (uint8_t s = 0; s < E_STEPPERS; s++) { - if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); - else { - ACTION_ITEM_N_P(s, msg, []{ - char cmd[12]; - sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex)); - lcd_enqueue_one_now(cmd); - }); - } - } - #endif - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!printer_busy()) { - // Load filament - #if E_STEPPERS == 1 - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); - else - GCODES_ITEM_P(msg_load, PSTR("M701")); - #else - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E); - for (uint8_t s = 0; s < E_STEPPERS; s++) { - if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); - else { - ACTION_ITEM_N_P(s, msg_load, []{ - char cmd[12]; - sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex)); - lcd_enqueue_one_now(cmd); - }); - } - } - #endif - - // Unload filament - #if E_STEPPERS == 1 - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); - else - GCODES_ITEM_P(msg_unload, PSTR("M702")); - #else - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - { - bool too_cold = false; - for (uint8_t s = 0; s < E_STEPPERS; s++) { - if (thermalManager.targetTooColdToExtrude(s)) { - too_cold = true; break; - } - } - if (!too_cold) - GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else - SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }); - } - #endif - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E); - for (uint8_t s = 0; s < E_STEPPERS; s++) { - if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); - else { - ACTION_ITEM_N_P(s, msg_unload, []{ - char cmd[12]; - sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex)); - lcd_enqueue_one_now(cmd); - }); - } - } - #endif - } // !printer_busy - #endif - - END_MENU(); - } -#endif - -static uint8_t hotend_status_extruder = 0; - -static PGM_P pause_header() { - switch (pause_mode) { - case PAUSE_MODE_CHANGE_FILAMENT: - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER); - case PAUSE_MODE_LOAD_FILAMENT: - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case PAUSE_MODE_UNLOAD_FILAMENT: - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); - default: break; - } - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE); -} - -// Portions from STATIC_ITEM... -#define HOTEND_STATUS_ITEM() do { \ - if (_menuLineNr == _thisItemNr) { \ - if (ui.should_draw()) { \ - MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT); \ - ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ - } \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); \ - } \ - ++_thisItemNr; \ -}while(0) - -void menu_pause_option() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); - #endif - ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_PURGE, []{ pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; }); - #if HAS_FILAMENT_SENSOR - if (runout.filament_ran_out) - EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); - else - #endif - ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_RESUME, []{ pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; }); - END_MENU(); -} - -// -// ADVANCED_PAUSE_FEATURE message screens -// -// Warning: msg must have three null bytes to delimit lines! -// -void _lcd_pause_message(PGM_P const msg) { - PGM_P const msg1 = msg; - PGM_P const msg2 = msg1 + strlen_P(msg1) + 1; - PGM_P const msg3 = msg2 + strlen_P(msg2) + 1; - const bool has2 = msg2[0], has3 = msg3[0], - skip1 = !has2 && (LCD_HEIGHT) >= 5; - - START_SCREEN(); - STATIC_ITEM_P(pause_header(), SS_CENTER|SS_INVERT); // 1: Header - if (skip1) SKIP_ITEM(); // Move a single-line message down - STATIC_ITEM_P(msg1); // 2: Message Line 1 - if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2 - if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines) - if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed - HOTEND_STATUS_ITEM(); // 5: Hotend Status - END_SCREEN(); -} - -void lcd_pause_pausing_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_INIT)); } -void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); } -void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); } -void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); } -void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); } -void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); } -void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); } -void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); } -void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); } - -void lcd_pause_purge_message() { - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE)); - #else - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); - #endif -} - -FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) { - switch (message) { - case PAUSE_MESSAGE_PAUSING: return lcd_pause_pausing_message; - case PAUSE_MESSAGE_CHANGING: return lcd_pause_changing_message; - case PAUSE_MESSAGE_UNLOAD: return lcd_pause_unload_message; - case PAUSE_MESSAGE_WAITING: return lcd_pause_waiting_message; - case PAUSE_MESSAGE_INSERT: return lcd_pause_insert_message; - case PAUSE_MESSAGE_LOAD: return lcd_pause_load_message; - case PAUSE_MESSAGE_PURGE: return lcd_pause_purge_message; - case PAUSE_MESSAGE_RESUME: return lcd_pause_resume_message; - case PAUSE_MESSAGE_HEAT: return lcd_pause_heat_message; - case PAUSE_MESSAGE_HEATING: return lcd_pause_heating_message; - case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; - return menu_pause_option; - case PAUSE_MESSAGE_STATUS: - default: break; - } - return nullptr; -} - -void lcd_pause_show_message( - const PauseMessage message, - const PauseMode mode/*=PAUSE_MODE_SAME*/, - const uint8_t extruder/*=active_extruder*/ -) { - if (mode != PAUSE_MODE_SAME) pause_mode = mode; - hotend_status_extruder = extruder; - const screenFunc_t next_screen = ap_message_screen(message); - if (next_screen) { - ui.defer_status_screen(); - ui.goto_screen(next_screen); - } - else - ui.return_to_status(); -} - -#endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_game.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_game.cpp deleted file mode 100644 index 4f9748dc12..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_game.cpp +++ /dev/null @@ -1,48 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_GAME_MENU - -#include "menu.h" -#include "game/game.h" - -void menu_game() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - #if ENABLED(MARLIN_BRICKOUT) - SUBMENU(MSG_BRICKOUT, brickout.enter_game); - #endif - #if ENABLED(MARLIN_INVADERS) - SUBMENU(MSG_INVADERS, invaders.enter_game); - #endif - #if ENABLED(MARLIN_SNAKE) - SUBMENU(MSG_SNAKE, snake.enter_game); - #endif - #if ENABLED(MARLIN_MAZE) - SUBMENU(MSG_MAZE, maze.enter_game); - #endif - END_MENU(); -} - -#endif // HAS_GAME_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_info.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_info.cpp deleted file mode 100644 index e7b4dbe7ce..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_info.cpp +++ /dev/null @@ -1,323 +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 . - * - */ - -// -// Info Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU) - -#include "menu.h" - -#if HAS_GAMES - #include "game/game.h" -#endif - -#define VALUE_ITEM(MSG, VALUE, STYL) do{ strcpy_P(buffer, PSTR(": ")); strcpy(buffer + 2, VALUE); STATIC_ITEM(MSG, STYL, buffer); }while(0) -#define VALUE_ITEM_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" - - // - // About Printer > Printer Stats - // - void menu_info_stats() { - if (ui.use_click()) return ui.go_back(); - - char buffer[21]; // For macro usage - - printStatistics stats = print_job_timer.getStats(); - - START_SCREEN(); // 12345678901234567890 - VALUE_ITEM(MSG_INFO_PRINT_COUNT, i16tostr3left(stats.totalPrints), SS_LEFT); // Print Count: 999 - VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666 - - STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s - - STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT); // Longest job time: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s - - STATIC_ITEM(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_P(PSTR("> "), SS_LEFT, buffer); // > 125m - - #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0 - strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN)); - #endif - - #if SERVICE_INTERVAL_1 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s - #endif - - #if SERVICE_INTERVAL_2 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); - #endif - - #if SERVICE_INTERVAL_3 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); - #endif - - END_SCREEN(); - } - -#endif - -// -// About Printer > Thermistors -// -void menu_info_thermistors() { - if (ui.use_click()) return ui.go_back(); - - char buffer[21]; // For macro usage - - START_SCREEN(); - - #if EXTRUDERS - #define THERMISTOR_ID TEMP_SENSOR_0 - #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(LCD_STR_E0 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT); - VALUE_ITEM_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_P(PSTR(LCD_STR_E1 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT); - VALUE_ITEM_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_P(PSTR(LCD_STR_E2 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT); - VALUE_ITEM_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_P(PSTR(LCD_STR_E3 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT); - VALUE_ITEM_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_P(PSTR(LCD_STR_E4 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT); - VALUE_ITEM_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_P(PSTR(LCD_STR_E5 ": " THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT); - VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); - #endif - - #if EXTRUDERS - { - STATIC_ITEM( - #if WATCH_HOTENDS - MSG_INFO_RUNAWAY_ON - #else - MSG_INFO_RUNAWAY_OFF - #endif - , SS_LEFT - ); - } - #endif - - #if HAS_HEATED_BED - { - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_BED - #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("BED:" THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT); - VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT); - STATIC_ITEM( - #if WATCH_BED - MSG_INFO_RUNAWAY_ON - #else - MSG_INFO_RUNAWAY_OFF - #endif - , SS_LEFT - ); - } - #endif - - #if HAS_HEATED_CHAMBER - { - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_CHAMBER - #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("CHAM:" THERMISTOR_NAME), SS_INVERT); - VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT); - VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT); - STATIC_ITEM( - #if WATCH_CHAMBER - MSG_INFO_RUNAWAY_ON - #else - MSG_INFO_RUNAWAY_OFF - #endif - , SS_LEFT - ); - } - #endif - - END_SCREEN(); -} - -// -// About Printer > Board Info -// -void menu_info_board() { - if (ui.use_click()) return ui.go_back(); - - char buffer[21]; // For macro usage - - START_SCREEN(); - STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_CENTER|SS_INVERT); // MyPrinterController - #ifdef BOARD_WEBSITE_URL - STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com - #endif - VALUE_ITEM_P(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 - VALUE_ITEM_P(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 - VALUE_ITEM_P(MSG_INFO_PSU, PSU_NAME, SS_CENTER); - END_SCREEN(); -} - -// -// About Printer > Printer Info -// -#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(); - } - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - void menu_show_custom_bootscreen() { - if (ui.use_click()) { ui.goto_screen(menu_show_marlin_bootscreen); } - ui.draw_custom_bootscreen(); - } - #endif - -#else - - void menu_info_printer() { - if (ui.use_click()) return ui.go_back(); - START_SCREEN(); - STATIC_ITEM_P(PSTR(MSG_MARLIN), SS_CENTER|SS_INVERT); // Marlin - STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION)); // x.x.x-Branch - STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM - STATIC_ITEM_P(PSTR(MACHINE_NAME)); // My3DPrinter - STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com - char buffer[21]; - VALUE_ITEM_P(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // 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 -// -void menu_info() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - #if ENABLED(LCD_PRINTER_INFO_IS_BOOTSCREEN) - SUBMENU(MSG_INFO_PRINTER_MENU, ( - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - menu_show_custom_bootscreen - #else - menu_show_marlin_bootscreen - #endif - )); - #else - SUBMENU(MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > - SUBMENU(MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > - #if EXTRUDERS - SUBMENU(MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > - #endif - #endif - - #if ENABLED(PRINTCOUNTER) - SUBMENU(MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > - #endif - - #if HAS_GAMES - #if ENABLED(GAMES_EASTER_EGG) - SKIP_ITEM(); - SKIP_ITEM(); - SKIP_ITEM(); - #endif - SUBMENU(MSG_GAMES, ( - #if HAS_GAME_MENU - menu_game - #elif ENABLED(MARLIN_BRICKOUT) - brickout.enter_game - #elif ENABLED(MARLIN_INVADERS) - invaders.enter_game - #elif ENABLED(MARLIN_SNAKE) - snake.enter_game - #elif ENABLED(MARLIN_MAZE) - maze.enter_game - #endif - )); - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU && LCD_INFO_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_job_recovery.cpp deleted file mode 100644 index 0b0b040921..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_job_recovery.cpp +++ /dev/null @@ -1,58 +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 . - * - */ - -// -// Job Recovery Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(POWER_LOSS_RECOVERY) - -#include "menu.h" -#include "../../gcode/queue.h" -#include "../../sd/cardreader.h" -#include "../../feature/power_loss_recovery.h" - -static void lcd_power_loss_recovery_resume() { - ui.return_to_status(); - queue.inject_P(PSTR("M1000")); -} - -static void lcd_power_loss_recovery_cancel() { - card.removeJobRecoveryFile(); - card.autostart_index = 0; - ui.return_to_status(); -} - -// TODO: Display long filename with Cancel/Resume buttons -// Requires supporting methods in PLR class. -void menu_job_recovery() { - ui.defer_status_screen(); - START_MENU(); - STATIC_ITEM(MSG_OUTAGE_RECOVERY); - ACTION_ITEM(MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); - ACTION_ITEM(MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); - END_MENU(); -} - -#endif // HAS_LCD_MENU && POWER_LOSS_RECOVERY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_led.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_led.cpp deleted file mode 100644 index e6644c6852..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_led.cpp +++ /dev/null @@ -1,83 +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 . - * - */ - -// -// LED Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(LED_CONTROL_MENU) - -#include "menu.h" -#include "../../feature/leds/leds.h" - -#if ENABLED(LED_COLOR_PRESETS) - - void menu_led_presets() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT); - #endif - BACK_ITEM(MSG_LED_CONTROL); - ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white); - ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red); - ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange); - ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow); - ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green); - ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue); - ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo); - ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet); - END_MENU(); - } - -#endif - -void menu_led_custom() { - START_MENU(); - BACK_ITEM(MSG_LED_CONTROL); - EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); - EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); - EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); - #if EITHER(RGBW_LED, NEOPIXEL_LED) - EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); - #if ENABLED(NEOPIXEL_LED) - EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); - #endif - #endif - END_MENU(); -} - -void menu_led() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - bool led_on = leds.lights_on; - EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle); - ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default); - #if ENABLED(LED_COLOR_PRESETS) - SUBMENU(MSG_LED_PRESETS, menu_led_presets); - #endif - SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom); - END_MENU(); -} - -#endif // HAS_LCD_MENU && LED_CONTROL_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_main.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_main.cpp deleted file mode 100644 index 9dfa8dc103..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_main.cpp +++ /dev/null @@ -1,284 +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 . - * - */ - -// -// Main Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "../../module/temperature.h" -#include "../../gcode/queue.h" -#include "../../module/printcounter.h" -#include "../../module/stepper.h" -#include "../../sd/cardreader.h" - -#if HAS_GAMES && DISABLED(LCD_INFO_MENU) - #include "game/game.h" -#endif - -#define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL)) -#define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE)) - -#if ENABLED(PRUSA_MMU2) - #include "../../lcd/menu/menu_mmu2.h" -#endif - -void menu_tune(); -void menu_motion(); -void menu_temperature(); -void menu_configuration(); - -#if ENABLED(CUSTOM_USER_MENUS) - void menu_user(); -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - void _menu_temp_filament_op(const PauseMode, const int8_t); - void menu_change_filament(); -#endif - -#if ENABLED(LCD_INFO_MENU) - void menu_info(); -#endif - -#if ENABLED(LED_CONTROL_MENU) - void menu_led(); -#endif - -#if HAS_CUTTER - #include "../../feature/spindle_laser.h" - void menu_spindle_laser(); -#endif - -#if ENABLED(MIXING_EXTRUDER) - void menu_mixer(); -#endif - -extern const char M21_STR[]; - -void menu_main() { - START_MENU(); - BACK_ITEM(MSG_WATCH); - - const bool busy = printingIsActive() - #if ENABLED(SDSUPPORT) - , card_detected = card.isMounted() - , card_open = card_detected && card.isFileOpen() - #endif - ; - - if (busy) { - #if MACHINE_CAN_PAUSE - ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print); - #endif - #if MACHINE_CAN_STOP - SUBMENU(MSG_STOP_PRINT, []{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK), - ui.abort_print, ui.goto_previous_screen, - GET_TEXT(MSG_STOP_PRINT), (PGM_P)nullptr, PSTR("?") - ); - }); - #endif - SUBMENU(MSG_TUNE, menu_tune); - } - else { - #if !HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT) - // - // Autostart - // - #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); - #endif - - if (card_detected) { - if (!card_open) { - SUBMENU(MSG_MEDIA_MENU, menu_media); - MENU_ITEM(gcode, - #if PIN_EXISTS(SD_DETECT) - MSG_CHANGE_MEDIA, M21_STR - #else - MSG_RELEASE_MEDIA, PSTR("M22") - #endif - ); - } - } - else { - #if PIN_EXISTS(SD_DETECT) - ACTION_ITEM(MSG_NO_MEDIA, nullptr); - #else - GCODES_ITEM(MSG_INIT_MEDIA, M21_STR); - ACTION_ITEM(MSG_MEDIA_RELEASED, nullptr); - #endif - } - #endif // !HAS_ENCODER_WHEEL && SDSUPPORT - - #if MACHINE_CAN_PAUSE - if (printingIsPaused()) ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print); - #endif - - SUBMENU(MSG_MOTION, menu_motion); - } - - #if HAS_CUTTER - SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser); - #endif - - SUBMENU(MSG_TEMPERATURE, menu_temperature); - - #if ENABLED(MIXING_EXTRUDER) - SUBMENU(MSG_MIXER, menu_mixer); - #endif - - #if ENABLED(MMU2_MENUS) - if (!busy) SUBMENU(MSG_MMU2_MENU, menu_mmu2); - #endif - - SUBMENU(MSG_CONFIGURATION, menu_configuration); - - #if ENABLED(CUSTOM_USER_MENUS) - #ifdef CUSTOM_USER_MENU_TITLE - SUBMENU_P(PSTR(CUSTOM_USER_MENU_TITLE), menu_user); - #else - SUBMENU(MSG_USER_MENU, menu_user); - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - GCODES_ITEM(MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - SUBMENU(MSG_FILAMENTCHANGE, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); - #else - SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament); - #endif - #endif - - #if ENABLED(LCD_INFO_MENU) - SUBMENU(MSG_INFO_MENU, menu_info); - #endif - - #if ENABLED(LED_CONTROL_MENU) - SUBMENU(MSG_LED_CONTROL, menu_led); - #endif - - // - // Switch power on/off - // - #if ENABLED(PSU_CONTROL) - if (powersupply_on) - GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81")); - else - GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); - #endif - - #if HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT) - // - // Autostart - // - #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); - #endif - - if (card_detected) { - if (!card_open) { - MENU_ITEM(gcode, - #if PIN_EXISTS(SD_DETECT) - MSG_CHANGE_MEDIA, M21_STR - #else - MSG_RELEASE_MEDIA, PSTR("M22") - #endif - ); - SUBMENU(MSG_MEDIA_MENU, menu_media); - } - } - else { - #if PIN_EXISTS(SD_DETECT) - ACTION_ITEM(MSG_NO_MEDIA, nullptr); - #else - GCODES_ITEM(MSG_INIT_MEDIA, M21_STR); - ACTION_ITEM(MSG_MEDIA_RELEASED, nullptr); - #endif - } - #endif // HAS_ENCODER_WHEEL && SDSUPPORT - - #if HAS_SERVICE_INTERVALS - static auto _service_reset = [](const int index) { - print_job_timer.resetServiceInterval(index); - #if HAS_BUZZER - ui.completion_feedback(); - #endif - ui.reset_status(); - ui.return_to_status(); - }; - #if SERVICE_INTERVAL_1 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1), - MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, - []{ _service_reset(1); }, ui.goto_previous_screen, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?") - ); - #endif - #if SERVICE_INTERVAL_2 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2), - MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, - []{ _service_reset(2); }, ui.goto_previous_screen, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?") - ); - #endif - #if SERVICE_INTERVAL_3 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3), - MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, - []{ _service_reset(3); }, ui.goto_previous_screen, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?") - ); - #endif - #endif - - #if HAS_GAMES && DISABLED(LCD_INFO_MENU) - #if ENABLED(GAMES_EASTER_EGG) - SKIP_ITEM(); - SKIP_ITEM(); - #endif - SUBMENU(MSG_GAMES, ( - #if HAS_GAME_MENU - menu_game - #elif ENABLED(MARLIN_BRICKOUT) - brickout.enter_game - #elif ENABLED(MARLIN_INVADERS) - invaders.enter_game - #elif ENABLED(MARLIN_SNAKE) - snake.enter_game - #elif ENABLED(MARLIN_MAZE) - maze.enter_game - #endif - )); - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_media.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_media.cpp deleted file mode 100644 index a12c8b79bb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_media.cpp +++ /dev/null @@ -1,165 +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 . - * - */ - -// -// SD Card Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(SDSUPPORT) - -#include "menu.h" -#include "../../sd/cardreader.h" - -void lcd_sd_updir() { - ui.encoderPosition = card.cdup() ? ENCODER_STEPS_PER_MENU_ITEM : 0; - encoderTopLine = 0; - ui.screen_changed = true; - ui.refresh(); -} - -#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - - uint16_t sd_encoder_position = 0xFFFF; - int8_t sd_top_line, sd_items; - - void MarlinUI::reselect_last_file() { - if (sd_encoder_position == 0xFFFF) return; - //#if HAS_GRAPHICAL_LCD - // // This is a hack to force a screen update. - // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - // ui.synchronize(); - // safe_delay(50); - // ui.synchronize(); - // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - // ui.drawing_screen = ui.screen_changed = true; - //#endif - - goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items); - sd_encoder_position = 0xFFFF; - - defer_status_screen(); - - //#if HAS_GRAPHICAL_LCD - // update(); - //#endif - } -#endif - -inline void sdcard_start_selected_file() { - card.openAndPrintFile(card.filename); - ui.return_to_status(); - ui.reset_status(); -} - -class MenuItem_sdfile : public MenuItem_sdbase { - public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, false); - } - static void action(PGM_P const pstr, CardReader &) { - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - // Save menu state for the selected file - sd_encoder_position = ui.encoderPosition; - sd_top_line = encoderTopLine; - sd_items = screen_items; - #endif - #if ENABLED(SD_MENU_CONFIRM_START) - MenuItem_submenu::action(pstr, []{ - char * const longest = card.longest_filename(); - char buffer[strlen(longest) + 2]; - buffer[0] = ' '; - strcpy(buffer + 1, longest); - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL), - sdcard_start_selected_file, ui.goto_previous_screen, - GET_TEXT(MSG_START_PRINT), buffer, PSTR("?") - ); - }); - #else - sdcard_start_selected_file(); - UNUSED(pstr); - #endif - } -}; - -class MenuItem_sdfolder : public MenuItem_sdbase { - public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, true); - } - static void action(PGM_P const, CardReader &theCard) { - card.cd(theCard.filename); - encoderTopLine = 0; - ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); - ui.screen_changed = true; - #if HAS_GRAPHICAL_LCD - ui.drawing_screen = false; - #endif - ui.refresh(); - } -}; - -void menu_media() { - ui.encoder_direction_menus(); - - #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(); - BACK_ITEM(MSG_MAIN); - if (card.flag.workDirIsRoot) { - #if !PIN_EXISTS(SD_DETECT) - ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); }); - #endif - } - else if (card.isMounted()) - ACTION_ITEM_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); - - if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuLineNr == _thisItemNr) { - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; - - card.getfilename_sorted(nr); - - if (card.flag.filenameIsDir) - MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card); - else - MENU_ITEM(sdfile, MSG_MEDIA_MENU, card); - } - else { - SKIP_ITEM(); - } - } - END_MENU(); -} - -#endif // HAS_LCD_MENU && SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mixer.cpp deleted file mode 100644 index 51e24d9358..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mixer.cpp +++ /dev/null @@ -1,292 +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 . - * - */ - -// -// Mixer Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER) - -#include "menu.h" -#include "menu_addon.h" - -#include "../../feature/mixing.h" - -#define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER - -#if ENABLED(GRADIENT_MIX) - - void lcd_mixer_gradient_z_start_edit() { - ui.defer_status_screen(); - ENCODER_RATE_MULTIPLY(true); - if (ui.encoderPosition != 0) { - mixer.gradient.start_z += float(int32_t(ui.encoderPosition)) * 0.1; - ui.encoderPosition = 0; - NOLESS(mixer.gradient.start_z, 0); - NOMORE(mixer.gradient.start_z, Z_MAX_POS); - } - if (ui.should_draw()) { - char tmp[21]; - strcpy_P(tmp, GET_TEXT(MSG_START_Z)); - sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); - SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - lcd_put_u8str(tmp); - } - - if (ui.lcd_clicked) { - if (mixer.gradient.start_z > mixer.gradient.end_z) - mixer.gradient.end_z = mixer.gradient.start_z; - mixer.refresh_gradient(); - ui.goto_previous_screen(); - } - } - - void lcd_mixer_gradient_z_end_edit() { - ui.defer_status_screen(); - ENCODER_RATE_MULTIPLY(true); - if (ui.encoderPosition != 0) { - mixer.gradient.end_z += float(int32_t(ui.encoderPosition)) * 0.1; - ui.encoderPosition = 0; - NOLESS(mixer.gradient.end_z, 0); - NOMORE(mixer.gradient.end_z, Z_MAX_POS); - } - - if (ui.should_draw()) { - char tmp[21]; - strcpy_P(tmp, GET_TEXT(MSG_END_Z)); - sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); - SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - lcd_put_u8str(tmp); - } - - if (ui.lcd_clicked) { - if (mixer.gradient.end_z < mixer.gradient.start_z) - mixer.gradient.start_z = mixer.gradient.end_z; - mixer.refresh_gradient(); - ui.goto_previous_screen(); - } - } - - void lcd_mixer_edit_gradient_menu() { - START_MENU(); - BACK_ITEM(MSG_MIXER); - - EDIT_ITEM(int8, MSG_START_VTOOL, &mixer.gradient.start_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); - EDIT_ITEM(int8, MSG_END_VTOOL, &mixer.gradient.end_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); - - #if ENABLED(GRADIENT_VTOOL) - EDIT_ITEM(int8, MSG_GRADIENT_ALIAS, &mixer.gradient.vtool_index, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); - #endif - - char tmp[18]; - - SUBMENU(MSG_START_Z, lcd_mixer_gradient_z_start_edit); - MENU_ITEM_ADDON_START(9); - sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - - SUBMENU(MSG_END_Z, lcd_mixer_gradient_z_end_edit); - MENU_ITEM_ADDON_START(9); - sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - - END_MENU(); - } - -#endif // GRADIENT_MIX - -static uint8_t v_index; - -#if DUAL_MIXING_EXTRUDER - void _lcd_draw_mix(const uint8_t y) { - char tmp[20]; // "100%_100%" - sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - SETCURSOR(2, y); lcd_put_u8str_P(GET_TEXT(MSG_MIX)); - SETCURSOR_RJ(9, y); lcd_put_u8str(tmp); - } -#endif - -void _lcd_mixer_select_vtool() { - mixer.T(v_index); - #if DUAL_MIXING_EXTRUDER - _lcd_draw_mix(LCD_HEIGHT - 1); - #endif -} - -#if CHANNEL_MIX_EDITING - - void _lcd_mixer_cycle_mix() { - uint16_t bits = 0; - MIXER_STEPPER_LOOP(i) if (mixer.collector[i]) SBI(bits, i); - bits = (bits + 1) & (_BV(MIXING_STEPPERS) - 1); - if (!bits) ++bits; - MIXER_STEPPER_LOOP(i) mixer.collector[i] = TEST(bits, i) ? 10.0f : 0.0f; - ui.refresh(); - } - - void _lcd_mixer_commit_vtool() { - mixer.normalize(); - ui.goto_previous_screen(); - } - -#endif - -void lcd_mixer_mix_edit() { - - #if DUAL_MIXING_EXTRUDER && !CHANNEL_MIX_EDITING - - // Adjust 2-channel mix from the encoder - if (ui.encoderPosition != 0) { - mixer.mix[0] += int32_t(ui.encoderPosition); - ui.encoderPosition = 0; - if (mixer.mix[0] < 0) mixer.mix[0] += 101; - if (mixer.mix[0] > 100) mixer.mix[0] -= 101; - mixer.mix[1] = 100 - mixer.mix[0]; - } - _lcd_draw_mix((LCD_HEIGHT - 1) / 2); - - // Click to commit the change - if (ui.lcd_clicked) { - mixer.update_vtool_from_mix(); - ui.goto_previous_screen(); - } - - #else - - START_MENU(); - BACK_ITEM(MSG_MIXER); - - #if CHANNEL_MIX_EDITING - - for (uint8_t n = 1; n <= MIXING_STEPPERS; n++) - EDIT_ITEM_FAST_N(float52, n, MSG_MIX_COMPONENT_N, &mixer.collector[n-1], 0, 10); - - ACTION_ITEM(MSG_CYCLE_MIX, _lcd_mixer_cycle_mix); - ACTION_ITEM(MSG_COMMIT_VTOOL, _lcd_mixer_commit_vtool); - - #endif - - END_MENU(); - - #endif -} - -#if DUAL_MIXING_EXTRUDER - - // - // Toggle Dual-Mix - // - inline void _lcd_mixer_toggle_mix() { - mixer.mix[0] = mixer.mix[0] == 100 ? 0 : 100; - mixer.mix[1] = 100 - mixer.mix[0]; - mixer.update_vtool_from_mix(); - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - } - -#endif - -#if CHANNEL_MIX_EDITING - - // - // Prepare and Edit Mix - // - inline void _lcd_goto_mix_edit() { - mixer.refresh_collector(10, v_index); - ui.goto_screen(lcd_mixer_mix_edit); - lcd_mixer_mix_edit(); - } - -#endif - -#if ENABLED(GRADIENT_MIX) - // - // Reverse Gradient - // - inline void _lcd_mixer_reverse_gradient() { - const uint8_t sv = mixer.gradient.start_vtool; - mixer.gradient.start_vtool = mixer.gradient.end_vtool; - mixer.gradient.end_vtool = sv; - mixer.refresh_gradient(); - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - } -#endif - -void menu_mixer() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - v_index = mixer.get_current_vtool(); - EDIT_ITEM(uint8, MSG_ACTIVE_VTOOL, &v_index, 0, MIXING_VIRTUAL_TOOLS - 1, _lcd_mixer_select_vtool - #if DUAL_MIXING_EXTRUDER - , true - #endif - ); - - #if DUAL_MIXING_EXTRUDER - { - char tmp[10]; - SUBMENU(MSG_MIX, lcd_mixer_mix_edit); - MENU_ITEM_ADDON_START(10); - mixer.update_mix_from_vtool(); - sprintf_P(tmp, PSTR("%3d;%3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - ACTION_ITEM(MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix); - } - #else - SUBMENU(MSG_MIX, _lcd_goto_mix_edit); - #endif - - // - // Reset All V-Tools - // - CONFIRM_ITEM(MSG_RESET_VTOOLS, - MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, - []{ - mixer.reset_vtools(); - LCD_MESSAGEPGM(MSG_VTOOLS_RESET); - ui.return_to_status(); - }, - ui.goto_previous_screen, - GET_TEXT(MSG_RESET_VTOOLS), (PGM_P)nullptr, PSTR("?") - ); - - #if ENABLED(GRADIENT_MIX) - { - char tmp[13]; - SUBMENU(MSG_GRADIENT, lcd_mixer_edit_gradient_menu); - MENU_ITEM_ADDON_START(10); - sprintf_P(tmp, PSTR("T%i->T%i"), mixer.gradient.start_vtool, mixer.gradient.end_vtool); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - ACTION_ITEM(MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient); - } - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU && MIXING_EXTRUDER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.cpp deleted file mode 100644 index ad3d649ee4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.cpp +++ /dev/null @@ -1,174 +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 . - * - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) - -#include "../../feature/prusa_MMU2/mmu2.h" -#include "menu_mmu2.h" -#include "menu.h" - -uint8_t currentTool; -bool mmuMenuWait; - -// -// Load Filament -// - -void _mmu2_load_filamentToNozzle(uint8_t index) { - ui.reset_status(); - ui.return_to_status(); - ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); - if (mmu2.load_filament_to_nozzle(index)) ui.reset_status(); -} - -inline void action_mmu2_load_filament_to_nozzle(const uint8_t tool) { - _mmu2_load_filamentToNozzle(tool); - ui.return_to_status(); -} - -void _mmu2_load_filament(uint8_t index) { - ui.return_to_status(); - ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); - mmu2.load_filament(index); - ui.reset_status(); -} -void action_mmu2_load_all() { - for (uint8_t i = 0; i < EXTRUDERS; i++) - _mmu2_load_filament(i); - ui.return_to_status(); -} - -void menu_mmu2_load_filament() { - START_MENU(); - BACK_ITEM(MSG_MMU2_MENU); - ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all); - LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); }); - END_MENU(); -} - -void menu_mmu2_load_to_nozzle() { - START_MENU(); - BACK_ITEM(MSG_MMU2_MENU); - LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); }); - END_MENU(); -} - -// -// Eject Filament -// - -void _mmu2_eject_filament(uint8_t index) { - ui.reset_status(); - ui.return_to_status(); - ui.status_printf_P(0, GET_TEXT(MSG_MMU2_EJECTING_FILAMENT), int(index + 1)); - if (mmu2.eject_filament(index, true)) ui.reset_status(); -} - -void action_mmu2_unload_filament() { - ui.reset_status(); - ui.return_to_status(); - LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT); - idle(); - if (mmu2.unload()) ui.reset_status(); -} - -void menu_mmu2_eject_filament() { - START_MENU(); - BACK_ITEM(MSG_MMU2_MENU); - LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); }); - END_MENU(); -} - -// -// MMU2 Menu -// - -void action_mmu2_reset() { - mmu2.init(); - ui.reset_status(); -} - -void menu_mmu2() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - SUBMENU(MSG_MMU2_LOAD_FILAMENT, menu_mmu2_load_filament); - SUBMENU(MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_load_to_nozzle); - SUBMENU(MSG_MMU2_EJECT_FILAMENT, menu_mmu2_eject_filament); - ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unload_filament); - ACTION_ITEM(MSG_MMU2_RESET, action_mmu2_reset); - END_MENU(); -} - -// -// T* Choose Filament -// - -inline void action_mmu2_choose(const uint8_t tool) { - currentTool = tool; - mmuMenuWait = false; -} - -void menu_mmu2_choose_filament() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_CENTER|SS_INVERT); - #endif - LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); }); - END_MENU(); -} - -// -// MMU2 Filament Runout -// - -void menu_mmu2_pause() { - currentTool = mmu2.get_current_tool(); - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_CENTER|SS_INVERT); - #endif - ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; }); - ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); }); - ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(currentTool); }); - ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(currentTool); }); - END_MENU(); -} - -void mmu2_M600() { - ui.defer_status_screen(); - ui.goto_screen(menu_mmu2_pause); - mmuMenuWait = true; - while (mmuMenuWait) idle(); -} - -uint8_t mmu2_choose_filament() { - ui.defer_status_screen(); - ui.goto_screen(menu_mmu2_choose_filament); - mmuMenuWait = true; - while (mmuMenuWait) idle(); - ui.return_to_status(); - return currentTool; -} - -#endif // HAS_LCD_MENU && ENABLED(PRUSA_MMU2_MENUS) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.h deleted file mode 100644 index 0f47092655..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_mmu2.h +++ /dev/null @@ -1,28 +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 - -#include - -void menu_mmu2(); -void mmu2_M600(); -uint8_t mmu2_choose_filament(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_motion.cpp deleted file mode 100644 index cb1527cf81..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_motion.cpp +++ /dev/null @@ -1,447 +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 . - * - */ - -// -// Motion Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "menu_addon.h" - -#include "../../module/motion.h" - -#if ENABLED(DELTA) - #include "../../module/delta.h" -#endif - -#if ENABLED(PREVENT_COLD_EXTRUSION) - #include "../../module/temperature.h" -#endif - -#if HAS_LEVELING - #include "../../module/planner.h" - #include "../../feature/bedlevel/bedlevel.h" -#endif - -extern millis_t manual_move_start_time; -extern int8_t manual_move_axis; -#if ENABLED(MANUAL_E_MOVES_RELATIVE) - float manual_move_e_origin = 0; -#endif -#if IS_KINEMATIC - extern float manual_move_offset; -#endif - -// -// Tell ui.update() to start a move to current_position" after a short delay. -// -inline void manual_move_to_current(AxisEnum axis - #if E_MANUAL > 1 - , const int8_t eindex=-1 - #endif -) { - #if E_MANUAL > 1 - if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder; - #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - manual_move_axis = (int8_t)axis; -} - -// -// "Motion" > "Move Axis" submenu -// - -static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { - if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - if (ui.encoderPosition && !ui.processing_manual_move) { - - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if HAS_SOFTWARE_ENDSTOPS - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop.min.x; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop.max.x; - #endif - break; - case Y_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop.min.y; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop.max.y; - #endif - break; - case Z_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop.min.z; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop.max.z; - #endif - default: break; - } - #endif // HAS_SOFTWARE_ENDSTOPS - - // Delta limits XY based on the current offset from center - // This assumes the center is 0,0 - #if ENABLED(DELTA) - if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis - min = -max; - } - #endif - - // Get the new position - const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - if (int32_t(ui.encoderPosition) < 0) - NOLESS(manual_move_offset, min - current_position[axis]); - else - NOMORE(manual_move_offset, max - current_position[axis]); - #else - current_position[axis] += diff; - if (int32_t(ui.encoderPosition) < 0) - NOLESS(current_position[axis], min); - else - NOMORE(current_position[axis], max); - #endif - - manual_move_to_current(axis); - ui.refresh(LCDVIEW_REDRAW_NOW); - } - ui.encoderPosition = 0; - if (ui.should_draw()) { - const float pos = NATIVE_TO_LOGICAL(ui.processing_manual_move ? destination[axis] : current_position[axis] - #if IS_KINEMATIC - + manual_move_offset - #endif - , axis); - MenuEditItemBase::draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); - } -} -void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } -void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); } -void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } - -#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(int32_t(ui.encoderPosition)) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - #else - current_position.e += diff; - #endif - manual_move_to_current(E_AXIS - #if E_MANUAL > 1 - , eindex - #endif - ); - ui.refresh(LCDVIEW_REDRAW_NOW); - } - ui.encoderPosition = 0; - } - if (ui.should_draw()) { - #if E_MANUAL > 1 - MenuItemBase::init(eindex); - #endif - MenuEditItemBase::draw_edit_screen( - GET_TEXT( - #if E_MANUAL > 1 - MSG_MOVE_EN - #else - MSG_MOVE_E - #endif - ), - ftostr41sign(current_position.e - #if IS_KINEMATIC - + manual_move_offset - #endif - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - - manual_move_e_origin - #endif - ) - ); - } // should_draw - } - -#endif // E_MANUAL - -// -// "Motion" > "Move Xmm" > "Move XYZ" submenu -// - -#ifndef SHORT_MANUAL_Z_MOVE - #define SHORT_MANUAL_Z_MOVE 0.025 -#endif - -screenFunc_t _manual_move_func_ptr; - -void _goto_manual_move(const float scale) { - ui.defer_status_screen(); - move_menu_scale = scale; - ui.goto_screen(_manual_move_func_ptr); -} - -void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) { - _manual_move_func_ptr = func; - START_MENU(); - if (LCD_HEIGHT >= 4) { - switch (axis) { - 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; - #endif - STATIC_ITEM(MSG_MOVE_E, SS_CENTER|SS_INVERT); - break; - } - } - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder)) - BACK_ITEM(MSG_HOTEND_TOO_COLD); - else - #endif - { - BACK_ITEM(MSG_MOVE_AXIS); - SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); - SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); - SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); - if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { - extern const char NUL_STR[]; - SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); - MENU_ITEM_ADDON_START(0); - char tmp[20], numstr[10]; - // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - } - } - END_MENU(); -} - -void menu_move() { - START_MENU(); - BACK_ITEM(MSG_MOTION); - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); - #endif - - if ( - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - all_axes_homed() - #else - true - #endif - ) { - if ( - #if ENABLED(DELTA) - current_position.z <= delta_clip_start_height - #else - true - #endif - ) { - SUBMENU(MSG_MOVE_X, []{ _menu_move_distance(X_AXIS, lcd_move_x); }); - SUBMENU(MSG_MOVE_Y, []{ _menu_move_distance(Y_AXIS, lcd_move_y); }); - } - #if ENABLED(DELTA) - else - ACTION_ITEM(MSG_FREE_XY, []{ line_to_z(delta_clip_start_height); ui.synchronize(); }); - #endif - - SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); }); - } - else - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); - - #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD) - - #if EXTRUDERS >= 4 - switch (active_extruder) { - case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break; - case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break; - case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break; - case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break; - #if EXTRUDERS == 6 - case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break; - case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break; - #endif - } - #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); - } - #else - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); - #endif - - #elif ENABLED(DUAL_X_CARRIAGE) - - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); - - #endif - - #if E_MANUAL - - // The current extruder - SUBMENU(MSG_MOVE_E, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); }); - - #define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); }); - - #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) - - // ...and the non-switching - #if E_MANUAL == 5 - SUBMENU_MOVE_E(4); - #elif E_MANUAL == 3 - SUBMENU_MOVE_E(2); - #endif - - #elif E_MANUAL > 1 - - // Independent extruders with one E-stepper per hotend - for (uint8_t n = 0; n < E_MANUAL; n++) SUBMENU_MOVE_E(n); - - #endif - - #endif // E_MANUAL - - END_MENU(); -} - -#if ENABLED(AUTO_BED_LEVELING_UBL) - void _lcd_ubl_level_bed(); -#elif ENABLED(LCD_BED_LEVELING) - void menu_bed_leveling(); -#endif - -void menu_motion() { - START_MENU(); - - // - // ^ Main - // - BACK_ITEM(MSG_MAIN); - - // - // Move Axis - // - #if ENABLED(DELTA) - if (all_axes_homed()) - #endif - SUBMENU(MSG_MOVE_AXIS, menu_move); - - // - // Auto Home - // - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); - #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - GCODES_ITEM(MSG_AUTO_HOME_X, PSTR("G28 X")); - GCODES_ITEM(MSG_AUTO_HOME_Y, PSTR("G28 Y")); - GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28 Z")); - #endif - - // - // Auto Z-Align - // - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); - #endif - - // - // Level Bed - // - #if ENABLED(AUTO_BED_LEVELING_UBL) - - SUBMENU(MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); - - #elif ENABLED(LCD_BED_LEVELING) - - if (!g29_in_progress) SUBMENU(MSG_BED_LEVELING, menu_bed_leveling); - - #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) - - #if DISABLED(PROBE_MANUALLY) - GCODES_ITEM(MSG_LEVEL_BED, PSTR("G28\nG29")); - #endif - if (all_axes_homed() && leveling_is_valid()) { - bool show_state = planner.leveling_active; - EDIT_ITEM(bool, MSG_BED_LEVELING, &show_state, _lcd_toggle_bed_leveling); - } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - editable.decimal = planner.z_fade_height; - EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); - #endif - - #endif - - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - ACTION_ITEM(MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - GCODES_ITEM(MSG_M48_TEST, PSTR("G28\nM48 P10")); - #endif - - // - // Disable Steppers - // - GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84")); - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_spindle_laser.cpp deleted file mode 100644 index 1c480577f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ /dev/null @@ -1,54 +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 . - * - */ - -// -// Spindle / Laser Menu -// - -#include "../../inc/MarlinConfig.h" - -#if HAS_LCD_MENU && HAS_CUTTER - - #include "menu.h" - - #include "../../feature/spindle_laser.h" - - void menu_spindle_laser() { - - START_MENU(); - BACK_ITEM(MSG_MAIN); - if (cutter.enabled()) { - #if ENABLED(SPINDLE_LASER_PWM) - EDIT_ITEM(CUTTER_MENU_TYPE, MSG_CUTTER(POWER), &cutter.power, SPEED_POWER_MIN, SPEED_POWER_MAX); - #endif - ACTION_ITEM(MSG_CUTTER(OFF), cutter.disable); - } - else { - ACTION_ITEM(MSG_CUTTER(ON), cutter.enable_forward); - #if ENABLED(SPINDLE_CHANGE_DIR) - ACTION_ITEM(MSG_SPINDLE_REVERSE, cutter.enable_reverse); - #endif - } - END_MENU(); - } - -#endif // HAS_LCD_MENU && HAS_CUTTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_temperature.cpp deleted file mode 100644 index 0c90a88753..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_temperature.cpp +++ /dev/null @@ -1,258 +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 . - * - */ - -// -// Temperature Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "../../module/temperature.h" - -#if FAN_COUNT > 1 || ENABLED(SINGLENOZZLE) - #include "../../module/motion.h" -#endif - -#if ENABLED(SINGLENOZZLE) - #include "../../module/tool_change.h" -#endif - -// Initialized by settings.load() -int16_t MarlinUI::preheat_hotend_temp[2], MarlinUI::preheat_bed_temp[2]; -uint8_t MarlinUI::preheat_fan_speed[2]; - -// -// "Temperature" submenu items -// - -void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) { - #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 - UNUSED(tempb); - #endif - #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - thermalManager.set_fan_speed(active_extruder < FAN_COUNT ? active_extruder : 0, fan); - #else - thermalManager.set_fan_speed(0, fan); - #endif - #else - UNUSED(fan); - #endif - ui.return_to_status(); -} - -#if HAS_TEMP_HOTEND - inline void _preheat_end(const uint8_t m, const uint8_t e) { - _lcd_preheat(e, ui.preheat_hotend_temp[m], -1, ui.preheat_fan_speed[m]); - } - #if HAS_HEATED_BED - inline void _preheat_both(const uint8_t m, const uint8_t e) { - _lcd_preheat(e, ui.preheat_hotend_temp[m], ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]); - } - #endif -#endif -#if HAS_HEATED_BED - inline void _preheat_bed(const uint8_t m) { - _lcd_preheat(0, 0, ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]); - } -#endif - -#if HAS_TEMP_HOTEND || HAS_HEATED_BED - - #define _PREHEAT_ITEMS(M,N) do{ \ - ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_both(M-1, MenuItemBase::itemIndex); }); \ - ACTION_ITEM_N(N, MSG_PREHEAT_##M##_END_E, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }); \ - }while(0) - #if HAS_HEATED_BED - #define PREHEAT_ITEMS(M,N) _PREHEAT_ITEMS(M,N) - #else - #define PREHEAT_ITEMS(M,N) \ - ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }) - #endif - - void menu_preheat_m1() { - START_MENU(); - BACK_ITEM(MSG_TEMPERATURE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_both(0, 0); }); - ACTION_ITEM(MSG_PREHEAT_1_END, []{ _preheat_end(0, 0); }); - #else - ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - _PREHEAT_ITEMS(1,0); - #endif - for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(1,n); - ACTION_ITEM(MSG_PREHEAT_1_ALL, []() { - #if HAS_HEATED_BED - _preheat_bed(0); - #endif - HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], e); - }); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - ACTION_ITEM(MSG_PREHEAT_1_BEDONLY, []{ _preheat_bed(0); }); - #endif - END_MENU(); - } - - void menu_preheat_m2() { - START_MENU(); - BACK_ITEM(MSG_TEMPERATURE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_both(1, 0); }); - ACTION_ITEM(MSG_PREHEAT_2_END, []{ _preheat_end(1, 0); }); - #else - ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); }); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - _PREHEAT_ITEMS(2,0); - #endif - for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(2,n); - ACTION_ITEM(MSG_PREHEAT_2_ALL, []() { - #if HAS_HEATED_BED - _preheat_bed(1); - #endif - HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], e); - }); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - ACTION_ITEM(MSG_PREHEAT_2_BEDONLY, []{ _preheat_bed(1); }); - #endif - END_MENU(); - } - - void lcd_cooldown() { - thermalManager.zero_fan_speeds(); - thermalManager.disable_all_heaters(); - ui.return_to_status(); - } - -#endif // HAS_TEMP_HOTEND || HAS_HEATED_BED - -void menu_temperature() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - // - // Nozzle: - // Nozzle [1-5]: - // - #if HOTENDS == 1 - EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); }); - #elif HOTENDS > 1 - #define EDIT_TARGET(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }) - HOTEND_LOOP() EDIT_TARGET(e); - #endif - - #if ENABLED(SINGLENOZZLE) - EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); - #endif - - // - // Bed: - // - #if HAS_HEATED_BED - EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); - #endif - - // - // Chamber: - // - #if HAS_HEATED_CHAMBER - EDIT_ITEM_FAST(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 5, thermalManager.start_watching_chamber); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - editable.uint8 = thermalManager.fan_speed[0]; - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #endif - #if HAS_FAN2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #endif - #endif // FAN_COUNT > 0 - - #if HAS_TEMP_HOTEND - - // - // Preheat for Material 1 and 2 - // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || HAS_HEATED_BED - SUBMENU(MSG_PREHEAT_1, menu_preheat_m1); - SUBMENU(MSG_PREHEAT_2, menu_preheat_m2); - #else - ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); - ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); }); - #endif - - // - // Cooldown - // - bool has_heat = false; - HOTEND_LOOP() if (thermalManager.temp_hotend[HOTEND_INDEX].target) { has_heat = true; break; } - #if HAS_TEMP_BED - if (thermalManager.temp_bed.target) has_heat = true; - #endif - if (has_heat) ACTION_ITEM(MSG_COOLDOWN, lcd_cooldown); - - #endif // HAS_TEMP_HOTEND - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tmc.cpp deleted file mode 100644 index ef0e207a60..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tmc.cpp +++ /dev/null @@ -1,225 +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 . - * - */ - -// -// TMC Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_TRINAMIC && HAS_LCD_MENU - -#include "menu.h" -#include "../../module/stepper/indirection.h" -#include "../../feature/tmc_util.h" - -#define TMC_EDIT_STORED_I_RMS(ST,MSG) EDIT_ITEM_P(uint16_4, PSTR(MSG), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) - -void menu_tmc_current() { - START_MENU(); - BACK_ITEM(MSG_TMC_DRIVERS); - #if AXIS_IS_TMC(X) - TMC_EDIT_STORED_I_RMS(X, MSG_X); - #endif - #if AXIS_IS_TMC(Y) - TMC_EDIT_STORED_I_RMS(Y, MSG_Y); - #endif - #if AXIS_IS_TMC(Z) - TMC_EDIT_STORED_I_RMS(Z, MSG_Z); - #endif - #if AXIS_IS_TMC(X2) - TMC_EDIT_STORED_I_RMS(X2, MSG_X2); - #endif - #if AXIS_IS_TMC(Y2) - TMC_EDIT_STORED_I_RMS(Y2, MSG_Y2); - #endif - #if AXIS_IS_TMC(Z2) - TMC_EDIT_STORED_I_RMS(Z2, MSG_Z2); - #endif - #if AXIS_IS_TMC(Z3) - TMC_EDIT_STORED_I_RMS(Z3, MSG_Z3); - #endif - #if AXIS_IS_TMC(E0) - TMC_EDIT_STORED_I_RMS(E0, LCD_STR_E0); - #endif - #if AXIS_IS_TMC(E1) - TMC_EDIT_STORED_I_RMS(E1, LCD_STR_E1); - #endif - #if AXIS_IS_TMC(E2) - TMC_EDIT_STORED_I_RMS(E2, LCD_STR_E2); - #endif - #if AXIS_IS_TMC(E3) - TMC_EDIT_STORED_I_RMS(E3, LCD_STR_E3); - #endif - #if AXIS_IS_TMC(E4) - TMC_EDIT_STORED_I_RMS(E4, LCD_STR_E4); - #endif - #if AXIS_IS_TMC(E5) - TMC_EDIT_STORED_I_RMS(E5, LCD_STR_E5); - #endif - END_MENU(); -} - -#if ENABLED(HYBRID_THRESHOLD) - - #define TMC_EDIT_STORED_HYBRID_THRS(ST, MSG) EDIT_ITEM_P(uint8, PSTR(MSG), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); - - void menu_tmc_hybrid_thrs() { - START_MENU(); - BACK_ITEM(MSG_TMC_DRIVERS); - #if AXIS_HAS_STEALTHCHOP(X) - TMC_EDIT_STORED_HYBRID_THRS(X, MSG_X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_EDIT_STORED_HYBRID_THRS(Y, MSG_Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_EDIT_STORED_HYBRID_THRS(Z, MSG_Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_EDIT_STORED_HYBRID_THRS(X2, MSG_X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_EDIT_STORED_HYBRID_THRS(Y2, MSG_Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_EDIT_STORED_HYBRID_THRS(Z2, MSG_Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_EDIT_STORED_HYBRID_THRS(Z3, MSG_Z3); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_EDIT_STORED_HYBRID_THRS(E0, LCD_STR_E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_EDIT_STORED_HYBRID_THRS(E1, LCD_STR_E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_EDIT_STORED_HYBRID_THRS(E2, LCD_STR_E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_EDIT_STORED_HYBRID_THRS(E3, LCD_STR_E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_EDIT_STORED_HYBRID_THRS(E4, LCD_STR_E4); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - TMC_EDIT_STORED_HYBRID_THRS(E5, LCD_STR_E5); - #endif - END_MENU(); - } - -#endif - -#if ENABLED(SENSORLESS_HOMING) - - #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(MSG_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); - - void menu_tmc_homing_thrs() { - START_MENU(); - BACK_ITEM(MSG_TMC_DRIVERS); - #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 - #if Z_SENSORLESS - TMC_EDIT_STORED_SGT(Z); - #endif - END_MENU(); - } - -#endif - -#if HAS_STEALTHCHOP - - #define TMC_EDIT_STEP_MODE(ST, MSG) EDIT_ITEM_P(bool, PSTR(MSG), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) - - void menu_tmc_step_mode() { - START_MENU(); - STATIC_ITEM(MSG_TMC_STEALTH_ENABLED); - BACK_ITEM(MSG_TMC_DRIVERS); - #if AXIS_HAS_STEALTHCHOP(X) - TMC_EDIT_STEP_MODE(X, MSG_X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - TMC_EDIT_STEP_MODE(Y, MSG_Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - TMC_EDIT_STEP_MODE(Z, MSG_Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - TMC_EDIT_STEP_MODE(X2, MSG_X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_EDIT_STEP_MODE(Y2, MSG_Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_EDIT_STEP_MODE(Z2, MSG_Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_EDIT_STEP_MODE(Z3, MSG_Z3); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - TMC_EDIT_STEP_MODE(E0, LCD_STR_E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - TMC_EDIT_STEP_MODE(E1, LCD_STR_E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - TMC_EDIT_STEP_MODE(E2, LCD_STR_E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - TMC_EDIT_STEP_MODE(E3, LCD_STR_E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - TMC_EDIT_STEP_MODE(E4, LCD_STR_E4); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - TMC_EDIT_STEP_MODE(E5, LCD_STR_E5); - #endif - END_MENU(); - } - -#endif - -void menu_tmc() { - START_MENU(); - BACK_ITEM(MSG_CONTROL); - SUBMENU(MSG_TMC_CURRENT, menu_tmc_current); - #if ENABLED(HYBRID_THRESHOLD) - SUBMENU(MSG_TMC_HYBRID_THRS, menu_tmc_hybrid_thrs); - #endif - #if ENABLED(SENSORLESS_HOMING) - SUBMENU(MSG_TMC_HOMING_THRS, menu_tmc_homing_thrs); - #endif - #if HAS_STEALTHCHOP - SUBMENU(MSG_TMC_STEPPING_MODE, menu_tmc_step_mode); - #endif - END_MENU(); -} - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tune.cpp deleted file mode 100644 index 4fba6fe719..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_tune.cpp +++ /dev/null @@ -1,211 +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 . - * - */ - -// -// Tune Menu -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU - -#include "menu.h" -#include "../../module/motion.h" -#include "../../module/planner.h" -#include "../../module/temperature.h" -#include "../../Marlin.h" - -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(SINGLENOZZLE) - #include "../../module/tool_change.h" -#endif - -#if ENABLED(BABYSTEPPING) - - #include "../../feature/babystep.h" - #include "../lcdprint.h" - #if HAS_GRAPHICAL_LCD - #include "../dogm/ultralcd_DOGM.h" - #endif - - void _lcd_babystep(const AxisEnum axis, PGM_P const msg) { - if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - if (ui.encoderPosition) { - const int16_t steps = int16_t(ui.encoderPosition) * ( - #if ENABLED(BABYSTEP_XY) - axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY : - #endif - BABYSTEP_MULTIPLICATOR_Z - ); - ui.encoderPosition = 0; - ui.refresh(LCDVIEW_REDRAW_NOW); - babystep.add_steps(axis, steps); - } - if (ui.should_draw()) { - const float spm = planner.steps_to_mm[axis]; - MenuEditItemBase::draw_edit_screen(msg, ftostr54sign(spm * babystep.accum)); - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - const bool in_view = (true - #if HAS_GRAPHICAL_LCD - && PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1) - #endif - ); - if (in_view) { - #if HAS_GRAPHICAL_LCD - ui.set_font(FONT_MENU); - lcd_moveto(0, LCD_PIXEL_HEIGHT - MENU_FONT_DESCENT); - #else - lcd_moveto(0, LCD_HEIGHT - 1); - #endif - lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL)); - lcd_put_wchar(':'); - lcd_put_u8str(ftostr54sign(spm * babystep.axis_total[BS_TOTAL_AXIS(axis)])); - } - #endif - } - } - - inline void _lcd_babystep_go(const screenFunc_t screen) { - ui.goto_screen(screen); - ui.defer_status_screen(); - babystep.accum = 0; - } - - #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); } - #endif - - #if DISABLED(BABYSTEP_ZPROBE_OFFSET) - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); } - void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); } - #endif - -#endif // BABYSTEPPING - -void menu_tune() { - START_MENU(); - BACK_ITEM(MSG_MAIN); - - // - // Speed: - // - EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999); - - // - // Manual bed leveling, Bed Z: - // - #if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING) - EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 - EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); }); - #elif HOTENDS > 1 - #define EDIT_NOZZLE(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }) - HOTEND_LOOP() EDIT_NOZZLE(e); - #endif - - #if ENABLED(SINGLENOZZLE) - EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); - #endif - - // - // Bed: - // - #if HAS_HEATED_BED - EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - editable.uint8 = thermalManager.fan_speed[0]; - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); - #endif - #endif - #if HAS_FAN1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #endif - #if HAS_FAN2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #endif - #endif // FAN_COUNT > 0 - - // - // Flow: - // Flow [1-5]: - // - #if EXTRUDERS == 1 - EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, []{ planner.refresh_e_factor(0); }); - #elif EXTRUDERS - EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); }); - #define EDIT_FLOW(N) EDIT_ITEM_N(int3, N, MSG_FLOW_N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }) - for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FLOW(n); - #endif - - // - // Babystep X: - // Babystep Y: - // Babystep Z: - // - #if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_XY) - SUBMENU(MSG_BABYSTEP_X, []{ _lcd_babystep_go(_lcd_babystep_x); }); - SUBMENU(MSG_BABYSTEP_Y, []{ _lcd_babystep_go(_lcd_babystep_y); }); - #endif - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #else - SUBMENU(MSG_BABYSTEP_Z, lcd_babystep_z); - #endif - #endif - - END_MENU(); -} - -#endif // HAS_LCD_MENU diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_ubl.cpp deleted file mode 100644 index 2290c83860..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/menu/menu_ubl.cpp +++ /dev/null @@ -1,625 +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 . - * - */ - -// -// Unified Bed Leveling Menus -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) - -#include "menu.h" -#include "../../module/planner.h" -#include "../../module/configuration_store.h" -#include "../../feature/bedlevel/bedlevel.h" - -static int16_t ubl_storage_slot = 0, - custom_hotend_temp = 190, - side_points = 3, - ubl_fillin_amount = 5, - ubl_height_amount = 1; - -static uint8_t n_edit_pts = 1, x_plot = 0, y_plot = 0; - -#if HAS_HEATED_BED - static int16_t custom_bed_temp = 50; -#endif - -float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places. So we keep a - // separate value that doesn't lose precision. -static int16_t ubl_encoderPosition = 0; - -static void _lcd_mesh_fine_tune(PGM_P msg) { - ui.defer_status_screen(); - if (ubl.encoder_diff) { - ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; - ubl.encoder_diff = 0; - - mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; - mesh_edit_value = mesh_edit_accumulator; - ui.encoderPosition = 0; - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - - const int32_t rounded = (int32_t)(mesh_edit_value * 1000); - mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; - } - - if (ui.should_draw()) { - MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(mesh_edit_value)); - #if ENABLED(MESH_EDIT_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(mesh_edit_value); - #endif - } -} - -void _lcd_mesh_edit_NOP() { - ui.defer_status_screen(); -} - -float lcd_mesh_edit() { - ui.goto_screen(_lcd_mesh_edit_NOP); - ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDITOR)); - return mesh_edit_value; -} - -void lcd_mesh_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - ui.goto_screen(_lcd_mesh_edit_NOP); -} - -void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(GET_TEXT(MSG_UBL_Z_OFFSET)); -} - -float lcd_z_offset_edit() { - ui.goto_screen(_lcd_z_offset_edit); - return mesh_edit_value; -} - -void lcd_z_offset_edit_setup(const float &initial) { - mesh_edit_value = mesh_edit_accumulator = initial; - ui.goto_screen(_lcd_z_offset_edit); -} - -/** - * UBL Build Custom Mesh Command - */ -void _lcd_ubl_build_custom_mesh() { - char ubl_lcd_gcode[20]; - queue.inject_P(G28_STR); - #if HAS_HEATED_BED - sprintf_P(ubl_lcd_gcode, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_one_now(ubl_lcd_gcode); - #endif - sprintf_P(ubl_lcd_gcode, PSTR("M109 S%i"), custom_hotend_temp); - lcd_enqueue_one_now(ubl_lcd_gcode); - queue.inject_P(PSTR("G29 P1")); -} - -/** - * UBL Custom Mesh submenu - * - * << Build Mesh - * Hotend Temp: --- - * Bed Temp: --- - * Build Custom Mesh - */ -void _lcd_ubl_custom_mesh() { - START_MENU(); - BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); - EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if HAS_HEATED_BED - EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 10)); - #endif - ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); - END_MENU(); -} - -/** - * UBL Adjust Mesh Height Command - */ -void _lcd_ubl_adjust_height_cmd() { - char ubl_lcd_gcode[16]; - const int ind = ubl_height_amount > 0 ? 9 : 10; - strcpy_P(ubl_lcd_gcode, PSTR("G29 P6 C -")); - sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount)); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - -/** - * UBL Adjust Mesh Height submenu - * - * << Edit Mesh - * Height Amount: --- - * Adjust Mesh Height - * << Info Screen - */ -void _menu_ubl_height_adjust() { - START_MENU(); - BACK_ITEM(MSG_EDIT_MESH); - EDIT_ITEM(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -/** - * UBL Edit Mesh submenu - * - * << UBL Tools - * Fine Tune All - * Fine Tune Closest - * - Adjust Mesh Height >> - * << Info Screen - */ -void _lcd_ubl_edit_mesh() { - START_MENU(); - BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); - SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -/** - * UBL Validate Custom Mesh Command - */ -void _lcd_ubl_validate_custom_mesh() { - char ubl_lcd_gcode[24]; - const int temp = - #if HAS_HEATED_BED - custom_bed_temp - #else - 0 - #endif - ; - sprintf_P(ubl_lcd_gcode, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_one_now_P(G28_STR); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - -/** - * UBL Validate Mesh submenu - * - * << UBL Tools - * Mesh Validation with Material 1 - * Mesh Validation with Material 2 - * Validate Custom Mesh - * << Info Screen - */ -void _lcd_ubl_validate_mesh() { - START_MENU(); - BACK_ITEM(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #else - GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #endif - ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -/** - * UBL Grid Leveling submenu - * - * << UBL Tools - * Side points: --- - * Level Mesh - */ -void _lcd_ubl_grid_level() { - START_MENU(); - BACK_ITEM(MSG_UBL_TOOLS); - EDIT_ITEM(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); - ACTION_ITEM(MSG_UBL_MESH_LEVEL, []{ - char ubl_lcd_gcode[12]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 J%i"), side_points); - lcd_enqueue_one_now(ubl_lcd_gcode); - }); - END_MENU(); -} - -/** - * UBL Mesh Leveling submenu - * - * << UBL Tools - * 3-Point Mesh Leveling - * - Grid Mesh Leveling >> - * << Info Screen - */ -void _lcd_ubl_mesh_leveling() { - START_MENU(); - BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); - SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -/** - * UBL Fill-in Amount Mesh Command - */ -void _lcd_ubl_fillin_amount_cmd() { - char ubl_lcd_gcode[18]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - -/** - * UBL Fill-in Mesh submenu - * - * << Build Mesh - * Fill-in Amount: --- - * Fill-in Mesh - * Smart Fill-in - * Manual Fill-in - * << Info Screen - */ -void _menu_ubl_fillin() { - START_MENU(); - BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); - EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -void _lcd_ubl_invalidate() { - ubl.invalidate(); - SERIAL_ECHOLNPGM("Mesh invalidated."); -} - -/** - * UBL Build Mesh submenu - * - * << UBL Tools - * Build Mesh with Material 1 - * Build Mesh with Material 2 - * - Build Custom Mesh >> - * Build Cold Mesh - * - Fill-in Mesh >> - * Continue Bed Mesh - * Invalidate All - * Invalidate Closest - * << Info Screen - */ -void _lcd_ubl_build_mesh() { - START_MENU(); - BACK_ITEM(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - GCODES_ITEM(MSG_UBL_BUILD_MESH_M1, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - GCODES_ITEM(MSG_UBL_BUILD_MESH_M2, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - #else - GCODES_ITEM(MSG_UBL_BUILD_MESH_M1, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - GCODES_ITEM(MSG_UBL_BUILD_MESH_M2, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - #endif - SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); - GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); - ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); - ACTION_ITEM(MSG_WATCH, ui.return_to_status); - END_MENU(); -} - -/** - * UBL Load Mesh Command - */ -void _lcd_ubl_load_mesh_cmd() { - char ubl_lcd_gcode[25]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 L%i"), ubl_storage_slot); - lcd_enqueue_one_now(ubl_lcd_gcode); - sprintf_P(ubl_lcd_gcode, GET_TEXT(MSG_MESH_LOADED), ubl_storage_slot); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - -/** - * UBL Save Mesh Command - */ -void _lcd_ubl_save_mesh_cmd() { - char ubl_lcd_gcode[25]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 S%i"), ubl_storage_slot); - lcd_enqueue_one_now(ubl_lcd_gcode); - sprintf_P(ubl_lcd_gcode, GET_TEXT(MSG_MESH_SAVED), ubl_storage_slot); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - -/** - * UBL Mesh Storage submenu - * - * << Unified Bed Leveling - * Memory Slot: --- - * Load Bed Mesh - * Save Bed Mesh - */ -void _lcd_ubl_storage_mesh() { - int16_t a = settings.calc_num_meshes(); - START_MENU(); - BACK_ITEM(MSG_UBL_LEVEL_BED); - if (!WITHIN(ubl_storage_slot, 0, a - 1)) { - STATIC_ITEM(MSG_UBL_NO_STORAGE); - } - else { - EDIT_ITEM(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); - ACTION_ITEM(MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); - ACTION_ITEM(MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - } - END_MENU(); -} - -/** - * UBL LCD "radar" map homing - */ -void _lcd_ubl_output_map_lcd(); - -void _lcd_ubl_map_homing() { - ui.defer_status_screen(); - _lcd_draw_homing(); - if (all_axes_homed()) { - ubl.lcd_map_control = true; // Return to the map screen - ui.goto_screen(_lcd_ubl_output_map_lcd); - } -} - -/** - * UBL LCD "radar" map point editing - */ -void _lcd_ubl_map_lcd_edit_cmd() { - char ubl_lcd_gcode[50], str[10], str2[10]; - 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); -} - -/** - * UBL LCD Map Movement - */ -void ubl_map_move_to_xy() { - const feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); - - destination = current_position; // sync destination at the start - - #if ENABLED(DELTA) - if (current_position.z > delta_clip_start_height) { - destination.z = delta_clip_start_height; - prepare_internal_move_to_destination(fr_mm_s); - } - #endif - - destination.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); - prepare_internal_move_to_destination(fr_mm_s); -} - -/** - * UBL LCD "radar" map - */ -void set_current_from_steppers_for_axis(const AxisEnum axis); -void sync_plan_position(); - -void _lcd_do_nothing() {} -void _lcd_hard_stop() { - const screenFunc_t old_screen = ui.currentScreen; - ui.currentScreen = _lcd_do_nothing; - planner.quick_stop(); - ui.currentScreen = old_screen; - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); -} - -void _lcd_ubl_output_map_lcd() { - static int16_t step_scaler = 0; - - if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd(); - - if (ui.encoderPosition) { - step_scaler += int32_t(ui.encoderPosition); - x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); - ui.encoderPosition = 0; - ui.refresh(LCDVIEW_REDRAW_NOW); - } - - #if IS_KINEMATIC - #define KEEP_LOOPING true // Loop until a valid point is found - #else - #define KEEP_LOOPING false - #endif - - do { - // Encoder to the right (++) - if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; } - if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0; - - // Encoder to the left (--) - if (x_plot < 0) { x_plot = GRID_MAX_POINTS_X - 1; y_plot--; } - if (y_plot < 0) y_plot = GRID_MAX_POINTS_Y - 1; - - #if IS_KINEMATIC - const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; - if (position_is_reachable(xy)) break; // Found a valid point - x_plot += (step_scaler < 0) ? -1 : 1; - #endif - - } while(KEEP_LOOPING); - - // Determine number of points to edit - #if IS_KINEMATIC - n_edit_pts = 9; //TODO: Delta accessible edit points - #else - const bool xc = WITHIN(x_plot, 1, GRID_MAX_POINTS_X - 2), - yc = WITHIN(y_plot, 1, GRID_MAX_POINTS_Y - 2); - n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners - #endif - - // Cleanup - if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; - - if (ui.should_draw()) { - ui.ubl_plot(x_plot, y_plot); - - if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. - _lcd_hard_stop(); - - ubl_map_move_to_xy(); // Move to new location - } -} - -/** - * UBL Homing before LCD map - */ -void _lcd_ubl_output_map_lcd_cmd() { - if (!all_axes_known()) { - set_all_unhomed(); - queue.inject_P(G28_STR); - } - ui.goto_screen(_lcd_ubl_map_homing); -} - -/** - * UBL Output map submenu - * - * << Unified Bed Leveling - * Output for Host - * Output for CSV - * Off Printer Backup - * Output Mesh Map - */ -void _lcd_ubl_output_map() { - START_MENU(); - BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); - ACTION_ITEM(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); - END_MENU(); -} - -/** - * UBL Tools submenu - * - * << Unified Bed Leveling - * - Build Mesh >> - * - Validate Mesh >> - * - Edit Mesh >> - * - Mesh Leveling >> - */ -void _menu_ubl_tools() { - START_MENU(); - BACK_ITEM(MSG_UBL_LEVEL_BED); - SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); - SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - SUBMENU(MSG_EDIT_MESH, _lcd_ubl_edit_mesh); - SUBMENU(MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); - END_MENU(); -} - -/** - * UBL Step-By-Step submenu - * - * << Unified Bed Leveling - * 1 Build Cold Mesh - * 2 Smart Fill-in - * - 3 Validate Mesh >> - * 4 Fine Tune All - * - 5 Validate Mesh >> - * 6 Fine Tune All - * 7 Save Bed Mesh - */ -void _lcd_ubl_step_by_step() { - START_MENU(); - BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29 P3 T0")); - SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - END_MENU(); -} - -/** - * UBL System submenu - * - * << Motion - * - Manually Build Mesh >> - * - Activate UBL >> - * - Deactivate UBL >> - * - Step-By-Step UBL >> - * - Mesh Storage >> - * - Output Map >> - * - UBL Tools >> - * - Output UBL Info >> - */ - -void _lcd_ubl_level_bed() { - START_MENU(); - BACK_ITEM(MSG_MOTION); - if (planner.leveling_active) - GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); - else - GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); - SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); - ACTION_ITEM(MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); - SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); - SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); - SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools); - GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29 W")); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - editable.decimal = planner.z_fade_height; - EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); - #endif - END_MENU(); -} - -#endif // HAS_LCD_MENU && AUTO_BED_LEVELING_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/thermistornames.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/thermistornames.h deleted file mode 100644 index 17772d7880..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/thermistornames.h +++ /dev/null @@ -1,132 +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 . - * - */ - -/** - * thermistornames.h - * - * Used by LCD code to obtain a thermistor name - * - * Usage: Set THERMISTOR_ID then #include this file - * to set a new value for THERMISTOR_NAME. - */ - -#undef THERMISTOR_NAME - -// User-specified thermistor parameters -#if THERMISTOR_ID == 1000 - #define THERMISTOR_NAME "User Parameters" - -// Thermcouples -#elif THERMISTOR_ID == -5 - #define THERMISTOR_NAME "MAX31865" -#elif THERMISTOR_ID == -4 - #define THERMISTOR_NAME "AD8495" -#elif THERMISTOR_ID == -3 - #define THERMISTOR_NAME "MAX31855" -#elif THERMISTOR_ID == -2 - #define THERMISTOR_NAME "MAX6675" -#elif THERMISTOR_ID == -1 - #define THERMISTOR_NAME "AD595" - -// Standard thermistors -#elif THERMISTOR_ID == 1 - #define THERMISTOR_NAME "EPCOS 100K" -#elif THERMISTOR_ID == 2 - #define THERMISTOR_NAME "ATC 204GT-2" -#elif THERMISTOR_ID == 3 - #define THERMISTOR_NAME "Mendel-parts" -#elif THERMISTOR_ID == 4 - #define THERMISTOR_NAME "Generic 10K" -#elif THERMISTOR_ID == 5 - #define THERMISTOR_NAME "ATC 104GT-2" -#elif THERMISTOR_ID == 501 - #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" -#elif THERMISTOR_ID == 512 - #define THERMISTOR_NAME "RPW-Ultra" -#elif THERMISTOR_ID == 6 - #define THERMISTOR_NAME "EPCOS (alt)" -#elif THERMISTOR_ID == 7 - #define THERMISTOR_NAME "HW 104LAG" -#elif THERMISTOR_ID == 71 - #define THERMISTOR_NAME "HW 104LAF" -#elif THERMISTOR_ID == 8 - #define THERMISTOR_NAME "E3104FXT" -#elif THERMISTOR_ID == 9 - #define THERMISTOR_NAME "GE AL03006" -#elif THERMISTOR_ID == 10 - #define THERMISTOR_NAME "RS 198-961" -#elif THERMISTOR_ID == 11 - #define THERMISTOR_NAME "1% beta 3950" -#elif THERMISTOR_ID == 12 - #define THERMISTOR_NAME "E3104FXT (alt)" -#elif THERMISTOR_ID == 13 - #define THERMISTOR_NAME "Hisens 3950" -#elif THERMISTOR_ID == 15 - #define THERMISTOR_NAME "100k JGAurora A5" -#elif THERMISTOR_ID == 18 - #define THERMISTOR_NAME "ATC Semitec 204GT-2" -#elif THERMISTOR_ID == 20 - #define THERMISTOR_NAME "Pt100 UltiMB" -#elif THERMISTOR_ID == 201 - #define THERMISTOR_NAME "Pt100 OverLord" -#elif THERMISTOR_ID == 60 - #define THERMISTOR_NAME "Makers Tool" -#elif THERMISTOR_ID == 70 - #define THERMISTOR_NAME "Hephestos 2" -#elif THERMISTOR_ID == 75 - #define THERMISTOR_NAME "MGB18" - -// Modified thermistors -#elif THERMISTOR_ID == 51 - #define THERMISTOR_NAME "EPCOS 1K" -#elif THERMISTOR_ID == 52 - #define THERMISTOR_NAME "ATC204GT-2 1K" -#elif THERMISTOR_ID == 55 - #define THERMISTOR_NAME "ATC104GT-2 1K" -#elif THERMISTOR_ID == 1047 - #define THERMISTOR_NAME "PT1000 4K7" -#elif THERMISTOR_ID == 1010 - #define THERMISTOR_NAME "PT1000 1K" -#elif THERMISTOR_ID == 147 - #define THERMISTOR_NAME "Pt100 4K7" -#elif THERMISTOR_ID == 110 - #define THERMISTOR_NAME "Pt100 1K" -#elif THERMISTOR_ID == 666 - #define THERMISTOR_NAME "Einstart S" - -// High Temperature thermistors -#elif THERMISTOR_ID == 61 - #define THERMISTOR_NAME "Formbot 350°C" -#elif THERMISTOR_ID == 66 - #define THERMISTOR_NAME "Dyze 4.7M" -#elif THERMISTOR_ID == 67 - #define THERMISTOR_NAME "SliceEng 450°C" - -// Dummies for dev testing -#elif THERMISTOR_ID == 998 - #define THERMISTOR_NAME "Dummy 1" -#elif THERMISTOR_ID == 999 - #define THERMISTOR_NAME "Dummy 2" -#elif THERMISTOR_ID == 1000 - #define THERMISTOR_NAME "Custom" - -#endif // THERMISTOR_ID diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.cpp deleted file mode 100644 index c2e00fcce6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.cpp +++ /dev/null @@ -1,1611 +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 . - * - */ - -#include "../inc/MarlinConfigPre.h" - -#ifdef LED_BACKLIGHT_TIMEOUT - #include "../feature/leds/leds.h" -#endif - -#if ENABLED(HOST_ACTION_COMMANDS) - #include "../feature/host_actions.h" -#endif - -#include "ultralcd.h" -MarlinUI ui; - -// All displays share the MarlinUI class -#if HAS_DISPLAY - #include "../gcode/queue.h" - #include "fontutils.h" - #include "../sd/cardreader.h" - #if ENABLED(EXTENSIBLE_UI) - #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) - #endif -#endif - -#if HAS_SPI_LCD - #if ENABLED(STATUS_MESSAGE_SCROLLING) - uint8_t MarlinUI::status_scroll_offset; // = 0 - constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH)); - #else - constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH); - #endif -#elif ENABLED(EXTENSIBLE_UI) - constexpr uint8_t MAX_MESSAGE_LENGTH = 63; -#endif - -#if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) - uint8_t MarlinUI::alert_level; // = 0 - char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; -#endif - -#if ENABLED(LCD_SET_PROGRESS_MANUALLY) - MarlinUI::progress_t MarlinUI::progress_override; // = 0 - #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - uint32_t MarlinUI::remaining_time; - #endif -#endif - -#if ENABLED(PCA9632_BUZZER) || USE_BEEPER - #include "../libs/buzzer.h" // for BUZZ() macro - #if ENABLED(PCA9632_BUZZER) - #include "../feature/leds/pca9632.h" - #endif - void MarlinUI::buzz(const long duration, const uint16_t freq) { - #if ENABLED(PCA9632_BUZZER) - pca9632_buzz(duration, freq); - #elif USE_BEEPER - buzzer.tone(duration, freq); - #endif - } -#endif - -#if HAS_SPI_LCD - -#if HAS_GRAPHICAL_LCD - #include "dogm/ultralcd_DOGM.h" -#endif - -#include "lcdprint.h" - -#include "../sd/cardreader.h" -#include "../module/temperature.h" -#include "../module/planner.h" -#include "../module/printcounter.h" -#include "../module/motion.h" - -#include "../Marlin.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../feature/power_loss_recovery.h" -#endif - -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if HAS_TRINAMIC - #include "../feature/tmc_util.h" -#endif - -#if HAS_ADC_BUTTONS - #include "../module/thermistor/thermistors.h" -#endif - -#if HAS_ENCODER_ACTION - volatile uint8_t MarlinUI::buttons; - #if HAS_SLOW_BUTTONS - volatile uint8_t MarlinUI::slow_buttons; - #endif - #if ENABLED(TOUCH_BUTTONS) - #include "../feature/touch/xpt2046.h" - #endif -#endif - -#if ENABLED(INIT_SDCARD_ON_BOOT) - uint8_t lcd_sd_status; -#endif - -#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - bool MarlinUI::defer_return_to_status; -#endif - -uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed - -#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - millis_t MarlinUI::next_filament_display; // = 0 -#endif - -millis_t MarlinUI::next_button_update_ms; // = 0 - -#if HAS_GRAPHICAL_LCD - bool MarlinUI::drawing_screen, MarlinUI::first_page; // = false -#endif - -// Encoder Handling -#if HAS_ENCODER_ACTION - uint32_t MarlinUI::encoderPosition; - volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update -#endif - -#if HAS_LCD_MENU - #include "menu/menu.h" - #include "../sd/cardreader.h" - - #if ENABLED(SDSUPPORT) - - #if ENABLED(SCROLL_LONG_FILENAMES) - uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max; - #endif - - const char * MarlinUI::scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll) { - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (doScroll) { - for (uint8_t l = FILENAME_LENGTH; l--;) - hash = ((hash << 1) | (hash >> 7)) ^ theCard.filename[l]; // rotate, xor - static uint8_t filename_scroll_hash; - if (filename_scroll_hash != hash) { // If the hash changed... - filename_scroll_hash = hash; // Save the new hash - filename_scroll_max = _MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge - #endif - } - return outstr; - } - - #endif - - screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR - bool MarlinUI::screen_changed; - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - bool MarlinUI::encoderRateMultiplierEnabled; - millis_t MarlinUI::lastEncoderMovementMillis = 0; - void MarlinUI::enable_encoder_multiplier(const bool onoff) { - encoderRateMultiplierEnabled = onoff; - lastEncoderMovementMillis = 0; - } - #endif - - #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) - int8_t MarlinUI::encoderDirection = ENCODERBASE; - #endif - - #if ENABLED(TOUCH_BUTTONS) - uint8_t MarlinUI::repeat_delay; - #endif - - bool MarlinUI::lcd_clicked; - float move_menu_scale; - - bool MarlinUI::use_click() { - const bool click = lcd_clicked; - lcd_clicked = false; - return click; - } - - #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) - - bool MarlinUI::external_control; // = false - - void MarlinUI::wait_for_release() { - while (button_pressed()) safe_delay(50); - safe_delay(50); - } - - #endif - - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { - SETCURSOR(col, row); - if (!string) return; - - auto _newline = [&col, &row]() { - col = 0; row++; // Move col to string len (plus space) - SETCURSOR(0, row); // Simulate carriage return - }; - - uint8_t *p = (uint8_t*)string; - wchar_t ch; - if (wordwrap) { - uint8_t *wrd = nullptr, c = 0; - // find the end of the part - for (;;) { - if (!wrd) wrd = p; // Get word start /before/ advancing - p = get_utf8_value_cb(p, cb_read_byte, &ch); - const bool eol = !ch; // zero ends the string - // End or a break between phrases? - if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { - if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces - // Past the right and the word is not too long? - if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? - c += !eol; // +1 so the space will be printed - col += c; // advance col to new position - while (c) { // character countdown - --c; // count down to zero - wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again - lcd_put_wchar(ch); // character to the LCD - } - if (eol) break; // all done! - wrd = nullptr; // set up for next word - } - else c++; // count word characters - } - } - else { - for (;;) { - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - lcd_put_wchar(ch); - col++; - if (col >= LCD_WIDTH) _newline(); - } - } - } - - 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 col = 0, row = 0; - if (!string && plen + slen <= LCD_WIDTH) { - col = (LCD_WIDTH - plen - slen) / 2; - row = LCD_HEIGHT > 3 ? 1 : 0; - } - wrap_string_P(col, row, pref, true); - if (string) { - if (col) { col = 0; row++; } // Move to the start of the next line - wrap_string(col, row, string); - } - if (suff) wrap_string_P(col, row, suff); - } - -#endif // HAS_LCD_MENU - -void MarlinUI::init() { - - init_lcd(); - - #if HAS_DIGITAL_BUTTONS - - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - - #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); - #endif - - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - - #endif // !HAS_DIGITAL_BUTTONS - - #if HAS_SHIFT_ENCODER - - #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register - - SET_OUTPUT(SR_DATA_PIN); - SET_OUTPUT(SR_CLK_PIN); - - #elif defined(SHIFT_CLK) - - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - #if defined(SHIFT_EN) && SHIFT_EN >= 0 - OUT_WRITE(SHIFT_EN, LOW); - #endif - SET_INPUT_PULLUP(SHIFT_OUT); - - #endif - - #endif // HAS_SHIFT_ENCODER - - #if ENABLED(SDSUPPORT) - #if PIN_EXISTS(SD_DETECT) - SET_INPUT_PULLUP(SD_DETECT_PIN); - #endif - #if ENABLED(INIT_SDCARD_ON_BOOT) - lcd_sd_status = 2; // UNKNOWN - #endif - #endif - - #if HAS_ENCODER_ACTION - #if HAS_SLOW_BUTTONS - slow_buttons = 0; - #endif - #endif - - update_buttons(); - - #if HAS_ENCODER_ACTION - encoderDiff = 0; - #endif -} - -bool MarlinUI::get_blink() { - static uint8_t blink = 0; - static millis_t next_blink_ms = 0; - millis_t ms = millis(); - if (ELAPSED(ms, next_blink_ms)) { - blink ^= 0xFF; - next_blink_ms = ms + 1000 - (LCD_UPDATE_INTERVAL) / 2; - } - return blink != 0; -} - -//////////////////////////////////////////// -///////////// Keypad Handling ////////////// -//////////////////////////////////////////// - -#if ENABLED(REPRAPWORLD_KEYPAD) && HAS_ENCODER_ACTION - - volatile uint8_t MarlinUI::keypad_buttons; - - #if HAS_LCD_MENU && !HAS_ADC_BUTTONS - - void lcd_move_x(); - void lcd_move_y(); - void lcd_move_z(); - - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - encoderPosition = dir; - switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); - default: break; - } - } - - #endif - - bool MarlinUI::handle_keypad() { - - #if HAS_ADC_BUTTONS - - #define ADC_MIN_KEY_DELAY 100 - if (keypad_buttons) { - #if HAS_ENCODER_ACTION - refresh(LCDVIEW_REDRAW_NOW); - #if HAS_LCD_MENU - if (encoderDirection == -(ENCODERBASE)) { // ADC_KEYPAD forces REVERSE_MENU_DIRECTION, so this indicates menu navigation - if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; - else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } - else if (RRK(EN_KEYPAD_RIGHT)) { return_to_status(); quick_feedback(); } - } - else - #endif - { - #if HAS_LCD_MENU - if (RRK(EN_KEYPAD_UP)) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (RRK(EN_KEYPAD_DOWN)) encoderPosition += ENCODER_PULSES_PER_STEP; - else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } - else if (RRK(EN_KEYPAD_RIGHT)) encoderPosition = 0; - #else - if (RRK(EN_KEYPAD_UP) || RRK(EN_KEYPAD_LEFT)) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (RRK(EN_KEYPAD_DOWN) || RRK(EN_KEYPAD_RIGHT)) encoderPosition += ENCODER_PULSES_PER_STEP; - #endif - } - #endif - next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; - return true; - } - - #else // !HAS_ADC_BUTTONS - - static uint8_t keypad_debounce = 0; - - if (!RRK( EN_KEYPAD_F1 | EN_KEYPAD_F2 - | EN_KEYPAD_F3 | EN_KEYPAD_DOWN - | EN_KEYPAD_RIGHT | EN_KEYPAD_MIDDLE - | EN_KEYPAD_UP | EN_KEYPAD_LEFT ) - ) { - if (keypad_debounce > 0) keypad_debounce--; - } - else if (!keypad_debounce) { - keypad_debounce = 2; - - const bool homed = all_axes_homed(); - - #if HAS_LCD_MENU - - if (RRK(EN_KEYPAD_MIDDLE)) goto_screen(menu_move); - - #if DISABLED(DELTA) && Z_HOME_DIR < 0 - if (RRK(EN_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); - #endif - - if (homed) { - #if ENABLED(DELTA) || Z_HOME_DIR != -1 - if (RRK(EN_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); - #endif - if (RRK(EN_KEYPAD_F3)) _reprapworld_keypad_move(Z_AXIS, -1); - if (RRK(EN_KEYPAD_LEFT)) _reprapworld_keypad_move(X_AXIS, -1); - if (RRK(EN_KEYPAD_RIGHT)) _reprapworld_keypad_move(X_AXIS, 1); - if (RRK(EN_KEYPAD_DOWN)) _reprapworld_keypad_move(Y_AXIS, 1); - if (RRK(EN_KEYPAD_UP)) _reprapworld_keypad_move(Y_AXIS, -1); - } - - #endif // HAS_LCD_MENU - - if (!homed && RRK(EN_KEYPAD_F1)) queue.inject_P(G28_STR); - return true; - } - - #endif // !ADC_KEYPAD - - return false; - } - -#endif // REPRAPWORLD_KEYPAD - -/** - * Status Screen - * - * This is very display-dependent, so the lcd implementation draws this. - */ - -#if ENABLED(LCD_PROGRESS_BAR) - millis_t MarlinUI::progress_bar_ms; // = 0 - #if PROGRESS_MSG_EXPIRE > 0 - millis_t MarlinUI::expire_status_ms; // = 0 - #endif -#endif - -void MarlinUI::status_screen() { - - #if HAS_LCD_MENU - ENCODER_RATE_MULTIPLY(false); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - - // - // HD44780 implements the following message blinking and - // message expiration because Status Line and Progress Bar - // share the same line on the display. - // - - #if DISABLED(PROGRESS_MSG_ONCE) || (PROGRESS_MSG_EXPIRE > 0) - #define GOT_MS - const millis_t ms = millis(); - #endif - - // If the message will blink rather than expire... - #if DISABLED(PROGRESS_MSG_ONCE) - if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) - progress_bar_ms = ms; - #endif - - #if PROGRESS_MSG_EXPIRE > 0 - - // Handle message expire - if (expire_status_ms > 0) { - - // Expire the message if a job is active and the bar has ticks - if (get_progress_percent() > 2 && !print_job_timer.isPaused()) { - if (ELAPSED(ms, expire_status_ms)) { - status_message[0] = '\0'; - expire_status_ms = 0; - } - } - else { - // Defer message expiration before bar appears - // and during any pause (not just SD) - expire_status_ms += LCD_UPDATE_INTERVAL; - } - } - - #endif // PROGRESS_MSG_EXPIRE - - #endif // LCD_PROGRESS_BAR - - #if HAS_LCD_MENU - - if (use_click()) { - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - next_filament_display = millis() + 5000UL; // Show status message for 5s - #endif - goto_screen(menu_main); - #if DISABLED(NO_LCD_REINIT) - init_lcd(); // May revive the LCD if static electricity killed it - #endif - return; - } - - #endif - - #if ENABLED(ULTIPANEL_FEEDMULTIPLY) - - const int16_t old_frm = feedrate_percentage; - int16_t new_frm = old_frm + int16_t(encoderPosition); - - // Dead zone at 100% feedrate - if (old_frm == 100) { - if (int16_t(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) - new_frm -= ENCODER_FEEDRATE_DEADZONE; - else if (int16_t(encoderPosition) < -(ENCODER_FEEDRATE_DEADZONE)) - new_frm += ENCODER_FEEDRATE_DEADZONE; - else - new_frm = old_frm; - } - else if ((old_frm < 100 && new_frm > 100) || (old_frm > 100 && new_frm < 100)) - new_frm = 100; - - LIMIT(new_frm, 10, 999); - - if (old_frm != new_frm) { - feedrate_percentage = new_frm; - encoderPosition = 0; - #if HAS_BUZZER && ENABLED(BEEP_ON_FEEDRATE_CHANGE) - static millis_t next_beep; - #ifndef GOT_MS - const millis_t ms = millis(); - #endif - if (ELAPSED(ms, next_beep)) { - buzz(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); - next_beep = ms + 500UL; - } - #endif - } - - #endif // ULTIPANEL_FEEDMULTIPLY - - draw_status_screen(); -} - -void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) { - init(); - status_printf_P(1, PSTR(S_FMT ": " S_FMT), lcd_error, lcd_component); - #if HAS_LCD_MENU - return_to_status(); - #endif - - // RED ALERT. RED ALERT. - #ifdef LED_BACKLIGHT_TIMEOUT - leds.set_color(LEDColorRed()); - #ifdef NEOPIXEL_BKGD_LED_INDEX - neo.set_pixel_color(NEOPIXEL_BKGD_LED_INDEX, 255, 0, 0, 0); - neo.show(); - #endif - #endif - - draw_kill_screen(); -} - -void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { - - #if HAS_LCD_MENU - refresh(); - #endif - - #if HAS_ENCODER_ACTION - if (clear_buttons) buttons = 0; - next_button_update_ms = millis() + 500; - #else - UNUSED(clear_buttons); - #endif - - #if HAS_BUZZER - // Buzz and wait. Is the delay needed for buttons to settle? - buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #if HAS_LCD_MENU - #if USE_BEEPER - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #else - delay(10); - #endif - #endif - #endif -} - -//////////////////////////////////////////// -/////////////// Manual Move //////////////// -//////////////////////////////////////////// - -#if HAS_LCD_MENU - - extern bool no_reentry; // Flag to prevent recursion into menu handlers - - int8_t manual_move_axis = (int8_t)NO_AXIS; - millis_t manual_move_start_time = 0; - - #if IS_KINEMATIC - bool MarlinUI::processing_manual_move = false; - float manual_move_offset = 0; - #endif - - #if E_MANUAL > 1 - int8_t MarlinUI::manual_move_e_index = 0; - #endif - - /** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send a move immediately. - */ - void MarlinUI::manage_manual_move() { - - if (processing_manual_move) return; - - 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 - - #if EXTRUDERS > 1 - const int8_t old_extruder = active_extruder; - if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; - #endif - - // Set movement on a single axis - destination = current_position; - destination[manual_move_axis] += manual_move_offset; - - // Reset for the next move - manual_move_offset = 0; - manual_move_axis = (int8_t)NO_AXIS; - - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // 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_internal_move_to_destination(fr_mm_s); // will set current_position from destination - processing_manual_move = false; - - #if EXTRUDERS > 1 - active_extruder = old_extruder; - #endif - - #else - - 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 - } - } - -#endif // HAS_LCD_MENU - -/** - * Update the LCD, read encoder buttons, etc. - * - Read button states - * - Check the SD Card slot state - * - Act on RepRap World keypad input - * - Update the encoder position - * - Apply acceleration to the encoder position - * - Do refresh(LCDVIEW_CALL_REDRAW_NOW) on controller events - * - Reset the Info Screen timeout if there's any input - * - Update status indicators, if any - * - * Run the current LCD menu handler callback function: - * - Call the handler only if lcdDrawUpdate != LCDVIEW_NONE - * - Before calling the handler, LCDVIEW_CALL_NO_REDRAW => LCDVIEW_NONE - * - Call the menu handler. Menu handlers should do the following: - * - If a value changes, set lcdDrawUpdate to LCDVIEW_REDRAW_NOW and draw the value - * (Encoder events automatically set lcdDrawUpdate for you.) - * - if (should_draw()) { redraw } - * - Before exiting the handler set lcdDrawUpdate to: - * - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT. - * - LCDVIEW_REDRAW_NOW to draw now (including remaining stripes). - * - LCDVIEW_CALL_REDRAW_NEXT to draw now and get LCDVIEW_REDRAW_NOW on the next loop. - * - LCDVIEW_CALL_NO_REDRAW to draw now and get LCDVIEW_NONE on the next loop. - * - NOTE: For graphical displays menu handlers may be called 2 or more times per loop, - * so don't change lcdDrawUpdate without considering this. - * - * After the menu handler callback runs (or not): - * - Clear the LCD if lcdDrawUpdate == LCDVIEW_CLEAR_CALL_REDRAW - * - Update lcdDrawUpdate for the next loop (i.e., move one state down, usually) - * - * This function is only called from the main thread. - */ - -LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - -void MarlinUI::update() { - - static uint16_t max_display_update_time = 0; - 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 - - // Handle any queued Move Axis motion - manage_manual_move(); - - // Update button states for button_pressed(), etc. - // If the state changes the next update may be delayed 300-500ms. - update_buttons(); - - // If the action button is pressed... - static bool wait_for_unclick; // = false - - #if ENABLED(TOUCH_BUTTONS) - - #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 - } - } - } - if (!(touch_buttons & (EN_A | EN_B))) arrow_pressed = false; - } - - #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 - 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 - wait_for_unclick = false; - - if (LCD_BACK_CLICKED()) { - quick_feedback(); - goto_previous_screen(); - } - - #endif // HAS_LCD_MENU - - #if ENABLED(INIT_SDCARD_ON_BOOT) - // - // SPI SD Card detection (and first card init when the LCD is present) - // - const uint8_t sd_status = (uint8_t)IS_SD_INSERTED(); - if (sd_status != lcd_sd_status && detected()) { - - uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! - lcd_sd_status = sd_status; - - if (sd_status) { - safe_delay(500); // Some boards need a delay to get settled - card.mount(); - if (old_sd_status == 2) - card.beginautostart(); // Initial boot - else - set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); - } - #if PIN_EXISTS(SD_DETECT) - else { - card.release(); - if (old_sd_status != 2) { - set_status_P(GET_TEXT(MSG_MEDIA_REMOVED)); - #if HAS_LCD_MENU - return_to_status(); - #endif - } - } - - #if DISABLED(NO_LCD_REINIT) - init_lcd(); // May revive the LCD if static electricity killed it - #endif - - #endif - - refresh(); - - ms = millis(); - next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; // delay LCD update until after SD activity completes - - #ifdef LED_BACKLIGHT_TIMEOUT - leds.reset_timeout(ms); - #endif - } - - #endif // INIT_SDCARD_ON_BOOT - - if (ELAPSED(ms, next_lcd_update_ms) - #if HAS_GRAPHICAL_LCD - || drawing_screen - #endif - ) { - - next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; - - #if ENABLED(TOUCH_BUTTONS) - if (on_status_screen()) - next_lcd_update_ms += (LCD_UPDATE_INTERVAL) * 2; - #endif - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - update_indicators(); - #endif - - #if HAS_ENCODER_ACTION - - #if HAS_SLOW_BUTTONS - slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context - #endif - - #if ENABLED(REPRAPWORLD_KEYPAD) - if (handle_keypad()) RESET_STATUS_TIMEOUT(); - #endif - - const float abs_diff = ABS(encoderDiff); - const bool encoderPastThreshold = (abs_diff >= (ENCODER_PULSES_PER_STEP)); - if (encoderPastThreshold || lcd_clicked) { - if (encoderPastThreshold) { - - #if HAS_LCD_MENU && ENABLED(ENCODER_RATE_MULTIPLIER) - - int32_t encoderMultiplier = 1; - - if (encoderRateMultiplierEnabled) { - const float encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP); - - if (lastEncoderMovementMillis) { - // Note that the rate is always calculated between two passes through the - // loop and that the abs of the encoderDiff value is tracked. - const float encoderStepRate = encoderMovementSteps / float(ms - lastEncoderMovementMillis) * 1000; - - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; - - #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate); - SERIAL_ECHOPAIR(" Multiplier: ", encoderMultiplier); - SERIAL_ECHOPAIR(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); - SERIAL_ECHOPAIR(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); - SERIAL_EOL(); - #endif - } - - lastEncoderMovementMillis = ms; - } // encoderRateMultiplierEnabled - - #else - - constexpr int32_t encoderMultiplier = 1; - - #endif // ENCODER_RATE_MULTIPLIER - - encoderPosition += (encoderDiff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); - encoderDiff = 0; - } - - RESET_STATUS_TIMEOUT(); - - refresh(LCDVIEW_REDRAW_NOW); - - #ifdef LED_BACKLIGHT_TIMEOUT - leds.reset_timeout(ms); - #endif - } - - #endif - - // This runs every ~100ms when idling often enough. - // Instead of tracking changes just redraw the Status Screen once per second. - if (on_status_screen() && !lcd_status_update_delay--) { - lcd_status_update_delay = 9 - #if HAS_GRAPHICAL_LCD - + 3 - #endif - ; - max_display_update_time--; - refresh(LCDVIEW_REDRAW_NOW); - } - - #if HAS_LCD_MENU && ENABLED(SCROLL_LONG_FILENAMES) - // If scrolling of long file names is enabled and we are in the sd card menu, - // cause a refresh to occur until all the text has scrolled into view. - if (currentScreen == menu_media && !lcd_status_update_delay--) { - lcd_status_update_delay = 4; - if (++filename_scroll_pos > filename_scroll_max) { - filename_scroll_pos = 0; - lcd_status_update_delay = 12; - } - refresh(LCDVIEW_REDRAW_NOW); - RESET_STATUS_TIMEOUT(); - } - #endif - - // then we want to use 1/2 of the time only. - uint16_t bbr2 = planner.block_buffer_runtime() >> 1; - - if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) { - - // Change state of drawing flag between screen updates - if (!drawing_screen) switch (lcdDrawUpdate) { - case LCDVIEW_CALL_NO_REDRAW: - refresh(LCDVIEW_NONE); - break; - case LCDVIEW_CLEAR_CALL_REDRAW: - case LCDVIEW_CALL_REDRAW_NEXT: - refresh(LCDVIEW_REDRAW_NOW); - case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT - case LCDVIEW_NONE: - break; - } // switch - - #if HAS_ADC_BUTTONS - keypad_buttons = 0; - #endif - - #if HAS_GRAPHICAL_LCD - - #if ENABLED(LIGHTWEIGHT_UI) - const bool in_status = on_status_screen(), - do_u8g_loop = !in_status; - lcd_in_status(in_status); - if (in_status) status_screen(); - #else - constexpr bool do_u8g_loop = true; - #endif - - if (do_u8g_loop) { - if (!drawing_screen) { // If not already drawing pages - u8g.firstPage(); // Start the first page - drawing_screen = first_page = true; // Flag as drawing pages - } - set_font(FONT_MENU); // Setup font for every page draw - u8g.setColorIndex(1); // And reset the color - run_current_screen(); // Draw and process the current screen - first_page = false; - - // The screen handler can clear drawing_screen for an action that changes the screen. - // If still drawing and there's another page, update max-time and return now. - // The nextPage will already be set up on the next call. - if (drawing_screen && (drawing_screen = u8g.nextPage())) { - if (on_status_screen()) - NOLESS(max_display_update_time, millis() - ms); - return; - } - } - - #else - - run_current_screen(); - - #endif - - #if HAS_LCD_MENU - lcd_clicked = false; - #endif - - // Keeping track of the longest time for an individual LCD update. - // Used to do screen throttling when the planner starts to fill up. - if (on_status_screen()) - NOLESS(max_display_update_time, millis() - ms); - } - - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - // Return to Status Screen after a timeout - if (on_status_screen() || defer_return_to_status) - RESET_STATUS_TIMEOUT(); - else if (ELAPSED(ms, return_to_status_ms)) - return_to_status(); - #endif - - // Change state of drawing flag between screen updates - if (!drawing_screen) switch (lcdDrawUpdate) { - case LCDVIEW_CLEAR_CALL_REDRAW: - clear_lcd(); break; - case LCDVIEW_REDRAW_NOW: - refresh(LCDVIEW_NONE); - case LCDVIEW_NONE: - case LCDVIEW_CALL_REDRAW_NEXT: - case LCDVIEW_CALL_NO_REDRAW: - default: break; - } // switch - - } // ELAPSED(ms, next_lcd_update_ms) -} - -#if HAS_ADC_BUTTONS - - typedef struct { - uint16_t ADCKeyValueMin, ADCKeyValueMax; - uint8_t ADCKeyNo; - } _stADCKeypadTable_; - - #ifndef ADC_BUTTONS_VALUE_SCALE - #define ADC_BUTTONS_VALUE_SCALE 1.0 // for the power voltage equal to the reference voltage - #endif - #ifndef ADC_BUTTONS_R_PULLUP - #define ADC_BUTTONS_R_PULLUP 4.7 // common pull-up resistor in the voltage divider - #endif - #ifndef ADC_BUTTONS_LEFT_R_PULLDOWN - #define ADC_BUTTONS_LEFT_R_PULLDOWN 0.47 // pull-down resistor for LEFT button voltage divider - #endif - #ifndef ADC_BUTTONS_RIGHT_R_PULLDOWN - #define ADC_BUTTONS_RIGHT_R_PULLDOWN 4.7 // pull-down resistor for RIGHT button voltage divider - #endif - #ifndef ADC_BUTTONS_UP_R_PULLDOWN - #define ADC_BUTTONS_UP_R_PULLDOWN 1.0 // pull-down resistor for UP button voltage divider - #endif - #ifndef ADC_BUTTONS_DOWN_R_PULLDOWN - #define ADC_BUTTONS_DOWN_R_PULLDOWN 10.0 // pull-down resistor for DOWN button voltage divider - #endif - #ifndef ADC_BUTTONS_MIDDLE_R_PULLDOWN - #define ADC_BUTTONS_MIDDLE_R_PULLDOWN 2.2 // pull-down resistor for MIDDLE button voltage divider - #endif - - // Calculate the ADC value for the voltage divider with specified pull-down resistor value - #define ADC_BUTTON_VALUE(r) int(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)) - - static constexpr uint16_t adc_button_tolerance = HAL_ADC_RANGE * 25 / 1024, - adc_other_button = HAL_ADC_RANGE * 1000 / 1024; - static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { - // VALUE_MIN, VALUE_MAX, KEY - { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1 }, // F1 - { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F2 }, // F2 - { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F3 }, // F3 - { ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) - adc_button_tolerance, - ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_LEFT }, // LEFT ( 272 ... 472) - { ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) - adc_button_tolerance, - ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_RIGHT }, // RIGHT (1948 ... 2148) - { ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) - adc_button_tolerance, - ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_UP }, // UP ( 618 ... 818) - { ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) - adc_button_tolerance, - ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_DOWN }, // DOWN (2686 ... 2886) - { ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - adc_button_tolerance, - ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405) - }; - - uint8_t get_ADC_keyValue() { - if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw; - thermalManager.current_ADCKey_raw = HAL_ADC_RANGE; - thermalManager.ADCKey_count = 0; - if (currentkpADCValue < adc_other_button) - for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { - const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), - hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); - if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); - } - } - return 0; - } - -#endif // HAS_ADC_BUTTONS - -#if HAS_ENCODER_ACTION - - #if DISABLED(ADC_KEYPAD) && (ENABLED(REPRAPWORLD_KEYPAD) || !HAS_DIGITAL_BUTTONS) - - /** - * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) - * These values are independent of which pins are used for EN_A and EN_B indications - * The rotary encoder part is also independent to the chipset used for the LCD - */ - #define GET_SHIFT_BUTTON_STATES(DST) \ - uint8_t new_##DST = 0; \ - WRITE(SHIFT_LD, LOW); \ - WRITE(SHIFT_LD, HIGH); \ - for (int8_t i = 0; i < 8; i++) { \ - new_##DST >>= 1; \ - if (READ(SHIFT_OUT)) SBI(new_##DST, 7); \ - WRITE(SHIFT_CLK, HIGH); \ - WRITE(SHIFT_CLK, LOW); \ - } \ - DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 - - #endif - - /** - * Read encoder buttons from the hardware registers - * Warning: This function is called from interrupt context! - */ - void MarlinUI::update_buttons() { - const millis_t now = millis(); - if (ELAPSED(now, next_button_update_ms)) { - - #if HAS_DIGITAL_BUTTONS - - #if ANY_BUTTON(EN1, EN2, ENC, BACK) - - uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif - - #else - - constexpr uint8_t newbutton = 0; - - #endif - - // - // Directional buttons - // - #if ANY_BUTTON(UP, DWN, LFT, RT) - - const int8_t pulses = (ENCODER_PULSES_PER_STEP) * encoderDirection; - - if (false) { - // for the else-ifs below - } - #if BUTTON_EXISTS(UP) - else if (BUTTON_PRESSED(UP)) { - encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(DWN) - else if (BUTTON_PRESSED(DWN)) { - encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(LFT) - else if (BUTTON_PRESSED(LFT)) { - encoderDiff = -pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(RT) - else if (BUTTON_PRESSED(RT)) { - encoderDiff = pulses; - next_button_update_ms = now + 300; - } - #endif - - #endif // UP || DWN || LFT || RT - - buttons = (newbutton - #if HAS_SLOW_BUTTONS - | slow_buttons - #endif - ); - - #elif HAS_ADC_BUTTONS - - buttons = 0; - - #endif - - #if HAS_ADC_BUTTONS - if (keypad_buttons == 0) { - const uint8_t b = get_ADC_keyValue(); - if (WITHIN(b, 1, 8)) keypad_buttons = _BV(b - 1); - } - #endif - - #if HAS_SHIFT_ENCODER - - GET_SHIFT_BUTTON_STATES(( - #if ENABLED(REPRAPWORLD_KEYPAD) - keypad_buttons - #else - buttons - #endif - )); - - #endif - - } // next_button_update_ms - - #if HAS_ENCODER_WHEEL - static uint8_t lastEncoderBits; - - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 - - // Manage encoder rotation - #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: encoderDiff += encoderDirection; break; case _E2: encoderDiff -= encoderDirection; } - - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case encrot0: ENCODER_SPIN(encrot3, encrot1); break; - case encrot1: ENCODER_SPIN(encrot0, encrot2); break; - case encrot2: ENCODER_SPIN(encrot1, encrot3); break; - case encrot3: ENCODER_SPIN(encrot2, encrot0); break; - } - if (external_control) { - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. - #endif - encoderDiff = 0; // Hide the encoder event from the current screen handler. - } - lastEncoderBits = enc; - } - - #endif // HAS_ENCODER_WHEEL - } - -#endif // HAS_ENCODER_ACTION - -#endif // HAS_SPI_LCD - -#if HAS_DISPLAY - - #if ENABLED(EXTENSIBLE_UI) - #include "extensible_ui/ui_api.h" - #endif - - //////////////////////////////////////////// - /////////////// Status Line //////////////// - //////////////////////////////////////////// - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - void MarlinUI::advance_status_scroll() { - // Advance by one UTF8 code-word - if (status_scroll_offset < utf8_strlen(status_message)) - while (!START_OF_UTF8_CHAR(status_message[++status_scroll_offset])); - else - status_scroll_offset = 0; - } - char* MarlinUI::status_and_len(uint8_t &len) { - char *out = status_message + status_scroll_offset; - len = utf8_strlen(out); - return out; - } - #endif - - void MarlinUI::finish_status(const bool persist) { - - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) - UNUSED(persist); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - progress_bar_ms = millis(); - #if PROGRESS_MSG_EXPIRE > 0 - expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; - #endif - #endif - - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - next_filament_display = millis() + 5000UL; // Show status message for 5s - #endif - - #if HAS_SPI_LCD && ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onStatusChanged(status_message); - #endif - } - - bool MarlinUI::has_status() { return (status_message[0] != '\0'); } - - void MarlinUI::set_status(const char * const message, const bool persist) { - if (alert_level) return; - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #endif - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(*pend)) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy(status_message, message, maxLen); - status_message[maxLen] = '\0'; - - finish_status(persist); - } - - #include - - void MarlinUI::status_printf_P(const uint8_t level, PGM_P const fmt, ...) { - if (level < alert_level) return; - alert_level = level; - va_list args; - va_start(args, fmt); - vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args); - va_end(args); - finish_status(level > 0); - } - - void MarlinUI::set_status_P(PGM_P const message, int8_t level) { - if (level < 0) level = alert_level = 0; - if (level < alert_level) return; - alert_level = level; - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #endif - - // Since the message is encoded in UTF8 it must - // only be cut on a character boundary. - - // Get a pointer to the null terminator - PGM_P pend = message + strlen_P(message); - - // If length of supplied UTF8 string is greater than - // the buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy_P(status_message, message, maxLen); - status_message[maxLen] = '\0'; - - finish_status(level > 0); - } - - void MarlinUI::set_alert_status_P(PGM_P const message) { - set_status_P(message, 1); - #if HAS_LCD_MENU - return_to_status(); - #endif - } - - #include "../Marlin.h" - #include "../module/printcounter.h" - - PGM_P print_paused = GET_TEXT(MSG_PRINT_PAUSED); - - /** - * Reset the status message - */ - void MarlinUI::reset_status() { - PGM_P printing = GET_TEXT(MSG_PRINTING); - PGM_P welcome = GET_TEXT(WELCOME_MSG); - #if SERVICE_INTERVAL_1 > 0 - static const char service1[] PROGMEM = { "> " SERVICE_NAME_1 "!" }; - #endif - #if SERVICE_INTERVAL_2 > 0 - static const char service2[] PROGMEM = { "> " SERVICE_NAME_2 "!" }; - #endif - #if SERVICE_INTERVAL_3 > 0 - static const char service3[] PROGMEM = { "> " SERVICE_NAME_3 "!" }; - #endif - PGM_P msg; - if (printingIsPaused()) - msg = print_paused; - #if ENABLED(SDSUPPORT) - else if (IS_SD_PRINTING()) - return set_status(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - - #if SERVICE_INTERVAL_1 > 0 - else if (print_job_timer.needsService(1)) msg = service1; - #endif - #if SERVICE_INTERVAL_2 > 0 - else if (print_job_timer.needsService(2)) msg = service2; - #endif - #if SERVICE_INTERVAL_3 > 0 - else if (print_job_timer.needsService(3)) msg = service3; - #endif - - else - msg = welcome; - - set_status_P(msg, -1); - } - - #if ENABLED(SDSUPPORT) - extern bool wait_for_user, wait_for_heatup; - #endif - - void MarlinUI::abort_print() { - #if ENABLED(SDSUPPORT) - wait_for_heatup = wait_for_user = false; - card.flag.abort_sd_printing = true; - #endif - #ifdef ACTION_ON_CANCEL - host_action_cancel(); - #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), PSTR("Dismiss")); - #endif - print_job_timer.stop(); - set_status_P(GET_TEXT(MSG_PRINT_ABORTED)); - #if HAS_LCD_MENU - return_to_status(); - #endif - } - - #if ANY(PARK_HEAD_ON_PAUSE, SDSUPPORT) - #include "../gcode/queue.h" - #endif - - void MarlinUI::pause_print() { - #if HAS_LCD_MENU - synchronize(GET_TEXT(MSG_PAUSE_PRINT)); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - if (recovery.enabled) recovery.save(true, false); - #endif - - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")); - #endif - - set_status_P(print_paused); - - #if ENABLED(PARK_HEAD_ON_PAUSE) - #if HAS_SPI_LCD - lcd_pause_show_message(PAUSE_MESSAGE_PAUSING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress - #endif - queue.inject_P(PSTR("M25 P\nM24")); - #elif ENABLED(SDSUPPORT) - queue.inject_P(PSTR("M25")); - #elif defined(ACTION_ON_PAUSE) - host_action_pause(); - #endif - } - - void MarlinUI::resume_print() { - reset_status(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - wait_for_heatup = wait_for_user = false; - #endif - if (IS_SD_PAUSED()) queue.inject_P(M24_STR); - #ifdef ACTION_ON_RESUME - host_action_resume(); - #endif - print_job_timer.start(); // Also called by M24 - } - - #if HAS_PRINT_PROGRESS - - MarlinUI::progress_t MarlinUI::_get_progress() { - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - const progress_t p = progress_override & PROGRESS_MASK; - #else - constexpr progress_t p = 0; - #endif - return (p - #if ENABLED(SDSUPPORT) - #if HAS_PRINT_PROGRESS_PERMYRIAD - ?: card.permyriadDone() - #else - ?: card.percentDone() - #endif - #endif - ); - } - - #endif - -#else // !HAS_DISPLAY - - // - // Send the status line as a host notification - // - - void MarlinUI::set_status(const char * const message, const bool) { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #else - UNUSED(message); - #endif - } - - void MarlinUI::set_status_P(PGM_P message, const int8_t) { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #else - UNUSED(message); - #endif - } - - void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) { - #if ENABLED(HOST_PROMPT_SUPPORT) - host_action_notify(message); - #else - UNUSED(message); - #endif - } - -#endif // !HAS_DISPLAY diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.h deleted file mode 100644 index 7fc3a5f731..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/lcd/ultralcd.h +++ /dev/null @@ -1,630 +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 - -#include "../inc/MarlinConfig.h" - -#if HAS_BUZZER - #include "../libs/buzzer.h" -#endif - -#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL) || BUTTON_EXISTS(EN1, EN2) || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) -#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL)))) -#define HAS_ENCODER_WHEEL ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTON_EXISTS(EN1, EN2)) -#define HAS_ENCODER_ACTION (HAS_LCD_MENU || ENABLED(ULTIPANEL_FEEDMULTIPLY)) - -// I2C buttons must be read in the main thread -#define HAS_SLOW_BUTTONS EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2) - -#if HAS_SPI_LCD - - #include "../Marlin.h" - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" - #include "../module/motion.h" // for active_extruder - #endif - - enum LCDViewAction : uint8_t { - LCDVIEW_NONE, - LCDVIEW_REDRAW_NOW, - LCDVIEW_CALL_REDRAW_NEXT, - LCDVIEW_CLEAR_CALL_REDRAW, - LCDVIEW_CALL_NO_REDRAW - }; - - #if HAS_ADC_BUTTONS - uint8_t get_ADC_keyValue(); - #endif - - #if ENABLED(TOUCH_BUTTONS) - #define LCD_UPDATE_INTERVAL 50 - #else - #define LCD_UPDATE_INTERVAL 100 - #endif - - #if HAS_LCD_MENU - - #if HAS_GRAPHICAL_LCD - #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) - #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) - #else - #define SETCURSOR(col, row) lcd_moveto(col, row) - #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row) - #endif - - #include "lcdprint.h" - - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); - inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } - inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } - - #if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" - #endif - - typedef void (*screenFunc_t)(); - typedef void (*menuAction_t)(); - - // Manual Movement - 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); - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) - void lcd_mesh_edit_setup(const float &initial); - float lcd_mesh_edit(); - #endif - - #endif // HAS_LCD_MENU - -#endif - -// REPRAPWORLD_KEYPAD (and ADC_KEYPAD) -#if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_OFFSET 0 // Bit offset into buttons for shift register values - - #define BLEN_KEYPAD_F3 0 - #define BLEN_KEYPAD_F2 1 - #define BLEN_KEYPAD_F1 2 - #define BLEN_KEYPAD_DOWN 3 - #define BLEN_KEYPAD_RIGHT 4 - #define BLEN_KEYPAD_MIDDLE 5 - #define BLEN_KEYPAD_UP 6 - #define BLEN_KEYPAD_LEFT 7 - - #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) - #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) - #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) - #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) - #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) - #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) - #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) - #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) - - #define RRK(B) (keypad_buttons & (B)) - - #ifdef EN_C - #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) - #else - #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) - #endif - -#endif - -#if HAS_DIGITAL_BUTTONS - - // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) - #define BLEN_A 0 - #define BLEN_B 1 - - #define EN_A _BV(BLEN_A) - #define EN_B _BV(BLEN_B) - - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - - #if BUTTON_EXISTS(ENC) || ENABLED(TOUCH_BUTTONS) - #define BLEN_C 2 - #define EN_C _BV(BLEN_C) - #endif - - #if ENABLED(LCD_I2C_VIKI) - - #include - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) - - #if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used - #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name - #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented. - #else - #define BUTTON_CLICK() (buttons & (B_MI|B_RI)) - #endif - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later - - #define BUTTON_CLICK() (buttons & B_MI) - - #endif - - #endif - -#else - - #undef BUTTON_EXISTS - #define BUTTON_EXISTS(...) false - - // Shift register bits correspond to buttons: - #define BL_LE 7 // Left - #define BL_UP 6 // Up - #define BL_MI 5 // Middle - #define BL_DW 4 // Down - #define BL_RI 3 // Right - #define BL_ST 2 // Red Button - #define B_LE (_BV(BL_LE)) - #define B_UP (_BV(BL_UP)) - #define B_MI (_BV(BL_MI)) - #define B_DW (_BV(BL_DW)) - #define B_RI (_BV(BL_RI)) - #define B_ST (_BV(BL_ST)) - - #ifndef BUTTON_CLICK - #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) - #endif - -#endif - -#if BUTTON_EXISTS(BACK) || ENABLED(TOUCH_BUTTONS) - #define BLEN_D 3 - #define EN_D _BV(BLEN_D) - #define LCD_BACK_CLICKED() (buttons & EN_D) -#else - #define LCD_BACK_CLICKED() false -#endif - -#ifndef BUTTON_CLICK - #ifdef EN_C - #define BUTTON_CLICK() (buttons & EN_C) - #else - #define BUTTON_CLICK() false - #endif -#endif - -#if HAS_GRAPHICAL_LCD - enum MarlinFont : uint8_t { - FONT_STATUSMENU = 1, - FONT_EDIT, - FONT_MENU - }; -#else - enum HD44780CharSet : uint8_t { - CHARSET_MENU, - CHARSET_INFO, - CHARSET_BOOT - }; -#endif - -//////////////////////////////////////////// -//////////// MarlinUI Singleton //////////// -//////////////////////////////////////////// - -class MarlinUI { -public: - - MarlinUI() { - #if HAS_LCD_MENU - currentScreen = status_screen; - #endif - } - - #if HAS_BUZZER - static void buzz(const long duration, const uint16_t freq); - #endif - - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void update_indicators(); - #endif - - // LCD implementations - static void clear_lcd(); - static void init_lcd(); - - #if HAS_DISPLAY - - static void init(); - static void update(); - static void set_alert_status_P(PGM_P const message); - - static char status_message[]; - static bool has_status(); - - static uint8_t alert_level; // Higher levels block lower levels - static inline void reset_alert_level() { alert_level = 0; } - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static uint8_t status_scroll_offset; - static void advance_status_scroll(); - static char* status_and_len(uint8_t &len); - #endif - - static void abort_print(); - static void pause_print(); - static void resume_print(); - - #if HAS_PRINT_PROGRESS - #if HAS_PRINT_PROGRESS_PERMYRIAD - typedef uint16_t progress_t; - #define PROGRESS_SCALE 100U - #define PROGRESS_MASK 0x7FFF - #else - typedef uint8_t progress_t; - #define PROGRESS_SCALE 1U - #define PROGRESS_MASK 0x7F - #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - static progress_t progress_override; - static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); } - static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); } - static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); } - #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - static uint32_t remaining_time; - FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; } - FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time; } - FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); } - #endif - #endif - static progress_t _get_progress(); - #if HAS_PRINT_PROGRESS_PERMYRIAD - FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); } - #endif - static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); } - #else - static constexpr uint8_t get_progress_percent() { return 0; } - #endif - - #if HAS_SPI_LCD - - static millis_t next_button_update_ms; - - static bool detected(); - - static LCDViewAction lcdDrawUpdate; - FORCE_INLINE static bool should_draw() { return bool(lcdDrawUpdate); } - FORCE_INLINE static void refresh(const LCDViewAction type) { lcdDrawUpdate = type; } - FORCE_INLINE static void refresh() { refresh(LCDVIEW_CLEAR_CALL_REDRAW); } - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - static void draw_custom_bootscreen(const uint8_t frame=0); - static void show_custom_bootscreen(); - #endif - - #if ENABLED(SHOW_BOOTSCREEN) - static void draw_marlin_bootscreen(const bool line2=false); - static void show_marlin_bootscreen(); - static void show_bootscreen(); - #endif - - #if HAS_GRAPHICAL_LCD - - static bool drawing_screen, first_page; - - static void set_font(const MarlinFont font_nr); - - #else - - static constexpr bool drawing_screen = false, first_page = true; - - static void set_custom_characters(const HD44780CharSet screen_charset=CHARSET_INFO); - - #if ENABLED(LCD_PROGRESS_BAR) - 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 expire_status_ms; // = 0 - FORCE_INLINE static void reset_progress_bar_timeout() { expire_status_ms = 0; } - #endif - #endif - - #endif - - static uint8_t lcd_status_update_delay; - - #if HAS_LCD_CONTRAST - static int16_t contrast; - static void set_contrast(const int16_t value); - FORCE_INLINE static void refresh_contrast() { set_contrast(contrast); } - #endif - - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - static millis_t next_filament_display; - #endif - - static void quick_feedback(const bool clear_buttons=true); - #if HAS_BUZZER - static void completion_feedback(const bool good=true); - #endif - - #if DISABLED(LIGHTWEIGHT_UI) - static void draw_status_message(const bool blink); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void draw_hotend_status(const uint8_t row, const uint8_t extruder); - #endif - - static void status_screen(); - - #else - static void refresh() {} - #endif - - static bool get_blink(); - static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component); - static void draw_kill_screen(); - static void set_status(const char* const message, const bool persist=false); - static void set_status_P(PGM_P const message, const int8_t level=0); - static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); - static void reset_status(); - - #else // No LCD - - // Send status to host as a notification - void set_status(const char* message, const bool=false); - void set_status_P(PGM_P message, const int8_t=0); - void status_printf_P(const uint8_t, PGM_P message, ...); - - static inline void init() {} - static inline void update() {} - static inline void refresh() {} - static inline void return_to_status() {} - static inline void set_alert_status_P(PGM_P const) {} - static inline void reset_status() {} - static inline void reset_alert_level() {} - static constexpr bool has_status() { return false; } - - #endif - - #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; - static void enable_encoder_multiplier(const bool onoff); - #endif - - #if ENABLED(SDSUPPORT) - #if ENABLED(SCROLL_LONG_FILENAMES) - static uint8_t filename_scroll_pos, filename_scroll_max; - #endif - static const char * scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll); - #endif - - #if IS_KINEMATIC - static bool processing_manual_move; - #else - static constexpr bool processing_manual_move = false; - #endif - - #if E_MANUAL > 1 - static int8_t manual_move_e_index; - #else - static constexpr int8_t manual_move_e_index = 0; - #endif - - static int16_t preheat_hotend_temp[2], preheat_bed_temp[2]; - static uint8_t preheat_fan_speed[2]; - - // Select Screen (modal NO/YES style dialog) - static bool selection; - static void set_selection(const bool sel) { selection = sel; } - static bool update_selection(); - - static void manage_manual_move(); - - static bool lcd_clicked; - static bool use_click(); - - static void synchronize(PGM_P const msg=nullptr); - - static screenFunc_t currentScreen; - static bool screen_changed; - static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0); - static void save_previous_screen(); - - // goto_previous_screen and go_back may also be used as menu item callbacks - #if ENABLED(TURBO_BACK_MENU_ITEM) - static void _goto_previous_screen(const bool is_back); - static inline void goto_previous_screen() { _goto_previous_screen(false); } - static inline void go_back() { _goto_previous_screen(true); } - #else - static void _goto_previous_screen(); - FORCE_INLINE static void goto_previous_screen() { _goto_previous_screen(); } - FORCE_INLINE static void go_back() { _goto_previous_screen(); } - #endif - - static void return_to_status(); - static inline bool on_status_screen() { return currentScreen == status_screen; } - FORCE_INLINE static void run_current_screen() { (*currentScreen)(); } - - #if ENABLED(LIGHTWEIGHT_UI) - static void lcd_in_status(const bool inStatus); - #endif - - FORCE_INLINE static void defer_status_screen(const bool defer=true) { - #if LCD_TIMEOUT_TO_STATUS - defer_return_to_status = defer; - #else - UNUSED(defer); - #endif - } - - static inline void goto_previous_screen_no_defer() { - defer_status_screen(false); - goto_previous_screen(); - } - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - static void reselect_last_file(); - #endif - - #if ENABLED(G26_MESH_VALIDATION) - FORCE_INLINE static void chirp() { - #if HAS_BUZZER - buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #endif - } - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) - static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot); - #endif - - static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr); - - #elif HAS_SPI_LCD - - static constexpr bool lcd_clicked = false; - static constexpr bool on_status_screen() { return true; } - FORCE_INLINE static void run_current_screen() { status_screen(); } - - #endif - - #if ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) - static bool wait_for_bl_move; - #else - static constexpr bool wait_for_bl_move = false; - #endif - - #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) - static bool external_control; - FORCE_INLINE static void capture() { external_control = true; } - FORCE_INLINE static void release() { external_control = false; } - #else - static constexpr bool external_control = false; - #endif - - #if HAS_ENCODER_ACTION - - static volatile uint8_t buttons; - #if ENABLED(REPRAPWORLD_KEYPAD) - static volatile uint8_t keypad_buttons; - static bool handle_keypad(); - #endif - #if HAS_SLOW_BUTTONS - static volatile uint8_t slow_buttons; - static uint8_t read_slow_buttons(); - #endif - - static void update_buttons(); - static inline bool button_pressed() { return BUTTON_CLICK(); } - #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) - static void wait_for_release(); - #endif - - static uint32_t encoderPosition; - - #if ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODERBASE -1 - #else - #define ENCODERBASE +1 - #endif - - #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) - static int8_t encoderDirection; - #else - static constexpr int8_t encoderDirection = ENCODERBASE; - #endif - - FORCE_INLINE static void encoder_direction_normal() { - #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) - encoderDirection = ENCODERBASE; - #endif - } - - FORCE_INLINE static void encoder_direction_menus() { - #if ENABLED(REVERSE_MENU_DIRECTION) - encoderDirection = -(ENCODERBASE); - #endif - } - - FORCE_INLINE static void encoder_direction_select() { - #if ENABLED(REVERSE_SELECT_DIRECTION) - encoderDirection = -(ENCODERBASE); - #endif - } - - #else - - static inline void update_buttons() {} - - #endif - -private: - - static void _synchronize(); - - #if HAS_DISPLAY - static void finish_status(const bool persist); - #endif - - #if HAS_SPI_LCD - #if HAS_LCD_MENU - #if LCD_TIMEOUT_TO_STATUS - static bool defer_return_to_status; - #else - static constexpr bool defer_return_to_status = false; - #endif - #endif - static void draw_status_screen(); - #endif -}; - -extern MarlinUI ui; - -#define LCD_MESSAGEPGM_P(x) ui.set_status_P(x) -#define LCD_ALERTMESSAGEPGM_P(x) ui.set_alert_status_P(x) - -#define LCD_MESSAGEPGM(x) LCD_MESSAGEPGM_P(GET_TEXT(x)) -#define LCD_ALERTMESSAGEPGM(x) LCD_ALERTMESSAGEPGM_P(GET_TEXT(x)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/000_l6470_read_me.md b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/000_l6470_read_me.md deleted file mode 100644 index 712ced551b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/000_l6470_read_me.md +++ /dev/null @@ -1,105 +0,0 @@ -Arduino-6470 library revision 0.7.0 or above is required. - -This software can be used with any L647x chip and the powerSTEP01. L647x and powerSTEP01 devices can not be mixed within a system. A flag in the library must be set to enable use of a powerSTEP01. - -These devices use voltage PWMs to drive the stepper phases. Phase current is not directly controlled. Each microstep corresponds to a particular PWM duty cycle. The KVAL\_HOLD register scales the PWM duty cycle. - -This software assumes that all L6470 drivers are in one SPI daisy chain. - -``` - The hardware setup is: - - MOSI from controller tied to SDI on the first device - - SDO of the first device is tied to SDI of the next device - - SDO of the last device is tied to MISO of the controller - - all devices share the same SCK, SS\_PIN and RESET\_PIN - - Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). - - Each L6470 acts on the **last** SPI data it saw when the SS\_PIN **goes high**. -``` - -The L6470 drivers operate in STEP\_CLOCK mode. In this mode the direction and enable are done via SPI commands and the phase currents are changed in response to step pulses (generated in the usual way). - -There are two different SPI routines used. - -- **uint8\_t** L6470\_Transfer(uint8\_t data, int \_SSPin, const uint8\_t chain\_position) is used to setup the chips and by the maintenance/status code. This code uses the Arduino-6470 library. - -- **void** L6470\_Transfer(uint8\_t L6470\_buf[], const uint8\_t length) is used by the set\_directions() routine to send the direction/enable commands. The library is NOT used by this code. - -**HARDWARE/SOFTWARE interaction** - -Powering up a stepper and setting the direction are done by the same command. Can't do one without the other. - -**All** directions are set **every time** a new block is popped off the queue by the stepper ISR. - -SPI transfers, when setting the directions, are minimized by using arrays and a SPI routine dedicated to this function. L6470 library calls are not used. For N L6470 drivers, this results in a N byte transfer. If library calls were used then N\*N bytes would be sent. - -**Power up (reset) sequence:** - -1. Stepper objects are created before the **setup()** entry point is reached. - -2. After the **setup()** entry point is reached and before the steppers are initialized, L6470\_init() is called to do the following - -3. If present, the hardware reset is pulsed. - -4. The L6470\_chain array is populated during **setup()**. This array is used to tell where in the SPI stream the commands/data for an stepper is positioned. - -5. The L6470 soft SPI pins are initialized. - -6. The L6470 chips are initialized during **setup()**. They can be re-initialized using the **L6470\_init\_to\_defaults()** function - -The steppers are **NOT** powered up during this sequence. - -**L6470\_chain** array - -This array is used by all routines that transmit SPI data. - -``` - Location 0 - number of drivers in chain - - Location 1 - axis index for first device in the chain (closest to MOSI) - - ... - - Location N - axis index for last device in the N device long chain (closest to MISO) -``` - -**Direction set and enable** - -The DIR\_WRITE macros for the L6470 drivers are written so that the standard X, Y, Z and extruder logic used by the set\_directions() routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array *L6470\_dir\_commands*. - -At the end of the set\_directions() routine, the array *L6470\_chain* is used to grab the corresponding direction/enable commands out of the array *L6470\_dir\_commands* and put them in the correct sequence in the array *L6470\_buf*. Array *L6470\_buf* is then passed to the **void** L6470\_Transfer function which actually sends the data to the devices. - -**Utilities and misc** - -The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. G28 sets them to the Marlin counts for the corresponding axis after homing. NOTE – these registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the M114 D command. - -The **L6470\_monitor** feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The KVAL\_HOLD value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present. - -**M122** displays the settings of most of the bits in the status register plus a couple of other items. - -**M906** can be used to set the KVAL\_HOLD register one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed. - -**M916, M917 & M918** - -These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and KVAL\_HOLD settings. In general they seem to provide an overly optimistic KVAL\_HOLD setting because of the lag between setting KVAL\_HOLD and the driver reaching final temperature. Enabling the **L6470\_monitor** feature during prints will provide the **final useful KVAL\_HOLD setting**. - -The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration and top speed increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed and power dissipated by the driver. - -**M916 -** Increases KVAL\_HOLD while moving one axis until get thermal warning. This routine is also useful for determining the approximate KVAL\_HOLD where the stepper stops losing steps. The sound will get noticeably quieter as it stops losing steps. - -**M917 -** Find minimum current thresholds. This is done by doing the following steps while moving an axis: - -1. Decrease OCD current until overcurrent error - -2. Increase OCD until overcurrent error goes away - -3. Decrease stall threshold until stall error - -4. Increase stall until stall error goes away - -**M918 -** Increase speed until error or max feedrate achieved. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.cpp deleted file mode 100644 index 549ba3c364..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ /dev/null @@ -1,796 +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 . - * - */ - -/** - * The monitor_driver routines are a close copy of the TMC code - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "L6470_Marlin.h" - -L6470_Marlin L6470; - -#include "../../module/stepper/indirection.h" -#include "../../module/planner.h" -#include "../../gcode/gcode.h" - -#define DEBUG_OUT ENABLED(L6470_CHITCHAT) -#include "../../core/debug_out.h" - -uint8_t L6470_Marlin::dir_commands[MAX_L6470]; // array to hold direction command for each driver - -char L6470_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; - -bool L6470_Marlin::index_to_dir[MAX_L6470] = { - INVERT_X_DIR , // 0 X - INVERT_Y_DIR , // 1 Y - INVERT_Z_DIR , // 2 Z - #if ENABLED(X_DUAL_STEPPER_DRIVERS) - INVERT_X_DIR ^ INVERT_X2_VS_X_DIR , // 3 X2 - #else - INVERT_X_DIR , // 3 X2 - #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR , // 4 Y2 - #else - INVERT_Y_DIR , // 4 Y2 - #endif - INVERT_Z_DIR , // 5 Z2 - INVERT_Z_DIR , // 6 Z3 - INVERT_E0_DIR , // 7 E0 - INVERT_E1_DIR , // 8 E1 - INVERT_E2_DIR , // 9 E2 - INVERT_E3_DIR , //10 E3 - INVERT_E4_DIR , //11 E4 - INVERT_E5_DIR , //12 E5 -}; - -uint8_t L6470_Marlin::axis_xref[MAX_L6470] = { - AxisEnum(X_AXIS), // X - AxisEnum(Y_AXIS), // Y - AxisEnum(Z_AXIS), // Z - AxisEnum(X_AXIS), // X2 - AxisEnum(Y_AXIS), // Y2 - AxisEnum(Z_AXIS), // Z2 - AxisEnum(Z_AXIS), // Z3 - AxisEnum(E_AXIS), // E0 - AxisEnum(E_AXIS), // E1 - AxisEnum(E_AXIS), // E2 - AxisEnum(E_AXIS), // E3 - AxisEnum(E_AXIS), // E4 - AxisEnum(E_AXIS) // E5 -}; - -volatile bool L6470_Marlin::spi_abort = false; -bool L6470_Marlin::spi_active = false; - -void L6470_Marlin::populate_chain_array() { - - #define _L6470_INIT_SPI(Q) do{ stepper##Q.set_chain_info(Q, Q##_CHAIN_POS); }while(0) - - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_INIT_SPI(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_SPI(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_SPI(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_SPI(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_SPI(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_SPI(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_SPI(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_SPI(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_SPI(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_SPI(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_SPI(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_SPI(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_INIT_SPI(E5); - #endif -} - -void L6470_Marlin::init() { // Set up SPI and then init chips - #if PIN_EXISTS(L6470_RESET_CHAIN) - OUT_WRITE(L6470_RESET_CHAIN_PIN, LOW); // hardware reset of drivers - delay(1); - OUT_WRITE(L6470_RESET_CHAIN_PIN, HIGH); - delay(1); // need about 650uS for the chip to fully start up - #endif - populate_chain_array(); // Set up array to control where in the SPI transfer sequence a particular stepper's data goes - L6470_spi_init(); // Set up L6470 soft SPI pins - init_to_defaults(); // init the chips -} - -uint16_t L6470_Marlin::get_status(const uint8_t axis) { - - #define GET_L6470_STATUS(Q) stepper##Q.getStatus() - - switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: return GET_L6470_STATUS(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_STATUS(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_STATUS(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_STATUS(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_STATUS(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_STATUS(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_STATUS(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_STATUS(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_STATUS(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_STATUS(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_STATUS(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_STATUS(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: return GET_L6470_STATUS(E5); - #endif - } - - return 0; // Not needed but kills a compiler warning -} - -uint32_t L6470_Marlin::get_param(uint8_t axis, uint8_t param) { - - #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) - - switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: return GET_L6470_PARAM(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_PARAM(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_PARAM(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_PARAM(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_PARAM(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_PARAM(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_PARAM(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_PARAM(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_PARAM(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_PARAM(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_PARAM(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_PARAM(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: return GET_L6470_PARAM(E5); - #endif - } - - return 0 ; // not needed but kills a compiler warning -} - -void L6470_Marlin::set_param(uint8_t axis, uint8_t param, uint32_t value) { - - #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - - switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: SET_L6470_PARAM(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: SET_L6470_PARAM(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: SET_L6470_PARAM(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: SET_L6470_PARAM(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: SET_L6470_PARAM(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: SET_L6470_PARAM(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: SET_L6470_PARAM(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: SET_L6470_PARAM(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: SET_L6470_PARAM(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: SET_L6470_PARAM(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: SET_L6470_PARAM(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: SET_L6470_PARAM(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: SET_L6470_PARAM(E5); - #endif - } -} - -inline void echo_min_max(const char a, const float &min, const float &max) { - DEBUG_CHAR(' '); DEBUG_CHAR(a); - DEBUG_ECHOPAIR(" min = ", min); - DEBUG_ECHOLNPAIR(" max = ", max); -} -inline void echo_oct_used(const float &oct, const bool stall) { - DEBUG_ECHOPAIR("over_current_threshold used : ", oct); - serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); - DEBUG_ECHOLNPGM(" threshold)"); -} -inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("ERROR - motion out of bounds"); } - -bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold -) { - // Return TRUE if the calling routine needs to abort/kill - - uint16_t displacement = 0; // " = 0" to eliminate compiler warning - uint8_t j; // general purpose counter - - if (!all_axes_homed()) { - DEBUG_ECHOLNPGM("ERROR - home all before running this command"); - //return true; - } - - LOOP_XYZE(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) { - displacement = _displacement; - uint8_t axis_offset = parser.byteval('J'); - axis_mon[0][0] = axis_codes[i]; // axis ASCII value (target character) - if (axis_offset >= 2 || axis_mon[0][0] == 'E') // Single axis, E0, or E1 - axis_mon[0][1] = axis_offset + '0'; - else if (axis_offset == 0) { // one or more axes - uint8_t driver_count_local = 0; // can't use "driver_count" directly as a subscript because it's passed by reference - for (j = 0; j < MAX_L6470; j++) // see how many drivers on this axis - if (axis_mon[0][0] == index_to_axis[j][0]) { - axis_mon[driver_count_local][0] = axis_mon[0][0]; - axis_mon[driver_count_local][1] = index_to_axis[j][1]; - axis_mon[driver_count_local][2] = index_to_axis[j][2]; // append end of string - axis_index[driver_count_local] = j; // set axis index - driver_count_local++; - } - driver_count = driver_count_local; - } - break; // only take first axis found - } - - // - // Position calcs & checks - // - - const xyze_pos_t center = { - LOGICAL_X_POSITION(current_position.x), - LOGICAL_Y_POSITION(current_position.y), - LOGICAL_Z_POSITION(current_position.z), - current_position.e - }; - - switch (axis_mon[0][0]) { - default: position_max = position_min = 0; break; - - case 'X': { - position_min = center.x - displacement; - position_max = center.x + displacement; - echo_min_max('X', position_min, position_max); - if (false - #ifdef X_MIN_POS - || position_min < (X_MIN_POS) - #endif - #ifdef X_MAX_POS - || position_max > (X_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'Y': { - position_min = center.y - displacement; - position_max = center.y + displacement; - echo_min_max('Y', position_min, position_max); - if (false - #ifdef Y_MIN_POS - || position_min < (Y_MIN_POS) - #endif - #ifdef Y_MAX_POS - || position_max > (Y_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'Z': { - position_min = center.z - displacement; - position_max = center.z + displacement; - echo_min_max('Z', position_min, position_max); - if (false - #ifdef Z_MIN_POS - || position_min < (Z_MIN_POS) - #endif - #ifdef Z_MAX_POS - || position_max > (Z_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'E': { - position_min = center.e - displacement; - position_max = center.e + displacement; - echo_min_max('E', position_min, position_max); - } break; - } - - // - // Work on the drivers - // - for (uint8_t k = 0; k < driver_count; k++) { - bool not_found = true; - for (j = 1; j <= L6470::chain[0]; j++) { - const char * const ind_axis = index_to_axis[L6470::chain[j]]; - if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver - not_found = false; - break; - } - } - if (not_found) { - driver_count = k; - axis_mon[k][0] = ' '; // mark this entry invalid - break; - } - } - - if (driver_count == 0) { - DEBUG_ECHOLNPGM("ERROR - not a L6470 axis"); - return true; - } - - DEBUG_ECHOPGM("Monitoring:"); - for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR(" ", axis_mon[j]); - L6470_EOL(); - - // now have a list of driver(s) to monitor - - // - // kVAL_HOLD checks & settings - // - - kval_hold = parser.byteval('K'); - if (kval_hold) { - DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); - for (j = 0; j < driver_count; j++) - set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - } - else { - // only print the KVAL_HOLD from one of the drivers - kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD); - DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold); - } - - // - // Overcurrent checks & settings - // - - if (over_current_flag) { - - uint8_t OCD_TH_val_local = 0, // compiler thinks OCD_TH_val is unused if use it directly - STALL_TH_val_local = 0; // just in case ... - - over_current_threshold = parser.intval('I'); - - if (over_current_threshold) { - - OCD_TH_val_local = over_current_threshold/375; - LIMIT(OCD_TH_val_local, 0, 15); - STALL_TH_val_local = over_current_threshold/31.25; - LIMIT(STALL_TH_val_local, 0, 127); - uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375, - STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25; - if (OCD_TH_actual < STALL_TH_actual) { - OCD_TH_val_local++; - OCD_TH_actual = (OCD_TH_val_local + 1) * 375; - } - - DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold); - echo_oct_used(STALL_TH_actual, true); - echo_oct_used(OCD_TH_actual, false); - - #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0) - - for (j = 0; j < driver_count; j++) { - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - } - else { - // only get & print the OVER_CURRENT values from one of the drivers - STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH); - OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH); - - echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); - echo_oct_used((OCD_TH_val_local + 1) * 375, false); - } // over_current_threshold - - for (j = 0; j < driver_count; j++) { // set all drivers on axis the same - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - - OCD_TH_val = OCD_TH_val_local; // force compiler to update the main routine's copy - STALL_TH_val = STALL_TH_val_local; // force compiler to update the main routine's copy - } // end of overcurrent - - // - // Feedrate - // - - final_feedrate = parser.floatval('F'); - if (final_feedrate == 0) { - static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; - const uint8_t num_feedrates = COUNT(default_max_feedrate); - for (j = 0; j < num_feedrates; j++) { - if (axis_codes[j] == axis_mon[0][0]) { - final_feedrate = default_max_feedrate[j]; - break; - } - } - if (j == 3 && num_feedrates > 4) { // have more than one extruder feedrate - uint8_t extruder_num = axis_mon[0][1] - '0'; - if (j <= num_feedrates - extruder_num) // have a feedrate specifically for this extruder - final_feedrate = default_max_feedrate[j + extruder_num]; - else - final_feedrate = default_max_feedrate[3]; // use E0 feedrate for this extruder - } - final_feedrate *= 60; // convert to mm/minute - } // end of feedrate - - return false; // FALSE indicates no user input problems -} - -#if ENABLED(L6470_CHITCHAT) - inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR("YES") : PSTR("NO ")); } -#endif - -void L6470_Marlin::say_axis(const uint8_t axis, const bool label/*=true*/) { - if (label) SERIAL_ECHOPGM("AXIS:"); - SERIAL_CHAR(' '); - SERIAL_CHAR(index_to_axis[axis][0]); - SERIAL_CHAR(index_to_axis[axis][1]); - SERIAL_CHAR(' '); -} - -void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis) { // assumes status bits have been inverted - #if ENABLED(L6470_CHITCHAT) - char temp_buf[10]; - say_axis(axis); - sprintf_P(temp_buf, PSTR(" %4x "), status); - DEBUG_ECHO(temp_buf); - print_bin(status); - DEBUG_ECHOPGM(" THERMAL: "); - serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); - DEBUG_ECHOPGM(" OVERCURRENT: "); - echo_yes_no(status & STATUS_OCD); - DEBUG_ECHOPGM(" STALL: "); - echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)); - L6470_EOL(); - #else - UNUSED(status); UNUSED(axis); - #endif -} - -////////////////////////////////////////////////////////////////////////////////////////////////// -//// -//// MONITOR_L6470_DRIVER_STATUS routines -//// -////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(MONITOR_L6470_DRIVER_STATUS) - - struct L6470_driver_data { - uint8_t driver_index; - uint32_t driver_status; - bool is_otw; - uint8_t otw_counter; - bool is_ot; - bool is_hi_Z; - uint8_t com_counter; - }; - - L6470_driver_data driver_L6470_data[] = { - #if AXIS_DRIVER_TYPE_X(L6470) - { 0, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - { 1, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - { 2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - { 3, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - { 4, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - { 5, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - { 6, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - { 7, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - { 8, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - { 9, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - { 10, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - { 11, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - { 12, 0, 0, 0, 0, 0, 0 } - #endif - }; - - inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=nullptr) { - p += sprintf_P(p, PSTR("Stepper %c%c "), char(index_to_axis[stepper_index][0]), char(index_to_axis[stepper_index][1])); - if (err) p += sprintf_P(p, err); - } - - void L6470_monitor_update(uint8_t stepper_index, uint16_t status) { - if (spi_abort) return; // don't do anything if set_directions() has occurred - uint8_t kval_hold; - char temp_buf[120]; - char* p = &temp_buf[0]; - uint8_t j; - for (j = 0; j < L6470::chain[0]; j++) // find the table for this stepper - if (driver_L6470_data[j].driver_index == stepper_index) break; - - driver_L6470_data[j].driver_status = status; - uint16_t _status = ~status; // all error bits are active low - - if (status == 0 || status == 0xFFFF) { // com problem - if (driver_L6470_data[j].com_counter == 0) { // warn user when it first happens - driver_L6470_data[j].com_counter++; - append_stepper_err(p, stepper_index, PSTR(" - communications lost\n")); - DEBUG_ECHO(temp_buf); - } - else { - driver_L6470_data[j].com_counter++; - if (driver_L6470_data[j].com_counter > 240) { // remind of com problem about every 2 minutes - driver_L6470_data[j].com_counter = 1; - append_stepper_err(p, stepper_index, PSTR(" - still no communications\n")); - DEBUG_ECHO(temp_buf); - } - } - } - else { - if (driver_L6470_data[j].com_counter) { // comms re-established - driver_L6470_data[j].com_counter = 0; - append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n")); - DEBUG_ECHO(temp_buf); - init_to_defaults(); - } - else { - // no com problems - do the usual checks - if (_status & L6470_ERROR_MASK) { - append_stepper_err(p, stepper_index); - - if (status & STATUS_HIZ) { // the driver has shut down HiZ is active high - driver_L6470_data[j].is_hi_Z = true; - p += sprintf_P(p, PSTR("%cIS SHUT DOWN"), ' '); - // if (_status & STATUS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN - if (_status & STATUS_TH_WRN) { // over current shutdown - p += sprintf_P(p, PSTR("%cdue to over temperature"), ' '); - driver_L6470_data[j].is_ot = true; - kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - } - else - driver_L6470_data[j].is_ot = false; - } - else { - driver_L6470_data[j].is_hi_Z = false; - - if (_status & STATUS_TH_WRN) { // have an over temperature warning - driver_L6470_data[j].is_otw = true; - driver_L6470_data[j].otw_counter++; - kval_hold = get_param(stepper_index, L6470_KVAL_HOLD); - if (driver_L6470_data[j].otw_counter > 4) { // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD - kval_hold -= KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - driver_L6470_data[j].otw_counter = 0; - driver_L6470_data[j].is_otw = true; - } - else if (driver_L6470_data[j].otw_counter) - p += sprintf_P(p, PSTR("%c- thermal warning"), ' '); // warn user - } - } - - #ifdef L6470_STOP_ON_ERROR - if (_status & (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD)) - kill(temp_buf); - #endif - - - #if ENABLED(L6470_CHITCHAT) - - if (_status & STATUS_OCD) - p += sprintf_P(p, PSTR("%c over current"), ' '); - - if (_status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) - p += sprintf_P(p, PSTR("%c stall"), ' '); - - if (_status & STATUS_UVLO) - p += sprintf_P(p, PSTR("%c under voltage lock out"), ' '); - - p += sprintf_P(p, PSTR("%c\n"), ' '); - #endif - - DEBUG_ECHOLN(temp_buf); // print the error message - } - else { - driver_L6470_data[j].is_ot = false; - driver_L6470_data[j].otw_counter = 0; //clear out warning indicators - driver_L6470_data[j].is_otw = false; - - } // end usual checks - } // comms established but have errors - } // comms re-established - } // end L6470_monitor_update() - - #define MONITOR_L6470_DRIVE(Q) L6470_monitor_update(Q, stepper##Q.getStatus()) - - void L6470_Marlin::monitor_driver() { - static millis_t next_cOT = 0; - if (ELAPSED(millis(), next_cOT)) { - next_cOT = millis() + 500; - - spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - - #if AXIS_DRIVER_TYPE_X(L6470) - MONITOR_L6470_DRIVE(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - MONITOR_L6470_DRIVE(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - MONITOR_L6470_DRIVE(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - MONITOR_L6470_DRIVE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - MONITOR_L6470_DRIVE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - MONITOR_L6470_DRIVE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - MONITOR_L6470_DRIVE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - MONITOR_L6470_DRIVE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - MONITOR_L6470_DRIVE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - MONITOR_L6470_DRIVE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - MONITOR_L6470_DRIVE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - MONITOR_L6470_DRIVE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - MONITOR_L6470_DRIVE(E5); - #endif - - #if ENABLED(L6470_DEBUG) - if (report_L6470_status) L6470_EOL(); - #endif - - spi_active = false; // done with all SPI transfers - clear handshake flags - spi_abort = false; - } - } - -#endif // MONITOR_L6470_DRIVER_STATUS - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.h deleted file mode 100644 index bc9a033e4a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/L6470/L6470_Marlin.h +++ /dev/null @@ -1,72 +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 - -#include "../../inc/MarlinConfig.h" - -#include - -#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) - -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 -#define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 - -class L6470_Marlin { -public: - static bool index_to_dir[MAX_L6470]; - static uint8_t axis_xref[MAX_L6470]; - static char index_to_axis[MAX_L6470][3]; - static uint8_t dir_commands[MAX_L6470]; - - // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer - static volatile bool spi_abort; - static bool spi_active; - - L6470_Marlin() {} - - static uint16_t get_status(const uint8_t axis); - - static uint32_t get_param(uint8_t axis, uint8_t param); - - static void set_param(uint8_t axis, uint8_t param, uint32_t value); - - static bool get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold); - - static void error_status_decode(const uint16_t status, const uint8_t axis); - - static void monitor_driver(); - - static void init(); - static void init_to_defaults(); - - static void say_axis(const uint8_t axis, const bool label=true); - -private: - void populate_chain_array(); -}; - -extern L6470_Marlin L6470; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/bresenham.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/bresenham.h deleted file mode 100644 index 013e357d08..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/bresenham.h +++ /dev/null @@ -1,132 +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 - -#include "../core/serial.h" - -/** - * bresenham_t.h - Bresenham algorithm template - * - * An array of values / counters that tick together - */ - -#define FORCE_INLINE __attribute__((always_inline)) inline -#define _O3 __attribute__((optimize("O3"))) - -template -struct BresenhamCfg { static constexpr uint8_t UID = uid, SIZE = size; }; - -template -class Bresenham { -private: - - static constexpr T signtest = -1; - static_assert(signtest < 0, "Bresenham type must be signed!"); - -public: - - static T divisor, value[Cfg::SIZE], dir[Cfg::SIZE], dividend[Cfg::SIZE], counter[Cfg::SIZE]; - - // Default: Instantiate all items with the identical parameters - Bresenham(const T &inDivisor=1, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0) { - for (uint8_t i = 0; i < Cfg::SIZE; i++) init(i, inDivisor, inDir, inDividend, inValue); - } - - // Instantiate all items with the same divisor - Bresenham(const T &inDivisor, const int8_t (&inDir)[Cfg::SIZE], const T (&inDividend)[Cfg::SIZE], const T (&inValue)[Cfg::SIZE]={0}) { - init(inDivisor, inDir, inDividend, inValue); - } - - // Instantiate all items with the same divisor and direction - Bresenham(const T &inDivisor, const int8_t &inDir, const T (&inDividend)[Cfg::SIZE], const T (&inValue)[Cfg::SIZE]={0}) { - init(inDivisor, inDir, inDividend, inValue); - } - - // Init all items with the same parameters - FORCE_INLINE static void init(const uint8_t index, const T &inDivisor=1, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0) { - divisor = inDivisor; - dir[index] = inDir; - dividend[index] = inDividend; - value[index] = inValue; - prime(index); - } - - // Init all items with the same divisor - FORCE_INLINE static void init(const T &inDivisor, const int8_t (&inDir)[Cfg::SIZE], const T (&inDividend)[Cfg::SIZE], const T (&inValue)[Cfg::SIZE]={0}) { - divisor = inDivisor; - for (uint8_t i = 0; i < Cfg::SIZE; i++) { - dir[i] = inDir[i]; - dividend[i] = inDividend[i]; - value[i] = inValue[i]; - } - prime(); - } - - // Init all items with the same divisor and direction - FORCE_INLINE static void init(const T &inDivisor, const int8_t &inDir, const T (&inDividend)[Cfg::SIZE], const T (&inValue)[Cfg::SIZE]={0}) { - divisor = inDivisor; - for (uint8_t i = 0; i < Cfg::SIZE; i++) { - dir[i] = inDir; - dividend[i] = inDividend[i]; - value[i] = inValue[i]; - } - prime(); - } - - // Reinit item with new dir, dividend, value keeping the same divisor - FORCE_INLINE static void reinit(const uint8_t index, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0) { - dir[index] = inDir; - dividend[index] = inDividend; - value[index] = inValue; - prime(); - } - - FORCE_INLINE static void prime(const uint8_t index) { counter[index] = -(divisor / 2); } - FORCE_INLINE static void prime() { for (uint8_t i = 0; i < Cfg::SIZE; i++) prime(i); } - - FORCE_INLINE static void back(const uint8_t index) { counter[index] -= divisor; } - - FORCE_INLINE static bool tick1(const uint8_t index) { - counter[index] += dividend[index]; - return counter[index] > 0; - } - - FORCE_INLINE static void tick(const uint8_t index) { - if (tick1(index)) { value[index] += dir[index]; back(index); } - } - - FORCE_INLINE static void tick1() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick1(i); } - - FORCE_INLINE static void tick() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick(i); } - - static void report(const uint8_t index) { - if (index < Cfg::SIZE) { - SERIAL_ECHOPAIR("bresenham ", int(index), " : (", dividend[index], "/", divisor, ") "); - if (counter[index] >= 0) SERIAL_CHAR(' '); - if (labs(counter[index]) < 100) { SERIAL_CHAR(' '); if (labs(counter[index]) < 10) SERIAL_CHAR(' '); } - SERIAL_ECHO(counter[index]); - SERIAL_ECHOLNPAIR(" ... ", value[index]); - } - } - - static void report() { for (uint8_t i = 0; i < Cfg::SIZE; i++) report(i); } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.cpp deleted file mode 100644 index 549c76008e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.cpp +++ /dev/null @@ -1,81 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if USE_BEEPER - -#include "buzzer.h" -#include "../module/temperature.h" - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -Buzzer::state_t Buzzer::state; -CircularQueue Buzzer::buffer; -Buzzer buzzer; - -/** - * @brief Add a tone to the queue - * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. - * - * @param duration Duration of the tone in milliseconds - * @param frequency Frequency of the tone in hertz - */ -void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) { - while (buffer.isFull()) { - tick(); - thermalManager.manage_heater(); - } - tone_t tone = { duration, frequency }; - buffer.enqueue(tone); -} - -void Buzzer::tick() { - const millis_t now = millis(); - - if (!state.endtime) { - if (buffer.isEmpty()) return; - - state.tone = buffer.dequeue(); - state.endtime = now + state.tone.duration; - - if (state.tone.frequency > 0) { - #if ENABLED(EXTENSIBLE_UI) - CRITICAL_SECTION_START; - ExtUI::onPlayTone(state.tone.frequency, state.tone.duration); - CRITICAL_SECTION_END; - #elif ENABLED(SPEAKER) - CRITICAL_SECTION_START; - ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration); - CRITICAL_SECTION_END; - #else - on(); - #endif - } - } - else if (ELAPSED(now, state.endtime)) reset(); -} - -#endif // USE_BEEPER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.h deleted file mode 100644 index 026b9330f9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/buzzer.h +++ /dev/null @@ -1,128 +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 - -#include "../inc/MarlinConfig.h" - -#if USE_BEEPER - - #include "circularqueue.h" - - #define TONE_QUEUE_LENGTH 4 - - /** - * @brief Tone structure - * @details Simple abstraction of a tone based on a duration and a frequency. - */ - struct tone_t { - uint16_t duration; - uint16_t frequency; - }; - - /** - * @brief Buzzer class - */ - class Buzzer { - public: - - typedef struct { - tone_t tone; - uint32_t endtime; - } state_t; - - private: - static state_t state; - - protected: - static CircularQueue buffer; - - /** - * @brief Inverts the sate of a digital PIN - * @details This will invert the current state of an digital IO pin. - */ - FORCE_INLINE static void invert() { TOGGLE(BEEPER_PIN); } - - /** - * @brief Turn off a digital PIN - * @details Alias of digitalWrite(PIN, LOW) using FastIO - */ - FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); } - - /** - * @brief Turn on a digital PIN - * @details Alias of digitalWrite(PIN, HIGH) using FastIO - */ - FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); } - - /** - * @brief Resets the state of the class - * @details Brings the class state to a known one. - */ - static inline void reset() { - off(); - state.endtime = 0; - } - - public: - /** - * @brief Class constructor - */ - Buzzer() { - SET_OUTPUT(BEEPER_PIN); - reset(); - } - - /** - * @brief Add a tone to the queue - * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. - * - * @param duration Duration of the tone in milliseconds - * @param frequency Frequency of the tone in hertz - */ - static void tone(const uint16_t duration, const uint16_t frequency=0); - - /** - * @brief Tick function - * @details This function should be called at loop, it will take care of - * playing the tones in the queue. - */ - static void tick(); - }; - - // Provide a buzzer instance - extern Buzzer buzzer; - - // Buzz directly via the BEEPER pin tone queue - #define BUZZ(d,f) buzzer.tone(d, f) - -#elif HAS_BUZZER - - // Buzz indirectly via the MarlinUI instance - #define BUZZ(d,f) ui.buzz(d,f) - -#else - - // No buzz capability - #define BUZZ(d,f) NOOP - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/circularqueue.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/circularqueue.h deleted file mode 100644 index 6b1923986d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/circularqueue.h +++ /dev/null @@ -1,131 +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 - -#include - -/** - * @brief Circular Queue class - * @details Implementation of the classic ring buffer data structure - */ -template -class CircularQueue { - private: - - /** - * @brief Buffer structure - * @details This structure consolidates all the overhead required to handle - * a circular queue such as the pointers and the buffer vector. - */ - struct buffer_t { - uint8_t head; - uint8_t tail; - uint8_t count; - uint8_t size; - T queue[N]; - } buffer; - - public: - /** - * @brief Class constructor - * @details This class requires two template parameters, T defines the type - * of item this queue will handle and N defines the maximum number of - * items that can be stored on the queue. - */ - CircularQueue() { - buffer.size = N; - buffer.count = buffer.head = buffer.tail = 0; - } - - /** - * @brief Removes and returns a item from the queue - * @details Removes the oldest item on the queue, pointed to by the - * buffer_t head field. The item is returned to the caller. - * @return type T item - */ - T dequeue() { - if (isEmpty()) return T(); - - uint8_t index = buffer.head; - - --buffer.count; - if (++buffer.head == buffer.size) - buffer.head = 0; - - return buffer.queue[index]; - } - - /** - * @brief Adds an item to the queue - * @details Adds an item to the queue on the location pointed by the buffer_t - * tail variable. Returns false if no queue space is available. - * @param item Item to be added to the queue - * @return true if the operation was successful - */ - bool enqueue(T const &item) { - if (isFull()) return false; - - buffer.queue[buffer.tail] = item; - - ++buffer.count; - if (++buffer.tail == buffer.size) - buffer.tail = 0; - - return true; - } - - /** - * @brief Checks if the queue has no items - * @details Returns true if there are no items on the queue, false otherwise. - * @return true if queue is empty - */ - bool isEmpty() { return 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 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 buffer.size; } - - /** - * @brief Gets the next item from the queue without removing it - * @details Returns the next item in the queue without removing it - * or updating the pointers. - * @return first item in the queue - */ - T peek() { return 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 buffer.count; } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.cpp deleted file mode 100644 index fdb6395607..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.cpp +++ /dev/null @@ -1,32 +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 . - * - */ - -#include "crc16.h" - -void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { - uint8_t *ptr = (uint8_t *)data; - while (cnt--) { - *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8)); - for (uint8_t i = 0; i < 8; i++) - *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (*crc << 1)); - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.h deleted file mode 100644 index d625acce07..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/crc16.h +++ /dev/null @@ -1,26 +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 - -#include - -void crc16(uint16_t *crc, const void * const data, uint16_t cnt); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/duration_t.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/duration_t.h deleted file mode 100644 index 0df3659b1b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/duration_t.h +++ /dev/null @@ -1,166 +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 - -#include "../HAL/shared/Marduino.h" - -struct duration_t { - /** - * @brief Duration is stored in seconds - */ - uint32_t value; - - /** - * @brief Constructor - */ - duration_t() - : duration_t(0) {}; - - /** - * @brief Constructor - * - * @param seconds The number of seconds - */ - duration_t(uint32_t const &seconds) { - this->value = seconds; - } - - /** - * @brief Equality comparison - * @details Overloads the equality comparison operator - * - * @param value The number of seconds to compare to - * @return True if both durations are equal - */ - bool operator==(const uint32_t &value) const { - return (this->value == value); - } - - /** - * @brief Inequality comparison - * @details Overloads the inequality comparison operator - * - * @param value The number of seconds to compare to - * @return False if both durations are equal - */ - bool operator!=(const uint32_t &value) const { - return ! this->operator==(value); - } - - /** - * @brief Formats the duration as years - * @return The number of years - */ - inline uint8_t year() const { - return this->day() / 365; - } - - /** - * @brief Formats the duration as days - * @return The number of days - */ - inline uint16_t day() const { - return this->hour() / 24; - } - - /** - * @brief Formats the duration as hours - * @return The number of hours - */ - inline uint32_t hour() const { - return this->minute() / 60; - } - - /** - * @brief Formats the duration as minutes - * @return The number of minutes - */ - inline uint32_t minute() const { - return this->second() / 60; - } - - /** - * @brief Formats the duration as seconds - * @return The number of seconds - */ - inline uint32_t second() const { - return this->value; - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "full" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 21 bytes - * - * Output examples: - * 123456789012345678901 (strlen) - * 135y 364d 23h 59m 59s - * 364d 23h 59m 59s - * 23h 59m 59s - * 59m 59s - * 59s - */ - char* toString(char * const buffer) const { - int y = this->year(), - d = this->day() % 365, - h = this->hour() % 24, - m = this->minute() % 60, - s = this->second() % 60; - - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); - else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); - else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); - else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); - else sprintf_P(buffer, PSTR("%is"), s); - return buffer; - } - - /** - * @brief Formats the duration as a string - * @details String will be formated using a "digital" representation of duration - * - * @param buffer The array pointed to must be able to accommodate 10 bytes - * - * Output examples: - * 123456789 (strlen) - * 99:59 - * 11d 12:33 - */ - uint8_t toDigital(char *buffer, bool with_days=false) const { - uint16_t h = uint16_t(this->hour()), - m = uint16_t(this->minute() % 60UL); - if (with_days) { - uint16_t d = this->day(); - sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m); - return d >= 10 ? 9 : 8; - } - else if (h < 100) { - sprintf_P(buffer, PSTR("%02hu:%02hu"), h, m); - return 5; - } - else { - sprintf_P(buffer, PSTR("%hu:%02hu"), h, m); - return 6; - } - } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/LICENSE b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/LICENSE deleted file mode 100644 index a40fc72b91..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -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 -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_common.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_common.h deleted file mode 100644 index c8dc95406e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_common.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * libs/heatshrink/heatshrink_common.h - */ -#pragma once - -#define HEATSHRINK_AUTHOR "Scott Vokes " -#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink" - -/* Version 0.4.1 */ -#define HEATSHRINK_VERSION_MAJOR 0 -#define HEATSHRINK_VERSION_MINOR 4 -#define HEATSHRINK_VERSION_PATCH 1 - -#define HEATSHRINK_MIN_WINDOW_BITS 4 -#define HEATSHRINK_MAX_WINDOW_BITS 15 - -#define HEATSHRINK_MIN_LOOKAHEAD_BITS 3 - -#define HEATSHRINK_LITERAL_MARKER 0x01 -#define HEATSHRINK_BACKREF_MARKER 0x00 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_config.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_config.h deleted file mode 100644 index 90520f1264..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_config.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * libs/heatshrink/heatshrink_config.h - */ -#pragma once - -// Should functionality assuming dynamic allocation be used? -#ifndef HEATSHRINK_DYNAMIC_ALLOC - //#define HEATSHRINK_DYNAMIC_ALLOC 1 -#endif - -#if HEATSHRINK_DYNAMIC_ALLOC - // Optional replacement of malloc/free - #define HEATSHRINK_MALLOC(SZ) malloc(SZ) - #define HEATSHRINK_FREE(P, SZ) free(P) -#else - // Required parameters for static configuration - #define HEATSHRINK_STATIC_INPUT_BUFFER_SIZE 32 - #define HEATSHRINK_STATIC_WINDOW_BITS 8 - #define HEATSHRINK_STATIC_LOOKAHEAD_BITS 4 -#endif - -// Turn on logging for debugging -#define HEATSHRINK_DEBUGGING_LOGS 0 - -// Use indexing for faster compression. (This requires additional space.) -#define HEATSHRINK_USE_INDEX 1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp deleted file mode 100644 index 4684af975e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp +++ /dev/null @@ -1,355 +0,0 @@ -/** - * libs/heatshrink/heatshrink_decoder.cpp - */ -#include -#include -#include "heatshrink_decoder.h" - -#pragma GCC optimize ("O3") - -/* States for the polling state machine. */ -typedef enum { - HSDS_TAG_BIT, /* tag bit */ - HSDS_YIELD_LITERAL, /* ready to yield literal byte */ - HSDS_BACKREF_INDEX_MSB, /* most significant byte of index */ - HSDS_BACKREF_INDEX_LSB, /* least significant byte of index */ - HSDS_BACKREF_COUNT_MSB, /* most significant byte of count */ - HSDS_BACKREF_COUNT_LSB, /* least significant byte of count */ - HSDS_YIELD_BACKREF /* ready to yield back-reference */ -} HSD_state; - -#if HEATSHRINK_DEBUGGING_LOGS - #include - #include - #include - #define LOG(...) fprintf(stderr, __VA_ARGS__) - #define ASSERT(X) assert(X) - static const char *state_names[] = { - "tag_bit", - "yield_literal", - "backref_index_msb", - "backref_index_lsb", - "backref_count_msb", - "backref_count_lsb", - "yield_backref" - }; -#else - #define LOG(...) /* no-op */ - #define ASSERT(X) /* no-op */ -#endif - -typedef struct { - uint8_t *buf; /* output buffer */ - size_t buf_size; /* buffer size */ - size_t *output_size; /* bytes pushed to buffer, so far */ -} output_info; - -#define NO_BITS ((uint16_t)-1) - -/* Forward references. */ -static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count); -static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte); - -#if HEATSHRINK_DYNAMIC_ALLOC -heatshrink_decoder *heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t window_sz2, uint8_t lookahead_sz2) { - if ((window_sz2 < HEATSHRINK_MIN_WINDOW_BITS) || - (window_sz2 > HEATSHRINK_MAX_WINDOW_BITS) || - (input_buffer_size == 0) || - (lookahead_sz2 < HEATSHRINK_MIN_LOOKAHEAD_BITS) || - (lookahead_sz2 >= window_sz2)) { - return nullptr; - } - size_t buffers_sz = (1 << window_sz2) + input_buffer_size; - size_t sz = sizeof(heatshrink_decoder) + buffers_sz; - heatshrink_decoder *hsd = HEATSHRINK_MALLOC(sz); - if (hsd == nullptr) return nullptr; - hsd->input_buffer_size = input_buffer_size; - hsd->window_sz2 = window_sz2; - hsd->lookahead_sz2 = lookahead_sz2; - heatshrink_decoder_reset(hsd); - LOG("-- allocated decoder with buffer size of %zu (%zu + %u + %u)\n", - sz, sizeof(heatshrink_decoder), (1 << window_sz2), input_buffer_size); - return hsd; -} - -void heatshrink_decoder_free(heatshrink_decoder *hsd) { - size_t buffers_sz = (1 << hsd->window_sz2) + hsd->input_buffer_size; - size_t sz = sizeof(heatshrink_decoder) + buffers_sz; - HEATSHRINK_FREE(hsd, sz); - (void)sz; /* may not be used by free */ -} -#endif - -void heatshrink_decoder_reset(heatshrink_decoder *hsd) { - size_t buf_sz = 1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd); - size_t input_sz = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd); - memset(hsd->buffers, 0, buf_sz + input_sz); - hsd->state = HSDS_TAG_BIT; - hsd->input_size = 0; - hsd->input_index = 0; - hsd->bit_index = 0x00; - hsd->current_byte = 0x00; - hsd->output_count = 0; - hsd->output_index = 0; - hsd->head_index = 0; -} - -/* Copy SIZE bytes into the decoder's input buffer, if it will fit. */ -HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, - uint8_t *in_buf, size_t size, size_t *input_size) { - if (hsd == nullptr || in_buf == nullptr || input_size == nullptr) - return HSDR_SINK_ERROR_NULL; - - size_t rem = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd) - hsd->input_size; - if (rem == 0) { - *input_size = 0; - return HSDR_SINK_FULL; - } - - size = rem < size ? rem : size; - LOG("-- sinking %zd bytes\n", size); - /* copy into input buffer (at head of buffers) */ - memcpy(&hsd->buffers[hsd->input_size], in_buf, size); - hsd->input_size += size; - *input_size = size; - return HSDR_SINK_OK; -} - - -/***************** - * Decompression * - *****************/ - -#define BACKREF_COUNT_BITS(HSD) (HEATSHRINK_DECODER_LOOKAHEAD_BITS(HSD)) -#define BACKREF_INDEX_BITS(HSD) (HEATSHRINK_DECODER_WINDOW_BITS(HSD)) - -// States -static HSD_state st_tag_bit(heatshrink_decoder *hsd); -static HSD_state st_yield_literal(heatshrink_decoder *hsd, output_info *oi); -static HSD_state st_backref_index_msb(heatshrink_decoder *hsd); -static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd); -static HSD_state st_backref_count_msb(heatshrink_decoder *hsd); -static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd); -static HSD_state st_yield_backref(heatshrink_decoder *hsd, output_info *oi); - -HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size) { - if (hsd == nullptr || out_buf == nullptr || output_size == nullptr) - return HSDR_POLL_ERROR_NULL; - - *output_size = 0; - - output_info oi; - oi.buf = out_buf; - oi.buf_size = out_buf_size; - oi.output_size = output_size; - - while (1) { - LOG("-- poll, state is %d (%s), input_size %d\n", hsd->state, state_names[hsd->state], hsd->input_size); - uint8_t in_state = hsd->state; - switch (in_state) { - case HSDS_TAG_BIT: - hsd->state = st_tag_bit(hsd); - break; - case HSDS_YIELD_LITERAL: - hsd->state = st_yield_literal(hsd, &oi); - break; - case HSDS_BACKREF_INDEX_MSB: - hsd->state = st_backref_index_msb(hsd); - break; - case HSDS_BACKREF_INDEX_LSB: - hsd->state = st_backref_index_lsb(hsd); - break; - case HSDS_BACKREF_COUNT_MSB: - hsd->state = st_backref_count_msb(hsd); - break; - case HSDS_BACKREF_COUNT_LSB: - hsd->state = st_backref_count_lsb(hsd); - break; - case HSDS_YIELD_BACKREF: - hsd->state = st_yield_backref(hsd, &oi); - break; - default: - return HSDR_POLL_ERROR_UNKNOWN; - } - - // If the current state cannot advance, check if input or output - // buffer are exhausted. - if (hsd->state == in_state) - return (*output_size == out_buf_size) ? HSDR_POLL_MORE : HSDR_POLL_EMPTY; - } -} - -static HSD_state st_tag_bit(heatshrink_decoder *hsd) { - uint32_t bits = get_bits(hsd, 1); // get tag bit - if (bits == NO_BITS) - return HSDS_TAG_BIT; - else if (bits) - return HSDS_YIELD_LITERAL; - else if (HEATSHRINK_DECODER_WINDOW_BITS(hsd) > 8) - return HSDS_BACKREF_INDEX_MSB; - else { - hsd->output_index = 0; - return HSDS_BACKREF_INDEX_LSB; - } -} - -static HSD_state st_yield_literal(heatshrink_decoder *hsd, output_info *oi) { - /* Emit a repeated section from the window buffer, and add it (again) - * to the window buffer. (Note that the repetition can include - * itself.)*/ - if (*oi->output_size < oi->buf_size) { - uint16_t byte = get_bits(hsd, 8); - if (byte == NO_BITS) { return HSDS_YIELD_LITERAL; } /* out of input */ - uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; - uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; - uint8_t c = byte & 0xFF; - LOG("-- emitting literal byte 0x%02x ('%c')\n", c, isprint(c) ? c : '.'); - buf[hsd->head_index++ & mask] = c; - push_byte(hsd, oi, c); - return HSDS_TAG_BIT; - } - return HSDS_YIELD_LITERAL; -} - -static HSD_state st_backref_index_msb(heatshrink_decoder *hsd) { - uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); - ASSERT(bit_ct > 8); - uint16_t bits = get_bits(hsd, bit_ct - 8); - LOG("-- backref index (msb), got 0x%04x (+1)\n", bits); - if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_MSB; } - hsd->output_index = bits << 8; - return HSDS_BACKREF_INDEX_LSB; -} - -static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd) { - uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); - uint16_t bits = get_bits(hsd, bit_ct < 8 ? bit_ct : 8); - LOG("-- backref index (lsb), got 0x%04x (+1)\n", bits); - if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_LSB; } - hsd->output_index |= bits; - hsd->output_index++; - uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); - hsd->output_count = 0; - return (br_bit_ct > 8) ? HSDS_BACKREF_COUNT_MSB : HSDS_BACKREF_COUNT_LSB; -} - -static HSD_state st_backref_count_msb(heatshrink_decoder *hsd) { - uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); - ASSERT(br_bit_ct > 8); - uint16_t bits = get_bits(hsd, br_bit_ct - 8); - LOG("-- backref count (msb), got 0x%04x (+1)\n", bits); - if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_MSB; } - hsd->output_count = bits << 8; - return HSDS_BACKREF_COUNT_LSB; -} - -static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd) { - uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); - uint16_t bits = get_bits(hsd, br_bit_ct < 8 ? br_bit_ct : 8); - LOG("-- backref count (lsb), got 0x%04x (+1)\n", bits); - if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_LSB; } - hsd->output_count |= bits; - hsd->output_count++; - return HSDS_YIELD_BACKREF; -} - -static HSD_state st_yield_backref(heatshrink_decoder *hsd, output_info *oi) { - size_t count = oi->buf_size - *oi->output_size; - if (count > 0) { - size_t i = 0; - if (hsd->output_count < count) count = hsd->output_count; - uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; - uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; - uint16_t neg_offset = hsd->output_index; - LOG("-- emitting %zu bytes from -%u bytes back\n", count, neg_offset); - ASSERT(neg_offset <= mask + 1); - ASSERT(count <= (size_t)(1 << BACKREF_COUNT_BITS(hsd))); - - for (i = 0; i < count; i++) { - uint8_t c = buf[(hsd->head_index - neg_offset) & mask]; - push_byte(hsd, oi, c); - buf[hsd->head_index & mask] = c; - hsd->head_index++; - LOG(" -- ++ 0x%02x\n", c); - } - hsd->output_count -= count; - if (hsd->output_count == 0) { return HSDS_TAG_BIT; } - } - return HSDS_YIELD_BACKREF; -} - -/* Get the next COUNT bits from the input buffer, saving incremental progress. - * Returns NO_BITS on end of input, or if more than 15 bits are requested. */ -static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count) { - uint16_t accumulator = 0; - int i = 0; - if (count > 15) return NO_BITS; - LOG("-- popping %u bit(s)\n", count); - - /* If we aren't able to get COUNT bits, suspend immediately, because we - * don't track how many bits of COUNT we've accumulated before suspend. */ - if (hsd->input_size == 0 && hsd->bit_index < (1 << (count - 1))) return NO_BITS; - - for (i = 0; i < count; i++) { - if (hsd->bit_index == 0x00) { - if (hsd->input_size == 0) { - LOG(" -- out of bits, suspending w/ accumulator of %u (0x%02x)\n", accumulator, accumulator); - return NO_BITS; - } - hsd->current_byte = hsd->buffers[hsd->input_index++]; - LOG(" -- pulled byte 0x%02x\n", hsd->current_byte); - if (hsd->input_index == hsd->input_size) { - hsd->input_index = 0; /* input is exhausted */ - hsd->input_size = 0; - } - hsd->bit_index = 0x80; - } - accumulator <<= 1; - if (hsd->current_byte & hsd->bit_index) { - accumulator |= 0x01; - if (0) { - LOG(" -- got 1, accumulator 0x%04x, bit_index 0x%02x\n", - accumulator, hsd->bit_index); - } - } - else if (0) { - LOG(" -- got 0, accumulator 0x%04x, bit_index 0x%02x\n", - accumulator, hsd->bit_index); - } - hsd->bit_index >>= 1; - } - - if (count > 1) LOG(" -- accumulated %08x\n", accumulator); - return accumulator; -} - -HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd) { - if (hsd == nullptr) { return HSDR_FINISH_ERROR_NULL; } - switch (hsd->state) { - case HSDS_TAG_BIT: - return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; - - /* If we want to finish with no input, but are in these states, it's - * because the 0-bit padding to the last byte looks like a backref - * marker bit followed by all 0s for index and count bits. */ - case HSDS_BACKREF_INDEX_LSB: - case HSDS_BACKREF_INDEX_MSB: - case HSDS_BACKREF_COUNT_LSB: - case HSDS_BACKREF_COUNT_MSB: - return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; - - /* If the output stream is padded with 0xFFs (possibly due to being in - * flash memory), also explicitly check the input size rather than - * uselessly returning MORE but yielding 0 bytes when polling. */ - case HSDS_YIELD_LITERAL: - return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; - - default: return HSDR_FINISH_MORE; - } -} - -static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte) { - LOG(" -- pushing byte: 0x%02x ('%c')\n", byte, isprint(byte) ? byte : '.'); - oi->buf[(*oi->output_size)++] = byte; - (void)hsd; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.h deleted file mode 100644 index 11fafe617f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/heatshrink/heatshrink_decoder.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * libs/heatshrink/heatshrink_decoder.h - */ -#pragma once - -#include -#include -#include "heatshrink_common.h" -#include "heatshrink_config.h" - -typedef enum { - HSDR_SINK_OK, /* data sunk, ready to poll */ - HSDR_SINK_FULL, /* out of space in internal buffer */ - HSDR_SINK_ERROR_NULL=-1, /* NULL argument */ -} HSD_sink_res; - -typedef enum { - HSDR_POLL_EMPTY, /* input exhausted */ - HSDR_POLL_MORE, /* more data remaining, call again w/ fresh output buffer */ - HSDR_POLL_ERROR_NULL=-1, /* NULL arguments */ - HSDR_POLL_ERROR_UNKNOWN=-2, -} HSD_poll_res; - -typedef enum { - HSDR_FINISH_DONE, /* output is done */ - HSDR_FINISH_MORE, /* more output remains */ - HSDR_FINISH_ERROR_NULL=-1, /* NULL arguments */ -} HSD_finish_res; - -#if HEATSHRINK_DYNAMIC_ALLOC -#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(BUF) \ - ((BUF)->input_buffer_size) -#define HEATSHRINK_DECODER_WINDOW_BITS(BUF) \ - ((BUF)->window_sz2) -#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ - ((BUF)->lookahead_sz2) -#else -#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_) \ - HEATSHRINK_STATIC_INPUT_BUFFER_SIZE -#define HEATSHRINK_DECODER_WINDOW_BITS(_) \ - (HEATSHRINK_STATIC_WINDOW_BITS) -#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ - (HEATSHRINK_STATIC_LOOKAHEAD_BITS) -#endif - -typedef struct { - uint16_t input_size; /* bytes in input buffer */ - uint16_t input_index; /* offset to next unprocessed input byte */ - uint16_t output_count; /* how many bytes to output */ - uint16_t output_index; /* index for bytes to output */ - uint16_t head_index; /* head of window buffer */ - uint8_t state; /* current state machine node */ - uint8_t current_byte; /* current byte of input */ - uint8_t bit_index; /* current bit index */ - -#if HEATSHRINK_DYNAMIC_ALLOC - /* Fields that are only used if dynamically allocated. */ - uint8_t window_sz2; /* window buffer bits */ - uint8_t lookahead_sz2; /* lookahead bits */ - uint16_t input_buffer_size; /* input buffer size */ - - /* Input buffer, then expansion window buffer */ - uint8_t buffers[]; -#else - /* Input buffer, then expansion window buffer */ - uint8_t buffers[(1 << HEATSHRINK_DECODER_WINDOW_BITS(_)) + HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_)]; -#endif -} heatshrink_decoder; - -#if HEATSHRINK_DYNAMIC_ALLOC -/* Allocate a decoder with an input buffer of INPUT_BUFFER_SIZE bytes, - * an expansion buffer size of 2^WINDOW_SZ2, and a lookahead - * size of 2^lookahead_sz2. (The window buffer and lookahead sizes - * must match the settings used when the data was compressed.) - * Returns NULL on error. */ -heatshrink_decoder *heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t expansion_buffer_sz2, uint8_t lookahead_sz2); - -/* Free a decoder. */ -void heatshrink_decoder_free(heatshrink_decoder *hsd); -#endif - -/* Reset a decoder. */ -void heatshrink_decoder_reset(heatshrink_decoder *hsd); - -/* Sink at most SIZE bytes from IN_BUF into the decoder. *INPUT_SIZE is set to - * indicate how many bytes were actually sunk (in case a buffer was filled). */ -HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, uint8_t *in_buf, size_t size, size_t *input_size); - -/* Poll for output from the decoder, copying at most OUT_BUF_SIZE bytes into - * OUT_BUF (setting *OUTPUT_SIZE to the actual amount copied). */ -HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size); - -/* Notify the dencoder that the input stream is finished. - * If the return value is HSDR_FINISH_MORE, there is still more output, so - * call heatshrink_decoder_poll and repeat. */ -HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.cpp deleted file mode 100644 index a30410641a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.cpp +++ /dev/null @@ -1,90 +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 . - * - */ - -#include "../inc/MarlinConfig.h" -#include "../gcode/parser.h" - -#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG) - - #include "hex_print_routines.h" - - #ifdef CPU_32_BIT - constexpr int byte_start = 4; - static char _hex[] = "0x00000000"; - #else - constexpr int byte_start = 0; - static char _hex[] = "0x0000"; - #endif - - char* hex_byte(const uint8_t b) { - _hex[byte_start + 4] = hex_nybble(b >> 4); - _hex[byte_start + 5] = hex_nybble(b); - return &_hex[byte_start + 4]; - } - - inline void _hex_word(const uint16_t w) { - _hex[byte_start + 2] = hex_nybble(w >> 12); - _hex[byte_start + 3] = hex_nybble(w >> 8); - _hex[byte_start + 4] = hex_nybble(w >> 4); - _hex[byte_start + 5] = hex_nybble(w); - } - - char* hex_word(const uint16_t w) { - _hex_word(w); - return &_hex[byte_start + 2]; - } - - #ifdef CPU_32_BIT - char* hex_long(const uint32_t l) { - _hex[2] = hex_nybble(l >> 28); - _hex[3] = hex_nybble(l >> 24); - _hex[4] = hex_nybble(l >> 20); - _hex[5] = hex_nybble(l >> 16); - _hex_word((uint16_t)(l & 0xFFFF)); - return &_hex[2]; - } - #endif - - char* hex_address(const void * const w) { - #ifdef CPU_32_BIT - (void)hex_long((ptr_int_t)w); - #else - (void)hex_word((ptr_int_t)w); - #endif - return _hex; - } - - void print_hex_nybble(const uint8_t n) { SERIAL_CHAR(hex_nybble(n)); } - void print_hex_byte(const uint8_t b) { SERIAL_ECHO(hex_byte(b)); } - void print_hex_word(const uint16_t w) { SERIAL_ECHO(hex_word(w)); } - void print_hex_address(const void * const w) { SERIAL_ECHO(hex_address(w)); } - - void print_hex_long(const uint32_t w, const char delimiter) { - SERIAL_ECHOPGM("0x"); - for (int B = 24; B >= 8; B -= 8){ - print_hex_byte(w >> B); - SERIAL_CHAR(delimiter); - } - print_hex_byte(w); - } - -#endif // AUTO_BED_LEVELING_UBL || M100_FREE_MEMORY_WATCHER || DEBUG_GCODE_PARSER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.h deleted file mode 100644 index 09d6d17013..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/hex_print_routines.h +++ /dev/null @@ -1,47 +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 - -#include - -// -// Utility functions to create and print hex strings as nybble, byte, and word. -// - -FORCE_INLINE char hex_nybble(const uint8_t n) { - return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10); -} -char* hex_byte(const uint8_t b); -char* hex_word(const uint16_t w); -char* hex_address(const void * const w); - -void print_hex_nybble(const uint8_t n); -void print_hex_byte(const uint8_t b); -void print_hex_word(const uint16_t w); -void print_hex_address(const void * const w); -void print_hex_long(const uint32_t w, const char delimiter); - -#ifdef CPU_32_BIT - typedef uint32_t ptr_int_t; -#else - typedef uint16_t ptr_int_t; -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.cpp deleted file mode 100644 index 1353296794..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.cpp +++ /dev/null @@ -1,70 +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 . - * - */ - -/** - * Least Squares Best Fit by Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. It also does not require all of - * coordinates to be present during the calculations. Each point can be - * probed and then discarded. - * - */ - -#include "../inc/MarlinConfig.h" - -#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - -#include "least_squares_fit.h" - -#include - -int finish_incremental_LSF(struct linear_fit_data *lsf) { - - const float N = lsf->N; - - if (N == 0.0) - return 1; - - lsf->xbar /= N; - lsf->ybar /= N; - lsf->zbar /= N; - lsf->x2bar = lsf->x2bar / N - sq(lsf->xbar); - lsf->y2bar = lsf->y2bar / N - sq(lsf->ybar); - lsf->z2bar = lsf->z2bar / N - sq(lsf->zbar); - lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar; - lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar; - lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar; - const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar); - - if (ABS(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy)) - return 1; - - lsf->A = (lsf->yzbar * lsf->xybar - lsf->xzbar * lsf->y2bar) / DD; - lsf->B = (lsf->xzbar * lsf->xybar - lsf->yzbar * lsf->x2bar) / DD; - lsf->D = -(lsf->zbar + lsf->A * lsf->xbar + lsf->B * lsf->ybar); - return 0; -} - -#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.h deleted file mode 100644 index acb29402c5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/least_squares_fit.h +++ /dev/null @@ -1,90 +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 - -/** - * Incremental Least Squares Best Fit By Roxy and Ed Williams - * - * This algorithm is high speed and has a very small code footprint. - * Its results are identical to both the Iterative Least-Squares published - * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE - * it saves roughly 10K of program memory. And even better... the data - * fed into the algorithm does not need to all be present at the same time. - * A point can be probed and its values fed into the algorithm and then discarded. - * - */ - -#include "../inc/MarlinConfig.h" -#include - -struct linear_fit_data { - float xbar, ybar, zbar, - x2bar, y2bar, z2bar, - xybar, xzbar, yzbar, - max_absx, max_absy, - A, B, D, N; -}; - -inline void incremental_LSF_reset(struct linear_fit_data *lsf) { - memset(lsf, 0, sizeof(linear_fit_data)); -} - -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) - 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(wx), lsf->max_absx); - lsf->max_absy = _MAX(ABS(wy), lsf->max_absy); -} -inline void incremental_WLSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z, const float &w) { - incremental_WLSF(lsf, pos.x, pos.y, z, w); -} - -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; - lsf->x2bar += sq(x); - lsf->y2bar += sq(y); - lsf->z2bar += sq(z); - lsf->xybar += x * y; - lsf->xzbar += x * z; - lsf->yzbar += y * z; - lsf->max_absx = _MAX(ABS(x), lsf->max_absx); - lsf->max_absy = _MAX(ABS(y), lsf->max_absy); - lsf->N += 1.0; -} -inline void incremental_LSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z) { - incremental_LSF(lsf, pos.x, pos.y, z); -} - -int finish_incremental_LSF(struct linear_fit_data *); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.cpp deleted file mode 100644 index b95a7c8afc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.cpp +++ /dev/null @@ -1,210 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if EITHER(NOZZLE_CLEAN_FEATURE, NOZZLE_PARK_FEATURE) - -#include "nozzle.h" - -Nozzle nozzle; - -#include "../Marlin.h" -#include "../module/motion.h" - -#if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start xyz_pos_t defining the starting point - * @param end xyz_pos_t defining the ending point - * @param strokes number of strokes to execute - */ - void Nozzle::stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) { - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const xyz_pos_t oldpos = current_position; - #endif - - // Move to the starting point - #if ENABLED(NOZZLE_CLEAN_NO_Z) - do_blocking_move_to_xy(start); - #else - do_blocking_move_to(start); - #endif - - // Start the stroke pattern - for (uint8_t i = 0; i < (strokes >> 1); i++) { - do_blocking_move_to_xy(end); - do_blocking_move_to_xy(start); - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(oldpos); - #endif - } - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start xyz_pos_t defining the starting point - * @param end xyz_pos_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of triangles to do - */ - void Nozzle::zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) { - const xy_pos_t diff = end - start; - if (!diff.x || !diff.y) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const xyz_pos_t back = current_position; - #endif - - #if ENABLED(NOZZLE_CLEAN_NO_Z) - do_blocking_move_to_xy(start); - #else - do_blocking_move_to(start); - #endif - - const uint8_t zigs = objects << 1; - const bool horiz = ABS(diff.x) >= ABS(diff.y); // Do a horizontal wipe? - const float P = (horiz ? diff.x : diff.y) / zigs; // Period of each zig / zag - const xyz_pos_t *side; - for (uint8_t j = 0; j < strokes; j++) { - for (int8_t i = 0; i < zigs; i++) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - for (int8_t i = zigs; i >= 0; i--) { - side = (i & 1) ? &end : &start; - if (horiz) - do_blocking_move_to_xy(start.x + i * P, side->y); - else - do_blocking_move_to_xy(side->x, start.y + i * P); - } - } - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(back); - #endif - } - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start xyz_pos_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) { - if (strokes == 0) return; - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - const xyz_pos_t back = current_position; - #endif - - #if ENABLED(NOZZLE_CLEAN_NO_Z) - do_blocking_move_to_xy(start); - #else - do_blocking_move_to(start); - #endif - - for (uint8_t s = 0; s < strokes; s++) - for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++) - do_blocking_move_to_xy( - middle.x + sin((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius, - middle.y + cos((RADIANS(360) / NOZZLE_CLEAN_CIRCLE_FN) * i) * radius - ); - - // Let's be safe - do_blocking_move_to_xy(start); - - #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(back); - #endif - } - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) { - xyz_pos_t start = NOZZLE_CLEAN_START_POINT, end = NOZZLE_CLEAN_END_POINT; - - if (pattern == 2) { - if (!(cleans & (_BV(X_AXIS) | _BV(Y_AXIS)))) { - SERIAL_ECHOLNPGM("Warning : Clean Circle requires XY"); - return; - } - constexpr xyz_pos_t middle NOZZLE_CLEAN_CIRCLE_MIDDLE; - end = middle; - } - else { - if (!TEST(cleans, X_AXIS)) start.x = end.x = current_position.x; - if (!TEST(cleans, Y_AXIS)) start.y = end.y = current_position.y; - } - if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position.z; - - switch (pattern) { - case 1: zigzag(start, end, strokes, objects); break; - case 2: circle(start, end, strokes, radius); break; - default: stroke(start, end, strokes); - } - } - -#endif // NOZZLE_CLEAN_FEATURE - -#if ENABLED(NOZZLE_PARK_FEATURE) - - void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) { - 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 - do_blocking_move_to_z(park.z, fr_z); - break; - - case 2: // Raise by Z-park height - do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z); - break; - - default: // Raise to at least the Z-park height - do_blocking_move_to_z(_MAX(park.z, current_position.z), fr_z); - } - - do_blocking_move_to_xy(park, fr_xy); - - report_current_position(); - } - -#endif // NOZZLE_PARK_FEATURE - -#endif // NOZZLE_CLEAN_FEATURE || NOZZLE_PARK_FEATURE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.h deleted file mode 100644 index 280f8b1a38..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/nozzle.h +++ /dev/null @@ -1,91 +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 - -#include "../inc/MarlinConfig.h" - -/** - * @brief Nozzle class - * - * @todo: Do not ignore the end.z value and allow XYZ movements - */ -class Nozzle { - private: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Stroke clean pattern - * @details Wipes the nozzle back and forth in a linear movement - * - * @param start xyz_pos_t defining the starting point - * @param end xyz_pos_t defining the ending point - * @param strokes number of strokes to execute - */ - static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) _Os; - - /** - * @brief Zig-zag clean pattern - * @details Apply a zig-zag cleaning pattern - * - * @param start xyz_pos_t defining the starting point - * @param end xyz_pos_t defining the ending point - * @param strokes number of strokes to execute - * @param objects number of objects to create - */ - static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; - - /** - * @brief Circular clean pattern - * @details Apply a circular cleaning pattern - * - * @param start xyz_pos_t defining the middle of circle - * @param strokes number of strokes to execute - * @param radius radius of circle - */ - static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - public: - - #if ENABLED(NOZZLE_CLEAN_FEATURE) - - /** - * @brief Clean the nozzle - * @details Starts the selected clean procedure pattern - * - * @param pattern one of the available patterns - * @param argument depends on the cleaning pattern - */ - static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) _Os; - - #endif // NOZZLE_CLEAN_FEATURE - - #if ENABLED(NOZZLE_PARK_FEATURE) - - static void park(const uint8_t z_action, const xyz_pos_t &park=NOZZLE_PARK_POINT) _Os; - - #endif -}; - -extern Nozzle nozzle; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.cpp deleted file mode 100644 index 6054f877e5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.cpp +++ /dev/null @@ -1,324 +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 . - * - */ - -#include "numtostr.h" - -#include "../inc/MarlinConfigPre.h" -#include "../core/utility.h" - -char conv[8] = { 0 }; - -#define DIGIT(n) ('0' + (n)) -#define DIGIMOD(n, f) DIGIT((n)/(f) % 10) -#define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ') -#define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-')) - -// Convert a full-range unsigned 8bit int to a percentage -const char* ui8tostr4pct(const uint8_t i) { - const uint8_t n = ui8_to_percent(i); - conv[3] = RJDIGIT(n, 100); - conv[4] = RJDIGIT(n, 10); - conv[5] = DIGIMOD(n, 1); - conv[6] = '%'; - return &conv[3]; -} - -// Convert unsigned 8bit int to string 123 format -const char* ui8tostr3(const uint8_t i) { - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[4]; -} - -// Convert signed 8bit int to rj string with 123 or -12 format -const char* i8tostr3(const int8_t x) { - int xx = x; - conv[4] = MINUSOR(xx, RJDIGIT(xx, 100)); - conv[5] = RJDIGIT(xx, 10); - conv[6] = DIGIMOD(xx, 1); - return &conv[4]; -} - -#if HAS_PRINT_PROGRESS_PERMYRIAD - // Convert unsigned 16-bit permyriad to percent with 100 / 23 / 23.4 / 3.45 format - const char* permyriadtostr4(const uint16_t xx) { - if (xx >= 10000) - return "100"; - else if (xx >= 1000) { - conv[3] = DIGIMOD(xx, 1000); - conv[4] = DIGIMOD(xx, 100); - conv[5] = '.'; - conv[6] = DIGIMOD(xx, 10); - return &conv[3]; - } - else if (xx % 100 == 0) { - conv[4] = ' '; - conv[5] = RJDIGIT(xx, 1000); - conv[6] = DIGIMOD(xx, 100); - return &conv[4]; - } - else { - conv[3] = DIGIMOD(xx, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(xx, 10); - conv[6] = RJDIGIT(xx, 1); - return &conv[3]; - } - } -#endif - -// Convert unsigned 16bit int to string 12345 format -const char* ui16tostr5(const uint16_t xx) { - conv[2] = RJDIGIT(xx, 10000); - conv[3] = RJDIGIT(xx, 1000); - conv[4] = RJDIGIT(xx, 100); - conv[5] = RJDIGIT(xx, 10); - conv[6] = DIGIMOD(xx, 1); - return &conv[2]; -} - -// Convert unsigned 16bit int to string 1234 format -const char* ui16tostr4(const uint16_t xx) { - conv[3] = RJDIGIT(xx, 1000); - conv[4] = RJDIGIT(xx, 100); - conv[5] = RJDIGIT(xx, 10); - conv[6] = DIGIMOD(xx, 1); - return &conv[3]; -} - -// Convert unsigned 16bit int to string 123 format -const char* ui16tostr3(const uint16_t xx) { - conv[4] = RJDIGIT(xx, 100); - conv[5] = RJDIGIT(xx, 10); - conv[6] = DIGIMOD(xx, 1); - return &conv[4]; -} - -// Convert signed 16bit int to rj string with 123 or -12 format -const char* i16tostr3(const int16_t x) { - int xx = x; - conv[4] = MINUSOR(xx, RJDIGIT(xx, 100)); - conv[5] = RJDIGIT(xx, 10); - conv[6] = DIGIMOD(xx, 1); - return &conv[4]; -} - -// Convert unsigned 16bit int to lj string with 123 format -const char* i16tostr3left(const int16_t i) { - char *str = &conv[6]; - *str = DIGIMOD(i, 1); - if (i >= 10) { - *(--str) = DIGIMOD(i, 10); - if (i >= 100) - *(--str) = DIGIMOD(i, 100); - } - return str; -} - -// Convert signed 16bit int to rj string with 1234, _123, -123, _-12, or __-1 format -const char* i16tostr4sign(const int16_t i) { - const bool neg = i < 0; - const int ii = neg ? -i : i; - if (i >= 1000) { - conv[3] = DIGIMOD(ii, 1000); - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else if (ii >= 100) { - conv[3] = neg ? '-' : ' '; - conv[4] = DIGIMOD(ii, 100); - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[3] = ' '; - conv[4] = ' '; - if (ii >= 10) { - conv[4] = neg ? '-' : ' '; - conv[5] = DIGIMOD(ii, 10); - } - else { - conv[5] = neg ? '-' : ' '; - } - } - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; -} - -// Convert unsigned float to string with 1.23 format -const char* ftostr12ns(const float &f) { - const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[3]; -} - -// Convert signed float to fixed-length string with 12.34 / -2.34 format or 123.45 / -23.45 format -const char* ftostr42_52(const float &f) { - if (f <= -10 || f >= 100) return ftostr52(f); // need more digits - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[2] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 1000)); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[2]; -} - -// Convert signed float to fixed-length string with 023.45 / -23.45 format -const char* ftostr52(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, DIGIMOD(i, 10000)); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; -} - -#if ENABLED(LCD_DECIMAL_SMALL_XY) - - // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format - const char* ftostr4sign(const float &f) { - const int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - if (!WITHIN(i, -99, 999)) return i16tostr4sign((int)f); - const bool neg = i < 0; - const int ii = neg ? -i : i; - conv[3] = neg ? '-' : (ii >= 100 ? DIGIMOD(ii, 100) : ' '); - conv[4] = DIGIMOD(ii, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(ii, 1); - return &conv[3]; - } - -#endif - -// Convert float to fixed-length string with +123.4 / -123.4 format -const char* ftostr41sign(const float &f) { - int i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return &conv[1]; -} - -// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -const char* ftostr43sign(const float &f, char plus/*=' '*/) { - long i = (f * 10000 + (f < 0 ? -5: 5)) / 10; - conv[1] = i ? MINUSOR(i, plus) : ' '; - conv[2] = DIGIMOD(i, 1000); - conv[3] = '.'; - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[1]; -} - -// Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format -const char* ftostr54sign(const float &f, char plus/*=' '*/) { - long i = (f * 100000 + (f < 0 ? -5: 5)) / 10; - conv[0] = i ? MINUSOR(i, plus) : ' '; - conv[1] = DIGIMOD(i, 10000); - conv[2] = '.'; - conv[3] = DIGIMOD(i, 1000); - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[0]; -} - -// Convert unsigned float to rj string with 12345 format -const char* ftostr5rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; - return ui16tostr5(i); -} - -// Convert signed float to string with +1234.5 format -const char* ftostr51sign(const float &f) { - long i = (f * 100 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return conv; -} - -// Convert signed float to string with +123.45 format -const char* ftostr52sign(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - conv[0] = MINUSOR(i, '+'); - conv[1] = DIGIMOD(i, 10000); - conv[2] = DIGIMOD(i, 1000); - conv[3] = DIGIMOD(i, 100); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIMOD(i, 1); - return conv; -} - -// Convert unsigned float to string with 1234.5 format omitting trailing zeros -const char* ftostr51rj(const float &f) { - const long i = ((f < 0 ? -f : f) * 100 + 5) / 10; - conv[0] = ' '; - conv[1] = RJDIGIT(i, 10000); - conv[2] = RJDIGIT(i, 1000); - conv[3] = RJDIGIT(i, 100); - conv[4] = DIGIMOD(i, 10); - conv[5] = '.'; - conv[6] = DIGIMOD(i, 1); - return conv; -} - -// Convert signed float to space-padded string with -_23.4_ format -const char* ftostr52sp(const float &f) { - long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; - uint8_t dig; - conv[0] = MINUSOR(i, ' '); - conv[1] = RJDIGIT(i, 10000); - conv[2] = RJDIGIT(i, 1000); - conv[3] = DIGIMOD(i, 100); - - if ((dig = i % 10)) { // second digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIMOD(i, 10); - conv[6] = DIGIT(dig); - } - else { - if ((dig = (i / 10) % 10)) { // first digit after decimal point? - conv[4] = '.'; - conv[5] = DIGIT(dig); - } - else // nothing after decimal point - conv[4] = conv[5] = ' '; - conv[6] = ' '; - } - return conv; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.h deleted file mode 100644 index f18df094a3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/numtostr.h +++ /dev/null @@ -1,104 +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 - -#include - -// Convert a full-range unsigned 8bit int to a percentage -const char* ui8tostr4pct(const uint8_t i); - -// Convert uint8_t to string with 123 format -const char* ui8tostr3(const uint8_t i); - -// Convert int8_t to string with 123 format -const char* i8tostr3(const int8_t x); - -#if HAS_PRINT_PROGRESS_PERMYRIAD - // Convert 16-bit unsigned permyriad value to percent: 100 / 23 / 23.4 / 3.45 - const char* permyriadtostr4(const uint16_t xx); -#endif - -// Convert uint16_t to string with 12345 format -const char* ui16tostr5(const uint16_t x); - -// Convert uint16_t to string with 1234 format -const char* ui16tostr4(const uint16_t x); - -// Convert uint16_t to string with 123 format -const char* ui16tostr3(const uint16_t x); - -// Convert int16_t to string with 123 format -const char* i16tostr3(const int16_t x); - -// Convert unsigned int to lj string with 123 format -const char* i16tostr3left(const int16_t xx); - -// Convert signed int to rj string with _123, -123, _-12, or __-1 format -const char* i16tostr4sign(const int16_t x); - -// Convert unsigned float to string with 1.23 format -const char* ftostr12ns(const float &x); - -// Convert signed float to fixed-length string with 12.34 / -2.34 or 023.45 / -23.45 format -const char* ftostr42_52(const float &x); - -// Convert signed float to fixed-length string with 023.45 / -23.45 format -const char* ftostr52(const float &x); - -// Convert float to fixed-length string with +123.4 / -123.4 format -const char* ftostr41sign(const float &x); - -// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -const char* ftostr43sign(const float &x, char plus=' '); - -// Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format -const char* ftostr54sign(const float &x, char plus=' '); - -// Convert unsigned float to rj string with 12345 format -const char* ftostr5rj(const float &x); - -// Convert signed float to string with +1234.5 format -const char* ftostr51sign(const float &x); - -// Convert signed float to space-padded string with -_23.4_ format -const char* ftostr52sp(const float &x); - -// Convert signed float to string with +123.45 format -const char* ftostr52sign(const float &x); - -// Convert unsigned float to string with 1234.5 format omitting trailing zeros -const char* ftostr51rj(const float &x); - -#include "../core/macros.h" - -// Convert float to rj string with 123 or -12 format -FORCE_INLINE const 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 - const char* ftostr4sign(const float &fx); -#else - // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format - FORCE_INLINE const char* ftostr4sign(const float &x) { return i16tostr4sign(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/private_spi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/private_spi.h deleted file mode 100644 index a3f8621f0d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/private_spi.h +++ /dev/null @@ -1,54 +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 - -#include "softspi.h" -#include - -template -class SPIclass { - static SoftSPI softSPI; - public: - FORCE_INLINE static void init() { softSPI.begin(); } - FORCE_INLINE static void send(uint8_t data) { softSPI.send(data); } - FORCE_INLINE static uint8_t receive() { return softSPI.receive(); } -}; - -// Hardware SPI -template<> -class SPIclass { - public: - FORCE_INLINE static void init() { - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - } - FORCE_INLINE static uint8_t receive() { - #if defined(__AVR__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) - SPDR = 0; - for (;!TEST(SPSR, SPIF);); - return SPDR; - #else - return spiRec(); - #endif - } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/softspi.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/softspi.h deleted file mode 100644 index 39d56b26f7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/softspi.h +++ /dev/null @@ -1,749 +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 - -// -// Based on https://github.com/niteris/ArduinoSoftSpi -// - -#include "../HAL/shared/Marduino.h" - -#ifndef FORCE_INLINE - #define FORCE_INLINE inline __attribute__((always_inline)) -#endif - -#define nop __asm__ volatile ("nop") // NOP for timing - -#ifdef __arm__ - - #ifdef CORE_TEENSY - - /** - * Read pin value - * @param[in] pin Arduino pin number - * @return value read - */ - FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { - return *portInputRegister(pin); - } - - /** - * Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ - FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool value) { - if (value) - *portSetRegister(pin) = 1; - else - *portClearRegister(pin) = 1; - } - - #else // !CORE_TEENSY - - /** - * Read pin value - * @param[in] pin Arduino pin number - * @return value read - */ - FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { - return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; - } - - /** - * Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ - FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool value) { - if (value) - g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else - g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; - } - - #endif // !CORE_TEENSY - - inline void fastDigitalToggle(uint8_t pin) { fastDigitalWrite(pin, !fastDigitalRead(pin)); } - - inline void fastPinMode(uint8_t pin, bool mode) { pinMode(pin, mode); } - -#else // !__arm__ - - #include - #include - - /** - * @class pin_map_t - * @brief struct for mapping digital pins - */ - struct pin_map_t { - volatile uint8_t* ddr; /**< address of DDR for this pin */ - volatile uint8_t* pin; /**< address of PIN for this pin */ - volatile uint8_t* port; /**< address of PORT for this pin */ - uint8_t bit; /**< bit number for this pin */ - }; - - #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) - - // 168 and 328 Arduinos - const static pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRB, &PINB, &PORTB, 0}, // B0 8 - {&DDRB, &PINB, &PORTB, 1}, // B1 9 - {&DDRB, &PINB, &PORTB, 2}, // B2 10 - {&DDRB, &PINB, &PORTB, 3}, // B3 11 - {&DDRB, &PINB, &PORTB, 4}, // B4 12 - {&DDRB, &PINB, &PORTB, 5}, // B5 13 - {&DDRC, &PINC, &PORTC, 0}, // C0 14 - {&DDRC, &PINC, &PORTC, 1}, // C1 15 - {&DDRC, &PINC, &PORTC, 2}, // C2 16 - {&DDRC, &PINC, &PORTC, 3}, // C3 17 - {&DDRC, &PINC, &PORTC, 4}, // C4 18 - {&DDRC, &PINC, &PORTC, 5} // C5 19 - }; - - #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - - // Mega - static const pin_map_t pinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 4}, // E4 2 - {&DDRE, &PINE, &PORTE, 5}, // E5 3 - {&DDRG, &PING, &PORTG, 5}, // G5 4 - {&DDRE, &PINE, &PORTE, 3}, // E3 5 - {&DDRH, &PINH, &PORTH, 3}, // H3 6 - {&DDRH, &PINH, &PORTH, 4}, // H4 7 - {&DDRH, &PINH, &PORTH, 5}, // H5 8 - {&DDRH, &PINH, &PORTH, 6}, // H6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 - {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 - {&DDRH, &PINH, &PORTH, 1}, // H1 16 - {&DDRH, &PINH, &PORTH, 0}, // H0 17 - {&DDRD, &PIND, &PORTD, 3}, // D3 18 - {&DDRD, &PIND, &PORTD, 2}, // D2 19 - {&DDRD, &PIND, &PORTD, 1}, // D1 20 - {&DDRD, &PIND, &PORTD, 0}, // D0 21 - {&DDRA, &PINA, &PORTA, 0}, // A0 22 - {&DDRA, &PINA, &PORTA, 1}, // A1 23 - {&DDRA, &PINA, &PORTA, 2}, // A2 24 - {&DDRA, &PINA, &PORTA, 3}, // A3 25 - {&DDRA, &PINA, &PORTA, 4}, // A4 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRA, &PINA, &PORTA, 6}, // A6 28 - {&DDRA, &PINA, &PORTA, 7}, // A7 29 - {&DDRC, &PINC, &PORTC, 7}, // C7 30 - {&DDRC, &PINC, &PORTC, 6}, // C6 31 - {&DDRC, &PINC, &PORTC, 5}, // C5 32 - {&DDRC, &PINC, &PORTC, 4}, // C4 33 - {&DDRC, &PINC, &PORTC, 3}, // C3 34 - {&DDRC, &PINC, &PORTC, 2}, // C2 35 - {&DDRC, &PINC, &PORTC, 1}, // C1 36 - {&DDRC, &PINC, &PORTC, 0}, // C0 37 - {&DDRD, &PIND, &PORTD, 7}, // D7 38 - {&DDRG, &PING, &PORTG, 2}, // G2 39 - {&DDRG, &PING, &PORTG, 1}, // G1 40 - {&DDRG, &PING, &PORTG, 0}, // G0 41 - {&DDRL, &PINL, &PORTL, 7}, // L7 42 - {&DDRL, &PINL, &PORTL, 6}, // L6 43 - {&DDRL, &PINL, &PORTL, 5}, // L5 44 - {&DDRL, &PINL, &PORTL, 4}, // L4 45 - {&DDRL, &PINL, &PORTL, 3}, // L3 46 - {&DDRL, &PINL, &PORTL, 2}, // L2 47 - {&DDRL, &PINL, &PORTL, 1}, // L1 48 - {&DDRL, &PINL, &PORTL, 0}, // L0 49 - {&DDRB, &PINB, &PORTB, 3}, // B3 50 - {&DDRB, &PINB, &PORTB, 2}, // B2 51 - {&DDRB, &PINB, &PORTB, 1}, // B1 52 - {&DDRB, &PINB, &PORTB, 0}, // B0 53 - {&DDRF, &PINF, &PORTF, 0}, // F0 54 - {&DDRF, &PINF, &PORTF, 1}, // F1 55 - {&DDRF, &PINF, &PORTF, 2}, // F2 56 - {&DDRF, &PINF, &PORTF, 3}, // F3 57 - {&DDRF, &PINF, &PORTF, 4}, // F4 58 - {&DDRF, &PINF, &PORTF, 5}, // F5 59 - {&DDRF, &PINF, &PORTF, 6}, // F6 60 - {&DDRF, &PINF, &PORTF, 7}, // F7 61 - {&DDRK, &PINK, &PORTK, 0}, // K0 62 - {&DDRK, &PINK, &PORTK, 1}, // K1 63 - {&DDRK, &PINK, &PORTK, 2}, // K2 64 - {&DDRK, &PINK, &PORTK, 3}, // K3 65 - {&DDRK, &PINK, &PORTK, 4}, // K4 66 - {&DDRK, &PINK, &PORTK, 5}, // K5 67 - {&DDRK, &PINK, &PORTK, 6}, // K6 68 - {&DDRK, &PINK, &PORTK, 7}, // K7 69 - - // pins_MIGHTYBOARD_REVE.h - {&DDRG, &PING, &PORTG, 4}, // G4 70 - {&DDRG, &PING, &PORTG, 3}, // G3 71 - {&DDRJ, &PINJ, &PORTJ, 2}, // J2 72 - {&DDRJ, &PINJ, &PORTJ, 3}, // J3 73 - {&DDRJ, &PINJ, &PORTJ, 7}, // J7 74 - {&DDRJ, &PINJ, &PORTJ, 4}, // J4 75 - {&DDRJ, &PINJ, &PORTJ, 5}, // J5 76 - {&DDRJ, &PINJ, &PORTJ, 6}, // J6 77 - {&DDRE, &PINE, &PORTE, 2}, // E2 78 - {&DDRE, &PINE, &PORTE, 6} // E6 79 - }; - - #elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__) \ - || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) \ - || defined(__AVR_ATmega64__) || defined(__AVR_ATmega32__) \ - || defined(__AVR_ATmega324__) || defined(__AVR_ATmega16__) - - #ifdef VARIANT_MIGHTY - - // Mighty Layout - static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 0}, // A0 24 - {&DDRA, &PINA, &PORTA, 1}, // A1 25 - {&DDRA, &PINA, &PORTA, 2}, // A2 26 - {&DDRA, &PINA, &PORTA, 3}, // A3 27 - {&DDRA, &PINA, &PORTA, 4}, // A4 28 - {&DDRA, &PINA, &PORTA, 5}, // A5 29 - {&DDRA, &PINA, &PORTA, 6}, // A6 30 - {&DDRA, &PINA, &PORTA, 7} // A7 31 - }; - - #elif defined(VARIANT_BOBUINO) - - // Bobuino Layout - static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRB, &PINB, &PORTB, 0}, // B0 4 - {&DDRB, &PINB, &PORTB, 1}, // B1 5 - {&DDRB, &PINB, &PORTB, 2}, // B2 6 - {&DDRB, &PINB, &PORTB, 3}, // B3 7 - {&DDRD, &PIND, &PORTD, 5}, // D5 8 - {&DDRD, &PIND, &PORTD, 6}, // D6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRA, &PINA, &PORTA, 7}, // A7 14 - {&DDRA, &PINA, &PORTA, 6}, // A6 15 - {&DDRA, &PINA, &PORTA, 5}, // A5 16 - {&DDRA, &PINA, &PORTA, 4}, // A4 17 - {&DDRA, &PINA, &PORTA, 3}, // A3 18 - {&DDRA, &PINA, &PORTA, 2}, // A2 19 - {&DDRA, &PINA, &PORTA, 1}, // A1 20 - {&DDRA, &PINA, &PORTA, 0}, // A0 21 - {&DDRC, &PINC, &PORTC, 0}, // C0 22 - {&DDRC, &PINC, &PORTC, 1}, // C1 23 - {&DDRC, &PINC, &PORTC, 2}, // C2 24 - {&DDRC, &PINC, &PORTC, 3}, // C3 25 - {&DDRC, &PINC, &PORTC, 4}, // C4 26 - {&DDRC, &PINC, &PORTC, 5}, // C5 27 - {&DDRC, &PINC, &PORTC, 6}, // C6 28 - {&DDRC, &PINC, &PORTC, 7}, // C7 29 - {&DDRD, &PIND, &PORTD, 4}, // D4 30 - {&DDRD, &PIND, &PORTD, 7} // D7 31 - }; - - #elif defined(VARIANT_STANDARD) - - // Standard Layout - static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 7}, // A7 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRA, &PINA, &PORTA, 5}, // A5 26 - {&DDRA, &PINA, &PORTA, 4}, // A4 27 - {&DDRA, &PINA, &PORTA, 3}, // A3 28 - {&DDRA, &PINA, &PORTA, 2}, // A2 29 - {&DDRA, &PINA, &PORTA, 1}, // A1 30 - {&DDRA, &PINA, &PORTA, 0} // A0 31 - }; - - #else // !(VARIANT_MIGHTY || VARIANT_BOBUINO || VARIANT_STANDARD) - - #error Undefined variant 1284, 644, 324, 64, 32 - - #endif - - #elif defined(__AVR_ATmega32U4__) - - #ifdef CORE_TEENSY - - // Teensy 2.0 - static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 7}, // B7 4 - {&DDRD, &PIND, &PORTD, 0}, // D0 5 - {&DDRD, &PIND, &PORTD, 1}, // D1 6 - {&DDRD, &PIND, &PORTD, 2}, // D2 7 - {&DDRD, &PIND, &PORTD, 3}, // D3 8 - {&DDRC, &PINC, &PORTC, 6}, // C6 9 - {&DDRC, &PINC, &PORTC, 7}, // C7 10 - {&DDRD, &PIND, &PORTD, 6}, // D6 11 - {&DDRD, &PIND, &PORTD, 7}, // D7 12 - {&DDRB, &PINB, &PORTB, 4}, // B4 13 - {&DDRB, &PINB, &PORTB, 5}, // B5 14 - {&DDRB, &PINB, &PORTB, 6}, // B6 15 - {&DDRF, &PINF, &PORTF, 7}, // F7 16 - {&DDRF, &PINF, &PORTF, 6}, // F6 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 4}, // F4 19 - {&DDRF, &PINF, &PORTF, 1}, // F1 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRD, &PIND, &PORTD, 4}, // D4 22 - {&DDRD, &PIND, &PORTD, 5}, // D5 23 - {&DDRE, &PINE, &PORTE, 6} // E6 24 - }; - - #else // !CORE_TEENSY - - // Leonardo - static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 2}, // D2 0 - {&DDRD, &PIND, &PORTD, 3}, // D3 1 - {&DDRD, &PIND, &PORTD, 1}, // D1 2 - {&DDRD, &PIND, &PORTD, 0}, // D0 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRC, &PINC, &PORTC, 6}, // C6 5 - {&DDRD, &PIND, &PORTD, 7}, // D7 6 - {&DDRE, &PINE, &PORTE, 6}, // E6 7 - {&DDRB, &PINB, &PORTB, 4}, // B4 8 - {&DDRB, &PINB, &PORTB, 5}, // B5 9 - {&DDRB, &PINB, &PORTB, 6}, // B6 10 - {&DDRB, &PINB, &PORTB, 7}, // B7 11 - {&DDRD, &PIND, &PORTD, 6}, // D6 12 - {&DDRC, &PINC, &PORTC, 7}, // C7 13 - {&DDRB, &PINB, &PORTB, 3}, // B3 14 - {&DDRB, &PINB, &PORTB, 1}, // B1 15 - {&DDRB, &PINB, &PORTB, 2}, // B2 16 - {&DDRB, &PINB, &PORTB, 0}, // B0 17 - {&DDRF, &PINF, &PORTF, 7}, // F7 18 - {&DDRF, &PINF, &PORTF, 6}, // F6 19 - {&DDRF, &PINF, &PORTF, 5}, // F5 20 - {&DDRF, &PINF, &PORTF, 4}, // F4 21 - {&DDRF, &PINF, &PORTF, 1}, // F1 22 - {&DDRF, &PINF, &PORTF, 0}, // F0 23 - {&DDRD, &PIND, &PORTD, 4}, // D4 24 - {&DDRD, &PIND, &PORTD, 7}, // D7 25 - {&DDRB, &PINB, &PORTB, 4}, // B4 26 - {&DDRB, &PINB, &PORTB, 5}, // B5 27 - {&DDRB, &PINB, &PORTB, 6}, // B6 28 - {&DDRD, &PIND, &PORTD, 6} // D6 29 - }; - - #endif // !CORE_TEENSY - - #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) - - // Teensy++ 1.0 & 2.0 - static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRE, &PINE, &PORTE, 0}, // E0 8 - {&DDRE, &PINE, &PORTE, 1}, // E1 9 - {&DDRC, &PINC, &PORTC, 0}, // C0 10 - {&DDRC, &PINC, &PORTC, 1}, // C1 11 - {&DDRC, &PINC, &PORTC, 2}, // C2 12 - {&DDRC, &PINC, &PORTC, 3}, // C3 13 - {&DDRC, &PINC, &PORTC, 4}, // C4 14 - {&DDRC, &PINC, &PORTC, 5}, // C5 15 - {&DDRC, &PINC, &PORTC, 6}, // C6 16 - {&DDRC, &PINC, &PORTC, 7}, // C7 17 - {&DDRE, &PINE, &PORTE, 6}, // E6 18 - {&DDRE, &PINE, &PORTE, 7}, // E7 19 - {&DDRB, &PINB, &PORTB, 0}, // B0 20 - {&DDRB, &PINB, &PORTB, 1}, // B1 21 - {&DDRB, &PINB, &PORTB, 2}, // B2 22 - {&DDRB, &PINB, &PORTB, 3}, // B3 23 - {&DDRB, &PINB, &PORTB, 4}, // B4 24 - {&DDRB, &PINB, &PORTB, 5}, // B5 25 - {&DDRB, &PINB, &PORTB, 6}, // B6 26 - {&DDRB, &PINB, &PORTB, 7}, // B7 27 - {&DDRA, &PINA, &PORTA, 0}, // A0 28 - {&DDRA, &PINA, &PORTA, 1}, // A1 29 - {&DDRA, &PINA, &PORTA, 2}, // A2 30 - {&DDRA, &PINA, &PORTA, 3}, // A3 31 - {&DDRA, &PINA, &PORTA, 4}, // A4 32 - {&DDRA, &PINA, &PORTA, 5}, // A5 33 - {&DDRA, &PINA, &PORTA, 6}, // A6 34 - {&DDRA, &PINA, &PORTA, 7}, // A7 35 - {&DDRE, &PINE, &PORTE, 4}, // E4 36 - {&DDRE, &PINE, &PORTE, 5}, // E5 37 - {&DDRF, &PINF, &PORTF, 0}, // F0 38 - {&DDRF, &PINF, &PORTF, 1}, // F1 39 - {&DDRF, &PINF, &PORTF, 2}, // F2 40 - {&DDRF, &PINF, &PORTF, 3}, // F3 41 - {&DDRF, &PINF, &PORTF, 4}, // F4 42 - {&DDRF, &PINF, &PORTF, 5}, // F5 43 - {&DDRF, &PINF, &PORTF, 6}, // F6 44 - {&DDRF, &PINF, &PORTF, 7} // F7 45 - }; - - #else // CPU type - - #error "Unknown CPU type for Software SPI" - - #endif // CPU type - - /** count of pins */ - static constexpr uint8_t digitalPinCount = sizeof(pinMap) / sizeof(pin_map_t); - - /** generate bad pin number error */ - void badPinNumber() - __attribute__((error("Pin number is too large or not a constant"))); - - /** - * Check for valid pin number - * @param[in] pin Number of pin to be checked. - */ - FORCE_INLINE static void badPinCheck(const uint8_t pin) { - if (!__builtin_constant_p(pin) || pin >= digitalPinCount) badPinNumber(); - } - - /** - * Fast write helper - * @param[in] address I/O register address - * @param[in] bit bit number to write - * @param[in] level value for bit - */ - FORCE_INLINE static void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) { - uint8_t oldSREG; - if (address > (uint8_t*)0x5F) { oldSREG = SREG; cli(); } - if (level) SBI(*address, bit); else CBI(*address, bit); - if (address > (uint8_t*)0x5F) SREG = oldSREG; - } - - /** - * Read pin value - * @param[in] pin Arduino pin number - * @return value read - */ - FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { - badPinCheck(pin); - return (*pinMap[pin].pin >> pinMap[pin].bit) & 1; - } - - /** - * Toggle a pin - * @param[in] pin Arduino pin number - * - * If the pin is in output mode toggle the pin level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ - FORCE_INLINE static void fastDigitalToggle(uint8_t pin) { - badPinCheck(pin); - if (pinMap[pin].pin > (uint8_t*)0x5F) - *pinMap[pin].pin = _BV(pinMap[pin].bit); // Must write bit to high address port - else - SBI(*pinMap[pin].pin, pinMap[pin].bit); // Compiles to sbi and PIN register will not be read - } - - /** - * Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ - FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool level) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, level); - } - - /** - * Set pin mode - * @param[in] pin Arduino pin number - * @param[in] mode if true set output mode else input mode - * - * fastPinMode does not enable or disable the 20K pullup for input mode. - */ - FORCE_INLINE static void fastPinMode(uint8_t pin, bool mode) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].ddr, pinMap[pin].bit, mode); - } - -#endif // !__arm__ - -/** - * Set pin configuration - * @param[in] pin Arduino pin number - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ -FORCE_INLINE static void fastPinConfig(uint8_t pin, bool mode, bool level) { - fastPinMode(pin, mode); - fastDigitalWrite(pin, level); -} - -/** - * @class DigitalPin - * @brief Fast digital port I/O - */ -template -class DigitalPin { -public: - - /** Constructor */ - DigitalPin() {} - - /** - * Constructor - * @param[in] pinMode if true set output mode else input mode. - */ - explicit DigitalPin(bool pinMode) { mode(pinMode); } - - /** - * Constructor - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - DigitalPin(bool mode, bool level) { config(mode, level); } - - /** - * Assignment operator - * @param[in] value If true set the pin's level high else set the - * pin's level low. - * - * @return This DigitalPin instance. - */ - FORCE_INLINE DigitalPin & operator = (bool value) { write(value); return *this; } - - /** - * Parentheses operator - * @return Pin's level - */ - FORCE_INLINE operator bool () const { return read(); } - - /** - * Set pin configuration - * @param[in] mode If true set output mode else input mode - * @param[in] level If mode is output, set level high/low. - * If mode is input, enable or disable the pin's 20K pullup. - */ - FORCE_INLINE void config(bool mode, bool level) { fastPinConfig(PinNumber, mode, level); } - - /** - * Set pin level high if output mode or enable 20K pullup if input mode. - */ - FORCE_INLINE void high() { write(true); } - - /** - * Set pin level low if output mode or disable 20K pullup if input mode. - */ - FORCE_INLINE void low() { write(false); } - - /** - * Set pin mode - * @param[in] pinMode if true set output mode else input mode. - * - * mode() does not enable or disable the 20K pullup for input mode. - */ - FORCE_INLINE void mode(bool pinMode) { fastPinMode(PinNumber, pinMode); } - - /** @return Pin's level */ - FORCE_INLINE bool read() const { return fastDigitalRead(PinNumber); } - - /** - * Toggle a pin - * If the pin is in output mode toggle the pin's level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ - FORCE_INLINE void toggle() { fastDigitalToggle(PinNumber); } - - /** - * Write the pin's level. - * @param[in] value If true set the pin's level high else set the - * pin's level low. - */ - FORCE_INLINE void write(bool value) { fastDigitalWrite(PinNumber, value); } -}; - -const bool MISO_MODE = false, // Pin Mode for MISO is input. - MISO_LEVEL = false, // Pullups disabled for MISO are disabled. - MOSI_MODE = true, // Pin Mode for MOSI is output. - SCK_MODE = true; // Pin Mode for SCK is output. - -/** - * @class SoftSPI - * @brief Fast software SPI. - */ -template -class SoftSPI { - public: - - /** Initialize SoftSPI pins. */ - void begin() { - fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL); - fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode)); - fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode)); - } - - /** - * Soft SPI receive byte. - * @return Data byte received. - */ - FORCE_INLINE uint8_t receive() { - uint8_t data = 0; - receiveBit(7, &data); - receiveBit(6, &data); - receiveBit(5, &data); - receiveBit(4, &data); - receiveBit(3, &data); - receiveBit(2, &data); - receiveBit(1, &data); - receiveBit(0, &data); - return data; - } - - /** - * Soft SPI send byte. - * @param[in] data Data byte to send. - */ - FORCE_INLINE void send(uint8_t data) { - sendBit(7, data); - sendBit(6, data); - sendBit(5, data); - sendBit(4, data); - sendBit(3, data); - sendBit(2, data); - sendBit(1, data); - sendBit(0, data); - } - - /** - * Soft SPI transfer byte. - * @param[in] txData Data byte to send. - * @return Data byte received. - */ - FORCE_INLINE uint8_t transfer(uint8_t txData) { - uint8_t rxData = 0; - transferBit(7, &rxData, txData); - transferBit(6, &rxData, txData); - transferBit(5, &rxData, txData); - transferBit(4, &rxData, txData); - transferBit(3, &rxData, txData); - transferBit(2, &rxData, txData); - transferBit(1, &rxData, txData); - transferBit(0, &rxData, txData); - return rxData; - } - - private: - - FORCE_INLINE bool MODE_CPHA(uint8_t mode) { return bool(mode & 1); } - FORCE_INLINE bool MODE_CPOL(uint8_t mode) { return bool(mode & 2); } - FORCE_INLINE void receiveBit(uint8_t bit, uint8_t* data) { - if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - nop; - nop; - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) SBI(*data, bit); - if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - - FORCE_INLINE void sendBit(uint8_t bit, uint8_t data) { - if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - fastDigitalWrite(MosiPin, data & _BV(bit)); - fastDigitalWrite(SckPin, MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - nop; - nop; - if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - - FORCE_INLINE void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { - if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - fastDigitalWrite(MosiPin, txData & _BV(bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) SBI(*rxData, bit); - if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } - -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.cpp deleted file mode 100644 index b80a1597d5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.cpp +++ /dev/null @@ -1,123 +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 . - * - */ - -#include "stopwatch.h" - -#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; -millis_t Stopwatch::stopTimestamp; - -bool Stopwatch::stop() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("stop")); - #endif - - if (isRunning() || isPaused()) { - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif - state = STOPPED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::pause() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("pause")); - #endif - - if (isRunning()) { - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerPaused(); - #endif - state = PAUSED; - stopTimestamp = millis(); - return true; - } - else return false; -} - -bool Stopwatch::start() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("start")); - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStarted(); - #endif - - if (!isRunning()) { - if (isPaused()) accumulator = duration(); - else reset(); - - state = RUNNING; - startTimestamp = millis(); - return true; - } - else return false; -} - -void Stopwatch::resume(const millis_t with_time) { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("resume")); - #endif - - reset(); - if ((accumulator = with_time)) state = RUNNING; -} - -void Stopwatch::reset() { - #if ENABLED(DEBUG_STOPWATCH) - Stopwatch::debug(PSTR("reset")); - #endif - - state = STOPPED; - startTimestamp = 0; - stopTimestamp = 0; - accumulator = 0; -} - -millis_t Stopwatch::duration() { - return ((isRunning() ? millis() : stopTimestamp) - - startTimestamp) / 1000UL + accumulator; -} - -#if ENABLED(DEBUG_STOPWATCH) - - void Stopwatch::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("Stopwatch::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.h deleted file mode 100644 index 013c243cfe..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/stopwatch.h +++ /dev/null @@ -1,118 +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 - -// Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) -//#define DEBUG_STOPWATCH - -#include "../core/macros.h" // for FORCE_INLINE - -#include -typedef uint32_t millis_t; - -/** - * @brief Stopwatch class - * @details This class acts as a timer proving stopwatch functionality including - * the ability to pause the running time counter. - */ -class Stopwatch { - private: - enum State : char { STOPPED, RUNNING, PAUSED }; - - static Stopwatch::State state; - static millis_t accumulator; - static millis_t startTimestamp; - static millis_t stopTimestamp; - - public: - /** - * @brief Initialize the stopwatch - */ - FORCE_INLINE static void init() { reset(); } - - /** - * @brief Stop the stopwatch - * @details Stop the running timer, it will silently ignore the request if - * no timer is currently running. - * @return true on success - */ - static bool stop(); - - /** - * @brief Pause the stopwatch - * @details Pause the running timer, it will silently ignore the request if - * no timer is currently running. - * @return true on success - */ - static bool pause(); - - /** - * @brief Start the stopwatch - * @details Start the timer, it will silently ignore the request if the - * timer is already running. - * @return true on success - */ - static bool start(); - - /** - * @brief Resume the stopwatch - * @details Resume a timer from a given duration - */ - static void resume(const millis_t with_time); - - /** - * @brief Reset the stopwatch - * @details Reset all settings to their default values. - */ - static void reset(); - - /** - * @brief Check if the timer is running - * @details Return true if the timer is currently running, false otherwise. - * @return true if stopwatch is running - */ - FORCE_INLINE static bool isRunning() { return state == RUNNING; } - - /** - * @brief Check if the timer is paused - * @details Return true if the timer is currently paused, false otherwise. - * @return true if stopwatch is paused - */ - FORCE_INLINE static bool isPaused() { return state == PAUSED; } - - /** - * @brief Get the running time - * @details Return the total number of seconds the timer has been running. - * @return the delta since starting the stopwatch - */ - static millis_t duration(); - - #ifdef DEBUG_STOPWATCH - - /** - * @brief Print a debug message - * @details Print a simple debug message "Stopwatch::function" - */ - static void debug(const char func[]); - - #endif -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.cpp deleted file mode 100644 index c2bb347dac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.cpp +++ /dev/null @@ -1,158 +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 . - * - */ - -/** - * vector_3.cpp - Vector library for bed leveling - * Copyright (c) 2012 Lars Brubaker. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "../inc/MarlinConfig.h" - -#if ABL_PLANAR || ENABLED(AUTO_BED_LEVELING_UBL) - -#include "vector_3.h" - -#include - -/** - * vector_3 - */ - -vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) { - const xyz_float_t &lv = left, &rv = right; - return vector_3(lv.y * rv.z - lv.z * rv.y, // YZ cross - lv.z * rv.x - lv.x * rv.z, // ZX cross - lv.x * rv.y - lv.y * rv.x); // XY cross -} - -vector_3 vector_3::get_normal() const { - vector_3 normalized = *this; - normalized.normalize(); - return normalized; -} - -void vector_3::normalize() { - *this *= RSQRT(sq(x) + sq(y) + sq(z)); -} - -// Apply a rotation to the matrix -void vector_3::apply_rotation(const matrix_3x3 &matrix) { - const float _x = x, _y = y, _z = z; - *this = { matrix.vectors[0][0] * _x + matrix.vectors[1][0] * _y + matrix.vectors[2][0] * _z, - matrix.vectors[0][1] * _x + matrix.vectors[1][1] * _y + matrix.vectors[2][1] * _z, - matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z }; -} - -extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; - -void vector_3::debug(PGM_P const title) { - serialprintPGM(title); - SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6); - SERIAL_ECHOPAIR_F_P(SP_Y_STR, y, 6); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z, 6); -} - -/** - * matrix_3x3 - */ - -void apply_rotation_xyz(const matrix_3x3 &matrix, float &_x, float &_y, float &_z) { - vector_3 vec = vector_3(_x, _y, _z); vec.apply_rotation(matrix); - _x = vec.x; _y = vec.y; _z = vec.z; -} - -// Reset to identity. No rotate or translate. -void matrix_3x3::set_to_identity() { - for (uint8_t i = 0; i < 3; i++) - for (uint8_t j = 0; j < 3; j++) - vectors[i][j] = float(i == j); -} - -// Create a matrix from 3 vector_3 inputs -matrix_3x3 matrix_3x3::create_from_rows(const vector_3 &row_0, const vector_3 &row_1, const vector_3 &row_2) { - //row_0.debug(PSTR("row_0")); - //row_1.debug(PSTR("row_1")); - //row_2.debug(PSTR("row_2")); - matrix_3x3 new_matrix; - new_matrix.vectors[0] = row_0; - new_matrix.vectors[1] = row_1; - new_matrix.vectors[2] = row_2; - //new_matrix.debug(PSTR("new_matrix")); - return new_matrix; -} - -// Create a matrix rotated to point towards a target -matrix_3x3 matrix_3x3::create_look_at(const vector_3 &target) { - const vector_3 z_row = target.get_normal(), - x_row = vector_3(1, 0, -target.x / target.z).get_normal(), - y_row = vector_3::cross(z_row, x_row).get_normal(); - - // x_row.debug(PSTR("x_row")); - // y_row.debug(PSTR("y_row")); - // z_row.debug(PSTR("z_row")); - - // create the matrix already correctly transposed - matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); - - // rot.debug(PSTR("rot")); - return rot; -} - -// Get a transposed copy of the matrix -matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) { - matrix_3x3 new_matrix; - for (uint8_t i = 0; i < 3; i++) - for (uint8_t j = 0; j < 3; j++) - new_matrix.vectors[i][j] = original.vectors[j][i]; - return new_matrix; -} - -void matrix_3x3::debug(PGM_P const title) { - if (title != nullptr) { - serialprintPGM(title); - SERIAL_EOL(); - } - for (uint8_t i = 0; i < 3; i++) { - for (uint8_t j = 0; j < 3; j++) { - if (vectors[i][j] >= 0.0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(vectors[i][j], 6); - SERIAL_CHAR(' '); - } - SERIAL_EOL(); - } -} - -#endif // HAS_ABL_OR_UBL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.h deleted file mode 100644 index e065697f05..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/libs/vector_3.h +++ /dev/null @@ -1,90 +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 - -/** - * vector_3.cpp - Vector library for bed leveling - * Copyright (c) 2012 Lars Brubaker. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "../core/types.h" - -class matrix_3x3; - -struct vector_3 : xyz_float_t { - - vector_3(const float &_x, const float &_y, const float &_z) { set(_x, _y, _z); } - vector_3(const xy_float_t &in) { set(in.x, in.y); } - vector_3(const xyz_float_t &in) { set(in.x, in.y, in.z); } - vector_3(const xyze_float_t &in) { set(in.x, in.y, in.z); } - vector_3() { reset(); } - - // Factory method - static vector_3 cross(const vector_3 &a, const vector_3 &b); - - // Modifiers - void normalize(); - void apply_rotation(const matrix_3x3 &matrix); - - // Accessors - float get_length() const; - vector_3 get_normal() const; - - // Operators - FORCE_INLINE vector_3 operator+(const vector_3 &v) const { vector_3 o = *this; o += v; return o; } - FORCE_INLINE vector_3 operator-(const vector_3 &v) const { vector_3 o = *this; o -= v; return o; } - FORCE_INLINE vector_3 operator*(const float &v) const { vector_3 o = *this; o *= v; return o; } - - void debug(PGM_P const title); -}; - -struct matrix_3x3 { - abc_float_t vectors[3]; - - // Factory methods - static matrix_3x3 create_from_rows(const vector_3 &row_0, const vector_3 &row_1, const vector_3 &row_2); - static matrix_3x3 create_look_at(const vector_3 &target); - static matrix_3x3 transpose(const matrix_3x3 &original); - - void set_to_identity(); - - void debug(PGM_P const title); -}; - -void apply_rotation_xyz(const matrix_3x3 &rotationMatrix, float &x, float &y, float &z); -FORCE_INLINE void apply_rotation_xyz(const matrix_3x3 &rotationMatrix, xyz_pos_t &pos) { - apply_rotation_xyz(rotationMatrix, pos.x, pos.y, pos.z); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.cpp deleted file mode 100644 index 91adc2ef27..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.cpp +++ /dev/null @@ -1,3464 +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 . - * - */ - -/** - * configuration_store.cpp - * - * Settings and EEPROM storage - * - * IMPORTANT: Whenever there are changes made to the variables stored in EEPROM - * in the functions below, also increment the version number. This makes sure that - * the default values are used whenever there is a change to the data, to prevent - * wrong data being written to the variables. - * - * ALSO: Variables in the Store and Retrieve sections must be in the same order. - * If a feature is disabled, some data must still be written that, when read, - * either sets a Sane Default, or results in No Change to the existing value. - * - */ - -// Change EEPROM version if the structure changes -#define EEPROM_VERSION "V74" -#define EEPROM_OFFSET 100 - -// Check the integrity of data offsets. -// Can be disabled for production build. -//#define DEBUG_EEPROM_READWRITE - -#include "configuration_store.h" - -#include "endstops.h" -#include "planner.h" -#include "stepper.h" -#include "temperature.h" -#include "../lcd/ultralcd.h" -#include "../core/language.h" -#include "../libs/vector_3.h" // for matrix_3x3 -#include "../gcode/gcode.h" -#include "../Marlin.h" - -#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) - #include "../HAL/shared/persistent_store_api.h" -#endif - -#include "probe.h" - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -#if HAS_SERVOS - #include "servo.h" -#endif - -#if HAS_SERVOS && HAS_SERVO_ANGLES - #define EEPROM_NUM_SERVOS NUM_SERVOS -#else - #define EEPROM_NUM_SERVOS NUM_SERVO_PLUGS -#endif - -#include "../feature/fwretract.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../feature/power_loss_recovery.h" -#endif - -#include "../feature/pause.h" - -#if ENABLED(BACKLASH_COMPENSATION) - #include "../feature/backlash.h" -#endif - -#if HAS_FILAMENT_SENSOR - #include "../feature/runout.h" -#endif - -#if ENABLED(EXTRA_LIN_ADVANCE_K) - extern float saved_extruder_advance_K[EXTRUDERS]; -#endif - -#if EXTRUDERS > 1 - #include "tool_change.h" - void M217_report(const bool eeprom); -#endif - -#if ENABLED(BLTOUCH) - #include "../feature/bltouch.h" -#endif - -#if HAS_TRINAMIC - #include "stepper/indirection.h" - #include "../feature/tmc_util.h" -#endif - -#pragma pack(push, 1) // No padding between variables - -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, 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; - -extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[]; - -/** - * Current EEPROM Layout - * - * Keep this data structure up to date so - * EEPROM size is known at compile time! - */ -typedef struct SettingsDataStruct { - char version[4]; // Vnn\0 - uint16_t crc; // Data Checksum - - // - // DISTINCT_E_FACTORS - // - uint8_t esteppers; // XYZE_N - XYZ - - planner_settings_t planner_settings; - - xyze_float_t planner_max_jerk; // M205 XYZE planner.max_jerk - float planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm - - xyz_pos_t home_offset; // M206 XYZ / M665 TPZ - - #if HAS_HOTEND_OFFSET - xyz_pos_t hotend_offset[HOTENDS - 1]; // M218 XYZ - #endif - - // - // FILAMENT_RUNOUT_SENSOR - // - bool runout_sensor_enabled; // M412 S - float runout_distance_mm; // M412 D - - // - // ENABLE_LEVELING_FADE_HEIGHT - // - float planner_z_fade_height; // M420 Zn planner.z_fade_height - - // - // MESH_BED_LEVELING - // - float mbl_z_offset; // mbl.z_offset - uint8_t mesh_num_x, mesh_num_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - #if ENABLED(MESH_BED_LEVELING) - float mbl_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // mbl.z_values - #else - float mbl_z_values[3][3]; - #endif - - // - // HAS_BED_PROBE - // - - xyz_pos_t probe_offset; - - // - // ABL_PLANAR - // - matrix_3x3 planner_bed_level_matrix; // planner.bed_level_matrix - - // - // AUTO_BED_LEVELING_BILINEAR - // - uint8_t grid_max_x, grid_max_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - xy_pos_t bilinear_grid_spacing, bilinear_start; // G29 L F - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bed_mesh_t z_values; // G29 - #else - float z_values[3][3]; - #endif - - // - // AUTO_BED_LEVELING_UBL - // - bool planner_leveling_active; // M420 S planner.leveling_active - int8_t ubl_storage_slot; // ubl.storage_slot - - // - // SERVO_ANGLES - // - uint16_t servo_angles[EEPROM_NUM_SERVOS][2]; // M281 P L U - - // - // BLTOUCH - // - bool bltouch_last_written_mode; - - // - // DELTA / [XYZ]_DUAL_ENDSTOPS - // - #if ENABLED(DELTA) - float delta_height; // M666 H - abc_float_t delta_endstop_adj; // M666 XYZ - float delta_radius, // M665 R - delta_diagonal_rod, // M665 L - delta_segments_per_second; // M665 S - abc_float_t delta_tower_angle_trim; // M665 XYZ - #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS - float x2_endstop_adj, // M666 X - y2_endstop_adj, // M666 Y - z2_endstop_adj, // M666 Z (S2) - z3_endstop_adj; // M666 Z (S3) - #endif - - // - // ULTIPANEL - // - int16_t ui_preheat_hotend_temp[2], // M145 S0 H - ui_preheat_bed_temp[2]; // M145 S0 B - uint8_t ui_preheat_fan_speed[2]; // M145 S0 F - - // - // PIDTEMP - // - PIDCF_t hotendPID[HOTENDS]; // M301 En PIDCF / M303 En U - int16_t lpq_len; // M301 L - - // - // PIDTEMPBED - // - PID_t bedPID; // M304 PID / M303 E-1 U - - // - // User-defined Thermistors - // - #if HAS_USER_THERMISTORS - user_thermistor_t user_thermistor[USER_THERMISTORS]; // M305 P0 R4700 T100000 B3950 - #endif - - // - // HAS_LCD_CONTRAST - // - int16_t lcd_contrast; // M250 C - - // - // POWER_LOSS_RECOVERY - // - bool recovery_enabled; // M413 S - - // - // FWRETRACT - // - fwretract_settings_t fwretract_settings; // M207 S F Z W, M208 S F W R - bool autoretract_enabled; // M209 S - - // - // !NO_VOLUMETRIC - // - bool parser_volumetric_enabled; // M200 D parser.volumetric_enabled - float planner_filament_size[EXTRUDERS]; // M200 T D planner.filament_size[] - - // - // HAS_TRINAMIC - // - 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 X2 - tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 - - // - // LIN_ADVANCE - // - float planner_extruder_advance_K[EXTRUDERS]; // M900 K planner.extruder_advance_K - - // - // HAS_MOTOR_CURRENT_PWM - // - uint32_t motor_current_setting[3]; // M907 X Z E - - // - // CNC_COORDINATE_SYSTEMS - // - xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; // G54-G59.3 - - // - // SKEW_CORRECTION - // - skew_factor_t planner_skew_factor; // M852 I J K planner.skew_factor - - // - // ADVANCED_PAUSE_FEATURE - // - #if EXTRUDERS - fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L - #endif - - // - // Tool-change settings - // - #if EXTRUDERS > 1 - toolchange_settings_t toolchange_settings; // M217 S P R - #endif - - // - // BACKLASH_COMPENSATION - // - xyz_float_t backlash_distance_mm; // M425 X Y Z - uint8_t backlash_correction; // M425 F - float backlash_smoothing_mm; // M425 S - - // - // EXTENSIBLE_UI - // - #if ENABLED(EXTENSIBLE_UI) - // This is a significant hardware change; don't reserve space when not present - uint8_t extui_data[ExtUI::eeprom_data_size]; - #endif - -} SettingsData; - -//static_assert(sizeof(SettingsData) <= E2END + 1, "EEPROM too small to contain SettingsData!"); - -MarlinSettings settings; - -uint16_t MarlinSettings::datasize() { return sizeof(SettingsData); } - -/** - * Post-process after Retrieve or Reset - */ - -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float new_z_fade_height; -#endif - -void MarlinSettings::postprocess() { - xyze_pos_t oldpos = current_position; - - // steps per s2 needs to be updated to agree with units per s2 - planner.reset_acceleration_rates(); - - // Make sure delta kinematics are updated before refreshing the - // planner position so the stepper counts will be set correctly. - #if ENABLED(DELTA) - recalc_delta_settings(); - #endif - - #if ENABLED(PIDTEMP) - thermalManager.updatePID(); - #endif - - #if DISABLED(NO_VOLUMETRICS) - planner.calculate_volumetric_multipliers(); - #elif EXTRUDERS - for (uint8_t i = COUNT(planner.e_factor); i--;) - planner.refresh_e_factor(i); - #endif - - // Software endstops depend on home_offset - LOOP_XYZ(i) { - update_workspace_offset((AxisEnum)i); - update_software_endstops((AxisEnum)i); - } - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - set_z_fade_height(new_z_fade_height, false); // false = no report - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - refresh_bed_level(); - #endif - - #if HAS_MOTOR_CURRENT_PWM - stepper.refresh_motor_power(); - #endif - - #if ENABLED(FWRETRACT) - fwretract.refresh_autoretract(); - #endif - - #if HAS_LINEAR_E_JERK - planner.recalculate_max_e_jerk(); - #endif - - // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm - // and init stepper.count[], planner.position[] with current_position - planner.refresh_positioning(); - - // Various factors can change the current position - if (oldpos != current_position) - report_current_position(); -} - -#if BOTH(PRINTCOUNTER, EEPROM_SETTINGS) - #include "printcounter.h" - static_assert( - !WITHIN(STATS_EEPROM_ADDRESS, EEPROM_OFFSET, EEPROM_OFFSET + sizeof(SettingsData)) && - !WITHIN(STATS_EEPROM_ADDRESS + sizeof(printStatistics), EEPROM_OFFSET, EEPROM_OFFSET + sizeof(SettingsData)), - "STATS_EEPROM_ADDRESS collides with EEPROM settings storage." - ); -#endif - -#if ENABLED(SD_FIRMWARE_UPDATE) - - #if ENABLED(EEPROM_SETTINGS) - static_assert( - !WITHIN(SD_FIRMWARE_UPDATE_EEPROM_ADDR, EEPROM_OFFSET, EEPROM_OFFSET + sizeof(SettingsData)), - "SD_FIRMWARE_UPDATE_EEPROM_ADDR collides with EEPROM settings storage." - ); - #endif - - bool MarlinSettings::sd_update_status() { - uint8_t val; - persistentStore.read_data(SD_FIRMWARE_UPDATE_EEPROM_ADDR, &val); - return (val == SD_FIRMWARE_UPDATE_ACTIVE_VALUE); - } - - bool MarlinSettings::set_sd_update_status(const bool enable) { - if (enable != sd_update_status()) - persistentStore.write_data( - SD_FIRMWARE_UPDATE_EEPROM_ADDR, - enable ? SD_FIRMWARE_UPDATE_ACTIVE_VALUE : SD_FIRMWARE_UPDATE_INACTIVE_VALUE - ); - return true; - } - -#endif // SD_FIRMWARE_UPDATE - -#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - static_assert( - EEPROM_OFFSET + sizeof(SettingsData) < ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE, - "ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE is insufficient to capture all EEPROM data." - ); -#endif - -#define DEBUG_OUT ENABLED(EEPROM_CHITCHAT) -#include "../core/debug_out.h" - -#if ENABLED(EEPROM_SETTINGS) - - #define EEPROM_START() if (!persistentStore.access_start()) { SERIAL_ECHO_MSG("No EEPROM."); return false; } \ - int eeprom_index = EEPROM_OFFSET - #define EEPROM_FINISH() persistentStore.access_finish() - #define EEPROM_SKIP(VAR) (eeprom_index += sizeof(VAR)) - #define EEPROM_WRITE(VAR) do{ persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); }while(0) - #define EEPROM_READ(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating); }while(0) - #define EEPROM_READ_ALWAYS(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); }while(0) - #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = true; } }while(0) - - #if ENABLED(DEBUG_EEPROM_READWRITE) - #define _FIELD_TEST(FIELD) \ - EEPROM_ASSERT( \ - eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ - "Field " STRINGIFY(FIELD) " mismatch." \ - ) - #else - #define _FIELD_TEST(FIELD) NOOP - #endif - - const char version[4] = EEPROM_VERSION; - - bool MarlinSettings::eeprom_error, MarlinSettings::validating; - - bool MarlinSettings::size_error(const uint16_t size) { - if (size != datasize()) { - DEBUG_ERROR_MSG("EEPROM datasize error."); - return true; - } - return false; - } - - /** - * M500 - Store Configuration - */ - bool MarlinSettings::save() { - float dummy = 0; - char ver[4] = "ERR"; - - uint16_t working_crc = 0; - - EEPROM_START(); - - eeprom_error = false; - #if ENABLED(FLASH_EEPROM_EMULATION) - EEPROM_SKIP(ver); // Flash doesn't allow rewriting without erase - #else - EEPROM_WRITE(ver); // invalidate data first - #endif - EEPROM_SKIP(working_crc); // Skip the checksum slot - - working_crc = 0; // clear before first "real data" - - _FIELD_TEST(esteppers); - - const uint8_t esteppers = COUNT(planner.settings.axis_steps_per_mm) - XYZ; - EEPROM_WRITE(esteppers); - - // - // Planner Motion - // - { - EEPROM_WRITE(planner.settings); - - #if HAS_CLASSIC_JERK - EEPROM_WRITE(planner.max_jerk); - #if HAS_LINEAR_E_JERK - dummy = float(DEFAULT_EJERK); - EEPROM_WRITE(dummy); - #endif - #else - const xyze_pos_t planner_max_jerk = { 10, 10, 0.4, float(DEFAULT_EJERK) }; - EEPROM_WRITE(planner_max_jerk); - #endif - - #if DISABLED(CLASSIC_JERK) - EEPROM_WRITE(planner.junction_deviation_mm); - #else - dummy = 0.02f; - EEPROM_WRITE(dummy); - #endif - } - - // - // Home Offset - // - { - _FIELD_TEST(home_offset); - - #if HAS_SCARA_OFFSET - EEPROM_WRITE(scara_home_offset); - #else - #if !HAS_HOME_OFFSET - const xyz_pos_t home_offset{0}; - #endif - EEPROM_WRITE(home_offset); - #endif - - #if HAS_HOTEND_OFFSET - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - EEPROM_WRITE(hotend_offset[e]); - #endif - } - - // - // Filament Runout Sensor - // - { - #if HAS_FILAMENT_SENSOR - const bool &runout_sensor_enabled = runout.enabled; - #else - const bool runout_sensor_enabled = true; - #endif - #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) - const float &runout_distance_mm = runout.runout_distance(); - #else - const float runout_distance_mm = 0; - #endif - _FIELD_TEST(runout_sensor_enabled); - EEPROM_WRITE(runout_sensor_enabled); - EEPROM_WRITE(runout_distance_mm); - } - - // - // Global Leveling - // - { - const float zfh = ( - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.z_fade_height - #else - 10.0 - #endif - ); - EEPROM_WRITE(zfh); - } - - // - // Mesh Bed Leveling - // - { - #if ENABLED(MESH_BED_LEVELING) - // Compile time test that sizeof(mbl.z_values) is as expected - static_assert( - sizeof(mbl.z_values) == (GRID_MAX_POINTS) * sizeof(mbl.z_values[0][0]), - "MBL Z array is the wrong size." - ); - const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(mbl.z_offset); - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - EEPROM_WRITE(mbl.z_values); - #else // For disabled MBL write a default mesh - dummy = 0; - const uint8_t mesh_num_x = 3, mesh_num_y = 3; - EEPROM_WRITE(dummy); // z_offset - EEPROM_WRITE(mesh_num_x); - EEPROM_WRITE(mesh_num_y); - for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummy); - #endif - } - - // - // Probe XYZ Offsets - // - { - _FIELD_TEST(probe_offset); - EEPROM_WRITE(probe_offset); - } - - // - // Planar Bed Leveling matrix - // - { - #if ABL_PLANAR - EEPROM_WRITE(planner.bed_level_matrix); - #else - dummy = 0; - for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); - #endif - } - - // - // Bilinear Auto Bed Leveling - // - { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Compile time test that sizeof(z_values) is as expected - static_assert( - sizeof(z_values) == (GRID_MAX_POINTS) * sizeof(z_values[0][0]), - "Bilinear Z array is the wrong size." - ); - const uint8_t grid_max_x = GRID_MAX_POINTS_X, grid_max_y = GRID_MAX_POINTS_Y; - EEPROM_WRITE(grid_max_x); // 1 byte - EEPROM_WRITE(grid_max_y); // 1 byte - EEPROM_WRITE(bilinear_grid_spacing); // 2 ints - EEPROM_WRITE(bilinear_start); // 2 ints - EEPROM_WRITE(z_values); // 9-256 floats - #else - // For disabled Bilinear Grid write an empty 3x3 grid - const uint8_t grid_max_x = 3, grid_max_y = 3; - const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; - dummy = 0; - EEPROM_WRITE(grid_max_x); - EEPROM_WRITE(grid_max_y); - EEPROM_WRITE(bilinear_grid_spacing); - EEPROM_WRITE(bilinear_start); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummy); - #endif - } - - // - // Unified Bed Leveling - // - { - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_WRITE(planner.leveling_active); - EEPROM_WRITE(ubl.storage_slot); - #else - const bool ubl_active = false; - const int8_t storage_slot = -1; - EEPROM_WRITE(ubl_active); - EEPROM_WRITE(storage_slot); - #endif // AUTO_BED_LEVELING_UBL - } - - // - // Servo Angles - // - { - _FIELD_TEST(servo_angles); - - #if !HAS_SERVO_ANGLES - uint16_t servo_angles[EEPROM_NUM_SERVOS][2] = { { 0, 0 } }; - #endif - EEPROM_WRITE(servo_angles); - } - - // - // BLTOUCH - // - { - _FIELD_TEST(bltouch_last_written_mode); - #if ENABLED(BLTOUCH) - const bool &bltouch_last_written_mode = bltouch.last_written_mode; - #else - constexpr bool bltouch_last_written_mode = false; - #endif - EEPROM_WRITE(bltouch_last_written_mode); - } - - // - // DELTA Geometry or Dual Endstops offsets - // - { - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_WRITE(delta_height); // 1 float - EEPROM_WRITE(delta_endstop_adj); // 3 floats - EEPROM_WRITE(delta_radius); // 1 float - EEPROM_WRITE(delta_diagonal_rod); // 1 float - EEPROM_WRITE(delta_segments_per_second); // 1 float - EEPROM_WRITE(delta_tower_angle_trim); // 3 floats - - #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS - - _FIELD_TEST(x2_endstop_adj); - - // Write dual endstops in X, Y, Z order. Unused = 0.0 - dummy = 0; - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.x2_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_WRITE(endstops.y2_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if Z_MULTI_ENDSTOPS - EEPROM_WRITE(endstops.z2_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #if ENABLED(Z_TRIPLE_ENDSTOPS) - EEPROM_WRITE(endstops.z3_endstop_adj); // 1 float - #else - EEPROM_WRITE(dummy); - #endif - - #endif - } - - // - // LCD Preheat settings - // - { - _FIELD_TEST(ui_preheat_hotend_temp); - - #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; - #else - constexpr int16_t ui_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, - ui_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }; - constexpr uint8_t ui_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; - #endif - - EEPROM_WRITE(ui_preheat_hotend_temp); - EEPROM_WRITE(ui_preheat_bed_temp); - EEPROM_WRITE(ui_preheat_fan_speed); - } - - // - // PIDTEMP - // - { - _FIELD_TEST(hotendPID); - HOTEND_LOOP() { - PIDCF_t pidcf = { - PID_PARAM(Kp, e), - unscalePID_i(PID_PARAM(Ki, e)), - unscalePID_d(PID_PARAM(Kd, e)), - PID_PARAM(Kc, e), - PID_PARAM(Kf, e) - }; - EEPROM_WRITE(pidcf); - } - - _FIELD_TEST(lpq_len); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_WRITE(thermalManager.lpq_len); - #else - const int16_t lpq_len = 20; - EEPROM_WRITE(lpq_len); - #endif - } - - // - // PIDTEMPBED - // - { - _FIELD_TEST(bedPID); - - const PID_t bed_pid = { - #if DISABLED(PIDTEMPBED) - DUMMY_PID_VALUE, DUMMY_PID_VALUE, DUMMY_PID_VALUE - #else - // Store the unscaled PID values - thermalManager.temp_bed.pid.Kp, - unscalePID_i(thermalManager.temp_bed.pid.Ki), - unscalePID_d(thermalManager.temp_bed.pid.Kd) - #endif - }; - EEPROM_WRITE(bed_pid); - } - - // - // User-defined Thermistors - // - #if HAS_USER_THERMISTORS - { - _FIELD_TEST(user_thermistor); - EEPROM_WRITE(thermalManager.user_thermistor); - } - #endif - - // - // LCD Contrast - // - { - _FIELD_TEST(lcd_contrast); - - const int16_t lcd_contrast = - #if HAS_LCD_CONTRAST - ui.contrast - #elif defined(DEFAULT_LCD_CONTRAST) - DEFAULT_LCD_CONTRAST - #else - 127 - #endif - ; - EEPROM_WRITE(lcd_contrast); - } - - // - // Power-Loss Recovery - // - { - _FIELD_TEST(recovery_enabled); - - const bool recovery_enabled = - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.enabled - #else - true - #endif - ; - EEPROM_WRITE(recovery_enabled); - } - - // - // Firmware Retraction - // - { - _FIELD_TEST(fwretract_settings); - - #if ENABLED(FWRETRACT) - EEPROM_WRITE(fwretract.settings); - #else - const fwretract_settings_t autoretract_defaults = { 3, 45, 0, 0, 0, 13, 0, 8 }; - EEPROM_WRITE(autoretract_defaults); - #endif - #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - EEPROM_WRITE(fwretract.autoretract_enabled); - #else - const bool autoretract_enabled = false; - EEPROM_WRITE(autoretract_enabled); - #endif - } - - // - // Volumetric & Filament Size - // - { - _FIELD_TEST(parser_volumetric_enabled); - - #if DISABLED(NO_VOLUMETRICS) - - EEPROM_WRITE(parser.volumetric_enabled); - EEPROM_WRITE(planner.filament_size); - - #else - - const bool volumetric_enabled = false; - dummy = DEFAULT_NOMINAL_FILAMENT_DIA; - EEPROM_WRITE(volumetric_enabled); - for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummy); - - #endif - } - - // - // TMC Configuration - // - { - _FIELD_TEST(tmc_stepper_current); - - tmc_stepper_current_t tmc_stepper_current = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - #if HAS_TRINAMIC - #if AXIS_IS_TMC(X) - tmc_stepper_current.X = stepperX.getMilliamps(); - #endif - #if AXIS_IS_TMC(Y) - tmc_stepper_current.Y = stepperY.getMilliamps(); - #endif - #if AXIS_IS_TMC(Z) - tmc_stepper_current.Z = stepperZ.getMilliamps(); - #endif - #if AXIS_IS_TMC(X2) - tmc_stepper_current.X2 = stepperX2.getMilliamps(); - #endif - #if AXIS_IS_TMC(Y2) - tmc_stepper_current.Y2 = stepperY2.getMilliamps(); - #endif - #if AXIS_IS_TMC(Z2) - tmc_stepper_current.Z2 = stepperZ2.getMilliamps(); - #endif - #if AXIS_IS_TMC(Z3) - tmc_stepper_current.Z3 = stepperZ3.getMilliamps(); - #endif - #if MAX_EXTRUDERS - #if AXIS_IS_TMC(E0) - tmc_stepper_current.E0 = stepperE0.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_IS_TMC(E1) - tmc_stepper_current.E1 = stepperE1.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_IS_TMC(E2) - tmc_stepper_current.E2 = stepperE2.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_IS_TMC(E3) - tmc_stepper_current.E3 = stepperE3.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_IS_TMC(E4) - tmc_stepper_current.E4 = stepperE4.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_IS_TMC(E5) - tmc_stepper_current.E5 = stepperE5.getMilliamps(); - #endif - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS - #endif - EEPROM_WRITE(tmc_stepper_current); - } - - // - // TMC Hybrid Threshold, and placeholder values - // - { - _FIELD_TEST(tmc_hybrid_threshold); - - #if ENABLED(HYBRID_THRESHOLD) - tmc_hybrid_threshold_t tmc_hybrid_threshold = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - #if AXIS_HAS_STEALTHCHOP(X) - tmc_hybrid_threshold.X = stepperX.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - tmc_hybrid_threshold.X2 = stepperX2.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - tmc_hybrid_threshold.Y2 = stepperY2.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - tmc_hybrid_threshold.Z2 = stepperZ2.get_pwm_thrs(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - tmc_hybrid_threshold.Z3 = stepperZ3.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS - #if AXIS_HAS_STEALTHCHOP(E0) - tmc_hybrid_threshold.E0 = stepperE0.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_HAS_STEALTHCHOP(E1) - tmc_hybrid_threshold.E1 = stepperE1.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_HAS_STEALTHCHOP(E2) - tmc_hybrid_threshold.E2 = stepperE2.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_HAS_STEALTHCHOP(E3) - tmc_hybrid_threshold.E3 = stepperE3.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_HAS_STEALTHCHOP(E4) - tmc_hybrid_threshold.E4 = stepperE4.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_HAS_STEALTHCHOP(E5) - tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs(); - #endif - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS - #else - const tmc_hybrid_threshold_t tmc_hybrid_threshold = { - .X = 100, .Y = 100, .Z = 3, - .X2 = 100, .Y2 = 100, .Z2 = 3, .Z3 = 3, - .E0 = 30, .E1 = 30, .E2 = 30, - .E3 = 30, .E4 = 30, .E5 = 30 - }; - #endif - EEPROM_WRITE(tmc_hybrid_threshold); - } - - // - // TMC StallGuard threshold - // - { - 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 - #if Z_SENSORLESS - tmc_sgt.Z = stepperZ.homing_threshold(); - #endif - #endif - EEPROM_WRITE(tmc_sgt); - } - - // - // TMC stepping mode - // - { - _FIELD_TEST(tmc_stealth_enabled); - - tmc_stealth_enabled_t tmc_stealth_enabled = { false, false, false, false, false, false, false, false, false, false, false, false, false }; - - #if HAS_STEALTHCHOP - #if AXIS_HAS_STEALTHCHOP(X) - tmc_stealth_enabled.X = stepperX.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - tmc_stealth_enabled.Y = stepperY.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - tmc_stealth_enabled.Z = stepperZ.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - tmc_stealth_enabled.X2 = stepperX2.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - tmc_stealth_enabled.Y2 = stepperY2.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - tmc_stealth_enabled.Z2 = stepperZ2.get_stealthChop_status(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - tmc_stealth_enabled.Z3 = stepperZ3.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS - #if AXIS_HAS_STEALTHCHOP(E0) - tmc_stealth_enabled.E0 = stepperE0.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_HAS_STEALTHCHOP(E1) - tmc_stealth_enabled.E1 = stepperE1.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_HAS_STEALTHCHOP(E2) - tmc_stealth_enabled.E2 = stepperE2.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_HAS_STEALTHCHOP(E3) - tmc_stealth_enabled.E3 = stepperE3.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_HAS_STEALTHCHOP(E4) - tmc_stealth_enabled.E4 = stepperE4.get_stealthChop_status(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_HAS_STEALTHCHOP(E5) - tmc_stealth_enabled.E5 = stepperE5.get_stealthChop_status(); - #endif - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS - #endif - EEPROM_WRITE(tmc_stealth_enabled); - } - - // - // Linear Advance - // - { - _FIELD_TEST(planner_extruder_advance_K); - - #if ENABLED(LIN_ADVANCE) - EEPROM_WRITE(planner.extruder_advance_K); - #else - dummy = 0; - for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummy); - #endif - } - - // - // Motor Current PWM - // - { - _FIELD_TEST(motor_current_setting); - - #if HAS_MOTOR_CURRENT_PWM - EEPROM_WRITE(stepper.motor_current_setting); - #else - const xyz_ulong_t no_current{0}; - EEPROM_WRITE(no_current); - #endif - } - - // - // CNC Coordinate Systems - // - - _FIELD_TEST(coordinate_system); - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - EEPROM_WRITE(gcode.coordinate_system); - #else - const xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS] = { { 0 } }; - EEPROM_WRITE(coordinate_system); - #endif - - // - // Skew correction factors - // - _FIELD_TEST(planner_skew_factor); - EEPROM_WRITE(planner.skew_factor); - - // - // Advanced Pause filament load & unload lengths - // - #if EXTRUDERS - { - #if DISABLED(ADVANCED_PAUSE_FEATURE) - const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 }; - #endif - _FIELD_TEST(fc_settings); - EEPROM_WRITE(fc_settings); - } - #endif - - // - // Multiple Extruders - // - - #if EXTRUDERS > 1 - _FIELD_TEST(toolchange_settings); - EEPROM_WRITE(toolchange_settings); - #endif - - // - // Backlash Compensation - // - { - #if ENABLED(BACKLASH_GCODE) - const xyz_float_t &backlash_distance_mm = backlash.distance_mm; - const uint8_t &backlash_correction = backlash.correction; - #else - const xyz_float_t backlash_distance_mm{0}; - const uint8_t backlash_correction = 0; - #endif - #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); - EEPROM_WRITE(backlash_correction); - EEPROM_WRITE(backlash_smoothing_mm); - } - - // - // Extensible UI User Data - // - #if ENABLED(EXTENSIBLE_UI) - { - char extui_data[ExtUI::eeprom_data_size] = { 0 }; - ExtUI::onStoreSettings(extui_data); - _FIELD_TEST(extui_data); - EEPROM_WRITE(extui_data); - } - #endif - - // - // Validate CRC and Data Size - // - if (!eeprom_error) { - const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET), - final_crc = working_crc; - - // Write the EEPROM header - eeprom_index = EEPROM_OFFSET; - - EEPROM_WRITE(version); - EEPROM_WRITE(final_crc); - - // Report storage size - DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("Settings Stored (", eeprom_size, " bytes; crc ", (uint32_t)final_crc, ")"); - - eeprom_error |= size_error(eeprom_size); - } - EEPROM_FINISH(); - - // - // UBL Mesh - // - #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) - if (ubl.storage_slot >= 0) - store_mesh(ubl.storage_slot); - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreWritten(!eeprom_error); - #endif - - return !eeprom_error; - } - - /** - * M501 - Retrieve Configuration - */ - bool MarlinSettings::_load() { - uint16_t working_crc = 0; - - EEPROM_START(); - - char stored_ver[4]; - EEPROM_READ_ALWAYS(stored_ver); - - uint16_t stored_crc; - EEPROM_READ_ALWAYS(stored_crc); - - // Version has to match or defaults are used - if (strncmp(version, stored_ver, 3) != 0) { - if (stored_ver[3] != '\0') { - stored_ver[0] = '?'; - stored_ver[1] = '\0'; - } - DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); - eeprom_error = true; - } - else { - float dummy = 0; - working_crc = 0; // Init to 0. Accumulated by EEPROM_READ - - _FIELD_TEST(esteppers); - - // Number of esteppers may change - uint8_t esteppers; - EEPROM_READ_ALWAYS(esteppers); - - // - // Planner Motion - // - { - // Get only the number of E stepper parameters previously stored - // Any steppers added later are set to their defaults - 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); - 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] : 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); - EEPROM_READ(planner.settings.retract_acceleration); - EEPROM_READ(planner.settings.travel_acceleration); - EEPROM_READ(planner.settings.min_feedrate_mm_s); - EEPROM_READ(planner.settings.min_travel_feedrate_mm_s); - - #if HAS_CLASSIC_JERK - EEPROM_READ(planner.max_jerk); - #if HAS_LINEAR_E_JERK - EEPROM_READ(dummy); - #endif - #else - for (uint8_t q = 4; q--;) EEPROM_READ(dummy); - #endif - - #if DISABLED(CLASSIC_JERK) - EEPROM_READ(planner.junction_deviation_mm); - #else - EEPROM_READ(dummy); - #endif - } - - // - // Home Offset (M206 / M665) - // - { - _FIELD_TEST(home_offset); - - #if HAS_SCARA_OFFSET - EEPROM_READ(scara_home_offset); - #else - #if !HAS_HOME_OFFSET - xyz_pos_t home_offset; - #endif - EEPROM_READ(home_offset); - #endif - } - - // - // Hotend Offsets, if any - // - { - #if HAS_HOTEND_OFFSET - // Skip hotend 0 which must be 0 - for (uint8_t e = 1; e < HOTENDS; e++) - EEPROM_READ(hotend_offset[e]); - #endif - } - - // - // Filament Runout Sensor - // - { - #if HAS_FILAMENT_SENSOR - bool &runout_sensor_enabled = runout.enabled; - #else - bool runout_sensor_enabled; - #endif - _FIELD_TEST(runout_sensor_enabled); - EEPROM_READ(runout_sensor_enabled); - - float runout_distance_mm; - EEPROM_READ(runout_distance_mm); - #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) - if (!validating) runout.set_runout_distance(runout_distance_mm); - #endif - } - - // - // Global Leveling - // - { - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - EEPROM_READ(new_z_fade_height); - #else - EEPROM_READ(dummy); - #endif - } - - // - // Mesh (Manual) Bed Leveling - // - { - uint8_t mesh_num_x, mesh_num_y; - EEPROM_READ(dummy); - EEPROM_READ_ALWAYS(mesh_num_x); - EEPROM_READ_ALWAYS(mesh_num_y); - - #if ENABLED(MESH_BED_LEVELING) - if (!validating) mbl.z_offset = dummy; - if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) { - // EEPROM data fits the current mesh - EEPROM_READ(mbl.z_values); - } - else { - // EEPROM data is stale - if (!validating) mbl.reset(); - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - } - #else - // MBL is disabled - skip the stored data - for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy); - #endif // MESH_BED_LEVELING - } - - // - // Probe Z Offset - // - { - _FIELD_TEST(probe_offset); - #if HAS_BED_PROBE - xyz_pos_t &zpo = probe_offset; - #else - xyz_pos_t zpo; - #endif - EEPROM_READ(zpo); - } - - // - // Planar Bed Leveling matrix - // - { - #if ABL_PLANAR - EEPROM_READ(planner.bed_level_matrix); - #else - for (uint8_t q = 9; q--;) EEPROM_READ(dummy); - #endif - } - - // - // Bilinear Auto Bed Leveling - // - { - uint8_t grid_max_x, grid_max_y; - EEPROM_READ_ALWAYS(grid_max_x); // 1 byte - EEPROM_READ_ALWAYS(grid_max_y); // 1 byte - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) { - if (!validating) set_bed_leveling_enabled(false); - EEPROM_READ(bilinear_grid_spacing); // 2 ints - EEPROM_READ(bilinear_start); // 2 ints - EEPROM_READ(z_values); // 9 to 256 floats - } - else // EEPROM data is stale - #endif // AUTO_BED_LEVELING_BILINEAR - { - // Skip past disabled (or stale) Bilinear Grid data - xy_pos_t bgs, bs; - EEPROM_READ(bgs); - EEPROM_READ(bs); - for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy); - } - } - - // - // Unified Bed Leveling active state - // - { - _FIELD_TEST(planner_leveling_active); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - EEPROM_READ(planner.leveling_active); - EEPROM_READ(ubl.storage_slot); - #else - bool planner_leveling_active; - uint8_t ubl_storage_slot; - EEPROM_READ(planner_leveling_active); - EEPROM_READ(ubl_storage_slot); - #endif - } - - // - // SERVO_ANGLES - // - { - _FIELD_TEST(servo_angles); - - #if ENABLED(EDITABLE_SERVO_ANGLES) - uint16_t (&servo_angles_arr)[EEPROM_NUM_SERVOS][2] = servo_angles; - #else - uint16_t servo_angles_arr[EEPROM_NUM_SERVOS][2]; - #endif - EEPROM_READ(servo_angles_arr); - } - - // - // BLTOUCH - // - { - _FIELD_TEST(bltouch_last_written_mode); - #if ENABLED(BLTOUCH) - bool &bltouch_last_written_mode = bltouch.last_written_mode; - #else - bool bltouch_last_written_mode; - #endif - EEPROM_READ(bltouch_last_written_mode); - } - - // - // DELTA Geometry or Dual Endstops offsets - // - { - #if ENABLED(DELTA) - - _FIELD_TEST(delta_height); - - EEPROM_READ(delta_height); // 1 float - EEPROM_READ(delta_endstop_adj); // 3 floats - EEPROM_READ(delta_radius); // 1 float - EEPROM_READ(delta_diagonal_rod); // 1 float - EEPROM_READ(delta_segments_per_second); // 1 float - EEPROM_READ(delta_tower_angle_trim); // 3 floats - - #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS - - _FIELD_TEST(x2_endstop_adj); - - #if ENABLED(X_DUAL_ENDSTOPS) - EEPROM_READ(endstops.x2_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - EEPROM_READ(endstops.y2_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if Z_MULTI_ENDSTOPS - EEPROM_READ(endstops.z2_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - EEPROM_READ(endstops.z3_endstop_adj); // 1 float - #else - EEPROM_READ(dummy); - #endif - - #endif - } - - // - // LCD Preheat settings - // - { - _FIELD_TEST(ui_preheat_hotend_temp); - - #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; - #else - int16_t ui_preheat_hotend_temp[2], ui_preheat_bed_temp[2]; - uint8_t ui_preheat_fan_speed[2]; - #endif - EEPROM_READ(ui_preheat_hotend_temp); // 2 floats - EEPROM_READ(ui_preheat_bed_temp); // 2 floats - EEPROM_READ(ui_preheat_fan_speed); // 2 floats - } - - // - // Hotend PID - // - { - HOTEND_LOOP() { - PIDCF_t pidcf; - EEPROM_READ(pidcf); - #if ENABLED(PIDTEMP) - if (!validating && pidcf.Kp != DUMMY_PID_VALUE) { - // Scale PID values since EEPROM values are unscaled - PID_PARAM(Kp, e) = pidcf.Kp; - PID_PARAM(Ki, e) = scalePID_i(pidcf.Ki); - PID_PARAM(Kd, e) = scalePID_d(pidcf.Kd); - #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = pidcf.Kc; - #endif - #if ENABLED(PID_FAN_SCALING) - PID_PARAM(Kf, e) = pidcf.Kf; - #endif - } - #endif - } - } - - // - // PID Extrusion Scaling - // - { - _FIELD_TEST(lpq_len); - #if ENABLED(PID_EXTRUSION_SCALING) - EEPROM_READ(thermalManager.lpq_len); - #else - int16_t lpq_len; - EEPROM_READ(lpq_len); - #endif - } - - // - // Heated Bed PID - // - { - PID_t pid; - EEPROM_READ(pid); - #if ENABLED(PIDTEMPBED) - if (!validating && pid.Kp != DUMMY_PID_VALUE) { - // Scale PID values since EEPROM values are unscaled - thermalManager.temp_bed.pid.Kp = pid.Kp; - thermalManager.temp_bed.pid.Ki = scalePID_i(pid.Ki); - thermalManager.temp_bed.pid.Kd = scalePID_d(pid.Kd); - } - #endif - } - - // - // User-defined Thermistors - // - #if HAS_USER_THERMISTORS - { - _FIELD_TEST(user_thermistor); - EEPROM_READ(thermalManager.user_thermistor); - } - #endif - - // - // LCD Contrast - // - { - _FIELD_TEST(lcd_contrast); - - int16_t lcd_contrast; - EEPROM_READ(lcd_contrast); - #if HAS_LCD_CONTRAST - ui.set_contrast(lcd_contrast); - #endif - } - - // - // Power-Loss Recovery - // - { - _FIELD_TEST(recovery_enabled); - - #if ENABLED(POWER_LOSS_RECOVERY) - EEPROM_READ(recovery.enabled); - #else - bool recovery_enabled; - EEPROM_READ(recovery_enabled); - #endif - } - - // - // Firmware Retraction - // - { - _FIELD_TEST(fwretract_settings); - - #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.settings); - #else - fwretract_settings_t fwretract_settings; - EEPROM_READ(fwretract_settings); - #endif - #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - #else - bool autoretract_enabled; - EEPROM_READ(autoretract_enabled); - #endif - } - - // - // Volumetric & Filament Size - // - { - struct { - bool volumetric_enabled; - float filament_size[EXTRUDERS]; - } storage; - - _FIELD_TEST(parser_volumetric_enabled); - EEPROM_READ(storage); - - #if DISABLED(NO_VOLUMETRICS) - if (!validating) { - parser.volumetric_enabled = storage.volumetric_enabled; - COPY(planner.filament_size, storage.filament_size); - } - #endif - } - - // - // TMC Stepper Settings - // - - if (!validating) reset_stepper_drivers(); - - // TMC Stepper Current - { - _FIELD_TEST(tmc_stepper_current); - - tmc_stepper_current_t currents; - EEPROM_READ(currents); - - #if HAS_TRINAMIC - - #define SET_CURR(Q) stepper##Q.rms_current(currents.Q ? currents.Q : Q##_CURRENT) - if (!validating) { - #if AXIS_IS_TMC(X) - SET_CURR(X); - #endif - #if AXIS_IS_TMC(Y) - SET_CURR(Y); - #endif - #if AXIS_IS_TMC(Z) - SET_CURR(Z); - #endif - #if AXIS_IS_TMC(X2) - SET_CURR(X2); - #endif - #if AXIS_IS_TMC(Y2) - SET_CURR(Y2); - #endif - #if AXIS_IS_TMC(Z2) - SET_CURR(Z2); - #endif - #if AXIS_IS_TMC(Z3) - SET_CURR(Z3); - #endif - #if AXIS_IS_TMC(E0) - SET_CURR(E0); - #endif - #if AXIS_IS_TMC(E1) - SET_CURR(E1); - #endif - #if AXIS_IS_TMC(E2) - SET_CURR(E2); - #endif - #if AXIS_IS_TMC(E3) - SET_CURR(E3); - #endif - #if AXIS_IS_TMC(E4) - SET_CURR(E4); - #endif - #if AXIS_IS_TMC(E5) - SET_CURR(E5); - #endif - } - #endif - } - - // TMC Hybrid Threshold - { - tmc_hybrid_threshold_t tmc_hybrid_threshold; - _FIELD_TEST(tmc_hybrid_threshold); - EEPROM_READ(tmc_hybrid_threshold); - - #if ENABLED(HYBRID_THRESHOLD) - if (!validating) { - #if AXIS_HAS_STEALTHCHOP(X) - stepperX.set_pwm_thrs(tmc_hybrid_threshold.X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - stepperY.set_pwm_thrs(tmc_hybrid_threshold.Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - stepperZ.set_pwm_thrs(tmc_hybrid_threshold.Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - stepperX2.set_pwm_thrs(tmc_hybrid_threshold.X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - stepperY2.set_pwm_thrs(tmc_hybrid_threshold.Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - stepperZ2.set_pwm_thrs(tmc_hybrid_threshold.Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - stepperZ3.set_pwm_thrs(tmc_hybrid_threshold.Z3); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - stepperE0.set_pwm_thrs(tmc_hybrid_threshold.E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - stepperE1.set_pwm_thrs(tmc_hybrid_threshold.E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - stepperE2.set_pwm_thrs(tmc_hybrid_threshold.E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - stepperE3.set_pwm_thrs(tmc_hybrid_threshold.E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - stepperE4.set_pwm_thrs(tmc_hybrid_threshold.E4); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - stepperE5.set_pwm_thrs(tmc_hybrid_threshold.E5); - #endif - } - #endif - } - - // - // TMC StallGuard threshold. - // X and X2 use the same value - // Y and Y2 use the same value - // Z, Z2 and Z3 use the same value - // - { - tmc_sgt_t tmc_sgt; - _FIELD_TEST(tmc_sgt); - EEPROM_READ(tmc_sgt); - #if USE_SENSORLESS - if (!validating) { - #ifdef X_STALL_SENSITIVITY - #if AXIS_HAS_STALLGUARD(X) - stepperX.homing_threshold(tmc_sgt.X); - #endif - #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); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.homing_threshold(tmc_sgt.Y); - #endif - #endif - #ifdef Z_STALL_SENSITIVITY - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.homing_threshold(tmc_sgt.Z); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.homing_threshold(tmc_sgt.Z); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - stepperZ3.homing_threshold(tmc_sgt.Z); - #endif - #endif - } - #endif - } - - // TMC stepping mode - { - _FIELD_TEST(tmc_stealth_enabled); - - tmc_stealth_enabled_t tmc_stealth_enabled; - EEPROM_READ(tmc_stealth_enabled); - - #if HAS_TRINAMIC - - #define SET_STEPPING_MODE(ST) stepper##ST.stored.stealthChop_enabled = tmc_stealth_enabled.ST; stepper##ST.refresh_stepping_mode(); - if (!validating) { - #if AXIS_HAS_STEALTHCHOP(X) - SET_STEPPING_MODE(X); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - SET_STEPPING_MODE(Y); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - SET_STEPPING_MODE(Z); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - SET_STEPPING_MODE(X2); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - SET_STEPPING_MODE(Y2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - SET_STEPPING_MODE(Z2); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - SET_STEPPING_MODE(Z3); - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - SET_STEPPING_MODE(E0); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - SET_STEPPING_MODE(E1); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - SET_STEPPING_MODE(E2); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - SET_STEPPING_MODE(E3); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - SET_STEPPING_MODE(E4); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - SET_STEPPING_MODE(E5); - #endif - } - #endif - } - - // - // Linear Advance - // - { - float extruder_advance_K[EXTRUDERS]; - _FIELD_TEST(planner_extruder_advance_K); - EEPROM_READ(extruder_advance_K); - #if ENABLED(LIN_ADVANCE) - if (!validating) - COPY(planner.extruder_advance_K, extruder_advance_K); - #endif - } - - // - // Motor Current PWM - // - { - uint32_t motor_current_setting[3]; - _FIELD_TEST(motor_current_setting); - EEPROM_READ(motor_current_setting); - #if HAS_MOTOR_CURRENT_PWM - if (!validating) - COPY(stepper.motor_current_setting, motor_current_setting); - #endif - } - - // - // CNC Coordinate System - // - { - _FIELD_TEST(coordinate_system); - #if ENABLED(CNC_COORDINATE_SYSTEMS) - if (!validating) (void)gcode.select_coordinate_system(-1); // Go back to machine space - EEPROM_READ(gcode.coordinate_system); - #else - xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; - EEPROM_READ(coordinate_system); - #endif - } - - // - // Skew correction factors - // - { - skew_factor_t skew_factor; - _FIELD_TEST(planner_skew_factor); - EEPROM_READ(skew_factor); - #if ENABLED(SKEW_CORRECTION_GCODE) - if (!validating) { - planner.skew_factor.xy = skew_factor.xy; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - planner.skew_factor.xz = skew_factor.xz; - planner.skew_factor.yz = skew_factor.yz; - #endif - } - #endif - } - - // - // Advanced Pause filament load & unload lengths - // - #if EXTRUDERS - { - #if DISABLED(ADVANCED_PAUSE_FEATURE) - fil_change_settings_t fc_settings[EXTRUDERS]; - #endif - _FIELD_TEST(fc_settings); - EEPROM_READ(fc_settings); - } - #endif - - // - // Tool-change settings - // - #if EXTRUDERS > 1 - _FIELD_TEST(toolchange_settings); - EEPROM_READ(toolchange_settings); - #endif - - // - // Backlash Compensation - // - { - #if ENABLED(BACKLASH_GCODE) - xyz_float_t &backlash_distance_mm = backlash.distance_mm; - uint8_t &backlash_correction = backlash.correction; - #else - float backlash_distance_mm[XYZ]; - uint8_t backlash_correction; - #endif - #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); - EEPROM_READ(backlash_correction); - EEPROM_READ(backlash_smoothing_mm); - } - - // - // Extensible UI User Data - // - #if ENABLED(EXTENSIBLE_UI) - // This is a significant hardware change; don't reserve EEPROM space when not present - { - const char extui_data[ExtUI::eeprom_data_size] = { 0 }; - _FIELD_TEST(extui_data); - EEPROM_READ(extui_data); - if (!validating) ExtUI::onLoadSettings(extui_data); - } - #endif - - eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); - if (eeprom_error) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize()); - } - else if (working_crc != stored_crc) { - eeprom_error = true; - DEBUG_ERROR_START(); - DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); - } - else if (!validating) { - DEBUG_ECHO_START(); - DEBUG_ECHO(version); - DEBUG_ECHOLNPAIR(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET), " bytes; crc ", (uint32_t)working_crc, ")"); - } - - if (!validating && !eeprom_error) postprocess(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (!validating) { - ubl.report_state(); - - if (!ubl.sanity_check()) { - SERIAL_EOL(); - #if ENABLED(EEPROM_CHITCHAT) - ubl.echo_name(); - DEBUG_ECHOLNPGM(" initialized.\n"); - #endif - } - else { - eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - DEBUG_ECHOPGM("?Can't enable "); - ubl.echo_name(); - DEBUG_ECHOLNPGM("."); - #endif - ubl.reset(); - } - - if (ubl.storage_slot >= 0) { - load_mesh(ubl.storage_slot); - DEBUG_ECHOLNPAIR("Mesh ", ubl.storage_slot, " loaded from storage."); - } - else { - ubl.reset(); - DEBUG_ECHOLNPGM("UBL reset"); - } - } - #endif - } - - #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) - if (!validating) report(); - #endif - EEPROM_FINISH(); - - return !eeprom_error; - } - - #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - extern bool restoreEEPROM(); - #endif - - bool MarlinSettings::validate() { - validating = true; - #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - bool success = _load(); - if (!success && restoreEEPROM()) { - SERIAL_ECHOLNPGM("Recovered backup EEPROM settings from SPI Flash"); - success = _load(); - } - #else - const bool success = _load(); - #endif - validating = false; - return success; - } - - bool MarlinSettings::load() { - if (validate()) { - const bool success = _load(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreRead(success); - #endif - return success; - } - reset(); - #if ENABLED(EEPROM_AUTO_INIT) - (void)save(); - SERIAL_ECHO_MSG("EEPROM Initialized"); - #endif - return false; - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - inline void ubl_invalid_slot(const int s) { - #if ENABLED(EEPROM_CHITCHAT) - DEBUG_ECHOLNPGM("?Invalid slot."); - DEBUG_ECHO(s); - DEBUG_ECHOLNPGM(" mesh slots available."); - #else - UNUSED(s); - #endif - } - - const uint16_t MarlinSettings::meshes_end = persistentStore.capacity() - 129; // 128 (+1 because of the change to capacity rather than last valid address) - // is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom - - uint16_t MarlinSettings::meshes_start_index() { - return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up - // or down a little bit without disrupting the mesh data - } - - uint16_t MarlinSettings::calc_num_meshes() { - return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values); - } - - int MarlinSettings::mesh_slot_offset(const int8_t slot) { - return meshes_end - (slot + 1) * sizeof(ubl.z_values); - } - - void MarlinSettings::store_mesh(const int8_t slot) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - const int16_t a = calc_num_meshes(); - if (!WITHIN(slot, 0, a - 1)) { - ubl_invalid_slot(a); - DEBUG_ECHOLNPAIR("E2END=", persistentStore.capacity() - 1, " meshes_end=", meshes_end, " slot=", slot); - DEBUG_EOL(); - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - - // Write crc to MAT along with other data, or just tack on to the beginning or end - persistentStore.access_start(); - const bool status = persistentStore.write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); - persistentStore.access_finish(); - - if (status) SERIAL_ECHOLNPGM("?Unable to save mesh data."); - else DEBUG_ECHOLNPAIR("Mesh saved in slot ", slot); - - #else - - // Other mesh types - - #endif - } - - void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=nullptr*/) { - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - const int16_t a = settings.calc_num_meshes(); - - if (!WITHIN(slot, 0, a - 1)) { - ubl_invalid_slot(a); - return; - } - - int pos = mesh_slot_offset(slot); - uint16_t crc = 0; - uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; - - persistentStore.access_start(); - const uint16_t status = persistentStore.read_data(pos, dest, sizeof(ubl.z_values), &crc); - persistentStore.access_finish(); - - if (status) SERIAL_ECHOLNPGM("?Unable to load mesh data."); - else DEBUG_ECHOLNPAIR("Mesh loaded from slot ", slot); - - EEPROM_FINISH(); - - #else - - // Other mesh types - - #endif - } - - //void MarlinSettings::delete_mesh() { return; } - //void MarlinSettings::defrag_meshes() { return; } - - #endif // AUTO_BED_LEVELING_UBL - -#else // !EEPROM_SETTINGS - - bool MarlinSettings::save() { - DEBUG_ERROR_MSG("EEPROM disabled"); - return false; - } - -#endif // !EEPROM_SETTINGS - -/** - * M502 - Reset Configuration - */ -void MarlinSettings::reset() { - LOOP_XYZE_N(i) { - 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 = feedRate_t(DEFAULT_MINIMUMFEEDRATE); - planner.settings.min_travel_feedrate_mm_s = feedRate_t(DEFAULT_MINTRAVELFEEDRATE); - - #if HAS_CLASSIC_JERK - #ifndef DEFAULT_XJERK - #define DEFAULT_XJERK 0 - #endif - #ifndef DEFAULT_YJERK - #define DEFAULT_YJERK 0 - #endif - #ifndef DEFAULT_ZJERK - #define DEFAULT_ZJERK 0 - #endif - planner.max_jerk.set(DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK); - #if HAS_CLASSIC_E_JERK - planner.max_jerk.e = DEFAULT_EJERK; - #endif - #endif - - #if DISABLED(CLASSIC_JERK) - planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); - #endif - - #if HAS_SCARA_OFFSET - scara_home_offset.reset(); - #elif HAS_HOME_OFFSET - home_offset.reset(); - #endif - - #if HAS_HOTEND_OFFSET - reset_hotend_offsets(); - #endif - - // - // Filament Runout Sensor - // - - #if HAS_FILAMENT_SENSOR - runout.enabled = true; - runout.reset(); - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - runout.set_runout_distance(FILAMENT_RUNOUT_DISTANCE_MM); - #endif - #endif - - // - // Tool-change Settings - // - - #if EXTRUDERS > 1 - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - toolchange_settings.swap_length = TOOLCHANGE_FIL_SWAP_LENGTH; - toolchange_settings.extra_prime = TOOLCHANGE_FIL_EXTRA_PRIME; - toolchange_settings.prime_speed = TOOLCHANGE_FIL_SWAP_PRIME_SPEED; - toolchange_settings.retract_speed = TOOLCHANGE_FIL_SWAP_RETRACT_SPEED; - #endif - #if ENABLED(TOOLCHANGE_PARK) - constexpr xyz_pos_t tpxy = TOOLCHANGE_PARK_XY; - toolchange_settings.change_point = tpxy; - #endif - toolchange_settings.z_raise = TOOLCHANGE_ZRAISE; - #endif - - #if ENABLED(BACKLASH_GCODE) - backlash.correction = (BACKLASH_CORRECTION) * 255; - constexpr xyz_float_t tmp = BACKLASH_DISTANCE_MM; - backlash.distance_mm = tmp; - #ifdef BACKLASH_SMOOTHING_MM - backlash.smoothing_mm = BACKLASH_SMOOTHING_MM; - #endif - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFactoryReset(); - #endif - - // - // Magnetic Parking Extruder - // - - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - mpe_settings_init(); - #endif - - // - // Global Leveling - // - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - new_z_fade_height = 0.0; - #endif - - #if HAS_LEVELING - reset_bed_level(); - #endif - - #if HAS_BED_PROBE - 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 - - // - // Servo Angles - // - - #if ENABLED(EDITABLE_SERVO_ANGLES) - COPY(servo_angles, base_servo_angles); - #endif - - // - // BLTOUCH - // - //#if ENABLED(BLTOUCH) - // bltouch.last_written_mode; - //#endif - - // - // Endstop Adjustments - // - - #if ENABLED(DELTA) - const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM; - delta_height = DELTA_HEIGHT; - delta_endstop_adj = adj; - delta_radius = DELTA_RADIUS; - delta_diagonal_rod = DELTA_DIAGONAL_ROD; - delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - delta_tower_angle_trim = dta; - - #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS - - #if ENABLED(X_DUAL_ENDSTOPS) - endstops.x2_endstop_adj = ( - #ifdef X_DUAL_ENDSTOPS_ADJUSTMENT - X_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - endstops.y2_endstop_adj = ( - #ifdef Y_DUAL_ENDSTOPS_ADJUSTMENT - Y_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - endstops.z2_endstop_adj = ( - #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT - Z_DUAL_ENDSTOPS_ADJUSTMENT - #else - 0 - #endif - ); - #elif ENABLED(Z_TRIPLE_ENDSTOPS) - endstops.z2_endstop_adj = ( - #ifdef Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 - Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 - #else - 0 - #endif - ); - endstops.z3_endstop_adj = ( - #ifdef Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 - Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 - #else - 0 - #endif - ); - #endif - - #endif - - // - // Preheat parameters - // - - #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; - ui.preheat_bed_temp[1] = PREHEAT_2_TEMP_BED; - ui.preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED; - ui.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED; - #endif - - // - // Hotend PID - // - - #if ENABLED(PIDTEMP) - HOTEND_LOOP() { - PID_PARAM(Kp, e) = float(DEFAULT_Kp); - PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki); - PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd); - #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = DEFAULT_Kc; - #endif - - #if ENABLED(PID_FAN_SCALING) - PID_PARAM(Kf, e) = DEFAULT_Kf; - #endif - } - #endif - - // - // PID Extrusion Scaling - // - - #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // Default last-position-queue size - #endif - - // - // Heated Bed PID - // - - #if ENABLED(PIDTEMPBED) - thermalManager.temp_bed.pid.Kp = DEFAULT_bedKp; - thermalManager.temp_bed.pid.Ki = scalePID_i(DEFAULT_bedKi); - thermalManager.temp_bed.pid.Kd = scalePID_d(DEFAULT_bedKd); - #endif - - // - // User-Defined Thermistors - // - - #if HAS_USER_THERMISTORS - thermalManager.reset_user_thermistors(); - #endif - - // - // LCD Contrast - // - - #if HAS_LCD_CONTRAST - ui.set_contrast(DEFAULT_LCD_CONTRAST); - #endif - - // - // Power-Loss Recovery - // - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.enable(true); - #endif - - // - // Firmware Retraction - // - - #if ENABLED(FWRETRACT) - fwretract.reset(); - #endif - - // - // Volumetric & Filament Size - // - - #if DISABLED(NO_VOLUMETRICS) - - parser.volumetric_enabled = - #if ENABLED(VOLUMETRIC_DEFAULT_ON) - true - #else - false - #endif - ; - for (uint8_t q = 0; q < COUNT(planner.filament_size); q++) - planner.filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; - - #endif - - endstops.enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - - reset_stepper_drivers(); - - // - // Linear Advance - // - - #if ENABLED(LIN_ADVANCE) - LOOP_L_N(i, EXTRUDERS) { - planner.extruder_advance_K[i] = LIN_ADVANCE_K; - #if ENABLED(EXTRA_LIN_ADVANCE_K) - saved_extruder_advance_K[i] = LIN_ADVANCE_K; - #endif - } - #endif - - // - // Motor Current PWM - // - - #if HAS_MOTOR_CURRENT_PWM - constexpr uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT; - for (uint8_t q = 3; q--;) - stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); - #endif - - // - // CNC Coordinate System - // - - #if ENABLED(CNC_COORDINATE_SYSTEMS) - (void)gcode.select_coordinate_system(-1); // Go back to machine space - #endif - - // - // Skew Correction - // - - #if ENABLED(SKEW_CORRECTION_GCODE) - planner.skew_factor.xy = XY_SKEW_FACTOR; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - planner.skew_factor.xz = XZ_SKEW_FACTOR; - planner.skew_factor.yz = YZ_SKEW_FACTOR; - #endif - #endif - - // - // Advanced Pause filament load & unload lengths - // - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; - fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH; - } - #endif - - postprocess(); - - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("Hardcoded Default Settings Loaded"); - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFactoryReset(); - #endif -} - -#if DISABLED(DISABLE_M503) - - #define CONFIG_ECHO_START() do{ if (!forReplay) SERIAL_ECHO_START(); }while(0) - #define CONFIG_ECHO_MSG(STR) do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0) - #define CONFIG_ECHO_HEADING(STR) do{ if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); } }while(0) - - #if HAS_TRINAMIC - inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M906"); } - #if HAS_STEALTHCHOP - 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); - } - if (newLine) SERIAL_EOL(); - } - #endif - #if ENABLED(HYBRID_THRESHOLD) - inline void say_M913(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M913"); } - #endif - #if USE_SENSORLESS - inline void say_M914() { SERIAL_ECHOPGM(" M914"); } - #endif - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - inline void say_M603(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M603 "); } - #endif - - inline void say_units(const bool colon) { - serialprintPGM( - #if ENABLED(INCH_MODE_SUPPORT) - parser.linear_unit_factor != 1.0 ? PSTR(" (in)") : - #endif - PSTR(" (mm)") - ); - if (colon) SERIAL_ECHOLNPGM(":"); - } - - void report_M92(const bool echo=true, const int8_t e=-1); - - /** - * M503 - Report current settings in RAM - * - * Unless specifically disabled, M503 is available even without EEPROM - */ - void MarlinSettings::report(const bool forReplay) { - /** - * Announce current units, in case inches are being displayed - */ - CONFIG_ECHO_START(); - #if ENABLED(INCH_MODE_SUPPORT) - SERIAL_ECHOPGM(" G2"); - SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0'); - SERIAL_ECHOPGM(" ;"); - say_units(false); - #else - SERIAL_ECHOPGM(" G21 ; Units in mm"); - say_units(false); - #endif - SERIAL_EOL(); - - #if HAS_LCD_MENU - - // Temperature units - for Ultipanel temperature options - - CONFIG_ECHO_START(); - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - SERIAL_ECHOPGM(" M149 "); - SERIAL_CHAR(parser.temp_units_code()); - SERIAL_ECHOPGM(" ; Units in "); - serialprintPGM(parser.temp_units_name()); - #else - SERIAL_ECHOLNPGM(" M149 C ; Units in Celsius"); - #endif - - #endif - - SERIAL_EOL(); - - #if DISABLED(NO_VOLUMETRICS) - - /** - * Volumetric extrusion M200 - */ - if (!forReplay) { - CONFIG_ECHO_START(); - SERIAL_ECHOPGM("Filament settings:"); - if (parser.volumetric_enabled) - SERIAL_EOL(); - else - SERIAL_ECHOLNPGM(" Disabled"); - } - - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 D", LINEAR_UNIT(planner.filament_size[0])); - #if EXTRUDERS > 1 - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 T1 D", LINEAR_UNIT(planner.filament_size[1])); - #if EXTRUDERS > 2 - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 T2 D", LINEAR_UNIT(planner.filament_size[2])); - #if EXTRUDERS > 3 - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 T3 D", LINEAR_UNIT(planner.filament_size[3])); - #if EXTRUDERS > 4 - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 T4 D", LINEAR_UNIT(planner.filament_size[4])); - #if EXTRUDERS > 5 - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M200 T5 D", LINEAR_UNIT(planner.filament_size[5])); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - if (!parser.volumetric_enabled) - CONFIG_ECHO_MSG(" M200 D0"); - - #endif // !NO_VOLUMETRICS - - CONFIG_ECHO_HEADING("Steps per unit:"); - report_M92(!forReplay); - - CONFIG_ECHO_HEADING("Maximum feedrates (units/s):"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M203 X"), LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]) - , SP_Y_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]) - , SP_Z_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]) - #if DISABLED(DISTINCT_E_FACTORS) - , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS]) - #endif - ); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START(); - for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOLNPAIR_P( - PSTR(" M203 T"), (int)i - , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) - ); - } - #endif - - CONFIG_ECHO_HEADING("Maximum Acceleration (units/s2):"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M201 X"), LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]) - , SP_Y_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]) - , SP_Z_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]) - #if DISABLED(DISTINCT_E_FACTORS) - , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS]) - #endif - ); - #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START(); - for (uint8_t i = 0; i < E_STEPPERS; i++) - SERIAL_ECHOLNPAIR_P( - PSTR(" M201 T"), (int)i - , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(i)]) - ); - #endif - - CONFIG_ECHO_HEADING("Acceleration (units/s2): P R T"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M204 P", LINEAR_UNIT(planner.settings.acceleration) - , " R", LINEAR_UNIT(planner.settings.retract_acceleration) - , " T", LINEAR_UNIT(planner.settings.travel_acceleration) - ); - - if (!forReplay) { - CONFIG_ECHO_START(); - SERIAL_ECHOPGM("Advanced: B S T"); - #if DISABLED(CLASSIC_JERK) - SERIAL_ECHOPGM(" J"); - #endif - #if HAS_CLASSIC_JERK - SERIAL_ECHOPGM(" X Y Z"); - #if HAS_CLASSIC_E_JERK - SERIAL_ECHOPGM(" E"); - #endif - #endif - SERIAL_EOL(); - } - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us) - , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s) - , PSTR(" T"), LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) - #if DISABLED(CLASSIC_JERK) - , PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm) - #endif - #if HAS_CLASSIC_JERK - , SP_X_STR, LINEAR_UNIT(planner.max_jerk.x) - , SP_Y_STR, LINEAR_UNIT(planner.max_jerk.y) - , SP_Z_STR, LINEAR_UNIT(planner.max_jerk.z) - #if HAS_CLASSIC_E_JERK - , SP_E_STR, LINEAR_UNIT(planner.max_jerk.e) - #endif - #endif - ); - - #if HAS_M206_COMMAND - CONFIG_ECHO_HEADING("Home offset:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - #if IS_CARTESIAN - PSTR(" M206 X"), LINEAR_UNIT(home_offset.x) - , SP_Y_STR, LINEAR_UNIT(home_offset.y) - , SP_Z_STR - #else - PSTR(" M206 Z") - #endif - , LINEAR_UNIT(home_offset.z) - ); - #endif - - #if HAS_HOTEND_OFFSET - CONFIG_ECHO_HEADING("Hotend offsets:"); - CONFIG_ECHO_START(); - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR_P( - PSTR(" M218 T"), (int)e, - SP_X_STR, LINEAR_UNIT(hotend_offset[e].x), - SP_Y_STR, LINEAR_UNIT(hotend_offset[e].y) - ); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(hotend_offset[e].z), 3); - } - #endif - - /** - * Bed Leveling - */ - #if HAS_LEVELING - - #if ENABLED(MESH_BED_LEVELING) - - CONFIG_ECHO_HEADING("Mesh Bed Leveling:"); - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - CONFIG_ECHO_START(); - ubl.echo_name(); - SERIAL_ECHOLNPGM(":"); - } - - #elif HAS_ABL_OR_UBL - - CONFIG_ECHO_HEADING("Auto Bed Leveling:"); - - #endif - - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M420 S"), planner.leveling_active ? 1 : 0 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , SP_Z_STR, LINEAR_UNIT(planner.z_fade_height) - #endif - ); - - #if ENABLED(MESH_BED_LEVELING) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START(); - SERIAL_ECHOPAIR_P(PSTR(" G29 S3 X"), (int)px + 1, SP_Y_STR, (int)py + 1); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(mbl.z_values[px][py]), 5); - } - } - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - if (!forReplay) { - SERIAL_EOL(); - ubl.report_state(); - SERIAL_ECHOLNPAIR("\nActive Mesh Slot: ", ubl.storage_slot); - SERIAL_ECHOLNPAIR("EEPROM can hold ", calc_num_meshes(), " meshes.\n"); - } - - //ubl.report_current_mesh(); // This is too verbose for large meshes. A better (more terse) - // solution needs to be found. - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - - if (leveling_is_valid()) { - for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { - for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START(); - SERIAL_ECHOPAIR(" G29 W I", (int)px, " J", (int)py); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(z_values[px][py]), 5); - } - } - } - - #endif - - #endif // HAS_LEVELING - - #if ENABLED(EDITABLE_SERVO_ANGLES) - - CONFIG_ECHO_HEADING("Servo Angles:"); - for (uint8_t i = 0; i < NUM_SERVOS; i++) { - switch (i) { - #if ENABLED(SWITCHING_EXTRUDER) - case SWITCHING_EXTRUDER_SERVO_NR: - #if EXTRUDERS > 3 - case SWITCHING_EXTRUDER_E23_SERVO_NR: - #endif - #elif ENABLED(SWITCHING_NOZZLE) - case SWITCHING_NOZZLE_SERVO_NR: - #elif (ENABLED(BLTOUCH) && defined(BLTOUCH_ANGLES)) || (defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR)) - case Z_PROBE_SERVO_NR: - #endif - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M281 P", int(i), " L", servo_angles[i][0], " U", servo_angles[i][1]); - default: break; - } - } - - #endif // EDITABLE_SERVO_ANGLES - - #if HAS_SCARA_OFFSET - - CONFIG_ECHO_HEADING("SCARA settings: S P T"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M665 S"), delta_segments_per_second - , PSTR(" P"), scara_home_offset.a - , PSTR(" T"), scara_home_offset.b - , SP_Z_STR, LINEAR_UNIT(scara_home_offset.z) - ); - - #elif ENABLED(DELTA) - - CONFIG_ECHO_HEADING("Endstop adjustment:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) - , SP_Y_STR, LINEAR_UNIT(delta_endstop_adj.b) - , SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c) - ); - - CONFIG_ECHO_HEADING("Delta settings: L R H S XYZ"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) - , PSTR(" R"), LINEAR_UNIT(delta_radius) - , PSTR(" H"), LINEAR_UNIT(delta_height) - , PSTR(" S"), delta_segments_per_second - , SP_X_STR, LINEAR_UNIT(delta_tower_angle_trim.a) - , SP_Y_STR, LINEAR_UNIT(delta_tower_angle_trim.b) - , SP_Z_STR, LINEAR_UNIT(delta_tower_angle_trim.c) - ); - - #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS - - CONFIG_ECHO_HEADING("Endstop adjustment:"); - CONFIG_ECHO_START(); - SERIAL_ECHOPGM(" M666"); - #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR_P(SP_X_STR, LINEAR_UNIT(endstops.x2_endstop_adj)); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj)); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - SERIAL_ECHOLNPAIR("S1 Z", LINEAR_UNIT(endstops.z2_endstop_adj)); - CONFIG_ECHO_START(); - SERIAL_ECHOPAIR(" M666 S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj)); - #elif ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR_P(SP_Z_STR, LINEAR_UNIT(endstops.z2_endstop_adj)); - #endif - SERIAL_EOL(); - - #endif // [XYZ]_DUAL_ENDSTOPS - - #if HOTENDS && HAS_LCD_MENU - - CONFIG_ECHO_HEADING("Material heatup parameters:"); - for (uint8_t i = 0; i < COUNT(ui.preheat_hotend_temp); i++) { - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M145 S", (int)i - , " H", TEMP_UNIT(ui.preheat_hotend_temp[i]) - , " B", TEMP_UNIT(ui.preheat_bed_temp[i]) - , " F", int(ui.preheat_fan_speed[i]) - ); - } - - #endif - - #if HAS_PID_HEATING - - CONFIG_ECHO_HEADING("PID settings:"); - - #if ENABLED(PIDTEMP) - HOTEND_LOOP() { - CONFIG_ECHO_START(); - SERIAL_ECHOPAIR_P( - #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) - PSTR(" M301 E"), e, - PSTR(" P") - #else - PSTR(" M301 P") - #endif - , PID_PARAM(Kp, e) - , PSTR(" I"), unscalePID_i(PID_PARAM(Ki, e)) - , PSTR(" D"), unscalePID_d(PID_PARAM(Kd, e)) - ); - #if ENABLED(PID_EXTRUSION_SCALING) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); - if (e == 0) SERIAL_ECHOPAIR(" L", thermalManager.lpq_len); - #endif - #if ENABLED(PID_FAN_SCALING) - SERIAL_ECHOPAIR(" F", PID_PARAM(Kf, e)); - #endif - SERIAL_EOL(); - } - #endif // PIDTEMP - - #if ENABLED(PIDTEMPBED) - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M304 P", thermalManager.temp_bed.pid.Kp - , " I", unscalePID_i(thermalManager.temp_bed.pid.Ki) - , " D", unscalePID_d(thermalManager.temp_bed.pid.Kd) - ); - #endif - - #endif // PIDTEMP || PIDTEMPBED - - #if HAS_USER_THERMISTORS - CONFIG_ECHO_HEADING("User thermistors:"); - for (uint8_t i = 0; i < USER_THERMISTORS; i++) - thermalManager.log_user_thermistor(i, true); - #endif - - #if HAS_LCD_CONTRAST - CONFIG_ECHO_HEADING("LCD Contrast:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M250 C", ui.contrast); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - CONFIG_ECHO_HEADING("Power-Loss Recovery:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M413 S", int(recovery.enabled)); - #endif - - #if ENABLED(FWRETRACT) - - CONFIG_ECHO_HEADING("Retract: S F Z"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M207 S"), LINEAR_UNIT(fwretract.settings.retract_length) - , PSTR(" W"), LINEAR_UNIT(fwretract.settings.swap_retract_length) - , PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_feedrate_mm_s)) - , SP_Z_STR, LINEAR_UNIT(fwretract.settings.retract_zraise) - ); - - CONFIG_ECHO_HEADING("Recover: S F"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M208 S", LINEAR_UNIT(fwretract.settings.retract_recover_extra) - , " W", LINEAR_UNIT(fwretract.settings.swap_retract_recover_extra) - , " F", LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_recover_feedrate_mm_s)) - ); - - #if ENABLED(FWRETRACT_AUTORETRACT) - - CONFIG_ECHO_HEADING("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M209 S", fwretract.autoretract_enabled ? 1 : 0); - - #endif // FWRETRACT_AUTORETRACT - - #endif // FWRETRACT - - /** - * Probe Offset - */ - #if HAS_BED_PROBE - if (!forReplay) { - CONFIG_ECHO_START(); - SERIAL_ECHOPGM("Z-Probe Offset"); - say_units(true); - } - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P(PSTR(" M851 X"), LINEAR_UNIT(probe_offset.x), - SP_Y_STR, LINEAR_UNIT(probe_offset.y), - SP_Z_STR, LINEAR_UNIT(probe_offset.z)); - #endif - - /** - * Bed Skew Correction - */ - #if ENABLED(SKEW_CORRECTION_GCODE) - CONFIG_ECHO_HEADING("Skew Factor: "); - CONFIG_ECHO_START(); - #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPAIR_F(" M852 I", LINEAR_UNIT(planner.skew_factor.xy), 6); - SERIAL_ECHOPAIR_F(" J", LINEAR_UNIT(planner.skew_factor.xz), 6); - SERIAL_ECHOLNPAIR_F(" K", LINEAR_UNIT(planner.skew_factor.yz), 6); - #else - SERIAL_ECHOLNPAIR_F(" M852 S", LINEAR_UNIT(planner.skew_factor.xy), 6); - #endif - #endif - - #if HAS_TRINAMIC - - /** - * TMC stepper driver current - */ - CONFIG_ECHO_HEADING("Stepper driver current:"); - - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - say_M906(forReplay); - #if AXIS_IS_TMC(X) - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps()); - #endif - #if AXIS_IS_TMC(Y) - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps()); - #endif - #if AXIS_IS_TMC(Z) - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps()); - #endif - SERIAL_EOL(); - #endif - - #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) - say_M906(forReplay); - SERIAL_ECHOPGM(" I1"); - #if AXIS_IS_TMC(X2) - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps()); - #endif - #if AXIS_IS_TMC(Y2) - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps()); - #endif - #if AXIS_IS_TMC(Z2) - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps()); - #endif - SERIAL_EOL(); - #endif - - #if AXIS_IS_TMC(Z3) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.getMilliamps()); - #endif - - #if AXIS_IS_TMC(E0) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T0 E", stepperE0.getMilliamps()); - #endif - #if AXIS_IS_TMC(E1) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T1 E", stepperE1.getMilliamps()); - #endif - #if AXIS_IS_TMC(E2) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T2 E", stepperE2.getMilliamps()); - #endif - #if AXIS_IS_TMC(E3) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T3 E", stepperE3.getMilliamps()); - #endif - #if AXIS_IS_TMC(E4) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T4 E", stepperE4.getMilliamps()); - #endif - #if AXIS_IS_TMC(E5) - say_M906(forReplay); - SERIAL_ECHOLNPAIR(" T5 E", stepperE5.getMilliamps()); - #endif - SERIAL_EOL(); - - /** - * TMC Hybrid Threshold - */ - #if ENABLED(HYBRID_THRESHOLD) - CONFIG_ECHO_HEADING("Hybrid Threshold:"); - #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) - say_M913(forReplay); - #endif - #if AXIS_HAS_STEALTHCHOP(X) - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) - SERIAL_EOL(); - #endif - - #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2) - say_M913(forReplay); - SERIAL_ECHOPGM(" I1"); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2) - SERIAL_EOL(); - #endif - - #if AXIS_HAS_STEALTHCHOP(Z3) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.get_pwm_thrs()); - #endif - - #if AXIS_HAS_STEALTHCHOP(E0) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T0 E", stepperE0.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T1 E", stepperE1.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T2 E", stepperE2.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T3 E", stepperE3.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T4 E", stepperE4.get_pwm_thrs()); - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - say_M913(forReplay); - SERIAL_ECHOLNPAIR(" T5 E", stepperE5.get_pwm_thrs()); - #endif - SERIAL_EOL(); - #endif // HYBRID_THRESHOLD - - /** - * TMC Sensorless homing thresholds - */ - #if USE_SENSORLESS - CONFIG_ECHO_HEADING("StallGuard threshold:"); - #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS - CONFIG_ECHO_START(); - say_M914(); - #if X_SENSORLESS - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.homing_threshold()); - #endif - #if Y_SENSORLESS - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.homing_threshold()); - #endif - #if Z_SENSORLESS - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.homing_threshold()); - #endif - SERIAL_EOL(); - #endif - - #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS - CONFIG_ECHO_START(); - say_M914(); - SERIAL_ECHOPGM(" I1"); - #if X2_SENSORLESS - SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.homing_threshold()); - #endif - #if Y2_SENSORLESS - SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.homing_threshold()); - #endif - #if Z2_SENSORLESS - SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.homing_threshold()); - #endif - SERIAL_EOL(); - #endif - - #if Z3_SENSORLESS - CONFIG_ECHO_START(); - say_M914(); - SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold()); - #endif - - #endif // USE_SENSORLESS - - /** - * TMC stepping mode - */ - #if HAS_STEALTHCHOP - CONFIG_ECHO_HEADING("Driver stepping mode:"); - #if AXIS_HAS_STEALTHCHOP(X) - const bool chop_x = stepperX.get_stealthChop_status(); - #else - constexpr bool chop_x = false; - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - const bool chop_y = stepperY.get_stealthChop_status(); - #else - constexpr bool chop_y = false; - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - const bool chop_z = stepperZ.get_stealthChop_status(); - #else - constexpr bool chop_z = false; - #endif - - if (chop_x || chop_y || chop_z) { - say_M569(forReplay); - if (chop_x) SERIAL_ECHO_P(SP_X_STR); - if (chop_y) SERIAL_ECHO_P(SP_Y_STR); - if (chop_z) SERIAL_ECHO_P(SP_Z_STR); - SERIAL_EOL(); - } - - #if AXIS_HAS_STEALTHCHOP(X2) - const bool chop_x2 = stepperX2.get_stealthChop_status(); - #else - constexpr bool chop_x2 = false; - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - const bool chop_y2 = stepperY2.get_stealthChop_status(); - #else - constexpr bool chop_y2 = false; - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - const bool chop_z2 = stepperZ2.get_stealthChop_status(); - #else - constexpr bool chop_z2 = false; - #endif - - if (chop_x2 || chop_y2 || chop_z2) { - say_M569(forReplay, PSTR("I1")); - if (chop_x2) SERIAL_ECHO_P(SP_X_STR); - if (chop_y2) SERIAL_ECHO_P(SP_Y_STR); - if (chop_z2) SERIAL_ECHO_P(SP_Z_STR); - SERIAL_EOL(); - } - - #if AXIS_HAS_STEALTHCHOP(Z3) - 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(forReplay, PSTR("T0 E"), true); } - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - 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(forReplay, PSTR("T2 E"), true); } - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - 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(forReplay, PSTR("T4 E"), true); } - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - if (stepperE5.get_stealthChop_status()) { say_M569(forReplay, PSTR("T5 E"), true); } - #endif - - #endif // HAS_STEALTHCHOP - - #endif // HAS_TRINAMIC - - /** - * Linear Advance - */ - #if ENABLED(LIN_ADVANCE) - CONFIG_ECHO_HEADING("Linear Advance:"); - CONFIG_ECHO_START(); - #if EXTRUDERS < 2 - SERIAL_ECHOLNPAIR(" M900 K", planner.extruder_advance_K[0]); - #else - LOOP_L_N(i, EXTRUDERS) - SERIAL_ECHOLNPAIR(" M900 T", int(i), " K", planner.extruder_advance_K[i]); - #endif - #endif - - #if HAS_MOTOR_CURRENT_PWM - CONFIG_ECHO_HEADING("Stepper motor currents:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M907 X"), stepper.motor_current_setting[0] - , SP_Z_STR, stepper.motor_current_setting[1] - , SP_E_STR, stepper.motor_current_setting[2] - ); - #endif - - /** - * Advanced Pause filament load & unload lengths - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - CONFIG_ECHO_HEADING("Filament load/unload lengths:"); - #if EXTRUDERS == 1 - say_M603(forReplay); - SERIAL_ECHOLNPAIR("L", LINEAR_UNIT(fc_settings[0].load_length), " U", LINEAR_UNIT(fc_settings[0].unload_length)); - #else - #define _ECHO_603(N) do{ say_M603(forReplay); SERIAL_ECHOLNPAIR("T" STRINGIFY(N) " L", LINEAR_UNIT(fc_settings[N].load_length), " U", LINEAR_UNIT(fc_settings[N].unload_length)); }while(0) - _ECHO_603(0); - _ECHO_603(1); - #if EXTRUDERS > 2 - _ECHO_603(2); - #if EXTRUDERS > 3 - _ECHO_603(3); - #if EXTRUDERS > 4 - _ECHO_603(4); - #if EXTRUDERS > 5 - _ECHO_603(5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS == 1 - #endif // ADVANCED_PAUSE_FEATURE - - #if EXTRUDERS > 1 - CONFIG_ECHO_HEADING("Tool-changing:"); - CONFIG_ECHO_START(); - M217_report(true); - #endif - - #if ENABLED(BACKLASH_GCODE) - CONFIG_ECHO_HEADING("Backlash compensation:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_P( - PSTR(" M425 F"), backlash.get_correction() - , SP_X_STR, LINEAR_UNIT(backlash.distance_mm.x) - , SP_Y_STR, LINEAR_UNIT(backlash.distance_mm.y) - , SP_Z_STR, LINEAR_UNIT(backlash.distance_mm.z) - #ifdef BACKLASH_SMOOTHING_MM - , PSTR(" S"), LINEAR_UNIT(backlash.smoothing_mm) - #endif - ); - #endif - - #if HAS_FILAMENT_SENSOR - CONFIG_ECHO_HEADING("Filament runout sensor:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M412 S", int(runout.enabled) - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - , " D", LINEAR_UNIT(runout.runout_distance()) - #endif - ); - #endif - } - -#endif // !DISABLE_M503 - -#pragma pack(pop) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.h deleted file mode 100644 index b8a64c5c68..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/configuration_store.h +++ /dev/null @@ -1,109 +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 - -#include "../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - #include "../HAL/shared/persistent_store_api.h" -#endif - -class MarlinSettings { - public: - static uint16_t datasize(); - - static void reset(); - static bool save(); // Return 'true' if data was saved - - FORCE_INLINE static bool init_eeprom() { - reset(); - #if ENABLED(EEPROM_SETTINGS) - const bool success = save(); - #if ENABLED(EEPROM_CHITCHAT) - if (success) report(); - #endif - return success; - #else - return true; - #endif - } - - #if ENABLED(SD_FIRMWARE_UPDATE) - static bool sd_update_status(); // True if the SD-Firmware-Update EEPROM flag is set - static bool set_sd_update_status(const bool enable); // Return 'true' after EEPROM is set (-> always true) - #endif - - #if ENABLED(EEPROM_SETTINGS) - - static bool load(); // Return 'true' if data was loaded ok - static bool validate(); // Return 'true' if EEPROM data is ok - - static inline void first_load() { - static bool loaded = false; - if (!loaded && load()) loaded = true; - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static uint16_t meshes_start_index(); - FORCE_INLINE static uint16_t meshes_end_index() { return meshes_end; } - static uint16_t calc_num_meshes(); - static int mesh_slot_offset(const int8_t slot); - static void store_mesh(const int8_t slot); - static void load_mesh(const int8_t slot, void * const into=nullptr); - - //static void delete_mesh(); // necessary if we have a MAT - //static void defrag_meshes(); // " - #endif - #else - FORCE_INLINE - static bool load() { reset(); report(); return true; } - FORCE_INLINE - static void first_load() { (void)load(); } - #endif - - #if DISABLED(DISABLE_M503) - static void report(const bool forReplay=false); - #else - FORCE_INLINE - static void report(const bool=false) {} - #endif - - private: - static void postprocess(); - - #if ENABLED(EEPROM_SETTINGS) - - static bool eeprom_error, validating; - - #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system - // That can store is enabled - static const uint16_t meshes_end; // 128 is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom - #endif - - static bool _load(); - static bool size_error(const uint16_t size); - #endif -}; - -extern MarlinSettings settings; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.cpp deleted file mode 100644 index 38d3d8146d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.cpp +++ /dev/null @@ -1,282 +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 . - * - */ - -/** - * delta.cpp - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(DELTA) - -#include "delta.h" -#include "motion.h" - -// For homing: -#include "planner.h" -#include "endstops.h" -#include "../lcd/ultralcd.h" -#include "../Marlin.h" - -#if HAS_BED_PROBE - #include "probe.h" -#endif - -#if ENABLED(SENSORLESS_HOMING) - #include "../feature/tmc_util.h" - #include "stepper/indirection.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../core/debug_out.h" - -// Initialized by settings.load() -float delta_height; -abc_float_t delta_endstop_adj{0}; -float delta_radius, - delta_diagonal_rod, - delta_segments_per_second; -abc_float_t delta_tower_angle_trim; -xy_float_t delta_tower[ABC]; -abc_float_t delta_diagonal_rod_2_tower; -float delta_clip_start_height = Z_MAX_POS; - -float delta_safe_distance_from_top(); - -/** - * Recalculate factors used for delta kinematics whenever - * settings have been changed (e.g., by M665). - */ -void recalc_delta_settings() { - constexpr abc_float_t trt = DELTA_RADIUS_TRIM_TOWER, - drt = DELTA_DIAGONAL_ROD_TRIM_TOWER; - delta_tower[A_AXIS].set(cos(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a), // front left tower - sin(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a)); - delta_tower[B_AXIS].set(cos(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b), // front right tower - sin(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b)); - delta_tower[C_AXIS].set(cos(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c), // back middle tower - sin(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c)); - delta_diagonal_rod_2_tower.set(sq(delta_diagonal_rod + drt.a), - sq(delta_diagonal_rod + drt.b), - sq(delta_diagonal_rod + drt.c)); - update_software_endstops(Z_AXIS); - set_all_unhomed(); -} - -/** - * Get a safe radius for calibration - */ - -#if ENABLED(DELTA_AUTO_CALIBRATION) - float calibration_radius_factor = 1; -#endif - -float delta_calibration_radius() { - return FLOOR((DELTA_PRINTABLE_RADIUS - ( - #if HAS_BED_PROBE - _MAX(HYPOT(probe_offset.x, probe_offset.y), MIN_PROBE_EDGE) - #else - MIN_PROBE_EDGE - #endif - )) * calibration_radius_factor); -} - -/** - * Delta Inverse Kinematics - * - * Calculate the tower positions for a given machine - * position, storing the result in the delta[] array. - * - * This is an expensive calculation, requiring 3 square - * roots per segmented linear move, and strains the limits - * of a Mega2560 with a Graphical Display. - * - * Suggested optimizations include: - * - * - Disable the home_offset (M206) and/or position_shift (G92) - * features to remove up to 12 float additions. - */ - -#define DELTA_DEBUG(VAR) do { \ - SERIAL_ECHOLNPAIR_P(PSTR("Cartesian X"), VAR.x, SP_Y_STR, VAR.y, SP_Z_STR, VAR.z); \ - SERIAL_ECHOLNPAIR("Delta A", delta.a, " B", delta.b, " C", delta.c); \ - }while(0) - -void inverse_kinematics(const xyz_pos_t &raw) { - #if HAS_HOTEND_OFFSET - // Delta hotend offsets must be applied in Cartesian space with no "spoofing" - xyz_pos_t pos = { raw.x - hotend_offset[active_extruder].x, - raw.y - hotend_offset[active_extruder].y, - raw.z }; - DELTA_IK(pos); - //DELTA_DEBUG(pos); - #else - DELTA_IK(raw); - //DELTA_DEBUG(raw); - #endif -} - -/** - * Calculate the highest Z position where the - * effector has the full range of XY motion. - */ -float delta_safe_distance_from_top() { - xyz_pos_t cartesian{0}; - inverse_kinematics(cartesian); - const float centered_extent = delta.a; - cartesian.y = DELTA_PRINTABLE_RADIUS; - inverse_kinematics(cartesian); - return ABS(centered_extent - delta.a); -} - -/** - * Delta Forward Kinematics - * - * See the Wikipedia article "Trilateration" - * https://en.wikipedia.org/wiki/Trilateration - * - * Establish a new coordinate system in the plane of the - * three carriage points. This system has its origin at - * tower1, with tower2 on the X axis. Tower3 is in the X-Y - * plane with a Z component of zero. - * We will define unit vectors in this coordinate system - * in our original coordinate system. Then when we calculate - * the Xnew, Ynew and Znew values, we can translate back into - * the original system by moving along those unit vectors - * by the corresponding values. - * - * Variable names matched to Marlin, c-version, and avoid the - * use of any vector library. - * - * by Andreas Hardtung 2016-06-07 - * based on a Java function from "Delta Robot Kinematics V3" - * by Steve Graves - * - * The result is stored in the cartes[] array. - */ -void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { - // Create a vector in old coordinates along x axis of new coordinate - const float p12[3] = { delta_tower[B_AXIS].x - delta_tower[A_AXIS].x, delta_tower[B_AXIS].y - delta_tower[A_AXIS].y, z2 - z1 }, - - // Get the reciprocal of Magnitude of vector. - d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), - - // Create unit vector by multiplying by the inverse of the magnitude. - ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, - - // Get the vector from the origin of the new system to the third point. - p13[3] = { delta_tower[C_AXIS].x - delta_tower[A_AXIS].x, delta_tower[C_AXIS].y - delta_tower[A_AXIS].y, z3 - z1 }, - - // Use the dot product to find the component of this vector on the X axis. - i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2], - - // Create a vector along the x axis that represents the x component of p13. - iex[3] = { ex[0] * i, ex[1] * i, ex[2] * i }; - - // Subtract the X component from the original vector leaving only Y. We use the - // variable that will be the unit vector after we scale it. - float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2] }; - - // The magnitude and the inverse of the magnitude of Y component - const float j2 = sq(ey[0]) + sq(ey[1]) + sq(ey[2]), inv_j = RSQRT(j2); - - // Convert to a unit vector - ey[0] *= inv_j; ey[1] *= inv_j; ey[2] *= inv_j; - - // The cross product of the unit x and y is the unit z - // float[] ez = vectorCrossProd(ex, ey); - const float ez[3] = { - ex[1] * ey[2] - ex[2] * ey[1], - ex[2] * ey[0] - ex[0] * ey[2], - ex[0] * ey[1] - ex[1] * ey[0] - }, - - // We now have the d, i and j values defined in Wikipedia. - // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew - Xnew = (delta_diagonal_rod_2_tower.a - delta_diagonal_rod_2_tower.b + d2) * inv_d * 0.5, - Ynew = ((delta_diagonal_rod_2_tower.a - delta_diagonal_rod_2_tower.c + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, - Znew = SQRT(delta_diagonal_rod_2_tower.a - HYPOT2(Xnew, Ynew)); - - // Start from the origin of the old coordinates and add vectors in the - // old coords that represent the Xnew, Ynew and Znew to find the point - // in the old system. - cartes.set(delta_tower[A_AXIS].x + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew, - delta_tower[A_AXIS].y + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew, - z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew); -} - -/** - * A delta can only safely home all axes at the same time - * This is like quick_home_xy() but for 3 towers. - */ -void home_delta() { - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); - // Init the current position of all carriages to 0,0,0 - current_position.reset(); - destination.reset(); - sync_plan_position(); - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - sensorless_t stealth_states { - tmc_enable_stallguard(stepperX), - tmc_enable_stallguard(stepperY), - tmc_enable_stallguard(stepperZ) - }; - #endif - - // Move all carriages together linearly until an endstop is hit. - current_position.z = (delta_height + 10 - #if HAS_BED_PROBE - - probe_offset.z - #endif - ); - line_to_current_position(homing_feedrate(X_AXIS)); - planner.synchronize(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - tmc_disable_stallguard(stepperX, stealth_states.x); - tmc_disable_stallguard(stepperY, stealth_states.y); - tmc_disable_stallguard(stepperZ, stealth_states.z); - #endif - - endstops.validate_homing_move(); - - // At least one carriage has reached the top. - // Now re-home each carriage separately. - homeaxis(A_AXIS); - homeaxis(B_AXIS); - homeaxis(C_AXIS); - - // Set all carriages to their home positions - // Do this here all at once for Delta, because - // XYZ isn't ABC. Applying this per-tower would - // give the impression that they are the same. - LOOP_XYZ(i) set_axis_is_at_home((AxisEnum)i); - - sync_plan_position(); - - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); -} - -#endif // DELTA diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.h deleted file mode 100644 index 17cd330686..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/delta.h +++ /dev/null @@ -1,125 +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 - -/** - * delta.h - Delta-specific functions - */ - -#include "../core/types.h" - -extern float delta_height; -extern abc_float_t delta_endstop_adj; -extern float delta_radius, - delta_diagonal_rod, - delta_segments_per_second; -extern abc_float_t delta_tower_angle_trim; -extern xy_float_t delta_tower[ABC]; -extern abc_float_t delta_diagonal_rod_2_tower; -extern float delta_clip_start_height; - -/** - * Recalculate factors used for delta kinematics whenever - * settings have been changed (e.g., by M665). - */ -void recalc_delta_settings(); - -/** - * Get a safe radius for calibration - */ -#if ENABLED(DELTA_AUTO_CALIBRATION) - extern float calibration_radius_factor; -#else - constexpr float calibration_radius_factor = 1; -#endif - -float delta_calibration_radius(); - -/** - * Delta Inverse Kinematics - * - * Calculate the tower positions for a given machine - * position, storing the result in the delta[] array. - * - * This is an expensive calculation, requiring 3 square - * roots per segmented linear move, and strains the limits - * of a Mega2560 with a Graphical Display. - * - * Suggested optimizations include: - * - * - Disable the home_offset (M206) and/or position_shift (G92) - * features to remove up to 12 float additions. - * - * - Use a fast-inverse-sqrt function and add the reciprocal. - * (see above) - */ - -// Macro to obtain the Z position of an individual tower -#define DELTA_Z(V,T) V.z + SQRT( \ - delta_diagonal_rod_2_tower[T] - HYPOT2( \ - delta_tower[T].x - V.x, \ - delta_tower[T].y - V.y \ - ) \ - ) - -#define DELTA_IK(V) delta.set(DELTA_Z(V, A_AXIS), DELTA_Z(V, B_AXIS), DELTA_Z(V, C_AXIS)) - -void inverse_kinematics(const xyz_pos_t &raw); - -/** - * Calculate the highest Z position where the - * effector has the full range of XY motion. - */ -float delta_safe_distance_from_top(); - -/** - * Delta Forward Kinematics - * - * See the Wikipedia article "Trilateration" - * https://en.wikipedia.org/wiki/Trilateration - * - * Establish a new coordinate system in the plane of the - * three carriage points. This system has its origin at - * tower1, with tower2 on the X axis. Tower3 is in the X-Y - * plane with a Z component of zero. - * We will define unit vectors in this coordinate system - * in our original coordinate system. Then when we calculate - * the Xnew, Ynew and Znew values, we can translate back into - * the original system by moving along those unit vectors - * by the corresponding values. - * - * Variable names matched to Marlin, c-version, and avoid the - * use of any vector library. - * - * by Andreas Hardtung 2016-06-07 - * based on a Java function from "Delta Robot Kinematics V3" - * by Steve Graves - * - * The result is stored in the cartes[] array. - */ -void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3); - -FORCE_INLINE void forward_kinematics_DELTA(const abc_float_t &point) { - forward_kinematics_DELTA(point.a, point.b, point.c); -} - -void home_delta(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.cpp deleted file mode 100644 index cbe274a692..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.cpp +++ /dev/null @@ -1,952 +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 . - * - */ - -/** - * endstops.cpp - A singleton object to manage endstops - */ - -#include "endstops.h" -#include "stepper.h" - -#include "../Marlin.h" -#include "../sd/cardreader.h" -#include "temperature.h" -#include "../lcd/ultralcd.h" - -#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - #include HAL_PATH(../HAL, endstop_interrupts.h) -#endif - -#if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) - #include "printcounter.h" // for print_job_timer -#endif - -#if ENABLED(BLTOUCH) - #include "../feature/bltouch.h" -#endif - -#if ENABLED(JOYSTICK) - #include "../feature/joystick.h" -#endif - -Endstops endstops; - -// private: - -bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() -volatile uint8_t Endstops::hit_state; - -Endstops::esbits_t Endstops::live_state = 0; - -#if ENDSTOP_NOISE_THRESHOLD - Endstops::esbits_t Endstops::validated_live_state; - uint8_t Endstops::endstop_poll_count; -#endif - -#if HAS_BED_PROBE - volatile bool Endstops::z_probe_enabled = false; -#endif - -// Initialized by settings.load() -#if ENABLED(X_DUAL_ENDSTOPS) - float Endstops::x2_endstop_adj; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - float Endstops::y2_endstop_adj; -#endif -#if Z_MULTI_ENDSTOPS - float Endstops::z2_endstop_adj; -#endif -#if ENABLED(Z_TRIPLE_ENDSTOPS) - float Endstops::z3_endstop_adj; -#endif - -#if ENABLED(SPI_ENDSTOPS) - Endstops::tmc_spi_homing_t Endstops::tmc_spi_homing; // = 0 -#endif -#if ENABLED(IMPROVE_HOMING_RELIABILITY) - millis_t sg_guard_period; // = 0 -#endif - -/** - * Class and Instance Methods - */ - -void Endstops::init() { - - #if HAS_X_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_XMIN) - SET_INPUT_PULLDOWN(X_MIN_PIN); - #else - SET_INPUT(X_MIN_PIN); - #endif - #endif - - #if HAS_X2_MIN - #if ENABLED(ENDSTOPPULLUP_XMIN) - SET_INPUT_PULLUP(X2_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_XMIN) - SET_INPUT_PULLDOWN(X2_MIN_PIN); - #else - SET_INPUT(X2_MIN_PIN); - #endif - #endif - - #if HAS_Y_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_YMIN) - SET_INPUT_PULLDOWN(Y_MIN_PIN); - #else - SET_INPUT(Y_MIN_PIN); - #endif - #endif - - #if HAS_Y2_MIN - #if ENABLED(ENDSTOPPULLUP_YMIN) - SET_INPUT_PULLUP(Y2_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_YMIN) - SET_INPUT_PULLDOWN(Y2_MIN_PIN); - #else - SET_INPUT(Y2_MIN_PIN); - #endif - #endif - - #if HAS_Z_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - SET_INPUT_PULLUP(Z_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMIN) - SET_INPUT_PULLDOWN(Z_MIN_PIN); - #else - SET_INPUT(Z_MIN_PIN); - #endif - #endif - - #if HAS_Z2_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - SET_INPUT_PULLUP(Z2_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMIN) - SET_INPUT_PULLDOWN(Z2_MIN_PIN); - #else - SET_INPUT(Z2_MIN_PIN); - #endif - #endif - - #if HAS_Z3_MIN - #if ENABLED(ENDSTOPPULLUP_ZMIN) - SET_INPUT_PULLUP(Z3_MIN_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMIN) - SET_INPUT_PULLDOWN(Z3_MIN_PIN); - #else - SET_INPUT(Z3_MIN_PIN); - #endif - #endif - - #if HAS_X_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_XMAX) - SET_INPUT_PULLDOWN(X_MAX_PIN); - #else - SET_INPUT(X_MAX_PIN); - #endif - #endif - - #if HAS_X2_MAX - #if ENABLED(ENDSTOPPULLUP_XMAX) - SET_INPUT_PULLUP(X2_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_XMAX) - SET_INPUT_PULLDOWN(X2_MAX_PIN); - #else - SET_INPUT(X2_MAX_PIN); - #endif - #endif - - #if HAS_Y_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_YMAX) - SET_INPUT_PULLDOWN(Y_MAX_PIN); - #else - SET_INPUT(Y_MAX_PIN); - #endif - #endif - - #if HAS_Y2_MAX - #if ENABLED(ENDSTOPPULLUP_YMAX) - SET_INPUT_PULLUP(Y2_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_YMAX) - SET_INPUT_PULLDOWN(Y2_MAX_PIN); - #else - SET_INPUT(Y2_MAX_PIN); - #endif - #endif - - #if HAS_Z_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMAX) - SET_INPUT_PULLDOWN(Z_MAX_PIN); - #else - SET_INPUT(Z_MAX_PIN); - #endif - #endif - - #if HAS_Z2_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z2_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMAX) - SET_INPUT_PULLDOWN(Z2_MAX_PIN); - #else - SET_INPUT(Z2_MAX_PIN); - #endif - #endif - - #if HAS_Z3_MAX - #if ENABLED(ENDSTOPPULLUP_ZMAX) - SET_INPUT_PULLUP(Z3_MAX_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMAX) - SET_INPUT_PULLDOWN(Z3_MAX_PIN); - #else - SET_INPUT(Z3_MAX_PIN); - #endif - #endif - - #if HAS_CALIBRATION_PIN - #if ENABLED(CALIBRATION_PIN_PULLUP) - SET_INPUT_PULLUP(CALIBRATION_PIN); - #elif ENABLED(CALIBRATION_PIN_PULLDOWN) - SET_INPUT_PULLDOWN(CALIBRATION_PIN); - #else - SET_INPUT(CALIBRATION_PIN); - #endif - #endif - - #if HAS_CUSTOM_PROBE_PIN - #if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE) - SET_INPUT_PULLUP(Z_MIN_PROBE_PIN); - #elif ENABLED(ENDSTOPPULLDOWN_ZMIN_PROBE) - SET_INPUT_PULLDOWN(Z_MIN_PROBE_PIN); - #else - SET_INPUT(Z_MIN_PROBE_PIN); - #endif - #endif - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - setup_endstop_interrupts(); - #endif - - // Enable endstops - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - true - #else - false - #endif - ); - -} // Endstops::init - -// Called at ~1KHz from Temperature ISR: Poll endstop state if required -void Endstops::poll() { - - #if ENABLED(PINS_DEBUGGING) - run_monitor(); // report changes in endstop status - #endif - - #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #elif ENDSTOP_NOISE_THRESHOLD - if (endstop_poll_count) update(); - #endif -} - -void Endstops::enable_globally(const bool onoff) { - enabled_globally = enabled = onoff; - resync(); -} - -// Enable / disable endstop checking -void Endstops::enable(const bool onoff) { - enabled = onoff; - resync(); -} - -// Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable -void Endstops::not_homing() { - enabled = enabled_globally; -} - -#if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - void Endstops::validate_homing_move() { - if (trigger_state()) hit_on_purpose(); - else kill(GET_TEXT(MSG_LCD_HOMING_FAILED)); - } -#endif - -// Enable / disable endstop z-probe checking -#if HAS_BED_PROBE - void Endstops::enable_z_probe(const bool onoff) { - z_probe_enabled = onoff; - resync(); - } -#endif - -// Get the stable endstop states when enabled -void Endstops::resync() { - if (!abort_enabled()) return; // If endstops/probes are disabled the loop below can hang - - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - update(); - #else - safe_delay(2); // Wait for Temperature ISR to run at least once (runs at 1KHz) - #endif - #if ENDSTOP_NOISE_THRESHOLD - while (endstop_poll_count) safe_delay(1); - #endif -} - -#if ENABLED(PINS_DEBUGGING) - void Endstops::run_monitor() { - if (!monitor_flag) return; - static uint8_t monitor_count = 16; // offset this check from the others - monitor_count += _BV(1); // 15 Hz - monitor_count &= 0x7F; - if (!monitor_count) monitor(); // report changes in endstop status - } -#endif - -void Endstops::event_handler() { - static uint8_t prev_hit_state; // = 0 - if (hit_state == prev_hit_state) return; - prev_hit_state = hit_state; - if (hit_state) { - #if HAS_SPI_LCD - char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; - #define _SET_STOP_CHAR(A,C) (chr## A = C) - #else - #define _SET_STOP_CHAR(A,C) ; - #endif - - #define _ENDSTOP_HIT_ECHO(A,C) do{ \ - SERIAL_ECHOPAIR(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); \ - _SET_STOP_CHAR(A,C); }while(0) - - #define _ENDSTOP_HIT_TEST(A,C) \ - if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \ - _ENDSTOP_HIT_ECHO(A,C) - - #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') - #define ENDSTOP_HIT_TEST_Y() _ENDSTOP_HIT_TEST(Y,'Y') - #define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z') - - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); - ENDSTOP_HIT_TEST_X(); - ENDSTOP_HIT_TEST_Y(); - ENDSTOP_HIT_TEST_Z(); - - #if HAS_CUSTOM_PROBE_PIN - #define P_AXIS Z_AXIS - if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); - #endif - SERIAL_EOL(); - - #if HAS_SPI_LCD - ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), GET_TEXT(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP); - #endif - - #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) - if (planner.abort_on_endstop_hit) { - card.stopSDPrint(); - quickstop_stepper(); - thermalManager.disable_all_heaters(); - print_job_timer.stop(); - } - #endif - } -} - -static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { - if (label) serialprintPGM(label); - SERIAL_ECHOPGM(": "); - serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN)); - SERIAL_EOL(); -} - -void _O2 Endstops::report_states() { - #if ENABLED(BLTOUCH) - bltouch._set_SW_mode(); - #endif - SERIAL_ECHOLNPGM(MSG_M119_REPORT); - #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S)) - #if HAS_X_MIN - ES_REPORT(X_MIN); - #endif - #if HAS_X2_MIN - ES_REPORT(X2_MIN); - #endif - #if HAS_X_MAX - ES_REPORT(X_MAX); - #endif - #if HAS_X2_MAX - ES_REPORT(X2_MAX); - #endif - #if HAS_Y_MIN - ES_REPORT(Y_MIN); - #endif - #if HAS_Y2_MIN - ES_REPORT(Y2_MIN); - #endif - #if HAS_Y_MAX - ES_REPORT(Y_MAX); - #endif - #if HAS_Y2_MAX - ES_REPORT(Y2_MAX); - #endif - #if HAS_Z_MIN - ES_REPORT(Z_MIN); - #endif - #if HAS_Z2_MIN - ES_REPORT(Z2_MIN); - #endif - #if HAS_Z3_MIN - ES_REPORT(Z3_MIN); - #endif - #if HAS_Z_MAX - ES_REPORT(Z_MAX); - #endif - #if HAS_Z2_MAX - ES_REPORT(Z2_MAX); - #endif - #if HAS_Z3_MAX - ES_REPORT(Z3_MAX); - #endif - #if HAS_CUSTOM_PROBE_PIN - print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE)); - #endif - #if HAS_FILAMENT_SENSOR - #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(MSG_FILAMENT_RUNOUT_SENSOR)); - #else - for (uint8_t i = 1; i <= NUM_RUNOUT_SENSORS; i++) { - pin_t pin; - switch (i) { - default: continue; - case 1: pin = FIL_RUNOUT_PIN; break; - case 2: pin = FIL_RUNOUT2_PIN; break; - #if NUM_RUNOUT_SENSORS > 2 - case 3: pin = FIL_RUNOUT3_PIN; break; - #if NUM_RUNOUT_SENSORS > 3 - case 4: pin = FIL_RUNOUT4_PIN; break; - #if NUM_RUNOUT_SENSORS > 4 - case 5: pin = FIL_RUNOUT5_PIN; break; - #if NUM_RUNOUT_SENSORS > 5 - case 6: pin = FIL_RUNOUT6_PIN; break; - #endif - #endif - #endif - #endif - } - SERIAL_ECHOPGM(MSG_FILAMENT_RUNOUT_SENSOR); - if (i > 1) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + i); } - print_es_state(extDigitalRead(pin) != FIL_RUNOUT_INVERTING); - } - #endif - #endif - #if ENABLED(BLTOUCH) - bltouch._reset_SW_mode(); - #endif - - #if ENABLED(JOYSTICK_DEBUG) - joystick.report(); - #endif - -} // Endstops::report_states - -// The following routines are called from an ISR context. It could be the temperature ISR, the -// endstop ISR or the Stepper ISR. - -#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX -#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN -#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING - -// Check endstops - Could be called from Temperature ISR! -void Endstops::update() { - - #if !ENDSTOP_NOISE_THRESHOLD - if (!abort_enabled()) return; - #endif - - #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) - #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - // With Dual X, endstops are only checked in the homing direction for the active extruder - #if ENABLED(DUAL_X_CARRIAGE) - #define E0_ACTIVE stepper.movement_extruder() == 0 - #define X_MIN_TEST ((X_HOME_DIR < 0 && E0_ACTIVE) || (X2_HOME_DIR < 0 && !E0_ACTIVE)) - #define X_MAX_TEST ((X_HOME_DIR > 0 && E0_ACTIVE) || (X2_HOME_DIR > 0 && !E0_ACTIVE)) - #else - #define X_MIN_TEST true - #define X_MAX_TEST true - #endif - - // Use HEAD for core axes, AXIS for others - #if CORE_IS_XY || CORE_IS_XZ - #define X_AXIS_HEAD X_HEAD - #else - #define X_AXIS_HEAD X_AXIS - #endif - #if CORE_IS_XY || CORE_IS_YZ - #define Y_AXIS_HEAD Y_HEAD - #else - #define Y_AXIS_HEAD Y_AXIS - #endif - #if CORE_IS_XZ || CORE_IS_YZ - #define Z_AXIS_HEAD Z_HEAD - #else - #define Z_AXIS_HEAD Z_AXIS - #endif - - /** - * Check and update endstops - */ - #if HAS_X_MIN && !X_SPI_SENSORLESS - UPDATE_ENDSTOP_BIT(X, MIN); - #if ENABLED(X_DUAL_ENDSTOPS) - #if HAS_X2_MIN - UPDATE_ENDSTOP_BIT(X2, MIN); - #else - COPY_LIVE_STATE(X_MIN, X2_MIN); - #endif - #endif - #endif - - #if HAS_X_MAX && !X_SPI_SENSORLESS - UPDATE_ENDSTOP_BIT(X, MAX); - #if ENABLED(X_DUAL_ENDSTOPS) - #if HAS_X2_MAX - UPDATE_ENDSTOP_BIT(X2, MAX); - #else - COPY_LIVE_STATE(X_MAX, X2_MAX); - #endif - #endif - #endif - - #if HAS_Y_MIN && !Y_SPI_SENSORLESS - UPDATE_ENDSTOP_BIT(Y, MIN); - #if ENABLED(Y_DUAL_ENDSTOPS) - #if HAS_Y2_MIN - UPDATE_ENDSTOP_BIT(Y2, MIN); - #else - COPY_LIVE_STATE(Y_MIN, Y2_MIN); - #endif - #endif - #endif - - #if HAS_Y_MAX && !Y_SPI_SENSORLESS - UPDATE_ENDSTOP_BIT(Y, MAX); - #if ENABLED(Y_DUAL_ENDSTOPS) - #if HAS_Y2_MAX - UPDATE_ENDSTOP_BIT(Y2, MAX); - #else - COPY_LIVE_STATE(Y_MAX, Y2_MAX); - #endif - #endif - #endif - - #if HAS_Z_MIN && !Z_SPI_SENSORLESS - UPDATE_ENDSTOP_BIT(Z, MIN); - #if Z_MULTI_ENDSTOPS - #if HAS_Z2_MIN - UPDATE_ENDSTOP_BIT(Z2, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z2_MIN); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - #if HAS_Z3_MIN - UPDATE_ENDSTOP_BIT(Z3, MIN); - #else - COPY_LIVE_STATE(Z_MIN, Z3_MIN); - #endif - #endif - #endif - #endif - - // When closing the gap check the enabled probe - #if HAS_CUSTOM_PROBE_PIN - UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - #endif - - #if HAS_Z_MAX && !Z_SPI_SENSORLESS - // Check both Z dual endstops - #if Z_MULTI_ENDSTOPS - UPDATE_ENDSTOP_BIT(Z, MAX); - #if HAS_Z2_MAX - UPDATE_ENDSTOP_BIT(Z2, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z2_MAX); - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - #if HAS_Z3_MAX - UPDATE_ENDSTOP_BIT(Z3, MAX); - #else - COPY_LIVE_STATE(Z_MAX, Z3_MAX); - #endif - #endif - #elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin isn't the bed probe it's the Z endstop - UPDATE_ENDSTOP_BIT(Z, MAX); - #endif - #endif - - #if ENDSTOP_NOISE_THRESHOLD - - /** - * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise, - * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution - * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample - * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes - * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It - * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances - * still exist. The only way to reduce them further is to increase the number of samples. - * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay). - */ - static esbits_t old_live_state; - if (old_live_state != live_state) { - endstop_poll_count = ENDSTOP_NOISE_THRESHOLD; - old_live_state = live_state; - } - else if (endstop_poll_count && !--endstop_poll_count) - validated_live_state = live_state; - - if (!abort_enabled()) return; - - #endif - - // Test the current status of an endstop - #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) - - // Record endstop was hit - #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) - - // Call the endstop triggered routine for single endstops - #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \ - if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ - _ENDSTOP_HIT(AXIS, MINMAX); \ - planner.endstop_triggered(_AXIS(AXIS)); \ - } \ - }while(0) - - // Call the endstop triggered routine for dual endstops - #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \ - const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX)) << 1); \ - if (dual_hit) { \ - _ENDSTOP_HIT(AXIS1, MINMAX); \ - /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.separate_multi_axis || dual_hit == 0b11) \ - planner.endstop_triggered(_AXIS(AXIS1)); \ - } \ - }while(0) - - #define PROCESS_TRIPLE_ENDSTOP(AXIS1, AXIS2, AXIS3, MINMAX) do { \ - const byte triple_hit = TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX)) << 1) | (TEST_ENDSTOP(_ENDSTOP(AXIS3, MINMAX)) << 2); \ - if (triple_hit) { \ - _ENDSTOP_HIT(AXIS1, MINMAX); \ - /* if not performing home or if both endstops were trigged during homing... */ \ - if (!stepper.separate_multi_axis || triple_hit == 0b111) \ - planner.endstop_triggered(_AXIS(AXIS1)); \ - } \ - }while(0) - - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) - #if ENABLED(G38_PROBE_AWAY) - #define _G38_OPEN_STATE (G38_move >= 4) - #else - #define _G38_OPEN_STATE LOW - #endif - // If G38 command is active check Z_MIN_PROBE for ALL movement - if (G38_move && TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE)) != _G38_OPEN_STATE) { - if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); } - else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); } - else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); } - G38_did_trigger = true; - } - #endif - - // Now, we must signal, after validation, if an endstop limit is pressed or not - if (stepper.axis_is_moving(X_AXIS)) { - if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction - #if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_DIR < 0) - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MIN); - #else - if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN); - #endif - #endif - } - else { // +direction - #if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_DIR > 0) - #if ENABLED(X_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(X, X2, MAX); - #else - if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Y_AXIS)) { - if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction - #if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_DIR < 0) - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); - #else - PROCESS_ENDSTOP(Y, MIN); - #endif - #endif - } - else { // +direction - #if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_DIR > 0) - #if ENABLED(Y_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); - #else - PROCESS_ENDSTOP(Y, MAX); - #endif - #endif - } - } - - if (stepper.axis_is_moving(Z_AXIS)) { - if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. - #if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_DIR < 0) - #if ENABLED(Z_TRIPLE_ENDSTOPS) - PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MIN); - #elif ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MIN); - #else - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #elif HAS_CUSTOM_PROBE_PIN - if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #else - PROCESS_ENDSTOP(Z, MIN); - #endif - #endif - #endif - - // When closing the gap check the enabled probe - #if HAS_CUSTOM_PROBE_PIN - if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); - #endif - } - else { // Z +direction. Gantry up, bed down. - #if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_DIR > 0) - #if ENABLED(Z_TRIPLE_ENDSTOPS) - PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MAX); - #elif ENABLED(Z_DUAL_ENDSTOPS) - PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); - #elif !HAS_CUSTOM_PROBE_PIN || Z_MAX_PIN != Z_MIN_PROBE_PIN - // If this pin is not hijacked for the bed probe - // then it belongs to the Z endstop - PROCESS_ENDSTOP(Z, MAX); - #endif - #endif - } - } -} // Endstops::update() - -#if ENABLED(SPI_ENDSTOPS) - - #define X_STOP (X_HOME_DIR < 0 ? X_MIN : X_MAX) - #define Y_STOP (Y_HOME_DIR < 0 ? Y_MIN : Y_MAX) - #define Z_STOP (Z_HOME_DIR < 0 ? Z_MIN : Z_MAX) - - bool Endstops::tmc_spi_homing_check() { - bool hit = false; - #if X_SPI_SENSORLESS - if (tmc_spi_homing.x && stepperX.test_stall_status()) { - SBI(live_state, X_STOP); - hit = true; - } - #endif - #if Y_SPI_SENSORLESS - if (tmc_spi_homing.y && stepperY.test_stall_status()) { - SBI(live_state, Y_STOP); - hit = true; - } - #endif - #if Z_SPI_SENSORLESS - if (tmc_spi_homing.z && stepperZ.test_stall_status()) { - SBI(live_state, Z_STOP); - hit = true; - } - #endif - return hit; - } - - void Endstops::clear_endstop_state() { - #if X_SPI_SENSORLESS - CBI(live_state, X_STOP); - #endif - #if Y_SPI_SENSORLESS - CBI(live_state, Y_STOP); - #endif - #if Z_SPI_SENSORLESS - CBI(live_state, Z_STOP); - #endif - } - -#endif // SPI_ENDSTOPS - -#if ENABLED(PINS_DEBUGGING) - - bool Endstops::monitor_flag = false; - - /** - * Monitor Endstops and Z Probe for changes - * - * If a change is detected then the LED is toggled and - * a message is sent out the serial port. - * - * Yes, we could miss a rapid back & forth change but - * that won't matter because this is all manual. - */ - void Endstops::monitor() { - - static uint16_t old_live_state_local = 0; - static uint8_t local_LED_status = 0; - uint16_t live_state_local = 0; - - #define ES_GET_STATE(S) if (READ(S##_PIN)) SBI(live_state_local, S) - - #if HAS_X_MIN - ES_GET_STATE(X_MIN); - #endif - #if HAS_X_MAX - ES_GET_STATE(X_MAX); - #endif - #if HAS_Y_MIN - ES_GET_STATE(Y_MIN); - #endif - #if HAS_Y_MAX - ES_GET_STATE(Y_MAX); - #endif - #if HAS_Z_MIN - ES_GET_STATE(Z_MIN); - #endif - #if HAS_Z_MAX - ES_GET_STATE(Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - ES_GET_STATE(Z_MIN_PROBE); - #endif - #if HAS_X2_MIN - ES_GET_STATE(X2_MIN); - #endif - #if HAS_X2_MAX - ES_GET_STATE(X2_MAX); - #endif - #if HAS_Y2_MIN - ES_GET_STATE(Y2_MIN); - #endif - #if HAS_Y2_MAX - ES_GET_STATE(Y2_MAX); - #endif - #if HAS_Z2_MIN - ES_GET_STATE(Z2_MIN); - #endif - #if HAS_Z2_MAX - ES_GET_STATE(Z2_MAX); - #endif - #if HAS_Z3_MIN - ES_GET_STATE(Z3_MIN); - #endif - #if HAS_Z3_MAX - ES_GET_STATE(Z3_MAX); - #endif - - uint16_t endstop_change = live_state_local ^ old_live_state_local; - #define ES_REPORT_CHANGE(S) if (TEST(endstop_change, S)) SERIAL_ECHOPAIR(" " STRINGIFY(S) ":", TEST(live_state_local, S)) - - if (endstop_change) { - #if HAS_X_MIN - ES_REPORT_CHANGE(X_MIN); - #endif - #if HAS_X_MAX - ES_REPORT_CHANGE(X_MAX); - #endif - #if HAS_Y_MIN - ES_REPORT_CHANGE(Y_MIN); - #endif - #if HAS_Y_MAX - ES_REPORT_CHANGE(Y_MAX); - #endif - #if HAS_Z_MIN - ES_REPORT_CHANGE(Z_MIN); - #endif - #if HAS_Z_MAX - ES_REPORT_CHANGE(Z_MAX); - #endif - #if HAS_Z_MIN_PROBE_PIN - ES_REPORT_CHANGE(Z_MIN_PROBE); - #endif - #if HAS_X2_MIN - ES_REPORT_CHANGE(X2_MIN); - #endif - #if HAS_X2_MAX - ES_REPORT_CHANGE(X2_MAX); - #endif - #if HAS_Y2_MIN - ES_REPORT_CHANGE(Y2_MIN); - #endif - #if HAS_Y2_MAX - ES_REPORT_CHANGE(Y2_MAX); - #endif - #if HAS_Z2_MIN - ES_REPORT_CHANGE(Z2_MIN); - #endif - #if HAS_Z2_MAX - ES_REPORT_CHANGE(Z2_MAX); - #endif - #if HAS_Z3_MIN - ES_REPORT_CHANGE(Z3_MIN); - #endif - #if HAS_Z3_MAX - ES_REPORT_CHANGE(Z3_MAX); - #endif - SERIAL_ECHOLNPGM("\n"); - analogWrite(pin_t(LED_PIN), local_LED_status); - local_LED_status ^= 255; - old_live_state_local = live_state_local; - } - } - -#endif // PINS_DEBUGGING diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.h deleted file mode 100644 index 151c428edc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/endstops.h +++ /dev/null @@ -1,192 +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 - -/** - * endstops.h - manages endstops - */ - -#include "../inc/MarlinConfig.h" -#include - -enum EndstopEnum : char { - X_MIN, Y_MIN, Z_MIN, Z_MIN_PROBE, - X_MAX, Y_MAX, Z_MAX, - X2_MIN, X2_MAX, - Y2_MIN, Y2_MAX, - Z2_MIN, Z2_MAX, - Z3_MIN, Z3_MAX -}; - -class Endstops { - public: - #if HAS_EXTRA_ENDSTOPS - typedef uint16_t esbits_t; - #if ENABLED(X_DUAL_ENDSTOPS) - static float x2_endstop_adj; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static float y2_endstop_adj; - #endif - #if Z_MULTI_ENDSTOPS - static float z2_endstop_adj; - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - static float z3_endstop_adj; - #endif - #else - typedef uint8_t esbits_t; - #endif - - private: - static bool enabled, enabled_globally; - static esbits_t live_state; - static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index - - #if ENDSTOP_NOISE_THRESHOLD - static esbits_t validated_live_state; - static uint8_t endstop_poll_count; // Countdown from threshold for polling - #endif - - public: - Endstops() {}; - - /** - * Initialize the endstop pins - */ - static void init(); - - /** - * Are endstops or the probe set to abort the move? - */ - FORCE_INLINE static bool abort_enabled() { - return (enabled - #if HAS_BED_PROBE - || z_probe_enabled - #endif - ); - } - - static inline bool global_enabled() { return enabled_globally; } - - /** - * Periodic call to poll endstops if required. Called from temperature ISR - */ - static void poll(); - - /** - * Update endstops bits from the pins. Apply filtering to get a verified state. - * If abort_enabled() and moving towards a triggered switch, abort the current move. - * Called from ISR contexts. - */ - static void update(); - - /** - * Get Endstop hit state. - */ - FORCE_INLINE static uint8_t trigger_state() { return hit_state; } - - /** - * Get current endstops state - */ - FORCE_INLINE static esbits_t state() { - return - #if ENDSTOP_NOISE_THRESHOLD - validated_live_state - #else - live_state - #endif - ; - } - - /** - * Report endstop hits to serial. Called from loop(). - */ - static void event_handler(); - - /** - * Report endstop states in response to M119 - */ - static void report_states(); - - // Enable / disable endstop checking globally - static void enable_globally(const bool onoff=true); - - // Enable / disable endstop checking - static void enable(const bool onoff=true); - - // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable - static void not_homing(); - - #if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill - static void validate_homing_move(); - #else - FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } - #endif - - // Clear endstops (i.e., they were hit intentionally) to suppress the report - FORCE_INLINE static void hit_on_purpose() { hit_state = 0; } - - // Enable / disable endstop z-probe checking - #if HAS_BED_PROBE - static volatile bool z_probe_enabled; - static void enable_z_probe(const bool onoff=true); - #endif - - static void resync(); - - // Debugging of endstops - #if ENABLED(PINS_DEBUGGING) - static bool monitor_flag; - static void monitor(); - static void run_monitor(); - #endif - - #if ENABLED(SPI_ENDSTOPS) - typedef struct { - union { - bool any; - struct { bool x:1, y:1, z:1; }; - }; - } tmc_spi_homing_t; - static tmc_spi_homing_t tmc_spi_homing; - static void clear_endstop_state(); - static bool tmc_spi_homing_check(); - #endif -}; - -extern Endstops endstops; - -/** - * A class to save and change the endstop state, - * then restore it when it goes out of scope. - */ -class TemporaryGlobalEndstopsState { - bool saved; - - public: - TemporaryGlobalEndstopsState(const bool enable) : saved(endstops.global_enabled()) { - endstops.enable_globally(enable); - } - ~TemporaryGlobalEndstopsState() { endstops.enable_globally(saved); } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.cpp deleted file mode 100644 index 484d6a077a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.cpp +++ /dev/null @@ -1,1727 +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 . - * - */ - -/** - * motion.cpp - */ - -#include "motion.h" -#include "endstops.h" -#include "stepper.h" -#include "planner.h" -#include "temperature.h" - -#include "../gcode/gcode.h" - -#include "../inc/MarlinConfig.h" - -#if IS_SCARA - #include "../libs/buzzer.h" - #include "../lcd/ultralcd.h" -#endif - -#if HAS_BED_PROBE - #include "probe.h" -#endif - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(BLTOUCH) - #include "../feature/bltouch.h" -#endif - -#if HAS_DISPLAY - #include "../lcd/ultralcd.h" -#endif - -#if ENABLED(SENSORLESS_HOMING) - #include "../feature/tmc_util.h" -#endif - -#if ENABLED(FWRETRACT) - #include "../feature/fwretract.h" -#endif - -#if ENABLED(BABYSTEP_DISPLAY_TOTAL) - #include "../feature/babystep.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../core/debug_out.h" - -#define XYZ_CONSTS(T, NAME, OPT) const PROGMEM XYZval NAME##_P = { X_##OPT, Y_##OPT, Z_##OPT } - -XYZ_CONSTS(float, base_min_pos, MIN_POS); -XYZ_CONSTS(float, base_max_pos, MAX_POS); -XYZ_CONSTS(float, base_home_pos, HOME_POS); -XYZ_CONSTS(float, max_length, MAX_LENGTH); -XYZ_CONSTS(float, home_bump_mm, HOME_BUMP_MM); -XYZ_CONSTS(signed char, home_dir, HOME_DIR); - -/** - * axis_homed - * Flags that each linear axis was homed. - * XYZ on cartesian, ABC on delta, ABZ on SCARA. - * - * axis_known_position - * Flags that the position is known in each linear axis. Set when homed. - * Cleared whenever a stepper powers off, potentially losing its position. - */ -uint8_t axis_homed, axis_known_position; // = 0 - -// Relative Mode. Enable with G91, disable with G90. -bool relative_mode; // = false; - -/** - * Cartesian Current Position - * Used to track the native machine position as moves are queued. - * Used by 'line_to_current_position' to do a move after changing it. - * Used by 'sync_plan_position' to update 'planner.position'. - */ -xyze_pos_t current_position = { 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'. - * G-codes can set destination using 'get_destination_from_command' - */ -xyze_pos_t destination; // {0} - -// The active extruder (tool). Set with T command. -#if EXTRUDERS > 1 - uint8_t active_extruder; // = 0 -#endif - -#if ENABLED(LCD_SHOW_E_TOTAL) - float e_move_accumulator; // = 0 -#endif - -// Extruder offsets -#if HAS_HOTEND_OFFSET - xyz_pos_t hotend_offset[HOTENDS]; // Initialized by settings.load() - void reset_hotend_offsets() { - constexpr float tmp[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z }; - static_assert( - !tmp[X_AXIS][0] && !tmp[Y_AXIS][0] && !tmp[Z_AXIS][0], - "Offsets for the first hotend must be 0.0." - ); - // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ] - HOTEND_LOOP() LOOP_XYZ(a) hotend_offset[e][a] = tmp[a][e]; - #if ENABLED(DUAL_X_CARRIAGE) - hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS); - #endif - } -#endif - -// The feedrate for the current move, often used as the default if -// 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! -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 feedRate_t homing_feedrate_mm_s[XYZ] PROGMEM = { - #if ENABLED(DELTA) - MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), - #else - MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), - #endif - MMM_TO_MMS(HOMING_FEEDRATE_Z) -}; - -// Cartesian conversion result goes here: -xyz_pos_t cartes; - -#if IS_KINEMATIC - - abc_pos_t delta; - - #if HAS_SCARA_OFFSET - abc_pos_t scara_home_offset; - #endif - - #if HAS_SOFTWARE_ENDSTOPS - float delta_max_radius, delta_max_radius_2; - #elif IS_SCARA - constexpr float delta_max_radius = SCARA_PRINTABLE_RADIUS, - delta_max_radius_2 = sq(SCARA_PRINTABLE_RADIUS); - #else // DELTA - constexpr float delta_max_radius = DELTA_PRINTABLE_RADIUS, - delta_max_radius_2 = sq(DELTA_PRINTABLE_RADIUS); - #endif - -#endif - -/** - * The workspace can be offset by some commands, or - * these offsets may be omitted to save on computation. - */ -#if HAS_POSITION_SHIFT - // The distance that XYZ has been offset by G92. Reset by G28. - xyz_pos_t position_shift{0}; -#endif -#if HAS_HOME_OFFSET - // This offset is added to the configured home position. - // Set by M206, M428, or menu item. Saved to EEPROM. - xyz_pos_t home_offset{0}; -#endif -#if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - // The above two are combined to save on computes - xyz_pos_t workspace_offset{0}; -#endif - -#if HAS_ABL_NOT_UBL - float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); -#endif - -/** - * Output the current position to serial - */ -void report_current_position() { - const xyz_pos_t lpos = current_position.asLogical(); - SERIAL_ECHOPAIR("X:", lpos.x, " Y:", lpos.y, " Z:", lpos.z, " E:", current_position.e); - - stepper.report_positions(); - - #if IS_SCARA - scara_report_positions(); - #endif -} - -/** - * sync_plan_position - * - * Set the planner/stepper positions directly from current_position with - * no kinematic translation. Used for homing axes and cartesian/core syncing. - */ -void sync_plan_position() { - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); - planner.set_position_mm(current_position); -} - -void sync_plan_position_e() { planner.set_e_position_mm(current_position.e); } - -/** - * Get the stepper positions in the cartes[] array. - * Forward kinematics are applied for DELTA and SCARA. - * - * The result is in the current coordinate space with - * leveling applied. The coordinates need to be run through - * unapply_leveling to obtain the "ideal" coordinates - * suitable for current_position, etc. - */ -void get_cartesian_from_steppers() { - #if ENABLED(DELTA) - forward_kinematics_DELTA( - planner.get_axis_position_mm(A_AXIS), - planner.get_axis_position_mm(B_AXIS), - planner.get_axis_position_mm(C_AXIS) - ); - #else - #if IS_SCARA - forward_kinematics_SCARA( - planner.get_axis_position_degrees(A_AXIS), - planner.get_axis_position_degrees(B_AXIS) - ); - #else - cartes.set(planner.get_axis_position_mm(X_AXIS), planner.get_axis_position_mm(Y_AXIS)); - #endif - cartes.z = planner.get_axis_position_mm(Z_AXIS); - #endif -} - -/** - * Set the current_position for an axis based on - * the stepper positions, removing any leveling that - * may have been applied. - * - * To prevent small shifts in axis position always call - * sync_plan_position after updating axes with this. - * - * To keep hosts in sync, always call report_current_position - * after updating the current_position. - */ -void set_current_from_steppers_for_axis(const AxisEnum axis) { - get_cartesian_from_steppers(); - - #if HAS_POSITION_MODIFIERS - xyze_pos_t pos = { cartes.x, cartes.y, cartes.z, current_position.e }; - planner.unapply_modifiers(pos - #if HAS_LEVELING - , true - #endif - ); - xyze_pos_t &cartes = pos; - #endif - if (axis == ALL_AXES) - current_position = cartes; - else - current_position[axis] = cartes[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 feedRate_t &fr_mm_s/*=feedrate_mm_s*/) { - planner.buffer_line(current_position, fr_mm_s, active_extruder); -} - -#if IS_KINEMATIC - - /** - * Buffer a fast move without interpolation. Set current_position to 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.line_to_destination_segmented(scaled_fr_mm_s); - #else - if (current_position == destination) return; - - planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); - #endif - - current_position = destination; - } - -#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; - - #if EXTRUDERS - const float old_fac = planner.e_factor[active_extruder]; - planner.e_factor[active_extruder] = 1.0f; - #endif - - #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; - #if EXTRUDERS - planner.e_factor[active_extruder] = old_fac; - #endif -} - -/** - * 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 feedRate_t &fr_mm_s/*=0.0*/) { - if (DEBUGGING(LEVELING)) DEBUG_XYZ(">>> do_blocking_move_to", rx, ry, rz); - - const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS), - xy_feedrate = fr_mm_s ?: feedRate_t(XY_PROBE_FEEDRATE_MM_S); - - #if ENABLED(DELTA) - - if (!position_is_reachable(rx, ry)) return; - - REMEMBER(fr, feedrate_mm_s, xy_feedrate); - - destination = current_position; // sync destination at the start - - if (DEBUGGING(LEVELING)) DEBUG_POS("destination = current_position", destination); - - // when in the danger zone - if (current_position.z > delta_clip_start_height) { - if (rz > delta_clip_start_height) { // staying in the danger zone - destination.set(rx, ry, rz); // move directly (uninterpolated) - prepare_internal_fast_move_to_destination(); // set current_position from destination - if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); - return; - } - destination.z = delta_clip_start_height; - prepare_internal_fast_move_to_destination(); // set current_position from destination - if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); - } - - if (rz > current_position.z) { // raising? - destination.z = rz; - prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination - if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); - } - - destination.set(rx, ry); - prepare_internal_move_to_destination(); // set current_position from destination - if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - - if (rz < current_position.z) { // lowering? - destination.z = rz; - prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination - if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); - } - - #elif IS_SCARA - - if (!position_is_reachable(rx, ry)) return; - - destination = current_position; - - // If Z needs to raise, do it before moving XY - if (destination.z < rz) { - destination.z = rz; - prepare_internal_fast_move_to_destination(z_feedrate); - } - - destination.set(rx, ry); - prepare_internal_fast_move_to_destination(xy_feedrate); - - // If Z needs to lower, do it after moving XY - if (destination.z > rz) { - destination.z = rz; - prepare_internal_fast_move_to_destination(z_feedrate); - } - - #else - - // If Z needs to raise, do it before moving XY - if (current_position.z < rz) { - current_position.z = rz; - line_to_current_position(z_feedrate); - } - - current_position.set(rx, ry); - line_to_current_position(xy_feedrate); - - // If Z needs to lower, do it after moving XY - if (current_position.z > rz) { - current_position.z = rz; - line_to_current_position(z_feedrate); - } - - #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< do_blocking_move_to"); - - planner.synchronize(); -} - -void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { - do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s); -} -void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { - do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s); -} -void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { - do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s); -} - -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, current_position.z, 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, ry, current_position.z, fr_mm_s); -} -void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { - do_blocking_move_to_xy_z(current_position, rz, fr_mm_s); -} - -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, fr_mm_s); -} -void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { - do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s); -} - -void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s/*=0.0f*/) { - do_blocking_move_to(raw.x, raw.y, z, fr_mm_s); -} - -// -// Prepare to do endstop or probe moves with custom feedrates. -// - Save / restore current feedrate and multiplier -// -static float saved_feedrate_mm_s; -static int16_t saved_feedrate_percentage; -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 restore_feedrate_and_scaling() { - feedrate_mm_s = saved_feedrate_mm_s; - feedrate_percentage = saved_feedrate_percentage; -} - -#if HAS_SOFTWARE_ENDSTOPS - - bool soft_endstops_enabled = true; - - // Software Endstops are based on the configured limits. - axis_limits_t soft_endstop = { - { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } - }; - - /** - * Software endstops can be used to monitor the open end of - * an axis that has a hardware endstop on the other end. Or - * they can prevent axes from moving past endstops and grinding. - * - * To keep doing their job as the coordinate system changes, - * the software endstop positions must be refreshed to remain - * at the same positions relative to the machine. - */ - void update_software_endstops(const AxisEnum axis - #if HAS_HOTEND_OFFSET - , const uint8_t old_tool_index/*=0*/, const uint8_t new_tool_index/*=0*/ - #endif - ) { - - #if ENABLED(DUAL_X_CARRIAGE) - - if (axis == X_AXIS) { - - // In Dual X mode hotend_offset[X] is T1's home position - const float dual_max_x = _MAX(hotend_offset[1].x, X2_MAX_POS); - - if (new_tool_index != 0) { - // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) - soft_endstop.min.x = X2_MIN_POS; - soft_endstop.max.x = dual_max_x; - } - else if (dxc_is_duplicating()) { - // In Duplication Mode, T0 can move as far left as X1_MIN_POS - // but not so far to the right that T1 would move past the end - soft_endstop.min.x = X1_MIN_POS; - soft_endstop.max.x = _MIN(X1_MAX_POS, dual_max_x - duplicate_extruder_x_offset); - } - else { - // In other modes, T0 can move from X1_MIN_POS to X1_MAX_POS - soft_endstop.min.x = X1_MIN_POS; - soft_endstop.max.x = X1_MAX_POS; - } - - } - - #elif ENABLED(DELTA) - - soft_endstop.min[axis] = base_min_pos(axis); - soft_endstop.max[axis] = (axis == Z_AXIS ? delta_height - #if HAS_BED_PROBE - - probe_offset.z - #endif - : base_max_pos(axis)); - - switch (axis) { - case X_AXIS: - case Y_AXIS: - // Get a minimum radius for clamping - delta_max_radius = _MIN(ABS(_MAX(soft_endstop.min.x, soft_endstop.min.y)), soft_endstop.max.x, soft_endstop.max.y); - delta_max_radius_2 = sq(delta_max_radius); - break; - case Z_AXIS: - delta_clip_start_height = soft_endstop.max[axis] - delta_safe_distance_from_top(); - default: break; - } - - #elif HAS_HOTEND_OFFSET - - // Software endstops are relative to the tool 0 workspace, so - // the movement limits must be shifted by the tool offset to - // retain the same physical limit when other tools are selected. - if (old_tool_index != new_tool_index) { - const float offs = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; - soft_endstop.min[axis] += offs; - soft_endstop.max[axis] += offs; - } - else { - const float offs = hotend_offset[active_extruder][axis]; - soft_endstop.min[axis] = base_min_pos(axis) + offs; - soft_endstop.max[axis] = base_max_pos(axis) + offs; - } - - #else - - soft_endstop.min[axis] = base_min_pos(axis); - soft_endstop.max[axis] = base_max_pos(axis); - - #endif - - if (DEBUGGING(LEVELING)) - SERIAL_ECHOLNPAIR("Axis ", axis_codes[axis], " min:", soft_endstop.min[axis], " max:", soft_endstop.max[axis]); -} - - /** - * Constrain the given coordinates to the software endstops. - * - * For DELTA/SCARA the XY constraint is based on the smallest - * radius within the set software endstops. - */ - void apply_motion_limits(xyz_pos_t &target) { - - if (!soft_endstops_enabled || !all_axes_homed()) return; - - #if IS_KINEMATIC - - #if HAS_HOTEND_OFFSET && ENABLED(DELTA) - // The effector center position will be the target minus the hotend offset. - const xy_pos_t offs = hotend_offset[active_extruder]; - #else - // SCARA needs to consider the angle of the arm through the entire move, so for now use no tool offset. - constexpr xy_pos_t offs{0}; - #endif - - const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y); - if (dist_2 > delta_max_radius_2) - target *= delta_max_radius / SQRT(dist_2); // 200 / 300 = 0.66 - - #else - - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_X) - NOLESS(target.x, soft_endstop.min.x); - #endif - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_X) - NOMORE(target.x, soft_endstop.max.x); - #endif - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - NOLESS(target.y, soft_endstop.min.y); - #endif - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - NOMORE(target.y, soft_endstop.max.y); - #endif - - #endif - - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - NOLESS(target.z, soft_endstop.min.z); - #endif - #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - NOMORE(target.z, soft_endstop.max.z); - #endif - } - -#endif // HAS_SOFTWARE_ENDSTOPS - -#if !UBL_SEGMENTED -#if IS_KINEMATIC - - #if IS_SCARA - /** - * Before raising this value, use M665 S[seg_per_sec] to decrease - * the number of segments-per-second. Default is 200. Some deltas - * do better with 160 or lower. It would be good to know how many - * segments-per-second are actually possible for SCARA on AVR. - * - * Longer segments result in less kinematic overhead - * but may produce jagged lines. Try 0.5mm, 1.0mm, and 2.0mm - * and compare the difference. - */ - #define SCARA_MIN_SEGMENT_LENGTH 0.5f - #endif - - /** - * Prepare a linear move in a DELTA or SCARA setup. - * - * Called from prepare_move_to_destination as the - * default Delta/SCARA segmenter. - * - * This calls planner.buffer_line several times, adding - * small incremental moves for DELTA or SCARA. - * - * For Unified Bed Leveling (Delta or Segmented Cartesian) - * 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 line_to_destination_kinematic() { - - // Get the top feedrate of the move in the XY plane - const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); - - const xyze_float_t diff = destination - current_position; - - // If the move is only in Z/E don't split up the move - if (!diff.x && !diff.y) { - 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(destination)) return true; - - // Get the linear distance in XYZ - float cartesian_mm = diff.magnitude(); - - // If the move is very short, check the E move distance - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e); - - // No E move either? Game over. - if (UNEAR_ZERO(cartesian_mm)) return true; - - // Minimum number of seconds to move the given distance - const float seconds = cartesian_mm / scaled_fr_mm_s; - - // The number of segments-per-second times the duration - // gives the number of segments - uint16_t segments = delta_segments_per_second * seconds; - - // For SCARA enforce a minimum segment size - #if IS_SCARA - NOMORE(segments, cartesian_mm * RECIPROCAL(SCARA_MIN_SEGMENT_LENGTH)); - #endif - - // At least one segment is required - NOLESS(segments, 1U); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments; - const xyze_float_t segment_distance = diff * inv_segments; - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; - #endif - - /* - SERIAL_ECHOPAIR("mm=", cartesian_mm); - SERIAL_ECHOPAIR(" seconds=", seconds); - SERIAL_ECHOPAIR(" segments=", segments); - SERIAL_ECHOPAIR(" segment_mm=", cartesian_segment_mm); - SERIAL_EOL(); - //*/ - - // Get the current position as starting point - xyze_pos_t raw = current_position; - - // Calculate and execute the segments - while (--segments) { - - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - - raw += segment_distance; - - if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - )) - break; - } - - // Ensure last segment arrives at target location. - planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, cartesian_segment_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - - return false; // caller will update current_position - } - -#else // !IS_KINEMATIC - - #if ENABLED(SEGMENT_LEVELED_MOVES) - - /** - * Prepare a segmented move on a CARTESIAN setup. - * - * This calls planner.buffer_line several times, adding - * small incremental moves. This allows the planner to - * apply more detailed bed leveling to the full move. - */ - inline void segmented_line_to_destination(const feedRate_t &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) { - - const xyze_float_t diff = destination - current_position; - - // If the move is only in Z/E don't split up the move - if (!diff.x && !diff.y) { - planner.buffer_line(destination, fr_mm_s, active_extruder); - return; - } - - // Get the linear distance in XYZ - // If the move is very short, check the E move distance - // No E move either? Game over. - float cartesian_mm = diff.magnitude(); - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e); - if (UNEAR_ZERO(cartesian_mm)) return; - - // The length divided by the segment size - // At least one segment is required - uint16_t segments = cartesian_mm / segment_size; - NOLESS(segments, 1U); - - // The approximate length of each segment - const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments; - const xyze_float_t segment_distance = diff * inv_segments; - - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; - #endif - - // SERIAL_ECHOPAIR("mm=", cartesian_mm); - // SERIAL_ECHOLNPAIR(" segments=", segments); - // SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); - - // Get the raw current position as starting point - xyze_pos_t raw = current_position; - - // Calculate and execute the segments - while (--segments) { - static millis_t next_idle_ms = millis() + 200UL; - thermalManager.manage_heater(); // This returns immediately if not really needed. - if (ELAPSED(millis(), next_idle_ms)) { - next_idle_ms = millis() + 200UL; - idle(); - } - raw += segment_distance; - if (!planner.buffer_line(raw, fr_mm_s, active_extruder, cartesian_segment_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - )) - break; - } - - // Since segment_distance is only approximate, - // the final move must be to the exact destination. - planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - } - - #endif // SEGMENT_LEVELED_MOVES - - /** - * Prepare a linear move in a Cartesian setup. - * - * When a mesh-based leveling system is active, moves are segmented - * according to the configuration of the leveling system. - * - * Return 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)) { - #if ENABLED(AUTO_BED_LEVELING_UBL) - 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(scaled_fr_mm_s); - return false; // caller will update current_position - #else - /** - * For MBL and ABL-BILINEAR only segment moves when X or Y are involved. - * Otherwise fall through to do a direct single move. - */ - if (xy_pos_t(current_position) != xy_pos_t(destination)) { - #if ENABLED(MESH_BED_LEVELING) - mbl.line_to_destination(scaled_fr_mm_s); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(scaled_fr_mm_s); - #endif - return true; - } - #endif - } - #endif // HAS_MESH - - planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); - return false; // caller will update current_position - } - -#endif // !IS_KINEMATIC -#endif // !UBL_SEGMENTED - -#if HAS_DUPLICATION_MODE - bool extruder_duplication_enabled, - mirrored_duplication_mode; - #if ENABLED(MULTI_NOZZLE_DUPLICATION) - uint8_t duplication_e_mask; // = 0 - #endif -#endif - -#if ENABLED(DUAL_X_CARRIAGE) - - DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - float inactive_extruder_x_pos = X2_MAX_POS, // used in mode 0 & 1 - duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 - xyz_pos_t raised_parked_position; // used in mode 1 - bool active_extruder_parked = false; // used in mode 1 & 2 - millis_t delayed_move_time = 0; // used in mode 1 - int16_t duplicate_extruder_temp_offset = 0; // used in mode 2 - - float x_home_pos(const int extruder) { - if (extruder == 0) - return base_home_pos(X_AXIS); - else - /** - * In dual carriage mode the extruder offset provides an override of the - * second X-carriage position when homed - otherwise X2_HOME_POS is used. - * This allows soft recalibration of the second extruder home position - * without firmware reflash (through the M218 command). - */ - return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS; - } - - /** - * Prepare a linear move in a dual X axis setup - * - * Return true if current_position[] was set to destination[] - */ - inline bool dual_x_carriage_unpark() { - if (active_extruder_parked) { - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - break; - case DXC_AUTO_PARK_MODE: - if (current_position.e == destination.e) { - // This is a travel move (with no extrusion) - // Skip it, but keep track of the current position - // (so it can be used as the start of the next non-travel move) - if (delayed_move_time != 0xFFFFFFFFUL) { - current_position = destination; - NOLESS(raised_parked_position.z, destination.z); - delayed_move_time = millis(); - return true; - } - } - // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - - #define CUR_X current_position.x - #define CUR_Y current_position.y - #define CUR_Z current_position.z - #define CUR_E current_position.e - #define RAISED_X raised_parked_position.x - #define RAISED_Y raised_parked_position.y - #define RAISED_Z raised_parked_position.z - - if ( planner.buffer_line(RAISED_X, RAISED_Y, RAISED_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder)) - if (planner.buffer_line( CUR_X, CUR_Y, RAISED_Z, CUR_E, PLANNER_XY_FEEDRATE(), active_extruder)) - line_to_current_position(planner.settings.max_feedrate_mm_s[Z_AXIS]); - delayed_move_time = 0; - active_extruder_parked = false; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Clear active_extruder_parked"); - break; - case DXC_MIRRORED_MODE: - case DXC_DUPLICATION_MODE: - if (active_extruder == 0) { - xyze_pos_t new_pos = current_position; - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) - new_pos.x += duplicate_extruder_x_offset; - else - new_pos.x = inactive_extruder_x_pos; - // move duplicate extruder into correct duplication position. - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Set planner X", inactive_extruder_x_pos, " ... Line to X", new_pos.x); - planner.set_position_mm(inactive_extruder_x_pos, current_position.y, current_position.z, current_position.e); - if (!planner.buffer_line(new_pos, planner.settings.max_feedrate_mm_s[X_AXIS], 1)) break; - planner.synchronize(); - sync_plan_position(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set extruder_duplication_enabled\nClear active_extruder_parked"); - } - else if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Active extruder not 0"); - break; - } - } - stepper.set_directions(); - return false; - } - -#endif // DUAL_X_CARRIAGE - -/** - * Prepare a single move and get ready for the next one - * - * This may result in several calls to planner.buffer_line to - * do smaller moves for DELTA, SCARA, mesh moves, etc. - * - * 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); - - #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) - - if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) { - bool ignore_e = false; - - #if ENABLED(PREVENT_COLD_EXTRUSION) - ignore_e = thermalManager.tooColdToExtrude(active_extruder); - if (ignore_e) SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); - #endif - - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder]; - if (e_delta > (EXTRUDE_MAXLENGTH)) { - #if ENABLED(MIXING_EXTRUDER) - float collector[MIXING_STEPPERS]; - mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector); - MIXER_STEPPER_LOOP(e) { - if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) { - ignore_e = true; - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); - break; - } - } - #else - ignore_e = true; - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); - #endif - } - #endif - - if (ignore_e) { - current_position.e = destination.e; // Behave as if the E move really took place - planner.set_e_position_mm(destination.e); // Prevent the planner from complaining too - } - } - - #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE - - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_unpark()) return; - #endif - - if ( - #if UBL_SEGMENTED - #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 - line_to_destination_kinematic() - #else - prepare_move_to_destination_cartesian() - #endif - ) return; - - current_position = destination; -} - -uint8_t axes_need_homing(uint8_t axis_bits/*=0x07*/) { - #if ENABLED(HOME_AFTER_DEACTIVATE) - #define HOMED_FLAGS axis_known_position - #else - #define HOMED_FLAGS axis_homed - #endif - // 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))) { - PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); - char msg[strlen_P(home_first)+1]; - 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.set_status(msg); - #endif - return true; - } - return false; -} - -/** - * Homing bump feedrate (mm/s) - */ -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 - static const uint8_t homing_bump_divisor[] PROGMEM = HOMING_BUMP_DIVISOR; - uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); - if (hbd < 1) { - hbd = 10; - SERIAL_ECHO_MSG("Warning: Homing Bump Divisor < 1"); - } - return homing_feedrate(axis) / float(hbd); -} - -#if ENABLED(SENSORLESS_HOMING) - /** - * Set sensorless homing if the axis has it, accounting for Core Kinematics. - */ - sensorless_t start_sensorless_homing_per_axis(const AxisEnum axis) { - sensorless_t stealth_states { false }; - - switch (axis) { - default: break; - #if X_SENSORLESS - case X_AXIS: - stealth_states.x = tmc_enable_stallguard(stepperX); - #if AXIS_HAS_STALLGUARD(X2) - stealth_states.x2 = tmc_enable_stallguard(stepperX2); - #endif - #if CORE_IS_XY && Y_SENSORLESS - stealth_states.y = tmc_enable_stallguard(stepperY); - #elif CORE_IS_XZ && Z_SENSORLESS - stealth_states.z = tmc_enable_stallguard(stepperZ); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - stealth_states.y = tmc_enable_stallguard(stepperY); - #if AXIS_HAS_STALLGUARD(Y2) - stealth_states.y2 = tmc_enable_stallguard(stepperY2); - #endif - #if CORE_IS_XY && X_SENSORLESS - stealth_states.x = tmc_enable_stallguard(stepperX); - #elif CORE_IS_YZ && Z_SENSORLESS - stealth_states.z = tmc_enable_stallguard(stepperZ); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - stealth_states.z = tmc_enable_stallguard(stepperZ); - #if AXIS_HAS_STALLGUARD(Z2) - stealth_states.z2 = tmc_enable_stallguard(stepperZ2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - stealth_states.z3 = tmc_enable_stallguard(stepperZ3); - #endif - #if CORE_IS_XZ && X_SENSORLESS - stealth_states.x = tmc_enable_stallguard(stepperX); - #elif CORE_IS_YZ && Y_SENSORLESS - stealth_states.y = tmc_enable_stallguard(stepperY); - #endif - break; - #endif - } - - #if ENABLED(SPI_ENDSTOPS) - switch (axis) { - #if X_SPI_SENSORLESS - case X_AXIS: endstops.tmc_spi_homing.x = true; break; - #endif - #if Y_SPI_SENSORLESS - case Y_AXIS: endstops.tmc_spi_homing.y = true; break; - #endif - #if Z_SPI_SENSORLESS - case Z_AXIS: endstops.tmc_spi_homing.z = true; break; - #endif - default: break; - } - #endif - - #if ENABLED(IMPROVE_HOMING_RELIABILITY) - sg_guard_period = millis() + default_sg_guard_duration; - #endif - - return stealth_states; - } - - void end_sensorless_homing_per_axis(const AxisEnum axis, sensorless_t enable_stealth) { - switch (axis) { - default: break; - #if X_SENSORLESS - case X_AXIS: - tmc_disable_stallguard(stepperX, enable_stealth.x); - #if AXIS_HAS_STALLGUARD(X2) - tmc_disable_stallguard(stepperX2, enable_stealth.x2); - #endif - #if CORE_IS_XY && Y_SENSORLESS - tmc_disable_stallguard(stepperY, enable_stealth.y); - #elif CORE_IS_XZ && Z_SENSORLESS - tmc_disable_stallguard(stepperZ, enable_stealth.z); - #endif - break; - #endif - #if Y_SENSORLESS - case Y_AXIS: - tmc_disable_stallguard(stepperY, enable_stealth.y); - #if AXIS_HAS_STALLGUARD(Y2) - tmc_disable_stallguard(stepperY2, enable_stealth.y2); - #endif - #if CORE_IS_XY && X_SENSORLESS - tmc_disable_stallguard(stepperX, enable_stealth.x); - #elif CORE_IS_YZ && Z_SENSORLESS - tmc_disable_stallguard(stepperZ, enable_stealth.z); - #endif - break; - #endif - #if Z_SENSORLESS - case Z_AXIS: - tmc_disable_stallguard(stepperZ, enable_stealth.z); - #if AXIS_HAS_STALLGUARD(Z2) - tmc_disable_stallguard(stepperZ2, enable_stealth.z2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - tmc_disable_stallguard(stepperZ3, enable_stealth.z3); - #endif - #if CORE_IS_XZ && X_SENSORLESS - tmc_disable_stallguard(stepperX, enable_stealth.x); - #elif CORE_IS_YZ && Y_SENSORLESS - tmc_disable_stallguard(stepperY, enable_stealth.y); - #endif - break; - #endif - } - - #if ENABLED(SPI_ENDSTOPS) - switch (axis) { - #if X_SPI_SENSORLESS - case X_AXIS: endstops.tmc_spi_homing.x = false; break; - #endif - #if Y_SPI_SENSORLESS - case Y_AXIS: endstops.tmc_spi_homing.y = false; break; - #endif - #if Z_SPI_SENSORLESS - case Z_AXIS: endstops.tmc_spi_homing.z = false; break; - #endif - default: break; - } - #endif - } - -#endif // SENSORLESS_HOMING - -/** - * Home an individual linear axis - */ -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, ", "); - if (fr_mm_s) - DEBUG_ECHO(fr_mm_s); - else - DEBUG_ECHOPAIR("[", homing_feedrate(axis), "]"); - DEBUG_ECHOLNPGM(")"); - } - - #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - thermalManager.wait_for_bed(); - ui.reset_status(); - } - #endif - - // Only do some things when moving towards an endstop - const int8_t axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - (axis == X_AXIS) ? x_home_dir(active_extruder) : - #endif - home_dir(axis); - const bool is_home_dir = (axis_home_dir > 0) == (distance > 0); - - #if ENABLED(SENSORLESS_HOMING) - sensorless_t stealth_states; - #endif - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(true); - #endif - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - stealth_states = start_sensorless_homing_per_axis(axis); - #endif - } - - const feedRate_t real_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; - line_to_current_position(real_fr_mm_s); - #else - abce_pos_t target = { 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; - planner.set_machine_position_mm(target); - target[axis] = distance; - - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - const xyze_float_t delta_mm_cart{0}; - #endif - - // Set delta/cartesian axes directly - planner.buffer_segment(target - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , delta_mm_cart - #endif - , real_fr_mm_s, active_extruder - ); - #endif - - planner.synchronize(); - - if (is_home_dir) { - - #if HOMING_Z_WITH_PROBE && QUIET_PROBING - if (axis == Z_AXIS) probing_pause(false); - #endif - - endstops.validate_homing_move(); - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_HOMING) - end_sensorless_homing_per_axis(axis, stealth_states); - #endif - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< do_homing_move(", axis_codes[axis], ")"); -} - -/** - * Set an axis' current position to its home position (after homing). - * - * For Core and Cartesian robots this applies one-to-one when an - * individual axis has been homed. - * - * DELTA should wait until all homing is done before setting the XYZ - * current_position to home, because homing is a single operation. - * In the case where the axis positions are already known and previously - * homed, DELTA could home to X or Y individually by moving either one - * to the center. However, homing Z always homes XY and Z. - * - * SCARA should wait until all XY homing is done before setting the XY - * current_position to home, because neither X nor Y is at home until - * both are at home. Z can however be homed individually. - * - * Callers must sync the planner position after calling this! - */ -void set_axis_is_at_home(const AxisEnum axis) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> set_axis_is_at_home(", axis_codes[axis], ")"); - - SBI(axis_known_position, axis); - SBI(axis_homed, axis); - - #if ENABLED(DUAL_X_CARRIAGE) - if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { - current_position.x = x_home_pos(active_extruder); - return; - } - #endif - - #if ENABLED(MORGAN_SCARA) - scara_set_axis_is_at_home(axis); - #elif ENABLED(DELTA) - current_position[axis] = (axis == Z_AXIS ? delta_height - #if HAS_BED_PROBE - - probe_offset.z - #endif - : base_home_pos(axis)); - #else - current_position[axis] = base_home_pos(axis); - #endif - - /** - * Z Probe Z Homing? Account for the probe's Z offset. - */ - #if HAS_BED_PROBE && Z_HOME_DIR < 0 - if (axis == Z_AXIS) { - #if HOMING_Z_WITH_PROBE - - current_position.z -= probe_offset.z; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> probe_offset.z = ", probe_offset.z); - - #else - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("*** Z HOMED TO ENDSTOP ***"); - - #endif - } - #endif - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.homed(axis); - #endif - - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - babystep.reset_total(axis); - #endif - - #if HAS_POSITION_SHIFT - position_shift[axis] = 0; - update_workspace_offset(axis); - #endif - - if (DEBUGGING(LEVELING)) { - #if HAS_HOME_OFFSET - DEBUG_ECHOLNPAIR("> home_offset[", axis_codes[axis], "] = ", home_offset[axis]); - #endif - DEBUG_POS("", current_position); - DEBUG_ECHOLNPAIR("<<< set_axis_is_at_home(", axis_codes[axis], ")"); - } -} - -/** - * Set an axis' to be unhomed. - */ -void set_axis_is_not_at_home(const AxisEnum axis) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> set_axis_is_not_at_home(", axis_codes[axis], ")"); - - CBI(axis_known_position, axis); - CBI(axis_homed, axis); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< set_axis_is_not_at_home(", axis_codes[axis], ")"); - - #if ENABLED(I2C_POSITION_ENCODERS) - I2CPEM.unhomed(axis); - #endif -} - -/** - * Home an individual "raw axis" to its endstop. - * This applies to XYZ on Cartesian and Core robots, and - * to the individual ABC steppers on DELTA and SCARA. - * - * At the end of the procedure the axis is marked as - * homed and the current position of that axis is updated. - * Kinematic robots should wait till all axes are homed - * before updating the current position. - */ - -void homeaxis(const AxisEnum axis) { - - #if IS_SCARA - // Only Z homing (with probe) is permitted - if (axis != Z_AXIS) { BUZZ(100, 880); return; } - #else - #define _CAN_HOME(A) \ - (axis == _AXIS(A) && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0))) - #if X_SPI_SENSORLESS - #define CAN_HOME_X true - #else - #define CAN_HOME_X _CAN_HOME(X) - #endif - #if Y_SPI_SENSORLESS - #define CAN_HOME_Y true - #else - #define CAN_HOME_Y _CAN_HOME(Y) - #endif - #if Z_SPI_SENSORLESS - #define CAN_HOME_Z true - #else - #define CAN_HOME_Z _CAN_HOME(Z) - #endif - if (!CAN_HOME_X && !CAN_HOME_Y && !CAN_HOME_Z) return; - #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> homeaxis(", axis_codes[axis], ")"); - - const int axis_home_dir = ( - #if ENABLED(DUAL_X_CARRIAGE) - axis == X_AXIS ? x_home_dir(active_extruder) : - #endif - home_dir(axis) - ); - - // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && DEPLOY_PROBE()) return; - #endif - - // Set flags for X, Y, Z motor locking - #if HAS_EXTRA_ENDSTOPS - switch (axis) { - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if Z_MULTI_ENDSTOPS - case Z_AXIS: - #endif - stepper.set_separate_multi_axis(true); - default: break; - } - #endif - - // Fast move towards endstop until triggered - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 1 Fast:"); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - if (axis == Z_AXIS && bltouch.deploy()) return; // The initial DEPLOY - #endif - - do_homing_move(axis, 1.5f * max_length( - #if ENABLED(DELTA) - Z_AXIS - #else - axis - #endif - ) * axis_home_dir - ); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE) - #endif - - // When homing Z with probe respect probe clearance - const float bump = axis_home_dir * ( - #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS && (Z_HOME_BUMP_MM)) ? _MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_HOME_BUMP_MM) : - #endif - home_bump_mm(axis) - ); - - // If a second homing move is configured... - if (bump) { - // Move away from the endstop by the axis HOME_BUMP_MM - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:"); - do_homing_move(axis, -bump - #if HOMING_Z_WITH_PROBE - , MMM_TO_MMS(axis == Z_AXIS ? Z_PROBE_SPEED_FAST : 0) - #endif - ); - - // Slow move towards endstop until triggered - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 2 Slow:"); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE) - #endif - - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); - - #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) - if (axis == Z_AXIS) bltouch.stow(); // The final STOW - #endif - } - - #if HAS_EXTRA_ENDSTOPS - const bool pos_dir = axis_home_dir > 0; - #if ENABLED(X_DUAL_ENDSTOPS) - if (axis == X_AXIS) { - const float adj = ABS(endstops.x2_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.x2_endstop_adj > 0) : (endstops.x2_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_x_lock(false); - stepper.set_x2_lock(false); - } - } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - if (axis == Y_AXIS) { - const float adj = ABS(endstops.y2_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.y2_endstop_adj > 0) : (endstops.y2_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_y_lock(false); - stepper.set_y2_lock(false); - } - } - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (axis == Z_AXIS) { - const float adj = ABS(endstops.z2_endstop_adj); - if (adj) { - if (pos_dir ? (endstops.z2_endstop_adj > 0) : (endstops.z2_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - do_homing_move(axis, pos_dir ? -adj : adj); - stepper.set_z_lock(false); - stepper.set_z2_lock(false); - } - } - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) - if (axis == Z_AXIS) { - // we push the function pointers for the stepper lock function into an array - void (*lock[3]) (bool)= {&stepper.set_z_lock, &stepper.set_z2_lock, &stepper.set_z3_lock}; - float adj[3] = {0, endstops.z2_endstop_adj, endstops.z3_endstop_adj}; - - void (*tempLock) (bool); - float tempAdj; - - // manual bubble sort by adjust value - if (adj[1] < adj[0]) { - tempLock = lock[0], tempAdj = adj[0]; - lock[0] = lock[1], adj[0] = adj[1]; - lock[1] = tempLock, adj[1] = tempAdj; - } - if (adj[2] < adj[1]) { - tempLock = lock[1], tempAdj = adj[1]; - lock[1] = lock[2], adj[1] = adj[2]; - lock[2] = tempLock, adj[2] = tempAdj; - } - if (adj[1] < adj[0]) { - tempLock = lock[0], tempAdj = adj[0]; - lock[0] = lock[1], adj[0] = adj[1]; - lock[1] = tempLock, adj[1] = tempAdj; - } - - if (pos_dir) { - // normalize adj to smallest value and do the first move - (*lock[0])(true); - do_homing_move(axis, adj[1] - adj[0]); - // lock the second stepper for the final correction - (*lock[1])(true); - do_homing_move(axis, adj[2] - adj[1]); - } - else { - (*lock[2])(true); - do_homing_move(axis, adj[1] - adj[2]); - (*lock[1])(true); - do_homing_move(axis, adj[0] - adj[1]); - } - - stepper.set_z_lock(false); - stepper.set_z2_lock(false); - stepper.set_z3_lock(false); - } - #endif - - // Reset flags for X, Y, Z motor locking - switch (axis) { - #if ENABLED(X_DUAL_ENDSTOPS) - case X_AXIS: - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - case Y_AXIS: - #endif - #if Z_MULTI_ENDSTOPS - case Z_AXIS: - #endif - stepper.set_separate_multi_axis(false); - default: break; - } - #endif - - #if IS_SCARA - - set_axis_is_at_home(axis); - sync_plan_position(); - - #elif ENABLED(DELTA) - - // Delta has already moved all three towers up in G28 - // so here it re-homes each tower in turn. - // Delta homing treats the axes as normal linear axes. - - // retrace by the amount specified in delta_endstop_adj + additional dist in order to have minimum steps - if (delta_endstop_adj[axis] * Z_HOME_DIR <= 0) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("delta_endstop_adj:"); - do_homing_move(axis, delta_endstop_adj[axis] - (MIN_STEPS_PER_SEGMENT + 1) * planner.steps_to_mm[axis] * Z_HOME_DIR); - } - - #else // CARTESIAN / CORE - - set_axis_is_at_home(axis); - sync_plan_position(); - - destination[axis] = current_position[axis]; - - if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); - - #endif - - // Put away the Z probe - #if HOMING_Z_WITH_PROBE - if (axis == Z_AXIS && STOW_PROBE()) return; - #endif - - #ifdef HOMING_BACKOFF_MM - constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; - const float backoff_mm = endstop_backoff[ - #if ENABLED(DELTA) - Z_AXIS - #else - axis - #endif - ]; - if (backoff_mm) { - current_position[axis] -= ABS(backoff_mm) * axis_home_dir; - line_to_current_position( - #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : - #endif - homing_feedrate(axis) - ); - } - #endif - - // Clear retracted status if homing the Z axis - #if ENABLED(FWRETRACT) - if (axis == Z_AXIS) fwretract.current_hop = 0.0; - #endif - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< homeaxis(", axis_codes[axis], ")"); - -} // homeaxis() - -#if HAS_WORKSPACE_OFFSET - void update_workspace_offset(const AxisEnum axis) { - workspace_offset[axis] = home_offset[axis] + position_shift[axis]; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Axis ", axis_codes[axis], " home_offset = ", home_offset[axis], " position_shift = ", position_shift[axis]); - } -#endif - -#if HAS_M206_COMMAND - /** - * Change the home offset for an axis. - * Also refreshes the workspace offset. - */ - void set_home_offset(const AxisEnum axis, const float v) { - home_offset[axis] = v; - update_workspace_offset(axis); - } -#endif // HAS_M206_COMMAND diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.h deleted file mode 100644 index 2e8ff64f52..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/motion.h +++ /dev/null @@ -1,411 +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 - -/** - * motion.h - * - * High-level motion commands to feed the planner - * Some of these methods may migrate to the planner class. - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - #include "probe.h" -#endif - -#if IS_SCARA - #include "scara.h" -#endif - -// Axis homed and known-position states -extern uint8_t axis_homed, axis_known_position; -constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); -FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; } -FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; } -FORCE_INLINE void set_all_unhomed() { axis_homed = 0; } -FORCE_INLINE void set_all_unknown() { axis_known_position = 0; } - -FORCE_INLINE bool homing_needed() { - return !( - #if ENABLED(HOME_AFTER_DEACTIVATE) - all_axes_known() - #else - all_axes_homed() - #endif - ); -} - -// Error margin to work around float imprecision -constexpr float slop = 0.0001; - -extern bool relative_mode; - -extern xyze_pos_t current_position, // High-level current tool position - destination; // Destination for a move - -// Scratch space for a cartesian result -extern xyz_pos_t cartes; - -// Until kinematics.cpp is created, declare this here -#if IS_KINEMATIC - extern abc_pos_t delta; -#endif - -#if HAS_ABL_NOT_UBL - extern float xy_probe_feedrate_mm_s; - #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s -#elif defined(XY_PROBE_SPEED) - #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_SPEED) -#else - #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() -#endif - -#if ENABLED(Z_SAFE_HOMING) - constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT }; -#endif - -/** - * Feed rates are often configured with mm/m - * but the planner and stepper like mm/s units. - */ -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 feedRate_t feedrate_mm_s; - -/** - * Feedrate scaling - */ -extern int16_t feedrate_percentage; - -// The active extruder (tool). Set with T command. -#if EXTRUDERS > 1 - extern uint8_t active_extruder; -#else - constexpr uint8_t active_extruder = 0; -#endif - -#if ENABLED(LCD_SHOW_E_TOTAL) - extern float e_move_accumulator; -#endif - -FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float(p); } -FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); } - -#define XYZ_DEFS(T, NAME, OPT) \ - extern const XYZval NAME##_P; \ - FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); } - -XYZ_DEFS(float, base_min_pos, MIN_POS); -XYZ_DEFS(float, base_max_pos, MAX_POS); -XYZ_DEFS(float, base_home_pos, HOME_POS); -XYZ_DEFS(float, max_length, MAX_LENGTH); -XYZ_DEFS(float, home_bump_mm, HOME_BUMP_MM); -XYZ_DEFS(signed char, home_dir, HOME_DIR); - -#if HAS_WORKSPACE_OFFSET - void update_workspace_offset(const AxisEnum axis); -#else - #define update_workspace_offset(x) NOOP -#endif - -#if HAS_HOTEND_OFFSET - extern xyz_pos_t hotend_offset[HOTENDS]; - void reset_hotend_offsets(); -#elif HOTENDS - constexpr xyz_pos_t hotend_offset[HOTENDS] = { { 0 } }; -#else - constexpr xyz_pos_t hotend_offset[1] = { { 0 } }; -#endif - -typedef struct { xyz_pos_t min, max; } axis_limits_t; -#if HAS_SOFTWARE_ENDSTOPS - extern bool soft_endstops_enabled; - extern axis_limits_t soft_endstop; - void apply_motion_limits(xyz_pos_t &target); - void update_software_endstops(const AxisEnum axis - #if HAS_HOTEND_OFFSET - , const uint8_t old_tool_index=0, const uint8_t new_tool_index=0 - #endif - ); -#else - constexpr bool soft_endstops_enabled = false; - //constexpr axis_limits_t soft_endstop = { - // { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, - // { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } }; - #define apply_motion_limits(V) NOOP - #define update_software_endstops(...) NOOP -#endif - -void report_current_position(); - -void get_cartesian_from_steppers(); -void set_current_from_steppers_for_axis(const AxisEnum axis); - -/** - * sync_plan_position - * - * Set the planner/stepper positions directly from current_position with - * no kinematic translation. Used for homing axes and cartesian/core syncing. - */ -void sync_plan_position(); -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 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 feedRate_t &fr_mm_s=0.0f); -void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); -void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); -void do_blocking_move_to(const xyze_pos_t &raw, 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); -void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); -FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); } -FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); } - -void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f); -FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); } -FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); } - -void remember_feedrate_and_scaling(); -void remember_feedrate_scaling_off(); -void restore_feedrate_and_scaling(); - -// -// Homing -// - -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()) -#else - #define MOTION_CONDITIONS IsRunning() -#endif - -void set_axis_is_at_home(const AxisEnum axis); - -void set_axis_is_not_at_home(const AxisEnum axis); - -void homeaxis(const AxisEnum axis); - -/** - * Workspace offsets - */ -#if HAS_HOME_OFFSET || HAS_POSITION_SHIFT - #if HAS_HOME_OFFSET - extern xyz_pos_t home_offset; - #endif - #if HAS_POSITION_SHIFT - extern xyz_pos_t position_shift; - #endif - #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - extern xyz_pos_t workspace_offset; - #define _WS workspace_offset - #elif HAS_HOME_OFFSET - #define _WS home_offset - #else - #define _WS position_shift - #endif - #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + _WS[AXIS]) - #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - _WS[AXIS]) - FORCE_INLINE void toLogical(xy_pos_t &raw) { raw += _WS; } - FORCE_INLINE void toLogical(xyz_pos_t &raw) { raw += _WS; } - FORCE_INLINE void toLogical(xyze_pos_t &raw) { raw += _WS; } - FORCE_INLINE void toNative(xy_pos_t &raw) { raw -= _WS; } - FORCE_INLINE void toNative(xyz_pos_t &raw) { raw -= _WS; } - FORCE_INLINE void toNative(xyze_pos_t &raw) { raw -= _WS; } -#else - #define NATIVE_TO_LOGICAL(POS, AXIS) (POS) - #define LOGICAL_TO_NATIVE(POS, AXIS) (POS) - FORCE_INLINE void toLogical(xy_pos_t&) {} - FORCE_INLINE void toLogical(xyz_pos_t&) {} - FORCE_INLINE void toLogical(xyze_pos_t&) {} - FORCE_INLINE void toNative(xy_pos_t&) {} - FORCE_INLINE void toNative(xyz_pos_t&) {} - FORCE_INLINE void toNative(xyze_pos_t&) {} -#endif -#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) -#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) -#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) -#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS) -#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS) -#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) - -/** - * position_is_reachable family of functions - */ - -#if IS_KINEMATIC // (DELTA or SCARA) - #if HAS_SCARA_OFFSET - extern abc_pos_t scara_home_offset; // A and B angular offsets, Z mm offset - #endif - - // Return true if the given point is within the printable area - inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) { - #if ENABLED(DELTA) - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + slop); - #elif IS_SCARA - const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); - #endif - } - - inline bool position_is_reachable(const xy_pos_t &pos, const float inset=0) { - return position_is_reachable(pos.x, pos.y, inset); - } - - #if HAS_BED_PROBE - // 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 - probe_offset.x, ry - probe_offset.y) - && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); - } - #endif - -#else // CARTESIAN - - // Return true if the given position is within the machine bounds. - inline bool position_is_reachable(const float &rx, const float &ry) { - if (!WITHIN(ry, Y_MIN_POS - slop, Y_MAX_POS + slop)) return false; - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder) - return WITHIN(rx, X2_MIN_POS - slop, X2_MAX_POS + slop); - else - return WITHIN(rx, X1_MIN_POS - slop, X1_MAX_POS + slop); - #else - return WITHIN(rx, X_MIN_POS - slop, X_MAX_POS + slop); - #endif - } - inline bool position_is_reachable(const xy_pos_t &pos) { return position_is_reachable(pos.x, pos.y); } - - #if HAS_BED_PROBE - /** - * Return whether the given position is within the bed, and whether the nozzle - * can reach the position required to put the probe at the given position. - * - * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the - * 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 - probe_offset.x, ry - probe_offset.y) - && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop) - && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop); - } - #endif - -#endif // CARTESIAN - -#if !HAS_BED_PROBE - FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } -#endif -FORCE_INLINE bool position_is_reachable_by_probe(const xy_pos_t &pos) { return position_is_reachable_by_probe(pos.x, pos.y); } - -/** - * Duplication mode - */ -#if HAS_DUPLICATION_MODE - extern bool extruder_duplication_enabled, // Used in Dual X mode 2 - mirrored_duplication_mode; // Used in Dual X mode 3 - #if ENABLED(MULTI_NOZZLE_DUPLICATION) - extern uint8_t duplication_e_mask; - #endif -#endif - -/** - * Dual X Carriage - */ -#if ENABLED(DUAL_X_CARRIAGE) - - enum DualXMode : char { - DXC_FULL_CONTROL_MODE, - DXC_AUTO_PARK_MODE, - DXC_DUPLICATION_MODE, - DXC_MIRRORED_MODE - }; - - extern DualXMode dual_x_carriage_mode; - extern float inactive_extruder_x_pos, // Used in mode 0 & 1 - duplicate_extruder_x_offset; // Used in mode 2 & 3 - extern xyz_pos_t raised_parked_position; // Used in mode 1 - extern bool active_extruder_parked; // Used in mode 1, 2 & 3 - extern millis_t delayed_move_time; // Used in mode 1 - extern int16_t duplicate_extruder_temp_offset; // Used in mode 2 & 3 - - FORCE_INLINE bool dxc_is_duplicating() { return dual_x_carriage_mode >= DXC_DUPLICATION_MODE; } - - float x_home_pos(const int extruder); - - FORCE_INLINE int x_home_dir(const uint8_t extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } - -#elif ENABLED(MULTI_NOZZLE_DUPLICATION) - - enum DualXMode : char { - DXC_DUPLICATION_MODE = 2 - }; - -#endif - -#if HAS_M206_COMMAND - void set_home_offset(const AxisEnum axis, const float v); -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.cpp deleted file mode 100644 index c95426154f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.cpp +++ /dev/null @@ -1,2817 +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 . - * - */ - -/** - * planner.cpp - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * The ring buffer implementation gleaned from the wiring_serial library by David A. Mellis. - * - * - * Reasoning behind the mathematics in this module (in the key of 'Mathematica'): - * - * s == speed, a == acceleration, t == time, d == distance - * - * Basic definitions: - * Speed[s_, a_, t_] := s + (a*t) - * Travel[s_, a_, t_] := Integrate[Speed[s, a, t], t] - * - * Distance to reach a specific speed with a constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, d, t] - * d -> (m^2 - s^2)/(2 a) --> estimate_acceleration_distance() - * - * Speed after a given distance of travel with constant acceleration: - * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, m, t] - * m -> Sqrt[2 a d + s^2] - * - * DestinationSpeed[s_, a_, d_] := Sqrt[2 a d + s^2] - * - * When to start braking (di) to reach a specified destination speed (s2) after accelerating - * from initial speed s1 without ever stopping at a plateau: - * Solve[{DestinationSpeed[s1, a, di] == DestinationSpeed[s2, a, d - di]}, di] - * di -> (2 a d - s1^2 + s2^2)/(4 a) --> intersection_distance() - * - * IntersectionDistance[s1_, s2_, a_, d_] := (2 a d - s1^2 + s2^2)/(4 a) - * - * -- - * - * The fast inverse function needed for Bézier interpolation for AVR - * was designed, written and tested by Eduardo José Tagle on April/2018 - */ - -#include "planner.h" -#include "stepper.h" -#include "motion.h" -#include "temperature.h" -#include "../lcd/ultralcd.h" -#include "../core/language.h" -#include "../gcode/parser.h" - -#include "../Marlin.h" - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #include "../feature/filwidth.h" -#endif - -#if ENABLED(BARICUDA) - #include "../feature/baricuda.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../feature/mixing.h" -#endif - -#if ENABLED(AUTO_POWER_CONTROL) - #include "../feature/power.h" -#endif - -#if ENABLED(BACKLASH_COMPENSATION) - #include "../feature/backlash.h" -#endif - -#if ENABLED(CANCEL_OBJECTS) - #include "../feature/cancel_object.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../feature/power_loss_recovery.h" -#endif - -#if HAS_CUTTER - #include "../feature/spindle_laser.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 - -Planner planner; - - // public: - -/** - * A ring buffer of moves described in steps - */ -block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; -volatile uint8_t Planner::block_buffer_head, // Index of the next block to be pushed - Planner::block_buffer_nonbusy, // Index of the first non-busy block - Planner::block_buffer_planned, // Index of the optimally planned block - Planner::block_buffer_tail; // Index of the busy block, if any -uint16_t Planner::cleaning_buffer_counter; // A counter to disable queuing of blocks -uint8_t Planner::delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - -planner_settings_t Planner::settings; // Initialized by settings.load() - -uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2 - -float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step - -#if DISABLED(CLASSIC_JERK) - float Planner::junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm - #else - float Planner::max_e_jerk; - #endif - #endif -#endif -#if HAS_CLASSIC_JERK - #if HAS_LINEAR_E_JERK - xyz_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. - #else - xyze_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif -#endif - -#if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - bool Planner::abort_on_endstop_hit = false; -#endif - -#if ENABLED(DISTINCT_E_FACTORS) - uint8_t Planner::last_extruder = 0; // Respond to extruder change -#endif - -#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 - Planner::volumetric_area_nominal = CIRCLE_AREA(float(DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5f), // Nominal cross-sectional area - Planner::volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner -#endif - -#if HAS_LEVELING - bool Planner::leveling_active = false; // Flag that auto bed leveling is enabled - #if ABL_PLANAR - matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float Planner::z_fade_height, // Initialized by settings.load() - Planner::inverse_z_fade_height, - Planner::last_fade_z; - #endif -#else - constexpr bool Planner::leveling_active; -#endif - -skew_factor_t Planner::skew_factor; // Initialized by settings.load() - -#if ENABLED(AUTOTEMP) - float Planner::autotemp_max = 250, - Planner::autotemp_min = 210, - Planner::autotemp_factor = 0.1f; - bool Planner::autotemp_enabled = false; -#endif - -// private: - -xyze_long_t Planner::position{0}; - -uint32_t Planner::cutoff_long; - -xyze_float_t Planner::previous_speed; -float Planner::previous_nominal_speed_sqr; - -#if ENABLED(DISABLE_INACTIVE_EXTRUDER) - uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; -#endif - -#ifdef XY_FREQUENCY_LIMIT - // Old direction bits. Used for speed calculations - unsigned char Planner::old_direction_bits = 0; - // Segment times (in µs). Used for speed calculations - xy_ulong_t Planner::axis_segment_time_us[3] = { { MAX_FREQ_TIME_US + 1, MAX_FREQ_TIME_US + 1 } }; -#endif - -#if ENABLED(LIN_ADVANCE) - float Planner::extruder_advance_K[EXTRUDERS]; // Initialized by settings.load() -#endif - -#if HAS_POSITION_FLOAT - xyze_pos_t Planner::position_float; // Needed for accurate maths. Steps cannot be used! -#endif - -#if IS_KINEMATIC - xyze_pos_t Planner::position_cart; -#endif - -#if HAS_SPI_LCD - volatile uint32_t Planner::block_buffer_runtime_us = 0; -#endif - -/** - * Class and Instance Methods - */ - -Planner::Planner() { init(); } - -void Planner::init() { - position.reset(); - #if HAS_POSITION_FLOAT - position_float.reset(); - #endif - #if IS_KINEMATIC - position_cart.reset(); - #endif - previous_speed.reset(); - previous_nominal_speed_sqr = 0; - #if ABL_PLANAR - bed_level_matrix.set_to_identity(); - #endif - clear_block_buffer(); - delay_before_delivering = 0; -} - -#if ENABLED(S_CURVE_ACCELERATION) - #ifdef __AVR__ - /** - * This routine returns 0x1000000 / d, getting the inverse as fast as possible. - * A fast-converging iterative Newton-Raphson method can reach full precision in - * just 1 iteration, and takes 211 cycles (worst case; the mean case is less, up - * to 30 cycles for small divisors), instead of the 500 cycles a normal division - * would take. - * - * Inspired by the following page: - * https://stackoverflow.com/questions/27801397/newton-raphson-division-with-big-integers - * - * Suppose we want to calculate floor(2 ^ k / B) where B is a positive integer - * Then, B must be <= 2^k, otherwise, the quotient is 0. - * - * The Newton - Raphson iteration for x = B / 2 ^ k yields: - * q[n + 1] = q[n] * (2 - q[n] * B / 2 ^ k) - * - * This can be rearranged to: - * q[n + 1] = q[n] * (2 ^ (k + 1) - q[n] * B) >> k - * - * Each iteration requires only integer multiplications and bit shifts. - * It doesn't necessarily converge to floor(2 ^ k / B) but in the worst case - * it eventually alternates between floor(2 ^ k / B) and ceil(2 ^ k / B). - * So it checks for this case and extracts floor(2 ^ k / B). - * - * A simple but important optimization for this approach is to truncate - * multiplications (i.e., calculate only the higher bits of the product) in the - * early iterations of the Newton - Raphson method. This is done so the results - * of the early iterations are far from the quotient. Then it doesn't matter if - * they are done inaccurately. - * It's important to pick a good starting value for x. Knowing how many - * digits the divisor has, it can be estimated: - * - * 2^k / x = 2 ^ log2(2^k / x) - * 2^k / x = 2 ^(log2(2^k)-log2(x)) - * 2^k / x = 2 ^(k*log2(2)-log2(x)) - * 2^k / x = 2 ^ (k-log2(x)) - * 2^k / x >= 2 ^ (k-floor(log2(x))) - * floor(log2(x)) is simply the index of the most significant bit set. - * - * If this estimation can be improved even further the number of iterations can be - * reduced a lot, saving valuable execution time. - * The paper "Software Integer Division" by Thomas L.Rodeheffer, Microsoft - * Research, Silicon Valley,August 26, 2008, available at - * https://www.microsoft.com/en-us/research/wp-content/uploads/2008/08/tr-2008-141.pdf - * suggests, for its integer division algorithm, using a table to supply the first - * 8 bits of precision, then, due to the quadratic convergence nature of the - * Newton-Raphon iteration, just 2 iterations should be enough to get maximum - * precision of the division. - * By precomputing values of inverses for small denominator values, just one - * Newton-Raphson iteration is enough to reach full precision. - * This code uses the top 9 bits of the denominator as index. - * - * The AVR assembly function implements this C code using the data below: - * - * // For small divisors, it is best to directly retrieve the results - * if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - * - * // Compute initial estimation of 0x1000000/x - - * // Get most significant bit set on divider - * uint8_t idx = 0; - * uint32_t nr = d; - * if (!(nr & 0xFF0000)) { - * nr <<= 8; idx += 8; - * if (!(nr & 0xFF0000)) { nr <<= 8; idx += 8; } - * } - * if (!(nr & 0xF00000)) { nr <<= 4; idx += 4; } - * if (!(nr & 0xC00000)) { nr <<= 2; idx += 2; } - * if (!(nr & 0x800000)) { nr <<= 1; idx += 1; } - * - * // Isolate top 9 bits of the denominator, to be used as index into the initial estimation table - * uint32_t tidx = nr >> 15, // top 9 bits. bit8 is always set - * ie = inv_tab[tidx & 0xFF] + 256, // Get the table value. bit9 is always set - * x = idx <= 8 ? (ie >> (8 - idx)) : (ie << (idx - 8)); // Position the estimation at the proper place - * - * x = uint32_t((x * uint64_t(_BV(25) - x * d)) >> 24); // Refine estimation by newton-raphson. 1 iteration is enough - * const uint32_t r = _BV(24) - x * d; // Estimate remainder - * if (r >= d) x++; // Check whether to adjust result - * return uint32_t(x); // x holds the proper estimation - * - */ - static uint32_t get_period_inverse(uint32_t d) { - - static const uint8_t inv_tab[256] PROGMEM = { - 255,253,252,250,248,246,244,242,240,238,236,234,233,231,229,227, - 225,224,222,220,218,217,215,213,212,210,208,207,205,203,202,200, - 199,197,195,194,192,191,189,188,186,185,183,182,180,179,178,176, - 175,173,172,170,169,168,166,165,164,162,161,160,158,157,156,154, - 153,152,151,149,148,147,146,144,143,142,141,139,138,137,136,135, - 134,132,131,130,129,128,127,126,125,123,122,121,120,119,118,117, - 116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101, - 100,99,98,97,96,95,94,93,92,91,90,89,88,88,87,86, - 85,84,83,82,81,80,80,79,78,77,76,75,74,74,73,72, - 71,70,70,69,68,67,66,66,65,64,63,62,62,61,60,59, - 59,58,57,56,56,55,54,53,53,52,51,50,50,49,48,48, - 47,46,46,45,44,43,43,42,41,41,40,39,39,38,37,37, - 36,35,35,34,33,33,32,32,31,30,30,29,28,28,27,27, - 26,25,25,24,24,23,22,22,21,21,20,19,19,18,18,17, - 17,16,15,15,14,14,13,13,12,12,11,10,10,9,9,8, - 8,7,7,6,6,5,5,4,4,3,3,2,2,1,0,0 - }; - - // For small denominators, it is cheaper to directly store the result. - // For bigger ones, just ONE Newton-Raphson iteration is enough to get - // maximum precision we need - static const uint32_t small_inv_tab[111] PROGMEM = { - 16777216,16777216,8388608,5592405,4194304,3355443,2796202,2396745,2097152,1864135,1677721,1525201,1398101,1290555,1198372,1118481, - 1048576,986895,932067,883011,838860,798915,762600,729444,699050,671088,645277,621378,599186,578524,559240,541200, - 524288,508400,493447,479349,466033,453438,441505,430185,419430,409200,399457,390167,381300,372827,364722,356962, - 349525,342392,335544,328965,322638,316551,310689,305040,299593,294337,289262,284359,279620,275036,270600,266305, - 262144,258111,254200,250406,246723,243148,239674,236298,233016,229824,226719,223696,220752,217885,215092,212369, - 209715,207126,204600,202135,199728,197379,195083,192841,190650,188508,186413,184365,182361,180400,178481,176602, - 174762,172960,171196,169466,167772,166111,164482,162885,161319,159783,158275,156796,155344,153919,152520 - }; - - // For small divisors, it is best to directly retrieve the results - if (d <= 110) return pgm_read_dword(&small_inv_tab[d]); - - uint8_t r8 = d & 0xFF, - r9 = (d >> 8) & 0xFF, - r10 = (d >> 16) & 0xFF, - r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18; - const uint8_t* ptab = inv_tab; - - __asm__ __volatile__( - // %8:%7:%6 = interval - // r31:r30: MUST be those registers, and they must point to the inv_tab - - A("clr %13") // %13 = 0 - - // Now we must compute - // result = 0xFFFFFF / d - // %8:%7:%6 = interval - // %16:%15:%14 = nr - // %13 = 0 - - // A plain division of 24x24 bits should take 388 cycles to complete. We will - // use Newton-Raphson for the calculation, and will strive to get way less cycles - // for the same result - Using C division, it takes 500cycles to complete . - - A("clr %3") // idx = 0 - A("mov %14,%6") - A("mov %15,%7") - A("mov %16,%8") // nr = interval - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") - A("mov %15,%14") // nr <<= 8, %14 not needed - A("subi %3,-8") // idx += 8 - A("tst %16") // nr & 0xFF0000 == 0 ? - A("brne 2f") // No, skip this - A("mov %16,%15") // nr <<= 8, %14 not needed - A("clr %15") // We clear %14 - A("subi %3,-8") // idx += 8 - - // here %16 != 0 and %16:%15 contains at least 9 MSBits, or both %16:%15 are 0 - L("2") - A("cpi %16,0x10") // (nr & 0xF00000) == 0 ? - A("brcc 3f") // No, skip this - A("swap %15") // Swap nibbles - A("swap %16") // Swap nibbles. Low nibble is 0 - A("mov %14, %15") - A("andi %14,0x0F") // Isolate low nibble - A("andi %15,0xF0") // Keep proper nibble in %15 - A("or %16, %14") // %16:%15 <<= 4 - A("subi %3,-4") // idx += 4 - - L("3") - A("cpi %16,0x40") // (nr & 0xC00000) == 0 ? - A("brcc 4f") // No, skip this - A("add %15,%15") - A("adc %16,%16") - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 2 - A("subi %3,-2") // idx += 2 - - L("4") - A("cpi %16,0x80") // (nr & 0x800000) == 0 ? - A("brcc 5f") // No, skip this - A("add %15,%15") - A("adc %16,%16") // %16:%15 <<= 1 - A("inc %3") // idx += 1 - - // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure - // we have at least 9 MSBits available to enter the initial estimation table - L("5") - A("add %15,%15") - A("adc %16,%16") // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table) - A("add r30,%16") // Only use top 8 bits - A("adc r31,%13") // r31:r30 = inv_tab + (tidx) - A("lpm %14, Z") // %14 = inv_tab[tidx] - A("ldi %15, 1") // %15 = 1 %15:%14 = inv_tab[tidx] + 256 - - // We must scale the approximation to the proper place - A("clr %16") // %16 will always be 0 here - A("subi %3,8") // idx == 8 ? - A("breq 6f") // yes, no need to scale - A("brcs 7f") // If C=1, means idx < 8, result was negative! - - // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8] - A("sbrs %3,0") // shift by 1bit position? - A("rjmp 8f") // No - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("8") - A("sbrs %3,1") // shift by 2bit position? - A("rjmp 9f") // No - A("add %14,%14") - A("adc %15,%15") - A("add %14,%14") - A("adc %15,%15") // %15:16 <<= 1 - L("9") - A("sbrs %3,2") // shift by 4bits position? - A("rjmp 16f") // No - A("swap %15") // Swap nibbles. lo nibble of %15 will always be 0 - A("swap %14") // Swap nibbles - A("mov %12,%14") - A("andi %12,0x0F") // isolate low nibble - A("andi %14,0xF0") // and clear it - A("or %15,%12") // %15:%16 <<= 4 - L("16") - A("sbrs %3,3") // shift by 8bits position? - A("rjmp 6f") // No, we are done - A("mov %16,%15") - A("mov %15,%14") - A("clr %14") - A("jmp 6f") - - // idx < 8, now %3 = idx - 8. Get the count of bits - L("7") - A("neg %3") // %3 = -idx = count of bits to move right. idx range:[1...8] - A("sbrs %3,0") // shift by 1 bit position ? - A("rjmp 10f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("10") - A("sbrs %3,1") // shift by 2 bit position ? - A("rjmp 11f") // No, skip it - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - A("asr %15") // (bit7 is always 0 here) - A("ror %14") - L("11") - A("sbrs %3,2") // shift by 4 bit position ? - A("rjmp 12f") // No, skip it - A("swap %15") // Swap nibbles - A("andi %14, 0xF0") // Lose the lowest nibble - A("swap %14") // Swap nibbles. Upper nibble is 0 - A("or %14,%15") // Pass nibble from upper byte - A("andi %15, 0x0F") // And get rid of that nibble - L("12") - A("sbrs %3,3") // shift by 8 bit position ? - A("rjmp 6f") // No, skip it - A("mov %14,%15") - A("clr %15") - L("6") // %16:%15:%14 = initial estimation of 0x1000000 / d - - // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration - // of Newton-Raphson. As it has a quadratic convergence, 1 iteration is enough - // to get more than 18bits of precision (the initial table lookup gives 9 bits of - // precision to start from). 18bits of precision is all what is needed here for result - - // %8:%7:%6 = d = interval - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %13 = 0 - // %3:%2:%1:%0 = working accumulator - - // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive - A("clr %0") - A("clr %1") - A("clr %2") - A("ldi %3,2") // %3:%2:%1:%0 = 0x2000000 - A("mul %6,%14") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%14") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1" ) - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%14") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%15") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%15") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%15") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%16") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%16") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = (1<<25) - x*d [169] - - // We need to multiply that result by x, and we are only interested in the top 24bits of that multiply - - // %16:%15:%14 = x = initial estimation of 0x1000000 / d - // %3:%2:%1:%0 = (1<<25) - x*d = acc - // %13 = 0 - - // result = %11:%10:%9:%5:%4 - A("mul %14,%0") // r1:r0 = LO(x) * LO(acc) - A("mov %4,r1") - A("clr %5") - A("clr %9") - A("clr %10") - A("clr %11") // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8 - A("mul %15,%0") // r1:r0 = MI(x) * LO(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) - A("mul %16,%0") // r1:r0 = HI(x) * LO(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8 - - A("mul %14,%1") // r1:r0 = LO(x) * MIL(acc) - A("add %4,r0") - A("adc %5,r1") - A("adc %9,%13") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIL(acc) - A("mul %15,%1") // r1:r0 = MI(x) * MIL(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8 - A("mul %16,%1") // r1:r0 = HI(x) * MIL(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16 - - A("mul %14,%2") // r1:r0 = LO(x) * MIH(acc) - A("add %5,r0") - A("adc %9,r1") - A("adc %10,%13") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8 - A("mul %15,%2") // r1:r0 = MI(x) * MIH(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16 - A("mul %16,%2") // r1:r0 = HI(x) * MIH(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24 - - A("mul %14,%3") // r1:r0 = LO(x) * HI(acc) - A("add %9,r0") - A("adc %10,r1") - A("adc %11,%13") // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16 - A("mul %15,%3") // r1:r0 = MI(x) * HI(acc) - A("add %10,r0") - A("adc %11,r1") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24 - A("mul %16,%3") // r1:r0 = HI(x) * HI(acc) - A("add %11,r0") // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32 - - // At this point, %11:%10:%9 contains the new estimation of x. - - // Finally, we must correct the result. Estimate remainder as - // (1<<24) - x*d - // %11:%10:%9 = x - // %8:%7:%6 = d = interval" "\n\t" - A("ldi %3,1") - A("clr %2") - A("clr %1") - A("clr %0") // %3:%2:%1:%0 = 0x1000000 - A("mul %6,%9") // r1:r0 = LO(d) * LO(x) - A("sub %0,r0") - A("sbc %1,r1") - A("sbc %2,%13") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * LO(x) - A("mul %7,%9") // r1:r0 = MI(d) * LO(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= MI(d) * LO(x) << 8 - A("mul %8,%9") // r1:r0 = HI(d) * LO(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16 - A("mul %6,%10") // r1:r0 = LO(d) * MI(x) - A("sub %1,r0") - A("sbc %2,r1") - A("sbc %3,%13") // %3:%2:%1:%0 -= LO(d) * MI(x) << 8 - A("mul %7,%10") // r1:r0 = MI(d) * MI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= MI(d) * MI(x) << 16 - A("mul %8,%10") // r1:r0 = HI(d) * MI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24 - A("mul %6,%11") // r1:r0 = LO(d) * HI(x) - A("sub %2,r0") - A("sbc %3,r1") // %3:%2:%1:%0 -= LO(d) * HI(x) << 16 - A("mul %7,%11") // r1:r0 = MI(d) * HI(x) - A("sub %3,r0") // %3:%2:%1:%0 -= MI(d) * HI(x) << 24 - // %3:%2:%1:%0 = r = (1<<24) - x*d - // %8:%7:%6 = d = interval - - // Perform the final correction - A("sub %0,%6") - A("sbc %1,%7") - A("sbc %2,%8") // r -= d - A("brcs 14f") // if ( r >= d) - - // %11:%10:%9 = x - A("ldi %3,1") - A("add %9,%3") - A("adc %10,%13") - A("adc %11,%13") // x++ - L("14") - - // Estimation is done. %11:%10:%9 = x - A("clr __zero_reg__") // Make C runtime happy - // [211 cycles total] - : "=r" (r2), - "=r" (r3), - "=r" (r4), - "=d" (r5), - "=r" (r6), - "=r" (r7), - "+r" (r8), - "+r" (r9), - "+r" (r10), - "=d" (r11), - "=r" (r12), - "=r" (r13), - "=d" (r14), - "=d" (r15), - "=d" (r16), - "=d" (r17), - "=d" (r18), - "+z" (ptab) - : - : "r0", "r1", "cc" - ); - - // Return the result - return r11 | (uint16_t(r12) << 8) | (uint32_t(r13) << 16); - } - #else - // All other 32-bit MPUs can easily do inverse using hardware division, - // so we don't need to reduce precision or to use assembly language at all. - // This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d - static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { - return d ? 0xFFFFFFFF / d : 0xFFFFFFFF; - } - #endif -#endif - -#define MINIMAL_STEP_RATE 120 - -/** - * Calculate trapezoid parameters, multiplying the entry- and exit-speeds - * by the provided factors. - ** - * ############ VERY IMPORTANT ############ - * NOTE that the PRECONDITION to call this function is that the block is - * NOT BUSY and it is marked as RECALCULATE. That WARRANTIES the Stepper ISR - * is not and will not use the block while we modify it, so it is safe to - * alter its values. - */ -void Planner::calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor) { - - uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), - final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) - - // Limit minimal step rate (Otherwise the timer will overflow.) - NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); - NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate = initial_rate; - #endif - - const int32_t accel = block->acceleration_steps_per_s2; - - // Steps required for acceleration, deceleration to/from nominal rate - uint32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), - decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); - // Steps between acceleration and deceleration, if any - int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; - - // Does accelerate_steps + decelerate_steps exceed step_event_count? - // Then we can't possibly reach the nominal rate, there will be no cruising. - // Use intersection_distance() to calculate accel / braking time in order to - // reach the final_rate exactly at the end of this block. - if (plateau_steps < 0) { - const float accelerate_steps_float = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); - accelerate_steps = _MIN(uint32_t(_MAX(accelerate_steps_float, 0)), block->step_event_count); - plateau_steps = 0; - - #if ENABLED(S_CURVE_ACCELERATION) - // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); - #endif - } - #if ENABLED(S_CURVE_ACCELERATION) - else // We have some plateau time, so the cruise rate will be the nominal rate - cruise_rate = block->nominal_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Jerk controlled speed requires to express speed versus time, NOT steps - uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), - deceleration_time = ((float)(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE); - - // And to offload calculations from the ISR, we also calculate the inverse of those times here - uint32_t acceleration_time_inverse = get_period_inverse(acceleration_time); - uint32_t deceleration_time_inverse = get_period_inverse(deceleration_time); - #endif - - // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = accelerate_steps + plateau_steps; - block->initial_rate = initial_rate; - #if ENABLED(S_CURVE_ACCELERATION) - block->acceleration_time = acceleration_time; - block->deceleration_time = deceleration_time; - block->acceleration_time_inverse = acceleration_time_inverse; - block->deceleration_time_inverse = deceleration_time_inverse; - block->cruise_rate = cruise_rate; - #endif - block->final_rate = final_rate; -} - -/* PLANNER SPEED DEFINITION - +--------+ <- current->nominal_speed - / \ - current->entry_speed -> + \ - | + <- next->entry_speed (aka exit speed) - +-------------+ - time --> - - Recalculates the motion plan according to the following basic guidelines: - - 1. Go over every feasible block sequentially in reverse order and calculate the junction speeds - (i.e. current->entry_speed) such that: - a. No junction speed exceeds the pre-computed maximum junction speed limit or nominal speeds of - neighboring blocks. - b. A block entry speed cannot exceed one reverse-computed from its exit speed (next->entry_speed) - with a maximum allowable deceleration over the block travel distance. - c. The last (or newest appended) block is planned from a complete stop (an exit speed of zero). - 2. Go over every block in chronological (forward) order and dial down junction speed values if - a. The exit speed exceeds the one forward-computed from its entry speed with the maximum allowable - acceleration over the block travel distance. - - When these stages are complete, the planner will have maximized the velocity profiles throughout the all - of the planner blocks, where every block is operating at its maximum allowable acceleration limits. In - other words, for all of the blocks in the planner, the plan is optimal and no further speed improvements - are possible. If a new block is added to the buffer, the plan is recomputed according to the said - guidelines for a new optimal plan. - - To increase computational efficiency of these guidelines, a set of planner block pointers have been - created to indicate stop-compute points for when the planner guidelines cannot logically make any further - changes or improvements to the plan when in normal operation and new blocks are streamed and added to the - planner buffer. For example, if a subset of sequential blocks in the planner have been planned and are - bracketed by junction velocities at their maximums (or by the first planner block as well), no new block - added to the planner buffer will alter the velocity profiles within them. So we no longer have to compute - them. Or, if a set of sequential blocks from the first block in the planner (or a optimal stop-compute - point) are all accelerating, they are all optimal and can not be altered by a new block added to the - planner buffer, as this will only further increase the plan speed to chronological blocks until a maximum - junction velocity is reached. However, if the operational conditions of the plan changes from infrequently - used feed holds or feedrate overrides, the stop-compute pointers will be reset and the entire plan is - recomputed as stated in the general guidelines. - - Planner buffer index mapping: - - block_buffer_tail: Points to the beginning of the planner buffer. First to be executed or being executed. - - block_buffer_head: Points to the buffer block after the last block in the buffer. Used to indicate whether - the buffer is full or empty. As described for standard ring buffers, this block is always empty. - - block_buffer_planned: Points to the first buffer block after the last optimally planned block for normal - streaming operating conditions. Use for planning optimizations by avoiding recomputing parts of the - planner buffer that don't change with the addition of a new block, as describe above. In addition, - this block can never be less than block_buffer_tail and will always be pushed forward and maintain - this requirement when encountered by the Planner::discard_current_block() routine during a cycle. - - NOTE: Since the planner only computes on what's in the planner buffer, some motions with lots of short - line segments, like G2/3 arcs or complex curves, may seem to move slow. This is because there simply isn't - enough combined distance traveled in the entire buffer to accelerate up to the nominal speed and then - decelerate to a complete stop at the end of the buffer, as stated by the guidelines. If this happens and - becomes an annoyance, there are a few simple solutions: (1) Maximize the machine acceleration. The planner - will be able to compute higher velocity profiles within the same combined distance. (2) Maximize line - motion(s) distance per block to a desired tolerance. The more combined distance the planner has to use, - the faster it can go. (3) Maximize the planner buffer size. This also will increase the combined distance - for the planner to compute over. It also increases the number of computations the planner has to perform - to compute an optimal plan, so select carefully. -*/ - -// The kernel called by recalculate() when scanning the plan from last to first entry. -void Planner::reverse_pass_kernel(block_t* const current, const block_t * const next) { - if (current) { - // If entry speed is already at the maximum entry speed, and there was no change of speed - // in the next block, there is no need to recheck. Block is cruising and there is no need to - // compute anything for this block, - // If not, block entry speed needs to be recalculated to ensure maximum possible planned speed. - const float max_entry_speed_sqr = current->max_entry_speed_sqr; - - // Compute maximum entry speed decelerating over the current block from its exit speed. - // If not at the maximum entry speed, or the previous block entry speed changed - if (current->entry_speed_sqr != max_entry_speed_sqr || (next && TEST(next->flag, BLOCK_BIT_RECALCULATE))) { - - // If nominal length true, max junction speed is guaranteed to be reached. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - - const float new_entry_speed_sqr = TEST(current->flag, BLOCK_BIT_NOMINAL_LENGTH) - ? max_entry_speed_sqr - : _MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next ? next->entry_speed_sqr : sq(float(MINIMUM_PLANNER_SPEED)), current->millimeters)); - if (current->entry_speed_sqr != new_entry_speed_sqr) { - - // Need to recalculate the block speed - Mark it now, so the stepper - // ISR does not consume the block before being recalculated - SBI(current->flag, BLOCK_BIT_RECALCULATE); - - // But there is an inherent race condition here, as the block may have - // become BUSY just before being marked RECALCULATE, so check for that! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks). And don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY so this is ahead of the Stepper ISR: - // Just Set the new entry speed. - current->entry_speed_sqr = new_entry_speed_sqr; - } - } - } - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the reverse pass. - */ -void Planner::reverse_pass() { - // Initialize block index to the last block in the planner buffer. - uint8_t block_index = prev_block_index(block_buffer_head); - - // Read the index of the last buffer planned block. - // The ISR may change it so get a stable local copy. - uint8_t planned_block_index = block_buffer_planned; - - // If there was a race condition and block_buffer_planned was incremented - // or was pointing at the head (queue empty) break loop now and avoid - // planning already consumed blocks - if (planned_block_index == block_buffer_head) return; - - // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last - // block in buffer. Cease planning when the last optimal planned or tail pointer is reached. - // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan. - const block_t *next = nullptr; - while (block_index != planned_block_index) { - - // Perform the reverse pass - block_t *current = &block_buffer[block_index]; - - // Only consider non sync blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { - reverse_pass_kernel(current, next); - next = current; - } - - // Advance to the next - block_index = prev_block_index(block_index); - - // The ISR could advance the block_buffer_planned while we were doing the reverse pass. - // We must try to avoid using an already consumed block as the last one - So follow - // changes to the pointer and make sure to limit the loop to the currently busy block - while (planned_block_index != block_buffer_planned) { - - // If we reached the busy block or an already processed block, break the loop now - if (block_index == planned_block_index) return; - - // Advance the pointer, following the busy block - planned_block_index = next_block_index(planned_block_index); - } - } -} - -// The kernel called by recalculate() when scanning the plan from first to last entry. -void Planner::forward_pass_kernel(const block_t* const previous, block_t* const current, const uint8_t block_index) { - if (previous) { - // If the previous block is an acceleration block, too short to complete the full speed - // change, adjust the entry speed accordingly. Entry speeds have already been reset, - // maximized, and reverse-planned. If nominal length is set, max junction speed is - // guaranteed to be reached. No need to recheck. - if (!TEST(previous->flag, BLOCK_BIT_NOMINAL_LENGTH) && - previous->entry_speed_sqr < current->entry_speed_sqr) { - - // Compute the maximum allowable speed - const float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - - // If true, current block is full-acceleration and we can move the planned pointer forward. - if (new_entry_speed_sqr < current->entry_speed_sqr) { - - // Mark we need to recompute the trapezoidal shape, and do it now, - // so the stepper ISR does not consume the block before being recalculated - SBI(current->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)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks and don't set its speed, as it can't - // be updated at this time. - CBI(current->flag, BLOCK_BIT_RECALCULATE); - } - else { - // Block is not BUSY, we won the race against the Stepper ISR: - - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. - - // Set optimal plan pointer. - block_buffer_planned = block_index; - } - } - } - - // Any block set at its maximum entry speed also creates an optimal plan up to this - // point in the buffer. When the plan is bracketed by either the beginning of the - // buffer and a maximum entry speed or two maximum entry speeds, every block in between - // cannot logically be further improved. Hence, we don't have to recompute them anymore. - if (current->entry_speed_sqr == current->max_entry_speed_sqr) - block_buffer_planned = block_index; - } -} - -/** - * recalculate() needs to go over the current plan twice. - * Once in reverse and once forward. This implements the forward pass. - */ -void Planner::forward_pass() { - - // Forward Pass: Forward plan the acceleration curve from the planned pointer onward. - // Also scans for optimal plan breakpoints and appropriately updates the planned pointer. - - // Begin at buffer planned pointer. Note that block_buffer_planned can be modified - // by the stepper ISR, so read it ONCE. It it guaranteed that block_buffer_planned - // will never lead head, so the loop is safe to execute. Also note that the forward - // pass will never modify the values at the tail. - uint8_t block_index = block_buffer_planned; - - block_t *block; - const block_t * previous = nullptr; - while (block_index != block_buffer_head) { - - // Perform the forward pass - block = &block_buffer[block_index]; - - // Skip SYNC blocks - 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, block, block_index); - previous = block; - } - // Advance to the previous - block_index = next_block_index(block_index); - } -} - -/** - * Recalculate the trapezoid speed profiles for all blocks in the plan - * according to the entry_factor for each junction. Must be called by - * recalculate() after updating the blocks. - */ -void Planner::recalculate_trapezoids() { - // The tail may be changed by the ISR so get a local copy. - uint8_t block_index = block_buffer_tail, - head_block_index = block_buffer_head; - // Since there could be a sync block in the head of the queue, and the - // next loop must not recalculate the head block (as it needs to be - // specially handled), scan backwards to the first non-SYNC block. - while (head_block_index != block_index) { - - // Go back (head always point to the first free block) - const uint8_t prev_index = prev_block_index(head_block_index); - - // Get the pointer to the block - block_t *prev = &block_buffer[prev_index]; - - // If not dealing with a sync block, we are done. The last block is not a SYNC block - if (!TEST(prev->flag, BLOCK_BIT_SYNC_POSITION)) break; - - // Examine the previous block. This and all following are SYNC blocks - head_block_index = prev_index; - } - - // Go from the tail (currently executed block) to the first block, without including it) - block_t *block = nullptr, *next = nullptr; - float current_entry_speed = 0.0, next_entry_speed = 0.0; - while (block_index != head_block_index) { - - next = &block_buffer[block_index]; - - // Skip sync blocks - if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { - next_entry_speed = SQRT(next->entry_speed_sqr); - - if (block) { - // Recalculate if current block entry or exit junction speed has changed. - 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(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(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(block->nominal_speed_sqr), - nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(block, current_entry_speed * nomr, next_entry_speed * nomr); - #if ENABLED(LIN_ADVANCE) - 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(block->flag, BLOCK_BIT_RECALCULATE); - } - } - - block = next; - current_entry_speed = next_entry_speed; - } - - block_index = next_block_index(block_index); - } - - // Last/newest block in buffer. Exit speed is set with MINIMUM_PLANNER_SPEED. Always recalculated. - if (next) { - - // Mark the next(last) block as RECALCULATE, to prevent the Stepper ISR running it. - // As the last block is always recalculated here, there is a chance the block isn't - // marked as RECALCULATE yet. That's the reason for the following line. - SBI(next->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(block)) { - // Block is not BUSY, we won the race against the Stepper ISR: - - const float next_nominal_speed = SQRT(next->nominal_speed_sqr), - nomr = 1.0f / next_nominal_speed; - calculate_trapezoid_for_block(next, next_entry_speed * nomr, float(MINIMUM_PLANNER_SPEED) * nomr); - #if ENABLED(LIN_ADVANCE) - if (next->use_advance_lead) { - const float comp = next->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; - next->max_adv_steps = next_nominal_speed * comp; - next->final_adv_steps = (MINIMUM_PLANNER_SPEED) * comp; - } - #endif - } - - // Reset next only to ensure its trapezoid is computed - The stepper is free to use - // the block from now on. - CBI(next->flag, BLOCK_BIT_RECALCULATE); - } -} - -void Planner::recalculate() { - // Initialize block index to the last block in the planner buffer. - const uint8_t block_index = prev_block_index(block_buffer_head); - // If there is just one block, no planning can be done. Avoid it! - if (block_index != block_buffer_planned) { - reverse_pass(); - forward_pass(); - } - recalculate_trapezoids(); -} - -#if ENABLED(AUTOTEMP) - - void Planner::getHighESpeed() { - static float oldt = 0; - - if (!autotemp_enabled) return; - if (thermalManager.degTargetHotend(0) + 2 < autotemp_min) return; // probably temperature set to zero. - - float high = 0.0; - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t* block = &block_buffer[b]; - if (block->steps.x || block->steps.y || block->steps.z) { - const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; - NOLESS(high, se); - } - } - - float t = autotemp_min + high * autotemp_factor; - LIMIT(t, autotemp_min, autotemp_max); - if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); - oldt = t; - thermalManager.setTargetHotend(t, 0); - } - -#endif // AUTOTEMP - -/** - * Maintain fans, paste extruder pressure, - */ -void Planner::check_axes_activity() { - - #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) - xyze_bool_t axis_active = { false }; - #endif - - #if FAN_COUNT > 0 - uint8_t tail_fan_speed[FAN_COUNT]; - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - uint8_t tail_valve_pressure; - #endif - #if HAS_HEATER_2 - uint8_t tail_e_to_p_pressure; - #endif - #endif - - if (has_blocks_queued()) { - - #if FAN_COUNT > 0 || ENABLED(BARICUDA) - block_t *block = &block_buffer[block_buffer_tail]; - #endif - - #if FAN_COUNT > 0 - FANS_LOOP(i) - tail_fan_speed[i] = thermalManager.scaledFanSpeed(i, block->fan_speed[i]); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - tail_valve_pressure = block->valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = block->e_to_p_pressure; - #endif - #endif - - #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 HAS_CUTTER - cutter.refresh(); - #endif - - #if FAN_COUNT > 0 - FANS_LOOP(i) - tail_fan_speed[i] = thermalManager.scaledFanSpeed(i); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - tail_valve_pressure = baricuda_valve_pressure; - #endif - #if HAS_HEATER_2 - tail_e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - #endif - } - - // - // Disable inactive axes - // - #if ENABLED(DISABLE_X) - if (!axis_active.x) disable_X(); - #endif - #if ENABLED(DISABLE_Y) - if (!axis_active.y) disable_Y(); - #endif - #if ENABLED(DISABLE_Z) - if (!axis_active.z) disable_Z(); - #endif - #if ENABLED(DISABLE_E) - if (!axis_active.e) disable_e_steppers(); - #endif - - // - // Update Fan speeds - // - #if FAN_COUNT > 0 - - #if FAN_KICKSTART_TIME > 0 - static millis_t fan_kick_end[FAN_COUNT] = { 0 }; - #define KICKSTART_FAN(f) \ - if (tail_fan_speed[f]) { \ - millis_t ms = millis(); \ - if (fan_kick_end[f] == 0) { \ - fan_kick_end[f] = ms + FAN_KICKSTART_TIME; \ - tail_fan_speed[f] = 255; \ - } else if (PENDING(ms, fan_kick_end[f])) \ - tail_fan_speed[f] = 255; \ - } else fan_kick_end[f] = 0 - #else - #define KICKSTART_FAN(f) NOOP - #endif - - #if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255 - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM) - #else - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ?: FAN_OFF_PWM) - #endif - - #if ENABLED(FAN_SOFT_PWM) - #define _FAN_SET(F) thermalManager.soft_pwm_amount_fan[F] = CALC_FAN_SPEED(F); - #elif ENABLED(FAST_PWM_FAN) - #define _FAN_SET(F) set_pwm_duty(FAN##F##_PIN, CALC_FAN_SPEED(F)); - #else - #define _FAN_SET(F) analogWrite(pin_t(FAN##F##_PIN), CALC_FAN_SPEED(F)); - #endif - #define FAN_SET(F) do{ KICKSTART_FAN(F); _FAN_SET(F); }while(0) - - #if HAS_FAN0 - FAN_SET(0); - #endif - #if HAS_FAN1 - FAN_SET(1); - #endif - #if HAS_FAN2 - FAN_SET(2); - #endif - - #endif // FAN_COUNT > 0 - - #if ENABLED(AUTOTEMP) - getHighESpeed(); - #endif - - #if ENABLED(BARICUDA) - #if HAS_HEATER_1 - analogWrite(pin_t(HEATER_1_PIN), tail_valve_pressure); - #endif - #if HAS_HEATER_2 - analogWrite(pin_t(HEATER_2_PIN), tail_e_to_p_pressure); - #endif - #endif -} - -#if DISABLED(NO_VOLUMETRICS) - - /** - * Get a volumetric multiplier from a filament diameter. - * This is the reciprocal of the circular cross-section area. - * Return 1.0 with volumetric off or a diameter of 0.0. - */ - inline float calculate_volumetric_multiplier(const float &diameter) { - return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5f) : 1; - } - - /** - * Convert the filament sizes into volumetric multipliers. - * The multiplier converts a given E value into a length. - */ - void Planner::calculate_volumetric_multipliers() { - for (uint8_t i = 0; i < COUNT(filament_size); i++) { - volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); - refresh_e_factor(i); - } - } - -#endif // !NO_VOLUMETRICS - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Convert the ratio value given by the filament width sensor - * into a volumetric multiplier. Conversion differs when using - * linear extrusion vs volumetric extrusion. - */ - 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(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); - } -#endif - -#if HAS_LEVELING - - constexpr xy_pos_t level_fulcrum = { - #if ENABLED(Z_SAFE_HOMING) - Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT - #else - X_HOME_POS, Y_HOME_POS - #endif - }; - - /** - * rx, ry, rz - Cartesian positions in mm - * Leveled XYZ on completion - */ - void Planner::apply_leveling(xyz_pos_t &raw) { - if (!leveling_active) return; - - #if ABL_PLANAR - - xy_pos_t d = raw - level_fulcrum; - apply_rotation_xyz(bed_level_matrix, d.x, d.y, raw.z); - raw = d + level_fulcrum; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - raw.z += ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - - void Planner::unapply_leveling(xyz_pos_t &raw) { - - if (leveling_active) { - - #if ABL_PLANAR - - matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); - - xy_pos_t d = raw - level_fulcrum; - apply_rotation_xyz(inverse, d.x, d.y, raw.z); - raw = d + level_fulcrum; - - #elif HAS_MESH - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); - #else - constexpr float fade_scaling_factor = 1.0; - #endif - - raw.z -= ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , fade_scaling_factor - #endif - ) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 - #endif - ); - - #endif - } - - #if ENABLED(SKEW_CORRECTION) - unskew(raw); - #endif - } - -#endif // HAS_LEVELING - -#if ENABLED(FWRETRACT) - /** - * rz, e - Cartesian positions in mm - */ - void Planner::apply_retract(float &rz, float &e) { - rz += fwretract.current_hop; - e -= fwretract.current_retract[active_extruder]; - } - - void Planner::unapply_retract(float &rz, float &e) { - rz -= fwretract.current_hop; - e += fwretract.current_retract[active_extruder]; - } - -#endif - -void Planner::quick_stop() { - - // Remove all the queued blocks. Note that this function is NOT - // called from the Stepper ISR, so we must consider tail as readonly! - // that is why we set head to tail - But there is a race condition that - // must be handled: The tail could change between the read and the assignment - // so this must be enclosed in a critical section - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - // Drop all queue entries - block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail; - - // Restart the block delay for the first movement - As the queue was - // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - - #if HAS_SPI_LCD - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif - - // Make sure to drop any attempt of queuing moves for at least 1 second - cleaning_buffer_counter = 1000; - - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - - // And stop the stepper ISR - stepper.quick_stop(); -} - -void Planner::endstop_triggered(const AxisEnum axis) { - // Record stepper position and discard the current block - stepper.endstop_triggered(axis); -} - -float Planner::triggered_position_mm(const AxisEnum axis) { - return stepper.triggered_position(axis) * steps_to_mm[axis]; -} - -void Planner::finish_and_disable() { - while (has_blocks_queued() || cleaning_buffer_counter) idle(); - disable_all_steppers(); -} - -/** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ -float Planner::get_axis_position_mm(const AxisEnum axis) { - float axis_steps; - #if IS_CORE - // Requesting one of the "core" axes? - if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) { - - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - 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); - #else - axis_steps = stepper.position(axis); - #endif - return axis_steps * steps_to_mm[axis]; -} - -/** - * Block until all buffered steps are executed / cleaned - */ -void Planner::synchronize() { - while ( - has_blocks_queued() || cleaning_buffer_counter - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) - || (READ(CLOSED_LOOP_ENABLE_PIN) && !READ(CLOSED_LOOP_MOVE_COMPLETE_PIN)) - #endif - ) idle(); -} - -/** - * Planner::_buffer_steps - * - * 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 - * - * Returns true if movement was properly queued, false otherwise - */ -bool Planner::_buffer_steps(const xyze_long_t &target - #if HAS_POSITION_FLOAT - , const xyze_pos_t &target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters -) { - - // If we are cleaning, do not accept queuing of movements - if (cleaning_buffer_counter) return false; - - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Fill the block with the specified movement - if (!_populate_block(block, false, target - #if HAS_POSITION_FLOAT - , target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , delta_mm_cart - #endif - , fr_mm_s, extruder, millimeters - )) { - // Movement was not queued, probably because it was too short. - // Simply accept that as movement queued and done - return true; - } - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - // Move buffer head - block_buffer_head = next_buffer_head; - - // Recalculate and optimize trapezoidal speed profiles - recalculate(); - - // Movement successfully queued! - return true; -} - -/** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * - * Returns true is movement is acceptable, false otherwise - */ -bool Planner::_populate_block(block_t * const block, bool split_move, - const abce_long_t &target - #if HAS_POSITION_FLOAT - , const xyze_pos_t &target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ -) { - - const int32_t da = target.a - position.a, - db = target.b - position.b, - dc = target.c - position.c; - - #if EXTRUDERS - int32_t de = target.e - position.e; - #else - constexpr int32_t de = 0; - #endif - - /* <-- add a slash to enable - SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s, - " A:", target.a, " (", da, " steps)" - " B:", target.b, " (", db, " steps)" - " C:", target.c, " (", dc, " steps)" - #if EXTRUDERS - " E:", target.e, " (", de, " steps)" - #endif - ); - //*/ - - #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) - if (de) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(extruder)) { - position.e = target.e; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float.e = target_float.e; - #endif - de = 0; // no difference - SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - const float e_steps = ABS(de * e_factor[extruder]); - const float max_e_steps = settings.axis_steps_per_mm[E_AXIS_N(extruder)] * (EXTRUDE_MAXLENGTH); - if (e_steps > max_e_steps) { - #if ENABLED(MIXING_EXTRUDER) - bool ignore_e = false; - float collector[MIXING_STEPPERS]; - mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector); - MIXER_STEPPER_LOOP(e) - if (e_steps * collector[e] > max_e_steps) { ignore_e = true; break; } - #else - constexpr bool ignore_e = true; - #endif - if (ignore_e) { - position.e = target.e; // Behave as if the move really took place, but ignore E part - #if HAS_POSITION_FLOAT - position_float.e = target_float.e; - #endif - de = 0; // no difference - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); - } - } - #endif // PREVENT_LENGTHY_EXTRUDE - } - #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE - - // Compute direction bit-mask for this block - uint8_t dm = 0; - #if CORE_IS_XY - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_HEAD); // ...and Y - if (dc < 0) SBI(dm, Z_AXIS); - if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction - #elif CORE_IS_XZ - if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction - if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #elif CORE_IS_YZ - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_HEAD); // Save the real Extruder (head) direction in Y Axis - if (dc < 0) SBI(dm, Z_HEAD); // ...and Z - if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction - if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction - #else - if (da < 0) SBI(dm, X_AXIS); - if (db < 0) SBI(dm, Y_AXIS); - if (dc < 0) SBI(dm, Z_AXIS); - #endif - if (de < 0) SBI(dm, E_AXIS); - - #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; - - // Set direction bits - block->direction_bits = dm; - - // Number of steps for each axis - // See http://www.corexy.com/theory.html - #if CORE_IS_XY - block->steps.set(ABS(da + db), ABS(da - db), ABS(dc)); - #elif CORE_IS_XZ - block->steps.set(ABS(da + dc), ABS(db), ABS(da - dc)); - #elif CORE_IS_YZ - block->steps.set(ABS(da), ABS(db + dc), ABS(db - dc)); - #elif IS_SCARA - block->steps.set(ABS(da), ABS(db), ABS(dc)); - #else - // default non-h-bot planning - block->steps.set(ABS(da), ABS(db), ABS(dc)); - #endif - - /** - * This part of the code calculates the total length of the movement. - * For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS. - * But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS - * and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y. - * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. - * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. - */ - struct DeltaMM : abce_float_t { - #if IS_CORE - xyz_pos_t head; - #endif - } delta_mm; - #if IS_CORE - #if CORE_IS_XY - delta_mm.head.x = da * steps_to_mm[A_AXIS]; - delta_mm.head.y = db * steps_to_mm[B_AXIS]; - delta_mm.z = dc * steps_to_mm[Z_AXIS]; - delta_mm.a = (da + db) * steps_to_mm[A_AXIS]; - delta_mm.b = CORESIGN(da - db) * steps_to_mm[B_AXIS]; - #elif CORE_IS_XZ - delta_mm.head.x = da * steps_to_mm[A_AXIS]; - delta_mm.y = db * steps_to_mm[Y_AXIS]; - delta_mm.head.z = dc * steps_to_mm[C_AXIS]; - delta_mm.a = (da + dc) * steps_to_mm[A_AXIS]; - delta_mm.c = CORESIGN(da - dc) * steps_to_mm[C_AXIS]; - #elif CORE_IS_YZ - delta_mm.x = da * steps_to_mm[X_AXIS]; - delta_mm.head.y = db * steps_to_mm[B_AXIS]; - delta_mm.head.z = dc * steps_to_mm[C_AXIS]; - delta_mm.b = (db + dc) * steps_to_mm[B_AXIS]; - delta_mm.c = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; - #endif - #else - delta_mm.a = da * steps_to_mm[A_AXIS]; - delta_mm.b = db * steps_to_mm[B_AXIS]; - delta_mm.c = dc * steps_to_mm[C_AXIS]; - #endif - - #if EXTRUDERS - delta_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)]; - #else - delta_mm.e = 0.0f; - #endif - - #if ENABLED(LCD_SHOW_E_TOTAL) - e_move_accumulator += delta_mm.e; - #endif - - if (block->steps.a < MIN_STEPS_PER_SEGMENT && block->steps.b < MIN_STEPS_PER_SEGMENT && block->steps.c < MIN_STEPS_PER_SEGMENT) { - block->millimeters = (0 - #if EXTRUDERS - + ABS(delta_mm.e) - #endif - ); - } - else { - if (millimeters) - block->millimeters = millimeters; - else - block->millimeters = SQRT( - #if CORE_IS_XY - sq(delta_mm.head.x) + sq(delta_mm.head.y) + sq(delta_mm.z) - #elif CORE_IS_XZ - sq(delta_mm.head.x) + sq(delta_mm.y) + sq(delta_mm.head.z) - #elif CORE_IS_YZ - sq(delta_mm.x) + sq(delta_mm.head.y) + sq(delta_mm.head.z) - #else - sq(delta_mm.x) + sq(delta_mm.y) + sq(delta_mm.z) - #endif - ); - - /** - * At this point at least one of the axes has more steps than - * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped as - * zero-length. It's important to not apply corrections - * to blocks that would get dropped! - * - * A correction function is permitted to add steps to an axis, it - * should *never* remove steps! - */ - #if ENABLED(BACKLASH_COMPENSATION) - backlash.add_correction_steps(da, db, dc, dm, block); - #endif - } - - #if EXTRUDERS - block->steps.e = esteps; - #endif - - block->step_event_count = _MAX(block->steps.a, block->steps.b, block->steps.c, esteps); - - // Bail if this is a zero-length block - if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; - - #if ENABLED(MIXING_EXTRUDER) - MIXER_POPULATE_BLOCK(); - #endif - - #if HAS_CUTTER - block->cutter_power = cutter.power; - #endif - - #if FAN_COUNT > 0 - FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; - #endif - - #if ENABLED(BARICUDA) - block->valve_pressure = baricuda_valve_pressure; - block->e_to_p_pressure = baricuda_e_to_p_pressure; - #endif - - #if EXTRUDERS > 1 - block->extruder = extruder; - #endif - - #if ENABLED(AUTO_POWER_CONTROL) - if (block->steps.x || block->steps.y || block->steps.z) - powerManager.power_on(); - #endif - - // Enable active axes - #if CORE_IS_XY - if (block->steps.a || block->steps.b) { - enable_X(); - enable_Y(); - } - #if DISABLED(Z_LATE_ENABLE) - if (block->steps.z) enable_Z(); - #endif - #elif CORE_IS_XZ - if (block->steps.a || block->steps.c) { - enable_X(); - enable_Z(); - } - if (block->steps.y) enable_Y(); - #elif CORE_IS_YZ - if (block->steps.b || block->steps.c) { - enable_Y(); - enable_Z(); - } - if (block->steps.x) enable_X(); - #else - if (block->steps.x) enable_X(); - if (block->steps.y) enable_Y(); - #if DISABLED(Z_LATE_ENABLE) - if (block->steps.z) enable_Z(); - #endif - #endif - - // Enable extruder(s) - #if EXTRUDERS - if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder - - for (uint8_t i = 0; i < EXTRUDERS; i++) - if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; - - #if HAS_DUPLICATION_MODE - if (extruder_duplication_enabled && extruder == 0) { - enable_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - } - #endif - - #define ENABLE_ONE_E(N) do{ \ - if (extruder == N) { \ - enable_E##N(); \ - g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \ - } \ - else if (!g_uc_extruder_last_move[N]) \ - disable_E##N(); \ - }while(0); - - #else - - #define ENABLE_ONE_E(N) enable_E##N(); - - #endif - - REPEAT(EXTRUDERS, ENABLE_ONE_E); - } - #endif // EXTRUDERS - - if (esteps) - NOLESS(fr_mm_s, settings.min_feedrate_mm_s); - else - NOLESS(fr_mm_s, settings.min_travel_feedrate_mm_s); - - const float inverse_millimeters = 1.0f / block->millimeters; // Inverse millimeters to remove multiple divides - - // Calculate inverse time for this move. No divide by zero due to previous checks. - // Example: At 120mm/s a 60mm move takes 0.5s. So this will give 2.0. - float inverse_secs = fr_mm_s * inverse_millimeters; - - // Get the number of non busy movements in queue (non busy means that they can be altered) - const uint8_t moves_queued = nonbusy_movesplanned(); - - // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill - #if EITHER(SLOWDOWN, ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) - // Segment time im micro seconds - uint32_t segment_time_us = LROUND(1000000.0f / inverse_secs); - #endif - - #if ENABLED(SLOWDOWN) - if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) { - if (segment_time_us < settings.min_segment_time_us) { - // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - const uint32_t nst = segment_time_us + LROUND(2 * (settings.min_segment_time_us - segment_time_us) / moves_queued); - inverse_secs = 1000000.0f / nst; - #if defined(XY_FREQUENCY_LIMIT) || HAS_SPI_LCD - segment_time_us = nst; - #endif - } - } - #endif - - #if HAS_SPI_LCD - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - block_buffer_runtime_us += segment_time_us; - block->segment_time_us = segment_time_us; - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 - block->nominal_rate = CEIL(block->step_event_count * inverse_secs); // (step/sec) Always > 0 - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM) // Only for extruder with filament sensor - filwidth.advance_e(delta_mm.e); - #endif - - // Calculate and limit speed in mm/sec - - xyze_float_t current_speed; - float speed_factor = 1.0f; // factor <1 decreases speed - - // Linear axes first with less logic - LOOP_XYZ(i) { - current_speed[i] = delta_mm[i] * inverse_secs; - const feedRate_t cs = ABS(current_speed[i]), - max_fr = settings.max_feedrate_mm_s[i]; - if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); - } - - // Limit speed on extruders, if any - #if EXTRUDERS - { - current_speed.e = delta_mm.e * inverse_secs; - #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) - // Move all mixing extruders at the specified rate - if (mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL) - current_speed.e *= MIXING_STEPPERS; - #endif - const feedRate_t cs = ABS(current_speed.e), - max_fr = (settings.max_feedrate_mm_s[E_AXIS_N(extruder)] - #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) - * MIXING_STEPPERS - #endif - ); - if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); - } - #endif - - // Max segment time in µs. - #ifdef XY_FREQUENCY_LIMIT - - // Check and limit the xy direction change frequency - const unsigned char direction_change = block->direction_bits ^ old_direction_bits; - old_direction_bits = block->direction_bits; - segment_time_us = LROUND((float)segment_time_us / speed_factor); - - uint32_t xs0 = axis_segment_time_us[0].x, - xs1 = axis_segment_time_us[1].x, - xs2 = axis_segment_time_us[2].x, - ys0 = axis_segment_time_us[0].y, - ys1 = axis_segment_time_us[1].y, - ys2 = axis_segment_time_us[2].y; - - if (TEST(direction_change, X_AXIS)) { - xs2 = axis_segment_time_us[2].x = xs1; - xs1 = axis_segment_time_us[1].x = xs0; - xs0 = 0; - } - xs0 = axis_segment_time_us[0].x = xs0 + segment_time_us; - - if (TEST(direction_change, Y_AXIS)) { - ys2 = axis_segment_time_us[2].y = axis_segment_time_us[1].y; - ys1 = axis_segment_time_us[1].y = axis_segment_time_us[0].y; - ys0 = 0; - } - ys0 = axis_segment_time_us[0].y = ys0 + segment_time_us; - - const uint32_t max_x_segment_time = _MAX(xs0, xs1, xs2), - max_y_segment_time = _MAX(ys0, ys1, ys2), - min_xy_segment_time = _MIN(max_x_segment_time, max_y_segment_time); - if (min_xy_segment_time < MAX_FREQ_TIME_US) { - const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US); - NOMORE(speed_factor, low_sf); - } - #endif // XY_FREQUENCY_LIMIT - - // Correct the speed - if (speed_factor < 1.0f) { - current_speed *= speed_factor; - block->nominal_rate *= speed_factor; - block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); - } - - // Compute and limit the acceleration rate for the trapezoid generator. - const float steps_per_mm = block->step_event_count * inverse_millimeters; - uint32_t accel; - if (!block->steps.a && !block->steps.b && !block->steps.c) { - // convert to: acceleration steps/sec^2 - accel = CEIL(settings.retract_acceleration * steps_per_mm); - #if ENABLED(LIN_ADVANCE) - block->use_advance_lead = false; - #endif - } - else { - #define LIMIT_ACCEL_LONG(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const uint32_t comp = max_acceleration_steps_per_s2[AXIS+INDX] * block->step_event_count; \ - if (accel * block->steps[AXIS] > comp) accel = comp / block->steps[AXIS]; \ - } \ - }while(0) - - #define LIMIT_ACCEL_FLOAT(AXIS,INDX) do{ \ - if (block->steps[AXIS] && max_acceleration_steps_per_s2[AXIS+INDX] < accel) { \ - const float comp = (float)max_acceleration_steps_per_s2[AXIS+INDX] * (float)block->step_event_count; \ - if ((float)accel * (float)block->steps[AXIS] > comp) accel = comp / (float)block->steps[AXIS]; \ - } \ - }while(0) - - // Start with print or travel acceleration - accel = CEIL((esteps ? settings.acceleration : settings.travel_acceleration) * steps_per_mm); - - #if ENABLED(LIN_ADVANCE) - - #if DISABLED(CLASSIC_JERK) - #if ENABLED(DISTINCT_E_FACTORS) - #define MAX_E_JERK max_e_jerk[extruder] - #else - #define MAX_E_JERK max_e_jerk - #endif - #else - #define MAX_E_JERK max_jerk.e - #endif - - /** - * - * Use LIN_ADVANCE for blocks if all these are true: - * - * esteps : This is a print move, because we checked for A, B, C steps before. - * - * extruder_advance_K[active_extruder] : There is an advance factor set for this extruder. - * - * de > 0 : Extruder is running forward (e.g., for "Wipe while retracting" (Slic3r) or "Combing" (Cura) moves) - */ - block->use_advance_lead = esteps - && extruder_advance_K[active_extruder] - && de > 0; - - if (block->use_advance_lead) { - block->e_D_ratio = (target_float.e - position_float.e) / - #if IS_KINEMATIC - block->millimeters - #else - SQRT(sq(target_float.x - position_float.x) - + sq(target_float.y - position_float.y) - + sq(target_float.z - position_float.z)) - #endif - ; - - // Check for unusual high e_D ratio to detect if a retract move was combined with the last print move due to min. steps per segment. Never execute this with advance! - // This assumes no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. - if (block->e_D_ratio > 3.0f) - block->use_advance_lead = false; - else { - const uint32_t max_accel_steps_per_s2 = MAX_E_JERK / (extruder_advance_K[active_extruder] * block->e_D_ratio) * steps_per_mm; - #if ENABLED(LA_DEBUG) - if (accel > max_accel_steps_per_s2) SERIAL_ECHOLNPGM("Acceleration limited."); - #endif - NOMORE(accel, max_accel_steps_per_s2); - } - } - #endif - - #if ENABLED(DISTINCT_E_FACTORS) - #define ACCEL_IDX extruder - #else - #define ACCEL_IDX 0 - #endif - - // Limit acceleration per axis - if (block->step_event_count <= cutoff_long) { - LIMIT_ACCEL_LONG(A_AXIS, 0); - LIMIT_ACCEL_LONG(B_AXIS, 0); - LIMIT_ACCEL_LONG(C_AXIS, 0); - LIMIT_ACCEL_LONG(E_AXIS, ACCEL_IDX); - } - else { - LIMIT_ACCEL_FLOAT(A_AXIS, 0); - LIMIT_ACCEL_FLOAT(B_AXIS, 0); - LIMIT_ACCEL_FLOAT(C_AXIS, 0); - LIMIT_ACCEL_FLOAT(E_AXIS, ACCEL_IDX); - } - } - block->acceleration_steps_per_s2 = accel; - block->acceleration = accel / steps_per_mm; - #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (4096.0f * 4096.0f / (STEPPER_TIMER_RATE))); - #endif - #if ENABLED(LIN_ADVANCE) - if (block->use_advance_lead) { - block->advance_speed = (STEPPER_TIMER_RATE) / (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * settings.axis_steps_per_mm[E_AXIS_N(extruder)]); - #if ENABLED(LA_DEBUG) - if (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) - SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); - if (block->advance_speed < 200) - SERIAL_ECHOLNPGM("eISR running at > 10kHz."); - #endif - } - #endif - - float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 - - #if DISABLED(CLASSIC_JERK) - /** - * Compute maximum allowable entry speed at junction by centripetal acceleration approximation. - * Let a circle be tangent to both previous and current path line segments, where the junction - * deviation is defined as the distance from the junction to the closest edge of the circle, - * colinear with the circle center. The circular segment joining the two paths represents the - * path of centripetal acceleration. Solve for max velocity based on max acceleration about the - * radius of the circle, defined indirectly by junction deviation. This may be also viewed as - * path width or max_jerk in the previous Grbl version. This approach does not actually deviate - * from path, but used as a robust way to compute cornering speeds, as it takes into account the - * nonlinearities of both the junction angle and junction velocity. - * - * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path - * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact - * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here - * is exactly the same. Instead of motioning all the way to junction point, the machine will - * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform - * a continuous mode path, but ARM-based microcontrollers most certainly do. - * - * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be - * changed dynamically during operation nor can the line move geometry. This must be kept in - * memory in the event of a feedrate override changing the nominal speeds of blocks, which can - * change the overall maximum entry speed conditions of all blocks. - * - * ####### - * https://github.com/MarlinFirmware/Marlin/issues/10341#issuecomment-388191754 - * - * hoffbaked: on May 10 2018 tuned and improved the GRBL algorithm for Marlin: - Okay! It seems to be working good. I somewhat arbitrarily cut it off at 1mm - on then on anything with less sides than an octagon. With this, and the - reverse pass actually recalculating things, a corner acceleration value - of 1000 junction deviation of .05 are pretty reasonable. If the cycles - can be spared, a better acos could be used. For all I know, it may be - already calculated in a different place. */ - - // Unit vector of previous path line segment - static xyze_float_t prev_unit_vec; - - xyze_float_t unit_vec = - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - delta_mm_cart - #else - { delta_mm.x, delta_mm.y, delta_mm.z, delta_mm.e } - #endif - ; - unit_vec *= inverse_millimeters; - - #if IS_CORE && DISABLED(CLASSIC_JERK) - /** - * On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y]. - * So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters". - * => normalize the complete junction vector - */ - normalize_junction_vector(unit_vec); - #endif - - // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Compute cosine of angle between previous and current path. (prev_unit_vec is negative) - // NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity. - float junction_cos_theta = (-prev_unit_vec.x * unit_vec.x) + (-prev_unit_vec.y * unit_vec.y) - + (-prev_unit_vec.z * unit_vec.z) + (-prev_unit_vec.e * unit_vec.e); - - // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). - if (junction_cos_theta > 0.999999f) { - // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); - } - else { - NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. - - // Convert delta vector to unit vector - xyze_float_t junction_unit_vec = unit_vec - prev_unit_vec; - normalize_junction_vector(junction_unit_vec); - - const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), - sin_theta_d2 = SQRT(0.5f * (1.0f - junction_cos_theta)); // Trig half angle identity. Always positive. - - vmax_junction_sqr = (junction_acceleration * junction_deviation_mm * sin_theta_d2) / (1.0f - sin_theta_d2); - if (block->millimeters < 1) { - - // Fast acos approximation, minus the error bar to be safe - const float junction_theta = (RADIANS(-40) * sq(junction_cos_theta) - RADIANS(50)) * junction_cos_theta + RADIANS(90) - 0.18f; - - // If angle is greater than 135 degrees (octagon), find speed for approximate arc - if (junction_theta > RADIANS(135)) { - const float limit_sqr = block->millimeters / (RADIANS(180) - junction_theta) * junction_acceleration; - NOMORE(vmax_junction_sqr, limit_sqr); - } - } - } - - // Get the lowest speed - vmax_junction_sqr = _MIN(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); - } - else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0; - - prev_unit_vec = unit_vec; - - #endif - - #ifdef USE_CACHED_SQRT - #define CACHED_SQRT(N, V) \ - static float saved_V, N; \ - if (V != saved_V) { N = SQRT(V); saved_V = V; } - #else - #define CACHED_SQRT(N, V) const float N = SQRT(V) - #endif - - #if HAS_CLASSIC_JERK - - /** - * Adapted from Průša MKS firmware - * https://github.com/prusa3d/Prusa-Firmware - */ - CACHED_SQRT(nominal_speed, block->nominal_speed_sqr); - - // Exit speed limited by a jerk to full halt of a previous last segment - static float previous_safe_speed; - - // Start with a safe speed (from which the machine may halt to stop immediately). - float safe_speed = nominal_speed; - - uint8_t limited = 0; - #if HAS_LINEAR_E_JERK - LOOP_XYZ(i) - #else - LOOP_XYZE(i) - #endif - { - const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis - maxj = max_jerk[i]; // mj : The max jerk setting for this axis - if (jerk > maxj) { // cs > mj : New current speed too fast? - if (limited) { // limited already? - const float mjerk = nominal_speed * maxj; // ns*mj - if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs - } - else { - safe_speed *= maxj / jerk; // Initial limit: ns*mj/cs - ++limited; // Initially limited - } - } - } - - float vmax_junction; - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { - // Estimate a maximum velocity allowed at a joint of two successive segments. - // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, - // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. - - // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. - float v_factor = 1; - limited = 0; - - // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. - // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. - CACHED_SQRT(previous_nominal_speed, previous_nominal_speed_sqr); - - vmax_junction = _MIN(nominal_speed, previous_nominal_speed); - - // Now limit the jerk in all axes. - const float smaller_speed_factor = vmax_junction / previous_nominal_speed; - #if HAS_LINEAR_E_JERK - LOOP_XYZ(axis) - #else - LOOP_XYZE(axis) - #endif - { - // Limit an axis. We have to differentiate: coasting, reversal of an axis, full stop. - float v_exit = previous_speed[axis] * smaller_speed_factor, - v_entry = current_speed[axis]; - if (limited) { - v_exit *= v_factor; - v_entry *= v_factor; - } - - // Calculate jerk depending on whether the axis is coasting in the same direction or reversing. - const float jerk = (v_exit > v_entry) - ? // coasting axis reversal - ( (v_entry > 0 || v_exit < 0) ? (v_exit - v_entry) : _MAX(v_exit, -v_entry) ) - : // v_exit <= v_entry coasting axis reversal - ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : _MAX(-v_exit, v_entry) ); - - if (jerk > max_jerk[axis]) { - v_factor *= max_jerk[axis] / jerk; - ++limited; - } - } - if (limited) vmax_junction *= v_factor; - // Now the transition velocity is known, which maximizes the shared exit / entry velocity while - // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. - const float vmax_junction_threshold = vmax_junction * 0.99f; - if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) - vmax_junction = safe_speed; - } - else - vmax_junction = safe_speed; - - previous_safe_speed = safe_speed; - - #if DISABLED(CLASSIC_JERK) - vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction)); - #else - vmax_junction_sqr = sq(vmax_junction); - #endif - - #endif // Classic Jerk Limiting - - // Max entry speed of this block equals the max exit speed of the previous block. - block->max_entry_speed_sqr = vmax_junction_sqr; - - // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); - - // If we are trying to add a split block, start with the - // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : _MIN(vmax_junction_sqr, v_allowable_sqr); - - // Initialize planner efficiency flags - // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag |= block->nominal_speed_sqr <= v_allowable_sqr ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE; - - // Update previous path unit_vector and nominal speed - previous_speed = current_speed; - previous_nominal_speed_sqr = block->nominal_speed_sqr; - - // Update the position - position = target; - #if HAS_POSITION_FLOAT - position_float = target_float; - #endif - - #if ENABLED(GRADIENT_MIX) - mixer.gradient_control(target_float.z); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - block->sdpos = recovery.command_sdpos(); - #endif - - // Movement was accepted - return true; -} // _populate_block() - -/** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ -void Planner::buffer_sync_block() { - // Wait for the next available block - uint8_t next_buffer_head; - block_t * const block = get_next_free_block(next_buffer_head); - - // Clear block - memset(block, 0, sizeof(block_t)); - - block->flag = BLOCK_FLAG_SYNC_POSITION; - - block->position = position; - - // If this is the first added movement, reload the delay, otherwise, cancel it. - if (block_buffer_head == block_buffer_tail) { - // If it was the first queued block, restart the 1st block delivery delay, to - // give the planner an opportunity to queue more movements and plan them - // As there are no queued movements, the Stepper ISR will not touch this - // variable, so there is no risk setting this here (but it MUST be done - // before the following line!!) - delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - } - - block_buffer_head = next_buffer_head; - - stepper.wake_up(); -} // buffer_sync_block() - -/** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ -bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , 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 - if (cleaning_buffer_counter) return false; - - // When changing extruders recalculate steps corresponding to the E position - #if ENABLED(DISTINCT_E_FACTORS) - if (last_extruder != extruder && settings.axis_steps_per_mm[E_AXIS_N(extruder)] != settings.axis_steps_per_mm[E_AXIS_N(last_extruder)]) { - position.e = LROUND(position.e * settings.axis_steps_per_mm[E_AXIS_N(extruder)] * steps_to_mm[E_AXIS_N(last_extruder)]); - last_extruder = extruder; - } - #endif - - // The target position of the tool in absolute steps - // Calculate target position in absolute steps - const abce_long_t target = { - 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 - const xyze_pos_t target_float = { a, b, c, e }; - #endif - - // DRYRUN prevents E moves from taking place - if (DEBUGGING(DRYRUN) - #if ENABLED(CANCEL_OBJECTS) - || cancelable.skipping - #endif - ) { - position.e = target.e; - #if HAS_POSITION_FLOAT - position_float.e = e; - #endif - } - - /* <-- add a slash to enable - SERIAL_ECHOPAIR(" buffer_segment FR:", fr_mm_s); - #if IS_KINEMATIC - SERIAL_ECHOPAIR(" A:", a); - SERIAL_ECHOPAIR(" (", position.a); - SERIAL_ECHOPAIR("->", target.a); - SERIAL_ECHOPAIR(") B:", b); - #else - SERIAL_ECHOPAIR(" X:", a); - SERIAL_ECHOPAIR(" (", position.x); - SERIAL_ECHOPAIR("->", target.x); - SERIAL_ECHOPAIR(") Y:", b); - #endif - SERIAL_ECHOPAIR(" (", position.y); - SERIAL_ECHOPAIR("->", target.y); - #if ENABLED(DELTA) - SERIAL_ECHOPAIR(") C:", c); - #else - SERIAL_ECHOPAIR(") Z:", c); - #endif - SERIAL_ECHOPAIR(" (", position.z); - SERIAL_ECHOPAIR("->", target.z); - SERIAL_ECHOPAIR(") E:", e); - SERIAL_ECHOPAIR(" (", position.e); - SERIAL_ECHOPAIR("->", target.e); - SERIAL_ECHOLNPGM(")"); - //*/ - - // Queue the movement - if ( - !_buffer_steps(target - #if HAS_POSITION_FLOAT - , target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , delta_mm_cart - #endif - , fr_mm_s, extruder, millimeters - ) - ) return false; - - stepper.wake_up(); - return true; -} // buffer_segment() - -/** - * Add a new linear movement to the buffer. - * 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) - * extruder - target extruder - * 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 feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters - #if ENABLED(SCARA_FEEDRATE_SCALING) - , const float &inv_duration - #endif -) { - xyze_pos_t machine = { rx, ry, rz, e }; - #if HAS_POSITION_MODIFIERS - apply_modifiers(machine); - #endif - - #if IS_KINEMATIC - - #if DISABLED(CLASSIC_JERK) - const xyze_pos_t delta_mm_cart = { - rx - position_cart.x, ry - position_cart.y, - rz - position_cart.z, e - position_cart.e - }; - #else - const xyz_pos_t delta_mm_cart = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z }; - #endif - - float mm = millimeters; - if (mm == 0.0) - mm = (delta_mm_cart.x != 0.0 || delta_mm_cart.y != 0.0) ? delta_mm_cart.magnitude() : ABS(delta_mm_cart.z); - - inverse_kinematics(machine); - - #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 ?: fr_mm_s / mm; - const feedRate_t feedrate = HYPOT(delta.a - position_float.a, delta.b - position_float.b) * duration_recip; - #else - const feedRate_t feedrate = fr_mm_s; - #endif - if (buffer_segment(delta.a, delta.b, delta.c, machine.e - #if DISABLED(CLASSIC_JERK) - , delta_mm_cart - #endif - , feedrate, extruder, mm - )) { - position_cart.set(rx, ry, rz, e); - return true; - } - else - return false; - #else - return buffer_segment(machine, fr_mm_s, extruder, millimeters); - #endif -} // buffer_line() - -/** - * Directly set the planner ABC position (and stepper positions) - * converting mm (or angles for SCARA) into steps. - * - * The provided ABC position is in machine units. - */ - -void Planner::set_machine_position_mm(const float &a, const float &b, const float &c, const float &e) { - #if ENABLED(DISTINCT_E_FACTORS) - last_extruder = active_extruder; - #endif - #if HAS_POSITION_FLOAT - position_float.set(a, b, c, e); - #endif - position.set(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(active_extruder)])); - if (has_blocks_queued()) { - //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. - //previous_speed.reset(); - buffer_sync_block(); - } - else - stepper.set_position(position); -} - -void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, const float &e) { - xyze_pos_t machine = { rx, ry, rz, e }; - #if HAS_POSITION_MODIFIERS - { - apply_modifiers(machine - #if HAS_LEVELING - , true - #endif - ); - } - #endif - #if IS_KINEMATIC - position_cart.set(rx, ry, rz, e); - inverse_kinematics(machine); - set_machine_position_mm(delta.a, delta.b, delta.c, machine.e); - #else - set_machine_position_mm(machine); - #endif -} - -/** - * Setters for planner position (also setting stepper position). - */ -void Planner::set_e_position_mm(const float &e) { - const uint8_t axis_index = E_AXIS_N(active_extruder); - #if ENABLED(DISTINCT_E_FACTORS) - last_extruder = active_extruder; - #endif - #if ENABLED(FWRETRACT) - float e_new = e - fwretract.current_retract[active_extruder]; - #else - const float e_new = e; - #endif - position.e = LROUND(settings.axis_steps_per_mm[axis_index] * e_new); - #if HAS_POSITION_FLOAT - position_float.e = e_new; - #endif - #if IS_KINEMATIC - position_cart.e = e; - #endif - if (has_blocks_queued()) - buffer_sync_block(); - else - stepper.set_axis_position(E_AXIS, position.e); -} - -// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 -void Planner::reset_acceleration_rates() { - #if ENABLED(DISTINCT_E_FACTORS) - #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS_N(active_extruder)) - #else - #define AXIS_CONDITION true - #endif - uint32_t highest_rate = 1; - LOOP_XYZE_N(i) { - max_acceleration_steps_per_s2[i] = settings.max_acceleration_mm_per_s2[i] * settings.axis_steps_per_mm[i]; - if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); - } - cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL - #if HAS_LINEAR_E_JERK - recalculate_max_e_jerk(); - #endif -} - -// Recalculate position, steps_to_mm if settings.axis_steps_per_mm changes! -void Planner::refresh_positioning() { - LOOP_XYZE_N(i) steps_to_mm[i] = 1.0f / settings.axis_steps_per_mm[i]; - set_position_mm(current_position); - reset_acceleration_rates(); -} - -inline void limit_and_warn(float &val, const uint8_t axis, PGM_P const setting_name, const xyze_float_t &max_limit) { - const uint8_t lim_axis = axis > E_AXIS ? E_AXIS : axis; - const float before = val; - LIMIT(val, 1, max_limit[lim_axis]); - if (before != val) { - SERIAL_CHAR(axis_codes[lim_axis]); - SERIAL_ECHOPGM(" Max "); - serialprintPGM(setting_name); - SERIAL_ECHOLNPAIR(" limited to ", val); - } -} - -void Planner::set_max_acceleration(const uint8_t axis, float targetValue) { - #if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #ifdef MAX_ACCEL_EDIT_VALUES - constexpr xyze_float_t max_accel_edit = MAX_ACCEL_EDIT_VALUES; - const xyze_float_t &max_acc_edit_scaled = max_accel_edit; - #else - constexpr xyze_float_t max_accel_edit = DEFAULT_MAX_ACCELERATION, - max_acc_edit_scaled = max_accel_edit * 2; - #endif - limit_and_warn(targetValue, axis, PSTR("Acceleration"), max_acc_edit_scaled); - #endif - settings.max_acceleration_mm_per_s2[axis] = targetValue; - - // Update steps per s2 to agree with the units per s2 (since they are used in the planner) - reset_acceleration_rates(); -} - -void Planner::set_max_feedrate(const uint8_t axis, float targetValue) { - #if ENABLED(LIMITED_MAX_FR_EDITING) - #ifdef MAX_FEEDRATE_EDIT_VALUES - constexpr xyze_float_t max_fr_edit = MAX_FEEDRATE_EDIT_VALUES; - const xyze_float_t &max_fr_edit_scaled = max_fr_edit; - #else - constexpr xyze_float_t max_fr_edit = DEFAULT_MAX_FEEDRATE, - max_fr_edit_scaled = max_fr_edit * 2; - #endif - limit_and_warn(targetValue, axis, PSTR("Feedrate"), max_fr_edit_scaled); - #endif - settings.max_feedrate_mm_s[axis] = targetValue; -} - -void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { - #if HAS_CLASSIC_JERK - #if ENABLED(LIMITED_JERK_EDITING) - constexpr xyze_float_t max_jerk_edit = - #ifdef MAX_JERK_EDIT_VALUES - MAX_JERK_EDIT_VALUES - #else - { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, - (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } - #endif - ; - limit_and_warn(targetValue, axis, PSTR("Jerk"), max_jerk_edit); - #endif - max_jerk[axis] = targetValue; - #else - UNUSED(axis); UNUSED(targetValue); - #endif -} - -#if ENABLED(AUTOTEMP) - - void Planner::autotemp_M104_M109() { - if ((autotemp_enabled = parser.seen('F'))) autotemp_factor = parser.value_float(); - if (parser.seen('S')) autotemp_min = parser.value_celsius(); - if (parser.seen('B')) autotemp_max = parser.value_celsius(); - } - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.h deleted file mode 100644 index a79c5bfd38..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner.h +++ /dev/null @@ -1,968 +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 - -/** - * planner.h - * - * Buffer movement commands and manage the acceleration profile plan - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - */ - -#include "../Marlin.h" - -#include "motion.h" -#include "../gcode/queue.h" - -#if ENABLED(DELTA) - #include "delta.h" -#endif - -#if ABL_PLANAR - #include "../libs/vector_3.h" // for matrix_3x3 -#endif - -#if ENABLED(FWRETRACT) - #include "../feature/fwretract.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../feature/mixing.h" -#endif - -#if HAS_CUTTER - #include "../feature/spindle_laser.h" -#endif - -// Feedrate for manual moves -#ifdef MANUAL_FEEDRATE - constexpr xyze_feedrate_t manual_feedrate_mm_m = MANUAL_FEEDRATE; -#endif - -enum BlockFlagBit : char { - // Recalculate trapezoids on entry junction. For optimization. - BLOCK_BIT_RECALCULATE, - - // Nominal speed always reached. - // i.e., The segment is long enough, so the nominal speed is reachable if accelerating - // from a safe speed (in consideration of jerking from zero speed). - BLOCK_BIT_NOMINAL_LENGTH, - - // The block is segment 2+ of a longer move - BLOCK_BIT_CONTINUED, - - // Sync the stepper counts from the block - BLOCK_BIT_SYNC_POSITION -}; - -enum BlockFlag : char { - BLOCK_FLAG_RECALCULATE = _BV(BLOCK_BIT_RECALCULATE), - BLOCK_FLAG_NOMINAL_LENGTH = _BV(BLOCK_BIT_NOMINAL_LENGTH), - BLOCK_FLAG_CONTINUED = _BV(BLOCK_BIT_CONTINUED), - BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION) -}; - -/** - * struct block_t - * - * A single entry in the planner buffer. - * Tracks linear movement over multiple axes. - * - * The "nominal" values are as-specified by gcode, and - * may never actually be reached due to acceleration limits. - */ -typedef struct block_t { - - volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! - - // Fields used by the motion planner to manage acceleration - float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 - entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 - max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 - millimeters, // The total travel of this block in mm - acceleration; // acceleration mm/sec^2 - - union { - abce_ulong_t steps; // Step count along each axis - abce_long_t position; // New position to force when this sync block is executed - }; - uint32_t step_event_count; // The number of step events required to complete this block - - #if EXTRUDERS > 1 - uint8_t extruder; // The extruder to move (if E move) - #else - static constexpr uint8_t extruder = 0; - #endif - - #if ENABLED(MIXING_EXTRUDER) - MIXER_BLOCK_FIELD; // Normalized color for the mixing steppers - #endif - - // Settings for the trapezoid generator - uint32_t accelerate_until, // The index of the step event on which to stop acceleration - decelerate_after; // The index of the step event on which to start decelerating - - #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase - acceleration_time, // Acceleration time and deceleration time in STEP timer counts - deceleration_time, - acceleration_time_inverse, // Inverse of acceleration and deceleration periods, expressed as integer. Scale depends on CPU being used - deceleration_time_inverse; - #else - uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation - #endif - - uint8_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) - - // Advance extrusion - #if ENABLED(LIN_ADVANCE) - bool use_advance_lead; - uint16_t advance_speed, // STEP timer value for extruder speed offset ISR - max_adv_steps, // max. advance steps to get cruising speed pressure (not always nominal_speed!) - final_adv_steps; // advance steps due to exit speed - float e_D_ratio; - #endif - - uint32_t nominal_rate, // The nominal step rate for this block in step_events/sec - initial_rate, // The jerk-adjusted step rate at start of block - final_rate, // The minimal rate at exit - acceleration_steps_per_s2; // acceleration steps/sec^2 - - #if HAS_CUTTER - cutter_power_t cutter_power; // Power level for Spindle, Laser, etc. - #endif - - #if FAN_COUNT > 0 - uint8_t fan_speed[FAN_COUNT]; - #endif - - #if ENABLED(BARICUDA) - uint8_t valve_pressure, e_to_p_pressure; - #endif - - #if HAS_SPI_LCD - 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, LCD_SHOW_E_TOTAL) - -#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 - 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) - #define XY_SKEW_FACTOR 0 - #define XZ_SKEW_FACTOR 0 - #define YZ_SKEW_FACTOR 0 -#endif - -typedef struct { - #if ENABLED(SKEW_CORRECTION_GCODE) - float xy; - #if ENABLED(SKEW_CORRECTION_FOR_Z) - float xz, yz; - #else - const float xz = XZ_SKEW_FACTOR, yz = YZ_SKEW_FACTOR; - #endif - #else - const float xy = XY_SKEW_FACTOR, - xz = XZ_SKEW_FACTOR, yz = YZ_SKEW_FACTOR; - #endif -} skew_factor_t; - -class Planner { - public: - - /** - * The move buffer, calculated in stepper steps - * - * block_buffer is a ring buffer... - * - * head,tail : indexes for write,read - * head==tail : the buffer is empty - * head!=tail : blocks are in the buffer - * head==(tail-1)%size : the buffer is full - * - * Writer of head is Planner::buffer_segment(). - * Reader of tail is Stepper::isr(). Always consider tail busy / read-only - */ - static block_t block_buffer[BLOCK_BUFFER_SIZE]; - static volatile uint8_t block_buffer_head, // Index of the next block to be pushed - block_buffer_nonbusy, // Index of the first non busy block - block_buffer_planned, // Index of the optimally planned block - block_buffer_tail; // Index of the busy block, if any - static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks - static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - - - #if ENABLED(DISTINCT_E_FACTORS) - static uint8_t last_extruder; // Respond to extruder change - #endif - - #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 - volumetric_area_nominal, // Nominal cross-sectional area - volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner - // May be auto-adjusted by a filament width sensor - #endif - - static planner_settings_t settings; - - static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2 - static float steps_to_mm[XYZE_N]; // Millimeters per step - - #if DISABLED(CLASSIC_JERK) - static float junction_deviation_mm; // (mm) M205 J - #if ENABLED(LIN_ADVANCE) - static float max_e_jerk // Calculated from junction_deviation_mm - #if ENABLED(DISTINCT_E_FACTORS) - [EXTRUDERS] - #endif - ; - #endif - #endif - - #if HAS_CLASSIC_JERK - #if HAS_LINEAR_E_JERK - static xyz_pos_t max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. - #else - static xyze_pos_t max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif - #endif - - #if HAS_LEVELING - static bool leveling_active; // Flag that bed leveling is enabled - #if ABL_PLANAR - static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level - #endif - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float z_fade_height, inverse_z_fade_height; - #endif - #else - static constexpr bool leveling_active = false; - #endif - - #if ENABLED(LIN_ADVANCE) - static float extruder_advance_K[EXTRUDERS]; - #endif - - #if HAS_POSITION_FLOAT - static xyze_pos_t position_float; - #endif - - #if IS_KINEMATIC - static xyze_pos_t position_cart; - #endif - - static skew_factor_t skew_factor; - - #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - static bool abort_on_endstop_hit; - #endif - - private: - - /** - * The current position of the tool in absolute steps - * Recalculated if any axis_steps_per_mm are changed by gcode - */ - static xyze_long_t position; - - /** - * Speed of previous path line segment - */ - static xyze_float_t previous_speed; - - /** - * Nominal speed of previous path line segment (mm/s)^2 - */ - static float previous_nominal_speed_sqr; - - /** - * Limit where 64bit math is necessary for acceleration calculation - */ - static uint32_t cutoff_long; - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float last_fade_z; - #endif - - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) - /** - * Counters to manage disabling inactive extruders - */ - static uint8_t g_uc_extruder_last_move[EXTRUDERS]; - #endif // DISABLE_INACTIVE_EXTRUDER - - #ifdef XY_FREQUENCY_LIMIT - // Used for the frequency limit - #define MAX_FREQ_TIME_US (uint32_t)(1000000.0 / XY_FREQUENCY_LIMIT) - // Old direction bits. Used for speed calculations - static unsigned char old_direction_bits; - // Segment times (in µs). Used for speed calculations - static xy_ulong_t axis_segment_time_us[3]; - #endif - - #if HAS_SPI_LCD - volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs - #endif - - public: - - /** - * Instance Methods - */ - - Planner(); - - void init(); - - /** - * Static (class) Methods - */ - - static void reset_acceleration_rates(); - static void refresh_positioning(); - static void set_max_acceleration(const uint8_t axis, float targetValue); - static void set_max_feedrate(const uint8_t axis, float targetValue); - static void set_max_jerk(const AxisEnum axis, float targetValue); - - - #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(); - - // Update multipliers based on new diameter measurements - static void calculate_volumetric_multipliers(); - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - 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) - - FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) { - filament_size[e] = v; - // make sure all extruders have some sane value for the filament size - for (uint8_t i = 0; i < COUNT(filament_size); i++) - if (!filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; - } - - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - /** - * Get the Z leveling fade factor based on the given Z height, - * re-calculating only when needed. - * - * Returns 1.0 if planner.z_fade_height is 0.0. - * Returns 0.0 if Z is past the specified 'Fade Height'. - */ - static inline float fade_scaling_factor_for_z(const float &rz) { - static float z_fade_factor = 1; - 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 z_fade_factor; - } - - FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } - - FORCE_INLINE static void set_z_fade_height(const float &zfh) { - z_fade_height = zfh > 0 ? zfh : 0; - inverse_z_fade_height = RECIPROCAL(z_fade_height); - force_fade_recalc(); - } - - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { - return !z_fade_height || rz < z_fade_height; - } - - #else - - FORCE_INLINE static float fade_scaling_factor_for_z(const float&) { return 1; } - - FORCE_INLINE static bool leveling_active_at_z(const float&) { return true; } - - #endif - - #if ENABLED(SKEW_CORRECTION) - - FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) { - const float sx = cx - cy * skew_factor.xy - cz * (skew_factor.xz - (skew_factor.xy * skew_factor.yz)), - sy = cy - cz * skew_factor.yz; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - FORCE_INLINE static void skew(xyz_pos_t &raw) { skew(raw.x, raw.y, raw.z); } - - FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) { - if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) { - const float sx = cx + cy * skew_factor.xy + cz * skew_factor.xz, - sy = cy + cz * skew_factor.yz; - if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { - cx = sx; cy = sy; - } - } - } - FORCE_INLINE static void unskew(xyz_pos_t &raw) { unskew(raw.x, raw.y, raw.z); } - - #endif // SKEW_CORRECTION - - #if HAS_LEVELING - /** - * Apply leveling to transform a cartesian position - * as it will be given to the planner and steppers. - */ - static void apply_leveling(xyz_pos_t &raw); - static void unapply_leveling(xyz_pos_t &raw); - FORCE_INLINE static void force_unapply_leveling(xyz_pos_t &raw) { - leveling_active = true; - unapply_leveling(raw); - leveling_active = false; - } - #endif - - #if ENABLED(FWRETRACT) - static void apply_retract(float &rz, float &e); - FORCE_INLINE static void apply_retract(xyze_pos_t &raw) { apply_retract(raw.z, raw.e); } - static void unapply_retract(float &rz, float &e); - FORCE_INLINE static void unapply_retract(xyze_pos_t &raw) { unapply_retract(raw.z, raw.e); } - #endif - - #if HAS_POSITION_MODIFIERS - FORCE_INLINE static void apply_modifiers(xyze_pos_t &pos - #if HAS_LEVELING - , bool leveling = - #if PLANNER_LEVELING - true - #else - false - #endif - #endif - ) { - #if ENABLED(SKEW_CORRECTION) - skew(pos); - #endif - #if HAS_LEVELING - if (leveling) apply_leveling(pos); - #endif - #if ENABLED(FWRETRACT) - apply_retract(pos); - #endif - } - - FORCE_INLINE static void unapply_modifiers(xyze_pos_t &pos - #if HAS_LEVELING - , bool leveling = - #if PLANNER_LEVELING - true - #else - false - #endif - #endif - ) { - #if ENABLED(FWRETRACT) - unapply_retract(pos); - #endif - #if HAS_LEVELING - if (leveling) unapply_leveling(pos); - #endif - #if ENABLED(SKEW_CORRECTION) - unskew(pos); - #endif - } - #endif // HAS_POSITION_MODIFIERS - - // Number of moves currently in the planner including the busy block, if any - FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } - - // Number of nonbusy moves currently in the planner - FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } - - // Remove all blocks from the buffer - FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } - - // Check if movement queue is full - FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } - - // Get count of movement slots free - FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); } - - /** - * Planner::get_next_free_block - * - * - Get the next head indices (passed by reference) - * - Wait for the number of spaces to open up in the planner - * - Return the first head block - */ - FORCE_INLINE static block_t* get_next_free_block(uint8_t &next_buffer_head, const uint8_t count=1) { - - // Wait until there are enough slots free - while (moves_free() < count) { idle(); } - - // Return the first available block - next_buffer_head = next_block_index(block_buffer_head); - return &block_buffer[block_buffer_head]; - } - - /** - * Planner::_buffer_steps - * - * Add a new linear movement to the buffer (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true if movement was buffered, false otherwise - */ - static bool _buffer_steps(const xyze_long_t &target - #if HAS_POSITION_FLOAT - , const xyze_pos_t &target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). - * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true is movement is acceptable, false otherwise - */ - static bool _populate_block(block_t * const block, bool split_move, - const xyze_long_t &target - #if HAS_POSITION_FLOAT - , const xyze_pos_t &target_float - #endif - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - /** - * Planner::buffer_sync_block - * Add a block to the buffer that just updates the position - */ - static void buffer_sync_block(); - - #if IS_KINEMATIC - private: - - // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const feedRate_t); - #endif - - /** - * Planner::buffer_segment - * - * Add a new linear movement to the buffer in axis units. - * - * Leveling and kinematics should be applied ahead of calling this. - * - * a,b,c,e - target positions in mm and/or degrees - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - */ - static bool buffer_segment(const float &a, const float &b, const float &c, const float &e - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - - FORCE_INLINE static bool buffer_segment(abce_pos_t &abce - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ) { - return buffer_segment(abce.a, abce.b, abce.c, abce.e - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , delta_mm_cart - #endif - , fr_mm_s, extruder, millimeters); - } - - public: - - /** - * Add a new linear movement to the buffer. - * 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) - * extruder - target extruder - * 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 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 xyze_pos_t &cart, 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 - ) { - return buffer_line(cart.x, cart.y, cart.z, cart.e, fr_mm_s, extruder, millimeters - #if ENABLED(SCARA_FEEDRATE_SCALING) - , inv_duration - #endif - ); - } - - /** - * Set the planner.position and individual stepper positions. - * Used by G92, G28, G29, and other procedures. - * - * The supplied position is in the cartesian coordinate space and is - * translated in to machine space as needed. Modifiers such as leveling - * and skew are also applied. - * - * Multiplies by axis_steps_per_mm[] and does necessary conversion - * for COREXY / COREXZ / COREYZ to set the corresponding stepper positions. - * - * Clears previous speed values. - */ - static void set_position_mm(const float &rx, const float &ry, const float &rz, const float &e); - FORCE_INLINE static void set_position_mm(const xyze_pos_t &cart) { set_position_mm(cart.x, cart.y, cart.z, cart.e); } - static void set_e_position_mm(const float &e); - - /** - * Set the planner.position and individual stepper positions. - * - * The supplied position is in machine space, and no additional - * conversions are applied. - */ - static void set_machine_position_mm(const float &a, const float &b, const float &c, const float &e); - FORCE_INLINE static void set_machine_position_mm(const abce_pos_t &abce) { set_machine_position_mm(abce.a, abce.b, abce.c, abce.e); } - - /** - * Get an axis position according to stepper position(s) - * For CORE machines apply translation from ABC to XYZ. - */ - static float get_axis_position_mm(const AxisEnum axis); - - // SCARA AB axes are in degrees, not mm - #if IS_SCARA - 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 - // 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 - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in mm (not core-savvy) - static float triggered_position_mm(const AxisEnum axis); - - // Block until all buffered steps are executed / cleaned - static void synchronize(); - - // Wait for moves to finish and disable all steppers - static void finish_and_disable(); - - // Periodic tick to handle cleaning timeouts - // Called from the Temperature ISR at ~1kHz - static void tick() { - if (cleaning_buffer_counter) { - --cleaning_buffer_counter; - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - if (!cleaning_buffer_counter) queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND)); - #endif - } - } - - /** - * Does the buffer have any blocks queued? - */ - FORCE_INLINE static bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); } - - /** - * The current block. nullptr if the buffer is empty. - * This also marks the block as busy. - * WARNING: Called from Stepper ISR context! - */ - static block_t* get_current_block() { - - // Get the number of moves in the planner queue so far - const uint8_t nr_moves = movesplanned(); - - // If there are any moves queued ... - if (nr_moves) { - - // If there is still delay of delivery of blocks running, decrement it - if (delay_before_delivering) { - --delay_before_delivering; - // If the number of movements queued is less than 3, and there is still time - // to wait, do not deliver anything - if (nr_moves < 3 && delay_before_delivering) return nullptr; - delay_before_delivering = 0; - } - - // If we are here, there is no excuse to deliver the block - block_t * const block = &block_buffer[block_buffer_tail]; - - // No trapezoid calculated? Don't execute yet. - if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return nullptr; - - #if HAS_SPI_LCD - block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. - #endif - - // As this block is busy, advance the nonbusy block pointer - block_buffer_nonbusy = next_block_index(block_buffer_tail); - - // Push block_buffer_planned pointer, if encountered. - if (block_buffer_tail == block_buffer_planned) - block_buffer_planned = block_buffer_nonbusy; - - // Return the block - return block; - } - - // The queue became empty - #if HAS_SPI_LCD - clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. - #endif - - return nullptr; - } - - /** - * "Discard" the block and "release" the memory. - * Called when the current block is no longer needed. - * NB: There MUST be a current block to call this function!! - */ - FORCE_INLINE static void discard_current_block() { - if (has_blocks_queued()) - block_buffer_tail = next_block_index(block_buffer_tail); - } - - #if HAS_SPI_LCD - - static uint16_t block_buffer_runtime() { - #ifdef __AVR__ - // Protect the access to the variable. Only required for AVR, as - // any 32bit CPU offers atomic access to 32bit variables - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - millis_t bbru = block_buffer_runtime_us; - - #ifdef __AVR__ - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - // To translate µs to ms a division by 1000 would be required. - // We introduce 2.4% error here by dividing by 1024. - // Doesn't matter because block_buffer_runtime_us is already too small an estimation. - bbru >>= 10; - // limit to about a minute. - NOMORE(bbru, 0xFFFFul); - return bbru; - } - - static void clear_block_buffer_runtime() { - #ifdef __AVR__ - // Protect the access to the variable. Only required for AVR, as - // any 32bit CPU offers atomic access to 32bit variables - bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - block_buffer_runtime_us = 0; - - #ifdef __AVR__ - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - } - - #endif - - #if ENABLED(AUTOTEMP) - static float autotemp_min, autotemp_max, autotemp_factor; - static bool autotemp_enabled; - static void getHighESpeed(); - static void autotemp_M104_M109(); - #endif - - #if HAS_LINEAR_E_JERK - FORCE_INLINE static void recalculate_max_e_jerk() { - #define GET_MAX_E_JERK(N) SQRT(SQRT(0.5) * junction_deviation_mm * (N) * RECIPROCAL(1.0 - SQRT(0.5))) - #if ENABLED(DISTINCT_E_FACTORS) - for (uint8_t i = 0; i < EXTRUDERS; i++) - max_e_jerk[i] = GET_MAX_E_JERK(settings.max_acceleration_mm_per_s2[E_AXIS_N(i)]); - #else - max_e_jerk = GET_MAX_E_JERK(settings.max_acceleration_mm_per_s2[E_AXIS]); - #endif - } - #endif - - private: - - /** - * Get the index of the next / previous block in the ring buffer - */ - static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } - static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } - - /** - * Calculate the distance (not time) it takes to accelerate - * from initial_rate to target_rate using the given acceleration: - */ - static float estimate_acceleration_distance(const float &initial_rate, const float &target_rate, const float &accel) { - if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 - return (sq(target_rate) - sq(initial_rate)) / (accel * 2); - } - - /** - * Return the point at which you must start braking (at the rate of -'accel') if - * you start at 'initial_rate', accelerate (until reaching the point), and want to end at - * 'final_rate' after traveling 'distance'. - * - * This is used to compute the intersection point between acceleration and deceleration - * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed) - */ - static float intersection_distance(const float &initial_rate, const float &final_rate, const float &accel, const float &distance) { - if (accel == 0) return 0; // accel was 0, set intersection distance to 0 - return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4); - } - - /** - * Calculate the maximum allowable speed squared at this point, in order - * to reach 'target_velocity_sqr' using 'acceleration' within a given - * 'distance'. - */ - static float max_allowable_speed_sqr(const float &accel, const float &target_velocity_sqr, const float &distance) { - return target_velocity_sqr - 2 * accel * distance; - } - - #if ENABLED(S_CURVE_ACCELERATION) - /** - * Calculate the speed reached given initial speed, acceleration and distance - */ - static float final_speed(const float &initial_velocity, const float &accel, const float &distance) { - return SQRT(sq(initial_velocity) + 2 * accel * distance); - } - #endif - - static void calculate_trapezoid_for_block(block_t* const block, const float &entry_factor, const float &exit_factor); - - static void reverse_pass_kernel(block_t* const current, const block_t * const next); - static void forward_pass_kernel(const block_t * const previous, block_t* const current, uint8_t block_index); - - static void reverse_pass(); - static void forward_pass(); - - static void recalculate_trapezoids(); - - static void recalculate(); - - #if DISABLED(CLASSIC_JERK) - - FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) { - float magnitude_sq = 0; - LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]); - vector *= RSQRT(magnitude_sq); - } - - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, xyze_float_t &unit_vec) { - float limit_value = max_value; - LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero - NOMORE(limit_value, ABS(settings.max_acceleration_mm_per_s2[idx] / unit_vec[idx])); - return limit_value; - } - - #endif // !CLASSIC_JERK -}; - -#define PLANNER_XY_FEEDRATE() (_MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS])) - -extern Planner planner; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.cpp deleted file mode 100644 index 080f4e41a8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.cpp +++ /dev/null @@ -1,206 +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 . - * - */ - -/** - * planner_bezier.cpp - * - * Compute and buffer movement commands for bezier curves - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(BEZIER_CURVE_SUPPORT) - -#include "planner.h" -#include "motion.h" -#include "temperature.h" - -#include "../Marlin.h" -#include "../core/language.h" -#include "../gcode/queue.h" - -// See the meaning in the documentation of cubic_b_spline(). -#define MIN_STEP 0.002f -#define MAX_STEP 0.1f -#define SIGMA 0.1f - -// Compute the linear interpolation between two real numbers. -static inline float interp(const float &a, const float &b, const float &t) { return (1 - t) * a + t * b; } - -/** - * Compute a Bézier curve using the De Casteljau's algorithm (see - * https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm), which is - * easy to code and has good numerical stability (very important, - * since Arudino works with limited precision real numbers). - */ -static inline float eval_bezier(const float &a, const float &b, const float &c, const float &d, const float &t) { - const float iab = interp(a, b, t), - ibc = interp(b, c, t), - icd = interp(c, d, t), - iabc = interp(iab, ibc, t), - ibcd = interp(ibc, icd, t); - return interp(iabc, ibcd, t); -} - -/** - * We approximate Euclidean distance with the sum of the coordinates - * offset (so-called "norm 1"), which is quicker to compute. - */ -static inline float dist1(const float &x1, const float &y1, const float &x2, const float &y2) { return ABS(x1 - x2) + ABS(y1 - y2); } - -/** - * The algorithm for computing the step is loosely based on the one in Kig - * (See https://sources.debian.net/src/kig/4:15.08.3-1/misc/kigpainter.cpp/#L759) - * However, we do not use the stack. - * - * The algorithm goes as it follows: the parameters t runs from 0.0 to - * 1.0 describing the curve, which is evaluated by eval_bezier(). At - * each iteration we have to choose a step, i.e., the increment of the - * t variable. By default the step of the previous iteration is taken, - * and then it is enlarged or reduced depending on how straight the - * curve locally is. The step is always clamped between MIN_STEP/2 and - * 2*MAX_STEP. MAX_STEP is taken at the first iteration. - * - * For some t, the step value is considered acceptable if the curve in - * the interval [t, t+step] is sufficiently straight, i.e., - * sufficiently close to linear interpolation. In practice the - * following test is performed: the distance between eval_bezier(..., - * t+step/2) is evaluated and compared with 0.5*(eval_bezier(..., - * t)+eval_bezier(..., t+step)). If it is smaller than SIGMA, then the - * step value is considered acceptable, otherwise it is not. The code - * seeks to find the larger step value which is considered acceptable. - * - * At every iteration the recorded step value is considered and then - * iteratively halved until it becomes acceptable. If it was already - * acceptable in the beginning (i.e., no halving were done), then - * maybe it was necessary to enlarge it; then it is iteratively - * doubled while it remains acceptable. The last acceptable value - * found is taken, provided that it is between MIN_STEP and MAX_STEP - * and does not bring t over 1.0. - * - * Caveat: this algorithm is not perfect, since it can happen that a - * step is considered acceptable even when the curve is not linear at - * all in the interval [t, t+step] (but its mid point coincides "by - * chance" with the midpoint according to the parametrization). This - * kind of glitches can be eliminated with proper first derivative - * estimates; however, given the improbability of such configurations, - * 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 xyze_pos_t &position, // current position - const xyze_pos_t &target, // target position - const xy_pos_t (&offsets)[2], // 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 xy_pos_t first = position + offsets[0], second = target + offsets[1]; - - xyze_pos_t bez_target; - bez_target.set(position.x, position.y); - float step = MAX_STEP; - - millis_t next_idle_ms = millis() + 200UL; - - for (float t = 0; t < 1;) { - - thermalManager.manage_heater(); - millis_t now = millis(); - if (ELAPSED(now, next_idle_ms)) { - next_idle_ms = now + 200UL; - idle(); - } - - // First try to reduce the step in order to make it sufficiently - // close to a linear interpolation. - bool did_reduce = false; - float new_t = t + step; - NOMORE(new_t, 1); - float new_pos0 = eval_bezier(position.x, first.x, second.x, target.x, new_t), - new_pos1 = eval_bezier(position.y, first.y, second.y, target.y, new_t); - for (;;) { - if (new_t - t < (MIN_STEP)) break; - const float candidate_t = 0.5f * (t + new_t), - candidate_pos0 = eval_bezier(position.x, first.x, second.x, target.x, candidate_t), - candidate_pos1 = eval_bezier(position.y, first.y, second.y, target.y, candidate_t), - interp_pos0 = 0.5f * (bez_target.x + new_pos0), - interp_pos1 = 0.5f * (bez_target.y + new_pos1); - if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - did_reduce = true; - } - - // If we did not reduce the step, maybe we should enlarge it. - if (!did_reduce) for (;;) { - if (new_t - t > MAX_STEP) break; - const float candidate_t = t + 2 * (new_t - t); - if (candidate_t >= 1) break; - const float candidate_pos0 = eval_bezier(position.x, first.x, second.x, target.x, candidate_t), - candidate_pos1 = eval_bezier(position.y, first.y, second.y, target.y, candidate_t), - interp_pos0 = 0.5f * (bez_target.x + candidate_pos0), - interp_pos1 = 0.5f * (bez_target.y + candidate_pos1); - if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; - new_t = candidate_t; - new_pos0 = candidate_pos0; - new_pos1 = candidate_pos1; - } - - // Check some postcondition; they are disabled in the actual - // Marlin build, but if you test the same code on a computer you - // may want to check they are respect. - /* - assert(new_t <= 1.0); - if (new_t < 1.0) { - assert(new_t - t >= (MIN_STEP) / 2.0); - assert(new_t - t <= (MAX_STEP) * 2.0); - } - */ - - step = new_t - t; - t = new_t; - - // Compute and send new position - xyze_pos_t new_bez = { - new_pos0, new_pos1, - interp(position.z, target.z, t), // FIXME. These two are wrong, since the parameter t is - interp(position.e, target.e, t) // not linear in the distance. - }; - apply_motion_limits(new_bez); - bez_target = new_bez; - - #if HAS_LEVELING && !PLANNER_LEVELING - xyze_pos_t pos = bez_target; - planner.apply_leveling(pos); - #else - const xyze_pos_t &pos = bez_target; - #endif - - if (!planner.buffer_line(pos, scaled_fr_mm_s, active_extruder, step)) - break; - } -} - -#endif // BEZIER_CURVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.h deleted file mode 100644 index d0aa82858c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/planner_bezier.h +++ /dev/null @@ -1,39 +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 - -/** - * planner_bezier.h - * - * Compute and buffer movement commands for Bézier curves - * - */ - -#include "../core/types.h" - -void cubic_b_spline( - const xyze_pos_t &position, // current position - const xyze_pos_t &target, // target position - const xy_pos_t (&offsets)[2], // a pair of offsets - const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate % - const uint8_t extruder -); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.cpp deleted file mode 100644 index cef233d9ac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.cpp +++ /dev/null @@ -1,362 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if DISABLED(PRINTCOUNTER) - -#include "../libs/stopwatch.h" -Stopwatch print_job_timer; // Global Print Job Timer instance - -#else // PRINTCOUNTER - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -#include "printcounter.h" -#include "../Marlin.h" -#include "../HAL/shared/persistent_store_api.h" - -#if HAS_BUZZER && SERVICE_WARNING_BUZZES > 0 - #include "../libs/buzzer.h" -#endif - -// Service intervals -#if HAS_SERVICE_INTERVALS - #if SERVICE_INTERVAL_1 > 0 - #define SERVICE_INTERVAL_SEC_1 (3600UL * SERVICE_INTERVAL_1) - #else - #define SERVICE_INTERVAL_SEC_1 (3600UL * 100) - #endif - #if SERVICE_INTERVAL_2 > 0 - #define SERVICE_INTERVAL_SEC_2 (3600UL * SERVICE_INTERVAL_2) - #else - #define SERVICE_INTERVAL_SEC_2 (3600UL * 100) - #endif - #if SERVICE_INTERVAL_3 > 0 - #define SERVICE_INTERVAL_SEC_3 (3600UL * SERVICE_INTERVAL_3) - #else - #define SERVICE_INTERVAL_SEC_3 (3600UL * 100) - #endif -#endif - -PrintCounter print_job_timer; // Global Print Job Timer instance - -printStatistics PrintCounter::data; - -const PrintCounter::eeprom_address_t PrintCounter::address = STATS_EEPROM_ADDRESS; - -millis_t PrintCounter::lastDuration; -bool PrintCounter::loaded = false; - -millis_t PrintCounter::deltaDuration() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("deltaDuration")); - #endif - - millis_t tmp = lastDuration; - lastDuration = duration(); - return lastDuration - tmp; -} - -void PrintCounter::incFilamentUsed(float const &amount) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("incFilamentUsed")); - #endif - - // Refuses to update data if object is not loaded - if (!isLoaded()) return; - - data.filamentUsed += amount; // mm -} - -void PrintCounter::initStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("initStats")); - #endif - - loaded = true; - data = { 0, 0, 0, 0, 0.0 - #if HAS_SERVICE_INTERVALS - #if SERVICE_INTERVAL_1 > 0 - , SERVICE_INTERVAL_SEC_1 - #endif - #if SERVICE_INTERVAL_2 > 0 - , SERVICE_INTERVAL_SEC_2 - #endif - #if SERVICE_INTERVAL_3 > 0 - , SERVICE_INTERVAL_SEC_3 - #endif - #endif - }; - - saveStats(); - persistentStore.access_start(); - persistentStore.write_data(address, (uint8_t)0x16); - persistentStore.access_finish(); -} - -#if HAS_SERVICE_INTERVALS - inline void _print_divider() { SERIAL_ECHO_MSG("============================================="); } - inline bool _service_warn(const char * const msg) { - _print_divider(); - SERIAL_ECHO_START(); - serialprintPGM(msg); - SERIAL_ECHOLNPGM("!"); - _print_divider(); - return true; - } -#endif - -void PrintCounter::loadStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("loadStats")); - #endif - - // Check if the EEPROM block is initialized - uint8_t value = 0; - persistentStore.access_start(); - persistentStore.read_data(address, &value, sizeof(uint8_t)); - if (value != 0x16) - initStats(); - else - persistentStore.read_data(address + sizeof(uint8_t), (uint8_t*)&data, sizeof(printStatistics)); - persistentStore.access_finish(); - loaded = true; - - #if HAS_SERVICE_INTERVALS - bool doBuzz = false; - #if SERVICE_INTERVAL_1 > 0 - if (data.nextService1 == 0) doBuzz = _service_warn(PSTR(" " SERVICE_NAME_1)); - #endif - #if SERVICE_INTERVAL_2 > 0 - if (data.nextService2 == 0) doBuzz = _service_warn(PSTR(" " SERVICE_NAME_2)); - #endif - #if SERVICE_INTERVAL_3 > 0 - if (data.nextService3 == 0) doBuzz = _service_warn(PSTR(" " SERVICE_NAME_3)); - #endif - #if HAS_BUZZER && SERVICE_WARNING_BUZZES > 0 - if (doBuzz) for (int i = 0; i < SERVICE_WARNING_BUZZES; i++) BUZZ(200, 404); - #else - UNUSED(doBuzz); - #endif - #endif // HAS_SERVICE_INTERVALS -} - -void PrintCounter::saveStats() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("saveStats")); - #endif - - // Refuses to save data if object is not loaded - if (!isLoaded()) return; - - // Saves the struct to EEPROM - persistentStore.access_start(); - persistentStore.write_data(address + sizeof(uint8_t), (uint8_t*)&data, sizeof(printStatistics)); - persistentStore.access_finish(); - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onConfigurationStoreWritten(true); - #endif -} - -#if HAS_SERVICE_INTERVALS - inline void _service_when(char buffer[], const char * const msg, const uint32_t when) { - SERIAL_ECHOPGM(MSG_STATS); - serialprintPGM(msg); - SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer)); - } -#endif - -void PrintCounter::showStats() { - char buffer[21]; - - SERIAL_ECHOPGM(MSG_STATS); - SERIAL_ECHOLNPAIR( - "Prints: ", data.totalPrints, - ", Finished: ", data.finishedPrints, - ", Failed: ", data.totalPrints - data.finishedPrints - - ((isRunning() || isPaused()) ? 1 : 0) // Remove 1 from failures with an active counter - ); - - SERIAL_ECHOPGM(MSG_STATS); - duration_t elapsed = data.printTime; - elapsed.toString(buffer); - SERIAL_ECHOPAIR("Total time: ", buffer); - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPAIR(" (", data.printTime); - SERIAL_CHAR(')'); - #endif - - elapsed = data.longestPrint; - elapsed.toString(buffer); - SERIAL_ECHOPAIR(", Longest job: ", buffer); - #if ENABLED(DEBUG_PRINTCOUNTER) - SERIAL_ECHOPAIR(" (", data.longestPrint); - SERIAL_CHAR(')'); - #endif - - SERIAL_ECHOPAIR("\n" MSG_STATS "Filament used: ", data.filamentUsed / 1000); - SERIAL_CHAR('m'); - SERIAL_EOL(); - - #if SERVICE_INTERVAL_1 > 0 - _service_when(buffer, PSTR(SERVICE_NAME_1), data.nextService1); - #endif - #if SERVICE_INTERVAL_2 > 0 - _service_when(buffer, PSTR(SERVICE_NAME_2), data.nextService2); - #endif - #if SERVICE_INTERVAL_3 > 0 - _service_when(buffer, PSTR(SERVICE_NAME_3), data.nextService3); - #endif -} - -void PrintCounter::tick() { - if (!isRunning()) return; - - millis_t now = millis(); - - static uint32_t update_next; // = 0 - if (ELAPSED(now, update_next)) { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("tick")); - #endif - millis_t delta = deltaDuration(); - data.printTime += delta; - - #if SERVICE_INTERVAL_1 > 0 - data.nextService1 -= _MIN(delta, data.nextService1); - #endif - #if SERVICE_INTERVAL_2 > 0 - data.nextService2 -= _MIN(delta, data.nextService2); - #endif - #if SERVICE_INTERVAL_3 > 0 - data.nextService3 -= _MIN(delta, data.nextService3); - #endif - - update_next = now + updateInterval * 1000; - } - - static uint32_t eeprom_next; // = 0 - if (ELAPSED(now, eeprom_next)) { - eeprom_next = now + saveInterval * 1000; - saveStats(); - } -} - -// @Override -bool PrintCounter::start() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("start")); - #endif - - bool paused = isPaused(); - - if (super::start()) { - if (!paused) { - data.totalPrints++; - lastDuration = 0; - } - return true; - } - - return false; -} - -// @Override -bool PrintCounter::stop() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - if (super::stop()) { - data.finishedPrints++; - data.printTime += deltaDuration(); - - if (duration() > data.longestPrint) - data.longestPrint = duration(); - - saveStats(); - return true; - } - else return false; -} - -// @Override -void PrintCounter::reset() { - #if ENABLED(DEBUG_PRINTCOUNTER) - debug(PSTR("stop")); - #endif - - super::reset(); - lastDuration = 0; -} - -#if HAS_SERVICE_INTERVALS - - void PrintCounter::resetServiceInterval(const int index) { - switch (index) { - #if SERVICE_INTERVAL_1 > 0 - case 1: data.nextService1 = SERVICE_INTERVAL_SEC_1; - #endif - #if SERVICE_INTERVAL_2 > 0 - case 2: data.nextService2 = SERVICE_INTERVAL_SEC_2; - #endif - #if SERVICE_INTERVAL_3 > 0 - case 3: data.nextService3 = SERVICE_INTERVAL_SEC_3; - #endif - } - saveStats(); - } - - bool PrintCounter::needsService(const int index) { - switch (index) { - #if SERVICE_INTERVAL_1 > 0 - case 1: return data.nextService1 == 0; - #endif - #if SERVICE_INTERVAL_2 > 0 - case 2: return data.nextService2 == 0; - #endif - #if SERVICE_INTERVAL_3 > 0 - case 3: return data.nextService3 == 0; - #endif - default: return false; - } - } - -#endif // HAS_SERVICE_INTERVALS - -#if ENABLED(DEBUG_PRINTCOUNTER) - - void PrintCounter::debug(const char func[]) { - if (DEBUGGING(INFO)) { - SERIAL_ECHOPGM("PrintCounter::"); - serialprintPGM(func); - SERIAL_ECHOLNPGM("()"); - } - } - -#endif - -#endif // PRINTCOUNTER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.h deleted file mode 100644 index fcc03a570e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/printcounter.h +++ /dev/null @@ -1,207 +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 - -#include "../libs/stopwatch.h" -#include "../libs/duration_t.h" -#include "../inc/MarlinConfig.h" - -// Print debug messages with M111 S2 -//#define DEBUG_PRINTCOUNTER - -#if EITHER(I2C_EEPROM, SPI_EEPROM) - // round up address to next page boundary (assuming 32 byte pages) - #define STATS_EEPROM_ADDRESS 0x40 -#else - #define STATS_EEPROM_ADDRESS 0x32 -#endif - -struct printStatistics { // 16 bytes - //const uint8_t magic; // Magic header, it will always be 0x16 - uint16_t totalPrints; // Number of prints - uint16_t finishedPrints; // Number of complete prints - uint32_t printTime; // Accumulated printing time - uint32_t longestPrint; // Longest successful print job - float filamentUsed; // Accumulated filament consumed in mm - #if SERVICE_INTERVAL_1 > 0 - uint32_t nextService1; // Service intervals (or placeholders) - #endif - #if SERVICE_INTERVAL_2 > 0 - uint32_t nextService2; - #endif - #if SERVICE_INTERVAL_3 > 0 - uint32_t nextService3; - #endif -}; - -class PrintCounter: public Stopwatch { - private: - typedef Stopwatch super; - - #if EITHER(I2C_EEPROM, SPI_EEPROM) || defined(CPU_32_BIT) - typedef uint32_t eeprom_address_t; - #else - typedef uint16_t eeprom_address_t; - #endif - - static printStatistics data; - - /** - * @brief EEPROM address - * @details Defines the start offset address where the data is stored. - */ - static const eeprom_address_t address; - - /** - * @brief Interval in seconds between counter updates - * @details This const value defines what will be the time between each - * accumulator update. This is different from the EEPROM save interval. - * - * @note The max value for this option is 60(s), otherwise integer - * overflow will happen. - */ - static constexpr uint16_t updateInterval = 10; - - /** - * @brief Interval in seconds between EEPROM saves - * @details This const value defines what will be the time between each - * EEPROM save cycle, the development team recommends to set this value - * no lower than 3600 secs (1 hour). - */ - static constexpr uint16_t saveInterval = 3600; - - /** - * @brief Timestamp of the last call to deltaDuration() - * @details Store the timestamp of the last deltaDuration(), this is - * required due to the updateInterval cycle. - */ - static millis_t lastDuration; - - /** - * @brief Stats were loaded from EEPROM - * @details If set to true it indicates if the statistical data was already - * loaded from the EEPROM. - */ - static bool loaded; - - protected: - /** - * @brief dT since the last call - * @details Return the elapsed time in seconds since the last call, this is - * used internally for print statistics accounting is not intended to be a - * user callable function. - */ - static millis_t deltaDuration(); - - public: - - /** - * @brief Initialize the print counter - */ - static inline void init() { - super::init(); - loadStats(); - } - - /** - * @brief Check if Print Statistics has been loaded - * @details Return true if the statistical data has been loaded. - * @return bool - */ - FORCE_INLINE static bool isLoaded() { return loaded; } - - /** - * @brief Increment the total filament used - * @details The total filament used counter will be incremented by "amount". - * - * @param amount The amount of filament used in mm - */ - static void incFilamentUsed(float const &amount); - - /** - * @brief Reset the Print Statistics - * @details Reset the statistics to zero and saves them to EEPROM creating - * also the magic header. - */ - static void initStats(); - - /** - * @brief Load the Print Statistics - * @details Load the statistics from EEPROM - */ - static void loadStats(); - - /** - * @brief Save the Print Statistics - * @details Save the statistics to EEPROM - */ - static void saveStats(); - - /** - * @brief Serial output the Print Statistics - * @details This function may change in the future, for now it directly - * prints the statistical data to serial. - */ - static void showStats(); - - /** - * @brief Return the currently loaded statistics - * @details Return the raw data, in the same structure used internally - */ - static printStatistics getStats() { return data; } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * periodically save the statistical data to EEPROM and do time keeping. - */ - static void tick(); - - /** - * The following functions are being overridden - */ - static bool start(); - static bool stop(); - static void reset(); - - #if HAS_SERVICE_INTERVALS - static void resetServiceInterval(const int index); - static bool needsService(const int index); - #endif - - #if ENABLED(DEBUG_PRINTCOUNTER) - - /** - * @brief Print a debug message - * @details Print a simple debug message - */ - static void debug(const char func[]); - - #endif -}; - -// Global Print Job Timer instance -#if ENABLED(PRINTCOUNTER) - extern PrintCounter print_job_timer; -#else - extern Stopwatch print_job_timer; -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.cpp deleted file mode 100644 index eaabd687f6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.cpp +++ /dev/null @@ -1,765 +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 . - * - */ - -/** - * probe.cpp - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - -#include "probe.h" - -#include "../libs/buzzer.h" -#include "motion.h" -#include "temperature.h" -#include "endstops.h" - -#include "../gcode/gcode.h" -#include "../lcd/ultralcd.h" - -#include "../Marlin.h" // for stop(), disable_e_steppers, wait_for_user - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if ENABLED(DELTA) - #include "delta.h" -#endif - -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - #include "planner.h" -#endif - -#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - #include "../feature/backlash.h" -#endif - -xyz_pos_t probe_offset; // Initialized by settings.load() - -#if ENABLED(BLTOUCH) - #include "../feature/bltouch.h" -#endif - -#if ENABLED(HOST_PROMPT_SUPPORT) - #include "../feature/host_actions.h" // for PROMPT_USER_CONTINUE -#endif - -#if HAS_Z_SERVO_PROBE - #include "servo.h" -#endif - -#if ENABLED(SENSORLESS_PROBING) - #include "stepper.h" - #include "../feature/tmc_util.h" -#endif - -#if QUIET_PROBING - #include "stepper/indirection.h" -#endif - -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extensible_ui/ui_api.h" -#endif - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../core/debug_out.h" - -#if ENABLED(Z_PROBE_SLED) - - #ifndef SLED_DOCKING_OFFSET - #define SLED_DOCKING_OFFSET 0 - #endif - - /** - * Method to dock/undock a sled designed by Charles Bell. - * - * stow[in] If false, move to MAX_X and engage the solenoid - * If true, move to MAX_X and release the solenoid - */ - static void dock_sled(bool stow) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("dock_sled(", stow, ")"); - - // Dock sled a bit closer to ensure proper capturing - do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); - - #if HAS_SOLENOID_1 && DISABLED(EXT_SOLENOID) - WRITE(SOL1_PIN, !stow); // switch solenoid - #endif - } - -#elif ENABLED(TOUCH_MI_PROBE) - - // Move to the magnet to unlock the probe - void run_deploy_moves_script() { - #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) - - const screenFunc_t prev_screen = ui.currentScreen; - LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI); - ui.return_to_status(); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI probe."), CONTINUE_STR); - #endif - while (wait_for_user) idle(); - 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 - } - - // Move down to the bed to stow the probe - void run_stow_moves_script() { - const xyz_pos_t oldpos = current_position; - endstops.enable_z_probe(false); - do_blocking_move_to_z(TOUCH_MI_RETRACT_Z, MMM_TO_MMS(HOMING_FEEDRATE_Z)); - do_blocking_move_to(oldpos, MMM_TO_MMS(HOMING_FEEDRATE_Z)); - } - -#elif ENABLED(Z_PROBE_ALLEN_KEY) - - void run_deploy_moves_script() { - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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() { - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - #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 - constexpr xyz_pos_t 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 - } - -#endif // Z_PROBE_ALLEN_KEY - -#if QUIET_PROBING - void probing_pause(const bool p) { - #if ENABLED(PROBING_HEATERS_OFF) - thermalManager.pause(p); - #endif - #if ENABLED(PROBING_FANS_OFF) - thermalManager.set_fans_paused(p); - #endif - #if ENABLED(PROBING_STEPPERS_OFF) - disable_e_steppers(); - #if NONE(DELTA, HOME_AFTER_DEACTIVATE) - disable_X(); disable_Y(); - #endif - #endif - if (p) safe_delay( - #if DELAY_BEFORE_PROBING > 25 - DELAY_BEFORE_PROBING - #else - 25 - #endif - ); - } -#endif // QUIET_PROBING - -/** - * Raise Z to a minimum height to make room for a probe to move - */ -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 (probe_offset.z < 0) z_dest -= probe_offset.z; - - NOMORE(z_dest, Z_MAX_POS); - - if (z_dest > current_position.z) - do_blocking_move_to_z(z_dest); -} - -FORCE_INLINE void probe_specific_action(const bool deploy) { - #if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) - do { - #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED) - if (deploy == (READ(Z_MIN_PROBE_PIN) == Z_MIN_PROBE_ENDSTOP_INVERTING)) break; - #endif - - BUZZ(100, 659); - BUZZ(100, 698); - - PGM_P const ds_str = deploy ? GET_TEXT(MSG_MANUAL_DEPLOY) : GET_TEXT(MSG_MANUAL_STOW); - ui.return_to_status(); // To display the new status message - ui.set_status_P(ds_str, 99); - serialprintPGM(ds_str); - SERIAL_EOL(); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR); - #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")); - #endif - while (wait_for_user) idle(); - ui.reset_status(); - - } while( - #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED) - true - #else - false - #endif - ); - - #endif // PAUSE_BEFORE_DEPLOY_STOW - - #if ENABLED(SOLENOID_PROBE) - - #if HAS_SOLENOID_1 - WRITE(SOL1_PIN, deploy); - #endif - - #elif ENABLED(Z_PROBE_SLED) - - dock_sled(!deploy); - - #elif HAS_Z_SERVO_PROBE - - #if DISABLED(BLTOUCH) - MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); - #elif ENABLED(BLTOUCH_HS_MODE) - // In HIGH SPEED MODE, use the normal retractable probe logic in this code - // i.e. no intermediate STOWs and DEPLOYs in between individual probe actions - if (deploy) bltouch.deploy(); else bltouch.stow(); - #endif - - #elif EITHER(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY) - - deploy ? run_deploy_moves_script() : run_stow_moves_script(); - - #elif ENABLED(RACK_AND_PINION_PROBE) - - do_blocking_move_to_x(deploy ? Z_PROBE_DEPLOY_X : Z_PROBE_RETRACT_X); - - #elif DISABLED(PAUSE_BEFORE_DEPLOY_STOW) - - UNUSED(deploy); - - #endif -} - -// returns false for ok and true for failure -bool set_probe_deployed(const bool deploy) { - - if (DEBUGGING(LEVELING)) { - DEBUG_POS("set_probe_deployed", current_position); - DEBUG_ECHOLNPAIR("deploy: ", deploy); - } - - if (endstops.z_probe_enabled == deploy) return false; - - // Make room for probe to deploy (or stow) - // Fix-mounted probe should only raise for deploy - // unless PAUSE_BEFORE_DEPLOY_STOW is enabled - #if ENABLED(FIX_MOUNTED_PROBE) && DISABLED(PAUSE_BEFORE_DEPLOY_STOW) - const bool deploy_stow_condition = deploy; - #else - constexpr bool deploy_stow_condition = true; - #endif - - // For beds that fall when Z is powered off only raise for trusted Z - #if ENABLED(UNKNOWN_Z_NO_RAISE) - const bool unknown_condition = TEST(axis_known_position, Z_AXIS); - #else - constexpr float unknown_condition = true; - #endif - - if (deploy_stow_condition && unknown_condition) - do_probe_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); - - #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) - if (axis_unhomed_error( - #if ENABLED(Z_PROBE_SLED) - _BV(X_AXIS) - #endif - )) { - SERIAL_ERROR_MSG(MSG_STOP_UNHOMED); - stop(); - return true; - } - #endif - - const xy_pos_t old_xy = current_position; - - #if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) - #if HAS_CUSTOM_PROBE_PIN - #define PROBE_STOWED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define PROBE_STOWED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - #endif - - #ifdef PROBE_STOWED - - // Only deploy/stow if needed - if (PROBE_STOWED() == deploy) { - if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early - // otherwise an Allen-Key probe can't be stowed. - probe_specific_action(deploy); - } - - if (PROBE_STOWED() == deploy) { // Unchanged after deploy/stow action? - if (IsRunning()) { - SERIAL_ERROR_MSG("Z-Probe failed"); - LCD_ALERTMESSAGEPGM_P(PSTR("Err: ZPROBE")); - } - stop(); - return true; - } - - #else - - probe_specific_action(deploy); - - #endif - - do_blocking_move_to(old_xy); - endstops.enable_z_probe(deploy); - return false; -} - -#ifdef Z_AFTER_PROBING - // After probing move to a preferred Z position - void move_z_after_probing() { - if (current_position.z != Z_AFTER_PROBING) { - do_blocking_move_to_z(Z_AFTER_PROBING); - current_position.z = Z_AFTER_PROBING; - } - } -#endif - -/** - * @brief Used by run_z_probe to do a single Z probe move. - * - * @param z Z destination - * @param fr_mm_s Feedrate in mm/s - * @return true to indicate an error - */ - -#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) - const char msg_wait_for_bed_heating[25] PROGMEM = "Wait for bed heating...\n"; -#endif - -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) - // Wait for bed to heat back up between probing points - if (thermalManager.isHeatingBed()) { - serialprintPGM(msg_wait_for_bed_heating); - LCD_MESSAGEPGM(MSG_BED_HEATING); - thermalManager.wait_for_bed(); - ui.reset_status(); - } - #endif - - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (bltouch.deploy()) return true; // DEPLOY in LOW SPEED MODE on every probe action - #endif - - // Disable stealthChop if used. Enable diag1 pin on driver. - #if ENABLED(SENSORLESS_PROBING) - sensorless_t stealth_states { false }; - #if ENABLED(DELTA) - stealth_states.x = tmc_enable_stallguard(stepperX); - stealth_states.y = tmc_enable_stallguard(stepperY); - #endif - stealth_states.z = tmc_enable_stallguard(stepperZ); - endstops.enable(true); - #endif - - #if QUIET_PROBING - probing_pause(true); - #endif - - // Move down until the probe is triggered - do_blocking_move_to_z(z, fr_mm_s); - - // Check to see if the probe was triggered - const bool probe_triggered = - #if BOTH(DELTA, SENSORLESS_PROBING) - endstops.trigger_state() & (_BV(X_MIN) | _BV(Y_MIN) | _BV(Z_MIN)) - #else - TEST(endstops.trigger_state(), - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - Z_MIN - #else - Z_MIN_PROBE - #endif - ) - #endif - ; - - #if QUIET_PROBING - probing_pause(false); - #endif - - // Re-enable stealthChop if used. Disable diag1 pin on driver. - #if ENABLED(SENSORLESS_PROBING) - endstops.not_homing(); - #if ENABLED(DELTA) - tmc_disable_stallguard(stepperX, stealth_states.x); - tmc_disable_stallguard(stepperY, stealth_states.y); - #endif - tmc_disable_stallguard(stepperZ, stealth_states.z); - #endif - - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (probe_triggered && bltouch.stow()) return true; // STOW in LOW SPEED MODE on trigger on every probe action - #endif - - // Clear endstop flags - endstops.hit_on_purpose(); - - // Get Z where the steppers were interrupted - set_current_from_steppers_for_axis(Z_AXIS); - - // Tell the planner where we actually are - sync_plan_position(); - - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position); - - return !probe_triggered; -} - -/** - * @brief Probe at the current XY (possibly more than once) to find the bed Z. - * - * @details Used by probe_at_point to get the bed Z height at the current XY. - * Leaves current_position.z at the height where the probe triggered. - * - * @return The Z position of the bed at the current XY or NAN on error. - */ -static float run_z_probe() { - - if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position); - - // 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) ? -probe_offset.z + Z_PROBE_LOW_POINT : -10.0; - - // Double-probing does a fast probe followed by a slow probe - #if TOTAL_PROBING == 2 - - // Do a first probe at the fast speed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("FAST Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - return NAN; - } - - const float first_probe_z = current_position.z; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("1st Probe Z:", first_probe_z); - - // Raise to give the probe clearance - do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - - #elif Z_PROBE_SPEED_FAST != Z_PROBE_SPEED_SLOW - - // 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 + (probe_offset.z < 0 ? -probe_offset.z : 0); - if (current_position.z > 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))) - do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - } - #endif - - #ifdef EXTRA_PROBING - float probes[TOTAL_PROBING]; - #endif - - #if TOTAL_PROBING > 2 - float probes_total = 0; - for ( - #if EXTRA_PROBING - uint8_t p = 0; p < TOTAL_PROBING; p++ - #else - uint8_t p = TOTAL_PROBING; p--; - #endif - ) - #endif - { - // Probe downward slowly to find the bed - if (do_probe_move(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW))) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("SLOW Probe fail!"); - DEBUG_POS("<<< run_z_probe", current_position); - } - return NAN; - } - - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - backlash.measure_with_probe(); - #endif - - const float z = current_position.z; - - #if EXTRA_PROBING - // Insert Z measurement into probes[]. Keep it sorted ascending. - for (uint8_t i = 0; i <= p; i++) { // Iterate the saved Zs to insert the new Z - if (i == p || probes[i] > z) { // Last index or new Z is smaller than this Z - for (int8_t m = p; --m >= i;) probes[m + 1] = probes[m]; // Shift items down after the insertion point - probes[i] = z; // Insert the new Z measurement - break; // Only one to insert. Done! - } - } - #elif TOTAL_PROBING > 2 - probes_total += z; - #else - UNUSED(z); - #endif - - #if TOTAL_PROBING > 2 - // Small Z raise after all but the last probe - if (p - #if EXTRA_PROBING - < TOTAL_PROBING - 1 - #endif - ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - #endif - } - - #if TOTAL_PROBING > 2 - - #if EXTRA_PROBING - // Take the center value (or average the two middle values) as the median - static constexpr int PHALF = (TOTAL_PROBING - 1) / 2; - const float middle = probes[PHALF], - median = ((TOTAL_PROBING) & 1) ? middle : (middle + probes[PHALF + 1]) * 0.5f; - - // Remove values farthest from the median - uint8_t min_avg_idx = 0, max_avg_idx = TOTAL_PROBING - 1; - for (uint8_t i = EXTRA_PROBING; i--;) - if (ABS(probes[max_avg_idx] - median) > ABS(probes[min_avg_idx] - median)) - max_avg_idx--; else min_avg_idx++; - - // Return the average value of all remaining probes. - for (uint8_t i = min_avg_idx; i <= max_avg_idx; i++) - probes_total += probes[i]; - - #endif - - const float measured_z = probes_total * RECIPROCAL(MULTIPLE_PROBING); - - #elif TOTAL_PROBING == 2 - - const float z2 = current_position.z; - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2); - - // Return a weighted average of the fast and slow probes - const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2; - - #else - - // Return the single probe result - const float measured_z = current_position.z; - - #endif - - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); - - return measured_z; -} - -/** - * - Move to the given XY - * - Deploy the probe, if not already deployed - * - Probe the bed, get the Z position - * - Depending on the 'stow' flag - * - Stow the probe, or - * - Raise to the BETWEEN height - * - Return the probed Z position - */ -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_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)" - ); - DEBUG_POS("", current_position); - } - - // TODO: Adapt for SCARA, where the offset rotates - xyz_pos_t npos = { rx, ry }; - if (probe_relative) { - if (!position_is_reachable_by_probe(npos)) return NAN; // The given position is in terms of the probe - npos -= probe_offset; // Get the nozzle position - } - else if (!position_is_reachable(npos)) return NAN; // The given position is in terms of the nozzle - - npos.z = - #if ENABLED(DELTA) - // Move below clip height or xy move will be aborted by do_blocking_move_to - _MIN(current_position.z, delta_clip_start_height) - #else - current_position.z - #endif - ; - - const float old_feedrate_mm_s = feedrate_mm_s; - feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; - - // Move the probe to the starting XYZ - do_blocking_move_to(npos); - - float measured_z = NAN; - if (!DEPLOY_PROBE()) { - measured_z = run_z_probe() + probe_offset.z; - - const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; - if (big_raise || raise_after == PROBE_PT_RAISE) - do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); - else if (raise_after == PROBE_PT_STOW) - if (STOW_PROBE()) measured_z = NAN; - } - - if (verbose_level > 2) { - SERIAL_ECHOPAIR_F("Bed X: ", LOGICAL_X_POSITION(rx), 3); - SERIAL_ECHOPAIR_F(" Y: ", LOGICAL_Y_POSITION(ry), 3); - SERIAL_ECHOLNPAIR_F(" Z: ", measured_z, 3); - } - - feedrate_mm_s = old_feedrate_mm_s; - - if (isnan(measured_z)) { - STOW_PROBE(); - LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); - SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED); - } - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< probe_at_point"); - - return measured_z; -} - -#if HAS_Z_SERVO_PROBE - - void servo_probe_init() { - /** - * Set position of Z Servo Endstop - * - * The servo might be deployed and positioned too low to stow - * when starting up the machine or rebooting the board. - * There's no way to know where the nozzle is positioned until - * homing has been done - no homing with z-probe without init! - * - */ - STOW_Z_SERVO(); - } - -#endif // HAS_Z_SERVO_PROBE - -#endif // HAS_BED_PROBE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.h deleted file mode 100644 index 928eb43ab5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/probe.h +++ /dev/null @@ -1,152 +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 - -/** - * probe.h - Move, deploy, enable, etc. - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_BED_PROBE - - extern xyz_pos_t probe_offset; - - bool set_probe_deployed(const bool deploy); - #ifdef Z_AFTER_PROBING - void move_z_after_probing(); - #endif - enum ProbePtRaise : unsigned char { - PROBE_PT_NONE, // No raise or stow after run_z_probe - PROBE_PT_STOW, // Do a complete stow after run_z_probe - 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_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); - inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) { - return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative); - } - #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 xyz_pos_t probe_offset{0}; - - #define DEPLOY_PROBE() - #define STOW_PROBE() - -#endif - -#if HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) - #if IS_KINEMATIC - constexpr float printable_radius = ( - #if ENABLED(DELTA) - DELTA_PRINTABLE_RADIUS - #elif IS_SCARA - SCARA_PRINTABLE_RADIUS - #endif - ); - - inline float probe_radius() { - return printable_radius - ( - #if HAS_BED_PROBE - _MAX(MIN_PROBE_EDGE, HYPOT(probe_offset.x, probe_offset.y)) - #else - MIN_PROBE_EDGE - #endif - ); - } - #endif - - inline float probe_min_x() { - return ( - #if IS_KINEMATIC - (X_CENTER) - probe_radius() - #else - _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset.x) - #endif - ); - } - inline float probe_max_x() { - return ( - #if IS_KINEMATIC - (X_CENTER) + probe_radius() - #else - _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset.x) - #endif - ); - } - inline float probe_min_y() { - return ( - #if IS_KINEMATIC - (Y_CENTER) - probe_radius() - #else - _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset.y) - #endif - ); - } - inline float probe_max_y() { - return ( - #if IS_KINEMATIC - (Y_CENTER) + probe_radius() - #else - _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset.y) - #endif - ); - } - - #if NEEDS_THREE_PROBE_POINTS - // Retrieve three points to probe the bed. Any type exposing set(X,Y) may be used. - template - inline void get_three_probe_points(T points[3]) { - #if ENABLED(HAS_FIXED_3POINT) - points[0].set(PROBE_PT_1_X, PROBE_PT_1_Y); - points[1].set(PROBE_PT_2_X, PROBE_PT_2_Y); - points[2].set(PROBE_PT_3_X, PROBE_PT_3_Y); - #else - #if IS_KINEMATIC - constexpr float SIN0 = 0.0, SIN120 = 0.866025, SIN240 = -0.866025, - COS0 = 1.0, COS120 = -0.5 , COS240 = -0.5; - points[0].set((X_CENTER) + probe_radius() * COS0, (Y_CENTER) + probe_radius() * SIN0); - points[1].set((X_CENTER) + probe_radius() * COS120, (Y_CENTER) + probe_radius() * SIN120); - points[2].set((X_CENTER) + probe_radius() * COS240, (Y_CENTER) + probe_radius() * SIN240); - #else - points[0].set(probe_min_x(), probe_min_y()); - points[1].set(probe_max_x(), probe_min_y()); - points[2].set((probe_max_x() - probe_min_x()) / 2, probe_max_y()); - #endif - #endif - } - #endif -#endif - -#if HAS_Z_SERVO_PROBE - void servo_probe_init(); -#endif - -#if QUIET_PROBING - void probing_pause(const bool p); -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.cpp deleted file mode 100644 index de7880e2d3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.cpp +++ /dev/null @@ -1,163 +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 . - * - */ - -/** - * scara.cpp - */ - -#include "../inc/MarlinConfig.h" - -#if IS_SCARA - -#include "scara.h" -#include "motion.h" -#include "planner.h" - -float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND; - -void scara_set_axis_is_at_home(const AxisEnum axis) { - if (axis == Z_AXIS) - current_position.z = Z_HOME_POS; - else { - - /** - * SCARA homes XY at the same time - */ - xyz_pos_t homeposition; - LOOP_XYZ(i) homeposition[i] = base_home_pos((AxisEnum)i); - - #if ENABLED(MORGAN_SCARA) - // MORGAN_SCARA uses arm angles for AB home position - // SERIAL_ECHOLNPAIR("homeposition A:", homeposition.a, " B:", homeposition.b); - inverse_kinematics(homeposition); - forward_kinematics_SCARA(delta.a, delta.b); - current_position[axis] = cartes[axis]; - #else - // MP_SCARA uses a Cartesian XY home position - // SERIAL_ECHOLNPAIR("homeposition X:", homeposition.x, " Y:", homeposition.y); - current_position[axis] = homeposition[axis]; - #endif - - // SERIAL_ECHOLNPAIR("Cartesian X:", current_position.x, " Y:", current_position.y); - update_software_endstops(axis); - } -} - -static constexpr xy_pos_t scara_offset = { SCARA_OFFSET_X, SCARA_OFFSET_Y }; - -/** - * Morgan SCARA Forward Kinematics. Results in 'cartes'. - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ -void forward_kinematics_SCARA(const float &a, const float &b) { - - const float a_sin = sin(RADIANS(a)) * L1, - a_cos = cos(RADIANS(a)) * L1, - b_sin = sin(RADIANS(b)) * L2, - b_cos = cos(RADIANS(b)) * L2; - - cartes.set(a_cos + b_cos + scara_offset.x, // theta - a_sin + b_sin + scara_offset.y); // theta+phi - - /* - SERIAL_ECHOLNPAIR( - "SCARA FK Angle a=", a, - " b=", b, - " a_sin=", a_sin, - " a_cos=", a_cos, - " b_sin=", b_sin, - " b_cos=", b_cos - ); - SERIAL_ECHOLNPAIR(" cartes (X,Y) = "(cartes.x, ", ", cartes.y, ")"); - //*/ -} - -void inverse_kinematics(const xyz_pos_t &raw) { - - #if ENABLED(MORGAN_SCARA) - - /** - * Morgan SCARA Inverse Kinematics. Results in 'delta'. - * - * See http://forums.reprap.org/read.php?185,283327 - * - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ - float C2, S2, SK1, SK2, THETA, PSI; - - // Translate SCARA to standard XY with scaling factor - const xy_pos_t spos = raw - scara_offset; - - const float H2 = HYPOT2(spos.x, spos.y); - if (L1 == L2) - C2 = H2 / L1_2_2 - 1; - else - C2 = (H2 - (L1_2 + L2_2)) / (2.0f * L1 * L2); - - S2 = SQRT(1.0f - sq(C2)); - - // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End - SK1 = L1 + L2 * C2; - - // Rotated Arm2 gives the distance from Arm1 to Arm2 - SK2 = L2 * S2; - - // Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow - THETA = ATAN2(SK1, SK2) - ATAN2(spos.x, spos.y); - - // Angle of Arm2 - PSI = ATAN2(S2, C2); - - delta.set(DEGREES(THETA), DEGREES(THETA + PSI), raw.z); - - /* - DEBUG_POS("SCARA IK", raw); - DEBUG_POS("SCARA IK", delta); - SERIAL_ECHOLNPAIR(" SCARA (x,y) ", sx, ",", sy, " C2=", C2, " S2=", S2, " Theta=", THETA, " Phi=", PHI); - //*/ - - #else // MP_SCARA - - const float x = raw.x, y = raw.y, c = HYPOT(x, y), - THETA3 = ATAN2(y, x), - THETA1 = THETA3 + ACOS((sq(c) + sq(L1) - sq(L2)) / (2.0f * c * L1)), - THETA2 = THETA3 - ACOS((sq(c) + sq(L2) - sq(L1)) / (2.0f * c * L2)); - - delta.set(DEGREES(THETA1), DEGREES(THETA2), raw.z); - - /* - DEBUG_POS("SCARA IK", raw); - DEBUG_POS("SCARA IK", delta); - SERIAL_ECHOLNPAIR(" SCARA (x,y) ", x, ",", y," Theta1=", THETA1, " Theta2=", THETA2); - //*/ - - #endif // MP_SCARA -} - -void scara_report_positions() { - SERIAL_ECHOLNPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS), " Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); - SERIAL_EOL(); -} - -#endif // IS_SCARA diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.h deleted file mode 100644 index cde1d1bcd6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/scara.h +++ /dev/null @@ -1,42 +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 - -/** - * scara.h - SCARA-specific functions - */ - -#include "../core/macros.h" - -extern float delta_segments_per_second; - -// Float constants for SCARA calculations -float constexpr L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, - L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2, - L2_2 = sq(float(L2)); - -void scara_set_axis_is_at_home(const AxisEnum axis); - -void inverse_kinematics(const xyz_pos_t &raw); -void forward_kinematics_SCARA(const float &a, const float &b); - -void scara_report_positions(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.cpp deleted file mode 100644 index c9d0431538..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.cpp +++ /dev/null @@ -1,58 +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 . - * - */ - -/** - * module/servo.cpp - */ - -#include "../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "servo.h" - -HAL_SERVO_LIB servo[NUM_SERVOS]; - -#if ENABLED(EDITABLE_SERVO_ANGLES) - uint16_t servo_angles[NUM_SERVOS][2]; -#endif - -void servo_init() { - #if NUM_SERVOS >= 1 && HAS_SERVO_0 - servo[0].attach(SERVO0_PIN); - servo[0].detach(); // Just set up the pin. We don't have a position yet. Don't move to a random position. - #endif - #if NUM_SERVOS >= 2 && HAS_SERVO_1 - servo[1].attach(SERVO1_PIN); - servo[1].detach(); - #endif - #if NUM_SERVOS >= 3 && HAS_SERVO_2 - servo[2].attach(SERVO2_PIN); - servo[2].detach(); - #endif - #if NUM_SERVOS >= 4 && HAS_SERVO_3 - servo[3].attach(SERVO3_PIN); - servo[3].detach(); - #endif -} - -#endif // HAS_SERVOS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.h deleted file mode 100644 index 4ead93cd5c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/servo.h +++ /dev/null @@ -1,96 +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 - -/** - * module/servo.h - */ - -#include "../inc/MarlinConfig.h" -#include "../HAL/shared/servo.h" - -#if HAS_SERVO_ANGLES - - #if ENABLED(SWITCHING_EXTRUDER) - #ifndef SWITCHING_EXTRUDER_E23_SERVO_NR - #define SWITCHING_EXTRUDER_E23_SERVO_NR -1 - #endif - #if EXTRUDERS > 3 - #define REQ_ANGLES 4 - #else - #define REQ_ANGLES 2 - #endif - #define SADATA SWITCHING_EXTRUDER_SERVO_ANGLES - #define ASRC(N,E) (SWITCHING_EXTRUDER_SERVO_NR == N ? asrc[E] : SWITCHING_EXTRUDER_E23_SERVO_NR == N ? asrc[E+2] : 0) - #elif ENABLED(SWITCHING_NOZZLE) - #define SADATA SWITCHING_NOZZLE_SERVO_ANGLES - #define ASRC(N,E) (SWITCHING_NOZZLE_SERVO_NR == N ? asrc[E] : 0) - #elif defined(Z_PROBE_SERVO_NR) - #define ASRC(N,E) (Z_PROBE_SERVO_NR == N ? asrc[E] : 0) - #if ENABLED(BLTOUCH) - #include "../feature/bltouch.h" - #endif - #ifdef BLTOUCH_ANGLES - #define SADATA BLTOUCH_ANGLES - #elif defined(Z_SERVO_ANGLES) - #define SADATA Z_SERVO_ANGLES - #else - #error "Servo angles are needed!" - #endif - #endif - - #if ENABLED(EDITABLE_SERVO_ANGLES) - extern uint16_t servo_angles[NUM_SERVOS][2]; - #define BASE_SERVO_ANGLES base_servo_angles - #else - #define BASE_SERVO_ANGLES servo_angles - #endif - - constexpr uint16_t asrc[] = SADATA; - #if REQ_ANGLES - static_assert(COUNT(asrc) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - #endif - - constexpr uint16_t BASE_SERVO_ANGLES [NUM_SERVOS][2] = { - { ASRC(0,0), ASRC(0,1) } - #if NUM_SERVOS > 1 - , { ASRC(1,0), ASRC(1,1) } - #if NUM_SERVOS > 2 - , { ASRC(2,0), ASRC(2,1) } - #if NUM_SERVOS > 3 - , { ASRC(3,0), ASRC(3,1) } - #endif - #endif - #endif - }; - - #if HAS_Z_SERVO_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1]) - #endif - -#endif // HAS_SERVO_ANGLES - -#define MOVE_SERVO(I, P) servo[I].move(P) - -extern HAL_SERVO_LIB servo[NUM_SERVOS]; -extern void servo_init(); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/speed_lookuptable.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/speed_lookuptable.h deleted file mode 100644 index b4cf8b94b8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/speed_lookuptable.h +++ /dev/null @@ -1,168 +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 - -#if F_CPU == 16000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, - { 961, 105}, { 856, 85}, { 771, 69}, { 702, 58}, { 644, 49}, { 595, 42}, { 553, 37}, { 516, 32}, - { 484, 28}, { 456, 25}, { 431, 23}, { 408, 20}, { 388, 19}, { 369, 16}, { 353, 16}, { 337, 14}, - { 323, 13}, { 310, 11}, { 299, 11}, { 288, 11}, { 277, 9}, { 268, 9}, { 259, 8}, { 251, 8}, - { 243, 8}, { 235, 7}, { 228, 6}, { 222, 6}, { 216, 6}, { 210, 6}, { 204, 5}, { 199, 5}, - { 194, 5}, { 189, 4}, { 185, 4}, { 181, 4}, { 177, 4}, { 173, 4}, { 169, 4}, { 165, 3}, - { 162, 3}, { 159, 4}, { 155, 3}, { 152, 3}, { 149, 2}, { 147, 3}, { 144, 3}, { 141, 2}, - { 139, 3}, { 136, 2}, { 134, 2}, { 132, 3}, { 129, 2}, { 127, 2}, { 125, 2}, { 123, 2}, - { 121, 2}, { 119, 1}, { 118, 2}, { 116, 2}, { 114, 1}, { 113, 2}, { 111, 2}, { 109, 1}, - { 108, 2}, { 106, 1}, { 105, 2}, { 103, 1}, { 102, 1}, { 101, 1}, { 100, 2}, { 98, 1}, - { 97, 1}, { 96, 1}, { 95, 2}, { 93, 1}, { 92, 1}, { 91, 1}, { 90, 1}, { 89, 1}, - { 88, 1}, { 87, 1}, { 86, 1}, { 85, 1}, { 84, 1}, { 83, 0}, { 83, 1}, { 82, 1}, - { 81, 1}, { 80, 1}, { 79, 1}, { 78, 0}, { 78, 1}, { 77, 1}, { 76, 1}, { 75, 0}, - { 75, 1}, { 74, 1}, { 73, 1}, { 72, 0}, { 72, 1}, { 71, 1}, { 70, 0}, { 70, 1}, - { 69, 0}, { 69, 1}, { 68, 1}, { 67, 0}, { 67, 1}, { 66, 0}, { 66, 1}, { 65, 0}, - { 65, 1}, { 64, 1}, { 63, 0}, { 63, 1}, { 62, 0}, { 62, 1}, { 61, 0}, { 61, 1}, - { 60, 0}, { 60, 0}, { 60, 1}, { 59, 0}, { 59, 1}, { 58, 0}, { 58, 1}, { 57, 0}, - { 57, 1}, { 56, 0}, { 56, 0}, { 56, 1}, { 55, 0}, { 55, 1}, { 54, 0}, { 54, 0}, - { 54, 1}, { 53, 0}, { 53, 0}, { 53, 1}, { 52, 0}, { 52, 0}, { 52, 1}, { 51, 0}, - { 51, 0}, { 51, 1}, { 50, 0}, { 50, 0}, { 50, 1}, { 49, 0}, { 49, 0}, { 49, 1}, - { 48, 0}, { 48, 0}, { 48, 1}, { 47, 0}, { 47, 0}, { 47, 0}, { 47, 1}, { 46, 0}, - { 46, 0}, { 46, 1}, { 45, 0}, { 45, 0}, { 45, 0}, { 45, 1}, { 44, 0}, { 44, 0}, - { 44, 0}, { 44, 1}, { 43, 0}, { 43, 0}, { 43, 0}, { 43, 1}, { 42, 0}, { 42, 0}, - { 42, 0}, { 42, 1}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 1}, { 40, 0}, - { 40, 0}, { 40, 0}, { 40, 0}, { 40, 1}, { 39, 0}, { 39, 0}, { 39, 0}, { 39, 0}, - { 39, 1}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 1}, { 37, 0}, { 37, 0}, - { 37, 0}, { 37, 0}, { 37, 0}, { 37, 1}, { 36, 0}, { 36, 0}, { 36, 0}, { 36, 0}, - { 36, 1}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 1}, - { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 1}, { 33, 0}, { 33, 0}, - { 33, 0}, { 33, 0}, { 33, 0}, { 33, 0}, { 33, 1}, { 32, 0}, { 32, 0}, { 32, 0}, - { 32, 0}, { 32, 0}, { 32, 0}, { 32, 0}, { 32, 1}, { 31, 0}, { 31, 0}, { 31, 0}, - { 31, 0}, { 31, 0}, { 31, 0}, { 31, 1}, { 30, 0}, { 30, 0}, { 30, 0}, { 30, 0} - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - { 62500, 12500}, { 50000, 8334}, { 41666, 5952}, { 35714, 4464}, { 31250, 3473}, { 27777, 2777}, { 25000, 2273}, { 22727, 1894}, - { 20833, 1603}, { 19230, 1373}, { 17857, 1191}, { 16666, 1041}, { 15625, 920}, { 14705, 817}, { 13888, 731}, { 13157, 657}, - { 12500, 596}, { 11904, 541}, { 11363, 494}, { 10869, 453}, { 10416, 416}, { 10000, 385}, { 9615, 356}, { 9259, 331}, - { 8928, 308}, { 8620, 287}, { 8333, 269}, { 8064, 252}, { 7812, 237}, { 7575, 223}, { 7352, 210}, { 7142, 198}, - { 6944, 188}, { 6756, 178}, { 6578, 168}, { 6410, 160}, { 6250, 153}, { 6097, 145}, { 5952, 139}, { 5813, 132}, - { 5681, 126}, { 5555, 121}, { 5434, 115}, { 5319, 111}, { 5208, 106}, { 5102, 102}, { 5000, 99}, { 4901, 94}, - { 4807, 91}, { 4716, 87}, { 4629, 84}, { 4545, 81}, { 4464, 79}, { 4385, 75}, { 4310, 73}, { 4237, 71}, - { 4166, 68}, { 4098, 66}, { 4032, 64}, { 3968, 62}, { 3906, 60}, { 3846, 59}, { 3787, 56}, { 3731, 55}, - { 3676, 53}, { 3623, 52}, { 3571, 50}, { 3521, 49}, { 3472, 48}, { 3424, 46}, { 3378, 45}, { 3333, 44}, - { 3289, 43}, { 3246, 41}, { 3205, 41}, { 3164, 39}, { 3125, 39}, { 3086, 38}, { 3048, 36}, { 3012, 36}, - { 2976, 35}, { 2941, 35}, { 2906, 33}, { 2873, 33}, { 2840, 32}, { 2808, 31}, { 2777, 30}, { 2747, 30}, - { 2717, 29}, { 2688, 29}, { 2659, 28}, { 2631, 27}, { 2604, 27}, { 2577, 26}, { 2551, 26}, { 2525, 25}, - { 2500, 25}, { 2475, 25}, { 2450, 23}, { 2427, 24}, { 2403, 23}, { 2380, 22}, { 2358, 22}, { 2336, 22}, - { 2314, 21}, { 2293, 21}, { 2272, 20}, { 2252, 20}, { 2232, 20}, { 2212, 20}, { 2192, 19}, { 2173, 18}, - { 2155, 19}, { 2136, 18}, { 2118, 18}, { 2100, 17}, { 2083, 17}, { 2066, 17}, { 2049, 17}, { 2032, 16}, - { 2016, 16}, { 2000, 16}, { 1984, 16}, { 1968, 15}, { 1953, 16}, { 1937, 14}, { 1923, 15}, { 1908, 15}, - { 1893, 14}, { 1879, 14}, { 1865, 14}, { 1851, 13}, { 1838, 14}, { 1824, 13}, { 1811, 13}, { 1798, 13}, - { 1785, 12}, { 1773, 13}, { 1760, 12}, { 1748, 12}, { 1736, 12}, { 1724, 12}, { 1712, 12}, { 1700, 11}, - { 1689, 12}, { 1677, 11}, { 1666, 11}, { 1655, 11}, { 1644, 11}, { 1633, 10}, { 1623, 11}, { 1612, 10}, - { 1602, 10}, { 1592, 10}, { 1582, 10}, { 1572, 10}, { 1562, 10}, { 1552, 9}, { 1543, 10}, { 1533, 9}, - { 1524, 9}, { 1515, 9}, { 1506, 9}, { 1497, 9}, { 1488, 9}, { 1479, 9}, { 1470, 9}, { 1461, 8}, - { 1453, 8}, { 1445, 9}, { 1436, 8}, { 1428, 8}, { 1420, 8}, { 1412, 8}, { 1404, 8}, { 1396, 8}, - { 1388, 7}, { 1381, 8}, { 1373, 7}, { 1366, 8}, { 1358, 7}, { 1351, 7}, { 1344, 8}, { 1336, 7}, - { 1329, 7}, { 1322, 7}, { 1315, 7}, { 1308, 6}, { 1302, 7}, { 1295, 7}, { 1288, 6}, { 1282, 7}, - { 1275, 6}, { 1269, 7}, { 1262, 6}, { 1256, 6}, { 1250, 7}, { 1243, 6}, { 1237, 6}, { 1231, 6}, - { 1225, 6}, { 1219, 6}, { 1213, 6}, { 1207, 6}, { 1201, 5}, { 1196, 6}, { 1190, 6}, { 1184, 5}, - { 1179, 6}, { 1173, 5}, { 1168, 6}, { 1162, 5}, { 1157, 5}, { 1152, 6}, { 1146, 5}, { 1141, 5}, - { 1136, 5}, { 1131, 5}, { 1126, 5}, { 1121, 5}, { 1116, 5}, { 1111, 5}, { 1106, 5}, { 1101, 5}, - { 1096, 5}, { 1091, 5}, { 1086, 4}, { 1082, 5}, { 1077, 5}, { 1072, 4}, { 1068, 5}, { 1063, 4}, - { 1059, 5}, { 1054, 4}, { 1050, 4}, { 1046, 5}, { 1041, 4}, { 1037, 4}, { 1033, 5}, { 1028, 4}, - { 1024, 4}, { 1020, 4}, { 1016, 4}, { 1012, 4}, { 1008, 4}, { 1004, 4}, { 1000, 4}, { 996, 4}, - { 992, 4}, { 988, 4}, { 984, 4}, { 980, 4}, { 976, 4}, { 972, 4}, { 968, 3}, { 965, 3} - }; - -#elif F_CPU == 20000000 - - const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { - {62500, 54055}, {8445, 3917}, {4528, 1434}, {3094, 745}, {2349, 456}, {1893, 307}, {1586, 222}, {1364, 167}, - {1197, 131}, {1066, 105}, {961, 86}, {875, 72}, {803, 61}, {742, 53}, {689, 45}, {644, 40}, - {604, 35}, {569, 32}, {537, 28}, {509, 25}, {484, 23}, {461, 21}, {440, 19}, {421, 17}, - {404, 16}, {388, 15}, {373, 14}, {359, 13}, {346, 12}, {334, 11}, {323, 10}, {313, 10}, - {303, 9}, {294, 9}, {285, 8}, {277, 7}, {270, 8}, {262, 7}, {255, 6}, {249, 6}, - {243, 6}, {237, 6}, {231, 5}, {226, 5}, {221, 5}, {216, 5}, {211, 4}, {207, 5}, - {202, 4}, {198, 4}, {194, 4}, {190, 3}, {187, 4}, {183, 3}, {180, 3}, {177, 4}, - {173, 3}, {170, 3}, {167, 2}, {165, 3}, {162, 3}, {159, 2}, {157, 3}, {154, 2}, - {152, 3}, {149, 2}, {147, 2}, {145, 2}, {143, 2}, {141, 2}, {139, 2}, {137, 2}, - {135, 2}, {133, 2}, {131, 2}, {129, 1}, {128, 2}, {126, 2}, {124, 1}, {123, 2}, - {121, 1}, {120, 2}, {118, 1}, {117, 1}, {116, 2}, {114, 1}, {113, 1}, {112, 2}, - {110, 1}, {109, 1}, {108, 1}, {107, 2}, {105, 1}, {104, 1}, {103, 1}, {102, 1}, - {101, 1}, {100, 1}, {99, 1}, {98, 1}, {97, 1}, {96, 1}, {95, 1}, {94, 1}, - {93, 1}, {92, 1}, {91, 0}, {91, 1}, {90, 1}, {89, 1}, {88, 1}, {87, 0}, - {87, 1}, {86, 1}, {85, 1}, {84, 0}, {84, 1}, {83, 1}, {82, 1}, {81, 0}, - {81, 1}, {80, 1}, {79, 0}, {79, 1}, {78, 0}, {78, 1}, {77, 1}, {76, 0}, - {76, 1}, {75, 0}, {75, 1}, {74, 1}, {73, 0}, {73, 1}, {72, 0}, {72, 1}, - {71, 0}, {71, 1}, {70, 0}, {70, 1}, {69, 0}, {69, 1}, {68, 0}, {68, 1}, - {67, 0}, {67, 1}, {66, 0}, {66, 1}, {65, 0}, {65, 0}, {65, 1}, {64, 0}, - {64, 1}, {63, 0}, {63, 1}, {62, 0}, {62, 0}, {62, 1}, {61, 0}, {61, 1}, - {60, 0}, {60, 0}, {60, 1}, {59, 0}, {59, 0}, {59, 1}, {58, 0}, {58, 0}, - {58, 1}, {57, 0}, {57, 0}, {57, 1}, {56, 0}, {56, 0}, {56, 1}, {55, 0}, - {55, 0}, {55, 1}, {54, 0}, {54, 0}, {54, 1}, {53, 0}, {53, 0}, {53, 0}, - {53, 1}, {52, 0}, {52, 0}, {52, 1}, {51, 0}, {51, 0}, {51, 0}, {51, 1}, - {50, 0}, {50, 0}, {50, 0}, {50, 1}, {49, 0}, {49, 0}, {49, 0}, {49, 1}, - {48, 0}, {48, 0}, {48, 0}, {48, 1}, {47, 0}, {47, 0}, {47, 0}, {47, 1}, - {46, 0}, {46, 0}, {46, 0}, {46, 0}, {46, 1}, {45, 0}, {45, 0}, {45, 0}, - {45, 1}, {44, 0}, {44, 0}, {44, 0}, {44, 0}, {44, 1}, {43, 0}, {43, 0}, - {43, 0}, {43, 0}, {43, 1}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, - {42, 1}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 1}, {40, 0}, - {40, 0}, {40, 0}, {40, 0}, {40, 1}, {39, 0}, {39, 0}, {39, 0}, {39, 0}, - {39, 0}, {39, 0}, {39, 1}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, - }; - - const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { - {62500, 10417}, {52083, 7441}, {44642, 5580}, {39062, 4340}, {34722, 3472}, {31250, 2841}, {28409, 2368}, {26041, 2003}, - {24038, 1717}, {22321, 1488}, {20833, 1302}, {19531, 1149}, {18382, 1021}, {17361, 914}, {16447, 822}, {15625, 745}, - {14880, 676}, {14204, 618}, {13586, 566}, {13020, 520}, {12500, 481}, {12019, 445}, {11574, 414}, {11160, 385}, - {10775, 359}, {10416, 336}, {10080, 315}, {9765, 296}, {9469, 278}, {9191, 263}, {8928, 248}, {8680, 235}, - {8445, 222}, {8223, 211}, {8012, 200}, {7812, 191}, {7621, 181}, {7440, 173}, {7267, 165}, {7102, 158}, - {6944, 151}, {6793, 145}, {6648, 138}, {6510, 133}, {6377, 127}, {6250, 123}, {6127, 118}, {6009, 113}, - {5896, 109}, {5787, 106}, {5681, 101}, {5580, 98}, {5482, 95}, {5387, 91}, {5296, 88}, {5208, 86}, - {5122, 82}, {5040, 80}, {4960, 78}, {4882, 75}, {4807, 73}, {4734, 70}, {4664, 69}, {4595, 67}, - {4528, 64}, {4464, 63}, {4401, 61}, {4340, 60}, {4280, 58}, {4222, 56}, {4166, 55}, {4111, 53}, - {4058, 52}, {4006, 51}, {3955, 49}, {3906, 48}, {3858, 48}, {3810, 45}, {3765, 45}, {3720, 44}, - {3676, 43}, {3633, 42}, {3591, 40}, {3551, 40}, {3511, 39}, {3472, 38}, {3434, 38}, {3396, 36}, - {3360, 36}, {3324, 35}, {3289, 34}, {3255, 34}, {3221, 33}, {3188, 32}, {3156, 31}, {3125, 31}, - {3094, 31}, {3063, 30}, {3033, 29}, {3004, 28}, {2976, 28}, {2948, 28}, {2920, 27}, {2893, 27}, - {2866, 26}, {2840, 25}, {2815, 25}, {2790, 25}, {2765, 24}, {2741, 24}, {2717, 24}, {2693, 23}, - {2670, 22}, {2648, 22}, {2626, 22}, {2604, 22}, {2582, 21}, {2561, 21}, {2540, 20}, {2520, 20}, - {2500, 20}, {2480, 20}, {2460, 19}, {2441, 19}, {2422, 19}, {2403, 18}, {2385, 18}, {2367, 18}, - {2349, 17}, {2332, 18}, {2314, 17}, {2297, 16}, {2281, 17}, {2264, 16}, {2248, 16}, {2232, 16}, - {2216, 16}, {2200, 15}, {2185, 15}, {2170, 15}, {2155, 15}, {2140, 15}, {2125, 14}, {2111, 14}, - {2097, 14}, {2083, 14}, {2069, 14}, {2055, 13}, {2042, 13}, {2029, 13}, {2016, 13}, {2003, 13}, - {1990, 13}, {1977, 12}, {1965, 12}, {1953, 13}, {1940, 11}, {1929, 12}, {1917, 12}, {1905, 12}, - {1893, 11}, {1882, 11}, {1871, 11}, {1860, 11}, {1849, 11}, {1838, 11}, {1827, 11}, {1816, 10}, - {1806, 11}, {1795, 10}, {1785, 10}, {1775, 10}, {1765, 10}, {1755, 10}, {1745, 9}, {1736, 10}, - {1726, 9}, {1717, 10}, {1707, 9}, {1698, 9}, {1689, 9}, {1680, 9}, {1671, 9}, {1662, 9}, - {1653, 9}, {1644, 8}, {1636, 9}, {1627, 8}, {1619, 9}, {1610, 8}, {1602, 8}, {1594, 8}, - {1586, 8}, {1578, 8}, {1570, 8}, {1562, 8}, {1554, 7}, {1547, 8}, {1539, 8}, {1531, 7}, - {1524, 8}, {1516, 7}, {1509, 7}, {1502, 7}, {1495, 7}, {1488, 7}, {1481, 7}, {1474, 7}, - {1467, 7}, {1460, 7}, {1453, 7}, {1446, 6}, {1440, 7}, {1433, 7}, {1426, 6}, {1420, 6}, - {1414, 7}, {1407, 6}, {1401, 6}, {1395, 7}, {1388, 6}, {1382, 6}, {1376, 6}, {1370, 6}, - {1364, 6}, {1358, 6}, {1352, 6}, {1346, 5}, {1341, 6}, {1335, 6}, {1329, 5}, {1324, 6}, - {1318, 5}, {1313, 6}, {1307, 5}, {1302, 6}, {1296, 5}, {1291, 5}, {1286, 6}, {1280, 5}, - {1275, 5}, {1270, 5}, {1265, 5}, {1260, 5}, {1255, 5}, {1250, 5}, {1245, 5}, {1240, 5}, - {1235, 5}, {1230, 5}, {1225, 5}, {1220, 5}, {1215, 4}, {1211, 5}, {1206, 5}, {1201, 5}, - }; - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.cpp deleted file mode 100644 index f59b7a42a3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.cpp +++ /dev/null @@ -1,2965 +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 . - * - */ - -/** - * stepper.cpp - A singleton object to execute motion plans using stepper motors - * Marlin Firmware - * - * Derived from Grbl - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -/** - * Timer calculations informed by the 'RepRap cartesian firmware' by Zack Smith - * and Philipp Tiefenbacher. - */ - -/** - * __________________________ - * /| |\ _________________ ^ - * / | | \ /| |\ | - * / | | \ / | | \ s - * / | | | | | \ p - * / | | | | | \ e - * +-----+------------------------+---+--+---------------+----+ e - * | BLOCK 1 | BLOCK 2 | d - * - * time -----> - * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. - */ - -/** - * Marlin uses the Bresenham algorithm. For a detailed explanation of theory and - * method see https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html - */ - -/** - * Jerk controlled movements planner added Apr 2018 by Eduardo José Tagle. - * Equations based on Synthethos TinyG2 sources, but the fixed-point - * implementation is new, as we are running the ISR with a variable period. - * Also implemented the Bézier velocity curve evaluation in ARM assembler, - * to avoid impacting ISR speed. - */ - -#include "stepper.h" - -Stepper stepper; // Singleton - -#if HAS_MOTOR_CURRENT_PWM - bool Stepper::initialized; // = false -#endif - -#ifdef __AVR__ - #include "speed_lookuptable.h" -#endif - -#include "endstops.h" -#include "planner.h" -#include "motion.h" - -#include "temperature.h" -#include "../lcd/ultralcd.h" -#include "../core/language.h" -#include "../gcode/queue.h" -#include "../sd/cardreader.h" -#include "../Marlin.h" -#include "../HAL/shared/Delay.h" - -#if MB(ALLIGATOR) - #include "../feature/dac/dac_dac084s085.h" -#endif - -#if HAS_DIGIPOTSS - #include -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../feature/mixing.h" -#endif - -#ifdef FILAMENT_RUNOUT_DISTANCE_MM - #include "../feature/runout.h" -#endif - -#if HAS_DRIVER(L6470) - #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) - bool Stepper::separate_multi_axis = false; -#endif - -#if HAS_MOTOR_CURRENT_PWM - uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load() -#endif - -// private: - -block_t* Stepper::current_block; // (= nullptr) A pointer to the block currently being traced - -uint8_t Stepper::last_direction_bits, // = 0 - Stepper::axis_did_move; // = 0 - -bool Stepper::abort_current_block; - -#if DISABLED(MIXING_EXTRUDER) && EXTRUDERS > 1 - uint8_t Stepper::last_moved_extruder = 0xFF; -#endif - -#if ENABLED(X_DUAL_ENDSTOPS) - bool Stepper::locked_X_motor = false, Stepper::locked_X2_motor = false; -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - bool Stepper::locked_Y_motor = false, Stepper::locked_Y2_motor = false; -#endif -#if Z_MULTI_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) - bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false; -#endif -#if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS) - bool Stepper::locked_Z3_motor = false; -#endif - -uint32_t Stepper::acceleration_time, Stepper::deceleration_time; -uint8_t Stepper::steps_per_isr; - -#if DISABLED(ADAPTIVE_STEP_SMOOTHING) - constexpr -#endif - uint8_t Stepper::oversampling_factor; - -xyze_long_t Stepper::delta_error{0}; - -xyze_ulong_t Stepper::advance_dividend{0}; -uint32_t Stepper::advance_divisor = 0, - Stepper::step_events_completed = 0, // The number of step events executed in the current block - 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) - uint8_t Stepper::stepper_extruder; -#else - constexpr uint8_t Stepper::stepper_extruder; -#endif - -#if ENABLED(S_CURVE_ACCELERATION) - int32_t __attribute__((used)) Stepper::bezier_A __asm__("bezier_A"); // A coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_B __asm__("bezier_B"); // B coefficient in Bézier speed curve with alias for assembler - int32_t __attribute__((used)) Stepper::bezier_C __asm__("bezier_C"); // C coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_F __asm__("bezier_F"); // F coefficient in Bézier speed curve with alias for assembler - uint32_t __attribute__((used)) Stepper::bezier_AV __asm__("bezier_AV"); // AV coefficient in Bézier speed curve with alias for assembler - #ifdef __AVR__ - bool __attribute__((used)) Stepper::A_negative __asm__("A_negative"); // If A coefficient was negative - #endif - bool Stepper::bezier_2nd_half; // =false If Bézier curve has been initialized or not -#endif - -uint32_t Stepper::nextMainISR = 0; - -#if ENABLED(LIN_ADVANCE) - - constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF; - uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER, - Stepper::LA_isr_rate = LA_ADV_NEVER; - uint16_t Stepper::LA_current_adv_steps = 0, - Stepper::LA_final_adv_steps, - Stepper::LA_max_adv_steps; - - int8_t Stepper::LA_steps = 0; - - bool Stepper::LA_use_advance_lead; - -#endif // LIN_ADVANCE - -int32_t Stepper::ticks_nominal = -1; -#if DISABLED(S_CURVE_ACCELERATION) - uint32_t Stepper::acc_step_rate; // needed for deceleration start point -#endif - -xyz_long_t Stepper::endstops_trigsteps; -xyze_long_t Stepper::count_position{0}; -xyze_int8_t Stepper::count_direction{0}; - -#define DUAL_ENDSTOP_APPLY_STEP(A,V) \ - if (separate_multi_axis) { \ - if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - else { \ - if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - } - -#define DUAL_SEPARATE_APPLY_STEP(A,V) \ - if (separate_multi_axis) { \ - if (!locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!locked_##A##2_motor) A##2_STEP_WRITE(V); \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - } - -#define TRIPLE_ENDSTOP_APPLY_STEP(A,V) \ - if (separate_multi_axis) { \ - if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##3_MIN) && count_direction[_AXIS(A)] < 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \ - } \ - else { \ - if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##2_motor) A##2_STEP_WRITE(V); \ - if (!(TEST(endstops.state(), A##3_MAX) && count_direction[_AXIS(A)] > 0) && !locked_##A##3_motor) A##3_STEP_WRITE(V); \ - } \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - A##3_STEP_WRITE(V); \ - } - -#define TRIPLE_SEPARATE_APPLY_STEP(A,V) \ - if (separate_multi_axis) { \ - if (!locked_##A##_motor) A##_STEP_WRITE(V); \ - if (!locked_##A##2_motor) A##2_STEP_WRITE(V); \ - if (!locked_##A##3_motor) A##3_STEP_WRITE(V); \ - } \ - else { \ - A##_STEP_WRITE(V); \ - A##2_STEP_WRITE(V); \ - A##3_STEP_WRITE(V); \ - } - -#if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0) - #if ENABLED(X_DUAL_ENDSTOPS) - #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) - #else - #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0) - #endif -#elif ENABLED(DUAL_X_CARRIAGE) - #define X_APPLY_DIR(v,ALWAYS) do{ \ - if (extruder_duplication_enabled || ALWAYS) { X_DIR_WRITE(v); X2_DIR_WRITE(mirrored_duplication_mode ? !(v) : v); } \ - else if (movement_extruder()) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ - }while(0) - #define X_APPLY_STEP(v,ALWAYS) do{ \ - if (extruder_duplication_enabled || ALWAYS) { X_STEP_WRITE(v); X2_STEP_WRITE(v); } \ - else if (movement_extruder()) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ - }while(0) -#else - #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) - #define X_APPLY_STEP(v,Q) X_STEP_WRITE(v) -#endif - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0) - #if ENABLED(Y_DUAL_ENDSTOPS) - #define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v) - #else - #define Y_APPLY_STEP(v,Q) do{ Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }while(0) - #endif -#else - #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v) - #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) -#endif - -#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); Z3_DIR_WRITE(v); }while(0) - #if ENABLED(Z_TRIPLE_ENDSTOPS) - #define Z_APPLY_STEP(v,Q) TRIPLE_ENDSTOP_APPLY_STEP(Z,v) - #elif ENABLED(Z_STEPPER_AUTO_ALIGN) - #define Z_APPLY_STEP(v,Q) TRIPLE_SEPARATE_APPLY_STEP(Z,v) - #else - #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); }while(0) - #endif -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0) - #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v) - #elif ENABLED(Z_STEPPER_AUTO_ALIGN) - #define Z_APPLY_STEP(v,Q) DUAL_SEPARATE_APPLY_STEP(Z,v) - #else - #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }while(0) - #endif -#else - #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) - #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) -#endif - -#if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(stepper_extruder, v) -#endif - -void Stepper::wake_up() { - // TCNT1 = 0; - ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -/** - * Set the stepper direction of each axis - * - * COREXY: X_AXIS=A_AXIS and Y_AXIS=B_AXIS - * COREXZ: X_AXIS=A_AXIS and Z_AXIS=C_AXIS - * COREYZ: Y_AXIS=B_AXIS and Z_AXIS=C_AXIS - */ -void Stepper::set_directions() { - - #if HAS_DRIVER(L6470) - 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); \ - count_direction[_AXIS(A)] = -1; \ - } \ - else { \ - A##_APPLY_DIR(!INVERT_## A##_DIR, false); \ - count_direction[_AXIS(A)] = 1; \ - } - - #if HAS_X_DIR - SET_STEP_DIR(X); // A - #endif - - #if HAS_Y_DIR - SET_STEP_DIR(Y); // B - #endif - - #if HAS_Z_DIR - SET_STEP_DIR(Z); // C - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - // Because this is valid for the whole block we don't know - // what e-steppers will step. Likely all. Set all. - if (motor_direction(E_AXIS)) { - MIXER_STEPPER_LOOP(j) REV_E_DIR(j); - count_direction.e = -1; - } - else { - MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); - count_direction.e = 1; - } - #else - if (motor_direction(E_AXIS)) { - REV_E_DIR(stepper_extruder); - count_direction.e = -1; - } - else { - NORM_E_DIR(stepper_extruder); - count_direction.e = 1; - } - #endif - #endif // !LIN_ADVANCE - - #if HAS_DRIVER(L6470) - - if (L6470.spi_active) { - L6470.spi_abort = true; // interrupted a SPI transfer - need to shut it down gracefully - for (uint8_t j = 1; j <= L6470::chain[0]; j++) - L6470_buf[j] = dSPIN_NOP; // fill buffer with NOOP commands - L6470.transfer(L6470_buf, L6470::chain[0]); // send enough NOOPs to complete any command - L6470.transfer(L6470_buf, L6470::chain[0]); - L6470.transfer(L6470_buf, L6470::chain[0]); - } - - // The L6470.dir_commands[] array holds the direction command for each stepper - - //scan command array and copy matches into L6470.transfer - for (uint8_t j = 1; j <= L6470::chain[0]; j++) - L6470_buf[j] = L6470.dir_commands[L6470::chain[j]]; - - L6470.transfer(L6470_buf, L6470::chain[0]); // send the command stream to the drivers - - #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 -} - -#if ENABLED(S_CURVE_ACCELERATION) - /** - * This uses a quintic (fifth-degree) Bézier polynomial for the velocity curve, giving - * a "linear pop" velocity curve; with pop being the sixth derivative of position: - * velocity - 1st, acceleration - 2nd, jerk - 3rd, snap - 4th, crackle - 5th, pop - 6th - * - * The Bézier curve takes the form: - * - * V(t) = P_0 * B_0(t) + P_1 * B_1(t) + P_2 * B_2(t) + P_3 * B_3(t) + P_4 * B_4(t) + P_5 * B_5(t) - * - * Where 0 <= t <= 1, and V(t) is the velocity. P_0 through P_5 are the control points, and B_0(t) - * through B_5(t) are the Bernstein basis as follows: - * - * B_0(t) = (1-t)^5 = -t^5 + 5t^4 - 10t^3 + 10t^2 - 5t + 1 - * B_1(t) = 5(1-t)^4 * t = 5t^5 - 20t^4 + 30t^3 - 20t^2 + 5t - * B_2(t) = 10(1-t)^3 * t^2 = -10t^5 + 30t^4 - 30t^3 + 10t^2 - * B_3(t) = 10(1-t)^2 * t^3 = 10t^5 - 20t^4 + 10t^3 - * B_4(t) = 5(1-t) * t^4 = -5t^5 + 5t^4 - * B_5(t) = t^5 = t^5 - * ^ ^ ^ ^ ^ ^ - * | | | | | | - * A B C D E F - * - * Unfortunately, we cannot use forward-differencing to calculate each position through - * the curve, as Marlin uses variable timer periods. So, we require a formula of the form: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + D*t^2 + E*t + F - * - * Looking at the above B_0(t) through B_5(t) expanded forms, if we take the coefficients of t^5 - * through t of the Bézier form of V(t), we can determine that: - * - * A = -P_0 + 5*P_1 - 10*P_2 + 10*P_3 - 5*P_4 + P_5 - * B = 5*P_0 - 20*P_1 + 30*P_2 - 20*P_3 + 5*P_4 - * C = -10*P_0 + 30*P_1 - 30*P_2 + 10*P_3 - * D = 10*P_0 - 20*P_1 + 10*P_2 - * E = - 5*P_0 + 5*P_1 - * F = P_0 - * - * Now, since we will (currently) *always* want the initial acceleration and jerk values to be 0, - * We set P_i = P_0 = P_1 = P_2 (initial velocity), and P_t = P_3 = P_4 = P_5 (target velocity), - * which, after simplification, resolves to: - * - * A = - 6*P_i + 6*P_t = 6*(P_t - P_i) - * B = 15*P_i - 15*P_t = 15*(P_i - P_t) - * C = -10*P_i + 10*P_t = 10*(P_t - P_i) - * D = 0 - * E = 0 - * F = P_i - * - * As the t is evaluated in non uniform steps here, there is no other way rather than evaluating - * the Bézier curve at each point: - * - * V_f(t) = A*t^5 + B*t^4 + C*t^3 + F [0 <= t <= 1] - * - * Floating point arithmetic execution time cost is prohibitive, so we will transform the math to - * use fixed point values to be able to evaluate it in realtime. Assuming a maximum of 250000 steps - * per second (driver pulses should at least be 2µS hi/2µS lo), and allocating 2 bits to avoid - * overflows on the evaluation of the Bézier curve, means we can use - * - * t: unsigned Q0.32 (0 <= t < 1) |range 0 to 0xFFFFFFFF unsigned - * A: signed Q24.7 , |range = +/- 250000 * 6 * 128 = +/- 192000000 = 0x0B71B000 | 28 bits + sign - * B: signed Q24.7 , |range = +/- 250000 *15 * 128 = +/- 480000000 = 0x1C9C3800 | 29 bits + sign - * C: signed Q24.7 , |range = +/- 250000 *10 * 128 = +/- 320000000 = 0x1312D000 | 29 bits + sign - * F: signed Q24.7 , |range = +/- 250000 * 128 = 32000000 = 0x01E84800 | 25 bits + sign - * - * The trapezoid generator state contains the following information, that we will use to create and evaluate - * the Bézier curve: - * - * blk->step_event_count [TS] = The total count of steps for this movement. (=distance) - * blk->initial_rate [VI] = The initial steps per second (=velocity) - * blk->final_rate [VF] = The ending steps per second (=velocity) - * and the count of events completed (step_events_completed) [CS] (=distance until now) - * - * Note the abbreviations we use in the following formulae are between []s - * - * For Any 32bit CPU: - * - * At the start of each trapezoid, calculate the coefficients A,B,C,F and Advance [AV], as follows: - * - * A = 6*128*(VF - VI) = 768*(VF - VI) - * B = 15*128*(VI - VF) = 1920*(VI - VF) - * C = 10*128*(VF - VI) = 1280*(VF - VI) - * F = 128*VI = 128*VI - * AV = (1<<32)/TS ~= 0xFFFFFFFF / TS (To use ARM UDIV, that is 32 bits) (this is computed at the planner, to offload expensive calculations from the ISR) - * - * And for each point, evaluate the curve with the following sequence: - * - * void lsrs(uint32_t& d, uint32_t s, int cnt) { - * d = s >> cnt; - * } - * void lsls(uint32_t& d, uint32_t s, int cnt) { - * d = s << cnt; - * } - * void lsrs(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) >> cnt; - * } - * void lsls(int32_t& d, uint32_t s, int cnt) { - * d = uint32_t(s) << cnt; - * } - * void umull(uint32_t& rlo, uint32_t& rhi, uint32_t op1, uint32_t op2) { - * uint64_t res = uint64_t(op1) * op2; - * rlo = uint32_t(res & 0xFFFFFFFF); - * rhi = uint32_t((res >> 32) & 0xFFFFFFFF); - * } - * void smlal(int32_t& rlo, int32_t& rhi, int32_t op1, int32_t op2) { - * int64_t mul = int64_t(op1) * op2; - * int64_t s = int64_t(uint32_t(rlo) | ((uint64_t(uint32_t(rhi)) << 32U))); - * mul += s; - * rlo = int32_t(mul & 0xFFFFFFFF); - * rhi = int32_t((mul >> 32) & 0xFFFFFFFF); - * } - * int32_t _eval_bezier_curve_arm(uint32_t curr_step) { - * uint32_t flo = 0; - * uint32_t fhi = bezier_AV * curr_step; - * uint32_t t = fhi; - * int32_t alo = bezier_F; - * int32_t ahi = 0; - * int32_t A = bezier_A; - * int32_t B = bezier_B; - * int32_t C = bezier_C; - * - * lsrs(ahi, alo, 1); // a = F << 31 - * lsls(alo, alo, 31); // - * umull(flo, fhi, fhi, t); // f *= t - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, C); // a+=(f>>33)*C - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // - * smlal(alo, ahi, flo, B); // a+=(f>>33)*B - * umull(flo, fhi, fhi, t); // f>>=32; f*=t - * lsrs(flo, fhi, 1); // f>>=33; - * smlal(alo, ahi, flo, A); // a+=(f>>33)*A; - * lsrs(alo, ahi, 6); // a>>=38 - * - * return alo; - * } - * - * This is rewritten in ARM assembly for optimal performance (43 cycles to execute). - * - * For AVR, the precision of coefficients is scaled so the Bézier curve can be evaluated in real-time: - * Let's reduce precision as much as possible. After some experimentation we found that: - * - * Assume t and AV with 24 bits is enough - * A = 6*(VF - VI) - * B = 15*(VI - VF) - * C = 10*(VF - VI) - * F = VI - * AV = (1<<24)/TS (this is computed at the planner, to offload expensive calculations from the ISR) - * - * Instead of storing sign for each coefficient, we will store its absolute value, - * and flag the sign of the A coefficient, so we can save to store the sign bit. - * It always holds that sign(A) = - sign(B) = sign(C) - * - * So, the resulting range of the coefficients are: - * - * t: unsigned (0 <= t < 1) |range 0 to 0xFFFFFF unsigned - * A: signed Q24 , range = 250000 * 6 = 1500000 = 0x16E360 | 21 bits - * B: signed Q24 , range = 250000 *15 = 3750000 = 0x393870 | 22 bits - * C: signed Q24 , range = 250000 *10 = 2500000 = 0x1312D0 | 21 bits - * F: signed Q24 , range = 250000 = 250000 = 0x0ED090 | 20 bits - * - * And for each curve, estimate its coefficients with: - * - * void _calc_bezier_curve_coeffs(int32_t v0, int32_t v1, uint32_t av) { - * // Calculate the Bézier coefficients - * if (v1 < v0) { - * A_negative = true; - * bezier_A = 6 * (v0 - v1); - * bezier_B = 15 * (v0 - v1); - * bezier_C = 10 * (v0 - v1); - * } - * else { - * A_negative = false; - * bezier_A = 6 * (v1 - v0); - * bezier_B = 15 * (v1 - v0); - * bezier_C = 10 * (v1 - v0); - * } - * bezier_F = v0; - * } - * - * And for each point, evaluate the curve with the following sequence: - * - * // unsigned multiplication of 24 bits x 24bits, return upper 16 bits - * void umul24x24to16hi(uint16_t& r, uint24_t op1, uint24_t op2) { - * r = (uint64_t(op1) * op2) >> 8; - * } - * // unsigned multiplication of 16 bits x 16bits, return upper 16 bits - * void umul16x16to16hi(uint16_t& r, uint16_t op1, uint16_t op2) { - * r = (uint32_t(op1) * op2) >> 16; - * } - * // unsigned multiplication of 16 bits x 24bits, return upper 24 bits - * void umul16x24to24hi(uint24_t& r, uint16_t op1, uint24_t op2) { - * r = uint24_t((uint64_t(op1) * op2) >> 16); - * } - * - * int32_t _eval_bezier_curve(uint32_t curr_step) { - * // To save computing, the first step is always the initial speed - * if (!curr_step) - * return bezier_F; - * - * uint16_t t; - * umul24x24to16hi(t, bezier_AV, curr_step); // t: Range 0 - 1^16 = 16 bits - * uint16_t f = t; - * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) - * uint24_t acc = bezier_F; // Range 20 bits (unsigned) - * if (A_negative) { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc -= v; - * } - * else { - * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits - * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits - * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) - * acc += v; - * } - * return acc; - * } - * These functions are translated to assembler for optimal performance. - * Coefficient calculation takes 70 cycles. Bezier point evaluation takes 150 cycles. - */ - - #ifdef __AVR__ - - // For AVR we use assembly to maximize speed - void Stepper::_calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av) { - - // Store advance - bezier_AV = av; - - // Calculate the rest of the coefficients - uint8_t r2 = v0 & 0xFF; - uint8_t r3 = (v0 >> 8) & 0xFF; - uint8_t r12 = (v0 >> 16) & 0xFF; - uint8_t r5 = v1 & 0xFF; - uint8_t r6 = (v1 >> 8) & 0xFF; - uint8_t r7 = (v1 >> 16) & 0xFF; - uint8_t r4,r8,r9,r10,r11; - - __asm__ __volatile__( - /* Calculate the Bézier coefficients */ - /* %10:%1:%0 = v0*/ - /* %5:%4:%3 = v1*/ - /* %7:%6:%10 = temporary*/ - /* %9 = val (must be high register!)*/ - /* %10 (must be high register!)*/ - - /* Store initial velocity*/ - A("sts bezier_F, %0") - A("sts bezier_F+1, %1") - A("sts bezier_F+2, %10") /* bezier_F = %10:%1:%0 = v0 */ - - /* Get delta speed */ - A("ldi %2,-1") /* %2 = 0xFF, means A_negative = true */ - A("clr %8") /* %8 = 0 */ - A("sub %0,%3") - A("sbc %1,%4") - A("sbc %10,%5") /* v0 -= v1, C=1 if result is negative */ - A("brcc 1f") /* branch if result is positive (C=0), that means v0 >= v1 */ - - /* Result was negative, get the absolute value*/ - A("com %10") - A("com %1") - A("neg %0") - A("sbc %1,%2") - A("sbc %10,%2") /* %10:%1:%0 +1 -> %10:%1:%0 = -(v0 - v1) = (v1 - v0) */ - A("clr %2") /* %2 = 0, means A_negative = false */ - - /* Store negative flag*/ - L("1") - A("sts A_negative, %2") /* Store negative flag */ - - /* Compute coefficients A,B and C [20 cycles worst case]*/ - A("ldi %9,6") /* %9 = 6 */ - A("mul %0,%9") /* r1:r0 = 6*LO(v0-v1) */ - A("sts bezier_A, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:r0 = 6*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 6*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 6*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 6*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 6*HI(v0-v1) << 16 */ - A("sts bezier_A+1, %6") - A("sts bezier_A+2, %7") /* bezier_A = %7:%6:?? = 6*(v0-v1) [35 cycles worst] */ - - A("ldi %9,15") /* %9 = 15 */ - A("mul %0,%9") /* r1:r0 = 5*LO(v0-v1) */ - A("sts bezier_B, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 5*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 5*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 5*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 5*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 5*HI(v0-v1) << 16 */ - A("sts bezier_B+1, %6") - A("sts bezier_B+2, %7") /* bezier_B = %7:%6:?? = 5*(v0-v1) [50 cycles worst] */ - - A("ldi %9,10") /* %9 = 10 */ - A("mul %0,%9") /* r1:r0 = 10*LO(v0-v1) */ - A("sts bezier_C, r0") - A("mov %6,r1") - A("clr %7") /* %7:%6:?? = 10*LO(v0-v1) */ - A("mul %1,%9") /* r1:r0 = 10*MI(v0-v1) */ - A("add %6,r0") - A("adc %7,r1") /* %7:%6:?? += 10*MI(v0-v1) << 8 */ - A("mul %10,%9") /* r1:r0 = 10*HI(v0-v1) */ - A("add %7,r0") /* %7:%6:?? += 10*HI(v0-v1) << 16 */ - A("sts bezier_C+1, %6") - " sts bezier_C+2, %7" /* bezier_C = %7:%6:?? = 10*(v0-v1) [65 cycles worst] */ - : "+r" (r2), - "+d" (r3), - "=r" (r4), - "+r" (r5), - "+r" (r6), - "+r" (r7), - "=r" (r8), - "=r" (r9), - "=r" (r10), - "=d" (r11), - "+r" (r12) - : - : "r0", "r1", "cc", "memory" - ); - } - - FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) { - - // If dealing with the first step, save expensive computing and return the initial speed - if (!curr_step) - return bezier_F; - - uint8_t r0 = 0; /* Zero register */ - uint8_t r2 = (curr_step) & 0xFF; - uint8_t r3 = (curr_step >> 8) & 0xFF; - uint8_t r4 = (curr_step >> 16) & 0xFF; - uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */ - - __asm__ __volatile( - /* umul24x24to16hi(t, bezier_AV, curr_step); t: Range 0 - 1^16 = 16 bits*/ - A("lds %9,bezier_AV") /* %9 = LO(AV)*/ - A("mul %9,%2") /* r1:r0 = LO(bezier_AV)*LO(curr_step)*/ - A("mov %7,r1") /* %7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("clr %8") /* %8:%7 = LO(bezier_AV)*LO(curr_step) >> 8*/ - A("lds %10,bezier_AV+1") /* %10 = MI(AV)*/ - A("mul %10,%2") /* r1:r0 = MI(bezier_AV)*LO(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += MI(bezier_AV)*LO(curr_step)*/ - A("lds r1,bezier_AV+2") /* r11 = HI(AV)*/ - A("mul r1,%2") /* r1:r0 = HI(bezier_AV)*LO(curr_step)*/ - A("add %8,r0") /* %8:%7 += HI(bezier_AV)*LO(curr_step) << 8*/ - A("mul %9,%3") /* r1:r0 = LO(bezier_AV)*MI(curr_step)*/ - A("add %7,r0") - A("adc %8,r1") /* %8:%7 += LO(bezier_AV)*MI(curr_step)*/ - A("mul %10,%3") /* r1:r0 = MI(bezier_AV)*MI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*MI(curr_step) << 8*/ - A("mul %9,%4") /* r1:r0 = LO(bezier_AV)*HI(curr_step)*/ - A("add %8,r0") /* %8:%7 += LO(bezier_AV)*HI(curr_step) << 8*/ - /* %8:%7 = t*/ - - /* uint16_t f = t;*/ - A("mov %5,%7") /* %6:%5 = f*/ - A("mov %6,%8") - /* %6:%5 = f*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits (unsigned) [17] */ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %9,r1") /* store MIL(LO(f) * LO(t)) in %9, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %9,r0") /* %9 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %9,r0") /* %9 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t)) */ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 = */ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - /* [15 +17*2] = [49]*/ - - /* %4:%3:%2 will be acc from now on*/ - - /* uint24_t acc = bezier_F; / Range 20 bits (unsigned)*/ - A("clr %9") /* "decimal place we get for free"*/ - A("lds %2,bezier_F") - A("lds %3,bezier_F+1") - A("lds %4,bezier_F+2") /* %4:%3:%2 = acc*/ - - /* if (A_negative) {*/ - A("lds r0,A_negative") - A("or r0,%0") /* Is flag signalling negative? */ - A("brne 3f") /* If yes, Skip next instruction if A was negative*/ - A("rjmp 1f") /* Otherwise, jump */ - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29] */ - /* acc -= v; */ - L("3") - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc -= v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_A) * LO(f) << 16*/ - A("jmp 2f") /* Done!*/ - - L("1") - - /* uint24_t v; */ - /* umul16x24to24hi(v, f, bezier_C); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_C") /* %10 = LO(bezier_C)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_C) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_C) * LO(f))*/ - A("lds %11, bezier_C+1") /* %11 = MI(bezier_C)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * LO(f)*/ - A("lds %1, bezier_C+2") /* %1 = HI(bezier_C)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_C) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_C) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_C) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_C) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_C) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_C) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_C) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^3 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_B); / Range 22bits [29]*/ - /* acc -= v;*/ - A("lds %10, bezier_B") /* %10 = LO(bezier_B)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_B) * LO(f)*/ - A("sub %9,r1") - A("sbc %2,%0") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(LO(bezier_B) * LO(f))*/ - A("lds %11, bezier_B+1") /* %11 = MI(bezier_B)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * LO(f)*/ - A("lds %1, bezier_B+2") /* %1 = HI(bezier_B)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_B) * LO(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_B) * MI(f)*/ - A("sub %9,r0") - A("sbc %2,r1") - A("sbc %3,%0") - A("sbc %4,%0") /* %4:%3:%2:%9 -= LO(bezier_B) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_B) * MI(f)*/ - A("sub %2,r0") - A("sbc %3,r1") - A("sbc %4,%0") /* %4:%3:%2:%9 -= MI(bezier_B) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_B) * LO(f)*/ - A("sub %3,r0") - A("sbc %4,r1") /* %4:%3:%2:%9 -= HI(bezier_B) * LO(f) << 16*/ - - /* umul16x16to16hi(f, f, t); / Range 16 bits : f = t^5 (unsigned) [17]*/ - A("mul %5,%7") /* r1:r0 = LO(f) * LO(t)*/ - A("mov %1,r1") /* store MIL(LO(f) * LO(t)) in %1, we need it for rounding*/ - A("clr %10") /* %10 = 0*/ - A("clr %11") /* %11 = 0*/ - A("mul %5,%8") /* r1:r0 = LO(f) * HI(t)*/ - A("add %1,r0") /* %1 += LO(LO(f) * HI(t))*/ - A("adc %10,r1") /* %10 = HI(LO(f) * HI(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%7") /* r1:r0 = HI(f) * LO(t)*/ - A("add %1,r0") /* %1 += LO(HI(f) * LO(t))*/ - A("adc %10,r1") /* %10 += HI(HI(f) * LO(t))*/ - A("adc %11,%0") /* %11 += carry*/ - A("mul %6,%8") /* r1:r0 = HI(f) * HI(t)*/ - A("add %10,r0") /* %10 += LO(HI(f) * HI(t))*/ - A("adc %11,r1") /* %11 += HI(HI(f) * HI(t))*/ - A("mov %5,%10") /* %6:%5 =*/ - A("mov %6,%11") /* f = %10:%11*/ - - /* umul16x24to24hi(v, f, bezier_A); / Range 21bits [29]*/ - /* acc += v; */ - A("lds %10, bezier_A") /* %10 = LO(bezier_A)*/ - A("mul %10,%5") /* r1:r0 = LO(bezier_A) * LO(f)*/ - A("add %9,r1") - A("adc %2,%0") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(LO(bezier_A) * LO(f))*/ - A("lds %11, bezier_A+1") /* %11 = MI(bezier_A)*/ - A("mul %11,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * LO(f)*/ - A("lds %1, bezier_A+2") /* %1 = HI(bezier_A)*/ - A("mul %1,%5") /* r1:r0 = MI(bezier_A) * LO(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 8*/ - A("mul %10,%6") /* r1:r0 = LO(bezier_A) * MI(f)*/ - A("add %9,r0") - A("adc %2,r1") - A("adc %3,%0") - A("adc %4,%0") /* %4:%3:%2:%9 += LO(bezier_A) * MI(f)*/ - A("mul %11,%6") /* r1:r0 = MI(bezier_A) * MI(f)*/ - A("add %2,r0") - A("adc %3,r1") - A("adc %4,%0") /* %4:%3:%2:%9 += MI(bezier_A) * MI(f) << 8*/ - A("mul %1,%6") /* r1:r0 = HI(bezier_A) * LO(f)*/ - A("add %3,r0") - A("adc %4,r1") /* %4:%3:%2:%9 += HI(bezier_A) * LO(f) << 16*/ - L("2") - " clr __zero_reg__" /* C runtime expects r1 = __zero_reg__ = 0 */ - : "+r"(r0), - "+r"(r1), - "+r"(r2), - "+r"(r3), - "+r"(r4), - "+r"(r5), - "+r"(r6), - "+r"(r7), - "+r"(r8), - "+r"(r9), - "+r"(r10), - "+r"(r11) - : - :"cc","r0","r1" - ); - return (r2 | (uint16_t(r3) << 8)) | (uint32_t(r4) << 16); - } - - #else - - // For all the other 32bit CPUs - FORCE_INLINE void Stepper::_calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av) { - // Calculate the Bézier coefficients - bezier_A = 768 * (v1 - v0); - bezier_B = 1920 * (v0 - v1); - bezier_C = 1280 * (v1 - v0); - bezier_F = 128 * v0; - bezier_AV = av; - } - - FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) { - #if defined(__ARM__) || defined(__thumb__) - - // For ARM Cortex M3/M4 CPUs, we have the optimized assembler version, that takes 43 cycles to execute - uint32_t flo = 0; - uint32_t fhi = bezier_AV * curr_step; - uint32_t t = fhi; - int32_t alo = bezier_F; - int32_t ahi = 0; - int32_t A = bezier_A; - int32_t B = bezier_B; - int32_t C = bezier_C; - - __asm__ __volatile__( - ".syntax unified" "\n\t" // is to prevent CM0,CM1 non-unified syntax - A("lsrs %[ahi],%[alo],#1") // a = F << 31 1 cycles - A("lsls %[alo],%[alo],#31") // 1 cycles - A("umull %[flo],%[fhi],%[fhi],%[t]") // f *= t 5 cycles [fhi:flo=64bits] - A("umull %[flo],%[fhi],%[fhi],%[t]") // f>>=32; f*=t 5 cycles [fhi:flo=64bits] - A("lsrs %[flo],%[fhi],#1") // 1 cycles [31bits] - A("smlal %[alo],%[ahi],%[flo],%[C]") // a+=(f>>33)*C; 5 cycles - A("umull %[flo],%[fhi],%[fhi],%[t]") // f>>=32; f*=t 5 cycles [fhi:flo=64bits] - A("lsrs %[flo],%[fhi],#1") // 1 cycles [31bits] - A("smlal %[alo],%[ahi],%[flo],%[B]") // a+=(f>>33)*B; 5 cycles - A("umull %[flo],%[fhi],%[fhi],%[t]") // f>>=32; f*=t 5 cycles [fhi:flo=64bits] - A("lsrs %[flo],%[fhi],#1") // f>>=33; 1 cycles [31bits] - A("smlal %[alo],%[ahi],%[flo],%[A]") // a+=(f>>33)*A; 5 cycles - A("lsrs %[alo],%[ahi],#6") // a>>=38 1 cycles - : [alo]"+r"( alo ) , - [flo]"+r"( flo ) , - [fhi]"+r"( fhi ) , - [ahi]"+r"( ahi ) , - [A]"+r"( A ) , // <== Note: Even if A, B, C, and t registers are INPUT ONLY - [B]"+r"( B ) , // GCC does bad optimizations on the code if we list them as - [C]"+r"( C ) , // such, breaking this function. So, to avoid that problem, - [t]"+r"( t ) // we list all registers as input-outputs. - : - : "cc" - ); - return alo; - - #else - - // For non ARM targets, we provide a fallback implementation. Really doubt it - // will be useful, unless the processor is fast and 32bit - - uint32_t t = bezier_AV * curr_step; // t: Range 0 - 1^32 = 32 bits - uint64_t f = t; - f *= t; // Range 32*2 = 64 bits (unsigned) - f >>= 32; // Range 32 bits (unsigned) - f *= t; // Range 32*2 = 64 bits (unsigned) - f >>= 32; // Range 32 bits : f = t^3 (unsigned) - int64_t acc = (int64_t) bezier_F << 31; // Range 63 bits (signed) - acc += ((uint32_t) f >> 1) * (int64_t) bezier_C; // Range 29bits + 31 = 60bits (plus sign) - f *= t; // Range 32*2 = 64 bits - f >>= 32; // Range 32 bits : f = t^3 (unsigned) - acc += ((uint32_t) f >> 1) * (int64_t) bezier_B; // Range 29bits + 31 = 60bits (plus sign) - f *= t; // Range 32*2 = 64 bits - f >>= 32; // Range 32 bits : f = t^3 (unsigned) - acc += ((uint32_t) f >> 1) * (int64_t) bezier_A; // Range 28bits + 31 = 59bits (plus sign) - acc >>= (31 + 7); // Range 24bits (plus sign) - return (int32_t) acc; - - #endif - } - #endif -#endif // S_CURVE_ACCELERATION - -/** - * Stepper Driver Interrupt - * - * Directly pulses the stepper motors at high frequency. - */ - -HAL_STEP_TIMER_ISR() { - HAL_timer_isr_prologue(STEP_TIMER_NUM); - - Stepper::isr(); - - HAL_timer_isr_epilogue(STEP_TIMER_NUM); -} - -#ifdef CPU_32_BIT - #define STEP_MULTIPLY(A,B) MultiU32X24toH32(A, B) -#else - #define STEP_MULTIPLY(A,B) MultiU24X32toH16(A, B) -#endif - -void Stepper::isr() { - #ifndef __AVR__ - // Disable interrupts, to avoid ISR preemption while we reprogram the period - // (AVR enters the ISR with global interrupts disabled, so no need to do it here) - DISABLE_ISRS(); - #endif - - // Program timer compare for the maximum period, so it does NOT - // flag an interrupt while this ISR is running - So changes from small - // periods to big periods are respected and the timer does not reset to 0 - HAL_timer_set_compare(STEP_TIMER_NUM, hal_timer_t(HAL_TIMER_TYPE_MAX)); - - // Count of ticks for the next ISR - hal_timer_t next_isr_ticks = 0; - - // Limit the amount of iterations - uint8_t max_loops = 10; - - // We need this variable here to be able to use it in the following loop - hal_timer_t min_ticks; - do { - // Enable ISRs to reduce USART processing latency - ENABLE_ISRS(); - - // Run main stepping pulse phase ISR if we have to - if (!nextMainISR) Stepper::stepper_pulse_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // Run linear advance stepper ISR if we have to - if (!nextAdvanceISR) nextAdvanceISR = Stepper::advance_isr(); - #endif - - // ^== Time critical. NOTHING besides pulse generation should be above here!!! - - // Run main stepping block processing ISR if we have to - if (!nextMainISR) nextMainISR = Stepper::stepper_block_phase_isr(); - - uint32_t interval = - #if ENABLED(LIN_ADVANCE) - _MIN(nextAdvanceISR, nextMainISR) // Nearest time interval - #else - nextMainISR // Remaining stepper ISR time - #endif - ; - - // Limit the value to the maximum possible value of the timer - NOMORE(interval, uint32_t(HAL_TIMER_TYPE_MAX)); - - // Compute the time remaining for the main isr - nextMainISR -= interval; - - #if ENABLED(LIN_ADVANCE) - // Compute the time remaining for the advance isr - if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval; - #endif - - /** - * This needs to avoid a race-condition caused by interleaving - * of interrupts required by both the LA and Stepper algorithms. - * - * Assume the following tick times for stepper pulses: - * Stepper ISR (S): 1 1000 2000 3000 4000 - * Linear Adv. (E): 10 1010 2010 3010 4010 - * - * The current algorithm tries to interleave them, giving: - * 1:S 10:E 1000:S 1010:E 2000:S 2010:E 3000:S 3010:E 4000:S 4010:E - * - * Ideal timing would yield these delta periods: - * 1:S 9:E 990:S 10:E 990:S 10:E 990:S 10:E 990:S 10:E - * - * But, since each event must fire an ISR with a minimum duration, the - * minimum delta might be 900, so deltas under 900 get rounded up: - * 900:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E d990:S d900:E - * - * It works, but divides the speed of all motors by half, leading to a sudden - * reduction to 1/2 speed! Such jumps in speed lead to lost steps (not even - * accounting for double/quad stepping, which makes it even worse). - */ - - // Compute the tick count for the next ISR - next_isr_ticks += interval; - - /** - * The following section must be done with global interrupts disabled. - * We want nothing to interrupt it, as that could mess the calculations - * we do for the next value to program in the period register of the - * stepper timer and lead to skipped ISRs (if the value we happen to program - * is less than the current count due to something preempting between the - * read and the write of the new period value). - */ - DISABLE_ISRS(); - - /** - * Get the current tick value + margin - * Assuming at least 6µs between calls to this ISR... - * On AVR the ISR epilogue+prologue is estimated at 100 instructions - Give 8µs as margin - * On ARM the ISR epilogue+prologue is estimated at 20 instructions - Give 1µs as margin - */ - min_ticks = HAL_timer_get_count(STEP_TIMER_NUM) + hal_timer_t( - #ifdef __AVR__ - 8 - #else - 1 - #endif - * (STEPPER_TIMER_TICKS_PER_US) - ); - - /** - * NB: If for some reason the stepper monopolizes the MPU, eventually the - * timer will wrap around (and so will 'next_isr_ticks'). So, limit the - * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse - * timing, since the MCU isn't fast enough. - */ - if (!--max_loops) next_isr_ticks = min_ticks; - - // Advance pulses if not enough time to wait for the next ISR - } while (next_isr_ticks < min_ticks); - - // Now 'next_isr_ticks' contains the period to the next Stepper ISR - And we are - // sure that the time has not arrived yet - Warrantied by the scheduler - - // Set the next ISR to fire at the proper time - HAL_timer_set_compare(STEP_TIMER_NUM, hal_timer_t(next_isr_ticks)); - - // Don't forget to finally reenable interrupts - ENABLE_ISRS(); -} - -/** - * This phase of the ISR should ONLY create the pulses for the steppers. - * This prevents jitter caused by the interval between the start of the - * interrupt and the start of the pulses. DON'T add any logic ahead of the - * call to this method that might cause variation in the timing. The aim - * is to keep pulse timing as regular as possible. - */ -void Stepper::stepper_pulse_phase_isr() { - - // If we must abort the current block, do so! - if (abort_current_block) { - abort_current_block = false; - if (current_block) { - axis_did_move = 0; - current_block = nullptr; - planner.discard_current_block(); - } - } - - // If there is no current block, do nothing - if (!current_block) return; - - // Count of pending loops and events for this iteration - const uint32_t pending_events = step_event_count - step_events_completed; - uint8_t events_to_do = _MIN(pending_events, steps_per_isr); - - // Just update the value we will get at the end of the loop - step_events_completed += events_to_do; - - // 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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Take multiple steps per interrupt (For high speed moves) - do { - - #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP - #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN - - // Start an active pulse, if Bresenham says so, and update position - #define PULSE_START(AXIS) do{ \ - delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); \ - count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \ - } \ - }while(0) - - // Stop an active pulse, if any, and adjust error term - #define PULSE_STOP(AXIS) do { \ - if (delta_error[_AXIS(AXIS)] >= 0) { \ - delta_error[_AXIS(AXIS)] -= advance_divisor; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0); \ - } \ - }while(0) - - // Pulse start - #if HAS_X_STEP - PULSE_START(X); - #endif - #if HAS_Y_STEP - PULSE_START(Y); - #endif - #if HAS_Z_STEP - PULSE_START(Z); - #endif - - // Pulse Extruders - // Tick the E axis, correct error term and update position - #if EITHER(LIN_ADVANCE, MIXING_EXTRUDER) - delta_error.e += advance_dividend.e; - if (delta_error.e >= 0) { - count_position.e += count_direction.e; - #if ENABLED(LIN_ADVANCE) - delta_error.e -= advance_divisor; - // Don't step E here - But remember the number of steps to perform - motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; - #else // !LIN_ADVANCE && MIXING_EXTRUDER - // Don't adjust delta_error.e here! - // Being positive is the criteria for ending the pulse. - E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); - #endif - } - #else // !LIN_ADVANCE && !MIXING_EXTRUDER - #if HAS_E0_STEP - PULSE_START(E); - #endif - #endif - - #if ENABLED(I2S_STEPPER_STREAM) - i2s_push_sample(); - #endif - - // TODO: need to deal with MINIMUM_STEPPER_PULSE over i2s - #if MINIMUM_STEPPER_PULSE && DISABLED(I2S_STEPPER_STREAM) - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - // Pulse stop - #if HAS_X_STEP - PULSE_STOP(X); - #endif - #if HAS_Y_STEP - PULSE_STOP(Y); - #endif - #if HAS_Z_STEP - PULSE_STOP(Z); - #endif - - #if DISABLED(LIN_ADVANCE) - #if ENABLED(MIXING_EXTRUDER) - if (delta_error.e >= 0) { - delta_error.e -= advance_divisor; - E_STEP_WRITE(mixer.get_stepper(), INVERT_E_STEP_PIN); - } - #else // !MIXING_EXTRUDER - #if HAS_E0_STEP - PULSE_STOP(E); - #endif - #endif - #endif // !LIN_ADVANCE - - // Decrement the count of pending pulses to do - --events_to_do; - - // For minimum pulse time wait after stopping pulses also - if (events_to_do) { - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - - } while (events_to_do); -} - -// This is the last half of the stepper interrupt: This one processes and -// properly schedules blocks from the planner. This is executed after creating -// the step pulses, so it is not time critical, as pulses are already done. - -uint32_t Stepper::stepper_block_phase_isr() { - - // If no queued movements, just wait 1ms for the next move - uint32_t interval = (STEPPER_TIMER_RATE) / 1000; - - // If there is a current block - if (current_block) { - - // If current block is finished, reset pointer - if (step_events_completed >= step_event_count) { - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - runout.block_completed(current_block); - #endif - axis_did_move = 0; - current_block = nullptr; - planner.discard_current_block(); - } - else { - // Step events not completed yet... - - // Are we in acceleration phase ? - if (step_events_completed <= accelerate_until) { // Calculate new timer value - - #if ENABLED(S_CURVE_ACCELERATION) - // Get the next speed to use (Jerk limited!) - uint32_t acc_step_rate = - acceleration_time < current_block->acceleration_time - ? _eval_bezier_curve(acceleration_time) - : current_block->cruise_rate; - #else - acc_step_rate = STEP_MULTIPLY(acceleration_time, current_block->acceleration_rate) + current_block->initial_rate; - NOMORE(acc_step_rate, current_block->nominal_rate); - #endif - - // acc_step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(acc_step_rate, oversampling_factor, &steps_per_isr); - acceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Fire ISR if final adv_rate is reached - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - } - else if (LA_steps) nextAdvanceISR = 0; - #endif // LIN_ADVANCE - } - // Are we in Deceleration phase ? - else if (step_events_completed > decelerate_after) { - uint32_t step_rate; - - #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... - if (!bezier_2nd_half) { - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); - bezier_2nd_half = true; - // The first point starts at cruise rate. Just save evaluation of the Bézier curve - step_rate = current_block->cruise_rate; - } - else { - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - } - #else - - // Using the old trapezoidal control - step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? - step_rate = acc_step_rate - step_rate; - NOLESS(step_rate, current_block->final_rate); - } - else - step_rate = current_block->final_rate; - #endif - - // step_rate is in steps/second - - // step_rate to timer interval and steps per stepper isr - interval = calc_timer_interval(step_rate, oversampling_factor, &steps_per_isr); - deceleration_time += interval; - - #if ENABLED(LIN_ADVANCE) - if (LA_use_advance_lead) { - // Wake up eISR on first deceleration loop and fire ISR if final adv_rate is reached - if (step_events_completed <= decelerate_after + steps_per_isr || (LA_steps && LA_isr_rate != current_block->advance_speed)) { - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - } - else if (LA_steps) nextAdvanceISR = 0; - #endif // LIN_ADVANCE - } - // We must be in cruise phase otherwise - else { - - #if ENABLED(LIN_ADVANCE) - // If there are any esteps, fire the next advance_isr "now" - if (LA_steps && LA_isr_rate != current_block->advance_speed) nextAdvanceISR = 0; - #endif - - // Calculate the ticks_nominal for this nominal speed, if not done yet - if (ticks_nominal < 0) { - // step_rate to timer interval and loops for the nominal speed - ticks_nominal = calc_timer_interval(current_block->nominal_rate, oversampling_factor, &steps_per_isr); - } - - // The timer interval is just the nominal value for the nominal speed - interval = ticks_nominal; - } - } - } - - // If there is no current block at this point, attempt to pop one from the buffer - // and prepare its movement - if (!current_block) { - - // Anything in the buffer? - if ((current_block = planner.get_current_block())) { - - // Sync block? Sync the stepper counts and return - while (TEST(current_block->flag, BLOCK_BIT_SYNC_POSITION)) { - _set_position(current_block->position); - planner.discard_current_block(); - - // Try to get a new block - if (!(current_block = planner.get_current_block())) - return interval; // No more queued movements! - } - - #if HAS_CUTTER - cutter.apply_power(current_block->cutter_power); - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.info.sdpos = current_block->sdpos; - #endif - - // Flag all moving axes for proper endstop handling - - #if IS_CORE - // Define conditions for checking endstops - #define S_(N) current_block->steps[CORE_AXIS_##N] - #define D_(N) TEST(current_block->direction_bits, CORE_AXIS_##N) - #endif - - #if CORE_IS_XY || CORE_IS_XZ - /** - * Head direction in -X axis for CoreXY and CoreXZ bots. - * - * If steps differ, both axes are moving. - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) - * If DeltaA == DeltaB, the movement is only in the 1st axis (X) - */ - #if EITHER(COREXY, COREXZ) - #define X_CMP == - #else - #define X_CMP != - #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) X_CMP D_(2)) ) - #else - #define X_MOVE_TEST !!current_block->steps.a - #endif - - #if CORE_IS_XY || CORE_IS_YZ - /** - * Head direction in -Y axis for CoreXY / CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) - */ - #if EITHER(COREYX, COREYZ) - #define Y_CMP == - #else - #define Y_CMP != - #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Y_CMP D_(2)) ) - #else - #define Y_MOVE_TEST !!current_block->steps.b - #endif - - #if CORE_IS_XZ || CORE_IS_YZ - /** - * Head direction in -Z axis for CoreXZ or CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) - */ - #if EITHER(COREZX, COREZY) - #define Z_CMP == - #else - #define Z_CMP != - #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && D_(1) Z_CMP D_(2)) ) - #else - #define Z_MOVE_TEST !!current_block->steps.c - #endif - - uint8_t axis_bits = 0; - if (X_MOVE_TEST) SBI(axis_bits, A_AXIS); - if (Y_MOVE_TEST) SBI(axis_bits, B_AXIS); - if (Z_MOVE_TEST) SBI(axis_bits, C_AXIS); - //if (!!current_block->steps.e) SBI(axis_bits, E_AXIS); - //if (!!current_block->steps.a) SBI(axis_bits, X_HEAD); - //if (!!current_block->steps.b) SBI(axis_bits, Y_HEAD); - //if (!!current_block->steps.c) SBI(axis_bits, Z_HEAD); - axis_did_move = axis_bits; - - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; - - uint8_t oversampling = 0; // Assume we won't use it - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - // At this point, we must decide if we can use Stepper movement axis smoothing. - uint32_t max_rate = current_block->nominal_rate; // Get the maximum rate (maximum event speed) - while (max_rate < MIN_STEP_ISR_FREQUENCY) { - max_rate <<= 1; - if (max_rate >= MAX_STEP_ISR_FREQUENCY_1X) break; - ++oversampling; - } - oversampling_factor = oversampling; - #endif - - // Based on the oversampling factor, do the calculations - step_event_count = current_block->step_event_count << oversampling; - - // Initialize Bresenham delta errors to 1/2 - delta_error = -int32_t(step_event_count); - - // Calculate Bresenham dividends and divisors - advance_dividend = current_block->steps << 1; - advance_divisor = step_event_count << 1; - - // No step events completed so far - step_events_completed = 0; - - // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling; - decelerate_after = current_block->decelerate_after << oversampling; - - #if ENABLED(MIXING_EXTRUDER) - MIXER_STEPPER_SETUP(); - #endif - - #if EXTRUDERS > 1 - stepper_extruder = current_block->extruder; - #endif - - // Initialize the trapezoid generator from the current block. - #if ENABLED(LIN_ADVANCE) - #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 - // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - if (stepper_extruder != last_moved_extruder) LA_current_adv_steps = 0; - #endif - - if ((LA_use_advance_lead = current_block->use_advance_lead)) { - LA_final_adv_steps = current_block->final_adv_steps; - LA_max_adv_steps = current_block->max_adv_steps; - //Start the ISR - nextAdvanceISR = 0; - LA_isr_rate = current_block->advance_speed; - } - else LA_isr_rate = LA_ADV_NEVER; - #endif - - if ( - #if HAS_DRIVER(L6470) - true // Always set direction for L6470 (This also enables the chips) - #else - current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || stepper_extruder != last_moved_extruder - #endif - #endif - ) { - last_direction_bits = current_block->direction_bits; - #if EXTRUDERS > 1 - last_moved_extruder = stepper_extruder; - #endif - set_directions(); - } - - // At this point, we must ensure the movement about to execute isn't - // trying to force the head against a limit switch. If using interrupt- - // driven change detection, and already against a limit then no call to - // the endstop_triggered method will be done and the movement will be - // done against the endstop. So, check the limits here: If the movement - // is against the limits, the block will be marked as to be killed, and - // on the next call to this ISR, will be discarded. - endstops.update(); - - #if ENABLED(Z_LATE_ENABLE) - // If delayed Z enable, enable it now. This option will severely interfere with - // timing between pulses when chaining motion between blocks, and it could lead - // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!! - if (current_block->steps.z) enable_Z(); - #endif - - // Mark the time_nominal as not calculated yet - ticks_nominal = -1; - - #if DISABLED(S_CURVE_ACCELERATION) - // Set as deceleration point the initial rate of the block - acc_step_rate = current_block->initial_rate; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - // Initialize the Bézier speed curve - _calc_bezier_curve_coeffs(current_block->initial_rate, current_block->cruise_rate, current_block->acceleration_time_inverse); - // We haven't started the 2nd half of the trapezoid - bezier_2nd_half = false; - #endif - - // Calculate the initial timer interval - interval = calc_timer_interval(current_block->initial_rate, oversampling_factor, &steps_per_isr); - } - } - - // Return the interval to wait - return interval; -} - -#if ENABLED(LIN_ADVANCE) - - // Timer interrupt for E. LA_steps is set in the main routine - uint32_t Stepper::advance_isr() { - uint32_t interval; - - if (LA_use_advance_lead) { - if (step_events_completed > decelerate_after && LA_current_adv_steps > LA_final_adv_steps) { - LA_steps--; - LA_current_adv_steps--; - interval = LA_isr_rate; - } - else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { - //step_events_completed <= (uint32_t)accelerate_until) { - LA_steps++; - LA_current_adv_steps++; - interval = LA_isr_rate; - } - else - interval = LA_isr_rate = LA_ADV_NEVER; - } - else - interval = LA_ADV_NEVER; - - #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); - - const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS); - - // Step E stepper if we have steps - while (LA_steps) { - - // Set the STEP pulse ON - #if ENABLED(MIXING_EXTRUDER) - E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); - #else - E_STEP_WRITE(stepper_extruder, !INVERT_E_STEP_PIN); - #endif - - // Enforce a minimum duration for STEP pulse ON - #if MINIMUM_STEPPER_PULSE - // Just wait for the requested pulse duration - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #endif - - // Add the delay needed to ensure the maximum driver rate is enforced - if (signed(added_step_ticks) > 0) pulse_end += hal_timer_t(added_step_ticks); - - LA_steps < 0 ? ++LA_steps : --LA_steps; - - // Set the STEP pulse OFF - #if ENABLED(MIXING_EXTRUDER) - E_STEP_WRITE(mixer.get_stepper(), INVERT_E_STEP_PIN); - #else - E_STEP_WRITE(stepper_extruder, INVERT_E_STEP_PIN); - #endif - - // For minimum pulse time wait before looping - // Just wait for the requested pulse duration - if (LA_steps) { - while (HAL_timer_get_count(PULSE_TIMER_NUM) < pulse_end) { /* nada */ } - #if MINIMUM_STEPPER_PULSE - // Add to the value, the time that the pulse must be active (to be used on the next loop) - pulse_end += hal_timer_t(MIN_PULSE_TICKS); - #endif - } - } // LA_steps - - return interval; - } -#endif // LIN_ADVANCE - -// Check if the given block is busy or not - Must not be called from ISR contexts -// The current_block could change in the middle of the read by an Stepper ISR, so -// we must explicitly prevent that! -bool Stepper::is_block_busy(const block_t* const block) { - #ifdef __AVR__ - // A SW memory barrier, to ensure GCC does not overoptimize loops - #define sw_barrier() asm volatile("": : :"memory"); - - // Keep reading until 2 consecutive reads return the same value, - // meaning there was no update in-between caused by an interrupt. - // This works because stepper ISRs happen at a slower rate than - // successive reads of a variable, so 2 consecutive reads with - // the same value means no interrupt updated it. - block_t* vold, *vnew = current_block; - sw_barrier(); - do { - vold = vnew; - vnew = current_block; - sw_barrier(); - } while (vold != vnew); - #else - block_t *vnew = current_block; - #endif - - // Return if the block is busy or not - return block == vnew; -} - -void Stepper::init() { - - #if MB(ALLIGATOR) - const float motor_current[] = MOTOR_CURRENT; - unsigned int digipot_motor = 0; - for (uint8_t i = 0; i < 3 + EXTRUDERS; i++) { - digipot_motor = 255 * (motor_current[i] / 2.5); - dac084s085::setValue(i, digipot_motor); - } - #endif//MB(ALLIGATOR) - - // Init Microstepping Pins - #if HAS_MICROSTEPS - microstep_init(); - #endif - - // Init Dir Pins - #if HAS_X_DIR - X_DIR_INIT; - #endif - #if HAS_X2_DIR - X2_DIR_INIT; - #endif - #if HAS_Y_DIR - Y_DIR_INIT; - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_DIR - Y2_DIR_INIT; - #endif - #endif - #if HAS_Z_DIR - Z_DIR_INIT; - #if Z_MULTI_STEPPER_DRIVERS && HAS_Z2_DIR - Z2_DIR_INIT; - #endif - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && HAS_Z3_DIR - Z3_DIR_INIT; - #endif - #endif - #if HAS_E0_DIR - E0_DIR_INIT; - #endif - #if HAS_E1_DIR - E1_DIR_INIT; - #endif - #if HAS_E2_DIR - E2_DIR_INIT; - #endif - #if HAS_E3_DIR - E3_DIR_INIT; - #endif - #if HAS_E4_DIR - E4_DIR_INIT; - #endif - #if HAS_E5_DIR - E5_DIR_INIT; - #endif - - // Init Enable Pins - steppers default to disabled. - #if HAS_X_ENABLE - X_ENABLE_INIT; - if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); - #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) && HAS_X2_ENABLE - X2_ENABLE_INIT; - if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Y_ENABLE - Y_ENABLE_INIT; - if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE - Y2_ENABLE_INIT; - if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_Z_ENABLE - Z_ENABLE_INIT; - if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); - #if Z_MULTI_STEPPER_DRIVERS && HAS_Z2_ENABLE - Z2_ENABLE_INIT; - if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); - #endif - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && HAS_Z3_ENABLE - Z3_ENABLE_INIT; - if (!Z_ENABLE_ON) Z3_ENABLE_WRITE(HIGH); - #endif - #endif - #if HAS_E0_ENABLE - E0_ENABLE_INIT; - if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); - #endif - #if HAS_E1_ENABLE - E1_ENABLE_INIT; - if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); - #endif - #if HAS_E2_ENABLE - E2_ENABLE_INIT; - if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); - #endif - #if HAS_E3_ENABLE - E3_ENABLE_INIT; - if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); - #endif - #if HAS_E4_ENABLE - E4_ENABLE_INIT; - if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); - #endif - #if HAS_E5_ENABLE - E5_ENABLE_INIT; - if (!E_ENABLE_ON) E5_ENABLE_WRITE(HIGH); - #endif - - #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT - #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) - #define _DISABLE(AXIS) disable_## AXIS() - - #define AXIS_INIT(AXIS, PIN) \ - _STEP_INIT(AXIS); \ - _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \ - _DISABLE(AXIS) - - #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E) - - // Init Step Pins - #if HAS_X_STEP - #if EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) - X2_STEP_INIT; - X2_STEP_WRITE(INVERT_X_STEP_PIN); - #endif - AXIS_INIT(X, X); - #endif - - #if HAS_Y_STEP - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - Y2_STEP_INIT; - Y2_STEP_WRITE(INVERT_Y_STEP_PIN); - #endif - AXIS_INIT(Y, Y); - #endif - - #if HAS_Z_STEP - #if Z_MULTI_STEPPER_DRIVERS - Z2_STEP_INIT; - Z2_STEP_WRITE(INVERT_Z_STEP_PIN); - #endif - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - Z3_STEP_INIT; - Z3_STEP_WRITE(INVERT_Z_STEP_PIN); - #endif - AXIS_INIT(Z, Z); - #endif - - #if E_STEPPERS > 0 && HAS_E0_STEP - E_AXIS_INIT(0); - #endif - #if E_STEPPERS > 1 && HAS_E1_STEP - E_AXIS_INIT(1); - #endif - #if E_STEPPERS > 2 && HAS_E2_STEP - E_AXIS_INIT(2); - #endif - #if E_STEPPERS > 3 && HAS_E3_STEP - E_AXIS_INIT(3); - #endif - #if E_STEPPERS > 4 && HAS_E4_STEP - E_AXIS_INIT(4); - #endif - #if E_STEPPERS > 5 && HAS_E5_STEP - E_AXIS_INIT(5); - #endif - - #if DISABLED(I2S_STEPPER_STREAM) - HAL_timer_start(STEP_TIMER_NUM, 122); // Init Stepper ISR to 122 Hz for quick starting - ENABLE_STEPPER_DRIVER_INTERRUPT(); - sei(); - #endif - - // Init direction bits for first moves - last_direction_bits = 0 - | (INVERT_X_DIR ? _BV(X_AXIS) : 0) - | (INVERT_Y_DIR ? _BV(Y_AXIS) : 0) - | (INVERT_Z_DIR ? _BV(Z_AXIS) : 0); - - set_directions(); - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - #if HAS_MOTOR_CURRENT_PWM - initialized = true; - #endif - digipot_init(); - #endif -} - -/** - * Set the stepper positions directly in steps - * - * The input is based on the typical per-axis XYZ steps. - * For CORE machines XYZ needs to be translated to ABC. - * - * This allows get_axis_position_mm to correctly - * derive the current XYZ position later on. - */ -void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - #if CORE_IS_XY - // corexy positioning - // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html - count_position.set(a + b, CORESIGN(a - b), c); - #elif CORE_IS_XZ - // corexz planning - count_position.set(a + c, b, CORESIGN(a - c)); - #elif CORE_IS_YZ - // coreyz planning - count_position.set(a, b + c, CORESIGN(b - c)); - #else - // default non-h-bot planning - count_position.set(a, b, c); - #endif - count_position.e = e; -} - -/** - * Get a stepper's position in steps. - */ -int32_t Stepper::position(const AxisEnum axis) { - #ifdef __AVR__ - // Protect the access to the position. Only required for AVR, as - // any 32bit CPU offers atomic access to 32bit variables - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - const int32_t v = count_position[axis]; - - #ifdef __AVR__ - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - return v; -} - -// Signal endstops were triggered - This function can be called from -// an ISR context (Temperature, Stepper or limits ISR), so we must -// be very careful here. If the interrupt being preempted was the -// Stepper ISR (this CAN happen with the endstop limits ISR) then -// when the stepper ISR resumes, we must be very sure that the movement -// is properly canceled -void Stepper::endstop_triggered(const AxisEnum axis) { - - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - 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(); - - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); -} - -int32_t Stepper::triggered_position(const AxisEnum axis) { - #ifdef __AVR__ - // Protect the access to the position. Only required for AVR, as - // any 32bit CPU offers atomic access to 32bit variables - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - const int32_t v = endstops_trigsteps[axis]; - - #ifdef __AVR__ - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - return v; -} - -void Stepper::report_positions() { - - #ifdef __AVR__ - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - const xyz_long_t pos = count_position; - - #ifdef __AVR__ - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA - SERIAL_ECHOPAIR(MSG_COUNT_A, pos.x, " B:", pos.y); - #else - SERIAL_ECHOPAIR(MSG_COUNT_X, pos.x, " Y:", pos.y); - #endif - #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA) - SERIAL_ECHOLNPAIR(" C:", pos.z); - #else - SERIAL_ECHOLNPAIR(" Z:", pos.z); - #endif -} - -#if ENABLED(BABYSTEPPING) - - #if MINIMUM_STEPPER_PULSE - #define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND) - #else - #define STEP_PULSE_CYCLES 0 - #endif - - #if ENABLED(DELTA) - #define CYCLES_EATEN_BABYSTEP (2 * 15) - #else - #define CYCLES_EATEN_BABYSTEP 0 - #endif - #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) - - #define _ENABLE(AXIS) enable_## AXIS() - #define _READ_DIR(AXIS) AXIS ##_DIR_READ() - #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR - #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) - - #if EXTRA_CYCLES_BABYSTEP > 20 - #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(PULSE_TIMER_NUM) - #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } - #else - #define _SAVE_START NOOP - #if EXTRA_CYCLES_BABYSTEP > 0 - #define _PULSE_WAIT DELAY_NS(EXTRA_CYCLES_BABYSTEP * NANOSECONDS_PER_CYCLE) - #elif ENABLED(DELTA) - #define _PULSE_WAIT DELAY_US(2); - #elif STEP_PULSE_CYCLES > 0 - #define _PULSE_WAIT NOOP - #else - #define _PULSE_WAIT DELAY_US(4); - #endif - #endif - - #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_POST_DIR_DELAY); \ - _SAVE_START; \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ - _APPLY_DIR(AXIS, old_dir); \ - } - - // MUST ONLY BE CALLED BY AN ISR, - // No other ISR should ever interrupt this! - void Stepper::babystep(const AxisEnum axis, const bool direction) { - cli(); - - switch (axis) { - - #if ENABLED(BABYSTEP_XY) - - case X_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction); - #elif CORE_IS_XZ - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Z, false, direction); - #else - BABYSTEP_AXIS(X, false, direction); - #endif - break; - - case Y_AXIS: - #if CORE_IS_XY - BABYSTEP_AXIS(X, false, direction); - BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0)); - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, false, direction); - BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0)); - #else - BABYSTEP_AXIS(Y, false, direction); - #endif - break; - - #endif - - case Z_AXIS: { - - #if CORE_IS_XZ - BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif CORE_IS_YZ - BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - - #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); - - #else // DELTA - - const bool z_direction = direction ^ BABYSTEP_INVERT_Z; - - enable_X(); - 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(); - - X_DIR_WRITE(INVERT_X_DIR ^ z_direction); - Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction); - Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction); - - #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); - #endif - - _SAVE_START; - - X_STEP_WRITE(!INVERT_X_STEP_PIN); - Y_STEP_WRITE(!INVERT_Y_STEP_PIN); - Z_STEP_WRITE(!INVERT_Z_STEP_PIN); - - _PULSE_WAIT; - - X_STEP_WRITE(INVERT_X_STEP_PIN); - Y_STEP_WRITE(INVERT_Y_STEP_PIN); - Z_STEP_WRITE(INVERT_Z_STEP_PIN); - - // Restore direction bits - X_DIR_WRITE(old_x_dir_pin); - Y_DIR_WRITE(old_y_dir_pin); - Z_DIR_WRITE(old_z_dir_pin); - - #endif - - } break; - - default: break; - } - sei(); - } - -#endif // BABYSTEPPING - -/** - * Software-controlled Stepper Motor Current - */ - -#if HAS_DIGIPOTSS - - // From Arduino DigitalPotControl example - void Stepper::digitalPotWrite(const int16_t address, const int16_t value) { - WRITE(DIGIPOTSS_PIN, LOW); // Take the SS pin low to select the chip - SPI.transfer(address); // Send the address and value via SPI - SPI.transfer(value); - WRITE(DIGIPOTSS_PIN, HIGH); // Take the SS pin high to de-select the chip - //delay(10); - } - -#endif // HAS_DIGIPOTSS - -#if HAS_MOTOR_CURRENT_PWM - - void Stepper::refresh_motor_power() { - if (!initialized) return; - LOOP_L_N(i, COUNT(motor_current_setting)) { - switch (i) { - #if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y) - case 0: - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: - #endif - #if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1) - case 2: - #endif - digipot_current(i, motor_current_setting[i]); - default: break; - } - } - } - -#endif // HAS_MOTOR_CURRENT_PWM - -#if !MB(PRINTRBOARD_G2) - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - - void Stepper::digipot_current(const uint8_t driver, const int16_t current) { - - #if HAS_DIGIPOTSS - - const uint8_t digipot_ch[] = DIGIPOT_CHANNELS; - digitalPotWrite(digipot_ch[driver], current); - - #elif HAS_MOTOR_CURRENT_PWM - - if (!initialized) return; - - if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1)) - motor_current_setting[driver] = current; // update motor_current_setting - - #define _WRITE_CURRENT_PWM(P) analogWrite(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) - switch (driver) { - case 0: - #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - _WRITE_CURRENT_PWM(X); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - _WRITE_CURRENT_PWM(Y); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - _WRITE_CURRENT_PWM(XY); - #endif - break; - case 1: - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - _WRITE_CURRENT_PWM(Z); - #endif - break; - case 2: - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - _WRITE_CURRENT_PWM(E); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) - _WRITE_CURRENT_PWM(E0); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) - _WRITE_CURRENT_PWM(E1); - #endif - break; - } - #endif - } - - void Stepper::digipot_init() { - - #if HAS_DIGIPOTSS - - static const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT; - - SPI.begin(); - SET_OUTPUT(DIGIPOTSS_PIN); - - for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) { - //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]); - digipot_current(i, digipot_motor_current[i]); - } - - #elif HAS_MOTOR_CURRENT_PWM - - #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - SET_PWM(MOTOR_CURRENT_PWM_X_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - SET_PWM(MOTOR_CURRENT_PWM_Y_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - SET_PWM(MOTOR_CURRENT_PWM_XY_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - SET_PWM(MOTOR_CURRENT_PWM_Z_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - SET_PWM(MOTOR_CURRENT_PWM_E_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) - SET_PWM(MOTOR_CURRENT_PWM_E0_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) - SET_PWM(MOTOR_CURRENT_PWM_E1_PIN); - #endif - - refresh_motor_power(); - - // Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) - #ifdef __AVR__ - SET_CS5(PRESCALER_1); - #endif - #endif - } - - #endif - -#else // PRINTRBOARD_G2 - - #include HAL_PATH(../HAL, fastio/G2_PWM.h) - -#endif - -#if HAS_MICROSTEPS - - /** - * Software-controlled Microstepping - */ - - void Stepper::microstep_init() { - #if HAS_X_MICROSTEPS - SET_OUTPUT(X_MS1_PIN); - SET_OUTPUT(X_MS2_PIN); - #if PIN_EXISTS(X_MS3) - SET_OUTPUT(X_MS3_PIN); - #endif - #endif - #if HAS_X2_MICROSTEPS - SET_OUTPUT(X2_MS1_PIN); - SET_OUTPUT(X2_MS2_PIN); - #if PIN_EXISTS(X2_MS3) - SET_OUTPUT(X2_MS3_PIN); - #endif - #endif - #if HAS_Y_MICROSTEPS - SET_OUTPUT(Y_MS1_PIN); - SET_OUTPUT(Y_MS2_PIN); - #if PIN_EXISTS(Y_MS3) - SET_OUTPUT(Y_MS3_PIN); - #endif - #endif - #if HAS_Y2_MICROSTEPS - SET_OUTPUT(Y2_MS1_PIN); - SET_OUTPUT(Y2_MS2_PIN); - #if PIN_EXISTS(Y2_MS3) - SET_OUTPUT(Y2_MS3_PIN); - #endif - #endif - #if HAS_Z_MICROSTEPS - SET_OUTPUT(Z_MS1_PIN); - SET_OUTPUT(Z_MS2_PIN); - #if PIN_EXISTS(Z_MS3) - SET_OUTPUT(Z_MS3_PIN); - #endif - #endif - #if HAS_Z2_MICROSTEPS - SET_OUTPUT(Z2_MS1_PIN); - SET_OUTPUT(Z2_MS2_PIN); - #if PIN_EXISTS(Z2_MS3) - SET_OUTPUT(Z2_MS3_PIN); - #endif - #endif - #if HAS_Z3_MICROSTEPS - SET_OUTPUT(Z3_MS1_PIN); - SET_OUTPUT(Z3_MS2_PIN); - #if PIN_EXISTS(Z3_MS3) - SET_OUTPUT(Z3_MS3_PIN); - #endif - #endif - #if HAS_E0_MICROSTEPS - SET_OUTPUT(E0_MS1_PIN); - SET_OUTPUT(E0_MS2_PIN); - #if PIN_EXISTS(E0_MS3) - SET_OUTPUT(E0_MS3_PIN); - #endif - #endif - #if HAS_E1_MICROSTEPS - SET_OUTPUT(E1_MS1_PIN); - SET_OUTPUT(E1_MS2_PIN); - #if PIN_EXISTS(E1_MS3) - SET_OUTPUT(E1_MS3_PIN); - #endif - #endif - #if HAS_E2_MICROSTEPS - SET_OUTPUT(E2_MS1_PIN); - SET_OUTPUT(E2_MS2_PIN); - #if PIN_EXISTS(E2_MS3) - SET_OUTPUT(E2_MS3_PIN); - #endif - #endif - #if HAS_E3_MICROSTEPS - SET_OUTPUT(E3_MS1_PIN); - SET_OUTPUT(E3_MS2_PIN); - #if PIN_EXISTS(E3_MS3) - SET_OUTPUT(E3_MS3_PIN); - #endif - #endif - #if HAS_E4_MICROSTEPS - SET_OUTPUT(E4_MS1_PIN); - SET_OUTPUT(E4_MS2_PIN); - #if PIN_EXISTS(E4_MS3) - SET_OUTPUT(E4_MS3_PIN); - #endif - #endif - #if HAS_E5_MICROSTEPS - SET_OUTPUT(E5_MS1_PIN); - SET_OUTPUT(E5_MS2_PIN); - #if PIN_EXISTS(E5_MS3) - SET_OUTPUT(E5_MS3_PIN); - #endif - #endif - - static const uint8_t microstep_modes[] = MICROSTEP_MODES; - for (uint16_t i = 0; i < COUNT(microstep_modes); i++) - microstep_mode(i, microstep_modes[i]); - } - - void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3) { - if (ms1 >= 0) switch (driver) { - #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS - case 0: - #if HAS_X_MICROSTEPS - WRITE(X_MS1_PIN, ms1); - #endif - #if HAS_X2_MICROSTEPS - WRITE(X2_MS1_PIN, ms1); - #endif - break; - #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS - case 1: - #if HAS_Y_MICROSTEPS - WRITE(Y_MS1_PIN, ms1); - #endif - #if HAS_Y2_MICROSTEPS - WRITE(Y2_MS1_PIN, ms1); - #endif - break; - #endif - #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS - case 2: - #if HAS_Z_MICROSTEPS - WRITE(Z_MS1_PIN, ms1); - #endif - #if HAS_Z2_MICROSTEPS - WRITE(Z2_MS1_PIN, ms1); - #endif - #if HAS_Z3_MICROSTEPS - WRITE(Z3_MS1_PIN, ms1); - #endif - break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS1_PIN, ms1); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS1_PIN, ms1); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS1_PIN, ms1); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS1_PIN, ms1); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS1_PIN, ms1); break; - #endif - #if HAS_E5_MICROSTEPS - case 8: WRITE(E5_MS1_PIN, ms1); break; - #endif - } - if (ms2 >= 0) switch (driver) { - #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS - case 0: - #if HAS_X_MICROSTEPS - WRITE(X_MS2_PIN, ms2); - #endif - #if HAS_X2_MICROSTEPS - WRITE(X2_MS2_PIN, ms2); - #endif - break; - #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS - case 1: - #if HAS_Y_MICROSTEPS - WRITE(Y_MS2_PIN, ms2); - #endif - #if HAS_Y2_MICROSTEPS - WRITE(Y2_MS2_PIN, ms2); - #endif - break; - #endif - #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS - case 2: - #if HAS_Z_MICROSTEPS - WRITE(Z_MS2_PIN, ms2); - #endif - #if HAS_Z2_MICROSTEPS - WRITE(Z2_MS2_PIN, ms2); - #endif - #if HAS_Z3_MICROSTEPS - WRITE(Z3_MS2_PIN, ms2); - #endif - break; - #endif - #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS2_PIN, ms2); break; - #endif - #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS2_PIN, ms2); break; - #endif - #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS2_PIN, ms2); break; - #endif - #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS2_PIN, ms2); break; - #endif - #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS2_PIN, ms2); break; - #endif - #if HAS_E5_MICROSTEPS - case 8: WRITE(E5_MS2_PIN, ms2); break; - #endif - } - if (ms3 >= 0) switch (driver) { - #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS - case 0: - #if HAS_X_MICROSTEPS && PIN_EXISTS(X_MS3) - WRITE(X_MS3_PIN, ms3); - #endif - #if HAS_X2_MICROSTEPS && PIN_EXISTS(X2_MS3) - WRITE(X2_MS3_PIN, ms3); - #endif - break; - #endif - #if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS - case 1: - #if HAS_Y_MICROSTEPS && PIN_EXISTS(Y_MS3) - WRITE(Y_MS3_PIN, ms3); - #endif - #if HAS_Y2_MICROSTEPS && PIN_EXISTS(Y2_MS3) - WRITE(Y2_MS3_PIN, ms3); - #endif - break; - #endif - #if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS - case 2: - #if HAS_Z_MICROSTEPS && PIN_EXISTS(Z_MS3) - WRITE(Z_MS3_PIN, ms3); - #endif - #if HAS_Z2_MICROSTEPS && PIN_EXISTS(Z2_MS3) - WRITE(Z2_MS3_PIN, ms3); - #endif - #if HAS_Z3_MICROSTEPS && PIN_EXISTS(Z3_MS3) - WRITE(Z3_MS3_PIN, ms3); - #endif - break; - #endif - #if HAS_E0_MICROSTEPS && PIN_EXISTS(E0_MS3) - case 3: WRITE(E0_MS3_PIN, ms3); break; - #endif - #if HAS_E1_MICROSTEPS && PIN_EXISTS(E1_MS3) - case 4: WRITE(E1_MS3_PIN, ms3); break; - #endif - #if HAS_E2_MICROSTEPS && PIN_EXISTS(E2_MS3) - case 5: WRITE(E2_MS3_PIN, ms3); break; - #endif - #if HAS_E3_MICROSTEPS && PIN_EXISTS(E3_MS3) - case 6: WRITE(E3_MS3_PIN, ms3); break; - #endif - #if HAS_E4_MICROSTEPS && PIN_EXISTS(E4_MS3) - case 7: WRITE(E4_MS3_PIN, ms3); break; - #endif - #if HAS_E5_MICROSTEPS && PIN_EXISTS(E5_MS3) - case 8: WRITE(E5_MS3_PIN, ms3); break; - #endif - } - } - - void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) { - switch (stepping_mode) { - #if HAS_MICROSTEP1 - case 1: microstep_ms(driver, MICROSTEP1); break; - #endif - #if HAS_MICROSTEP2 - case 2: microstep_ms(driver, MICROSTEP2); break; - #endif - #if HAS_MICROSTEP4 - case 4: microstep_ms(driver, MICROSTEP4); break; - #endif - #if HAS_MICROSTEP8 - case 8: microstep_ms(driver, MICROSTEP8); break; - #endif - #if HAS_MICROSTEP16 - case 16: microstep_ms(driver, MICROSTEP16); break; - #endif - #if HAS_MICROSTEP32 - case 32: microstep_ms(driver, MICROSTEP32); break; - #endif - #if HAS_MICROSTEP64 - case 64: microstep_ms(driver, MICROSTEP64); break; - #endif - #if HAS_MICROSTEP128 - case 128: microstep_ms(driver, MICROSTEP128); break; - #endif - - default: SERIAL_ERROR_MSG("Microsteps unavailable"); break; - } - } - - void Stepper::microstep_readings() { - SERIAL_ECHOPGM("MS1,MS2,MS3 Pins\nX: "); - #if HAS_X_MICROSTEPS - SERIAL_CHAR('0' + READ(X_MS1_PIN)); - SERIAL_CHAR('0' + READ(X_MS2_PIN)); - #if PIN_EXISTS(X_MS3) - SERIAL_ECHOLN((int)READ(X_MS3_PIN)); - #endif - #endif - #if HAS_Y_MICROSTEPS - SERIAL_ECHOPGM("Y: "); - SERIAL_CHAR('0' + READ(Y_MS1_PIN)); - SERIAL_CHAR('0' + READ(Y_MS2_PIN)); - #if PIN_EXISTS(Y_MS3) - SERIAL_ECHOLN((int)READ(Y_MS3_PIN)); - #endif - #endif - #if HAS_Z_MICROSTEPS - SERIAL_ECHOPGM("Z: "); - SERIAL_CHAR('0' + READ(Z_MS1_PIN)); - SERIAL_CHAR('0' + READ(Z_MS2_PIN)); - #if PIN_EXISTS(Z_MS3) - SERIAL_ECHOLN((int)READ(Z_MS3_PIN)); - #endif - #endif - #if HAS_E0_MICROSTEPS - SERIAL_ECHOPGM("E0: "); - SERIAL_CHAR('0' + READ(E0_MS1_PIN)); - SERIAL_CHAR('0' + READ(E0_MS2_PIN)); - #if PIN_EXISTS(E0_MS3) - SERIAL_ECHOLN((int)READ(E0_MS3_PIN)); - #endif - #endif - #if HAS_E1_MICROSTEPS - SERIAL_ECHOPGM("E1: "); - SERIAL_CHAR('0' + READ(E1_MS1_PIN)); - SERIAL_CHAR('0' + READ(E1_MS2_PIN)); - #if PIN_EXISTS(E1_MS3) - SERIAL_ECHOLN((int)READ(E1_MS3_PIN)); - #endif - #endif - #if HAS_E2_MICROSTEPS - SERIAL_ECHOPGM("E2: "); - SERIAL_CHAR('0' + READ(E2_MS1_PIN)); - SERIAL_CHAR('0' + READ(E2_MS2_PIN)); - #if PIN_EXISTS(E2_MS3) - SERIAL_ECHOLN((int)READ(E2_MS3_PIN)); - #endif - #endif - #if HAS_E3_MICROSTEPS - SERIAL_ECHOPGM("E3: "); - SERIAL_CHAR('0' + READ(E3_MS1_PIN)); - SERIAL_CHAR('0' + READ(E3_MS2_PIN)); - #if PIN_EXISTS(E3_MS3) - SERIAL_ECHOLN((int)READ(E3_MS3_PIN)); - #endif - #endif - #if HAS_E4_MICROSTEPS - SERIAL_ECHOPGM("E4: "); - SERIAL_CHAR('0' + READ(E4_MS1_PIN)); - SERIAL_CHAR('0' + READ(E4_MS2_PIN)); - #if PIN_EXISTS(E4_MS3) - SERIAL_ECHOLN((int)READ(E4_MS3_PIN)); - #endif - #endif - #if HAS_E5_MICROSTEPS - SERIAL_ECHOPGM("E5: "); - SERIAL_CHAR('0' + READ(E5_MS1_PIN)); - SERIAL_ECHOLN((int)READ(E5_MS2_PIN)); - #if PIN_EXISTS(E5_MS3) - SERIAL_ECHOLN((int)READ(E5_MS3_PIN)); - #endif - #endif - } - -#endif // HAS_MICROSTEPS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.h deleted file mode 100644 index 1ab455bd06..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper.h +++ /dev/null @@ -1,548 +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.h - stepper motor driver: executes motion plans of planner.c using the stepper motors - * Derived from Grbl - * - * Copyright (c) 2009-2011 Simen Svale Skogsrud - * - * Grbl 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. - * - * Grbl 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 Grbl. If not, see . - */ - -#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 - -// -// Estimate the amount of time the Stepper ISR will take to execute -// - -#ifdef CPU_32_BIT - - // The base ISR takes 792 cycles - #define ISR_BASE_CYCLES 792UL - - // Linear advance base time is 64 cycles - #if ENABLED(LIN_ADVANCE) - #define ISR_LA_BASE_CYCLES 64UL - #else - #define ISR_LA_BASE_CYCLES 0UL - #endif - - // S curve interpolation adds 40 cycles - #if ENABLED(S_CURVE_ACCELERATION) - #define ISR_S_CURVE_CYCLES 40UL - #else - #define ISR_S_CURVE_CYCLES 0UL - #endif - - // Stepper Loop base cycles - #define ISR_LOOP_BASE_CYCLES 4UL - - // To start the step pulse, in the worst case takes - #define ISR_START_STEPPER_CYCLES 13UL - - // And each stepper (start + stop pulse) takes in worst case - #define ISR_STEPPER_CYCLES 16UL - -#else - - // The base ISR takes 752 cycles - #define ISR_BASE_CYCLES 752UL - - // Linear advance base time is 32 cycles - #if ENABLED(LIN_ADVANCE) - #define ISR_LA_BASE_CYCLES 32UL - #else - #define ISR_LA_BASE_CYCLES 0UL - #endif - - // S curve interpolation adds 160 cycles - #if ENABLED(S_CURVE_ACCELERATION) - #define ISR_S_CURVE_CYCLES 160UL - #else - #define ISR_S_CURVE_CYCLES 0UL - #endif - - // Stepper Loop base cycles - #define ISR_LOOP_BASE_CYCLES 32UL - - // To start the step pulse, in the worst case takes - #define ISR_START_STEPPER_CYCLES 57UL - - // And each stepper (start + stop pulse) takes in worst case - #define ISR_STEPPER_CYCLES 88UL - -#endif - -// Add time for each stepper -#if HAS_X_STEP - #define ISR_START_X_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_X_STEPPER_CYCLES 0UL - #define ISR_X_STEPPER_CYCLES 0UL -#endif -#if HAS_Y_STEP - #define ISR_START_Y_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Y_STEPPER_CYCLES 0UL - #define ISR_Y_STEPPER_CYCLES 0UL -#endif -#if HAS_Z_STEP - #define ISR_START_Z_STEPPER_CYCLES ISR_START_STEPPER_CYCLES - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES -#else - #define ISR_START_Z_STEPPER_CYCLES 0UL - #define ISR_Z_STEPPER_CYCLES 0UL -#endif - -// E is always interpolated, even for mixing extruders -#define ISR_START_E_STEPPER_CYCLES ISR_START_STEPPER_CYCLES -#define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES - -// If linear advance is disabled, the loop also handles them -#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) - #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES)) - #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) -#else - #define ISR_START_MIXING_STEPPER_CYCLES 0UL - #define ISR_MIXING_STEPPER_CYCLES 0UL -#endif - -// Calculate the minimum time to start all stepper pulses in the ISR loop -#define MIN_ISR_START_LOOP_CYCLES (ISR_START_X_STEPPER_CYCLES + ISR_START_Y_STEPPER_CYCLES + ISR_START_Z_STEPPER_CYCLES + ISR_START_E_STEPPER_CYCLES + ISR_START_MIXING_STEPPER_CYCLES) - -// And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES) - -// Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate -#define _MIN_STEPPER_PULSE_CYCLES(N) _MAX(uint32_t((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) -#if MINIMUM_STEPPER_PULSE - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(uint32_t(MINIMUM_STEPPER_PULSE)) -#elif HAS_DRIVER(LV8729) - #define MIN_STEPPER_PULSE_CYCLES uint32_t((((F_CPU) - 1) / 2000000) + 1) // 0.5µs, aka 500ns -#else - #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL) -#endif - -// Calculate the minimum ticks of the PULSE timer that must elapse with the step pulse enabled -// 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) && 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))) -#endif - -// Calculate the extra ticks of the PULSE timer between step pulses -#define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS)) - -// But the user could be enforcing a minimum time, so the loop time is -#define ISR_LOOP_CYCLES (ISR_LOOP_BASE_CYCLES + _MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LOOP_CYCLES)) - -// If linear advance is enabled, then it is handled separately -#if ENABLED(LIN_ADVANCE) - - // Estimate the minimum LA loop time - #if ENABLED(MIXING_EXTRUDER) // ToDo: ??? - // HELP ME: What is what? - // Directions are set up for MIXING_STEPPERS - like before. - // Finding the right stepper may last up to MIXING_STEPPERS loops in get_next_stepper(). - // These loops are a bit faster than advancing a bresenham counter. - // Always only one e-stepper is stepped. - #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) - #else - #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES - #endif - - // And the real loop time - #define ISR_LA_LOOP_CYCLES _MAX(MIN_STEPPER_PULSE_CYCLES, MIN_ISR_LA_LOOP_CYCLES) - -#else - #define ISR_LA_LOOP_CYCLES 0UL -#endif - -// Now estimate the total ISR execution time in cycles given a step per ISR multiplier -#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + (ISR_LOOP_CYCLES) * (R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R)) - -// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz) -#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128)) -#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64)) -#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32)) -#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16)) -#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8)) -#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4)) -#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2)) -#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1)) - -// The minimum allowable frequency for step smoothing will be 1/10 of the maximum nominal frequency (in Hz) -#define MIN_STEP_ISR_FREQUENCY MAX_STEP_ISR_FREQUENCY_1X - -// -// Stepper class definition -// -class Stepper { - - public: - - #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) - static bool separate_multi_axis; - #endif - - #if HAS_MOTOR_CURRENT_PWM - #ifndef PWM_MOTOR_CURRENT - #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT - #endif - static uint32_t motor_current_setting[3]; - static bool initialized; - #endif - - private: - - static block_t* current_block; // A pointer to the block currently being traced - - static uint8_t last_direction_bits, // The next stepping-bits to be output - axis_did_move; // Last Movement in the given direction is not null, as computed when the last movement was fetched from planner - - static bool abort_current_block; // Signals to the stepper that current block should be aborted - - // Last-moved extruder, as set when the last movement was fetched from planner - #if EXTRUDERS < 2 - static constexpr uint8_t last_moved_extruder = 0; - #elif DISABLED(MIXING_EXTRUDER) - static uint8_t last_moved_extruder; - #endif - - #if ENABLED(X_DUAL_ENDSTOPS) - static bool locked_X_motor, locked_X2_motor; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static bool locked_Y_motor, locked_Y2_motor; - #endif - #if Z_MULTI_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) - static bool locked_Z_motor, locked_Z2_motor; - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS) - static bool locked_Z3_motor; - #endif - - static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks - static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call - - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis - #else - static constexpr uint8_t oversampling_factor = 0; - #endif - - // Delta error variables for the Bresenham line tracer - static xyze_long_t delta_error; - static xyze_ulong_t advance_dividend; - static uint32_t advance_divisor, - step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating - step_event_count; // The total event count for the current block - - #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) - static uint8_t stepper_extruder; - #else - static constexpr uint8_t stepper_extruder = 0; - #endif - - #if ENABLED(S_CURVE_ACCELERATION) - static int32_t bezier_A, // A coefficient in Bézier speed curve - bezier_B, // B coefficient in Bézier speed curve - bezier_C; // C coefficient in Bézier speed curve - static uint32_t bezier_F, // F coefficient in Bézier speed curve - bezier_AV; // AV coefficient in Bézier speed curve - #ifdef __AVR__ - static bool A_negative; // If A coefficient was negative - #endif - static bool bezier_2nd_half; // If Bézier curve has been initialized or not - #endif - - static uint32_t nextMainISR; // time remaining for the next Step ISR - #if ENABLED(LIN_ADVANCE) - static uint32_t nextAdvanceISR, LA_isr_rate; - static uint16_t LA_current_adv_steps, LA_final_adv_steps, LA_max_adv_steps; // Copy from current executed block. Needed because current_block is set to NULL "too early". - static int8_t LA_steps; - static bool LA_use_advance_lead; - #endif // LIN_ADVANCE - - static int32_t ticks_nominal; - #if DISABLED(S_CURVE_ACCELERATION) - static uint32_t acc_step_rate; // needed for deceleration start point - #endif - - // - // Exact steps at which an endstop was triggered - // - static xyz_long_t endstops_trigsteps; - - // - // Positions of stepper motors, in step units - // - static xyze_long_t count_position; - - // - // Current direction of stepper motors (+1 or -1) - // - static xyze_int8_t count_direction; - - public: - - // - // Constructor / initializer - // - Stepper() {}; - - // Initialize stepper hardware - static void init(); - - // Interrupt Service Routines - - // The ISR scheduler - static void isr(); - - // The stepper pulse phase ISR - static void stepper_pulse_phase_isr(); - - // The stepper block processing phase ISR - static uint32_t stepper_block_phase_isr(); - - #if ENABLED(LIN_ADVANCE) - // The Linear advance stepper ISR - static uint32_t advance_isr(); - #endif - - // Check if the given block is busy or not - Must not be called from ISR contexts - static bool is_block_busy(const block_t* const block); - - // Get the position of a stepper, in steps - static int32_t position(const AxisEnum axis); - - // Report the positions of the steppers, in steps - static void report_positions(); - - // The stepper subsystem goes to sleep when it runs out of things to execute. Call this - // to notify the subsystem that it is time to go to work. - static void wake_up(); - - // Quickly stop all steppers - FORCE_INLINE static void quick_stop() { abort_current_block = true; } - - // The direction of a single motor - FORCE_INLINE static bool motor_direction(const AxisEnum axis) { return TEST(last_direction_bits, axis); } - - // The last movement direction was not null on the specified axis. Note that motor direction is not necessarily the same. - FORCE_INLINE static bool axis_is_moving(const AxisEnum axis) { return TEST(axis_did_move, axis); } - - // The extruder associated to the last movement - FORCE_INLINE static uint8_t movement_extruder() { - return (0 - #if EXTRUDERS > 1 && DISABLED(MIXING_EXTRUDER) - + last_moved_extruder - #endif - ); - } - - // Handle a triggered endstop - static void endstop_triggered(const AxisEnum axis); - - // Triggered position of an axis in steps - static int32_t triggered_position(const AxisEnum axis); - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digitalPotWrite(const int16_t address, const int16_t value); - static void digipot_current(const uint8_t driver, const int16_t current); - #endif - - #if HAS_MICROSTEPS - static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3); - static void microstep_mode(const uint8_t driver, const uint8_t stepping); - static void microstep_readings(); - #endif - - #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) - FORCE_INLINE static void set_separate_multi_axis(const bool state) { separate_multi_axis = state; } - #endif - #if ENABLED(X_DUAL_ENDSTOPS) - FORCE_INLINE static void set_x_lock(const bool state) { locked_X_motor = state; } - FORCE_INLINE static void set_x2_lock(const bool state) { locked_X2_motor = state; } - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - FORCE_INLINE static void set_y_lock(const bool state) { locked_Y_motor = state; } - FORCE_INLINE static void set_y2_lock(const bool state) { locked_Y2_motor = state; } - #endif - #if Z_MULTI_ENDSTOPS || (ENABLED(Z_STEPPER_AUTO_ALIGN) && Z_MULTI_STEPPER_DRIVERS) - FORCE_INLINE static void set_z_lock(const bool state) { locked_Z_motor = state; } - FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } - #endif - #if ENABLED(Z_TRIPLE_ENDSTOPS) || BOTH(Z_STEPPER_AUTO_ALIGN, Z_TRIPLE_STEPPER_DRIVERS) - FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; } - #endif - - #if ENABLED(BABYSTEPPING) - static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention - #endif - - #if HAS_MOTOR_CURRENT_PWM - static void refresh_motor_power(); - #endif - - // Set the current position in steps - static inline void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { - planner.synchronize(); - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - _set_position(a, b, c, e); - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - } - static inline void set_position(const xyze_long_t &abce) { set_position(abce.a, abce.b, abce.c, abce.e); } - - static inline void set_axis_position(const AxisEnum a, const int32_t &v) { - planner.synchronize(); - - #ifdef __AVR__ - // Protect the access to the position. Only required for AVR, as - // any 32bit CPU offers atomic access to 32bit variables - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - - count_position[a] = v; - - #ifdef __AVR__ - // Reenable Stepper ISR - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); - #endif - } - - // Set direction bits for all steppers - static void set_directions(); - - private: - - // Set the current position in steps - static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e); - FORCE_INLINE static void _set_position(const abce_long_t &spos) { _set_position(spos.a, spos.b, spos.c, spos.e); } - - FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { - uint32_t timer; - - // Scale the frequency, as requested by the caller - step_rate <<= scale; - - uint8_t multistep = 1; - #if DISABLED(DISABLE_MULTI_STEPPING) - - // The stepping frequency limits for each multistepping rate - static const uint32_t limit[] PROGMEM = { - ( MAX_STEP_ISR_FREQUENCY_1X ), - ( MAX_STEP_ISR_FREQUENCY_2X >> 1), - ( MAX_STEP_ISR_FREQUENCY_4X >> 2), - ( MAX_STEP_ISR_FREQUENCY_8X >> 3), - ( MAX_STEP_ISR_FREQUENCY_16X >> 4), - ( MAX_STEP_ISR_FREQUENCY_32X >> 5), - ( MAX_STEP_ISR_FREQUENCY_64X >> 6), - (MAX_STEP_ISR_FREQUENCY_128X >> 7) - }; - - // Select the proper multistepping - uint8_t idx = 0; - while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) { - step_rate >>= 1; - multistep <<= 1; - ++idx; - }; - #else - NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X)); - #endif - *loops = multistep; - - #ifdef CPU_32_BIT - // In case of high-performance processor, it is able to calculate in real-time - timer = uint32_t(STEPPER_TIMER_RATE) / step_rate; - #else - constexpr uint32_t min_step_rate = F_CPU / 500000U; - NOLESS(step_rate, min_step_rate); - step_rate -= min_step_rate; // Correct for minimal speed - if (step_rate >= (8 * 256)) { // higher step rate - const uint8_t tmp_step_rate = (step_rate & 0x00FF); - const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0], - gain = (uint16_t)pgm_read_word(table_address + 2); - timer = MultiU16X8toH16(tmp_step_rate, gain); - timer = (uint16_t)pgm_read_word(table_address) - timer; - } - else { // lower step rates - uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0]; - table_address += ((step_rate) >> 1) & 0xFFFC; - timer = (uint16_t)pgm_read_word(table_address) - - (((uint16_t)pgm_read_word(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3); - } - // (there is no need to limit the timer value here. All limits have been - // applied above, and AVR is able to keep up at 30khz Stepping ISR rate) - #endif - - return timer; - } - - #if ENABLED(S_CURVE_ACCELERATION) - static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); - static int32_t _eval_bezier_curve(const uint32_t curr_step); - #endif - - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - static void digipot_init(); - #endif - - #if HAS_MICROSTEPS - static void microstep_init(); - #endif - -}; - -extern Stepper stepper; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.cpp deleted file mode 100644 index d682193aa9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.cpp +++ /dev/null @@ -1,143 +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 . - * - */ - -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.h deleted file mode 100644 index 8c731a8042..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/L6470.h +++ /dev/null @@ -1,176 +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/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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.cpp deleted file mode 100644 index 8acb735c9d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.cpp +++ /dev/null @@ -1,126 +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 . - * - */ - -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.h deleted file mode 100644 index a1c2704823..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/TMC26X.h +++ /dev/null @@ -1,144 +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/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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.cpp deleted file mode 100644 index 2037c1b84e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.cpp +++ /dev/null @@ -1,53 +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 . - * - */ - -/** - * 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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.h deleted file mode 100644 index ed87fde83c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/indirection.h +++ /dev/null @@ -1,399 +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" - -#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_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.cpp deleted file mode 100644 index 24e3d8cce3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.cpp +++ /dev/null @@ -1,740 +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 . - * - */ - -/** - * stepper/trinamic.cpp - * Stepper driver indirection for Trinamic - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_TRINAMIC - -#include "trinamic.h" -#include "../stepper.h" - -#include -#include - -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]) - -// 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, ST##_CHAIN_POS) -#else - #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, ST##_CHAIN_POS) -#endif - -#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) - -#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) - -#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 - -#ifndef TMC_BAUD_RATE - #define TMC_BAUD_RATE 115200 -#endif - -#if HAS_DRIVER(TMC2130) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - st.begin(); - - CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - st.en_pwm_mode(stealth); - st.stored.stealthChop_enabled = stealth; - - PWMCONF_t pwmconf{0}; - pwmconf.pwm_freq = 0b01; // f_pwm = 2/683 f_clk - pwmconf.pwm_autoscale = true; - pwmconf.pwm_grad = 5; - pwmconf.pwm_ampl = 180; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - - st.GSTAT(); // Clear GSTAT - } -#endif // TMC2130 - -#if HAS_DRIVER(TMC2160) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - st.begin(); - - CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - st.en_pwm_mode(stealth); - st.stored.stealthChop_enabled = stealth; - - TMC2160_n::PWMCONF_t pwmconf{0}; - pwmconf.pwm_lim = 12; - pwmconf.pwm_reg = 8; - pwmconf.pwm_autograd = true; - pwmconf.pwm_autoscale = true; - pwmconf.pwm_freq = 0b01; - pwmconf.pwm_grad = 14; - pwmconf.pwm_ofs = 36; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - - st.GSTAT(); // Clear GSTAT - } -#endif // TMC2160 - -// -// TMC2208/2209 Driver objects and inits -// -#if HAS_TMC220x - #if AXIS_HAS_UART(X) - #ifdef X_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, X, X); - #else - TMC_UART_DEFINE(SW, X, X); - #endif - #endif - #if AXIS_HAS_UART(X2) - #ifdef X2_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, X2, X); - #else - TMC_UART_DEFINE(SW, X2, X); - #endif - #endif - #if AXIS_HAS_UART(Y) - #ifdef Y_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, Y, Y); - #else - TMC_UART_DEFINE(SW, Y, Y); - #endif - #endif - #if AXIS_HAS_UART(Y2) - #ifdef Y2_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, Y2, Y); - #else - TMC_UART_DEFINE(SW, Y2, Y); - #endif - #endif - #if AXIS_HAS_UART(Z) - #ifdef Z_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, Z, Z); - #else - TMC_UART_DEFINE(SW, Z, Z); - #endif - #endif - #if AXIS_HAS_UART(Z2) - #ifdef Z2_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, Z2, Z); - #else - TMC_UART_DEFINE(SW, Z2, Z); - #endif - #endif - #if AXIS_HAS_UART(Z3) - #ifdef Z3_HARDWARE_SERIAL - TMC_UART_DEFINE(HW, Z3, Z); - #else - TMC_UART_DEFINE(SW, Z3, Z); - #endif - #endif - #if AXIS_HAS_UART(E0) - #ifdef E0_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 0); - #else - TMC_UART_DEFINE_E(SW, 0); - #endif - #endif - #if AXIS_HAS_UART(E1) - #ifdef E1_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 1); - #else - TMC_UART_DEFINE_E(SW, 1); - #endif - #endif - #if AXIS_HAS_UART(E2) - #ifdef E2_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 2); - #else - TMC_UART_DEFINE_E(SW, 2); - #endif - #endif - #if AXIS_HAS_UART(E3) - #ifdef E3_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 3); - #else - TMC_UART_DEFINE_E(SW, 3); - #endif - #endif - #if AXIS_HAS_UART(E4) - #ifdef E4_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 4); - #else - TMC_UART_DEFINE_E(SW, 4); - #endif - #endif - #if AXIS_HAS_UART(E5) - #ifdef E5_HARDWARE_SERIAL - TMC_UART_DEFINE_E(HW, 5); - #else - TMC_UART_DEFINE_E(SW, 5); - #endif - #endif - - void tmc_serial_begin() { - #if AXIS_HAS_UART(X) - #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperX.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(X2) - #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperX2.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(Y) - #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperY.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(Y2) - #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperY2.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(Z) - #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperZ.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(Z2) - #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperZ2.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(Z3) - #ifdef Z3_HARDWARE_SERIAL - Z3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperZ3.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E0) - #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE0.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E1) - #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE1.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E2) - #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE2.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E3) - #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE3.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E4) - #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE4.beginSerial(TMC_BAUD_RATE); - #endif - #endif - #if AXIS_HAS_UART(E5) - #ifdef E5_HARDWARE_SERIAL - E5_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); - #else - stepperE5.beginSerial(TMC_BAUD_RATE); - #endif - #endif - } -#endif - -#if HAS_DRIVER(TMC2208) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - TMC2208_n::GCONF_t gconf{0}; - gconf.pdn_disable = true; // Use UART - gconf.mstep_reg_select = true; // Select microsteps with UART - gconf.i_scale_analog = false; - gconf.en_spreadcycle = !stealth; - st.GCONF(gconf.sr); - st.stored.stealthChop_enabled = stealth; - - TMC2208_n::CHOPCONF_t chopconf{0}; - chopconf.tbl = 0b01; // blank_time = 24 - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - TMC2208_n::PWMCONF_t pwmconf{0}; - pwmconf.pwm_lim = 12; - pwmconf.pwm_reg = 8; - pwmconf.pwm_autograd = true; - pwmconf.pwm_autoscale = true; - pwmconf.pwm_freq = 0b01; - pwmconf.pwm_grad = 14; - pwmconf.pwm_ofs = 36; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - - st.GSTAT(0b111); // Clear - delay(200); - } -#endif // TMC2208 - -#if HAS_DRIVER(TMC2209) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - TMC2208_n::GCONF_t gconf{0}; - gconf.pdn_disable = true; // Use UART - gconf.mstep_reg_select = true; // Select microsteps with UART - gconf.i_scale_analog = false; - gconf.en_spreadcycle = !stealth; - st.GCONF(gconf.sr); - st.stored.stealthChop_enabled = stealth; - - TMC2208_n::CHOPCONF_t chopconf{0}; - chopconf.tbl = 0b01; // blank_time = 24 - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - TMC2208_n::PWMCONF_t pwmconf{0}; - pwmconf.pwm_lim = 12; - pwmconf.pwm_reg = 8; - pwmconf.pwm_autograd = true; - pwmconf.pwm_autoscale = true; - pwmconf.pwm_freq = 0b01; - pwmconf.pwm_grad = 14; - pwmconf.pwm_ofs = 36; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - - st.GSTAT(0b111); // Clear - delay(200); - } -#endif // TMC2209 - -#if HAS_DRIVER(TMC2660) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool) { - st.begin(); - - TMC2660_n::CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - st.CHOPCONF(chopconf.sr); - - st.sdoff(0); - st.rms_current(mA); - st.microsteps(microsteps); - #if ENABLED(SQUARE_WAVE_STEPPING) - st.dedge(true); - #endif - st.intpol(INTERPOLATE); - st.diss2g(true); // Disable short to ground protection. Too many false readings? - - #if ENABLED(TMC_DEBUG) - st.rdsel(0b01); - #endif - } -#endif // TMC2660 - -#if HAS_DRIVER(TMC5130) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - st.begin(); - - CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - st.en_pwm_mode(stealth); - st.stored.stealthChop_enabled = stealth; - - PWMCONF_t pwmconf{0}; - pwmconf.pwm_freq = 0b01; // f_pwm = 2/683 f_clk - pwmconf.pwm_autoscale = true; - pwmconf.pwm_grad = 5; - pwmconf.pwm_ampl = 180; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - - st.GSTAT(); // Clear GSTAT - } -#endif // TMC5130 - -#if HAS_DRIVER(TMC5160) - template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) { - st.begin(); - - CHOPCONF_t chopconf{0}; - chopconf.tbl = 1; - chopconf.toff = chopper_timing.toff; - chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hend + 3; - chopconf.hstrt = chopper_timing.hstrt - 1; - #if ENABLED(SQUARE_WAVE_STEPPING) - chopconf.dedge = true; - #endif - st.CHOPCONF(chopconf.sr); - - st.rms_current(mA, HOLD_MULTIPLIER); - st.microsteps(microsteps); - st.iholddelay(10); - st.TPOWERDOWN(128); // ~2s until driver lowers to hold current - - st.en_pwm_mode(stealth); - st.stored.stealthChop_enabled = stealth; - - TMC2160_n::PWMCONF_t pwmconf{0}; - pwmconf.pwm_lim = 12; - pwmconf.pwm_reg = 8; - pwmconf.pwm_autograd = true; - pwmconf.pwm_autoscale = true; - pwmconf.pwm_freq = 0b01; - pwmconf.pwm_grad = 14; - pwmconf.pwm_ofs = 36; - st.PWMCONF(pwmconf.sr); - - #if ENABLED(HYBRID_THRESHOLD) - st.set_pwm_thrs(thrs); - #else - UNUSED(thrs); - #endif - st.GSTAT(); // Clear GSTAT - } -#endif // TMC5160 - -void restore_trinamic_drivers() { - #if AXIS_IS_TMC(X) - stepperX.push(); - #endif - #if AXIS_IS_TMC(X2) - stepperX2.push(); - #endif - #if AXIS_IS_TMC(Y) - stepperY.push(); - #endif - #if AXIS_IS_TMC(Y2) - stepperY2.push(); - #endif - #if AXIS_IS_TMC(Z) - stepperZ.push(); - #endif - #if AXIS_IS_TMC(Z2) - stepperZ2.push(); - #endif - #if AXIS_IS_TMC(Z3) - stepperZ3.push(); - #endif - #if AXIS_IS_TMC(E0) - stepperE0.push(); - #endif - #if AXIS_IS_TMC(E1) - stepperE1.push(); - #endif - #if AXIS_IS_TMC(E2) - stepperE2.push(); - #endif - #if AXIS_IS_TMC(E3) - stepperE3.push(); - #endif - #if AXIS_IS_TMC(E4) - stepperE4.push(); - #endif - #if AXIS_IS_TMC(E5) - stepperE5.push(); - #endif -} - -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 AXIS_IS_TMC(X) - _TMC_INIT(X, STEALTH_AXIS_XY); - #endif - #if AXIS_IS_TMC(X2) - _TMC_INIT(X2, STEALTH_AXIS_XY); - #endif - #if AXIS_IS_TMC(Y) - _TMC_INIT(Y, STEALTH_AXIS_XY); - #endif - #if AXIS_IS_TMC(Y2) - _TMC_INIT(Y2, STEALTH_AXIS_XY); - #endif - #if AXIS_IS_TMC(Z) - _TMC_INIT(Z, STEALTH_AXIS_Z); - #endif - #if AXIS_IS_TMC(Z2) - _TMC_INIT(Z2, STEALTH_AXIS_Z); - #endif - #if AXIS_IS_TMC(Z3) - _TMC_INIT(Z3, STEALTH_AXIS_Z); - #endif - #if AXIS_IS_TMC(E0) - _TMC_INIT(E0, STEALTH_AXIS_E); - #endif - #if AXIS_IS_TMC(E1) - _TMC_INIT(E1, STEALTH_AXIS_E); - #endif - #if AXIS_IS_TMC(E2) - _TMC_INIT(E2, STEALTH_AXIS_E); - #endif - #if AXIS_IS_TMC(E3) - _TMC_INIT(E3, STEALTH_AXIS_E); - #endif - #if AXIS_IS_TMC(E4) - _TMC_INIT(E4, STEALTH_AXIS_E); - #endif - #if AXIS_IS_TMC(E5) - _TMC_INIT(E5, STEALTH_AXIS_E); - #endif - - #if USE_SENSORLESS - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - stepperX.homing_threshold(X_STALL_SENSITIVITY); - #endif - #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); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.homing_threshold(Y_STALL_SENSITIVITY); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - stepperZ.homing_threshold(Z_STALL_SENSITIVITY); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.homing_threshold(Z_STALL_SENSITIVITY); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - stepperZ3.homing_threshold(Z_STALL_SENSITIVITY); - #endif - #endif - #endif - - #ifdef TMC_ADV - TMC_ADV() - #endif - - stepper.set_directions(); -} - -#endif // HAS_TRINAMIC diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.h deleted file mode 100644 index 8c6e9c21aa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/stepper/trinamic.h +++ /dev/null @@ -1,232 +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/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_thinkerV2/Marlin2.0/Marlin/src/module/temperature.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/temperature.cpp deleted file mode 100644 index daaa008bf9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/temperature.cpp +++ /dev/null @@ -1,3218 +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 . - * - */ - -/** - * temperature.cpp - temperature control - */ - -#include "temperature.h" -#include "endstops.h" - -#include "../Marlin.h" -#include "../lcd/ultralcd.h" -#include "planner.h" -#include "../core/language.h" -#include "../HAL/shared/Delay.h" - -#if ENABLED(MAX6675_IS_MAX31865) - #include "Adafruit_MAX31865.h" - #ifndef MAX31865_CS_PIN - #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example - #endif - #ifndef MAX31865_MOSI_PIN - #define MAX31865_MOSI_PIN MOSI_PIN // 63 - #endif - #ifndef MAX31865_MISO_PIN - #define MAX31865_MISO_PIN MAX6675_DO_PIN // 42 - #endif - #ifndef MAX31865_SCK_PIN - #define MAX31865_SCK_PIN MAX6675_SCK_PIN // 40 - #endif - Adafruit_MAX31865 max31865 = Adafruit_MAX31865(MAX31865_CS_PIN - #if MAX31865_CS_PIN != MAX6675_SS_PIN - , MAX31865_MOSI_PIN // For software SPI also set MOSI/MISO/SCK - , MAX31865_MISO_PIN - , MAX31865_SCK_PIN - #endif - ); -#endif - -#define MAX6675_SEPARATE_SPI (EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PIN_EXISTS(MAX6675_SCK, MAX6675_DO)) - -#if MAX6675_SEPARATE_SPI - #include "../libs/private_spi.h" -#endif - -#if EITHER(BABYSTEPPING, PID_EXTRUSION_SCALING) - #include "stepper.h" -#endif - -#if ENABLED(BABYSTEPPING) - #include "../feature/babystep.h" - #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) - #include "../gcode/gcode.h" - #endif -#endif - -#include "printcounter.h" - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #include "../feature/filwidth.h" -#endif - -#if ENABLED(EMERGENCY_PARSER) - #include "../feature/emergency_parser.h" -#endif - -#if ENABLED(PRINTER_EVENT_LEDS) - #include "../feature/leds/printer_event_leds.h" -#endif - -#if ENABLED(JOYSTICK) - #include "../feature/joystick.h" -#endif - -#if ENABLED(SINGLENOZZLE) - #include "tool_change.h" -#endif - -#if USE_BEEPER - #include "../libs/buzzer.h" -#endif - -#if HOTEND_USES_THERMISTOR - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; - static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; - #else - static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE, (void*)HEATER_5_TEMPTABLE); - static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN, HEATER_5_TEMPTABLE_LEN); - #endif -#endif - -Temperature thermalManager; - -/** - * Macros to include the heater id in temp errors. The compiler's dead-code - * elimination should (hopefully) optimize out the unused strings. - */ - -#if HAS_HEATED_BED - #define _BED_PSTR(h) (h) == H_BED ? GET_TEXT(MSG_BED) : -#else - #define _BED_PSTR(h) -#endif -#if HAS_HEATED_CHAMBER - #define _CHAMBER_PSTR(h) (h) == H_CHAMBER ? GET_TEXT(MSG_CHAMBER) : -#else - #define _CHAMBER_PSTR(h) -#endif -#define _E_PSTR(h,N) ((HOTENDS) > N && (h) == N) ? PSTR(LCD_STR_E##N) : -#define HEATER_PSTR(h) _BED_PSTR(h) _CHAMBER_PSTR(h) _E_PSTR(h,1) _E_PSTR(h,2) _E_PSTR(h,3) _E_PSTR(h,4) _E_PSTR(h,5) PSTR(LCD_STR_E0) - -// public: - -#if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - bool Temperature::adaptive_fan_slowing = true; -#endif - -#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 } -#endif - -#if ENABLED(AUTO_POWER_CHAMBER_FAN) - uint8_t Temperature::chamberfan_speed; // = 0 -#endif - -#if FAN_COUNT > 0 - - uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 } - - #if ENABLED(EXTRA_FAN_SPEED) - uint8_t Temperature::old_fan_speed[FAN_COUNT], Temperature::new_fan_speed[FAN_COUNT]; - - void Temperature::set_temp_fan_speed(const uint8_t fan, const uint16_t tmp_temp) { - switch (tmp_temp) { - case 1: - set_fan_speed(fan, old_fan_speed[fan]); - break; - case 2: - old_fan_speed[fan] = fan_speed[fan]; - set_fan_speed(fan, new_fan_speed[fan]); - break; - default: - new_fan_speed[fan] = _MIN(tmp_temp, 255U); - break; - } - } - - #endif - - #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) - bool Temperature::fans_paused; // = false; - uint8_t Temperature::saved_fan_speed[FAN_COUNT]; // = { 0 } - #endif - - #if ENABLED(ADAPTIVE_FAN_SLOWING) - uint8_t Temperature::fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128); - #endif - - /** - * Set the print fan speed for a target extruder - */ - void Temperature::set_fan_speed(uint8_t target, uint16_t speed) { - - NOMORE(speed, 255U); - - #if ENABLED(SINGLENOZZLE) - if (target != active_extruder) { - if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed; - return; - } - target = 0; // Always use fan index 0 with SINGLENOZZLE - #endif - - if (target >= FAN_COUNT) return; - - fan_speed[target] = speed; - } - - #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) - - void Temperature::set_fans_paused(const bool p) { - if (p != fans_paused) { - fans_paused = p; - if (p) - FANS_LOOP(i) { saved_fan_speed[i] = fan_speed[i]; fan_speed[i] = 0; } - else - FANS_LOOP(i) fan_speed[i] = saved_fan_speed[i]; - } - } - - #endif - -#endif // FAN_COUNT > 0 - -#if WATCH_HOTENDS - heater_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } } -#endif -#if HEATER_IDLE_HANDLER - heater_idle_t Temperature::hotend_idle[HOTENDS]; // = { { 0 } } -#endif - -#if HAS_HEATED_BED - bed_info_t Temperature::temp_bed; // = { 0 } - // Init min and max temp with extreme values to prevent false errors during startup - #ifdef BED_MINTEMP - int16_t Temperature::mintemp_raw_BED = HEATER_BED_RAW_LO_TEMP; - #endif - #ifdef BED_MAXTEMP - int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP; - #endif - #if WATCH_BED - heater_watch_t Temperature::watch_bed; // = { 0 } - #endif - #if DISABLED(PIDTEMPBED) - millis_t Temperature::next_bed_check_ms; - #endif - #if HEATER_IDLE_HANDLER - heater_idle_t Temperature::bed_idle; // = { 0 } - #endif -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - chamber_info_t Temperature::temp_chamber; // = { 0 } - #if HAS_HEATED_CHAMBER - #ifdef CHAMBER_MINTEMP - int16_t Temperature::mintemp_raw_CHAMBER = HEATER_CHAMBER_RAW_LO_TEMP; - #endif - #ifdef CHAMBER_MAXTEMP - int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP; - #endif - #if WATCH_CHAMBER - heater_watch_t Temperature::watch_chamber{0}; - #endif - millis_t Temperature::next_chamber_check_ms; - #endif // HAS_HEATED_CHAMBER -#endif // HAS_TEMP_CHAMBER - -// Initialized by settings.load() -#if ENABLED(PIDTEMP) - //hotend_pid_t Temperature::pid[HOTENDS]; -#endif - -#if ENABLED(PREVENT_COLD_EXTRUSION) - bool Temperature::allow_cold_extrude = false; - int16_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; -#endif - -// private: - -#if EARLY_WATCHDOG - bool Temperature::inited = false; -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - uint16_t Temperature::redundant_temperature_raw = 0; - float Temperature::redundant_temperature = 0.0; -#endif - -volatile bool Temperature::temp_meas_ready = false; - -#if ENABLED(PID_EXTRUSION_SCALING) - int32_t Temperature::last_e_position, Temperature::lpq[LPQ_MAX_LEN]; - lpq_ptr_t Temperature::lpq_ptr = 0; -#endif - -#define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) < (HEATER_##N##_RAW_HI_TEMP) ? 1 : -1) - -#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); -#endif - -#ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; -#endif - -#ifdef MILLISECONDS_PREHEAT_TIME - millis_t Temperature::preheat_end_time[HOTENDS] = { 0 }; -#endif - -#if HAS_AUTO_FAN - millis_t Temperature::next_auto_fan_check_ms = 0; -#endif - -#if ENABLED(FAN_SOFT_PWM) - uint8_t Temperature::soft_pwm_amount_fan[FAN_COUNT], - Temperature::soft_pwm_count_fan[FAN_COUNT]; -#endif - -#if ENABLED(PROBING_HEATERS_OFF) - bool Temperature::paused; -#endif - -// public: - -#if HAS_ADC_BUTTONS - uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE; - uint8_t Temperature::ADCKey_count = 0; -#endif - -#if ENABLED(PID_EXTRUSION_SCALING) - int16_t Temperature::lpq_len; // Initialized in configuration_store -#endif - -#if HAS_PID_HEATING - - inline void say_default_() { SERIAL_ECHOPGM("#define DEFAULT_"); } - - /** - * PID Autotuning (M303) - * - * Alternately heat and cool the nozzle, observing its behavior to - * determine the best PID values to achieve a stable temperature. - * Needs sufficient heater power to make some overshoot at target - * 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_temp = 0.0; - int cycles = 0; - bool heating = true; - - millis_t next_temp_ms = millis(), t1 = next_temp_ms, t2 = next_temp_ms; - long t_high = 0, t_low = 0; - - long bias, d; - PID_t tune_pid = { 0, 0, 0 }; - float maxT = 0, minT = 10000; - - const bool isbed = (heater == H_BED); - - #if HAS_PID_FOR_BOTH - #define GHV(B,H) (isbed ? (B) : (H)) - #define SHV(B,H) do{ if (isbed) temp_bed.soft_pwm_amount = B; else temp_hotend[heater].soft_pwm_amount = H; }while(0) - #define ONHEATINGSTART() (isbed ? printerEventLEDs.onBedHeatingStart() : printerEventLEDs.onHotendHeatingStart()) - #define ONHEATING(S,C,T) (isbed ? printerEventLEDs.onBedHeating(S,C,T) : printerEventLEDs.onHotendHeating(S,C,T)) - #elif ENABLED(PIDTEMPBED) - #define GHV(B,H) B - #define SHV(B,H) (temp_bed.soft_pwm_amount = B) - #define ONHEATINGSTART() printerEventLEDs.onBedHeatingStart() - #define ONHEATING(S,C,T) printerEventLEDs.onBedHeating(S,C,T) - #else - #define GHV(B,H) H - #define SHV(B,H) (temp_hotend[heater].soft_pwm_amount = H) - #define ONHEATINGSTART() printerEventLEDs.onHotendHeatingStart() - #define ONHEATING(S,C,T) printerEventLEDs.onHotendHeating(S,C,T) - #endif - - #if WATCH_BED || WATCH_HOTENDS - #define HAS_TP_BED BOTH(THERMAL_PROTECTION_BED, PIDTEMPBED) - #if HAS_TP_BED && BOTH(THERMAL_PROTECTION_HOTENDS, PIDTEMP) - #define GTV(B,H) (isbed ? (B) : (H)) - #elif HAS_TP_BED - #define GTV(B,H) (B) - #else - #define GTV(B,H) (H) - #endif - const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); - const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); - millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL; - float next_watch_temp = 0.0; - bool heated = false; - #endif - - #if HAS_AUTO_FAN - next_auto_fan_check_ms = next_temp_ms + 2500UL; - #endif - - if (target > GHV(BED_MAXTEMP - 10, temp_range[heater].maxtemp - 15)) { - SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); - return; - } - - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); - - disable_all_heaters(); - - SHV(bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); - - wait_for_heatup = true; // Can be interrupted with M108 - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); - LEDColor color = ONHEATINGSTART(); - #endif - - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - adaptive_fan_slowing = false; - #endif - - // PID Tuning loop - while (wait_for_heatup) { - - const millis_t ms = millis(); - - if (temp_meas_ready) { // temp sample ready - updateTemperaturesFromRawValues(); - - // Get the current temperature and constrain it - 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_temp, target); - #endif - - #if HAS_AUTO_FAN - if (ELAPSED(ms, next_auto_fan_check_ms)) { - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - 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; - maxT = target; - } - } - - if (!heating && current_temp < target) { - if (ELAPSED(ms, t1 + 5000UL)) { - heating = true; - t2 = ms; - t_low = t2 - t1; - if (cycles > 0) { - const long max_pow = GHV(MAX_BED_POWER, PID_MAX); - bias += (d * (t_high - t_low)) / (t_low + t_high); - 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, minT, MSG_T_MAX, maxT); - if (cycles > 2) { - 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; - - SERIAL_ECHOPAIR(MSG_KU, Ku, MSG_TU, Tu); - if (isbed) { // Do not remove this otherwise PID autotune won't work right for the bed! - tune_pid.Kp = Ku * 0.2f; - tune_pid.Ki = 2 * tune_pid.Kp / Tu; - tune_pid.Kd = tune_pid.Kp * Tu / 3; - SERIAL_ECHOLNPGM("\n" " No overshoot"); // Works far better for the bed. Classic and some have bad ringing. - SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); - } - else { - tune_pid.Kp = Ku * pf; - tune_pid.Kd = tune_pid.Kp * Tu * df; - tune_pid.Ki = 2 * tune_pid.Kp / Tu; - SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); - } - - /** - tune_pid.Kp = 0.33 * Ku; - tune_pid.Ki = tune_pid.Kp / Tu; - tune_pid.Kd = tune_pid.Kp * Tu / 3; - SERIAL_ECHOLNPGM(" Some overshoot"); - SERIAL_ECHOLNPAIR(" Kp: ", tune_pid.Kp, " Ki: ", tune_pid.Ki, " Kd: ", tune_pid.Kd, " No overshoot"); - tune_pid.Kp = 0.2 * Ku; - tune_pid.Ki = 2 * tune_pid.Kp / Tu; - tune_pid.Kd = tune_pid.Kp * Tu / 3; - SERIAL_ECHOPAIR(" Kp: ", tune_pid.Kp, " Ki: ", tune_pid.Ki, " Kd: ", tune_pid.Kd); - */ - } - } - SHV((bias + d) >> 1, (bias + d) >> 1); - cycles++; - minT = target; - } - } - } - - // Did the temperature overshoot very far? - #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 30 - #endif - if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { - SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); - break; - } - - // Report heater states every 2 seconds - if (ELAPSED(ms, next_temp_ms)) { - #if HAS_TEMP_SENSOR - print_heater_states(isbed ? active_extruder : heater); - SERIAL_EOL(); - #endif - next_temp_ms = ms + 2000UL; - - // Make sure heating is actually working - #if WATCH_BED || WATCH_HOTENDS - if ( - #if WATCH_BED && WATCH_HOTENDS - true - #elif WATCH_HOTENDS - !isbed - #else - isbed - #endif - ) { - if (!heated) { // If not yet reached target... - 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_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), GET_TEXT(MSG_HEATING_FAILED_LCD)); - } - else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); - } - #endif - } // every 2 seconds - - // Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle - #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE - #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L - #endif - if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { - SERIAL_ECHOLNPGM(MSG_PID_TIMEOUT); - break; - } - - if (cycles > ncycles && cycles > 2) { - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED); - - #if HAS_PID_FOR_BOTH - const char * const estring = GHV(PSTR("bed"), NUL_STR); - say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); - say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); - say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); - #elif ENABLED(PIDTEMP) - say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); - say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); - say_default_(); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); - #else - say_default_(); SERIAL_ECHOLNPAIR("bedKp ", tune_pid.Kp); - say_default_(); SERIAL_ECHOLNPAIR("bedKi ", tune_pid.Ki); - say_default_(); SERIAL_ECHOLNPAIR("bedKd ", tune_pid.Kd); - #endif - - #define _SET_BED_PID() do { \ - temp_bed.pid.Kp = tune_pid.Kp; \ - temp_bed.pid.Ki = scalePID_i(tune_pid.Ki); \ - temp_bed.pid.Kd = scalePID_d(tune_pid.Kd); \ - }while(0) - - #define _SET_EXTRUDER_PID() do { \ - PID_PARAM(Kp, heater) = tune_pid.Kp; \ - PID_PARAM(Ki, heater) = scalePID_i(tune_pid.Ki); \ - PID_PARAM(Kd, heater) = scalePID_d(tune_pid.Kd); \ - updatePID(); }while(0) - - // Use the result? (As with "M303 U1") - if (set_result) { - #if HAS_PID_FOR_BOTH - if (isbed) _SET_BED_PID(); else _SET_EXTRUDER_PID(); - #elif ENABLED(PIDTEMP) - _SET_EXTRUDER_PID(); - #else - _SET_BED_PID(); - #endif - } - - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPidTuningDone(color); - #endif - - goto EXIT_M303; - } - ui.update(); - } - - disable_all_heaters(); - - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPidTuningDone(color); - #endif - - EXIT_M303: - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - adaptive_fan_slowing = true; - #endif - return; - } - -#endif // HAS_PID_HEATING - -/** - * Class and Instance Methods - */ - -int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { - switch (heater_id) { - #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 - } -} - -#define _EFANOVERLAP(A,B) _FANOVERLAP(E##A,B) - -#if HAS_AUTO_FAN - - #define CHAMBER_FAN_INDEX HOTENDS - - void Temperature::checkExtruderAutoFans() { - #define _EFAN(B,A) _EFANOVERLAP(A,B) ? B : - static const uint8_t fanBit[] PROGMEM = { - 0 - #if HOTENDS > 1 - , REPEAT2(1,_EFAN,1) 1 - #if HOTENDS > 2 - , REPEAT2(2,_EFAN,2) 2 - #if HOTENDS > 3 - , REPEAT2(3,_EFAN,3) 3 - #if HOTENDS > 4 - , REPEAT2(4,_EFAN,4) 4 - #if HOTENDS > 5 - , REPEAT2(5,_EFAN,5) 5 - #endif - #endif - #endif - #endif - #endif - #if HAS_AUTO_CHAMBER_FAN - #define _CFAN(B) _FANOVERLAP(CHAMBER,B) ? B : - , REPEAT(HOTENDS,_CFAN) (HOTENDS) - #endif - }; - - uint8_t fanState = 0; - HOTEND_LOOP() - if (temp_hotend[e].celsius >= EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[e])); - - #if HAS_AUTO_CHAMBER_FAN - if (temp_chamber.celsius >= CHAMBER_AUTO_FAN_TEMPERATURE) - SBI(fanState, pgm_read_byte(&fanBit[CHAMBER_FAN_INDEX])); - #endif - - #define _UPDATE_AUTO_FAN(P,D,A) do{ \ - if (PWM_PIN(P##_AUTO_FAN_PIN) && A < 255) \ - analogWrite(pin_t(P##_AUTO_FAN_PIN), D ? A : 0); \ - else \ - WRITE(P##_AUTO_FAN_PIN, D); \ - }while(0) - - uint8_t fanDone = 0; - for (uint8_t f = 0; f < COUNT(fanBit); f++) { - const uint8_t realFan = pgm_read_byte(&fanBit[f]); - if (TEST(fanDone, realFan)) continue; - const bool fan_on = TEST(fanState, realFan); - switch (f) { - #if ENABLED(AUTO_POWER_CHAMBER_FAN) - case CHAMBER_FAN_INDEX: - chamberfan_speed = fan_on ? CHAMBER_AUTO_FAN_SPEED : 0; - break; - #endif - default: - #if ENABLED(AUTO_POWER_E_FANS) - autofan_speed[realFan] = fan_on ? EXTRUDER_AUTO_FAN_SPEED : 0; - #endif - break; - } - - switch (f) { - #if HAS_AUTO_FAN_0 - case 0: _UPDATE_AUTO_FAN(E0, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_FAN_1 - case 1: _UPDATE_AUTO_FAN(E1, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_FAN_2 - case 2: _UPDATE_AUTO_FAN(E2, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_FAN_3 - case 3: _UPDATE_AUTO_FAN(E3, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_FAN_4 - case 4: _UPDATE_AUTO_FAN(E4, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_FAN_5 - case 5: _UPDATE_AUTO_FAN(E5, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; - #endif - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E - case CHAMBER_FAN_INDEX: _UPDATE_AUTO_FAN(CHAMBER, fan_on, CHAMBER_AUTO_FAN_SPEED); break; - #endif - } - SBI(fanDone, realFan); - } - } - -#endif // HAS_AUTO_FAN - -// -// Temperature Error Handlers -// - -inline void loud_kill(PGM_P const lcd_msg, const heater_ind_t heater) { - Running = false; - #if USE_BEEPER - for (uint8_t i = 20; i--;) { - WRITE(BEEPER_PIN, HIGH); delay(25); - WRITE(BEEPER_PIN, LOW); delay(80); - } - WRITE(BEEPER_PIN, HIGH); - #endif - kill(lcd_msg, HEATER_PSTR(heater)); -} - -void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) { - - static uint8_t killed = 0; - - if (IsRunning() - #if BOGUS_TEMPERATURE_GRACE_PERIOD - && killed == 2 - #endif - ) { - SERIAL_ERROR_START(); - serialprintPGM(serial_msg); - SERIAL_ECHOPGM(MSG_STOPPED_HEATER); - if (heater >= 0) SERIAL_ECHO((int)heater); - #if HAS_HEATED_CHAMBER - else if (heater == H_CHAMBER) SERIAL_ECHOPGM(MSG_HEATER_CHAMBER); - #endif - else SERIAL_ECHOPGM(MSG_HEATER_BED); - SERIAL_EOL(); - } - - disable_all_heaters(); // always disable (even for bogus temp) - - #if BOGUS_TEMPERATURE_GRACE_PERIOD - const millis_t ms = millis(); - static millis_t expire_ms; - switch (killed) { - case 0: - expire_ms = ms + BOGUS_TEMPERATURE_GRACE_PERIOD; - ++killed; - break; - case 1: - if (ELAPSED(ms, expire_ms)) ++killed; - break; - case 2: - loud_kill(lcd_msg, heater); - ++killed; - break; - } - #elif defined(BOGUS_TEMPERATURE_GRACE_PERIOD) - UNUSED(killed); - #else - if (!killed) { killed = 1; loud_kill(lcd_msg, heater); } - #endif -} - -void Temperature::max_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); -} - -void Temperature::min_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); -} - -#if HOTENDS - - float Temperature::get_pid_output_hotend(const uint8_t E_NAME) { - 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; - - float 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) - #if HOTENDS == 1 - constexpr bool this_hotend = true; - #else - const bool this_hotend = (ee == active_extruder); - #endif - work_pid[ee].Kc = 0; - if (this_hotend) { - 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 - - #if ENABLED(PID_FAN_SCALING) - if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { - work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder]; - pid_output += work_pid[ee].Kf; - } - //pid_output -= work_pid[ee].Ki; - //pid_output += work_pid[ee].Ki * work_pid[ee].Kf - #endif // PID_FAN_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 (ee == 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 - const bool is_idling = hotend_idle[ee].timed_out; - #else - constexpr bool is_idling = false; - #endif - const float pid_output = (!is_idling && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; - - #endif - - return pid_output; - } - -#endif // HOTENDS - -#if ENABLED(PIDTEMPBED) - - float Temperature::get_pid_output_bed() { - - #if DISABLED(PID_OPENLOOP) - - 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.celsius; - - if (!temp_bed.target || pid_error < -(PID_FUNCTIONAL_RANGE)) { - pid_output = 0; - pid_reset = true; - } - else if (pid_error > PID_FUNCTIONAL_RANGE) { - pid_output = MAX_BED_POWER; - pid_reset = true; - } - else { - if (pid_reset) { - temp_iState = 0.0; - work_pid.Kd = 0.0; - pid_reset = false; - } - - temp_iState = constrain(temp_iState + pid_error, 0, max_power_over_i_gain); - - 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.celsius) - work_pid.Kd); - - 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); - } - - #else // PID_OPENLOOP - - const float pid_output = constrain(temp_bed.target, 0, MAX_BED_POWER); - - #endif // PID_OPENLOOP - - #if ENABLED(PID_BED_DEBUG) - { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR( - " 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, - MSG_PID_DEBUG_DTERM, work_pid.Kd, - #endif - ); - } - #endif - - return pid_output; - } - -#endif // PIDTEMPBED - -/** - * Manage heating activities for extruder hot-ends and a heated bed - * - Acquire updated temperature readings - * - Also resets the watchdog timer - * - Invoke thermal runaway protection - * - Manage extruder auto-fan - * - Apply filament width to the extrusion rate (may move) - * - Update the heated bed PID output value - */ -void Temperature::manage_heater() { - - #if EARLY_WATCHDOG - // If thermal manager is still not running, make sure to at least reset the watchdog! - if (!inited) return watchdog_refresh(); - #endif - - #if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) - static bool last_pause_state; - #endif - - #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(); - #endif - - if (!temp_meas_ready) return; - - updateTemperaturesFromRawValues(); // also resets the watchdog - - #if ENABLED(HEATER_0_USES_MAX6675) - 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].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 - - millis_t ms = millis(); - - #if HOTENDS - - 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), GET_TEXT(MSG_THERMAL_RUNAWAY)); - #endif - - #if HEATER_IDLE_HANDLER - hotend_idle[e].update(ms); - #endif - - #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 - - 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 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), GET_TEXT(MSG_HEATING_FAILED_LCD)); - else // Start again if the target is still far off - start_watching_hotend(e); - } - #endif - - #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), GET_TEXT(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 - checkExtruderAutoFans(); - next_auto_fan_check_ms = ms + 2500UL; - } - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - /** - * Dynamically set the volumetric multiplier based - * on the delayed Filament Width measurement. - */ - filwidth.update_volumetric(); - #endif - - #if HAS_HEATED_BED - - #if ENABLED(THERMAL_PROTECTION_BED) - if (degBed() > BED_MAXTEMP) - _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); - #endif - - #if WATCH_BED - // Make sure temperature is increasing - if (watch_bed.elapsed(ms)) { // Time to check the bed? - if (degBed() < watch_bed.target) // Failed to increase enough? - _temp_error(H_BED, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); - else // Start again if the target is still far off - start_watching_bed(); - } - #endif // WATCH_BED - - do { - - #if DISABLED(PIDTEMPBED) - if (PENDING(ms, next_bed_check_ms) - #if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) - && paused == last_pause_state - #endif - ) break; - next_bed_check_ms = ms + BED_CHECK_INTERVAL; - #if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) - last_pause_state = paused; - #endif - #endif - - #if HEATER_IDLE_HANDLER - bed_idle.update(ms); - #endif - - #if HAS_THERMALLY_PROTECTED_BED - 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 - if (bed_idle.timed_out) { - temp_bed.soft_pwm_amount = 0; - #if DISABLED(PIDTEMPBED) - WRITE_HEATER_BED(LOW); - #endif - } - else - #endif - { - #if ENABLED(PIDTEMPBED) - 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.celsius, BED_MINTEMP, BED_MAXTEMP)) { - #if ENABLED(BED_LIMIT_SWITCHING) - if (temp_bed.celsius >= temp_bed.target + BED_HYSTERESIS) - temp_bed.soft_pwm_amount = 0; - 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.celsius < temp_bed.target ? MAX_BED_POWER >> 1 : 0; - #endif - } - else { - temp_bed.soft_pwm_amount = 0; - WRITE_HEATER_BED(LOW); - } - #endif - } - - } while (false); - - #endif // HAS_HEATED_BED - - #if HAS_HEATED_CHAMBER - - #ifndef CHAMBER_CHECK_INTERVAL - #define CHAMBER_CHECK_INTERVAL 1000UL - #endif - - #if ENABLED(THERMAL_PROTECTION_CHAMBER) - if (degChamber() > CHAMBER_MAXTEMP) - _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); - #endif - - #if WATCH_CHAMBER - // Make sure temperature is increasing - if (watch_chamber.elapsed(ms)) { // Time to check the chamber? - if (degChamber() < watch_chamber.target) // Failed to increase enough? - _temp_error(H_CHAMBER, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); - else - start_watching_chamber(); // Start again if the target is still far off - } - #endif - - if (ELAPSED(ms, next_chamber_check_ms)) { - next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL; - - if (WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { - #if ENABLED(CHAMBER_LIMIT_SWITCHING) - if (temp_chamber.celsius >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) - temp_chamber.soft_pwm_amount = 0; - 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.celsius < temp_chamber.target ? MAX_CHAMBER_POWER >> 1 : 0; - #endif - } - else { - temp_chamber.soft_pwm_amount = 0; - WRITE_HEATER_CHAMBER(LOW); - } - - #if ENABLED(THERMAL_PROTECTION_CHAMBER) - 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.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) -#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET) - -/** - * Bisect search for the range of the 'raw' value, then interpolate - * proportionally between the under and over values. - */ -#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ - uint8_t l = 0, r = LEN, m; \ - for (;;) { \ - m = (l + r) >> 1; \ - if (!m) return short(pgm_read_word(&TBL[0][1])); \ - if (m == l || m == r) return short(pgm_read_word(&TBL[LEN-1][1])); \ - short v00 = pgm_read_word(&TBL[m-1][0]), \ - v10 = pgm_read_word(&TBL[m-0][0]); \ - if (raw < v00) r = m; \ - else if (raw > v10) l = m; \ - else { \ - const short v01 = short(pgm_read_word(&TBL[m-1][1])), \ - v11 = short(pgm_read_word(&TBL[m-0][1])); \ - return v01 + (raw - v00) * float(v11 - v01) / float(v10 - v00); \ - } \ - } \ -}while(0) - -#if HAS_USER_THERMISTORS - - user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load() - - void Temperature::reset_user_thermistors() { - user_thermistor_t user_thermistor[USER_THERMISTORS] = { - #if ENABLED(HEATER_0_USER_THERMISTOR) - { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, - #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) - { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 }, - #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) - { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 }, - #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) - { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 }, - #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) - { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 }, - #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) - { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, - #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) - { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, - #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) - { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 } - #endif - }; - COPY(thermalManager.user_thermistor, user_thermistor); - } - - void Temperature::log_user_thermistor(const uint8_t t_index, const bool eprom/*=false*/) { - - if (eprom) - SERIAL_ECHOPGM(" M305 "); - else - SERIAL_ECHO_START(); - SERIAL_CHAR('P'); - SERIAL_CHAR('0' + t_index); - - const user_thermistor_t &t = user_thermistor[t_index]; - - SERIAL_ECHOPAIR_F(" R", t.series_res, 1); - SERIAL_ECHOPAIR_F(" T", t.res_25, 1); - SERIAL_ECHOPAIR_F(" B", t.beta, 1); - SERIAL_ECHOPAIR_F(" C", t.sh_c_coeff, 9); - SERIAL_ECHOPGM(" ; "); - serialprintPGM( - #if ENABLED(HEATER_0_USER_THERMISTOR) - t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") : - #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) - t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") : - #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) - t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") : - #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) - t_index == CTI_HOTEND_3 ? PSTR("HOTEND 3") : - #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) - t_index == CTI_HOTEND_4 ? PSTR("HOTEND 4") : - #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) - t_index == CTI_HOTEND_5 ? PSTR("HOTEND 5") : - #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) - t_index == CTI_BED ? PSTR("BED") : - #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) - t_index == CTI_CHAMBER ? PSTR("CHAMBER") : - #endif - nullptr - ); - SERIAL_EOL(); - } - - float Temperature::user_thermistor_to_deg_c(const uint8_t t_index, const int raw) { - //#if (MOTHERBOARD == BOARD_RAMPS_14_EFB) - // static uint32_t clocks_total = 0; - // static uint32_t calls = 0; - // uint32_t tcnt5 = TCNT5; - //#endif - - if (!WITHIN(t_index, 0, COUNT(user_thermistor) - 1)) return 25; - - 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 - const int adc_max = MAX_RAW_THERMISTOR_VALUE, - 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 = t.series_res * (adc_raw + 0.5f) / adc_inverse, - log_resistance = logf(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) - // int32_t clocks = TCNT5 - tcnt5; - // if (clocks >= 0) { - // clocks_total += clocks; - // calls++; - // } - //#endif - - // Return degrees C (up to 999, as the LCD only displays 3 digits) - return _MIN(value + THERMISTOR_ABS_ZERO_C, 999); - } -#endif - -#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 ( - #if ENABLED(MAX6675_IS_MAX31865) - max31865.temperature(100, 400) // 100 ohms = PT100 resistance. 400 ohms = calibration resistor - #else - raw * 0.25 - #endif - ); - #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; - } -#endif // HOTENDS - -#if HAS_HEATED_BED - // Derived from RepRap FiveD extruder::getTemperature() - // For bed temperature measurement. - float Temperature::analog_to_celsius_bed(const int raw) { - #if ENABLED(HEATER_BED_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_BED, raw); - #elif ENABLED(HEATER_BED_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_HEATED_BED - -#if HAS_TEMP_CHAMBER - // Derived from RepRap FiveD extruder::getTemperature() - // For chamber temperature measurement. - float Temperature::analog_to_celsius_chamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_CHAMBER, raw); - #elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR) - SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) - return TEMP_AD8495(raw); - #else - return 0; - #endif - } -#endif // HAS_TEMP_CHAMBER - -/** - * Get the raw values into the actual temperatures. - * The raw values are created in interrupt context, - * and this function is called from normal context - * as it would block the stepper routine. - */ -void Temperature::updateTemperaturesFromRawValues() { - #if ENABLED(HEATER_0_USES_MAX6675) - temp_hotend[0].raw = READ_MAX6675(0); - #endif - #if ENABLED(HEATER_1_USES_MAX6675) - temp_hotend[1].raw = READ_MAX6675(1); - #endif - #if HOTENDS - HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); - #endif - #if HAS_HEATED_BED - temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw); - #endif - #if HAS_TEMP_CHAMBER - 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) - filwidth.update_measured_mm(); - #endif - - // Reset the watchdog on good temperature measurement - watchdog_refresh(); - - temp_meas_ready = false; -} - -#if MAX6675_SEPARATE_SPI - SPIclass max6675_spi; -#endif - -// Init fans according to whether they're native PWM or Software PWM -#ifdef ALFAWISE_UX0 - #define _INIT_SOFT_FAN(P) OUT_WRITE_OD(P, FAN_INVERTING ? LOW : HIGH) -#else - #define _INIT_SOFT_FAN(P) OUT_WRITE(P, FAN_INVERTING ? LOW : HIGH) -#endif -#if ENABLED(FAN_SOFT_PWM) - #define _INIT_FAN_PIN(P) _INIT_SOFT_FAN(P) -#else - #define _INIT_FAN_PIN(P) do{ if (PWM_PIN(P)) SET_PWM(P); else _INIT_SOFT_FAN(P); }while(0) -#endif -#if ENABLED(FAST_PWM_FAN) - #define SET_FAST_PWM_FREQ(P) set_pwm_frequency(P, FAST_PWM_FAN_FREQUENCY) -#else - #define SET_FAST_PWM_FREQ(P) NOOP -#endif -#define INIT_FAN_PIN(P) do{ _INIT_FAN_PIN(P); SET_FAST_PWM_FREQ(P); }while(0) -#if EXTRUDER_AUTO_FAN_SPEED != 255 - #define INIT_E_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(FAST_PWM_FAN_FREQUENCY); } else SET_OUTPUT(P); }while(0) -#else - #define INIT_E_AUTO_FAN_PIN(P) SET_OUTPUT(P) -#endif -#if CHAMBER_AUTO_FAN_SPEED != 255 - #define INIT_CHAMBER_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(FAST_PWM_FAN_FREQUENCY); } else SET_OUTPUT(P); }while(0) -#else - #define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P) -#endif - -/** - * Initialize the temperature manager - * The manager is implemented by periodic calls to manage_heater() - */ -void Temperature::init() { - - #if ENABLED(MAX6675_IS_MAX31865) - max31865.begin(MAX31865_2WIRE); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE - #endif - - #if EARLY_WATCHDOG - // Flag that the thermalManager should be running - if (inited) return; - inited = true; - #endif - - #if MB(RUMBA) - #define _AD(N) (ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495)) - #if _AD(0) || _AD(1) || _AD(2) || _AD(3) || _AD(4) || _AD(5) || _AD(BED) || _AD(CHAMBER) - // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector - MCUCR = _BV(JTD); - MCUCR = _BV(JTD); - #endif - #endif - - #if BOTH(PIDTEMP, PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - - #if HAS_HEATER_0 - #ifdef ALFAWISE_UX0 - OUT_WRITE_OD(HEATER_0_PIN, HEATER_0_INVERTING); - #else - OUT_WRITE(HEATER_0_PIN, HEATER_0_INVERTING); - #endif - #endif - - #if HAS_HEATER_1 - OUT_WRITE(HEATER_1_PIN, HEATER_1_INVERTING); - #endif - #if HAS_HEATER_2 - OUT_WRITE(HEATER_2_PIN, HEATER_2_INVERTING); - #endif - #if HAS_HEATER_3 - OUT_WRITE(HEATER_3_PIN, HEATER_3_INVERTING); - #endif - #if HAS_HEATER_4 - OUT_WRITE(HEATER_4_PIN, HEATER_4_INVERTING); - #endif - #if HAS_HEATER_5 - OUT_WRITE(HEATER_5_PIN, HEATER_5_INVERTING); - #endif - - #if HAS_HEATED_BED - #ifdef ALFAWISE_UX0 - OUT_WRITE_OD(HEATER_BED_PIN, HEATER_BED_INVERTING); - #else - OUT_WRITE(HEATER_BED_PIN, HEATER_BED_INVERTING); - #endif - #endif - - #if HAS_HEATED_CHAMBER - OUT_WRITE(HEATER_CHAMBER_PIN, HEATER_CHAMBER_INVERTING); - #endif - - #if HAS_FAN0 - INIT_FAN_PIN(FAN_PIN); - #endif - #if HAS_FAN1 - INIT_FAN_PIN(FAN1_PIN); - #endif - #if HAS_FAN2 - INIT_FAN_PIN(FAN2_PIN); - #endif - #if ENABLED(USE_CONTROLLER_FAN) - INIT_FAN_PIN(CONTROLLER_FAN_PIN); - #endif - - #if MAX6675_SEPARATE_SPI - - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - - max6675_spi.init(); - - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS_PIN, HIGH); - - #endif - - #if ENABLED(HEATER_1_USES_MAX6675) - OUT_WRITE(MAX6675_SS2_PIN, HIGH); - #endif - - HAL_adc_init(); - - #if HAS_TEMP_ADC_0 - HAL_ANALOG_SELECT(TEMP_0_PIN); - #endif - #if HAS_TEMP_ADC_1 - HAL_ANALOG_SELECT(TEMP_1_PIN); - #endif - #if HAS_TEMP_ADC_2 - HAL_ANALOG_SELECT(TEMP_2_PIN); - #endif - #if HAS_TEMP_ADC_3 - HAL_ANALOG_SELECT(TEMP_3_PIN); - #endif - #if HAS_TEMP_ADC_4 - HAL_ANALOG_SELECT(TEMP_4_PIN); - #endif - #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 - #if HAS_TEMP_CHAMBER - HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - HAL_ANALOG_SELECT(FILWIDTH_PIN); - #endif - #if HAS_ADC_BUTTONS - HAL_ANALOG_SELECT(ADC_KEYPAD_PIN); - #endif - - HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); - ENABLE_TEMPERATURE_INTERRUPT(); - - #if HAS_AUTO_FAN_0 - INIT_E_AUTO_FAN_PIN(E0_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_FAN_1 && !_EFANOVERLAP(1,0) - INIT_E_AUTO_FAN_PIN(E1_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_FAN_2 && !(_EFANOVERLAP(2,0) || _EFANOVERLAP(2,1)) - INIT_E_AUTO_FAN_PIN(E2_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_FAN_3 && !(_EFANOVERLAP(3,0) || _EFANOVERLAP(3,1) || _EFANOVERLAP(3,2)) - INIT_E_AUTO_FAN_PIN(E3_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_FAN_4 && !(_EFANOVERLAP(4,0) || _EFANOVERLAP(4,1) || _EFANOVERLAP(4,2) || _EFANOVERLAP(4,3)) - INIT_E_AUTO_FAN_PIN(E4_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_FAN_5 && !(_EFANOVERLAP(5,0) || _EFANOVERLAP(5,1) || _EFANOVERLAP(5,2) || _EFANOVERLAP(5,3) || _EFANOVERLAP(5,4)) - INIT_E_AUTO_FAN_PIN(E5_AUTO_FAN_PIN); - #endif - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E - INIT_CHAMBER_AUTO_FAN_PIN(CHAMBER_AUTO_FAN_PIN); - #endif - - // Wait for temperature measurement to settle - delay(250); - - #if HOTENDS - - #define _TEMP_MIN_E(NR) do{ \ - temp_range[NR].mintemp = HEATER_ ##NR## _MINTEMP; \ - while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < HEATER_ ##NR## _MINTEMP) \ - temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \ - }while(0) - #define _TEMP_MAX_E(NR) do{ \ - temp_range[NR].maxtemp = HEATER_ ##NR## _MAXTEMP; \ - while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > HEATER_ ##NR## _MAXTEMP) \ - temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \ - }while(0) - - #ifdef HEATER_0_MINTEMP - _TEMP_MIN_E(0); - #endif - #ifdef HEATER_0_MAXTEMP - _TEMP_MAX_E(0); - #endif - #if HOTENDS > 1 - #ifdef HEATER_1_MINTEMP - _TEMP_MIN_E(1); - #endif - #ifdef HEATER_1_MAXTEMP - _TEMP_MAX_E(1); - #endif - #if HOTENDS > 2 - #ifdef HEATER_2_MINTEMP - _TEMP_MIN_E(2); - #endif - #ifdef HEATER_2_MAXTEMP - _TEMP_MAX_E(2); - #endif - #if HOTENDS > 3 - #ifdef HEATER_3_MINTEMP - _TEMP_MIN_E(3); - #endif - #ifdef HEATER_3_MAXTEMP - _TEMP_MAX_E(3); - #endif - #if HOTENDS > 4 - #ifdef HEATER_4_MINTEMP - _TEMP_MIN_E(4); - #endif - #ifdef HEATER_4_MAXTEMP - _TEMP_MAX_E(4); - #endif - #if HOTENDS > 5 - #ifdef HEATER_5_MINTEMP - _TEMP_MIN_E(5); - #endif - #ifdef HEATER_5_MAXTEMP - _TEMP_MAX_E(5); - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - #endif // HOTENDS - - #if HAS_HEATED_BED - #ifdef BED_MINTEMP - while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR); - #endif - #ifdef BED_MAXTEMP - while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) maxtemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR); - #endif - #endif // HAS_HEATED_BED - - #if HAS_HEATED_CHAMBER - #ifdef CHAMBER_MINTEMP - while (analog_to_celsius_chamber(mintemp_raw_CHAMBER) < CHAMBER_MINTEMP) mintemp_raw_CHAMBER += TEMPDIR(CHAMBER) * (OVERSAMPLENR); - #endif - #ifdef CHAMBER_MAXTEMP - while (analog_to_celsius_chamber(maxtemp_raw_CHAMBER) > CHAMBER_MAXTEMP) maxtemp_raw_CHAMBER -= TEMPDIR(CHAMBER) * (OVERSAMPLENR); - #endif - #endif - - #if ENABLED(PROBING_HEATERS_OFF) - paused = false; - #endif -} - -#if WATCH_HOTENDS - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M104, M109) - */ - void Temperature::start_watching_hotend(const uint8_t E_NAME) { - const uint8_t ee = HOTEND_INDEX; - if (degTargetHotend(ee) && degHotend(ee) < degTargetHotend(ee) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { - watch_hotend[ee].target = degHotend(ee) + WATCH_TEMP_INCREASE; - watch_hotend[ee].next_ms = millis() + (WATCH_TEMP_PERIOD) * 1000UL; - } - else - watch_hotend[ee].next_ms = 0; - } -#endif - -#if WATCH_BED - /** - * Start Heating Sanity Check for hotends that are below - * their target temperature by a configurable margin. - * This is called when the temperature is set. (M140, M190) - */ - void Temperature::start_watching_bed() { - if (degTargetBed() && degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { - watch_bed.target = degBed() + WATCH_BED_TEMP_INCREASE; - watch_bed.next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL; - } - else - watch_bed.next_ms = 0; - } -#endif - -#if WATCH_CHAMBER - /** - * Start Heating Sanity Check for chamber that is below - * its target temperature by a configurable margin. - * This is called when the temperature is set. (M141, M191) - */ - void Temperature::start_watching_chamber() { - if (degChamber() < degTargetChamber() - (WATCH_CHAMBER_TEMP_INCREASE + TEMP_CHAMBER_HYSTERESIS + 1)) { - watch_chamber.target = degChamber() + WATCH_CHAMBER_TEMP_INCREASE; - watch_chamber.next_ms = millis() + (WATCH_CHAMBER_TEMP_PERIOD) * 1000UL; - } - else - watch_chamber.next_ms = 0; - } -#endif - -#if HAS_THERMAL_PROTECTION - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - Temperature::tr_state_machine_t Temperature::tr_state_machine[HOTENDS]; // = { { TRInactive, 0 } }; - #endif - #if HAS_THERMALLY_PROTECTED_BED - Temperature::tr_state_machine_t Temperature::tr_state_machine_bed; // = { TRInactive, 0 }; - #endif - #if ENABLED(THERMAL_PROTECTION_CHAMBER) - Temperature::tr_state_machine_t Temperature::tr_state_machine_chamber; // = { TRInactive, 0 }; - #endif - - void Temperature::thermal_runaway_protection(Temperature::tr_state_machine_t &sm, const float ¤t, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) { - - static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; - - /** - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: "); - if (heater_id == H_CHAMBER) SERIAL_ECHOPGM("chamber"); - if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHO(heater_id); - SERIAL_ECHOPAIR(" ; State:", sm.state, " ; Timer:", sm.timer, " ; Temperature:", current, " ; Target Temp:", target); - if (heater_id >= 0) - SERIAL_ECHOPAIR(" ; Idle Timeout:", hotend_idle[heater_id].timed_out); - else - SERIAL_ECHOPAIR(" ; Idle Timeout:", bed_idle.timed_out); - SERIAL_EOL(); - //*/ - - const int heater_index = heater_id >= 0 ? heater_id : HOTENDS; - - #if HEATER_IDLE_HANDLER - // If the heater idle timeout expires, restart - if ((heater_id >= 0 && hotend_idle[heater_id].timed_out) - #if HAS_HEATED_BED - || (heater_id < 0 && bed_idle.timed_out) - #endif - ) { - sm.state = TRInactive; - tr_target_temperature[heater_index] = 0; - } - else - #endif - { - // If the target temperature changes, restart - if (tr_target_temperature[heater_index] != target) { - tr_target_temperature[heater_index] = target; - sm.state = target > 0 ? TRFirstHeating : TRInactive; - } - } - - switch (sm.state) { - // Inactive state waits for a target temperature to be set - case TRInactive: break; - - // When first heating, wait for the temperature to be reached then go to Stable state - case TRFirstHeating: - if (current < tr_target_temperature[heater_index]) break; - sm.state = TRStable; - - // While the temperature is stable watch for a bad temperature - case TRStable: - - #if ENABLED(ADAPTIVE_FAN_SLOWING) - if (adaptive_fan_slowing && heater_id >= 0) { - const int fan_index = _MIN(heater_id, FAN_COUNT - 1); - if (fan_speed[fan_index] == 0 || current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.25f)) - fan_speed_scaler[fan_index] = 128; - else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.3335f)) - fan_speed_scaler[fan_index] = 96; - else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.5f)) - fan_speed_scaler[fan_index] = 64; - else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.8f)) - fan_speed_scaler[fan_index] = 32; - else - fan_speed_scaler[fan_index] = 0; - } - #endif - - if (current >= tr_target_temperature[heater_index] - hysteresis_degc) { - sm.timer = millis() + period_seconds * 1000UL; - break; - } - else if (PENDING(millis(), sm.timer)) break; - sm.state = TRRunaway; - - case TRRunaway: - _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); - } - } - -#endif // HAS_THERMAL_PROTECTION - -void Temperature::disable_all_heaters() { - - #if ENABLED(AUTOTEMP) - planner.autotemp_enabled = false; - #endif - - #if HOTENDS - HOTEND_LOOP() setTargetHotend(0, e); - #endif - - #if HAS_HEATED_BED - setTargetBed(0); - #endif - - #if HAS_HEATED_CHAMBER - setTargetChamber(0); - #endif - - // Unpause and reset everything - #if ENABLED(PROBING_HEATERS_OFF) - pause(false); - #endif - - #define DISABLE_HEATER(NR) { \ - setTargetHotend(0, NR); \ - temp_hotend[NR].soft_pwm_amount = 0; \ - WRITE_HEATER_ ##NR (LOW); \ - } - - #if HAS_TEMP_HOTEND - REPEAT(HOTENDS, DISABLE_HEATER); - #endif - - #if HAS_HEATED_BED - temp_bed.target = 0; - temp_bed.soft_pwm_amount = 0; - WRITE_HEATER_BED(LOW); - #endif - - #if HAS_HEATED_CHAMBER - temp_chamber.target = 0; - temp_chamber.soft_pwm_amount = 0; - WRITE_HEATER_CHAMBER(LOW); - #endif -} - -#if ENABLED(PROBING_HEATERS_OFF) - - void Temperature::pause(const bool p) { - if (p != paused) { - paused = p; - if (p) { - HOTEND_LOOP() hotend_idle[e].expire(); // timeout immediately - #if HAS_HEATED_BED - bed_idle.expire(); // timeout immediately - #endif - } - else { - HOTEND_LOOP() reset_heater_idle_timer(e); - #if HAS_HEATED_BED - reset_bed_idle_timer(); - #endif - } - } - } - -#endif // PROBING_HEATERS_OFF - -#if HAS_MAX6675 - - int Temperature::read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex - #endif - ) { - #if COUNT_6675 == 1 - constexpr uint8_t hindex = 0; - #else - // Needed to return the correct temp when this is called too soon - static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; - #endif - - #define MAX6675_HEAT_INTERVAL 250UL - - #if ENABLED(MAX6675_IS_MAX31855) - static uint32_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 7 - #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 - #else - static uint16_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 4 - #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 - #endif - - // Return last-read value between readings - static millis_t next_max6675_ms[COUNT_6675] = { 0 }; - millis_t ms = millis(); - if (PENDING(ms, next_max6675_ms[hindex])) - return int( - #if COUNT_6675 == 1 - max6675_temp - #else - max6675_temp_previous[hindex] // Need to return the correct previous value - #endif - ); - - next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; - - #if ENABLED(MAX6675_IS_MAX31865) - max6675_temp = int(max31865.temperature(100, 400)); // 100 ohms = PT100 resistance. 400 ohms = calibration resistor - #endif - - // - // TODO: spiBegin, spiRec and spiInit doesn't work when soft spi is used. - // - #if !MAX6675_SEPARATE_SPI - spiBegin(); - spiInit(MAX6675_SPEED_BITS); - #endif - - #if COUNT_6675 > 1 - #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) - #define SET_OUTPUT_MAX6675() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) - #elif ENABLED(HEATER_1_USES_MAX6675) - #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS2_PIN) - #else - #define WRITE_MAX6675(V) WRITE(MAX6675_SS_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS_PIN) - #endif - - SET_OUTPUT_MAX6675(); - WRITE_MAX6675(LOW); // enable TT_MAX6675 - - DELAY_NS(100); // Ensure 100ns delay - - // Read a big-endian temperature value - max6675_temp = 0; - for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= ( - #if MAX6675_SEPARATE_SPI - max6675_spi.receive() - #else - spiRec() - #endif - ); - if (i > 0) max6675_temp <<= 8; // shift left if not the last byte - } - - WRITE_MAX6675(HIGH); // disable TT_MAX6675 - - if (max6675_temp & MAX6675_ERROR_MASK) { - SERIAL_ERROR_START(); - SERIAL_ECHOPGM("Temp measurement error! "); - #if MAX6675_ERROR_MASK == 7 - SERIAL_ECHOPGM("MAX31855 "); - if (max6675_temp & 1) - SERIAL_ECHOLNPGM("Open Circuit"); - else if (max6675_temp & 2) - SERIAL_ECHOLNPGM("Short to GND"); - else if (max6675_temp & 4) - SERIAL_ECHOLNPGM("Short to VCC"); - #else - SERIAL_ECHOLNPGM("MAX6675"); - #endif - - // Thermocouple open - max6675_temp = 4 * ( - #if COUNT_6675 > 1 - hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX - #elif ENABLED(HEATER_1_USES_MAX6675) - HEATER_1_MAX6675_TMAX - #else - HEATER_0_MAX6675_TMAX - #endif - ); - } - else - max6675_temp >>= MAX6675_DISCARD_BITS; - - #if ENABLED(MAX6675_IS_MAX31855) - if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature - #endif - - #if COUNT_6675 > 1 - max6675_temp_previous[hindex] = max6675_temp; - #endif - - return int(max6675_temp); - } - -#endif // HAS_MAX6675 - -/** - * Get raw temperatures - */ -void Temperature::set_current_temp_raw() { - - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) - 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].update(); - #endif - #if HAS_TEMP_ADC_2 - temp_hotend[2].update(); - #if HAS_TEMP_ADC_3 - temp_hotend[3].update(); - #if HAS_TEMP_ADC_4 - temp_hotend[4].update(); - #if HAS_TEMP_ADC_5 - temp_hotend[5].update(); - #endif // HAS_TEMP_ADC_5 - #endif // HAS_TEMP_ADC_4 - #endif // HAS_TEMP_ADC_3 - #endif // HAS_TEMP_ADC_2 - #endif // HAS_TEMP_ADC_1 - - #if HAS_HEATED_BED - temp_bed.update(); - #endif - - #if HAS_TEMP_CHAMBER - 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; -} - -void Temperature::readings_ready() { - - // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); - - // Filament Sensor - can be read any time since IIR filtering is used - #if ENABLED(FILAMENT_WIDTH_SENSOR) - filwidth.reading_ready(); - #endif - - #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.reset(); - #endif - - #if HAS_TEMP_CHAMBER - temp_chamber.reset(); - #endif - - #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 - - #if HOTENDS - - static constexpr int8_t temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - #define _TEMPDIR(N) , TEMPDIR(N) - #if ENABLED(HEATER_1_USES_MAX6675) - , 0 - #else - _TEMPDIR(1) - #endif - #if HOTENDS > 2 - REPEAT_S(2, HOTENDS, _TEMPDIR) - #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 - #define BEDCMP(A,B) ((A)<=(B)) - #else - #define BEDCMP(A,B) ((A)>=(B)) - #endif - const bool bed_on = (temp_bed.target > 0) - #if ENABLED(PIDTEMPBED) - || (temp_bed.soft_pwm_amount > 0) - #endif - ; - if (BEDCMP(temp_bed.raw, maxtemp_raw_BED)) max_temp_error(H_BED); - if (bed_on && BEDCMP(mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED); - #endif - - #if HAS_HEATED_CHAMBER - #if TEMPDIR(CHAMBER) < 0 - #define CHAMBERCMP(A,B) ((A)<=(B)) - #else - #define CHAMBERCMP(A,B) ((A)>=(B)) - #endif - const bool chamber_on = (temp_chamber.target > 0); - if (CHAMBERCMP(temp_chamber.raw, maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER); - if (chamber_on && CHAMBERCMP(mintemp_raw_CHAMBER, temp_chamber.raw)) min_temp_error(H_CHAMBER); - #endif -} - -/** - * Timer 0 is shared with millies so don't change the prescaler. - * - * On AVR this ISR uses the compare method so it runs at the base - * frequency (16 MHz / 64 / 256 = 976.5625 Hz), but at the TCNT0 set - * in OCR0B above (128 or halfway between OVFs). - * - * - Manage PWM to all the heaters and fan - * - Prepare or Measure one of the raw ADC sensor values - * - Check new temperature values for MIN/MAX errors (kill on error) - * - Step the babysteps value for each axis towards 0 - * - For PINS_DEBUGGING, monitor and report endstop pins - * - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged - * - Call planner.tick to count down its "ignore" time - */ -HAL_TEMP_TIMER_ISR() { - HAL_timer_isr_prologue(TEMP_TIMER_NUM); - - Temperature::tick(); - - HAL_timer_isr_epilogue(TEMP_TIMER_NUM); -} - -#if ENABLED(SLOW_PWM_HEATERS) && !defined(MIN_STATE_TIME) - #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds -#endif - -class SoftPWM { -public: - uint8_t count; - inline bool add(const uint8_t mask, const uint8_t amount) { - count = (count & mask) + amount; return (count > mask); - } - #if ENABLED(SLOW_PWM_HEATERS) - bool state_heater; - uint8_t state_timer_heater; - inline void dec() { if (state_timer_heater > 0) state_timer_heater--; } - inline bool ready(const bool v) { - const bool rdy = !state_timer_heater; - if (rdy && state_heater != v) { - state_heater = v; - state_timer_heater = MIN_STATE_TIME; - } - return rdy; - } - #endif -}; - -/** - * Handle various ~1KHz tasks associated with temperature - * - Heater PWM (~1KHz with scaler) - * - LCD Button polling (~500Hz) - * - Start / Read one ADC sensor - * - Advance Babysteps - * - Endstop polling - * - Planner clean buffer - */ -void Temperature::tick() { - - static int8_t temp_count = -1; - static ADCSensorState adc_sensor_state = StartupDelay; - static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); - - // avoid multiple loads of pwm_count - uint8_t pwm_count_tmp = pwm_count; - - #if HAS_ADC_BUTTONS - static unsigned int raw_ADCKey_value = 0; - static bool ADCKey_pressed = false; - #endif - - #if HOTENDS - static SoftPWM soft_pwm_hotend[HOTENDS]; - #endif - - #if HAS_HEATED_BED - static SoftPWM soft_pwm_bed; - #endif - - #if HAS_HEATED_CHAMBER - static SoftPWM soft_pwm_chamber; - #endif - - #if DISABLED(SLOW_PWM_HEATERS) - - #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; - - #if HOTENDS - #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]); - REPEAT(HOTENDS, _PWM_MOD_E); - #endif - - #if HAS_HEATED_BED - _PWM_MOD(BED,soft_pwm_bed,temp_bed); - #endif - - #if HAS_HEATED_CHAMBER - _PWM_MOD(CHAMBER,soft_pwm_chamber,temp_chamber); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #define _FAN_PWM(N) do{ \ - uint8_t &spcf = soft_pwm_count_fan[N]; \ - spcf = (spcf & pwm_mask) + (soft_pwm_amount_fan[N] >> 1); \ - WRITE_FAN(N, spcf > pwm_mask ? HIGH : LOW); \ - }while(0) - #if HAS_FAN0 - _FAN_PWM(0); - #endif - #if HAS_FAN1 - _FAN_PWM(1); - #endif - #if HAS_FAN2 - _FAN_PWM(2); - #endif - #endif - } - else { - #define _PWM_LOW(N,S) do{ if (S.count <= pwm_count_tmp) WRITE_HEATER_##N(LOW); }while(0) - #if HOTENDS - #define _PWM_LOW_E(N) _PWM_LOW(N, soft_pwm_hotend[N]); - REPEAT(HOTENDS, _PWM_LOW_E); - #endif - - #if HAS_HEATED_BED - _PWM_LOW(BED, soft_pwm_bed); - #endif - - #if HAS_HEATED_CHAMBER - _PWM_LOW(CHAMBER, soft_pwm_chamber); - #endif - - #if ENABLED(FAN_SOFT_PWM) - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(0, LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN(1, LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN(2, LOW); - #endif - #endif - } - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - #else // SLOW_PWM_HEATERS - - /** - * SLOW PWM HEATERS - * - * For relay-driven heaters - */ - #define _SLOW_SET(NR,PWM,V) do{ if (PWM.ready(V)) WRITE_HEATER_##NR(V); }while(0) - #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 - #define _SLOW_PWM_E(N) _SLOW_PWM(N, soft_pwm_hotend[N], temp_hotend[N]); - REPEAT(HOTENDS, _SLOW_PWM_E); - #endif - - #if HAS_HEATED_BED - _SLOW_PWM(BED, soft_pwm_bed, temp_bed); - #endif - - } // slow_pwm_count == 0 - - #if HOTENDS - #define _PWM_OFF_E(N) _PWM_OFF(N, soft_pwm_hotend[N]); - REPEAT(HOTENDS, _PWM_OFF_E); - #endif - - #if HAS_HEATED_BED - _PWM_OFF(BED, soft_pwm_bed); - #endif - - #if ENABLED(FAN_SOFT_PWM) - if (pwm_count_tmp >= 127) { - pwm_count_tmp = 0; - #define _PWM_FAN(N) do{ \ - soft_pwm_count_fan[N] = soft_pwm_amount_fan[N] >> 1; \ - WRITE_FAN(N, soft_pwm_count_fan[N] > 0 ? HIGH : LOW); \ - }while(0) - #if HAS_FAN0 - _PWM_FAN(0); - #endif - #if HAS_FAN1 - _PWM_FAN(1); - #endif - #if HAS_FAN2 - _PWM_FAN(2); - #endif - } - #if HAS_FAN0 - if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(0, LOW); - #endif - #if HAS_FAN1 - if (soft_pwm_count_fan[1] <= pwm_count_tmp) WRITE_FAN(1, LOW); - #endif - #if HAS_FAN2 - if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN(2, LOW); - #endif - #endif // FAN_SOFT_PWM - - // SOFT_PWM_SCALE to frequency: - // - // 0: 16000000/64/256/128 = 7.6294 Hz - // 1: / 64 = 15.2588 Hz - // 2: / 32 = 30.5176 Hz - // 3: / 16 = 61.0352 Hz - // 4: / 8 = 122.0703 Hz - // 5: / 4 = 244.1406 Hz - pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - - // increment slow_pwm_count only every 64th pwm_count, - // i.e. yielding a PWM frequency of 16/128 Hz (8s). - if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) { - slow_pwm_count++; - slow_pwm_count &= 0x7F; - - #if HOTENDS - HOTEND_LOOP() soft_pwm_hotend[e].dec(); - #endif - #if HAS_HEATED_BED - soft_pwm_bed.dec(); - #endif - } // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0 - - #endif // SLOW_PWM_HEATERS - - // - // Update lcd buttons 488 times per second - // - static bool do_buttons; - if ((do_buttons ^= true)) ui.update_buttons(); - - /** - * One sensor is sampled on every other call of the ISR. - * Each sensor is read 16 (OVERSAMPLENR) times, taking the average. - * - * On each Prepare pass, ADC is started for a sensor pin. - * On the next pass, the ADC value is read and accumulated. - * - * This gives each ADC 0.9765ms to charge up. - */ - #define ACCUMULATE_ADC(obj) do{ \ - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else obj.sample(HAL_READ_ADC()); \ - }while(0) - - ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; - - switch (adc_sensor_state) { - - case SensorsReady: { - // All sensors have been read. Stay in this state for a few - // ISRs to save on calls to temp update/checking code below. - constexpr int8_t extra_loops = MIN_ADC_ISR_LOOPS - (int8_t)SensorsReady; - static uint8_t delay_count = 0; - if (extra_loops > 0) { - if (delay_count == 0) delay_count = extra_loops; // Init this delay - if (--delay_count) // While delaying... - next_sensor_state = SensorsReady; // retain this state (else, next state will be 0) - break; - } - else { - adc_sensor_state = StartSampling; // Fall-through to start sampling - next_sensor_state = (ADCSensorState)(int(StartSampling) + 1); - } - } - - case StartSampling: // Start of sampling loops. Do updates/checks. - if (++temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. - temp_count = 0; - readings_ready(); - } - 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; - #endif - - #if HAS_HEATED_BED - 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; - #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; - #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; - #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; - #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; - #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; - #endif - - #if ENABLED(FILAMENT_WIDTH_SENSOR) - 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 - 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 Measure_ADC_KEY: - if (!HAL_ADC_READY()) - next_sensor_state = adc_sensor_state; // redo this state - else if (ADCKey_count < 16) { - raw_ADCKey_value = HAL_READ_ADC(); - if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) { - NOMORE(current_ADCKey_raw, raw_ADCKey_value); - ADCKey_count++; - } - else { //ADC Key release - if (ADCKey_count > 0) ADCKey_count++; else ADCKey_pressed = false; - if (ADCKey_pressed) { - ADCKey_count = 0; - current_ADCKey_raw = HAL_ADC_RANGE; - } - } - } - if (ADCKey_count == 16) ADCKey_pressed = true; - break; - #endif // ADC_KEYPAD - - case StartupDelay: break; - - } // switch(adc_sensor_state) - - // Go to the next state - adc_sensor_state = next_sensor_state; - - // - // Additional ~1KHz Tasks - // - - #if ENABLED(BABYSTEPPING) - babystep.task(); - #endif - - // Poll endstops state, if required - endstops.poll(); - - // Periodically call the planner timer - planner.tick(); -} - -#if HAS_TEMP_SENSOR - - #include "../gcode/gcode.h" - - static void print_heater_state(const float &c, const float &t - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , const float r - #endif - , const heater_ind_t e=INDEX_NONE - ) { - char k; - switch (e) { - #if HAS_TEMP_CHAMBER - case H_CHAMBER: k = 'C'; break; - #endif - #if HAS_TEMP_HOTEND - default: k = 'T'; break; - #if HAS_HEATED_BED - case H_BED: k = 'B'; break; - #endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - case H_REDUNDANT: k = 'R'; break; - #endif - #elif HAS_HEATED_BED - default: k = 'B'; break; - #endif - } - SERIAL_CHAR(' '); - SERIAL_CHAR(k); - #if HOTENDS > 1 - if (e >= 0) SERIAL_CHAR('0' + e); - #endif - SERIAL_CHAR(':'); - SERIAL_ECHO(c); - SERIAL_ECHOPAIR(" /" , t); - #if ENABLED(SHOW_TEMP_ADC_VALUES) - SERIAL_ECHOPAIR(" (", r * RECIPROCAL(OVERSAMPLENR)); - SERIAL_CHAR(')'); - #endif - delay(2); - } - - void Temperature::print_heater_states(const uint8_t target_extruder - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - , const bool include_r/*=false*/ - #endif - ) { - #if HAS_TEMP_HOTEND - print_heater_state(degHotend(target_extruder), degTargetHotend(target_extruder) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(target_extruder) - #endif - ); - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - if (include_r) print_heater_state(redundant_temperature, degTargetHotend(target_extruder) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , redundant_temperature_raw - #endif - , H_REDUNDANT - ); - #endif - #endif - #if HAS_HEATED_BED - print_heater_state(degBed(), degTargetBed() - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawBedTemp() - #endif - , H_BED - ); - #endif - #if HAS_TEMP_CHAMBER - print_heater_state(degChamber() - #if HAS_HEATED_CHAMBER - , degTargetChamber() - #else - , 0 - #endif - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawChamberTemp() - #endif - , H_CHAMBER - ); - #endif // HAS_TEMP_CHAMBER - #if HOTENDS > 1 - HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) - #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(e) - #endif - , (heater_ind_t)e - ); - #endif - SERIAL_ECHOPAIR(" @:", getHeaterPower((heater_ind_t)target_extruder)); - #if HAS_HEATED_BED - SERIAL_ECHOPAIR(" B@:", getHeaterPower(H_BED)); - #endif - #if HAS_HEATED_CHAMBER - SERIAL_ECHOPAIR(" C@:", getHeaterPower(H_CHAMBER)); - #endif - #if HOTENDS > 1 - HOTEND_LOOP() { - SERIAL_ECHOPAIR(" @", e); - SERIAL_CHAR(':'); - SERIAL_ECHO(getHeaterPower((heater_ind_t)e)); - } - #endif - } - - #if ENABLED(AUTO_REPORT_TEMPERATURES) - - uint8_t Temperature::auto_report_temp_interval; - millis_t Temperature::next_temp_report_ms; - - void Temperature::auto_report_temperatures() { - if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) { - next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; - PORT_REDIRECT(SERIAL_BOTH); - print_heater_states(active_extruder); - SERIAL_EOL(); - } - } - - #endif // AUTO_REPORT_TEMPERATURES - - #if HOTENDS && HAS_DISPLAY - void Temperature::set_heating_message(const uint8_t e) { - const bool heating = isHeatingHotend(e); - ui.status_printf_P(0, - #if HOTENDS > 1 - PSTR("E%c " S_FMT), '1' + e - #else - PSTR("E " S_FMT) - #endif - , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING) - ); - } - #endif - - #if HAS_TEMP_HOTEND - - #ifndef MIN_COOLING_SLOPE_DEG - #define MIN_COOLING_SLOPE_DEG 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME - #define MIN_COOLING_SLOPE_TIME 60 - #endif - - bool Temperature::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 - ) { - #if TEMP_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_CONDITIONS (wants_to_cool ? isCoolingHotend(target_extruder) : isHeatingHotend(target_extruder)) - #endif - - #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = degHotend(target_extruder); - printerEventLEDs.onHotendHeatingStart(); - #endif - - float target_temp = -1.0, old_temp = 9999.0; - bool wants_to_cool = false, first_loop = true; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - do { - // Target temperature might be changed during the loop - if (target_temp != degTargetHotend(target_extruder)) { - wants_to_cool = isCoolingHotend(target_extruder); - target_temp = degTargetHotend(target_extruder); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { // Print temp & remaining time every 1s while waiting - next_temp_ms = now + 1000UL; - print_heater_states(target_extruder); - #if TEMP_RESIDENCY_TIME > 0 - SERIAL_ECHOPGM(" W:"); - if (residency_start_ms) - SERIAL_ECHO(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_CHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - gcode.reset_stepper_timeout(); // Keep steppers powered - - const float temp = degHotend(target_extruder); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from violet to red as nozzle heats up - if (!wants_to_cool) printerEventLEDs.onHotendHeating(start_temp, temp, target_temp); - #endif - - #if TEMP_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_WINDOW) { - residency_start_ms = now; - if (first_loop) residency_start_ms += (TEMP_RESIDENCY_TIME) * 1000UL; - } - } - else if (temp_diff > TEMP_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif - - // Prevent a wait-forever situation if R is misused i.e. M109 R0 - if (wants_to_cool) { - // break after MIN_COOLING_SLOPE_TIME seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; - old_temp = temp; - } - } - - #if G26_CLICK_CAN_CANCEL - if (click_to_cancel && ui.use_click()) { - wait_for_heatup = false; - ui.quick_feedback(); - } - #endif - - first_loop = false; - - } while (wait_for_heatup && TEMP_CONDITIONS); - - if (wait_for_heatup) { - ui.reset_status(); - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onHeatingDone(); - #endif - } - - return wait_for_heatup; - } - - #endif // HAS_TEMP_HOTEND - - #if HAS_HEATED_BED - - #ifndef MIN_COOLING_SLOPE_DEG_BED - #define MIN_COOLING_SLOPE_DEG_BED 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME_BED - #define MIN_COOLING_SLOPE_TIME_BED 60 - #endif - - bool Temperature::wait_for_bed(const bool no_wait_for_cooling/*=true*/ - #if G26_CLICK_CAN_CANCEL - , const bool click_to_cancel/*=false*/ - #endif - ) { - #if TEMP_BED_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - bool first_loop = true; - // Loop until the temperature has stabilized - #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed()) - #endif - - float target_temp = -1, old_temp = 9999; - bool wants_to_cool = false; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = degBed(); - printerEventLEDs.onBedHeatingStart(); - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != degTargetBed()) { - wants_to_cool = isCoolingBed(); - target_temp = degTargetBed(); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. - next_temp_ms = now + 1000UL; - print_heater_states(active_extruder); - #if TEMP_BED_RESIDENCY_TIME > 0 - SERIAL_ECHOPGM(" W:"); - if (residency_start_ms) - SERIAL_ECHO(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_CHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - gcode.reset_stepper_timeout(); // Keep steppers powered - - const float temp = degBed(); - - #if ENABLED(PRINTER_EVENT_LEDS) - // Gradually change LED strip from blue to violet as bed heats up - if (!wants_to_cool) printerEventLEDs.onBedHeating(start_temp, temp, target_temp); - #endif - - #if TEMP_BED_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_BED_WINDOW) { - residency_start_ms = now; - if (first_loop) residency_start_ms += (TEMP_BED_RESIDENCY_TIME) * 1000UL; - } - } - else if (temp_diff > TEMP_BED_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif // TEMP_BED_RESIDENCY_TIME > 0 - - // Prevent a wait-forever situation if R is misused i.e. M190 R0 - if (wants_to_cool) { - // Break after MIN_COOLING_SLOPE_TIME_BED seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_BED)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED; - old_temp = temp; - } - } - - #if G26_CLICK_CAN_CANCEL - if (click_to_cancel && ui.use_click()) { - wait_for_heatup = false; - ui.quick_feedback(); - } - #endif - - #if TEMP_BED_RESIDENCY_TIME > 0 - first_loop = false; - #endif - - } while (wait_for_heatup && TEMP_BED_CONDITIONS); - - if (wait_for_heatup) ui.reset_status(); - - return wait_for_heatup; - } - - #endif // HAS_HEATED_BED - - #if HAS_HEATED_CHAMBER - - #ifndef MIN_COOLING_SLOPE_DEG_CHAMBER - #define MIN_COOLING_SLOPE_DEG_CHAMBER 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME_CHAMBER - #define MIN_COOLING_SLOPE_TIME_CHAMBER 60 - #endif - - bool Temperature::wait_for_chamber(const bool no_wait_for_cooling/*=true*/) { - #if TEMP_CHAMBER_RESIDENCY_TIME > 0 - millis_t residency_start_ms = 0; - // Loop until the temperature has stabilized - #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL)) - #else - // Loop until the temperature is very close target - #define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber()) - #endif - - float target_temp = -1, old_temp = 9999; - bool wants_to_cool = false, first_loop = true; - wait_for_heatup = true; - millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; - - #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) - KEEPALIVE_STATE(NOT_BUSY); - #endif - - do { - // Target temperature might be changed during the loop - if (target_temp != degTargetChamber()) { - wants_to_cool = isCoolingChamber(); - target_temp = degTargetChamber(); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - } - - now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. - next_temp_ms = now + 1000UL; - print_heater_states(active_extruder); - #if TEMP_CHAMBER_RESIDENCY_TIME > 0 - SERIAL_ECHOPGM(" W:"); - if (residency_start_ms) - SERIAL_ECHO(long((((TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); - else - SERIAL_CHAR('?'); - #endif - SERIAL_EOL(); - } - - idle(); - gcode.reset_stepper_timeout(); // Keep steppers powered - - const float temp = degChamber(); - - #if TEMP_CHAMBER_RESIDENCY_TIME > 0 - - const float temp_diff = ABS(target_temp - temp); - - if (!residency_start_ms) { - // Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_CHAMBER_WINDOW) { - residency_start_ms = now; - if (first_loop) residency_start_ms += (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL; - } - } - else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) { - // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = now; - } - - #endif // TEMP_CHAMBER_RESIDENCY_TIME > 0 - - // Prevent a wait-forever situation if R is misused i.e. M191 R0 - if (wants_to_cool) { - // Break after MIN_COOLING_SLOPE_TIME_CHAMBER seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG_CHAMBER)) break; - next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_CHAMBER; - old_temp = temp; - } - } - - first_loop = false; - - } while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS); - - if (wait_for_heatup) ui.reset_status(); - - return wait_for_heatup; - } - - #endif // HAS_HEATED_CHAMBER - -#endif // HAS_TEMP_SENSOR diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/temperature.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/temperature.h deleted file mode 100644 index 4eff4e4f62..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/temperature.h +++ /dev/null @@ -1,841 +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 - -/** - * temperature.h - temperature controller - */ - -#include "thermistor/thermistors.h" - -#include "../inc/MarlinConfig.h" - -#if ENABLED(AUTO_POWER_CONTROL) - #include "../feature/power.h" -#endif - -#ifndef SOFT_PWM_SCALE - #define SOFT_PWM_SCALE 0 -#endif - -#if HOTENDS <= 1 - #define HOTEND_INDEX 0 - #define E_NAME -#else - #define HOTEND_INDEX e - #define E_NAME e -#endif - -// Identifiers for other heaters -typedef enum : int8_t { - INDEX_NONE = -4, - H_REDUNDANT, H_CHAMBER, H_BED, - H_E0, H_E1, H_E2, H_E3, H_E4, H_E5 -} heater_ind_t; - -// PID storage -typedef struct { float Kp, Ki, Kd; } PID_t; -typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; -typedef struct { float Kp, Ki, Kd, Kf; } PIDF_t; -typedef struct { float Kp, Ki, Kd, Kc, Kf; } PIDCF_t; - -typedef - #if BOTH(PID_EXTRUSION_SCALING, PID_FAN_SCALING) - PIDCF_t - #elif ENABLED(PID_EXTRUSION_SCALING) - PIDC_t - #elif ENABLED(PID_FAN_SCALING) - PIDF_t - #else - PID_t - #endif -hotend_pid_t; - -#if ENABLED(PID_EXTRUSION_SCALING) - typedef IF<(LPQ_MAX_LEN > 255), uint16_t, uint8_t>::type lpq_ptr_t; -#endif - -#define DUMMY_PID_VALUE 3000.0f - -#if ENABLED(PIDTEMP) - #define _PID_Kp(H) Temperature::temp_hotend[H].pid.Kp - #define _PID_Ki(H) Temperature::temp_hotend[H].pid.Ki - #define _PID_Kd(H) Temperature::temp_hotend[H].pid.Kd - #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_Kc(H) Temperature::temp_hotend[H].pid.Kc - #else - #define _PID_Kc(H) 1 - #endif - - #if ENABLED(PID_FAN_SCALING) - #define _PID_Kf(H) Temperature::temp_hotend[H].pid.Kf - #else - #define _PID_Kf(H) 0 - #endif -#else - #define _PID_Kp(H) DUMMY_PID_VALUE - #define _PID_Ki(H) DUMMY_PID_VALUE - #define _PID_Kd(H) DUMMY_PID_VALUE - #define _PID_Kc(H) 1 -#endif - -#define PID_PARAM(F,H) _PID_##F(H) - -/** - * States for ADC reading in the ISR - */ -enum ADCSensorState : char { - StartSampling, - #if HAS_TEMP_ADC_0 - PrepareTemp_0, MeasureTemp_0, - #endif - #if HAS_HEATED_BED - PrepareTemp_BED, MeasureTemp_BED, - #endif - #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, MeasureTemp_CHAMBER, - #endif - #if HAS_TEMP_ADC_1 - PrepareTemp_1, MeasureTemp_1, - #endif - #if HAS_TEMP_ADC_2 - PrepareTemp_2, MeasureTemp_2, - #endif - #if HAS_TEMP_ADC_3 - PrepareTemp_3, MeasureTemp_3, - #endif - #if HAS_TEMP_ADC_4 - PrepareTemp_4, MeasureTemp_4, - #endif - #if HAS_TEMP_ADC_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, - #endif - #if HAS_ADC_BUTTONS - 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 -}; - -// Minimum number of Temperature::ISR loops between sensor readings. -// Multiplied by 16 (OVERSAMPLENR) to obtain the total time to -// get all oversampled sensor readings -#define MIN_ADC_ISR_LOOPS 10 - -#define ACTUAL_ADC_SAMPLES _MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) - -#if HAS_PID_HEATING - #define PID_K2 (1-float(PID_K1)) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / TEMP_TIMER_FREQUENCY) - - // Apply the scale factors to the PID values - #define scalePID_i(i) ( float(i) * PID_dT ) - #define unscalePID_i(i) ( float(i) / PID_dT ) - #define scalePID_d(d) ( float(d) / PID_dT ) - #define unscalePID_d(d) ( float(d) * PID_dT ) -#endif - -#define G26_CLICK_CAN_CANCEL (HAS_LCD_MENU && ENABLED(G26_MESH_VALIDATION)) - -// A temperature sensor -typedef struct TempInfo { - uint16_t acc; - int16_t raw; - 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 -typedef struct HeaterInfo : public TempInfo { - int16_t target; - uint8_t soft_pwm_amount; -} heater_info_t; - -// A heater with PID stabilization -template -struct PIDHeaterInfo : public HeaterInfo { - T pid; // Initialized by settings.load() -}; - -#if ENABLED(PIDTEMP) - typedef struct PIDHeaterInfo hotend_info_t; -#else - typedef heater_info_t hotend_info_t; -#endif -#if HAS_HEATED_BED - #if ENABLED(PIDTEMPBED) - typedef struct PIDHeaterInfo bed_info_t; - #else - typedef heater_info_t bed_info_t; - #endif -#endif -#if HAS_HEATED_CHAMBER - typedef heater_info_t chamber_info_t; -#elif HAS_TEMP_CHAMBER - typedef temp_info_t chamber_info_t; -#endif - -// Heater idle handling -typedef struct { - millis_t timeout_ms; - bool timed_out; - inline void update(const millis_t &ms) { if (!timed_out && timeout_ms && ELAPSED(ms, timeout_ms)) timed_out = true; } - inline void start(const millis_t &ms) { timeout_ms = millis() + ms; timed_out = false; } - inline void reset() { timeout_ms = 0; timed_out = false; } - inline void expire() { start(0); } -} heater_idle_t; - -// Heater watch handling -typedef struct { - uint16_t target; - millis_t next_ms; - inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); } - inline bool elapsed() { return elapsed(millis()); } -} heater_watch_t; - -// Temperature sensor read value ranges -typedef struct { int16_t raw_min, raw_max; } raw_range_t; -typedef struct { int16_t mintemp, maxtemp; } celsius_range_t; -typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t; - -#define THERMISTOR_ABS_ZERO_C -273.15f // bbbbrrrrr cold ! -#define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f // mmmmm comfortable - -#if HAS_USER_THERMISTORS - - enum CustomThermistorIndex : uint8_t { - #if ENABLED(HEATER_0_USER_THERMISTOR) - CTI_HOTEND_0, - #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) - CTI_HOTEND_1, - #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) - CTI_HOTEND_2, - #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) - CTI_HOTEND_3, - #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) - CTI_HOTEND_4, - #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) - CTI_HOTEND_5, - #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) - CTI_BED, - #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) - CTI_CHAMBER, - #endif - USER_THERMISTORS - }; - - // User-defined thermistor - typedef struct { - bool pre_calc; // true if pre-calculations update needed - float sh_c_coeff, // Steinhart-Hart C coefficient .. defaults to '0.0' - sh_alpha, - series_res, - res_25, res_25_recip, - res_25_log, - beta, beta_recip; - } user_thermistor_t; - -#endif - -class Temperature { - - public: - - #if HOTENDS - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #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; - #endif - - #if HAS_TEMP_CHAMBER - static chamber_info_t temp_chamber; - #endif - - #if ENABLED(AUTO_POWER_E_FANS) - static uint8_t autofan_speed[HOTENDS]; - #endif - - #if ENABLED(AUTO_POWER_CHAMBER_FAN) - static uint8_t chamberfan_speed; - #endif - - #if ENABLED(FAN_SOFT_PWM) - static uint8_t soft_pwm_amount_fan[FAN_COUNT], - soft_pwm_count_fan[FAN_COUNT]; - #endif - - #if ENABLED(PREVENT_COLD_EXTRUSION) - static bool allow_cold_extrude; - static int16_t extrude_min_temp; - FORCE_INLINE static bool tooCold(const int16_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp; } - FORCE_INLINE static bool tooColdToExtrude(const uint8_t E_NAME) { - return tooCold(degHotend(HOTEND_INDEX)); - } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t E_NAME) { - return tooCold(degTargetHotend(HOTEND_INDEX)); - } - #else - FORCE_INLINE static bool tooColdToExtrude(const uint8_t) { return false; } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t) { return false; } - #endif - - FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } - - #if HEATER_IDLE_HANDLER - static heater_idle_t hotend_idle[HOTENDS]; - #if HAS_HEATED_BED - static heater_idle_t bed_idle; - #endif - #if HAS_HEATED_CHAMBER - static heater_idle_t chamber_idle; - #endif - #endif - - private: - - #if EARLY_WATCHDOG - static bool inited; // If temperature controller is running - #endif - - static volatile bool temp_meas_ready; - - #if WATCH_HOTENDS - static heater_watch_t watch_hotend[HOTENDS]; - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static uint16_t redundant_temperature_raw; - static float redundant_temperature; - #endif - - #if ENABLED(PID_EXTRUSION_SCALING) - static int32_t last_e_position, lpq[LPQ_MAX_LEN]; - static lpq_ptr_t lpq_ptr; - #endif - - #if HOTENDS - static temp_range_t temp_range[HOTENDS]; - #endif - - #if HAS_HEATED_BED - #if WATCH_BED - static heater_watch_t watch_bed; - #endif - #if DISABLED(PIDTEMPBED) - static millis_t next_bed_check_ms; - #endif - #ifdef BED_MINTEMP - static int16_t mintemp_raw_BED; - #endif - #ifdef BED_MAXTEMP - static int16_t maxtemp_raw_BED; - #endif - #endif - - #if HAS_HEATED_CHAMBER - #if WATCH_CHAMBER - static heater_watch_t watch_chamber; - #endif - static millis_t next_chamber_check_ms; - #ifdef CHAMBER_MINTEMP - static int16_t mintemp_raw_CHAMBER; - #endif - #ifdef CHAMBER_MAXTEMP - static int16_t maxtemp_raw_CHAMBER; - #endif - #endif - - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - static uint8_t consecutive_low_temperature_error[HOTENDS]; - #endif - - #ifdef MILLISECONDS_PREHEAT_TIME - static millis_t preheat_end_time[HOTENDS]; - #endif - - #if HAS_AUTO_FAN - static millis_t next_auto_fan_check_ms; - #endif - - #if ENABLED(PROBING_HEATERS_OFF) - static bool paused; - #endif - - public: - #if HAS_ADC_BUTTONS - static uint32_t current_ADCKey_raw; - static uint8_t ADCKey_count; - #endif - - #if ENABLED(PID_EXTRUSION_SCALING) - static int16_t lpq_len; - #endif - - /** - * Instance Methods - */ - - void init(); - - /** - * Static (class) methods - */ - - #if HAS_USER_THERMISTORS - static user_thermistor_t user_thermistor[USER_THERMISTORS]; - static void log_user_thermistor(const uint8_t t_index, const bool eprom=false); - static void reset_user_thermistors(); - static float user_thermistor_to_deg_c(const uint8_t t_index, const int raw); - static bool set_pull_up_res(int8_t t_index, float value) { - //if (!WITHIN(t_index, 0, USER_THERMISTORS - 1)) return false; - if (!WITHIN(value, 1, 1000000)) return false; - user_thermistor[t_index].series_res = value; - return true; - } - static bool set_res25(int8_t t_index, float value) { - if (!WITHIN(value, 1, 10000000)) return false; - user_thermistor[t_index].res_25 = value; - user_thermistor[t_index].pre_calc = true; - return true; - } - static bool set_beta(int8_t t_index, float value) { - if (!WITHIN(value, 1, 1000000)) return false; - user_thermistor[t_index].beta = value; - user_thermistor[t_index].pre_calc = true; - return true; - } - static bool set_sh_coeff(int8_t t_index, float value) { - if (!WITHIN(value, -0.01f, 0.01f)) return false; - user_thermistor[t_index].sh_c_coeff = value; - user_thermistor[t_index].pre_calc = true; - return true; - } - #endif - - #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); - #endif - #if HAS_TEMP_CHAMBER - static float analog_to_celsius_chamber(const int raw); - #endif - - #if FAN_COUNT > 0 - - static uint8_t fan_speed[FAN_COUNT]; - #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT) - - static void set_fan_speed(const uint8_t target, const uint16_t speed); - - #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) - static bool fans_paused; - static uint8_t saved_fan_speed[FAN_COUNT]; - #endif - - static constexpr inline uint8_t fanPercent(const uint8_t speed) { return ui8_to_percent(speed); } - - #if ENABLED(ADAPTIVE_FAN_SLOWING) - static uint8_t fan_speed_scaler[FAN_COUNT]; - #endif - - static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) { - UNUSED(target); // Potentially unused! - return (fs * uint16_t( - #if ENABLED(ADAPTIVE_FAN_SLOWING) - fan_speed_scaler[target] - #else - 128 - #endif - )) >> 7; - } - - static inline uint8_t scaledFanSpeed(const uint8_t target) { - return scaledFanSpeed(target, fan_speed[target]); - } - - #if ENABLED(EXTRA_FAN_SPEED) - static uint8_t old_fan_speed[FAN_COUNT], new_fan_speed[FAN_COUNT]; - static void set_temp_fan_speed(const uint8_t fan, const uint16_t tmp_temp); - #endif - - #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) - void set_fans_paused(const bool p); - #endif - - #endif // FAN_COUNT > 0 - - static inline void zero_fan_speeds() { - #if FAN_COUNT > 0 - FANS_LOOP(i) set_fan_speed(i, 0); - #endif - } - - /** - * Called from the Temperature ISR - */ - static void readings_ready(); - static void tick(); - - /** - * Call periodically to manage heaters - */ - static void manage_heater() _O2; // Added _O2 to work around a compiler error - - /** - * Preheating hotends - */ - #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(const uint8_t E_NAME) { - return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); - } - static void start_preheat_time(const uint8_t E_NAME) { - preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; - } - static void reset_preheat_time(const uint8_t E_NAME) { - preheat_end_time[HOTEND_INDEX] = 0; - } - #else - #define is_preheating(n) (false) - #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_NAME) { - return (0 - #if HOTENDS - + temp_hotend[HOTEND_INDEX].celsius - #endif - ); - } - - #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawHotendTemp(const uint8_t E_NAME) { - return (0 - #if HOTENDS - + temp_hotend[HOTEND_INDEX].raw - #endif - ); - } - #endif - - FORCE_INLINE static int16_t degTargetHotend(const uint8_t E_NAME) { - return (0 - #if HOTENDS - + temp_hotend[HOTEND_INDEX].target - #endif - ); - } - - #if WATCH_HOTENDS - static void start_watching_hotend(const uint8_t e=0); - #else - static inline void start_watching_hotend(const uint8_t=0) {} - #endif - - #if HOTENDS - - static void setTargetHotend(const int16_t celsius, const uint8_t E_NAME) { - 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 - #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_NAME) { - return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].celsius; - } - - FORCE_INLINE static bool isCoolingHotend(const uint8_t E_NAME) { - 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.celsius; } - FORCE_INLINE static int16_t degTargetBed() { return temp_bed.target; } - 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(); - #else - static inline void start_watching_bed() {} - #endif - - static void setTargetBed(const int16_t celsius) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - temp_bed.target = - #ifdef BED_MAXTEMP - _MIN(celsius, BED_MAXTEMP - 10) - #else - celsius - #endif - ; - start_watching_bed(); - } - - static bool wait_for_bed(const bool no_wait_for_cooling=true - #if G26_CLICK_CAN_CANCEL - , const bool click_to_cancel=false - #endif - ); - - #endif // HAS_HEATED_BED - - #if HAS_TEMP_CHAMBER - #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.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.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 - - #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 - */ - static int16_t getHeaterPower(const heater_ind_t heater); - - /** - * Switch off all heaters, set all target temperatures to 0 - */ - static void disable_all_heaters(); - - /** - * Perform auto-tuning for hotend or bed in response to M303 - */ - #if HAS_PID_HEATING - static void PID_autotune(const float &target, const heater_ind_t hotend, const int8_t ncycles, const bool set_result=false); - - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - static bool adaptive_fan_slowing; - #elif ENABLED(ADAPTIVE_FAN_SLOWING) - static constexpr bool adaptive_fan_slowing = true; - #endif - - /** - * Update the temp manager when PID values change - */ - #if ENABLED(PIDTEMP) - FORCE_INLINE static void updatePID() { - #if ENABLED(PID_EXTRUSION_SCALING) - last_e_position = 0; - #endif - } - #endif - - #endif - - #if ENABLED(PROBING_HEATERS_OFF) - static void pause(const bool p); - FORCE_INLINE static bool is_paused() { return paused; } - #endif - - #if HEATER_IDLE_HANDLER - - static void reset_heater_idle_timer(const uint8_t E_NAME) { - hotend_idle[HOTEND_INDEX].reset(); - start_watching_hotend(HOTEND_INDEX); - } - - #if HAS_HEATED_BED - static void reset_bed_idle_timer() { - bed_idle.reset(); - start_watching_bed(); - } - #endif - - #endif // HEATER_IDLE_HANDLER - - #if HAS_TEMP_SENSOR - static void print_heater_states(const uint8_t target_extruder - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - , const bool include_r=false - #endif - ); - #if ENABLED(AUTO_REPORT_TEMPERATURES) - static uint8_t auto_report_temp_interval; - static millis_t next_temp_report_ms; - static void auto_report_temperatures(); - static inline void set_auto_report_interval(uint8_t v) { - NOMORE(v, 60); - auto_report_temp_interval = v; - next_temp_report_ms = millis() + 1000UL * v; - } - #endif - #endif - - #if HAS_DISPLAY - static void set_heating_message(const uint8_t e); - #endif - - private: - static void set_current_temp_raw(); - static void updateTemperaturesFromRawValues(); - - #define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) - #if HAS_MAX6675 - #if BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) - #define COUNT_6675 2 - #else - #define COUNT_6675 1 - #endif - #if COUNT_6675 > 1 - #define READ_MAX6675(N) read_max6675(N) - #else - #define READ_MAX6675(N) read_max6675() - #endif - static int read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex=0 - #endif - ); - #endif - - static void checkExtruderAutoFans(); - - static float get_pid_output_hotend(const uint8_t e); - - #if ENABLED(PIDTEMPBED) - static float get_pid_output_bed(); - #endif - - #if HAS_HEATED_CHAMBER - static float get_pid_output_chamber(); - #endif - - static void _temp_error(const heater_ind_t e, PGM_P const serial_msg, PGM_P const lcd_msg); - static void min_temp_error(const heater_ind_t e); - static void max_temp_error(const heater_ind_t e); - - #define HAS_THERMAL_PROTECTION (EITHER(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER) || HAS_THERMALLY_PROTECTED_BED) - - #if HAS_THERMAL_PROTECTION - - enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; - - typedef struct { - millis_t timer = 0; - TRState state = TRInactive; - } tr_state_machine_t; - - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - static tr_state_machine_t tr_state_machine[HOTENDS]; - #endif - #if HAS_THERMALLY_PROTECTED_BED - static tr_state_machine_t tr_state_machine_bed; - #endif - #if ENABLED(THERMAL_PROTECTION_CHAMBER) - static tr_state_machine_t tr_state_machine_chamber; - #endif - - static void thermal_runaway_protection(tr_state_machine_t &state, const float ¤t, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); - - #endif // HAS_THERMAL_PROTECTION -}; - -extern Temperature thermalManager; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1.h deleted file mode 100644 index f2eb078081..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1.h +++ /dev/null @@ -1,90 +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 - -// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor -const short temptable_1[][2] PROGMEM = { - { OV( 23), 300 }, - { OV( 25), 295 }, - { OV( 27), 290 }, - { OV( 28), 285 }, - { OV( 31), 280 }, - { OV( 33), 275 }, - { OV( 35), 270 }, - { OV( 38), 265 }, - { OV( 41), 260 }, - { OV( 44), 255 }, - { OV( 48), 250 }, - { OV( 52), 245 }, - { OV( 56), 240 }, - { OV( 61), 235 }, - { OV( 66), 230 }, - { OV( 71), 225 }, - { OV( 78), 220 }, - { OV( 84), 215 }, - { OV( 92), 210 }, - { OV( 100), 205 }, - { OV( 109), 200 }, - { OV( 120), 195 }, - { OV( 131), 190 }, - { OV( 143), 185 }, - { OV( 156), 180 }, - { OV( 171), 175 }, - { OV( 187), 170 }, - { OV( 205), 165 }, - { OV( 224), 160 }, - { OV( 245), 155 }, - { OV( 268), 150 }, - { OV( 293), 145 }, - { OV( 320), 140 }, - { OV( 348), 135 }, - { OV( 379), 130 }, - { OV( 411), 125 }, - { OV( 445), 120 }, - { OV( 480), 115 }, - { OV( 516), 110 }, - { OV( 553), 105 }, - { OV( 591), 100 }, - { OV( 628), 95 }, - { OV( 665), 90 }, - { OV( 702), 85 }, - { OV( 737), 80 }, - { OV( 770), 75 }, - { OV( 801), 70 }, - { OV( 830), 65 }, - { OV( 857), 60 }, - { OV( 881), 55 }, - { OV( 903), 50 }, - { OV( 922), 45 }, - { OV( 939), 40 }, - { OV( 954), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_10.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_10.h deleted file mode 100644 index 0ef9d9d635..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_10.h +++ /dev/null @@ -1,57 +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 - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, RS thermistor 198-961 -const short temptable_10[][2] PROGMEM = { - { OV( 1), 929 }, - { OV( 36), 299 }, - { OV( 71), 246 }, - { OV( 106), 217 }, - { OV( 141), 198 }, - { OV( 176), 184 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 154 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 91 }, - { OV( 701), 86 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1010.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1010.h deleted file mode 100644 index ab2b1fb443..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1010.h +++ /dev/null @@ -1,39 +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 - -// Pt1000 with 1k0 pullup -const short temptable_1010[][2] PROGMEM = { - PtLine( 0, 1000, 1000), - PtLine( 25, 1000, 1000), - PtLine( 50, 1000, 1000), - PtLine( 75, 1000, 1000), - PtLine(100, 1000, 1000), - PtLine(125, 1000, 1000), - PtLine(150, 1000, 1000), - PtLine(175, 1000, 1000), - PtLine(200, 1000, 1000), - PtLine(225, 1000, 1000), - PtLine(250, 1000, 1000), - PtLine(275, 1000, 1000), - PtLine(300, 1000, 1000) -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1047.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1047.h deleted file mode 100644 index 8010d8ebc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_1047.h +++ /dev/null @@ -1,34 +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 - -// Pt1000 with 4k7 pullup -const short temptable_1047[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 1000, 4700), - PtLine( 50, 1000, 4700), - PtLine(100, 1000, 4700), - PtLine(150, 1000, 4700), - PtLine(200, 1000, 4700), - PtLine(250, 1000, 4700), - PtLine(300, 1000, 4700) -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_11.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_11.h deleted file mode 100644 index f9a9524a15..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_11.h +++ /dev/null @@ -1,76 +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 - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, QU-BD silicone bed QWG-104F-3950 thermistor -const short temptable_11[][2] PROGMEM = { - { OV( 1), 938 }, - { OV( 31), 314 }, - { OV( 41), 290 }, - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 111), 215 }, - { OV( 121), 209 }, - { OV( 131), 204 }, - { OV( 141), 199 }, - { OV( 151), 195 }, - { OV( 161), 190 }, - { OV( 171), 187 }, - { OV( 181), 183 }, - { OV( 191), 179 }, - { OV( 201), 176 }, - { OV( 221), 170 }, - { OV( 241), 165 }, - { OV( 261), 160 }, - { OV( 281), 155 }, - { OV( 301), 150 }, - { OV( 331), 144 }, - { OV( 361), 139 }, - { OV( 391), 133 }, - { OV( 421), 128 }, - { OV( 451), 123 }, - { OV( 491), 117 }, - { OV( 531), 111 }, - { OV( 571), 105 }, - { OV( 611), 100 }, - { OV( 641), 95 }, - { OV( 681), 90 }, - { OV( 711), 85 }, - { OV( 751), 79 }, - { OV( 791), 72 }, - { OV( 811), 69 }, - { OV( 831), 65 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 901), 51 }, - { OV( 921), 45 }, - { OV( 941), 39 }, - { OV( 971), 28 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1021), -27 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_110.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_110.h deleted file mode 100644 index a55a193611..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_110.h +++ /dev/null @@ -1,34 +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 - -// Pt100 with 1k0 pullup -const short temptable_110[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 1000), - PtLine( 50, 100, 1000), - PtLine(100, 100, 1000), - PtLine(150, 100, 1000), - PtLine(200, 100, 1000), - PtLine(250, 100, 1000), - PtLine(300, 100, 1000) -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_12.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_12.h deleted file mode 100644 index 9210bf9131..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_12.h +++ /dev/null @@ -1,56 +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 - -// R25 = 100 kOhm, beta25 = 4700 K, 4.7 kOhm pull-up, (personal calibration for Makibox hot bed) -const short temptable_12[][2] PROGMEM = { - { OV( 35), 180 }, // top rating 180C - { OV( 211), 140 }, - { OV( 233), 135 }, - { OV( 261), 130 }, - { OV( 290), 125 }, - { OV( 328), 120 }, - { OV( 362), 115 }, - { OV( 406), 110 }, - { OV( 446), 105 }, - { OV( 496), 100 }, - { OV( 539), 95 }, - { OV( 585), 90 }, - { OV( 629), 85 }, - { OV( 675), 80 }, - { OV( 718), 75 }, - { OV( 758), 70 }, - { OV( 793), 65 }, - { OV( 822), 60 }, - { OV( 841), 55 }, - { OV( 875), 50 }, - { OV( 899), 45 }, - { OV( 926), 40 }, - { OV( 946), 35 }, - { OV( 962), 30 }, - { OV( 977), 25 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1010), 0 }, - { OV(1023), -40 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_13.h deleted file mode 100644 index 703ec74159..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_13.h +++ /dev/null @@ -1,49 +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 - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, Hisens thermistor -const short temptable_13[][2] PROGMEM = { - { OV( 20.04), 300 }, - { OV( 23.19), 290 }, - { OV( 26.71), 280 }, - { OV( 31.23), 270 }, - { OV( 36.52), 260 }, - { OV( 42.75), 250 }, - { OV( 50.68), 240 }, - { OV( 60.22), 230 }, - { OV( 72.03), 220 }, - { OV( 86.84), 210 }, - { OV(102.79), 200 }, - { OV(124.46), 190 }, - { OV(151.02), 180 }, - { OV(182.86), 170 }, - { OV(220.72), 160 }, - { OV(316.96), 140 }, - { OV(447.17), 120 }, - { OV(590.61), 100 }, - { OV(737.31), 80 }, - { OV(857.77), 60 }, - { OV(939.52), 40 }, - { OV(986.03), 20 }, - { OV(1008.7), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_147.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_147.h deleted file mode 100644 index b020103a38..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_147.h +++ /dev/null @@ -1,34 +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 - -// Pt100 with 4k7 pullup -const short temptable_147[][2] PROGMEM = { - // only a few values are needed as the curve is very flat - PtLine( 0, 100, 4700), - PtLine( 50, 100, 4700), - PtLine(100, 100, 4700), - PtLine(150, 100, 4700), - PtLine(200, 100, 4700), - PtLine(250, 100, 4700), - PtLine(300, 100, 4700) -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_15.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_15.h deleted file mode 100644 index aab32c05c0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_15.h +++ /dev/null @@ -1,65 +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 - - // 100k bed thermistor in JGAurora A5. Calibrated by Sam Pinches 21st Jan 2018 using cheap k-type thermocouple inserted into heater block, using TM-902C meter. -const short temptable_15[][2] PROGMEM = { - { OV( 31), 275 }, - { OV( 33), 270 }, - { OV( 35), 260 }, - { OV( 38), 253 }, - { OV( 41), 248 }, - { OV( 48), 239 }, - { OV( 56), 232 }, - { OV( 66), 222 }, - { OV( 78), 212 }, - { OV( 93), 206 }, - { OV( 106), 199 }, - { OV( 118), 191 }, - { OV( 130), 186 }, - { OV( 158), 176 }, - { OV( 187), 167 }, - { OV( 224), 158 }, - { OV( 270), 148 }, - { OV( 321), 137 }, - { OV( 379), 127 }, - { OV( 446), 117 }, - { OV( 518), 106 }, - { OV( 593), 96 }, - { OV( 668), 86 }, - { OV( 739), 76 }, - { OV( 767), 72 }, - { OV( 830), 62 }, - { OV( 902), 48 }, - { OV( 926), 45 }, - { OV( 955), 35 }, - { OV( 966), 30 }, - { OV( 977), 25 }, - { OV( 985), 20 }, - { OV( 993), 15 }, - { OV( 999), 10 }, - { OV(1004), 5 }, - { OV(1008), 0 }, - { OV(1012), -5 }, - { OV(1016), -10 }, - { OV(1020), -15 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_18.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_18.h deleted file mode 100644 index 46f1be452a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_18.h +++ /dev/null @@ -1,59 +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 - -// ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - version (measured/tested/approved) -const short temptable_18[][2] PROGMEM = { - { OV( 1), 713 }, - { OV( 17), 284 }, - { OV( 20), 275 }, - { OV( 23), 267 }, - { OV( 27), 257 }, - { OV( 31), 250 }, - { OV( 37), 240 }, - { OV( 43), 232 }, - { OV( 51), 222 }, - { OV( 61), 213 }, - { OV( 73), 204 }, - { OV( 87), 195 }, - { OV( 106), 185 }, - { OV( 128), 175 }, - { OV( 155), 166 }, - { OV( 189), 156 }, - { OV( 230), 146 }, - { OV( 278), 137 }, - { OV( 336), 127 }, - { OV( 402), 117 }, - { OV( 476), 107 }, - { OV( 554), 97 }, - { OV( 635), 87 }, - { OV( 713), 78 }, - { OV( 784), 68 }, - { OV( 846), 58 }, - { OV( 897), 49 }, - { OV( 937), 39 }, - { OV( 966), 30 }, - { OV( 986), 20 }, - { OV(1000), 10 }, - { OV(1010), 0 }, - { OV(1024),-273 } // for safety -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_2.h deleted file mode 100644 index 4a59e8d818..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_2.h +++ /dev/null @@ -1,62 +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 - -// -// R25 = 200 kOhm, beta25 = 4338 K, 4.7 kOhm pull-up, ATC Semitec 204GT-2 -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// -const short temptable_2[][2] PROGMEM = { - { OV( 1), 848 }, - { OV( 30), 300 }, // top rating 300C - { OV( 34), 290 }, - { OV( 39), 280 }, - { OV( 46), 270 }, - { OV( 53), 260 }, - { OV( 63), 250 }, - { OV( 74), 240 }, - { OV( 87), 230 }, - { OV( 104), 220 }, - { OV( 124), 210 }, - { OV( 148), 200 }, - { OV( 176), 190 }, - { OV( 211), 180 }, - { OV( 252), 170 }, - { OV( 301), 160 }, - { OV( 357), 150 }, - { OV( 420), 140 }, - { OV( 489), 130 }, - { OV( 562), 120 }, - { OV( 636), 110 }, - { OV( 708), 100 }, - { OV( 775), 90 }, - { OV( 835), 80 }, - { OV( 884), 70 }, - { OV( 924), 60 }, - { OV( 955), 50 }, - { OV( 977), 40 }, - { OV( 993), 30 }, - { OV(1004), 20 }, - { OV(1012), 10 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_20.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_20.h deleted file mode 100644 index 44c6a946c9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_20.h +++ /dev/null @@ -1,77 +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 - -#define REVERSE_TEMP_SENSOR_RANGE - -// Pt100 with INA826 amp on Ultimaker v2.0 electronics -const short temptable_20[][2] PROGMEM = { - { OV( 0), 0 }, - { OV(227), 1 }, - { OV(236), 10 }, - { OV(245), 20 }, - { OV(253), 30 }, - { OV(262), 40 }, - { OV(270), 50 }, - { OV(279), 60 }, - { OV(287), 70 }, - { OV(295), 80 }, - { OV(304), 90 }, - { OV(312), 100 }, - { OV(320), 110 }, - { OV(329), 120 }, - { OV(337), 130 }, - { OV(345), 140 }, - { OV(353), 150 }, - { OV(361), 160 }, - { OV(369), 170 }, - { OV(377), 180 }, - { OV(385), 190 }, - { OV(393), 200 }, - { OV(401), 210 }, - { OV(409), 220 }, - { OV(417), 230 }, - { OV(424), 240 }, - { OV(432), 250 }, - { OV(440), 260 }, - { OV(447), 270 }, - { OV(455), 280 }, - { OV(463), 290 }, - { OV(470), 300 }, - { OV(478), 310 }, - { OV(485), 320 }, - { OV(493), 330 }, - { OV(500), 340 }, - { OV(507), 350 }, - { OV(515), 360 }, - { OV(522), 370 }, - { OV(529), 380 }, - { OV(537), 390 }, - { OV(544), 400 }, - { OV(614), 500 }, - { OV(681), 600 }, - { OV(744), 700 }, - { OV(805), 800 }, - { OV(862), 900 }, - { OV(917), 1000 }, - { OV(968), 1100 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_201.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_201.h deleted file mode 100644 index 21f0e92a41..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_201.h +++ /dev/null @@ -1,57 +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 - -#define REVERSE_TEMP_SENSOR_RANGE - -// Pt100 with LMV324 amp on Overlord v1.1 electronics -const short temptable_201[][2] PROGMEM = { - { OV( 0), 0 }, - { OV( 8), 1 }, - { OV( 23), 6 }, - { OV( 41), 15 }, - { OV( 51), 20 }, - { OV( 68), 28 }, - { OV( 74), 30 }, - { OV( 88), 35 }, - { OV( 99), 40 }, - { OV( 123), 50 }, - { OV( 148), 60 }, - { OV( 173), 70 }, - { OV( 198), 80 }, - { OV( 221), 90 }, - { OV( 245), 100 }, - { OV( 269), 110 }, - { OV( 294), 120 }, - { OV( 316), 130 }, - { OV( 342), 140 }, - { OV( 364), 150 }, - { OV( 387), 160 }, - { OV( 412), 170 }, - { OV( 433), 180 }, - { OV( 456), 190 }, - { OV( 480), 200 }, - { OV( 500), 210 }, - { OV( 548), 224 }, - { OV( 572), 233 }, - { OV(1155), 490 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_3.h deleted file mode 100644 index bccfcb04c1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_3.h +++ /dev/null @@ -1,54 +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 - -// R25 = 100 kOhm, beta25 = 4120 K, 4.7 kOhm pull-up, mendel-parts -const short temptable_3[][2] PROGMEM = { - { OV( 1), 864 }, - { OV( 21), 300 }, - { OV( 25), 290 }, - { OV( 29), 280 }, - { OV( 33), 270 }, - { OV( 39), 260 }, - { OV( 46), 250 }, - { OV( 54), 240 }, - { OV( 64), 230 }, - { OV( 75), 220 }, - { OV( 90), 210 }, - { OV( 107), 200 }, - { OV( 128), 190 }, - { OV( 154), 180 }, - { OV( 184), 170 }, - { OV( 221), 160 }, - { OV( 265), 150 }, - { OV( 316), 140 }, - { OV( 375), 130 }, - { OV( 441), 120 }, - { OV( 513), 110 }, - { OV( 588), 100 }, - { OV( 734), 80 }, - { OV( 856), 60 }, - { OV( 938), 40 }, - { OV( 986), 20 }, - { OV(1008), 0 }, - { OV(1018), -20 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_331.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_331.h deleted file mode 100644 index 8f98d07523..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_331.h +++ /dev/null @@ -1,92 +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 - -#define OVM(V) OV((V)*(0.327/0.5)) - -// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor -const short temptable_331[][2] PROGMEM = { - { OVM( 23), 300 }, - { OVM( 25), 295 }, - { OVM( 27), 290 }, - { OVM( 28), 285 }, - { OVM( 31), 280 }, - { OVM( 33), 275 }, - { OVM( 35), 270 }, - { OVM( 38), 265 }, - { OVM( 41), 260 }, - { OVM( 44), 255 }, - { OVM( 48), 250 }, - { OVM( 52), 245 }, - { OVM( 56), 240 }, - { OVM( 61), 235 }, - { OVM( 66), 230 }, - { OVM( 71), 225 }, - { OVM( 78), 220 }, - { OVM( 84), 215 }, - { OVM( 92), 210 }, - { OVM( 100), 205 }, - { OVM( 109), 200 }, - { OVM( 120), 195 }, - { OVM( 131), 190 }, - { OVM( 143), 185 }, - { OVM( 156), 180 }, - { OVM( 171), 175 }, - { OVM( 187), 170 }, - { OVM( 205), 165 }, - { OVM( 224), 160 }, - { OVM( 245), 155 }, - { OVM( 268), 150 }, - { OVM( 293), 145 }, - { OVM( 320), 140 }, - { OVM( 348), 135 }, - { OVM( 379), 130 }, - { OVM( 411), 125 }, - { OVM( 445), 120 }, - { OVM( 480), 115 }, - { OVM( 516), 110 }, - { OVM( 553), 105 }, - { OVM( 591), 100 }, - { OVM( 628), 95 }, - { OVM( 665), 90 }, - { OVM( 702), 85 }, - { OVM( 737), 80 }, - { OVM( 770), 75 }, - { OVM( 801), 70 }, - { OVM( 830), 65 }, - { OVM( 857), 60 }, - { OVM( 881), 55 }, - { OVM( 903), 50 }, - { OVM( 922), 45 }, - { OVM( 939), 40 }, - { OVM( 954), 35 }, - { OVM( 966), 30 }, - { OVM( 977), 25 }, - { OVM( 985), 20 }, - { OVM( 993), 15 }, - { OVM( 999), 10 }, - { OVM(1004), 5 }, - { OVM(1008), 0 }, - { OVM(1012), -5 }, - { OVM(1016), -10 }, - { OVM(1020), -15 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_4.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_4.h deleted file mode 100644 index 46462ba566..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_4.h +++ /dev/null @@ -1,46 +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 - -// R25 = 10 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, Generic 10k thermistor -const short temptable_4[][2] PROGMEM = { - { OV( 1), 430 }, - { OV( 54), 137 }, - { OV( 107), 107 }, - { OV( 160), 91 }, - { OV( 213), 80 }, - { OV( 266), 71 }, - { OV( 319), 64 }, - { OV( 372), 57 }, - { OV( 425), 51 }, - { OV( 478), 46 }, - { OV( 531), 41 }, - { OV( 584), 35 }, - { OV( 637), 30 }, - { OV( 690), 25 }, - { OV( 743), 20 }, - { OV( 796), 14 }, - { OV( 849), 7 }, - { OV( 902), 0 }, - { OV( 955), -11 }, - { OV(1008), -35 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_5.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_5.h deleted file mode 100644 index 0d3905ac1c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_5.h +++ /dev/null @@ -1,62 +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 - -// R25 = 100 kOhm, beta25 = 4267 K, 4.7 kOhm pull-up -// 100k ParCan thermistor (104GT-2) -// ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance -const short temptable_5[][2] PROGMEM = { - { OV( 1), 713 }, - { OV( 17), 300 }, // top rating 300C - { OV( 20), 290 }, - { OV( 23), 280 }, - { OV( 27), 270 }, - { OV( 31), 260 }, - { OV( 37), 250 }, - { OV( 43), 240 }, - { OV( 51), 230 }, - { OV( 61), 220 }, - { OV( 73), 210 }, - { OV( 87), 200 }, - { OV( 106), 190 }, - { OV( 128), 180 }, - { OV( 155), 170 }, - { OV( 189), 160 }, - { OV( 230), 150 }, - { OV( 278), 140 }, - { OV( 336), 130 }, - { OV( 402), 120 }, - { OV( 476), 110 }, - { OV( 554), 100 }, - { OV( 635), 90 }, - { OV( 713), 80 }, - { OV( 784), 70 }, - { OV( 846), 60 }, - { OV( 897), 50 }, - { OV( 937), 40 }, - { OV( 966), 30 }, - { OV( 986), 20 }, - { OV(1000), 10 }, - { OV(1010), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_501.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_501.h deleted file mode 100644 index cb178321aa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_501.h +++ /dev/null @@ -1,58 +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 - -// 100k Zonestar thermistor. Adjusted By Hally -const short temptable_501[][2] PROGMEM = { - { OV( 1), 713 }, - { OV( 14), 300 }, // Top rating 300C - { OV( 16), 290 }, - { OV( 19), 280 }, - { OV( 23), 270 }, - { OV( 27), 260 }, - { OV( 31), 250 }, - { OV( 37), 240 }, - { OV( 47), 230 }, - { OV( 57), 220 }, - { OV( 68), 210 }, - { OV( 84), 200 }, - { OV( 100), 190 }, - { OV( 128), 180 }, - { OV( 155), 170 }, - { OV( 189), 160 }, - { OV( 230), 150 }, - { OV( 278), 140 }, - { OV( 336), 130 }, - { OV( 402), 120 }, - { OV( 476), 110 }, - { OV( 554), 100 }, - { OV( 635), 90 }, - { OV( 713), 80 }, - { OV( 784), 70 }, - { OV( 846), 60 }, - { OV( 897), 50 }, - { OV( 937), 40 }, - { OV( 966), 30 }, - { OV( 986), 20 }, - { OV(1000), 10 }, - { OV(1010), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_51.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_51.h deleted file mode 100644 index 93306d0f81..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_51.h +++ /dev/null @@ -1,83 +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 - -// R25 = 100 kOhm, beta25 = 4092 K, 1 kOhm pull-up, -// 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: Twice the resolution and better linearity from 150C to 200C -const short temptable_51[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 190), 250 }, // top rating 250C - { OV( 203), 245 }, - { OV( 217), 240 }, - { OV( 232), 235 }, - { OV( 248), 230 }, - { OV( 265), 225 }, - { OV( 283), 220 }, - { OV( 302), 215 }, - { OV( 322), 210 }, - { OV( 344), 205 }, - { OV( 366), 200 }, - { OV( 390), 195 }, - { OV( 415), 190 }, - { OV( 440), 185 }, - { OV( 467), 180 }, - { OV( 494), 175 }, - { OV( 522), 170 }, - { OV( 551), 165 }, - { OV( 580), 160 }, - { OV( 609), 155 }, - { OV( 638), 150 }, - { OV( 666), 145 }, - { OV( 695), 140 }, - { OV( 722), 135 }, - { OV( 749), 130 }, - { OV( 775), 125 }, - { OV( 800), 120 }, - { OV( 823), 115 }, - { OV( 845), 110 }, - { OV( 865), 105 }, - { OV( 884), 100 }, - { OV( 901), 95 }, - { OV( 917), 90 }, - { OV( 932), 85 }, - { OV( 944), 80 }, - { OV( 956), 75 }, - { OV( 966), 70 }, - { OV( 975), 65 }, - { OV( 982), 60 }, - { OV( 989), 55 }, - { OV( 995), 50 }, - { OV(1000), 45 }, - { OV(1004), 40 }, - { OV(1007), 35 }, - { OV(1010), 30 }, - { OV(1013), 25 }, - { OV(1015), 20 }, - { OV(1017), 15 }, - { OV(1018), 10 }, - { OV(1019), 5 }, - { OV(1020), 0 }, - { OV(1021), -5 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_512.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_512.h deleted file mode 100644 index aa9e9e57f9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_512.h +++ /dev/null @@ -1,87 +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 . - * - */ - -// 100k thermistor supplied with RPW-Ultra hotend, 4.7k pullup - -const short temptable_512[][2] PROGMEM = { - { OV(26), 300 }, - { OV(28), 295 }, - { OV(30), 290 }, - { OV(32), 285 }, - { OV(34), 280 }, - { OV(37), 275 }, - { OV(39), 270 }, - { OV(42), 265 }, - { OV(46), 260 }, - { OV(49), 255 }, - { OV(53), 250 }, // 256.5 - { OV(57), 245 }, - { OV(62), 240 }, - { OV(67), 235 }, - { OV(73), 230 }, - { OV(79), 225 }, - { OV(86), 220 }, - { OV(94), 215 }, - { OV(103), 210 }, - { OV(112), 205 }, - { OV(123), 200 }, - { OV(135), 195 }, - { OV(148), 190 }, - { OV(162), 185 }, - { OV(178), 180 }, - { OV(195), 175 }, - { OV(215), 170 }, - { OV(235), 165 }, - { OV(258), 160 }, - { OV(283), 155 }, - { OV(310), 150 }, // 2040.6 - { OV(338), 145 }, - { OV(369), 140 }, - { OV(401), 135 }, - { OV(435), 130 }, - { OV(470), 125 }, - { OV(505), 120 }, - { OV(542), 115 }, - { OV(579), 110 }, - { OV(615), 105 }, - { OV(651), 100 }, - { OV(686), 95 }, - { OV(720), 90 }, - { OV(751), 85 }, - { OV(781), 80 }, - { OV(809), 75 }, - { OV(835), 70 }, - { OV(858), 65 }, - { OV(880), 60 }, - { OV(899), 55 }, - { OV(915), 50 }, - { OV(930), 45 }, - { OV(944), 40 }, - { OV(955), 35 }, - { OV(965), 30 }, // 78279.3 - { OV(974), 25 }, - { OV(981), 20 }, - { OV(988), 15 }, - { OV(993), 10 }, - { OV(998), 5 }, - { OV(1002), 0 }, -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_52.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_52.h deleted file mode 100644 index 0e2b028e45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_52.h +++ /dev/null @@ -1,62 +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 - -// R25 = 200 kOhm, beta25 = 4338 K, 1 kOhm pull-up, -// 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_52[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 125), 300 }, // top rating 300C - { OV( 142), 290 }, - { OV( 162), 280 }, - { OV( 185), 270 }, - { OV( 211), 260 }, - { OV( 240), 250 }, - { OV( 274), 240 }, - { OV( 312), 230 }, - { OV( 355), 220 }, - { OV( 401), 210 }, - { OV( 452), 200 }, - { OV( 506), 190 }, - { OV( 563), 180 }, - { OV( 620), 170 }, - { OV( 677), 160 }, - { OV( 732), 150 }, - { OV( 783), 140 }, - { OV( 830), 130 }, - { OV( 871), 120 }, - { OV( 906), 110 }, - { OV( 935), 100 }, - { OV( 958), 90 }, - { OV( 976), 80 }, - { OV( 990), 70 }, - { OV(1000), 60 }, - { OV(1008), 50 }, - { OV(1013), 40 }, - { OV(1017), 30 }, - { OV(1019), 20 }, - { OV(1021), 10 }, - { OV(1022), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_55.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_55.h deleted file mode 100644 index b9a462eab3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_55.h +++ /dev/null @@ -1,62 +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 - -// R25 = 100 kOhm, beta25 = 4267 K, 1 kOhm pull-up, -// 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) -// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf -// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance -// Advantage: More resolution and better linearity from 150C to 200C -const short temptable_55[][2] PROGMEM = { - { OV( 1), 500 }, - { OV( 76), 300 }, - { OV( 87), 290 }, - { OV( 100), 280 }, - { OV( 114), 270 }, - { OV( 131), 260 }, - { OV( 152), 250 }, - { OV( 175), 240 }, - { OV( 202), 230 }, - { OV( 234), 220 }, - { OV( 271), 210 }, - { OV( 312), 200 }, - { OV( 359), 190 }, - { OV( 411), 180 }, - { OV( 467), 170 }, - { OV( 527), 160 }, - { OV( 590), 150 }, - { OV( 652), 140 }, - { OV( 713), 130 }, - { OV( 770), 120 }, - { OV( 822), 110 }, - { OV( 867), 100 }, - { OV( 905), 90 }, - { OV( 936), 80 }, - { OV( 961), 70 }, - { OV( 979), 60 }, - { OV( 993), 50 }, - { OV(1003), 40 }, - { OV(1010), 30 }, - { OV(1015), 20 }, - { OV(1018), 10 }, - { OV(1020), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_6.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_6.h deleted file mode 100644 index a3e6e69f85..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_6.h +++ /dev/null @@ -1,64 +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 - -// R25 = 100 kOhm, beta25 = 4092 K, 8.2 kOhm pull-up, 100k Epcos (?) thermistor -const short temptable_6[][2] PROGMEM = { - { OV( 1), 350 }, - { OV( 28), 250 }, // top rating 250C - { OV( 31), 245 }, - { OV( 35), 240 }, - { OV( 39), 235 }, - { OV( 42), 230 }, - { OV( 44), 225 }, - { OV( 49), 220 }, - { OV( 53), 215 }, - { OV( 62), 210 }, - { OV( 71), 205 }, // fitted graphically - { OV( 78), 200 }, // fitted graphically - { OV( 94), 190 }, - { OV( 102), 185 }, - { OV( 116), 170 }, - { OV( 143), 160 }, - { OV( 183), 150 }, - { OV( 223), 140 }, - { OV( 270), 130 }, - { OV( 318), 120 }, - { OV( 383), 110 }, - { OV( 413), 105 }, - { OV( 439), 100 }, - { OV( 484), 95 }, - { OV( 513), 90 }, - { OV( 607), 80 }, - { OV( 664), 70 }, - { OV( 781), 60 }, - { OV( 810), 55 }, - { OV( 849), 50 }, - { OV( 914), 45 }, - { OV( 914), 40 }, - { OV( 935), 35 }, - { OV( 954), 30 }, - { OV( 970), 25 }, - { OV( 978), 22 }, - { OV(1008), 3 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_60.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_60.h deleted file mode 100644 index 78939bfb44..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_60.h +++ /dev/null @@ -1,107 +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 - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, -// Maker's Tool Works Kapton Bed Thermistor -// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 -// r0: 100000 -// t0: 25 -// r1: 0 (parallel with rTherm) -// r2: 4700 (series with rTherm) -// beta: 3950 -// min adc: 1 at 0.0048828125 V -// max adc: 1023 at 4.9951171875 V -const short temptable_60[][2] PROGMEM = { - { OV( 51), 272 }, - { OV( 61), 258 }, - { OV( 71), 247 }, - { OV( 81), 237 }, - { OV( 91), 229 }, - { OV( 101), 221 }, - { OV( 131), 204 }, - { OV( 161), 190 }, - { OV( 191), 179 }, - { OV( 231), 167 }, - { OV( 271), 157 }, - { OV( 311), 148 }, - { OV( 351), 140 }, - { OV( 381), 135 }, - { OV( 411), 130 }, - { OV( 441), 125 }, - { OV( 451), 123 }, - { OV( 461), 122 }, - { OV( 471), 120 }, - { OV( 481), 119 }, - { OV( 491), 117 }, - { OV( 501), 116 }, - { OV( 511), 114 }, - { OV( 521), 113 }, - { OV( 531), 111 }, - { OV( 541), 110 }, - { OV( 551), 108 }, - { OV( 561), 107 }, - { OV( 571), 105 }, - { OV( 581), 104 }, - { OV( 591), 102 }, - { OV( 601), 101 }, - { OV( 611), 100 }, - { OV( 621), 98 }, - { OV( 631), 97 }, - { OV( 641), 95 }, - { OV( 651), 94 }, - { OV( 661), 92 }, - { OV( 671), 91 }, - { OV( 681), 90 }, - { OV( 691), 88 }, - { OV( 701), 87 }, - { OV( 711), 85 }, - { OV( 721), 84 }, - { OV( 731), 82 }, - { OV( 741), 81 }, - { OV( 751), 79 }, - { OV( 761), 77 }, - { OV( 771), 76 }, - { OV( 781), 74 }, - { OV( 791), 72 }, - { OV( 801), 71 }, - { OV( 811), 69 }, - { OV( 821), 67 }, - { OV( 831), 65 }, - { OV( 841), 63 }, - { OV( 851), 62 }, - { OV( 861), 60 }, - { OV( 871), 57 }, - { OV( 881), 55 }, - { OV( 891), 53 }, - { OV( 901), 51 }, - { OV( 911), 48 }, - { OV( 921), 45 }, - { OV( 931), 42 }, - { OV( 941), 39 }, - { OV( 951), 36 }, - { OV( 961), 32 }, - { OV( 981), 23 }, - { OV( 991), 17 }, - { OV(1001), 9 }, - { OV(1008), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_61.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_61.h deleted file mode 100644 index 3619947117..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_61.h +++ /dev/null @@ -1,116 +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 - -// R25 = 100 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, -// Formbot / Vivedino high temp 100k thermistor -// 100KR13950181203 -// Generated with modified version of https://www.thingiverse.com/thing:103668 -// Using table 1 with datasheet values -// Resistance 100k Ohms at 25deg. C -// Resistance Tolerance + / -1% -// B Value 3950K at 25/50 deg. C -// B Value Tolerance + / - 1% -const short temptable_61[][2] PROGMEM = { - { OV( 2.00), 420 }, // Guestimate to ensure we dont lose a reading and drop temps to -50 when over - { OV( 12.07), 350 }, - { OV( 12.79), 345 }, - { OV( 13.59), 340 }, - { OV( 14.44), 335 }, - { OV( 15.37), 330 }, - { OV( 16.38), 325 }, - { OV( 17.46), 320 }, - { OV( 18.63), 315 }, - { OV( 19.91), 310 }, - { OV( 21.29), 305 }, - { OV( 22.79), 300 }, - { OV( 24.43), 295 }, - { OV( 26.21), 290 }, - { OV( 28.15), 285 }, - { OV( 30.27), 280 }, - { OV( 32.58), 275 }, - { OV( 35.10), 270 }, - { OV( 38.44), 265 }, - { OV( 40.89), 260 }, - { OV( 44.19), 255 }, - { OV( 47.83), 250 }, - { OV( 51.80), 245 }, - { OV( 56.20), 240 }, - { OV( 61.00), 235 }, - { OV( 66.30), 230 }, - { OV( 72.11), 225 }, - { OV( 78.51), 220 }, - { OV( 85.57), 215 }, - { OV( 93.34), 210 }, - { OV( 101.91), 205 }, - { OV( 111.34), 200 }, - { OV( 121.73), 195 }, - { OV( 133.17), 190 }, - { OV( 145.74), 185 }, - { OV( 159.57), 180 }, - { OV( 174.73), 175 }, - { OV( 191.35), 170 }, - { OV( 209.53), 165 }, - { OV( 229.35), 160 }, - { OV( 250.90), 155 }, - { OV( 274.25), 150 }, - { OV( 299.46), 145 }, - { OV( 326.52), 140 }, - { OV( 355.44), 135 }, - { OV( 386.15), 130 }, - { OV( 418.53), 125 }, - { OV( 452.43), 120 }, - { OV( 487.62), 115 }, - { OV( 523.82), 110 }, - { OV( 560.70), 105 }, - { OV( 597.88), 100 }, - { OV( 634.97), 95 }, - { OV( 671.55), 90 }, - { OV( 707.21), 85 }, - { OV( 741.54), 80 }, - { OV( 779.65), 75 }, - { OV( 809.57), 70 }, - { OV( 833.40), 65 }, - { OV( 859.55), 60 }, - { OV( 883.27), 55 }, - { OV( 904.53), 50 }, - { OV( 923.38), 45 }, - { OV( 939.91), 40 }, - { OV( 954.26), 35 }, - { OV( 966.59), 30 }, - { OV( 977.08), 25 }, - { OV( 985.92), 20 }, - { OV( 993.39), 15 }, - { OV( 999.42), 10 }, - { OV(1004.43), 5 }, - { OV(1008.51), 0 }, - { OV(1011.79), -5 }, - { OV(1014.40), -10 }, - { OV(1016.48), -15 }, - { OV(1018.10), -20 }, - { OV(1019.35), -25 }, - { OV(1020.32), -30 }, - { OV(1021.05), -35 }, - { OV(1021.60), -40 }, - { OV(1022.01), -45 }, - { OV(1022.31), -50 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_66.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_66.h deleted file mode 100644 index c8669c49fc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_66.h +++ /dev/null @@ -1,53 +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 - -// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor -const short temptable_66[][2] PROGMEM = { - { OV( 17.5), 850 }, - { OV( 17.9), 500 }, - { OV( 21.7), 480 }, - { OV( 26.6), 460 }, - { OV( 33.1), 440 }, - { OV( 41.0), 420 }, - { OV( 52.3), 400 }, - { OV( 67.7), 380 }, - { OV( 86.5), 360 }, - { OV( 112.0), 340 }, - { OV( 147.2), 320 }, - { OV( 194.0), 300 }, - { OV( 254.3), 280 }, - { OV( 330.2), 260 }, - { OV( 427.9), 240 }, - { OV( 533.4), 220 }, - { OV( 646.5), 200 }, - { OV( 754.4), 180 }, - { OV( 844.3), 160 }, - { OV( 911.7), 140 }, - { OV( 958.6), 120 }, - { OV( 988.8), 100 }, - { OV(1006.6), 80 }, - { OV(1015.8), 60 }, - { OV(1021.3), 30 }, - { OV( 1022), 25 }, - { OV( 1023), 20 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_666.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_666.h deleted file mode 100644 index 3b8c68b88d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_666.h +++ /dev/null @@ -1,99 +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 - -/** - * This file was generated by tltgen on Thu Jul 5 15:46:43 2018. - * tltgen was created by Pieter Agten (pieter.agten@gmail.com). - */ -//#include "output_table.h" - -/* - * Parameters: - * A: -0.000480634 - * B: 0.00031362 - * C: -2.03978e-07 - */ -#define NUMTEMPS 61 -const short temptable_666[NUMTEMPS][2] PROGMEM = { - { OV( 1), 794 }, - { OV( 18), 288 }, - { OV( 35), 234 }, - { OV( 52), 207 }, - { OV( 69), 189 }, - { OV( 86), 176 }, - { OV(103), 166 }, - { OV(120), 157 }, - { OV(137) ,150 }, - { OV(154), 144 }, - { OV(172), 138 }, - { OV(189), 134 }, - { OV(206), 129 }, - { OV(223), 125 }, - { OV(240), 121 }, - { OV(257), 118 }, - { OV(274), 115 }, - { OV(291), 112 }, - { OV(308), 109 }, - { OV(325), 106 }, - { OV(342), 103 }, - { OV(359), 101 }, - { OV(376), 99 }, - { OV(393), 96 }, - { OV(410), 94 }, - { OV(427), 92 }, - { OV(444), 90 }, - { OV(461), 88 }, - { OV(478), 86 }, - { OV(495), 84 }, - { OV(512), 82 }, - { OV(530), 80 }, - { OV(547), 78 }, - { OV(564), 76 }, - { OV(581), 74 }, - { OV(598), 72 }, - { OV(615), 70 }, - { OV(632), 68 }, - { OV(649), 67 }, - { OV(666), 65 }, - { OV(683), 63 }, - { OV(700), 61 }, - { OV(717), 59 }, - { OV(734), 57 }, - { OV(751), 55 }, - { OV(768), 53 }, - { OV(785), 51 }, - { OV(802), 49 }, - { OV(819), 47 }, - { OV(836), 44 }, - { OV(853), 42 }, - { OV(871), 39 }, - { OV(888), 37 }, - { OV(905), 34 }, - { OV(922), 30 }, - { OV(939), 27 }, - { OV(956), 23 }, - { OV(973), 18 }, - { OV(990), 11 }, - { OV(1007), 2 }, - { OV(1023),-25 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_67.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_67.h deleted file mode 100644 index 9e86811123..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_67.h +++ /dev/null @@ -1,81 +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 - -// R25 = 500 KOhm, beta25 = 3800 K, 4.7 kOhm pull-up, SliceEngineering 450 °C Thermistor -const short temptable_67[][2] PROGMEM = { - { OV( 22 ), 500 }, - { OV( 23 ), 490 }, - { OV( 25 ), 480 }, - { OV( 27 ), 470 }, - { OV( 29 ), 460 }, - { OV( 32 ), 450 }, - { OV( 35 ), 440 }, - { OV( 38 ), 430 }, - { OV( 41 ), 420 }, - { OV( 45 ), 410 }, - { OV( 50 ), 400 }, - { OV( 55 ), 390 }, - { OV( 60 ), 380 }, - { OV( 67 ), 370 }, - { OV( 74 ), 360 }, - { OV( 82 ), 350 }, - { OV( 91 ), 340 }, - { OV( 102 ), 330 }, - { OV( 114 ), 320 }, - { OV( 127 ), 310 }, - { OV( 143 ), 300 }, - { OV( 161 ), 290 }, - { OV( 181 ), 280 }, - { OV( 204 ), 270 }, - { OV( 229 ), 260 }, - { OV( 259 ), 250 }, - { OV( 290 ), 240 }, - { OV( 325 ), 230 }, - { OV( 364 ), 220 }, - { OV( 407 ), 210 }, - { OV( 453 ), 200 }, - { OV( 501 ), 190 }, - { OV( 551 ), 180 }, - { OV( 603 ), 170 }, - { OV( 655 ), 160 }, - { OV( 706 ), 150 }, - { OV( 755 ), 140 }, - { OV( 801 ), 130 }, - { OV( 842 ), 120 }, - { OV( 879 ), 110 }, - { OV( 910 ), 100 }, - { OV( 936 ), 90 }, - { OV( 948 ), 85 }, - { OV( 958 ), 80 }, - { OV( 975 ), 70 }, - { OV( 988 ), 60 }, - { OV( 998 ), 50 }, - { OV(1006 ), 40 }, - { OV(1011 ), 30 }, - { OV(1013 ), 25 }, - { OV(1015 ), 20 }, - { OV(1018 ), 10 }, - { OV(1020 ), 0 }, - { OV(1021 ), -10 }, - { OV(1022 ), -20 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_7.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_7.h deleted file mode 100644 index 609317d492..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_7.h +++ /dev/null @@ -1,84 +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 - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAG-J01 -const short temptable_7[][2] PROGMEM = { - { OV( 1), 941 }, - { OV( 19), 362 }, - { OV( 37), 299 }, // top rating 300C - { OV( 55), 266 }, - { OV( 73), 245 }, - { OV( 91), 229 }, - { OV( 109), 216 }, - { OV( 127), 206 }, - { OV( 145), 197 }, - { OV( 163), 190 }, - { OV( 181), 183 }, - { OV( 199), 177 }, - { OV( 217), 171 }, - { OV( 235), 166 }, - { OV( 253), 162 }, - { OV( 271), 157 }, - { OV( 289), 153 }, - { OV( 307), 149 }, - { OV( 325), 146 }, - { OV( 343), 142 }, - { OV( 361), 139 }, - { OV( 379), 135 }, - { OV( 397), 132 }, - { OV( 415), 129 }, - { OV( 433), 126 }, - { OV( 451), 123 }, - { OV( 469), 121 }, - { OV( 487), 118 }, - { OV( 505), 115 }, - { OV( 523), 112 }, - { OV( 541), 110 }, - { OV( 559), 107 }, - { OV( 577), 105 }, - { OV( 595), 102 }, - { OV( 613), 99 }, - { OV( 631), 97 }, - { OV( 649), 94 }, - { OV( 667), 92 }, - { OV( 685), 89 }, - { OV( 703), 86 }, - { OV( 721), 84 }, - { OV( 739), 81 }, - { OV( 757), 78 }, - { OV( 775), 75 }, - { OV( 793), 72 }, - { OV( 811), 69 }, - { OV( 829), 66 }, - { OV( 847), 62 }, - { OV( 865), 59 }, - { OV( 883), 55 }, - { OV( 901), 51 }, - { OV( 919), 46 }, - { OV( 937), 41 }, - { OV( 955), 35 }, - { OV( 973), 27 }, - { OV( 991), 17 }, - { OV(1009), 1 }, - { OV(1023), 0 } // to allow internal 0 degrees C -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_70.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_70.h deleted file mode 100644 index f05f066bea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_70.h +++ /dev/null @@ -1,46 +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 - -// Stock BQ Hephestos 2 100k thermistor. -// Created on 29/12/2017 with an ambient temperature of 20C. -// ANENG AN8009 DMM with a K-type probe used for measurements. - -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, bqh2 stock thermistor -const short temptable_70[][2] PROGMEM = { - { OV( 18), 270 }, - { OV( 27), 248 }, - { OV( 34), 234 }, - { OV( 45), 220 }, - { OV( 61), 205 }, - { OV( 86), 188 }, - { OV( 123), 172 }, - { OV( 420), 110 }, - { OV( 590), 90 }, - { OV( 845), 56 }, - { OV( 970), 25 }, - { OV( 986), 20 }, - { OV( 994), 15 }, - { OV(1000), 10 }, - { OV(1005), 5 }, - { OV(1009), 0 } // safety -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_71.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_71.h deleted file mode 100644 index 0198f326ed..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_71.h +++ /dev/null @@ -1,94 +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 - -// R25 = 100 kOhm, beta25 = 3974 K, 4.7 kOhm pull-up, Honeywell 135-104LAF-J01 -// R0 = 100000 Ohm -// T0 = 25 °C -// Beta = 3974 -// R1 = 0 Ohm -// R2 = 4700 Ohm -const short temptable_71[][2] PROGMEM = { - { OV( 35), 300 }, - { OV( 51), 269 }, - { OV( 59), 258 }, - { OV( 64), 252 }, - { OV( 71), 244 }, - { OV( 81), 235 }, - { OV( 87), 230 }, - { OV( 92), 226 }, - { OV( 102), 219 }, - { OV( 110), 214 }, - { OV( 115), 211 }, - { OV( 126), 205 }, - { OV( 128), 204 }, - { OV( 130), 203 }, - { OV( 132), 202 }, - { OV( 134), 201 }, - { OV( 136), 200 }, - { OV( 147), 195 }, - { OV( 154), 192 }, - { OV( 159), 190 }, - { OV( 164), 188 }, - { OV( 172), 185 }, - { OV( 175), 184 }, - { OV( 178), 183 }, - { OV( 181), 182 }, - { OV( 184), 181 }, - { OV( 187), 180 }, - { OV( 190), 179 }, - { OV( 193), 178 }, - { OV( 196), 177 }, - { OV( 199), 176 }, - { OV( 202), 175 }, - { OV( 205), 174 }, - { OV( 208), 173 }, - { OV( 215), 171 }, - { OV( 237), 165 }, - { OV( 256), 160 }, - { OV( 300), 150 }, - { OV( 351), 140 }, - { OV( 470), 120 }, - { OV( 504), 115 }, - { OV( 538), 110 }, - { OV( 745), 80 }, - { OV( 770), 76 }, - { OV( 806), 70 }, - { OV( 829), 66 }, - { OV( 860), 60 }, - { OV( 879), 56 }, - { OV( 888), 54 }, - { OV( 905), 50 }, - { OV( 924), 45 }, - { OV( 940), 40 }, - { OV( 955), 35 }, - { OV( 972), 28 }, - { OV( 974), 27 }, - { OV( 976), 26 }, - { OV( 978), 25 }, - { OV( 980), 24 }, - { OV( 987), 20 }, - { OV( 995), 15 }, - { OV(1001), 10 }, - { OV(1006), 5 }, - { OV(1010), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_75.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_75.h deleted file mode 100644 index fcc4c60375..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_75.h +++ /dev/null @@ -1,80 +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 - -/** - * R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, - * Generic Silicon Heat Pad with NTC 100K thermistor - * - * Many generic silicone heat pads use the MGB18-104F39050L32 thermistor, applicable to various - * wattages and voltages. This table is correct if this part is used. It's been optimized - * to provide good granularity in the 60-110C range, good for PLA and ABS. For higher temperature - * filament (e.g., nylon) uncomment HIGH_TEMP_RANGE_75 for increased accuracy. If higher - * temperatures aren't used it can improve performance slightly to leave it commented out. - */ - -//#define HIGH_TEMP_RANGE_75 - -const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor - { OV(111.06), 200 }, // v=0.542 r=571.747 res=0.501 degC/count - - #ifdef HIGH_TEMP_RANGE_75 - { OV(174.87), 175 }, // v=0.854 r=967.950 res=0.311 degC/count These values are valid. But they serve no - { OV(191.64), 170 }, // v=0.936 r=1082.139 res=0.284 degC/count purpose. It is better to delete them so - { OV(209.99), 165 }, // v=1.025 r=1212.472 res=0.260 degC/count the search is quicker and get to the meaningful - { OV(230.02), 160 }, // v=1.123 r=1361.590 res=0.239 degC/count part of the table sooner. - { OV(251.80), 155 }, // v=1.230 r=1532.621 res=0.220 degC/count - #endif - - { OV(275.43), 150 }, // v=1.345 r=1729.283 res=0.203 degC/count - - #ifdef HIGH_TEMP_RANGE_75 - { 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(1008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_8.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_8.h deleted file mode 100644 index 8cb9f3aaaa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_8.h +++ /dev/null @@ -1,46 +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 - -// R25 = 100 kOhm, beta25 = 3950 K, 10 kOhm pull-up, NTCS0603E3104FHT -const short temptable_8[][2] PROGMEM = { - { OV( 1), 704 }, - { OV( 54), 216 }, - { OV( 107), 175 }, - { OV( 160), 152 }, - { OV( 213), 137 }, - { OV( 266), 125 }, - { OV( 319), 115 }, - { OV( 372), 106 }, - { OV( 425), 99 }, - { OV( 478), 91 }, - { OV( 531), 85 }, - { OV( 584), 78 }, - { OV( 637), 71 }, - { OV( 690), 65 }, - { OV( 743), 58 }, - { OV( 796), 50 }, - { OV( 849), 42 }, - { OV( 902), 31 }, - { OV( 955), 17 }, - { OV(1008), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_9.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_9.h deleted file mode 100644 index 44274106b0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_9.h +++ /dev/null @@ -1,57 +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 - -// R25 = 100 kOhm, beta25 = 3960 K, 4.7 kOhm pull-up, GE Sensing AL03006-58.2K-97-G1 -const short temptable_9[][2] PROGMEM = { - { OV( 1), 936 }, - { OV( 36), 300 }, - { OV( 71), 246 }, - { OV( 106), 218 }, - { OV( 141), 199 }, - { OV( 176), 185 }, - { OV( 211), 173 }, - { OV( 246), 163 }, - { OV( 281), 155 }, - { OV( 316), 147 }, - { OV( 351), 140 }, - { OV( 386), 134 }, - { OV( 421), 128 }, - { OV( 456), 122 }, - { OV( 491), 117 }, - { OV( 526), 112 }, - { OV( 561), 107 }, - { OV( 596), 102 }, - { OV( 631), 97 }, - { OV( 666), 92 }, - { OV( 701), 87 }, - { OV( 736), 81 }, - { OV( 771), 76 }, - { OV( 806), 70 }, - { OV( 841), 63 }, - { OV( 876), 56 }, - { OV( 911), 48 }, - { OV( 946), 38 }, - { OV( 981), 23 }, - { OV(1005), 5 }, - { OV(1016), 0 } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_99.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_99.h deleted file mode 100644 index b6183e54e4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_99.h +++ /dev/null @@ -1,64 +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 - -// 100k bed thermistor with a 10K pull-up resistor - made by $ buildroot/share/scripts/createTemperatureLookupMarlin.py --rp=10000 - -const short temptable_99[][2] PROGMEM = { - { OV( 5.81), 350 }, // v=0.028 r= 57.081 res=13.433 degC/count - { OV( 6.54), 340 }, // v=0.032 r= 64.248 res=11.711 degC/count - { OV( 7.38), 330 }, // v=0.036 r= 72.588 res=10.161 degC/count - { OV( 8.36), 320 }, // v=0.041 r= 82.336 res= 8.772 degC/count - { OV( 9.51), 310 }, // v=0.046 r= 93.780 res= 7.535 degC/count - { OV( 10.87), 300 }, // v=0.053 r= 107.281 res= 6.439 degC/count - { OV( 12.47), 290 }, // v=0.061 r= 123.286 res= 5.473 degC/count - { OV( 14.37), 280 }, // v=0.070 r= 142.360 res= 4.627 degC/count - { OV( 16.64), 270 }, // v=0.081 r= 165.215 res= 3.891 degC/count - { OV( 19.37), 260 }, // v=0.095 r= 192.758 res= 3.253 degC/count - { OV( 22.65), 250 }, // v=0.111 r= 226.150 res= 2.705 degC/count - { OV( 26.62), 240 }, // v=0.130 r= 266.891 res= 2.236 degC/count - { OV( 31.46), 230 }, // v=0.154 r= 316.931 res= 1.839 degC/count - { OV( 37.38), 220 }, // v=0.182 r= 378.822 res= 1.504 degC/count - { OV( 44.65), 210 }, // v=0.218 r= 455.939 res= 1.224 degC/count - { OV( 53.64), 200 }, // v=0.262 r= 552.778 res= 0.991 degC/count - { OV( 64.78), 190 }, // v=0.316 r= 675.386 res= 0.799 degC/count - { OV( 78.65), 180 }, // v=0.384 r= 831.973 res= 0.643 degC/count - { OV( 95.94), 170 }, // v=0.468 r= 1033.801 res= 0.516 degC/count - { OV(117.52), 160 }, // v=0.574 r= 1296.481 res= 0.414 degC/count - { OV(144.42), 150 }, // v=0.705 r= 1641.900 res= 0.333 degC/count - { OV(177.80), 140 }, // v=0.868 r= 2101.110 res= 0.269 degC/count - { OV(218.89), 130 }, // v=1.069 r= 2718.725 res= 0.220 degC/count - { OV(268.82), 120 }, // v=1.313 r= 3559.702 res= 0.183 degC/count - { OV(328.35), 110 }, // v=1.603 r= 4719.968 res= 0.155 degC/count - { OV(397.44), 100 }, // v=1.941 r= 6343.323 res= 0.136 degC/count - { OV(474.90), 90 }, // v=2.319 r= 8648.807 res= 0.124 degC/count - { OV(558.03), 80 }, // v=2.725 r= 11975.779 res= 0.118 degC/count - { OV(642.76), 70 }, // v=3.138 r= 16859.622 res= 0.119 degC/count - { OV(724.25), 60 }, // v=3.536 r= 24161.472 res= 0.128 degC/count - { OV(797.93), 50 }, // v=3.896 r= 35295.361 res= 0.146 degC/count - { OV(860.51), 40 }, // v=4.202 r= 52635.209 res= 0.178 degC/count - { OV(910.55), 30 }, // v=4.446 r= 80262.251 res= 0.229 degC/count - { OV(948.36), 20 }, // v=4.631 r=125374.433 res= 0.313 degC/count - { OV(975.47), 10 }, // v=4.763 r=201020.458 res= 0.449 degC/count - { OV(994.02), 0 } // v=4.854 r=331567.870 res= 0.676 degC/count -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_998.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_998.h deleted file mode 100644 index 74d0e6e38c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_998.h +++ /dev/null @@ -1,33 +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 - -// User-defined table 1 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_998_VALUE - #define DUMMY_THERMISTOR_998_VALUE 25 -#endif - -const short temptable_998[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_998_VALUE }, - { OV(1023), DUMMY_THERMISTOR_998_VALUE } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_999.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_999.h deleted file mode 100644 index 9d5818bc76..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistor_999.h +++ /dev/null @@ -1,33 +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 - -// User-defined table 2 -// Dummy Thermistor table.. It will ALWAYS read a fixed value. -#ifndef DUMMY_THERMISTOR_999_VALUE - #define DUMMY_THERMISTOR_999_VALUE 25 -#endif - -const short temptable_999[][2] PROGMEM = { - { OV( 1), DUMMY_THERMISTOR_999_VALUE }, - { OV(1023), DUMMY_THERMISTOR_999_VALUE } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistors.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistors.h deleted file mode 100644 index 8dac7e2aee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/thermistor/thermistors.h +++ /dev/null @@ -1,338 +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 - -#include "../../inc/MarlinConfig.h" - -#define THERMISTOR_TABLE_ADC_RESOLUTION 1024 -#define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / (THERMISTOR_TABLE_ADC_RESOLUTION)) -#if ENABLED(HAL_ADC_FILTERED) - #define OVERSAMPLENR 1 -#else - #define OVERSAMPLENR 16 -#endif -#define MAX_RAW_THERMISTOR_VALUE (HAL_ADC_RANGE * (OVERSAMPLENR) - 1) - -// Currently Marlin stores all oversampled ADC values as int16_t, make sure the HAL settings do not overflow 15bit -#if MAX_RAW_THERMISTOR_VALUE > ((1 << 15) - 1) - #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION." -#endif - -#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) - -#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTORBED == n || THERMISTORCHAMBER == n) - -// Pt1000 and Pt100 handling -// -// Rt=R0*(1+a*T+b*T*T) [for T>0] -// a=3.9083E-3, b=-5.775E-7 -#define PtA 3.9083E-3 -#define PtB -5.775E-7 -#define PtRt(T,R0) ((R0) * (1.0 + (PtA) * (T) + (PtB) * (T) * (T))) -#define PtAdVal(T,R0,Rup) (short)(1024 / (Rup / PtRt(T, R0) + 1)) -#define PtLine(T,R0,Rup) { OV(PtAdVal(T, R0, Rup)), T } - -#if ANY_THERMISTOR_IS(1) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "EPCOS" - #include "thermistor_1.h" -#endif -#if ANY_THERMISTOR_IS(2) // 4338 K, R25 = 200 kOhm, Pull-up = 4.7 kOhm, "ATC Semitec 204GT-2" - #include "thermistor_2.h" -#endif -#if ANY_THERMISTOR_IS(3) // beta25 = 4120 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Mendel-parts" - #include "thermistor_3.h" -#endif -#if ANY_THERMISTOR_IS(4) // beta25 = 3950 K, R25 = 10 kOhm, Pull-up = 4.7 kOhm, "Generic" - #include "thermistor_4.h" -#endif -#if ANY_THERMISTOR_IS(5) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "ParCan, ATC 104GT-2" - #include "thermistor_5.h" -#endif -#if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor - #include "thermistor_501.h" -#endif -#if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" - #include "thermistor_512.h" -#endif -#if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 8.2 kOhm, "EPCOS ?" - #include "thermistor_6.h" -#endif -#if ANY_THERMISTOR_IS(7) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAG-J01" - #include "thermistor_7.h" -#endif -#if ANY_THERMISTOR_IS(71) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAF-J01" - #include "thermistor_71.h" -#endif -#if ANY_THERMISTOR_IS(8) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 10 kOhm, "Vishay E3104FHT" - #include "thermistor_8.h" -#endif -#if ANY_THERMISTOR_IS(9) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "GE Sensing AL03006-58.2K-97-G1" - #include "thermistor_9.h" -#endif -#if ANY_THERMISTOR_IS(10) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "RS 198-961" - #include "thermistor_10.h" -#endif -#if ANY_THERMISTOR_IS(11) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "QU-BD silicone bed, QWG-104F-3950" - #include "thermistor_11.h" -#endif -#if ANY_THERMISTOR_IS(13) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hisens" - #include "thermistor_13.h" -#endif -#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration - #include "thermistor_15.h" -#endif -#if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - #include "thermistor_18.h" -#endif -#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics - #include "thermistor_20.h" -#endif -#if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS" - #include "thermistor_51.h" -#endif -#if ANY_THERMISTOR_IS(52) // beta25 = 4338 K, R25 = 200 kOhm, Pull-up = 1 kOhm, "ATC Semitec 204GT-2" - #include "thermistor_52.h" -#endif -#if ANY_THERMISTOR_IS(55) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "ATC Semitec 104GT-2 (Used on ParCan)" - #include "thermistor_55.h" -#endif -#if ANY_THERMISTOR_IS(60) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Maker's Tool Works Kapton Bed" - #include "thermistor_60.h" -#endif -#if ANY_THERMISTOR_IS(61) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Formbot 350°C Thermistor" - #include "thermistor_61.h" -#endif -#if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5 MOhm, Pull-up = 4.7 kOhm, "DyzeDesign 500 °C Thermistor" - #include "thermistor_66.h" -#endif -#if ANY_THERMISTOR_IS(67) // R25 = 500 KOhm, beta25 = 3800 K, 4.7 kOhm pull-up, SliceEngineering 450 °C Thermistor - #include "thermistor_67.h" -#endif -#if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Personal calibration for Makibox hot bed" - #include "thermistor_12.h" -#endif -#if ANY_THERMISTOR_IS(70) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hephestos 2, bqh2 stock thermistor" - #include "thermistor_70.h" -#endif -#if ANY_THERMISTOR_IS(75) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "MGB18-104F39050L32 thermistor" - #include "thermistor_75.h" -#endif -#if ANY_THERMISTOR_IS(99) // 100k bed thermistor with a 10K pull-up resistor (on some Wanhao i3 models) - #include "thermistor_99.h" -#endif -#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup - #include "thermistor_110.h" -#endif -#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup - #include "thermistor_147.h" -#endif -#if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord - #include "thermistor_201.h" -#endif -#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage - #include "thermistor_331.h" -#endif -#if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)" - #include "thermistor_666.h" -#endif -#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup - #include "thermistor_1010.h" -#endif -#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup - #include "thermistor_1047.h" -#endif -#if ANY_THERMISTOR_IS(998) // User-defined table 1 - #include "thermistor_998.h" -#endif -#if ANY_THERMISTOR_IS(999) // User-defined table 2 - #include "thermistor_999.h" -#endif -#if ANY_THERMISTOR_IS(1000) // Custom - const short temptable_1000[][2] PROGMEM = { { 0, 0 } }; -#endif - -#define _TT_NAME(_N) temptable_ ## _N -#define TT_NAME(_N) _TT_NAME(_N) - -#if THERMISTOR_HEATER_0 - #define HEATER_0_TEMPTABLE TT_NAME(THERMISTOR_HEATER_0) - #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) -#elif defined(HEATER_0_USES_THERMISTOR) - #error "No heater 0 thermistor table specified" -#else - #define HEATER_0_TEMPTABLE nullptr - #define HEATER_0_TEMPTABLE_LEN 0 -#endif - -#if THERMISTOR_HEATER_1 - #define HEATER_1_TEMPTABLE TT_NAME(THERMISTOR_HEATER_1) - #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) -#elif defined(HEATER_1_USES_THERMISTOR) - #error "No heater 1 thermistor table specified" -#else - #define HEATER_1_TEMPTABLE nullptr - #define HEATER_1_TEMPTABLE_LEN 0 -#endif - -#if THERMISTOR_HEATER_2 - #define HEATER_2_TEMPTABLE TT_NAME(THERMISTOR_HEATER_2) - #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) -#elif defined(HEATER_2_USES_THERMISTOR) - #error "No heater 2 thermistor table specified" -#else - #define HEATER_2_TEMPTABLE nullptr - #define HEATER_2_TEMPTABLE_LEN 0 -#endif - -#if THERMISTOR_HEATER_3 - #define HEATER_3_TEMPTABLE TT_NAME(THERMISTOR_HEATER_3) - #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) -#elif defined(HEATER_3_USES_THERMISTOR) - #error "No heater 3 thermistor table specified" -#else - #define HEATER_3_TEMPTABLE nullptr - #define HEATER_3_TEMPTABLE_LEN 0 -#endif - -#if THERMISTOR_HEATER_4 - #define HEATER_4_TEMPTABLE TT_NAME(THERMISTOR_HEATER_4) - #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) -#elif defined(HEATER_4_USES_THERMISTOR) - #error "No heater 4 thermistor table specified" -#else - #define HEATER_4_TEMPTABLE nullptr - #define HEATER_4_TEMPTABLE_LEN 0 -#endif - -#if THERMISTOR_HEATER_5 - #define HEATER_5_TEMPTABLE TT_NAME(THERMISTOR_HEATER_5) - #define HEATER_5_TEMPTABLE_LEN COUNT(HEATER_5_TEMPTABLE) -#elif defined(HEATER_5_USES_THERMISTOR) - #error "No heater 5 thermistor table specified" -#else - #define HEATER_5_TEMPTABLE nullptr - #define HEATER_5_TEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORBED - #define BED_TEMPTABLE TT_NAME(THERMISTORBED) - #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) - #error "No bed thermistor table specified" -#else - #define BED_TEMPTABLE_LEN 0 -#endif - -#ifdef THERMISTORCHAMBER - #define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER) - #define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) - #error "No chamber thermistor table specified" -#else - #define CHAMBER_TEMPTABLE_LEN 0 -#endif - -// The SCAN_THERMISTOR_TABLE macro needs alteration? -static_assert( - HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 - && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 - && HEATER_4_TEMPTABLE_LEN < 256 && HEATER_5_TEMPTABLE_LEN < 256 - && BED_TEMPTABLE_LEN < 256 && CHAMBER_TEMPTABLE_LEN < 256, - "Temperature conversion tables over 255 entries need special consideration." -); - -// Set the high and low raw values for the heaters -// For thermistors the highest temperature results in the lowest ADC value -// For thermocouples the highest temperature results in the highest ADC value -#ifndef HEATER_0_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_0_USES_THERMISTOR) - #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_0_RAW_LO_TEMP 0 - #else - #define HEATER_0_RAW_HI_TEMP 0 - #define HEATER_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_1_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_1_USES_THERMISTOR) - #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_1_RAW_LO_TEMP 0 - #else - #define HEATER_1_RAW_HI_TEMP 0 - #define HEATER_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_2_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_2_USES_THERMISTOR) - #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_2_RAW_LO_TEMP 0 - #else - #define HEATER_2_RAW_HI_TEMP 0 - #define HEATER_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_3_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_3_USES_THERMISTOR) - #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_3_RAW_LO_TEMP 0 - #else - #define HEATER_3_RAW_HI_TEMP 0 - #define HEATER_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_4_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_4_USES_THERMISTOR) - #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_4_RAW_LO_TEMP 0 - #else - #define HEATER_4_RAW_HI_TEMP 0 - #define HEATER_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_5_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_5_USES_THERMISTOR) - #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_5_RAW_LO_TEMP 0 - #else - #define HEATER_5_RAW_HI_TEMP 0 - #define HEATER_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_BED_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR) - #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_BED_RAW_LO_TEMP 0 - #else - #define HEATER_BED_RAW_HI_TEMP 0 - #define HEATER_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif -#ifndef HEATER_CHAMBER_RAW_HI_TEMP - #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_CHAMBER_USES_THERMISTOR) - #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE - #define HEATER_CHAMBER_RAW_LO_TEMP 0 - #else - #define HEATER_CHAMBER_RAW_HI_TEMP 0 - #define HEATER_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE - #endif -#endif - -#undef REVERSE_TEMP_SENSOR_RANGE diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.cpp deleted file mode 100644 index b392e751d5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.cpp +++ /dev/null @@ -1,1065 +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 . - * - */ - -#include "../inc/MarlinConfigPre.h" - -#include "tool_change.h" - -#include "probe.h" -#include "motion.h" -#include "planner.h" -#include "temperature.h" - -#include "../Marlin.h" - -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../core/debug_out.h" - -#if EXTRUDERS > 1 - toolchange_settings_t toolchange_settings; // Initialized by settings.load() -#endif - -#if ENABLED(SINGLENOZZLE) - uint16_t singlenozzle_temp[EXTRUDERS]; - #if FAN_COUNT > 0 - uint8_t singlenozzle_fan_speed[EXTRUDERS]; - #endif -#endif - -#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) - #include "../gcode/gcode.h" // for dwell() -#endif - -#if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD) - #include "servo.h" -#endif - -#if ENABLED(EXT_SOLENOID) && DISABLED(PARKING_EXTRUDER) - #include "../feature/solenoid.h" -#endif - -#if ENABLED(MK2_MULTIPLEXER) - #include "../feature/snmm.h" -#endif - -#if ENABLED(MIXING_EXTRUDER) - #include "../feature/mixing.h" -#endif - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if HAS_FANMUX - #include "../feature/fanmux.h" -#endif - -#if ENABLED(PRUSA_MMU2) - #include "../feature/prusa_MMU2/mmu2.h" -#endif - -#if HAS_LCD_MENU - #include "../lcd/ultralcd.h" -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" -#endif - -#if DO_SWITCH_EXTRUDER - - #if EXTRUDERS > 3 - #define _SERVO_NR(E) ((E) < 2 ? SWITCHING_EXTRUDER_SERVO_NR : SWITCHING_EXTRUDER_E23_SERVO_NR) - #else - #define _SERVO_NR(E) SWITCHING_EXTRUDER_SERVO_NR - #endif - - void move_extruder_servo(const uint8_t e) { - planner.synchronize(); - #if EXTRUDERS & 1 - if (e < EXTRUDERS - 1) - #endif - { - MOVE_SERVO(_SERVO_NR(e), servo_angles[_SERVO_NR(e)][e]); - safe_delay(500); - } - } - -#endif // DO_SWITCH_EXTRUDER - -#if ENABLED(SWITCHING_NOZZLE) - - #if SWITCHING_NOZZLE_TWO_SERVOS - - inline void _move_nozzle_servo(const uint8_t e, const uint8_t angle_index) { - constexpr int8_t sns_index[2] = { SWITCHING_NOZZLE_SERVO_NR, SWITCHING_NOZZLE_E1_SERVO_NR }; - constexpr int16_t sns_angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; - planner.synchronize(); - MOVE_SERVO(sns_index[e], sns_angles[angle_index]); - safe_delay(500); - } - - void lower_nozzle(const uint8_t e) { _move_nozzle_servo(e, 0); } - void raise_nozzle(const uint8_t e) { _move_nozzle_servo(e, 1); } - - #else - - void move_nozzle_servo(const uint8_t angle_index) { - planner.synchronize(); - MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]); - safe_delay(500); - } - - #endif - -#endif // SWITCHING_NOZZLE - -inline void _line_to_current(const AxisEnum fr_axis, const float fscale=1) { - line_to_current_position(planner.settings.max_feedrate_mm_s[fr_axis] * fscale); -} -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) - - float parkingposx[2], // M951 R L - parkinggrabdistance, // M951 I - parkingslowspeed, // M951 J - parkinghighspeed, // M951 H - parkingtraveldistance, // M951 D - compensationmultiplier; - - inline void magnetic_parking_extruder_tool_change(const uint8_t new_tool) { - - const float oldx = current_position.x, - grabpos = mpe_settings.parking_xpos[new_tool] + (new_tool ? mpe_settings.grab_distance : -mpe_settings.grab_distance), - offsetcompensation = (0 - #if HAS_HOTEND_OFFSET - + hotend_offset[active_extruder].x * mpe_settings.compensation_factor - #endif - ); - - 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 - * - * Steps: - * 1. Move high speed to park position of new extruder - * 2. Move to couple position of new extruder (this also discouple the old extruder) - * 3. Move to park position of new extruder - * 4. Move high speed to approach park position of old extruder - * 5. Move to park position of old extruder - * 6. Move to starting position - */ - - // STEP 1 - - current_position.x = mpe_settings.parking_xpos[new_tool] + offsetcompensation; - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(1) Move extruder ", int(new_tool)); - DEBUG_POS(" to new extruder ParkPos", current_position); - } - - planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); - planner.synchronize(); - - // STEP 2 - - current_position.x = grabpos + offsetcompensation; - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(2) Couple extruder ", int(new_tool)); - DEBUG_POS(" to new extruder GrabPos", current_position); - } - - planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); - planner.synchronize(); - - // Delay before moving tool, to allow magnetic coupling - gcode.dwell(150); - - // STEP 3 - - current_position.x = mpe_settings.parking_xpos[new_tool] + offsetcompensation; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(3) Move extruder ", int(new_tool)); - DEBUG_POS(" back to new extruder ParkPos", current_position); - } - - planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); - planner.synchronize(); - - // STEP 4 - - current_position.x = mpe_settings.parking_xpos[active_extruder] + (active_extruder == 0 ? MPE_TRAVEL_DISTANCE : -MPE_TRAVEL_DISTANCE) + offsetcompensation; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(4) Move extruder ", int(new_tool)); - DEBUG_POS(" close to old extruder ParkPos", current_position); - } - - planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); - planner.synchronize(); - - // STEP 5 - - current_position.x = mpe_settings.parking_xpos[active_extruder] + offsetcompensation; - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(5) Park extruder ", int(new_tool)); - DEBUG_POS(" at old extruder ParkPos", current_position); - } - - planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); - planner.synchronize(); - - // STEP 6 - - current_position.x = oldx; - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(6) Move extruder ", int(new_tool)); - DEBUG_POS(" to starting position", current_position); - } - - planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); - planner.synchronize(); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Autopark done."); - } - -#elif ENABLED(PARKING_EXTRUDER) - - void pe_solenoid_init() { - for (uint8_t n = 0; n <= 1; ++n) - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_solenoid(n); - #else - pe_deactivate_solenoid(n); - #endif - } - - void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state) { - switch (extruder_num) { - case 1: OUT_WRITE(SOL1_PIN, state); break; - default: OUT_WRITE(SOL0_PIN, state); break; - } - #if PARKING_EXTRUDER_SOLENOIDS_DELAY > 0 - gcode.dwell(PARKING_EXTRUDER_SOLENOIDS_DELAY); - #endif - } - - inline void parking_extruder_tool_change(const uint8_t new_tool, bool no_move) { - if (!no_move) { - - constexpr float parkingposx[] = PARKING_EXTRUDER_PARKING_X; - - #if HAS_HOTEND_OFFSET - const float x_offset = hotend_offset[active_extruder].x; - #else - constexpr float x_offset = 0; - #endif - - const float midpos = (parkingposx[0] + parkingposx[1]) * 0.5f + x_offset, - grabpos = parkingposx[new_tool] + (new_tool ? PARKING_EXTRUDER_GRAB_DISTANCE : -(PARKING_EXTRUDER_GRAB_DISTANCE)) + x_offset; - - /** - * 1. Move to park position of old extruder - * 2. Disengage magnetic field, wait for delay - * 3. Move near new extruder - * 4. Engage magnetic field for new extruder - * 5. Move to parking incl. offset of new extruder - * 6. Lower Z-Axis - */ - - // STEP 1 - - if (DEBUGGING(LEVELING)) DEBUG_POS("Start PE Tool-Change", current_position); - - current_position.x = parkingposx[active_extruder] + x_offset; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR("(1) Park extruder ", int(active_extruder)); - DEBUG_POS("Moving ParkPos", current_position); - } - fast_line_to_current(X_AXIS); - - // STEP 2 - - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(2) Disengage magnet"); - pe_deactivate_solenoid(active_extruder); - - // STEP 3 - - current_position.x += active_extruder ? -10 : 10; // move 10mm away from parked extruder - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("(3) Move near new extruder"); - DEBUG_POS("Move away from parked extruder", current_position); - } - fast_line_to_current(X_AXIS); - - // STEP 4 - - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Engage magnetic field"); - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_solenoid(active_extruder); // Just save power for inverted magnets - #endif - pe_activate_solenoid(new_tool); - - // STEP 5 - - current_position.x = grabpos + (new_tool ? -10 : 10); - fast_line_to_current(X_AXIS); - - current_position.x = grabpos; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("(5) Unpark extruder", current_position); - } - slow_line_to_current(X_AXIS); - - // STEP 6 - - current_position.x = midpos - #if HAS_HOTEND_OFFSET - - hotend_offset[new_tool].x - #endif - ; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("(6) Move midway between hotends", current_position); - } - fast_line_to_current(X_AXIS); - planner.synchronize(); // Always sync the final move - - if (DEBUGGING(LEVELING)) DEBUG_POS("PE Tool-Change done.", current_position); - } - else { // nomove == true - // Only engage magnetic field for new extruder - pe_activate_solenoid(new_tool); - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_solenoid(active_extruder); // Just save power for inverted magnets - #endif - } - } - -#endif // PARKING_EXTRUDER - -#if ENABLED(SWITCHING_TOOLHEAD) - - inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) { - if (no_move) return; - - constexpr uint16_t angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES; - - constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS; - const float placexpos = toolheadposx[active_extruder], - grabxpos = toolheadposx[new_tool]; - - /** - * 1. Move to switch position of current toolhead - * 2. Unlock tool and drop it in the dock - * 3. Move to the new toolhead - * 4. Grab and lock the new toolhead - */ - - // 1. Move to switch position of current toolhead - - if (DEBUGGING(LEVELING)) DEBUG_POS("Start ST Tool-Change", current_position); - - current_position.x = placexpos; - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); - DEBUG_POS("Move X SwitchPos", current_position); - } - fast_line_to_current(X_AXIS); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS - (SWITCHING_TOOLHEAD_Y_SECURITY); - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move Y SwitchPos + Security", current_position); - } - fast_line_to_current(Y_AXIS); - - // 2. Unlock tool and drop it in the dock - - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(2) Unlock and Place Toolhead"); - MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, angles[1]); - safe_delay(500); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); - slow_line_to_current(Y_AXIS); - - // Wait for move to complete, then another 0.2s - planner.synchronize(); - safe_delay(200); - - current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - fast_line_to_current(Y_AXIS); // move away from docked toolhead - - // 3. Move to the new toolhead - - current_position.x = grabxpos; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(3) Move to new toolhead position"); - DEBUG_POS("Move to new toolhead X", current_position); - } - fast_line_to_current(X_AXIS); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS - (SWITCHING_TOOLHEAD_Y_SECURITY); - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move Y SwitchPos + Security", current_position); - } - fast_line_to_current(Y_AXIS); - - // 4. Grab and lock the new toolhead - - current_position.y = SWITCHING_TOOLHEAD_Y_POS; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(4) Grab and lock new toolhead"); - DEBUG_POS("Move Y SwitchPos", current_position); - } - slow_line_to_current(Y_AXIS); - - // Wait for move to finish, pause 0.2s, move servo, pause 0.5s - planner.synchronize(); - safe_delay(200); - MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, angles[0]); - safe_delay(500); - - current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - fast_line_to_current(Y_AXIS); // Move away from docked toolhead - planner.synchronize(); // Always sync the final move - - if (DEBUGGING(LEVELING)) DEBUG_POS("ST Tool-Change done.", current_position); - } - -#elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - - inline void magnetic_switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) { - if (no_move) return; - - constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS, - toolheadclearx[] = SWITCHING_TOOLHEAD_X_SECURITY; - - const float placexpos = toolheadposx[active_extruder], - placexclear = toolheadclearx[active_extruder], - grabxpos = toolheadposx[new_tool], - grabxclear = toolheadclearx[new_tool]; - - /** - * 1. Move to switch position of current toolhead - * 2. Release and place toolhead in the dock - * 3. Move to the new toolhead - * 4. Grab the new toolhead and move to security position - */ - - if (DEBUGGING(LEVELING)) DEBUG_POS("Start MST Tool-Change", current_position); - - // 1. Move to switch position current toolhead - - current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); - DEBUG_POS("Move Y SwitchPos + Security", current_position); - } - fast_line_to_current(Y_AXIS); - - current_position.x = placexclear; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move X SwitchPos + Security", current_position); - } - fast_line_to_current(X_AXIS); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move Y SwitchPos", current_position); - } - fast_line_to_current(Y_AXIS); - - current_position.x = placexpos; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move X SwitchPos", current_position); - } - line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS] * 0.25f); - - // 2. Release and place toolhead in the dock - - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(2) Release and Place Toolhead"); - } - - current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Release", current_position); - line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.1f); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_SECURITY; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move Y SwitchPos + Security", current_position); - } - line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS]); - - // 3. Move to new toolhead position - - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(3) Move to new toolhead position"); - } - - current_position.x = grabxpos; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X", current_position); - fast_line_to_current(X_AXIS); - - // 4. Grab the new toolhead and move to security position - - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(4) Grab new toolhead, move to security position"); - } - - current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Release", current_position); - line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS]); - - current_position.y = SWITCHING_TOOLHEAD_Y_POS; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("Move Y SwitchPos", current_position); - } - _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 - current_position.e += SWITCHING_TOOLHEAD_PRIME_MM; - planner.buffer_line(current_position, MMM_TO_MMS(SWITCHING_TOOLHEAD_PRIME_FEEDRATE), new_tool); - #endif - #if SWITCHING_TOOLHEAD_RETRACT_MM - current_position.e -= SWITCHING_TOOLHEAD_RETRACT_MM; - planner.buffer_line(current_position, MMM_TO_MMS(SWITCHING_TOOLHEAD_RETRACT_FEEDRATE), new_tool); - #endif - #else - planner.synchronize(); - safe_delay(100); // Give switch time to settle - #endif - - current_position.x = grabxclear; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X + Security", current_position); - _line_to_current(X_AXIS, 0.1f); - planner.synchronize(); - safe_delay(100); // Give switch time to settle - - current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - 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); - } - -#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - - inline void est_activate_solenoid() { OUT_WRITE(SOL0_PIN, HIGH); } - inline void est_deactivate_solenoid() { OUT_WRITE(SOL0_PIN, LOW); } - void est_init() { est_activate_solenoid(); } - - inline void em_switching_toolhead_tool_change(const uint8_t new_tool, bool no_move) { - if (no_move) return; - - constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS; - const float placexpos = toolheadposx[active_extruder], - grabxpos = toolheadposx[new_tool]; - const xyz_pos_t &hoffs = hotend_offset[active_extruder]; - - /** - * 1. Raise Z-Axis to give enough clearance - * 2. Move to position near active extruder parking - * 3. Move gently to park position of active extruder - * 4. Disengage magnetic field, wait for delay - * 5. Leave extruder and move to position near new extruder parking - * 6. Move gently to park position of new extruder - * 7. Engage magnetic field for new extruder parking - * 8. Unpark extruder - * 9. Apply Z hotend offset to current position - */ - - if (DEBUGGING(LEVELING)) DEBUG_POS("Start EMST Tool-Change", current_position); - - // 1. Raise Z-Axis to give enough clearance - - current_position.z += SWITCHING_TOOLHEAD_Z_HOP; - if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis ", current_position); - fast_line_to_current(Z_AXIS); - - // 2. Move to position near active extruder parking - - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - SERIAL_ECHOLNPAIR("(2) Move near active extruder parking", active_extruder); - DEBUG_POS("Moving ParkPos", current_position); - } - current_position.set(hoffs.x + placexpos, - hoffs.y + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR); - fast_line_to_current(X_AXIS); - - // 3. Move gently to park position of active extruder - - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - SERIAL_ECHOLNPAIR("(3) Move gently to park position of active extruder", active_extruder); - DEBUG_POS("Moving ParkPos", current_position); - } - - current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - slow_line_to_current(Y_AXIS); - - // 4. Disengage magnetic field, wait for delay - - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Disengage magnet"); - est_deactivate_solenoid(); - - // 5. Leave extruder and move to position near new extruder parking - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("(5) Move near new extruder parking"); - DEBUG_POS("Moving ParkPos", current_position); - } - - current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; - slow_line_to_current(Y_AXIS); - current_position.set(hoffs.x + grabxpos, - hoffs.y + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR); - fast_line_to_current(X_AXIS); - - // 6. Move gently to park position of new extruder - - current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_ECHOLNPGM("(6) Move near new extruder"); - } - slow_line_to_current(Y_AXIS); - - // 7. Engage magnetic field for new extruder parking - - planner.synchronize(); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(7) Engage magnetic field"); - est_activate_solenoid(); - - // 8. Unpark extruder - - current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(8) Unpark extruder"); - slow_line_to_current(X_AXIS); - planner.synchronize(); // Always sync the final move - - // 9. Apply Z hotend offset to current position - - if (DEBUGGING(LEVELING)) DEBUG_POS("(9) Applying Z-offset", current_position); - current_position.z += hoffs.z - hotend_offset[new_tool].z; - - if (DEBUGGING(LEVELING)) DEBUG_POS("EMST Tool-Change done.", current_position); - } - -#endif // ELECTROMAGNETIC_SWITCHING_TOOLHEAD - -#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) - - inline void dualx_tool_change(const uint8_t new_tool, bool &no_move) { - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: DEBUG_ECHOLNPGM("FULL_CONTROL"); break; - case DXC_AUTO_PARK_MODE: DEBUG_ECHOLNPGM("AUTO_PARK"); break; - case DXC_DUPLICATION_MODE: DEBUG_ECHOLNPGM("DUPLICATION"); break; - case DXC_MIRRORED_MODE: DEBUG_ECHOLNPGM("MIRRORED"); break; - } - } - - const float xhome = x_home_pos(active_extruder); - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE - && IsRunning() && !no_move - && (delayed_move_time || current_position.x != xhome) - ) { - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("MoveX to ", xhome); - - // Park old head - current_position.x = xhome; - line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS]); - planner.synchronize(); - } - - // Activate the new extruder ahead of calling set_axis_is_at_home! - active_extruder = new_tool; - - // This function resets the max/min values - the current position may be overwritten below. - set_axis_is_at_home(X_AXIS); - - if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); - - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - // New current position is the position of the activated extruder - current_position.x = inactive_extruder_x_pos; - // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination.x; - break; - case DXC_AUTO_PARK_MODE: - // record current raised toolhead position for use by unpark - raised_parked_position = current_position; - active_extruder_parked = true; - delayed_move_time = 0; - break; - default: - break; - } - - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - DEBUG_POS("New extruder (parked)", current_position); - } - } - -#endif // DUAL_X_CARRIAGE - -/** - * Perform a tool-change, which may result in moving the - * previous tool out of the way and the new tool into place. - */ -void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { - - #if ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - if (new_tool == active_extruder) return; - #endif - - #if ENABLED(MIXING_EXTRUDER) - - UNUSED(no_move); - - if (new_tool >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(new_tool); - - #if MIXING_VIRTUAL_TOOLS > 1 - // T0-Tnnn: Switch virtual tool by changing the index to the mix - mixer.T(new_tool); - #endif - - #elif ENABLED(PRUSA_MMU2) - - UNUSED(no_move); - - mmu2.tool_change(new_tool); - - #elif EXTRUDERS == 0 - - // Nothing to do - UNUSED(new_tool); UNUSED(no_move); - - #elif EXTRUDERS < 2 - - UNUSED(no_move); - - if (new_tool) invalid_extruder_error(new_tool); - return; - - #else // EXTRUDERS > 1 - - planner.synchronize(); - - #if ENABLED(DUAL_X_CARRIAGE) // Only T0 allowed if the Printer is in DXC_DUPLICATION_MODE or DXC_MIRRORED_MODE - if (new_tool != 0 && dxc_is_duplicating()) - return invalid_extruder_error(new_tool); - #endif - - if (new_tool >= EXTRUDERS) - return invalid_extruder_error(new_tool); - - if (!no_move && !all_axes_homed()) { - no_move = true; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("No move (not homed)"); - } - - #if HAS_LCD_MENU - ui.return_to_status(); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - const bool idex_full_control = dual_x_carriage_mode == DXC_FULL_CONTROL_MODE; - #else - constexpr bool idex_full_control = false; - #endif - - const uint8_t old_tool = active_extruder; - const bool can_move_away = !no_move && !idex_full_control; - - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - const bool should_swap = can_move_away && toolchange_settings.swap_length; - #if ENABLED(PREVENT_COLD_EXTRUSION) - const bool too_cold = !DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(old_tool) || thermalManager.targetTooColdToExtrude(new_tool)); - #else - constexpr bool too_cold = false; - #endif - if (should_swap) { - if (too_cold) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); - #if ENABLED(SINGLENOZZLE) - active_extruder = new_tool; - return; - #endif - } - else { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); - #else - current_position.e -= toolchange_settings.swap_length / planner.e_factor[old_tool]; - planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), old_tool); - planner.synchronize(); - #endif - } - } - #endif // TOOLCHANGE_FILAMENT_SWAP - - #if HAS_LEVELING - // Set current position to the physical position - TEMPORARY_BED_LEVELING_STATE(false); - #endif - - if (new_tool != old_tool) { - - #if SWITCHING_NOZZLE_TWO_SERVOS - raise_nozzle(old_tool); - #endif - - REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S); - - #if HAS_SOFTWARE_ENDSTOPS - #if HAS_HOTEND_OFFSET - #define _EXT_ARGS , old_tool, new_tool - #else - #define _EXT_ARGS - #endif - update_software_endstops(X_AXIS _EXT_ARGS); - #if DISABLED(DUAL_X_CARRIAGE) - update_software_endstops(Y_AXIS _EXT_ARGS); - update_software_endstops(Z_AXIS _EXT_ARGS); - #endif - #endif - - destination = current_position; - - #if DISABLED(SWITCHING_NOZZLE) - if (can_move_away) { - // Do a small lift to avoid the workpiece in the move back (below) - current_position.z += toolchange_settings.z_raise; - #if HAS_SOFTWARE_ENDSTOPS - NOMORE(current_position.z, soft_endstop.max.z); - #endif - fast_line_to_current(Z_AXIS); - #if ENABLED(TOOLCHANGE_PARK) - current_position = toolchange_settings.change_point; - #endif - planner.buffer_line(current_position, feedrate_mm_s, old_tool); - planner.synchronize(); - } - #endif - - #if HAS_HOTEND_OFFSET - xyz_pos_t diff = hotend_offset[new_tool] - hotend_offset[old_tool]; - #if ENABLED(DUAL_X_CARRIAGE) - diff.x = 0; - #endif - #else - constexpr xyz_pos_t diff{0}; - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - dualx_tool_change(new_tool, no_move); - #elif ENABLED(PARKING_EXTRUDER) // Dual Parking extruder - parking_extruder_tool_change(new_tool, no_move); - #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) // Magnetic Parking extruder - magnetic_parking_extruder_tool_change(new_tool); - #elif ENABLED(SWITCHING_TOOLHEAD) // Switching Toolhead - switching_toolhead_tool_change(new_tool, no_move); - #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching Toolhead - magnetic_switching_toolhead_tool_change(new_tool, no_move); - #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching ToolChanger - em_switching_toolhead_tool_change(new_tool, no_move); - #elif ENABLED(SWITCHING_NOZZLE) && !SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle (single servo) - // Raise by a configured distance to avoid workpiece, except with - // SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead. - current_position.z += _MAX(-diff.z, 0.0) + toolchange_settings.z_raise; - #if HAS_SOFTWARE_ENDSTOPS - NOMORE(current_position.z, soft_endstop.max.z); - #endif - if (!no_move) fast_line_to_current(Z_AXIS); - move_nozzle_servo(new_tool); - #endif - - #if DISABLED(DUAL_X_CARRIAGE) - active_extruder = new_tool; // Set the new active extruder - #endif - - // The newly-selected extruder XYZ is actually at... - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Offset Tool XY by { ", diff.x, ", ", diff.y, ", ", diff.z, " }"); - current_position += diff; - - // Tell the planner the new "current position" - sync_plan_position(); - - #if ENABLED(DELTA) - //LOOP_XYZ(i) update_software_endstops(i); // or modify the constrain function - const bool safe_to_move = current_position.z < delta_clip_start_height - 1; - #else - constexpr bool safe_to_move = true; - #endif - - // Return to position and lower again - if (safe_to_move && !no_move && IsRunning()) { - - #if ENABLED(SINGLENOZZLE) - #if FAN_COUNT > 0 - singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0]; - thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool]; - #endif - - singlenozzle_temp[old_tool] = thermalManager.temp_hotend[0].target; - if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { - thermalManager.setTargetHotend(singlenozzle_temp[new_tool], 0); - #if HAS_DISPLAY - thermalManager.set_heating_message(0); - #endif - (void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling - } - #endif - - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - if (should_swap && !too_cold) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - do_pause_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed)); - do_pause_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE); - #else - current_position.e += toolchange_settings.swap_length / planner.e_factor[new_tool]; - planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), new_tool); - current_position.e += toolchange_settings.extra_prime / planner.e_factor[new_tool]; - planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed * 0.2f), new_tool); - #endif - planner.synchronize(); - planner.set_e_position_mm((destination.e = current_position.e = current_position.e - (TOOLCHANGE_FIL_EXTRA_PRIME))); - } - #endif - - // Prevent a move outside physical bounds - #if ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - // If the original position is within tool store area, go to X origin at once - if (destination.y < SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR) { - current_position.x = 0; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], new_tool); - planner.synchronize(); - } - #else - apply_motion_limits(destination); - #endif - - // Should the nozzle move back to the old position? - if (can_move_away) { - #if ENABLED(TOOLCHANGE_NO_RETURN) - // Just move back down - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move back Z only"); - do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); - #else - // Move back to the original (or adjusted) position - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); - do_blocking_move_to(destination); - #endif - } - else if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move back skipped"); - - #if ENABLED(DUAL_X_CARRIAGE) - active_extruder_parked = false; - #endif - } - #if ENABLED(SWITCHING_NOZZLE) - else { - // Move back down. (Including when the new tool is higher.) - do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); - } - #endif - - #if ENABLED(PRUSA_MMU2) - mmu2.tool_change(new_tool); - #endif - - #if SWITCHING_NOZZLE_TWO_SERVOS - lower_nozzle(new_tool); - #endif - - } // (new_tool != old_tool) - - planner.synchronize(); - - #if ENABLED(EXT_SOLENOID) && DISABLED(PARKING_EXTRUDER) - disable_all_solenoids(); - enable_solenoid_on_active_extruder(); - #endif - - #if ENABLED(MK2_MULTIPLEXER) - if (new_tool >= E_STEPPERS) return invalid_extruder_error(new_tool); - select_multiplexed_stepper(new_tool); - #endif - - #if DO_SWITCH_EXTRUDER - planner.synchronize(); - move_extruder_servo(active_extruder); - #endif - - #if HAS_FANMUX - fanmux_switch(active_extruder); - #endif - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(active_extruder)); - - #endif // EXTRUDERS > 1 -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.h deleted file mode 100644 index 613cb1612c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/module/tool_change.h +++ /dev/null @@ -1,104 +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 - -#include "../inc/MarlinConfigPre.h" -#include "../core/types.h" - -#if EXTRUDERS > 1 - - typedef struct { - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - float swap_length, extra_prime; - int16_t prime_speed, retract_speed; - #endif - #if ENABLED(TOOLCHANGE_PARK) - xy_pos_t change_point; - #endif - float z_raise; - } toolchange_settings_t; - - extern toolchange_settings_t toolchange_settings; - -#endif - -#if DO_SWITCH_EXTRUDER - void move_extruder_servo(const uint8_t e); -#endif - -#if ENABLED(SWITCHING_NOZZLE) - #if SWITCHING_NOZZLE_TWO_SERVOS - void lower_nozzle(const uint8_t e); - void raise_nozzle(const uint8_t e); - #else - void move_nozzle_servo(const uint8_t angle_index); - #endif -#endif - -#if ENABLED(PARKING_EXTRUDER) - - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - #define PE_MAGNET_ON_STATE !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #else - #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #endif - - void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state); - - inline void pe_activate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, PE_MAGNET_ON_STATE); } - inline void pe_deactivate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, !PE_MAGNET_ON_STATE); } - - void pe_solenoid_init(); - -#elif ENABLED(MAGNETIC_PARKING_EXTRUDER) - - typedef struct MPESettings { - 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; - - void mpe_settings_init(); - -#endif - -#if ENABLED(SINGLENOZZLE) - extern uint16_t singlenozzle_temp[EXTRUDERS]; - #if FAN_COUNT > 0 - extern uint8_t singlenozzle_fan_speed[EXTRUDERS]; - #endif -#endif - -#if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - void est_init(); -#endif - -/** - * Perform a tool-change, which may result in moving the - * previous tool out of the way and the new tool into place. - */ -void tool_change(const uint8_t tmp_extruder, bool no_move=false); diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/esp32/pins_ESP32.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/esp32/pins_ESP32.h deleted file mode 100644 index 0831746f0d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/esp32/pins_ESP32.h +++ /dev/null @@ -1,86 +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 - -/** - * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments - */ - -#ifndef ARDUINO_ARCH_ESP32 - "Oops! Select an ESP32 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Espressif ESP32" - -// -// I2S (steppers & other output-only pins) -// -#define I2S_STEPPER_STREAM -#define I2S_WS 25 -#define I2S_BCK 26 -#define I2S_DATA 27 - -// -// Limit Switches -// -#define X_MIN_PIN 34 -#define Y_MIN_PIN 35 -#define Z_MIN_PIN 15 - -// -// Steppers -// -#define X_STEP_PIN 128 -#define X_DIR_PIN 129 -#define X_ENABLE_PIN 130 -//#define X_CS_PIN 0 - -#define Y_STEP_PIN 131 -#define Y_DIR_PIN 132 -#define Y_ENABLE_PIN 133 -//#define Y_CS_PIN 13 - -#define Z_STEP_PIN 134 -#define Z_DIR_PIN 135 -#define Z_ENABLE_PIN 136 -//#define Z_CS_PIN 5 // SS_PIN - -#define E0_STEP_PIN 137 -#define E0_DIR_PIN 138 -#define E0_ENABLE_PIN 139 -//#define E0_CS_PIN 21 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 36 // Analog Input -#define TEMP_BED_PIN 39 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define FAN_PIN 13 -#define HEATER_BED_PIN 4 - -// SPI -#define SDSS 5 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/linux/pins_RAMPS_LINUX.h deleted file mode 100644 index 48cdb1dd62..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ /dev/null @@ -1,615 +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 - -/** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RAMPS 1.4" -#endif - -#define E2END 0xFFF // 4KB - -#define IS_RAMPS_EFB - -// -// Servos -// -#ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI -#else - #define SERVO0_PIN 11 -#endif -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 -#ifndef SERVO3_PIN - #define SERVO3_PIN 4 -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif -#ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN 8 -#endif -#ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN 9 -#endif -#ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN 10 -#endif - -#define HEATER_0_PIN RAMPS_D10_PIN - -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define FAN_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN RAMPS_D9_PIN - #define FAN_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #define FAN1_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_SF) // Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN -#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN - #if HOTENDS == 1 - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif - -#ifndef FAN_PIN - #define FAN_PIN 4 // IO pin. Buffer needed -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif - -// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // Prefer the servo connector - #define CASE_LIGHT_PIN 6 // Hardware PWM - #elif HAS_FREE_AUX2_PINS // try to use AUX 2 - #define CASE_LIGHT_PIN 44 // Hardware PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // Prefer the servo connector - #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM - #define SPINDLE_DIR_PIN 5 - #elif HAS_FREE_AUX2_PINS // try to use AUX 2 - #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN -#endif - -/** - * Default pins for TMC software SPI - */ -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - /** - * Software serial - */ - - #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN 40 - #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN 63 - #endif - #ifndef X2_SERIAL_TX_PIN - #define X2_SERIAL_TX_PIN -1 - #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN -1 - #endif - - #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN 59 - #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN 64 - #endif - #ifndef Y2_SERIAL_TX_PIN - #define Y2_SERIAL_TX_PIN -1 - #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN -1 - #endif - - #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN 42 - #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN 65 - #endif - #ifndef Z2_SERIAL_TX_PIN - #define Z2_SERIAL_TX_PIN -1 - #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN -1 - #endif - - #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN 44 - #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN 66 - #endif - #ifndef E1_SERIAL_TX_PIN - #define E1_SERIAL_TX_PIN -1 - #endif - #ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN -1 - #endif - #ifndef E2_SERIAL_TX_PIN - #define E2_SERIAL_TX_PIN -1 - #endif - #ifndef E2_SERIAL_RX_PIN - #define E2_SERIAL_RX_PIN -1 - #endif - #ifndef E3_SERIAL_TX_PIN - #define E3_SERIAL_TX_PIN -1 - #endif - #ifndef E3_SERIAL_RX_PIN - #define E3_SERIAL_RX_PIN -1 - #endif - #ifndef E4_SERIAL_TX_PIN - #define E4_SERIAL_TX_PIN -1 - #endif - #ifndef E4_SERIAL_RX_PIN - #define E4_SERIAL_RX_PIN -1 - #endif -#endif - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -#if HAS_SPI_LCD - - // - // LCD Display output pins - // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - - #elif BOTH(NEWPANEL, PANEL_ONE) - - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - - #else - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 25 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 37 - #endif - - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - - #else - - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #endif - - #define LCD_PINS_D7 29 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - #endif - - #endif - - #if DISABLED(NEWPANEL) - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - - #endif - - // - // LCD Display input pins - // - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 - #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #endif - - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS SDSS - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - #define BTN_ENC -1 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN 33 - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - #define KILL_PIN 31 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 - - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 - - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BEEPER_PIN 37 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD_PIN 12 - - #elif ENABLED(AZSMZ_12864) - - // Pins only defined for RAMPS_SMART currently - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h deleted file mode 100644 index 65d3fe73ee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h +++ /dev/null @@ -1,160 +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 - -/** - * AZSMZ MINI pin assignments - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "AZSMZ MINI" - -// -// Servos -// -#define SERVO0_PIN P1_23 - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 -#define Y_MIN_PIN P1_26 -#define Z_MIN_PIN P1_28 -#define Z_MAX_PIN P1_29 - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // A0 (TH1) -#define TEMP_BED_PIN P0_24_A1 // A1 (TH2) -#define TEMP_1_PIN P0_25_A2 // A2 (TH3) - -// -// Heaters / Fans -// -// EFB -#define HEATER_0_PIN P2_04 -#define HEATER_BED_PIN P2_05 -#ifndef FAN_PIN - #define FAN_PIN P2_07 -#endif -#define FAN1_PIN P0_26 - -#define LCD_SDSS P0_16 // LCD SD chip select -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if ENABLED(AZSMZ_12864) - #define BEEPER_PIN P1_30 - #define DOGLCD_A0 P2_06 - #define DOGLCD_CS P1_22 - #define BTN_EN1 P4_28 - #define BTN_EN2 P1_27 - #define BTN_ENC P3_26 - #ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD - #endif -#endif - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN LCD_SDSS - #define SD_DETECT_PIN P3_25 -#elif SD_CONNECTION_IS(ONBOARD) - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif - -// -// Ethernet pins -// -#define ENET_MDIO P1_17 -#define ENET_RX_ER P1_14 -#define ENET_RXD1 P1_10 -#define ENET_MOC P1_16 -#define REF_CLK P1_15 -#define ENET_RXD0 P1_09 -#define ENET_CRS P1_08 -#define ENET_TX_EN P1_04 -#define ENET_TXD0 P1_00 -#define ENET_TXD1 P1_01 - -/** - * PWMs - * - * There are 6 PWMs. Each PWM can be assigned to one of two pins. - * - * SERVO2 does NOT have a PWM assigned to it. - * - * PWM1.1 DIO4 SERVO3_PIN FIL_RUNOUT_PIN 5V output, PWM - * PWM1.1 DIO26 E0_STEP_PIN - * PWM1.2 DIO11 SERVO0_PIN - * PWM1.2 DIO54 X_STEP_PIN - * PWM1.3 DIO6 SERVO1_PIN J5-1 - * PWM1.3 DIO60 Y_STEP_PIN - * PWM1.4 DIO53 SDSS(SSEL0) J3-5 AUX-3 - * PWM1.4 DIO46 Z_STEP_PIN - * PWM1.5 DIO3 X_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES - * PWM1.5 DIO9 RAMPS_D9_PIN - * PWM1.6 DIO14 Y_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES - * PWM1.6 DIO10 RAMPS_D10_PIN - */ - - /** - * Special pins - * D37 - not 5V tolerant - * D49 - not 5V tolerant - * D57 - open collector - * D58 - open collector - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h deleted file mode 100644 index 823bdba0d3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ /dev/null @@ -1,183 +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 - -/** - * BIQU BQ111-A4 - * - * Applies to the following boards: - * - * BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed) - * - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "BIQU Thunder B300 V1.0" -#endif - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series -#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series -#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series -#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series -#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V, 1K series -#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 -#ifndef X_CS_PIN - #define X_CS_PIN P1_15 // ETH -#endif - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 -#ifndef Y_CS_PIN - #define Y_CS_PIN P1_14 // ETH -#endif - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 -#ifndef Z_CS_PIN - #define Z_CS_PIN P1_16 // ETH -#endif - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 -#ifndef E0_CS_PIN - #define E0_CS_PIN P1_17 // ETH -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P0_18 // ETH - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P0_17 // ETH - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P0_15 // ETH - #endif -#endif - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_24_A1 // A0 (T0) -#define TEMP_BED_PIN P0_23_A0 // A1 (T1) - -// -// Heaters / Fans -// -#define HEATER_0_PIN P2_07 -#define HEATER_BED_PIN P2_05 -#ifndef FAN_PIN - #define FAN_PIN P2_04 -#endif - -// -// Unused -// -//#define PIN_P2_10 P2_10 // IBOOT-1 -//#define PIN_P0_27 P0_27 // Onboard SD Detect - -/** - * LCD / Controller - * - * REPRAP_DISCOUNT_SMART_CONTROLLER is not supported due to the lack of LCD_PINS_D5, - * LCD_PINS_D6 or LCD_PINS_D7 in the EXP1 connector. - * - * A remote SD card is not supported as the pins routed to EXP2 are the same as used - * for the onboard SD card, and a chip select signal is not provided for the remote - * SD card. - */ -#if HAS_SPI_LCD - - #define BEEPER_PIN P1_31 // EXP1-1 - - #define BTN_EN1 P3_26 // EXP2-3 - #define BTN_EN2 P3_25 // EXP2-5 - #define BTN_ENC P1_30 // EXP1-2 - - #define SD_DETECT_PIN P0_27 // EXP2-7 - #define LCD_PINS_RS P0_16 // EXP1-4 - #define LCD_PINS_ENABLE P0_18 // (MOSI) EXP1-3 - #define LCD_PINS_D4 P0_15 // (SCK) EXP1-5 - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && HAS_CHARACTER_LCD - #error "REPRAP_DISCOUNT_SMART_CONTROLLER is not supported by the BIQU B300 v1.0" - #endif - - #if ENABLED(SDSUPPORT) - #error "SDSUPPORT is not supported by the BIQU B300 v1.0 when an LCD controller is used" - #endif - -#endif // HAS_SPI_LCD - -/** - * SD Card Reader - * - * Software SPI is used to interface with a stand-alone SD card reader connected to EXP1. - * Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board. - */ -#if ENABLED(SDSUPPORT) - #define SCK_PIN P0_15 // EXP1-5 - #define MISO_PIN P0_16 // EXP1-4 - #define MOSI_PIN P0_18 // EXP1-3 - #define SS_PIN P1_30 // EXP1-2 - #define SDSS SS_PIN -#endif - -/** - * PWMS - * - * There are 6 PWMS. Each PWM can be assigned to one of two pins. - * - * PWM1.1 P0_18 LCD_PINS_ENABLE - * PWM1.1 P2_0 X_STEP_PIN - * PWM1.2 P1_20 - * PWM1.2 P2_1 Y_STEP_PIN - * PWM1.3 P1_21 - * PWM1.3 P2_2 Z_STEP_PIN - * PWM1.4 P1_23 - * PWM1.4 P2_3 E0_STEP_PIN - * PWM1.5 P1_24 X_MIN_PIN - * PWM1.5 P2_4 FAN_PIN - * PWM1.6 P1_26 Y_MIN_PIN - * PWM1.6 P2_5 HEATER_BED_PIN - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h deleted file mode 100644 index a20659f0f5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h +++ /dev/null @@ -1,161 +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 - -/** - * BIQU BQ111-A4 - * - * Applies to the following boards: - * - * BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed) - * - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "BIQU BQ111-A4" - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series -#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series -#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series -#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series -#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V, 1K series -#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series - - -// -// Steppers -// -#define X_STEP_PIN P2_0 -#define X_DIR_PIN P0_5 -#define X_ENABLE_PIN P0_4 - -#define Y_STEP_PIN P2_1 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 - -#define Z_STEP_PIN P2_2 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P2_3 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 - - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // A0 (T0) -#define TEMP_BED_PIN P0_24_A1 // A1 (T1) - - -// -// Heaters / Fans -// -#define HEATER_0_PIN P2_7 -#define HEATER_BED_PIN P2_5 -#ifndef FAN_PIN - #define FAN_PIN P2_4 -#endif - -// -// Unused -// -//#define PIN_P2_10 P2_10 // IBOOT-1 -//#define PIN_P0_27 P0_27 // Onboard SD Detect - -/** - * LCD / Controller - * - * REPRAP_DISCOUNT_SMART_CONTROLLER is not supported due to the lack of LCD_PINS_D5, - * LCD_PINS_D6 or LCD_PINS_D7 in the EXP1 connector. - * - * A remote SD card is not supported as the pins routed to EXP2 are the same as used - * for the onboard SD card, and a chip select signal is not provided for the remote - * SD card. - */ -#if HAS_SPI_LCD - - #define BEEPER_PIN P1_31 // EXP1-1 - - #define BTN_EN1 P3_26 // EXP2-3 - #define BTN_EN2 P3_25 // EXP2-5 - #define BTN_ENC P1_30 // EXP1-2 - - #define SD_DETECT_PIN P0_27 // EXP2-7 - #define LCD_PINS_RS P0_16 // EXP1-4 - #define LCD_PINS_ENABLE P0_18 // (MOSI) EXP1-3 - #define LCD_PINS_D4 P0_15 // (SCK) EXP1-5 - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && HAS_CHARACTER_LCD - #error "REPRAP_DISCOUNT_SMART_CONTROLLER is not supported by the BIQU BQ111-A4" - #endif - - #if ENABLED(SDSUPPORT) - #error "SDSUPPORT is not supported by the BIQU BQ111-A4 when an LCD controller is used" - #endif - -#endif // HAS_SPI_LCD - - -/** - * SD Card Reader - * - * Software SPI is used to interface with a stand-alone SD card reader connected to EXP1. - * Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board. - */ -#if ENABLED(SDSUPPORT) - - #define SCK_PIN P0_15 // EXP1-5 - #define MISO_PIN P0_16 // EXP1-4 - #define MOSI_PIN P0_18 // EXP1-3 - #define SS_PIN P1_30 // EXP1-2 - #define SDSS SS_PIN - -#endif // SDSUPPORT - - -/** - * PWMS - * - * There are 6 PWMS. Each PWM can be assigned to one of two pins. - * - * PWM1.1 P0_18 LCD_PINS_ENABLE - * PWM1.1 P2_0 X_STEP_PIN - * PWM1.2 P1_20 - * PWM1.2 P2_1 Y_STEP_PIN - * PWM1.3 P1_21 - * PWM1.3 P2_2 Z_STEP_PIN - * PWM1.4 P1_23 - * PWM1.4 P2_3 E0_STEP_PIN - * PWM1.5 P1_24 X_MIN_PIN - * PWM1.5 P2_4 FAN_PIN - * PWM1.6 P1_26 Y_MIN_PIN - * PWM1.6 P2_5 HEATER_BED_PIN - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR.h deleted file mode 100644 index ba6bfbca57..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR.h +++ /dev/null @@ -1,94 +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 - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Steppers -// - -#define E1_STEP_PIN P0_01 -#define E1_DIR_PIN P0_00 -#define E1_ENABLE_PIN P0_10 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN -#define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN -#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN - -// -// Heaters / Fans -// -#ifndef HEATER_0_PIN - #define HEATER_0_PIN P2_07 -#endif -#if HOTENDS == 1 - #ifndef FAN1_PIN - #define FAN1_PIN P2_04 - #endif -#else - #ifndef HEATER_1_PIN - #define HEATER_1_PIN P2_04 - #endif -#endif -#ifndef FAN_PIN - #define FAN_PIN P2_03 -#endif -#ifndef HEATER_BED_PIN - #define HEATER_BED_PIN P2_05 -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD - #define BEEPER_PIN P1_30 // (37) not 5V tolerant -#endif - -// -// SD Support -// -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h deleted file mode 100644 index afcae1cad1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ /dev/null @@ -1,233 +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 - -#define BOARD_INFO_NAME "BIGTREE SKR 1.1" - -// -// Limit Switches -// - -#define X_MIN_PIN P1_29 -#define X_MAX_PIN P1_28 -#define Y_MIN_PIN P1_27 -#define Y_MAX_PIN P1_26 -#define Z_MIN_PIN P1_25 -#define Z_MAX_PIN P1_24 - -// -// Steppers -// -#define X_STEP_PIN P0_04 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P4_28 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P2_02 -#define Y_ENABLE_PIN P2_00 - -#define Z_STEP_PIN P0_20 -#define Z_DIR_PIN P0_21 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P0_11 -#define E0_DIR_PIN P2_13 -#define E0_ENABLE_PIN P2_12 - -/** - * LCD / Controller - * - * As of 20 JAN 2019 only the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER display has - * been tested with these settings. It can be connected to the SKR using standard cables - * via the EXP1 and EXP2 ports. Other displays may need a custom cable and/or changes to - * the pins defined below. - * - * The SD card on the LCD controller uses the same SPI signals as the LCD, resulting in - * garbage/lines on the LCD display during SD card access. The LCD code mitigates this - * by redrawing the screen after SD card accesses. - */ - -#if HAS_SPI_LCD - #define BTN_EN1 P3_26 - #define BTN_EN2 P3_25 - #define BTN_ENC P2_11 - - #define SD_DETECT_PIN P1_31 - #define LCD_SDSS P1_23 - #define LCD_PINS_RS P0_16 - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P2_06 - #define DOGLCD_A0 P0_16 - #endif -#endif - -// -// SD Support -// -// MKS_MINI_12864 strongly prefers the SD card on the display and -// requires jumpers on the SKR V1.1 board as documented here: -// https://www.facebook.com/groups/505736576548648/permalink/630639874058317/ -#ifndef SDCARD_CONNECTION - #if ENABLED(MKS_MINI_12864) - #define SDCARD_CONNECTION LCD - #else - #define SDCARD_CONNECTION ONBOARD - #endif -#endif - -#if SD_CONNECTION_IS(LCD) - #define SS_PIN P1_23 -#endif - -// Trinamic driver support - -#if HAS_TRINAMIC - // Using TMC devices in intelligent mode requires extra connections to each device. Unfortunately - // the SKR does not have many free pins (especially if a display is in use). The SPI-based devices - // will require 3 connections (clock, mosi, miso), plus a chip select line (CS) for each driver. - // The UART-based devices require 2 pis per deriver (one of which must be interrupt capable). - // The same SPI pins can be shared with the display/SD card reader, meaning SPI-based devices are - // probably a good choice for this board. - // - // SOFTWARE_DRIVER_ENABLE is a good option. It uses SPI to control the driver enable and allows the - // hardware ENABLE pins for each driver to be repurposed as SPI chip select. To use this mode the - // driver modules will probably need to be modified, removing the pin used for the enable line from - // the module and wiring this connection directly to GND (as is the case for TMC2130). - // Using this option and sharing all of the SPI pins allows 5 TMC2130 drivers to be used along with - // a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER without requiring the use of any extra pins. - // - // Other options will probably require the use of any free pins and the TFT serial port or a - // different type of display (like the TFT), using the pins normally used for the display and encoder. - // Unfortunately, tests show it's not possible to use endstop and thermistor pins for chip-select. - // Sample settings are provided below, but only some have been tested. - // - // Another option is to share the enable and chip-select pins when using SPI. Several users have - // reported that this works. However, it's unlikely that this configuration will allow SPI communi- - // cation with the device when the drivers are active, meaning that some of the more advanced TMC - // options may not be available. - - // When using any TMC SPI-based drivers, software SPI is used - // because pins may be shared with the display or SD card. - #define TMC_USE_SW_SPI - #define TMC_SW_MOSI P0_18 - #define TMC_SW_MISO P0_17 - // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.) - #define TMC_SW_SCK P0_15 - // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise. - //#define TMC_SW_SCK P2_06 - - #if ENABLED(SOFTWARE_DRIVER_ENABLE) - - // Software enable allows the enable pins to be repurposed as chip-select pins. - // Note: Requires the driver modules to be modified to always be enabled with the enable pin removed. - #if AXIS_DRIVER_TYPE_X(TMC2130) - #define X_CS_PIN P4_28 - #undef X_ENABLE_PIN - #define X_ENABLE_PIN -1 - #endif - - #if AXIS_DRIVER_TYPE_Y(TMC2130) - #define Y_CS_PIN P2_00 - #undef Y_ENABLE_PIN - #define Y_ENABLE_PIN -1 - #endif - - #if AXIS_DRIVER_TYPE_Z(TMC2130) - #define Z_CS_PIN P0_19 - #undef Z_ENABLE_PIN - #define Z_ENABLE_PIN -1 - #endif - - #if AXIS_DRIVER_TYPE_E0(TMC2130) - #define E0_CS_PIN P2_12 - #undef E0_ENABLE_PIN - #define E0_ENABLE_PIN -1 - #endif - - - #if AXIS_DRIVER_TYPE_E1(TMC2130) - #define E1_CS_PIN P0_10 - #undef E1_ENABLE_PIN - #define E1_ENABLE_PIN -1 - #endif - - #else // !SOFTWARE_DRIVER_ENABLE - - // A chip-select pin is needed for each driver. - - // EXAMPLES - - // Example 1: No LCD attached or a TFT style display using the AUX header RX/TX pins. - // SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2. - //#define SKR_USE_LCD_PINS_FOR_CS - #if ENABLED(SKR_USE_LCD_PINS_FOR_CS) - #if SD_CONNECTION_IS(LCD) - #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS." - #endif - #define X_CS_PIN P1_23 - #define Y_CS_PIN P3_26 - #define Z_CS_PIN P2_11 - #define E0_CS_PIN P3_25 - #define E1_CS_PIN P1_31 - #endif - - // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - // The SD card reader attached to the LCD (if present) can't be used because - // the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'. - //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS - #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS) - #if SD_CONNECTION_IS(LCD) - #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS." - #endif - #define X_CS_PIN P0_02 - #define Y_CS_PIN P0_03 - #define Z_CS_PIN P2_06 - // We use SD_DETECT_PIN for E0 - #undef SD_DETECT_PIN - #define E0_CS_PIN P1_31 - // We use LCD_SDSS pin for E1 - #undef LCD_SDSS - #define LCD_SDSS -1 - #define E1_CS_PIN P1_23 - #endif - - // Example 3: Use the driver enable pins for chip-select. - // Commands must not be sent to the drivers when enabled. So certain - // advanced features (like driver monitoring) will not be available. - //#define SKR_USE_ENABLE_CS - #if ENABLED(SKR_USE_ENABLE_FOR_CS) - #define X_CS_PIN X_ENABLE_PIN - #define Y_CS_PIN Y_ENABLE_PIN - #define Z_CS_PIN Z_ENABLE_PIN - #define E0_CS_PIN E0_ENABLE_PIN - #define E1_CS_PIN E1_ENABLE_PIN - #endif - - #endif // SOFTWARE_DRIVER_ENABLE - -#endif - -// Include common SKR pins -#include "pins_BTT_SKR.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h deleted file mode 100644 index 9621157653..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ /dev/null @@ -1,312 +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 - -#define BOARD_INFO_NAME "BIGTREE SKR 1.3" - -/** - * Limit Switches - * - * For Stallguard homing to max swap the min / max pins so - * the MAX physical connectors can be used for other things. - */ -#if X_HOME_DIR == -1 || !X_STALL_SENSITIVITY - #define X_MIN_PIN P1_29 // X_MIN - #define X_MAX_PIN P1_28 // X_MAX -#else - #define X_MIN_PIN P1_28 // X_MAX - #define X_MAX_PIN P1_29 // X_MIN -#endif - -#if Y_HOME_DIR == -1 || !Y_STALL_SENSITIVITY - #define Y_MIN_PIN P1_27 // Y_MIN - #define Y_MAX_PIN P1_26 // Y_MAX -#else - #define Y_MIN_PIN P1_26 // Y_MAX - #define Y_MAX_PIN P1_27 // Y_MIN -#endif - -#if Z_HOME_DIR == -1 || !Z_STALL_SENSITIVITY - #define Z_MIN_PIN P1_25 // Z_MIN - #define Z_MAX_PIN P1_24 // Z_MAX -#else - #define Z_MIN_PIN P1_24 // Z_MAX - #define Z_MAX_PIN P1_25 // Z_MIN -#endif - -// -// Servos -// -#ifndef SERVO0_PIN - #define SERVO0_PIN P2_00 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN P1_24 -#endif - -// -// Filament Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P1_28 -#endif - -// -// Steppers -// -#define X_STEP_PIN P2_02 -#define X_DIR_PIN P2_06 -#define X_ENABLE_PIN P2_01 -#ifndef X_CS_PIN - #define X_CS_PIN P1_17 -#endif - -#define Y_STEP_PIN P0_19 -#define Y_DIR_PIN P0_20 -#define Y_ENABLE_PIN P2_08 -#ifndef Y_CS_PIN - #define Y_CS_PIN P1_15 -#endif - -#define Z_STEP_PIN P0_22 -#define Z_DIR_PIN P2_11 -#define Z_ENABLE_PIN P0_21 -#ifndef Z_CS_PIN - #define Z_CS_PIN P1_10 -#endif - -#define E0_STEP_PIN P2_13 -#define E0_DIR_PIN P0_11 -#define E0_ENABLE_PIN P2_12 -#ifndef E0_CS_PIN - #define E0_CS_PIN P1_08 -#endif - -#ifndef E1_CS_PIN - #define E1_CS_PIN P1_01 -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P4_28 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P0_05 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P0_04 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - #define X_SERIAL_TX_PIN P4_29 - #define X_SERIAL_RX_PIN P1_17 - - #define Y_SERIAL_TX_PIN P1_16 - #define Y_SERIAL_RX_PIN P1_15 - - #define Z_SERIAL_TX_PIN P1_14 - #define Z_SERIAL_RX_PIN P1_10 - - #define E0_SERIAL_TX_PIN P1_09 - #define E0_SERIAL_RX_PIN P1_08 - - #define E1_SERIAL_TX_PIN P1_04 - #define E1_SERIAL_RX_PIN P1_01 - - #define Z2_SERIAL_TX_PIN P1_04 - #define Z2_SERIAL_RX_PIN P1_01 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -/** - * _____ _____ - * NC | · · | GND 5V | · · | GND - * RESET | · · | 1.31 (SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) - * (MOSI) 0.18 | · · | 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) - * (SD_SS) 0.16 | · · | 3.26 (BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) - * (SCK) 0.15 | · · | 0.17 (MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) - * ----- ----- - * EXP2 EXP1 - */ -#if HAS_SPI_LCD - - #if ENABLED(ANET_FULL_GRAPHICS_LCD) - - #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue." - - /** - * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. - * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) - * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.) - * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board. - * - * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! - * - * The ANET_FULL_GRAPHICS_LCD connector plug: - * - * BEFORE AFTER - * _____ _____ - * GND 1 | · · | 2 5V 5V 1 | · · | 2 GND - * CS 3 | · · | 4 BTN_EN2 CS 3 | · · | 4 BTN_EN2 - * SID 5 | · · | 6 BTN_EN1 SID 5 | · · | 6 BTN_EN1 - * open 7 | · · | 8 BTN_ENC CLK 7 | · · | 8 BTN_ENC - * CLK 9 | · · | 10 Beeper open 9 | · · | 10 Beeper - * ----- ----- - * LCD LCD - */ - - #define LCD_PINS_RS P1_23 - - #define BTN_EN1 P1_20 - #define BTN_EN2 P1_22 - #define BTN_ENC P1_18 - - #define LCD_PINS_ENABLE P1_21 - #define LCD_PINS_D4 P1_19 - - #elif ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS P1_22 - - #define BTN_EN1 P1_18 - #define BTN_EN2 P1_20 - #define BTN_ENC P0_28 // (58) open-drain - - #define LCD_PINS_ENABLE P1_23 - #define LCD_PINS_D4 P1_21 - - #else // !CR10_STOCKDISPLAY - - #define LCD_PINS_RS P1_19 - - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - #define BTN_ENC P0_28 // (58) open-drain - - #define LCD_PINS_ENABLE P1_18 - #define LCD_PINS_D4 P1_20 - - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 - #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant) - - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P1_18 - #define DOGLCD_A0 P1_19 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 - - #define LCD_BACKLIGHT_PIN -1 - - #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 P1_20 // 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 P1_21 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_22 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_23 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_21 - #endif - - #else // !FYSETC_MINI_12864 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P1_21 - #define DOGLCD_A0 P1_22 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 - #define FORCE_SOFT_SPI - #endif - - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P1_21 - #define LCD_PINS_D6 P1_22 - #define LCD_PINS_D7 P1_23 - #endif - - #endif // !FYSETC_MINI_12864 - - #endif // !CR10_STOCKDISPLAY - -#endif // HAS_SPI_LCD - -// -// SD Support -// - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD -#endif - -#if SD_CONNECTION_IS(LCD) - #define SS_PIN P0_16 -#endif - -/** - * Special pins - * P1_30 (37) (NOT 5V tolerant) - * P1_31 (49) (NOT 5V tolerant) - * P0_27 (57) (Open collector) - * P0_28 (58) (Open collector) - */ - -// Include common SKR pins -#include "pins_BTT_SKR.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h deleted file mode 100644 index 6e45a49a9e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ /dev/null @@ -1,163 +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 - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "GMARSH X6 REV1" - -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks -// -#define LPC1768_ENABLE_CLKOUT_12M - -// -// Servos -// -#define SERVO0_PIN P1_26 // PWM1[6] -#define SERVO1_PIN P1_18 // PWM1[1] - -// -// Limit Switches -// -#define X_MIN_PIN P0_00 -#define X_MAX_PIN P0_01 -#define Y_MIN_PIN P0_10 -#define Y_MAX_PIN P0_21 -#define Z_MIN_PIN P2_13 -#define Z_MAX_PIN P2_22 - -// -// Steppers -// - -#define X_STEP_PIN P1_01 -#define X_DIR_PIN P1_04 -#define X_ENABLE_PIN P0_26 - -#define Y_STEP_PIN P1_10 -#define Y_DIR_PIN P1_14 -#define Y_ENABLE_PIN P1_08 - -#define Z_STEP_PIN P1_17 -#define Z_DIR_PIN P4_29 -#define Z_ENABLE_PIN P1_15 - -#define E0_STEP_PIN P0_05 -#define E0_DIR_PIN P2_00 -#define E0_ENABLE_PIN P4_28 - -#define E1_STEP_PIN P2_03 -#define E1_DIR_PIN P2_04 -#define E1_ENABLE_PIN P2_01 - -#define E2_STEP_PIN P2_07 -#define E2_DIR_PIN P2_08 -#define E2_ENABLE_PIN P2_05 - -// -// TMC2208 UART pins -// -#if HAS_DRIVER(TMC2208) - #define X_SERIAL_TX_PIN P1_00 - #define X_SERIAL_RX_PIN P1_00 - #define Y_SERIAL_TX_PIN P1_09 - #define Y_SERIAL_RX_PIN P1_09 - #define Z_SERIAL_TX_PIN P1_16 - #define Z_SERIAL_RX_PIN P1_16 - #define E0_SERIAL_TX_PIN P0_04 - #define E0_SERIAL_RX_PIN P0_04 - #define E1_SERIAL_TX_PIN P2_02 - #define E1_SERIAL_RX_PIN P2_02 - #define E2_SERIAL_TX_PIN P2_06 - #define E2_SERIAL_RX_PIN P2_06 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#else - #error "TMC2208 UART configuration is required for GMarsh X6." -#endif - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_24_A1 // AD0[0] on P0_23 -#define TEMP_BED_PIN P0_23_A0 // AD0[1] on P0_24 - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P1_19 // Not a PWM pin, software PWM required -#define HEATER_0_PIN P3_26 // PWM1[3] -#define FAN_PIN P3_25 // Part cooling fan - connected to PWM1[2] -#define E0_AUTO_FAN_PIN P0_27 // Extruder cooling fan - -// -// Misc. Functions -// -#define LED_PIN P1_31 - -// -// LCD -// -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define BEEPER_PIN P0_19 - #define BTN_EN1 P1_23 - #define BTN_EN2 P1_24 - #define BTN_ENC P1_25 - #define LCD_PINS_RS P0_20 - #define LCD_PINS_ENABLE P0_21 - #define LCD_PINS_D4 P2_11 - #define LCD_PINS_D5 P0_22 - #define LCD_PINS_D6 P1_29 - #define LCD_PINS_D7 P1_28 -#endif - -// -// SD Support -// - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN P0_16 -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h deleted file mode 100644 index fd87dbe1e2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ /dev/null @@ -1,377 +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 - -/** - * MKS SBASE pin assignments - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "MKS SBASE" -#endif -#ifndef BOARD_WEBSITE_URL - #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SBASE" -#endif - -#define LED_PIN P1_18 // Used as a status indicator -#define LED2_PIN P1_19 -#define LED3_PIN P1_20 -#define LED4_PIN P1_21 - -// -// Servos -// -#define SERVO0_PIN P1_23 // J8-3 (low jitter) -#define SERVO1_PIN P2_12 // J8-4 -#define SERVO2_PIN P2_11 // J8-5 -#define SERVO3_PIN P4_28 // J8-6 - -// -// Limit Switches - Not Interrupt Capable -// -#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series -#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series -#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series -#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series -#define Z_MIN_PIN P1_28 // The original Mks Sbase DIO19 has a 10k pullup to 3.3V or 5V, 1K series, so when using a Zprobe we must use DIO41 (J8 P1.22) -#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series - -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN P4_28 // Connector J8 -#endif - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) -#define TEMP_0_PIN P0_24_A1 // A1 (TH2) -#define TEMP_1_PIN P0_25_A2 // A2 (TH3) -#define TEMP_2_PIN P0_26_A3 // A3 (TH4) - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 -#define HEATER_1_PIN P2_06 -#ifndef FAN_PIN - #define FAN_PIN P2_04 -#endif - -// -// Connector J7 -// Note: These pins are all digitally shared with the EXP1/EXP2 Connector. -// Using them with an LCD connected or configured will lead to hangs & crashes. -// - -// 5V -// NC -// GND -#define PIN_P0_17 P0_17 -#define PIN_P0_16 P0_16 -#define PIN_P0_15 P0_15 - -// -// Connector J8 -// - -// GND -#define PIN_P1_22 P1_22 -#define PIN_P1_23 P1_23 // PWM Capable -#define PIN_P2_12 P2_12 // Interrupt Capable -#define PIN_P2_11 P2_11 // Interrupt Capable - -// -// Průša i3 MK2 Multi Material Multiplexer Support -// -#if ENABLED(MK2_MULTIPLEXER) - #define E_MUX0_PIN P1_23 // J8-3 - #define E_MUX1_PIN P2_12 // J8-4 - #define E_MUX2_PIN P2_11 // J8-5 -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN P0_25 // TH3 Connector - -// -// Ethernet pins -// -#ifndef ULTIPANEL - #define ENET_MDIO P1_17 // J12-4 - #define ENET_RX_ER P1_14 // J12-6 - #define ENET_RXD1 P1_10 // J12-8 -#endif - -#define ENET_MOC P1_16 // J12-3 -#define REF_CLK P1_15 // J12-5 -#define ENET_RXD0 P1_09 // J12-7 -#define ENET_CRS P1_08 // J12-9 -#define ENET_TX_EN P1_04 // J12-10 -#define ENET_TXD0 P1_00 // J12-11 -#define ENET_TXD1 P1_01 // J12-12 - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(CUSTOM_CABLE) - - /** - * A custom cable is needed. See the README file in the - * Marlin\src\config\examples\Mks\Sbase directory - * P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be - * used as the SD_DETECT for the LCD's SD card. - * - * The best solution is to use the custom cable to connect the LCD's SD_DETECT - * to a pin NOT on EXP2. - * - * If you can't find a pin to use for the LCD's SD_DETECT then comment out - * SD_DETECT_PIN entirely and remove that wire from the the custom cable. - */ - #define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) - #define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) - #define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) - #define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9) - #define SS_PIN P0_28 - #define LPC_SOFTWARE_SPI // With a custom cable we need software SPI because the - // selected pins are not on a hardware SPI controller -#elif SD_CONNECTION_IS(LCD) - // use standard cable and header, SPI and SD detect sre shared with on-board SD card - // hardware SPI is used for both SD cards. The detect pin is shred between the - // LCD and onboard SD readers so we disable it. - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_28 -#elif SD_CONNECTION_IS(ONBOARD) - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#endif - -/** - * Smart LCD adapter - * - * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as - * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use - * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable - * is needed to pick up 5V for the EXP1 connection. - * - * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines - * on the LCD display during accesses of the SD card. The menus/code has been arranged so - * that the garbage/lines are erased immediately after the SD card accesses are completed. - */ - -#if HAS_SPI_LCD - #define BEEPER_PIN P1_31 // EXP1.1 - #define BTN_ENC P1_30 // EXP1.2 - #define BTN_EN1 P3_26 // EXP2.5 - #define BTN_EN2 P3_25 // EXP2.3 - #define LCD_PINS_RS P0_16 // EXP1.4 - #define LCD_SDSS P0_28 // EXP2.4 - #define LCD_PINS_ENABLE P0_18 // EXP1.3 - #define LCD_PINS_D4 P0_15 // EXP1.5 - #if ANY(VIKI2, miniVIKI) - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN - #endif - - #if ENABLED(FYSETC_MINI_12864) - /** - * The FYSETC display can NOT use the SCK and MOSI pins on EXP2, so a - * special cable is needed to go between EXP2 on the FYSETC and the - * controller board's EXP2 and J8. It also means that a software SPI - * is needed to drive those pins. - * - * The FYSETC requires mode 3 SPI interface. - * - * Pins 6, 7 & 8 on EXP2 are no connects. That means a second special - * cable will be needed if the RGB LEDs are to be active. - */ - #define DOGLCD_CS LCD_PINS_ENABLE // EXP1.3 (LCD_EN on FYSETC schematic) - #define DOGLCD_A0 LCD_PINS_RS // EXP1.4 (LCD_A0 on FYSETC schematic) - #define DOGLCD_SCK P2_11 // J8-5 (SCK on FYSETC schematic) - #define DOGLCD_MOSI P4_28 // J8-6 (MOSI on FYSETC schematic) - - //#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 - - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P2_12 // J8-4 (LCD_D6 on FYSETC schematic) - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_23 // J8-3 (LCD_D5 on FYSETC schematic) - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 // J8-2 (LCD_D7 on FYSETC schematic) - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P2_12 - #endif - - #elif ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #endif - -#endif - -/** - * Example for trinamic drivers using the J8 connector on MKs Sbase. - * 2130s need 1 pin for each driver. 2208/2209s need 2 pins for serial control. - * This board does not have enough pins to use hardware serial. - */ - -#if HAS_DRIVER(TMC2130) - // J8 - #define X_CS_PIN P1_22 - #define Y_CS_PIN P1_23 - #define Z_CS_PIN P2_12 - #define E0_CS_PIN P2_11 - #define E1_CS_PIN P4_28 - -// Hardware SPI is on EXP2. See if you can make it work: -// https://github.com/makerbase-mks/MKS-SBASE/issues/25 -#define TMC_USE_SW_SPI -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P0_03 // AUX1 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P0_02 // AUX1 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P0_26 // TH4 - #endif - #endif -#endif - -#if MB(MKS_SBASE) && HAS_TMC220x - - /** - * TMC2208/TMC2209 stepper drivers - * - * The shortage of pins becomes apparent. - * Worst case you may have to give up the LCD - * RX pins need to be interrupt capable - */ - #define X_SERIAL_TX_PIN P1_22 // J8-2 - #define X_SERIAL_RX_PIN P2_12 // J8-4 Interrupt Capable - #define Y_SERIAL_TX_PIN P1_23 // J8-3 - #define Y_SERIAL_RX_PIN P2_11 // J8-5 Interrupt Capable - #define Z_SERIAL_TX_PIN P2_12 // J8-4 - #define Z_SERIAL_RX_PIN P0_25 // TH3 - #define E0_SERIAL_TX_PIN P4_28 // J8-6 - #define E0_SERIAL_RX_PIN P0_26 // TH4 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// UNUSED -#define PIN_P0_27 P0_27 // EXP2/Onboard SD -#define PIN_P0_28 P0_28 // EXP2 -#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) - -/** - * PWMs - * - * There are 6 PWMs. Each PWM can be assigned to one of two pins. - * - * SERVO2 does NOT have a PWM assigned to it. - * - * PWM1.1 P1_18 SERVO3_PIN FIL_RUNOUT_PIN 5V output, PWM - * PWM1.1 P2_00 E0_STEP_PIN - * PWM1.2 P1_20 SERVO0_PIN - * PWM1.2 P2_01 X_STEP_PIN - * PWM1.3 P1_21 SERVO1_PIN J5-1 - * PWM1.3 P2_02 Y_STEP_PIN - * PWM1.4 P1_23 SDSS(SSEL0) J3-5 AUX-3 - * PWM1.4 P2_03 Z_STEP_PIN - * PWM1.5 P1_24 X_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES - * PWM1.5 P2_04 RAMPS_D9_PIN - * PWM1.6 P1_26 Y_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES - * PWM1.6 P2_05 RAMPS_D10_PIN - */ - -/** - * Special pins - * P1_30 - not 5V tolerant - EXP1 - * P1_31 - not 5V tolerant - EXP1 - * P0_27 - open collector - EXP2 - * P0_28 - open collector - EXP2 - * - */ - -/** - * Serial Ports - * P0_00 - Port 3 - * P0_01 - SD Card (Onboard) - * P0_10 - Port 2 - * P0_11 - Y_EN/Y_DIR - * P0_15 - Port 1 - * P0_16 - EXP1 - * P0_02 - Port 0 - * P0_03 - AUX1 - * P0_29 - Port -1 - * P0_30 - USB - * - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h deleted file mode 100644 index e1b4169e03..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ /dev/null @@ -1,289 +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 - -/** - * MKS SGEN-L pin assignments - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "MKS SGen-L" -#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L" - -// -// Servos -// -#define SERVO0_PIN P1_23 // SERVO P1.23 -#define SERVO1_PIN P2_00 // SERVO P2.0 - -// -// Limit Switches -// -#define X_MIN_PIN P1_29 -#define X_MAX_PIN P1_28 -#define Y_MIN_PIN P1_27 -#define Y_MAX_PIN P1_26 -#define Z_MIN_PIN P1_25 -#define Z_MAX_PIN P1_24 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN P1_24 -#endif - -// -// Steppers -// -#define X_STEP_PIN P2_02 -#define X_DIR_PIN P2_03 -#define X_ENABLE_PIN P2_01 -#ifndef X_CS_PIN - #define X_CS_PIN P1_01 -#endif - -#define Y_STEP_PIN P0_19 -#define Y_DIR_PIN P0_20 -#define Y_ENABLE_PIN P2_08 -#ifndef Y_CS_PIN - #define Y_CS_PIN P1_08 -#endif - -#define Z_STEP_PIN P0_22 -#define Z_DIR_PIN P2_11 -#define Z_ENABLE_PIN P0_21 -#ifndef Z_CS_PIN - #define Z_CS_PIN P1_10 -#endif - -#define E0_STEP_PIN P2_13 -#define E0_DIR_PIN P0_11 -#define E0_ENABLE_PIN P2_12 -#ifndef E0_CS_PIN - #define E0_CS_PIN P1_15 -#endif - -#define E1_STEP_PIN P0_01 -#define E1_DIR_PIN P0_00 -#define E1_ENABLE_PIN P0_10 -#ifndef E1_CS_PIN - #define E1_CS_PIN P1_17 -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P4_28 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P0_05 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P0_04 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - - #define X_SERIAL_TX_PIN P1_04 - #define X_SERIAL_RX_PIN P1_01 - - #define Y_SERIAL_TX_PIN P1_09 - #define Y_SERIAL_RX_PIN P1_08 - - #define Z_SERIAL_TX_PIN P1_14 - #define Z_SERIAL_RX_PIN P1_10 - - #define E0_SERIAL_TX_PIN P1_16 - #define E0_SERIAL_RX_PIN P1_15 - - #define E1_SERIAL_TX_PIN P4_29 - #define E1_SERIAL_RX_PIN P1_17 - - #define Z2_SERIAL_TX_PIN P4_29 - #define Z2_SERIAL_RX_PIN P1_17 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // Analog Input A0 (TH1) -#define TEMP_BED_PIN P0_24_A1 // Analog Input A1 (TB) -#define TEMP_1_PIN P0_25_A2 // Analog Input A2 (TH2) - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 -#define HEATER_1_PIN P2_06 -#ifndef FAN_PIN - #define FAN_PIN P2_04 -#endif - -// -// Misc. Functions -// -#define LED_PIN P1_18 // Used as a status indicator -#define LED2_PIN P1_19 -#define LED3_PIN P1_20 -#define LED4_PIN P1_21 - -/** - * _____ _____ - * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) - * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 1.20 (SD_MOSI) - * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST - * GND | · · | 5V GND | · · | NC - * ----- ----- - * EXP1 EXP2 - */ -#if HAS_SPI_LCD - #define BEEPER_PIN P1_31 - #define BTN_ENC P1_30 - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS P1_00 - - #define BTN_EN1 P0_18 - #define BTN_EN2 P0_15 - - #define LCD_PINS_ENABLE P1_22 - #define LCD_PINS_D4 P0_17 - - #else - #define LCD_PINS_RS P0_16 - - #define BTN_EN1 P3_25 - #define BTN_EN2 P3_26 - - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 - - #define LCD_SDSS P0_28 - #define SD_DETECT_PIN P0_27 - - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P0_18 - #define DOGLCD_A0 P0_16 - #define DOGLCD_SCK P0_07 - #define DOGLCD_MOSI P1_20 - - #define LCD_BACKLIGHT_PIN -1 - - #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 P0_15 // 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 P0_17 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_00 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P0_17 - #endif - - #else // !FYSETC_MINI_12864 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P0_17 - #define DOGLCD_A0 P1_00 - #endif - - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P0_17 - #define LCD_PINS_D6 P1_00 - #define LCD_PINS_D7 P1_22 - #endif - - #endif // !FYSETC_MINI_12864 - - #endif - -#endif // HAS_SPI_LCD - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_28 -#elif SD_CONNECTION_IS(ONBOARD) - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif - -// -// Other Pins -// -//#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -//#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -//#define PS_ON_PIN P1_23 // SERVO P1.23 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h deleted file mode 100644 index c4f7760516..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ /dev/null @@ -1,504 +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 - -/** - * Re-ARM with RAMPS v1.4 pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - */ - -// Numbers in parentheses () are the corresponding mega2560 pin numbers - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Re-ARM RAMPS 1.4" - -// -// Servos -// -#define SERVO0_PIN P1_20 // (11) -#define SERVO1_PIN P1_21 // ( 6) also on J5-1 -#define SERVO2_PIN P1_19 // ( 5) -#define SERVO3_PIN P1_18 // ( 4) 5V output - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 // ( 3) 10k pullup to 3.3V, 1K series -#define X_MAX_PIN P1_25 // ( 2) 10k pullup to 3.3V, 1K series -#define Y_MIN_PIN P1_26 // (14) 10k pullup to 3.3V, 1K series -#define Y_MAX_PIN P1_27 // (15) 10k pullup to 3.3V, 1K series -#define Z_MIN_PIN P1_29 // (18) 10k pullup to 3.3V, 1K series -#define Z_MAX_PIN P1_28 // (19) 10k pullup to 3.3V, 1K series - -// -// Steppers -// -#define X_STEP_PIN P2_01 // (54) -#define X_DIR_PIN P0_11 // (55) -#define X_ENABLE_PIN P0_10 // (38) -#ifndef X_CS_PIN - #define X_CS_PIN P1_01 // ETH -#endif - -#define Y_STEP_PIN P2_02 // (60) -#define Y_DIR_PIN P0_20 // (61) -#define Y_ENABLE_PIN P0_19 // (56) -#ifndef Y_CS_PIN - #define Y_CS_PIN P1_04 // ETH -#endif - -#define Z_STEP_PIN P2_03 // (46) -#define Z_DIR_PIN P0_22 // (48) -#define Z_ENABLE_PIN P0_21 // (62) -#ifndef Z_CS_PIN - #define Z_CS_PIN P1_10 // ETH -#endif - -#define E0_STEP_PIN P2_00 // (26) -#define E0_DIR_PIN P0_05 // (28) -#define E0_ENABLE_PIN P0_04 // (24) -#ifndef E0_CS_PIN - #define E0_CS_PIN P1_14 // ETH -#endif - -#define E1_STEP_PIN P2_08 // (36) -#define E1_DIR_PIN P2_13 // (34) -#define E1_ENABLE_PIN P4_29 // (30) -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P1_00 // ETH - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P1_08 // ETH - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P1_09 // ETH - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - - // - // Software serial - // - - // P2_08 E1-Step - // P2_13 E1-Dir - - #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN P0_01 - #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN P0_01 - #endif - - #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN P0_00 - #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN P0_00 - #endif - - #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN P2_13 - #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN P2_13 - #endif - - #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN P2_08 - #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN P2_08 - #endif - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_0_PIN -#define TEMP_BED_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_BED_PIN -#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN -#define TEMP_2_PIN P0_26_A3 // A3 - (63) - J5-3 & AUX-2 -#define TEMP_3_PIN P1_30_A4 // A4 - (37) - BUZZER_PIN -//#define TEMP_4_PIN P1_31_A5 // A5 - (49) - SD_DETECT_PIN -//#define ?? P0_03_A6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 -#define FILWIDTH_PIN P0_02_A7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif -#ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN P2_07 // (8) -#endif -#ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN P2_04 // (9) -#endif -#ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN P2_05 // (10) -#endif - -#define HEATER_0_PIN RAMPS_D10_PIN - -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN RAMPS_D9_PIN -#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN RAMPS_D8_PIN -#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") - #define HEATER_BED_PIN RAMPS_D8_PIN - #if HOTENDS == 1 - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif - -#ifndef FAN_PIN - #if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN - #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define FAN_PIN P1_18 // (4) IO pin. Buffer needed - #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #endif -#endif - -// -// Misc. Functions -// -#define LED_PIN P4_28 // (13) - -// define digital pin 5 for the filament runout sensor. Use the RAMPS 1.4 digital input 5 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P1_19 // (5) -#endif - -#define PS_ON_PIN P2_12 // (12) - -#if !defined(MAX6675_SS_PIN) && DISABLED(USE_ZMAX_PLUG) - #define MAX6675_SS_PIN P1_28 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENA_PIN) - #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // Try to use servo connector - #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// Use servo pins, if available -// -#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if NUM_SERVOS > 1 - #if ENABLED(SPINDLE_FEATURE) - #error "SPINDLE_FEATURE requires 3 free servo pins." - #else - #error "LASER_FEATURE requires 3 free servo pins." - #endif - #endif - #define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN SERVO2_PIN // (5) -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN - #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN -#endif -#define E_MUX2_PIN P0_26 // (63) E1_CS_PIN - -/** - * LCD / Controller - * - * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required. - * - * - https://github.com/wolfmanjm/universal-panel-adapter - * - http://panucattdevices.freshdesk.com/support/solutions/articles/1000243195-lcd-display-installation - */ - -/** - * Smart LCD adapter - * - * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as - * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use - * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable - * is needed to pick up 5V for the EXP1 connection. - * - * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines - * on the LCD display during accesses of the SD card. The menus/code has been arranged so - * that the garbage/lines are erased immediately after the SD card accesses are completed. - */ - -#if ENABLED(CR10_STOCKDISPLAY) - - // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3. - // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one - // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. - // Requires REVERSE_ENCODER_DIRECTION in Configuration.h - - #define BEEPER_PIN P2_11 // J3-3 & AUX-4 - - #define BTN_EN1 P0_16 // J3-7 & AUX-4 - #define BTN_EN2 P1_23 // J3-5 & AUX-4 - #define BTN_ENC P3_25 // J3-4 & AUX-4 - - #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) - #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI) - #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) - -#elif HAS_SPI_LCD - - //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - - #if ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN P1_01 - #define BTN_ENC P1_04 - #else - #define BEEPER_PIN P1_30 // (37) not 5V tolerant - #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 - #endif - - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - - #define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) - #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 - - #if ENABLED(NEWPANEL) - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) - #endif - #else - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 - #endif - - #if ANY(VIKI2, miniVIKI) - // #define LCD_SCREEN_ROT_180 - - #define DOGLCD_CS P0_16 // (16) - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN - - #define STAT_LED_BLUE_PIN P0_26 //(63) may change if cable changes - #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes - #else - - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 - - // EXP1 on LCD adapter is not usable - using Ethernet connector instead - #define DOGLCD_CS P1_09 - #define DOGLCD_A0 P1_14 - //#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 P0_16 // 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 P1_00 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_01 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_08 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_00 - #endif - #else - #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #endif - - #define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers - #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO - #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER - #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 - #endif - #endif - - #if ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #endif - -#endif // HAS_SPI_LCD - -// -// Ethernet pins -// -#if DISABLED(ULTIPANEL) - #define ENET_MDIO P1_17 // (71) J12-4 - #define ENET_RX_ER P1_14 // (73) J12-6 - #define ENET_RXD1 P1_10 // (75) J12-8 -#endif -#define ENET_MOC P1_16 // (70) J12-3 -#define REF_CLK P1_15 // (72) J12-5 -#define ENET_RXD0 P1_09 // (74) J12-7 -#define ENET_CRS P1_08 // (76) J12-9 -#define ENET_TX_EN P1_04 // (77) J12-10 -#define ENET_TXD0 P1_00 // (78) J12-11 -#define ENET_TXD1 P1_01 // (79) J12-12 - -// -// SD Support -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - #define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - #define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - #define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif - -/** - * Fast PWMs - * - * The LPC1768's hardware PWM controller has 6 channels. Each channel - * can be setup to either control a dedicated pin directly or to generate - * an interrupt. The direct method's duty cycle is accurate to within a - * a microsecond. The interrupt method's average duty cycle has the - * the same accuracy but the individual cycles can vary because of higher - * priority interrupts. - * - * All Fast PWMs have a 50Hz rate. - * - * The following pins/signals use the direct method. All other pins use the - * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the - * interrupt method. - * - * P1_20 (11) SERVO0_PIN - * P1_21 ( 6) SERVO1_PIN J5-1 - * P0_18 ( 4) SERVO3_PIN 5V output - * *P2_04 ( 9) RAMPS_D9_PIN - * *P2_05 (10) RAMPS_D10_PIN - * - * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as - * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it. - */ - - /** - * Special pins - * P1_30 (37) (NOT 5V tolerant) - * P1_31 (49) (NOT 5V tolerant) - * P0_27 (57) (Open collector) - * P0_28 (58) (Open collector) - */ - -/** - * The following mega2560 pins are NOT available in a Re-ARM system: - * - * 7, 17, 22, 23, 25, 27, 29, 32, 39, 40, 42, 43, 44, 45, 47, 64, 65, 66 - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h deleted file mode 100644 index 4bc3c86882..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h +++ /dev/null @@ -1,114 +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 - -/** - * Selena Compact pin assignments - */ - -#ifndef MCU_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Selena Compact" -#define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena" - -// -// Servos -// -#define SERVO0_PIN P1_23 - -// -// Limit Switches -// -#define X_MIN_PIN P1_28 -#define X_MAX_PIN P1_25 -#define Y_MIN_PIN P2_11 -#define Y_MAX_PIN -1 -#define Z_MIN_PIN P1_27 -#define Z_MAX_PIN -1 -#define Z_PROBE P1_22 - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) -#define TEMP_0_PIN P0_24_A1 // A1 (TH2) -#define TEMP_1_PIN P0_25_A2 // A2 (TH3) - - -// -// Heaters / Fans -// - -#define HEATER_BED_PIN P2_05 -#define HEATER_BED2_PIN P2_04 -#define HEATER_0_PIN P2_07 -#define HEATER_1_PIN P2_06 -#ifndef FAN_PIN - #define FAN_PIN P1_24 -#endif -#define FAN1_PIN P1_26 - -// -// Display -// - -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define LCD_PINS_RS P0_16 - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 - #define LCD_PINS_D5 P1_00 - #define LCD_PINS_D6 P1_01 - #define LCD_PINS_D7 P1_04 - #define BEEPER_PIN P1_31 - - #define BTN_EN1 P3_25 - #define BTN_EN2 P3_26 - #define BTN_ENC P1_30 - - #define SD_DETECT_PIN -1 -#endif // REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h deleted file mode 100644 index 0ae4393cac..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h +++ /dev/null @@ -1,128 +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 - -/** - * Azteeg X5 GT pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Azteeg X5 GT" -#define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3" - -// -// Servos -// -#define SERVO0_PIN P1_23 - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 -#define X_MAX_PIN P1_27 -#define Y_MIN_PIN P1_25 -#define Y_MAX_PIN P1_28 -#define Z_MIN_PIN P1_26 -#define Z_MAX_PIN P1_29 - - -// -// Steppers -// -#define X_STEP_PIN P2_01 -#define X_DIR_PIN P0_11 -#define X_ENABLE_PIN P0_10 -#ifndef X_CS_PIN - #define X_CS_PIN P0_10 // BSD2660 default -#endif - -#define Y_STEP_PIN P2_02 -#define Y_DIR_PIN P0_20 -#define Y_ENABLE_PIN P0_19 -#ifndef Y_CS_PIN - #define Y_CS_PIN P0_19 // BSD2660 default -#endif - -#define Z_STEP_PIN P2_03 -#define Z_DIR_PIN P0_22 -#define Z_ENABLE_PIN P0_21 -#ifndef Z_CS_PIN - #define Z_CS_PIN P0_21 // BSD2660 default -#endif - -#define E0_STEP_PIN P2_00 -#define E0_DIR_PIN P0_05 -#define E0_ENABLE_PIN P0_04 -#ifndef E0_CS_PIN - #define E0_CS_PIN P0_04 // BSD2660 default -#endif - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 -#ifndef E1_CS_PIN - #define E1_CS_PIN P4_29 // BSD2660 default -#endif - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) -#define TEMP_0_PIN P0_24_A1 // A1 (TH2) -#define TEMP_1_PIN P0_25_A2 // A2 (TH3) - - -// -// Heaters / Fans -// - -#define HEATER_BED_PIN P2_07 -#define HEATER_0_PIN P2_04 -#define HEATER_1_PIN P2_05 -#ifndef FAN_PIN - #define FAN_PIN P0_26 -#endif -#define FAN1_PIN P1_22 - -// -// Display -// - -#if ANY(VIKI2, miniVIKI) - #define BEEPER_PIN P1_31 - #define DOGLCD_A0 P2_06 - #define DOGLCD_CS P0_16 - - #define BTN_EN1 P3_25 - #define BTN_EN2 P3_26 - #define BTN_ENC P2_11 - - #define SD_DETECT_PIN P1_18 - #define SDSS P1_21 - - #define STAT_LED_RED_PIN P1_19 - #define STAT_LED_BLUE_PIN P1_20 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h deleted file mode 100644 index 5cc4d52d30..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ /dev/null @@ -1,212 +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 - -/** - * Azteeg X5 MINI pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Azteeg X5 MINI" -#endif -#define BOARD_WEBSITE_URL "tiny.cc/x5_mini" - -// -// LED -// -#define LED_PIN P1_18 - -// -// Servos -// -#define SERVO0_PIN P1_29 - -// -// Limit Switches -// -#define X_STOP_PIN P1_24 -#define Y_STOP_PIN P1_26 -#define Z_STOP_PIN P1_28 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P2_04 -#endif - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN P0_25_A2 // Analog Input (P0_25) -#endif - -// -// Steppers -// -#define X_STEP_PIN P2_01 -#define X_DIR_PIN P0_11 -#define X_ENABLE_PIN P0_10 - -#define Y_STEP_PIN P2_02 -#define Y_DIR_PIN P0_20 -#define Y_ENABLE_PIN P0_19 - -#define Z_STEP_PIN P2_03 -#define Z_DIR_PIN P0_22 -#define Z_ENABLE_PIN P0_21 - -#define E0_STEP_PIN P2_00 -#define E0_DIR_PIN P0_05 -#define E0_ENABLE_PIN P0_04 - -// -// DIGIPOT slave addresses -// -#ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT -#endif - -#ifndef DIGIPOT_I2C_ADDRESS_B - #define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT -#endif - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) -#define TEMP_0_PIN P0_24_A1 // A1 (TH2) - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_07 -#define HEATER_0_PIN P2_05 -#ifndef FAN_PIN - #define FAN_PIN P0_26 -#endif -#define FAN1_PIN P1_25 - -// -// Display -// -#if HAS_SPI_LCD - - #if ENABLED(CR10_STOCKDISPLAY) - - // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3. - // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one - // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. - // Requires REVERSE_ENCODER_DIRECTION in Configuration.h - - #define BEEPER_PIN P2_11 // J3-3 & AUX-4 - - #define BTN_EN1 P0_16 // J3-7 & AUX-4 - #define BTN_EN2 P1_23 // J3-5 & AUX-4 - #define BTN_ENC P3_25 // J3-4 & AUX-4 - - #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) - #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI) - #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) - - #else - - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 - - #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 - #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers - #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 - - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #elif DISABLED(NEWPANEL) - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 - #endif - - #if ANY(VIKI2, miniVIKI) - //#define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN P1_30 // (37) may change if cable changes - #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN - - #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes - #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes - #else - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO - #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER - #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 - #endif - #define BEEPER_PIN P1_30 // (37) not 5V tolerant - #define DOGLCD_CS P0_16 // (16) - #endif - - #if ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #endif - - #endif - -#endif // HAS_SPI_LCD - -// -// SD Support -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN P1_23 -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h deleted file mode 100644 index 3c2a40b403..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h +++ /dev/null @@ -1,44 +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 - -/** - * Azteeg X5 MINI pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Azteeg X5 MINI WIFI" - -// -// DIGIPOT slave addresses -// -#ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x58 // shifted slave address for first DIGIPOT (0x58 <- 0x2C << 1) -#endif -#ifndef DIGIPOT_I2C_ADDRESS_B - #define DIGIPOT_I2C_ADDRESS_B 0x5C // shifted slave address for second DIGIPOT (0x5C <- 0x2E << 1) -#endif - -#include "pins_AZTEEG_X5_MINI.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h deleted file mode 100644 index 7ab8b5bb4a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h +++ /dev/null @@ -1,172 +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 - -/** - * Cohesion3D Mini pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Cohesion3D Mini" - -// -// Servos -// -#define SERVO0_PIN P1_23 - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 // 10k pullup to 3.3V -#define X_MAX_PIN P1_25 // 10k pullup to 3.3V -#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V -#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V -#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V -#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 -#define X_CS_PIN P1_10 // Ethernet Expansion - Pin 9 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 -#define Y_CS_PIN P1_09 // Ethernet Expansion - Pin 10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 -#define Z_CS_PIN P1_00 // Ethernet Expansion - Pin 11 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 -#define E0_CS_PIN P1_04 // Ethernet Expansion - Pin 12 - -// -// Default pins for TMC software SPI -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7 - #endif -#endif - -// -// Analog Inputs -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // P0_23 -#define TEMP_BED_PIN P0_24_A1 // P0_24 - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 // FET 1 -#ifndef FAN_PIN - #define FAN_PIN P2_06 // FET 3 -#endif - -// -// Auto fans -// -#define AUTO_FAN_PIN P2_04 // FET 4 - -#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN - -// -// Misc. Functions -// -#define LED_PIN P4_28 // Play LED - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER - #undef HEATER_0_PIN - #define SPINDLE_LASER_ENA_PIN P2_07 // FET 1 - #undef HEATER_BED_PIN - #define SPINDLE_LASER_PWM_PIN P2_05 // Bed FET - #undef FAN_PIN - #define SPINDLE_DIR_PIN P2_06 // FET 3 -#endif - -// -// LCD / Controller -// -// LCD_PINS_D5, D6, and D7 are not present in the EXP1 connector, and will need to be -// defined to use the REPRAP_DISCOUNT_SMART_CONTROLLER. -// -// A remote SD card is currently not supported because the pins routed to the EXP2 -// connector are shared with the onboard SD card, and Marlin does not support reading -// G-code files from the onboard SD card. -// -#if HAS_SPI_LCD - - #define BEEPER_PIN P0_27 // EXP2-7 - open drain - - #define BTN_EN1 P3_26 // EXP2-5 - #define BTN_EN2 P3_25 // EXP2-3 - #define BTN_ENC P1_30 // EXP1-2 - - #define LCD_PINS_RS P0_16 // EXP1-4 - #define LCD_SDSS P0_28 // EXP2-4 - #define LCD_PINS_ENABLE P0_18 // EXP1-3 - #define LCD_PINS_D4 P0_15 // EXP1-5 - - #define KILL_PIN P2_11 // EXP2-10 - - #if ENABLED(SDSUPPORT) - #error "SDSUPPORT is not currently supported by the Cohesion3D boards" - #endif - -#endif // HAS_SPI_LCD - -// -// Ethernet pins -// -#define ENET_MDIO P1_17 -#define ENET_RX_ER P1_14 -#define ENET_RXD1 P1_10 -#define ENET_MOC P1_16 -#define REF_CLK P1_15 -#define ENET_RXD0 P1_09 -#define ENET_CRS P1_08 -#define ENET_TX_EN P1_04 -#define ENET_TXD0 P1_00 -#define ENET_TXD1 P1_01 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h deleted file mode 100644 index 77cbb19780..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h +++ /dev/null @@ -1,277 +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 - -/** - * Cohesion3D ReMix pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Cohesion3D ReMix" - -// -// Servos -// -#define SERVO0_PIN P2_04 - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 // 10k pullup to 3.3V -#define X_MAX_PIN P1_25 // 10k pullup to 3.3V -#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V -#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V -#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V -#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 -#define X_CS_PIN P1_10 // Ethernet Expansion - Pin 9 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 -#define Y_CS_PIN P1_09 // Ethernet Expansion - Pin 10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 -#define Z_CS_PIN P1_00 // Ethernet Expansion - Pin 11 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 -#define E0_CS_PIN P1_04 // Ethernet Expansion - Pin 12 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 -#define E1_CS_PIN P1_01 // Ethernet Expansion - Pin 14 - -#define E2_STEP_PIN P1_20 -#define E2_DIR_PIN P1_19 -#define E2_ENABLE_PIN P1_21 -#define E2_CS_PIN P1_18 // FET 6 - -// -// Default pins for TMC software SPI -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7 - #endif -#endif - -// -// Analog Inputs -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 -#define TEMP_BED_PIN P0_24_A1 -#define TEMP_1_PIN P0_25_A2 -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #define FILWIDTH_PIN P0_26_A3 -#else - #define TEMP_2_PIN P0_26_A3 -#endif - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 // FET 1 -#define HEATER_1_PIN P1_23 // FET 2 -#define HEATER_2_PIN P1_22 // FET 3 -#ifndef FAN_PIN - #define FAN_PIN P2_06 // FET 4 -#endif - -// -// Auto fans -// -#if HOTENDS == 3 - #define AUTO_FAN_PIN P1_18 // FET 6 -#else - #define AUTO_FAN_PIN P1_22 // FET 3 -#endif -#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN - -// -// Misc. Functions -// -#define LED_PIN P4_28 // Play LED - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER - #undef HEATER_0_PIN - #undef HEATER_BED_PIN - #undef FAN_PIN - #define SPINDLE_LASER_ENA_PIN P2_07 // FET 1 - #define SPINDLE_LASER_PWM_PIN P2_05 // Bed FET - #define SPINDLE_DIR_PIN P2_06 // FET 4 -#endif - -// -// LCD / Controller -// -// LCD_PINS_D5, D6, and D7 are not present in the EXP1 connector, and will need to be -// defined to use the REPRAP_DISCOUNT_SMART_CONTROLLER. -// -// A remote SD card is currently not supported because the pins routed to the EXP2 -// connector are shared with the onboard SD card, and Marlin does not support that -// hardware configuration. -// - -#if ENABLED(FYSETC_MINI_12864) - - #define FORCE_SOFT_SPI // REQUIRED - results in LCD soft SPI mode 3 - - #define BEEPER_PIN P1_31 // EXP1-1 - #define BTN_ENC P1_30 // EXP1-2 - #define DOGLCD_CS P0_18 // EXP1-3 - #define DOGLCD_A0 P0_16 // EXP1-4 - #define LCD_RESET_PIN P0_15 // EXP1-5 - - // A custom cable is REQUIRED for EXP2 cable because the SCK & MOSI on the card's EXP2 are dedicated - // to the onboard SD card. All required EXP2 signals come from the Ethernet connector. Pin 1 of this - // connector is the one nearest the motor power connector. - #define DOGLCD_SCK P1_17 // EXP2-2 => Ethernet pin 5 (bottom, 3 from left) - #define BTN_EN2 P1_09 // EXP2-3 => Ethernet pin 9 (bottom, 5 from left) - #define BTN_EN1 P1_04 // EXP2-5 => Ethernet pin 11 (bottom, 6 from left) - #define DOGLCD_MOSI P1_01 // EXP2-6 => Ethernet pin 13 (bottom, 7 from left) - - // A custom EXP1 cable is required colored LEDs. Pins 1-5, 9, 10 of the cable go to pins 1-5, 9, 10 - // on the board's EXP1 connector. Pins 6, 7, and 8 of the EXP1 cable go to the Ethernet connector. - // Rev 1.2 displays do NOT require the RGB LEDs. 2.0 and 2.1 displays do require RGB. - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P1_16 // EXP1-6 => Ethernet pin 6 (top row, 3 from left) - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_10 // EXP1-7 => Ethernet pin 10 (top row, 5 from left) - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_00 // EXP1-8 => Ethernet pin 12 (top row, 6 from left) - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_16 // EXP1-6 => Ethernet pin 6 (top row, 3 from left) - #endif - -#elif HAS_SPI_LCD - - #define BEEPER_PIN P1_31 // EXP1-1 - //#define SD_DETECT_PIN P0_27 // EXP2-7 - - #define BTN_EN1 P3_26 // EXP2-5 - #define BTN_EN2 P3_25 // EXP2-3 - #define BTN_ENC P1_30 // EXP1-2 - - #define LCD_PINS_RS P0_16 // EXP1-4 - #define LCD_SDSS P0_28 // EXP2-4 - #define LCD_PINS_ENABLE P0_18 // EXP1-3 - #define LCD_PINS_D4 P0_15 // EXP1-5 - - #define KILL_PIN P2_11 // EXP2-10 - -#endif // HAS_SPI_LCD - -// -// SD Support -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_07 // (52) system defined J3-9 & AUX-3 - #define MISO_PIN P0_08 // (50) system defined J3-10 & AUX-3 - #define MOSI_PIN P0_09 // (51) system defined J3-10 & AUX-3 - #define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." -#endif - -// -// Ethernet pins -// -//#define ENET_MDIO P1_17 // Ethernet pin 5 (bottom, 3 from left) -//#define ENET_RX_ER P1_14 -//#define ENET_RXD1 P1_10 // Ethernet pin 10 (top row, 5 from left) -//#define ENET_MOC P1_16 // Ethernet pin 6 (top row, 3 from left) -//#define REF_CLK P1_15 -//#define ENET_RXD0 P1_09 // Ethernet pin 9 (bottom, 5 from left) -//#define ENET_CRS P1_08 // Ethernet pin 8 (top row, 4 from left) - INPUT ONLY -//#define ENET_TX_EN P1_04 // Ethernet pin 11 (bottom, 6 from left) -//#define ENET_TXD0 P1_00 // Ethernet pin 12 (top row, 6 from left) -//#define ENET_TXD1 P1_01 // Ethernet pin 13 (bottom, 7 from left) - -/** - * EXP1 pins - * 1 - P1_31 - * 2 - P1_30 - * 3 - P0_18 - * 4 - P0_16 - * 5 - P0_15 - * 6 - N/C - * 7 - N/C - * 8 - P0_27 (also on EXP2-7) - * 9 - GND - * 10 - +5V - * - * - * EXP2 pins - * 1 - P0_08 - * 2 - P0_07 - * 3 - P3_26 - * 4 - P0_28 - * 5 - P3_25 - * 6 - P0_09 - * 7 - P0_27 (also on EXP1_8) - * 8 - P2_11 - * 9 - GND - * 10 - N/C - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h deleted file mode 100644 index 30172e19ed..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h +++ /dev/null @@ -1,67 +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 - -/** - * MKS SGen pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "MKS SGen" -#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN" - -#include "../lpc1768/pins_MKS_SBASE.h" - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN - -//#undef BTN_EN1 -//#undef BTN_EN2 -//#define BTN_EN1 P1_23 // EXP2.5 -//#define BTN_EN2 P1_22 // EXP2.3 - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * The shortage of pins becomes apparent. - * In the worst case you may have to give up the LCD. - * RX pins must be interrupt-capable. - */ - #define X_SERIAL_TX_PIN P4_29 // J8-2 - #define X_SERIAL_RX_PIN P4_29 // J8-2 - - #define Y_SERIAL_TX_PIN P2_08 // J8-3 - #define Y_SERIAL_RX_PIN P2_08 // J8-3 - - #define Z_SERIAL_TX_PIN P2_11 // J8-4 - #define Z_SERIAL_RX_PIN P2_11 // J8-4 - #define E0_SERIAL_TX_PIN P2_13 // J8-5 - #define E0_SERIAL_RX_PIN P2_13 // J8-5 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h deleted file mode 100644 index 1096ddc629..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ /dev/null @@ -1,116 +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 - -/** - * Smoothieboard pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "Smoothieboard" -#define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard" - -// -// Servos -// -#define SERVO0_PIN P1_23 - -// -// Limit Switches -// -#define X_MIN_PIN P1_24 -#define X_MAX_PIN P1_25 -#define Y_MIN_PIN P1_26 -#define Y_MAX_PIN P1_27 -#define Z_MIN_PIN P1_28 -#define Z_MAX_PIN P1_29 - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P0_05 -#define X_ENABLE_PIN P0_04 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P0_11 -#define Y_ENABLE_PIN P0_10 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P0_20 -#define Z_ENABLE_PIN P0_19 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P0_22 -#define E0_ENABLE_PIN P0_21 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_0_PIN P0_23_A0 // (T1) -#define TEMP_BED_PIN P0_24_A1 // (T2) -#define TEMP_1_PIN P0_25_A2 // (T3) -#define TEMP_2_PIN P0_26_A3 // (T4) - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 -#define HEATER_1_PIN P1_23 -#ifndef FAN_PIN - #define FAN_PIN P2_06 -#endif -#define FAN1_PIN P2_04 - -// -// LCD / Controller -// -#if ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN P1_31 - #define DOGLCD_A0 P2_11 - #define DOGLCD_CS P0_16 - - #define BTN_EN1 P3_25 - #define BTN_EN2 P3_26 - #define BTN_ENC P1_30 - - #define SD_DETECT_PIN P1_18 - #define SDSS P1_21 - - #define STAT_LED_RED_PIN P1_19 - #define STAT_LED_BLUE_PIN P1_20 - -#elif HAS_SPI_LCD - - #error "Marlin's Smoothieboard support cannot drive your LCD." - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h deleted file mode 100644 index c2d7d478f1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ /dev/null @@ -1,177 +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 - -/** - * TH3D EZBoard pin assignments - */ - -#ifndef MCU_LPC1769 - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#endif - -#define BOARD_INFO_NAME "TH3D EZBoard" -#define BOARD_WEBSITE_URL "th3dstudio.com" - -// -// Servos -// -#define SERVO0_PIN P2_04 - -// -// Limit Switches -// -#define X_STOP_PIN P1_24 -#define Y_STOP_PIN P1_25 -#define Z_STOP_PIN P1_26 - -// -// Filament Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P1_27 -#endif - -// -// Steppers -// -#define X_STEP_PIN P2_00 -#define X_DIR_PIN P1_16 -#define X_ENABLE_PIN P1_17 - -#define Y_STEP_PIN P2_01 -#define Y_DIR_PIN P1_10 -#define Y_ENABLE_PIN P1_09 - -#define Z_STEP_PIN P2_02 -#define Z_DIR_PIN P1_15 -#define Z_ENABLE_PIN P1_14 - -#define E0_STEP_PIN P2_03 -#define E0_DIR_PIN P1_04 -#define E0_ENABLE_PIN P1_08 - -#define E1_STEP_PIN P2_08 -#define E1_DIR_PIN P2_13 -#define E1_ENABLE_PIN P4_29 - -#if HAS_DRIVER(TMC2208) - // - // TMC2208 stepper drivers - // Software serial - // - #define X_SERIAL_TX_PIN P0_04 - #define X_SERIAL_RX_PIN P0_05 - #define Y_SERIAL_TX_PIN P0_10 - #define Y_SERIAL_RX_PIN P0_11 - #define Z_SERIAL_TX_PIN P0_19 - #define Z_SERIAL_RX_PIN P0_20 - #define E0_SERIAL_TX_PIN P0_22 - #define E0_SERIAL_RX_PIN P0_21 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temp Sensors -// 3.3V max when defined as an Analog Input! -// -#if TEMP_SENSOR_0 == 20 // PT100 Adapter - #define TEMP_0_PIN P0_02_A7 // Analog Input -#else - #define TEMP_0_PIN P0_23_A0 // Analog Input P0_23 -#endif - -#define TEMP_BED_PIN P0_24_A1 // Analog Input P0_24 -#define TEMP_1_PIN P0_25_A2 // Analog Input P0_25 - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #define FILWIDTH_PIN P0_26_A3 // Analog Input P0_26 -#else - #define TEMP_2_PIN P0_26_A3 // Analog Input P0_26 -#endif - -// -// Heaters / Fans -// -#define HEATER_BED_PIN P2_05 -#define HEATER_0_PIN P2_07 -#ifndef FAN_PIN - #define FAN_PIN P2_06 -#endif -#define FAN1_PIN P1_22 - -// -// Auto fans -// -#define AUTO_FAN_PIN P1_22 // FET 3 -#define ORIG_E0_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E1_AUTO_FAN_PIN AUTO_FAN_PIN -#define ORIG_E2_AUTO_FAN_PIN AUTO_FAN_PIN - -// -// SD Card -// - -#define SDCARD_CONNECTION ONBOARD - -#define SCK_PIN P0_07 -#define MISO_PIN P0_08 -#define MOSI_PIN P0_09 -#define ONBOARD_SD_CS_PIN P0_06 -#define SS_PIN ONBOARD_SD_CS_PIN - -// -// LCD / Controller -// - -/** - * _____ - * 5V | · · | GND - * (LCD_EN) P0_18 | · · | P0_16 (LCD_RS) - * (LCD_D4) P0_15 | · · | P3_25 (BTN_EN2) - * (RESET) P2_11 | · · | P3_26 (BTN_EN1) - * (BTN_ENC) P1_30 | · · | P1_31 (BEEPER) - * ----- - * EXP1 - * - * LCD_PINS_D5, D6, and D7 are not present in the EXP1 connector, and will need to be - * defined to use the REPRAP_DISCOUNT_SMART_CONTROLLER. - * - * A remote SD card is currently not supported because the pins routed to the EXP2 - * connector are shared with the onboard SD card. - * - */ - -#if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN P1_31 - #define BTN_EN1 P3_26 - #define BTN_EN2 P3_25 - #define BTN_ENC P1_30 - #define LCD_PINS_RS P0_16 - #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_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONIC.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONIC.h deleted file mode 100644 index e49207a42a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONIC.h +++ /dev/null @@ -1,80 +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 - -/** - * Cheaptronic v1.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Cheaptronic v1.0" -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 2 -#define Z_STOP_PIN 5 - -// -// Steppers -// -#define X_STEP_PIN 14 -#define X_DIR_PIN 15 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 35 -#define Y_DIR_PIN 36 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 41 -#define Z_ENABLE_PIN 37 - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 25 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 // Analog Input -#define TEMP_1_PIN 14 // Analog Input -#define TEMP_BED_PIN 13 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 19 // EXTRUDER 1 -#define HEATER_1_PIN 23 // EXTRUDER 2 -#define HEATER_BED_PIN 22 - -// -// LCD / Controller -// -// Cheaptronic v1.0 doesn't support LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h deleted file mode 100644 index f2df6e1ecb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h +++ /dev/null @@ -1,136 +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 - -/** - * Cheaptronic v2.0 pin assignments - * Built and sold by Michal Dyntar - RRO - * www.reprapobchod.cz - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Cheaptronic v2.0" - -// -// Limit Switches -// -#define X_MIN_PIN 30 -#define X_MAX_PIN 31 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 33 -#define Z_MIN_PIN 34 -#define Z_MAX_PIN 35 - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 22 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 25 -#define E1_ENABLE_PIN 27 - -#define E2_STEP_PIN 29 -#define E2_DIR_PIN 28 -#define E2_ENABLE_PIN 39 - -// -// Temperature sensors -// -#define TEMP_0_PIN 15 -#define TEMP_1_PIN 13 -#define TEMP_2_PIN 14 -#define TEMP_3_PIN 11 // should be used for chamber temperature control -#define TEMP_BED_PIN 12 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 6 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 9 -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif -#define FAN2_PIN 58 // additional fan or light control output - -// -// Other board specific pins -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 37 // board input labeled as F-DET -#endif -#define Z_MIN_PROBE_PIN 36 // additional external board input labeled as E-SENS (should be used for Z-probe) -#define LED_PIN 13 -#define SPINDLE_ENABLE_PIN 4 // additional PWM pin 1 at JP1 connector - should be used for laser control too -#define EXT_2 5 // additional PWM pin 2 at JP1 connector -#define EXT_3 2 // additional PWM pin 3 at JP1 connector -#define PS_ON_PIN 45 -#define KILL_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // shared with TEMP_3 analog input -#endif - -// -// LCD / Controller -// -#define LCD_PINS_RS 19 -#define LCD_PINS_ENABLE 42 -#define LCD_PINS_D4 18 -#define LCD_PINS_D5 38 -#define LCD_PINS_D6 41 -#define LCD_PINS_D7 40 - -// -// Beeper, SD Card, Encoder -// -#define BEEPER_PIN 44 - -#if ENABLED(SDSUPPORT) - #define SDSS 53 - #define SD_DETECT_PIN 49 -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 11 - #define BTN_EN2 12 - #define BTN_ENC 43 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_11.h deleted file mode 100644 index 3915c1cfed..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * CartesioV11 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "CN Controls V11" - -// -// Limit Switches -// -#define X_STOP_PIN 43 -#define Y_STOP_PIN 45 -#define Z_STOP_PIN 42 - -// -// Steppers -// -#define X_STEP_PIN 34 -#define X_DIR_PIN 36 -#define X_ENABLE_PIN 35 - -#define Y_STEP_PIN 37 -#define Y_DIR_PIN 39 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 40 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 41 - -#define E0_STEP_PIN 29 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 3 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 15 -#define E2_DIR_PIN 14 -#define E2_ENABLE_PIN 16 - -#define E3_STEP_PIN 44 -#define E3_DIR_PIN 49 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 3 // Analog Input. 3 for tool2 -> 2 for chambertemp -#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 - -#ifndef TEMP_CHAMBER_PIN - //#define TEMP_CHAMBER_PIN 2 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 5 -#define HEATER_1_PIN 58 -#define HEATER_2_PIN 64 -#define HEATER_3_PIN 46 -#define HEATER_BED_PIN 2 - -#ifndef FAN_PIN - //#define FAN_PIN 7 // common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 13 - -// Tools - -//#define TOOL_0_PIN 4 -//#define TOOL_1_PIN 59 -//#define TOOL_2_PIN 8 -//#define TOOL_3_PIN 30 -//#define TOOL_PWM_PIN 7 // common PWM pin for all tools - -// Common I/O - -//#define FIL_RUNOUT_PIN -1 -//#define PWM_1_PIN 11 -//#define PWM_2_PIN 10 -//#define SPARE_IO 12 - -// -// LCD / Controller -// -#define BEEPER_PIN 6 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 26 -#define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 -#define DOGLCD_SCK -1 - -#define BTN_EN1 23 -#define BTN_EN2 25 -#define BTN_ENC 27 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 19 -#define SHIFT_LD 18 -#define SHIFT_CLK 17 - -//#define UI1 31 -//#define UI2 22 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 31 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_12.h deleted file mode 100644 index b9a96c410b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * CartesioV12 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "CN Controls V12" - -// -// Limit Switches -// -#define X_STOP_PIN 19 -#define Y_STOP_PIN 22 -#define Z_STOP_PIN 23 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 26 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 30 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 31 -#define Z_DIR_PIN 33 -#define Z_ENABLE_PIN 32 - -#define E0_STEP_PIN 57 -#define E0_DIR_PIN 55 -#define E0_ENABLE_PIN 58 - -#define E1_STEP_PIN 61 -#define E1_DIR_PIN 62 -#define E1_ENABLE_PIN 60 - -#define E2_STEP_PIN 46 -#define E2_DIR_PIN 66 -#define E2_ENABLE_PIN 44 - -#define E3_STEP_PIN 45 -#define E3_DIR_PIN 69 -#define E3_ENABLE_PIN 47 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 9 // Analog Input. 9 for tool2 -> 13 for chambertemp -#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 - -#ifndef TEMP_CHAMBER_PIN - //#define TEMP_CHAMBER_PIN 13 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 11 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 3 -#define HEATER_BED_PIN 24 - -#ifndef FAN_PIN - #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools -#endif - -#define ORIG_E0_AUTO_FAN_PIN 7 -#define ORIG_E1_AUTO_FAN_PIN 7 -#define ORIG_E2_AUTO_FAN_PIN 7 -#define ORIG_E3_AUTO_FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 15 - -// Tools - -//#define TOOL_0_PIN 56 -//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder -//#define TOOL_1_PIN 59 -//#define TOOL_1_PWM_PIN 8 // lights at dual extruder -//#define TOOL_2_PIN 4 -//#define TOOL_2_PWM_PIN 5 -//#define TOOL_3_PIN 14 -//#define TOOL_3_PWM_PIN 2 - -// Common I/O - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 18 -#endif -//#define PWM_1_PIN 12 -//#define PWM_2_PIN 13 -//#define SPARE_IO 17 - -// -// LCD / Controller -// -#define BEEPER_PIN 16 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 39 -#define DOGLCD_CS 35 -#define DOGLCD_MOSI 48 -#define DOGLCD_SCK 49 -#define LCD_SCREEN_ROT_180 - -// The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 - -// Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 42 -#define SHIFT_LD 41 -#define SHIFT_CLK 40 - -//#define UI1 43 -//#define UI2 37 - -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_15.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_15.h deleted file mode 100644 index 2fad8d576e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_CNCONTROLS_15.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * CNControls V15 for HMS434 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "CN Controls V15" - -// -// Servos -// -#define SERVO0_PIN 6 - -// -// Limit Switches -// -#define X_STOP_PIN 34 -#define Y_STOP_PIN 39 -#define Z_STOP_PIN 62 - -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 49 -#endif - -// -// Steppers -// -#define X_STEP_PIN 14 -#define X_DIR_PIN 25 -#define X_ENABLE_PIN 26 - -#define Y_STEP_PIN 11 -#define Y_DIR_PIN 12 -#define Y_ENABLE_PIN 15 - -#define Z_STEP_PIN 24 -#define Z_DIR_PIN 27 -#define Z_ENABLE_PIN 28 - -#define E0_STEP_PIN 64 -#define E0_DIR_PIN 65 -#define E0_ENABLE_PIN 63 - -// -// Temperature Sensors -// Analog Inputs -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 4 // Analog Input - -#ifndef TEMP_CHAMBER_PIN - #define TEMP_CHAMBER_PIN 5 // Analog Input -#endif - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 32 -#define HEATER_CHAMBER_PIN 33 - -// -// Fans -// -#define FAN0_PIN 8 -#define ORIG_E0_AUTO_FAN_PIN 30 -#define ORIG_E1_AUTO_FAN_PIN 30 -#define ORIG_E2_AUTO_FAN_PIN 30 -#define ORIG_E3_AUTO_FAN_PIN 30 -//#define ORIG_CHAMBER_AUTO_FAN_PIN 10 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 40 - -// Common I/O - -#define FIL_RUNOUT_PIN 9 -//#define FIL_RUNOUT_PIN 29 // encoder sensor -//#define PWM_1_PIN 12 -//#define PWM_2_PIN 13 -//#define SPARE_IO 17 -#define BEEPER_PIN 13 -#define STAT_LED_BLUE_PIN -1 -#define STAT_LED_RED_PIN 10 // 31 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_EINSTART-S.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_EINSTART-S.h deleted file mode 100644 index fae1d2e94d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_EINSTART-S.h +++ /dev/null @@ -1,113 +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 - -/** - * Einstart-S pin assignments - * PCB Silkscreen: 3DPrinterCon_v3.5 - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Einstart-S" - -// -// Limit Switches -// -#define X_STOP_PIN 44 -#define Y_STOP_PIN 43 -#define Z_STOP_PIN 42 - -// -// Steppers -// -#define X_STEP_PIN 76 -#define X_DIR_PIN 75 -#define X_ENABLE_PIN 73 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 32 -#define Y_ENABLE_PIN 72 - -#define Z_STEP_PIN 34 -#define Z_DIR_PIN 35 -#define Z_ENABLE_PIN 33 - -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 37 -#define E0_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 83 -#define HEATER_BED_PIN 38 - -#define FAN_PIN 82 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 4 - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -// -// LCD Display output pins -// - -// Requires #define U8GLIB_SH1106_EINSTART in Configuration.h -// u8glib constructor -// U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS); - -#define LCD_PINS_DC 78 -#define LCD_PINS_RS 79 -// DOGM SPI LCD Support -#define DOGLCD_CS 3 -#define DOGLCD_MOSI 2 -#define DOGLCD_SCK 5 -#define DOGLCD_A0 2 - -// -// LCD Display input pins -// -#define BTN_UP 25 -#define BTN_DWN 26 -#define BTN_LFT 27 -#define BTN_RT 28 - -// 'OK' button -#define BTN_ENC 29 - -// Set Kill to right arrow, same as RIGID_PANEL -#define KILL_PIN 28 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_ELEFU_3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_ELEFU_3.h deleted file mode 100644 index 5b43acab10..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_ELEFU_3.h +++ /dev/null @@ -1,152 +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 - -/** - * Elefu RA Board Pin Assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Elefu Ra v3" - -// -// Limit Switches -// -#define X_MIN_PIN 35 -#define X_MAX_PIN 34 -#define Y_MIN_PIN 33 -#define Y_MAX_PIN 32 -#define Z_MIN_PIN 31 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 49 -#define X_DIR_PIN 13 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 11 -#define Y_DIR_PIN 9 -#define Y_ENABLE_PIN 12 - -#define Z_STEP_PIN 7 -#define Z_DIR_PIN 6 -#define Z_ENABLE_PIN 8 - -#define E0_STEP_PIN 40 -#define E0_DIR_PIN 41 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 18 -#define E1_DIR_PIN 19 -#define E1_ENABLE_PIN 38 - -#define E2_STEP_PIN 43 -#define E2_DIR_PIN 47 -#define E2_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 3 // Analog Input -#define TEMP_1_PIN 2 // Analog Input -#define TEMP_2_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 45 // 12V PWM1 -#define HEATER_1_PIN 46 // 12V PWM2 -#define HEATER_2_PIN 17 // 12V PWM3 -#define HEATER_BED_PIN 44 // DOUBLE 12V PWM - -#ifndef FAN_PIN - #define FAN_PIN 16 // 5V PWM -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 10 // Set to -1 if using a manual switch on the PWRSW Connector -#define SLEEP_WAKE_PIN 26 // This feature still needs work -#define PHOTOGRAPH_PIN 29 - -// -// LCD / Controller -// -#define BEEPER_PIN 36 - -#if ENABLED(RA_CONTROL_PANEL) - - #define SDSS 53 - #define SD_DETECT_PIN 28 - - #define BTN_EN1 14 - #define BTN_EN2 39 - #define BTN_ENC 15 - -#endif // RA_CONTROL_PANEL - -#if ENABLED(RA_DISCO) - // variables for which pins the TLC5947 is using - #define TLC_CLOCK_PIN 25 - #define TLC_BLANK_PIN 23 - #define TLC_XLAT_PIN 22 - #define TLC_DATA_PIN 24 - - // We also need to define pin to port number mapping for the 2560 to match the pins listed above. - // If you change the TLC pins, update this as well per the 2560 datasheet! This currently only works with the RA Board. - #define TLC_CLOCK_BIT 3 - #define TLC_CLOCK_PORT &PORTA - - #define TLC_BLANK_BIT 1 - #define TLC_BLANK_PORT &PORTA - - #define TLC_DATA_BIT 2 - #define TLC_DATA_PORT &PORTA - - #define TLC_XLAT_BIT 0 - #define TLC_XLAT_PORT &PORTA - - // Change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful - // Leave it at at least 1 if you have enabled RA_LIGHTING - // The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module. - #define NUM_TLCS 2 - - // These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. - // Modify them according to your specific situation. - // NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs. - #define TRANS_ARRAY { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8 } // forward - //#define TRANS_ARRAY { 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15 } // backward -#endif // RA_DISCO diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A.h deleted file mode 100644 index 16bd5688df..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ /dev/null @@ -1,141 +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 - -/** - * Geeetech GT2560 Revision A board pin assignments, based on the work of - * George Robles (https://georges3dprinters.com) and - * Richard Smith - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "GT2560 Rev.A" -#endif -#define DEFAULT_MACHINE_NAME "Prusa i3 Pro B" - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 -#define TEMP_1_PIN 9 -#define TEMP_BED_PIN 10 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing -#define KILL_PIN -1 - -#if HAS_SPI_LCD - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 5 - #define DOGLCD_CS 21 - #define BTN_EN1 40 - #define BTN_EN2 42 - #else - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - #define BTN_EN1 42 - #define BTN_EN2 40 - #endif - - #define BTN_ENC 19 - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h deleted file mode 100644 index c5c894810b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h +++ /dev/null @@ -1,36 +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 - -/** - * Geeetech GT2560 Revision A+ board pin assignments - */ - -#define BOARD_INFO_NAME "GT2560 Rev.A+" - -#include "pins_GT2560_REV_A.h" - -#if ENABLED(BLTOUCH) - #define SERVO0_PIN 11 -#else - #define SERVO0_PIN 32 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3.h deleted file mode 100644 index 0534ba0620..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3.h +++ /dev/null @@ -1,185 +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 - -/** - * GT2560 V3.0 pin assignment - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "GT2560 V3.0" -#endif - -// -// Servos -// -#define SERVO0_PIN 11 //13 untested 3Dtouch - -// -// Limit Switches -// -#ifndef X_STOP_PIN - #ifndef X_MIN_PIN - #define X_MIN_PIN 24 - #endif - #ifndef X_MAX_PIN - #define X_MAX_PIN 22 - #endif -#endif -#ifndef Y_STOP_PIN - #ifndef Y_MIN_PIN - #define Y_MIN_PIN 28 - #endif - #ifndef Y_MAX_PIN - #define Y_MAX_PIN 26 - #endif -#endif -#ifndef Z_STOP_PIN - #ifndef Z_MIN_PIN - #define Z_MIN_PIN 30 - #endif - #ifndef Z_MAX_PIN - #define Z_MAX_PIN 32 - #endif -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 66 -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN 67 -#endif - -// -// Power Recovery -// -#define POWER_LOSS_PIN 69 // Pin to detect power loss -#define POWER_LOSS_STATE LOW - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 39 -#define X_ENABLE_PIN 35 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 25 -#define Z_DIR_PIN 23 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 46 -#define E0_DIR_PIN 44 -#define E0_ENABLE_PIN 12 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -#define E2_STEP_PIN 43 -#define E2_DIR_PIN 45 -#define E2_ENABLE_PIN 41 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 11 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_2_PIN 1 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 3 -#define HEATER_2_PIN 1 -#define HEATER_BED_PIN 4 -#define FAN_PIN 9 -//#define FAN1_PIN 8 -//#define FAN2_PIN 7 - -// -// Misc. Functions -// -#define SD_DETECT_PIN 38 -#define SDSS 53 -#define LED_PIN 6 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // This pin must be enabled at boot to keep power flowing - -#ifndef CASE_LIGHT_PIN - #define CASE_LIGHT_PIN 6 // 21 -#endif - -// -// LCD Controller -// -#define BEEPER_PIN 18 - -#ifndef LCD_PINS_RS - #define LCD_PINS_RS 20 -#endif -#ifndef LCD_PINS_ENABLE - #define LCD_PINS_ENABLE 17 -#endif -#ifndef LCD_PINS_D4 - #define LCD_PINS_D4 16 -#endif -#ifndef LCD_PINS_D5 - #define LCD_PINS_D5 21 -#endif -#ifndef LCD_PINS_D6 - #define LCD_PINS_D6 5 -#endif -#ifndef LCD_PINS_D7 - #define LCD_PINS_D7 36 -#endif - -#if ENABLED(NEWPANEL) - #ifndef BTN_EN1 - #define BTN_EN1 42 - #endif - #ifndef BTN_EN2 - #define BTN_EN2 40 - #endif - #ifndef BTN_ENC - #define BTN_ENC 19 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_A20.h deleted file mode 100644 index e3b6895af1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_A20.h +++ /dev/null @@ -1,39 +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 - -/** - * Geeetech A20M pin assignment - */ - -#define LCD_PINS_RS 5 -#define LCD_PINS_ENABLE 36 -#define LCD_PINS_D4 21 -#define LCD_PINS_D7 6 - -#if ENABLED(NEWPANEL) - #define BTN_EN1 16 - #define BTN_EN2 17 - #define BTN_ENC 19 -#endif - -#include "pins_GT2560_V3.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h deleted file mode 100644 index afdcad3435..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h +++ /dev/null @@ -1,35 +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 - -/***************************************************************** - * GT2560 V3.0 pin assignment (for Mecreator 2) - *****************************************************************/ - -#define BOARD_INFO_NAME "GT2560 V3.0 (MC2)" - -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 - -#include "pins_GT2560_V3.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_HJC2560C_REV2.h deleted file mode 100644 index a39162dded..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ /dev/null @@ -1,170 +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 - -/** - * HJC2560-C Rev2.x pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define DEFAULT_MACHINE_NAME "ADIMLab Gantry v2" -#define BOARD_INFO_NAME "HJC2560-C" - -// -// Servos -// -//#ifndef SERVO0_PIN -// #define SERVO0_PIN 11 -//#endif - -// -// Limit Switches -// -#define X_STOP_PIN 22 -#define Y_STOP_PIN 26 -#define Z_STOP_PIN 29 -//#define EXP_STOP_PIN 28 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 32 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 36 -#define Z_ENABLE_PIN 34 - -#define E0_STEP_PIN 42 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -#define MOTOR_CURRENT_PWM_XY_PIN 44 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 46 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT { 1300, 1300, 1250 } - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 //默认不使用PWM_FAN冷却喷嘴,如果需要,则取消注释 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 39 -//#define LED_PIN 8 -#define CASE_LIGHT_PIN 8 // 8 默认挤出机风扇作为Case LED,如果需要PWM FAN,则需要将FAN_PIN置为7,LED_PIN置为8 - -//#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered -//#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) - #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! - #define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 // LCD_CS - #define LCD_PINS_ENABLE 15 // LCD_SDA - #define LCD_PINS_D4 14 // LCD_SCK - - #if ENABLED(HJC_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 5 // LCD_Backlight - //#ifndef LCD_CONTRAST_PIN - // #define LCD_CONTRAST_PIN 5 // LCD_Contrast - //#endif - #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 24 // Filament runout - #endif - #else - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - #endif - - #define BTN_EN1 41 - #define BTN_EN2 40 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 39 - - #else - - // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #endif // !NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_LEAPFROG.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_LEAPFROG.h deleted file mode 100644 index 56eec5e97e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_LEAPFROG.h +++ /dev/null @@ -1,92 +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 - -/** - * Leapfrog Driver board pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Leapfrog" - -// -// Limit Switches -// -#define X_MIN_PIN 47 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 48 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 49 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 28 -#define X_DIR_PIN 63 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 14 // A6 -#define Y_DIR_PIN 15 // A0 -#define Y_ENABLE_PIN 39 - -#define Z_STEP_PIN 31 // A2 -#define Z_DIR_PIN 32 // A6 -#define Z_ENABLE_PIN 30 // A1 - -#define E0_STEP_PIN 34 // 34 -#define E0_DIR_PIN 35 // 35 -#define E0_ENABLE_PIN 33 // 33 - -#define E1_STEP_PIN 37 // 37 -#define E1_DIR_PIN 40 // 40 -#define E1_ENABLE_PIN 36 // 36 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input (D27) -#define TEMP_1_PIN 15 // Analog Input (1) -#define TEMP_BED_PIN 14 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 // 12 -#define HEATER_2_PIN 11 // 13 -#define HEATER_BED_PIN 10 // 14/15 - -#define FAN_PIN 7 - -// -// Misc. Functions -// -#define SDSS 11 -#define LED_PIN 13 -#define SOL1_PIN 16 -#define SOL2_PIN 17 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGACONTROLLER.h deleted file mode 100644 index 473e79b276..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ /dev/null @@ -1,164 +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 - -/** - * Mega controller pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Mega Controller" - -// -// Servos -// -#define SERVO0_PIN 30 -#define SERVO1_PIN 31 -#define SERVO2_PIN 32 -#define SERVO3_PIN 33 - -// -// Limit Switches -// -#define X_MIN_PIN 43 -#define X_MAX_PIN 42 -#define Y_MIN_PIN 38 -#define Y_MAX_PIN 41 -#define Z_MIN_PIN 40 -#define Z_MAX_PIN 37 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 37 -#endif - -// -// Steppers -// -#define X_STEP_PIN 62 // A8 -#define X_DIR_PIN 63 // A9 -#define X_ENABLE_PIN 61 // A7 - -#define Y_STEP_PIN 65 // A11 -#define Y_DIR_PIN 66 // A12 -#define Y_ENABLE_PIN 64 // A10 - -#define Z_STEP_PIN 68 // A14 -#define Z_DIR_PIN 69 // A15 -#define Z_ENABLE_PIN 67 // A13 - -#define E0_STEP_PIN 23 -#define E0_DIR_PIN 24 -#define E0_ENABLE_PIN 22 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 27 -#define E1_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 0 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input -#else - #define TEMP_1_PIN 2 // Analog Input -#endif - -#define TEMP_2_PIN 3 // Analog Input - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 6 // Analog Input -#else - #define TEMP_BED_PIN 1 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 29 -#define HEATER_1_PIN 34 -#define HEATER_BED_PIN 28 - -#ifndef FAN_PIN - #define FAN_PIN 39 -#endif -#define FAN1_PIN 35 -#define FAN2_PIN 36 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN FAN2_PIN -#endif - -#define FAN_SOFT_PWM - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#if ENABLED(MINIPANEL) - - #define BEEPER_PIN 46 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 47 - #define DOGLCD_CS 45 - #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 - - #define KILL_PIN 12 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 48 - #define BTN_EN2 11 - #define BTN_ENC 10 - - #define SD_DETECT_PIN 49 - -#endif // MINIPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 7 // Pullup! -#define SPINDLE_DIR_PIN 8 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS.h deleted file mode 100644 index 6433757867..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS.h +++ /dev/null @@ -1,131 +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 - -/** - * MegaTronics pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Megatronics" -// -// Limit Switches -// -#define X_MIN_PIN 41 -#define X_MAX_PIN 37 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 60 // A6 -#define Y_DIR_PIN 61 // A7 -#define Y_ENABLE_PIN 22 - -#define Z_STEP_PIN 54 // A0 -#define Z_DIR_PIN 55 // A1 -#define Z_ENABLE_PIN 56 // A2 - -#define E0_STEP_PIN 31 -#define E0_DIR_PIN 32 -#define E0_ENABLE_PIN 38 - -#define E1_STEP_PIN 34 -#define E1_DIR_PIN 36 -#define E1_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 8 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 // IO pin. Buffer needed -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// LCD / Controller -// -#define BEEPER_PIN 33 - -#if BOTH(ULTRA_LCD, NEWPANEL) - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - // Buttons directly attached to AUX-2 - #define BTN_EN1 59 - #define BTN_EN2 64 - #define BTN_ENC 43 - - #define SD_DETECT_PIN -1 // RAMPS doesn't use this - -#endif // HAS_SPI_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 4 // Pullup! -#define SPINDLE_DIR_PIN 11 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_2.h deleted file mode 100644 index 4cd5999604..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_2.h +++ /dev/null @@ -1,152 +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 - -/** - * MegaTronics v2.0 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Megatronics v2.0" -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 27 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 4 // A6 -#define Y_DIR_PIN 54 // A0 -#define Y_ENABLE_PIN 5 - -#define Z_STEP_PIN 56 // A2 -#define Z_DIR_PIN 60 // A6 -#define Z_ENABLE_PIN 55 // A1 - -#define E0_STEP_PIN 35 -#define E0_DIR_PIN 36 -#define E0_ENABLE_PIN 34 - -#define E1_STEP_PIN 29 -#define E1_DIR_PIN 39 -#define E1_ENABLE_PIN 28 - -#define E2_STEP_PIN 23 // ? schematic says 24 -#define E2_DIR_PIN 24 // ? schematic says 23 -#define E2_ENABLE_PIN 22 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 4 // Analog Input -#else - #define TEMP_0_PIN 13 // Analog Input -#endif - -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 8 // Analog Input -#else - #define TEMP_1_PIN 15 // Analog Input -#endif - -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 2 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 3 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 16 // Pullup! -#define SPINDLE_DIR_PIN 11 - -// -// LCD / Controller -// -#define BEEPER_PIN 64 - -#if HAS_SPI_LCD - - #define LCD_PINS_RS 14 - #define LCD_PINS_ENABLE 15 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 31 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 33 - - #if ENABLED(NEWPANEL) - // Buttons are directly attached using keypad - #define BTN_EN1 61 - #define BTN_EN2 59 - #define BTN_ENC 43 - #else - // Buttons attached to shift register of reprapworld keypad v1.1 - #define SHIFT_CLK 63 - #define SHIFT_LD 42 - #define SHIFT_OUT 17 - #define SHIFT_EN 17 - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_3.h deleted file mode 100644 index a33b2ecfc5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MEGATRONICS_3.h +++ /dev/null @@ -1,195 +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 - -/** - * MegaTronics v3.0 / v3.1 / v3.2 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if MB(MEGATRONICS_32) - #define BOARD_INFO_NAME "Megatronics v3.2" -#elif MB(MEGATRONICS_31) - #define BOARD_INFO_NAME "Megatronics v3.1" -#else - #define BOARD_INFO_NAME "Megatronics v3.0" -#endif - -// -// Servos -// -#define SERVO0_PIN 46 // AUX3-6 -#define SERVO1_PIN 47 // AUX3-5 -#define SERVO2_PIN 48 // AUX3-4 -#define SERVO3_PIN 49 // AUX3-3 - -// -// Limit Switches -// -#define X_MIN_PIN 37 // No INT -#define X_MAX_PIN 40 // No INT -#define Y_MIN_PIN 41 // No INT -#define Y_MAX_PIN 38 // No INT -#define Z_MIN_PIN 18 // No INT -#define Z_MAX_PIN 19 // No INT - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 58 -#define X_DIR_PIN 57 -#define X_ENABLE_PIN 59 - -#define Y_STEP_PIN 5 -#define Y_DIR_PIN 17 -#define Y_ENABLE_PIN 4 - -#define Z_STEP_PIN 16 -#define Z_DIR_PIN 11 -#define Z_ENABLE_PIN 3 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 29 - -#define E1_STEP_PIN 25 -#define E1_DIR_PIN 24 -#define E1_ENABLE_PIN 26 - -#define E2_STEP_PIN 22 -#define E2_DIR_PIN 60 -#define E2_ENABLE_PIN 23 - -// -// Temperature Sensors -// -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 11 // Analog Input -#else - #define TEMP_0_PIN 15 // Analog Input -#endif -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 10 // Analog Input -#else - #define TEMP_1_PIN 13 // Analog Input -#endif -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 9 // Analog Input -#else - #define TEMP_2_PIN 12 // Analog Input -#endif -#if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 8 // Analog Input -#else - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 9 -#define HEATER_2_PIN 8 -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif -#define FAN1_PIN 7 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define CASE_LIGHT_PIN 45 // Try the keypad connector - -// -// LCD / Controller -// -#define BEEPER_PIN 61 - -#define BTN_EN1 44 -#define BTN_EN2 45 -#define BTN_ENC 33 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 56 // CS chip select / SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #define SD_DETECT_PIN 35 - -#else - - #define LCD_PINS_RS 32 - #define LCD_PINS_ENABLE 31 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 30 - #define LCD_PINS_D6 39 - #define LCD_PINS_D7 15 - - #define SHIFT_CLK 43 - #define SHIFT_LD 35 - #define SHIFT_OUT 34 - #define SHIFT_EN 44 - - #if MB(MEGATRONICS_31, MEGATRONICS_32) - #define SD_DETECT_PIN 56 - #endif - -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 43 // Pullup! - #define SPINDLE_DIR_PIN 42 -#elif EXTRUDERS <= 2 - // Hijack the last extruder so that we can get the PWM signal off the Y breakout - // Move Y to the E2 plug. This makes dual Y steppers harder - #undef Y_ENABLE_PIN // 4 - #undef Y_STEP_PIN // 5 - #undef Y_DIR_PIN // 17 - #undef E2_ENABLE_PIN // 23 - #undef E2_STEP_PIN // 22 - #undef E2_DIR_PIN // 60 - #define Y_ENABLE_PIN 23 - #define Y_STEP_PIN 22 - #define Y_DIR_PIN 60 - #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 17 // Pullup! - #define SPINDLE_DIR_PIN 5 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h deleted file mode 100644 index 703d5caae0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ /dev/null @@ -1,298 +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 - -/** - * Mightyboard Rev.E pin assignments - * also works for Rev D boards. It's all rev E despite what the silk screen says - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - * - * Corrected pin assignment for EX2_HEAT_PIN pin. Changed it from 9 to 11. The port - * number (B5) agrees with the schematic but B5 is assigned to logical pin 11. - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Mightyboard" -#define DEFAULT_MACHINE_NAME "MB Replicator" - -// -// Servos -// -#define SERVO0_PIN 36 // C1 (1280-EX1) -#define SERVO1_PIN 37 // C0 (1280-EX2) -#define SERVO2_PIN 40 // G1 (1280-EX3) -#define SERVO3_PIN 41 // G0 (1280-EX4) - -// -// Limit Switches -// -#define X_MIN_PIN 49 // L0 -#define X_MAX_PIN 48 // L1 -#define Y_MIN_PIN 47 // L2 -#define Y_MAX_PIN 46 // L3 -#define Z_MIN_PIN 43 // L6 -#define Z_MAX_PIN 42 // L7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 42 -#endif - -// -// Filament Runout Pins -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 49 -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN 47 -#endif - -// -// Steppers -// -#define X_STEP_PIN 55 // F1 -#define X_DIR_PIN 54 // F0 -#define X_ENABLE_PIN 56 // F2 - -#define Y_STEP_PIN 59 // F5 -#define Y_DIR_PIN 58 // F4 -#define Y_ENABLE_PIN 60 // F6 - -#define Z_STEP_PIN 63 // K1 -#define Z_DIR_PIN 62 // K0 -#define Z_ENABLE_PIN 64 // K2 - -#define E0_STEP_PIN 25 // A3 -#define E0_DIR_PIN 24 // A2 -#define E0_ENABLE_PIN 26 // A4 - -#define E1_STEP_PIN 29 // A7 -#define E1_DIR_PIN 28 // A6 -#define E1_ENABLE_PIN 39 // G2 - -// -// I2C Digipots - MCP4018 -// Address 5E (2F << 1) -// Set from 0 - 127 with stop bit. -// (Ex. 3F << 1 | 1) -// -#define DIGIPOTS_I2C_SCL 76 // J5 -#define DIGIPOTS_I2C_SDA_X 57 // F3 -#define DIGIPOTS_I2C_SDA_Y 61 // F7 -#define DIGIPOTS_I2C_SDA_Z 65 // K3 -#define DIGIPOTS_I2C_SDA_E0 27 // A5 -#define DIGIPOTS_I2C_SDA_E1 77 // J6 - -#ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) -#endif - -// -// Temperature Sensors -// -// K7 - 69 / ADC15 - 15 -#define TEMP_BED_PIN 15 - -// SPI for Max6675 or Max31855 Thermocouple -// Uses a separate SPI bus -// -// 3 E5 DO (SO) -// 5 E3 CS1 -// 2 E4 CS2 -// 78 E2 SCK -// -#define THERMO_SCK_PIN 78 // E2 -#define THERMO_DO_PIN 3 // E5 -#define THERMO_CS1_PIN 5 // E3 -#define THERMO_CS2_PIN 2 // E4 - -#define MAX6675_SS_PIN THERMO_CS1_PIN -#define MAX6675_SS2_PIN THERMO_CS2_PIN -#define MAX6675_SCK_PIN THERMO_SCK_PIN -#define MAX6675_DO_PIN THERMO_DO_PIN - -// -// Augmentation for auto-assigning plugs -// -// Two thermocouple connectors allows for either -// 2 extruders or 1 extruder and a heated bed. -// With no heated bed, an additional 24V fan is possible. -// - -// Labels from the schematic: -#define EX1_HEAT_PIN 6 // H3 -#define EX1_FAN_PIN 7 // H4 -#define EX2_HEAT_PIN 11 // B5 -#define EX2_FAN_PIN 12 // B6 -#define HBP_PIN 45 // L4 -#define EXTRA_FET_PIN 44 // L5 - -#if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_EEB - #else - #define IS_EEF - #endif -#elif TEMP_SENSOR_BED - #define IS_EFB -#else - #define IS_EFF -#endif - -// -// Heaters / Fans (24V) -// -#define HEATER_0_PIN EX1_HEAT_PIN - -#if ENABLED(IS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN HBP_PIN -#elif ENABLED(IS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN EX2_HEAT_PIN -#elif ENABLED(IS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN EX2_HEAT_PIN - #define HEATER_BED_PIN HBP_PIN -#elif ENABLED(IS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN HBP_PIN -#endif - -#ifndef FAN_PIN - #if EITHER(IS_EFB, IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN EX2_HEAT_PIN - #elif EITHER(IS_EEF, IS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN HBP_PIN - #else - #define FAN_PIN EXTRA_FET_PIN - #endif -#endif - -// -// Misc. Functions -// -#define LED_PIN 13 // B7 -#define CUTOFF_RESET_PIN 16 // H1 -#define CUTOFF_TEST_PIN 17 // H0 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - #define LCD_PINS_RS 33 // C4: LCD-STROBE - #define LCD_PINS_ENABLE 72 // J2: LEFT - #define LCD_PINS_D4 35 // C2: LCD-CLK - #define LCD_PINS_D5 32 // C5: RLED - #define LCD_PINS_D6 34 // C3: LCD-DATA - #define LCD_PINS_D7 31 // C6: GLED - - #define BTN_EN2 75 // J4, UP - #define BTN_EN1 73 // J3, DOWN - //STOP button connected as KILL_PIN - #define KILL_PIN 14 // J1, RIGHT - //KILL - not connected - - #define BEEPER_PIN 8 // H5, SD_WP - - //on board leds - #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2) - #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3) - - #else - // Replicator uses a 3-wire SR controller with HD44780 - #define SR_DATA_PIN 34 // C3 - #define SR_CLK_PIN 35 // C2 - #define SR_STROBE_PIN 33 // C4 - - #define BTN_UP 75 // J4 - #define BTN_DWN 73 // J3 - #define BTN_LFT 72 // J2 - #define BTN_RT 14 // J1 - - // Disable encoder - #undef BTN_EN1 - #undef BTN_EN2 - - #define BEEPER_PIN 4 // G5 - - #define STAT_LED_RED_PIN 32 // C5 - #define STAT_LED_BLUE_PIN 31 // C6 (Actually green) - - #endif - - #define BTN_CENTER 15 // J0 - #define BTN_ENC BTN_CENTER - -#endif // HAS_SPI_LCD - -// -// SD Card -// -#define SDSS 53 // B0 -#define SD_DETECT_PIN 9 // H6 - -// -//TMC 2208 -// -#if HAS_DRIVER(TMC2208) - /** - * TMC2208 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - #define X_HARDWARE_SERIAL Serial2 - #define Y_HARDWARE_SERIAL Serial1 - - /** - * Software serial - */ - - #define X_SERIAL_TX_PIN 16 - #define X_SERIAL_RX_PIN 17 - - #define Y_SERIAL_TX_PIN 18 - #define Y_SERIAL_RX_PIN 19 - - #define Z_SERIAL_TX_PIN 41 - #define Z_SERIAL_RX_PIN 66 - - #define E0_SERIAL_TX_PIN 40 - #define E0_SERIAL_RX_PIN 67 - - #define E1_SERIAL_TX_PIN 37 - #define E1_SERIAL_RX_PIN 68 - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MINITRONICS.h deleted file mode 100644 index 16fad0067f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_MINITRONICS.h +++ /dev/null @@ -1,143 +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 - -/** - * Minitronics v1.0/1.1 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for M3, M4 & M5 spindle control commands - * - */ - -#ifndef __AVR_ATmega1281__ - #error "Oops! Select 'Minitronics' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Minitronics v1.0/1.1" -// -// Limit Switches -// -#define X_MIN_PIN 5 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 2 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 6 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 48 -#define X_DIR_PIN 47 -#define X_ENABLE_PIN 49 - -#define Y_STEP_PIN 39 // A6 -#define Y_DIR_PIN 40 // A0 -#define Y_ENABLE_PIN 38 - -#define Z_STEP_PIN 42 // A2 -#define Z_DIR_PIN 43 // A6 -#define Z_ENABLE_PIN 41 // A1 - -#define E0_STEP_PIN 45 -#define E0_DIR_PIN 44 -#define E0_ENABLE_PIN 27 - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 35 -#define E1_ENABLE_PIN 37 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input -#define TEMP_1_PIN 6 // Analog Input -#define TEMP_BED_PIN 6 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 7 // EXTRUDER 1 -#define HEATER_1_PIN 8 // EXTRUDER 2 -#define HEATER_BED_PIN 3 // BED - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif - -// -// Misc. Functions -// -#define SDSS 16 -#define LED_PIN 46 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 15 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 11 // SID (MOSI) - #define LCD_PINS_D4 10 // SCK (CLK) clock - - #define BTN_EN1 18 - #define BTN_EN2 17 - #define BTN_ENC 25 - - #define SD_DETECT_PIN 30 - -#else - - #define LCD_PINS_RS -1 - #define LCD_PINS_ENABLE -1 - - // Buttons are directly attached using keypad - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 - - #define SD_DETECT_PIN -1 // Minitronics doesn't use this -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER // assumes we're only doing CNC work (no 3D printing) - #undef HEATER_BED_PIN - #undef TEMP_BED_PIN // need to free up some pins but also need to - #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin - #undef TEMP_1_PIN // requires the presence of certain pins or else it - #define HEATER_BED_PIN 4 // won't compile - #define TEMP_BED_PIN 50 - #define TEMP_0_PIN 51 - #define SPINDLE_LASER_ENA_PIN 52 // using A6 because it already has a pullup - #define SPINDLE_LASER_PWM_PIN 3 // WARNING - LED & resistor pull up to +12/+24V stepper voltage - #define SPINDLE_DIR_PIN 53 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_OVERLORD.h deleted file mode 100644 index b6043c018c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_OVERLORD.h +++ /dev/null @@ -1,144 +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 - -/** - * Dreammaker Overlord v1.1 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Overlord Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "OVERLORD" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -// -// Limit Switches -// -#define X_STOP_PIN 24 -#define Y_STOP_PIN 28 -#define Z_MIN_PIN 46 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 46 // JP4, Tfeed1 -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define FIL_RUNOUT_PIN 44 // JP3, Tfeed2 -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input - Redundant temp sensor -#define TEMP_2_PIN 12 // Analog Input -#define TEMP_3_PIN 14 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#define FAN_PIN 7 // material cooling fan - -// -// SD Card -// -#define SDSS 53 -#define SD_DETECT_PIN 38 - -// -// Misc. Functions -// -#define LED_PIN 13 // On PCB status led -#define PS_ON_PIN 12 // For stepper/heater/fan power. Active HIGH. -#define POWER_LOSS_PIN 34 // Power check - whether hotends/steppers/fans have power - -#if ENABLED(BATTERY_STATUS_AVAILABLE) - #undef BATTERY_STATUS_PIN - #define BATTERY_STATUS_PIN 26 // Status of power loss battery, whether it is charged (low) or charging (high) -#endif -#if ENABLED(INPUT_VOLTAGE_AVAILABLE) - #undef VOLTAGE_DETECTION_PIN - #define VOLTAGE_DETECTION_PIN 11 // Analog Input - ADC Voltage level of main input -#endif - -// -// LCD / Controller -// -#if HAS_GRAPHICAL_LCD - // OVERLORD OLED pins - #define LCD_PINS_RS 20 - #define LCD_PINS_D5 21 - #define LCD_PINS_ENABLE 15 - #define LCD_PINS_D4 14 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - #ifndef LCD_RESET_PIN - #define LCD_RESET_PIN 5 // LCD_PINS_D6 - #endif -#endif - -#if ENABLED(NEWPANEL) - #define BTN_ENC 16 // Enter Pin - #define BTN_UP 19 // Button UP Pin - #define BTN_DWN 17 // Button DOWN Pin -#endif - -// Additional connectors/pins on the Overlord V1.X board -#define PCB_VERSION_PIN 22 -#define APPROACH_PIN 11 // JP7, Tpd -#define GATE_PIN 36 // Threshold, JP6, Tg diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_SILVER_GATE.h deleted file mode 100644 index 2ea2b09f5a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_SILVER_GATE.h +++ /dev/null @@ -1,93 +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 - -#if !defined(__AVR_ATmega1281__) && !defined(__AVR_ATmega2561__) - #error "Oops! Select 'Silvergate' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Silver Gate" - -#define X_STEP_PIN 43 -#define X_DIR_PIN 44 -#define X_ENABLE_PIN 42 -#define X_MIN_PIN 31 -#define X_MAX_PIN 34 - -#define Y_STEP_PIN 40 -#define Y_DIR_PIN 41 -#define Y_ENABLE_PIN 39 -#define Y_MIN_PIN 32 -#define Y_MAX_PIN 35 - -#define Z_STEP_PIN 13 -#define Z_DIR_PIN 38 -#define Z_ENABLE_PIN 14 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 36 - -#define E0_STEP_PIN 27 -#define E0_DIR_PIN 37 -#define E0_ENABLE_PIN 45 - -#define SDSS 16 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 34 // X_MAX unless overridden -#endif - -#ifndef FAN_PIN - #define FAN_PIN 5 -#endif - -#define HEATER_0_PIN 7 - -#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN -#define CONTROLLER_FAN_PIN 2 - -#define TEMP_0_PIN 7 // Analog Input - -#define HEATER_BED_PIN 8 -#define TEMP_BED_PIN 6 - -#if HAS_GRAPHICAL_LCD - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 - #define LCD_PINS_RS 30 - #define LCD_PINS_ENABLE 20 - #define LCD_PINS_D4 25 - #define BEEPER_PIN 29 - #define BTN_EN1 19 - #define BTN_EN2 22 - #define BTN_ENC 24 - #define LCD_BACKLIGHT_PIN 6 - #if ENABLED(SILVER_GATE_GLCD_CONTROLLER) - #define KILL_PIN 21 - #define HOME_PIN 28 - #endif - #endif -#endif - -#define SD_DETECT_PIN 15 - -#define STAT_LED_RED_PIN 23 -#define STAT_LED_BLUE_PIN 26 -#define CASE_LIGHT_PIN 51 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h deleted file mode 100644 index 1cceef8dab..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h +++ /dev/null @@ -1,111 +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 - -/** - * Wanhao 0ne+ pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Wanhao i3 Mini 0ne+" -#define DEFAULT_MACHINE_NAME "i3 Mini" -#define BOARD_WEBSITE_URL "https://tinyurl.com/yyxw7se7" - -// -// Limit Switches -// -#define X_STOP_PIN 19 -#define Y_STOP_PIN 18 -#define Z_STOP_PIN 38 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 38 -#endif - -// -// Steppers -// -#define X_STEP_PIN 22 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 57 - -#define Y_STEP_PIN 25 -#define Y_DIR_PIN 26 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 29 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 28 - -#define E0_STEP_PIN 55 -#define E0_DIR_PIN 56 -#define E0_ENABLE_PIN 54 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 -#define TEMP_BED_PIN 14 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 44 -#define FAN_PIN 12 // IO pin. Buffer needed - -// -// SD Card -// -#define SD_DETECT_PIN -1 -#define SDSS 53 - -// -// Misc. Functions -// -#define BEEPER_PIN 37 -#define KILL_PIN 64 - -// -// LCD / Controller (Integrated MINIPANEL) -// -#if ENABLED(MINIPANEL) - #define DOGLCD_A0 40 - #define DOGLCD_CS 41 - #define LCD_BACKLIGHT_PIN 65 // Backlight LED on A11/D65 - #define LCD_RESET_PIN 27 - - #define BTN_EN1 2 - #define BTN_EN2 3 - #define BTN_ENC 5 - - // This display has adjustable contrast - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 255 - #define LCD_CONTRAST_INIT LCD_CONTRAST_MAX -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pins.h deleted file mode 100644 index bd89019284..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pins.h +++ /dev/null @@ -1,1196 +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 - -#include "../core/boards.h" - -/** - * Include pins definitions - * - * Pins numbering schemes: - * - * - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR) - * The FastIO headers map digital pins to their ports and functions. - * - * - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN) - * These numbers are the same in any pin mapping. - */ - -#define MAX_EXTRUDERS 6 - -#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) - #define IS_RAMPS_EFB -#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB) - #define IS_RAMPS_EEB -#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF) - #define IS_RAMPS_EFF -#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF) - #define IS_RAMPS_EEF -#elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF) - #define IS_RAMPS_SF -#endif - -#define HAS_FREE_AUX2_PINS !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) - -// -// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 -// - -#if MB(RAMPS_OLD) - #include "ramps/pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFB) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEB) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EFF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_EEF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_13_SF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFB) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEB) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EFF) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_EEF) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_14_SF) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFB) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEB) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EFF) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_EEF) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RAMPS_PLUS_SF) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 - -// -// RAMPS Derivatives - ATmega1280, ATmega2560 -// - -#elif MB(3DRAG) - #include "ramps/pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(K8200) - #include "ramps/pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(K8400) - #include "ramps/pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(K8800) - #include "ramps/pins_K8800.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) -#elif MB(BAM_DICE) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(BAM_DICE_DUE) - #include "ramps/pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE) - #include "ramps/pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_14) - #include "ramps/pins_MKS_BASE_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(MKS_BASE_15) - #include "ramps/pins_MKS_BASE_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_BASE_HEROIC) - #include "ramps/pins_MKS_BASE_HEROIC.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_13) - #include "ramps/pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MKS_GEN_L) - #include "ramps/pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(KFB_2) - #include "ramps/pins_BIQU_KFB_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(ZRIB_V20) - #include "ramps/pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) -#elif MB(FELIX2) - #include "ramps/pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD) - #include "ramps/pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(RIGIDBOARD_V2) - #include "ramps/pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(SAINSMART_2IN1) - #include "ramps/pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER) - #include "ramps/pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(ULTIMAKER_OLD) - #include "ramps/pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(AZTEEG_X3) - #include "ramps/pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 -#elif MB(AZTEEG_X3_PRO) - #include "ramps/pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 -#elif MB(ULTIMAIN_2) - #include "ramps/pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(FORMBOT_RAPTOR) - #include "ramps/pins_FORMBOT_RAPTOR.h" // ATmega2560 env:megaatmega2560 -#elif MB(FORMBOT_RAPTOR2) - #include "ramps/pins_FORMBOT_RAPTOR2.h" // ATmega2560 env:megaatmega2560 -#elif MB(FORMBOT_TREX2PLUS) - #include "ramps/pins_FORMBOT_TREX2PLUS.h" // ATmega2560 env:megaatmega2560 -#elif MB(FORMBOT_TREX3) - #include "ramps/pins_FORMBOT_TREX3.h" // ATmega2560 env:megaatmega2560 -#elif MB(RUMBA) - #include "ramps/pins_RUMBA.h" // ATmega2560 env:megaatmega2560 -#elif MB(RUMBA_RAISE3D) - #include "ramps/pins_RUMBA_RAISE3D.h" // ATmega2560 env:megaatmega2560 -#elif MB(RL200) - #include "ramps/pins_RL200.h" // ATmega2560 env:megaatmega2560 -#elif MB(BQ_ZUM_MEGA_3D) - #include "ramps/pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 -#elif MB(MAKEBOARD_MINI) - #include "ramps/pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_13) - #include "ramps/pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_14) - #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRIGORILLA_14_11) - #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_ENDER_4) - #include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_CREALITY) - #include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMPS_DAGOMA) - #include "ramps/pins_RAMPS_DAGOMA.h" // ATmega2560 env:megaatmega2560 -#elif MB(FYSETC_F6_13) - #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6_13 -#elif MB(DUPLICATOR_I3_PLUS) - #include "ramps/pins_DUPLICATOR_I3_PLUS.h" // ATmega2560 env:megaatmega2560 -#elif MB(VORON) - #include "ramps/pins_VORON.h" // ATmega2560 env:megaatmega2560 -#elif MB(TRONXY_V3_1_0) - #include "ramps/pins_TRONXY_V3_1_0.h" // ATmega2560 env:megaatmega2560 -#elif MB(Z_BOLT_X_SERIES) - #include "ramps/pins_Z_BOLT_X_SERIES.h" // ATmega2560 env:megaatmega2560 -#elif MB(TT_OSCAR) - #include "ramps/pins_TT_OSCAR.h" // ATmega2560 env:megaatmega2560 -#elif MB(TANGO) - #include "ramps/pins_TANGO.h" // ATmega2560 env:megaatmega2560 -#elif MB(MKS_GEN_L_V2) - #include "ramps/pins_MKS_GEN_L_V2.h" // ATmega2560 env:megaatmega2560 - - -// -// RAMBo and derivatives -// - -#elif MB(RAMBO) - #include "rambo/pins_RAMBO.h" // ATmega2560 env:rambo -#elif MB(MINIRAMBO, MINIRAMBO_10A) - #include "rambo/pins_MINIRAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RAMBO) - #include "rambo/pins_EINSY_RAMBO.h" // ATmega2560 env:rambo -#elif MB(EINSY_RETRO) - #include "rambo/pins_EINSY_RETRO.h" // ATmega2560 env:rambo -#elif MB(SCOOVO_X9H) - #include "rambo/pins_SCOOVO_X9H.h" // ATmega2560 env:rambo - -// -// Other ATmega1280, ATmega2560 -// - -#elif MB(CNCONTROLS_11) - #include "mega/pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CNCONTROLS_12) - #include "mega/pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CNCONTROLS_15) - #include "mega/pins_CNCONTROLS_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MIGHTYBOARD_REVE) - #include "mega/pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(CHEAPTRONIC) - #include "mega/pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 -#elif MB(CHEAPTRONIC_V2) - #include "mega/pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS) - #include "mega/pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_2) - #include "mega/pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_3, MEGATRONICS_31, MEGATRONICS_32) - #include "mega/pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(ELEFU_3) - #include "mega/pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(LEAPFROG) - #include "mega/pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(MEGACONTROLLER) - #include "mega/pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 -#elif MB(GT2560_REV_A) - #include "mega/pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(GT2560_REV_A_PLUS) - #include "mega/pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(GT2560_V3) - #include "mega/pins_GT2560_V3.h" // ATmega2560 env:megaatmega2560 -#elif MB(GT2560_V3_MC2) - #include "mega/pins_GT2560_V3_MC2.h" // ATmega2560 env:megaatmega2560 -#elif MB(GT2560_V3_A20) - #include "mega/pins_GT2560_V3_A20.h" // ATmega2560 env:megaatmega2560 -#elif MB(EINSTART_S) - #include "mega/pins_EINSTART-S.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 -#elif MB(WANHAO_ONEPLUS) - #include "mega/pins_WANHAO_ONEPLUS.h" // ATmega2560 env:megaatmega2560 -#elif MB(OVERLORD) - #include "mega/pins_OVERLORD.h" // ATmega2560 env:megaatmega2560 -#elif MB(HJC2560C_REV2) - #include "mega/pins_HJC2560C_REV2.h" // ATmega2560 env:megaatmega2560 - -// -// ATmega1281, ATmega2561 -// - -#elif MB(MINITRONICS) - #include "mega/pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 -#elif MB(SILVER_GATE) - #include "mega/pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 - -// -// Sanguinololu and Derivatives - ATmega644P, ATmega1284P -// - -#elif MB(SANGUINOLOLU_11) - #include "sanguino/pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(SANGUINOLOLU_12) - #include "sanguino/pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI) - #include "sanguino/pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MAKR3D) - #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_CREALITY) - #include "sanguino/pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_MALYAN) - #include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(MELZI_TRONXY) - #include "sanguino/pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(STB_11) - #include "sanguino/pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(AZTEEG_X1) - #include "sanguino/pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Other ATmega644P, ATmega644, ATmega1284P -// - -#elif MB(GEN3_MONOLITHIC) - #include "sanguino/pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p -#elif MB(GEN3_PLUS) - #include "sanguino/pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6) - #include "sanguino/pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN6_DELUXE) - #include "sanguino/pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_CUSTOM) - #include "sanguino/pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_12) - #include "sanguino/pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_13) - #include "sanguino/pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(GEN7_14) - #include "sanguino/pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p -#elif MB(OMCA_A) - #include "sanguino/pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p -#elif MB(OMCA) - #include "sanguino/pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p -#elif MB(ANET_10) - #include "sanguino/pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p -#elif MB(SETHI) - #include "sanguino/pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p - -// -// Teensyduino - AT90USB1286, AT90USB1286P -// - -#elif MB(TEENSYLU) - #include "teensy2/pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90usb1286_cdc -#elif MB(PRINTRBOARD) - #include "teensy2/pins_PRINTRBOARD.h" // AT90USB1286 env:at90usb1286_dfu -#elif MB(PRINTRBOARD_REVF) - #include "teensy2/pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90usb1286_dfu -#elif MB(BRAINWAVE) - #include "teensy2/pins_BRAINWAVE.h" // AT90USB646 env:at90usb1286_cdc -#elif MB(BRAINWAVE_PRO) - #include "teensy2/pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90usb1286_cdc -#elif MB(SAV_MKI) - #include "teensy2/pins_SAV_MKI.h" // AT90USB1286 env:at90usb1286_cdc -#elif MB(TEENSY2) - #include "teensy2/pins_TEENSY2.h" // AT90USB1286 env:teensy20 -#elif MB(5DPRINT) - #include "teensy2/pins_5DPRINT.h" // AT90USB1286 env:at90usb1286_dfu - -// -// LPC1768 ARM Cortex M3 -// - -#elif MB(RAMPS_14_RE_ARM_EFB) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EEB) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EFF) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EEF) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_SF) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(MKS_SBASE) - #include "lpc1768/pins_MKS_SBASE.h" // LPC1768 env:LPC1768 -#elif MB(MKS_SGEN_L) - #include "lpc1768/pins_MKS_SGEN_L.h" // LPC1768 env:LPC1768 -#elif MB(AZSMZ_MINI) - #include "lpc1768/pins_AZSMZ_MINI.h" // LPC1768 env:LPC1768 -#elif MB(BIQU_BQ111_A4) - #include "lpc1768/pins_BIQU_BQ111_A4.h" // LPC1768 env:LPC1768 -#elif MB(SELENA_COMPACT) - #include "lpc1768/pins_SELENA_COMPACT.h" // LPC1768 env:LPC1768 -#elif MB(BIGTREE_SKR_V1_1) - #include "lpc1768/pins_BTT_SKR_V1_1.h" // LPC1768 env:LPC1768 -#elif MB(BIQU_B300_V1_0) - #include "lpc1768/pins_BIQU_B300_V1.0.h" // LPC1768 env:LPC1768 -#elif MB(BIGTREE_SKR_V1_3) - #include "lpc1768/pins_BTT_SKR_V1_3.h" // LPC1768 env:LPC1768 -#elif MB(GMARSH_X6_REV1) - #include "lpc1768/pins_GMARSH_X6_REV1.h" // LPC1768 env:LPC1768 - -// -// LPC1769 ARM Cortex M3 -// - -#elif MB(MKS_SGEN) - #include "lpc1769/pins_MKS_SGEN.h" // LPC1769 env:LPC1769 -#elif MB(AZTEEG_X5_GT) - #include "lpc1769/pins_AZTEEG_X5_GT.h" // LPC1769 env:LPC1769 -#elif MB(AZTEEG_X5_MINI) - #include "lpc1769/pins_AZTEEG_X5_MINI.h" // LPC1769 env:LPC1769 -#elif MB(AZTEEG_X5_MINI_WIFI) - #include "lpc1769/pins_AZTEEG_X5_MINI_WIFI.h" // LPC1769 env:LPC1769 -#elif MB(COHESION3D_REMIX) - #include "lpc1769/pins_COHESION3D_REMIX.h" // LPC1769 env:LPC1769 -#elif MB(COHESION3D_MINI) - #include "lpc1769/pins_COHESION3D_MINI.h" // LPC1769 env:LPC1769 -#elif MB(SMOOTHIEBOARD) - #include "lpc1769/pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1769 -#elif MB(TH3D_EZBOARD) - #include "lpc1769/pins_TH3D_EZBOARD.h" // LPC1769 env:LPC1769 - -// -// Due (ATSAM) boards -// - -#elif MB(DUE3DOM) - #include "sam/pins_DUE3DOM.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(DUE3DOM_MINI) - #include "sam/pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RADDS) - #include "sam/pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RURAMPS4D_11) - #include "sam/pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RURAMPS4D_13) - #include "sam/pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_FD_V1) - #include "sam/pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_FD_V2) - #include "sam/pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EFB) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EEB) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EFF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EEF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_SF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EFB) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EEB) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EFF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EEF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_SF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EFB) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EEB) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EFF) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EEF) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_SF) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(ULTRATRONICS_PRO) - #include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(ARCHIM1) - #include "sam/pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(ARCHIM2) - #include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(ALLIGATOR) - #include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(ADSK) - #include "sam/pins_ADSK.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(PRINTRBOARD_G2) - #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB - -// -// STM32 ARM Cortex-M3 -// - -#elif MB(STM32F103RE) - #include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F103RE -#elif MB(MALYAN_M200) - #include "stm32/pins_MALYAN_M200.h" // STM32F1 env:STM32F103CB_malyan -#elif MB(STM3R_MINI) - #include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F103RE -#elif MB(GTM32_PRO_VB) - #include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F103RE -#elif MB(GTM32_MINI_A30) - #include "stm32/pins_GTM32_MINI_A30.h" // STM32F1 env:STM32F103RE -#elif MB(GTM32_MINI) - #include "stm32/pins_GTM32_MINI.h" // STM32F1 env:STM32F103RE -#elif MB(GTM32_REV_B) - #include "stm32/pins_GTM32_REV_B.h" // STM32F1 env:STM32F103RE -#elif MB(MORPHEUS) - #include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F103RE -#elif MB(CHITU3D) - #include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F103RE -#elif MB(MKS_ROBIN) - #include "stm32/pins_MKS_ROBIN.h" // STM32F1 env:mks_robin -#elif MB(MKS_ROBIN_MINI) - #include "stm32/pins_MKS_ROBIN_MINI.h" // STM32F1 env:mks_robin_mini -#elif MB(MKS_ROBIN_NANO) - #include "stm32/pins_MKS_ROBIN_NANO.h" // STM32F1 env:mks_robin_nano -#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_BTT_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB -#elif MB(BTT_SKR_MINI_E3_V1_0) - #include "stm32/pins_BTT_SKR_MINI_E3_V1_0.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB -#elif MB(BTT_SKR_MINI_E3_V1_2) - #include "stm32/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB -#elif MB(BIGTREE_SKR_E3_DIP) - #include "stm32/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_bigtree env:STM32F103RE_bigtree_USB env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB -#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:STM32F103RC_fysetc -#elif MB(FYSETC_CHEETAH) - #include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103RC_fysetc -#elif MB(FYSETC_CHEETAH_V12) - #include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103RC_fysetc -#elif MB(LONGER3D_LK) - #include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer - -// -// ARM Cortex-M4F -// - -#elif MB(TEENSY31_32) - #include "teensy3/pins_TEENSY31_32.h" // TEENSY31_32 env:teensy31 -#elif MB(TEENSY35_36) - #include "teensy3/pins_TEENSY35_36.h" // TEENSY35_36 env:teensy35 - -// -// STM32 ARM Cortex-M4F -// - -#elif MB(BEAST) - #include "stm32/pins_BEAST.h" // STM32F4 env:STM32F4 -#elif MB(GENERIC_STM32F4) - #include "stm32/pins_GENERIC_STM32F4.h" // STM32F4 env:STM32F4 -#elif MB(ARMED) - #include "stm32/pins_ARMED.h" // STM32F4 env:ARMED -#elif MB(RUMBA32) - #include "stm32/pins_RUMBA32.h" // STM32F4 env:RUMBA32 -#elif MB(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_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO -#elif MB(BIGTREE_BTT002_V1_0) - #include "stm32/pins_BTT_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 -#elif MB(VAKE403D) - #include "stm32/pins_VAKE403D.h" // STM32F4 env:STM32F4 -#elif MB(FYSETC_S6) - #include "stm32/pins_FYSETC_S6.h" // STM32F4 env:FYSETC_S6 - -// -// ARM Cortex M7 -// - -#elif MB(THE_BORG) - #include "stm32/pins_THE_BORG.h" // STM32F7 env:STM32F7 -#elif MB(REMRAM_V1) - #include "stm32/pins_REMRAM_V1.h" // STM32F7 env:STM32F7 - -// -// Espressif ESP32 -// - -#elif MB(ESPRESSIF_ESP32) - - #include "esp32/pins_ESP32.h" // ESP32 env:esp32 - -// -// Linux Native Debug board -// - -#elif MB(LINUX_RAMPS) - #include "linux/pins_RAMPS_LINUX.h" // Linux env:linux_native - -#else - #error "Unknown MOTHERBOARD value set in Configuration.h" -#endif - -// Define certain undefined pins -#ifndef X_MS1_PIN - #define X_MS1_PIN -1 -#endif -#ifndef X_MS2_PIN - #define X_MS2_PIN -1 -#endif -#ifndef X_MS3_PIN - #define X_MS3_PIN -1 -#endif -#ifndef Y_MS1_PIN - #define Y_MS1_PIN -1 -#endif -#ifndef Y_MS2_PIN - #define Y_MS2_PIN -1 -#endif -#ifndef Y_MS3_PIN - #define Y_MS3_PIN -1 -#endif -#ifndef Z_MS1_PIN - #define Z_MS1_PIN -1 -#endif -#ifndef Z_MS2_PIN - #define Z_MS2_PIN -1 -#endif -#ifndef Z_MS3_PIN - #define Z_MS3_PIN -1 -#endif -#ifndef E0_MS1_PIN - #define E0_MS1_PIN -1 -#endif -#ifndef E0_MS2_PIN - #define E0_MS2_PIN -1 -#endif -#ifndef E0_MS3_PIN - #define E0_MS3_PIN -1 -#endif -#ifndef E1_MS1_PIN - #define E1_MS1_PIN -1 -#endif -#ifndef E1_MS2_PIN - #define E1_MS2_PIN -1 -#endif -#ifndef E1_MS3_PIN - #define E1_MS3_PIN -1 -#endif -#ifndef E2_MS1_PIN - #define E2_MS1_PIN -1 -#endif -#ifndef E2_MS2_PIN - #define E2_MS2_PIN -1 -#endif -#ifndef E2_MS3_PIN - #define E2_MS3_PIN -1 -#endif -#ifndef E3_MS1_PIN - #define E3_MS1_PIN -1 -#endif -#ifndef E3_MS2_PIN - #define E3_MS2_PIN -1 -#endif -#ifndef E3_MS3_PIN - #define E3_MS3_PIN -1 -#endif -#ifndef E4_MS1_PIN - #define E4_MS1_PIN -1 -#endif -#ifndef E4_MS2_PIN - #define E4_MS2_PIN -1 -#endif -#ifndef E4_MS3_PIN - #define E4_MS3_PIN -1 -#endif -#ifndef E5_MS1_PIN - #define E5_MS1_PIN -1 -#endif -#ifndef E5_MS2_PIN - #define E5_MS2_PIN -1 -#endif -#ifndef E5_MS3_PIN - #define E5_MS3_PIN -1 -#endif - -#ifndef E0_STEP_PIN - #define E0_STEP_PIN -1 -#endif -#ifndef E0_DIR_PIN - #define E0_DIR_PIN -1 -#endif -#ifndef E0_ENABLE_PIN - #define E0_ENABLE_PIN -1 -#endif -#ifndef E1_STEP_PIN - #define E1_STEP_PIN -1 -#endif -#ifndef E1_DIR_PIN - #define E1_DIR_PIN -1 -#endif -#ifndef E1_ENABLE_PIN - #define E1_ENABLE_PIN -1 -#endif -#ifndef E2_STEP_PIN - #define E2_STEP_PIN -1 -#endif -#ifndef E2_DIR_PIN - #define E2_DIR_PIN -1 -#endif -#ifndef E2_ENABLE_PIN - #define E2_ENABLE_PIN -1 -#endif -#ifndef E3_STEP_PIN - #define E3_STEP_PIN -1 -#endif -#ifndef E3_DIR_PIN - #define E3_DIR_PIN -1 -#endif -#ifndef E3_ENABLE_PIN - #define E3_ENABLE_PIN -1 -#endif -#ifndef E4_STEP_PIN - #define E4_STEP_PIN -1 -#endif -#ifndef E4_DIR_PIN - #define E4_DIR_PIN -1 -#endif -#ifndef E4_ENABLE_PIN - #define E4_ENABLE_PIN -1 -#endif -#ifndef E5_STEP_PIN - #define E5_STEP_PIN -1 -#endif -#ifndef E5_DIR_PIN - #define E5_DIR_PIN -1 -#endif -#ifndef E5_ENABLE_PIN - #define E5_ENABLE_PIN -1 -#endif - -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif -#ifndef E4_CS_PIN - #define E4_CS_PIN -1 -#endif -#ifndef E5_CS_PIN - #define E5_CS_PIN -1 -#endif - -#ifndef FAN_PIN - #define FAN_PIN -1 -#endif -#define FAN0_PIN FAN_PIN -#ifndef FAN1_PIN - #define FAN1_PIN -1 -#endif -#ifndef FAN2_PIN - #define FAN2_PIN -1 -#endif -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN -1 -#endif - -#ifndef FANMUX0_PIN - #define FANMUX0_PIN -1 -#endif -#ifndef FANMUX1_PIN - #define FANMUX1_PIN -1 -#endif -#ifndef FANMUX2_PIN - #define FANMUX2_PIN -1 -#endif - -#ifndef HEATER_0_PIN - #define HEATER_0_PIN -1 -#endif -#ifndef HEATER_1_PIN - #define HEATER_1_PIN -1 -#endif -#ifndef HEATER_2_PIN - #define HEATER_2_PIN -1 -#endif -#ifndef HEATER_3_PIN - #define HEATER_3_PIN -1 -#endif -#ifndef HEATER_4_PIN - #define HEATER_4_PIN -1 -#endif -#ifndef HEATER_5_PIN - #define HEATER_5_PIN -1 -#endif -#ifndef HEATER_BED_PIN - #define HEATER_BED_PIN -1 -#endif - -#ifndef TEMP_0_PIN - #define TEMP_0_PIN -1 -#endif -#ifndef TEMP_1_PIN - #define TEMP_1_PIN -1 -#endif -#ifndef TEMP_2_PIN - #define TEMP_2_PIN -1 -#endif -#ifndef TEMP_3_PIN - #define TEMP_3_PIN -1 -#endif -#ifndef TEMP_4_PIN - #define TEMP_4_PIN -1 -#endif -#ifndef TEMP_5_PIN - #define TEMP_5_PIN -1 -#endif -#ifndef TEMP_BED_PIN - #define TEMP_BED_PIN -1 -#endif - -#ifndef SD_DETECT_PIN - #define SD_DETECT_PIN -1 -#endif -#ifndef SDPOWER_PIN - #define SDPOWER_PIN -1 -#endif -#ifndef SDSS - #define SDSS -1 -#endif -#ifndef LED_PIN - #define LED_PIN -1 -#endif -#if DISABLED(PSU_CONTROL) || !defined(PS_ON_PIN) - #undef PS_ON_PIN - #define PS_ON_PIN -1 -#endif -#ifndef KILL_PIN - #define KILL_PIN -1 -#endif -#ifndef SUICIDE_PIN - #define SUICIDE_PIN -1 -#endif -#ifndef SUICIDE_PIN_INVERTING - #define SUICIDE_PIN_INVERTING false -#endif - -#ifndef NUM_SERVO_PLUGS - #define NUM_SERVO_PLUGS 4 -#endif - -// -// Assign auto fan pins if needed -// -#ifndef E0_AUTO_FAN_PIN - #ifdef ORIG_E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN - #else - #define E0_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E1_AUTO_FAN_PIN - #ifdef ORIG_E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN - #else - #define E1_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E2_AUTO_FAN_PIN - #ifdef ORIG_E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN - #else - #define E2_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E3_AUTO_FAN_PIN - #ifdef ORIG_E3_AUTO_FAN_PIN - #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN - #else - #define E3_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E4_AUTO_FAN_PIN - #ifdef ORIG_E4_AUTO_FAN_PIN - #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN - #else - #define E4_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef E5_AUTO_FAN_PIN - #ifdef ORIG_E5_AUTO_FAN_PIN - #define E5_AUTO_FAN_PIN ORIG_E5_AUTO_FAN_PIN - #else - #define E5_AUTO_FAN_PIN -1 - #endif -#endif -#ifndef CHAMBER_AUTO_FAN_PIN - #ifdef ORIG_CHAMBER_AUTO_FAN_PIN - #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN - #else - #define CHAMBER_AUTO_FAN_PIN -1 - #endif -#endif - -// -// Assign endstop pins for boards with only 3 connectors -// -#ifdef X_STOP_PIN - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_STOP_PIN - #define X_MAX_PIN -1 - #else - #define X_MIN_PIN -1 - #define X_MAX_PIN X_STOP_PIN - #endif -#elif X_HOME_DIR < 0 - #define X_STOP_PIN X_MIN_PIN -#else - #define X_STOP_PIN X_MAX_PIN -#endif - -#ifdef Y_STOP_PIN - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_STOP_PIN - #define Y_MAX_PIN -1 - #else - #define Y_MIN_PIN -1 - #define Y_MAX_PIN Y_STOP_PIN - #endif -#elif Y_HOME_DIR < 0 - #define Y_STOP_PIN Y_MIN_PIN -#else - #define Y_STOP_PIN Y_MAX_PIN -#endif - -#ifdef Z_STOP_PIN - #if Z_HOME_DIR < 0 - #define Z_MIN_PIN Z_STOP_PIN - #define Z_MAX_PIN -1 - #else - #define Z_MIN_PIN -1 - #define Z_MAX_PIN Z_STOP_PIN - #endif -#elif Z_HOME_DIR < 0 - #define Z_STOP_PIN Z_MIN_PIN -#else - #define Z_STOP_PIN Z_MAX_PIN -#endif - -// -// Disable unused endstop / probe pins -// -#if !HAS_CUSTOM_PROBE_PIN - #undef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN -1 -#endif - -#if DISABLED(USE_XMAX_PLUG) - #undef X_MAX_PIN - #define X_MAX_PIN -1 -#endif - -#if DISABLED(USE_YMAX_PLUG) - #undef Y_MAX_PIN - #define Y_MAX_PIN -1 -#endif - -#if DISABLED(USE_ZMAX_PLUG) - #undef Z_MAX_PIN - #define Z_MAX_PIN -1 -#endif - -#if DISABLED(USE_XMIN_PLUG) - #undef X_MIN_PIN - #define X_MIN_PIN -1 -#endif - -#if DISABLED(USE_YMIN_PLUG) - #undef Y_MIN_PIN - #define Y_MIN_PIN -1 -#endif - -#if DISABLED(USE_ZMIN_PLUG) - #undef Z_MIN_PIN - #define Z_MIN_PIN -1 -#endif - -#ifndef LCD_PINS_D4 - #define LCD_PINS_D4 -1 -#endif - -#if HAS_CHARACTER_LCD || TOUCH_UI_ULTIPANEL - #ifndef LCD_PINS_D5 - #define LCD_PINS_D5 -1 - #endif - #ifndef LCD_PINS_D6 - #define LCD_PINS_D6 -1 - #endif - #ifndef LCD_PINS_D7 - #define LCD_PINS_D7 -1 - #endif -#endif - -/** - * Auto-Assignment for Dual X, Dual Y, Multi-Z Steppers - * - * By default X2 is assigned to the next open E plug - * on the board, then in order, Y2, Z2, Z3. These can be - * overridden in Configuration.h or Configuration_adv.h. - */ - -#define __EPIN(p,q) E##p##_##q##_PIN -#define _EPIN(p,q) __EPIN(p,q) - -// The X2 axis, if any, should be the next open extruder port -#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) - #ifndef X2_STEP_PIN - #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) - #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) - #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) - #if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) - #error "No E stepper plug left for X2!" - #endif - #endif - #ifndef X2_MS1_PIN - #define X2_MS1_PIN _EPIN(E_STEPPERS, MS1) - #endif - #ifndef X2_MS2_PIN - #define X2_MS2_PIN _EPIN(E_STEPPERS, MS2) - #endif - #ifndef X2_MS3_PIN - #define X2_MS3_PIN _EPIN(E_STEPPERS, MS3) - #endif - #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN) - #define X2_CS_PIN _EPIN(E_STEPPERS, CS) - #endif - #if AXIS_HAS_UART(X2) - #ifndef X2_SERIAL_TX_PIN - #define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX) - #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN _EPIN(E_STEPPERS, SERIAL_RX) - #endif - #endif - #define Y2_E_INDEX INCREMENT(E_STEPPERS) -#else - #define Y2_E_INDEX E_STEPPERS -#endif - -#ifndef X2_CS_PIN - #define X2_CS_PIN -1 -#endif -#ifndef X2_MS1_PIN - #define X2_MS1_PIN -1 -#endif -#ifndef X2_MS2_PIN - #define X2_MS2_PIN -1 -#endif -#ifndef X2_MS3_PIN - #define X2_MS3_PIN -1 -#endif - -// The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #ifndef Y2_STEP_PIN - #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) - #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) - #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) - #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP) - #error "No E stepper plug left for Y2!" - #endif - #endif - #ifndef Y2_MS1_PIN - #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1) - #endif - #ifndef Y2_MS2_PIN - #define Y2_MS2_PIN _EPIN(Y2_E_INDEX, MS2) - #endif - #ifndef Y2_MS3_PIN - #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3) - #endif - #if AXIS_HAS_SPI(Y2) && !defined(Y2_CS_PIN) - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif - #if AXIS_HAS_UART(Y2) - #ifndef Y2_SERIAL_TX_PIN - #define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX) - #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) - #endif - #endif - #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) -#else - #define Z2_E_INDEX Y2_E_INDEX -#endif - -#ifndef Y2_CS_PIN - #define Y2_CS_PIN -1 -#endif -#ifndef Y2_MS1_PIN - #define Y2_MS1_PIN -1 -#endif -#ifndef Y2_MS2_PIN - #define Y2_MS2_PIN -1 -#endif -#ifndef Y2_MS3_PIN - #define Y2_MS3_PIN -1 -#endif - -// The Z2 axis, if any, should be the next open extruder port -#if Z_MULTI_STEPPER_DRIVERS - #ifndef Z2_STEP_PIN - #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) - #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) - #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) - #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP) - #error "No E stepper plug left for Z2!" - #endif - #endif - #ifndef Z2_MS1_PIN - #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1) - #endif - #ifndef Z2_MS2_PIN - #define Z2_MS2_PIN _EPIN(Z2_E_INDEX, MS2) - #endif - #ifndef Z2_MS3_PIN - #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3) - #endif - #if AXIS_HAS_SPI(Z2) && !defined(Z2_CS_PIN) - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif - #if AXIS_HAS_UART(Z2) - #ifndef Z2_SERIAL_TX_PIN - #define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX) - #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) - #endif - #endif - #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) -#else - #define Z3_E_INDEX Z2_E_INDEX -#endif - -#ifndef Z2_CS_PIN - #define Z2_CS_PIN -1 -#endif -#ifndef Z2_MS1_PIN - #define Z2_MS1_PIN -1 -#endif -#ifndef Z2_MS2_PIN - #define Z2_MS2_PIN -1 -#endif -#ifndef Z2_MS3_PIN - #define Z2_MS3_PIN -1 -#endif - -#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - #ifndef Z3_STEP_PIN - #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) - #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) - #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) - #if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP) - #error "No E stepper plug left for Z3!" - #endif - #endif - #if AXIS_HAS_SPI(Z3) - #ifndef Z3_CS_PIN - #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) - #endif - #endif - #ifndef Z3_MS1_PIN - #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1) - #endif - #ifndef Z3_MS2_PIN - #define Z3_MS2_PIN _EPIN(Z3_E_INDEX, MS2) - #endif - #ifndef Z3_MS3_PIN - #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3) - #endif - #if AXIS_HAS_UART(Z3) - #ifndef Z3_SERIAL_TX_PIN - #define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX) - #endif - #ifndef Z3_SERIAL_RX_PIN - #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) - #endif - #endif -#endif - -#ifndef Z3_CS_PIN - #define Z3_CS_PIN -1 -#endif -#ifndef Z3_MS1_PIN - #define Z3_MS1_PIN -1 -#endif -#ifndef Z3_MS2_PIN - #define Z3_MS2_PIN -1 -#endif -#ifndef Z3_MS3_PIN - #define Z3_MS3_PIN -1 -#endif - -#if HAS_GRAPHICAL_LCD - #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1) - #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 - #endif - #if !defined(ST7920_DELAY_2) && defined(BOARD_ST7920_DELAY_2) - #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 - #endif - #if !defined(ST7920_DELAY_3) && defined(BOARD_ST7920_DELAY_3) - #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 - #endif -#else - #undef ST7920_DELAY_1 - #undef ST7920_DELAY_2 - #undef ST7920_DELAY_3 -#endif - -#undef HAS_FREE_AUX2_PINS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug.h deleted file mode 100644 index 23a1abe8b7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug.h +++ /dev/null @@ -1,239 +0,0 @@ -/** - * 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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#define MAX_NAME_LENGTH 39 // one place to specify the format of all the sources of names - // "-" left justify, "39" minimum width of name, pad with blanks - -/** - * This routine minimizes RAM usage by creating a FLASH resident array to - * store the pin names, pin numbers and analog/digital flag. - * - * Creating the array in FLASH is a two pass process. The first pass puts the - * name strings into FLASH. The second pass actually creates the array. - * - * Both passes use the same pin list. The list contains two macro names. The - * actual macro definitions are changed depending on which pass is being done. - * - */ - -// first pass - put the name strings into FLASH - -#define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const char ENTRY_NAME[] PROGMEM = { PIN_NAME }; -#define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) - -#include "pinsDebug_list.h" -#line 46 - -// manually add pins that have names that are macros which don't play well with these macros -#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM)) - static const char RXD_NAME[] PROGMEM = { "RXD" }; - static const char TXD_NAME[] PROGMEM = { "TXD" }; -#endif - -///////////////////////////////////////////////////////////////////////////// - -// second pass - create the array - -#undef _ADD_PIN_2 -#undef _ADD_PIN -#undef REPORT_NAME_DIGITAL -#undef REPORT_NAME_ANALOG - -#define _ADD_PIN_2(ENTRY_NAME, NAME, IS_DIGITAL) { ENTRY_NAME, NAME, IS_DIGITAL }, -#define _ADD_PIN(NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2(entry_NAME_##COUNTER, NAME, IS_DIGITAL) -#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true) -#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) - - -typedef struct { - PGM_P const name; - pin_t pin; - bool is_digital; -} PinInfo; - -const PinInfo pin_array[] PROGMEM = { - - /** - * [pin name] [pin number] [is digital or analog] 1 = digital, 0 = analog - * Each entry takes up 6 bytes in FLASH: - * 2 byte pointer to location of the name string - * 2 bytes containing the pin number - * analog pin numbers were convereted to digital when the array was created - * 2 bytes containing the digital/analog bool flag - */ - - // manually add pins ... - #if SERIAL_PORT == 0 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME, 0, true }, - { TXD_NAME, 1, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME, 8, true }, - { TXD_NAME, 9, true }, - #endif - #endif - - #include "pinsDebug_list.h" - #line 98 - -}; - -#include HAL_PATH(../HAL, pinsDebug.h) // get the correct support file for this CPU - -#ifndef M43_NEVER_TOUCH - #define M43_NEVER_TOUCH(Q) false -#endif - -static void print_input_or_output(const bool isout) { - serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input = ")); -} - -// pretty report with PWM info -inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = false, const char *start_string = "") { - char buffer[MAX_NAME_LENGTH + 1]; // for the sprintf statements - bool found = false, multi_name_pin = false; - - for (uint8_t x = 0; x < COUNT(pin_array); x++) { // scan entire array and report all instances of this pin - if (GET_ARRAY_PIN(x) == pin) { - if (found) multi_name_pin = true; - found = true; - if (!multi_name_pin) { // report digital and analog pin number only on the first time through - sprintf_P(buffer, PSTR("%sPIN: "), start_string); // digital pin number - SERIAL_ECHO(buffer); - PRINT_PIN(pin); - PRINT_PORT(pin); - if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { - sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number - SERIAL_ECHO(buffer); - } - else SERIAL_ECHO_SP(8); // add padding if not an analog pin - } - else { - SERIAL_CHAR('.'); - SERIAL_ECHO_SP(MULTI_NAME_PAD + strlen(start_string)); // add padding if not the first instance found - } - PRINT_ARRAY_NAME(x); - if (extended) { - if (pin_is_protected(pin) && !ignore) - SERIAL_ECHOPGM("protected "); - else { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - if (pin == 46) { - print_input_or_output(IS_OUTPUT(46)); - SERIAL_CHAR('0' + READ(46)); - } - else if (pin == 47) { - print_input_or_output(IS_OUTPUT(47)); - SERIAL_CHAR('0' + READ(47)); - } - } - else - #endif - { - if (!GET_ARRAY_IS_DIGITAL(x)) { - sprintf_P(buffer, PSTR("Analog in = %5ld"), (long)analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin))); - SERIAL_ECHO(buffer); - } - else { - if (!GET_PINMODE(pin)) { - //pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this - // because this could interfere with inductive/capacitive - // sensors (high impedance voltage divider) and with Pt100 amplifier - print_input_or_output(false); - SERIAL_ECHO(digitalRead_mod(pin)); - } - else if (pwm_status(pin)) { - // do nothing - } - else { - print_input_or_output(true); - SERIAL_ECHO(digitalRead_mod(pin)); - } - } - if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report - } - } - } - SERIAL_EOL(); - } // end of IF - } // end of for loop - - if (!found) { - sprintf_P(buffer, PSTR("%sPIN: "), start_string); - SERIAL_ECHO(buffer); - PRINT_PIN(pin); - PRINT_PORT(pin); - if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { - sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number - SERIAL_ECHO(buffer); - } - else - SERIAL_ECHO_SP(8); // add padding if not an analog pin - SERIAL_ECHOPGM(""); - if (extended) { - #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO - if (pin == 46 || pin == 47) { - SERIAL_ECHO_SP(12); - if (pin == 46) { - print_input_or_output(IS_OUTPUT(46)); - SERIAL_CHAR('0' + READ(46)); - } - else { - print_input_or_output(IS_OUTPUT(47)); - SERIAL_CHAR('0' + READ(47)); - } - } - else - #endif - { - if (pwm_status(pin)) { - // do nothing - } - else if (GET_PINMODE(pin)) { - SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); - print_input_or_output(true); - SERIAL_ECHO(digitalRead_mod(pin)); - } - else { - if (IS_ANALOG(pin)) { - sprintf_P(buffer, PSTR(" Analog in = %5ld"), (long)analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin))); - SERIAL_ECHO(buffer); - SERIAL_ECHOPGM(" "); - } - else - SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); // add padding if not an analog pin - - print_input_or_output(false); - SERIAL_ECHO(digitalRead_mod(pin)); - } - //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin - if (extended) { - SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); - pwm_details(pin); // report PWM capabilities only if doing an extended report - } - } - } - SERIAL_EOL(); - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug_list.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug_list.h deleted file mode 100644 index 993c23b5c0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/pinsDebug_list.h +++ /dev/null @@ -1,1454 +0,0 @@ -/** - * 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 . - * - */ - -// Please update this list when adding new pins to Marlin. -// The order doesn't matter. -// Following this pattern is a must. -// If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. - -// Pin lists 1.1.x and 2.0.x synchronized 2018-02-17 - -#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(X2_MS1) - #undef X2_MS1_PIN -#endif -#if !PIN_EXISTS(X2_MS2) - #undef X2_MS2_PIN -#endif -#if !PIN_EXISTS(X2_MS3) - #undef X2_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(Y2_MS1) - #undef Y2_MS1_PIN -#endif -#if !PIN_EXISTS(Y2_MS2) - #undef Y2_MS2_PIN -#endif -#if !PIN_EXISTS(Y2_MS3) - #undef Y2_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(Z2_MS1) - #undef Z2_MS1_PIN -#endif -#if !PIN_EXISTS(Z2_MS2) - #undef Z2_MS2_PIN -#endif -#if !PIN_EXISTS(Z2_MS3) - #undef Z2_MS3_PIN -#endif -#if !PIN_EXISTS(Z3_MS1) - #undef Z3_MS1_PIN -#endif -#if !PIN_EXISTS(Z3_MS2) - #undef Z3_MS2_PIN -#endif -#if !PIN_EXISTS(Z3_MS3) - #undef Z3_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 -// - -#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) -#endif -#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A1) -#endif -#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A2) -#endif -#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A3) -#endif -#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A4) -#endif -#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) -#endif -#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) -#endif -#if !defined(ARDUINO_ARCH_SAM) && !defined(ARDUINO_ARCH_SAMD) //TC1 & TC2 are macros in the SAM/SAMD tool chain - #if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC1) - #endif - #if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TC2) - #endif -#endif -#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) -#endif -#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) -#endif -#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) -#endif -#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) -#endif -#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) -#endif -#if PIN_EXISTS(TEMP_5) && TEMP_5_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_5_PIN) -#endif -#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) -#endif -#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) -#endif -#if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS - REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) -#endif - -// -// Digital Pin Assignments -// - -#if defined(__FD) && __FD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FD) -#endif -#if defined(__FS) && __FS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __FS) -#endif -#if defined(__GD) && __GD >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GD) -#endif -#if defined(__GS) && __GS >= 0 - REPORT_NAME_DIGITAL(__LINE__, __GS) -#endif -#if PIN_EXISTS(AVR_MISO) - REPORT_NAME_DIGITAL(__LINE__, AVR_MISO_PIN) -#endif -#if PIN_EXISTS(AVR_MOSI) - REPORT_NAME_DIGITAL(__LINE__, AVR_MOSI_PIN) -#endif -#if PIN_EXISTS(AVR_SCK) - REPORT_NAME_DIGITAL(__LINE__, AVR_SCK_PIN) -#endif -#if PIN_EXISTS(ALARM) - REPORT_NAME_DIGITAL(__LINE__, ALARM_PIN) -#endif -#if PIN_EXISTS(AVR_SS) - REPORT_NAME_DIGITAL(__LINE__, AVR_SS_PIN) -#endif -#if PIN_EXISTS(BEEPER) - REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN) -#endif -#if defined(BTN_BACK) && BTN_BACK >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_BACK) -#endif -#if defined(BTN_CENTER) && BTN_CENTER >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER) -#endif -#if defined(BTN_DOWN) && BTN_DOWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN) -#endif -#if defined(BTN_DWN) && BTN_DWN >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_DWN) -#endif -#if defined(BTN_EN1) && BTN_EN1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN1) -#endif -#if defined(BTN_EN2) && BTN_EN2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) -#endif -#if defined(BTN_ENC) && BTN_ENC >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) -#endif -#if defined(BTN_HOME) && BTN_HOME >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_HOME) -#endif -#if defined(BTN_LEFT) && BTN_LEFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT) -#endif -#if defined(BTN_LFT) && BTN_LFT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_LFT) -#endif -#if defined(BTN_RIGHT) && BTN_RIGHT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT) -#endif -#if defined(BTN_RT) && BTN_RT >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_RT) -#endif -#if defined(BTN_UP) && BTN_UP >= 0 - REPORT_NAME_DIGITAL(__LINE__, BTN_UP) -#endif -#if PIN_EXISTS(CASE_LIGHT) - REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN) -#endif -#if PIN_EXISTS(CHAMBER_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, CHAMBER_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(CONTROLLER_FAN) - REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN) -#endif -#if PIN_EXISTS(COOLANT_FLOOD) - REPORT_NAME_DIGITAL(__LINE__, COOLANT_FLOOD_PIN) -#endif -#if PIN_EXISTS(COOLANT_MIST) - REPORT_NAME_DIGITAL(__LINE__, COOLANT_MIST_PIN) -#endif -#if PIN_EXISTS(CUTOFF_RESET) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_RESET_PIN) -#endif -#if PIN_EXISTS(CUTOFF_TEST) - REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN) -#endif -#if defined(D57) && D57 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D57) -#endif -#if defined(D58) && D58 >= 0 - REPORT_NAME_DIGITAL(__LINE__, D58) -#endif -#if PIN_EXISTS(DAC_DISABLE) - REPORT_NAME_DIGITAL(__LINE__, DAC_DISABLE_PIN) -#endif -#if defined(DAC0_SYNC) && DAC0_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC0_SYNC) -#endif -#if defined(DAC1_SYNC) && DAC1_SYNC >= 0 - REPORT_NAME_DIGITAL(__LINE__, DAC1_SYNC) -#endif -#if PIN_EXISTS(DEBUG) - REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN) -#endif -#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL) -#endif -#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0) -#endif -#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1) -#endif -#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X) -#endif -#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y) -#endif -#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z) -#endif -#if PIN_EXISTS(DIGIPOTSS) - REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN) -#endif -#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0) -#endif -#if defined(DOGLCD_CS) && DOGLCD_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS) -#endif -#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI) -#endif -#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK) -#endif -#if defined(TMC_SW_MISO) && TMC_SW_MISO >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO) -#endif -#if defined(TMC_SW_MOSI) && TMC_SW_MOSI >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI) -#endif -#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 - REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) -#endif -#if PIN_EXISTS(E_MUX0) - REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN) -#endif -#if PIN_EXISTS(E_MUX1) - REPORT_NAME_DIGITAL(__LINE__, E_MUX1_PIN) -#endif -#if PIN_EXISTS(E_MUX2) - REPORT_NAME_DIGITAL(__LINE__, E_MUX2_PIN) -#endif -#if PIN_EXISTS(E_STOP) - REPORT_NAME_DIGITAL(__LINE__, E_STOP_PIN) -#endif -#if PIN_EXISTS(E0_ATT) - REPORT_NAME_DIGITAL(__LINE__, E0_ATT_PIN) -#endif -#if PIN_EXISTS(E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E0_CS) - REPORT_NAME_DIGITAL(__LINE__, E0_CS_PIN) -#endif -#if PIN_EXISTS(E0_DIR) - REPORT_NAME_DIGITAL(__LINE__, E0_DIR_PIN) -#endif -#if PIN_EXISTS(E0_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E0_ENABLE_PIN) -#endif -#if PIN_EXISTS(E0_MS1) - REPORT_NAME_DIGITAL(__LINE__, E0_MS1_PIN) -#endif -#if PIN_EXISTS(E0_MS2) - REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN) -#endif -#if PIN_EXISTS(E0_MS3) - REPORT_NAME_DIGITAL(__LINE__, E0_MS3_PIN) -#endif -#if PIN_EXISTS(E0_STEP) - REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN) -#endif -#if PIN_EXISTS(E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E1_CS) - REPORT_NAME_DIGITAL(__LINE__, E1_CS_PIN) -#endif -#if PIN_EXISTS(E1_DIR) - REPORT_NAME_DIGITAL(__LINE__, E1_DIR_PIN) -#endif -#if PIN_EXISTS(E1_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E1_ENABLE_PIN) -#endif -#if PIN_EXISTS(E1_MS1) - REPORT_NAME_DIGITAL(__LINE__, E1_MS1_PIN) -#endif -#if PIN_EXISTS(E1_MS2) - REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN) -#endif -#if PIN_EXISTS(E1_MS3) - REPORT_NAME_DIGITAL(__LINE__, E1_MS3_PIN) -#endif -#if PIN_EXISTS(E1_STEP) - REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN) -#endif -#if PIN_EXISTS(E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E2_CS) - REPORT_NAME_DIGITAL(__LINE__, E2_CS_PIN) -#endif -#if PIN_EXISTS(E2_DIR) - REPORT_NAME_DIGITAL(__LINE__, E2_DIR_PIN) -#endif -#if PIN_EXISTS(E2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E2_ENABLE_PIN) -#endif -#if PIN_EXISTS(E2_MS1) - REPORT_NAME_DIGITAL(__LINE__, E2_MS1_PIN) -#endif -#if PIN_EXISTS(E2_MS2) - REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN) -#endif -#if PIN_EXISTS(E2_MS3) - REPORT_NAME_DIGITAL(__LINE__, E2_MS3_PIN) -#endif -#if PIN_EXISTS(E2_STEP) - REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN) -#endif -#if PIN_EXISTS(E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E3_CS) - REPORT_NAME_DIGITAL(__LINE__, E3_CS_PIN) -#endif -#if PIN_EXISTS(E3_DIR) - REPORT_NAME_DIGITAL(__LINE__, E3_DIR_PIN) -#endif -#if PIN_EXISTS(E3_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E3_ENABLE_PIN) -#endif -#if PIN_EXISTS(E3_MS1) - REPORT_NAME_DIGITAL(__LINE__, E3_MS1_PIN) -#endif -#if PIN_EXISTS(E3_MS2) - REPORT_NAME_DIGITAL(__LINE__, E3_MS2_PIN) -#endif -#if PIN_EXISTS(E3_MS3) - REPORT_NAME_DIGITAL(__LINE__, E3_MS3_PIN) -#endif -#if PIN_EXISTS(E3_STEP) - REPORT_NAME_DIGITAL(__LINE__, E3_STEP_PIN) -#endif -#if PIN_EXISTS(E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E4_CS) - REPORT_NAME_DIGITAL(__LINE__, E4_CS_PIN) -#endif -#if PIN_EXISTS(E4_DIR) - REPORT_NAME_DIGITAL(__LINE__, E4_DIR_PIN) -#endif -#if PIN_EXISTS(E4_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E4_ENABLE_PIN) -#endif -#if PIN_EXISTS(E4_MS1) - REPORT_NAME_DIGITAL(__LINE__, E4_MS1_PIN) -#endif -#if PIN_EXISTS(E4_MS2) - REPORT_NAME_DIGITAL(__LINE__, E4_MS2_PIN) -#endif -#if PIN_EXISTS(E4_MS3) - REPORT_NAME_DIGITAL(__LINE__, E4_MS3_PIN) -#endif -#if PIN_EXISTS(E4_STEP) - REPORT_NAME_DIGITAL(__LINE__, E4_STEP_PIN) -#endif -#if PIN_EXISTS(E5_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, E5_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(E5_CS) - REPORT_NAME_DIGITAL(__LINE__, E5_CS_PIN) -#endif -#if PIN_EXISTS(E5_DIR) - REPORT_NAME_DIGITAL(__LINE__, E5_DIR_PIN) -#endif -#if PIN_EXISTS(E5_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, E5_ENABLE_PIN) -#endif -#if PIN_EXISTS(E5_MS1) - REPORT_NAME_DIGITAL(__LINE__, E5_MS1_PIN) -#endif -#if PIN_EXISTS(E5_MS2) - REPORT_NAME_DIGITAL(__LINE__, E5_MS2_PIN) -#endif -#if PIN_EXISTS(E5_MS3) - REPORT_NAME_DIGITAL(__LINE__, E5_MS3_PIN) -#endif -#if PIN_EXISTS(E5_STEP) - REPORT_NAME_DIGITAL(__LINE__, E5_STEP_PIN) -#endif -#if defined(ENET_CRS) && ENET_CRS >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) -#endif -#if defined(ENET_MDIO) && ENET_MDIO >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO) -#endif -#if defined(ENET_MOC) && ENET_MOC >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_MOC) -#endif -#if defined(ENET_RX_ER) && ENET_RX_ER >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER) -#endif -#if defined(ENET_RXD0) && ENET_RXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0) -#endif -#if defined(ENET_RXD1) && ENET_RXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1) -#endif -#if defined(ENET_TX_EN) && ENET_TX_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN) -#endif -#if defined(ENET_TXD0) && ENET_TXD0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0) -#endif -#if defined(ENET_TXD1) && ENET_TXD1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1) -#endif -#if PIN_EXISTS(EXP_VOLTAGE_LEVEL) - REPORT_NAME_DIGITAL(__LINE__, EXP_VOLTAGE_LEVEL_PIN) -#endif - -#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO) -#endif -#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO) -#endif -#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO) -#endif -#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO) -#endif -#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO) -#endif -#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24) -#endif -#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2) -#endif -#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0) -#endif -#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1) -#endif -#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3) -#endif -#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN) -#endif -#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 - REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN) -#endif -#if PIN_EXISTS(FAN) - REPORT_NAME_DIGITAL(__LINE__, FAN_PIN) -#endif -#if PIN_EXISTS(FAN1) - REPORT_NAME_DIGITAL(__LINE__, FAN1_PIN) -#endif -#if PIN_EXISTS(FAN2) - REPORT_NAME_DIGITAL(__LINE__, FAN2_PIN) -#endif -#if PIN_EXISTS(FAN3) - REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT2) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT2_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT3) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT3_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT4) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT4_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT5) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT5_PIN) -#endif -#if PIN_EXISTS(FIL_RUNOUT6) - REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT6_PIN) -#endif -#if PIN_EXISTS(HEATER_0) - REPORT_NAME_DIGITAL(__LINE__, HEATER_0_PIN) -#endif -#if PIN_EXISTS(HEATER_1) - REPORT_NAME_DIGITAL(__LINE__, HEATER_1_PIN) -#endif -#if PIN_EXISTS(HEATER_2) - REPORT_NAME_DIGITAL(__LINE__, HEATER_2_PIN) -#endif -#if PIN_EXISTS(HEATER_3) - REPORT_NAME_DIGITAL(__LINE__, HEATER_3_PIN) -#endif -#if PIN_EXISTS(HEATER_4) - REPORT_NAME_DIGITAL(__LINE__, HEATER_4_PIN) -#endif -#if PIN_EXISTS(HEATER_5) - REPORT_NAME_DIGITAL(__LINE__, HEATER_5_PIN) -#endif -#if PIN_EXISTS(HEATER_6) - REPORT_NAME_DIGITAL(__LINE__, HEATER_6_PIN) -#endif -#if PIN_EXISTS(HEATER_7) - REPORT_NAME_DIGITAL(__LINE__, HEATER_7_PIN) -#endif -#if PIN_EXISTS(HEATER_BED) - REPORT_NAME_DIGITAL(__LINE__, HEATER_BED_PIN) -#endif -#if PIN_EXISTS(HOME) - REPORT_NAME_DIGITAL(__LINE__, HOME_PIN) -#endif -#if PIN_EXISTS(I2C_SCL) - REPORT_NAME_DIGITAL(__LINE__, I2C_SCL_PIN) -#endif -#if PIN_EXISTS(I2C_SDA) - REPORT_NAME_DIGITAL(__LINE__, I2C_SDA_PIN) -#endif -#if PIN_EXISTS(KILL) - REPORT_NAME_DIGITAL(__LINE__, KILL_PIN) -#endif -#if PIN_EXISTS(LCD_BACKLIGHT) - REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN) -#endif -#if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4) -#endif -#if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5) -#endif -#if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6) -#endif -#if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7) -#endif -#if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE) -#endif -#if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS) -#endif -#if defined(LCD_SDSS) && LCD_SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS) -#endif -#if PIN_EXISTS(LED_GREEN) - REPORT_NAME_DIGITAL(__LINE__, LED_GREEN_PIN) -#endif -#if PIN_EXISTS(LED) - REPORT_NAME_DIGITAL(__LINE__, LED_PIN) -#endif -#if PIN_EXISTS(LED_RED) - REPORT_NAME_DIGITAL(__LINE__, LED_RED_PIN) -#endif -#if PIN_EXISTS(MAX) - REPORT_NAME_DIGITAL(__LINE__, MAX_PIN) -#endif -#if PIN_EXISTS(MAX6675_DO) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_DO_PIN) -#endif -#if PIN_EXISTS(MAX6675_SCK) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN) -#endif -#if PIN_EXISTS(MAX6675_SS) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS_PIN) -#endif -#if PIN_EXISTS(MAX6675_SS2) - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS2_PIN) -#endif -// #if defined(MISO) && MISO >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MISO) -// #endif -#if PIN_EXISTS(MISO) - REPORT_NAME_DIGITAL(__LINE__, MISO_PIN) -#endif -#if PIN_EXISTS(MOSFET_A) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN) -#endif -#if PIN_EXISTS(MOSFET_B) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_B_PIN) -#endif -#if PIN_EXISTS(MOSFET_C) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_C_PIN) -#endif -#if PIN_EXISTS(MOSFET_D) - REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN) -#endif -// #if defined(MOSI) && MOSI >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MOSI) -// #endif -#if PIN_EXISTS(MOSI) - REPORT_NAME_DIGITAL(__LINE__, MOSI_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_E_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_X_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Y_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_XY_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_X_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Y_PIN) -#endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_Z_PIN) -#endif -#if PIN_EXISTS(MOTOR_FAULT) - REPORT_NAME_DIGITAL(__LINE__, MOTOR_FAULT_PIN) -#endif -#if PIN_EXISTS(ORIG_E0_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E0_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E1_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E1_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E2_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E2_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E3_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E3_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E4_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E4_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(ORIG_E5_AUTO_FAN) - REPORT_NAME_DIGITAL(__LINE__, ORIG_E5_AUTO_FAN_PIN) -#endif -#if PIN_EXISTS(PHOTOGRAPH) - REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN) -#endif -#if PIN_EXISTS(PS_ON) - REPORT_NAME_DIGITAL(__LINE__, PS_ON_PIN) -#endif -#if PIN_EXISTS(PWM_1) - REPORT_NAME_DIGITAL(__LINE__, PWM_1_PIN) -#endif -#if PIN_EXISTS(PWM_2) - REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN) -#endif -#if defined(REF_CLK) && REF_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, REF_CLK) -#endif -#if PIN_EXISTS(RAMPS_D10) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D10_PIN) -#endif -#if PIN_EXISTS(RAMPS_D8) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D8_PIN) -#endif -#if PIN_EXISTS(RAMPS_D9) - REPORT_NAME_DIGITAL(__LINE__, RAMPS_D9_PIN) -#endif -#if PIN_EXISTS(RGB_LED_R) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_R_PIN) -#endif -#if PIN_EXISTS(RGB_LED_G) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_G_PIN) -#endif -#if PIN_EXISTS(RGB_LED_B) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_B_PIN) -#endif -#if PIN_EXISTS(RGB_LED_W) - REPORT_NAME_DIGITAL(__LINE__, RGB_LED_W_PIN) -#endif -#if PIN_EXISTS(RX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, RX_ENABLE_PIN) -#endif -#if PIN_EXISTS(SAFETY_TRIGGERED) - REPORT_NAME_DIGITAL(__LINE__, SAFETY_TRIGGERED_PIN) -#endif -// #if defined(SCK) && SCK >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCK) -// #endif -#if PIN_EXISTS(SCK) - REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) -#endif -// #if defined(SCL) && SCL >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCL) -// #endif -#if PIN_EXISTS(SD_DETECT) - REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) -#endif -// #if defined(SDA) && SDA >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SDA) -// #endif -#if PIN_EXISTS(SDPOWER) - REPORT_NAME_DIGITAL(__LINE__, SDPOWER_PIN) -#endif -#if defined(SDSS) && SDSS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDSS) -#endif -#if defined(SERVO0) && SERVO0 >= 0 - REPORT_NAME_DIGITAL(__LINE__, SERVO0) -#endif -#if PIN_EXISTS(SERVO0) - REPORT_NAME_DIGITAL(__LINE__, SERVO0_PIN) -#endif -#if PIN_EXISTS(SERVO1) - REPORT_NAME_DIGITAL(__LINE__, SERVO1_PIN) -#endif -#if PIN_EXISTS(SERVO2) - REPORT_NAME_DIGITAL(__LINE__, SERVO2_PIN) -#endif -#if PIN_EXISTS(SERVO3) - REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN) -#endif -#if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK) -#endif -#if defined(SHIFT_EN) && SHIFT_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN) -#endif -#if defined(SHIFT_LD) && SHIFT_LD >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD) -#endif -#if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT) -#endif -#if PIN_EXISTS(SLED) - REPORT_NAME_DIGITAL(__LINE__, SLED_PIN) -#endif -#if PIN_EXISTS(SLEEP_WAKE) - REPORT_NAME_DIGITAL(__LINE__, SLEEP_WAKE_PIN) -#endif -#if PIN_EXISTS(SOL0) - REPORT_NAME_DIGITAL(__LINE__, SOL0_PIN) -#endif -#if PIN_EXISTS(SOL1) - REPORT_NAME_DIGITAL(__LINE__, SOL1_PIN) -#endif -#if PIN_EXISTS(SOL2) - REPORT_NAME_DIGITAL(__LINE__, SOL2_PIN) -#endif -#if PIN_EXISTS(SOL3) - REPORT_NAME_DIGITAL(__LINE__, SOL3_PIN) -#endif -#if PIN_EXISTS(SOL4) - REPORT_NAME_DIGITAL(__LINE__, SOL4_PIN) -#endif -#if PIN_EXISTS(SOL5) - REPORT_NAME_DIGITAL(__LINE__, SOL5_PIN) -#endif -#if defined(SPARE_IO) && SPARE_IO >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPARE_IO) -#endif -#if defined(SPI_EEPROM1_CS) && SPI_EEPROM1_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM1_CS) -#endif -#if defined(SPI_EEPROM2_CS) && SPI_EEPROM2_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM2_CS) -#endif -#if defined(SPI_FLASH_CS) && SPI_FLASH_CS >= 0 - REPORT_NAME_DIGITAL(__LINE__, SPI_FLASH_CS) -#endif -#if PIN_EXISTS(SPINDLE_DIR) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_DIR_PIN) -#endif -#if PIN_EXISTS(SPINDLE_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_ENABLE_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_ENA) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_ENA_PIN) -#endif -#if PIN_EXISTS(SPINDLE_LASER_PWM) - REPORT_NAME_DIGITAL(__LINE__, SPINDLE_LASER_PWM_PIN) -#endif -#if PIN_EXISTS(SR_CLK) - REPORT_NAME_DIGITAL(__LINE__, SR_CLK_PIN) -#endif -#if PIN_EXISTS(SR_DATA) - REPORT_NAME_DIGITAL(__LINE__, SR_DATA_PIN) -#endif -#if PIN_EXISTS(SR_STROBE) - REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN) -#endif -#if PIN_EXISTS(SS) - REPORT_NAME_DIGITAL(__LINE__, SS_PIN) -#endif -#if PIN_EXISTS(STAT_LED_BLUE) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) -#endif -#if defined(STAT_LED_RED_LED) && STAT_LED_RED_LED >= 0 - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED) -#endif -#if PIN_EXISTS(STAT_LED_RED) - REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_PIN) -#endif -#if PIN_EXISTS(STEPPER_RESET) - REPORT_NAME_DIGITAL(__LINE__, STEPPER_RESET_PIN) -#endif -#if PIN_EXISTS(SUICIDE) - REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN) -#endif -#if PIN_EXISTS(THERMO_CS1) - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1_PIN) -#endif -#if PIN_EXISTS(THERMO_CS2) - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2_PIN) -#endif -#if PIN_EXISTS(THERMO_DO) - REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN) -#endif -#if PIN_EXISTS(THERMO_SCK) - REPORT_NAME_DIGITAL(__LINE__, THERMO_SCK_PIN) -#endif -#if PIN_EXISTS(TLC_BLANK) - REPORT_NAME_DIGITAL(__LINE__, TLC_BLANK_PIN) -#endif -#if PIN_EXISTS(TLC_CLOCK) - REPORT_NAME_DIGITAL(__LINE__, TLC_CLOCK_PIN) -#endif -#if PIN_EXISTS(TLC_DATA) - REPORT_NAME_DIGITAL(__LINE__, TLC_DATA_PIN) -#endif -#if PIN_EXISTS(TLC_XLAT) - REPORT_NAME_DIGITAL(__LINE__, TLC_XLAT_PIN) -#endif -#if PIN_EXISTS(TOOL_0) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PIN) -#endif -#if PIN_EXISTS(TOOL_0_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_1) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PIN) -#endif -#if PIN_EXISTS(TOOL_1_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_2) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PIN) -#endif -#if PIN_EXISTS(TOOL_2_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_3) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PIN) -#endif -#if PIN_EXISTS(TOOL_3_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PWM_PIN) -#endif -#if PIN_EXISTS(TOOL_PWM) - REPORT_NAME_DIGITAL(__LINE__, TOOL_PWM_PIN) -#endif -#if PIN_EXISTS(TX_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN) -#endif -#if defined(UI1) && UI1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI1) -#endif -#if defined(UI2) && UI2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, UI2) -#endif -#if defined(UNUSED_PWM) && UNUSED_PWM >= 0 - REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM) -#endif -#if PIN_EXISTS(X_ATT) - REPORT_NAME_DIGITAL(__LINE__, X_ATT_PIN) -#endif -#if PIN_EXISTS(X_CS) - REPORT_NAME_DIGITAL(__LINE__, X_CS_PIN) -#endif -#if PIN_EXISTS(X_DIR) - REPORT_NAME_DIGITAL(__LINE__, X_DIR_PIN) -#endif -#if PIN_EXISTS(X_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X_ENABLE_PIN) -#endif -#if PIN_EXISTS(X_MAX) - REPORT_NAME_DIGITAL(__LINE__, X_MAX_PIN) -#endif -#if PIN_EXISTS(X_MIN) - REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN) -#endif -#if PIN_EXISTS(X_MS1) - REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN) -#endif -#if PIN_EXISTS(X_MS2) - REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN) -#endif -#if PIN_EXISTS(X_MS3) - REPORT_NAME_DIGITAL(__LINE__, X_MS3_PIN) -#endif -#if PIN_EXISTS(X_STEP) - REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN) -#endif -#if PIN_EXISTS(X_STOP) - REPORT_NAME_DIGITAL(__LINE__, X_STOP_PIN) -#endif -#if PIN_EXISTS(X2_DIR) - REPORT_NAME_DIGITAL(__LINE__, X2_DIR_PIN) -#endif -#if PIN_EXISTS(X2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) -#endif -#if PIN_EXISTS(X2_MS1) - REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN) -#endif -#if PIN_EXISTS(X2_MS2) - REPORT_NAME_DIGITAL(__LINE__, X2_MS2_PIN) -#endif -#if PIN_EXISTS(X2_MS3) - REPORT_NAME_DIGITAL(__LINE__, X2_MS3_PIN) -#endif -#if PIN_EXISTS(X2_STEP) - REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN) -#endif -#if PIN_EXISTS(Y_ATT) - REPORT_NAME_DIGITAL(__LINE__, Y_ATT_PIN) -#endif -#if PIN_EXISTS(Y_CS) - REPORT_NAME_DIGITAL(__LINE__, Y_CS_PIN) -#endif -#if PIN_EXISTS(Y_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y_DIR_PIN) -#endif -#if PIN_EXISTS(Y_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y_MAX) - REPORT_NAME_DIGITAL(__LINE__, Y_MAX_PIN) -#endif -#if PIN_EXISTS(Y_MIN) - REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN) -#endif -#if PIN_EXISTS(Y_MS1) - REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN) -#endif -#if PIN_EXISTS(Y_MS2) - REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN) -#endif -#if PIN_EXISTS(Y_MS3) - REPORT_NAME_DIGITAL(__LINE__, Y_MS3_PIN) -#endif -#if PIN_EXISTS(Y_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN) -#endif -#if PIN_EXISTS(Y_STOP) - REPORT_NAME_DIGITAL(__LINE__, Y_STOP_PIN) -#endif -#if PIN_EXISTS(Y2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Y2_DIR_PIN) -#endif -#if PIN_EXISTS(Y2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Y2_MS1) - REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN) -#endif -#if PIN_EXISTS(Y2_MS2) - REPORT_NAME_DIGITAL(__LINE__, Y2_MS2_PIN) -#endif -#if PIN_EXISTS(Y2_MS3) - REPORT_NAME_DIGITAL(__LINE__, Y2_MS3_PIN) -#endif -#if PIN_EXISTS(Y2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN) -#endif -#if PIN_EXISTS(Z_ATT) - REPORT_NAME_DIGITAL(__LINE__, Z_ATT_PIN) -#endif -#if PIN_EXISTS(Z_CS) - REPORT_NAME_DIGITAL(__LINE__, Z_CS_PIN) -#endif -#if PIN_EXISTS(Z_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z_DIR_PIN) -#endif -#if PIN_EXISTS(Z_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z_MAX) - REPORT_NAME_DIGITAL(__LINE__, Z_MAX_PIN) -#endif -#if PIN_EXISTS(Z_MIN) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN) -#endif -#if PIN_EXISTS(Z_MIN_PROBE) - REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) -#endif -#if PIN_EXISTS(Z_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN) -#endif -#if PIN_EXISTS(Z_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) -#endif -#if PIN_EXISTS(Z_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z_MS3_PIN) -#endif -#if PIN_EXISTS(Z_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) -#endif -#if PIN_EXISTS(Z_STOP) - REPORT_NAME_DIGITAL(__LINE__, Z_STOP_PIN) -#endif -#if PIN_EXISTS(Z2_CS) - REPORT_NAME_DIGITAL(__LINE__, Z2_CS_PIN) -#endif -#if PIN_EXISTS(Z2_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z2_DIR_PIN) -#endif -#if PIN_EXISTS(Z2_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z2_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN) -#endif -#if PIN_EXISTS(Z2_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS2_PIN) -#endif -#if PIN_EXISTS(Z2_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z2_MS3_PIN) -#endif -#if PIN_EXISTS(Z2_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z2_STEP_PIN) -#endif -#if PIN_EXISTS(Z3_CS) - REPORT_NAME_DIGITAL(__LINE__, Z3_CS_PIN) -#endif -#if PIN_EXISTS(Z3_DIR) - REPORT_NAME_DIGITAL(__LINE__, Z3_DIR_PIN) -#endif -#if PIN_EXISTS(Z3_ENABLE) - REPORT_NAME_DIGITAL(__LINE__, Z3_ENABLE_PIN) -#endif -#if PIN_EXISTS(Z3_MS1) - REPORT_NAME_DIGITAL(__LINE__, Z3_MS1_PIN) -#endif -#if PIN_EXISTS(Z3_MS2) - REPORT_NAME_DIGITAL(__LINE__, Z3_MS2_PIN) -#endif -#if PIN_EXISTS(Z3_MS3) - REPORT_NAME_DIGITAL(__LINE__, Z3_MS3_PIN) -#endif -#if PIN_EXISTS(Z3_STEP) - REPORT_NAME_DIGITAL(__LINE__, Z3_STEP_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D6) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN) -#endif -#if PIN_EXISTS(ZRIB_V20_D9) - REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D9_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(X2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Y2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(Z3_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, Z3_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(Z3_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, Z3_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E0_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E1_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E2_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E3_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E4_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(E5_SERIAL_TX) - REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_TX_PIN) -#endif -#if PIN_EXISTS(E5_SERIAL_RX) - REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_SCK) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SCK_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_MISO) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_MISO_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_MOSI) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_MOSI_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_SS) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SS_PIN) -#endif -#if PIN_EXISTS(L6470_RESET_CHAIN) - REPORT_NAME_DIGITAL(__LINE__, L6470_RESET_CHAIN_PIN) -#endif -#if PIN_EXISTS(FET_SAFETY) - REPORT_NAME_DIGITAL(__LINE__, FET_SAFETY_PIN) -#endif -#if PIN_EXISTS(TOUCH_MISO) - REPORT_NAME_DIGITAL(__LINE__, TOUCH_MISO_PIN) -#endif -#if PIN_EXISTS(TOUCH_MOSI) - REPORT_NAME_DIGITAL(__LINE__, TOUCH_MOSI_PIN) -#endif -#if PIN_EXISTS(TOUCH_SCK) - REPORT_NAME_DIGITAL(__LINE__, TOUCH_SCK_PIN) -#endif -#if PIN_EXISTS(TOUCH_CS) - REPORT_NAME_DIGITAL(__LINE__, TOUCH_CS_PIN) -#endif -#if PIN_EXISTS(TOUCH_INT) - REPORT_NAME_DIGITAL(__LINE__, TOUCH_INT_PIN) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h deleted file mode 100644 index d667032c9c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ /dev/null @@ -1,180 +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 - -/** - * Einsy-Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Einsy Rambo" - -// -// TMC2130 Configuration_adv defaults for EinsyRambo -// -#if !AXIS_DRIVER_TYPE_X(TMC2130) || !AXIS_DRIVER_TYPE_Y(TMC2130) || !AXIS_DRIVER_TYPE_Z(TMC2130) || !AXIS_DRIVER_TYPE_E0(TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRambo." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_STOP_PIN 12 - #define Y_STOP_PIN 11 - #define Z_STOP_PIN 10 - -#else - - #define X_STOP_PIN X_DIAG_PIN - #define Y_STOP_PIN Y_DIAG_PIN - - #if ENABLED(BLTOUCH) - #define Z_STOP_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_STOP_PIN 10 - #endif - -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif - -#ifndef FAN1_PIN - #define FAN1_PIN 6 -#endif - -// -// Misc. Functions -// -#define SDSS 77 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 18 // Pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL - - #define KILL_PIN 32 - - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 61 - #define BTN_EN2 59 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 61 - #define LCD_PINS_D4 59 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - #define SD_DETECT_PIN 15 - - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RETRO.h deleted file mode 100644 index 9ca51ac86f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ /dev/null @@ -1,195 +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 - -/** - * Einsy-Retro pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Einsy Retro" - -// -// TMC2130 Configuration_adv defaults for EinsyRetro -// -#if !AXIS_DRIVER_TYPE_X(TMC2130) || !AXIS_DRIVER_TYPE_Y(TMC2130) || !AXIS_DRIVER_TYPE_Z(TMC2130) || !AXIS_DRIVER_TYPE_E0(TMC2130) - #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro." -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 64 -#define Y_DIAG_PIN 69 -#define Z_DIAG_PIN 68 -#define E0_DIAG_PIN 65 - -// -// Limit Switches -// -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -// -// SERVO0_PIN and Z_MIN_PIN configuration for BLTOUCH sensor when combined with SENSORLESS_HOMING. -// - -#if DISABLED(SENSORLESS_HOMING) - - #define X_MIN_PIN 12 - #define Y_MIN_PIN 11 - #define Z_MIN_PIN 10 - #define X_MAX_PIN 81 - #define Y_MAX_PIN 57 - -#else - - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_DIAG_PIN - #define X_MAX_PIN 81 - #else - #define X_MIN_PIN 12 - #define X_MAX_PIN X_DIAG_PIN - #endif - - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_DIAG_PIN - #define Y_MAX_PIN 57 - #else - #define Y_MIN_PIN 11 - #define Y_MAX_PIN Y_DIAG_PIN - #endif - - #if ENABLED(BLTOUCH) - #define Z_MIN_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_MIN_PIN 10 - #endif - -#endif - -#define Z_MAX_PIN 7 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 10 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 49 -#define X_ENABLE_PIN 29 -#define X_CS_PIN 41 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 48 -#define Y_ENABLE_PIN 28 -#define Y_CS_PIN 39 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 -#define Z_CS_PIN 67 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 -#define E0_CS_PIN 66 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 9 - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 18 // Pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 - -// -// LCD / Controller -// -#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) - - #define KILL_PIN 32 - - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 18 - #define BTN_EN2 19 - #else - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 // On 0.6b, use 61 - #define LCD_PINS_D4 19 // On 0.6b, use 59 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 - #endif - - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 - - #define SD_DETECT_PIN 15 - - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_MINIRAMBO.h deleted file mode 100644 index 51c5fab892..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ /dev/null @@ -1,192 +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 - -/** - * Mini-RAMBo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'RAMBo' in 'Tools > Board.'" -#endif - -#if MB(MINIRAMBO_10A) - #define BOARD_INFO_NAME "Mini RAMBo 1.0a" -#else - #define BOARD_INFO_NAME "Mini RAMBo" -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 30 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 24 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 23 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 23 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 - -#define MOTOR_CURRENT_PWM_XY_PIN 46 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 44 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_1_PIN 7 -#if !MB(MINIRAMBO_10A) - #define HEATER_2_PIN 6 -#endif -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#if !MB(MINIRAMBO_10A) - #define CASE_LIGHT_PIN 9 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -// use P1 connector for spindle pins -#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 18 // Pullup! -#define SPINDLE_DIR_PIN 19 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#if !MB(MINIRAMBO_10A) - #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL - - #if !MB(MINIRAMBO_10A) - #define KILL_PIN 32 - #endif - - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL - - #if MB(MINIRAMBO_10A) - - #define BEEPER_PIN 78 - - #define BTN_EN1 80 - #define BTN_EN2 73 - #define BTN_ENC 21 - - #define LCD_PINS_RS 38 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 15 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 31 - - #define SD_DETECT_PIN 72 - - #else // !MINIRAMBO_10A - - // AUX-4 - #define BEEPER_PIN 84 - - // AUX-2 - #define BTN_EN1 14 - #define BTN_EN2 72 - #define BTN_ENC 9 - - #define LCD_PINS_RS 82 - #define LCD_PINS_ENABLE 18 - #define LCD_PINS_D4 19 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - - #define SD_DETECT_PIN 15 - - #endif // !MINIRAMBO_10A - - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_RAMBO.h deleted file mode 100644 index cae6b1e07e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_RAMBO.h +++ /dev/null @@ -1,255 +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 - -/** - * IMPORTANT NOTE: - * Rambo users should be sure to compile Marlin using either the RAMBo - * board type if using the Arduino IDE - available via the link below - or - * the 'rambo' environment if using platformio, by specifying '-e rambo' on - * the command line or by changing the value of the 'env_default' variable to - * 'rambo' in the supplied platformio.ini. - * - * If you don't compile using the proper board type, the RAMBo's extended - * pins will likely be unavailable and accessories/addons may not work. - * - * Instructions for installing the Arduino RAMBo board type for the - * Arduino IDE are available at: - * http://reprap.org/wiki/Rambo_firmware - */ - -/** - * Rambo pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Rambo" - -#define POWER_LOSS_DETECT_PIN 44 -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MAX_PIN 30 -#define FIL_RUNOUT_PIN -1//24 - - -#if ENABLED(BLTOUCH) - #define Z_MIN_PIN 22 -#elif ENABLED(FIX_MOUNTED_PROBE) - #define Z_MIN_PIN 4//24 -#else - - #define Z_MIN_PIN 10 -#endif - - -// -// Servos -// -#define SERVO0_PIN -1//24/* X_MAX_PIN//22 // Motor header MX1*/ -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN -1//24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define Z2_STEP_PIN 33 -#define Z2_DIR_PIN 42 -#define Z2_ENABLE_PIN 25 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS { 4,5,3,0,1 } // X Y Z E0 E1 digipot channels to stepper driver mapping -#ifndef DIGIPOT_MOTOR_CURRENT - #define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 6 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 2 -#define FAN2_PIN 6 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 -#define CASE_LIGHT_PIN 46 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN NoPin // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN NoPin // Pin should have a pullup! -#define SPINDLE_DIR_PIN NoPin - -// -// M7/M8/M9 - Coolant Control -// -#define COOLANT_MIST_PIN 22 -#define COOLANT_FLOOD_PIN 44 - -// -// Průša i3 MK2 Multiplexer Support -// -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 84 // 84 in MK2 Firmware - -// -// LCD / Controller -// -#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL - - #define KILL_PIN 80 - - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL - - #define LCD_PINS_RS 70 - #define LCD_PINS_ENABLE 71 - #define LCD_PINS_D4 72 - #define LCD_PINS_D5 73 - #define LCD_PINS_D6 74 - #define LCD_PINS_D7 75 - - #if ANY(VIKI2, miniVIKI) - #define BEEPER_PIN 44 - // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the - // beeper/buzzer is connected to pin 33; however, the pin used in the - // diagram is actually pin 44, so this is correct. - - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 85 - #define BTN_EN2 84 - #define BTN_ENC 83 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 - - #else // !VIKI2 && !miniVIKI - - #define BEEPER_PIN 79 - - // AUX-2 -#define BTN_EN1 64 -#define BTN_EN2 63 -//#define BTN_EN1 76 -//#define BTN_EN2 77 - #define BTN_ENC 78 - - #define SD_DETECT_PIN 81 - - #endif // !VIKI2 && !miniVIKI - - #else // !NEWPANEL - old style panel with shift register - - // No Beeper added - #define BEEPER_PIN 33 - - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - - #define LCD_PINS_RS 75 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #endif // !NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h deleted file mode 100644 index e8c9b2ebc0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ /dev/null @@ -1,159 +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 - -/************************************************ - * Rambo pin assignments MODIFIED FOR Scoovo X9H - ************************************************/ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Scoovo X9H" - -// -// Servos -// -#define SERVO0_PIN 22 // Motor header MX1 -#define SERVO1_PIN 23 // Motor header MX2 -#define SERVO2_PIN 24 // Motor header MX3 -#define SERVO3_PIN 5 // PWM header pin 5 - -// -// Limit Switches -// -#define X_MIN_PIN 12 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 30 - -// -// Z Probe (when not Z_MIN_IN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 30 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 -#define X_ENABLE_PIN 29 - -#define Y_STEP_PIN 36 -#define Y_DIR_PIN 49 -#define Y_ENABLE_PIN 28 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 47 -#define Z_ENABLE_PIN 27 - -#define E0_STEP_PIN 34 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 26 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 42 -#define E1_ENABLE_PIN 25 - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 40 -#define X_MS2_PIN 41 -#define Y_MS1_PIN 69 -#define Y_MS2_PIN 39 -#define Z_MS1_PIN 68 -#define Z_MS2_PIN 67 -#define E0_MS1_PIN 65 -#define E0_MS2_PIN 66 -#define E1_MS1_PIN 63 -#define E1_MS2_PIN 64 - -#define DIGIPOTSS_PIN 38 -#define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_BED_PIN 7 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #define FAN_PIN 8 -#endif -#define FAN1_PIN 6 -#define FAN2_PIN 2 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 4 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 3 // Analog Input -#endif - -// -// LCD / Controller -// -#define LCD_PINS_RS 70 // Ext2_5 -#define LCD_PINS_ENABLE 71 // Ext2_7 -#define LCD_PINS_D4 72 // Ext2_9 ? -#define LCD_PINS_D5 73 // Ext2_11 ? -#define LCD_PINS_D6 74 // Ext2_13 -#define LCD_PINS_D7 75 // Ext2_15 ? -#define BEEPER_PIN -1 - -#define BTN_HOME 80 // Ext_16 -#define BTN_CENTER 81 // Ext_14 -#define BTN_ENC BTN_CENTER -#define BTN_RIGHT 82 // Ext_12 -#define BTN_LEFT 83 // Ext_10 -#define BTN_UP 84 // Ext2_8 -#define BTN_DOWN 85 // Ext2_6 - -#define HOME_PIN BTN_HOME - -#if ANY(VIKI2, miniVIKI) - #define BEEPER_PIN 44 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #define STAT_LED_RED_PIN 22 - #define STAT_LED_BLUE_PIN 32 -#endif // VIKI2/miniVIKI diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_3DRAG.h deleted file mode 100644 index e6c3bdc2ea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_3DRAG.h +++ /dev/null @@ -1,162 +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 - -/** - * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "3Drag" -#endif - -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#endif - -#ifndef DEFAULT_SOURCE_CODE_URL - #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" -#endif - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 9 -#define RAMPS_D9_PIN 8 -#define MOSFET_D_PIN 12 - -#define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header - -#include "pins_RAMPS.h" - -// -// Limit Switches -// -#undef Z_MAX_PIN - -// -// Steppers -// -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 63 - -// -// Heaters / Fans -// -#define HEATER_2_PIN 6 - -// -// Misc. Functions -// -#undef SDSS -#define SDSS 25 - -#undef SD_DETECT_PIN -#define SD_DETECT_PIN 53 - -// -// LCD / Controller -// -#if BOTH(ULTRA_LCD, NEWPANEL) - #undef BEEPER_PIN - - #undef LCD_PINS_RS - #undef LCD_PINS_ENABLE - #undef LCD_PINS_D4 - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 37 - #define LCD_PINS_D5 35 - #define LCD_PINS_D6 33 - #define LCD_PINS_D7 31 - - // Buttons - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #define BTN_EN1 16 - #define BTN_EN2 17 - #define BTN_ENC 23 - -#else - - #define BEEPER_PIN 33 - -#endif // HAS_SPI_LCD && NEWPANEL - -/** - * M3/M4/M5 - Spindle/Laser Control - * - * If you want to control the speed of your spindle then you'll have - * have to sacrifce the Extruder and pull some signals off the Z stepper - * driver socket. - * - * The following assumes: - * - the Z stepper driver socket is empty - * - the extruder driver socket has a driver board plugged into it - * - the Z stepper wires are attached the the extruder connector - * - * If you want to keep the extruder AND don't have a LCD display then - * you can still control the power on/off and spindle direction. - * - * Where to get spindle signals - * - * stepper signal socket name socket name - * ------- - * SPINDLE_LASER_ENA_PIN /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_DIR_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor - */ -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not good with 3DRAG -#undef SPINDLE_LASER_ENA_PIN -#undef SPINDLE_DIR_PIN - -#if HAS_CUTTER - #if !EXTRUDERS - #undef E0_DIR_PIN - #undef E0_ENABLE_PIN - #undef E0_STEP_PIN - #undef Z_DIR_PIN - #undef Z_ENABLE_PIN - #undef Z_STEP_PIN - #define Z_DIR_PIN 28 - #define Z_ENABLE_PIN 24 - #define Z_STEP_PIN 26 - #define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 62 // Pullup! - #define SPINDLE_DIR_PIN 48 - #elif !BOTH(ULTRA_LCD, NEWPANEL) // use expansion header if no LCD in use - #define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown! - #define SPINDLE_DIR_PIN 17 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3.h deleted file mode 100644 index 692d4f8a6e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ /dev/null @@ -1,96 +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 - -/** - * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 6 // Define before RAMPS pins include -#endif -#define BOARD_INFO_NAME "Azteeg X3" - -// -// Servos -// -#define SERVO0_PIN 44 // SERVO1 port -#define SERVO1_PIN 55 // SERVO2 port - -#include "pins_RAMPS_13.h" - -// -// LCD / Controller -// -#undef STAT_LED_RED_PIN -#undef STAT_LED_BLUE_PIN - -#if ANY(VIKI2, miniVIKI) - - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef BTN_ENC - #define DOGLCD_A0 31 - #define DOGLCD_CS 32 - #define BTN_ENC 12 - - #define STAT_LED_RED_PIN 64 - #define STAT_LED_BLUE_PIN 63 - -#else - - #define STAT_LED_RED_PIN 6 - #define STAT_LED_BLUE_PIN 11 - -#endif - -// -// Misc -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT, STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN - #undef STAT_LED_RED_PIN -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3 board -#undef SPINDLE_LASER_ENA_PIN -#undef SPINDLE_DIR_PIN - -#if HAS_CUTTER - #undef SDA // use EXP3 header - #undef SCL - #if SERVO0_PIN == 7 - #undef SERVO0_PIN - #define SERVO0_PIN 11 - #endif - #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 20 // Pullup! - #define SPINDLE_DIR_PIN 21 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h deleted file mode 100644 index 62014217ff..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ /dev/null @@ -1,166 +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 - -/** - * AZTEEG_X3_PRO (Arduino Mega) pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 5 || E_STEPPERS > 5 - #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Azteeg X3 Pro" - -// -// RAMPS pins overrides -// - -// -// Servos -// -// Tested this pin with bed leveling on a Delta with 1 servo. -// Physical wire attachment on EXT1: GND, 5V, D47. -// -#define SERVO0_PIN 47 - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 -#define Z_STOP_PIN 18 - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #define CASE_LIGHT_PIN 44 -#endif - -// -// Import RAMPS 1.4 pins -// -#include "pins_RAMPS.h" - -// DIGIPOT slave addresses -#ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT 0x2C (0x58 <- 0x2C << 1) -#endif -#ifndef DIGIPOT_I2C_ADDRESS_B - #define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT 0x2E (0x5C <- 0x2E << 1) -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 18 -#endif - -// -// Steppers -// -#define E2_STEP_PIN 23 -#define E2_DIR_PIN 25 -#define E2_ENABLE_PIN 40 - -#define E3_STEP_PIN 27 -#define E3_DIR_PIN 29 -#define E3_ENABLE_PIN 41 - -#define E4_STEP_PIN 43 -#define E4_DIR_PIN 37 -#define E4_ENABLE_PIN 42 - -// -// Temperature Sensors -// -#define TEMP_2_PIN 12 // Analog Input -#define TEMP_3_PIN 11 // Analog Input -#define TEMP_4_PIN 10 // Analog Input -#define TC1 4 // Analog Input (Thermo couple on Azteeg X3Pro) -#define TC2 5 // Analog Input (Thermo couple on Azteeg X3Pro) - -// -// Heaters / Fans -// -#define HEATER_2_PIN 16 -#define HEATER_3_PIN 17 -#define HEATER_4_PIN 4 -#define HEATER_5_PIN 5 -#define HEATER_6_PIN 6 -#define HEATER_7_PIN 11 - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN 4 // Pin used for the fan to cool motherboard (-1 to disable) -#endif - -// Fans/Water Pump to cool the hotend cool side. -#define ORIG_E0_AUTO_FAN_PIN 5 -#define ORIG_E1_AUTO_FAN_PIN 5 -#define ORIG_E2_AUTO_FAN_PIN 5 -#define ORIG_E3_AUTO_FAN_PIN 5 - -// -// LCD / Controller -// -#undef BEEPER_PIN -#define BEEPER_PIN 33 - -#if ANY(VIKI2, miniVIKI) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 49 // For easy adapter board - #undef BEEPER_PIN - #define BEEPER_PIN 12 // 33 isn't physically available to the LCD display -#else - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 -#endif - -// -// Misc. Functions -// -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN - #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it - #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are no good with the AzteegX3pro board -#undef SPINDLE_LASER_ENA_PIN -#undef SPINDLE_DIR_PIN - -#if HAS_CUTTER // EXP2 header - #if ANY(VIKI2, miniVIKI) - #define BTN_EN2 31 // Pin 7 needed for Spindle PWM - #endif - #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 20 // Pullup! - #define SPINDLE_DIR_PIN 21 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h deleted file mode 100644 index 4cadf481f3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ /dev/null @@ -1,49 +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 - -/** - * BAM&DICE Due (Arduino Mega) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "2PrintBeta Due" - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 66 // Pullup or pulldown! -#define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - -#include "pins_RAMPS.h" - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#define TEMP_0_PIN 9 // Analog Input -#define TEMP_1_PIN 11 // Analog Input diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h deleted file mode 100644 index 7f27df6eb4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h +++ /dev/null @@ -1,40 +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 - -/** - * KFB 2.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "KFB 2.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "KFB 2.0" - -// -// Heaters / Fans -// -// Power outputs BEEF or BEFF -#define MOSFET_D_PIN 7 - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h deleted file mode 100644 index 14013d874c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ /dev/null @@ -1,117 +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 - -/** - * bq ZUM Mega 3D board definition - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "ZUM Mega 3D" - -// -// Heaters / Fans -// -#define RAMPS_D8_PIN 10 -#define RAMPS_D9_PIN 12 -#define RAMPS_D10_PIN 9 -#define MOSFET_D_PIN 7 - -// -// Auto fans -// -#define ORIG_E0_AUTO_FAN_PIN 11 -#define ORIG_E1_AUTO_FAN_PIN 6 -#define ORIG_E2_AUTO_FAN_PIN 6 -#define ORIG_E3_AUTO_FAN_PIN 6 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! -#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM -#define SPINDLE_DIR_PIN 42 - -// -// Limit Switches -// -#define X_MAX_PIN 79 // 2 - -// -// Import RAMPS 1.3 pins -// -#include "pins_RAMPS_13.h" - -// -// Z Probe (when not Z_MIN_PIN) -// -#undef Z_MIN_PROBE_PIN -#define Z_MIN_PROBE_PIN 19 // IND_S_5V - -#undef Z_ENABLE_PIN -#define Z_ENABLE_PIN 77 // 62 - -// -// Steppers -// -#define DIGIPOTSS_PIN 22 -#define DIGIPOT_CHANNELS { 4, 5, 3, 0, 1 } - -// -// Temperature Sensors -// -#undef TEMP_1_PIN -#define TEMP_1_PIN 14 // Analog Input (15) - -#undef TEMP_BED_PIN -#define TEMP_BED_PIN 15 // Analog Input (14) - -// -// Misc. Functions -// -#undef PS_ON_PIN // 12 -#define PS_ON_PIN 81 // External Power Supply - -#define CASE_LIGHT_PIN 44 // Hardware PWM - - -// This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team -// decided to ship the printer only with the probe and no additional Z-min -// endstop and the instruction manual advises the user to connect the probe to -// IND_S_5V the option Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN will not work. -#ifdef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef Z_MIN_PIN - #undef Z_MAX_PIN - #define Z_MIN_PIN 19 // IND_S_5V - #define Z_MAX_PIN 18 // Z-MIN Label -#endif - -// -// Used by the Hephestos 2 heated bed upgrade kit -// -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef HEATER_BED_PIN - #define HEATER_BED_PIN 8 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h deleted file mode 100644 index 0ffc70aa73..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h +++ /dev/null @@ -1,184 +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 - -/** - * Wanhao Duplicator i3 Plus pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Duplicator i3 Plus" - -// -// Limit Switches -// -#define X_STOP_PIN 54 // PF0 / A0 -#define Y_STOP_PIN 24 // PA2 / AD2 -#define Z_MIN_PIN 23 // PA1 / AD1 -#define Z_MAX_PIN 25 // PA3 / AD3 -#define SERVO0_PIN 40 // PG1 / !RD - -// -// Steppers -// -#define X_STEP_PIN 61 // PF7 / A7 -#define X_DIR_PIN 62 // PK0 / A8 -#define X_ENABLE_PIN 60 // PF6 / A6 - -#define Y_STEP_PIN 64 // PK2 / A10 -#define Y_DIR_PIN 65 // PK3 / A11 -#define Y_ENABLE_PIN 63 // PK1 / A9 - -#define Z_STEP_PIN 67 // PK5 / A13 -#define Z_DIR_PIN 69 // PK7 / A15 -#define Z_ENABLE_PIN 66 // PK4 / A12 -#define Z_MIN_PROBE_PIN 25 // PA3 / AD3 - -#define E0_STEP_PIN 58 // PF4 / A4 -#define E0_DIR_PIN 59 // PF5 / A5 -#define E0_ENABLE_PIN 57 // PF3 / A3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // PF1 / A1 Analog -#define TEMP_BED_PIN 14 // PK6 / A14 Analog - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 // PG5 / PWM4 -#define HEATER_BED_PIN 3 // PE5 / PWM3 - -#define FAN_PIN 5 // PE3 / PWM5 - -// -// Misc. Functions -// -#define SDSS 53 // PB0 / SS -#define LED_PIN 13 // PB7 / PWM13 - -#define MISO_PIN 50 // PB3 -#define MOSI_PIN 51 // PB2 -#define SCK_PIN 52 // PB1 - -// -// LCDs and Controllers -// -#if HAS_SPI_LCD - #if ENABLED(ZONESTAR_LCD) - #define LCD_PINS_RS 2 - #define LCD_PINS_ENABLE 36 - #define LCD_PINS_D4 37 - #define LCD_PINS_D5 34 - #define LCD_PINS_D6 35 - #define LCD_PINS_D7 32 - #define ADC_KEYPAD_PIN 12 // Analog - #endif -#endif - -/** - * == EXT connector == - * - * 2 4 6 8 10 - * #---------------# - * #2 | ° ° ° ° ° | - * #1 | ° ° ° ° ° | - * #---------------# - * 1 3 5 7 9 - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 52 / PG1 (!RD) | 40 # - * # 2 | 95 / PF2 (A2) | 2 # - * # 3 | 54 / PC1 (A9) | 36 # - * # 4 | 53 / PC0 (A8) | 37 # - * # 5 | 56 / PC3 (A11) | 34 # - * # 6 | 55 / PC2 (A10) | 35 # - * # 7 | 58 / PC5 (A13) | 32 # - * # 8 | 57 / PC4 (A12) | 33 # - * # 9 | GND | - # - * # 10 | VCC | + # - * ################################## - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * == Z-probe connector == - * - * 1 2 3 - * #---------# - * | ° ° ° | - * #---------# - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 24V or 5V | + # - * # 2 | 75 / PA3 (AD3) | 25 # - * # 3 | GND | - # - * ################################## - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * == Y-endstop == == Z-endstop == == Bed temperature == - * - * 1 2 1 2 1 2 - * #------# #------# #------# - * | ° ° | | ° ° | | ° ° | - * #------# #------# #------# - * - * ############### Y ################ ############### Z ################ ############## BED ############### - * # Pin | ATMEGA2560 Pin | Arduino # # Pin | ATMEGA2560 Pin | Arduino # # Pin | ATMEGA2560 Pin | Arduino # - * ################################## ################################## ################################## - * # 1 | GND | - # # 1 | GND | - # # 1 | GND | - # - * # 2 | 76 / PA2 (AD2) | 24 # # 2 | 77 / PA1 (AD1) | 23 # # 2 |83 / PK6 (ADC14)| 14 # - * ################################## ################################## ################################## - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * == SPI connector == - * - * 5 3 1 - * #---------# - * | ° ° ° | - * | ° ° ° | - * #---------# - * 6 4 2 - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 22 / PB3 (MISO)| 50 # - * # 2 | VCC | + # - * # 3 | 20 / PB1 (SCK) | 52 # - * # 4 | 21 / PB2 (MOSI)| 51 # - * # 5 | 30 / !RESET | RESET # - * # 6 | GND | - # - * ################################## - * - * Pictogram by Ludy https://github.com/Ludy87 - * See: https://sebastien.andrivet.com/en/posts/wanhao-duplicator-i3-plus-3d-printer/ - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FELIX2.h deleted file mode 100644 index c2c2b4bbf4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FELIX2.h +++ /dev/null @@ -1,63 +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 - -/** - * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Felix 2.0+" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#include "pins_RAMPS.h" - -// -// Misc. Functions -// -#define SDPOWER_PIN 1 - -#define PS_ON_PIN 12 - -// -// LCD / Controller -// -#if BOTH(ULTRA_LCD, NEWPANEL) - - #define SD_DETECT_PIN 6 - -#endif // NEWPANEL && ULTRA_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not valid with this board -#undef SPINDLE_LASER_ENA_PIN -#undef SPINDLE_DIR_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h deleted file mode 100644 index 0ff0ec57ba..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h +++ /dev/null @@ -1,195 +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 - -/** - * Formbot Raptor pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "Formbot supports up to 3 hotends / E-steppers. Comment out this line to continue." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Formbot Raptor" -#endif -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#endif - -// -// Servos -// -#define SERVO0_PIN 11 -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -#define E2_STEP_PIN 42 -#define E2_DIR_PIN 43 -#define E2_ENABLE_PIN 44 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 8 - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 57 -#endif - -#if !HAS_FILAMENT_SENSOR - #define FAN1_PIN 4 -#endif - -// -// Misc. Functions -// -#ifndef SDSS - #define SDSS 53 -#endif -#define LED_PIN 13 -#define LED4_PIN 5 - -// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector -#define FILWIDTH_PIN 5 // Analog Input - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#define CASE_LIGHT_PIN 5 - -// -// LCD / Controller -// -// Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER -// -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define BEEPER_PIN 37 - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h deleted file mode 100644 index 431d4370ba..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h +++ /dev/null @@ -1,68 +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 - -/** - * Formbot Raptor 2 pin assignments - */ - -#define BOARD_INFO_NAME "Formbot Raptor2" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -#define FAN_PIN 6 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 22 -#endif - -#include "pins_FORMBOT_RAPTOR.h" - -#define GREEDY_PANEL ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD) - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !NUM_SERVOS // Try to use servo connector first - #define SPINDLE_LASER_ENA_PIN 6 // Pullup or pulldown! - #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_PWM_PIN 44 // Hardware PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) - #if NUM_SERVOS <= 1 // Try to use servo connector first - #define CASE_LIGHT_PIN 6 // Hardware PWM - #elif !GREEDY_PANEL // Try to use AUX2 - #define CASE_LIGHT_PIN 44 // Hardware PWM - #endif -#endif - -#undef GREEDY_PANEL - -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && (CASE_LIGHT_PIN == SPINDLE_LASER_ENA_PIN || CASE_LIGHT_PIN == SPINDLE_LASER_PWM_PIN) - #error "CASE_LIGHT_PIN conflicts with a Spindle / Laser pin." -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h deleted file mode 100644 index 665462c012..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ /dev/null @@ -1,196 +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 - -/** - * Formbot pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Formbot" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -// -// Servos -// -#define SERVO0_PIN 11 -#define SERVO1_PIN -1 // was 6 -#define SERVO2_PIN -1 // was 5 -#define SERVO3_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -#define E2_STEP_PIN 42 -#define E2_DIR_PIN 43 -#define E2_ENABLE_PIN 44 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 3 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 58 - -#define FAN_PIN 9 - -#if HAS_FILAMENT_SENSOR - #define FIL_RUNOUT_PIN 4 - //#define FIL_RUNOUT2_PIN -1 -#else - // Though defined as a fan pin, it is utilized as a dedicated laser pin by Formbot. - #define FAN1_PIN 4 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#ifndef LED_PIN - #define LED_PIN 13 // The Formbot v 1 board has almost no unassigned pins on it. The Board's LED -#endif // is a good place to get a signal to control the Max7219 LED Matrix. - -// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector -#define FILWIDTH_PIN 5 // Analog Input - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#define CASE_LIGHT_PIN 8 - -// -// LCD / Controller -// -// Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER -// -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #ifndef BEEPER_PIN - #define BEEPER_PIN 37 - #endif - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - - // Allow MAX7219 to steal the KILL pin - #if !defined(KILL_PIN) && MAX7219_CLK_PIN != 41 && MAX7219_DIN_PIN != 41 && MAX7219_LOAD_PIN != 41 - #define KILL_PIN 41 - #endif - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h deleted file mode 100644 index a96585eb69..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ /dev/null @@ -1,173 +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 - -/** - * Formbot pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Formbot" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -// -// Servos -// -#define SERVO0_PIN 11 -#define SERVO1_PIN -1 // was 6 -#define SERVO2_PIN -1 -#define SERVO3_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -#define E2_STEP_PIN 42 -#define E2_DIR_PIN 43 -#define E2_ENABLE_PIN 44 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - - - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 7 -#define HEATER_BED_PIN 8 - -#define FAN_PIN 9 -#define FAN1_PIN 12 - -#define NUM_RUNOUT_SENSORS 2 -#define FIL_RUNOUT_PIN 22 -#define FIL_RUNOUT2_PIN 21 - -// -// Misc. Functions -// -#define CASE_LIGHT_PIN 5 -#define SDSS 53 -#ifndef LED_PIN - #define LED_PIN 13 -#endif - -#define SPINDLE_LASER_PWM_PIN -1 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 4 // Pullup! - -// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector -#define FILWIDTH_PIN 5 // Analog Input - -// -// LCD / Controller -// -// Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER -// -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #ifndef KILL_PIN - #define KILL_PIN 41 - #endif - #ifndef BEEPER_PIN - #define BEEPER_PIN 37 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h deleted file mode 100644 index 1168948d93..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ /dev/null @@ -1,253 +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 - -// -// FYSETC F6 pin assignments -// - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'FYSETC F6' in 'Tools > Board.'" -#endif - -#if ENABLED(SD_DETECT_INVERTED) - //#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board." -#endif - -#define BOARD_INFO_NAME "FYSETC F6 1.3" - -#define RESET_PIN 30 -#define SPI_FLASH_CS 83 - -// -// Servos -// -#define SERVO0_PIN 13 -#define SERVO1_PIN 11 // (PS_ON_PIN) -#define SERVO2_PIN 10 // (FIL_RUNOUT_PIN) -#define SERVO3_PIN 4 // (RGB_LED_G_PIN) - -// -// Limit Switches -// -#define X_MIN_PIN 63 -#define X_MAX_PIN 64 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 12 -#define Z_MAX_PIN 9 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN SERVO2_PIN -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 9 // Servos pin -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 70 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 39 -#endif - -#define Z_STEP_PIN 43 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 58 -#ifndef Z_CS_PIN - #define Z_CS_PIN 74 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 47 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 32 -#endif - -#define E2_STEP_PIN 59 -#define E2_DIR_PIN 57 -#define E2_ENABLE_PIN 40 -#ifndef E2_CS_PIN - #define E2_CS_PIN 42 -#endif - -// -// Sensorless homing DIAG pin is not directly connected to the MCU. Close -// the jumper next to the limit switch socket when using sensorless homing. -// - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Software serial communication pins. - * At the moment, F6 rx pins are not pc interrupt pins - */ - #define X_SERIAL_RX_PIN -1 // 71 - #define X_SERIAL_TX_PIN 72 - #define Y_SERIAL_RX_PIN -1 // 73 - #define Y_SERIAL_TX_PIN 75 - #define Z_SERIAL_RX_PIN -1 // 78 - #define Z_SERIAL_TX_PIN 79 - #define E0_SERIAL_RX_PIN -1 // 76 - #define E0_SERIAL_TX_PIN 77 - #define E1_SERIAL_RX_PIN -1 // 80 - #define E1_SERIAL_TX_PIN 81 - #define E2_SERIAL_RX_PIN -1 // 22 - #define E2_SERIAL_TX_PIN 82 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 12 // Analog Input -#define TEMP_1_PIN 13 // Analog Input -#define TEMP_2_PIN 14 // Analog Input -#define TEMP_BED_PIN 15 // Analog Input - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 9 // Analog Input on X+ endstop -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 5 -#define HEATER_1_PIN 6 -#define HEATER_2_PIN 7 -#define HEATER_BED_PIN 8 - -#define FAN_PIN 44 -#define FAN1_PIN 45 -#define FAN2_PIN 46 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define KILL_PIN 41 - -#ifndef PS_ON_PIN - #define PS_ON_PIN SERVO1_PIN -#endif - -/** - * ----- ----- - * 5V/D41 | · · | GND 5V | · · | GND - * RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6) - * (MOSI) D51 | · · | D33 (BTN_EN2) (LCD_D5) D25 | · · | D23 (LCD_D4) - * (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN) - * (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER) - * ----- ----- - * EXP2 EXP1 - */ - -// -// LCDs and Controllers -// -#define BEEPER_PIN 37 -#define SD_DETECT_PIN 49 - -#if ENABLED(FYSETC_MINI_12864) - // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - // - #define DOGLCD_A0 16 - #define DOGLCD_CS 17 - - #define LCD_BACKLIGHT_PIN -1 - #define KILL_PIN 41 - - #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. - // Seems to work best if left open. - - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 25 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 27 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 29 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 - #endif - -#elif HAS_GRAPHICAL_LCD - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS 25 - #define DOGLCD_A0 27 - #endif - -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 -#endif - -#ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 3 -#endif -#ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 4 -#endif -#ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 9 -#endif -#ifndef RGB_LED_W_PIN - #define RGB_LED_W_PIN -1 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8200.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8200.h deleted file mode 100644 index 41cc4dfbf8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8200.h +++ /dev/null @@ -1,33 +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 - -/** - * K8200 Arduino Mega with RAMPS v1.3 pin assignments - * Identical to 3DRAG - */ - -#define BOARD_INFO_NAME "Velleman K8200" -#define DEFAULT_MACHINE_NAME "K8200" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" - -#include "pins_3DRAG.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8400.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8400.h deleted file mode 100644 index a47d21c914..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8400.h +++ /dev/null @@ -1,73 +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 - -/** - * Velleman K8400 (Vertex) - * 3DRAG clone - * - * K8400 has some minor differences over a normal 3Drag: - * - No X/Y max endstops - * - Second extruder step pin has moved - * - No power supply control - * - Second heater has moved pin - */ - -#define BOARD_INFO_NAME "K8400" -#define DEFAULT_MACHINE_NAME "Vertex" - -#include "pins_3DRAG.h" - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 - -#undef X_MIN_PIN -#undef X_MAX_PIN -#undef Y_MIN_PIN -#undef Y_MAX_PIN - -// -// Steppers -// -#undef E1_STEP_PIN -#define E1_STEP_PIN 32 - -// -// Heaters / Fans -// -#undef HEATER_1_PIN -#define HEATER_1_PIN 11 - -// -// Misc. Functions -// -#undef PS_ON_PIN -#undef KILL_PIN -#undef SD_DETECT_PIN - -#if Z_STEP_PIN == 26 - #undef Z_STEP_PIN - #define Z_STEP_PIN 32 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8800.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8800.h deleted file mode 100644 index bfc61d0182..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_K8800.h +++ /dev/null @@ -1,109 +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 - -/** - * Velleman K8800 (Vertex) - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "K8800" -#define DEFAULT_MACHINE_NAME "Vertex Delta" - -//#define LCD_SCREEN_ROT_180 - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 -#define Z_MIN_PIN 68 // Used for bed leveling -#define Z_MAX_PIN 66 - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 63 - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN 32 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define FAN_PIN 8 -#define CONTROLLER_FAN_PIN 9 - -// -// Misc. Functions -// -#define SDSS 25 - -#define FIL_RUNOUT_PIN 69 // PK7 -#define KILL_PIN 20 // PD1 - -// -// LCD / Controller -// -#define SD_DETECT_PIN 21 // PD0 -#define LCD_SDSS 53 -#define BEEPER_PIN 6 - -#define DOGLCD_CS 29 -#define DOGLCD_A0 27 - -#define LCD_PINS_RS 27 -#define LCD_PINS_ENABLE 29 -#define LCD_PINS_D4 37 -#define LCD_PINS_D5 35 -#define LCD_PINS_D6 33 -#define LCD_PINS_D7 31 - -#if ENABLED(NEWPANEL) - #define BTN_EN1 17 - #define BTN_EN2 16 - #define BTN_ENC 23 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h deleted file mode 100644 index 66dddbef45..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h +++ /dev/null @@ -1,33 +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 - -#define BOARD_INFO_NAME "MAKEboard Mini" - -// -// Only 3 Limit Switch plugs on Micromake C1 -// -#define X_STOP_PIN 2 -#define Y_STOP_PIN 15 -#define Z_STOP_PIN 19 - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE.h deleted file mode 100644 index 75c7eb2848..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE.h +++ /dev/null @@ -1,51 +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 - -/** - * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments - * - * Rev B - Override pin definitions for CASE_LIGHT and M3/M4/M5 spindle control - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS BASE 1.0" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#define CASE_LIGHT_PIN 2 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 15 // Pullup! -#define SPINDLE_DIR_PIN 19 - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_14.h deleted file mode 100644 index 700e2a410c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_14.h +++ /dev/null @@ -1,187 +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 - -/** - * MKS BASE v1.4 - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS BASE 1.4 only supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS BASE 1.4" - -// -// Heaters / Fans -// -#define MOSFET_D_PIN 7 // PH4 ** Pin16 ** PWM7 //E1 -#define FAN_PIN 9 // PH6 ** Pin18 ** PWM9 - -// Other Mods -#define CASE_LIGHT_PIN 11 // PB5 ** Pin24 ** PWM11 -#define SERVO3_PIN 12 // PB6 ** Pin25 ** D12 -#define PS_ON_PIN 2 // X+ // PE4 ** Pin6 ** PWM2 **MUST BE HARDWARE PWM -#define FILWIDTH_PIN 15 // Y+ // PJ0 ** Pin63 ** USART3_RX **Pin should have a pullup! -#define FIL_RUNOUT_PIN 19 // Z+ // PD2 ** Pin45 ** USART1_RX - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // X+ // PE4 ** Pin6 ** PWM2 **MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 15 // Y+ // PJ0 ** Pin63 ** USART3_RX **Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 // Z+ // PD2 ** Pin45 ** USART1_RX - -// -// Microstepping pins -// -#define X_MS1_PIN 5 // PE3 ** Pin5 ** PWM5 -#define X_MS2_PIN 6 // PH3 ** Pin15 ** PWM6 -#define Y_MS1_PIN 59 // PF5 ** Pin92 ** A5 -#define Y_MS2_PIN 58 // PF4 ** Pin93 ** A4 -#define Z_MS1_PIN 22 // PA0 ** Pin78 ** D22 -#define Z_MS2_PIN 39 // PG2 ** Pin70 ** D39 -#define E0_MS1_PIN 64 // PK2 ** Pin87 ** A10 -#define E0_MS2_PIN 63 // PK1 ** Pin88 ** A9 -#define E1_MS1_PIN 57 // PF3 ** Pin94 ** A3 -#define E1_MS2_PIN 4 // PG5 ** Pin1 ** PWM4 - -#ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 -#endif -#ifndef RGB_LED_R_PIN - #define RGB_LED_G_PIN 51 -#endif -#ifndef RGB_LED_R_PIN - #define RGB_LED_B_PIN 52 -#endif - -#include "pins_RAMPS.h" - -/* - Available connectors on MKS BASE v1.4 - - ======= - | GND | - |-----| E0 - | 10 | (10) PB4 ** Pin23 ** PWM10 - |-----| - | GND | - |-----| E1 - | 7 | ( 7) PH4 ** Pin16 ** PWM7 - |-----| - | GND | - |-----| FAN - | 9 | ( 9) PH6 ** Pin18 ** PWM9 - ======= - - ======= - | GND | - |-----| Heated Bed - | 8 | ( 8) PH5 ** Pin17 ** PWM8 - ======= - - ========== - | 12-24V | - |--------| Power - | GND | - ========== - - XS3 Connector - ================= - | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11 - |----|-----|----| - | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12 - ================= - - Servos Connector - ================= - | 11 | GND | 5V | (11) PB5 ** Pin24 ** PWM11 - |----|-----|----| - | 12 | GND | 5V | (12) PB6 ** Pin25 ** PWM12 - ================= - - ICSP - ================= - | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI - |----|----|-----| - | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO - ================= (52) PB1 ** Pin20 ** SPI_SCK - - XS6/AUX-1 Connector - ====================== - | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA - |----|-----|----|----| - | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO - ====================== (51) PB2 ** Pin21 ** SPI_MOSI - (52) PB1 ** Pin20 ** SPI_SCK - (21) PD0 ** Pin43 ** I2C_SCL - - Temperature - ================================== - | GND | 69 | GND | 68 | GND | 67 | - ================================== - (69) PK7 ** Pin82 ** A15 - (68) PK6 ** Pin83 ** A14 - (67) PK5 ** Pin84 ** A13 - - Limit Switches - ============ - | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2 - |----|-----| - | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3 - |----|-----| - | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX - |----|-----| - | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX - |----|-----| - | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX - |----|-----| - | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX - ============ - - EXP1 - ============ - | 37 | 35 | (37) PC0 ** Pin53 ** D37 - |-----|----| (35) PC2 ** Pin55 ** D35 - | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX - |-----|----| (16) PH1 ** Pin13 ** USART2_TX - | 23 | 25 | (23) PA1 ** Pin77 ** D23 - |-----|----| (25) PA3 ** Pin75 ** D25 - | 27 | 29 | (27) PA5 ** Pin73 ** D27 - |-----|----| (29) PA7 ** Pin71 ** D29 - | GND | 5V | - ============ - - EXP2 - ============ - | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO - |-----|----| (52) PB1 ** Pin20 ** SPI_SCK - | 31 | 53 | (31) PC6 ** Pin59 ** D31 - |-----|----| (53) PB0 ** Pin19 ** SPI_SS - | 33 | 51 | (33) PC4 ** Pin57 ** D33 - |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI - | 49 | 41 | (49) PL0 ** Pin35 ** D49 - |-----|----| (41) PG0 ** Pin51 ** D41 - | GND | NC | - ============ -*/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_15.h deleted file mode 100644 index 12629706f3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_15.h +++ /dev/null @@ -1,42 +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 - -/** - * MKS BASE v1.5 with A4982 stepper drivers and digital micro-stepping - */ - -#include "pins_MKS_BASE.h" - -/** - * Microstepping pins - */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 / SERVO2_PIN -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 / SERVO1_PIN -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 / SERVO3_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h deleted file mode 100644 index 55448d4c0b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h +++ /dev/null @@ -1,36 +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 - -/** - * MKS BASE with Heroic HR4982 stepper drivers - */ - -#include "pins_MKS_BASE_15.h" - -/** - * Some new boards use HR4982 (Heroic) instead of the A4982 (Allegro) stepper drivers. - * Most the functionality is similar, the HR variant obviously doesn't work with diode - * smoothers (no fast decay). And the Heroic has a 128 µStepping mode where the A4982 - * is doing quarter steps (MS1=0, MS2=1). - */ -#define HEROIC_STEPPER_DRIVERS diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_13.h deleted file mode 100644 index 9596214cb2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ /dev/null @@ -1,147 +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 - -/** - * Arduino Mega with RAMPS v1.4 adjusted pin assignments - * - * MKS GEN v1.3 (Extruder, Fan, Bed) - * MKS GEN v1.3 (Extruder, Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Fan, Bed) - * MKS GEN v1.4 (Extruder, Extruder, Fan, Bed) - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS GEN >= v1.3" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// PSU / SERVO -// -// If PSU_CONTROL is specified, always hijack Servo 3 -// -#if ENABLED(PSU_CONTROL) - #define SERVO3_PIN -1 - #define PS_ON_PIN 4 -#endif - -#include "pins_RAMPS.h" - -// -// LCD / Controller -// -#if ANY(VIKI2, miniVIKI) - /** - * VIKI2 Has two groups of wires with... - * - * +Vin + Input supply, requires 120ma for LCD and mSD card - * GND Ground Pin - * MOSI Data input for LCD and SD - * MISO Data output for SD - * SCK Clock for LCD and SD - * AO Reg. Sel for LCD - * LCS Chip Select for LCD - * SDCS Chip Select for SD - * SDCD Card Detect pin for SD - * ENCA Encoder output A - * ENCB Encoder output B - * ENCBTN Encoder button switch - * - * BTN Panel mounted button switch - * BUZZER Piezo buzzer - * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered) - * RED-LED Red LED ring pin (3 to 5v, mosfet buffered) - * - * This configuration uses the following arrangement: - * - * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK - * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS - * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI - * D27 = A0 D29 = LCS D49 = SDCD RST = --- - * GND = GND 5V = 5V GND = --- D41 = --- - */ - - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC - #undef DOGLCD_A0 - #undef DOGLCD_CS - #undef SD_DETECT_PIN - #undef BEEPER_PIN - #undef KILL_PIN - #undef STAT_LED_RED_PIN - #undef STAT_LED_BLUE_PIN - - // - // VIKI2 12-wire lead - // - - // orange/white SDCD - #define SD_DETECT_PIN 49 - - // white ENCA - #define BTN_EN1 35 - - // green ENCB - #define BTN_EN2 37 - - // purple ENCBTN - #define BTN_ENC 31 - - // brown A0 - #define DOGLCD_A0 27 - - // green/white LCS - #define DOGLCD_CS 29 - - // 50 gray MISO - // 51 yellow MOSI - // 52 orange SCK - - // blue SDCS - //#define SDSS 53 - - // - // VIKI2 4-wire lead - // - - // blue BTN - #define KILL_PIN 23 - - // green BUZZER - #define BEEPER_PIN 25 - - // yellow RED-LED - #define STAT_LED_RED_PIN 16 - - // white BLUE-LED - #define STAT_LED_BLUE_PIN 17 - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L.h deleted file mode 100644 index 88973baa1a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L.h +++ /dev/null @@ -1,53 +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 - -/** - * MKS GEN L – Arduino Mega2560 with RAMPS v1.4 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS GEN L" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// CS Pins wired to avoid conflict with the LCD -// See https://www.thingiverse.com/asset:66604 -// - -#ifndef X_CS_PIN - #define X_CS_PIN 59 -#endif - -#ifndef Y_CS_PIN - #define Y_CS_PIN 63 -#endif - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h deleted file mode 100644 index ff1314b2bf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h +++ /dev/null @@ -1,89 +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 - -/** - * MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS GEN L V2 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS GEN L V2" - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -// -// CS Pins wired to avoid conflict with the LCD -// See https://www.thingiverse.com/asset:66604 -// - -#ifndef X_CS_PIN - #define X_CS_PIN 63 -#endif - -#ifndef Y_CS_PIN - #define Y_CS_PIN 64 -#endif - -#ifndef Z_CS_PIN - #define Z_CS_PIN 65 -#endif - -#ifndef E0_CS_PIN - #define E0_CS_PIN 66 -#endif - -#ifndef E1_CS_PIN - #define E1_CS_PIN 21 -#endif - -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 3 -#define Y_DIAG_PIN 14 -#define Z_DIAG_PIN 18 -#define E0_DIAG_PIN 2 -#define E1_DIAG_PIN 15 - -#ifndef SERVO1_PIN - #define SERVO1_PIN 12 -#endif -#ifndef SERVO2_PIN - #define SERVO2_PIN 39 -#endif -#ifndef SERVO3_PIN - #define SERVO3_PIN 32 -#endif - -#ifndef E1_SERIAL_TX_PIN - #define E1_SERIAL_TX_PIN 20 -#endif -#ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN 21 -#endif - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS.h deleted file mode 100644 index 0c96131315..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS.h +++ /dev/null @@ -1,693 +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 - -/** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 - */ - -#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." -#endif - -#if NONE(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768) - #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" - #endif -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RAMPS 1.4" -#endif - -// -// Servos -// -#ifndef SERVO0_PIN - #ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 - #else - #define SERVO0_PIN 11 - #endif -#endif -#ifndef SERVO1_PIN - #define SERVO1_PIN 6 -#endif -#ifndef SERVO2_PIN - #define SERVO2_PIN 5 -#endif -#ifndef SERVO3_PIN - #define SERVO3_PIN 4 -#endif - -// -// Limit Switches -// -#ifndef X_STOP_PIN - #ifndef X_MIN_PIN - #define X_MIN_PIN 3 - #endif - #ifndef X_MAX_PIN - #define X_MAX_PIN 2 - #endif -#endif -#ifndef Y_STOP_PIN - #ifndef Y_MIN_PIN - #define Y_MIN_PIN 14 - #endif - #ifndef Y_MAX_PIN - #define Y_MAX_PIN 15 - #endif -#endif -#ifndef Z_STOP_PIN - #ifndef Z_MIN_PIN - #define Z_MIN_PIN 18 - #endif - #ifndef Z_MAX_PIN - #define Z_MAX_PIN 19 - #endif -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN 53 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN 49 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN 40 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN 42 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN 44 -#endif - -// -// Temperature Sensors -// -#ifndef TEMP_0_PIN - #define TEMP_0_PIN 13 // Analog Input -#endif -#ifndef TEMP_1_PIN - #define TEMP_1_PIN 15 // Analog Input -#endif -#ifndef TEMP_BED_PIN - #define TEMP_BED_PIN 14 // Analog Input -#endif - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Augmentation for auto-assigning RAMPS plugs -// -#if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif - -// -// Heaters / Fans -// -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif -#ifndef RAMPS_D8_PIN - #define RAMPS_D8_PIN 8 -#endif -#ifndef RAMPS_D9_PIN - #define RAMPS_D9_PIN 9 -#endif -#ifndef RAMPS_D10_PIN - #define RAMPS_D10_PIN 10 -#endif - -#define HEATER_0_PIN RAMPS_D10_PIN - -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN RAMPS_D9_PIN -#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN RAMPS_D9_PIN - #define HEATER_BED_PIN RAMPS_D8_PIN -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN1_PIN RAMPS_D8_PIN -#elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") - #define HEATER_BED_PIN RAMPS_D8_PIN - #if HOTENDS == 1 - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif - -#ifndef FAN_PIN - #if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN RAMPS_D9_PIN - #elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN RAMPS_D8_PIN - #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define FAN_PIN 4 // IO pin. Buffer needed - #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN_PIN RAMPS_D9_PIN - #endif -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif - -// RAMPS 1.4 DIO 4 on the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // Prefer the servo connector - #define CASE_LIGHT_PIN 6 // Hardware PWM - #elif HAS_FREE_AUX2_PINS - #define CASE_LIGHT_PIN 44 // Hardware PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) - #if !NUM_SERVOS // Use servo connector if possible - #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM - #define SPINDLE_DIR_PIN 5 - #elif HAS_FREE_AUX2_PINS - #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_DIR_PIN 65 - #else - #error "No auto-assignable Spindle/Laser pins available." - #endif -#endif - -// -// TMC software SPI -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - - #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN 40 - #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN 63 - #endif - #ifndef X2_SERIAL_TX_PIN - #define X2_SERIAL_TX_PIN -1 - #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN -1 - #endif - - #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN 59 - #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN 64 - #endif - #ifndef Y2_SERIAL_TX_PIN - #define Y2_SERIAL_TX_PIN -1 - #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN -1 - #endif - - #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN 42 - #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN 65 - #endif - #ifndef Z2_SERIAL_TX_PIN - #define Z2_SERIAL_TX_PIN -1 - #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN -1 - #endif - - #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN 44 - #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN 66 - #endif - #ifndef E1_SERIAL_TX_PIN - #define E1_SERIAL_TX_PIN -1 - #endif - #ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN -1 - #endif - #ifndef E2_SERIAL_TX_PIN - #define E2_SERIAL_TX_PIN -1 - #endif - #ifndef E2_SERIAL_RX_PIN - #define E2_SERIAL_RX_PIN -1 - #endif - #ifndef E3_SERIAL_TX_PIN - #define E3_SERIAL_TX_PIN -1 - #endif - #ifndef E3_SERIAL_RX_PIN - #define E3_SERIAL_RX_PIN -1 - #endif - #ifndef E4_SERIAL_TX_PIN - #define E4_SERIAL_TX_PIN -1 - #endif - #ifndef E4_SERIAL_RX_PIN - #define E4_SERIAL_RX_PIN -1 - #endif -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN -#endif - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -#if HAS_SPI_LCD - - // - // LCD Display output pins - // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - - #elif BOTH(NEWPANEL, PANEL_ONE) - - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - - #else - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 25 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 37 - #endif - - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - - #else - - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #endif - - #define LCD_PINS_D7 29 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - #endif - - #endif - - #if DISABLED(NEWPANEL) - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - - #endif - - // - // LCD Display input pins - // - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 - #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #endif - - #define BTN_ENC 35 - #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN 49 - #endif - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS SDSS - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 40 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 42 - #define BTN_ENC -1 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN 33 - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board - #define KILL_PIN 31 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - - #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) - - #define BEEPER_PIN 37 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - - #ifndef KILL_PIN - #define KILL_PIN 41 - #endif - - #if ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 - - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 - - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define BTN_EN1 31 - #define BTN_EN2 33 - - #elif ENABLED(FYSETC_MINI_12864) - - // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - - #define DOGLCD_A0 16 - #define DOGLCD_CS 17 - - #define BTN_EN1 33 - #define BTN_EN2 31 - - //#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 23 // 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 25 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 27 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 29 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 - #endif - - #endif - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 64 - - #elif ENABLED(ZONESTAR_LCD) - - #define ADC_KEYPAD_PIN 12 - - #elif ENABLED(AZSMZ_12864) - - // Pins only defined for RAMPS_SMART currently - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_13.h deleted file mode 100644 index 508064e66f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_13.h +++ /dev/null @@ -1,42 +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 - -/** - * Arduino Mega with RAMPS v1.3 pin assignments - * - * Applies to the following boards: - * - * RAMPS_13_EFB (Extruder, Fan, Bed) - * RAMPS_13_EEB (Extruder, Extruder, Bed) - * RAMPS_13_EFF (Extruder, Fan, Fan) - * RAMPS_13_EEF (Extruder, Extruder, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RAMPS 1.3" -#endif - -#define IS_RAMPS_13 -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h deleted file mode 100644 index 1328354b7d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ /dev/null @@ -1,62 +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 - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Creality3D RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Creality3D RAMPS" - -// -// Heaters / Fans -// - -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#define FIL_RUNOUT_PIN 2 -#if NUM_RUNOUT_SENSORS > 1 - #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 PS_ON_PIN 40 // Used by CR2020 Industrial series - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) - #define CASE_LIGHT_PIN 65 -#endif - -#include "pins_RAMPS.h" - -#ifndef BEEPER_PIN - #define BEEPER_PIN 37 // Always define beeper pin so Play Tone works with ExtUI -#endif - -#define EXP1_PIN 65 // A11 - Used by CR2020 Industrial series for case -#define EXP2_PIN 66 // A12 -#define EXP3_PIN 11 // SERVO0_PIN -#define EXP4_PIN 12 // PS_ON_PIN - -#define SUICIDE_PIN 12 // Used by CR2020 Industrial series -#define SUICIDE_PIN_INVERTING true // Used by CR2020 Industrial series diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h deleted file mode 100644 index 43937e2137..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h +++ /dev/null @@ -1,40 +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 - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Dagoma3D F5 RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Dagoma3D F5 RAMPS" - -#define X_STOP_PIN 2 -#define Y_STOP_PIN 3 -#define Z_STOP_PIN 15 -#define FIL_RUNOUT_PIN 39 - -#define ORIG_E0_AUTO_FAN_PIN 7 - -// -// Import RAMPS 1.4 pins -// -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h deleted file mode 100644 index 0eb3035c1d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h +++ /dev/null @@ -1,41 +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 - -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "Ender-4 supports only 1 hotend / E-stepper. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Ender-4" - -#include "pins_RAMPS.h" - -// The board only has one PWM fan connector. The others are 12V always-on. -// The default config uses this pin to control the brightness of the LED -// band (case light). Thus the hotend and controller fans are always-on. - -#if ENABLED(CASE_LIGHT_ENABLE) - #undef FAN_PIN - #ifndef CASE_LIGHT_PIN - #define CASE_LIGHT_PIN RAMPS_D9_PIN - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_OLD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_OLD.h deleted file mode 100644 index a55348fec1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_OLD.h +++ /dev/null @@ -1,116 +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 - -/** - * Arduino Mega with RAMPS v1.0, v1.1, v1.2 pin assignments - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RAMPS <1.2" - -// Uncomment the following line for RAMPS v1.0 -//#define RAMPS_V_1_0 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 16 -#define Y_MAX_PIN 17 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 -#endif - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 38 -#define Y_DIR_PIN 40 -#define Y_ENABLE_PIN 36 - -#define Z_STEP_PIN 44 -#define Z_DIR_PIN 46 -#define Z_ENABLE_PIN 42 - -#define E0_STEP_PIN 32 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#if ENABLED(RAMPS_V_1_0) - #define HEATER_0_PIN 12 - #define HEATER_BED_PIN -1 - #ifndef FAN_PIN - #define FAN_PIN 11 - #endif -#else // RAMPS_V_1_1 or RAMPS_V_1_2 - #define HEATER_0_PIN 10 - #define HEATER_BED_PIN 8 - #ifndef FAN_PIN - #define FAN_PIN 9 - #endif -#endif - -// -// Misc. Functions -// -#define SDPOWER_PIN 48 -#define SDSS 53 -#define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // Hardware PWM - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 41 // Pullup or pulldown! -#define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM -#define SPINDLE_DIR_PIN 43 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h deleted file mode 100644 index 02193a5a03..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ /dev/null @@ -1,86 +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 - -/** - * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments - * The differences to the RAMPS v1.4 are: - * - Swap heater E0 with E1 - * - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10. - * - Change pins 16->42, 17->44 and 29->53 used for display. - * - * Applies to the following boards: - * - * RAMPS_PLUS_EFB (Extruder, Fan, Bed) - * RAMPS_PLUS_EEB (Extruder, Extruder, Bed) - * RAMPS_PLUS_EFF (Extruder, Fan, Fan) - * RAMPS_PLUS_EEF (Extruder, Extruder, Fan) - * RAMPS_PLUS_SF (Spindle, Controller Fan) - * - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RAMPS 1.4 Plus" - -#define RAMPS_D8_PIN 10 -#define RAMPS_D10_PIN 8 - -#include "pins_RAMPS.h" - -// -// Steppers - Swap E0 / E1 on 3DYMY -// -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN - -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#undef X_CS_PIN -#undef Y_CS_PIN -#undef Z_CS_PIN -#undef E0_CS_PIN -#undef E1_CS_PIN - -#if ENABLED(ULTRA_LCD, REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(NEWPANEL, PANEL_ONE) - #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #undef LCD_PINS_RS - #define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42 - #undef LCD_PINS_ENABLE - #define LCD_PINS_ENABLE 44 // 3DYMY boards pin 17 -> 44 - #endif - #undef LCD_PINS_D7 - #define LCD_PINS_D7 53 // 3DYMY boards pin 29 -> 53 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD.h deleted file mode 100644 index c69843c621..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD.h +++ /dev/null @@ -1,138 +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 - -/** - * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RigidBoard" -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops -#endif - -// -// MOSFET changes -// -#define RAMPS_D9_PIN 8 // FAN (by default) -#define RAMPS_D10_PIN 9 // EXTRUDER 1 -#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN - -#include "pins_RAMPS.h" - -// -// Steppers -// -// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3 -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 34 -#define E0_ENABLE_PIN 30 - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#define E1_STEP_PIN 26 -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 24 - -#define STEPPER_RESET_PIN 41 // Stepper drivers have a reset on RigidBot - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#undef TEMP_1_PIN -#undef TEMP_BED_PIN -#define TEMP_0_PIN 14 // Analog Input -#define TEMP_1_PIN 13 // Analog Input -#define TEMP_BED_PIN 15 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS_PIN -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// Heaters / Fans -// -#undef HEATER_BED_PIN -#define HEATER_BED_PIN 10 - -#ifndef FAN_PIN - #define FAN_PIN 8 // Same as RAMPS_13_EEF -#endif - -// -// Misc. Functions -// -#undef PS_ON_PIN -#define PS_ON_PIN -1 - -// -// LCD / Controller -// -// LCD Panel options for the RigidBoard -#if ENABLED(RIGIDBOT_PANEL) - - #undef BEEPER_PIN - #define BEEPER_PIN -1 - - // Direction buttons - #define BTN_UP 37 - #define BTN_DWN 35 - #define BTN_LFT 33 - #define BTN_RT 32 - - // 'R' button - #undef BTN_ENC - #define BTN_ENC 31 - - // Disable encoder - #undef BTN_EN1 - #define BTN_EN1 -1 - #undef BTN_EN2 - #define BTN_EN2 -1 - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - -#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 22 - - #undef KILL_PIN - #define KILL_PIN 32 - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h deleted file mode 100644 index 01ccb5927a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h +++ /dev/null @@ -1,52 +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 - -/** - * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments - */ - -#define BOARD_INFO_NAME "RigidBoard V2" - -#include "pins_RIGIDBOARD.h" - -// -// Steppers -// - -// I2C based DAC like on the Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Channels available for DAC, For Rigidboard there are 4 -#define DAC_STEPPER_ORDER { 0, 1, 2, 3 } - -#define DAC_STEPPER_SENSE 0.05 // sense resistors on rigidboard stepper chips are .05 value -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 4096 // was 5000 but max allowable value is actually 4096 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 2x = 4.096V -#define DAC_STEPPER_GAIN 1 // value of 1 here sets gain of 2 -#define DAC_DISABLE_PIN 42 // set low to enable DAC -#define DAC_OR_ADDRESS 0x01 - -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RL200.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RL200.h deleted file mode 100644 index 1202638d1c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RL200.h +++ /dev/null @@ -1,56 +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 - -/** - * Rapide Lite 200 v1 (RUMBA clone) pin assignments. Has slightly different assignment for - * extruder motors due to dual Z motors. Pinout therefore based on pins_RUMBA.h. - */ - -#define BOARD_INFO_NAME "RL200" -#define DEFAULT_MACHINE_NAME "Rapide Lite 200" - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#if DISABLED(Z_DUAL_STEPPER_DRIVERS) - #error "RL200 uses dual Z stepper motors. Update Configuration_adv.h or comment out this line to continue." -#endif - -#if !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825)) - #error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200." -#endif - -#define E0_STEP_PIN 26 // (RUMBA E1 pins) -#define E0_DIR_PIN 25 -#define E0_ENABLE_PIN 27 - -#define E1_STEP_PIN 29 // (RUMBA E2 pins) -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 39 - -#define Z2_STEP_PIN 23 // (RUMBA E0 pins) -#define Z2_DIR_PIN 22 -#define Z2_ENABLE_PIN 24 - -#include "pins_RUMBA.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA.h deleted file mode 100644 index cf3bfe226c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA.h +++ /dev/null @@ -1,231 +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 - -/** - * RUMBA pin assignments - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Rumba" -#endif -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#endif - -// -// Servos -// -#define SERVO0_PIN 5 - -// -// Limit Switches -// -#define X_MIN_PIN 37 -#define X_MAX_PIN 36 -#define Y_MIN_PIN 35 -#define Y_MAX_PIN 34 -#define Z_MIN_PIN 33 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 48 - -#define Y_STEP_PIN 54 -#define Y_DIR_PIN 47 -#define Y_ENABLE_PIN 55 - -#define Z_STEP_PIN 57 -#define Z_DIR_PIN 56 -#define Z_ENABLE_PIN 62 - -#ifndef E0_STEP_PIN - #define E0_STEP_PIN 23 - #define E0_DIR_PIN 22 - #define E0_ENABLE_PIN 24 -#endif - -#ifndef E1_STEP_PIN - #define E1_STEP_PIN 26 - #define E1_DIR_PIN 25 - #define E1_ENABLE_PIN 27 -#endif - -#if E1_STEP_PIN != 29 - #define E2_STEP_PIN 29 - #define E2_DIR_PIN 28 - #define E2_ENABLE_PIN 39 -#endif - -// -// Temperature Sensors -// -#ifndef TEMP_0_PIN - #if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 6 // Analog Input (connector *K1* on RUMBA thermocouple ADD ON is used) - #else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) - #endif -#endif - -#ifndef TEMP_1_PIN - #if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input (connector *K2* on RUMBA thermocouple ADD ON is used) - #else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) - #endif -#endif - -#if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 7 // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_BED is defined as thermocouple) -#else - #define TEMP_2_PIN 13 // Analog Input (default connector for thermistor *T2* on rumba board is used) -#endif - -// Optional for extruder 4 or chamber: -//#define TEMP_X_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) -#else - #define TEMP_BED_PIN 11 // Analog Input (default connector for thermistor *THB* on rumba board is used) -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 8 -#define HEATER_BED_PIN 9 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif -#ifndef FAN1_PIN - #define FAN1_PIN 8 -#endif - -// -// Misc. Functions -// -#define LED_PIN 13 -#define PS_ON_PIN 45 -#define KILL_PIN 46 -#define CASE_LIGHT_PIN 45 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#ifndef SPINDLE_LASER_PWM_PIN - #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM. Pin 4 interrupts OC0* and OC1* always in use? -#endif -#ifndef SPINDLE_LASER_ENA_PIN - #define SPINDLE_LASER_ENA_PIN 14 // Pullup! -#endif -#ifndef SPINDLE_DIR_PIN - #define SPINDLE_DIR_PIN 15 -#endif - -// -// LCD / Controller -// -#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 38 // Set as output on init - #define LCD_PINS_RS 41 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 19 - #define DOGLCD_MOSI 42 - #define DOGLCD_SCK 18 - #define DOGLCD_A0 LCD_PINS_DC -#elif ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS 42 - #define DOGLCD_A0 19 - #define DOGLCD_MOSI 51 - #define DOGLCD_SCK 52 - - //#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 18 // 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 41 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 38 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 40 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 - #endif - -#else - #define LCD_PINS_RS 19 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 18 - #define LCD_PINS_D5 38 - #define LCD_PINS_D6 41 -#endif - -#define LCD_PINS_D7 40 - -// -// Beeper, SD Card, Encoder -// -#define BEEPER_PIN 44 - -#if ENABLED(SDSUPPORT) - #define SDSS 53 - #define SD_DETECT_PIN 49 -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 11 - #define BTN_EN2 12 - #define BTN_ENC 43 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h deleted file mode 100644 index 0cc4ebb3ba..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h +++ /dev/null @@ -1,31 +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 - -#define BOARD_INFO_NAME "Raise3D Rumba" -#define DEFAULT_MACHINE_NAME "Raise3D N Series" - -// Raise3D uses thermocouples on the standard input pins -#define TEMP_0_PIN 15 // Analog Input -#define TEMP_1_PIN 14 // Analog Input - -#include "pins_RUMBA.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h deleted file mode 100644 index 27c746ad25..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h +++ /dev/null @@ -1,42 +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 - -/** - * Sainsmart 2-in-1 pin assignments - */ - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Sainsmart" - -// -// Heaters / Fans -// -#define RAMPS_D10_PIN 9 // E -#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat - // RAMPS_D8_PIN 8 // B -#define MOSFET_D_PIN 10 // F / E - -#include "pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TANGO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TANGO.h deleted file mode 100644 index 2cc8565db2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TANGO.h +++ /dev/null @@ -1,51 +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 - -/** - * BIQU Tango pin assignments - */ - -#define BOARD_INFO_NAME "Tango" - -#define FAN_PIN 8 -#define FAN1_PIN -1 - -#define ORIG_E0_AUTO_FAN_PIN 7 - -#ifndef TEMP_0_PIN - #if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 10 // Analog Input (connector *K1* on Tango thermocouple ADD ON is used) - #else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) - #endif -#endif - -#ifndef TEMP_1_PIN - #if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 9 // Analog Input (connector *K2* on Tango thermocouple ADD ON is used) - #else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) - #endif -#endif - -#include "pins_RUMBA.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h deleted file mode 100644 index fd0b67c88a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h +++ /dev/null @@ -1,40 +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 - -/** - * Arduino Mega with RAMPS v1.3 for Anycubic - */ - -#define BOARD_INFO_NAME "Anycubic RAMPS 1.3" - -#define IS_RAMPS_EFB -#define RAMPS_D9_PIN 44 -#define FAN2_PIN 9 -#define ORIG_E0_AUTO_FAN_PIN 9 - -#include "pins_RAMPS_13.h" - -#undef E1_STEP_PIN -#undef E1_DIR_PIN -#undef E1_ENABLE_PIN -#undef E1_CS_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h deleted file mode 100644 index 031ab8e16b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ /dev/null @@ -1,111 +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 - -/** - * Arduino Mega with RAMPS v1.4 for Anycubic - */ - -#define BOARD_INFO_NAME "Anycubic RAMPS 1.4" - -// -// Servos -// -#if MB(TRIGORILLA_14_11) - #define SERVO0_PIN 5 - #define SERVO1_PIN 4 - #define SERVO2_PIN 11 - #define SERVO3_PIN 6 -#endif - -// Labeled pins -#define TRIGORILLA_HEATER_BED_PIN 8 -#define TRIGORILLA_HEATER_0_PIN 10 -#define TRIGORILLA_HEATER_1_PIN 45 // Anycubic Kossel: Unused - -#define TRIGORILLA_FAN0_PIN 9 // Anycubic Kossel: Usually the part cooling fan -#define TRIGORILLA_FAN1_PIN 7 // Anycubic Kossel: Unused -#define TRIGORILLA_FAN2_PIN 44 // Anycubic Kossel: Hotend fan - -// Remap MOSFET pins to common usages: - -#define RAMPS_D10_PIN TRIGORILLA_HEATER_0_PIN // HEATER_0_PIN is always RAMPS_D10_PIN in pins_RAMPS.h - -#if HOTENDS > 1 // EEF and EEB - #define RAMPS_D9_PIN TRIGORILLA_HEATER_1_PIN - #if !TEMP_SENSOR_BED - // EEF - #define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN - #else - // EEB - #define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN - #define FAN_PIN TRIGORILLA_FAN0_PIN // Override pin 4 in pins_RAMPS.h - #endif -#elif TEMP_SENSOR_BED - // EFB (Anycubic Kossel default) - #define RAMPS_D9_PIN TRIGORILLA_FAN0_PIN - #define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN -#else - // EFF - #define RAMPS_D9_PIN TRIGORILLA_FAN1_PIN - #define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN -#endif - -#if HOTENDS > 1 || TEMP_SENSOR_BED // EEF, EEB, EFB - #define FAN1_PIN TRIGORILLA_FAN1_PIN -#endif -#define FAN2_PIN TRIGORILLA_FAN2_PIN -#define ORIG_E0_AUTO_FAN_PIN TRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config - -#include "pins_RAMPS.h" - -// -// AnyCubic made the following changes to 1.1.0-RC8 -// If these are appropriate for your LCD let us know. -// -#if 0 && HAS_SPI_LCD - - // LCD Display output pins - #if BOTH(NEWPANEL, PANEL_ONE) - #undef LCD_PINS_D6 - #define LCD_PINS_D6 57 - #endif - - // LCD Display input pins - #if ENABLED(NEWPANEL) - #if ANY(VIKI2, miniVIKI) - #undef DOGLCD_A0 - #define DOGLCD_A0 23 - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #undef BEEPER_PIN - #define BEEPER_PIN 33 - #undef LCD_BACKLIGHT_PIN - #define LCD_BACKLIGHT_PIN 67 - #endif - #elif ENABLED(MINIPANEL) - #undef BEEPER_PIN - #define BEEPER_PIN 33 - #undef DOGLCD_A0 - #define DOGLCD_A0 42 - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h deleted file mode 100644 index 48b510d8c2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h +++ /dev/null @@ -1,279 +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 - -/** - * Arduino Mega for Tronxy X5S-2E, etc. - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "TRONXY-V3-1.0 supports only 2 hotends/E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "TRONXY-V3-1.0" - -// -// Servos -// -#define SERVO1_PIN 12 // 2560 PIN 25/PB6 - -// -// Import RAMPS 1.4 pins -// -#include "pins_RAMPS.h" - -/** - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== AUX-1 connector ===== - * - * 2 4 6 8 - * #----------------# - * #2 | ° ° ° ° | - * #1 | ° ° ° ° | - * NOTCH #------ ------# - * 1 3 5 7 - * - * ################################### - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | VCC | + # - * # 2 | VCC | + # - * # 3 | GND | - # - * # 4 | GND | - # - * # 5 | N/C | # - * # 6 | 3 / PE1 (TXD0) | D1 # - * # 7 | N/C | # - * # 8 | 2 / PE0 (RXD0) | D0 # - * ################################### - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== Limit Switch connectors ===== - * - * ############## X+ ################# - * X+ # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 6 / PE4 (INT4) | D2 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * ############## X- ################# - * X- # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 7 / PE5 (INT5) | D3 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * ############## Y+ ################# - * Y+ # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 63/PJ0 (PCINT9) | D15 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * ############## Y- ################# - * Y- # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 64/PJ1 (PCINT10)| D14 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * ############## Z+ ################# - * Z+ # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 45 / PD2 (INT2) | D19 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * ############## Z- ################# - * Z- # Pin | ATMEGA2560 Pin | Arduino # - * 1 2 3 ################################### - * #- --- -# # 1 | 46 / PD3 (INT3) | D18 # - * | ° ° ° | # 2 | GND | - # - * #-------# # 3 | VCC | + # - * ################################### - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== EXP1/EXP2 connectors ===== - * - * (NOTE ORDER) EXP2 EXP1 - * 2 4 6 8 10 2 4 6 8 10 - * #-------------------# #-------------------# - * #2 | ° ° ° ° ° | #2 | ° ° ° ° ° | - * #1 | ° ° ° ° ° | #1 | ° ° ° ° ° | - * NOTCH #-------- -------# NOTCH #-------- -------# - * 1 3 5 7 9 1 3 5 7 9 - * - * ############# EXP1 ################ - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | 53 / PC0 | D37 # - * # 2 | 55 / PC2 | D35 # - * # 3 | 12 / PH0 (RXD2) | D17 # - * # 4 | 13 / PH1 (TXD2) | D16 # - * # 5 | 77 / PA1 | D23 # - * # 6 | 75 / PA3 | D25 # - * # 7 | 73 / PA5 | D27 # - * # 8 | 71 / PA7 | D29 # - * # 9 | GND | - # - * # 10 | VCC | + # - * ################################### - * - * ############# EXP2 ################ - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | 22 / PB3 (MISO) | D50 # - * # 2 | 20 / PB1 (SCK) | D52 # - * # 3 | 59 / PC6 | D31 # - * # 4 | N/C | # - * # 5 | 57 / PC4 | D33 # - * # 6 | 21 / PB2 (MOSI) | D51 # - * # 7 | N/C | # - * # 8 | 30 / !RESET | RESET # - * # 9 | GND | - # - * # 10 | 51 / PG0 | D41 # - * ################################### - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== ICSP connector ===== - * - * 2 4 6 - * #---------# - * | ° ° ° | - * | ° ° ° | - * #---------# - * 1 3 5 - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 22 / PB3 (MISO)| 50 # - * # 2 | VCC | + # - * # 3 | 20 / PB1 (SCK) | 52 # - * # 4 | 21 / PB2 (MOSI)| 51 # - * # 5 | 30 / !RESET | RESET # - * # 6 | GND | - # - * ################################## - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== SERVOS connector ===== - * - * 2 4 6 - * #---------# - * | ° ° ° | - * | ° ° ° | - * #---------# - * 1 3 5 - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 25 / PB6 (OC1B)| D12 # - * # 2 | 24 / PB5 (OC1A)| D11 # - * # 3 | GND | - # - * # 4 | GND | - # - * # 5 | VCC | + # - * # 6 | VCC | + # - * ################################## - * - * NOTE: Pins 1 and 2 are the ones closest to the "L" and "PWR" LEDs. - * - * NOTE: Check servo wiring before connecting, for example: - * + Airtronics (non-Z) use: Red = +; Black = -; Black & White, White or Orange = signal. - * + Airtronics-Z use: Red = +; Black = -; Blue = signal. - * + Futaba use: Red = +; Black = -; White = signal. - * + Hitec use: Red = +; Black = -; Yellow = signal. - * + JR use: Red = +; Brown = -; Orange = signal. - * - * NOTE: Test your servo limits: - * Due to effects of component tolerances and/or age, the usable range of S-values for individual servos may be less than the settable 0-255 range. For example: - * 1. One servo may have a fully usable range of M280 P0 S0 through M280 P0 S255. - * 2. A different servo (of the same brand and model) may have a usable range of only M280 P0 S0 through M280 P0 S165 after which you experience binding. - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== Thermistor connectors ===== - * - * (NOTE ORDER) TH2 TH1 TB - * 1 2 1 2 1 2 - * #- -# #- -# #- -# - * | ° ° | | ° ° | | ° ° | - * #-----# #-----# #-----# - * - * ############## TB ################# - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | GND | - # - * # 2 | 83 / PK6 (ADC14)| A14 # - * ################################### - * - * ############## TH1 ################ - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | GND | - # - * # 2 | 84 / PK5 (ADC13)| A13 # - * ################################### - * - * ############## TH2 ################ - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################### - * # 1 | GND | - # - * # 2 | 82 / PK7 (ADC15)| A15 # - * ################################### - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - * - * ===== XS3 connector ===== - * - * 2 4 6 - * #---------# - * | ° ° ° | - * | ° ° ° | - * #---------# - * 1 3 5 - * - * ################################## - * # Pin | ATMEGA2560 Pin | Arduino # - * ################################## - * # 1 | 85 / ADC12 | A12 # - * # 2 | 86 / ADC11 | A11 # - * # 3 | GND | - # - * # 4 | GND | - # - * # 5 | VCC | + # - * # 6 | VCC | + # - * ################################## - * - * NOTE: Pins 1 and 2 are the ones closest to the "L" and "PWR" LEDs. - * - * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TT_OSCAR.h deleted file mode 100644 index 1c40729a87..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ /dev/null @@ -1,512 +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 . - * - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 5 || E_STEPPERS > 5 - #error "TTOSCAR supports up to 5 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "TT OSCAR" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -// -// Servos -// -#define SERVO0_PIN 11 -#define SERVO1_PIN 12 -#define SERVO2_PIN 5 -#define SERVO3_PIN 4 - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#define X_MAX_PIN 2 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN SERVO3_PIN -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#define X_CS_PIN 57 - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#define Y_CS_PIN 58 - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#define Z_CS_PIN 53 - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#define E0_CS_PIN 49 - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#define E1_CS_PIN E0_CS_PIN - -#define E2_STEP_PIN 63 -#define E2_DIR_PIN 22 -#define E2_ENABLE_PIN 59 -#define E2_CS_PIN E0_CS_PIN - -#define E3_STEP_PIN 32 -#define E3_DIR_PIN 40 -#define E3_ENABLE_PIN 39 -#define E3_CS_PIN E0_CS_PIN - -#define E4_STEP_PIN 43 -#define E4_DIR_PIN 42 -#define E4_ENABLE_PIN 47 -#define E4_CS_PIN E0_CS_PIN - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - - #define X_SERIAL_TX_PIN -1 // 59 - #define X_SERIAL_RX_PIN -1 // 63 - #define X2_SERIAL_TX_PIN -1 - #define X2_SERIAL_RX_PIN -1 - - #define Y_SERIAL_TX_PIN -1 // 64 - #define Y_SERIAL_RX_PIN -1 // 40 - #define Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 - - #define Z_SERIAL_TX_PIN -1 // 44 - #define Z_SERIAL_RX_PIN -1 // 42 - #define Z2_SERIAL_TX_PIN -1 - #define Z2_SERIAL_RX_PIN -1 - - #define E0_SERIAL_TX_PIN -1 // 66 - #define E0_SERIAL_RX_PIN -1 // 65 - #define E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 -#endif - -// -// Default pins for TMC software SPI -// -//#if ENABLED(TMC_USE_SW_SPI) -// #ifndef TMC_SW_MOSI -// #define TMC_SW_MOSI 66 -// #endif -// #ifndef TMC_SW_MISO -// #define TMC_SW_MISO 44 -// #endif -// #ifndef TMC_SW_SCK -// #define TMC_SW_SCK 64 -// #endif -//#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 -#define TEMP_1_PIN 15 -#define TEMP_2_PIN 10 -#define TEMP_3_PIN 11 -#define TEMP_BED_PIN 14 - -#if TEMP_SENSOR_CHAMBER > 0 - #define TEMP_CHAMBER_PIN 12 -#else - #define TEMP_4_PIN 12 -#endif - -// SPI for Max6675 or Max31855 Thermocouple -//#if DISABLED(SDSUPPORT) -// #define MAX6675_SS 66 // Don't use 53 if there is even the remote possibility of using Display/SD card -//#else -// #define MAX6675_SS 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -//#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 44 -#define HEATER_BED_PIN 8 - -#define FAN_PIN 9 - -#if EXTRUDERS >= 5 - #define HEATER_4_PIN 6 -#else - #define FAN1_PIN 6 -#endif - -#if EXTRUDERS >= 4 - #define HEATER_3_PIN 45 -#else - #define FAN2_PIN 45 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -//#ifndef FILWIDTH_PIN -// #define FILWIDTH_PIN 5 // Analog Input -//#endif - -// DIO 4 (Servos plug) for the runout sensor. -//#define FIL_RUNOUT_PIN SERVO3_PIN - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -// -// Case Light -// -#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN) - #if !NUM_SERVOS // Prefer the servo connector - #define CASE_LIGHT_PIN 6 // Hardware PWM - #elif HAS_FREE_AUX2_PINS // Try to use AUX 2 - #define CASE_LIGHT_PIN 44 // Hardware PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #if !NUM_SERVOS // Prefer the servo connector - #define SPINDLE_LASER_ENABLE_PIN 4 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM - #define SPINDLE_DIR_PIN 5 - #elif HAS_FREE_AUX2_PINS // Try to use AUX 2 - #define SPINDLE_LASER_ENABLE_PIN 40 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -// -// Průša i3 MK2 Multiplexer Support -// -//#ifndef E_MUX0_PIN -// #define E_MUX0_PIN 58 // Y_CS_PIN -//#endif -//#ifndef E_MUX1_PIN -// #define E_MUX1_PIN 53 // Z_CS_PIN -//#endif -//#ifndef E_MUX2_PIN -// #define E_MUX2_PIN 49 // En_CS_PIN -//#endif - -////////////////////////// -// LCDs and Controllers // -////////////////////////// - -#if HAS_SPI_LCD - - // - // LCD Display output pins - // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - - #elif BOTH(NEWPANEL, PANEL_ONE) - - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - - #elif ENABLED(ZONESTAR_LCD) - - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 - #define ADC_KEYPAD_PIN 12 - - #else - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 25 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 37 - #endif - - #else - - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init - // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 - #define DOGLCD_A0 LCD_PINS_DC - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #endif - - #define LCD_PINS_D7 29 - - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - #endif - - #endif - - #if DISABLED(NEWPANEL) - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - - #endif - - // - // LCD Display input pins - // - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 - #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #endif - - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - //#define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - //#define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - #define BTN_ENC -1 - - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - - #elif EITHER(VIKI2, miniVIKI) - - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 - - #define BEEPER_PIN 33 - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board - //#define KILL_PIN 31 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - //#define KILL_PIN 41 - - #elif ENABLED(MKS_MINI_12864) - - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 - - // GLCD features - //#define LCD_CONTRAST_INIT 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BEEPER_PIN 37 - - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - //#define SDSS 53 - #define SD_DETECT_PIN 49 - //#define KILL_PIN 64 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - - // GLCD features - //#define LCD_CONTRAST_INIT 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - - #define SDSS 53 - #define SD_DETECT_PIN 49 - //#define KILL_PIN 64 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons are directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - //#define KILL_PIN 41 - #endif - - #endif - - #endif // NEWPANEL - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h deleted file mode 100644 index c182aa96f0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h +++ /dev/null @@ -1,140 +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 - -/** - * Ultiboard v2.0 pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#ifndef __AVR_ATmega2560__ - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Ultimaker 2.x" -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" - -// -// Limit Switches -// -#define X_STOP_PIN 22 -#define Y_STOP_PIN 26 -#define Z_STOP_PIN 29 - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 32 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 31 - -#define Z_STEP_PIN 35 -#define Z_DIR_PIN 36 -#define Z_ENABLE_PIN 34 - -#define E0_STEP_PIN 42 -#define E0_DIR_PIN 43 -#define E0_ENABLE_PIN 37 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -#define MOTOR_CURRENT_PWM_XY_PIN 44 -#define MOTOR_CURRENT_PWM_Z_PIN 45 -#define MOTOR_CURRENT_PWM_E_PIN 46 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250} - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -#define ORIG_E0_AUTO_FAN_PIN 77 - -// -// Misc. Functions -// -#define SDSS 53 -#define SD_DETECT_PIN 39 -#define LED_PIN 8 -#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered -#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider. - -// -// LCD / Controller -// -#define BEEPER_PIN 18 - -#define LCD_PINS_RS 20 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 14 -#define LCD_PINS_D5 21 -#define LCD_PINS_D6 5 -#define LCD_PINS_D7 6 - -// Buttons are directly attached -#define BTN_EN1 40 -#define BTN_EN2 41 -#define BTN_ENC 19 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER // use the LED_PIN for spindle speed control or case light - #undef LED_PIN - #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENA_PIN 17 // Pullup! - #define SPINDLE_LASER_PWM_PIN 8 // Hardware PWM -#else - #undef LED_PIN - #define CASE_LIGHT_PIN 8 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER.h deleted file mode 100644 index b2594acebc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER.h +++ /dev/null @@ -1,165 +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 - -/** - * Ultimaker pin assignments - */ - -/** - * Rev B 2 JAN 2017 - * - * Added pin definitions for: - * M3, M4 & M5 spindle control commands - * case light - */ - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Ultimaker" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" - -// -// Servos -// -#define SERVO0_PIN 11 - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 32 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#define E0_STEP_PIN 43 -#define E0_DIR_PIN 45 -#define E0_ENABLE_PIN 41 - -#define E1_STEP_PIN 49 -#define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 48 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 9 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -#define HEATER_1_PIN 3 -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 7 -#endif - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 -#define PS_ON_PIN 12 -#define SUICIDE_PIN 54 // PIN that has to be turned on right after start, to keep power flowing. -#define CASE_LIGHT_PIN 8 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // Buttons directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #define SD_DETECT_PIN -1 - - #endif // !NEWPANEL - -#endif // HAS_SPI_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 10 // Pullup! -#define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h deleted file mode 100644 index dd9aaf1292..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ /dev/null @@ -1,274 +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 - -/** - * Ultimaker pin assignments (Old electronics) - */ - -/** - * Rev B 3 JAN 2017 - * - * Details on pin definitions for M3, M4 & M5 spindle control commands and for - * the CASE_LIGHT_PIN are at the end of this file. - * - * This started out as an attempt to add pin definitions for M3, M4 & M5 spindle - * control commands but quickly turned into a head scratcher as the sources for - * the revisions provided inconsistent information. - * - * As best I can determine: - * 1.5.3 boards should use the pins_ULTIMAKER.h file which means the BOARD_INFO_NAME - * define in this file should say 1.5.3 rather than 1.5.4 - * This file is meant for 1.1 - 1.3 boards. - * The endstops for the 1.0 boards use different definitions than on the 1.1 - 1.3 - * boards. - * - * I've added sections that have the 1.0 and 1.5.3 + endstop definitions so you can - * easily switch if needed. I've also copied over the 1.5.3 + LCD definitions. - * - * To be 100% sure of the board you have: - * 1. In Configuration_adv.h enable "PINS_DEBUGGING" - * 2. Compile & uploade - * 3. Enter the command "M43 W1 I1". This command will report that pin nmumber and - * name of any pin that changes state. - * 4. Using a 1k (approximately) resistor pull the endstops and some of the LCD pins - * to ground and see what is reported. - * 5. If the reported pin doesn't match the file then try a different board revision - * and repeat steps 2 - 5 - */ - -#define BOARD_REV_1_1_TO_1_3 -//#define BOARD_REV_1_0 -//#define BOARD_REV_1_5 - -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#ifdef BOARD_REV_1_1_TO_1_3 - #define BOARD_INFO_NAME "Ultimaker 1.1-1.3" -#elif defined(BOARD_REV_1_0) - #define BOARD_INFO_NAME "Ultimaker 1.0" -#elif defined(BOARD_REV_1_5) - #define BOARD_INFO_NAME "Ultimaker 1.5" -#else - #define BOARD_INFO_NAME "Ultimaker 1.5.4+" -#endif -#define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" - -// -// Limit Switches -// -#if ENABLED(BOARD_REV_1_1_TO_1_3) - #define X_MIN_PIN 15 // SW1 - #define X_MAX_PIN 14 // SW2 - #define Y_MIN_PIN 17 // SW3 - #define Y_MAX_PIN 16 // SW4 - #define Z_MIN_PIN 19 // SW5 - #define Z_MAX_PIN 18 // SW6 -#endif - -#if ENABLED(BOARD_REV_1_0) - #if HAS_CUTTER - #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM - #define Y_STOP_PIN 12 // SW2 - #define Z_STOP_PIN 11 // SW3 - #else - #define X_MIN_PIN 13 // SW1 - #define X_MAX_PIN 12 // SW2 - #define Y_MIN_PIN 11 // SW3 - #define Y_MAX_PIN 10 // SW4 - #define Z_MIN_PIN 9 // SW5 - #define Z_MAX_PIN 8 // SW6 - #endif -#endif - -#if ENABLED(BOARD_REV_1_5) - #define X_MIN_PIN 22 - #define X_MAX_PIN 24 - #define Y_MIN_PIN 26 - #define Y_MAX_PIN 28 - #define Z_MIN_PIN 30 - #define Z_MAX_PIN 32 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#if !defined(Z_MIN_PROBE_PIN) && !(HAS_CUTTER && ENABLED(BOARD_REV_1_0)) - #define Z_MIN_PROBE_PIN Z_MAX_PIN -#endif - -// -// Steppers -// -#define X_STEP_PIN 25 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 27 - -#define Y_STEP_PIN 31 -#define Y_DIR_PIN 33 -#define Y_ENABLE_PIN 29 - -#define Z_STEP_PIN 37 -#define Z_DIR_PIN 39 -#define Z_ENABLE_PIN 35 - -#if HAS_CUTTER && ENABLED(BOARD_REV_1_1_TO_1_3) && EXTRUDERS == 1 - // Move E0 to the spare and get Spindle/Laser signals from E0 - #define E0_STEP_PIN 49 - #define E0_DIR_PIN 47 - #define E0_ENABLE_PIN 48 -#else - #define E0_STEP_PIN 43 - #define E0_DIR_PIN 45 - #define E0_ENABLE_PIN 41 - - #define E1_STEP_PIN 49 - #define E1_DIR_PIN 47 - #define E1_ENABLE_PIN 48 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 8 // Analog Input -#define TEMP_1_PIN 1 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 2 -//#define HEATER_1_PIN 3 // used for case light Rev A said "1" -#define HEATER_BED_PIN 4 - -// -// LCD / Controller -// -#if ANY(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) - - #define LCD_PINS_RS 24 - #define LCD_PINS_ENABLE 22 - #define LCD_PINS_D4 36 - #define LCD_PINS_D5 34 - #define LCD_PINS_D6 32 - #define LCD_PINS_D7 30 - -#elif ENABLED(BOARD_REV_1_5, ULTRA_LCD) - - #define BEEPER_PIN 18 - - #if ENABLED(NEWPANEL) - - #define LCD_PINS_RS 20 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 6 - - // Buttons directly attached - #define BTN_EN1 40 - #define BTN_EN2 42 - #define BTN_ENC 19 - - #define SD_DETECT_PIN 38 - - #else // !NEWPANEL - Old style panel with shift register - - // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 5 - #define LCD_PINS_D4 6 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 20 - #define LCD_PINS_D7 19 - - #endif // !NEWPANEL - -#endif - -// -// case light - see spindle section for more info on available hardware PWMs -// -#if !PIN_EXISTS(CASE_LIGHT) && ENABLED(BOARD_REV_1_5) - #define CASE_LIGHT_PIN 7 // use PWM - MUST BE HARDWARE PWM -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER - #if EITHER(BOARD_REV_1_0, BOARD_REV_1_5) // Use the last three SW positions - #define SPINDLE_DIR_PIN 10 // 1.0: SW4 1.5: EXP3-6 ("10") - #define SPINDLE_LASER_PWM_PIN 9 // 1.0: SW5 1.5: EXP3-7 ( "9") .. MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENA_PIN 8 // 1.0: SW6 1.5: EXP3-8 ( "8") .. Pin should have a pullup! - #elif ENABLED(BOARD_REV_1_1_TO_1_3) - /** - * Only four hardware PWMs physically connected to anything on these boards: - * - * HEATER_0_PIN 2 silkscreen varies - usually "PWM 1" or "HEATER1" - * HEATER_1_PIN 3 silkscreen varies - usually "PWM 2" or "HEATER2" - * HEATER_BED_PIN 4 silkscreen varies - usually "PWM 3" or "HEATED BED" - * E0_DIR_PIN 45 - * - * If one of the heaters is used then special precautions will usually be needed. - * They have an LED and resistor pullup to +24V which could damage 3.3V-5V ICs. - */ - #if EXTRUDERS == 1 - #define SPINDLE_DIR_PIN 43 - #define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 41 // Pullup! - #elif TEMP_SENSOR_BED == 0 // Can't use E0 so see if HEATER_BED_PIN is available - #undef HEATER_BED_PIN - #define SPINDLE_DIR_PIN 38 // Probably pin 4 on 10 pin connector closest to the E0 socket - #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM - Special precautions usually needed. - #define SPINDLE_LASER_ENA_PIN 40 // Pullup! (Probably pin 6 on the 10-pin - // connector closest to the E0 socket) - #endif - #endif -#endif - -/** - * Where to get the spindle signals on the E0 socket - * - * spindle signal socket name socket name - * ------- - * SPINDLE_LASER_ENA_PIN /ENABLE *| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_DIR_PIN STEP O| |O VDD - * SPINDLE_LASER_PWM_PIN DIR O| |O GND - * ------- - * * - pin closest to MS1, MS2 & MS3 jumpers on the board - * - * Note: Socket names vary from vendor to vendor. - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_VORON.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_VORON.h deleted file mode 100644 index 43c3317164..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_VORON.h +++ /dev/null @@ -1,47 +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 - -/** - * VORON Design v2 pin assignments - * See https://github.com/mzbotreprap/VORON/blob/master/Firmware/Marlin/pins_RAMPS_VORON.h - */ - -#define BOARD_INFO_NAME "VORON Design v2" - -#define RAMPS_D8_PIN 11 - -#include "pins_RAMPS.h" - -// -// Heaters / Fans -// -#undef FAN_PIN -#define FAN_PIN 5 // Using the pin for the controller fan since controller fan is always on. -#define CONTROLLER_FAN_PIN 8 -#define ORIG_E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan -#define ORIG_E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan) - -// -// LCDs and Controllers -// -#undef BEEPER_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ZRIB_V20.h deleted file mode 100644 index bf85bfa12d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_ZRIB_V20.h +++ /dev/null @@ -1,69 +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 - -/** - * ZRIB V2.0 & V3.0 pin assignments - * V2 and V3 Boards only differ in USB controller, nothing affecting the pins. - */ - -#include "pins_MKS_GEN_13.h" - -#define ZRIB_V20_D6_PIN 6 // Fan -#define ZRIB_V20_D9_PIN 9 // Fan2 -#define ZRIB_V20_A10_PIN 10 -#define ZRIB_V20_D16_PIN 16 -#define ZRIB_V20_D17_PIN 17 -#define ZRIB_V20_D23_PIN 23 -#define ZRIB_V20_D25_PIN 25 -#define ZRIB_V20_D27_PIN 27 -#define ZRIB_V20_D29_PIN 29 -#define ZRIB_V20_D37_PIN 37 - -#define ORIG_E0_AUTO_FAN_PIN ZRIB_V20_D6_PIN -#define ORIG_E1_AUTO_FAN_PIN ZRIB_V20_D6_PIN -#define ORIG_E2_AUTO_FAN_PIN ZRIB_V20_D6_PIN -#define ORIG_E3_AUTO_FAN_PIN ZRIB_V20_D6_PIN - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 11 // Analog Input -#endif - -#if ENABLED(ZONESTAR_LCD) - #undef LCD_PINS_RS - #undef LCD_PINS_ENABLE - #undef LCD_PINS_D4 - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 - #undef ADC_KEYPAD_PIN - #undef BEEPER_PIN - - #define LCD_PINS_RS ZRIB_V20_D16_PIN - #define LCD_PINS_ENABLE ZRIB_V20_D17_PIN - #define LCD_PINS_D4 ZRIB_V20_D23_PIN - #define LCD_PINS_D5 ZRIB_V20_D25_PIN - #define LCD_PINS_D6 ZRIB_V20_D27_PIN - #define LCD_PINS_D7 ZRIB_V20_D29_PIN - #define ADC_KEYPAD_PIN ZRIB_V20_A10_PIN - #define BEEPER_PIN ZRIB_V20_D37_PIN -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h deleted file mode 100644 index 8545dc488a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h +++ /dev/null @@ -1,288 +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 - -/** - * Z-Bolt X Series board – based on Arduino Mega2560 - */ - -#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." -#endif - -#define BOARD_INFO_NAME "Z-Bolt X Series" - -// -// Servos -// -#ifndef SERVO0_PIN - #define SERVO0_PIN 11 -#endif -#ifndef SERVO3_PIN - #define SERVO3_PIN 4 -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 3 -#ifndef X_MAX_PIN - #define X_MAX_PIN 2 -#endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif - -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif - -#define Z_STEP_PIN 46 -#define Z_DIR_PIN 48 -#define Z_ENABLE_PIN 62 -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif - -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif - -#define E1_STEP_PIN 36 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 30 -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif - -// Red -#define E2_STEP_PIN 42 -#define E2_DIR_PIN 40 -#define E2_ENABLE_PIN 65 -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif - -// Black -#define E3_STEP_PIN 44 -#define E3_DIR_PIN 64 -#define E3_ENABLE_PIN 66 -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_2_PIN 5 // Analog Input (BLACK) -#define TEMP_3_PIN 9 // Analog Input (RED) -#define TEMP_BED_PIN 14 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 10 -#define HEATER_1_PIN 7 -#define HEATER_2_PIN 6 -#define HEATER_3_PIN 5 -#define HEATER_BED_PIN 8 - -#define FAN_PIN 9 - -// -// Misc. Functions -// -#define SDSS 53 -#define LED_PIN 13 - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif - -// Оn the servos connector -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 4 -#endif - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // Prefer the servo connector - #define CASE_LIGHT_PIN 6 // Hardware PWM - #elif HAS_FREE_AUX2_PINS - #define CASE_LIGHT_PIN 44 // Hardware PWM - #endif -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // Prefer the servo connector - #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM - #define SPINDLE_DIR_PIN 5 - #elif HAS_FREE_AUX2_PINS - #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_DIR_PIN 65 - #endif -#endif - -// -// TMC software SPI -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 66 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 44 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 64 - #endif -#endif - -#if HAS_DRIVER(TMC2208) - /** - * TMC2208 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - - #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN 40 - #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN 63 - #endif - #ifndef X2_SERIAL_TX_PIN - #define X2_SERIAL_TX_PIN -1 - #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN -1 - #endif - - #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN 59 - #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN 64 - #endif - #ifndef Y2_SERIAL_TX_PIN - #define Y2_SERIAL_TX_PIN -1 - #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN -1 - #endif - - #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN 42 - #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN 65 - #endif - #ifndef Z2_SERIAL_TX_PIN - #define Z2_SERIAL_TX_PIN -1 - #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN -1 - #endif - - #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN 44 - #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN 66 - #endif - #ifndef E1_SERIAL_TX_PIN - #define E1_SERIAL_TX_PIN -1 - #endif - #ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN -1 - #endif - #ifndef E2_SERIAL_TX_PIN - #define E2_SERIAL_TX_PIN -1 - #endif - #ifndef E2_SERIAL_RX_PIN - #define E2_SERIAL_RX_PIN -1 - #endif - #ifndef E3_SERIAL_TX_PIN - #define E3_SERIAL_TX_PIN -1 - #endif - #ifndef E3_SERIAL_RX_PIN - #define E3_SERIAL_RX_PIN -1 - #endif - #ifndef E4_SERIAL_TX_PIN - #define E4_SERIAL_TX_PIN -1 - #endif - #ifndef E4_SERIAL_RX_PIN - #define E4_SERIAL_RX_PIN -1 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ADSK.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ADSK.h deleted file mode 100644 index c502f07671..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ADSK.h +++ /dev/null @@ -1,208 +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 - -/** - * Arduino DUE Shield Kit (ADSK) pin assignments - */ - -#define BOARD_INFO_NAME "ADSK" - -#if !defined(__SAM3X8E__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'" -#endif - -/* CNC shield modifications: -FROM THE BOTTOM CUT THE 5V PIN THAT GOES TO ARDUINO!!! -On the top put jumper between 5V and 3V3 pins, - jumper between D12 and A.STEP, jumper between D13 and A.DIR -*/ - -/* CNC shield 3D printer connections: -X,Y,Z steppers as normal -A stepper for E0 extruder -(X-)&(GND) - X limit -(Y-)&(GND) - Y limit -(Z-)&(GND) - Z limit -(Abort)&(GND) - Extruder thermistor (also require pullup resistor 4.7K between "Abort" and - Vcc (now "5V" on the board but actual 3.3V because of jumper)) -(Hold)&(GND) - Bed thermistor (also require pullup resistor 4.7K between "Hold" and - Vcc (now "5V" on the board but actual 3.3V because of jumper)) -(CoolEn) - 3.3v signal to controll extruder heater MOSFET -(Resume) - 3.3v signal to control heatbed MOSFET -(SDA) - 3.3v signal to controll extruder fan -(SCL) - 3.3v signal to controll extruder cooling fan -*/ - -/* CNC Shield pinout -"Name on the board": DUE pin -"Abort": Analog pin 0 or Digital pin 54 -"Hold": Analog pin 1 or Digital pin 55 -"Resume": Analog pin 2 or Digital pin 56 -"CoolEn": Analog pin 3 or Digital pin 57 -"SDA": Analog pin 4 or Digital pin 58 -"SCL": Analog pin 5 or Digital pin 59 -"E-STOP": Reset pin -"RX": Digital pin 0 -"TX": Digital pin 1 -"X.STEP": Digital pin 2 -"Y.STEP": Digital pin 3 -"Z.STEP": Digital pin 4 -"X.DIR": Digital pin 5 -"Y.DIR": Digital pin 6 -"Z.DIR": Digital pin 7 -"EN": Digital pin 8 -"X+","X-": Digital pin 9 -"Y+","Y-": Digital pin 10 -"Z+","Z-": Digital pin 11 -"SpinEn": Digital pin 12 -> will be connected to A.STEP with jumper -"SpinDir": Digital pin 13 -> will be connected to A.DIR with jumper -*/ - -// -// Servos -// -#define SERVO0_PIN 61 // Analog pin 7, Digital pin 61 - -// -// Limit Switches -// -#define X_MIN_PIN 9 -#define Y_MIN_PIN 10 -#define Z_MIN_PIN 11 - -#define Z_MIN_PROBE_PIN 62 // Analog pin 8, Digital pin 62 - -// -// Steppers -// -#define X_STEP_PIN 2 -#define X_DIR_PIN 5 -#define X_ENABLE_PIN 8 - -#define Y_STEP_PIN 3 -#define Y_DIR_PIN 6 -#define Y_ENABLE_PIN 8 - -#define Z_STEP_PIN 4 -#define Z_DIR_PIN 7 -#define Z_ENABLE_PIN 8 - -#define E0_STEP_PIN 12 -#define E0_DIR_PIN 13 -#define E0_ENABLE_PIN 8 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 55 // "Hold": Analog pin 1, Digital pin 55 -#define HEATER_BED_PIN 57 // "CoolEn": Analog pin 3, Digital pin 57 -#define FAN_PIN 54 // "Abort": Analog pin 0, Digital pin 54 -#undef E0_AUTO_FAN_PIN -#define E0_AUTO_FAN_PIN 56 // "Resume": Analog pin 2, Digital pin 56 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 4 // "SDA": Analog pin 4, Digital pin 58 -#define TEMP_BED_PIN 5 // "SCL": Analog pin 5, Digital pin 59 - -// -// Misc. Functions -// -#define SDSS 52 - -#if ENABLED(ZONESTAR_LCD) - - /** - * The 2004 LCD should be powered with 5V. - * The next LCD pins RS,D4,D5,D6,D7 have internal pull-ups to 5V and as result the 5V will be on these pins. - * Luckily these internal pull-ups have really high resistance and adding 33K pull-down resistors will create - * simple voltage divider that will bring the voltage down just slightly bellow 3.3V. - * - * This LCD also has buttons that connected to the same ADC pin with different voltage divider combinations. - * On the LCD panel there is internal pull-up resistor of the 4.7K connected to 5V. - * Connecting another 4.7K pull-down resistor between ADC pin and the GND - * will result in scaled values for voltage dividers and will bring them down to be always below 3.3V. - * - * For 2004 LCD to work with 3.3V board like Arduino DUE the next required: - * Pull-down resistors of 33K between each of LCD pins RS,D4,D5,D6,D7 and the GND. - * Pull-down resistor of 4.7K between ADC_KEYPAD_PIN and the GND - * - * All these modifications will still work with 5V based boards but require proper scaled ADC values - */ - - #ifdef __SAM3X8E__ - #define AREF_VOLTS 3.3 - #else - #define AREF_VOLTS 5.0 - #endif - - // - // LCD / Controller - // - #define LCD_PINS_ENABLE 14 - #define LCD_PINS_RS 15 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 17 - #define LCD_PINS_D6 18 - #define LCD_PINS_D7 19 - #define ADC_KEYPAD_PIN 6 //60 // Analog pin 6, Digital pin 60 - - /** - * The below defines will scale all the values to work properly on both - * 5V (Mega) and 3.3V (DUE) boards with all pull-up resistors added for 3.3V - */ - - #define ADC_BUTTONS_VALUE_SCALE (5.0/AREF_VOLTS) // The LCD module pullup voltage is 5.0V but ADC reference voltage is 3.3V - - #define ADC_BUTTONS_R_PULLDOWN 4.7 // Moves voltage down to be bellow 3.3V instead of 5V - // the resistors values will be scaled because of 4.7K pulldown parallel resistor - #define _ADC_BUTTONS_R_SCALED(R) ((R) * (ADC_BUTTONS_R_PULLDOWN) / ((R) + ADC_BUTTONS_R_PULLDOWN)) - - // buttons pullup resistor - #define ADC_BUTTONS_R_PULLUP 4.7 // the resistor on the 2004 LCD panel - // buttons resistors with scaled values because of parallel pulldown resistor - #define ADC_BUTTONS_LEFT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(0.47) - #define ADC_BUTTONS_RIGHT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(4.7) - #define ADC_BUTTONS_UP_R_PULLDOWN _ADC_BUTTONS_R_SCALED(1.0) - #define ADC_BUTTONS_DOWN_R_PULLDOWN _ADC_BUTTONS_R_SCALED(10.0) - #define ADC_BUTTONS_MIDDLE_R_PULLDOWN _ADC_BUTTONS_R_SCALED(2.2) - -#endif // ZONESTAR_LCD - -/** - * RJ45 8 pins extruder connector - * - * 1 - GND (Please do not connect to the same GND as extruder heater to prevent ground offset voltage) - * 2 - thermistor - * 3 - SERVO PWM - * 4 - extruder heater - * 5 - FAN (print cooling) - * 6 - FAN (extruder cooling) - * 7 - Probe signal - * 8 - 5V - * - * Standard ethernet pairs: 1&2, 3&6, 4&5, 7&8 - * Use CAT7 cable to have all pairs shielded - * - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h deleted file mode 100644 index 75dd004648..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h +++ /dev/null @@ -1,160 +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 - -/** - * Alligator Board R2 - * http://www.3dartists.org/ - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Alligator Board R2" - -// -// Servos -// -#define SERVO0_PIN 36 -#define SERVO1_PIN 40 -#define SERVO2_PIN 41 -#define SERVO3_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 33 // PC1 -#define X_MAX_PIN 34 // PC2 -#define Y_MIN_PIN 35 // PC3 -#define Y_MAX_PIN 37 // PC5 -#define Z_MIN_PIN 38 // PC6 -#define Z_MAX_PIN 39 // PC7 - -// -// Steppers -// -#define X_STEP_PIN 96 // PB24 -#define X_DIR_PIN 2 // PB25 -#define X_ENABLE_PIN 24 // PA15, motor RESET pin - -#define Y_STEP_PIN 94 // PB22 -#define Y_DIR_PIN 95 // PB23 -#define Y_ENABLE_PIN 24 // PA15, motor RESET pin - -#define Z_STEP_PIN 98 // PC27 -#define Z_DIR_PIN 3 // PC28 -#define Z_ENABLE_PIN 24 // PA15, motor RESET pin - -#define E0_STEP_PIN 5 // PC25 -#define E0_DIR_PIN 4 // PC26 -#define E0_ENABLE_PIN 24 // PA15, motor RESET pin - -#define E1_STEP_PIN 28 // PD3 on piggy -#define E1_DIR_PIN 27 // PD2 on piggy -#define E1_ENABLE_PIN 24 // PA15, motor RESET pin - -#define E2_STEP_PIN 11 // PD7 on piggy -#define E2_DIR_PIN 29 // PD6 on piggy -#define E2_ENABLE_PIN 24 // PA15, motor RESET pin - -#define E3_STEP_PIN 30 // PD9 on piggy -#define E3_DIR_PIN 12 // PD8 on piggy -#define E3_ENABLE_PIN 24 // PA15, motor RESET pin - -// Microstepping pins - Mapping not from fastio.h (?) -#define X_MS1_PIN 99 // PC10 -#define Y_MS1_PIN 10 // PC29 -#define Z_MS1_PIN 44 // PC19 -#define E0_MS1_PIN 45 // PC18 - -//#define MOTOR_FAULT_PIN 22 // PB26 , motor X-Y-Z-E0 motor FAULT - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input (PA24) -#define TEMP_1_PIN 2 // Analog Input (PA23 on piggy) -#define TEMP_2_PIN 3 // Analog Input (PA22 on piggy) -#define TEMP_3_PIN 4 // Analog Input (PA6 on piggy) -#define TEMP_BED_PIN 0 // Analog Input (PA16) - -// -// Heaters / Fans -// -// Note that on the Due pin A0 on the board is channel 2 on the ARM chip -#define HEATER_0_PIN 68 // PA1 -#define HEATER_1_PIN 8 // PC22 on piggy -#define HEATER_2_PIN 9 // PC21 on piggy -#define HEATER_3_PIN 97 // PC20 on piggy -#define HEATER_BED_PIN 69 // PA0 - -#ifndef FAN_PIN - #define FAN_PIN 92 // PA5 -#endif -#define FAN1_PIN 31 // PA7 - -// -// Misc. Functions -// -#define SDSS 77 // PA28 -#define SD_DETECT_PIN 87 // PA29 -#define LED_RED_PIN 40 // PC8 -#define LED_GREEN_PIN 41 // PC9 - -#define EXP_VOLTAGE_LEVEL_PIN 65 - -#define SPI_CHAN_DAC 1 - -#define DAC0_SYNC 53 // PB14 -#define DAC1_SYNC 6 // PC24 - -// 64K SPI EEPROM -#define SPI_EEPROM -#define SPI_CHAN_EEPROM1 2 -#define SPI_EEPROM1_CS 25 // PD0 - -// 2K SPI EEPROM -#define SPI_EEPROM2_CS 26 // PD1 - -// FLASH SPI -// 32Mb -#define SPI_FLASH_CS 23 // PA14 - -// -// LCD / Controller -// -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - #define LCD_PINS_RS 18 - #define LCD_PINS_ENABLE 15 - #define LCD_PINS_D4 19 - #define BEEPER_PIN 64 - - #define BTN_EN1 14 - #define BTN_EN2 16 - #define BTN_ENC 17 - - #undef UI_VOLTAGE_LEVEL - #define UI_VOLTAGE_LEVEL 1 - -#endif // REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM1.h deleted file mode 100644 index 83a68e776f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM1.h +++ /dev/null @@ -1,202 +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 - -/** - * ARCHIM1 pin assignment - * - * The Archim 1.0 board requires Arduino Archim addons installed. - * - * - Add the following URL to Arduino IDE's Additional Board Manager URLs: - * https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json - * - * - In the Arduino IDE Board Manager search for Archim and install the package. - * - * - Change your target board to "Archim". - * - * Further information on the UltiMachine website... - * https://github.com/ultimachine/Archim/wiki - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Archim' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Archim 1.0" - -// -// Timers -// -#define STEP_TIMER_NUM 3 -#define HAL_STEP_TIMER_ISR() void TC3_Handler() - -// -// Items marked * have been altered from Archim v1.0 -// - -// -// Servos -// -#define SERVO0_PIN 20 // D20 PB12 (Header J20 20) -#define SERVO1_PIN 21 // D21 PB13 (Header J20 19) - - -// -// Limit Switches -// -#define X_MIN_PIN 14 // PD4 MIN ES1 -#define X_MAX_PIN 32 // PD10 MAX ES1 -#define Y_MIN_PIN 29 // PD6 MIN ES2 -#define Y_MAX_PIN 15 // PD5 MAX ES2 -#define Z_MIN_PIN 31 // PA7 MIN ES3 -#define Z_MAX_PIN 30 // PD9 MAX ES3 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15) -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16) -#endif - - -// -// Steppers -// -#define X_STEP_PIN 40 // PC8 STEP1 * -#define X_DIR_PIN 59 // PA4 DIR1 * -#define X_ENABLE_PIN 41 // PC9 EN1 - -#define Y_STEP_PIN 49 // PC14 STEP2 * -#define Y_DIR_PIN 47 // PC16 DIR2 * -#define Y_ENABLE_PIN 48 // PC15 EN2 * - -#define Z_STEP_PIN 36 // PC4 STEP Z * -#define Z_DIR_PIN 107 // PB10 DIR Z * -#define Z_ENABLE_PIN 96 // PC10 EN Z -AddOns * - -#define E0_STEP_PIN 78 // PB23 STEP3 * -#define E0_DIR_PIN 22 // PB26 DIR3 * -#define E0_ENABLE_PIN 97 // PB24 EN3 -Addons * - -#define E1_STEP_PIN 26 // PD1 STEP4 * -#define E1_DIR_PIN 27 // PD2 DIR4 * -#define E1_ENABLE_PIN 28 // PD3 EN4 * - -// Microstepping mode pins * -#define X_MS1_PIN 39 // PC7 MOD0E1 - As listed in schematic -#define X_MS2_PIN 38 // PC6 MOD1E1 -#define X_MS3_PIN 37 // PC5 MOD2E1 - -#define Y_MS1_PIN 50 // PC13 MODE0E2 -#define Y_MS2_PIN 51 // PC12 MODE1E2 -#define Y_MS3_PIN 92 // PC11 MODE2E2 - AddOns - -#define Z_MS1_PIN 44 // PC19 MOD0E Z -#define Z_MS2_PIN 45 // PC18 MOD1E Z -#define Z_MS3_PIN 46 // PC17 MOD2E Z - -#define E0_MS1_PIN 105 // PB22 MOD0E3 - AddOns -#define E0_MS2_PIN 106 // PC27 MOD1E3 - AddOns -#define E0_MS3_PIN 104 // PC20 MOD2E3 - AddOns - -#define E1_MS1_PIN 25 // PD0 MOD0E4 -#define E1_MS2_PIN 18 // PA11 MOD1E4 -#define E1_MS3_PIN 19 // PA10 MOD2E4 - -// Motor current PWM pins * -#define MOTOR_CURRENT_PWM_X_PIN 58 // PA6 X-REF TIOB2 -#define MOTOR_CURRENT_PWM_Y_PIN 12 // PD8 Y-REF TIOB8 -#define MOTOR_CURRENT_PWM_Z_PIN 10 // PC29 Z-REF TIOB7 -#define MOTOR_CURRENT_PWM_E0_PIN 3 // PC28 E1-REF TIOA7 -#define MOTOR_CURRENT_PWM_E1_PIN 11 // PD7 E2-REF TIOA8 - -#define MOTOR_CURRENT_PWM_RANGE 2750 // (3.3 Volts * 100000 Ohms) / (100000 Ohms + 20000 Ohms) = 2.75 Volts (max vref) -#define DEFAULT_PWM_MOTOR_CURRENT { 1000, 1000, 1000 } //, 1000, 1000} // X Y Z E0 E1, 1000 = 1000mAh - -// -// Temperature Sensors -// -#define TEMP_0_PIN 10 // D10 PB19 THERM AN1 * -#define TEMP_1_PIN 9 // D9 PB18 THERM AN2 * -#define TEMP_2_PIN 8 // D8 PB17 THERM AN4 * -#define TEMP_BED_PIN 11 // D11 PB20 THERM AN3 * - -// -// Heaters / Fans -// -#define HEATER_0_PIN 6 // D6 PC24 FET_PWM3 -#define HEATER_1_PIN 7 // D7 PC23 FET_PWM4 -#define HEATER_2_PIN 8 // D8 PC22 FET_PWM5 -#define HEATER_BED_PIN 9 // D9 PC21 BED_PWM - -#ifndef FAN_PIN - #define FAN_PIN 4 // D4 PC26 FET_PWM1 -#endif -#define FAN1_PIN 5 // D5 PC25 FET_PWM2 - -// -// Misc. Functions -// - -// Internal MicroSD card reader on the PCB -#define INT_SCK_PIN 42 // D42 PA19/MCCK -#define INT_MISO_PIN 43 // D43 PA20/MCCDA -#define INT_MOSI_PIN 73 // D73 PA21/MCDA0 -#define INT_SDSS 55 // D55 PA24/MCDA3 - -// External SD card reader on SC2 -#define SCK_PIN 76 // D76 PA27 -#define MISO_PIN 74 // D74 PA25 -#define MOSI_PIN 75 // D75 PA26 -#define SDSS 87 // D87 PA29 - -// 2MB SPI Flash -#define SPI_FLASH_SS 52 // D52 PB21 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - #define BEEPER_PIN 23 // D24 PA15_CTS1 - #define LCD_PINS_RS 17 // D17 PA12_RXD1 - #define LCD_PINS_ENABLE 24 // D23 PA14_RTS1 - #define LCD_PINS_D4 69 // D69 PA0_CANTX0 - #define LCD_PINS_D5 54 // D54 PA16_SCK1 - #define LCD_PINS_D6 68 // D68 PA1_CANRX0 - #define LCD_PINS_D7 34 // D34 PC2_PWML0 - - #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 - - #if ENABLED(NEWPANEL) - // Buttons on AUX-2 - #define BTN_EN1 60 // D60 PA3_TIOB1 - #define BTN_EN2 13 // D13 PB27_TIOB0 - #define BTN_ENC 16 // D16 PA13_TXD1 - #endif // NEWPANEL -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM2.h deleted file mode 100644 index 504e937f9f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ARCHIM2.h +++ /dev/null @@ -1,255 +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 - -/** - * ARCHIM2 pin assignment - * - * The Archim 2.0 board requires Arduino Archim addons installed. - * - * - Add the following URL to Arduino IDE's Additional Board Manager URLs: - * https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json - * - * - In the Arduino IDE Board Manager search for Archim and install the package. - * - * - Change your target board to "Archim". - * - * Further information on the UltiMachine website... - * https://github.com/ultimachine/Archim/wiki - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Archim' in 'Tools > Board.'" -#elif DISABLED(TMC_USE_SW_SPI) - #error "Archim2 requires Software SPI. Enable TMC_USE_SW_SPI in Configuration_adv.h." -#endif - -#define BOARD_INFO_NAME "Archim 2.0" - -// -// Items marked * have been altered from Archim v1.0 -// - -// -// Servos -// -#define SERVO0_PIN 20 // D20 PB12 (Header J20 20) -#define SERVO1_PIN 21 // D21 PB13 (Header J20 19) - -// -// Limit Switches -// - -#if ENABLED(SENSORLESS_HOMING) - - // Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. - // Otherwise use a physical endstop based configuration. - - // TMC2130 Diag Pins - #define X_DIAG_PIN 59 // PA4 - #define Y_DIAG_PIN 48 // PC15 - #define Z_DIAG_PIN 36 // PC4 - #define E0_DIAG_PIN 78 // PB23 - #define E1_DIAG_PIN 25 // PD0 - - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_DIAG_PIN - #define X_MAX_PIN 32 - #else - #define X_MIN_PIN 14 - #define X_MAX_PIN X_DIAG_PIN - #endif - - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_DIAG_PIN - #define Y_MAX_PIN 15 - #else - #define Y_MIN_PIN 29 - #define Y_MAX_PIN Y_DIAG_PIN - #endif - -#else - - #define X_MIN_PIN 14 // PD4 MIN ES1 - #define X_MAX_PIN 32 // PD10 MAX ES1 - #define Y_MIN_PIN 29 // PD6 MIN ES2 - #define Y_MAX_PIN 15 // PD5 MAX ES2 - -#endif - -#define Z_MIN_PIN 31 // PA7 MIN ES3 -#define Z_MAX_PIN 30 // PD9 MAX ES3 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 32 -#endif - -// -// Steppers -// -#define X_STEP_PIN 38 // PC6 X-STEP * -#define X_DIR_PIN 37 // PC5 X-DIR * -#define X_ENABLE_PIN 41 // PC9 EN1 -#ifndef X_CS_PIN - #define X_CS_PIN 39 // PC7 X_nCS -#endif - -#define Y_STEP_PIN 51 // PC12 Y-STEP * -#define Y_DIR_PIN 92 // PC11 Y-DIR -AddOns * -#define Y_ENABLE_PIN 49 // PC14 Y-EN * -#ifndef Y_CS_PIN - #define Y_CS_PIN 50 // PC13 Y_nCS -#endif - -#define Z_STEP_PIN 46 // PC17 Z-STEP * -#define Z_DIR_PIN 47 // PC16 Z-DIR * -#define Z_ENABLE_PIN 44 // PC19 Z-END * -#ifndef Z_CS_PIN - #define Z_CS_PIN 45 // PC18 Z_nCS -#endif - -#define E0_STEP_PIN 107 // PB10 E1-STEP -AddOns * -#define E0_DIR_PIN 96 // PC10 E1-DIR -AddOns * -#define E0_ENABLE_PIN 105 // PB22 E1-EN -AddOns * -#ifndef E0_CS_PIN - #define E0_CS_PIN 104 // PC20 E1_nCS -AddOns * -#endif - -#define E1_STEP_PIN 22 // PB26 E2_STEP * -#define E1_DIR_PIN 97 // PB24 E2_DIR -AddOns * -#define E1_ENABLE_PIN 18 // PA11 E2-EN -#ifndef E1_CS_PIN - #define E1_CS_PIN 19 // PA10 E2_nCS -#endif - -// -// Software SPI pins for TMC2130 stepper drivers. -// Required for the Archim2 board. -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI 28 // PD3 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO 26 // PD1 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK 27 // PD2 - #endif -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 10 // D10 PB19 THERM AN1 * -#define TEMP_1_PIN 9 // D9 PB18 THERM AN2 * -#define TEMP_2_PIN 8 // D8 PB17 THERM AN4 * -#define TEMP_BED_PIN 11 // D11 PB20 THERM AN3 * - -// -// Heaters / Fans -// -#define HEATER_0_PIN 6 // D6 PC24 FET_PWM3 -#define HEATER_1_PIN 7 // D7 PC23 FET_PWM4 -#define HEATER_2_PIN 8 // D8 PC22 FET_PWM5 -#define HEATER_BED_PIN 9 // D9 PC21 BED_PWM - -#ifndef FAN_PIN - #define FAN_PIN 4 // D4 PC26 FET_PWM1 -#endif -#define FAN1_PIN 5 // D5 PC25 FET_PWM2 - -// -// Misc. Functions -// - -// Internal MicroSD card reader on the PCB -#define INT_SCK_PIN 42 // D42 PA19/MCCK -#define INT_MISO_PIN 43 // D43 PA20/MCCDA -#define INT_MOSI_PIN 73 // D73 PA21/MCDA0 -#define INT_SDSS 55 // D55 PA24/MCDA3 - -// External SD card reader on SC2 -#define SCK_PIN 76 // D76 PA27 -#define MISO_PIN 74 // D74 PA25 -#define MOSI_PIN 75 // D75 PA26 -#define SDSS 87 // D87 PA29 - -// Unused Digital GPIO J20 Pins -#define GPIO_PB1_J20_5 94 // D94 PB1 (Header J20 5) -#define GPIO_PB0_J20_6 95 // D95 PB0 (Header J20 6) -#define GPIO_PB3_J20_7 103 // D103 PB3 (Header J20 7) -#define GPIO_PB2_J20_8 93 // D93 PB2 (Header J20 8) -#define GPIO_PB6_J20_9 99 // D99 PB6 (Header J20 9) -#define GPIO_PB5_J20_10 101 // D101 PB5 (Header J20 10) -#define GPIO_PB8_J20_11 100 // D100 PB8 (Header J20 11) -#define GPIO_PB4_J20_12 102 // D102 PB4 (Header J20 12) -#define GPIO_PB9_J20_13 108 // D108 PB9 (Header J20 13) -#define GPIO_PB7_J20_14 98 // D98 PB7 (Header J20 14) -#define GPIO_PB15_J20_15 66 // D66 PB15 (Header J20 15) -#define GPIO_PB16_J20_16 67 // D67 PB16 (Header J20 16) -#define GPIO_PB14_J20_17 53 // D53 PB14 (Header J20 17) -#define GPIO_PA18_J20_21 71 // D71 PA17 (Header J20 21) -#define GPIO_PA17_J20_22 70 // D70 PA17 (Header J20 22) - -// Case Light - -#define CASE_LIGHT_PIN GPIO_PB1_J20_5 - -// 2MB SPI Flash -#define SPI_FLASH_SS 52 // D52 PB21 - -// -// Filament Runout Sensor -// - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN GPIO_PB15_J20_15 -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN GPIO_PB16_J20_16 -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) - #define BEEPER_PIN 23 // D24 PA15_CTS1 - #define LCD_PINS_RS 17 // D17 PA12_RXD1 - #define LCD_PINS_ENABLE 24 // D23 PA14_RTS1 - #define LCD_PINS_D4 69 // D69 PA0_CANTX0 - #define LCD_PINS_D5 54 // D54 PA16_SCK1 - #define LCD_PINS_D6 68 // D68 PA1_CANRX0 - #define LCD_PINS_D7 34 // D34 PC2_PWML0 - - #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 - - #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) - // Buttons on AUX-2 - #define BTN_EN1 60 // D60 PA3_TIOB1 - #define BTN_EN2 13 // D13 PB27_TIOB0 - #define BTN_ENC 16 // D16 PA13_TXD1 // the click - #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM.h deleted file mode 100644 index 731e31defa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM.h +++ /dev/null @@ -1,171 +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 - -/** - * DUE3DOM pin assignments - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "DUE3DOM" - -// -// Servos -// -#define SERVO0_PIN 5 -#define SERVO1_PIN 6 -#define SERVO2_PIN 13 -#define SERVO3_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 38 -#define X_MAX_PIN 36 -#define Y_MIN_PIN 34 -#define Y_MAX_PIN 32 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN 28 - -// -// Steppers -// -#define X_STEP_PIN 2 -#define X_DIR_PIN 3 -#define X_ENABLE_PIN 22 - -#define Y_STEP_PIN 17 -#define Y_DIR_PIN 16 -#define Y_ENABLE_PIN 26 - -#define Z_STEP_PIN 61 // Z1 STP -#define Z_DIR_PIN 60 // Z1 DIR -#define Z_ENABLE_PIN 15 // Z1 ENA - -#define E0_STEP_PIN 64 // Z2 STP -#define E0_DIR_PIN 63 // Z2 DIR -#define E0_ENABLE_PIN 62 // Z2 ENA - -#define E1_STEP_PIN 51 // E1 STP -#define E1_DIR_PIN 53 // E1 DIR -#define E1_ENABLE_PIN 65 // E1 ENA - -#define E2_STEP_PIN 24 // E2 STP -#define E2_DIR_PIN 23 // E2 DIR -#define E2_ENABLE_PIN 49 // E2 ENA - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (HOTEND0 thermistor) -#define TEMP_1_PIN 2 // Analog Input (HOTEND1 thermistor) -#define TEMP_2_PIN 5 // Analog Input (unused) -#define TEMP_BED_PIN 1 // Analog Input (BED thermistor) - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN -1 -#else - #define MAX6675_SS_PIN -1 -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 7 // HOTEND0 MOSFET -#define HEATER_1_PIN 8 // HOTEND1 MOSFET -#define HEATER_BED_PIN 39 // BED MOSFET - -#ifndef FAN_PIN - #define FAN_PIN 11 // FAN1 header on board - PRINT FAN -#endif -#define FAN1_PIN 9 // FAN2 header on board - CONTROLLER FAN -#define FAN2_PIN 12 // FAN3 header on board - EXTRUDER0 FAN - -// -// Misc. Functions -// -#define SDSS 4 -#define PS_ON_PIN 40 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #define LCD_PINS_RS 42 - #define LCD_PINS_ENABLE 43 - #define LCD_PINS_D4 44 - #define LCD_PINS_D5 45 - #define LCD_PINS_D6 46 - #define LCD_PINS_D7 47 - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define SDSS 4 - #define SD_DETECT_PIN 14 - - #elif ENABLED(RADDS_DISPLAY) - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define BTN_BACK 71 - - #undef SDSS - #define SDSS 4 - #define SD_DETECT_PIN 14 - - #elif HAS_SSD1306_OLED_I2C - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - #define BEEPER_PIN 41 - #define LCD_SDSS 4 - #define SD_DETECT_PIN 14 - - #elif ENABLED(SPARK_FULL_GRAPHICS) - - #define LCD_PINS_D4 29 - #define LCD_PINS_ENABLE 27 - #define LCD_PINS_RS 25 - - #define BTN_EN1 35 - #define BTN_EN2 33 - #define BTN_ENC 37 - - #define BEEPER_PIN -1 - #endif // SPARK_FULL_GRAPHICS -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h deleted file mode 100644 index ed9781388a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ /dev/null @@ -1,174 +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 - -/** - * DUE3DOM MINI pin assignments - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "DUE3DOM MINI" - -// -// Servos -// -#define SERVO0_PIN 5 -#define SERVO1_PIN 6 -#define SERVO2_PIN 8 // 4-pin header FAN0 -#define SERVO3_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 38 -#define X_MAX_PIN -1 -#define Y_MIN_PIN 34 -#define Y_MAX_PIN -1 -#define Z_MIN_PIN 30 -#define Z_MAX_PIN -1 - -// -// Steppers -// -#define X_STEP_PIN 17 -#define X_DIR_PIN 16 -#define X_ENABLE_PIN 22 - -#define Y_STEP_PIN 2 -#define Y_DIR_PIN 3 -#define Y_ENABLE_PIN 26 - -#define Z_STEP_PIN 64 -#define Z_DIR_PIN 63 -#define Z_ENABLE_PIN 15 - -#define E0_STEP_PIN 61 -#define E0_DIR_PIN 60 -#define E0_ENABLE_PIN 62 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (HOTEND0 thermistor) -#define TEMP_1_PIN 2 // Analog Input (unused) -#define TEMP_2_PIN 5 // Analog Input (OnBoard thermistor beta 3950) -#define TEMP_BED_PIN 1 // Analog Input (BED thermistor) - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 53 -#else - #define MAX6675_SS_PIN 53 -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // HOTEND0 MOSFET -#define HEATER_BED_PIN 7 // BED MOSFET - -#ifndef FAN_PIN - #define FAN_PIN 11 // FAN1 header on board - PRINT FAN -#endif -#define FAN1_PIN 12 // FAN2 header on board - CONTROLLER FAN -#define FAN2_PIN 9 // FAN3 header on board - EXTRUDER0 FAN -//#define FAN3_PIN 8 // FAN0 4-pin header on board - -// -// Misc. Functions -// -#define SDSS 4 -#define PS_ON_PIN 40 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #define LCD_PINS_RS 42 - #define LCD_PINS_ENABLE 43 - #define LCD_PINS_D4 44 - #define LCD_PINS_D5 45 - #define LCD_PINS_D6 46 - #define LCD_PINS_D7 47 - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define SDSS 4 - #define SD_DETECT_PIN 14 - - #elif ENABLED(RADDS_DISPLAY) - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define BTN_BACK 71 - - #undef SDSS - #define SDSS 4 - #define SD_DETECT_PIN 14 - - #elif HAS_SSD1306_OLED_I2C - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - #define BEEPER_PIN 41 - #define LCD_SDSS 4 - #define SD_DETECT_PIN 14 - - #elif ENABLED(SPARK_FULL_GRAPHICS) - - #define LCD_PINS_D4 29 - #define LCD_PINS_ENABLE 27 - #define LCD_PINS_RS 25 - - #define BTN_EN1 35 - #define BTN_EN2 33 - #define BTN_ENC 37 - - #define BEEPER_PIN -1 - - #elif ENABLED(MINIPANEL) - #define BTN_EN1 52 - #define BTN_EN2 50 - #define BTN_ENC 48 - #define LCD_SDSS 4 - #define SD_DETECT_PIN 14 - #define BEEPER_PIN 41 - #define DOGLCD_A0 46 - #define DOGLCD_CS 45 - - #endif // SPARK_FULL_GRAPHICS -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h deleted file mode 100644 index d5cc3bed6a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h +++ /dev/null @@ -1,174 +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 - -/** - * PRINTRBOARD_G2 - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "PRINTRBOARD_G2" -#endif - -// -// Servos -// -//#define SERVO0_PIN -1 -//#define SERVO1_PIN -1 - -// -// Limit Switches -// -#define X_MIN_PIN 22 // PB26 -#define Y_MAX_PIN 18 // PA11 -#define Z_MIN_PIN 19 // PA10 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 22 -#endif - -#ifndef FIL_RUNOUT_PIN - //#define FIL_RUNOUT_PIN 57 // PA22 -#endif -#ifndef FIL_RUNOUT2_PIN - //#define FIL_RUNOUT2_PIN 21 // PB13 -#endif - -// -// LED defines -// -//#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) -//#define NEOPIXEL_PIN 20 // LED driving pin on motherboard -//#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip -//#define SDA0 20 // PB12 NeoPixel pin I2C data -//#define SCL0 21 // PB13 I2C clock - -// D0_12 #REF! (INDICATOR_LED) -// B28 JTAG-CLK -// B31 JTAG_TMS /SWD_DIO -//A18 INTERRUPT_OUT -//A12 USART_RX not used -//A13 USART_TX not used -//A14 UART_RTS -//A15 UART_CTS -//PB2 Unassigned -//PB4 to PB9 Unassigned -//#define UART_RX_PIN 0 // PA8 "RX0" -//#define UART_TX_PIN 1 // PA9 "TX0" -//#define UART_RTS_PIN 23 // PA14 -//#define UART_CTS_PIN 24 // PA15 - -// -// Steppers -// -#define Z_STEP_PIN 73 // PA21 MOTOR 1 -#define Z_DIR_PIN 75 // PA26 -#define Z_ENABLE_PIN 74 // PA25 - -#define X_STEP_PIN 66 // PB15 MOTOR 2 -#define X_DIR_PIN 54 // PA16 -#define X_ENABLE_PIN 67 // PB16 - -#define Y_STEP_PIN 34 // PA29 MOTOR 3 -#define Y_DIR_PIN 35 // PB1 -#define Y_ENABLE_PIN 36 // PB0 - -#define E0_STEP_PIN 53 // PB14 MOTOR 4 -#define E0_DIR_PIN 78 // PB23 -#define E0_ENABLE_PIN 37 // PB22 - -// Microstepping mode pins -#define Z_MS1_PIN 52 // PB21 MODE0 MOTOR 1 -#define Z_MS2_PIN 52 // PB21 MODE1 -#define Z_MS3_PIN 65 // PB20 MODE2 - -#define X_MS1_PIN 43 // PA20 MODE0 MOTOR 2 -#define X_MS2_PIN 43 // PA20 MODE1 -#define X_MS3_PIN 42 // PA19 MODE2 - -#define Y_MS1_PIN 77 // PA28 MODE0 MOTOR 3 -#define Y_MS2_PIN 77 // PA28 MODE1 -#define Y_MS3_PIN 76 // PA27 MODE2 - -#define E0_MS1_PIN 38 // PB11 MODE0 MOTOR 4 -#define E0_MS2_PIN 38 // PB11 MODE1 -#define E0_MS3_PIN 39 // PB10 MODE2 - -// Motor current PWM pins -#define MOTOR_CURRENT_PWM_X_PIN 62 // PB17 MOTOR 1 -#define MOTOR_CURRENT_PWM_Z_PIN 63 // PB18 MOTOR 2 -#define MOTOR_CURRENT_PWM_Y_PIN 64 // PB19 MOTOR 3 -#define MOTOR_CURRENT_PWM_E_PIN 61 // PA2 MOTOR 4 - -#define DEFAULT_PWM_MOTOR_CURRENT { 300, 400, 1000} // XY Z E0, 1000 = 1000mAh - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // digital 56 PA23 -#define TEMP_BED_PIN 5 // digital 59 PA4 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 40 // PA5 -#define HEATER_BED_PIN 41 // PB24 - -#ifndef FAN_PIN - #define FAN_PIN 13 // PB27 Fan1A -#endif -#define FAN1_PIN 58 // PA6 Fan1B - -#define FET_SAFETY_PIN 31 // PA7 must be pulsed low every 50 mS or FETs are turned off -#define FET_SAFETY_DELAY 50 // 50 mS delay between pulses -#define FET_SAFETY_INVERTED true // true - negative going pulse of 2 uS - -///////////////////////////////////////////////////////// - -#define MISO_PIN 68 // set to unused pins for now -#define MOSI_PIN 69 // set to unused pins for now -#define SCK_PIN 70 // set to unused pins for now -#define SDSS 71 // set to unused pins for now - -/** - * G2 uses 8 pins that are not available in the DUE environment: - * 34 PA29 - Y_STEP_PIN - * 35 PB1 - Y_DIR_PIN - * 36 PB0 - Y_ENABLE_PIN - * 37 PB22 - E0_ENABLE_PIN - * 38 PB11 - E0_MS1_PIN - normally used by the USB native port - * 39 PB10 - E0_MS3_PIN - normally used by the USB native port - * 40 PA5 - HEATER_0_PIN - * 41 PB24 - HEATER_BED_PIN - * - * None of these are in the arduino_due_x variant so digitalWrite and digitalRead can't be used on them. - * - * They can be accessed via FASTIO functions WRITE, READ, OUT_WRITE, OUTPUT, ... - * - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RADDS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RADDS.h deleted file mode 100644 index 85db7492e3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RADDS.h +++ /dev/null @@ -1,275 +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 - -/** - * RADDS - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RADDS" - -// -// Servos -// -#define SERVO0_PIN 5 -#define SERVO1_PIN 6 -#define SERVO2_PIN 39 -#define SERVO3_PIN 40 - -// -// Limit Switches -// -#define X_MIN_PIN 28 -#define X_MAX_PIN 34 -#define Y_MIN_PIN 30 -#define Y_MAX_PIN 36 -#define Z_MIN_PIN 32 -#define Z_MAX_PIN 38 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 38 -#endif - -// -// Steppers -// -#define X_STEP_PIN 24 -#define X_DIR_PIN 23 -#define X_ENABLE_PIN 26 -#ifndef X_CS_PIN - #define X_CS_PIN 25 -#endif - -#define Y_STEP_PIN 17 -#define Y_DIR_PIN 16 -#define Y_ENABLE_PIN 22 -#ifndef Y_CS_PIN - #define Y_CS_PIN 27 -#endif - -#define Z_STEP_PIN 2 -#define Z_DIR_PIN 3 -#define Z_ENABLE_PIN 15 -#ifndef Z_CS_PIN - #define Z_CS_PIN 29 -#endif - -#define E0_STEP_PIN 61 -#define E0_DIR_PIN 60 -#define E0_ENABLE_PIN 62 -#ifndef E0_CS_PIN - #define E0_CS_PIN 31 -#endif - -#define E1_STEP_PIN 64 -#define E1_DIR_PIN 63 -#define E1_ENABLE_PIN 65 -#ifndef E1_CS_PIN - #define E1_CS_PIN 33 -#endif - -#define E2_STEP_PIN 51 -#define E2_DIR_PIN 53 -#define E2_ENABLE_PIN 49 -#ifndef E2_CS_PIN - #define E2_CS_PIN 35 -#endif - -/** - * RADDS Extension Board V2 / V3 - * http://doku.radds.org/dokumentation/extension-board - */ -//#define RADDS_EXTENSION 2 -#if RADDS_EXTENSION >= 2 - #define E3_DIR_PIN 33 - #define E3_STEP_PIN 35 - #define E3_ENABLE_PIN 37 - #ifndef E3_CS_PIN - #define E3_CS_PIN 6 - #endif - - #if RADDS_EXTENSION == 3 - - #define E4_DIR_PIN 27 - #define E4_STEP_PIN 29 - #define E4_ENABLE_PIN 31 - #ifndef E4_CS_PIN - #define E4_CS_PIN 39 - #endif - - #define E5_DIR_PIN 66 - #define E5_STEP_PIN 67 - #define E5_ENABLE_PIN 68 - #ifndef E5_CS_PIN - #define E5_CS_PIN 6 - #endif - - #define RADDS_EXT_MSI_PIN 69 - - #define BOARD_INIT() OUT_WRITE(RADDS_EXT_VDD_PIN, HIGH) - - #else - - #define E4_DIR_PIN 27 - #define E4_STEP_PIN 29 - #define E4_ENABLE_PIN 31 - #ifndef E4_CS_PIN - #define E4_CS_PIN 39 - #endif - - // E3 and E4 share the same MSx pins - #define E3_MS1_PIN 67 - #define E4_MS1_PIN 67 - #define E3_MS2_PIN 68 - #define E4_MS2_PIN 68 - #define E3_MS3_PIN 69 - #define E4_MS3_PIN 69 - - #define RADDS_EXT_VDD2_PIN 66 - - #define BOARD_INIT() do{ OUT_WRITE(RADDS_EXT_VDD_PIN, HIGH); OUT_WRITE(RADDS_EXT_VDD2_PIN, HIGH); }while(0) - - #endif - - #define RADDS_EXT_VDD_PIN 25 - -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_2_PIN 2 // Analog Input -#define TEMP_3_PIN 3 // Analog Input -#define TEMP_4_PIN 5 // dummy so will compile when PINS_DEBUGGING is enabled -#define TEMP_BED_PIN 4 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 53 -#else - #define MAX6675_SS_PIN 49 -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 -#define HEATER_1_PIN 12 -#define HEATER_2_PIN 11 -#define HEATER_BED_PIN 7 // BED - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif -#define FAN1_PIN 8 - -// -// Misc. Functions -// -#define SD_DETECT_PIN 14 -#define PS_ON_PIN 40 // SERVO3_PIN - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 39 // SERVO2_PIN -#endif - -#define I2C_EEPROM -#define E2END 0x1FFF // 8KB - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(RADDS_DISPLAY) - - #define LCD_PINS_RS 42 - #define LCD_PINS_ENABLE 43 - #define LCD_PINS_D4 44 - #define LCD_PINS_D5 45 - #define LCD_PINS_D6 46 - #define LCD_PINS_D7 47 - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define BTN_BACK 71 - - #define SDSS 10 - #define SD_DETECT_PIN 14 - - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - // The REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER requires - // an adapter such as https://www.thingiverse.com/thing:1740725 - - #define LCD_PINS_RS 42 - #define LCD_PINS_ENABLE 43 - #define LCD_PINS_D4 44 - - #define BEEPER_PIN 41 - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - - #define SDSS 10 - #define SD_DETECT_PIN 14 - - #elif HAS_SSD1306_OLED_I2C - - #define BTN_EN1 50 - #define BTN_EN2 52 - #define BTN_ENC 48 - #define BEEPER_PIN 41 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 14 - - #elif ENABLED(SPARK_FULL_GRAPHICS) - - #define LCD_PINS_D4 29 - #define LCD_PINS_ENABLE 27 - #define LCD_PINS_RS 25 - - #define BTN_EN1 35 - #define BTN_EN2 33 - #define BTN_ENC 37 - - #endif // SPARK_FULL_GRAPHICS - -#endif // HAS_SPI_LCD - -#ifndef SDSS - #define SDSS 4 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS4DUE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS4DUE.h deleted file mode 100644 index 36c0717bce..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS4DUE.h +++ /dev/null @@ -1,56 +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 - -/** - * Arduino Mega or Due with RAMPS4DUE pin assignments - * - * Applies to the following boards: - * - * RAMPS4DUE_EFB (Hotend, Fan, Bed) - * RAMPS4DUE_EEB (Hotend0, Hotend1, Bed) - * RAMPS4DUE_EFF (Hotend, Fan0, Fan1) - * RAMPS4DUE_EEF (Hotend0, Hotend1, Fan) - * RAMPS4DUE_SF (Spindle, Controller Fan) - * - * Differences between - * RAMPS_14 | RAMPS4DUE - * A13 | A9/D63 (shares the same pin with AUX2_4PIN) - * A14 | A10/D64 (shares the same pin with AUX2_5PIN) - * A15 | NC - */ - -#if !defined(__SAM3X8E__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RAMPS4DUE" -#define IS_RAMPS4DUE - -// -// Temperature Sensors -// -#define TEMP_0_PIN 9 // Analog Input -#define TEMP_1_PIN -1 // Analog Input -#define TEMP_BED_PIN 10 // Analog Input - -#include "../ramps/pins_RAMPS.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_DUO.h deleted file mode 100644 index d63d9a32a8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ /dev/null @@ -1,131 +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 - -/** - * Arduino Mega or Due with RAMPS Duo pin assignments - * - * Applies to the following boards: - * - * RAMPS_DUO_EFB (Hotend, Fan, Bed) - * RAMPS_DUO_EEB (Hotend0, Hotend1, Bed) - * RAMPS_DUO_EFF (Hotend, Fan0, Fan1) - * RAMPS_DUO_EEF (Hotend0, Hotend1, Fan) - * RAMPS_DUO_SF (Spindle, Controller Fan) - * - * Differences between - * RAMPS_14 | RAMPS_DUO - * A9/D63 | A12/D66 - * A10/D64 | A13/D67 - * A11/D65 | A14/D68 - * A12/D66 | A15/D69 - * A13 | A9 - * A14 | A10 - * A15 | A11 - */ - -#if !defined(__SAM3X8E__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RAMPS Duo" - -#define IS_RAMPS_DUO -#include "../ramps/pins_RAMPS.h" - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#define TEMP_0_PIN 9 // Analog Input - -#undef TEMP_1_PIN -#define TEMP_1_PIN 11 // Analog Input - -#undef TEMP_BED_PIN -#define TEMP_BED_PIN 10 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS_PIN -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 69 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 69 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if BOTH(NEWPANEL, PANEL_ONE) - #undef LCD_PINS_D4 - #define LCD_PINS_D4 68 - - #undef LCD_PINS_D5 - #define LCD_PINS_D5 69 - - #undef LCD_PINS_D7 - #define LCD_PINS_D7 67 - #endif - - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #undef BTN_EN1 - #define BTN_EN1 67 - - #undef BTN_ENC - #define BTN_ENC 66 - - #elif ENABLED(MINIPANEL) - - #undef DOGLCD_CS - #define DOGLCD_CS 69 - - #undef LCD_BACKLIGHT_PIN - #define LCD_BACKLIGHT_PIN 68 // backlight LED on A14/D68 - - #undef KILL_PIN - #define KILL_PIN 67 - - #undef BTN_EN2 - #define BTN_EN2 66 - - #else - - #if ENABLED(REPRAPWORLD_KEYPAD) - #undef BTN_EN1 - #define BTN_EN1 67 // encoder - - #undef BTN_ENC - #define BTN_ENC 66 // enter button - #elif ENABLED(PANEL_ONE) - #undef BTN_EN2 - #define BTN_EN2 66 // AUX2 PIN 4 - #endif - #endif - - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h deleted file mode 100644 index 5add612cc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ /dev/null @@ -1,235 +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 - -/** - * RAMPS-FD - * - * No EEPROM - * Use 4k7 thermistor tables - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RAMPS-FD v1" -#endif - -#define INVERTED_HEATER_PINS -#define INVERTED_BED_PINS -#define INVERTED_FAN_PINS - -// -// Servos -// -#define SERVO0_PIN 7 -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 -#define SERVO3_PIN 3 - -// -// Limit Switches -// -#define X_MIN_PIN 22 -#define X_MAX_PIN 30 -#define Y_MIN_PIN 24 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 26 -#define Z_MAX_PIN 34 - -// -// Steppers -// -#define X_STEP_PIN 63 -#define X_DIR_PIN 62 -#define X_ENABLE_PIN 48 -#ifndef X_CS_PIN - #define X_CS_PIN 68 -#endif - -#define Y_STEP_PIN 65 -#define Y_DIR_PIN 64 -#define Y_ENABLE_PIN 46 -#ifndef Y_CS_PIN - #define Y_CS_PIN 60 -#endif - -#define Z_STEP_PIN 67 -#define Z_DIR_PIN 66 -#define Z_ENABLE_PIN 44 -#ifndef Z_CS_PIN - #define Z_CS_PIN 58 -#endif - -#define E0_STEP_PIN 36 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 42 -#ifndef E0_CS_PIN - #define E0_CS_PIN 67 -#endif - -#define E1_STEP_PIN 43 -#define E1_DIR_PIN 41 -#define E1_ENABLE_PIN 39 -#ifndef E1_CS_PIN - #define E1_CS_PIN 61 -#endif - -#define E2_STEP_PIN 32 -#define E2_DIR_PIN 47 -#define E2_ENABLE_PIN 45 -#ifndef E2_CS_PIN - #define E2_CS_PIN 59 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_1_PIN 2 // Analog Input -#define TEMP_2_PIN 3 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 53 -#else - #define MAX6675_SS_PIN 49 -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 9 -#define HEATER_1_PIN 10 -#define HEATER_2_PIN 11 -#define HEATER_BED_PIN 8 - -#ifndef FAN_PIN - #define FAN_PIN 12 -#endif - -// -// Misc. Functions -// -#define SDSS 4 -#define LED_PIN 13 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - // ramps-fd lcd adaptor - - #define BEEPER_PIN 37 - #define BTN_EN1 33 - #define BTN_EN2 31 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - - #if ENABLED(NEWPANEL) - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #endif - - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS LCD_PINS_ENABLE - #define DOGLCD_A0 LCD_PINS_RS - #define DOGLCD_SCK 76 - #define DOGLCD_MOSI 75 - - //#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 23 // 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 25 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 27 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 29 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 - #endif - - #elif ENABLED(NEWPANEL) - - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #if ENABLED(MINIPANEL) - #define DOGLCD_CS 25 - #define DOGLCD_A0 27 - #endif - - #endif - - #if ANY(VIKI2, miniVIKI) - #define DOGLCD_A0 16 - #define KILL_PIN 51 - #define STAT_LED_BLUE_PIN 29 - #define STAT_LED_RED_PIN 23 - #define DOGLCD_CS 17 - #define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI - #define DOGLCD_MOSI 75 // MOSI_PIN - #define DOGLCD_MISO 74 // MISO_PIN - #endif - -#endif // HAS_SPI_LCD - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HOTENDS < 3 && HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA - #define SPINDLE_LASER_PWM_PIN 12 // Hardware PWM - #define SPINDLE_DIR_PIN 47 // Use E2 DIR -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h deleted file mode 100644 index 22fdafd68e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h +++ /dev/null @@ -1,52 +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 - -/** - * RAMPS-FD v2 - * - * EEPROM supported - * Use 1k thermistor tables - */ - -#define BOARD_INFO_NAME "RAMPS-FD v2" - -#ifndef E0_CS_PIN - #define E0_CS_PIN 69 // moved from A13 to A15 on v2.2, if not earlier -#endif - -#include "pins_RAMPS_FD_V1.h" - -#undef INVERTED_HEATER_PINS -#undef INVERTED_BED_PINS -#undef INVERTED_FAN_PINS - -#define I2C_EEPROM -#define E2END 0xFFFF // 64K in a 24C512 - -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_SMART.h deleted file mode 100644 index 619b2d594d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ /dev/null @@ -1,111 +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 - -/** - * Arduino Due with RAMPS-SMART pin assignments - * - * Applies to the following boards: - * - * RAMPS_SMART_EFB (Hotend, Fan, Bed) - * RAMPS_SMART_EEB (Hotend0, Hotend1, Bed) - * RAMPS_SMART_EFF (Hotend, Fan0, Fan1) - * RAMPS_SMART_EEF (Hotend0, Hotend1, Fan) - * RAMPS_SMART_SF (Spindle, Controller Fan) - * - * Differences between - * RAMPS_14 | RAMPS-SMART - * NONE | D16 (Additional AUX-3 pin(AUX3_2PIN), shares the same pin with AUX4_18PIN) - * NONE | D17 (Additional AUX-3 pin(AUX3_1PIN), shares the same pin with AUX4_17PIN) - * D0 | NONE - * D1 | NONE - * A3/D57 | NONE - * A4/D58 | NONE - * A5/D59 | A3/D57 - * A9/D63 | A4/D58 - * A10/D64 | A5/D59 - * A11/D65 | D66 - * A12/D66 | D67 - * A13 | A9 - * A14 | A10 - * A15 | A11 - * - * - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER works fine connected to AUX-4 with - * Smart Adapter, but requires removing the AUX3 pin header on the adapter to fit. - * To use the SD card reader, wire its pins to AUX-3 (and use Software SPI). - * - * To use Hardware SPI for SD, the SDSS pin must be set to 52 instead of 53. - * Hardware SPI also requires additional wiring because the board doesn't pass - * the 6-pin SPI header from the DUE board. - * (Search the web for "Arduino DUE Board Pinout" to see the correct header.) - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RAMPS-SMART" - -#define IS_RAMPS_SMART -#include "../ramps/pins_RAMPS.h" - -// I2C EEPROM with 4K of space -#define I2C_EEPROM -#define E2END 0xFFF - -#define RESET_PIN 42 // Resets the board if the jumper is attached - -// -// Temperature Sensors -// -#undef TEMP_0_PIN -#define TEMP_0_PIN 9 // Analog Input - -#undef TEMP_1_PIN -#define TEMP_1_PIN 10 // Analog Input - -#undef TEMP_BED_PIN -#define TEMP_BED_PIN 11 // Analog Input - -// SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS_PIN -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 67 // Don't use 53 if there is even the remote possibility of using Display/SD card -#else - #define MAX6675_SS_PIN 67 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present -#endif - -// -// LCD / Controller -// -// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel -#if ENABLED(AZSMZ_12864) - #define BEEPER_PIN 66 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 65 - #define DOGLCD_A0 59 - #define DOGLCD_CS 44 - #define BTN_EN1 58 - #define BTN_EN2 40 - #define BTN_ENC 67 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 66 - #define SD_DETECT_PIN 49 // Pin 49 for display sd interface, 72 for easy adapter board - #define KILL_PIN 42 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_11.h deleted file mode 100644 index 45540e8dad..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ /dev/null @@ -1,274 +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 . - * - * Ported sys0724 & Vynt - */ - -/** - * Arduino Mega? or Due with RuRAMPS4DUE pin assignments - * - * Applies to the following boards: - * RURAMPS4DUE (Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) - * - * Differences between - * RADDS | RuRAMPS4DUE - * | - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RuRAMPS4Due v1.1" - -// -// 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 43 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 // Support Extension Board -#define X_DIR_PIN 36 -#define X_ENABLE_PIN 38 -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif - -#define Y_STEP_PIN 32 // Support Extension Board -#define Y_DIR_PIN 35 -#define Y_ENABLE_PIN 34 -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif - -#define Z_STEP_PIN 30 // Support Extension Board -#define Z_DIR_PIN 2 -#define Z_ENABLE_PIN 33 -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif - -#define E0_STEP_PIN 29 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 31 -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif - -#define E1_STEP_PIN 22 -#define E1_DIR_PIN 24 -#define E1_ENABLE_PIN 26 -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif - -#define E2_STEP_PIN 25 -#define E2_DIR_PIN 23 -#define E2_ENABLE_PIN 27 -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif - -#define E3_STEP_PIN 15 // Only For Extension Board -#define E3_DIR_PIN 14 -#define E3_ENABLE_PIN 61 -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif - -// For Future: Microstepping pins - Mapping not from fastio.h (?) -//#define E3_MS1_PIN ? -//#define E3_MS2_PIN ? -//#define E3_MS3_PIN ? - -#if HAS_CUSTOM_PROBE_PIN - #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 - -#ifndef FAN_PIN - #define FAN_PIN 9 -#endif -#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) // 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 // 4,10,52 if using HW SPI. -#define LED_PIN -1 // 13 - HEATER_0_PIN -#define PS_ON_PIN -1 // 65 - -// MKS TFT / Nextion Use internal USART-1 -#define TFT_LCD_MODULE_COM 1 -#define TFT_LCD_MODULE_BAUDRATE 115600 - -// ESP WiFi Use internal USART-2 -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115600 -#define ESP_WIFI_MODULE_RESET_PIN -1 -#define PIGGY_GPIO_PIN -1 - -// -// EEPROM -// -#define E2END 0x7FFF // 32Kb (24lc256) -#define I2C_EEPROM // EEPROM on I2C-0 -//#define EEPROM_SD // EEPROM on SDCARD -//#define SPI_EEPROM // EEPROM on SPI-0 -//#define SPI_CHAN_EEPROM1 ? -//#define SPI_EEPROM1_CS ? -// 2K EEPROM -//#define SPI_EEPROM2_CS ? -// 32Mb FLASH -//#define SPI_FLASH_CS ? - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 - #endif - - #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 - - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 - - #elif HAS_SSD1306_OLED_I2C - - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 - - #elif ENABLED(FYSETC_MINI_12864) - - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 - - //#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) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 - #endif - - #elif ENABLED(SPARK_FULL_GRAPHICS) - - //http://doku.radds.org/dokumentation/other-electronics/sparklcd/ - #error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D." - //#define LCD_PINS_D4 29 //? - //#define LCD_PINS_ENABLE 27 //? - //#define LCD_PINS_RS 25 //? - //#define BTN_EN1 35 //? - //#define BTN_EN2 33 //? - //#define BTN_ENC 37 //? - - #endif // SPARK_FULL_GRAPHICS - - #if ENABLED(NEWPANEL) - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_13.h deleted file mode 100644 index c8ff71673b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ /dev/null @@ -1,258 +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 . - * - * Ported sys0724 & Vynt - */ - -/** - * Arduino Mega? or Due with RuRAMPS4DUE pin assignments - * - * Applies to the following boards: - * RURAMPS4DUE (Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) - * - * Differences between - * RADDS | RuRAMPS4DUE - * | - */ - -#ifndef __SAM3X8E__ - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RuRAMPS4Due 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 61 -#endif - -#if HAS_CUSTOM_PROBE_PIN - #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) // 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 // 4,10,52 if using HW SPI. -#define LED_PIN -1 // 13 - HEATER_0_PIN -#define PS_ON_PIN -1 // 65 - -// 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-0 -//#define EEPROM_SD // EEPROM on SDCARD -//#define SPI_EEPROM // EEPROM on SPI-0 -//#define SPI_CHAN_EEPROM1 ? -//#define SPI_EEPROM1_CS ? -// 2K EEPROM -//#define SPI_EEPROM2_CS ? -// 32Mb FLASH -//#define SPI_FLASH_CS ? - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 - #endif - - #if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 - - #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 - - #elif HAS_SSD1306_OLED_I2C - - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 - - #elif ENABLED(FYSETC_MINI_12864) - - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 - - //#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) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 - #endif - - #elif ENABLED(MKS_MINI_12864) - - #define ORIG_BEEPER_PIN 62 - - #define DOGLCD_A0 52 - #define DOGLCD_CS 50 - - #define SD_DETECT_PIN 51 - - #endif - - #if ENABLED(NEWPANEL) - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h deleted file mode 100644 index 94fb7cddc1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h +++ /dev/null @@ -1,174 +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 - -/** - * ReprapWorld ULTRATRONICS v1.0 - */ - -#ifndef ARDUINO_ARCH_SAM - #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Ultratronics v1.0" - -// -// Servos -// -#if NUM_SERVOS > 0 - #define SERVO0_PIN 11 - #if NUM_SERVOS > 1 - #define SERVO1_PIN 12 - #endif -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 31 -#define X_MAX_PIN 30 -#define Y_MIN_PIN 12 -#define Y_MAX_PIN 11 -#define Z_MIN_PIN 29 -#define Z_MAX_PIN 28 - -// -// Steppers -// -#define X_STEP_PIN 35 -#define X_DIR_PIN 34 -#define X_ENABLE_PIN 37 -#ifndef X_CS_PIN - #define X_CS_PIN 18 -#endif - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 -#define Y_ENABLE_PIN 33 -#ifndef Y_CS_PIN - #define Y_CS_PIN 19 -#endif - -#define Z_STEP_PIN 25 -#define Z_DIR_PIN 26 -#define Z_ENABLE_PIN 24 -#ifndef Z_CS_PIN - #define Z_CS_PIN 16 -#endif - -#define E0_STEP_PIN 47 -#define E0_DIR_PIN 46 -#define E0_ENABLE_PIN 48 -#ifndef E0_CS_PIN - #define E0_CS_PIN 17 -#endif - -#define E1_STEP_PIN 44 -#define E1_DIR_PIN 36 -#define E1_ENABLE_PIN 45 -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif - -#define E2_STEP_PIN 42 -#define E2_DIR_PIN 41 -#define E2_ENABLE_PIN 43 -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif - -#define E3_STEP_PIN 39 -#define E3_DIR_PIN 38 -#define E3_ENABLE_PIN 40 -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 2 // Analog Input -#define TEMP_2_PIN 3 // Analog Input -#define TEMP_3_PIN 4 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 -#define HEATER_1_PIN 8 -#define HEATER_2_PIN 7 -#define HEATER_3_PIN 9 -#define HEATER_BED_PIN 2 - -#ifndef FAN_PIN - #define FAN_PIN 6 -#endif -#define FAN2_PIN 5 - -// -// Misc. Functions -// -#define SDSS 59 -#define SD_DETECT_PIN 60 -#define LED_PIN 13 -#define PS_ON_PIN 32 - -// -// SPI Buses -// - -#define DAC0_SYNC 53 // PB14 -#define SPI_CHAN_DAC 1 - -#define SPI_CHAN_EEPROM1 -1 -#define SPI_EEPROM1_CS -1 -#define SPI_EEPROM2_CS -1 -#define SPI_FLASH_CS -1 - -// SPI for Max6675 or Max31855 Thermocouple -#define MAX6675_SS_PIN 65 -#define MAX31855_SS0 65 -#define MAX31855_SS1 52 -#define MAX31855_SS2 50 -#define MAX31855_SS3 51 - -#define ENC424_SS 61 - -// -// LCD / Controller -// - -#define BEEPER_PIN 27 - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS A8 // CS chip select / SS chip slave select - #define LCD_PINS_ENABLE MOSI // SID (MOSI) - #define LCD_PINS_D4 SCK // SCK (CLK) clock - - #define BTN_EN1 20 - #define BTN_EN2 21 - #define BTN_ENC 64 - -#endif // REPRAPWORLD_GRAPHICAL_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_ANET_10.h deleted file mode 100644 index 6e49bad616..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_ANET_10.h +++ /dev/null @@ -1,268 +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 - -/** - * Anet V1.0 board pin assignments - */ - -/** - * Rev B 16 JUN 2017 - * - * 1) no longer uses Sanguino files to define some of the pins - * 2) added pointers to useable Arduino IDE extensions - * - */ - -/** - * The standard Arduino IDE extension (board manager) for this board - * is located at https://github.com/SkyNet3D/anet-board. - * - * Installation instructions are on that page. - * - * After copying the files to the appropriate location, restart Arduino and - * you'll see "Anet V1.0" and "Anet V1.0 (Optiboot)" in the boards list. - * - * "Anet V1.0" uses the bootloader that was installed on the board when - * it shipped from the factory. - * - * "Anet V1.0 (Optiboot)" frees up another 3K of FLASH. You'll need to burn - * a new bootloader to the board to be able to automatically download a - * compiled image. - * - */ - -/** - * Another usable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -/** - * To burn a new bootloader: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select the board and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Additional info: - * - * Anet Schematics - https://github.com/ralf-e/ANET-3D-Board-V1.0 - * Wiring RRDFG Smart Controller - http://www.thingiverse.com/thing:2103748 - * SkyNet3D Anet software development - https://github.com/SkyNet3D/Marlin/ - * Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/ - * - * Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community. - */ - -#ifndef __AVR_ATmega1284P__ - #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega1284P' in 'Tools > Processor.' (For PlatformIO, use 'melzi' or 'melzi_optiboot.')" -#endif - -#define BOARD_INFO_NAME "Anet 1.0" - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 -#define X_ENABLE_PIN 14 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 -#define Y_ENABLE_PIN 14 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 -#define Z_ENABLE_PIN 26 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 -#define E0_ENABLE_PIN 14 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) -#define HEATER_BED_PIN 12 // (bed) - -#ifndef FAN_PIN - #define FAN_PIN 4 -#endif - -// -// Misc. Functions -// -#define SDSS 31 -#define LED_PIN -1 - -/** - * LCD / Controller - * - * Only the following displays are supported: - * ZONESTAR_LCD - * ANET_FULL_GRAPHICS_LCD - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - */ - -#if HAS_SPI_LCD - #define LCD_SDSS 28 - #if ENABLED(ADC_KEYPAD) - #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define ADC_KEYPAD_PIN 1 - #elif EITHER(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD) - // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics - // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb - // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #define SERVO0_PIN 29 // free for BLTouch/3D-Touch - #define BEEPER_PIN 17 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 28 - #define LCD_PINS_D4 30 - #define BTN_EN1 11 - #define BTN_EN2 10 - #define BTN_ENC 16 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #define BOARD_ST7920_DELAY_2 DELAY_NS(63) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - #endif -#else - #define SERVO0_PIN 27 -#endif - -/** - * ==================================================================== - * =============== Alternative RepRapDiscount Wiring ================== - * ==================================================================== - * - * An alternative wiring scheme for the RepRapDiscount Full Graphics Display is - * published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748. - * - * Using that adapter requires changing the pin definition as follows: - * #define SERVO0_PIN 27 // free for BLTouch/3D-Touch - * #define BEEPER_PIN 28 - * #define LCD_PINS_RS 30 - * #define LCD_PINS_ENABLE 29 - * #define LCD_PINS_D4 17 - * - * The BLTouch pin becomes LCD:3 - */ - -/** - * ==================================================================== - * ===================== LCD PINOUTS ================================== - * ==================================================================== - * - * Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring - * physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | http://www.thingiverse - * pin pin functions | | | | .com/thing:2103748 - *------------------------------------------------------------------------------------------------------------------------ - * ANET-J3.1 8 *** | N/A | J3_TX *** | | - * ANET-J3.2 9 *** | N/A | J3_RX *** | | - * ANET-J3.3 6 MISO | N/A | MISO *** | EXP2.1 MISO | EXP2.1 MISO - * ANET-J3.4 +5V | N/A | +5V | | - * ANET-J3.5 7 SCK | N/A | SCK *** | EXP2.2 SCK | EXP2.2 SCK - * ANET-J3.6 5 MOSI | N/A | MOSI *** | EXP2.6 MOSI | EXP2.6 MOSI - * ANET-J3.7 !RESET | N/A | button | EXP2.8 panel button | EXP2.8 panel button - * ANET-J3.8 GND | N/A | GND | EXP2.9 GND | EXP2.9 GND - * ANET-J3.9 4 Don't use | N/A | N/C | | - * ANET-J3.10 +3.3V | N/A | +3.3V *** | | - * | | | | - * | | | | - * ANET-LCD.1 GND | GND | GND | EXP1.9 GND | EXP1.9 GND - * ANET-LCD.2 +5V | +5V | +5V | EXP1.10 +5V | EXP1.10 +5V - * ANET-LCD.3 27 A4 | N/C * | LCD_PINS_RS | EXP1.4 LCD_PINS_RS | EXP2.4 SDSS or N/C * - * ANET-LCD.4 10 | LCD_PINS_D4 | BTN_EN2 | EXP2.3 BTN_EN2 | EXP2.3 BTN_EN2 - * ANET-LCD.5 28 A3 | LCD_PINS_RS | LCD_PINS_ENABLE | EXP1.3 LCD_PINS_ENABLE | EXP1.1 BEEPER_PIN - * ANET-LCD.6 11 | LCD_PINS_D5 | BTN_EN1 | EXP2.5 BTN_EN1 | EXP2.5 BTN_EN1 - * ANET-LCD.7 29 A2 | LCD_PINS_ENABLE | N/C * | EXP2.4 SDSS or N/C * | EXP1.3 LCD_PINS_ENABLE - * ANET-LCD.8 16 SCL | LCD_PINS_D6 | BTN_ENC | EXP1.2 BTN_ENC | EXP1.2 BTN_ENC - * ANET-LCD.9 30 A1 | ADC_KEYPAD_PIN ** | LCD_PINS_D4 | EXP1.5 LCD_PINS_D4 | EXP1.4 LCD_PINS_RS - * ANET-LCD.10 17 SDA | LCD_PINS_D7 | BEEPER_PIN | EXP1.1 BEEPER_PIN | EXP1.5 LCD_PINS_D4 - * - * N/C * - if not connected to the LCD can be used for BLTouch servo input - * ** - analog pin -WITHOUT a pullup - * *** - only connected to something if the Bluetooth module is populated - */ - -/** - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * physical pin function - * EXP1.1 BEEPER - * EXP1.2 BTN_ENC - * EXP1.3 LCD_PINS_ENABLE - * EXP1.4 LCD_PINS_RS - * EXP1.5 LCD_PINS_D4 - * EXP1.6 LCD_PINS_D5 (not used) - * EXP1.7 LCD_PINS_D6 (not used) - * EXP1.8 LCD_PINS_D7 (not used) - * EXP1.9 GND - * EXP1.10 VCC - * - * - * EXP2.1 MISO - * EXP2.2 SCK - * EXP2.3 BTN_EN2 - * EXP2.4 SDSS - * EXP2.5 BTN_EN1 - * EXP2.6 MOSI - * EXP2.7 SD_DETECT_PIN - * EXP2.8 button - * EXP2.9 GND - * EXP2.10 NC - */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h deleted file mode 100644 index 4140dc4b95..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h +++ /dev/null @@ -1,30 +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 - -/** - * Azteeg X1 pin assignments - */ - -#define BOARD_INFO_NAME "Azteeg X1" - -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h deleted file mode 100644 index 3059f6c898..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h +++ /dev/null @@ -1,101 +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 - -/** - * Gen3 Monolithic Electronics pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644P__ - #error "Oops! Select 'Sanguino' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Gen3 Monolithic" -#define DEBUG_PIN 0 - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 // actually uses Y_enable_pin - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 // shared with X_enable_pin - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 12 -#define E0_DIR_PIN 17 -#define E0_ENABLE_PIN 3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 16 - -// -// Misc. Functions -// -#define PS_ON_PIN 14 // Alex, does this work on the card? - -// Alex extras from Gen3+ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h deleted file mode 100644 index e370a888f3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h +++ /dev/null @@ -1,102 +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 - -/** - * Gen3+ pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Gen3+" - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 17 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 13 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 5 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 12 -#define HEATER_BED_PIN 16 - -// -// Misc. Functions -// -#define SDSS 4 -#define PS_ON_PIN 14 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6.h deleted file mode 100644 index 294b4df2f5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6.h +++ /dev/null @@ -1,120 +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 - -/** - * Gen6 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Gen6" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 20 -#define Y_STOP_PIN 25 -#define Z_STOP_PIN 30 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 19 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 27 -#define Z_DIR_PIN 28 -#define Z_ENABLE_PIN 29 - -#define E0_STEP_PIN 4 // Edited @ EJE Electronics 20100715 -#define E0_DIR_PIN 2 // Edited @ EJE Electronics 20100715 -#define E0_ENABLE_PIN 3 // Added @ EJE Electronics 20100715 - -// -// Temperature Sensor -// -#define TEMP_0_PIN 5 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 14 // changed @ rkoeppl 20110410 - -#if !MB(GEN6) - #define HEATER_BED_PIN 1 // changed @ rkoeppl 20110410 - #define TEMP_BED_PIN 0 // Analog Input -#endif - -// -// Misc. Functions -// -#define SDSS 17 -#define DEBUG_PIN 0 -#define CASE_LIGHT_PIN 16 // Hardware PWM - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 5 // Pullup or pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h deleted file mode 100644 index fc4d8b6e10..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h +++ /dev/null @@ -1,56 +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 - -/** - * Gen6 Deluxe pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the SANGUINO board and then select the CPU. - * - */ - - -#define BOARD_INFO_NAME "Gen6 Deluxe" - -#include "pins_GEN6.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_12.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_12.h deleted file mode 100644 index 53e4e04df8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_12.h +++ /dev/null @@ -1,150 +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 - -/** - * Gen7 v1.1, v1.2, v1.3 pin assignments - */ - - /** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Gen7 v1.1 / 1.2" -#endif - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_MIN_PIN 7 -#define Y_MIN_PIN 5 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 -#define Y_MAX_PIN 2 -#define X_MAX_PIN 6 - - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 0 -#endif - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#if !defined(FAN_PIN) && GEN7_VERSION < 13 // Gen7 v1.3 removed the fan pin - #define FAN_PIN 31 -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -#if GEN7_VERSION < 13 - #define CASE_LIGHT_PIN 16 // Hardware PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define CASE_LIGHT_PIN 15 // Hardware PWM -#endif - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! -#define SPINDLE_DIR_PIN 11 -#if GEN7_VERSION < 13 - #define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM -#else // Gen7 v1.3 removed the I2C connector & signals so need to get PWM off the PC power supply header - #define SPINDLE_LASER_PWM_PIN 15 // Hardware PWM -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_13.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_13.h deleted file mode 100644 index 7f66ac1a9a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_13.h +++ /dev/null @@ -1,56 +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 - -/** - * Gen7 v1.3 pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#define BOARD_INFO_NAME "Gen7 v1.3" - -#define GEN7_VERSION 13 // v1.3 -#include "pins_GEN7_12.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_14.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_14.h deleted file mode 100644 index df18f6e781..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_14.h +++ /dev/null @@ -1,119 +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 - -/** - * Gen7 v1.4 pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Gen7 v1.4" - -#define GEN7_VERSION 14 // v1.4 - -// -// Limit switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 29 -#define X_DIR_PIN 28 -#define X_ENABLE_PIN 25 - -#define Y_STEP_PIN 27 -#define Y_DIR_PIN 26 -#define Y_ENABLE_PIN 25 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 25 - -#define E0_STEP_PIN 19 -#define E0_DIR_PIN 18 -#define E0_ENABLE_PIN 25 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -// -// Misc. Functions -// -#define PS_ON_PIN 15 -#define CASE_LIGHT_PIN 15 // Hardware PWM - -// A pin for debugging -#define DEBUG_PIN 0 - -// RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 20 // Pullup or pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM -#define SPINDLE_DIR_PIN 21 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h deleted file mode 100644 index 8605f0d469..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h +++ /dev/null @@ -1,139 +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 - -/** - * Gen7 Alfons3 board pin assignments - * - * These Pins are assigned for the modified GEN7 Board from Alfons3. - * Please review the pins and adjust them for your needs. - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Gen7 Custom" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 // different from standard GEN7 -#define X_DIR_PIN 20 // different from standard GEN7 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // Analog Input -#define TEMP_BED_PIN 1 // Analog Input (pin 34 bed) - -// -// Heaters -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 // (bed) - -// -// Misc. Functions -// -#define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support -#define PS_ON_PIN 19 -#define CASE_LIGHT_PIN 15 // Hardware PWM - -// A pin for debugging -#define DEBUG_PIN -1 - -// -// LCD / Controller -// -#define BEEPER_PIN -1 - -// 4bit LCD Support -#define LCD_PINS_RS 18 -#define LCD_PINS_ENABLE 17 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 15 -#define LCD_PINS_D6 13 -#define LCD_PINS_D7 14 - -// Buttons are directly attached -#define BTN_EN1 11 -#define BTN_EN2 10 -#define BTN_ENC 12 - -// RS485 pins -//#define TX_ENABLE_PIN 12 -//#define RX_ENABLE_PIN 13 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 5 // Pullup or pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM -#define SPINDLE_DIR_PIN 6 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI.h deleted file mode 100644 index ad0a58509b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI.h +++ /dev/null @@ -1,32 +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 - -/** - * Melzi pin assignments - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Melzi" -#endif - -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h deleted file mode 100644 index 66fbd47890..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ /dev/null @@ -1,118 +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 - -/** - * Melzi (Creality) pin assignments - * - * The Creality board needs a bootloader installed before Marlin can be uploaded. - * If you don't have a chip programmer you can use a spare Arduino plus a few - * electronic components to write the bootloader. - * - * See http://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/ - */ - -#define BOARD_INFO_NAME "Melzi (Creality)" - -#include "pins_MELZI.h" - -// For the stock CR-10 use the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -// option for the display in Configuration.h - -#undef LCD_SDSS -#undef LED_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef FIL_RUNOUT_PIN // Uses Beeper/LED Pin Pulled to GND - -#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) -#define LCD_PINS_RS 28 // ST9720 CS -#define LCD_PINS_ENABLE 17 // ST9720 DAT -#define LCD_PINS_D4 30 // ST9720 CLK - -#if ENABLED(BLTOUCH) - #define SERVO0_PIN 27 - #undef BEEPER_PIN -#endif - -// Alter timing for graphical display -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif - -#if ENABLED(MINIPANEL) - #undef DOGLCD_CS - #define DOGLCD_CS LCD_PINS_RS -#endif - -/** - PIN: 0 Port: B0 E0_DIR_PIN protected - PIN: 1 Port: B1 E0_STEP_PIN protected - PIN: 2 Port: B2 Z_DIR_PIN protected - PIN: 3 Port: B3 Z_STEP_PIN protected - PIN: 4 Port: B4 AVR_SS_PIN protected - . FAN_PIN protected - . SS_PIN protected - PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 - . MOSI_PIN Output = 1 - PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . MISO_PIN Input = 0 - PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SCK_PIN Output = 0 - PIN: 8 Port: D0 RXD Input = 1 - PIN: 9 Port: D1 TXD Input = 0 - PIN: 10 Port: D2 BTN_EN2 Input = 1 - PIN: 11 Port: D3 BTN_EN1 Input = 1 - PIN: 12 Port: D4 HEATER_BED_PIN protected - PIN: 13 Port: D5 HEATER_0_PIN protected - PIN: 14 Port: D6 E0_ENABLE_PIN protected - . X_ENABLE_PIN protected - . Y_ENABLE_PIN protected - PIN: 15 Port: D7 X_STEP_PIN protected - PIN: 16 Port: C0 BTN_ENC Input = 1 - . SCL Input = 1 - PIN: 17 Port: C1 LCD_PINS_ENABLE Output = 0 - . SDA Output = 0 - PIN: 18 Port: C2 X_MIN_PIN protected - . X_STOP_PIN protected - PIN: 19 Port: C3 Y_MIN_PIN protected - . Y_STOP_PIN protected - PIN: 20 Port: C4 Z_MIN_PIN protected - . Z_STOP_PIN protected - PIN: 21 Port: C5 X_DIR_PIN protected - PIN: 22 Port: C6 Y_STEP_PIN protected - PIN: 23 Port: C7 Y_DIR_PIN protected - PIN: 24 Port: A7 TEMP_0_PIN protected - PIN: 25 Port: A6 TEMP_BED_PIN protected - PIN: 26 Port: A5 Z_ENABLE_PIN protected - PIN: 27 Port: A4 BEEPER_PIN Output = 0 - PIN: 28 Port: A3 LCD_PINS_RS Output = 0 - PIN: 29 Port: A2 Input = 0 - PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 - PIN: 31 Port: A0 SDSS Output = 1 -*/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h deleted file mode 100644 index ef1f1332c1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h +++ /dev/null @@ -1,29 +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 - -/** - * Melzi with ATmega1284 (MaKr3d version) pin assignments - */ - -#define BOARD_INFO_NAME "Melzi (ATmega1284)" -#include "pins_MELZI.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h deleted file mode 100644 index fd3f482c06..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ /dev/null @@ -1,51 +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 - -/** - * Melzi (Malyan M150) pin assignments - */ - -#define BOARD_INFO_NAME "Melzi (Malyan)" -#include "pins_MELZI.h" - -#undef LCD_SDSS -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC - -#define LCD_PINS_RS 17 // ST9720 CS -#define LCD_PINS_ENABLE 16 // ST9720 DAT -#define LCD_PINS_D4 11 // ST9720 CLK -#define BTN_EN1 30 -#define BTN_EN2 29 -#define BTN_ENC 28 - -// Alter timing for graphical display -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h deleted file mode 100644 index d4b05e316e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ /dev/null @@ -1,58 +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 - -/** - * Melzi pin assignments - */ - -#define BOARD_INFO_NAME "Melzi (Tronxy)" -#include "pins_MELZI.h" - -#undef Z_ENABLE_PIN -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D5 -#undef LCD_PINS_D6 -#undef LCD_PINS_D7 -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC -#undef LCD_SDSS - -#define Z_ENABLE_PIN 14 -#define LCD_PINS_RS 30 -#define LCD_PINS_ENABLE 28 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 17 -#define LCD_PINS_D6 27 -#define LCD_PINS_D7 29 -#define BTN_EN1 10 -#define BTN_EN2 11 -#define BTN_ENC 26 - -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA.h deleted file mode 100644 index 8c50483574..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA.h +++ /dev/null @@ -1,151 +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 - -/** - * Open Motion controller with enable based extruders (Final!) - * - * ATmega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - * REF http://sanguino.cc/hardware - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) - #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega644' or 'ATmega644P' in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Final OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 26 -#define X_DIR_PIN 25 -#define X_ENABLE_PIN 10 - -#define Y_STEP_PIN 28 -#define Y_DIR_PIN 27 -#define Y_ENABLE_PIN 10 - -#define Z_STEP_PIN 23 -#define Z_DIR_PIN 22 -#define Z_ENABLE_PIN 10 - -#define E0_STEP_PIN 24 -#define E0_DIR_PIN 21 -#define E0_ENABLE_PIN 10 - -#define E1_STEP_PIN -1 // 21 -#define E1_DIR_PIN -1 // 20 -#define E1_ENABLE_PIN -1 // 19 - -#define E2_STEP_PIN -1 // 21 -#define E2_DIR_PIN -1 // 20 -#define E2_ENABLE_PIN -1 // 18 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input -#define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input (1,2 or I2C) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 3 // DONE PWM on RIGHT connector -#define HEATER_BED_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 14 // PWM on MIDDLE connector -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -#define I2C_SCL_PIN 16 -#define I2C_SDA_PIN 17 - -// future proofing -#define __FS 20 -#define __FD 19 -#define __GS 18 -#define __GD 13 - -#define UNUSED_PWM 14 // PWM on LEFT connector diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA_A.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA_A.h deleted file mode 100644 index 94a186241b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_OMCA_A.h +++ /dev/null @@ -1,138 +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 - -/** - * Open Motion controller with enable based extruders (Alpha!) - * - * ATmega644 - * - * +---\/---+ - * (D 0) PB0 1| |40 PA0 (AI 0 / D31) - * (D 1) PB1 2| |39 PA1 (AI 1 / D30) - * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) - * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) - * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) - * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) - * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) - * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) - * RST 9| |32 AREF - * VCC 10| |31 GND - * GND 11| |30 AVCC - * XTAL2 12| |29 PC7 (D 23) - * XTAL1 13| |28 PC6 (D 22) - * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI - * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO - * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS - * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK - * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA - * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL - * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM - * +--------+ - * - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#ifndef __AVR_ATmega644__ - #error "Oops! Select 'Sanguino' in 'Tools > Board' and ATmega644 in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Alpha OMCA" - -// -// Limit Switches -// -#define X_STOP_PIN 0 -#define Y_STOP_PIN 1 -#define Z_STOP_PIN 2 - -// -// Steppers -// -#define X_STEP_PIN 21 -#define X_DIR_PIN 20 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -#define E1_STEP_PIN -1 // 19 -#define E1_DIR_PIN -1 // 18 -#define E1_ENABLE_PIN 24 - -#define E2_STEP_PIN -1 // 17 -#define E2_DIR_PIN -1 // 16 -#define E2_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // Analog Input (D27) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 - -#ifndef FAN_PIN - #define FAN_PIN 3 -#endif - -// -// Misc. Functions -// -#define SDSS 11 - -/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h deleted file mode 100644 index 9fc7d6f1a2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ /dev/null @@ -1,320 +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 - -/** - * Sanguinololu board pin assignments - */ - -/** - * Rev B 26 DEC 2016 - * - * 1) added pointer to a current Arduino IDE extension - * 2) added support for M3, M4 & M5 spindle control commands - * 3) added case light pin definition - * - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Sanguinololu <1.2" -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 18 -#define Y_STOP_PIN 19 -#define Z_STOP_PIN 20 - -// -// Steppers -// -#define X_STEP_PIN 15 -#define X_DIR_PIN 21 - -#define Y_STEP_PIN 22 -#define Y_DIR_PIN 23 - -#define Z_STEP_PIN 3 -#define Z_DIR_PIN 2 - -#define E0_STEP_PIN 1 -#define E0_DIR_PIN 0 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder) -#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 // (extruder) - -#if ENABLED(SANGUINOLOLU_V_1_2) - - #define HEATER_BED_PIN 12 // (bed) - #define X_ENABLE_PIN 14 - #define Y_ENABLE_PIN 14 - #define Z_ENABLE_PIN 26 - #define E0_ENABLE_PIN 14 - - #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2) - #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan - #endif - -#else - - #define HEATER_BED_PIN 14 // (bed) - #define X_ENABLE_PIN -1 - #define Y_ENABLE_PIN -1 - #define Z_ENABLE_PIN -1 - #define E0_ENABLE_PIN -1 - -#endif - -#if !defined(FAN_PIN) && (MB(AZTEEG_X1, STB_11) || IS_MELZI) - #define FAN_PIN 4 // Works for Panelolu2 too -#endif - -// -// Misc. Functions -// - -/** - * In some versions of the Sanguino libraries the pin - * definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi). - * If you encounter issues with these pins, upgrade your - * Sanguino libraries! See #368. - */ -//#define SDSS 24 -#define SDSS 31 - -#if IS_MELZI - #define LED_PIN 27 -#elif MB(STB_11) - #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED -#endif - -#if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header - #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available -#endif - -/** - * Sanguinololu 1.4 AUX pins: - * - * PWM TX1 RX1 SDA SCL - * 12V 5V D12 D11 D10 D17 D16 - * GND GND D31 D30 D29 D28 D27 - * A4 A3 A2 A1 A0 - */ - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if HAS_GRAPHICAL_LCD - - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 - - #if IS_MELZI - #define LCD_PINS_RS 30 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 29 // SID (MOSI) - #define LCD_PINS_D4 17 // SCK (CLK) clock - // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with - // Marlin so this can be used for BEEPER_PIN. You can use this pin - // with M42 instead of BEEPER_PIN. - #define BEEPER_PIN 27 - #else // Sanguinololu >=1.3 - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - #endif - - #else // DOGM SPI LCD Support - - #define DOGLCD_A0 30 - - #if ENABLED(MAKRPANEL) - - #define BEEPER_PIN 29 - #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN 28 // PA3 - - #elif IS_MELZI - - #define BEEPER_PIN 27 - #define DOGLCD_CS 28 - - #else // !MAKRPANEL - - #define DOGLCD_CS 29 - - #endif - - #endif - - // Uncomment screen orientation - #define LCD_SCREEN_ROT_0 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #else // !HAS_GRAPHICAL_LCD - - #define LCD_PINS_RS 4 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 - - #endif // !HAS_GRAPHICAL_LCD - - #if ENABLED(LCD_I2C_PANELOLU2) - - #if IS_MELZI - #define BTN_ENC 29 - #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi - #else - #define BTN_ENC 30 - #endif - - #elif ENABLED(LCD_FOR_MELZI) - - #define LCD_PINS_RS 17 - #define LCD_PINS_ENABLE 16 - #define LCD_PINS_D4 11 - #define BTN_ENC 28 - #define BTN_EN1 29 - #define BTN_EN2 30 - - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #define BOARD_ST7920_DELAY_2 DELAY_NS(188) - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) - - #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards - - #define LCD_PINS_RS 28 - #define LCD_PINS_ENABLE 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 - #define ADC_KEYPAD_PIN 1 - - #define BTN_EN1 -1 - #define BTN_EN2 -1 - - #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD - - #define BTN_ENC 16 - #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi - - #endif - - #if ENABLED(NEWPANEL) && !defined(BTN_EN1) - #define BTN_EN1 11 - #define BTN_EN2 10 - #endif - - #define SD_DETECT_PIN -1 - -#endif // HAS_SPI_LCD - -// -// M3/M4/M5 - Spindle/Laser Control -// -#if HAS_CUTTER - #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header - - #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM - #define SPINDLE_DIR_PIN 11 - - #elif !MB(MELZI) // use X stepper motor socket - - /** - * To control the spindle speed and have an LCD you must sacrifice - * the Extruder and pull some signals off the X stepper driver socket. - * - * The following assumes: - * - The X stepper driver socket is empty - * - The extruder driver socket has a driver board plugged into it - * - The X stepper wires are attached the the extruder connector - */ - - /** - * Where to get the spindle signals - * - * spindle signal socket name socket name - * ------- - * /ENABLE O| |O VMOT - * MS1 O| |O GND - * MS2 O| |O 2B - * MS3 O| |O 2A - * /RESET O| |O 1A - * /SLEEP O| |O 1B - * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_LASER_ENA_PIN DIR O| |O GND - * ------- - * - * Note: Socket names vary from vendor to vendor. - */ - #undef X_DIR_PIN - #undef X_ENABLE_PIN - #undef X_STEP_PIN - #define X_DIR_PIN 0 - #define X_ENABLE_PIN 14 - #define X_STEP_PIN 1 - #define SPINDLE_LASER_PWM_PIN 15 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 21 // Pullup! - #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h deleted file mode 100644 index f4b05e4f6e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h +++ /dev/null @@ -1,42 +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 - -/** - * Sanguinololu V1.2 pin assignments - * - * Applies to the following boards: - * - * AZTEEG_X1 - * MELZI - * MELZI_CREALITY - * MELZI_MAKR3D - * SANGUINOLOLU_12 - * STB_11 - */ - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Sanguinololu 1.2" -#endif - -#define SANGUINOLOLU_V_1_2 -#include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SETHI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SETHI.h deleted file mode 100644 index 79c3209b4b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_SETHI.h +++ /dev/null @@ -1,125 +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 - -/** - * Sethi 3D_1 pin assignments - www.sethi3d.com.br - */ - -/** - * Rev B 26 DEC 2016 - * - * added pointer to a current Arduino IDE extension - * this assumes that this board uses the Sanguino pin map - */ - -/** - * A useable Arduino IDE extension (board manager) can be found at - * https://github.com/Lauszus/Sanguino - * - * This extension has been tested on Arduino 1.6.12 & 1.8.0 - * - * Here's the JSON path: - * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json - * - * When installing select 1.0.2 - * - * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino - * Just use the above JSON URL instead of Sparkfun's JSON. - * - * Once installed select the Sanguino board and then select the CPU. - * - */ - -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) - #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" -#endif - -#define BOARD_INFO_NAME "Sethi 3D_1" - -#ifndef GEN7_VERSION - #define GEN7_VERSION 12 // v1.x -#endif - -// -// Limit Switches -// -#define X_STOP_PIN 2 -#define Y_STOP_PIN 0 -#define Z_MIN_PIN 1 -#define Z_MAX_PIN 0 - -// -// Steppers -// -#define X_STEP_PIN 19 -#define X_DIR_PIN 18 -#define X_ENABLE_PIN 24 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 22 -#define Y_ENABLE_PIN 24 - -#define Z_STEP_PIN 26 -#define Z_DIR_PIN 25 -#define Z_ENABLE_PIN 24 - -#define E0_STEP_PIN 28 -#define E0_DIR_PIN 27 -#define E0_ENABLE_PIN 24 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 4 -#define HEATER_BED_PIN 3 - -#ifndef FAN_PIN - #if GEN7_VERSION >= 13 - // Gen7 v1.3 removed the fan pin - #define FAN_PIN -1 - #else - #define FAN_PIN 31 - #endif -#endif - -// -// Misc. Functions -// -#define PS_ON_PIN 15 - -// All these generations of Gen7 supply thermistor power -// via PS_ON, so ignore bad thermistor readings -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// our pin for debugging. -#define DEBUG_PIN 0 - -// our RS485 pins -#define TX_ENABLE_PIN 12 -#define RX_ENABLE_PIN 13 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_STB_11.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_STB_11.h deleted file mode 100644 index 9a79853467..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sanguino/pins_STB_11.h +++ /dev/null @@ -1,30 +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 - -/** - * STB V1.1 pin assignments - */ - -#define BOARD_INFO_NAME "STB V1.1" - -#include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sensitive_pins.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sensitive_pins.h deleted file mode 100644 index b0ec52b45c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/sensitive_pins.h +++ /dev/null @@ -1,532 +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 - -// -// Prepare a list of protected pins for M42/M43 -// - -#if PIN_EXISTS(X_MIN) - #define _X_MIN X_MIN_PIN, -#else - #define _X_MIN -#endif -#if PIN_EXISTS(X_MAX) - #define _X_MAX X_MAX_PIN, -#else - #define _X_MAX -#endif -#if PIN_EXISTS(X_CS) && AXIS_HAS_SPI(X) - #define _X_CS X_CS_PIN, -#else - #define _X_CS -#endif -#if PIN_EXISTS(X_MS1) - #define _X_MS1 X_MS1_PIN, -#else - #define _X_MS1 -#endif -#if PIN_EXISTS(X_MS2) - #define _X_MS2 X_MS2_PIN, -#else - #define _X_MS2 -#endif -#if PIN_EXISTS(X_MS3) - #define _X_MS3 X_MS3_PIN, -#else - #define _X_MS3 -#endif - -#define _X_PINS X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, _X_MIN _X_MAX _X_MS1 _X_MS2 _X_MS3 _X_CS - -#if PIN_EXISTS(Y_MIN) - #define _Y_MIN Y_MIN_PIN, -#else - #define _Y_MIN -#endif -#if PIN_EXISTS(Y_MAX) - #define _Y_MAX Y_MAX_PIN, -#else - #define _Y_MAX -#endif -#if PIN_EXISTS(Y_CS) && AXIS_HAS_SPI(Y) - #define _Y_CS Y_CS_PIN, -#else - #define _Y_CS -#endif -#if PIN_EXISTS(Y_MS1) - #define _Y_MS1 Y_MS1_PIN, -#else - #define _Y_MS1 -#endif -#if PIN_EXISTS(Y_MS2) - #define _Y_MS2 Y_MS2_PIN, -#else - #define _Y_MS2 -#endif -#if PIN_EXISTS(Y_MS3) - #define _Y_MS3 Y_MS3_PIN, -#else - #define _Y_MS3 -#endif - -#define _Y_PINS Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, _Y_MIN _Y_MAX _Y_MS1 _Y_MS2 _Y_MS3 _Y_CS - -#if PIN_EXISTS(Z_MIN) - #define _Z_MIN Z_MIN_PIN, -#else - #define _Z_MIN -#endif -#if PIN_EXISTS(Z_MAX) - #define _Z_MAX Z_MAX_PIN, -#else - #define _Z_MAX -#endif -#if PIN_EXISTS(Z_CS) && AXIS_HAS_SPI(Z) - #define _Z_CS Z_CS_PIN, -#else - #define _Z_CS -#endif -#if PIN_EXISTS(Z_MS1) - #define _Z_MS1 Z_MS1_PIN, -#else - #define _Z_MS1 -#endif -#if PIN_EXISTS(Z_MS2) - #define _Z_MS2 Z_MS2_PIN, -#else - #define _Z_MS2 -#endif -#if PIN_EXISTS(Z_MS3) - #define _Z_MS3 Z_MS3_PIN, -#else - #define _Z_MS3 -#endif - -#define _Z_PINS Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, _Z_MIN _Z_MAX _Z_MS1 _Z_MS2 _Z_MS3 _Z_CS - -// -// Extruder Chip Select, Digital Micro-steps -// - -// Mixing stepper, Switching stepper, or regular stepper -#define E_NEEDED(N) (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > N) \ - || (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \ - || (NONE(SWITCHING_EXTRUDER, MIXING_EXTRUDER) && EXTRUDERS > N) - -#define _E0_CS -#define _E0_MS1 -#define _E0_MS2 -#define _E0_MS3 - -#if E_NEEDED(0) - #if PIN_EXISTS(E0_CS) && AXIS_HAS_SPI(E0) - #undef _E0_CS - #define _E0_CS E0_CS_PIN, - #endif - #if PIN_EXISTS(E0_MS1) - #undef _E0_MS1 - #define _E0_MS1 E0_MS1_PIN, - #endif - #if PIN_EXISTS(E0_MS2) - #undef _E0_MS2 - #define _E0_MS2 E0_MS2_PIN, - #endif - #if PIN_EXISTS(E0_MS3) - #undef _E0_MS3 - #define _E0_MS3 E0_MS3_PIN, - #endif -#endif - -#define _E1_CS -#define _E1_MS1 -#define _E1_MS2 -#define _E1_MS3 - -#if E_NEEDED(1) - #if PIN_EXISTS(E1_CS) && AXIS_HAS_SPI(E1) - #undef _E1_CS - #define _E1_CS E1_CS_PIN, - #endif - #if PIN_EXISTS(E1_MS1) - #undef _E1_MS1 - #define _E1_MS1 E1_MS1_PIN, - #endif - #if PIN_EXISTS(E1_MS2) - #undef _E1_MS2 - #define _E1_MS2 E1_MS2_PIN, - #endif - #if PIN_EXISTS(E1_MS3) - #undef _E1_MS3 - #define _E1_MS3 E1_MS3_PIN, - #endif -#endif - -#define _E2_CS -#define _E2_MS1 -#define _E2_MS2 -#define _E2_MS3 - -#if E_NEEDED(2) - #if PIN_EXISTS(E2_CS) && AXIS_HAS_SPI(E2) - #undef _E2_CS - #define _E2_CS E2_CS_PIN, - #endif - #if PIN_EXISTS(E2_MS1) - #undef _E2_MS1 - #define _E2_MS1 E2_MS1_PIN, - #endif - #if PIN_EXISTS(E2_MS2) - #undef _E2_MS2 - #define _E2_MS2 E2_MS2_PIN, - #endif - #if PIN_EXISTS(E2_MS3) - #undef _E2_MS3 - #define _E2_MS3 E2_MS3_PIN, - #endif -#endif - -#define _E3_CS -#define _E3_MS1 -#define _E3_MS2 -#define _E3_MS3 - -#if E_NEEDED(3) - #if PIN_EXISTS(E3_CS) && AXIS_HAS_SPI(E3) - #undef _E3_CS - #define _E3_CS E3_CS_PIN, - #endif - #if PIN_EXISTS(E3_MS1) - #undef _E3_MS1 - #define _E3_MS1 E3_MS1_PIN, - #endif - #if PIN_EXISTS(E3_MS2) - #undef _E3_MS2 - #define _E3_MS2 E3_MS2_PIN, - #endif - #if PIN_EXISTS(E3_MS3) - #undef _E3_MS3 - #define _E3_MS3 E3_MS3_PIN, - #endif -#endif - -#define _E4_CS -#define _E4_MS1 -#define _E4_MS2 -#define _E4_MS3 - -#if E_NEEDED(4) - #if PIN_EXISTS(E4_CS) && AXIS_HAS_SPI(E4) - #undef _E4_CS - #define _E4_CS E4_CS_PIN, - #endif - #if PIN_EXISTS(E4_MS1) - #undef _E4_MS1 - #define _E4_MS1 E4_MS1_PIN, - #endif - #if PIN_EXISTS(E4_MS2) - #undef _E4_MS2 - #define _E4_MS2 E4_MS2_PIN, - #endif - #if PIN_EXISTS(E4_MS3) - #undef _E4_MS3 - #define _E4_MS3 E4_MS3_PIN, - #endif -#endif - -#define _E5_CS -#define _E5_MS1 -#define _E5_MS2 -#define _E5_MS3 - -#if E_NEEDED(5) - #if PIN_EXISTS(E5_CS) && AXIS_HAS_SPI(E5) - #undef _E5_CS - #define _E5_CS E5_CS_PIN, - #endif - #if PIN_EXISTS(E5_MS1) - #undef _E5_MS1 - #define _E5_MS1 E5_MS1_PIN, - #endif - #if PIN_EXISTS(E5_MS2) - #undef _E5_MS2 - #define _E5_MS2 E5_MS2_PIN, - #endif - #if PIN_EXISTS(E5_MS3) - #undef _E5_MS3 - #define _E5_MS3 E5_MS3_PIN, - #endif -#endif - -// -// E Steppers -// - -#define _E0_PINS -#define _E1_PINS -#define _E2_PINS -#define _E3_PINS -#define _E4_PINS -#define _E5_PINS - -#if EXTRUDERS - #undef _E0_PINS - #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3 -#endif - -#if ENABLED(SWITCHING_EXTRUDER) - // Tools 0 and 1 use E0 - #if EXTRUDERS > 2 // Tools 2 and 3 use E1 - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3 - #if EXTRUDERS > 4 // Tools 4 and 5 use E2 - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3 - #endif - #endif -#elif EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) - #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3 - #if EXTRUDERS > 2 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 2) - #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3 - #if EXTRUDERS > 3 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 3) - #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, _E3_CS _E3_MS1 _E3_MS2 _E3_MS3 - #if EXTRUDERS > 4 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 4) - #undef _E4_PINS - #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, _E4_CS _E4_MS1 _E4_MS2 _E4_MS3 - #if EXTRUDERS > 5 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 5) - #undef _E5_PINS - #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, _E5_CS _E5_MS1 _E5_MS2 _E5_MS3 - #endif // EXTRUDERS > 5 || MIXING_EXTRUDER > 5 - #endif // EXTRUDERS > 4 || MIXING_EXTRUDER > 4 - #endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3 - #endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2 -#endif // EXTRUDERS > 1 || MIXING_EXTRUDER - -// -// Heaters, Fans, Temp Sensors -// - -#define _H0_PINS -#define _H1_PINS -#define _H2_PINS -#define _H3_PINS -#define _H4_PINS -#define _H5_PINS - -#if HOTENDS - #undef _H0_PINS - #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN), - #if HOTENDS > 1 - #undef _H1_PINS - #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN), - #if HOTENDS > 2 - #undef _H2_PINS - #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN), - #if HOTENDS > 3 - #undef _H3_PINS - #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN), - #if HOTENDS > 4 - #undef _H4_PINS - #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN), - #if HOTENDS > 5 - #undef _H5_PINS - #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN), - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 -#endif // HOTENDS - -#define _BED_PINS -#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED) - #undef _BED_PINS - #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), -#endif - -// -// Dual X, Dual Y, Multi-Z -// Chip Select and Digital Micro-stepping -// - -#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) - #if PIN_EXISTS(X2_CS) && AXIS_HAS_SPI(X2) - #define _X2_CS X2_CS_PIN, - #else - #define _X2_CS - #endif - #if PIN_EXISTS(X2_MS1) - #define _X2_MS1 X2_MS1_PIN, - #else - #define _X2_MS1 - #endif - #if PIN_EXISTS(X2_MS2) - #define _X2_MS2 X2_MS2_PIN, - #else - #define _X2_MS2 - #endif - #if PIN_EXISTS(X2_MS3) - #define _X2_MS3 X2_MS3_PIN, - #else - #define _X2_MS3 - #endif - #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, _X2_CS _X2_MS1 _X2_MS2 _X2_MS3 -#else - #define _X2_PINS -#endif - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #if PIN_EXISTS(Y2_CS) && AXIS_HAS_SPI(Y2) - #define _Y2_CS Y2_CS_PIN, - #else - #define _Y2_CS - #endif - #if PIN_EXISTS(Y2_MS1) - #define _Y2_MS1 Y2_MS1_PIN, - #else - #define _Y2_MS1 - #endif - #if PIN_EXISTS(Y2_MS2) - #define _Y2_MS2 Y2_MS2_PIN, - #else - #define _Y2_MS2 - #endif - #if PIN_EXISTS(Y2_MS3) - #define _Y2_MS3 Y2_MS3_PIN, - #else - #define _Y2_MS3 - #endif - #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, _Y2_CS _Y2_MS1 _Y2_MS2 _Y2_MS3 -#else - #define _Y2_PINS -#endif - -#if Z_MULTI_STEPPER_DRIVERS - #if PIN_EXISTS(Z2_CS) && AXIS_HAS_SPI(Z2) - #define _Z2_CS Z2_CS_PIN, - #else - #define _Z2_CS - #endif - #if PIN_EXISTS(Z2_MS1) - #define _Z2_MS1 Z2_MS1_PIN, - #else - #define _Z2_MS1 - #endif - #if PIN_EXISTS(Z2_MS2) - #define _Z2_MS2 Z2_MS2_PIN, - #else - #define _Z2_MS2 - #endif - #if PIN_EXISTS(Z2_MS3) - #define _Z2_MS3 Z2_MS3_PIN, - #else - #define _Z2_MS3 - #endif - #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, _Z2_CS _Z2_MS1 _Z2_MS2 _Z2_MS3 -#else - #define _Z2_PINS -#endif - -#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - #if PIN_EXISTS(Z3_CS) && AXIS_HAS_SPI(Z3) - #define _Z3_CS Z3_CS_PIN, - #else - #define _Z3_CS - #endif - #if PIN_EXISTS(Z3_MS1) - #define _Z3_MS1 Z3_MS1_PIN, - #else - #define _Z3_MS1 - #endif - #if PIN_EXISTS(Z3_MS2) - #define _Z3_MS2 Z3_MS2_PIN, - #else - #define _Z3_MS2 - #endif - #if PIN_EXISTS(Z3_MS3) - #define _Z3_MS3 Z3_MS3_PIN, - #else - #define _Z3_MS3 - #endif - #define _Z3_PINS Z3_STEP_PIN, Z3_DIR_PIN, Z3_ENABLE_PIN, _Z3_CS _Z3_MS1 _Z3_MS2 _Z3_MS3 -#else - #define _Z3_PINS -#endif - -// -// Generate the final Sensitive Pins array, -// keeping the array as small as possible. -// - -#if PIN_EXISTS(PS_ON) - #define _PS_ON PS_ON_PIN, -#else - #define _PS_ON -#endif - -#if HAS_BED_PROBE && PIN_EXISTS(Z_MIN_PROBE) - #define _Z_PROBE Z_MIN_PROBE_PIN, -#else - #define _Z_PROBE -#endif - -#if TEMP_SENSOR_BED && PIN_EXISTS(HEATER_BED) - #define _HEATER_BED HEATER_BED_PIN, -#else - #define _HEATER_BED -#endif - -#if PIN_EXISTS(FAN) - #define _FAN0 FAN_PIN, -#else - #define _FAN0 -#endif -#if PIN_EXISTS(FAN1) - #define _FAN1 FAN1_PIN, -#else - #define _FAN1 -#endif -#if PIN_EXISTS(FAN2) - #define _FAN2 FAN2_PIN, -#else - #define _FAN2 -#endif -#if PIN_EXISTS(CONTROLLER_FAN) - #define _FANC CONTROLLER_FAN_PIN, -#else - #define _FANC -#endif - -#ifndef HAL_SENSITIVE_PINS - #define HAL_SENSITIVE_PINS -#endif - -#define SENSITIVE_PINS { \ - _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z_PROBE \ - _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _BED_PINS \ - _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \ - _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FANC \ - HAL_SENSITIVE_PINS \ -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_ARMED.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_ARMED.h deleted file mode 100644 index 495654a82c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_ARMED.h +++ /dev/null @@ -1,198 +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 - -#ifndef STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Arm'ed supports up to 2 hotends / E-steppers." -#endif - -#ifndef ARMED_V1_0 - #define ARMED_V1_1 -#endif - -#undef BOARD_INFO_NAME // Defined on the command line by Arduino Core STM32 -#define BOARD_INFO_NAME "Arm'ed" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -#define I2C_EEPROM - -#undef E2END // Defined in Arduino Core STM32 to be used with EEPROM emulation. This board uses a real EEPROM. -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_STOP_PIN PE0 -#define Y_STOP_PIN PE1 -#define Z_STOP_PIN PE14 - -// -// Z Probe (when not Z_MIN_PIN) -// -//#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PA4 -//#endif - -// -// Filament Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PA3 -#endif - -// -// Steppers -// - -#ifdef ARMED_SWAP_X_E1 - #define X_STEP_PIN PE4 - #define X_DIR_PIN PE2 - #define X_ENABLE_PIN PE3 - #define X_CS_PIN PE5 -#else - #define X_STEP_PIN PD3 - #define X_DIR_PIN PD2 - #define X_ENABLE_PIN PD0 - #define X_CS_PIN PD1 -#endif - -#define Y_STEP_PIN PE11 -#define Y_DIR_PIN PE10 -#define Y_ENABLE_PIN PE13 -#define Y_CS_PIN PE12 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD7 -#define Z_ENABLE_PIN PD4 -#define Z_CS_PIN PD5 - -#define E0_STEP_PIN PB5 -#define E0_DIR_PIN PB6 -#ifdef ARMED_V1_1 - #define E0_ENABLE_PIN PC12 -#else - #define E0_ENABLE_PIN PB3 -#endif -#define E0_CS_PIN PB4 - -#ifdef ARMED_SWAP_X_E1 - #define E1_STEP_PIN PD3 - #define E1_DIR_PIN PD2 - #define E1_ENABLE_PIN PD0 - #define E1_CS_PIN PD1 -#else - #define E1_STEP_PIN PE4 - #define E1_DIR_PIN PE2 - #define E1_ENABLE_PIN PE3 - #define E1_CS_PIN PE5 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC0 // Analog Input -#define TEMP_1_PIN PC1 // Analog Input -#define TEMP_BED_PIN PC2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN PA1 // Hardware PWM -#define HEATER_1_PIN PA2 // Hardware PWM -#define HEATER_BED_PIN PA0 // Hardware PWM - -#define FAN_PIN PC6 // Hardware PWM, Part cooling fan -#define FAN1_PIN PC7 // Hardware PWM, Extruder fan -#define FAN2_PIN PC8 // Hardware PWM, Controller fan - -// -// Misc functions -// -#define SDSS PE7 -#define LED_PIN PB7 // Heart beat -#define PS_ON_PIN PA10 -#define KILL_PIN PA8 -#define PWR_LOSS PA4 // Power loss / nAC_FAULT - -// -// LCD / Controller -// -#define SD_DETECT_PIN PA15 -#define BEEPER_PIN PC9 - -#if ENABLED(FYSETC_MINI_12864) - // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - // - #define DOGLCD_A0 PE9 - #define DOGLCD_CS PE8 - - #define LCD_BACKLIGHT_PIN -1 - - #define LCD_RESET_PIN PB12 // 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 PB13 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PB14 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PB15 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PB13 - #endif -#else - #define LCD_PINS_RS PE9 - #define LCD_PINS_ENABLE PE8 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS PB13 - #define DOGLCD_A0 PB14 - #endif -#endif - -#define BTN_EN1 PC4 -#define BTN_EN2 PC5 -#define BTN_ENC PC3 - -// -// Extension pins -// -#define EXT0_PIN PB0 -#define EXT1_PIN PB1 -#define EXT2_PIN PB2 -#define EXT3_PIN PD8 -#define EXT4_PIN PD9 -#define EXT5_PIN PD10 -#define EXT6_PIN PD11 -#define EXT7_PIN PD12 -#define EXT8_PIN PB10 -#define EXT9_PIN PB11 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BEAST.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BEAST.h deleted file mode 100644 index 7b1f61d918..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BEAST.h +++ /dev/null @@ -1,285 +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 - -#if !defined(__STM32F1__) && !defined(__STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" -#endif - -/** - * 21017 Victor Perez Marlin for stm32f1 test - */ - -#define BOARD_INFO_NAME "Beast STM32" -#define DEFAULT_MACHINE_NAME "STM32F103RET6" - -// Enable I2C_EEPROM for testing -#define I2C_EEPROM - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Steppers -// -#define X_STEP_PIN PE0 -#define X_DIR_PIN PE1 -#define X_ENABLE_PIN PC0 -#define X_MIN_PIN PD5 -#define X_MAX_PIN -1 - -#define Y_STEP_PIN PE2 -#define Y_DIR_PIN PE3 -#define Y_ENABLE_PIN PC1 -#define Y_MIN_PIN PD6 -#define Y_MAX_PIN - -#define Z_STEP_PIN PE4 -#define Z_DIR_PIN PE5 -#define Z_ENABLE_PIN PC2 -#define Z_MIN_PIN PD7 -#define Z_MAX_PIN -1 - -#define Y2_STEP_PIN -1 -#define Y2_DIR_PIN -1 -#define Y2_ENABLE_PIN -1 - -#define Z2_STEP_PIN -1 -#define Z2_DIR_PIN -1 -#define Z2_ENABLE_PIN -1 - -#define E0_STEP_PIN PE6 -#define E0_DIR_PIN PE7 -#define E0_ENABLE_PIN PC3 - -/** - * TODO: Currently using same Enable pin to all steppers. - */ - -#define E1_STEP_PIN PE8 -#define E1_DIR_PIN PE9 -#define E1_ENABLE_PIN PC4 - -#define E2_STEP_PIN PE10 -#define E2_DIR_PIN PE11 -#define E2_ENABLE_PIN PC5 - -// -// Misc. Functions -// -#define SDSS PA15 -#define LED_PIN PB2 - -#define PS_ON_PIN -1 -#define KILL_PIN -1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD12 // EXTRUDER 1 -#define HEATER_1_PIN PD13 -#define HEATER_2_PIN PD14 - -#define HEATER_BED_PIN PB9 // BED -#define HEATER_BED2_PIN -1 // BED2 -#define HEATER_BED3_PIN -1 // BED3 - -#ifndef FAN_PIN - #define FAN_PIN PB10 -#endif - -#define FAN_SOFT_PWM - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA0 // Analog Input -#define TEMP_0_PIN PA1 // Analog Input -#define TEMP_1_PIN PA2 // Analog Input -#define TEMP_2_PIN PA3 // Analog Input - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #else - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - #endif - - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h deleted file mode 100644 index 74a715a8d2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h +++ /dev/null @@ -1,134 +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 - -/** - * STM32F407VET6 with RAMPS-like shield - * 'Black' STM32F407VET6 board - http://wiki.stm32duino.com/index.php?title=STM32F407 - * Shield - https://github.com/jmz52/Hardware - */ - -#if !defined(STM32F4) && !defined(STM32F4xx) - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "Black STM32F4VET6 supports up to 2 hotends / E-steppers." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Black STM32F4VET6" -#endif - -#define DEFAULT_MACHINE_NAME "STM32F407VET6" - -//#define I2C_EEPROM -//#define E2END 0x1FFF // 8KB -#define SRAM_EEPROM_EMULATION - -// -// Servos -// -#define SERVO0_PIN PC6 -#define SERVO1_PIN PC7 - -// -// Limit Switches -// -#define X_MIN_PIN PC13 -#define X_MAX_PIN PA15 -#define Y_MIN_PIN PA5 -#define Y_MAX_PIN PD12 -#define Z_MIN_PIN PD14 -#define Z_MAX_PIN PD15 - -// -// Steppers -// -#define X_STEP_PIN PC4 -#define X_DIR_PIN PA4 -#define X_ENABLE_PIN PE7 - -#define Y_STEP_PIN PE5 -#define Y_DIR_PIN PE2 -#define Y_ENABLE_PIN PE6 - -#define Z_STEP_PIN PD5 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PD6 - -#define E0_STEP_PIN PD7 -#define E0_DIR_PIN PD0 -#define E0_ENABLE_PIN PB9 - -#define E1_STEP_PIN PE0 -#define E1_DIR_PIN PE1 -#define E1_ENABLE_PIN PB8 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC0 // T0 -#define TEMP_1_PIN PC1 // T1 -#define TEMP_BED_PIN PC2 // TB - -#ifndef TEMP_CHAMBER_PIN - #define TEMP_CHAMBER_PIN PC3 // TC -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN PA2 // Heater0 -#define HEATER_1_PIN PA3 // Heater1 -#define HEATER_BED_PIN PA1 // Hotbed - -#define FAN_PIN PE9 // Fan0 -#define FAN1_PIN PE11 // Fan1 -#define FAN2_PIN PE13 // Fan2 -#define FAN3_PIN PE14 // Fan3 - -// -// Misc. Functions -// -#define SDSS PB12 -#define LED_PIN PA6 -//#define LED_PIN PA7 -#define KILL_PIN PB1 - -// -// LCD / Controller -// -#define SD_DETECT_PIN PC5 -//#define SD_DETECT_PIN PA8 // SDIO SD_DETECT_PIN, external SDIO card reader only - -#define BEEPER_PIN PD10 -#define LCD_PINS_RS PE15 -#define LCD_PINS_ENABLE PD8 -#define LCD_PINS_D4 PE10 -#define LCD_PINS_D5 PE12 -#define LCD_PINS_D6 PD1 -#define LCD_PINS_D7 PE8 -#define BTN_ENC PD9 -#define BTN_EN1 PD4 -#define BTN_EN2 PD13 - -#define DOGLCD_CS LCD_PINS_D5 -#define DOGLCD_A0 LCD_PINS_D6 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h deleted file mode 100644 index 7b275a7be6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h +++ /dev/null @@ -1,251 +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 - -#ifndef TARGET_STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "BIGTREE Btt002 1.0" - -#define SRAM_EEPROM_EMULATION - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Servos -// -#define SERVO0_PIN PC3 - -// -// Limit Switches -// -#define X_MIN_PIN PD3 -#define X_MAX_PIN PD3 -#define Y_MIN_PIN PD2 -#define Y_MAX_PIN PD2 -#define Z_MIN_PIN PD1 -#define Z_MAX_PIN PD1 - -// -// Z Probe must be this pins ## -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PD1 -#endif - -// -// Steppers -// -#define X_STEP_PIN PA9 -#define X_DIR_PIN PA10 -#define X_ENABLE_PIN PA8 -#ifndef X_CS_PIN - #define X_CS_PIN PE2 -#endif - -#define Y_STEP_PIN PC8 -#define Y_DIR_PIN PC9 -#define Y_ENABLE_PIN PC7 - #ifndef Y_CS_PIN - #define Y_CS_PIN PE3 -#endif - -#define Z_STEP_PIN PD15 -#define Z_DIR_PIN PC6 -#define Z_ENABLE_PIN PD14 -#ifndef Z_CS_PIN - #define Z_CS_PIN PE4 -#endif - -#define E0_STEP_PIN PD12 -#define E0_DIR_PIN PD13 -#define E0_ENABLE_PIN PD11 -#ifndef E0_CS_PIN - #define E0_CS_PIN PD7 -#endif - -/* -//SKR_PRO_V1.1 -#define E1_STEP_PIN PD15 -#define E1_DIR_PIN PE7 -#define E1_ENABLE_PIN PA3 -#ifndef E1_CS_PIN - #define E1_CS_PIN PG15 -#endif - -#define E2_STEP_PIN PD13 -#define E2_DIR_PIN PG9 -#define E2_ENABLE_PIN PF0 -#ifndef E2_CS_PIN - #define E2_CS_PIN PG12 -#endif -*/ -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PB15 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO PB14 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK PB13 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial ## - // - #define X_SERIAL_TX_PIN PE2 - #define X_SERIAL_RX_PIN PE2 - - #define Y_SERIAL_TX_PIN PE3 - #define Y_SERIAL_RX_PIN PE3 - - #define Z_SERIAL_TX_PIN PE4 - #define Z_SERIAL_RX_PIN PE4 - - #define E0_SERIAL_TX_PIN PD7 - #define E0_SERIAL_RX_PIN PD7 - - //#define E1_SERIAL_TX_PIN PD1 - //#define E1_SERIAL_RX_PIN PD1 - - //#define E2_SERIAL_TX_PIN PD6 - //#define E2_SERIAL_RX_PIN PD6 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA2 // T1 <-> E0 -#define TEMP_1_PIN PA0 // T2 <-> E1 -//#define TEMP_2_PIN PC2 // T3 <-> E2 SKR_PRO -#define TEMP_BED_PIN PA1 // T0 <-> Bed - -// -// Heaters / Fans -// -#define HEATER_0_PIN PE6 // Heater0 -//#define HEATER_1_PIN PD14 // Heater1 -//#define HEATER_2_PIN PB0 // Heater1 -#define HEATER_BED_PIN PE5 // Hotbed -#define FAN_PIN PB9 // Fan0 -#define FAN1_PIN PB8 // Fan1 -//#define FAN2_PIN PE6 // Fan2 - -// HAL SPI pins group -#define SCK_PIN PA5 // SPI SCLK -#define MYSSEL PA4 // SPI SSEL -#define MISO_PIN PA6 // SPI MISO -#define MOSI_PIN PA7 // SPI MOSI - -// -// Misc. Functions -// -#define SDSS PA4 - -/** - * -------------------------------------SKR_MK3----------------------------------------------- - * _____ _____ | - * PA3 | · · | GND 5V | · · | GND | - * NRESET | · · | PC4(SD_DET) (LCD_D7) PE13 | · · | PE12 (LCD_D6) | - * (MOSI)PA7 | · · | PB0(BTN_EN2) (LCD_D5) PE11 | · · | PE10 (LCD_D4) | - * (SD_SS)PA4 | · · | PC5(BTN_EN1) (LCD_RS) PE8 | · · | PE9 (LCD_EN) | - * (SCK)PA5 | · · | PA6(MISO) (BTN_ENC) PB1 | · · | PE7 (BEEPER) | - *  ̄ ̄  ̄ ̄ | - * EXP2 EXP1 | - * --------------------------------------------------------------------------------------------- - */ -// -// LCDs and Controllers -// -#if HAS_SPI_LCD - #define BEEPER_PIN PE7 - #define BTN_ENC PB1 - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PE12 - - #define BTN_EN1 PE9 - #define BTN_EN2 PE10 - - #define LCD_PINS_ENABLE PE13 - #define LCD_PINS_D4 PE11 - - #else - - #define LCD_PINS_RS PE8 - - #define BTN_EN1 PC5 - #define BTN_EN2 PB0 - #define SD_DETECT_PIN PC4 - - #define LCD_SDSS PA4 - - #define LCD_PINS_ENABLE PE9 - #define LCD_PINS_D4 PE10 - - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 PE11 - #define LCD_PINS_D6 PE12 - #define LCD_PINS_D7 PE13 - #endif - - #endif - - // Alter timing for graphical display - #if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h deleted file mode 100644 index 2618e3462e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h +++ /dev/null @@ -1,226 +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 - -#ifndef TARGET_STM32F1 - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "BIGTREE SKR E3 DIP V1.0" - -// Release PB3/PB4 (TMC_SW Pins) from JTAG pins -#define DISABLE_JTAG - -// 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 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) -#undef E2END -#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB - -// -// Servos -// -#define SERVO0_PIN PA1 - -// -// Limit Switches -// -#define X_STOP_PIN PC1 -#define Y_STOP_PIN PC0 -#define Z_STOP_PIN PC15 - -// -// Z Probe must be this pin -// -#define Z_MIN_PROBE_PIN PC14 - -// -// Filament Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC2 -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PC7 -#define X_STEP_PIN PC6 -#define X_DIR_PIN PB15 -#ifndef X_CS_PIN - #define X_CS_PIN PC10 -#endif - -#define Y_ENABLE_PIN PB14 -#define Y_STEP_PIN PB13 -#define Y_DIR_PIN PB12 -#ifndef Y_CS_PIN - #define Y_CS_PIN PC11 -#endif - -#define Z_ENABLE_PIN PB11 -#define Z_STEP_PIN PB10 -#define Z_DIR_PIN PB2 -#ifndef Z_CS_PIN - #define Z_CS_PIN PC12 -#endif - -#define E0_ENABLE_PIN PB1 -#define E0_STEP_PIN PB0 -#define E0_DIR_PIN PC5 -#ifndef E0_CS_PIN - #define E0_CS_PIN PD2 -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PB5 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO PB4 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK PB3 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - #define X_SERIAL_TX_PIN PC10 - #define X_SERIAL_RX_PIN PC10 - - #define Y_SERIAL_TX_PIN PC11 - #define Y_SERIAL_RX_PIN PC11 - - #define Z_SERIAL_TX_PIN PC12 - #define Z_SERIAL_RX_PIN PC12 - - #define E0_SERIAL_TX_PIN PD2 - #define E0_SERIAL_RX_PIN PD2 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA0 // Analog Input -#define TEMP_BED_PIN PC3 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC8 // EXTRUDER -#define HEATER_BED_PIN PC9 // BED -#define FAN_PIN PA8 - -// -// USB connect control -// -#define USB_CONNECT_PIN PC13 -#define USB_CONNECT_INVERTING false - -#define SD_DETECT_PIN PC4 - -/** - * _____ - * 5V | · · | GND - * (LCD_EN) PB7 | · · | PB8 (LCD_RS) - * (LCD_D4) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PA15 (BEEPER) - * ----- - * EXP1 - */ -#if HAS_SPI_LCD - #define BEEPER_PIN PA15 - #define BTN_ENC PB6 - - #if ENABLED(CR10_STOCKDISPLAY) - - #define LCD_PINS_RS PB8 - - #define BTN_EN1 PA9 - #define BTN_EN2 PA10 - - #define LCD_PINS_ENABLE PB7 - #define LCD_PINS_D4 PB9 - - #elif ENABLED(MKS_MINI_12864) - - /** Creality Ender-2 display pinout - * _____ - * 5V | · · | GND - * (MOSI) PB7 | · · | PB8 (LCD_RS) - * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PA15 (SCK) - * ----- - * EXP1 - */ - - #define BTN_EN1 PA9 - #define BTN_EN2 PA10 - #define DOGLCD_CS PB8 - #define DOGLCD_A0 PB9 - #define DOGLCD_SCK PA15 - #define DOGLCD_MOSI PB7 - #define FORCE_SOFT_SPI - #define LCD_BACKLIGHT_PIN -1 - - #else - #error "Only CR10_STOCKDISPLAY and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP." - #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_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h deleted file mode 100644 index abb9e9a912..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h +++ /dev/null @@ -1,180 +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 - -#ifndef TARGET_STM32F1 - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -// Release PB3/PB4 (E0 STP/DIR) from JTAG pins -#define DISABLE_JTAG - -// 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 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) -#undef E2END -#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB - -// -// Servos -// -#define SERVO0_PIN PA1 - -// -// Limit Switches -// -#define X_STOP_PIN PC0 -#define Y_STOP_PIN PC1 -#define Z_STOP_PIN PC2 - -// -// Z Probe must be this pins -// -#define Z_MIN_PROBE_PIN PC14 - -// -// Filament Runout Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC15 // "E0-STOP" -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PB14 -#define X_STEP_PIN PB13 -#define X_DIR_PIN PB12 - -#define Y_ENABLE_PIN PB11 -#define Y_STEP_PIN PB10 -#define Y_DIR_PIN PB2 - -#define Z_ENABLE_PIN PB1 -#define Z_STEP_PIN PB0 -#define Z_DIR_PIN PC5 - -#define E0_ENABLE_PIN PD2 -#define E0_STEP_PIN PB3 -#define E0_DIR_PIN PB4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA0 // Analog Input -#define TEMP_BED_PIN PC3 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC8 // EXTRUDER -#define HEATER_BED_PIN PC9 // BED -#define FAN_PIN PA8 - -// -// USB connect control -// -#define USB_CONNECT_PIN PC13 -#define USB_CONNECT_INVERTING false - -#define SD_DETECT_PIN PC4 - -/** - * _____ - * 5V | · · | GND - * (LCD_EN) PB7 | · · | PB8 (LCD_RS) - * (LCD_D4) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PB5 (BEEPER) - * ----- - * EXP1 - */ -#if HAS_SPI_LCD - - #if ENABLED(CR10_STOCKDISPLAY) - - #define BEEPER_PIN PB5 - #define BTN_ENC PB6 - - #define LCD_PINS_RS PB8 - - #define BTN_EN1 PA9 - #define BTN_EN2 PA10 - - #define LCD_PINS_ENABLE PB7 - #define LCD_PINS_D4 PB9 - - #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - - #define LCD_PINS_RS PB9 - #define LCD_PINS_ENABLE PB6 - #define LCD_PINS_D4 PB8 - #define LCD_PINS_D5 PA10 - #define LCD_PINS_D6 PA9 - #define LCD_PINS_D7 PB5 - #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! - - #elif ENABLED(MKS_MINI_12864) - - /** Creality Ender-2 display pinout - * _____ - * 5V | · · | GND - * (MOSI) PB7 | · · | PB8 (LCD_RS) - * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PB5 (SCK) - * ----- - * EXP1 - */ - #define BTN_EN1 PA9 - #define BTN_EN2 PA10 - #define BTN_ENC PB6 - - #define DOGLCD_CS PB8 - #define DOGLCD_A0 PB9 - #define DOGLCD_SCK PB5 - #define DOGLCD_MOSI PB7 - #define FORCE_SOFT_SPI - #define LCD_BACKLIGHT_PIN -1 - - #else - - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3." - - #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_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h deleted file mode 100644 index bd2078e5d9..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h +++ /dev/null @@ -1,37 +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 - -#include "pins_BTT_SKR_MINI_E3.h" - -#define BOARD_INFO_NAME "BIGTREE SKR Mini E3" - -/** - * TMC2209 stepper drivers - * Hardware serial communication ports. - */ -#if HAS_DRIVER(TMC2209) - #define X_HARDWARE_SERIAL Serial4 - #define Y_HARDWARE_SERIAL Serial4 - #define Z_HARDWARE_SERIAL Serial4 - #define E0_HARDWARE_SERIAL Serial4 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h deleted file mode 100644 index 67da8571fb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h +++ /dev/null @@ -1,51 +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 - -#include "pins_BTT_SKR_MINI_E3.h" - -#define BOARD_INFO_NAME "BIGTREE SKR Mini E3 V1.2" - -#define NEOPIXEL_PIN PC7 // LED driving pin - -/** - * TMC2208/TMC2209 stepper drivers - */ -#if HAS_TMC220x - // - // Software serial - // - #define X_SERIAL_TX_PIN PB15 - #define X_SERIAL_RX_PIN PB15 - - #define Y_SERIAL_TX_PIN PC6 - #define Y_SERIAL_RX_PIN PC6 - - #define Z_SERIAL_TX_PIN PC10 - #define Z_SERIAL_RX_PIN PC10 - - #define E0_SERIAL_TX_PIN PC11 - #define E0_SERIAL_RX_PIN PC11 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h deleted file mode 100644 index 3c6b673b6e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h +++ /dev/null @@ -1,210 +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 - -#ifndef TARGET_STM32F1 - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "BIGTREE SKR Mini 1.1" - -//#define DISABLE_DEBUG -#define DISABLE_JTAG - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -#define FLASH_EEPROM_EMULATION -#define EEPROM_PAGE_SIZE (0x800) // 2KB -#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) -#define E2END (EEPROM_PAGE_SIZE - 1) - -// -// Limit Switches -// -#define X_MIN_PIN PC2 -#define X_MAX_PIN PA2 -#define Y_MIN_PIN PC1 -#define Y_MAX_PIN PA1 -#define Z_MIN_PIN PC0 -#define Z_MAX_PIN PC3 - -// -// Steppers -// - -#define X_STEP_PIN PC6 -#define X_DIR_PIN PC7 -#define X_ENABLE_PIN PB15 - -#define Y_STEP_PIN PB13 -#define Y_DIR_PIN PB14 -#define Y_ENABLE_PIN PB12 - -#define Z_STEP_PIN PB10 -#define Z_DIR_PIN PB11 -#define Z_ENABLE_PIN PB2 - -#define E0_STEP_PIN PC5 -#define E0_DIR_PIN PB0 -#define E0_ENABLE_PIN PC4 - -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_SCK - #define TMC_SW_SCK PB3 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO PB4 - #endif - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PB5 - #endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN PA8 -#define FAN_PIN PC8 -#define HEATER_BED_PIN PC9 - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PB1 // Analog Input -#define TEMP_0_PIN PA0 // Analog Input - -// -// LCD Pins -// - -/** - * _____ _____ - * NC | · · | GND 5V | · · | GND - * RESET | · · | PB9 (SD_DETECT) (LCD_D7) PC14 | · · | PC15 (LCD_D6) - * (MOSI) PB5 | · · | PB8 (BTN_EN2) (LCD_D5) PB7 | · · | PC13 (LCD_D4) - * (SD_SS) PA15 | · · | PD2 (BTN_EN1) (LCD_RS) PC12 | · · | PB6 (LCD_EN) - * (SCK) PB3 | · · | PB4 (MISO) (BTN_ENC) PC11 | · · | PC10 (BEEPER) - * ----- ----- - * EXP2 EXP1 - */ - -#if HAS_SPI_LCD - #define BEEPER_PIN PC10 - #define BTN_ENC PC11 - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PC15 - - #define BTN_EN1 PB6 - #define BTN_EN2 PC13 - - #define LCD_PINS_ENABLE PC14 - #define LCD_PINS_D4 PB7 - - #else - - #define LCD_PINS_RS PC12 - - #define BTN_EN1 PD2 - #define BTN_EN2 PB8 - - #define LCD_PINS_ENABLE PB6 - - #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) - #define LCD_PINS_D5 PB7 - #define LCD_PINS_D6 PC15 - #define LCD_PINS_D7 PC14 - #endif - - #endif // !FYSETC_MINI_12864 - - #endif - -#endif // HAS_SPI_LCD - -// -// SD Card -// - -// By default the onboard SD is enabled. -// 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 - -#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 -#elif SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI1 - #define SD_DETECT_PIN PA3 - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #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 - -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h deleted file mode 100644 index dad46716fd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h +++ /dev/null @@ -1,268 +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 - -#ifndef TARGET_STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "BIGTREE SKR Pro 1.1" // redefined? - -// Use one of these or SDCard-based Emulation will be used -//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation -//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation - -// -// Servos -// -#define SERVO0_PIN PA1 - -// -// Limit Switches -// -#define X_MIN_PIN PB10 -#define X_MAX_PIN PE15 -#define Y_MIN_PIN PE12 -#define Y_MAX_PIN PE10 -#define Z_MIN_PIN PG8 -#define Z_MAX_PIN PG5 - -// -// Z Probe must be this pins -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PA2 -#endif - -// -// Steppers -// -#define X_STEP_PIN PE9 -#define X_DIR_PIN PF1 -#define X_ENABLE_PIN PF2 -#ifndef X_CS_PIN - #define X_CS_PIN PA15 -#endif - -#define Y_STEP_PIN PE11 -#define Y_DIR_PIN PE8 -#define Y_ENABLE_PIN PD7 - #ifndef Y_CS_PIN - #define Y_CS_PIN PB8 -#endif - -#define Z_STEP_PIN PE13 -#define Z_DIR_PIN PC2 -#define Z_ENABLE_PIN PC0 -#ifndef Z_CS_PIN - #define Z_CS_PIN PB9 -#endif - -#define E0_STEP_PIN PE14 -#define E0_DIR_PIN PA0 -#define E0_ENABLE_PIN PC3 -#ifndef E0_CS_PIN - #define E0_CS_PIN PB3 -#endif - -#define E1_STEP_PIN PD15 -#define E1_DIR_PIN PE7 -#define E1_ENABLE_PIN PA3 -#ifndef E1_CS_PIN - #define E1_CS_PIN PG15 -#endif - -#define E2_STEP_PIN PD13 -#define E2_DIR_PIN PG9 -#define E2_ENABLE_PIN PF0 -#ifndef E2_CS_PIN - #define E2_CS_PIN PG12 -#endif - -// -// Software SPI pins for TMC2130 stepper drivers -// -#if ENABLED(TMC_USE_SW_SPI) - #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PC12 - #endif - #ifndef TMC_SW_MISO - #define TMC_SW_MISO PC11 - #endif - #ifndef TMC_SW_SCK - #define TMC_SW_SCK PC10 - #endif -#endif - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL Serial - //#define X2_HARDWARE_SERIAL Serial1 - //#define Y_HARDWARE_SERIAL Serial1 - //#define Y2_HARDWARE_SERIAL Serial1 - //#define Z_HARDWARE_SERIAL Serial1 - //#define Z2_HARDWARE_SERIAL Serial1 - //#define E0_HARDWARE_SERIAL Serial1 - //#define E1_HARDWARE_SERIAL Serial1 - //#define E2_HARDWARE_SERIAL Serial1 - //#define E3_HARDWARE_SERIAL Serial1 - //#define E4_HARDWARE_SERIAL Serial1 - - // - // Software serial - // - #define X_SERIAL_TX_PIN PC13 - #define X_SERIAL_RX_PIN PC13 - - #define Y_SERIAL_TX_PIN PE3 - #define Y_SERIAL_RX_PIN PE3 - - #define Z_SERIAL_TX_PIN PE1 - #define Z_SERIAL_RX_PIN PE1 - - #define E0_SERIAL_TX_PIN PD4 - #define E0_SERIAL_RX_PIN PD4 - - #define E1_SERIAL_TX_PIN PD1 - #define E1_SERIAL_RX_PIN PD1 - - #define E2_SERIAL_TX_PIN PD6 - #define E2_SERIAL_RX_PIN PD6 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PF4 // T1 <-> E0 -#define TEMP_1_PIN PF5 // T2 <-> E1 -#define TEMP_2_PIN PF6 // T3 <-> E2 -#define TEMP_BED_PIN PF3 // T0 <-> Bed - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB1 // Heater0 -#define HEATER_1_PIN PD14 // Heater1 -#define HEATER_2_PIN PB0 // Heater1 -#define HEATER_BED_PIN PD12 // Hotbed -#define FAN_PIN PC8 // Fan0 -#define FAN1_PIN PE5 // Fan1 -#define FAN2_PIN PE6 // Fan2 - -// -// Misc. Functions -// -#define SDSS PB12 - -/** - * _____ _____ - * NC | · · | GND 5V | · · | GND - * RESET | · · | PF12(SD_DETECT) (LCD_D7) PG7 | · · | PG6 (LCD_D6) - * (MOSI)PB15 | · · | PF11(BTN_EN2) (LCD_D5) PG3 | · · | PG2 (LCD_D4) - * (SD_SS)PB12 | · · | PG10(BTN_EN1) (LCD_RS) PD10 | · · | PD11 (LCD_EN) - * (SCK)PB13 | · · | PB14(MISO) (BTN_ENC) PA8 | · · | PG4 (BEEPER) - *  ̄ ̄  ̄ ̄ - * EXP2 EXP1 - */ - -// -// LCDs and Controllers -// -#if HAS_SPI_LCD - #define BEEPER_PIN PG4 - #define BTN_ENC PA8 - - #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PG6 - - #define BTN_EN1 PD11 - #define BTN_EN2 PG2 - - #define LCD_PINS_ENABLE PG7 - #define LCD_PINS_D4 PG3 - - // CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here. - // It will be defined again at the #HAS_GRAPHICAL_LCD section below. - #undef ST7920_DELAY_1 - #undef ST7920_DELAY_2 - #undef ST7920_DELAY_3 - - - #else - - #define LCD_PINS_RS PD10 - - #define BTN_EN1 PG10 - #define BTN_EN2 PF11 - #define SD_DETECT_PIN PF12 - - #define LCD_SDSS PB12 - - #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 - #define LCD_PINS_D7 PG7 - #endif - - #endif - - // Alter timing for graphical display - #if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_CHITU3D.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_CHITU3D.h deleted file mode 100644 index 48b57b3502..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_CHITU3D.h +++ /dev/null @@ -1,283 +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 - -#if !defined(__STM32F1__) && !defined(__STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" -#endif - -/** - * 2017 Victor Perez Marlin for stm32f1 test - */ - -#define BOARD_INFO_NAME "Chitu3D" -#define DEFAULT_MACHINE_NAME "STM32F103RET6" - -// Enable I2C_EEPROM for testing -//#define I2C_EEPROM - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Steppers -// -#define X_STEP_PIN PE5 -#define X_DIR_PIN PE6 -#define X_ENABLE_PIN PC13 -#define X_MIN_PIN PG10 -#define X_MAX_PIN -1 - -#define Y_STEP_PIN PE2 -#define Y_DIR_PIN PE3 -#define Y_ENABLE_PIN PE4 -#define Y_MIN_PIN PA12 -#define Y_MAX_PIN - -#define Z_STEP_PIN PB9 -#define Z_DIR_PIN PE0 -#define Z_ENABLE_PIN PE1 -#define Z_MIN_PIN PA14 -#define Z_MAX_PIN -1 - -#define Y2_STEP_PIN -1 -#define Y2_DIR_PIN -1 -#define Y2_ENABLE_PIN -1 - -#define Z2_STEP_PIN -1 -#define Z2_DIR_PIN -1 -#define Z2_ENABLE_PIN -1 - -#define E0_STEP_PIN PB4 -#define E0_DIR_PIN PB5 -#define E0_ENABLE_PIN PB8 - - - -#define E1_STEP_PIN -1 -#define E1_DIR_PIN -1 -#define E1_ENABLE_PIN -1 - -#define E2_STEP_PIN -1 -#define E2_DIR_PIN -1 -#define E2_ENABLE_PIN -1 - -// -// Misc. Functions -// -#define SDSS -1 -#define LED_PIN -1 -#define CASE_LIGHT_PIN 8 - -#define PS_ON_PIN -1 -#define KILL_PIN PD6 // LED strip 24v - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD12 // HOT-END -#define HEATER_1_PIN -1 -#define HEATER_2_PIN -1 - -#define HEATER_BED_PIN PG11 // HOT-BED -#define HEATER_BED2_PIN -1 // BED2 -#define HEATER_BED3_PIN -1 // BED3 - -#ifndef FAN_PIN - #define FAN_PIN PG14 // MAIN BOARD FAN -#endif - -#define FAN_SOFT_PWM - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA0 // Analog Input -#define TEMP_0_PIN PA1 // Analog Input -#define TEMP_1_PIN -1 // Analog Input -#define TEMP_2_PIN -1 // Analog Input - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #else - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - #endif - - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h deleted file mode 100644 index d55bdcc150..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h +++ /dev/null @@ -1,189 +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 - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "FYSETC AIO II" -#define BOARD_WEBSITE_URL "fysetc.com" - -#define DISABLE_JTAG - -#define pins_v2_20190128 // geo-f:add for new pins define - -// 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 -// -#define X_STOP_PIN PA1 -#define Y_STOP_PIN PA0 -#define Z_STOP_PIN PB14 - -// -// Filament runout -// -#ifdef pins_v2_20190128 - #define FIL_RUNOUT_PIN PB15 -#else - #define FIL_RUNOUT_PIN PB5 -#endif - -// -// Steppers -// -#define X_STEP_PIN PB8 -#define X_DIR_PIN PB9 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PB2 -#ifdef pins_v2_20190128 - #define Y_DIR_PIN PB3 -#else - #define Y_DIR_PIN PB0 -#endif -#define Y_ENABLE_PIN PB1 - -#define Z_STEP_PIN PC0 -#define Z_DIR_PIN PC1 -#define Z_ENABLE_PIN PC2 - -#define E0_STEP_PIN PC15 -#define E0_DIR_PIN PC14 -#define E0_ENABLE_PIN PC13 - -// -// Stepper current PWM -// - -// X:PA2 Y:PA3 Z:PB12 E:PB13 // changed for test -//#define MOTOR_CURRENT_PWM_XY_PIN PA3 -//#define MOTOR_CURRENT_PWM_Z_PIN PA2 // PB12 -//#define MOTOR_CURRENT_PWM_XY_PIN PB6 -//#define MOTOR_CURRENT_PWM_Z_PIN PB7 // PB12 -//#define MOTOR_CURRENT_PWM_E_PIN -1 // PB13 -// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range -#ifndef MOTOR_CURRENT_PWM_RANGE - #define MOTOR_CURRENT_PWM_RANGE 1500 // geo-f:old 2000 -#endif -#define DEFAULT_PWM_MOTOR_CURRENT {500, 500, 400} // geo-f:old 1300 1300 1250 - -// 采用 SDIO PCB从左到右数 -// 1:PC10 - SDIO_D2 -// 2:PC11 - SDIO_D3 -// 3:PD2 - SDIO_CMD -// 4:VCC -// 5:PC12 - SDIO_CK -// 6:VDD -// 7:PC8 - SDIO_D0 -// 8:PC9 - SDIO_D1 -// 9:PA15 - SD_DETECT_PIN - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC7 -#define HEATER_BED_PIN PC6 -#ifndef FAN_PIN - #define FAN_PIN PC8 -#endif - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PC5 // Analog Input -#define TEMP_0_PIN PC4 // Analog Input - -// -// Misc. Functions -// -#define SDSS PA4 - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #define BEEPER_PIN PC9 - - #if HAS_GRAPHICAL_LCD - - #define DOGLCD_A0 PA15 - #ifdef pins_v2_20190128 - #define DOGLCD_CS PB5 - #else - #define DOGLCD_CS PB7 - #endif - - //#define LCD_CONTRAST_INIT 190 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #endif - - // not connected to a pin - #define SD_DETECT_PIN PC3 - - #if ENABLED(NEWPANEL) - // The encoder and click button - #define BTN_EN1 PC10 - #define BTN_EN2 PC11 - #define BTN_ENC PC12 - #endif - - #ifdef pins_v2_20190128 - #define LCD_RESET_PIN PB4 - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PB0 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PB6 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PB7 - #endif - #else - #define LCD_RESET_PIN PB6 - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PB3 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PB4 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PB5 - #endif - #endif - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h deleted file mode 100644 index 28b37cc841..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h +++ /dev/null @@ -1,151 +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 - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define DEFAULT_MACHINE_NAME "3D Printer" - -#define BOARD_INFO_NAME "FYSETC Cheetah" -#define BOARD_WEBSITE_URL "fysetc.com" - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -#define DISABLE_JTAG - -#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 -// -#define SERVO0_PIN PA0 - -// -// Limit Switches -// -#define X_STOP_PIN PA1 -#define Y_STOP_PIN PB4 -#define Z_STOP_PIN PA15 - -// -// Filament runout -// -#define FIL_RUNOUT_PIN PB5 - -// -// Steppers -// -#define X_STEP_PIN PB8 -#define X_DIR_PIN PB9 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PB2 -#define Y_DIR_PIN PB3 -#define Y_ENABLE_PIN PB1 - -#define Z_STEP_PIN PC0 -#define Z_DIR_PIN PC1 -#define Z_ENABLE_PIN PC2 - -#define E0_STEP_PIN PC15 -#define E0_DIR_PIN PC14 -#define E0_ENABLE_PIN PC13 - -#define X_HARDWARE_SERIAL MSerial2 -#define Y_HARDWARE_SERIAL MSerial2 -#define Z_HARDWARE_SERIAL MSerial2 -#define E0_HARDWARE_SERIAL MSerial2 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC6 -#define HEATER_BED_PIN PC7 -#ifndef FAN_PIN - #define FAN_PIN PC8 -#endif - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PC5 // Analog Input -#define TEMP_0_PIN PC4 // Analog Input - -// -// Misc. Functions -// -#define SDSS PA4 - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #define BEEPER_PIN PC9 - - #if HAS_GRAPHICAL_LCD - #define DOGLCD_A0 PB14 - #define DOGLCD_CS PB12 - #define DOGLCD_SCK PB13 - #define DOGLCD_MOSI PB15 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - - #if EITHER(FYSETC_MINI_12864, U8GLIB_ST7920) - #define FORCE_SOFT_SPI - #endif - #endif - - #define LCD_PINS_RS PB12 // CS -- SOFT SPI for ENDER3 LCD - #define LCD_PINS_D4 PB13 // SCLK - #define LCD_PINS_ENABLE PB15 // DATA MOSI - - // not connected to a pin - #define SD_DETECT_PIN PC3 - - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PB0 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PB7 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PB6 - #endif - - //#define LCD_CONTRAST_INIT 190 - - #if ENABLED(NEWPANEL) - #define BTN_EN1 PC11 - #define BTN_EN2 PC10 - #define BTN_ENC PC12 - #endif - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h deleted file mode 100644 index 236bb17f61..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h +++ /dev/null @@ -1,64 +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 - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#include "pins_FYSETC_CHEETAH.h" - -#undef X_HARDWARE_SERIAL -#undef Y_HARDWARE_SERIAL -#undef Z_HARDWARE_SERIAL -#undef E0_HARDWARE_SERIAL - -#undef RGB_LED_R_PIN -#undef RGB_LED_G_PIN -#undef RGB_LED_B_PIN - -#define FAN1_PIN PB0 // Fan1 - -#if HAS_TMC220x - - /** - * TMC2208/TMC2209 stepper drivers - */ - - // - // Software serial - // - #define X_SERIAL_TX_PIN PA11 - #define X_SERIAL_RX_PIN PA12 - - #define Y_SERIAL_TX_PIN PB6 - #define Y_SERIAL_RX_PIN PB7 - - #define Z_SERIAL_TX_PIN PB10 - #define Z_SERIAL_RX_PIN PB11 - - #define E0_SERIAL_TX_PIN PA2 - #define E0_SERIAL_RX_PIN PA3 - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_S6.h deleted file mode 100644 index 227fe4cd55..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ /dev/null @@ -1,238 +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 - -#ifndef STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA32 supports up to 3 hotends / E-steppers." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "FYSETC_S6" -#endif -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#endif - -// change the prio to 3 , 2 is for software serial -//#define TEMP_TIMER_IRQ_PRIO 3 - -// -// EEPROM Emulation -// -#define FLASH_EEPROM_EMULATION -//#define SRAM_EEPROM_EMULATION - -// -// Limit Switches -// -#define X_MIN_PIN PB14 -#define X_MAX_PIN PA1 -#define Y_MIN_PIN PB13 -#define Y_MAX_PIN PA2 -#define Z_MIN_PIN PA0 -#define Z_MAX_PIN PA3 - -// -// Servos -// share with Z_MAX_PIN -// -#define SERVO0_PIN PA3 - -// -// Steppers -// -#define X_STEP_PIN PE11 -#define X_DIR_PIN PE10 -#define X_ENABLE_PIN PE12 -#define X_CS_PIN PE7 - -#define Y_STEP_PIN PD8 -#define Y_DIR_PIN PB12 -#define Y_ENABLE_PIN PD9 -#define Y_CS_PIN PE15 - -#define Z_STEP_PIN PD14 -#define Z_DIR_PIN PD13 -#define Z_ENABLE_PIN PD15 -#define Z_CS_PIN PD10 - -#define E0_STEP_PIN PD5 -#define E0_DIR_PIN PD6 -#define E0_ENABLE_PIN PD4 -#define E0_CS_PIN PD7 - -#define E1_STEP_PIN PE6 -#define E1_DIR_PIN PC13 -#define E1_ENABLE_PIN PE5 -#define E1_CS_PIN PC14 - -#define E2_STEP_PIN PE2 -#define E2_DIR_PIN PE4 -#define E2_ENABLE_PIN PE3 -#define E2_CS_PIN PC15 - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - */ - - // - // Software serial - // - #define X_SERIAL_TX_PIN PE9 - #define X_SERIAL_RX_PIN PE8 - - #define Y_SERIAL_TX_PIN PE14 - #define Y_SERIAL_RX_PIN PE13 - - #define Z_SERIAL_TX_PIN PD11 - #define Z_SERIAL_RX_PIN PD12 - - #define E0_SERIAL_TX_PIN PD3 - #define E0_SERIAL_RX_PIN PA15 - - #define E1_SERIAL_TX_PIN PC4 - #define E1_SERIAL_RX_PIN PC5 - - #define E2_SERIAL_TX_PIN PE1 - #define E2_SERIAL_RX_PIN PE0 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC0 -#define TEMP_1_PIN PC1 -#define TEMP_2_PIN PC2 -#define TEMP_BED_PIN PC3 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB3 -#define HEATER_1_PIN PB4 -#define HEATER_2_PIN PB15 -#define HEATER_BED_PIN PC8 - -#define FAN_PIN PB0 -#define FAN1_PIN PB1 -#define FAN2_PIN PB2 - -// -// SPI -// -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -// -// Misc. Functions -// -//#define LED_PIN PB14 -//#define BTN_PIN PC10 -//#define PS_ON_PIN PE11 -//#define KILL_PIN PC5 - -#define SDSS PA4 - -// -// LCD / Controller -// - -#define BEEPER_PIN PC9 -#define SD_DETECT_PIN PB10 - -#if ENABLED(FYSETC_MINI_12864) - // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - // - #define DOGLCD_A0 PD2 - #define DOGLCD_CS PC11 - - //#define LCD_BACKLIGHT_PIN -1 - //#define KILL_PIN -1 - - #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. - // Seems to work best if left open. - - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PC12 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PD0 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PD1 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PC12 - #endif - -#elif HAS_GRAPHICAL_LCD - #define LCD_PINS_RS PD2 - #define LCD_PINS_ENABLE PC11 - #define LCD_PINS_D4 PC10 - #define LCD_PINS_D5 PC12 - #define LCD_PINS_D6 PD0 - #define LCD_PINS_D7 PD1 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS PC12 - #define DOGLCD_A0 PD0 - #endif - -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 PC6 - #define BTN_EN2 PC7 - #define BTN_ENC PA8 -#endif - -// Alter timing for graphical display -#if HAS_GRAPHICAL_LCD - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(103) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(51) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(642) - #endif -#endif - -#ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PB6 -#endif -#ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PB5 -#endif -#ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PB7 -#endif -#ifndef RGB_LED_W_PIN - #define RGB_LED_W_PIN -1 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h deleted file mode 100644 index a55bd34bcb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h +++ /dev/null @@ -1,190 +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 - -/** - * 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 - #error "STM32F4 supports up to 2 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "Misc. STM32F4" -#define DEFAULT_MACHINE_NAME "STM32F407VET6" - -//#define I2C_EEPROM - -#ifndef E2END - #define E2END 0xFFF // 4KB -#endif - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_MIN_PIN PE0 -#define X_MAX_PIN -1 -#define Y_MIN_PIN PE1 -#define Y_MAX_PIN -1 -#define Z_MIN_PIN PE14 -#define Z_MAX_PIN -1 - -// -// Z Probe (when not Z_MIN_PIN) -// - -//#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PA4 -//#endif - -// -// Steppers -// - -#define X_STEP_PIN PD3 -#define X_DIR_PIN PD2 -#define X_ENABLE_PIN PD0 -//#ifndef X_CS_PIN -// #define X_CS_PIN PD1 -//#endif - -#define Y_STEP_PIN PE11 -#define Y_DIR_PIN PE10 -#define Y_ENABLE_PIN PE13 -//#ifndef Y_CS_PIN -// #define Y_CS_PIN PE12 -//#endif - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD7 -#define Z_ENABLE_PIN PD4 -//#ifndef Z_CS_PIN -// #define Z_CS_PIN PD5 -//#endif - -#define E0_STEP_PIN PB5 -#define E0_DIR_PIN PB6 -#define E0_ENABLE_PIN PB3 -//#ifndef E0_CS_PIN -// #define E0_CS_PIN PB4 -//#endif - -#define E1_STEP_PIN PE4 -#define E1_DIR_PIN PE2 -#define E1_ENABLE_PIN PE3 -//#ifndef E1_CS_PIN -// #define E1_CS_PIN PE5 -//#endif - -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -// -// Temperature Sensors -// - -#define TEMP_0_PIN PC0 // Analog Input -#define TEMP_1_PIN PC1 // Analog Input -#define TEMP_BED_PIN PC2 // Analog Input - -// -// Heaters / Fans -// - -#define HEATER_0_PIN PA1 -#define HEATER_1_PIN PA2 -#define HEATER_BED_PIN PA0 - -#ifndef FAN_PIN - #define FAN_PIN PC6 -#endif -#define FAN1_PIN PC7 -#define FAN2_PIN PC8 - -#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN - -// -// Misc. Functions -// - -//#define CASE_LIGHT_PIN_CI PF13 -//#define CASE_LIGHT_PIN_DO PF14 -//#define NEOPIXEL_PIN PF13 - -// -// Průša i3 MK2 Multi Material Multiplexer Support -// - -//#define E_MUX0_PIN PG3 -//#define E_MUX1_PIN PG4 - -// -// Servos -// - -//#define SERVO0_PIN PE13 -//#define SERVO1_PIN PE14 - - -#define SDSS PE7 -#define SS_PIN PE7 -#define LED_PIN PB7 //Alive -#define PS_ON_PIN PA10 -#define KILL_PIN PA8 -#define PWR_LOSS PA4 //Power loss / nAC_FAULT - -// -// LCD / Controller -// - -#define SD_DETECT_PIN PA15 -#define BEEPER_PIN PC9 -#define LCD_PINS_RS PE9 -#define LCD_PINS_ENABLE PE8 -#define LCD_PINS_D4 PB12 -#define LCD_PINS_D5 PB13 -#define LCD_PINS_D6 PB14 -#define LCD_PINS_D7 PB15 -#define BTN_EN1 PC4 -#define BTN_EN2 PC5 -#define BTN_ENC PC3 - -// -// Filament runout -// - -#define FIL_RUNOUT_PIN PA3 - -// -// ST7920 Delays -// -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI.h deleted file mode 100644 index 36d7377ffa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI.h +++ /dev/null @@ -1,230 +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 - -/** - * 24 May 2018 - @chepo for STM32F103VET6 - * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "GTM32 Pro VB" -#define DEFAULT_MACHINE_NAME "STM32F103VET6" - -//#define DISABLE_DEBUG - -// -// It is required to disable JTAG function because its pins are -// used as GPIO to drive the Y axis stepper. -// DO NOT ENABLE! -// -#define DISABLE_JTAG - -// -// If you don't need the SWDIO functionality (any more), you may -// disable SWD here to regain PA13/PA14 pins for other use. -// -//#define DISABLE_JTAGSWD - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// Enable EEPROM Emulation for this board as it doesn't have EEPROM -#define FLASH_EEPROM_EMULATION -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_MIN_PIN PE5 // ENDSTOPS 15,17 -#define X_MAX_PIN PE4 // ENDSTOPS 16,18 -#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 -#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 -#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 -#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PD13 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PA12 -#define Y_DIR_PIN PA11 -#define Y_ENABLE_PIN PA15 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PB3 - -// Extruder stepper pins -// NOTE: Numbering here is made according to EXT connector numbers, -// the FANx_PWM line numbering in the schematics is reverse. -// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step -// stick that drives the EXT0 output on the board. -// -#define E0_STEP_PIN PC14 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PC15 - -#define E1_STEP_PIN PA0 -#define E1_DIR_PIN PB6 -#define E1_ENABLE_PIN PA1 - -#define E2_STEP_PIN PB2 -#define E2_DIR_PIN PB11 -#define E2_ENABLE_PIN PC4 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB0 // EXT0 port -#define HEATER_1_PIN PB5 // EXT1 port -#define HEATER_2_PIN PB4 // EXT2 port -#define HEATER_BED_PIN PB1 // CON2X3 hotbed port - -// -// These are FAN PWM pins on EXT0..EXT2 connectors. -// -//#define FAN_PIN PB9 // EXT0 port -#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan -#define FAN1_PIN PB8 // EXT1 port -#define FAN2_PIN PB7 // EXT2 port - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 // EXT0 port -#define TEMP_1_PIN PC1 // EXT1 port -#define TEMP_2_PIN PC0 // EXT2 port -#define TEMP_BED_PIN PC3 // CON2X3 hotbed port - -// -// Misc. Functions -// -#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - // - // LCD display on J2 FFC40 - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // - #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE PE14 // SID (MOSI) - #define LCD_PINS_D4 PD8 // SCK (CLK) clock - #define LCD_PINS_D5 PD9 - #define LCD_PINS_D6 PD10 - #define LCD_PINS_D7 PE15 - - #else - // - // Serial LCDs can be implemented in ExtUI - // - //#define LCD_UART_TX PD8 - //#define LCD_UART_RX PD9 - #endif - - #if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif - -#endif // HAS_SPI_LCD - -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - // - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // connected with a flat wire to J2 connector on the board. - // - #define BTN_EN1 PE8 - #define BTN_EN2 PE9 - #define BTN_ENC PE13 - - #define GTM32_PRO_VB_USE_LCD_BEEPER - #define GTM32_PRO_VB_USE_EXT_SDCARD -#endif - -// -// Beeper -// -#ifdef GTM32_PRO_VB_USE_LCD_BEEPER - // This is pin 32 on J2 FFC40 and pin, goes to the beeper - // on Geeetech's version of RepRapDiscount Smart Controller - // (e.g. on Rostock 301) - #define BEEPER_PIN PE12 -#else - // This is the beeper on the board itself - #define BEEPER_PIN PB10 -#endif - -/** - * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. - * - * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) - * connector, which usually go to the SD Card slot on the Geeetech version of the - * RepRapDiscount Smart Controller. Both connectors have the card detect signal. - * - * The on-board SD card and the external card (on either SD_CARD or J2) are two - * separate devices and can work simultaneously. Unfortunately, Marlin only supports - * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. - */ -#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) - // - // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector - // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 - #define SD_DETECT_PIN PC7 -#else - // - // Use the on-board card socket labeled TF_CARD_SOCKET - // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 - #define SD_DETECT_PIN -1 // Card detect is not connected -#endif - -#define SDSS SS_PIN - -// -// ESP WiFi can be soldered to J9 connector which is wired to USART2. -// Must define WIFISUPPORT in Configuration.h for the printer. -// -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h deleted file mode 100644 index c4b7b37b94..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h +++ /dev/null @@ -1,230 +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 - -/** - * 24 May 2018 - @chepo for STM32F103VET6 - * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "GTM32 Pro VB" -#define DEFAULT_MACHINE_NAME "STM32F103VET6" - -//#define DISABLE_DEBUG - -// -// It is required to disable JTAG function because its pins are -// used as GPIO to drive the Y axis stepper. -// DO NOT ENABLE! -// -#define DISABLE_JTAG - -// -// If you don't need the SWDIO functionality (any more), you may -// disable SWD here to regain PA13/PA14 pins for other use. -// -//#define DISABLE_JTAGSWD - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// Enable EEPROM Emulation for this board as it doesn't have EEPROM -#define FLASH_EEPROM_EMULATION -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_MIN_PIN PE5 // ENDSTOPS 15,17 -#define X_MAX_PIN PE4 // ENDSTOPS 16,18 -#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 -#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 -#define Z_MIN_PIN PE0 // ENDSTOPS 3,5 -#define Z_MAX_PIN PE1 // ENDSTOPS 4,6 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PD13 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PA12 -#define Y_DIR_PIN PA11 -#define Y_ENABLE_PIN PA15 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PB3 - -// Extruder stepper pins -// NOTE: Numbering here is made according to EXT connector numbers, -// the FANx_PWM line numbering in the schematics is reverse. -// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step -// stick that drives the EXT0 output on the board. -// -#define E0_STEP_PIN PC14 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PC15 - -#define E1_STEP_PIN PA0 -#define E1_DIR_PIN PB6 -#define E1_ENABLE_PIN PA1 - -#define E2_STEP_PIN PB2 -#define E2_DIR_PIN PB11 -#define E2_ENABLE_PIN PC4 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB0 // EXT0 port -#define HEATER_1_PIN PB5 // EXT1 port -#define HEATER_2_PIN PB4 // EXT2 port -#define HEATER_BED_PIN PB1 // CON2X3 hotbed port - -// -// These are FAN PWM pins on EXT0..EXT2 connectors. -// -//#define FAN_PIN PB9 // EXT0 port -#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan -#define FAN1_PIN PB8 // EXT1 port -#define FAN2_PIN PB7 // EXT2 port - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 // EXT0 port -#define TEMP_1_PIN PC1 // EXT1 port -#define TEMP_2_PIN PC0 // EXT2 port -#define TEMP_BED_PIN PC3 // CON2X3 hotbed port - -// -// Misc. Functions -// -#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - // - // LCD display on J2 FFC40 - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // connected with a flat wire to J2 connector on the board. - // - #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE PE14 // SID (MOSI) - #define LCD_PINS_D4 PD8 // SCK (CLK) clock - #define LCD_PINS_D5 PD9 - #define LCD_PINS_D6 PD10 - #define LCD_PINS_D7 PE15 - - #define BTN_EN1 PE8 - #define BTN_EN2 PE9 - #define BTN_ENC PE13 - - #define GTM32_PRO_VB_USE_LCD_BEEPER - #define GTM32_PRO_VB_USE_EXT_SDCARD - - #else - // - // Serial LCDs can be implemented in ExtUI - // - //#define LCD_UART_TX PD8 - //#define LCD_UART_RX PD9 - #endif - - #if HAS_GRAPHICAL_LCD - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif - #endif - -#endif // HAS_SPI_LCD - -// -// Beeper -// -#ifdef GTM32_PRO_VB_USE_LCD_BEEPER - // This is pin 32 on J2 FFC40 and pin, goes to the beeper - // on Geeetech's version of RepRapDiscount Smart Controller - // (e.g. on Rostock 301) - #define BEEPER_PIN PE12 -#else - // This is the beeper on the board itself - #define BEEPER_PIN PB10 -#endif - -/** - * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. - * - * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) - * connector, which usually go to the SD Card slot on the Geeetech version of the - * RepRapDiscount Smart Controller. Both connectors have the card detect signal. - * - * The on-board SD card and the external card (on either SD_CARD or J2) are two - * separate devices and can work simultaneously. Unfortunately, Marlin only supports - * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. - */ -#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) - // - // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector - // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 - #define SD_DETECT_PIN PC7 -#else - // - // Use the on-board card socket labeled TF_CARD_SOCKET - // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 - #define SD_DETECT_PIN -1 // Card detect is not connected -#endif - -#define SDSS SS_PIN - -// -// ESP WiFi can be soldered to J9 connector which is wired to USART2. -// Must define WIFISUPPORT in Configuration.h for the printer. -// -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h deleted file mode 100644 index 36d7377ffa..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h +++ /dev/null @@ -1,230 +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 - -/** - * 24 May 2018 - @chepo for STM32F103VET6 - * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "GTM32 Pro VB" -#define DEFAULT_MACHINE_NAME "STM32F103VET6" - -//#define DISABLE_DEBUG - -// -// It is required to disable JTAG function because its pins are -// used as GPIO to drive the Y axis stepper. -// DO NOT ENABLE! -// -#define DISABLE_JTAG - -// -// If you don't need the SWDIO functionality (any more), you may -// disable SWD here to regain PA13/PA14 pins for other use. -// -//#define DISABLE_JTAGSWD - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// Enable EEPROM Emulation for this board as it doesn't have EEPROM -#define FLASH_EEPROM_EMULATION -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_MIN_PIN PE5 // ENDSTOPS 15,17 -#define X_MAX_PIN PE4 // ENDSTOPS 16,18 -#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 -#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 -#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 -#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PD13 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PA12 -#define Y_DIR_PIN PA11 -#define Y_ENABLE_PIN PA15 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PB3 - -// Extruder stepper pins -// NOTE: Numbering here is made according to EXT connector numbers, -// the FANx_PWM line numbering in the schematics is reverse. -// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step -// stick that drives the EXT0 output on the board. -// -#define E0_STEP_PIN PC14 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PC15 - -#define E1_STEP_PIN PA0 -#define E1_DIR_PIN PB6 -#define E1_ENABLE_PIN PA1 - -#define E2_STEP_PIN PB2 -#define E2_DIR_PIN PB11 -#define E2_ENABLE_PIN PC4 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB0 // EXT0 port -#define HEATER_1_PIN PB5 // EXT1 port -#define HEATER_2_PIN PB4 // EXT2 port -#define HEATER_BED_PIN PB1 // CON2X3 hotbed port - -// -// These are FAN PWM pins on EXT0..EXT2 connectors. -// -//#define FAN_PIN PB9 // EXT0 port -#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan -#define FAN1_PIN PB8 // EXT1 port -#define FAN2_PIN PB7 // EXT2 port - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 // EXT0 port -#define TEMP_1_PIN PC1 // EXT1 port -#define TEMP_2_PIN PC0 // EXT2 port -#define TEMP_BED_PIN PC3 // CON2X3 hotbed port - -// -// Misc. Functions -// -#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - // - // LCD display on J2 FFC40 - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // - #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE PE14 // SID (MOSI) - #define LCD_PINS_D4 PD8 // SCK (CLK) clock - #define LCD_PINS_D5 PD9 - #define LCD_PINS_D6 PD10 - #define LCD_PINS_D7 PE15 - - #else - // - // Serial LCDs can be implemented in ExtUI - // - //#define LCD_UART_TX PD8 - //#define LCD_UART_RX PD9 - #endif - - #if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif - -#endif // HAS_SPI_LCD - -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - // - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // connected with a flat wire to J2 connector on the board. - // - #define BTN_EN1 PE8 - #define BTN_EN2 PE9 - #define BTN_ENC PE13 - - #define GTM32_PRO_VB_USE_LCD_BEEPER - #define GTM32_PRO_VB_USE_EXT_SDCARD -#endif - -// -// Beeper -// -#ifdef GTM32_PRO_VB_USE_LCD_BEEPER - // This is pin 32 on J2 FFC40 and pin, goes to the beeper - // on Geeetech's version of RepRapDiscount Smart Controller - // (e.g. on Rostock 301) - #define BEEPER_PIN PE12 -#else - // This is the beeper on the board itself - #define BEEPER_PIN PB10 -#endif - -/** - * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. - * - * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) - * connector, which usually go to the SD Card slot on the Geeetech version of the - * RepRapDiscount Smart Controller. Both connectors have the card detect signal. - * - * The on-board SD card and the external card (on either SD_CARD or J2) are two - * separate devices and can work simultaneously. Unfortunately, Marlin only supports - * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. - */ -#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) - // - // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector - // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 - #define SD_DETECT_PIN PC7 -#else - // - // Use the on-board card socket labeled TF_CARD_SOCKET - // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 - #define SD_DETECT_PIN -1 // Card detect is not connected -#endif - -#define SDSS SS_PIN - -// -// ESP WiFi can be soldered to J9 connector which is wired to USART2. -// Must define WIFISUPPORT in Configuration.h for the printer. -// -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_REV_B.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_REV_B.h deleted file mode 100644 index fcb510e161..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_GTM32_REV_B.h +++ /dev/null @@ -1,232 +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 - -/** - * 24 May 2018 - @chepo for STM32F103VET6 - * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_NAME "GTM32 Pro VB" -#define DEFAULT_MACHINE_NAME "M201" - -//#define DISABLE_DEBUG - -// -// It is required to disable JTAG function because its pins are -// used as GPIO to drive the Y axis stepper. -// DO NOT ENABLE! -// -#define DISABLE_JTAG - -// -// If you don't need the SWDIO functionality (any more), you may -// disable SWD here to regain PA13/PA14 pins for other use. -// -//#define DISABLE_JTAGSWD - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// Enable EEPROM Emulation for this board as it doesn't have EEPROM -#define FLASH_EEPROM_EMULATION -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_MIN_PIN PE5 // ENDSTOPS 15,17 -#define X_MAX_PIN PE4 // ENDSTOPS 16,18 -#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 -#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 -#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 -#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PD13 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PA12 -#define Y_DIR_PIN PA11 -#define Y_ENABLE_PIN PA15 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PB3 - -// Extruder stepper pins -// NOTE: Numbering here is made according to EXT connector numbers, -// the FANx_PWM line numbering in the schematics is reverse. -// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step -// stick that drives the EXT0 output on the board. -// -#define E0_STEP_PIN PC14 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PC15 - -#define E1_STEP_PIN PA0 -#define E1_DIR_PIN PB6 -#define E1_ENABLE_PIN PA1 - -#define E2_STEP_PIN PB2 -#define E2_DIR_PIN PB11 -#define E2_ENABLE_PIN PC4 - -// -// Heaters / Fans - INFO: Extruders ports are in reverse order. Pin numbers here differ from schematic. Original firmware assumes heater, fan and temp sensor on port EXT0 PB0, PB9, PC2. -// -#define HEATER_0_PIN PB0 // EXT0 port. -#define HEATER_1_PIN PB5 // EXT1 port -#define HEATER_2_PIN PB4 // EXT2 port -#define HEATER_BED_PIN PB1 // CON2X3 hotbed port - -// -// These are FAN PWM pins on EXT0..EXT2 connectors. -// -//#define FAN_PIN PB9 // EXT0 port -#define FAN1_PIN PB8 // EXT1 port -#define FAN2_PIN PB7 // EXT2 port -#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 // EXT0 port -#define TEMP_1_PIN PC1 // EXT1 port -#define TEMP_2_PIN PC0 // EXT2 port -#define TEMP_BED_PIN PC3 // CON2X3 hotbed port - -// -// Misc. Functions -// -#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - // - // LCD display on J2 FFC40 - // Geeetech's LCD2004A Control Panel is very much like - // RepRapDiscount Smart Controller, but adds an FFC40 connector - // connected with a flat wire to J2 connector on the board. - // - #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE PE14 // SID (MOSI) - #define LCD_PINS_D4 PD8 // SCK (CLK) clock - #define LCD_PINS_D5 PD9 - #define LCD_PINS_D6 PD10 - #define LCD_PINS_D7 PE15 - - #define BTN_EN1 PE8 - #define BTN_EN2 PE9 - #define BTN_ENC PE13 - - //#define GTM32_PRO_VB_USE_LCD_BEEPER - #define GTM32_PRO_VB_USE_EXT_SDCARD - - #else - // - // Serial LCDs can be implemented in ExtUI - // - //#define LCD_UART_TX PD8 - //#define LCD_UART_RX PD9 - #endif - - #if HAS_GRAPHICAL_LCD - #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 - #endif - -#endif // HAS_SPI_LCD - -// -// Beeper -// -#ifdef GTM32_PRO_VB_USE_LCD_BEEPER - // This is pin 32 on J2 FFC40 and pin, goes to the beeper - // on Geeetech's version of RepRapDiscount Smart Controller - // (e.g. on Rostock 301) - #define BEEPER_PIN PE12 -#else - // This is the beeper on the board itself - #define BEEPER_PIN PB10 -#endif - -/** - * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. - * - * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) - * connector, which usually go to the SD Card slot on the Geeetech version of the - * RepRapDiscount Smart Controller. Both connectors have the card detect signal. - * - * The on-board SD card and the external card (on either SD_CARD or J2) are two - * separate devices and can work simultaneously. Unfortunately, Marlin only supports - * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. - */ -#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) - // - // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector - // - #define SS_PIN PB12 // PC11 - #define SCK_PIN PB13 // PC12 // PC1 - #define MOSI_PIN PB15 // PD2 // PD2 - #define MISO_PIN PB14 // PC8 - #define SD_DETECT_PIN PC7 - -#else - // - // Use the on-board card socket labeled TF_CARD_SOCKET - // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 // PA6 - #define SD_DETECT_PIN -1 // Card detect is not connected -#endif - -#define SDSS SS_PIN - -// -// ESP WiFi can be soldered to J9 connector which is wired to USART2. -// Must define WIFISUPPORT in Configuration.h for the printer. -// -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h deleted file mode 100644 index d0e082dbd0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h +++ /dev/null @@ -1,130 +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 - - /** - * ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ - * ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ - * ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ - * Pin assignments for 32-bit JGAurora A5S & A1 - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 1 || E_STEPPERS > 1 - #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue." -#endif -#define BOARD_INFO_NAME "JGAurora A5S A1 board" - -#ifndef STM32_XL_DENSITY - #define STM32_XL_DENSITY -#endif - -// #define MCU_STM32F103ZE // not yet required -// Enable EEPROM Emulation for this board, so that we don't overwrite factory data - -//#define I2C_EEPROM // AT24C64 -//#define E2END 0x7FFF // 64KB -//#define FLASH_EEPROM_EMULATION -//#define E2END 0xFFF // 4KB -//#define E2END uint32(EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE * 2) - 1) -//#define EEPROM_CHITCHAT -//#define DEBUG_EEPROM_READWRITE - -// -// Limit Switches -// -#define X_STOP_PIN PC6 -#define Y_STOP_PIN PG8 -#define Z_STOP_PIN PG7 -//#define X_MAX_PIN PC5 -//#define Y_MAX_PIN PC4 -//#define Z_MAX_PIN PB0 - -// -// Steppers -// -#define X_STEP_PIN PD6 -#define X_DIR_PIN PD3 -#define X_ENABLE_PIN PG9 - -#define Y_STEP_PIN PG12 -#define Y_DIR_PIN PG11 -#define Y_ENABLE_PIN PG13 - -#define Z_STEP_PIN PG15 -#define Z_DIR_PIN PG14 -#define Z_ENABLE_PIN PB8 - -#define E0_STEP_PIN PE2 -#define E0_DIR_PIN PB9 -#define E0_ENABLE_PIN PE3 - -#define E1_STEP_PIN PE5 -#define E1_DIR_PIN PE4 -#define E1_ENABLE_PIN PE6 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 -#define TEMP_BED_PIN PC1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PA2 -#define HEATER_BED_PIN PA3 - -#define FAN_PIN PA1 - -#define FIL_RUNOUT_PIN PC7 - -// -// LCD -// -#define LCD_BACKLIGHT_PIN PF11 -#define FSMC_CS_PIN PD7 -#define FSMC_RS_PIN PG0 - -#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT -#define FSMC_DMA_DEV DMA2 -#define FSMC_DMA_CHANNEL DMA_CH5 - -// -// SD Card -// -#define SD_DETECT_PIN PF10 - -// -// Misc. -// -#define BEEPER_PIN PC3 // use PB7 to shut up if desired -#define LED_PIN PC13 - -// -// Touch support -// -#if ENABLED(TOUCH_BUTTONS) - #define TOUCH_CS_PIN PA4 - #define TOUCH_INT_PIN PC4 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_K.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_K.h deleted file mode 100644 index 10a36d8c6f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_K.h +++ /dev/null @@ -1,177 +0,0 @@ -/** - * 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 -// -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_X.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_X.h deleted file mode 100644 index c9c1da17e8..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LERDGE_X.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * 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 -// -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LONGER3D_LK.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LONGER3D_LK.h deleted file mode 100644 index 5862449e87..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_LONGER3D_LK.h +++ /dev/null @@ -1,169 +0,0 @@ -/** - * 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 - -/** - * Longer3D LK1/LK2 & Alfawise U20/U30 (STM32F103VET6) board pin assignments - */ - -#if !defined(__STM32F1__) && !defined(STM32F1xx) - #error "Oops! Select a STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 1 || E_STEPPERS > 1 - #error "Longer3D board only supports 1 hotend / E-stepper. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "Longer3D" -#define ALFAWISE_UX0 // Common to all Longer3D STM32F1 boards (used for Open drain mosfets) - -//#define DISABLE_DEBUG // We still want to debug with STLINK... -#define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK - // Release PB4 (STEP_X_PIN) from JTAG NRST role. -// -// Limit Switches -// -#define X_MIN_PIN PC1 // pin 16 -#define X_MAX_PIN PC0 // pin 15 (Filament sensor on Alfawise setup) -#define Y_MIN_PIN PC15 // pin 9 -#define Y_MAX_PIN PC14 // pin 8 (Unused in stock Alfawise setup) -#define Z_MIN_PIN PE6 // pin 5 Standard Endstop or Z_Probe endstop function -#define Z_MAX_PIN PE5 // pin 4 (Unused in stock Alfawise setup) - // May be used for BLTouch Servo function on older variants (<= V08) - -// -// Filament Sensor -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC0 // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true) -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PB5 // pin 91 -#define X_STEP_PIN PB4 // pin 90 -#define X_DIR_PIN PB3 // pin 89 - -#define Y_ENABLE_PIN PB8 // pin 95 -#define Y_STEP_PIN PB7 // pin 93 -#define Y_DIR_PIN PB6 // pin 92 - -#define Z_ENABLE_PIN PE1 // pin 98 -#define Z_STEP_PIN PE0 // pin 97 -#define Z_DIR_PIN PB9 // pin 96 - -#define E0_ENABLE_PIN PE4 // pin 3 -#define E0_STEP_PIN PE3 // pin 2 -#define E0_DIR_PIN PE2 // pin 1 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA0 // pin 23 (Nozzle 100K/3950 thermistor) -#define TEMP_BED_PIN PA1 // pin 24 (Hot Bed 100K/3950 thermistor) - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD3 // pin 84 (Nozzle Heat Mosfet) -#define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet) - -#define FAN_PIN PA15 // pin 77 (4cm Fan) -#define FAN_SOFT_PWM // Required to avoid issues with heating or STLink -#define FAN_MIN_PWM 35 // Fan will not start in 1-30 range -#define FAN_MAX_PWM 255 - -//#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor - // Can drive a PC Buzzer, if connected between PWM and 5V pins - -#define LED_PIN PC2 // pin 17 - -// -// PWM for a servo probe -// Other servo devices are not supported on this board! -// -#if HAS_Z_SERVO_PROBE - #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V) - #define SERVO0_PWM_OD // Comment this if using PE5 - - //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0) - //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5) -#endif - -/** - * Note: Alfawise screens use various TFT controllers. Supported screens - * are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for - * other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp - * - * If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader - * init the screen. - * - * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu - * because Marlin uses the reset as a failsafe to revive a glitchy LCD. - */ - -#define LCD_RESET_PIN PC4 // pin 33 -#define LCD_BACKLIGHT_PIN PD12 // pin 59 -#define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 -#define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed - -#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT -#define FSMC_DMA_DEV DMA2 -#define FSMC_DMA_CHANNEL DMA_CH5 - -#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h -#define DOGLCD_SCK -1 - -/** - * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer - * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins - * declared below. - */ -#if ENABLED(TOUCH_BUTTONS) - #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS - #define TOUCH_SCK_PIN PB13 // pin 52 - #define TOUCH_MOSI_PIN PB14 // pin 53 - #define TOUCH_MISO_PIN PB15 // pin 54 - #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843) -#endif - -// -// Persistent Storage -// If no option is selected below the SD Card will be used -// -//#define SPI_EEPROM -#define FLASH_EEPROM_EMULATION - -#undef E2END -#if ENABLED(SPI_EEPROM) - // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits) - #define SPI_CHAN_EEPROM1 1 - #define SPI_EEPROM1_CS PC5 // pin 34 - #define EEPROM_SCK BOARD_SPI1_SCK_PIN // PA5 pin 30 - #define EEPROM_MISO BOARD_SPI1_MISO_PIN // PA6 pin 31 - #define EEPROM_MOSI BOARD_SPI1_MOSI_PIN // PA7 pin 32 - #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) - #define E2END ((16 * EEPROM_PAGE_SIZE)-1) // Limit to 64KB for now... -#elif ENABLED(FLASH_EEPROM_EMULATION) - // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) - #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) - #define E2END (EEPROM_PAGE_SIZE - 1) -#else - #define E2END (0x7FFU) // On SD, Limit to 2KB, require this amount of RAM -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MALYAN_M200.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MALYAN_M200.h deleted file mode 100644 index 87337c72b6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MALYAN_M200.h +++ /dev/null @@ -1,92 +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 - -/** - * MALYAN M200 pin assignments - */ - -#if NONE(__STM32F1__, STM32F1xx, STM32F0xx) - #error "Oops! Select an STM32 board in your IDE." -#endif - -#define BOARD_INFO_NAME "Malyan M200" - -// Enable EEPROM Emulation for this board -// This setting should probably be in configuration.h -// but it is literally the only board which uses it. -#define FLASH_EEPROM_EMULATION - -#define SDSS SS_PIN - -// Based on PWM timer usage, we have to use these timers and soft PWM for the fans -// On STM32F103: -// PB3, PB6, PB7, and PB8 can be used with pwm, which rules out TIM2 and TIM4. -// On STM32F070, 16 and 17 are in use, but 1 and 3 are available. -#undef STEP_TIMER -#undef TEMP_TIMER -#define STEP_TIMER 1 -#define TEMP_TIMER 3 - -// -// Limit Switches -// -#define X_MIN_PIN PB4 -#define Y_MIN_PIN PA15 -#define Z_MIN_PIN PB5 - -// -// Steppers -// -// X & Y enable are the same -#define X_STEP_PIN PB14 -#define X_DIR_PIN PB15 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PB12 -#define Y_DIR_PIN PB13 -#define Y_ENABLE_PIN PA8 - -#define Z_STEP_PIN PB10 -#define Z_DIR_PIN PB2 -#define Z_ENABLE_PIN PB11 - -#define E0_STEP_PIN PB0 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PB1 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA0 // Analog Input (HOTEND0 thermistor) -#define TEMP_BED_PIN PA1 // Analog Input (BED thermistor) - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB6 // HOTEND0 MOSFET -#define HEATER_BED_PIN PB7 // BED MOSFET - -#define MALYAN_FAN1_PIN PB8 // FAN1 header on board - PRINT FAN -#define MALYAN_FAN2_PIN PB3 // FAN2 header on board - CONTROLLER FAN - -#define FAN1_PIN MALYAN_FAN2_PIN diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN.h deleted file mode 100644 index 2273da994f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN.h +++ /dev/null @@ -1,158 +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 - -/** - * MKS Robin (STM32F130ZET6) board pin assignments - * - * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS Robin" - -// -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role -// -#define DISABLE_JTAG - -// -// Servos -// -#define SERVO0_PIN PC3 // XS1 - 5 -#define SERVO1_PIN PA1 // XS1 - 6 -#define SERVO2_PIN PF9 // XS2 - 5 -#define SERVO3_PIN PF8 // XS2 - 6 - -// -// Limit Switches -// -#define X_MIN_PIN PB12 -#define X_MAX_PIN PB0 -#define Y_MIN_PIN PC5 -#define Y_MAX_PIN PC4 -#define Z_MIN_PIN PA4 -#define Z_MAX_PIN PF7 - -// -// Steppers -// -#define X_ENABLE_PIN PB9 -#define X_STEP_PIN PB8 -#define X_DIR_PIN PB5 - -#define Y_ENABLE_PIN PB4 -#define Y_STEP_PIN PG15 -#define Y_DIR_PIN PG10 - -#define Z_ENABLE_PIN PD7 -#define Z_STEP_PIN PD3 -#define Z_DIR_PIN PG14 - -#define E0_ENABLE_PIN PG13 -#define E0_STEP_PIN PG8 -#define E0_DIR_PIN PA15 - -#define E1_ENABLE_PIN PA12 -#define E1_STEP_PIN PA11 -#define E1_DIR_PIN PA8 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC1 // TH1 -#define TEMP_1_PIN PC2 // TH2 -#define TEMP_BED_PIN PC0 // TB1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC7 // HEATER1 -#define HEATER_1_PIN PA6 // HEATER2 -#define HEATER_BED_PIN PC6 // HOT BED - -#define FAN_PIN PA7 // FAN - -/** - * Note: MKS Robin board is using SPI2 interface. Make sure your stm32duino library is configured accordingly - */ -//#define MAX6675_SS_PIN PE5 // TC1 - CS1 -//#define MAX6675_SS_PIN PE6 // TC2 - CS2 - -#define POWER_LOSS_PIN PA2 // PW_DET -#define PS_ON_PIN PA3 // PW_OFF -#define FIL_RUNOUT_PIN PF11 // MT_DET - -#define BEEPER_PIN PC13 -#define LED_PIN PB2 - -/** - * Note: MKS Robin TFT screens use various TFT controllers - * Supported screens are based on the ILI9341 and ST7789V (320x240), ILI9328 and 9488 are not. - * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp - * - * If the screen stays white, disable 'LCD_RESET_PIN' - * to let the bootloader init the screen. - * - * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu - * because Marlin uses the reset as a failsafe to revive a glitchy LCD. - */ -//#define LCD_RESET_PIN PF6 -#define LCD_BACKLIGHT_PIN PG11 -#define FSMC_CS_PIN PG12 // NE4 -#define FSMC_RS_PIN PF0 // A0 - -#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT -#define FSMC_DMA_DEV DMA2 -#define FSMC_DMA_CHANNEL DMA_CH5 - -#if ENABLED(TOUCH_BUTTONS) - #define TOUCH_CS_PIN PB1 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI -#endif - -// SPI1(PA7) & SPI3(PB5) not available -#define ENABLE_SPI2 - -#if ENABLED(SDIO_SUPPORT) - #define SCK_PIN PB13 // SPI2 - #define MISO_PIN PB14 // SPI2 - #define MOSI_PIN PB15 // SPI2 - #define SS_PIN -1 // PB12 is X- - #define SD_DETECT_PIN PF12 // SD_CD -#else - // SD as custom software SPI (SDIO pins) - #define SCK_PIN PC12 - #define MISO_PIN PC8 - #define MOSI_PIN PD2 - #define SS_PIN -1 - #define ONBOARD_SD_CS_PIN PC11 - #define SDSS PD2 - #define SD_DETECT_PIN -1 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h deleted file mode 100644 index da2c6967ae..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h +++ /dev/null @@ -1,139 +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 - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin Lite supports up to 1 hotends / E-steppers. Comment out this line to continue." -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "MKS Robin Lite" -#endif -#define BOARD_WEBSITE_URL "github.com/makerbase-mks" - -//#define DISABLE_DEBUG -#define DISABLE_JTAG -#define ENABLE_SPI2 - -// -// Limit Switches -// -#define X_STOP_PIN PC13 -#define Y_STOP_PIN PC0 -#define Z_MIN_PIN PC12 -#define Z_MAX_PIN PB9 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PB12 -#define X_ENABLE_PIN PB10 - -#define Y_STEP_PIN PB11 -#define Y_DIR_PIN PB2 -#define Y_ENABLE_PIN PB10 - -#define Z_STEP_PIN PB1 -#define Z_DIR_PIN PC5 -#define Z_ENABLE_PIN PB10 - -#define E0_STEP_PIN PC4 -#define E0_DIR_PIN PA5 -#define E0_ENABLE_PIN PA4 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC9 -#define FAN_PIN PA8 -#define HEATER_BED_PIN PC8 - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA1 -#define TEMP_0_PIN PA0 - -#define FIL_RUNOUT_PIN PB8 // MT_DET - -// -// LCD Pins -// -#if HAS_SPI_LCD - #define BEEPER_PIN PD2 - #define BTN_ENC PB3 - #define LCD_PINS_RS PC3 - - #define BTN_EN1 PB5 - #define BTN_EN2 PB4 - - #define LCD_PINS_ENABLE PC2 - - #if ENABLED(MKS_MINI_12864) - - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN -1 - #define DOGLCD_A0 PC1 - #define DOGLCD_CS PC2 - #define DOGLCD_SCK PB13 - #define DOGLCD_MOSI PB15 - - #else // !MKS_MINI_12864 - - #define LCD_PINS_D4 PC1 - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 -1 - #define LCD_PINS_D6 -1 - #define LCD_PINS_D7 -1 - #endif - - #endif // !MKS_MINI_12864 - -#endif // HAS_SPI_LCD - -// Motor current PWM pins -#define MOTOR_CURRENT_PWM_XY_PIN PB0 -#define MOTOR_CURRENT_PWM_Z_PIN PA7 -#define MOTOR_CURRENT_PWM_E_PIN PA6 -#define MOTOR_CURRENT_PWM_RANGE (65535/10/3.3) // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp -#define DEFAULT_PWM_MOTOR_CURRENT { 1000, 1000, 1000 } // 1.05Amp per driver, here is XY, Z and E. This values determined empirically. - -// -// SD Card -// -#define ENABLE_SPI2 -#define SD_DETECT_PIN PC10 -#define SCK_PIN PB13 -#define MISO_PIN P1B4 -#define MOSI_PIN P1B5 -#define SS_PIN PA15 - -#if HAS_GRAPHICAL_LCD - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h deleted file mode 100644 index 7be36b61fc..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h +++ /dev/null @@ -1,147 +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 - -/** - * MKS Robin MINI (STM32F130VET6) board pin assignments - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin mini supports up to 1 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS Robin mini" - -// -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG - -// -// Note: MKS Robin mini board is using SPI2 interface. -// -#define SPI_MODULE 2 - -// -// Limit Switches -// -#define X_MIN_PIN PA15 -#define X_MAX_PIN PA15 -#define Y_MIN_PIN PA12 -#define Y_MAX_PIN PA12 -#define Z_MIN_PIN PA11 -#define Z_MAX_PIN PC4 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PF11 // MT_DET -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PE4 -#define X_STEP_PIN PE3 -#define X_DIR_PIN PE2 - -#define Y_ENABLE_PIN PE1 -#define Y_STEP_PIN PE0 -#define Y_DIR_PIN PB9 - -#define Z_ENABLE_PIN PB8 -#define Z_STEP_PIN PB5 -#define Z_DIR_PIN PB4 - -#define E0_ENABLE_PIN PB3 -#define E0_STEP_PIN PD6 -#define E0_DIR_PIN PD3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC1 // TH1 -#define TEMP_BED_PIN PC0 // TB1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC3 // HEATER1 -#define HEATER_BED_PIN PA0 // HOT BED - -#define FAN_PIN PB1 // FAN - -// -// Thermocouples -// -//#define MAX6675_SS_PIN PE5 // TC1 - CS1 -//#define MAX6675_SS_PIN PE6 // TC2 - CS2 - -// -// Misc. Functions -// -#define POWER_LOSS_PIN PA2 // PW_DET -#define PS_ON_PIN PA3 // PW_OFF - -//#define LED_PIN PB2 - -// -// LCD / Controller -// -#define BEEPER_PIN PC5 -#define SD_DETECT_PIN PD12 - -/** - * Note: MKS Robin TFT screens use various TFT controllers. - * If the screen stays white, disable 'LCD_RESET_PIN' - * to let the bootloader init the screen. - */ -#if ENABLED(FSMC_GRAPHICAL_TFT) - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 - - #define LCD_RESET_PIN PF6 - #define NO_LCD_REINIT // Suppress LCD re-initialization - - #define LCD_BACKLIGHT_PIN PD13 - - #if ENABLED(TOUCH_BUTTONS) - #define TOUCH_CS_PIN PC2 - #endif -#endif - -// Motor current PWM pins -#define MOTOR_CURRENT_PWM_XY_PIN PA6 -#define MOTOR_CURRENT_PWM_Z_PIN PA7 -#define MOTOR_CURRENT_PWM_E_PIN PB0 -#define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp -#define DEFAULT_PWM_MOTOR_CURRENT { 1030, 1030, 1030 } // 1.05Amp per driver, here is XY, Z and E. This values determined empirically. - -// This is a kind of workaround in case native marlin "digipot" interface won't work. -// Required to enable related code in STM32F1/HAL.cpp -//#ifndef MKS_ROBIN_MINI_VREF_PWM -// #define MKS_ROBIN_MINI_VREF_PWM -//#endif - -//#define VREF_XY_PIN PA6 -//#define VREF_Z_PIN PA7 -//#define VREF_E1_PIN PB0 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h deleted file mode 100644 index dab92328b6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h +++ /dev/null @@ -1,134 +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 - -/** - * MKS Robin nano (STM32F130VET6) board pin assignments - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue." -#endif - -#define BOARD_INFO_NAME "MKS Robin nano" - -// -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG - -// -// Note: MKS Robin board is using SPI2 interface. -// -#define SPI_MODULE 2 - -// -// Limit Switches -// -#define X_STOP_PIN PA15 -#define Y_STOP_PIN PA12 -#define Z_MIN_PIN PA11 -#define Z_MAX_PIN PC4 - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PA4 // MT_DET -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PE4 -#define X_STEP_PIN PE3 -#define X_DIR_PIN PE2 - -#define Y_ENABLE_PIN PE1 -#define Y_STEP_PIN PE0 -#define Y_DIR_PIN PB9 - -#define Z_ENABLE_PIN PB8 -#define Z_STEP_PIN PB5 -#define Z_DIR_PIN PB4 - -#define E0_ENABLE_PIN PB3 -#define E0_STEP_PIN PD6 -#define E0_DIR_PIN PD3 - -#define E1_ENABLE_PIN PA3 -#define E1_STEP_PIN PA6 -#define E1_DIR_PIN PA1 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC1 // TH1 -#define TEMP_1_PIN PC2 // TH2 -#define TEMP_BED_PIN PC0 // TB1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC3 // HEATER1 -#define HEATER_1_PIN PB0 // HEATER2 -#define HEATER_BED_PIN PA0 // HOT BED - -#define FAN_PIN PB1 // FAN - -// -// Thermocouples -// -//#define MAX6675_SS_PIN PE5 // TC1 - CS1 -//#define MAX6675_SS_PIN PE6 // TC2 - CS2 - -// -// Misc. Functions -// -#define POWER_LOSS_PIN PA2 // PW_DET -#define PS_ON_PIN PA3 // PW_OFF - -#define LED_PIN PB2 - -// -// LCD / Controller -// -#define BEEPER_PIN PC5 -#define SD_DETECT_PIN PD12 - -/** - * Note: MKS Robin TFT screens use various TFT controllers. - * If the screen stays white, disable 'LCD_RESET_PIN' - * to let the bootloader init the screen. - */ -#if ENABLED(FSMC_GRAPHICAL_TFT) - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 - - #define LCD_RESET_PIN PF6 - #define NO_LCD_REINIT // Suppress LCD re-initialization - - #define LCD_BACKLIGHT_PIN PD13 - - #if ENABLED(TOUCH_BUTTONS) - #define TOUCH_CS_PIN PA7 - #endif -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MORPHEUS.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MORPHEUS.h deleted file mode 100644 index fd4da1ab7d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_MORPHEUS.h +++ /dev/null @@ -1,91 +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 - - /** - * 2017 Victor Perez Marlin for stm32f1 test - * 2018 Modified by Pablo Crespo for Morpheus Board (https://github.com/pscrespo/Morpheus-STM32) - */ - -/** - * MORPHEUS Board pin assignments - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Bluepill based board" - -// -// Limit Switches -// -#define X_MIN_PIN PB14 -#define Y_MIN_PIN PB13 -#define Z_MIN_PIN PB12 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PB9 -#endif - -// -// Steppers -// -// X & Y enable are the same -#define X_STEP_PIN PB7 -#define X_DIR_PIN PB6 -#define X_ENABLE_PIN PB8 - -#define Y_STEP_PIN PB5 -#define Y_DIR_PIN PB4 -#define Y_ENABLE_PIN PB8 - -#define Z_STEP_PIN PA15 -#define Z_DIR_PIN PA10 -#define Z_ENABLE_PIN PB3 - -#define E0_STEP_PIN PA8 -#define E0_DIR_PIN PB15 -#define E0_ENABLE_PIN PA9 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PB1 // Analog Input (HOTEND thermistor) -#define TEMP_BED_PIN PB0 // Analog Input (BED thermistor) - -// -// Heaters / Fans -// -#define HEATER_0_PIN PA2 // HOTEND MOSFET -#define HEATER_BED_PIN PA0 // BED MOSFET - -#define FAN_PIN PA1 // FAN1 header on board - PRINT FAN - -// -// Misc. -// -#define LED_PIN PC13 -#define SDSS PA3 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_REMRAM_V1.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_REMRAM_V1.h deleted file mode 100644 index aa9d6ea178..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_REMRAM_V1.h +++ /dev/null @@ -1,133 +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 - -#ifndef STM32F7xx - #error "Oops! Select an STM32F7 board in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RemRam v1" -#define DEFAULT_MACHINE_NAME "RemRam" - -#define SRAM_EEPROM_EMULATION // Emulate the EEPROM using Backup SRAM - -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "RemRam supports only one hotend / E-stepper." -#endif - -// -// Limit Switches -// -#if DISABLED(SENSORLESS_HOMING) - #define X_MIN_PIN 58 - #define X_MAX_PIN 59 - #define Y_MIN_PIN 60 - #define Y_MAX_PIN 61 - #define Z_MIN_PIN 62 - #define Z_MAX_PIN 63 -#else - #define X_STOP_PIN 36 - #define Y_STOP_PIN 39 - #define Z_MIN_PIN 62 - #define Z_MAX_PIN 42 -#endif - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 26 // EXT_D1 -#endif - -// -// Steppers -// -#define X_STEP_PIN 22 -#define X_DIR_PIN 35 -#define X_ENABLE_PIN 34 -#define X_CS_PIN 14 - -#define Y_STEP_PIN 23 -#define Y_DIR_PIN 38 -#define Y_ENABLE_PIN 37 -#define Y_CS_PIN 15 - -#define Z_STEP_PIN 24 -#define Z_DIR_PIN 41 -#define Z_ENABLE_PIN 40 -#define Z_CS_PIN 16 - -#define E0_STEP_PIN 25 -#define E0_DIR_PIN 44 -#define E0_ENABLE_PIN 43 -#define E0_CS_PIN 10 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 64 // THERM_1 -#define TEMP_1_PIN 65 // THERM_2 -#define TEMP_BED_PIN 66 // THERM_3 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 33 -#define HEATER_BED_PIN 31 - -#ifndef FAN_PIN - #define FAN_PIN 30 // "FAN1" -#endif -#define FAN1_PIN 32 // "FAN2" - -#define ORIG_E0_AUTO_FAN_PIN 32 // Use this by NOT overriding E0_AUTO_FAN_PIN - -// -// Servos -// -#define SERVO0_PIN 26 // PWM_EXT1 -#define SERVO1_PIN 27 // PWM_EXT2 - -#define SDSS 57 // Onboard SD card reader -//#define SDSS 9 // LCD SD card reader -#define LED_PIN 21 // STATUS_LED - -// -// LCD / Controller -// -#define SD_DETECT_PIN 56 // SD_CARD_DET -#define BEEPER_PIN 46 // LCD_BEEPER -#define LCD_PINS_RS 49 // LCD_RS -#define LCD_PINS_ENABLE 48 // LCD_EN -#define LCD_PINS_D4 50 // LCD_D4 -#define LCD_PINS_D5 51 // LCD_D5 -#define LCD_PINS_D6 52 // LCD_D6 -#define LCD_PINS_D7 53 // LCD_D7 -#define BTN_EN1 54 // BTN_EN1 -#define BTN_EN2 55 // BTN_EN2 -#define BTN_ENC 47 // BTN_ENC - -// -// Timers -// - -#define STEP_TIMER 2 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_RUMBA32.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_RUMBA32.h deleted file mode 100644 index 26b4540c2b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_RUMBA32.h +++ /dev/null @@ -1,130 +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 - -#ifndef STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA32 supports up to 3 hotends / E-steppers." -#endif - -#define RUMBA32_V1_0 -#define BOARD_INFO_NAME "RUMBA32" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -//#define I2C_EEPROM -#define E2END 0xFFF // 4KB - -// -// Limit Switches -// -#define X_MIN_PIN PB12 -#define X_MAX_PIN PB13 -#define Y_MIN_PIN PB15 -#define Y_MAX_PIN PD8 -#define Z_MIN_PIN PD9 -#define Z_MAX_PIN PD10 - -// -// Steppers -// -#define X_STEP_PIN PA0 -#define X_DIR_PIN PC15 -#define X_ENABLE_PIN PC11 -#define X_CS_PIN PC14 - -#define Y_STEP_PIN PE5 -#define Y_DIR_PIN PE6 -#define Y_ENABLE_PIN PE3 -#define Y_CS_PIN PE4 - -#define Z_STEP_PIN PE1 -#define Z_DIR_PIN PE2 -#define Z_ENABLE_PIN PB7 -#define Z_CS_PIN PE0 - -#define E0_STEP_PIN PB5 -#define E0_DIR_PIN PB6 -#define E0_ENABLE_PIN PC12 -#define E0_CS_PIN PC13 - -#define E1_STEP_PIN PD6 -#define E1_DIR_PIN PD7 -#define E1_ENABLE_PIN PD4 -#define E1_CS_PIN PD5 - -#define E2_STEP_PIN PD2 -#define E2_DIR_PIN PD3 -#define E2_ENABLE_PIN PD0 -#define E2_CS_PIN PD1 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC4 -#define TEMP_1_PIN PC3 -#define TEMP_2_PIN PC2 -#define TEMP_3_PIN PC1 -#define TEMP_BED_PIN PC0 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC6 -#define HEATER_1_PIN PC7 -#define HEATER_2_PIN PC8 -#define HEATER_BED_PIN PA1 - -#define FAN_PIN PC9 -#define FAN1_PIN PA8 - -// -// I2C -// -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -// -// Misc. Functions -// -#define LED_PIN PB14 -#define BTN_PIN PC10 -#define PS_ON_PIN PE11 -#define KILL_PIN PC5 - -#define SDSS PA2 -#define SD_DETECT_PIN PB0 -#define BEEPER_PIN PE8 - -// -// LCD / Controller -// -#define LCD_PINS_RS PE10 -#define LCD_PINS_ENABLE PE9 -#define LCD_PINS_D4 PE12 -#define LCD_PINS_D5 PE13 -#define LCD_PINS_D6 PE14 -#define LCD_PINS_D7 PE15 -#define BTN_EN1 PB1 -#define BTN_EN2 PB2 -#define BTN_ENC PE7 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STEVAL.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STEVAL.h deleted file mode 100644 index 062981a1ea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STEVAL.h +++ /dev/null @@ -1,150 +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 - -#ifndef STM32F4 - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#endif - -#ifndef MACHINE_NAME - #define MACHINE_NAME "STEVAL-3DP001V1" -#endif - -#undef TEMP_TIMER -#define TEMP_TIMER 9 // the Marlin default of timer 7 doesn't exist on the STM32MF401 series - -// -// Limit Switches -// -#define X_MIN_PIN 38 // PD8 X_STOP -#define X_MAX_PIN -1 -#define Y_MIN_PIN 39 // PD9 Y_STOP -#define Y_MAX_PIN -1 -#define Z_MIN_PIN 40 // PD10 Z_STOP -#define Z_MAX_PIN -1 - -// -// Z Probe (when not Z_MIN_PIN) -// -// #ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN 11 // PA4 -// #endif - -#define SCK_PIN 16 // PB13 SPI_S -#define MISO_PIN 17 // PB14 SPI_M -#define MOSI_PIN 18 // PB15 SPI_M - -// -// Steppers -// - -#define X_STEP_PIN 60 // PE14 X_PWM -#define X_DIR_PIN 61 // PE15 X_DIR -#define X_ENABLE_PIN 59 // PE13 X_RES -#define X_CS_PIN 11 // PA4 SPI_CS - -#define Y_STEP_PIN 62 // PB10 Y_PWM -#define Y_DIR_PIN 63 // PE9 Y_DIR -#define Y_ENABLE_PIN 64 // PE10 Y_RES -#define Y_CS_PIN 11 // PA4 SPI_CS - -#define Z_STEP_PIN 66 // PC6 Z_PWM -#define Z_DIR_PIN 67 // PC0 Z_DIR -#define Z_ENABLE_PIN 65 // PC15 Z_RES -#define Z_CS_PIN 11 // PA4 SPI_CS - -#define E0_STEP_PIN 70 // PD12 E1_PW -#define E0_DIR_PIN 68 // PC13 E1_DIR -#define E0_ENABLE_PIN 69 // PC14 E1_RE -#define E0_CS_PIN 11 // PA4 SPI_CS - -#define E1_STEP_PIN 72 // PE5 E2_PWM -#define E1_DIR_PIN 73 // PE6 E2_DIR -#define E1_ENABLE_PIN 71 // PE4 E2_RESE -#define E1_CS_PIN 11 // PA4 SPI_CS - -#define E2_STEP_PIN 76 // PB8 E3_PWM -#define E2_DIR_PIN 74 // PE2 E3_DIR -#define E2_ENABLE_PIN 75 // PE3 E3_RESE -#define E2_CS_PIN 11 // PA4 SPI_CS - - -// -// Temperature Sensors -// -#define TEMP_0_PIN 52 // PA0 E1_THER -#define TEMP_1_PIN 53 // PA1 E2_THER -#define TEMP_BED_PIN 50 // PC2 BED_THE - -// -// Heaters / Fans -// -#define HEATER_0_PIN 52 // PA0 E1_THER -#define HEATER_1_PIN 53 // PA1 E2_THER -#define HEATER_BED_PIN 50 // PC2 BED_THE - -#define FAN_PIN 56 // PC4 E1_FAN PWM pin, Part cooling fan -#define FAN1_PIN 57 // PC5 E2_FAN PWM pin, Extruder fan -#define FAN2_PIN 58 // PE8 E3_FAN PWM pin, Controller fan - -// -// Misc functions -// -#define SDSS 11 // PA4 SPI_CS -#define LED_PIN -1 // Heart beat -#define PS_ON_PIN -1 -#define KILL_PIN -1 -#define PWR_LOSS -1 // Power loss / nAC_FAULT - -// -// LCD / Controller -// -//#define SD_DETECT_PIN 24 // PA15 SD_CA -//#define BEEPER_PIN 23 // PC9 SDIO_D1 -//#define LCD_PINS_RS 63 // PE9 Y_DIR -//#define LCD_PINS_ENABLE 58 // PE8 E3_FAN -//#define LCD_PINS_D4 15 // PB12 SPI_C -//#define LCD_PINS_D5 16 // PB13 SPI_S -//#define LCD_PINS_D6 17 // PB14 SPI_M -//#define LCD_PINS_D7 18 // PB15 SPI_M -//#define BTN_EN1 56 // PC4 E1_FAN -//#define BTN_EN2 57 // PC5 E2_FAN -//#define BTN_ENC 51 // PC3 BED_THE - -// -// Filament runout detection -// -//#define FIL_RUNOUT_PIN 55 // PA3 BED_THE - -// -// Extension pins -// -//#define EXT0_PIN 48 // PB0 E2_HEAT -//#define EXT1_PIN 49 // PB1 E3_HEAT -//#define EXT2_PIN // PB2 -//#define EXT3_PIN 38 // PD8 X_STOP -//#define EXT4_PIN 39 // PD9 Y_STOP -//#define EXT5_PIN 40 // PD10 Z_STOP -//#define EXT6_PIN 41 // PD11 -//#define EXT7_PIN 70 // PD12 E1_PW -//#define EXT8_PIN 62 // PB10 Y_PWM -//#define EXT9_PIN // PB11 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM32F1R.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM32F1R.h deleted file mode 100644 index ccafcad1f7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM32F1R.h +++ /dev/null @@ -1,261 +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 - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -/** - * 21017 Victor Perez Marlin for stm32f1 test - */ - -#define BOARD_INFO_NAME "Misc. STM32F1R" -#define DEFAULT_MACHINE_NAME "STM32F103RET6" - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_STOP_PIN PB3 -#define Y_STOP_PIN PB4 -#define Z_STOP_PIN PB5 - -// -// Steppers -// -#define X_STEP_PIN PC0 -#define X_DIR_PIN PC1 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PC2 -#define Y_DIR_PIN PC3 -#define Y_ENABLE_PIN PA8 - -#define Z_STEP_PIN PC4 -#define Z_DIR_PIN PC5 -#define Z_ENABLE_PIN PA8 - -#define E0_STEP_PIN PC6 -#define E0_DIR_PIN PC7 -#define E0_ENABLE_PIN PA8 - -/** - * TODO: Currently using same Enable pin to all steppers. - */ - -#define E1_STEP_PIN PC8 -#define E1_DIR_PIN PC9 -#define E1_ENABLE_PIN PA8 - -#define E2_STEP_PIN PC10 -#define E2_DIR_PIN PC11 -#define E2_ENABLE_PIN PA8 - -// -// Misc. Functions -// -#define SDSS PA4 -#define LED_PIN PD2 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB0 // EXTRUDER 1 -#define HEATER_1_PIN PB1 - -#define HEATER_BED_PIN PA3 // BED - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA0 // Analog Input -#define TEMP_0_PIN PA1 // Analog Input -#define TEMP_1_PIN PA2 // Analog Input - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #else - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - #endif - - #if ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM3R_MINI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM3R_MINI.h deleted file mode 100644 index 9192ae453e..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_STM3R_MINI.h +++ /dev/null @@ -1,285 +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 - -#if !defined(__STM32F1__) && !defined(__STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" -#endif - -/** - * 21017 Victor Perez Marlin for stm32f1 test - */ - -#define BOARD_INFO_NAME "STM3R Mini" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -// Enable I2C_EEPROM for testing -#define I2C_EEPROM - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_STOP_PIN PD0 -#define Y_STOP_PIN PD1 -#define Z_STOP_PIN PD4 - -// -// Steppers -// -#define X_STEP_PIN PE1 -#define X_DIR_PIN PE0 -#define X_ENABLE_PIN PC0 - -#define Y_STEP_PIN PE3 -#define Y_DIR_PIN PE2 -#define Y_ENABLE_PIN PC1 - -#define Z_STEP_PIN PE5 -#define Z_DIR_PIN PE4 -#define Z_ENABLE_PIN PC2 - -#define E0_STEP_PIN PE7 -#define E0_DIR_PIN PE6 -#define E0_ENABLE_PIN PC3 - -#define E1_STEP_PIN PE9 -#define E1_DIR_PIN PE8 -#define E1_ENABLE_PIN PC4 - -#define E2_STEP_PIN PE11 -#define E2_DIR_PIN PE10 -#define E2_ENABLE_PIN PC5 - -// -// Misc. Functions -// -#define SDSS PA15 -#define LED_PIN PB2 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD12 // EXTRUDER 1 -//#define HEATER_1_PIN PD13 - -#define HEATER_BED_PIN PB9 // BED -//#define HEATER_BED2_PIN -1 // BED2 -//#define HEATER_BED3_PIN -1 // BED3 - -#ifndef FAN_PIN - #define FAN_PIN PD14 -#endif -#define FAN1_PIN PD13 - -#define FAN_SOFT_PWM - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA0 -#define TEMP_0_PIN PA1 -#define TEMP_1_PIN PA2 -#define TEMP_2_PIN PA3 - -// Laser control -#if HAS_CUTTER - #define SPINDLE_LASER_PWM_PIN PB8 - #define SPINDLE_LASER_ENA_PIN PD5 -#endif - -// -// LCD Pins -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #else - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 - #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - #endif - #endif - - #if ENABLED(TOUCH_BUTTONS) - - #define TOUCH_CS_PIN PB12 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 - #define TOUCH_MOSI_PIN PB14 - #define TOUCH_MISO_PIN PB15 - #define TOUCH_INT_PIN PC6 // (PenIRQ coming from ADS7843) - - #elif ENABLED(NEWPANEL) - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - - #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - - #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - - #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - - #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - - #endif - #endif // NEWPANEL - -#endif // HAS_SPI_LCD diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_THE_BORG.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_THE_BORG.h deleted file mode 100644 index 1f8569e4ea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_THE_BORG.h +++ /dev/null @@ -1,185 +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 - -#ifndef STM32F7 - #error "Oops! Select an STM32F7 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "The-Borg supports up to 3 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "The-Borge" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -#define E2END 0xFFF // EEPROM end address - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_MIN_PIN PE9 -#define X_MAX_PIN PE10 -#define Y_MIN_PIN PE7 -#define Y_MAX_PIN PE8 -#define Z_MIN_PIN PF15 -#define Z_MAX_PIN PG0 -#define E_MIN_PIN PE2 -#define E_MAX_PIN PE3 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PA4 -#endif - -// -// Steppers -// -#define STEPPER_ENABLE_PIN PE0 - -#define X_STEP_PIN PC6 // 96, 39 in Arduino -#define X_DIR_PIN PC7 -#define X_ENABLE_PIN PC8 - - -#define Y_STEP_PIN PD9 -#define Y_DIR_PIN PD10 -#define Y_ENABLE_PIN PD11 - -#define Z_STEP_PIN PE15 -#define Z_DIR_PIN PG1 -#define Z_ENABLE_PIN PD8 - - -#define E0_STEP_PIN PB1 -#define E0_DIR_PIN PB2 -#define E0_ENABLE_PIN PE11 - - -#define E1_STEP_PIN PC4 -#define E1_DIR_PIN PC5 -#define E1_ENABLE_PIN PB0 - - -#define E2_STEP_PIN PC13 -#define E2_DIR_PIN PC14 -#define E2_ENABLE_PIN PC15 - -#define Z2_STEP_PIN PC13 -#define Z2_DIR_PIN PC14 -#define Z2_ENABLE_PIN PC15 - - -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -#define SPI1_SCK_PIN PA5 -#define SPI1_MISO_PIN PA6 -#define SPI1_MOSI_PIN PA7 - -#define SPI6_SCK_PIN PG13 -#define SPI6_MISO_PIN PG12 -#define SPI6_MOSI_PIN PG14 - -// -// Temperature Sensors -// - -#define TEMP_0_PIN PC3 // Analog Input -#define TEMP_1_PIN PC2 // Analog Input -#define TEMP_2_PIN PC1 // Analog Input -#define TEMP_3_PIN PC0 // Analog Input - -#define TEMP_BED_PIN PF10 // Analog Input - -#define TEMP_5_PIN PE12 // Analog Input, Probe temp - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD15 -#define HEATER_1_PIN PD14 -#define HEATER_BED_PIN PF6 - -#ifndef FAN_PIN - #define FAN_PIN PD13 -#endif -#define FAN1_PIN PA0 -#define FAN2_PIN PA1 - -#define ORIG_E0_AUTO_FAN_PIN PA1 // Use this by NOT overriding E0_AUTO_FAN_PIN - -// -// Misc. Functions -// - -//#define CASE_LIGHT_PIN_CI PF13 -//#define CASE_LIGHT_PIN_DO PF14 -//#define NEOPIXEL_PIN PF13 - -// -// Průša i3 MK2 Multi Material Multiplexer Support -// - -#define E_MUX0_PIN PG3 -#define E_MUX1_PIN PG4 - -// -// Servos -// - -#define SERVO0_PIN PE13 -#define SERVO1_PIN PE14 - - -#define SDSS PA8 -#define SS_PIN PA8 -#define LED_PIN PA2 // Alive -#define PS_ON_PIN PA3 -#define KILL_PIN -1 //PD5 // EXP2-10 -#define PWR_LOSS PG5 // Power loss / nAC_FAULT - -// -// MAX7219_DEBUG -// -#define MAX7219_CLK_PIN PG10 // EXP1-1 -#define MAX7219_DIN_PIN PD7 // EXP1-3 -#define MAX7219_LOAD_PIN PD1 // EXP1-5 - -// -// LCD / Controller -// -//#define SD_DETECT_PIN -1 //PB6) // EXP2-4 -#define BEEPER_PIN PG10 // EXP1-1 -#define LCD_PINS_RS PG9 // EXP1-4 -#define LCD_PINS_ENABLE PD7 // EXP1-3 -#define LCD_PINS_D4 PD1 // EXP1-5 -#define LCD_PINS_D5 PF0 // EXP1-6 -#define LCD_PINS_D6 PD3 // EXP1-7 -#define LCD_PINS_D7 PD4 // EXP1-8 -#define BTN_EN1 PD6 // EXP2-5 -#define BTN_EN2 PD0 // EXP2-3 -#define BTN_ENC PG11 // EXP1-2 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_VAKE403D.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_VAKE403D.h deleted file mode 100644 index df23f3b318..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/stm32/pins_VAKE403D.h +++ /dev/null @@ -1,194 +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 - -#if !defined(STM32F4) && !defined(STM32F4xx) - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "STM32F4 supports up to 2 hotends / E-steppers." -#endif - -#define DEFAULT_MACHINE_NAME "STM32F446VET6" -#define BOARD_NAME "STM32F4 VAkE" - -//#define I2C_EEPROM - -#define E2END 0xFFF // EEPROM end address (4kB) - -// -// Servos -// -//#define SERVO0_PIN PE13 -//#define SERVO1_PIN PE14 - -// -// Limit Switches -// -#define X_STOP_PIN PE10 -#define Y_STOP_PIN PE9 -#define Z_STOP_PIN PE8 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PA4 -#endif - -// -// Filament runout -// -#define FIL_RUNOUT_PIN PA3 - -// -// Steppers -// - -#define STEPPER_ENABLE_PIN PB2 - -#define X_STEP_PIN PC6 // X_STEP -#define X_DIR_PIN PC7 // X_DIR -#define X_ENABLE_PIN PB2 // -#ifndef X_CS_PIN - #define X_CS_PIN PC8 // X_CS -#endif - -#define Y_STEP_PIN PD9 // Y_STEP -#define Y_DIR_PIN PD10 // Y_DIR -#define Y_ENABLE_PIN PB2 // -#ifndef Y_CS_PIN - #define Y_CS_PIN PD11 // Y_CS -#endif - -#define Z_STEP_PIN PE15 // Z_STEP -#define Z_DIR_PIN PB10 // Z_DIR -#define Z_ENABLE_PIN PB2 -#ifndef Z_CS_PIN - #define Z_CS_PIN PD8 -#endif - -#define E0_STEP_PIN PB1 -#define E0_DIR_PIN PB13 -#define E0_ENABLE_PIN PB2 -#ifndef E0_CS_PIN - #define E0_CS_PIN PE11 -#endif - -#define E1_STEP_PIN PC4 -#define E1_DIR_PIN PC5 -#define E1_ENABLE_PIN PB2 -#ifndef E1_CS_PIN - #define E1_CS_PIN PB0 -#endif - -#define SCK_PIN PE12 // PA5 // SPI1 for SD card -#define MISO_PIN PE13 // PA6 -#define MOSI_PIN PE14 // PA7 - -// added for SD card : optional or not ??? -//#define SD_CHIP_SELECT_PIN SDSS // The default chip select pin for the SD card is SS. -// The following three pins must not be redefined for hardware SPI. -//#define SPI_MOSI_PIN MOSI_PIN // SPI Master Out Slave In pin -//#define SPI_MISO_PIN MISO_PIN // SPI Master In Slave Out pin -//#define SPI_SCK_PIN SCK_PIN // SPI Clock pin - -// -// Temperature Sensors (Analog inputs) -// - -#define TEMP_0_PIN PC0 // Analog Input -#define TEMP_1_PIN PC1 // Analog Input -#define TEMP_2_PIN PC2 // Analog Input -#define TEMP_3_PIN PC3 // Analog Input -#define TEMP_BED_PIN PC3 // Analog Input - -// -// Heaters / Fans -// - -#define HEATER_0_PIN PD15 -#define HEATER_1_PIN PD14 -#define HEATER_BED_PIN PD12 - -#ifndef FAN_PIN - #define FAN_PIN PD13 -#endif -#define FAN1_PIN PB5 // PA0 -#define FAN2_PIN PB4 // PA1 - -#define ORIG_E0_AUTO_FAN_PIN PD13 // Use this by NOT overriding E0_AUTO_FAN_PIN - -// -// Misc. Functions -// - -//#define CASE_LIGHT_PIN_CI PF13 -//#define CASE_LIGHT_PIN_DO PF14 -//#define NEOPIXEL_PIN PF13 - -// -// Prusa i3 MK2 Multi Material Multiplexer Support -// -//#define E_MUX0_PIN PG3 -//#define E_MUX1_PIN PG4 - -#define LED_PIN PB14 // Alive -#define PS_ON_PIN PE0 -#define KILL_PIN PD5 -#define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT - -#if ENABLED(SDSUPPORT) - #define SD_DETECT_PIN PB7 - #define SS_PIN PB_15 // USD_CS -> CS for onboard SD -#endif - -// -// LCD / Controller -// -#if HAS_SPI_LCD - #if ENABLED(SDSUPPORT) - #define SDSS PB6 // CS for SD card in LCD - #endif - #define BEEPER_PIN PC9 - #define LCD_PINS_RS PC12 - #define LCD_PINS_ENABLE PD7 - #define LCD_PINS_D4 PD1 - #define LCD_PINS_D5 PD2 - #define LCD_PINS_D6 PD3 - #define LCD_PINS_D7 PD4 - #define BTN_EN1 PD6 - #define BTN_EN2 PD0 - #define BTN_ENC PB12 -#endif - -// -// 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_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_5DPRINT.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_5DPRINT.h deleted file mode 100644 index 80c6975279..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_5DPRINT.h +++ /dev/null @@ -1,148 +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 - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * 5DPrint D8 Driver board pin assignments - * - * https://bitbucket.org/makible/5dprint-d8-controller-board - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define DEFAULT_MACHINE_NAME "Makibox" -#define BOARD_INFO_NAME "5DPrint D8" - -// -// Servos -// -#define SERVO0_PIN 41 -#define SERVO1_PIN 42 -#define SERVO2_PIN 43 -#define SERVO3_PIN 44 - -// -// Limit Switches -// -#define X_STOP_PIN 37 // E5 -#define Y_STOP_PIN 36 // E4 -#define Z_STOP_PIN 19 // E7 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 17 // C7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 13 // C3 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 12 // C2 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 11 // C1 - -// -// Digital Microstepping -// -#define X_MS1_PIN 25 // B5 -#define X_MS2_PIN 26 // B6 -#define Y_MS1_PIN 9 // E1 -#define Y_MS2_PIN 8 // E0 -#define Z_MS1_PIN 7 // D7 -#define Z_MS2_PIN 6 // D6 -#define E0_MS1_PIN 5 // D5 -#define E0_MS2_PIN 4 // D4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 -#define HEATER_BED_PIN 14 // C4 - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -//DIGIPOTS slave addresses -#ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for DIGIPOT 0x2C (0x58 <- 0x2C << 1) -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE.h deleted file mode 100644 index 3c38ad0b01..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE.h +++ /dev/null @@ -1,126 +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 - -/** - * Brainwave 1.0 pin assignments (AT90USB646) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointer to a currently available Arduino IDE extension that will - * allow this board to use the latest Marlin software - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB - * This is the only known IDE extension that is compatible with the pin definitions - * in this file, Adrduino 1.6.12 and the latest mainstream Marlin software. - * - * "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share - * the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such - * that PWM1A, PWM1B & PWM1C can't be used. - * - * Installation: - * - * 1. In the Arduino IDE, under Files -> Preferences paste the following URL - * https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json - * 2. Under Tools > Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB - * and then click on "Install" - * 3. Select "AT90USB646_TEENSYPP" from the 'Tools > Board' menu. - */ - -/** - * To burn the bootloader that comes with Marlin_AT90USB: - * - * 1. Connect your programmer to the board. - * 2. In Arduino IDE select "AT90USB646_TEENSYPP" and then select the programmer. - * 3. In Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB646__ - #error "Oops! Select 'AT90USB646_TEENSYPP' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Brainwave" - -// -// Limit Switches -// -#define X_STOP_PIN 35 // A7 -#define Y_STOP_PIN 34 // A6 -#define Z_STOP_PIN 33 // A5 - -// -// Steppers -// -#define X_STEP_PIN 3 // D3 -#define X_DIR_PIN 5 // D5 -#define X_ENABLE_PIN 4 // D4 -#define X_ATT_PIN 2 // D2 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 9 // E1 -#define Y_ENABLE_PIN 8 // E0 -#define Y_ATT_PIN 6 // D6 - -#define Z_STEP_PIN 11 // C1 -#define Z_DIR_PIN 13 // C3 -#define Z_ENABLE_PIN 12 // C2 -#define Z_ATT_PIN 10 // C0 - -#define E0_STEP_PIN 15 // C5 -#define E0_DIR_PIN 17 // C7 -#define E0_ENABLE_PIN 16 // C6 -#define E0_ATT_PIN 14 // C4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input -#define TEMP_BED_PIN 6 // F6 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 32 // A4 Extruder -#define HEATER_BED_PIN 18 // E6 Bed - -#ifndef FAN_PIN - #define FAN_PIN 31 // A3 Fan -#endif - -// -// Misc. Functions -// -#define LED_PIN 19 // E7 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h deleted file mode 100644 index cd4dd33695..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h +++ /dev/null @@ -1,138 +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 - -/** - * Brainwave Pro pin assignments (AT90USB1286) - * - * Requires hardware bundle for Arduino: - * https://github.com/unrepentantgeek/brainwave-arduino - */ - -/** - * Rev B 16 JAN 2017 - * - * Added pointers to currently available Arduino IDE extensions that will - * allow this board to use the latest Marlin software - * - * - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Brainwave Pro" - -// -// Limit Switches -// -#define X_STOP_PIN 45 // F7 -#define Y_STOP_PIN 12 // C2 -#define Z_STOP_PIN 36 // E4 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 11 // C1 -#endif - -// -// Steppers -// -#define X_STEP_PIN 9 // E1 -#define X_DIR_PIN 8 // E0 -#define X_ENABLE_PIN 23 // B3 - -#define Y_STEP_PIN 7 // D7 -#define Y_DIR_PIN 6 // D6 -#define Y_ENABLE_PIN 20 // B0 - -#define Z_STEP_PIN 5 // D5 -#define Z_DIR_PIN 4 // D4 -#define Z_ENABLE_PIN 37 // E5 - -#define E0_STEP_PIN 47 // E3 -#define E0_DIR_PIN 46 // E2 -#define E0_ENABLE_PIN 25 // B5 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 2 // F2 Analog Input -#define TEMP_1_PIN 1 // F1 Analog Input -#define TEMP_BED_PIN 0 // F0 Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 27 // B7 -#define HEATER_BED_PIN 26 // B6 Bed -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 Fan, PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define SD_DETECT_PIN 24 // B4 -#define LED_PIN 13 // C3 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h deleted file mode 100644 index 6f6ba5b8c1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ /dev/null @@ -1,169 +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 - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Printrboard" - -// Disable JTAG pins so they can be used for the Extrudrboard -#define DISABLE_JTAG - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 20 // B0 SS -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_BED_PIN 0 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_1_PIN 44 // F6 -#define HEATER_2_PIN 45 // F7 -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 26 // B6 SDCS -#define FILWIDTH_PIN 2 // Analog Input - -// -// LCD / Controller -// -#if BOTH(ULTRA_LCD, NEWPANEL) - - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ANY(VIKI2, miniVIKI) - #define BEEPER_PIN 8 // E0 JP11-10 - - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #undef SDSS - #define SDSS 43 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 3 // D3 RX1 JP2-7 - #define BTN_EN2 2 // D2 TX1 JP2-5 - #define BTN_ENC 41 // F3 JP2-4 - #undef SDSS - #define SDSS 38 // F0 B-THERM connector - use SD card on Panelolu2 - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif // HAS_SPI_LCD && NEWPANEL diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h deleted file mode 100644 index 6aaa037d25..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ /dev/null @@ -1,281 +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 - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - https://www.pjrc.com/teensy/teensyduino.html - * Installation - https://www.pjrc.com/teensy/td_download.html - * - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Note: With Teensyduino extension, the Arduino IDE will report 130048 bytes of program storage space available, - * but there is actually only 122880 bytes due to the larger DFU bootloader shipped by default on all Printrboard RevF. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular and easiest option. - */ - -/** - * To burn the bootloader that comes with Printrboard HID extension: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#ifndef USBCON - #error "USBCON should be defined by the platform for this board." -#endif - -#define BOARD_INFO_NAME "Printrboard Rev.F" - -// Disable JTAG pins so EXP1 pins work correctly -// (Its pins are used for the Extrudrboard and filament sensor, for example). -#define DISABLE_JTAG - -/** - * Note that REV F6 of the Printrboard stole the A HOTEND pin and - * reassigned it to a second fan for the extruder heater. It's - * recommended that you swap the A and B outputs on the Extrudrboard - * so EXTRUDERS=2 will still work on F6, using B for E1/HEATER_1/TEMP_1. - * See https://printrbot.zendesk.com/hc/en-us/articles/115003072346 - * - * If you have REV F6 you probably also want to set E0_AUTO_FAN_PIN - * to PRINTRBOARD_F6_HEATER_FAN_PIN (44). - * - * Define NO_EXTRUDRBOARD if you don't have an EXTRUDRBOARD and wish to - * reassign different functions to EXP1. - * - * Define NO_EXTRUDRBOARD_OUTPUT_SWAP if you have a REV F5 or lower and - * want to use EXTRUDRBOARD A for E1 and EXTRUDRBOARD B for E2. - */ -//#define NO_EXTRUDRBOARD -//#define NO_EXTRUDRBOARD_OUTPUT_SWAP - -// -// Limit Switches -// -#define X_STOP_PIN 47 // E3 -#define Y_STOP_PIN 24 // B4 PWM2A -#define Z_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define E1_STEP_PIN 25 // B5 - #define E1_DIR_PIN 37 // E5 - #define E1_ENABLE_PIN 42 // F4 - - #define E2_STEP_PIN 2 // D2 - #define E2_DIR_PIN 3 // D3 - #define E2_ENABLE_PIN 43 // F5 -#else - #define E1_STEP_PIN 2 // D2 - #define E1_DIR_PIN 3 // D3 - #define E1_ENABLE_PIN 43 // F5 - - #define E2_STEP_PIN 25 // B5 - #define E2_DIR_PIN 37 // E5 - #define E2_ENABLE_PIN 42 // F4 -#endif -#endif // NO_EXTRUDRBOARD - -// Enable control of stepper motor currents with the I2C based MCP4728 DAC used on Printrboard REVF -#define DAC_STEPPER_CURRENT - -// Set default drive strength percents if not already defined - X, Y, Z, E axis -#ifndef DAC_MOTOR_CURRENT_DEFAULT - #define DAC_MOTOR_CURRENT_DEFAULT { 70, 70, 50, 70 } -#endif - -// Number of channels available for DAC -#define DAC_STEPPER_ORDER { 3, 2, 1, 0 } - -#define DAC_STEPPER_SENSE 0.11 -#define DAC_STEPPER_ADDRESS 0 -#define DAC_STEPPER_MAX 3520 -#define DAC_STEPPER_VREF 1 // internal Vref, gain 1x = 2.048V -#define DAC_STEPPER_GAIN 0 -#define DAC_OR_ADDRESS 0x00 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 1 // Analog Input (Extruder) -#define TEMP_BED_PIN 0 // Analog Input (Bed) - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define TEMP_1_PIN 2 // Analog Input (Extrudrboard A THERM) - #define TEMP_2_PIN 3 // Analog Input (Extrudrboard B THERM) -#else - #define TEMP_1_PIN 3 // Analog Input (Extrudrboard B THERM) - #define TEMP_2_PIN 2 // Analog Input (Extrudrboard A THERM) -#endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#if DISABLED(NO_EXTRUDRBOARD) -#if DISABLED(NO_EXTRUDRBOARD_OUTPUT_SWAP) - #define HEATER_1_PIN 44 // F6 - Extrudrboard A HOTEND - #define HEATER_2_PIN 45 // F7 - Extrudrboard B HOTEND -#else - #define HEATER_1_PIN 45 // F7 - Extrudrboard B HOTEND - #define HEATER_2_PIN 44 // F6 - Extrudrboard A HOTEND -#endif -#endif - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// LCD / Controller -// -//#define USE_INTERNAL_SD - -#if HAS_SPI_LCD - #define LCD_PINS_RS 9 // E1 JP11-11 - #define LCD_PINS_ENABLE 8 // E0 JP11-10 - #define LCD_PINS_D4 7 // D7 JP11-8 - #define LCD_PINS_D5 6 // D6 JP11-7 - #define LCD_PINS_D6 5 // D5 JP11-6 - #define LCD_PINS_D7 4 // D4 JP11-5 - - #if ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 8 // E0 JP11-10 - #define DOGLCD_A0 40 // F2 JP2-2 - #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 2 // D2 TX1 JP2-5 - #define BTN_EN2 3 // D3 RX1 JP2-7 - #define BTN_ENC 45 // F7 TDI JP2-12 - - #define SDSS 3 // F5 TMS JP2-8 - - #define STAT_LED_RED_PIN 12 // C2 JP11-14 - #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 - - #elif ENABLED(MINIPANEL) - - #if DISABLED(USE_INTERNAL_SD) - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define SDSS 11 // 36 C1 EXP2-13 EXP2-07 - #define SD_DETECT_PIN 9 // 34 E1 EXP2-11 EXP2-04 - #endif - - // PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. MKSLCD12864 PIN# - #define DOGLCD_A0 4 // 29 D4 EXP2-05 EXP1-04 - #define DOGLCD_CS 5 // 30 D5 EXP2-06 EXP1-05 - #define BTN_ENC 6 // 31 D6 EXP2-07 EXP1-09 - #define BEEPER_PIN 7 // 32 D7 EXP2-08 EXP1-10 - #define KILL_PIN 8 // 33 E0 EXP2-10 EXP2-03 - #define BTN_EN1 10 // 35 C0 EXP2-12 EXP2-06 - #define BTN_EN2 12 // 37 C2 EXP2-14 EXP2-08 - //#define LCD_BACKLIGHT_PIN 43 // 56 F5 EXP1-12 Not Implemented - //#define SCK 21 // 11 B1 ICSP-04 EXP2-09 - //#define MOSI 22 // 12 B2 ICSP-03 EXP2-05 - //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 - - // increase delays - #define BOARD_ST7920_DELAY_1 DELAY_NS(313) - #define BOARD_ST7920_DELAY_2 DELAY_NS(313) - #define BOARD_ST7920_DELAY_3 DELAY_NS(313) - - #else - - #define BTN_EN1 10 // C0 JP11-12 - #define BTN_EN2 11 // C1 JP11-13 - #define BTN_ENC 12 // C2 JP11-14 - - #endif - -#endif - -// -// Misc. Functions -// -// PIN FASTIO PIN# ATUSB90 PIN# Teensy2.0++ PIN# Printrboard RevF Conn. -#ifndef SDSS - #define SDSS 20 // 10 B0 -#endif - -/** - * This is EXP1-2, which is also the TEMP_A_PIN for the Extrudrboard. - * If using w/ Extrudrboard, cut off pin 2 on the Extrudrboard male - * connector to ensure this is disconnected from the A THERM pullups. - * You probably want to set EXTRUDERS=2 and swap the Extrudrboard outputs, - * which will let you use Channel B on the Extrudrboard as E1. - */ -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 2 // Analog Input -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_SAV_MKI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_SAV_MKI.h deleted file mode 100644 index 1ae186ab59..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_SAV_MKI.h +++ /dev/null @@ -1,185 +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 - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "SAV MkI" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#define DEFAULT_SOURCE_CODE_URL "https://tinyurl.com/onru38b" - -// -// Servos -// -#define SERVO0_PIN 39 // F1 In teensy's pin definition for pinMode (in servo.cpp) - -// -// Limit Switches -// -#define X_STOP_PIN 25 // B5 -#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 For inductive sensor. -//#define E_STOP_PIN 36 // E4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - Bed - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 - -// Extension header pin mapping -// ---------------------------- -// SCL (I2C)-D0 A0 (An), IO -// SDA (I2C)-D1 A1 (An), IO -// RX1-D2 A2 (An), IO -// TX1-D3 A3 (An), IO -// PWM-D24 A4 (An), IO -// 5V GND -// 12V GND -#define EXT_AUX_SCL_D0 0 // D0 PWM0B -#define EXT_AUX_SDA_D1 1 // D1 -#define EXT_AUX_RX1_D2 2 // D2 -#define EXT_AUX_TX1_D3 3 // D3 -#define EXT_AUX_PWM_D24 24 // B4 PWM2A -#define EXT_AUX_A0 0 // F0 Analog Input -#define EXT_AUX_A0_IO 38 // F0 Digital IO -#define EXT_AUX_A1 1 // F1 Analog Input -#define EXT_AUX_A1_IO 39 // F1 Digital IO -#define EXT_AUX_A2 2 // F2 Analog Input -#define EXT_AUX_A2_IO 40 // F2 Digital IO -#define EXT_AUX_A3 3 // F3 Analog Input -#define EXT_AUX_A3_IO 41 // F3 Digital IO -#define EXT_AUX_A4 4 // F4 Analog Input -#define EXT_AUX_A4_IO 42 // F4 Digital IO - -// -// LCD / Controller -// -#define BEEPER_PIN -1 -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 - -#if ENABLED(SAV_3DLCD) - // For LCD SHIFT register LCD - #define SR_DATA_PIN EXT_AUX_SDA_D1 - #define SR_CLK_PIN EXT_AUX_SCL_D0 -#endif - -#if EITHER(SAV_3DLCD, SAV_3DGLCD) - - #define BTN_EN1 EXT_AUX_A1_IO - #define BTN_EN2 EXT_AUX_A0_IO - #define BTN_ENC EXT_AUX_PWM_D24 - - #define KILL_PIN EXT_AUX_A2_IO - #define HOME_PIN EXT_AUX_A4_IO - -#else // Use the expansion header for spindle control - - // - // M3/M4/M5 - Spindle/Laser Control - // - #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A - #define SPINDLE_LASER_ENA_PIN 39 // F1 Pin should have a pullup! - #define SPINDLE_DIR_PIN 40 // F2 - - #define CASE_LIGHT_PIN 0 // D0 PWM0B - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSY2.h deleted file mode 100644 index a91a019121..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSY2.h +++ /dev/null @@ -1,185 +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 - -/** - * Rev B 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - -/** - * Teensy++ 2.0 Breadboard pin assignments (AT90USB1286) - * Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! - * http://www.pjrc.com/teensy/teensyduino.html - * See http://reprap.org/wiki/Printrboard for more info - * - * CLI build: HARDWARE_MOTHERBOARD=84 make - * - * DaveX plan for Teensylu/printrboard-type pinouts for a TeensyBreadboard: - * (ref teensylu & sprinter) - * - * USB - * GND GND |-----#####-----| +5V ATX +5SB - * ATX PS_ON PWM 27 |b7 ##### b6| 26 PWM* Stepper Enable - * PWM 0 |d0 b5| 25 PWM* - * PWM 1 |d1 b4| 24 PWM - * X_MIN 2 |d2 b3| 23 MISO_PIN - * Y_MIN 3 |d3 b2| 22 MOSI_PIN - * Z_MIN 4 |d4 * * b1| 21 SCK_PIN - * 5 |d5 e e b0| 20 SDSS - * LED 6 |d6 5 4 e7| 19 - * 7 |d7 e6| 18 - * LCD RS 8 |e0 | GND - * LCD EN 9 |e1 a4 a0 R| AREF - * LCD D4 10 |c0 a5 a1 f0| 38 A0 ENC_1 - * LCD D5 11 |c1 a6 a2 f1| 39 A1 ENC_2 - * LCD D6 12 |c2 a7 a3 f2| 40 A2 ENC_CLK - * LCD D6 13 |c3 f3| 41 A3 - * Bed Heat PWM 14 |c4 V G R f4| 42 A4 - * Extruder Heat PWM 15 |c5 c n S f5| 43 A5 - * Fan PWM 16 |c6 c d T f6| 44 A6 Bed TC - * 17 |c7 * * * f7| 45 A7 Extruder TC * 4.7k * +5 - * ----------------- - * - * Interior E4: 36, INT4 - * Interior E5: 37, INT5 - * Interior PA0-7: 28-35 -- Printrboard and Teensylu use these pins for step & direction: - * T++ PA Signal Marlin - * - * Z STEP 32 a4 a0 28 X STEP - * Z DIR 33 a5 a1 29 X DIR - * E STEP 34 a6 a2 30 Y STEP - * E DIR 35 a7 a3 31 Y DIR - */ - -#ifndef __AVR_AT90USB1286__ - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Teensy++2.0" - -// -// Limit Switches -// -#define X_STOP_PIN 2 // D2 -#define Y_STOP_PIN 3 // D3 -#define Z_STOP_PIN 4 // D4 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 Marlin -#define X_DIR_PIN 29 // A1 Marlin -#define X_ENABLE_PIN 26 // B6 - -#define Y_STEP_PIN 30 // A2 Marlin -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 26 // B6 Shared w/x - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 26 // B6 Shared w/x - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 26 // B6 Shared w/x - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // F7 Analog Input (Extruder) -#define TEMP_BED_PIN 6 // F6 Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A Fan -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 -#define LED_PIN 6 // D6 -#define PS_ON_PIN 27 // B7 -#define CASE_LIGHT_PIN 1 // D1 PWM2B MUST BE HARDWARE PWM - -// -// LCD / Controller -// -#if ENABLED(ULTIPANEL) - #define LCD_PINS_RS 8 // E0 - #define LCD_PINS_ENABLE 9 // E1 - #define LCD_PINS_D4 10 // C0 - #define LCD_PINS_D5 11 // C1 - #define LCD_PINS_D6 12 // C2 - #define LCD_PINS_D7 13 // C3 - #define BTN_EN1 38 // F0 - #define BTN_EN2 39 // F1 - #define BTN_ENC 40 // F2 -#endif - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_ENA_PIN 5 // D5 Pin should have a pullup! -#define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM -#define SPINDLE_DIR_PIN 7 // D7 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSYLU.h deleted file mode 100644 index 5fde57180b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy2/pins_TEENSYLU.h +++ /dev/null @@ -1,163 +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 . - * - */ - -/** - * Rev C 2 JUN 2017 - * - * Converted to Arduino pin numbering - */ - -/** - * There are two Arduino IDE extensions that are compatible with this board - * and with the mainstream Marlin software. All have been used with Arduino 1.6.12 - * - * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html - * Select Teensy++ 2.0 in Arduino IDE from the 'Tools > Board' menu - * - * Installation instructions are at the above URL. Don't bother loading the - * libraries - they are not used with the Marlin software. - * - * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support - * This is basically Teensyduino but with a bootloader that can handle image sizes - * larger than 64K. - * - * Installation: - * - * 1. Go to the above URL, click on the "Clone or Download" button and then - * click on "Download ZIP" button. - * 2. Unzip the file, find the "printrboard" directory and then copy it to the - * hardware directory in Arduino. The Arduino hardware directory will probably - * be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware. - * 3. Restart Arduino. - * 4. Select "Printrboard" from the 'Tools > Board' menu. - * - * Teensyduino is the most popular option. Printrboard is used if your board doesn't have - * the Teensyduino bootloader on it. - */ - -/** - * To burn the bootloader that comes with Printrboard: - * - * 1. Connect your programmer to the board. - * 2. In the Arduino IDE select "Printrboard" and then select the programmer. - * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. - * 4. The programmer is no longer needed. Remove it. - */ - - /** - * SILKSCREEN ERROR - * - * The silkscreen for the endstops do NOT match the schematic. The silkscreen SHOULD - * read (from left to right) X-STOP, Y-STOP, Z-STOP & E-STOP. The silkscreen actually - * reads E-STOP, X-STOP, Y-STOP & Z-STOP. - * - * The pin assignments in this file match the silkscreen. - */ - -#if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1286P__) - #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "Teensylu" - -// -// Limit Switch definitions that match the SCHEMATIC -// -//#define X_STOP_PIN 25 // B5 -//#define Y_STOP_PIN 26 // B6 -//#define Z_STOP_PIN 27 // B7 -//#define E_STOP_PIN 36 // E4 - - -// -// Limit Switch definitions that match the SILKSCREEN -// -#define X_STOP_PIN 26 // B6 -#define Y_STOP_PIN 27 // B7 -#define Z_STOP_PIN 36 // E4 -//#define E_STOP_PIN 25 // B5 - -// -// Steppers -// -#define X_STEP_PIN 28 // A0 -#define X_DIR_PIN 29 // A1 -#define X_ENABLE_PIN 19 // E7 - -#define Y_STEP_PIN 30 // A2 -#define Y_DIR_PIN 31 // A3 -#define Y_ENABLE_PIN 18 // E6 - -#define Z_STEP_PIN 32 // A4 -#define Z_DIR_PIN 33 // A5 -#define Z_ENABLE_PIN 17 // C7 - -#define E0_STEP_PIN 34 // A6 -#define E0_DIR_PIN 35 // A7 -#define E0_ENABLE_PIN 13 // C3 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 7 // Analog Input (Extruder) -#define TEMP_BED_PIN 6 // Analog Input (Bed) - -// -// Heaters / Fans -// -#define HEATER_0_PIN 15 // C5 PWM3B - Extruder -#define HEATER_BED_PIN 14 // C4 PWM3C - -#ifndef FAN_PIN - #define FAN_PIN 16 // C6 PWM3A -#endif - -// -// Misc. Functions -// -#define SDSS 20 // B0 JP31-6 -#define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B - -// -// LCD / Controller -// -#if BOTH(ULTRA_LCD, NEWPANEL) - - #define BEEPER_PIN -1 - - #if ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 3 // D3 IO-8 - #define BTN_EN2 2 // D2 IO-10 - #define BTN_ENC 41 // F3 IO-7 - #define SDSS 38 // F0 IO-13 use SD card on Panelolu2 - #endif - - #define SD_DETECT_PIN -1 - -#endif // HAS_SPI_LCD && NEWPANEL - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 24 // B4 IO-3 PWM2A - MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 39 // F1 IO-11 - Pin should have a pullup! -#define SPINDLE_DIR_PIN 40 // F2 IO-9 diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY31_32.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY31_32.h deleted file mode 100644 index a68b9e31c4..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY31_32.h +++ /dev/null @@ -1,121 +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 - -/** - * Teensy 3.1 (MK20DX256) and Teensy 3.2 (MK20DX256) Breadboard pin assignments - * Requires the Teensyduino software with Teensy 3.1 or Teensy 3.2 selected in Arduino IDE! - * http://www.pjrc.com/teensy/teensyduino.html - */ - -#if !IS_32BIT_TEENSY - #error "Oops! Select 'Teensy 3.1' or 'Teensy 3.2' in 'Tools > Board.'" -#endif - -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "Teensy3.2" -#endif - -#define AT90USB 1286 // Disable MarlinSerial etc. -#define USBCON //1286 // Disable MarlinSerial etc. - -// -// Limit Switches -// -#define X_STOP_PIN 3 -#define Y_STOP_PIN 4 -#define Z_STOP_PIN 5 - -// -// Steppers -// -#define X_STEP_PIN 5 -#define X_DIR_PIN 6 -#define X_ENABLE_PIN 2 - -#define Y_STEP_PIN 7 -#define Y_DIR_PIN 8 -#define Y_ENABLE_PIN 2 - -#define Z_STEP_PIN 9 -#define Z_DIR_PIN 10 -#define Z_ENABLE_PIN 2 - -#define E0_STEP_PIN 11 -#define E0_DIR_PIN 12 -#define E0_ENABLE_PIN 2 - -//#define E1_STEP_PIN 33 -//#define E1_DIR_PIN 34 -//#define E1_ENABLE_PIN 35 - -// -// Heaters / Fans -// -#define HEATER_0_PIN 20 -// #define HEATER_1_PIN 36 -#define HEATER_BED_PIN 21 -#ifndef FAN_PIN - #define FAN_PIN 22 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN 14 // Analog Input - Extruder 2 => A2 -//#define TEMP_1_PIN 0 // Analog Input -#define TEMP_BED_PIN 15 // Analog Input - Bed - -#ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 6 // Analog Input -#endif - -// -// Misc. Functions -// - -//#define SDSS 16 // 8 -#define LED_PIN 13 - -//#define SOL1_PIN 28 - -// -// LCD / Controller -// - -//#define SCK_PIN 13 -//#define MISO_PIN 12 -//#define MOSI_PIN 11 - -/* -#if HAS_SPI_LCD - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 41 - #define LCD_PINS_D4 42 - #define LCD_PINS_D5 43 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 45 - #define BTN_EN1 46 - #define BTN_EN2 47 - #define BTN_ENC 48 -#endif -*/ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY35_36.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY35_36.h deleted file mode 100644 index b0f0e4d474..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/pins/teensy3/pins_TEENSY35_36.h +++ /dev/null @@ -1,162 +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 - -/**************************************************************************************** -* Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) Breadboard pin assignments -* Requires the Teensyduino software with Teensy 3.5 or Teensy 3.6 selected in Arduino IDE! -* http://www.pjrc.com/teensy/teensyduino.html -****************************************************************************************/ - -#if !IS_32BIT_TEENSY - #error "Oops! Select 'Teensy 3.5' or 'Teensy 3.6' in 'Tools > Board.'" -#endif - -#if IS_TEENSY35 - #define BOARD_INFO_NAME "Teensy3.5" -#elif IS_TEENSY36 - #define BOARD_INFO_NAME "Teensy3.6" -#endif - -#define AT90USB 1286 // Disable MarlinSerial etc. -#define USBCON //1286 // Disable MarlinSerial etc. -/* - - teemuatlut plan for Teensy3.5 and Teensy3.6: - USB - GND |-----#####-----| VIN 5V - X_STEP_PIN MOSI1 RX1 0 | ##### | Analog GND - X_DIR_PIN MISO1 TX1 1 | | 3.3V - Y_STEP_PIN PWM 2 | *NC AREF* | 23 A9 PWM - Y_DIR_PIN SCL2 CAN0TX PWM 3 | *A26 A10* | 22 A8 PWM - Z_STEP_PIN SDA2 CAN0RX PWM 4 | *A25 A11* | 21 A7 PWM CS0 MOSI1 RX1 - Z_DIR_PIN MISO1 TX1 PWM 5 | *GND * * 57 | 20 A6 PWM CS0 SCK1 FILWIDTH_PIN - X_ENABLE_PIN PWM 6 | *GND * * 56 | 19 A5 SCL0 E0_STEP_PIN - Y_ENABLE_PIN SCL0 MOSI0 RX3 PWM 7 | * * 55 | 18 A4 SDA0 E0_DIR_PIN - Z_ENABLE_PIN SDA0 MISO0 TX3 PWM 8 | * * 54 | 17 A3 SDA0 E0_ENABLE_PIN - CS0 RX2 PWM 9 | | 16 A2 SCL0 TEMP_0_PIN - CS0 TX2 PWM 10 | | 15 A1 CS0 TEMP_BED_PIN - X_STOP_PIN MOSI0 11 | | 14 A0 PWM CS0 TEMP_1_PIN - Y_STOP_PIN MISO0 12 | | 13 LED SCK0 LED_PIN - 3.3V | | GND - Z_STOP_PIN 24 | 40 * * 53 | A22 DAC1 -AUX2 25 | 41 * * 52 | A21 DAC0 -AUX2 FAN_PIN SCL2 TX1 26 | 42 * * 51 | 39 A20 MISO0 SDSS -AUX2 Z-PROBE PWR SCK0 RX1 27 | * * * * * | 38 A19 PWM SDA1 -AUX2 SOL1_PIN MOSI0 28 | 43 * * 50 | 37 A18 PWM SCL1 -D10 CONTROLLER_FAN_PIN CAN0TX PWM 29 | 44 * * 49 | 36 A17 PWM -D9 HEATER_0_PIN CAN0RX PWM 30 | 45 * * 48 | 35 A16 PWM E1_ENABLE_PIN -D8 HEATER_BED_PIN CS1 RX4 A12 31 | 46 * * 47 | 34 A15 PWM SDA0 RX5 E1_DIR_PIN - SCK1 TX4 A13 32 |__GND_*_*_3.3V_| 33 A14 PWM SCL0 TX5 E1_STEP_PIN - - Interior pins: - LCD_PINS_RS 40 * * 53 SCK2 - LCD_PINS_ENABLE 41 * * 52 MOSI2 - LCD_PINS_D4 42 * * 51 MISO2 - LCD_PINS_D5 CS2 43 * * 50 A24 - LCD_PINS_D6 MOSI2 44 * * 49 A23 - LCD_PINS_D7 MISO2 45 * * 48 TX6 SDA0 BTN_ENC - BTN_EN1 SCK2 46 * * 47 RX6 SCL0 BTN_EN2 - GND * * 3.3V - -*/ - -// -// Limit Switches -// -#define X_STOP_PIN 24 -#define Y_STOP_PIN 26 -#define Z_STOP_PIN 28 - -// -// Steppers -// -#define X_STEP_PIN 22 -#define X_DIR_PIN 21 -#define X_ENABLE_PIN 39 - -#define Y_STEP_PIN 19 -#define Y_DIR_PIN 18 -#define Y_ENABLE_PIN 20 - -#define Z_STEP_PIN 38 -#define Z_DIR_PIN 37 -#define Z_ENABLE_PIN 17 - -#define E0_STEP_PIN 31 -#define E0_DIR_PIN 30 -#define E0_ENABLE_PIN 32 - -#define E1_STEP_PIN 33 -#define E1_DIR_PIN 34 -#define E1_ENABLE_PIN 35 - -#define HEATER_0_PIN 30 -#define HEATER_1_PIN 36 -#define HEATER_BED_PIN 31 -#ifndef FAN_PIN - #define FAN_PIN 2 -#endif - -#define TEMP_0_PIN 2 // Extruder / Analog pin numbering: 2 => A2 -#define TEMP_1_PIN 0 -#define TEMP_BED_PIN 1 // Bed / Analog pin numbering - -#define SDSS 39 // 8 -#define LED_PIN 13 -#define PS_ON_PIN 1 -#define ALARM_PIN -1 - -#define FILWIDTH_PIN 6 -#define SOL1_PIN 28 - -#if 0 -// Pretty sure this is obsolete! -// Please use Marlin 1.1.x pins files as reference for new pins files. -#ifndef SDSUPPORT - // these are defined in the SD library if building with SD support - #define SCK_PIN 13 - #define MISO_PIN 12 - #define MOSI_PIN 11 -#endif -#endif - -#if HAS_SPI_LCD - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 41 - #define LCD_PINS_D4 42 - #define LCD_PINS_D5 43 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 45 -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 46 - #define BTN_EN2 47 - #define BTN_ENC 48 -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.cpp deleted file mode 100644 index a09de08fe5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.cpp +++ /dev/null @@ -1,642 +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 . - * - */ - -/** - * Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - * Updated with backports of the latest SdFat library from the same author - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) && NONE(USB_FLASH_DRIVE_SUPPORT, SDIO_SUPPORT) - -/* Enable FAST CRC computations - You can trade speed for FLASH space if - * needed by disabling the following define */ -#define FAST_CRC 1 - -#include "Sd2Card.h" - -#include "../Marlin.h" - -#if ENABLED(SD_CHECK_AND_RETRY) - static bool crcSupported = true; - - #ifdef FAST_CRC - static const uint8_t crctab7[] PROGMEM = { - 0x00,0x09,0x12,0x1B,0x24,0x2D,0x36,0x3F,0x48,0x41,0x5A,0x53,0x6C,0x65,0x7E,0x77, - 0x19,0x10,0x0B,0x02,0x3D,0x34,0x2F,0x26,0x51,0x58,0x43,0x4A,0x75,0x7C,0x67,0x6E, - 0x32,0x3B,0x20,0x29,0x16,0x1F,0x04,0x0D,0x7A,0x73,0x68,0x61,0x5E,0x57,0x4C,0x45, - 0x2B,0x22,0x39,0x30,0x0F,0x06,0x1D,0x14,0x63,0x6A,0x71,0x78,0x47,0x4E,0x55,0x5C, - 0x64,0x6D,0x76,0x7F,0x40,0x49,0x52,0x5B,0x2C,0x25,0x3E,0x37,0x08,0x01,0x1A,0x13, - 0x7D,0x74,0x6F,0x66,0x59,0x50,0x4B,0x42,0x35,0x3C,0x27,0x2E,0x11,0x18,0x03,0x0A, - 0x56,0x5F,0x44,0x4D,0x72,0x7B,0x60,0x69,0x1E,0x17,0x0C,0x05,0x3A,0x33,0x28,0x21, - 0x4F,0x46,0x5D,0x54,0x6B,0x62,0x79,0x70,0x07,0x0E,0x15,0x1C,0x23,0x2A,0x31,0x38, - 0x41,0x48,0x53,0x5A,0x65,0x6C,0x77,0x7E,0x09,0x00,0x1B,0x12,0x2D,0x24,0x3F,0x36, - 0x58,0x51,0x4A,0x43,0x7C,0x75,0x6E,0x67,0x10,0x19,0x02,0x0B,0x34,0x3D,0x26,0x2F, - 0x73,0x7A,0x61,0x68,0x57,0x5E,0x45,0x4C,0x3B,0x32,0x29,0x20,0x1F,0x16,0x0D,0x04, - 0x6A,0x63,0x78,0x71,0x4E,0x47,0x5C,0x55,0x22,0x2B,0x30,0x39,0x06,0x0F,0x14,0x1D, - 0x25,0x2C,0x37,0x3E,0x01,0x08,0x13,0x1A,0x6D,0x64,0x7F,0x76,0x49,0x40,0x5B,0x52, - 0x3C,0x35,0x2E,0x27,0x18,0x11,0x0A,0x03,0x74,0x7D,0x66,0x6F,0x50,0x59,0x42,0x4B, - 0x17,0x1E,0x05,0x0C,0x33,0x3A,0x21,0x28,0x5F,0x56,0x4D,0x44,0x7B,0x72,0x69,0x60, - 0x0E,0x07,0x1C,0x15,0x2A,0x23,0x38,0x31,0x46,0x4F,0x54,0x5D,0x62,0x6B,0x70,0x79 - }; - - static uint8_t CRC7(const uint8_t* data, uint8_t n) { - uint8_t crc = 0; - while (n > 0) { - crc = pgm_read_byte(&crctab7[ (crc << 1) ^ *data++ ]); - n--; - } - return (crc << 1) | 1; - } - #else - static uint8_t CRC7(const uint8_t* data, uint8_t n) { - uint8_t crc = 0; - for (uint8_t i = 0; i < n; i++) { - uint8_t d = data[i]; - d ^= crc << 1; - if (d & 0x80) d ^= 9; - crc = d ^ (crc & 0x78) ^ (crc << 4) ^ ((crc >> 3) & 15); - crc &= 0x7F; - } - crc = (crc << 1) ^ (crc << 4) ^ (crc & 0x70) ^ ((crc >> 3) & 0x0F); - return crc | 1; - } - #endif -#endif - -// Send command and return error code. Return zero for OK -uint8_t Sd2Card::cardCommand(const uint8_t cmd, const uint32_t arg) { - // Select card - chipSelect(); - - // Wait up to 300 ms if busy - waitNotBusy(SD_WRITE_TIMEOUT); - - uint8_t *pa = (uint8_t *)(&arg); - - #if ENABLED(SD_CHECK_AND_RETRY) - - // Form message - uint8_t d[6] = {(uint8_t) (cmd | 0x40), pa[3], pa[2], pa[1], pa[0] }; - - // Add crc - d[5] = CRC7(d, 5); - - // Send message - for (uint8_t k = 0; k < 6; k++) spiSend(d[k]); - - #else - // Send command - spiSend(cmd | 0x40); - - // Send argument - for (int8_t i = 3; i >= 0; i--) spiSend(pa[i]); - - // Send CRC - correct for CMD0 with arg zero or CMD8 with arg 0X1AA - spiSend(cmd == CMD0 ? 0X95 : 0X87); - #endif - - // Skip stuff byte for stop read - if (cmd == CMD12) spiRec(); - - // Wait for response - for (uint8_t i = 0; ((status_ = spiRec()) & 0x80) && i != 0xFF; i++) { /* Intentionally left empty */ } - return status_; -} - -/** - * Determine the size of an SD flash memory card. - * - * \return The number of 512 byte data blocks in the card - * or zero if an error occurs. - */ -uint32_t Sd2Card::cardSize() { - csd_t csd; - if (!readCSD(&csd)) return 0; - if (csd.v1.csd_ver == 0) { - uint8_t read_bl_len = csd.v1.read_bl_len; - uint16_t c_size = (csd.v1.c_size_high << 10) - | (csd.v1.c_size_mid << 2) | csd.v1.c_size_low; - uint8_t c_size_mult = (csd.v1.c_size_mult_high << 1) - | csd.v1.c_size_mult_low; - return (uint32_t)(c_size + 1) << (c_size_mult + read_bl_len - 7); - } - else if (csd.v2.csd_ver == 1) { - uint32_t c_size = ((uint32_t)csd.v2.c_size_high << 16) - | (csd.v2.c_size_mid << 8) | csd.v2.c_size_low; - return (c_size + 1) << 10; - } - else { - error(SD_CARD_ERROR_BAD_CSD); - return 0; - } -} - -void Sd2Card::chipDeselect() { - extDigitalWrite(chipSelectPin_, HIGH); - spiSend(0xFF); // Ensure MISO goes high impedance -} - -void Sd2Card::chipSelect() { - spiInit(spiRate_); - extDigitalWrite(chipSelectPin_, LOW); -} - -/** - * Erase a range of blocks. - * - * \param[in] firstBlock The address of the first block in the range. - * \param[in] lastBlock The address of the last block in the range. - * - * \note This function requests the SD card to do a flash erase for a - * range of blocks. The data on the card after an erase operation is - * either 0 or 1, depends on the card vendor. The card must support - * single block erase. - * - * \return true for success, false for failure. - */ -bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) { - csd_t csd; - if (!readCSD(&csd)) goto FAIL; - // check for single block erase - if (!csd.v1.erase_blk_en) { - // erase size mask - uint8_t m = (csd.v1.sector_size_high << 1) | csd.v1.sector_size_low; - if ((firstBlock & m) != 0 || ((lastBlock + 1) & m) != 0) { - // error card can't erase specified area - error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK); - goto FAIL; - } - } - if (type_ != SD_CARD_TYPE_SDHC) { firstBlock <<= 9; lastBlock <<= 9; } - if (cardCommand(CMD32, firstBlock) || cardCommand(CMD33, lastBlock) || cardCommand(CMD38, 0)) { - error(SD_CARD_ERROR_ERASE); - goto FAIL; - } - if (!waitNotBusy(SD_ERASE_TIMEOUT)) { - error(SD_CARD_ERROR_ERASE_TIMEOUT); - goto FAIL; - } - chipDeselect(); - return true; - FAIL: - chipDeselect(); - return false; -} - -/** - * Determine if card supports single block erase. - * - * \return true if single block erase is supported. - * false if single block erase is not supported. - */ -bool Sd2Card::eraseSingleBlockEnable() { - csd_t csd; - return readCSD(&csd) ? csd.v1.erase_blk_en : false; -} - -/** - * Initialize an SD flash memory card. - * - * \param[in] sckRateID SPI clock rate selector. See setSckRate(). - * \param[in] chipSelectPin SD chip select pin number. - * - * \return true for success, false for failure. - * The reason for failure can be determined by calling errorCode() and errorData(). - */ -bool Sd2Card::init(const uint8_t sckRateID, const pin_t chipSelectPin) { - errorCode_ = type_ = 0; - chipSelectPin_ = chipSelectPin; - // 16-bit init start time allows over a minute - const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; - uint32_t arg; - - watchdog_refresh(); // In case init takes too long - - // Set pin modes - extDigitalWrite(chipSelectPin_, HIGH); // For some CPUs pinMode can write the wrong data so init desired data value first - pinMode(chipSelectPin_, OUTPUT); // Solution for #8746 by @benlye - spiBegin(); - - // Set SCK rate for initialization commands - spiRate_ = SPI_SD_INIT_RATE; - spiInit(spiRate_); - - // Must supply min of 74 clock cycles with CS high. - for (uint8_t i = 0; i < 10; i++) spiSend(0xFF); - - watchdog_refresh(); // In case init takes too long - - // Command to go idle in SPI mode - while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { - if (ELAPSED(millis(), init_timeout)) { - error(SD_CARD_ERROR_CMD0); - goto FAIL; - } - } - - #if ENABLED(SD_CHECK_AND_RETRY) - crcSupported = (cardCommand(CMD59, 1) == R1_IDLE_STATE); - #endif - - watchdog_refresh(); // In case init takes too long - - // check SD version - for (;;) { - if (cardCommand(CMD8, 0x1AA) == (R1_ILLEGAL_COMMAND | R1_IDLE_STATE)) { - type(SD_CARD_TYPE_SD1); - break; - } - - // Get the last byte of r7 response - for (uint8_t i = 0; i < 4; i++) status_ = spiRec(); - if (status_ == 0xAA) { - type(SD_CARD_TYPE_SD2); - break; - } - - if (ELAPSED(millis(), init_timeout)) { - error(SD_CARD_ERROR_CMD8); - goto FAIL; - } - } - - watchdog_refresh(); // In case init takes too long - - // Initialize card and send host supports SDHC if SD2 - arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; - while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { - // Check for timeout - if (ELAPSED(millis(), init_timeout)) { - error(SD_CARD_ERROR_ACMD41); - goto FAIL; - } - } - // If SD2 read OCR register to check for SDHC card - if (type() == SD_CARD_TYPE_SD2) { - if (cardCommand(CMD58, 0)) { - error(SD_CARD_ERROR_CMD58); - goto FAIL; - } - if ((spiRec() & 0xC0) == 0xC0) type(SD_CARD_TYPE_SDHC); - // Discard rest of ocr - contains allowed voltage range - for (uint8_t i = 0; i < 3; i++) spiRec(); - } - chipDeselect(); - - return setSckRate(sckRateID); - - FAIL: - chipDeselect(); - return false; -} - -/** - * Read a 512 byte block from an SD card. - * - * \param[in] blockNumber Logical block to be read. - * \param[out] dst Pointer to the location that will receive the data. - * \return true for success, false for failure. - */ -bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card - - #if ENABLED(SD_CHECK_AND_RETRY) - uint8_t retryCnt = 3; - for (;;) { - if (cardCommand(CMD17, blockNumber)) - error(SD_CARD_ERROR_CMD17); - else if (readData(dst, 512)) - return true; - - chipDeselect(); - if (!--retryCnt) break; - - cardCommand(CMD12, 0); // Try sending a stop command, ignore the result. - errorCode_ = 0; - } - return false; - #else - if (cardCommand(CMD17, blockNumber)) { - error(SD_CARD_ERROR_CMD17); - chipDeselect(); - return false; - } - else - return readData(dst, 512); - #endif -} - -/** - * Read one data block in a multiple block read sequence - * - * \param[in] dst Pointer to the location for the data to be read. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readData(uint8_t* dst) { - chipSelect(); - return readData(dst, 512); -} - -#if ENABLED(SD_CHECK_AND_RETRY) - #ifdef FAST_CRC - static const uint16_t crctab16[] PROGMEM = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 - }; - // faster CRC-CCITT - // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); - } - return crc; - } - #else - // slower CRC-CCITT - // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = (uint8_t)(crc >> 8) | (crc << 8); - crc ^= data[i]; - crc ^= (uint8_t)(crc & 0xFF) >> 4; - crc ^= crc << 12; - crc ^= (crc & 0xFF) << 5; - } - return crc; - } - #endif -#endif // SD_CHECK_AND_RETRY - -bool Sd2Card::readData(uint8_t* dst, const uint16_t count) { - bool success = false; - - const millis_t read_timeout = millis() + SD_READ_TIMEOUT; - while ((status_ = spiRec()) == 0xFF) { // Wait for start block token - if (ELAPSED(millis(), read_timeout)) { - error(SD_CARD_ERROR_READ_TIMEOUT); - goto FAIL; - } - } - - if (status_ == DATA_START_BLOCK) { - spiRead(dst, count); // Transfer data - - const uint16_t recvCrc = (spiRec() << 8) | spiRec(); - #if ENABLED(SD_CHECK_AND_RETRY) - success = !crcSupported || recvCrc == CRC_CCITT(dst, count); - if (!success) error(SD_CARD_ERROR_READ_CRC); - #else - success = true; - UNUSED(recvCrc); - #endif - } - else - error(SD_CARD_ERROR_READ); - - FAIL: - chipDeselect(); - return success; -} - -/** read CID or CSR register */ -bool Sd2Card::readRegister(const uint8_t cmd, void* buf) { - uint8_t* dst = reinterpret_cast(buf); - if (cardCommand(cmd, 0)) { - error(SD_CARD_ERROR_READ_REG); - chipDeselect(); - return false; - } - return readData(dst, 16); -} - -/** - * Start a read multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * - * \note This function is used with readData() and readStop() for optimized - * multiple block reads. SPI chipSelect must be low for the entire sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStart(uint32_t blockNumber) { - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; - - const bool success = !cardCommand(CMD18, blockNumber); - if (!success) error(SD_CARD_ERROR_CMD18); - chipDeselect(); - return success; -} - -/** - * End a read multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::readStop() { - chipSelect(); - const bool success = !cardCommand(CMD12, 0); - if (!success) error(SD_CARD_ERROR_CMD12); - chipDeselect(); - return success; -} - -/** - * Set the SPI clock rate. - * - * \param[in] sckRateID A value in the range [0, 6]. - * - * The SPI clock will be set to F_CPU/pow(2, 1 + sckRateID). The maximum - * SPI rate is F_CPU/2 for \a sckRateID = 0 and the minimum rate is F_CPU/128 - * for \a scsRateID = 6. - * - * \return The value one, true, is returned for success and the value zero, - * false, is returned for an invalid value of \a sckRateID. - */ -bool Sd2Card::setSckRate(const uint8_t sckRateID) { - const bool success = (sckRateID <= 6); - if (success) spiRate_ = sckRateID; else error(SD_CARD_ERROR_SCK_RATE); - return success; -} - -/** - * Wait for card to become not-busy - * \param[in] timeout_ms Timeout to abort. - * \return true for success, false for timeout. - */ -bool Sd2Card::waitNotBusy(const millis_t timeout_ms) { - const millis_t wait_timeout = millis() + timeout_ms; - while (spiRec() != 0xFF) if (ELAPSED(millis(), wait_timeout)) return false; - return true; -} - -/** - * Write a 512 byte block to an SD card. - * - * \param[in] blockNumber Logical block to be written. - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card - - bool success = false; - if (!cardCommand(CMD24, blockNumber)) { - if (writeData(DATA_START_BLOCK, src)) { - if (waitNotBusy(SD_WRITE_TIMEOUT)) { // Wait for flashing to complete - success = !(cardCommand(CMD13, 0) || spiRec()); // Response is r2 so get and check two bytes for nonzero - if (!success) error(SD_CARD_ERROR_WRITE_PROGRAMMING); - } - else - error(SD_CARD_ERROR_WRITE_TIMEOUT); - } - } - else - error(SD_CARD_ERROR_CMD24); - - chipDeselect(); - return success; -} - -/** - * Write one data block in a multiple block write sequence - * \param[in] src Pointer to the location of the data to be written. - * \return true for success, false for failure. - */ -bool Sd2Card::writeData(const uint8_t* src) { - bool success = true; - chipSelect(); - // Wait for previous write to finish - if (!waitNotBusy(SD_WRITE_TIMEOUT) || !writeData(WRITE_MULTIPLE_TOKEN, src)) { - error(SD_CARD_ERROR_WRITE_MULTIPLE); - success = false; - } - chipDeselect(); - return success; -} - -// Send one block of data for write block or write multiple blocks -bool Sd2Card::writeData(const uint8_t token, const uint8_t* src) { - - uint16_t crc = - #if ENABLED(SD_CHECK_AND_RETRY) - CRC_CCITT(src, 512) - #else - 0xFFFF - #endif - ; - spiSendBlock(token, src); - spiSend(crc >> 8); - spiSend(crc & 0xFF); - - status_ = spiRec(); - if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { - error(SD_CARD_ERROR_WRITE); - chipDeselect(); - return false; - } - return true; -} - -/** - * Start a write multiple blocks sequence. - * - * \param[in] blockNumber Address of first block in sequence. - * \param[in] eraseCount The number of blocks to be pre-erased. - * - * \note This function is used with writeData() and writeStop() - * for optimized multiple block writes. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStart(uint32_t blockNumber, const uint32_t eraseCount) { - bool success = false; - if (!cardAcmd(ACMD23, eraseCount)) { // Send pre-erase count - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card - success = !cardCommand(CMD25, blockNumber); - if (!success) error(SD_CARD_ERROR_CMD25); - } - else - error(SD_CARD_ERROR_ACMD23); - - chipDeselect(); - return success; -} - -/** - * End a write multiple blocks sequence. - * - * \return true for success, false for failure. - */ -bool Sd2Card::writeStop() { - bool success = false; - chipSelect(); - if (waitNotBusy(SD_WRITE_TIMEOUT)) { - spiSend(STOP_TRAN_TOKEN); - success = waitNotBusy(SD_WRITE_TIMEOUT); - } - else - error(SD_CARD_ERROR_STOP_TRAN); - - chipDeselect(); - return success; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.h deleted file mode 100644 index f44dbb3124..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card.h +++ /dev/null @@ -1,183 +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 - -/** - * \file - * \brief Sd2Card class for V2 SD/SDHC cards - */ - -/** - * Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "SdFatConfig.h" -#include "SdInfo.h" - -#include - -uint16_t const SD_INIT_TIMEOUT = 2000, // init timeout ms - SD_ERASE_TIMEOUT = 10000, // erase timeout ms - SD_READ_TIMEOUT = 300, // read timeout ms - SD_WRITE_TIMEOUT = 600; // write time out ms - -// SD card errors -uint8_t const SD_CARD_ERROR_CMD0 = 0x01, // timeout error for command CMD0 (initialize card in SPI mode) - SD_CARD_ERROR_CMD8 = 0x02, // CMD8 was not accepted - not a valid SD card - SD_CARD_ERROR_CMD12 = 0x03, // card returned an error response for CMD12 (write stop) - SD_CARD_ERROR_CMD17 = 0x04, // card returned an error response for CMD17 (read block) - SD_CARD_ERROR_CMD18 = 0x05, // card returned an error response for CMD18 (read multiple block) - SD_CARD_ERROR_CMD24 = 0x06, // card returned an error response for CMD24 (write block) - SD_CARD_ERROR_CMD25 = 0x07, // WRITE_MULTIPLE_BLOCKS command failed - SD_CARD_ERROR_CMD58 = 0x08, // card returned an error response for CMD58 (read OCR) - SD_CARD_ERROR_ACMD23 = 0x09, // SET_WR_BLK_ERASE_COUNT failed - SD_CARD_ERROR_ACMD41 = 0x0A, // ACMD41 initialization process timeout - SD_CARD_ERROR_BAD_CSD = 0x0B, // card returned a bad CSR version field - SD_CARD_ERROR_ERASE = 0x0C, // erase block group command failed - SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0x0D, // card not capable of single block erase - SD_CARD_ERROR_ERASE_TIMEOUT = 0x0E, // Erase sequence timed out - SD_CARD_ERROR_READ = 0x0F, // card returned an error token instead of read data - SD_CARD_ERROR_READ_REG = 0x10, // read CID or CSD failed - SD_CARD_ERROR_READ_TIMEOUT = 0x11, // timeout while waiting for start of read data - SD_CARD_ERROR_STOP_TRAN = 0x12, // card did not accept STOP_TRAN_TOKEN - SD_CARD_ERROR_WRITE = 0x13, // card returned an error token as a response to a write operation - SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0x14, // REMOVE - not used ... attempt to write protected block zero - SD_CARD_ERROR_WRITE_MULTIPLE = 0x15, // card did not go ready for a multiple block write - SD_CARD_ERROR_WRITE_PROGRAMMING = 0x16, // card returned an error to a CMD13 status check after a write - SD_CARD_ERROR_WRITE_TIMEOUT = 0x17, // timeout occurred during write programming - SD_CARD_ERROR_SCK_RATE = 0x18, // incorrect rate selected - SD_CARD_ERROR_INIT_NOT_CALLED = 0x19, // init() not called - // 0x1A is unused now, it was: card returned an error for CMD59 (CRC_ON_OFF) - SD_CARD_ERROR_READ_CRC = 0x1B; // invalid read CRC - -// card types -uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 SD card - SD_CARD_TYPE_SD2 = 2, // Standard capacity V2 SD card - SD_CARD_TYPE_SDHC = 3; // High Capacity SD card - -/** - * define SOFTWARE_SPI to use bit-bang SPI - */ -#if MEGA_SOFT_SPI - #define SOFTWARE_SPI -#elif USE_SOFTWARE_SPI - #define SOFTWARE_SPI -#endif // MEGA_SOFT_SPI - -/** - * \class Sd2Card - * \brief Raw access to SD and SDHC flash memory cards. - */ -class Sd2Card { -public: - - Sd2Card() : errorCode_(SD_CARD_ERROR_INIT_NOT_CALLED), type_(0) {} - - uint32_t cardSize(); - bool erase(uint32_t firstBlock, uint32_t lastBlock); - bool eraseSingleBlockEnable(); - - /** - * Set SD error code. - * \param[in] code value for error code. - */ - inline void error(const uint8_t code) { errorCode_ = code; } - - /** - * \return error code for last error. See Sd2Card.h for a list of error codes. - */ - inline int errorCode() const { return errorCode_; } - - /** \return error data for last error. */ - inline int errorData() const { return status_; } - - /** - * Initialize an SD flash memory card with default clock rate and chip - * select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin). - * - * \return true for success or false for failure. - */ - bool init(const uint8_t sckRateID, const pin_t chipSelectPin); - - bool readBlock(uint32_t block, uint8_t* dst); - - /** - * Read a card's CID register. The CID contains card identification - * information such as Manufacturer ID, Product name, Product serial - * number and Manufacturing date. - * - * \param[out] cid pointer to area for returned data. - * - * \return true for success or false for failure. - */ - bool readCID(cid_t* cid) { return readRegister(CMD10, cid); } - - /** - * Read a card's CSD register. The CSD contains Card-Specific Data that - * provides information regarding access to the card's contents. - * - * \param[out] csd pointer to area for returned data. - * - * \return true for success or false for failure. - */ - inline bool readCSD(csd_t* csd) { return readRegister(CMD9, csd); } - - bool readData(uint8_t* dst); - bool readStart(uint32_t blockNumber); - bool readStop(); - bool setSckRate(const uint8_t sckRateID); - - /** - * Return the card type: SD V1, SD V2 or SDHC - * \return 0 - SD V1, 1 - SD V2, or 3 - SDHC. - */ - int type() const {return type_;} - bool writeBlock(uint32_t blockNumber, const uint8_t* src); - bool writeData(const uint8_t* src); - bool writeStart(uint32_t blockNumber, const uint32_t eraseCount); - bool writeStop(); - -private: - uint8_t chipSelectPin_, - errorCode_, - spiRate_, - status_, - type_; - - // private functions - inline uint8_t cardAcmd(const uint8_t cmd, const uint32_t arg) { - cardCommand(CMD55, 0); - return cardCommand(cmd, arg); - } - uint8_t cardCommand(const uint8_t cmd, const uint32_t arg); - - bool readData(uint8_t* dst, const uint16_t count); - bool readRegister(const uint8_t cmd, void* buf); - void chipDeselect(); - void chipSelect(); - inline void type(const uint8_t value) { type_ = value; } - bool waitNotBusy(const millis_t timeout_ms); - bool writeData(const uint8_t token, const uint8_t* src); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card_sdio.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card_sdio.h deleted file mode 100644 index 2aa2e86c03..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/Sd2Card_sdio.h +++ /dev/null @@ -1,39 +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 - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDIO_SUPPORT) - -bool SDIO_Init(); -bool SDIO_ReadBlock(uint32_t block, uint8_t *dst); -bool SDIO_WriteBlock(uint32_t block, const uint8_t *src); - -class Sd2Card { - public: - bool init(uint8_t sckRateID = 0, uint8_t chipSelectPin = 0) { return SDIO_Init(); } - bool readBlock(uint32_t block, uint8_t *dst) { return SDIO_ReadBlock(block, dst); } - bool writeBlock(uint32_t block, const uint8_t *src) { return SDIO_WriteBlock(block, src); } -}; - -#endif // SDIO_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.cpp deleted file mode 100644 index 2969208838..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.cpp +++ /dev/null @@ -1,1728 +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 . - * - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdBaseFile.h" - -#include "../Marlin.h" -SdBaseFile* SdBaseFile::cwd_ = 0; // Pointer to Current Working Directory - -// callback function for date/time -void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; - -// add a cluster to a file -bool SdBaseFile::addCluster() { - if (!vol_->allocContiguous(1, &curCluster_)) return false; - - // if first cluster of file link to directory entry - if (firstCluster_ == 0) { - firstCluster_ = curCluster_; - flags_ |= F_FILE_DIR_DIRTY; - } - return true; -} - -// Add a cluster to a directory file and zero the cluster. -// return with first block of cluster in the cache -bool SdBaseFile::addDirCluster() { - uint32_t block; - // max folder size - if (fileSize_ / sizeof(dir_t) >= 0xFFFF) return false; - - if (!addCluster()) return false; - if (!vol_->cacheFlush()) return false; - - block = vol_->clusterStartBlock(curCluster_); - - // set cache to first block of cluster - vol_->cacheSetBlockNumber(block, true); - - // zero first block of cluster - memset(vol_->cacheBuffer_.data, 0, 512); - - // zero rest of cluster - for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { - if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) return false; - } - // Increase directory file size by cluster size - fileSize_ += 512UL << vol_->clusterSizeShift_; - return true; -} - -// cache a file's directory entry -// return pointer to cached entry or null for failure -dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { - if (!vol_->cacheRawBlock(dirBlock_, action)) return nullptr; - return vol_->cache()->dir + dirIndex_; -} - -/** - * Close a file and force cached data and directory information - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include no file is open or an I/O error. - */ -bool SdBaseFile::close() { - bool rtn = sync(); - type_ = FAT_FILE_TYPE_CLOSED; - return rtn; -} - -/** - * Check for contiguous file and return its raw block range. - * - * \param[out] bgnBlock the first block address for the file. - * \param[out] endBlock the last block address for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is not contiguous, file has zero length - * or an I/O error occurred. - */ -bool SdBaseFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) { - // error if no blocks - if (firstCluster_ == 0) return false; - - for (uint32_t c = firstCluster_; ; c++) { - uint32_t next; - if (!vol_->fatGet(c, &next)) return false; - - // check for contiguous - if (next != (c + 1)) { - // error if not end of chain - if (!vol_->isEOC(next)) return false; - *bgnBlock = vol_->clusterStartBlock(firstCluster_); - *endBlock = vol_->clusterStartBlock(c) - + vol_->blocksPerCluster_ - 1; - return true; - } - } - return false; -} - -/** - * Create and open a new contiguous file of a specified size. - * - * \note This function only supports short DOS 8.3 names. - * See open() for more information. - * - * \param[in] dirFile The directory where the file will be created. - * \param[in] path A path with a valid DOS 8.3 file name. - * \param[in] size The desired file size. - * - * \return true for success, false for failure. - * Reasons for failure include \a path contains - * an invalid DOS 8.3 file name, the FAT volume has not been initialized, - * a file is already open, the file already exists, the root - * directory is full or an I/O error. - * - */ -bool SdBaseFile::createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size) { - uint32_t count; - // don't allow zero length file - if (size == 0) return false; - if (!open(dirFile, path, O_CREAT | O_EXCL | O_RDWR)) return false; - - // calculate number of clusters needed - count = ((size - 1) >> (vol_->clusterSizeShift_ + 9)) + 1; - - // allocate clusters - if (!vol_->allocContiguous(count, &firstCluster_)) { - remove(); - return false; - } - fileSize_ = size; - - // insure sync() will update dir entry - flags_ |= F_FILE_DIR_DIRTY; - - return sync(); -} - -/** - * Return a file's directory entry. - * - * \param[out] dir Location for return of the file's directory entry. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::dirEntry(dir_t* dir) { - dir_t* p; - // make sure fields on SD are correct - if (!sync()) return false; - - // read entry - p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // copy to caller's struct - memcpy(dir, p, sizeof(dir_t)); - return true; -} - -/** - * Format the name field of \a dir into the 13 byte array - * \a name in standard 8.3 short name format. - * - * \param[in] dir The directory structure containing the name. - * \param[out] name A 13 byte char array for the formatted name. - */ -void SdBaseFile::dirName(const dir_t& dir, char* name) { - uint8_t j = 0; - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) name[j++] = '.'; - name[j++] = dir.name[i]; - } - name[j] = 0; -} - -/** - * Test for the existence of a file in a directory - * - * \param[in] name Name of the file to be tested for. - * - * The calling instance must be an open directory file. - * - * dirFile.exists("TOFIND.TXT") searches for "TOFIND.TXT" in the directory - * dirFile. - * - * \return true if the file exists else false. - */ -bool SdBaseFile::exists(const char* name) { - SdBaseFile file; - return file.open(this, name, O_READ); -} - -/** - * Get a string from a file. - * - * fgets() reads bytes from a file into the array pointed to by \a str, until - * \a num - 1 bytes are read, or a delimiter is read and transferred to \a str, - * or end-of-file is encountered. The string is then terminated - * with a null byte. - * - * fgets() deletes CR, '\\r', from the string. This insures only a '\\n' - * terminates the string for Windows text files which use CRLF for newline. - * - * \param[out] str Pointer to the array where the string is stored. - * \param[in] num Maximum number of characters to be read - * (including the final null byte). Usually the length - * of the array \a str is used. - * \param[in] delim Optional set of delimiters. The default is "\n". - * - * \return For success fgets() returns the length of the string in \a str. - * If no data is read, fgets() returns zero for EOF or -1 if an error occurred. - **/ -int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { - char ch; - int16_t n = 0; - int16_t r = -1; - while ((n + 1) < num && (r = read(&ch, 1)) == 1) { - // delete CR - if (ch == '\r') continue; - str[n++] = ch; - if (!delim) { - if (ch == '\n') break; - } - else { - if (strchr(delim, ch)) break; - } - } - if (r < 0) { - // read error - return -1; - } - str[n] = '\0'; - return n; -} - -/** - * Get a file's name - * - * \param[out] name An array of 13 characters for the file's name. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::getDosName(char * const name) { - if (!isOpen()) return false; - - if (isRoot()) { - name[0] = '/'; - name[1] = '\0'; - return true; - } - // cache entry - dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); - if (!p) return false; - - // format name - dirName(*p, name); - return true; -} - -void SdBaseFile::getpos(filepos_t* pos) { - pos->position = curPosition_; - pos->cluster = curCluster_; -} - -/** - * List directory contents. - * - * \param[in] pr Print stream for list. - * - * \param[in] flags The inclusive OR of - * - * LS_DATE - %Print file modification date - * - * LS_SIZE - %Print file size. - * - * LS_R - Recursive list of subdirectories. - * - * \param[in] indent Amount of space before file name. Used for recursive - * list to indicate subdirectory level. - */ -void SdBaseFile::ls(uint8_t flags, uint8_t indent) { - rewind(); - int8_t status; - while ((status = lsPrintNext(flags, indent))) { - if (status > 1 && (flags & LS_R)) { - uint16_t index = curPosition() / 32 - 1; - SdBaseFile s; - if (s.open(this, index, O_READ)) s.ls(flags, indent + 2); - seekSet(32 * (index + 1)); - } - } -} - -// saves 32 bytes on stack for ls recursion -// return 0 - EOF, 1 - normal file, or 2 - directory -int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { - dir_t dir; - uint8_t w = 0; - - while (1) { - if (read(&dir, sizeof(dir)) != sizeof(dir)) return 0; - if (dir.name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entries for . and .. - if (dir.name[0] != DIR_NAME_DELETED && dir.name[0] != '.' - && DIR_IS_FILE_OR_SUBDIR(&dir)) break; - } - // indent for dir level - for (uint8_t i = 0; i < indent; i++) SERIAL_CHAR(' '); - - // print name - for (uint8_t i = 0; i < 11; i++) { - if (dir.name[i] == ' ')continue; - if (i == 8) { - SERIAL_CHAR('.'); - w++; - } - SERIAL_CHAR(dir.name[i]); - w++; - } - if (DIR_IS_SUBDIR(&dir)) { - SERIAL_CHAR('/'); - w++; - } - if (flags & (LS_DATE | LS_SIZE)) { - while (w++ < 14) SERIAL_CHAR(' '); - } - // print modify date/time if requested - if (flags & LS_DATE) { - SERIAL_CHAR(' '); - printFatDate(dir.lastWriteDate); - SERIAL_CHAR(' '); - printFatTime(dir.lastWriteTime); - } - // print size if requested - if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) { - SERIAL_CHAR(' '); - SERIAL_ECHO(dir.fileSize); - } - SERIAL_EOL(); - return DIR_IS_FILE(&dir) ? 1 : 2; -} - -// Format directory name field from a 8.3 name string -bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { - uint8_t n = 7, // Max index until a dot is found - i = 11; - while (i) name[--i] = ' '; // Set whole FILENAME.EXT to spaces - while (*str && *str != '/') { // For each character, until nul or '/' - uint8_t c = *str++; // Get char and advance - if (c == '.') { // For a dot... - if (n == 10) return false; // Already moved the max index? fail! - n = 10; // Move the max index for full 8.3 name - i = 8; // Move up to the extension place - } - else { - // Fail for illegal characters - PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); - while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; - if (i > n || c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters - name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name - } - } - *ptr = str; // Set passed pointer to the end - return name[0] != ' '; // Return true if any name was set -} - -/** - * Make a new directory. - * - * \param[in] parent An open SdFat instance for the directory that will contain - * the new directory. - * - * \param[in] path A path with a valid 8.3 DOS name for the new directory. - * - * \param[in] pFlag Create missing parent directories if true. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a parent is not a - * directory, \a path is invalid or already exists in \a parent. - */ -bool SdBaseFile::mkdir(SdBaseFile* parent, const char* path, bool pFlag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile* sub = &dir1; - SdBaseFile* start = parent; - - if (!parent || isOpen()) return false; - - if (*path == '/') { - while (*path == '/') path++; - if (!parent->isRoot()) { - if (!dir2.openRoot(parent->vol_)) return false; - parent = &dir2; - } - } - while (1) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) { - if (!pFlag || !sub->mkdir(parent, dname)) - return false; - } - if (parent != start) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return mkdir(parent, dname); -} - -bool SdBaseFile::mkdir(SdBaseFile* parent, const uint8_t dname[11]) { - uint32_t block; - dir_t d; - dir_t* p; - - if (!parent->isDir()) return false; - - // create a normal file - if (!open(parent, dname, O_CREAT | O_EXCL | O_RDWR)) return false; - - // convert file to directory - flags_ = O_READ; - type_ = FAT_FILE_TYPE_SUBDIR; - - // allocate and zero first cluster - if (!addDirCluster()) return false; - - // force entry to SD - if (!sync()) return false; - - // cache entry - should already be in cache due to sync() call - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - - // change directory entry attribute - p->attributes = DIR_ATT_DIRECTORY; - - // make entry for '.' - memcpy(&d, p, sizeof(d)); - d.name[0] = '.'; - for (uint8_t i = 1; i < 11; i++) d.name[i] = ' '; - - // cache block for '.' and '..' - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - - // copy '.' to block - memcpy(&vol_->cache()->dir[0], &d, sizeof(d)); - - // make entry for '..' - d.name[1] = '.'; - if (parent->isRoot()) { - d.firstClusterLow = 0; - d.firstClusterHigh = 0; - } - else { - d.firstClusterLow = parent->firstCluster_ & 0xFFFF; - d.firstClusterHigh = parent->firstCluster_ >> 16; - } - // copy '..' to block - memcpy(&vol_->cache()->dir[1], &d, sizeof(d)); - - // write first block - return vol_->cacheFlush(); -} - -/** - * Open a file in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::open(const char* path, uint8_t oflag) { - return open(cwd_, path, oflag); -} - -/** - * Open a file or directory by name. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * O_READ - Open for reading. - * - * O_RDONLY - Same as O_READ. - * - * O_WRITE - Open for writing. - * - * O_WRONLY - Same as O_WRITE. - * - * O_RDWR - Open for reading and writing. - * - * O_APPEND - If set, the file offset shall be set to the end of the - * file prior to each write. - * - * O_AT_END - Set the initial position at the end of the file. - * - * O_CREAT - If the file exists, this flag has no effect except as noted - * under O_EXCL below. Otherwise, the file shall be created - * - * O_EXCL - If O_CREAT and O_EXCL are set, open() shall fail if the file exists. - * - * O_SYNC - Call sync() after each write. This flag should not be used with - * write(uint8_t), write_P(PGM_P), writeln_P(PGM_P), or the Arduino Print class. - * These functions do character at a time writes so sync() will be called - * after each byte. - * - * O_TRUNC - If the file exists and is a regular file, and the file is - * successfully opened and is not read only, its length shall be truncated to 0. - * - * WARNING: A given file must not be opened by more than one SdBaseFile object - * of file corruption may occur. - * - * \note Directory files must be opened read only. Write and truncation is - * not allowed for directory files. - * - * \return true for success, false for failure. - * Reasons for failure include this file is already open, \a dirFile is not - * a directory, \a path is invalid, the file does not exist - * or can't be opened in the access mode specified by oflag. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { - uint8_t dname[11]; - SdBaseFile dir1, dir2; - SdBaseFile *parent = dirFile, *sub = &dir1; - - if (!dirFile || isOpen()) return false; - - if (*path == '/') { // Path starts with '/' - if (!dirFile->isRoot()) { // Is the passed dirFile the root? - if (!dir2.openRoot(dirFile->vol_)) return false; // Get the root in dir2, if possible - parent = &dir2; // Change 'parent' to point at the root dir - } - while (*path == '/') path++; // Skip all leading slashes - } - - for (;;) { - if (!make83Name(path, dname, &path)) return false; - while (*path == '/') path++; - if (!*path) break; - if (!sub->open(parent, dname, O_READ)) return false; - if (parent != dirFile) parent->close(); - parent = sub; - sub = parent != &dir1 ? &dir1 : &dir2; - } - return open(parent, dname, oflag); -} - -// open with filename in dname -bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { - bool emptyFound = false, fileFound = false; - uint8_t index; - dir_t* p; - - vol_ = dirFile->vol_; - - dirFile->rewind(); - // search for file - - while (dirFile->curPosition_ < dirFile->fileSize_) { - index = 0xF & (dirFile->curPosition_ >> 5); - p = dirFile->readDirCache(); - if (!p) return false; - - if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { - // remember first empty slot - if (!emptyFound) { - dirBlock_ = dirFile->vol_->cacheBlockNumber(); - dirIndex_ = index; - emptyFound = true; - } - // done if no entries follow - if (p->name[0] == DIR_NAME_FREE) break; - } - else if (!memcmp(dname, p->name, 11)) { - fileFound = true; - break; - } - } - if (fileFound) { - // don't open existing file if O_EXCL - if (oflag & O_EXCL) return false; - } - else { - // don't create unless O_CREAT and O_WRITE - if (!(oflag & O_CREAT) || !(oflag & O_WRITE)) return false; - if (emptyFound) { - index = dirIndex_; - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - } - else { - if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; - - // add and zero cluster for dirFile - first cluster is in cache for write - if (!dirFile->addDirCluster()) return false; - - // use first entry in cluster - p = dirFile->vol_->cache()->dir; - index = 0; - } - // initialize as empty file - memset(p, 0, sizeof(*p)); - memcpy(p->name, dname, 11); - - // set timestamps - if (dateTime_) { - // call user date/time function - dateTime_(&p->creationDate, &p->creationTime); - } - else { - // use default date/time - p->creationDate = FAT_DEFAULT_DATE; - p->creationTime = FAT_DEFAULT_TIME; - } - p->lastAccessDate = p->creationDate; - p->lastWriteDate = p->creationDate; - p->lastWriteTime = p->creationTime; - - // write entry to SD - if (!dirFile->vol_->cacheFlush()) return false; - } - // open entry in cache - return openCachedEntry(index, oflag); -} - -/** - * Open a file by index. - * - * \param[in] dirFile An open SdFat instance for the directory. - * - * \param[in] index The \a index of the directory entry for the file to be - * opened. The value for \a index is (directory file position)/32. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) { - dir_t* p; - - vol_ = dirFile->vol_; - - // error if already open - if (isOpen() || !dirFile) return false; - - // don't open existing file if O_EXCL - user call error - if (oflag & O_EXCL) return false; - - // seek to location of entry - if (!dirFile->seekSet(32 * index)) return false; - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // error if empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_FREE || - p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - return false; - } - // open cached entry - return openCachedEntry(index & 0xF, oflag); -} - -// open a cached directory entry. Assumes vol_ is initialized -bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { - // location of entry in cache - dir_t* p = &vol_->cache()->dir[dirIndex]; - - // write or truncate is an error for a directory or read-only file - if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { - if (oflag & (O_WRITE | O_TRUNC)) goto FAIL; - } - // remember location of directory entry on SD - dirBlock_ = vol_->cacheBlockNumber(); - dirIndex_ = dirIndex; - - // copy first cluster number for directory fields - firstCluster_ = (uint32_t)p->firstClusterHigh << 16; - firstCluster_ |= p->firstClusterLow; - - // make sure it is a normal file or subdirectory - if (DIR_IS_FILE(p)) { - fileSize_ = p->fileSize; - type_ = FAT_FILE_TYPE_NORMAL; - } - else if (DIR_IS_SUBDIR(p)) { - if (!vol_->chainSize(firstCluster_, &fileSize_)) goto FAIL; - type_ = FAT_FILE_TYPE_SUBDIR; - } - else - goto FAIL; - - // save open flags for read/write - flags_ = oflag & F_OFLAG; - - // set to start of file - curCluster_ = 0; - curPosition_ = 0; - if ((oflag & O_TRUNC) && !truncate(0)) return false; - return oflag & O_AT_END ? seekEnd(0) : true; - - FAIL: - type_ = FAT_FILE_TYPE_CLOSED; - return false; -} - -/** - * Open the next file or subdirectory in a directory. - * - * \param[in] dirFile An open SdFat instance for the directory containing the - * file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. - * - * See open() by path for definition of flags. - * \return true for success or false for failure. - */ -bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) { - dir_t* p; - uint8_t index; - - if (!dirFile) return false; - - // error if already open - if (isOpen()) return false; - - vol_ = dirFile->vol_; - - while (1) { - index = 0xF & (dirFile->curPosition_ >> 5); - - // read entry into cache - p = dirFile->readDirCache(); - if (!p) return false; - - // done if last entry - if (p->name[0] == DIR_NAME_FREE) return false; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') { - continue; - } - // must be file or dir - if (DIR_IS_FILE_OR_SUBDIR(p)) { - return openCachedEntry(index, oflag); - } - } - return false; -} - -#if 0 -/** - * Open a directory's parent directory. - * - * \param[in] dir Parent of this directory will be opened. Must not be root. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::openParent(SdBaseFile* dir) { - dir_t entry; - dir_t* p; - SdBaseFile file; - uint32_t c; - uint32_t cluster; - uint32_t lbn; - // error if already open or dir is root or dir is not a directory - if (isOpen() || !dir || dir->isRoot() || !dir->isDir()) return false; - vol_ = dir->vol_; - // position to '..' - if (!dir->seekSet(32)) return false; - // read '..' entry - if (dir->read(&entry, sizeof(entry)) != 32) return false; - // verify it is '..' - if (entry.name[0] != '.' || entry.name[1] != '.') return false; - // start cluster for '..' - cluster = entry.firstClusterLow; - cluster |= (uint32_t)entry.firstClusterHigh << 16; - if (cluster == 0) return openRoot(vol_); - // start block for '..' - lbn = vol_->clusterStartBlock(cluster); - // first block of parent dir - if (!vol_->cacheRawBlock(lbn, SdVolume::CACHE_FOR_READ)) return false; - - p = &vol_->cacheBuffer_.dir[1]; - // verify name for '../..' - if (p->name[0] != '.' || p->name[1] != '.') return false; - // '..' is pointer to first cluster of parent. open '../..' to find parent - if (p->firstClusterHigh == 0 && p->firstClusterLow == 0) { - if (!file.openRoot(dir->volume())) return false; - } - else if (!file.openCachedEntry(1, O_READ)) - return false; - - // search for parent in '../..' - do { - if (file.readDir(&entry, nullptr) != 32) return false; - c = entry.firstClusterLow; - c |= (uint32_t)entry.firstClusterHigh << 16; - } while (c != cluster); - - // open parent - return open(&file, file.curPosition() / 32 - 1, O_READ); -} -#endif - -/** - * Open a volume's root directory. - * - * \param[in] vol The FAT volume containing the root directory to be opened. - * - * \return true for success, false for failure. - * Reasons for failure include the file is already open, the FAT volume has - * not been initialized or it a FAT12 volume. - */ -bool SdBaseFile::openRoot(SdVolume* vol) { - // error if file is already open - if (isOpen()) return false; - - if (vol->fatType() == 16 || (FAT12_SUPPORT && vol->fatType() == 12)) { - type_ = FAT_FILE_TYPE_ROOT_FIXED; - firstCluster_ = 0; - fileSize_ = 32 * vol->rootDirEntryCount(); - } - else if (vol->fatType() == 32) { - type_ = FAT_FILE_TYPE_ROOT32; - firstCluster_ = vol->rootDirStart(); - if (!vol->chainSize(firstCluster_, &fileSize_)) return false; - } - else // volume is not initialized, invalid, or FAT12 without support - return false; - - vol_ = vol; - // read only - flags_ = O_READ; - - // set to start of file - curCluster_ = curPosition_ = 0; - - // root has no directory entry - dirBlock_ = dirIndex_ = 0; - return true; -} - -/** - * Return the next available byte without consuming it. - * - * \return The byte if no error and not at eof else -1; - */ -int SdBaseFile::peek() { - filepos_t pos; - getpos(&pos); - int c = read(); - if (c >= 0) setpos(&pos); - return c; -} - -// print uint8_t with width 2 -static void print2u(const uint8_t v) { - if (v < 10) SERIAL_CHAR('0'); - SERIAL_ECHO(int(v)); -} - -/** - * %Print a directory date field to Serial. - * - * Format is yyyy-mm-dd. - * - * \param[in] fatDate The date field from a directory entry. - */ - - -/** - * %Print a directory date field. - * - * Format is yyyy-mm-dd. - * - * \param[in] pr Print stream for output. - * \param[in] fatDate The date field from a directory entry. - */ -void SdBaseFile::printFatDate(uint16_t fatDate) { - SERIAL_ECHO(FAT_YEAR(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_MONTH(fatDate)); - SERIAL_CHAR('-'); - print2u(FAT_DAY(fatDate)); -} - - -/** - * %Print a directory time field. - * - * Format is hh:mm:ss. - * - * \param[in] pr Print stream for output. - * \param[in] fatTime The time field from a directory entry. - */ -void SdBaseFile::printFatTime(uint16_t fatTime) { - print2u(FAT_HOUR(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_MINUTE(fatTime)); - SERIAL_CHAR(':'); - print2u(FAT_SECOND(fatTime)); -} - -/** - * Print a file's name to Serial - * - * \return true for success, false for failure. - */ -bool SdBaseFile::printName() { - char name[FILENAME_LENGTH]; - if (!getDosName(name)) return false; - SERIAL_ECHO(name); - return true; -} - -/** - * Read the next byte from a file. - * - * \return For success read returns the next byte in the file as an int. - * If an error occurs or end of file is reached -1 is returned. - */ -int16_t SdBaseFile::read() { - uint8_t b; - return read(&b, 1) == 1 ? b : -1; -} - -/** - * Read data from a file starting at the current position. - * - * \param[out] buf Pointer to the location that will receive the data. - * - * \param[in] nbyte Maximum number of bytes to read. - * - * \return For success read() returns the number of bytes read. - * A value less than \a nbyte, including zero, will be returned - * if end of file is reached. - * If an error occurs, read() returns -1. Possible errors include - * read() called before a file has been opened, corrupt file system - * or an I/O error occurred. - */ -int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { - uint8_t* dst = reinterpret_cast(buf); - uint16_t offset, toRead; - uint32_t block; // raw device block number - - // error if not open or write only - if (!isOpen() || !(flags_ & O_READ)) return -1; - - // max bytes left in file - NOMORE(nbyte, fileSize_ - curPosition_); - - // amount left to read - toRead = nbyte; - while (toRead > 0) { - offset = curPosition_ & 0x1FF; // offset in block - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - block = vol_->rootDirStart() + (curPosition_ >> 9); - } - else { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - if (offset == 0 && blockOfCluster == 0) { - // start of new cluster - if (curPosition_ == 0) - curCluster_ = firstCluster_; // use first cluster in file - else if (!vol_->fatGet(curCluster_, &curCluster_)) // get next cluster from FAT - return -1; - } - block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - } - uint16_t n = toRead; - - // amount to be read from current block - NOMORE(n, 512 - offset); - - // no buffering needed if n == 512 - if (n == 512 && block != vol_->cacheBlockNumber()) { - if (!vol_->readBlock(block, dst)) return -1; - } - else { - // read block to cache and copy data to caller - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return -1; - uint8_t* src = vol_->cache()->data + offset; - memcpy(dst, src, n); - } - dst += n; - curPosition_ += n; - toRead -= n; - } - return nbyte; -} - -/** - * Read the next entry in a directory. - * - * \param[out] dir The dir_t struct that will receive the data. - * - * \return For success readDir() returns the number of bytes read. - * A value of zero will be returned if end of file is reached. - * If an error occurs, readDir() returns -1. Possible errors include - * readDir() called before a directory has been opened, this is not - * a directory file or an I/O error occurred. - */ -int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { - int16_t n; - // if not a directory file or miss-positioned return an error - if (!isDir() || (0x1F & curPosition_)) return -1; - - // If we have a longFilename buffer, mark it as invalid. - // If a long filename is found it will be filled automatically. - if (longFilename) longFilename[0] = '\0'; - - while (1) { - - n = read(dir, sizeof(dir_t)); - if (n != sizeof(dir_t)) return n ? -1 : 0; - - // last entry if DIR_NAME_FREE - if (dir->name[0] == DIR_NAME_FREE) return 0; - - // skip deleted entry and entry for . and .. - if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') { - if (longFilename) longFilename[0] = '\0'; // Invalidate erased file long name, if any - continue; - } - - // Fill the long filename if we have a long filename entry. - // Long filename entries are stored before the short filename. - if (longFilename && DIR_IS_LONG_NAME(dir)) { - vfat_t* VFAT = (vfat_t*)dir; - // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 - if (VFAT->firstClusterLow == 0) { - const uint8_t seq = VFAT->sequenceNumber & 0x1F; - if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { - // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table. - n = (seq - 1) * (FILENAME_LENGTH); - for (uint8_t i = 0; i < FILENAME_LENGTH; i++) - longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; - // If this VFAT entry is the last one, add a NUL terminator at the end of the string - if (VFAT->sequenceNumber & 0x40) longFilename[n + FILENAME_LENGTH] = '\0'; - } - } - } - // Return if normal file or subdirectory - if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; - } -} - - -// Read next directory entry into the cache -// Assumes file is correctly positioned -dir_t* SdBaseFile::readDirCache() { - uint8_t i; - // error if not directory - if (!isDir()) return 0; - - // index of entry in cache - i = (curPosition_ >> 5) & 0xF; - - // use read to locate and cache block - if (read() < 0) return 0; - - // advance to next entry - curPosition_ += 31; - - // return pointer to entry - return vol_->cache()->dir + i; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file read-only, is a directory, - * or an I/O error occurred. - */ -bool SdBaseFile::remove() { - dir_t* d; - // free any clusters - will fail if read-only or directory - if (!truncate(0)) return false; - - // cache directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // set this file closed - type_ = FAT_FILE_TYPE_CLOSED; - - // write entry to SD - return vol_->cacheFlush(); - return true; -} - -/** - * Remove a file. - * - * The directory entry and all data for the file are deleted. - * - * \param[in] dirFile The directory that contains the file. - * \param[in] path Path for the file to be removed. - * - * \note This function should not be used to delete the 8.3 version of a - * file that has a long name. For example if a file has the long name - * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT". - * - * \return true for success, false for failure. - * Reasons for failure include the file is a directory, is read only, - * \a dirFile is not a directory, \a path is not found - * or an I/O error occurred. - */ -bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { - SdBaseFile file; - return file.open(dirFile, path, O_WRITE) ? file.remove() : false; -} - -/** - * Rename a file or subdirectory. - * - * \param[in] dirFile Directory for the new path. - * \param[in] newPath New path name for the file/directory. - * - * \return true for success, false for failure. - * Reasons for failure include \a dirFile is not open or is not a directory - * file, newPath is invalid or already exists, or an I/O error occurs. - */ -bool SdBaseFile::rename(SdBaseFile* dirFile, const char* newPath) { - dir_t entry; - uint32_t dirCluster = 0; - SdBaseFile file; - dir_t* d; - - // must be an open file or subdirectory - if (!(isFile() || isSubDir())) return false; - - // can't move file - if (vol_ != dirFile->vol_) return false; - - // sync() and cache directory entry - sync(); - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // save directory entry - memcpy(&entry, d, sizeof(entry)); - - // mark entry deleted - d->name[0] = DIR_NAME_DELETED; - - // make directory entry for new path - if (isFile()) { - if (!file.open(dirFile, newPath, O_CREAT | O_EXCL | O_WRITE)) { - goto restore; - } - } - else { - // don't create missing path prefix components - if (!file.mkdir(dirFile, newPath, false)) { - goto restore; - } - // save cluster containing new dot dot - dirCluster = file.firstCluster_; - } - // change to new directory entry - dirBlock_ = file.dirBlock_; - dirIndex_ = file.dirIndex_; - - // mark closed to avoid possible destructor close call - file.type_ = FAT_FILE_TYPE_CLOSED; - - // cache new directory entry - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy all but name field to new directory entry - memcpy(&d->attributes, &entry.attributes, sizeof(entry) - sizeof(d->name)); - - // update dot dot if directory - if (dirCluster) { - // get new dot dot - uint32_t block = vol_->clusterStartBlock(dirCluster); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) return false; - memcpy(&entry, &vol_->cache()->dir[1], sizeof(entry)); - - // free unused cluster - if (!vol_->freeChain(dirCluster)) return false; - - // store new dot dot - block = vol_->clusterStartBlock(firstCluster_); - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) return false; - memcpy(&vol_->cache()->dir[1], &entry, sizeof(entry)); - } - return vol_->cacheFlush(); - -restore: - if ((d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE))) { - // restore entry - d->name[0] = entry.name[0]; - vol_->cacheFlush(); - } - return false; -} - -/** - * Remove a directory file. - * - * The directory file will be removed only if it is empty and is not the - * root directory. rmdir() follows DOS and Windows and ignores the - * read-only attribute for the directory. - * - * \note This function should not be used to delete the 8.3 version of a - * directory that has a long name. For example if a directory has the - * long name "New folder" you should not delete the 8.3 name "NEWFOL~1". - * - * \return true for success, false for failure. - * Reasons for failure include the file is not a directory, is the root - * directory, is not empty, or an I/O error occurred. - */ -bool SdBaseFile::rmdir() { - // must be open subdirectory - if (!isSubDir()) return false; - - rewind(); - - // make sure directory is empty - while (curPosition_ < fileSize_) { - dir_t* p = readDirCache(); - if (!p) return false; - // done if past last used entry - if (p->name[0] == DIR_NAME_FREE) break; - // skip empty slot, '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - // error not empty - if (DIR_IS_FILE_OR_SUBDIR(p)) return false; - } - // convert empty directory to normal file for remove - type_ = FAT_FILE_TYPE_NORMAL; - flags_ |= O_WRITE; - return remove(); -} - -/** - * Recursively delete a directory and all contained files. - * - * This is like the Unix/Linux 'rm -rf *' if called with the root directory - * hence the name. - * - * Warning - This will remove all contents of the directory including - * subdirectories. The directory will then be removed if it is not root. - * The read-only attribute for files will be ignored. - * - * \note This function should not be used to delete the 8.3 version of - * a directory that has a long name. See remove() and rmdir(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::rmRfStar() { - uint32_t index; - SdBaseFile f; - rewind(); - while (curPosition_ < fileSize_) { - // remember position - index = curPosition_ / 32; - - dir_t* p = readDirCache(); - if (!p) return false; - - // done if past last entry - if (p->name[0] == DIR_NAME_FREE) break; - - // skip empty slot or '.' or '..' - if (p->name[0] == DIR_NAME_DELETED || p->name[0] == '.') continue; - - // skip if part of long file name or volume label in root - if (!DIR_IS_FILE_OR_SUBDIR(p)) continue; - - if (!f.open(this, index, O_READ)) return false; - if (f.isSubDir()) { - // recursively delete - if (!f.rmRfStar()) return false; - } - else { - // ignore read-only - f.flags_ |= O_WRITE; - if (!f.remove()) return false; - } - // position to next entry if required - if (curPosition_ != (32 * (index + 1))) { - if (!seekSet(32 * (index + 1))) return false; - } - } - // don't try to delete root - if (!isRoot()) { - if (!rmdir()) return false; - } - return true; -} - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdBaseFile::SdBaseFile(const char* path, uint8_t oflag) { - type_ = FAT_FILE_TYPE_CLOSED; - writeError = false; - open(path, oflag); -} - -/** - * Sets a file's position. - * - * \param[in] pos The new position in bytes from the beginning of the file. - * - * \return true for success, false for failure. - */ -bool SdBaseFile::seekSet(const uint32_t pos) { - uint32_t nCur, nNew; - // error if file not open or seek past end of file - if (!isOpen() || pos > fileSize_) return false; - - if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { - curPosition_ = pos; - return true; - } - if (pos == 0) { - curCluster_ = curPosition_ = 0; // set position to start of file - return true; - } - - // calculate cluster index for cur and new position - nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); - nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); - - if (nNew < nCur || curPosition_ == 0) - curCluster_ = firstCluster_; // must follow chain from first cluster - else - nNew -= nCur; // advance from curPosition - - while (nNew--) - if (!vol_->fatGet(curCluster_, &curCluster_)) return false; - - curPosition_ = pos; - return true; -} - -void SdBaseFile::setpos(filepos_t* pos) { - curPosition_ = pos->position; - curCluster_ = pos->cluster; -} - -/** - * The sync() call causes all modified data and directory fields - * to be written to the storage device. - * - * \return true for success, false for failure. - * Reasons for failure include a call to sync() before a file has been - * opened or an I/O error. - */ -bool SdBaseFile::sync() { - // only allow open files and directories - if (!isOpen()) goto FAIL; - - if (flags_ & F_FILE_DIR_DIRTY) { - dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - // check for deleted by another open file object - if (!d || d->name[0] == DIR_NAME_DELETED) goto FAIL; - - // do not set filesize for dir files - if (!isDir()) d->fileSize = fileSize_; - - // update first cluster fields - d->firstClusterLow = firstCluster_ & 0xFFFF; - d->firstClusterHigh = firstCluster_ >> 16; - - // set modify time if user supplied a callback date/time function - if (dateTime_) { - dateTime_(&d->lastWriteDate, &d->lastWriteTime); - d->lastAccessDate = d->lastWriteDate; - } - // clear directory dirty - flags_ &= ~F_FILE_DIR_DIRTY; - } - return vol_->cacheFlush(); - - FAIL: - writeError = true; - return false; -} - -/** - * Copy a file's timestamps - * - * \param[in] file File to copy timestamps from. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(SdBaseFile* file) { - dir_t* d; - dir_t dir; - - // get timestamps - if (!file->dirEntry(&dir)) return false; - - // update directory fields - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - // copy timestamps - d->lastAccessDate = dir.lastAccessDate; - d->creationDate = dir.creationDate; - d->creationTime = dir.creationTime; - d->creationTimeTenths = dir.creationTimeTenths; - d->lastWriteDate = dir.lastWriteDate; - d->lastWriteTime = dir.lastWriteTime; - - // write back entry - return vol_->cacheFlush(); -} - -/** - * Set a file's timestamps in its directory entry. - * - * \param[in] flags Values for \a flags are constructed by a bitwise-inclusive - * OR of flags from the following list - * - * T_ACCESS - Set the file's last access date. - * - * T_CREATE - Set the file's creation date and time. - * - * T_WRITE - Set the file's last write/modification date and time. - * - * \param[in] year Valid range 1980 - 2107 inclusive. - * - * \param[in] month Valid range 1 - 12 inclusive. - * - * \param[in] day Valid range 1 - 31 inclusive. - * - * \param[in] hour Valid range 0 - 23 inclusive. - * - * \param[in] minute Valid range 0 - 59 inclusive. - * - * \param[in] second Valid range 0 - 59 inclusive - * - * \note It is possible to set an invalid date since there is no check for - * the number of days in a month. - * - * \note - * Modify and access timestamps may be overwritten if a date time callback - * function has been set by dateTimeCallback(). - * - * \return true for success, false for failure. - */ -bool SdBaseFile::timestamp(uint8_t flags, uint16_t year, uint8_t month, - uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { - uint16_t dirDate, dirTime; - dir_t* d; - - if (!isOpen() - || year < 1980 - || year > 2107 - || month < 1 - || month > 12 - || day < 1 - || day > 31 - || hour > 23 - || minute > 59 - || second > 59) { - return false; - } - // update directory entry - if (!sync()) return false; - - d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!d) return false; - - dirDate = FAT_DATE(year, month, day); - dirTime = FAT_TIME(hour, minute, second); - if (flags & T_ACCESS) { - d->lastAccessDate = dirDate; - } - if (flags & T_CREATE) { - d->creationDate = dirDate; - d->creationTime = dirTime; - // seems to be units of 1/100 second not 1/10 as Microsoft states - d->creationTimeTenths = second & 1 ? 100 : 0; - } - if (flags & T_WRITE) { - d->lastWriteDate = dirDate; - d->lastWriteTime = dirTime; - } - return vol_->cacheFlush(); -} - -/** - * Truncate a file to a specified length. The current file position - * will be maintained if it is less than or equal to \a length otherwise - * it will be set to end of file. - * - * \param[in] length The desired length for the file. - * - * \return true for success, false for failure. - * Reasons for failure include file is read only, file is a directory, - * \a length is greater than the current file size or an I/O error occurs. - */ -bool SdBaseFile::truncate(uint32_t length) { - uint32_t newPos; - // error if not a normal file or read-only - if (!isFile() || !(flags_ & O_WRITE)) return false; - - // error if length is greater than current size - if (length > fileSize_) return false; - - // fileSize and length are zero - nothing to do - if (fileSize_ == 0) return true; - - // remember position for seek after truncation - newPos = curPosition_ > length ? length : curPosition_; - - // position to last cluster in truncated file - if (!seekSet(length)) return false; - - if (length == 0) { - // free all clusters - if (!vol_->freeChain(firstCluster_)) return false; - firstCluster_ = 0; - } - else { - uint32_t toFree; - if (!vol_->fatGet(curCluster_, &toFree)) return false; - - if (!vol_->isEOC(toFree)) { - // free extra clusters - if (!vol_->freeChain(toFree)) return false; - - // current cluster is end of chain - if (!vol_->fatPutEOC(curCluster_)) return false; - } - } - fileSize_ = length; - - // need to update directory entry - flags_ |= F_FILE_DIR_DIRTY; - - if (!sync()) return false; - - // set file to correct position - return seekSet(newPos); -} - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { - // convert void* to uint8_t* - must be before goto statements - const uint8_t* src = reinterpret_cast(buf); - - // number of bytes left to write - must be before goto statements - uint16_t nToWrite = nbyte; - - // error if not a normal file or is read-only - if (!isFile() || !(flags_ & O_WRITE)) goto FAIL; - - // seek to end of file if append flag - if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { - if (!seekEnd()) goto FAIL; - } - - while (nToWrite > 0) { - uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); - uint16_t blockOffset = curPosition_ & 0x1FF; - if (blockOfCluster == 0 && blockOffset == 0) { - // start of new cluster - if (curCluster_ == 0) { - if (firstCluster_ == 0) { - // allocate first cluster of file - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = firstCluster_; - } - } - else { - uint32_t next; - if (!vol_->fatGet(curCluster_, &next)) goto FAIL; - if (vol_->isEOC(next)) { - // add cluster if at end of chain - if (!addCluster()) goto FAIL; - } - else { - curCluster_ = next; - } - } - } - // max space in block - uint16_t n = 512 - blockOffset; - - // lesser of space and amount to write - NOMORE(n, nToWrite); - - // block for data write - uint32_t block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; - if (n == 512) { - // full block - don't need to use cache - if (vol_->cacheBlockNumber() == block) { - // invalidate cache if block is in cache - vol_->cacheSetBlockNumber(0xFFFFFFFF, false); - } - if (!vol_->writeBlock(block, src)) goto FAIL; - } - else { - if (blockOffset == 0 && curPosition_ >= fileSize_) { - // start of new block don't need to read into cache - if (!vol_->cacheFlush()) goto FAIL; - // set cache dirty and SD address of block - vol_->cacheSetBlockNumber(block, true); - } - else { - // rewrite part of block - if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto FAIL; - } - uint8_t* dst = vol_->cache()->data + blockOffset; - memcpy(dst, src, n); - } - curPosition_ += n; - src += n; - nToWrite -= n; - } - if (curPosition_ > fileSize_) { - // update fileSize and insure sync will update dir entry - fileSize_ = curPosition_; - flags_ |= F_FILE_DIR_DIRTY; - } - else if (dateTime_ && nbyte) { - // insure sync will update modified date and time - flags_ |= F_FILE_DIR_DIRTY; - } - - if (flags_ & O_SYNC) { - if (!sync()) goto FAIL; - } - return nbyte; - - FAIL: - // return for write error - writeError = true; - return -1; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.h deleted file mode 100644 index 4d4062b1cd..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdBaseFile.h +++ /dev/null @@ -1,387 +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 - -/** - * \file - * \brief SdBaseFile class - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "SdFatConfig.h" -#include "SdVolume.h" - -#include - -/** - * \struct filepos_t - * \brief internal type for istream - * do not use in user apps - */ -struct filepos_t { - uint32_t position; // stream byte position - uint32_t cluster; // cluster of position - filepos_t() : position(0), cluster(0) {} -}; - -// use the gnu style oflag in open() -uint8_t const O_READ = 0x01, // open() oflag for reading - O_RDONLY = O_READ, // open() oflag - same as O_IN - O_WRITE = 0x02, // open() oflag for write - O_WRONLY = O_WRITE, // open() oflag - same as O_WRITE - O_RDWR = (O_READ | O_WRITE), // open() oflag for reading and writing - O_ACCMODE = (O_READ | O_WRITE), // open() oflag mask for access modes - O_APPEND = 0x04, // The file offset shall be set to the end of the file prior to each write. - O_SYNC = 0x08, // Synchronous writes - call sync() after each write - O_TRUNC = 0x10, // Truncate the file to zero length - O_AT_END = 0x20, // Set the initial position at the end of the file - O_CREAT = 0x40, // Create the file if nonexistent - O_EXCL = 0x80; // If O_CREAT and O_EXCL are set, open() shall fail if the file exists - -// SdBaseFile class static and const definitions - -// flags for ls() -uint8_t const LS_DATE = 1, // ls() flag to print modify date - LS_SIZE = 2, // ls() flag to print file size - LS_R = 4; // ls() flag for recursive list of subdirectories - - -// flags for timestamp -uint8_t const T_ACCESS = 1, // Set the file's last access date - T_CREATE = 2, // Set the file's creation date and time - T_WRITE = 4; // Set the file's write date and time - -// values for type_ -uint8_t const FAT_FILE_TYPE_CLOSED = 0, // This file has not been opened. - FAT_FILE_TYPE_NORMAL = 1, // A normal file - FAT_FILE_TYPE_ROOT_FIXED = 2, // A FAT12 or FAT16 root directory - FAT_FILE_TYPE_ROOT32 = 3, // A FAT32 root directory - FAT_FILE_TYPE_SUBDIR = 4, // A subdirectory file - FAT_FILE_TYPE_MIN_DIR = FAT_FILE_TYPE_ROOT_FIXED; // Test value for directory type - -/** - * date field for FAT directory entry - * \param[in] year [1980,2107] - * \param[in] month [1,12] - * \param[in] day [1,31] - * - * \return Packed date for dir_t entry. - */ -static inline uint16_t FAT_DATE(uint16_t year, uint8_t month, uint8_t day) { return (year - 1980) << 9 | month << 5 | day; } - -/** - * year part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted year [1980,2107] - */ -static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9); } - -/** - * month part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted month [1,12] - */ -static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0xF; } - -/** - * day part of FAT directory date field - * \param[in] fatDate Date in packed dir format. - * - * \return Extracted day [1,31] - */ -static inline uint8_t FAT_DAY(uint16_t fatDate) { return fatDate & 0x1F; } - -/** - * time field for FAT directory entry - * \param[in] hour [0,23] - * \param[in] minute [0,59] - * \param[in] second [0,59] - * - * \return Packed time for dir_t entry. - */ -static inline uint16_t FAT_TIME(uint8_t hour, uint8_t minute, uint8_t second) { return hour << 11 | minute << 5 | second >> 1; } - -/** - * hour part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted hour [0,23] - */ -static inline uint8_t FAT_HOUR(uint16_t fatTime) { return fatTime >> 11; } - -/** - * minute part of FAT directory time field - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted minute [0,59] - */ -static inline uint8_t FAT_MINUTE(uint16_t fatTime) { return (fatTime >> 5) & 0x3F; } - -/** - * second part of FAT directory time field - * Note second/2 is stored in packed time. - * - * \param[in] fatTime Time in packed dir format. - * - * \return Extracted second [0,58] - */ -static inline uint8_t FAT_SECOND(uint16_t fatTime) { return 2 * (fatTime & 0x1F); } - -// Default date for file timestamps is 1 Jan 2000 -uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1; -// Default time for file timestamp is 1 am -uint16_t const FAT_DEFAULT_TIME = (1 << 11); - -/** - * \class SdBaseFile - * \brief Base class for SdFile with Print and C++ streams. - */ -class SdBaseFile { - public: - SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} - SdBaseFile(const char* path, uint8_t oflag); - ~SdBaseFile() { if (isOpen()) close(); } - - /** - * writeError is set to true if an error occurs during a write(). - * Set writeError to false before calling print() and/or write() and check - * for true after calls to print() and/or write(). - */ - bool writeError; - - // helpers for stream classes - - /** - * get position for streams - * \param[out] pos struct to receive position - */ - void getpos(filepos_t* pos); - - /** - * set position for streams - * \param[out] pos struct with value for new position - */ - void setpos(filepos_t* pos); - - bool close(); - bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); - bool createContiguous(SdBaseFile* dirFile, - const char* path, uint32_t size); - /** - * \return The current cluster number for a file or directory. - */ - uint32_t curCluster() const { return curCluster_; } - - /** - * \return The current position for a file or directory. - */ - uint32_t curPosition() const { return curPosition_; } - - /** - * \return Current working directory - */ - static SdBaseFile* cwd() { return cwd_; } - - /** - * Set the date/time callback function - * - * \param[in] dateTime The user's call back function. The callback - * function is of the form: - * - * \code - * void dateTime(uint16_t* date, uint16_t* time) { - * uint16_t year; - * uint8_t month, day, hour, minute, second; - * - * // User gets date and time from GPS or real-time clock here - * - * // return date using FAT_DATE macro to format fields - * *date = FAT_DATE(year, month, day); - * - * // return time using FAT_TIME macro to format fields - * *time = FAT_TIME(hour, minute, second); - * } - * \endcode - * - * Sets the function that is called when a file is created or when - * a file's directory entry is modified by sync(). All timestamps, - * access, creation, and modify, are set when a file is created. - * sync() maintains the last access date and last modify date/time. - * - * See the timestamp() function. - */ - static void dateTimeCallback( - void (*dateTime)(uint16_t* date, uint16_t* time)) { - dateTime_ = dateTime; - } - - /** - * Cancel the date/time callback function. - */ - static void dateTimeCallbackCancel() { dateTime_ = 0; } - bool dirEntry(dir_t* dir); - static void dirName(const dir_t& dir, char* name); - bool exists(const char* name); - int16_t fgets(char* str, int16_t num, char* delim = 0); - - /** - * \return The total number of bytes in a file or directory. - */ - uint32_t fileSize() const { return fileSize_; } - - /** - * \return The first cluster number for a file or directory. - */ - uint32_t firstCluster() const { return firstCluster_; } - - /** - * \return True if this is a directory else false. - */ - bool isDir() const { return type_ >= FAT_FILE_TYPE_MIN_DIR; } - - /** - * \return True if this is a normal file else false. - */ - bool isFile() const { return type_ == FAT_FILE_TYPE_NORMAL; } - - /** - * \return True if this is an open file/directory else false. - */ - bool isOpen() const { return type_ != FAT_FILE_TYPE_CLOSED; } - - /** - * \return True if this is a subdirectory else false. - */ - bool isSubDir() const { return type_ == FAT_FILE_TYPE_SUBDIR; } - - /** - * \return True if this is the root directory. - */ - bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - - 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); - bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag); - bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag); - bool open(const char* path, uint8_t oflag = O_READ); - bool openNext(SdBaseFile* dirFile, uint8_t oflag); - bool openRoot(SdVolume* vol); - int peek(); - static void printFatDate(uint16_t fatDate); - static void printFatTime(uint16_t fatTime); - bool printName(); - int16_t read(); - int16_t read(void* buf, uint16_t nbyte); - int8_t readDir(dir_t* dir, char* longFilename); - static bool remove(SdBaseFile* dirFile, const char* path); - bool remove(); - - /** - * Set the file's current position to zero. - */ - void rewind() { seekSet(0); } - bool rename(SdBaseFile* dirFile, const char* newPath); - bool rmdir(); - bool rmRfStar(); - - /** - * Set the files position to current position + \a pos. See seekSet(). - * \param[in] offset The new position in bytes from the current position. - * \return true for success or false for failure. - */ - bool seekCur(const int32_t offset) { return seekSet(curPosition_ + offset); } - - /** - * Set the files position to end-of-file + \a offset. See seekSet(). - * \param[in] offset The new position in bytes from end-of-file. - * \return true for success or false for failure. - */ - bool seekEnd(const int32_t offset = 0) { return seekSet(fileSize_ + offset); } - bool seekSet(const uint32_t pos); - bool sync(); - bool timestamp(SdBaseFile* file); - bool timestamp(uint8_t flag, uint16_t year, uint8_t month, uint8_t day, - uint8_t hour, uint8_t minute, uint8_t second); - - /** - * Type of file. Use isFile() or isDir() instead of type() if possible. - * - * \return The file or directory type. - */ - uint8_t type() const { return type_; } - bool truncate(uint32_t size); - - /** - * \return SdVolume that contains this file. - */ - SdVolume* volume() const { return vol_; } - int16_t write(const void* buf, uint16_t nbyte); - - private: - friend class SdFat; // allow SdFat to set cwd_ - static SdBaseFile* cwd_; // global pointer to cwd dir - - // data time callback function - static void (*dateTime_)(uint16_t* date, uint16_t* time); - - // bits defined in flags_ - static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC), // should be 0x0F - F_FILE_DIR_DIRTY = 0x80; // sync of directory entry required - - // private data - uint8_t flags_; // See above for definition of flags_ bits - uint8_t fstate_; // error and eof indicator - uint8_t type_; // type of file see above for values - uint32_t curCluster_; // cluster for current file position - uint32_t curPosition_; // current file position in bytes from beginning - uint32_t dirBlock_; // block for this files directory entry - uint8_t dirIndex_; // index of directory entry in dirBlock - uint32_t fileSize_; // file size in bytes - uint32_t firstCluster_; // first cluster of file - SdVolume* vol_; // volume where file is located - - /** - * EXPERIMENTAL - Don't use! - */ - //bool openParent(SdBaseFile* dir); - - // private functions - bool addCluster(); - bool addDirCluster(); - dir_t* cacheDirEntry(uint8_t action); - int8_t lsPrintNext(uint8_t flags, uint8_t indent); - static bool make83Name(const char* str, uint8_t* name, const char** ptr); - bool mkdir(SdBaseFile* parent, const uint8_t dname[11]); - bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); - bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); - dir_t* readDirCache(); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatConfig.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatConfig.h deleted file mode 100644 index 8ab6aef1c6..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatConfig.h +++ /dev/null @@ -1,106 +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 - -/** - * SdFatConfig.h - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -/** - * To use multiple SD cards set USE_MULTIPLE_CARDS nonzero. - * - * Using multiple cards costs 400 - 500 bytes of flash. - * - * Each card requires about 550 bytes of SRAM so use of a Mega is recommended. - */ -#define USE_MULTIPLE_CARDS 0 - -/** - * Call flush for endl if ENDL_CALLS_FLUSH is nonzero - * - * The standard for iostreams is to call flush. This is very costly for - * SdFat. Each call to flush causes 2048 bytes of I/O to the SD. - * - * SdFat has a single 512 byte buffer for SD I/O so it must write the current - * data block to the SD, read the directory block from the SD, update the - * directory entry, write the directory block to the SD and read the data - * block back into the buffer. - * - * The SD flash memory controller is not designed for this many rewrites - * so performance may be reduced by more than a factor of 100. - * - * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force - * all data to be written to the SD. - */ -#define ENDL_CALLS_FLUSH 0 - -/** - * Allow FAT12 volumes if FAT12_SUPPORT is nonzero. - * FAT12 has not been well tested. - */ -#define FAT12_SUPPORT 0 - -/** - * SPI init rate for SD initialization commands. Must be 5 (F_CPU/64) - * or 6 (F_CPU/128). - */ -#define SPI_SD_INIT_RATE 5 - -/** - * Set the SS pin high for hardware SPI. If SS is chip select for another SPI - * device this will disable that device during the SD init phase. - */ -#define SET_SPI_SS_HIGH 1 - -/** - * Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos. - * Pins used are SS 10, MOSI 11, MISO 12, and SCK 13. - * - * MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used - * on Mega Arduinos. Software SPI works well with GPS Shield V1.1 - * but many SD cards will fail with GPS Shield V1.0. - */ -#define MEGA_SOFT_SPI 0 - -// Set USE_SOFTWARE_SPI nonzero to ALWAYS use Software SPI. -#define USE_SOFTWARE_SPI 0 - -/** - * The __cxa_pure_virtual function is an error handler that is invoked when - * a pure virtual function is called. - */ -#define USE_CXA_PURE_VIRTUAL 1 - -/** - * Defines for 8.3 and long (vfat) filenames - */ - -#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry - -// Total bytes needed to store a single long filename -#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatStructs.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatStructs.h deleted file mode 100644 index ddf6546a0c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatStructs.h +++ /dev/null @@ -1,614 +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 - -/** - * \file - * \brief FAT file structures - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include - -#define PACKED __attribute__((__packed__)) - -/** - * mostly from Microsoft document fatgen103.doc - * http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx - */ - -uint8_t const BOOTSIG0 = 0x55, // Value for byte 510 of boot block or MBR - BOOTSIG1 = 0xAA, // Value for byte 511 of boot block or MBR - EXTENDED_BOOT_SIG = 0x29; // Value for bootSignature field int FAT/FAT32 boot sector - -/** - * \struct partitionTable - * \brief MBR partition table entry - * - * A partition table entry for a MBR formatted storage device. - * The MBR partition table has four entries. - */ -struct partitionTable { - /** - * Boot Indicator . Indicates whether the volume is the active - * partition. Legal values include: 0x00. Do not use for booting. - * 0x80 Active partition. - */ - uint8_t boot; - /** - * Head part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t beginHead; - /** - * Sector part of Cylinder-head-sector address of the first block in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned beginSector : 6; - /** High bits cylinder for first block in partition. */ - unsigned beginCylinderHigh : 2; - /** - * Combine beginCylinderLow with beginCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t beginCylinderLow; - /** - * Partition type. See defines that begin with PART_TYPE_ for - * some Microsoft partition types. - */ - uint8_t type; - /** - * head part of cylinder-head-sector address of the last sector in the - * partition. Legal values are 0-255. Only used in old PC BIOS. - */ - uint8_t endHead; - /** - * Sector part of cylinder-head-sector address of the last sector in - * the partition. Legal values are 1-63. Only used in old PC BIOS. - */ - unsigned endSector : 6; - /** High bits of end cylinder */ - unsigned endCylinderHigh : 2; - /** - * Combine endCylinderLow with endCylinderHigh. Legal values - * are 0-1023. Only used in old PC BIOS. - */ - uint8_t endCylinderLow; - - uint32_t firstSector; // Logical block address of the first block in the partition. - uint32_t totalSectors; // Length of the partition, in blocks. -} PACKED; - -typedef struct partitionTable part_t; // Type name for partitionTable - -/** - * \struct masterBootRecord - * - * \brief Master Boot Record - * - * The first block of a storage device that is formatted with a MBR. - */ -struct masterBootRecord { - uint8_t codeArea[440]; // Code Area for master boot program. - uint32_t diskSignature; // Optional Windows NT disk signature. May contain boot code. - uint16_t usuallyZero; // Usually zero but may be more boot code. - part_t part[4]; // Partition tables. - uint8_t mbrSig0; // First MBR signature byte. Must be 0x55 - uint8_t mbrSig1; // Second MBR signature byte. Must be 0xAA -} PACKED; -/** Type name for masterBootRecord */ -typedef struct masterBootRecord mbr_t; - -/** - * \struct fat_boot - * - * \brief Boot sector for a FAT12/FAT16 volume. - * - */ -struct fat_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. The value of this field is always 1. - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * For FAT12 and FAT16 volumes, this field contains the count of - * 32-byte directory entries in the root directory. For FAT32 volumes, - * this field must be set to 0. For FAT12 and FAT16 volumes, this - * value should always specify a count that when multiplied by 32 - * results in a multiple of bytesPerSector. FAT16 volumes should - * use the value 512. - */ - uint16_t rootDirEntryCount; - /** - * This field is the old 16-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then totalSectors32 - * must be nonzero. For FAT32 volumes, this field must be 0. For - * FAT12 and FAT16 volumes, this field contains the sector count, and - * totalSectors32 is 0 if the total sector count fits - * (is less than 0x10000). - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * Count of sectors occupied by one FAT on FAT12/FAT16 volumes. - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * This field is the new 32-bit total count of sectors on the volume. - * This count includes the count of all sectors in all four regions - * of the volume. This field can be 0; if it is 0, then - * totalSectors16 must be nonzero. - */ - uint32_t totalSectors32; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A field with a value of either FAT, FAT12 or FAT16, - * depending on the disk format. - */ - char fileSystemType[8]; - - uint8_t bootCode[448]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA -} PACKED; - -typedef struct fat_boot fat_boot_t; // Type name for FAT Boot Sector - -/** - * \struct fat32_boot - * - * \brief Boot sector for a FAT32 volume. - */ -struct fat32_boot { - /** - * The first three bytes of the boot sector must be valid, - * executable x 86-based CPU instructions. This includes a - * jump instruction that skips the next nonexecutable bytes. - */ - uint8_t jump[3]; - /** - * This is typically a string of characters that identifies - * the operating system that formatted the volume. - */ - char oemId[8]; - /** - * The size of a hardware sector. Valid decimal values for this - * field are 512, 1024, 2048, and 4096. For most disks used in - * the United States, the value of this field is 512. - */ - uint16_t bytesPerSector; - /** - * Number of sectors per allocation unit. This value must be a - * power of 2 that is greater than 0. The legal values are - * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided. - */ - uint8_t sectorsPerCluster; - /** - * The number of sectors preceding the start of the first FAT, - * including the boot sector. Must not be zero - */ - uint16_t reservedSectorCount; - /** - * The number of copies of the FAT on the volume. - * The value of this field is always 2. - */ - uint8_t fatCount; - /** - * FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0. - */ - uint16_t rootDirEntryCount; - /** - * For FAT32 volumes, this field must be 0. - */ - uint16_t totalSectors16; - /** - * This dates back to the old MS-DOS 1.x media determination and is - * no longer usually used for anything. 0xF8 is the standard value - * for fixed (nonremovable) media. For removable media, 0xF0 is - * frequently used. Legal values are 0xF0 or 0xF8-0xFF. - */ - uint8_t mediaType; - /** - * On FAT32 volumes this field must be 0, and sectorsPerFat32 - * contains the FAT size count. - */ - uint16_t sectorsPerFat16; - - uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise. - uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise. - - /** - * Count of hidden sectors preceding the partition that contains this - * FAT volume. This field is generally only relevant for media - * visible on interrupt 0x13. - */ - uint32_t hidddenSectors; - /** - * Contains the total number of sectors in the FAT32 volume. - */ - uint32_t totalSectors32; - /** - * Count of sectors occupied by one FAT on FAT32 volumes. - */ - uint32_t sectorsPerFat32; - /** - * This field is only defined for FAT32 media and does not exist on - * FAT12 and FAT16 media. - * Bits 0-3 -- Zero-based number of active FAT. - * Only valid if mirroring is disabled. - * Bits 4-6 -- Reserved. - * Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs. - * -- 1 means only one FAT is active; it is the one referenced - * in bits 0-3. - * Bits 8-15 -- Reserved. - */ - uint16_t fat32Flags; - /** - * FAT32 version. High byte is major revision number. - * Low byte is minor revision number. Only 0.0 define. - */ - uint16_t fat32Version; - /** - * Cluster number of the first cluster of the root directory for FAT32. - * This usually 2 but not required to be 2. - */ - uint32_t fat32RootCluster; - /** - * Sector number of FSINFO structure in the reserved area of the - * FAT32 volume. Usually 1. - */ - uint16_t fat32FSInfo; - /** - * If nonzero, indicates the sector number in the reserved area - * of the volume of a copy of the boot record. Usually 6. - * No value other than 6 is recommended. - */ - uint16_t fat32BackBootBlock; - /** - * Reserved for future expansion. Code that formats FAT32 volumes - * should always set all of the bytes of this field to 0. - */ - uint8_t fat32Reserved[12]; - /** - * Related to the BIOS physical drive number. Floppy drives are - * identified as 0x00 and physical hard disks are identified as - * 0x80, regardless of the number of physical disk drives. - * Typically, this value is set prior to issuing an INT 13h BIOS - * call to specify the device to access. The value is only - * relevant if the device is a boot device. - */ - uint8_t driveNumber; - - uint8_t reserved1; // Used by Windows NT - should be zero for FAT - uint8_t bootSignature; // 0x29 if next three fields are valid - - /** - * A random serial number created when formatting a disk, - * which helps to distinguish between disks. - * Usually generated by combining date and time. - */ - uint32_t volumeSerialNumber; - /** - * A field once used to store the volume label. The volume label - * is now stored as a special file in the root directory. - */ - char volumeLabel[11]; - /** - * A text field with a value of FAT32. - */ - char fileSystemType[8]; - - uint8_t bootCode[420]; // X86 boot code - uint8_t bootSectorSig0; // must be 0x55 - uint8_t bootSectorSig1; // must be 0xAA - -} PACKED; - -typedef struct fat32_boot fat32_boot_t; // Type name for FAT32 Boot Sector - -uint32_t const FSINFO_LEAD_SIG = 0x41615252, // 'AaRR' Lead signature for a FSINFO sector - FSINFO_STRUCT_SIG = 0x61417272; // 'aArr' Struct signature for a FSINFO sector - -/** - * \struct fat32_fsinfo - * - * \brief FSINFO sector for a FAT32 volume. - * - */ -struct fat32_fsinfo { - uint32_t leadSignature; // must be 0x52, 0x52, 0x61, 0x41 'RRaA' - uint8_t reserved1[480]; // must be zero - uint32_t structSignature; // must be 0x72, 0x72, 0x41, 0x61 'rrAa' - /** - * Contains the last known free cluster count on the volume. - * If the value is 0xFFFFFFFF, then the free count is unknown - * and must be computed. Any other value can be used, but is - * not necessarily correct. It should be range checked at least - * to make sure it is <= volume cluster count. - */ - uint32_t freeCount; - /** - * This is a hint for the FAT driver. It indicates the cluster - * number at which the driver should start looking for free clusters. - * If the value is 0xFFFFFFFF, then there is no hint and the driver - * should start looking at cluster 2. - */ - uint32_t nextFree; - - uint8_t reserved2[12]; // must be zero - uint8_t tailSignature[4]; // must be 0x00, 0x00, 0x55, 0xAA -} PACKED; - -typedef struct fat32_fsinfo fat32_fsinfo_t; // Type name for FAT32 FSINFO Sector - -// End Of Chain values for FAT entries -uint16_t const FAT12EOC = 0xFFF, // FAT12 end of chain value used by Microsoft. - FAT12EOC_MIN = 0xFF8, // Minimum value for FAT12 EOC. Use to test for EOC. - FAT16EOC = 0xFFFF, // FAT16 end of chain value used by Microsoft. - FAT16EOC_MIN = 0xFFF8; // Minimum value for FAT16 EOC. Use to test for EOC. -uint32_t const FAT32EOC = 0x0FFFFFFF, // FAT32 end of chain value used by Microsoft. - FAT32EOC_MIN = 0x0FFFFFF8, // Minimum value for FAT32 EOC. Use to test for EOC. - FAT32MASK = 0x0FFFFFFF; // Mask a for FAT32 entry. Entries are 28 bits. - -/** - * \struct directoryEntry - * \brief FAT short directory entry - * - * Short means short 8.3 name, not the entry size. - * - * Date Format. A FAT directory entry date stamp is a 16-bit field that is - * basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the - * format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the - * 16-bit word): - * - * Bits 9-15: Count of years from 1980, valid value range 0-127 - * inclusive (1980-2107). - * - * Bits 5-8: Month of year, 1 = January, valid value range 1-12 inclusive. - * - * Bits 0-4: Day of month, valid value range 1-31 inclusive. - * - * Time Format. A FAT directory entry time stamp is a 16-bit field that has - * a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the - * 16-bit word, bit 15 is the MSB of the 16-bit word). - * - * Bits 11-15: Hours, valid value range 0-23 inclusive. - * - * Bits 5-10: Minutes, valid value range 0-59 inclusive. - * - * Bits 0-4: 2-second count, valid value range 0-29 inclusive (0 - 58 seconds). - * - * The valid time range is from Midnight 00:00:00 to 23:59:58. - */ -struct directoryEntry { - /** - * Short 8.3 name. - * - * The first eight bytes contain the file name with blank fill. - * The last three bytes contain the file extension with blank fill. - */ - uint8_t name[11]; - /** - * Entry attributes. - * - * The upper two bits of the attribute byte are reserved and should - * always be set to 0 when a file is created and never modified or - * looked at after that. See defines that begin with DIR_ATT_. - */ - uint8_t attributes; - /** - * Reserved for use by Windows NT. Set value to 0 when a file is - * created and never modify or look at it after that. - */ - uint8_t reservedNT; - /** - * The granularity of the seconds part of creationTime is 2 seconds - * so this field is a count of tenths of a second and it's valid - * value range is 0-199 inclusive. (WHG note - seems to be hundredths) - */ - uint8_t creationTimeTenths; - - uint16_t creationTime; // Time file was created. - uint16_t creationDate; // Date file was created. - - /** - * Last access date. Note that there is no last access time, only - * a date. This is the date of last read or write. In the case of - * a write, this should be set to the same date as lastWriteDate. - */ - uint16_t lastAccessDate; - /** - * High word of this entry's first cluster number (always 0 for a - * FAT12 or FAT16 volume). - */ - uint16_t firstClusterHigh; - - uint16_t lastWriteTime; // Time of last write. File creation is considered a write. - uint16_t lastWriteDate; // Date of last write. File creation is considered a write. - uint16_t firstClusterLow; // Low word of this entry's first cluster number. - uint32_t fileSize; // 32-bit unsigned holding this file's size in bytes. -} PACKED; - -/** - * \struct directoryVFATEntry - * \brief VFAT long filename directory entry - * - * directoryVFATEntries are found in the same list as normal directoryEntry. - * But have the attribute field set to DIR_ATT_LONG_NAME. - * - * Long filenames are saved in multiple directoryVFATEntries. - * Each entry containing 13 UTF-16 characters. - */ -struct directoryVFATEntry { - /** - * Sequence number. Consists of 2 parts: - * bit 6: indicates first long filename block for the next file - * bit 0-4: the position of this long filename block (first block is 1) - */ - uint8_t sequenceNumber; - - uint16_t name1[5]; // First set of UTF-16 characters - uint8_t attributes; // attributes (at the same location as in directoryEntry), always 0x0F - uint8_t reservedNT; // Reserved for use by Windows NT. Always 0. - uint8_t checksum; // Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. - uint16_t name2[6]; // Second set of UTF-16 characters - uint16_t firstClusterLow; // firstClusterLow is always zero for longFilenames - uint16_t name3[2]; // Third set of UTF-16 characters -} PACKED; - -// Definitions for directory entries -// -typedef struct directoryEntry dir_t; // Type name for directoryEntry -typedef struct directoryVFATEntry vfat_t; // Type name for directoryVFATEntry - -uint8_t const DIR_NAME_0xE5 = 0x05, // escape for name[0] = 0xE5 - DIR_NAME_DELETED = 0xE5, // name[0] value for entry that is free after being "deleted" - DIR_NAME_FREE = 0x00, // name[0] value for entry that is free and no allocated entries follow - DIR_ATT_READ_ONLY = 0x01, // file is read-only - DIR_ATT_HIDDEN = 0x02, // File should hidden in directory listings - DIR_ATT_SYSTEM = 0x04, // Entry is for a system file - DIR_ATT_VOLUME_ID = 0x08, // Directory entry contains the volume label - DIR_ATT_DIRECTORY = 0x10, // Entry is for a directory - DIR_ATT_ARCHIVE = 0x20, // Old DOS archive bit for backup support - DIR_ATT_LONG_NAME = 0x0F, // Test value for long name entry. Test is (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. - DIR_ATT_LONG_NAME_MASK = 0x3F, // Test mask for long name entry - DIR_ATT_DEFINED_BITS = 0x3F; // defined attribute bits - -/** - * Directory entry is part of a long name - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for part of a long name else false. - */ -static inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) { - return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME; -} - -/** Mask for file/subdirectory tests */ -uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY); - -/** - * Directory entry is for a file - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file else false. - */ -static inline uint8_t DIR_IS_FILE(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0; -} - -/** - * Directory entry is for a subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a subdirectory else false. - */ -static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY; -} - -/** - * Directory entry is for a file or subdirectory - * \param[in] dir Pointer to a directory entry. - * - * \return true if the entry is for a normal file or subdirectory else false. - */ -static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { - return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.cpp deleted file mode 100644 index 428ed219af..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.cpp +++ /dev/null @@ -1,60 +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 . - * - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFatUtil.h" -#include - -/** - * Amount of free RAM - * \return The number of free bytes. - */ -#ifdef __arm__ - - extern "C" char* sbrk(int incr); - int SdFatUtil::FreeRam() { - char top; - return &top - reinterpret_cast(sbrk(0)); - } - -#else - - extern char* __brkval; - extern char __bss_end; - int SdFatUtil::FreeRam() { - char top; - return __brkval ? &top - __brkval : &top - &__bss_end; - } - -#endif - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.h deleted file mode 100644 index ff31a10a10..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFatUtil.h +++ /dev/null @@ -1,40 +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 - -/** - * Arduino SdFat Library - * Copyright (c) 2008 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -/** - * \file - * \brief Useful utility functions. - */ - -namespace SdFatUtil { - int FreeRam(); -} - -using namespace SdFatUtil; // NOLINT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.cpp deleted file mode 100644 index aa9c192e93..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.cpp +++ /dev/null @@ -1,101 +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 . - * - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdFile.h" - -/** - * Create a file object and open it in the current working directory. - * - * \param[in] path A path with a valid 8.3 DOS name for a file to be opened. - * - * \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive - * OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t). - */ -SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { } - -/** - * Write data to an open file. - * - * \note Data is moved to the cache but may not be written to the - * storage device until sync() is called. - * - * \param[in] buf Pointer to the location of the data to be written. - * - * \param[in] nbyte Number of bytes to write. - * - * \return For success write() returns the number of bytes written, always - * \a nbyte. If an error occurs, write() returns -1. Possible errors - * include write() is called before a file has been opened, write is called - * for a read-only file, device is full, a corrupt file system or an I/O error. - * - */ -int16_t SdFile::write(const void* buf, uint16_t nbyte) { return SdBaseFile::write(buf, nbyte); } - -/** - * Write a byte to a file. Required by the Arduino Print class. - * \param[in] b the byte to be written. - * Use writeError to check for errors. - */ -#if ARDUINO >= 100 - size_t SdFile::write(uint8_t b) { return SdBaseFile::write(&b, 1); } -#else - void SdFile::write(uint8_t b) { SdBaseFile::write(&b, 1); } -#endif - -/** - * Write a string to a file. Used by the Arduino Print class. - * \param[in] str Pointer to the string. - * Use writeError to check for errors. - */ -void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); } - -/** - * Write a PROGMEM string to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::write_P(PGM_P str) { - for (uint8_t c; (c = pgm_read_byte(str)); str++) write(c); -} - -/** - * Write a PROGMEM string followed by CR/LF to a file. - * \param[in] str Pointer to the PROGMEM string. - * Use writeError to check for errors. - */ -void SdFile::writeln_P(PGM_P str) { - write_P(str); - write_P(PSTR("\r\n")); -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.h deleted file mode 100644 index ff33d8715b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdFile.h +++ /dev/null @@ -1,59 +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 - -/** - * \file - * \brief SdFile class - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "SdBaseFile.h" - -#include -#include - -/** - * \class SdFile - * \brief SdBaseFile with Print. - */ -class SdFile : public SdBaseFile/*, public Print*/ { - public: - SdFile() {} - SdFile(const char* name, uint8_t oflag); - #if ARDUINO >= 100 - size_t write(uint8_t b); - #else - void write(uint8_t b); - #endif - - int16_t write(const void* buf, uint16_t nbyte); - void write(const char* str); - void write_P(PGM_P str); - void writeln_P(PGM_P str); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdInfo.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdInfo.h deleted file mode 100644 index ecb517ae9a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdInfo.h +++ /dev/null @@ -1,265 +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 - -/** - * Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include - -// Based on the document: -// -// SD Specifications -// Part 1 -// Physical Layer -// Simplified Specification -// Version 3.01 -// May 18, 2010 -// -// http://www.sdcard.org/developers/tech/sdcard/pls/simplified_specs - -// SD card commands -uint8_t const CMD0 = 0x00, // GO_IDLE_STATE - init card in spi mode if CS low - CMD8 = 0x08, // SEND_IF_COND - verify SD Memory Card interface operating condition - CMD9 = 0x09, // SEND_CSD - read the Card Specific Data (CSD register) - CMD10 = 0x0A, // SEND_CID - read the card identification information (CID register) - CMD12 = 0x0C, // STOP_TRANSMISSION - end multiple block read sequence - CMD13 = 0x0D, // SEND_STATUS - read the card status register - CMD17 = 0x11, // READ_SINGLE_BLOCK - read a single data block from the card - CMD18 = 0x12, // READ_MULTIPLE_BLOCK - read a multiple data blocks from the card - CMD24 = 0x18, // WRITE_BLOCK - write a single data block to the card - CMD25 = 0x19, // WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION - CMD32 = 0x20, // ERASE_WR_BLK_START - sets the address of the first block to be erased - CMD33 = 0x21, // ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased - CMD38 = 0x26, // ERASE - erase all previously selected blocks - CMD55 = 0x37, // APP_CMD - escape for application specific command - CMD58 = 0x3A, // READ_OCR - read the OCR register of a card - CMD59 = 0x3B, // CRC_ON_OFF - enable or disable CRC checking - ACMD23 = 0x17, // SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing - ACMD41 = 0x29; // SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process - -/** status for card in the ready state */ -uint8_t const R1_READY_STATE = 0x00; -/** status for card in the idle state */ -uint8_t const R1_IDLE_STATE = 0x01; -/** status bit for illegal command */ -uint8_t const R1_ILLEGAL_COMMAND = 0x04; -/** start data token for read or write single block*/ -uint8_t const DATA_START_BLOCK = 0xFE; -/** stop token for write multiple blocks*/ -uint8_t const STOP_TRAN_TOKEN = 0xFD; -/** start data token for write multiple blocks*/ -uint8_t const WRITE_MULTIPLE_TOKEN = 0xFC; -/** mask for data response tokens after a write block operation */ -uint8_t const DATA_RES_MASK = 0x1F; -/** write data accepted token */ -uint8_t const DATA_RES_ACCEPTED = 0x05; - -/** Card IDentification (CID) register */ -typedef struct CID { - // byte 0 - /** Manufacturer ID */ - unsigned char mid; - // byte 1-2 - /** OEM/Application ID */ - char oid[2]; - // byte 3-7 - /** Product name */ - char pnm[5]; - // byte 8 - /** Product revision least significant digit */ - unsigned char prv_m : 4; - /** Product revision most significant digit */ - unsigned char prv_n : 4; - // byte 9-12 - /** Product serial number */ - uint32_t psn; - // byte 13 - /** Manufacturing date year low digit */ - unsigned char mdt_year_high : 4; - /** not used */ - unsigned char reserved : 4; - // byte 14 - /** Manufacturing date month */ - unsigned char mdt_month : 4; - /** Manufacturing date year low digit */ - unsigned char mdt_year_low : 4; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** CRC7 checksum */ - unsigned char crc : 7; -} cid_t; - -/** CSD for version 1.00 cards */ -typedef struct CSDV1 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - unsigned char taac; - // byte 2 - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - unsigned char c_size_high : 2; - unsigned char reserved2 : 2; - unsigned char dsr_imp : 1; - unsigned char read_blk_misalign : 1; - unsigned char write_blk_misalign : 1; - unsigned char read_bl_partial : 1; - // byte 7 - unsigned char c_size_mid; - // byte 8 - unsigned char vdd_r_curr_max : 3; - unsigned char vdd_r_curr_min : 3; - unsigned char c_size_low : 2; - // byte 9 - unsigned char c_size_mult_high : 2; - unsigned char vdd_w_cur_max : 3; - unsigned char vdd_w_curr_min : 3; - // byte 10 - unsigned char sector_size_high : 6; - unsigned char erase_blk_en : 1; - unsigned char c_size_mult_low : 1; - // byte 11 - unsigned char wp_grp_size : 7; - unsigned char sector_size_low : 1; - // byte 12 - unsigned char write_bl_len_high : 2; - unsigned char r2w_factor : 3; - unsigned char reserved3 : 2; - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved4 : 5; - unsigned char write_partial : 1; - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved5: 2; - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Indicates the file format on the card */ - unsigned char file_format_grp : 1; - // byte 15 - unsigned char always1 : 1; - unsigned char crc : 7; -} csd1_t; - -/** CSD for version 2.00 cards */ -typedef struct CSDV2 { - // byte 0 - unsigned char reserved1 : 6; - unsigned char csd_ver : 2; - // byte 1 - /** fixed to 0x0E */ - unsigned char taac; - // byte 2 - /** fixed to 0 */ - unsigned char nsac; - // byte 3 - unsigned char tran_speed; - // byte 4 - unsigned char ccc_high; - // byte 5 - /** This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte */ - unsigned char read_bl_len : 4; - unsigned char ccc_low : 4; - // byte 6 - /** not used */ - unsigned char reserved2 : 4; - unsigned char dsr_imp : 1; - /** fixed to 0 */ - unsigned char read_blk_misalign : 1; - /** fixed to 0 */ - unsigned char write_blk_misalign : 1; - /** fixed to 0 - no partial read */ - unsigned char read_bl_partial : 1; - // byte 7 - /** not used */ - unsigned char reserved3 : 2; - /** high part of card size */ - unsigned char c_size_high : 6; - // byte 8 - /** middle part of card size */ - unsigned char c_size_mid; - // byte 9 - /** low part of card size */ - unsigned char c_size_low; - // byte 10 - /** sector size is fixed at 64 KB */ - unsigned char sector_size_high : 6; - /** fixed to 1 - erase single is supported */ - unsigned char erase_blk_en : 1; - /** not used */ - unsigned char reserved4 : 1; - // byte 11 - unsigned char wp_grp_size : 7; - /** sector size is fixed at 64 KB */ - unsigned char sector_size_low : 1; - // byte 12 - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_high : 2; - /** fixed value of 2 */ - unsigned char r2w_factor : 3; - /** not used */ - unsigned char reserved5 : 2; - /** fixed value of 0 - no write protect groups */ - unsigned char wp_grp_enable : 1; - // byte 13 - unsigned char reserved6 : 5; - /** always zero - no partial block read*/ - unsigned char write_partial : 1; - /** write_bl_len fixed for 512 byte blocks */ - unsigned char write_bl_len_low : 2; - // byte 14 - unsigned char reserved7: 2; - /** Do not use always 0 */ - unsigned char file_format : 2; - unsigned char tmp_write_protect : 1; - unsigned char perm_write_protect : 1; - unsigned char copy : 1; - /** Do not use always 0 */ - unsigned char file_format_grp : 1; - // byte 15 - /** not used always 1 */ - unsigned char always1 : 1; - /** checksum */ - unsigned char crc : 7; -} csd2_t; - -/** union of old and new style CSD register */ -union csd_t { - csd1_t v1; - csd2_t v2; -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.cpp deleted file mode 100644 index 0501949406..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.cpp +++ /dev/null @@ -1,387 +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 . - * - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "SdVolume.h" - -#include "../Marlin.h" - -#if !USE_MULTIPLE_CARDS - // raw block cache - uint32_t SdVolume::cacheBlockNumber_; // current block number - cache_t SdVolume::cacheBuffer_; // 512 byte cache for Sd2Card - Sd2Card* SdVolume::sdCard_; // pointer to SD card object - bool SdVolume::cacheDirty_; // cacheFlush() will write block if true - uint32_t SdVolume::cacheMirrorBlock_; // mirror block for second FAT -#endif // USE_MULTIPLE_CARDS - -// find a contiguous group of clusters -bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) { - // start of group - uint32_t bgnCluster; - // end of group - uint32_t endCluster; - // last cluster of FAT - uint32_t fatEnd = clusterCount_ + 1; - - // flag to save place to start next search - bool setStart; - - // set search start cluster - if (*curCluster) { - // try to make file contiguous - bgnCluster = *curCluster + 1; - - // don't save new start location - setStart = false; - } - else { - // start at likely place for free cluster - bgnCluster = allocSearchStart_; - - // save next search start if one cluster - setStart = count == 1; - } - // end of group - endCluster = bgnCluster; - - // search the FAT for free clusters - for (uint32_t n = 0;; n++, endCluster++) { - // can't find space checked all clusters - if (n >= clusterCount_) return false; - - // past end - start from beginning of FAT - if (endCluster > fatEnd) { - bgnCluster = endCluster = 2; - } - uint32_t f; - if (!fatGet(endCluster, &f)) return false; - - if (f != 0) { - // cluster in use try next cluster as bgnCluster - bgnCluster = endCluster + 1; - } - else if ((endCluster - bgnCluster + 1) == count) { - // done - found space - break; - } - } - // mark end of chain - if (!fatPutEOC(endCluster)) return false; - - // link clusters - while (endCluster > bgnCluster) { - if (!fatPut(endCluster - 1, endCluster)) return false; - endCluster--; - } - if (*curCluster != 0) { - // connect chains - if (!fatPut(*curCluster, bgnCluster)) return false; - } - // return first cluster number to caller - *curCluster = bgnCluster; - - // remember possible next free cluster - if (setStart) allocSearchStart_ = bgnCluster + 1; - - return true; -} - -bool SdVolume::cacheFlush() { - if (cacheDirty_) { - if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) - return false; - - // mirror FAT tables - if (cacheMirrorBlock_) { - if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) - return false; - cacheMirrorBlock_ = 0; - } - cacheDirty_ = 0; - } - return true; -} - -bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { - if (cacheBlockNumber_ != blockNumber) { - if (!cacheFlush()) return false; - if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) return false; - cacheBlockNumber_ = blockNumber; - } - if (dirty) cacheDirty_ = true; - return true; -} - -// return the size in bytes of a cluster chain -bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { - uint32_t s = 0; - do { - if (!fatGet(cluster, &cluster)) return false; - s += 512UL << clusterSizeShift_; - } while (!isEOC(cluster)); - *size = s; - return true; -} - -// Fetch a FAT entry -bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { - uint32_t lba; - if (cluster > (clusterCount_ + 1)) return false; - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return false; - index &= 0x1FF; - uint16_t tmp = cacheBuffer_.data[index]; - index++; - if (index == 512) { - if (!cacheRawBlock(lba + 1, CACHE_FOR_READ)) return false; - index = 0; - } - tmp |= cacheBuffer_.data[index] << 8; - *value = cluster & 1 ? tmp >> 4 : tmp & 0xFFF; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (lba != cacheBlockNumber_ && !cacheRawBlock(lba, CACHE_FOR_READ)) - return false; - - *value = (fatType_ == 16) ? cacheBuffer_.fat16[cluster & 0xFF] : (cacheBuffer_.fat32[cluster & 0x7F] & FAT32MASK); - return true; -} - -// Store a FAT entry -bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { - uint32_t lba; - // error if reserved cluster - if (cluster < 2) return false; - - // error if not in FAT - if (cluster > (clusterCount_ + 1)) return false; - - if (FAT12_SUPPORT && fatType_ == 12) { - uint16_t index = cluster; - index += index >> 1; - lba = fatStartBlock_ + (index >> 9); - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - index &= 0x1FF; - uint8_t tmp = value; - if (cluster & 1) { - tmp = (cacheBuffer_.data[index] & 0xF) | tmp << 4; - } - cacheBuffer_.data[index] = tmp; - index++; - if (index == 512) { - lba++; - index = 0; - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - } - tmp = value >> 4; - if (!(cluster & 1)) { - tmp = ((cacheBuffer_.data[index] & 0xF0)) | tmp >> 4; - } - cacheBuffer_.data[index] = tmp; - return true; - } - - if (fatType_ == 16) - lba = fatStartBlock_ + (cluster >> 8); - else if (fatType_ == 32) - lba = fatStartBlock_ + (cluster >> 7); - else - return false; - - if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false; - - // store entry - if (fatType_ == 16) - cacheBuffer_.fat16[cluster & 0xFF] = value; - else - cacheBuffer_.fat32[cluster & 0x7F] = value; - - // mirror second FAT - if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; - return true; -} - -// free a cluster chain -bool SdVolume::freeChain(uint32_t cluster) { - // clear free cluster location - allocSearchStart_ = 2; - - do { - uint32_t next; - if (!fatGet(cluster, &next)) return false; - - // free cluster - if (!fatPut(cluster, 0)) return false; - - cluster = next; - } while (!isEOC(cluster)); - - return true; -} - -/** Volume free space in clusters. - * - * \return Count of free clusters for success or -1 if an error occurs. - */ -int32_t SdVolume::freeClusterCount() { - uint32_t free = 0; - uint16_t n; - uint32_t todo = clusterCount_ + 2; - - if (fatType_ == 16) - n = 256; - else if (fatType_ == 32) - n = 128; - else // put FAT12 here - return -1; - - for (uint32_t lba = fatStartBlock_; todo; todo -= n, lba++) { - if (!cacheRawBlock(lba, CACHE_FOR_READ)) return -1; - NOMORE(n, todo); - if (fatType_ == 16) { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat16[i] == 0) free++; - } - else { - for (uint16_t i = 0; i < n; i++) - if (cacheBuffer_.fat32[i] == 0) free++; - } - } - return free; -} - -/** Initialize a FAT volume. - * - * \param[in] dev The SD card where the volume is located. - * - * \param[in] part The partition to be used. Legal values for \a part are - * 1-4 to use the corresponding partition on a device formatted with - * a MBR, Master Boot Record, or zero if the device is formatted as - * a super floppy with the FAT boot sector in block zero. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding a valid - * FAT file system in the specified partition or an I/O error. - */ -bool SdVolume::init(Sd2Card* dev, uint8_t part) { - uint32_t totalBlocks, volumeStartBlock = 0; - fat32_boot_t* fbs; - - sdCard_ = dev; - fatType_ = 0; - allocSearchStart_ = 2; - cacheDirty_ = 0; // cacheFlush() will write block if true - cacheMirrorBlock_ = 0; - cacheBlockNumber_ = 0xFFFFFFFF; - - // if part == 0 assume super floppy with FAT boot sector in block zero - // if part > 0 assume mbr volume with partition table - if (part) { - if (part > 4) return false; - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - part_t* p = &cacheBuffer_.mbr.part[part - 1]; - if ((p->boot & 0x7F) != 0 || p->totalSectors < 100 || p->firstSector == 0) - return false; // not a valid partition - volumeStartBlock = p->firstSector; - } - if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false; - fbs = &cacheBuffer_.fbs32; - if (fbs->bytesPerSector != 512 || - fbs->fatCount == 0 || - fbs->reservedSectorCount == 0 || - fbs->sectorsPerCluster == 0) { - // not valid FAT volume - return false; - } - fatCount_ = fbs->fatCount; - blocksPerCluster_ = fbs->sectorsPerCluster; - // determine shift that is same as multiply by blocksPerCluster_ - clusterSizeShift_ = 0; - while (blocksPerCluster_ != _BV(clusterSizeShift_)) { - // error if not power of 2 - if (clusterSizeShift_++ > 7) return false; - } - blocksPerFat_ = fbs->sectorsPerFat16 ? - fbs->sectorsPerFat16 : fbs->sectorsPerFat32; - - fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; - - // count for FAT16 zero for FAT32 - rootDirEntryCount_ = fbs->rootDirEntryCount; - - // directory start for FAT16 dataStart for FAT32 - rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; - - // data start for FAT16 and FAT32 - dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511) / 512); - - // total blocks for FAT16 or FAT32 - totalBlocks = fbs->totalSectors16 ? - fbs->totalSectors16 : fbs->totalSectors32; - - // total data blocks - clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); - - // divide by cluster size to get cluster count - clusterCount_ >>= clusterSizeShift_; - - // FAT type is determined by cluster count - if (clusterCount_ < 4085) { - fatType_ = 12; - if (!FAT12_SUPPORT) return false; - } - else if (clusterCount_ < 65525) - fatType_ = 16; - else { - rootDirStart_ = fbs->fat32RootCluster; - fatType_ = 32; - } - return true; -} - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.h deleted file mode 100644 index b5282bdce3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/SdVolume.h +++ /dev/null @@ -1,201 +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 - -/** - * \file - * \brief SdVolume class - */ - -/** - * Arduino SdFat Library - * Copyright (c) 2009 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ - -#include - -#include "../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #include "usb_flashdrive/Sd2Card_FlashDrive.h" -#elif ENABLED(SDIO_SUPPORT) - #include "Sd2Card_sdio.h" -#else - #include "Sd2Card.h" -#endif - -#include "SdFatConfig.h" -#include "SdFatStructs.h" - -//============================================================================== -// SdVolume class -/** - * \brief Cache for an SD data block - */ -union cache_t { - uint8_t data[512]; // Used to access cached file data blocks. - uint16_t fat16[256]; // Used to access cached FAT16 entries. - uint32_t fat32[128]; // Used to access cached FAT32 entries. - dir_t dir[16]; // Used to access cached directory entries. - mbr_t mbr; // Used to access a cached Master Boot Record. - fat_boot_t fbs; // Used to access to a cached FAT boot sector. - fat32_boot_t fbs32; // Used to access to a cached FAT32 boot sector. - fat32_fsinfo_t fsinfo; // Used to access to a cached FAT32 FSINFO sector. -}; - -/** - * \class SdVolume - * \brief Access FAT16 and FAT32 volumes on SD and SDHC cards. - */ -class SdVolume { - public: - // Create an instance of SdVolume - SdVolume() : fatType_(0) {} - /** - * Clear the cache and returns a pointer to the cache. Used by the WaveRP - * recorder to do raw write to the SD card. Not for normal apps. - * \return A pointer to the cache buffer or zero if an error occurs. - */ - cache_t* cacheClear() { - if (!cacheFlush()) return 0; - cacheBlockNumber_ = 0xFFFFFFFF; - return &cacheBuffer_; - } - - /** - * Initialize a FAT volume. Try partition one first then try super - * floppy format. - * - * \param[in] dev The Sd2Card where the volume is located. - * - * \return true for success, false for failure. - * Reasons for failure include not finding a valid partition, not finding - * a valid FAT file system or an I/O error. - */ - bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0); } - bool init(Sd2Card* dev, uint8_t part); - - // inline functions that return volume info - uint8_t blocksPerCluster() const { return blocksPerCluster_; } //> \return The volume's cluster size in blocks. - uint32_t blocksPerFat() const { return blocksPerFat_; } //> \return The number of blocks in one FAT. - uint32_t clusterCount() const { return clusterCount_; } //> \return The total number of clusters in the volume. - uint8_t clusterSizeShift() const { return clusterSizeShift_; } //> \return The shift count required to multiply by blocksPerCluster. - uint32_t dataStartBlock() const { return dataStartBlock_; } //> \return The logical block number for the start of file data. - uint8_t fatCount() const { return fatCount_; } //> \return The number of FAT structures on the volume. - uint32_t fatStartBlock() const { return fatStartBlock_; } //> \return The logical block number for the start of the first FAT. - uint8_t fatType() const { return fatType_; } //> \return The FAT type of the volume. Values are 12, 16 or 32. - int32_t freeClusterCount(); - uint32_t rootDirEntryCount() const { return rootDirEntryCount_; } /** \return The number of entries in the root directory for FAT16 volumes. */ - - /** - * \return The logical block number for the start of the root directory - * on FAT16 volumes or the first cluster number on FAT32 volumes. - */ - uint32_t rootDirStart() const { return rootDirStart_; } - - /** - * Sd2Card object for this volume - * \return pointer to Sd2Card object. - */ - Sd2Card* sdCard() { return sdCard_; } - - /** - * Debug access to FAT table - * - * \param[in] n cluster number. - * \param[out] v value of entry - * \return true for success or false for failure - */ - bool dbgFat(uint32_t n, uint32_t* v) { return fatGet(n, v); } - - private: - // Allow SdBaseFile access to SdVolume private data. - friend class SdBaseFile; - - // value for dirty argument in cacheRawBlock to indicate read from cache - static bool const CACHE_FOR_READ = false; - // value for dirty argument in cacheRawBlock to indicate write to cache - static bool const CACHE_FOR_WRITE = true; - - #if USE_MULTIPLE_CARDS - cache_t cacheBuffer_; // 512 byte cache for device blocks - uint32_t cacheBlockNumber_; // Logical number of block in the cache - Sd2Card* sdCard_; // Sd2Card object for cache - bool cacheDirty_; // cacheFlush() will write block if true - uint32_t cacheMirrorBlock_; // block number for mirror FAT - #else - static cache_t cacheBuffer_; // 512 byte cache for device blocks - static uint32_t cacheBlockNumber_; // Logical number of block in the cache - static Sd2Card* sdCard_; // Sd2Card object for cache - static bool cacheDirty_; // cacheFlush() will write block if true - static uint32_t cacheMirrorBlock_; // block number for mirror FAT - #endif - - uint32_t allocSearchStart_; // start cluster for alloc search - uint8_t blocksPerCluster_; // cluster size in blocks - uint32_t blocksPerFat_; // FAT size in blocks - uint32_t clusterCount_; // clusters in one FAT - uint8_t clusterSizeShift_; // shift to convert cluster count to block count - uint32_t dataStartBlock_; // first data block number - uint8_t fatCount_; // number of FATs on volume - uint32_t fatStartBlock_; // start block for first FAT - uint8_t fatType_; // volume type (12, 16, OR 32) - uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir - uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 - - bool allocContiguous(uint32_t count, uint32_t* curCluster); - uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1); } - uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_); } - uint32_t blockNumber(uint32_t cluster, uint32_t position) const { return clusterStartBlock(cluster) + blockOfCluster(position); } - - cache_t* cache() { return &cacheBuffer_; } - uint32_t cacheBlockNumber() const { return cacheBlockNumber_; } - - #if USE_MULTIPLE_CARDS - bool cacheFlush(); - bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #else - static bool cacheFlush(); - static bool cacheRawBlock(uint32_t blockNumber, bool dirty); - #endif - - // used by SdBaseFile write to assign cache to SD location - void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { - cacheDirty_ = dirty; - cacheBlockNumber_ = blockNumber; - } - void cacheSetDirty() { cacheDirty_ |= CACHE_FOR_WRITE; } - bool chainSize(uint32_t beginCluster, uint32_t* size); - bool fatGet(uint32_t cluster, uint32_t* value); - bool fatPut(uint32_t cluster, uint32_t value); - bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); } - bool freeChain(uint32_t cluster); - bool isEOC(uint32_t cluster) const { - if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; - if (fatType_ == 16) return cluster >= FAT16EOC_MIN; - return cluster >= FAT32EOC_MIN; - } - bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst); } - bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); } -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.cpp deleted file mode 100644 index a0cb19b95d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.cpp +++ /dev/null @@ -1,1122 +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 . - * - */ - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#include "cardreader.h" - -#include "../Marlin.h" -#include "../lcd/ultralcd.h" -#include "../module/planner.h" -#include "../module/printcounter.h" -#include "../core/language.h" -#include "../gcode/queue.h" -#include "../module/configuration_store.h" - -#if ENABLED(EMERGENCY_PARSER) - #include "../feature/emergency_parser.h" -#endif - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../feature/power_loss_recovery.h" -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" -#endif - -// public: - -card_flags_t CardReader::flag; -char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH]; -int8_t CardReader::autostart_index; - -#if ENABLED(BINARY_FILE_TRANSFER) && NUM_SERIAL > 1 - int8_t CardReader::transfer_port_index; -#endif - -// private: - -SdFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; -uint8_t CardReader::workDirDepth; - -#if ENABLED(SDCARD_SORT_ALPHA) - - uint16_t CardReader::sort_count; - #if ENABLED(SDSORT_GCODE) - bool CardReader::sort_alpha; - int CardReader::sort_folders; - //bool CardReader::sort_reverse; - #endif - - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *CardReader::sort_order; - #else - uint8_t CardReader::sort_order[SDSORT_LIMIT]; - #endif - - #if ENABLED(SDSORT_USES_RAM) - - #if ENABLED(SDSORT_CACHE_NAMES) - uint16_t CardReader::nrFiles; // Cached total file count - #if ENABLED(SDSORT_DYNAMIC_RAM) - char **CardReader::sortshort, **CardReader::sortnames; - #else - char CardReader::sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; - char CardReader::sortnames[SDSORT_LIMIT][SORTED_LONGNAME_STORAGE]; - #endif - #elif DISABLED(SDSORT_USES_STACK) - char CardReader::sortnames[SDSORT_LIMIT][SORTED_LONGNAME_STORAGE]; - #endif - - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *CardReader::isDir; - #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) - uint8_t CardReader::isDir[(SDSORT_LIMIT+7)>>3]; - #endif - #define IS_DIR(n) TEST(isDir[(n) >> 3], (n) & 0x07) - #endif - - #endif // SDSORT_USES_RAM - -#endif // SDCARD_SORT_ALPHA - -Sd2Card CardReader::sd2card; -SdVolume CardReader::volume; -SdFile CardReader::file; - -uint8_t CardReader::file_subcall_ctr; -uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; -char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - -uint32_t CardReader::filesize, CardReader::sdpos; - -CardReader::CardReader() { - #if ENABLED(SDCARD_SORT_ALPHA) - sort_count = 0; - #if ENABLED(SDSORT_GCODE) - sort_alpha = true; - sort_folders = FOLDER_SORTING; - //sort_reverse = false; - #endif - #endif - flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; - filesize = sdpos = 0; - file_subcall_ctr = 0; - - workDirDepth = 0; - ZERO(workDirParents); - - // Disable autostart until card is initialized - autostart_index = -1; - - #if PIN_EXISTS(SDPOWER) - OUT_WRITE(SDPOWER_PIN, HIGH); // Power the SD reader - #endif -} - -// -// Get a DOS 8.3 filename in its useful form -// -char *createFilename(char * const buffer, const dir_t &p) { - char *pos = buffer; - for (uint8_t i = 0; i < 11; i++) { - if (p.name[i] == ' ') continue; - if (i == 8) *pos++ = '.'; - *pos++ = p.name[i]; - } - *pos++ = 0; - return buffer; -} - -// -// Return 'true' if the item is a folder or G-code file -// -bool CardReader::is_dir_or_gcode(const dir_t &p) { - uint8_t pn0 = p.name[0]; - - if ( pn0 == DIR_NAME_FREE || pn0 == DIR_NAME_DELETED // Clear or Deleted entry - || pn0 == '.' || longFilename[0] == '.' // Hidden file - || !DIR_IS_FILE_OR_SUBDIR(&p) // Not a File or Directory - || (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute - ) return false; - - flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder - - return ( - flag.filenameIsDir // All Directories are ok - || (p.name[8] == 'G' && p.name[9] != '~') // Non-backup *.G* files are accepted - ); -} - -// -// Get the number of (compliant) items in the folder -// -int CardReader::countItems(SdFile dir) { - dir_t p; - int c = 0; - while (dir.readDir(&p, longFilename) > 0) - c += is_dir_or_gcode(p); - - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES - nrFiles = c; - #endif - - return c; -} - -// -// Get file/folder info for an item by index -// -void CardReader::selectByIndex(SdFile dir, const uint8_t index) { - dir_t p; - for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0;) { - if (is_dir_or_gcode(p)) { - if (cnt == index) { - createFilename(filename, p); - return; // 0 based index - } - cnt++; - } - } -} - -// -// Get file/folder info for an item by name -// -void CardReader::selectByName(SdFile dir, const char * const match) { - dir_t p; - for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0; cnt++) { - if (is_dir_or_gcode(p)) { - createFilename(filename, p); - if (strcasecmp(match, filename) == 0) return; - } - } -} - -// -// Recursive method to list all files within a folder -// -void CardReader::printListing(SdFile parent, const char * const prepend/*=nullptr*/) { - dir_t p; - while (parent.readDir(&p, longFilename) > 0) { - if (DIR_IS_SUBDIR(&p)) { - - // Get the short name for the item, which we know is a folder - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, p); - - // Allocate enough stack space for the full path to a folder, trailing slash, and nul - const bool prepend_is_empty = (!prepend || prepend[0] == '\0'); - const int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1; - char path[len]; - - // Append the FOLDERNAME12/ to the passed string. - // It contains the full path to the "parent" argument. - // We now have the full path to the item in this folder. - strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty - strcat(path, dosFilename); // FILENAME_LENGTH characters maximum - strcat(path, "/"); // 1 character - - // Serial.print(path); - - // Get a new directory object using the full path - // and dive recursively into it. - SdFile child; - if (!child.open(&parent, dosFilename, O_READ)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename); - } - printListing(child, path); - // close() is done automatically by destructor of SdFile - } - else if (is_dir_or_gcode(p)) { - createFilename(filename, p); - if (prepend) SERIAL_ECHO(prepend); - SERIAL_ECHO(filename); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(p.fileSize); - } - } -} - -// -// List all files on the SD card -// -void CardReader::ls() { - root.rewind(); - printListing(root); -} - -#if ENABLED(LONG_FILENAME_HOST_SUPPORT) - - // - // Get a long pretty path based on a DOS 8.3 path - // - void CardReader::printLongPath(char * const path) { - - int i, pathLen = strlen(path); - - // SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path); - - // Zero out slashes to make segments - for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0'; - - SdFile diveDir = root; // start from the root for segment 1 - for (i = 0; i < pathLen;) { - - if (path[i] == '\0') i++; // move past a single nul - - char *segment = &path[i]; // The segment after most slashes - - // If a segment is empty (extra-slash) then exit - if (!*segment) break; - - // Go to the next segment - while (path[++i]) { } - - // SERIAL_ECHOPGM("Looking for segment: "); SERIAL_ECHOLN(segment); - - // Find the item, setting the long filename - diveDir.rewind(); - selectByName(diveDir, segment); - - // Print /LongNamePart to serial output - SERIAL_CHAR('/'); - SERIAL_ECHO(longFilename[0] ? longFilename : "???"); - - // If the filename was printed then that's it - if (!flag.filenameIsDir) break; - - // SERIAL_ECHOPGM("Opening dir: "); SERIAL_ECHOLN(segment); - - // Open the sub-item as the new dive parent - SdFile dir; - if (!dir.open(&diveDir, segment, O_READ)) { - SERIAL_EOL(); - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment); - break; - } - - diveDir.close(); - diveDir = dir; - - } // while i SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_MSG("trying to call sub-gcode files with too many levels. MAX level is:" STRINGIFY(SD_PROCEDURE_DEPTH)); - kill(); - return; - } - - // Store current filename (based on workDirParents) and position - getAbsFilename(proc_filenames[file_subcall_ctr]); - filespos[file_subcall_ctr] = sdpos; - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); - file_subcall_ctr++; - } - else - doing = 1; - } - else if (subcall) // Returning from a subcall? - SERIAL_ECHO_MSG("END SUBROUTINE"); - else { // Opening fresh file - doing = 2; - file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure - } - - if (doing) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Now "); - serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); - SERIAL_ECHOLNPAIR(" file: ", path); - } - - stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, path); - if (!fname) return; - - if (read) { - if (file.open(curDir, fname, O_READ)) { - filesize = file.fileSize(); - sdpos = 0; - SERIAL_ECHOLNPAIR(MSG_SD_FILE_OPENED, fname, MSG_SD_SIZE, filesize); - SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED); - - selectFileByName(fname); - ui.set_status(longFilename[0] ? longFilename : fname); - //if (longFilename[0]) { - // SERIAL_ECHOPAIR(MSG_SD_FILE_LONG_NAME, longFilename); - //} - } - else - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); - } - else { //write - if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); - else { - flag.saving = true; - selectFileByName(fname); - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.disable(); - #endif - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname); - ui.set_status(fname); - } - } -} - -// -// Delete a file by name in the working directory -// -void CardReader::removeFile(const char * const name) { - if (!isMounted()) return; - - //stopSDPrint(); - - SdFile *curDir; - const char * const fname = diveToFile(curDir, name); - if (!fname) return; - - if (file.remove(curDir, fname)) { - SERIAL_ECHOLNPAIR("File deleted:", fname); - sdpos = 0; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - else - SERIAL_ECHOLNPAIR("Deletion failed, File: ", fname, "."); -} - -void CardReader::report_status() { - if (isPrinting()) { - SERIAL_ECHOPGM(MSG_SD_PRINTING_BYTE); - SERIAL_ECHO(sdpos); - SERIAL_CHAR('/'); - SERIAL_ECHOLN(filesize); - } - else - SERIAL_ECHOLNPGM(MSG_SD_NOT_PRINTING); -} - -void CardReader::write_command(char * const buf) { - char* begin = buf; - char* npos = nullptr; - char* end = buf + strlen(buf) - 1; - - file.writeError = false; - if ((npos = strchr(buf, 'N')) != nullptr) { - begin = strchr(npos, ' ') + 1; - end = strchr(npos, '*') - 1; - } - end[1] = '\r'; - end[2] = '\n'; - end[3] = '\0'; - file.write(begin); - - if (file.writeError) SERIAL_ERROR_MSG(MSG_SD_ERR_WRITE_TO_FILE); -} - -// -// Run the next autostart file. Called: -// - On boot after successful card init -// - After finishing the previous autostart file -// - From the LCD command to run the autostart file -// - -void CardReader::checkautostart() { - - if (autostart_index < 0 || flag.sdprinting) return; - - if (!isMounted()) mount(); - #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) - else settings.first_load(); - #endif - - if (isMounted() - #if ENABLED(POWER_LOSS_RECOVERY) - && !recovery.valid() // Don't run auto#.g when a resume file exists - #endif - ) { - char autoname[8]; - sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0'); - dir_t p; - root.rewind(); - while (root.readDir(&p, nullptr) > 0) { - for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); - if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { - openAndPrintFile(autoname); - autostart_index++; - return; - } - } - } - autostart_index = -1; -} - -void CardReader::beginautostart() { - autostart_index = 0; - cdroot(); -} - -void CardReader::closefile(const bool store_location) { - file.sync(); - file.close(); - flag.saving = flag.logging = false; - sdpos = 0; - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.enable(); - #endif - - if (store_location) { - //future: store printer state, filename and position for continuing a stopped print - // so one can unplug the printer and continue printing the next day. - } -} - -// -// Get info for a file in the working directory by index -// -void CardReader::selectFileByIndex(const uint16_t nr) { - #if ENABLED(SDSORT_CACHE_NAMES) - if (nr < sort_count) { - strcpy(filename, sortshort[nr]); - strcpy(longFilename, sortnames[nr]); - flag.filenameIsDir = IS_DIR(nr); - return; - } - #endif - workDir.rewind(); - selectByIndex(workDir, nr); -} - -// -// Get info for a file in the working directory by DOS name -// -void CardReader::selectFileByName(const char * const match) { - #if ENABLED(SDSORT_CACHE_NAMES) - for (int nr = 0; nr < sort_count; nr++) - if (strcasecmp(match, sortshort[nr]) == 0) { - strcpy(filename, sortshort[nr]); - strcpy(longFilename, sortnames[nr]); - flag.filenameIsDir = IS_DIR(nr); - return; - } - #endif - workDir.rewind(); - selectByName(workDir, match); -} - -uint16_t CardReader::countFilesInWorkDir() { - workDir.rewind(); - return countItems(workDir); -} - -/** - * Dive to the given DOS 8.3 file path, with optional echo of the dive paths. - * - * On exit, curDir contains an SdFile reference to the file's directory. - * - * Returns a pointer to the last segment (filename) of the given DOS 8.3 path. - * - * A nullptr result indicates an unrecoverable error. - */ -const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo/*=false*/) { - // Track both parent and subfolder - static SdFile newDir1, newDir2; - SdFile *sub = &newDir1, *startDir; - - const char *item_name_adr = path; - if (path[0] == '/') { - curDir = &root; - workDirDepth = 0; - item_name_adr++; - } - else - curDir = &workDir; - - startDir = curDir; - - // Start dive - while (item_name_adr) { - // Find next sub - char * const name_end = strchr(item_name_adr, '/'); - if (name_end <= item_name_adr) break; - - // Set subDirName - const uint8_t len = name_end - item_name_adr; - char dosSubdirname[len + 1]; - strncpy(dosSubdirname, item_name_adr, len); - dosSubdirname[len] = 0; - - if (echo) SERIAL_ECHOLN(dosSubdirname); - - // Open curDir - if (!sub->open(curDir, dosSubdirname, O_READ)) { - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname, "."); - return nullptr; - } - - // Close curDir if not at starting-point - if (curDir != startDir) curDir->close(); - - // curDir now subDir - curDir = sub; - - // Update workDirParents and workDirDepth - if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = *curDir; - - // Point sub pointer to unused newDir - sub = (curDir != &newDir1) ? &newDir1 : &newDir2; - - // item_name_adr point to next sub - item_name_adr = name_end + 1; - } - return item_name_adr; -} - -void CardReader::cd(const char * relpath) { - SdFile newDir; - SdFile *parent = workDir.isOpen() ? &workDir : &root; - - 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) - presort(); - #endif - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_SD_CANT_ENTER_SUBDIR, relpath); - } -} - -int8_t CardReader::cdup() { - if (workDirDepth > 0) { // At least 1 dir has been saved - workDir = --workDirDepth ? workDirParents[workDirDepth - 1] : root; // Use parent, or root if none - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - } - if (!workDirDepth) flag.workDirIsRoot = true; - return workDirDepth; -} - -void CardReader::cdroot() { - workDir = root; - flag.workDirIsRoot = true; - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif -} - -#if ENABLED(SDCARD_SORT_ALPHA) - - /** - * Get the name of a file in the working directory by sort-index - */ - void CardReader::getfilename_sorted(const uint16_t nr) { - selectFileByIndex( - #if ENABLED(SDSORT_GCODE) - sort_alpha && - #endif - (nr < sort_count) ? sort_order[nr] : nr - ); - } - - #if ENABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - // Use dynamic method to copy long filename - #define SET_SORTNAME(I) (sortnames[I] = strdup(longest_filename())) - #if ENABLED(SDSORT_CACHE_NAMES) - // When caching also store the short name, since - // we're replacing the selectFileByIndex() behavior. - #define SET_SORTSHORT(I) (sortshort[I] = strdup(filename)) - #else - #define SET_SORTSHORT(I) NOOP - #endif - #else - // Copy filenames into the static array - #define _SET_SORTNAME(I) strncpy(sortnames[I], longest_filename(), SORTED_LONGNAME_MAXLEN) - #if SORTED_LONGNAME_MAXLEN == LONG_FILENAME_LENGTH - // Short name sorting always use LONG_FILENAME_LENGTH with no trailing nul - #define SET_SORTNAME(I) _SET_SORTNAME(I) - #else - // Copy multiple name blocks. Add a nul for the longest case. - #define SET_SORTNAME(I) do{ _SET_SORTNAME(I); sortnames[I][SORTED_LONGNAME_MAXLEN] = '\0'; }while(0) - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - #define SET_SORTSHORT(I) strcpy(sortshort[I], filename) - #else - #define SET_SORTSHORT(I) NOOP - #endif - #endif - #endif - - /** - * Read all the files and produce a sort key - * - * We can do this in 3 ways... - * - Minimal RAM: Read two filenames at a time sorting along... - * - Some RAM: Buffer the directory just for this sort - * - Most RAM: Buffer the directory and return filenames from RAM - */ - void CardReader::presort() { - - // Throw away old sort index - flush_presort(); - - // Sorting may be turned off - #if ENABLED(SDSORT_GCODE) - if (!sort_alpha) return; - #endif - - // If there are files, sort up to the limit - uint16_t fileCnt = countFilesInWorkDir(); - if (fileCnt > 0) { - - // Never sort more than the max allowed - // If you use folders to organize, 20 may be enough - NOMORE(fileCnt, uint16_t(SDSORT_LIMIT)); - - // Sort order is always needed. May be static or dynamic. - #if ENABLED(SDSORT_DYNAMIC_RAM) - sort_order = new uint8_t[fileCnt]; - #endif - - // Use RAM to store the entire directory during pre-sort. - // SDSORT_LIMIT should be set to prevent over-allocation. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortshort = new char*[fileCnt]; - sortnames = new char*[fileCnt]; - #endif - #elif ENABLED(SDSORT_USES_STACK) - char sortnames[fileCnt][SORTED_LONGNAME_STORAGE]; - #endif - - // Folder sorting needs 1 bit per entry for flags. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - isDir = new uint8_t[(fileCnt + 7) >> 3]; - #elif ENABLED(SDSORT_USES_STACK) - uint8_t isDir[(fileCnt + 7) >> 3]; - #endif - #endif - - #else // !SDSORT_USES_RAM - - // By default re-read the names from SD for every compare - // retaining only two filenames at a time. This is very - // slow but is safest and uses minimal RAM. - char name1[LONG_FILENAME_LENGTH]; - - #endif - - if (fileCnt > 1) { - - // Init sort order. - for (uint16_t i = 0; i < fileCnt; i++) { - sort_order[i] = ( - #if ENABLED(SDCARD_RATHERRECENTFIRST) - fileCnt - 1 - - #endif - i); - // If using RAM then read all filenames now. - #if ENABLED(SDSORT_USES_RAM) - selectFileByIndex(i); - SET_SORTNAME(i); - SET_SORTSHORT(i); - // char out[30]; - // sprintf_P(out, PSTR("---- %i %s %s"), i, flag.filenameIsDir ? "D" : " ", sortnames[i]); - // SERIAL_ECHOLN(out); - #if HAS_FOLDER_SORTING - const uint16_t bit = i & 0x07, ind = i >> 3; - if (bit == 0) isDir[ind] = 0x00; - if (flag.filenameIsDir) isDir[ind] |= _BV(bit); - #endif - #endif - } - - // Bubble Sort - for (uint16_t i = fileCnt; --i;) { - bool didSwap = false; - uint8_t o1 = sort_order[0]; - #if DISABLED(SDSORT_USES_RAM) - selectFileByIndex(o1); // Pre-fetch the first entry and save it - strcpy(name1, longest_filename()); // so the loop only needs one fetch - #if HAS_FOLDER_SORTING - bool dir1 = flag.filenameIsDir; - #endif - #endif - - for (uint16_t j = 0; j < i; ++j) { - const uint16_t o2 = sort_order[j + 1]; - - // Compare names from the array or just the two buffered names - #if ENABLED(SDSORT_USES_RAM) - #define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0) - #else - #define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) - #endif - - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_USES_RAM) - // Folder sorting needs an index and bit to test for folder-ness. - #define _SORT_CMP_DIR(fs) IS_DIR(o1) == IS_DIR(o2) ? _SORT_CMP_NODIR() : IS_DIR(fs > 0 ? o1 : o2) - #else - #define _SORT_CMP_DIR(fs) ((dir1 == flag.filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) - #endif - #endif - - // The most economical method reads names as-needed - // throughout the loop. Slow if there are many. - #if DISABLED(SDSORT_USES_RAM) - selectFileByIndex(o2); - const bool dir2 = flag.filenameIsDir; - char * const name2 = longest_filename(); // use the string in-place - #endif // !SDSORT_USES_RAM - - // Sort the current pair according to settings. - if ( - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_GCODE) - sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_NODIR() - #else - _SORT_CMP_DIR(FOLDER_SORTING) - #endif - #else - _SORT_CMP_NODIR() - #endif - ) { - // Reorder the index, indicate that sorting happened - // Note that the next o1 will be the current o1. No new fetch needed. - sort_order[j] = o2; - sort_order[j + 1] = o1; - didSwap = true; - } - else { - // The next o1 is the current o2. No new fetch needed. - o1 = o2; - #if DISABLED(SDSORT_USES_RAM) - #if HAS_FOLDER_SORTING - dir1 = dir2; - #endif - strcpy(name1, name2); - #endif - } - } - if (!didSwap) break; - } - // Using RAM but not keeping names around - #if ENABLED(SDSORT_USES_RAM) && DISABLED(SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - for (uint16_t i = 0; i < fileCnt; ++i) free(sortnames[i]); - #if HAS_FOLDER_SORTING - free(isDir); - #endif - #endif - #endif - } - else { - sort_order[0] = 0; - #if BOTH(SDSORT_USES_RAM, SDSORT_CACHE_NAMES) - #if ENABLED(SDSORT_DYNAMIC_RAM) - sortnames = new char*[1]; - sortshort = new char*[1]; - isDir = new uint8_t[1]; - #endif - selectFileByIndex(0); - SET_SORTNAME(0); - SET_SORTSHORT(0); - isDir[0] = flag.filenameIsDir; - #endif - } - - sort_count = fileCnt; - } - } - - void CardReader::flush_presort() { - if (sort_count > 0) { - #if ENABLED(SDSORT_DYNAMIC_RAM) - delete sort_order; - #if ENABLED(SDSORT_CACHE_NAMES) - for (uint8_t i = 0; i < sort_count; ++i) { - free(sortshort[i]); // strdup - free(sortnames[i]); // strdup - } - delete sortshort; - delete sortnames; - #endif - #endif - sort_count = 0; - } - } - -#endif // SDCARD_SORT_ALPHA - -uint16_t CardReader::get_num_Files() { - return - #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES - nrFiles // no need to access the SD card for filenames - #else - countFilesInWorkDir() - #endif - ; -} - -// -// Return from procedure or close out the Print Job -// -void CardReader::printingHasFinished() { - planner.synchronize(); - file.close(); - if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. - file_subcall_ctr--; - openFile(proc_filenames[file_subcall_ctr], true, true); - setIndex(filespos[file_subcall_ctr]); - startFileprint(); - } - else { - stopSDPrint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - removeJobRecoveryFile(); - #endif - - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); - #endif - - print_job_timer.stop(); - queue.enqueue_now_P(print_job_timer.duration() > 60 ? PSTR("M31") : PSTR("M117")); - - #if ENABLED(SDCARD_SORT_ALPHA) - presort(); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.set_progress_done(); - #endif - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - ui.reselect_last_file(); - #endif - } -} - -#if ENABLED(AUTO_REPORT_SD_STATUS) - uint8_t CardReader::auto_report_sd_interval = 0; - millis_t CardReader::next_sd_report_ms; - #if NUM_SERIAL > 1 - int8_t CardReader::auto_report_port; - #endif - - void CardReader::auto_report_sd_status() { - millis_t current_ms = millis(); - if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) { - next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval; - PORT_REDIRECT(auto_report_port); - report_status(); - } - } -#endif // AUTO_REPORT_SD_STATUS - -#if ENABLED(POWER_LOSS_RECOVERY) - - bool CardReader::jobRecoverFileExists() { - const bool exists = recovery.file.open(&root, recovery.filename, O_READ); - if (exists) recovery.file.close(); - return exists; - } - - void CardReader::openJobRecoveryFile(const bool read) { - 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, "."); - else if (!read) - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, recovery.filename); - } - - // Removing the job recovery file currently requires closing - // the file being printed, so during SD printing the file should - // be zeroed and written instead of deleted. - void CardReader::removeJobRecoveryFile() { - if (jobRecoverFileExists()) { - recovery.init(); - removeFile(recovery.filename); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_ECHOPGM("Power-loss file delete"); - serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); - #endif - } - } - -#endif // POWER_LOSS_RECOVERY - -#endif // SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.h deleted file mode 100644 index 8ef8dbeae3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/cardreader.h +++ /dev/null @@ -1,301 +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 - -#include "../inc/MarlinConfig.h" - -#if ENABLED(SDSUPPORT) - -#define SD_RESORT BOTH(SDCARD_SORT_ALPHA, SDSORT_DYNAMIC_RAM) - -#define MAX_DIR_DEPTH 10 // Maximum folder depth -#define MAXDIRNAMELENGTH 8 // DOS folder name size -#define MAXPATHNAMELENGTH (1 + (MAXDIRNAMELENGTH + 1) * (MAX_DIR_DEPTH) + 1 + FILENAME_LENGTH) // "/" + N * ("ADIRNAME/") + "filename.ext" - -#include "SdFile.h" - -typedef struct { - bool saving:1, - logging:1, - sdprinting:1, - mounted:1, - filenameIsDir:1, - workDirIsRoot:1, - abort_sd_printing:1 - #if ENABLED(BINARY_FILE_TRANSFER) - , binary_mode:1 - #endif - ; -} card_flags_t; - -class CardReader { -public: - static card_flags_t flag; // Flags (above) - static char filename[FILENAME_LENGTH], // DOS 8.3 filename of the selected item - longFilename[LONG_FILENAME_LENGTH]; // Long name of the selected item - - // Fast! binary file transfer - #if ENABLED(BINARY_FILE_TRANSFER) - #if NUM_SERIAL > 1 - static int8_t transfer_port_index; - #else - static constexpr int8_t transfer_port_index = 0; - #endif - #endif - - // // // Methods // // // - - CardReader(); - - static SdFile getroot() { return root; } - - static void mount(); - static void release(); - static inline bool isMounted() { return flag.mounted; } - static void ls(); - - // SD Card Logging - static void openLogFile(char * const path); - static void write_command(char * const buf); - - // Auto-Start files - static int8_t autostart_index; // Index of autoX.g files - static void beginautostart(); - static void checkautostart(); - - // Basic file ops - static void openFile(char * const path, const bool read, const bool subcall=false); - static void closefile(const bool store_location=false); - static void removeFile(const char * const name); - - static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - static void printLongPath(char * const path); // Used by M33 - #endif - - // Working Directory for SD card menu - static void cdroot(); - static void cd(const char *relpath); - static int8_t cdup(); - static uint16_t countFilesInWorkDir(); - static uint16_t get_num_Files(); - - // Select a file - static void selectFileByIndex(const uint16_t nr); - static void selectFileByName(const char* const match); - - // Print job - static void openAndPrintFile(const char *name); // (working directory) - static void printingHasFinished(); - static void getAbsFilename(char *dst); - static void startFileprint(); - static void printFilename(); - static void stopSDPrint( - #if SD_RESORT - const bool re_sort=false - #endif - ); - static void report_status(); - static inline void pauseSDPrint() { flag.sdprinting = false; } - static inline bool isPaused() { return isFileOpen() && !flag.sdprinting; } - static inline bool isPrinting() { return flag.sdprinting; } - #if HAS_PRINT_PROGRESS_PERMYRIAD - static inline uint16_t permyriadDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 9999) / 10000) : 0; } - #endif - static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - - // Helper for open and remove - static const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo=false); - - #if ENABLED(SDCARD_SORT_ALPHA) - static void presort(); - static void getfilename_sorted(const uint16_t nr); - #if ENABLED(SDSORT_GCODE) - FORCE_INLINE static void setSortOn(bool b) { sort_alpha = b; presort(); } - FORCE_INLINE static void setSortFolders(int i) { sort_folders = i; presort(); } - //FORCE_INLINE static void setSortReverse(bool b) { sort_reverse = b; } - #endif - #else - FORCE_INLINE static void getfilename_sorted(const uint16_t nr) { selectFileByIndex(nr); } - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - static bool jobRecoverFileExists(); - static void openJobRecoveryFile(const bool read); - static void removeJobRecoveryFile(); - #endif - - static inline bool isFileOpen() { return isMounted() && file.isOpen(); } - static inline uint32_t getIndex() { return sdpos; } - static inline bool eof() { return sdpos >= filesize; } - static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } - 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(); - static inline void set_auto_report_interval(uint8_t v) { - #if NUM_SERIAL > 1 - auto_report_port = serial_port_index; - #endif - NOMORE(v, 60); - auto_report_sd_interval = v; - next_sd_report_ms = millis() + 1000UL * v; - } - #endif - -private: - // - // Working directory and parents - // - static SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; - static uint8_t workDirDepth; - - // - // Alphabetical file and folder sorting - // - #if ENABLED(SDCARD_SORT_ALPHA) - static uint16_t sort_count; // Count of sorted items in the current directory - #if ENABLED(SDSORT_GCODE) - static bool sort_alpha; // Flag to enable / disable the feature - static int sort_folders; // Folder sorting before/none/after - //static bool sort_reverse; // Flag to enable / disable reverse sorting - #endif - - // By default the sort index is static - #if ENABLED(SDSORT_DYNAMIC_RAM) - static uint8_t *sort_order; - #else - static uint8_t sort_order[SDSORT_LIMIT]; - #endif - - #if BOTH(SDSORT_USES_RAM, SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) - #define SORTED_LONGNAME_MAXLEN (SDSORT_CACHE_VFATS) * (FILENAME_LENGTH) - #define SORTED_LONGNAME_STORAGE (SORTED_LONGNAME_MAXLEN + 1) - #else - #define SORTED_LONGNAME_MAXLEN LONG_FILENAME_LENGTH - #define SORTED_LONGNAME_STORAGE SORTED_LONGNAME_MAXLEN - #endif - - // Cache filenames to speed up SD menus. - #if ENABLED(SDSORT_USES_RAM) - - // If using dynamic ram for names, allocate on the heap. - #if ENABLED(SDSORT_CACHE_NAMES) - static uint16_t nrFiles; // Cache the total count - #if ENABLED(SDSORT_DYNAMIC_RAM) - static char **sortshort, **sortnames; - #else - static char sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; - #endif - #endif - - #if (ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)) || NONE(SDSORT_CACHE_NAMES, SDSORT_USES_STACK) - static char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_STORAGE]; - #endif - - // Folder sorting uses an isDir array when caching items. - #if HAS_FOLDER_SORTING - #if ENABLED(SDSORT_DYNAMIC_RAM) - static uint8_t *isDir; - #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) - static uint8_t isDir[(SDSORT_LIMIT+7)>>3]; - #endif - #endif - - #endif // SDSORT_USES_RAM - - #endif // SDCARD_SORT_ALPHA - - static Sd2Card sd2card; - static SdVolume volume; - static SdFile file; - - static uint32_t filesize, sdpos; - - // - // Procedure calls to other files - // - #ifndef SD_PROCEDURE_DEPTH - #define SD_PROCEDURE_DEPTH 1 - #endif - static uint8_t file_subcall_ctr; - static uint32_t filespos[SD_PROCEDURE_DEPTH]; - static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - - // - // SD Auto Reporting - // - #if ENABLED(AUTO_REPORT_SD_STATUS) - static uint8_t auto_report_sd_interval; - static millis_t next_sd_report_ms; - #if NUM_SERIAL > 1 - static int8_t auto_report_port; - #endif - #endif - - // - // Directory items - // - static bool is_dir_or_gcode(const dir_t &p); - static int countItems(SdFile dir); - static void selectByIndex(SdFile dir, const uint8_t index); - static void selectByName(SdFile dir, const char * const match); - static void printListing(SdFile parent, const char * const prepend=nullptr); - - #if ENABLED(SDCARD_SORT_ALPHA) - static void flush_presort(); - #endif -}; - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define IS_SD_INSERTED() Sd2Card::isInserted() -#elif PIN_EXISTS(SD_DETECT) - #if ENABLED(SD_DETECT_INVERTED) - #define IS_SD_INSERTED() READ(SD_DETECT_PIN) - #else - #define IS_SD_INSERTED() !READ(SD_DETECT_PIN) - #endif -#else - // No card detect line? Assume the card is inserted. - #define IS_SD_INSERTED() true -#endif - -#define IS_SD_PRINTING() card.flag.sdprinting -#define IS_SD_PAUSED() card.isPaused() -#define IS_SD_FILE_OPEN() card.isFileOpen() - -extern CardReader card; - -#else // !SDSUPPORT - -#define IS_SD_PRINTING() false -#define IS_SD_PAUSED() false -#define IS_SD_FILE_OPEN() false - -#define LONG_FILENAME_LENGTH 0 - -#endif // !SDSUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp deleted file mode 100644 index 12f02c19f0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ /dev/null @@ -1,326 +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 . - * - */ - -#include "../../inc/MarlinConfigPre.h" - -/** - * Adjust USB_DEBUG to select debugging verbosity. - * 0 - no debug messages - * 1 - basic insertion/removal messages - * 2 - show USB state transitions - * 3 - perform block range checking - * 4 - print each block access - */ -#define USB_DEBUG 1 -#define USB_STARTUP_DELAY 0 - -// uncomment to get 'printf' console debugging. NOT FOR UNO! -//#define HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} -//#define BS_HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} -//#define MAX_HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - -#include "../../Marlin.h" -#include "../../core/serial.h" -#include "../../module/temperature.h" - -static_assert(USB_CS_PIN != -1, "USB_CS_PIN must be defined"); -static_assert(USB_INTR_PIN != -1, "USB_INTR_PIN must be defined"); - -#if ENABLED(USE_UHS3_USB) - #define NO_AUTO_SPEED - #define UHS_MAX3421E_SPD 8000000 >> SPI_SPEED - #define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1 - #define UHS_HOST_MAX_INTERFACE_DRIVERS 2 - #define MASS_MAX_SUPPORTED_LUN 1 - #define USB_HOST_SERIAL MYSERIAL0 - - // Workaround for certain issues with UHS3 - #define SKIP_PAGE3F // Required for IOGEAR media adapter - #define USB_NO_TEST_UNIT_READY // Required for removable media adapter - #define USB_HOST_MANUAL_POLL // Optimization to shut off IRQ automatically - - // Workarounds for keeping Marlin's watchdog timer from barking... - void marlin_yield() { - thermalManager.manage_heater(); - } - #define SYSTEM_OR_SPECIAL_YIELD(...) marlin_yield(); - #define delay(x) safe_delay(x) - - #define LOAD_USB_HOST_SYSTEM - #define LOAD_USB_HOST_SHIELD - #define LOAD_UHS_BULK_STORAGE - - #define MARLIN_UHS_WRITE_SS(v) WRITE(USB_CS_PIN, v) - #define MARLIN_UHS_READ_IRQ() READ(USB_INTR_PIN) - - #include "lib-uhs3/UHS_host/UHS_host.h" - - MAX3421E_HOST usb(USB_CS_PIN, USB_INTR_PIN); - UHS_Bulk_Storage bulk(&usb); - - #define UHS_START (usb.Init() == 0) - #define UHS_STATE(state) UHS_USB_HOST_STATE_##state -#else - #include "lib-uhs2/Usb.h" - #include "lib-uhs2/masstorage.h" - - USB usb; - BulkOnly bulk(&usb); - - #define UHS_START usb.start() - #define UHS_STATE(state) USB_STATE_##state -#endif - -#include "Sd2Card_FlashDrive.h" - -#if HAS_DISPLAY - #include "../../lcd/ultralcd.h" -#endif - -static enum { - UNINITIALIZED, - DO_STARTUP, - WAIT_FOR_DEVICE, - WAIT_FOR_LUN, - MEDIA_READY, - MEDIA_ERROR -} state; - -#if USB_DEBUG >= 3 - uint32_t lun0_capacity; -#endif - -bool Sd2Card::usbStartup() { - if (state <= DO_STARTUP) { - SERIAL_ECHOPGM("Starting USB host..."); - if (!UHS_START) { - SERIAL_ECHOLNPGM(" failed."); - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM(MSG_MEDIA_USB_FAILED); - #endif - return false; - } - - // SPI quick test - check revision register - switch (usb.regRd(rREVISION)) { - case 0x01: SERIAL_ECHOLNPGM("rev.01 started"); break; - case 0x12: SERIAL_ECHOLNPGM("rev.02 started"); break; - case 0x13: SERIAL_ECHOLNPGM("rev.03 started"); break; - default: SERIAL_ECHOLNPGM("started. rev unknown."); break; - } - state = WAIT_FOR_DEVICE; - } - return true; -} - -// The USB library needs to be called periodically to detect USB thumbdrive -// insertion and removals. Call this idle() function periodically to allow -// the USB library to monitor for such events. This function also takes care -// of initializing the USB library for the first time. - -void Sd2Card::idle() { - usb.Task(); - - const uint8_t task_state = usb.getUsbTaskState(); - - #if USB_DEBUG >= 2 - if (state > DO_STARTUP) { - static uint8_t laststate = 232; - if (task_state != laststate) { - laststate = task_state; - #define UHS_USB_DEBUG(x) case UHS_STATE(x): SERIAL_ECHOLNPGM(#x); break - switch (task_state) { - UHS_USB_DEBUG(IDLE); - UHS_USB_DEBUG(RESET_DEVICE); - UHS_USB_DEBUG(RESET_NOT_COMPLETE); - UHS_USB_DEBUG(DEBOUNCE); - UHS_USB_DEBUG(DEBOUNCE_NOT_COMPLETE); - UHS_USB_DEBUG(WAIT_SOF); - UHS_USB_DEBUG(ERROR); - UHS_USB_DEBUG(CONFIGURING); - UHS_USB_DEBUG(CONFIGURING_DONE); - UHS_USB_DEBUG(RUNNING); - default: - SERIAL_ECHOLNPAIR("UHS_USB_HOST_STATE: ", task_state); - break; - } - } - } - #endif - - static millis_t next_state_ms = millis(); - - #define GOTO_STATE_AFTER_DELAY(STATE, DELAY) do{ state = STATE; next_state_ms = millis() + DELAY; }while(0) - - if (ELAPSED(millis(), next_state_ms)) { - GOTO_STATE_AFTER_DELAY(state, 250); // Default delay - - switch (state) { - - case UNINITIALIZED: - #ifndef MANUAL_USB_STARTUP - GOTO_STATE_AFTER_DELAY( DO_STARTUP, USB_STARTUP_DELAY ); - #endif - break; - - case DO_STARTUP: usbStartup(); break; - - case WAIT_FOR_DEVICE: - if (task_state == UHS_STATE(RUNNING)) { - #if USB_DEBUG >= 1 - SERIAL_ECHOLNPGM("USB device inserted"); - #endif - GOTO_STATE_AFTER_DELAY( WAIT_FOR_LUN, 250 ); - } - break; - - case WAIT_FOR_LUN: - /* USB device is inserted, but if it is an SD card, - * adapter it may not have an SD card in it yet. */ - if (bulk.LUNIsGood(0)) { - #if USB_DEBUG >= 1 - SERIAL_ECHOLNPGM("LUN is good"); - #endif - GOTO_STATE_AFTER_DELAY( MEDIA_READY, 100 ); - } - else { - #ifdef USB_HOST_MANUAL_POLL - // Make sure we catch disconnect events - usb.busprobe(); - usb.VBUS_changed(); - #endif - #if USB_DEBUG >= 1 - SERIAL_ECHOLNPGM("Waiting for media"); - #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM(MSG_MEDIA_WAITING); - #endif - GOTO_STATE_AFTER_DELAY(state, 2000); - } - break; - - case MEDIA_READY: break; - case MEDIA_ERROR: break; - } - - if (state > WAIT_FOR_DEVICE && task_state != UHS_STATE(RUNNING)) { - // Handle device removal events - #if USB_DEBUG >= 1 - SERIAL_ECHOLNPGM("USB device removed"); - #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - if (state != MEDIA_READY) - LCD_MESSAGEPGM(MSG_MEDIA_USB_REMOVED); - #endif - GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 ); - } - - else if (state > WAIT_FOR_LUN && !bulk.LUNIsGood(0)) { - // Handle media removal events - #if USB_DEBUG >= 1 - SERIAL_ECHOLNPGM("Media removed"); - #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - 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(MSG_MEDIA_READ_ERROR); - #endif - GOTO_STATE_AFTER_DELAY( MEDIA_ERROR, 0 ); - } - } -} - -// Marlin calls this function to check whether an USB drive is inserted. -// This is equivalent to polling the SD_DETECT when using SD cards. -bool Sd2Card::isInserted() { - return state == MEDIA_READY; -} - -bool Sd2Card::ready() { - return state > DO_STARTUP; -} - -// Marlin calls this to initialize an SD card once it is inserted. -bool Sd2Card::init(const uint8_t, const pin_t) { - if (!isInserted()) return false; - - #if USB_DEBUG >= 1 - const uint32_t sectorSize = bulk.GetSectorSize(0); - if (sectorSize != 512) { - SERIAL_ECHOLNPAIR("Expecting sector size of 512. Got: ", sectorSize); - return false; - } - #endif - - #if USB_DEBUG >= 3 - lun0_capacity = bulk.GetCapacity(0); - SERIAL_ECHOLNPAIR("LUN Capacity (in blocks): ", lun0_capacity); - #endif - return true; -} - -// Returns the capacity of the card in blocks. -uint32_t Sd2Card::cardSize() { - if (!isInserted()) return false; - #if USB_DEBUG < 3 - const uint32_t - #endif - lun0_capacity = bulk.GetCapacity(0); - return lun0_capacity; -} - -bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { - if (!isInserted()) return false; - #if USB_DEBUG >= 3 - if (block >= lun0_capacity) { - SERIAL_ECHOLNPAIR("Attempt to read past end of LUN: ", block); - return false; - } - #if USB_DEBUG >= 4 - SERIAL_ECHOLNPAIR("Read block ", block); - #endif - #endif - return bulk.Read(0, block, 512, 1, dst) == 0; -} - -bool Sd2Card::writeBlock(uint32_t block, const uint8_t* src) { - if (!isInserted()) return false; - #if USB_DEBUG >= 3 - if (block >= lun0_capacity) { - SERIAL_ECHOLNPAIR("Attempt to write past end of LUN: ", block); - return false; - } - #if USB_DEBUG >= 4 - SERIAL_ECHOLNPAIR("Write block ", block); - #endif - #endif - return bulk.Write(0, block, 512, 1, src) == 0; -} - -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h deleted file mode 100644 index a429bfd28f..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ /dev/null @@ -1,74 +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 - -/** - * \file - * \brief Sd2Card class for V2 SD/SDHC cards - */ - -#include "../SdFatConfig.h" -#include "../SdInfo.h" - -/** - * define SOFTWARE_SPI to use bit-bang SPI - */ -#if MEGA_SOFT_SPI || USE_SOFTWARE_SPI - #define SOFTWARE_SPI -#endif - -// SPI pin definitions - do not edit here - change in SdFatConfig.h -#if DISABLED(SOFTWARE_SPI) - // hardware pin defs - #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. -#else // SOFTWARE_SPI - #define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD -#endif // SOFTWARE_SPI - -class Sd2Card { - private: - uint32_t pos; - - static void usbStateDebug(); - - public: - static bool usbStartup(); - - bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=SD_CHIP_SELECT_PIN); - - static void idle(); - - inline bool readStart(const uint32_t block) { pos = block; return ready(); } - inline bool readData(uint8_t* dst) { return readBlock(pos++, dst); } - inline bool readStop() const { return true; } - - inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return ready(); } - inline bool writeData(uint8_t* src) { return writeBlock(pos++, src); } - inline bool writeStop() const { return true; } - - bool readBlock(uint32_t block, uint8_t* dst); - bool writeBlock(uint32_t blockNumber, const uint8_t* src); - - uint32_t cardSize(); - static bool isInserted(); - static bool ready(); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt deleted file mode 100644 index 5abcc8f2ad..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt +++ /dev/null @@ -1,46 +0,0 @@ - -==== USB HOST SHIELD 2.0 LIBRARY ==== - -The lib/ folder contains a subset of the files from the USB Host Shield 2.0 -library: - - https://github.com/felis/USB_Host_Shield_2.0 - -While the original library was released under the GPLv2 and could not be -commingled with Marlin, the developers have graciously re-licenced the -files needed for Marlin as "GPLv2 or later", as documented in this thread. - - https://github.com/felis/USB_Host_Shield_2.0/issues/364 - -Small modifications have been made to the source. Please search for -USB_FLASH_DRIVE_SUPPORT or look at the patch file to see what was changed. - -==== LICENSE SUMMARY ==== - -Source Path: Repository: License: ------------- ----------- -------- -lib-uhs3/ github.com/felis/USB_Host_Shield_2.0 GPLv2 or later -lib-uhs3/lib/masstorage.cpp github.com/greiman/UsbFat [1] MIT -lib-uhs3/lib/settings.h github.com/greiman/UsbFat [1] MIT - -[1] Changes related to SKIP_WRITE_PROTECT and DELAY only - -==== PERFORMANCE ENHANCEMENTS FOR USB DRIVES ==== - -There are also some small performance enhancements from Bill Greiman, regarding -SKIP_WRITE_PROTECT and DELAY. These changes came from the following repo: - - https://github.com/greiman/UsbFat - -While the original library was released under the GPLv2 and could not be -commingled with Marlin, the developer has graciously re-licenced his changes -under the "MIT" license, as documented here: - - https://github.com/greiman/UsbFat/issues/8 - -==== MARLIN INTEGRATION WORK ==== - -All additional work done to integrate USB into Marlin was performed by AlephObjects, Inc. -and is licensed under the GPLv3. - --- marcio@alephobjects.com diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp deleted file mode 100644 index 9092633b84..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ /dev/null @@ -1,798 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -/* USB functions */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) - -#include "Usb.h" - -static uint8_t usb_error = 0; -static uint8_t usb_task_state; - -/* constructor */ -USB::USB() : bmHubPre(0) { - usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; //set up state machine - init(); -} - -/* Initialize data structures */ -void USB::init() { - //devConfigIndex = 0; - bmHubPre = 0; -} - -uint8_t USB::getUsbTaskState() { - return usb_task_state; -} - -void USB::setUsbTaskState(uint8_t state) { - usb_task_state = state; -} - -EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) { - UsbDevice *p = addrPool.GetUsbDevicePtr(addr); - - if (!p || !p->epinfo) - return nullptr; - - EpInfo *pep = p->epinfo; - - for (uint8_t i = 0; i < p->epcount; i++) { - if ((pep)->epAddr == ep) - return pep; - - pep++; - } - return nullptr; -} - -/* set device table entry */ - -/* each device is different and has different number of endpoints. This function plugs endpoint record structure, defined in application, to devtable */ -uint8_t USB::setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr) { - if (!eprecord_ptr) - return USB_ERROR_INVALID_ARGUMENT; - - UsbDevice *p = addrPool.GetUsbDevicePtr(addr); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - p->address.devAddress = addr; - p->epinfo = eprecord_ptr; - p->epcount = epcount; - - return 0; -} - -uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_limit) { - UsbDevice *p = addrPool.GetUsbDevicePtr(addr); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - if (!p->epinfo) - return USB_ERROR_EPINFO_IS_NULL; - - *ppep = getEpInfoEntry(addr, ep); - - if (!*ppep) - return USB_ERROR_EP_NOT_FOUND_IN_TBL; - - *nak_limit = (0x0001UL << (((*ppep)->bmNakPower > USB_NAK_MAX_POWER) ? USB_NAK_MAX_POWER : (*ppep)->bmNakPower)); - (*nak_limit)--; - /* - USBTRACE2("\r\nAddress: ", addr); - USBTRACE2(" EP: ", ep); - USBTRACE2(" NAK Power: ",(*ppep)->bmNakPower); - USBTRACE2(" NAK Limit: ", nak_limit); - USBTRACE("\r\n"); - */ - regWr(rPERADDR, addr); //set peripheral address - - uint8_t mode = regRd(rMODE); - - //Serial.print("\r\nMode: "); - //Serial.println( mode, HEX); - //Serial.print("\r\nLS: "); - //Serial.println(p->lowspeed, HEX); - - - - // Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise - regWr(rMODE, (p->lowspeed) ? mode | bmLOWSPEED | bmHubPre : mode & ~(bmHUBPRE | bmLOWSPEED)); - - return 0; -} - -/* Control transfer. Sets address, endpoint, fills control packet with necessary data, dispatches control packet, and initiates bulk IN transfer, */ -/* depending on request. Actual requests are defined as inlines */ -/* return codes: */ -/* 00 = success */ - -/* 01-0f = non-zero HRSLT */ -uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, - uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p) { - bool direction = false; //request direction, IN or OUT - uint8_t rcode; - SETUP_PKT setup_pkt; - - EpInfo *pep = nullptr; - uint16_t nak_limit = 0; - - rcode = SetAddress(addr, ep, &pep, &nak_limit); - if (rcode) return rcode; - - direction = ((bmReqType & 0x80) > 0); - - /* fill in setup packet */ - setup_pkt.ReqType_u.bmRequestType = bmReqType; - setup_pkt.bRequest = bRequest; - setup_pkt.wVal_u.wValueLo = wValLo; - setup_pkt.wVal_u.wValueHi = wValHi; - setup_pkt.wIndex = wInd; - setup_pkt.wLength = total; - - bytesWr(rSUDFIFO, 8, (uint8_t*) & setup_pkt); //transfer to setup packet FIFO - - rcode = dispatchPkt(tokSETUP, ep, nak_limit); //dispatch packet - if (rcode) return rcode; // Return HRSLT if not zero - - if (dataptr != nullptr) { //data stage, if present - if (direction) { //IN transfer - uint16_t left = total; - pep->bmRcvToggle = 1; //bmRCVTOG1; - - while (left) { - // Bytes read into buffer - uint16_t read = nbytes; - //uint16_t read = (leftbmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - continue; - } - - if (rcode) return rcode; - - // Invoke callback function if inTransfer completed successfully and callback function pointer is specified - if (!rcode && p) ((USBReadParser*)p)->Parse(read, dataptr, total - left); - - left -= read; - - if (read < nbytes) break; - } - } - else { //OUT transfer - pep->bmSndToggle = 1; //bmSNDTOG1; - rcode = OutTransfer(pep, nak_limit, nbytes, dataptr); - } - if (rcode) return rcode; // return error - } - // Status stage - return dispatchPkt((direction) ? tokOUTHS : tokINHS, ep, nak_limit); //GET if direction -} - -/* IN transfer to arbitrary endpoint. Assumes PERADDR is set. Handles multiple packets if necessary. Transfers 'nbytes' bytes. */ -/* Keep sending INs and writes data to memory area pointed by 'data' */ - -/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error, - fe USB xfer timeout */ -uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) { - EpInfo *pep = nullptr; - uint16_t nak_limit = 0; - - uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit); - if (rcode) { - USBTRACE3("(USB::InTransfer) SetAddress Failed ", rcode, 0x81); - USBTRACE3("(USB::InTransfer) addr requested ", addr, 0x81); - USBTRACE3("(USB::InTransfer) ep requested ", ep, 0x81); - return rcode; - } - return InTransfer(pep, nak_limit, nbytesptr, data, bInterval); -} - -uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) { - uint8_t rcode = 0; - uint8_t pktsize; - - uint16_t nbytes = *nbytesptr; - //printf("Requesting %i bytes ", nbytes); - uint8_t maxpktsize = pep->maxPktSize; - - *nbytesptr = 0; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value - - // use a 'break' to exit this loop - for (;;) { - rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS. - if (rcode == hrTOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value - continue; - } - if (rcode) { - //printf(">>>>>>>> Problem! dispatchPkt %2.2x\r\n", rcode); - break; //should be 0, indicating ACK. Else return error code. - } - /* check for RCVDAVIRQ and generate error if not present */ - /* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */ - if ((regRd(rHIRQ) & bmRCVDAVIRQ) == 0) { - //printf(">>>>>>>> Problem! NO RCVDAVIRQ!\r\n"); - rcode = 0xF0; //receive error - break; - } - pktsize = regRd(rRCVBC); //number of received bytes - //printf("Got %i bytes \r\n", pktsize); - // This would be OK, but... - //assert(pktsize <= nbytes); - if (pktsize > nbytes) { - // This can happen. Use of assert on Arduino locks up the Arduino. - // So I will trim the value, and hope for the best. - //printf(">>>>>>>> Problem! Wanted %i bytes but got %i.\r\n", nbytes, pktsize); - pktsize = nbytes; - } - - int16_t mem_left = (int16_t)nbytes - *((int16_t*)nbytesptr); - if (mem_left < 0) mem_left = 0; - - data = bytesRd(rRCVFIFO, ((pktsize > mem_left) ? mem_left : pktsize), data); - - regWr(rHIRQ, bmRCVDAVIRQ); // Clear the IRQ & free the buffer - *nbytesptr += pktsize; // add this packet's byte count to total transfer length - - /* The transfer is complete under two conditions: */ - /* 1. The device sent a short packet (L.T. maxPacketSize) */ - /* 2. 'nbytes' have been transferred. */ - if (pktsize < maxpktsize || *nbytesptr >= nbytes) { // Transferred 'nbytes' bytes? - // Save toggle value - pep->bmRcvToggle = ((regRd(rHRSL) & bmRCVTOGRD)) ? 1 : 0; - //printf("\r\n"); - rcode = 0; - break; - } - else if (bInterval > 0) - delay(bInterval); // Delay according to polling interval - } - return rcode; -} - -/* OUT transfer to arbitrary endpoint. Handles multiple packets if necessary. Transfers 'nbytes' bytes. */ -/* Handles NAK bug per Maxim Application Note 4000 for single buffer transfer */ - -/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */ -uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { - EpInfo *pep = nullptr; - uint16_t nak_limit = 0; - - uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit); - if (rcode) return rcode; - - return OutTransfer(pep, nak_limit, nbytes, data); -} - -uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data) { - uint8_t rcode = hrSUCCESS, retry_count; - uint8_t *data_p = data; //local copy of the data pointer - uint16_t bytes_tosend, nak_count; - uint16_t bytes_left = nbytes; - - uint8_t maxpktsize = pep->maxPktSize; - - if (maxpktsize < 1 || maxpktsize > 64) - return USB_ERROR_INVALID_MAX_PKT_SIZE; - - uint32_t timeout = (uint32_t)millis() + USB_XFER_TIMEOUT; - - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value - - while (bytes_left) { - retry_count = 0; - nak_count = 0; - bytes_tosend = (bytes_left >= maxpktsize) ? maxpktsize : bytes_left; - bytesWr(rSNDFIFO, bytes_tosend, data_p); //filling output FIFO - regWr(rSNDBC, bytes_tosend); //set number of bytes - regWr(rHXFR, (tokOUT | pep->epAddr)); //dispatch packet - while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ - rcode = (regRd(rHRSL) & 0x0F); - - while (rcode && ((int32_t)((uint32_t)millis() - timeout) < 0L)) { - switch (rcode) { - case hrNAK: - nak_count++; - if (nak_limit && (nak_count == nak_limit)) - goto breakout; - //return ( rcode); - break; - case hrTIMEOUT: - retry_count++; - if (retry_count == USB_RETRY_LIMIT) - goto breakout; - //return ( rcode); - break; - case hrTOGERR: - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value - break; - default: - goto breakout; - } - - /* process NAK according to Host out NAK bug */ - regWr(rSNDBC, 0); - regWr(rSNDFIFO, *data_p); - regWr(rSNDBC, bytes_tosend); - regWr(rHXFR, (tokOUT | pep->epAddr)); //dispatch packet - while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ - rcode = (regRd(rHRSL) & 0x0F); - } // while rcode && .... - bytes_left -= bytes_tosend; - data_p += bytes_tosend; - } // while bytes_left... -breakout: - - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; //bmSNDTOG1 : bmSNDTOG0; //update toggle - return ( rcode); //should be 0 in all cases -} - -/* dispatch USB packet. Assumes peripheral address is set and relevant buffer is loaded/empty */ -/* If NAK, tries to re-send up to nak_limit times */ -/* If nak_limit == 0, do not count NAKs, exit after timeout */ -/* If bus timeout, re-sends up to USB_RETRY_LIMIT times */ - -/* return codes 0x00-0x0F are HRSLT( 0x00 being success ), 0xFF means timeout */ -uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { - uint32_t timeout = (uint32_t)millis() + USB_XFER_TIMEOUT; - uint8_t tmpdata; - uint8_t rcode = hrSUCCESS; - uint8_t retry_count = 0; - uint16_t nak_count = 0; - - while ((int32_t)((uint32_t)millis() - timeout) < 0L) { - #if defined(ESP8266) || defined(ESP32) - yield(); // needed in order to reset the watchdog timer on the ESP8266 - #endif - regWr(rHXFR, (token | ep)); //launch the transfer - rcode = USB_ERROR_TRANSFER_TIMEOUT; - - while ((int32_t)((uint32_t)millis() - timeout) < 0L) { //wait for transfer completion - #if defined(ESP8266) || defined(ESP32) - yield(); // needed to reset the watchdog timer on the ESP8266 - #endif - tmpdata = regRd(rHIRQ); - - if (tmpdata & bmHXFRDNIRQ) { - regWr(rHIRQ, bmHXFRDNIRQ); //clear the interrupt - rcode = 0x00; - break; - } - - } // while millis() < timeout - - //if (rcode != 0x00) //exit if timeout - // return ( rcode); - - rcode = (regRd(rHRSL) & 0x0F); //analyze transfer result - - switch (rcode) { - case hrNAK: - nak_count++; - if (nak_limit && (nak_count == nak_limit)) - return (rcode); - break; - case hrTIMEOUT: - retry_count++; - if (retry_count == USB_RETRY_LIMIT) - return (rcode); - break; - default: - return (rcode); - } - - } // while timeout > millis() - return rcode; -} - -/* USB main task. Performs enumeration/cleanup */ -void USB::Task() { //USB state machine - uint8_t rcode; - uint8_t tmpdata; - static uint32_t delay = 0; - //USB_DEVICE_DESCRIPTOR buf; - bool lowspeed = false; - - MAX3421E::Task(); - - tmpdata = getVbusState(); - - /* modify USB task state if Vbus changed */ - switch (tmpdata) { - case SE1: //illegal state - usb_task_state = USB_DETACHED_SUBSTATE_ILLEGAL; - lowspeed = false; - break; - case SE0: //disconnected - if ((usb_task_state & USB_STATE_MASK) != USB_STATE_DETACHED) - usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; - lowspeed = false; - break; - case LSHOST: - lowspeed = true; - //intentional fallthrough - case FSHOST: //attached - if ((usb_task_state & USB_STATE_MASK) == USB_STATE_DETACHED) { - delay = (uint32_t)millis() + USB_SETTLE_DELAY; - usb_task_state = USB_ATTACHED_SUBSTATE_SETTLE; - } - break; - } - - for (uint8_t i = 0; i < USB_NUMDEVICES; i++) - if (devConfig[i]) rcode = devConfig[i]->Poll(); - - switch (usb_task_state) { - case USB_DETACHED_SUBSTATE_INITIALIZE: - init(); - - for (uint8_t i = 0; i < USB_NUMDEVICES; i++) - if (devConfig[i]) - rcode = devConfig[i]->Release(); - - usb_task_state = USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE; - break; - case USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE: //just sit here - break; - case USB_DETACHED_SUBSTATE_ILLEGAL: //just sit here - break; - case USB_ATTACHED_SUBSTATE_SETTLE: //settle time for just attached device - if ((int32_t)((uint32_t)millis() - delay) >= 0L) - usb_task_state = USB_ATTACHED_SUBSTATE_RESET_DEVICE; - else break; // don't fall through - case USB_ATTACHED_SUBSTATE_RESET_DEVICE: - regWr(rHCTL, bmBUSRST); //issue bus reset - usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE; - break; - case USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE: - if ((regRd(rHCTL) & bmBUSRST) == 0) { - tmpdata = regRd(rMODE) | bmSOFKAENAB; //start SOF generation - regWr(rMODE, tmpdata); - usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_SOF; - //delay = (uint32_t)millis() + 20; //20ms wait after reset per USB spec - } - break; - case USB_ATTACHED_SUBSTATE_WAIT_SOF: //todo: change check order - if (regRd(rHIRQ) & bmFRAMEIRQ) { - //when first SOF received _and_ 20ms has passed we can continue - /* - if (delay < (uint32_t)millis()) //20ms passed - usb_task_state = USB_STATE_CONFIGURING; - */ - usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_RESET; - delay = (uint32_t)millis() + 20; - } - break; - case USB_ATTACHED_SUBSTATE_WAIT_RESET: - if ((int32_t)((uint32_t)millis() - delay) >= 0L) usb_task_state = USB_STATE_CONFIGURING; - else break; // don't fall through - case USB_STATE_CONFIGURING: - - //Serial.print("\r\nConf.LS: "); - //Serial.println(lowspeed, HEX); - - rcode = Configuring(0, 0, lowspeed); - - if (!rcode) - usb_task_state = USB_STATE_RUNNING; - else if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE) { - usb_error = rcode; - usb_task_state = USB_STATE_ERROR; - } - break; - case USB_STATE_RUNNING: - break; - case USB_STATE_ERROR: - //MAX3421E::Init(); - break; - } -} - -uint8_t USB::DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed) { - //uint8_t buf[12]; - uint8_t rcode; - UsbDevice *p0 = nullptr, *p = nullptr; - - // Get pointer to pseudo device with address 0 assigned - p0 = addrPool.GetUsbDevicePtr(0); - if (!p0) return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - if (!p0->epinfo) return USB_ERROR_EPINFO_IS_NULL; - - p0->lowspeed = lowspeed; - - // Allocate new address according to device class - uint8_t bAddress = addrPool.AllocAddress(parent, false, port); - if (!bAddress) return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL; - - p = addrPool.GetUsbDevicePtr(bAddress); - if (!p) return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - p->lowspeed = lowspeed; - - // Assign new address to the device - rcode = setAddr(0, 0, bAddress); - if (rcode) { - addrPool.FreeAddress(bAddress); - bAddress = 0; - } - return rcode; -} - -uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lowspeed) { - //printf("AttemptConfig: parent = %i, port = %i\r\n", parent, port); - uint8_t retries = 0; - -again: - uint8_t rcode = devConfig[driver]->ConfigureDevice(parent, port, lowspeed); - if (rcode == USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET) { - if (parent == 0) { - // Send a bus reset on the root interface. - regWr(rHCTL, bmBUSRST); //issue bus reset - delay(102); // delay 102ms, compensate for clock inaccuracy. - } - else { - // reset parent port - devConfig[parent]->ResetHubPort(port); - } - } - else if (rcode == hrJERR && retries < 3) { // Some devices returns this when plugged in - trying to initialize the device again usually works - delay(100); - retries++; - goto again; - } - else if (rcode) - return rcode; - - rcode = devConfig[driver]->Init(parent, port, lowspeed); - if (rcode == hrJERR && retries < 3) { // Some devices returns this when plugged in - trying to initialize the device again usually works - delay(100); - retries++; - goto again; - } - - if (rcode) { - // Issue a bus reset, because the device may be in a limbo state - if (parent == 0) { - // Send a bus reset on the root interface. - regWr(rHCTL, bmBUSRST); //issue bus reset - delay(102); // delay 102ms, compensate for clock inaccuracy. - } - else { - // reset parent port - devConfig[parent]->ResetHubPort(port); - } - } - return rcode; -} - -/** - * This is broken. It needs to enumerate differently. - * It causes major problems with several devices if detected in an unexpected order. - * - * Oleg - I wouldn't do anything before the newly connected device is considered sane. - * i.e.(delays are not indicated for brevity): - * 1. reset - * 2. GetDevDescr(); - * 3a. If ACK, continue with allocating address, addressing, etc. - * 3b. Else reset again, count resets, stop at some number (5?). - * 4. When max.number of resets is reached, toggle power/fail - * If desired, this could be modified by performing two resets with GetDevDescr() in the middle - however, from my experience, if a device answers to GDD() - * it doesn't need to be reset again - * New steps proposal: - * 1: get address pool instance. exit on fail - * 2: pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf). exit on fail. - * 3: bus reset, 100ms delay - * 4: set address - * 5: pUsb->setEpInfoEntry(bAddress, 1, epInfo), exit on fail - * 6: while (configurations) { - * for (each configuration) { - * for (each driver) { - * 6a: Ask device if it likes configuration. Returns 0 on OK. - * If successful, the driver configured device. - * The driver now owns the endpoints, and takes over managing them. - * The following will need codes: - * Everything went well, instance consumed, exit with success. - * Instance already in use, ignore it, try next driver. - * Not a supported device, ignore it, try next driver. - * Not a supported configuration for this device, ignore it, try next driver. - * Could not configure device, fatal, exit with fail. - * } - * } - * } - * 7: for (each driver) { - * 7a: Ask device if it knows this VID/PID. Acts exactly like 6a, but using VID/PID - * 8: if we get here, no driver likes the device plugged in, so exit failure. - * - */ -uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { - //uint8_t bAddress = 0; - //printf("Configuring: parent = %i, port = %i\r\n", parent, port); - uint8_t devConfigIndex; - uint8_t rcode = 0; - uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)]; - USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); - UsbDevice *p = nullptr; - EpInfo *oldep_ptr = nullptr; - EpInfo epInfo; - - epInfo.epAddr = 0; - epInfo.maxPktSize = 8; - epInfo.bmSndToggle = 0; - epInfo.bmRcvToggle = 0; - epInfo.bmNakPower = USB_NAK_MAX_POWER; - - //delay(2000); - AddressPool &addrPool = GetAddressPool(); - // Get pointer to pseudo device with address 0 assigned - p = addrPool.GetUsbDevicePtr(0); - if (!p) { - //printf("Configuring error: USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL\r\n"); - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - } - - // Save old pointer to EP_RECORD of address 0 - oldep_ptr = p->epinfo; - - // Temporary assign new pointer to epInfo to p->epinfo in order to - // avoid toggle inconsistence - - p->epinfo = &epInfo; - - p->lowspeed = lowspeed; - // Get device descriptor - rcode = getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*)buf); - - // Restore p->epinfo - p->epinfo = oldep_ptr; - - if (rcode) { - //printf("Configuring error: Can't get USB_DEVICE_DESCRIPTOR\r\n"); - return rcode; - } - - // to-do? - // Allocate new address according to device class - //bAddress = addrPool.AllocAddress(parent, false, port); - - uint16_t vid = udd->idVendor, pid = udd->idProduct; - uint8_t klass = udd->bDeviceClass, subklass = udd->bDeviceSubClass; - - // Attempt to configure if VID/PID or device class matches with a driver - // Qualify with subclass too. - // - // VID/PID & class tests default to false for drivers not yet ported - // subclass defaults to true, so you don't have to define it if you don't have to. - // - for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) { - if (!devConfig[devConfigIndex]) continue; // no driver - if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed - if (devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) { - rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed); - if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED) - break; - } - } - - if (devConfigIndex < USB_NUMDEVICES) return rcode; - - // blindly attempt to configure - for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) { - if (!devConfig[devConfigIndex]) continue; - if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed - if (devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) continue; // If this is true it means it must have returned USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED above - rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed); - - //printf("ERROR ENUMERATING %2.2x\r\n", rcode); - if (!(rcode == USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED || rcode == USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE)) { - // in case of an error dev_index should be reset to 0 - // in order to start from the very beginning the - // next time the program gets here - //if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE) - // devConfigIndex = 0; - return rcode; - } - } - // Arriving here means the device class is unsupported by registered classes - return DefaultAddressing(parent, port, lowspeed); -} - -uint8_t USB::ReleaseDevice(uint8_t addr) { - if (addr) { - for (uint8_t i = 0; i < USB_NUMDEVICES; i++) { - if (!devConfig[i]) continue; - if (devConfig[i]->GetAddress() == addr) - return devConfig[i]->Release(); - } - } - return 0; -} - -#if 1 //!defined(USB_METHODS_INLINE) -//get device descriptor - -uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) { - return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, nullptr); -} -//get configuration descriptor - -uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { - return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, nullptr); -} - -/* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this - total length. The length of the first request can be shorter ( 4 bytes ), however, there are devices which won't work unless this length is set to 9 */ -uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) { - const uint8_t bufSize = 64; - uint8_t buf[bufSize]; - USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); - - uint8_t ret = getConfDescr(addr, ep, 9, conf, buf); - if (ret) return ret; - - uint16_t total = ucd->wTotalLength; - - //USBTRACE2("\r\ntotal conf.size:", total); - - return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, total, bufSize, buf, p); -} - -//get string descriptor - -uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { - return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, nullptr); -} -//set address - -uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) { - uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); - //delay(2); //per USB 2.0 sect.9.2.6.3 - delay(300); // Older spec says you should wait at least 200ms - return rcode; - //return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); -} -//set configuration - -uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) { - return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); -} - -#endif // defined(USB_METHODS_INLINE) -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h deleted file mode 100644 index 195b26e940..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -/* USB functions */ -#define _usb_h_ - -#include "../../../inc/MarlinConfigPre.h" - -// WARNING: Do not change the order of includes, or stuff will break! -#include -#include -#include - -// None of these should ever be included by a driver, or a user's sketch. -#include "settings.h" -#include "printhex.h" -#include "message.h" - -#include "hexdump.h" -//#include "sink_parser.h" -#include "max3421e.h" -#include "address.h" -//#include "avrpins.h" -#include "usb_ch9.h" -#include "usbhost.h" -#include "UsbCore.h" -#include "parsetools.h" -#include "confdescparser.h" - -#undef _usb_h_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h deleted file mode 100644 index 472fed59cf..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h +++ /dev/null @@ -1,312 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#ifndef _usb_h_ - #error "Never include UsbCore.h directly; include Usb.h instead" -#endif - -#pragma once - -// Not used anymore? If anyone uses this, please let us know so that this may be -// moved to the proper place, settings.h. -//#define USB_METHODS_INLINE - -/* shield pins. First parameter - SS pin, second parameter - INT pin */ - -#ifdef __MARLIN_FIRMWARE__ -typedef MAX3421e MAX3421E; // Marlin redefines this class in "../usb_host.h" -#elif defined(BOARD_BLACK_WIDDOW) -typedef MAX3421e MAX3421E; // Black Widow -#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) -#if EXT_RAM -typedef MAX3421e MAX3421E; // Teensy++ 2.0 with XMEM2 -#else -typedef MAX3421e MAX3421E; // Teensy++ 1.0 and 2.0 -#endif -#elif defined(BOARD_MEGA_ADK) -typedef MAX3421e MAX3421E; // Arduino Mega ADK -#elif defined(ARDUINO_AVR_BALANDUINO) -typedef MAX3421e MAX3421E; // Balanduino -#elif defined(__ARDUINO_X86__) && PLATFORM_ID == 0x06 -typedef MAX3421e MAX3421E; // The Intel Galileo supports much faster read and write speed at pin 2 and 3 -#elif defined(ESP8266) -typedef MAX3421e MAX3421E; // ESP8266 boards -#elif defined(ESP32) -typedef MAX3421e MAX3421E; // ESP32 boards -#else -typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.x -#endif - -/* Common setup data constant combinations */ -#define bmREQ_GET_DESCR USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //get descriptor request type -#define bmREQ_SET USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //set request type for all but 'set feature' and 'set interface' -#define bmREQ_CL_GET_INTF USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE //get interface request type - -// D7 data transfer direction (0 - host-to-device, 1 - device-to-host) -// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved) -// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved) - -// USB Device Classes -#define USB_CLASS_USE_CLASS_INFO 0x00 // Use Class Info in the Interface Descriptors -#define USB_CLASS_AUDIO 0x01 // Audio -#define USB_CLASS_COM_AND_CDC_CTRL 0x02 // Communications and CDC Control -#define USB_CLASS_HID 0x03 // HID -#define USB_CLASS_PHYSICAL 0x05 // Physical -#define USB_CLASS_IMAGE 0x06 // Image -#define USB_CLASS_PRINTER 0x07 // Printer -#define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage -#define USB_CLASS_HUB 0x09 // Hub -#define USB_CLASS_CDC_DATA 0x0a // CDC-Data -#define USB_CLASS_SMART_CARD 0x0b // Smart-Card -#define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security -#define USB_CLASS_VIDEO 0x0e // Video -#define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare -#define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device -#define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller -#define USB_CLASS_MISC 0xef // Miscellaneous -#define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific -#define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific - -// Additional Error Codes -#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1 -#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2 -#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3 -#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4 -#define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5 -#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6 -#define USB_ERROR_EPINFO_IS_NULL 0xD7 -#define USB_ERROR_INVALID_ARGUMENT 0xD8 -#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9 -#define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA -#define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB -#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET 0xE0 -#define USB_ERROR_FailGetDevDescr 0xE1 -#define USB_ERROR_FailSetDevTblEntry 0xE2 -#define USB_ERROR_FailGetConfDescr 0xE3 -#define USB_ERROR_TRANSFER_TIMEOUT 0xFF - -#define USB_XFER_TIMEOUT 5000 // (5000) USB transfer timeout in milliseconds, per section 9.2.6.1 of USB 2.0 spec -//#define USB_NAK_LIMIT 32000 // NAK limit for a transfer. 0 means NAKs are not counted -#define USB_RETRY_LIMIT 3 // 3 retry limit for a transfer -#define USB_SETTLE_DELAY 200 // settle delay in milliseconds - -#define USB_NUMDEVICES 16 //number of USB devices -//#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller -#define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms - -/* USB state machine states */ -#define USB_STATE_MASK 0xf0 - -#define USB_STATE_DETACHED 0x10 -#define USB_DETACHED_SUBSTATE_INITIALIZE 0x11 -#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE 0x12 -#define USB_DETACHED_SUBSTATE_ILLEGAL 0x13 -#define USB_ATTACHED_SUBSTATE_SETTLE 0x20 -#define USB_ATTACHED_SUBSTATE_RESET_DEVICE 0x30 -#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE 0x40 -#define USB_ATTACHED_SUBSTATE_WAIT_SOF 0x50 -#define USB_ATTACHED_SUBSTATE_WAIT_RESET 0x51 -#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE 0x60 -#define USB_STATE_ADDRESSING 0x70 -#define USB_STATE_CONFIGURING 0x80 -#define USB_STATE_RUNNING 0x90 -#define USB_STATE_ERROR 0xa0 - -class USBDeviceConfig { -public: - - virtual uint8_t Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused))) { - return 0; - } - - virtual uint8_t ConfigureDevice(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed __attribute__((unused))) { - return 0; - } - - virtual uint8_t Release() { - return 0; - } - - virtual uint8_t Poll() { - return 0; - } - - virtual uint8_t GetAddress() { - return 0; - } - - virtual void ResetHubPort(uint8_t port __attribute__((unused))) { - return; - } // Note used for hubs only! - - virtual bool VIDPIDOK(uint16_t vid __attribute__((unused)), uint16_t pid __attribute__((unused))) { - return false; - } - - virtual bool DEVCLASSOK(uint8_t klass __attribute__((unused))) { - return false; - } - - virtual bool DEVSUBCLASSOK(uint8_t subklass __attribute__((unused))) { - return true; - } - -}; - -/* USB Setup Packet Structure */ -typedef struct { - - union { // offset description - uint8_t bmRequestType; // 0 Bit-map of request type - - struct { - uint8_t recipient : 5; // Recipient of the request - uint8_t type : 2; // Type of request - uint8_t direction : 1; // Direction of data X-fer - } __attribute__((packed)); - } ReqType_u; - uint8_t bRequest; // 1 Request - - union { - uint16_t wValue; // 2 Depends on bRequest - - struct { - uint8_t wValueLo; - uint8_t wValueHi; - } __attribute__((packed)); - } wVal_u; - uint16_t wIndex; // 4 Depends on bRequest - uint16_t wLength; // 6 Depends on bRequest -} __attribute__((packed)) SETUP_PKT, *PSETUP_PKT; - - - -// Base class for incoming data parser - -class USBReadParser { -public: - virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) = 0; -}; - -class USB : public MAX3421E { - AddressPoolImpl addrPool; - USBDeviceConfig* devConfig[USB_NUMDEVICES]; - uint8_t bmHubPre; - -public: - USB(); - - void SetHubPreMask() { - bmHubPre |= bmHUBPRE; - }; - - void ResetHubPreMask() { - bmHubPre &= (~bmHUBPRE); - }; - - AddressPool& GetAddressPool() { - return (AddressPool&)addrPool; - }; - - uint8_t RegisterDeviceClass(USBDeviceConfig *pdev) { - for (uint8_t i = 0; i < USB_NUMDEVICES; i++) { - if (!devConfig[i]) { - devConfig[i] = pdev; - return 0; - } - } - return USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS; - }; - - void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { - addrPool.ForEachUsbDevice(pfunc); - }; - uint8_t getUsbTaskState(); - void setUsbTaskState(uint8_t state); - - EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep); - uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr); - - /* Control requests */ - uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr); - uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr); - - uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p); - - uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr); - uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr); - uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value); - /**/ - uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, bool direction); - uint8_t ctrlStatus(uint8_t ep, bool direction, uint16_t nak_limit); - uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval = 0); - 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(); - - uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed); - uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed); - uint8_t ReleaseDevice(uint8_t addr); - - uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, - uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p); - -private: - void init(); - uint8_t SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_limit); - uint8_t OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data); - uint8_t InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval = 0); - uint8_t AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lowspeed); -}; - -#if 0 //defined(USB_METHODS_INLINE) -//get device descriptor - -inline uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) { - return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, dataptr)); -} -//get configuration descriptor - -inline uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { - return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, dataptr)); -} -//get string descriptor - -inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr) { - return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, nuint8_ts, dataptr)); -} -//set address - -inline uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) { - return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, nullptr)); -} -//set configuration - -inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) { - return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, nullptr)); -} - -#endif // defined(USB_METHODS_INLINE) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h deleted file mode 100644 index f51e43f0ea..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h +++ /dev/null @@ -1,271 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include address.h directly; include Usb.h instead" -#endif - -/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ -/* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */ -#define USB_NAK_MAX_POWER 15 //NAK binary order maximum value -#define USB_NAK_DEFAULT 14 //default 32K-1 NAKs before giving up -#define USB_NAK_NOWAIT 1 //Single NAK stops transfer -#define USB_NAK_NONAK 0 //Do not count NAKs, stop retrying after USB Timeout - -struct EpInfo { - uint8_t epAddr; // Endpoint address - uint8_t maxPktSize; // Maximum packet size - - union { - uint8_t epAttribs; - - struct { - uint8_t bmSndToggle : 1; // Send toggle, when zero bmSNDTOG0, bmSNDTOG1 otherwise - uint8_t bmRcvToggle : 1; // Send toggle, when zero bmRCVTOG0, bmRCVTOG1 otherwise - uint8_t bmNakPower : 6; // Binary order for NAK_LIMIT value - } __attribute__((packed)); - }; -} __attribute__((packed)); - -// 7 6 5 4 3 2 1 0 -// --------------------------------- -// | | H | P | P | P | A | A | A | -// --------------------------------- -// -// H - if 1 the address is a hub address -// P - parent hub address -// A - device address / port number in case of hub -// - -struct UsbDeviceAddress { - union { - struct { - uint8_t bmAddress : 3; // device address/port number - uint8_t bmParent : 3; // parent hub address - uint8_t bmHub : 1; // hub flag - uint8_t bmReserved : 1; // reserved, must be zero - } __attribute__((packed)); - uint8_t devAddress; - }; -} __attribute__((packed)); - -#define bmUSB_DEV_ADDR_ADDRESS 0x07 -#define bmUSB_DEV_ADDR_PARENT 0x38 -#define bmUSB_DEV_ADDR_HUB 0x40 - -struct UsbDevice { - EpInfo *epinfo; // endpoint info pointer - UsbDeviceAddress address; - uint8_t epcount; // number of endpoints - bool lowspeed; // indicates if a device is the low speed one - // uint8_t devclass; // device class -} __attribute__((packed)); - -class AddressPool { - public: - virtual UsbDevice* GetUsbDevicePtr(uint8_t addr) = 0; - virtual uint8_t AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 0) = 0; - virtual void FreeAddress(uint8_t addr) = 0; -}; - -typedef void (*UsbDeviceHandleFunc)(UsbDevice *pdev); - -#define ADDR_ERROR_INVALID_INDEX 0xFF -#define ADDR_ERROR_INVALID_ADDRESS 0xFF - -template -class AddressPoolImpl : public AddressPool { - EpInfo dev0ep; //Endpoint data structure used during enumeration for uninitialized device - - uint8_t hubCounter; // hub counter is kept - // in order to avoid hub address duplication - - UsbDevice thePool[MAX_DEVICES_ALLOWED]; - - // Initialize address pool entry - - void InitEntry(uint8_t index) { - thePool[index].address.devAddress = 0; - thePool[index].epcount = 1; - thePool[index].lowspeed = 0; - thePool[index].epinfo = &dev0ep; - } - - // Return thePool index for a given address - - uint8_t FindAddressIndex(uint8_t address = 0) { - for (uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++) - if (thePool[i].address.devAddress == address) - return i; - - return 0; - } - - // Return thePool child index for a given parent - - uint8_t FindChildIndex(UsbDeviceAddress addr, uint8_t start = 1) { - for (uint8_t i = (start < 1 || start >= MAX_DEVICES_ALLOWED) ? 1 : start; i < MAX_DEVICES_ALLOWED; i++) { - if (thePool[i].address.bmParent == addr.bmAddress) - return i; - } - return 0; - } - - // Frees address entry specified by index parameter - - void FreeAddressByIndex(uint8_t index) { - // Zero field is reserved and should not be affected - if (index == 0) return; - - UsbDeviceAddress uda = thePool[index].address; - // If a hub was switched off all port addresses should be freed - if (uda.bmHub == 1) { - for (uint8_t i = 1; (i = FindChildIndex(uda, i));) - FreeAddressByIndex(i); - - // If the hub had the last allocated address, hubCounter should be decremented - if (hubCounter == uda.bmAddress) hubCounter--; - } - InitEntry(index); - } - - // Initialize the whole address pool at once - - void InitAllAddresses() { - for (uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++) - InitEntry(i); - - hubCounter = 0; - } - -public: - - AddressPoolImpl() : hubCounter(0) { - // Zero address is reserved - InitEntry(0); - - thePool[0].address.devAddress = 0; - thePool[0].epinfo = &dev0ep; - dev0ep.epAddr = 0; - dev0ep.maxPktSize = 8; - dev0ep.bmSndToggle = 0; // Set DATA0/1 toggles to 0 - dev0ep.bmRcvToggle = 0; - dev0ep.bmNakPower = USB_NAK_MAX_POWER; - - InitAllAddresses(); - } - - // Return a pointer to a specified address entry - - virtual UsbDevice* GetUsbDevicePtr(uint8_t addr) { - if (!addr) return thePool; - uint8_t index = FindAddressIndex(addr); - return index ? thePool + index : nullptr; - } - - // Perform an operation specified by pfunc for each addressed device - - void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { - if (pfunc) { - for (uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++) - if (thePool[i].address.devAddress) - pfunc(thePool + i); - } - } - - // Allocate new address - - virtual uint8_t AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 0) { - /* if (parent != 0 && port == 0) - USB_HOST_SERIAL.println("PRT:0"); */ - UsbDeviceAddress _parent; - _parent.devAddress = parent; - if (_parent.bmReserved || port > 7) - //if(parent > 127 || port > 7) - return 0; - - if (is_hub && hubCounter == 7) return 0; - - // finds first empty address entry starting from one - uint8_t index = FindAddressIndex(0); - - if (!index) return 0; // if empty entry is not found - - if (_parent.devAddress == 0) { - if (is_hub) { - thePool[index].address.devAddress = 0x41; - hubCounter++; - } - else - thePool[index].address.devAddress = 1; - - return thePool[index].address.devAddress; - } - - UsbDeviceAddress addr; - addr.devAddress = 0; // Ensure all bits are zero - addr.bmParent = _parent.bmAddress; - if (is_hub) { - addr.bmHub = 1; - addr.bmAddress = ++hubCounter; - } - else { - addr.bmHub = 0; - addr.bmAddress = port; - } - thePool[index].address = addr; - /* - USB_HOST_SERIAL.print("Addr:"); - USB_HOST_SERIAL.print(addr.bmHub, HEX); - USB_HOST_SERIAL.print("."); - USB_HOST_SERIAL.print(addr.bmParent, HEX); - USB_HOST_SERIAL.print("."); - USB_HOST_SERIAL.println(addr.bmAddress, HEX); - */ - return thePool[index].address.devAddress; - } - - // Empty the pool entry - - virtual void FreeAddress(uint8_t addr) { - // if the root hub is disconnected all the addresses should be initialized - if (addr == 0x41) { - InitAllAddresses(); - return; - } - FreeAddressByIndex(FindAddressIndex(addr)); - } - - // Return number of hubs attached - // It can be helpful to find out if hubs are attached when getting the exact number of hubs. - //uint8_t GetNumHubs() { return hubCounter; } - //uint8_t GetNumDevices() { - // uint8_t counter = 0; - // for (uint8_t i = 1; i < MAX_DEVICES_ALLOWED; i++) - // if (thePool[i].address != 0); counter++; - // return counter; - //} -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h deleted file mode 100644 index 5d4ddaf175..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h +++ /dev/null @@ -1,201 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include confdescparser.h directly; include Usb.h instead" -#endif - -class UsbConfigXtracter { -public: - //virtual void ConfigXtract(const USB_CONFIGURATION_DESCRIPTOR *conf) = 0; - //virtual void InterfaceXtract(uint8_t conf, const USB_INTERFACE_DESCRIPTOR *iface) = 0; - - virtual void EndpointXtract(uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) { - } -}; - -#define CP_MASK_COMPARE_CLASS 1 -#define CP_MASK_COMPARE_SUBCLASS 2 -#define CP_MASK_COMPARE_PROTOCOL 4 -#define CP_MASK_COMPARE_ALL 7 - -// Configuration Descriptor Parser Class Template - -template -class ConfigDescParser : public USBReadParser { - UsbConfigXtracter *theXtractor; - MultiValueBuffer theBuffer; - MultiByteValueParser valParser; - ByteSkipper theSkipper; - uint8_t varBuffer[16 /*sizeof(USB_CONFIGURATION_DESCRIPTOR)*/]; - - uint8_t stateParseDescr; // ParseDescriptor state - - uint8_t dscrLen; // Descriptor length - uint8_t dscrType; // Descriptor type - - bool isGoodInterface; // Apropriate interface flag - uint8_t confValue; // Configuration value - uint8_t protoValue; // Protocol value - uint8_t ifaceNumber; // Interface number - uint8_t ifaceAltSet; // Interface alternate settings - - bool UseOr; - bool ParseDescriptor(uint8_t **pp, uint16_t *pcntdn); - void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc); - -public: - - void SetOR() { UseOr = true; } - ConfigDescParser(UsbConfigXtracter *xtractor); - void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset); -}; - -template -ConfigDescParser::ConfigDescParser(UsbConfigXtracter *xtractor) : - theXtractor(xtractor), - stateParseDescr(0), - dscrLen(0), - dscrType(0), - UseOr(false) { - theBuffer.pValue = varBuffer; - valParser.Initialize(&theBuffer); - theSkipper.Initialize(&theBuffer); - }; - -template -void ConfigDescParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset __attribute__((unused))) { - uint16_t cntdn = (uint16_t)len; - uint8_t *p = (uint8_t*)pbuf; - while (cntdn) if (!ParseDescriptor(&p, &cntdn)) return; -} - -/* Parser for the configuration descriptor. Takes values for class, subclass, protocol fields in interface descriptor and - compare masks for them. When the match is found, calls EndpointXtract passing buffer containing endpoint descriptor */ -template -bool ConfigDescParser::ParseDescriptor(uint8_t **pp, uint16_t *pcntdn) { - USB_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast(varBuffer); - USB_INTERFACE_DESCRIPTOR* uid = reinterpret_cast(varBuffer); - switch (stateParseDescr) { - case 0: - theBuffer.valueSize = 2; - valParser.Initialize(&theBuffer); - stateParseDescr = 1; - case 1: - if (!valParser.Parse(pp, pcntdn)) return false; - dscrLen = *((uint8_t*)theBuffer.pValue); - dscrType = *((uint8_t*)theBuffer.pValue + 1); - stateParseDescr = 2; - case 2: - // This is a sort of hack. Assuming that two bytes are all ready in the buffer - // the pointer is positioned two bytes ahead in order for the rest of descriptor - // to be read right after the size and the type fields. - // This should be used carefully. varBuffer should be used directly to handle data - // in the buffer. - theBuffer.pValue = varBuffer + 2; - stateParseDescr = 3; - case 3: - switch (dscrType) { - case USB_DESCRIPTOR_INTERFACE: - isGoodInterface = false; - break; - case USB_DESCRIPTOR_CONFIGURATION: - case USB_DESCRIPTOR_ENDPOINT: - case HID_DESCRIPTOR_HID: - break; - } - theBuffer.valueSize = dscrLen - 2; - valParser.Initialize(&theBuffer); - stateParseDescr = 4; - case 4: - switch (dscrType) { - case USB_DESCRIPTOR_CONFIGURATION: - if (!valParser.Parse(pp, pcntdn)) return false; - confValue = ucd->bConfigurationValue; - break; - case USB_DESCRIPTOR_INTERFACE: - if (!valParser.Parse(pp, pcntdn)) return false; - if ((MASK & CP_MASK_COMPARE_CLASS) && uid->bInterfaceClass != CLASS_ID) - break; - if ((MASK & CP_MASK_COMPARE_SUBCLASS) && uid->bInterfaceSubClass != SUBCLASS_ID) - break; - if (UseOr) { - if ((!((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol))) break; - } - else if ((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol != PROTOCOL_ID) - break; - isGoodInterface = true; - ifaceNumber = uid->bInterfaceNumber; - ifaceAltSet = uid->bAlternateSetting; - protoValue = uid->bInterfaceProtocol; - break; - case USB_DESCRIPTOR_ENDPOINT: - if (!valParser.Parse(pp, pcntdn)) return false; - if (isGoodInterface && theXtractor) - theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_ENDPOINT_DESCRIPTOR*)varBuffer); - break; - //case HID_DESCRIPTOR_HID: - // if (!valParser.Parse(pp, pcntdn)) return false; - // PrintHidDescriptor((const USB_HID_DESCRIPTOR*)varBuffer); - // break; - default: - if (!theSkipper.Skip(pp, pcntdn, dscrLen - 2)) return false; - } - theBuffer.pValue = varBuffer; - stateParseDescr = 0; - } - return true; -} - -template -void ConfigDescParser::PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc) { - Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80); - Notify(PSTR("bDescLength:\t\t"), 0x80); - PrintHex (pDesc->bLength, 0x80); - - Notify(PSTR("\r\nbDescriptorType:\t"), 0x80); - PrintHex (pDesc->bDescriptorType, 0x80); - - Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80); - PrintHex (pDesc->bcdHID, 0x80); - - Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80); - PrintHex (pDesc->bCountryCode, 0x80); - - Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80); - PrintHex (pDesc->bNumDescriptors, 0x80); - - for (uint8_t i = 0; i < pDesc->bNumDescriptors; i++) { - HID_CLASS_DESCRIPTOR_LEN_AND_TYPE *pLT = (HID_CLASS_DESCRIPTOR_LEN_AND_TYPE*)&(pDesc->bDescrType); - - Notify(PSTR("\r\nbDescrType:\t\t"), 0x80); - PrintHex (pLT[i].bDescrType, 0x80); - - Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80); - PrintHex (pLT[i].wDescriptorLength, 0x80); - } - Notify(PSTR("\r\n"), 0x80); -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h deleted file mode 100644 index 59c3b48f67..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include hexdump.h directly; include Usb.h instead" -#endif - -extern int UsbDEBUGlvl; - -template -class HexDumper : public BASE_CLASS { - uint8_t byteCount; - OFFSET_TYPE byteTotal; - -public: - - HexDumper() : byteCount(0), byteTotal(0) { - }; - - void Initialize() { - byteCount = 0; - byteTotal = 0; - }; - - void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset); -}; - -template -void HexDumper::Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset __attribute__((unused))) { - if (UsbDEBUGlvl >= 0x80) { // Fully bypass this block of code if we do not debug. - for (LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) { - if (!byteCount) { - PrintHex (byteTotal, 0x80); - E_Notify(PSTR(": "), 0x80); - } - PrintHex (pbuf[j], 0x80); - E_Notify(PSTR(" "), 0x80); - - if (byteCount == 15) { - E_Notify(PSTR("\r\n"), 0x80); - byteCount = 0xFF; - } - } - } -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h deleted file mode 100644 index 0fb5c02ff1..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include macros.h directly; include Usb.h instead" -#endif - -//////////////////////////////////////////////////////////////////////////////// -// HANDY MACROS -//////////////////////////////////////////////////////////////////////////////// - -#define VALUE_BETWEEN(v,l,h) (((v)>(l)) && ((v)<(h))) -#define VALUE_WITHIN(v,l,h) (((v)>=(l)) && ((v)<=(h))) -#define output_pgm_message(wa,fp,mp,el) wa = &mp, fp((char *)pgm_read_pointer(wa), el) -#define output_if_between(v,l,h,wa,fp,mp,el) if (VALUE_BETWEEN(v,l,h)) output_pgm_message(wa,fp,mp[v-(l+1)],el); - -#define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) -#ifndef __BYTE_GRABBING_DEFINED__ -#define __BYTE_GRABBING_DEFINED__ 1 -#ifdef BROKEN_OPTIMIZER_LITTLE_ENDIAN -// Note: Use this if your compiler generates horrible assembler! -#define BGRAB0(__usi__) (((uint8_t *)&(__usi__))[0]) -#define BGRAB1(__usi__) (((uint8_t *)&(__usi__))[1]) -#define BGRAB2(__usi__) (((uint8_t *)&(__usi__))[2]) -#define BGRAB3(__usi__) (((uint8_t *)&(__usi__))[3]) -#define BGRAB4(__usi__) (((uint8_t *)&(__usi__))[4]) -#define BGRAB5(__usi__) (((uint8_t *)&(__usi__))[5]) -#define BGRAB6(__usi__) (((uint8_t *)&(__usi__))[6]) -#define BGRAB7(__usi__) (((uint8_t *)&(__usi__))[7]) -#else -// Note: The cast alone to uint8_t is actually enough. -// GCC throws out the "& 0xff", and the size is no different. -// Some compilers need it. -#define BGRAB0(__usi__) ((uint8_t)((__usi__) & 0xff )) -#define BGRAB1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xff)) -#define BGRAB2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xff)) -#define BGRAB3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xff)) -#define BGRAB4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xff)) -#define BGRAB5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xff)) -#define BGRAB6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xff)) -#define BGRAB7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xff)) -#endif -#define BOVER1(__usi__) ((uint16_t)(__usi__) << 8) -#define BOVER2(__usi__) ((uint32_t)(__usi__) << 16) -#define BOVER3(__usi__) ((uint32_t)(__usi__) << 24) -#define BOVER4(__usi__) ((uint64_t)(__usi__) << 32) -#define BOVER5(__usi__) ((uint64_t)(__usi__) << 40) -#define BOVER6(__usi__) ((uint64_t)(__usi__) << 48) -#define BOVER7(__usi__) ((uint64_t)(__usi__) << 56) - -// These are the smallest and fastest ways I have found so far in pure C/C++. -#define BMAKE16(__usc1__,__usc0__) ((uint16_t)((uint16_t)(__usc0__) | (uint16_t)BOVER1(__usc1__))) -#define BMAKE32(__usc3__,__usc2__,__usc1__,__usc0__) ((uint32_t)((uint32_t)(__usc0__) | (uint32_t)BOVER1(__usc1__) | (uint32_t)BOVER2(__usc2__) | (uint32_t)BOVER3(__usc3__))) -#define BMAKE64(__usc7__,__usc6__,__usc5__,__usc4__,__usc3__,__usc2__,__usc1__,__usc0__) ((uint64_t)((uint64_t)__usc0__ | (uint64_t)BOVER1(__usc1__) | (uint64_t)BOVER2(__usc2__) | (uint64_t)BOVER3(__usc3__) | (uint64_t)BOVER4(__usc4__) | (uint64_t)BOVER5(__usc5__) | (uint64_t)BOVER6(__usc6__) | (uint64_t)BOVER1(__usc7__))) -#endif - -/* - * Debug macros: Strings are stored in progmem (flash) instead of RAM. - */ -#define USBTRACE(s) (Notify(PSTR(s), 0x80)) -#define USBTRACE1(s,l) (Notify(PSTR(s), l)) -#define USBTRACE2(s,r) (Notify(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR("\r\n"), 0x80)) -#define USBTRACE3(s,r,l) (Notify(PSTR(s), l), D_PrintHex((r), l), Notify(PSTR("\r\n"), l)) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp deleted file mode 100644 index a57245f78a..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp +++ /dev/null @@ -1,1219 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) - -#include "masstorage.h" - -const uint8_t BulkOnly::epDataInIndex = 1; -const uint8_t BulkOnly::epDataOutIndex = 2; -const uint8_t BulkOnly::epInterruptInIndex = 3; - -//////////////////////////////////////////////////////////////////////////////// -// Interface code -//////////////////////////////////////////////////////////////////////////////// - -/** - * Get the capacity of the media - * - * @param lun Logical Unit Number - * @return media capacity - */ -uint32_t BulkOnly::GetCapacity(uint8_t lun) { - return LUNOk[lun] ? CurrentCapacity[lun] : 0UL; -} - -/** - * Get the sector (block) size used on the media - * - * @param lun Logical Unit Number - * @return media sector size - */ -uint16_t BulkOnly::GetSectorSize(uint8_t lun) { - return LUNOk[lun] ? CurrentSectorSize[lun] : 0U; -} - -/** - * Test if LUN is ready for use - * - * @param lun Logical Unit Number - * @return true if LUN is ready for use - */ -bool BulkOnly::LUNIsGood(uint8_t lun) { return LUNOk[lun]; } - -/** - * Test if LUN is write protected - * - * @param lun Logical Unit Number - * @return cached status of write protect switch - */ -bool BulkOnly::WriteProtected(uint8_t lun) { return WriteOk[lun]; } - -/** - * Wrap and execute a SCSI CDB with length of 6 - * - * @param cdb CDB to execute - * @param buf_size Size of expected transaction - * @param buf Buffer - * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT - * @return - */ -uint8_t BulkOnly::SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { - // promote buf_size to 32bits. - CommandBlockWrapper cbw = CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); - //SetCurLUN(cdb->LUN); - return (HandleSCSIError(Transaction(&cbw, buf_size, buf))); -} - -/** - * Wrap and execute a SCSI CDB with length of 10 - * - * @param cdb CDB to execute - * @param buf_size Size of expected transaction - * @param buf Buffer - * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT - * @return - */ -uint8_t BulkOnly::SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { - // promote buf_size to 32bits. - CommandBlockWrapper cbw = CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); - //SetCurLUN(cdb->LUN); - return (HandleSCSIError(Transaction(&cbw, buf_size, buf))); -} - -/** - * Lock or Unlock the tray or door on device. - * Caution: Some devices with buggy firmware will lock up. - * - * @param lun Logical Unit Number - * @param lock 1 to lock, 0 to unlock - * @return - */ -uint8_t BulkOnly::LockMedia(uint8_t lun, uint8_t lock) { - Notify(PSTR("\r\nLockMedia\r\n"), 0x80); - Notify(PSTR("---------\r\n"), 0x80); - - CDB6_t cdb = CDB6_t(SCSI_CMD_PREVENT_REMOVAL, lun, (uint8_t)0, lock); - return SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_IN); -} - -/** - * Media control, for spindle motor and media tray or door. - * This includes CDROM, TAPE and anything with a media loader. - * - * @param lun Logical Unit Number - * @param ctl 0x00 Stop Motor, 0x01 Start Motor, 0x02 Eject Media, 0x03 Load Media - * @return 0 on success - */ -uint8_t BulkOnly::MediaCTL(uint8_t lun, uint8_t ctl) { - Notify(PSTR("\r\nMediaCTL\r\n"), 0x80); - Notify(PSTR("-----------------\r\n"), 0x80); - - uint8_t rcode = MASS_ERR_UNIT_NOT_READY; - if (bAddress) { - CDB6_t cdb = CDB6_t(SCSI_CMD_START_STOP_UNIT, lun, ctl & 0x03, 0); - rcode = SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_OUT); - } - else - SetCurLUN(lun); - - return rcode; -} - -/** - * Read data from media - * - * @param lun Logical Unit Number - * @param addr LBA address on media to read - * @param bsize size of a block (we should probably use the cached size) - * @param blocks how many blocks to read - * @param buf memory that is able to hold the requested data - * @return 0 on success - */ -uint8_t BulkOnly::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) { - if (!LUNOk[lun]) return MASS_ERR_NO_MEDIA; - Notify(PSTR("\r\nRead LUN:\t"), 0x80); - D_PrintHex (lun, 0x90); - Notify(PSTR("\r\nLBA:\t\t"), 0x90); - D_PrintHex (addr, 0x90); - Notify(PSTR("\r\nblocks:\t\t"), 0x90); - D_PrintHex (blocks, 0x90); - Notify(PSTR("\r\nblock size:\t"), 0x90); - D_PrintHex (bsize, 0x90); - Notify(PSTR("\r\n---------\r\n"), 0x80); - CDB10_t cdb = CDB10_t(SCSI_CMD_READ_10, lun, blocks, addr); - -again: - uint8_t er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), buf, (uint8_t)MASS_CMD_DIR_IN); - - if (er == MASS_ERR_STALL) { - MediaCTL(lun, 1); - delay(150); - if (!TestUnitReady(lun)) goto again; - } - return er; -} - -/** - * Write data to media - * - * @param lun Logical Unit Number - * @param addr LBA address on media to write - * @param bsize size of a block (we should probably use the cached size) - * @param blocks how many blocks to write - * @param buf memory that contains the data to write - * @return 0 on success - */ -uint8_t BulkOnly::Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t * buf) { - if (!LUNOk[lun]) return MASS_ERR_NO_MEDIA; - if (!WriteOk[lun]) return MASS_ERR_WRITE_PROTECTED; - Notify(PSTR("\r\nWrite LUN:\t"), 0x80); - D_PrintHex (lun, 0x90); - Notify(PSTR("\r\nLBA:\t\t"), 0x90); - D_PrintHex (addr, 0x90); - Notify(PSTR("\r\nblocks:\t\t"), 0x90); - D_PrintHex (blocks, 0x90); - Notify(PSTR("\r\nblock size:\t"), 0x90); - D_PrintHex (bsize, 0x90); - Notify(PSTR("\r\n---------\r\n"), 0x80); - CDB10_t cdb = CDB10_t(SCSI_CMD_WRITE_10, lun, blocks, addr); - -again: - uint8_t er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), (void*)buf, (uint8_t)MASS_CMD_DIR_OUT); - - if (er == MASS_ERR_WRITE_STALL) { - MediaCTL(lun, 1); - delay(150); - if (!TestUnitReady(lun)) goto again; - } - return er; -} - -// End of user functions, the remaining code below is driver internals. -// Only developer serviceable parts below! - -//////////////////////////////////////////////////////////////////////////////// -// Main driver code -//////////////////////////////////////////////////////////////////////////////// - -BulkOnly::BulkOnly(USB *p) : -pUsb(p), -bAddress(0), -bIface(0), -bNumEP(1), -qNextPollTime(0), -bPollEnable(false), -//dCBWTag(0), -bLastUsbError(0) { - ClearAllEP(); - dCBWTag = 0; - if (pUsb) pUsb->RegisterDeviceClass(this); -} - -/** - * USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET == success - * We need to standardize either the rcode, or change the API to return values - * so a signal that additional actions are required can be produced. - * Some of these codes do exist already. - * - * TECHNICAL: We could do most of this code elsewhere, with the exception of checking the class instance. - * Doing so would save some program memory when using multiple drivers. - * - * @param parent USB address of parent - * @param port address of port on parent - * @param lowspeed true if device is low speed - * @return - */ -uint8_t BulkOnly::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) { - - const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR); - - uint8_t buf[constBufSize]; - USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast(buf); - uint8_t rcode; - UsbDevice *p = nullptr; - EpInfo *oldep_ptr = nullptr; - USBTRACE("MS ConfigureDevice\r\n"); - ClearAllEP(); - AddressPool &addrPool = pUsb->GetAddressPool(); - - if (bAddress) return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE; - - // - // Get pointer to pseudo device with address 0 assigned - p = addrPool.GetUsbDevicePtr(0); - if (!p) return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - if (!p->epinfo) { - USBTRACE("epinfo\r\n"); - return USB_ERROR_EPINFO_IS_NULL; - } - - // Save old pointer to EP_RECORD of address 0 - oldep_ptr = p->epinfo; - - // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence - p->epinfo = epInfo; - - p->lowspeed = lowspeed; - // Get device descriptor - rcode = pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf); - - // Restore p->epinfo - p->epinfo = oldep_ptr; - - if (rcode) goto FailGetDevDescr; - - // Allocate new address according to device class - bAddress = addrPool.AllocAddress(parent, false, port); - - if (!bAddress) return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL; - - // Extract Max Packet Size from the device descriptor - epInfo[0].maxPktSize = udd->bMaxPacketSize0; - // Steal and abuse from epInfo structure to save on memory. - epInfo[1].epAddr = udd->bNumConfigurations; - // - return USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET; - -FailGetDevDescr: - - #ifdef DEBUG_USB_HOST - NotifyFailGetDevDescr(rcode); - #endif - rcode = USB_ERROR_FailGetDevDescr; - - Release(); - return rcode; -} - -/** - * @param parent (not used) - * @param port (not used) - * @param lowspeed true if device is low speed - * @return 0 for success - */ -uint8_t BulkOnly::Init(uint8_t parent __attribute__((unused)), uint8_t port __attribute__((unused)), bool lowspeed) { - uint8_t rcode; - uint8_t num_of_conf = epInfo[1].epAddr; // number of configurations - epInfo[1].epAddr = 0; - USBTRACE("MS Init\r\n"); - - AddressPool &addrPool = pUsb->GetAddressPool(); - UsbDevice *p = addrPool.GetUsbDevicePtr(bAddress); - - if (!p) return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - // Assign new address to the device - delay(2000); - rcode = pUsb->setAddr(0, 0, bAddress); - - if (rcode) { - p->lowspeed = false; - addrPool.FreeAddress(bAddress); - bAddress = 0; - USBTRACE2("setAddr:", rcode); - return rcode; - } - - USBTRACE2("Addr:", bAddress); - - p->lowspeed = false; - - p = addrPool.GetUsbDevicePtr(bAddress); - - if (!p) return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - p->lowspeed = lowspeed; - - // Assign epInfo to epinfo pointer - rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo); - - if (rcode) goto FailSetDevTblEntry; - - USBTRACE2("NC:", num_of_conf); - - for (uint8_t i = 0; i < num_of_conf; i++) { - ConfigDescParser< USB_CLASS_MASS_STORAGE, - MASS_SUBCLASS_SCSI, - MASS_PROTO_BBB, - CP_MASK_COMPARE_CLASS | - CP_MASK_COMPARE_SUBCLASS | - CP_MASK_COMPARE_PROTOCOL > BulkOnlyParser(this); - - rcode = pUsb->getConfDescr(bAddress, 0, i, &BulkOnlyParser); - - if (rcode) goto FailGetConfDescr; - - if (bNumEP > 1) break; - } - - if (bNumEP < 3) return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED; - - // Assign epInfo to epinfo pointer - pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo); - - USBTRACE2("Conf:", bConfNum); - - // Set Configuration Value - rcode = pUsb->setConf(bAddress, 0, bConfNum); - - if (rcode) goto FailSetConfDescr; - - //Linux does a 1sec delay after this. - delay(1000); - - rcode = GetMaxLUN(&bMaxLUN); - if (rcode) goto FailGetMaxLUN; - - if (bMaxLUN >= MASS_MAX_SUPPORTED_LUN) bMaxLUN = MASS_MAX_SUPPORTED_LUN - 1; - ErrorMessage (PSTR("MaxLUN"), bMaxLUN); - - delay(1000); // Delay a bit for slow firmware. - - for (uint8_t lun = 0; lun <= bMaxLUN; lun++) { - InquiryResponse response; - rcode = Inquiry(lun, sizeof (InquiryResponse), (uint8_t*) & response); - if (rcode) { - ErrorMessage (PSTR("Inquiry"), rcode); - } - else { - #if 0 - printf("LUN %i `", lun); - uint8_t *buf = response.VendorID; - for (int i = 0; i < 28; i++) printf("%c", buf[i]); - printf("'\r\nQualifier %1.1X ", response.PeripheralQualifier); - printf("Device type %2.2X ", response.DeviceType); - printf("RMB %1.1X ", response.Removable); - printf("SSCS %1.1X ", response.SCCS); - uint8_t sv = response.Version; - printf("SCSI version %2.2X\r\nDevice conforms to ", sv); - switch (sv) { - case 0: - printf("No specific"); - break; - case 1: - printf("ANSI X3.131-1986 (ANSI 1)"); - break; - case 2: - printf("ANSI X3.131-1994 (ANSI 2)"); - break; - case 3: - printf("ANSI INCITS 301-1997 (SPC)"); - break; - case 4: - printf("ANSI INCITS 351-2001 (SPC-2)"); - break; - case 5: - printf("ANSI INCITS 408-2005 (SPC-4)"); - break; - case 6: - printf("T10/1731-D (SPC-4)"); - break; - default: printf("unknown"); - } - printf(" standards.\r\n"); - #endif - - uint8_t tries = 0xf0; - while ((rcode = TestUnitReady(lun))) { - if (rcode == 0x08) break; // break on no media, this is OK to do. - // try to lock media and spin up - if (tries < 14) { - LockMedia(lun, 1); - MediaCTL(lun, 1); // I actually have a USB stick that needs this! - } else - delay(2 * (tries + 1)); - tries++; - if (!tries) break; - } - if (!rcode) { - delay(1000); - LUNOk[lun] = CheckLUN(lun); - if (!LUNOk[lun]) LUNOk[lun] = CheckLUN(lun); - } - } - } - - CheckMedia(); - - rcode = OnInit(); - - if (rcode) goto FailOnInit; - - #ifdef DEBUG_USB_HOST - USBTRACE("MS configured\r\n\r\n"); - #endif - - bPollEnable = true; - - //USBTRACE("Poll enabled\r\n"); - return 0; - - FailSetConfDescr: - - #ifdef DEBUG_USB_HOST - NotifyFailSetConfDescr(); - goto Fail; - #endif - - FailOnInit: - - #ifdef DEBUG_USB_HOST - USBTRACE("OnInit:"); - goto Fail; - #endif - - FailGetMaxLUN: - - #ifdef DEBUG_USB_HOST - USBTRACE("GetMaxLUN:"); - goto Fail; - #endif - - //#ifdef DEBUG_USB_HOST - // FailInvalidSectorSize: - // USBTRACE("Sector Size is NOT VALID: "); - // goto Fail; - //#endif - - FailSetDevTblEntry: - #ifdef DEBUG_USB_HOST - NotifyFailSetDevTblEntry(); - goto Fail; - #endif - - FailGetConfDescr: - #ifdef DEBUG_USB_HOST - NotifyFailGetConfDescr(); - #endif - - #ifdef DEBUG_USB_HOST - Fail: - NotifyFail(rcode); - #endif - Release(); - return rcode; -} - -/** - * For driver use only. - * - * @param conf - * @param iface - * @param alt - * @param proto - * @param pep - */ -void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR * pep) { - ErrorMessage (PSTR("Conf.Val"), conf); - ErrorMessage (PSTR("Iface Num"), iface); - ErrorMessage (PSTR("Alt.Set"), alt); - - bConfNum = conf; - - uint8_t index; - - #if 1 - if ((pep->bmAttributes & bmUSB_TRANSFER_TYPE) == USB_TRANSFER_TYPE_BULK) { - index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex; - // Fill in the endpoint info structure - epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F); - epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize; - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - - bNumEP++; - - PrintEndpointDescriptor(pep); - } - #else - if ((pep->bmAttributes & bmUSB_TRANSFER_TYPE) == USB_TRANSFER_TYPE_INTERRUPT && (pep->bEndpointAddress & 0x80) == 0x80) - index = epInterruptInIndex; - else if ((pep->bmAttributes & bmUSB_TRANSFER_TYPE) == USB_TRANSFER_TYPE_BULK) - index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex; - else - return; - - // Fill in the endpoint info structure - epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F); - epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize; - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - - bNumEP++; - - PrintEndpointDescriptor(pep); - #endif -} - -/** - * For driver use only. - * - * @return - */ -uint8_t BulkOnly::Release() { - ClearAllEP(); - pUsb->GetAddressPool().FreeAddress(bAddress); - return 0; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return true if LUN is ready for use. - */ -bool BulkOnly::CheckLUN(uint8_t lun) { - uint8_t rcode; - Capacity capacity; - for (uint8_t i = 0; i < 8; i++) capacity.data[i] = 0; - - rcode = ReadCapacity10(lun, (uint8_t*)capacity.data); - if (rcode) { - //printf(">>>>>>>>>>>>>>>>ReadCapacity returned %i\r\n", rcode); - return false; - } - ErrorMessage (PSTR(">>>>>>>>>>>>>>>>CAPACITY OK ON LUN"), lun); - for (uint8_t i = 0; i < 8 /*sizeof (Capacity)*/; i++) - D_PrintHex (capacity.data[i], 0x80); - Notify(PSTR("\r\n\r\n"), 0x80); - - // Only 512/1024/2048/4096 are valid values! - uint32_t c = BMAKE32(capacity.data[4], capacity.data[5], capacity.data[6], capacity.data[7]); - if (c != 0x0200UL && c != 0x0400UL && c != 0x0800UL && c != 0x1000UL) return false; - - // Store capacity information. - CurrentSectorSize[lun] = (uint16_t)(c); // & 0xFFFF); - - CurrentCapacity[lun] = BMAKE32(capacity.data[0], capacity.data[1], capacity.data[2], capacity.data[3]) + 1; - if (CurrentCapacity[lun] == /*0xFFFFFFFFUL */ 0x01UL || CurrentCapacity[lun] == 0x00UL) { - // Buggy firmware will report 0xFFFFFFFF or 0 for no media - if (CurrentCapacity[lun]) - ErrorMessage (PSTR(">>>>>>>>>>>>>>>>BUGGY FIRMWARE. CAPACITY FAIL ON LUN"), lun); - return false; - } - delay(20); - Page3F(lun); - return !TestUnitReady(lun); -} - -/** - * For driver use only. - * - * Scan for media change on all LUNs - */ -void BulkOnly::CheckMedia() { - for (uint8_t lun = 0; lun <= bMaxLUN; lun++) { - if (TestUnitReady(lun)) { - LUNOk[lun] = false; - continue; - } - if (!LUNOk[lun]) LUNOk[lun] = CheckLUN(lun); - } - #if 0 - printf("}}}}}}}}}}}}}}}}STATUS "); - for (uint8_t lun = 0; lun <= bMaxLUN; lun++) - printf(LUNOk[lun] ? "#" : "."); - printf("\r\n"); - #endif - qNextPollTime = (uint32_t)millis() + 2000; -} - -/** - * For driver use only. - * - * @return - */ -uint8_t BulkOnly::Poll() { - //uint8_t rcode = 0; - if (!bPollEnable) return 0; - if ((int32_t)((uint32_t)millis() - qNextPollTime) >= 0L) CheckMedia(); - //rcode = 0; - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -// SCSI code -//////////////////////////////////////////////////////////////////////////////// - -/** - * For driver use only. - * - * @param plun - * @return - */ -uint8_t BulkOnly::GetMaxLUN(uint8_t *plun) { - uint8_t ret = pUsb->ctrlReq(bAddress, 0, bmREQ_MASSIN, MASS_REQ_GET_MAX_LUN, 0, 0, bIface, 1, 1, plun, nullptr); - - if (ret == hrSTALL) - *plun = 0; - - return 0; -} - -/** - * For driver use only. Used during Driver Init - * - * @param lun Logical Unit Number - * @param bsize - * @param buf - * @return - */ -uint8_t BulkOnly::Inquiry(uint8_t lun, uint16_t bsize, uint8_t *buf) { - Notify(PSTR("\r\nInquiry\r\n"), 0x80); - Notify(PSTR("---------\r\n"), 0x80); - - CDB6_t cdb = CDB6_t(SCSI_CMD_INQUIRY, lun, 0UL, (uint8_t)bsize, 0); - uint8_t rc = SCSITransaction6(&cdb, bsize, buf, (uint8_t)MASS_CMD_DIR_IN); - - return rc; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return - */ -uint8_t BulkOnly::TestUnitReady(uint8_t lun) { - //SetCurLUN(lun); - if (!bAddress) - return MASS_ERR_UNIT_NOT_READY; - - Notify(PSTR("\r\nTestUnitReady\r\n"), 0x80); - Notify(PSTR("-----------------\r\n"), 0x80); - - CDB6_t cdb = CDB6_t(SCSI_CMD_TEST_UNIT_READY, lun, (uint8_t)0, 0); - return SCSITransaction6(&cdb, 0, nullptr, (uint8_t)MASS_CMD_DIR_IN); - -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param pc - * @param page - * @param subpage - * @param len - * @param pbuf - * @return - */ -uint8_t BulkOnly::ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t * pbuf) { - Notify(PSTR("\r\rModeSense\r\n"), 0x80); - Notify(PSTR("------------\r\n"), 0x80); - - CDB6_t cdb = CDB6_t(SCSI_CMD_MODE_SENSE_6, lun, (uint32_t)((((pc << 6) | page) << 8) | subpage), len, 0); - return SCSITransaction6(&cdb, len, pbuf, (uint8_t)MASS_CMD_DIR_IN); -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param bsize - * @param buf - * @return - */ -uint8_t BulkOnly::ReadCapacity10(uint8_t lun, uint8_t *buf) { - Notify(PSTR("\r\nReadCapacity\r\n"), 0x80); - Notify(PSTR("---------------\r\n"), 0x80); - - CDB10_t cdb = CDB10_t(SCSI_CMD_READ_CAPACITY_10, lun); - return SCSITransaction10(&cdb, 8, buf, (uint8_t)MASS_CMD_DIR_IN); -} - -/** - * For driver use only. - * - * Page 3F contains write protect status. - * - * @param lun Logical Unit Number to test. - * @return Write protect switch status. - */ -uint8_t BulkOnly::Page3F(uint8_t lun) { - uint8_t buf[192]; - for (int i = 0; i < 192; i++) { - buf[i] = 0x00; - } - WriteOk[lun] = true; - #ifdef SKIP_WRITE_PROTECT - return 0; - #endif - uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); - if (!rc) { - WriteOk[lun] = ((buf[2] & 0x80) == 0); - Notify(PSTR("Mode Sense: "), 0x80); - for (int i = 0; i < 4; i++) { - D_PrintHex (buf[i], 0x80); - Notify(PSTR(" "), 0x80); - } - Notify(PSTR("\r\n"), 0x80); - } - return rc; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param size - * @param buf - * @return - */ -uint8_t BulkOnly::RequestSense(uint8_t lun, uint16_t size, uint8_t *buf) { - Notify(PSTR("\r\nRequestSense\r\n"), 0x80); - Notify(PSTR("----------------\r\n"), 0x80); - - CDB6_t cdb = CDB6_t(SCSI_CMD_REQUEST_SENSE, lun, 0UL, (uint8_t)size, 0); - CommandBlockWrapper cbw = CommandBlockWrapper(++dCBWTag, (uint32_t)size, &cdb, (uint8_t)MASS_CMD_DIR_IN); - //SetCurLUN(lun); - return Transaction(&cbw, size, buf); -} - - -//////////////////////////////////////////////////////////////////////////////// -// USB code -//////////////////////////////////////////////////////////////////////////////// - -/** - * For driver use only. - * - * @param index - * @return - */ -uint8_t BulkOnly::ClearEpHalt(uint8_t index) { - if (index == 0) - return 0; - - uint8_t ret = 0; - - while ((ret = (pUsb->ctrlReq(bAddress, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr), 0, 0, nullptr, nullptr)) == 0x01)) - delay(6); - - if (ret) { - ErrorMessage (PSTR("ClearEpHalt"), ret); - ErrorMessage (PSTR("EP"), ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr)); - return ret; - } - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - return 0; -} - -/** - * For driver use only. - * - */ -void BulkOnly::Reset() { - while (pUsb->ctrlReq(bAddress, 0, bmREQ_MASSOUT, MASS_REQ_BOMSR, 0, 0, bIface, 0, 0, nullptr, nullptr) == 0x01) delay(6); -} - -/** - * For driver use only. - * - * @return 0 if successful - */ -uint8_t BulkOnly::ResetRecovery() { - Notify(PSTR("\r\nResetRecovery\r\n"), 0x80); - Notify(PSTR("-----------------\r\n"), 0x80); - - delay(6); - Reset(); - delay(6); - ClearEpHalt(epDataInIndex); - delay(6); - bLastUsbError = ClearEpHalt(epDataOutIndex); - delay(6); - return bLastUsbError; -} - -/** - * For driver use only. - * - * Clear all EP data and clear all LUN status - */ -void BulkOnly::ClearAllEP() { - for (uint8_t i = 0; i < MASS_MAX_ENDPOINTS; i++) { - epInfo[i].epAddr = 0; - epInfo[i].maxPktSize = (i) ? 0 : 8; - epInfo[i].bmSndToggle = 0; - epInfo[i].bmRcvToggle = 0; - epInfo[i].bmNakPower = USB_NAK_DEFAULT; - } - - for (uint8_t i = 0; i < MASS_MAX_SUPPORTED_LUN; i++) { - LUNOk[i] = false; - WriteOk[i] = false; - CurrentCapacity[i] = 0UL; - CurrentSectorSize[i] = 0; - } - - bIface = 0; - bNumEP = 1; - bAddress = 0; - qNextPollTime = 0; - bPollEnable = false; - bLastUsbError = 0; - bMaxLUN = 0; - bTheLUN = 0; -} - -/** - * For driver use only. - * - * @param pcsw - * @param pcbw - * @return - */ -bool BulkOnly::IsValidCSW(CommandStatusWrapper *pcsw, CommandBlockWrapperBase *pcbw) { - if (pcsw->dCSWSignature != MASS_CSW_SIGNATURE) { - Notify(PSTR("CSW:Sig error\r\n"), 0x80); - return false; - } - if (pcsw->dCSWTag != pcbw->dCBWTag) { - Notify(PSTR("CSW:Wrong tag\r\n"), 0x80); - return false; - } - return true; -} - -/** - * For driver use only. - * - * @param error - * @param index - * @return - */ -uint8_t BulkOnly::HandleUsbError(uint8_t error, uint8_t index) { - uint8_t count = 3; - - bLastUsbError = error; - //if (error) - //ClearEpHalt(index); - while (error && count) { - if (error != hrSUCCESS) { - ErrorMessage (PSTR("USB Error"), error); - ErrorMessage (PSTR("Index"), index); - } - switch (error) { - // case hrWRONGPID: - case hrSUCCESS: return MASS_ERR_SUCCESS; - case hrBUSY: return MASS_ERR_UNIT_BUSY; // SIE is busy, just hang out and try again. - case hrTIMEOUT: - case hrJERR: return MASS_ERR_DEVICE_DISCONNECTED; - case hrSTALL: - if (index) { - ClearEpHalt(index); - return (index == epDataInIndex) ? MASS_ERR_STALL : MASS_ERR_WRITE_STALL; - } - return MASS_ERR_STALL; - - case hrNAK: - return index ? MASS_ERR_UNIT_BUSY : MASS_ERR_UNIT_BUSY; - - case hrTOGERR: - // Handle a super rare corner case, where toggles become de-synced. - // I've only run into one device that has this firmware bug, and this is - // the only clean way to get back into sync with the buggy device firmware. - // --AJK - if (bAddress && bConfNum) { - error = pUsb->setConf(bAddress, 0, bConfNum); - if (error) break; - } - return MASS_ERR_SUCCESS; - default: - ErrorMessage (PSTR("\r\nUSB"), error); - return MASS_ERR_GENERAL_USB_ERROR; - } - count--; - } // while - - return ((error && !count) ? MASS_ERR_GENERAL_USB_ERROR : MASS_ERR_SUCCESS); -} - -#if MS_WANT_PARSER - uint8_t BulkOnly::Transaction(CommandBlockWrapper *pcbw, uint16_t buf_size, void *buf) { - return Transaction(CommandBlockWrapper *pcbw, uint16_t buf_size, void *buf, 0); - } -#endif - -/** - * For driver use only. - * - * @param pcbw - * @param buf_size - * @param buf - * @param flags - * @return - */ -uint8_t BulkOnly::Transaction(CommandBlockWrapper *pcbw, uint16_t buf_size, void *buf - #if MS_WANT_PARSER - , uint8_t flags - #endif -) { - #if MS_WANT_PARSER - uint16_t bytes = (pcbw->dCBWDataTransferLength > buf_size) ? buf_size : pcbw->dCBWDataTransferLength; - printf("Transfersize %i\r\n", bytes); - delay(1000); - - bool callback = (flags & MASS_TRANS_FLG_CALLBACK) == MASS_TRANS_FLG_CALLBACK; - #else - uint16_t bytes = buf_size; - #endif - - bool write = (pcbw->bmCBWFlags & MASS_CMD_DIR_IN) != MASS_CMD_DIR_IN; - uint8_t ret = 0; - uint8_t usberr; - CommandStatusWrapper csw; // up here, we allocate ahead to save cpu cycles. - SetCurLUN(pcbw->bmCBWLUN); - ErrorMessage (PSTR("CBW.dCBWTag"), pcbw->dCBWTag); - - while ((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, sizeof (CommandBlockWrapper), (uint8_t*)pcbw)) == hrBUSY) delay(1); - - ret = HandleUsbError(usberr, epDataOutIndex); - //ret = HandleUsbError(pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, sizeof (CommandBlockWrapper), (uint8_t*)pcbw), epDataOutIndex); - if (ret) - ErrorMessage (PSTR("============================ CBW"), ret); - else { - if (bytes) { - if (!write) { - #if MS_WANT_PARSER - if (callback) { - uint8_t rbuf[bytes]; - while ((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, rbuf)) == hrBUSY) delay(1); - if (usberr == hrSUCCESS) ((USBReadParser*)buf)->Parse(bytes, rbuf, 0); - } - else - #endif - { - while ((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*)buf)) == hrBUSY) delay(1); - } - ret = HandleUsbError(usberr, epDataInIndex); - } - else { - while ((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, bytes, (uint8_t*)buf)) == hrBUSY) delay(1); - ret = HandleUsbError(usberr, epDataOutIndex); - } - if (ret) ErrorMessage (PSTR("============================ DAT"), ret); - } - } - - bytes = sizeof (CommandStatusWrapper); - int tries = 2; - while (tries--) { - while ((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*) & csw)) == hrBUSY) delay(1); - if (!usberr) break; - ClearEpHalt(epDataInIndex); - if (tries) ResetRecovery(); - } - - if (!ret) { - Notify(PSTR("CBW:\t\tOK\r\n"), 0x80); - Notify(PSTR("Data Stage:\tOK\r\n"), 0x80); - } - else { - // Throw away csw, IT IS NOT OF ANY USE. - ResetRecovery(); - return ret; - } - - ret = HandleUsbError(usberr, epDataInIndex); - if (ret) ErrorMessage (PSTR("============================ CSW"), ret); - - if (usberr == hrSUCCESS) { - if (IsValidCSW(&csw, pcbw)) { - //ErrorMessage (PSTR("CSW.dCBWTag"), csw.dCSWTag); - //ErrorMessage (PSTR("bCSWStatus"), csw.bCSWStatus); - //ErrorMessage (PSTR("dCSWDataResidue"), csw.dCSWDataResidue); - Notify(PSTR("CSW:\t\tOK\r\n\r\n"), 0x80); - return csw.bCSWStatus; - } - else { - // NOTE! Sometimes this is caused by the reported residue being wrong. - // Get a different device. It isn't compliant, and should have never passed Q&A. - // I own one... 05e3:0701 Genesys Logic, Inc. USB 2.0 IDE Adapter. - // Other devices that exhibit this behavior exist in the wild too. - // Be sure to check quirks in the Linux source code before reporting a bug. --xxxajk - Notify(PSTR("Invalid CSW\r\n"), 0x80); - ResetRecovery(); - //return MASS_ERR_SUCCESS; - return MASS_ERR_INVALID_CSW; - } - } - return ret; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return - */ -uint8_t BulkOnly::SetCurLUN(uint8_t lun) { - if (lun > bMaxLUN) return MASS_ERR_INVALID_LUN; - bTheLUN = lun; - return MASS_ERR_SUCCESS; -} - -/** - * For driver use only. - * - * @param status - * @return - */ -uint8_t BulkOnly::HandleSCSIError(uint8_t status) { - uint8_t ret = 0; - - switch (status) { - case 0: return MASS_ERR_SUCCESS; - - case 2: - ErrorMessage (PSTR("Phase Error"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - ResetRecovery(); - return MASS_ERR_GENERAL_SCSI_ERROR; - - case 1: - ErrorMessage (PSTR("SCSI Error"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - RequestSenseResponce rsp; - - ret = RequestSense(bTheLUN, sizeof (RequestSenseResponce), (uint8_t*) & rsp); - - if (ret) return MASS_ERR_GENERAL_SCSI_ERROR; - - ErrorMessage (PSTR("Response Code"), rsp.bResponseCode); - if (rsp.bResponseCode & 0x80) { - Notify(PSTR("Information field: "), 0x80); - for (int i = 0; i < 4; i++) { - D_PrintHex (rsp.CmdSpecificInformation[i], 0x80); - Notify(PSTR(" "), 0x80); - } - Notify(PSTR("\r\n"), 0x80); - } - ErrorMessage (PSTR("Sense Key"), rsp.bmSenseKey); - ErrorMessage (PSTR("Add Sense Code"), rsp.bAdditionalSenseCode); - ErrorMessage (PSTR("Add Sense Qual"), rsp.bAdditionalSenseQualifier); - // warning, this is not testing ASQ, only SK and ASC. - switch (rsp.bmSenseKey) { - case SCSI_S_UNIT_ATTENTION: - switch (rsp.bAdditionalSenseCode) { - case SCSI_ASC_MEDIA_CHANGED: - return MASS_ERR_MEDIA_CHANGED; - default: - return MASS_ERR_UNIT_NOT_READY; - } - case SCSI_S_NOT_READY: - switch (rsp.bAdditionalSenseCode) { - case SCSI_ASC_MEDIUM_NOT_PRESENT: - return MASS_ERR_NO_MEDIA; - default: - return MASS_ERR_UNIT_NOT_READY; - } - case SCSI_S_ILLEGAL_REQUEST: - switch (rsp.bAdditionalSenseCode) { - case SCSI_ASC_LBA_OUT_OF_RANGE: - return MASS_ERR_BAD_LBA; - default: - return MASS_ERR_CMD_NOT_SUPPORTED; - } - default: - return MASS_ERR_GENERAL_SCSI_ERROR; - } - - // case 4: return MASS_ERR_UNIT_BUSY; // Busy means retry later. - // case 0x05/0x14: we stalled out - // case 0x15/0x16: we naked out. - default: - ErrorMessage (PSTR("Gen SCSI Err"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - return status; - } // switch -} - - -//////////////////////////////////////////////////////////////////////////////// -// Debugging code -//////////////////////////////////////////////////////////////////////////////// - -/** - * - * @param ep_ptr - */ -void BulkOnly::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { - Notify(PSTR("Endpoint descriptor:"), 0x80); - Notify(PSTR("\r\nLength:\t\t"), 0x80); - D_PrintHex (ep_ptr->bLength, 0x80); - Notify(PSTR("\r\nType:\t\t"), 0x80); - D_PrintHex (ep_ptr->bDescriptorType, 0x80); - Notify(PSTR("\r\nAddress:\t"), 0x80); - D_PrintHex (ep_ptr->bEndpointAddress, 0x80); - Notify(PSTR("\r\nAttributes:\t"), 0x80); - D_PrintHex (ep_ptr->bmAttributes, 0x80); - Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); - D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); - Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); - D_PrintHex (ep_ptr->bInterval, 0x80); - Notify(PSTR("\r\n"), 0x80); -} - -//////////////////////////////////////////////////////////////////////////////// -// misc/to kill/to-do -//////////////////////////////////////////////////////////////////////////////// - -/* We won't be needing this... */ -uint8_t BulkOnly::Read(uint8_t lun __attribute__((unused)), uint32_t addr __attribute__((unused)), uint16_t bsize __attribute__((unused)), uint8_t blocks __attribute__((unused)), USBReadParser * prs __attribute__((unused))) { - #if MS_WANT_PARSER - if (!LUNOk[lun]) return MASS_ERR_NO_MEDIA; - Notify(PSTR("\r\nRead (With parser)\r\n"), 0x80); - Notify(PSTR("---------\r\n"), 0x80); - - CommandBlockWrapper cbw = CommandBlockWrapper(); - - cbw.dCBWSignature = MASS_CBW_SIGNATURE; - cbw.dCBWTag = ++dCBWTag; - cbw.dCBWDataTransferLength = ((uint32_t)bsize * blocks); - cbw.bmCBWFlags = MASS_CMD_DIR_IN, - cbw.bmCBWLUN = lun; - cbw.bmCBWCBLength = 10; - - cbw.CBWCB[0] = SCSI_CMD_READ_10; - cbw.CBWCB[8] = blocks; - cbw.CBWCB[2] = ((addr >> 24) & 0xff); - cbw.CBWCB[3] = ((addr >> 16) & 0xff); - cbw.CBWCB[4] = ((addr >> 8) & 0xff); - cbw.CBWCB[5] = (addr & 0xff); - - return HandleSCSIError(Transaction(&cbw, bsize, prs, 1)); - #else - return MASS_ERR_NOT_IMPLEMENTED; - #endif -} - -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h deleted file mode 100644 index 09b82fdb92..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h +++ /dev/null @@ -1,562 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#pragma once - -// Cruft removal, makes driver smaller, faster. -#ifndef MS_WANT_PARSER - #define MS_WANT_PARSER 0 -#endif - -#include "Usb.h" - -#define bmREQ_MASSOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -#define bmREQ_MASSIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE - -// Mass Storage Subclass Constants -#define MASS_SUBCLASS_SCSI_NOT_REPORTED 0x00 // De facto use -#define MASS_SUBCLASS_RBC 0x01 -#define MASS_SUBCLASS_ATAPI 0x02 // MMC-5 (ATAPI) -#define MASS_SUBCLASS_OBSOLETE1 0x03 // Was QIC-157 -#define MASS_SUBCLASS_UFI 0x04 // Specifies how to interface Floppy Disk Drives to USB -#define MASS_SUBCLASS_OBSOLETE2 0x05 // Was SFF-8070i -#define MASS_SUBCLASS_SCSI 0x06 // SCSI Transparent Command Set -#define MASS_SUBCLASS_LSDFS 0x07 // Specifies how host has to negotiate access before trying SCSI -#define MASS_SUBCLASS_IEEE1667 0x08 - -// Mass Storage Class Protocols -#define MASS_PROTO_CBI 0x00 // CBI (with command completion interrupt) -#define MASS_PROTO_CBI_NO_INT 0x01 // CBI (without command completion interrupt) -#define MASS_PROTO_OBSOLETE 0x02 -#define MASS_PROTO_BBB 0x50 // Bulk Only Transport -#define MASS_PROTO_UAS 0x62 - -// Request Codes -#define MASS_REQ_ADSC 0x00 -#define MASS_REQ_GET 0xFC -#define MASS_REQ_PUT 0xFD -#define MASS_REQ_GET_MAX_LUN 0xFE -#define MASS_REQ_BOMSR 0xFF // Bulk-Only Mass Storage Reset - -#define MASS_CBW_SIGNATURE 0x43425355 -#define MASS_CSW_SIGNATURE 0x53425355 - -#define MASS_CMD_DIR_OUT 0 // (0 << 7) -#define MASS_CMD_DIR_IN 0x80 //(1 << 7) - -/* - * Reference documents from T10 (http://www.t10.org) - * SCSI Primary Commands - 3 (SPC-3) - * SCSI Block Commands - 2 (SBC-2) - * Multi-Media Commands - 5 (MMC-5) - */ - -/* Group 1 commands (CDB's here are should all be 6-bytes) */ -#define SCSI_CMD_TEST_UNIT_READY 0x00 -#define SCSI_CMD_REQUEST_SENSE 0x03 -#define SCSI_CMD_FORMAT_UNIT 0x04 -#define SCSI_CMD_READ_6 0x08 -#define SCSI_CMD_WRITE_6 0x0A -#define SCSI_CMD_INQUIRY 0x12 -#define SCSI_CMD_MODE_SELECT_6 0x15 -#define SCSI_CMD_MODE_SENSE_6 0x1A -#define SCSI_CMD_START_STOP_UNIT 0x1B -#define SCSI_CMD_PREVENT_REMOVAL 0x1E -/* Group 2 Commands (CDB's here are 10-bytes) */ -#define SCSI_CMD_READ_FORMAT_CAPACITIES 0x23 -#define SCSI_CMD_READ_CAPACITY_10 0x25 -#define SCSI_CMD_READ_10 0x28 -#define SCSI_CMD_WRITE_10 0x2A -#define SCSI_CMD_SEEK_10 0x2B -#define SCSI_CMD_ERASE_10 0x2C -#define SCSI_CMD_WRITE_AND_VERIFY_10 0x2E -#define SCSI_CMD_VERIFY_10 0x2F -#define SCSI_CMD_SYNCHRONIZE_CACHE 0x35 -#define SCSI_CMD_WRITE_BUFFER 0x3B -#define SCSI_CMD_READ_BUFFER 0x3C -#define SCSI_CMD_READ_SUBCHANNEL 0x42 -#define SCSI_CMD_READ_TOC 0x43 -#define SCSI_CMD_READ_HEADER 0x44 -#define SCSI_CMD_PLAY_AUDIO_10 0x45 -#define SCSI_CMD_GET_CONFIGURATION 0x46 -#define SCSI_CMD_PLAY_AUDIO_MSF 0x47 -#define SCSI_CMD_PLAY_AUDIO_TI 0x48 -#define SCSI_CMD_PLAY_TRACK_REL_10 0x49 -#define SCSI_CMD_GET_EVENT_STATUS 0x4A -#define SCSI_CMD_PAUSE_RESUME 0x4B -#define SCSI_CMD_READ_DISC_INFORMATION 0x51 -#define SCSI_CMD_READ_TRACK_INFORMATION 0x52 -#define SCSI_CMD_RESERVE_TRACK 0x53 -#define SCSI_CMD_SEND_OPC_INFORMATION 0x54 -#define SCSI_CMD_MODE_SELECT_10 0x55 -#define SCSI_CMD_REPAIR_TRACK 0x58 -#define SCSI_CMD_MODE_SENSE_10 0x5A -#define SCSI_CMD_CLOSE_TRACK_SESSION 0x5B -#define SCSI_CMD_READ_BUFFER_CAPACITY 0x5C -#define SCSI_CMD_SEND_CUE_SHEET 0x5D -/* Group 5 Commands (CDB's here are 12-bytes) */ -#define SCSI_CMD_REPORT_LUNS 0xA0 -#define SCSI_CMD_BLANK 0xA1 -#define SCSI_CMD_SECURITY_PROTOCOL_IN 0xA2 -#define SCSI_CMD_SEND_KEY 0xA3 -#define SCSI_CMD_REPORT_KEY 0xA4 -#define SCSI_CMD_PLAY_AUDIO_12 0xA5 -#define SCSI_CMD_LOAD_UNLOAD 0xA6 -#define SCSI_CMD_SET_READ_AHEAD 0xA7 -#define SCSI_CMD_READ_12 0xA8 -#define SCSI_CMD_PLAY_TRACK_REL_12 0xA9 -#define SCSI_CMD_WRITE_12 0xAA -#define SCSI_CMD_READ_MEDIA_SERIAL_12 0xAB -#define SCSI_CMD_GET_PERFORMANCE 0xAC -#define SCSI_CMD_READ_DVD_STRUCTURE 0xAD -#define SCSI_CMD_SECURITY_PROTOCOL_OUT 0xB5 -#define SCSI_CMD_SET_STREAMING 0xB6 -#define SCSI_CMD_READ_MSF 0xB9 -#define SCSI_CMD_SET_SPEED 0xBB -#define SCSI_CMD_MECHANISM_STATUS 0xBD -#define SCSI_CMD_READ_CD 0xBE -#define SCSI_CMD_SEND_DISC_STRUCTURE 0xBF -/* Vendor-unique Commands, included for completeness */ -#define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4 /* SONY unique */ -#define SCSI_CMD_PLAYBACK_CONTROL 0xC9 /* SONY unique */ -#define SCSI_CMD_READ_CDDA 0xD8 /* Vendor unique */ -#define SCSI_CMD_READ_CDXA 0xDB /* Vendor unique */ -#define SCSI_CMD_READ_ALL_SUBCODES 0xDF /* Vendor unique */ - -/* SCSI error codes */ -#define SCSI_S_NOT_READY 0x02 -#define SCSI_S_MEDIUM_ERROR 0x03 -#define SCSI_S_ILLEGAL_REQUEST 0x05 -#define SCSI_S_UNIT_ATTENTION 0x06 -#define SCSI_ASC_LBA_OUT_OF_RANGE 0x21 -#define SCSI_ASC_MEDIA_CHANGED 0x28 -#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A - -/* USB error codes */ -#define MASS_ERR_SUCCESS 0x00 -#define MASS_ERR_PHASE_ERROR 0x02 -#define MASS_ERR_UNIT_NOT_READY 0x03 -#define MASS_ERR_UNIT_BUSY 0x04 -#define MASS_ERR_STALL 0x05 -#define MASS_ERR_CMD_NOT_SUPPORTED 0x06 -#define MASS_ERR_INVALID_CSW 0x07 -#define MASS_ERR_NO_MEDIA 0x08 -#define MASS_ERR_BAD_LBA 0x09 -#define MASS_ERR_MEDIA_CHANGED 0x0A -#define MASS_ERR_DEVICE_DISCONNECTED 0x11 -#define MASS_ERR_UNABLE_TO_RECOVER 0x12 // Reset recovery error -#define MASS_ERR_INVALID_LUN 0x13 -#define MASS_ERR_WRITE_STALL 0x14 -#define MASS_ERR_READ_NAKS 0x15 -#define MASS_ERR_WRITE_NAKS 0x16 -#define MASS_ERR_WRITE_PROTECTED 0x17 -#define MASS_ERR_NOT_IMPLEMENTED 0xFD -#define MASS_ERR_GENERAL_SCSI_ERROR 0xFE -#define MASS_ERR_GENERAL_USB_ERROR 0xFF -#define MASS_ERR_USER 0xA0 // For subclasses to define their own error codes - -#define MASS_TRANS_FLG_CALLBACK 0x01 // Callback is involved -#define MASS_TRANS_FLG_NO_STALL_CHECK 0x02 // STALL condition is not checked -#define MASS_TRANS_FLG_NO_PHASE_CHECK 0x04 // PHASE_ERROR is not checked - -#define MASS_MAX_ENDPOINTS 3 - -struct Capacity { - uint8_t data[8]; - //uint32_t dwBlockAddress; - //uint32_t dwBlockLength; -} __attribute__((packed)); - -struct BASICCDB { - uint8_t Opcode; - - unsigned unused : 5; - unsigned LUN : 3; - - uint8_t info[12]; -} __attribute__((packed)); - -typedef BASICCDB BASICCDB_t; - -struct CDB6 { - uint8_t Opcode; - - unsigned LBAMSB : 5; - unsigned LUN : 3; - - uint8_t LBAHB; - uint8_t LBALB; - uint8_t AllocationLength; - uint8_t Control; - -public: - - CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) : - Opcode(_Opcode), LBAMSB(BGRAB2(LBA) & 0x1f), LUN(_LUN), LBAHB(BGRAB1(LBA)), LBALB(BGRAB0(LBA)), - AllocationLength(_AllocationLength), Control(_Control) { - } - - CDB6(uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control) : - Opcode(_Opcode), LBAMSB(0), LUN(_LUN), LBAHB(0), LBALB(0), - AllocationLength(_AllocationLength), Control(_Control) { - } -} __attribute__((packed)); - -typedef CDB6 CDB6_t; - -struct CDB10 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned LUN : 3; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t Misc2; - - uint8_t ALC_MB; - uint8_t ALC_LB; - - uint8_t Control; -public: - - CDB10(uint8_t _Opcode, uint8_t _LUN) : - Opcode(_Opcode), Service_Action(0), LUN(_LUN), - LBA_L_M_MB(0), LBA_L_M_LB(0), LBA_L_L_MB(0), LBA_L_L_LB(0), - Misc2(0), ALC_MB(0), ALC_LB(0), Control(0) { - } - - CDB10(uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA) : - Opcode(_Opcode), Service_Action(0), LUN(_LUN), - LBA_L_M_MB(BGRAB3(_LBA)), LBA_L_M_LB(BGRAB2(_LBA)), LBA_L_L_MB(BGRAB1(_LBA)), LBA_L_L_LB(BGRAB0(_LBA)), - Misc2(0), ALC_MB(BGRAB1(xflen)), ALC_LB(BGRAB0(xflen)), Control(0) { - } -} __attribute__((packed)); - -typedef CDB10 CDB10_t; - -struct CDB12 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned Misc : 3; - - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - uint8_t Control; -} __attribute__((packed)); - -typedef CDB12 CDB12_t; - -struct CDB_LBA32_16 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned Misc : 3; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t A_M_M_MB; - uint8_t A_M_M_LB; - uint8_t A_M_L_MB; - uint8_t A_M_L_LB; - - uint8_t ALC_M_MB; - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - - uint8_t Misc2; - uint8_t Control; -} __attribute__((packed)); - -struct CDB_LBA64_16 { - uint8_t Opcode; - uint8_t Misc; - - uint8_t LBA_M_M_MB; - uint8_t LBA_M_M_LB; - uint8_t LBA_M_L_MB; - uint8_t LBA_M_L_LB; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t ALC_M_MB; - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - - uint8_t Misc2; - uint8_t Control; -} __attribute__((packed)); - -struct InquiryResponse { - uint8_t DeviceType : 5; - uint8_t PeripheralQualifier : 3; - - unsigned Reserved : 7; - unsigned Removable : 1; - - uint8_t Version; - - unsigned ResponseDataFormat : 4; - unsigned HISUP : 1; - unsigned NormACA : 1; - unsigned TrmTsk : 1; - unsigned AERC : 1; - - uint8_t AdditionalLength; - //uint8_t Reserved3[2]; - - unsigned PROTECT : 1; - unsigned Res : 2; - unsigned ThreePC : 1; - unsigned TPGS : 2; - unsigned ACC : 1; - unsigned SCCS : 1; - - unsigned ADDR16 : 1; - unsigned R1 : 1; - unsigned R2 : 1; - unsigned MCHNGR : 1; - unsigned MULTIP : 1; - unsigned VS : 1; - unsigned ENCSERV : 1; - unsigned BQUE : 1; - - unsigned SoftReset : 1; - unsigned CmdQue : 1; - unsigned Reserved4 : 1; - unsigned Linked : 1; - unsigned Sync : 1; - unsigned WideBus16Bit : 1; - unsigned WideBus32Bit : 1; - unsigned RelAddr : 1; - - uint8_t VendorID[8]; - uint8_t ProductID[16]; - uint8_t RevisionID[4]; -} __attribute__((packed)); - -struct CommandBlockWrapperBase { - uint32_t dCBWSignature; - uint32_t dCBWTag; - uint32_t dCBWDataTransferLength; - uint8_t bmCBWFlags; -public: - - CommandBlockWrapperBase() { - } - - CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) : - dCBWSignature(MASS_CBW_SIGNATURE), dCBWTag(tag), dCBWDataTransferLength(xflen), bmCBWFlags(flgs) { - } -} __attribute__((packed)); - -struct CommandBlockWrapper : public CommandBlockWrapperBase { - - struct { - uint8_t bmCBWLUN : 4; - uint8_t bmReserved1 : 4; - }; - - struct { - uint8_t bmCBWCBLength : 4; - uint8_t bmReserved2 : 4; - }; - - uint8_t CBWCB[16]; - -public: - // All zeroed. - - CommandBlockWrapper() : - CommandBlockWrapperBase(0, 0, 0), bmReserved1(0), bmReserved2(0) { - for (int i = 0; i < 16; i++) CBWCB[i] = 0; - } - - // Generic Wrap, CDB zeroed. - - CommandBlockWrapper(uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd) : - CommandBlockWrapperBase(tag, xflen, flgs), - bmCBWLUN(lu), bmReserved1(0), bmCBWCBLength(cmdlen), bmReserved2(0) { - for (int i = 0; i < 16; i++) CBWCB[i] = 0; - // Type punning can cause optimization problems and bugs. - // Using reinterpret_cast to a dreinterpretifferent object is the proper way to do this. - //(((BASICCDB_t *) CBWCB)->LUN) = cmd; - BASICCDB_t *x = reinterpret_cast(CBWCB); - x->LUN = cmd; - } - - // Wrap for CDB of 6 - - CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB6_t *cdb, uint8_t dir) : - CommandBlockWrapperBase(tag, xflen, dir), - bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(6), bmReserved2(0) { - memcpy(&CBWCB, cdb, 6); - } - // Wrap for CDB of 10 - - CommandBlockWrapper(uint32_t tag, uint32_t xflen, CDB10_t *cdb, uint8_t dir) : - CommandBlockWrapperBase(tag, xflen, dir), - bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(10), bmReserved2(0) { - memcpy(&CBWCB, cdb, 10); - } -} __attribute__((packed)); - -struct CommandStatusWrapper { - uint32_t dCSWSignature; - uint32_t dCSWTag; - uint32_t dCSWDataResidue; - uint8_t bCSWStatus; -} __attribute__((packed)); - -struct RequestSenseResponce { - uint8_t bResponseCode; - uint8_t bSegmentNumber; - - uint8_t bmSenseKey : 4; - uint8_t bmReserved : 1; - uint8_t bmILI : 1; - uint8_t bmEOM : 1; - uint8_t bmFileMark : 1; - - uint8_t Information[4]; - uint8_t bAdditionalLength; - uint8_t CmdSpecificInformation[4]; - uint8_t bAdditionalSenseCode; - uint8_t bAdditionalSenseQualifier; - uint8_t bFieldReplaceableUnitCode; - uint8_t SenseKeySpecific[3]; -} __attribute__((packed)); - -class BulkOnly : public USBDeviceConfig, public UsbConfigXtracter { -protected: - static const uint8_t epDataInIndex; // DataIn endpoint index - static const uint8_t epDataOutIndex; // DataOUT endpoint index - static const uint8_t epInterruptInIndex; // InterruptIN endpoint index - - USB *pUsb; - uint8_t bAddress; - uint8_t bConfNum; // configuration number - uint8_t bIface; // interface value - uint8_t bNumEP; // total number of EP in the configuration - uint32_t qNextPollTime; // next poll time - bool bPollEnable; // poll enable flag - - EpInfo epInfo[MASS_MAX_ENDPOINTS]; - - uint32_t dCBWTag; // Tag - //uint32_t dCBWDataTransferLength; // Data Transfer Length - uint8_t bLastUsbError; // Last USB error - uint8_t bMaxLUN; // Max LUN - uint8_t bTheLUN; // Active LUN - uint32_t CurrentCapacity[MASS_MAX_SUPPORTED_LUN]; // Total sectors - uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits - bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes. - bool WriteOk[MASS_MAX_SUPPORTED_LUN]; - void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); - - // Additional Initialization Method for Subclasses - - virtual uint8_t OnInit() { return 0; } - -public: - BulkOnly(USB *p); - - uint8_t GetLastUsbError() { return bLastUsbError; }; - - uint8_t GetbMaxLUN() { return bMaxLUN; } // Max LUN - uint8_t GetbTheLUN() { return bTheLUN; } // Active LUN - - bool WriteProtected(uint8_t lun); - uint8_t MediaCTL(uint8_t lun, uint8_t ctl); - uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf); - uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs); - uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf); - uint8_t LockMedia(uint8_t lun, uint8_t lock); - - bool LUNIsGood(uint8_t lun); - uint32_t GetCapacity(uint8_t lun); - uint16_t GetSectorSize(uint8_t lun); - - // USBDeviceConfig implementation - uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed); - uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed); - - uint8_t Release(); - uint8_t Poll(); - - virtual uint8_t GetAddress() { return bAddress; } - - // UsbConfigXtracter implementation - void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep); - - virtual bool DEVCLASSOK(uint8_t klass) { return klass == USB_CLASS_MASS_STORAGE; } - - uint8_t SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); - uint8_t SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); - -private: - uint8_t Inquiry(uint8_t lun, uint16_t size, uint8_t *buf); - uint8_t TestUnitReady(uint8_t lun); - uint8_t RequestSense(uint8_t lun, uint16_t size, uint8_t *buf); - uint8_t ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t *buf); - uint8_t GetMaxLUN(uint8_t *max_lun); - uint8_t SetCurLUN(uint8_t lun); - void Reset(); - uint8_t ResetRecovery(); - uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf); - void ClearAllEP(); - void CheckMedia(); - bool CheckLUN(uint8_t lun); - uint8_t Page3F(uint8_t lun); - bool IsValidCBW(uint8_t size, uint8_t *pcbw); - bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw); - - bool IsValidCSW(CommandStatusWrapper *pcsw, CommandBlockWrapperBase *pcbw); - - uint8_t ClearEpHalt(uint8_t index); - #if MS_WANT_PARSER - uint8_t Transaction(CommandBlockWrapper *cbw, uint16_t bsize, void *buf, uint8_t flags); - #endif - uint8_t Transaction(CommandBlockWrapper *cbw, uint16_t bsize, void *buf); - uint8_t HandleUsbError(uint8_t error, uint8_t index); - uint8_t HandleSCSIError(uint8_t status); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h deleted file mode 100644 index 39845fb730..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include max3421e.h directly; include Usb.h instead" -#endif - -/* MAX3421E register/bit names and bitmasks */ - -/* Arduino pin definitions */ -/* pin numbers to port numbers */ - -#define SE0 0 -#define SE1 1 -#define FSHOST 2 -#define LSHOST 3 - -/* MAX3421E command byte format: rrrrr0wa where 'r' is register number */ -// -// MAX3421E Registers in HOST mode. -// -#define rRCVFIFO 0x08 //1<<3 -#define rSNDFIFO 0x10 //2<<3 -#define rSUDFIFO 0x20 //4<<3 -#define rRCVBC 0x30 //6<<3 -#define rSNDBC 0x38 //7<<3 - -#define rUSBIRQ 0x68 //13<<3 -/* USBIRQ Bits */ -#define bmVBUSIRQ 0x40 //b6 -#define bmNOVBUSIRQ 0x20 //b5 -#define bmOSCOKIRQ 0x01 //b0 - -#define rUSBIEN 0x70 //14<<3 -/* USBIEN Bits */ -#define bmVBUSIE 0x40 //b6 -#define bmNOVBUSIE 0x20 //b5 -#define bmOSCOKIE 0x01 //b0 - -#define rUSBCTL 0x78 //15<<3 -/* USBCTL Bits */ -#define bmCHIPRES 0x20 //b5 -#define bmPWRDOWN 0x10 //b4 - -#define rCPUCTL 0x80 //16<<3 -/* CPUCTL Bits */ -#define bmPUSLEWID1 0x80 //b7 -#define bmPULSEWID0 0x40 //b6 -#define bmIE 0x01 //b0 - -#define rPINCTL 0x88 //17<<3 -/* PINCTL Bits */ -#define bmFDUPSPI 0x10 //b4 -#define bmINTLEVEL 0x08 //b3 -#define bmPOSINT 0x04 //b2 -#define bmGPXB 0x02 //b1 -#define bmGPXA 0x01 //b0 -// GPX pin selections -#define GPX_OPERATE 0x00 -#define GPX_VBDET 0x01 -#define GPX_BUSACT 0x02 -#define GPX_SOF 0x03 - -#define rREVISION 0x90 //18<<3 - -#define rIOPINS1 0xa0 //20<<3 - -/* IOPINS1 Bits */ -#define bmGPOUT0 0x01 -#define bmGPOUT1 0x02 -#define bmGPOUT2 0x04 -#define bmGPOUT3 0x08 -#define bmGPIN0 0x10 -#define bmGPIN1 0x20 -#define bmGPIN2 0x40 -#define bmGPIN3 0x80 - -#define rIOPINS2 0xa8 //21<<3 -/* IOPINS2 Bits */ -#define bmGPOUT4 0x01 -#define bmGPOUT5 0x02 -#define bmGPOUT6 0x04 -#define bmGPOUT7 0x08 -#define bmGPIN4 0x10 -#define bmGPIN5 0x20 -#define bmGPIN6 0x40 -#define bmGPIN7 0x80 - -#define rGPINIRQ 0xb0 //22<<3 -/* GPINIRQ Bits */ -#define bmGPINIRQ0 0x01 -#define bmGPINIRQ1 0x02 -#define bmGPINIRQ2 0x04 -#define bmGPINIRQ3 0x08 -#define bmGPINIRQ4 0x10 -#define bmGPINIRQ5 0x20 -#define bmGPINIRQ6 0x40 -#define bmGPINIRQ7 0x80 - -#define rGPINIEN 0xb8 //23<<3 -/* GPINIEN Bits */ -#define bmGPINIEN0 0x01 -#define bmGPINIEN1 0x02 -#define bmGPINIEN2 0x04 -#define bmGPINIEN3 0x08 -#define bmGPINIEN4 0x10 -#define bmGPINIEN5 0x20 -#define bmGPINIEN6 0x40 -#define bmGPINIEN7 0x80 - -#define rGPINPOL 0xc0 //24<<3 -/* GPINPOL Bits */ -#define bmGPINPOL0 0x01 -#define bmGPINPOL1 0x02 -#define bmGPINPOL2 0x04 -#define bmGPINPOL3 0x08 -#define bmGPINPOL4 0x10 -#define bmGPINPOL5 0x20 -#define bmGPINPOL6 0x40 -#define bmGPINPOL7 0x80 - -#define rHIRQ 0xc8 //25<<3 -/* HIRQ Bits */ -#define bmBUSEVENTIRQ 0x01 // indicates BUS Reset Done or BUS Resume -#define bmRWUIRQ 0x02 -#define bmRCVDAVIRQ 0x04 -#define bmSNDBAVIRQ 0x08 -#define bmSUSDNIRQ 0x10 -#define bmCONDETIRQ 0x20 -#define bmFRAMEIRQ 0x40 -#define bmHXFRDNIRQ 0x80 - -#define rHIEN 0xd0 //26<<3 - -/* HIEN Bits */ -#define bmBUSEVENTIE 0x01 -#define bmRWUIE 0x02 -#define bmRCVDAVIE 0x04 -#define bmSNDBAVIE 0x08 -#define bmSUSDNIE 0x10 -#define bmCONDETIE 0x20 -#define bmFRAMEIE 0x40 -#define bmHXFRDNIE 0x80 - -#define rMODE 0xd8 //27<<3 - -/* MODE Bits */ -#define bmHOST 0x01 -#define bmLOWSPEED 0x02 -#define bmHUBPRE 0x04 -#define bmSOFKAENAB 0x08 -#define bmSEPIRQ 0x10 -#define bmDELAYISO 0x20 -#define bmDMPULLDN 0x40 -#define bmDPPULLDN 0x80 - -#define rPERADDR 0xe0 //28<<3 - -#define rHCTL 0xe8 //29<<3 -/* HCTL Bits */ -#define bmBUSRST 0x01 -#define bmFRMRST 0x02 -#define bmSAMPLEBUS 0x04 -#define bmSIGRSM 0x08 -#define bmRCVTOG0 0x10 -#define bmRCVTOG1 0x20 -#define bmSNDTOG0 0x40 -#define bmSNDTOG1 0x80 - -#define rHXFR 0xf0 //30<<3 - -#undef tokSETUP -#undef tokIN -#undef tokOUT -#undef tokINHS -#undef tokOUTHS -#undef tokISOIN -#undef tokISOOUT - -/* Host transfer token values for writing the HXFR register (R30) */ -/* OR this bit field with the endpoint number in bits 3:0 */ -#define tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1 -#define tokIN 0x00 // HS=0, ISO=0, OUTNIN=0, SETUP=0 -#define tokOUT 0x20 // HS=0, ISO=0, OUTNIN=1, SETUP=0 -#define tokINHS 0x80 // HS=1, ISO=0, OUTNIN=0, SETUP=0 -#define tokOUTHS 0xA0 // HS=1, ISO=0, OUTNIN=1, SETUP=0 -#define tokISOIN 0x40 // HS=0, ISO=1, OUTNIN=0, SETUP=0 -#define tokISOOUT 0x60 // HS=0, ISO=1, OUTNIN=1, SETUP=0 - -#define rHRSL 0xf8 //31<<3 - -/* HRSL Bits */ -#define bmRCVTOGRD 0x10 -#define bmSNDTOGRD 0x20 -#define bmKSTATUS 0x40 -#define bmJSTATUS 0x80 -#define bmSE0 0x00 //SE0 - disconnect state -#define bmSE1 0xc0 //SE1 - illegal state - -/* Host error result codes, the 4 LSB's in the HRSL register */ -#define hrSUCCESS 0x00 -#define hrBUSY 0x01 -#define hrBADREQ 0x02 -#define hrUNDEF 0x03 -#define hrNAK 0x04 -#define hrSTALL 0x05 -#define hrTOGERR 0x06 -#define hrWRONGPID 0x07 -#define hrBADBC 0x08 -#define hrPIDERR 0x09 -#define hrPKTERR 0x0A -#define hrCRCERR 0x0B -#define hrKERR 0x0C -#define hrJERR 0x0D -#define hrTIMEOUT 0x0E -#define hrBABBLE 0x0F - -#define MODE_FS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmSOFKAENAB) -#define MODE_LS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmLOWSPEED|bmSOFKAENAB) diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp deleted file mode 100644 index 78a9ba1fd7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) - -#include "Usb.h" - -// 0x80 is the default (i.e. trace) to turn off set this global to something lower. -// this allows for 126 other debugging levels. -// TO-DO: Allow assignment to a different serial port by software -int UsbDEBUGlvl = 0x80; - -void E_Notifyc(char c, int lvl) { - if (UsbDEBUGlvl < lvl) return; - USB_HOST_SERIAL.print(c - #if !defined(ARDUINO) || ARDUINO < 100 - , BYTE - #endif - ); - //USB_HOST_SERIAL.flush(); -} - -void E_Notify(char const * msg, int lvl) { - if (UsbDEBUGlvl < lvl) return; - if (!msg) return; - while (const char c = pgm_read_byte(msg++)) E_Notifyc(c, lvl); -} - -void E_NotifyStr(char const * msg, int lvl) { - if (UsbDEBUGlvl < lvl) return; - if (!msg) return; - while (const char c = *msg++) E_Notifyc(c, lvl); -} - -void E_Notify(uint8_t b, int lvl) { - if (UsbDEBUGlvl < lvl) return; - USB_HOST_SERIAL.print(b - #if !defined(ARDUINO) || ARDUINO < 100 - , DEC - #endif - ); - //USB_HOST_SERIAL.flush(); -} - -void E_Notify(double d, int lvl) { - if (UsbDEBUGlvl < lvl) return; - USB_HOST_SERIAL.print(d); - //USB_HOST_SERIAL.flush(); -} - -#ifdef DEBUG_USB_HOST - - void NotifyFailGetDevDescr() { - Notify(PSTR("\r\ngetDevDescr "), 0x80); - } - - void NotifyFailSetDevTblEntry() { - Notify(PSTR("\r\nsetDevTblEn "), 0x80); - } - - void NotifyFailGetConfDescr() { - Notify(PSTR("\r\ngetConf "), 0x80); - } - - void NotifyFailSetConfDescr() { - Notify(PSTR("\r\nsetConf "), 0x80); - } - - void NotifyFailGetDevDescr(uint8_t reason) { - NotifyFailGetDevDescr(); - NotifyFail(reason); - } - - void NotifyFailSetDevTblEntry(uint8_t reason) { - NotifyFailSetDevTblEntry(); - NotifyFail(reason); - - } - - void NotifyFailGetConfDescr(uint8_t reason) { - NotifyFailGetConfDescr(); - NotifyFail(reason); - } - - void NotifyFailSetConfDescr(uint8_t reason) { - NotifyFailSetConfDescr(); - NotifyFail(reason); - } - - void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID) { - Notify(PSTR("\r\nUnknown Device Connected - VID: "), 0x80); - D_PrintHex (VID, 0x80); - Notify(PSTR(" PID: "), 0x80); - D_PrintHex (PID, 0x80); - } - - void NotifyFail(uint8_t rcode) { - D_PrintHex (rcode, 0x80); - Notify(PSTR("\r\n"), 0x80); - } - -#endif // DEBUG_USB_HOST - -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h deleted file mode 100644 index 960120d18d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include message.h directly; include Usb.h instead" -#endif - -extern int UsbDEBUGlvl; - -void E_Notify(char const * msg, int lvl); -void E_Notify(uint8_t b, int lvl); -void E_NotifyStr(char const * msg, int lvl); -void E_Notifyc(char c, int lvl); - -#ifdef DEBUG_USB_HOST - #define Notify E_Notify - #define NotifyStr E_NotifyStr - #define Notifyc E_Notifyc - void NotifyFailGetDevDescr(uint8_t reason); - void NotifyFailSetDevTblEntry(uint8_t reason); - void NotifyFailGetConfDescr(uint8_t reason); - void NotifyFailSetConfDescr(uint8_t reason); - void NotifyFailGetDevDescr(); - void NotifyFailSetDevTblEntry(); - void NotifyFailGetConfDescr(); - void NotifyFailSetConfDescr(); - void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); - void NotifyFail(uint8_t rcode); -#else - #define Notify(...) ((void)0) - #define NotifyStr(...) ((void)0) - #define Notifyc(...) ((void)0) - #define NotifyFailGetDevDescr(...) ((void)0) - #define NotifyFailSetDevTblEntry(...) ((void)0) - #define NotifyFailGetConfDescr(...) ((void)0) - #define NotifyFailGetDevDescr(...) ((void)0) - #define NotifyFailSetDevTblEntry(...) ((void)0) - #define NotifyFailGetConfDescr(...) ((void)0) - #define NotifyFailSetConfDescr(...) ((void)0) - #define NotifyFailUnknownDevice(...) ((void)0) - #define NotifyFail(...) ((void)0) -#endif - -template -void ErrorMessage(uint8_t level, char const * msg, ERROR_TYPE rcode = 0) { - #ifdef DEBUG_USB_HOST - Notify(msg, level); - Notify(PSTR(": "), level); - D_PrintHex (rcode, level); - Notify(PSTR("\r\n"), level); - #endif -} - -template -void ErrorMessage(char const * msg __attribute__((unused)), ERROR_TYPE rcode __attribute__((unused)) = 0) { - #ifdef DEBUG_USB_HOST - Notify(msg, 0x80); - Notify(PSTR(": "), 0x80); - D_PrintHex (rcode, 0x80); - Notify(PSTR("\r\n"), 0x80); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp deleted file mode 100644 index 0c7061b77c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) - -#include "Usb.h" - -bool MultiByteValueParser::Parse(uint8_t **pp, uint16_t *pcntdn) { - if (!pBuf) { - Notify(PSTR("Buffer pointer is NULL!\r\n"), 0x80); - return false; - } - for (; countDown && (*pcntdn); countDown--, (*pcntdn)--, (*pp)++) - pBuf[valueSize - countDown] = (**pp); - - if (countDown) return false; - - countDown = valueSize; - return true; -} - -bool PTPListParser::Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me) { - switch (nStage) { - case 0: - pBuf->valueSize = lenSize; - theParser.Initialize(pBuf); - nStage = 1; - - case 1: - if (!theParser.Parse(pp, pcntdn)) return false; - - arLen = 0; - arLen = (pBuf->valueSize >= 4) ? *((uint32_t*)pBuf->pValue) : (uint32_t)(*((uint16_t*)pBuf->pValue)); - arLenCntdn = arLen; - nStage = 2; - - case 2: - pBuf->valueSize = valSize; - theParser.Initialize(pBuf); - nStage = 3; - - case 3: - for (; arLenCntdn; arLenCntdn--) { - if (!theParser.Parse(pp, pcntdn)) return false; - if (pf) pf(pBuf, (arLen - arLenCntdn), me); - } - - nStage = 0; - } - return true; -} - -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h deleted file mode 100644 index 28a2841446..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include parsetools.h directly; include Usb.h instead" -#endif - -struct MultiValueBuffer { - uint8_t valueSize; - void *pValue; -} __attribute__((packed)); - -class MultiByteValueParser { - uint8_t * pBuf; - uint8_t countDown; - uint8_t valueSize; - -public: - - MultiByteValueParser() : pBuf(nullptr), countDown(0), valueSize(0) { - }; - - const uint8_t* GetBuffer() { return pBuf; } - - void Initialize(MultiValueBuffer * const pbuf) { - pBuf = (uint8_t*)pbuf->pValue; - countDown = valueSize = pbuf->valueSize; - } - - bool Parse(uint8_t **pp, uint16_t *pcntdn); -}; - -class ByteSkipper { - uint8_t *pBuf; - uint8_t nStage; - uint16_t countDown; - -public: - - ByteSkipper() : pBuf(nullptr), nStage(0), countDown(0) { - } - - void Initialize(MultiValueBuffer *pbuf) { - pBuf = (uint8_t*)pbuf->pValue; - countDown = 0; - } - - bool Skip(uint8_t **pp, uint16_t *pcntdn, uint16_t bytes_to_skip) { - switch (nStage) { - case 0: - countDown = bytes_to_skip; - nStage++; - case 1: - for (; countDown && (*pcntdn); countDown--, (*pp)++, (*pcntdn)--); - - if (!countDown) - nStage = 0; - } - return (!countDown); - } -}; - -// Pointer to a callback function triggered for each element of PTP array when used with PTPArrayParser -typedef void (*PTP_ARRAY_EL_FUNC)(const MultiValueBuffer * const p, uint32_t count, const void *me); - -class PTPListParser { -public: - - enum ParseMode { - modeArray, modeRange/*, modeEnum*/ - }; - -private: - uint8_t nStage; - uint8_t enStage; - - uint32_t arLen; - uint32_t arLenCntdn; - - uint8_t lenSize; // size of the array length field in bytes - uint8_t valSize; // size of the array element in bytes - - MultiValueBuffer *pBuf; - - // The only parser for both size and array element parsing - MultiByteValueParser theParser; - - uint8_t /*ParseMode*/ prsMode; - -public: - - PTPListParser() : - nStage(0), - enStage(0), - arLen(0), - arLenCntdn(0), - lenSize(0), - valSize(0), - pBuf(nullptr), - prsMode(modeArray) {} - ; - - void Initialize(const uint8_t len_size, const uint8_t val_size, MultiValueBuffer * const p, const uint8_t mode = modeArray) { - pBuf = p; - lenSize = len_size; - valSize = val_size; - prsMode = mode; - - if (prsMode == modeRange) { - arLenCntdn = arLen = 3; - nStage = 2; - } - else { - arLenCntdn = arLen = 0; - nStage = 0; - } - enStage = 0; - theParser.Initialize(p); - } - - bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = nullptr); -}; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h deleted file mode 100644 index 2cde3fc341..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ -#pragma once - -#ifndef _usb_h_ - #error "Never include printhex.h directly; include Usb.h instead" -#endif - -void E_Notifyc(char c, int lvl); - -template -void PrintHex(T val, int lvl) { - int num_nibbles = sizeof (T) * 2; - do { - char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); - if (v > 57) v += 7; - E_Notifyc(v, lvl); - } while (--num_nibbles); -} - -template -void PrintBin(T val, int lvl) { - for (T mask = (((T)1) << ((sizeof (T) << 3) - 1)); mask; mask >>= 1) - E_Notifyc(val & mask ? '1' : '0', lvl); -} - -template -void SerialPrintHex(T val) { - int num_nibbles = sizeof (T) * 2; - do { - char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); - if (v > 57) v += 7; - USB_HOST_SERIAL.print(v); - } while (--num_nibbles); -} - -template -void PrintHex2(Print *prn, T val) { - T mask = (((T)1) << (((sizeof (T) << 1) - 1) << 2)); - while (mask > 1) { - if (val < mask) prn->print("0"); - mask >>= 4; - } - prn->print((T)val, HEX); -} - -template void D_PrintHex(T val __attribute__((unused)), int lvl __attribute__((unused))) { - #ifdef DEBUG_USB_HOST - PrintHex (val, lvl); - #endif -} - -template -void D_PrintBin(T val, int lvl) { - #ifdef DEBUG_USB_HOST - PrintBin (val, lvl); - #endif -} diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h deleted file mode 100644 index 41821173d3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#pragma once - -#include "../../../inc/MarlinConfig.h" - -#include "macros.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - //////////////////////////////////////////////////////////////////////////////// - /* Added by Bill Greiman to speed up mass storage initialization with USB - * flash drives and simple USB hard drives. - * Disable this by defining DELAY(x) to be delay(x). - */ - #define delay(x) if ((x) < 200) safe_delay(x) - /* Almost all USB flash drives and simple USB hard drives fail the write - * protect test and add 20 - 30 seconds to USB init. Set SKIP_WRITE_PROTECT - * to nonzero to skip the test and assume the drive is writable. - */ - #define SKIP_WRITE_PROTECT 1 - /* Since Marlin only cares about USB flash drives, we only need one LUN. */ - #define MASS_MAX_SUPPORTED_LUN 1 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// SPI Configuration -//////////////////////////////////////////////////////////////////////////////// - -#ifndef USB_SPI - #define USB_SPI SPI - //#define USB_SPI SPI1 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// DEBUGGING -//////////////////////////////////////////////////////////////////////////////// - -/* Set this to 1 to activate serial debugging */ -#define ENABLE_UHS_DEBUGGING 0 - -/* This can be used to select which serial port to use for debugging if - * multiple serial ports are available. - * For example Serial3. - */ -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_HOST_SERIAL MYSERIAL0 -#endif - -#ifndef USB_HOST_SERIAL - #define USB_HOST_SERIAL Serial -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Manual board activation -//////////////////////////////////////////////////////////////////////////////// - -/* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */ -#define USE_UHS_MEGA_ADK 0 // If you are using Arduino 1.5.5 or newer there is no need to do this manually - -/* Set this to 1 if you are using a Black Widdow */ -#define USE_UHS_BLACK_WIDDOW 0 - -/* Set this to a one to use the xmem2 lock. This is needed for multitasking and threading */ -#define USE_XMEM_SPI_LOCK 0 - -//////////////////////////////////////////////////////////////////////////////// -// Wii IR camera -//////////////////////////////////////////////////////////////////////////////// - -/* Set this to 1 to activate code for the Wii IR camera */ -#define ENABLE_WII_IR_CAMERA 0 - -//////////////////////////////////////////////////////////////////////////////// -// MASS STORAGE -//////////////////////////////////////////////////////////////////////////////// -// ******* IMPORTANT ******* -// Set this to 1 to support single LUN devices, and save RAM. -- I.E. thumb drives. -// Each LUN needs ~13 bytes to be able to track the state of each unit. -#ifndef MASS_MAX_SUPPORTED_LUN - #define MASS_MAX_SUPPORTED_LUN 8 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Set to 1 to use the faster spi4teensy3 driver. -//////////////////////////////////////////////////////////////////////////////// -#ifndef USE_SPI4TEENSY3 - #define USE_SPI4TEENSY3 1 -#endif - -// Disabled on the Teensy LC, as it is incompatible for now -#ifdef __MKL26Z64__ - #undef USE_SPI4TEENSY3 - #define USE_SPI4TEENSY3 0 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// AUTOMATIC Settings -//////////////////////////////////////////////////////////////////////////////// - -// No user serviceable parts below this line. -// DO NOT change anything below here unless you are a developer! - -//#include "version_helper.h" - -#if defined(__GNUC__) && defined(__AVR__) - #ifndef GCC_VERSION - #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) - #endif - #if GCC_VERSION < 40602 // Test for GCC < 4.6.2 - #ifdef PROGMEM - #undef PROGMEM - #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4 - #ifdef PSTR - #undef PSTR - #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source - #endif - #endif - #endif -#endif - -#if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING - #define DEBUG_USB_HOST -#endif - -#if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA - #define WIICAMERA -#endif - -// To use some other locking (e.g. freertos), -// 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. -#ifndef XMEM_ACQUIRE_SPI - #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API) - #include - #else - #define XMEM_ACQUIRE_SPI() (void(0)) - #define XMEM_RELEASE_SPI() (void(0)) - #endif -#endif - -#if !defined(EXT_RAM) && defined(EXT_RAM_STACK) || defined(EXT_RAM_HEAP) - #include -#else - #define EXT_RAM 0 -#endif - -#if defined(CORE_TEENSY) && defined(KINETISK) - #define USING_SPI4TEENSY3 USE_SPI4TEENSY3 -#else - #define USING_SPI4TEENSY3 0 -#endif -#if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3 - #include // Use the Arduino SPI library for the Arduino Due, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available -#endif -#ifdef RBL_NRF51822 - #include - #include - #define SPI SPI_Master - #define MFK_CASTUINT8T (uint8_t) // RBLs return type for sizeof needs casting to uint8_t -#endif -#if defined(__PIC32MX__) || defined(__PIC32MZ__) - #include <../../../../hardware/pic32/libraries/SPI/SPI.h> // Hack to use the SPI library -#endif - -#if defined(ESP8266) || defined(ESP32) - #define MFK_CASTUINT8T (uint8_t) // ESP return type for sizeof needs casting to uint8_t -#endif - -#ifdef STM32F4 - #include "stm32f4xx_hal.h" - extern SPI_HandleTypeDef SPI_Handle; // Needed to be declared in your main.cpp -#endif - -// Fix defines on Arduino Due -#ifdef ARDUINO_SAM_DUE - #ifdef tokSETUP - #undef tokSETUP - #endif - #ifdef tokIN - #undef tokIN - #endif - #ifdef tokOUT - #undef tokOUT - #endif - #ifdef tokINHS - #undef tokINHS - #endif - #ifdef tokOUTHS - #undef tokOUTHS - #endif -#endif - -// Set defaults -#ifndef MFK_CASTUINT8T - #define MFK_CASTUINT8T -#endif - -// Workaround issue: https://github.com/esp8266/Arduino/issues/2078 -#ifdef ESP8266 - #undef PROGMEM - #define PROGMEM -#undef PSTR - #define PSTR(s) (s) -#undef pgm_read_byte - #define pgm_read_byte(addr) (*reinterpret_cast(addr)) - #undef pgm_read_word - #define pgm_read_word(addr) (*reinterpret_cast(addr)) -#endif - -#ifdef ARDUINO_ESP8266_WIFIO - #error "This board is currently not supported" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h deleted file mode 100644 index 039215b1bb..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact information - * ------------------- - * - * Circuits At Home, LTD - * Web : http://www.circuitsathome.com - * e-mail : support@circuitsathome.com - */ - -#ifndef _usb_h_ - #error "Never include usb_ch9.h directly; include Usb.h instead" -#endif - -/* USB chapter 9 structures */ - -/* Misc.USB constants */ -#define DEV_DESCR_LEN 18 //device descriptor length -#define CONF_DESCR_LEN 9 //configuration descriptor length -#define INTR_DESCR_LEN 9 //interface descriptor length -#define EP_DESCR_LEN 7 //endpoint descriptor length - -/* Standard Device Requests */ - -#define USB_REQUEST_GET_STATUS 0 // Standard Device Request - GET STATUS -#define USB_REQUEST_CLEAR_FEATURE 1 // Standard Device Request - CLEAR FEATURE -#define USB_REQUEST_SET_FEATURE 3 // Standard Device Request - SET FEATURE -#define USB_REQUEST_SET_ADDRESS 5 // Standard Device Request - SET ADDRESS -#define USB_REQUEST_GET_DESCRIPTOR 6 // Standard Device Request - GET DESCRIPTOR -#define USB_REQUEST_SET_DESCRIPTOR 7 // Standard Device Request - SET DESCRIPTOR -#define USB_REQUEST_GET_CONFIGURATION 8 // Standard Device Request - GET CONFIGURATION -#define USB_REQUEST_SET_CONFIGURATION 9 // Standard Device Request - SET CONFIGURATION -#define USB_REQUEST_GET_INTERFACE 10 // Standard Device Request - GET INTERFACE -#define USB_REQUEST_SET_INTERFACE 11 // Standard Device Request - SET INTERFACE -#define USB_REQUEST_SYNCH_FRAME 12 // Standard Device Request - SYNCH FRAME - -#define USB_FEATURE_ENDPOINT_HALT 0 // CLEAR/SET FEATURE - Endpoint Halt -#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // CLEAR/SET FEATURE - Device remote wake-up -#define USB_FEATURE_TEST_MODE 2 // CLEAR/SET FEATURE - Test mode - -/* Setup Data Constants */ - -#define USB_SETUP_HOST_TO_DEVICE 0x00 // Device Request bmRequestType transfer direction - host to device transfer -#define USB_SETUP_DEVICE_TO_HOST 0x80 // Device Request bmRequestType transfer direction - device to host transfer -#define USB_SETUP_TYPE_STANDARD 0x00 // Device Request bmRequestType type - standard -#define USB_SETUP_TYPE_CLASS 0x20 // Device Request bmRequestType type - class -#define USB_SETUP_TYPE_VENDOR 0x40 // Device Request bmRequestType type - vendor -#define USB_SETUP_RECIPIENT_DEVICE 0x00 // Device Request bmRequestType recipient - device -#define USB_SETUP_RECIPIENT_INTERFACE 0x01 // Device Request bmRequestType recipient - interface -#define USB_SETUP_RECIPIENT_ENDPOINT 0x02 // Device Request bmRequestType recipient - endpoint -#define USB_SETUP_RECIPIENT_OTHER 0x03 // Device Request bmRequestType recipient - other - -/* USB descriptors */ - -#define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor. -#define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor. -#define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor. -#define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor. -#define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor. -#define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier. -#define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration. -#define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power. -#define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor. - -#define HID_DESCRIPTOR_HID 0x21 - - -/* OTG SET FEATURE Constants */ -#define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP -#define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP -#define OTG_FEATURE_A_ALT_HNP_SUPPORT 5 // SET FEATURE OTG - Another port on the A device supports HNP - -/* USB Endpoint Transfer Types */ -#define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint. -#define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint. -#define USB_TRANSFER_TYPE_BULK 0x02 // Endpoint is a bulk endpoint. -#define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint. -#define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes - - -/* Standard Feature Selectors for CLEAR_FEATURE Requests */ -#define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient -#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient -#define USB_FEATURE_TEST_MODE 2 // Device recipient - -/* descriptor data structures */ - -/* Device descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // DEVICE descriptor type (USB_DESCRIPTOR_DEVICE). - uint16_t bcdUSB; // USB Spec Release Number (BCD). - uint8_t bDeviceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bDeviceSubClass; // Subclass code (assigned by the USB-IF). - uint8_t bDeviceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bMaxPacketSize0; // Maximum packet size for endpoint 0. - uint16_t idVendor; // Vendor ID (assigned by the USB-IF). - uint16_t idProduct; // Product ID (assigned by the manufacturer). - uint16_t bcdDevice; // Device release number (BCD). - uint8_t iManufacturer; // Index of String Descriptor describing the manufacturer. - uint8_t iProduct; // Index of String Descriptor describing the product. - uint8_t iSerialNumber; // Index of String Descriptor with the device's serial number. - uint8_t bNumConfigurations; // Number of possible configurations. -} __attribute__((packed)) USB_DEVICE_DESCRIPTOR; - -/* Configuration descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // CONFIGURATION descriptor type (USB_DESCRIPTOR_CONFIGURATION). - uint16_t wTotalLength; // Total length of all descriptors for this configuration. - uint8_t bNumInterfaces; // Number of interfaces in this configuration. - uint8_t bConfigurationValue; // Value of this configuration (1 based). - uint8_t iConfiguration; // Index of String Descriptor describing the configuration. - uint8_t bmAttributes; // Configuration characteristics. - uint8_t bMaxPower; // Maximum power consumed by this configuration. -} __attribute__((packed)) USB_CONFIGURATION_DESCRIPTOR; - -/* Interface descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // INTERFACE descriptor type (USB_DESCRIPTOR_INTERFACE). - uint8_t bInterfaceNumber; // Number of this interface (0 based). - uint8_t bAlternateSetting; // Value of this alternate interface setting. - uint8_t bNumEndpoints; // Number of endpoints in this interface. - uint8_t bInterfaceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bInterfaceSubClass; // Subclass code (assigned by the USB-IF). - uint8_t bInterfaceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t iInterface; // Index of String Descriptor describing the interface. -} __attribute__((packed)) USB_INTERFACE_DESCRIPTOR; - -/* Endpoint descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // ENDPOINT descriptor type (USB_DESCRIPTOR_ENDPOINT). - uint8_t bEndpointAddress; // Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN). - uint8_t bmAttributes; // Endpoint transfer type. - uint16_t wMaxPacketSize; // Maximum packet size. - uint8_t bInterval; // Polling interval in frames. -} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR; - -/* HID descriptor */ -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdHID; // HID class specification release - uint8_t bCountryCode; - uint8_t bNumDescriptors; // Number of additional class specific descriptors - uint8_t bDescrType; // Type of class descriptor - uint16_t wDescriptorLength; // Total size of the Report descriptor -} __attribute__((packed)) USB_HID_DESCRIPTOR; - -typedef struct { - uint8_t bDescrType; // Type of class descriptor - uint16_t wDescriptorLength; // Total size of the Report descriptor -} __attribute__((packed)) HID_CLASS_DESCRIPTOR_LEN_AND_TYPE; diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp deleted file mode 100644 index 16051b34c3..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/**************** - * usb_host.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: . * - ****************************************************************************/ - -/* What follows is a modified version of the MAX3421e originally defined in - * lib/usbhost.c". This has been rewritten to use SPI routines from the - * Marlin HAL */ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) - -#include "Usb.h" -#include "usbhost.h" - -uint8_t MAX3421e::vbusState = 0; - -// constructor -void MAX3421e::cs() { - WRITE(USB_CS_PIN,0); -} - -void MAX3421e::ncs() { - WRITE(USB_CS_PIN,1); -} - -// write single byte into MAX3421 register -void MAX3421e::regWr(uint8_t reg, uint8_t data) { - cs(); - spiSend(reg | 0x02); - spiSend(data); - ncs(); -}; - -// multiple-byte write -// return a pointer to memory position after last written -uint8_t* MAX3421e::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { - cs(); - spiSend(reg | 0x02); - while (nbytes--) spiSend(*data_p++); - ncs(); - return data_p; -} - -// GPIO write -// GPIO byte is split between 2 registers, so two writes are needed to write one byte - -// GPOUT bits are in the low nybble. 0-3 in IOPINS1, 4-7 in IOPINS2 -void MAX3421e::gpioWr(uint8_t data) { - regWr(rIOPINS1, data); - regWr(rIOPINS2, data >> 4); -} - -// single host register read -uint8_t MAX3421e::regRd(uint8_t reg) { - cs(); - spiSend(reg); - uint8_t rv = spiRec(); - ncs(); - return rv; -} -// multiple-byte register read - -// return a pointer to a memory position after last read -uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { - cs(); - spiSend(reg); - while (nbytes--) *data_p++ = spiRec(); - ncs(); - return data_p; -} -// GPIO read. See gpioWr for explanation - -// GPIN pins are in high nybbles of IOPINS1, IOPINS2 -uint8_t MAX3421e::gpioRd() { - return (regRd(rIOPINS2) & 0xf0) | // pins 4-7, clean lower nybble - (regRd(rIOPINS1) >> 4); // shift low bits and OR with upper from previous operation. -} - -// reset MAX3421e. Returns false if PLL failed to stabilize 1 second after reset -bool MAX3421e::reset() { - regWr(rUSBCTL, bmCHIPRES); - regWr(rUSBCTL, 0x00); - for (uint8_t i = 100; i--;) { - if (regRd(rUSBIRQ) & bmOSCOKIRQ) return true; - delay(10); - } - return false; -} - -// initialize MAX3421e. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not -bool MAX3421e::start() { - // Initialize pins and SPI bus - - SET_OUTPUT(USB_CS_PIN); - SET_INPUT_PULLUP(USB_INTR_PIN); - ncs(); - spiBegin(); - - spiInit( - #ifdef SPI_SPEED - SPI_SPEED - #else - SPI_FULL_SPEED - #endif - ); - - // MAX3421e - full-duplex, level interrupt, vbus off. - regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | GPX_VBDET)); - - const uint8_t revision = regRd(rREVISION); - if (revision == 0x00 || revision == 0xFF) { - SERIAL_ECHOLNPAIR("Revision register appears incorrect on MAX3421e initialization. Got ", revision); - return false; - } - - if (!reset()) { - SERIAL_ECHOLNPGM("OSCOKIRQ hasn't asserted in time"); - return false; - } - - // Delay a minimum of 1 second to ensure any capacitors are drained. - // 1 second is required to make sure we do not smoke a Microdrive! - - delay(1000); - - regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host - regWr(rHIEN, bmCONDETIE | bmFRAMEIE); // connection detection - - // check if device is connected - regWr(rHCTL, bmSAMPLEBUS); // sample USB bus - while (!(regRd(rHCTL) & bmSAMPLEBUS)) delay(10); // wait for sample operation to finish - - busprobe(); // check if anything is connected - - regWr(rHIRQ, bmCONDETIRQ); // clear connection detect interrupt - regWr(rCPUCTL, 0x01); // enable interrupt pin - - // GPX pin on. This is done here so that busprobe will fail if we have a switch connected. - regWr(rPINCTL, bmFDUPSPI | bmINTLEVEL); - - return true; -} - -// Probe bus to determine device presence and speed. Switch host to this speed. -void MAX3421e::busprobe() { - // Switch on just the J & K bits - switch (regRd(rHRSL) & (bmJSTATUS | bmKSTATUS)) { - case bmJSTATUS: - if ((regRd(rMODE) & bmLOWSPEED) == 0) { - regWr(rMODE, MODE_FS_HOST); // start full-speed host - vbusState = FSHOST; - } - else { - regWr(rMODE, MODE_LS_HOST); // start low-speed host - vbusState = LSHOST; - } - break; - case bmKSTATUS: - if ((regRd(rMODE) & bmLOWSPEED) == 0) { - regWr(rMODE, MODE_LS_HOST); // start low-speed host - vbusState = LSHOST; - } - else { - regWr(rMODE, MODE_FS_HOST); // start full-speed host - vbusState = FSHOST; - } - break; - case bmSE1: // illegal state - vbusState = SE1; - break; - case bmSE0: // disconnected state - regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST | bmSEPIRQ); - vbusState = SE0; - break; - } -} - -// MAX3421 state change task and interrupt handler -uint8_t MAX3421e::Task() { - return READ(USB_INTR_PIN) ? 0 : IntHandler(); -} - -uint8_t MAX3421e::IntHandler() { - uint8_t HIRQ = regRd(rHIRQ), // determine interrupt source - HIRQ_sendback = 0x00; - if (HIRQ & bmCONDETIRQ) { - busprobe(); - HIRQ_sendback |= bmCONDETIRQ; - } - // End HIRQ interrupts handling, clear serviced IRQs - regWr(rHIRQ, HIRQ_sendback); - return HIRQ_sendback; -} - -#endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h deleted file mode 100644 index 8fdad47ac2..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h +++ /dev/null @@ -1,58 +0,0 @@ -/************** - * usb_host.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 - -/* This the following comes from "lib/usbhost.h", but has been rewritten - * to use the SPI functions from Marlin's HAL */ - -class MAX3421e { - private: - static uint8_t vbusState; - void cs(); - void ncs(); - - uint8_t GpxHandler(); - uint8_t IntHandler(); - - public: - bool start(); - - void regWr(uint8_t reg, uint8_t data); - uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p); - void gpioWr(uint8_t data); - uint8_t regRd(uint8_t reg); - uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p); - uint8_t gpioRd(); - bool reset(); - - uint8_t getVbusState() {return vbusState;}; - - void busprobe(); - - uint8_t Task(); -}; - -#define USE_MARLIN_MAX3421E - -#if defined(__SAM3X8E__) && !defined(ARDUINO_SAM_DUE) - #define ARDUINO_SAM_DUE // Spoof the USB library that this is a DUE -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt deleted file mode 100644 index 710b3f20b5..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -==== USB HOST SHIELD 3.0 LIBRARY ==== - -The lib-uhs3/ folder contains a subset of the files from the USB Host Shield -3.0 library: - - https://github.com/felis/UHS30 - - -==== LICENSE SUMMARY ==== - -Source Path: Repository: License: ------------- ----------- -------- -usb_flashdrive/lib github.com/felis/UHS30 GPLv2 or later - - -==== MARLIN INTEGRATION WORK ==== - -All additional work done to integrate USB into Marlin was performed by -AlephObjects, Inc. and is licensed under the GPLv3. - -This version of UHS3 has been modified for better compatibility with Marlin. -The upstream version of UHS 3.0 runs a frame timer interrupt every 1 ms to -handle device polling. This timer interrupt interferes with Marlin's stepper -IRQ, so the flag USB_HOST_MANUAL_POLL has been added to move the polling to -the idle task. Additional logic was added to disable and enable the frame -IRQ. - -SKIP_PAGE3F and USB_NO_TEST_UNIT_READY were added to work around bugs with -certain devices. - --- marcio@alephobjects.com diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h deleted file mode 100644 index 6ad9cb5c8d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and - Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef __UHS_BULK_STORAGE_H__ -#define __UHS_BULK_STORAGE_H__ - - -//////////////////////////////////////////////////////////////////////////////// -// Define any of these options at the top of your sketch to override -// the defaults contained herewith. Do NOT do modifications here. -// Macro | Settings and notes | Default -// -----------------------------------------+-----------------------+----------- -// | 1 to 8 | -// | Each LUN needs | -// MASS_MAX_SUPPORTED_LUN | ~13 bytes to be able | 8 -// | to track the state of | -// | each unit. | -// -----------------------------------------+-----------------------+----------- -// | Just define to use. | -// DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE | works only if extra | -// | huge debug is on too. | -// -----------------------------------------^-----------------------^----------- - -#ifndef MASS_MAX_SUPPORTED_LUN -#define MASS_MAX_SUPPORTED_LUN 8 -#endif - -#include "UHS_SCSI.h" - -#define UHS_BULK_bmREQ_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -#define UHS_BULK_bmREQ_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE - -// Request Codes -#define UHS_BULK_REQ_ADSC 0x00U -#define UHS_BULK_REQ_GET 0xFCU -#define UHS_BULK_REQ_PUT 0xFDU -#define UHS_BULK_REQ_GET_MAX_LUN 0xFEU -#define UHS_BULK_REQ_BOMSR 0xFFU // Mass Storage Reset - -#define UHS_BULK_CBW_SIGNATURE 0x43425355LU -#define UHS_BULK_CSW_SIGNATURE 0x53425355LU - -#define UHS_BULK_CMD_DIR_OUT 0x00U -#define UHS_BULK_CMD_DIR_IN 0x80U - -/* Bulk error codes */ -#define UHS_BULK_ERR_SUCCESS UHS_HOST_ERROR_NONE -#define UHS_BULK_ERR_PHASE_ERROR 0x22U -#define UHS_BULK_ERR_UNIT_NOT_READY 0x23U -#define UHS_BULK_ERR_UNIT_BUSY 0x24U -#define UHS_BULK_ERR_STALL 0x25U -#define UHS_BULK_ERR_CMD_NOT_SUPPORTED 0x26U -#define UHS_BULK_ERR_INVALID_CSW 0x27U -#define UHS_BULK_ERR_NO_MEDIA 0x28U -#define UHS_BULK_ERR_BAD_LBA 0x29U -#define UHS_BULK_ERR_MEDIA_CHANGED 0x2AU -#define UHS_BULK_ERR_DEVICE_DISCONNECTED UHS_HOST_ERROR_UNPLUGGED -#define UHS_BULK_ERR_UNABLE_TO_RECOVER 0x32U // Reset recovery error -#define UHS_BULK_ERR_INVALID_LUN 0x33U -#define UHS_BULK_ERR_WRITE_STALL 0x34U -#define UHS_BULK_ERR_READ_NAKS 0x35U -#define UHS_BULK_ERR_WRITE_NAKS 0x36U -#define UHS_BULK_ERR_WRITE_PROTECTED 0x37U -#define UHS_BULK_ERR_NOT_IMPLEMENTED 0xFDU -#define UHS_BULK_ERR_GENERAL_SCSI_ERROR 0xF0U -#define UHS_BULK_ERR_GENERAL_USB_ERROR 0xFFU -#define UHS_BULK_ERR_USER 0xA0U // For subclasses to define their own error codes - -#define MASS_MAX_ENDPOINTS 3 - -struct UHS_BULK_CommandBlockWrapperBase { - volatile uint32_t dCBWSignature; - volatile uint32_t dCBWTag; - volatile uint32_t dCBWDataTransferLength; - volatile uint8_t bmCBWFlags; -public: - - UHS_BULK_CommandBlockWrapperBase() { - } - - UHS_BULK_CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) : - dCBWSignature(UHS_BULK_CBW_SIGNATURE), dCBWTag(tag), dCBWDataTransferLength(xflen), bmCBWFlags(flgs) { - } -} __attribute__((packed)); - -struct UHS_BULK_CommandBlockWrapper : public UHS_BULK_CommandBlockWrapperBase { - - struct { - uint8_t bmCBWLUN : 4; - uint8_t bmReserved1 : 4; - }; - - struct { - uint8_t bmCBWCBLength : 4; - uint8_t bmReserved2 : 4; - }; - - uint8_t CBWCB[16]; - -public: - // All zeroed. - - UHS_BULK_CommandBlockWrapper() : - UHS_BULK_CommandBlockWrapperBase(0, 0, 0), bmReserved1(0), bmReserved2(0) { - for(int i = 0; i < 16; i++) CBWCB[i] = 0; - } - - // Generic Wrap, CDB zeroed. - - UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd) : - UHS_BULK_CommandBlockWrapperBase(tag, xflen, flgs), - bmCBWLUN(lu), bmReserved1(0), bmCBWCBLength(cmdlen), bmReserved2(0) { - for(int i = 0; i < 16; i++) CBWCB[i] = 0; - SCSI_CDB_BASE_t *x = reinterpret_cast(CBWCB); - x->LUN = cmd; - } - - // Wrap for CDB of 6 - - UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, SCSI_CDB6_t *cdb, uint8_t dir) : - UHS_BULK_CommandBlockWrapperBase(tag, xflen, dir), - bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(6), bmReserved2(0) { - memcpy(&CBWCB, cdb, 6); - } - // Wrap for CDB of 10 - - UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, SCSI_CDB10_t *cdb, uint8_t dir) : - UHS_BULK_CommandBlockWrapperBase(tag, xflen, dir), - bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(10), bmReserved2(0) { - memcpy(&CBWCB, cdb, 10); - } -} __attribute__((packed)); - -struct UHS_BULK_CommandStatusWrapper { - uint32_t dCSWSignature; - uint32_t dCSWTag; - uint32_t dCSWDataResidue; - uint8_t bCSWStatus; -} __attribute__((packed)); - -class UHS_Bulk_Storage : public UHS_USBInterface { -protected: - static const uint8_t epDataInIndex = 1; // DataIn endpoint index - static const uint8_t epDataOutIndex = 2; // DataOUT endpoint index - static const uint8_t epInterruptInIndex = 3; // InterruptIN endpoint index - - uint8_t bMaxLUN; // Max LUN - volatile uint32_t dCBWTag; // Tag - volatile uint8_t bTheLUN; // Active LUN - volatile uint32_t CurrentCapacity[MASS_MAX_SUPPORTED_LUN]; // Total sectors - volatile uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits - volatile bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes. - volatile bool WriteOk[MASS_MAX_SUPPORTED_LUN]; - void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); - -public: - UHS_Bulk_Storage(UHS_USB_HOST_BASE *p); - - volatile UHS_EpInfo epInfo[MASS_MAX_ENDPOINTS]; - - uint8_t GetbMaxLUN() { - return bMaxLUN; // Max LUN - } - - uint8_t GetbTheLUN() { - return bTheLUN; // Active LUN - } - - bool WriteProtected(uint8_t lun); - uint8_t MediaCTL(uint8_t lun, uint8_t ctl); - uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf); - uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf); - uint8_t LockMedia(uint8_t lun, uint8_t lock); - - bool LUNIsGood(uint8_t lun); - uint32_t GetCapacity(uint8_t lun); - uint16_t GetSectorSize(uint8_t lun); - uint8_t SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); - uint8_t SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); - - - // Configure and internal methods, these should never be called by a user's sketch. - uint8_t Start(); - bool OKtoEnumerate(ENUMERATION_INFO *ei); - uint8_t SetInterface(ENUMERATION_INFO *ei); - - uint8_t GetAddress() { - return bAddress; - }; - - - void Poll(); - - void DriverDefaults(); - - -private: - void Reset(); - void CheckMedia(); - - bool IsValidCBW(uint8_t size, uint8_t *pcbw); - bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw); - bool IsValidCSW(UHS_BULK_CommandStatusWrapper *pcsw, UHS_BULK_CommandBlockWrapperBase *pcbw); - - bool CheckLUN(uint8_t lun); - - uint8_t Inquiry(uint8_t lun, uint16_t size, uint8_t *buf); - uint8_t TestUnitReady(uint8_t lun); - uint8_t RequestSense(uint8_t lun, uint16_t size, uint8_t *buf); - uint8_t ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t *buf); - uint8_t GetMaxLUN(uint8_t *max_lun); - uint8_t SetCurLUN(uint8_t lun); - uint8_t ResetRecovery(); - uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf); - uint8_t Page3F(uint8_t lun); - uint8_t ClearEpHalt(uint8_t index); - uint8_t Transaction(UHS_BULK_CommandBlockWrapper *cbw, uint16_t bsize, void *buf); - uint8_t HandleUsbError(uint8_t error, uint8_t index); - uint8_t HandleSCSIError(uint8_t status); - -}; - -#if defined(LOAD_UHS_BULK_STORAGE) && !defined(UHS_BULK_STORAGE_LOADED) -#include "UHS_BULK_STORAGE_INLINE.h" -#endif -#endif // __MASSTORAGE_H__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h deleted file mode 100644 index a171b13818..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h +++ /dev/null @@ -1,1210 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if defined(LOAD_UHS_BULK_STORAGE) && defined(__UHS_BULK_STORAGE_H__) && !defined(UHS_BULK_STORAGE_LOADED) -#define UHS_BULK_STORAGE_LOADED - -// uncomment to get 'printf' console debugging. NOT FOR UNO! -//#define DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE - -#if DEBUG_PRINTF_EXTRA_HUGE -#ifdef DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE -#define BS_HOST_DEBUG(...) printf(__VA_ARGS__) -#else -#define BS_HOST_DEBUG(...) VOID0 -#endif -#else -#define BS_HOST_DEBUG(...) VOID0 -#endif - -//////////////////////////////////////////////////////////////////////////////// - -// Interface code - -//////////////////////////////////////////////////////////////////////////////// - -/** - * Get the capacity of the media - * - * @param lun Logical Unit Number - * @return media capacity - */ -uint32_t UHS_NI UHS_Bulk_Storage::GetCapacity(uint8_t lun) { - uint32_t v = 0LU; - pUsb->DisablePoll(); - if(LUNOk[lun]) - v = CurrentCapacity[lun]; - pUsb->EnablePoll(); - return v; -} - -/** - * Get the sector (block) size used on the media - * - * @param lun Logical Unit Number - * @return media sector size - */ -uint16_t UHS_NI UHS_Bulk_Storage::GetSectorSize(uint8_t lun) { - uint16_t v = 0U; - pUsb->DisablePoll(); - if(LUNOk[lun]) - v = CurrentSectorSize[lun]; - pUsb->EnablePoll(); - return v; -} - -/** - * Test if LUN is ready for use - * - * @param lun Logical Unit Number - * @return true if LUN is ready for use - */ -bool UHS_NI UHS_Bulk_Storage::LUNIsGood(uint8_t lun) { - bool v; - pUsb->DisablePoll(); - v = LUNOk[lun]; - pUsb->EnablePoll(); - return v; -} - -/** - * Test if LUN is write protected - * - * @param lun Logical Unit Number - * @return cached status of write protect switch - */ -bool UHS_NI UHS_Bulk_Storage::WriteProtected(uint8_t lun) { - bool v; - pUsb->DisablePoll(); - v = WriteOk[lun]; - pUsb->EnablePoll(); - return v; -} - -/** - * Wrap and execute a SCSI CDB with length of 6 - * - * @param cdb CDB to execute - * @param buf_size Size of expected transaction - * @param buf Buffer - * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - pUsb->DisablePoll(); - // promote buf_size to 32bits. - UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); - -#if 0 - // Lets check the CBW here: - printf("\r\n"); - printf("\r\n"); - uint8_t *dump = (uint8_t*)(&cbw); - - for(int i=0; i<(sizeof (UHS_BULK_CommandBlockWrapper)); i++) { - printf("%02.2x ", *dump); - dump++; - } - printf("\r\n"); - printf("\r\n"); -#endif - - uint8_t v = (HandleSCSIError(Transaction(&cbw, buf_size, buf))); - pUsb->EnablePoll(); - return v; -} - -/** - * Wrap and execute a SCSI CDB with length of 10 - * - * @param cdb CDB to execute - * @param buf_size Size of expected transaction - * @param buf Buffer - * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - pUsb->DisablePoll(); - // promote buf_size to 32bits. - UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); - //SetCurLUN(cdb->LUN); - uint8_t v = (HandleSCSIError(Transaction(&cbw, buf_size, buf))); - pUsb->EnablePoll(); - return v; -} - -/** - * Lock or Unlock the tray or door on device. - * Caution: Some devices with buggy firmware will lock up. - * - * @param lun Logical Unit Number - * @param lock 1 to lock, 0 to unlock - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::LockMedia(uint8_t lun, uint8_t lock) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - pUsb->DisablePoll(); - Notify(PSTR("\r\nLockMedia\r\n"), 0x80); - Notify(PSTR("---------\r\n"), 0x80); - - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_PREVENT_REMOVAL, lun, (uint8_t)0, lock); - - uint8_t v = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)UHS_BULK_CMD_DIR_IN); - pUsb->EnablePoll(); - return v; -} - -/** - * Media control, for spindle motor and media tray or door. - * This includes CDROM, TAPE and anything with a media loader. - * - * @param lun Logical Unit Number - * @param ctl 0x00 Stop Motor, 0x01 Start Motor, 0x02 Eject Media, 0x03 Load Media - * @return 0 on success - */ -uint8_t UHS_NI UHS_Bulk_Storage::MediaCTL(uint8_t lun, uint8_t ctl) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - pUsb->DisablePoll(); - Notify(PSTR("\r\nMediaCTL\r\n"), 0x80); - Notify(PSTR("-----------------\r\n"), 0x80); - - uint8_t rcode = UHS_BULK_ERR_UNIT_NOT_READY; - if(bAddress) { - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_START_STOP_UNIT, lun, ctl & 0x03, 0); - rcode = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)UHS_BULK_CMD_DIR_OUT); - } else { - SetCurLUN(lun); - } - pUsb->EnablePoll(); - return rcode; -} - -/** - * Read data from media - * - * @param lun Logical Unit Number - * @param addr LBA address on media to read - * @param bsize size of a block (we should probably use the cached size) - * @param blocks how many blocks to read - * @param buf memory that is able to hold the requested data - * @return 0 on success - */ -uint8_t UHS_NI UHS_Bulk_Storage::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) { - if(!bAddress) return UHS_BULK_ERR_NO_MEDIA; - uint8_t er = UHS_BULK_ERR_NO_MEDIA; - pUsb->DisablePoll(); - if(LUNOk[lun]) { - Notify(PSTR("\r\nRead LUN:\t"), 0x80); - D_PrintHex (lun, 0x90); - Notify(PSTR("\r\nLBA:\t\t"), 0x90); - D_PrintHex (addr, 0x90); - Notify(PSTR("\r\nblocks:\t\t"), 0x90); - D_PrintHex (blocks, 0x90); - Notify(PSTR("\r\nblock size:\t"), 0x90); - D_PrintHex (bsize, 0x90); - Notify(PSTR("\r\n---------\r\n"), 0x80); - SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_READ_10, lun, blocks, addr); - -again: - er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), buf, (uint8_t)UHS_BULK_CMD_DIR_IN); - - if(er == UHS_BULK_ERR_STALL) { - MediaCTL(lun, 1); - - if(UHS_SLEEP_MS(150)) { - if(!TestUnitReady(lun)) goto again; - } - } - } - qNextPollTime = millis() + 100; - pUsb->EnablePoll(); - - return er; -} - -/** - * Write data to media - * - * @param lun Logical Unit Number - * @param addr LBA address on media to write - * @param bsize size of a block (we should probably use the cached size) - * @param blocks how many blocks to write - * @param buf memory that contains the data to write - * @return 0 on success - */ -uint8_t UHS_NI UHS_Bulk_Storage::Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t * buf) { - if(!bAddress) return UHS_BULK_ERR_NO_MEDIA; - uint8_t er = UHS_BULK_ERR_NO_MEDIA; - pUsb->DisablePoll(); - if(LUNOk[lun]) { - if(!WriteOk[lun]) { - er = UHS_BULK_ERR_WRITE_PROTECTED; - } else { - Notify(PSTR("\r\nWrite LUN:\t"), 0x80); - D_PrintHex (lun, 0x90); - Notify(PSTR("\r\nLBA:\t\t"), 0x90); - D_PrintHex (addr, 0x90); - Notify(PSTR("\r\nblocks:\t\t"), 0x90); - D_PrintHex (blocks, 0x90); - Notify(PSTR("\r\nblock size:\t"), 0x90); - D_PrintHex (bsize, 0x90); - Notify(PSTR("\r\n---------\r\n"), 0x80); - SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_WRITE_10, lun, blocks, addr); - -again: - er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), (void*)buf, (uint8_t)UHS_BULK_CMD_DIR_OUT); - - if(er == UHS_BULK_ERR_WRITE_STALL) { - MediaCTL(lun, 1); - - if(UHS_SLEEP_MS(150)) { - if(!TestUnitReady(lun)) goto again; - } - } - } - } - qNextPollTime = millis() + 100; - pUsb->EnablePoll(); - - return er; -} - -// End of user functions, the remaining code below is driver internals. -// Only developer serviceable parts below! - -//////////////////////////////////////////////////////////////////////////////// - -// Main driver code - -//////////////////////////////////////////////////////////////////////////////// - -UHS_NI UHS_Bulk_Storage::UHS_Bulk_Storage(UHS_USB_HOST_BASE *p) { - pUsb = p; - dCBWTag = 0; - if(pUsb) { - - DriverDefaults(); - pUsb->RegisterDeviceClass(this); - // Serial.print("Bulk Register to USB Host @ 0x"); - // Serial.println((uint32_t)pUsb, HEX); - // Serial.print("Bulk Register to USB Host Address Pool @ 0x"); - // Serial.println((uint32_t)pUsb->GetAddressPool(), HEX); - } -} - -/** - * - * @param ei Enumeration information - * @return true if this interface driver can handle this interface description - */ -bool UHS_NI UHS_Bulk_Storage::OKtoEnumerate(ENUMERATION_INFO *ei) { - BS_HOST_DEBUG("BulkOnly: checking numep %i, klass %2.2x, subklass %2.2x\r\n", ei->interface.numep, ei->klass, ei->subklass); - BS_HOST_DEBUG("BulkOnly: checking protocol %2.2x, interface.klass %2.2x, interface.subklass %2.2x\r\n", ei->protocol, ei->interface.klass, ei->interface.subklass); - BS_HOST_DEBUG("BulkOnly: checking interface.protocol %2.2x\r\n", ei->interface.protocol); - // - // TO-DO? - // Check that we have 2 bulk endpoints, and one in each direction?? - // e.g. (ei->interface.numep > 1) && // two or more endpoints AND check types - // This will work with proper hardware though. - // - - return ( - ((ei->klass == UHS_USB_CLASS_MASS_STORAGE) || (ei->interface.klass == UHS_USB_CLASS_MASS_STORAGE)) && // mass storage class AND - ((ei->subklass == UHS_BULK_SUBCLASS_SCSI) || (ei->interface.subklass == UHS_BULK_SUBCLASS_SCSI)) && // SCSI command set AND - ((ei->protocol == UHS_STOR_PROTO_BBB) || (ei->interface.protocol == UHS_STOR_PROTO_BBB)) // Bulk Only transport - ); -} - -/** - * @param ei Enumeration information - * @return 0 always - */ -uint8_t UHS_NI UHS_Bulk_Storage::SetInterface(ENUMERATION_INFO *ei) { - uint8_t index; - - bAddress = ei->address; - BS_HOST_DEBUG("BS SetInterface\r\n"); - // Fill in the endpoint info structure - for(uint8_t ep = 0; ep < ei->interface.numep; ep++) { - BS_HOST_DEBUG("ep: 0x%2.2x bmAttributes: 0x%2.2x ", ep, ei->interface.epInfo[ep].bmAttributes); - if(ei->interface.epInfo[ep].bmAttributes == USB_TRANSFER_TYPE_BULK) { - index = ((ei->interface.epInfo[ep].bEndpointAddress & USB_TRANSFER_DIRECTION_IN) == USB_TRANSFER_DIRECTION_IN) ? epDataInIndex : epDataOutIndex; - epInfo[index].epAddr = (ei->interface.epInfo[ep].bEndpointAddress & 0x0F); - epInfo[index].maxPktSize = ei->interface.epInfo[ep].wMaxPacketSize; - epInfo[index].epAttribs = 0; - epInfo[index].bmNakPower = UHS_USB_NAK_MAX_POWER; - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - epInfo[index].bIface=ei->interface.bInterfaceNumber; - BS_HOST_DEBUG("index: %i\r\n", index); - } - BS_HOST_DEBUG("\r\n"); - } - bNumEP = 3; - epInfo[0].epAddr = 0; - epInfo[0].maxPktSize = ei->bMaxPacketSize0; - epInfo[0].bmNakPower = UHS_USB_NAK_MAX_POWER; - bIface = ei->interface.bInterfaceNumber; - - return 0; -}; - -/** - * - * @return 0 for success - */ -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); - // Serial.print("Bulk Start USB Host Address Pool @ 0x"); - // Serial.println((uint32_t)pUsb->GetAddressPool(), HEX); - - BS_HOST_DEBUG("BS Start, speed: %i\r\n", pUsb->GetAddressPool()->GetUsbDevicePtr(bAddress)->speed); - BS_HOST_DEBUG("BS Start\r\n"); - rcode = pUsb->setEpInfoEntry(bAddress, bIface, 3, epInfo); - // Serial.println(rcode,HEX); - if(rcode) goto FailOnInit; - - // Do a 1 second delay before LUN query - if(!UHS_SLEEP_MS(1000)) goto FailUnPlug; - - rcode = GetMaxLUN(&bMaxLUN); - BS_HOST_DEBUG("GetMaxLUN 0x%2.2x\r\n", rcode); - if(rcode) { - goto FailGetMaxLUN; - } - if(bMaxLUN >= MASS_MAX_SUPPORTED_LUN) bMaxLUN = MASS_MAX_SUPPORTED_LUN - 1; - BS_HOST_DEBUG("MaxLUN %u\r\n", bMaxLUN); - //ErrorMessage (PSTR("MaxLUN"), bMaxLUN); - if(!UHS_SLEEP_MS(150)) goto FailUnPlug; // Delay a bit for slow firmware. (again) - - for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { - if(!UHS_SLEEP_MS(3)) goto FailUnPlug; - SCSI_Inquiry_Response response; - rcode = Inquiry(lun, sizeof (SCSI_Inquiry_Response), (uint8_t*) & response); - BS_HOST_DEBUG("Inquiry 0x%2.2x 0x%2.2x\r\n", sizeof (SCSI_Inquiry_Response), rcode); - if(rcode) { - goto FailInquiry; -#if 0 - } else { - BS_HOST_DEBUG("LUN %i `", lun); - uint8_t *buf = response.VendorID; - for(int i = 0; i < 28; i++) BS_HOST_DEBUG("%c", buf[i]); - BS_HOST_DEBUG("'\r\nQualifier %1.1X ", response.PeripheralQualifier); - BS_HOST_DEBUG("Device type %2.2X ", response.DeviceType); - BS_HOST_DEBUG("RMB %1.1X ", response.Removable); - BS_HOST_DEBUG("SSCS %1.1X ", response.SCCS); - uint8_t sv = response.Version; - BS_HOST_DEBUG("SCSI version %2.2X\r\nDevice conforms to ", sv); - switch(sv) { - case 0: - BS_HOST_DEBUG("No specific"); - break; - case 1: - BS_HOST_DEBUG("ANSI X3.131-1986 (ANSI 1)"); - break; - case 2: - BS_HOST_DEBUG("ANSI X3.131-1994 (ANSI 2)"); - break; - case 3: - BS_HOST_DEBUG("ANSI INCITS 301-1997 (SPC)"); - break; - case 4: - BS_HOST_DEBUG("ANSI INCITS 351-2001 (SPC-2)"); - break; - case 5: - BS_HOST_DEBUG("ANSI INCITS 408-2005 (SPC-4)"); - break; - case 6: - BS_HOST_DEBUG("T10/1731-D (SPC-4)"); - break; - default: - BS_HOST_DEBUG("unknown"); - } - BS_HOST_DEBUG(" standards.\r\n"); -#endif - } - } - - for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { - if(!UHS_SLEEP_MS(3)) goto FailUnPlug; - #ifndef USB_NO_TEST_UNIT_READY - uint8_t tries = 0xf0; - while((rcode = TestUnitReady(lun))) { - BS_HOST_DEBUG("\r\nTry %2.2x TestUnitReady %2.2x\r\n", tries - 0xf0, rcode); - if(rcode == 0x08) break; // break on no media, this is OK to do. - if(rcode == UHS_BULK_ERR_DEVICE_DISCONNECTED) goto FailUnPlug; - if(rcode == UHS_BULK_ERR_INVALID_CSW) goto Fail; - if(rcode != UHS_BULK_ERR_MEDIA_CHANGED) goto Fail; - if(!UHS_SLEEP_MS(2 * (tries + 1))) goto FailUnPlug; - tries++; - if(!tries) break; - } - #else - // Don't wait for the LUN to become ready, as this will - // trigger Marlin's watchdog timer - rcode = -1; - #endif - if(!UHS_SLEEP_MS(3)) goto FailUnPlug; - LockMedia(lun, 1); - if(rcode == 0x08) { - if(!UHS_SLEEP_MS(3)) goto FailUnPlug; - if(MediaCTL(lun, 1) == UHS_BULK_ERR_DEVICE_DISCONNECTED) goto FailUnPlug; // I actually have a USB stick that needs this! - } - BS_HOST_DEBUG("\r\nTry %2.2x TestUnitReady %2.2x\r\n", tries - 0xf0, rcode); - if(!rcode) { - if(!UHS_SLEEP_MS(3)) goto FailUnPlug; - BS_HOST_DEBUG("CheckLUN...\r\n"); - BS_HOST_DEBUG("%lu\r\n", millis()/1000); - // Stalls on ***some*** devices, ***WHY***?! Device SAID it is READY!! - LUNOk[lun] = CheckLUN(lun); - BS_HOST_DEBUG("%lu\r\n", millis()/1000); - if(!LUNOk[lun]) LUNOk[lun] = CheckLUN(lun); - if(!UHS_SLEEP_MS(1)) goto FailUnPlug; - BS_HOST_DEBUG("Checked LUN...\r\n"); - } else { - LUNOk[lun] = false; - } - } - - rcode = OnStart(); - - if(rcode) goto FailOnInit; - -#ifdef DEBUG_USB_HOST - USBTRACE("BS configured\r\n\r\n"); -#endif - qNextPollTime = millis() + 100; - bPollEnable = true; - - return 0; -FailUnPlug: - rcode = UHS_BULK_ERR_DEVICE_DISCONNECTED; - goto Fail; - -FailOnInit: -#ifdef DEBUG_USB_HOST - USBTRACE("OnStart:"); - goto Fail; -#endif - -FailGetMaxLUN: -#ifdef DEBUG_USB_HOST - USBTRACE("GetMaxLUN:"); - goto Fail; -#endif - -FailInquiry: -#ifdef DEBUG_USB_HOST - USBTRACE("Inquiry:"); -#endif - -Fail: -#ifdef DEBUG_USB_HOST - NotifyFail(rcode); -#endif - Release(); - - return rcode; -} - -// Base class definition of Release() used. See UHS_USBInterface class definition for details - -/** - * For driver use only. - * - * @return - */ -//void UHS_NI UHS_Bulk_Storage::Release() { -// pUsb->DisablePoll(); -// OnRelease(); -// DriverDefaults(); -// pUsb->EnablePoll(); -// return; -//} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return true if LUN is ready for use. - */ -bool UHS_NI UHS_Bulk_Storage::CheckLUN(uint8_t lun) { - uint8_t rcode; - SCSI_Capacity capacity; - for(uint8_t i = 0; i < 8; i++) capacity.data[i] = 0; - - rcode = ReadCapacity10(lun, (uint8_t*)capacity.data); - if(rcode) { - BS_HOST_DEBUG(">>>>>>>>>>>>>>>>ReadCapacity returned %i\r\n", rcode); - return false; - } -#ifdef DEBUG_USB_HOST - ErrorMessage (PSTR(">>>>>>>>>>>>>>>>CAPACITY OK ON LUN"), lun); - for(uint8_t i = 0; i < 8 /*sizeof (Capacity)*/; i++) - D_PrintHex (capacity.data[i], 0x80); - Notify(PSTR("\r\n\r\n"), 0x80); -#endif - // Only 512/1024/2048/4096 are valid values! - uint32_t c = UHS_BYTES_TO_UINT32(capacity.data[4], capacity.data[5], capacity.data[6], capacity.data[7]); - if(c != 0x0200LU && c != 0x0400LU && c != 0x0800LU && c != 0x1000LU) { - return false; - } - // Store capacity information. - CurrentSectorSize[lun] = (uint16_t)(c); // & 0xFFFF); - - CurrentCapacity[lun] = UHS_BYTES_TO_UINT32(capacity.data[0], capacity.data[1], capacity.data[2], capacity.data[3]) + 1; - if(CurrentCapacity[lun] == /*0xffffffffLU */ 0x01LU || CurrentCapacity[lun] == 0x00LU) { - // Buggy firmware will report 0xffffffff or 0 for no media -#ifdef DEBUG_USB_HOST - if(CurrentCapacity[lun]) - ErrorMessage (PSTR(">>>>>>>>>>>>>>>>BUGGY FIRMWARE. CAPACITY FAIL ON LUN"), lun); -#endif - return false; - } - if(!UHS_SLEEP_MS(20)) return false; - #ifndef SKIP_PAGE3F - Page3F(lun); - #endif - if(!TestUnitReady(lun)) return true; - - return false; -} - -/** - * For driver use only. - * - * Scan for media change on all LUNs - */ -void UHS_NI UHS_Bulk_Storage::CheckMedia() { - if(!bAddress) return; - for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { - if(TestUnitReady(lun)) { - LUNOk[lun] = false; - continue; - } - if(!LUNOk[lun]) - LUNOk[lun] = CheckLUN(lun); - } -#if 0 - BS_HOST_DEBUG("}}}}}}}}}}}}}}}}STATUS "); - for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { - if(LUNOk[lun]) - BS_HOST_DEBUG("#"); - - else BS_HOST_DEBUG("."); - } - BS_HOST_DEBUG("\r\n"); -#endif - OnPoll(); - qNextPollTime = millis() + 100; -} - -/** - * For driver use only. - * - */ -void UHS_NI UHS_Bulk_Storage::Poll() { - if((long)(millis() - qNextPollTime) >= 0L) { - - CheckMedia(); - } - - return; -} - -//////////////////////////////////////////////////////////////////////////////// - - -// SCSI code - - -//////////////////////////////////////////////////////////////////////////////// - -/** - * For driver use only. - * - * @param plun - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::GetMaxLUN(uint8_t *plun) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - uint8_t ret = pUsb->ctrlReq(bAddress, mkSETUP_PKT16(UHS_BULK_bmREQ_IN, UHS_BULK_REQ_GET_MAX_LUN, 0x0000U, bIface, 1), 1, plun); - - if(ret == UHS_HOST_ERROR_STALL) { - - *plun = 0; - Notify(PSTR("\r\nGetMaxLUN Stalled\r\n"), 0x80); - } - return 0; -} - -/** - * For driver use only. Used during Driver Start - * - * @param lun Logical Unit Number - * @param bsize - * @param buf - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::Inquiry(uint8_t lun, uint16_t bsize, uint8_t *buf) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - Notify(PSTR("\r\nInquiry\r\n"), 0x80); - Notify(PSTR("---------\r\n"), 0x80); - - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_INQUIRY, lun, 0LU, (uint8_t)bsize, 0); - uint8_t rc = SCSITransaction6(&cdb, bsize, buf, (uint8_t)UHS_BULK_CMD_DIR_IN); - - return rc; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::TestUnitReady(uint8_t lun) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - //SetCurLUN(lun); - if(!bAddress) - return UHS_BULK_ERR_UNIT_NOT_READY; - - Notify(PSTR("\r\nTestUnitReady\r\n"), 0x80); - Notify(PSTR("-----------------\r\n"), 0x80); - - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_TEST_UNIT_READY, lun, (uint8_t)0, 0); - - return SCSITransaction6(&cdb, 0, NULL, (uint8_t)UHS_BULK_CMD_DIR_IN); - -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param pc - * @param page - * @param subpage - * @param len - * @param pbuf - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t * pbuf) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - Notify(PSTR("\r\rModeSense\r\n"), 0x80); - Notify(PSTR("------------\r\n"), 0x80); - - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_MODE_SENSE_6, lun, (uint32_t)((((pc << 6) | page) << 8) | subpage), len, 0); - - return SCSITransaction6(&cdb, len, pbuf, (uint8_t)UHS_BULK_CMD_DIR_IN); -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param bsize - * @param buf - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::ReadCapacity10(uint8_t lun, uint8_t *buf) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - Notify(PSTR("\r\nReadCapacity\r\n"), 0x80); - Notify(PSTR("---------------\r\n"), 0x80); - - SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_READ_CAPACITY_10, lun); - - return SCSITransaction10(&cdb, 8, buf, (uint8_t)UHS_BULK_CMD_DIR_IN); -} - -/** - * For driver use only. - * - * Page 3F contains write protect status. - * - * @param lun Logical Unit Number to test. - * @return Write protect switch status. - */ -uint8_t UHS_NI UHS_Bulk_Storage::Page3F(uint8_t lun) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - uint8_t buf[192]; - for(int i = 0; i < 192; i++) { - buf[i] = 0x00; - } - WriteOk[lun] = true; - uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); - if(!rc) { - WriteOk[lun] = ((buf[2] & 0x80) == 0); -#ifdef DEBUG_USB_HOST - Notify(PSTR("Mode Sense: "), 0x80); - for(int i = 0; i < 4; i++) { - - D_PrintHex (buf[i], 0x80); - Notify(PSTR(" "), 0x80); - } - Notify(PSTR("\r\n"), 0x80); -#endif - } - return rc; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @param size - * @param buf - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::RequestSense(uint8_t lun, uint16_t size, uint8_t *buf) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - pUsb->DisablePoll(); - Notify(PSTR("\r\nRequestSense\r\n"), 0x80); - Notify(PSTR("----------------\r\n"), 0x80); - - SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_REQUEST_SENSE, lun, 0LU, (uint8_t)size, 0); - UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)size, &cdb, (uint8_t)UHS_BULK_CMD_DIR_IN); - uint8_t v = Transaction(&cbw, size, buf); - pUsb->EnablePoll(); - - return v; -} - - -//////////////////////////////////////////////////////////////////////////////// - - -// USB code - - -//////////////////////////////////////////////////////////////////////////////// - -/** - * For driver use only. - * - * @param index - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::ClearEpHalt(uint8_t index) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - uint8_t ret = 0; - if(index != 0) { - uint8_t ep = (index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr; - do { - ret = pUsb->EPClearHalt(bAddress, ep); - if(!UHS_SLEEP_MS(6)) break; - } while(ret == 0x01); - - if(ret) { - ErrorMessage (PSTR("ClearEpHalt"), ret); - ErrorMessage (PSTR("EP"), ep); - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - return ret; - } else { - - epInfo[index].bmSndToggle = 0; - epInfo[index].bmRcvToggle = 0; - } - } - return ret; -} - -/** - * For driver use only. - * - */ -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) { - if(!UHS_SLEEP_MS(6)) break; - } - - if(!bAddress) return; - - UHS_SLEEP_MS(2500); -} - -/** - * For driver use only. - * - * @return 0 if successful - */ -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); - qNextPollTime = millis() + 90000; - uint8_t bLastUsbError = UHS_HOST_ERROR_UNPLUGGED; - if(UHS_SLEEP_MS(6)) { - Reset(); - if(UHS_SLEEP_MS(6)) { - bLastUsbError = ClearEpHalt(epDataInIndex); - if(UHS_SLEEP_MS(6)) { - - bLastUsbError = ClearEpHalt(epDataOutIndex); - UHS_SLEEP_MS(6); - } - } - } - return bLastUsbError; -} - -/** - * For driver use only. - * - * Clear all EP data and clear all LUN status - */ -void UHS_NI UHS_Bulk_Storage::DriverDefaults() { - - pUsb->DeviceDefaults(MASS_MAX_ENDPOINTS, this); - - for(uint8_t i = 0; i < MASS_MAX_SUPPORTED_LUN; i++) { - - LUNOk[i] = false; - WriteOk[i] = false; - CurrentCapacity[i] = 0lu; - CurrentSectorSize[i] = 0; - } - - dCBWTag = 0; - bMaxLUN = 0; - bTheLUN = 0; -} - -/** - * For driver use only. - * - * @param pcsw - * @param pcbw - * @return - */ -bool UHS_NI UHS_Bulk_Storage::IsValidCSW(UHS_BULK_CommandStatusWrapper *pcsw, UHS_BULK_CommandBlockWrapperBase *pcbw) { - if(!bAddress) return false; - if(pcsw->dCSWSignature != UHS_BULK_CSW_SIGNATURE) { - Notify(PSTR("CSW:Sig error\r\n"), 0x80); - return false; - } - if(pcsw->dCSWTag != pcbw->dCBWTag) { - Notify(PSTR("CSW:Wrong tag\r\n"), 0x80); - ErrorMessage (PSTR("dCSWTag"), pcsw->dCSWTag); - ErrorMessage (PSTR("dCBWTag"), pcbw->dCBWTag); - - return false; - } - return true; -} - -/** - * For driver use only. - * - * @param error - * @param index - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::HandleUsbError(uint8_t error, uint8_t index) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - - uint8_t count = 3; - while(error && count) { - if(error != UHS_HOST_ERROR_NONE) { - ErrorMessage (PSTR("USB Error"), error); - ErrorMessage (PSTR("Index"), index); - } - switch(error) { - // case UHS_HOST_ERROR_WRONGPID: - case UHS_HOST_ERROR_NONE: - return UHS_BULK_ERR_SUCCESS; - case UHS_HOST_ERROR_BUSY: - // SIE is busy, just hang out and try again. - return UHS_BULK_ERR_UNIT_BUSY; - case UHS_HOST_ERROR_NAK: - return UHS_BULK_ERR_UNIT_BUSY; - case UHS_HOST_ERROR_UNPLUGGED: - case UHS_HOST_ERROR_TIMEOUT: - case UHS_HOST_ERROR_JERR: - return UHS_BULK_ERR_DEVICE_DISCONNECTED; - case UHS_HOST_ERROR_STALL: - if(index == 0) return UHS_BULK_ERR_STALL; - ClearEpHalt(index); - if(index != epDataInIndex) return UHS_BULK_ERR_WRITE_STALL; - return UHS_BULK_ERR_STALL; - - - case UHS_HOST_ERROR_TOGERR: - // Handle a very super rare corner case, where toggles become de-synched. - // I have only ran into one device that has this firmware bug, and this is - // the only clean way to get back into sync with the buggy device firmware. - // --AJK - if(bAddress && bConfNum) { - error = pUsb->setConf(bAddress, bConfNum); - - if(error) break; - } - return UHS_BULK_ERR_SUCCESS; - - default: - ErrorMessage (PSTR("\r\nUSB"), error); - - return UHS_BULK_ERR_GENERAL_USB_ERROR; - } - count--; - } // while - - return ((error && !count) ? UHS_BULK_ERR_GENERAL_USB_ERROR : UHS_BULK_ERR_SUCCESS); -} - -/** - * For driver use only. - * - * @param pcbw - * @param buf_size - * @param buf - * @param flags - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::Transaction(UHS_BULK_CommandBlockWrapper *pcbw, uint16_t buf_size, void *buf) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - - uint16_t bytes = buf_size; - bool write = (pcbw->bmCBWFlags & UHS_BULK_CMD_DIR_IN) != UHS_BULK_CMD_DIR_IN; - uint8_t ret = 0; - uint8_t usberr; - UHS_BULK_CommandStatusWrapper csw; // up here, we allocate ahead to save cpu cycles. - SetCurLUN(pcbw->bmCBWLUN); - ErrorMessage (PSTR("CBW.dCBWTag"), pcbw->dCBWTag); - - while((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, sizeof (UHS_BULK_CommandBlockWrapper), (uint8_t*)pcbw)) == UHS_HOST_ERROR_BUSY) { - if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - } - ret = HandleUsbError(usberr, epDataOutIndex); - if(ret) { - ErrorMessage (PSTR("============================ CBW"), ret); - } else { - if(bytes) { - if(!write) { - while((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*)buf)) == UHS_HOST_ERROR_BUSY) { - if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - } - ret = HandleUsbError(usberr, epDataInIndex); - } else { - while((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, bytes, (uint8_t*)buf)) == UHS_HOST_ERROR_BUSY) { - if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - } - ret = HandleUsbError(usberr, epDataOutIndex); - } - if(ret) { - ErrorMessage (PSTR("============================ DAT"), ret); - } - } - } - - { - bytes = sizeof (UHS_BULK_CommandStatusWrapper); - int tries = 2; - while(tries--) { - while((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*) & csw)) == UHS_HOST_ERROR_BUSY) { - if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - } - if(!usberr) break; - if(tries) { - if(usberr == UHS_HOST_ERROR_STALL) { - ResetRecovery(); - } else { - ClearEpHalt(epDataInIndex); - } - } - } - if(!ret) { - Notify(PSTR("CBW:\t\tOK\r\n"), 0x80); - Notify(PSTR("Data Stage:\tOK\r\n"), 0x80); - } else { - // Throw away csw, IT IS NOT OF ANY USE. - ResetRecovery(); - return ret; - } - ret = HandleUsbError(usberr, epDataInIndex); - if(ret) { - ErrorMessage (PSTR("============================ CSW"), ret); - } - if(usberr == UHS_HOST_ERROR_NONE) { - if(IsValidCSW(&csw, pcbw)) { - //ErrorMessage (PSTR("CSW.dCBWTag"), csw.dCSWTag); - //ErrorMessage (PSTR("bCSWStatus"), csw.bCSWStatus); - //ErrorMessage (PSTR("dCSWDataResidue"), csw.dCSWDataResidue); - Notify(PSTR("CSW:\t\tOK\r\n\r\n"), 0x80); - return csw.bCSWStatus; - } else { - // NOTE! Sometimes this is caused by the reported residue being wrong. - // Get a different device. It isn't compliant, and should have never passed Q&A. - // I own one... 05e3:0701 Genesys Logic, Inc. USB 2.0 IDE Adapter. - // Other devices that exhibit this behavior exist in the wild too. - // Be sure to check quirks in the Linux source code before reporting a bug. --xxxajk - Notify(PSTR("Invalid CSW\r\n"), 0x80); - Reset(); - ResetRecovery(); - - return UHS_BULK_ERR_INVALID_CSW; - } - } - } - return ret; -} - -/** - * For driver use only. - * - * @param lun Logical Unit Number - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::SetCurLUN(uint8_t lun) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - if(lun > bMaxLUN) - return UHS_BULK_ERR_INVALID_LUN; - bTheLUN = lun; - - return UHS_BULK_ERR_SUCCESS; -}; - -/** - * For driver use only. - * - * @param status - * @return - */ -uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) { - if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - uint8_t ret = 0; - switch(status) { - case 0: return UHS_BULK_ERR_SUCCESS; - - case 2: - ErrorMessage (PSTR("Phase Error"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - ResetRecovery(); - return UHS_BULK_ERR_GENERAL_SCSI_ERROR; - - case 1: - ErrorMessage (PSTR("SCSI Error"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - SCSI_Request_Sense_Response rsp; - - ret = RequestSense(bTheLUN, sizeof (SCSI_Request_Sense_Response), (uint8_t*) & rsp); - - if(ret) { - if(ret == UHS_BULK_ERR_DEVICE_DISCONNECTED) return UHS_BULK_ERR_DEVICE_DISCONNECTED; - return UHS_BULK_ERR_GENERAL_SCSI_ERROR; - } -#if ENABLE_UHS_DEBUGGING - ErrorMessage (PSTR("Response Code"), rsp.bResponseCode); - if(rsp.bResponseCode & 0x80) { - Notify(PSTR("Information field: "), 0x80); - for(int i = 0; i < 4; i++) { - D_PrintHex (rsp.CmdSpecificInformation[i], 0x80); - Notify(PSTR(" "), 0x80); - } - Notify(PSTR("\r\n"), 0x80); - } - ErrorMessage (PSTR("Sense Key"), rsp.bmSenseKey); - ErrorMessage (PSTR("Add Sense Code"), rsp.bAdditionalSenseCode); - ErrorMessage (PSTR("Add Sense Qual"), rsp.bAdditionalSenseQualifier); -#endif - // warning, this is not testing ASQ, only SK and ASC. - switch(rsp.bmSenseKey) { - case SCSI_S_UNIT_ATTENTION: - switch(rsp.bAdditionalSenseCode) { - case SCSI_ASC_MEDIA_CHANGED: - return UHS_BULK_ERR_MEDIA_CHANGED; - default: - return UHS_BULK_ERR_UNIT_NOT_READY; - } - case SCSI_S_NOT_READY: - switch(rsp.bAdditionalSenseCode) { - case SCSI_ASC_MEDIUM_NOT_PRESENT: - return UHS_BULK_ERR_NO_MEDIA; - default: - return UHS_BULK_ERR_UNIT_NOT_READY; - } - case SCSI_S_ILLEGAL_REQUEST: - switch(rsp.bAdditionalSenseCode) { - case SCSI_ASC_LBA_OUT_OF_RANGE: - return UHS_BULK_ERR_BAD_LBA; - default: - return UHS_BULK_ERR_CMD_NOT_SUPPORTED; - } - default: - return UHS_BULK_ERR_GENERAL_SCSI_ERROR; - } - - // case 4: return MASS_ERR_UNIT_BUSY; // Busy means retry later. - // case 0x05/0x14: we stalled out - // case 0x15/0x16: we naked out. - default: - ErrorMessage (PSTR("Gen SCSI Err"), status); - ErrorMessage (PSTR("LUN"), bTheLUN); - - return status; - } // switch -} - - -//////////////////////////////////////////////////////////////////////////////// - - -// Debugging code - - -//////////////////////////////////////////////////////////////////////////////// - -/** - * - * @param ep_ptr - */ -void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { - Notify(PSTR("Endpoint descriptor:"), 0x80); - Notify(PSTR("\r\nLength:\t\t"), 0x80); - D_PrintHex (ep_ptr->bLength, 0x80); - Notify(PSTR("\r\nType:\t\t"), 0x80); - D_PrintHex (ep_ptr->bDescriptorType, 0x80); - Notify(PSTR("\r\nAddress:\t"), 0x80); - D_PrintHex (ep_ptr->bEndpointAddress, 0x80); - Notify(PSTR("\r\nAttributes:\t"), 0x80); - D_PrintHex (ep_ptr->bmAttributes, 0x80); - Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); - D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); - Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); - D_PrintHex (ep_ptr->bInterval, 0x80); - Notify(PSTR("\r\n"), 0x80); -} - -#else -#error "Never include UHS_BULK_STORAGE_INLINE.h, include UHS_host.h instead" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h deleted file mode 100644 index 1050d70c74..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h +++ /dev/null @@ -1,327 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef UHS_SCSI_H -#define UHS_SCSI_H - -/* - * Reference documents from T10 (http://www.t10.org) - * SCSI Primary Commands - 3 (SPC-3) - * SCSI Block Commands - 2 (SBC-2) - * Multi-Media Commands - 5 (MMC-5) - */ - -/* Group 1 commands (CDB's here are should all be 6-bytes) */ -#define SCSI_CMD_TEST_UNIT_READY 0x00U -#define SCSI_CMD_REQUEST_SENSE 0x03U -#define SCSI_CMD_FORMAT_UNIT 0x04U -#define SCSI_CMD_READ_6 0x08U -#define SCSI_CMD_WRITE_6 0x0AU -#define SCSI_CMD_INQUIRY 0x12U -#define SCSI_CMD_MODE_SELECT_6 0x15U -#define SCSI_CMD_MODE_SENSE_6 0x1AU -#define SCSI_CMD_START_STOP_UNIT 0x1BU -#define SCSI_CMD_PREVENT_REMOVAL 0x1EU -/* Group 2 Commands (CDB's here are 10-bytes) */ -#define SCSI_CMD_READ_FORMAT_CAPACITIES 0x23U -#define SCSI_CMD_READ_CAPACITY_10 0x25U -#define SCSI_CMD_READ_10 0x28U -#define SCSI_CMD_WRITE_10 0x2AU -#define SCSI_CMD_SEEK_10 0x2BU -#define SCSI_CMD_ERASE_10 0x2CU -#define SCSI_CMD_WRITE_AND_VERIFY_10 0x2EU -#define SCSI_CMD_VERIFY_10 0x2FU -#define SCSI_CMD_SYNCHRONIZE_CACHE 0x35U -#define SCSI_CMD_WRITE_BUFFER 0x3BU -#define SCSI_CMD_READ_BUFFER 0x3CU -#define SCSI_CMD_READ_SUBCHANNEL 0x42U -#define SCSI_CMD_READ_TOC 0x43U -#define SCSI_CMD_READ_HEADER 0x44U -#define SCSI_CMD_PLAY_AUDIO_10 0x45U -#define SCSI_CMD_GET_CONFIGURATION 0x46U -#define SCSI_CMD_PLAY_AUDIO_MSF 0x47U -#define SCSI_CMD_PLAY_AUDIO_TI 0x48U -#define SCSI_CMD_PLAY_TRACK_REL_10 0x49U -#define SCSI_CMD_GET_EVENT_STATUS 0x4AU -#define SCSI_CMD_PAUSE_RESUME 0x4BU -#define SCSI_CMD_READ_DISC_INFORMATION 0x51U -#define SCSI_CMD_READ_TRACK_INFORMATION 0x52U -#define SCSI_CMD_RESERVE_TRACK 0x53U -#define SCSI_CMD_SEND_OPC_INFORMATION 0x54U -#define SCSI_CMD_MODE_SELECT_10 0x55U -#define SCSI_CMD_REPAIR_TRACK 0x58U -#define SCSI_CMD_MODE_SENSE_10 0x5AU -#define SCSI_CMD_CLOSE_TRACK_SESSION 0x5BU -#define SCSI_CMD_READ_BUFFER_CAPACITY 0x5CU -#define SCSI_CMD_SEND_CUE_SHEET 0x5DU -/* Group 5 Commands (CDB's here are 12-bytes) */ -#define SCSI_CMD_REPORT_LUNS 0xA0U -#define SCSI_CMD_BLANK 0xA1U -#define SCSI_CMD_SECURITY_PROTOCOL_IN 0xA2U -#define SCSI_CMD_SEND_KEY 0xA3U -#define SCSI_CMD_REPORT_KEY 0xA4U -#define SCSI_CMD_PLAY_AUDIO_12 0xA5U -#define SCSI_CMD_LOAD_UNLOAD 0xA6U -#define SCSI_CMD_SET_READ_AHEAD 0xA7U -#define SCSI_CMD_READ_12 0xA8U -#define SCSI_CMD_PLAY_TRACK_REL_12 0xA9U -#define SCSI_CMD_WRITE_12 0xAAU -#define SCSI_CMD_READ_MEDIA_SERIAL_12 0xABU -#define SCSI_CMD_GET_PERFORMANCE 0xACU -#define SCSI_CMD_READ_DVD_STRUCTURE 0xADU -#define SCSI_CMD_SECURITY_PROTOCOL_OUT 0xB5U -#define SCSI_CMD_SET_STREAMING 0xB6U -#define SCSI_CMD_READ_MSF 0xB9U -#define SCSI_CMD_SET_SPEED 0xBBU -#define SCSI_CMD_MECHANISM_STATUS 0xBDU -#define SCSI_CMD_READ_CD 0xBEU -#define SCSI_CMD_SEND_DISC_STRUCTURE 0xBFU -/* Vendor-unique Commands, included for completeness */ -#define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4U /* SONY unique */ -#define SCSI_CMD_PLAYBACK_CONTROL 0xC9U /* SONY unique */ -#define SCSI_CMD_READ_CDDA 0xD8U /* Vendor unique */ -#define SCSI_CMD_READ_CDXA 0xDBU /* Vendor unique */ -#define SCSI_CMD_READ_ALL_SUBCODES 0xDFU /* Vendor unique */ - -/* SCSI error codes */ -#define SCSI_S_NOT_READY 0x02U -#define SCSI_S_MEDIUM_ERROR 0x03U -#define SCSI_S_ILLEGAL_REQUEST 0x05U -#define SCSI_S_UNIT_ATTENTION 0x06U -#define SCSI_ASC_LBA_OUT_OF_RANGE 0x21U -#define SCSI_ASC_MEDIA_CHANGED 0x28U -#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3AU - -struct SCSI_Capacity { - uint8_t data[8]; - //uint32_t dwBlockAddress; - //uint32_t dwBlockLength; -} __attribute__((packed)); - -struct SCSI_CDB_BASE { - uint8_t Opcode; - - unsigned unused : 5; - unsigned LUN : 3; - - uint8_t info[12]; -} __attribute__((packed)); - -typedef SCSI_CDB_BASE SCSI_CDB_BASE_t; - -struct SCSI_CDB6 { - uint8_t Opcode; - - unsigned LBAMSB : 5; - unsigned LUN : 3; - - uint8_t LBAHB; - uint8_t LBALB; - uint8_t AllocationLength; - uint8_t Control; - -public: - - SCSI_CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) : - Opcode(_Opcode), LBAMSB(UHS_UINT8_BYTE2(LBA) & 0x1f), LUN(_LUN), LBAHB(UHS_UINT8_BYTE1(LBA)), LBALB(UHS_UINT8_BYTE0(LBA)), - AllocationLength(_AllocationLength), Control(_Control) { - } - - SCSI_CDB6(uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control) : - Opcode(_Opcode), LBAMSB(0), LUN(_LUN), LBAHB(0), LBALB(0), - AllocationLength(_AllocationLength), Control(_Control) { - } -} __attribute__((packed)); - -typedef SCSI_CDB6 SCSI_CDB6_t; - -struct SCSI_CDB10 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned LUN : 3; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t Misc2; - - uint8_t ALC_MB; - uint8_t ALC_LB; - - uint8_t Control; -public: - - SCSI_CDB10(uint8_t _Opcode, uint8_t _LUN) : - Opcode(_Opcode), Service_Action(0), LUN(_LUN), - LBA_L_M_MB(0), LBA_L_M_LB(0), LBA_L_L_MB(0), LBA_L_L_LB(0), - Misc2(0), ALC_MB(0), ALC_LB(0), Control(0) { - } - - SCSI_CDB10(uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA) : - Opcode(_Opcode), Service_Action(0), LUN(_LUN), - LBA_L_M_MB(UHS_UINT8_BYTE3(_LBA)), LBA_L_M_LB(UHS_UINT8_BYTE2(_LBA)), LBA_L_L_MB(UHS_UINT8_BYTE1(_LBA)), LBA_L_L_LB(UHS_UINT8_BYTE0(_LBA)), - Misc2(0), ALC_MB(UHS_UINT8_BYTE1(xflen)), ALC_LB(UHS_UINT8_BYTE0(xflen)), Control(0) { - } -} __attribute__((packed)); - -typedef SCSI_CDB10 SCSI_CDB10_t; - -struct SCSI_CDB12 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned Misc : 3; - - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - uint8_t Control; -} __attribute__((packed)); - -typedef SCSI_CDB12 SCSI_CDB12_t; - -struct SCSI_CDB_LBA32_16 { - uint8_t Opcode; - - unsigned Service_Action : 5; - unsigned Misc : 3; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t A_M_M_MB; - uint8_t A_M_M_LB; - uint8_t A_M_L_MB; - uint8_t A_M_L_LB; - - uint8_t ALC_M_MB; - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - - uint8_t Misc2; - uint8_t Control; -} __attribute__((packed)); - -struct SCSI_CDB_LBA64_16 { - uint8_t Opcode; - uint8_t Misc; - - uint8_t LBA_M_M_MB; - uint8_t LBA_M_M_LB; - uint8_t LBA_M_L_MB; - uint8_t LBA_M_L_LB; - - uint8_t LBA_L_M_MB; - uint8_t LBA_L_M_LB; - uint8_t LBA_L_L_MB; - uint8_t LBA_L_L_LB; - - uint8_t ALC_M_MB; - uint8_t ALC_M_LB; - uint8_t ALC_L_MB; - uint8_t ALC_L_LB; - - uint8_t Misc2; - uint8_t Control; -} __attribute__((packed)); - -struct SCSI_Inquiry_Response { - uint8_t DeviceType : 5; - uint8_t PeripheralQualifier : 3; - - unsigned Reserved : 7; - unsigned Removable : 1; - - uint8_t Version; - - unsigned ResponseDataFormat : 4; - unsigned HISUP : 1; - unsigned NormACA : 1; - unsigned TrmTsk : 1; - unsigned AERC : 1; - - uint8_t AdditionalLength; - - unsigned PROTECT : 1; - unsigned Res : 2; - unsigned ThreePC : 1; - unsigned TPGS : 2; - unsigned ACC : 1; - unsigned SCCS : 1; - - unsigned ADDR16 : 1; - unsigned R1 : 1; - unsigned R2 : 1; - unsigned MCHNGR : 1; - unsigned MULTIP : 1; - unsigned VS : 1; - unsigned ENCSERV : 1; - unsigned BQUE : 1; - - unsigned SoftReset : 1; - unsigned CmdQue : 1; - unsigned Reserved4 : 1; - unsigned Linked : 1; - unsigned Sync : 1; - unsigned WideBus16Bit : 1; - unsigned WideBus32Bit : 1; - unsigned RelAddr : 1; - - uint8_t VendorID[8]; - uint8_t ProductID[16]; - uint8_t RevisionID[4]; -} __attribute__((packed)); - -struct SCSI_Request_Sense_Response { - uint8_t bResponseCode; - uint8_t bSegmentNumber; - - uint8_t bmSenseKey : 4; - uint8_t bmReserved : 1; - uint8_t bmILI : 1; - uint8_t bmEOM : 1; - uint8_t bmFileMark : 1; - - uint8_t Information[4]; - uint8_t bAdditionalLength; - uint8_t CmdSpecificInformation[4]; - uint8_t bAdditionalSenseCode; - uint8_t bAdditionalSenseQualifier; - uint8_t bFieldReplaceableUnitCode; - uint8_t SenseKeySpecific[3]; -} __attribute__((packed)); - -#endif /* UHS_SCSI_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h deleted file mode 100644 index 5c60f2d183..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ -#ifndef _UHS_UNOFFICIAL_IDs_h -#define _UHS_UNOFFICIAL_IDs_h - -// Bogus unofficial and unregistered VIDs from cloners to be listed here. - -#define UHS_VID_UNOFFICIAL_JOYTECH 0x162EU // For unofficial Joytech controllers - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h deleted file mode 100644 index 417c9f6e69..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h +++ /dev/null @@ -1,2993 +0,0 @@ -/* - * USB vendor ids - * This file was generated by running python ./make-USB_IDs.py > UHS_USB_IDs.h - * Don't change it directly. - * - * Copyright 2014, Andrew J. Kroll for Circuits At Home, LTD. All rights reserved. - * - * Copyright 2012, Michal Labedzki for Tieto Corporation - * Other values imported from libghoto2/camlibs/ptp2/library.c, music-players.h - * Copyright (C) 2001-2005 Mariusz Woloszyn - * Copyright (C) 2003-2013 Marcus Meissner - * Copyright (C) 2005 Hubert Figuiere - * Copyright (C) 2009 Axel Waggershauser - * Copyright (C) 2005-2007 Richard A. Low - * Copyright (C) 2005-2012 Linus Walleij - * Copyright (C) 2007 Ted Bullock - * Copyright (C) 2012 Sony Mobile Communications AB - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * Copyright 1998 Gerald Combs - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#ifndef _UHS_USB_IDs_h_ -#define _UHS_USB_IDs_h_ -#include "UHS_UNOFFICIAL_IDs.h" - -#define UHS_VID_FRYS_ELECTRONICS 0x0001U // Fry's Electronics -#define UHS_VID_INGRAM 0x0002U // Ingram -#define UHS_VID_CLUB_MAC 0x0003U // Club Mac -#define UHS_VID_NEBRASKA_FURNITURE_MART 0x0004U // Nebraska Furniture Mart -#define UHS_VID_UNKNOWN 0x0011U // Unknown -#define UHS_VID_PLANEX 0x0053U // Planex -#define UHS_VID_DRAGONRISE 0x0079U // DragonRise Inc. -#define UHS_VID_TRUST_INTERNATIONAL_BV 0x0105U // Trust International B.V. -#define UHS_VID_IBP 0x0127U // IBP -#define UHS_VID_UNKNOWN_1 0x0145U // Unknown -#define UHS_VID_MLK 0x017cU // MLK -#define UHS_VID_TP_LINK 0x0200U // TP-Link -#define UHS_VID_CHIPSBANK_MICROELECTRONICS 0x0204U // Chipsbank Microelectronics Co., Ltd -#define UHS_VID_HANGZHOU_WORLDE 0x0218U // Hangzhou Worlde -#define UHS_VID_HUMAX 0x02adU // HUMAX Co., Ltd. -#define UHS_VID_MM300_EBOOK_READER 0x0300U // MM300 eBook Reader -#define UHS_VID_OCZ_TECHNOLOGY 0x0324U // OCZ Technology Inc -#define UHS_VID_OCZ_TECHNOLOGY_1 0x0325U // OCZ Technology Inc -#define UHS_VID_LTS 0x0386U // LTS -#define UHS_VID_SHENZHEN_SINOTE_TECH_ELECTRON 0x03d9U // Shenzhen Sinote Tech-Electron Co., Ltd -#define UHS_VID_BERND_WALTER_COMPUTER_TECHNOLOGY 0x03daU // Bernd Walter Computer Technology -#define UHS_VID_ENDPOINTS 0x03e8U // EndPoints, Inc. -#define UHS_VID_THESYS_MICROELECTRONICS 0x03e9U // Thesys Microelectronics -#define UHS_VID_DATA_BROADCASTING 0x03eaU // Data Broadcasting Corp. -#define UHS_VID_ATMEL 0x03ebU // Atmel Corp. -#define UHS_VID_IWATSU_AMERICA 0x03ecU // Iwatsu America, Inc. -#define UHS_VID_MITEL 0x03edU // Mitel Corp. -#define UHS_VID_MITSUMI 0x03eeU // Mitsumi -#define UHS_VID_HEWLETT_PACKARD 0x03f0U // Hewlett-Packard -#define UHS_VID_GENOA_TECHNOLOGY 0x03f1U // Genoa Technology -#define UHS_VID_OAK_TECHNOLOGY 0x03f2U // Oak Technology, Inc. -#define UHS_VID_ADAPTEC 0x03f3U // Adaptec, Inc. -#define UHS_VID_DIEBOLD 0x03f4U // Diebold, Inc. -#define UHS_VID_SIEMENS_ELECTROMECHANICAL 0x03f5U // Siemens Electromechanical -#define UHS_VID_EPSON_IMAGING_TECHNOLOGY_CENTER 0x03f8U // Epson Imaging Technology Center -#define UHS_VID_KEYTRONIC 0x03f9U // KeyTronic Corp. -#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 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. -#define UHS_VID_FUTURE_TECHNOLOGY_DEVICES_INTERNATIONAL 0x0403U // Future Technology Devices International, Ltd -#define UHS_VID_NCR 0x0404U // NCR Corp. -#define UHS_VID_SYNOPSYS 0x0405U // Synopsys, Inc. -#define UHS_VID_FUJITSU_ICL_COMPUTERS 0x0406U // Fujitsu-ICL Computers -#define UHS_VID_FUJITSU_PERSONAL_SYSTEMS 0x0407U // Fujitsu Personal Systems, Inc. -#define UHS_VID_QUANTA_COMPUTER 0x0408U // Quanta Computer, Inc. -#define UHS_VID_NEC 0x0409U // NEC Corp. -#define UHS_VID_KODAK 0x040aU // Kodak Co. -#define UHS_VID_WELTREND_SEMICONDUCTOR 0x040bU // Weltrend Semiconductor -#define UHS_VID_VTECH_COMPUTERS 0x040cU // VTech Computers, Ltd -#define UHS_VID_VIA_TECHNOLOGIES 0x040dU // VIA Technologies, Inc. -#define UHS_VID_MCCI 0x040eU // MCCI -#define UHS_VID_ECHO_SPEECH 0x040fU // Echo Speech Corp. -#define UHS_VID_BUFFALO_INC_FORMERLY_MELCO 0x0411U // BUFFALO INC. (formerly MelCo., Inc.) -#define UHS_VID_AWARD_SOFTWARE_INTERNATIONAL 0x0412U // Award Software International -#define UHS_VID_LEADTEK_RESEARCH 0x0413U // Leadtek Research, Inc. -#define UHS_VID_GIGA_BYTE_TECHNOLOGY 0x0414U // Giga-Byte Technology Co., Ltd -#define UHS_VID_WINBOND_ELECTRONICS 0x0416U // Winbond Electronics Corp. -#define UHS_VID_SYMBIOS_LOGIC 0x0417U // Symbios Logic -#define UHS_VID_AST_RESEARCH 0x0418U // AST Research -#define UHS_VID_SAMSUNG_INFO_SYSTEMS_AMERICA 0x0419U // Samsung Info. Systems America, Inc. -#define UHS_VID_PHOENIX_TECHNOLOGIES 0x041aU // Phoenix Technologies, Ltd -#define UHS_VID_DTV 0x041bU // d'TV -#define UHS_VID_S3 0x041dU // S3, Inc. -#define UHS_VID_CREATIVE_TECHNOLOGY 0x041eU // Creative Technology, Ltd -#define UHS_VID_LCS_TELEGRAPHICS 0x041fU // LCS Telegraphics -#define UHS_VID_CHIPS_AND_TECHNOLOGIES 0x0420U // Chips and Technologies -#define UHS_VID_NOKIA_MOBILE_PHONES 0x0421U // Nokia Mobile Phones -#define UHS_VID_ADI_SYSTEMS 0x0422U // ADI Systems, Inc. -#define UHS_VID_COMPUTER_ACCESS_TECHNOLOGY 0x0423U // Computer Access Technology Corp. -#define UHS_VID_STANDARD_MICROSYSTEMS 0x0424U // Standard Microsystems Corp. -#define UHS_VID_MOTOROLA_SEMICONDUCTORS_HK 0x0425U // Motorola Semiconductors HK, Ltd -#define UHS_VID_INTEGRATED_DEVICE_TECHNOLOGY 0x0426U // Integrated Device Technology, Inc. -#define UHS_VID_MOTOROLA_ELECTRONICS_TAIWAN 0x0427U // Motorola Electronics Taiwan, Ltd -#define UHS_VID_ADVANCED_GRAVIS_COMPUTER_TECH 0x0428U // Advanced Gravis Computer Tech, Ltd -#define UHS_VID_CIRRUS_LOGIC 0x0429U // Cirrus Logic -#define UHS_VID_ERICSSON_AUSTRIAN_AG 0x042aU // Ericsson Austrian, AG -#define UHS_VID_INTEL 0x042bU // Intel Corp. -#define UHS_VID_INNOVATIVE_SEMICONDUCTORS 0x042cU // Innovative Semiconductors, Inc. -#define UHS_VID_MICRONICS 0x042dU // Micronics -#define UHS_VID_ACER 0x042eU // Acer, Inc. -#define UHS_VID_MOLEX 0x042fU // Molex, Inc. -#define UHS_VID_SUN_MICROSYSTEMS 0x0430U // Sun Microsystems, Inc. -#define UHS_VID_ITAC_SYSTEMS 0x0431U // Itac Systems, Inc. -#define UHS_VID_UNISYS 0x0432U // Unisys Corp. -#define UHS_VID_ALPS_ELECTRIC 0x0433U // Alps Electric, Inc. -#define UHS_VID_SAMSUNG_INFO_SYSTEMS_AMERICA_1 0x0434U // Samsung Info. Systems America, Inc. -#define UHS_VID_HYUNDAI_ELECTRONICS_AMERICA 0x0435U // Hyundai Electronics America -#define UHS_VID_TAUGAGREINING_HF 0x0436U // Taugagreining HF -#define UHS_VID_FRAMATOME_CONNECTORS_USA 0x0437U // Framatome Connectors USA -#define UHS_VID_ADVANCED_MICRO_DEVICES 0x0438U // Advanced Micro Devices, Inc. -#define UHS_VID_VOICE_TECHNOLOGIES_GROUP 0x0439U // Voice Technologies Group -#define UHS_VID_LEXMARK_INTERNATIONAL 0x043dU // Lexmark International, Inc. -#define UHS_VID_LG_ELECTRONICS_USA 0x043eU // LG Electronics USA, Inc. -#define UHS_VID_RADISYS 0x043fU // RadiSys Corp. -#define UHS_VID_EIZO_NANAO 0x0440U // Eizo Nanao Corp. -#define UHS_VID_WINBOND_SYSTEMS_LAB 0x0441U // Winbond Systems Lab. -#define UHS_VID_ERICSSON 0x0442U // Ericsson, Inc. -#define UHS_VID_GATEWAY 0x0443U // Gateway, Inc. -#define UHS_VID_LUCENT_TECHNOLOGIES 0x0445U // Lucent Technologies, Inc. -#define UHS_VID_NMB_TECHNOLOGIES 0x0446U // NMB Technologies Corp. -#define UHS_VID_MOMENTUM_MICROSYSTEMS 0x0447U // Momentum Microsystems -#define UHS_VID_SHAMROCK_TECH 0x044aU // Shamrock Tech. Co., Ltd -#define UHS_VID_WSI 0x044bU // WSI -#define UHS_VID_CCLITRI 0x044cU // CCL/ITRI -#define UHS_VID_SIEMENS_NIXDORF_AG 0x044dU // Siemens Nixdorf AG -#define UHS_VID_ALPS_ELECTRIC_1 0x044eU // Alps Electric Co., Ltd -#define UHS_VID_THRUSTMASTER 0x044fU // ThrustMaster, Inc. -#define UHS_VID_DFI 0x0450U // DFI, Inc. -#define UHS_VID_TEXAS_INSTRUMENTS 0x0451U // Texas Instruments, Inc. -#define UHS_VID_MITSUBISHI_ELECTRONICS_AMERICA 0x0452U // Mitsubishi Electronics America, Inc. -#define UHS_VID_CMD_TECHNOLOGY 0x0453U // CMD Technology -#define UHS_VID_VOBIS_MICROCOMPUTER_AG 0x0454U // Vobis Microcomputer AG -#define UHS_VID_TELEMATICS_INTERNATIONAL 0x0455U // Telematics International, Inc. -#define UHS_VID_ANALOG_DEVICES 0x0456U // Analog Devices, Inc. -#define UHS_VID_SILICON_INTEGRATED_SYSTEMS 0x0457U // Silicon Integrated Systems Corp. -#define UHS_VID_KYE_SYSTEMS_CORP_MOUSE_SYSTEMS 0x0458U // KYE Systems Corp. (Mouse Systems) -#define UHS_VID_ADOBE_SYSTEMS 0x0459U // Adobe Systems, Inc. -#define UHS_VID_SONICBLUE 0x045aU // SONICblue, Inc. -#define UHS_VID_HITACHI 0x045bU // Hitachi, Ltd -#define UHS_VID_NORTEL_NETWORKS 0x045dU // Nortel Networks, Ltd -#define UHS_VID_MICROSOFT 0x045eU // Microsoft Corp. -#define UHS_VID_ACE_CAD_ENTERPRISE 0x0460U // Ace Cad Enterprise Co., Ltd -#define UHS_VID_PRIMAX_ELECTRONICS 0x0461U // Primax Electronics, Ltd -#define UHS_VID_MGE_UPS_SYSTEMS 0x0463U // MGE UPS Systems -#define UHS_VID_AMPTYCOELECTRONICS 0x0464U // AMP/Tycoelectronics Corp. -#define UHS_VID_ATANDT_PARADYNE 0x0467U // AT&T Paradyne -#define UHS_VID_WIESON_TECHNOLOGIES 0x0468U // Wieson Technologies Co., Ltd -#define UHS_VID_CHERRY 0x046aU // Cherry GmbH -#define UHS_VID_AMERICAN_MEGATRENDS 0x046bU // American Megatrends, Inc. -#define UHS_VID_TOSHIBA_CORP_DIGITAL_MEDIA_EQUIPMENT 0x046cU // Toshiba Corp., Digital Media Equipment -#define UHS_VID_LOGITECH 0x046dU // Logitech, Inc. -#define UHS_VID_BEHAVIOR_TECH_COMPUTER 0x046eU // Behavior Tech. Computer Corp. -#define UHS_VID_CRYSTAL_SEMICONDUCTOR 0x046fU // Crystal Semiconductor -#define UHS_VID_PHILIPS_OR_NXP 0x0471U // Philips (or NXP) -#define UHS_VID_CHICONY_ELECTRONICS 0x0472U // Chicony Electronics Co., Ltd -#define UHS_VID_SANYO_INFORMATION_BUSINESS 0x0473U // Sanyo Information Business Co., Ltd -#define UHS_VID_SANYO_ELECTRIC 0x0474U // Sanyo Electric Co., Ltd -#define UHS_VID_RELISYSTECO_INFORMATION_SYSTEM 0x0475U // Relisys/Teco Information System -#define UHS_VID_AESP 0x0476U // AESP -#define UHS_VID_SEAGATE_TECHNOLOGY 0x0477U // Seagate Technology, Inc. -#define UHS_VID_CONNECTIX 0x0478U // Connectix Corp. -#define UHS_VID_ADVANCED_PERIPHERAL_LABORATORIES 0x0479U // Advanced Peripheral Laboratories -#define UHS_VID_SEMTECH 0x047aU // Semtech Corp. -#define UHS_VID_SILITEK 0x047bU // Silitek Corp. -#define UHS_VID_DELL_COMPUTER 0x047cU // Dell Computer Corp. -#define UHS_VID_KENSINGTON 0x047dU // Kensington -#define UHS_VID_AGERE_SYSTEMS_INC_LUCENT 0x047eU // Agere Systems, Inc. (Lucent) -#define UHS_VID_PLANTRONICS 0x047fU // Plantronics, Inc. -#define UHS_VID_TOSHIBA_AMERICA 0x0480U // Toshiba America Inc -#define UHS_VID_ZENITH_DATA_SYSTEMS 0x0481U // Zenith Data Systems -#define UHS_VID_KYOCERA 0x0482U // Kyocera Corp. -#define UHS_VID_STMICROELECTRONICS 0x0483U // STMicroelectronics -#define UHS_VID_SPECIALIX 0x0484U // Specialix -#define UHS_VID_NOKIA_MONITORS 0x0485U // Nokia Monitors -#define UHS_VID_ASUS_COMPUTERS 0x0486U // ASUS Computers, Inc. -#define UHS_VID_STEWART_CONNECTOR 0x0487U // Stewart Connector -#define UHS_VID_CIRQUE 0x0488U // Cirque Corp. -#define UHS_VID_FOXCONN_HON_HAI 0x0489U // Foxconn / Hon Hai -#define UHS_VID_S_MOS_SYSTEMS 0x048aU // S-MOS Systems, Inc. -#define UHS_VID_ALPS_ELECTRIC_IRELAND 0x048cU // Alps Electric Ireland, Ltd -#define UHS_VID_INTEGRATED_TECHNOLOGY_EXPRESS 0x048dU // Integrated Technology Express, Inc. -#define UHS_VID_EICON_TECH 0x048fU // Eicon Tech. -#define UHS_VID_UNITED_MICROELECTRONICS 0x0490U // United Microelectronics Corp. -#define UHS_VID_CAPETRONIC 0x0491U // Capetronic -#define UHS_VID_SAMSUNG_SEMICONDUCTOR 0x0492U // Samsung SemiConductor, Inc. -#define UHS_VID_MAG_TECHNOLOGY 0x0493U // MAG Technology Co., Ltd -#define UHS_VID_ESS_TECHNOLOGY 0x0495U // ESS Technology, Inc. -#define UHS_VID_MICRON_ELECTRONICS 0x0496U // Micron Electronics -#define UHS_VID_SMILE_INTERNATIONAL 0x0497U // Smile International -#define UHS_VID_CAPETRONIC_KAOHSIUNG 0x0498U // Capetronic (Kaohsiung) Corp. -#define UHS_VID_YAMAHA 0x0499U // Yamaha Corp. -#define UHS_VID_GANDALF_TECHNOLOGIES 0x049aU // Gandalf Technologies, Ltd -#define UHS_VID_CURTIS_COMPUTER_PRODUCTS 0x049bU // Curtis Computer Products -#define UHS_VID_ACER_ADVANCED_LABS 0x049cU // Acer Advanced Labs, Inc. -#define UHS_VID_VLSI_TECHNOLOGY 0x049dU // VLSI Technology -#define UHS_VID_COMPAQ_COMPUTER 0x049fU // Compaq Computer Corp. -#define UHS_VID_DIGITAL_EQUIPMENT 0x04a0U // Digital Equipment Corp. -#define UHS_VID_SYSTEMSOFT 0x04a1U // SystemSoft Corp. -#define UHS_VID_FIREPOWER_SYSTEMS 0x04a2U // FirePower Systems -#define UHS_VID_TRIDENT_MICROSYSTEMS 0x04a3U // Trident Microsystems, Inc. -#define UHS_VID_HITACHI_1 0x04a4U // Hitachi, Ltd -#define UHS_VID_ACER_PERIPHERALS_INC_NOW_BENQ 0x04a5U // Acer Peripherals Inc. (now BenQ Corp.) -#define UHS_VID_NOKIA_DISPLAY_PRODUCTS 0x04a6U // Nokia Display Products -#define UHS_VID_VISIONEER 0x04a7U // Visioneer -#define UHS_VID_MULTIVIDEO_LABS 0x04a8U // Multivideo Labs, Inc. -#define UHS_VID_CANON 0x04a9U // Canon, Inc. -#define UHS_VID_DAEWOO_TELECOM 0x04aaU // DaeWoo Telecom, Ltd -#define UHS_VID_CHROMATIC_RESEARCH 0x04abU // Chromatic Research -#define UHS_VID_MICRO_AUDIOMETRICS 0x04acU // Micro Audiometrics Corp. -#define UHS_VID_DOOIN_ELECTRONICS 0x04adU // Dooin Electronics -#define UHS_VID_WINNOV_LP 0x04afU // Winnov L.P. -#define UHS_VID_NIKON 0x04b0U // Nikon Corp. -#define UHS_VID_PAN_INTERNATIONAL 0x04b1U // Pan International -#define UHS_VID_IBM 0x04b3U // IBM Corp. -#define UHS_VID_CYPRESS_SEMICONDUCTOR 0x04b4U // Cypress Semiconductor Corp. -#define UHS_VID_ROHM_LSI_SYSTEMS_USA 0x04b5U // ROHM LSI Systems USA, LLC -#define UHS_VID_HINT 0x04b6U // Hint Corp. -#define UHS_VID_COMPAL_ELECTRONICS 0x04b7U // Compal Electronics, Inc. -#define UHS_VID_SEIKO_EPSON 0x04b8U // Seiko Epson Corp. -#define UHS_VID_RAINBOW_TECHNOLOGIES 0x04b9U // Rainbow Technologies, Inc. -#define UHS_VID_TOUCAN_SYSTEMS 0x04baU // Toucan Systems, Ltd -#define UHS_VID_I_O_DATA_DEVICE 0x04bbU // I-O Data Device, Inc. -#define UHS_VID_TOSHIBA_ELECTRONICS_TAIWAN 0x04bdU // Toshiba Electronics Taiwan Corp. -#define UHS_VID_TELIA_RESEARCH 0x04beU // Telia Research AB -#define UHS_VID_TDK 0x04bfU // TDK Corp. -#define UHS_VID_US_ROBOTICS_3COM 0x04c1U // U.S. Robotics (3Com) -#define UHS_VID_METHODE_ELECTRONICS_FAR_EAST_PTE 0x04c2U // Methode Electronics Far East PTE, Ltd -#define UHS_VID_MAXI_SWITCH 0x04c3U // Maxi Switch, Inc. -#define UHS_VID_LOCKHEED_MARTIN_ENERGY_RESEARCH 0x04c4U // Lockheed Martin Energy Research -#define UHS_VID_FUJITSU 0x04c5U // Fujitsu, Ltd -#define UHS_VID_TOSHIBA_AMERICA_ELECTRONIC_COMPONENTS 0x04c6U // Toshiba America Electronic Components -#define UHS_VID_MICRO_MACRO_TECHNOLOGIES 0x04c7U // Micro Macro Technologies -#define UHS_VID_KONICA 0x04c8U // Konica Corp. -#define UHS_VID_LITE_ON_TECHNOLOGY 0x04caU // Lite-On Technology Corp. -#define UHS_VID_FUJI_PHOTO_FILM 0x04cbU // Fuji Photo Film Co., Ltd -#define UHS_VID_ST_ERICSSON 0x04ccU // ST-Ericsson -#define UHS_VID_TATUNG_CO_OF_AMERICA 0x04cdU // Tatung Co. Of America -#define UHS_VID_SCANLOGIC 0x04ceU // ScanLogic Corp. -#define UHS_VID_MYSON_CENTURY 0x04cfU // Myson Century, Inc. -#define UHS_VID_DIGI_INTERNATIONAL 0x04d0U // Digi International -#define UHS_VID_ITT_CANON 0x04d1U // ITT Canon -#define UHS_VID_ALTEC_LANSING_TECHNOLOGIES 0x04d2U // Altec Lansing Technologies -#define UHS_VID_VIDUS 0x04d3U // VidUS, Inc. -#define UHS_VID_LSI_LOGIC 0x04d4U // LSI Logic, Inc. -#define UHS_VID_FORTE_TECHNOLOGIES 0x04d5U // Forte Technologies, Inc. -#define UHS_VID_MENTOR_GRAPHICS 0x04d6U // Mentor Graphics -#define UHS_VID_OKI_SEMICONDUCTOR 0x04d7U // Oki Semiconductor -#define UHS_VID_MICROCHIP_TECHNOLOGY 0x04d8U // Microchip Technology, Inc. -#define UHS_VID_HOLTEK_SEMICONDUCTOR 0x04d9U // Holtek Semiconductor, Inc. -#define UHS_VID_PANASONIC_MATSUSHITA 0x04daU // Panasonic (Matsushita) -#define UHS_VID_HYPERTEC_PTY 0x04dbU // Hypertec Pty, Ltd -#define UHS_VID_HUAN_HSIN_HOLDINGS 0x04dcU // Huan Hsin Holdings, Ltd -#define UHS_VID_SHARP 0x04ddU // Sharp Corp. -#define UHS_VID_MINDSHARE 0x04deU // MindShare, Inc. -#define UHS_VID_INTERLINK_ELECTRONICS 0x04dfU // Interlink Electronics -#define UHS_VID_IIYAMA_NORTH_AMERICA 0x04e1U // Iiyama North America, Inc. -#define UHS_VID_EXAR 0x04e2U // Exar Corp. -#define UHS_VID_ZILOG 0x04e3U // Zilog, Inc. -#define UHS_VID_ACC_MICROELECTRONICS 0x04e4U // ACC Microelectronics -#define UHS_VID_PROMISE_TECHNOLOGY 0x04e5U // Promise Technology -#define UHS_VID_SCM_MICROSYSTEMS 0x04e6U // SCM Microsystems, Inc. -#define UHS_VID_ELO_TOUCHSYSTEMS 0x04e7U // Elo TouchSystems -#define UHS_VID_SAMSUNG_ELECTRONICS 0x04e8U // Samsung Electronics Co., Ltd -#define UHS_VID_PC_TEL 0x04e9U // PC-Tel, Inc. -#define UHS_VID_BROOKTREE 0x04eaU // Brooktree Corp. -#define UHS_VID_NORTHSTAR_SYSTEMS 0x04ebU // Northstar Systems, Inc. -#define UHS_VID_TOKYO_ELECTRON_DEVICE 0x04ecU // Tokyo Electron Device, Ltd -#define UHS_VID_ANNABOOKS 0x04edU // Annabooks -#define UHS_VID_PACIFIC_ELECTRONIC_INTERNATIONAL 0x04efU // Pacific Electronic International, Inc. -#define UHS_VID_DAEWOO_ELECTRONICS 0x04f0U // Daewoo Electronics Co., Ltd -#define UHS_VID_VICTOR_COMPANY_OF_JAPAN 0x04f1U // Victor Company of Japan, Ltd -#define UHS_VID_CHICONY_ELECTRONICS_1 0x04f2U // Chicony Electronics Co., Ltd -#define UHS_VID_ELAN_MICROELECTRONICS 0x04f3U // Elan Microelectronics Corp. -#define UHS_VID_HARTING_ELEKTRONIK 0x04f4U // Harting Elektronik, Inc. -#define UHS_VID_FUJITSU_ICL_SYSTEMS 0x04f5U // Fujitsu-ICL Systems, Inc. -#define UHS_VID_NORAND 0x04f6U // Norand Corp. -#define UHS_VID_NEWNEX_TECHNOLOGY 0x04f7U // Newnex Technology Corp. -#define UHS_VID_FUTUREPLUS_SYSTEMS 0x04f8U // FuturePlus Systems -#define UHS_VID_BROTHER_INDUSTRIES 0x04f9U // Brother Industries, Ltd -#define UHS_VID_DALLAS_SEMICONDUCTOR 0x04faU // Dallas Semiconductor -#define UHS_VID_BIOSTAR_MICROTECH_INTERNATIONAL 0x04fbU // Biostar Microtech International Corp. -#define UHS_VID_SUNPLUS_TECHNOLOGY 0x04fcU // Sunplus Technology Co., Ltd -#define UHS_VID_SOLITON_SYSTEMS_KK 0x04fdU // Soliton Systems, K.K. -#define UHS_VID_PFU 0x04feU // PFU, Ltd -#define UHS_VID_E_CMOS 0x04ffU // E-CMOS Corp. -#define UHS_VID_SIAM_UNITED_HI_TECH 0x0500U // Siam United Hi-Tech -#define UHS_VID_FUJIKURA_DDK 0x0501U // Fujikura DDK, Ltd -#define UHS_VID_ACER_1 0x0502U // Acer, Inc. -#define UHS_VID_HITACHI_AMERICA 0x0503U // Hitachi America, Ltd -#define UHS_VID_HAYES_MICROCOMPUTER_PRODUCTS 0x0504U // Hayes Microcomputer Products -#define UHS_VID_3COM 0x0506U // 3Com Corp. -#define UHS_VID_HOSIDEN 0x0507U // Hosiden Corp. -#define UHS_VID_CLARION 0x0508U // Clarion Co., Ltd -#define UHS_VID_AZTECH_SYSTEMS 0x0509U // Aztech Systems, Ltd -#define UHS_VID_CINCH_CONNECTORS 0x050aU // Cinch Connectors -#define UHS_VID_CABLE_SYSTEM_INTERNATIONAL 0x050bU // Cable System International -#define UHS_VID_INNOMEDIA 0x050cU // InnoMedia, Inc. -#define UHS_VID_BELKIN_COMPONENTS 0x050dU // Belkin Components -#define UHS_VID_NEON_TECHNOLOGY 0x050eU // Neon Technology, Inc. -#define UHS_VID_KC_TECHNOLOGY 0x050fU // KC Technology, Inc. -#define UHS_VID_SEJIN_ELECTRON 0x0510U // Sejin Electron, Inc. -#define UHS_VID_NABLE_DATABOOK_TECHNOLOGIES 0x0511U // N'Able (DataBook) Technologies, Inc. -#define UHS_VID_HUALON_MICROELECTRONICS 0x0512U // Hualon Microelectronics Corp. -#define UHS_VID_DIGITAL_X 0x0513U // digital-X, Inc. -#define UHS_VID_FCI_ELECTRONICS 0x0514U // FCI Electronics -#define UHS_VID_ACTC 0x0515U // ACTC -#define UHS_VID_LONGWELL_ELECTRONICS 0x0516U // Longwell Electronics -#define UHS_VID_BUTTERFLY_COMMUNICATIONS 0x0517U // Butterfly Communications -#define UHS_VID_EZKEY 0x0518U // EzKEY Corp. -#define UHS_VID_STAR_MICRONICS 0x0519U // Star Micronics Co., Ltd -#define UHS_VID_WYSE_TECHNOLOGY 0x051aU // WYSE Technology -#define UHS_VID_SILICON_GRAPHICS 0x051bU // Silicon Graphics -#define UHS_VID_SHUTTLE 0x051cU // Shuttle, Inc. -#define UHS_VID_AMERICAN_POWER_CONVERSION 0x051dU // American Power Conversion -#define UHS_VID_SCIENTIFIC_ATLANTA 0x051eU // Scientific Atlanta, Inc. -#define UHS_VID_IO_SYSTEMS_ELITE_ELECTRONICS 0x051fU // IO Systems (Elite Electronics), Inc. -#define UHS_VID_TAIWAN_SEMICONDUCTOR_MANUFACTURING 0x0520U // Taiwan Semiconductor Manufacturing Co. -#define UHS_VID_AIRBORN_CONNECTORS 0x0521U // Airborn Connectors -#define UHS_VID_ADVANCED_CONNECTEK 0x0522U // Advanced Connectek, Inc. -#define UHS_VID_ATEN 0x0523U // ATEN GmbH -#define UHS_VID_SOLA_ELECTRONICS 0x0524U // Sola Electronics -#define UHS_VID_NETCHIP_TECHNOLOGY 0x0525U // Netchip Technology, Inc. -#define UHS_VID_TEMIC_MHS 0x0526U // Temic MHS S.A. -#define UHS_VID_ALTRA 0x0527U // ALTRA -#define UHS_VID_ATI_TECHNOLOGIES 0x0528U // ATI Technologies, Inc. -#define UHS_VID_ALADDIN_KNOWLEDGE_SYSTEMS 0x0529U // Aladdin Knowledge Systems -#define UHS_VID_CRESCENT_HEART_SOFTWARE 0x052aU // Crescent Heart Software -#define UHS_VID_TEKOM_TECHNOLOGIES 0x052bU // Tekom Technologies, Inc. -#define UHS_VID_CANON_INFORMATION_SYSTEMS 0x052cU // Canon Information Systems, Inc. -#define UHS_VID_AVID_ELECTRONICS 0x052dU // Avid Electronics Corp. -#define UHS_VID_STANDARD_MICROSYSTEMS_1 0x052eU // Standard Microsystems Corp. -#define UHS_VID_UNICORE_SOFTWARE 0x052fU // Unicore Software, Inc. -#define UHS_VID_AMERICAN_MICROSYSTEMS 0x0530U // American Microsystems, Inc. -#define UHS_VID_WACOM_TECHNOLOGY 0x0531U // Wacom Technology Corp. -#define UHS_VID_SYSTECH 0x0532U // Systech Corp. -#define UHS_VID_ALCATEL_MOBILE_PHONES 0x0533U // Alcatel Mobile Phones -#define UHS_VID_MOTOROLA 0x0534U // Motorola, Inc. -#define UHS_VID_LIH_TZU_ELECTRIC 0x0535U // LIH TZU Electric Co., Ltd -#define UHS_VID_HAND_HELD_PRODUCTS_WELCH_ALLYN 0x0536U // Hand Held Products (Welch Allyn, Inc.) -#define UHS_VID_INVENTEC 0x0537U // Inventec Corp. -#define UHS_VID_CALDERA_INTERNATIONAL_INC_SCO 0x0538U // Caldera International, Inc. (SCO) -#define UHS_VID_SHYH_SHIUN_TERMINALS 0x0539U // Shyh Shiun Terminals Co., Ltd -#define UHS_VID_PREHKEYTEC 0x053aU // PrehKeyTec GmbH -#define UHS_VID_GLOBAL_VILLAGE_COMMUNICATION 0x053bU // Global Village Communication -#define UHS_VID_INSTITUT_OF_MICROELECTRONIC_AND_MECHATRONIC_SYSTEMS 0x053cU // Institut of Microelectronic & Mechatronic Systems -#define UHS_VID_SILICON_ARCHITECT 0x053dU // Silicon Architect -#define UHS_VID_MOBILITY_ELECTRONICS 0x053eU // Mobility Electronics -#define UHS_VID_SYNOPSYS_1 0x053fU // Synopsys, Inc. -#define UHS_VID_UNIACCESS 0x0540U // UniAccess AB -#define UHS_VID_SIRF_TECHNOLOGY 0x0541U // Sirf Technology, Inc. -#define UHS_VID_VIEWSONIC 0x0543U // ViewSonic Corp. -#define UHS_VID_CRISTIE_ELECTRONICS 0x0544U // Cristie Electronics, Ltd -#define UHS_VID_XIRLINK 0x0545U // Xirlink, Inc. -#define UHS_VID_POLAROID 0x0546U // Polaroid Corp. -#define UHS_VID_ANCHOR_CHIPS 0x0547U // Anchor Chips, Inc. -#define UHS_VID_TYAN_COMPUTER 0x0548U // Tyan Computer Corp. -#define UHS_VID_PIXERA 0x0549U // Pixera Corp. -#define UHS_VID_FUJITSU_MICROELECTRONICS 0x054aU // Fujitsu Microelectronics, Inc. -#define UHS_VID_NEW_MEDIA 0x054bU // New Media Corp. -#define UHS_VID_SONY 0x054cU // Sony Corp. -#define UHS_VID_TRY 0x054dU // Try Corp. -#define UHS_VID_PROSIDE 0x054eU // Proside Corp. -#define UHS_VID_WYSE_TECHNOLOGY_TAIWAN 0x054fU // WYSE Technology Taiwan -#define UHS_VID_FUJI_XEROX 0x0550U // Fuji Xerox Co., Ltd -#define UHS_VID_COMPUTREND_SYSTEMS 0x0551U // CompuTrend Systems, Inc. -#define UHS_VID_PHILIPS_MONITORS 0x0552U // Philips Monitors -#define UHS_VID_STMICROELECTRONICS_IMAGING_DIVISION_VLSI_VISION 0x0553U // STMicroelectronics Imaging Division (VLSI Vision) -#define UHS_VID_DICTAPHONE 0x0554U // Dictaphone Corp. -#define UHS_VID_ANAM_SANDT 0x0555U // ANAM S&T Co., Ltd -#define UHS_VID_ASAHI_KASEI_MICROSYSTEMS 0x0556U // Asahi Kasei Microsystems Co., Ltd -#define UHS_VID_ATEN_INTERNATIONAL 0x0557U // ATEN International Co., Ltd -#define UHS_VID_TRUEVISION 0x0558U // Truevision, Inc. -#define UHS_VID_CADENCE_DESIGN_SYSTEMS 0x0559U // Cadence Design Systems, Inc. -#define UHS_VID_KENWOOD_USA 0x055aU // Kenwood USA -#define UHS_VID_KNOWLEDGETEK 0x055bU // KnowledgeTek, Inc. -#define UHS_VID_PROTON_ELECTRONIC_IND 0x055cU // Proton Electronic Ind. -#define UHS_VID_SAMSUNG_ELECTRO_MECHANICS 0x055dU // Samsung Electro-Mechanics Co. -#define UHS_VID_CTX_OPTO_ELECTRONICS 0x055eU // CTX Opto-Electronics Corp. -#define UHS_VID_MUSTEK_SYSTEMS 0x055fU // Mustek Systems, Inc. -#define UHS_VID_INTERFACE 0x0560U // Interface Corp. -#define UHS_VID_OASIS_DESIGN 0x0561U // Oasis Design, Inc. -#define UHS_VID_TELEX_COMMUNICATIONS 0x0562U // Telex Communications, Inc. -#define UHS_VID_IMMERSION 0x0563U // Immersion Corp. -#define UHS_VID_KODAK_DIGITAL_PRODUCT_CENTER_JAPAN_LTD_FORMERLY_CHINON_INDUSTRIES 0x0564U // Kodak Digital Product Center, Japan Ltd. (formerly Chinon Industries Inc.) -#define UHS_VID_PERACOM_NETWORKS 0x0565U // Peracom Networks, Inc. -#define UHS_VID_MONTEREY_INTERNATIONAL 0x0566U // Monterey International Corp. -#define UHS_VID_XYRATEX_INTERNATIONAL 0x0567U // Xyratex International, Ltd -#define UHS_VID_QUARTZ_INGENIERIE 0x0568U // Quartz Ingenierie -#define UHS_VID_SEGASOFT 0x0569U // SegaSoft -#define UHS_VID_WACOM 0x056aU // Wacom Co., Ltd -#define UHS_VID_DECICON 0x056bU // Decicon, Inc. -#define UHS_VID_ETEK_LABS 0x056cU // eTEK Labs -#define UHS_VID_EIZO 0x056dU // EIZO Corp. -#define UHS_VID_ELECOM 0x056eU // Elecom Co., Ltd -#define UHS_VID_KOREA_DATA_SYSTEMS 0x056fU // Korea Data Systems Co., Ltd -#define UHS_VID_EPSON_AMERICA 0x0570U // Epson America -#define UHS_VID_INTEREX 0x0571U // Interex, Inc. -#define UHS_VID_CONEXANT_SYSTEMS_ROCKWELL 0x0572U // Conexant Systems (Rockwell), Inc. -#define UHS_VID_ZORAN_CO_PERSONAL_MEDIA_DIVISION_NOGATECH 0x0573U // Zoran Co. Personal Media Division (Nogatech) -#define UHS_VID_CITY_UNIVERSITY_OF_HONG_KONG 0x0574U // City University of Hong Kong -#define UHS_VID_PHILIPS_CREATIVE_DISPLAY_SOLUTIONS 0x0575U // Philips Creative Display Solutions -#define UHS_VID_BAFOQUALITY_COMPUTER_ACCESSORIES 0x0576U // BAFO/Quality Computer Accessories -#define UHS_VID_ELSA 0x0577U // ELSA -#define UHS_VID_INTRINSIX 0x0578U // Intrinsix Corp. -#define UHS_VID_GVC 0x0579U // GVC Corp. -#define UHS_VID_SAMSUNG_ELECTRONICS_AMERICA 0x057aU // Samsung Electronics America -#define UHS_VID_Y_E_DATA 0x057bU // Y-E Data, Inc. -#define UHS_VID_AVM 0x057cU // AVM GmbH -#define UHS_VID_SHARK_MULTIMEDIA 0x057dU // Shark Multimedia, Inc. -#define UHS_VID_NINTENDO 0x057eU // Nintendo Co., Ltd -#define UHS_VID_QUICKSHOT 0x057fU // QuickShot, Ltd -#define UHS_VID_DENRON 0x0580U // Denron, Inc. -#define UHS_VID_RACAL_DATA_GROUP 0x0581U // Racal Data Group -#define UHS_VID_ROLAND 0x0582U // Roland Corp. -#define UHS_VID_PADIX_CO_LTD_ROCKFIRE 0x0583U // Padix Co., Ltd (Rockfire) -#define UHS_VID_RATOC_SYSTEM 0x0584U // RATOC System, Inc. -#define UHS_VID_FLASHPOINT_TECHNOLOGY 0x0585U // FlashPoint Technology, Inc. -#define UHS_VID_ZYXEL_COMMUNICATIONS 0x0586U // ZyXEL Communications Corp. -#define UHS_VID_AMERICA_KOTOBUKI_ELECTRONICS_INDUSTRIES 0x0587U // America Kotobuki Electronics Industries, Inc. -#define UHS_VID_SAPIEN_DESIGN 0x0588U // Sapien Design -#define UHS_VID_VICTRON 0x0589U // Victron -#define UHS_VID_NOHAU 0x058aU // Nohau Corp. -#define UHS_VID_INFINEON_TECHNOLOGIES 0x058bU // Infineon Technologies -#define UHS_VID_IN_FOCUS_SYSTEMS 0x058cU // In Focus Systems -#define UHS_VID_MICREL_SEMICONDUCTOR 0x058dU // Micrel Semiconductor -#define UHS_VID_TRIPATH_TECHNOLOGY 0x058eU // Tripath Technology, Inc. -#define UHS_VID_ALCOR_MICRO 0x058fU // Alcor Micro Corp. -#define UHS_VID_OMRON 0x0590U // Omron Corp. -#define UHS_VID_QUESTRA_CONSULTING 0x0591U // Questra Consulting -#define UHS_VID_POWERWARE 0x0592U // Powerware Corp. -#define UHS_VID_INCITE 0x0593U // Incite -#define UHS_VID_PRINCETON_GRAPHIC_SYSTEMS 0x0594U // Princeton Graphic Systems -#define UHS_VID_ZORAN_MICROELECTRONICS 0x0595U // Zoran Microelectronics, Ltd -#define UHS_VID_MICROTOUCH_SYSTEMS 0x0596U // MicroTouch Systems, Inc. -#define UHS_VID_TRISIGNAL_COMMUNICATIONS 0x0597U // Trisignal Communications -#define UHS_VID_NIIGATA_CANOTEC 0x0598U // Niigata Canotec Co., Inc. -#define UHS_VID_BRILLIANCE_SEMICONDUCTOR 0x0599U // Brilliance Semiconductor, Inc. -#define UHS_VID_SPECTRUM_SIGNAL_PROCESSING 0x059aU // Spectrum Signal Processing, Inc. -#define UHS_VID_IOMEGA 0x059bU // Iomega Corp. -#define UHS_VID_A_TREND_TECHNOLOGY 0x059cU // A-Trend Technology Co., Ltd -#define UHS_VID_ADVANCED_INPUT_DEVICES 0x059dU // Advanced Input Devices -#define UHS_VID_INTELLIGENT_INSTRUMENTATION 0x059eU // Intelligent Instrumentation -#define UHS_VID_LACIE 0x059fU // LaCie, Ltd -#define UHS_VID_VETRONIX 0x05a0U // Vetronix Corp. -#define UHS_VID_USC 0x05a1U // USC Corp. -#define UHS_VID_FUJI_FILM_MICRODEVICES 0x05a2U // Fuji Film Microdevices Co., Ltd -#define UHS_VID_ARC_INTERNATIONAL 0x05a3U // ARC International -#define UHS_VID_ORTEK_TECHNOLOGY 0x05a4U // Ortek Technology, Inc. -#define UHS_VID_SAMPO_TECHNOLOGY 0x05a5U // Sampo Technology Corp. -#define UHS_VID_CISCO_SYSTEMS 0x05a6U // Cisco Systems, Inc. -#define UHS_VID_BOSE 0x05a7U // Bose Corp. -#define UHS_VID_SPACETEC_IMC 0x05a8U // Spacetec IMC Corp. -#define UHS_VID_OMNIVISION_TECHNOLOGIES 0x05a9U // OmniVision Technologies, Inc. -#define UHS_VID_UTILUX_SOUTH_CHINA 0x05aaU // Utilux South China, Ltd -#define UHS_VID_IN_SYSTEM_DESIGN 0x05abU // In-System Design -#define UHS_VID_APPLE 0x05acU // Apple, Inc. -#define UHS_VID_YC_CABLE_USA 0x05adU // Y.C. Cable U.S.A., Inc. -#define UHS_VID_SYNOPSYS_2 0x05aeU // Synopsys, Inc. -#define UHS_VID_JING_MOLD_ENTERPRISE 0x05afU // Jing-Mold Enterprise Co., Ltd -#define UHS_VID_FOUNTAIN_TECHNOLOGIES 0x05b0U // Fountain Technologies, Inc. -#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER 0x05b1U // First International Computer, Inc. -#define UHS_VID_LG_SEMICON 0x05b4U // LG Semicon Co., Ltd -#define UHS_VID_DIALOGIC 0x05b5U // Dialogic Corp. -#define UHS_VID_PROXIMA 0x05b6U // Proxima Corp. -#define UHS_VID_MEDIANIX_SEMICONDUCTOR 0x05b7U // Medianix Semiconductor, Inc. -#define UHS_VID_AGILER 0x05b8U // Agiler, Inc. -#define UHS_VID_PHILIPS_RESEARCH_LABORATORIES 0x05b9U // Philips Research Laboratories -#define UHS_VID_DIGITALPERSONA 0x05baU // DigitalPersona, Inc. -#define UHS_VID_GREY_CELL_SYSTEMS 0x05bbU // Grey Cell Systems -#define UHS_VID_3G_GREEN_GREEN_GLOBE 0x05bcU // 3G Green Green Globe Co., Ltd -#define UHS_VID_RAFI_GMBH_AND_CO_KG 0x05bdU // RAFI GmbH & Co. KG -#define UHS_VID_TYCO_ELECTRONICS_RAYCHEM 0x05beU // Tyco Electronics (Raychem) -#define UHS_VID_S_AND_S_RESEARCH 0x05bfU // S & S Research -#define UHS_VID_KEIL_SOFTWARE 0x05c0U // Keil Software -#define UHS_VID_KAWASAKI_MICROELECTRONICS 0x05c1U // Kawasaki Microelectronics, Inc. -#define UHS_VID_MEDIA_PHONICS_SUISSE 0x05c2U // Media Phonics (Suisse) S.A. -#define UHS_VID_DIGI_INTERNATIONAL_1 0x05c5U // Digi International, Inc. -#define UHS_VID_QUALCOMM 0x05c6U // Qualcomm, Inc. -#define UHS_VID_QTRONIX 0x05c7U // Qtronix Corp. -#define UHS_VID_CHENG_UEI_PRECISION_INDUSTRY_CO_LTD_FOXLINK 0x05c8U // Cheng Uei Precision Industry Co., Ltd (Foxlink) -#define UHS_VID_SEMTECH_1 0x05c9U // Semtech Corp. -#define UHS_VID_RICOH 0x05caU // Ricoh Co., Ltd -#define UHS_VID_POWERVISION_TECHNOLOGIES 0x05cbU // PowerVision Technologies, Inc. -#define UHS_VID_ELSA_AG 0x05ccU // ELSA AG -#define UHS_VID_SILICOM 0x05cdU // Silicom, Ltd -#define UHS_VID_SCI_WORX 0x05ceU // sci-worx GmbH -#define UHS_VID_SUNG_FORN 0x05cfU // Sung Forn Co., Ltd -#define UHS_VID_GE_MEDICAL_SYSTEMS_LUNAR 0x05d0U // GE Medical Systems Lunar -#define UHS_VID_BRAINBOXES 0x05d1U // Brainboxes, Ltd -#define UHS_VID_WAVE_SYSTEMS 0x05d2U // Wave Systems Corp. -#define UHS_VID_TOHOKU_RICOH 0x05d3U // Tohoku Ricoh Co., Ltd -#define UHS_VID_SUPER_GATE_TECHNOLOGY 0x05d5U // Super Gate Technology Co., Ltd -#define UHS_VID_PHILIPS_SEMICONDUCTORS_CICT 0x05d6U // Philips Semiconductors, CICT -#define UHS_VID_THOMAS_AND_BETTS 0x05d7U // Thomas & Betts Corp. -#define UHS_VID_ULTIMA_ELECTRONICS 0x05d8U // Ultima Electronics Corp. -#define UHS_VID_AXIOHM_TRANSACTION_SOLUTIONS 0x05d9U // Axiohm Transaction Solutions -#define UHS_VID_MICROTEK_INTERNATIONAL 0x05daU // Microtek International, Inc. -#define UHS_VID_SUN_CORP_SUNTAC_UNKNOWN 0x05dbU // Sun Corp. (Suntac?) -#define UHS_VID_LEXAR_MEDIA 0x05dcU // Lexar Media, Inc. -#define UHS_VID_DELTA_ELECTRONICS 0x05ddU // Delta Electronics, Inc. -#define UHS_VID_SILICON_VISION 0x05dfU // Silicon Vision, Inc. -#define UHS_VID_SYMBOL_TECHNOLOGIES 0x05e0U // Symbol Technologies -#define UHS_VID_SYNTEK_SEMICONDUCTOR 0x05e1U // Syntek Semiconductor Co., Ltd -#define UHS_VID_ELECVISION 0x05e2U // ElecVision, Inc. -#define UHS_VID_GENESYS_LOGIC 0x05e3U // Genesys Logic, Inc. -#define UHS_VID_RED_WING 0x05e4U // Red Wing Corp. -#define UHS_VID_FUJI_ELECTRIC 0x05e5U // Fuji Electric Co., Ltd -#define UHS_VID_KEITHLEY_INSTRUMENTS 0x05e6U // Keithley Instruments -#define UHS_VID_ICC 0x05e8U // ICC, Inc. -#define UHS_VID_KAWASAKI_LSI 0x05e9U // Kawasaki LSI -#define UHS_VID_FFC 0x05ebU // FFC, Ltd -#define UHS_VID_COM21 0x05ecU // COM21, Inc. -#define UHS_VID_CYTECHINFO 0x05eeU // Cytechinfo Inc. -#define UHS_VID_AVB_INC_ANKO_UNKNOWN_ 0x05efU // AVB, Inc. [anko?] -#define UHS_VID_CANOPUS 0x05f0U // Canopus Co., Ltd -#define UHS_VID_COMPASS_COMMUNICATIONS 0x05f1U // Compass Communications -#define UHS_VID_DEXIN 0x05f2U // Dexin Corp., Ltd -#define UHS_VID_PI_ENGINEERING 0x05f3U // PI Engineering, Inc. -#define UHS_VID_UNIXTAR_TECHNOLOGY 0x05f5U // Unixtar Technology, Inc. -#define UHS_VID_AOC_INTERNATIONAL 0x05f6U // AOC International -#define UHS_VID_RFC_DISTRIBUTIONS_PTE 0x05f7U // RFC Distribution(s) PTE, Ltd -#define UHS_VID_PSC_SCANNING 0x05f9U // PSC Scanning, Inc. -#define UHS_VID_SIEMENS_TELECOMMUNICATIONS_SYSTEMS 0x05faU // Siemens Telecommunications Systems, Ltd -#define UHS_VID_HARMAN 0x05fcU // Harman -#define UHS_VID_INTERACT 0x05fdU // InterAct, Inc. -#define UHS_VID_CHIC_TECHNOLOGY 0x05feU // Chic Technology Corp. -#define UHS_VID_LECROY 0x05ffU // LeCroy Corp. -#define UHS_VID_BARCO_DISPLAY_SYSTEMS 0x0600U // Barco Display Systems -#define UHS_VID_JAZZ_HIPSTER 0x0601U // Jazz Hipster Corp. -#define UHS_VID_VISTA_IMAGING 0x0602U // Vista Imaging, Inc. -#define UHS_VID_NOVATEK_MICROELECTRONICS 0x0603U // Novatek Microelectronics Corp. -#define UHS_VID_JEAN 0x0604U // Jean Co., Ltd -#define UHS_VID_ANCHOR_CANDC 0x0605U // Anchor C&C Co., Ltd -#define UHS_VID_ROYAL_INFORMATION_ELECTRONICS 0x0606U // Royal Information Electronics Co., Ltd -#define UHS_VID_BRIDGE_INFORMATION 0x0607U // Bridge Information Co., Ltd -#define UHS_VID_GENRAD_ADS 0x0608U // Genrad Ads -#define UHS_VID_SMK_MANUFACTURING 0x0609U // SMK Manufacturing, Inc. -#define UHS_VID_WORTHINGTON_DATA_SOLUTIONS 0x060aU // Worthington Data Solutions, Inc. -#define UHS_VID_SOLID_YEAR 0x060bU // Solid Year -#define UHS_VID_EEH_DATALINK 0x060cU // EEH Datalink GmbH -#define UHS_VID_AUCTOR 0x060dU // Auctor Corp. -#define UHS_VID_TRANSMONDE_TECHNOLOGIES 0x060eU // Transmonde Technologies, Inc. -#define UHS_VID_JOINSOON_ELECTRONICS_MFG 0x060fU // Joinsoon Electronics Mfg. Co., Ltd -#define UHS_VID_COSTAR_ELECTRONICS 0x0610U // Costar Electronics, Inc. -#define UHS_VID_TOTOKU_ELECTRIC 0x0611U // Totoku Electric Co., Ltd -#define UHS_VID_TRANSACT_TECHNOLOGIES 0x0613U // TransAct Technologies, Inc. -#define UHS_VID_BIO_RAD_LABORATORIES 0x0614U // Bio-Rad Laboratories -#define UHS_VID_QUABBIN_WIRE_AND_CABLE 0x0615U // Quabbin Wire & Cable Co., Inc. -#define UHS_VID_FUTURE_TECHNO_DESIGNS_PVT 0x0616U // Future Techno Designs PVT, Ltd -#define UHS_VID_SWISS_FEDERAL_INSITUTE_OF_TECHNOLOGY 0x0617U // Swiss Federal Insitute of Technology -#define UHS_VID_MACALLY 0x0618U // MacAlly -#define UHS_VID_SEIKO_INSTRUMENTS 0x0619U // Seiko Instruments, Inc. -#define UHS_VID_VERIDICOM_INTERNATIONAL 0x061aU // Veridicom International, Inc. -#define UHS_VID_PROMPTUS_COMMUNICATIONS 0x061bU // Promptus Communications, Inc. -#define UHS_VID_ACT_LABS 0x061cU // Act Labs, Ltd -#define UHS_VID_QUATECH 0x061dU // Quatech, Inc. -#define UHS_VID_NISSEI_ELECTRIC 0x061eU // Nissei Electric Co. -#define UHS_VID_ALARIS 0x0620U // Alaris, Inc. -#define UHS_VID_ODU_STECKVERBINDUNGSSYSTEME_GMBH_AND_CO_KG 0x0621U // ODU-Steckverbindungssysteme GmbH & Co. KG -#define UHS_VID_IOTECH 0x0622U // Iotech, Inc. -#define UHS_VID_LITTELFUSE 0x0623U // Littelfuse, Inc. -#define UHS_VID_AVOCENT 0x0624U // Avocent Corp. -#define UHS_VID_TIMEDIA_TECHNOLOGY 0x0625U // TiMedia Technology Co., Ltd -#define UHS_VID_NIPPON_SYSTEMS_DEVELOPMENT 0x0626U // Nippon Systems Development Co., Ltd -#define UHS_VID_ADOMAX_TECHNOLOGY 0x0627U // Adomax Technology Co., Ltd -#define UHS_VID_TASKING_SOFTWARE 0x0628U // Tasking Software, Inc. -#define UHS_VID_ZIDA_TECHNOLOGIES 0x0629U // Zida Technologies, Ltd -#define UHS_VID_CREATIVE_LABS 0x062aU // Creative Labs -#define UHS_VID_GREATLINK_ELECTRONICS_TAIWAN 0x062bU // Greatlink Electronics Taiwan, Ltd -#define UHS_VID_INSTITUTE_FOR_INFORMATION_INDUSTRY 0x062cU // Institute for Information Industry -#define UHS_VID_TAIWAN_TAI_HAO_ENTERPRISES 0x062dU // Taiwan Tai-Hao Enterprises Co., Ltd -#define UHS_VID_MAINSUPER_ENTERPRISES 0x062eU // Mainsuper Enterprises Co., Ltd -#define UHS_VID_SIN_SHENG_TERMINAL_AND_MACHINE 0x062fU // Sin Sheng Terminal & Machine, Inc. -#define UHS_VID_JUJO_ELECTRONICS 0x0631U // JUJO Electronics Corp. -#define UHS_VID_CYRIX 0x0633U // Cyrix Corp. -#define UHS_VID_MICRON_TECHNOLOGY 0x0634U // Micron Technology, Inc. -#define UHS_VID_METHODE_ELECTRONICS 0x0635U // Methode Electronics, Inc. -#define UHS_VID_SIERRA_IMAGING 0x0636U // Sierra Imaging, Inc. -#define UHS_VID_AVISION 0x0638U // Avision, Inc. -#define UHS_VID_CHRONTEL 0x0639U // Chrontel, Inc. -#define UHS_VID_TECHWIN 0x063aU // Techwin Corp. -#define UHS_VID_TAUGAGREINING_HF_1 0x063bU // Taugagreining HF -#define UHS_VID_YAMAICHI_ELECTRONICS_CO_LTD_SAKURA 0x063cU // Yamaichi Electronics Co., Ltd (Sakura) -#define UHS_VID_FONG_KAI_INDUSTRIAL 0x063dU // Fong Kai Industrial Co., Ltd -#define UHS_VID_REALMEDIA_TECHNOLOGY 0x063eU // RealMedia Technology, Inc. -#define UHS_VID_NEW_TECHNOLOGY_CABLE 0x063fU // New Technology Cable, Ltd -#define UHS_VID_HITEX_DEVELOPMENT_TOOLS 0x0640U // Hitex Development Tools -#define UHS_VID_WOODS_INDUSTRIES 0x0641U // Woods Industries, Inc. -#define UHS_VID_VIA_MEDICAL 0x0642U // VIA Medical Corp. -#define UHS_VID_TEAC 0x0644U // TEAC Corp. -#define UHS_VID_WHO_UNKNOWN_VISION_SYSTEMS 0x0645U // Who? Vision Systems, Inc. -#define UHS_VID_UMAX 0x0646U // UMAX -#define UHS_VID_ACTON_RESEARCH 0x0647U // Acton Research Corp. -#define UHS_VID_INSIDE_OUT_NETWORKS 0x0648U // Inside Out Networks -#define UHS_VID_WELI_SCIENCE 0x0649U // Weli Science Co., Ltd -#define UHS_VID_ANALOG_DEVICES_INC_WHITE_MOUNTAIN_DSP 0x064bU // Analog Devices, Inc. (White Mountain DSP) -#define UHS_VID_JI_HAW_INDUSTRIAL 0x064cU // Ji-Haw Industrial Co., Ltd -#define UHS_VID_TRITECH_MICROELECTRONICS 0x064dU // TriTech Microelectronics, Ltd -#define UHS_VID_SUYIN 0x064eU // Suyin Corp. -#define UHS_VID_WIBU_SYSTEMS_AG 0x064fU // WIBU-Systems AG -#define UHS_VID_DYNAPRO_SYSTEMS 0x0650U // Dynapro Systems -#define UHS_VID_LIKOM_TECHNOLOGY_SDN_BHD 0x0651U // Likom Technology Sdn. Bhd. -#define UHS_VID_STARGATE_SOLUTIONS 0x0652U // Stargate Solutions, Inc. -#define UHS_VID_CNF 0x0653U // CNF, Inc. -#define UHS_VID_GRANITE_MICROSYSTEMS 0x0654U // Granite Microsystems, Inc. -#define UHS_VID_SPACE_SHUTTLE_HI_TECH 0x0655U // Space Shuttle Hi-Tech Co., Ltd -#define UHS_VID_GLORY_MARK_ELECTRONIC 0x0656U // Glory Mark Electronic, Ltd -#define UHS_VID_TEKCON_ELECTRONICS 0x0657U // Tekcon Electronics Corp. -#define UHS_VID_SIGMA_DESIGNS 0x0658U // Sigma Designs, Inc. -#define UHS_VID_AETHRA 0x0659U // Aethra -#define UHS_VID_OPTOELECTRONICS 0x065aU // Optoelectronics Co., Ltd -#define UHS_VID_TRACEWELL_SYSTEMS 0x065bU // Tracewell Systems -#define UHS_VID_SILICON_GRAPHICS_1 0x065eU // Silicon Graphics -#define UHS_VID_GOOD_WAY_TECHNOLOGY_CO_LTD_AND_GWC_TECHNOLOGY 0x065fU // Good Way Technology Co., Ltd & GWC technology Inc. -#define UHS_VID_TSAY_E_BVI_INTERNATIONAL 0x0660U // TSAY-E (BVI) International, Inc. -#define UHS_VID_HAMAMATSU_PHOTONICS_KK 0x0661U // Hamamatsu Photonics K.K. -#define UHS_VID_KANSAI_ELECTRIC 0x0662U // Kansai Electric Co., Ltd -#define UHS_VID_TOPMAX_ELECTRONIC 0x0663U // Topmax Electronic Co., Ltd -#define UHS_VID_ETANDT_TECHNOLOGY 0x0664U // ET&T Technology Co., Ltd. -#define UHS_VID_CYPRESS_SEMICONDUCTOR_1 0x0665U // Cypress Semiconductor -#define UHS_VID_AIWA 0x0667U // Aiwa Co., Ltd -#define UHS_VID_WORDWAND 0x0668U // WordWand -#define UHS_VID_OCE_PRINTING_SYSTEMS 0x0669U // Oce' Printing Systems GmbH -#define UHS_VID_TOTAL_TECHNOLOGIES 0x066aU // Total Technologies, Ltd -#define UHS_VID_LINKSYS 0x066bU // Linksys, Inc. -#define UHS_VID_ENTREGA 0x066dU // Entrega, Inc. -#define UHS_VID_ACER_SEMICONDUCTOR_AMERICA 0x066eU // Acer Semiconductor America, Inc. -#define UHS_VID_SIGMATEL 0x066fU // SigmaTel, Inc. -#define UHS_VID_SEQUEL_IMAGING 0x0670U // Sequel Imaging -#define UHS_VID_LABTEC 0x0672U // Labtec, Inc. -#define UHS_VID_HCL 0x0673U // HCL -#define UHS_VID_KEY_MOUSE_ELECTRONIC_ENTERPRISE 0x0674U // Key Mouse Electronic Enterprise Co., Ltd -#define UHS_VID_DRAYTEK 0x0675U // DrayTek Corp. -#define UHS_VID_TELES_AG 0x0676U // Teles AG -#define UHS_VID_AIWA_1 0x0677U // Aiwa Co., Ltd -#define UHS_VID_ACARD_TECHNOLOGY 0x0678U // ACard Technology Corp. -#define UHS_VID_PROLIFIC_TECHNOLOGY 0x067bU // Prolific Technology, Inc. -#define UHS_VID_EFFICIENT_NETWORKS 0x067cU // Efficient Networks, Inc. -#define UHS_VID_HOHNER 0x067dU // Hohner Corp. -#define UHS_VID_INTERMEC_TECHNOLOGIES 0x067eU // Intermec Technologies Corp. -#define UHS_VID_VIRATA 0x067fU // Virata, Ltd -#define UHS_VID_REALTEK_SEMICONDUCTOR_CORP_CPP_DIV_AVANCE_LOGIC 0x0680U // Realtek Semiconductor Corp., CPP Div. (Avance Logic) -#define UHS_VID_SIEMENS_INFORMATION_AND_COMMUNICATION_PRODUCTS 0x0681U // Siemens Information and Communication Products -#define UHS_VID_VICTOR_COMPANY_OF_JAPAN_1 0x0682U // Victor Company of Japan, Ltd -#define UHS_VID_ACTIONTEC_ELECTRONICS 0x0684U // Actiontec Electronics, Inc. -#define UHS_VID_ZD_INCORPORATED 0x0685U // ZD Incorporated -#define UHS_VID_MINOLTA 0x0686U // Minolta Co., Ltd -#define UHS_VID_PERTECH 0x068aU // Pertech, Inc. -#define UHS_VID_POTRANS_INTERNATIONAL 0x068bU // Potrans International, Inc. -#define UHS_VID_CH_PRODUCTS 0x068eU // CH Products, Inc. -#define UHS_VID_GOLDEN_BRIDGE_ELECTECH 0x0690U // Golden Bridge Electech, Inc. -#define UHS_VID_HAGIWARA_SYS_COM 0x0693U // Hagiwara Sys-Com Co., Ltd -#define UHS_VID_LEGO_GROUP 0x0694U // Lego Group -#define UHS_VID_CHUNTEX_CTX 0x0698U // Chuntex (CTX) -#define UHS_VID_TEKTRONIX 0x0699U // Tektronix, Inc. -#define UHS_VID_ASKEY_COMPUTER 0x069aU // Askey Computer Corp. -#define UHS_VID_THOMSON 0x069bU // Thomson, Inc. -#define UHS_VID_HUGHES_NETWORK_SYSTEMS_HNS 0x069dU // Hughes Network Systems (HNS) -#define UHS_VID_WELCAT 0x069eU // Welcat Inc. -#define UHS_VID_ALLIED_DATA_TECHNOLOGIES_BV 0x069fU // Allied Data Technologies BV -#define UHS_VID_TOPRO_TECHNOLOGY 0x06a2U // Topro Technology, Inc. -#define UHS_VID_SAITEK_PLC 0x06a3U // Saitek PLC -#define UHS_VID_XIAMEN_DOOWELL_ELECTRON 0x06a4U // Xiamen Doowell Electron Co., Ltd -#define UHS_VID_DIVIO 0x06a5U // Divio -#define UHS_VID_MICROSTORE 0x06a7U // MicroStore, Inc. -#define UHS_VID_TOPAZ_SYSTEMS 0x06a8U // Topaz Systems, Inc. -#define UHS_VID_WESTELL 0x06a9U // Westell -#define UHS_VID_SYSGRATION 0x06aaU // Sysgration, Ltd -#define UHS_VID_FUJITSU_LABORATORIES_OF_AMERICA 0x06acU // Fujitsu Laboratories of America, Inc. -#define UHS_VID_GREATLAND_ELECTRONICS_TAIWAN 0x06adU // Greatland Electronics Taiwan, Ltd -#define UHS_VID_PROFESSIONAL_MULTIMEDIA_TESTING_CENTRE 0x06aeU // Professional Multimedia Testing Centre -#define UHS_VID_HARTING_INC_OF_NORTH_AMERICA 0x06afU // Harting, Inc. of North America -#define UHS_VID_PIXELA 0x06b8U // Pixela Corp. -#define UHS_VID_ALCATEL_TELECOM 0x06b9U // Alcatel Telecom -#define UHS_VID_SMOOTH_CORD_AND_CONNECTOR 0x06baU // Smooth Cord & Connector Co., Ltd -#define UHS_VID_EDA 0x06bbU // EDA, Inc. -#define UHS_VID_OKI_DATA 0x06bcU // Oki Data Corp. -#define UHS_VID_AGFA_GEVAERT_NV 0x06bdU // AGFA-Gevaert NV -#define UHS_VID_AME_OPTIMEDIA_TECHNOLOGY 0x06beU // AME Optimedia Technology Co., Ltd -#define UHS_VID_LEOCO 0x06bfU // Leoco Corp. -#define UHS_VID_PHIDGETS_INC_FORMERLY_GLAB 0x06c2U // Phidgets Inc. (formerly GLAB) -#define UHS_VID_BIZLINK_INTERNATIONAL 0x06c4U // Bizlink International Corp. -#define UHS_VID_HAGENUK 0x06c5U // Hagenuk, GmbH -#define UHS_VID_INFOWAVE_SOFTWARE 0x06c6U // Infowave Software, Inc. -#define UHS_VID_SIIG 0x06c8U // SIIG, Inc. -#define UHS_VID_TAXAN_EUROPE 0x06c9U // Taxan (Europe), Ltd -#define UHS_VID_NEWER_TECHNOLOGY 0x06caU // Newer Technology, Inc. -#define UHS_VID_SYNAPTICS 0x06cbU // Synaptics, Inc. -#define UHS_VID_TERAYON_COMMUNICATION_SYSTEMS 0x06ccU // Terayon Communication Systems -#define UHS_VID_KEYSPAN 0x06cdU // Keyspan -#define UHS_VID_CONTEC 0x06ceU // Contec -#define UHS_VID_SPHERONVR_AG 0x06cfU // SpheronVR AG -#define UHS_VID_LAPLINK 0x06d0U // LapLink, Inc. -#define UHS_VID_DAEWOO_ELECTRONICS_1 0x06d1U // Daewoo Electronics Co., Ltd -#define UHS_VID_MITSUBISHI_ELECTRIC 0x06d3U // Mitsubishi Electric Corp. -#define UHS_VID_CISCO_SYSTEMS_1 0x06d4U // Cisco Systems -#define UHS_VID_TOSHIBA 0x06d5U // Toshiba -#define UHS_VID_AASHIMA_TECHNOLOGY_BV 0x06d6U // Aashima Technology B.V. -#define UHS_VID_NETWORK_COMPUTING_DEVICES_NCD 0x06d7U // Network Computing Devices (NCD) -#define UHS_VID_TECHNICAL_MARKETING_RESEARCH 0x06d8U // Technical Marketing Research, Inc. -#define UHS_VID_PHOENIXTEC_POWER 0x06daU // Phoenixtec Power Co., Ltd -#define UHS_VID_PARADYNE 0x06dbU // Paradyne -#define UHS_VID_FOXLINK_IMAGE_TECHNOLOGY 0x06dcU // Foxlink Image Technology Co., Ltd -#define UHS_VID_HEISEI_ELECTRONICS 0x06deU // Heisei Electronics Co., Ltd -#define UHS_VID_MULTI_TECH_SYSTEMS 0x06e0U // Multi-Tech Systems, Inc. -#define UHS_VID_ADS_TECHNOLOGIES 0x06e1U // ADS Technologies, Inc. -#define UHS_VID_ALCATEL_MICROELECTRONICS 0x06e4U // Alcatel Microelectronics -#define UHS_VID_TIGER_JET_NETWORK 0x06e6U // Tiger Jet Network, Inc. -#define UHS_VID_SIRIUS_TECHNOLOGIES 0x06eaU // Sirius Technologies -#define UHS_VID_PC_EXPERT_TECH 0x06ebU // PC Expert Tech. Co., Ltd -#define UHS_VID_IAC_GEOMETRISCHE_INGENIEURS_BV 0x06efU // I.A.C. Geometrische Ingenieurs B.V. -#define UHS_VID_TNC_INDUSTRIAL 0x06f0U // T.N.C Industrial Co., Ltd -#define UHS_VID_OPCODE_SYSTEMS 0x06f1U // Opcode Systems, Inc. -#define UHS_VID_EMINE_TECHNOLOGY 0x06f2U // Emine Technology Co. -#define UHS_VID_WINTREND_TECHNOLOGY 0x06f6U // Wintrend Technology Co., Ltd -#define UHS_VID_WAILLY_TECHNOLOGY 0x06f7U // Wailly Technology Ltd -#define UHS_VID_GUILLEMOT 0x06f8U // Guillemot Corp. -#define UHS_VID_ASYST_ELECTRONIC_DOO 0x06f9U // ASYST electronic d.o.o. -#define UHS_VID_HSD_SRL 0x06faU // HSD S.r.L -#define UHS_VID_MOTOROLA_SEMICONDUCTOR_PRODUCTS_SECTOR 0x06fcU // Motorola Semiconductor Products Sector -#define UHS_VID_BOSTON_ACOUSTICS 0x06fdU // Boston Acoustics -#define UHS_VID_GALLANT_COMPUTER 0x06feU // Gallant Computer, Inc. -#define UHS_VID_SUPERCOMAL_WIRE_AND_CABLE_SDN_BHD 0x0701U // Supercomal Wire & Cable SDN. BHD. -#define UHS_VID_BVTECH_INDUSTRY 0x0703U // Bvtech Industry, Inc. -#define UHS_VID_NKK 0x0705U // NKK Corp. -#define UHS_VID_ARIEL 0x0706U // Ariel Corp. -#define UHS_VID_STANDARD_MICROSYSTEMS_2 0x0707U // Standard Microsystems Corp. -#define UHS_VID_PUTERCOM 0x0708U // Putercom Co., Ltd -#define UHS_VID_SILICON_SYSTEMS_LTD_SSL 0x0709U // Silicon Systems, Ltd (SSL) -#define UHS_VID_OKI_ELECTRIC_INDUSTRY 0x070aU // Oki Electric Industry Co., Ltd -#define UHS_VID_COMOSS_ELECTRONIC 0x070dU // Comoss Electronic Co., Ltd -#define UHS_VID_EXCEL_CELL_ELECTRONIC 0x070eU // Excel Cell Electronic Co., Ltd -#define UHS_VID_CONNECT_TECH 0x0710U // Connect Tech, Inc. -#define UHS_VID_MAGIC_CONTROL_TECHNOLOGY 0x0711U // Magic Control Technology Corp. -#define UHS_VID_INTERVAL_RESEARCH 0x0713U // Interval Research Corp. -#define UHS_VID_NEWMOTION 0x0714U // NewMotion, Inc. -#define UHS_VID_ZNK 0x0717U // ZNK Corp. -#define UHS_VID_IMATION 0x0718U // Imation Corp. -#define UHS_VID_TREMON_ENTERPRISES 0x0719U // Tremon Enterprises Co., Ltd -#define UHS_VID_DOMAIN_TECHNOLOGIES 0x071bU // Domain Technologies, Inc. -#define UHS_VID_XIONICS_DOCUMENT_TECHNOLOGIES 0x071cU // Xionics Document Technologies, Inc. -#define UHS_VID_EICON_NETWORKS 0x071dU // Eicon Networks Corp. -#define UHS_VID_ARISTON_TECHNOLOGIES 0x071eU // Ariston Technologies -#define UHS_VID_CENTILLIUM_COMMUNICATIONS 0x0723U // Centillium Communications Corp. -#define UHS_VID_VANGUARD_INTERNATIONAL_SEMICONDUCTOR_AMERICA 0x0726U // Vanguard International Semiconductor-America -#define UHS_VID_AMITM 0x0729U // Amitm -#define UHS_VID_SUNIX 0x072eU // Sunix Co., Ltd -#define UHS_VID_ADVANCED_CARD_SYSTEMS 0x072fU // Advanced Card Systems, Ltd -#define UHS_VID_SUSTEEN 0x0731U // Susteen, Inc. -#define UHS_VID_GOLDFULL_ELECTRONICS_AND_TELECOMMUNICATIONS 0x0732U // Goldfull Electronics & Telecommunications Corp. -#define UHS_VID_VIEWQUEST_TECHNOLOGIES 0x0733U // ViewQuest Technologies, Inc. -#define UHS_VID_LASAT_COMMUNICATIONS_AS 0x0734U // Lasat Communications A/S -#define UHS_VID_ASUSCOM_NETWORK 0x0735U // Asuscom Network -#define UHS_VID_LOROM_INDUSTRIAL 0x0736U // Lorom Industrial Co., Ltd -#define UHS_VID_MAD_CATZ 0x0738U // Mad Catz, Inc. -#define UHS_VID_CHAPLET_SYSTEMS 0x073aU // Chaplet Systems, Inc. -#define UHS_VID_SUNCOM_TECHNOLOGIES 0x073bU // Suncom Technologies -#define UHS_VID_INDUSTRIAL_ELECTRONIC_ENGINEERS 0x073cU // Industrial Electronic Engineers, Inc. -#define UHS_VID_EUTRON_SPA 0x073dU // Eutron S.p.a. -#define UHS_VID_NEC_1 0x073eU // NEC, Inc. -#define UHS_VID_STOLLMANN 0x0742U // Stollmann -#define UHS_VID_SYNTECH_INFORMATION 0x0745U // Syntech Information Co., Ltd -#define UHS_VID_ONKYO 0x0746U // Onkyo Corp. -#define UHS_VID_LABWAY 0x0747U // Labway Corp. -#define UHS_VID_STRONG_MAN_ENTERPRISE 0x0748U // Strong Man Enterprise Co., Ltd -#define UHS_VID_EVER_ELECTRONICS 0x0749U // EVer Electronics Corp. -#define UHS_VID_MING_FORTUNE_INDUSTRY 0x074aU // Ming Fortune Industry Co., Ltd -#define UHS_VID_POLESTAR_TECH 0x074bU // Polestar Tech. Corp. -#define UHS_VID_C_C_C_GROUP_PLC 0x074cU // C-C-C Group PLC -#define UHS_VID_MICRONAS 0x074dU // Micronas GmbH -#define UHS_VID_DIGITAL_STREAM 0x074eU // Digital Stream Corp. -#define UHS_VID_AUREAL_SEMICONDUCTOR 0x0755U // Aureal Semiconductor -#define UHS_VID_NETWORK_TECHNOLOGIES 0x0757U // Network Technologies, Inc. -#define UHS_VID_SOPHISTICATED_CIRCUITS 0x075bU // Sophisticated Circuits, Inc. -#define UHS_VID_MIDIMAN 0x0763U // Midiman -#define UHS_VID_CYBER_POWER_SYSTEM 0x0764U // Cyber Power System, Inc. -#define UHS_VID_X_RITE 0x0765U // X-Rite, Inc. -#define UHS_VID_JESS_LINK_PRODUCTS 0x0766U // Jess-Link Products Co., Ltd -#define UHS_VID_TOKHEIM 0x0767U // Tokheim Corp. -#define UHS_VID_CAMTEL_TECHNOLOGY 0x0768U // Camtel Technology Corp. -#define UHS_VID_SURECOM_TECHNOLOGY 0x0769U // Surecom Technology Corp. -#define UHS_VID_SMART_TECHNOLOGY_ENABLERS 0x076aU // Smart Technology Enablers, Inc. -#define UHS_VID_OMNIKEY_AG 0x076bU // OmniKey AG -#define UHS_VID_PARTNER_TECH 0x076cU // Partner Tech -#define UHS_VID_DENSO 0x076dU // Denso Corp. -#define UHS_VID_KUAN_TECH_ENTERPRISE 0x076eU // Kuan Tech Enterprise Co., Ltd -#define UHS_VID_JHEN_VEI_ELECTRONIC 0x076fU // Jhen Vei Electronic Co., Ltd -#define UHS_VID_WELCH_ALLYN_INC__MEDICAL_DIVISION 0x0770U // Welch Allyn, Inc - Medical Division -#define UHS_VID_OBSERVATOR_INSTRUMENTS_BV 0x0771U // Observator Instruments BV -#define UHS_VID_YOUR_DATA_OUR_CARE 0x0772U // Your data Our Care -#define UHS_VID_AMTRAN_TECHNOLOGY 0x0774U // AmTRAN Technology Co., Ltd -#define UHS_VID_LONGSHINE_ELECTRONICS 0x0775U // Longshine Electronics Corp. -#define UHS_VID_INALWAYS 0x0776U // Inalways Corp. -#define UHS_VID_COMDA_ENTERPRISE 0x0777U // Comda Enterprise Corp. -#define UHS_VID_VOLEX 0x0778U // Volex, Inc. -#define UHS_VID_FAIRCHILD_SEMICONDUCTOR 0x0779U // Fairchild Semiconductor -#define UHS_VID_SANKYO_SEIKI_MFG 0x077aU // Sankyo Seiki Mfg. Co., Ltd -#define UHS_VID_LINKSYS_1 0x077bU // Linksys -#define UHS_VID_FORWARD_ELECTRONICS 0x077cU // Forward Electronics Co., Ltd -#define UHS_VID_GRIFFIN_TECHNOLOGY 0x077dU // Griffin Technology -#define UHS_VID_WELL_EXCELLENT_AND_MOST 0x077fU // Well Excellent & Most Corp. -#define UHS_VID_SAGEM_MONETEL 0x0780U // Sagem Monetel GmbH -#define UHS_VID_SANDISK 0x0781U // SanDisk Corp. -#define UHS_VID_TRACKERBALL 0x0782U // Trackerball -#define UHS_VID_C3PO 0x0783U // C3PO -#define UHS_VID_VIVITAR 0x0784U // Vivitar, Inc. -#define UHS_VID_NTT_ME 0x0785U // NTT-ME -#define UHS_VID_LOGITEC 0x0789U // Logitec Corp. -#define UHS_VID_HAPP_CONTROLS 0x078bU // Happ Controls, Inc. -#define UHS_VID_GTCOCALCOMP 0x078cU // GTCO/CalComp -#define UHS_VID_BRINCOM 0x078eU // Brincom, Inc. -#define UHS_VID_PRO_IMAGE_MANUFACTURING 0x0790U // Pro-Image Manufacturing Co., Ltd -#define UHS_VID_COPARTNER_WIRE_AND_CABLE_MFG 0x0791U // Copartner Wire and Cable Mfg. Corp. -#define UHS_VID_AXIS_COMMUNICATIONS 0x0792U // Axis Communications AB -#define UHS_VID_WHA_YU_INDUSTRIAL 0x0793U // Wha Yu Industrial Co., Ltd -#define UHS_VID_ABL_ELECTRONICS 0x0794U // ABL Electronics Corp. -#define UHS_VID_REALCHIP 0x0795U // RealChip, Inc. -#define UHS_VID_CERTICOM 0x0796U // Certicom Corp. -#define UHS_VID_GRANDTECH_SEMICONDUCTOR 0x0797U // Grandtech Semiconductor Corp. -#define UHS_VID_OPTELEC 0x0798U // Optelec -#define UHS_VID_ALTERA 0x0799U // Altera -#define UHS_VID_SAGEM 0x079bU // Sagem -#define UHS_VID_ALFADATA_COMPUTER 0x079dU // Alfadata Computer Corp. -#define UHS_VID_DIGICOM_SPA 0x07a1U // Digicom S.p.A. -#define UHS_VID_NATIONAL_TECHNICAL_SYSTEMS 0x07a2U // National Technical Systems -#define UHS_VID_ONNTO 0x07a3U // Onnto Corp. -#define UHS_VID_BE 0x07a4U // Be, Inc. -#define UHS_VID_ADMTEK 0x07a6U // ADMtek, Inc. -#define UHS_VID_COREGA_KK 0x07aaU // Corega K.K. -#define UHS_VID_FREECOM_TECHNOLOGIES 0x07abU // Freecom Technologies -#define UHS_VID_MICROTECH 0x07afU // Microtech -#define UHS_VID_TRUST_TECHNOLOGIES 0x07b0U // Trust Technologies -#define UHS_VID_IMP 0x07b1U // IMP, Inc. -#define UHS_VID_MOTOROLA_BCS 0x07b2U // Motorola BCS, Inc. -#define UHS_VID_PLUSTEK 0x07b3U // Plustek, Inc. -#define UHS_VID_OLYMPUS_OPTICAL 0x07b4U // Olympus Optical Co., Ltd -#define UHS_VID_MEGA_WORLD_INTERNATIONAL 0x07b5U // Mega World International, Ltd -#define UHS_VID_MARUBUN 0x07b6U // Marubun Corp. -#define UHS_VID_TIME_INTERCONNECT 0x07b7U // TIME Interconnect, Ltd -#define UHS_VID_ABOCOM_SYSTEMS 0x07b8U // AboCom Systems Inc -#define UHS_VID_CANON_COMPUTER_SYSTEMS 0x07bcU // Canon Computer Systems, Inc. -#define UHS_VID_WEBGEAR 0x07bdU // Webgear, Inc. -#define UHS_VID_VERIDICOM 0x07beU // Veridicom -#define UHS_VID_CODE_MERCENARIES_HARD_UND_SOFTWARE 0x07c0U // Code Mercenaries Hard- und Software GmbH -#define UHS_VID_KEISOKUGIKEN 0x07c1U // Keisokugiken -#define UHS_VID_DATAFAB_SYSTEMS 0x07c4U // Datafab Systems, Inc. -#define UHS_VID_APG_CASH_DRAWER 0x07c5U // APG Cash Drawer -#define UHS_VID_SHAREWAVE 0x07c6U // ShareWave, Inc. -#define UHS_VID_POWERTECH_INDUSTRIAL 0x07c7U // Powertech Industrial Co., Ltd -#define UHS_VID_BUG 0x07c8U // B.U.G., Inc. -#define UHS_VID_ALLIED_TELESYN_INTERNATIONAL 0x07c9U // Allied Telesyn International -#define UHS_VID_AVERMEDIA_TECHNOLOGIES 0x07caU // AVerMedia Technologies, Inc. -#define UHS_VID_KINGMAX_TECHNOLOGY 0x07cbU // Kingmax Technology, Inc. -#define UHS_VID_CARRY_COMPUTER_ENG 0x07ccU // Carry Computer Eng., Co., Ltd -#define UHS_VID_ELEKTOR 0x07cdU // Elektor -#define UHS_VID_CASIO_COMPUTER 0x07cfU // Casio Computer Co., Ltd -#define UHS_VID_DAZZLE 0x07d0U // Dazzle -#define UHS_VID_D_LINK_SYSTEM 0x07d1U // D-Link System -#define UHS_VID_APTIO_PRODUCTS 0x07d2U // Aptio Products, Inc. -#define UHS_VID_CYBERDATA 0x07d3U // Cyberdata Corp. -#define UHS_VID_RADIANT_SYSTEMS 0x07d5U // Radiant Systems -#define UHS_VID_GCC_TECHNOLOGIES 0x07d7U // GCC Technologies, Inc. -#define UHS_VID_ARASAN_CHIP_SYSTEMS 0x07daU // Arasan Chip Systems -#define UHS_VID_DIAMOND_MULTIMEDIA 0x07deU // Diamond Multimedia -#define UHS_VID_DAVID_ELECTRONICS 0x07dfU // David Electronics Co., Ltd -#define UHS_VID_AMBIENT_TECHNOLOGIES 0x07e1U // Ambient Technologies, Inc. -#define UHS_VID_ELMEG_GMBH_AND 0x07e2U // Elmeg GmbH & Co., Ltd -#define UHS_VID_PLANEX_COMMUNICATIONS 0x07e3U // Planex Communications, Inc. -#define UHS_VID_MOVADO_ENTERPRISE 0x07e4U // Movado Enterprise Co., Ltd -#define UHS_VID_QPS 0x07e5U // QPS, Inc. -#define UHS_VID_ALLIED_CABLE 0x07e6U // Allied Cable Corp. -#define UHS_VID_MIRVO_TOYS 0x07e7U // Mirvo Toys, Inc. -#define UHS_VID_LABSYSTEMS 0x07e8U // Labsystems -#define UHS_VID_IWATSU_ELECTRIC 0x07eaU // Iwatsu Electric Co., Ltd -#define UHS_VID_DOUBLE_H_TECHNOLOGY 0x07ebU // Double-H Technology Co., Ltd -#define UHS_VID_TAIYO_ELECTRIC_WIRE_AND_CABLE 0x07ecU // Taiyo Electric Wire & Cable Co., Ltd -#define UHS_VID_TOREX_RETAIL_FORMERLY_LOGWARE 0x07eeU // Torex Retail (formerly Logware) -#define UHS_VID_STSN 0x07efU // STSN -#define UHS_VID_MICROCOMPUTER_APPLICATIONS 0x07f2U // Microcomputer Applications, Inc. -#define UHS_VID_CIRCUIT_ASSEMBLY 0x07f6U // Circuit Assembly Corp. -#define UHS_VID_CENTURY 0x07f7U // Century Corp. -#define UHS_VID_DOTOP_TECHNOLOGY 0x07f9U // Dotop Technology, Inc. -#define UHS_VID_DRAYTEK_1 0x07faU // DrayTek Corp. -#define UHS_VID_MARK_OF_THE_UNICORN 0x07fdU // Mark of the Unicorn -#define UHS_VID_UNKNOWN_2 0x07ffU // Unknown -#define UHS_VID_MAGTEK 0x0801U // MagTek -#define UHS_VID_MAKO_TECHNOLOGIES 0x0802U // Mako Technologies, LLC -#define UHS_VID_ZOOM_TELEPHONICS 0x0803U // Zoom Telephonics, Inc. -#define UHS_VID_GENICOM_TECHNOLOGY 0x0809U // Genicom Technology, Inc. -#define UHS_VID_EVERMUCH_TECHNOLOGY 0x080aU // Evermuch Technology Co., Ltd -#define UHS_VID_CROSS_MATCH_TECHNOLOGIES 0x080bU // Cross Match Technologies -#define UHS_VID_DATALOGIC_SPA 0x080cU // Datalogic S.p.A. -#define UHS_VID_TECO_IMAGE_SYSTEMS 0x080dU // Teco Image Systems Co., Ltd -#define UHS_VID_PERSONAL_COMMUNICATION_SYSTEMS 0x0810U // Personal Communication Systems, Inc. -#define UHS_VID_MATTEL 0x0813U // Mattel, Inc. -#define UHS_VID_ELICENSER 0x0819U // eLicenser -#define UHS_VID_MG_LOGIC 0x081aU // MG Logic -#define UHS_VID_INDIGITA 0x081bU // Indigita Corp. -#define UHS_VID_MIPSYS 0x081cU // Mipsys -#define UHS_VID_ALPHASMART 0x081eU // AlphaSmart, Inc. -#define UHS_VID_REUDO 0x0822U // Reudo Corp. -#define UHS_VID_GC_PROTRONICS 0x0825U // GC Protronics -#define UHS_VID_DATA_TRANSIT 0x0826U // Data Transit -#define UHS_VID_BROADLOGIC 0x0827U // BroadLogic, Inc. -#define UHS_VID_SATO 0x0828U // Sato Corp. -#define UHS_VID_DIRECTV_BROADBAND_INC_TELOCITY 0x0829U // DirecTV Broadband, Inc. (Telocity) -#define UHS_VID_HANDSPRING 0x082dU // Handspring -#define UHS_VID_PALM 0x0830U // Palm, Inc. -#define UHS_VID_KOUWELL_ELECTRONICS 0x0832U // Kouwell Electronics Corp. -#define UHS_VID_SOURCENEXT 0x0833U // Sourcenext Corp. -#define UHS_VID_ACTION_STAR_ENTERPRISE 0x0835U // Action Star Enterprise Co., Ltd -#define UHS_VID_TREKSTOR 0x0836U // TrekStor -#define UHS_VID_SAMSUNG_TECHWIN 0x0839U // Samsung Techwin Co., Ltd -#define UHS_VID_ACCTON_TECHNOLOGY 0x083aU // Accton Technology Corp. -#define UHS_VID_GLOBAL_VILLAGE 0x083fU // Global Village -#define UHS_VID_ARGOSY_RESEARCH 0x0840U // Argosy Research, Inc. -#define UHS_VID_RIOPORTCOM 0x0841U // Rioport.com, Inc. -#define UHS_VID_WELLAND_INDUSTRIAL 0x0844U // Welland Industrial Co., Ltd -#define UHS_VID_NETGEAR 0x0846U // NetGear, Inc. -#define UHS_VID_MINTON_OPTIC_INDUSTRY 0x084dU // Minton Optic Industry Co., Inc. -#define UHS_VID_KB_GEAR 0x084eU // KB Gear -#define UHS_VID_EMPEG 0x084fU // Empeg -#define UHS_VID_FAST_POINT_TECHNOLOGIES 0x0850U // Fast Point Technologies, Inc. -#define UHS_VID_MACRONIX_INTERNATIONAL 0x0851U // Macronix International Co., Ltd -#define UHS_VID_CSEM 0x0852U // CSEM -#define UHS_VID_TOPRE_CORPORATION 0x0853U // Topre Corporation -#define UHS_VID_ACTIVEWIRE 0x0854U // ActiveWire, Inc. -#define UHS_VID_BANDB_ELECTRONICS 0x0856U // B&B Electronics -#define UHS_VID_HITACHI_MAXELL 0x0858U // Hitachi Maxell, Ltd -#define UHS_VID_MINOLTA_SYSTEMS_LABORATORY 0x0859U // Minolta Systems Laboratory, Inc. -#define UHS_VID_XIRCOM 0x085aU // Xircom -#define UHS_VID_COLORVISION 0x085cU // ColorVision, Inc. -#define UHS_VID_TELETROL_SYSTEMS 0x0862U // Teletrol Systems, Inc. -#define UHS_VID_FILANET 0x0863U // Filanet Corp. -#define UHS_VID_NETGEAR_1 0x0864U // NetGear, Inc. -#define UHS_VID_DATA_TRANSLATION 0x0867U // Data Translation, Inc. -#define UHS_VID_EMAGIC_SOFT_UND_HARDWARE 0x086aU // Emagic Soft- und Hardware GmbH -#define UHS_VID_DETEWE__DEUTSCHE_TELEPHONWERKE_AG_AND 0x086cU // DeTeWe - Deutsche Telephonwerke AG & Co. -#define UHS_VID_SYSTEM_TALKS 0x086eU // System TALKS, Inc. -#define UHS_VID_MEC_IMEX 0x086fU // MEC IMEX, Inc. -#define UHS_VID_METRICOM 0x0870U // Metricom -#define UHS_VID_SANDISK_1 0x0871U // SanDisk, Inc. -#define UHS_VID_XPEED 0x0873U // Xpeed, Inc. -#define UHS_VID_A_TEC_SUBSYSTEM 0x0874U // A-Tec Subsystem, Inc. -#define UHS_VID_COMTROL 0x0879U // Comtrol Corp. -#define UHS_VID_ADESSOKBTEK_AMERICA 0x087cU // Adesso/Kbtek America, Inc. -#define UHS_VID_JATON 0x087dU // Jaton Corp. -#define UHS_VID_FUJITSU_COMPUTER_PRODUCTS_OF_AMERICA 0x087eU // Fujitsu Computer Products of America -#define UHS_VID_QUALCORE_LOGIC 0x087fU // QualCore Logic Inc. -#define UHS_VID_APT_TECHNOLOGIES 0x0880U // APT Technologies, Inc. -#define UHS_VID_RECORDING_INDUSTRY_ASSOCIATION_OF_AMERICA_RIAA 0x0883U // Recording Industry Association of America (RIAA) -#define UHS_VID_BOCA_RESEARCH 0x0885U // Boca Research, Inc. -#define UHS_VID_XAC_AUTOMATION 0x0886U // XAC Automation Corp. -#define UHS_VID_HANNSTAR_ELECTRONICS 0x0887U // Hannstar Electronics Corp. -#define UHS_VID_TECHTOOLS 0x088aU // TechTools -#define UHS_VID_MASSWORKS 0x088bU // MassWorks, Inc. -#define UHS_VID_SWECOIN 0x088cU // Swecoin AB -#define UHS_VID_ILOK 0x088eU // iLok -#define UHS_VID_DIOGRAPHY 0x0892U // DioGraphy, Inc. -#define UHS_VID_TSI_INCORPORATED 0x0894U // TSI Incorporated -#define UHS_VID_LAUTERBACH 0x0897U // Lauterbach -#define UHS_VID_UNITED_TECHNOLOGIES_RESEARCH_CNTR 0x089cU // United Technologies Research Cntr. -#define UHS_VID_ICRON_TECHNOLOGIES 0x089dU // Icron Technologies Corp. -#define UHS_VID_NST 0x089eU // NST Co., Ltd -#define UHS_VID_PRIMEX_AEROSPACE 0x089fU // Primex Aerospace Co. -#define UHS_VID_E9 0x08a5U // e9, Inc. -#define UHS_VID_TOSHIBA_TEC 0x08a6U // Toshiba TEC -#define UHS_VID_ANDREA_ELECTRONICS 0x08a8U // Andrea Electronics -#define UHS_VID_CWAV 0x08a9U // CWAV Inc. -#define UHS_VID_MACRAIGOR_SYSTEMS 0x08acU // Macraigor Systems LLC -#define UHS_VID_MACALLY_MACE_GROUP 0x08aeU // Macally (Mace Group, Inc.) -#define UHS_VID_METROHM 0x08b0U // Metrohm -#define UHS_VID_SORENSON_VISION 0x08b4U // Sorenson Vision, Inc. -#define UHS_VID_NATSU 0x08b7U // NATSU -#define UHS_VID_J_GORDON_ELECTRONIC_DESIGN 0x08b8U // J. Gordon Electronic Design, Inc. -#define UHS_VID_RADIOSHACK_CORP_TANDY 0x08b9U // RadioShack Corp. (Tandy) -#define UHS_VID_TEXAS_INSTRUMENTS_1 0x08bbU // Texas Instruments -#define UHS_VID_CITIZEN_WATCH 0x08bdU // Citizen Watch Co., Ltd -#define UHS_VID_PRECISE_BIOMETRICS 0x08c3U // Precise Biometrics -#define UHS_VID_PROXIM 0x08c4U // Proxim, Inc. -#define UHS_VID_KEY_NICE_ENTERPRISE 0x08c7U // Key Nice Enterprise Co., Ltd -#define UHS_VID_2WIRE 0x08c8U // 2Wire, Inc. -#define UHS_VID_NIPPON_TELEGRAPH_AND_TELEPHONE 0x08c9U // Nippon Telegraph and Telephone Corp. -#define UHS_VID_AIPTEK_INTERNATIONAL 0x08caU // Aiptek International, Inc. -#define UHS_VID_JUE_HSUN_IND 0x08cdU // Jue Hsun Ind. Corp. -#define UHS_VID_LONG_WELL_ELECTRONICS 0x08ceU // Long Well Electronics Corp. -#define UHS_VID_PRODUCTIVITY_ENHANCEMENT_PRODUCTS 0x08cfU // Productivity Enhancement Products -#define UHS_VID_SMARTBRIDGES 0x08d1U // smartBridges, Inc. -#define UHS_VID_VIRTUAL_INK 0x08d3U // Virtual Ink -#define UHS_VID_FUJITSU_SIEMENS_COMPUTERS 0x08d4U // Fujitsu Siemens Computers -#define UHS_VID_IXXAT_AUTOMATION 0x08d8U // IXXAT Automation GmbH -#define UHS_VID_INCREMENT_P 0x08d9U // Increment P Corp. -#define UHS_VID_BILLIONTON_SYSTEMS 0x08ddU // Billionton Systems, Inc. -#define UHS_VID__UNKNOWN 0x08deU // ? -#define UHS_VID_SPYRUS 0x08dfU // Spyrus, Inc. -#define UHS_VID_OLITEC 0x08e3U // Olitec, Inc. -#define UHS_VID_PIONEER 0x08e4U // Pioneer Corp. -#define UHS_VID_LITRONIC 0x08e5U // Litronic -#define UHS_VID_GEMALTO_WAS_GEMPLUS 0x08e6U // Gemalto (was Gemplus) -#define UHS_VID_PAN_INTERNATIONAL_WIRE_AND_CABLE 0x08e7U // Pan-International Wire & Cable -#define UHS_VID_INTEGRATED_MEMORY_LOGIC 0x08e8U // Integrated Memory Logic -#define UHS_VID_EXTENDED_SYSTEMS 0x08e9U // Extended Systems, Inc. -#define UHS_VID_ERICSSON_INC_BLUE_RIDGE_LABS 0x08eaU // Ericsson, Inc., Blue Ridge Labs -#define UHS_VID_M_SYSTEMS_FLASH_DISK_PIONEERS 0x08ecU // M-Systems Flash Disk Pioneers -#define UHS_VID_MEDIATEK 0x08edU // MediaTek Inc. -#define UHS_VID_CCSIHESSO 0x08eeU // CCSI/Hesso -#define UHS_VID_COREX_TECHNOLOGIES 0x08f0U // Corex Technologies -#define UHS_VID_CTI_ELECTRONICS 0x08f1U // CTI Electronics Corp. -#define UHS_VID_GOTOP_INFORMATION 0x08f2U // Gotop Information Inc. -#define UHS_VID_SYSTEC 0x08f5U // SysTec Co., Ltd -#define UHS_VID_LOGIC_3_INTERNATIONAL 0x08f6U // Logic 3 International, Ltd -#define UHS_VID_VERNIER 0x08f7U // Vernier -#define UHS_VID_KEEN_TOP_INTERNATIONAL_ENTERPRISE 0x08f8U // Keen Top International Enterprise Co., Ltd -#define UHS_VID_WIPRO_TECHNOLOGIES 0x08f9U // Wipro Technologies -#define UHS_VID_CAERE 0x08faU // Caere -#define UHS_VID_SOCKET_COMMUNICATIONS 0x08fbU // Socket Communications -#define UHS_VID_SICON_CABLE_TECHNOLOGY 0x08fcU // Sicon Cable Technology Co., Ltd -#define UHS_VID_DIGIANSWER_AS 0x08fdU // Digianswer A/S -#define UHS_VID_AUTHENTEC 0x08ffU // AuthenTec, Inc. -#define UHS_VID_PINNACLE_SYSTEMS 0x0900U // Pinnacle Systems, Inc. -#define UHS_VID_VST_TECHNOLOGIES 0x0901U // VST Technologies -#define UHS_VID_FARADAY_TECHNOLOGY 0x0906U // Faraday Technology Corp. -#define UHS_VID_SIEMENS_AG 0x0908U // Siemens AG -#define UHS_VID_AUDIO_TECHNICA 0x0909U // Audio-Technica Corp. -#define UHS_VID_TRUMPION_MICROELECTRONICS 0x090aU // Trumpion Microelectronics, Inc. -#define UHS_VID_NEUROSMITH 0x090bU // Neurosmith -#define UHS_VID_SILICON_MOTION_INC__TAIWAN_FORMERLY_FEIYA_TECHNOLOGY 0x090cU // Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) -#define UHS_VID_MULTIPORT_COMPUTER_VERTRIEBS 0x090dU // Multiport Computer Vertriebs GmbH -#define UHS_VID_SHINING_TECHNOLOGY 0x090eU // Shining Technology, Inc. -#define UHS_VID_FUJITSU_DEVICES 0x090fU // Fujitsu Devices, Inc. -#define UHS_VID_ALATION_SYSTEMS 0x0910U // Alation Systems, Inc. -#define UHS_VID_PHILIPS_SPEECH_PROCESSING 0x0911U // Philips Speech Processing -#define UHS_VID_VOQUETTE 0x0912U // Voquette, Inc. -#define UHS_VID_GLOBESPAN 0x0915U // GlobeSpan, Inc. -#define UHS_VID_SMARTDISK 0x0917U // SmartDisk Corp. -#define UHS_VID_TIGER_ELECTRONICS 0x0919U // Tiger Electronics -#define UHS_VID_GARMIN_INTERNATIONAL 0x091eU // Garmin International -#define UHS_VID_ECHELON 0x0920U // Echelon Co. -#define UHS_VID_GOHUBS 0x0921U // GoHubs, Inc. -#define UHS_VID_DYMO_COSTAR 0x0922U // Dymo-CoStar Corp. -#define UHS_VID_IC_MEDIA 0x0923U // IC Media Corp. -#define UHS_VID_XEROX 0x0924U // Xerox -#define UHS_VID_LAKEVIEW_RESEARCH 0x0925U // Lakeview Research -#define UHS_VID_SUMMUS 0x0927U // Summus, Ltd -#define UHS_VID_PLX_TECHNOLOGY_INC_FORMERLY_OXFORD_SEMICONDUCTOR 0x0928U // PLX Technology, Inc. (formerly Oxford Semiconductor, Ltd) -#define UHS_VID_AMERICAN_BIOMETRIC 0x0929U // American Biometric Co. -#define UHS_VID_TOSHIBA_INFORMATION_AND_INDUSTRIAL_SYS_AND_SERVICES 0x092aU // Toshiba Information & Industrial Sys. And Services -#define UHS_VID_SENA_TECHNOLOGIES 0x092bU // Sena Technologies, Inc. -#define UHS_VID_NORTHERN_EMBEDDED_SCIENCECAVNEX 0x092fU // Northern Embedded Science/CAVNEX -#define UHS_VID_TOSHIBA_1 0x0930U // Toshiba Corp. -#define UHS_VID_HARMONIC_DATA_SYSTEMS 0x0931U // Harmonic Data Systems, Ltd -#define UHS_VID_CRESCENTEC 0x0932U // Crescentec Corp. -#define UHS_VID_QUANTUM 0x0933U // Quantum Corp. -#define UHS_VID_SPIRENT_COMMUNICATIONS 0x0934U // Spirent Communications -#define UHS_VID_NUTESLA 0x0936U // NuTesla -#define UHS_VID_LUMBERG 0x0939U // Lumberg, Inc. -#define UHS_VID_PIXART_IMAGING 0x093aU // Pixart Imaging, Inc. -#define UHS_VID_PLEXTOR 0x093bU // Plextor Corp. -#define UHS_VID_INTREPID_CONTROL_SYSTEMS 0x093cU // Intrepid Control Systems, Inc. -#define UHS_VID_INNOSYNC 0x093dU // InnoSync, Inc. -#define UHS_VID_JST_MFG 0x093eU // J.S.T. Mfg. Co., Ltd -#define UHS_VID_OLYMPIA_TELECOM_VERTRIEBS 0x093fU // Olympia Telecom Vertriebs GmbH -#define UHS_VID_JAPAN_STORAGE_BATTERY 0x0940U // Japan Storage Battery Co., Ltd -#define UHS_VID_PHOTOBIT 0x0941U // Photobit Corp. -#define UHS_VID_I2GOCOM 0x0942U // i2Go.com, LLC -#define UHS_VID_HCL_TECHNOLOGIES_INDIA_PRIVATE 0x0943U // HCL Technologies India Private, Ltd -#define UHS_VID_KORG 0x0944U // KORG, Inc. -#define UHS_VID_PASCO_SCIENTIFIC 0x0945U // Pasco Scientific -#define UHS_VID_KRONAUER_MUSIC_IN_DIGITAL 0x0948U // Kronauer music in digital -#define UHS_VID_LINKUP_SYSTEMS 0x094bU // Linkup Systems Corp. -#define UHS_VID_CABLE_TELEVISION_LABORATORIES 0x094dU // Cable Television Laboratories -#define UHS_VID_YANO 0x094fU // Yano -#define UHS_VID_KINGSTON_TECHNOLOGY 0x0951U // Kingston Technology -#define UHS_VID_RPM_SYSTEMS 0x0954U // RPM Systems Corp. -#define UHS_VID_NVIDIA 0x0955U // NVidia Corp. -#define UHS_VID_BSQUARE 0x0956U // BSquare Corp. -#define UHS_VID_AGILENT_TECHNOLOGIES 0x0957U // Agilent Technologies, Inc. -#define UHS_VID_COMPULINK_RESEARCH 0x0958U // CompuLink Research, Inc. -#define UHS_VID_COLOGNE_CHIP_AG 0x0959U // Cologne Chip AG -#define UHS_VID_PORTSMITH 0x095aU // Portsmith -#define UHS_VID_MEDIALOGIC 0x095bU // Medialogic Corp. -#define UHS_VID_K_TEC_ELECTRONICS 0x095cU // K-Tec Electronics -#define UHS_VID_POLYCOM 0x095dU // Polycom, Inc. -#define UHS_VID_ACER_NEWEB 0x0967U // Acer NeWeb Corp. -#define UHS_VID_CATALYST_ENTERPRISES 0x0968U // Catalyst Enterprises, Inc. -#define UHS_VID_FEITIAN_TECHNOLOGIES 0x096eU // Feitian Technologies, Inc. -#define UHS_VID_GRETAG_MACBETH_AG 0x0971U // Gretag-Macbeth AG -#define UHS_VID_SCHLUMBERGER 0x0973U // Schlumberger -#define UHS_VID_DATAGRAPHIX_A_BUSINESS_UNIT_OF_ANACOMP 0x0974U // Datagraphix, a business unit of Anacomp -#define UHS_VID_OLE_COMMUNICATIONS 0x0975U // OL'E Communications, Inc. -#define UHS_VID_ADIRONDACK_WIRE_AND_CABLE 0x0976U // Adirondack Wire & Cable -#define UHS_VID_LIGHTSURF_TECHNOLOGIES 0x0977U // Lightsurf Technologies -#define UHS_VID_BECKHOFF 0x0978U // Beckhoff GmbH -#define UHS_VID_JEILIN_TECHNOLOGY 0x0979U // Jeilin Technology Corp., Ltd -#define UHS_VID_MINDS_AT_WORK 0x097aU // Minds At Work LLC -#define UHS_VID_KNUDSEN_ENGINEERING 0x097bU // Knudsen Engineering, Ltd -#define UHS_VID_MARUNIX 0x097cU // Marunix Co., Ltd -#define UHS_VID_ROSUN_TECHNOLOGIES 0x097dU // Rosun Technologies, Inc. -#define UHS_VID_BIOPAC_SYSTEMS 0x097eU // Biopac Systems Inc. -#define UHS_VID_BARUN_ELECTRONICS 0x097fU // Barun Electronics Co., Ltd -#define UHS_VID_OAK_TECHNOLOGY_1 0x0981U // Oak Technology, Ltd -#define UHS_VID_APRICORN 0x0984U // Apricorn -#define UHS_VID_CAB_PRODUKTTECHNIK_GMBH_AND_CO_KG 0x0985U // cab Produkttechnik GmbH & Co KG -#define UHS_VID_MATSUSHITA_ELECTRIC_WORKS 0x0986U // Matsushita Electric Works, Ltd. -#define UHS_VID_VITANA 0x098cU // Vitana Corp. -#define UHS_VID_INDESIGN 0x098dU // INDesign -#define UHS_VID_INTEGRATED_INTELLECTUAL_PROPERTY 0x098eU // Integrated Intellectual Property, Inc. -#define UHS_VID_KENWOOD_TMI 0x098fU // Kenwood TMI Corp. -#define UHS_VID_GEMSTAR_EBOOK_GROUP 0x0993U // Gemstar eBook Group, Ltd -#define UHS_VID_INTEGRATED_TELECOM_EXPRESS 0x0996U // Integrated Telecom Express, Inc. -#define UHS_VID_ZIPPY_TECHNOLOGY 0x099aU // Zippy Technology Corp. -#define UHS_VID_PAIRGAIN_TECHNOLOGIES 0x09a3U // PairGain Technologies -#define UHS_VID_CONTECH_RESEARCH 0x09a4U // Contech Research, Inc. -#define UHS_VID_VCON_TELECOMMUNICATIONS 0x09a5U // VCON Telecommunications -#define UHS_VID_POINCHIPS 0x09a6U // Poinchips -#define UHS_VID_DATA_TRANSMISSION_NETWORK 0x09a7U // Data Transmission Network Corp. -#define UHS_VID_LIN_SHIUNG_ENTERPRISE 0x09a8U // Lin Shiung Enterprise Co., Ltd -#define UHS_VID_SMART_CARD_TECHNOLOGIES 0x09a9U // Smart Card Technologies Co., Ltd -#define UHS_VID_INTERSIL 0x09aaU // Intersil Corp. -#define UHS_VID_JAPAN_CASH_MACHINE 0x09abU // Japan Cash Machine Co., Ltd. -#define UHS_VID_TRIPP_LITE 0x09aeU // Tripp Lite -#define UHS_VID_FRANKLIN_ELECTRONIC_PUBLISHERS 0x09b2U // Franklin Electronic Publishers, Inc. -#define UHS_VID_ALTIUS_SOLUTIONS 0x09b3U // Altius Solutions, Inc. -#define UHS_VID_MDS_TELEPHONE_SYSTEMS 0x09b4U // MDS Telephone Systems -#define UHS_VID_CELLTRIX_TECHNOLOGY 0x09b5U // Celltrix Technology Co., Ltd -#define UHS_VID_GRUNDIG 0x09bcU // Grundig -#define UHS_VID_MYSMARTCOM 0x09beU // MySmart.Com -#define UHS_VID_AUERSWALD_GMBH_AND_CO_KG 0x09bfU // Auerswald GmbH & Co. KG -#define UHS_VID_GENPIX_ELECTRONICS 0x09c0U // Genpix Electronics, LLC -#define UHS_VID_ARRIS_INTERACTIVE 0x09c1U // Arris Interactive LLC -#define UHS_VID_NISCA 0x09c2U // Nisca Corp. -#define UHS_VID_ACTIVCARD 0x09c3U // ActivCard, Inc. -#define UHS_VID_ACTISYS 0x09c4U // ACTiSYS Corp. -#define UHS_VID_MEMORY 0x09c5U // Memory Corp. -#define UHS_VID_BMC_MESSSYSTEME 0x09caU // BMC Messsysteme GmbH -#define UHS_VID_WORKBIT 0x09ccU // Workbit Corp. -#define UHS_VID_PSION_DACOM_HOME_NETWORKS 0x09cdU // Psion Dacom Home Networks, Ltd -#define UHS_VID_CITY_ELECTRONICS 0x09ceU // City Electronics, Ltd -#define UHS_VID_ELECTRONICS_TESTING_CENTER_TAIWAN 0x09cfU // Electronics Testing Center, Taiwan -#define UHS_VID_NEOMAGIC 0x09d1U // NeoMagic, Inc. -#define UHS_VID_VREELIN_ENGINEERING 0x09d2U // Vreelin Engineering, Inc. -#define UHS_VID_COM_ONE 0x09d3U // Com One -#define UHS_VID_NOVATEL_WIRELESS 0x09d7U // Novatel Wireless -#define UHS_VID_KRF_TECH 0x09d9U // KRF Tech, Ltd -#define UHS_VID_A4TECH 0x09daU // A4Tech Co., Ltd. -#define UHS_VID_MEASUREMENT_COMPUTING 0x09dbU // Measurement Computing Corp. -#define UHS_VID_AIMEX 0x09dcU // Aimex Corp. -#define UHS_VID_FELLOWES 0x09ddU // Fellowes, Inc. -#define UHS_VID_ADDONICS_TECHNOLOGIES 0x09dfU // Addonics Technologies Corp. -#define UHS_VID_INTELLON 0x09e1U // Intellon Corp. -#define UHS_VID_JO_DAN_INTERNATIONAL 0x09e5U // Jo-Dan International, Inc. -#define UHS_VID_SILUTIA 0x09e6U // Silutia, Inc. -#define UHS_VID_REAL_3D 0x09e7U // Real 3D, Inc. -#define UHS_VID_AKAI_PROFESSIONAL_MI 0x09e8U // AKAI Professional M.I. Corp. -#define UHS_VID_CHEN_SOURCE 0x09e9U // Chen-Source, Inc. -#define UHS_VID_IM_NETWORKS 0x09ebU // IM Networks, Inc. -#define UHS_VID_XITEL 0x09efU // Xitel -#define UHS_VID_GOFLIGHT 0x09f3U // GoFlight, Inc. -#define UHS_VID_ARESCOM 0x09f5U // AresCom -#define UHS_VID_ROCKETCHIPS 0x09f6U // RocketChips, Inc. -#define UHS_VID_EDU_SCIENCE_HK 0x09f7U // Edu-Science (H.K.), Ltd -#define UHS_VID_SOFTCONNEX_TECHNOLOGIES 0x09f8U // SoftConnex Technologies, Inc. -#define UHS_VID_BAY_ASSOCIATES 0x09f9U // Bay Associates -#define UHS_VID_MTEK_VISION 0x09faU // Mtek Vision -#define UHS_VID_ALTERA_1 0x09fbU // Altera -#define UHS_VID_GAIN_TECHNOLOGY 0x09ffU // Gain Technology Corp. -#define UHS_VID_LIQUID_AUDIO 0x0a00U // Liquid Audio -#define UHS_VID_VIA 0x0a01U // ViA, Inc. -#define UHS_VID_UNKNOWN_MANUFACTURER 0x0a05U // Unknown Manufacturer -#define UHS_VID_ONTRAK_CONTROL_SYSTEMS 0x0a07U // Ontrak Control Systems Inc. -#define UHS_VID_CYBEX_COMPUTER_PRODUCTS 0x0a0bU // Cybex Computer Products Co. -#define UHS_VID_SERVERGY 0x0a0dU // Servergy, Inc -#define UHS_VID_XENTEC 0x0a11U // Xentec, Inc. -#define UHS_VID_CAMBRIDGE_SILICON_RADIO 0x0a12U // Cambridge Silicon Radio, Ltd -#define UHS_VID_TELEBYTE 0x0a13U // Telebyte, Inc. -#define UHS_VID_SPACELABS_MEDICAL 0x0a14U // Spacelabs Medical, Inc. -#define UHS_VID_SCALAR 0x0a15U // Scalar Corp. -#define UHS_VID_TREK_TECHNOLOGY_S_PTE 0x0a16U // Trek Technology (S) PTE, Ltd -#define UHS_VID_PENTAX 0x0a17U // Pentax Corp. -#define UHS_VID_HEIDELBERGER_DRUCKMASCHINEN_AG 0x0a18U // Heidelberger Druckmaschinen AG -#define UHS_VID_HUA_GENG_TECHNOLOGIES 0x0a19U // Hua Geng Technologies, Inc. -#define UHS_VID_MEDTRONIC_PHYSIO_CONTROL 0x0a21U // Medtronic Physio Control Corp. -#define UHS_VID_CENTURY_SEMICONDUCTOR_USA 0x0a22U // Century Semiconductor USA, Inc. -#define UHS_VID_DATACARD_GROUP 0x0a27U // Datacard Group -#define UHS_VID_AK_MODUL_BUS_COMPUTER 0x0a2cU // AK-Modul-Bus Computer GmbH -#define UHS_VID_TG3_ELECTRONICS 0x0a34U // TG3 Electronics, Inc. -#define UHS_VID_RADIKAL_TECHNOLOGIES 0x0a35U // Radikal Technologies -#define UHS_VID_GILAT_SATELLITE_NETWORKS 0x0a39U // Gilat Satellite Networks, Ltd -#define UHS_VID_PENTAMEDIA 0x0a3aU // PentaMedia Co., Ltd -#define UHS_VID_NTT_DOCOMO 0x0a3cU // NTT DoCoMo, Inc. -#define UHS_VID_VARO_VISION 0x0a3dU // Varo Vision -#define UHS_VID_SWISSONIC_AG 0x0a3fU // Swissonic AG -#define UHS_VID_BOCA_SYSTEMS 0x0a43U // Boca Systems, Inc. -#define UHS_VID_DAVICOM_SEMICONDUCTOR 0x0a46U // Davicom Semiconductor, Inc. -#define UHS_VID_HIROSE_ELECTRIC 0x0a47U // Hirose Electric -#define UHS_VID_IO_INTERCONNECT 0x0a48U // I/O Interconnect -#define UHS_VID_PLOYTEC 0x0a4aU // Ploytec GmbH -#define UHS_VID_FUJITSU_MEDIA_DEVICES 0x0a4bU // Fujitsu Media Devices, Ltd -#define UHS_VID_COMPUTEX 0x0a4cU // Computex Co., Ltd -#define UHS_VID_EVOLUTION_ELECTRONICS 0x0a4dU // Evolution Electronics, Ltd -#define UHS_VID_STEINBERG_SOFT_UND_HARDWARE 0x0a4eU // Steinberg Soft-und Hardware GmbH -#define UHS_VID_LITTON_SYSTEMS 0x0a4fU // Litton Systems, Inc. -#define UHS_VID_MIMAKI_ENGINEERING 0x0a50U // Mimaki Engineering Co., Ltd -#define UHS_VID_SONY_ELECTRONICS 0x0a51U // Sony Electronics, Inc. -#define UHS_VID_JEBSEE_ELECTRONICS 0x0a52U // Jebsee Electronics Co., Ltd -#define UHS_VID_PORTABLE_PERIPHERAL 0x0a53U // Portable Peripheral Co., Ltd -#define UHS_VID_ELECTRONICS_FOR_IMAGING 0x0a5aU // Electronics For Imaging, Inc. -#define UHS_VID_EASICS_NV 0x0a5bU // EAsics NV -#define UHS_VID_BROADCOM 0x0a5cU // Broadcom Corp. -#define UHS_VID_DIATREND 0x0a5dU // Diatrend Corp. -#define UHS_VID_ZEBRA 0x0a5fU // Zebra -#define UHS_VID_MPMAN 0x0a62U // MPMan -#define UHS_VID_CLEARCUBE_TECHNOLOGY 0x0a66U // ClearCube Technology -#define UHS_VID_MEDELI_ELECTRONICS 0x0a67U // Medeli Electronics Co., Ltd -#define UHS_VID_COMAIDE 0x0a68U // Comaide Corp. -#define UHS_VID_CHROMA_ATE 0x0a69U // Chroma ate, Inc. -#define UHS_VID_GREEN_HOUSE 0x0a6bU // Green House Co., Ltd -#define UHS_VID_INTEGRATED_CIRCUIT_SYSTEMS 0x0a6cU // Integrated Circuit Systems, Inc. -#define UHS_VID_UPS_MANUFACTURING 0x0a6dU // UPS Manufacturing -#define UHS_VID_BENWIN 0x0a6eU // Benwin -#define UHS_VID_CORE_TECHNOLOGY 0x0a6fU // Core Technology, Inc. -#define UHS_VID_INTERNATIONAL_GAME_TECHNOLOGY 0x0a70U // International Game Technology -#define UHS_VID_VIPCOLOR_TECHNOLOGIES_USA 0x0a71U // VIPColor Technologies USA, Inc. -#define UHS_VID_SANWA_DENSHI 0x0a72U // Sanwa Denshi -#define UHS_VID_MACKIE_DESIGNS 0x0a73U // Mackie Designs -#define UHS_VID_NSTL 0x0a7dU // NSTL, Inc. -#define UHS_VID_OCTAGON_SYSTEMS 0x0a7eU // Octagon Systems Corp. -#define UHS_VID_REXON_TECHNOLOGY 0x0a80U // Rexon Technology Corp., Ltd -#define UHS_VID_CHESEN_ELECTRONICS 0x0a81U // Chesen Electronics Corp. -#define UHS_VID_SYSCAN 0x0a82U // Syscan -#define UHS_VID_NEXTCOMM 0x0a83U // NextComm, Inc. -#define UHS_VID_MAUI_INNOVATIVE_PERIPHERALS 0x0a84U // Maui Innovative Peripherals -#define UHS_VID_IDEXX_LABS 0x0a85U // Idexx Labs -#define UHS_VID_NITGEN 0x0a86U // NITGen Co., Ltd -#define UHS_VID_AKTIV 0x0a89U // Aktiv -#define UHS_VID_PICTURETEL 0x0a8dU // Picturetel -#define UHS_VID_JAPAN_AVIATION_ELECTRONICS_INDUSTRY 0x0a8eU // Japan Aviation Electronics Industry, Ltd -#define UHS_VID_CANDY_TECHNOLOGY 0x0a90U // Candy Technology Co., Ltd -#define UHS_VID_GLOBLINK_TECHNOLOGY 0x0a91U // Globlink Technology, Inc. -#define UHS_VID_EGO_SYSTEMS 0x0a92U // EGO SYStems, Inc. -#define UHS_VID_C_TECHNOLOGIES 0x0a93U // C Technologies AB -#define UHS_VID_INTERSENSE 0x0a94U // Intersense -#define UHS_VID_LAVA_COMPUTER_MFG 0x0aa3U // Lava Computer Mfg., Inc. -#define UHS_VID_DEVELCO_ELEKTRONIK 0x0aa4U // Develco Elektronik -#define UHS_VID_FIRST_INTERNATIONAL_DIGITAL 0x0aa5U // First International Digital -#define UHS_VID_PERCEPTION_DIGITAL 0x0aa6U // Perception Digital, Ltd -#define UHS_VID_WINCOR_NIXDORF_INTERNATIONAL 0x0aa7U // Wincor Nixdorf International GmbH -#define UHS_VID_TRIGEM_COMPUTER 0x0aa8U // TriGem Computer, Inc. -#define UHS_VID_BAROMTEC 0x0aa9U // Baromtec Co. -#define UHS_VID_JAPAN_CBM 0x0aaaU // Japan CBM Corp. -#define UHS_VID_VISION_SHAPE_EUROPE 0x0aabU // Vision Shape Europe SA -#define UHS_VID_ICOMPRESSION 0x0aacU // iCompression, Inc. -#define UHS_VID_ROHDE_AND_SCHWARZ_GMBH_AND_CO_KG 0x0aadU // Rohde & Schwarz GmbH & Co. KG -#define UHS_VID_NEC_INFRONTIA_CORP_NITSUKO 0x0aaeU // NEC infrontia Corp. (Nitsuko) -#define UHS_VID_DIGITALWAY 0x0aafU // Digitalway Co., Ltd -#define UHS_VID_ARROW_STRONG_ELECTRONICS 0x0ab0U // Arrow Strong Electronics Co., Ltd -#define UHS_VID_FEIG_ELECTRONIC 0x0ab1U // FEIG ELECTRONIC GmbH -#define UHS_VID_ELLISYS 0x0abaU // Ellisys -#define UHS_VID_STEREO_LINK 0x0abeU // Stereo-Link -#define UHS_VID_DIOLAN 0x0abfU // Diolan -#define UHS_VID_SANYO_SEMICONDUCTOR_COMPANY_MICRO 0x0ac3U // Sanyo Semiconductor Company Micro -#define UHS_VID_LECO 0x0ac4U // Leco Corp. -#define UHS_VID_I_AND_C 0x0ac5U // I & C Corp. -#define UHS_VID_SINGING_ELECTRONS 0x0ac6U // Singing Electrons, Inc. -#define UHS_VID_PANWEST 0x0ac7U // Panwest Corp. -#define UHS_VID_Z_STAR_MICROELECTRONICS 0x0ac8U // Z-Star Microelectronics Corp. -#define UHS_VID_MICRO_SOLUTIONS 0x0ac9U // Micro Solutions, Inc. -#define UHS_VID_OPEN_NETWORKS 0x0acaU // OPEN Networks Ltd -#define UHS_VID_KOGA_ELECTRONICS 0x0accU // Koga Electronics Co. -#define UHS_VID_ID_TECH 0x0acdU // ID Tech -#define UHS_VID_ZYDAS 0x0aceU // ZyDAS -#define UHS_VID_INTOTO 0x0acfU // Intoto, Inc. -#define UHS_VID_INTELLIX 0x0ad0U // Intellix Corp. -#define UHS_VID_REMOTEC_TECHNOLOGY 0x0ad1U // Remotec Technology, Ltd -#define UHS_VID_SERVICE_AND_QUALITY_TECHNOLOGY 0x0ad2U // Service & Quality Technology Co., Ltd -#define UHS_VID_DATA_ENCRYPTION_SYSTEMS 0x0adaU // Data Encryption Systems Ltd. -#define UHS_VID_ALLION_COMPUTER 0x0ae3U // Allion Computer, Inc. -#define UHS_VID_TAITO 0x0ae4U // Taito Corp. -#define UHS_VID_NEODYM_SYSTEMS 0x0ae7U // Neodym Systems, Inc. -#define UHS_VID_SYSTEM_SUPPORT 0x0ae8U // System Support Co., Ltd -#define UHS_VID_NORTH_SHORE_CIRCUIT_DESIGN_LLP 0x0ae9U // North Shore Circuit Design L.L.P. -#define UHS_VID_SCIESSENCE 0x0aeaU // SciEssence, LLC -#define UHS_VID_TTP_COMMUNICATIONS 0x0aebU // TTP Communications, Ltd -#define UHS_VID_NEODIO_TECHNOLOGIES 0x0aecU // Neodio Technologies Corp. -#define UHS_VID_OPTION 0x0af0U // Option -#define UHS_VID_SILVER_I 0x0af6U // Silver I Co., Ltd -#define UHS_VID_B2C2 0x0af7U // B2C2, Inc. -#define UHS_VID_HAMA 0x0af9U // Hama, Inc. -#define UHS_VID_DMC 0x0afaU // DMC Co., Ltd. -#define UHS_VID_ZAPTRONIX 0x0afcU // Zaptronix Ltd -#define UHS_VID_TATENO_DENNOU 0x0afdU // Tateno Dennou, Inc. -#define UHS_VID_CUMMINS_ENGINE 0x0afeU // Cummins Engine Co. -#define UHS_VID_JUMP_ZONE_NETWORK_PRODUCTS 0x0affU // Jump Zone Network Products, Inc. -#define UHS_VID_INGENICO 0x0b00U // INGENICO -#define UHS_VID_ASUSTEK_COMPUTER 0x0b05U // ASUSTek Computer, Inc. -#define UHS_VID_DATAMAX_ONEIL 0x0b0bU // Datamax-O'Neil -#define UHS_VID_TODOS 0x0b0cU // Todos AB -#define UHS_VID_PROJECTLAB 0x0b0dU // ProjectLab -#define UHS_VID_GN_NETCOM 0x0b0eU // GN Netcom -#define UHS_VID_AVID_TECHNOLOGY 0x0b0fU // AVID Technology -#define UHS_VID_PCALLY 0x0b10U // Pcally -#define UHS_VID_I_TECH_SOLUTIONS 0x0b11U // I Tech Solutions Co., Ltd -#define UHS_VID_ELECTRONIC_WARFARE_ASSOC_INC_EWA 0x0b1eU // Electronic Warfare Assoc., Inc. (EWA) -#define UHS_VID_INSYDE_SOFTWARE 0x0b1fU // Insyde Software Corp. -#define UHS_VID_TRANSDIMENSION 0x0b20U // TransDimension, Inc. -#define UHS_VID_YOKOGAWA_ELECTRIC 0x0b21U // Yokogawa Electric Corp. -#define UHS_VID_JAPAN_SYSTEM_DEVELOPMENT 0x0b22U // Japan System Development Co., Ltd -#define UHS_VID_PAN_ASIA_ELECTRONICS 0x0b23U // Pan-Asia Electronics Co., Ltd -#define UHS_VID_LINK_EVOLUTION 0x0b24U // Link Evolution Corp. -#define UHS_VID_RITEK 0x0b27U // Ritek Corp. -#define UHS_VID_KENWOOD 0x0b28U // Kenwood Corp. -#define UHS_VID_VILLAGE_CENTER 0x0b2cU // Village Center, Inc. -#define UHS_VID_PNY_TECHNOLOGIES 0x0b30U // PNY Technologies, Inc. -#define UHS_VID_CONTOUR_DESIGN 0x0b33U // Contour Design, Inc. -#define UHS_VID_HITACHI_ULSI_SYSTEMS 0x0b37U // Hitachi ULSI Systems Co., Ltd -#define UHS_VID_GEAR_HEAD 0x0b38U // Gear Head -#define UHS_VID_OMNIDIRECTIONAL_CONTROL_TECHNOLOGY 0x0b39U // Omnidirectional Control Technology, Inc. -#define UHS_VID_IPAXESS 0x0b3aU // IPaxess -#define UHS_VID_TEKRAM_TECHNOLOGY 0x0b3bU // Tekram Technology Co., Ltd -#define UHS_VID_OLIVETTI_TECHCENTER 0x0b3cU // Olivetti Techcenter -#define UHS_VID_KIKUSUI_ELECTRONICS 0x0b3eU // Kikusui Electronics Corp. -#define UHS_VID_HAL 0x0b41U // Hal Corp. -#define UHS_VID_PLAYCOM 0x0b43U // Play.com, Inc. -#define UHS_VID_SPORTBUGCOM 0x0b47U // Sportbug.com, Inc. -#define UHS_VID_TECHNOTREND_AG 0x0b48U // TechnoTrend AG -#define UHS_VID_ASCII 0x0b49U // ASCII Corp. -#define UHS_VID_PINE 0x0b4bU // Pine Corp. Ltd. -#define UHS_VID_GRAPHTEC_AMERICA 0x0b4dU // Graphtec America, Inc. -#define UHS_VID_MUSICAL_ELECTRONICS 0x0b4eU // Musical Electronics, Ltd -#define UHS_VID_DUMPRIES 0x0b50U // Dumpries Co., Ltd -#define UHS_VID_COMFORT_KEYBOARD 0x0b51U // Comfort Keyboard Co. -#define UHS_VID_COLORADO_MICRODISPLAY 0x0b52U // Colorado MicroDisplay, Inc. -#define UHS_VID_SINBON_ELECTRONICS 0x0b54U // Sinbon Electronics Co., Ltd -#define UHS_VID_TYI_SYSTEMS 0x0b56U // TYI Systems, Ltd -#define UHS_VID_BEIJING_HANWANGTECHNOLOGY 0x0b57U // Beijing HanwangTechnology Co., Ltd -#define UHS_VID_LAKE_COMMUNICATIONS 0x0b59U // Lake Communications, Ltd -#define UHS_VID_COREL 0x0b5aU // Corel Corp. -#define UHS_VID_GREEN_ELECTRONICS 0x0b5fU // Green Electronics Co., Ltd -#define UHS_VID_NSINE 0x0b60U // Nsine, Ltd -#define UHS_VID_NEC_VIEWTECHNOLOGY 0x0b61U // NEC Viewtechnology, Ltd -#define UHS_VID_ORANGE_MICRO 0x0b62U // Orange Micro, Inc. -#define UHS_VID_ADLINK_TECHNOLOGY 0x0b63U // ADLink Technology, Inc. -#define UHS_VID_WONDERFUL_WIRE_CABLE 0x0b64U // Wonderful Wire Cable Co., Ltd -#define UHS_VID_EXPERT_MAGNETICS 0x0b65U // Expert Magnetics Corp. -#define UHS_VID_CYBIKO 0x0b66U // Cybiko Inc. -#define UHS_VID_FAIRBANKS_SCALES 0x0b67U // Fairbanks Scales -#define UHS_VID_CACHEVISION 0x0b69U // CacheVision -#define UHS_VID_MAXIM_INTEGRATED_PRODUCTS 0x0b6aU // Maxim Integrated Products -#define UHS_VID_NAGANO_JAPAN_RADIO 0x0b6fU // Nagano Japan Radio Co., Ltd -#define UHS_VID_PORTALPLAYER 0x0b70U // PortalPlayer, Inc. -#define UHS_VID_SHIN_EI_SANGYO 0x0b71U // SHIN-EI Sangyo Co., Ltd -#define UHS_VID_EMBEDDED_WIRELESS_TECHNOLOGY 0x0b72U // Embedded Wireless Technology Co., Ltd -#define UHS_VID_COMPUTONE 0x0b73U // Computone Corp. -#define UHS_VID_ROLAND_DG 0x0b75U // Roland DG Corp. -#define UHS_VID_SUNRISE_TELECOM 0x0b79U // Sunrise Telecom, Inc. -#define UHS_VID_ZEEVO 0x0b7aU // Zeevo, Inc. -#define UHS_VID_TAIKO_DENKI 0x0b7bU // Taiko Denki Co., Ltd -#define UHS_VID_ITRAN_COMMUNICATIONS 0x0b7cU // ITRAN Communications, Ltd -#define UHS_VID_ASTRODESIGN 0x0b7dU // Astrodesign, Inc. -#define UHS_VID_ID3_TECHNOLOGIES 0x0b81U // id3 Technologies -#define UHS_VID_REXTRON_TECHNOLOGY 0x0b84U // Rextron Technology, Inc. -#define UHS_VID_ELKAT_ELECTRONICS_SDN_BHD 0x0b85U // Elkat Electronics, Sdn., Bhd. -#define UHS_VID_EXPUTER_SYSTEMS 0x0b86U // Exputer Systems, Inc. -#define UHS_VID_PLUS_ONE_I_AND_T 0x0b87U // Plus-One I & T, Inc. -#define UHS_VID_SIGMA_KOKI_CO_LTD_TECHNOLOGY_CENTER 0x0b88U // Sigma Koki Co., Ltd, Technology Center -#define UHS_VID_ADVANCED_DIGITAL_BROADCAST 0x0b89U // Advanced Digital Broadcast, Ltd -#define UHS_VID_SMART_TECHNOLOGIES 0x0b8cU // SMART Technologies Inc. -#define UHS_VID_ASIX_ELECTRONICS 0x0b95U // ASIX Electronics Corp. -#define UHS_VID_SEWON_TELECOM 0x0b96U // Sewon Telecom -#define UHS_VID_O2_MICRO 0x0b97U // O2 Micro, Inc. -#define UHS_VID_PLAYMATES_TOYS 0x0b98U // Playmates Toys, Inc. -#define UHS_VID_AUDIO_INTERNATIONAL 0x0b99U // Audio International, Inc. -#define UHS_VID_DIPL_ING_STEFAN_KUNDE 0x0b9bU // Dipl.-Ing. Stefan Kunde -#define UHS_VID_SOFTPROTEC 0x0b9dU // Softprotec Co. -#define UHS_VID_CHIPPO_TECHNOLOGIES 0x0b9fU // Chippo Technologies -#define UHS_VID_US_ROBOTICS 0x0bafU // U.S. Robotics -#define UHS_VID_CONCORD_CAMERA 0x0bb0U // Concord Camera Corp. -#define UHS_VID_INFINILINK 0x0bb1U // Infinilink Corp. -#define UHS_VID_AMBIT_MICROSYSTEMS 0x0bb2U // Ambit Microsystems Corp. -#define UHS_VID_OFUJI_TECHNOLOGY 0x0bb3U // Ofuji Technology -#define UHS_VID_HTC_HIGH_TECH_COMPUTER 0x0bb4U // HTC (High Tech Computer Corp.) -#define UHS_VID_MURATA_MANUFACTURING 0x0bb5U // Murata Manufacturing Co., Ltd -#define UHS_VID_NETWORK_ALCHEMY 0x0bb6U // Network Alchemy -#define UHS_VID_JOYTECH_COMPUTER 0x0bb7U // Joytech Computer Co., Ltd -#define UHS_VID_HITACHI_SEMICONDUCTOR_AND_DEVICES_SALES 0x0bb8U // Hitachi Semiconductor and Devices Sales Co., Ltd -#define UHS_VID_EIGER_MANDC 0x0bb9U // Eiger M&C Co., Ltd -#define UHS_VID_ZACCESS_SYSTEMS 0x0bbaU // ZAccess Systems -#define UHS_VID_GENERAL_METERS 0x0bbbU // General Meters Corp. -#define UHS_VID_ASSISTIVE_TECHNOLOGY 0x0bbcU // Assistive Technology, Inc. -#define UHS_VID_SYSTEM_CONNECTION 0x0bbdU // System Connection, Inc. -#define UHS_VID_KNILINK_TECHNOLOGY 0x0bc0U // Knilink Technology, Inc. -#define UHS_VID_FUW_YNG_ELECTRONICS 0x0bc1U // Fuw Yng Electronics Co., Ltd -#define UHS_VID_SEAGATE_RSS 0x0bc2U // Seagate RSS LLC -#define UHS_VID_IPWIRELESS 0x0bc3U // IPWireless, Inc. -#define UHS_VID_MICROCUBE 0x0bc4U // Microcube Corp. -#define UHS_VID_JCN 0x0bc5U // JCN Co., Ltd -#define UHS_VID_EXWAY 0x0bc6U // ExWAY, Inc. -#define UHS_VID_X10_WIRELESS_TECHNOLOGY 0x0bc7U // X10 Wireless Technology, Inc. -#define UHS_VID_TELMAX_COMMUNICATIONS 0x0bc8U // Telmax Communications -#define UHS_VID_ECI_TELECOM 0x0bc9U // ECI Telecom, Ltd -#define UHS_VID_STARTEK_ENGINEERING 0x0bcaU // Startek Engineering, Inc. -#define UHS_VID_PERFECT_TECHNIC_ENTERPRISE 0x0bcbU // Perfect Technic Enterprise Co., Ltd -#define UHS_VID_ANDREW_PARGETER_AND_ASSOCIATES 0x0bd7U // Andrew Pargeter & Associates -#define UHS_VID_REALTEK_SEMICONDUCTOR 0x0bdaU // Realtek Semiconductor Corp. -#define UHS_VID_ERICSSON_BUSINESS_MOBILE_NETWORKS_BV 0x0bdbU // Ericsson Business Mobile Networks BV -#define UHS_VID_Y_MEDIA 0x0bdcU // Y Media Corp. -#define UHS_VID_ORANGE_PCS 0x0bddU // Orange PCS -#define UHS_VID_KANDA_TSUSHIN_KOGYO 0x0be2U // Kanda Tsushin Kogyo Co., Ltd -#define UHS_VID_TOYO 0x0be3U // TOYO Corp. -#define UHS_VID_ELKA_INTERNATIONAL 0x0be4U // Elka International, Ltd -#define UHS_VID_DOME_IMAGING_SYSTEMS 0x0be5U // DOME imaging systems, Inc. -#define UHS_VID_DONG_GUAN_HUMEN_WONDERFUL_WIRE_CABLE_FACTORY 0x0be6U // Dong Guan Humen Wonderful Wire Cable Factory -#define UHS_VID_MEI 0x0bedU // MEI -#define UHS_VID_LTK_INDUSTRIES 0x0beeU // LTK Industries, Ltd -#define UHS_VID_WAY2CALL_COMMUNICATIONS 0x0befU // Way2Call Communications -#define UHS_VID_PACE_MICRO_TECHNOLOGY_PLC 0x0bf0U // Pace Micro Technology PLC -#define UHS_VID_INTRACOM 0x0bf1U // Intracom S.A. -#define UHS_VID_KONEXX 0x0bf2U // Konexx -#define UHS_VID_ADDONICS_TECHNOLOGIES_1 0x0bf6U // Addonics Technologies, Inc. -#define UHS_VID_SUNNY_GIKEN 0x0bf7U // Sunny Giken, Inc. -#define UHS_VID_FUJITSU_SIEMENS_COMPUTERS_1 0x0bf8U // Fujitsu Siemens Computers -#define UHS_VID_KVASER 0x0bfdU // Kvaser AB -#define UHS_VID_MOTO_DEVELOPMENT_GROUP 0x0c04U // MOTO Development Group, Inc. -#define UHS_VID_APPIAN_GRAPHICS 0x0c05U // Appian Graphics -#define UHS_VID_HASBRO_GAMES 0x0c06U // Hasbro Games, Inc. -#define UHS_VID_INFINITE_DATA_STORAGE 0x0c07U // Infinite Data Storage, Ltd -#define UHS_VID_AGATE 0x0c08U // Agate -#define UHS_VID_COMJET_INFORMATION_SYSTEM 0x0c09U // Comjet Information System -#define UHS_VID_HIGHPOINT_TECHNOLOGIES 0x0c0aU // Highpoint Technologies, Inc. -#define UHS_VID_DURA_MICRO_INC_ACOMDATA 0x0c0bU // Dura Micro, Inc. (Acomdata) -#define UHS_VID_ZEROPLUS 0x0c12U // Zeroplus -#define UHS_VID_IRIS_GRAPHICS 0x0c15U // Iris Graphics -#define UHS_VID_GYRATION 0x0c16U // Gyration, Inc. -#define UHS_VID_CYBERBOARD_AS 0x0c17U // Cyberboard A/S -#define UHS_VID_SYNERTEK_KOREA 0x0c18U // SynerTek Korea, Inc. -#define UHS_VID_CYBERPIXIE 0x0c19U // cyberPIXIE, Inc. -#define UHS_VID_SILICON_MOTION 0x0c1aU // Silicon Motion, Inc. -#define UHS_VID_MIPS_TECHNOLOGIES 0x0c1bU // MIPS Technologies -#define UHS_VID_HANG_ZHOU_SILAN_ELECTRONICS 0x0c1cU // Hang Zhou Silan Electronics Co., Ltd -#define UHS_VID_TALLY_PRINTER 0x0c22U // Tally Printer Corp. -#define UHS_VID_LERNOUT__HAUSPIE 0x0c23U // Lernout + Hauspie -#define UHS_VID_TAIYO_YUDEN 0x0c24U // Taiyo Yuden -#define UHS_VID_SAMPO 0x0c25U // Sampo Corp. -#define UHS_VID_PROLIFIC_TECHNOLOGY_1 0x0c26U // Prolific Technology Inc. -#define UHS_VID_RFIDEAS 0x0c27U // RFIDeas, Inc -#define UHS_VID_METROLOGIC_INSTRUMENTS 0x0c2eU // Metrologic Instruments -#define UHS_VID_EAGLETRON 0x0c35U // Eagletron, Inc. -#define UHS_VID_E_INK 0x0c36U // E Ink Corp. -#define UHS_VID_EDIGITAL 0x0c37U // e.Digital -#define UHS_VID_DER_AN_ELECTRIC_WIRE_AND_CABLE 0x0c38U // Der An Electric Wire & Cable Co., Ltd -#define UHS_VID_IFR 0x0c39U // IFR -#define UHS_VID_FURUI_PRECISE_COMPONENT_KUNSHAN 0x0c3aU // Furui Precise Component (Kunshan) Co., Ltd -#define UHS_VID_KOMATSU 0x0c3bU // Komatsu, Ltd -#define UHS_VID_RADIUS 0x0c3cU // Radius Co., Ltd -#define UHS_VID_INNOCOM 0x0c3dU // Innocom, Inc. -#define UHS_VID_NEXTCELL 0x0c3eU // Nextcell, Inc. -#define UHS_VID_MOTOROLA_IDEN 0x0c44U // Motorola iDEN -#define UHS_VID_MICRODIA 0x0c45U // Microdia -#define UHS_VID_WAVERIDER_COMMUNICATIONS 0x0c46U // WaveRider Communications, Inc. -#define UHS_VID_ALGE_TIMING 0x0c4aU // ALGE-TIMING GmbH -#define UHS_VID_REINER_SCT_KARTENSYSTEME 0x0c4bU // Reiner SCT Kartensysteme GmbH -#define UHS_VID_NEEDHAMS_ELECTRONICS 0x0c4cU // Needham's Electronics -#define UHS_VID_SEALEVEL_SYSTEMS 0x0c52U // Sealevel Systems, Inc. -#define UHS_VID_VIEWPLUS 0x0c53U // ViewPLUS, Inc. -#define UHS_VID_GLORY 0x0c54U // Glory, Ltd -#define UHS_VID_SPECTRUM_DIGITAL 0x0c55U // Spectrum Digital, Inc. -#define UHS_VID_BILLION_BRIGHT 0x0c56U // Billion Bright, Ltd -#define UHS_VID_IMAGINATIVE_DESIGN_OPERATION 0x0c57U // Imaginative Design Operation Co., Ltd -#define UHS_VID_VIDAR_SYSTEMS 0x0c58U // Vidar Systems Corp. -#define UHS_VID_DONG_GUAN_SHINKO_WIRE 0x0c59U // Dong Guan Shinko Wire Co., Ltd -#define UHS_VID_TRS_INTERNATIONAL_MFG 0x0c5aU // TRS International Mfg., Inc. -#define UHS_VID_XYTRONIX_RESEARCH_AND_DESIGN 0x0c5eU // Xytronix Research & Design -#define UHS_VID_APOGEE_ELECTRONICS 0x0c60U // Apogee Electronics Corp. -#define UHS_VID_CHANT_SINCERE 0x0c62U // Chant Sincere Co., Ltd -#define UHS_VID_TOKO 0x0c63U // Toko, Inc. -#define UHS_VID_SIGNALITY_SYSTEM_ENGINEERING 0x0c64U // Signality System Engineering Co., Ltd -#define UHS_VID_EMINENCE_ENTERPRISE 0x0c65U // Eminence Enterprise Co., Ltd -#define UHS_VID_REXON_ELECTRONICS 0x0c66U // Rexon Electronics Corp. -#define UHS_VID_CONCEPT_TELECOM 0x0c67U // Concept Telecom, Ltd -#define UHS_VID_ACS 0x0c6aU // ACS -#define UHS_VID_JETI_TECHNISCHE_INSTRUMENTE 0x0c6cU // JETI Technische Instrumente GmbH -#define UHS_VID_MCT_ELEKTRONIKLADEN 0x0c70U // MCT Elektronikladen -#define UHS_VID_PEAK_SYSTEM 0x0c72U // PEAK System -#define UHS_VID_OPTRONIC_LABORATORIES 0x0c74U // Optronic Laboratories Inc. -#define UHS_VID_JMTEK 0x0c76U // JMTek, LLC. -#define UHS_VID_SIPIX_GROUP 0x0c77U // Sipix Group, Ltd -#define UHS_VID_DETTO 0x0c78U // Detto Corp. -#define UHS_VID_NUCONNEX_TECHNOLOGIES_PTE 0x0c79U // NuConnex Technologies Pte., Ltd -#define UHS_VID_WING_SPAN_ENTERPRISE 0x0c7aU // Wing-Span Enterprise Co., Ltd -#define UHS_VID_NDA_TECHNOLOGIES 0x0c86U // NDA Technologies, Inc. -#define UHS_VID_KYOCERA_WIRELESS 0x0c88U // Kyocera Wireless Corp. -#define UHS_VID_HONDA_TSUSHIN_KOGYO 0x0c89U // Honda Tsushin Kogyo Co., Ltd -#define UHS_VID_PATHWAY_CONNECTIVITY 0x0c8aU // Pathway Connectivity, Inc. -#define UHS_VID_WAVEFLY 0x0c8bU // Wavefly Corp. -#define UHS_VID_COACTIVE_NETWORKS 0x0c8cU // Coactive Networks -#define UHS_VID_TEMPO 0x0c8dU // Tempo -#define UHS_VID_CESSCOM 0x0c8eU // Cesscom Co., Ltd -#define UHS_VID_APPLIED_MICROSYSTEMS 0x0c8fU // Applied Microsystems -#define UHS_VID_CRYPTERA 0x0c94U // Cryptera -#define UHS_VID_BERKSHIRE_PRODUCTS 0x0c98U // Berkshire Products, Inc. -#define UHS_VID_INNOCHIPS 0x0c99U // Innochips Co., Ltd -#define UHS_VID_HANWOOL_ROBOTICS 0x0c9aU // Hanwool Robotics Corp. -#define UHS_VID_JOBIN_YVON 0x0c9bU // Jobin Yvon, Inc. -#define UHS_VID_SEMTEK 0x0c9dU // SemTek -#define UHS_VID_ZYFER 0x0ca2U // Zyfer -#define UHS_VID_SEGA 0x0ca3U // Sega Corp. -#define UHS_VID_STANDT_INSTRUMENT 0x0ca4U // ST&T Instrument Corp. -#define UHS_VID_BAE_SYSTEMS_CANADA 0x0ca5U // BAE Systems Canada, Inc. -#define UHS_VID_CASTLES_TECHNOLOGY 0x0ca6U // Castles Technology Co., Ltd -#define UHS_VID_INFORMATION_SYSTEMS_LABORATORIES 0x0ca7U // Information Systems Laboratories -#define UHS_VID_MOTOROLA_CGISS 0x0cadU // Motorola CGISS -#define UHS_VID_ASCOM_BUSINESS_SYSTEMS 0x0caeU // Ascom Business Systems, Ltd -#define UHS_VID_BUSLINK 0x0cafU // Buslink -#define UHS_VID_FLYING_PIG_SYSTEMS 0x0cb0U // Flying Pig Systems -#define UHS_VID_INNOVONICS 0x0cb1U // Innovonics, Inc. -#define UHS_VID_CELESTIX_NETWORKS_PTE 0x0cb6U // Celestix Networks, Pte., Ltd -#define UHS_VID_SINGATRON_ENTERPRISE 0x0cb7U // Singatron Enterprise Co., Ltd -#define UHS_VID_OPTICIS 0x0cb8U // Opticis Co., Ltd -#define UHS_VID_TRUST_ELECTRONIC_SHANGHAI 0x0cbaU // Trust Electronic (Shanghai) Co., Ltd -#define UHS_VID_SHANGHAI_DARONG_ELECTRONICS 0x0cbbU // Shanghai Darong Electronics Co., Ltd -#define UHS_VID_PALMAX_TECHNOLOGY 0x0cbcU // Palmax Technology Co., Ltd -#define UHS_VID_PENTEL_CO_LTD_ELECTRONICS_EQUIPMENT_DIV 0x0cbdU // Pentel Co., Ltd (Electronics Equipment Div.) -#define UHS_VID_KERYX_TECHNOLOGIES 0x0cbeU // Keryx Technologies, Inc. -#define UHS_VID_UNION_GENIUS_COMPUTER 0x0cbfU // Union Genius Computer Co., Ltd -#define UHS_VID_KUON_YI_INDUSTRIAL 0x0cc0U // Kuon Yi Industrial Corp. -#define UHS_VID_GIVEN_IMAGING 0x0cc1U // Given Imaging, Ltd -#define UHS_VID_TIMEX 0x0cc2U // Timex Corp. -#define UHS_VID_RIMAGE 0x0cc3U // Rimage Corp. -#define UHS_VID_EMSYS 0x0cc4U // emsys GmbH -#define UHS_VID_SENDO 0x0cc5U // Sendo -#define UHS_VID_INTERMAGIC 0x0cc6U // Intermagic Corp. -#define UHS_VID_KONTRON_MEDICAL_AG 0x0cc7U // Kontron Medical AG -#define UHS_VID_TECHNOTOOLS 0x0cc8U // Technotools Corp. -#define UHS_VID_BROADMAX_TECHNOLOGIES 0x0cc9U // BroadMAX Technologies, Inc. -#define UHS_VID_AMPHENOL 0x0ccaU // Amphenol -#define UHS_VID_SKNET 0x0ccbU // SKNet Co., Ltd -#define UHS_VID_DOMEX_TECHNOLOGY 0x0cccU // Domex Technology Corp. -#define UHS_VID_TERRATEC_ELECTRONIC 0x0ccdU // TerraTec Electronic GmbH -#define UHS_VID_BANG_OLUFSEN 0x0cd4U // Bang Olufsen -#define UHS_VID_LABJACK_CORPORATION 0x0cd5U // LabJack Corporation -#define UHS_VID_NEWCHIP_SRL 0x0cd7U // NewChip S.r.l. -#define UHS_VID_JS_DIGITECH 0x0cd8U // JS Digitech, Inc. -#define UHS_VID_HITACHI_SHIN_DIN_CABLE 0x0cd9U // Hitachi Shin Din Cable, Ltd -#define UHS_VID_Z_COM 0x0cdeU // Z-Com -#define UHS_VID_VALIDATION_TECHNOLOGIES_INTERNATIONAL 0x0ce5U // Validation Technologies International -#define UHS_VID_PICO_TECHNOLOGY 0x0ce9U // Pico Technology -#define UHS_VID_E_CONN_ELECTRONIC 0x0cf1U // e-Conn Electronic Co., Ltd -#define UHS_VID_ENE_TECHNOLOGY 0x0cf2U // ENE Technology, Inc. -#define UHS_VID_ATHEROS_COMMUNICATIONS 0x0cf3U // Atheros Communications, Inc. -#define UHS_VID_FOMTEX 0x0cf4U // Fomtex Corp. -#define UHS_VID_CELLINK 0x0cf5U // Cellink Co., Ltd -#define UHS_VID_COMPUCABLE 0x0cf6U // Compucable Corp. -#define UHS_VID_ISHONI_NETWORKS 0x0cf7U // ishoni Networks -#define UHS_VID_CLARISYS 0x0cf8U // Clarisys, Inc. -#define UHS_VID_CENTRAL_SYSTEM_RESEARCH 0x0cf9U // Central System Research Co., Ltd -#define UHS_VID_INVISO 0x0cfaU // Inviso, Inc. -#define UHS_VID_MINOLTA_QMS 0x0cfcU // Minolta-QMS, Inc. -#define UHS_VID_SAFA_MEDIA 0x0cffU // SAFA MEDIA Co., Ltd. -#define UHS_VID_TELOS_EDV_SYSTEMENTWICKLUNG 0x0d06U // telos EDV Systementwicklung GmbH -#define UHS_VID_UTSTARCOM 0x0d08U // UTStarcom -#define UHS_VID_CONTEMPORARY_CONTROLS 0x0d0bU // Contemporary Controls -#define UHS_VID_ASTRON_ELECTRONICS 0x0d0cU // Astron Electronics Co., Ltd -#define UHS_VID_MKNET 0x0d0dU // MKNet Corp. -#define UHS_VID_HYBRID_NETWORKS 0x0d0eU // Hybrid Networks, Inc. -#define UHS_VID_FENG_SHIN_CABLE 0x0d0fU // Feng Shin Cable Co., Ltd -#define UHS_VID_ELASTIC_NETWORKS 0x0d10U // Elastic Networks -#define UHS_VID_MASPRO_DENKOH 0x0d11U // Maspro Denkoh Corp. -#define UHS_VID_HANSOL_ELECTRONICS 0x0d12U // Hansol Electronics, Inc. -#define UHS_VID_BMF 0x0d13U // BMF Corp. -#define UHS_VID_ARRAY_COMM 0x0d14U // Array Comm, Inc. -#define UHS_VID_ONSTREAM_BV 0x0d15U // OnStream b.v. -#define UHS_VID_HI_TOUCH_IMAGING_TECHNOLOGIES 0x0d16U // Hi-Touch Imaging Technologies Co., Ltd -#define UHS_VID_NALTEC 0x0d17U // NALTEC, Inc. -#define UHS_VID_COAXMEDIA 0x0d18U // coaXmedia -#define UHS_VID_HANK_CONNECTION_INDUSTRIAL 0x0d19U // Hank Connection Industrial Co., Ltd -#define UHS_VID_NXP 0x0d28U // NXP -#define UHS_VID_LEO_HUI_ELECTRIC_WIRE_AND_CABLE 0x0d32U // Leo Hui Electric Wire & Cable Co., Ltd -#define UHS_VID_AIRSPEAK 0x0d33U // AirSpeak, Inc. -#define UHS_VID_REARDEN_STEEL_TECHNOLOGIES 0x0d34U // Rearden Steel Technologies -#define UHS_VID_DAH_KUN 0x0d35U // Dah Kun Co., Ltd -#define UHS_VID_POSIFLEX_TECHNOLOGIES 0x0d3aU // Posiflex Technologies, Inc. -#define UHS_VID_SRI_CABLE_TECHNOLOGY 0x0d3cU // Sri Cable Technology, Ltd -#define UHS_VID_TANGTOP_TECHNOLOGY 0x0d3dU // Tangtop Technology Co., Ltd -#define UHS_VID_FITCOM 0x0d3eU // Fitcom, inc. -#define UHS_VID_MTS_SYSTEMS 0x0d3fU // MTS Systems Corp. -#define UHS_VID_ASCOR 0x0d40U // Ascor, Inc. -#define UHS_VID_TA_YUN_TERMINALS_INDUSTRIAL 0x0d41U // Ta Yun Terminals Industrial Co., Ltd -#define UHS_VID_FULL_DER 0x0d42U // Full Der Co., Ltd -#define UHS_VID_KOBIL_SYSTEMS 0x0d46U // Kobil Systems GmbH -#define UHS_VID_PROMETHEAN_LIMITED 0x0d48U // Promethean Limited -#define UHS_VID_MAXTOR 0x0d49U // Maxtor -#define UHS_VID_NF 0x0d4aU // NF Corp. -#define UHS_VID_GRAPE_SYSTEMS 0x0d4bU // Grape Systems, Inc. -#define UHS_VID_TEDAS_AG 0x0d4cU // Tedas AG -#define UHS_VID_COHERENT 0x0d4dU // Coherent, Inc. -#define UHS_VID_AGERE_SYSTEMS_NETHERLAND_BV 0x0d4eU // Agere Systems Netherland BV -#define UHS_VID_EADS_AIRBUS_FRANCE 0x0d4fU // EADS Airbus France -#define UHS_VID_CLEWARE 0x0d50U // Cleware GmbH -#define UHS_VID_VOLEX_ASIA_PTE 0x0d51U // Volex (Asia) Pte., Ltd -#define UHS_VID_HMI 0x0d53U // HMI Co., Ltd -#define UHS_VID_HOLON 0x0d54U // Holon Corp. -#define UHS_VID_ASKA_TECHNOLOGIES 0x0d55U // ASKA Technologies, Inc. -#define UHS_VID_AVLAB_TECHNOLOGY 0x0d56U // AVLAB Technology, Inc. -#define UHS_VID_SOLOMON_MICROTECH 0x0d57U // Solomon Microtech, Ltd -#define UHS_VID_SMC_NETWORKS 0x0d5cU // SMC Networks, Inc. -#define UHS_VID_MYACOM 0x0d5eU // Myacom, Ltd -#define UHS_VID_CSI 0x0d5fU // CSI, Inc. -#define UHS_VID_IVL_TECHNOLOGIES 0x0d60U // IVL Technologies, Ltd -#define UHS_VID_MEILU_ELECTRONICS_SHENZHEN 0x0d61U // Meilu Electronics (Shenzhen) Co., Ltd -#define UHS_VID_DARFON_ELECTRONICS 0x0d62U // Darfon Electronics Corp. -#define UHS_VID_FRITZ_GEGAUF_AG 0x0d63U // Fritz Gegauf AG -#define UHS_VID_DXG_TECHNOLOGY 0x0d64U // DXG Technology Corp. -#define UHS_VID_KMJP 0x0d65U // KMJP Co., Ltd -#define UHS_VID_TMT 0x0d66U // TMT -#define UHS_VID_ADVANET 0x0d67U // Advanet, Inc. -#define UHS_VID_SUPER_LINK_ELECTRONICS 0x0d68U // Super Link Electronics Co., Ltd -#define UHS_VID_NSI 0x0d69U // NSI -#define UHS_VID_MEGAPOWER_INTERNATIONAL 0x0d6aU // Megapower International Corp. -#define UHS_VID_AND_OR_LOGIC 0x0d6bU // And-Or Logic -#define UHS_VID_TRY_COMPUTER 0x0d70U // Try Computer Co., Ltd -#define UHS_VID_HIRAKAWA_HEWTECH 0x0d71U // Hirakawa Hewtech Corp. -#define UHS_VID_WINMATE_COMMUNICATION 0x0d72U // Winmate Communication, Inc. -#define UHS_VID_HITS_COMMUNICATIONS 0x0d73U // Hit's Communications, Inc. -#define UHS_VID_MFP_KOREA 0x0d76U // MFP Korea, Inc. -#define UHS_VID_POWER_SENTRYNEWPOINT 0x0d77U // Power Sentry/Newpoint -#define UHS_VID_JAPAN_DISTRIBUTOR 0x0d78U // Japan Distributor Corp. -#define UHS_VID_MARX_DATENTECHNIK 0x0d7aU // MARX Datentechnik GmbH -#define UHS_VID_WELLCO_TECHNOLOGY 0x0d7bU // Wellco Technology Co., Ltd -#define UHS_VID_TAIWAN_LINE_TEK_ELECTRONIC 0x0d7cU // Taiwan Line Tek Electronic Co., Ltd -#define UHS_VID_PHISON_ELECTRONICS 0x0d7dU // Phison Electronics Corp. -#define UHS_VID_AMERICAN_COMPUTER_AND_DIGITAL_COMPONENTS 0x0d7eU // American Computer & Digital Components -#define UHS_VID_ESSENTIAL_REALITY 0x0d7fU // Essential Reality LLC -#define UHS_VID_HR_SILVINE_ELECTRONICS 0x0d80U // H.R. Silvine Electronics, Inc. -#define UHS_VID_TECHNOVISION 0x0d81U // TechnoVision -#define UHS_VID_THINK_OUTSIDE 0x0d83U // Think Outside, Inc. -#define UHS_VID_DOLBY_LABORATORIES 0x0d87U // Dolby Laboratories Inc. -#define UHS_VID_OZ_SOFTWARE 0x0d89U // Oz Software -#define UHS_VID_KING_JIM 0x0d8aU // King Jim Co., Ltd -#define UHS_VID_ASCOM_TELECOMMUNICATIONS 0x0d8bU // Ascom Telecommunications, Ltd -#define UHS_VID_C_MEDIA_ELECTRONICS 0x0d8cU // C-Media Electronics, Inc. -#define UHS_VID_PROMOTION_AND_DISPLAY_TECHNOLOGY 0x0d8dU // Promotion & Display Technology, Ltd -#define UHS_VID_GLOBAL_SUN_TECHNOLOGY 0x0d8eU // Global Sun Technology, Inc. -#define UHS_VID_PITNEY_BOWES 0x0d8fU // Pitney Bowes -#define UHS_VID_SURE_FIRE_ELECTRICAL 0x0d90U // Sure-Fire Electrical Corp. -#define UHS_VID_SKANHEX_TECHNOLOGY 0x0d96U // Skanhex Technology, Inc. -#define UHS_VID_SANTA_BARBARA_INSTRUMENT_GROUP 0x0d97U // Santa Barbara Instrument Group -#define UHS_VID_MARS_SEMICONDUCTOR 0x0d98U // Mars Semiconductor Corp. -#define UHS_VID_TRAZER_TECHNOLOGIES 0x0d99U // Trazer Technologies, Inc. -#define UHS_VID_RTX_TELECOM_AS 0x0d9aU // RTX Telecom AS -#define UHS_VID_TAT_SHING_ELECTRICAL 0x0d9bU // Tat Shing Electrical Co. -#define UHS_VID_CHEE_CHEN_HI_TECHNOLOGY 0x0d9cU // Chee Chen Hi-Technology Co., Ltd -#define UHS_VID_SANWA_SUPPLY 0x0d9dU // Sanwa Supply, Inc. -#define UHS_VID_AVAYA 0x0d9eU // Avaya -#define UHS_VID_POWERCOM 0x0d9fU // Powercom Co., Ltd -#define UHS_VID_DANGER_RESEARCH 0x0da0U // Danger Research -#define UHS_VID_SUZHOU_PETERS_PRECISE_INDUSTRIAL 0x0da1U // Suzhou Peter's Precise Industrial Co., Ltd -#define UHS_VID_LAND_INSTRUMENTS_INTERNATIONAL 0x0da2U // Land Instruments International, Ltd -#define UHS_VID_NIPPON_ELECTRO_SENSORY_DEVICES 0x0da3U // Nippon Electro-Sensory Devices Corp. -#define UHS_VID_POLAR_ELECTRO_OY 0x0da4U // Polar Electro Oy -#define UHS_VID_IOGEAR 0x0da7U // IOGear, Inc. -#define UHS_VID_SOFTDSP 0x0da8U // softDSP Co., Ltd -#define UHS_VID_CUBIG_GROUP 0x0dabU // Cubig Group -#define UHS_VID_WESTOVER_SCIENTIFIC 0x0dadU // Westover Scientific -#define UHS_VID_MICRO_STAR_INTERNATIONAL 0x0db0U // Micro Star International -#define UHS_VID_WEN_TE_ELECTRONICS 0x0db1U // Wen Te Electronics Co., Ltd -#define UHS_VID_SHIAN_HWI_PLUG_PARTS_PLASTIC_FACTORY 0x0db2U // Shian Hwi Plug Parts, Plastic Factory -#define UHS_VID_TEKRAM_TECHNOLOGY_1 0x0db3U // Tekram Technology Co., Ltd -#define UHS_VID_CHUNG_FU_CHEN_YEH_ENTERPRISE 0x0db4U // Chung Fu Chen Yeh Enterprise Corp. -#define UHS_VID_ACCESS_IS 0x0db5U // Access IS -#define UHS_VID_ELCON_SYSTEMTECHNIK 0x0db7U // ELCON Systemtechnik -#define UHS_VID_DIGIDESIGN 0x0dbaU // Digidesign -#define UHS_VID_AANDD_MEDICAL 0x0dbcU // A&D Medical -#define UHS_VID_JIUH_SHIUH_PRECISION_INDUSTRY 0x0dbeU // Jiuh Shiuh Precision Industry Co., Ltd -#define UHS_VID_JESS_LINK_INTERNATIONAL 0x0dbfU // Jess-Link International -#define UHS_VID_G7_SOLUTIONS_FORMERLY_GREAT_NOTIONS 0x0dc0U // G7 Solutions (formerly Great Notions) -#define UHS_VID_TAMAGAWA_SEIKI 0x0dc1U // Tamagawa Seiki Co., Ltd -#define UHS_VID_ATHENA_SMARTCARD_SOLUTIONS 0x0dc3U // Athena Smartcard Solutions, Inc. -#define UHS_VID_MACPOWER_PERIPHERALS 0x0dc4U // Macpower Peripherals, Ltd -#define UHS_VID_SDK 0x0dc5U // SDK Co., Ltd -#define UHS_VID_PRECISION_SQUARED_TECHNOLOGY 0x0dc6U // Precision Squared Technology Corp. -#define UHS_VID_FIRST_CABLE_LINE 0x0dc7U // First Cable Line, Inc. -#define UHS_VID_NETWORKFAB 0x0dcdU // NetworkFab Corp. -#define UHS_VID_ACCESS_SOLUTIONS 0x0dd0U // Access Solutions -#define UHS_VID_CONTEK_ELECTRONICS 0x0dd1U // Contek Electronics Co., Ltd -#define UHS_VID_POWER_QUOTIENT_INTERNATIONAL 0x0dd2U // Power Quotient International Co., Ltd -#define UHS_VID_MEDIAQ 0x0dd3U // MediaQ -#define UHS_VID_CUSTOM_ENGINEERING_SPA 0x0dd4U // Custom Engineering SPA -#define UHS_VID_CALIFORNIA_MICRO_DEVICES 0x0dd5U // California Micro Devices -#define UHS_VID_KOCOM 0x0dd7U // Kocom Co., Ltd -#define UHS_VID_NETAC_TECHNOLOGY 0x0dd8U // Netac Technology Co., Ltd -#define UHS_VID_HIGHSPEED_SURFING 0x0dd9U // HighSpeed Surfing -#define UHS_VID_INTEGRATED_CIRCUIT_SOLUTION 0x0ddaU // Integrated Circuit Solution, Inc. -#define UHS_VID_TAMARACK 0x0ddbU // Tamarack, Inc. -#define UHS_VID_DATELINK_TECHNOLOGY 0x0dddU // Datelink Technology Co., Ltd -#define UHS_VID_UBICOM 0x0ddeU // Ubicom, Inc. -#define UHS_VID_BD_CONSUMER_HEALTHCARE 0x0de0U // BD Consumer Healthcare -#define UHS_VID_USBMICRO 0x0de7U // USBmicro -#define UHS_VID_UTECH_ELECTRONIC_DG 0x0deaU // UTECH Electronic (D.G.) Co., Ltd. -#define UHS_VID_NOVASONICS 0x0dedU // Novasonics -#define UHS_VID_LIFETIME_MEMORY_PRODUCTS 0x0deeU // Lifetime Memory Products -#define UHS_VID_FULL_RISE_ELECTRONIC 0x0defU // Full Rise Electronic Co., Ltd -#define UHS_VID_NETANDSYS 0x0df4U // NET&SYS -#define UHS_VID_SITECOM_EUROPE_BV 0x0df6U // Sitecom Europe B.V. -#define UHS_VID_MOBILE_ACTION_TECHNOLOGY 0x0df7U // Mobile Action Technology, Inc. -#define UHS_VID_TOYO_COMMUNICATION_EQUIPMENT 0x0dfaU // Toyo Communication Equipment Co., Ltd -#define UHS_VID_GENERALTOUCH_TECHNOLOGY 0x0dfcU // GeneralTouch Technology Co., Ltd -#define UHS_VID_NIPPON_SYSTEMWARE 0x0e03U // Nippon Systemware Co., Ltd -#define UHS_VID_WINBEST_TECHNOLOGY 0x0e08U // Winbest Technology Co., Ltd -#define UHS_VID_AMIGO_TECHNOLOGY 0x0e0bU // Amigo Technology Inc. -#define UHS_VID_GESYTEC 0x0e0cU // Gesytec -#define UHS_VID_PICOQUANT 0x0e0dU // PicoQuant GmbH -#define UHS_VID_VMWARE 0x0e0fU // VMware, Inc. -#define UHS_VID_JMTEK_1 0x0e16U // JMTek, LLC -#define UHS_VID_WALEX_ELECTRONIC 0x0e17U // Walex Electronic, Ltd -#define UHS_VID_UNISYS_1 0x0e1aU // Unisys -#define UHS_VID_CREWAVE 0x0e1bU // Crewave -#define UHS_VID_PEGASUS_TECHNOLOGIES 0x0e20U // Pegasus Technologies Ltd. -#define UHS_VID_COWON_SYSTEMS 0x0e21U // Cowon Systems, Inc. -#define UHS_VID_SYMBIAN 0x0e22U // Symbian Ltd. -#define UHS_VID_LIOU_YUANE_ENTERPRISE 0x0e23U // Liou Yuane Enterprise Co., Ltd -#define UHS_VID_VINCHIP_SYSTEMS 0x0e25U // VinChip Systems, Inc. -#define UHS_VID_J_PHONE_EAST 0x0e26U // J-Phone East Co., Ltd -#define UHS_VID_HEARTMATH 0x0e30U // HeartMath LLC -#define UHS_VID_MICRO_COMPUTER_CONTROL 0x0e34U // Micro Computer Control Corp. -#define UHS_VID_3PEA_TECHNOLOGIES 0x0e35U // 3Pea Technologies, Inc. -#define UHS_VID_TIEPIE_ENGINEERING 0x0e36U // TiePie engineering -#define UHS_VID_STRATITEC 0x0e38U // Stratitec, Inc. -#define UHS_VID_SMART_MODULAR_TECHNOLOGIES 0x0e39U // Smart Modular Technologies, Inc. -#define UHS_VID_NEOSTAR_TECHNOLOGY 0x0e3aU // Neostar Technology Co., Ltd -#define UHS_VID_MANSELLA 0x0e3bU // Mansella, Ltd -#define UHS_VID_LINE6 0x0e41U // Line6, Inc. -#define UHS_VID_SUN_RISEFUL_TECHNOLOGY 0x0e44U // Sun-Riseful Technology Co., Ltd. -#define UHS_VID_JULIA 0x0e48U // Julia Corp., Ltd -#define UHS_VID_SHENZHEN_BAO_HING_ELECTRIC_WIRE_AND_CABLE_MFR 0x0e4aU // Shenzhen Bao Hing Electric Wire & Cable Mfr. Co. -#define UHS_VID_RADICA_GAMES 0x0e4cU // Radica Games, Ltd -#define UHS_VID_TECHNODATA_INTERWARE 0x0e50U // TechnoData Interware -#define UHS_VID_SPEED_DRAGON_MULTIMEDIA 0x0e55U // Speed Dragon Multimedia, Ltd -#define UHS_VID_KINGSTON_TECHNOLOGY_COMPANY 0x0e56U // Kingston Technology Company, Inc. -#define UHS_VID_ACTIVE 0x0e5aU // Active Co., Ltd -#define UHS_VID_UNION_POWER_INFORMATION_INDUSTRIAL 0x0e5bU // Union Power Information Industrial Co., Ltd -#define UHS_VID_BITLAND_INFORMATION_TECHNOLOGY 0x0e5cU // Bitland Information Technology Co., Ltd -#define UHS_VID_NELTRON_INDUSTRIAL 0x0e5dU // Neltron Industrial Co., Ltd -#define UHS_VID_CONWISE_TECHNOLOGY 0x0e5eU // Conwise Technology Co., Ltd. -#define UHS_VID_HAWKING_TECHNOLOGIES 0x0e66U // Hawking Technologies -#define UHS_VID_FOSSIL 0x0e67U // Fossil, Inc. -#define UHS_VID_MEGAWIN_TECHNOLOGY 0x0e6aU // Megawin Technology Co., Ltd -#define UHS_VID_LOGIC3 0x0e6fU // Logic3 -#define UHS_VID_TOKYO_ELECTRONIC_INDUSTRY 0x0e70U // Tokyo Electronic Industry Co., Ltd -#define UHS_VID_HSI_CHIN_ELECTRONICS 0x0e72U // Hsi-Chin Electronics Co., Ltd -#define UHS_VID_TVS_ELECTRONICS 0x0e75U // TVS Electronics, Ltd -#define UHS_VID_ARCHOS 0x0e79U // Archos, Inc. -#define UHS_VID_ON_TECH_INDUSTRY 0x0e7bU // On-Tech Industry Co., Ltd -#define UHS_VID_GMATE 0x0e7eU // Gmate, Inc. -#define UHS_VID_CHING_TAI_ELECTRIC_WIRE_AND_CABLE 0x0e82U // Ching Tai Electric Wire & Cable Co., Ltd -#define UHS_VID_SHIN_AN_WIRE_AND_CABLE 0x0e83U // Shin An Wire & Cable Co. -#define UHS_VID_WELL_FORCE_ELECTRONIC 0x0e8cU // Well Force Electronic Co., Ltd -#define UHS_VID_MEDIATEK_1 0x0e8dU // MediaTek Inc. -#define UHS_VID_GREENASIA 0x0e8fU // GreenAsia Inc. -#define UHS_VID_WIEBETECH 0x0e90U // WiebeTech, LLC -#define UHS_VID_VTECH_ENGINEERING_CANADA 0x0e91U // VTech Engineering Canada, Ltd -#define UHS_VID_CS_GLORY_ENTERPRISE 0x0e92U // C's Glory Enterprise Co., Ltd -#define UHS_VID_EM_TECHNICS 0x0e93U // eM Technics Co., Ltd -#define UHS_VID_FUTURE_TECHNOLOGY 0x0e95U // Future Technology Co., Ltd -#define UHS_VID_APLUX_COMMUNICATIONS 0x0e96U // Aplux Communications, Ltd -#define UHS_VID_FINGERWORKS 0x0e97U // Fingerworks, Inc. -#define UHS_VID_ADVANCED_ANALOGIC_TECHNOLOGIES 0x0e98U // Advanced Analogic Technologies, Inc. -#define UHS_VID_PARALLEL_DICE 0x0e99U // Parallel Dice Co., Ltd -#define UHS_VID_TA_HSING_INDUSTRIES 0x0e9aU // TA HSING Industries, Ltd -#define UHS_VID_ADTEC 0x0e9bU // ADTEC Corp. -#define UHS_VID_STREAMZAP 0x0e9cU // Streamzap, Inc. -#define UHS_VID_TAMURA 0x0e9fU // Tamura Corp. -#define UHS_VID_OURS_TECHNOLOGY 0x0ea0U // Ours Technology, Inc. -#define UHS_VID_NIHON_COMPUTER 0x0ea6U // Nihon Computer Co., Ltd -#define UHS_VID_MSL_ENTERPRISES 0x0ea7U // MSL Enterprises Corp. -#define UHS_VID_CENDYNE 0x0ea8U // CenDyne, Inc. -#define UHS_VID_HUMAX_1 0x0eadU // Humax Co., Ltd -#define UHS_VID_NOVATECH 0x0eb0U // NovaTech -#define UHS_VID_WIS_TECHNOLOGIES 0x0eb1U // WIS Technologies, Inc. -#define UHS_VID_Y_S_ELECTRONIC 0x0eb2U // Y-S Electronic Co., Ltd -#define UHS_VID_SAINT_TECHNOLOGY 0x0eb3U // Saint Technology Corp. -#define UHS_VID_ENDOR_AG 0x0eb7U // Endor AG -#define UHS_VID_METTLER_TOLEDO 0x0eb8U // Mettler Toledo -#define UHS_VID_THERMO_FISHER_SCIENTIFIC 0x0ebbU // Thermo Fisher Scientific -#define UHS_VID_VWEB 0x0ebeU // VWeb Corp. -#define UHS_VID_OMEGA_TECHNOLOGY_OF_TAIWAN 0x0ebfU // Omega Technology of Taiwan, Inc. -#define UHS_VID_LHI_TECHNOLOGY_CHINA 0x0ec0U // LHI Technology (China) Co., Ltd -#define UHS_VID_ABIT_COMPUTER 0x0ec1U // Abit Computer Corp. -#define UHS_VID_SWEETRAY_INDUSTRIAL 0x0ec2U // Sweetray Industrial, Ltd -#define UHS_VID_AXELL 0x0ec3U // Axell Co., Ltd -#define UHS_VID_BALLRACING_DEVELOPMENTS 0x0ec4U // Ballracing Developments, Ltd -#define UHS_VID_GT_INFORMATION_SYSTEM 0x0ec5U // GT Information System Co., Ltd -#define UHS_VID_INNOVISION_MULTIMEDIA 0x0ec6U // InnoVISION Multimedia, Ltd -#define UHS_VID_THETA_LINK 0x0ec7U // Theta Link Corp. -#define UHS_VID_LITE_ON_IT 0x0ecdU // Lite-On IT Corp. -#define UHS_VID_TAISOL_ELECTRONICS 0x0eceU // TaiSol Electronics Co., Ltd -#define UHS_VID_PHOGENIX_IMAGING 0x0ecfU // Phogenix Imaging, LLC -#define UHS_VID_WINMAXGROUP 0x0ed1U // WinMaxGroup -#define UHS_VID_KYOTO_MICRO_COMPUTER 0x0ed2U // Kyoto Micro Computer Co., Ltd -#define UHS_VID_WING_TECH_ENTERPRISE 0x0ed3U // Wing-Tech Enterprise Co., Ltd -#define UHS_VID_FIBERBYTE 0x0ed5U // Fiberbyte -#define UHS_VID_NORIAKE_ITRON 0x0edaU // Noriake Itron Corp. -#define UHS_VID_E_MDT 0x0edfU // e-MDT Co., Ltd -#define UHS_VID_SHIMA_SEIKI_MFG 0x0ee0U // Shima Seiki Mfg., Ltd -#define UHS_VID_SAROTECH 0x0ee1U // Sarotech Co., Ltd -#define UHS_VID_AMI_SEMICONDUCTOR 0x0ee2U // AMI Semiconductor, Inc. -#define UHS_VID_COMTRUE_TECHNOLOGY 0x0ee3U // ComTrue Technology Corp. -#define UHS_VID_SUNRICH_TECHNOLOGY 0x0ee4U // Sunrich Technology, Ltd -#define UHS_VID_DIGITAL_STREAM_TECHNOLOGY 0x0eeeU // Digital Stream Technology, Inc. -#define UHS_VID_D_WAV_SCIENTIFIC 0x0eefU // D-WAV Scientific Co., Ltd -#define UHS_VID_HITACHI_CABLE 0x0ef0U // Hitachi Cable, Ltd -#define UHS_VID_AICHI_MICRO_INTELLIGENT 0x0ef1U // Aichi Micro Intelligent Corp. -#define UHS_VID_IO_MAGIC 0x0ef2U // I/O Magic Corp. -#define UHS_VID_LYNN_PRODUCTS 0x0ef3U // Lynn Products, Inc. -#define UHS_VID_DSI_DATOTECH 0x0ef4U // DSI Datotech -#define UHS_VID_POINTCHIPS 0x0ef5U // PointChips -#define UHS_VID_YIELD_MICROELECTRONICS 0x0ef6U // Yield Microelectronics Corp. -#define UHS_VID_SM_TECH_CO_LTD_TULIP 0x0ef7U // SM Tech Co., Ltd (Tulip) -#define UHS_VID_OASIS_SEMICONDUCTOR 0x0efdU // Oasis Semiconductor -#define UHS_VID_WEM_TECHNOLOGY 0x0efeU // Wem Technology, Inc. -#define UHS_VID_UNITEK_UPS_SYSTEMS 0x0f03U // Unitek UPS Systems -#define UHS_VID_VISUAL_FRONTIER_ENTERPRISE 0x0f06U // Visual Frontier Enterprise Co., Ltd -#define UHS_VID_CSL_WIRE_AND_PLUG_SHEN_ZHEN 0x0f08U // CSL Wire & Plug (Shen Zhen) Co. -#define UHS_VID_CAS 0x0f0cU // CAS Corp. -#define UHS_VID_HORI 0x0f0dU // Hori Co., Ltd -#define UHS_VID_ENERGY_FULL 0x0f0eU // Energy Full Corp. -#define UHS_VID_LD_DIDACTIC 0x0f11U // LD Didactic GmbH -#define UHS_VID_MARS_ENGINEERING 0x0f12U // Mars Engineering Corp. -#define UHS_VID_ACETEK_TECHNOLOGY 0x0f13U // Acetek Technology Co., Ltd -#define UHS_VID_INGENICO_1 0x0f14U // Ingenico -#define UHS_VID_FINGER_LAKES_INSTRUMENTATION 0x0f18U // Finger Lakes Instrumentation -#define UHS_VID_ORACOM 0x0f19U // Oracom Co., Ltd -#define UHS_VID_ONSET_COMPUTER 0x0f1bU // Onset Computer Corp. -#define UHS_VID_FUNAI_ELECTRIC 0x0f1cU // Funai Electric Co., Ltd -#define UHS_VID_IWILL 0x0f1dU // Iwill Corp. -#define UHS_VID_IOI_TECHNOLOGY 0x0f21U // IOI Technology Corp. -#define UHS_VID_SENIOR_INDUSTRIES 0x0f22U // Senior Industries, Inc. -#define UHS_VID_LEADER_TECH_MANUFACTURER 0x0f23U // Leader Tech Manufacturer Co., Ltd -#define UHS_VID_FLEX_P_INDUSTRIES_SND_BHD 0x0f24U // Flex-P Industries, Snd., Bhd. -#define UHS_VID_VIPOWER 0x0f2dU // ViPower, Inc. -#define UHS_VID_GENIALITY_MAPLE_TECHNOLOGY 0x0f2eU // Geniality Maple Technology Co., Ltd -#define UHS_VID_PRIVA_DESIGN_SERVICES 0x0f2fU // Priva Design Services -#define UHS_VID_JESS_TECHNOLOGY 0x0f30U // Jess Technology Co., Ltd -#define UHS_VID_CHRYSALIS_DEVELOPMENT 0x0f31U // Chrysalis Development -#define UHS_VID_YFC_BONEAGLE_ELECTRIC 0x0f32U // YFC-BonEagle Electric Co., Ltd -#define UHS_VID_KOKUYO 0x0f37U // Kokuyo Co., Ltd -#define UHS_VID_NIEN_YI_INDUSTRIAL 0x0f38U // Nien-Yi Industrial Corp. -#define UHS_VID_TG3_ELECTRONICS_1 0x0f39U // TG3 Electronics -#define UHS_VID_AIRPRIME_INCORPORATED 0x0f3dU // Airprime, Incorporated -#define UHS_VID_RDC_SEMICONDUCTOR 0x0f41U // RDC Semiconductor Co., Ltd -#define UHS_VID_NITAL_CONSULTING_SERVICES 0x0f42U // Nital Consulting Services, Inc. -#define UHS_VID_POLHEMUS 0x0f44U // Polhemus -#define UHS_VID_ST_JOHN_TECHNOLOGY 0x0f4bU // St. John Technology Co., Ltd -#define UHS_VID_WORLDWIDE_CABLE_OPTO 0x0f4cU // WorldWide Cable Opto Corp. -#define UHS_VID_MICROTUNE 0x0f4dU // Microtune, Inc. -#define UHS_VID_FREEDOM_SCIENTIFIC 0x0f4eU // Freedom Scientific -#define UHS_VID_WING_KEY_ELECTRICAL 0x0f52U // Wing Key Electrical Co., Ltd -#define UHS_VID_DONGGUAN_WHITE_HORSE_CABLE_FACTORY 0x0f53U // Dongguan White Horse Cable Factory, Ltd -#define UHS_VID_KAWAI_MUSICAL_INSTRUMENTS_MFG 0x0f54U // Kawai Musical Instruments Mfg. Co., Ltd -#define UHS_VID_AMBICOM 0x0f55U // AmbiCom, Inc. -#define UHS_VID_PRAIRIECOMM 0x0f5cU // Prairiecomm, Inc. -#define UHS_VID_NEWAGE_INTERNATIONAL 0x0f5dU // NewAge International, LLC -#define UHS_VID_KEY_TECHNOLOGY 0x0f5fU // Key Technology Corp. -#define UHS_VID_NTK 0x0f60U // NTK, Ltd -#define UHS_VID_VARIAN 0x0f61U // Varian, Inc. -#define UHS_VID_ACROX_TECHNOLOGIES 0x0f62U // Acrox Technologies Co., Ltd -#define UHS_VID_LEAPFROG_ENTERPRISES 0x0f63U // LeapFrog Enterprises -#define UHS_VID_KOBE_STEEL 0x0f68U // Kobe Steel, Ltd -#define UHS_VID_DIONEX 0x0f69U // Dionex Corp. -#define UHS_VID_VIBREN_TECHNOLOGIES 0x0f6aU // Vibren Technologies, Inc. -#define UHS_VID_INTELLIGENT_SYSTEMS 0x0f6eU // INTELLIGENT SYSTEMS -#define UHS_VID_DFI_1 0x0f73U // DFI -#define UHS_VID_GUNTERMANN_AND_DRUNCK 0x0f78U // Guntermann & Drunck GmbH -#define UHS_VID_DQ_TECHNOLOGY 0x0f7cU // DQ Technology, Inc. -#define UHS_VID_NETBOTZ 0x0f7dU // NetBotz, Inc. -#define UHS_VID_FLUKE 0x0f7eU // Fluke Corp. -#define UHS_VID_VTECH_HOLDINGS 0x0f88U // VTech Holdings, Ltd -#define UHS_VID_YAZAKI 0x0f8bU // Yazaki Corp. -#define UHS_VID_YOUNG_GENERATION_INTERNATIONAL 0x0f8cU // Young Generation International Corp. -#define UHS_VID_UNIWILL_COMPUTER 0x0f8dU // Uniwill Computer Corp. -#define UHS_VID_KINGNET_TECHNOLOGY 0x0f8eU // Kingnet Technology Co., Ltd -#define UHS_VID_SOMA_NETWORKS 0x0f8fU // Soma Networks -#define UHS_VID_CVILUX 0x0f97U // CviLux Corp. -#define UHS_VID_CYBERBANK 0x0f98U // CyberBank Corp. -#define UHS_VID_HYUN_WON 0x0f9cU // Hyun Won, Inc. -#define UHS_VID_LUCENT_TECHNOLOGIES_1 0x0f9eU // Lucent Technologies -#define UHS_VID_STARCONN_ELECTRONIC 0x0fa3U // Starconn Electronic Co., Ltd -#define UHS_VID_ATL_TECHNOLOGY 0x0fa4U // ATL Technology -#define UHS_VID_SOTEC 0x0fa5U // Sotec Co., Ltd -#define UHS_VID_EPOX_COMPUTER 0x0fa7U // Epox Computer Co., Ltd -#define UHS_VID_LOGIC_CONTROLS 0x0fa8U // Logic Controls, Inc. -#define UHS_VID_WINPOINT_ELECTRONIC 0x0fafU // Winpoint Electronic Corp. -#define UHS_VID_HAURTIAN_WIRE_AND_CABLE 0x0fb0U // Haurtian Wire & Cable Co., Ltd -#define UHS_VID_INCLOSE_DESIGN 0x0fb1U // Inclose Design, Inc. -#define UHS_VID_JUAN_CHERN_INDUSTRIAL 0x0fb2U // Juan-Chern Industrial Co., Ltd -#define UHS_VID_HEBER 0x0fb6U // Heber Ltd -#define UHS_VID_WISTRON 0x0fb8U // Wistron Corp. -#define UHS_VID_AACOM 0x0fb9U // AACom Corp. -#define UHS_VID_SAN_SHING_ELECTRONICS 0x0fbaU // San Shing Electronics Co., Ltd -#define UHS_VID_BITWISE_SYSTEMS 0x0fbbU // Bitwise Systems, Inc. -#define UHS_VID_MITAC_INTERNATINAL 0x0fc1U // Mitac Internatinal Corp. -#define UHS_VID_PLUG_AND_JACK_INDUSTRIAL 0x0fc2U // Plug and Jack Industrial, Inc. -#define UHS_VID_DELCOM_ENGINEERING 0x0fc5U // Delcom Engineering -#define UHS_VID_DATAPLUS_SUPPLIES 0x0fc6U // Dataplus Supplies, Inc. -#define UHS_VID_RESEARCH_IN_MOTION 0x0fcaU // Research In Motion, Ltd. -#define UHS_VID_SONY_ERICSSON_MOBILE_COMMUNICATIONS 0x0fceU // Sony Ericsson Mobile Communications AB -#define UHS_VID_DYNASTREAM_INNOVATIONS 0x0fcfU // Dynastream Innovations, Inc. -#define UHS_VID_TULIP_COMPUTERS_BV 0x0fd0U // Tulip Computers B.V. -#define UHS_VID_GIANT_ELECTRONICS 0x0fd1U // Giant Electronics Ltd. -#define UHS_VID_SEAC_BANCHE 0x0fd2U // Seac Banche -#define UHS_VID_TENOVIS_GMBH_AND_CO_KG 0x0fd4U // Tenovis GmbH & Co., KG -#define UHS_VID_DIRECT_ACCESS_TECHNOLOGY 0x0fd5U // Direct Access Technology, Inc. -#define UHS_VID_ELGATO_SYSTEMS 0x0fd9U // Elgato Systems GmbH -#define UHS_VID_QUANTEC_NETWORKS 0x0fdaU // Quantec Networks GmbH -#define UHS_VID_MICRO_PLUS 0x0fdcU // Micro Plus -#define UHS_VID_OREGON_SCIENTIFIC 0x0fdeU // Oregon Scientific -#define UHS_VID_OSTERHOUT_DESIGN_GROUP 0x0fe0U // Osterhout Design Group -#define UHS_VID_IN_TECH_ELECTRONICS 0x0fe4U // IN-Tech Electronics, Ltd -#define UHS_VID_GREENCONN_USA 0x0fe5U // Greenconn (U.S.A.), Inc. -#define UHS_VID_KONTRON_INDUSTRIAL_COMPUTER_SOURCE_ICS_ADVENT 0x0fe6U // Kontron (Industrial Computer Source / ICS Advent) -#define UHS_VID_DVICO 0x0fe9U // DVICO -#define UHS_VID_UNITED_COMPUTER_ACCESSORIES 0x0feaU // United Computer Accessories -#define UHS_VID_CRS_ELECTRONIC 0x0febU // CRS Electronic Co., Ltd -#define UHS_VID_UMC_ELECTRONICS 0x0fecU // UMC Electronics Co., Ltd -#define UHS_VID_ACCESS 0x0fedU // Access Co., Ltd -#define UHS_VID_XSIDO 0x0feeU // Xsido Corp. -#define UHS_VID_MJ_RESEARCH 0x0fefU // MJ Research, Inc. -#define UHS_VID_CORE_VALLEY 0x0ff6U // Core Valley Co., Ltd -#define UHS_VID_CHI_SHING_COMPUTER_ACCESSORIES 0x0ff7U // CHI SHING Computer Accessories Co., Ltd -#define UHS_VID_CLAVIA_DMI 0x0ffcU // Clavia DMI AB -#define UHS_VID_EARLYSENSE 0x0ffdU // EarlySense -#define UHS_VID_AOPEN 0x0fffU // Aopen, Inc. -#define UHS_VID_SPEED_TECH 0x1000U // Speed Tech Corp. -#define UHS_VID_RITRONICS_COMPONENTS_S_PTE 0x1001U // Ritronics Components (S) Pte., Ltd -#define UHS_VID_SIGMA 0x1003U // Sigma Corp. -#define UHS_VID_LG_ELECTRONICS 0x1004U // LG Electronics, Inc. -#define UHS_VID_APACER_TECHNOLOGY 0x1005U // Apacer Technology, Inc. -#define UHS_VID_IRIVER 0x1006U // iRiver, Ltd. -#define UHS_VID_EMUZED 0x1009U // Emuzed, Inc. -#define UHS_VID_AV_CHASEWAY 0x100aU // AV Chaseway, Ltd -#define UHS_VID_CHOU_CHIN_INDUSTRIAL 0x100bU // Chou Chin Industrial Co., Ltd -#define UHS_VID_NETOPIA 0x100dU // Netopia, Inc. -#define UHS_VID_FUKUDA_DENSHI 0x1010U // Fukuda Denshi Co., Ltd -#define UHS_VID_MOBILE_MEDIA_TECH 0x1011U // Mobile Media Tech. -#define UHS_VID_SDKM_FIBRES_WIRES_AND_CABLES_BERHAD 0x1012U // SDKM Fibres, Wires & Cables Berhad -#define UHS_VID_TST_TOUCHLESS_SENSOR_TECHNOLOGY_AG 0x1013U // TST-Touchless Sensor Technology AG -#define UHS_VID_DENSITRON_TECHNOLOGIES_PLC 0x1014U // Densitron Technologies PLC -#define UHS_VID_SOFTRONICS_PTY 0x1015U // Softronics Pty., Ltd -#define UHS_VID_XIAMEN_HUNGS_ENTERPRISE 0x1016U // Xiamen Hung's Enterprise Co., Ltd -#define UHS_VID_SPEEDY_INDUSTRIAL_SUPPLIES_PTE 0x1017U // Speedy Industrial Supplies, Pte., Ltd -#define UHS_VID_ELITEGROUP_COMPUTER_SYSTEMS_ECS 0x1019U // Elitegroup Computer Systems (ECS) -#define UHS_VID_LABTEC_1 0x1020U // Labtec -#define UHS_VID_SHINKO_SHOJI 0x1022U // Shinko Shoji Co., Ltd -#define UHS_VID_HYPER_PALTEK 0x1025U // Hyper-Paltek -#define UHS_VID_NEWLY 0x1026U // Newly Corp. -#define UHS_VID_TIME_DOMAIN 0x1027U // Time Domain -#define UHS_VID_INOVYS 0x1028U // Inovys Corp. -#define UHS_VID_ATLANTIC_COAST_TELESYS 0x1029U // Atlantic Coast Telesys -#define UHS_VID_RAMOS_TECHNOLOGY 0x102aU // Ramos Technology Co., Ltd -#define UHS_VID_INFOTRONIC_AMERICA 0x102bU // Infotronic America, Inc. -#define UHS_VID_ETOMS_ELECTRONICS 0x102cU // Etoms Electronics Corp. -#define UHS_VID_WINIC 0x102dU // Winic Corp. -#define UHS_VID_COMAX_TECHNOLOGY 0x1031U // Comax Technology, Inc. -#define UHS_VID_C_ONE_TECHNOLOGY 0x1032U // C-One Technology Corp. -#define UHS_VID_NUCAM 0x1033U // Nucam Corp. -#define UHS_VID_STEELSERIES_APS 0x1038U // SteelSeries ApS -#define UHS_VID_DEVOLO_AG 0x1039U // devolo AG -#define UHS_VID_PSA 0x103aU // PSA -#define UHS_VID_STANTON 0x103dU // Stanton -#define UHS_VID_ICREATE_TECHNOLOGIES 0x1043U // iCreate Technologies Corp. -#define UHS_VID_CHU_YUEN_ENTERPRISE 0x1044U // Chu Yuen Enterprise Co., Ltd -#define UHS_VID_WINBOND_ELECTRONICS_CORP_HEX_ 0x1046U // Winbond Electronics Corp. [hex] -#define UHS_VID_TARGUS_GROUP_INTERNATIONAL 0x1048U // Targus Group International -#define UHS_VID_MYLEX_BUSLOGIC 0x104bU // Mylex / Buslogic -#define UHS_VID_AMCO_TEC_INTERNATIONAL 0x104cU // AMCO TEC International, Inc. -#define UHS_VID_NEWPORT_CORPORATION 0x104dU // Newport Corporation -#define UHS_VID_WB_ELECTRONICS 0x104fU // WB Electronics -#define UHS_VID_YUBICOCOM 0x1050U // Yubico.com -#define UHS_VID_IMMANUEL_ELECTRONICS 0x1053U // Immanuel Electronics Co., Ltd -#define UHS_VID_BMS_INTERNATIONAL_BEHEER_NV 0x1054U // BMS International Beheer N.V. -#define UHS_VID_COMPLEX_MICRO_INTERCONNECTION 0x1055U // Complex Micro Interconnection Co., Ltd -#define UHS_VID_HSIN_CHEN_ENT 0x1056U // Hsin Chen Ent Co., Ltd -#define UHS_VID_ON_SEMICONDUCTOR 0x1057U // ON Semiconductor -#define UHS_VID_WESTERN_DIGITAL_TECHNOLOGIES 0x1058U // Western Digital Technologies, Inc. -#define UHS_VID_GIESECKE_AND_DEVRIENT 0x1059U // Giesecke & Devrient GmbH -#define UHS_VID_FOXCONN_INTERNATIONAL 0x105bU // Foxconn International, Inc. -#define UHS_VID_HONG_JI_ELECTRIC_WIRE_AND_CABLE_DONGGUAN 0x105cU // Hong Ji Electric Wire & Cable (Dongguan) Co., Ltd -#define UHS_VID_DELKIN_DEVICES 0x105dU // Delkin Devices, Inc. -#define UHS_VID_VALENCE_SEMICONDUCTOR_DESIGN 0x105eU // Valence Semiconductor Design, Ltd -#define UHS_VID_CHIN_SHONG_ENTERPRISE 0x105fU // Chin Shong Enterprise Co., Ltd -#define UHS_VID_EASTHOME_INDUSTRIAL 0x1060U // Easthome Industrial Co., Ltd -#define UHS_VID_MOTOROLA_ELECTRONICS_TAIWAN_LTD_HEX_ 0x1063U // Motorola Electronics Taiwan, Ltd [hex] -#define UHS_VID_CCYU_TECHNOLOGY 0x1065U // CCYU Technology -#define UHS_VID_LOYAL_LEGEND 0x106aU // Loyal Legend, Ltd -#define UHS_VID_CURITEL_COMMUNICATIONS 0x106cU // Curitel Communications, Inc. -#define UHS_VID_SAN_CHIEH_MANUFACTURING 0x106dU // San Chieh Manufacturing, Ltd -#define UHS_VID_CONECTL 0x106eU // ConectL -#define UHS_VID_MONEY_CONTROLS 0x106fU // Money Controls -#define UHS_VID_GCT_SEMICONDUCTOR 0x1076U // GCT Semiconductor, Inc. -#define UHS_VID_GATEWAY_1 0x107bU // Gateway, Inc. -#define UHS_VID_ARLEC_AUSTRALIA 0x107dU // Arlec Australia, Ltd -#define UHS_VID_MIDORIYA_ELECTRIC 0x107eU // Midoriya Electric Co., Ltd -#define UHS_VID_KIDZMOUSE 0x107fU // KidzMouse, Inc. -#define UHS_VID_SHIN_ETSUKAKEN 0x1082U // Shin-Etsukaken Co., Ltd -#define UHS_VID_CANON_ELECTRONICS 0x1083U // Canon Electronics, Inc. -#define UHS_VID_PANTECH 0x1084U // Pantech Co., Ltd -#define UHS_VID_CHLORIDE_POWER_PROTECTION 0x108aU // Chloride Power Protection -#define UHS_VID_GRAND_TEK_TECHNOLOGY 0x108bU // Grand-tek Technology Co., Ltd -#define UHS_VID_ROBERT_BOSCH 0x108cU // Robert Bosch GmbH -#define UHS_VID_LOTES 0x108eU // Lotes Co., Ltd. -#define UHS_VID_SURFACE_OPTICS 0x1099U // Surface Optics Corp. -#define UHS_VID_DATASOFT_SYSTEMS 0x109aU // DATASOFT Systems GmbH -#define UHS_VID_HISENSE 0x109bU // Hisense -#define UHS_VID_ESOL 0x109fU // eSOL Co., Ltd -#define UHS_VID_HIROTECH 0x10a0U // Hirotech, Inc. -#define UHS_VID_MITSUBISHI_MATERIALS 0x10a3U // Mitsubishi Materials Corp. -#define UHS_VID_SK_TELETECH 0x10a9U // SK Teletech Co., Ltd -#define UHS_VID_CABLES_TO_GO 0x10aaU // Cables To Go -#define UHS_VID_USI 0x10abU // USI Co., Ltd -#define UHS_VID_HONEYWELL 0x10acU // Honeywell, Inc. -#define UHS_VID_PRINCETON_TECHNOLOGY 0x10aeU // Princeton Technology Corp. -#define UHS_VID_LIEBERT 0x10afU // Liebert Corp. -#define UHS_VID_COMODO_PLX_UNKNOWN 0x10b5U // Comodo (PLX?) -#define UHS_VID_DIBCOM 0x10b8U // DiBcom -#define UHS_VID_TM_TECHNOLOGY 0x10bbU // TM Technology, Inc. -#define UHS_VID_DINGING_TECHNOLOGY 0x10bcU // Dinging Technology Co., Ltd -#define UHS_VID_TMT_TECHNOLOGY 0x10bdU // TMT Technology, Inc. -#define UHS_VID_SMARTHOME 0x10bfU // SmartHome -#define UHS_VID_UNIVERSAL_LASER_SYSTEMS 0x10c3U // Universal Laser Systems, Inc. -#define UHS_VID_CYGNAL_INTEGRATED_PRODUCTS 0x10c4U // Cygnal Integrated Products, Inc. -#define UHS_VID_SANEI_ELECTRIC 0x10c5U // Sanei Electric, Inc. -#define UHS_VID_INTEC 0x10c6U // Intec, Inc. -#define UHS_VID_ERATECH 0x10cbU // Eratech -#define UHS_VID_GBM_CONNECTOR 0x10ccU // GBM Connector Co., Ltd -#define UHS_VID_KYCON 0x10cdU // Kycon, Inc. -#define UHS_VID_SILICON_LABS 0x10ceU // Silicon Labs -#define UHS_VID_VELLEMAN_COMPONENTS 0x10cfU // Velleman Components, Inc. -#define UHS_VID_HOTTINGER_BALDWIN_MEASUREMENT 0x10d1U // Hottinger Baldwin Measurement -#define UHS_VID_RAYCOMPOSER__R_ADAMS 0x10d2U // RayComposer - R. Adams -#define UHS_VID_MAN_BOON_MANUFACTORY 0x10d4U // Man Boon Manufactory, Ltd -#define UHS_VID_UNI_CLASS_TECHNOLOGY 0x10d5U // Uni Class Technology Co., Ltd -#define UHS_VID_ACTIONS_SEMICONDUCTOR 0x10d6U // Actions Semiconductor Co., Ltd -#define UHS_VID_AUTHENEX 0x10deU // Authenex, Inc. -#define UHS_VID_IN_WIN_DEVELOPMENT 0x10dfU // In-Win Development, Inc. -#define UHS_VID_POST_OP_VIDEO 0x10e0U // Post-Op Video, Inc. -#define UHS_VID_CABLEPLUS 0x10e1U // CablePlus, Ltd -#define UHS_VID_NADA_ELECTRONICS 0x10e2U // Nada Electronics, Ltd -#define UHS_VID_VAST_TECHNOLOGIES 0x10ecU // Vast Technologies, Inc. -#define UHS_VID_NEXIO 0x10f0U // Nexio Co., Ltd -#define UHS_VID_IMPORTEK 0x10f1U // Importek -#define UHS_VID_TURTLE_BEACH 0x10f5U // Turtle Beach -#define UHS_VID_PICTOS_TECHNOLOGIES 0x10fbU // Pictos Technologies, Inc. -#define UHS_VID_ANUBIS_ELECTRONICS 0x10fdU // Anubis Electronics, Ltd -#define UHS_VID_THRANE_AND_THRANE 0x10feU // Thrane & Thrane -#define UHS_VID_VIRTOUCH 0x1100U // VirTouch, Ltd -#define UHS_VID_EASYPASS_INDUSTRIAL 0x1101U // EasyPass Industrial Co., Ltd -#define UHS_VID_BRIGHTCOM_TECHNOLOGIES 0x1108U // Brightcom Technologies, Ltd -#define UHS_VID_MOXA_TECHNOLOGIES 0x110aU // Moxa Technologies Co., Ltd. -#define UHS_VID_ANALOG_DEVICES_CANADA_LTD_ALLIED_TELESYN 0x1110U // Analog Devices Canada, Ltd (Allied Telesyn) -#define UHS_VID_PANDORA_INTERNATIONAL 0x1111U // Pandora International Ltd. -#define UHS_VID_YM_ELECTRIC 0x1112U // YM ELECTRIC CO., Ltd -#define UHS_VID_MEDION_AG 0x1113U // Medion AG -#define UHS_VID_VSO_ELECTRIC 0x111eU // VSO Electric Co., Ltd -#define UHS_VID_REDRAT 0x112aU // RedRat -#define UHS_VID_MASTER_HILL_ELECTRIC_WIRE_AND_CABLE 0x112eU // Master Hill Electric Wire and Cable Co., Ltd -#define UHS_VID_CELLON_INTERNATIONAL 0x112fU // Cellon International, Inc. -#define UHS_VID_TENX_TECHNOLOGY 0x1130U // Tenx Technology, Inc. -#define UHS_VID_INTEGRATED_SYSTEM_SOLUTION 0x1131U // Integrated System Solution Corp. -#define UHS_VID_TOSHIBA_CORP_DIGITAL_MEDIA_EQUIPMENT_HEX_ 0x1132U // Toshiba Corp., Digital Media Equipment [hex] -#define UHS_VID_CTS_ELECTRONINCS 0x1136U // CTS Electronincs -#define UHS_VID_ARIN_TECH 0x113cU // Arin Tech Co., Ltd -#define UHS_VID_MAPOWER_ELECTRONICS 0x113dU // Mapower Electronics Co., Ltd -#define UHS_VID_V_ONE_MULTIMEDIA_PTE 0x1141U // V One Multimedia, Pte., Ltd -#define UHS_VID_CYBERSCAN_TECHNOLOGIES 0x1142U // CyberScan Technologies, Inc. -#define UHS_VID_JAPAN_RADIO_COMPANY 0x1145U // Japan Radio Company -#define UHS_VID_SHIMANE_SANYO_ELECTRIC 0x1146U // Shimane SANYO Electric Co., Ltd. -#define UHS_VID_EVER_GREAT_ELECTRIC_WIRE_AND_CABLE 0x1147U // Ever Great Electric Wire and Cable Co., Ltd -#define UHS_VID_SPHAIRON_ACCESS_SYSTEMS 0x114bU // Sphairon Access Systems GmbH -#define UHS_VID_TINIUS_OLSEN_TESTING_MACHINE 0x114cU // Tinius Olsen Testing Machine Co., Inc. -#define UHS_VID_ALPHA_IMAGING_TECHNOLOGY 0x114dU // Alpha Imaging Technology Corp. -#define UHS_VID_WAVECOM 0x114fU // Wavecom -#define UHS_VID_SALIX_TECHNOLOGY 0x115bU // Salix Technology Co., Ltd. -#define UHS_VID_SECUGEN 0x1162U // Secugen Corp. -#define UHS_VID_DELORME_PUBLISHING 0x1163U // DeLorme Publishing, Inc. -#define UHS_VID_YUAN_HIGH_TECH_DEVELOPMENT 0x1164U // YUAN High-Tech Development Co., Ltd -#define UHS_VID_TELSON_ELECTRONICS 0x1165U // Telson Electronics Co., Ltd -#define UHS_VID_BANTAM_INTERACTIVE_TECHNOLOGIES 0x1166U // Bantam Interactive Technologies -#define UHS_VID_SALIENT_SYSTEMS 0x1167U // Salient Systems Corp. -#define UHS_VID_BIZCONN_INTERNATIONAL 0x1168U // BizConn International Corp. -#define UHS_VID_GIGASTORAGE 0x116eU // Gigastorage Corp. -#define UHS_VID_SILICON_10_TECHNOLOGY 0x116fU // Silicon 10 Technology Corp. -#define UHS_VID_SHENGYIH_STEEL_MOLD 0x1175U // Shengyih Steel Mold Co., Ltd -#define UHS_VID_SANTA_ELECTRONIC 0x117dU // Santa Electronic, Inc. -#define UHS_VID_JNC 0x117eU // JNC, Inc. -#define UHS_VID_VENTURE 0x1182U // Venture Corp., Ltd -#define UHS_VID_COMPAQ_COMPUTER_CORP_HEX_DIGITAL_DREAM_UNKNOWN 0x1183U // Compaq Computer Corp. [hex] (Digital Dream ?) -#define UHS_VID_KYOCERA_ELCO 0x1184U // Kyocera Elco Corp. -#define UHS_VID_BLOOMBERG_LP 0x1188U // Bloomberg L.P. -#define UHS_VID_ACER_COMMUNICATIONS_AND_MULTIMEDIA 0x1189U // Acer Communications & Multimedia -#define UHS_VID_YOU_YANG_TECHNOLOGY 0x118fU // You Yang Technology Co., Ltd -#define UHS_VID_TRIPACE 0x1190U // Tripace -#define UHS_VID_LOYALTY_FOUNDER_ENTERPRISE 0x1191U // Loyalty Founder Enterprise Co., Ltd -#define UHS_VID_YANKEE_ROBOTICS 0x1196U // Yankee Robotics, LLC -#define UHS_VID_TECHNOIMAGIA 0x1197U // Technoimagia Co., Ltd -#define UHS_VID_STARSHINE_TECHNOLOGY 0x1198U // StarShine Technology Corp. -#define UHS_VID_SIERRA_WIRELESS 0x1199U // Sierra Wireless, Inc. -#define UHS_VID_ZHAN_QI_TECHNOLOGY 0x119aU // ZHAN QI Technology Co., Ltd -#define UHS_VID_RUWIDO_AUSTRIA 0x119bU // ruwido austria GmbH -#define UHS_VID_CHIPCON_AS 0x11a0U // Chipcon AS -#define UHS_VID_TECHNOVAS 0x11a3U // Technovas Co., Ltd -#define UHS_VID_GLOBALMEDIA_GROUP 0x11aaU // GlobalMedia Group, LLC -#define UHS_VID_EXITO_ELECTRONICS 0x11abU // Exito Electronics Co., Ltd -#define UHS_VID_NIKE 0x11acU // Nike -#define UHS_VID_ATECH_FLASH_TECHNOLOGY 0x11b0U // ATECH FLASH TECHNOLOGY -#define UHS_VID_RANDD_INTERNATIONAL_NV 0x11beU // R&D International NV -#define UHS_VID_INMAX 0x11c5U // Inmax -#define UHS_VID_VERIFONE 0x11caU // VeriFone Inc -#define UHS_VID_TOPFIELD 0x11dbU // Topfield Co., Ltd. -#define UHS_VID_KI_TECHNOLOGY 0x11e6U // K.I. Technology Co. Ltd. -#define UHS_VID_SIEMENS_AG_1 0x11f5U // Siemens AG -#define UHS_VID_PROLIFIC 0x11f6U // Prolific -#define UHS_VID_ALCATEL_UNKNOWN 0x11f7U // Alcatel (?) -#define UHS_VID_TSC_AUTO_ID_TECHNOLOGY 0x1203U // TSC Auto ID Technology Co., Ltd -#define UHS_VID_INTERBIOMETRICS 0x1209U // InterBiometrics -#define UHS_VID_HUDSON_SOFT 0x120eU // Hudson Soft Co., Ltd -#define UHS_VID_MAGELLAN 0x120fU // Magellan -#define UHS_VID_DIGITECH 0x1210U // DigiTech -#define UHS_VID_JUNGSOFT 0x121eU // Jungsoft Co., Ltd -#define UHS_VID_UNKNOWN_MANUFACTURER_1 0x1221U // Unknown manufacturer -#define UHS_VID_SKYCABLE_ENTERPRISE 0x1223U // SKYCABLE ENTERPRISE. CO., LTD. -#define UHS_VID_DATAPAQ_LIMITED 0x1228U // Datapaq Limited -#define UHS_VID_CHIPIDEA_MICROELECTRONICA 0x1230U // Chipidea-Microelectronica, S.A. -#define UHS_VID_DENVER_ELECTRONICS 0x1233U // Denver Electronics -#define UHS_VID_BRAIN_ACTUATED_TECHNOLOGIES 0x1234U // Brain Actuated Technologies -#define UHS_VID_FOCUSRITE_NOVATION 0x1235U // Focusrite-Novation -#define UHS_VID_BELKIN 0x1241U // Belkin -#define UHS_VID_AIRVAST 0x124aU // AirVast -#define UHS_VID_NYKO_HONEY_BEE 0x124bU // Nyko (Honey Bee) -#define UHS_VID_MXI__MEMORY_EXPERTS_INTERNATIONAL 0x124cU // MXI - Memory Experts International, Inc. -#define UHS_VID_APOGEE 0x125cU // Apogee Inc. -#define UHS_VID_A_DATA_TECHNOLOGY 0x125fU // A-DATA Technology Co., Ltd. -#define UHS_VID_STANDARD_MICROSYSTEMS_3 0x1260U // Standard Microsystems Corp. -#define UHS_VID_COVIDIEN_ENERGY_BASED_DEVICES 0x1264U // Covidien Energy-based Devices -#define UHS_VID_PIRELLI_BROADBAND_SOLUTIONS 0x1266U // Pirelli Broadband Solutions -#define UHS_VID_LOGIC3_SPECTRAVIDEO_PLC 0x1267U // Logic3 / SpectraVideo plc -#define UHS_VID_ARISTOCRAT_TECHNOLOGIES 0x126cU // Aristocrat Technologies -#define UHS_VID_BEL_STEWART 0x126dU // Bel Stewart -#define UHS_VID_STROBE_DATA 0x126eU // Strobe Data, Inc. -#define UHS_VID_TWINMOS 0x126fU // TwinMOS -#define UHS_VID_ENSONIQ 0x1274U // Ensoniq -#define UHS_VID_XAXERO_MARINE_SOFTWARE_ENGINEERING 0x1275U // Xaxero Marine Software Engineering, Ltd. -#define UHS_VID_STARLIGHT_XPRESS 0x1278U // Starlight Xpress -#define UHS_VID_ZEBRIS_MEDICAL 0x1283U // zebris Medical GmbH -#define UHS_VID_MARVELL_SEMICONDUCTOR 0x1286U // Marvell Semiconductor, Inc. -#define UHS_VID_QUALCOMM_FLARION_TECHNOLOGIES_INC_LEADTEK_RESEARCH 0x1291U // Qualcomm Flarion Technologies, Inc. / Leadtek Research, Inc. -#define UHS_VID_INNOMEDIA_1 0x1292U // Innomedia -#define UHS_VID_BELKIN_COMPONENTS_HEX_ 0x1293U // Belkin Components [hex] -#define UHS_VID_RISO_KAGAKU 0x1294U // RISO KAGAKU CORP. -#define UHS_VID_CYBERTAN_TECHNOLOGY 0x129bU // CyberTAN Technology -#define UHS_VID_TRENDCHIP_TECHNOLOGIES 0x12a7U // Trendchip Technologies Corp. -#define UHS_VID_HONEY_BEE_ELECTRONIC_INTERNATIONAL 0x12abU // Honey Bee Electronic International Ltd. -#define UHS_VID_ZHEJIANG_XINYA_ELECTRONIC_TECHNOLOGY 0x12b8U // Zhejiang Xinya Electronic Technology Co., Ltd. -#define UHS_VID_E28 0x12b9U // E28 -#define UHS_VID_LICENSED_BY_SONY_COMPUTER_ENTERTAINMENT_AMERICA 0x12baU // Licensed by Sony Computer Entertainment America -#define UHS_VID_GEMBIRD 0x12bdU // Gembird -#define UHS_VID_AUTOCUE_GROUP 0x12c4U // Autocue Group Ltd -#define UHS_VID_DEXIN_1 0x12cfU // DEXIN -#define UHS_VID_HUAWEI_TECHNOLOGIES 0x12d1U // Huawei Technologies Co., Ltd. -#define UHS_VID_LINE_TECH_INDUSTRIAL 0x12d2U // LINE TECH INDUSTRIAL CO., LTD. -#define UHS_VID_EMS_DR_THOMAS_WUENSCHE 0x12d6U // EMS Dr. Thomas Wuensche -#define UHS_VID_BETTER_WIRE_FACTORY 0x12d7U // BETTER WIRE FACTORY CO., LTD. -#define UHS_VID_ARANEUS_INFORMATION_SYSTEMS_OY 0x12d8U // Araneus Information Systems Oy -#define UHS_VID_WALDORF_MUSIC 0x12e6U // Waldorf Music GmbH -#define UHS_VID_TAPWAVE 0x12efU // Tapwave, Inc. -#define UHS_VID_DYNAMIC_SYSTEM_ELECTRONICS 0x12f5U // Dynamic System Electronics Corp. -#define UHS_VID_MEMOREX_PRODUCTS 0x12f7U // Memorex Products, Inc. -#define UHS_VID_AIN_COMM_TECHNOLOGY 0x12fdU // AIN Comm. Technology Co., Ltd -#define UHS_VID_FASCINATING_ELECTRONICS 0x12ffU // Fascinating Electronics, Inc. -#define UHS_VID_TRANSCEND_INFORMATION 0x1307U // Transcend Information, Inc. -#define UHS_VID_SHUTTLE_1 0x1308U // Shuttle, Inc. -#define UHS_VID_ROPER 0x1310U // Roper -#define UHS_VID_ICS_ELECTRONICS 0x1312U // ICS Electronics -#define UHS_VID_THORLABS 0x1313U // ThorLabs -#define UHS_VID_NATURAL_POINT 0x131dU // Natural Point -#define UHS_VID_ENVARA 0x132aU // Envara Inc. -#define UHS_VID_KONICA_MINOLTA 0x132bU // Konica Minolta -#define UHS_VID_KEMPER_DIGITAL 0x133eU // Kemper Digital GmbH -#define UHS_VID_MOBILITY 0x1342U // Mobility -#define UHS_VID_CITIZEN_SYSTEMS 0x1343U // Citizen Systems -#define UHS_VID_SINO_LITE_TECHNOLOGY 0x1345U // Sino Lite Technology Corp. -#define UHS_VID_MORAVIAN_INSTRUMENTS 0x1347U // Moravian Instruments -#define UHS_VID_KATSURAGAWA_ELECTRIC 0x1348U // Katsuragawa Electric Co., Ltd. -#define UHS_VID_PANJIT_INTERNATIONAL 0x134cU // PanJit International Inc. -#define UHS_VID_DIGBYS_BITPILE_INC_DBA_D_BIT 0x134eU // Digby's Bitpile, Inc. DBA D Bit -#define UHS_VID_PANDE_MICROCOMPUTER_SYSTEMS 0x1357U // P&E Microcomputer Systems -#define UHS_VID_CONTROL_DEVELOPMENT 0x135fU // Control Development Inc. -#define UHS_VID_SEGGER 0x1366U // SEGGER -#define UHS_VID_STEC 0x136bU // STEC -#define UHS_VID_ANDOR_TECHNOLOGY 0x136eU // Andor Technology Ltd. -#define UHS_VID_SWISSBIT 0x1370U // Swissbit -#define UHS_VID_CNET_TECHNOLOGY 0x1371U // CNet Technology Inc. -#define UHS_VID_VIMTRON_ELECTRONICS 0x1376U // Vimtron Electronics Co., Ltd. -#define UHS_VID_SCAPS 0x137bU // SCAPS GmbH -#define UHS_VID_NETGEAR_2 0x1385U // Netgear, Inc -#define UHS_VID_VALIDITY_SENSORS 0x138aU // Validity Sensors, Inc. -#define UHS_VID_JUNGO 0x138eU // Jungo LTD -#define UHS_VID_TOMTOM_BV 0x1390U // TOMTOM B.V. -#define UHS_VID_IDEALTEK 0x1391U // IdealTEK, Inc. -#define UHS_VID_SENNHEISER_COMMUNICATIONS 0x1395U // Sennheiser Communications -#define UHS_VID_BEHRINGER_INTERNATIONAL 0x1397U // BEHRINGER International GmbH -#define UHS_VID_Q_TEC 0x1398U // Q-tec -#define UHS_VID_BALTECH 0x13adU // Baltech -#define UHS_VID_PERKINELMER_OPTOELECTRONICS 0x13b0U // PerkinElmer Optoelectronics -#define UHS_VID_LINKSYS_2 0x13b1U // Linksys -#define UHS_VID_ALESIS 0x13b2U // Alesis -#define UHS_VID_NIPPON_DICS 0x13b3U // Nippon Dics Co., Ltd. -#define UHS_VID_PCPLAY 0x13baU // PCPlay -#define UHS_VID_RICOH_PRINTING_SYSTEMS 0x13beU // Ricoh Printing Systems, Ltd. -#define UHS_VID_JYETAI_PRECISION_INDUSTRIAL 0x13caU // JyeTai Precision Industrial Co., Ltd. -#define UHS_VID_WISAIR 0x13cfU // Wisair Ltd. -#define UHS_VID_TECHSAN_ELECTRONICS 0x13d0U // Techsan Electronics Co., Ltd. -#define UHS_VID_A_MAX_TECHNOLOGY_MACAO_COMMERCIAL_OFFSHORE 0x13d1U // A-Max Technology Macao Commercial Offshore Co. Ltd. -#define UHS_VID_SHARK_MULTIMEDIA_1 0x13d2U // Shark Multimedia -#define UHS_VID_IMC_NETWORKS 0x13d3U // IMC Networks -#define UHS_VID_GUIDANCE_SOFTWARE 0x13d7U // Guidance Software, Inc. -#define UHS_VID_ALEREON 0x13dcU // ALEREON, INC. -#define UHS_VID_ITECH_DYNAMIC_LIMITED 0x13ddU // i.Tech Dynamic Limited -#define UHS_VID_KAIBO_WIRE_AND_CABLE_SHENZHEN 0x13e1U // Kaibo Wire & Cable (Shenzhen) Co., Ltd. -#define UHS_VID_RANE 0x13e5U // Rane -#define UHS_VID_TECHNOSCOPE 0x13e6U // TechnoScope Co., Ltd. -#define UHS_VID_HENGSTLER 0x13eaU // Hengstler -#define UHS_VID_ZYDACRON 0x13ecU // Zydacron -#define UHS_VID_MOSART 0x13eeU // MosArt -#define UHS_VID_INITIO_CORPORATION 0x13fdU // Initio Corporation -#define UHS_VID_KINGSTON_TECHNOLOGY_COMPANY_1 0x13feU // Kingston Technology Company Inc. -#define UHS_VID_AXXION_GROUP 0x1400U // Axxion Group Corp. -#define UHS_VID_BOWE_BELL_AND_HOWELL 0x1402U // Bowe Bell & Howell -#define UHS_VID_SITRONIX 0x1403U // Sitronix -#define UHS_VID_IDS_IMAGING_DEVELOPMENT_SYSTEMS 0x1409U // IDS Imaging Development Systems GmbH -#define UHS_VID_TELECHIPS 0x140eU // Telechips, Inc. -#define UHS_VID_NOVATEL_WIRELESS_1 0x1410U // Novatel Wireless -#define UHS_VID_NAM_TAI_EANDE_PRODUCTS_LTD_OR_OMNIVISION_TECHNOLOGIES 0x1415U // Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. -#define UHS_VID_ABILITY_ENTERPRISE 0x1419U // ABILITY ENTERPRISE CO., LTD. -#define UHS_VID_SENSOR_TECHNOLOGY 0x1421U // Sensor Technology -#define UHS_VID_VEGA_TECHNOLOGIES_INDUSTRIAL_AUSTRIA 0x1429U // Vega Technologies Industrial (Austria) Co. -#define UHS_VID_THALES_E_TRANSACTIONS 0x142aU // Thales E-Transactions -#define UHS_VID_ARBITER_SYSTEMS 0x142bU // Arbiter Systems, Inc. -#define UHS_VID_REDOCTANE 0x1430U // RedOctane -#define UHS_VID_PERTECH_RESOURCES 0x1431U // Pertech Resources, Inc. -#define UHS_VID_WISTRON_NEWEB 0x1435U // Wistron NeWeb -#define UHS_VID_DENALI_SOFTWARE 0x1436U // Denali Software, Inc. -#define UHS_VID_ALTEK_CORPORATION 0x143cU // Altek Corporation -#define UHS_VID_DIGILENT 0x1443U // Digilent -#define UHS_VID_XJGROUP 0x1446U // X.J.GROUP -#define UHS_VID_RADIO_SHACK 0x1453U // Radio Shack -#define UHS_VID_EXTENDING_WIRE_AND_CABLE 0x1456U // Extending Wire & Cable Co., Ltd. -#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER_1 0x1457U // First International Computer, Inc. -#define UHS_VID_TRUST 0x145fU // Trust -#define UHS_VID_TATUNG 0x1460U // Tatung Co. -#define UHS_VID_STACCATO_COMMUNICATIONS 0x1461U // Staccato Communications -#define UHS_VID_MICRO_STAR_INTERNATIONAL_1 0x1462U // Micro Star International -#define UHS_VID_HUAWEI_3COM 0x1472U // Huawei-3Com -#define UHS_VID_FORMOSA_INDUSTRIAL_COMPUTING 0x147aU // Formosa Industrial Computing, Inc. -#define UHS_VID_UPEK 0x147eU // Upek -#define UHS_VID_HAMA_GMBH_AND_CO_KG 0x147fU // Hama GmbH & Co., KG -#define UHS_VID_VAILLANT 0x1482U // Vaillant -#define UHS_VID_ELSA_AG_HEX_ 0x1484U // Elsa AG [hex] -#define UHS_VID_SILICOM_1 0x1485U // Silicom -#define UHS_VID_DSP_GROUP 0x1487U // DSP Group, Ltd. -#define UHS_VID_EVATRONIX 0x148eU // EVATRONIX SA -#define UHS_VID_RALINK_TECHNOLOGY 0x148fU // Ralink Technology, Corp. -#define UHS_VID_FUTRONIC_TECHNOLOGY 0x1491U // Futronic Technology Co. Ltd. -#define UHS_VID_SUUNTO 0x1493U // Suunto -#define UHS_VID_PANSTRONG_COMPANY 0x1497U // Panstrong Company Ltd. -#define UHS_VID_MICROTEK_INTERNATIONAL_1 0x1498U // Microtek International Inc. -#define UHS_VID_IMAGINATION_TECHNOLOGIES 0x149aU // Imagination Technologies -#define UHS_VID_WIDEVIEW_TECHNOLOGY 0x14aaU // WideView Technology Inc. -#define UHS_VID_CTK_CORPORATION 0x14adU // CTK Corporation -#define UHS_VID_PRINTRONIX 0x14aeU // Printronix Inc. -#define UHS_VID_ATP_ELECTRONICS 0x14afU // ATP Electronics Inc. -#define UHS_VID_STARTECHCOM 0x14b0U // StarTech.com Ltd. -#define UHS_VID_RALINK_TECHNOLOGY_1 0x14b2U // Ralink Technology, Corp. -#define UHS_VID_ROCKWELL_AUTOMATION 0x14c0U // Rockwell Automation, Inc. -#define UHS_VID_GEMLIGHT_COMPUTER 0x14c2U // Gemlight Computer, Ltd -#define UHS_VID_ZYTRONIC 0x14c8U // Zytronic -#define UHS_VID_SUPER_TOP 0x14cdU // Super Top -#define UHS_VID_JAMER_INDUSTRIES 0x14d8U // JAMER INDUSTRIES CO., LTD. -#define UHS_VID_RARITAN_COMPUTER 0x14ddU // Raritan Computer, Inc. -#define UHS_VID_WINRADIO_COMMUNICATIONS 0x14e0U // WiNRADiO Communications -#define UHS_VID_DIALOGUE_TECHNOLOGY 0x14e1U // Dialogue Technology Corp. -#define UHS_VID_SAIN_INFORMATION_AND_COMMUNICATIONS 0x14e5U // SAIN Information & Communications Co., Ltd. -#define UHS_VID_PLANEX_COMMUNICATIONS_1 0x14eaU // Planex Communications -#define UHS_VID_SHURE 0x14edU // Shure Inc. -#define UHS_VID_TECHNISAT_DIGITAL 0x14f7U // TechniSat Digital GmbH -#define UHS_VID_ELLISYS_1 0x1500U // Ellisys -#define UHS_VID_PINE_TUM_ENTERPRISE 0x1501U // Pine-Tum Enterprise Co., Ltd. -#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER_2 0x1509U // First International Computer, Inc. -#define UHS_VID_MEDMOBILE 0x1513U // medMobile -#define UHS_VID_ACTEL 0x1514U // Actel -#define UHS_VID_COMPUSA 0x1516U // CompUSA -#define UHS_VID_CHESHIRE_ENGINEERING 0x1518U // Cheshire Engineering Corp. -#define UHS_VID_COMNEON 0x1519U // Comneon -#define UHS_VID_BITWIRE 0x1520U // Bitwire Corp. -#define UHS_VID_ENE_TECHNOLOGY_1 0x1524U // ENE Technology Inc -#define UHS_VID_SILICON_PORTALS 0x1527U // Silicon Portals -#define UHS_VID_UBIQUAM 0x1529U // UBIQUAM Co., Ltd. -#define UHS_VID_THESYCON_SYSTEMSOFTWARE_AND_CONSULTING 0x152aU // Thesycon Systemsoftware & Consulting GmbH -#define UHS_VID_MIR_SRL 0x152bU // MIR Srl -#define UHS_VID_JMICRON_TECHNOLOGY_CORP_JMICRON_USA_TECHNOLOGY 0x152dU // JMicron Technology Corp. / JMicron USA Technology Corp. -#define UHS_VID_LG_HLDS 0x152eU // LG (HLDS) -#define UHS_VID_RAZER_USA 0x1532U // Razer USA, Ltd -#define UHS_VID_TERRATEC_ELECTRONIC_1 0x153bU // TerraTec Electronic GmbH -#define UHS_VID_U_BLOX_AG 0x1546U // U-Blox AG -#define UHS_VID_SG_INTEC_LTD_AND_CO_KG 0x1547U // SG Intec Ltd & Co KG -#define UHS_VID_CELECTRONIC 0x154aU // Celectronic GmbH -#define UHS_VID_PNY 0x154bU // PNY -#define UHS_VID_CONNECTCOUNTY_HOLDINGS_BERHAD 0x154dU // ConnectCounty Holdings Berhad -#define UHS_VID_DANDM_HOLDINGS_INC_DENONMARANTZ 0x154eU // D&M Holdings, Inc. (Denon/Marantz) -#define UHS_VID_SNBC 0x154fU // SNBC CO., Ltd -#define UHS_VID_PROLINK_MICROSYSTEMS 0x1554U // Prolink Microsystems Corp. -#define UHS_VID_OQO 0x1557U // OQO -#define UHS_VID_SUNF_PU_TECHNOLOGY 0x1568U // Sunf Pu Technology Co., Ltd -#define UHS_VID_QUANTUM_CORPORATION 0x156fU // Quantum Corporation -#define UHS_VID_ALLTOP_TECHNOLOGY 0x1570U // ALLTOP TECHNOLOGY CO., LTD. -#define UHS_VID_KETRON_SRL 0x157bU // Ketron SRL -#define UHS_VID_TRENDNET 0x157eU // TRENDnet -#define UHS_VID_FIBERLINE 0x1582U // Fiberline -#define UHS_VID_SMA_TECHNOLOGIE_AG 0x1587U // SMA Technologie AG -#define UHS_VID_OAKLEY 0x158dU // Oakley Inc. -#define UHS_VID_JDS_UNIPHASE_CORPORATION_JDSU 0x158eU // JDS Uniphase Corporation (JDSU) -#define UHS_VID_KUNSHAN_GUOJI_ELECTRONICS 0x1598U // Kunshan Guoji Electronics Co., Ltd. -#define UHS_VID_FREESCALE_SEMICONDUCTOR 0x15a2U // Freescale Semiconductor, Inc. -#define UHS_VID_AFATECH_TECHNOLOGIES 0x15a4U // Afatech Technologies, Inc. -#define UHS_VID_TEAMS_POWER_LIMITED 0x15a8U // Teams Power Limited -#define UHS_VID_GEMTEK 0x15a9U // Gemtek -#define UHS_VID_GEARWAY_ELECTRONICS_DONG_GUAN 0x15aaU // Gearway Electronics (Dong Guan) Co., Ltd. -#define UHS_VID_VMWARE_1 0x15adU // VMware Inc. -#define UHS_VID_OLIMEX 0x15baU // Olimex Ltd. -#define UHS_VID_XL_IMAGING 0x15c0U // XL Imaging -#define UHS_VID_SOUNDGRAPH 0x15c2U // SoundGraph Inc. -#define UHS_VID_ADVANCE_MULTIMEDIA_INTERNET_TECHNOLOGY_INC_AMIT 0x15c5U // Advance Multimedia Internet Technology Inc. (AMIT) -#define UHS_VID_LABORATOIRES_MXM 0x15c6U // Laboratoires MXM -#define UHS_VID_KTF_TECHNOLOGIES 0x15c8U // KTF Technologies -#define UHS_VID_D_BOX_TECHNOLOGIES 0x15c9U // D-Box Technologies -#define UHS_VID_TEXTECH_INTERNATIONAL 0x15caU // Textech International Ltd. -#define UHS_VID_COULOMB_ELECTRONICS 0x15d5U // Coulomb Electronics Ltd. -#define UHS_VID_TRUST_INTERNATIONAL_BV_1 0x15d9U // Trust International B.V. -#define UHS_VID_HYNIX_SEMICONDUCTOR 0x15dcU // Hynix Semiconductor Inc. -#define UHS_VID_SEONG_JI_INDUSTRIAL 0x15e0U // Seong Ji Industrial Co., Ltd. -#define UHS_VID_RSA 0x15e1U // RSA -#define UHS_VID_NUMARK 0x15e4U // Numark -#define UHS_VID_SOHOWARE 0x15e8U // SohoWare -#define UHS_VID_PACIFIC_DIGITAL 0x15e9U // Pacific Digital Corp. -#define UHS_VID_BELCARRA_TECHNOLOGIES 0x15ecU // Belcarra Technologies Corp. -#define UHS_VID_HANFTEK 0x15f4U // HanfTek -#define UHS_VID_TASCAM 0x1604U // Tascam -#define UHS_VID_UMAX_1 0x1606U // Umax -#define UHS_VID_INSIDE_OUT_NETWORKS_HEX_ 0x1608U // Inside Out Networks [hex] -#define UHS_VID_VIA_TECHNOLOGIES_1 0x160aU // VIA Technologies, Inc. -#define UHS_VID_INRO 0x160eU // INRO -#define UHS_VID_AMOI_ELECTRONICS 0x1614U // Amoi Electronics -#define UHS_VID_SONY_1 0x1617U // Sony Corp. -#define UHS_VID_L_AND_K_PRECISION_TECHNOLOGY 0x1619U // L & K Precision Technology Co., Ltd. -#define UHS_VID_WIONICS_RESEARCH 0x1621U // Wionics Research -#define UHS_VID_STONESTREET_ONE 0x1628U // Stonestreet One, Inc. -#define UHS_VID_AIRGO_NETWORKS 0x162aU // Airgo Networks Inc. -#define UHS_VID_WIQUEST_COMMUNICATIONS 0x162fU // WiQuest Communications, Inc. -#define UHS_VID_2WIRE_1 0x1630U // 2Wire, Inc. -#define UHS_VID_GOOD_WAY_TECHNOLOGY 0x1631U // Good Way Technology -#define UHS_VID_ENTREGA_HEX_ 0x1645U // Entrega [hex] -#define UHS_VID_SOFTEC_MICROSYSTEMS 0x1649U // SofTec Microsystems -#define UHS_VID_CHIPX 0x164aU // ChipX -#define UHS_VID_MATRIX_VISION 0x164cU // Matrix Vision GmbH -#define UHS_VID_STRUCK_INNOVATIVE_SYSTEME 0x1657U // Struck Innovative Systeme GmbH -#define UHS_VID_FRONTIER_DESIGN_GROUP 0x165bU // Frontier Design Group -#define UHS_VID_KONDO_KAGAKU 0x165cU // Kondo Kagaku -#define UHS_VID_CREATIX_POLYMEDIA 0x1660U // Creatix Polymedia GmbH -#define UHS_VID_GIGA_TMS 0x1667U // GIGA-TMS INC. -#define UHS_VID_ACTIONTEC_ELECTRONICS_INC_HEX_ 0x1668U // Actiontec Electronics, Inc. [hex] -#define UHS_VID_PIKRON_LTD_HEX_ 0x1669U // PiKRON Ltd. [hex] -#define UHS_VID_CLIPSAL 0x166aU // Clipsal -#define UHS_VID_CHINA_HUADA_INTEGRATED_CIRCUIT_DESIGN_GROUP_CO_LTD_CIDC_GROUP 0x1677U // China Huada Integrated Circuit Design (Group) Co., Ltd. (CIDC Group) -#define UHS_VID_TOTAL_PHASE 0x1679U // Total Phase -#define UHS_VID_GOLDEN_BRIDGE_ELECTECH_1 0x1680U // Golden Bridge Electech Inc. -#define UHS_VID_PREVO_TECHNOLOGIES 0x1681U // Prevo Technologies, Inc. -#define UHS_VID_MAXWISE_PRODUCTION_ENTERPRISE 0x1682U // Maxwise Production Enterprise Ltd. -#define UHS_VID_GODSPEED_COMPUTER 0x1684U // Godspeed Computer Corp. -#define UHS_VID_DELOCK 0x1685U // Delock -#define UHS_VID_ZOOM_CORPORATION 0x1686U // ZOOM Corporation -#define UHS_VID_KINGMAX_DIGITAL 0x1687U // Kingmax Digital Inc. -#define UHS_VID_SAAB 0x1688U // Saab AB -#define UHS_VID_RAZER_USA_1 0x1689U // Razer USA, Ltd -#define UHS_VID_ATHEROS_COMMUNICATIONS_1 0x168cU // Atheros Communications -#define UHS_VID_ASKEY_COMPUTER_CORP_HEX_ 0x1690U // Askey Computer Corp. [hex] -#define UHS_VID_HITACHI_VIDEO_AND_INFORMATION_SYSTEM 0x1696U // Hitachi Video and Information System, Inc. -#define UHS_VID_VTEC_TEST 0x1697U // VTec Test, Inc. -#define UHS_VID_SHENZHEN_ZHENGERYA_CABLE 0x16a5U // Shenzhen Zhengerya Cable Co., Ltd. -#define UHS_VID_UNIGRAF 0x16a6U // Unigraf -#define UHS_VID_GLOBAL_SUN_TECHNOLOGY_1 0x16abU // Global Sun Technology -#define UHS_VID_DONGGUAN_CHINGLUNG_WIRE_AND_CABLE 0x16acU // Dongguan ChingLung Wire & Cable Co., Ltd. -#define UHS_VID_ISTATION 0x16b4U // iStation -#define UHS_VID_PERSENTEC 0x16b5U // Persentec, Inc. -#define UHS_VID_VAN_OOIJEN_TECHNISCHE_INFORMATICA 0x16c0U // Van Ooijen Technische Informatica -#define UHS_VID_WIRELESS_CABLES 0x16caU // Wireless Cables, Inc. -#define UHS_VID_SILEX_TECHNOLOGY 0x16ccU // silex technology, Inc. -#define UHS_VID_MCS 0x16d0U // MCS -#define UHS_VID_SUPREMA 0x16d1U // Suprema Inc. -#define UHS_VID_FRONTLINE_TEST_EQUIPMENT 0x16d3U // Frontline Test Equipment, Inc. -#define UHS_VID_ANYDATA_CORPORATION 0x16d5U // AnyDATA Corporation -#define UHS_VID_JABLOCOM_SRO 0x16d6U // JABLOCOM s.r.o. -#define UHS_VID_CMOTECH 0x16d8U // CMOTECH Co., Ltd. -#define UHS_VID_WIENER_PLEIN_AND_BAUS 0x16dcU // Wiener, Plein & Baus -#define UHS_VID_KING_BILLION_ELECTRONICS 0x16dfU // King Billion Electronics Co., Ltd. -#define UHS_VID_GN_RESOUND_AS 0x16f0U // GN ReSound A/S -#define UHS_VID_FUTURELOGIC 0x16f5U // Futurelogic Inc. -#define UHS_VID_BLUEVIEW_TECHNOLOGIES 0x1706U // BlueView Technologies, Inc. -#define UHS_VID_ARTIMI 0x1707U // ARTIMI -#define UHS_VID_SWISSONIC 0x170bU // Swissonic -#define UHS_VID_AVNERA 0x170dU // Avnera -#define UHS_VID_LEICA_MICROSYSTEMS 0x1711U // Leica Microsystems -#define UHS_VID_MEYER_INSTRUMENTS_MIS 0x1724U // Meyer Instruments (MIS) -#define UHS_VID_VITESSE_SEMICONDUCTOR 0x1725U // Vitesse Semiconductor -#define UHS_VID_AXESSTEL 0x1726U // Axesstel, Inc. -#define UHS_VID_WALTOP_INTERNATIONAL 0x172fU // Waltop International Corp. -#define UHS_VID_CELLINK_TECHNOLOGY 0x1733U // Cellink Technology Co., Ltd -#define UHS_VID_CANON_IMAGING_SYSTEM_TECHNOLOGIES 0x1736U // CANON IMAGING SYSTEM TECHNOLOGIES INC. -#define UHS_VID_LINKSYS_3 0x1737U // Linksys -#define UHS_VID_QSENN 0x173dU // QSENN -#define UHS_VID_SENAO 0x1740U // Senao -#define UHS_VID_GENERAL_ATOMICS 0x1743U // General Atomics -#define UHS_VID_MQP_ELECTRONICS 0x1748U // MQP Electronics -#define UHS_VID_ASMEDIA_TECHNOLOGY 0x174cU // ASMedia Technology Inc. -#define UHS_VID_SYNTEK 0x174fU // Syntek -#define UHS_VID_GERTEC_TELECOMUNICACOES_LTDA 0x1753U // GERTEC Telecomunicacoes Ltda. -#define UHS_VID_ENENSYS_TECHNOLOGIES 0x1756U // ENENSYS Technologies -#define UHS_VID_LUCIDPORT_TECHNOLOGY 0x1759U // LucidPort Technology, Inc. -#define UHS_VID_ASUSTEK_COMPUTER_INC_WRONG_ID 0x1761U // ASUSTek Computer, Inc. (wrong ID) -#define UHS_VID_SYSTEM_LEVEL_SOLUTIONS 0x1772U // System Level Solutions, Inc. -#define UHS_VID_AROWANA 0x1776U // Arowana -#define UHS_VID_SWEEX 0x177fU // Sweex -#define UHS_VID_MULTIPLE_VENDORS 0x1781U // Multiple Vendors -#define UHS_VID_SPREADTRUM_COMMUNICATIONS 0x1782U // Spreadtrum Communications Inc. -#define UHS_VID_TOPSEED_TECHNOLOGY 0x1784U // TopSeed Technology Corp. -#define UHS_VID_ATI_AIB 0x1787U // ATI AIB -#define UHS_VID_SHENZHEN_LITKCONN_TECHNOLOGY 0x1788U // ShenZhen Litkconn Technology Co., Ltd. -#define UHS_VID_PRINTREX 0x1796U // Printrex, Inc. -#define UHS_VID_JALCO 0x1797U // JALCO CO., LTD. -#define UHS_VID_THALES_NORWAY_AS 0x1799U // Thales Norway A/S -#define UHS_VID_RICAVISION_INTERNATIONAL 0x179dU // Ricavision International, Inc. -#define UHS_VID_SAMSON_TECHNOLOGIES 0x17a0U // Samson Technologies Corp. -#define UHS_VID_CONCEPT2 0x17a4U // Concept2 -#define UHS_VID_ADVANCED_CONNECTION_TECHNOLOGY 0x17a5U // Advanced Connection Technology Inc. -#define UHS_VID_MICOMSOFT 0x17a7U // MICOMSOFT CO., LTD. -#define UHS_VID_KAMSTRUP_AS 0x17a8U // Kamstrup A/S -#define UHS_VID_GREY_INNOVATION 0x17b3U // Grey Innovation -#define UHS_VID_LUNATONE 0x17b5U // Lunatone -#define UHS_VID_SAURIS 0x17baU // SAURIS GmbH -#define UHS_VID_SINGIM_INTERNATIONAL 0x17c3U // Singim International Corp. -#define UHS_VID_NATIVE_INSTRUMENTS 0x17ccU // Native Instruments -#define UHS_VID_HIP_HING_CABLE_AND_PLUG_MFY 0x17cfU // Hip Hing Cable & Plug Mfy. Ltd. -#define UHS_VID_SANFORD_LP 0x17d0U // Sanford L.P. -#define UHS_VID_KOREA_TECHTRON 0x17d3U // Korea Techtron Co., Ltd. -#define UHS_VID_DISPLAYLINK 0x17e9U // DisplayLink -#define UHS_VID_CORNICE 0x17ebU // Cornice, Inc. -#define UHS_VID_LENOVO 0x17efU // Lenovo -#define UHS_VID_WAVESENSE 0x17f4U // WaveSense -#define UHS_VID_KK_ROCKY 0x17f5U // K.K. Rocky -#define UHS_VID_UNICOMP 0x17f6U // Unicomp, Inc -#define UHS_VID_ADVANTECH 0x1809U // Advantech -#define UHS_VID_TWINHAN 0x1822U // Twinhan -#define UHS_VID_GWO_JINN_INDUSTRIES 0x1831U // Gwo Jinn Industries Co., Ltd. -#define UHS_VID_HUIZHOU_SHENGHUA_INDUSTRIAL 0x1832U // Huizhou Shenghua Industrial Co., Ltd. -#define UHS_VID_VIVOPHONE 0x183dU // VIVOphone -#define UHS_VID_VAISALA 0x1843U // Vaisala -#define UHS_VID_ASROCK_INCORPORATION 0x1849U // ASRock Incorporation -#define UHS_VID_GYROCOM_CANDC 0x1852U // GYROCOM C&C Co., LTD -#define UHS_VID_MEMORY_DEVICES 0x1854U // Memory Devices Ltd. -#define UHS_VID_COMPRO 0x185bU // Compro -#define UHS_VID_TECH_TECHNOLOGY_INDUSTRIAL_COMPANY 0x1861U // Tech Technology Industrial Company -#define UHS_VID_TERIDIAN_SEMICONDUCTOR 0x1862U // Teridian Semiconductor Corp. -#define UHS_VID_NEXIO_1 0x1870U // Nexio Co., Ltd -#define UHS_VID_AVEO_TECHNOLOGY 0x1871U // Aveo Technology Corp. -#define UHS_VID_NAVILOCK 0x1873U // Navilock -#define UHS_VID_ALIENWARE_CORPORATION 0x187cU // Alienware Corporation -#define UHS_VID_SIANO_MOBILE_SILICON 0x187fU // Siano Mobile Silicon -#define UHS_VID_VAST_TECHNOLOGIES_1 0x1892U // Vast Technologies, Inc. -#define UHS_VID_TOPSEED 0x1894U // Topseed -#define UHS_VID_EVERTOP_WIRE_CABLE 0x1897U // Evertop Wire Cable Co. -#define UHS_VID_3SHAPE_AS 0x189fU // 3Shape A/S -#define UHS_VID_CSSN 0x18a4U // CSSN -#define UHS_VID_VERBATIM 0x18a5U // Verbatim, Ltd -#define UHS_VID_PETALYNX 0x18b1U // Petalynx -#define UHS_VID_E3C_TECHNOLOGIES 0x18b4U // e3C Technologies -#define UHS_VID_MIKKON_TECHNOLOGY_LIMITED 0x18b6U // Mikkon Technology Limited -#define UHS_VID_ZOTEK_ELECTRONIC 0x18b7U // Zotek Electronic Co., Ltd. -#define UHS_VID_AMIT_TECHNOLOGY 0x18c5U // AMIT Technology, Inc. -#define UHS_VID_ECAMM 0x18cdU // Ecamm -#define UHS_VID_GOOGLE 0x18d1U // Google Inc. -#define UHS_VID_STARLINE_INTERNATIONAL_GROUP_LIMITED 0x18d5U // Starline International Group Limited -#define UHS_VID_KABA 0x18d9U // Kaba -#define UHS_VID_LKC_TECHNOLOGIES 0x18dcU // LKC Technologies, Inc. -#define UHS_VID_PLANON_SYSTEM_SOLUTIONS 0x18ddU // Planon System Solutions Inc. -#define UHS_VID_FITIPOWER_INTEGRATED_TECHNOLOGY 0x18e3U // Fitipower Integrated Technology Inc -#define UHS_VID_QCOM 0x18e8U // Qcom -#define UHS_VID_MATROX_GRAPHICS 0x18eaU // Matrox Graphics, Inc. -#define UHS_VID_ARKMICRO_TECHNOLOGIES 0x18ecU // Arkmicro Technologies Inc. -#define UHS_VID_FINEARCH 0x18fdU // FineArch Inc. -#define UHS_VID_GEMBIRD_1 0x1908U // GEMBIRD -#define UHS_VID_MOTOROLA_GSG 0x190dU // Motorola GSG -#define UHS_VID_ALCO_DIGITAL_DEVICES_LIMITED 0x1914U // Alco Digital Devices Limited -#define UHS_VID_NORDIC_SEMICONDUCTOR_ASA 0x1915U // Nordic Semiconductor ASA -#define UHS_VID_FITLINXX 0x1923U // FitLinxx -#define UHS_VID_NEXTWINDOW 0x1926U // NextWindow -#define UHS_VID_AVAGO_TECHNOLOGIES_PTE 0x192fU // Avago Technologies, Pte. -#define UHS_VID_SHENZHEN_XIANHE_TECHNOLOGY 0x1930U // Shenzhen Xianhe Technology Co., Ltd. -#define UHS_VID_NINGBO_BROAD_TELECOMMUNICATION 0x1931U // Ningbo Broad Telecommunication Co., Ltd. -#define UHS_VID_FEATURE_INTEGRATION_TECHNOLOGY_INC_FINTEK 0x1934U // Feature Integration Technology Inc. (Fintek) -#define UHS_VID_DREAM_LINK 0x1941U // Dream Link -#define UHS_VID_SENSORAY 0x1943U // Sensoray Co., Inc. -#define UHS_VID_LAB126 0x1949U // Lab126, Inc. -#define UHS_VID_PRESONUS_AUDIO_ELECTRONICS 0x194fU // PreSonus Audio Electronics, Inc. -#define UHS_VID_HYPERSTONE_AG 0x1951U // Hyperstone AG -#define UHS_VID_IRONKEY 0x1953U // Ironkey Inc. -#define UHS_VID_RADIIENT_TECHNOLOGIES 0x1954U // Radiient Technologies -#define UHS_VID_ITRON_TECHNOLOGY_IONE 0x195dU // Itron Technology iONE -#define UHS_VID_UNIDEN_CORPORATION 0x1965U // Uniden Corporation -#define UHS_VID_CASIO_HITACHI_MOBILE_COMMUNICATIONS 0x1967U // CASIO HITACHI Mobile Communications Co., Ltd. -#define UHS_VID_WISPRO_TECHNOLOGY 0x196bU // Wispro Technology Inc. -#define UHS_VID_DANE_ELEC_CORP_USA 0x1970U // Dane-Elec Corp. USA -#define UHS_VID_DONGGUAN_GUNEETAL_WIRE_AND_CABLE 0x1975U // Dongguan Guneetal Wire & Cable Co., Ltd. -#define UHS_VID_CHIPSBRAND_MICROELECTRONICS_HK 0x1976U // Chipsbrand Microelectronics (HK) Co., Ltd. -#define UHS_VID_T_LOGIC 0x1977U // T-Logic -#define UHS_VID_LEUZE_ELECTRONIC 0x197dU // Leuze electronic -#define UHS_VID_NUCONN_TECHNOLOGY 0x1989U // Nuconn Technology Corp. -#define UHS_VID_BECEEM_COMMUNICATIONS 0x198fU // Beceem Communications Inc. -#define UHS_VID_ACRON_PRECISION_INDUSTRIAL 0x1990U // Acron Precision Industrial Co., Ltd. -#define UHS_VID_TRILLIUM_TECHNOLOGY_PTY 0x1995U // Trillium Technology Pty. Ltd. -#define UHS_VID_PIXELINK 0x1996U // PixeLINK -#define UHS_VID_MICROSTRAIN 0x199bU // MicroStrain, Inc. -#define UHS_VID_THE_IMAGING_SOURCE_EUROPE 0x199eU // The Imaging Source Europe GmbH -#define UHS_VID_BENICA_CORPORATION 0x199fU // Benica Corporation -#define UHS_VID_BIFORST_TECHNOLOGY 0x19a8U // Biforst Technology Inc. -#define UHS_VID_BODELIN 0x19abU // Bodelin -#define UHS_VID_S_LIFE 0x19afU // S Life -#define UHS_VID_BATRONIX 0x19b2U // Batronix -#define UHS_VID_CELESTRON 0x19b4U // Celestron -#define UHS_VID_B_AND_W_GROUP 0x19b5U // B & W Group -#define UHS_VID_INFOTECH_LOGISTIC 0x19b6U // Infotech Logistic, LLC -#define UHS_VID_DATA_ROBOTICS 0x19b9U // Data Robotics -#define UHS_VID_FUTUBA 0x19c2U // Futuba -#define UHS_VID_MINDTRIBE 0x19caU // Mindtribe -#define UHS_VID_PARROT 0x19cfU // Parrot SA -#define UHS_VID_ZTE_WCDMA_TECHNOLOGIES_MSM 0x19d2U // ZTE WCDMA Technologies MSM -#define UHS_VID_KFI_PRINTERS 0x19dbU // KFI Printers -#define UHS_VID_WEIDUAN_ELECTRONIC_ACCESSORY_SZ 0x19e1U // WeiDuan Electronic Accessory (S.Z.) Co., Ltd. -#define UHS_VID_INDUSTRIAL_TECHNOLOGY_RESEARCH_INSTITUTE 0x19e8U // Industrial Technology Research Institute -#define UHS_VID_PAK_HENG_TECHNOLOGY_SHENZHEN 0x19efU // Pak Heng Technology (Shenzhen) Co., Ltd. -#define UHS_VID_RODE_MICROPHONES 0x19f7U // RODE Microphones -#define UHS_VID_GAMPAQ_COLTD 0x19faU // Gampaq Co.Ltd -#define UHS_VID_DYNEX 0x19ffU // Dynex -#define UHS_VID_BELLWOOD_INTERNATIONAL 0x1a08U // Bellwood International, Inc. -#define UHS_VID_USB_IF_NON_WORKSHOP 0x1a0aU // USB-IF non-workshop -#define UHS_VID_KES 0x1a12U // KES Co., Ltd. -#define UHS_VID_VEHO 0x1a1dU // Veho -#define UHS_VID_AMPHENOL_EAST_ASIA 0x1a25U // Amphenol East Asia Ltd. -#define UHS_VID_SEAGATE_BRANDED_SOLUTIONS 0x1a2aU // Seagate Branded Solutions -#define UHS_VID_CHINA_RESOURCE_SEMICO 0x1a2cU // China Resource Semico Co., Ltd -#define UHS_VID_QUANTA_MICROSYSTEMS 0x1a32U // Quanta Microsystems, Inc. -#define UHS_VID_ACRUX 0x1a34U // ACRUX -#define UHS_VID_BIWIN_TECHNOLOGY 0x1a36U // Biwin Technology Ltd. -#define UHS_VID_TERMINUS_TECHNOLOGY 0x1a40U // Terminus Technology Inc. -#define UHS_VID_ACTION_ELECTRONICS 0x1a41U // Action Electronics Co., Ltd. -#define UHS_VID_VASCO_DATA_SECURITY_INTERNATIONAL 0x1a44U // VASCO Data Security International -#define UHS_VID_SILICON_IMAGE 0x1a4aU // Silicon Image -#define UHS_VID_SAFEBOOT_INTERNATIONAL_BV 0x1a4bU // SafeBoot International B.V. -#define UHS_VID_TANDBERG_DATA 0x1a5aU // Tandberg Data -#define UHS_VID_ABBOTT_DIABETES_CARE 0x1a61U // Abbott Diabetes Care -#define UHS_VID_SPANSION 0x1a6aU // Spansion Inc. -#define UHS_VID_SAMYOUNG_ELECTRONICS 0x1a6dU // SamYoung Electronics Co., Ltd -#define UHS_VID_GLOBAL_UNICHIP 0x1a6eU // Global Unichip Corp. -#define UHS_VID_SAGEM_ORGA 0x1a6fU // Sagem Orga GmbH -#define UHS_VID_PHYSIK_INSTRUMENTE 0x1a72U // Physik Instrumente -#define UHS_VID_BAYER_HEALTH_CARE 0x1a79U // Bayer Health Care LLC -#define UHS_VID_LUMBERG_CONNECT_GMBH_AND_CO_KG 0x1a7bU // Lumberg Connect GmbH & Co. KG -#define UHS_VID_EVOLUENT 0x1a7cU // Evoluent -#define UHS_VID_HOLTEK_SEMICONDUCTOR_1 0x1a81U // Holtek Semiconductor, Inc. -#define UHS_VID_QINHENG_ELECTRONICS 0x1a86U // QinHeng Electronics -#define UHS_VID_DYNALITH_SYSTEMS 0x1a89U // Dynalith Systems Co., Ltd. -#define UHS_VID_SGS_TAIWAN 0x1a8bU // SGS Taiwan Ltd. -#define UHS_VID_BANDRICH 0x1a8dU // BandRich, Inc. -#define UHS_VID_LEICA_CAMERA_AG 0x1a98U // Leica Camera AG -#define UHS_VID_DATA_DRIVE_THRU 0x1aa4U // Data Drive Thru, Inc. -#define UHS_VID_UBEACON_TECHNOLOGIES 0x1aa5U // UBeacon Technologies, Inc. -#define UHS_VID_EFORTUNE_TECHNOLOGY 0x1aa6U // eFortune Technology Corp. -#define UHS_VID_KEETOUCH 0x1aadU // KeeTouch -#define UHS_VID_RIGOL_TECHNOLOGIES 0x1ab1U // Rigol Technologies -#define UHS_VID_SALCOMP_PLC 0x1acbU // Salcomp Plc -#define UHS_VID_MIDIPLUS 0x1accU // Midiplus Co, Ltd. -#define UHS_VID_DESAY_WIRE 0x1ad1U // Desay Wire Co., Ltd. -#define UHS_VID_APS 0x1ad4U // APS -#define UHS_VID_SEL_C662_SERIAL_CABLE 0x1adbU // SEL C662 Serial Cable -#define UHS_VID_IC_DESIGN_REINHARD_GOTTINGER 0x1ae4U // ic-design Reinhard Gottinger GmbH -#define UHS_VID_X_TENSIONS 0x1ae7U // X-TENSIONS -#define UHS_VID_HIGH_TOP_PRECISION_ELECTRONIC 0x1aedU // High Top Precision Electronic Co., Ltd. -#define UHS_VID_CONNTECH_ELECTRONIC_SUZHOU_CORPORATION 0x1aefU // Conntech Electronic (Suzhou) Corporation -#define UHS_VID_CONNECT_ONE 0x1af1U // Connect One Ltd. -#define UHS_VID_A_EBERLE_GMBH_AND_CO_KG 0x1afeU // A. Eberle GmbH & Co. KG -#define UHS_VID_MEILHAUS_ELECTRONIC 0x1b04U // Meilhaus Electronic GmbH -#define UHS_VID_BLUTRONICS_SRL 0x1b0eU // BLUTRONICS S.r.l. -#define UHS_VID_CORSAIR 0x1b1cU // Corsair -#define UHS_VID_MSTAR_SEMICONDUCTOR 0x1b20U // MStar Semiconductor, Inc. -#define UHS_VID_WILINX 0x1b22U // WiLinx Corp. -#define UHS_VID_CELLEX_POWER_PRODUCTS 0x1b26U // Cellex Power Products, Inc. -#define UHS_VID_CURRENT_ELECTRONICS 0x1b27U // Current Electronics Inc. -#define UHS_VID_NAVISIS 0x1b28U // NAVIsis Inc. -#define UHS_VID_UGOBE_LIFE_FORMS 0x1b32U // Ugobe Life Forms, Inc. -#define UHS_VID_VIXS_SYSTEMS 0x1b36U // ViXS Systems, Inc. -#define UHS_VID_IPASSION_TECHNOLOGY 0x1b3bU // iPassion Technology Inc. -#define UHS_VID_GENERALPLUS_TECHNOLOGY 0x1b3fU // Generalplus Technology Inc. -#define UHS_VID_ENERGIZER_HOLDINGS 0x1b47U // Energizer Holdings, Inc. -#define UHS_VID_PLASTRON_PRECISION 0x1b48U // Plastron Precision Co., Ltd. -#define UHS_VID_ARH 0x1b52U // ARH Inc. -#define UHS_VID_KS_TERMINALS 0x1b59U // K.S. Terminals Inc. -#define UHS_VID_CHAO_ZHOU_KAI_YUAN_ELECTRIC 0x1b5aU // Chao Zhou Kai Yuan Electric Co., Ltd. -#define UHS_VID_THE_HONG_KONG_STANDARDS_AND_TESTING_CENTRE 0x1b65U // The Hong Kong Standards and Testing Centre Ltd. -#define UHS_VID_FUSHICAI 0x1b71U // Fushicai -#define UHS_VID_ATERGI_TECHNOLOGY 0x1b72U // ATERGI TECHNOLOGY CO., LTD. -#define UHS_VID_FRESCO_LOGIC 0x1b73U // Fresco Logic -#define UHS_VID_OVISLINK 0x1b75U // Ovislink Corp. -#define UHS_VID_LEGEND_SILICON 0x1b76U // Legend Silicon Corp. -#define UHS_VID_AFATECH 0x1b80U // Afatech -#define UHS_VID_DONGGUAN_GUANSHANG_ELECTRONICS 0x1b86U // Dongguan Guanshang Electronics Co., Ltd. -#define UHS_VID_SHENMING_ELECTRON_DONG_GUAN 0x1b88U // ShenMing Electron (Dong Guan) Co., Ltd. -#define UHS_VID_ALTIUM_LIMITED 0x1b8cU // Altium Limited -#define UHS_VID_E_MOVE_TECHNOLOGY 0x1b8dU // e-MOVE Technology Co., Ltd. -#define UHS_VID_AMLOGIC 0x1b8eU // Amlogic, Inc. -#define UHS_VID_MA_LABS 0x1b8fU // MA LABS, Inc. -#define UHS_VID_N_TRIG 0x1b96U // N-Trig -#define UHS_VID_YMAX_COMMUNICATIONS 0x1b98U // YMax Communications Corp. -#define UHS_VID_SHENZHEN_YUANCHUAN_ELECTRONIC 0x1b99U // Shenzhen Yuanchuan Electronic -#define UHS_VID_JINQ_CHERN_ENTERPRISE 0x1ba1U // JINQ CHERN ENTERPRISE CO., LTD. -#define UHS_VID_LITE_METALS_AND_PLASTIC_SHENZHEN 0x1ba2U // Lite Metals & Plastic (Shenzhen) Co., Ltd. -#define UHS_VID_EMBER_CORPORATION 0x1ba4U // Ember Corporation -#define UHS_VID_ABILIS_SYSTEMS 0x1ba6U // Abilis Systems -#define UHS_VID_CHINA_TELECOMMUNICATION_TECHNOLOGY_LABS 0x1ba8U // China Telecommunication Technology Labs -#define UHS_VID_HARMONIX_MUSIC 0x1badU // Harmonix Music -#define UHS_VID_VUZIX_CORPORATION 0x1baeU // Vuzix Corporation -#define UHS_VID_T_AND_A_MOBILE_PHONES 0x1bbbU // T & A Mobile Phones -#define UHS_VID_FORD_MOTOR 0x1bc4U // Ford Motor Co. -#define UHS_VID_AVIXE_TECHNOLOGY_CHINA 0x1bc5U // AVIXE Technology (China) Ltd. -#define UHS_VID_TELIT_WIRELESS_SOLUTIONS 0x1bc7U // Telit Wireless Solutions -#define UHS_VID_CONTAC_CABLE_INDUSTRIAL_LIMITED 0x1bceU // Contac Cable Industrial Limited -#define UHS_VID_SUNPLUS_INNOVATION_TECHNOLOGY 0x1bcfU // Sunplus Innovation Technology Inc. -#define UHS_VID_HANGZHOU_RIYUE_ELECTRONIC 0x1bd0U // Hangzhou Riyue Electronic Co., Ltd. -#define UHS_VID_BG_SYSTEMS 0x1bd5U // BG Systems, Inc. -#define UHS_VID_P_TWO_INDUSTRIES 0x1bdeU // P-TWO INDUSTRIES, INC. -#define UHS_VID_SHENZHEN_TONGYUAN_NETWORK_COMMUNICATION_CABLES 0x1befU // Shenzhen Tongyuan Network-Communication Cables Co., Ltd -#define UHS_VID_REALVISION 0x1bf0U // RealVision Inc. -#define UHS_VID_EXTRANET_SYSTEMS 0x1bf5U // Extranet Systems Inc. -#define UHS_VID_ORIENT_SEMICONDUCTOR_ELECTRONICS 0x1bf6U // Orient Semiconductor Electronics, Ltd. -#define UHS_VID_TOUCHPACK 0x1bfdU // TouchPack -#define UHS_VID_KRETON_CORPORATION 0x1c02U // Kreton Corporation -#define UHS_VID_QNAP_SYSTEM 0x1c04U // QNAP System Inc. -#define UHS_VID_IONICS_EMS 0x1c0cU // Ionics EMS, Inc. -#define UHS_VID_RELM_WIRELESS 0x1c0dU // Relm Wireless -#define UHS_VID_LANTERRA_INDUSTRIAL 0x1c10U // Lanterra Industrial Co., Ltd. -#define UHS_VID_ALECTRONIC_LIMITED 0x1c13U // ALECTRONIC LIMITED -#define UHS_VID_DATEL_ELECTRONICS 0x1c1aU // Datel Electronics Ltd. -#define UHS_VID_VOLKSWAGEN_OF_AMERICA 0x1c1bU // Volkswagen of America, Inc. -#define UHS_VID_GOLDVISH 0x1c1fU // Goldvish S.A. -#define UHS_VID_FUJI_ELECTRIC_DEVICE_TECHNOLOGY 0x1c20U // Fuji Electric Device Technology Co., Ltd. -#define UHS_VID_ADDMM 0x1c21U // ADDMM LLC -#define UHS_VID_ZHONGSHAN_CHIANG_YU_ELECTRIC 0x1c22U // ZHONGSHAN CHIANG YU ELECTRIC CO., LTD. -#define UHS_VID_SHANGHAI_HAIYING_ELECTRONICS 0x1c26U // Shanghai Haiying Electronics Co., Ltd. -#define UHS_VID_HUIYANG_D_AND_S_CABLE 0x1c27U // HuiYang D & S Cable Co., Ltd. -#define UHS_VID_ELSTER 0x1c29U // Elster GmbH -#define UHS_VID_LS_CABLE 0x1c31U // LS Cable Ltd. -#define UHS_VID_SPRINGCARD 0x1c34U // SpringCard -#define UHS_VID_AUTHORIZER_TECHNOLOGIES 0x1c37U // Authorizer Technologies, Inc. -#define UHS_VID_NONIN_MEDICAL 0x1c3dU // NONIN MEDICAL INC. -#define UHS_VID_WEP_PERIPHERALS 0x1c3eU // Wep Peripherals -#define UHS_VID_EZPROTOTYPES 0x1c40U // EZPrototypes -#define UHS_VID_CHERNG_WEEI_TECHNOLOGY 0x1c49U // Cherng Weei Technology Corp. -#define UHS_VID_SIGMA_MICRO 0x1c4fU // SiGma Micro -#define UHS_VID_PHILIPS_AND_LITE_ON_DIGITAL_SOLUTIONS_CORPORATION 0x1c6bU // Philips & Lite-ON Digital Solutions Corporation -#define UHS_VID_SKYDIGITAL 0x1c6cU // Skydigital Inc. -#define UHS_VID_AMT 0x1c73U // AMT -#define UHS_VID_KAETAT_INDUSTRIAL 0x1c77U // Kaetat Industrial Co., Ltd. -#define UHS_VID_DATASCOPE 0x1c78U // Datascope Corp. -#define UHS_VID_UNIGEN_CORPORATION 0x1c79U // Unigen Corporation -#define UHS_VID_LIGHTUNING_TECHNOLOGY 0x1c7aU // LighTuning Technology Inc. -#define UHS_VID_LUXSHARE_PRECISION_INDUSTRY_SHENZHEN 0x1c7bU // LUXSHARE PRECISION INDUSTRY (SHENZHEN) CO., LTD. -#define UHS_VID_SCHOMAECKER 0x1c83U // Schomaecker GmbH -#define UHS_VID_2N_TELEKOMUNIKACE_AS 0x1c87U // 2N TELEKOMUNIKACE a.s. -#define UHS_VID_SOMAGIC 0x1c88U // Somagic, Inc. -#define UHS_VID_HONGKONG_WEIDIDA_ELECTRON_LIMITED 0x1c89U // HONGKONG WEIDIDA ELECTRON LIMITED -#define UHS_VID_ASTRON_INTERNATIONAL 0x1c8eU // ASTRON INTERNATIONAL CORP. -#define UHS_VID_ALPINE_ELECTRONICS 0x1c98U // ALPINE ELECTRONICS, INC. -#define UHS_VID_OMEGA_TECHNOLOGY 0x1c9eU // OMEGA TECHNOLOGY -#define UHS_VID_ACCARIO 0x1ca0U // ACCARIO Inc. -#define UHS_VID_SYMWAVE 0x1ca1U // Symwave -#define UHS_VID_KINSTONE 0x1cacU // Kinstone -#define UHS_VID_ACES_ELECTRONIC 0x1cb3U // Aces Electronic Co., Ltd. -#define UHS_VID_OPEX_CORPORATION 0x1cb4U // OPEX CORPORATION -#define UHS_VID_IDEACOM_TECHNOLOGY 0x1cb6U // IdeaCom Technology Inc. -#define UHS_VID_LUMINARY_MICRO 0x1cbeU // Luminary Micro Inc. -#define UHS_VID_FORTAT_SKYMARK_INDUSTRIAL_COMPANY 0x1cbfU // FORTAT SKYMARK INDUSTRIAL COMPANY -#define UHS_VID_PLANTSENSE 0x1cc0U // PlantSense -#define UHS_VID_NEXTWAVE_BROADBAND 0x1ccaU // NextWave Broadband Inc. -#define UHS_VID_BODATONG_TECHNOLOGY_SHENZHEN 0x1ccdU // Bodatong Technology (Shenzhen) Co., Ltd. -#define UHS_VID_ADP_CORPORATION 0x1cd4U // adp corporation -#define UHS_VID_FIRECOMMS 0x1cd5U // Firecomms Ltd. -#define UHS_VID_ANTONIO_PRECISE_PRODUCTS_MANUFACTORY 0x1cd6U // Antonio Precise Products Manufactory Ltd. -#define UHS_VID_TELECOMMUNICATIONS_TECHNOLOGY_ASSOCIATION_TTA 0x1cdeU // Telecommunications Technology Association (TTA) -#define UHS_VID_WONTEN_TECHNOLOGY 0x1cdfU // WonTen Technology Co., Ltd. -#define UHS_VID_EDIMAX_TECHNOLOGY 0x1ce0U // EDIMAX TECHNOLOGY CO., LTD. -#define UHS_VID_AMPHENOL_KAE 0x1ce1U // Amphenol KAE -#define UHS_VID_DRESDEN_ELEKTRONIK 0x1cf1U // Dresden Elektronik -#define UHS_VID_ANDES_TECHNOLOGY_CORPORATION 0x1cfcU // ANDES TECHNOLOGY CORPORATION -#define UHS_VID_FLEXTRONICS_DIGITAL_DESIGN_JAPAN 0x1cfdU // Flextronics Digital Design Japan, LTD. -#define UHS_VID_ICON 0x1d03U // iCON -#define UHS_VID_SOLID_MOTION 0x1d07U // Solid-Motion -#define UHS_VID_NINGBO_HENTEK_DRAGON_ELECTRONICS 0x1d08U // NINGBO HENTEK DRAGON ELECTRONICS CO., LTD. -#define UHS_VID_TECHFAITH_WIRELESS_TECHNOLOGY_LIMITED 0x1d09U // TechFaith Wireless Technology Limited -#define UHS_VID_JOHNSON_CONTROLS_INC_THE_AUTOMOTIVE_BUSINESS_UNIT 0x1d0aU // Johnson Controls, Inc. The Automotive Business Unit -#define UHS_VID_HAN_HUA_CABLE_AND_WIRE_TECHNOLOGY_JX 0x1d0bU // HAN HUA CABLE & WIRE TECHNOLOGY (J.X.) CO., LTD. -#define UHS_VID_SONIX_TECHNOLOGY 0x1d0fU // Sonix Technology Co., Ltd. -#define UHS_VID_ALPHA_SAT_TECHNOLOGY_LIMITED 0x1d14U // ALPHA-SAT TECHNOLOGY LIMITED -#define UHS_VID_C_THRU_MUSIC 0x1d17U // C-Thru Music Ltd. -#define UHS_VID_DEXATEK_TECHNOLOGY 0x1d19U // Dexatek Technology Ltd. -#define UHS_VID_DIOSTECH 0x1d1fU // Diostech Co., Ltd. -#define UHS_VID_SAMTACK 0x1d20U // SAMTACK INC. -#define UHS_VID_ASUS 0x1d27U // ASUS -#define UHS_VID_DREAM_CHEEKY 0x1d34U // Dream Cheeky -#define UHS_VID_TOUCH 0x1d45U // Touch -#define UHS_VID_PEGATRON_CORPORATION 0x1d4dU // PEGATRON CORPORATION -#define UHS_VID_OPENMOKO 0x1d50U // OpenMoko, Inc. -#define UHS_VID_XENTA 0x1d57U // Xenta -#define UHS_VID_SMARTRONIX 0x1d5bU // Smartronix, Inc. -#define UHS_VID_LINUX_FOUNDATION 0x1d6bU // Linux Foundation -#define UHS_VID_CITIZEN 0x1d90U // Citizen -#define UHS_VID_ACTIONS_MICROELECTRONICS 0x1de1U // Actions Microelectronics Co. -#define UHS_VID_QUALCOMM_OPTION 0x1e0eU // Qualcomm / Option -#define UHS_VID_POINT_GREY_RESEARCH 0x1e10U // Point Grey Research, Inc. -#define UHS_VID_MIRION_TECHNOLOGIES_DOSIMETRY_SERVICES_DIVISION 0x1e17U // Mirion Technologies Dosimetry Services Division -#define UHS_VID_LUMENSION_SECURITY 0x1e1dU // Lumension Security -#define UHS_VID_INVIA 0x1e1fU // INVIA -#define UHS_VID_FESTO_AG_AND_CO_KG 0x1e29U // Festo AG & Co. KG -#define UHS_VID_CHIPSBANK_MICROELECTRONICS_1 0x1e3dU // Chipsbank Microelectronics Co., Ltd -#define UHS_VID_CLEVERSCOPE 0x1e41U // Cleverscope -#define UHS_VID_CUBETERNET 0x1e4eU // Cubeternet -#define UHS_VID_TYPEMATRIX 0x1e54U // TypeMatrix -#define UHS_VID_TREKSTOR_GMBH_AND_CO_KG 0x1e68U // TrekStor GmbH & Co. KG -#define UHS_VID_NZXT 0x1e71U // NZXT -#define UHS_VID_COBY_ELECTRONICS_CORPORATION 0x1e74U // Coby Electronics Corporation -#define UHS_VID_ROCCAT 0x1e7dU // ROCCAT -#define UHS_VID_NUCORE_TECHNOLOGY 0x1ebbU // NuCORE Technology, Inc. -#define UHS_VID_AIRTIES_WIRELESS_NETWORKS 0x1edaU // AirTies Wireless Networks -#define UHS_VID_BLACKMAGIC_DESIGN 0x1edbU // Blackmagic design -#define UHS_VID_ONDA_COMMUNICATION_SPA 0x1ee8U // ONDA COMMUNICATION S.p.a. -#define UHS_VID_EADS_DEUTSCHLAND 0x1ef6U // EADS Deutschland GmbH -#define UHS_VID_CAL_COMP 0x1f28U // Cal-Comp -#define UHS_VID_ONDA_UNVERIFIED 0x1f3aU // Onda (unverified) -#define UHS_VID_THE_NEAT_COMPANY 0x1f44U // The Neat Company -#define UHS_VID_H_TRONIC 0x1f48U // H-TRONIC GmbH -#define UHS_VID_G_TEK_ELECTRONICS_GROUP 0x1f4dU // G-Tek Electronics Group -#define UHS_VID_ALIPH 0x1f6fU // Aliph -#define UHS_VID_INNOSTOR_TECHNOLOGY_CORPORATION 0x1f75U // Innostor Technology Corporation -#define UHS_VID_TANDBERG 0x1f82U // TANDBERG -#define UHS_VID_ALERE 0x1f84U // Alere, Inc. -#define UHS_VID_STANTUM 0x1f87U // Stantum -#define UHS_VID_UBIQUITI_NETWORKS 0x1f9bU // Ubiquiti Networks, Inc. -#define UHS_VID_SAMSUNG_OPTO_ELECTRONCS 0x1fabU // Samsung Opto-Electroncs Co., Ltd. -#define UHS_VID_DELPHIN_TECHNOLOGY_AG 0x1fbdU // Delphin Technology AG -#define UHS_VID_NXP_SEMICONDUCTORS 0x1fc9U // NXP Semiconductors -#define UHS_VID_ILX_LIGHTWAVE_CORPORATION 0x1fdeU // ILX Lightwave Corporation -#define UHS_VID_VERTEX_WIRELESS 0x1fe7U // Vertex Wireless Co., Ltd. -#define UHS_VID_CVT_ELECTRONICSCOLTD 0x1ff7U // CVT Electronics.Co.,Ltd -#define UHS_VID_IDEOFY 0x1fffU // Ideofy Inc. -#define UHS_VID_D_LINK 0x2001U // D-Link Corp. -#define UHS_VID_DAP_TECHNOLOGIES 0x2002U // DAP Technologies -#define UHS_VID_DETECTOMAT 0x2003U // detectomat -#define UHS_VID_RELOOP 0x200cU // Reloop -#define UHS_VID_PCTV_SYSTEMS 0x2013U // PCTV Systems -#define UHS_VID_PLANEX_1 0x2019U // PLANEX -#define UHS_VID_ENCORE_ELECTRONICS 0x203dU // Encore Electronics Inc. -#define UHS_VID_HAUPPAUGE 0x2040U // Hauppauge -#define UHS_VID_TEXAS_INSTRUMENTS_2 0x2047U // Texas Instruments -#define UHS_VID_NANO_RIVER_TECHNOLOGY 0x2058U // Nano River Technology -#define UHS_VID_TAICANG_TANDW_ELECTRONICS 0x2077U // Taicang T&W Electronics Co. Ltd -#define UHS_VID_BARNES_AND_NOBLE 0x2080U // Barnes & Noble -#define UHS_VID_SIMPASS 0x2086U // SIMPASS -#define UHS_VID_CANDO 0x2087U // Cando -#define UHS_VID_CLAY_LOGIC 0x20a0U // Clay Logic -#define UHS_VID_XMOS 0x20b1U // XMOS Ltd -#define UHS_VID_HANVON 0x20b3U // Hanvon -#define UHS_VID_QI_HARDWARE 0x20b7U // Qi Hardware -#define UHS_VID_MINICIRCUITS 0x20ceU // Minicircuits -#define UHS_VID_SIMTEC_ELECTRONICS 0x20dfU // Simtec Electronics -#define UHS_VID_NET_NEW_ELECTRONIC_TECHNOLOGY 0x20f1U // NET New Electronic Technology GmbH -#define UHS_VID_TRENDNET_1 0x20f4U // TRENDnet -#define UHS_VID_XIMEA 0x20f7U // XIMEA -#define UHS_VID_RT_SYSTEMS 0x2100U // RT Systems -#define UHS_VID_ACTIONSTAR 0x2101U // ActionStar -#define UHS_VID_VIA_LABS 0x2109U // VIA Labs, Inc. -#define UHS_VID_SOFTKINETIC 0x2113U // Softkinetic -#define UHS_VID_ADVANCED_SILICON 0x2149U // Advanced Silicon S.A. -#define UHS_VID_CREATIVE_UNKNOWN 0x2162U // Creative (?) -#define UHS_VID_GW_INSTEK 0x2184U // GW Instek -#define UHS_VID_EMOTIV_SYSTEMS_PTY 0x21a1U // Emotiv Systems Pty. Ltd. -#define UHS_VID_AGECODAGIS_SARL 0x21d6U // Agecodagis SARL -#define UHS_VID_MACALLY_1 0x2222U // MacAlly -#define UHS_VID_SAMWOO_ENTERPRISE 0x2227U // SAMWOO Enterprise -#define UHS_VID_SILICON_MOTION_1 0x2232U // Silicon Motion -#define UHS_VID_RADIOSHACK_CORPORATION 0x2233U // RadioShack Corporation -#define UHS_VID_KOBO 0x2237U // Kobo Inc. -#define UHS_VID_MORPHO 0x225dU // Morpho -#define UHS_VID_8D_TECHNOLOGIES 0x228dU // 8D Technologies inc. -#define UHS_VID_PIE_DIGITAL 0x22a6U // Pie Digital, Inc. -#define UHS_VID_MOTOROLA_PCS 0x22b8U // Motorola PCS -#define UHS_VID_ETURBOTOUCH_TECHNOLOGY 0x22b9U // eTurboTouch Technology, Inc. -#define UHS_VID_TECHNOLOGY_INNOVATION_HOLDINGS 0x22baU // Technology Innovation Holdings, Ltd -#define UHS_VID_PINNACLE_SYSTEMS_1 0x2304U // Pinnacle Systems, Inc. -#define UHS_VID_SHINING_TECHNOLOGIES_INC_HEX_ 0x2318U // Shining Technologies, Inc. [hex] -#define UHS_VID_ARDUINO 0x2341U // Arduino SA -#define UHS_VID_PUMATRONIX_LTDA 0x2373U // Pumatronix Ltda -#define UHS_VID_DIGITALWAY_1 0x2375U // Digit@lway, Inc. -#define UHS_VID_SANHO_DIGITAL_ELECTRONICS 0x2406U // SANHO Digital Electronics Co., Ltd. -#define UHS_VID_AESSENT_TECHNOLOGY 0x2443U // Aessent Technology Ltd -#define UHS_VID_TRIPP_LITE_1 0x2478U // Tripp-Lite -#define UHS_VID_MAXXTER 0x248aU // Maxxter -#define UHS_VID_M2TECH_SRL 0x249cU // M2Tech s.r.l. -#define UHS_VID_PARATRONIC 0x24e1U // Paratronic -#define UHS_VID_TWINMOS_1 0x2632U // TwinMOS -#define UHS_VID_XSENS 0x2639U // Xsens -#define UHS_VID_ELECTRONICS_FOR_IMAGING_INC_HEX_ 0x2650U // Electronics For Imaging, Inc. [hex] -#define UHS_VID_SUNDTEK 0x2659U // Sundtek -#define UHS_VID_BASLER_AG 0x2676U // Basler AG -#define UHS_VID_CITIZEN_1 0x2730U // Citizen -#define UHS_VID_DIGITALWAY_2 0x2735U // DigitalWay -#define UHS_VID_NHJ 0x2770U // NHJ, Ltd -#define UHS_VID_THINGM 0x27b8U // ThingM -#define UHS_VID_ASUSTEK_COMPUTER_1 0x2821U // ASUSTek Computer Inc. -#define UHS_VID_TOPTRONIC_INDUSTRIAL 0x2899U // Toptronic Industrial Co., Ltd -#define UHS_VID_DRACALRAPHNET_TECHNOLOGIES 0x289bU // Dracal/Raphnet technologies -#define UHS_VID_JOLLA_OY 0x2931U // Jolla Oy -#define UHS_VID_DOG_HUNTER_AG 0x2a03U // dog hunter AG -#define UHS_VID_RTD_EMBEDDED_TECHNOLOGIES 0x2a37U // RTD Embedded Technologies, Inc. -#define UHS_VID_MEIZU 0x2a45U // Meizu Corp. -#define UHS_VID_PLANEX_COMMUNICATIONS_2 0x2c02U // Planex Communications -#define UHS_VID_DOLPHIN_PERIPHERALS 0x2c1aU // Dolphin Peripherals -#define UHS_VID_FUJITSU_1 0x2fb2U // Fujitsu, Ltd -#define UHS_VID_EAGLETRON_1 0x3125U // Eagletron -#define UHS_VID_NAVINI_NETWORKS 0x3136U // Navini Networks -#define UHS_VID_WHANAM_ELECTRONICS 0x3176U // Whanam Electronics Co., Ltd -#define UHS_VID_LINK_INSTRUMENTS 0x3195U // Link Instruments -#define UHS_VID_VIDZMEDIA_PTE 0x3275U // VidzMedia Pte Ltd -#define UHS_VID_INLINE 0x3333U // InLine -#define UHS_VID_AEI 0x3334U // AEI -#define UHS_VID_YAKUMO 0x3340U // Yakumo -#define UHS_VID_LEAGUER_MICROELECTRONICS_LME 0x3344U // Leaguer Microelectronics (LME) -#define UHS_VID_MICRO_STAR 0x3504U // Micro Star -#define UHS_VID_POWER_QUOTIENT_INTERNATIONAL_1 0x3538U // Power Quotient International Co., Ltd -#define UHS_VID_DIVA 0x3579U // DIVA -#define UHS_VID_SHARKOON 0x357dU // Sharkoon -#define UHS_VID_INVIBRO 0x3636U // InVibro -#define UHS_VID_WEM 0x3838U // WEM -#define UHS_VID_NATIONAL_INSTRUMENTS 0x3923U // National Instruments Corp. -#define UHS_VID_I_O_DATA 0x40bbU // I-O Data -#define UHS_VID_I_ROCKS 0x4101U // i-rocks -#define UHS_VID_IRIVER_1 0x4102U // iRiver, Ltd. -#define UHS_VID_DELL_COMPUTER_1 0x413cU // Dell Computer Corp. -#define UHS_VID_USBEST_TECHNOLOGY 0x4146U // USBest Technology -#define UHS_VID_TARGUS 0x4168U // Targus -#define UHS_VID_USB_DESIGN_BY_EXAMPLE 0x4242U // USB Design by Example -#define UHS_VID_GOPRO 0x4255U // GoPro -#define UHS_VID_BROADCOM_1 0x4317U // Broadcom Corp. -#define UHS_VID_WINCHIPHEAD 0x4348U // WinChipHead -#define UHS_VID_SHUTTLE_2 0x4572U // Shuttle, Inc. -#define UHS_VID_PANRAM 0x4586U // Panram -#define UHS_VID_EMS_PRODUCTION 0x4670U // EMS Production -#define UHS_VID_MIDITECH 0x4752U // Miditech -#define UHS_VID_GW_INSTEK_1 0x4757U // GW Instek -#define UHS_VID_ACEECA 0x4766U // Aceeca -#define UHS_VID_MEMOREX 0x4855U // Memorex -#define UHS_VID_SIMPLETECH 0x4971U // SimpleTech -#define UHS_VID_MUSICAL_FIDELITY 0x4d46U // Musical Fidelity -#define UHS_VID_GRANDTEC 0x5032U // Grandtec -#define UHS_VID_LINKSYS_UNKNOWN 0x5041U // Linksys (?) -#define UHS_VID_AVERATEC_UNKNOWN 0x50c2U // Averatec (?) -#define UHS_VID_SWEEX_1 0x5173U // Sweex -#define UHS_VID_I_TETRA 0x5219U // I-Tetra -#define UHS_VID_OWON 0x5345U // Owon -#define UHS_VID_SATOSHILABS 0x534cU // SatoshiLabs -#define UHS_VID_MEYER_INSTRUMENTS_MIS_1 0x5354U // Meyer Instruments (MIS) -#define UHS_VID_TRANSMETA 0x544dU // Transmeta Corp. -#define UHS_VID_UC_LOGIC_TECHNOLOGY 0x5543U // UC-Logic Technology Corp. -#define UHS_VID_EPIPHAN_SYSTEMS 0x5555U // Epiphan Systems Inc. -#define UHS_VID_ONSPEC_ELECTRONIC 0x55aaU // OnSpec Electronic, Inc. -#define UHS_VID_GOTVIEW 0x5654U // Gotview -#define UHS_VID_UNI_TREND_GROUP_LIMITED 0x5656U // Uni-Trend Group Limited -#define UHS_VID_IRTOUCHSYSTEMS 0x595aU // IRTOUCHSYSTEMS Co. Ltd. -#define UHS_VID_ACER_2 0x5986U // Acer, Inc -#define UHS_VID_NONOLITH_LABS 0x59e3U // Nonolith Labs -#define UHS_VID_ZINWELL 0x5a57U // Zinwell -#define UHS_VID_BEHOLDER_INTERNATIONAL 0x6000U // Beholder International Ltd. -#define UHS_VID_INGENIC_SEMICONDUCTOR 0x601aU // Ingenic Semiconductor Ltd. -#define UHS_VID_SITECOM 0x6189U // Sitecom -#define UHS_VID_LIGHTINGSOFT_AG 0x6244U // LightingSoft AG -#define UHS_VID_TWINHAN_TECHNOLOGY 0x6253U // TwinHan Technology Co., Ltd -#define UHS_VID_CORELOGIC 0x636cU // CoreLogic, Inc. -#define UHS_VID_UNKNOWN_SONY_UNKNOWN 0x6472U // Unknown (Sony?) -#define UHS_VID_ARKMICRO_TECHNOLOGIES_1 0x6547U // Arkmicro Technologies Inc. -#define UHS_VID_IRTOUCHSYSTEMS_1 0x6615U // IRTOUCHSYSTEMS Co. Ltd. -#define UHS_VID_PROTOTYPE_PRODUCT_VENDOR_ID 0x6666U // Prototype product Vendor ID -#define UHS_VID_WISEGROUP 0x6677U // WiseGroup, Ltd. -#define UHS_VID_3COM_1 0x6891U // 3Com -#define UHS_VID_OPERA1 0x695cU // Opera1 -#define UHS_VID_YEALINK_NETWORK_TECHNOLOGY 0x6993U // Yealink Network Technology Co., Ltd. -#define UHS_VID_SHANGHAI_JUJO_ELECTRONICS 0x6a75U // Shanghai Jujo Electronics Co., Ltd -#define UHS_VID_CME_CENTRAL_MUSIC 0x7104U // CME (Central Music Co.) -#define UHS_VID_STACKFOUNDRY 0x726cU // StackFoundry LLC -#define UHS_VID_TBS_TECHNOLOGIES_CHINA 0x734cU // TBS Technologies China -#define UHS_VID_BEIJING_STONE_TECHNOLOGY 0x7373U // Beijing STONE Technology Co. Ltd. -#define UHS_VID_EDIMAX_TECHNOLOGY_1 0x7392U // Edimax Technology Co., Ltd -#define UHS_VID_INTEL_1 0x8086U // Intel Corp. -#define UHS_VID_INTEL_2 0x8087U // Intel Corp. -#define UHS_VID_VIRTUALBOX 0x80eeU // VirtualBox -#define UHS_VID_KEIO 0x8282U // Keio -#define UHS_VID_EGO_SYSTEMS_1 0x8341U // EGO Systems, Inc. -#define UHS_VID_TRANSCEND_INFORMATION_1 0x8564U // Transcend Information, Inc. -#define UHS_VID_INTENSO_GMBG 0x8644U // Intenso GmbG -#define UHS_VID_CH_PRODUCTS_1 0x8e06U // CH Products, Inc. -#define UHS_VID_SITECOM_1 0x9016U // Sitecom -#define UHS_VID_TEVII_TECHNOLOGY 0x9022U // TeVii Technology Ltd. -#define UHS_VID_GEOLAB 0x9148U // GeoLab, Ltd -#define UHS_VID_MOSCHIP_SEMICONDUCTOR 0x9710U // MosChip Semiconductor -#define UHS_VID_BESTMEDIA_CD_RECORDABLE_GMBH_AND_CO_KG 0x9849U // Bestmedia CD Recordable GmbH & Co. KG -#define UHS_VID_ODEON 0x9999U // Odeon -#define UHS_VID_GRANDTEC_1 0x99faU // Grandtec -#define UHS_VID_J_WESTHUES 0x9ac4U // J. Westhues -#define UHS_VID_MARVELL_SEMICONDUCTOR_1 0x9e88U // Marvell Semiconductor, Inc. -#define UHS_VID_ANMO_ELECTRONICS_CORP_DINO_LITE_UNKNOWN 0xa128U // AnMo Electronics Corp. / Dino-Lite (?) -#define UHS_VID_ANMO_ELECTRONICS_CORPORATION 0xa168U // AnMo Electronics Corporation -#define UHS_VID_ASIX 0xa600U // Asix -#define UHS_VID_3COM_2 0xa727U // 3Com -#define UHS_VID_MXT 0xaaaaU // MXT -#define UHS_VID_UNKNOWN_3 0xabcdU // Unknown -#define UHS_VID_BLUE_MICROPHONES 0xb58eU // Blue Microphones -#define UHS_VID_CARD_DEVICE_EXPERT 0xc216U // Card Device Expert Co., LTD -#define UHS_VID_KEIL_SOFTWARE_1 0xc251U // Keil Software, Inc. -#define UHS_VID_CACE_TECHNOLOGIES 0xcaceU // CACE Technologies Inc. -#define UHS_VID_SMART_TECHNOLOGY_INDUSTRIAL 0xcd12U // SMART TECHNOLOGY INDUSTRIAL LTD. -#define UHS_VID_ULTIMARC 0xd208U // Ultimarc -#define UHS_VID_ULTIMARC_1 0xd209U // Ultimarc -#define UHS_VID_LOGILINK 0xd904U // LogiLink -#define UHS_VID_XORCOM 0xe4e4U // Xorcom Ltd. -#define UHS_VID_MAKINGTHINGS 0xeb03U // MakingThings -#define UHS_VID_EMPIA_TECHNOLOGY 0xeb1aU // eMPIA Technology, Inc. -#define UHS_VID_KWORLD 0xeb2aU // KWorld -#define UHS_VID_SMART_TECHNOLOGY_INDUSTRIAL_1 0xef18U // SMART TECHNOLOGY INDUSTRIAL LTD. -#define UHS_VID_HEWLETT_PACKARD_1 0xf003U // Hewlett Packard -#define UHS_VID_LEAP_MOTION 0xf182U // Leap Motion -#define UHS_VID_ATTEN_ELECTRONICS_SIGLENT_TECHNOLOGIES 0xf4ecU // Atten Electronics / Siglent Technologies -#define UHS_VID_SHENZHEN_SIGLENT 0xf4edU // Shenzhen Siglent Co., Ltd. -#define UHS_VID_HAMA_1 0xf766U // Hama -#define UHS_VID_CONRAD_ELECTRONIC_SE 0xfc08U // Conrad Electronic SE -#define UHS_VID_FNK_TECH 0xffeeU // FNK Tech - -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h deleted file mode 100644 index 190077d17c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h +++ /dev/null @@ -1,336 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if !defined(_UHS_host_h_) || defined(USBCORE_H) -#error "Never include UHS_UsbCore.h directly; include UHS_Host.h instead" -#else -#define USBCORE_H - -#ifndef UHS_HOST_MAX_INTERFACE_DRIVERS -#define UHS_HOST_MAX_INTERFACE_DRIVERS 0x10U // Default maximum number of USB interface drivers -#endif - -#ifndef SYSTEM_OR_SPECIAL_YIELD -#define SYSTEM_OR_SPECIAL_YIELD(...) VOID0 -#endif - -#ifndef SYSTEM_OR_SPECIAL_YIELD_FROM_ISR -#define SYSTEM_OR_SPECIAL_YIELD_FROM_ISR(...) SYSTEM_OR_SPECIAL_YIELD -#endif - -// As we make extensions to a target interface add to UHS_HOST_MAX_INTERFACE_DRIVERS -// This offset gets calculated for supporting wide subclasses, such as HID, BT, etc. -#define UHS_HID_INDEX (UHS_HOST_MAX_INTERFACE_DRIVERS + 1) - -/* Common setup data constant combinations */ -//get descriptor request type -#define UHS_bmREQ_GET_DESCR (USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE) - -//set request type for all but 'set feature' and 'set interface' -#define UHS_bmREQ_SET (USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE) - -//get interface request type -#define UHS_bmREQ_CL_GET_INTF (USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE) - -// D7 data transfer direction (0 - host-to-device, 1 - device-to-host) -// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved) -// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved) - - -// TO-DO: Use the python script to generate these. -// TO-DO: Add _all_ subclasses here. -// USB Device Classes, Subclasses and Protocols -//////////////////////////////////////////////////////////////////////////////// -// Use Class Info in the Interface Descriptors -#define UHS_USB_CLASS_USE_CLASS_INFO 0x00U - -//////////////////////////////////////////////////////////////////////////////// -// Audio -#define UHS_USB_CLASS_AUDIO 0x01U -// Subclasses -#define UHS_USB_SUBCLASS_AUDIOCONTROL 0x01U -#define UHS_USB_SUBCLASS_AUDIOSTREAMING 0x02U -#define UHS_USB_SUBCLASS_MIDISTREAMING 0x03U - -//////////////////////////////////////////////////////////////////////////////// -// Communications and CDC Control -#define UHS_USB_CLASS_COM_AND_CDC_CTRL 0x02U - -//////////////////////////////////////////////////////////////////////////////// -// HID -#define UHS_USB_CLASS_HID 0x03U -// Subclasses -#define UHS_HID_BOOT_SUBCLASS 0x01U -// Protocols -#define UHS_HID_PROTOCOL_HIDBOOT_KEYBOARD 0x01U -#define UHS_HID_PROTOCOL_HIDBOOT_MOUSE 0x02U -//////////////////////////////////////////////////////////////////////////////// -// Physical -#define UHS_USB_CLASS_PHYSICAL 0x05U - -//////////////////////////////////////////////////////////////////////////////// -// Image -#define UHS_USB_CLASS_IMAGE 0x06U - -//////////////////////////////////////////////////////////////////////////////// -// Printer -#define UHS_USB_CLASS_PRINTER 0x07U - -//////////////////////////////////////////////////////////////////////////////// -// Mass Storage -#define UHS_USB_CLASS_MASS_STORAGE 0x08 -// Subclasses -#define UHS_BULK_SUBCLASS_SCSI_NOT_REPORTED 0x00U // De facto use -#define UHS_BULK_SUBCLASS_RBC 0x01U -#define UHS_BULK_SUBCLASS_ATAPI 0x02U // MMC-5 (ATAPI) -#define UHS_BULK_SUBCLASS_OBSOLETE1 0x03U // Was QIC-157 -#define UHS_BULK_SUBCLASS_UFI 0x04U // Specifies how to interface Floppy Disk Drives to USB -#define UHS_BULK_SUBCLASS_OBSOLETE2 0x05U // Was SFF-8070i -#define UHS_BULK_SUBCLASS_SCSI 0x06U // SCSI Transparent Command Set -#define UHS_BULK_SUBCLASS_LSDFS 0x07U // Specifies how host has to negotiate access before trying SCSI -#define UHS_BULK_SUBCLASS_IEEE1667 0x08U -// Protocols -#define UHS_STOR_PROTO_CBI 0x00U // CBI (with command completion interrupt) -#define UHS_STOR_PROTO_CBI_NO_INT 0x01U // CBI (without command completion interrupt) -#define UHS_STOR_PROTO_OBSOLETE 0x02U -#define UHS_STOR_PROTO_BBB 0x50U // Bulk Only Transport -#define UHS_STOR_PROTO_UAS 0x62U - -//////////////////////////////////////////////////////////////////////////////// -// Hub -#define UHS_USB_CLASS_HUB 0x09U - -//////////////////////////////////////////////////////////////////////////////// -// CDC-Data -#define UHS_USB_CLASS_CDC_DATA 0x0AU - -//////////////////////////////////////////////////////////////////////////////// -// Smart-Card -#define UHS_USB_CLASS_SMART_CARD 0x0BU - -//////////////////////////////////////////////////////////////////////////////// -// Content Security -#define UHS_USB_CLASS_CONTENT_SECURITY 0x0DU - -//////////////////////////////////////////////////////////////////////////////// -// Video -#define UHS_USB_CLASS_VIDEO 0x0EU - -//////////////////////////////////////////////////////////////////////////////// -// Personal Healthcare -#define UHS_USB_CLASS_PERSONAL_HEALTH 0x0FU - -//////////////////////////////////////////////////////////////////////////////// -// Diagnostic Device -#define UHS_USB_CLASS_DIAGNOSTIC_DEVICE 0xDCU - -//////////////////////////////////////////////////////////////////////////////// -// Wireless Controller -#define UHS_USB_CLASS_WIRELESS_CTRL 0xE0U - -//////////////////////////////////////////////////////////////////////////////// -// Miscellaneous -#define UHS_USB_CLASS_MISC 0xEFU - -//////////////////////////////////////////////////////////////////////////////// -// Application Specific -#define UHS_USB_CLASS_APP_SPECIFIC 0xFEU - -//////////////////////////////////////////////////////////////////////////////// -// Vendor Specific -#define UHS_USB_CLASS_VENDOR_SPECIFIC 0xFFU - -//////////////////////////////////////////////////////////////////////////////// - - -/* USB state machine states */ -#define UHS_USB_HOST_STATE_MASK 0xF0U - -// Configure states, MSN == 0 --------------------------V -#define UHS_USB_HOST_STATE_DETACHED 0x00U -#define UHS_USB_HOST_STATE_DEBOUNCE 0x01U -#define UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE 0x02U -#define UHS_USB_HOST_STATE_RESET_NOT_COMPLETE 0x03U -#define UHS_USB_HOST_STATE_WAIT_SOF 0x04U -#define UHS_USB_HOST_STATE_WAIT_BUS_READY 0x05U -#define UHS_USB_HOST_STATE_RESET_DEVICE 0x0AU -#define UHS_USB_HOST_STATE_CONFIGURING 0x0CU // Looks like "CO"nfig (backwards) -#define UHS_USB_HOST_STATE_CONFIGURING_DONE 0x0DU // Looks like "DO"one (backwards) -#define UHS_USB_HOST_STATE_CHECK 0x0EU -#define UHS_USB_HOST_STATE_ILLEGAL 0x0FU // Foo - -// Run states, MSN != 0 --------------------------------V -#define UHS_USB_HOST_STATE_RUNNING 0x60U // Looks like "GO" -#define UHS_USB_HOST_STATE_IDLE 0x1DU // Looks like "ID"le -#define UHS_USB_HOST_STATE_ERROR 0xF0U // Looks like "FO"o -#define UHS_USB_HOST_STATE_INITIALIZE 0x10U // Looks like "I"nit - -// Host SE result codes. -// Common SE results are stored in the low nybble, all interface drivers understand these plus 0x1f. -// Extended SE results are 0x10-0x1e. SE code only understands these internal to the hardware. -// Values > 0x1F are driver or other internal error conditions. -// Return these result codes from your host controller driver to match the error condition -// ALL Non-zero values are errors. -// Values not listed in this table are not handled in the base class, or any host driver. - -#define UHS_HOST_ERROR_NONE 0x00U // No error -#define UHS_HOST_ERROR_BUSY 0x01U // transfer pending -#define UHS_HOST_ERROR_BADREQ 0x02U // Transfer Launch Request was bad -#define UHS_HOST_ERROR_DMA 0x03U // DMA was too short, or too long -#define UHS_HOST_ERROR_NAK 0x04U // Peripheral returned NAK -#define UHS_HOST_ERROR_STALL 0x05U // Peripheral returned STALL -#define UHS_HOST_ERROR_TOGERR 0x06U // Toggle error/ISO over-underrun -#define UHS_HOST_ERROR_WRONGPID 0x07U // Received wrong Packet ID -#define UHS_HOST_ERROR_BADBC 0x08U // Byte count is bad -#define UHS_HOST_ERROR_PIDERR 0x09U // Received Packet ID is corrupted -#define UHS_HOST_ERROR_BADRQ 0x0AU // Packet error. Increase max packet. -#define UHS_HOST_ERROR_CRC 0x0BU // USB CRC was incorrect -#define UHS_HOST_ERROR_KERR 0x0CU // K-state instead of response, usually indicates wrong speed -#define UHS_HOST_ERROR_JERR 0x0DU // J-state instead of response, usually indicates wrong speed -#define UHS_HOST_ERROR_TIMEOUT 0x0EU // Device did not respond in time -#define UHS_HOST_ERROR_BABBLE 0x0FU // Line noise/unexpected data -#define UHS_HOST_ERROR_MEM_LAT 0x10U // Error caused by memory latency. -#define UHS_HOST_ERROR_NYET 0x11U // OUT transfer accepted with NYET - -// Addressing error codes -#define ADDR_ERROR_INVALID_INDEX 0xA0U -#define ADDR_ERROR_INVALID_ADDRESS 0xA1U - -// Common Interface Driver error codes -#define UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED 0xD1U // Driver doesn't support the device or interfaces -#define UHS_HOST_ERROR_DEVICE_INIT_INCOMPLETE 0xD2U // Init partially finished, but died. -#define UHS_HOST_ERROR_CANT_REGISTER_DEVICE_CLASS 0xD3U // There was no driver for the interface requested. -#define UHS_HOST_ERROR_ADDRESS_POOL_FULL 0xD4U // No addresses left in the address pool. -#define UHS_HOST_ERROR_HUB_ADDRESS_OVERFLOW 0xD5U // No hub addresses left. The maximum is 7. -#define UHS_HOST_ERROR_NO_ADDRESS_IN_POOL 0xD6U // Address was not allocated in the pool, thus not found. -#define UHS_HOST_ERROR_NULL_EPINFO 0xD7U // The supplied endpoint was NULL, indicates a bug or other problem. -#define UHS_HOST_ERROR_BAD_ARGUMENT 0xD8U // Indicates a range violation bug. -#define UHS_HOST_ERROR_DEVICE_DRIVER_BUSY 0xD9U // The interface driver is busy or out buffer is full, try again later. -#define UHS_HOST_ERROR_BAD_MAX_PACKET_SIZE 0xDAU // The maximum packet size was exceeded. Try again with smaller size. -#define UHS_HOST_ERROR_NO_ENDPOINT_IN_TABLE 0xDBU // The endpoint could not be found in the endpoint table. -#define UHS_HOST_ERROR_UNPLUGGED 0xDEU // Someone removed the USB device, or Vbus was turned off. -#define UHS_HOST_ERROR_NOMEM 0xDFU // Out Of Memory. - -// Control request stream errors -#define UHS_HOST_ERROR_FailGetDevDescr 0xE1U -#define UHS_HOST_ERROR_FailSetDevTblEntry 0xE2U -#define UHS_HOST_ERROR_FailGetConfDescr 0xE3U -#define UHS_HOST_ERROR_END_OF_STREAM 0xEFU - -// Host base class specific Error codes -#define UHS_HOST_ERROR_NOT_IMPLEMENTED 0xFEU -#define UHS_HOST_ERROR_TRANSFER_TIMEOUT 0xFFU - -// SEI interaction defaults -#define UHS_HOST_TRANSFER_MAX_MS 10000 // USB transfer timeout in ms, per section 9.2.6.1 of USB 2.0 spec -#define UHS_HOST_TRANSFER_RETRY_MAXIMUM 3 // 3 retry limit for a transfer -#define UHS_HOST_DEBOUNCE_DELAY_MS 500 // settle delay in milliseconds -#define UHS_HUB_RESET_DELAY_MS 20 // hub port reset delay, 10ms recomended, but can be up to 20ms - -// -// We only provide the minimum needed information for enumeration. -// Interface drivers should be able to set up what is needed with nothing more. -// A driver needs to know the following information: -// 1: address on the USB network, parent and port (aka UsbDeviceAddress) -// 2: endpoints -// 3: vid:pid, class, subclass, protocol -// - -struct ENDPOINT_INFO { - uint8_t bEndpointAddress; // Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN). - uint8_t bmAttributes; // Endpoint transfer type. - uint16_t wMaxPacketSize; // Maximum packet size. - uint8_t bInterval; // Polling interval in frames. -} __attribute__((packed)); - -struct INTERFACE_INFO { - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t numep; - uint8_t klass; - uint8_t subklass; - uint8_t protocol; - ENDPOINT_INFO epInfo[16]; -} __attribute__((packed)); - -struct ENUMERATION_INFO { - uint16_t vid; - uint16_t pid; - uint16_t bcdDevice; - uint8_t klass; - uint8_t subklass; - uint8_t protocol; - uint8_t bMaxPacketSize0; - uint8_t currentconfig; - uint8_t parent; - uint8_t port; - uint8_t address; - INTERFACE_INFO interface; -} __attribute__((packed)); - -/* USB Setup Packet Structure */ -typedef struct { - // offset description - // 0 Bit-map of request type - union { - uint8_t bmRequestType; - - struct { - uint8_t recipient : 5; // Recipient of the request - uint8_t type : 2; // Type of request - uint8_t direction : 1; // Direction of data transfer - } __attribute__((packed)); - } ReqType_u; - - // 1 Request - uint8_t bRequest; - - // 2 Depends on bRequest - union { - uint16_t wValue; - - struct { - uint8_t wValueLo; - uint8_t wValueHi; - } __attribute__((packed)); - } wVal_u; - // 4 Depends on bRequest - uint16_t wIndex; - // 6 Depends on bRequest - uint16_t wLength; - // 8 bytes total -} __attribute__((packed)) SETUP_PKT, *PSETUP_PKT; - - -// little endian :-) 8 8 8 8 16 16 -#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wValLo))<<16)|(((uint64_t)(wValHi))<<24)|(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) -#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wVal ))<<16) |(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) - -// Big endian -- but we aren't able to use this :-/ -//#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48)|(((uint64_t)(wValLo))<<40)|(((uint64_t)(wValHi))<<32)|(((uint64_t)(wInd))<<16)|((uint64_t)(total))) -//#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48) |(((uint64_t)(wVal))<<32) |(((uint64_t)(wInd))<<16)|((uint64_t)(total))) - -#endif /* USBCORE_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h deleted file mode 100644 index 1c8b791910..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h +++ /dev/null @@ -1,248 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if !defined(_UHS_host_h_) || defined(__ADDRESS_H__) -#error "Never include UHS_address.h directly; include UHS_Usb.h instead" -#else -#define __ADDRESS_H__ - - - -/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ -/* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */ -#define UHS_USB_NAK_MAX_POWER 14 // NAK binary order maximum value -#define UHS_USB_NAK_DEFAULT 13 // default 16K-1 NAKs before giving up -#define UHS_USB_NAK_NOWAIT 1 // Single NAK stops transfer -#define UHS_USB_NAK_NONAK 0 // Do not count NAKs, stop retrying after USB Timeout. Try not to use this. - -#define bmUSB_DEV_ADDR_PORT 0x07 -#define bmUSB_DEV_ADDR_PARENT 0x78 -#define bmUSB_DEV_ADDR_HUB 0x40 - -// TODO: embed parent? -struct UHS_EpInfo { - uint8_t epAddr; // Endpoint address - uint8_t bIface; - uint16_t maxPktSize; // Maximum packet size - - union { - uint8_t epAttribs; - - struct { - uint8_t bmSndToggle : 1; // Send toggle, when zero bmSNDTOG0, bmSNDTOG1 otherwise - uint8_t bmRcvToggle : 1; // Send toggle, when zero bmRCVTOG0, bmRCVTOG1 otherwise - uint8_t bmNeedPing : 1; // 1 == ping protocol needed for next out packet - uint8_t bmNakPower : 5; // Binary order for NAK_LIMIT value - } __attribute__((packed)); - }; -} __attribute__((packed)); - -// TODO: embed parent address and port into epinfo struct, -// and nuke this address stupidity. -// This is a compact scheme. Should also support full spec. -// This produces a 7 hub limit, 49 devices + 7 hubs, 56 total. -// -// 7 6 5 4 3 2 1 0 -// --------------------------------- -// | | H | P | P | P | A | A | A | -// --------------------------------- -// -// H - if 1 the address is a hub address -// P - parent hub number -// A - port number of parent -// - -struct UHS_DeviceAddress { - - union { - - struct { - uint8_t bmAddress : 3; // port number - uint8_t bmParent : 3; // parent hub address - uint8_t bmHub : 1; // hub flag - uint8_t bmReserved : 1; // reserved, must be zero - } __attribute__((packed)); - uint8_t devAddress; - }; -} __attribute__((packed)); - -struct UHS_Device { - volatile UHS_EpInfo *epinfo[UHS_HOST_MAX_INTERFACE_DRIVERS]; // endpoint info pointer - UHS_DeviceAddress address; - uint8_t epcount; // number of endpoints - uint8_t speed; // indicates device speed -} __attribute__((packed)); - -typedef void (*UsbDeviceHandleFunc)(UHS_Device *pdev); - -class AddressPool { - UHS_EpInfo dev0ep; //Endpoint data structure used during enumeration for uninitialized device - - // In order to avoid hub address duplication, this should use bits - uint8_t hubCounter; // hub counter - - UHS_Device thePool[UHS_HOST_MAX_INTERFACE_DRIVERS]; - - // Initializes address pool entry - - void UHS_NI InitEntry(uint8_t index) { - thePool[index].address.devAddress = 0; - thePool[index].epcount = 1; - thePool[index].speed = 0; - for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - thePool[index].epinfo[i] = &dev0ep; - } - }; - - // Returns thePool index for a given address - - uint8_t UHS_NI FindAddressIndex(uint8_t address = 0) { - for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - if(thePool[i].address.devAddress == address) - return i; - } - return 0; - }; - - // Returns thePool child index for a given parent - - uint8_t UHS_NI FindChildIndex(UHS_DeviceAddress addr, uint8_t start = 1) { - for(uint8_t i = (start < 1 || start >= UHS_HOST_MAX_INTERFACE_DRIVERS) ? 1 : start; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - if(thePool[i].address.bmParent == addr.bmAddress) - return i; - } - return 0; - }; - - // Frees address entry specified by index parameter - - void UHS_NI FreeAddressByIndex(uint8_t index) { - // Zero field is reserved and should not be affected - if(index == 0) - return; - - UHS_DeviceAddress uda = thePool[index].address; - // If a hub was switched off all port addresses should be freed - if(uda.bmHub == 1) { - for(uint8_t i = 1; (i = FindChildIndex(uda, i));) - FreeAddressByIndex(i); - - // FIXME: use BIT MASKS - // If the hub had the last allocated address, hubCounter should be decremented - if(hubCounter == uda.bmAddress) - hubCounter--; - } - InitEntry(index); - } - - void InitAllAddresses() { - for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) InitEntry(i); - hubCounter = 0; - }; -public: - - AddressPool() { - hubCounter = 0; - // Zero address is reserved - InitEntry(0); - - thePool[0].epinfo[0] = &dev0ep; - dev0ep.epAddr = 0; -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - dev0ep.maxPktSize = 0x40; //starting at 0x40 and work down -#else - dev0ep.maxPktSize = 0x08; -#endif - dev0ep.epAttribs = 0; //set DATA0/1 toggles to 0 - dev0ep.bmNakPower = UHS_USB_NAK_MAX_POWER; - InitAllAddresses(); - }; - - // Returns a pointer to a specified address entry - - UHS_Device* UHS_NI GetUsbDevicePtr(uint8_t addr) { - if(!addr) - return thePool; - - uint8_t index = FindAddressIndex(addr); - - return (!index) ? NULL : &thePool[index]; - }; - - - // Allocates new address - - uint8_t UHS_NI AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 1) { - /* if (parent != 0 && port == 0) - USB_HOST_SERIAL.println("PRT:0"); */ - UHS_DeviceAddress _parent; - _parent.devAddress = parent; - if(_parent.bmReserved || port > 7) - //if(parent > 127 || port > 7) - return 0; - - // FIXME: use BIT MASKS - if(is_hub && hubCounter == 7) - return 0; - - // finds first empty address entry starting from one - uint8_t index = FindAddressIndex(0); - - if(!index) // if empty entry is not found - return 0; - - UHS_DeviceAddress addr; - addr.devAddress = port; - addr.bmParent = _parent.bmAddress; - - // FIXME: use BIT MASKS - if(is_hub) { - hubCounter++; - addr.bmHub = 1; - addr.bmAddress = hubCounter; - } - thePool[index].address = addr; -#if DEBUG_PRINTF_EXTRA_HUGE -#ifdef UHS_DEBUG_USB_ADDRESS - printf("Address: %x (%x.%x.%x)\r\n", addr.devAddress, addr.bmHub, addr.bmParent, addr.bmAddress); -#endif -#endif - return thePool[index].address.devAddress; - }; - - void UHS_NI FreeAddress(uint8_t addr) { - // if the root hub is disconnected all the addresses should be initialized - if(addr == 0x41) { - InitAllAddresses(); - return; - } - uint8_t index = FindAddressIndex(addr); - FreeAddressByIndex(index); - }; - -}; - -#endif // __ADDRESS_H__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h deleted file mode 100644 index bc111f7b61..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ -#if !defined(_usb_h_) || defined(__HEXDUMP_H__) -#error "Never include UHS_hexdump.h directly; include UHS_Usb.h instead" -#else -#define __HEXDUMP_H__ - -extern int UsbDEBUGlvl; - -template -class HexDumper : public BASE_CLASS { - uint8_t byteCount; - OFFSET_TYPE byteTotal; - -public: - - HexDumper() : byteCount(0), byteTotal(0) { - }; - - void Initialize() { - byteCount = 0; - byteTotal = 0; - }; - - virtual void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset); -}; - -template -void HexDumper::Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset) { - if(UsbDEBUGlvl >= 0x80) { // Fully bypass this block of code if we do not debug. - for(LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) { - if(!byteCount) { - PrintHex (byteTotal, 0x80); - E_Notify(PSTR(": "), 0x80); - } - PrintHex (pbuf[j], 0x80); - E_Notify(PSTR(" "), 0x80); - - if(byteCount == 15) { - E_Notify(PSTR("\r\n"), 0x80); - byteCount = 0xFF; - } - } - } -} - -#endif // __HEXDUMP_H__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h deleted file mode 100644 index 7f7d18116c..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ -/* USB functions */ -#ifndef _UHS_host_h_ -#define _UHS_host_h_ - -// WARNING: Do not change the order of includes, or stuff will break! -#include -#include -#include -#include - -#if DISABLED(USE_UHS3_USB) -#include -#include -#include -#include -#endif -#include "UHS_macros.h" - -// None of these should ever be directly included by a driver, or a user's sketch. -#include "../dyn_SWI/dyn_SWI.h" -#include "UHS_USB_IDs.h" -#include "UHS_settings.h" -#include "UHS_usb_ch9.h" -#include "UHS_UsbCore.h" -#include "UHS_address.h" -#include "UHS_usbhost.h" -#include "UHS_printhex.h" -#include "UHS_message.h" - -// Load system components as required -#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_LOADED) -#include "UHS_util_INLINE.h" -#include "UHS_host_INLINE.h" -#include "UHS_printf_HELPER.h" - -#ifdef LOAD_USB_HOST_SHIELD -#include "USB_HOST_SHIELD/USB_HOST_SHIELD.h" -#endif - -#if defined(LOAD_UHS_KINETIS_FS_HOST) && !defined(UHS_KINETIS_FS_HOST_LOADED) -#include "UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h" -#endif - -#if defined(LOAD_UHS_KINETIS_EHCI) && !defined(UHS_KINETIS_EHCI_LOADED) -#include "UHS_KINETIS_EHCI/UHS_KINETIS_EHCI.h" -#endif - -// Load USB drivers and multiplexers - -#ifdef LOAD_UHS_HUB -#include "UHS_HUB/UHS_HUB.h" -#endif // HUB loaded - -#ifdef LOAD_UHS_BULK_STORAGE -#include "UHS_BULK_STORAGE/UHS_BULK_STORAGE.h" -#endif - -#ifdef LOAD_GENERIC_STORAGE -#include "../UHS_FS/UHS_FS.h" -#endif -// Add BT and optionally HID if directed to do so -#ifdef LOAD_UHS_BT -#include "UHS_BT/UHS_BT.h" -#endif // BT and optionally HID loaded - -// Add HID -#ifdef LOAD_UHS_HID -#include "UHS_HID/UHS_HID.h" -#endif // HID loaded - -// Add CDC multiplexers (currently only ACM) -#if defined(LOAD_UHS_CDC_ACM) || defined(LOAD_UHS_CDC_ACM_FTDI) || defined(LOAD_UHS_CDC_ACM_PROLIFIC) || defined(LOAD_UHS_CDC_ACM_XR21B1411) -#include "UHS_CDC/UHS_CDC.h" -#endif // CDC loaded - -#ifdef LOAD_UHS_ADK -#include "UHS_ADK/UHS_ADK.h" -#endif - -#ifdef LOAD_UHS_MIDI -#include "UHS_MIDI/UHS_MIDI.h" -#endif - -#endif // System code loaded - -#endif // _UHS_host_h_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h deleted file mode 100644 index 908391a157..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h +++ /dev/null @@ -1,1224 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_LOADED) -#define USB_HOST_SYSTEM_LOADED - -#ifndef DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST -#define DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST 0 -#endif - -#if DEBUG_PRINTF_EXTRA_HUGE -#if DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST -#define HOST_DEBUG(...) printf(__VA_ARGS__) -#else -#define HOST_DEBUG(...) VOID0 -#endif -#else -#define HOST_DEBUG(...) VOID0 -#endif - -UHS_EpInfo* UHS_USB_HOST_BASE::getEpInfoEntry(uint8_t addr, uint8_t ep) { - UHS_Device *p = addrPool.GetUsbDevicePtr(addr); - - if(!p || !p->epinfo) - return NULL; - - - UHS_EpInfo *pep; - for(uint8_t j = 0; j < UHS_HOST_MAX_INTERFACE_DRIVERS; j++) { - pep = (UHS_EpInfo *)(p->epinfo[j]); - - for(uint8_t i = 0; i < p->epcount; i++) { - if((pep)->epAddr == ep) { - HOST_DEBUG("ep entry for interface %d ep %d max packet size = %d\r\n", pep->bIface, ep, pep->maxPktSize); - return pep; - } - - pep++; - } - } - return NULL; -} - -/** - * Sets a device table entry for a device. - * Each device is different and has different number of endpoints. - * This function plugs endpoint record structure, defined in application, to devtable - * - * @param addr device address - * @param epcount how many endpoints - * @param eprecord pointer to the endpoint structure - * @return Zero for success, or error code - */ -uint8_t UHS_USB_HOST_BASE::setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord) { - if(!eprecord) - return UHS_HOST_ERROR_BAD_ARGUMENT; - - UHS_Device *p = addrPool.GetUsbDevicePtr(addr); - - if(!p) - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - - p->address.devAddress = addr; - p->epinfo[iface] = eprecord; - p->epcount = epcount; - return 0; -} - -/** - * sets all enpoint addresses to zero. - * Sets all max packet sizes to defaults - * Clears all endpoint attributes - * Sets bmNakPower to USB_NAK_DEFAULT - * Sets binterface to zero. - * Sets bNumEP to zero. - * Sets bAddress to zero. - * Clears qNextPollTime and sets bPollEnable to false. - * - * @param maxep How many endpoints to initialize - * @param device pointer to the device driver instance (this) - * - */ - -void UHS_USB_HOST_BASE::DeviceDefaults(uint8_t maxep, UHS_USBInterface *interface) { - - for(uint8_t i = 0; i < maxep; i++) { - interface->epInfo[i].epAddr = 0; - interface->epInfo[i].maxPktSize = (i) ? 0 : 8; - interface->epInfo[i].epAttribs = 0; - interface->epInfo[i].bmNakPower = UHS_USB_NAK_DEFAULT; - } - interface->pUsb->GetAddressPool()->FreeAddress(interface->bAddress); - interface->bIface = 0; - interface->bNumEP = 1; - interface->bAddress = 0; - interface->qNextPollTime = 0; - interface->bPollEnable = false; -} - -/** - * Perform a bus reset to the port of the connected device - * - * @param parent index to Parent - * @param port what port on the parent - * @param address address of the device - * @return Zero for success, or error code - */ - -uint8_t UHS_USB_HOST_BASE::doSoftReset(uint8_t parent, uint8_t port, uint8_t address) { - uint8_t rcode = 0; - - if(parent == 0) { - // Send a bus reset on the root interface. - doHostReset(); - } else { - // reset parent port - devConfig[parent]->ResetHubPort(port); - } - - // - // Many devices require a delay before setting the address here... - // We loop upon fails for up to 2 seconds instead. - // Most devices will be happy without a retry. - // - uint8_t retries = 0; - if(address) { - do { - rcode = setAddr(0, address); - if(!rcode) break; - retries++; - sof_delay(10); - } while(retries < 200); - HOST_DEBUG("%i retries.\r\n", retries); - } else { -#if DEBUG_PRINTF_EXTRA_HUGE - printf("\r\ndoSoftReset called with address == 0.\r\n"); -#endif - } - return rcode; -} - -/* - * Pseudo code so you may understand the code flow. - * - * reset; (happens at the lower level) - * GetDevDescr(); - * reset; - * If there are no configuration descriptors { - * // - * // Note: I know of no device that does this. - * // I suppose there could be one though. - * // - * try to enumerate. - * } else { - * last success count = 0 - * best config = 0 - * for each configuration descriptor { - * for each interface descriptor { - * get the endpoint descriptors for this interface. - * Check to see if a driver can handle this interface. - * If it can, add 1 to the success count. - * } - * if success count > last success count { - * best config = current config - * last success count = success count - * } - * } - * set the device config to the best config - * for each best config interface descriptor { - * initialize driver that can handle this interface config - * } - * } - * - * NOTES: - * 1: We do not need to save toggle states anymore and have not - * needed to for some time, because the lower level driver - * actually corrects wrong toggles on-the-fly for us. - * - * 2: We always do a second reset, since this stupid bug is - * actually part of the specification documents that I - * have found all over the net. Even Linux does it, and - * many devices actually EXPECT this behavior. Some devices - * will not enumerate without it. For devices that do not - * need it, the additional reset is harmless. Here is an - * example of one of these documents, see page Five: - * http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_113_Simplified%20Description%20of%20USB%20Device%20Enumeration.pdf - * - * - */ - -/** - * Enumerates interfaces on devices - * - * @param parent index to Parent - * @param port what port on the parent - * @param speed the speed of the device - * @return Zero for success, or error code - */ -uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t speed) { - //uint8_t bAddress = 0; - HOST_DEBUG("\r\n\r\n\r\nConfiguring: parent = %i, port = %i, speed = %i\r\n", parent, port, speed); - uint8_t rcode = 0; - uint8_t retries = 0; - uint8_t numinf = 0; - uint8_t configs; - UHS_Device *p = NULL; - //EpInfo epInfo; // cap at 16, this should be fairly reasonable. - ENUMERATION_INFO ei; - uint8_t bestconf = 0; - uint8_t bestsuccess = 0; - - uint8_t devConfigIndex; - -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - const uint8_t biggest = 0x40; - // wrap in {} to throw away the 64 byte buffer when we are done with it - { - uint8_t buf[biggest]; - USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); -#else - const uint8_t biggest = 18; - uint8_t buf[biggest]; - USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); - USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); -#endif - - //for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { - // if((devConfig[devConfigIndex]->bAddress) && (!devConfig[devConfigIndex]->bPollEnable)) { - // devConfig[devConfigIndex]->bAddress = 0; - // } - //} - // Serial.print("HOST USB Host @ 0x"); - // Serial.println((uint32_t)this, HEX); - // Serial.print("HOST USB Host Address Pool @ 0x"); - // Serial.println((uint32_t)GetAddressPool(), HEX); - - sof_delay(200); - p = addrPool.GetUsbDevicePtr(0); - if(!p) { - HOST_DEBUG("Configuring error: USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL\r\n"); - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - } - - p->speed = speed; -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - - p->epinfo[0][0].maxPktSize = 0x40; // Windows bug is expected. - // poison data - // udd->bMaxPacketSize0 = 0U; -#else - p->epinfo[0][0].maxPktSize = 0x08; // USB Spec, start small, work your way up. -#endif -again: - memset((void *)buf, 0, biggest); - HOST_DEBUG("\r\n\r\nConfiguring PktSize 0x%2.2x, rcode: 0x%2.2x, retries %i,\r\n", p->epinfo[0][0].maxPktSize, rcode, retries); - rcode = getDevDescr(0, biggest, (uint8_t*)buf); -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - if(rcode || udd->bMaxPacketSize0 < 8) -#else - if(rcode) -#endif - { - if(rcode == UHS_HOST_ERROR_JERR && retries < 4) { - // - // Some devices return JERR when plugged in. - // Attempts to reinitialize the device usually works. - // - // I have a hub that will refuse to work and acts like - // this unless external power is supplied. - // So this may not always work, and you may be fooled. - // - sof_delay(100); - retries++; - goto again; -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - } else if(((rcode == UHS_HOST_ERROR_DMA || rcode == UHS_HOST_ERROR_MEM_LAT) && retries < 4) || (udd->bMaxPacketSize0 < 8 && !rcode)) { - - if(p->epinfo[0][0].maxPktSize > 8 && rcode == UHS_HOST_ERROR_DMA) p->epinfo[0][0].maxPktSize = p->epinfo[0][0].maxPktSize >> 1; -#else - } else if((rcode == UHS_HOST_ERROR_DMA || rcode == UHS_HOST_ERROR_MEM_LAT) && retries < 4) { - if(p->epinfo[0][0].maxPktSize < 32) p->epinfo[0][0].maxPktSize = p->epinfo[0][0].maxPktSize << 1; -#endif - HOST_DEBUG("Configuring error: 0x%2.2x UHS_HOST_ERROR_DMA. Retry with maxPktSize: %i\r\n", rcode, p->epinfo[0][0].maxPktSize); - doSoftReset(parent, port, 0); - retries++; - sof_delay(200); - goto again; - } - HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_DEVICE_DESCRIPTOR\r\n", rcode); - return rcode; - } - - -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - ei.address = addrPool.AllocAddress(parent, false, port); - - if(!ei.address) { - return UHS_HOST_ERROR_ADDRESS_POOL_FULL; - } - - p = addrPool.GetUsbDevicePtr(ei.address); - // set to 1 if you suspect address table corruption. -#if 0 - if(!p) { - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - } -#endif - - p->speed = speed; - - rcode = doSoftReset(parent, port, ei.address); - - if(rcode) { - addrPool.FreeAddress(ei.address); - HOST_DEBUG("Configuring error: %2.2x Can't set USB INTERFACE ADDRESS\r\n", rcode); - return rcode; - } - - { // the { } wrapper saves on stack. - HOST_DEBUG("DevDescr 2nd poll, bMaxPacketSize0:%u\r\n", udd->bMaxPacketSize0); - UHS_EpInfo dev1ep; - dev1ep.maxPktSize = udd->bMaxPacketSize0; - dev1ep.epAddr = 0; - dev1ep.epAttribs = 0; - dev1ep.bmNakPower = UHS_USB_NAK_MAX_POWER; - p->address.devAddress = ei.address; - p->epcount = 1; - p->epinfo[0] = &dev1ep; - - sof_delay(10); - memset((void *)buf, 0, biggest); - rcode = getDevDescr(ei.address, 18, (uint8_t*)buf); - if(rcode) HOST_DEBUG("getDevDescr err: 0x%x \r\n", rcode); - - addrPool.FreeAddress(ei.address); - if(rcode && rcode != UHS_HOST_ERROR_DMA) { - return rcode; - } - sof_delay(10); - } -#endif - - ei.vid = udd->idVendor; - ei.pid = udd->idProduct; - ei.bcdDevice = udd->bcdDevice; - ei.klass = udd->bDeviceClass; - ei.subklass = udd->bDeviceSubClass; - ei.protocol = udd->bDeviceProtocol; - ei.bMaxPacketSize0 = udd->bMaxPacketSize0; - ei.currentconfig = 0; - ei.parent = parent; - ei.port = port; - configs = udd->bNumConfigurations; -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - } // unwrapped, old large buf now invalid and discarded. - - uint8_t buf[18]; - USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); -#endif - - ei.address = addrPool.AllocAddress(parent, IsHub(ei.klass), port); - - if(!ei.address) { - return UHS_HOST_ERROR_ADDRESS_POOL_FULL; - } - - p = addrPool.GetUsbDevicePtr(ei.address); - // set to 1 if you suspect address table corruption. -#if 0 - if(!p) { - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - } -#endif - - p->speed = speed; - - rcode = doSoftReset(parent, port, ei.address); - - if(rcode) { - addrPool.FreeAddress(ei.address); - HOST_DEBUG("Configuring error: %2.2x Can't set USB INTERFACE ADDRESS\r\n", rcode); - return rcode; - } - - if(configs < 1) { - HOST_DEBUG("No interfaces?!\r\n"); - addrPool.FreeAddress(ei.address); - // rcode = TestInterface(&ei); - // Not implemented (yet) - rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; - } else { - HOST_DEBUG("configs: %i\r\n", configs); - for(uint8_t conf = 0; (!rcode) && (conf < configs); conf++) { - // read the config descriptor into a buffer. - rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), conf, buf); - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); - rcode = UHS_HOST_ERROR_FailGetConfDescr; - continue; - } - ei.currentconfig = conf; - numinf = ucd->bNumInterfaces; // Does _not_ include alternates! - HOST_DEBUG("CONFIGURATION: %i, bNumInterfaces %i, wTotalLength %i\r\n", conf, numinf, ucd->wTotalLength); - uint8_t success = 0; - uint16_t inf = 0; - uint8_t data[ei.bMaxPacketSize0]; - UHS_EpInfo *pep; - pep = ctrlReqOpen(ei.address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei.currentconfig, USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); - if(!pep) { - rcode = UHS_HOST_ERROR_NULL_EPINFO; - continue; - } - uint16_t left; - uint16_t read; - uint8_t offset; - rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset); - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); - break; - } - for(; (numinf) && (!rcode); inf++) { - // iterate for each interface on this config - rcode = getNextInterface(&ei, pep, data, &left, &read, &offset); - if(rcode == UHS_HOST_ERROR_END_OF_STREAM) { - HOST_DEBUG("USB_INTERFACE END OF STREAM\r\n"); - ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei.bMaxPacketSize0, data); - rcode = 0; - break; - } - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); - continue; - } - rcode = TestInterface(&ei); - if(!rcode) success++; - rcode = 0; - } - if(!inf) { - rcode = TestInterface(&ei); - if(!rcode) success++; - rcode = 0; - } - if(success > bestsuccess) { - bestconf = conf; - bestsuccess = success; - } - } - if(!bestsuccess) rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; - } - if(!rcode) { - rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), bestconf, buf); - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); - rcode = UHS_HOST_ERROR_FailGetConfDescr; - } - } - if(!rcode) { - bestconf++; - ei.currentconfig = bestconf; - numinf = ucd->bNumInterfaces; // Does _not_ include alternates! - HOST_DEBUG("CONFIGURATION: %i, bNumInterfaces %i, wTotalLength %i\r\n", bestconf, numinf, ucd->wTotalLength); - if(!rcode) { - HOST_DEBUG("Best configuration is %i, enumerating interfaces.\r\n", bestconf); - uint16_t inf = 0; - uint8_t data[ei.bMaxPacketSize0]; - UHS_EpInfo *pep; - pep = ctrlReqOpen(ei.address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei.currentconfig - 1, USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); - if(!pep) { - rcode = UHS_HOST_ERROR_NULL_EPINFO; - - } else { - uint16_t left; - uint16_t read; - uint8_t offset; - rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset); - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); - } else { - for(; (numinf) && (!rcode); inf++) { - // iterate for each interface on this config - rcode = getNextInterface(&ei, pep, data, &left, &read, &offset); - if(rcode == UHS_HOST_ERROR_END_OF_STREAM) { - ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei.bMaxPacketSize0, data); - rcode = 0; - break; - } - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); - continue; - } - - if(enumerateInterface(&ei) == UHS_HOST_MAX_INTERFACE_DRIVERS) { - HOST_DEBUG("No interface driver for this interface."); - } else { - HOST_DEBUG("Interface Configured\r\n"); - } - } - } - } - } else { - HOST_DEBUG("Configuring error: %2.2x Can't set USB_INTERFACE_CONFIG stream.\r\n", rcode); - } - } - - if(!rcode) { - rcode = setConf(ei.address, bestconf); - if(rcode) { - HOST_DEBUG("Configuring error: %2.2x Can't set Configuration.\r\n", rcode); - addrPool.FreeAddress(ei.address); - } else { - for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { - HOST_DEBUG("Driver %i ", devConfigIndex); - if(!devConfig[devConfigIndex]) { - HOST_DEBUG("no driver at this index.\r\n"); - continue; // no driver - } - HOST_DEBUG("@ %2.2x ", devConfig[devConfigIndex]->bAddress); - if(devConfig[devConfigIndex]->bAddress) { - if(!devConfig[devConfigIndex]->bPollEnable) { - HOST_DEBUG("Initialize\r\n"); - rcode = devConfig[devConfigIndex]->Finalize(); - rcode = devConfig[devConfigIndex]->Start(); - if(!rcode) { - HOST_DEBUG("Total endpoints = (%i)%i\r\n", p->epcount, devConfig[devConfigIndex]->bNumEP); - } else { - break; - } - } else { - HOST_DEBUG("Already initialized.\r\n"); - continue; // consumed - } - } else { - HOST_DEBUG("Skipped\r\n"); - } - } -#if 0 // defined(UHS_HID_LOADED) - // Now do HID -#endif - } - } else { - addrPool.FreeAddress(ei.address); - } - return rcode; -} - -/** - * Removes a device from the tables - * - * @param addr address of the device - * @return nothing - */ -void UHS_USB_HOST_BASE::ReleaseDevice(uint8_t addr) { - if(addr) { -#if 0 // defined(UHS_HID_LOADED) - // Release any HID children - UHS_HID_Release(this, addr); -#endif - for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - if(!devConfig[i]) continue; - if(devConfig[i]->bAddress == addr) { - devConfig[i]->Release(); - break; - } - } - } -} - -/** - * Gets the device descriptor, or part of it from endpoint Zero. - * - * @param addr Address of the device - * @param nbytes how many bytes to return - * @param dataptr pointer to the data to return - * @return status of the request, zero is success. - */ -uint8_t UHS_USB_HOST_BASE::getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr) { - return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes), nbytes, dataptr)); -} - -/** - * Gets the config descriptor, or part of it from endpoint Zero. - * - * @param addr Address of the device - * @param nbytes how many bytes to return - * @param conf index to descriptor to return - * @param dataptr ointer to the data to return - * @return status of the request, zero is success. - */ -uint8_t UHS_USB_HOST_BASE::getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { - return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes), nbytes, dataptr)); -} - -/** - * Get the string descriptor from a device - * - * @param addr Address of the device - * @param ns - * @param index - * @param langid language ID - * @param dataptr pointer to the data to return - * @return status of the request, zero is success. - */ -uint8_t UHS_USB_HOST_BASE::getStrDescr(uint8_t addr, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { - return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns), ns, dataptr)); -} - -// -//set address -// - -/** - * Set the address of a device to a new address via endpoint Zero. - * - * @param oldaddr current address - * @param newaddr new address - * @return status of the request, zero is success. - */ -uint8_t UHS_USB_HOST_BASE::setAddr(uint8_t oldaddr, uint8_t newaddr) { - uint8_t rcode = ctrlReq(oldaddr, mkSETUP_PKT8(UHS_bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000), 0x0000, NULL); - sof_delay(300); // Older spec says you should wait at least 200ms - return rcode; -} - -// -//set configuration -// - -/** - * Set the configuration for the device to use via endpoint Zero. - * - * @param addr Address of the device - * @param conf_value configuration index value - * @return status of the request, zero is success. - */ -uint8_t UHS_USB_HOST_BASE::setConf(uint8_t addr, uint8_t conf_value) { - return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000), 0x0000, NULL)); -} - -/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */ - -/** - * Writes data to an interface pipe - * - * @param addr Address of the device - * @param ep Endpoint of the pipe - * @param nbytes number of bytes to transfer - * @param data pointer to buffer to hold transfer - * @return zero for success or error code - */ -uint8_t UHS_USB_HOST_BASE::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { - UHS_EpInfo *pep = NULL; - uint16_t nak_limit = 0; - HOST_DEBUG("outTransfer: addr: 0x%2.2x ep: 0x%2.2x nbytes: 0x%4.4x data: 0x%p\r\n", addr, ep, nbytes, data); - - uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit); - HOST_DEBUG("outTransfer: SetAddress 0x%2.2x\r\n", rcode); - if(!rcode) - rcode = OutTransfer(pep, nak_limit, nbytes, data); - return rcode; -}; - -/** - * Reads data from an interface pipe - * - * @param addr Address of the device - * @param ep Endpoint of the pipe - * @param nbytesptr number of bytes to transfer - * @param data pointer to buffer to hold transfer - * @return zero for success or error code - */ -uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data) { - UHS_EpInfo *pep = NULL; - uint16_t nak_limit = 0; - - uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit); - - // if(rcode) { - // USBTRACE3("(USB::InTransfer) SetAddress Failed ", rcode, 0x81); - // USBTRACE3("(USB::InTransfer) addr requested ", addr, 0x81); - // USBTRACE3("(USB::InTransfer) ep requested ", ep, 0x81); - // return rcode; - // } - if(!rcode) - rcode = InTransfer(pep, nak_limit, nbytesptr, data); - return rcode; - -} - -/** - * Initialize the descriptor stream, works much like opening a file. - * - * @param ei - * @param ucd - * @param pep - * @param data - * @param left - * @param read - * @param offset - * @return zero for success or error code - */ -uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) { - if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT; - if(!pep) return UHS_HOST_ERROR_NULL_EPINFO; - *left = ucd->wTotalLength; - *read = 0; - *offset = 1; - uint8_t rcode; - pep->maxPktSize = ei->bMaxPacketSize0; - rcode = getone(pep, left, read, data, offset); - return rcode; -} - -uint8_t UHS_USB_HOST_BASE::getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset) { - uint16_t remain; - uint8_t ty; - uint8_t rcode = UHS_HOST_ERROR_END_OF_STREAM; - uint8_t *ptr; - uint8_t epc = 0; - ei->interface.numep = 0; - ei->interface.klass = 0; - ei->interface.subklass = 0; - ei->interface.protocol = 0; - while(*left + *read) { - remain = data[*offset]; // bLength - while(remain < 2) { - rcode = getone(pep, left, read, data, offset); - if(rcode) - return rcode; - remain = data[*offset]; - } - rcode = getone(pep, left, read, data, offset); - if(rcode) - return rcode; - ty = data[*offset]; // bDescriptorType - HOST_DEBUG("bLength: %i ", remain); - HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); - remain--; - if(ty == USB_DESCRIPTOR_INTERFACE) { - HOST_DEBUG("INTERFACE DESCRIPTOR FOUND\r\n"); - ptr = (uint8_t *)(&(ei->interface.bInterfaceNumber)); - for(int i = 0; i < 6; i++) { - rcode = getone(pep, left, read, data, offset); - if(rcode) - return rcode; - *ptr = data[*offset]; - ptr++; - } - rcode = getone(pep, left, read, data, offset); - if(rcode) - return rcode; - // Now at iInterface - // Get endpoints. - HOST_DEBUG("Getting %i endpoints\r\n", ei->interface.numep); - while(epc < ei->interface.numep) { - rcode = getone(pep, left, read, data, offset); - if(rcode) { - HOST_DEBUG("ENDPOINT DESCRIPTOR DIED WAY EARLY\r\n"); - return rcode; - } - remain = data[*offset]; // bLength - while(remain < 2) { - rcode = getone(pep, left, read, data, offset); - if(rcode) - return rcode; - remain = data[*offset]; - } - rcode = getone(pep, left, read, data, offset); - if(rcode) { - HOST_DEBUG("ENDPOINT DESCRIPTOR DIED EARLY\r\n"); - return rcode; - } - ty = data[*offset]; // bDescriptorType - HOST_DEBUG("bLength: %i ", remain); - HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); - remain -= 2; - if(ty == USB_DESCRIPTOR_ENDPOINT) { - HOST_DEBUG("ENDPOINT DESCRIPTOR: %i\r\n", epc); - ptr = (uint8_t *)(&(ei->interface.epInfo[epc].bEndpointAddress)); - for(unsigned int i = 0; i< sizeof (ENDPOINT_INFO); i++) { - rcode = getone(pep, left, read, data, offset); - if(rcode) { - HOST_DEBUG("ENDPOINT DESCRIPTOR DIED LATE\r\n"); - return rcode; - } - *ptr = data[*offset]; - ptr++; - remain--; - } - epc++; - HOST_DEBUG("ENDPOINT DESCRIPTOR OK\r\n"); - } - rcode = eat(pep, left, read, data, offset, &remain); - if(rcode) { - HOST_DEBUG("ENDPOINT DESCRIPTOR DIED EATING\r\n"); - return rcode; - } - remain = 0; - } - remain = 1; - // queue ahead, but do not report if error. - rcode = eat(pep, left, read, data, offset, &remain); - if(!ei->interface.numep && rcode) { - return rcode; - } - HOST_DEBUG("ENDPOINT DESCRIPTORS FILLED\r\n"); - return 0; - } else { - rcode = eat(pep, left, read, data, offset, &remain); - if(rcode) - return rcode; - } - rcode = UHS_HOST_ERROR_END_OF_STREAM; - } - return rcode; -} - -uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd) { - if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT; - uint8_t data[ei->bMaxPacketSize0]; - UHS_EpInfo *pep; - pep = ctrlReqOpen(ei->address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei->currentconfig, - USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); - if(!pep) return UHS_HOST_ERROR_NULL_EPINFO; - uint16_t left = ucd->wTotalLength; - uint8_t cinf = 0; - uint8_t ty; - uint8_t epc = 0; - uint16_t remain = ucd->bLength; - uint16_t read = 0; - uint8_t offset = remain; - uint8_t *ptr; - uint8_t rcode; - ei->interface.numep = 0; - ei->interface.klass = 0; - ei->interface.subklass = 0; - ei->interface.protocol = 0; - pep->maxPktSize = ei->bMaxPacketSize0; - - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - HOST_DEBUG("\r\nGetting interface: %i\r\n", inf); - inf++; - while(cinf != inf && (left + read)) { - //HOST_DEBUG("getInterface: cinf: %i inf: %i left: %i read: %i offset: %i remain %i\r\n", cinf, inf, left, read, offset, remain); - // Go past current descriptor - HOST_DEBUG("Skip: %i\r\n", remain); - rcode = eat(pep, &left, &read, data, &offset, &remain); - if(rcode) - return rcode; - remain = data[offset]; // bLength - while(remain < 2) { - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - remain = data[offset]; - } - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - ty = data[offset]; // bDescriptorType - HOST_DEBUG("bLength: %i ", remain); - HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); - remain--; - if(ty == USB_DESCRIPTOR_INTERFACE) { - HOST_DEBUG("INTERFACE DESCRIPTOR: %i\r\n", cinf); - cinf++; - if(cinf == inf) { - // Get the interface descriptor information. - ptr = (uint8_t *)(&(ei->interface.bInterfaceNumber)); - for(int i = 0; i < 6; i++) { - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - *ptr = data[offset]; - ptr++; - } - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - // Now at iInterface - remain = 0; - // Get endpoints. - HOST_DEBUG("Getting %i endpoints\r\n", ei->interface.numep); - while(epc < ei->interface.numep) { - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - remain = data[offset]; // bLength - while(remain < 2) { - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - remain = data[offset]; - } - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - ty = data[offset]; // bDescriptorType - HOST_DEBUG("bLength: %i ", remain); - HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); - remain--; - if(ty == USB_DESCRIPTOR_ENDPOINT) { - HOST_DEBUG("ENDPOINT DESCRIPTOR: %i\r\n", epc); - ptr = (uint8_t *)(&(ei->interface.epInfo[epc].bEndpointAddress)); - for(unsigned int i = 0; i< sizeof (ENDPOINT_INFO); i++) { - rcode = getone(pep, &left, &read, data, &offset); - if(rcode) - return rcode; - *ptr = data[offset]; - ptr++; - } - epc++; - remain = 0; - } else { - rcode = eat(pep, &left, &read, data, &offset, &remain); - if(rcode) - return rcode; - remain = 0; - } - } - } - } - } - - return ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei->bMaxPacketSize0, data); -} - -uint8_t UHS_USB_HOST_BASE::getone(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset) { - uint8_t rcode = 0; - *offset += 1; - if(*offset < *read) { - return 0; - } else if(*left > 0) { - // uint16_t num = *left; - uint16_t num = pep->maxPktSize; - if(num > *left) num = *left; - *offset = 0; - rcode = ctrlReqRead(pep, left, read, num, dataptr); - if(rcode == 0) { - if(*read == 0) { - rcode = UHS_HOST_ERROR_END_OF_STREAM; - } else if(*read < num) *left = 0; - } - } else { - rcode = UHS_HOST_ERROR_END_OF_STREAM; - } - return rcode; -} - -uint8_t UHS_USB_HOST_BASE::eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset, uint16_t *yum) { - uint8_t rcode = 0; - HOST_DEBUG("eating %i\r\n", *yum); - while(*yum) { - *yum -= 1; - rcode = getone(pep, left, read, dataptr, offset); - if(rcode) break; - } - return rcode; -} - -uint8_t UHS_USB_HOST_BASE::ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr) { - //bool direction = bmReqType & 0x80; //request direction, IN or OUT - uint8_t rcode = 0; - - // Serial.println(""); - UHS_EpInfo *pep = ctrlReqOpen(addr, Request, dataptr); - if(!pep) { - HOST_DEBUG("ctrlReq1: ERROR_NULL_EPINFO addr: %d\r\n", addr); - return UHS_HOST_ERROR_NULL_EPINFO; - } - uint8_t rt = (uint8_t)(Request & 0xFFU); - - // Serial.println("Opened"); - uint16_t left = (uint16_t)(Request >> 48) /*total*/; - if(dataptr != NULL) { - //data stage - if((rt & 0x80) == 0x80) { - //IN transfer - while(left) { - // Bytes read into buffer - uint16_t read = nbytes; - HOST_DEBUG("ctrlReq2: left: %i, read:%i, nbytes %i\r\n", left, read, nbytes); - rcode = ctrlReqRead(pep, &left, &read, nbytes, dataptr); - -#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - HOST_DEBUG("RESULT: 0x%2.2x 0x%2.2x 0x%2.2x 0x%8.8lx%8.8lx\r\n", rcode, addr, read, (uint32_t)((Request>>32)&0xfffffffflu), (uint32_t)(Request&0xfffffffflu)); - // Should only be used for GET_DESCRIPTOR USB_DESCRIPTOR_DEVICE - constexpr uint32_t req_match = ((uint32_t)USB_DESCRIPTOR_DEVICE << 24) | - ((uint32_t)USB_REQUEST_GET_DESCRIPTOR << 8); - const uint32_t req_found = Request & 0xFF00FF00ul; - if(!addr && read && (req_found == req_match)) { - HOST_DEBUG("ctrlReq3: acceptBuffer sz %i nbytes %i left %i\n\r", read, nbytes, left); - left = 0; - rcode = UHS_HOST_ERROR_NONE; - break; - } -#endif - if(rcode) { - return rcode; - } - } - } else { - // OUT transfer - rcode = OutTransfer(pep, 0, nbytes, dataptr); - } - if(rcode) { - //return error - return ( rcode); - } - } - - // Serial.println("Close Phase"); - // Serial.flush(); - // Status stage - rcode = ctrlReqClose(pep, rt, left, nbytes, dataptr); - // Serial.println("Closed"); - return rcode; -} - -uint8_t UHS_USB_HOST_BASE::EPClearHalt(uint8_t addr, uint8_t ep) { - return ctrlReq(addr, mkSETUP_PKT8(USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ep, 0), 0, NULL); -} - -uint8_t UHS_USB_HOST_BASE::TestInterface(ENUMERATION_INFO *ei) { - - uint8_t devConfigIndex; - uint8_t rcode = 0; - HOST_DEBUG("TestInterface VID:%4.4x PID:%4.4x Class:%2.2x Subclass:%2.2x Protocol %2.2x\r\n", ei->vid, ei->pid, ei->klass, ei->subklass, ei->protocol); - HOST_DEBUG("Interface data: Class:%2.2x Subclass:%2.2x Protocol %2.2x, number of endpoints %i\r\n", ei->interface.klass, ei->interface.subklass, ei->interface.subklass, ei->interface.numep); - HOST_DEBUG("Parent: %2.2x, bAddress: %2.2x\r\n", ei->parent, ei->address); - for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { - if(!devConfig[devConfigIndex]) { - HOST_DEBUG("No driver at index %i\r\n", devConfigIndex); - continue; // no driver - } - if(devConfig[devConfigIndex]->bAddress) { - HOST_DEBUG("Driver %i is already consumed @ %2.2x\r\n", devConfigIndex, devConfig[devConfigIndex]->bAddress); - continue; // consumed - } - - if(devConfig[devConfigIndex]->OKtoEnumerate(ei)) { - HOST_DEBUG("Driver %i supports this interface\r\n", devConfigIndex); - break; - } - } - if(devConfigIndex == UHS_HOST_MAX_INTERFACE_DRIVERS) { - rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; -#if 0 // defined(UHS_HID_LOADED) - // Check HID here, if it is, then lie - if(ei->klass == UHS_USB_CLASS_HID) { - devConfigIndex = UHS_HID_INDEX; // for debugging, otherwise this has no use. - rcode = 0; - } -#endif - } - if(!rcode) HOST_DEBUG("Driver %i can be used for this interface\r\n", devConfigIndex); - else HOST_DEBUG("No driver for this interface.\r\n"); - return rcode; -}; - -uint8_t UHS_USB_HOST_BASE::enumerateInterface(ENUMERATION_INFO *ei) { - uint8_t devConfigIndex; - - HOST_DEBUG("AttemptConfig: parent = %i, port = %i\r\n", ei->parent, ei->port); - -#if 0 // defined(UHS_HID_LOADED) - // Check HID here, if it is, then lie - if(ei->klass == UHS_USB_CLASS_HID || ei->interface.klass == UHS_USB_CLASS_HID) { - UHS_HID_SetUSBInterface(this, ENUMERATION_INFO * ei); - devConfigIndex = UHS_HID_INDEX; - } else -#endif - for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { - if(!devConfig[devConfigIndex]) { - HOST_DEBUG("No driver at index %i\r\n", devConfigIndex); - continue; // no driver - } - if(devConfig[devConfigIndex]->bAddress) { - HOST_DEBUG("Driver %i is already consumed @ %2.2x\r\n", devConfigIndex, devConfig[devConfigIndex]->bAddress); - continue; // consumed - } - - if(devConfig[devConfigIndex]->OKtoEnumerate(ei)) { - HOST_DEBUG("Driver %i supports this interface\r\n", devConfigIndex); - if(!devConfig[devConfigIndex]->SetInterface(ei)) break; - else devConfigIndex = UHS_HOST_MAX_INTERFACE_DRIVERS; - } - } - return devConfigIndex; -}; - - -//////////////////////////////////////////////////////////////////////////////// -// Vendor Specific Interface Class -//////////////////////////////////////////////////////////////////////////////// - -#if 0 -/** - * Might go away, depends on if it is useful, or not. - * - * @param ei Enumeration information - * @return true if this interface driver can handle this interface description - */ -bool UHS_NI UHS_VSI::OKtoEnumerate(ENUMERATION_INFO *ei) { - return ( - (ei->subklass == UHS_USB_CLASS_VENDOR_SPECIFIC) || - (ei->interface.subklass == UHS_USB_CLASS_VENDOR_SPECIFIC) - ); -} - -/** - * Copy the entire ENUMERATION_INFO structure - * @param ei Enumeration information - * @return 0 - */ -uint8_t UHS_NI UHS_VSI::SetInterface(ENUMERATION_INFO *ei) { - bNumEP = 1; - bAddress = ei->address; - - eInfo.address = ei->address; - eInfo.bMaxPacketSize0 = ei->bMaxPacketSize0; - eInfo.currentconfig = ei->currentconfig; - eInfo.interface.bAlternateSetting = ei->interface.bAlternateSetting; - eInfo.interface.bInterfaceNumber = ei->interface.bInterfaceNumber; - eInfo.interface.numep = ei->interface.numep; - eInfo.interface.protocol = ei->interface.protocol; - eInfo.interface.subklass = ei->interface.subklass; - eInfo.klass = ei->klass; - eInfo.parent = ei->parent; - eInfo.pid = ei->pid; - eInfo.port = ei->port; - eInfo.protocol = ei->protocol; - eInfo.subklass = ei->subklass; - eInfo.vid = ei->vid; - for(uint8_t i = 0; i < eInfo.interface.numep; i++) { - eInfo.interface.epInfo[i].bEndpointAddress = ei->interface.epInfo[i].bEndpointAddress; - eInfo.interface.epInfo[i].bInterval = ei->interface.epInfo[i].bInterval; - eInfo.interface.epInfo[i].bmAttributes = ei->interface.epInfo[i].bmAttributes; - eInfo.interface.epInfo[i].wMaxPacketSize = ei->interface.epInfo[i].wMaxPacketSize; - } - return 0; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - - -#if 0 - -/* TO-DO: Move this silliness to a NONE driver. - * When we have a generic NONE driver we can: - * o Extract ALL device information to help users with a new device. - * o Use an unknown device from a sketch, kind of like usblib does. - * This will aid in making more drivers in a faster way. - */ -uint8_t UHS_USB_HOST_BASE::DefaultAddressing(uint8_t parent, uint8_t port, uint8_t speed) { - uint8_t rcode; - UHS_Device *p0 = NULL, *p = NULL; - - // Get pointer to pseudo device with address 0 assigned - p0 = addrPool.GetUsbDevicePtr(0); - - if(!p0) - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - - if(!p0->epinfo) - return UHS_HOST_ERROR_NULL_EPINFO; - - p0->speed = speed; - - // Allocate new address according to device class - uint8_t bAddress = addrPool.AllocAddress(parent, false, port); - - if(!bAddress) - return UHS_HOST_ERROR_ADDRESS_POOL_FULL; - - p = addrPool.GetUsbDevicePtr(bAddress); - - if(!p) - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - - p->speed = speed; - - // Assign new address to the device - rcode = setAddr(0, bAddress); - - if(rcode) { - addrPool.FreeAddress(bAddress); - bAddress = 0; - return rcode; - } - return 0; -} -#endif - -#else -#error "Never include UHS_host_INLINE.h, include UHS_host.h instead" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h deleted file mode 100644 index 9c94e4d0ee..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ /dev/null @@ -1,392 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef MACROS_H -#define MACROS_H -#include "macro_logic.h" -/* - * Universal Arduino(tm) "IDE" fixups. - */ - - -// Just in case... -#ifndef SERIAL_PORT_MONITOR -#define SERIAL_PORT_MONITOR Serial -#endif - -#ifndef INT16_MIN -#define INT16_MIN -32768 -#endif -// require 10607+ -#if defined(ARDUINO) && ARDUINO >=10607 -// nop :-) -#else -#error "Arduino version too old, and must be at least 1.6.7" -#endif - -// Nuke screwed up macro junk from the IDE. -#ifdef __cplusplus -#ifdef true -#undef true -#endif -#ifdef false -#undef false -#endif -#endif - - -#ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE - -#ifndef UHS_BIG_FLASH - -#if defined(FLASHEND) && defined(FLASHSTART) -#if (FLASHEND - FLASHSTART) > 0x0FFFFU -#define UHS_BIG_FLASH 1 -#else -#define UHS_BIG_FLASH 0 -#endif - -#elif defined(__PIC32_FLASH_SIZE) -#if __PIC32_FLASH_SIZE > 511 -#define UHS_BIG_FLASH 1 -#else -#define UHS_BIG_FLASH 0 -#endif - -#elif defined(FLASHEND) && !defined(FLASHSTART) -// Assumes flash starts at 0x00000, is this a safe assumption? -// 192K + should be OK -#if FLASHEND > 0x02FFFFU -#define UHS_BIG_FLASH 1 -#else -#define UHS_BIG_FLASH 0 -#endif - -#elif defined(IFLASH_SIZE) -#if IFLASH_SIZE > 0x0FFFFU -#define UHS_BIG_FLASH 1 -#else -#define UHS_BIG_FLASH 0 -#endif - -#elif defined(ESP8266) -#define UHS_BIG_FLASH 1 -#define SYSTEM_OR_SPECIAL_YIELD(...) yield() - -#elif defined(__arm__) && defined(CORE_TEENSY) -#define UHS_BIG_FLASH 1 - -#elif defined(ARDUINO_spresense_ast) -#define UHS_BIG_FLASH 1 -#else -// safe default -#warning Small flash? -#define UHS_BIG_FLASH 0 -#endif -#endif - -#if UHS_BIG_FLASH -#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1 -#else -#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 0 -#endif -#endif - -#if defined(__arm__) && defined(CORE_TEENSY) -#define UHS_PIN_WRITE(p, v) digitalWriteFast(p, v) -#define UHS_PIN_READ(p) digitalReadFast(p) -#endif -// 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. -#ifndef UHS_PIN_WRITE -#define UHS_PIN_WRITE(p, v) digitalWrite(p, v) -#endif -#ifndef UHS_PIN_READ -#define UHS_PIN_READ(p) digitalRead(p) -#endif - -#if defined( __PIC32MX__ ) && !defined(interrupts) // compiling with Microchip XC32 compiler -#define interrupts() __builtin_enable_interrupts() -#edfine noInterrupts() __builtin_disable_interrupts() -#endif - -#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) -#endif -#else -#define UHS_GET_DPI(x) (x) -#endif - -#ifndef __AVR__ -#ifndef __PGMSPACE_H_ -// This define should prevent reading the system pgmspace.h if included elsewhere -// This is not normally needed. -#define __PGMSPACE_H_ 1 -#endif - -#ifndef PROGMEM -#define PROGMEM -#endif -#ifndef PGM_P -#define PGM_P const char * -#endif -#ifndef PSTR -#define PSTR(str) (str) -#endif -#ifndef F -#define F(str) (str) -#endif -#ifndef _SFR_BYTE -#define _SFR_BYTE(n) (n) -#endif -#ifndef memchr_P -#define memchr_P(str, c, len) memchr((str), (c), (len)) -#endif -#ifndef memcmp_P -#define memcmp_P(a, b, n) memcmp((a), (b), (n)) -#endif -#ifndef memcpy_P -#define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) -#endif -#ifndef memmem_P -#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen)) -#endif -#ifndef memrchr_P -#define memrchr_P(str, val, len) memrchr((str), (val), (len)) -#endif -#ifndef strcat_P -#define strcat_P(dest, src) strcat((dest), (src)) -#endif -#ifndef strchr_P -#define strchr_P(str, c) strchr((str), (c)) -#endif -#ifndef strchrnul_P -#define strchrnul_P(str, c) strchrnul((str), (c)) -#endif -#ifndef strcmp_P -#define strcmp_P(a, b) strcmp((a), (b)) -#endif -#ifndef strcpy_P -#define strcpy_P(dest, src) strcpy((dest), (src)) -#endif -#ifndef strcasecmp_P -#define strcasecmp_P(a, b) strcasecmp((a), (b)) -#endif -#ifndef strcasestr_P -#define strcasestr_P(a, b) strcasestr((a), (b)) -#endif -#ifndef strlcat_P -#define strlcat_P(dest, src, len) strlcat((dest), (src), (len)) -#endif -#ifndef strlcpy_P -#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len)) -#endif -#ifndef strlen_P -#define strlen_P(s) strlen((const char *)(s)) -#endif -#ifndef strnlen_P -#define strnlen_P(str, len) strnlen((str), (len)) -#endif -#ifndef strncmp_P -#define strncmp_P(a, b, n) strncmp((a), (b), (n)) -#endif -#ifndef strncasecmp_P -#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n)) -#endif -#ifndef strncat_P -#define strncat_P(a, b, n) strncat((a), (b), (n)) -#endif -#ifndef strncpy_P -#define strncpy_P(a, b, n) strncmp((a), (b), (n)) -#endif -#ifndef strpbrk_P -#define strpbrk_P(str, chrs) strpbrk((str), (chrs)) -#endif -#ifndef strrchr_P -#define strrchr_P(str, c) strrchr((str), (c)) -#endif -#ifndef strsep_P -#define strsep_P(strp, delim) strsep((strp), (delim)) -#endif -#ifndef strspn_P -#define strspn_P(str, chrs) strspn((str), (chrs)) -#endif -#ifndef strstr_P -#define strstr_P(a, b) strstr((a), (b)) -#endif -#ifndef sprintf_P -#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__) -#endif -#ifndef vfprintf_P -#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__) -#endif -#ifndef printf_P -#define printf_P(...) printf(__VA_ARGS__) -#endif -#ifndef snprintf_P -#define snprintf_P(s, n, ...) ((s), (n), __VA_ARGS__) -#endif -#ifndef vsprintf_P -#define vsprintf_P(s, ...) ((s),__VA_ARGS__) -#endif -#ifndef vsnprintf_P -#define vsnprintf_P(s, n, ...) ((s), (n),__VA_ARGS__) -#endif -#ifndef fprintf_P -#define fprintf_P(s, ...) ((s), __VA_ARGS__) -#endif - -#ifndef pgm_read_byte -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#endif -#ifndef pgm_read_word -#define pgm_read_word(addr) (*(const unsigned short *)(addr)) -#endif -#ifndef pgm_read_dword -#define pgm_read_dword(addr) (*(const unsigned long *)(addr)) -#endif -#ifndef pgm_read_float -#define pgm_read_float(addr) (*(const float *)(addr)) -#endif - -#ifndef pgm_read_byte_near -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#endif -#ifndef pgm_read_word_near -#define pgm_read_word_near(addr) pgm_read_word(addr) -#endif -#ifndef pgm_read_dword_near -#define pgm_read_dword_near(addr) pgm_read_dword(addr) -#endif -#ifndef pgm_read_float_near -#define pgm_read_float_near(addr) pgm_read_float(addr) -#endif -#ifndef pgm_read_byte_far -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#endif -#ifndef pgm_read_word_far -#define pgm_read_word_far(addr) pgm_read_word(addr) -#endif -#ifndef pgm_read_dword_far -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#endif -#ifndef pgm_read_float_far -#define pgm_read_float_far(addr) pgm_read_float(addr) -#endif - -#ifndef pgm_read_pointer -#define pgm_read_pointer -#endif - -#endif - - -//////////////////////////////////////////////////////////////////////////////// -// HANDY MACROS -//////////////////////////////////////////////////////////////////////////////// - -// Atmoically set/clear single bits using bitbands. -// Believe it or not, this boils down to a constant, -// and is less code than using |= &= operators. -// Bonus, it makes code easier to read too. -// Bitbanding is a wonderful thing. -#define BITNR(i) (i&0x1?0:i&0x2?1:i&0x4?2:i&0x8?3:i&0x10?4:i&0x20?5:i&0x40?6:i&0x80?7:i&0x100?8:i&0x200?9:i&0x400?10:i&0x800?11:i&0x1000?12:i&0x2000?13:i&0x4000?14:i&0x8000?15:i&0x10000?16:i&0x20000?17:i&0x40000?18:i&0x80000?19:i&0x100000?20:i&0x200000?21:i&0x400000?22:i&0x800000?23:i&0x1000000?24:i&0x2000000?25:i&0x4000000?26:i&0x8000000?27:i&0x10000000?28:i&0x20000000?29:i&0x40000000?30:i&0x80000000?31:32) -#define UHS_KIO_BITBAND_ADDR(r, i) (((uint32_t)&(r) - 0x40000000) * 32 + (i) * 4 + 0x42000000) -#define UHS_KIO_SETBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 1 -#define UHS_KIO_CLRBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 0 - - -#define VALUE_BETWEEN(v,l,h) (((v)>(l)) && ((v)<(h))) -#define VALUE_WITHIN(v,l,h) (((v)>=(l)) && ((v)<=(h))) -#define output_pgm_message(wa,fp,mp,el) wa = &mp, fp((char *)pgm_read_pointer(wa), el) -#define output_if_between(v,l,h,wa,fp,mp,el) if(VALUE_BETWEEN(v,l,h)) output_pgm_message(wa,fp,mp[v-(l+1)],el); - -#define UHS_SWAP_VALUES(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) -#ifndef __BYTE_GRABBING_DEFINED__ -#define __BYTE_GRABBING_DEFINED__ 1 -#ifdef BROKEN_OPTIMIZER_LITTLE_ENDIAN -// Note: Use this if your compiler generates horrible assembler! -#define UHS_UINT8_BYTE0(__usi__) (((uint8_t *)&(__usi__))[0]) -#define UHS_UINT8_BYTE1(__usi__) (((uint8_t *)&(__usi__))[1]) -#define UHS_UINT8_BYTE2(__usi__) (((uint8_t *)&(__usi__))[2]) -#define UHS_UINT8_BYTE3(__usi__) (((uint8_t *)&(__usi__))[3]) -#define UHS_UINT8_BYTE4(__usi__) (((uint8_t *)&(__usi__))[4]) -#define UHS_UINT8_BYTE5(__usi__) (((uint8_t *)&(__usi__))[5]) -#define UHS_UINT8_BYTE6(__usi__) (((uint8_t *)&(__usi__))[6]) -#define UHS_UINT8_BYTE7(__usi__) (((uint8_t *)&(__usi__))[7]) -#else -// Note: The cast alone to uint8_t is actually enough. -// GCC throws out the "& 0xff", and the size is no different. -// Some compilers need it. -#define UHS_UINT8_BYTE0(__usi__) ((uint8_t)((__usi__) & 0xff )) -#define UHS_UINT8_BYTE1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xff)) -#define UHS_UINT8_BYTE2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xff)) -#define UHS_UINT8_BYTE3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xff)) -#define UHS_UINT8_BYTE4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xff)) -#define UHS_UINT8_BYTE5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xff)) -#define UHS_UINT8_BYTE6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xff)) -#define UHS_UINT8_BYTE7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xff)) -#endif -#define UHS_UINT16_SET_BYTE1(__usi__) ((uint16_t)(__usi__) << 8) -#define UHS_UINT32_SET_BYTE1(__usi__) ((uint32_t)(__usi__) << 8) -#define UHS_UINT64_SET_BYTE1(__usi__) ((uint64_t)(__usi__) << 8) -#define UHS_UINT32_SET_BYTE2(__usi__) ((uint32_t)(__usi__) << 16) -#define UHS_UINT64_SET_BYTE2(__usi__) ((uint64_t)(__usi__) << 16) -#define UHS_UINT32_SET_BYTE3(__usi__) ((uint32_t)(__usi__) << 24) -#define UHS_UINT64_SET_BYTE3(__usi__) ((uint64_t)(__usi__) << 24) -#define UHS_UINT64_SET_BYTE4(__usi__) ((uint64_t)(__usi__) << 32) -#define UHS_UINT64_SET_BYTE5(__usi__) ((uint64_t)(__usi__) << 40) -#define UHS_UINT64_SET_BYTE6(__usi__) ((uint64_t)(__usi__) << 48) -#define UHS_UINT64_SET_BYTE7(__usi__) ((uint64_t)(__usi__) << 56) - -// These are the smallest and fastest ways I have found so far in pure C/C++. -#define UHS_BYTES_TO_UINT16(__usc1__,__usc0__) ((uint16_t)((uint16_t)(__usc0__) | (uint16_t)UHS_UINT16_SET_BYTE1(__usc1__))) -#define UHS_BYTES_TO_UINT32(__usc3__,__usc2__,__usc1__,__usc0__) ((uint32_t)((uint32_t)(__usc0__) | UHS_UINT32_SET_BYTE1(__usc1__) | UHS_UINT32_SET_BYTE2(__usc2__) | UHS_UINT32_SET_BYTE3(__usc3__))) -#define UHS_BYTES_TO_UINT64(__usc7__,__usc6__,__usc5__,__usc4__,__usc3__,__usc2__,__usc1__,__usc0__) ((uint64_t)((uint64_t)__usc0__ | UHS_UINT64_SET_BYTE1(__usc1__) | UHS_UINT64_SET_BYTE2(__usc2__) | UHS_UINT64_SET_BYTE3(__usc3__) | UHS_UINT64_SET_BYTE4(__usc4__) | UHS_UINT64_SET_BYTE5(__usc5__) | UHS_UINT64_SET_BYTE6(__usc6__) | UHS_UINT64_SET_BYTE7(__usc7__))) -#endif -/* - * Debug macros. - * Useful when porting from UHS2. - * Do not use these for any new code. - * Change to better debugging after port is completed. - * Strings are stored in progmem (flash) instead of RAM. - */ -#define USBTRACE1(s,l) (Notify(PSTR(s), l)) -#define USBTRACE(s) (USBTRACE1((s), 0x80)); USB_HOST_SERIAL.flush() -#define USBTRACE3(s,r,l) (Notify(PSTR(s), l), D_PrintHex((r), l), Notify(PSTR("\r\n"), l)) -#define USBTRACE3X(s,r,l) (Notify(PSTR(s), l), D_PrintHex((r), l)) -#define USBTRACE2(s,r) (USBTRACE3((s),(r),0x80)); USB_HOST_SERIAL.flush() -#define USBTRACE2X(s,r) (USBTRACE3X((s),(r),0x80)); USB_HOST_SERIAL.flush() - -#define VOID0 ((void)0) -#ifndef NOTUSED -#define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) -#endif -#endif /* MACROS_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h deleted file mode 100644 index f5ed3d8b40..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ -#if !defined(_UHS_host_h_) || defined(__MESSAGE_H__) -#error "Never include UHS_message.h directly; include UHS_Usb.h instead" -#else -#define __MESSAGE_H__ - -extern int UsbDEBUGlvl; - -void E_Notify(char const * msg, int lvl); -void E_Notify(uint8_t b, int lvl); -void E_NotifyStr(char const * msg, int lvl); -void E_Notifyc(char c, int lvl); - -#ifdef DEBUG_USB_HOST -#define Notify E_Notify -#define NotifyStr E_NotifyStr -#define Notifyc E_Notifyc -void NotifyFailGetDevDescr(uint8_t reason); -void NotifyFailSetDevTblEntry(uint8_t reason); -void NotifyFailGetConfDescr(uint8_t reason); -void NotifyFailSetConfDescr(uint8_t reason); -void NotifyFailGetDevDescr(); -void NotifyFailSetDevTblEntry(); -void NotifyFailGetConfDescr(); -void NotifyFailSetConfDescr(); -void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); -void NotifyFail(uint8_t rcode); -#else -#define Notify(...) VOID0 -#define NotifyStr(...) VOID0 -#define Notifyc(...) VOID0 -#define NotifyFailGetDevDescr(...) VOID0 -#define NotifyFailSetDevTblEntry(...) VOID0 -#define NotifyFailGetConfDescr(...) VOID0 -#define NotifyFailGetDevDescr(...) VOID0 -#define NotifyFailSetDevTblEntry(...) VOID0 -#define NotifyFailGetConfDescr(...) VOID0 -#define NotifyFailSetConfDescr(...) VOID0 -#define NotifyFailUnknownDevice(...) VOID0 -#define NotifyFail(...) VOID0 -#endif - -#ifdef DEBUG_USB_HOST -template void ErrorMessage(uint8_t level, char const * msg, ERROR_TYPE rcode = 0) { - Notify(msg, level); - Notify(PSTR(": "), level); - D_PrintHex (rcode, level); - Notify(PSTR("\r\n"), level); -#else -template void ErrorMessage(NOTUSED(uint8_t level), NOTUSED(char const * msg), ERROR_TYPE rcode = 0) { - (void)rcode; -#endif -} - -#ifdef DEBUG_USB_HOST -template void ErrorMessage(char const * msg, ERROR_TYPE rcode = 0) { - Notify(msg, 0x80); - Notify(PSTR(": "), 0x80); - D_PrintHex (rcode, 0x80); - Notify(PSTR("\r\n"), 0x80); -#else -template void ErrorMessage(NOTUSED(char const * msg), ERROR_TYPE rcode = 0) { - (void)rcode; -#endif -} - -#endif // __MESSAGE_H__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h deleted file mode 100644 index 4b8d387d27..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef UHS_PRINTF_HELPER_H -#define UHS_PRINTF_HELPER_H - -#ifdef LOAD_UHS_PRINTF_HELPER -#include -#ifdef true -#undef true -#endif -#ifdef false -#undef false -#endif - -#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 - -#ifndef STDIO_IS_OK_TO_USE_AS_IS -// We need to patch STDIO so it can be used. - -#ifndef SERIAL_PORT_MONITOR -// Some don't define this. -#define SERIAL_PORT_MONITOR Serial -#endif - -#ifndef SERIAL_PORT_HARDWARE -// Some don't define this. -#define SERIAL_PORT_HARDWARE SERIAL_PORT_MONITOR -#endif - -#ifndef USB_HOST_SERIAL -#if defined(SERIAL_PORT_USBVIRTUAL) && defined(LOAD_UHS_KINETIS_FS_HOST) -#define USB_HOST_SERIAL SERIAL_PORT_HARDWARE -#else -#define USB_HOST_SERIAL SERIAL_PORT_MONITOR -#endif -#endif - -#ifndef NOTUSED -#define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) -#endif - -#ifndef __AVR__ -#ifndef printf_P -#define printf_P(...) printf(__VA_ARGS__) -#endif -#endif - -#ifdef ARDUINO_ARCH_PIC32 -/* - * For printf() output with pic32 Arduino - */ -extern "C" { - - void _mon_putc(char s) { - USB_HOST_SERIAL.write(s); - } - - int _mon_getc() { - while(!USB_HOST_SERIAL.available()); - return USB_HOST_SERIAL.read(); - } -} - -#elif defined(__AVR__) -extern "C" { - - static FILE tty_stdio; - static FILE tty_stderr; - - static int NOTUSED(tty_stderr_putc(char c, NOTUSED(FILE *t))); - static int NOTUSED(tty_stderr_flush(NOTUSED(FILE *t))); - static int NOTUSED(tty_std_putc(char c, NOTUSED(FILE *t))); - static int NOTUSED(tty_std_getc(NOTUSED(FILE *t))); - static int NOTUSED(tty_std_flush(NOTUSED(FILE *t))); - - static int tty_stderr_putc(char c, NOTUSED(FILE *t)) { - USB_HOST_SERIAL.write(c); - return 0; - } - - static int tty_stderr_flush(NOTUSED(FILE *t)) { - USB_HOST_SERIAL.flush(); - return 0; - } - - static int tty_std_putc(char c, NOTUSED(FILE *t)) { - USB_HOST_SERIAL.write(c); - return 0; - } - - static int tty_std_getc(NOTUSED(FILE *t)) { - while(!USB_HOST_SERIAL.available()); - return USB_HOST_SERIAL.read(); - } - - static int tty_std_flush(NOTUSED(FILE *t)) { - USB_HOST_SERIAL.flush(); - return 0; - } -} -#elif defined(CORE_TEENSY) -extern "C" { - - int _write(int fd, const char *ptr, int len) { - int j; - for(j = 0; j < len; j++) { - if(fd == 1) - USB_HOST_SERIAL.write(*ptr++); - else if(fd == 2) - USB_HOST_SERIAL.write(*ptr++); - } - return len; - } - - int _read(int fd, char *ptr, int len) { - if(len > 0 && fd == 0) { - while(!USB_HOST_SERIAL.available()); - *ptr = USB_HOST_SERIAL.read(); - return 1; - } - return 0; - } - -#include - - int _fstat(int fd, struct stat *st) { - memset(st, 0, sizeof (*st)); - st->st_mode = S_IFCHR; - st->st_blksize = 1024; - return 0; - } - - int _isatty(int fd) { - return (fd < 3) ? 1 : 0; - } -} -#else -#error no STDIO -#endif // defined(ARDUINO_ARCH_PIC32) - - - -#ifdef __AVR__ -// The only wierdo in the bunch... -void UHS_AVR_printf_HELPER_init() { - // Set up stdio/stderr - tty_stdio.put = tty_std_putc; - tty_stdio.get = tty_std_getc; - tty_stdio.flags = _FDEV_SETUP_RW; - tty_stdio.udata = 0; - - tty_stderr.put = tty_stderr_putc; - tty_stderr.get = NULL; - tty_stderr.flags = _FDEV_SETUP_WRITE; - tty_stderr.udata = 0; - - stdout = &tty_stdio; - stdin = &tty_stdio; - stderr = &tty_stderr; - -} -#define UHS_printf_HELPER_init() UHS_AVR_printf_HELPER_init() -#endif - -#endif /* STDIO_IS_OK_TO_USE_AS_IS */ -#endif /* load.... */ - -#ifndef UHS_printf_HELPER_init -#define UHS_printf_HELPER_init() (void(0)) -#endif -#endif /* UHS_PRINTF_HELPER_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h deleted file mode 100644 index 09e3365107..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if !defined(_UHS_host_h_) || defined(__PRINTHEX_H__) -#error "Never include UHS_printhex.h directly; include UHS_Usb.h instead" -#else -#define __PRINTHEX_H__ - -void E_Notifyc(char c, int lvl); - -template -void PrintHex(T val, int lvl) { - int num_nibbles = sizeof (T) * 2; - - do { - char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); - if(v > 57) v += 7; - E_Notifyc(v, lvl); - } while(--num_nibbles); -} - -template -void PrintBin(T val, int lvl) { - for(T mask = (((T)1) << ((sizeof (T) << 3) - 1)); mask; mask >>= 1) - if(val & mask) - E_Notifyc('1', lvl); - else - E_Notifyc('0', lvl); -} - -template -void SerialPrintHex(T val) { - int num_nibbles = sizeof (T) * 2; - - do { - char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); - if(v > 57) v += 7; - USB_HOST_SERIAL.print(v); - } while(--num_nibbles); -} - -template -void PrintHex2(Print *prn, T val) { - T mask = (((T)1) << (((sizeof (T) << 1) - 1) << 2)); - - while(mask > 1) { - if(val < mask) - prn->print("0"); - - mask >>= 4; - } - prn->print((T)val, HEX); -} - -#ifdef DEBUG_USB_HOST -template void D_PrintHex(T val, int lvl) { - PrintHex (val, lvl); -#else -template void D_PrintHex(NOTUSED(T val), NOTUSED(int lvl)) { -#endif -} - -#ifdef DEBUG_USB_HOST -template void D_PrintBin(T val, int lvl) { - PrintBin (val, lvl); -#else -template void D_PrintBin(NOTUSED(T val), NOTUSED(int lvl)) { -#endif -} - - - -#endif // __PRINTHEX_H__ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h deleted file mode 100644 index a401c28516..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef UHS_SETTINGS_H -#define UHS_SETTINGS_H - -// TO-DO: Move specific settings to modules which use them. - -//////////////////////////////////////////////////////////////////////////////// -// Define any of these options at the top of your sketch to override -// the defaults contained herewith. Do NOT do modifications here. -// Individual Components have their own settings. -// -// Macro | Settings and notes | Default -// -----------------------------+-----------------------+----------------------- -// | Any class that does | -// USB_HOST_SERIAL | text streaming | SERIAL_PORT_MONITOR -// | e.g. Serial2 | -// -----------------------------+-----------------------+----------------------- -// ENABLE_UHS_DEBUGGING | 0 = off, 1 = on | 0 -// -----------------------------+-----------------------+----------------------- -// | 0 = off, 1 = on | -// | Caution! Can make | -// DEBUG_PRINTF_EXTRA_HUGE | program too large! | 0 -// | Other modules depend | -// | on this setting. | -// -----------------------------+-----------------------+----------------------- -// USE_UHS_BLACK_WIDDOW | 0 = no, 1 = yes | 0 -// -----------------------------+-----------------------+----------------------- -// ENABLE_WII_IR_CAMERA | 0 = no, 1 = yes | 0 -// -----------------------------^-----------------------^----------------------- -// -//////////////////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////////////// -// DEBUGGING -//////////////////////////////////////////////////////////////////////////////// - -#ifndef USB_HOST_SERIAL -#if defined(SERIAL_PORT_USBVIRTUAL) && defined(LOAD_UHS_KINETIS_FS_HOST) -#define USB_HOST_SERIAL SERIAL_PORT_HARDWARE -#else -#define USB_HOST_SERIAL SERIAL_PORT_MONITOR -#endif -#endif - -#ifndef ENABLE_UHS_DEBUGGING -#define ENABLE_UHS_DEBUGGING 0 -#endif - -#ifndef DEBUG_PRINTF_EXTRA_HUGE -#define DEBUG_PRINTF_EXTRA_HUGE 0 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Manual board activation -//////////////////////////////////////////////////////////////////////////////// - -/* Set this to 1 if you are using a Black Widdow */ -#ifndef USE_UHS_BLACK_WIDDOW -#define USE_UHS_BLACK_WIDDOW 0 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Wii IR camera -//////////////////////////////////////////////////////////////////////////////// - -/* Set this to 1 to activate code for the Wii IR camera */ -#ifndef ENABLE_WII_IR_CAMERA -#define ENABLE_WII_IR_CAMERA 0 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Set to 1 to use the faster spi4teensy3 driver. (not used yet)) -//////////////////////////////////////////////////////////////////////////////// -#ifndef USE_SPI4TEENSY3 -#define USE_SPI4TEENSY3 0 -#endif - -//////////////////////////////////////////////////////////////////////////////// -// AUTOMATIC Settings -//////////////////////////////////////////////////////////////////////////////// - -// No user serviceable parts below this line. -// DO NOT change anything below here unless you are a developer! - -#if defined(__GNUC__) && defined(__AVR__) -#ifndef GCC_VERSION -#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#endif -#if GCC_VERSION < 40602 // Test for GCC < 4.6.2 -#ifdef PROGMEM -#undef PROGMEM -#define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4 -#ifdef PSTR -#undef PSTR -#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source -#endif -#endif -#endif -#endif - -#if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING -#define DEBUG_USB_HOST -#endif - -#if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA -#define WIICAMERA -#endif - -#define UHS_SLEEP_MS(v) pUsb->sof_delay(v) - -#ifndef UHS_NI -#define UHS_NI __attribute__((noinline)) -#endif - -#endif /* SETTINGS_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h deleted file mode 100644 index 34b8ad72e7..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h +++ /dev/null @@ -1,222 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if !defined(_UHS_host_h_) || defined(_UHS_ch9_h_) -#error "Never include UHS_usb_ch9.h directly; include UHS_Usb.h instead" -#else - -/* USB chapter 9 structures */ -#define _UHS_ch9_h_ - -/* Misc.USB constants */ -#define DEV_DESCR_LEN 18 //device descriptor length -#define CONF_DESCR_LEN 9 //configuration descriptor length -#define INTR_DESCR_LEN 9 //interface descriptor length -#define EP_DESCR_LEN 7 //endpoint descriptor length - -/* Standard Device Requests */ -#define USB_REQUEST_GET_STATUS 0 // Standard Device Request - GET STATUS -#define USB_REQUEST_CLEAR_FEATURE 1 // Standard Device Request - CLEAR FEATURE -#define USB_REQUEST_SET_FEATURE 3 // Standard Device Request - SET FEATURE -#define USB_REQUEST_SET_ADDRESS 5 // Standard Device Request - SET ADDRESS -#define USB_REQUEST_GET_DESCRIPTOR 6 // Standard Device Request - GET DESCRIPTOR -#define USB_REQUEST_SET_DESCRIPTOR 7 // Standard Device Request - SET DESCRIPTOR -#define USB_REQUEST_GET_CONFIGURATION 8 // Standard Device Request - GET CONFIGURATION -#define USB_REQUEST_SET_CONFIGURATION 9 // Standard Device Request - SET CONFIGURATION -#define USB_REQUEST_GET_INTERFACE 10 // Standard Device Request - GET INTERFACE -#define USB_REQUEST_SET_INTERFACE 11 // Standard Device Request - SET INTERFACE -#define USB_REQUEST_SYNCH_FRAME 12 // Standard Device Request - SYNCH FRAME - -/* Wireless USB Device Requests */ -#define USB_REQ_SET_ENCRYPTION 0x0D -#define USB_REQ_GET_ENCRYPTION 0x0E -#define USB_REQ_RPIPE_ABORT 0x0E -#define USB_REQ_SET_HANDSHAKE 0x0F -#define USB_REQ_RPIPE_RESET 0x0F -#define USB_REQ_GET_HANDSHAKE 0x10 -#define USB_REQ_SET_CONNECTION 0x11 -#define USB_REQ_SET_SECURITY_DATA 0x12 -#define USB_REQ_GET_SECURITY_DATA 0x13 -#define USB_REQ_SET_WUSB_DATA 0x14 -#define USB_REQ_LOOPBACK_DATA_WRITE 0x15 -#define USB_REQ_LOOPBACK_DATA_READ 0x16 -#define USB_REQ_SET_INTERFACE_DS 0x17 - -/* USB feature flags */ -#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ -#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ -#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ -#define USB_DEVICE_BATTERY 2 /* (wireless) */ -#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ -#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ -#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ -#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ -#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ - -#define USB_FEATURE_ENDPOINT_HALT 0 // CLEAR/SET FEATURE - Endpoint Halt -#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // CLEAR/SET FEATURE - Device remote wake-up -#define USB_FEATURE_TEST_MODE 2 // CLEAR/SET FEATURE - Test mode -/* OTG SET FEATURE Constants */ -#define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP -#define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP -#define OTG_FEATURE_A_ALT_HNP_SUPPORT 5 // SET FEATURE OTG - Another port on the A device supports HNP - -/* Setup Data Constants */ -#define USB_SETUP_HOST_TO_DEVICE 0x00 // Device Request bmRequestType transfer direction - host to device transfer -#define USB_SETUP_DEVICE_TO_HOST 0x80 // Device Request bmRequestType transfer direction - device to host transfer -#define USB_SETUP_TYPE_STANDARD 0x00 // Device Request bmRequestType type - standard -#define USB_SETUP_TYPE_CLASS 0x20 // Device Request bmRequestType type - class -#define USB_SETUP_TYPE_VENDOR 0x40 // Device Request bmRequestType type - vendor -#define USB_SETUP_RECIPIENT_DEVICE 0x00 // Device Request bmRequestType recipient - device -#define USB_SETUP_RECIPIENT_INTERFACE 0x01 // Device Request bmRequestType recipient - interface -#define USB_SETUP_RECIPIENT_ENDPOINT 0x02 // Device Request bmRequestType recipient - endpoint -#define USB_SETUP_RECIPIENT_OTHER 0x03 // Device Request bmRequestType recipient - other -#define USB_SETUP_RECIPIENT_PORT 0x04 // Wireless USB 1.0 -#define USB_SETUP_RECIPIENT_RPIPE 0x05 // Wireless USB 1.0 - - -/* USB descriptors */ -#define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor. -#define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor. -#define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor. -#define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor. -#define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor. -#define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier. -#define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration. -#define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power. -#define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor. -#define USB_DESCRIPTOR_DEBUG 0x0a -#define USB_DESCRIPTOR_INTERFACE_ASSOCIATION 0x0b -#define USB_DESCRIPTOR_SECURITY 0x0c -#define USB_DESCRIPTOR_KEY 0x0d -#define USB_DESCRIPTOR_ENCRYPTION_TYPE 0x0e -#define USB_DESCRIPTOR_BOS 0x0f -#define USB_DESCRIPTOR_DEVICE_CAPABILITY 0x10 -#define USB_DESCRIPTOR_WIRELESS_ENDPOINT_COMP 0x11 -#define USB_DESCRIPTOR_WIRE_ADAPTER 0x21 -#define USB_DESCRIPTOR_RPIPE 0x22 -#define USB_DESCRIPTOR_CS_RADIO_CONTROL 0x23 -#define USB_DESCRIPTOR_SS_ENDPOINT_COMP 0x30 - -#define USB_HID_DESCRIPTOR 0x21 - - -// Conventional codes for class-specific descriptors. "Common Class" Spec (3.11) -#define USB_DESCRIPTOR_CS_DEVICE 0x21 -#define USB_DESCRIPTOR_CS_CONFIG 0x22 -#define USB_DESCRIPTOR_CS_STRING 0x23 -#define USB_DESCRIPTOR_CS_INTERFACE 0x24 -#define USB_DESCRIPTOR_CS_ENDPOINT 0x25 - - - -/* USB Endpoint Transfer Types */ -#define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint. -#define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint. -#define USB_TRANSFER_TYPE_BULK 0x02 // Endpoint is a bulk endpoint. -#define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint. -#define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes -#define USB_TRANSFER_DIRECTION_IN 0x80 // Indicate direction is IN - -/* Standard Feature Selectors for CLEAR_FEATURE Requests */ -#define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient -#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient -#define USB_FEATURE_TEST_MODE 2 // Device recipient - -/* descriptor data structures */ - -/* Device descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // DEVICE descriptor type (USB_DESCRIPTOR_DEVICE). - uint16_t bcdUSB; // USB Spec Release Number (BCD). - uint8_t bDeviceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bDeviceSubClass; // Subclass code (assigned by the USB-IF). - uint8_t bDeviceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bMaxPacketSize0; // Maximum packet size for endpoint 0. - uint16_t idVendor; // Vendor ID (assigned by the USB-IF). - uint16_t idProduct; // Product ID (assigned by the manufacturer). - uint16_t bcdDevice; // Device release number (BCD). - uint8_t iManufacturer; // Index of String Descriptor describing the manufacturer. - uint8_t iProduct; // Index of String Descriptor describing the product. - uint8_t iSerialNumber; // Index of String Descriptor with the device's serial number. - uint8_t bNumConfigurations; // Number of possible configurations. -} __attribute__((packed)) USB_DEVICE_DESCRIPTOR; - -/* Configuration descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // CONFIGURATION descriptor type (USB_DESCRIPTOR_CONFIGURATION). - uint16_t wTotalLength; // Total length of all descriptors for this configuration. - uint8_t bNumInterfaces; // Number of interfaces in this configuration. - uint8_t bConfigurationValue; // Value of this configuration (1 based). - uint8_t iConfiguration; // Index of String Descriptor describing the configuration. - uint8_t bmAttributes; // Configuration characteristics. - uint8_t bMaxPower; // Maximum power consumed by this configuration. -} __attribute__((packed)) USB_CONFIGURATION_DESCRIPTOR; - -/* Interface descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // INTERFACE descriptor type (USB_DESCRIPTOR_INTERFACE). - uint8_t bInterfaceNumber; // Number of this interface (0 based). - uint8_t bAlternateSetting; // Value of this alternate interface setting. - uint8_t bNumEndpoints; // Number of endpoints in this interface. - uint8_t bInterfaceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t bInterfaceSubClass; // Subclass code (assigned by the USB-IF). - uint8_t bInterfaceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. - uint8_t iInterface; // Index of String Descriptor describing the interface. -} __attribute__((packed)) USB_INTERFACE_DESCRIPTOR; - -/* Endpoint descriptor structure */ -typedef struct { - uint8_t bLength; // Length of this descriptor. - uint8_t bDescriptorType; // ENDPOINT descriptor type (USB_DESCRIPTOR_ENDPOINT). - uint8_t bEndpointAddress; // Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN). - uint8_t bmAttributes; // Endpoint transfer type. - uint16_t wMaxPacketSize; // Maximum packet size. - uint8_t bInterval; // Polling interval in frames. -} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR; - -/* HID descriptor */ -/* -typedef struct { - uint8_t bLength; - uint8_t bDescriptorType; - uint16_t bcdHID; // HID class specification release - uint8_t bCountryCode; - uint8_t bNumDescriptors; // Number of additional class specific descriptors - uint8_t bDescrType; // Type of class descriptor - uint16_t wDescriptorLength; // Total size of the Report descriptor -} __attribute__((packed)) USB_HID_DESCRIPTOR; -*/ - -typedef struct { - uint8_t bDescrType; // Type of class descriptor - uint16_t wDescriptorLength; // Total size of the Report descriptor -} __attribute__((packed)) HID_CLASS_DESCRIPTOR_LEN_AND_TYPE; - -#endif // _ch9_h_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h deleted file mode 100644 index 9a6b110a15..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h +++ /dev/null @@ -1,452 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef _UHS_host_h_ -#error "Never include UHS_usbhost.h directly; include UHS_host.h instead" -#else -#ifndef _USBHOST_H_ -#define _USBHOST_H_ - -// Very early prototypes -#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 -#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); -#endif - -//#if defined(LOAD_UHS_CDC_ACM) || defined(LOAD_UHS_CDC_ACM_FTDI) || defined(LOAD_UHS_CDC_ACM_PROLIFIC) || defined(LOAD_UHS_CDC_ACM_XR21B1411) -//void UHS_CDC_ACM_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); -//void UHS_CDC_ACM_ScanUninitialized(UHS_USB_HOST_BASE *host); -//void UHS_CDC_ACM_Poll(UHS_USB_HOST_BASE *host); -//#endif - -class UHS_USBInterface; // forward class declaration - -// enumerator to turn the VBUS on/off - -typedef enum { - vbus_on = 0, - vbus_off = 1 -} VBUS_t; - -// All host SEI use this base class - -class UHS_USB_HOST_BASE { -public: - AddressPool addrPool; - UHS_USBInterface* devConfig[UHS_HOST_MAX_INTERFACE_DRIVERS]; - volatile uint8_t usb_error; - volatile uint8_t usb_task_state; - volatile uint8_t usb_task_polling_disabled; - volatile uint8_t usb_host_speed; - volatile uint8_t hub_present; - - UHS_USB_HOST_BASE() { - for(uint16_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - devConfig[i] = NULL; - } - usb_task_polling_disabled = 0; - usb_task_state = UHS_USB_HOST_STATE_INITIALIZE; //set up state machine - usb_host_speed = 0; - usb_error = 0; - }; - - ///////////////////////////////////////////// - // - // Virtual methods that interface to the SIE - // Overriding each is mandatory. - // - ///////////////////////////////////////////// - - /** - * Delay for x milliseconds - * Override if your controller provides an SOF IRQ, which may involve - * some sort of reentrant ISR or workaround with interrupts enabled. - * - * @param x how many milliseconds to delay - * @return true if delay completed without a state change, false if delay aborted - */ - virtual bool UHS_NI sof_delay(uint16_t x) { - if(!(usb_task_state & UHS_USB_HOST_STATE_MASK)) return false; - uint8_t current_state = usb_task_state; - while(current_state == usb_task_state && x--) { - delay(1); - } - return (current_state == usb_task_state); - }; - - virtual UHS_EpInfo * UHS_NI ctrlReqOpen(NOTUSED(uint8_t addr), NOTUSED(uint64_t Request), NOTUSED(uint8_t* dataptr)) { - return NULL; - }; - - virtual void UHS_NI vbusPower(NOTUSED(VBUS_t state)) { - }; - - 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)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI OutTransfer(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t nak_limit), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *data)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI InTransfer(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t nak_limit), NOTUSED(uint16_t *nbytesptr), NOTUSED(uint8_t *data)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI ctrlReqClose(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint8_t bmReqType), NOTUSED(uint16_t left), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *dataptr)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI ctrlReqRead(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t *left), NOTUSED(uint16_t *read), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *dataptr)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI dispatchPkt(NOTUSED(uint8_t token), NOTUSED(uint8_t ep), NOTUSED(uint16_t nak_limit)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual uint8_t UHS_NI init() { - return 0; - }; - - virtual void UHS_NI doHostReset() { - }; - - virtual int16_t UHS_NI Init(NOTUSED(int16_t mseconds)) { - return -1; - }; - - virtual int16_t UHS_NI Init() { - return Init(INT16_MIN); - }; - - 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() { - /* This is for machine specific support to disable/powerdown the USB Hw */ - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - virtual bool IsHub(uint8_t klass) { - return (klass == UHS_USB_CLASS_HUB); - }; - - 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() { - // Used on MCU that lack control of IRQ priority (AVR). - // Resumes ISRs. - // NOTE: you must track the state yourself! - }; - - ///////////////////////////////////////////// - // - // Built-ins, No need to override - // - ///////////////////////////////////////////// - // these two probably will go away, and won't be used, TBD - inline void Poll_Others() { -#ifdef UHS_LOAD_BT - UHS_BT_Poll(this); -#endif -#ifdef UHS_LOAD_HID - UHS_HID_Poll(this); -#endif - } - - inline void DisablePoll() { - noInterrupts(); - usb_task_polling_disabled++; - DDSB(); - interrupts(); - } - - inline void EnablePoll() { - noInterrupts(); - usb_task_polling_disabled--; - DDSB(); - interrupts(); - } - - uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd); - - uint8_t UHS_NI setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord_ptr); - - uint8_t UHS_NI EPClearHalt(uint8_t addr, uint8_t ep); - - uint8_t UHS_NI ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr); - - uint8_t UHS_NI getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr); - - uint8_t UHS_NI getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr); - - uint8_t UHS_NI setAddr(uint8_t oldaddr, uint8_t newaddr); - - uint8_t UHS_NI setConf(uint8_t addr, uint8_t conf_value); - - uint8_t UHS_NI getStrDescr(uint8_t addr, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr); - - void UHS_NI ReleaseDevice(uint8_t addr); - - uint8_t UHS_NI Configuring(uint8_t parent, uint8_t port, uint8_t speed); - - void UHS_NI DeviceDefaults(uint8_t maxep, UHS_USBInterface *device); - - UHS_EpInfo* UHS_NI getEpInfoEntry(uint8_t addr, uint8_t ep); - - inline uint8_t getUsbTaskState() { - return ( usb_task_state); - }; - - inline AddressPool* GetAddressPool() { - return &addrPool; - }; - - int UHS_NI RegisterDeviceClass(UHS_USBInterface *pdev) { - for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { - if(!devConfig[i]) { - devConfig[i] = pdev; - return i; - } - } - //return UHS_HOST_ERROR_CANT_REGISTER_DEVICE_CLASS; - return -1; - }; -#if 0 - - inline void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { - addrPool.ForEachUsbDevice(pfunc); - }; -#endif - - uint8_t TestInterface(ENUMERATION_INFO *ei); - uint8_t enumerateInterface(ENUMERATION_INFO *ei); - uint8_t getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset); - uint8_t initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset); - uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); - uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data); - uint8_t doSoftReset(uint8_t parent, uint8_t port, uint8_t address); - uint8_t getone(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset); - uint8_t eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset, uint16_t *yum); - -}; - -// All device interface drivers use this subclass - -class UHS_USBInterface { -public: - - UHS_USB_HOST_BASE *pUsb; // Parent USB host - volatile uint8_t bNumEP; // total number of EP in this interface - volatile UHS_EpInfo epInfo[16]; // This is a stub, override in the driver. - - volatile uint8_t bAddress; // address of the device - volatile uint8_t bConfNum; // configuration number - volatile uint8_t bIface; // interface value - volatile bool bPollEnable; // poll enable flag, operating status - volatile uint32_t qNextPollTime; // next poll time - - /** - * Resets interface driver to unused state. You should override this in - * your driver if it requires extra class variable cleanup. - */ - virtual void DriverDefaults() { - printf("Default driver defaults.\r\n"); - pUsb->DeviceDefaults(bNumEP, this); - }; - - /** - * Checks if this interface is supported. - * Executed called when new devices are connected. - * - * @param ei - * @return true if the interface is supported - */ - virtual bool OKtoEnumerate(NOTUSED(ENUMERATION_INFO *ei)) { - return false; - }; - - /** - * Configures any needed endpoint information for an interface. - * You must provide this in your driver. - * Executed when new devices are connected and OKtoEnumerate() - * returned true. - * - * @param ei - * @return zero on success - */ - virtual uint8_t SetInterface(NOTUSED(ENUMERATION_INFO *ei)) { - return UHS_HOST_ERROR_NOT_IMPLEMENTED; - }; - - /** - * Interface specific additional setup and enumeration that - * can't occur when the descriptor stream is open. - * Also used for collection of unclaimed interfaces, to link to the master. - * - * @return zero on success - */ - virtual uint8_t Finalize() { - return 0; - }; - - /** - * Executed after interface is finalized but, before polling has started. - * - * @return 0 on success - */ - virtual uint8_t OnStart() { - return 0; - }; - - /** - * Start interface polling - * @return - */ - virtual uint8_t Start() { - uint8_t rcode = OnStart(); - if(!rcode) bPollEnable = true; - return rcode; - }; - - /** - * Executed before anything else in Release(). - * - */ - virtual void OnRelease() { - return; - }; - - /** - * Release resources when device is disconnected. - * Normally this does not need to be overridden. - */ - virtual void Release() { - OnRelease(); - DriverDefaults(); - return; - }; - - /** - * Executed After driver polls. - * Can be used when there is an important change detected during polling - * and you want to handle it elsewhere. - * Examples: - * Media status change for bulk, e.g. ready, not-ready, media changed, door opened. - * 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() { - return; - }; - - /** - * Poll interface driver. You should override this in your driver if you - * require polling faster or slower than every 100 milliseconds, or your - * driver requires special housekeeping. - */ - virtual void Poll() { - OnPoll(); - qNextPollTime = millis() + 100; - }; - - virtual bool UHS_NI Polling() { - return bPollEnable; - } - - /** - * This is only for a hub. - * @param port - */ - virtual void ResetHubPort(NOTUSED(uint8_t port)) { - return; - }; - -#if 0 - /** - * - * @return true if this interface is Vendor Specific. - */ - virtual bool IsVSI() { - return false; - } -#endif -}; - -#if 0 -/** - * - * Vendor Specific interface class. - * This is used by a partner interface. - * It can also be used to force-enumerate an interface that - * can use this interface directly. - * You can also add an instance of this class within the interface constructor - * if you expect the interface. - * - * If this is not needed, it may be removed. Nothing I have written needs this. - * Let me know if it is not required, then IsVSI method can also be shit-canned. - * -- AJK - */ - -class UHS_VSI : public UHS_USBInterface { -public: - volatile UHS_EpInfo epInfo[1]; - volatile ENUMERATION_INFO eInfo; - UHS_VSI(UHS_USB_HOST_BASE *p); - bool OKtoEnumerate(ENUMERATION_INFO *ei); - uint8_t SetInterface(ENUMERATION_INFO *ei); - virtual void DriverDefaults(); - virtual void Release(); - - uint8_t GetAddress() { - return bAddress; - }; - - virtual bool IsVSI() { - return true; - } - -}; -#endif - -#endif //_USBHOST_H_ -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h deleted file mode 100644 index 4f53443fb0..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -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 2 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, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_UTIL_LOADED) -#define USB_HOST_SYSTEM_UTIL_LOADED - -// 0x80 is the default (i.e. trace) to turn off set this global to something lower. -// this allows for 126 other debugging levels. -// TO-DO: Allow assignment to a different serial port by software -int UsbDEBUGlvl = 0x80; - -void E_Notifyc(char c, int lvl) { - if(UsbDEBUGlvl < lvl) return; -#if defined(ARDUINO) && ARDUINO >=100 - USB_HOST_SERIAL.print(c); -#else - USB_HOST_SERIAL.print(c, BYTE); -#endif - //USB_HOST_SERIAL.flush(); -} - -void E_Notify(char const * msg, int lvl) { - if(UsbDEBUGlvl < lvl) return; - if(!msg) return; - char c; - - while((c = pgm_read_byte(msg++))) E_Notifyc(c, lvl); -} - -void E_NotifyStr(char const * msg, int lvl) { - if(UsbDEBUGlvl < lvl) return; - if(!msg) return; - char c; - - while((c = *msg++)) E_Notifyc(c, lvl); -} - -void E_Notify(uint8_t b, int lvl) { - if(UsbDEBUGlvl < lvl) return; -#if defined(ARDUINO) && ARDUINO >=100 - USB_HOST_SERIAL.print(b); -#else - USB_HOST_SERIAL.print(b, DEC); -#endif -} - -void E_Notify(double d, int lvl) { - if(UsbDEBUGlvl < lvl) return; - USB_HOST_SERIAL.print(d); -} - -#ifdef DEBUG_USB_HOST - -void NotifyFailGetDevDescr() { - Notify(PSTR("\r\ngetDevDescr "), 0x80); -} - -void NotifyFailSetDevTblEntry() { - Notify(PSTR("\r\nsetDevTblEn "), 0x80); -} - -void NotifyFailGetConfDescr() { - Notify(PSTR("\r\ngetConf "), 0x80); -} - -void NotifyFailSetConfDescr() { - Notify(PSTR("\r\nsetConf "), 0x80); -} - -void NotifyFailGetDevDescr(uint8_t reason) { - NotifyFailGetDevDescr(); - NotifyFail(reason); -} - -void NotifyFailSetDevTblEntry(uint8_t reason) { - NotifyFailSetDevTblEntry(); - NotifyFail(reason); - -} - -void NotifyFailGetConfDescr(uint8_t reason) { - NotifyFailGetConfDescr(); - NotifyFail(reason); -} - -void NotifyFailSetConfDescr(uint8_t reason) { - NotifyFailSetConfDescr(); - NotifyFail(reason); -} - -void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID) { - Notify(PSTR("\r\nUnknown Device Connected - VID: "), 0x80); - D_PrintHex (VID, 0x80); - Notify(PSTR(" PID: "), 0x80); - D_PrintHex (PID, 0x80); -} - -void NotifyFail(uint8_t rcode) { - D_PrintHex (rcode, 0x80); - Notify(PSTR("\r\n"), 0x80); -} -#endif - -#else -#error "Never include UHS_util_INLINE.h, include UHS_host.h instead" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h deleted file mode 100644 index f42a806d70..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -This software may be distributed and modified under the terms of the GNU -General Public License version 2 (GPL2) as published by the Free Software -Foundation and appearing in the file GPL2.TXT included in the packaging of -this file. Please note that GPL2 Section 2[b] requires that all works based -on this software must also be made publicly available under the terms of -the GPL2 ("Copyleft"). - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ -#if !defined(USB_HOST_SHIELD_H) || defined(_max3421e_h_) -#error "Never include UHS_max3421e.h directly; include USB_HOST_SHIELD.h instead" -#else - -#define _max3421e_h_ - -/* MAX3421E register/bit names and bitmasks */ - -#define SE0 0 -#define SE1 1 -#define FSHOST 2 -#define LSHOST 3 - -/* MAX3421E command byte format: rrrrr0wa where 'r' is register number */ - -// -// MAX3421E Registers in HOST mode. -// -#define rRCVFIFO 0x08 // Receive FIFO Register -#define rSNDFIFO 0x10 // Send FIFO Register -#define rSUDFIFO 0x20 // Set Up Data FIFO Register -#define rRCVBC 0x30 // Receive FIFO Byte Count Register -#define rSNDBC 0x38 // Send FIFO Byte Count Register - -// USB Interrupt Request Status (USBIRQ) -#define rUSBIRQ 0x68 // USB Interrupt Request Register -#define bmVBUSIRQ 0x40 // Vbus Present Interrupt Request -#define bmNOVBUSIRQ 0x20 // Vbus Absent Interrupt Request -#define bmOSCOKIRQ 0x01 // Oscillator OK Interrupt Request - -// USB Interrupt Request Control (USBIEN) -#define rUSBIEN 0x70 // USB Interrupt Request Enable Register -#define bmVBUSIE bmVBUSIRQ // Vbus Present Interrupt Request Enable -#define bmNOVBUSIE bmNOVBUSIRQ // Vbus Absent Interrupt Request Enable -#define bmOSCOKIE bmOSCOKIRQ // Oscillator OK Interrupt Request Enable - -// (USBCTL) -#define rUSBCTL 0x78 //15<<3 -#define bmCHIPRES 0x20 //b5 -#define bmPWRDOWN 0x10 //b4 - -// (CPUCTL) -#define rCPUCTL 0x80 //16<<3 -#define bmPUSLEWID1 0x80 //b7 -#define bmPULSEWID0 0x40 //b6 -#define bmIE 0x01 //b0 - -// bmPUSLEWID1 bmPULSEWID0 Pulse width -// 0 0 10.6uS -// 0 1 5.3uS -// 1 0 2.6uS -// 1 1 1.3uS -#define PUSLEWIDTH10_6 (0) -#define PUSLEWIDTH5_3 (bmPULSEWID0) -#define PUSLEWIDTH2_6 (bmPUSLEWID1) -#define PUSLEWIDTH1_3 (bmPULSEWID0 | bmPUSLEWID1) - -// (PINCTL) -#define rPINCTL 0x88 //17<<3 -#define bmFDUPSPI 0x10 //b4 -#define bmINTLEVEL 0x08 //b3 -#define bmPOSINT 0x04 //b2 -#define bmGPXB 0x02 //b1 -#define bmGPXA 0x01 //b0 - -// GPX pin selections -#define GPX_OPERATE 0x00 // -#define GPX_VBDET 0x01 // -#define GPX_BUSACT 0x02 // -#define GPX_SOF 0x03 // - -#define rREVISION 0x90 //18<<3 - -// (IOPINS1) -#define rIOPINS1 0xa0 //20<<3 -#define bmGPOUT0 0x01 // -#define bmGPOUT1 0x02 // -#define bmGPOUT2 0x04 // -#define bmGPOUT3 0x08 // -#define bmGPIN0 0x10 // -#define bmGPIN1 0x20 // -#define bmGPIN2 0x40 // -#define bmGPIN3 0x80 // - -// (IOPINS2) -#define rIOPINS2 0xa8 //21<<3 -#define bmGPOUT4 0x01 // -#define bmGPOUT5 0x02 // -#define bmGPOUT6 0x04 // -#define bmGPOUT7 0x08 // -#define bmGPIN4 0x10 // -#define bmGPIN5 0x20 // -#define bmGPIN6 0x40 // -#define bmGPIN7 0x80 // - -// (GPINIRQ) -#define rGPINIRQ 0xb0 //22<<3 -#define bmGPINIRQ0 0x01 // -#define bmGPINIRQ1 0x02 // -#define bmGPINIRQ2 0x04 // -#define bmGPINIRQ3 0x08 // -#define bmGPINIRQ4 0x10 // -#define bmGPINIRQ5 0x20 // -#define bmGPINIRQ6 0x40 // -#define bmGPINIRQ7 0x80 // - -// (GPINIEN) -#define rGPINIEN 0xb8 //23<<3 -#define bmGPINIEN0 0x01 // -#define bmGPINIEN1 0x02 // -#define bmGPINIEN2 0x04 // -#define bmGPINIEN3 0x08 // -#define bmGPINIEN4 0x10 // -#define bmGPINIEN5 0x20 // -#define bmGPINIEN6 0x40 // -#define bmGPINIEN7 0x80 // - -// (GPINPOL) -#define rGPINPOL 0xc0 //24<<3 -#define bmGPINPOL0 0x01 // -#define bmGPINPOL1 0x02 // -#define bmGPINPOL2 0x04 // -#define bmGPINPOL3 0x08 // -#define bmGPINPOL4 0x10 // -#define bmGPINPOL5 0x20 // -#define bmGPINPOL6 0x40 // -#define bmGPINPOL7 0x80 // - -// -// If any data transfer errors occur, the HXFRDNIRQ asserts, while the RCVDAVIRQ does not. -// -// The CPU clears the SNDBAVIRQ by writing the SNDBC register. -// The CPU should never directly clear the SNDBAVIRQ bit. - -// Host Interrupt Request Status (HIRQ) -#define rHIRQ 0xc8 // Host Interrupt Request Register -#define bmBUSEVENTIRQ 0x01 // BUS Reset Done or BUS Resume Interrupt Request -#define bmRWUIRQ 0x02 // Remote Wakeup Interrupt Request -#define bmRCVDAVIRQ 0x04 // Receive FIFO Data Available Interrupt Request -#define bmSNDBAVIRQ 0x08 // Send Buffer Available Interrupt Request -#define bmSUSDNIRQ 0x10 // Suspend operation Done Interrupt Request -#define bmCONDETIRQ 0x20 // Peripheral Connect/Disconnect Interrupt Request -#define bmFRAMEIRQ 0x40 // Frame Generator Interrupt Request -#define bmHXFRDNIRQ 0x80 // Host Transfer Done Interrupt Request - -// IRQs that are OK for the CPU to clear -#define ICLRALLBITS (bmBUSEVENTIRQ | bmRWUIRQ | bmRCVDAVIRQ | bmSUSDNIRQ | bmCONDETIRQ | bmFRAMEIRQ | bmHXFRDNIRQ) - -// Host Interrupt Request Control (HIEN) -#define rHIEN 0xd0 // -#define bmBUSEVENTIE bmBUSEVENTIRQ // BUS Reset Done or BUS Resume Interrupt Request Enable -#define bmRWUIE bmRWUIRQ // Remote Wakeup Interrupt Request Enable -#define bmRCVDAVIE bmRCVDAVIRQ // Receive FIFO Data Available Interrupt Request Enable -#define bmSNDBAVIE bmSNDBAVIRQ // Send Buffer Available Interrupt Request Enable -#define bmSUSDNIE bmSUSDNIRQ // Suspend operation Done Interrupt Request Enable -#define bmCONDETIE bmCONDETIRQ // Peripheral Connect/Disconnect Interrupt Request Enable -#define bmFRAMEIE bmFRAMEIRQ // Frame Generator Interrupt Request Enable -#define bmHXFRDNIE bmHXFRDNIRQ // Host Transfer Done Interrupt Request Enable - -// (MODE)) -#define rMODE 0xd8 //27<<3 -#define bmHOST 0x01 // -#define bmLOWSPEED 0x02 // -#define bmHUBPRE 0x04 // -#define bmSOFKAENAB 0x08 // -#define bmSEPIRQ 0x10 // -#define bmDELAYISO 0x20 // -#define bmDMPULLDN 0x40 // -#define bmDPPULLDN 0x80 // - -#define rPERADDR 0xe0 //28<<3 - -// (HCTL) -#define rHCTL 0xe8 //29<<3 -#define bmBUSRST 0x01 // -#define bmFRMRST 0x02 // -#define bmSAMPLEBUS 0x04 // -#define bmSIGRSM 0x08 // -#define bmRCVTOG0 0x10 // -#define bmRCVTOG1 0x20 // -#define bmSNDTOG0 0x40 // -#define bmSNDTOG1 0x80 // - -// Host transfer (HXFR) -#define rHXFR 0xf0 //30<<3 -/* Host transfer token values for writing the HXFR register (R30) */ -/* OR this bit field with the endpoint number in bits 3:0 */ -#define MAX3421E_tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1 -#define MAX3421E_tokIN 0x00 // HS=0, ISO=0, OUTNIN=0, SETUP=0 -#define MAX3421E_tokOUT 0x20 // HS=0, ISO=0, OUTNIN=1, SETUP=0 -#define MAX3421E_tokINHS 0x80 // HS=1, ISO=0, OUTNIN=0, SETUP=0 -#define MAX3421E_tokOUTHS 0xA0 // HS=1, ISO=0, OUTNIN=1, SETUP=0 -#define MAX3421E_tokISOIN 0x40 // HS=0, ISO=1, OUTNIN=0, SETUP=0 -#define MAX3421E_tokISOOUT 0x60 // HS=0, ISO=1, OUTNIN=1, SETUP=0 - -// (HRSL) -#define rHRSL 0xf8 //31<<3 -#define bmRCVTOGRD 0x10 // -#define bmSNDTOGRD 0x20 // -#define bmKSTATUS 0x40 // -#define bmJSTATUS 0x80 // -#define bmSE0 0x00 //SE0 - disconnect state -#define bmSE1 0xc0 //SE1 - illegal state - -#define MODE_FS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmSOFKAENAB) -#define MODE_LS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmLOWSPEED|bmSOFKAENAB) - -#endif //_max3421e_h_ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h deleted file mode 100644 index f0cdae2b6b..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ /dev/null @@ -1,519 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -This software may be distributed and modified under the terms of the GNU -General Public License version 2 (GPL2) as published by the Free Software -Foundation and appearing in the file GPL2.TXT included in the packaging of -this file. Please note that GPL2 Section 2[b] requires that all works based -on this software must also be made publicly available under the terms of -the GPL2 ("Copyleft"). - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#ifndef USB_HOST_SHIELD_H -#define USB_HOST_SHIELD_H - -// uncomment to get 'printf' console debugging. NOT FOR UNO! -//#define DEBUG_PRINTF_EXTRA_HUGE_USB_HOST_SHIELD - -#ifdef LOAD_USB_HOST_SHIELD -#include "UHS_max3421e.h" -#include - - -#ifndef SPI_HAS_TRANSACTION -#error "Your SPI library installation is too old." -#else -#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." -#endif - -#endif -#if DEBUG_PRINTF_EXTRA_HUGE -#ifdef DEBUG_PRINTF_EXTRA_HUGE_USB_HOST_SHIELD -#define MAX_HOST_DEBUG(...) printf_P(__VA_ARGS__) -#else -#define MAX_HOST_DEBUG(...) VOID0 -#endif -#else -#define MAX_HOST_DEBUG(...) VOID0 -#endif - -#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 -#endif -#else -#define USB_HOST_SHIELD_USE_ISR 1 -#endif - - - -#if !USB_HOST_SHIELD_USE_ISR -#error NOISR Polled mode _NOT SUPPORTED YET_ - -// -// Polled defaults -// -#ifdef BOARD_BLACK_WIDDOW -#define UHS_MAX3421E_SS_ 6 -#define UHS_MAX3421E_INT_ 3 -#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) -#if EXT_RAM -// Teensy++ 2.0 with XMEM2 -#define UHS_MAX3421E_SS_ 20 -#define UHS_MAX3421E_INT_ 7 -#else -#define UHS_MAX3421E_SS_ 9 -#define UHS_MAX3421E_INT_ 8 -#endif -#define UHS_MAX3421E_SPD -#elif defined(ARDUINO_AVR_ADK) -#define UHS_MAX3421E_SS_ 53 -#define UHS_MAX3421E_INT_ 54 -#elif defined(ARDUINO_AVR_BALANDUINO) -#define UHS_MAX3421E_SS_ 20 -#define UHS_MAX3421E_INT_ 19 -#else -#define UHS_MAX3421E_SS_ 10 -#define UHS_MAX3421E_INT_ 9 -#endif - -#else -#ifdef ARDUINO_ARCH_PIC32 -// PIC32 only allows edge interrupts, isn't that lovely? We'll emulate it... -#if CHANGE < 2 -#error core too old. -#endif - -#define IRQ_IS_EDGE 0 -#ifndef digitalPinToInterrupt -// great, this isn't implemented. -#warning digitalPinToInterrupt is not defined, complain here https://github.com/chipKIT32/chipKIT-core/issues/114 -#if defined(_BOARD_UNO_) || defined(_BOARD_UC32_) -#define digitalPinToInterrupt(p) ((p) == 2 ? 1 : ((p) == 7 ? 2 : ((p) == 8 ? 3 : ((p) == 35 ? 4 : ((p) == 38 ? 0 : NOT_AN_INTERRUPT))))) -#warning digitalPinToInterrupt is now defined until this is taken care of. -#else -#error digitalPinToInterrupt not defined for your board, complain here https://github.com/chipKIT32/chipKIT-core/issues/114 -#endif -#endif -#else -#define IRQ_IS_EDGE 0 -#endif - -// More stupidity from our friends @ Sony... -#ifdef ARDUINO_spresense_ast -#ifndef NOT_AN_INTERRUPT -#define NOT_AN_INTERRUPT -1 -#endif -#endif - -// SAMD uses an enum for this instead of a define. Isn't that just dandy? -#if !defined(NOT_AN_INTERRUPT) && !defined(ARDUINO_ARCH_SAMD) -#warning NOT_AN_INTERRUPT not defined, possible problems ahead. -#warning If NOT_AN_INTERRUPT is an enum or something else, complain to UHS30 developers on github. -#warning Otherwise complain to your board core developer/maintainer. -#define NOT_AN_INTERRUPT -1 -#endif - -// -// Interrupt defaults. Int0 or Int1 -// -#ifdef BOARD_BLACK_WIDDOW -#error "HELP! Please send us an email, I don't know the values for Int0 and Int1 on the Black Widow board!" -#elif defined(ARDUINO_AVR_ADK) -#define UHS_MAX3421E_SS_ 53 -#define UHS_MAX3421E_INT_ 54 -#elif defined(ARDUINO_spresense_ast) -#define UHS_MAX3421E_SS_ 21 -#define UHS_MAX3421E_INT_ 20 -#define SPIclass SPI5 -//#define UHS_MAX3421E_SPD 100000 -#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) - -// TO-DO! - -#if EXT_RAM -// Teensy++ 2.0 with XMEM2 -#define UHS_MAX3421E_SS_ 20 -#define UHS_MAX3421E_INT_ 7 -#else -#define UHS_MAX3421E_SS_ 9 -#define UHS_MAX3421E_INT_ 8 -#endif - -#elif defined(ARDUINO_AVR_BALANDUINO) -#error "ISR mode is currently not supported on the Balanduino. Please set USB_HOST_SHIELD_USE_ISR to 0." -#else -#define UHS_MAX3421E_SS_ 10 -#ifdef __AVR__ -#ifdef __AVR_ATmega32U4__ -#define INT_FOR_PIN2 1 -#define INT_FOR_PIN3 0 -#else -// Everybody else??? -#define INT_FOR_PIN2 0 -#define INT_FOR_PIN3 1 -#endif -#define UHS_MAX3421E_INT_ 3 -#else -// Non-avr -#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 -#else -#define UHS_MAX3421E_INT_ 9 -#endif -#endif -#endif -#endif - - - -#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 -// logic level is referenced to the voltage on VL. Data is clocked into the SPI slave inter face on the -// rising edge of SCLK. Data is clocked out of the SPI slave interface on the falling edge of SCLK. -// Serial Clock (SCLK) Period 38.4ns minimum. 17ns minimum pulse width. VL >2.5V -// SCLK Fall to MISO Propagation Delay 14.2ns -// SCLK Fall to MOSI Propagation Delay 14.2ns -// SCLK Fall to MOSI Drive 3.5ns -// Theoretical deadline for reply 17.7ns -// 26MHz 38.4615ns period <-- MAX3421E theoretical maximum - -#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) -// PIC MX 5/6/7 characteristics -// 25MHZ 40ns period <-- PIC MX 5/6/7 theoretical maximum -// pulse width minimum Tsclk/2ns -// Trise/fall 10ns maximum. 5ns is typical but not guaranteed. -// Tsetup minimum for MISO 10ns. -// We are in violation by 7.7ns @ 25MHz due to latency alone. -// Even reading at end of data cycle, we only have a 2.3ns window. -// This is too narrow to to compensate for capacitance, trace lengths, and noise. - -// 17.7ns + 10ns = 27.7ns -// 18MHz fits and has enough slack time to compensate for capacitance, trace lengths, and noise. -// For high speeds the SMP bit is recommended too, which samples at the end instead of the middle. -// 20Mhz seems to work. - -#define UHS_MAX3421E_SPD 20000000 -#else -#define UHS_MAX3421E_SPD 25000000 -#endif -#endif -#else -// We start at 25MHz, and back down until hardware can take it. -// Of course, SPI library can adjust this for us too. -// 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. -#ifndef UHS_MAX3421E_SPD -#define UHS_MAX3421E_SPD 25000000 -#endif -#endif - -#ifndef UHS_MAX3421E_INT -#define UHS_MAX3421E_INT UHS_MAX3421E_INT_ -#endif - -#ifndef UHS_MAX3421E_SS -#define UHS_MAX3421E_SS UHS_MAX3421E_SS_ -#endif - -// NOTE: On the max3421e the irq enable and irq bits are in the same position. - -// IRQs used if CPU polls -#define ENIBITSPOLLED (bmCONDETIE | bmBUSEVENTIE | bmFRAMEIE) -// IRQs used if CPU is interrupted -#define ENIBITSISR (bmCONDETIE | bmBUSEVENTIE | bmFRAMEIE /* | bmRCVDAVIRQ | bmSNDBAVIRQ | bmHXFRDNIRQ */ ) - -#if !USB_HOST_SHIELD_USE_ISR -#define IRQ_CHECK_MASK (ENIBITSPOLLED & ICLRALLBITS) -#define IRQ_IS_EDGE 0 -#else -#define IRQ_CHECK_MASK (ENIBITSISR & ICLRALLBITS) -#endif - -#if IRQ_IS_EDGE -// Note: UNO32 Interrupts can only be RISING, or FALLING. -// This poses an interesting problem, since we want to use a LOW level. -// The MAX3421E provides for pulse width control for an IRQ. -// We do need to watch the timing on this, as a second IRQ could cause -// a missed IRQ, since we read the level of the line to check if the IRQ -// is actually for this chip. The only other alternative is to add a capacitor -// and an NPN transistor, and use two lines. We can try this first, though. -// Worse case, we can ignore reading the pin for verification on UNO32. -// Too bad there is no minimum low width setting. -// -// Single Clear First Second Clear first Clear last -// IRQ Single IRQ IRQ Second active pending IRQ -// | | | | | | -// V V V V V V -// _____ _________ _ _ _______ -// |______| |______| |______| |______________| -// -#define IRQ_SENSE FALLING -#ifdef ARDUINO_ARCH_PIC32 -//#define bmPULSEWIDTH PUSLEWIDTH10_6 -#define bmPULSEWIDTH 0 -#define bmIRQ_SENSE 0 -#else -#define bmPULSEWIDTH PUSLEWIDTH1_3 -#define bmIRQ_SENSE 0 -#endif -#else -#ifndef IRQ_SENSE -#define IRQ_SENSE LOW -#endif -#ifndef bmPULSEWIDTH -#define bmPULSEWIDTH 0 -#endif -#ifndef bmIRQ_SENSE -#define bmIRQ_SENSE bmINTLEVEL -#endif -#endif - -class MAX3421E_HOST : -public UHS_USB_HOST_BASE -#ifdef SWI_IRQ_NUM -, public dyn_SWI -#endif -{ - // TO-DO: move these into the parent class. - volatile uint8_t vbusState; - volatile uint16_t sof_countdown; - - // TO-DO: pack into a struct/union and use one byte - volatile bool busevent; - volatile bool sofevent; - volatile bool counted; - volatile bool condet; - volatile bool doingreset; - - #ifdef USB_HOST_MANUAL_POLL - volatile bool frame_irq_enabled = false; - - bool enable_frame_irq(bool enable) { - const bool prev_state = frame_irq_enabled; - if(prev_state != enable) { - if(enable) - regWr(rHIEN, regRd(rHIEN) | bmFRAMEIE); - else - regWr(rHIEN, regRd(rHIEN) & ~bmFRAMEIE); - frame_irq_enabled = enable; - } - return prev_state; - } - #endif - -public: - SPISettings MAX3421E_SPI_Settings; - uint8_t ss_pin; - uint8_t irq_pin; - // Will use the defaults UHS_MAX3421E_SS, UHS_MAX3421E_INT and speed - - UHS_NI MAX3421E_HOST() { - sof_countdown = 0; - busevent = false; - doingreset = false; - sofevent = false; - condet = false; - ss_pin = UHS_MAX3421E_SS; - irq_pin = UHS_MAX3421E_INT; - MAX3421E_SPI_Settings = SPISettings(UHS_MAX3421E_SPD, MSBFIRST, SPI_MODE0); - hub_present = 0; - }; - - // Will use user supplied pins, and UHS_MAX3421E_SPD - - UHS_NI MAX3421E_HOST(uint8_t pss, uint8_t pirq) { - sof_countdown = 0; - busevent = false; - doingreset = false; - sofevent = false; - condet = false; - ss_pin = pss; - irq_pin = pirq; - MAX3421E_SPI_Settings = SPISettings(UHS_MAX3421E_SPD, MSBFIRST, SPI_MODE0); - hub_present = 0; - }; - - // Will use user supplied pins, and speed - - UHS_NI MAX3421E_HOST(uint8_t pss, uint8_t pirq, uint32_t pspd) { - sof_countdown = 0; - doingreset = false; - busevent = false; - sofevent = false; - condet = false; - ss_pin = pss; - irq_pin = pirq; - MAX3421E_SPI_Settings = SPISettings(pspd, MSBFIRST, SPI_MODE0); - hub_present = 0; - }; - - virtual bool UHS_NI sof_delay(uint16_t x) { -#ifdef USB_HOST_MANUAL_POLL - const bool saved_irq_state = enable_frame_irq(true); -#endif - sof_countdown = x; - while((sof_countdown != 0) && !condet) { - SYSTEM_OR_SPECIAL_YIELD(); -#if !USB_HOST_SHIELD_USE_ISR - Task(); -#endif - } -#ifdef USB_HOST_MANUAL_POLL - enable_frame_irq(saved_irq_state); -#endif - // Serial.println("...Wake"); - return (!condet); - }; - - virtual UHS_EpInfo *ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t* dataptr); - - virtual void UHS_NI vbusPower(VBUS_t state) { - regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE) | (uint8_t)(state)); - }; - - 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); - virtual uint8_t InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data); - virtual uint8_t ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, uint16_t left, uint16_t nbytes, uint8_t *dataptr); - 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() { - for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) - if(devConfig[i]) - devConfig[i]->Release(); - hub_present = 0; - }; - - virtual bool IsHub(uint8_t klass) { - if(klass == UHS_USB_CLASS_HUB) { - hub_present = bmHUBPRE; - return true; - } - return false; - }; - - virtual void VBUS_changed(); - - virtual void UHS_NI doHostReset() { -#if USB_HOST_SHIELD_USE_ISR - // Enable interrupts - noInterrupts(); -#endif - doingreset = true; - busevent = true; - regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. - regWr(rHCTL, bmBUSRST); //issue bus reset -#if USB_HOST_SHIELD_USE_ISR - DDSB(); - // Enable interrupts - interrupts(); -#endif - while(busevent) { - DDSB(); - SYSTEM_OR_SPECIAL_YIELD(); - } -#endif -#if USB_HOST_SHIELD_USE_ISR - // Enable interrupts - noInterrupts(); -#endif - #ifdef USB_HOST_MANUAL_POLL - enable_frame_irq(true); - #endif - sofevent = true; -#if USB_HOST_SHIELD_USE_ISR - DDSB(); - // Enable interrupts - interrupts(); -#endif - // Wait for SOF - while(sofevent) { - } -#if USB_HOST_SHIELD_USE_ISR - // Enable interrupts - noInterrupts(); -#endif - doingreset = false; -#if USB_HOST_SHIELD_USE_ISR - DDSB(); - // Enable interrupts - interrupts(); - }; - - - int16_t UHS_NI Init(int16_t mseconds); - - int16_t UHS_NI Init() { - return Init(INT16_MIN); - }; - - 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(); - 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. -#ifdef SWI_IRQ_NUM - - void dyn_SWISR() { - ISRbottom(); - }; -#endif - - 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! -#ifdef __AVR__ - noInterrupts(); - detachInterrupt(UHS_GET_DPI(irq_pin)); - interrupts(); -#endif - }; - - virtual void UHS_NI resume_host(); -}; -#ifndef SPIclass -#define SPIclass SPI -#endif -#ifndef USB_HOST_SHIELD_LOADED -#include "USB_HOST_SHIELD_INLINE.h" -#endif -#else -#error "define LOAD_USB_HOST_SHIELD in your sketch, never include USB_HOST_SHIELD.h in a driver." -#endif -#endif /* USB_HOST_SHIELD_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h deleted file mode 100644 index ef2dfe0137..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ /dev/null @@ -1,1003 +0,0 @@ -/* Copyright (C) 2015-2016 Andrew J. Kroll - and -Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. - -This software may be distributed and modified under the terms of the GNU -General Public License version 2 (GPL2) as publishe7d by the Free Software -Foundation and appearing in the file GPL2.TXT included in the packaging of -this file. Please note that GPL2 Section 2[b] requires that all works based -on this software must also be made publicly available under the terms of -the GPL2 ("Copyleft"). - -Contact information -------------------- - -Circuits At Home, LTD -Web : http://www.circuitsathome.com -e-mail : support@circuitsathome.com - */ - -#if defined(USB_HOST_SHIELD_H) && !defined(USB_HOST_SHIELD_LOADED) -#define USB_HOST_SHIELD_LOADED -#include - -#ifndef digitalPinToInterrupt -#error digitalPinToInterrupt not defined, complain to your board maintainer. -#endif - - -#if USB_HOST_SHIELD_USE_ISR - -// allow two slots. this makes the maximum allowed shield count TWO -// for AVRs this is limited to pins 2 and 3 ONLY -// for all other boards, one odd and one even pin number is allowed. -static MAX3421E_HOST *ISReven; -static MAX3421E_HOST *ISRodd; - -static void UHS_NI call_ISReven() { - ISReven->ISRTask(); -} - -static void UHS_NI call_ISRodd() { - UHS_PIN_WRITE(LED_BUILTIN, HIGH); - ISRodd->ISRTask(); -} -#endif - - -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! -#ifdef __AVR__ - noInterrupts(); - if(irq_pin & 1) { - ISRodd = this; - attachInterrupt(UHS_GET_DPI(irq_pin), call_ISRodd, IRQ_SENSE); - } else { - ISReven = this; - attachInterrupt(UHS_GET_DPI(irq_pin), call_ISReven, IRQ_SENSE); - } - interrupts(); -#endif - -} -/* write single byte into MAX3421e register */ -void UHS_NI MAX3421E_HOST::regWr(uint8_t reg, uint8_t data) { - SPIclass.beginTransaction(MAX3421E_SPI_Settings); - MARLIN_UHS_WRITE_SS(LOW); - SPIclass.transfer(reg | 0x02); - SPIclass.transfer(data); - MARLIN_UHS_WRITE_SS(HIGH); - SPIclass.endTransaction(); -} - - -/* multiple-byte write */ - -/* returns a pointer to memory position after last written */ -uint8_t* UHS_NI MAX3421E_HOST::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { - SPIclass.beginTransaction(MAX3421E_SPI_Settings); - MARLIN_UHS_WRITE_SS(LOW); - SPIclass.transfer(reg | 0x02); - //printf("%2.2x :", reg); - - while(nbytes) { - SPIclass.transfer(*data_p); - //printf("%2.2x ", *data_p); - nbytes--; - data_p++; // advance data pointer - } - MARLIN_UHS_WRITE_SS(HIGH); - SPIclass.endTransaction(); - //printf("\r\n"); - return (data_p); -} -/* GPIO write */ -/*GPIO byte is split between 2 registers, so two writes are needed to write one byte */ - -/* GPOUT bits are in the low nibble. 0-3 in IOPINS1, 4-7 in IOPINS2 */ -void UHS_NI MAX3421E_HOST::gpioWr(uint8_t data) { - regWr(rIOPINS1, data); - data >>= 4; - regWr(rIOPINS2, data); - return; -} - -/* single host register read */ -uint8_t UHS_NI MAX3421E_HOST::regRd(uint8_t reg) { - SPIclass.beginTransaction(MAX3421E_SPI_Settings); - MARLIN_UHS_WRITE_SS(LOW); - SPIclass.transfer(reg); - uint8_t rv = SPIclass.transfer(0); - MARLIN_UHS_WRITE_SS(HIGH); - SPIclass.endTransaction(); - return (rv); -} -/* multiple-byte register read */ - -/* returns a pointer to a memory position after last read */ -uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { - SPIclass.beginTransaction(MAX3421E_SPI_Settings); - MARLIN_UHS_WRITE_SS(LOW); - SPIclass.transfer(reg); - while(nbytes) { - *data_p++ = SPIclass.transfer(0); - nbytes--; - } - MARLIN_UHS_WRITE_SS(HIGH); - SPIclass.endTransaction(); - return ( data_p); -} - -/* GPIO read. See gpioWr for explanation */ - -/* GPIN pins are in high nibbles of IOPINS1, IOPINS2 */ -uint8_t UHS_NI MAX3421E_HOST::gpioRd() { - uint8_t gpin = 0; - gpin = regRd(rIOPINS2); //pins 4-7 - gpin &= 0xf0; //clean lower nibble - gpin |= (regRd(rIOPINS1) >> 4); //shift low bits and OR with upper from previous operation. - return ( gpin); -} - -/* 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() { - uint16_t i = 0; - - // Initiate chip reset - regWr(rUSBCTL, bmCHIPRES); - regWr(rUSBCTL, 0x00); - - int32_t now; - uint32_t expires = micros() + 65535; - - // Enable full-duplex SPI so we can read rUSBIRQ - regWr(rPINCTL, bmFDUPSPI); - while((int32_t)(micros() - expires) < 0L) { - if((regRd(rUSBIRQ) & bmOSCOKIRQ)) { - break; - } - } - now = (int32_t)(micros() - expires); - if(now < 0L) { - i = 65535 + now; // Note this subtracts, as now is negative - } - return (i); -} - -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); - switch(vbusState) { - case LSHOST: // Low speed - - speed = 0; - // Intentional fall-through - case FSHOST: // Full speed - // Start device initialization if we are not initializing - // Resets to the device cause an IRQ - // usb_task_state == UHS_USB_HOST_STATE_RESET_NOT_COMPLETE; - //if((usb_task_state & UHS_USB_HOST_STATE_MASK) != UHS_USB_HOST_STATE_DETACHED) { - ReleaseChildren(); - if(!doingreset) { - if(usb_task_state == UHS_USB_HOST_STATE_RESET_NOT_COMPLETE) { - usb_task_state = UHS_USB_HOST_STATE_WAIT_BUS_READY; - } else if(usb_task_state != UHS_USB_HOST_STATE_WAIT_BUS_READY) { - usb_task_state = UHS_USB_HOST_STATE_DEBOUNCE; - } - } - sof_countdown = 0; - break; - case SE1: //illegal state - sof_countdown = 0; - doingreset = false; - ReleaseChildren(); - usb_task_state = UHS_USB_HOST_STATE_ILLEGAL; - break; - case SE0: //disconnected - default: - sof_countdown = 0; - doingreset = false; - ReleaseChildren(); - usb_task_state = UHS_USB_HOST_STATE_IDLE; - break; - } - usb_host_speed = speed; - //printf("0x%2.2x\r\n\r\n\r\n\r\n", usb_task_state); - return; -}; - -/** - * Probe bus to determine device presence and speed, - * then switch host to detected speed. - */ -void UHS_NI MAX3421E_HOST::busprobe() { - uint8_t bus_sample; - uint8_t tmpdata; - bus_sample = regRd(rHRSL); //Get J,K status - bus_sample &= (bmJSTATUS | bmKSTATUS); //zero the rest of the byte - switch(bus_sample) { //start full-speed or low-speed host - case(bmJSTATUS): - // Serial.println("J"); - if((regRd(rMODE) & bmLOWSPEED) == 0) { - regWr(rMODE, MODE_FS_HOST); // start full-speed host - vbusState = FSHOST; - } else { - regWr(rMODE, MODE_LS_HOST); // start low-speed host - vbusState = LSHOST; - } - #ifdef USB_HOST_MANUAL_POLL - enable_frame_irq(true); - #endif - tmpdata = regRd(rMODE) | bmSOFKAENAB; // start SOF generation - regWr(rHIRQ, bmFRAMEIRQ); // see data sheet. - regWr(rMODE, tmpdata); - break; - case(bmKSTATUS): - // Serial.println("K"); - if((regRd(rMODE) & bmLOWSPEED) == 0) { - regWr(rMODE, MODE_LS_HOST); // start low-speed host - vbusState = LSHOST; - } else { - regWr(rMODE, MODE_FS_HOST); // start full-speed host - vbusState = FSHOST; - } - #ifdef USB_HOST_MANUAL_POLL - enable_frame_irq(true); - #endif - tmpdata = regRd(rMODE) | bmSOFKAENAB; // start SOF generation - regWr(rHIRQ, bmFRAMEIRQ); // see data sheet. - regWr(rMODE, tmpdata); - break; - case(bmSE1): //illegal state - // Serial.println("I"); - regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); - vbusState = SE1; - // sofevent = false; - break; - case(bmSE0): //disconnected state - // Serial.println("D"); - regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); - vbusState = SE0; - // sofevent = false; - break; - }//end switch( bus_sample ) -} - -/** - * Initialize USB hardware, turn on VBUS - * - * @param mseconds Delay energizing VBUS after mseconds, A value of INT16_MIN means no delay. - * @return 0 on success, -1 on error - */ -int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) { - usb_task_state = UHS_USB_HOST_STATE_INITIALIZE; //set up state machine - // Serial.print("MAX3421E 'this' USB Host @ 0x"); - // Serial.println((uint32_t)this, HEX); - // Serial.print("MAX3421E 'this' USB Host Address Pool @ 0x"); - // Serial.println((uint32_t)GetAddressPool(), HEX); - Init_dyn_SWI(); - UHS_printf_HELPER_init(); - noInterrupts(); -#ifdef ARDUINO_AVR_ADK - // For Mega ADK, which has a Max3421e on-board, - // set MAX_RESET to output mode, and then set it to HIGH - // PORTJ bit 2 - if(irq_pin == 54) { - DDRJ |= 0x04; // output - PORTJ |= 0x04; // HIGH - } -#endif - SPIclass.begin(); -#ifdef ARDUINO_AVR_ADK - if(irq_pin == 54) { - DDRE &= ~0x20; // input - PORTE |= 0x20; // pullup - } else -#endif - pinMode(irq_pin, INPUT_PULLUP); - //UHS_PIN_WRITE(irq_pin, HIGH); - pinMode(ss_pin, OUTPUT); - MARLIN_UHS_WRITE_SS(HIGH); - -#ifdef USB_HOST_SHIELD_TIMING_PIN - pinMode(USB_HOST_SHIELD_TIMING_PIN, OUTPUT); - // My counter/timer can't work on an inverted gate signal - // so we gate using a high pulse -- AJK - UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, LOW); -#endif - interrupts(); - -#if USB_HOST_SHIELD_USE_ISR - int intr = digitalPinToInterrupt(irq_pin); - if(intr == NOT_AN_INTERRUPT) { -#ifdef ARDUINO_AVR_ADK - if(irq_pin == 54) - intr = 6; - else -#endif - return (-2); - } - SPIclass.usingInterrupt(intr); -#else - SPIclass.usingInterrupt(255); -#endif -#ifndef NO_AUTO_SPEED - // test to get to reset acceptance. - uint32_t spd = UHS_MAX3421E_SPD; -again: - MAX3421E_SPI_Settings = SPISettings(spd, MSBFIRST, SPI_MODE0); - if(reset() == 0) { - MAX_HOST_DEBUG(PSTR("Fail SPI speed %lu\r\n"), spd); - if(spd > 1999999) { - spd -= 1000000; - goto again; - } - return (-1); - } else { - // reset passes, does 64k? - uint8_t sample_wr = 0; - uint8_t sample_rd = 0; - uint8_t gpinpol_copy = regRd(rGPINPOL); - for(uint16_t j = 0; j < 65535; j++) { - regWr(rGPINPOL, sample_wr); - sample_rd = regRd(rGPINPOL); - if(sample_rd != sample_wr) { - MAX_HOST_DEBUG(PSTR("Fail SPI speed %lu\r\n"), spd); - if(spd > 1999999) { - spd -= 1000000; - goto again; - } - return (-1); - } - sample_wr++; - } - regWr(rGPINPOL, gpinpol_copy); - } - - MAX_HOST_DEBUG(PSTR("Pass SPI speed %lu\r\n"), spd); -#endif - - if(reset() == 0) { //OSCOKIRQ hasn't asserted in time - MAX_HOST_DEBUG(PSTR("OSCOKIRQ hasn't asserted in time")); - return ( -1); - } - - /* MAX3421E - full-duplex SPI, interrupt kind, vbus off */ - regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE | GPX_VBDET)); - - // Delay a minimum of 1 second to ensure any capacitors are drained. - // 1 second is required to make sure we do not smoke a Microdrive! - if(mseconds != INT16_MIN) { - if(mseconds < 1000) mseconds = 1000; - delay(mseconds); // We can't depend on SOF timer here. - } - - regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host - - // Enable interrupts on the MAX3421e - regWr(rHIEN, IRQ_CHECK_MASK); - // Enable interrupt pin on the MAX3421e, set pulse width for edge - regWr(rCPUCTL, (bmIE | bmPULSEWIDTH)); - - /* check if device is connected */ - regWr(rHCTL, bmSAMPLEBUS); // sample USB bus - while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish - - busprobe(); //check if anything is connected - VBUS_changed(); - - // GPX pin on. This is done here so that a change is detected if we have a switch connected. - /* MAX3421E - full-duplex SPI, interrupt kind, vbus on */ - regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE)); - regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. - regWr(rHCTL, bmBUSRST); // issue bus reset to force generate yet another possible IRQ - - -#if USB_HOST_SHIELD_USE_ISR - // Attach ISR to service IRQ from MAX3421e - noInterrupts(); - if(irq_pin & 1) { - ISRodd = this; - attachInterrupt(UHS_GET_DPI(irq_pin), call_ISRodd, IRQ_SENSE); - } else { - ISReven = this; - attachInterrupt(UHS_GET_DPI(irq_pin), call_ISReven, IRQ_SENSE); - } - interrupts(); -#endif - //printf("\r\nrPINCTL 0x%2.2X\r\n", rPINCTL); - //printf("rCPUCTL 0x%2.2X\r\n", rCPUCTL); - //printf("rHIEN 0x%2.2X\r\n", rHIEN); - //printf("irq_pin %i\r\n", irq_pin); - return 0; -} - -/** - * Setup UHS_EpInfo structure - * - * @param addr USB device address - * @param ep Endpoint - * @param ppep pointer to the pointer to a valid UHS_EpInfo structure - * @param nak_limit how many NAKs before aborting - * @return 0 on success - */ -uint8_t UHS_NI MAX3421E_HOST::SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo **ppep, uint16_t &nak_limit) { - UHS_Device *p = addrPool.GetUsbDevicePtr(addr); - - if(!p) - return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; - - if(!p->epinfo) - return UHS_HOST_ERROR_NULL_EPINFO; - - *ppep = getEpInfoEntry(addr, ep); - - if(!*ppep) - return UHS_HOST_ERROR_NO_ENDPOINT_IN_TABLE; - - nak_limit = (0x0001UL << (((*ppep)->bmNakPower > UHS_USB_NAK_MAX_POWER) ? UHS_USB_NAK_MAX_POWER : (*ppep)->bmNakPower)); - nak_limit--; - /* - USBTRACE2("\r\nAddress: ", addr); - USBTRACE2(" EP: ", ep); - USBTRACE2(" NAK Power: ",(*ppep)->bmNakPower); - USBTRACE2(" NAK Limit: ", nak_limit); - USBTRACE("\r\n"); - */ - regWr(rPERADDR, addr); //set peripheral address - - uint8_t mode = regRd(rMODE); - - //Serial.print("\r\nMode: "); - //Serial.println( mode, HEX); - //Serial.print("\r\nLS: "); - //Serial.println(p->speed, HEX); - - // Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise - regWr(rMODE, (p->speed) ? mode & ~(bmHUBPRE | bmLOWSPEED) : mode | bmLOWSPEED | hub_present); - - return 0; -} - -/** - * Receive a packet - * - * @param pep pointer to a valid UHS_EpInfo structure - * @param nak_limit how many NAKs before aborting - * @param nbytesptr pointer to maximum number of bytes of data to receive - * @param data pointer to data buffer - * @return 0 on success - */ -uint8_t UHS_NI MAX3421E_HOST::InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data) { - uint8_t rcode = 0; - uint8_t pktsize; - - uint16_t nbytes = *nbytesptr; - MAX_HOST_DEBUG(PSTR("Requesting %i bytes "), nbytes); - uint8_t maxpktsize = pep->maxPktSize; - - *nbytesptr = 0; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value - - // use a 'break' to exit this loop - while(1) { - rcode = dispatchPkt(MAX3421E_tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS. -#if 0 - // This issue should be resolved now. - if(rcode == UHS_HOST_ERROR_TOGERR) { - //MAX_HOST_DEBUG(PSTR("toggle wrong\r\n")); - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value - continue; - } -#endif - if(rcode) { - //MAX_HOST_DEBUG(PSTR(">>>>>>>> Problem! dispatchPkt %2.2x\r\n"), rcode); - break; //should be 0, indicating ACK. Else return error code. - } - /* check for RCVDAVIRQ and generate error if not present */ - /* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */ - if((regRd(rHIRQ) & bmRCVDAVIRQ) == 0) { - //MAX_HOST_DEBUG(PSTR(">>>>>>>> Problem! NO RCVDAVIRQ!\r\n")); - rcode = 0xf0; //receive error - break; - } - pktsize = regRd(rRCVBC); //number of received bytes - MAX_HOST_DEBUG(PSTR("Got %i bytes \r\n"), pktsize); - - if(pktsize > nbytes) { //certain devices send more than asked - //MAX_HOST_DEBUG(PSTR(">>>>>>>> Warning: wanted %i bytes but got %i.\r\n"), nbytes, pktsize); - pktsize = nbytes; - } - - int16_t mem_left = (int16_t)nbytes - *((int16_t*)nbytesptr); - - if(mem_left < 0) - mem_left = 0; - - data = bytesRd(rRCVFIFO, ((pktsize > mem_left) ? mem_left : pktsize), data); - - regWr(rHIRQ, bmRCVDAVIRQ); // Clear the IRQ & free the buffer - *nbytesptr += pktsize; // add this packet's byte count to total transfer length - - /* The transfer is complete under two conditions: */ - /* 1. The device sent a short packet (L.T. maxPacketSize) */ - /* 2. 'nbytes' have been transferred. */ - if((pktsize < maxpktsize) || (*nbytesptr >= nbytes)) // have we transferred 'nbytes' bytes? - { - // Save toggle value - pep->bmRcvToggle = ((regRd(rHRSL) & bmRCVTOGRD)) ? 1 : 0; - //MAX_HOST_DEBUG(PSTR("\r\n")); - rcode = 0; - break; - } // if - } //while( 1 ) - return ( rcode); -} - -/** - * Transmit a packet - * - * @param pep pointer to a valid UHS_EpInfo structure - * @param nak_limit how many NAKs before aborting - * @param nbytes number of bytes of data to send - * @param data pointer to data buffer - * @return 0 on success - */ -uint8_t UHS_NI MAX3421E_HOST::OutTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data) { - uint8_t rcode = UHS_HOST_ERROR_NONE; - uint8_t retry_count; - uint8_t *data_p = data; //local copy of the data pointer - uint16_t bytes_tosend; - uint16_t nak_count; - uint16_t bytes_left = nbytes; - - uint8_t maxpktsize = pep->maxPktSize; - - if(maxpktsize < 1 || maxpktsize > 64) - return UHS_HOST_ERROR_BAD_MAX_PACKET_SIZE; - - unsigned long timeout = millis() + UHS_HOST_TRANSFER_MAX_MS; - - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value - - while(bytes_left) { - SYSTEM_OR_SPECIAL_YIELD(); - retry_count = 0; - nak_count = 0; - bytes_tosend = (bytes_left >= maxpktsize) ? maxpktsize : bytes_left; - bytesWr(rSNDFIFO, bytes_tosend, data_p); //filling output FIFO - regWr(rSNDBC, bytes_tosend); //set number of bytes - regWr(rHXFR, (MAX3421E_tokOUT | pep->epAddr)); //dispatch packet - while(!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ - rcode = (regRd(rHRSL) & 0x0f); - - while(rcode && ((long)(millis() - timeout) < 0L)) { - switch(rcode) { - case UHS_HOST_ERROR_NAK: - nak_count++; - if(nak_limit && (nak_count == nak_limit)) - goto breakout; - break; - case UHS_HOST_ERROR_TIMEOUT: - retry_count++; - if(retry_count == UHS_HOST_TRANSFER_RETRY_MAXIMUM) - goto breakout; - break; - case UHS_HOST_ERROR_TOGERR: - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value - break; - default: - goto breakout; - }//switch( rcode - - /* process NAK according to Host out NAK bug */ - regWr(rSNDBC, 0); - regWr(rSNDFIFO, *data_p); - regWr(rSNDBC, bytes_tosend); - regWr(rHXFR, (MAX3421E_tokOUT | pep->epAddr)); //dispatch packet - while(!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ - rcode = (regRd(rHRSL) & 0x0f); - SYSTEM_OR_SPECIAL_YIELD(); - }//while( rcode && .... - bytes_left -= bytes_tosend; - data_p += bytes_tosend; - }//while( bytes_left... -breakout: - - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; //bmSNDTOG1 : bmSNDTOG0; //update toggle - return ( rcode); //should be 0 in all cases -} - -/** - * Send the actual packet. - * - * @param token - * @param ep Endpoint - * @param nak_limit how many NAKs before aborting, 0 == exit after timeout - * @return 0 on success, 0xFF indicates NAK timeout. @see - */ -/* Assumes peripheral address is set and relevant buffer is loaded/empty */ -/* If NAK, tries to re-send up to nak_limit times */ -/* If nak_limit == 0, do not count NAKs, exit after timeout */ -/* If bus timeout, re-sends up to USB_RETRY_LIMIT times */ - -/* return codes 0x00-0x0f are HRSLT( 0x00 being success ), 0xff means timeout */ -uint8_t UHS_NI MAX3421E_HOST::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { - unsigned long timeout = millis() + UHS_HOST_TRANSFER_MAX_MS; - uint8_t tmpdata; - uint8_t rcode = UHS_HOST_ERROR_NONE; - uint8_t retry_count = 0; - uint16_t nak_count = 0; - - for(;;) { - regWr(rHXFR, (token | ep)); //launch the transfer - while((long)(millis() - timeout) < 0L) //wait for transfer completion - { - SYSTEM_OR_SPECIAL_YIELD(); - tmpdata = regRd(rHIRQ); - - if(tmpdata & bmHXFRDNIRQ) { - regWr(rHIRQ, bmHXFRDNIRQ); //clear the interrupt - //rcode = 0x00; - break; - }//if( tmpdata & bmHXFRDNIRQ - - }//while ( millis() < timeout - - rcode = (regRd(rHRSL) & 0x0f); //analyze transfer result - - switch(rcode) { - case UHS_HOST_ERROR_NAK: - nak_count++; - if(nak_limit && (nak_count == nak_limit)) - return (rcode); - delayMicroseconds(200); - break; - case UHS_HOST_ERROR_TIMEOUT: - retry_count++; - if(retry_count == UHS_HOST_TRANSFER_RETRY_MAXIMUM) - return (rcode); - break; - default: - return (rcode); - }//switch( rcode - } -} - -// -// NULL is error, we don't need to know the reason. -// - -UHS_EpInfo * UHS_NI MAX3421E_HOST::ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t *dataptr) { - uint8_t rcode; - UHS_EpInfo *pep = NULL; - uint16_t nak_limit = 0; - rcode = SetAddress(addr, 0, &pep, nak_limit); - - if(!rcode) { - - bytesWr(rSUDFIFO, 8, (uint8_t*)(&Request)); //transfer to setup packet FIFO - - rcode = dispatchPkt(MAX3421E_tokSETUP, 0, nak_limit); //dispatch packet - if(!rcode) { - if(dataptr != NULL) { - if(((Request)/* bmReqType*/ & 0x80) == 0x80) { - pep->bmRcvToggle = 1; //bmRCVTOG1; - } else { - pep->bmSndToggle = 1; //bmSNDTOG1; - } - } - } else { - pep = NULL; - } - } - return pep; -} - -uint8_t UHS_NI MAX3421E_HOST::ctrlReqRead(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint16_t nbytes, uint8_t *dataptr) { - *read = 0; - uint16_t nak_limit = 0; - MAX_HOST_DEBUG(PSTR("ctrlReqRead left: %i\r\n"), *left); - if(*left) { -again: - *read = nbytes; - uint8_t rcode = InTransfer(pep, nak_limit, read, dataptr); - if(rcode == UHS_HOST_ERROR_TOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - goto again; - } - - if(rcode) { - MAX_HOST_DEBUG(PSTR("ctrlReqRead ERROR: %2.2x, left: %i, read %i\r\n"), rcode, *left, *read); - return rcode; - } - *left -= *read; - MAX_HOST_DEBUG(PSTR("ctrlReqRead left: %i, read %i\r\n"), *left, *read); - } - return 0; -} - -uint8_t UHS_NI MAX3421E_HOST::ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, uint16_t left, uint16_t nbytes, uint8_t *dataptr) { - uint8_t rcode = 0; - - //MAX_HOST_DEBUG(PSTR("Closing")); - if(((bmReqType & 0x80) == 0x80) && pep && left && dataptr) { - MAX_HOST_DEBUG(PSTR("ctrlReqRead Sinking %i\r\n"), left); - // If reading, sink the rest of the data. - while(left) { - uint16_t read = nbytes; - rcode = InTransfer(pep, 0, &read, dataptr); - if(rcode == UHS_HOST_ERROR_TOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - continue; - } - if(rcode) break; - left -= read; - if(read < nbytes) break; - } - } - if(!rcode) { - // Serial.println("Dispatching"); - rcode = dispatchPkt(((bmReqType & 0x80) == 0x80) ? MAX3421E_tokOUTHS : MAX3421E_tokINHS, 0, 0); //GET if direction - // } else { - // Serial.println("Bypassed Dispatch"); - } - return rcode; -} - -/** - * Bottom half of the ISR task - */ -void UHS_NI MAX3421E_HOST::ISRbottom() { - uint8_t x; - // Serial.print("Enter "); - // Serial.print((uint32_t)this,HEX); - // Serial.print(" "); - // Serial.println(usb_task_state, HEX); - - DDSB(); - if(condet) { - VBUS_changed(); -#if USB_HOST_SHIELD_USE_ISR - noInterrupts(); -#endif - condet = false; -#if USB_HOST_SHIELD_USE_ISR - interrupts(); -#endif - } - switch(usb_task_state) { - case UHS_USB_HOST_STATE_INITIALIZE: - // should never happen... - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_INITIALIZE\r\n")); - busprobe(); - VBUS_changed(); - break; - case UHS_USB_HOST_STATE_DEBOUNCE: - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_DEBOUNCE\r\n")); - // This seems to not be needed. The host controller has debounce built in. - sof_countdown = UHS_HOST_DEBOUNCE_DELAY_MS; - usb_task_state = UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE; - break; - case UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE: - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE\r\n")); - if(!sof_countdown) usb_task_state = UHS_USB_HOST_STATE_RESET_DEVICE; - break; - case UHS_USB_HOST_STATE_RESET_DEVICE: - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_RESET_DEVICE\r\n")); - busevent = true; - usb_task_state = UHS_USB_HOST_STATE_RESET_NOT_COMPLETE; - regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. - regWr(rHCTL, bmBUSRST); // issue bus reset - break; - case UHS_USB_HOST_STATE_RESET_NOT_COMPLETE: - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_RESET_NOT_COMPLETE\r\n")); - if(!busevent) usb_task_state = UHS_USB_HOST_STATE_WAIT_BUS_READY; - break; - case UHS_USB_HOST_STATE_WAIT_BUS_READY: - MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_WAIT_BUS_READY\r\n")); - usb_task_state = UHS_USB_HOST_STATE_CONFIGURING; - break; // don't fall through - - case UHS_USB_HOST_STATE_CONFIGURING: - usb_task_state = UHS_USB_HOST_STATE_CHECK; - x = Configuring(0, 1, usb_host_speed); - usb_error = x; - if(usb_task_state == UHS_USB_HOST_STATE_CHECK) { - if(x) { - MAX_HOST_DEBUG(PSTR("Error 0x%2.2x"), x); - if(x == UHS_HOST_ERROR_JERR) { - usb_task_state = UHS_USB_HOST_STATE_IDLE; - } else if(x != UHS_HOST_ERROR_DEVICE_INIT_INCOMPLETE) { - usb_error = x; - usb_task_state = UHS_USB_HOST_STATE_ERROR; - } - } else - usb_task_state = UHS_USB_HOST_STATE_CONFIGURING_DONE; - } - break; - - case UHS_USB_HOST_STATE_CHECK: - // Serial.println((uint32_t)__builtin_return_address(0), HEX); - break; - case UHS_USB_HOST_STATE_CONFIGURING_DONE: - usb_task_state = UHS_USB_HOST_STATE_RUNNING; - break; - #ifdef USB_HOST_MANUAL_POLL - case UHS_USB_HOST_STATE_RUNNING: - case UHS_USB_HOST_STATE_ERROR: - case UHS_USB_HOST_STATE_IDLE: - case UHS_USB_HOST_STATE_ILLEGAL: - enable_frame_irq(false); - break; - #else - case UHS_USB_HOST_STATE_RUNNING: - Poll_Others(); - for(x = 0; (usb_task_state == UHS_USB_HOST_STATE_RUNNING) && (x < UHS_HOST_MAX_INTERFACE_DRIVERS); x++) { - if(devConfig[x]) { - if(devConfig[x]->bPollEnable) devConfig[x]->Poll(); - } - } - // fall thru - #endif - default: - // Do nothing - break; - } // switch( usb_task_state ) - DDSB(); -#if USB_HOST_SHIELD_USE_ISR - if(condet) { - VBUS_changed(); - noInterrupts(); - condet = false; - interrupts(); - } -#endif -#ifdef USB_HOST_SHIELD_TIMING_PIN - // My counter/timer can't work on an inverted gate signal - // so we gate using a high pulse -- AJK - UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, LOW); -#endif - //usb_task_polling_disabled--; - EnablePoll(); - DDSB(); -} - - -/* USB main task. Services the MAX3421e */ -#if !USB_HOST_SHIELD_USE_ISR - -void UHS_NI MAX3421E_HOST::ISRTask() { -} -void UHS_NI MAX3421E_HOST::Task() -#else - -void UHS_NI MAX3421E_HOST::Task() { -#ifdef USB_HOST_MANUAL_POLL - if(usb_task_state == UHS_USB_HOST_STATE_RUNNING) { - noInterrupts(); - for(uint8_t x = 0; x < UHS_HOST_MAX_INTERFACE_DRIVERS; x++) - if(devConfig[x] && devConfig[x]->bPollEnable) - devConfig[x]->Poll(); - interrupts(); - } -#endif -} - -void UHS_NI MAX3421E_HOST::ISRTask() -#endif -{ - DDSB(); - -#ifndef SWI_IRQ_NUM - suspend_host(); -#if USB_HOST_SHIELD_USE_ISR - // Enable interrupts - interrupts(); -#endif -#endif - - counted = false; - if(!MARLIN_UHS_READ_IRQ()) { - uint8_t HIRQALL = regRd(rHIRQ); //determine interrupt source - uint8_t HIRQ = HIRQALL & IRQ_CHECK_MASK; - uint8_t HIRQ_sendback = 0x00; - - if((HIRQ & bmCONDETIRQ) || (HIRQ & bmBUSEVENTIRQ)) { - MAX_HOST_DEBUG - (PSTR("\r\nBEFORE CDIRQ %s BEIRQ %s resetting %s state 0x%2.2x\r\n"), - (HIRQ & bmCONDETIRQ) ? "T" : "F", - (HIRQ & bmBUSEVENTIRQ) ? "T" : "F", - doingreset ? "T" : "F", - usb_task_state - ); - } - // ALWAYS happens BEFORE or WITH CONDETIRQ - if(HIRQ & bmBUSEVENTIRQ) { - HIRQ_sendback |= bmBUSEVENTIRQ; - if(!doingreset) condet = true; - busprobe(); - busevent = false; - } - - if(HIRQ & bmCONDETIRQ) { - HIRQ_sendback |= bmCONDETIRQ; - if(!doingreset) condet = true; - busprobe(); - } - -#if 1 - if((HIRQ & bmCONDETIRQ) || (HIRQ & bmBUSEVENTIRQ)) { - MAX_HOST_DEBUG - (PSTR("\r\nAFTER CDIRQ %s BEIRQ %s resetting %s state 0x%2.2x\r\n"), - (HIRQ & bmCONDETIRQ) ? "T" : "F", - (HIRQ & bmBUSEVENTIRQ) ? "T" : "F", - doingreset ? "T" : "F", - usb_task_state - ); - } -#endif - - if(HIRQ & bmFRAMEIRQ) { - HIRQ_sendback |= bmFRAMEIRQ; - if(sof_countdown) { - sof_countdown--; - counted = true; - } - sofevent = false; - } - - //MAX_HOST_DEBUG(PSTR("\r\n%s%s%s\r\n"), - // sof_countdown ? "T" : "F", - // counted ? "T" : "F", - // usb_task_polling_disabled? "T" : "F"); - DDSB(); - regWr(rHIRQ, HIRQ_sendback); -#ifndef SWI_IRQ_NUM - resume_host(); -#if USB_HOST_SHIELD_USE_ISR - // Disable interrupts - noInterrupts(); -#endif -#endif - if(!sof_countdown && !counted && !usb_task_polling_disabled) { - DisablePoll(); - //usb_task_polling_disabled++; -#ifdef USB_HOST_SHIELD_TIMING_PIN - // My counter/timer can't work on an inverted gate signal - // so we gate using a high pulse -- AJK - UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, HIGH); -#endif - -#ifdef SWI_IRQ_NUM - // MAX_HOST_DEBUG(PSTR("--------------- Doing SWI ----------------")); - exec_SWI(this); -#else -#if USB_HOST_SHIELD_USE_ISR - // Enable interrupts - interrupts(); -#endif /* USB_HOST_SHIELD_USE_ISR */ - ISRbottom(); -#endif /* SWI_IRQ_NUM */ - } - } -} - -#if 0 -DDSB(); -#endif -#else -#error "Never include USB_HOST_SHIELD_INLINE.h, include UHS_host.h instead" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h deleted file mode 100644 index 114064044d..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * File: macro_logic.h - * Author: root - * - * Created on December 22, 2018, 4:49 AM - * - * To test: - * gcc -DAJK_TEST_MACRO_LOGIC -E macro_logic.h - * - */ - -#ifndef MACRO_LOGIC_H -#define MACRO_LOGIC_H - -#define AJK_CAT(a, ...) AJK_PRIMITIVE_CAT(a, __VA_ARGS__) -#define AJK_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ - -#define AJK_COMPL(b) AJK_PRIMITIVE_CAT(AJK_COMPL_, b) -#define AJK_COMPL_0 1 -#define AJK_COMPL_1 0 - -#define AJK_BITAND(x) AJK_PRIMITIVE_CAT(AJK_BITAND_, x) -#define AJK_BITAND_0(y) 0 -#define AJK_BITAND_1(y) y - -#define AJK_INC(x) AJK_PRIMITIVE_CAT(AJK_INC_, x) -#define AJK_INC_0 1 -#define AJK_INC_1 2 -#define AJK_INC_2 3 -#define AJK_INC_3 4 -#define AJK_INC_4 5 -#define AJK_INC_5 6 -#define AJK_INC_6 7 -#define AJK_INC_7 8 -#define AJK_INC_8 9 -#define AJK_INC_9 10 -#define AJK_INC_10 10 - -#define AJK_DEC(x) AJK_PRIMITIVE_CAT(AJK_DEC_, x) -#define AJK_DEC_0 0 -#define AJK_DEC_1 0 -#define AJK_DEC_2 1 -#define AJK_DEC_3 2 -#define AJK_DEC_4 3 -#define AJK_DEC_5 4 -#define AJK_DEC_6 5 -#define AJK_DEC_7 6 -#define AJK_DEC_8 7 -#define AJK_DEC_9 8 -#define AJK_DEC_10 9 - -#define AJK_CHECK_N(x, n, ...) n -#define AJK_CHECK(...) AJK_CHECK_N(__VA_ARGS__, 0,) -#define AJK_PROBE(x) x, 1, - -#define AJK_IS_PAREN(x) AJK_CHECK(AJK_IS_PAREN_PROBE x) -#define AJK_IS_PAREN_PROBE(...) AJK_PROBE(~) - -#define AJK_NOT(x) AJK_CHECK(AJK_PRIMITIVE_CAT(AJK_NOT_, x)) -#define AJK_NOT_0 AJK_PROBE(~) - -#define AJK_COMPL(b) AJK_PRIMITIVE_CAT(AJK_COMPL_, b) -#define AJK_COMPL_0 1 -#define AJK_COMPL_1 0 - -#define AJK_BOOL(x) AJK_COMPL(AJK_NOT(x)) - -#define AJK_IIF(c) AJK_PRIMITIVE_CAT(AJK_IIF_, c) -#define AJK_IIF_0(t, ...) __VA_ARGS__ -#define AJK_IIF_1(t, ...) t - -#define AJK_IF(c) AJK_IIF(AJK_BOOL(c)) - -#define AJK_EAT(...) -#define AJK_EXPAND(...) __VA_ARGS__ -#define AJK_WHEN(c) AJK_IF(c)(AJK_EXPAND, AJK_EAT) - -#define AJK_EMPTY() -#define AJK_DEFER(id) id AJK_EMPTY() -#define AJK_OBSTRUCT(id) id AJK_DEFER(AJK_EMPTY)() - -#define AJK_EVAL(...) AJK_EVAL1(AJK_EVAL1(AJK_EVAL1(__VA_ARGS__))) -#define AJK_EVAL1(...) AJK_EVAL2(AJK_EVAL2(AJK_EVAL2(__VA_ARGS__))) -#define AJK_EVAL2(...) AJK_EVAL3(AJK_EVAL3(AJK_EVAL3(__VA_ARGS__))) -#define AJK_EVAL3(...) AJK_EVAL4(AJK_EVAL4(AJK_EVAL4(__VA_ARGS__))) -#define AJK_EVAL4(...) AJK_EVAL5(AJK_EVAL5(AJK_EVAL5(__VA_ARGS__))) -#define AJK_EVAL5(...) __VA_ARGS__ - -#define AJK_REPEAT(AJK_count, AJK_macro, ...) \ - AJK_WHEN(AJK_count) \ - ( \ - AJK_OBSTRUCT(AJK_REPEAT_INDIRECT) () \ - ( \ - AJK_DEC(AJK_count), AJK_macro, __VA_ARGS__ \ - ) \ - AJK_OBSTRUCT(AJK_macro) \ - ( \ - AJK_DEC(AJK_count), __VA_ARGS__ \ - ) \ - ) -#define AJK_REPEAT_INDIRECT() AJK_REPEAT - -#define AJK_WHILE(AJK_pred, AJK_op, ...) \ - IF(AJK_pred(__VA_ARGS__)) \ - ( \ - AJK_OBSTRUCT(AJK_WHILE_INDIRECT) () \ - ( \ - AJK_pred, AJK_op, AJK_op(__VA_ARGS__) \ - ), \ - __VA_ARGS__ \ - ) -#define AJK_WHILE_INDIRECT() AJK_WHILE - -#define AJK_PRIMITIVE_COMPARE(x, y) AJK_IS_PAREN \ -( \ - AJK_COMPARE_ ## x ( AJK_COMPARE_ ## y) (()) \ -) - -#define AJK_IS_COMPARABLE(x) AJK_IS_PAREN( AJK_CAT(AJK_COMPARE_, x) (()) ) - -#define AJK_NOT_EQUAL(x, y) \ -AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \ -( \ - AJK_PRIMITIVE_COMPARE, \ - 1 AJK_EAT \ -)(x, y) - -#define AJK_EQUAL(x, y) AJK_COMPL(AJK_NOT_EQUAL(x, y)) - - -#define AJK_COMMA() , - -#define AJK_COMMA_IF(n) AJK_IF(n)(AJK_COMMA, AJK_EAT)() - - -#define AJK_COMMA_VAR(AJK_count, AJK_v) AJK_COMMA_IF(AJK_count) AJK_v ## AJK_count - -#define AJK_MAKE_LIST(AJK_v, AJK_count) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_COMMA_VAR, AJK_v)) - -#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)) -#ifdef AJK_TEST_MACRO_LOGIC - -#define BODY(AJKindex) some(C, statement); contaning(a, test[AJKindex]); -#define ZERO_TIMES_TEST 0 -#define THREE_TIMES_TEST 3 -blank > AJK_MAKE_LIST(VARIABLE_, ZERO_TIMES_TEST) < because zero repeats -Make 3 comma separated indexed variables : AJK_MAKE_LIST(VARIABLE_, THREE_TIMES_TEST) -Make 3 bogus function bodies -AJK_MAKE_FUNS(unsigned Cfunc,(arg1, arg2),3,BODY) -#endif - -#endif /* MACRO_LOGIC_H */ diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h deleted file mode 100644 index 5408a94ade..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - * File: SWI_INLINE.h - * Author: xxxajk@gmail.com - * - * Created on December 5, 2014, 9:40 AM - * - * This is the actual library. - * There are no 'c' or 'cpp' files. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifdef DYN_SWI_H -#ifndef SWI_INLINE_H -#define SWI_INLINE_H - -#ifndef SWI_MAXIMUM_ALLOWED -#define SWI_MAXIMUM_ALLOWED 4 -#endif - - - -#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) -static char dyn_SWI_initied = 0; -static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED]; -static dyn_SWI* dyn_SWI_EXEC[SWI_MAXIMUM_ALLOWED]; -#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() { - __asm__ volatile ("dsb"); -} -#endif // defined(__USE_CMSIS_VECTORS__) -#else // defined(__arm__) -__attribute__((always_inline)) static inline void __DSB() { - __asm__ volatile ("sync" : : : "memory"); -} -#endif // defined(__arm__) - -/** - * Execute queued class ISR routines. - */ -#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 -#ifdef __PIC32MZXX__ - __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) -#else - __attribute__((interrupt(),nomips16)) -#endif - softISR() { -#else -#ifdef ARDUINO_spresense_ast -unsigned int softISR() { -#else -void softISR() { -#endif -#endif - - // - // TO-DO: Perhaps limit to 8, and inline this? - // - - - // Make a working copy, while clearing the queue. - noInterrupts(); -#ifdef ARDUINO_ARCH_PIC32 - //ifs->clr = swibit; -#endif - for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { - dyn_SWI_EXEC[i] = dyn_SWI_LIST[i]; - dyn_SWI_LIST[i] = NULL; - } - __DSB(); - interrupts(); - - // Execute each class SWI - for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { - if(dyn_SWI_EXEC[i]) { -#ifdef __DYN_SWI_DEBUG_LED__ - digitalWrite(__DYN_SWI_DEBUG_LED__, HIGH); -#endif - dyn_SWI_EXEC[i]->dyn_SWISR(); -#ifdef __DYN_SWI_DEBUG_LED__ - digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); -#endif - } - } -#ifdef ARDUINO_ARCH_PIC32 - noInterrupts(); - if(!dyn_SWI_EXEC[0]) ifs->clr = swibit; - interrupts(); -#endif -#ifdef ARDUINO_spresense_ast - return 0; -#endif -} - -#define DDSB() __DSB() -#endif - - -#ifdef __arm__ -#ifndef interruptsStatus -#define interruptsStatus() __interruptsStatus() -static inline unsigned char __interruptsStatus() __attribute__((always_inline, unused)); - -static inline unsigned char __interruptsStatus() { - unsigned int primask; - asm volatile ("mrs %0, primask" : "=r" (primask)); - if(primask) return 0; - return 1; -} -#endif - -/** - * Initialize the Dynamic (class) Software Interrupt - */ -static void Init_dyn_SWI() { - if(!dyn_SWI_initied) { -#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 */ - } - /* relocate vector table */ - noInterrupts(); - SCB->VTOR = reinterpret_cast(&_VectorsRam); - DDSB(); - interrupts(); -#endif -#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); - DDSB(); - interrupts(); - NVIC_SET_PRIORITY(SWI_IRQ_NUM, 255); - NVIC_ENABLE_IRQ(SWI_IRQ_NUM); -#endif -#ifdef __DYN_SWI_DEBUG_LED__ - pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); - digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); -#endif - dyn_SWI_initied = 1; - } -} - -/** - * - * @param klass class that extends dyn_SWI - * @return 0 on queue full, else returns queue position (ones based) - */ -int exec_SWI(const dyn_SWI* klass) { - int rc = 0; - - uint8_t irestore = interruptsStatus(); - // Allow use from inside a critical section... - // ... and prevent races if also used inside an ISR - noInterrupts(); - for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { - if(!dyn_SWI_LIST[i]) { - rc = 1 + i; // Success! - dyn_SWI_LIST[i] = (dyn_SWI*)klass; -#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 - // Hopefully the value of Zero is legal. - // 1 microsecond latency would suck! - attachTimerInterrupt(softISR, 100); -#endif - DDSB(); - break; - } - } - // Restore interrupts, if they were on. - if(irestore) interrupts(); - return rc; -} -#elif defined(ARDUINO_ARCH_PIC32) - -/** - * Initialize the Dynamic (class) Software Interrupt - */ -static void Init_dyn_SWI() { - if(!dyn_SWI_initied) { - uint32_t sreg = disableInterrupts(); - - setIntVector(SWI_VECTOR, softISR); - setIntPriority(SWI_VECTOR, 1, 1); // Lowest priority, ever. - ifs->clr = swibit; - iec->clr = swibit; - iec->set = swibit; - restoreInterrupts(sreg); -#ifdef __DYN_SWI_DEBUG_LED__ - pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); - UHS_PIN_WRITE(__DYN_SWI_DEBUG_LED__, LOW); -#endif - } -} - -/** - * - * @param klass class that extends dyn_SWI - * @return 0 on queue full, else returns queue position (ones based) - */ -int exec_SWI(const dyn_SWI* klass) { - int rc = 0; - uint32_t sreg = disableInterrupts(); - for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { - if(!dyn_SWI_LIST[i]) { - rc = 1 + i; // Success! - dyn_SWI_LIST[i] = (dyn_SWI*)klass; - if(!(ifs->reg & swibit)) ifs->set = swibit; - ; - break; - } - } - restoreInterrupts(sreg); - return rc; -} - -#endif /* defined(__arm__) */ -#endif /* SWI_INLINE_H */ -#else -#error "Never include SWI_INLINE.h directly, include dyn_SWI.h instead" -#endif diff --git a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h deleted file mode 100644 index 0fdb3ee3db..0000000000 --- a/Marlin_thinkerV2/Marlin2.0/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * File: dyn_SWI.h - * Author: xxxajk@gmail.com - * - * Created on December 5, 2014, 9:12 AM - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DYN_SWI_H -#define DYN_SWI_H - - -#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) -#ifdef ARDUINO_ARCH_PIC32 -#include -#endif -#ifdef __cplusplus - -#ifdef true -#undef true -#endif - -#ifdef false -#undef false -#endif - -#endif - -#ifdef ARDUINO_spresense_ast -#define SWI_IRQ_NUM 666 // because this board is totally evil. -#elif defined(ARDUINO_ARCH_PIC32) -#ifndef SWI_IRQ_NUM -#ifdef _DSPI0_IPL_ISR -#define SWI_IPL _DSPI0_IPL_ISR -#define SWI_VECTOR _DSPI0_ERR_IRQ -#define SWI_IRQ_NUM _DSPI0_ERR_IRQ -#elif defined(_PMP_ERROR_IRQ) -#define SWI_IRQ_NUM _PMP_ERROR_IRQ -#define SWI_VECTOR _PMP_VECTOR -#else -#error SWI_IRQ_NUM and SWI_VECTOR need a definition -#endif -#ifdef __cplusplus -extern "C" -{ - void -#ifdef __PIC32MZXX__ - __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) -#else - __attribute__((interrupt(),nomips16)) -#endif - softISR(); -} -#endif -#endif -#elif !defined(NVIC_NUM_INTERRUPTS) -// Assume CMSIS -#define __USE_CMSIS_VECTORS__ -#ifdef NUMBER_OF_INT_VECTORS -#define NVIC_NUM_INTERRUPTS (NUMBER_OF_INT_VECTORS-16) -#else -#define NVIC_NUM_INTERRUPTS ((int)PERIPH_COUNT_IRQn) -#endif -#define VECTORTABLE_SIZE (NVIC_NUM_INTERRUPTS+16) -#define VECTORTABLE_ALIGNMENT (0x100ul) -#define NVIC_GET_ACTIVE(n) NVIC_GetActive((IRQn_Type)n) -#define NVIC_GET_PENDING(n) NVIC_GetPendingIRQ((IRQn_Type)n) -#define NVIC_SET_PENDING(n) NVIC_SetPendingIRQ((IRQn_Type)n) -#define NVIC_ENABLE_IRQ(n) NVIC_EnableIRQ((IRQn_Type)n) -#define NVIC_SET_PRIORITY(n ,p) NVIC_SetPriority((IRQn_Type)n, (uint32_t) p) -//extern "C" { -// extern uint32_t _VectorsRam[VECTORTABLE_SIZE] __attribute__((aligned(VECTORTABLE_ALIGNMENT))); -//} - -#ifndef SWI_IRQ_NUM -#if defined(__SAM3X8E__) && defined(_VARIANT_ARDUINO_DUE_X_) -// DUE -// Choices available: -// HSMCI_IRQn Multimedia Card Interface (HSMCI) -// EMAC_IRQn Ethernet MAC (EMAC) -// EMAC is not broken out on the official DUE, but is on clones. -// SPI0_IRQn Serial Peripheral Interface (SPI0) -// SPI0_IRQn seems to be the best choice, as long as nobody uses an ISR based master -#define SWI_IRQ_NUM SPI0_IRQn -#elif defined(ARDUINO_SAMD_ZERO) -// Just use sercom4's unused IRQ vector. -#define SWI_IRQ_NUM I2S_IRQn -//#define SWI_IRQ_NUM SERCOM4_IRQn -#endif -#endif - -#ifndef SWI_IRQ_NUM -#error SWI_IRQ_NUM not defined (CMSIS) -#endif - -#elif defined(CORE_TEENSY) - -#ifndef NVIC_GET_ACTIVE -#define NVIC_GET_ACTIVE(n) (*((volatile uint32_t *)0xE000E300 + ((n) >> 5)) & (1 << ((n) & 31))) -#endif -#ifndef NVIC_GET_PENDING -#define NVIC_GET_PENDING(n) (*((volatile uint32_t *)0xE000E200 + ((n) >> 5)) & (1 << ((n) & 31))) -#ifndef SWI_IRQ_NUM -#ifdef __MK20DX256__ -#define SWI_IRQ_NUM 17 -#elif defined(__MK20DX128__) -#define SWI_IRQ_NUM 5 -#elif defined(__MKL26Z64__) -#define SWI_IRQ_NUM 4 -#elif defined(__MK66FX1M0__) -#define SWI_IRQ_NUM 30 -#elif defined(__MK64FX512__) -#define SWI_IRQ_NUM 30 -#elif defined(__IMXRT1052__) || defined(__IMXRT1062__) -#define SWI_IRQ_NUM 71 -#else -#error Do not know how to relocate IRQ vectors for this pjrc product -#endif -#endif -#endif -#else // Not CMSIS or PJRC CORE_TEENSY or PIC32 or SPRESENSE -#error Do not know how to relocate IRQ vectors or perform SWI -#endif // SWI_IRQ_NUM - - -#ifndef SWI_IRQ_NUM -#error SWI_IRQ_NUM not defined -#else -/** - * Use this class to extend your class, in order to provide - * a C++ context callable SWI. - */ -class dyn_SWI { -public: - - /** - * Override this method with your code. - */ - virtual void dyn_SWISR() { - }; -}; - -extern int exec_SWI(const dyn_SWI* klass); - -#include "SWI_INLINE.h" - -// IMPORTANT! Define this so that you do NOT end up with a NULL stub! -#define SWI_NO_STUB -#endif /* SWI_IRQ_NUM */ -#endif /* __arm__ */ - -// if no SWI for CPU (e.g. AVR) make a void stub. -#ifndef SWI_NO_STUB -#define Init_dyn_SWI() (void(0)) -#ifndef DDSB -#define DDSB() (void(0)) -#endif -#endif -#endif /* DYN_SWI_H */ diff --git a/TMC2208/TMC2208_v12.pcb b/TMC2208/TMC2208_v12.pcb deleted file mode 100644 index 200c8b1d74..0000000000 Binary files a/TMC2208/TMC2208_v12.pcb and /dev/null differ diff --git a/TMC2208/readme.txt b/TMC2208/readme.txt deleted file mode 100644 index 9b47ac6c98..0000000000 --- a/TMC2208/readme.txt +++ /dev/null @@ -1,4 +0,0 @@ - -This design is based on:watterott/SilentStepStick - -https://github.com/watterott/SilentStepStick \ No newline at end of file diff --git a/drivers/CH34x_Install_Windows_v3_4.zip b/drivers/CH34x_Install_Windows_v3_4.zip deleted file mode 100644 index eede55e6fa..0000000000 Binary files a/drivers/CH34x_Install_Windows_v3_4.zip and /dev/null differ diff --git a/drivers/arduino.png b/drivers/arduino.png deleted file mode 100644 index edac62c1d7..0000000000 Binary files a/drivers/arduino.png and /dev/null differ diff --git a/drivers/eryone.png b/drivers/eryone.png deleted file mode 100644 index 9657e00bdb..0000000000 Binary files a/drivers/eryone.png and /dev/null differ diff --git a/drivers/probe.png b/drivers/probe.png deleted file mode 100644 index f7506bd3ce..0000000000 Binary files a/drivers/probe.png and /dev/null differ diff --git a/hex/Marlin20190505.hex b/hex/Marlin20190505.hex deleted file mode 100644 index fd79582b02..0000000000 --- a/hex/Marlin20190505.hex +++ /dev/null @@ -1,7819 +0,0 @@ -:100000000C94AE180C94DF180C94DF180C94DF18C5 -:100010000C94DF180C94DF180C94DF180C94DF1884 -:100020000C94DF180C94DF180C94DF180C94DF1874 -:100030000C94DF180C94DF180C94DF180C94DF1864 -:100040000C94DF180C9482560C94DF180C94DF1873 -:100050000C94DF180C94DF180C9491A80C94F9DB25 -:100060000C94DF180C944C380C94DF180C94DF18A7 -:100070000C94DF180C94DF180C94DF180C94DF1824 -:100080000C94DF180C94DF180C94DF180C94DF1814 -:100090000C94DF180C94DF180C94DF180C94DF1804 -:1000A0000C94DF180C94DF180C94DF180C94DF18F4 -:1000B0000C94DF180C94DF180C94DF180C94DF18E4 -:1000C0000C94DF180C94DF180C94DF180C94DF18D4 -:1000D0000C94DF180C94DF180C94DF180C94DF18C4 -:1000E0000C94DF18F5B9F8B9E7B9EBB9F1B92FBA43 -:1000F000FCB900BA06BA0ABA0EBA14BA18BA1CBACF -:100100002FBA22BA26BA2ABAB2BDB7BDBCBDC6BD87 -:10011000D0BD49BEDABDE2BDEABDF4BDFEBD08BE3C -:1001200017BE21BE49BE2BBE35BE3FBEABC7F4C510 -:100130002CC6E7C72CC62CC62CC62CC62CC62CC673 -:100140002CC62CC62CC62CC62CC62CC62CC62CC61F -:100150002CC62CC62CC62CC62CC62CC62CC62CC60F -:100160002CC62CC62CC62CC6E1C72CC62CC62CC649 -:100170002CC62CC62CC62CC62CC6BAC72CC62CC660 -:100180002CC62CC62CC62CC62CC62CC62CC62CC6DF -:10019000FEC729C6084AD73B3BCE016E84BCBFFDD3 -:1001A000C12F3D6C74319ABD56833DDA3D00C77F47 -:1001B00011BED9E4BB4C3E916BAAAABE00000080E0 -:1001C0003F05A84CCDB2D44EB93836A9020C50B96F -:1001D000918688083CA6AAAA2ABE000000803F009B -:1001E0004E414E494E495459494E46CDCCCC3D0A1C -:1001F000D7233C17B7D13877CC2B329595E6241FFF -:10020000B14F0A000020410000C84200401C4620B7 -:10021000BCBE4CCA1B0E5AAEC59D74434F4D4D55C6 -:100220004E49434154494F4E0044525952554E0095 -:100230004552524F525300494E464F004543484F96 -:100240000047322F47332062616420706172616D14 -:1002500065746572730A00536C6565702E2E2E00EE -:10026000436C69636B20746F20726573756D652EC6 -:100270002E2E004E6F206D6F76652E00456E642029 -:1002800066696C65206C6973740A00426567696E03 -:100290002066696C65206C6973740A00286E6F2093 -:1002A00066696C65290043757272656E74206669B3 -:1002B0006C653A200046696C652064656C65746500 -:1002C000643A0044656C6574696F6E206661696CA0 -:1002D00065642C2046696C653A2000256973002509 -:1002E000696D20256973002569682025696D2025C1 -:1002F000697300256964202569682025696D2025BA -:10030000697300256979202569642025696820259D -:10031000696D20256973005072696E742074696D6F -:10032000653A20003C023702300229021B026F6648 -:10033000660044454255473A004B494C4C45442ED3 -:1003400020004D3131332053006F6B003344205077 -:1003500072696E746572204F66662E00544845526D -:100360004D414C5F50524F54454354494F4E00410C -:1003700055544F5245504F52545F53445F5354416C -:1003800054555300454D455247454E43595F5041E2 -:100390005253455200434153455F4C494748545FCF -:1003A0004252494748544E45535300544F47474CD7 -:1003B000455F4C494748545300534F4654574152A8 -:1003C000455F504F574552004255494C445F504598 -:1003D0005243454E54004C4556454C494E475F44A8 -:1003E000415441005A5F50524F4245004155544FCD -:1003F0004C4556454C005052494E545F4A4F4200BE -:1004000050524F4752455353004155544F52455057 -:100410004F52545F54454D5000564F4C554D455426 -:1004200052494300454550524F4D005345524941B2 -:100430004C5F584F4E5F584F4646004649524D5705 -:100440004152455F4E414D453A4D61726C696E2097 -:10045000312E312E3920284769746875622920535E -:100460004F555243455F434F44455F55524C3A68A0 -:10047000747470733A2F2F6769746875622E636F96 -:100480006D2F4D61726C696E4669726D7761726530 -:100490002F4D61726C696E2050524F544F434F4C38 -:1004A0005F56455253494F4E3A312E30204D41430D -:1004B00048494E455F545950453A3344205072697B -:1004C0006E7465722045585452554445525F434FEF -:1004D000554E543A3120555549443A636564653266 -:1004E0006132662D343161322D343734382D396222 -:1004F00031322D6335356336326633363766660AF8 -:10050000002F2F20004D31343520533C696E646537 -:10051000783E206F7574206F662072616E6765206B -:1005200028302D31290A00205400205200416363F5 -:10053000656C65726174696F6E3A20500020466C7C -:100540006F773A2000000125301D0CFF2829FF2479 -:10055000311C0BFF4527FF232F1B0AFF4443FFFFDE -:10056000FF0403080602FF222B1A4142FF03380949 -:10057000FF3620643A0020693A0020703A00496E44 -:1005800076616C69642065787472756465720A00BE -:1005900043290A0061626C656420286D696E2074CD -:1005A000656D702000436F6C6420657874727564AB -:1005B000657320617265200020643A0020693A006A -:1005C00020703A004E6F2063617365206C69676824 -:1005D000740A00454550524F4D204F4B0A0041636D -:1005E000746976652045787472756465723A200086 -:1005F000496E76616C6964206578747275646572A1 -:100600000A00656E7175657565696E672022004B1D -:10061000494C4C45442E200053544F505045442ED5 -:1006200020005072696E7465722073746F7070650B -:10063000642064756520746F206572726F72732E0A -:100640002046697820746865206572726F72206137 -:100650006E6420757365204D39393920746F2072AE -:100660006573746172742E202854656D70657261B3 -:10067000747572652069732072657365742E2053DA -:100680006574206974206166746572207265737484 -:10069000617274696E67290A004E6F204368656352 -:1006A0006B73756D2077697468206C696E65206E58 -:1006B000756D6265722C204C617374204C696E6597 -:1006C0003A20004E6F20436865636B73756D207729 -:1006D000697468206C696E65206E756D6265722C38 -:1006E000204C617374204C696E653A200063686524 -:1006F000636B73756D206D69736D617463682C2015 -:100700004C617374204C696E653A20004C696E65CB -:10071000204E756D626572206973206E6F74204C77 -:10072000617374204C696E65204E756D6265722B25 -:10073000312C204C617374204C696E653A20004D59 -:10074000313130004D3331004732382058004D32BE -:10075000310053442072656164206572726F720AC1 -:1007600000446F6E65207072696E74696E672066F2 -:10077000696C650A0020496E76616C696420657851 -:1007800074727564657220000000000000000000B3 -:100790000000000000009643000096430000C8439C -:1007A000486F6D696E67206661696C6564005072A0 -:1007B0006F7465637465642050696E0A0020573A4F -:1007C000004520436F6F6C696E672E2E2E0045200A -:1007D00048656174696E672E2E2E000000000000CF -:1007E00000000000000000000000000000E0000029 -:1007F00000000000000000000000000003F0000006 -:1008000000000000000000000000000007FC0000E5 -:1008100000000000000000000000000007FF0000D2 -:10082000000000000000000000000000C3FFC00046 -:10083000000000000000000000000001E1FFE000F7 -:10084000000000000000000000000003F07FF8003E -:10085000000000000000000000000007F81FFE007C -:1008600000000000000000000000000FF807FF007B -:1008700000000000000000000000001FF003FE0068 -:1008800000000000000000000000003FE000FC004D -:1008900000000000000000000000007FC0003800E1 -:1008A00000000000000000000000007F80001080B9 -:1008B00000000000000000000000007F0000038036 -:1008C00000000000000000000000007E0020078300 -:1008D000FF87FF100081C0600C7FF87C00700F87DD -:1008E000FFCFFF980187F0700CFFFC7C01FE0F80AA -:1008F000000C019C038E38780C00007C07FC0F80F4 -:10090000000C018E071C1C7C0C00007C01F00F8089 -:10091000000C01870E180C6E0C00007C00E00F83A9 -:10092000FF8FFF83FC3006660C7FF87C00000F878A -:10093000FFCFFF01F83006600CFFFC7C00800F80C9 -:10094000000C030060300660CC00007C01F00F80DA -:10095000000C018060180C60EC00007C03FC0F8030 -:10096000000C0180601C1C607C00007C0FF80F8074 -:10097000000C0180600E38603C00007C03E00F83B7 -:10098000FF8C01806007F0601C7FF87E01C00F873C -:10099000FFCC01806001C0600CFFFC7F00001F8065 -:1009A00000000000000000000000007FC0003F8049 -:1009B00000000000000000000000007FF000FF8049 -:1009C00000000000000000000000003FFC01FF806C -:1009D00000000000000000000000000FFF07FF0003 -:1009E000000000000000000000000003FF9FFC006A -:1009F000000000000000000000000000FF9FF80061 -:100A00000000000000000000000000003F9FE00028 -:100A10000000000000000000000000001F9F800098 -:100A2000000000000000000000000000079F000020 -:100A3000000000000000000000000000019C000019 -:100A400000000000000000000000000000000000A6 -:100A50000000000000000000000000000000000096 -:100A6000000000000000000000000025732C005A68 -:100A700025752C45256C752C50256C752C542575C9 -:100A80002C4225752C002020506C616E6E657242E0 -:100A9000756666657242797465733A200020467205 -:100AA0006565204D656D6F72793A2000436F6D70FA -:100AB000696C65643A204D617920203520323031EF -:100AC000390A00207C20417574686F723A202865CD -:100AD00072796F6E652C207468696E6B6572323541 -:100AE000363020636F6E666967290A00323031380C -:100AF0002D30382D303100204C61737420557064D6 -:100B0000617465643A2000312E312E390A004D613E -:100B1000726C696E0020536F667477617265205243 -:100B2000657365740A00205761746368646F672099 -:100B300052657365740A002042726F776E206F757C -:100B4000742052657365740A002045787465726E6E -:100B5000616C2052657365740A00506F7765725539 -:100B6000700A0073746172740A006175746F25698C -:100B70002E67006572726F722077726974696E6792 -:100B800020746F2066696C650A00456E6473746F2B -:100B900070732025632025632025632025630020B2 -:100BA0005A3A0020593A0020583A00656E6473742E -:100BB0006F7073206869743A20004D3130362053CD -:100BC0003230300047323820590047323820580040 -:100BD0004D31303920543020532575004D31393096 -:100BE0002053257500446F6E6520736176696E67CA -:100BF0002066696C652E0A004D32390045787472A2 -:100C000075646572004D6F7665205A004D6F76658C -:100C10002059004D6F7665205800507265706172E2 -:100C20006500496E697469616C697A652045455053 -:100C3000524F4D00436F6E74726F6C005265737447 -:100C40006F7265206661696C73616665004C6F61E7 -:100C5000642073657474696E677300496E697469A2 -:100C6000616C697A6520454550524F4D0053746F51 -:100C700072652073657474696E67730046696C6190 -:100C80006D656E74004D6F74696F6E0054656D70A4 -:100C900065726174757265004D61696E00507265B0 -:100CA000686561742041425320636F6E6600507224 -:100CB000656865617420504C4120636F6E6600501A -:100CC00049442D44005049442D44005049442D4985 -:100CD000005049442D49005049442D50005049448A -:100CE0002D500020082046616374002008204661D2 -:100CF0006374002008204D6178002008204D617841 -:100D0000002008204D6178002008204D696E0020E9 -:100D100008204D696E002008204D696E004F666600 -:100D2000004F6E20004175746F74656D70004661F0 -:100D30006E20737065656420330046616E207370A9 -:100D400065656420330046616E20737065656420BC -:100D5000330046616E207370656564203200466121 -:100D60006E20737065656420320046616E2073707A -:100D700065656420320046616E207370656564208D -:100D8000310046616E2073706565642031004661F4 -:100D90006E207370656564203100426564004265B1 -:100DA0006400426564004E6F7A7A6C65004E6F7A1B -:100DB0007A6C65004E6F7A7A6C6500436F6E747260 -:100DC0006F6C0053746F72652073657474696E671D -:100DD00073004265640042656400426564004E6FC2 -:100DE0007A7A6C65004E6F7A7A6C65004E6F7A7A0B -:100DF0006C650046616E2073706565640046616EC7 -:100E00002073706565640046616E2073706565646B -:100E10000054656D706572617475726500556E6B16 -:100E20006E6F776E20636F6D6D616E643A20220085 -:100E30005344207072696E74696E672062797465BC -:100E400020004E6F74205344207072696E74696E76 -:100E5000670A0020746F6F206C6F6E67206578746E -:100E6000727573696F6E2070726576656E746564F5 -:100E70000A0020636F6C6420657874727573696F03 -:100E80006E2070726576656E7465640A00577269CB -:100E900074696E6720746F2066696C653A20006F14 -:100EA00070656E206661696C65642C2046696C65AE -:100EB0003A20006F70656E206661696C65642C2055 -:100EC00046696C653A200046696C652073656C65FF -:100ED000637465640A002053697A653A20004669A4 -:100EE0006C65206F70656E65643A20002066696CE1 -:100EF000653A2000646F696E67006672657368000A -:100F00004E6F772000454E4420535542524F555462 -:100F1000494E450A002220706F73002220706172D2 -:100F2000656E743A2200535542524F5554494E450E -:100F30002043414C4C207461726765743A22004B27 -:100F4000494C4C45442E2000747279696E672074B8 -:100F50006F2063616C6C207375622D67636F6465CD -:100F60002066696C6573207769746820746F6F20E0 -:100F70006D616E79206C6576656C732E204D4158DD -:100F8000206C6576656C2069733A004572726F72E9 -:100F90003A006F70656E206661696C65642C20464E -:100FA000696C653A200043616E6E6F74206F7065E6 -:100FB0006E2073756264697220006563686F3A0021 -:100FC00024F4D43050C38E20C2A24017828B7011FB -:100FD000127A910D816CD90AA861E108C758660799 -:100FE000615143061E4B5D05C145A7041A4111041A -:100FF000093D9803713931034036DB0265339102B4 -:10100000D4305402802E1D02632CEE01752AC501D6 -:10101000B028A001102781018F2564012B244B01EA -:10102000E0223401AC211F018D200D01801FFC0046 -:10103000841EED00971DDF00B81CD200E61BC60021 -:10104000201BBC00641AB200B219A8000A19A00043 -:101050006A189900D117910040178B00B5168400CB -:1010600031167E00B31579003A157300C7146F006E -:1010700058146A00EE1366008813630025135E009F -:10108000C7125B006C12570015125400C1115100B9 -:1010900070114F0021114B00D61049008D104700F0 -:1010A0004610440002104200C00F4000800F3E0076 -:1010B000420F3C00060F3B00CB0E3800930E37006A -:1010C0005C0E3500270E3400F30D3200C10D3100E7 -:1010D000900D3000600D2E00320D2D00050D2C00FE -:1010E000D90C2B00AE0C2900850C29005C0C2700C4 -:1010F000350C27000E0C2600E80B2400C40B24003E -:10110000A00B23007D0B23005A0B2100390B21007B -:10111000180B2000F80A1F00D90A1E00BB0A1E0087 -:101120009D0A1D00800A1D00630A1C00470A1B005F -:101130002C0A1B00110A1A00F7091A00DD09190010 -:10114000C4091900AB091900920917007B0918009E -:10115000630917004C09160036091600200916000D -:101160000A091500F5081500E0081400CC08140061 -:10117000B8081400A4081400900813007D08120099 -:101180006B081300580812004608120034081100BA -:10119000230811001208110001081100F0071000C7 -:1011A000E0071000D0071000C0071000B0070F00C4 -:1011B000A107100091070E0083070F0074070F00AE -:1011C00065070E0057070E0049070E003B070D008C -:1011D0002E070E0020070D0013070D0006070D0057 -:1011E000F9060C00ED060D00E0060C00D4060C001C -:1011F000C8060C00BC060C00B0060C00A4060B00D0 -:1012000099060C008D060B0082060B0077060B007A -:101210006C060B0061060A0057060B004C060A001C -:1012200042060A0038060A002E060A0024060A00B2 -:101230001A060A001006090007060A00FD05090043 -:10124000F4050900EB050900E2050900D9050900CC -:10125000D0050900C7050900BE050900B50508004D -:10126000AD050800A50509009C05080094050800C7 -:101270008C050800840508007C050800740508003A -:101280006C050700650508005D05070056050800A8 -:101290004E05070047050700400508003805070010 -:1012A000310507002A050700230507001C05060075 -:1012B000160507000F0507000805060002050700D0 -:1012C000FB040600F5040700EE040600E80406002F -:1012D000E2040700DB040600D5040600CF04060084 -:1012E000C9040600C3040600BD040600B7040600D6 -:1012F000B1040500AC040600A6040600A004050025 -:101300009B04060095040500900406008A0405006D -:1013100085040500800406007A04050075040500B4 -:10132000700405006B0405006604050061040500F7 -:101330005C04050057040500520405004D04050037 -:1013400048040500430405003E0404003A04050077 -:1013500035040500300404002C04050027040400B3 -:10136000230405001E0404001A04040016040500EA -:10137000110404000D040400090405000404040021 -:1013800000040400FC030400F8030400F403040058 -:10139000F0030400EC030400E8030400E403040089 -:1013A000E0030400DC030400D8030400D4030400B9 -:1013B000D0030400CC030400C8030300C5030300EA -:1013C00024F404D9201BC40C5C0E9804C4095F02E9 -:1013D00065077101F405F900FB04B30048048700B8 -:1013E000C10369005803550003034500BE023A00DB -:1013F0008402310053022A00290225000402200041 -:10140000E4011C00C8011900AF0117009801140085 -:1014100084011300710110006101100051010E00E0 -:1014200043010D0036010B002B010B0020010B00C6 -:10143000150109000C01090003010800FB00080068 -:10144000F3000800EB000700E4000600DE000600E1 -:10145000D8000600D2000600CC000500C700050039 -:10146000C2000500BD000400B9000400B50004007E -:10147000B1000400AD000400A9000400A5000300B1 -:10148000A20003009F0004009B00030098000300DB -:101490009500020093000300900003008D000200FD -:1014A0008B00030088000200860002008400030015 -:1014B000810002007F0002007D0002007B0002002C -:1014C000790002007700010076000200740002003B -:1014D00072000100710002006F0002006D00010047 -:1014E0006C0002006A000100690002006700010050 -:1014F0006600010065000100640002006200010056 -:1015000061000100600001005F0002005D00010059 -:101510005C0001005B0001005A000100590001005D -:10152000580001005700010056000100550001005D -:10153000540001005300000053000100520001005C -:1015400051000100500001004F0001004E0000005A -:101550004E0001004D0001004C0001004B00000056 -:101560004B0001004A000100490001004800000052 -:10157000480001004700010046000000460001004D -:101580004500000045000100440001004300000048 -:101590004300010042000000420001004100000041 -:1015A00041000100400001003F0000003F00010039 -:1015B0003E0000003E0001003D0000003D00010033 -:1015C0003C0000003C0000003C0001003B0000002B -:1015D0003B0001003A0000003A0001003900000021 -:1015E0003900010038000000380000003800010018 -:1015F0003700000037000100360000003600000010 -:101600003600010035000000350000003500010003 -:1016100034000000340000003400010033000000FA -:1016200033000000330001003200000032000000EF -:1016300032000100310000003100000031000100E3 -:101640003000000030000000300001002F000000DA -:101650002F0000002F0000002F0001002E000000CE -:101660002E0000002E0001002D0000002D000000C3 -:101670002D0000002D0001002C0000002C000000B7 -:101680002C0000002C0001002B0000002B000000AB -:101690002B0000002B0001002A0000002A0000009F -:1016A0002A0000002A000100290000002900000093 -:1016B0002900000029000000290001002800000086 -:1016C0002800000028000000280000002800010079 -:1016D000270000002700000027000000270000006E -:1016E0002700010026000000260000002600000060 -:1016F0002600000026000100250000002500000053 -:101700002500000025000000250000002500010044 -:101710002400000024000000240000002400000039 -:10172000240001002300000023000000230000002B -:10173000230000002300000023000000230001001C -:101740002200000022000000220000002200000011 -:101750002200000022000100210000002100000002 -:1017600021000000210000002100000021000000F5 -:1017700021000100200000002000000020000000E7 -:1017800020000000200000002000000020000000D9 -:10179000200001001F0000001F0000001F000000CB -:1017A0001F0000001F0000001F0000001F000100BC -:1017B0001E0000001E0000001E0000001E000000B1 -:1017C000043700001E290000511B000058100000C3 -:1017D00010090000CC040000780200004101000064 -:1017E0004D31303420532575004739322045257559 -:1017F00000473932205A25752E2575004D35303079 -:10180000004E4F202000594553202000526573752B -:101810006D65205072696E74203F0025753A253041 -:10182000327500253032753A2530327500257564E1 -:1018300020253032753A25303275002020202020B6 -:1018400020005A00590020202020005800092000C4 -:101850000000000000000000000000003FFFF0005A -:1018600000000000000000000000003800700000D0 -:101870000000000000000000000030FC300000000C -:1018800000000000000000000020FC10000000002C -:1018900000000000000000002078100000000000A0 -:1018A00000000000000000203010000000000000D8 -:1018B0000000000000002C00D03FC000000000002D -:1018C00000002082002E31D07FE0000000000000E8 -:1018D000001041002F7BD07FE000000000000000DE -:1018E0001041002F7BD07FE00000000000000020AE -:1018F00082002E31D03FC0000000000000004104F3 -:10190000002C00D03FC00000000000000082080052 -:101910002030107FE000000000000000820800205E -:1019200078107FE00000000000000041040020FC6F -:10193000107FE00000000000000020820030FC303A -:101940001F80000000000000000000003800700F41 -:101950000000000000000000FFFFC03FFFF0060095 -:1019600000000000000000FFFFC0000000000000B9 -:101970000000000000000000003FFFF00000000039 -:1019800000000000000000003800700000000000AF -:101990000000000000000031863000000000000060 -:1019A000000000000000238710000000000000007D -:1019B00000000000002787900000000000000000E9 -:1019C000000000002F87D000000000000000000091 -:1019D0000000002F03D03FC00000000000000020E6 -:1019E00082002030107FE000000000000000104165 -:1019F000002078107FE0000000000000001041008F -:101A00002078107FE000000000000000208200200D -:101A100030103FC0000000000000004104002F0310 -:101A2000D03FC0000000000000008208002F87D0D7 -:101A30007FE0000000000000008208002787907F00 -:101A4000E0000000000000004104002387107FE058 -:101A5000000000000000002082003186301F80005E -:101A60000000000000000000003800700F000000BF -:101A70000000000000FFFFC03FFFF0060000000074 -:101A800000000000FFFFC0000000454550524F4DD0 -:101A9000206461746173697A65206572726F722E59 -:101AA0000A00290A002062797465733B206372631F -:101AB000200053657474696E67732053746F726588 -:101AC00064202800200D0A62797465733B206372DC -:101AD00063206572726F722000200D0A627974654E -:101AE000733B20637263206572726F7220007265AF -:101AF00061642066696C65206E616D653A2000291D -:101B00000A002062797465733B2063726320007061 -:101B10006F7765726F66662073746F726564207389 -:101B2000657474696E677320726574726965766531 -:101B300064202800290A002062797465733B2063C1 -:101B4000726320002073746F72656420736574740F -:101B5000696E6773207265747269657665642028A2 -:101B600000202863616C63756C6174656429210AC7 -:101B70000020213D2000454550524F4D2043524307 -:101B8000206D69736D61746368202D202873746FF4 -:101B90007265642920002053697A653A2000496EF5 -:101BA0006465783A2000204D61726C696E3D56354F -:101BB00035290A0028454550524F4D3D00454550B6 -:101BC000524F4D2076657273696F6E206D69736D2B -:101BD00061746368200048617264636F64656420A7 -:101BE00044656661756C742053657474696E6773BF -:101BF000204C6F616465640A00DC050000DC0500B0 -:101C00000032000000DC0500000000964300009652 -:101C1000430000A0400000C8410000A0420000A016 -:101C2000420000C8430000BA4220286D6D29002000 -:101C3000440020490020204D3330342050002044FF -:101C40000020490020204D333031205000504944BD -:101C50002073657474696E67733A0A002046002029 -:101C6000420020480020204D3134352053004D6182 -:101C700074657269616C206865617475702070614B -:101C800072616D65746572733A0A00205A002059BA -:101C90000020204D323036205800486F6D65206F8F -:101CA00066667365743A0A00204500205A00205980 -:101CB0000020580020540020530020204D323035A1 -:101CC00020420020453C6D61785F655F6A65726BFC -:101CD0003E0020583C6D61785F785F6A65726B3EAC -:101CE00020593C6D61785F795F6A65726B3E205A5E -:101CF0003C6D61785F7A5F6A65726B3E0041647625 -:101D0000616E6365643A20423C6D696E5F7365671E -:101D10006D656E745F74696D655F75733E20533CCD -:101D20006D696E5F66656564726174653E20543CE2 -:101D30006D696E5F74726176656C5F66656564720D -:101D40006174653E0020540020520020204D323046 -:101D500034205000416363656C65726174696F6E15 -:101D60002028756E6974732F7332293A20503C70A5 -:101D700072696E745F616363656C3E20523C72658C -:101D800074726163745F616363656C3E20543C747C -:101D9000726176656C5F616363656C3E0A00204525 -:101DA00000205A0020590020204D323031205800A8 -:101DB0004D6178696D756D20416363656C65726115 -:101DC00074696F6E2028756E6974732F7332293AA7 -:101DD0000A00204500205A0020590020204D3230B2 -:101DE000332058004D6178696D756D2066656564B6 -:101DF00072617465732028756E6974732F73293A44 -:101E00000A00204500205A0020590020204D393278 -:101E100020580053746570732070657220756E6968 -:101E2000743A0A0020204D3230302044300A00201D -:101E3000204D3230302044002044697361626C656B -:101E4000640A0046696C616D656E74207365747414 -:101E5000696E67733A0020204D3134392043203BAE -:101E600020556E69747320696E2043656C736975C3 -:101E7000730A002020473231202020203B007A5F67 -:101E80006D696E3A2000795F6D696E3A2000785F67 -:101E90006D696E3A20005265706F7274696E6720CA -:101EA000656E6473746F70207374617475730A0067 -:101EB00020573A0042656420636F6F6C696E672E2D -:101EC0002E2E004265642068656174696E672E2E4F -:101ED0002E00205A3A0020593A0020436F756E7444 -:101EE00020583A0020453A00205A3A0020593A003A -:101EF000583A003A004361703A00205A00205900D5 -:101F0000580020204D61783A2000205A00205900C6 -:101F1000580020204D696E3A20004F6E20004F6619 -:101F20006600536F667420656E6473746F70733AE5 -:101F300020004B64200023646566696E652044457B -:101F40004641554C545F004B692000236465666927 -:101F50006E652044454641554C545F004B7020004F -:101F600023646566696E652044454641554C545F5F -:101F700000504944204175746F74756E6520666920 -:101F80006E697368656421205075742074686520DB -:101F90006C617374204B702C204B6920616E64203F -:101FA0004B6420636F6E7374616E74732066726F1E -:101FB0006D2062656C6F7720696E746F20436F6E61 -:101FC00066696775726174696F6E2E680A005049A0 -:101FD00044204175746F74756E65206661696C6527 -:101FE00064212074696D656F75740A004531205451 -:101FF0004845524D414C2052554E4157415900429F -:10200000454420544845524D414C2052554E41576D -:10201000415900546865726D616C2052756E61772C -:1020200061790045312048656174696E6720666199 -:10203000696C6564004265642068656174696E67F7 -:10204000206661696C65640048656174696E67202B -:102050006661696C656400504944204175746F7411 -:10206000756E65206661696C6564212054656D70CC -:102070006572617475726520746F6F206869676836 -:102080000A00204B643A2000204B693A2000204B84 -:10209000703A20000A20436C6173736963205049D1 -:1020A00044200A002054753A2000204B753A200045 -:1020B000206D61783A2000206D696E3A200020641E -:1020C0003A200020626961733A200050494420415F -:1020D00075746F74756E65206661696C6564212026 -:1020E000426164206578747275646572206E756DE6 -:1020F0006265720A00504944204175746F74756EB0 -:10210000652073746172740A00486F6D65202573D1 -:102110002573257320666972737400206669727373 -:10212000740A005A0059005800486F6D6520004F2E -:10213000666673657473206170706C6965640045D0 -:1021400072723A20546F6F206661722100546F6F73 -:10215000206661722066726F6D20726566657265B9 -:102160006E636520706F696E740A007C3C3E5E2B66 -:102170003D3F2F5B5D3B2C2A225C00526573656EF0 -:10218000643A20006F6B0020746F6F206C6F6E6775 -:1021900020657874727573696F6E207072657665EC -:1021A0006E7465640A0020636F6C642065787472D5 -:1021B0007573696F6E2070726576656E7465640AFA -:1021C00000627573793A2070617573656420666F7B -:1021D0007220696E7075740A00627573793A2070A6 -:1021E000617573656420666F7220757365720A008D -:1021F000627573793A2070726F63657373696E6785 -:102200000A004B494C4C45442E20004B494C4C2075 -:10221000636175736564206279204B494C4C206280 -:102220007574746F6E2F70696E0A004B494C4C4583 -:10223000442E20004B494C4C20636175736564202B -:10224000627920746F6F206D75636820696E6163B9 -:10225000746976652074696D65202D2063757272CE -:10226000656E7420636F6D6D616E643A2000506C12 -:1022700065617365207265736574005052494E54F0 -:1022800045522048414C544544005072696E746573 -:10229000722068616C7465642E206B696C6C2829EF -:1022A0002063616C6C6564210A000000000000007E -:1022B000000000000000000048420000484200000A -:1022C0008040000000005761726E696E673A2048D6 -:1022D0006F6D696E672042756D7020446976697311 -:1022E0006F72203C20310A000202040000A040006E -:1022F00000A040000000400000964300009643000C -:1023000000C843FFFFFF436172642072656D6F7602 -:102310006564004361726420696E736572746564FC -:102320000056652D6A65726B0056652D6A65726B85 -:102330000056652D6A65726B00567A2D6A65726B60 -:1023400000567A2D6A65726B0056792D6A65726B3C -:102350000056792D6A65726B0056792D6A65726B2D -:102360000056782D6A65726B0056782D6A65726B1F -:102370000056782D6A65726B004D6F74696F6E0040 -:102380004573746570732F6D6D004573746570735C -:102390002F6D6D005A73746570732F6D6D005A73D5 -:1023A000746570732F6D6D005973746570732F6D44 -:1023B0006D005973746570732F6D6D00587374657B -:1023C00070732F6D6D005873746570732F6D6D0091 -:1023D0004D6F74696F6E0053746570732F6D6D006F -:1023E0004A65726B00416363656C65726174696F05 -:1023F0006E0056656C6F6369747900436F6E74721A -:102400006F6C0046696C2E204469612E0046696C31 -:102410002E204469612E004F6666004F6E200045F5 -:1024200020696E206D6D3300436F6E74726F6C00A7 -:1024300043616E6E6F7420656E7465722073756291 -:102440006469723A2000022E2E004D61696E0040D0 -:10245000012C0173012201AB011801F3010E0148A7 -:10246000020401AC02FA002A03F000C303E6008074 -:1024700004DC006D05D2006C06C800C707BE007002 -:1024800009B4006D0BAA00CB0DA000CF138C00F295 -:102490001B7800E9246400142E50009C353C00B8E1 -:1024A0003A2800A03D14000B3F000070012C019061 -:1024B000012701B0012201C0011D01F00118011026 -:1024C00002130130020E016002090190020401C0F2 -:1024D00002FF000003FA004003F5008003F000D083 -:1024E00003EB002004E6007004E100E004DC00409F -:1024F00005D700C005D2004006CD00D006C8008038 -:1025000007C3003008BE00F008B900C009B400B02D -:102510000AAF00B00BAA00D00CA500000EA000501E -:102520000F9B00C01096005012910000148C00C048 -:10253000158700B0178200B0197D00D01B7800000D -:102540001E730040206E0090226900F02464004059 -:10255000275F0090295A00E02B5500102E500020D4 -:10256000304B0010324600E033410090353C001003 -:1025700037370070383200A0392D00B03A2800A05B -:102580003B2300603C1E00103D1900903D140010DC -:102590003E0F00703E0A00C03E0500003F000040B4 -:1025A0003FFBFF803FF6FFC03FF1FF45312054481D -:1025B00045524D414C2052554E41574159004245DC -:1025C0004420544845524D414C2052554E415741AC -:1025D0005900546865726D616C2052756E61776147 -:1025E00079004531204572723A204D415854454D8D -:1025F00050004572723A204D415854454D5020428A -:102600004544004D415854454D50207472696767E8 -:1026100065726564004531204572723A204D494E1D -:1026200054454D50004572723A204D494E54454D27 -:102630005020424544004D494E54454D502074723F -:1026400069676765726564004D38342058205920E9 -:102650005A20450025732C207361766520656E64D1 -:102660002D2D2D2D2D2D2D2D005A25752C45256C0C -:10267000752C50256C752C5425752C4225752C0015 -:10268000202F002042403A0020403A0050726568F6 -:1026900065617420504C4120456E6400507265683D -:1026A00065617420504C4120426564005072656839 -:1026B00065617420504C4100507265706172650014 -:1026C000507265686561742041425320456E640014 -:1026D0005072656865617420414253204265640010 -:1026E0005072656865617420414253005072657094 -:1026F000617265004D3432380050726568656174EE -:1027000020504C4100436F6F6C646F776E005072C5 -:102710006568656174204142530044697361626C6D -:1027200065207374657070657273004D38340053A2 -:10273000657420686F6D65206F66667365747300DD -:102740004175746F20686F6D6500473238004D6FBA -:1027500076652061786973004D61696E004D6F7612 -:10276000652058004D6F76652059004D6F766520C5 -:102770005A004578747275646572004D6F766520F5 -:10278000302E316D6D004D6F766520316D6D004DD1 -:102790006F76652031306D6D004D6F766520617804 -:1027A0006973004578747275646572004D6F766563 -:1027B000205A004D6F76652059004D6F7665205880 -:1027C000004D6963726F737465707320756E617606 -:1027D00061696C61626C650A0045313A20004530E0 -:1027E0003A20005A3A2000593A2000583A20004D29 -:1027F00053312C4D53322050696E730A0062656468 -:102800000A002C2073797374656D2073746F707077 -:10281000656421204865617465725F49443A20000F -:102820004265642068656174696E67206661696CE1 -:1028300065640048656174696E67206661696C65EE -:10284000640045312048656174696E67206661697E -:102850006C65640048656174696E67206661696CC7 -:1028600065640000002100240027002A002D0030AC -:1028700000330001010000040107010A01000022E9 -:1028800000250028002B002E00310034000201003A -:1028900000050108010B010000200023002600298B -:1028A000002C002F00320000010000030106010986 -:1028B0000105050505070508080808020202020AC5 -:1028C0000A080804040404010101010101010103D3 -:1028D00003030303030303040707070C0C0C0C0C8E -:1028E0000C0C0C0202020206060606060606060B81 -:1028F0000B0B0B0B0B0B0B010210202008081020F8 -:10290000401020408002010201080402010102047B -:10291000081020408080402010080402018004023A -:102920000180402010080402010804020101020491 -:102930000810204080010204081020408000000A96 -:102940000B02090C0D0E0807030401000000000033 -:102950000000000000000000000000000000000077 -:102960000000000000000000001211100000000034 -:102970000000000000000000000000000000000057 -:102980000000004D3234004D323320257300000624 -:102990000900FE0701920321207FFF07FF07FF00C8 -:1029A000000006000001070706020080808080808A -:1029B0000080030202060105A0A00507070600002B -:1029C0005050F850F850500507070600002078A036 -:1029D0007028F020050707060000C0C810204098A6 -:1029E000180507070600006090A040A89068020341 -:1029F00003060104C0408003070706010020408051 -:102A000080804020030707060100804020202040EE -:102A10008005050506000120A870A820050505060B -:102A200000012020F820200203030602FFC040809E -:102A3000050101060003F8020202060200C0C005FB -:102A40000505060001081020408005070706000064 -:102A50007088888888887003070706010040C04096 -:102A6000404040E00507070600007088087080803D -:102A7000F8050707060000F81020100808F0050701 -:102A80000706000010305090F810100507070600E8 -:102A900000F880F0080888700507070600007080BD -:102AA00080F0888870050707060000F808102020CD -:102AB0002020050707060000708888708888700548 -:102AC0000707060000708888780808700205050668 -:102AD0000200C0C000C0C00206060602FFC0C0005F -:102AE000C0408004070706000010204080402010EE -:102AF000050303060002F800F8040707060100803A -:102B0000402010204080050707060000708808104C -:102B100020002005070706000070880868A8A87034 -:102B2000050707060000708888F888888805070769 -:102B3000060000F08888F08888F005070706000086 -:102B400070888080808870050707060000F08888FC -:102B5000888888F0050707060000F88080F08080EC -:102B6000F8050707060000F88080F08080800507E0 -:102B700007060000708880B888887005070706007F -:102B800000888888F8888888010707060200808006 -:102B90008080808080050707060000381010101024 -:102BA00090600507070600008890A0C0A0908805E7 -:102BB0000707060000808080808080F805070706F0 -:102BC000000088D8A888888888050707060000883C -:102BD00088C8A89888880507070600007088888834 -:102BE000888870050707060000F08888F0808080DC -:102BF00005070706000070888888A8906805070701 -:102C0000060000F08888F0A09088050707060000FD -:102C1000788080700808F0050707060000F820207B -:102C200020202020050707060000888888888888DB -:102C300070050707060000888888888850200507E7 -:102C4000070600008888888888A8500507070600BE -:102C5000008888502050888805070706000088886B -:102C60008850202020050707060000F808102040A3 -:102C700080F8030707060100E08080808080E0057F -:102C80000505060001804020100803070706010023 -:102C9000E02020202020E0050303060004205088C7 -:102CA000050101060000F802020206020580400547 -:102CB00005050600007008788878050707060000FB -:102CC0008080B0C88888F005050506000070808007 -:102CD0008870050707060000080868988888780546 -:102CE00005050600007088F88070050707060000DB -:102CF0003048E0404040400506060600FF708888E6 -:102D00007808700507070600008080B0C8888888AA -:102D10000107070602008000808080808003080889 -:102D20000601FF200020202020A040040707060005 -:102D300000808090A0C0A090030707060100C0405B -:102D400040404040E0050505060000D0A8A8A8A81E -:102D5000050505060000B0C8888888050505060039 -:102D60000070888888700506060600FFF08888F0E5 -:102D700080800506060600FF788888780808050523 -:102D800005060000B0C880808005050506000070BB -:102D9000807008F00407070600004040E040404013 -:102DA0003005050506000088888898680505050631 -:102DB000000088888850200505050600008888A83E -:102DC000A850050505060000885020508805060615 -:102DD0000600FF888888780870050505060000F859 -:102DE000102040F8030707060100204040804040C3 -:102DF0002001070706020080808080808080030712 -:102E00000706010080404020404080050202060085 -:102E100002689000000006000000060900FE0000A5 -:102E200000000001090008FE000005080806000077 -:102E300040F0C88888987810050808060000C0F897 -:102E40008888888888F80505050600012030F83054 -:102E5000200508080600002070F820202020E0054A -:102E600009090600FF2070A8A8B888887020050905 -:102E7000090600FFE080C0B0A8283028280509090D -:102E80000600FFF8A88888888888A8F8050A0A0636 -:102E900000FE205050505088A8A8887003030306F5 -:102EA000000340A0405654726176206D696E005652 -:102EB00054726176206D696E005654726176206D91 -:102EC000696E00566D696E00566D696E00566D69CB -:102ED0006E00566D6178204500566D617820450082 -:102EE000566D6178204500566D6178205A00566D08 -:102EF0006178205A00566D6178205A00566D6178CD -:102F0000205900566D6178205900566D617820591E -:102F100000566D6178205800566D61782058005633 -:102F20006D61782058004D6F74696F6E00416D615E -:102F300078204500416D6178204500416D61782021 -:102F40005A00416D6178205A00416D617820590026 -:102F5000416D6178205900416D6178205800416DC4 -:102F60006178205800412D74726176656C00412DA6 -:102F700074726176656C00412D7265747261637460 -:102F800000412D7265747261637400416363656C06 -:102F900000416363656C004D6F74696F6E0033446C -:102FA000205072696E7465722052656164792E00DA -:102FB0005072696E74696E672E2E2E005072696EA3 -:102FC0007420706175736564005072696E7420615D -:102FD000626F72746564005072696E742066726FFD -:102FE0006D2053440053746F70207072696E7400CA -:102FF000526573756D65207072696E74004E6F2036 -:10300000534420636172640050617573652070726F -:10301000696E7400436F6E74726F6C0050726570ED -:103020006172650054756E6500496E666F2073634A -:103030007265656E004261627973746570205A0032 -:103040004261627973746570205A00466C6F770034 -:10305000466C6F7700466C6F770046616E20737028 -:1030600065656420330046616E2073706565642079 -:10307000330046616E2073706565642033004661DD -:103080006E20737065656420320046616E20737037 -:1030900065656420320046616E207370656564204A -:1030A000320046616E2073706565642031004661B0 -:1030B0006E20737065656420310046616E20737008 -:1030C00065656420310042656400426564004265C4 -:1030D00064004E6F7A7A6C65004E6F7A7A6C650088 -:1030E0004E6F7A7A6C650053706565640053706545 -:1030F0006564005370656564004D61696E004572DA -:10310000726F722077726974696E6720746F2045E0 -:103110004550524F4D210A00534420636172642090 -:103120006F6B0A006F70656E526F6F742066616915 -:103130006C65640A00766F6C756D652E696E6974D6 -:10314000206661696C65640A00534420696E697485 -:10315000206661696C0A00003DE39AE411241FBEF9 -:10316000CFEFD1E2DEBFCDBF00E00CBF13E0A0E0A7 -:10317000B2E0EAEEF6EE01E00BBF02C007900D925E -:10318000A439B107D9F724E1A4E9B3E001C01D9245 -:10319000AC35B207E1F718E1CDEAD8E100E006C0AE -:1031A00021970109802FFE010E949EF2CC3AD1079F -:1031B00080E00807A9F70E945EDC0C9464F30C948D -:1031C00000002F923F924F925F926F927F928F9268 -:1031D0009F92AF92BF92CF92DF92EF92FF920F93A6 -:1031E0001F93CF93DF93CDB7DEB7CF55D1090FB67D -:1031F000F894DEBF0FBECDBF21E02093FB0F80917E -:10320000780F8D3409F474C6843511F40C94B52C00 -:10321000873411F00C94F32C2090760F3090770FB8 -:1032200034E02316310409F44BC54CF437FC5CC67A -:1032300080913A0252E0251631047CF529C08AE5D6 -:103240002816310409F491C534F4ACE12A1631048E -:1032500009F474C549C6BBE52B16310409F489C5C8 -:10326000ECE52E16310409F03FC69FE4292E92E0CA -:10327000392E29E0E22E20E1F22EADE1B4E0BDA727 -:10328000ACA738E7C32E30E1D32E00E010E0B1C583 -:1032900081110C94FA2C0C94F52C882311F40C94C5 -:1032A000F52C0E947D3182E50E947131882309F45A -:1032B00036C10E94F5304B015C0120E030E0A901ED -:1032C0000E946DEB882309F4E1C420911D04309124 -:1032D0001E0440911F04509120042CA73DA74EA727 -:1032E0005FA78091210490912204A0912304B091C2 -:1032F000240488AB99ABAAABBBAB209115103091DD -:10330000161040911710509118102CAF3DAF4EAFD2 -:103310005FAF8091191090911A10A0911B10B0917D -:103320001C1088AF99AFAAAFBBAF6CA57DA58EA5C9 -:103330009FA50E946DEB81110DC028AD39AD4AAD3E -:103340005BAD68A979A98AA99BA90E946DEB882326 -:1033500009F49CC411E092E02916310409F010E050 -:1033600020E030E0A901C501B4010E946DEB881F87 -:103370008827881F18130BC020E030E040E85FE387 -:1033800028962CAF3DAF4EAF5FAF28970AC080E0C4 -:1033900090E0A0E8BFEB28968CAF9DAFAEAFBFAF7B -:1033A00028972CA53DA54EA55FA56CAD7DAD8EAD36 -:1033B0009FAD0E9496EF24966CAF7DAF8EAF9FAF0E -:1033C000249728A939A94AA95BA968AD79AD8AAD26 -:1033D0009BAD0E9496EF6B017C0124962CAD3DAD18 -:1033E0004EAD5FAD2497CA01B9010E94D2EB2B010B -:1033F0003C01A7019601C701B6010E94D2EB9B01D7 -:10340000AC01C301B2010E9497EF0E9402F26CABC3 -:103410007DAB8EAB9FAB20E030E040E05FE30E94ED -:10342000D2EB2B013C01A5019401C501B4010E941E -:10343000D2EB4B015C01A3019201C301B2010E94D6 -:10344000D2EB9B01AC01C501B4010E9496EF0E9432 -:1034500002F228962CAD3DAD4EAD5FAD28970E948F -:10346000D2EB4B015C01C701B60190582CA93DA9D4 -:103470004EA95FA90E9473F0A50194010E94D2EBAE -:103480006B017C012CAD3DAD4EAD5FAD6CA57DA556 -:103490008EA59FA50E9497EF20E030E040E05FE31B -:1034A0000E94D2EB9B01AC01C701B6010E9497EFCD -:1034B0002CA53DA54EA55FA50E9496EF6B017C0152 -:1034C00028AD39AD4AAD5BAD68A979A98AA99BA998 -:1034D0000E9497EF20E030E040E05FE30E94D2EBF3 -:1034E0002B013C012CA93DA94EA95FA924966CADE6 -:1034F0007DAD8EAD9FAD24970E9473F0A501940120 -:103500000E94D2EB9B01AC01C301B2010E9497EF74 -:1035100028A939A94AA95BA90E9496EF14C089E499 -:103520000E947131882329F00E94F5306B017C01E3 -:1035300003C0C12CD12C76018AE40E94713188230A -:10354000D9F00E94F5306CAF7DAF8EAF9FAF20E019 -:1035500030E0A901C701B6010E946DEB81111AC0CC -:1035600020E030E0A9016CAD7DAD8EAD9FAD0E9435 -:103570006DEB81110FC08AC320E030E0A901C701C3 -:10358000B6010E946DEB882309F480C31CAE1DAE0A -:103590001EAE1FAEA701960150582CA73DA74EA7FF -:1035A0005FA78CAD9DADAEADBFADB05888AB99AB4C -:1035B000AAABBBABCA01B9010E94D2EB4B015C01C3 -:1035C00028A939A94AA95BA9CA01B9010E94D2EB6D -:1035D0009B01AC01C501B4010E9497EF0E9402F269 -:1035E00064966CAF7DAF8EAF9FAF649720911D0442 -:1035F00030911E0440911F045091200428AF39AF30 -:103600004AAF5BAFA701960168AD79AD8AAD9BADBE -:103610000E9497EF28966CAF7DAF8EAF9FAF289733 -:103620008091210490912204A0912304B09124045C -:1036300024968CAF9DAFAEAFBFAF24972CAD3DAD00 -:103640004EAD5FADBC01CD010E9497EF68966CAFA7 -:103650007DAF8EAF9FAF68972091151030911610F7 -:1036600040911710509118102C962CAF3DAF4EAFD3 -:103670005FAF2C9728962CAD3DAD4EAD5FAD289732 -:103680002C966CAD7DAD8EAD9FAD2C970E9496EFC4 -:103690006B017C018091191090911A10A0911B1060 -:1036A000B0911C1060968CAF9DAFAEAFBFAF60976E -:1036B00068962CAD3DAD4EAD5FAD6897BC01CD01B8 -:1036C0000E9496EF4B015C01209125043091260465 -:1036D00040912704509128046C962CAF3DAF4EAF1B -:1036E0005FAF6C9760911D1070911E1080911F103C -:1036F000909120100E9496EF6CAB7DAB8EAB9FAB90 -:10370000A70196016CA57DA58EA59FA50E94D2EB71 -:103710002B013C01A501940168A979A98AA99BA95B -:103720000E94D2EB9B01AC01C301B2010E9497EF52 -:103730002B013C01A50194016CA57DA58EA59FA53B -:103740000E94D2EB4B015C01A701960168A979A9FF -:103750008AA99BA90E94D2EB9B01AC01C501B401CF -:103760000E9496EFA30192010E940AF06B017C0176 -:1037700020E030E0A9010E946DEB87FF0AC02BED2D -:103780003FE049EC50E4C701B6010E9497EF6B019E -:103790007C0132E02316310451F42BED3FE049EC7B -:1037A00050E4C701B6010E9496EF6B017C0120E056 -:1037B00030E0A901C701B6010E946DEB811126C05E -:1037C0002C962CAD3DAD4EAD5FAD2C9768AD79AD6F -:1037D0008AAD9BAD0E946DEB811118C060962CAD37 -:1037E0003DAD4EAD5FAD609724966CAD7DAD8EADB9 -:1037F0009FAD24970E946DEB811108C05BEDC52E33 -:103800005FE0D52E59ECE52E50E4F52EA701960188 -:1038100064966CAD7DAD8EAD9FAD64970E94D2EB8A -:103820004B015C0120E030E0A9016CA97DA98EA9C3 -:103830009FA90E946DEB8823D9F0A5019401C501D1 -:10384000B4010E94D2EB4B015C012CA93DA94EA909 -:103850005FA9CA01B9010E94D2EB9B01AC01C5016D -:10386000B4010E9497EF0E9402F24B015C010DC06F -:1038700020E030E0A901C501B4010E94BDF187FF3D -:1038800004C0B7FAB094B7F8B0942FE632E143E839 -:103890005AE3C501B4010E946DEB87FF02C00C948E -:1038A000F52CC501B4010E940CF10E94E0F02296B3 -:1038B0007FAF6EAF2297672B31F481E090E02296C4 -:1038C0009FAF8EAF22974090290450902A046090B9 -:1038D0002B0470902C042296AEADBFAD2297BD0193 -:1038E00080E090E00E9471EB4B015C019B01AC0118 -:1038F000C701B6010E9473F068AF79AF8AAF9BAF82 -:10390000A50194016CA97DA98EA99FA90E9473F0BD -:1039100064966CAF7DAF8EAF9FAF6497A3019201A9 -:1039200060912110709122108091231090912410A9 -:103930000E9496EFA50194010E9473F0A0966CAFCF -:103940007DAF8EAF9FAFA09728AD39AD4AAD5BADCF -:10395000CA01B9010E94D2EB20E030E040E05FE311 -:103960000E94D2EB9B01AC0160E070E080E89FE335 -:103970000E9496EF2C966CAF7DAF8EAF9FAF2C97C9 -:103980006C962CAD3DAD4EAD5FAD6C9729873A87F7 -:103990004B875C874D865E866F86788A60914D0284 -:1039A00070914E02072E000C880B990B0E9473EB4E -:1039B00020911F0230912002409121025091220259 -:1039C0000E94D2EB2AE037ED43E25CE30E94D2EBA7 -:1039D00068A779A78AA79BA70E94EDDB9B01AC0192 -:1039E00028533F4F4F4F5F4F60962CAF3DAF4EAFC8 -:1039F0005FAF60974CA45DA46EA47FA4222423949F -:103A0000312C39E13CAB22964EAD5FAD2297421589 -:103A1000530509F41AC10E9446B40E94EDDBDC0193 -:103A2000CB0160962CAD3DAD4EAD5FAD6097821B76 -:103A3000930BA40BB50BB7FD10C00E94EDDB9B01EF -:103A4000AC0128533F4F4F4F5F4F60962CAF3DAFB7 -:103A50004EAF5FAF60970E9489903CA931503CAB5C -:103A6000332309F441C028A939A94AA95BA92C9696 -:103A70006CAD7DAD8EAD9FAD2C970E94D2EB6B01EE -:103A80007C019201A30168AD79AD8AAD9BAD0E9426 -:103A9000D2EBA70196010E9497EF7B018C01920166 -:103AA000A3012C966CAD7DAD8EAD9FAD2C970E9481 -:103AB000D2EB4B015C0128A939A94AA95BA968ADE1 -:103AC00079AD8AAD9BAD0E94D2EB9B01AC01C501E3 -:103AD000B4010E9496EF2B013C01C701D80188ABCD -:103AE00099ABAAABBBAB4DC0B10180E090E00E94A6 -:103AF00071EB28AD39AD4AAD5BAD0E94D2EB4B0105 -:103B00005C010E9470F06B017C01C501B4010E9450 -:103B1000F8F14B015C01A70196016CA57DA58EA56E -:103B20009FA50E94D2EB2B013C012CAD3DAD4EADCB -:103B30005FADC501B4010E94D2EBA30192010E94C6 -:103B400097EF2B013C01A50194016CA57DA58EA5E5 -:103B50009FA50E94D2EB4B015C012CAD3DAD4EAD5B -:103B60005FADC701B6010E94D2EB9B01AC01C5015C -:103B7000B4010E9496EF68AB79AB8AAB9BAB49E18D -:103B80004CAB9201A30128966CAD7DAD8EAD9FAD7F -:103B900028970E9497EF69837A838B839C8328A957 -:103BA00039A94AA95BA968966CAD7DAD8EAD9FAD74 -:103BB00068970E9497EF6D837E838F8398876496C2 -:103BC0002CAD3DAD4EAD5FAD649769857A858B8533 -:103BD0009C850E9497EF69877A878B879C87A09640 -:103BE0002CAD3DAD4EAD5FADA0976D857E858F85CB -:103BF00098890E9497EF6D877E878F87988B809139 -:103C00003902882321F0CE0101960E949A8EE0901D -:103C1000041118A219A21AA21BA2CE0180966C014F -:103C20008E01085D1F4F9E01235F3F4FAE01475F2E -:103C30005F4FBE016B5F7F4F4F970E94014188230A -:103C400021F09FEF291A390ADECEE09004111CA260 -:103C50001DA21EA21FA2DE0194966D018E01085DB9 -:103C60001F4F21E230E14DE150E169E170E185E172 -:103C700090E10E94014180E1E5E1F0E1ADE1B4E0D5 -:103C800001900D928A95E1F70C94F52CEBE8FFE09A -:103C900084918F010F5F1F4F882321F00E94023211 -:103CA000F801F6CFE1E4F2E084918F010F5F1F4F3E -:103CB000882311F40C94F52C0E940232F801F4CF01 -:103CC00080E50E947131882329F00E94B5306B0194 -:103CD0007C0103C0C12CD12C760183E50E94713197 -:103CE000882361F00E94F53020E030E04AE754E498 -:103CF0000E94D2EB0E94E0F06B017C010E94165FF3 -:103D00008091950B811105C060E087E592E00E94EB -:103D100030C50E94EDDBC60ED71EE81EF91E0E94BC -:103D2000EDDBDC01CB018C199D09AE09BF09B7FDA4 -:103D300002C00C94F52C0E948990F1CF809133043D -:103D40008770873011F00C94FE2C8FE40E94713143 -:103D5000882319F00E94E63003C08FE40E942831C6 -:103D600081110C94F52C0C94FE2C109298030C9459 -:103D7000F52C209398030C94F52C0E94F5302B0120 -:103D80003C01133049F0D6012D913D914D915C914C -:103D90000E9496EF2B013C01ECA5FDA5208131810D -:103DA00042815381C301B2010E9496EF4B015C0135 -:103DB0002DEB37E346E855EB0E94BDF187FD21C0AE -:103DC0002DEB37E346E855E3C501B4010E946DEBE6 -:103DD0001816BCF01F5FF4E0EF0EF11C2CA53DA5FA -:103DE0002C5F3F4F3DA72CA734E0C30ED11C1430ED -:103DF00031F1F10181911F010E947131882351F34A -:103E0000BCCF133051F44092290450922A0460929E -:103E10002B0470922C0401E0DDCFA5019401D701A1 -:103E20006D917D918D919C910E9497EFF701608338 -:103E3000718382839383812F0E94CC2FCBCF002369 -:103E400009F44EC020E030E0A9016091290470918E -:103E50002A0480912B0490912C040E9497EF2091CA -:103E6000670B3091680B4091690B50916A0B0E946F -:103E7000D2EB0E94C8F16093110C7093120C8093E6 -:103E8000130C9093140C9091EF0B8091F00B9817FA -:103E900019F00E94B85E24C00E94165F80916F00E6 -:103EA000982F927081FF05C080916F008D7F809365 -:103EB0006F004091110C5091120C6091130C709195 -:103EC000140C4093B1105093B2106093B3107093E0 -:103ED000B410992329F080916F00826080936F0065 -:103EE0000E94C6820C94F52C0E946B4F0C94F52C0A -:103EF0008091760F9091770F8537910509F4ACC7C3 -:103F00000CF0B8C08C34910509F4F3C40CF050C027 -:103F10008931910509F4A2C21CF58431910509F497 -:103F200032C27CF48131910509F422C22CF402974B -:103F300008F4A7C10C94B22C429709F459C60C940A -:103F4000B22C8631910509F462C20CF45CC287314F -:103F5000910509F462C2489709F475C20C94B22C19 -:103F60008E31910509F4F6C284F48B31910509F480 -:103F700089C20CF479C28C31910509F4E1C24D97E4 -:103F800011F40C94F52C0C94B22C8032910509F4A8 -:103F90007AC30CF4C4C38A32910509F476C48B3415 -:103FA000910511F00C94B22C0E94C9B70C94F52C19 -:103FB0008A36910509F4C2C5B4F58435910509F432 -:103FC00017C6E4F48135910509F4F3C54CF48D343A -:103FD000910511F00C94B22C0E9400B80C94F52CB1 -:103FE0008235910509F401C68335910511F00C94D1 -:103FF000B22C81E0809397030C94F52C8C359105BD -:1040000009F442C634F48535910509F424C60C94AC -:10401000B22C8836910509F470C48936910509F4EB -:104020002CC50C94B22C8F36910509F4A8C484F4E5 -:104030008C36910509F4F1C40CF4A5C58D369105B3 -:1040400009F45BC58E36910509F486C40C94B22C34 -:104050008137910509F4E8C40CF4E2C48237910574 -:1040600009F49AC68337910511F00C94B22CEBE356 -:10407000F4E097C68C3241E0940711F40C94232AA3 -:104080000CF07BC0893C910511F40C9457287CF509 -:104090008C38910509F434C5ACF48737910509F4DF -:1040A00036C70CF4E8C68837910509F433C7893759 -:1040B000910511F00C94B22C1092100410920F0480 -:1040C0000C94F52C8B39910509F4F2C434F4813940 -:1040D000910509F425C70C94B22C8E3B910509F487 -:1040E0002AC5883C910509F492C70C94B22C833DF3 -:1040F000910511F40C947B293CF58C3C910511F44D -:104100000C948C2864F48B3C910511F00C94B22C27 -:10411000AFE4EA2EA2E0FA2E0FE016E0EEC78D3CE7 -:10412000910511F40C9401298E3C910511F00C9429 -:10413000B22CEFE4CE2EE2E0DE2EF1E1EF2EF4E041 -:10414000FF2E10E00C9469298D3D910511F40C941B -:1041500089293CF48C3D910511F40C947E290C9432 -:10416000B22C823E910511F40C94F52982329140D3 -:1041700011F40C941A2A0C94B22C8C3AB1E09B07DF -:1041800011F40C947829D4F58E35F1E09F0711F4E1 -:104190000C94A32BB4F48E3231E0930711F40C94F9 -:1041A000DD2A14F40C94482A8F3251E0950711F45B -:1041B0000C942B2B8033914011F40C942E2B0C94E7 -:1041C000B22C8336B1E09B0711F40C941C2C3CF408 -:1041D0008F35914011F40C94D22B0C94B22C803971 -:1041E00021E0920711F40C94332C8A39914011F09C -:1041F0000C94B22C0E943B7C0C94F52C883F41E03F -:10420000940711F40C94462CECF4853FA1E09A0736 -:1042100011F40C94362C4CF4843F914011F00C9422 -:10422000B22C0E9401690C94F52C863FF1E09F07A7 -:1042300011F40C94392C873F914011F40C943C2CD0 -:104240000C94B22C8C3833E0930711F40C948A2C24 -:1042500064F48B38934011F00C94B22C8FE4E82E68 -:1042600082E0F82E10E00C94692C803AA3E09A07C3 -:1042700009F448C2873E934011F40C94A02C0C948E -:10428000B22CA090740FB090750F80E50E94713130 -:10429000882359F00E94B5306B017C0111E0672B37 -:1042A000682B692B31F410E004C010E0C12CD12C34 -:1042B000760183E50E947131882311F40C942A2E33 -:1042C0000E94F53020E030E04AE754E40E94D2EB4F -:1042D0000E94E0F06B017C0111110BC0672B682B71 -:1042E000692B39F4A114B10421F0F5018081811109 -:1042F00002C010E001C011E00E94165F112329F0F6 -:1043000061E0C5010E946AC505C060E080E692E0F8 -:104310000E9430C583E08093FB0F81E080933A10C8 -:10432000C114D104E104F104B1F00E94EDDBC60E2A -:10433000D71EE81EF91E0E94EDDBDC01CB018C19B3 -:104340009D09AE09BF09B7FF0DC080913A108111D8 -:104350000C942F2E07C080913A10882319F00E94E8 -:104360008990F9CF0E9411CF10923A100C94F52C3D -:1043700060E083E792E00E9430C517981698159880 -:1043800014980C94F52CEBE8F2E084918F010F5F08 -:104390001F4F882321F00E940232F801F6CF1092BD -:1043A000B20E8DE69CE00E9477898BE1EDE6FCE0A1 -:1043B000DE01159601900D928A95E1F780916B0CC4 -:1043C00090916C0C9C838B8387E692E09A8389831F -:1043D00040E050E0BE016F5F7F4F80E090E00E94C0 -:1043E0009B51CE0101960E940D90ECE7F2E0849182 -:1043F0008F010F5F1F4F882311F40C94F52C0E943E -:104400000232F801F4CF0E9455DA0C94F52C109288 -:10441000350C1092360C0C94F52CE091740FF09141 -:10442000750F8081882329F0803209F4108231963B -:10443000F8CF40E061E08091740F9091750F0E9479 -:104440005E540C94F52C8091360C882319F081E091 -:104450008093350C0E94C9B70C94F52C1092350C42 -:104460000E94EBB70C94F52C8091360C882311F444 -:104470000C94F52C83E50E94713181110C94332E3C -:104480000C94F52C83E40E942831882309F454C04D -:10449000E6EAF2E084918F010F5F1F4F882321F03D -:1044A0000E940232F801F6CF8091080E882391F025 -:1044B000BE016F5F7F4F85E09EE00E943F888E01C6 -:1044C0000F5F1F4FD8018D918D01882381F10E94CC -:1044D0000232F8CFECE9F2E084918F010F5F1F4FB9 -:1044E000882329F10E940232F801F6CF80915A0BFD -:1044F000882309F485C2B4E2CB2EB3E0DB2EE12C95 -:10450000F12C20E080915A0B90E00E2C02C0959582 -:1045100087950A94E2F780FD5BC23FEFE31AF30A46 -:1045200042E0C40ED11C55E0E516F10459F78AE0CB -:104530000E9402320C94F52C0E94964E0C94F52C9D -:1045400040E060E08091740F9091750F0E945E547E -:104550000C94F52C8091360C882311F40C94F52CD6 -:1045600085E09EE00E943BD785E09EE00E941A888D -:104570001092340C1092330C8091360C882311F475 -:104580000C94F52C0091740F1091750F1092350C4E -:104590008091080E882321F085E09EE00E941A8811 -:1045A000B801CE0180960E94A2538C01892B11F490 -:1045B0000C94F52C68A179A16115710511F06C5F5F -:1045C0007F4F19821C8222E0A801CE0101960E9431 -:1045D000A68D811102C0F12C14C0CE0101960E945B -:1045E000884F8823C1F361E0CE0101960E942388A1 -:1045F000009789F325EEFC0120831C820E94E4D4FD -:10460000F82ECE0101960E94FC31FF2011F1E5EB5E -:10461000F2E084917F012FEFE21AF20A882321F061 -:104620000E940232F701F5CFD8018D918D018823C8 -:1046300019F00E940232F8CF8AE00E9402321092F2 -:10464000650C1092660C1092670C1092680C0C941A -:10465000F52CE3ECF2E084917F01BFEFEB1AFB0A4B -:10466000882321F00E940232F701F5CFF8018191F1 -:104670008F01882319F00E940232F8CF8EE20E9447 -:1046800002320C94F52C8091350C81110E94165F3A -:104690008091360C882311F40C94F52C80E50E944F -:1046A0007131882319F00E94E63003C080E50E9432 -:1046B0002831182F482F61E08091740F9091750F69 -:1046C0000E945E5483E50E947131882381F00E942C -:1046D000C530AB01BC014093650C5093660C6093F0 -:1046E000670C7093680C85E09EE00E943087809193 -:1046F000360C882319F081E08093350C11110C944D -:10470000F52CA8CE8091740F9091750F21E0209325 -:10471000340C40E060E00E945E540C94F52C0E9442 -:104720007AB77B018C0120E831E541E050E00E943E -:104730005BEFC9016DE671E00E945BF24B015C0129 -:10474000C801B70120E13EE040E050E00E945BEF8D -:10475000CA01B90128E130E040E050E00E945BEF7F -:10476000762E672EC62ED72E8CE3282E312C412C88 -:10477000512CC801B701A20191010E945BEFF62EF6 -:10478000E72ECA01B901A20191010E945BEFCB01A2 -:104790008E010F5F1F4F8114910499F0EF92FF92E9 -:1047A0007F936F936F927F92BF92AF929F928F92FF -:1047B00083E093E09F938F931F930F930E9407EBE7 -:1047C00013C0A114B104B1F0EF92FF927F936F93E5 -:1047D0006F927F92BF92AF9283EF92E09F938F93FD -:1047E0001F930F930E9407EB0FB6F894DEBF0FBE26 -:1047F000CDBF30C0CD2879F0EF92FF927F936F93B9 -:104800006F927F9287EE92E09F938F931F930F9307 -:104810000E9407EBE9CF892B69F0EF92FF927F931B -:104820006F938FED92E09F938F931F930F930E944E -:1048300007EBDACFEF92FF928BED92E09F938F938D -:104840001F930F930E9407EB0F900F900F900F9004 -:104850000F900F9060E0C8010E946AC5EAEBFFE08C -:1048600084917F01BFEFEB1AFB0A882321F00E949D -:104870000232F701F5CFB80187E193E00E94125EA2 -:104880008AE00E9402320C94F52C83E50E9471317B -:10489000882311F40C94F52C0E94D530E82E80E585 -:1048A0000E947131882339F00E94D530182F87FF7C -:1048B00003C00C94F52C1DE089E40E94713188231B -:1048C00041F00E94E63081110C94CD2EE5E4F5E034 -:1048D0000BC089E40E942831F6CF319625E0E237FB -:1048E000F20711F40C94CD2E84911813F6CF0C948A -:1048F0006A2E0E94EBB70C94F52C88E690E00E949B -:10490000A93581110C94F52C80915A0B83FF02C0BC -:104910000C94F52C83E50E9471318823C9F00E9424 -:10492000F5300E94DBF0709303116093021180E078 -:104930000E9407AA0E94F53020E030E04AEA52E4E3 -:104940000E946DEB181624F00E9400B80E9411CF4F -:104950000E942D5E0C94F52C8EE40E947131882308 -:1049600011F40C94F52C0E94C5306093740B709375 -:10497000750B8093760B9093770B0C94F52C83E555 -:104980000E942831882359F083E50E9471318823E1 -:1049900019F00E94D53001C080E080935A0BEAEBF9 -:1049A000FFE084918F010F5F1F4F882321F00E9449 -:1049B0000232F801F6CFE2E3F3E084918F010F5F5A -:1049C0001F4F882309F492CD0E940232F801F5CFDF -:1049D000BB24B394B20E222319F08CE20E9402325F -:1049E000F60185919491FC0184918F010F5F1F4F17 -:1049F000882321F00E940232F801F6CF2B2D8DCDB5 -:104A0000EEE2F3E084918F010F5F1F4F882309F4DA -:104A10008ECD0E940232F801F5CF10920602E5C752 -:104A200089E393E00E94299083E50E9471318823F5 -:104A300059F00E94D5308D3318F480932302D5C7E6 -:104A40008CE380932302D1C7EAEBFFE084918F01CE -:104A50000F5F1F4F882321F00E940232F801F6CF2A -:104A60004091230250E060E070E082E493E00E9415 -:104A7000BF5D8AE00E940232B8C789E690E00E94DA -:104A8000A935811111C0E9E4F3E084918F010F5F32 -:104A90001F4F882321F00E940232F801F6CF0E94B6 -:104AA0000EA88AE00E9402321092FB0F0C94F02EA6 -:104AB00083E50E947131882309F497C70E94D5309D -:104AC000182F8D3308F01CE3109308100E94EDDBC3 -:104AD0006B017C01212F30E0A8EEB3E00E9487EF4C -:104AE000C60ED71EE81EF91EC0920410D092051003 -:104AF000E0920610F092071078C70E94FF3575C744 -:104B000080915A0B83FF01C070C783E50E94713109 -:104B1000882309F46AC70E94F5300E94DBF06639E9 -:104B2000710514F066E970E0709301116093001153 -:104B30000E94BBA95AC70E943D8557C780E50E94C5 -:104B40007131882339F00E94D530182F833008F056 -:104B50004CC701C010E083E50E947131882319F031 -:104B60000E94C53002C06FEF70E0E12FF0E06F3FB0 -:104B7000710510F06FEF70E0EE0FFF1FE15CF94F71 -:104B80007183608332C780E50E947131882339F0D8 -:104B90000E94C5306330710508F027C702C060E08D -:104BA00070E0660F771FFB01E15CF94F1182108204 -:104BB0001CC70E9453AA0E941474109240061092BF -:104BC0003F0610924206109241061092440610923F -:104BD000430668EE73E080E090E00E9443C460E02A -:104BE0008CE493E00E9430C500C710929703FDC685 -:104BF00083E50E947131882399F00E94F53020E00E -:104C000030E04AE754E40E94D2EB0E94E0F0609367 -:104C10002402709325028093260290932702E5C612 -:104C200088E50E94283181110C94432E89E50E9469 -:104C3000283181110C94432E8AE50E94283181117C -:104C40000C94432E85E40E94283181110C94432E4C -:104C50000E941474CAC683E50E942831882309F48F -:104C6000C4C60E94F53020E030E04AE754E40E94D8 -:104C7000D2EB0E94E0F060930010709301108093DB -:104C8000021090930310B1C63FE4C32E32E0D32E3E -:104C90004BE5E42E4BE0F42E10E0D6018D916D0132 -:104CA0000E942831882309F46DC0133009F063C0D5 -:104CB0000E94F5304B015C0120E030E040EA51E415 -:104CC0000E946DEB87FF4EC0A50194016091670BB8 -:104CD0007091680B8091690B90916A0B0E9473F040 -:104CE0002B013C019B01AC016091EB057091EC053F -:104CF0008091ED059091EE050E94D2EB6093EB055B -:104D00007093EC058093ED059093EE05A30192015D -:104D100060911B0670911C0680911D0690911E06E5 -:104D20000E94D2EB60931B0670931C0680931D06B5 -:104D300090931E066091FB057091FC058091FD0526 -:104D40009091FE050E9471EBA30192010E94D2EBAB -:104D50000E94E0F06093FB057093FC058093FD05D5 -:104D60009093FE058092670B9092680BA092690B5E -:104D7000B0926A0B07C00E94F530F701608371831F -:104D8000828393831F5FF4E0EF0EF11C143009F06F -:104D900084CF0E94FE5F29C60E94165F0E94C682D1 -:104DA00024C684918F010F5F1F4F882321F00E943A -:104DB0000232F801F6CF60E08BE294E00E948F822D -:104DC00061E084E294E00E948F8261E089E194E0F6 -:104DD0000E948F8261E089E094E00E948F8260E00F -:104DE00080E094E00E948F8261E086EF93E00E9471 -:104DF0008F8260E08CEE93E00E948F8260E084EE10 -:104E000093E00E948F8260E086ED93E00E948F82A3 -:104E100060E088EC93E00E948F8260E089EB93E091 -:104E20000E948F8260E08BEA93E00E948F8260E0B4 -:104E300085E993E00E948F8260E084E893E00E941D -:104E40008F8260E08FE693E00E948F8261E08CE5C4 -:104E500093E00E948F82C9C58091740F9091750F65 -:104E6000DC012C91222321F060E00E946AC5BDC5BF -:104E70000E9411CFBAC50091740F1091750F83E095 -:104E8000D12C40E08150E1F0F8019081292F2B7F57 -:104E90002134C1F721812133A9F7913421F09534D0 -:104EA00021F441E002C0DD24D39498012E5F3F4FEE -:104EB00089012F5F3F4FD8019C919032C9F3E2CF17 -:104EC000442369F0EAEBFFE084917F01BFEFEB1A26 -:104ED000FB0A882321F00E940232F701F5CFDD2082 -:104EE00069F0E1E0F5E084917F012FEFE21AF20A28 -:104EF000882321F00E940232F701F5CFD8018D916D -:104F00008D01882309F413CB0E940232F7CF0E944F -:104F10009A766BC581E08093100480930F0465C579 -:104F200083E50E947131882319F00E94C53002C0C8 -:104F300060E070E08B01112702301105CCF0EBE846 -:104F4000FFE084918F010F5F1F4F882321F00E94A3 -:104F50000232F801F6CFE5E0F5E084918F010F5FB2 -:104F60001F4F882309F441C50E940232F801F5CF92 -:104F700088E40E9471318823A9F00E94C5306A3A02 -:104F800071053CF06530B1E07B072CF064E071E026 -:104F900002C06AEA70E0F801EE0FFF1FE553FA4F16 -:104FA0007183608386E40E9471318823A9F00E9496 -:104FB000C530F801EE0FFF1FE153FA4F7183608394 -:104FC0006F3F710519F014F06FEF70E077FF02C0CA -:104FD00060E070E07183608382E40E947131882315 -:104FE00009F403C50E94C5306530710534F0683896 -:104FF00071052CF067E870E002C065E070E0000F1A -:10500000111FF801E953FA4F71836083EEC488ECF5 -:1050100090E00E94A9358111E8C484E40E942831FF -:10502000882309F441C00E94F5306B017C0111E036 -:1050300020E030E0A9010E946DEB811101C010E079 -:1050400010934B1020E030E0A901C701B6010E9487 -:105050006DEB882349F10E94F530E0915B1024E06C -:10506000E29FF0011124E95BFF4E6083718382832C -:10507000938320E030E0A9016091471070914810BF -:105080008091491090914A100E946DEB81110CC0E3 -:1050900080E090E0A0EEBFE380934710909348102B -:1050A000A0934910B0934A100E9482739EC4BFE43B -:1050B000EB2EB2E0FB2E03E212E1D7018D917D01D0 -:1050C0000E942831882349F00E94F5300E94E0F0C8 -:1050D000F80160837183828393830C5F1F4FF2E139 -:1050E00003331F0751F70E945D5E7FC40C5F1F4FA3 -:1050F000F6E00F311F0709F478C4D7018D917D01C7 -:105100000E942831882391F30E94F530F8016083D2 -:10511000718382839383EACF83E50E947131882370 -:10512000A1F00E94F5306093070670930806809303 -:10513000090690930A066093030670930406809311 -:1051400005069093060610E001C011E080E50E947C -:105150007131882359F00E94F530609307067093EF -:1051600008068093090690930A0610E082E50E94E3 -:105170007131882359F00E94F53060930B067093CB -:105180000C0680930D0690930E0610E084E50E94B5 -:105190007131882359F00E94F530609303067093B3 -:1051A000040680930506909306061FC4112309F494 -:1051B0001CC4409107065091080660910906709141 -:1051C0000A068DE295E00E94DC5D40910B0650914D -:1051D0000C0660910D0670910E068AE295E00E9421 -:1051E000DC5D4091030650910406609105067091C4 -:1051F000060687E295E00E94DC5D8AE00E940232AA -:10520000F4C382E40E942831882349F0AED760932A -:10521000230670932406809325069093260683E543 -:105220000E942831882349F0E0D760933B067093B1 -:105230003C0680933D0690933E0684E50E9428310B -:10524000882349F0D2D7609337067093380680934D -:10525000390690933A0688E5FBD7882349F0C5D7ED -:105260006093DF057093E0058093E1059093E2057C -:1052700089E5EED7882349F0B8D76093E3057093AA -:10528000E4058093E5059093E6058AE5E1D7882358 -:1052900049F0ABD76093E7057093E8058093E90583 -:1052A0009093EA0585E4D4D7882309F49EC39DD75B -:1052B0006093EB057093EC058093ED059093EE05FC -:1052C00094C31F5FF4E0EF0EF11C133011F40C9443 -:1052D000701FD6018D916D01BBD7882391F385D7BF -:1052E000F7016083718382839383812F55D6E9CF41 -:1052F0000E94B2837AC30E94B18177C383E5F1D75C -:10530000882309F472C341D770934E0260934D0213 -:105310006CC38DED90E00E94A935811166C383E5D1 -:10532000E0D78823D1F100915B1010E02ED7000F59 -:10533000111FF801E55BFD4F7183608380915B1065 -:1053400090E08C01000F111F000F111F98012C5EBF -:105350003D4F7901880F991FFC01E55BFD4F60818E -:105360007181072E000C880B990B0E9473EB2AE0C9 -:1053700037ED43E25CE30E94D2EBF801E65CFD4EC0 -:1053800020813181428153810E94D2EBD7016D93FC -:105390007D938D939C93139728C3EAEBFFE0849150 -:1053A0008F010F5F1F4F882321F00E940232F80106 -:1053B000F6CF85E40E94023280915B10805D0E94EE -:1053C0000232E0915B10F0E0EE0FFF1FE55BFD4F56 -:1053D000608171818DE395E00E94F95D85E20E9414 -:1053E00002328AE00E94023200C380E531D788236E -:1053F00009F4FBC2CAD66B017C0183E572D788230E -:1054000019F0C3D68B0102C00FEF1FEFC801019640 -:10541000039708F0EAC2D7FCE8C28C2DE5E4F5E07A -:105420009491891709F456C43196B5E0E237FB0729 -:10543000B9F753C48AE555D7811177C483E551D7AD -:10544000811173C4D2C283E54CD7882311F09DD655 -:1054500002C064E071E079A368A380E542D78823A5 -:1054600031F093D66938E3E17E0730F402C068EE8C -:1054700073E07A83698304C088E893E19A8389831F -:10548000BE01605E7F4FCE0101960E9494DBADC2EB -:1054900085E427D781110EC080E5DAD6882381F014 -:1054A000A4D66093BA057093BB058093BC05909316 -:1054B000BD0506C07AD6882379F3EBE8FFE068C023 -:1054C00089E4C6D6882379F090D62CEA35EC47E2F9 -:1054D0005EE30E94D2EB6093C2057093C305809394 -:1054E000C4059093C50584E4B3D6882379F07DD6AE -:1054F0002CEA35EC47E25EE30E9473F06093BE0550 -:105500007093BF058093C0059093C105EAEBFFE05F -:1055100084918F010F5F1F4F882319F073D7F80113 -:10552000F7CF4091BA055091BB056091BC057091D1 -:10553000BD058AE795E00E94DC5D2CEA35EC47E288 -:105540005EE36091C2057091C3058091C40590919E -:10555000C5050E9473F0AB01BC0186E795E00E948F -:10556000DC5D2CEA35EC47E25EE36091BE057091AC -:10557000BF058091C0059091C1050E94D2EBAB019F -:10558000BC0182E795E00E94DC5D8AE03BD72DC23A -:1055900084918F010F5F1F4F882319F033D7F801D3 -:1055A000F7CFEEE7F5E084918F010F5F1F4F88235F -:1055B00009F41BC227D7F801F6CF83E549D6182F87 -:1055C000882369F012D60E94DBF070931902609371 -:1055D000180221E0672B09F020E02093450680E5C2 -:1055E00037D6882351F02091180230911902232BCD -:1055F00009F0ECD580934506F8C11111F6C1EAEB2C -:10560000FFE084918F010F5F1F4F882319F0FAD6B6 -:10561000F801F7CF80914506811103C06CE173E07A -:1056200002C064E773E085EA95E00E94125E609133 -:1056300018027091190284E995E00E94F95DE0E991 -:10564000F5E084918F010F5F1F4F882309F4CDC1CE -:10565000D9D6F801F6CF0E94927CC7C180E5F8D573 -:10566000882349F0C2D56093BD107093BE1080931B -:10567000BF109093C01089E4EBD5882379F0B5D59D -:105680002CEA35EC47E25EE30E94D2EB6093B9105E -:105690007093BA108093BB109093BC1084E4D8D55B -:1056A000882379F0A2D52CEA35EC47E25EE30E942C -:1056B00073F06093B5107093B6108093B710909309 -:1056C000B810EAEBFFE084918F010F5F1F4F882332 -:1056D00019F098D6F801F7CF4091BD105091BE1047 -:1056E0006091BF107091C01080EC95E00E94DC5D6D -:1056F0002CEA35EC47E25EE36091B9107091BA1084 -:105700008091BB109091BC100E9473F0AB01BC0162 -:105710008CEB95E00E94DC5D2CEA35EC47E25EE321 -:105720006091B5107091B6108091B7109091B8103B -:105730000E94D2EBAB01BC0188EB95E00E94DC5DDE -:105740008AE060D652C183E583D5811106C03FE46B -:10575000E32E32E0F32E10E00DC010E026D5682FC6 -:10576000812F0E943CB91F5F1530C1F7F0CF1F5F3A -:10577000143061F0D7018D917D016AD58823B9F38A -:1057800014D5682F812F0E943CB9F1CF82E460D5F7 -:10579000882329F00AD5682F84E00E943CB90E9432 -:1057A00015B823C183E59DD5882309F442C0FDD4F3 -:1057B000813049F0823009F03CC09FE4E92E92E04C -:1057C000F92E10E01FC02FE4E22E22E0F22E10E0AE -:1057D000F70181917F0185D5882331F0E6D44FEF21 -:1057E000682F812F0E94CDB81F5F143089F782E4A3 -:1057F00078D58823F1F0D9D44FEF682F17C01F5FF9 -:10580000143069F0D7018D917D016BD58823B9F3F0 -:10581000CCD4482F6FEF812F0E94CDB8F0CF82E417 -:1058200060D5882331F0C1D4482F6FEF84E00E9407 -:10583000CDB80E9415B8D9C0EBE8FFE084918F0184 -:105840000F5F1F4F882319F0DDD5F801F7CFE4EC87 -:10585000F5E084918F010F5F1F4F882309F4C5C0C5 -:10586000D1D5F801F6CF0E94165FBFC00E942E7CF2 -:10587000BCC00E94FD7AB9C083E5EAD4882319F040 -:10588000A5D491E089270E94FA76AFC02093480FF3 -:105890000E94876D1092480F882309F4A6C0EAEB96 -:1058A000FFE084918F010F5F1F4F882319F0AAD565 -:1058B000F801F7CFE3EDF5E084918F010F5F1F4F03 -:1058C000882309F492C09ED5F801F6CF1F5F1430EB -:1058D00059F0F70181917F01BBD48823B9F355D4E6 -:1058E000812F0E947EB9F2CF82E4B2D4882321F0C6 -:1058F0004CD484E00E947EB983E5AAD4882309F4BD -:1059000074C010E042D4812F0E947EB91F5F153011 -:10591000C9F76BC083E5E5D4882319F036D48B0131 -:1059200002C000E010E080E5DCD4882319F02DD41B -:10593000CB0102C080E090E0B8010E946FB955C071 -:1059400081E080933A021092DE0583E5CAD4882371 -:1059500031F03CD4811149C00E94D19446C083E506 -:1059600077D4F8CF0E946B4F40C0F090760F0E9422 -:10597000165FFF2009F1EAEBFFE084918F010F5FD2 -:105980001F4F882319F03ED5F801F7CF84E53AD5AB -:105990006F2D70E080E090E04AE00E943E3580E2AA -:1059A00031D5E0EFF5E084918F010F5F1F4F882321 -:1059B000E1F028D5F801F7CF10920411EAEBFFE0EF -:1059C00084918F010F5F1F4F882319F01BD5F801B9 -:1059D000F7CF6091041170E08EED95E00E94F95DC3 -:1059E0008AE010D502C00E946B4F1092FB0F0E94FC -:1059F000B494F6C182D40E94A093F7CF0E94165FA0 -:105A000080911F0290912002A0912102B091220268 -:105A100080939B0390939C03A0939D03B0939E035C -:105A200080914D0290914E0290939A038093990336 -:105A300084E690E090934E0280934D0211E0109323 -:105A4000100488E505D4282E89E502D4082F8AE5BC -:105A5000FFD3382E211004C0011104C0132505C046 -:105A6000011102C010E001C0132D80E1EDE1F4E06E -:105A7000A5E1B0E101900D928A95E1F782E531D47C -:105A8000882309F4AEC0B1D36B017C0120E030E083 -:105A9000A9010E946DEB882309F4A3C0111105C070 -:105AA000211003C0002309F4ADC0C0921D10D09294 -:105AB0001E10E0921F10F0922010209125043091CA -:105AC00026044091270450912804C701B6010E9482 -:105AD000BDF118160CF085C02091210430912204EC -:105AE00040912304509124042CA73DA74EA75FA703 -:105AF00040901D0450901E0460901F04709020047C -:105B000080911F0290912002A0912102B091220267 -:105B100088AB99ABAAABBBABEEEBF2E2859095906C -:105B2000A590B49080921F0290922002A092210230 -:105B3000B0922202C0922504D0922604E09227045B -:105B4000F0922804FDD185E595E5A5E0B3E48093C6 -:105B50001F0290932002A0932102B0932202409250 -:105B60001D0450921E0460921F04709220042CA504 -:105B70003DA54EA55FA520932104309322044093B8 -:105B8000230450932404DCD1209125043091260471 -:105B90004091270450912804C701B6010E946DEB83 -:105BA00087FF11C080921F0290922002A0922102D2 -:105BB000B0922202C0922504D0922604E0922704DB -:105BC000F0922804BDD10E94165F88A999A9AAA9BC -:105BD000BBA980931F0290932002A0932102B0934F -:105BE0002202111105C0211003C0011106C00AC014 -:105BF00080E00E942C8F1123C1F381E00E942C8F42 -:105C0000111102C0332019F082E00E942C8F04D2BF -:105C100080910F048093100480919B0390919C03CA -:105C2000A0919D03B0919E0380931F029093200248 -:105C3000A0932102B09322028091990390919A033C -:105C400090934E0280934D0283E0809313020E9452 -:105C5000C682CBCE11110C9479210C9472210E9432 -:105C600089900C949B2191D2AB01BC014093650CAF -:105C70005093660C6093670C7093680C85E09EE00F -:105C80000E943087B2CE0E94165F88E5E1D2882359 -:105C900031F0179A809133048E7F8093330489E525 -:105CA000D7D2882331F0169A809133048D7F809368 -:105CB00033048AE5CDD2882331F0159A80913304DC -:105CC0008B7F8093330485E4C3D2882309F48DCE7F -:105CD000149A8BCE0E9443DC88CE0E94165FBC2CA7 -:105CE00060E08C2D0E944FBD0F3FFFEF1F0759F45E -:105CF0008C2D0E94F9BC31E020E0892B09F030E0C6 -:105D0000032F122F05C00130110561F000E010E0F3 -:105D10008B2D0E94F9BC8017910709F466CE0E9472 -:105D20008990F6CF01E010E0F3CF5FD220E030E0C1 -:105D300040E050EC0E946DEB87FD10C056D220E091 -:105D400030E040E050E40E94BDF1181614F04DD24E -:105D500009C060E070E080E090E404C060E070E0C2 -:105D600080E090EC2091330422FF3FCE0091381266 -:105D7000109139122091630B3091640B4091650BA7 -:105D80005091660B0E94D2EB0E94DBF0600F711FF6 -:105D9000709339126093381228CE61E0812F0E94EF -:105DA0004FBD6E2D812F0E9421BDF12CB701812F97 -:105DB0000E948BBD163029F4F0924206E092410613 -:105DC00014CE183029F4F0924006E0923F060DCE32 -:105DD000123009F00ACEF0924406E092430605CE56 -:105DE000C15ADF4F0FB6F894DEBF0FBECDBFDF91B3 -:105DF000CF911F910F91FF90EF90DF90CF90BF90C8 -:105E0000AF909F908F907F906F905F904F903F905A -:105E10002F90089590913104E92FF0E0E35DFB4F5E -:105E200080839F5F943018F49093310402C01092E5 -:105E300031048091B6058F5F8093B605089508956B -:105E400080E090E008958091F90F9091FA0F9817F3 -:105E500059F0E92FF0E0E758F04F80819F5F9F777E -:105E60009093FA0F90E008958FEF9FEF08950F93AE -:105E70001F93CF93DF93EC010E94EDDB0E811F8116 -:105E800028853985011511052105310559F52C8520 -:105E90002223A9F13A8521502C8721E0230F2A875C -:105EA0004D85241301C01A86FE0124E0329FE00DC7 -:105EB000F11D112406851785208931890A831B83EA -:105EC0002C833D83DC01CB01800F911FA11DB11DEF -:105ED0008E839F83A887B9878C819D81892B79F0D8 -:105EE000769A0DC0DC01CB01801B910BA20BB30B8A -:105EF000B7FD05C076981E821F8218861986DF912D -:105F0000CF911F910F910895CF93FC0120812B33E6 -:105F1000A1F02091B605243080F4C62FBC018091F9 -:105F20003104F0E68F9FC00111248B5C9B4F0E94CF -:105F300007F38C2F6FDF81E001C080E0CF910895DF -:105F4000CF92DF92EF920F931F93CF93DF9300D006 -:105F50001F92CDB7DEB7E090041119821A821B821E -:105F60001C82CE0101966C010FE112E029E234E0BF -:105F700045E254E061E274E08DE194E00E94014169 -:105F80000F900F900F900F90DF91CF911F910F9175 -:105F9000EF90DF90CF9008950F931F93CF93DF93EF -:105FA00094E0899FE00111248E0108581F4EFE01E4 -:105FB000EF5EFB4FDE01A75FBF4E2D913D914D91EE -:105FC0005C9160817181828193810E9497EFF801D9 -:105FD0006083718382839383FE01E857F84F859134 -:105FE0009591A591B491FE01EC57FF4E808391836A -:105FF000A283B383FE01EC56F84F85919591A5914C -:10600000B491C35DDD4F88839983AA83BB83DF91FD -:10601000CF911F910F91089529E234E045E254E0B9 -:1060200061E274E08DE194E00C94265F2F923F9240 -:106030004F925F926F927F929F92AF92BF92CF9258 -:10604000DF92EF92FF920F931F93CF93DF93CDB721 -:10605000DEB728970FB6F894DEBF0FBECDBF1A018A -:106060002B01922EF32EC82ED12CF601ED5FFC4DA4 -:10607000E491AA24A3941E160CF4A12CBB24B3947F -:1060800020E030E0A901C201B1010E94BDF1181663 -:106090000CF0B12CCC0CDD1CCC0CDD1CC601835EDD -:1060A0009B4F3C01FC011082118212821382B4DFEB -:1060B000F3012082318242825382E090041120E079 -:1060C00030E0A901B801892D9F2D0E946DEB81114F -:1060D0000AC0F601EA54FD4D85919591A591B491C0 -:1060E0008C019A2EFB2EC801A92DBF2D8D839E8376 -:1060F000AF83B88719821A821B821C82CE01019657 -:106100006C018E010B5F1F4F29E234E045E254E041 -:1061100061E274E08DE194E00E9401410E94165F0B -:10612000AB1459F080913204882319F01092320494 -:1061300004C080EA97E00E94299028960FB6F89450 -:10614000DEBF0FBECDBFDF91CF911F910F91FF90AA -:10615000EF90DF90CF90BF90AF909F907F906F9027 -:106160005F904F903F902F90089580919F03909162 -:10617000A003009731F04AE050E060E070E00C943A -:10618000ABE960E070E0CB01089580919F039091AE -:10619000A003009731F04AE050E060E070E00C941A -:1061A00080E860E070E0CB010895EFDF97FD0AC062 -:1061B000ECDF6F3F71058105910509F02CF4E5DFF7 -:1061C000862F089580E008958FEF089580919F03B2 -:1061D0009091A003892B31F0E8DF91E0811103C099 -:1061E00090E001C091E0892F08950F931F93CF9302 -:1061F00080919F039091A0030097F1F0FC018F0123 -:10620000C1912C2F2F7D89F0C53411F0C536B9F717 -:10621000F801108260E070E00E942DE7F801C08371 -:10622000562F472F382F292F0BC060E070E0CF91F9 -:106230001F910F910C942DE750E040E030E020E0FA -:10624000652F742F832F922FCF911F910F91089557 -:1062500081548A3108F042C0E82FF0E04091700F7D -:106260005091710F6091720F7091730F04C0769509 -:106270006795579547958A95D2F7842F817040FF8F -:106280002FC0EA5AF04F9081992309F1E091DC0583 -:10629000F091DD05E90FF11D908120ED290F2A30E5 -:1062A00098F09E3211F491810CC09D3211F09B3216 -:1062B00071F4918120ED290F2A3030F09E3239F4AB -:1062C000928190539A3018F42E2F9F2F02C020E015 -:1062D00090E020939F039093A003089580E0089599 -:1062E0000895B6DF882341F081E020919F0330912B -:1062F000A003232B09F480E008959F92AF92BF92F0 -:10630000CF92DF92EF92FF920F931F93CF93DF9381 -:106310008FE4A82E82E0B82E05E110E1CDE1D4E0B3 -:1063200098E7C92E90E1D92E24E9E22E23E0F22E3F -:10633000912CF50181915F018BDF882301F155DFFD -:10634000F7012081211104C020919803222339F004 -:10635000288139814A815B810E9497EF0AC0F3E06E -:106360009F1639F0F60120813181428153810E94CC -:1063700096EFF801608371838283938309C08881DB -:106380009981AA81BB81F80180839183A283B38321 -:1063900093940C5F1F4F2496F4E0CF0ED11C2FEF87 -:1063A000E21AF20A84E09812C4CF86E49ADF8823C6 -:1063B000B9F01BDF20E030E0A9010E94BDF1181602 -:1063C0007CF413DF20E030E040E752E40E9473F0F9 -:1063D00060931F0270932002809321029093220207 -:1063E000DF91CF911F910F91FF90EF90DF90CF90B1 -:1063F000BF90AF909F900895FC01238121110C94D0 -:106400001A8808959091C00095FFFCCF8093C60034 -:106410000895EF92FF921F93CF93DF937C0160E08A -:1064200073DD182F882399F0EAEBFFE08491EF01E8 -:106430002196882319F0E6DFFE01F8CFB70182E04C -:1064400096E00E94125E82E2DDDF8AE0DBDF812FD0 -:10645000DF91CF911F91FF90EF900895DF92EF921F -:10646000FF920F931F93CF93DF93CDB7DEB76E9755 -:106470000FB6F894DEBF0FBECDBF609119117091B9 -:106480001A116115710541F14DE150E0CE010196FF -:106490007C010E94DEEA1E8EF7018F010E191F0992 -:1064A000D190DD2019F09AE0D912F7CFF701E00F73 -:1064B000F11F1082C701ADDF882371F0DD20A9F044 -:1064C0000F5F1F4F8091191190911A11080F191F1A -:1064D00010931A110093191181E020911911309134 -:1064E0001A11232B29F480E003C000E010E0F0CF64 -:1064F0006E960FB6F894DEBF0FBECDBFDF91CF9181 -:106500001F910F91FF90EF90DF9008952F923F928F -:106510004F925F926F927F928F929F92AF92BF92B3 -:10652000CF92DF92EF92FF920F931F93CF93DF935F -:10653000CDB7DEB7C056D1090FB6F894DEBF0FBE97 -:10654000CDBF8CDF811180C28091B605843008F008 -:1065500047C079DCAC0197FF91C142C08E3409F08D -:10656000EEC10115110509F4EAC16FE377E0C80136 -:106570000E94EDEA7C01892B09F4A3C16EE470E06E -:10658000C80104960E94F3F2009709F49AC14AE008 -:1065900050E060E070E001960E9480E86093A10303 -:1065A0007093A2038093A3039093A4038090740B31 -:1065B0009090750BA090760BB090770B2FEF821A0E -:1065C000920AA20AB20A681579058A059B0509F4A0 -:1065D0007AC1EF2809F077C18CE097E00E946951F9 -:1065E0008091350C882309F42FC28091B605811162 -:1065F00002C010920704662463944091650C509188 -:10660000660C6091670C7091680C8091610C9091A0 -:10661000620CA091630CB091640C481759076A078B -:106620007B0708F4612C00E010E0CE0101966C01BC -:106630003324339480E6282E98E4492E97E0592E8F -:106640008091B605843008F0FFC16110FDC18091D2 -:1066500007048111F9C180910D0E90910E0EA09149 -:106660000F0EB091100E8093650C9093660CA09362 -:10667000670CB093680C41E050E0B60185E09EE005 -:106680000E949A8A019719F4898190E002C08FEFE5 -:106690009FEF782E8090650C9090660CA090670C10 -:1066A000B090680C4091610C5091620C6091630C49 -:1066B0007091640C6624639484169506A606B7064A -:1066C00008F4612C84169506A606B706B0F4019668 -:1066D00009F472C08AE0781609F49FC09DE079162B -:1066E00009F49BC023E2721619F08AE37812ACC059 -:1066F000809106048111A8C085C00E94165F85E0C4 -:106700009EE00E941A8850921A1140921911A6DE3A -:106710008091200E882361F181508093200E2DE816 -:10672000289FC001112441E061E08B5D914F0E94E0 -:106730005E54E091200E84E0E89FF0011124EF5DAB -:10674000F14F40815181628173814093650C509378 -:10675000660C6093670C7093680C85E09EE00E9465 -:1067600030878091360C8823B9F03092350C14C0F4 -:106770001092350C0E9414740E9400B80E947AB7DF -:106780006D3371058105910538F084E497E09093AD -:106790001A118093191162DE8091350C811136C077 -:1067A000E1E6F7E084917F019FEFE91AF90A882377 -:1067B00049F128DEF701F6CFEBE8FFE084917F0195 -:1067C0002FEFE21AF20A882319F01CDEF701F6CF48 -:1067D000E2E5F7E084917F019FEFE91AF90A882347 -:1067E00019F010DEF701F6CF8EE497E09F938F93B8 -:1067F000DF92CF920E9407EBC6010BDE0F900F9045 -:106800000F900F9083E2781208C005C023E2721245 -:1068100018C100E010E03092070410920604011540 -:10682000110519F40E9446B40CC080913104289ED1 -:10683000000D111D1124F801EB5CFB4F108280E06C -:10684000E9DA00E010E0FCCE0F35110508F0F8CED3 -:106850009BE3791202C030920604809106048111F4 -:10686000EFCE80913104F801289EE00DF11D112436 -:10687000EB5CFB4F70820F5F1F4FE2CE982F209191 -:10688000720B3091730B8A3019F09D3009F0A8C05B -:10689000109205042115310519F40E9446B454CE16 -:1068A000F901EB55FC4F10821092730B1092720B92 -:1068B00005EA13E0F8018191803209F04FCE8F0193 -:1068C000F9CFC80164CE6AE270E0C8010E942BF3E0 -:1068D0009C01009701F1982F901BF12C992339F01E -:1068E0009150F801E90FF11D8081F826F7CF4AE0B9 -:1068F00050E060E070E0C90101960E9480E8CF2C72 -:10690000D12CE12CF12C6C157D058E059F0531F005 -:106910008DEE96E063CE83EC96E060CE8091A1038D -:106920009091A203A091A303B091A4038093740B50 -:106930009093750BA093760BB093770B07C0809163 -:10694000330C882319F089E996E048CE80913A0209 -:10695000811122C067E470E0C8010E94F3F2009741 -:10696000D9F04AE050E060E070E001960E9480E8D3 -:106970006430710588F4E2E2F6E084917F019FEFD4 -:10698000E91AF90A882319F03DDDF701F6CF60E036 -:1069900088E196E00E9430C560E273E0C8010E9481 -:1069A000FEF2892B21F41092060210923A1065E251 -:1069B00073E0C8010E94FEF2892B21F48FE096E07B -:1069C0000E9429906AE273E0C8010E94FEF2892BBE -:1069D00011F40E943B7C61E085EA93E095DAB4CD46 -:1069E0002F3531050CF0B0CD9C35B9F42CDA97FD7C -:1069F000ABCD209105042111A7CD2091720B3091D0 -:106A0000730BA9014F5F5F4F5093730B4093720B51 -:106A1000F901EB55FC4F808397CD9B3319F481E04E -:106A2000809305048091050481118ECDC9010196E2 -:106A30009093730B8093720BF901EB55FC4F4083DD -:106A400083CD10920604EECEC05ADF4F0FB6F894F5 -:106A5000DEBF0FBECDBFDF91CF911F910F91FF9091 -:106A6000EF90DF90CF90BF90AF909F908F907F90EE -:106A70006F905F904F903F902F9008958F929F92CC -:106A8000AF92BF92EF92FF920F931F93CF93DF933A -:106A9000CDB7DEB7A0970FB6F894DEBF0FBECDBF5F -:106AA000611571058105910589F100E0842E912C15 -:106AB000A12CB12C102FEE24E394F12CEC0EFD1E32 -:106AC000E00EF11C07FDFA94A50194010E945BEF12 -:106AD000F7016083B901CA010F5F61157105810576 -:106AE000910541F71F3F21F1E1E0F0E0EC0FFD1FC0 -:106AF000E10FF11D17FDFA9580818A3010F097E3C0 -:106B000001C090E3890F7EDC1150ECCF80E3A096AA -:106B10000FB6F894DEBF0FBECDBFDF91CF911F91AE -:106B20000F91FF90EF90BF90AF909F908F906ACCA5 -:106B3000A0960FB6F894DEBF0FBECDBFDF91CF9108 -:106B40001F910F91FF90EF90BF90AF909F908F900B -:106B50000895EF92FF920F931F93CF93DF937C01E1 -:106B600084E5BFDBD82F882321F11FDBC82F18163F -:106B7000E4F4EAEBFFE084918F010F5F1F4F88235D -:106B800019F040DCF801F7CF8DE43CDCB70180E080 -:106B900090E04AE073DF6C2FCC0F770B85E797E02E -:106BA0000E94F95D8AE02EDC08C080935B10D0E083 -:106BB00004C08091041180935B108D2FDF91CF91E1 -:106BC0001F910F91FF90EF900895CF92DF92EF9277 -:106BD000FF926B017C0197FF0AC08DE213DCF094F9 -:106BE000E094D094C094C11CD11CE11CF11C4AE07B -:106BF000C701B601FF90EF90DF90CF903FCF2F926B -:106C00003F924F925F926F927F928F929F92AF923C -:106C1000BF92CF92DF92EF92FF920F931F93CF9389 -:106C2000DF93CDB7DEB762970FB6F894DEBF0FBE25 -:106C3000CDBF8DE690E08DDF8111A4C180915A0B0C -:106C400083FDA0C183E54DDB8F83811105C082E503 -:106C500048DB882309F496C1C8DA0E94DBF0709300 -:106C600003116093021180E00E9407AABEDA20E0BF -:106C700030E04AEA52E40E946DEB18162CF00E94B4 -:106C800000B80E9411CF02C00E94C9B760910211E2 -:106C900070910311072E000C880B990B0E9473EB67 -:106CA0006B017C018090460690904706A0904806B4 -:106CB000B0904906A50194010E94BDF1181674F028 -:106CC0002F81211110C0A5019401C701B6010E94B6 -:106CD000BDF118161CF081EC97E002C08EEC97E035 -:106CE00060E00E9430C50E942D5E81E08093060224 -:106CF0001B821C821D821E8219861A861B861C8698 -:106D00001A821D863CE33E874CE14F8756E4588B40 -:106D10001A8A312C80E889839FEB998B812C912CE6 -:106D200054016091021170910311072E000C880B21 -:106D3000990B0E9473EB7B018C019B01AC016A896A -:106D4000732D898199890E946DEB882309F440C0D5 -:106D500020914606309147064091480650914906D9 -:106D6000AF81B701C801A1110BC00E946DEB881F54 -:106D70008827881F8A83EA8A3F2C0983198B28C0B9 -:106D80000E946DEB87FF1FC080910602882309F4E3 -:106D9000F9C062960FB6F894DEBF0FBECDBFDF918B -:106DA000CF911F910F91FF90EF90DF90CF90BF9008 -:106DB000AF909F908F907F906F905F904F903F909B -:106DC0002F900C9411CFEA8A3F2C0983198B1A82D9 -:106DD0000E94EDDB6B017C01DC01CB0129853A854A -:106DE0004B855C85821B930BA40BB50BB7FD37C09D -:106DF000D701C60188519C4FAF4FBF4F89879A87F3 -:106E0000AB87BC870E940EA8EDEBF7E084913F01B1 -:106E10009FEF691A790A882319F0F4DAF301F6CFA3 -:106E200081149104A104B104B1F0D501C401805FC3 -:106E3000984DAF4FBF4FBC01CD016C197D098E0934 -:106E40009F0928EE33E040E050E00E945BEFCA016A -:106E5000B901BBDE02C08FE3D5DA8AE0D3DA0E9443 -:106E600089900E94EDDB6093FC0F7093FD0F80937F -:106E7000FE0F9093FF0F20904606A0914706A8872B -:106E80000091480610914906222D3A2FA8016A89DF -:106E9000732D898199890E9496EF2B013C0120E096 -:106EA00030E0A9010E94BDF187FF04C077FA709419 -:106EB00077F8709481149104A104B10459F420E08E -:106EC00030E040E85FE3C301B2010E946DEB87FF51 -:106ED0000DC00AC020E030E040E450E4C301B2013C -:106EE0000E94BDF1181614F446015701BA81BB2364 -:106EF00089F12B813C814D815E8121153105410550 -:106F0000510541F0D701C601821B930BA40BB50BB1 -:106F1000B7FD20C0222D3885A8016D857E858F851F -:106F200098890E9496EF20E030E040EC5FE30E94F9 -:106F30006DEB87FD29CFD701C601805A9541AF4F30 -:106F4000BF4F8B839C83AD83BE832D8698859E87A0 -:106F50000F87188B80910602882309F415CF8114BE -:106F60009104A104B10409F4DCCEA0E1CA1AA7E29D -:106F7000DA0AE108F108C818D908EA08FB08F7FEA0 -:106F800003CFCFCE62960FB6F894DEBF0FBECDBF53 -:106F9000DF91CF911F910F91FF90EF90DF90CF90F5 -:106FA000BF90AF909F908F907F906F905F904F9029 -:106FB0003F902F9008958F929F92AF92BF92CF9261 -:106FC000DF92EF92FF92CF936B017C01B42E20E011 -:106FD00030E0A9010E946DEB87FF06C08DE212DA56 -:106FE000F7FAF094F7F8F094C0E060E070E080E029 -:106FF0009FE3CB1541F02DEC3CEC4CEC5DE30E94A3 -:10700000D2EBCF5FF6CF9B01AC01C701B6010E9466 -:1070100097EF6B017C010E94E0F04B015C014AE0BC -:107020002DDDCC2379F1C501B4010E9471EB9B01E8 -:10703000AC01C701B6010E9496EF6B017C018EE2A4 -:10704000E1D920E030E040E251E4C701B6010E94FE -:10705000D2EB4B015C010E94DBF06B01770FEE0875 -:10706000FF08C701B601B1DDC701B6010E9473EB8D -:107070009B01AC01C501B4010E9496EF6B017C013C -:10708000C150F9F6CF91FF90EF90DF90CF90BF9075 -:10709000AF909F908F9008951F920F920FB60F920E -:1070A00011240BB60F922F938F939F93EF93FF931F -:1070B0002091FA0FE091F90F81E08E0F8F77909178 -:1070C000C600281729F0F0E0E758F04F9083E82F2A -:1070D000E093F90FFF91EF919F918F912F910F9076 -:1070E0000BBE0F900FBE0F901F9018950E94ACF230 -:1070F0002CEA35EC47E25EE36091D3057091D4054C -:107100008091D5059091D6050E9473F06093BE05DD -:107110007093BF058093C0059093C10508952CEA34 -:1071200035EC47E25EE36091D7057091D805809118 -:10713000D9059091DA050E94D2EB6093C205709355 -:10714000C3058093C4059093C5050895CF93DF933D -:107150000E947DBBD0910D11C0E0D11120C0809163 -:107160001011882331F080911302882309F476C02E -:107170000DC0809139108823B1F3109239100E940C -:10718000D86780910F11882371F3A3C081E090919B -:107190001011911180E024E04AE15CE05CC0D13044 -:1071A00019F580911011813031F0809113028823FC -:1071B00009F454C00FC0809139108823B1F31092A4 -:1071C000391084EE93EB0E94869F80910F118823E3 -:1071D00061F37FC081E090911011913009F080E05F -:1071E00023E043E15CE037C0D23011F5809110110B -:1071F000823029F080911302882381F10FC08091A1 -:1072000039108823B9F3109239108AE09BE30E9469 -:10721000869F80910F11882369F35BC081E0909174 -:107220001011923009F080E023E04CE05CE013C0E4 -:10723000D33059F5809110118330C1F08091130241 -:10724000882361F081E090911011933009F080E083 -:1072500023E045E05CE06C2F0E9494C4CF5FDF5FC9 -:10726000C53009F07ACFC0930E1133C08091391028 -:10727000882321F3109239108FE09BE30E94869FB0 -:1072800080910F118823D1F224C0D43039F7809136 -:107290001011843029F0809113028823F9F20FC075 -:1072A000809139108823B9F31092391084E19BE35F -:1072B0000E94869F80910F11882369F30AC081E0A4 -:1072C00090911011943009F080E023E04CEF5BE0E6 -:1072D000C2CFDF91CF910895CF93DF930E947DBB02 -:1072E000D0910D11C0E0D11120C0809110118823E0 -:1072F00031F080911302882309F476C00DC080918B -:1073000039108823B1F3109239100E94D867809108 -:107310000F11882371F314C181E090911011911124 -:1073200080E024E048E95CE05CC0D13019F5809150 -:107330001011813031F080911302882309F454C078 -:107340000FC0809139108823B1F3109239108CE767 -:107350009CE30E94869F80910F11882361F3F0C007 -:1073600081E090911011913009F080E023E04CE829 -:107370005CE037C0D23011F580911011823029F0D5 -:1073800080911302882381F10FC0809139108823E6 -:10739000B9F3109239108BEB90EA0E94869F80918E -:1073A0000F11882369F3CCC081E0909110119230C5 -:1073B00009F080E023E045E85CE013C0D33061F5DC -:1073C000809110118330C9F080911302882361F0FD -:1073D00081E090911011933009F080E023E04CE7B8 -:1073E0005CE06C2F0E9494C4CF5FDF5FC53009F072 -:1073F0007ACF88E080930E11A3C080913910882342 -:1074000019F31092391083E99FE90E94869F8091B9 -:107410000F118823C9F294C0D43011F58091101156 -:10742000843029F0809113028823F1F20FC08091FB -:1074300039108823B9F3109239100E9401690E9413 -:10744000F0CE80910F11882369F37AC081E090918A -:107450001011943009F080E020E24DE65CE0C1CFED -:10746000D53019F580911011853031F080911302DB -:10747000882309F4B9CF0FC0809139108823B1F364 -:10748000109239100E942E7C0E94F0CE80910F1134 -:10749000882361F355C081E090911011953009F077 -:1074A00080E020E24DE45CE09CCFD63019F580917D -:1074B0001011863031F080911302882309F494CFA3 -:1074C0000FC0809139108823B1F3109239100E94B7 -:1074D000FD7A0E9465C480910F11882361F330C04A -:1074E00081E090911011963009F080E020E24CE3A9 -:1074F0005CE077CFD73009F077CF809110118730DB -:1075000031F080911302882309F46ECF0FC080916F -:1075100039108823B1F31092391083EA9AE30E945C -:10752000869F80910F11882361F30AC081E09091BA -:107530001011973009F080E023E04BE55CE051CF7B -:10754000DF91CF9108951F93CF93DF930E947DBB6E -:1075500010910D11C0E0812F8C0F01F58091101159 -:10756000882331F080911302882309F448C00DC0AC -:10757000809139108823B1F3109239100E94D86796 -:1075800080910F11882371F341C081E09091101117 -:10759000911180E024E044E35CE02EC0813079F575 -:1075A00080911011813029F080911302882339F1E4 -:1075B0001AC0809139108823B9F3109239100E94B3 -:1075C000FD7A0E940169D82F882319F080E00E947B -:1075D000FA768D2F0E94F0CE0E94D86780910F110D -:1075E000882311F313C081E090911011913009F0BC -:1075F00080E020E242E25CE06C2F0E9494C4CF5F06 -:10760000C53009F0A8CF82E080930E11DF91CF91B1 -:107610001F91089568E97FEA81E00C9493B264E9D0 -:107620007FEA82E00C9493B26BE07EEA83E00C94F4 -:1076300093B22F923F924F925F926F927F928F926E -:107640009F92AF92BF92CF92DF92EF92FF920F93F1 -:107650001F93CF93DF93C82F0E947DBB40900D11E5 -:10766000512CD0E0CC0FDD1FCE0189539A4F7C0105 -:1076700092ED292E9DE0392ECE0185539A4F6C0153 -:1076800025EE622E2DE0722EC153DA4F33EFA32E7A -:107690003DE0B32E4DEF842E4DE0942E411020C0DE -:1076A00080911011882331F080911302882309F40E -:1076B000B8C00DC0809139108823B1F310923910F1 -:1076C0000E94D86780910F11882371F302C181E075 -:1076D00090911011911180E024E041E15EE09EC0A4 -:1076E00091E049123EC080911011813031F08091BB -:1076F0001302882309F495C016C08091391088239D -:10770000B1F31092391000E010E02FEF30E040E0CC -:1077100050E0BE0187E09EE00E94A7E580910F1136 -:10772000882329F3D6C01F928FEF8F931F921F9249 -:10773000DF93CF93BF92AF929F928F925F9281E03F -:1077400090911011913009F080E08F930E9484E4B1 -:107750008DB79EB70C960FB6F8949EBF0FBE8DBF27 -:1077600060C092E0491242C080911011823031F025 -:1077700080911302882309F454C016C080913910F7 -:107780008823B1F31092391000E010E024E031E0DA -:1077900045E050E0B6018CEE9DE00E94A7E58091A7 -:1077A0000F11882329F395C021E02F9384E08F9354 -:1077B0001F9285E08F93DF92CF928EED9DE09F9395 -:1077C0008F937F926F925F9281E09091101192302F -:1077D00009F080E08F930E9484E48DB79EB70C96E9 -:1077E0000FB6F8949EBF0FBE8DBF1BC023E042169C -:1077F00001F184E0481215C080911011843009F421 -:1078000058C080911302882361F081E0909110119B -:10781000943009F080E020E243EC5DE0652D0E94A9 -:1078200094C45394439495E0591238CF50920E115A -:1078300050C080911011833029F080911302882369 -:1078400081F316C0809139108823B9F31092391052 -:1078500000E010E027E830E045E050E0B7018AEDB5 -:107860009DE00E94A7E580910F11882331F331C07C -:107870001F9297E89F931F9285E08F93FF92EF925C -:107880003F922F9286ED9DE09F938F935F9281E0D0 -:1078900090911011933009F080E08F930E9484E45E -:1078A0008DB79EB70C960FB6F8949EBF0FBE8DBFD6 -:1078B000B8CF80913910882309F4A3CF10923910E2 -:1078C0000E9401690E94F0CE80910F11882309F473 -:1078D00098CFDF91CF911F910F91FF90EF90DF90A4 -:1078E000CF90BF90AF909F908F907F906F905F9060 -:1078F0004F903F902F9008953F924F925F926F92DA -:107900007F928F929F92AF92BF92CF92DF92EF922F -:10791000FF920F931F93CF930E947DBBC0910D11D7 -:10792000312C6EECC62E68E9D62E78E0472E7DE02D -:10793000572EEFE06E2EEDE07E2EFAE3AF2EFDE047 -:10794000BF2EA2E58A2EADE09A2EC11123C08091F0 -:107950001011882331F080911302882309F4D4C0D8 -:107960000DC0809139108823B1F3109239100E9414 -:10797000D86780910F11882371F332C481E0909110 -:107980001011911180E024E04BEB5DE0632D0E942B -:1079900094C4BAC0C13009F054C080911011813034 -:1079A00031F080911302882309F4AEC021C0809188 -:1079B00039108823B1F310923910C0931611109228 -:1079C00034101092351010923610109237100EE5C8 -:1079D0001EEC24E031E040E050E062E071E184EB35 -:1079E0009DE00E94A7E580910F118823D1F2F8C392 -:1079F0008EE59EEC9F938F9381E08F9384E08F932D -:107A00001F921F9282E091E19F938F9386EA9DE0FF -:107A10009F938F938DEA9DE09F938F933F9281E098 -:107A200090911011913009F080E08F930E9484E4CE -:107A30008DB79EB70E960FB6F8949EBF0FBE8DBF42 -:107A400063C0C23009F054C080911011823031F00F -:107A500080911302882309F457C022C08091391005 -:107A60008823B1F31092391081E08093161110929F -:107A7000341010923510109236101092371001E623 -:107A80001EEC27E830E040E050E060E071E182EA7F -:107A90009DE00E94A7E580910F118823C9F2A0C341 -:107AA00081E69EEC9F938F931F9287E88F931F929E -:107AB0001F9280E091E19F938F938AE99DE09F93CD -:107AC0008F938EE99DE09F938F933F9281E09091F9 -:107AD0001011923009F080E08F930E9484E48DB7FA -:107AE0009EB70E960FB6F8949EBF0FBE8DBF0CC00A -:107AF000C33009F0FCC080911011833009F470C1CB -:107B000080911302811190C12CEA35EC47E25EE3CB -:107B10006091C2057091C3058091C4059091C5051F -:107B20000E9473F06093D7057093D8058093D905B0 -:107B30009093DA052CEA35EC47E25EE36091BE05EE -:107B40007091BF058091C0059091C1050E94D2EB54 -:107B50006093D3057093D4058093D5059093D60593 -:107B6000CA30E9F5809110118A3031F0809113020A -:107B7000882309F42CC124C0809139108823B1F3E3 -:107B800010923910E12C18E1F12E0CE116E420E0FE -:107B900030E040E85FE36AEB75E08DED9CE00E9429 -:107BA000BBE4D0924402C09243021092FF101092A4 -:107BB000FE101092FD1080910F118823B9F210C3AE -:107BC00011E0809110118A3009F010E08AEB95E005 -:107BD0000E941DC100E09C0147ED5CE041C0CB303C -:107BE00009F043C0809110118B3031F08091130265 -:107BF000882309F4ECC026C0809139108823B1F3A2 -:107C000010923910E12C18E1F12E0CE116E42AE073 -:107C100037ED43E25CE367ED75E081ED9CE00E94A7 -:107C2000BBE4D0924402C09243028FE898E3909361 -:107C3000FF108093FE101092FD1080910F11882389 -:107C4000A9F2CEC211E0809110118B3009F010E042 -:107C500087ED95E00E941DC100E09C014BEC5CE0CB -:107C6000632D812F0E94E7E3B2C0CC3009F0A3C09E -:107C7000809110118C3031F080911302882309F427 -:107C8000A6C026C0809139108823B1F31092391014 -:107C9000E12C18E1F12E0CE116E420E030E040E8A0 -:107CA0005FE363ED75E085EC9CE00E94BBE4D0925D -:107CB0004402C092430288E798E39093FF108093B8 -:107CC000FE101092FD1080910F118823A9F288C236 -:107CD00011E0809110118C3009F010E083ED95E0F7 -:107CE0000E941DC100E09C014FEB5CE0B9CFC430A5 -:107CF00009F4BEC0C53009F409C1C63009F454C145 -:107D0000C73009F080C180911011873009F49DC1FE -:107D100080911302882309F4F7CE83E48F9382E8DD -:107D20008F931F921F921F921F928FE092E09F935A -:107D30008F935F924F927F926F923F9281E09091EA -:107D40001011973009F080E08F930E944CE48DB7BA -:107D50009EB70E960FB6F8949EBF0FBE8DBF2CEA4D -:107D600035EC47E25EE36091C2057091C3058091F6 -:107D7000C4059091C5050E9473F06093D705709378 -:107D8000D8058093D9059093DA052CEA35EC47E2C3 -:107D90005EE36091BE057091BF058091C005909132 -:107DA000C1050E94D2EB6093D3057093D4058093F4 -:107DB000D5059093D605CD3009F0EBC18091101117 -:107DC0008D3009F4CBC1809113028111D8C1339455 -:107DD000CF5F95E03912B9CD8FE080930E1100C2CC -:107DE00080913910882309F48BCE1092391081E0EC -:107DF0008093161110923410109235101092361094 -:107E00001092371000E010E02FEF30E040E050E03B -:107E10006FE376E08EE89DE00E94A7E580910F1168 -:107E2000882309F46DCEDCC11F928FEF8F931F92D0 -:107E30001F928FE396E09F938F9386E79DE09F9339 -:107E40008F9382E89DE09F938F933F9281E0909182 -:107E50001011933009F080E08F930E9484E48DB775 -:107E60009EB70C960FB6F8949EBF0FBE8DBF4CCE3A -:107E700080911011843031F080911302882309F42D -:107E800043CE22C0809139108823B1F3109239106B -:107E900081E08093161110923410109235101092D8 -:107EA00036101092371000E010E02FEF30E040E085 -:107EB00050E061E476E08AE69DE00E94A7E58091CB -:107EC0000F118823C9F28CC11F928FEF8F931F92DD -:107ED0001F9281E496E09F938F939F928F928EE5FD -:107EE0009DE09F938F933F9281E090911011943089 -:107EF00009F080E08F930E9484E48DB79EB70C96C2 -:107F00000FB6F8949EBF0FBE8DBFFECD80911011AD -:107F1000853031F080911302882309F4F5CD22C019 -:107F2000809139108823B1F31092391081E0809349 -:107F300016111092341010923510109236101092C3 -:107F4000371000E010E02FEF30E040E050E063E455 -:107F500076E086E49DE00E94A7E580910F118823DA -:107F6000C9F23EC11F928FEF8F931F921F9283E43D -:107F700096E09F938F938EE29DE09F938F93BF92A5 -:107F8000AF923F9281E090911011953009F080E01E -:107F90008F930E9484E48DB79EB70C960FB6F89429 -:107FA0009EBF0FBE8DBFB0CD90911011963029F0BD -:107FB00080911302811115C0A7CD809139108823BB -:107FC000B9F3109239102091C60581E08227809381 -:107FD000C60583E08093130280910F11882341F33B -:107FE000FFC08091C605811103C02DE13DE002C0B4 -:107FF00021E23DE081E0963009F080E001E045E2D9 -:108000005DE0632D1FC0C830D1F1C93009F07CCDCF -:1080100080911011893009F47BC08091130288236C -:1080200009F49DCE11E080911011893009F010E023 -:1080300087E092E00E94EEC200E09C0143EE5CE02B -:10804000632D812F0E94E7E35FCD80913910882353 -:1080500009F45ECE10923910E12CF12C02E813E401 -:1080600020E030E0A9016FE072E086E19DE00E942F -:1080700008E680910F11882309F44ACEB1C080919F -:108080001011883031F080911302882309F43CCD1F -:1080900018C0809139108823B1F310923910E12C67 -:1080A000F12C02E813E420E030E0A9016BE072E07B -:1080B00081E09DE00E9408E680910F11882319F36A -:1080C0008FC083E48F9382E88F931F921F921F9239 -:1080D0001F928BE092E09F938F9383EF9CE09F939E -:1080E0008F938AEF9CE09F938F933F9281E09091D2 -:1080F0001011983009F080E08F930E944CE48DB706 -:108100009EB70E960FB6F8949EBF0FBE8DBF27CEBA -:1081100080913910882309F480CF10923910E12C16 -:10812000F12C00E81FE320E030E0A90167E072E0F5 -:108130008BEE9CE00E94BBE488E59AE990934402B0 -:10814000809343021092FF101092FE101092FD10C7 -:1081500080910F11882309F460CF42C080913910BB -:10816000882309F430CE1092391088E39EEC0E94E7 -:10817000869F80910F11882309F425CE31C081E0BC -:10818000909110119D3009F080E023E04EEA5CE010 -:1081900015C0CE3009F01BCE809110118E3091F0B9 -:1081A00080911302882309F412CE81E0909110117E -:1081B0009E3009F080E023E04DE95CE0632D0E94F1 -:1081C00094C405CE80913910882351F31092391050 -:1081D00085E39EEC0E94869F80910F11882301F316 -:1081E000CF911F910F91FF90EF90DF90CF90BF90B4 -:1081F000AF909F908F907F906F905F904F903F9047 -:1082000008952F923F924F925F926F927F928F923A -:108210009F92AF92BF92CF92DF92EF92FF920F9315 -:108220001F93CF93DF93CDB7DEB7C956D1090FB6F1 -:10823000F894DEBF0FBECDBFE0916B0BF0916C0BDD -:10824000EF2B11F00C942449DEAECDAEE9AE7901EE -:108250006A015B01FC0120915B0B30915C0B40914A -:108260005D0B50915E0B60817181828193810E94D0 -:10827000D2EB0E94C8F1A1966CAF7DAF8EAF9FAFDD -:10828000A19720915F0B3091600B4091610B509151 -:10829000620BD5016D917D918D919C910E94D2EBE5 -:1082A0000E94C8F1A5966CAF7DAF8EAF9FAFA5972A -:1082B0002091630B3091640B4091650B5091660BDC -:1082C000F60160817181828193810E94D2EB0E94CC -:1082D000C8F1A9966CAF7DAF8EAF9FAFA9972091E3 -:1082E000670B3091680B4091690B50916A0BD70175 -:1082F0006D917D918D919C910E94D2EB0E94C8F16D -:108300002B966CAF7DAF8EAF9FAF2B9780915A0BA2 -:1083100083FF0EC02B964CAC5DAC6EAC7FAC2B9744 -:108320004092110C5092120C6092130C7092140C2B -:10833000D8013C9011964C9011974DA612965C90E6 -:10834000129759AA13962C908091EF0B9091F00BF5 -:10835000891B8F708F3019F40E948990F5CF60903F -:10836000EF0BAA966FAEAA978091EF0B082F10E043 -:108370001CA30BA38091050C9091060CA091070CF7 -:10838000B091080CA1968CAC9DACAEACBFACA197E3 -:10839000881A990AAA0ABB0A8091090C90910A0CC2 -:1083A000A0910B0CB0910C0CA5964CAC5DAC6EACD6 -:1083B0007FACA597481A590A6A0A7B0A4DA25EA2A9 -:1083C0006FA278A680910D0C90910E0CA0910F0CCD -:1083D000B091100CA9964CAC5DAC6EAC7FACA9977B -:1083E000481A590A6A0A7B0A49A65AA66BA67CA6AD -:1083F0008091110C9091120CA091130CB091140C5F -:108400002B964CAC5DAC6EAC7FAC2B97481A590ADE -:108410006A0A7B0A09F49DC08091450681113BC020 -:1084200060914606709147068091480690914906F2 -:108430000E94DBF020911802309119026217730735 -:1084400054F52B964CAC5DAC6EAC7FAC2B97409248 -:10845000110C5092120C6092130C7092140CEAEBF7 -:10846000FFE084918F010F5F1F4F811103C0E2E78E -:10847000FEE004C00E940232F801F3CF84918F0124 -:108480000F5F1F4F882321F00E940232F801F6CFC0 -:10849000412C512C320139AD24E0329F800111244E -:1084A0000C5E1D4FC301B2010E9473EBD8012D91E8 -:1084B0003D914D915C910E94D2EB6B017C0120E0DB -:1084C00030E0A9010E94BDF187FF04C0F7FAF094E3 -:1084D000F7F8F0946091670B7091680B8091690BCD -:1084E00090916A0B0E94DBF09B01AC01A8ECB0E01C -:1084F0000E947DEF0E9473EBA70196010E946DEB35 -:1085000087FF2AC02B964CAC5DAC6EAC7FAC2B9732 -:108510004092110C5092120C6092130C7092140C39 -:10852000EAEBFFE084918F010F5F1F4F811103C0C1 -:10853000E3E5FEE004C00E940232F801F3CF84912B -:108540008F010F5F1F4F882321F00E940232F80134 -:10855000F6CF412C512C3201D501C4018827B7FD3B -:1085600083959927AA27BB27182F2DA13EA14FA19C -:1085700058A557FD126089A59AA5ABA5BCA5B7FD66 -:10858000146077FC186009ADA4E00A9FC0011124B3 -:108590009C012C5E3D4F7901C301B2010E9473EB37 -:1085A000D7012D913D914D915C910E94D2EB6B01D1 -:1085B0007C0120E030E0A9010E94BDF187FF04C0EA -:1085C000C701B601905802C0C701B60120E030E0F3 -:1085D00040E05FE30E9497EF0E94E0F06DAB7EAB5E -:1085E0008FAB98AF81E54BA05CA0849DF001859D89 -:1085F000F00D1124E65BF94F108216ABB501A40112 -:10860000B7FE07C044275527BA01481959096A0916 -:108610007B0981E56BA07CA0869DF001879DF00D14 -:108620001124E65BF94F458B568B678B708F8DA1BC -:108630009EA1AFA1B8A5B7FF07C0B095A095909532 -:1086400081959F4FAF4FBF4F21E50BA11CA1209FEC -:10865000F001219FF00D1124E65BF94F818F928F7D -:10866000A38FB48F09A51AA52BA53CA537FF07C07A -:1086700030952095109501951F4F2F4F3F4FE1E505 -:108680007E2E4BA05CA0749CF001759CF00D112413 -:10869000E65BF94F058F168F278F30A34DA85EA894 -:1086A0006FA878AC41A252A263A274A23A01F62F3D -:1086B000E72F481759076A077B0718F43C01FA2F80 -:1086C000EB2FC301AF2FBE2F80179107A207B3076F -:1086D00010F4D901C8014DA85EA86FA878AC841524 -:1086E0009505A605B70510F4D301C20121E56BA0DD -:1086F0007CA0269DF001279DF00D1124E65BF94F2B -:1087000085A396A3A7A3B0A70697A105B10508F472 -:1087100094C5DF01A95BBF4F80913F069091400651 -:1087200011969C938E9312968091410690914206E9 -:1087300011969C938E9312968091430690914406D5 -:108740008D939C9379AC71A6452B462B472B09F052 -:10875000179881E50BA11CA1809FF001819FF00D6E -:108760001124E65BF94F818D928DA38DB48D892BF9 -:108770008A2B8B2B09F0169881E54BA05CA0849D79 -:10878000F001859DF00D1124E65BF94F858D968DE6 -:10879000A78DB0A1892B8A2B8B2B09F015984DA89A -:1087A0005EA86FA878AC45284628472809F44EC52E -:1087B0008091710B882319F081508093710B59AC13 -:1087C000511004C0149880E28093710B60903B06B6 -:1087D00070903C0600913D0610913E069301A80161 -:1087E000632D7DA589A9922D0E946DEB87FF04C0A2 -:1087F000362C7DA609AB212EC501B4010E9473EB76 -:1088000020912706309128064091290650912A068A -:108810000E94D2EB69AF7AAF8BAF9CAF698B7A8B3A -:108820008B8B9C8B6DA17EA18FA198A50E9473EB71 -:1088300020912B0630912C0640912D0650912E064A -:108840000E94D2EB2B013C016D8B7E8B8F8B988F1E -:1088500069A57AA58BA59CA50E9473EB20912F0694 -:108860003091300640913106509132060E94D2EB91 -:108870004B015C01698F7A8F8B8F9C8F209133061F -:10888000309134064091350650913606C701B60145 -:108890000E94D2EB6B017C016D8F7E8F8F8F98A32E -:1088A00081E50BA11CA1809FF001819FF00D112497 -:1088B000E65BF94F85899689A789B08D0697A10552 -:1088C000B10508F4CCC4ADADBEADCD90DD90ED905A -:1088D000FC9020E030E0A901C701B6010E946DEBD9 -:1088E0008111E5C429AD3AAD4BAD5CADCA01B9010A -:1088F0000E94D2EB6B017C01A3019201C301B20182 -:108900000E94D2EB9B01AC01C701B6010E9497EF18 -:108910006B017C01A5019401C501B4010E94D2EB59 -:108920009B01AC01C701B6010E9497EF0E9402F2C1 -:1089300021E54BA05CA0249DF001259DF00D1124A4 -:10894000E65BF94F658776878787908B81E50BA17A -:108950001CA1809FF001819FF00D1124E65BF94F6F -:10896000258536854785508960E070E080E89FE383 -:108970000E9473F023966CAF7DAF8EAF9FAF2397AD -:10898000232D3DA549A9522D0E94D2EB4B015C013C -:108990008091EF0B9091ED0B891B8F708DAFA5012E -:1089A000940160E074E284E799E40E9473F00E940D -:1089B000C8F16B017C018DAD8250863008F486C40D -:1089C00080916F00982F927081FF05C080916F0099 -:1089D0008D7F80936F0040911F065091200660911B -:1089E000210670912206C40ED51EE61EF71EC09207 -:1089F0001F06D0922006E0922106F09222069923CB -:108A000029F080916F00826080936F0081E56BA0F8 -:108A10007CA0869D8001879D100D1124065B194F57 -:108A2000D8011D964D905D906D907C9050976B96FF -:108A30004CAE5DAE6EAE7FAE6B97A5019401C301E7 -:108A4000B2010E94D2EB9B01AC010E94D2EB2F96A7 -:108A50006CAF7DAF8EAF9FAF2F97F80161837283AC -:108A60008383948345A056A067A070A44DA65EA6FC -:108A70006FA678AAC301B2010E9471EB69AB7AAB11 -:108A80008BAB9CAB9B01AC01C501B4010E94D2EB46 -:108A90000E945DF00E94E0F063966CAF7DAF8EAFF8 -:108AA0009FAF6397F80167AB70AF81AF92AF8E0154 -:108AB0000F5E1F4F25961FAF0EAF2597005111096E -:108AC0001AAF09AF0FE016E06D961FAF0EAF6D97AE -:108AD0008E010F5D1F4F1AA309A349AC5AAC6596CE -:108AE0005FAE4EAE6597212C312C00E80DA31FE33D -:108AF00019A72596AEADBFAD25972D913D914D910E -:108B00005D912596BFAFAEAF2597C501B4010E9418 -:108B1000D2EB6B017C016596EEADFFAD659761937D -:108B20007193819391936596FFAFEEAF659720E0C7 -:108B300030E0A9010E94BDF187FF04C0F7FAF0946C -:108B4000F7F8F0946D96AEADBFAD6D974D905D901A -:108B50006D907D906D96BFAFAEAF6D97A7019601FA -:108B6000C301B2010E946DEB87FDEAC349A05AA080 -:108B700025966EAC7FAC25974614570409F0B9CF03 -:108B800020E030E040E85FE3B1018DA199A50E94AB -:108B90006DEB87FF4EC07E0101E1E00EF11C09ADD7 -:108BA0001AAD91014DA159A5D8016D917D918D917D -:108BB0009C910E94D2EBF801619371938193919300 -:108BC0008F01EE16FF0669F781E54BA05CA0849D3E -:108BD0008001859D100D1124065B194F63966CADC5 -:108BE0007DAD8EAD9FAD63970E9471EB91014DA15C -:108BF00059A50E94D2EB0E94E0F0D801D7966D9360 -:108C00007D938D939C93DA9791014DA159A5B10164 -:108C10008DA199A50E94D2EB2F962CAD3DAD4EAD06 -:108C20005FAD2F970E94D2EBF8016183728383833B -:108C3000948329A93AA94BA95CA923966CAD7DAD73 -:108C40008EAD9FAD23970E94D2EB6DA37EA38FA321 -:108C500098A781E54BA05CA0849DF001859DF00D57 -:108C60001124E65BF94F85889688A788B08C81141B -:108C70009104A104B10409F479C34DA85EA86FA8BA -:108C800078AC45284628472809F493C32091070665 -:108C9000309108064091090650910A066DA17EA107 -:108CA0008FA198A50E94D2EB0E945DF00E94E0F097 -:108CB0006B017C018091FF0590910006A091010657 -:108CC000B09102064DA45EA46FA478A88415950502 -:108CD000A605B70508F418C481149104A104B104D1 -:108CE00009F070C381E56BA07CA0869DF001879D93 -:108CF000F00D1124E65BF94F818C928CA38CB48C1F -:108D000081149104A104B10409F083C381E50BA18E -:108D10001CA1809FF001819FF00D1124E65BF94FAB -:108D2000858C968CA78CB0A081149104A104B10409 -:108D300009F098C381E54BA05CA0849DF001859D5E -:108D4000F00D1124E65BF94F81A092A0A3A0B4A07E -:108D500081149104A104B10409F0ADC381E56BA0B5 -:108D60007CA0869D8001879D100D1124065B194F04 -:108D7000F801ED5BFF4FC082D182E282F382C7012E -:108D8000B6010E9471EB6B017C012DA13EA14FA1A8 -:108D900058A50E9473F02F966CAF7DAF8EAF9FAF3A -:108DA0002F97D80151966D937D938D939C935497F3 -:108DB0002DEB37E346E051E4C701B6010E94D2EB48 -:108DC0000E94E0F0F80162AB73AB84AB95AB4180DD -:108DD00052806380748027964CAE5DAE6EAE7FAEDF -:108DE0002797C301B2010E9402F2362E272E8C0172 -:108DF000EFEDF5E06196FFAFEEAF61973E01F1E177 -:108E00006F0E711C2FED35E021963FAF2EAF2197ED -:108E100049AC5AAC6DA379A78DA719AB1DAAD20195 -:108E2000CD90DD90ED90FD902D0120E030E0A90186 -:108E3000C701B6010E94BDF187FF04C0F7FAF094A4 -:108E4000F7F8F0942196EEADFFAD219781909190C7 -:108E5000A190B1902196FFAFEEAF2197A7019601A7 -:108E6000C501B4010E946DEB87FD6BC464147504E9 -:108E7000B1F64DAC442009F4DDC4C090F10BD090A4 -:108E8000F20BE090F30BF090F40B2DEB37E346E898 -:108E900055E3C701B6010E946DEB87FDCBC4C70146 -:108EA000B6010E9402F26B017C019B01AC01632DB3 -:108EB000722DC8010E946DEB87FD03C03C2C2D2C48 -:108EC00087019601A701632D722DC8010E9473F0DE -:108ED00067966CAF7DAF8EAF9FAF679725EF3BE096 -:108EE00021963FAF2EAF2197412C512C30E8632EB5 -:108EF0003FE3732E4DAA5EAA6FAA78AE1DAE2196EF -:108F0000AEADBFAD21972D913D914D915D912196D3 -:108F1000BFAFAEAF219767966CAD7DAD8EAD9FAD07 -:108F200067970E94D2EB4B015C01E9ADFAADC190AD -:108F3000D190E190F190FAAFE9AF4DAC442091F0BF -:108F40002DA93EA94FA958AD0E94D2EB4B015C015F -:108F50002DA93EA94FA958ADC701B6010E94D2EB79 -:108F60006B017C01A7019601C501B4010E94BDF10E -:108F700020E030E0A90118160CF029C4C701B601A1 -:108F80000E94BDF118160CF41DC420E030E0A901C8 -:108F9000C501B4010E946DEB87FD14C426013701A1 -:108FA00077FA709477F87094A3019201C501B40127 -:108FB0000E94BDF1181614F4240135016196AEAD7E -:108FC000BFAD6197CD90DD90ED90FD906196BFAF04 -:108FD000AEAF6197A3019201C701B6010E946DEB8C -:108FE00087FF15C0A3019201C701B6010E9473F06B -:108FF0009B01AC016DA97EA98FA998AD0E94D2EB0F -:109000006DAB7EAB8FAB98AFBDADBF5FBDAFE5E0E5 -:10901000FCE021964EAC5FAC2197E415F50509F014 -:109020006ECF5DAC552061F02DA93EA94FA958AD7A -:10903000632D722DC8010E94D2EB362E272E8C0193 -:1090400024EA30E74DE75FE3632D722DC8010E94EB -:10905000D2EB6B017C0120916D0B30916E0B409136 -:109060006F0B5091700B0E946DEB87FDD9C38DA1E2 -:1090700099A5ADA5B9A980936D0B90936E0BA093A4 -:109080006F0BB093700B21E56BA07CA0269DC001F7 -:10909000279D900D11249C01265B394F7901232DCA -:1090A000322DA801632D722DC8010E94D2EBD70189 -:1090B00019966D937D938D939C931C978BE097ED00 -:1090C000A3E2BBE3F70185839683A783B087108172 -:1090D0002F966CAD7DAD8EAD9FAD2F9790589B01B7 -:1090E000AC010E9497EF6B962CAD3DAD4EAD5FADE0 -:1090F0006B970E94D2EB9B01AC016BE077ED83E2B2 -:109100009BE30E9496EF9B01AC0127966CAD7DAD71 -:109110008EAD9FAD27970E946DEB18160CF48FC390 -:1091200083E0182B81E54BA05CA0849DF001859D18 -:10913000F00D1124E65BF94F108380E1FE013196BA -:10914000A5EFBBE001900D928A95E1F727964CAC14 -:109150005DAC6EAC7FAC27974092F10B5092F20B56 -:109160006092F30B7092F40BA1964CAC5DAC6EACBC -:109170007FACA1974092050C5092060C6092070CB0 -:109180007092080CA5964CAC5DAC6EAC7FACA5970C -:109190004092090C50920A0C60920B0C70920C0CCD -:1091A000A9964CAC5DAC6EAC7FACA99740920D0C0F -:1091B00050920E0C60920F0C7092100C2B964CACCF -:1091C0005DAC6EAC7FAC2B974092110C5092120CA0 -:1091D0006092130C7092140C9091EF0B8091F00B35 -:1091E000981303C084E68093EC0BAA968FADAA97E0 -:1091F0008F5F8F708093EF0B8091EF0B9091EE0B50 -:1092000081508F7089131DC3D090F00B8090EF0BAD -:1092100021E5D810A1C3212C312C412C512C1BA2AB -:109220001DA2712C612C00E010E0E12CF12C8D10BE -:10923000A0C30115110509F011C480916F0082606F -:1092400080936F0081E03FC580E03DC560903706A8 -:10925000709038060091390610913A06BFCA818D88 -:10926000928DA38DB48D0697A105B10508F02BCB87 -:10927000858D968DA78DB0A10697A105B10508F043 -:1092800022CB20E030E0A901C701B6010E94BDF168 -:1092900087FF04C0F7FAF094F7F8F09481E54BA04B -:1092A0005CA0849DF001859DF00D112408C081E52E -:1092B0006BA07CA0869DF001879DF00D1124E65BDC -:1092C000F94FC586D686E786F08A40CB8091230683 -:1092D00090912406A0912506B0912606C816D906BD -:1092E000EA06FB0608F06CCB8C199D09AE09BF0994 -:1092F000BC01CD01660F771F881F991F4DAC042D4F -:1093000010E020E030E0A90198010E945BEFCA0163 -:10931000B9010E9471EB0E94C8F1C60ED71EE81E6B -:10932000F91EC701B6010E9471EB9B01AC0160E020 -:1093300074E284E799E40E9473F04B015C0140CB36 -:10934000A7019601C301B2010E9473F07B018C0159 -:109350009B01AC01B1018DA199A50E94BDF1181628 -:109360000CF004CC17010DA319A700CC818D928DB0 -:10937000A38DB48D892B8A2B8B2B09F07ECC858D08 -:10938000968DA78DB0A1892B8A2B8B2B09F075CCDC -:1093900020910B0630910C0640910D0650910E065F -:1093A0006DA17EA18FA198A50E94D2EB0E945DF0D5 -:1093B000C3C12091030630910406409105065091E7 -:1093C00006066CCC6091EF057091F0058091F10577 -:1093D0009091F2056C157D058E059F0508F082CCF5 -:1093E000A30192010E944CEF2B013C01A5019401C5 -:1093F000C701B6010E944CEF46165706680679066B -:1094000008F070CCC301B2010E945BEF69017A01E0 -:1094100069CC6091F3057091F4058091F505909108 -:10942000F6056C157D058E059F0508F06FCC2DA502 -:109430003EA54FA558A90E944CEF2B013C01A50168 -:109440009401C701B6010E944CEF46165706680604 -:10945000790608F05BCCC301B2010E945BEF6901A1 -:109460007A0154CC6091F7057091F8058091F90567 -:109470009091FA056C157D058E059F0508F05ACC74 -:109480002DA53EA54FA558A90E944CEF2B013C01EC -:10949000A5019401C701B6010E944CEF461657067C -:1094A0006806790608F046CCC301B2010E945BEF62 -:1094B00069017A013FCC6091FB057091FC058091B8 -:1094C000FD059091FE056C157D058E059F0508F044 -:1094D00045CC2DA53EA54FA558A90E944CEF2B01C8 -:1094E0003C01A5019401C701B6010E944CEF46164C -:1094F00057066806790608F031CCC301B2010E9414 -:109500005BEF69017A012ACC81149104A104B104B2 -:10951000B9F16091EF057091F0058091F10590919E -:10952000F2056C157D058E059F0550F50E9471EBC7 -:1095300029A93AA94BA95CA90E94D2EB2B013C01B5 -:10954000C501B4010E9471EB4B015C01C701B6017A -:109550000E9471EBA50194010E94D2EB9B01AC012A -:10956000C301B2010E946DEB87FF0AC0A5019401FF -:10957000C301B2010E9473F00E94E0F06B017C0114 -:1095800081E56BA07CA0869DF001879DF00D1124E4 -:10959000E65BF94F418C528C638C748C41145104FE -:1095A00061047104B9F16091F3057091F405809143 -:1095B000F5059091F6056C157D058E059F0550F516 -:1095C0000E9471EB29A93AA94BA95CA90E94D2EB90 -:1095D0004B015C01C301B2010E9471EB2B013C0104 -:1095E000C701B6010E9471EBA30192010E94D2EB68 -:1095F0009B01AC01C501B4010E946DEB87FF0AC05D -:10960000A3019201C501B4010E9473F00E94E0F031 -:109610006B017C0181E50BA11CA1809FF001819F62 -:10962000F00D1124E65BF94F458C568C678C70A0C9 -:109630004114510461047104B9F16091F70570910E -:10964000F8058091F9059091FA056C157D058E0558 -:109650009F0550F50E9471EB29A93AA94BA95CA975 -:109660000E94D2EB4B015C01C301B2010E9471EB7D -:109670002B013C01C701B6010E9471EBA3019201CD -:109680000E94D2EB9B01AC01C501B4010E946DEBBD -:1096900087FF0AC0A3019201C501B4010E9473F0C3 -:1096A0000E94E0F06B017C0181E54BA05CA0849DF1 -:1096B000F001859DF00D1124E65BF94F81A092A089 -:1096C000A3A0B4A081149104A104B10409F446CB71 -:1096D0006091FB057091FC058091FD059091FE0560 -:1096E0006C157D058E059F0508F038CB0E9471EB47 -:1096F00029A93AA94BA95CA90E94D2EB2B013C01F4 -:10970000C501B4010E9471EB4B015C01C701B601B8 -:109710000E9471EBA50194010E94D2EB9B01AC0168 -:10972000C301B2010E946DEB87FF18CBA501940124 -:10973000C301B2010E9473F00E94E0F06B017C0152 -:109740000DCBFDA9FF2331F1A5019401632D722DED -:10975000C8010E94D2EB4B015C012DA139A54DA59A -:1097600059A9C701B6010E94D2EB9B01AC01C5010A -:10977000B4010E946DEB87FF22C0A7019601C501CD -:10978000B4010E9473F06DA379A78DA799AB21E076 -:109790002DAB6CCBA7019601C501B4010E9473F0FB -:1097A0009B01AC016DA179A58DA599A90E94D2EB71 -:1097B0006DA379A78DA799AB31E03DAB57CB41E0C5 -:1097C0004DAB54CBA7019601C501B40113C0C7012D -:1097D000B6010E946DEB87FD09C020E030E0A901D1 -:1097E000C501B4010E94BDF118164CF4A501940105 -:1097F000C701B6010E9496EF2B013C01DFCB24018B -:10980000350177FA709477F87094A3019201C7013B -:10981000B6010E946DEB87FDD1CB26013701CECB7F -:109820002DA139A54DA559A9C701B6010E946DEB1F -:1098300087FF1DCC3DA029A40DA519A918CC81E056 -:1098400070CCF090EF0B8FEF8F0D8F708BA3B090DB -:10985000EE0B8091EF0BB81609F453C0C12CD12C3C -:109860005BA05B1409F44DC0652C712C21E5269D8D -:109870008001279D100D1124065B194FD8018C9192 -:1098800083FD2AC00DAB19AF19964C9019974DA2C4 -:109890001A965C901A9759A61B964C901B974DA64A -:1098A0001C965C901C9759AA15962D903D904D9052 -:1098B0005C901897A20191016DA179A58DA599A938 -:1098C0000E946DEB811108C1C114D10439F0D60199 -:1098D0008C9180FD01C102C0CDAAD9AE8BA181506F -:1098E0008F708BA38091EE0B8B1103C0CDA8D9ACE8 -:1098F000B7CF4BA04B1429F081E08B0D8F70B82EA1 -:10990000F1CF5090EE0B5BA2C12CD12C8091EF0BCC -:109910006BA0861509F478CC862C912C91E5792ED4 -:10992000789C8001799C100D1124065B194FD80199 -:109930008C9183FD0AC05801C114D10439F0C601CD -:109940000E94C6B9811102C045C156018BA18F5F2B -:109950008F708BA36501DACF8FEF880D8F70289FF2 -:10996000F0011124E65BF94F908193FF54CC882ECF -:1099700050CC21E52D9D80011124065B194FD801A3 -:109980008C9183FD19C015966D917D918D919C915F -:1099900018970E9402F2C62EB72EA82E992EE11417 -:1099A000F10409F44DC0F701808180FD0AC0D8019F -:1099B0008C9180FD06C044C0CBA0BDA0A72C962CE6 -:1099C00044C0F701808181608083C7010E94C6B9CD -:1099D000811132C0F70161817281838194810E947B -:1099E00002F29B01AC0160E070E080E89FE30E941E -:1099F00073F01B012C019B01AC016C2D7B2D8A2D7A -:109A0000992D0E94D2EB69837A838B839C832BA14F -:109A10003DA1472D562DC201B1010E94D2EB698BA9 -:109A20007A8B8B8B9C8BAE014F5F5F4FBE016F5E5D -:109A30007F4FC7010E945274D7018C918E7F8C9307 -:109A40002C2C3B2C4A2C592C780181E08D0D8F70E9 -:109A5000D82ECBA2BDA27A2C692CE9CBF80180814B -:109A600081608083C7010E94C6B9811130C0D801CE -:109A700011966D917D918D919C9114970E9402F2A7 -:109A80009B01AC0160E070E080E89FE30E9473F00E -:109A90006B017C012DEC3CEC4CE45DE30E94D2EBCD -:109AA00069837A838B839C839101A201C701B601EC -:109AB0000E94D2EB698B7A8B8B8B9C8BAE014F5FB4 -:109AC0005F4FBE016F5E7F4FC8010E945274F80164 -:109AD00080818E7F8083B1CB21E5269DF001279D7B -:109AE000F00D1124E65BF94F808181FD43C0C11464 -:109AF000D10431F0F601C580D680E780F08408C03B -:109B00002BE0C22E27EDD22E23E2E22E2BE3F22E03 -:109B100021E5269DF001279DF00D1124E65BF94F0C -:109B200081899289A389B489BC01CD0190589B0198 -:109B3000AC010E9497EFD8011D962D913D914D915A -:109B40005C9150970E94D2EB9B01AC01C701B6011A -:109B50000E9496EFE62E872E982EA92E262F372FBD -:109B6000482F592F6DA179A58DA599A90E946DEB5C -:109B700087FF04C0EDA089A49DA4A9A82E2D382D8F -:109B8000492D5A2DC201B1010E946DEB882309F4C1 -:109B9000A5CEB1E5B69DC001B79D900D1124FC0185 -:109BA000E65BF94F6F01808181608083C8010E946C -:109BB000C6B9882329F0D6018C918E7F8C938ECEE6 -:109BC0008E2D982DA92DBA2DF60185839683A78316 -:109BD000B08784CED6018C9181FD52C0D6011596F6 -:109BE0004D905D906D907C9018974DA25EA26FA2F3 -:109BF00078A61501B5E02B0E311CF8014580568082 -:109C000067807084A30192016DA17EA18FA198A5A8 -:109C10000E946DEB87FF34C0F60181899289A38988 -:109C2000B489BC01CD0190589B01AC010E9497EF13 -:109C3000D6011D962D913D914D915C9150970E94BA -:109C4000D2EB9B01AC016DA17EA18FA198A50E94D2 -:109C500096EF6B017C019B01AC01C301B2010E9434 -:109C6000BDF118166CF4D8018C9181608C93C501FC -:109C70000E94C6B98823E9F0F80180818E7F808335 -:109C800081E5582E589CF001599CF00D1124E65B9B -:109C9000F94F218532854385548565817681878199 -:109CA00090850E946DEB811151CE6BA06092EE0BFE -:109CB0004DCED101CD92DD92ED92FC9213974BA047 -:109CC0004092EE0BDDCFC759DF4F0FB6F894DEBFE1 -:109CD0000FBECDBFDF91CF911F910F91FF90EF90FD -:109CE000DF90CF90BF90AF909F908F907F906F90BC -:109CF0005F904F903F902F900895CF93DF93CDB713 -:109D0000DEB78091DE0581110EC09E01275F3F4FB7 -:109D10004F81588566E170E085E99BE00E9435EB54 -:109D200083E080931302DF91CF910895CF93DF9367 -:109D30008091360C882339F08091350C882319F0F6 -:109D4000E0E3FEE003C0E2E4FEE02EC08491EF0118 -:109D50002196882321F00E940232FE01F7CF609104 -:109D6000650C7091660C8091670C9091680C4AE0CC -:109D70000E943E358FE20E9402326091610C709128 -:109D8000620C8091630C9091640C4AE00E943E3515 -:109D90008AE00E9402326091650C7091660C80919D -:109DA000670C9091680C0CC08491EF012196882378 -:109DB00021F00E940232FE01F7CF60E070E0CB019B -:109DC000DF91CF910895FC01DB018C9120813181DD -:109DD000382798E0A901440F551F37FD06C09A01A6 -:109DE0009150C1F73183208308959A01B1E22B2766 -:109DF000B0E13B27F5CFEF92FF920F931F93CF93E4 -:109E0000DF93F82E062FE42E152FE091C70BF0916B -:109E1000C80B82EB9BE01995080FCE2DD12F10E0D7 -:109E20002991222349F0402F6F2D82EB9BE00E9465 -:109E300064BFF80E180FF4CF812FDF91CF911F91DF -:109E40000F91FF90EF9008958F929F92AF92BF92E3 -:109E5000CF92DF92EF92FF920F931F93CF93DF93F6 -:109E6000A82EC62FB42E6801062F020F842E912C27 -:109E7000C01721F176011B2DDA2D1123D9F0F7013E -:109E800084916091B40B7091B50BD093CE0BC093BD -:109E9000CF0B1092D10B8093D00B2EEC3BE04BE319 -:109EA00082EB9BE00E943EBFFFEFEF1AFF0A1150CA -:109EB000D85FE3CFC80CD91CCF5FDACFDF91CF9149 -:109EC0001F910F91FF90EF90DF90CF90BF90AF90D8 -:109ED0009F908F900895CF93DF93EAEBFFE08491FA -:109EE000EF012196882321F00E940232FE01F7CF74 -:109EF0006091DC057091DD058DE19EE00E94125EAF -:109F000082E20E9402328AE0DF91CF910C94023209 -:109F10008F929F92AF92BF92CF92DF92EF92FF9279 -:109F20000F931F93CF93DF9300D01F92CDB7DEB76F -:109F3000FC018381813079F5818181FF2CC0818989 -:109F40009289A389B489892B8A2B8B2B09F448C069 -:109F50007F0140E050E0BA01CF010E9430878823A2 -:109F6000D1F0F70185889688A788B08CC18CD28CF7 -:109F700082E090E0A0E0B0E0F60180839183A283CC -:109F8000B3839E012F5F3F4FB501A401C6010E941C -:109F9000EDD5811102C080E03CC000E010E09801E6 -:109FA000B501A401C6010E945CD58823A1F3898074 -:109FB0009A80AB80BC80F6018789803141F4F8EF4C -:109FC0008F16FFEF9F06A104B10460F4DACF88EF8B -:109FD00088168FEF9806A8068FE0B80618F4D1CF40 -:109FE00081E017C0F701158A168A178A108E118A28 -:109FF000128A138A148A818180688183C7010E9432 -:10A000003BD7882341F240E050E0BA01C7010E94EB -:10A0100030870F900F900F900F90DF91CF911F918D -:10A020000F91FF90EF90DF90CF90BF90AF909F90F7 -:10A030008F9008950F931F93CF93E091C00BF091F1 -:10A04000C10B309719F082EB9BE019950091B40B8E -:10A050001091B50BE091E30BF091E40B82E01995C0 -:10A06000E091E30BF091E40B81E0199520E030E002 -:10A0700045E1B80182EB9BE00E943EBFC82F8823D8 -:10A0800041F025EE3BE047E1B80182EB9BE00E9406 -:10A090003EBFE091E30BF091E40B80E019958C2F2B -:10A0A000CF911F910F910895682F8EEA9BE00C9439 -:10A0B0008FA60F931F93CF93DF93EC018C010A5E61 -:10A0C0001F4FFE018491882329F0EEDF21960C17A3 -:10A0D0001D07B9F7DF91CF911F910F9108950F934D -:10A0E0001F93CF93DF93C5E9DBE00BEA1BE0899177 -:10A0F000882321F0D9DF0C171D07C9F7DF91CF9115 -:10A100001F910F9108952091B60B3091B70B28172E -:10A11000390709F444C09093B70B8093B60B0097AE -:10A1200009F437C02091C90BFC01211107C03596F5 -:10A13000E491E093CA0BFC013C960FC0213039F446 -:10A140003F96E491E093CA0BFC01709606C03D96E1 -:10A15000E491E093CA0BFC013E9684918093CB0B73 -:10A160008091CA0B082E000C990B2091CB0B821BFF -:10A17000910927FD93952091CC0B203441F0829FCB -:10A18000C001112426E0969587952A95E1F78093E2 -:10A19000CD0B84EE9EEB9093C80B8093C70B089574 -:10A1A0000F931F93CF93DF931F92CDB7DEB700912C -:10A1B000B40B1091B50BE091E30BF091E40B82E04E -:10A1C000199520E030E04AE0B80182EB9BE00E9464 -:10A1D0003EBF182FE091E30BF091E40B83E019955B -:10A1E000E091E30BF091E40B80E019951123C1F1AC -:10A1F0006091B40B7091B50B9E012F5F3F4F46E409 -:10A2000082EB9BE00E943EBF89818093B20B6091FC -:10A21000B40B7091B50B9E012F5F3F4F47E482EB6B -:10A220009BE00E943EBF89818093B30B6091B40B89 -:10A230007091B50B20E030E048E482EB9BE00E9497 -:10A240003EBF8093BD0B6091B40B7091B50B25EEB2 -:10A250003BE047E182EB9BE00E943EBF81E001C012 -:10A2600080E00F90DF91CF911F910F910895CF93D0 -:10A27000DF938091EB0B811104C081E08093EB0BA5 -:10A280008FDFC091B40BD091B50BE091E30BF0914F -:10A29000E40B82E01995E091E30BF091E40B81E08F -:10A2A000199520E030E044E1BE0182EB9BE00E9482 -:10A2B0003EBF25EE3BE047E1BE0182EB9BE00E9402 -:10A2C0003EBFE091E30BF091E40B80E0DF91CF9192 -:10A2D00019940F931F93CF93DF938C01EBE8FFE06A -:10A2E0008491EF012196882321F00E940232FE0121 -:10A2F000F7CFF8018491EF012196882321F00E9485 -:10A300000232FE01F7CF6091740B7091750B809152 -:10A31000760B9091770B0E94E5358AE00E9402321D -:10A320000E94D1941092730B1092720BDF91CF9117 -:10A330001F910F9108952F923F924F925F926F92CB -:10A340007F928F929F92AF92BF92CF92DF92EF92C5 -:10A35000FF920F931F93CF93DF93CDB7DEB7C25712 -:10A36000D1090FB6F894DEBF0FBECDBF8C013B0103 -:10A370004A014DB75EB7E1965FAF4EAFE197AD963C -:10A380001FAEAD971B0154E0250E311C7E018FE5F9 -:10A39000E80EF11C97E6492E92E0592EE0E4F0E039 -:10A3A000EC0FFD1F3496E396FFAFEEAFE397F3019A -:10A3B0008781823008F462C184859585A685B7853A -:10A3C0008F719927AA27BB27892B8A2B8B2B09F002 -:10A3D00055C11092450C45E45CE0BE016F5F7F4FB4 -:10A3E000C1010E94D3D618160CF048C18C85982F55 -:10A3F0009871903129F42091B20E2150223078F4D6 -:10A400002981222309F43AC1253E89F22E3279F2BC -:10A410002091450C2E3259F28A7049F6B8C04DB7DA -:10A420005EB7AF965FAF4EAFAF97BE016F5F7F4F26 -:10A43000C7010E94CED40115110521F0F8018081D9 -:10A4400081119BC021E081E090E0F70101900020A4 -:10A45000E9F73197EE19FF098E0F9F1F02964DB74E -:10A460005EB7481B590B0FB6F8945EBF0FBE4DBFC9 -:10A470008DB79EB701965C01211102C0B80102C0E0 -:10A4800066E673E0C5010E9407F3B701C5010E94AB -:10A49000E8F266E673E0C5010E94E8F225961FAE79 -:10A4A000259728961FAE289724961FAE1EAE249798 -:10A4B00022965FAE4EAE229721E0A701B101E3964E -:10A4C0008EAD9FADE3970E94A68D81112AC0809129 -:10A4D000B20E811126C0EAEBFFE084916F019FEF7D -:10A4E000C91AD90A882321F00E940232F601F5CF59 -:10A4F000E6EAFFE084916F012FEFC21AD20A8823A7 -:10A5000021F00E940232F601F5CF6701F601819138 -:10A510006F01882319F00E940232F8CF8AE00E946E -:10A5200002328BE1FE01EC5BFF4FDE01959601905C -:10A530000D928A95E1F724968EAD9FAD24979CA34A -:10A540008BA35AA249A240E050E0BE016F5D7F4F4D -:10A55000C501F1DECE0181960E940D90CE01805C96 -:10A560009F4F0E940D90AF964EAD5FADAF970FB667 -:10A57000F8945EBF0FBE4DBF1ACFF80101900020C6 -:10A58000E9F73197CF01801B910B20E05ECF81E08E -:10A59000903109F080E08093370C903141F089854B -:10A5A000873409F004CF8A858E3709F400CF809173 -:10A5B000B20E813029F08230D9F18111F8CE0AC073 -:10A5C0008091B30E9091B40E01969093B40E809347 -:10A5D000B30EEDCEBE016F5F7F4F88E39CE00E941B -:10A5E000CED40115110529F488E3C82E8CE0D82EAD -:10A5F00009C06801F60181916F018823A9F30E94C7 -:10A600000232F8CFF60181916F01882319F00E9480 -:10A610000232F8CF80E20E9402326D8D7E8D8F8DE6 -:10A6200098A14AE00E943E358AE00E940232BFCEE5 -:10A63000BE016F5F7F4F88E39CE00E94CED48114FF -:10A64000910441F068E37CE0C4010E94D5F2892BBB -:10A6500069F414C0AD96FFADAD978F2F90E02091B7 -:10A66000B70E3091B80E8217930741F0AD962FAD1B -:10A67000AD972F5FAD962FAFAD9799CEE1968EAD8A -:10A680009FADE1970FB6F8949EBF0FBE8DBFCE5819 -:10A69000DF4F0FB6F894DEBF0FBECDBFDF91CF9175 -:10A6A0001F910F91FF90EF90DF90CF90BF90AF90F0 -:10A6B0009F908F907F906F905F904F903F902F90E2 -:10A6C00008950F931F93CF93DF93CDB7DEB76F97A6 -:10A6D0000FB6F894DEBF0FBECDBF8B0122E02093F2 -:10A6E000B20E9093B80E8093B70E8CE89CE00E9457 -:10A6F00077898BE1ECE8FCE0DE01159601900D9284 -:10A700008A95E1F780918A0C90918B0C9C838B83C6 -:10A7100087E692E09A838983A801BE016F5F7F4F2D -:10A7200080E090E008DECE0101960E940D906F96C9 -:10A730000FB6F894DEBF0FBECDBFDF91CF911F9152 -:10A740000F9108952F923F924F925F926F927F9256 -:10A750008F929F92AF92BF92CF92DF92EF92FF9231 -:10A760000F931F93CF93DF93CDB7DEB76F970FB6DD -:10A77000F894DEBF0FBECDBF6C012DB63EB61D8274 -:10A7800018861C821B8287E692E09A838983FB01EC -:10A7900080819E012F5F3F4F39018F3241F088E861 -:10A7A0009CE0F60191838083F62E172F64C089E622 -:10A7B0009CE0F601918380838B010F5F1F4F011591 -:10A7C000110509F456C04DB65EB66FE270E0C801DF -:10A7D0000E94F3F24C010817190708F048C07C01E9 -:10A7E000E01AF10AFF24C70101962DB73EB7281BD6 -:10A7F000390B0FB6F8943EBF0FBE2DBF8DB79EB775 -:10A8000001965C01A701B8010E941CF3F501EE0D51 -:10A81000FF1D1082F601608171816115710511F0D3 -:10A820006C5F7F4F21E0A501CE0105960E94A68DA9 -:10A83000811111C0B50182E99FE00E94125E8EE293 -:10A840000E9402328AE00E9402320FB6F8945EBE85 -:10A850000FBE4DBE0EC0F6017182608284010F5F93 -:10A860001F4F0FB6F8945EBE0FBE4DBEA8CFF02EA0 -:10A8700002C0F12C10E0C3010E940D908F2D912F8A -:10A880000FB6F8943EBE0FBE2DBE6F960FB6F8946D -:10A89000DEBF0FBECDBFDF91CF911F910F91FF9013 -:10A8A000EF90DF90CF90BF90AF909F908F907F9070 -:10A8B0006F905F904F903F902F900895DF92EF92AE -:10A8C000FF920F931F93CF93DF9300D01F921F929D -:10A8D000CDB7DEB72091360C222309F4AEC1D62EB7 -:10A8E0007C018091080E882309F4A5C0442309F453 -:10A8F00077C18091200E882329F1EBE8FFE0849155 -:10A900008F010F5F1F4F882321F00E940232F80150 -:10A91000F6CFE8E4FFE084918F010F5F1F4F88239B -:10A9200021F00E940232F801F6CF61E070E080E091 -:10A9300090E00E94E5358AE00E9402328FE39FE0BA -:10A940000E94299086E29EE09A8389838FE2809319 -:10A95000250E81E08B8310E00FE18091DD0D18174B -:10A9600078F4019FC0011124AE014D5F5F4FBE011D -:10A970006F5F7F4F8955934F0E949FD41F5FEDCF2C -:10A980008B8187FD0FC0AE014D5F5F4FBE016F5FD2 -:10A990007F4F81E09EE00E949FD489819A81019738 -:10A9A0009A838983E981FA811082E091200E84E004 -:10A9B000E89FF0011124EF5DF14F8091650C9091BB -:10A9C000660CA091670CB091680C80839183A28380 -:10A9D000B383EAEBFFE084918F010F5F1F4F882361 -:10A9E00021F00E940232F801F6CFB70186E29FE023 -:10A9F0000E94125E6091200E9DE8699FB0011124B3 -:10AA00006B5D714F8BE19FE00E94125E4091650C7F -:10AA10005091660C6091670C7091680C85E19FE025 -:10AA20000E94BF5D8AE00E9402328091200E8F5FFB -:10AA30008093200E26C04423C1F0EAEBFFE084910E -:10AA40008F010F5F1F4F882321F00E940232F8010F -:10AA5000F6CFE5E0FFE084918F010F5F1F4F882361 -:10AA600081F00E940232F801F6CF1092200EE2E04F -:10AA7000B8C0B7018CEE9EE00E94125E8AE00E9490 -:10AA800002321092350C8091080E882321F085E067 -:10AA90009EE00E941A88B701CE01039653DE8C0116 -:10AAA000892B09F4CAC09B818C81692F782FDD2006 -:10AAB00009F46DC06115710511F06C5F7F4F21E0E5 -:10AAC000A80185E09EE00E94A68D882309F45BC062 -:10AAD0008091160E9091170EA091180EB091190E3C -:10AAE0008093610C9093620CA093630CB093640C00 -:10AAF0001092650C1092660C1092670C1092680C04 -:10AB0000B80188E79BE00E9407F388E7E82E8BE016 -:10AB1000F82EF70181917F01882319F00E940232FB -:10AB2000F8CF8AE00E940232B8018EED9EE00E94CA -:10AB3000125E4091610C5091620C6091630C7091B7 -:10AB4000640C86ED9EE00E94BF5D8AE00E940232A6 -:10AB5000E7ECFEE084917F019FEFE91AF90A882370 -:10AB600021F00E940232F701F5CFB80180E090E0B9 -:10AB7000A8DD8091450C882319F085E49CE001C094 -:10AB8000C80160E02AC0B80183EB9EE010C06115E7 -:10AB9000710511F06C5F7F4F26E5A80185E09EE00E -:10ABA0000E94A68D81110CC0B8018FE99EE00E9421 -:10ABB000125E8EE20E9402328AE00E9402323DC0A2 -:10ABC00081E08093330CB7018DE89EE00E94125E15 -:10ABD0008AE00E94023260E0C8010E946AC52DC06E -:10ABE000E1E0ED83EAEBFFE084918F010F5F1F4FFF -:10ABF000882321F00E940232F801F6CFE0E0FFE066 -:10AC000084918F010F5F1F4F882321F00E94023231 -:10AC1000F801F6CFFD81F13019F0EAEFFEE002C055 -:10AC2000E4EFFEE084918F010F5F1F4F882309F44A -:10AC300020CF0E940232F801F5CF0F900F900F90B5 -:10AC40000F900F90DF91CF911F910F91FF90EF9098 -:10AC5000DF900895CF93DF938091EF0B9091F00BED -:10AC6000891B8F7009F445C09091EC0B992351F02A -:10AC7000833030F48FEF890F19F08093EC0B3BC0D9 -:10AC80001092EC0BE091F00B81E5E89FF0011124AC -:10AC9000E65BF94F808180FD2EC080911F06909168 -:10ACA0002006A0912106B0912206EF01C35BDF4F81 -:10ACB000488159816A817B81841B950BA60BB70B58 -:10ACC00080931F0690932006A0932106B09322063E -:10ACD0008091F00B8F5F8F708093ED0B9091F00B54 -:10ACE0008091EE0B98130AC08091ED0B8093EE0BD0 -:10ACF00005C00E94277680E090E001C0CF01DF917F -:10AD0000CF9108950F930FB70F9300916E000F939B -:10AD10000B7F00936E0000916F000D7F00936F001A -:10AD20000F930BB70F930CB70F921F922F933F9374 -:10AD30004F935F936F937F938F939F93AF93BF9343 -:10AD4000EF93FF93112471D0FF91EF91BF91AF91D9 -:10AD50009F918F917F916F915F914F913F912F9133 -:10AD60001F900F900CBF0F910BBF0F910260F894D2 -:10AD700000936F000F9100936E000F910FBF0F9122 -:10AD800018958091B90E80FF08C080910B018095C5 -:10AD90008270809309018FEF06C080910B01827051 -:10ADA0008093090181E08093BB0E8091B90E81FFF1 -:10ADB00007C080910B018170809309018FEF07C05C -:10ADC00080910B01809581708093090181E08093CF -:10ADD000BC0E8091B90E82FF07C080910B01847078 -:10ADE000809309018FEF07C080910B0180958470DB -:10ADF0008093090181E08093BD0E8091B90E83FF9D -:10AE000008C080910B0180958074809309018FEFB9 -:10AE100006C080910B0180748093090181E08093CA -:10AE2000BE0E00000000000008952F923F924F9246 -:10AE30005F926F927F928F929F92AF92BF92CF92CA -:10AE4000DF92EF92FF921F93CF93DF93F8948FEFEF -:10AE50009FEF90938900809388001AE0C0E0D0E0D3 -:10AE6000BCED2B2EB7E13B2E78948091000F909192 -:10AE7000010FA091020FB091030F892B8A2B8B2B0E -:10AE800009F0CEC1809198108823D1F010929810CB -:10AE90008091961090919710892B91F01092BA0E94 -:10AEA00010929710109296109091EF0B8091F00BEA -:10AEB000981731F08091F00B8F5F8F708093F00BBB -:10AEC0008091961090919710892B09F4A9C18090D8 -:10AED000FC0E9090FD0EA090FE0EB090FF0E4091E3 -:10AEE000F80E5091F90E6091FA0E7091FB0EC09021 -:10AEF000EB0ED12CE12CF12CDB01CA018819990948 -:10AF0000AA09BB09C816D906EA06FB0610F4D70140 -:10AF1000C601282F880D991DAA1DBB1D8093FC0E0C -:10AF20009093FD0EA093FE0EB093FF0E80918400CF -:10AF3000909185004E96C090D30ED090D40EE090A4 -:10AF4000D50EF090D60E4091C30E5091C40E609174 -:10AF5000C50E7091C60E4C0D5D1D6E1D7F1D40937C -:10AF6000D30E5093D40E6093D50E7093D60E77FD0A -:10AF70001CC0409AC090A510D090A610E090A710D9 -:10AF8000F090A8104091BB0E042E000C550B660BE0 -:10AF9000770B4C0D5D1D6E1D7F1D4093A5105093CA -:10AFA000A6106093A7107093A810C090D70ED090F1 -:10AFB000D80EE090D90EF090DA0E4091C70E509165 -:10AFC000C80E6091C90E7091CA0E4C0D5D1D6E1DAC -:10AFD0007F1D4093D70E5093D80E6093D90E709377 -:10AFE000DA0E77FD1CC0419AC090A910D090AA102B -:10AFF000E090AB10F090AC104091BC0E042E000C11 -:10B00000550B660B770B4C0D5D1D6E1D7F1D409320 -:10B01000A9105093AA106093AB107093AC10C0901D -:10B02000DB0ED090DC0EE090DD0EF090DE0E409155 -:10B03000CB0E5091CC0E6091CD0E7091CE0E4C0D7A -:10B040005D1D6E1D7F1D4093DB0E5093DC0E6093E3 -:10B05000DD0E7093DE0E77FD1CC0429AC090AD10DD -:10B06000D090AE10E090AF10F090B0104091BD0EB7 -:10B07000042E000C550B660B770B4C0D5D1D6E1DE1 -:10B080007F1D4093AD105093AE106093AF1070933E -:10B09000B010C090DF0ED090E00EE090E10EF09086 -:10B0A000E20E4091CF0E5091D00E6091D10E709172 -:10B0B000D20E4C0D5D1D6E1D7F1D4093DF0E509313 -:10B0C000E00E6093E10E7093E20E77FD1CC0439A90 -:10B0D000C090B110D090B210E090B310F090B410C6 -:10B0E0004091BE0E042E000C550B660B770B4C0DD9 -:10B0F0005D1D6E1D7F1D4093B1105093B210609383 -:10B10000B3107093B410409184005091850048179B -:10B110005907C8F34091D30E5091D40E6091D50ECB -:10B120007091D60E77FD15C0C090BF0ED090C00EA6 -:10B13000E090C10EF090C20E4C195D096E097F09B6 -:10B140004093D30E5093D40E6093D50E7093D60EC9 -:10B1500040984091D70E5091D80E6091D90E7091C1 -:10B16000DA0E77FD15C0C090BF0ED090C00EE090F3 -:10B17000C10EF090C20E4C195D096E097F09409313 -:10B18000D70E5093D80E6093D90E7093DA0E419873 -:10B190004091DB0E5091DC0E6091DD0E7091DE0E61 -:10B1A00077FD15C0C090BF0ED090C00EE090C10ECC -:10B1B000F090C20E4C195D096E097F094093DB0EB9 -:10B1C0005093DC0E6093DD0E7093DE0E429840913A -:10B1D000DF0E5091E00E6091E10E7091E20E77FD6E -:10B1E00015C0C090BF0ED090C00EE090C10EF09080 -:10B1F000C20E4C195D096E097F094093DF0E509312 -:10B20000E00E6093E10E7093E20E4398215041F0FE -:10B21000409184005091850048175907C8F38ACEA1 -:10B220008091000F9091010FA091020FB091030F38 -:10B23000892B8A2B8B2B09F01FC3E0919610F0917C -:10B240009710309709F494C48091FC0E9091FD0EF4 -:10B25000A091FE0EB091FF0E4091F80E5091F90EA4 -:10B260006091FA0E7091FB0E84179507A607B70739 -:10B27000D0F01092BA0E10929710109296109091F2 -:10B28000EF0B8091F00B981709F472C48091F00BCA -:10B290008F5F8F708093F00BA0EDCA2EA7E0DA2E9F -:10B2A000E12CF12C4EC14091F40E5091F50E6091BD -:10B2B000F60E7091F70E481759076A077B0708F4D6 -:10B2C00067C04091F00E5091F10E6091F20E7091B6 -:10B2D000F30E82A993A9A4A9B5A9FF24499FE12C43 -:10B2E0005A9F90016A9F300D699F200D311D4A9F22 -:10B2F000E00C211D3F1D599FE00C211D3F1D689F43 -:10B30000E00C211D3F1D589FE10C2F1D3F1DE694B1 -:10B310002F1D3F1DB49F200D311DB59F300D1124F1 -:10B3200083AD94ADA5ADB6AD820F931FA11DB11D28 -:10B330008093EC0E9093ED0EA093EE0EB093EF0E73 -:10B34000C7A8D0ACE1ACF2ACC816D906EA06FB0639 -:10B3500040F4C092EC0ED092ED0EE092EE0EF09220 -:10B36000EF0E8090EC0E9090ED0EA090EE0EB0904F -:10B37000EF0E80EC97E121E0FC01C590D590E590BF -:10B38000F490C814D904EA04FB0408F4BBC2C5C293 -:10B390004091E70E5091E80E6091E90E7091EA0E2F -:10B3A000481759076A077B0708F063C04091E30E0E -:10B3B0005091E40E6091E50E7091E60E82A993A97A -:10B3C000A4A9B5A9FF24499FE12C5A9F90016A9F27 -:10B3D000300D699F200D311D4A9FE00C211D3F1D3E -:10B3E000599FE00C211D3F1D689FE00C211D3F1D52 -:10B3F000589FE10C2F1D3F1DE6942F1D3F1DB49F4C -:10B40000200D311DB59F300D1124C901A0E0B0E021 -:10B410008090EC0E9090ED0EA090EE0EB090EF0E9E -:10B42000FF9688159905AA05BB0580F4C080D180D8 -:10B43000E280F380881A990AAA0ABB0A8C149D0438 -:10B44000AE04BF0438F44601570104C080809180E7 -:10B45000A280B38080EC97E121E0FC01C590D590FB -:10B46000E590F490C814D904EA04FB0408F4BDC2C2 -:10B47000C7C280911B0290911C02A0911D02B09145 -:10B480001E02B7FF56C087A990ADA1ADB2AD20ECAA -:10B4900037E141E0F901C590D590E590F490C816E8 -:10B4A000D906EA06FB0658F4B695A79597958795B1 -:10B4B000440F2C5F3F4FF7E12C3D3F0759F7409376 -:10B4C000EB0E80329105A105B10508F424C38097E5 -:10B4D000A109B109811528E09207A105B10508F479 -:10B4E000F7C244E0949F9001112420543C4EF9018E -:10B4F000329645915491EE27859FB001849F610D4E -:10B500007E1F06946E1F7E1F1124CB01A0E0B0E0C9 -:10B51000F9014591549160E070E0481B590B6A0BAA -:10B520007B0B40931B0250931C0260931D0270938F -:10B530001E02C0901B02D0901C02E0901D02F090F1 -:10B540001E028091961090919710892B09F08CC162 -:10B5500081DB9093971080939610892B09F484C116 -:10B56000E0919610F0919710808183FF3EC085890D -:10B570009689A789B08D8093A5109093A610A0936B -:10B58000A710B093A810818D928DA38DB48D809358 -:10B59000A9109093AA10A093AB10B093AC10858D16 -:10B5A000968DA78DB0A18093AD109093AE10A0930F -:10B5B000AF10B093B01081A192A1A3A1B4A18093C8 -:10B5C000B1109093B210A093B310B093B4109091B7 -:10B5D000EF0B8091F00B981709F4BACF8091F00B24 -:10B5E0008F5F8F708093F00BB3CF85889688A78884 -:10B5F000B08C81E081149104A104B10409F480E0CD -:10B60000C18CD28CE38CF48CC114D104E104F1041C -:10B6100009F08260458D568D678D70A141155105E9 -:10B620006105710509F084608093BA0E1092E30EF3 -:10B630001092E40E1092E50E1092E60E1092F00EAB -:10B640001092F10E1092F20E1092F30E85A196A1B7 -:10B65000A7A1B0A58093F80E9093F90EA093FA0ECF -:10B66000B093FB0E442455243201481A590A6A0A41 -:10B670007B0A4092DF0E5092E00E6092E10E7092D3 -:10B68000E20E4092DB0E5092DC0E6092DD0E709264 -:10B69000DE0E4092D70E5092D80E6092D90E709264 -:10B6A000DA0E4092D30E5092D40E6092D50E709264 -:10B6B000D60E880C991CAA1CBB1C8092C30E9092BB -:10B6C000C40EA092C50EB092C60ECC0CDD1CEE1CB2 -:10B6D000FF1CC092C70ED092C80EE092C90EF09225 -:10B6E000CA0E440F551F661F771F4093CB0E509311 -:10B6F000CC0E6093CD0E7093CE0E41A152A163A1EA -:10B7000074A1440F551F661F771F4093CF0E5093AF -:10B71000D00E6093D10E7093D20E880F991FAA1F7E -:10B72000BB1F8093BF0E9093C00EA093C10EB09329 -:10B73000C20E1092FC0E1092FD0E1092FE0E109290 -:10B74000FF0E82A593A5A4A5B5A58093F40E9093B2 -:10B75000F50EA093F60EB093F70E86A597A5A0A9B7 -:10B76000B1A98093E70E9093E80EA093E90EB093F1 -:10B77000EA0E41A556A98091B90E58130AC08091CE -:10B780001A0290E0242F042E000C330B28173907DF -:10B7900029F05093B90E40931A02F3DA8091100405 -:10B7A00081110E9442768FEF9FEFDC0180931B0294 -:10B7B00090931C02A0931D02B0931E02E09196107C -:10B7C000F091971083AD94ADA5ADB6AD8093EC0E1E -:10B7D0009093ED0EA093EE0EB093EF0E20EC37E1B8 -:10B7E00041E0F901C590D590E590F490C816D906CE -:10B7F000EA06FB0650F4B695A79597958795440FF2 -:10B800002C5F3F4F2216330661F74093EB0E8032D8 -:10B810009105A105B10508F4A6C18097A109B10958 -:10B820008115F8E09F07A105B10508F479C144E04E -:10B83000949F9001112420543C4EF9013296459179 -:10B840005491EE27859FB001849F610D7E1F069461 -:10B850006E1F7E1F1124F901C590D490E12CF12CAC -:10B86000C61AD70AE108F108C092000FD092010F62 -:10B87000E092020FF092030F8091000F9091010F60 -:10B88000A091020FB091030FAC01BD010097F1E050 -:10B89000AF07B10520F04FEF5FEF60E070E0841B71 -:10B8A000950BA60BB70B8093000F9093010FA093FD -:10B8B000020FB093030FF89480918400909185005B -:10B8C0004096115039F0C40FD51FC817D90708F496 -:10B8D000CBCA01C0EC01D0938900C0938800789452 -:10B8E000DF91CF911F91FF90EF90DF90CF90BF90AD -:10B8F000AF909F908F907F906F905F904F903F9010 -:10B900002F900895B694A79497948794220F049645 -:10B9100037E18C3D930709F02FCD2093EB0E80E2A9 -:10B9200088169104A104B10408F459C020E2821AD7 -:10B930009108A108B108811438E09306A104B1046C -:10B94000F8F0A4E09A9EC001112480549C4EFC01A2 -:10B95000329625913491F82DEE27F39FD001F29F76 -:10B96000A10DBE1F0694AE1FBE1F1124FC01C59081 -:10B97000D490E12CF12CCA1ADB0AE108F10822C0AC -:10B98000D501C401B695A79597958795FC01EC7FE5 -:10B99000CF018054904FFC01C590D490FC013296A9 -:10B9A00025913491E82DE770E29FC001E39F900D4F -:10B9B0001124F3E096958795FA95E1F7C81AD90A0C -:10B9C000E12CF12C4C0D5D1D6E1D7F1D4093F00E82 -:10B9D0005093F10E6093F20E7093F30EB2CDA0E28D -:10B9E0008A2E912CA12CB12CA1CFB694A794979418 -:10B9F0008794220F0496A7E18C3D9A0709F02DCD7C -:10BA00002093EB0E90E289169104A104B10408F48E -:10BA100059C020E2821A9108A108B108811438E0C7 -:10BA20009306A104B104F8F0A4E09A9EC001112489 -:10BA300080549C4EFC01329625913491F82DEE27CE -:10BA4000F39FD001F29FA10DBE1F0694AE1FBE1F33 -:10BA50001124FC01C590D490E12CF12CCA1ADB0A08 -:10BA6000E108F10822C0D501C401B695A7959795C4 -:10BA70008795FC01EC7FCF018054904FFC01C5906D -:10BA8000D490FC01329625913491E82DE770E29F25 -:10BA9000C001E39F900D112433E0969587953A9568 -:10BAA000E1F7C81AD90AE12CF12C4C0D5D1D6E1D71 -:10BAB0007F1D4093E30E5093E40E6093E50E709368 -:10BAC000E60E3FCDF0E28F2E912CA12CB12CA1CF10 -:10BAD000AC01BD017695679557954795FA01EC7FC6 -:10BAE0009F012054304FF90145915491F90132964C -:10BAF000659174918770869F9001879F300D112406 -:10BB0000C901F3E096958795FA95E1F7481B590B23 -:10BB100060E070E006CD80E290E0A0E0B0E0D7CC3D -:10BB2000AC01BD017695679557954795FA01EC7F75 -:10BB30009F012054304FF901C590D490F9013296FD -:10BB4000459154918770849F9001859F300D1124F9 -:10BB5000C90123E0969587952A95E1F7C81AD90A75 -:10BB6000E12CF12C81CE80E290E0A0E0B0E055CE57 -:10BB700080EDC82E87E0D82EE12CF12CE9CCCF92B5 -:10BB8000DF92EF92FF92CF93DF936A017B01FC017A -:10BB90008491EF012196882321F00E940232FE0158 -:10BBA000F7CF4AE0C701B601DF91CF91FF90EF9048 -:10BBB000DF90CF900C943E35CF92DF92EF92FF92C0 -:10BBC000CF93DF936A017B01FC018491EF01219601 -:10BBD000882321F00E940232FE01F7CF42E0C70124 -:10BBE000B601DF91CF91FF90EF90DF90CF900C9452 -:10BBF000DB370F931F93CF93DF938B01FC0184916D -:10BC0000EF012196882321F00E940232FE01F7CF36 -:10BC1000B801110F880B990BDF91CF911F910F91F4 -:10BC20000C94E5350F931F93CF93DF938B01FC01A9 -:10BC30008491EF012196882321F00E940232FE01B7 -:10BC4000F7CFE8018991882319F00E940232FACFD8 -:10BC5000DF91CF911F910F91089586E40E942831C2 -:10BC60008093C605882351F00E94F5306093070247 -:10BC7000709308028093090290930A0283E50E9460 -:10BC80002831882351F00E94F53060930F027093A1 -:10BC90001002809311029093120282E40E942831D4 -:10BCA000882351F00E94F53060930B0270930C02D0 -:10BCB00080930D0290930E0208954F925F926F92BF -:10BCC0007F928F929F92AF92BF92EF92FF920F93CB -:10BCD0001F93CF93DF93C3E2D2E18BE5E82E8BE095 -:10BCE000F82E0FEE15E0412C512C3201439469914E -:10BCF000799189919991F70181909190A190B1905A -:10BD00007F010E9471EBA50194010E94D2EB0E9479 -:10BD1000E0F0F80161937193819391938F0146163E -:10BD200057066806790610F42B013C01F2E1C33393 -:10BD3000DF07E9F66FEF7FEFCB01A30192010E94CD -:10BD40005BEF2093FF05309300064093010650936C -:10BD50000206DF91CF911F910F91FF90EF90BF905E -:10BD6000AF909F908F907F906F905F904F900895CD -:10BD70008091EF0B9091F00B891B8F708F3019F42D -:10BD80000E948990F5CF8091EF0B8F5F8F70E091CB -:10BD9000EF0B91E59E9FF0011124E65BF94FDF0167 -:10BDA0001D929A95E9F798E090834091050C509187 -:10BDB000060C6091070C7091080C458B568B678BB5 -:10BDC000708F4091090C50910A0C60910B0C70918E -:10BDD0000C0C418F528F638F748F40910D0C5091DA -:10BDE0000E0C60910F0C7091100C458F568F678F61 -:10BDF00070A34091110C5091120C6091130C709132 -:10BE0000140C41A352A363A374A32091EF0B909150 -:10BE1000F00B291303C094E69093EC0B8093EF0B87 -:10BE200080916F00826080936F0008959091EF0B76 -:10BE30008091F00B981306C080916B0B90916C0B66 -:10BE4000892B19F00E948990F1CF0895EF92FF920B -:10BE50000F931F93CF93DF937B018A01E901209118 -:10BE60005B0B30915C0B40915D0B50915E0BFC01C4 -:10BE700060817181828193810E94D2EB0E94C8F11E -:10BE80006093050C7093060C8093070C9093080C3C -:10BE900020915F0B3091600B4091610B5091620BD0 -:10BEA000F70160817181828193810E94D2EB0E94AF -:10BEB000C8F16093090C70930A0C80930B0C90935B -:10BEC0000C0C20E030E0A901F801608171818281D1 -:10BED00093810E9497EF2091630B3091640B409106 -:10BEE000650B5091660B0E94D2EB0E94C8F16093E3 -:10BEF0000D0C70930E0C80930F0C9093100C2091EE -:10BF0000670B3091680B4091690B50916A0B688107 -:10BF100079818A819B810E94D2EB0E94C8F1609353 -:10BF2000110C7093120C8093130C9093140C90913D -:10BF3000EF0B8091F00B981739F0DF91CF911F91A3 -:10BF40000F91FF90EF9014CF71DF80916F00982FC9 -:10BF5000927081FF05C080916F008D7F80936F008C -:10BF60004091050C5091060C6091070C7091080CE3 -:10BF70004093A5105093A6106093A7107093A8103B -:10BF80004091090C50910A0C60910B0C70910C0CB3 -:10BF90004093A9105093AA106093AB107093AC100B -:10BFA00040910D0C50910E0C60910F0C7091100C83 -:10BFB0004093AD105093AE106093AF107093B010DB -:10BFC0004091110C5091120C6091130C7091140C53 -:10BFD0004093B1105093B2106093B3107093B410AB -:10BFE000992329F080916F00826080936F00DF9128 -:10BFF000CF911F910F91FF90EF9008950F931F9392 -:10C00000CF93DF93CBE5DBE007E216E0299139918E -:10C010004991599160E070E080E89FE30E9473F0DD -:10C02000F80161937193819391938F01FBE0CB367B -:10C03000DF0761F729E234E045E254E061E274E0B1 -:10C040008DE194E003DFDF91CF911F910F9135CE09 -:10C05000CF93DF930E947DBBD0910D11C0E0D11131 -:10C0600022C080911011882331F08091130288231F -:10C0700009F464C00FC0809139108823B1F3109285 -:10C08000391088E290E60E94869F80910F118823E4 -:10C0900061F35CC081E090911011911180E023E088 -:10C0A0004CE058E148C0D13019F580911011813031 -:10C0B00031F080911302882309F440C00FC08091B1 -:10C0C00039108823B1F31092391080EE96E60E9461 -:10C0D000869F80910F11882361F338C081E0909191 -:10C0E0001011913009F080E023E046E058E123C0D0 -:10C0F000D23021F580911011823029F08091130205 -:10C100008823E1F00FC0809139108823B9F3109291 -:10C1100039108FE897E60E94869F80910F1188233F -:10C1200069F314C081E090911011923009F080E021 -:10C1300023E041E058E16C2F0E9494C4CF5FDF5FA1 -:10C14000C53009F08CCF83E080930E11DF91CF9141 -:10C1500008958091300F8630D8F496E0899FF001E1 -:10C160001124E45FF04F2091430230914402318367 -:10C17000208340911211509113116091141170910C -:10C18000151142835383648375838F5F8093300FCF -:10C190000895CF92DF92EF92FF920F931F93CF9368 -:10C1A000DF93EC016A017B0180914302909144028C -:10C1B0008C179D0709F477C02FECC233D207A1F486 -:10C1C0008C559146C1F50E94EDDBDC01CB018E510F -:10C1D0009B4FAF4FBF4F8093080F9093090FA093D1 -:10C1E0000A0FB0930B0F27C021E6CC35D20709F018 -:10C1F0004DC082539F4CD9F50E94EDDB0091080F92 -:10C200001091090F20910A0F30910B0FDC01CB0127 -:10C21000801B910BA20BB30BB7FF29C08091EF0BD2 -:10C220009091F00B891B8F7021F48091350C88233D -:10C23000F1F0C3E6DEECD0934402C0934302C09217 -:10C240001211D0921311E0921411F0921511CC55E5 -:10C25000D14621F4109233101092300F82E0809377 -:10C26000130281E080930F11109238101CC08CE5EE -:10C2700091E69093440280934302C0921211D092AF -:10C280001311E0921411F0921511E4CFD0934402EF -:10C29000C0934302409312115093131160931411F1 -:10C2A00070931511DBCFDF91CF911F910F91FF900C -:10C2B000EF90DF90CF9008953F924F925F926F92F0 -:10C2C0007F928F929F92AF92BF92CF92DF92EF9226 -:10C2D000FF920F931F93CF93DF93CDB7DEB72A97CB -:10C2E0000FB6F894DEBF0FBECDBF1092161180912D -:10C2F000391010923910882349F00E944EC840E04E -:10C3000050E0BA0182E39FEC44DF42C54091121134 -:10C3100050911311609114117091151120914D02DB -:10C3200030914E02C901840F951F2436310524F443 -:10C33000853691053CF416C02436310531F084363B -:10C34000910584F484E690E00DC047305105610505 -:10C35000710514F0069706C04A3F5F4F6F4F7F4F3D -:10C360006CF4069690934E0280934D021092121137 -:10C3700010921311109214111092151180914D0208 -:10C3800090914E028A3091053CF0883EE3E09E0792 -:10C390002CF087EE93E002C08AE090E090934E028A -:10C3A00080934D020E94EDDB0091320F1091330F0C -:10C3B0002091340F3091350F6B017C01C01AD10AE6 -:10C3C000E20AF30AF7FC13C02091310F2095209365 -:10C3D000310FDC01CB018A549C4FAF4FBF4F80938C -:10C3E000320F9093330FA093340FB093350F3090EA -:10C3F000310F0E94D1C48091E60B853110F53320B6 -:10C4000059F080913F0690914006892B29F03DE636 -:10C41000E32E39E1F32E04C020E5E22E28E1F22ECE -:10C4200003E128E741E068E082EB9BE00E9442BF25 -:10C43000882339F0870123E14FE061E088E00E9422 -:10C44000244F8091E60B8D3108F0FEC0883080F5D6 -:10C450006091021170910311072E000C880B990B4B -:10C460000E9473EB20E030E040E05FE30E9497EF32 -:10C470000E94DBF0CB010E940DC4FC018081803260 -:10C48000A9F48181803281F093E085E0891B80935B -:10C49000E90B87E08093EA0BCF010E94BEC88DE4D0 -:10C4A00098E10E94B1C804C096E0EFCF90E0EDCFD4 -:10C4B0008091E60B8D31A0F58091E80B853180F1FC -:10C4C00020E030E040E05FE360914606709147066F -:10C4D00080914806909149060E9497EF0E94DBF0F8 -:10C4E000CB010E940DC4FC018081803209F0D5C2CD -:10C4F0008181803209F4CFC293E085E0891B80936B -:10C50000E90B8CE18093EA0BCF010E94BEC88DE459 -:10C5100098E10E94B1C88091E60B853108F4B6C25B -:10C520008091E60B883070F56091001170910111D7 -:10C53000072E000C880B990B0E9473EB20E030E073 -:10C5400040E05FE30E9497EF0E94DBF0CB010E9486 -:10C550000DC4FC012081203229F42181203221F4F4 -:10C5600036E003C030E001C033E021E5231B209317 -:10C57000E90B27E02093EA0B0E94BEC88DE498E106 -:10C580000E94B1C88091E60B8D31A0F58091E80B37 -:10C59000853180F120E030E040E05FE36091040FFE -:10C5A0007091050F8091060F9091070F0E9497EFF1 -:10C5B0000E94DBF0CB010E940DC4FC01808180321F -:10C5C00009F09DC28181803209F092C296E081E536 -:10C5D000891B8093E90B8CE18093EA0BCF010E94C9 -:10C5E000BEC88DE498E10E94B1C88091E60B853108 -:10C5F00008F480C28091E60B8C3130F58091E80B15 -:10C60000843110F180913F0690914006019644E6F6 -:10C61000489F9001499F300D112437FF02C02150DF -:10C620003F4F832F932F990F990B009769F028E6BE -:10C630002093E90B2BE12093EA0B0E940DC40E948A -:10C64000BEC885E20E9454508091080E882349F0AC -:10C650008091E60B843328F48091E80B8A3208F04D -:10C6600079C28091E60B853328F48091E80B813301 -:10C6700008F094C28091080E882369F18091610CC2 -:10C680009091620CA091630CB091640C0097A1058D -:10C69000B10509F1BC01CD016D597F4F8F4F9F4FFF -:10C6A00024E630E040E050E00E945BEF6091650CD2 -:10C6B0007091660C8091670C9091680C0E945BEF02 -:10C6C000223048F08091E60B843328F48091E80B07 -:10C6D000823308F06AC28091E60B813308F064C0AF -:10C6E0008091E80B893208F45FC00E947AB72B0171 -:10C6F0003C0120E13EE040E050E00E945BEF690138 -:10C7000079018CE3882E912CA12CB12CC301B201AC -:10C71000A50194010E945BEFCA01B901A501940132 -:10C720000E945BEFA62E972E8E010F5F1F4F20E811 -:10C73000421621E5520621E06206710408F44EC259 -:10C74000C301B20120E831E541E050E00E945BEF17 -:10C7500069019F92AF92C70168E170E00E945BF2AD -:10C760009F938F933F932F938DE298E19F938F93A5 -:10C770001F930F930E9407EB0FB6F894DEBF0FBE16 -:10C78000CDBF9AE0C916D10408F052C288E0982FB4 -:10C79000990F890F8195855A8093E90B80E38093E7 -:10C7A000EA0BC8010E94BEC8E091AC0BF091AD0B42 -:10C7B000848181112DC120917810309179104091A0 -:10C7C0007A1050917B1060911D0470911E0480912D -:10C7D0001F04909120040E9497EF6B017C0120E0E0 -:10C7E00030E0A9010E946DEB87FD05C020E030E03C -:10C7F00040E05FE304C020E030E040E05FEBC701D1 -:10C80000B6010E9497EF0E94DBF0CB010E948CC31F -:10C81000BC0182E49FE00E9407F320917C103091DC -:10C820007D1040917E1050917F1060912104709195 -:10C83000220480912304909124040E9497EF6B01BD -:10C840007C0120E030E0A9010E946DEB87FD05C06E -:10C8500020E030E040E05FE304C020E030E040E072 -:10C860005FEBC701B6010E9497EF0E94DBF0CB019E -:10C870000E948CC3BC018DE39FE00E9407F32091CE -:10C8800080103091811040918210509183106091FE -:10C8900025047091260480912704909128040E9419 -:10C8A00097EF6B017C0120E030E04AE754E40E94FE -:10C8B000D2EB2B013C0120E030E0A901C701B60119 -:10C8C0000E946DEB87FD05C020E030E040EA50E4B7 -:10C8D00004C020E030E040EA50ECC301B2010E9405 -:10C8E00097EF20E030E040E251E40E9473F00E94B4 -:10C8F000DBF06B017C0197FD16C06031F7E27F072A -:10C9000081059105D4F020E137E240E050E00E943B -:10C9100082F2CA01B9012AE030E040E050E00E9412 -:10C9200082F2605D0BC0F094E094D094C094C11C7E -:10C93000D11CE11CF11C6DE201C060E260930611A4 -:10C9400028EEC21623E0D206E104F10494F0C701F8 -:10C95000B60128EE33E040E050E00E9482F2CA01C6 -:10C96000B9012AE030E040E050E00E9482F2605DD0 -:10C9700001C060E260930711C701B60124E630E010 -:10C9800040E050E00E9482F29AE0492E512C612C46 -:10C99000712CCA01B901A30192010E9482F2605D6B -:10C9A00060930811C701B601A30192010E9482F2AF -:10C9B000162F662381F08EE280930911CA01B90116 -:10C9C000A30192010E9482F2605D60930A11105DE2 -:10C9D00010930B1117C0CA01B901A30192010E9463 -:10C9E00082F2662339F08EE280930911605D6093D4 -:10C9F0000A1105C080E280930A118093091180E238 -:10CA000080930B1166E071E186E39FE00E9407F3DB -:10CA10008091E60B883298F48091E80B8D3178F0A4 -:10CA20002BE040E86DE180E00E94D6BB8091E60BF0 -:10CA3000873228F48091E80B8F3108F0FBC0809199 -:10CA4000E60B823328F48091E80B8B3208F081C129 -:10CA50008091E60B803408F09BC18091E80B88330D -:10CA600008F496C11092E90B8FE38093EA0B85E9F5 -:10CA70009BE00E94529F182F0E946F50163108F0C1 -:10CA800087C180E20E9454501F5FF8CF8091E80B6D -:10CA9000813128F445CD96E030CD90E02ECD6091E7 -:10CAA000021170910311072E000C880B990B0E9444 -:10CAB00073EB20914606309147064091480650910D -:10CAC00049060E94BDF118163CF022E042E061E107 -:10CAD0008DE00E9407BC24CD1092D20B22E042E0F0 -:10CAE00061E18DE00E9407BC81E08093D20B18CDFC -:10CAF00093E06DCD8091E80B813118F47BCD90E00F -:10CB000066CD6091001170910111072E000C880B09 -:10CB1000990B0E9473EB2091040F3091050F409107 -:10CB2000060F5091070F0E94BDF1181664F4109281 -:10CB3000D20B22E042E062E188E50E9407BC81E07E -:10CB40008093D20B57CD22E042E062E188E50E945B -:10CB500007BC50CD27E048E06AE28AE20E9407BCA9 -:10CB600025E042E06CE282E30E9407BC24E04AE058 -:10CB700061E38AE20E94D6BB6091B40B7091B50B61 -:10CB800082E38093CE0B8BE28093CF0B2EEC3BE0C5 -:10CB900042E382EB9BE00E943EBF63CD24E04AE487 -:10CBA00061E386E30E94D6BB65CDF8E42F9FB00118 -:10CBB0001124072E000C880B990B0E9473EB2AE0BE -:10CBC00037ED43E25CE30E94D2EB0E94E0F0462F97 -:10CBD00022E062E387E30E9407BC7DCDE4E6EE1627 -:10CBE000F10498F49F92AF92DF92CF9283E298E1A2 -:10CBF0009F938F931F930F930E9407EB0FB6F894A8 -:10CC0000DEBF0FBECDBF85E0C2CD9F92AF92DF9257 -:10CC1000CF928BE198E19F938F931F930F930E9484 -:10CC200007EB0FB6F894DEBF0FBECDBF86E0AFCDE9 -:10CC300089E0ADCD83E08093E90B16E21093EA0B17 -:10CC40008BE498E10E94B1C88BE08093E90B1093CC -:10CC5000EA0B332029F082E49FE00E94BEC819C08D -:10CC60008091340480FD0DC002E41FE0F801819141 -:10CC70008F01882371F08F320CF08FE30E949DC8E2 -:10CC8000F5CF8091330480FDE6CF86E498E10E94E1 -:10CC9000B1C88BE28093E90B16E21093EA0B84E4AF -:10CCA00098E10E94B1C883E38093E90B1093EA0BEB -:10CCB000332029F08DE39FE00E94BEC819C0809107 -:10CCC000340481FD0DC00DE31FE0F80181918F0157 -:10CCD000882371F08F320CF08FE30E949DC8F5CF4E -:10CCE0008091330481FDE6CF86E498E10E94B1C8CB -:10CCF00083E58093E90B16E21093EA0B82E498E156 -:10CD00000E94B1C88BE58093E90B1093EA0B3320A6 -:10CD100029F086E39FE00E94BEC891CE8091340442 -:10CD200082FD0EC006E31FE0F80181918F01882388 -:10CD300009F485CE8F320CF08FE30E949DC8F4CFAA -:10CD40008091330482FDE5CF8BE398E10E94B1C866 -:10CD500076CE84E00E946DC883E08093E90B12E3F5 -:10CD60001093EA0B86E00E949DC80E94D1C48CE01B -:10CD70008093E90B1093EA0B80914D0290914E0243 -:10CD80000E940DC40E94BEC885E20E94545060CE2D -:10CD90002A960FB6F894DEBF0FBECDBFDF91CF91BC -:10CDA0001F910F91FF90EF90DF90CF90BF90AF90C9 -:10CDB0009F908F907F906F905F904F903F900895DD -:10CDC000CF92DF92EF92FF920F931F93CF93DF9357 -:10CDD000CDB7DEB7C054D1090FB6F894DEBF0FBE91 -:10CDE000CDBF1092940B40E050E0BA018CE591E683 -:10CDF000D0D908E71BE0F80181918F01882319F051 -:10CE00000E940232F8CF8AE00E94023281E08093D1 -:10CE1000940B8091860B9091870B6AE070E00E94E2 -:10CE20005BF29F938F937F936F9381EF97E19F9333 -:10CE30008F938E010F5F1F4F1F930F930E9407EB7D -:10CE400078010FB6F894DEBF0FBECDBF6801F601C2 -:10CE500081916F01882319F00E940232F8CF8AE095 -:10CE60000E940232C8010E9409328091930B8F9375 -:10CE70008091920B8F938091910B8F938091900B67 -:10CE80008F9389EE97E19F938F931F930F930E9447 -:10CE900007EB0FB6F894DEBF0FBECDBF6801F601F9 -:10CEA00081916F01882319F00E940232F8CF8AE045 -:10CEB0000E940232C8010E9409328091890B8F932F -:10CEC0008091880B8F9380EE97E19F938F931F93B0 -:10CED0000F930E9407EB0F900F900F900F900F9001 -:10CEE0000F90F70181917F01882319F00E9402328F -:10CEF000F8CF8AE00E940232C8010E940932C05C69 -:10CF0000DF4F0FB6F894DEBF0FBECDBFDF91CF91DC -:10CF10001F910F91FF90EF90DF90CF900895EF92C7 -:10CF2000FF920F931F93CF93DF93CDB7DEB7A097F8 -:10CF30000FB6F894DEBF0FBECDBF1092940B1092C7 -:10CF4000780B8CEF97E19F938F938E010F5F1F4FAC -:10CF50001F930F930E9407EB78010F900F900F9093 -:10CF60000F90F70181917F01882319F00E9402320E -:10CF7000F8CF8AE00E940232C8010E94093240E0E4 -:10CF800050E0BA018CE591E604D9A0960FB6F8946A -:10CF9000DEBF0FBECDBFDF91CF911F910F91FF90EC -:10CFA000EF90089540E050E0BA018CE591E6F1C8B9 -:10CFB000E091300FEE2381F0E150E093300F86E0F6 -:10CFC000E89FF0011124E45FF04F428153816481B6 -:10CFD000758180819181DDC8E5CFAF92BF92CF92FC -:10CFE000DF92EF92FF920F931F93CF93DF935C0139 -:10CFF0007B010E94449FEC01C7010E94529F04E103 -:10D0000010E0081B1109DD270C171D071CF0DD249B -:10D01000D39402C082E0D82E8091B30B90E06D2DA6 -:10D0200070E06F5F7F4F0E946FF2C62EC6E0C60FA2 -:10D030008091E60BC81748F02091E80B30E08C2F68 -:10D0400090E00B97281739079CF5D0E0E114F10424 -:10D05000C1F18AE30E94545082E0D8120FC0CC0D77 -:10D060008091E60BC81768F12091E80B30E08C2F17 -:10D0700090E00B97281739071CF423C0DD2309F132 -:10D08000802F880F080F000F0093E90BC093EA0B65 -:10D0900080E20E945450C701DF91CF911F910F9100 -:10D0A000FF90EF90DF90CF90BF90AF900C94BEC8F0 -:10D0B0001092E90BC093EA0BC5010E945950D1E0D0 -:10D0C000C5CFDF91CF911F910F91FF90EF90DF902F -:10D0D000CF90BF90AF9008959CE0899F802D112440 -:10D0E00091E0980F909317112CE0280F20931811BE -:10D0F0004091E60B50E030E02E5F3F4F241735079C -:10D10000CCF0292F30E04091E80B50E02417350790 -:10D110008CF4662341F08E5F0E9468BB80911811E9 -:10D120008E5F0E9468BB809118111092E90B80936A -:10D13000EA0B08950895CF93DF938F389240B1F0B2 -:10D14000EBE8FFE08491EF012196882321F00E9413 -:10D150000232FE01F7CFEAE8FAE18491EF0121966D -:10D16000882331F00E940232FE01F7CF80E001C037 -:10D1700081E0DF91CF9108950F931F93CF93DF93B9 -:10D1800000D000D0CDB7DEB71A82198282E293E0D8 -:10D190009C838B839E012F5F3F4F4DE150E068E7FA -:10D1A0007BE0CE0103960E94D1D389819A819E8330 -:10D1B0008D8380E293E09C838B839E012F5F3F4FA2 -:10D1C00042E050E0BE016B5F7F4FCE0103960E94AC -:10D1D000D1D308E613E0F80181918F01882319F07B -:10D1E0000E940232F8CF8AE00E94023226960FB6E1 -:10D1F000F894DEBF0FBECDBFDF91CF911F910F918D -:10D2000008958F929F92AF92BF92CF92DF92EF924A -:10D21000FF920F931F93CF93DF93CDB7DEB7CE5915 -:10D22000D1090FB6F894DEBF0FBECDBFE9961CAE94 -:10D230001DAE1EAE1FAEE99780916E0390916F03F5 -:10D24000A0917003B0917103ED968CAF9DAFAEAF1E -:10D25000BFAFED97C157DF4F19821882CF58D0402A -:10D2600084E690E0CF56DF4F99838883C159D04040 -:10D270001092470F9E0121573F4F44E050E0BE01FE -:10D2800067587F4FCE018F569F4F0E94D1D3CF5604 -:10D29000DF4F88819981C159D0400296CF56DF4F28 -:10D2A00099838883C159D040C157DF4F19821882B2 -:10D2B000CF58D04081E0C956DF4F8883C759D0404E -:10D2C0009E0121573F4F41E050E0BE0169567F4F1C -:10D2D000CE018F569F4F0E94D1D39E0121573F4FC1 -:10D2E00040E150E063E272E1CE018F569F4F0E9411 -:10D2F000D1D39E0121573F4F44E050E063E276E0F6 -:10D30000CE018F569F4F0E94D1D39E0121573F4F90 -:10D3100040E150E06BE57BE0CE018F569F4F0E94CD -:10D32000D1D39E0121573F4F40E150E06FE076E0BE -:10D33000CE018F569F4F0E94D1D39E0121573F4F60 -:10D3400044E050E067E076E0CE018F569F4F0E94A8 -:10D35000D1D39E0121573F4F44E050E06BE076E08F -:10D36000CE018F569F4F0E94D1D39E0121573F4F30 -:10D3700044E050E063E076E0CE018F569F4F0E947C -:10D38000D1D39E0121573F4F44E050E06BE376E05C -:10D39000CE018F569F4F0E94D1D39E0121573F4F00 -:10D3A00044E050E067E376E0CE018F569F4F0E9445 -:10D3B000D1D39E0121573F4F40E150E06FED75E022 -:10D3C000CE018F569F4F0E94D1D38AE097EDA3EAFA -:10D3D000BCE3E9968CAF9DAFAEAFBFAFE9979E01BE -:10D3E00021573F4F44E050E0BE016B587F4FCE01C4 -:10D3F0008F569F4F0E94D1D39E0121573F4F4CE043 -:10D4000050E061E174E0CE018F569F4F0E94D1D36E -:10D4100080E090E0A0E2B1E4C358DF4F88839983B5 -:10D42000AA83BB83CD57D0409E0121573F4F44E094 -:10D4300050E0BE0163587F4FCE018F569F4F0E9430 -:10D44000D1D3E9961CAE1DAE1EAE1FAEE99783E0A8 -:10D45000C856DF4F8883C859D040C756DF4F8883EE -:10D46000C959D0409E0121573F4F44E050E0BE01D2 -:10D470006B587F4FCE018F569F4F0E94D1D39E0194 -:10D4800021573F4F41E050E0BE0168567F4FCE012B -:10D490008F569F4F0E94D1D39E0121573F4F41E0AD -:10D4A00050E0BE0167567F4FCE018F569F4F0E94BE -:10D4B000D1D31AE0115071F09E0121573F4F44E043 -:10D4C00050E0BE016B587F4FCE018F569F4F0E9498 -:10D4D000D1D3F0CFCF57DF4F188219821A821B8227 -:10D4E000C158D0409E0121573F4F44E050E0BE015B -:10D4F0006F577F4FCE018F569F4F0E94D1D3E99631 -:10D500001CAE1DAE1EAE1FAEE9971AE0115071F0B1 -:10D510009E0121573F4F44E050E0BE016B587F4FC2 -:10D52000CE018F569F4F0E94D1D3F0CF83E0C656D5 -:10D53000DF4F8883CA59D040C556DF4F8883CB5907 -:10D54000D040CB57DF4F188219821A821B82C558F0 -:10D55000D040C757DF4F188219821A821B82C958E0 -:10D56000D040E9961CAE1DAE1EAE1FAEE9979E01DF -:10D5700021573F4F41E050E0BE0166567F4FCE013C -:10D580008F569F4F0E94D1D39E0121573F4F41E0BC -:10D5900050E0BE0165567F4FCE018F569F4F0E94CF -:10D5A000D1D39E0121573F4F44E050E0BE01675761 -:10D5B0007F4FCE018F569F4F0E94D1D39E0121579E -:10D5C0003F4F44E050E0BE016B577F4FCE018F5676 -:10D5D0009F4F0E94D1D30AE010E00150110971F071 -:10D5E0009E0121573F4F44E050E0BE016B587F4FF2 -:10D5F000CE018F569F4F0E94D1D3EFCFC456DF4F3D -:10D600001882CC59D0408FEFC356DF4F8883CD5955 -:10D61000D0409E0121573F4F41E050E0BE0164568B -:10D620007F4FCE018F569F4F0E94D1D39E0121572D -:10D630003F4F41E050E0BE0163567F4FCE018F5611 -:10D640009F4F0E94D1D39E0121573F4F44E050E0AD -:10D650006BEC75E0CE018F569F4F0E94D1D39E0197 -:10D6600021573F4F44E050E067EC75E0CE018F5604 -:10D670009F4F0E94D1D39E0121573F4F44E050E07D -:10D680006FEC75E0CE018F569F4F0E94D1D310E012 -:10D69000C12C80E8D82E8BE3E82E85E4F82E812C6F -:10D6A000912C90E8A92E9FE3B92E111138C09E014C -:10D6B00021573F4F44E050E06AEB75E0CE018F56B2 -:10D6C0009F4F0E94D1D39E0121573F4F44E050E02D -:10D6D00062EC75E0CE018F569F4F0E94D1D39E0120 -:10D6E00021573F4F44E050E06EEB75E0CE018F567E -:10D6F0009F4F0E94D1D3E9968CAE9DAEAEAEBFAE29 -:10D70000E9979E0121573F4F44E050E0BE016B581E -:10D710007F4FCE018F569F4F0E94D1D32AC0E996EA -:10D72000CCAEDDAEEEAEFFAEE9979E0121573F4F86 -:10D7300044E050E0BE016B587F4FCE018F569F4FA3 -:10D740000E94D1D3E9961CAE1DAE1EAE1FAEE99766 -:10D7500004E0015071F09E0121573F4F44E050E03A -:10D76000BE016B587F4FCE018F569F4F0E94D1D381 -:10D77000F0CF1F5F153009F098CF84E190E0CD56CF -:10D78000DF4F99838883C359D0409E0121573F4F73 -:10D7900042E050E0BE016D567F4FCE018F569F4F45 -:10D7A0000E94D1D39E0121573F4F44E050E06DEBE2 -:10D7B00070E1CE018F569F4F0E94D1D39E01215719 -:10D7C0003F4F44E050E069EB70E1CE018F569F4F30 -:10D7D0000E94D1D39E0121573F4F44E050E065EBBA -:10D7E00070E1CE018F569F4F0E94D1D380E290E02E -:10D7F000CB56DF4F99838883C559D0409E0121576E -:10D800003F4F42E050E0BE016B567F4FCE018F5636 -:10D810009F4F0E94D1D3C256DF4F1882CE59D040BD -:10D8200080E2EBE7F2E0DE019D9601900D928A9591 -:10D83000E1F79E0121573F4F41E050E0BE016256A3 -:10D840007F4FCE018F569F4F0E94D1D39E0121570B -:10D850003F4F40E250E0BE01635D7F4FCE018F56E7 -:10D860009F4F0E94D1D39E0121573F4F41E050E08E -:10D870006BE470E1CE018F569F4F0E94D1D310E030 -:10D8800011110EC08091471090914810A09149103D -:10D89000B0914A10E9968CAF9DAFAEAFBFAFE9979C -:10D8A0009E0121573F4F44E050E0BE016B587F4F2F -:10D8B000CE018F569F4F0E94D1D31F5F153001F7C5 -:10D8C000BE01635B7F4F86E1FB0111928A95E9F708 -:10D8D0009E0121573F4F46E150E0CE018F569F4FAA -:10D8E0000E94D1D38CE2EBE9F2E0DE0111960190C7 -:10D8F0000D928A95E1F79E0121573F4F4CE250E08F -:10D90000BE016F5F7F4FCE018F569F4F0E94D1D3D4 -:10D91000BE0161597F4F86E0FB0111928A95E9F7BC -:10D920009E0121573F4F46E050E0CE018F569F4F5A -:10D930000E94D1D3E9961CAE1DAE1EAE1FAEE99774 -:10D940009E0121573F4F44E050E0BE016B587F4F8E -:10D95000CE018F569F4F0E94D1D3BE016D597F4F8C -:10D960008CE0FB0111928A95E9F79E0121573F4F08 -:10D970004CE050E0CE018F569F4F0E94D1D3E996E4 -:10D980001CAE1DAE1EAE1FAEE9971CE1115071F02A -:10D990009E0121573F4F44E050E0BE016B587F4F3E -:10D9A000CE018F569F4F0E94D1D3F0CFE9961CAE87 -:10D9B0001DAE1EAE1FAEE99714E0115071F09E012E -:10D9C00021573F4F44E050E0BE016B587F4FCE01DE -:10D9D0008F569F4F0E94D1D3F0CFE9961CAE1DAE5B -:10D9E0001EAE1FAEE9971BE0115071F09E0121574A -:10D9F0003F4F44E050E0BE016B587F4FCE018F5641 -:10DA00009F4F0E94D1D3F0CF8091470F811166C004 -:10DA1000CF56DF4FE880F980C159D040F4E6EF1AC5 -:10DA2000F108C157DF4F88819981CF58D040C35743 -:10DA3000DF4F99838883CD58D04084E690E0CF565D -:10DA4000DF4F99838883C159D0409E0121573F4FB2 -:10DA500044E050E067EF72E0CE018F569F4F0E9486 -:10DA6000D1D39E0121573F4F42E050E0BE016357A2 -:10DA70007F4FCE018F569F4F0E94D1D3EAEBFFE03C -:10DA800084918F010F5F1F4F882321F00E94023283 -:10DA9000F801F6CFB70182EB9AE10E94F95DC35716 -:10DAA000DF4F48815981CD58D04060E070E085EA71 -:10DAB0009AE10E94BF5DE2EAFAE184918F010F5F73 -:10DAC0001F4F882321F00E940232F801F6CFC701D0 -:10DAD00032DB9091470F892B8093470F4DDB90915C -:10DAE000470F81E08927C256DF4F0FB6F894DEBF9B -:10DAF0000FBECDBFDF91CF911F910F91FF90EF909F -:10DB0000DF90CF90BF90AF909F908F9008952F920D -:10DB10003F924F925F926F927F928F929F92AF92BD -:10DB2000BF92CF92DF92EF92FF920F931F93CF930A -:10DB3000DF93CDB7DEB7C956D1090FB6F894DEBF73 -:10DB40000FBECDBF8DB69EB66B961FAE1EAE6B9749 -:10DB500084E690E06D969FAF8EAF6D9701E09E01D9 -:10DB6000275A3F4F44E050E0BE01615B7F4FCE013A -:10DB7000855A9F4F0E9484D39E01275A3F4F42E00F -:10DB800050E0BE01635A7F4FCE01855A9F4F0E94DD -:10DB900084D343E050E0BE01615B7F4F87EF92E0AA -:10DBA0000E940EF3892B09F43FC063968FAD6397F3 -:10DBB000882339F08FE360968FAF609761961FAE30 -:10DBC0006197EAEBFFE084918F010F5F1F4F811196 -:10DBD00003C0EDEBFBE104C00E940232F801F3CF79 -:10DBE00084918F010F5F1F4F882321F00E94023222 -:10DBF000F801F6CFBE01615B7F4F84EB9BE10E9491 -:10DC0000125EE6EAFBE184918F010F5F1F4F8823CC -:10DC100021F00E940232F801F6CF81E08093470F95 -:10DC20000E94FD7AEEDAE2C42DB63EB62F961CAE07 -:10DC30001DAE1EAE1FAE2F976B961FAE1EAE6B971E -:10DC400001E09E01275A3F4F41E050E0BE016C5970 -:10DC50007F4FCE01855A9F4F0E9484D380E1E7EC2D -:10DC6000F2E0DE01919601900D928A95E1F780E154 -:10DC7000E7EDF2E0DE01519601900D928A95E1F711 -:10DC800080E1E7EEF2E0DE01119601900D928A95B7 -:10DC9000E1F7A5964FADA59750E04D5F5F4F440F5C -:10DCA000551F440F551F2DB73EB7241B350B0FB61C -:10DCB000F8943EBF0FBE2DBF8DB79EB701963C01B5 -:10DCC00000E09E01275A3F4FBC01CE01855A9F4F6D -:10DCD0000E9484D39E01275A3F4F44E050E063E204 -:10DCE00076E0CE01855A9F4F0E9484D3A596AFACB3 -:10DCF000A597B12C93E0A90EB11CAA0CBB1CAA0CD1 -:10DD0000BB1CEDB7FEB7EA19FB090FB6F894FEBFCE -:10DD10000FBEEDBF2DB73EB72F5F3F4F79018DB7D7 -:10DD20009EB78A199B090FB6F8949EBF0FBE8DBF90 -:10DD3000EDB7FEB731966F019E01275A3F4FA501FF -:10DD4000B701CE01855A9F4F0E9484D39E01275A66 -:10DD50003F4FA501B601CE01855A9F4F0E9484D343 -:10DD60008091480F882309F4A3C000E09E01275A40 -:10DD70003F4F44E050E067E076E0CE01855A9F4F88 -:10DD80000E9484D39E01275A3F4F44E050E06BE04D -:10DD900076E0CE01855A9F4F0E9484D39E01275A78 -:10DDA0003F4F44E050E063E076E0CE01855A9F4F5C -:10DDB0000E9484D39E01275A3F4F44E050E06BE31A -:10DDC00076E0CE01855A9F4F0E9484D39E01275A48 -:10DDD0003F4F44E050E067E376E0CE01855A9F4F25 -:10DDE0000E9484D39E01275A3F4F40E150E06FEDDF -:10DDF00075E0CE01855A9F4F0E9484D39E01275A19 -:10DE00003F4F44E050E0BE01655B7F4FCE01855A35 -:10DE10009F4F0E9484D39E01275A3F4F4CE050E011 -:10DE200061E174E0CE01855A9F4F0E9484D39E0128 -:10DE3000275A3F4F44E050E0BE01655B7F4FCE0163 -:10DE4000855A9F4F0E9484D39E01275A3F4F44E03A -:10DE500050E0BE01655B7F4FCE01855A9F4F0E9407 -:10DE600084D301E09E01275A3F4F41E050E0BE01BC -:10DE70006D597F4FCE01855A9F4F0E9484D39E01DA -:10DE8000275A3F4F41E050E0BE016E597F4FCE010F -:10DE9000855A9F4F0E9484D3A4968FADA497A396D2 -:10DEA000CFACA3978C9D60011124E12CF12C7CC098 -:10DEB000A5968FADA59790E002962FE036E0A89644 -:10DEC0003FAF2EAFA897B601AE014F5F5F4F2BE576 -:10DED000A22E2BE0B22ED7017E0131E1E30EF11C20 -:10DEE00033E2C32E32E1D32EAA967FAE6EAEAA974E -:10DEF0008E010F5D1F4F20E030E0821793072CF05A -:10DF0000AA96EEADFFADAA9701C0F80140805180FE -:10DF100062807380F60141925192619271926F0119 -:10DF20008217930734F04D905D906D907C9013971D -:10DF300005C0F7014080518062807380F5014192F5 -:10DF40005192619271925F018217930714F0FB0165 -:10DF500001C0FA014080518062807380A896EEADC6 -:10DF6000FFADA8974192519261927192A896FFAF2E -:10DF7000EEAFA8972F5F3F4F6C5F7F4F4C5F5F4FB7 -:10DF80001496F4E0EF0EF11CAA96EEADFFADAA9741 -:10DF90003496AA96FFAFEEAFAA970C5F1F4F2430BE -:10DFA000310509F0AACFE1CE00E09E01275A3F4F8C -:10DFB00044E050E0BE01EC14FD0459F0655B7F4F76 -:10DFC000CE01855A9F4F0E9484D3FFEFEF1AFF0ABC -:10DFD000EBCF695B7F4FCE01855A9F4F0E9484D360 -:10DFE0001AE0115079F000E09E01275A3F4F44E0BB -:10DFF00050E0BE01655B7F4FCE01855A9F4F0E9466 -:10E0000084D3EFCF01E09E01275A3F4F41E050E01B -:10E01000BE016F597F4FCE01855A9F4F0E9484D316 -:10E020009E01275A3F4F41E050E0BE01605A7F4FAA -:10E03000CE01855A9F4F0E9484D300E09E01275A4B -:10E040003F4F44E050E0BE01635C7F4FCE01855AF4 -:10E050009F4F0E9484D39E01275A3F4F44E050E0D7 -:10E06000BE016F5C7F4FCE01855A9F4F0E9484D3C3 -:10E07000A2968FADA297A196CFACA1978C9D60017F -:10E080001124E12CF12C00E09E01275A3F4FCE14C1 -:10E09000DF0471F044E050E0BE01655B7F4FCE01CC -:10E0A000855A9F4F0E9484D32FEFE21AF20AEBCFDA -:10E0B00041E050E0BE016B597F4FCE01855A9F4F22 -:10E0C0000E9484D39E01275A3F4F41E050E0BE0199 -:10E0D000615A7F4FCE01855A9F4F0E9484D39E0183 -:10E0E000275A3F4F44E050E06BEC75E0CE01855A73 -:10E0F0009F4F0E9484D39E01275A3F4F44E050E037 -:10E1000067EC75E0CE01855A9F4F0E9484D39E0133 -:10E11000275A3F4F44E050E06FEC75E0CE01855A3E -:10E120009F4F0E9484D310E000E09E01275A3F4F8A -:10E1300044E050E0BE01655B7F4FCE01855A9F4FA2 -:10E140000E9484D3111110C02F96CCACDDACEEAC84 -:10E15000FFAC2F9720E030E84BE355E4C701B60150 -:10E160000E946DEB811103C084E0F82E33C08091D2 -:10E17000480F811108C0C092BA05D092BB05E09249 -:10E18000BC05F092BD0500E09E01275A3F4F44E0D8 -:10E1900050E062EC75E0CE01855A9F4F0E9484D317 -:10E1A0009E01275A3F4F44E050E06EEB75E0CE01F0 -:10E1B000855A9F4F0E9484D39E01275A3F4F44E0C7 -:10E1C00050E0BE01655B7F4FCE01855A9F4F0E9494 -:10E1D00084D312C0FA94FF2079F000E09E01275A00 -:10E1E0003F4F44E050E0BE01655B7F4FCE01855A52 -:10E1F0009F4F0E9484D3EECF1F5F153009F094CF5C -:10E2000000E09E01275A3F4F42E050E0BE01695AAC -:10E210007F4FCE01855A9F4F0E9484D39E01275A7B -:10E220003F4F44E050E0BE01655B7F4FCE01855A11 -:10E230009F4F0E9484D32F96CCACDDACEEACFFACEC -:10E240002F9720E030E84BE355E4C701B6010E9468 -:10E250006DEB882329F18091480F811108C0C0928D -:10E26000BD10D092BE10E092BF10F092C01000E03E -:10E270009E01275A3F4F44E050E069EB70E1CE0128 -:10E28000855A9F4F0E9484D39E01275A3F4F44E0F6 -:10E2900050E065EB70E1CE01855A9F4F0E9484D318 -:10E2A00000E09E01275A3F4F42E050E0BE016B5A0A -:10E2B0007F4FCE01855A9F4F0E9484D39E01275ADB -:10E2C0003F4F41E050E0BE016B597F4FCE01855A70 -:10E2D0009F4F0E9484D319E0115000E09E01275AFD -:10E2E0003F4F112359F044E050E0BE01655B7F4F82 -:10E2F000CE01855A9F4F0E9484D3EECF41E050E07B -:10E300006BE470E1CE01855A9F4F0E9484D310E0E8 -:10E3100000E09E01275A3F4F44E050E0BE01655B9C -:10E320007F4FCE01855A9F4F0E9484D38091480F22 -:10E33000811110C011110EC02F968CAD9DADAEADE8 -:10E34000BFAD2F978093471090934810A09349102A -:10E35000B0934A101F5F1530D9F61CE0115011F42C -:10E360001CE00FC000E09E01275A3F4F42E050E002 -:10E37000BE016D5A7F4FCE01855A9F4F0E9484D3B4 -:10E38000EDCF115000E09E01275A3F4F112359F065 -:10E3900044E050E0BE016D5B7F4FCE01855A9F4F38 -:10E3A0000E9484D3EECF46E050E0BE01635C7F4F15 -:10E3B000CE01855A9F4F0E9484D39E01275A3F4F1A -:10E3C00044E050E0BE01655B7F4FCE01855A9F4F10 -:10E3D0000E9484D39E01275A3F4F4CE050E0BE017B -:10E3E0006F5C7F4FCE01855A9F4F0E9484D31CE102 -:10E3F000115011F414E01DC000E09E01275A3F4F58 -:10E4000044E050E0BE01655B7F4FCE01855A9F4FCF -:10E410000E9484D3EDCF00E09E01275A3F4F44E095 -:10E4200050E0BE01655B7F4FCE01855A9F4F0E9431 -:10E4300084D3115081F71BE0115079F000E09E0168 -:10E44000275A3F4F44E050E0BE01655B7F4FCE014D -:10E45000855A9F4F0E9484D3EFCF6D968EAD9FADAE -:10E460006D97845691090E949B688093470F88237B -:10E4700001F1EAEBFFE084918F010F5F1F4F8823CA -:10E4800021F00E940232F801F6CF6D966EAD7FAD9D -:10E490006D97645671098EE99BE10E94F95D6FE802 -:10E4A00072E086E99BE10E94F95D8AE00E940232F7 -:10E4B0008EC06B962EAD3FAD6B976F968EAD9FADB8 -:10E4C0006F972817390709F447C081E08093470FF9 -:10E4D000EBE8FFE084918F010F5F1F4F811103C0B4 -:10E4E000E6E7FBE104C00E940232F801F3CF849119 -:10E4F0008F010F5F1F4F882321F00E940232F80125 -:10E50000F6CF6F966EAD7FAD6F9780E090E04AE0FA -:10E510000E943E35E1E7FBE184918F010F5F1F4FC1 -:10E52000882321F00E940232F801F6CF6B966EAD7F -:10E530007FAD6B9780E090E04AE00E943E35E1E6D7 -:10E54000FBE184918F010F5F1F4F882309F43FC0C7 -:10E550000E940232F801F5CF8091480F811141C02D -:10E56000EAEBFFE084918F010F5F1F4F811103C021 -:10E5700007EF12E004C00E940232F801F3CFF80165 -:10E5800081918F01882319F00E940232F8CF6D9695 -:10E590006EAD7FAD6D976456710984E49BE10E9476 -:10E5A000F95D6B964EAD5FAD6B9760E070E087E311 -:10E5B0009BE10E94BF5DE4E3FBE184918F010F5F6B -:10E5C0001F4F882321F00E940232F801F6CF80917C -:10E5D000480F811106C08091470F811102C00E942F -:10E5E00045D40FB6F8943EBE0FBE2DBE8091480FA5 -:10E5F000811101C0FFD31AA219A280E293E09A838D -:10E60000898300E09E012F5D3F4F42E050E0BE0154 -:10E610006F5E7F4FCE0101960E9484D31AA219A289 -:10E620009E012F5D3F4F4DE150E068E77BE0CE015A -:10E6300001960E9484D349A15AA189899A894817D1 -:10E64000590779F5EAEBFFE084918F010F5F1F4FC7 -:10E65000882321F00E940232F801F6CF69817A8185 -:10E66000605273408FE09BE10E94F95D49A15AA17D -:10E6700060E070E082E09BE10E94BF5DEFEFFAE1B5 -:10E6800084918F010F5F1F4F882321F00E94023277 -:10E69000F801F6CF68E77BE08EEE9AE10E94125E09 -:10E6A0000EC060E070E089ED9AE10E94BF5D49898B -:10E6B0005A8960E070E084EC9AE10E94BF5D90911D -:10E6C000470F81E089270FB6F8949EBE0FBE8DBE1E -:10E6D000C759DF4F0FB6F894DEBF0FBECDBFDF9135 -:10E6E000CF911F910F91FF90EF90DF90CF90BF904F -:10E6F000AF909F908F907F906F905F904F903F90E2 -:10E700002F900895CF92DF92EF92FF9280914B105D -:10E71000882371F1C0904710D0904810E0904910C4 -:10E72000F0904A1020E030E0A901C701B6010E9434 -:10E730006DEB8823E9F020E030E040E05FE3C701C3 -:10E74000B6010E94D2EB9B01AC010E94D2EB2BEDF3 -:10E750003FE049E450E40E94D2EB9B01AC0160E051 -:10E7600070E080E89FE30E9473F06B017C0106C0BB -:10E77000C12CD12C80E8E82E8FE3F82EC0923A12FB -:10E78000D0923B12E0923C12F0923D1260914B020B -:10E7900070914C02072E000C880B990B0E9473EBB2 -:10E7A0002AE037ED43E25CE30E94D2EBA701960139 -:10E7B0000E94D2EB609314027093150280931602AC -:10E7C00090931702FF90EF90DF90CF900895CF9332 -:10E7D000DF9390916F00292F227091FF05C09091D7 -:10E7E0006F009D7F90936F0094E0899FA00111249A -:10E7F000FA01EB55FF4E6081718182819381222362 -:10E8000029F020916F00226020936F00EA01C95D1A -:10E81000D94F0E9473EB288139814A815B810E9424 -:10E82000D2EBDF91CF9108959091EF0B8091F00B97 -:10E83000981306C080916B0B90916C0B892B19F08B -:10E840000E948990F1CF0C941590CF93DF93909113 -:10E850006F00292F227091FF05C090916F009D7F5E -:10E8600090936F0094E0899FA0011124FA01E7566C -:10E87000FF4E6081718182819381222329F0209152 -:10E880006F00226020936F00EA01C95DD94F0E949A -:10E8900073EB288139814A815B810E94D2EBDF9141 -:10E8A000CF9108954F925F926F927F928F929F9235 -:10E8B000AF92BF92CF92DF92EF92FF920F931F938E -:10E8C000CF93DF93CDB7DEB768970FB6F894DEBF6E -:10E8D0000FBECDBF8C015B015A834983DC01D79603 -:10E8E0006D917D918D919C91DA970E9471EB6B01F6 -:10E8F0007C01F50120813181428153810E94D2EB5C -:10E900000E945DF00E94E0F069877A878B879C8780 -:10E91000A981BA812D913D914D915C91C701B601BC -:10E920000E94D2EB0E945DF00E94E0F06D877E872E -:10E930008F87988B29853A854B855C8528373105EB -:10E940004105510540F488E790E0A0E0B0E08987F8 -:10E950009A87AB87BC872D853E854F855889283798 -:10E9600031054105510540F488E790E0A0E0B0E0B2 -:10E970008D879E87AF87B88BF801ED5BFF4F2081B5 -:10E9800031814281538129833A834B835C83CA015D -:10E99000B9010E9473EB2B013C0169857A858B8557 -:10E9A0009C850E9471EB698B7A8B8B8B9C8B20E012 -:10E9B00030E0A901C301B2010E946DEB882329F167 -:10E9C000A7019601C701B6010E94D2EB4B015C0181 -:10E9D00029893A894B895C89CA01B9010E94D2EB25 -:10E9E0009B01AC01C501B4010E9496EF4B015C0193 -:10E9F000A3019201C301B2010E9497EF9B01AC01F8 -:10EA0000C501B4010E9473F003C060E070E0CB0167 -:10EA10000E945DF00E94E0F06D837E838F83988773 -:10EA200069817A818B819C819095809570956195A3 -:10EA30007F4F8F4F9F4F0E9473EB4B015C016D85A1 -:10EA40007E858F8598890E9471EB69837A838B8399 -:10EA50009C8320E030E0A901C501B4010E946DEB68 -:10EA6000882349F129813A814B815C81CA01B9012E -:10EA70000E94D2EB6D8B7E8B8F8B988FA7019601B6 -:10EA8000C701B6010E94D2EB9B01AC016D897E8962 -:10EA90008F89988D0E9496EF6B017C01A5019401EE -:10EAA000C501B4010E9497EF9B01AC01C701B601FB -:10EAB0000E9473F003C060E070E0CB010E940CF193 -:10EAC000D80195968D909D90AD90BC9098977501CA -:10EAD00064012D813E814F815885C21AD30AE40A10 -:10EAE000F50A0E94E0F0C61AD70AE80AF90AF7FE0A -:10EAF00075C020E030E0A901C301B2010E946DEBB6 -:10EB0000882309F443C0C501B4010E9471EB6B0175 -:10EB10007C01A3019201C301B2010E9497EF9B0106 -:10EB2000AC01C701B6010E94D2EB6B017C012989BF -:10EB30003A894B895C89CA01B9010E94D2EB9B01D9 -:10EB4000AC01C701B6010E9496EF6B017C012981DF -:10EB50003A814B815C81CA01B9010E94D2EB9B01D1 -:10EB6000AC01C701B6010E9497EF6B017C0120E068 -:10EB700030E040E850E4C301B2010E94D2EB9B01B7 -:10EB8000AC01C701B6010E9473F003C060E070E001 -:10EB9000CB010E945DF07B018D83998320E030E002 -:10EBA000A9010E94BDF1181624F0E12CF12C1D8260 -:10EBB0001982B7018D8199810E94E0F06D837E8377 -:10EBC0008F83988786169706A806B90620F48D824B -:10EBD0009E82AF82B886C12CD12C76018D819E8118 -:10EBE000AF81B885F80182A793A7A4A7B5A7C80EDF -:10EBF000D91EEA1EFB1EC6A6D7A6E0AAF1AA298541 -:10EC00003A854B855C8523AF34AF45AF56AFFF9651 -:10EC10002D853E854F8558892083318342835383D8 -:10EC200068960FB6F894DEBF0FBECDBFDF91CF91CF -:10EC30001F910F91FF90EF90DF90CF90BF90AF901A -:10EC40009F908F907F906F905F904F9008958091EC -:10EC50006F00982F927081FF05C080916F008D7FAB -:10EC600080936F0010921F061092200610922106CA -:10EC700010922206992329F080916F008260809380 -:10EC80006F0008958091490F1E9902C0816001C0F4 -:10EC90008E7F8093490F8091490F1D9902C0826039 -:10ECA00001C08D7F8093490F8091490F1C9902C04C -:10ECB000846001C08B7F8093490F8091BA0E80FFE2 -:10ECC00010C08091B90E80FF0CC08091490F80FF69 -:10ECD00008C08091320481608093320480E00E94F9 -:10ECE0009EB98091BA0E81FF10C08091B90E81FF4C -:10ECF0000CC08091490F81FF08C08091320482606E -:10ED00008093320481E00E949EB98091BA0E82FF06 -:10ED100010C08091B90E82FF0CC08091490F82FF14 -:10ED200008C08091320484608093320482E00C94A5 -:10ED30009EB90895CF93DF93E6E9FEE18491EF0158 -:10ED40002196882321F00E940232FE01F7CFEEE8DF -:10ED5000FEE18491EF012196882321F00E94023286 -:10ED6000FE01F7CF1E9B03C0C2E7D3E002C0C7E796 -:10ED7000D3E08991882319F00E940232FACF8AE009 -:10ED80000E940232E6E8FEE18491EF012196882399 -:10ED900021F00E940232FE01F7CF1D9B03C0C2E7A3 -:10EDA000D3E002C0C7E7D3E08991882319F00E941D -:10EDB0000232FACF8AE00E940232EEE7FEE184914D -:10EDC000EF012196882321F00E940232FE01F7CF45 -:10EDD0001C9B03C0C2E7D3E002C0C7E7D3E0899120 -:10EDE000882319F00E940232FACF8AE0DF91CF9196 -:10EDF0000C9402328F929F92AF92BF92CF92DF9289 -:10EE0000EF92FF920F931F93CF93C82F882319F08F -:10EE1000E3E7FEE10CC0EAEBFFE084918F010F5FB6 -:10EE20001F4F8823A9F30E940232F801F6CF849184 -:10EE30008F010F5F1F4F882321F00E940232F801DB -:10EE4000F6CFE9E2FCE184918F010F5F1F4F882329 -:10EE500021F00E940232F801F6CF8AE00E940232CD -:10EE6000CC2319F0E6E5FEE10CC0EAEBFFE084916B -:10EE70008F010F5F1F4F8823A9F30E940232F80110 -:10EE8000F6CF84918F010F5F1F4F882321F00E94DE -:10EE90000232F801F6CF8AE00E940232C1112CC082 -:10EEA000EAEBFFE084918F010F5F1F4F882321F071 -:10EEB0000E940232F801F6CFE3E4FEE184918F0173 -:10EEC0000F5F1F4F882321F00E940232F801F6CF16 -:10EED00080914B10882321F08AE00E9402323AC0D0 -:10EEE000E8E3FEE184918F010F5F1F4F882391F1CA -:10EEF0000E940232F801F6CF40914710509148101D -:10EF00006091491070914A108FE29EE10E94DC5D91 -:10EF10008AE00E94023280914B10811127C0CC23DD -:10EF200019F0E4E2FEE10CC0EAEBFFE084918F010E -:10EF30000F5F1F4F8823A9F30E940232F801F6CF1A -:10EF400084918F010F5F1F4F882381F00E9402324E -:10EF5000F801F6CFEAEBFFE084918F010F5F1F4FBE -:10EF6000882351F20E940232F801F6CFC11124C069 -:10EF7000EAEBFFE084918F010F5F1F4F882321F0A0 -:10EF80000E940232F801F6CFE3E1FEE184918F01A5 -:10EF90000F5F1F4F882321F00E940232F801F6CF45 -:10EFA000EAEBFFE084918F010F5F1F4F882321F070 -:10EFB0000E940232F801F6CF40915B0B50915C0B3E -:10EFC00060915D0B70915E0B8BE09EE10E94DC5DB9 -:10EFD00040915F0B5091600B6091610B7091620BDF -:10EFE00088E09EE10E94DC5D4091630B5091640BD0 -:10EFF0006091650B7091660B85E09EE10E94DC5D7F -:10F000004091670B5091680B6091690B70916A0B8E -:10F0100082E09EE10E94DC5D8AE00E940232C11122 -:10F0200024C0EAEBFFE084918F010F5F1F4F88231C -:10F0300021F00E940232F801F6CFE4EEFDE1849166 -:10F040008F010F5F1F4F882321F00E940232F801C9 -:10F05000F6CFEAEBFFE084918F010F5F1F4F88230B -:10F0600021F00E940232F801F6CF40910F06509134 -:10F07000100660911106709112068BED9DE10E94C1 -:10F08000DC5D409113065091140660911506709155 -:10F09000160688ED9DE10E94DC5D409117065091B7 -:10F0A00018066091190670911A0685ED9DE10E947F -:10F0B000DC5D40911B0650911C0660911D0670910D -:10F0C0001E0682ED9DE10E94DC5D8AE00E94023214 -:10F0D000C11124C0EAEBFFE084918F010F5F1F4F45 -:10F0E000882321F00E940232F801F6CFE0EBFDE127 -:10F0F00084918F010F5F1F4F882321F00E940232FD -:10F10000F801F6CFEAEBFFE084918F010F5F1F4F0C -:10F11000882321F00E940232F801F6CF4091231299 -:10F1200050912412609125127091261287EA9DE178 -:10F130000E94BF5D409127125091281260912912C0 -:10F1400070912A1284EA9DE10E94BF5D40912B12CA -:10F1500050912C1260912D1270912E1281EA9DE136 -:10F160000E94BF5D40912F12509130126091311278 -:10F17000709132128EE99DE10E94BF5D8AE00E948B -:10F180000232C11124C0EAEBFFE084918F010F5FCE -:10F190001F4F882321F00E940232F801F6CFE4E5E8 -:10F1A000FDE184918F010F5F1F4F882321F00E94A2 -:10F1B0000232F801F6CFEAEBFFE084918F010F5F96 -:10F1C0001F4F882321F00E940232F801F6CF4091B0 -:10F1D0000706509108066091090670910A068BE4B3 -:10F1E0009DE10E94DC5D40910B0650910C06609100 -:10F1F0000D0670910E0688E49DE10E94DC5D409151 -:10F20000030650910406609105067091060685E498 -:10F210009DE10E94DC5D8AE00E940232C1113FC084 -:10F22000EAEBFFE084918F010F5F1F4F882321F0ED -:10F230000E940232F801F6CFEDEFFCE184918F01DC -:10F240000F5F1F4F882321F00E940232F801F6CF92 -:10F25000E2EDFCE184918F010F5F1F4F882321F0C5 -:10F260000E940232F801F6CFE3ECFCE184918F01B9 -:10F270000F5F1F4F882321F00E940232F801F6CF62 -:10F280008AE00E940232EAEBFFE084918F010F5F77 -:10F290001F4F882321F00E940232F801F6CF4091DF -:10F2A00023065091240660912506709126068AEB6C -:10F2B0009CE10E94BF5D40913B0650913C066091ED -:10F2C0003D0670913E0687EB9CE10E94DC5D40911B -:10F2D0003706509138066091390670913A0684EBF2 -:10F2E0009CE10E94DC5D4091DF055091E00560915A -:10F2F000E1057091E20581EB9CE10E94DC5D4091AB -:10F30000E3055091E4056091E5057091E6058EEA0C -:10F310009CE10E94DC5D4091E7055091E805609119 -:10F32000E9057091EA058BEA9CE10E94DC5D409161 -:10F33000EB055091EC056091ED057091EE0588EAC2 -:10F340009CE10E94DC5D8AE00E940232C11124C06F -:10F35000EAEBFFE084918F010F5F1F4F882321F0BC -:10F360000E940232F801F6CFEAE9FCE184918F01B4 -:10F370000F5F1F4F882321F00E940232F801F6CF61 -:10F38000EAEBFFE084918F010F5F1F4F882321F08C -:10F390000E940232F801F6CF4091110450911204FC -:10F3A000609113047091140481E99CE10E94DC5D7A -:10F3B000409115045091160460911704709118043F -:10F3C0008EE89CE10E94DC5D4091190450911A0482 -:10F3D00060911B0470911C048BE89CE10E94DC5D31 -:10F3E0008AE00E940232CC2379F08BECA82E85E0D3 -:10F3F000B82E97ECC92E95E0D92E2FECE22E25E001 -:10F40000F22E00E010E03DC0EAEBFFE084918F01B6 -:10F410000F5F1F4F882321F00E940232F801F6CFC0 -:10F42000EEE6FCE184918F010F5F1F4F8823E9F224 -:10F430000E940232F801F6CFB80185E69CE10E94F5 -:10F44000F95DF501619171915F0182E69CE10E9495 -:10F45000F95DF601619171916F018FE59CE10E9468 -:10F46000F95DF701619171917F018CE59CE10E944A -:10F47000F95D8AE00E9402320F5F1F4F02301105D2 -:10F4800079F0C111D9CFEAEBFFE084914F019FEFF2 -:10F49000891A990A882381F20E940232F401F5CF79 -:10F4A000C11124C0EAEBFFE084918F010F5F1F4F71 -:10F4B000882321F00E940232F801F6CFEDE4FCE14E -:10F4C00084918F010F5F1F4F882321F00E94023229 -:10F4D000F801F6CFEAEBFFE084918F010F5F1F4F39 -:10F4E000882321F00E940232F801F6CF4091BA053C -:10F4F0005091BB056091BC057091BD0584E49CE111 -:10F500000E94DC5D2CEA35EC47E25EE36091C205C7 -:10F510007091C3058091C4059091C5050E9473F058 -:10F52000AB01BC0181E49CE10E94DC5D2CEA35EC7E -:10F5300047E25EE36091BE057091BF058091C00512 -:10F540009091C1050E94D2EBAB01BC018EE39CE11E -:10F550000E94DC5D8AE00E940232C1110CC0EAEB1D -:10F56000FFE084918F010F5F1F4F882321F00E94DD -:10F570000232F801F6CF4091BD105091BE1060915B -:10F58000BF107091C01085E39CE10E94DC5D2CEA05 -:10F5900035EC47E25EE36091B9107091BA1080914A -:10F5A000BB109091BC100E9473F0AB01BC0182E3D0 -:10F5B0009CE10E94DC5D2CEA35EC47E25EE3609161 -:10F5C000B5107091B6108091B7109091B8100E944C -:10F5D000D2EBAB01BC018FE29CE10E94DC5D8AE0D2 -:10F5E000CF911F910F91FF90EF90DF90CF90BF9040 -:10F5F000AF909F908F900C940232CF93DF932BE5C6 -:10F600003BE0CFE0D6E0A3E2B2E180E090E0FC0195 -:10F61000E75EF34E4591559165917491F9014193DF -:10F620005193619371939F01FC01E75FF34E459104 -:10F630005591659174914993599369937993FC011C -:10F64000E750F44E45915591659174914D935D93BA -:10F650006D937D93049680319105C9F680E29EE416 -:10F66000A0E0B0E08093230690932406A0932506A3 -:10F67000B093260680E090E0AAE7B4E48093070602 -:10F6800090930806A0930906B0930A0680930B0690 -:10F6900090930C06A0930D06B0930E06809303067C -:10F6A00090930406A0930506B093060610923B06BD -:10F6B00010923C0610923D0610923E0610923706BC -:10F6C000109238061092390610923A0680E090E0C7 -:10F6D000A0EAB1E48093DF059093E005A093E105F3 -:10F6E000B093E2058093E3059093E405A093E505CC -:10F6F000B093E6058DEC9CECACECBEE38093E705A3 -:10F700009093E805A093E905B093EA0580E090E0C6 -:10F71000A0EAB0E48093EB059093EC05A093ED058F -:10F72000B093EE058CE0E1E1F4E0DF011D928A95F3 -:10F73000E9F784EB90E09093CC058093CB0580EFC4 -:10F7400090E09093CE058093CD0586E490E0909371 -:10F75000C8058093C7058EE690E09093CA05809314 -:10F76000C9051092D0051092CF051092D2051092C3 -:10F77000D1058AE999E9A1EBB1E48093BA059093A8 -:10F78000BB05A093BC05B093BD0586EA91E3A5E354 -:10F79000BEE38093C2059093C305A093C405B093C4 -:10F7A000C50580E493EFADE2B4E48093BE05909389 -:10F7B000BF05A093C005B093C10580E090E0A8EC20 -:10F7C000B2E48093BD109093BE10A093BF10B0938D -:10F7D000C0108CE09EEAA2E5BFE38093B91090933D -:10F7E000BA10A093BB10B093BC1080E790E0A9EED4 -:10F7F000B4E48093B5109093B610A093B710B09373 -:10F80000B81010924B1080E090E0A0EEBFE3809320 -:10F81000471090934810A0934910B0934A1010924B -:10F82000100410920F040E9445D4EAEBFFE084918B -:10F83000EF012196882321F00E940232FE01F7CFCA -:10F84000E6EDFBE18491EF012196882321F00E94EF -:10F850000232FE01F7CFDF91CF91089581E08093CE -:10F86000480F0E94876D1092480F81110C94876D8C -:10F87000C4DE81E00895CF9380916F00C82FC270DD -:10F8800081FF05C080916F008D7F80936F00809114 -:10F89000F00B8093EF0B8093EE0B8093ED0B84E6DF -:10F8A0008093EC0BD4D988EE93E090936C0B80930B -:10F8B0006B0BCC2329F080916F00826080936F00E6 -:10F8C00081E0809398100E94165F80E00E94E773A9 -:10F8D00060934A0F70934B0F80934C0F90934D0F92 -:10F8E00081E00E94E77360934E0F70934F0F8093F7 -:10F8F000500F9093510F82E00E94E7736093520F74 -:10F900007093530F8093540F9093550F8CE0EAE45B -:10F91000FFE0ADE1B4E001900D928A95E1F7CF915F -:10F920000C940C302F923F924F925F926F927F9285 -:10F930008F929F92AF92BF92CF92DF92EF92FF92FF -:10F940000F931F93CF93DF93CDB7DEB7C554D10983 -:10F950000FB6F894DEBF0FBECDBF85E40E947131B3 -:10F96000882321F00E94C5307B0102C0E12CF12CDC -:10F9700083E40E947131882321F00E94C5306AA37C -:10F9800002C005E00AA385E50E947131882319F0C1 -:10F990000E94E63003C085E50E9428318CA7F7FC61 -:10F9A00007C0812C912C16E1A12E13E4B12E06C0C4 -:10F9B000812C912CBCE8AB2EB2E4BB2E83E50E94D7 -:10F9C0007131882321F00E94F5304B015C01E11474 -:10F9D000F10411F410925B10E9820E94EDDB2B011F -:10F9E0003C01198117FD03C008E210E002C00CE3DE -:10F9F00010E061E06E0D623080F0EBECF0E284919B -:10FA00008F010F5F1F4F1B830A83882309F48FC464 -:10FA10000E940232EA81FB81F2CFE5EFF0E28491AD -:10FA20007F012FEFE21AF20A882321F00E940232AE -:10FA3000F701F5CF0E9453AA398137FF04C08FE741 -:10FA400080935A1008C04981E42F440FFF0BE75AF6 -:10FA5000FF4E8FE78083C501B4010E94DBF0072EC3 -:10FA6000000C880B990B0E9473EB6A877B878C874D -:10FA70009D879801A8EEB3E00E9487EF6DA77EA74F -:10FA80008FA798ABDC01CB01840D951DA61DB71D7A -:10FA90008AAF9BAFACAFBDAF81E080930602098116 -:10FAA0000F3F39F405E310E21FAF0EAF0FEF1FE178 -:10FAB00006C003E210E21FAF0EAF0CEE1FE122966C -:10FAC0001FAF0EAF22974CA25DA26EA27FA249AAE1 -:10FAD0005AAA6BAA7CAA1DAA1EAA1FAA18AE19AE02 -:10FAE000188E10E4198F0CE10A8F16E41B8F1C8E00 -:10FAF0001D8E1E8E1F8E1C8A1D8A1E8A1F8A188AC2 -:10FB0000198A1A8A1B8AC12CD12C76012FE730E082 -:10FB100040E050E02E833F8348875987FFE78F2ED0 -:10FB2000912CA12CB12C18A619A61AA61BA611E07F -:10FB30001F861E8625961FAE2597212C312C2696D2 -:10FB40001FAE26970981802F000F990B9C01275A21 -:10FB50003F4E24963FAF2EAF2497880F991F880FF2 -:10FB6000991FAC014A5B594F59A348A38AA1082E9B -:10FB7000000C990B9BA38AA380910602882309F4A9 -:10FB80006EC20E94EDDB6A837B838C839D838091B0 -:10FB90005810882309F4BDC00E9493AD098107FD68 -:10FBA0000CC0A8A1B9A1BC912596BFAF2597E8A12B -:10FBB000F9A12180328003810BC00091040F2596AA -:10FBC0000FAF25972090050F3090060F0091070F7B -:10FBD00026960FAF269725962FAD2597322D432DCC -:10FBE00026965FAD26976C8D7D8D8E8D9F8D0E94A4 -:10FBF0006DEB87FF0AC025960FAD25970C8F2D8ED4 -:10FC00003E8E26960FAD26970F8F288D398D4A8D03 -:10FC10005B8D25966FAD2597722D832D26969FAD12 -:10FC200026970E946DEB87FF0AC025960FAD25979A -:10FC3000088F298E3A8E26960FAD26970B8F259624 -:10FC40002FAD2597322D432D26965FAD26976A85D9 -:10FC50007B858C859D85112309F443C00E946DEB43 -:10FC600087FF57C04A815B816C817D8144195509AA -:10FC700066097709DB01CA0188589341A109B109D6 -:10FC8000B7FD47C0D501C4010E811F812885398584 -:10FC9000801B910BA20BB30B1981B595A795979576 -:10FCA000879517FF03C080935A1005C02496EEADC8 -:10FCB000FFAD2497808348A759A76AA77BA70A8529 -:10FCC0000C8F1B851D8F0C850E8F1D851F8F2A8124 -:10FCD0003B814C815D812CA33DA34EA35FA310E02B -:10FCE00018C00E94BDF11816A4F48A819B81AC81D2 -:10FCF000BD812CA13DA14EA15FA1821B930BA40B42 -:10FD0000B50BAC01BD01485853416109710977FF3A -:10FD1000C1C120E030E040EA51E46A857B858C85F2 -:10FD20009D850E9497EF25962FAD2597322D432D67 -:10FD300026965FAD26970E946DEB87FF10C0E7E522 -:10FD4000F0E284918F010F5F1F4F1B830A8388238A -:10FD500009F485C10E940232EA81FB81F2CF8A81D7 -:10FD60009B81AC81BD8129A93AA94BA95CA9821BC1 -:10FD7000930BA40BB50BB7FD93C00E940EA88AE0AD -:10FD80000E9402328A819B81AC81BD818053984F51 -:10FD9000AF4FBF4F89AB9AABABABBCAB0DA9011159 -:10FDA0005EC02EA93FA948AD59AD25966FAD2597E8 -:10FDB000722D832D26969FAD26970E94BDF11816B1 -:10FDC000DCF520E030E040E050E425966FAD25976B -:10FDD000722D832D26969FAD26970E9497EF6EABCE -:10FDE0007FAB88AF99AF2DA53EA54FA558A98A81B5 -:10FDF0009B81AC81BD81280F391F4A1F5B1F2AAF31 -:10FE00003BAF4CAF5DAF20E030E040EC50E46A85A2 -:10FE10007B858C859D850E9496EF25962FAD259735 -:10FE2000322D432D26965FAD26970E946DEB881FDD -:10FE30008827881F8DAB34C08A819B81AC81BD81AE -:10FE40002AAD3BAD4CAD5DAD821B930BA40BB50B46 -:10FE5000B7FD26C04EAD5FAD68E470E21EC020E085 -:10FE600030E040EA51E46A857B858C859D850E945F -:10FE700096EF9B01AC0125966FAD2597722D832DD2 -:10FE800026969FAD26970E946DEB87FF09C02296AC -:10FE90004EAD5FAD229763E170E289810E94E8B3C5 -:10FEA0008A819B81AC81BD81880F991FAA1FBB1FCE -:10FEB0002CA13DA14EA15FA1821B930BA40BB50BFE -:10FEC00084199509A609B70981389F44A241B10553 -:10FED00080F0EEECFFE184918F010F5F1F4F1B83D9 -:10FEE0000A83882309F4BBC00E940232EA81FB81A5 -:10FEF000F2CF2AA13BA14E855F85241735070CF070 -:10FF0000ABC0E1E7FFE184918F010F5F1F4F1B83BF -:10FF10000A83882329F00E940232EA81FB81F3CF11 -:10FF2000198117FD03C007E613E002C001E813E0E2 -:10FF30001B830A836A817B8180E69FE10E94125EB7 -:10FF4000B701A6018CE59FE10E94DC5D8AE00E947A -:10FF500002326A817B818BE49FE10E94125E4889B4 -:10FF600059896A897B8987E49FE10E94DC5D8AE088 -:10FF70000E9402326A817B8186E39FE10E94125EC9 -:10FF80004C895D896E897F8982E39FE10E94DC5DF7 -:10FF90008AE00E9402321CA5112309F4C8C109811C -:10FFA00007FF2DC0C092BD10D092BE10E092BF10CE -:10FFB000F092C0102CEA35EC47E25EE3688979895B -:10FFC0008A899B890E94D2EB6093B9107093BA1012 -:10FFD0008093BB109093BC102CEA35EC47E25EE3B3 -:10FFE0006C897D898E899F890E9473F06093B5101A -:10FFF0007093B6108093B7109093B81098C1C092C8 -:020000021000EC -:10000000BA05D092BB05E092BC05F092BD052CEA82 -:1000100035EC47E25EE3688979898A899B890E9489 -:10002000D2EB6093C2057093C3058093C40590938F -:10003000C5052CEA35EC47E25EE36C897D898E8943 -:100040009F890E9473F06093BE057093BF058093F3 -:10005000C0059093C1056BC10E94569C8DCDCB5BB2 -:10006000DF4F0FB6F894DEBF0FBECDBFDF91CF914B -:100070001F910F91FF90EF90DF90CF90BF90AF90C6 -:100080009F908F907F906F905F904F903F902F90B8 -:100090000C9453AA0E851F85012B09F41DC148A499 -:1000A00059A46AA47BA4480E591E6A1E7B1E28A56B -:1000B00039A54AA55BA5281B390B4A0B5B0B6E8142 -:1000C0007F81888599850E944CEFA30192010E944F -:1000D00082F2DA01C901880D991DAA1DBB1D843168 -:1000E0009105A105B105FCF04C015D018C3E910527 -:1000F000A105B1052CF05BEE852E912CA12CB12C25 -:1001000020E882169104A104B104DCF08EEF90E0A7 -:10011000A0E0B0E088199909AA09BB098E839F83E2 -:10012000A887B98712C044E1842E912CA12CB12C50 -:1001300004E110E020E030E00E831F832887398738 -:1001400004C08E829F82A886B986E3ECF0E2849197 -:100150008F010F5F1F4F882321F00E940232F801A8 -:10016000F6CFC501B4010E94E535EEEBF0E28491D3 -:100170008F010F5F1F4F882321F00E940232F80188 -:10018000F6CF6E817F81888599850E94E535488DFF -:10019000598D6A8D7B8D87EB90E20E94DC5D4C8DE2 -:1001A0005D8D6E8D7F8D80EB90E20E94DC5D0E8513 -:1001B0001F85033011050CF48FC06E817F81888507 -:1001C00099850E9473EB20E030E040E850E40E9403 -:1001D000D2EB6B017C01288D398D4A8D5B8D6C8D46 -:1001E0007D8D8E8D9F8D0E9496EF2BED3FE049E433 -:1001F00050E40E94D2EB20E030E040E05FE30E9458 -:10020000D2EB9B01AC01C701B6010E9473F06B01F8 -:100210007C01C301B2010E9473EB2FE632E143E897 -:100220005AE30E94D2EB2B013C01B701A6018AEAF6 -:1002300090E20E94DC5DB301A20184EA90E20E9498 -:10024000DC5D2AE939E949E15FE3C701B6010E94B3 -:10025000D2EB6B017C019B01AC010E9497EFA301E3 -:1002600092010E9473F0688B798B8A8B9B8BA7011C -:100270009601C301B2010E94D2EB20E030E040E0E1 -:100280005EE30E94D2EB6C8B7D8B8E8B9F8BE4E9BF -:10029000F0E284918F010F5F1F4F882321F00E94AD -:1002A0000232F801F6CFB701A6018EE890E20E9473 -:1002B000DC5D488959896A897B8988E890E20E94D7 -:1002C000DC5D4C895D896E897F8982E890E20E94BD -:1002D000DC5D8AE00E9402328E819F81A885B9850B -:1002E000880D991DAA1DBB1D1981B595A7959795D8 -:1002F000879517FF03C080935A1005C02496EEAD72 -:10030000FFAD249780830E851F850F5F1F4F1F87CA -:100310000E871A85188F0B85098F1C851A8F0D85FE -:100320000B8F4A805B806C807D8011E0F2CCCB5BD0 -:10033000DF4F0FB6F894DEBF0FBECDBFDF91CF9178 -:100340001F910F91FF90EF90DF90CF90BF90AF90F3 -:100350009F908F907F906F905F904F903F902F90E5 -:100360000895CF93DF93EAEBFFE08491EF012196AC -:10037000882321F00E940232FE01F7CF83E50E941C -:100380002831882321F00E94E63080933902E2E28E -:10039000FFE18491EF012196882321F00E9402322F -:1003A000FE01F7CF80913902811103C0EEE1FFE138 -:1003B00002C0EAE1FFE18491EF012196882321F058 -:1003C0000E940232FE01F7CFE2E1FFE18491EF01EA -:1003D0002196882321F00E940232FE01F7CF20915E -:1003E00078103091791040917A1050917B10609183 -:1003F00084107091851080918610909187100E94D2 -:1004000097EFAB01BC0180E19FE10E94DC5D209190 -:100410007C1030917D1040917E1050917F10609142 -:1004200088107091891080918A1090918B100E9491 -:1004300097EFAB01BC018DE09FE10E94DC5D209154 -:100440008010309181104091821050918310609102 -:100450008C1070918D1080918E1090918F100E9451 -:1004600097EFAB01BC018AE09FE10E94DC5DE2E016 -:10047000FFE18491EF012196882321F00E9402324E -:10048000FE01F7CF209178103091791040917A10C9 -:1004900050917B1060912D0270912E0280912F025D -:1004A000909130020E9497EFAB01BC0180E09FE188 -:1004B0000E94DC5D20917C1030917D1040917E1077 -:1004C00050917F106091310270913202809133021D -:1004D000909134020E9497EFAB01BC018DEF9EE139 -:1004E0000E94DC5D2091801030918110409182103B -:1004F00050918310609135027091360280913702DD -:10050000909138020E9497EFAB01BC018AEF9EE107 -:100510000E94DC5D8AE0DF91CF910C940232FF9261 -:100520000F931F93CF93DF93F82E092F162FE5EF2C -:10053000FEE18491EF012196882321F00E9402328E -:10054000FE01F7CFEF2DF02F8491EF012196882344 -:1005500021F00E940232FE01F7CFE3EFFEE1849129 -:10056000EF012196882321F00E940232FE01F7CF8D -:10057000612F70E080E090E00E94E5358AE0DF9135 -:10058000CF911F910F91FF900C9402324F925F9286 -:100590006F927F928F929F92AF92BF92CF92DF9293 -:1005A000EF92FF92CF93DF93E0EFFEE18491EF01B2 -:1005B0002196882321F00E940232FE01F7CF20917C -:1005C00078103091791040917A1050917B106091A1 -:1005D0001D0470911E0480911F04909120040E94BC -:1005E00097EF42E00E94DB37ECEEFEE18491EF01F1 -:1005F0002196882321F00E940232FE01F7CF20913C -:100600007C1030917D1040917E1050917F10609150 -:1006100021047091220480912304909124040E946B -:1006200097EF42E00E94DB37E8EEFEE18491EF01B4 -:100630002196882321F00E940232FE01F7CF2091FB -:100640008010309181104091821050918310609100 -:1006500025047091260480912704909128040E941B -:1006600097EF42E00E94DB37E4EEFEE18491EF0178 -:100670002196882321F00E940232FE01F7CF60917B -:10068000290470912A0480912B0490912C0442E05B -:100690000E94DB3780916F00982F927081FF05C018 -:1006A00080916F008D7F80936F004090A5105090D7 -:1006B000A6106090A7107090A8108090A91090903C -:1006C000AA10A090AB10B090AC10C090AD10D0901C -:1006D000AE10E090AF10F090B010992329F0809107 -:1006E0006F00826080936F00EAEDFEE18491EF017C -:1006F0002196882321F00E940232FE01F7CFC30128 -:10070000B2010E94E535E6EDFEE18491EF0121960C -:10071000882321F00E940232FE01F7CFC501B40107 -:100720000E94E535E2EDFEE18491EF0121968823F8 -:1007300021F00E940232FE01F7CFC701B6010E94EC -:10074000E5358AE0DF91CF91FF90EF90DF90CF9079 -:10075000BF90AF909F908F907F906F905F904F90E1 -:100760000C9402322F923F924F925F926F927F923F -:100770008F929F92AF92BF92CF92DF92EF92FF92B1 -:100780000F931F93CF93DF93CDB7DEB762970FB66A -:10079000F894DEBF0FBECDBF80913404982F9270C5 -:1007A000F92EE82FE470EE2EF82FF170DF2E80FF87 -:1007B00004C0992311F0E11179C0EAEBFFE08491C4 -:1007C0008F010F5F1F4F811103C0E9E2F1E204C006 -:1007D0000E940232F801F3CF84918F010F5F1F4F07 -:1007E000882321F00E940232F801F6CFD1100CC00C -:1007F000E7E2F1E284918F010F5F1F4F882321F020 -:100800000E940232F801F6CFF1100CC0E5E2F1E2ED -:1008100084918F010F5F1F4F882321F00E940232C5 -:10082000F801F6CFE11003C0E3E2F1E203C0EBE12F -:10083000F1E20AC084918F010F5F1F4F8823B9F343 -:100840000E940232F801F6CF84918F010F5F1F4F93 -:10085000882321F00E940232F801F6CFE11003C094 -:1008600045E853E002C047E653E0F11003C027E833 -:1008700033E002C027E633E0D11003C089E893E0FB -:1008800002C087E693E05F934F933F932F939F932C -:100890008F9389E091E29F938F931F920E947D4EE8 -:1008A0000FB6F894DEBF0FBECDBFCEC00AEA12E28B -:1008B000EDE1F4E0FA8BE98BCE0101965C0193E067 -:1008C000892E93E2992E1501F80165917591859114 -:1008D0009491E989FA89C190D190E190F190FA8BD5 -:1008E000E98BA70196010E9496EF2B013C01F101D3 -:1008F000608371838283938320E030E040EA51EC8F -:100900000E94BDF187FD0AC020E030E040EA51E4DA -:10091000C301B2010E946DEB18162CF4F40184910E -:1009200018160CF487C0F101C190D190E190F190BC -:100930001F0120E030E040EA51ECC701B6010E94FF -:10094000BDF187FD0AC020E030E040EA51E4C70174 -:10095000B6010E946DEB18164CF5EBE8FFE08491B0 -:100960008F010F5F1F4F811103C0EDE4F1E204C05E -:100970000E940232F801F3CF84918F010F5F1F4F65 -:10098000882321F00E940232F801F6CF61E08FE364 -:1009900091E20E9430C50E94D26788E290E0988B75 -:1009A0008F8788EC90E09E878D873CC00C5F1F4F3F -:1009B000FFEF8F1A9F0A82E2063B180709F084CFE7 -:1009C00081E1E82E84E0F82E10E0F501819191910B -:1009D000A191B1915F01F70181939193A193B1939B -:1009E0007F01812F0E94CC2F1F5F133071F7CEDD66 -:1009F00060E08FE291E20E9430C583E992E0988B3B -:100A00008F8704E610E01E870D87BE01615F7F4F70 -:100A1000CE010D960E9494DB8AEB92E0988B8F8733 -:100A20001E870D87BE01615F7F4FCE010D960E942C -:100A300094DB0AC0F7FAF094F7F8F094F101C08261 -:100A4000D182E282F3826FCF62960FB6F894DEBF56 -:100A50000FBECDBFDF91CF911F910F91FF90EF900F -:100A6000DF90CF90BF90AF909F908F907F906F90CE -:100A70005F904F903F902F9008952F923F924F920A -:100A80005F926F927F928F929F92AF92BF92CF921E -:100A9000DF92EF92FF920F931F93CF93DF93CDB727 -:100AA000DEB762970FB6F894DEBF0FBECDBF809160 -:100AB0005A0B83FDA2C183E50E9471318C8781119D -:100AC00006C082E50E947131882309F496C10E9414 -:100AD000F5300E94DBF0663971050CF08BC1709324 -:100AE0000111609300110E94BBA90E94F53020E023 -:100AF00030E040EA50E40E94BDF1181614F40E9460 -:100B0000C9B76091001170910111072E000C880B7C -:100B1000990B0E9473EB2091040F3091050F4091C7 -:100B2000060F5091070F0E94BDF118161CF084EBC0 -:100B30009EE102C083EC9EE160E00E9430C581E04E -:100B4000809306028091041180935B101A821B82AD -:100B50001C821D82188619861A861B8619821D869C -:100B60002CE32E873CE13F8746E4488B312C212C37 -:100B700050E8598B8FEB8A8B812C912C540160911A -:100B8000001170910111072E000C880B990B0E9427 -:100B900073EB7B018C019B01AC01632D722D898964 -:100BA0009A890E946DEB882309F442C02091040FBA -:100BB0003091050F4091060F5091070F9C85B701AA -:100BC000802F91110CC0912F0E946DEB881F8827F8 -:100BD000881F89833E2C2F2C098B1A8B29C0912FBB -:100BE0000E946DEB87FF1FC080910602882309F4E5 -:100BF00004C162960FB6F894DEBF0FBECDBFDF9181 -:100C0000CF911F910F91FF90EF90DF90CF90BF9009 -:100C1000AF909F908F907F906F905F904F903F909C -:100C20002F900C9411CF3E2C2F2C098B1A8B1982EC -:100C30000E94EDDB6B017C01DC01CB01288539854D -:100C40004A855B85821B930BA40BB50BB7FD3BC09C -:100C5000D701C60188519C4FAF4FBF4F88879987F6 -:100C6000AA87BB870E940EA8E0EBFEE184913F01BA -:100C70009FEF691A790A882321F00E940232F3015A -:100C8000F5CF81149104A104B104B9F0D501C401D8 -:100C9000805F984DAF4FBF4FBC01CD016C197D09EE -:100CA0008E099F0928EE33E040E050E00E945BEFA0 -:100CB000CA01B9010E94E53503C08FE30E940232E8 -:100CC0008AE00E9402320E9489900E94EDDB6093CC -:100CD000FC0F7093FD0F8093FE0F9093FF0FA09178 -:100CE000040FAE83B091050FBF830091060F1091E2 -:100CF000070F9D01A801632D722D89899A890E9491 -:100D000096EF2B013C0120E030E0A9010E94BDF1EB -:100D100087FF04C077FA709477F870948114910477 -:100D2000A104B10459F420E030E040E85FE3C301DE -:100D3000B2010E946DEB87FF0DC00AC020E030E0D9 -:100D400040E450E4C301B2010E94BDF1181614F44E -:100D50004601570129812223A9F18A819B81AC8117 -:100D6000BD81892B8A2B8B2B61F0D701C6012A818B -:100D70003B814C815D81821B930BA40BB50BB7FDAE -:100D800021C02E813F81A8016D857E858F85988940 -:100D90000E9496EF20E030E040EC5FE30E946DEBB4 -:100DA00087FD22CFD701C601805A9541AF4FBF4F73 -:100DB0008A839B83AC83BD839E819D87AF81AE87F1 -:100DC0000F87188B80910602882309F40DCF8114B8 -:100DD0009104A104B10409F4D2CEB0E1CB1AB7E278 -:100DE000DB0AE108F108C818D908EA08FB08F7FE91 -:100DF000FBCEC5CE66E970E072CE62960FB6F8946F -:100E0000DEBF0FBECDBFDF91CF911F910F91FF903D -:100E1000EF90DF90CF90BF90AF909F908F907F909A -:100E20006F905F904F903F902F9008950F931F9376 -:100E3000CF93DF93EB010E94EDDB8B0174D78F3FE3 -:100E400049F00E94EDDB601B710B6C177D07B0F35E -:100E500080E001C081E0DF91CF911F910F91089553 -:100E60008F929F92AF92BF92CF92DF92EF92FF92BA -:100E70000F931F93CF93DF93EC018B81811102C0FD -:100E800080E078C009891A892B893C8904171507E5 -:100E900026073707A8F36A017B01823029F4C88648 -:100EA000D986EA86FB860DC0C114D104E104F104A1 -:100EB00051F4188619861A861B861C821D821E8292 -:100EC0001F8281E057C088849984AA84BB84E98DFD -:100ED000FA8D258530E0275F3F4FB501A4014150D1 -:100EE000510961097109022E04C0769567955795DD -:100EF00047950A94D2F7D701C6010197A109B10914 -:100F000004C0B695A795979587952A95D2F784172B -:100F10009507A607B70720F089288A288B2871F43F -:100F20004D895E896F89788D4C835D836E837F8365 -:100F30004C015D018E010C5F1F4F16C0841B950B89 -:100F4000A60BB70BF5CF4C815D816E817F81980137 -:100F5000898D9A8D0E94EDD591E0891A9108A1089A -:100F6000B108882309F48CCF81149104A104B10441 -:100F700051F795CFDF91CF911F910F91FF90EF9097 -:100F8000DF90CF90BF90AF909F908F9008950F9378 -:100F90001F93CF93DF93FC012381222311F080E084 -:100FA00044C08B01EC01FB018789803139F180322B -:100FB000B1F783E08B83F801428D538D648D758D7D -:100FC0004D8B5E8B6F8B788F9E012F5E3F4FC801DC -:100FD0000E946DD6882319F31A8F098F81E08983C7 -:100FE000188619861A861B861C821D821E821F8205 -:100FF000188A1C861D861E861F8617C082E08B837A -:101000001D8A1E8A1F8A188EFB01808D918DA0E09B -:10101000B0E025E0880F991FAA1FBB1F2A95D1F7C2 -:10102000898B9A8BAB8BBC8BD7CFDF91CF911F91E4 -:101030000F910895CF93DF93EC010E943BD71B8261 -:10104000DF91CF910895CF93DF93EC0141E06111DF -:1010500001C040E06C857D858E859F850E9424D5EA -:10106000882341F0888920E2829FC00111248E5B91 -:101070009D4E02C080E090E0DF91CF910895CF9324 -:10108000DF93EB01FC012381211102C080E027C026 -:101090002250223020F48FE2888319821FC060E042 -:1010A000D2DF009799F3FC0190E080E02EE23081DE -:1010B000303269F0883029F4DE01A90FB11D2C937C -:1010C0009F5FDE01A90FB11D30813C939F5F8F5F51 -:1010D00031968B3061F7C90FD11D188281E0DF9105 -:1010E000CF9108953F924F925F926F927F928F922D -:1010F0009F92AF92BF92CF92DF92EF92FF920F93A7 -:101100001F93CF93DF93CDB7DEB72C970FB6F8942C -:10111000DEBF0FBECDBF5C01DC0159968D909C9067 -:101120005A97F40181859285A385B4859C01AD0110 -:101130002F5F3F4F4F4F5F4F29873A874B875C8721 -:10114000D5011496CD90DD90ED90FC901797C114C9 -:10115000D104E104F10439F0BFEFCB1ADB0AEB0A4A -:10116000FB0A312C07C0F401C080D180E280F380FB -:1011700033243394260137011D821E821F82188674 -:10118000F40181859285A385B4852D813E814F81AF -:101190005885281739074A075B0708F064C0898516 -:1011A0009A85AB85BC858C159D05AE05BF0550F4B1 -:1011B00082E0C82ED12CE12CF12C92E0492E512C4A -:1011C000612C712C9E012F5F3F4FB701A601C40116 -:1011D0000E94EDD5882309F446C089819A81AB81AC -:1011E000BC81892B8A2B8B2B41F0260137019FEF85 -:1011F000491A590A690A790A05C0C414D504E604D3 -:10120000F70491F02D813E814F8158852F5F3F4F2C -:101210004F4F5F4F2D833E834F8358873FEFC31A55 -:10122000D30AE30AF30AACCF0FEF1FEF2FEF3FE033 -:10123000B301A201C4010E945CD5F82E882399F065 -:10124000D50114964D915D916D917C911797411543 -:1012500051056105710549F093018201C4010E94A5 -:101260005CD5811102C0F12C29C0D50114964D9294 -:101270005D926D927C921797332051F0D301C20199 -:101280000196A11DB11DF40180839183A283B383D4 -:10129000F50185899689A789B08D892B8A2B8B2B9F -:1012A00069F4D50155964D925D926D927C92589756 -:1012B00011968C911197806811968C938F2D2C9696 -:1012C0000FB6F894DEBF0FBECDBFDF91CF911F9157 -:1012D0000F91FF90EF90DF90CF90BF90AF909F90D5 -:1012E0008F907F906F905F904F903F90089540E077 -:1012F00050E0BA01B5CD61E0FC0180810C9421BDC4 -:101300008EBD0DB407FEFDCF08958F929F92AF92D0 -:10131000BF92EF92FF921F93CF93DF93EC01162FB2 -:1013200049015A019A81892F806A86958CBD90FD6A -:1013300003C081E0963009F480E08DBD60E08881D3 -:101340000E9421BD6CE271E0CE0170DD812F8064CE -:10135000D7DF88E1E82EF12CD501C4010E2C04C0A2 -:10136000B695A795979587950A94D2F7C9DF88E037 -:10137000E81AF10888EFE8168FEFF80669F71123ED -:1013800091F0183011F487E801C08FEFB9DF1C30FD -:1013900009F4C9D410E0C7D48B8387FF07C01F3F6F -:1013A00029F01F5FF8CF85E9ABDFF4CFDF91CF9154 -:1013B0001F91FF90EF90BF90AF909F908F900895F6 -:1013C0000F931F93CF93DF93EC0189018C818330BE -:1013D00039F089E0440F551F661F771F8A95D1F7B2 -:1013E0009A01AB0168E1CE0190DF882311F086E01D -:1013F0002CC08EEF8EBDF801C8019E5F0DB407FEB4 -:10140000FDCF20812EBD0DB407FEFDCF21812EBD65 -:1014100032968E179F0791F70DB407FEFDCF8FEF21 -:101420006FDF8FEF6DDF7FD48B838F71853029F075 -:1014300083E18983CE015FDF09C068E572E0CE01F8 -:10144000F5DC182F811106C087E18983CE0153DFB7 -:1014500010E00FC020E030E0A9016DE0CE0155DFC3 -:10146000811103C060D4882311F086E1EECFCE0154 -:1014700042DF812FDF91CF911F910F910895EF925D -:10148000FF920F931F93CF93DF93EC0179018C812F -:10149000833039F089E0440F551F661F771F8A9506 -:1014A000D1F79A01AB0161E1CE012FDF882329F04A -:1014B00084E08983CE011FDF35C00E94EDDB8B0104 -:1014C00032D48B838F3F49F40E94EDDB601B710B9C -:1014D0006D327140A8F381E103C08E3F39F08FE097 -:1014E0008983CE0108DF8FEF0BDF1CC08FEF8EBD2D -:1014F000F701D701A150BE4F0DB407FEFDCF9EB539 -:1015000091938EBDEA17FB07B9F70DB407FEFDCF27 -:101510008EB58C9308D407D4CE01EDDE8FEFF0DECC -:1015200081E001C080E0DF91CF911F910F91FF908A -:10153000EF9008952F923F924F925F926F927F9219 -:101540008F929F92AF92BF92CF92DF92EF92FF92D3 -:101550000F931F93CF93DF9300D01F92CDB7DEB7C9 -:101560009C838B834B015A01DC0113968C91811172 -:1015700003C08FEF9FEFEAC0EB81FC81818180FF88 -:10158000F8CFAB81BC8151960D911D912D913C916D -:10159000549718964D915D916D917C911B97C50163 -:1015A000A0E0B0E068017901C41AD50AE60AF70A9A -:1015B000C816D906EA06FB0618F45801A41AB50A9B -:1015C00075018B819C8104969A838983612C42E00A -:1015D000742EE114F10409F48BC0AB81BC81189620 -:1015E0004D915D916D917C911B976A01B1E0DB2279 -:1015F000EB81FC812381818D928D1A012B0139E0D1 -:1016000056944794379427943A95D1F7223061F451 -:10161000FC01828D938DA48DB58DBC01CD01620D31 -:10162000731D841D951D4AC0DC0114961C91115038 -:101630001221C114D10401F511111EC0452B462BF6 -:10164000472B59F4EB81FC8185899689A789B08D58 -:1016500084839583A683B7830FC0AB81BC81149626 -:101660004D915D916D917C91179729813A810E94EE -:10167000EDD5882309F47DCFEB81FC81218D328D5E -:1016800084819581A681B7810297A109B109F901E9 -:10169000058404C0880F991FAA1FBB1F0A94D2F7A4 -:1016A0004685578560897189840F951FA61FB71FCE -:1016B000BC01CD01610F711D811D911D93012C197C -:1016C0003D0987012E153F0508F489010115F2E057 -:1016D0001F0771F520914214309143144091441436 -:1016E00050914514621773078407950719F420C0B9 -:1016F000C5012CC09401AB01BC0180914B149091A9 -:101700004C14BDDE882309F434CF800E911EEB818A -:10171000FC8180859185A285B385800F911FA11DD5 -:10172000B11D80879187A287B387E01AF10A51CF54 -:1017300040E00E9424D5882309F41BCFB6016E5BDC -:101740007D4EA801C4010E94C5F2DFCF0F900F901B -:101750000F900F90DF91CF911F910F91FF90EF901D -:10176000DF90CF90BF90AF909F908F907F906F90C1 -:101770005F904F903F902F9008954F925F926F929D -:101780007F929F92AF92BF92CF92DF92EF92FF92A1 -:101790000F931F93CF93DF931F92CDB7DEB78C01CA -:1017A0007B015A01C22EDB0159968D919C915A976B -:1017B000F801928F818FCB019ADD912CF701808502 -:1017C0009185A285B385418952896389748984177B -:1017D0009507A607B70708F05FC025E0B695A7955F -:1017E000979587952A95D1F7F82FFF70DF2ED701AF -:1017F00013968C91823008F45EC041E050E0BE0147 -:101800006F5F7F4FC70196DE019719F4898190E0E1 -:1018100002C08FEF9FEF019609F44DC0F70180855C -:101820009185A285B3854F96A11DB11D80879187B3 -:10183000A287B387F0E2DF9EB00111246E5B7D4E7C -:1018400061157105C1F1DB018C91882319F0853E8A -:10185000C1F468C191100EC080914214909143145C -:10186000A0914414B0914514F80184879587A68708 -:10187000B787D08ADB018C91882361F099249394F7 -:101880009DCF4BE050E0C5010E94B8F2892B09F0D2 -:1018900095CF13C0992493948C2D8274823459F47B -:1018A000992009F48AC0F801D08861E0C801CBDB37 -:1018B000009709F00BC180E038C1C7FCFCCFF0E213 -:1018C000DF9EA00111249A012E5B3D4ED9011B968B -:1018D0008C91817121F08C2D827109F06AC0809108 -:1018E000421490914314A0914414B0914514F8010E -:1018F00084879587A687B787D08ACA018E5B9D4E5D -:101900007C01DC0154964D915C91559760E070E04C -:10191000DA0199278827858B968BA78BB08FF701E3 -:10192000428D538D60E070E0482B592B6A2B7B2B46 -:10193000D80155964D935D936D937C935897F9011B -:101940008385887161F4F701848D958DA68DB78D9F -:10195000F801818B928BA38BB48B81E010C0803116 -:1019600041F598012F5E3F4FD80159968D919C917A -:101970005A970E946DD68823E1F084E0F8018383B2 -:101980008C2D8F70D80111968C931197F8011482C9 -:1019900015821682178218961D921D921D921C9216 -:1019A0001B97C4FEB3C0C8010E94884F8111AEC00E -:1019B00082CFD80113961C927ECFD70113968C91BB -:1019C0001397823009F477CF51968D919D910D90A8 -:1019D000BC91A02D803E9F4FAF41B10508F06BCF69 -:1019E000C70180DB882309F466CF0E94E4D48823F2 -:1019F00009F461CFD70159962D913C915A971496CD -:101A00008D919D910D90BC91A02D0297A109B109D6 -:101A1000F901058404C0880F991FAA1FBB1F0A94EF -:101A2000D2F74684578460887188480E591E6A1E12 -:101A30007B1E81E080934A144092421450924314DA -:101A4000609244147092451480E092E0E2E4F2E186 -:101A5000DF019C011D9221503040E1F7DD24D39439 -:101A6000D7015996ED91FC915A978481D81690F43C -:101A700022E432E1B301A2014D0D511D611D711D22 -:101A800080914B1490914C149BDC882309F413CF64 -:101A9000D394E6CF80E092E0A0E0B0E0058404C0FB -:101AA000880F991FAA1FBB1F0A94D2F7F70141891B -:101AB000528963897489840F951FA61FB71F818B74 -:101AC000928BA38BB48B82E492E1D12C20E2DC01D7 -:101AD0001D922A95E9F72BE0F501DC0101900D92AA -:101AE0002A95E1F721E238E2FC01318B208B40E0BE -:101AF00058E057874687338B228B318F208F578B47 -:101B0000468B0E94E4D48111DACED5CEC5FE08C042 -:101B1000F8014189528963897489C801A1D905C036 -:101B200081E003C09110AACE97CE0F90DF91CF91A4 -:101B30001F910F91FF90EF90DF90CF90BF90AF90EB -:101B40009F907F906F905F904F9008952F923F925B -:101B50004F925F926F927F928F929F92AF92BF92BD -:101B6000CF92DF92EF92FF920F931F93CF93DF9369 -:101B7000CDB7DEB7C254D1090FB6F894DEBF0FBEA1 -:101B8000CDBF4C015B016A01322E19821C821C8E72 -:101B90001F8E6115710511F410E0A2C0FC01838154 -:101BA0008111FACFFA0180818F3209F097C0F501D7 -:101BB00083818250823010F485010BC0F501618D64 -:101BC000728DCE014C96E3D9882331F38E01045EE9 -:101BD0001F4FC6016C010196F60120812F32D1F30F -:101BE000CE0101967C013C012E019CE1490E511C65 -:101BF0002396EFAE23972F2C9BE09150E7E3F0E084 -:101C0000EC0FFD1FE90FF11D80E280839111F5CFEC -:101C1000960147E0D9018D91882369F18F3259F1FE -:101C20008E3239F44A3009F4B7CF98E04AE09D018A -:101C3000F1CFEBE6F1E22491222321F031968213D9 -:101C4000FACFAACF491708F4A7CF813208F4A4CF5E -:101C50008F3709F4A1CF21E0290FE7E3F0E0EC0F83 -:101C6000FD1FE90FF11D9FE9980F9A3108F480528A -:101C70008083922FDCCF8FA9803209F48DCF690148 -:101C8000F90180812F5F3F4F8F32C9F38823E9F03C -:101C900021E0AE01495C5F4FB801C7016EDD8823CA -:101CA00009F47ACF0A151B0511F0C801C3D96E14C7 -:101CB0007F0441F023969FAD2397822D8701E92E63 -:101CC000F82E9ACF942D852DF9CF232DAE01495CA6 -:101CD0005F4FB801C40151DD182F02C08B0180CFC6 -:101CE000CE014C960E94FC31CE0101960E94FC313F -:101CF000812FCE5BDF4F0FB6F894DEBF0FBECDBF96 -:101D0000DF91CF911F910F91FF90EF90DF90CF90D7 -:101D1000BF90AF909F908F907F906F905F904F900B -:101D20003F902F9008958FEF8EBD0DB407FEFDCF2D -:101D30008EB50895CF92DF92EF92FF92CF93DF930B -:101D4000EC01C0908410D0908510E0908610F09047 -:101D50008710A7019601688179818A819B810E9401 -:101D60006DEB87FF04C0C882D982EA82FB82C090F3 -:101D70008810D0908910E0908A10F0908B10A70105 -:101D800096016C817D818E819F810E946DEB87FF22 -:101D900004C0CC82DD82EE82FF82C0902D02D09002 -:101DA0002E02E0902F02F0903002A7019601688188 -:101DB00079818A819B810E94BDF1181624F4C88222 -:101DC000D982EA82FB82C0903102D0903202E09048 -:101DD0003302F0903402A70196016C817D818E81DF -:101DE0009F810E94BDF1181624F4CC82DD82EE8220 -:101DF000FF82C0908C10D0908D10E0908E10F090EB -:101E00008F10A7019601688579858A859B850E9438 -:101E10006DEB87FF04C0C886D986EA86FB86C09032 -:101E20003502D0903602E0903702F0903802A701D8 -:101E30009601688579858A859B850E94BDF1181673 -:101E400024F4C886D986EA86FB86DF91CF91FF907D -:101E5000EF90DF90CF9008954F925F926F927F92B4 -:101E60008F929F92AF92BF92DF92EF92FF920F9369 -:101E70001F93CF93DF93D82EC82FD0E0FE01ED5FE4 -:101E8000FC4D64917E01EE0CFF1CEE0CFF1CF70173 -:101E9000E950FD4D4590559065907490062E000CCC -:101EA000770B880B990B0E9473EB4B015C0120E0D0 -:101EB00030E040EC5FE3C301B2010E94D2EBA50128 -:101EC00094010E94D2EBAB01BC0100E010E098014C -:101ED0008D2D0E941630F701E551FD4D259135916C -:101EE00045915491C501B4010E94D2EB4B015C01B4 -:101EF00020E030E0A9010E946DEB882309F447C07F -:101F000000E010E09801B501A40170588D2D0E94E9 -:101F10001630FE01E851FD4D6491611117C0EAEBE6 -:101F2000FFE08491EF012196882321F00E94023284 -:101F3000FE01F7CFE6ECF2E28491EF0121968823CF -:101F400021F00E940232FE01F7CF6AE0F701EA5465 -:101F5000FD4D459055906590749070E080E090E064 -:101F60000E9473EB9B01AC01C301B2010E9473F0AC -:101F70002B013C01A5019401C501B4010E9497EF1A -:101F8000AB01BC01930182018D2D0E94163081E0CE -:101F900090E00D2C01C0880F0A94EAF79091330469 -:101FA000982B9093330490913404892B80933404BC -:101FB000F701E75FFF4E10821182128213828D2D8E -:101FC0000E94CC2FF701E655FD4D85919591A59185 -:101FD000B491E701C35EDB4F88839983AA83BB83F7 -:101FE0000E940C30F701EB5EFF4E88819981AA8137 -:101FF000BB8180839183A283B383DF91CF911F91B3 -:102000000F91FF90EF90DF90BF90AF909F908F90D7 -:102010007F906F905F904F90089527E632E0FC012B -:102020003183208304960C94FC31179A80913304F9 -:102030008E7F80933304169A809133048D7F809332 -:102040003304159A809133048B7F80933304149A60 -:1020500008958C01EBE8FFE08491EF01219688233D -:1020600021F00E940232FE01F7CFEAE8F2E2849109 -:10207000EF012196882321F00E940232FE01F7CF62 -:102080000E9453AAD2DF0E94609F61E0C8010E94B3 -:1020900030C50E94D267C091B30BC695C6950E9409 -:1020A0003751DC2FDD0F1D2F1C0F84E00E946DC8FF -:1020B0001092E90BC093EA0B0E946F501092E90B4B -:1020C000D093EA0B8BE792E20E9459501092E90BF1 -:1020D0001093EA0B8EE692E20E9459500E941A5029 -:1020E0008111E3CF2FEF8BE49DE1215080409040A0 -:1020F000E1F700C00000F8942FEF84E39CE021504A -:1021000080409040E1F700C000000E9453AAA895CB -:10211000FECF2F923F924F925F926F927F928F925B -:102120009F92AF92BF92CF92DF92EF92FF920F9366 -:102130001F93CF93DF9300D01F92CDB7DEB70E94DD -:10214000569C0E94EDDB6B017C0110912302112350 -:1021500009F47BC08091FB0F882309F476C040917D -:10216000251050912610609127107091281046017B -:102170005701841A950AA60AB70AB7FC78C08330BB -:1021800051F134F481300CF460C0EAEBFFE006C09A -:10219000843009F05AC0EAEBFFE03BC084919F0114 -:1021A0002F5F3F4F3B832A83882329F00E9402320E -:1021B000EA81FB81F3CFE0EFF1E284919F012F5F91 -:1021C0003F4F3B832A83882309F43FC00E94023299 -:1021D000EA81FB81F2CFEAEBFFE084919F012F5F60 -:1021E0003F4F3B832A83882329F00E940232EA81F1 -:1021F000FB81F3CFE9EDF1E284919F012F5F3F4F27 -:102200003B832A83882309F10E940232EA81FB8101 -:10221000F3CF84919F012F5F3F4F3B832A83882315 -:1022200029F00E940232EA81FB81F3CFE1ECF1E276 -:1022300084919F012F5F3F4F3B832A83882329F09E -:102240000E940232EA81FB81F3CF212F30E0A8EE19 -:10225000B3E00E9487EFC60ED71EE81EF91EC0929B -:102260002510D0922610E0922710F092281080912D -:10227000B605843010F40E9486320E94EDDBC090D7 -:102280000010D0900110E0900210F0900310C114E3 -:10229000D104E104F10489F10091FC0F1091FD0FCC -:1022A0002091FE0F3091FF0F0C0D1D1D2E1D3F1DA7 -:1022B0004B015C01801A910AA20AB30AB7FC1DC047 -:1022C000EBE8FFE084919F012F5F3F4F3B832A8320 -:1022D000882329F00E940232EA81FB81F3CF6091CA -:1022E000DC057091DD0584E392E20E94125E8AE0D3 -:1022F0000E9402328BE292E27AC0C0902402D09017 -:102300002502E0902602F0902702C114D104E104D6 -:10231000F104B1F13091EF0B2091F00B321749F03D -:102320006093FC0F7093FD0F8093FE0F9093FF0F4F -:1023300027C00091FC0F1091FD0F2091FE0F3091EE -:10234000FF0F0C0D1D1D2E1D3F1DDC01CB01801B41 -:10235000910BA20BB30BB7FD13C0179A80913304F6 -:102360008E7F80933304169A809133048D7F8093FF -:102370003304159A809133048B7F80933304149A2D -:1023800080912D1090912E10679902C0019604C083 -:10239000181619062CF4019790932E1080932D1087 -:1023A00080912D1090912E108E3E92400CF1EBE812 -:1023B000FFE084919F012F5F3F4F3B832A83882357 -:1023C00029F00E940232EA81FB81F3CFEBE0F2E2D6 -:1023D00084919F012F5F3F4F3B832A83882329F0FD -:1023E0000E940232EA81FB81F3CF82E092E231DE89 -:1023F0009091EF0B8091F00B981309C060913F060C -:10240000809041068A8290904306998224C0E09190 -:10241000F00B81E58E9FF0011124EF56F94F60819A -:10242000E091F00B8E9FF0011124ED56F94FA08042 -:10243000AA82E091F00B8E9FF0011124EB56F94F28 -:10244000B080B9828091F00B9091EF0B981719F042 -:102450008F5F8F70F9CF70E088E00E948BBDCA80DB -:102460006C2D70E086E00E948BBDD9806D2D70E0F0 -:1024700082E00E948BBD8091C605882309F4FAC0D2 -:1024800000910F0210911002E0901102EC82F09086 -:102490001202FA8260910211709103116E5F7F4FF8 -:1024A000072E000C880B990B0E9473EB9801A70173 -:1024B0000E946DEB87FDDEC0F090F00B212C312CDB -:1024C000E12C19828091EF0B8F1509F460C08F2DDC -:1024D00090E021E5289FF001299FF00D1124E65B93 -:1024E000F94F458956896789708D452B462B472BB7 -:1024F00081F4418D528D638D748D452B462B472B76 -:1025000041F4458D568D678D70A1452B462B472B89 -:10251000C9F141E5489F9001499F300D1124C9013F -:10252000865B994F6C01FC0161817281838194818A -:102530000E9402F24B015C01F60161A172A183A12C -:1025400094A10E9471EB2B013C01F60165A176A1DB -:1025500087A190A50E9471EB9B01AC01C301B20160 -:102560000E9473F0A50194010E94D2EB5B016C0103 -:1025700091014E2D59810E94BDF118161CF41501D0 -:10258000EC2CD98281E08F0D8F70F82E9BCF20919B -:102590000702309108024091090250910A02B101EC -:1025A0008E2D99810E94D2EB98014C815A810E9414 -:1025B00097EF6B017C019B01AC01B8018C819A8182 -:1025C0000E94BDF11816ACF000910B0210910C02A4 -:1025D00080900D028C8290900E029A829801A40144 -:1025E000B601C7010E94BDF118161CF08601EC82ED -:1025F000FA82C0902910D0902A10E0902B10F09011 -:102600002C1098014C815A81C701B6010E94BDF17E -:102610001816D4F420E037ED43EA5CE3B8018C816E -:102620009A810E94D2EB4B015C0128E431EE4AE72B -:102630005FE3C701B6010E94D2EBA50194010E949D -:1026400097EF8B018C839A83C801AC81BA81809308 -:10265000291090932A10A0932B10B0932C10B8013E -:10266000CD010E94DBF0709303116093021180E0B2 -:102670000E9407AA0E9446B485E19CE00E94372F81 -:10268000A0900810A982AA2009F443C00E94EDDBA3 -:102690000091041010910510209106103091071040 -:1026A000DC01CB01801B910BA20BB30BB7FD31C03A -:1026B0000E94EDDB6B017C012A2D30E0A8EEB3E037 -:1026C0000E9487EFC60ED71EE81EF91EC0920410A6 -:1026D000D0920510E0920610F09207100E940EA80A -:1026E0008AE00F900F900F900F90DF91CF911F9184 -:1026F0000F91FF90EF90DF90CF90BF90AF909F90A1 -:102700008F907F906F905F904F903F902F900C94A0 -:1027100002320F900F900F900F90DF91CF911F9189 -:102720000F91FF90EF90DF90CF90BF90AF909F9070 -:102730008F907F906F905F904F903F902F90089573 -:102740008F929F92AF92BF92CF92DF92EF92FF92C1 -:102750000F931F93CF93DF93CDB7DEB728970FB6B4 -:10276000F894DEBF0FBECDBF80913902882319F0E7 -:1027700085E190E1DFDA80915A0B83FDA5C0C0901E -:102780002110D0902210E0902310F090241020917E -:10279000290430912A0440912B0450912C04C70144 -:1027A000B6010E946DEB882309F48EC08091450626 -:1027B000811131C0609146067091470680914806AC -:1027C000909149060E94DBF0209118023091190285 -:1027D0006217730704F5C0922904D0922A04E0928C -:1027E0002B04F0922C04EAEBFFE084918F010F5F41 -:1027F0001F4F882321F00E940232F801F6CFE6EA4B -:10280000F1E284918F010F5F1F4F882321F00E9416 -:102810000232F801F6CF8090211090902210A09003 -:102820002310B09024102091290430912A04409163 -:102830002B0450912C04C501B4010E9496EF6B014A -:102840007C0120E030E0A9010E94BDF187FF04C0B7 -:10285000F7FAF094F7F8F094E091041184E0E89F1F -:10286000F0011124EC5EFD4F2081318142815381C2 -:10287000C701B6010E94D2EB20E030E048E453E407 -:102880000E94BDF1181604F58092290490922A0442 -:10289000A0922B04B0922C04EAEBFFE084918F010C -:1028A0000F5F1F4F882321F00E940232F801F6CFFC -:1028B000E7E8F1E284918F010F5F1F4F882321F039 -:1028C0000E940232F801F6CF60914D0270914E02E3 -:1028D000072E000C880B990B0E9473EB20911F02AE -:1028E0003091200240912102509122020E94D2EBAD -:1028F0002AE037ED43E25CE30E94D2EB6D837E83F6 -:102900008F839887E090041119821A821B821C829F -:10291000CE0101966C018E010B5F1F4F21E230E169 -:102920004DE150E169E170E185E190E10E940141F2 -:1029300080E1E5E1F0E1ADE1B4E001900D928A952E -:10294000E1F728960FB6F894DEBF0FBECDBFDF913A -:10295000CF911F910F91FF90EF90DF90CF90BF909C -:10296000AF909F908F900895CF93DF93E091B5053E -:10297000F0E0E35DFB4F8081882381F0E4E8F1E241 -:102980008491EF012196882321F00E940232FE01FA -:10299000F7CF8AE0DF91CF910C940232DF91CF9193 -:1029A0000895CF93DF938091F90F8093FA0FEBE7AF -:1029B000F1E28491EF012196882321F00E940232F6 -:1029C000FE01F7CF8091740B9091750BA091760B5F -:1029D000B091770BBC01CD016F5F7F4F8F4F9F4F41 -:1029E0000E94E5358AE00E940232DF91CF91BCCF90 -:1029F0004F925F926F927F928F929F92AF92BF920F -:102A0000CF92DF92EF92FF921F93CF93DF93C0910B -:102A1000B50520E6C29FE0011124CB5CDB4F80911D -:102A20005A0B80FF1AC0EAEBFFE084917F016FEF41 -:102A3000E61AF60A811102C07E0104C00E94023229 -:102A4000F701F3CFF70181917F01882319F00E94EC -:102A50000232F8CF8AE00E9402321092750F109273 -:102A6000740F8FE38093780F1092770F1092760F88 -:102A70001092700F1092710F1092720F1092730FCC -:102A8000CE01EC01288101962032D9F32E34C9F40D -:102A9000898190ED980F9A3020F08D3211F08B32B1 -:102AA00081F4FE0132969F012F5F3F4F808180535A -:102AB0008A3010F4F901F7CFEF0131968881803226 -:102AC000D9F3D093DD05C093DC057E01FFEFEF1A4B -:102AD000FF0A18816AE270E0C7010E94F3F20097D2 -:102AE00031F0FC01319780818032E1F311821D3495 -:102AF00029F0143519F0173409F0EAC0F701808184 -:102B00002FEFE21AF20A8032C9F380538A3008F0BC -:102B1000DFC01093780F80E090E06AE03196DF012B -:102B200011972C91022E000C330B20533109689F12 -:102B3000A001699F500D1124C901840F951F2081A8 -:102B400020532A3058F39093770F8093760FDF014C -:102B500031962C912032D9F31D34D1F48E31910568 -:102B600091F03CF48731910571F08C31910581F43D -:102B70000AC08537910564F08737910524F0803AC3 -:102B800063E0960729F4B093750FA093740FA0C06B -:102B9000C12CD12C760140E050E0812C912C5401C5 -:102BA0008394FD0131967C9171110DC05093750F86 -:102BB0004093740FC092700FD092710FE092720F19 -:102BC000F092730F85C07132E1F41D34D1F480327C -:102BD0009105B9F4C092700FD092710FE092720F0C -:102BE000F092730FF093750FE093740F63E270E04F -:102BF000CF010E94F3F2009709F46AC0FC01108231 -:102C000067C071547A3108F040C09F01F9016081BA -:102C10002F5F3F4F6032D1F320ED260F2A30D8F0DE -:102C20006E3211F421810CC06D3211F06B3259F407 -:102C3000218130ED320F3A3070F02E3221F42281B2 -:102C400020532A3040F04115510509F052C0AF0120 -:102C5000415051094EC09F01A72FB0E0240135011A -:102C600004C0440C551C661C771C7A95D2F7C42806 -:102C7000D528E628F7282115310511F02C1B01C0B5 -:102C800020E0AA5AB04F2C9304C04115510509F415 -:102C9000AD01208121542A3110F4DF0182CF9F0140 -:102CA000F901D9016D916623C1F370ED760F7A3089 -:102CB00010F49D01F5CF73ED760F7230D0F36B32C7 -:102CC000C1F3F9012F5F3F4F60816032D1F3E5CF4F -:102CD000DF91CF911F91FF90EF90DF90CF90BF9049 -:102CE000AF909F908F907F906F905F904F900C94DB -:102CF000E11820E030E0B0CFCF92DF92EF92FF9268 -:102D00000F931F93CF93DF9300D01F92CDB7DEB701 -:102D10008091121190911311A0911411B09115117D -:102D2000B7FF08C0109212111092131110921411D3 -:102D3000109215118091F1109091F210A091F31062 -:102D4000B091F4104091121150911311609114112F -:102D50007091151184179507A607B70744F480935F -:102D6000121190931311A0931411B0931511809127 -:102D70001302882379F1409112115091131160913F -:102D80001411709115118091F5109091F610A09189 -:102D9000F710B091F8106A017B01C80ED91EEA1E27 -:102DA000FB1EC701B6010E9471EB20E030E048EC49 -:102DB00052E40E94D2EB69837A838B839C83CE0199 -:102DC00001960E94BEC1BC018091FB109091FC1045 -:102DD0000E94ED671091391011110AC08091FD1009 -:102DE000882309F442C080911302882309F43DC06E -:102DF000409112115091131160911411709115119D -:102E00008091F5109091F610A091F710B091F81004 -:102E10006A017B01C80ED91EEA1EFB1EC701B6015E -:102E20000E9471EB20E030E048EC52E40E94D2EBCB -:102E30000E94E0F0E091F910F091FA10309721F043 -:102E40006083718382839383E091FE10F091FF1081 -:102E5000309731F08091FD10811101C01111199549 -:102E60008091391081110E94D867109239100F900B -:102E70000F900F900F90DF91CF911F910F91FF90C6 -:102E8000EF90DF90CF900895CF92DF92EF92FF9274 -:102E90000F931F93CF93DF9300D01F92CDB7DEB770 -:102EA0008091121190911311A0911411B0911511EC -:102EB000B7FF08C010921211109213111092141142 -:102EC000109215118091F1109091F210A091F310D1 -:102ED000B091F4104091121150911311609114119E -:102EE0007091151184179507A607B70744F48093CE -:102EF000121190931311A0931411B0931511809196 -:102F00001302882379F140911211509113116091AD -:102F10001411709115118091F5109091F610A091F7 -:102F2000F710B091F8106A017B01C80ED91EEA1E95 -:102F3000FB1EC701B6010E9473EB20E030E048ECB5 -:102F400052E40E94D2EB69837A838B839C83CE0107 -:102F500001960E94BEC1BC018091FB109091FC10B3 -:102F60000E94ED6710913910111109C08091FD1078 -:102F7000882309F43FC0809113028823D9F140913E -:102F800012115091131160911411709115118091CB -:102F9000F5109091F610A091F710B091F8106A0119 -:102FA0007B01C80ED91EEA1EFB1EC701B6010E9496 -:102FB00073EB20E030E048EC52E40E94D2EBE09169 -:102FC000F910F091FA10309721F0608371838283B9 -:102FD0009383E091FE10F091FF10309731F08091D3 -:102FE000FD10811101C011111995809139108111C5 -:102FF0000E94D867109239100F900F900F900F9089 -:10300000DF91CF911F910F91FF90EF90DF90CF90C4 -:103010000895CF92DF92EF92FF920F931F93CF9379 -:10302000DF9300D01F92CDB7DEB78091121190913F -:103030001311A0911411B0911511B7FF08C010928F -:1030400012111092131110921411109215118091F7 -:10305000F1109091F210A091F310B091F410409102 -:103060001211509113116091141170911511841760 -:103070009507A607B70744F4809312119093131194 -:10308000A0931411B093151180911302882379F144 -:1030900040911211509113116091141170911511FA -:1030A0008091F5109091F610A091F710B091F81062 -:1030B0006A017B01C80ED91EEA1EFB1EC701B601BC -:1030C0000E9473EB2AE037ED43E25CE30E94D2EB0F -:1030D00069837A838B839C83CE0101960E945CC0B6 -:1030E000BC018091FB109091FC100E94ED67109143 -:1030F0003910111109C08091FD10882309F43FC0D7 -:10310000809113028823D9F140911211509113112B -:1031100060911411709115118091F5109091F61035 -:10312000A091F710B091F8106A017B01C80ED91E6A -:10313000EA1EFB1EC701B6010E9473EB2AE037EDC1 -:1031400043E25CE30E94D2EBE091F910F091FA10B7 -:10315000309721F06083718382839383E091FE1026 -:10316000F091FF10309731F08091FD10811101C076 -:10317000111119958091391081110E94D867109210 -:1031800039100F900F900F900F90DF91CF911F91FA -:103190000F91FF90EF90DF90CF900895CF92DF9244 -:1031A000EF92FF920F931F93CF93DF9300D01F9264 -:1031B000CDB7DEB78091121190911311A091141127 -:1031C000B0911511B7FF08C010921211109213118F -:1031D00010921411109215118091F1109091F2102B -:1031E000A091F310B091F41040911211509113116D -:1031F000609114117091151184179507A607B707F0 -:1032000044F48093121190931311A0931411B0936E -:10321000151180911302882379F140911211509178 -:10322000131160911411709115118091F510909106 -:10323000F610A091F710B091F8106A017B01C80E4A -:10324000D91EEA1EFB1EC701B6010E9473EB2AE0DD -:1032500037ED43E25CE30E94D2EB69837A838B8390 -:103260009C83CE0101960E941DC1BC018091FB1080 -:103270009091FC100E94ED6710913910111109C056 -:103280008091FD10882309F43FC0809113028823A8 -:10329000D9F1409112115091131160911411709154 -:1032A00015118091F5109091F610A091F710B09142 -:1032B000F8106A017B01C80ED91EEA1EFB1EC70169 -:1032C000B6010E9473EB2AE037ED43E25CE30E9413 -:1032D000D2EBE091F910F091FA10309721F0608371 -:1032E000718382839383E091FE10F091FF103097F9 -:1032F00031F08091FD10811101C01111199580915B -:10330000391081110E94D867109239100F900F90D8 -:103310000F900F90DF91CF911F910F91FF90EF9041 -:10332000DF90CF900895CF92DF92EF92FF920F93AC -:103330001F93CF93DF9300D01F92CDB7DEB780915C -:10334000121190911311A0911411B0911511B7FFA2 -:1033500008C01092121110921311109214111092B1 -:1033600015118091F1109091F210A091F310B0918D -:10337000F410409112115091131160911411709139 -:10338000151184179507A607B70744F48093121107 -:1033900090931311A0931411B093151180911302FF -:1033A000882379F1409112115091131160911411F9 -:1033B000709115118091F5109091F610A091F71071 -:1033C000B091F8106A017B01C80ED91EEA1EFB1EDF -:1033D000C701B6010E9473EB2FE632E143E85AE3DE -:1033E0000E94D2EB69837A838B839C83CE01019602 -:1033F0000E9429BCBC018091FB109091FC100E949E -:10340000ED6710913910111109C08091FD108823CA -:1034100009F43FC0809113028823D9F14091121121 -:103420005091131160911411709115118091F51044 -:103430009091F610A091F710B091F8106A017B01FD -:10344000C80ED91EEA1EFB1EC701B6010E9473EB0F -:103450002FE632E143E85AE30E94D2EBE091F91003 -:10346000F091FA10309721F0608371838283938307 -:10347000E091FE10F091FF10309731F08091FD1037 -:10348000811101C0111119958091391081110E948B -:10349000D867109239100F900F900F900F90DF9116 -:1034A000CF911F910F91FF90EF90DF90CF900895F3 -:1034B000CF92DF92EF92FF920F931F93CF93DF9300 -:1034C00000D01F92CDB7DEB78091121190911311E9 -:1034D000A0911411B0911511B7FF08C010921211EC -:1034E0001092131110921411109215118091F11075 -:1034F0009091F210A091F310B091F410409112113C -:103500005091131160911411709115118417950742 -:10351000A607B70744F48093121190931311A09358 -:103520001411B093151180911302882379F1409101 -:103530001211509113116091141170911511809115 -:10354000F5109091F610A091F710B091F8106A0163 -:103550007B01C80ED91EEA1EFB1EC701B6010E94E0 -:1035600073EB2AE037ED43E25CE30E94D2EB698320 -:103570007A838B839C83CE0101960E94EEC2BC01AC -:103580008091FB109091FC100E94ED671091391012 -:10359000111109C08091FD10882309F43FC080916A -:1035A00013028823D9F140911211509113116091A7 -:1035B0001411709115118091F5109091F610A09151 -:1035C000F710B091F8106A017B01C80ED91EEA1EEF -:1035D000FB1EC701B6010E9473EB2AE037ED43E200 -:1035E0005CE30E94D2EBE091F910F091FA10309771 -:1035F00021F06083718382839383E091FE10F091C8 -:10360000FF10309731F08091FD10811101C0111130 -:1036100019958091391081110E94D8671092391044 -:103620000F900F900F900F90DF91CF911F910F91FE -:10363000FF90EF90DF90CF900895CF92DF92EF92BE -:10364000FF920F931F93CF938091121190911311BA -:10365000A0911411B0911511B7FF08C0109212116A -:103660001092131110921411109215118091F110F3 -:103670009091F210A091F310B091F41040911211BA -:1036800050911311609114117091151184179507C1 -:10369000A607B70744F48093121190931311A093D7 -:1036A0001411B0931511809113028823E1F1409118 -:1036B0001211509113116091141170911511809194 -:1036C000F5109091F610A091F710B091F8108A01C2 -:1036D0009B01080F191F2A1F3B1FC901B8010E9437 -:1036E00073EB6B017C0120E030E0A9010E946DEBDF -:1036F00087FD05C020E030E040E05FE304C020E04B -:1037000030E040E05FEBC701B6010E9497EF0E94F6 -:10371000DBF0CB010E940DC4BC018091FB109091A5 -:10372000FC100E94ED67C0913910C11108C0809152 -:10373000FD108823C9F1809113028823A9F14091DB -:103740001211509113116091141170911511809103 -:10375000F5109091F610A091F710B091F8108A0131 -:103760009B01080F191F2A1F3B1FC901B8010E94A6 -:1037700073EBE091F910F091FA10309721F060832B -:10378000718382839383E091FE10F091FF10309754 -:1037900031F08091FD10811101C0C1111995809106 -:1037A000391081110E94D86710923910CF911F9162 -:1037B0000F91FF90EF90DF90CF90089580911211BC -:1037C00090911311A0911411B0911511B7FF08C079 -:1037D00010921211109213111092141110921511CF -:1037E0008091F1109091F210A091F310B091F4102B -:1037F0004091121150911311609114117091151193 -:1038000084179507A607B70744F480931211909385 -:103810001311A0931411B0931511809113028823F2 -:1038200099F020911211309113118091F51090911F -:10383000F610820F931F0E940DC4BC018091FB10F3 -:103840009091FC100E94ED6720913910211108C061 -:103850008091FD10882339F180911302882319F19A -:1038600040911211509113118091F5109091F61022 -:10387000840F951FE091F910F091FA10309711F034 -:1038800091838083E091FE10F091FF10309731F02A -:103890008091FD10811101C021111995809139107D -:1038A00081110E94D8671092391008954F925F924B -:1038B0006F927F928F929F92AF92BF92CF92DF9240 -:1038C000EF92FF920F931F93CF93DF93CDB7DEB7A5 -:1038D0002A970FB6F894DEBF0FBECDBF1091280215 -:1038E0001F3F09F44BC00E94EDDBC0902F10D09019 -:1038F0003010E0903110F0903210DC01CB018C19C7 -:103900009D09AE09BF09B7FD39C08091EF0B9091B9 -:10391000F00B8F5F8F70891789F1133009F45AC249 -:10392000E090041124E01202F0011124E550FD4F53 -:1039300020E030E040E752E4608171818281938130 -:103940000E9473F069837A838B839C831D821E821D -:103950001F821886AE014B5F5F4F6A018E010F5FB9 -:103960001F4F29E234E045E254E061E274E08DE16A -:1039700094E00E9401418FEF809328020E94D9C4F5 -:1039800080911C1282FF40C08091461081113EC080 -:1039900081E08093461090913A10892780933910E6 -:1039A00010923A1083E08093130210921C120E942E -:1039B000EDDBDC01CB018C509E4FAF4FBF4F8093AE -:1039C0001D1290931E12A0931F12B093201288E82C -:1039D00093E19A87898782E090E09A838983BE0188 -:1039E000675F7F4FCE0101960E9494DB16E0115075 -:1039F00069F085E19CE00E94372F62E070E080E092 -:103A000090E00E9452BEF3CF1092461099B181E02F -:103A1000292F207194FD80E010914510811739F114 -:103A2000809345102111DCC164EF71E080E090E0EB -:103A30000E9443C40E9455DA123009F0CDC11092A1 -:103A4000600C8BE1EDE6FCE0ACE8BCE001900D928F -:103A50008A95E1F780916B0C90916C0C90938B0C94 -:103A600080938A0C83E0809313020E944EC80E94C8 -:103A7000EDDB6B017C018091411090914210A0918F -:103A80004310B0914410A7019601281B390B4A0B33 -:103A90005B0B57FF05C080913810882309F4DDC106 -:103AA000D701C6018C599F4FAF4FBF4F8093411034 -:103AB00090934210A0934310B093441080911B1236 -:103AC000082E000C990B97FF03C0919581959109E1 -:103AD00084302CF480913910811194C0A4C080915D -:103AE0001611882309F467C080911B12809034104E -:103AF00090903510A0903610B0903710811491043A -:103B0000A104B10409F44AC0082E000C990B97FFD8 -:103B100003C0919581959109682F87FF02C063E0EA -:103B2000680F65956595062E000C770B880B990B31 -:103B30000E9473EB2B013C01C701B601681979099A -:103B40008A099B090E9471EB9B01AC01C301B20180 -:103B50000E9473F020E030E04AE754E40E94D2EB88 -:103B60004B015C0120E030E040E253E40E94BDF1F3 -:103B700087FF0FC020E030E046E952E4C501B40100 -:103B80000E94BDF187FD0AC02AE030E040E050E02D -:103B900009C024E630E040E050E004C021E030E01D -:103BA00040E050E0C0923410D0923510E0923610D0 -:103BB000F092371004C021E030E040E050E0A091E6 -:103BC0001B120A2E000CBB0B0E94A6F224E030E070 -:103BD00040E050E00E9482F2809112119091131106 -:103BE000A0911411B0911511820F931FA41FB51F3E -:103BF0008093121190931311A0931411B093151187 -:103C000010921B12D701C6018856954CAF4FBF4F7B -:103C100080933D1090933E10A0933F10B0934010BE -:103C200081E08093130280914302909144028C556D -:103C3000914641F480912902882309F4DEC0815025 -:103C40008093290280916F00282F227081FF05C088 -:103C500080916F008D7F80936F0080911F069091FF -:103C60002006A0912106B0912206222329F020915E -:103C70006F00226020936F003AE0B695A795979564 -:103C800087953A95D1F7009741E0A407B10520F058 -:103C90008FEF9FEFA0E0B0E09695879520911302FB -:103CA000211105C0309138103111D3C059C000978F -:103CB00041F040913B1050913C104817590708F0D3 -:103CC0004FC080913810811113C0223050F0243041 -:103CD00028F0243031F41092130203C081E0809365 -:103CE00013020E94375181E08093111180933810A4 -:103CF00084E00E946DC881E08093D20BE091430282 -:103D0000F091440219951092111180913810882376 -:103D100051F00E941A5091E0811101C090E09093FF -:103D2000381081117AC01092391080903B10909019 -:103D30003C10A12CB12C0E94EDDBDC01CB018C19D5 -:103D40009D09AE09BF0988169906AA06BB0640F46C -:103D50000E94EDDB6C197D0970933C1060933B1061 -:103D600080914302909144028C55914621F08091BC -:103D70003310882379F088E9C80E8AE3D81EE11C45 -:103D8000F11CC0923D10D0923E10E0923F10F09294 -:103D9000401014C080913D1090913E10A0913F10B2 -:103DA000B0914010C81AD90AEA0AFB0AF7FC06C00B -:103DB0008091940B833011F00E94D267809138106B -:103DC00081114BC080911302813009F046C01092DE -:103DD000130243C0E12CA6CD60E083E193E20AC068 -:103DE0001092350C1092360C123009F43BCE60E084 -:103DF00086E093E20E9430C535CE8CE080932902A4 -:103E000080913B1090913C10019790933C108093CF -:103E10003B1081E08093130215CF80903B1090906F -:103E20003C10A12CB12C0E94EDDBDC01CB018C19E4 -:103E30009D09AE09BF0988169906AA06BB0668F453 -:103E40000E94EDDB6C197D0970933C1060933B1070 -:103E500004C0009709F44CCF2CCF2A960FB6F894E3 -:103E6000DEBF0FBECDBFDF91CF911F910F91FF90AD -:103E7000EF90DF90CF90BF90AF909F908F907F900A -:103E80006F905F904F900895FC0180E090E0249146 -:103E9000222339F02491207C203809F001963196B4 -:103EA000F6CF0895FC0120E030E09191992331F0A4 -:103EB000907C9038D1F32F5F3F4FF7CFC901089521 -:103EC000CF93DF930E944EC8E4E0F1E080818F7DC4 -:103ED0008083C5E0D1E0888180958072A3E0B1E065 -:103EE0008C9380818F7B80838881809580748C9374 -:103EF0006A98729A54985C9A82E0809345100E9466 -:103F0000D9C410921B12DF91CF910895CF93DF9304 -:103F1000EC010E94A96040E050E0BA01CE01DF91BF -:103F2000CF910C94C9602F923F924F925F926F9203 -:103F30007F928F929F92AF92BF92CF92DF92EF9239 -:103F4000FF920F931F93CF93DF930E947DBBD0917D -:103F50000D11C0E087E4282E80E1382E9CED892EDB -:103F600095E0992EA12CB12C26ED422E26E0522E62 -:103F7000612C712C33E9E32E39E9F32E42E8C42E8B -:103F800043E7D42ED11123C080911011882331F042 -:103F900080911302882309F44FC00DC0809139101D -:103FA0008823B1F3109239100E94D86780910F11C5 -:103FB000882371F3CDC081E090911011911180E0C0 -:103FC00024E048E254E26C2F0E9494C435C0D13002 -:103FD00099F580911011813029F08091130281119F -:103FE00016C02AC0809139108823B9F31092391075 -:103FF00080914B108D2780934B1083E080931302A8 -:104000000E94827380910F11882339F3A1C080919F -:104010004B10811103C027E134E202C02BE134E2EE -:1040200081E090911011913009F080E001E04FE1C2 -:1040300054E26C2F0E94E7E380914B10882309F42F -:104040007FC0D23009F07AC080911011823031F0F7 -:1040500080911302882309F471C05EC080913910E9 -:104060008823B1F31092391091E0909316111092B9 -:1040700034101092351010923610109237100E94A2 -:10408000A96083E0809313028DE094E29093FC108A -:104090008093FB103092FA102092F9108092F51064 -:1040A0009092F610A092F710B092F8104092F11092 -:1040B0005092F2106092F3107092F41020E030E011 -:1040C0004AE754E46091471070914810809149107C -:1040D00090914A100E94D2EB20E030E84BEB54E480 -:1040E0000E9496EF0E94E0F06093121170931311FA -:1040F0008093141190931511F0924402E0924302C0 -:10410000D092FF10C092FE101092FD1080910F11FE -:10411000882309F49DCF1CC011E0809110118230DA -:1041200009F010E087E490E10E9429BC00E09C01C6 -:1041300043E054E26C2F812F0E94E7E383E001C04B -:1041400082E0CF5FDF5FC53009F01CCF80930E1196 -:10415000DF91CF911F910F91FF90EF90DF90CF9063 -:10416000BF90AF909F908F907F906F905F904F9097 -:104170003F902F900895CF93DF930E947DBBD09105 -:104180000D11C0E0D11120C080911011882331F0B1 -:1041900080911302882309F474C00DC080913910F6 -:1041A0008823B1F3109239100E94D86780910F11C3 -:1041B000882371F39FC081E090911011911180E0EC -:1041C00024E04BEF53E25AC0D13011F58091101129 -:1041D000813031F080911302882309F452C00EC05F -:1041E000809139108823B1F31092391083ED9BEC44 -:1041F0008DDE80910F11882369F37CC081E090915E -:104200001011913009F080E023E042EF53E236C014 -:10421000D23009F580911011823029F0809113027B -:10422000882379F10EC0809139108823B9F3109258 -:1042300039108BEC98EC6ADE80910F11882371F3B2 -:1042400059C081E090911011923009F080E023E094 -:1042500045EE53E213C0D33051F5809110118330F5 -:10426000C1F080911302882361F081E090911011D8 -:10427000933009F080E023E040EE53E26C2F0E947F -:1042800094C4CF5FDF5FC53009F07CCFC0930E11BF -:1042900031C080913910882321F31092391082EEB9 -:1042A00094EA34DE80910F118823D9F223C0D430F0 -:1042B00041F780911011843029F0809113028823F6 -:1042C00001F30EC0809139108823B9F31092391090 -:1042D00086E693EA1BDE80910F11882371F30AC0F2 -:1042E00081E090911011943009F080E023E047EDD7 -:1042F00053E2C4CFDF91CF9108958F929F92AF92F6 -:10430000BF92CF92DF92EF92FF920F931F93CF93C2 -:10431000DF93CDB7DEB76F970FB6F894DEBF0FBE51 -:10432000CDBF81E08093B20E1092B40E1092B30E06 -:104330008CE89CE00E9477898BE1ECE8FCE0DE01F0 -:10434000159601900D928A95E1F780918A0C9091D3 -:104350008B0C9C838B8387E692E09A83898340E071 -:1043600050E0BE016F5F7F4F80E090E00E949B5164 -:10437000CE0101960E940D908090B30E9090B40EE5 -:104380000E947DBBE0900D11F12CE11021C08091C5 -:104390001011882329F0809113028823C9F00DC0E1 -:1043A000809139108823B9F3109239100E94D86790 -:1043B00080910F11882379F376C181E090911011DB -:1043C000911180E024E04AE454E26F2D0E9494C4ED -:1043D00068E37CE08CE89CE00E943F888091380C88 -:1043E0008F3209F45EC041E0E4125DC0909110117B -:1043F000913009F047C080913910882309F442C0F8 -:10440000109239108091DD0D882319F1815080932D -:10441000DD0D882361F090E001974FE1489F900106 -:10442000499F300D1124C9018955934F02C089E677 -:104430009CE02BE1FC013496ACE8BCE001900D92CD -:104440002A95E1F7FC018281938190938B0C8093F4 -:104450008A0C81E090E0A0E0B0E02091DD0D211118 -:1044600003C080E090E0DC0180931211909313115F -:10447000A0931411B093151110920D1181E0809347 -:104480000F11C0C080911302882369F081E0913040 -:1044900009F080E020E246E454E26F2D0E9494C4CB -:1044A00002C081E001C082E001E0080F6401F1E098 -:1044B000CF1AD1081FEF100F4FEFC416D40609F41E -:1044C000EBC0E112E7C060E070E0C6010E946153FA -:1044D0008091370C90911011882309F4A1C09E118E -:1044E00095C080913910882309F490C0109239103A -:1044F0001D8218861C821B8287E692E09A8389833C -:1045000080918F0C811103C069E67CE002C068E8ED -:104510007CE06115710519F06C5F7F4F02C060E0AF -:1045200070E021E048E35CE0CE0105960E94A68D94 -:10453000882361F18BE1FE013596ACE8BCE0019087 -:104540000D928A95E1F72B813C8130938B0C20935F -:104550008A0C8091DD0D8A3008F03DC091E0980F03 -:104560009093DD0DEFE18E9FC0011124DC01A55574 -:10457000B34F4BE1ECE8FCE001900D924A95E1F776 -:10458000FC01E955F34F3383228325C0EAEBFFE0BA -:1045900084918F010F5F1F4F882321F00E94023208 -:1045A000F801F6CFE0E3F4E284918F010F5F1F4F33 -:1045B000882321F00E940232F801F6CF08E31CE0C4 -:1045C000F80181918F01882319F00E940232F8CFFF -:1045D0008AE00E940232CE0101960E940D90109254 -:1045E0000D1182E090E0A0E0B0E080931211909372 -:1045F0001311A0931411B093151181E080930F1142 -:104600001092381083E0809313024DC08091130202 -:10461000882309F43FC081E0911380E041E037C076 -:104620009E1529F0809113028823A1F12AC0809160 -:1046300039108823B9F31092391088E39CE00E9466 -:1046400007BB68E37CE088E79BE00E9407F388E310 -:10465000A82E8CE0B82EF50181915F01882319F016 -:104660000E940232F8CF8AE00E9402321092940B2C -:104670000E94D2670E9411CF80910F11882391F27E -:1046800012C081E090911011911380E040E06F2DF5 -:104690000E946DE50F5F0BCFF394E39445E0F412B5 -:1046A00074CE10930E116F960FB6F894DEBF0FBE46 -:1046B000CDBFDF91CF911F910F91FF90EF90DF90D1 -:1046C000CF90BF90AF909F908F9008959F92AF92A0 -:1046D000BF92CF92DF92EF92FF920F931F93CF93EF -:1046E000DF930E947DBBD0910D11C0E0992493947B -:1046F00049E0C42E48E9D42E53E3A52E5EECB52E36 -:10470000D11123C080911011882331F080911302C0 -:10471000882309F4CBC00DC0809139108823B1F3F0 -:10472000109239100E94D86780910F11882371F37D -:104730003DC181E090911011911180E024E040EDA5 -:1047400053E26C2F0E9494C4B1C0D13009F047C02D -:1047500080911011813031F080911302882309F487 -:10476000A5C02EC0809139108823B1F31092391062 -:10477000D0931611109234101092351010923610FA -:1047800010923710E12C1CE3F12E0CE116E420E02E -:1047900030E040EA50E46BE57BE086EC93E20E9477 -:1047A000BBE4D0924402C0924302B092FF10A092A8 -:1047B000FE101092FD1080910F11882369F2F6C04F -:1047C00011E080911011813009F010E08BE59BE041 -:1047D0000E945CC000E09C014CEB53E263C0D2300D -:1047E00009F047C080911011823031F0809113029E -:1047F000882309F45BC02EC0809139108823B1F35F -:1048000010923910909216111092341010923510A7 -:104810001092361010923710E12C1CE3F12E0CE1AF -:1048200016E420E030E040EA50E46FE57BE082EB04 -:1048300093E20E94BBE4D0924402C0924302B09241 -:10484000FF10A092FE101092FD1080910F1188238E -:1048500069F2ACC011E080911011823009F010E0D3 -:104860008FE59BE00E945CC000E09C0148EA53E2B7 -:1048700019C0D33009F051C0809110118330F1F08C -:1048800080911302882391F011E080911011833000 -:1048900009F010E083E69BE00E945CC000E09C0110 -:1048A00044E953E26C2F812F0E94E7E3CF5FDF5F83 -:1048B000C53009F025CFC0930E1178C08091391012 -:1048C0008823F1F210923910909216111092341040 -:1048D000109235101092361010923710E12C1CE314 -:1048E000F12E0CE116E420E030E040EA50E463E60B -:1048F0007BE08EE993E20E94BBE4D0924402C09236 -:104900004302B092FF10A092FE101092FD10809111 -:104910000F11882309F4B4CF49C0D43039F68091FF -:104920001011843031F080911302882309F4BECF36 -:104930002EC0809139108823B1F3109239109092D3 -:1049400016111092341010923510109236101092E9 -:104950003710E12C1CE3F12E0CE116E420E030E0EE -:1049600040EA50E467E67BE08AE893E20E94BBE419 -:10497000D0924402C0924302B092FF10A092FE1067 -:104980001092FD1080910F11882369F20FC011E081 -:1049900080911011843009F010E087E69BE00E94BE -:1049A0005CC000E09C0140E853E27CCFDF91CF91F6 -:1049B0001F910F91FF90EF90DF90CF90BF90AF903D -:1049C0009F9008953F924F925F926F927F928F9245 -:1049D0009F92AF92BF92CF92DF92EF92FF920F938E -:1049E0001F93CF93DF930E947DBBD0910D11C0E048 -:1049F0005524539443E0442E5EED352E69E4C62ED3 -:104A000063E2D62E71E5A72E73E2B72EE1E68E2E75 -:104A1000E3E29E2EF9E66F2EF3E27F2ED11123C042 -:104A200080911011882331F080911302882309F4BA -:104A3000C5C00DC0809139108823B1F31092391090 -:104A40000E94D86780910F11882371F356C181E0CD -:104A500090911011911180E024E049E753E26C2F0E -:104A60000E9494C4ABC0D13009F04DC080911011A8 -:104A7000813031F080911302882309F49FC024C053 -:104A8000809139108823B1F310923910D093161108 -:104A90001092341010923510109236101092371078 -:104AA000E12C10E8F12E07E714E420E030E040E8C4 -:104AB0005FE36FED75E081E793E20E9408E6809185 -:104AC0000F118823B9F219C14F923F921F925F9242 -:104AD0008FED95E09F938F939F928F927F926F922D -:104AE000CF9381E090911011913009F080E08F9385 -:104AF0000E944CE48DB79EB70C960FB6F8949EBFFB -:104B00000FBE8DBF5BC0D23009F04DC08091101137 -:104B1000823031F080911302882309F44FC024C001 -:104B2000809139108823B1F31092391050921611E8 -:104B300010923410109235101092361010923710D7 -:104B4000E12C10E8F12E07E714E420E030E040E823 -:104B50005FE363EE75E089E593E20E9408E68091E9 -:104B60000F118823B9F2C9C04F923F921F925F92F2 -:104B700083EE95E09F938F93DF92CF92BF92AF9297 -:104B8000CF9381E090911011923009F080E08F93E3 -:104B90000E944CE48DB79EB70C960FB6F8949EBF5A -:104BA0000FBE8DBF0BC0D33009F053C080911011E0 -:104BB000833061F080911302811138C0CF5FDF5FD5 -:104BC000C53009F02BCFC0930E1197C080913910DA -:104BD000882381F3109239105092161110923410DC -:104BE000109235101092361010923710E12C10E808 -:104BF000F12E07E714E42DEC3CEC4CEC5DE367EEA2 -:104C000075E081E493E20E94BBE48EEC98E9909316 -:104C10004402809343021092FF101092FE101092F3 -:104C2000FD1080910F11882329F267C011E0809157 -:104C30001011833009F010E087EE95E00E941DC14D -:104C400000E09C0149E353E26C2F812F0E94E7E3CF -:104C5000B5CFD43009F0B2CF80911011843031F04B -:104C600080911302882309F4A9CF24C080913910C0 -:104C70008823B1F31092391050921611109234100B -:104C8000109235101092361010923710E12C10E867 -:104C9000F12E07E714E420E030E040E85FE36BEE3C -:104CA00075E081E393E20E9408E680910F1188236A -:104CB000B9F223C04F923F921F925F928BEE95E024 -:104CC0009F938F9381E293E29F938F9389E293E284 -:104CD0009F938F93CF9381E090911011943009F0BE -:104CE00080E08F930E944CE48DB79EB70C960FB670 -:104CF000F8949EBF0FBE8DBF61CFDF91CF911F9102 -:104D00000F91FF90EF90DF90CF90BF90AF909F906A -:104D10008F907F906F905F904F903F900895DF92BB -:104D2000EF92FF920F931F93CF93DF93EC01D62E58 -:104D30001CAD0BAD7C0184E0E80EF11CE98DFA8D11 -:104D4000C7011995412F480F2D2D602FC7010E94D3 -:104D500064BF9BAD890F8BAF81E090E0DF91CF9175 -:104D60001F910F91FF90EF90DF900895FF920F93A6 -:104D70001F93CF93DF938C01EB01F42E80E20E940E -:104D800002328FEFF81611F084E501C082E40E9430 -:104D900002328AE30E940232F801608171818281CD -:104DA000938142E00E94DB37488159816A817B818F -:104DB00080E896E20E94DC5D62E070E080E090E0D6 -:104DC000DF91CF911F910F91FF900C9452BE909163 -:104DD000050194709093030187FD76C0A39890918C -:104DE0000501909594709093030190910501947042 -:104DF00090930301982F990F86FD72C0A39880911C -:104E00000501809584708093030180910501847071 -:104E100080930301292F220F96FD60C0A3988091F3 -:104E20000501809584708093030180910501847051 -:104E300080930301922F990F26FD4EC0A398809175 -:104E40000501809584708093030180910501847031 -:104E500080930301292F220F96FD3CC0A3988091D7 -:104E60000501809584708093030180910501847011 -:104E700080930301922F990F26FD2AC0A398809159 -:104E800005018095847080930301809105018470F1 -:104E900080930301292F220F96FD18C0A3988091BB -:104EA00005018095847080930301809105018470D1 -:104EB0008093030126FD16C0A3988091050180957B -:104EC0008470809303010895A39A89CFA39AE7CFB2 -:104ED000A39AD5CFA39AC3CFA39AB1CFA39A9FCFBA -:104EE000A39A8DCFA39A80910501809584708093B9 -:104EF000030108958F929F92AF92BF92CF92DF925B -:104F0000EF92FF920F931F93CF93DF93F7E1FF2E62 -:104F1000E12CAE2DB0E0BD016F0D711D759567954B -:104F20006E1511F0F6120BC0E9EAF4E26591749186 -:104F3000072E000C880B990B0E9473EB62C09B013B -:104F400021503109220F331F220F331FF901E15B7A -:104F5000FB4D05911491AB01440F551F440F551F94 -:104F6000FA01E15BFB4DC591D4918017910714F4D0 -:104F7000F62ED1CFC817D90714F4E62ECACFF901FF -:104F8000EF5AFB4DE590F490FA01EF5AFB4DC590B6 -:104F9000D490BC01601B710B072E000C880B990B81 -:104FA0000E9473EB4B015C01B6016E197F09072E5D -:104FB000000C880B990B0E9473EB9B01AC01C5019F -:104FC000B4010E94D2EB4B015C01C01BD10BBE01AE -:104FD000DD0F880B990B0E9473EB9B01AC01C5019F -:104FE000B4010E9473F04B015C01B701FF0C880B08 -:104FF000990B0E9473EB9B01AC01C501B4010E94A7 -:1050000097EFDF91CF911F910F91FF90EF90DF907D -:10501000CF90BF90AF909F908F9008950F931F9364 -:10502000CF93DF93CDB7DEB728970FB6F894DEBFE6 -:105030000FBECDBF6091021170910311072E000CBD -:10504000880B990B0E9473EB6D837E838F83988707 -:105050008091460690914706A0914806B091490676 -:1050600089839A83AB83BC834DEFBE016B5F7F4F17 -:10507000CE0101967BDE6091001170910111072E27 -:10508000000C880B990B0E9473EB6D837E838F83DA -:1050900098878091040F9091050FA091060FB09111 -:1050A000070F89839A83AB83BC834FEFBE016B5F8D -:1050B0007F4FCE0101965ADEE8E8F6E284918F0137 -:1050C0000F5F1F4F882321F00E940232F801F6CFB4 -:1050D000E0915B10F0E0E75AFF4E608170E080E005 -:1050E00090E00E94E535E3E8F6E284918F010F5FDE -:1050F0001F4F882321F00E940232F801F6CF609101 -:105100005A1070E080E090E00E94E53528960FB6D6 -:10511000F894DEBF0FBECDBFDF91CF911F910F91ED -:1051200008950F930FB70F9300916E000B7F0093BC -:105130006E0078940F930BB70F930CB70F921F92DA -:105140002F933F934F935F936F937F938F939F938F -:10515000AF93BF93EF93FF931124C9D1FF91EF91C8 -:10516000BF91AF919F918F917F916F915F914F917F -:105170003F912F911F900F900CBF0F910BBF0F917C -:105180000460F89400936E000F910FBF0F91189573 -:105190002F923F924F925F926F927F928F929F9247 -:1051A000AF92BF92CF92DF92EF92FF920F931F9335 -:1051B000CF93DF9300D01F92CDB7DEB75C017A8327 -:1051C00069834A01170107FD07C0802F002E000CDC -:1051D000990B9C838B8304C0E1E0F0E0FC83EB83BC -:1051E000F90140805180628073808B819C81880F9F -:1051F000991F880F991F9C838B83845A9F4E7C0133 -:10520000A3019201FC0160817181828193810E94DE -:105210006DEB882391F0F7014082518262827382A4 -:1052200011E020E030E0A901C301B2010E94BDF10C -:1052300018160CF010E0F5011083F5018081823022 -:10524000D1F0833009F45EC0813009F07DC0EB817C -:10525000FC81E45AFF4E2081318142815381F40167 -:1052600060817181828193810E946DEB87FD6CC0AA -:1052700082E0F50180838B819C81845A9F4E9C83C0 -:105280008B83B60180E090E00E9471EB9B01AC0142 -:10529000EB81FC8160817181828193810E9496EF14 -:1052A0009B01AC01F40160817181828193810E9434 -:1052B000BDF187FD14C00E94EDDB6B017C01910103 -:1052C000A8EEB3E00E9487EFC60ED71EE81EF91EB7 -:1052D000E981FA81C082D182E282F38235C00E94E4 -:1052E000EDDBE981FA81C080D180E280F380DC01CE -:1052F000CB018C199D09AE09BF09B7FD25C083E01C -:10530000F50180830F3F19F04BEA55E202C04EEBE6 -:1053100055E262ED75E2802F0F900F900F900F9085 -:10532000DF91CF911F910F91FF90EF90DF90CF9081 -:10533000BF90AF909F908F907F906F905F904F90B5 -:105340003F902F900C94E8B30F900F900F900F9018 -:10535000DF91CF911F910F91FF90EF90DF90CF9051 -:10536000BF90AF909F908F907F906F905F904F9085 -:105370003F902F900895CF92DF92EF92FF92C090CE -:10538000040FD090050FE090060FF090070F60918A -:1053900000117091011166507109072E000C880BE5 -:1053A000990B0E9473EB9B01AC01C701B6010E94EF -:1053B0006DEB87FF1FC020E030E040E050E4C70104 -:1053C000B6010E9497EF0E94E0F07093571060932F -:1053D00056100E94EDDBDC01CB01805A9541AF4FA6 -:1053E000BF4F8093521090935310A0935410B093DA -:1053F000551008C010925210109253101092541071 -:1054000010925510FF90EF90DF90CF900895CF92BB -:10541000DF92EF92FF92C0904606D0904706E09050 -:105420004806F09049066091021170910311665090 -:105430007109072E000C880B990B0E9473EB9B01DE -:10544000AC01C701B6010E946DEB87FF1FC020E0D1 -:1054500030E040E050E4C701B6010E9497EF0E949F -:10546000E0F070935110609350100E94EDDBDC016E -:10547000CB01805C9346AF4FBF4F80934C1090930D -:105480004D10A0934E10B0934F1008C010924C10C6 -:1054900010924D1010924E1010924F10FF90EF90FE -:1054A000DF90CF9008951092C605109203111092CC -:1054B000021180E0ACDF10920111109200115BDF4D -:1054C0000E9400B8109203111092021180E09FDF39 -:1054D0001092591080910201807480930001109203 -:1054E00001111092001110925A1075980895CF92E0 -:1054F000DF92EF92FF920F931F93CF93DF93CDB77D -:10550000DEB7A0970FB6F894DEBF0FBECDBF1091E7 -:105510002C028CE20E94F9BC892B09F0EEC080912C -:10552000780B882309F4E9C08091940B8111E5C0C0 -:1055300080913312813009F0E0C0609102117091C6 -:105540000311072E000C880B990B0E9473EB20E0CF -:1055500030E040E05FE30E9497EF0E94E0F070933C -:10556000890B6093880B6091001170910111072ED7 -:10557000000C880B990B0E9473EB20E030E040E0B8 -:105580005FE30E9497EF0E94E0F070938B0B6093B3 -:105590008A0B89DF0E941590209180103091811034 -:1055A00040918210509183106091250470912604DF -:1055B00080912704909128040E9497EF20E030E02A -:1055C00040E251E40E94D2EB0E94E0F07093870B1E -:1055D0006093860B6091290470912A0480912B04BA -:1055E00090912C040E94E0F06093900B7093910BCB -:1055F0008093920B9093930B0E94964E60938C0B2A -:1056000070938D0B80938E0B90938F0B83E0809320 -:10561000940B0E94BC680BE813E0D8018D918D01BA -:10562000882319F00E940232F8CF8AE00E940232E9 -:1056300080918B0B8F9380918A0B8F938091890B34 -:105640008F938091880B8F9380918F0B8F93809194 -:105650008E0B8F9380918D0B8F9380918C0B8F93FA -:105660008091930B8F938091920B8F938091910BEC -:105670008F938091900B8F938091870B8F93809164 -:10568000860B8F9389E696E29F938F938E010F5F2F -:105690001F4F1F930F930E9407EB78010FB6F894EA -:1056A000DEBF0FBECDBF6801D6018D916D0188238D -:1056B00019F00E940232F8CF8AE00E94023288E795 -:1056C0009BE09F938F9384E596E29F938F931F9324 -:1056D0000F930E9407EB0F900F900F900F900F9079 -:1056E0000F90F70181917F01882319F00E94023207 -:1056F000F8CF8AE00E940232FFCF1F37A0F01F5779 -:10570000909159109093771080910201911180959A -:1057100080748093000180915A10809376108823C2 -:1057200079F0759A0EC080917710181728F0809143 -:10573000020180748093000180917610181708F0A0 -:1057400075981F5F10932C029091751081E0892746 -:105750008093751081110E94D9C480912B028530ED -:105760001CF411E0180F01C010E0823009F4A0C051 -:105770004CF48823F9F0813009F0CEC010927B0000 -:1057800080E4ACC0843009F4B1C00CF4A4C085300E -:1057900009F0C2C090917410911102C080937410EE -:1057A00080917410815080937410882309F4B4C0E0 -:1057B00015E0B2C080912A028F5F80932A02803167 -:1057C0000CF4AAC010922A0280915810811113C0C3 -:1057D00080916A1090916B1090936710809366107F -:1057E0008091681090916910909365108093641077 -:1057F00081E0809358108AE0EAE6F0E1DF011D9233 -:105800008A95E9F71092691010926810E09066107E -:10581000F0906710F194E194F10800915910809193 -:105820000B0490910C049195819591098E159F051B -:1058300044F4002331F042EE55E263E076E280E08A -:10584000C7D78091020290910302919581959109A9 -:10585000E816F90644F4002331F045E156E266E328 -:1058600076E280E0B5D700915A10E0906410F09095 -:1058700065108091090490910A048E159F0544F0EB -:10588000002331F042EF55E263E076E28FEFA0D7DC -:105890008091000290910102E816F906ECF10023D4 -:1058A000D9F145E256E266E376E28FEF91D734C054 -:1058B00080917A0086FD2DC08091780090917900CA -:1058C00020916A1030916B10820F931F90936B1090 -:1058D00080936A1021C010927B0082E480937C0048 -:1058E00080917A00806480937A0016C080917A005B -:1058F00086FD11C080917800909179002091681008 -:1059000030916910820F931F9093691080936810F3 -:1059100003C012E001C014E010932B0220E030E03D -:10592000A4E0C901880F991FFC01EC5CFD4E608169 -:1059300071816115710509F433C0F8942230E9F4DE -:10594000509109015470159840910B0116161706D5 -:105950000CF44095447040930901000000000000E1 -:10596000429A4A2F4A950000E9F7429840910B016C -:10597000511140954470409309017894FC01EC5C0E -:10598000FD4E161617063CF44081518141505109D5 -:105990005183408305C080819181019691838083EA -:1059A0002F5F3F4F2330310509F0BBCF80911004AA -:1059B00081110E94427680916B0B90916C0B009745 -:1059C00079F0019790936C0B80936B0B892B41F4CA -:1059D00088E496E290931A11809319110E942E3256 -:1059E000A0960FB6F894DEBF0FBECDBFDF91CF916A -:1059F0001F910F91FF90EF90DF90CF9008958F92BD -:105A00009F92AF92BF92CF92DF92EF92FF920F934D -:105A10001F93CF93DF93F0E4FF2EE12CAE2DB0E087 -:105A2000BD016F0D711D759567956E1511F0F6121C -:105A30000BC0E9EAF5E265917491072E000C880B22 -:105A4000990B0E9473EB62C09B0121503109220F18 -:105A5000331F220F331FF901E555FB4D05911491BA -:105A6000AB01440F551F440F551FFA01E555FB4D7F -:105A7000C591D4918017910714F4F62ED1CFC81791 -:105A8000D90714F4E62ECACFF901E355FB4DE59092 -:105A9000F490FA01E355FB4DC590D490BC01601B16 -:105AA000710B072E000C880B990B0E9473EB4B01B6 -:105AB0005C01B6016E197F09072E000C880B990B4B -:105AC0000E9473EB9B01AC01C501B4010E94D2EBB3 -:105AD0004B015C01C01BD10BBE01DD0F880B990B84 -:105AE0000E9473EB9B01AC01C501B4010E9473F0ED -:105AF0004B015C01B701FF0C880B990B0E9473EB03 -:105B00009B01AC01C501B4010E9497EFDF91CF91D9 -:105B10001F910F91FF90EF90DF90CF90BF90AF90CB -:105B20009F908F90089560E080916610909167102B -:105B3000E1D9609346067093470680934806909398 -:105B40004906809164109091651059DF6093040FAD -:105B50007093050F8093060F9093070FA8951092EE -:105B60005810089521E020933310609390107093A3 -:105B70009110809392109093931040E050E0BA01FE -:105B800080919410909195100C94C96060E070E041 -:105B900080E291E4E7CF60E070E080E89FE3E2CF4D -:105BA0006DEC7CEC8CEC9DE3DDCFCF92DF92EF923D -:105BB000FF92CF93C82F0E94EDDB6B017C0124EA9A -:105BC00030E74DE75FE36091901070919110809104 -:105BD0009210909193100E946DEB87FD05C08AEFA3 -:105BE00090E0A0E0B0E003C080E090E0DC01C80EEF -:105BF000D91EEA1EFB1EC0922F10D0923010E092E8 -:105C00003110F0923210C0932802CF91FF90EF90A4 -:105C1000DF90CF9008958091391010923910882329 -:105C200021F0109233100C94D8676091121170918A -:105C30001311809114119091151161157105810551 -:105C4000910559F10E9473EB2091901030919110C1 -:105C500040919210509193100E94D2EB2091290410 -:105C600030912A0440912B0450912C040E9497EF0C -:105C70006093290470932A0480932B0490932C043E -:105C800083E093DF81E0809313021092121110924F -:105C90001311109214111092151180911302882380 -:105CA00049F089E294E00E9476C2BC0182E797E263 -:105CB0000C94ED6708953F924F925F926F927F929E -:105CC0008F929F92AF92BF92CF92DF92EF92FF920C -:105CD0000F931F93CF93DF93CDB7DEB72A970FB6FD -:105CE000F894DEBF0FBECDBF9A878987362E80918C -:105CF000391010923910882329F0109233100E9425 -:105D0000D867F6C08091121190911311A0911411CF -:105D1000B09115118D839E83AF83B887892B8A2B11 -:105D20008B2B09F4A3C094E0699F80011124F80132 -:105D3000E35EFB4F408051806280738020E030E062 -:105D40004AE754E4C301B2010E9496EF4B015C01A3 -:105D500020E030E04AE754E4C301B2010E9497EF2B -:105D60006B017C01809139028823D1F1A1E03A16C0 -:105D700039F13A16A0F0B2E03B1232C080908C109C -:105D800090908D10A0908E10B0908F10C090350222 -:105D9000D0903602E0903702F090380221C0809017 -:105DA000841090908510A0908610B0908710C090BD -:105DB0002D02D0902E02E0902F02F090300210C001 -:105DC0008090881090908910A0908A10B0908B10CD -:105DD000C0903102D0903202E0903302F090340251 -:105DE0006D817E818F8198850E9473EB2091901048 -:105DF0003091911040919210509193100E94D2EBEB -:105E0000A30192010E9497EF2B013C018D819E819D -:105E1000AF81B885A3019201B7FF16C0C501B401D7 -:105E20000E94BDF1181644F0F801E35EFB4F40827A -:105E300051826282738215C0F801E35EFB4F80825B -:105E40009182A282B3820DC0C701B6010E946DEBA0 -:105E500087FFEACFF801E35EFB4FC082D182E28286 -:105E6000F382832DA2DE81E080931302109212113F -:105E700010921311109214111092151180911302A7 -:105E80008823B1F1A4E03A9EC0011124FC01E35E35 -:105E9000FB4FDC01A858BF4E2D913D914D915C9177 -:105EA00060817181828193810E9497EF69837A83F7 -:105EB0008B839C832DEC3CEC4CEC5DE3609190106B -:105EC0007091911080919210909193100E94BDF169 -:105ED00087FD05C0CE0101960E9476C204C0CE01A6 -:105EE00001960E9429BCBC0189859A850E94ED67B4 -:105EF0002A960FB6F894DEBF0FBECDBFDF91CF91CB -:105F00001F910F91FF90EF90DF90CF90BF90AF90D7 -:105F10009F908F907F906F905F904F903F900895EB -:105F200060E08DE597E2C7CE62E08BE697E2C3CEF4 -:105F300061E084E697E2BFCEAF92BF92CF92DF924C -:105F4000EF92FF921F93CF93DF930E947DBBC0918E -:105F50000D11D0E08BE2E82E87E2F82E94EFC92EE7 -:105F600096E2D92E2AE4A22E27E2B22EC11120C039 -:105F700080911011882331F080911302882309F455 -:105F80007AC00DC0809139108823B1F31092391076 -:105F90000E94D86780910F11882371F342C181E07C -:105FA00090911011911180E024E048E557E260C023 -:105FB000C13019F580911011813031F080911302B8 -:105FC000882309F458C00FC0809139108823B1F399 -:105FD0001092391086EA98E30E94869F80910F11F3 -:105FE000882361F31EC181E090911011913009F076 -:105FF00080E023E04EE457E23BC0C23021F58091BF -:106000001011823029F0809113028823A1F111C070 -:10601000809139108823B9F310923910B0921A1177 -:10602000A09219110E942E3280910F11882359F3EA -:10603000F8C081E090911011923009F080E020E2E8 -:1060400040E457E215C0C33009F0C1C0809110117F -:10605000833009F4A7C080911302882361F081E0A6 -:1060600090911011933009F080E020E24FE257E266 -:106070006D2F0E9494C48091021190910311209180 -:10608000001130910111232B11F4892B99F1C530A6 -:1060900099F580911011853031F080911302882399 -:1060A00009F4BDC01AC0809139108823B1F3109251 -:1060B00039101092400610923F061092420610923C -:1060C00041061092440610924306EDD90E94D26711 -:1060D00080910F11882309F3A4C081E090911011E1 -:1060E000953009F080E020E245E057E26D2F0E94F4 -:1060F00094C495C015E001C016E01C1323C0809124 -:106100001011811729F0809113028823D9F00FC054 -:10611000809139108823B9F31092391087ED91EBF3 -:106120000E94869F80910F11882369F37AC081E0D5 -:10613000909110119C1380E023E049EF56E26D2FFF -:106140000E9494C481E0810F8C1323C080911011B0 -:106150008C1729F0809113028823D9F00FC0809109 -:1061600039108823B9F3109239108BE191EB0E941A -:10617000869F80910F11882369F353C081E090912D -:1061800010119C1380E023E04EE057E26D2F0E9437 -:1061900094C4DF5FCF5FD53009F0E8CE1E5F109367 -:1061A0000E113FC080913910882309F454CF10920A -:1061B0003910D0921A11C09219110E942E320E94E9 -:1061C000D26780910F11882309F445CF2AC0C430CB -:1061D00009F051CF80911011843031F08091130279 -:1061E000882309F448CF11C0809139108823B1F376 -:1061F00010923910F0921A11E09219110E942E3269 -:1062000080910F11882351F30CC081E090911011FF -:10621000943009F080E020E24AE157E229CF16E00D -:1062200091CFDF91CF911F91FF90EF90DF90CF90B2 -:10623000BF90AF900895CF93DF930E947DBBD09124 -:106240000D11C0E0D11120C080911011882331F0D0 -:1062500080911302882309F488C00DC08091391001 -:106260008823B1F3109239100E94D86780910F11E2 -:10627000882371F399C081E090911011911180E011 -:1062800024E04CEE56E26EC0D13069F580911011D9 -:10629000813031F080911302882309F466C019C05F -:1062A000809139108823B1F3109239104091D105B3 -:1062B0005091D2056091C9057091CA058091CD05B4 -:1062C0009091CE050E94BEBC80910F11882311F3DE -:1062D0006BC081E090911011913009F080E020E2D4 -:1062E00040EE56E23FC0D23051F58091101182301D -:1062F00029F0809113028823C1F117C080913910D1 -:106300008823B9F3109239104091D1055091D205EC -:106310006FEF7FEF8091CD059091CE050E94BEBCBE -:1063200080910F11882329F33FC081E090911011D3 -:10633000923009F080E020E240EC56E213C0D33006 -:10634000A1F4809110118330C9F080911302882349 -:1063500061F081E090911011933009F080E020E22B -:1063600040ED56E26C2F0E9494C4CF5FDF5FC530D2 -:1063700009F068CF84E080930E1116C08091391027 -:10638000882319F3109239104091D1055091D2050C -:106390006091C9057091CA0580E090E00E94BEBC82 -:1063A00080910F11882389F2DF91CF910895CF93C7 -:1063B000DF930E947DBBD0910D11C0E0D11120C0B0 -:1063C00080911011882331F080911302882309F401 -:1063D00088C00DC0809139108823B1F31092391014 -:1063E0000E94D86780910F11882371F399C081E0D2 -:1063F00090911011911180E024E048EB56E26EC0BC -:10640000D13069F580911011813031F08091130203 -:10641000882309F466C019C0809139108823B1F32C -:10642000109239104091CF055091D0056091C70569 -:106430007091C8058091CB059091CC050E94BEBC9F -:1064400080910F11882311F36BC081E0909110119E -:10645000913009F080E020E24CEA56E23FC0D230B1 -:1064600051F580911011823029F080911302882318 -:10647000C1F117C0809139108823B9F310923910F7 -:106480004091CF055091D0056FEF7FEF8091CB0504 -:106490009091CC050E94BEBC80910F11882329F3F6 -:1064A0003FC081E090911011923009F080E020E22D -:1064B0004CE856E213C0D330A1F480911011833020 -:1064C000C9F080911302882361F081E0909110114E -:1064D000933009F080E020E24CE956E26C2F0E94F4 -:1064E00094C4CF5FDF5FC53009F068CF84E080934C -:1064F0000E1116C080913910882319F310923910AB -:106500004091CF055091D0056091C7057091C805A5 -:1065100080E090E00E94BEBC80910F11882389F238 -:10652000DF91CF9108951F93CF93DF93182F70932E -:106530009510609394100E947DBBD0910D11C0E026 -:1065400081E0113061F120F0123009F44FC075C0C4 -:10655000D1119DC08823D9F0809110111816BCF07C -:1065600040911211509113116091141170911511F5 -:106570004F5F5F4F6F4F7F4F409312115093131136 -:1065800060931411709315118F5F80931011809197 -:106590001302882309F4D8C06AEB77E274C0D111E2 -:1065A00076C08823D9F0809110111816BCF0409164 -:1065B00012115091131160911411709115114F5FC8 -:1065C0005F4F6F4F7F4F40931211509313116093A1 -:1065D0001411709315118F5F809310118091130225 -:1065E000882309F4B1C063EB77E24DC0D1114FC0ED -:1065F0008823D9F0809110111816BCF04091121127 -:106600005091131160911411709115114F5F5F4FEC -:106610006F4F7F4F409312115093131160931411D9 -:10662000709315118F5F809310118091130288234E -:1066300009F48AC06CEA77E226C0D11128C0882309 -:10664000D9F0809110111816BCF0409112115091A0 -:10665000131160911411709115114F5F5F4F6F4FBF -:106660007F4F409312115093131160931411709344 -:1066700015118F5F8093101180911302882309F404 -:1066800063C063EA77E28C2F0E94E8E65DC0D130F8 -:1066900009F580911011813031F080911302882327 -:1066A00009F452C00DC0809139108823B1F31092C3 -:1066B00039100E94D86780910F11882371F380C030 -:1066C00081E090911011913009F080E024E049E9D7 -:1066D00057E237C0D23011F580911011823029F085 -:1066E00080911302882381F10FC080913910882393 -:1066F000B9F31092391086EC9DEA0E94869F809132 -:106700000F11882369F35CC081E0909110119230E1 -:1067100009F080E023E04FE857E213C0D33061F581 -:10672000809110118330C9F080911302882361F0A9 -:1067300081E090911011933009F080E023E046E869 -:1067400057E26C2F0E9494C4CF5FDF5F80E0C530BA -:1067500009F0F7CEC0930E1133C080913910882311 -:1067600019F3109239108BEC9DEA0E94869F80915C -:106770000F118823C9F224C0D43031F78091101151 -:10678000843029F0809113028823F1F20FC08091A8 -:1067900039108823B9F31092391080ED9DEA0E94D8 -:1067A000869F80910F11882369F30AC081E0909140 -:1067B0001011943009F080E023E04BE757E2C1CF9D -:1067C000DF91CF911F91089560E97FEA80E0ABCE21 -:1067D000DF92EF92FF920F931F93CF93DF93F82EE8 -:1067E000D62EE72E8A0180913A02882309F439C017 -:1067F000EBE8FFE08491EF012196882321F00E94CD -:106800000232FE01F7CFED2DFE2D8491EF0121968E -:10681000882321F00E940232FE01F7CFE2E0F8E285 -:106820008491EF012196882321F00E940232FE011B -:10683000F7CFF7FC0BC06F2DFF0C770B880B990B74 -:106840000E94E5358AE00E9402320BC0EDEFF7E2CC -:106850008491EF012196882321F00E940232FE01EB -:10686000F7CF8091CD10811108C010923A0281E0DB -:106870008093CD10C8010E942990DF91CF911F9184 -:106880000F91FF90EF90DF900C9453AA4F925F927C -:106890006F927F928F929F92AF92BF92CF92DF9230 -:1068A000EF92FF920F931F93CF93DF93CDB7DEB795 -:1068B00060970FB6F894DEBF0FBECDBF8091581021 -:1068C000811117C060960FB6F894DEBF0FBECDBF22 -:1068D000DF91CF911F910F91FF90EF90DF90CF90BC -:1068E000BF90AF909F908F907F906F905F904F90F0 -:1068F000089519D90E94EDDB4B015C0160910211F2 -:1069000070910311072E000C880B990B0E9473EBFA -:1069100069837A838B839C8348E0C42ED12C58E210 -:10692000E52EF12C00E09E012F5F3F4F46E456E03C -:106930006DEE70E18CEE90E10E94C8A8C090460612 -:10694000D0904706E0904806F090490660910D040B -:1069500070910E04072E000C880B990B0E9473EBAC -:106960009B01AC01C701B6010E94BDF118160CF0E5 -:1069700009C16091040270910502072E000C880B7A -:10698000990B0E9473EB9B01AC01C701B6010E94F9 -:106990006DEB87FFF7C00091021110910311B80150 -:1069A000012E000C880B990B0E9473EBA701960136 -:1069B0000E9496EF2B013C0120ED3CEC4CE45DE3A2 -:1069C0006091BE057091BF058091C0059091C10591 -:1069D0000E94D2EB6D837E838F8398872091E31092 -:1069E0003091E4104091E5105091E610C701B601D6 -:1069F0000E9496EF9B01AC016D817E818F8198850D -:106A00000E94D2EB6D837E838F83988723E333E3E9 -:106A100043E75FE36091DF107091E0108091E11037 -:106A20009091E2100E94D2EB9B01AC016D817E81BE -:106A30008F8198850E9497EF6D837E838F839887DF -:106A40006093DF107093E0108093E1109093E21058 -:106A5000C092E310D092E410E092E510F092E610BC -:106A600020E030E040E251E4C301B2010E94BDF1F8 -:106A700018160CF413C220E030E040E251ECC301E0 -:106A8000B2010E946DEB87FD12C2012B09F40FC207 -:106A90008091DE1081110FC22091DA103091DB104D -:106AA0004091DC105091DD1029873A874B875C8735 -:106AB0002091BA053091BB054091BC055091BD05B0 -:106AC000C301B2010E94D2EB6B017C01A3019201D0 -:106AD00069857A858B859C850E9497EF69877A877F -:106AE0008B879C876093DA107093DB108093DC10A7 -:106AF0009093DD102091C2053091C3054091C405EB -:106B00005091C5050E94D2EBA70196010E9497EF14 -:106B10002D813E814F8158850E9496EF6B017C014B -:106B200020E030E04FE753E40E94BDF120E030E088 -:106B3000A90118160CF4C6C1C701B6010E946DEB7D -:106B400087FD07C0C701B6010E94DBF07595679508 -:106B50001AC020E030E0A901C301B2010E946DEB30 -:106B600087FF10C0A301920169857A858B859C857A -:106B70000E9496EF6093DA107093DB108093DC1024 -:106B80009093DD1060E06093591080914C109091CB -:106B90004D10A0914E10B0914F100097A105B10576 -:106BA00021F1A5019401281B390B4A0B5B0B57FD02 -:106BB0001CC0609150107091511080E090E00E94D4 -:106BC00071EB9B01AC016091460670914706809184 -:106BD0004806909149060E946DEB87FF64C142E42C -:106BE00058E264E578E280E0F3DD80915210909104 -:106BF0005310A0915410B09155100097A105B10504 -:106C000011F1881A990AAA0ABB0AB7FC1CC0609144 -:106C100056107091571080E090E00E9471EB9B013C -:106C2000AC016091040F7091050F8091060F909157 -:106C3000070F0E946DEB87FF21C140E258E263E33A -:106C400078E28FEFC5DD6091001170910111072E80 -:106C5000000C880B990B0E9473EB69837A838B83FA -:106C60009C8392E0C92ED12C24E1E22EF12C0FEF6F -:106C70009E012F5F3F4F44E05FE067EE70E18BEED7 -:106C800090E10E94C8A8C090040FD090050FE0903A -:106C9000060FF090070F20E030E040EA50E4C70113 -:106CA000B6010E94BDF187FDE5C020E030E046E17D -:106CB00053E4C701B6010E946DEB18160CF4DAC05C -:106CC0006091001170910111072E000C880B990B37 -:106CD0000E9473EBA70196010E9496EF4B015C01A5 -:106CE0002091BD103091BE104091BF105091C01046 -:106CF0000E94D2EB69877A878B879C872091D61078 -:106D00003091D7104091D8105091D910C501B401DD -:106D10000E9497EF6D837E838F8398876093D61050 -:106D20007093D7108093D8109093D9102091B910F8 -:106D30003091BA104091BB105091BC100E94D2EB20 -:106D40006D877E878F87988B20ED3CEC4CE45DE36C -:106D50006091B5107091B6108091B7109091B810F5 -:106D60000E94D2EB2B013C012091D2103091D31024 -:106D70004091D4105091D510C701B6010E9496EFF2 -:106D80009B01AC01C301B2010E94D2EB2B013C017B -:106D900023E333E343E75FE36091CE107091CF10BC -:106DA0008091D0109091D1100E94D2EB9B01AC0148 -:106DB000C301B2010E9497EF2B013C016093CE10FA -:106DC0007093CF108093D0109093D110C092D210B6 -:106DD000D092D310E092D410F092D5102D853E853C -:106DE0004F85588969857A858B859C850E9497EFA8 -:106DF000A30192010E9496EF6B017C0120E030E03C -:106E00004FE753E40E94BDF120E030E0A9011816DD -:106E1000C4F5C501B4010E94BDF1181684F4A501A2 -:106E200094016D817E818F8198850E9496EF609399 -:106E3000D6107093D7108093D8109093D9106FE725 -:106E40001AC020E030E0A901C501B4010E946DEB39 -:106E500087FF10C0A50194016D817E818F81988587 -:106E60000E9496EF6093D6107093D7108093D8103D -:106E70009093D91060E060935A1024CD0E94BBA972 -:106E8000E2CEC701B6010E946DEB87FDDACFC701E4 -:106E9000B6010E94DBF075956795EDCF81E0809398 -:106EA000DE106FE770CE80E00E9407AA9ECE81E0E0 -:106EB0008093DE1067CE1092DE1019861A861B862C -:106EC0001C86F6CDC301B2010E94BDF118164CF725 -:106ED000A301920169857A858B859C850E9496EF36 -:106EE0006093DA107093DB108093DC109093DD10C8 -:106EF0006FE749CE0F931F9380913312813019F4BD -:106F00000E94EDDB08C06091C9107091CA10809199 -:106F1000CB109091CC100091C5101091C61020910B -:106F2000C7103091C810601B710B820B930B28EEB9 -:106F300033E040E050E00E945BEF8091C1109091FF -:106F4000C210A091C310B091C410BC01CD01620F5A -:106F5000731F841F951F1F910F9108951092331274 -:106F60001092C5101092C6101092C7101092C8103F -:106F70001092C9101092CA101092CB101092CC101F -:106F80001092C1101092C2101092C3101092C4102F -:106F90000895809133128130E1F0823051F4AADFFC -:106FA0006093C1107093C2108093C3109093C4106B -:106FB00001C0D4DF81E0809333120E94EDDB609347 -:106FC000C5107093C6108093C7109093C81081E0CD -:106FD000089580E0089580913312813079F482E041 -:106FE000809333120E94EDDB6093C9107093CA1036 -:106FF0008093CB109093CC1081E0089580E00895A9 -:10700000809133128150823010F080E00895109208 -:1070100033120E94EDDB6093C9107093CA10809305 -:10702000CB109093CC1081E00895CF93DF93EFEED7 -:10703000F7E28491EF012196882321F00E94023229 -:10704000FE01F7CFEBEEF7E28491EF012196882362 -:1070500021F00E940232FE01F7CF62B366956170A3 -:1070600070E080E090E00E94E53562B3617070E00E -:1070700080E090E00E94E5358AE00E940232E7EE6F -:10708000F7E28491EF012196882321F00E940232D9 -:10709000FE01F7CF60910601862F660F990BAA0BB0 -:1070A000BB0BBC01CD01662797FD63957727882729 -:1070B00099270E94E53562B362FB662760F970E0AC -:1070C00080E090E00E94E5358AE00E940232E3EE23 -:1070D000F7E28491EF012196882321F00E94023289 -:1070E000FE01F7CF6091060166FB662760F970E04C -:1070F00080E090E00E94E5356091060165FB66271F -:1071000060F970E080E090E00E94E5358AE00E943E -:107110000232EEEDF7E28491EF012196882321F00F -:107120000E940232FE01F7CF6091060163FB6627E1 -:1071300060F970E080E090E00E94E5356091060122 -:107140006295617070E080E090E00E94E5358AE031 -:107150000E940232E9EDF7E28491EF012196882343 -:1071600021F00E940232FE01F7CF60910601669580 -:10717000617070E080E090E00E94E535609106016A -:1071800062FB662760F970E080E090E00E94E535E0 -:107190008AE0DF91CF910C94023267FD3BC08230D0 -:1071A000D9F028F4882341F0813061F033C0833076 -:1071B000E9F0843029F12EC0662311F0A19A39C07C -:1071C000A19837C0809108016111809580788093E3 -:1071D000060147FF36C0089580910801611180952E -:1071E00080748093060147FF32C0089580910801A2 -:1071F0006111809588708093060147FF2EC0089525 -:10720000809108016111809582708093060147FF8B -:107210002AC0089547FD2FC08230C9F028F4882382 -:1072200051F0813041F50DC08330B9F0843019F54B -:107230001AC047FD20C0442311F0A09A0895A098D9 -:107240000895442311F0A29A0895A2980895809178 -:1072500008014111809580720BC080910801411195 -:107260008095807105C080910801411180958470DE -:107270008093060108950895CF93DF93643021F140 -:1072800028F46130E9F06230E9F004C06830F9F0C8 -:107290006031E9F0EBE8FFE08491EF01219688236B -:1072A00021F00E940232FE01F7CFE1ECF7E2849177 -:1072B000EF012196882381F00E940232FE01F7CF70 -:1072C00040E003C040E004C041E060E002C041E0B3 -:1072D00061E0DF91CF9161CFDF91CF9108955F9809 -:1072E0008EBD00000DB407FEFDCF8EB56EBD000053 -:1072F0000DB407FEFDCF8EB55F9A0895CF93DF934F -:1073000000D01F921F92CDB7DEB795E0EBE0F3E01F -:10731000DE01119601900D929A95E1F7E1E0F0E01F -:10732000EC0FFD1FE80FF11D808190E00F900F9092 -:107330000F900F900F90DF91CF91D1CF90916F0070 -:10734000292F227091FF05C090916F009D7F90932F -:107350006F0034E0839FC0011124FC01EB55FF4E08 -:107360004081518162817381FC01E756FF4E408369 -:1073700051836283738381E080939810222329F0E4 -:1073800080916F00826080936F000895BC0120910E -:1073900096103091971040919610509197102417A5 -:1073A000350711F09A01F7CF81E02617370709F06A -:1073B00080E0089590E0FC013197E231F10508F09A -:1073C0004EC08827EE58FF4F8F4F0C949EF280914D -:1073D00080008F7703C0809180008F7D8093800034 -:1073E000089580918000877FF9CF84B58F7702C0A0 -:1073F00084B58F7D84BD08958091B0008F7703C0E0 -:107400008091B0008F7D8093B000089580919000AE -:107410008F7707C0809190008F7D03C0809190008E -:10742000877F8093900008958091A0008F7707C098 -:107430008091A0008F7D03C08091A000877F809302 -:10744000A0000895809120018F7707C080912001CE -:107450008F7D03C080912001877F80932001089554 -:10746000EF92FF920F931F93CF93DF93D82F062FA6 -:10747000C42F142FF82EF40EEE24EA948F2D811BC6 -:107480001830A0F06091B40B7091B50B8093CE0BC7 -:107490000093CF0B1092D10BE092D00B2EEC3BE07F -:1074A0004BE382EB9BE0EAD41850E8CF8C2F869513 -:1074B0008695869598E0899FD00D11244C2F98EFE2 -:1074C000899F400D1124442311F197E049276091D1 -:1074D000B40B7091B50BD093CE0B0093CF0B1092E1 -:1074E000D10B4F5F47708FEF90E001C0880F4A9536 -:1074F000EAF78093D00B2EEC3BE04BE382EB9BE072 -:10750000DF91CF911F910F91FF90EF90B7C4DF9162 -:10751000CF911F910F91FF90EF9008950F931F93BC -:10752000CF93DF93182F042FC62FD62FD20F402FC3 -:107530006C2F812F95DFCF5FCD13F9CFDF91CF91E6 -:107540001F910F910895DF92EF92FF920F931F9377 -:10755000CF93DF93082FD62FC42F142FF62EF40EBF -:10756000EE24E394DD24DA948F2D811B1830A0F0F3 -:107570006091B40B7091B50B0093CE0B8093CF0B41 -:10758000E092D10BD092D00B2EEC3BE04BE382EBA0 -:107590009BE074D41850E8CF8C2F869586958695FD -:1075A00098E0899FD00D11244C2F98EF899F400DB2 -:1075B0001124442321F187E048276091B40B709196 -:1075C000B50B0093CE0BD093CF0B81E08093D10B02 -:1075D0004F5F47708FEF90E001C0880F4A95EAF740 -:1075E0008093D00B2EEC3BE04BE382EB9BE0DF91F2 -:1075F000CF911F910F91FF90EF90DF903FC4DF91EB -:10760000CF911F910F91FF90EF90DF900895CF924F -:10761000DF92EF92FF920F931F93CF93DF93CDB73B -:10762000DEB7EDB6FEB6DC010D900020E9F79D0156 -:10763000281B390B2C5F3F4F4DB75EB7421B530BD6 -:107640000FB6F8945EBF0FBE4DBF0DB71EB70F5FEC -:107650001F4F9F938F9387E899E29F938F931F9378 -:107660000F930E9407EB680154E0C50ED11C0F90E8 -:107670000F900F900F900F900F90F601808188234C -:1076800049F0082E000C990B0E94B0F2F60181938C -:107690006F01F3CFC8010E940932811103C00E941B -:1076A0008990F8CF83E899E290931A118093191189 -:1076B0000E942E320FB6F894FEBE0FBEEDBEDF91D3 -:1076C000CF911F910F91FF90EF90DF90CF90089591 -:1076D0000F93CF93C82F01E020E8482F60E082EBA2 -:1076E0009BE0D0D3882331F040E86C2F80E0CF912D -:1076F0000F91B6CECF910F910895109216118091EF -:10770000121190911311A0911411B09115118130A3 -:107710009048A105B10540F010921211109213117A -:10772000109214111092151180911111882331F0CB -:10773000809112118093101110920F1180910E11EF -:107740001816D4F4082E000C990B019720911011F3 -:10775000022E000C330B2817390774F08093101198 -:10776000092E000CAA0BBB0B8093121190931311DE -:10777000A0931411B09315118091101190910D11D7 -:10778000891714F480930D1120910D11022E000C15 -:10779000330B2C5F3F4F482F082E000C550B24173E -:1077A00035071CF4845080930D110895FF920F93B8 -:1077B0001F93CF93DF93182FC62FF42ED22F022FB3 -:1077C000242F462F682F82EB9BE05CD38823C9F0DF -:1077D0004F2D6C2F812F44DE4D2F6C2F812FB3DE68 -:1077E0008FEF8F0D4D2F6C2F810FADDE6FEF6D0F73 -:1077F0006C0F4F2D812FDF91CF911F910F91FF9033 -:107800002FCEDF91CF911F910F91FF900895FF929E -:107810000F931F93CF93DF93C82FD62F142FF22EE1 -:10782000022F242F462F682F82EB9BE02BD3882337 -:1078300051F02F2D412F6D2F8C2FDF91CF911F9164 -:107840000F91FF906BCEDF91CF911F910F91FF9021 -:1078500008958F929F92AF92BF92CF92DF92EF9254 -:10786000FF92CF93FC01C080D180E280F38020E0C2 -:1078700030E44CE156E4C701B6010E94D2EB4B0163 -:107880005C0120E030E0A901C701B6010E946DEB68 -:1078900087FD05C020E030E040EA50E404C020E06D -:1078A00030E040EA50ECC501B4010E9497EF20E0BF -:1078B00030E040E251E40E9473F00E94DBF06B0183 -:1078C0007C01611571058105910561F097FF0AC082 -:1078D000F094E094D094C094C11CD11CE11CF11C24 -:1078E0008DE201C080E280930611C701B60128EE47 -:1078F00033E040E050E00E9482F28AE0882E912C32 -:10790000A12CB12CCA01B901A50194010E9482F2F7 -:10791000605D609307118EE280930811C701B60184 -:1079200024E630E040E050E00E9482F2CA01B90152 -:10793000A50194010E9482F2605D60930911C70164 -:10794000B601A50194010E9482F2C62FCA01B901B5 -:10795000A50194010E9482F2605D60930A11C05DEE -:10796000C0930B1186E091E1CF91FF90EF90DF90F3 -:10797000CF90BF90AF909F908F9008950F931F93DB -:10798000CF93DF938B01EA01181619066CF484314A -:1079900021E0920714F083E191E09093031180932A -:1079A000021180E00E9407AA17FD0EC006391105DA -:1079B0001CF096E980E002C0902F812F9093001177 -:1079C000809301110E94BBA980910411833010F4AF -:1079D00090E002C080E090E0880F991FFC01E15C1C -:1079E000F94FD183C083DF91CF911F910F910C94F8 -:1079F000D267CF93DF93282F30E0F901E35CF64D97 -:107A00008491F901E950F74DD491F901EF54F74D04 -:107A1000C491CC2389F08111CDDCEC2FF0E0EE0F86 -:107A2000FF1FE956F74DA591B491EC91ED2381E04C -:107A300090E021F480E002C080E090E0DF91CF91FF -:107A400008951F93CF93DF93282F30E0F901E35C73 -:107A5000F64D8491F901E950F74DD491F901EF54B5 -:107A6000F74DC491CC23B9F0162F8111A3DCEC2F74 -:107A7000F0E0EE0FFF1FE358F74DA591B4919FB7CB -:107A8000F894111104C08C91D095D82302C0EC91C8 -:107A9000DE2BDC939FBFDF91CF911F910895CF9391 -:107AA000DF9390E0FC01E950F74D2491FC01EF5485 -:107AB000F74D8491882361F190E0880F991FFC01B4 -:107AC000ED59F74DC591D491FC01E358F74DA591BF -:107AD000B491611109C09FB7F894888120958223E1 -:107AE0008883EC912E230BC0623061F49FB7F89429 -:107AF0008881322F309583238883EC912E2B2C9311 -:107B00009FBF06C08FB7F894E8812E2B28838FBFC4 -:107B1000DF91CF9108951F93CF93DF93182FEB013F -:107B200061E0BDDF209711F460E004C0CF3FD105D4 -:107B300031F461E0812FDF91CF911F9182CFE12F4E -:107B4000F0E0E35CF64DE4918E2F90E0FC0131977C -:107B5000E231F10508F09DC08827EC57FF4F8F4FA9 -:107B60000C949EF284B5806884BDC7BD97C084B56F -:107B7000806284BDC8BD92C080918000806880937F -:107B80008000D0938900C093880088C080918000D5 -:107B9000806280938000D0938B00C0938A007EC067 -:107BA00080918000886080938000D0938D00C09386 -:107BB0008C0074C08091B00080688093B000C09346 -:107BC000B3006CC08091B00080628093B000C0931D -:107BD000B40064C080919000806880939000D0933E -:107BE0009900C09398005AC0809190008062809361 -:107BF0009000D0939B00C0939A0050C08091900059 -:107C0000886080939000D0939D00C0939C0046C0F4 -:107C10008091A00080688093A0008091A0008F7B5D -:107C20008093A000D093A900C093A80037C0809192 -:107C3000A00080628093A000D093AB00C093AA0004 -:107C40002DC08091A00088608093A000D093AD00EB -:107C5000C093AC0023C080912001806880932001F4 -:107C6000D0932901C093280119C08091200180621E -:107C700080932001D0932B01C0932A010FC08091E3 -:107C80002001886080932001D0932D01C0932C01A6 -:107C900005C0C038D1050CF04CCF46CFDF91CF9155 -:107CA0001F9108958F929F92AF92BF92CF92DF92D1 -:107CB000EF92FF926B017C010E94C8DB4B015C01DB -:107CC000C114D104E104F104F1F00E94C8DBDC012D -:107CD000CB0188199909AA09BB09883E9340A105DF -:107CE000B10570F321E0C21AD108E108F10888EE6D -:107CF000880E83E0981EA11CB11CC114D104E104BC -:107D0000F10419F7DDCFFF90EF90DF90CF90BF9097 -:107D1000AF909F908F900895CF92DF92EF92FF9255 -:107D20000F931F93CF93DF936C017A018B01C0E017 -:107D3000D0E0CE15DF0581F0D8016D918D01D6011F -:107D4000ED91FC910190F081E02DC6011995892BF0 -:107D500011F02196EECF7E01C701DF91CF911F91E7 -:107D60000F91FF90EF90DF90CF9008950895FC0160 -:107D7000A681B7818281481B8581483018F0A80F01 -:107D8000B11D4770382F369536953695562F57705A -:107D900080E890E002C0959587955A95E2F7439F59 -:107DA000402D1124669566956695E62FF0E0E40F68 -:107DB000F11DEA0FFB1F3081222311F0832B02C03B -:107DC000809583238083089580E008950B96FC01BD -:107DD000849108950A96FC0184910895FC01849190 -:107DE0000895FCDF882321F0823011F083E00895AC -:107DF00086E00895FC01E60FF11D849190E0982F34 -:107E000088273196E4918E0F911D089568E0F2CF96 -:107E100066E0F0CF81E00895FB014181DC0112961C -:107E20002C911297421760F013962C9113972417F8 -:107E300038F0608115962C91621710F4248197CF49 -:107E40000895FC0130819281930F928321819217D2 -:107E500060F494819F5F94838381830F821710F075 -:107E60008FEF820F838381E0089580E00895FC0105 -:107E7000128280818150838314820895DB01ED9109 -:107E8000FC9119940F93FC010150040F84A996A949 -:107E9000941718F0081728F402C0081750F00417B8 -:107EA00040F42150260F83A995A9961720F428178E -:107EB00020F480E007C0281720F481E0261710F096 -:107EC000F8CF81E00F9108955F926F927F928F9229 -:107ED0009F92AF92BF92CF92DF92EF92FF920F9359 -:107EE0001F93CF93DF93EC01062F142FC22EEC804B -:107EF000FD80C70173DFD82E8C819D8172DF982EA3 -:107F000021E0D21203C02FE0A22E02C0AA24AA941C -:107F10008C819D815FDFD82E8C819D8157DFB82EAB -:107F20008C819D8173DFE0E6EC1538F4009729F031 -:107F3000E80EF91E91E6D92E10C08C819D8168DF74 -:107F4000F0E4FC1538F4009729F0E80EF91E81E4FE -:107F5000D82E03C021E1E20EF11CBC1430F4188AC3 -:107F60001B8A1C8A198A1A8A96C0BD14C0F3892DEF -:107F700090E0F70124912F3F21F4FFEFEF1AFF0A61 -:107F80003FC0CD1034C08C819D8128DF97012F5FC9 -:107F90003F4FF701882311F0823091F484918B8B4D -:107FA000F90124912C8BF7013396E491E88BF701CA -:107FB0003496E491E98BF7013596E491EA8B25C07C -:107FC0008491982F9F7092509A8B82958F70898B95 -:107FD000F9012491822F8F708C8B22952F702B8B1F -:107FE000F7013296E491E295EF70E88B0EC0F7014D -:107FF0003296E491EA219C012E0F311DE20EF31E10 -:10800000BD1409F4ACCFD394B4CFE114F10409F456 -:1080100042C08C819D81E5DEA82EDB88BC88C988A2 -:10802000C00E8A898B0D181B0B2D2D2D412F6C2D09 -:10803000CE0128DF882369F1EA0CF11C87E08D0D61 -:10804000D82ED694D694D6945B2C510E4E01FCE1DA -:108050008F0E911C6D2C712C5116D9F00C2D5701DF -:108060008A2D8E198D1588F4F50184916A817B81A2 -:108070000C8F1D8F1F8E8E8F94014BE3CE01FEDE81 -:10808000FFEFAF1ABF0A085FEBCFE60CF71C1F5FCC -:10809000E3CF888901C080E0DF91CF911F910F91DC -:1080A000FF90EF90DF90CF90BF90AF909F908F9018 -:1080B0007F906F905F9008958F929F92AF92BF9242 -:1080C000CF92DF92EF92FF92CF93FC01C080D180DC -:1080D000E280F38020E030E0A901C701B6010E94F0 -:1080E0006DEB87FF08C0C701B601905820E030E073 -:1080F0004AE754E406C020E030E04AE754E4C70110 -:10810000B6010E94D2EB20E030E040EA50E40E9449 -:1081100097EF20E030E040E251E40E9473F00E94CB -:10812000DBF06B017C01603AF6E87F07F1E08F0736 -:10813000910584F020EA36E841E050E00E9482F2A6 -:10814000CA01B9012AE030E040E050E00E9482F22A -:10815000605D01C060E26093051180E1C81687E2AE -:10816000D806E104F10494F0C701B60120E137E23A -:1081700040E050E00E9482F2CA01B9012AE030E0FA -:1081800040E050E00E9482F2605D01C060E26093D6 -:108190000611E8EECE16E3E0DE06E104F10494F009 -:1081A000C701B60128EE33E040E050E00E9482F2C1 -:1081B000CA01B9012AE030E040E050E00E9482F2BA -:1081C000605D01C060E260930711C701B60124E65B -:1081D00030E040E050E00E9482F28AE0882E912C4C -:1081E000A12CB12CCA01B901A50194010E9482F20F -:1081F000605D609308118EE280930911C701B6019A -:10820000A50194010E9482F2C62FCA01B901A501FD -:1082100094010E9482F2605D60930A11C05DC09378 -:108220000B1185E091E1CF91FF90EF90DF90CF901F -:10823000BF90AF909F908F9008958F929F92AF9232 -:10824000BF92CF92DF92EF92FF92CF93FC01C0805A -:10825000D180E280F38020E030E04AE754E4C701B7 -:10826000B6010E94D2EB4B015C0120E030E0A90195 -:10827000C701B6010E946DEB87FD05C060E070E0AC -:1082800080EA90E404C060E070E080EA90ECA50130 -:1082900094010E9497EF20E030E040E251E40E9418 -:1082A00073F00E94DBF06B017C0197FF0AC0F09431 -:1082B000E094D094C094C11CD11CE11CF11C8DE24F -:1082C00001C08BE280930511C701B60120E137E2BE -:1082D00040E050E00E9482F28AE0882E912CA12C8E -:1082E000B12CCA01B901A50194010E9482F2605D1E -:1082F00060930611C701B60128EE33E040E050E07C -:108300000E9482F2CA01B901A50194010E9482F281 -:10831000605D60930711C701B60124E630E040E0DC -:1083200050E00E9482F2CA01B901A50194010E94A5 -:1083300082F2605D609308118EE280930911C7019B -:10834000B601A50194010E9482F2C62FCA01B901AB -:10835000A50194010E9482F2605D60930A11C05DE4 -:10836000C0930B1185E091E1CF91FF90EF90DF90EA -:10837000CF90BF90AF909F908F9008958F929F92D3 -:10838000AF92BF92CF92DF92EF92FF92FC01C0803A -:10839000D180E280F38020E030E0A901C701B6017E -:1083A0000E946DEB87FF08C0C701B601905820E01E -:1083B00030E040E251E406C020E030E040E251E429 -:1083C000C701B6010E94D2EB20E030E040EA50E461 -:1083D0000E9497EF20E030E040E251E40E9473F009 -:1083E0000E94DBF06B017C016031F7E27F078105C1 -:1083F000910584F020E137E240E050E00E9482F2F3 -:10840000CA01B9012AE030E040E050E00E9482F267 -:10841000605D01C060E26093071188EEC81683E0DA -:10842000D806E104F10494F0C701B60128EE33E068 -:1084300040E050E00E9482F2CA01B9012AE030E037 -:1084400040E050E00E9482F2605D01C060E2609313 -:108450000811E4E6CE16D104E104F10494F0C7015A -:10846000B60124E630E040E050E00E9482F2CA010A -:10847000B9012AE030E040E050E00E9482F2605D05 -:1084800001C060E260930911FAE0CF16D104E10463 -:10849000F1049CF08AE0882E912CA12CB12CC7010C -:1084A000B601A50194010E9482F2CA01B901A50199 -:1084B00094010E9482F2605D01C060E260930A1143 -:1084C000C701B6012AE030E040E050E00E9482F2AD -:1084D000605D60930B1187E091E1FF90EF90DF907A -:1084E000CF90BF90AF909F908F9008958F929F9262 -:1084F000AF92BF92CF92DF92EF92FF92FC01C080C9 -:10850000D180E280F38020E030E048EC52E4C70103 -:10851000B6010E94D2EB4B015C0120E030E0A901E2 -:10852000C701B6010E946DEB87FD05C060E070E0F9 -:1085300080EA90E404C060E070E080EA90ECA5017D -:1085400094010E9497EF20E030E040E251E40E9465 -:1085500073F00E94DBF09B0177FF06C022273327D0 -:10856000261B370B8DE201C08BE280930611C901F7 -:1085700068EE73E00E946FF2CB01EAE0F0E0BF0129 -:108580000E946FF2805D80930711C90164E670E07C -:108590000E946FF2CB01BF010E946FF2805D809359 -:1085A0000811C901BF010E946FF2282FCB01BF0142 -:1085B0000E946FF2805D809309118EE280930A1110 -:1085C000205D20930B1186E091E1FF90EF90DF900A -:1085D000CF90BF90AF909F908F9008958F929F9271 -:1085E000AF92BF92CF92DF92EF92FF92CF93FC01B6 -:1085F000C080D180E280F38020E030E04AE754E49C -:10860000C701B6010E94D2EB4B015C0120E030E0D3 -:10861000A901C701B6010E946DEB87FD05C060E0AE -:1086200070E080EA90E404C060E070E080EA90ECE2 -:10863000A50194010E9497EF20E030E040E251E470 -:108640000E9473F00E94DBF06B017C0197FD10C06B -:1086500020E137E240E050E00E9482F2CA01B90115 -:108660002AE030E040E050E00E9482F2605D09C004 -:10867000F094E094D094C094C11CD11CE11CF11C76 -:108680006DE260930611C701B60128EE33E040E0C9 -:1086900050E00E9482F28AE0882E912CA12CB12C0D -:1086A000CA01B901A50194010E9482F2605D609344 -:1086B0000711C701B60124E630E040E050E00E9417 -:1086C00082F2CA01B901A50194010E9482F2605DA3 -:1086D000609308118EE280930911C701B601A501CC -:1086E00094010E9482F2C62FCA01B901A50194012A -:1086F0000E9482F2605D60930A11C05DC0930B110D -:1087000086E091E1CF91FF90EF90DF90CF90BF9006 -:10871000AF909F908F9008959C0197FF0AC0EE271D -:10872000FF27E81BF90BE436F1050CF44CC08DE291 -:1087300030C0283E83E038073CF1C90168EE73E0A1 -:108740000E946FF2CB01EAE0F0E0BF010E946FF2FD -:10875000805D80930811C90164E670E00E946FF2A9 -:10876000CB01BF010E946FF2805D80930911C901A6 -:10877000BF010E946FF2CB01BF010E946FF2805DCA -:1087800080930A11F9013EC0F90124363105DCF06D -:1087900080E280930811CF0164E670E00E946FF2DE -:1087A000CB012AE030E0B9010E946FF2805D809336 -:1087B0000911CF01B9010E946FF2CB01B9010E94EA -:1087C0006FF2805D1DC080E28093081180930911D3 -:1087D000EA30F10584F037FF02C08DE201C080E28B -:1087E00080930911CF016AE070E00E946FF2605D32 -:1087F00060930A1107C037FF02C08DE201C080E21A -:1088000080930A11CF016AE070E00E946FF2805DF0 -:1088100080930B1188E091E108959C0197FD0EC0B3 -:108820008436910584F064E670E00E946FF2CB011B -:108830006AE070E00E946FF2805D06C0319521957C -:1088400031098DE201C080E2809309112A3031059F -:1088500064F0EAE0F0E0C901BF010E946FF2CB01D1 -:10886000BF010E946FF2805D01C080E280930A1117 -:10887000C9016AE070E00E946FF2805D80930B1185 -:1088800089E091E10895CF92DF92EF92FF926B0120 -:108890007C0183E3C816D104E104F10468F082E3AB -:1088A000C81AD108E108F10862E370E080E090E0C6 -:1088B000F9D90E9446B4EDCFC701B601F3D9FF90B4 -:1088C000EF90DF90CF900C9446B40F931F93CF930B -:1088D000DF9300D000D0CDB7DEB783E992E09C8370 -:1088E0008B8304E610E01A830983BE016D5F7F4F1E -:1088F000CE0101960E9494DB8AEB92E09E838D83E9 -:108900001A830983BE016B5F7F4FCE0101960E94DF -:1089100094DB26960FB6F894DEBF0FBECDBFDF9175 -:10892000CF911F910F9108950F931F93CF93DF93D2 -:10893000982F862F8A01D22F692F0E946C68909100 -:10894000E60B80911811891738F19091E80B80910E -:108950001711981708F1C4E1F8018491882329F0D0 -:10896000D5D3C81B0F5F1F4FF7CFCC2329F080E270 -:108970000E945450C150F9CF809118119AE79093FA -:10898000E90B8093EA0B8D2FD8D380E2DF91CF9152 -:108990001F910F910C945450DF91CF911F910F9123 -:1089A00008958EE899E20E94835081E0809321121D -:1089B00008950F931F930E94EDDB00911D121091FB -:1089C0001E1220911F1230912012DC01CB01801B5E -:1089D000910BA20BB30BB7FD0FC08091030185FB78 -:1089E000992790F981E089279091030196FF826091 -:1089F000629B846080931C1280911C128170909104 -:108A00001C1291FD826090912212891731F1813000 -:108A1000A9F028F0823041F0833059F01CC0913029 -:108A200089F0923099F017C0992361F0933071F07A -:108A300012C0913059F0923071F404C0992331F092 -:108A4000933049F490911B129F5F03C090911B12C9 -:108A5000915090931B12809322121F910F910895B1 -:108A60000F931F93CF93DF938C0167FF03C0109286 -:108A7000DE0560E08091DE0590E0262F062E000CDA -:108A8000330B281739070CF16093DE05C8010E94EB -:108A9000BDEA800F911FEC01C01BD10BC731D1057E -:108AA0003CF00197FC012491207C2038D1F3F3CFD6 -:108AB000DD27AE01B80185E99BE00E94DEEACB56D6 -:108AC000D44F188283E080931302DF91CF911F91DE -:108AD0000F910895CF93DF932091DE0521111DC0E2 -:108AE000FC0101900020E9F73197EF01C81BD90B79 -:108AF000C731D1052CF02291207C2038E1F3F5CF4D -:108B0000BC01DD27AE0185E99BE00E941CF3CB563A -:108B1000D44F188283E080931302DF91CF910895A0 -:108B2000AF92BF92CF92DF92EF92FF920F931F937B -:108B3000CF93DF935B0189014A3009F48FC045313F -:108B400009F061C0DB011296ED91FC911397F28060 -:108B5000C681D781A49A88E290E00197F1F720E1DD -:108B6000E22EEF0C38E2C32ED12C88EF0E94E7A64C -:108B7000C6010197F1F7BFE1BF1508F456C08F2D6C -:108B8000807780680E94E7A68F2D8295807F0E9463 -:108B9000E7A6C6010197F1F780E80E94E7A680E00A -:108BA0000E94E7A6C6010197F1F78AEF0E94E7A6A7 -:108BB000C6010197F1F78E01005F1F4F8881807F0A -:108BC0000E94E7A689918295807F0E94E7A6C01740 -:108BD000D107A1F7C6010197F1F7F394FE10C5CFB5 -:108BE000A498F501C281D381CE012BD98111FAC19C -:108BF000DF91CF911F910F91FF90EF90DF90CF9079 -:108C0000BF90AF900895DB011296CD91DC91139740 -:108C1000842F90E0FC017497E433F105E8F4882791 -:108C2000EA56FF4F8F4F0C949EF210EE1F0D106806 -:108C3000812F807F0E94E7A6812F8295807F0E94EE -:108C4000E7A6C6010197F1F780E80E94E7A680E851 -:108C5000A7CF8981F901808381E0CACF9C9AA4982B -:108C60009B9AA39880910401846080930401809171 -:108C700005018095847080930301A49A88E290E0B6 -:108C80000197F1F788E790E02EE93FE0CEE9DFE0D9 -:108C9000F9013197F1F70197C9F788EF0E94E7A62C -:108CA00008E210E0C8010197F1F780E20E94E7A610 -:108CB00080E00E94E7A6C8010197F1F780E00E94DA -:108CC000E7A680E80E94E7A6C8010197F1F780E0D7 -:108CD0000E94E7A680E10E94E7A6C8010197F1F78C -:108CE000CE010197F1F7CE010197F1F7CE0101977F -:108CF000F1F7CE010197F1F7CE010197F1F7CE011F -:108D00000197F1F7CE010197F1F7CE010197F1F745 -:108D1000CE010197F1F7CE010197F1F7CE0101974E -:108D2000F1F7CE010197F1F7CE010197F1F7CE01EE -:108D30000197F1F72197F1F780E20E94E7A680E41E -:108D40000E94E7A6C8010197F1F780E20E94E7A61A -:108D500080E60E94E7A6C8010197F1F7F12CC8E26E -:108D6000D0E08F2D807780680E94E7A68F2D8295B6 -:108D7000807F0E94E7A6C8010197F1F780E80E9472 -:108D8000E7A680E00E94E7A6C8010197F1F78AEF05 -:108D90000E94E7A6C8010197F1F790E280910501D2 -:108DA000847080930301A39880910501809584705D -:108DB0008093030180910501847080930301A3983F -:108DC0008091050180958470809303018091050155 -:108DD000847080930301A39880910501809584702D -:108DE0008093030180910501847080930301A3980F -:108DF0008091050180958470809303018091050125 -:108E0000847080930301A3988091050180958470FC -:108E10008093030180910501847080930301A398DE -:108E200080910501809584708093030180910501F4 -:108E3000847080930301A3988091050180958470CC -:108E40008093030180910501847080930301A398AE -:108E500080910501809584708093030180910501C4 -:108E6000847080930301A39880910501809584709C -:108E70008093030180910501847080930301A3987E -:108E80008091050180958470809303018091050194 -:108E9000847080930301A39880910501809584706C -:108EA0008093030180910501847080930301A3984E -:108EB0008091050180958470809303018091050164 -:108EC000847080930301A39880910501809584703C -:108ED0008093030180910501847080930301A3981E -:108EE0008091050180958470809303018091050134 -:108EF000847080930301A39880910501809584700C -:108F00008093030180910501847080930301A398ED -:108F1000809105018095847080930301F801319759 -:108F2000F1F7915009F03ACF88EF0E94E7A6CE0101 -:108F30000197F1F7F39480E2F81213CF80E00E94DA -:108F4000E7A680EC0E94E7A688E290E00197F1F79F -:108F5000A49881E04DCE4D8150E0440F551F60E054 -:108F600070E08E819F810E94CEF2CE010E9437BFB9 -:108F700081E03ECEF90181819381913009F46EC088 -:108F8000933009F040C048EF480F91E02B8124173F -:108F900008F490E021E03A81831708F420E031E002 -:108FA000841708F030E0492F432B242319F493232E -:108FB00009F452CED8011296FC90EE24EA94D12CFA -:108FC00044C0B901CE010E940CBF81E011CEF9016D -:108FD00010828A8181838D81815082838B818383FA -:108FE00081E006CE4D8150E0440F551F60E070E0F7 -:108FF0008E819F810E94CEF281E0FACD8D81D901D0 -:109000008C9381E0F5CD2B81281708F425CE2A8199 -:10901000821708F421CEF2809130C9F1D8F1923054 -:10902000B9F4E12CDD24DA9410C0B801CE010E941D -:109030000CBFF8018181D8019C919D0D9C938E0DF0 -:1090400011968C93FF0C09F407CEF7FEF4CFEDCF09 -:10905000933009F4B2CFE12CD12CF7CF38E0380FA0 -:1090600091E02B81281708F490E021E0381708F0F0 -:1090700020E041E05A81351708F440E0322F392BC7 -:10908000342319F4922309F4E7CDF801F280EE2499 -:10909000E39495CFE12CDD24D394D7CFCF93DF9306 -:1090A0001F92CDB7DEB78091EB0B811105C081E037 -:1090B0008093EB0B0E94D0506091B40B7091B50B74 -:1090C00019829E012F5F3F4F4FE082EB9BE00E9491 -:1090D0003EBF0F90DF91CF910895CF93C82F82307C -:1090E00051F024F4813081F4CF915BCC833031F0A6 -:1090F000843021F009C089E19EE202C08EE899E245 -:109100000E948350C0932112CF910895CF93C82F0E -:109110008FEF8C0F893058F489E19EE20E948350D2 -:109120008C2F0E94545080912112D7DF03C08C2FC6 -:109130000E94545081E0CF910895CF939FEF980FF4 -:10914000993060F4C82F89E19EE20E9483508C2FF1 -:109150000E94545080912112CF91BFCFCF910C9497 -:109160005450CF93DF93EC01FE018491882319F0D2 -:10917000E4DF2196F9CFDF91CF910895CF93DF936C -:10918000EC018991882311F0D8DFFBCFDF91CF91DB -:1091900008950C945D5E2F923F924F925F926F9272 -:1091A0007F928F929F92AF92BF92CF92DF92EF9277 -:1091B000FF920F931F93CF93DF9300D01F92CDB7F1 -:1091C000DEB70E947DBB10910D11F12CEE24E394CB -:1091D000812C912C540183949DED492E93E0592EBE -:1091E000612C712C24E4222E27E9322E33E0D32E79 -:1091F000111122C080911011882331F08091130247 -:10920000882309F42AC10DC0809139108823B1F355 -:10921000109239100E94D86780910F11882371F342 -:10922000ABC281E090911011911180E024E047E9F8 -:109230005FE26F2D79DB11C1113009F075C08091AB -:109240001011813031F080911302882309F405C197 -:109250005CC0809139108823B1F3109239101093BB -:109260001611109234101092351010923610109280 -:1092700037100E94A960D092130281E99FE2909377 -:10928000FC108093FB10A7E0B6E0B093FA10A09317 -:10929000F9101092F5101092F6101092F71010922B -:1092A000F8108EED93E0A0E0B0E08093F110909381 -:1092B000F210A093F310B093F4102AE037ED43E2DC -:1092C0005CE3609107067091080680910906909111 -:1092D0000A060E94D2EB0E94E0F060931211709394 -:1092E000131180931411909315113092440220921F -:1092F00043021092FF101092FE101092FD10809108 -:109300000F11882309F49FCF37C2CC24C3948091D6 -:109310001011813009F0C12C87E096E02FD800E0D1 -:109320009C014BE85FE295C0123009F078C0809153 -:109330001011823031F080911302882309F48DC01E -:109340005EC0809139108823B1F310923910E092F9 -:10935000161110923410109235101092361010928F -:1093600037100E94A960D0921302A1E8BFE2B09327 -:10937000FC10A093FB108BE096E09093FA10809382 -:10938000F9108092F5109092F610A092F710B0921A -:10939000F8104092F1105092F2106092F310709217 -:1093A000F4102AE037ED43E25CE360910B06709124 -:1093B0000C0680910D0690910E060E94D2EB20E0E3 -:1093C00030E040E85FE30E9496EF0E94E0F0609397 -:1093D0001211709313118093141190931511309200 -:1093E0004402209243021092FF101092FE1010923D -:1093F000FD1080910F11882309F49DCFBDC1CC24AD -:10940000C39480911011823009F0C12C8BE096E05A -:109410000E94BEC100E09C0147E75FE21AC0133022 -:1094200009F082C080911011833001F18091130204 -:10943000882399F0CC24C39480911011833009F0D3 -:10944000C12C83E096E00E94BEC100E09C0145E68D -:109450005FE26F2D8C2D0E94E7E3F3941F5F95E090 -:10946000F912C6CE88E080930E1186C18091391022 -:109470008823E1F210923910E09216111092341004 -:109480001092351010923610109237100E94A96079 -:1094900010931302AEE6BFE2B093FC10A093FB1052 -:1094A00083E096E09093FA108093F9108092F51083 -:1094B0009092F610A092F710B092F8104092F1102E -:1094C0005092F2106092F3107092F4102AE037ED8F -:1094D00043E25CE360910306709104068091050607 -:1094E000909106060E94D2EB20E030E040E85FE376 -:1094F0000E9496EF0E94E0F0609312117093131196 -:1095000080931411909315113092440220924302DB -:109510001092FF101092FE101092FD1080910F110A -:10952000882309F483CF28C1143009F047C0809103 -:109530001011843031F080911302882309F48DCF0B -:109540001FC0809139108823B1F310923910E09236 -:10955000161110923410109235101092361010928D -:10956000371024E630E040E050E063E272E18EE53F -:109570009FE20E9479E680910F118823E1F2FCC0FE -:10958000CC24C39480911011843009F0C12C6091D7 -:1095900023127091241280912512909126120E941C -:1095A00071EB69837A838B839C83CE0101960E9441 -:1095B000BEC100E09C0147E55FE24BCF153009F0EA -:1095C00047C080911011853031F0809113028823BB -:1095D00009F443CF1FC0809139108823B1F3109252 -:1095E0003910E0921611109234101092351010922A -:1095F00036101092371024E630E040E050E067E289 -:1096000072E180E59FE20E9479E680910F11882344 -:10961000E1F2B2C0CC24C39480911011853009F0DE -:10962000C12C60912712709128128091291290917B -:109630002A120E9471EB69837A838B839C83CE010B -:1096400001960E94BEC100E09C0149E45FE201CFA7 -:10965000163009F047C080911011863031F08091AA -:109660001302882309F4F9CE1FC080913910882392 -:10967000B1F310923910E09216111092341010923A -:10968000351010923610109237102AE030E040E08A -:1096900050E06BE272E182E49FE20E9479E6809101 -:1096A0000F118823E1F268C0CC24C394809110117B -:1096B000863009F0C12C60912B1270912C12809190 -:1096C0002D1290912E120E9471EB69837A838B8305 -:1096D0009C83CE0101960E94BEC100E09C014BE339 -:1096E0005FE2B7CE173009F0B8CE80911011873005 -:1096F00031F080911302882309F4AFCE1FC080910E -:1097000039108823B1F310923910E092161110929B -:10971000341010923510109236101092371024E643 -:1097200030E040E050E06FE272E184E39FE20E94AB -:1097300079E680910F118823E1F21EC0CC24C394F6 -:1097400080911011873009F0C12C60912F12709117 -:10975000301280913112909132120E9471EB698324 -:109760007A838B839C83CE0101960E94BEC100E068 -:109770009C014DE25FE26DCE0F900F900F900F9025 -:10978000DF91CF911F910F91FF90EF90DF90CF90DD -:10979000BF90AF909F908F907F906F905F904F9011 -:1097A0003F902F9008952F923F925F926F927F92F9 -:1097B0008F929F92AF92BF92CF92DF92EF92FF92E1 -:1097C0000F931F93CF93DF930E947DBBC0910D1128 -:1097D000512CD1E065EA262E6EE2362E7EEE672E03 -:1097E0007EE2772EE3E0CE2EEFE2DE2EF1E1AF2E29 -:1097F000FFE2BF2EA8E18A2EAFE29A2EC11122C04D -:1098000080911011882331F080911302882309F48C -:10981000CAC00DC0809139108823B1F3109239105D -:109820000E94D86780910F11882371F30AC281E0EA -:1098300090911011911180E024E046E25FE2652DE5 -:1098400073D8B1C0C13009F04FC080911011813080 -:1098500031F080911302882309F4A5C024C08091BF -:1098600039108823B1F310923910C0931611109259 -:109870003410109235101092361010923710E12CDF -:1098800010ECF12E09E714E420E030E040E85FE35B -:109890006FE076E08FE19FE20E9408E680910F1171 -:1098A0008823B9F2CEC183E08F9387EE8F931F9206 -:1098B000DF938FE096E09F938F93BF92AF929F923A -:1098C0008F925F9281E090911011913009F080E0C9 -:1098D0008F930E944CE48DB79EB70C960FB6F89408 -:1098E0009EBF0FBE8DBF5FC0C23009F051C08091D6 -:1098F0001011823031F080911302882309F453C093 -:1099000024C0809139108823B1F310923910D0937C -:1099100016111092341010923510109236101092C9 -:109920003710E12C10ECF12E09E714E420E030E0D0 -:1099300040E85FE363E176E08AE09FE20E9408E6A8 -:1099400080910F118823B9F27CC183E08F9387EE59 -:109950008F931F92DF9383E196E09F938F938CEF19 -:109960009EE29F938F93DF92CF925F9281E09091DE -:109970001011923009F080E08F930E944CE48DB773 -:109980009EB70C960FB6F8949EBF0FBE8DBF0BC04E -:10999000C33009F058C080911011833069F0809174 -:1099A000130281112DC05394CF5F95E0591226CF39 -:1099B00087E080930E1145C180913910882379F397 -:1099C00010923910D0931611109234101092351055 -:1099D0001092361010923710E12C10ECF12E09E79E -:1099E00014E420E030E040E85FE367E176E085EFF3 -:1099F0009EE20E9408E680910F11882381F221C126 -:109A000083E08F9387EE8F931F92DF9387E196E039 -:109A10009F938F9387EE9EE29F938F937F926F9297 -:109A20005F9281E090911011933009F080E08F9364 -:109A30000E944CE48DB79EB70C960FB6F8949EBF6B -:109A40000FBE8DBFB0CFC43009F053C0809110114C -:109A5000843031F080911302882309F4A4CF24C00C -:109A6000809139108823B1F310923910D0931611D8 -:109A70001092341010923510109236101092371048 -:109A8000E12C10ECF12E09E714E420E030E040E88E -:109A90005FE36BE176E080EE9EE20E9408E6809153 -:109AA0000F118823B9F2CDC083E08F9387EE8F9397 -:109AB0001F92DF938BE196E09F938F9382ED9EE25E -:109AC0009F938F9389ED9EE29F938F935F9281E0A6 -:109AD00090911011943009F080E08F930E944CE433 -:109AE0008DB79EB70C960FB6F8949EBF0FBE8DBF74 -:109AF0005ACFC53009F052C080911011853031F035 -:109B000080911302882309F44ECF23C0809139102D -:109B10008823B1F310923910D0931611109234109B -:109B2000109235101092361010923710E12C10EC74 -:109B3000F12E09E714E420E030E0A9016BE376E0C0 -:109B40008DEC9EE20E9408E680910F118823C1F2FD -:109B500078C083E08F9387EE8F931F921F928BE3E1 -:109B600096E09F938F9383EC9EE29F938F9388EC74 -:109B70009EE29F938F935F9281E0909110119530B8 -:109B800009F080E08F930E944CE48DB79EB70C964D -:109B90000FB6F8949EBF0FBE8DBF05CFC63009F03B -:109BA00002CF80911011863031F08091130288230A -:109BB00009F4F9CE23C0809139108823B1F31092B3 -:109BC0003910D09316111092341010923510109253 -:109BD000361010923710E12C10ECF12E09E714E446 -:109BE00020E030E0A90167E376E089EB9EE20E9485 -:109BF00008E680910F118823C1F223C083E08F9380 -:109C000087EE8F931F921F9287E396E09F938F9327 -:109C10003F922F928FEA9EE29F938F935F9281E013 -:109C200090911011963009F080E08F930E944CE4DF -:109C30008DB79EB70C960FB6F8949EBF0FBE8DBF22 -:109C4000B2CEDF91CF911F910F91FF90EF90DF90F7 -:109C5000CF90BF90AF909F908F907F906F905F90CC -:109C60003F902F9008950C94FE5F81E00C94193B77 -:109C700080E00C94193B60914B0270914C02072ECE -:109C8000000C880B990B0E9473EB2AE037ED43E23E -:109C90005CE30E94D2EB20913A1230913B1240914A -:109CA0003C1250913D120E94D2EB609314027093CB -:109CB00015028093160290931702089580E00C9489 -:109CC00007AA0C94BBA940E050E0BA0186E79EECDD -:109CD0000E94C96010923E1210923F1210924012E0 -:109CE0001092411281E0809333100895CF93DF9357 -:109CF00000D01F92CDB7DEB7809139101092391085 -:109D0000882329F0109233100E94D86762C0809196 -:109D1000121190911311A0911411B0911511009787 -:109D2000A105B10589F11092121110921311109230 -:109D300014111092151121E0209313022091330485 -:109D400022FF0AC02091381230913912280F391F92 -:109D50003093391220933812092E000CAA0BBB0B3A -:109D600040913E1250913F12609140127091411209 -:109D7000840F951FA61FB71F80933E1290933F122A -:109D8000A0934012B093411280911302882309F1ED -:109D900060913E1270913F12809140129091411259 -:109DA0000E9473EB20912F063091300640913106CE -:109DB000509132060E94D2EB69837A838B839C8315 -:109DC000CE0101960E9429BCBC0185E390E30E946C -:109DD000ED670F900F900F900F90DF91CF91089546 -:109DE000CF93DF9300D01F92CDB7DEB7882319F051 -:109DF0000E9465C40FC088EB91E09C838B8384E153 -:109E000090E09A838983BE016D5F7F4FCE010196FA -:109E10000E9494DB0F900F900F900F90DF91CF91E5 -:109E20000895809133128230A9F09091350C9923D6 -:109E300061F08091450C811103C088E39CE002C071 -:109E400085E49CE061E00C946AC5813031F08EE9D4 -:109E50009FE205C08CEB9FE202C080EB9FE26FEFB8 -:109E60000C9430C51F93CF93DF930E947DBBD0919C -:109E70000D11C0E011E0D11121C080911011882393 -:109E800029F0809113028823C9F00DC08091391008 -:109E90008823B9F3109239100E94D86780910F116E -:109EA000882379F36BC181E090911011911180E0CA -:109EB00024E049E250E36C2F0E9494C48091EF0BA0 -:109EC0009091F00B891B8F7021F48091350C8823C1 -:109ED00029F1D13031F580911011813031F080912C -:109EE0001302882309F443C00FC0809139108823DE -:109EF000B1F31092391082EC90ED0E94869F809110 -:109F00000F11882361F33AC181E0909110119130D3 -:109F100009F080E023E044E250E326C0D13009F4A8 -:109F200008C1D23021F580911011823029F0809142 -:109F300013028823E1F00FC0809139108823B9F310 -:109F4000109239108CE699E30E94869F80910F1140 -:109F5000882369F313C181E090911011923009F0C8 -:109F600080E023E044E150E36C2F0E9494C4809190 -:109F7000360C882309F4AEC08091080E882309F4BA -:109F800083C08091350C882339F1D33009F04DC05E -:109F900080911011833031F080911302882309F4ED -:109FA000EBC010C0809139108823B1F310923910A2 -:109FB0001092350C0E94EBB734DF80910F1188238B -:109FC00059F3DCC081E090911011933009F080E0EA -:109FD00020E248E050E325C0D33039F580911011DC -:109FE000833031F080911302882309F4C5C010C07A -:109FF000809139108823B1F3109239101093350CE9 -:10A000000E94C9B70EDF80910F11882359F3B6C0A3 -:10A0100081E090911011933009F080E020E240EF50 -:10A020005FE26C2F0E9494C4A7C0D43009F0A4C092 -:10A0300080911011843031F080911302882309F44B -:10A040009BC018C0809139108823B1F31092391049 -:10A0500010923A10109206021093B7056FEF89EC38 -:10A060009FE20E9430C50E94D26780910F11882321 -:10A0700019F384C081E090911011943009F080E0D0 -:10A0800020E245EE5FE2CDCFD33009F049C08091A8 -:10A090001011833031F080911302882309F440C0FD -:10A0A0000FC0809139108823B1F3109239108DE7D9 -:10A0B00091EA0E94869F80910F11882361F35EC010 -:10A0C00081E090911011933009F080E023E047ED9A -:10A0D0005FE223C0D33021F580911011833029F045 -:10A0E000809113028823E1F00FC0809139108823FA -:10A0F000B9F3109239108DE791EA0E94869F809102 -:10A100000F11882369F33AC081E0909110119330C8 -:10A1100009F080E023E04DEF5FE26C2F0E9494C4D1 -:10A1200084E0CF5FDF5FC53009F0A5CE80930E11CC -:10A1300025C080911011813031F080911302882365 -:10A1400009F415CF0FC0809139108823B1F3109214 -:10A1500039108CE99FEA0E94869F80910F11882315 -:10A1600061F30CC081E090911011913009F080E012 -:10A1700023E04CE150E3F8CE85E0D3CFDF91CF91DF -:10A180001F9108953F924F925F926F927F928F92AC -:10A190009F92AF92BF92CF92DF92EF92FF920F9376 -:10A1A0001F93CF930E947DBBC0910D11312C82EA89 -:10A1B000482E80E3582E9EEA692E90E3792E2AECF1 -:10A1C000E22E20E3F22E32EDC32E30E3D32E49ED02 -:10A1D000A42E40E3B42E57EE852E50E3952EC111E8 -:10A1E00020C080911011882331F0809113028823C0 -:10A1F00009F4D8C00DC0809139108823B1F31092B2 -:10A2000039100E94D86780910F11882371F36BC2B7 -:10A2100081E090911011911180E024E049EF50E32A -:10A22000BEC0C13009F045C080911011813031F0BD -:10A2300080911302882309F4B5C017C080913910AA -:10A240008823B1F31092391000E010E027EE33E0DC -:10A250004AE050E06DE472E083EF90E30E94A7E5EE -:10A2600080910F11882321F33EC283E08F9387EE04 -:10A270008F931F928AE08F938DE492E09F938F9348 -:10A280009F928F928DEE90E39F938F933F9281E008 -:10A2900090911011913009F080E08F930E9484E436 -:10A2A0008DB79EB70C960FB6F8949EBF0FBE8DBFAC -:10A2B00079C0C23009F051C080911011823031F064 -:10A2C00080911302882309F46DC022C08091391057 -:10A2D0008823B1F31092391081E080931611109207 -:10A2E00034101092351010923610109237100EE57F -:10A2F0001EEC24E031E040E050E062E071E180EEED -:10A3000090E30E94A7E580910F118823C9F2EBC169 -:10A310008EE59EEC9F938F9381E08F9384E08F93E3 -:10A320001F921F9282E091E19F938F93DF92CF92D1 -:10A33000BF92AF923F9281E090911011923009F05C -:10A3400080E08F930E9484E48DB79EB70E960FB67F -:10A35000F8949EBF0FBE8DBF25C0C33061F1C430DD -:10A3600009F47AC0C53009F4C3C0C63009F410C17D -:10A37000C73009F45DC1C830A9F48091101188304C -:10A3800009F4A1C180911302882361F081E09091CA -:10A390001011983009F080E023E040E450E3632D91 -:10A3A0000E9494C43394CF5F95E0391218CF89E0AE -:10A3B00080930E1198C180911011833029F0809103 -:10A3C0001302882379F322C0809139108823B9F3CE -:10A3D0001092391081E0809316111092341010926F -:10A3E0003510109236101092371001E61EEC27E857 -:10A3F00030E040E050E060E071E18EEC90E30E94DC -:10A40000A7E580910F118823D1F26DC181E69EEC02 -:10A410009F938F931F9287E88F931F921F9280E0E4 -:10A4200091E19F938F9386EC90E39F938F93FF929C -:10A43000EF923F9281E090911011933009F080E00B -:10A440008F930E9484E48DB79EB70E960FB6F89452 -:10A450009EBF0FBE8DBFA6CF80911011843031F00A -:10A4600080911302882309F49DCF22C08091391076 -:10A470008823B1F31092391081E080931611109265 -:10A48000341010923510109236101092371000E0F0 -:10A4900010E02FEF30E040E050E06FE376E08AEB31 -:10A4A00090E30E94A7E580910F118823C9F21BC198 -:10A4B0001F928FEF8F931F921F928FE396E09F93CF -:10A4C0008F935F924F927F926F923F9281E0909133 -:10A4D0001011943009F080E08F930E9484E48DB7CE -:10A4E0009EB70C960FB6F8949EBF0FBE8DBF5ACF85 -:10A4F00080911011853031F080911302882309F486 -:10A5000051CF22C0809139108823B1F310923910B5 -:10A5100081E0809316111092341010923510109231 -:10A5200036101092371000E010E02FEF30E040E0DE -:10A5300050E061E476E086E990E30E94A7E580912F -:10A540000F118823C9F2CFC01F928FEF8F931F92F4 -:10A550001F9281E496E09F938F938EE790E39F9301 -:10A560008F938AE890E39F938F933F9281E090913D -:10A570001011953009F080E08F930E9484E48DB72C -:10A580009EB70C960FB6F8949EBF0FBE8DBF0ACF34 -:10A5900080911011863031F080911302882309F4E4 -:10A5A00001CF22C0809139108823B1F31092391065 -:10A5B00081E0809316111092341010923510109291 -:10A5C00036101092371000E010E02FEF30E040E03E -:10A5D00050E063E476E082E790E30E94A7E5809193 -:10A5E0000F118823C9F27FC01F928FEF8F931F92A4 -:10A5F0001F9283E496E09F938F938AE590E39F9365 -:10A600008F9386E690E39F938F933F9281E09091A2 -:10A610001011963009F080E08F930E9484E48DB78A -:10A620009EB70C960FB6F8949EBF0FBE8DBFBACEE4 -:10A6300080911011873031F080911302882309F442 -:10A64000B1CE17C0809139108823B1F31092391020 -:10A650000BE31EEC27EE33E04AE050E06BE472E0DF -:10A6600085E590E30E94A7E580910F11882321F3EF -:10A670003AC08BE39EEC9F938F9383E08F9387EE9A -:10A680008F931F928AE08F938BE492E09F938F9336 -:10A690008BE490E39F938F9380E590E39F938F9358 -:10A6A0003F9281E090911011973009F080E08F93F4 -:10A6B0000E9484E48DB79EB70E960FB6F8949EBFA5 -:10A6C0000FBE8DBF6FCE80913910882309F45ACE0A -:10A6D0001092391083E69EEC0E94869F80910F11A4 -:10A6E000882309F44FCECF911F910F91FF90EF90E7 -:10A6F000DF90CF90BF90AF909F908F907F906F90A2 -:10A700005F904F903F9008958F929F92AF92BF922B -:10A71000CF92DF92EF92FF920F93CF93DF931F922E -:10A72000CDB7DEB77C015B016A0149018091470F1B -:10A730008823E9F0F70180819181C80ED91ED1826A -:10A74000C08222C001111DC0BE016F5F7F4FC401D6 -:10A750000E94E34EF701808191810196918380836D -:10A76000FFEFAF1ABF0A81E0C81AD10869F0F701FC -:10A77000808191810E9436EF89839091480F9111D9 -:10A78000E1CFF5018083E0CF0F90DF91CF910F9162 -:10A79000FF90EF90DF90CF90BF90AF909F908F9001 -:10A7A00008957F928F929F92AF92BF92CF92DF9245 -:10A7B000EF92FF920F931F93CF93DF931F92CDB72A -:10A7C000DEB7E091470FEE2341F0FC01208131819B -:10A7D000420F531F5183408349C069017C015B01D3 -:10A7E0008B01040F151FA016B10609F43FC0F70135 -:10A7F00080809180F50171905F017982C4010E948F -:10A8000036EF781631F1672DC4010E943EEFC40186 -:10A810000E9436EF99818917E1F0EAEBFFE084911D -:10A820008F010F5F1F4F882321F00E940232F80131 -:10A83000F6CFEEEFF0E384918F010F5F1F4F882377 -:10A8400021F00E940232F801F6CF81E08093470F99 -:10A850000DC0BE016F5F7F4FC6010E94E34EF7013E -:10A8600080819181019691838083BDCF0F90DF918C -:10A87000CF911F910F91FF90EF90DF90CF90BF90FD -:10A88000AF909F908F907F900895CF93DF93CDB737 -:10A89000DEB72C970FB6F894DEBF0FBECDBF809108 -:10A8A0001D0490911E04A0911F04B091200489837F -:10A8B0009A83AB83BC838091210490912204A09160 -:10A8C0002304B09124048D839E83AF83B887809145 -:10A8D000250490912604A0912704B091280489872B -:10A8E0009A87AB87BC870E945D5E0E94827380E07E -:10A8F0000E94CC2F81E00E94CC2F82E00E94CC2FBE -:10A900000E94FE5F4CE050E06DE174E0CE010196E4 -:10A910000E94B8F2892B51F02C960FB6F894DEBF46 -:10A920000FBECDBFDF91CF910C94C6822C960FB68F -:10A93000F894DEBF0FBECDBFDF91CF9108950F9386 -:10A940001F93CF93DF938B01EA01DB016D917C9123 -:10A9500004960E943F88D801ED91FC911197908157 -:10A960008881992349F08D3838F43196ED93FC9322 -:10A9700088818F5F8883EFCF8D3858F48FE2808392 -:10A98000F8018081918101969183808388818F5F16 -:10A990008883DF91CF911F910F910895FC0120E0F2 -:10A9A0003EE2DB014C91403241F0283011F430831B -:10A9B0003196DB014C91408331962F5F6F5F7F4F63 -:10A9C0002B3079F710820895CF9380914A14882311 -:10A9D000B9F1409142145091431460914414709124 -:10A9E000451422E432E180914B1490914C140E9462 -:10A9F000E089C82F811102C0C0E023C040914614F5 -:10AA000050914714609148147091491441155105B3 -:10AA10006105710591F022E432E180914B1490912F -:10AA20004C140E94E089882339F310924614109246 -:10AA30004714109248141092491410924A1401C0FD -:10AA4000C1E08C2FCF910895CF92DF92EF92FF92C9 -:10AA5000CF936B017C01C42F8091421490914314D9 -:10AA6000A0914414B09145148C159D05AE05BF0509 -:10AA7000C9F0AADF811102C080E018C022E432E1EF -:10AA8000B701A60180914B1490914C140E943F8A0B -:10AA9000882391F3C0924214D0924314E09244145C -:10AAA000F092451481E0C11180934A14CF91FF9038 -:10AAB000EF90DF90CF9008954F925F926F927F92C8 -:10AAC0008F929F92AF92BF92CF92DF92EF92FF92BE -:10AAD0000F931F93CF93DF93EC0142305105610533 -:10AAE000710510F480E068C089859A85AB85BC85C6 -:10AAF0000196A11DB11D84179507A607B70790F30E -:10AB00008F89803149F4852E962EA72EBB248B8900 -:10AB10009C89AD89BE890FC0803221F78B889C88C3 -:10AB2000AD88BE88DB01CA01E7E0B695A795979589 -:10AB30008795EA95D1F7880E991EAA1EBB1E28019B -:10AB400039016A017B0141E0C501B4017DDF882341 -:10AB500049F29F89903161F4DD24EE24FF249601AF -:10AB6000220F331FF901EE5BFD4E5182408211C06E -:10AB7000E894C7F8DD24EE24FF249601220F331F4A -:10AB8000220F331FF901EE5BFD4E4082518262823B -:10AB900073829A89923080F04D815E816F817885D1 -:10ABA000840E951EA61EB71E8092461490924714DE -:10ABB000A0924814B0924914DF91CF911F910F9148 -:10ABC000FF90EF90DF90CF90BF90AF909F908F90CD -:10ABD0007F906F905F904F900895CF92DF92EF92A9 -:10ABE000FF920F931F93CF93DF93FC018185928592 -:10ABF000A385B4850196A11DB11D84179507A607ED -:10AC0000B70710F480E060C08789803149F4BB2722 -:10AC1000A72F962F852FC388D488E588F6880FC084 -:10AC2000803281F783899489A589B6896A017B017D -:10AC3000C7E0F694E794D794C794CA95D1F78C0DE2 -:10AC40009D1DAE1DBF1DE9016A017B018F01409171 -:10AC50004214509143146091441470914514841728 -:10AC60009507A607B70731F040E0BC01CD01ECDE47 -:10AC7000882341F2F8018789803179F4B701A60170 -:10AC8000552766277727440F551FFA01EE5BFD4EC7 -:10AC900080819181A0E0B0E012C0B701A6014F779A -:10ACA000552766277727440F551F440F551FFA0174 -:10ACB000EE5BFD4E80819181A281B381BF7088835C -:10ACC0009983AA83BB8381E0DF91CF911F910F917C -:10ACD000FF90EF90DF90CF9008954F925F926F9228 -:10ACE0007F92AF92BF92CF92DF92EF92FF920F933B -:10ACF0001F93CF93DF9300D01F92CDB7DEB78C01A7 -:10AD000049835A836B837C835901C12CD12C7601F2 -:10AD1000412C82E0582E612C712C49815A816B8123 -:10AD20007C819E012F5F3F4FC80157DF882341F18F -:10AD3000D301C201F801058404C0880F991FAA1F1E -:10AD4000BB1F0A94D2F7C80ED91EEA1EFB1E49810A -:10AD50005A816B817C818789803139F481E0483F59 -:10AD60005F4F6105710538F4D8CF81E0483F5F4FF0 -:10AD70006F4F7F4090F2F501C082D182E282F38270 -:10AD80000F900F900F900F90DF91CF911F910F9127 -:10AD9000FF90EF90DF90CF90BF90AF907F906F903B -:10ADA0005F904F900895DF92EF92FF920F931F9361 -:10ADB000CF93DF938C01EB017A018DE0D82E40E236 -:10ADC00050E0BE01C8010E949A8A8032910539F094 -:10ADD00021E0892B09F420E0822F819544C028814D -:10ADE0002223C9F1253E11F02E3231F4E114F10491 -:10ADF00031F3F7011082E3CFE114F10441F13B8517 -:10AE00003F733F3021F54A8D5B8D452B01F52F7146 -:10AE10003FEF320F3230D8F430E021503109D29E6A -:10AE2000C001D39E900D1124D701A80FB91FFE01B8 -:10AE300020E0AD01253088F431813D932F5F3296BB -:10AE40002D30C1F7288126FF02C0FA0115862B8517 -:10AE500023FDB5CF08C080E006C02B3010F434814C -:10AE6000ECCF3681EACFDF91CF911F910F91FF9008 -:10AE7000EF90DF900895CF93DF93EC018B818823CF -:10AE800031F1898187FF20C061E0CE010E942388D3 -:10AE9000FC01892BE1F08081853EC9F08B818230F5 -:10AEA00040F489899A89AB89BC89848F958FA68F54 -:10AEB000B78F8D899E89AF89B88D938F828FB58B1F -:10AEC000A48B89818F778983DF91CF917DCD81E0BC -:10AED000888380E0DF91CF9108952F923F924F9227 -:10AEE0005F926F927F928F929F92AF92BF92CF921A -:10AEF000DF92EF92FF920F931F93CF93DF9300D0D7 -:10AF00001F92CDB7DEB78C014B011A01DC011396FD -:10AF10008C9113978130C9F411968C9181FF15C0E3 -:10AF200082FF19C0F801418952896389748980853B -:10AF30009185A285B38584179507A607B70759F0B1 -:10AF4000C8010E943087811106C081E0D8018C932E -:10AF50008FEF9FEF29C1610185C059968D919C911A -:10AF60005A97FC0174802FEF270D2A013B0139E02D -:10AF700076946794579447943A95D1F7722E74203B -:10AF80007A01F1E0FF22772009F478C080E092E0B6 -:10AF90008E199F0956018C159D0508F45C01D80196 -:10AFA00059962D913C915A9714968D919D910D90A3 -:10AFB000BC91A02D0297A109B109F901058404C033 -:10AFC000880F991FAA1FBB1F0A94D2F74685578581 -:10AFD00060897189840F951FA61FB71F9C01AD0161 -:10AFE000270D311D411D511D29013A01A11432E0E7 -:10AFF000B30609F089C08091421490914314A09146 -:10B000004414B0914514481659066A067B0669F443 -:10B0100010924A148FEF9FEFDC01809342149093BB -:10B020004314A0934414B09345149401B301A201B6 -:10B0300080914B1490914C140E94E089882309F46C -:10B0400084CFF80180859185A285B3858A0D9B1DEB -:10B05000A11DB11D80879187A287B3878A0C9B1C95 -:10B06000CA18DB08D80118964D915D916D917C91BD -:10B070001B97C114D10409F070CF7AC0E114F10418 -:10B0800009F084CF14964D915D916D917C91179745 -:10B09000411551056105710559F455968D919D91A4 -:10B0A0000D90BC91A02D0097A105B10539F520C0E8 -:10B0B0009E012F5F3F4F91DD882309F446CF8981A0 -:10B0C0009A81AB81BC81F801218D328DF9012789EC -:10B0D000203139F4883FFFEF9F07A105B10540F407 -:10B0E0000DC0883F2FEF9207A2072FE0B20730F084 -:10B0F000C8010E947288811149CF27CFF80184834B -:10B100009583A683B78342CFE114F10411F5D801EA -:10B1100018964D915D916D917C911B9751968D91F3 -:10B120009D910D90BC91A02D481759076A077B0788 -:10B1300080F04ADC882309F408CF81E080934A1428 -:10B1400040924214509243146092441470924514F9 -:10B1500007C041E0C301B20177DC882309F4F5CED2 -:10B16000A501B401C7018E5B9D4E0E94C5F269CF57 -:10B17000F80181899289A389B48984179507A60764 -:10B18000B70738F4418B528B638B748B8181806855 -:10B190008183F801818183FD02C0C10105C0C8011E -:10B1A0006ADE8111FACFD1CE0F900F900F900F90E1 -:10B1B000DF91CF911F910F91FF90EF90DF90CF9093 -:10B1C000BF90AF909F908F907F906F905F904F90C7 -:10B1D0003F902F900895CF93DF931F92CDB7DEB7A6 -:10B1E000698341E050E0BE016F5F7F4F049675DEDA -:10B1F0000F90DF91CF9108958F929F92AF92BF925F -:10B20000CF92DF92EF92FF921F93CF93DF93C82FDD -:10B210008EED9DE090934C1480934B141092FA0D98 -:10B2200082E090E0A0E0B0E08093E30D9093E40D25 -:10B23000A093E50DB093E60D10924A1410924614B7 -:10B240001092471410924814109249148FEF9FEFF8 -:10B25000DC018093421490934314A0934414B09360 -:10B260004514CC2371F1C53008F0F6C040E060E031 -:10B2700070E0CB01E9DB882309F4EEC020E1C29F36 -:10B28000C00111248E5C9D4EFC01E254FE4F2081D2 -:10B290002F7709F0E1C03C96408151816281738132 -:10B2A000443651056105710508F4D6C03497C08055 -:10B2B000D180E280F380C114D104E104F10421F4CF -:10B2C000CBC0C12CD12C760140E0C701B601BCDB5C -:10B2D000182F882309F4C0C080914D1290914E120E -:10B2E0008115924009F0B8C0A0915212AA2309F426 -:10B2F000B3C060915012709151126115710509F43B -:10B30000ABC020914F12222309F4A6C0A093F50DE3 -:10B310002093E70D80E030E041E050E0C82FFA01D3 -:10B32000082E02C0EE0FFF1F0A94E2F72E173F0708 -:10B3300039F08F5FC83091F789E08093F00D8CC0B1 -:10B340008093F00D2091581230915912211531053A -:10B3500019F040E050E008C0209166123091671269 -:10B3600040916812509169122093E80D3093E90DD5 -:10B370004093EA0D5093EB0D46015701860E971E40 -:10B38000A11CB11C8092F60D9092F70DA092F80DC1 -:10B39000B092F90DE0915312F0915412F093FC0D1C -:10B3A000E093FB0DB0E00E947DEF860E971EA81E75 -:10B3B000B91E8092FD0D9092FE0DA092FF0DB092ED -:10B3C000000E85E0EE0FFF1F8A95E1F7E150FE4F7A -:10B3D000EF2FFF27E6958E0E9F1EA11CB11C8092B9 -:10B3E000F10D9092F20DA092F30DB092F40D209118 -:10B3F0005512309156122115310521F0A90160E056 -:10B4000070E008C040916212509163126091641222 -:10B4100070916512D701C60188199909AA09BB095B -:10B42000840F951FA61FB71F04C0B695A7959795C3 -:10B430008795CA95D2F78093EC0D9093ED0DA0936C -:10B44000EE0DB093EF0D853F2FE09207A105B105FA -:10B4500028F48CE08093FA0D10E01AC0853F9F4FCE -:10B46000A105B10510F480E111C080916E12909198 -:10B470006F12A0917012B09171128093FD0D909394 -:10B48000FE0DA093FF0DB093000E80E28093FA0DA5 -:10B49000812FDF91CF911F91FF90EF90DF90CF90A0 -:10B4A000BF90AF909F908F900895CF92DF92EF92D0 -:10B4B000FF921F93CF93DF931092360C8091700C04 -:10B4C000882321F08DE69CE00E941A881092E20DFC -:10B4D0001092DF0D85E38093DE0D7FD1EB01A895FF -:10B4E00061E08091DE0D0E944FBD8EED9DE00E94D7 -:10B4F0007B892398229A219A209A289A85E0809322 -:10B50000E00D82E58CBD1DBC1AE08FEF0E948089A2 -:10B510001150D9F720E030E0A90160E08EED9DE008 -:10B520000E948589182F8093E10D813041F055D11B -:10B530006C1B7D0B613D774068F381E053C02AEAC4 -:10B5400031E040E050E068E08EED9DE00E948589AA -:10B5500082FF03C01093E20D0EC014E00E94938E90 -:10B560008093E10D1150D1F78A3A11F082E03AC090 -:10B5700082E08093E20D8091E20D823021F0C12CB7 -:10B58000D12C760105C0C12CD12CE12C80E4F82E01 -:10B5900020E030E0A90167E38EED9DE00E948589FF -:10B5A000A701960169E28EED9DE00E948589809356 -:10B5B000E10D882341F011D16C1B7D0B613D77407B -:10B5C00038F38AE00FC08091E20D823011F520E05F -:10B5D00030E0A9016AE38EED9DE00E948589882311 -:10B5E00051F088E08093DF0D8EED9DE00E947B8915 -:10B5F000EAEBFFE019C00E94938E807C803C19F436 -:10B6000083E08093E20D0E94938E0E94938E0E94AD -:10B61000938E8EED9DE00E947B891092E00D81E07B -:10B62000EBDD811131C015C08491EF012196882393 -:10B6300021F00E940232FE01F7CFE9E4F1E38491A8 -:10B64000EF012196882309F456C00E940232FE01C0 -:10B65000F6CF80E0D1DD811117C0EBE8FFE08491E7 -:10B66000EF012196882321F00E940232FE01F7CFDC -:10B67000E5E3F1E38491EF012196882309F43BC0CF -:10B680000E940232FE01F6CF63EE7DE08DE69CE083 -:10B690000E94C787811116C0EBE8FFE08491EF019B -:10B6A0002196882321F00E940232FE01F7CFE4E2C6 -:10B6B000F1E38491EF0121968823E9F00E940232A0 -:10B6C000FE01F7CF81E08093360CEAEBFFE0849136 -:10B6D000EF012196882321F00E940232FE01F7CF6C -:10B6E000E8E1F1E38491EF012196882321F00E94A3 -:10B6F0000232FE01F7CF8BE1EDE6FCE0ACE8BCE006 -:10B7000001900D928A95E1F780916B0C90916C0CF1 -:10B7100090938B0C80938A0CDF91CF911F91FF90B7 -:10B72000EF90DF90CF9008950F931F93CF93DF9307 -:10B730008C01EB019091210C2091220C921307C0F7 -:10B7400085E19CE00E94372F0E9446B4F3CFF801B8 -:10B7500060817181488159818091200C34E0839F00 -:10B76000F0011124E75EF34F7387628755874487A2 -:10B770009F5F9093210C8F5F281719F08093200C06 -:10B7800002C01092200CDF91CF911F910F9108956C -:10B790003FB7F8948091521490915314A09154148F -:10B7A000B091551426B5A89B05C02F3F19F00196FE -:10B7B000A11DB11D3FBFBA2FA92F982F8827820F37 -:10B7C000911DA11DB11DBC01CD0142E0660F771F87 -:10B7D000881F991F4A95D1F708952FB7F894609163 -:10B7E0004E1470914F1480915014909151142FBFAA -:10B7F00008951F920F920FB60F9211242F933F932B -:10B800008F939F93AF93BF9380914E1490914F1459 -:10B81000A0915014B091511430914D1423E0230F96 -:10B820002D3720F40196A11DB11D05C026E8230F78 -:10B830000296A11DB11D20934D1480934E14909338 -:10B840004F14A0935014B0935114809152149091BE -:10B850005314A0915414B09155140196A11DB11D1B -:10B860008093521490935314A0935414B09355148E -:10B87000BF91AF919F918F913F912F910F900FBEEC -:10B880000F901F901895CF93DF93EBE8FFE0849122 -:10B89000EF012196882321F00E940232FE01F7CFAA -:10B8A000EEEAF7E08491EF012196882321F00E94CF -:10B8B0000232FE01F7CFDF91CF910895CF93DF934E -:10B8C000CDB7DEB7CA56D1090FB6F894DEBF0FBEAA -:10B8D000CDBF789484B5826084BD84B5816084BD19 -:10B8E00085B5826085BD85B5816085BD80916E001E -:10B8F000816080936E00109281008091810082604F -:10B90000809381008091810081608093810080918B -:10B9100080008160809380008091B100846080937A -:10B92000B1008091B00081608093B000809191005F -:10B93000826080939100809191008160809391005A -:10B94000809190008160809390008091A10082603E -:10B950008093A1008091A10081608093A1008091DB -:10B96000A00081608093A00080912101826080937B -:10B97000210180912101816080932101809120012A -:10B9800081608093200180917A00846080937A00A6 -:10B9900080917A00826080937A0080917A00816041 -:10B9A00080937A0080917A00806880937A00109268 -:10B9B000C1006F98779A82E08093C0001092C50012 -:10B9C00087E08093C4008091C10080618093C100B2 -:10B9D0008091C10088608093C1008091C10080681F -:10B9E0008093C100E3E6FBE084918F010F5F1F4F5E -:10B9F000882321F00E940232F801F6CFEAEBFFE043 -:10BA000084918F010F5F1F4F882321F00E94023223 -:10BA1000F801F6CF14B710FF0DC0EAE5FBE0849102 -:10BA20007F012FEFE21AF20A882321F00E940232EE -:10BA3000F701F5CF11FF0DC0E9E4FBE084917F0130 -:10BA40003FEFE31AF30A882321F00E940232F70144 -:10BA5000F5CF12FF0DC0E7E3FBE084917F019FEF7C -:10BA6000E91AF90A882321F00E940232F701F5CF82 -:10BA700013FF0DC0E6E2FBE084917F012FEFE21A95 -:10BA8000F20A882321F00E940232F701F5CF15FF58 -:10BA90000CC0E5E1FBE084918F010F5F1F4F88230D -:10BAA00021F00E940232F801F6CF14BEEEE0FBE076 -:10BAB00084918F010F5F1F4F882321F00E94023273 -:10BAC000F801F6CF80E20E940232E7E0FBE08491C9 -:10BAD0008F010F5F1F4F882321F00E940232F8016F -:10BAE000F6CF8AE00E940232EAEBFFE084918F01F8 -:10BAF0000F5F1F4F882321F00E940232F801F6CF1A -:10BB0000E7EFFAE084918F010F5F1F4F882321F048 -:10BB10000E940232F801F6CFECEEFAE084918F0138 -:10BB20000F5F1F4F882321F00E940232F801F6CFE9 -:10BB3000E3ECFAE084918F010F5F1F4F882321F01F -:10BB40000E940232F801F6CFEAEBFFE084918F0108 -:10BB50000F5F1F4F882321F00E940232F801F6CFB9 -:10BB6000ECEAFAE084918F010F5F1F4F882321F0E8 -:10BB70000E940232F801F6CFEAEBFFE084918F01D8 -:10BB80000F5F1F4F882321F00E940232F801F6CF89 -:10BB90008091561490915714FE0131967F01BF0198 -:10BBA000009719F0681B790B02C06C5574418DE940 -:10BBB0009AE00E94F95D60E175E086E89AE00E94F3 -:10BBC000F95D8AE00E94023281E080932D04809327 -:10BBD0002E0480932F04809330040E942E7C8CE0EE -:10BBE000E1E1F4E0ADE1B4E001900D928A95E1F776 -:10BBF0000E940C308091010180648093010180914A -:10BC0000010180618093010180910101886080932E -:10BC100001016D9A80910101806280930101809100 -:10BC200001018860809301016C9A87ED80937A000E -:10BC300010927E0010927D0080917E008160809342 -:10BC40007E0080917E00846080937E0080E888BDC5 -:10BC500080916E00846080936E006AEF70E080E0F7 -:10BC600090E00E9452BE85E090E090930E04809395 -:10BC70000D04009102021091030260E0C8010E94CD -:10BC80007AA720E030E040EA50E40E946DEB87FFA5 -:10BC900007C0005111091093030200930202E9CF7B -:10BCA00083E191E0909305028093040200910B04DC -:10BCB00010910C0460E0C8010E947AA720E030E8EF -:10BCC00049E853E40E94BDF118163CF4005F1F4F91 -:10BCD00010930C0400930B04E9CF00910002109123 -:10BCE0000102C8010E94FFAC20E030E040EA50E4CD -:10BCF0000E946DEB87FF07C00051110910930102EC -:10BD000000930002EACF0091090410910A04C801CF -:10BD10000E94FFAC20E030E046E153E40E94BDF118 -:10BD200018163CF4005F1F4F10930A040093090497 -:10BD3000EACF0E94AEB726982E9A25982D9A24987D -:10BD40002C9A1092100410920F041FB7F89480914F -:10BD5000B805811127C0E6EEF8E28491ECE2F9E241 -:10BD60009491E82FF0E0EE0FFF1FED59F74DA591EC -:10BD7000B491EC91E92321F461E085E30E9421BDB7 -:10BD800061E085E30E944FBD8CB580618CBD8CB5B0 -:10BD900080648CBD61E084E30E944FBD61E083E379 -:10BDA0000E944FBD8091B8058F5F8093B8051FBF7B -:10BDB000579A03E5C02E02E0D02E10E0F601619103 -:10BDC0006F0170E0812F0E947EB91F5F1530B1F7BF -:10BDD000999A989A809107018068809307019A9AAE -:10BDE0008091070180648093070180910701806240 -:10BDF00080930701809107018860809307018091FB -:10BE00000701806180930701809107018260809320 -:10BE100007018091070184608093070118E5C12E16 -:10BE200012E0D12E10E0F60161916F01812F0E9486 -:10BE30003CB91F5F1530B9F780910A018260809389 -:10BE40000A0180910A01816080930A0180910A01B0 -:10BE5000846080930A0180910A01806480930A01C2 -:10BE600080910A01806880930A010F9A179A0E9AAE -:10BE7000169A0D9A159A0C9A149A0B9A139A389A44 -:10BE80004098179A809133048E7F80933304399AB7 -:10BE90004198169A809133048D7F809333043A9AA7 -:10BEA0004298159A809133048B7F809333043B9A98 -:10BEB0004398149A809180008C7F809380008091B9 -:10BEC0008100877E886080938100809180008F73DD -:10BED0008093800080918100887F826080938100C0 -:10BEE00080E090E490938900809388001092850010 -:10BEF0001092840080916F00826080936F0081E0D7 -:10BF00008093100478940E94C1560E94609F0E9402 -:10BF100011CF0091B20BB090B30B10E0C801805864 -:10BF2000910997FD019695958795C82E0E943751E6 -:10BF3000C8014E9796958795A82E06561109169515 -:10BF40000795D02EB4EF9B2E9B0CBA94BA9409E2BD -:10BF500020E840E06C2D82EB9BE00E9442BF8823EA -:10BF600041F00BED17E029E240E160E08C2D0E94EA -:10BF7000244F84E00E946DC84FE253E0692D8A2D62 -:10BF80000E94FB4E45E353E06B2D8D2D0E94FB4E2E -:10BF90000E941A508111DBCF64EC79E080E090E0E0 -:10BFA0000E9443C498E288E10FB6F894A895809364 -:10BFB00060000FBE9093600060E08CE20E944FBD75 -:10BFC0008091940B833009F072C040E050E0BA01D8 -:10BFD00088E290E60E94C96007E413E0F8018191CD -:10BFE0008F01882319F00E940232F8CF8AE00E9464 -:10BFF000023280918B0B8F9380918A0B8F9380916B -:10C00000890B8F938091880B8F9380918F0B8F93E7 -:10C0100080918E0B8F9380918D0B8F9380918C0BE1 -:10C020008F938091930B8F938091920B8F9380913C -:10C03000910B8F938091900B8F938091870B8F93AF -:10C040008091860B8F938FE69AE09F938F93FF9258 -:10C05000EF920E9407EB87010FB6F894DEBF0FBE88 -:10C06000CDBF6701F60181916F01882319F00E940D -:10C070000232F8CF8AE00E94023288E79BE09F9369 -:10C080008F938BE69AE09F938F93FF92EF920E949B -:10C0900007EB0F900F900F900F900F900F90F801FB -:10C0A00081918F01882369F00E940232F8CF00E568 -:10C0B00013E0F80181918F01882319F00E94023268 -:10C0C000F8CF8AE00E9402324E01F1E68F0E911CF9 -:10C0D0008E010F5F1F4F6CED262E6BE0362E70ED3C -:10C0E000472E7BE0572E8091600C87FD3FC08091EA -:10C0F000350C81113BC08091360C811101C0D5D91E -:10C100008091360C882379F18091600C282F082EBD -:10C11000000C330B3F938F932AE63BE03F932F9322 -:10C120009F928F920E9407EB8DE69CE00E94778998 -:10C130000F900F900F900F900F900F908091700CB8 -:10C14000823088F08091750C9091760CA091770CDC -:10C15000B091780C8F719927AA27BB27892B8A2B3E -:10C160008B2B09F430C28FEF8093600C8091B70560 -:10C17000882331F11092B7051092350C8091080E8A -:10C18000882321F085E09EE00E941A881092B6056F -:10C19000109231041092B5050E943B7C0E9400B8B9 -:10C1A0000E9453AA1092400610923F061092420637 -:10C1B0001092410610924406109243061092060215 -:10C1C0008091B605843010F40E9486328091B605C5 -:10C1D000882309F4A5C08091330C882309F489C011 -:10C1E000C090B505F0E6CF9EC00111249C012B5CE8 -:10C1F0003B4F690168EF7BE0C9010E94EDEA892BA2 -:10C2000001F185E09EE00E943BD785E09EE00E9420 -:10C210001A881092340C1092330CE5EEFBE08491F6 -:10C220006F013FEFC31AD30A882341F00E94023204 -:10C23000F601F5CF8091340C81115BC00E94B4945B -:10C240005AC0F60101900020E9F731975F01AC1860 -:10C25000BD081092050E6EE470E0C6010E94F3F274 -:10C260003C01009739F481E0A81AB108F601EA0D03 -:10C27000FB1D0DC060E270E00E94F3F201966C01BC -:10C280006AE270E0C3010E94F3F2FC0131978DE095 -:10C2900081838AE082831382F60101900020E9F70E -:10C2A0003197AF014C195D09B60185E09EE00E940F -:10C2B0006DD78091050E882309F4BCCFEBE8FFE031 -:10C2C00084916F019FEFC91AD90A882321F00E9437 -:10C2D0000232F601F5CFE3E7FBE084916F012FEF27 -:10C2E000C21AD20A882309F4A5CF0E940232F601AD -:10C2F000F4CF0E94F8948091B605882389F081508C -:10C300008093B6058091B5058F5F843018F48093D3 -:10C31000B50502C01092B5058091B6058111A5C082 -:10C320008091940B813009F0A0C080918B0B8F938A -:10C3300080918A0B8F933F922F92FF92EF920E94EF -:10C3400007EB67010F900F900F900F900F900F90D9 -:10C350005701F50181915F01882319F00E94023293 -:10C36000F8CF8AE00E940232C7010E940932809110 -:10C37000890B8F938091880B8F935F924F92FF92DE -:10C38000EF920E9407EB0F900F900F900F900F907D -:10C390000F905701F50181915F01882319F00E94E8 -:10C3A0000232F8CF8AE00E940232C7010E940932AD -:10C3B0002AEC3BE03F932F93FF92EF920E9407EB12 -:10C3C0000F900F900F900F905701F50181915F0131 -:10C3D000882319F00E940232F8CF8AE00E940232CC -:10C3E000C8010E94093224EC3BE03F932F931F9336 -:10C3F0000F930E9407EB0F900F900F900F90570133 -:10C40000F50181915F01882319F00E940232F8CF73 -:10C410008AE00E940232C8010E9409322AEB3BE006 -:10C420003F932F931F930F930E9407EB0F900F9052 -:10C430000F900F90F60181916F01882319F00E94EF -:10C440000232F8CF8AE00E940232C8010E9409320B -:10C450008091340484608093340480913304846038 -:10C460008093330482E08093940B8091B605811110 -:10C4700040C088E79BE02091940B2230D1F59F9338 -:10C480008F9380918F0B8F9380918E0B8F938091E0 -:10C490008D0B8F9380918C0B8F9389E593E09F9305 -:10C4A0008F93FF92EF920E9436F367010FB6F894D4 -:10C4B000DEBF0FBECDBF5701F50181915F0188231B -:10C4C00019F00E940232F8CF8AE00E9402321092E4 -:10C4D000940B0E94BC68C7010E940932F601819149 -:10C4E0006F01882319F00E940232F8CF8AE00E947F -:10C4F000023280913204882309F457C090913204AB -:10C500008091B905981709F450C0EAEBFFE08491D7 -:10C510006F012FEFC21AD20A882321F00E94023243 -:10C52000F601F5CFEBEAFBE084916F013FEFC31A10 -:10C53000D30A882321F00E940232F601F5CF8091C0 -:10C54000320480FD76C08091320484FD72C050E2D6 -:10C55000D52E8091320481FD78C08091320485FD12 -:10C5600074C040E2C42E8091320482FD7AC0809172 -:10C57000320486FD76C030E2B32E8AE00E94023299 -:10C580001F9280E28F931F92BF921F92CF921F92B1 -:10C59000DF928AE89BE09F938F931F920E947D4ECB -:10C5A0000FB6F894DEBF0FBECDBF809132048093EA -:10C5B000B9050E94899080E090E0892B09F493CD21 -:10C5C0000E94000090CD40E050E0B7018DE69CE075 -:10C5D0000E94D3D618160CF0C6CDF70101900020AA -:10C5E000E9F73197BE2EBE18BA949FEFB91669F0DD -:10C5F0006801CB0CD11CB7FCDA94F601808190E085 -:10C600000E94B0F2F6018083EFCF8A858E3709F45D -:10C6100095CD45E050E0B401C8010E940EF3892B8E -:10C6200009F08CCDC4010E9407BB8091600C8F5F24 -:10C630009BCD80E00E942574AB01BC0187EA9BE0A2 -:10C640000E94DC5D28E5D22E84CF81E00E94257413 -:10C65000AB01BC0183EA9BE00E94DC5D99E5C92E39 -:10C6600082CF82E00E942574AB01BC018FE99BE080 -:10C670000E94DC5D8AE5B82E80CFF1D1E091B40B49 -:10C68000F091B50B828193819093AD0B8093AC0BAD -:10C6900080E1E5E0FCE0DF01282F1D922A95E9F713 -:10C6A000E5EFFBE0DF011D928A95E9F71092F10BAF -:10C6B0001092F20B1092F30B1092F40B1092F00BFD -:10C6C0001092EF0B1092EE0B1092ED0B1092EC0B00 -:10C6D00010926D0C1092700C10926C0C10926B0CEE -:10C6E00087E692E090936A0C8093690C10928C0C10 -:10C6F00010928F0C10928B0C10928A0C9093890CD4 -:10C700008093880CE7EAFCE014821782138212827D -:10C71000918380837F96BDE0ED3DFB07A9F789E11A -:10C720008093DF0D1092E20D1092FA0D1092050E1B -:10C730001092080E1092040E1092030E87E692E0FB -:10C740009093020E8093010E1092340C1092330CD1 -:10C750001092360C1092350C1092610C1092620CF3 -:10C760001092630C1092640C1092650C1092660C7F -:10C770001092670C1092680C1092200E1092DD0D32 -:10C7800086E391E0E7EAFCE0DF019C011D92215085 -:10C790003040E1F78FEF8093600C81E692E0909358 -:10C7A000160C8093150C84E08093220C1092200CC0 -:10C7B00010921F0C1092210C6E9A769810921B0CFE -:10C7C00010921C0C10921D0C10921E0C0895CF920A -:10C7D000DF92EF92FF920F93CF93DF93982F862FE4 -:10C7E0006A017901692F0E946C689091E60B809133 -:10C7F0001811891708F448C09091E80B809117111F -:10C80000981708F441C0002321F0C7010E94449FFB -:10C8100003C0C7010E94529FD82FC4E1C81BF60174 -:10C820008491882339F00E9486C8C81BFFEFCF1A75 -:10C83000DF0AF5CF8AE30E945450CC2329F080E22E -:10C840000E945450C150F9CF809118119AEFD99F8E -:10C85000D02D1124D058D093E90B8093EA0BC70157 -:10C86000002349F0DF91CF910F91FF90EF90DF907F -:10C87000CF900C94B1C8DF91CF910F91FF90EF90C2 -:10C88000DF90CF900C94BEC8DF91CF910F91FF90B5 -:10C89000EF90DF90CF900895CF92DF92EF92FF92CA -:10C8A0000F93CF93DF93CDB7DEB7E989FA89C080C4 -:10C8B000D180E280F38020E030E0A901C701B60119 -:10C8C0000CD787FD05C020E030E040E05FE304C006 -:10C8D00020E030E040E05FEBC701B6010E9497EF37 -:10C8E0000E94DBF0CB010E940DC400E09C014D854D -:10C8F0005E856C858B856BDFDF91CF910F91FF900B -:10C90000EF90DF90CF9008950F93CF93DF93CDB743 -:10C91000DEB7ED85FE85808191810E940DC400E027 -:10C920009C0149855A8568858F8151DFDF91CF91C0 -:10C930000F910895CF93DF9381E09EE00E940D90C8 -:10C9400087EA9CE0892B51F488E89CE00E940D90D6 -:10C9500089E69CE0DF91CF910C940D90C0E0D0E08F -:10C96000CE018254924F0E940D906F97CA3C8EEF79 -:10C97000D807B1F7E9CF4F925F926F927F928F9273 -:10C980009F92AF92BF92CF92DF92EF92FF920F935E -:10C990001F93CF93DF936C01EB0129013A0147010B -:10C9A00058010E94A96083E080931302D092FC108A -:10C9B000C092FB10D093FA10C093F91020E030E041 -:10C9C00048EC52E4C301B201EDD60E94DBF0609363 -:10C9D000F5107093F6108093F7109093F81083D6AB -:10C9E0006B017C0120E030E048EC52E4C501B40169 -:10C9F000D9D6A70196010E9496EF0E94DBF06093C2 -:10CA0000F1107093F2108093F3109093F41020E0E3 -:10CA100030E048EC52E4688179818A819B81C2D6FA -:10CA2000A70196010E9496EF0E94E0F06093121118 -:10CA3000709313118093141190931511DF91CF917E -:10CA40001F910F91FF90EF90DF90CF90BF90AF902C -:10CA50009F908F907F906F905F904F9008951F935D -:10CA6000CF93DF93CEEADBE01B821A8284E193E06E -:10CA7000998388831BAE1CAE1DAE198618861B8653 -:10CA80001A861D8611E01C8782E28E871B8A1A8A0D -:10CA90004EE050E06FEF70E085ED9BE00E94CEF23B -:10CAA0001CA384EE9EEB9A8F898F1B8F1C8E1D8E8C -:10CAB00080E48E8F1F8E86EB9EEB9EAB8DAB85E464 -:10CAC00092E09F838E830E94D05084E193E099830B -:10CAD0008883DF91CF911F9108950F931F93CF9378 -:10CAE000982F862FC42F692F0E946C689091E60BB7 -:10CAF00080911811891738F19091E80B80911711E6 -:10CB0000981708F18091450C811114C008E31CE0CE -:10CB1000CC2319F082E00E949DC8C5E1F801819103 -:10CB20008F0181110CC0C15080E20E945450C1118C -:10CB3000FACF09C010925A0C05E41CE0E9CF0E941C -:10CB400086C8C81B59F7CF911F910F910895AF92D6 -:10CB5000BF92CF92DF92EF92FF920F931F93CF93EA -:10CB6000DF935C017B016A01E9010E94A96083E017 -:10CB700080931302B092FC10A092FB10F092FA1076 -:10CB8000E092F910A601DD0C660B770B4093F510CF -:10CB90005093F6106093F7107093F810CE01DD0FEC -:10CBA000AA0BBB0B841B950BA60BB70B8093F11044 -:10CBB0009093F210A093F310B093F410F7018081DA -:10CBC0009181092E000CAA0BBB0B841B950BA60BA5 -:10CBD000B70B8093121190931311A0931411B0937B -:10CBE00015118EED9BE990934402809343021093BC -:10CBF000FF100093FE101092FD10DF91CF911F9156 -:10CC00000F91FF90EF90DF90CF90BF90AF9008957D -:10CC10004F925F926F927F928F929F92AF92BF924C -:10CC2000CF92DF92EF92FF920F931F93CF93DF93F8 -:10CC30006C01EB0129013A01470158010E94A960EA -:10CC400083E080931302D092FC10C092FB10D0932B -:10CC5000FA10C093F910C301B2010E94DBF0609397 -:10CC6000F5107093F6108093F7109093F8103BD561 -:10CC70006B017C019B01AC01C501B4010E9496EFE0 -:10CC80000E94DBF06093F1107093F2108093F31028 -:10CC90009093F410A7019601688179818A819B8124 -:10CCA0000E9496EF0E94E0F06093121170931311AE -:10CCB00080931411909315118DE19BE99093440298 -:10CCC000809343021092FF101092FE101092FD10FC -:10CCD000DF91CF911F910F91FF90EF90DF90CF9058 -:10CCE000BF90AF909F908F907F906F905F904F908C -:10CCF0000895CF92DF92EF92FF920F931F93CF93FD -:10CD0000DF938C01EB0169017A010E94A96083E045 -:10CD1000809313021093FC100093FB10D093FA1031 -:10CD2000C093F910C701B601DCD42AE037ED43E225 -:10CD30005CE338D50E94DBF06093F5107093F61039 -:10CD40008093F7109093F810CED46B017C019B0177 -:10CD5000AC0160E070E887E794E40E9496EF0E94DF -:10CD6000DBF06093F1107093F2108093F3109093C6 -:10CD7000F410688179818A819B81B3D42AE037EDF0 -:10CD800043E25CE30FD5A70196010E9496EF0E9453 -:10CD9000E0F060931211709313118093141190932B -:10CDA00015118CE796E9909344028093430289EC35 -:10CDB00098EC9093FF108093FE101092FD10DF917D -:10CDC000CF911F910F91FF90EF90DF90CF9008953A -:10CDD0000F931F93CF93DF938B0161E00E946C68E8 -:10CDE0009091E60B80911811891790F19091E80BC2 -:10CDF00080911711981760F1C8010E94449F26E1A5 -:10CE000030E0A901481B590BCA0157FD01969595C1 -:10CE10008795C6E1D9EED80F8D2F8C0F87FD0EC0F8 -:10CE200080E20E945450C150F7CFF80184918823CA -:10CE300041F00E9486C8C81B0F5F1F4F1C16ACF341 -:10CE400007C0CC2329F080E20E945450C150F9CF92 -:10CE5000DF91CF911F910F9108958F929F92AF9282 -:10CE6000BF92CF92DF92EF92FF920F931F93CF93D7 -:10CE7000DF93EC016B016115710519F0FB019183E2 -:10CE800080837E01FFEFEF1AFF0A0881802F90E078 -:10CE90006CD3892B11F0E701F4CF0D3239F47E0108 -:10CEA00082E0E80EF11C098111E008C00B3229F480 -:10CEB0007E0192E0E90EF11C098110E0E701219763 -:10CEC00043E050E068EE71E0CE0160D3892BB9F405 -:10CED000239645E050E063EE71E0CE0157D3892BF5 -:10CEE00009F42596C114D10419F0F601D183C08349 -:10CEF0001111F0C060E070E080E89FE7F4C043E00B -:10CF000050E060EE71E0CE0141D3892B59F4C11499 -:10CF1000D10409F4E4C0F2E0EF0EF11CF601F18255 -:10CF2000E082DDC020E030E0A901C0E0D0E0F70100 -:10CF300060EDA62EA00E89E08A1528F1912F92604F -:10CF4000B92E812F887012FF04C0811123C0219651 -:10CF500021C081112197A5E0B0E0CFD7DC01CB0142 -:10CF6000880F991FAA1FBB1F9C01AD012A0D311DFF -:10CF7000411D511D283989E93807480789E15807BB -:10CF800048F0166006C09EEFA9120AC013FD40C00B -:10CF90001860B12E8FEFE81AF80A00811B2DC7CF59 -:10CFA000802F8F7D8534A1F580818D3211F4106141 -:10CFB00006C08B3221F0319661E070E004C08181BF -:10CFC000329662E070E080538A3018F0E61BF70B6F -:10CFD0001FC060E070E060389CE079075CF4DB0122 -:10CFE000AA0FBB1FAA0FBB1F6A0F7B1F660F771FFD -:10CFF000680F711D3196DF0111978C9180538A3033 -:10D0000050F314FF03C0719561957109C60FD71FC6 -:10D0100011FF08C0C114D10429F0CF010197F60116 -:10D0200091838083CA01B9015CD3212F23702330FF -:10D0300019F04B015C0106C04B015C01B7FAB094DA -:10D04000B7F8B09420E030E0A901C501B40145D3A0 -:10D05000882309F43CC0D7FF06C0D195C195D109FA -:10D060000FEF11E002C007E112E06801F8E1CF1A0A -:10D07000D10890E2E92EF12CCE15DF056CF0F80115 -:10D080002591359145915491C501B4018BD34B0144 -:10D090005C01CE19DF09F0CF04501109F594E79433 -:10D0A0000C151D0549F78A2D880F8B2D881F8F3F82 -:10D0B00041F020E030E0A901C501B4010ED3811197 -:10D0C00006C082E290E090935B1480935A14C501ED -:10D0D000B40109C060E070E080E89FEF04C060E048 -:10D0E00070E080EC9FE7DF91CF911F910F91FF904F -:10D0F000EF90DF90CF90BF90AF909F908F9008956A -:10D100003F924F925F926F927F928F929F92AF92D7 -:10D11000BF92CF92DF92EF92FF920F931F93CF9324 -:10D12000DF935C016B017A016115710519F0FB0158 -:10D1300091838083E114F10429F0C701029783975A -:10D1400008F0E2C0E5012196F5011081812F90E001 -:10D150000CD2892B11F05E01F5CF1D3229F42196F6 -:10D16000F501118101E007C01B3221F4E50122968F -:10D17000F501118100E0E114F10409F1F0E1EF168D -:10D18000F10429F43EC010E3E114F10421F128E098 -:10D19000E216F10401F154F4E2E0EE16F10421F597 -:10D1A000812C912CA12CB0E4BB2E3DC0FAE0EF16EF -:10D1B000F10439F020E1E216F104B1F42FC010338C -:10D1C00011F1FAE0EF2EF12CACEC8A2E982CA82C61 -:10D1D000ACE0BA2E28C078E0E72EF12C812C912CFF -:10D1E000A12CE0E1BE2E1FC060E070E080E090E87E -:10D1F00097010F2C000C440B550B5DD649015A01C9 -:10D2000012C0103359F488818F7D883509F0BBCF67 -:10D2100019812296026080E1E82EF12C812C912C5C -:10D22000A12C68E0B62E40E060E070E0CB01270161 -:10D230000F2C000C66087708FE0150ED352E310EDC -:10D2400029E0231570F42FEB210F2A3118F439EC63 -:10D25000332E06C02FE9210F2A3110F529EA322E8C -:10D26000310E232D30E02E153F05D4F447FD15C0B7 -:10D2700086169706A806B90668F0A30192010CD697 -:10D28000630D711D811D911D61307105810520E8BF -:10D29000920710F04FEF01C041E021961081CCCFF2 -:10D2A000202F2170C114D10471F0442329F021975B -:10D2B000F601D183C08307C001FF19C02297F60190 -:10D2C000D183C08314C047FF12C0222329F060E03D -:10D2D00070E080E090E804C06FEF7FEF8FEF9FE792 -:10D2E00022E230E030935B1420935A1409C02223C9 -:10D2F00081F090958095709561957F4F8F4F9F4FEE -:10D30000462F372F282F12C040E030E020E090E079 -:10D310000DC097FFF5CF82E290E090935B1480936D -:10D320005A146FEF7FEF8FEF9FE7EACF642F732FD1 -:10D33000822FDF91CF911F910F91FF90EF90DF909F -:10D34000CF90BF90AF909F908F907F906F905F90A5 -:10D350004F903F9008953F924F925F926F927F92CD -:10D360008F929F92AF92BF92CF92DF92EF92FF92F5 -:10D370000F931F93CF93DF935C016B017A016115CB -:10D38000710519F0FB0191838083E114F10429F008 -:10D39000C7010297839708F0C6C0E5012196F50101 -:10D3A0001081812F90E0E1D0892B11F05E01F5CF43 -:10D3B0001D3229F42196F501118101E007C01B32CD -:10D3C00021F4E5012296F501118100E0E114F10458 -:10D3D000B1F0F0E1EF16F10429F4AEC010E3E1146E -:10D3E000F10401F12AE0E216F104A9F180E1E81666 -:10D3F000F10471F0E8E0EE16F104F1F413C010331B -:10D4000039F588818F7D883549F719812296026028 -:10D41000F0E1EF2EF12C88248A94982CA82CAFE010 -:10D42000BA2E1FC078E0E72EF12C88248A94982C1D -:10D43000A82CEFE1BE2E15C06FEF7FEFCB01970157 -:10D440000F2C000C440B550B36D549015A0109C06D -:10D450008AE0E82EF12C69E9862E982CA82C69E147 -:10D46000B62E40E060E070E0CB0127010F2C000CED -:10D4700066087708FE0150ED352E310E29E02315A0 -:10D4800070F42FEB210F2A3118F439EC332E06C03B -:10D490002FE9210F2A3128F529EA322E310E232DCA -:10D4A00030E02E153F05ECF44F3FC1F0861697068D -:10D4B000A806B90680F0A3019201EED4232D30E036 -:10D4C00040E050E0620F731F841F951F62177307BF -:10D4D0008407950710F44FEF01C041E021961081B9 -:10D4E000C9CFC114D10451F0442311F0219703C0D6 -:10D4F00001FF04C02297F601D183C08300FF07C05B -:10D5000090958095709561957F4F8F4F9F4F4F3FBE -:10D5100079F482E290E090935B1480935A143FEF89 -:10D520002FEF9FEF0DC040E030E020E090E008C01A -:10D53000462F372F282F04C0103309F069CF61CF51 -:10D54000642F732F822FDF91CF911F910F91FF9046 -:10D55000EF90DF90CF90BF90AF909F908F907F9093 -:10D560006F905F904F903F90089591117BC38032F0 -:10D5700019F089508550D0F70895FC0105900020DE -:10D58000E9F7809590958E0F9F1F0895FB01DC01B0 -:10D590004150504088F08D9181341CF08B350CF453 -:10D5A000805E659161341CF06B350CF4605E861B07 -:10D5B000611171F3990B0895881BFCCFFB01DC010D -:10D5C0004150504048F005900D920020C9F701C02D -:10D5D0001D9241505040E0F70895FB0155915523AD -:10D5E000A9F0BF01DC014D9145174111E1F759F454 -:10D5F000CD010590002049F04D9140154111C9F32E -:10D60000FB014111EFCF81E090E0019708950F9366 -:10D610001F93CF93DF93CDB7DEB72E970FB6F89455 -:10D62000DEBF0FBECDBF0E891F898EE08C831A83AB -:10D6300009838FEF9FE79E838D83AE01465E5F4F28 -:10D64000688D798DCE01019610D1EF81F885E00FBC -:10D65000F11F10822E960FB6F894DEBF0FBECDBF1D -:10D66000DF91CF911F910F9108950F931F93CF9347 -:10D67000DF93CDB7DEB72E970FB6F894DEBF0FBE9F -:10D68000CDBF8C01FA018EE08C831A83098377FF6A -:10D6900002C060E070E8CB0101979E838D83A901F1 -:10D6A000BF01CE010196E1D04D815E8157FD0AC0D8 -:10D6B0002F813885421753070CF49A01F801E20FC5 -:10D6C000F31F10822E960FB6F894DEBF0FBECDBFAB -:10D6D000DF91CF911F910F91089540D008F481E020 -:10D6E0000895E89409C097FB3EF490958095709555 -:10D6F00061957F4F8F4F9F4F9923A9F0F92F96E99E -:10D70000BB279395F695879577956795B795F11112 -:10D71000F8CFFAF4BB0F11F460FF1BC06F5F7F4FAF -:10D720008F4F9F4F16C0882311F096E911C07723C1 -:10D7300021F09EE8872F762F05C0662371F096E8CA -:10D74000862F70E060E02AF09A95660F771F881F99 -:10D75000DAF7880F9695879597F90895990F00083D -:10D76000550FAA0BE0E8FEEF16161706E807F907B3 -:10D77000C0F012161306E407F50798F0621B730B4E -:10D78000840B950B39F40A2661F0232B242B252BCF -:10D7900021F408950A2609F4A140A6958FEF811D72 -:10D7A000811D08950BD028C319D328F01ED318F07B -:10D7B000952309F00AC30FC3112452C32ED3A0F33B -:10D7C000959FD1F3950F50E0551F629FF001729F16 -:10D7D000BB27F00DB11D639FAA27F00DB11DAA1F35 -:10D7E000649F6627B00DA11D661F829F2227B00D82 -:10D7F000A11D621F739FB00DA11D621F839FA00D0D -:10D80000611D221F749F3327A00D611D231F849F5C -:10D81000600D211D822F762F6A2F11249F575040B3 -:10D820008AF0E1F088234AF0EE0FFF1FBB1F661F4E -:10D83000771F881F91505040A9F79E3F510570F007 -:10D84000C4C20EC35F3FECF3983EDCF38695779538 -:10D850006795B795F795E7959F5FC1F7FE2B880F02 -:10D86000911D9695879597F908952F923F924F9223 -:10D870005F926F927F928F929F92AF92BF92CF9260 -:10D88000DF92EF92FF920F931F93CF93DF93CDB769 -:10D89000DEB72B970FB6F894DEBF0FBECDBF6C017D -:10D8A0007B018A01FC0117821682838181FFBFC13F -:10D8B000CE0101963C01F6019381F70193FD85911C -:10D8C00093FF81917F01882309F4ADC1853239F43A -:10D8D00093FD859193FF81917F01853221F4B601FB -:10D8E00090E0D9D1E8CF912C212C312CFFE1F31518 -:10D8F000D8F08B3279F038F4803279F08332A1F4A9 -:10D90000232D20611DC08D3261F0803369F4232DF9 -:10D91000216016C0832D8260382EE32DE4603E2EF8 -:10D920002AC0F32DF8601DC037FC2DC020ED280F54 -:10D930002A3040F08E32B9F436FC75C1232D2064B4 -:10D94000322E19C036FE06C08AE0989E200D1124A2 -:10D95000922E11C0EAE02E9E200D1124222EF32DCE -:10D96000F0623F2E08C08C3621F4832D8068382E5B -:10D9700002C0883641F4F70193FD859193FF8191B0 -:10D980007F018111B3CF982F9F7D9554933028F458 -:10D990000C5F1F4F9FE399830DC0833631F08337AF -:10D9A00071F0833509F055C020C0F801808189836A -:10D9B0000E5F1F4F88248394912C530112C02801BD -:10D9C000F2E04F0E511CF801A080B18036FE03C07A -:10D9D000692D70E002C06FEF7FEFC50151D14C019E -:10D9E0008201F32DFF773F2E15C0280122E0420E61 -:10D9F000511CF801A080B18036FE03C0692D70E093 -:10DA000002C06FEF7FEFC50130D14C01F32DF068FC -:10DA10003F2E820133FC19C0822D90E088169906B2 -:10DA2000A0F4B60180E290E036D12A94F5CFF5015A -:10DA300037FC859137FE81915F01B60190E02BD1D3 -:10DA400021102A9421E0821A91088114910479F717 -:10DA5000E1C0843611F0893639F5F80137FE07C088 -:10DA600060817181828193810C5F1F4F08C060814A -:10DA70007181072E000C880B990B0E5F1F4FF32D41 -:10DA8000FF763F2E97FF09C0909580957095619520 -:10DA90007F4F8F4F9F4FF0683F2E2AE030E0A30169 -:10DAA00036D1882E861844C0853731F4232D2F7E39 -:10DAB000B22E2AE030E025C0932D997FB92E8F3603 -:10DAC000C1F018F4883579F0AEC0803719F0883786 -:10DAD00021F0A9C0E92FE061BE2EB4FE0DC0FB2DE0 -:10DAE000F460BF2E09C034FE0AC0292F2660B22E72 -:10DAF00006C028E030E005C020E130E002C020E1AF -:10DB000032E0F801B7FE07C06081718182819381A4 -:10DB10000C5F1F4F06C06081718180E090E00E5F56 -:10DB20001F4FA301F4D0882E8618FB2DFF773F2EC0 -:10DB300036FE0DC0232D2E7FA22E891458F434FEFC -:10DB40000BC032FC09C0832D8E7EA82E05C0B82CD8 -:10DB5000A32C03C0B82C01C0B92CA4FE0FC0FE0139 -:10DB6000E80DF11D8081803321F49A2D997EA92E34 -:10DB700009C0A2FE06C0B394B39404C08A2D86786F -:10DB800009F0B394A3FC10C0A0FE06C0B21480F448 -:10DB9000280C922C9B180DC0B21458F4B60180E2E8 -:10DBA00090E079D0B394F8CFB21418F42B1802C0D7 -:10DBB000982C212CA4FE0FC0B60180E390E06BD01E -:10DBC000A2FE16C0A1FC03C088E790E002C088E571 -:10DBD00090E0B6010CC08A2D867851F0A1FE02C0FB -:10DBE0008BE201C080E2A7FC8DE2B60190E053D049 -:10DBF000891430F4B60180E390E04DD09A94F8CFC8 -:10DC00008A94F301E80DF11D8081B60190E043D0C4 -:10DC10008110F6CF222009F44ECEB60180E290E0CA -:10DC20003AD02A94F7CFF6018681978102C08FEF10 -:10DC30009FEF2B960FB6F894DEBF0FBECDBFDF91DE -:10DC4000CF911F910F91FF90EF90DF90CF90BF90F9 -:10DC5000AF909F908F907F906F905F904F903F908C -:10DC60002F900895992788270895FC010590615009 -:10DC700070400110D8F7809590958E0F9F1F0895E2 -:10DC8000FC016150704001900110D8F7809590958B -:10DC90008E0F9F1F08950F931F93CF93DF93FB0168 -:10DCA000238121FD03C08FEF9FEF2CC022FF16C000 -:10DCB00046815781248135814217530744F4A0815E -:10DCC000B1819D012F5F3F4F318320838C9326814B -:10DCD00037812F5F3F4F3783268314C08B01EC01C0 -:10DCE000FB010084F185E02D1995892BE1F6D8011F -:10DCF00016968D919C911797019617969C938E93EB -:10DD00001697CE01DF91CF911F910F910895FA01DF -:10DD1000AA27283051F1203181F1E8946F936E7F6A -:10DD20006E5F7F4F8F4F9F4FAF4FB1E03ED0B4E05B -:10DD30003CD0670F781F891F9A1FA11D680F791F9C -:10DD40008A1F911DA11D6A0F711D811D911DA11DAD -:10DD500020D009F468943F912AE0269F11243019BD -:10DD6000305D3193DEF6CF010895462F4770405D58 -:10DD70004193B3E00FD0C9F7F6CF462F4F70405D07 -:10DD80004A3318F0495D31FD4052419302D0A9F762 -:10DD9000EACFB4E0A6959795879577956795BA955C -:10DDA000C9F700976105710508959B01AC010A2E22 -:10DDB00006945795479537952795BA95C9F7620FF9 -:10DDC000731F841F951FA01D089597F99F6780E812 -:10DDD00070E060E008959FEF80EC089500240A94BD -:10DDE0001616170618060906089500240A94121636 -:10DDF0001306140605060895092E0394000C11F469 -:10DE0000882352F0BB0F40F4BF2B11F460FF04C015 -:10DE10006F5F7F4F8F4F9F4F089557FD9058440F6E -:10DE2000551F59F05F3F71F04795880F97FB991F79 -:10DE300061F09F3F79F08795089512161306140636 -:10DE4000551FF2CF4695F1DF08C0161617061806C3 -:10DE5000991FF1CF86957105610508940895E8949E -:10DE6000BB2766277727CB0197F90895F999FECF4D -:10DE700092BD81BDF89A992780B50895262FF9990A -:10DE8000FECF1FBA92BD81BD20BD0FB6F894FA9A9D -:10DE9000F99A0FBE01960895DB018F939F932DD0C1 -:10DEA000BF91AF91A29F800D911DA39F900DB29F36 -:10DEB000900D11240895A1E21A2EAA1BBB1BFD018F -:10DEC0000DC0AA1FBB1FEE1FFF1FA217B307E40759 -:10DED000F50720F0A21BB30BE40BF50B661F771FB1 -:10DEE000881F991F1A9469F7609570958095909591 -:10DEF0009B01AC01BD01CF01089509D0A59F900DF4 -:10DF0000B49F900DA49F800D911D11240895A29F90 -:10DF1000B001B39FC001A39F700D811D1124911DFD -:10DF2000B29F700D811D1124911D08955058BB277B -:10DF3000AA270ED061CF52DF30F057DF20F031F446 -:10DF40009F3F11F41EF447CF0EF4E095E7FB3DCF61 -:10DF5000E92F63DF80F3BA17620773078407950719 -:10DF600018F071F49EF57BCF0EF4E0950B2EBA2FCE -:10DF7000A02D0B01B90190010C01CA01A0011124CF -:10DF8000FF27591B99F0593F50F4503E68F11A167B -:10DF9000F040A22F232F342F4427585FF3CF46950C -:10DFA00037952795A795F0405395C9F77EF41F162E -:10DFB000BA0B620B730B840BBAF09150A1F0FF0FF8 -:10DFC000BB1F661F771F881FC2F70EC0BA0F621FE4 -:10DFD000731F841F48F4879577956795B795F795D4 -:10DFE0009E3F08F0B3CF9395880F08F09927EE0F66 -:10DFF000979587950895F2DE58F080E891E009F44E -:10E000009EEFF3DE28F040E851E059F45EEF09C0DE -:10E01000E2CE25CFE92FE07800DF68F3092E052A4C -:10E02000C1F3261737074807590738F00E2E07F8AF -:10E03000E02569F0E025E0640AC0EF6307F800948A -:10E0400007FADB01B9019D01DC01CA01AD01EF93C3 -:10E0500059D0D2DE0AD05F91552331F02BED3FE04D -:10E0600049E450FD49EC63CF0895DF93DD27B92FD4 -:10E07000BF7740E85FE31616170648075B0710F402 -:10E08000D92F7FD19F938F937F936F93F9D1E4E939 -:10E09000F1E0FED0B1DE2F913F914F915F918EDB89 -:10E0A000DD2349F09058A2EA2AED3FE049EC5FE316 -:10E0B000D0785D274DDFDF919FCE48D180F09F372C -:10E0C00040F491110EF4CCCE60E070E080E89FE364 -:10E0D000089526F01B16611D711D811DB0C0CAC0B8 -:10E0E000FDD0E39522C10CD087CE7FDE40F076DEF6 -:10E0F00030F021F45F3F19F068CE5111B1CE6BCEF4 -:10E100008CDE98F39923C9F35523B1F3951B550B76 -:10E11000BB27AA2762177307840738F09F5F5F4FFA -:10E12000220F331F441FAA1FA9F333D00E2E3AF03B -:10E13000E0E830D091505040E695001CCAF729D055 -:10E14000FE2F27D0660F771F881FBB1F26173707A4 -:10E150004807AB07B0E809F0BB0B802DBF01FF27D4 -:10E1600093585F4F2AF09E3F510568F02ECE78CE2F -:10E170005F3FECF3983EDCF3869577956795B7950E -:10E18000F7959F5FC9F7880F911D9695879597F929 -:10E190000895E1E0660F771F881FBB1F62177307A2 -:10E1A0008407BA0720F0621B730B840BBA0BEE1FB7 -:10E1B00088F7E095089504D06894B11151CE089580 -:10E1C00034DE88F09F5790F0B92F9927B751A0F00F -:10E1D000D1F0660F771F881F991F1AF0BA95C9F7FB -:10E1E00012C0B13081F03BDEB1E0089538CE672F28 -:10E1F000782F8827B85F39F0B93FCCF386957795AB -:10E200006795B395D9F73EF4909580957095619593 -:10E210007F4F8F4F9F4F089599D080F09F3740F4E4 -:10E2200091110EF01DCE60E070E080E89FEB089544 -:10E2300026F41B16611D711D811D01C01BC08823A2 -:10E2400071F4772321F09850872B762F07C066232F -:10E2500011F499270DC09051862B70E060E02AF0F0 -:10E260009A95660F771F881FDAF7880F969587951E -:10E2700097F908959F3F31F0915020F48795779555 -:10E280006795B795880F911D9695879597F908958D -:10E29000DF93CF931F930F93FF92EF92DF927B0157 -:10E2A0008C01689405C0DA2EEF0188DAFE01E8944B -:10E2B000A5912591359145915591AEF3EF0148DE39 -:10E2C000FE019701A801DA9479F7DF90EF90FF90B3 -:10E2D0000F911F91CF91DF9108957DCDA6DDE8F3D9 -:10E2E000E894E0E0BB279F57F0F02AED3FE049ECCF -:10E2F00006C0EE0FBB0F661F771F881F28F0B23ACB -:10E3000062077307840728F0B25A620B730B840B01 -:10E31000E3959A9572F7803830F49A95BB0F661F93 -:10E32000771F881FD2F79048A7CFEF93E0FF06C072 -:10E33000A2EA2AED3FE049EC5FEB0ADE5DDD0F90DB -:10E34000039401FC9058E1ECF1E0A4C06EDDA0F074 -:10E35000BEE7B91788F4BB279F3860F41616B11DC5 -:10E36000672F782F8827985FF7CF869577956795E1 -:10E37000B11D93959639C8F30895F0D908F48FEF3D -:10E3800008959B01AC0160E070E080E89FE3ABCEB4 -:10E390004CDD58F19E5758F19851A0F0E9F09830B3 -:10E3A00020F5092E9927660F771F881F991F0A9459 -:10E3B000D1F712C0062E672F782F8827985F11F4A7 -:10E3C000000C07C0993FB4F38695779567959395B0 -:10E3D000D9F7611D711D811D3EF490958095709552 -:10E3E00061957F4F8F4F9F4F0895689439CD37CDFA -:10E3F0009F9374DF0F9007FCEE5F97CF11F40EF43C -:10E40000EACC38CF12DDD0F39923D9F3CEF39F575E -:10E41000550B87FF38D00024A0E640EA90018058D1 -:10E420005695979528F4805C660F771F881F20F01B -:10E4300026173707480730F4621B730B840B20291B -:10E4400031294A2BA69517940794202531254A2770 -:10E4500058F7660F771F881F20F0261737074807E1 -:10E4600030F4620B730B840B200D311D411DA09500 -:10E4700081F7B901842F9158880F96958795089553 -:10E480009B01AC018FC991505040660F771F881FC8 -:10E49000D2F708959F938F937F936F93FF93EF939A -:10E4A0009B01AC017FD9EF91FF91F2DE2F913F915B -:10E4B0004F915F9177C9AA1BBB1B51E107C0AA1FEF -:10E4C000BB1FA617B70710F0A61BB70B881F991F15 -:10E4D0005A95A9F780959095BC01CD01089597FBB9 -:10E4E000072E16F4009406D077FD08D0E4DF07FC71 -:10E4F00005D03EF4909581959F4F08957095619554 -:10E500007F4F0895052E97FB16F400940FD057FD0A -:10E5100005D0D1DC07FC02D046F408C050954095E8 -:10E52000309521953F4F4F4F5F4F089590958095BF -:10E53000709561957F4F8F4F9F4F0895EE0FFF1F8E -:10E54000881F8BBF0790F691E02D1994B7FFD5CCAB -:10E55000D4DC821B930B089581E090E0F894B4C062 -:10E560009111089581548A5108F4805E855A089566 -:10E57000FB01DC0104C08D910190801921F4415010 -:10E580005040C8F7881B990B0895FB01DC0102C0BD -:10E5900001900D9241505040D8F70895DC0101C020 -:10E5A0006D9341505040E0F70895FB01DC018D91DF -:10E5B00081341CF08B350CF4805E619161341CF069 -:10E5C0006B350CF4605E861B611189F3990B08951D -:10E5D000FB01DC010D900020E9F7119701900D92ED -:10E5E0000020E1F70895FC018191861721F088232E -:10E5F000D9F7992708953197CF010895FB01DC01E0 -:10E600008D91019080190110D9F3990B0895FB01A8 -:10E61000DC0101900D920020E1F70895FB01DC017F -:10E620004150504030F08D910190801919F4002034 -:10E63000B9F7881B990B0895FB01DC01415050404C -:10E6400048F001900D920020C9F701C01D92415081 -:10E650005040E0F70895FC0181E090E0019006163B -:10E6600009F4CF010020D1F7019708950F931F936C -:10E67000CF93DF93CDB7DEB72E970FB6F894DEBFFA -:10E680000FBECDBF0E891F8986E08C831A83098354 -:10E690008FEF9FE79E838D83AE01465E5F4F688D4F -:10E6A000798DCE010196E1D8EF81F885E00FF11F59 -:10E6B00010822E960FB6F894DEBF0FBECDBFDF914D -:10E6C000CF911F910F91089518E1CDEAD8E100E0B4 -:10E6D00005C0802FFE0132DF2196011DCE3AD10701 -:0AE6E00080E00807B1F7F894FFCFBF -:10E6EA00FF3FFF3FFF3F01CDCCCC3D00007A430006 -:10E6FA00005243030000803FAA00FFFFFFFFFF0014 -:10E70A0000C84102C0D40100FF01FF0601000096C3 -:10E71A0043000096430000C8430101104000000076 -:10E72A00801B115C6190C53B020ABF6400640058FB -:10E73A00595A4587878787871010101010000000E4 -:10E74A0000372F00000000EBD88CBE202F1F2F00AF -:10E75A0000000076388CBE202F1F2F00004040009A -:10E76A000034420000000000000000000000000029 -:10E77A0000504100000000000000416400000064F5 -:10E78A0000000003000000640000006400000003B1 -:10E79A000000001E0000001E0000001E0000001EF7 -:10E7AA000000001E000000DC050000DC050000324D -:10E7BA00000000DC0500000000A0420000A04200AA -:10E7CA0000C8430000BA4200009643000096430086 -:10E7DA0000A0400000C8415635350000803B450086 -:10E7EA00803B4500007043000070420405030001AD -:10E7FA00000000008FA68CBE202F1F2F64697300B3 -:10E80A004D313038004D313132004D343130003124 -:10E81A002E312E3900687474703A2F2F6572796F11 -:10E82A006E652E636F6D00726573756D65203300BA -:10E83A00726573756D652030004D33322053256C37 -:10E84A007520212573002F007361766533004552C8 -:10E85A0052006F70656E005452494747455245440D -:10E86A0000626564005A0059005800736176652099 -:04E87A006F6B0000C0 -:00000001FF diff --git a/hex/Marlin_BLTOUCH20190505.hex b/hex/Marlin_BLTOUCH20190505.hex deleted file mode 100644 index 56beb8a488..0000000000 --- a/hex/Marlin_BLTOUCH20190505.hex +++ /dev/null @@ -1,8731 +0,0 @@ -:100000000C94391A0C946A1A0C946A1A0C946A1A91 -:100010000C946A1A0C946A1A0C946A1A0C946A1A50 -:100020000C946A1A0C946A1A0C946A1A0C946A1A40 -:100030000C946A1A0C946A1A0C946A1A0C946A1A30 -:100040000C946A1A0C94734F0C946A1A0C946A1AE2 -:100050000C946A1A0C946A1A0C94AF750C94E3ED24 -:100060000C946A1A0C942C3F0C946A1A0C946A1A19 -:100070000C946A1A0C946A1A0C946A1A0C946A1AF0 -:100080000C94B7570C946A1A0C946A1A0C946A1A56 -:100090000C946A1A0C946A1A0C946A1A0C946A1AD0 -:1000A0000C946A1A0C946A1A0C9489570C946A1A64 -:1000B0000C946A1A0C946A1A0C946A1A0C945B5782 -:1000C0000C946A1A0C946A1A0C946A1A0C946A1AA0 -:1000D0000C946A1A0C946A1A0C946A1A0C946A1A90 -:1000E0000C946A1ADAE9DDE9CCE9D0E9D6E914EA38 -:1000F000E1E9E5E9EBE9EFE9F3E9F9E9FDE901EA2D -:1001000014EA07EA0BEA0FEAFFEC04ED09ED13ED40 -:100110001DED96ED27ED2FED37ED41ED4BED55ED56 -:1001200064ED6EED96ED78ED82ED8CED49F091EE9B -:10013000CAEE85F0CAEECAEECAEECAEECAEECAEE42 -:10014000CAEECAEECAEECAEECAEECAEECAEECAEEEF -:10015000CAEECAEECAEECAEECAEECAEECAEECAEEDF -:10016000CAEECAEECAEECAEE7FF0CAEECAEECAEE18 -:10017000CAEECAEECAEECAEECAEE58F0CAEECAEE2F -:10018000CAEECAEECAEECAEECAEECAEECAEECAEEAF -:100190009CF0C7EE084AD73B3BCE016E84BCBFFD46 -:1001A000C12F3D6C74319ABD56833DDA3D00C77F47 -:1001B00011BED9E4BB4C3E916BAAAABE00000080E0 -:1001C0003F05A84CCDB2D44EB93836A9020C50B96F -:1001D000918688083CA6AAAA2ABE000000803F009B -:1001E0000D9496024E414E494E495459494E46CDC2 -:1001F000CCCC3D0AD7233C17B7D13877CC2B3295DE -:1002000095E6241FB14F0A000020410000C84200BB -:10021000401C4620BCBE4CCA1B0E5AAEC59D744342 -:100220004F4D4D554E49434154494F4E004452594C -:1002300052554E004552524F525300494E464F00C0 -:100240004543484F0047322F473320626164207096 -:100250006172616D65746572730A00536C656570D7 -:100260002E2E2E00205A3A200020593A20004265B6 -:100270006420583A20004D65736820706F696E7471 -:100280002063616E6E6F74206265207265736F6C9F -:100290007665640A00436C69636B20746F20726535 -:1002A00073756D652E2E2E004E6F206D6F76652E48 -:1002B00000456E642066696C65206C6973740A0081 -:1002C000426567696E2066696C65206C6973740AA3 -:1002D00000286E6F2066696C652900534420707297 -:1002E000696E74696E67206279746520004E6F7460 -:1002F000205344207072696E74696E670A004375FA -:100300007272656E742066696C653A2000256973A7 -:100310000025696D20256973002569682025696DB0 -:100320002025697300256964202569682025696D89 -:10033000202569730025697920256964202569686D -:100340002025696D20256973005072696E742074D0 -:10035000696D653A200040023B0234022D021F0203 -:100360006F66660044454255473A004B494C4C4540 -:10037000442E20004D3131332053006F6B00334445 -:10038000205072696E746572204F66662E00544864 -:1003900045524D414C5F50524F54454354494F4E86 -:1003A000004155544F5245504F52545F53445F5390 -:1003B000544154555300454D455247454E43595FAE -:1003C00050415253455200434153455F4C494748C1 -:1003D000545F4252494748544E45535300544F4787 -:1003E000474C455F4C494748545300534F46545778 -:1003F0004152455F504F574552004255494C445F6A -:1004000050455243454E54004C4556454C494E4785 -:100410005F44415441005A5F50524F42450041559C -:10042000544F4C4556454C005052494E545F4A4F2C -:10043000420050524F4752455353004155544F527A -:1004400045504F52545F54454D5000564F4C554DFA -:10045000455452494300454550524F4D0053455273 -:1004600049414C5F584F4E5F584F464600464952EF -:100470004D574152455F4E414D453A4D61726C6951 -:100480006E20312E312E3920284769746875622913 -:1004900020534F555243455F434F44455F55524C9F -:1004A0003A68747470733A2F2F6769746875622E96 -:1004B000636F6D2F4D61726C696E4669726D776105 -:1004C00072652F4D61726C696E2050524F544F43CC -:1004D0004F4C5F56455253494F4E3A312E30204DC6 -:1004E000414348494E455F545950453A33442050A2 -:1004F00072696E7465722045585452554445525F76 -:10050000434F554E543A3120555549443A6365643A -:1005100065326132662D343161322D343734382DF5 -:10052000396231322D63353563363266333637669C -:10053000660A002F2F20007A5F6D696E3A200079DD -:100540005F6D696E3A2000785F6D696E3A200052E7 -:1005500065706F7274696E6720656E6473746F7016 -:10056000207374617475730A004D31343520533C27 -:10057000696E6465783E206F7574206F66207261C5 -:100580006E67652028302D31290A00205400205242 -:1005900000416363656C65726174696F6E3A2050E7 -:1005A0000020466C6F773A2000000125301D0CFFBB -:1005B0002829FF24311C0BFF4527FF232F1B1EFF7B -:1005C0004443FFFFFF0403080602FF222B1A4142A7 -:1005D000FF033809FF36206F7574206F6620726143 -:1005E0006E67650A00536572766F20003A2000201E -:1005F000536572766F200043290A0061626C65645E -:1006000020286D696E2074656D702000436F6C64E6 -:1006100020657874727564657320617265200020AE -:10062000643A0020693A0020703A004E6F206361FE -:100630007365206C696768740A00454550524F4DD8 -:10064000204F4B0A003F5A206F7574206F6620724E -:10065000616E676520282D323020746F203230297A -:100660000A003A200050726F6265205A204F666679 -:10067000736574004163746976652045787472759A -:100680006465723A2000496E76616C696420657811 -:100690007472756465720A00656E71756575656959 -:1006A0006E672022004B494C4C45442E2000535489 -:1006B0004F505045442E20005072696E7465722070 -:1006C00073746F707065642064756520746F206545 -:1006D00072726F72732E2046697820746865206587 -:1006E00072726F7220616E6420757365204D3939A6 -:1006F0003920746F20726573746172742E202854CF -:10070000656D7065726174757265206973207265BC -:100710007365742E20536574206974206166746556 -:10072000722072657374617274696E67290A004E73 -:100730006F20436865636B73756D207769746820FB -:100740006C696E65206E756D6265722C204C6173EC -:1007500074204C696E653A20004E6F2043686563D3 -:100760006B73756D2077697468206C696E65206E97 -:10077000756D6265722C204C617374204C696E65D6 -:100780003A2000636865636B73756D206D69736DE6 -:10079000617463682C204C617374204C696E653AF7 -:1007A00020004C696E65204E756D6265722069731C -:1007B000206E6F74204C617374204C696E65204EFE -:1007C000756D6265722B312C204C617374204C69FD -:1007D0006E653A20004D313130004D3331004732E3 -:1007E000382058004D323100534420726561642036 -:1007F0006572726F720A00446F6E65207072696E66 -:1008000074696E672066696C650A0020496E7661BE -:100810006C696420657874727564657220000000EC -:1008200000000000000000000000000096430000EF -:1008300096430000C84353544F505045442E200067 -:100840005072696E7465722073746F707065642085 -:1008500064756520746F206572726F72732E204606 -:10086000697820746865206572726F7220616E64A9 -:1008700020757365204D39393920746F2072657386 -:10088000746172742E202854656D70657261747580 -:1008900072652069732072657365742E20536574C8 -:1008A0002069742061667465722072657374617268 -:1008B00074696E67290A0053544F502063616C6C51 -:1008C00065642062656361757365206F6620424CC4 -:1008D000546F756368206572726F72202D20726587 -:1008E00073746172742077697468204D3939390ADC -:1008F0000042696C696E656172204C6576656C6951 -:100900006E6720477269643A0A00486F6D696E67C6 -:10091000206661696C65640020746F6F206C6F6E77 -:100920006720657874727573696F6E207072657672 -:10093000656E7465640A0020636F6C64206578746A -:10094000727573696F6E2070726576656E7465641A -:100950000A0024F4D43050C38E20C2A24017828BE8 -:100960007011127A910D816CD90AA861E108C758FB -:100970006607615143061E4B5D05C145A7041A4138 -:100980001104093D9803713931034036DB026533A8 -:100990009102D4305402802E1D02632CEE01752A80 -:1009A000C501B028A001102781018F2564012B24E7 -:1009B0004B01E0223401AC211F018D200D01801F6D -:1009C000FC00841EED00971DDF00B81CD200E61B62 -:1009D000C600201BBC00641AB200B219A8000A1994 -:1009E000A0006A189900D117910040178B00B51626 -:1009F000840031167E00B31579003A157300C714D0 -:100A00006F0058146A00EE13660088136300251304 -:100A10005E00C7125B006C12570015125400C11122 -:100A2000510070114F0021114B00D61049008D105C -:100A300047004610440002104200C00F4000800FE3 -:100A40003E00420F3C00060F3B00CB0E3800930ED9 -:100A500037005C0E3500270E3400F30D3200C10D57 -:100A60003100900D3000600D2E00320D2D00050D6F -:100A70002C00D90C2B00AE0C2900850C29005C0C35 -:100A80002700350C27000E0C2600E80B2400C40BB1 -:100A90002400A00B23007D0B23005A0B2100390BEF -:100AA0002100180B2000F80A1F00D90A1E00BB0AFB -:100AB0001E009D0A1D00800A1D00630A1C00470AD3 -:100AC0001B002C0A1B00110A1A00F7091A00DD0985 -:100AD0001900C4091900AB091900920917007B0914 -:100AE0001800630917004C09160036091600200982 -:100AF00016000A091500F5081500E0081400CC08D6 -:100B00001400B8081400A4081400900813007D080D -:100B100012006B081300580812004608120034082F -:100B20001100230811001208110001081100F0073C -:100B30001000E0071000D0071000C0071000B00739 -:100B40000F00A107100091070E0083070F00740724 -:100B50000F0065070E0057070E0049070E003B0700 -:100B60000D002E070E0020070D0013070D000607CD -:100B70000D00F9060C00ED060D00E0060C00D40691 -:100B80000C00C8060C00BC060C00B0060C00A40645 -:100B90000B0099060C008D060B0082060B007706F1 -:100BA0000B006C060B0061060A0057060B004C0692 -:100BB0000A0042060A0038060A002E060A00240629 -:100BC0000A001A060A001006090007060A00FD05B9 -:100BD0000900F4050900EB050900E2050900D90543 -:100BE0000900D0050900C7050900BE050900B505C3 -:100BF0000800AD050800A50509009C05080094053E -:100C000008008C050800840508007C0508007405B0 -:100C100008006C050700650508005D05070056051E -:100C200008004E0507004705070040050800380585 -:100C30000700310507002A050700230507001C05EA -:100C40000600160507000F05070008050600020547 -:100C50000700FB040600F5040700EE040600E804A4 -:100C60000600E2040700DB040600D5040600CF04FA -:100C70000600C9040600C3040600BD040600B7044C -:100C80000600B1040500AC040600A6040600A0049A -:100C900005009B04060095040500900406008A04E4 -:100CA000050085040500800406007A04050075042B -:100CB0000500700405006B0405006604050061046E -:100CC00005005C04050057040500520405004D04AE -:100CD000050048040500430405003E0404003A04EE -:100CE000050035040500300404002C040500270429 -:100CF0000400230405001E0404001A040400160462 -:100D00000500110404000D04040009040500040496 -:100D1000040000040400FC030400F8030400F403CE -:100D20000400F0030400EC030400E8030400E403FF -:100D30000400E0030400DC030400D8030400D4032F -:100D40000400D0030400CC030400C8030300C5035F -:100D5000030024F404D9201BC40C5C0E9804C409BD -:100D60005F0265077101F405F900FB04B300480454 -:100D70008700C10369005803550003034500BE0204 -:100D80003A008402310053022A002902250004029D -:100D90002000E4011C00C8011900AF0117009801F0 -:100DA0001400840113007101100061011000510151 -:100DB0000E0043010D0036010B002B010B0020013A -:100DC0000B00150109000C01090003010800FB00DC -:100DD0000800F3000800EB000700E4000600DE0056 -:100DE0000600D8000600D2000600CC000500C700AF -:100DF0000500C2000500BD000400B9000400B500F4 -:100E00000400B1000400AD000400A9000400A50026 -:100E10000300A20003009F0004009B000300980051 -:100E200003009500020093000300900003008D0072 -:100E300002008B000300880002008600020084008C -:100E40000300810002007F0002007D0002007B00A1 -:100E500002007900020077000100760002007400B1 -:100E6000020072000100710002006F0002006D00BC -:100E700001006C0002006A000100690002006700C6 -:100E800001006600010065000100640002006200CC -:100E9000010061000100600001005F0002005D00D0 -:100EA00001005C0001005B0001005A0001005900D4 -:100EB00001005800010057000100560001005500D4 -:100EC00001005400010053000000530001005200D3 -:100ED000010051000100500001004F0001004E00D0 -:100EE00000004E0001004D0001004C0001004B00CD -:100EF00000004B0001004A000100490001004800C9 -:100F000000004800010047000100460000004600C4 -:100F100001004500000045000100440001004300BD -:100F200000004300010042000000420001004100B7 -:100F3000000041000100400001003F0000003F00B0 -:100F400001003E0000003E0001003D0000003D00A9 -:100F500001003C0000003C0000003C0001003B00A0 -:100F600000003B0001003A0000003A000100390097 -:100F7000000039000100380000003800000038008F -:100F80000100370000003700010036000000360085 -:100F9000000036000100350000003500000035007B -:100FA0000100340000003400000034000100330070 -:100FB0000000330000003300010032000000320066 -:100FC000000032000100310000003100000031005B -:100FD00001003000000030000000300001002F0050 -:100FE00000002F0000002F0000002F0001002E0045 -:100FF00000002E0000002E0001002D0000002D003A -:1010000000002D0000002D0001002C0000002C002D -:1010100000002C0000002C0001002B0000002B0021 -:1010200000002B0000002B0001002A0000002A0015 -:1010300000002A0000002A00010029000000290009 -:1010400000002900000029000000290001002800FC -:1010500000002800000028000000280000002800F0 -:1010600001002700000027000000270000002700E3 -:1010700000002700010026000000260000002600D6 -:1010800000002600000026000100250000002500C9 -:1010900000002500000025000000250000002500BC -:1010A00001002400000024000000240000002400AF -:1010B00000002400010023000000230000002300A2 -:1010C0000000230000002300000023000000230094 -:1010D0000100220000002200000022000000220087 -:1010E0000000220000002200010021000000210079 -:1010F000000021000000210000002100000021006C -:10110000000021000100200000002000000020005D -:10111000000020000000200000002000000020004F -:101120000000200001001F0000001F0000001F0041 -:1011300000001F0000001F0000001F0000001F0033 -:1011400001001E0000001E0000001E0000001E0026 -:101150000000043700001E290000511B0000581039 -:10116000000010090000CC040000780200004101DA -:10117000000057726974696E6720746F2066696C2D -:10118000653A20006F70656E206661696C65642C3D -:101190002046696C653A20006F70656E2066616953 -:1011A0006C65642C2046696C653A200046696C6564 -:1011B0002073656C65637465640A002053697A6501 -:1011C0003A200046696C65206F70656E65643A2050 -:1011D000002066696C653A2000646F696E6700667E -:1011E00072657368004E6F772000454E442053555A -:1011F00042524F5554494E450A002220706F7300E9 -:101200002220706172656E743A2200535542524F2B -:101210005554494E452043414C4C207461726765DA -:10122000743A22004B494C4C45442E20007472798C -:10123000696E6720746F2063616C6C207375622D1A -:1012400067636F64652066696C657320776974688D -:1012500020746F6F206D616E79206C6576656C739C -:101260002E204D4158206C6576656C2069733A00DC -:101270004572726F723A006F70656E206661696CBC -:1012800065642C2046696C653A200043616E6E6F80 -:1012900074206F70656E20737562646972200065DA -:1012A00063686F3A00202844525952554E2900472E -:1012B0003239204175746F20426564204C65766533 -:1012C0006C696E67003F20284C2C522C462C42291A -:1012D000206F7574206F6620626F756E64732E0ABE -:1012E000003F2856296572626F7365206C657665CC -:1012F0006C20697320696D706C61757369626C65CF -:101300002028302D34292E0A00426164205A20768C -:10131000616C75650A004E6F2062696C696E65616B -:101320007220677269640A0046696C652064656CA6 -:10133000657465643A0044656C6574696F6E206617 -:1013400061696C65642C2046696C653A20005072B6 -:101350006F7465637465642050696E0A0020573AA3 -:10136000004520436F6F6C696E672E2E2E0045205E -:1013700048656174696E672E2E2E0020573A004230 -:10138000656420636F6F6C696E672E2E2E00426558 -:10139000642068656174696E672E2E2E00205A3AAB -:1013A0000020593A0020436F756E7420583A00208F -:1013B000453A00205A3A0020593A00583A00436111 -:1013C00072642072656D6F7665640043617264209B -:1013D000696E7365727465640000060900FE07019A -:1013E000920321207FFF07FF07FF00000006000097 -:1013F00001070706020080808080800080030202CF -:10140000060105A0A00507070600005050F850F897 -:1014100050500507070600002078A07028F020052E -:101420000707060000C0C8102040981805070706E7 -:1014300000006090A040A89068020303060104C069 -:101440004080030707060100204080808040200381 -:101450000707060100804020202040800505050682 -:10146000000120A870A8200505050600012020F82D -:1014700020200203030602FFC04080050101060090 -:1014800003F8020202060200C0C0050505060001BD -:1014900008102040800507070600007088888888AB -:1014A000887003070706010040C040404040E00547 -:1014B0000707060000708808708080F80507070697 -:1014C0000000F81020100808F005070706000010BB -:1014D000305090F81010050707060000F880F0085B -:1014E000088870050707060000708080F088887003 -:1014F000050707060000F808102020202005070730 -:10150000060000708888708888700507070600004C -:1015100070888878080870020505060200C0C000BF -:10152000C0C00206060602FFC0C000C0408004071B -:10153000070600001020408040201005030306002D -:1015400002F800F804070706010080402010204040 -:101550008005070706000070880810200020050796 -:101560000706000070880868A8A87005070706002D -:1015700000708888F8888888050707060000F088CA -:1015800088F08888F0050707060000708880808052 -:101590008870050707060000F08888888888F005AD -:1015A0000707060000F88080F08080F8050707062E -:1015B0000000F88080F0808080050707060000703A -:1015C0008880B8888870050707060000888888F832 -:1015D00088888801070706020080808080808080DC -:1015E0000507070600003810101010906005070767 -:1015F0000600008890A0C0A090880507070600009C -:10160000808080808080F805070706000088D8A8C1 -:10161000888888880507070600008888C8A89888F1 -:101620008805070706000070888888888870050785 -:1016300007060000F08888F0808080050707060014 -:101640000070888888A89068050707060000F08861 -:1016500088F0A09088050707060000788080700851 -:1016600008F0050707060000F820202020202005AC -:10167000070706000088888888888870050707069D -:1016800000008888888888502005070706000088A1 -:1016900088888888A8500507070600008888502099 -:1016A0005088880507070600008888885020202079 -:1016B000050707060000F80810204080F803070718 -:1016C000060100E08080808080E0050505060001BD -:1016D0008040201008030707060100E0202020209A -:1016E00020E00503030600042050880501010600E0 -:1016F00000F802020206020580400505050600000A -:1017000070087888780507070600008080B0C888D0 -:1017100088F00505050600007080808870050707C1 -:101720000600000808689888887805050506000006 -:101730007088F880700507070600003048E04040D8 -:1017400040400506060600FF708888780870050787 -:10175000070600008080B0C8888888010707060255 -:1017600000800080808080800308080601FF200040 -:1017700020202020A040040707060000808090A0C1 -:10178000C0A090030707060100C04040404040E071 -:10179000050505060000D0A8A8A8A80505050600AF -:1017A00000B0C8888888050505060000708888880C -:1017B000700506060600FFF08888F08080050606A2 -:1017C0000600FF788888780808050505060000B03F -:1017D000C880808005050506000070807008F00450 -:1017E00007070600004040E0404040300505050680 -:1017F00000008888889868050505060000888888A4 -:1018000050200505050600008888A8A85005050594 -:1018100006000088502050880506060600FF8888CC -:1018200088780870050505060000F8102040F803C8 -:1018300007070601002040408040402001070706BE -:10184000020080808080808080030707060100807E -:1018500040402040408005020206000268900000DF -:101860000006000040012C0173012201AB011801A8 -:10187000F3010E0148020401AC02FA002A03F00051 -:10188000C303E6008004DC006D05D2006C06C800CE -:10189000C707BE007009B4006D0BAA00CB0DA000F5 -:1018A000CF138C00F21B7800E9246400142E500042 -:1018B0009C353C00B83A2800A03D14000B3F0000C6 -:1018C0006265640A002C2073797374656D207374EB -:1018D0006F7070656421204865617465725F49446A -:1018E0003A20004265642068656174696E6720660D -:1018F00061696C65640048656174696E6720666142 -:10190000696C65640045312048656174696E6720C3 -:101910006661696C65640048656174696E6720661C -:1019200061696C65640070012C0190012701B001B0 -:101930002201C0011D01F001180110021301300243 -:101940000E016002090190020401C002FF000003C1 -:10195000FA004003F5008003F000D003EB00200400 -:10196000E6007004E100E004DC004005D700C0059B -:10197000D2004006CD00D006C8008007C300300862 -:10198000BE00F008B900C009B400B00AAF00B00B47 -:10199000AA00D00CA500000EA000500F9B00C010A4 -:1019A00096005012910000148C00C0158700B017EB -:1019B0008200B0197D00D01B7800001E730040200B -:1019C0006E0090226900F024640040275F00902997 -:1019D0005A00E02B5500102E500020304B001032E2 -:1019E0004600E033410090353C0010373700703836 -:1019F0003200A0392D00B03A2800A03B2300603C03 -:101A00001E00103D1900903D1400103E0F00703E66 -:101A10000A00C03E0500003F0000403FFBFF803F42 -:101A2000F6FFC03FF1FF453120544845524D414C2F -:101A30002052554E41574159004245442054484593 -:101A4000524D414C2052554E415741590054686502 -:101A5000726D616C2052756E61776179004531203D -:101A60004572723A204D415854454D5000457272AE -:101A70003A204D415854454D5020424544004D4177 -:101A80005854454D502074726967676572656400EB -:101A90004531204572723A204D494E54454D500013 -:101AA0004572723A204D494E54454D5020424544AE -:101AB000004D494E54454D502074726967676572F8 -:101AC0006564004D383420582059205A20450020A4 -:101AD0002F002042403A0020403A00000000000061 -:101AE00000000000000000000000000000E0000016 -:101AF00000000000000000000000000003F00000F3 -:101B000000000000000000000000000007FC0000D2 -:101B100000000000000000000000000007FF0000BF -:101B2000000000000000000000000000C3FFC00033 -:101B3000000000000000000000000001E1FFE000E4 -:101B4000000000000000000000000003F07FF8002B -:101B5000000000000000000000000007F81FFE0069 -:101B600000000000000000000000000FF807FF0068 -:101B700000000000000000000000001FF003FE0055 -:101B800000000000000000000000003FE000FC003A -:101B900000000000000000000000007FC0003800CE -:101BA00000000000000000000000007F80001080A6 -:101BB00000000000000000000000007F0000038023 -:101BC00000000000000000000000007E00200783ED -:101BD000FF87FF100081C0600C7FF87C00700F87CA -:101BE000FFCFFF980187F0700CFFFC7C01FE0F8097 -:101BF000000C019C038E38780C00007C07FC0F80E1 -:101C0000000C018E071C1C7C0C00007C01F00F8076 -:101C1000000C01870E180C6E0C00007C00E00F8396 -:101C2000FF8FFF83FC3006660C7FF87C00000F8777 -:101C3000FFCFFF01F83006600CFFFC7C00800F80B6 -:101C4000000C030060300660CC00007C01F00F80C7 -:101C5000000C018060180C60EC00007C03FC0F801D -:101C6000000C0180601C1C607C00007C0FF80F8061 -:101C7000000C0180600E38603C00007C03E00F83A4 -:101C8000FF8C01806007F0601C7FF87E01C00F8729 -:101C9000FFCC01806001C0600CFFFC7F00001F8052 -:101CA00000000000000000000000007FC0003F8036 -:101CB00000000000000000000000007FF000FF8036 -:101CC00000000000000000000000003FFC01FF8059 -:101CD00000000000000000000000000FFF07FF00F0 -:101CE000000000000000000000000003FF9FFC0057 -:101CF000000000000000000000000000FF9FF8004E -:101D00000000000000000000000000003F9FE00015 -:101D10000000000000000000000000001F9F800085 -:101D2000000000000000000000000000079F00000D -:101D3000000000000000000000000000019C000006 -:101D40000000000000000000000000000000000093 -:101D50000000000000000000000000000000000083 -:101D600000000000000000000000002020506C6116 -:101D70006E6E657242756666657242797465733A15 -:101D800020002046726565204D656D6F72793A209E -:101D900000436F6D70696C65643A204D6179202055 -:101DA0003520323031390A00207C20417574686F4B -:101DB000723A20286572796F6E652C207468696E9E -:101DC0006B65723235363020636F6E666967290A3B -:101DD00000323031382D30382D303100204C6173D5 -:101DE0007420557064617465643A2000312E312E80 -:101DF000390A004D61726C696E0020536F6674770A -:101E00006172652052657365740A002057617463BE -:101E100068646F672052657365740A002042726FB0 -:101E2000776E206F75742052657365740A002045C3 -:101E3000787465726E616C2052657365740A005027 -:101E40006F77657255700A0073746172740A00616D -:101E500075746F25692E67006572726F72207772D4 -:101E60006974696E6720746F2066696C650A004545 -:101E70006E6473746F70732025632025632025635F -:101E800020256300205A3A0020593A0020583A0091 -:101E9000656E6473746F7073206869743A200044CF -:101EA0006F6E6520736176696E672066696C652E5A -:101EB0000A004D323900466C6F7700466C6F770030 -:101EC000466C6F770046616E2073706565642033E1 -:101ED0000046616E20737065656420330046616E54 -:101EE00020737065656420330046616E20737065F1 -:101EF000656420320046616E20737065656420322F -:101F00000046616E20737065656420320046616E24 -:101F100020737065656420310046616E20737065C2 -:101F2000656420310046616E207370656564203100 -:101F3000004265640042656400426564004E6F7A49 -:101F40007A6C65004E6F7A7A6C65004E6F7A7A6CA7 -:101F5000650046616465204865696768740046618C -:101F60006465204865696768740046616465204857 -:101F700065696768740053706565640053706565D2 -:101F800064005370656564004D61696E0050726550 -:101F90006865617420504C4120456E640050726544 -:101FA0006865617420504C41204265640050726540 -:101FB0006865617420504C410050726570617265B3 -:101FC00000507265686561742041425320456E641B -:101FD0000050726568656174204142532042656417 -:101FE000005072656865617420414253005072650B -:101FF00070617265004D343238004D3238302050F7 -:1020000030205331363000424C546F756368205392 -:10201000656C662D54657374004D32383020503035 -:10202000205331323000507265686561742041423E -:1020300053005072656865617420504C4100436FD5 -:102040006F6C646F776E00526573657420424C54F8 -:102050006F7563680044697361626C6520737465B1 -:102060007070657273004D38340053657420686F6A -:102070006D65206F666673657473004661646520E4 -:1020800048656967687400466164652048656967EA -:102090006874004661646520486569676874004F2C -:1020A0006666004F6E2000426564204C6576656C64 -:1020B000696E67004C6576656C2062656400473226 -:1020C000380A473239004175746F20686F6D6500BA -:1020D000473238004D6F76652061786973004D6135 -:1020E000696E003A0A0020286D6D290020204D38C5 -:1020F0003531205A005A2D50726F6265204F666646 -:102100007365740020440020490020204D33303492 -:1021100020500020440020490020204D3330312041 -:1021200050005049442073657474696E67733A0AAD -:102130000020460020420020480020204D31343548 -:102140002053004D6174657269616C20686561742B -:10215000757020706172616D65746572733A0A0002 -:10216000205A00204A0020204732392057204900B9 -:10217000205A0020204D3432302053004175746FB6 -:1021800020426564204C6576656C696E673A0A008A -:10219000205A0020590020204D3230362058004867 -:1021A0006F6D65206F66667365743A0A002045009E -:1021B000205A0020590020580020540020530020AD -:1021C000204D32303520420020453C6D61785F65FE -:1021D0005F6A65726B3E0020583C6D61785F785F86 -:1021E0006A65726B3E20593C6D61785F795F6A6504 -:1021F000726B3E205A3C6D61785F7A5F6A65726BE4 -:102200003E00416476616E6365643A20423C6D69CC -:102210006E5F7365676D656E745F74696D655F751C -:10222000733E20533C6D696E5F66656564726174D0 -:10223000653E20543C6D696E5F74726176656C5FBB -:1022400066656564726174653E002054002052002A -:1022500020204D323034205000416363656C65723C -:102260006174696F6E2028756E6974732F733229DB -:102270003A20503C7072696E745F616363656C3EB6 -:1022800020523C726574726163745F616363656C54 -:102290003E20543C74726176656C5F616363656C6B -:1022A0003E0A00204500205A0020590020204D32CF -:1022B00030312058004D6178696D756D2041636340 -:1022C000656C65726174696F6E2028756E697473D0 -:1022D0002F7332293A0A00204500205A0020590065 -:1022E00020204D3230332058004D6178696D756D76 -:1022F000206665656472617465732028756E697403 -:10230000732F73293A0A00204500205A00205900F3 -:1023100020204D3932205800537465707320706549 -:102320007220756E69743A0A0020204D32303020D8 -:1023300044300A0020204D323030204400204469CF -:102340007361626C65640A0046696C616D656E74E8 -:102350002073657474696E67733A0020204D3134C0 -:10236000392043203B20556E69747320696E2043E9 -:10237000656C736975730A00202047323120202074 -:10238000203B004D3234004D323320257300556E12 -:102390006B6E6F776E20636F6D6D616E643A202295 -:1023A0000050726F62696E67206661696C65640ACD -:1023B0000050726F62696E67206661696C656400C7 -:1023C000205A3A200020593A200042656420583AA9 -:1023D0002000486F6D65202573257325732066697D -:1023E000727374002066697273740A005A0059008F -:1023F0005800486F6D65200053442063617264206B -:102400006F6B0A006F70656E526F6F742066616942 -:102410006C65640A00766F6C756D652E696E697403 -:10242000206661696C65640A00534420696E6974B2 -:10243000206661696C0A0000060900FE00000000C9 -:102440000001090008FE000005080806000040F031 -:10245000C88888987810050808060000C0F88888A1 -:10246000888888F80505050600012030F830200529 -:1024700008080600002070F820202020E005090947 -:102480000600FF2070A8A8B88888702005090906F2 -:1024900000FFE080C0B0A828302828050909060000 -:1024A000FFF8A88888888888A8F8050A0A0600FE28 -:1024B000205050505088A8A88870030303060003DA -:1024C00040A04025753A2530327500253032753AE6 -:1024D000253032750025756420253032753A253057 -:1024E000327500202020202020005A005900202092 -:1024F000202000580009200000000000000000001B -:10250000000000003FFFF00000000000000000009D -:102510000000003800700000000000000000000013 -:10252000000030FC3000000000000000000000004F -:102530000020FC100000000000000000000000006F -:1025400020781000000000000000000000000020C3 -:1025500030100000000000000000000000002C000F -:10256000D03FC0000000000000002082002E31D0CB -:102570007FE0000000000000001041002F7BD07FB2 -:10258000E0000000000000001041002F7BD07FE041 -:10259000000000000000002082002E31D03FC0006B -:1025A0000000000000004104002C00D03FC00000EB -:1025B00000000000008208002030107FE0000000D2 -:1025C000000000008208002078107FE0000000007A -:1025D00000000041040020FC107FE000000000002B -:1025E000000020820030FC301F800000000000004E -:1025F000000000003800700F000000000000000024 -:10260000FFFFC03FFFF0060000000000000000FFD9 -:10261000FFC00000000000000000000000000000FB -:10262000003FFFF00000000000000000000000007C -:1026300038007000000000000000000000000031C1 -:10264000863000000000000000000000000023872A -:10265000100000000000000000000000002787902C -:102660000000000000000000000000002F87D000E4 -:1026700000000000000000000000002F03D03FC059 -:10268000000000000000002082002030107FE000E9 -:102690000000000000001041002078107FE00000E2 -:1026A00000000000001041002078107FE0000000D2 -:1026B000000000002082002030103FC00000000019 -:1026C0000000004104002F03D03FC00000000000C4 -:1026D00000008208002F87D07FE00000000000008B -:1026E000008208002787907FE000000000000000C3 -:1026F0004104002387107FE000000000000000205C -:1027000082003186301F80000000000000000000C1 -:10271000003800700F0000000000000000FFFFC044 -:102720003FFFF0060000000000000000FFFFC000B7 -:10273000000046696C2E204469612E0046696C2EAB -:10274000204469612E004F6666004F6E20004520D0 -:10275000696E206D6D3300436F6E74726F6C004351 -:10276000616E6E6F7420656E74657220737562643D -:1027700069723A2000022E2E004D61696E003A0007 -:102780004361703A005741524E494E4721204C6FE9 -:1027900077205A204A65726B206D6179206C6561E3 -:1027A0006420746F20756E77616E7465642070614B -:1027B000757365732E0A00205A00205900580020B6 -:1027C000204D61783A2000205A00205900580020FE -:1027D000204D696E3A20004F6E20004F6666005310 -:1027E0006F667420656E6473746F70733A20002096 -:1027F000643A0020693A0020703A00496E76616CB4 -:1028000069642065787472756465720A004B64208F -:102810000023646566696E652044454641554C5405 -:102820005F004B69200023646566696E652044453E -:102830004641554C545F004B702000236465666927 -:102840006E652044454641554C545F005049442034 -:102850004175746F74756E652066696E697368651D -:1028600064212050757420746865206C6173742035 -:102870004B702C204B6920616E64204B6420636F89 -:102880006E7374616E74732066726F6D2062656C16 -:102890006F7720696E746F20436F6E66696775721B -:1028A0006174696F6E2E680A005049442041757446 -:1028B0006F74756E65206661696C6564212074694A -:1028C0006D656F75740A00453120544845524D417D -:1028D0004C2052554E4157415900424544205448DE -:1028E00045524D414C2052554E4157415900546874 -:1028F00065726D616C2052756E617761790045314A -:102900002048656174696E67206661696C65640062 -:102910004265642068656174696E67206661696CF0 -:1029200065640048656174696E67206661696C65FD -:102930006400504944204175746F74756E6520665B -:1029400061696C6564212054656D70657261747590 -:10295000726520746F6F20686967680A00204B6495 -:102960003A2000204B693A2000204B703A20000AA0 -:1029700020436C617373696320504944200A00202E -:1029800054753A2000204B753A2000206D61783A4A -:102990002000206D696E3A200020643A20002062F9 -:1029A0006961733A2000504944204175746F747511 -:1029B0006E65206661696C656421204261642065F2 -:1029C00078747275646572206E756D6265720A0046 -:1029D000504944204175746F74756E65207374613D -:1029E00072740A004F66660A004661646520486595 -:1029F000696768742000426564204C6576656C697F -:102A00006E6720004661696C656420746F20656E96 -:102A100061626C6520426564204C6576656C696E08 -:102A2000670A004D65736820706F696E742063617A -:102A30006E6E6F74206265207265736F6C7665646C -:102A40000A004D34323120696E636F7272656374AF -:102A500020706172616D6574657220757361676560 -:102A60000A004F666673657473206170706C6965E7 -:102A700064004572723A20546F6F206661722100C3 -:102A8000546F6F206661722066726F6D207265668A -:102A90006572656E636520706F696E740A004572B9 -:102AA000726F722077726974696E6720746F204547 -:102AB0004550524F4D210A00454550524F4D20641C -:102AC00061746173697A65206572726F722E0A0093 -:102AD000290A002062797465733B206372632000C9 -:102AE00053657474696E67732053746F72656420E4 -:102AF000280020746F6F206C6F6E67206578747289 -:102B00007573696F6E2070726576656E7465640AA0 -:102B10000020636F6C6420657874727573696F6EE2 -:102B20002070726576656E7465640A0062757379EB -:102B30003A2070617573656420666F7220696E70EB -:102B400075740A00627573793A20706175736564F3 -:102B500020666F7220757365720A00627573793A28 -:102B60002070726F63657373696E670A004B494C1E -:102B70004C45442E20004B494C4C206361757365D5 -:102B800064206279204B494C4C20627574746F6EDE -:102B90002F70696E0A004B494C4C45442E20004B67 -:102BA000494C4C2063617573656420627920746FB1 -:102BB0006F206D75636820696E6163746976652046 -:102BC00074696D65202D2063757272656E74206363 -:102BD0006F6D6D616E643A2000506C6561736520A5 -:102BE0007265736574005052494E544552204841F5 -:102BF0004C544544005072696E7465722068616C73 -:102C00007465642E206B696C6C28292063616C6C80 -:102C10006564210A000000000000000000000000C0 -:102C200000000048420000484200008040000000D0 -:102C3000005761726E696E673A20486F6D696E6702 -:102C40002042756D702044697669736F72203C2054 -:102C5000310A000202040000A0400000A040000071 -:102C6000004000009643000096430000C843FFFF69 -:102C7000FF416D6178204500416D6178204500413C -:102C80006D6178205A00416D6178205A00416D6174 -:102C900078205900416D6178205900416D6178209C -:102CA0005800416D6178205800412D74726176653D -:102CB0006C00412D74726176656C00412D726574F3 -:102CC0007261637400412D726574726163740041B6 -:102CD0006363656C00416363656C004D6F74696F7D -:102CE0006E0056652D6A65726B0056652D6A6572B9 -:102CF0006B0056652D6A65726B00567A2D6A657297 -:102D00006B00567A2D6A65726B0056792D6A657272 -:102D10006B0056792D6A65726B0056792D6A657263 -:102D20006B0056782D6A65726B0056782D6A657255 -:102D30006B0056782D6A65726B004D6F74696F6E0B -:102D4000004573746570732F6D6D00457374657005 -:102D5000732F6D6D005A73746570732F6D6D005A0B -:102D600073746570732F6D6D005973746570732F74 -:102D70006D6D005973746570732F6D6D00587374A9 -:102D80006570732F6D6D005873746570732F6D6D62 -:102D9000004D6F74696F6E0053746570732F6D6DA5 -:102DA000004A65726B00416363656C6572617469AA -:102DB0006F6E0056656C6F636974790050726F6254 -:102DC00065205A204F66667365740050726F6265A5 -:102DD000205A204F666673657400436F6E74726F7D -:102DE0006C007C3C3E5E2B3D3F2F5B5D3B2C2A22E2 -:102DF0005C00507265686561742041425320636FC6 -:102E00006E66005072656865617420504C412063A5 -:102E10006F6E66005049442D44005049442D4400D3 -:102E20005049442D49005049442D49005049442DF2 -:102E300050005049442D5000200820466163740022 -:102E400020082046616374002008204D617800202E -:102E500008204D6178002008204D6178002008206E -:102E60004D696E002008204D696E002008204D69D4 -:102E70006E004F6666004F6E20004175746F74657A -:102E80006D700046616E2073706565642033004686 -:102E9000616E20737065656420330046616E207337 -:102EA0007065656420330046616E207370656564EB -:102EB00020320046616E20737065656420320046E2 -:102EC000616E20737065656420320046616E207308 -:102ED0007065656420310046616E207370656564BD -:102EE00020310046616E20737065656420310042B8 -:102EF00065640042656400426564004E6F7A7A6CD6 -:102F000065004E6F7A7A6C65004E6F7A7A6C650058 -:102F1000436F6E74726F6C0053746F7265207365CB -:102F20007474696E677300426564004265640042B0 -:102F30006564004E6F7A7A6C65004E6F7A7A6C65C4 -:102F4000004E6F7A7A6C650046616E20737065651D -:102F5000640046616E2073706565640046616E2092 -:102F600073706565640054656D7065726174757227 -:102F700065005654726176206D696E005654726118 -:102F800076206D696E005654726176206D696E0010 -:102F9000566D696E00566D696E00566D696E00560D -:102FA0006D6178204500566D6178204500566D6151 -:102FB00078204500566D6178205A00566D61782062 -:102FC0005A00566D6178205A00566D61782059007C -:102FD000566D6178205900566D6178205900566D04 -:102FE0006178205800566D6178205800566D6178E0 -:102FF0002058004D6F74696F6E00290A00206279B5 -:103000007465733B2063726320002073746F726574 -:10301000642073657474696E677320726574726975 -:1030200065766564202800202863616C63756C6197 -:1030300074656429210A0020213D20004545505235 -:103040004F4D20435243206D69736D617463682056 -:103050002D202873746F7265642920002053697ACB -:10306000653A2000496E6465783A2000204D61720F -:103070006C696E3D563535290A0028454550524F3A -:103080004D3D00454550524F4D2076657273696F36 -:103090006E206D69736D61746368200048617264AD -:1030A000636F6465642044656661756C7420536564 -:1030B0007474696E6773204C6F616465640A00DC28 -:1030C000050000DC05000032000000DC0500000007 -:1030D000009643000096430000A0400000C8410055 -:1030E00000A0420000A0420000C8430000BA424DC8 -:1030F0006F76652058004D6F76652059004D6F76CC -:1031000065205A004578747275646572004D6F765B -:103110006520302E316D6D004D6F766520316D6DFF -:10312000004D6F76652031306D6D004D6F766520F6 -:1031300061786973004578747275646572004D6FCB -:103140007665205A004D6F76652059004D6F766583 -:103150002058004578747275646572004D6F76650D -:10316000205A004D6F76652059004D6F76652058C6 -:10317000005072657061726500496E697469616CB6 -:10318000697A6520454550524F4D00436F6E747209 -:103190006F6C00526573746F7265206661696C7341 -:1031A000616665004C6F61642073657474696E6755 -:1031B0007300496E697469616C697A652045455090 -:1031C000524F4D0053746F72652073657474696E4D -:1031D000677300424C546F7563680046696C616D9B -:1031E000656E74004D6F74696F6E0054656D706527 -:1031F000726174757265004D61696E000000210096 -:10320000240027002A002D003000330001010000B7 -:10321000040107010A0100002200250028002B00FC -:103220002E003100340002010000050108010B01ED -:10323000000020002300260029002C002F0032006F -:103240000001000003010601090105050505070548 -:1032500008080808020202020A0A08080404040412 -:10326000010101010101010103030303030303033E -:10327000040707070C0C0C0C0C0C0C0C02020202CD -:1032800006060606060606060B0B0B0B0B0B0B0BB6 -:103290000102102020080810204010204080020168 -:1032A000020108040201010204081020408080404D -:1032B000201008040201800402018040201008044C -:1032C00002010804020101020408102040800102EA -:1032D00004081020408000000A0B02090C0D0E08A3 -:1032E00007030401000000000000000000000000CF -:1032F00000000000000000000000000000000000CE -:10330000000012111000000000000000000000008A -:103310000000000000000000000000004D69637222 -:103320006F737465707320756E617661696C61622C -:103330006C650A0045313A200045303A20005A3A7F -:103340002000593A2000583A20004D53312C4D535B -:10335000322050696E730A003344205072696E74D3 -:1033600065722052656164792E005072696E7469CD -:103370006E672E2E2E005072696E74207061757308 -:1033800065640053746F7720424C546F7563680016 -:103390004D32383020503020533930004465706C45 -:1033A0006F7920424C546F756368004D323830207D -:1033B00050302053313000424C546F7563682053B5 -:1033C000656C662D54657374004D32383020503072 -:1033D000205331323000526573657420424C546F73 -:1033E000756368004D32383020503020533136300C -:1033F000004D61696E005072696E742061626F7277 -:10340000746564005072696E742066726F6D20532B -:10341000440053746F70207072696E74005265734B -:10342000756D65207072696E74004E6F2053442074 -:1034300063617264005061757365207072696E74A7 -:1034400000436F6E74726F6C0050726570617265CC -:103450000054756E6500496E666F20736372656512 -:103460006E00526573656E643A20006F6B0035FB29 -:10347000F00011241FBECFEFD1E2DEBFCDBF00E0D0 -:103480000CBF13E0A0E0B2E0ECEEFFE102E00BBF06 -:1034900002C007900D92AE38B107D9F725E1AEE82A -:1034A000B3E001C01D92AC31B207E1F71AE1C8E305 -:1034B000DAE100E006C021970109802FFE010F9498 -:1034C000530FC733D10780E00807A9F70E9414FC07 -:1034D0000D94E50F0C9400002F923F924F925F9253 -:1034E0006F927F928F929F92AF92BF92CF92DF9214 -:1034F000EF92FF920F931F93CF93DF93CDB7DEB779 -:10350000CB56D1090FB6F894DEBF0FBECDBF21E078 -:1035100020932B13809167148D3411F40C944C2359 -:10352000843511F40C94F730873411F00C94413148 -:1035300020906514309066143CE12316310409F4A0 -:103540002DC69CF454E02516310444F482E028167C -:103550003104C4F537FE2FC00C94482394E029169B -:10356000310409F4DDC50C944823AAE22A1631047B -:1035700009F403C764F4EDE12E16310409F425C6FD -:10358000FEE12F16310409F424C60C9448233BE5D0 -:103590002316310409F4AFC74CE52416310409F4AD -:1035A000AEC75AE52516310411F00C944823109249 -:1035B00092030C9443318091090281110C9448319B -:1035C0000C94433180910902882311F40C94433107 -:1035D0000E94F43882E50E94E838882309F44CC13F -:1035E0000E946C384B015C0120E030E0A9010F948F -:1035F0000C08882309F470C18091B60F9091B70F21 -:10360000A091B80FB091B90F88AF99AFAAAFBBAF77 -:103610002091BA0F3091BB0F4091BC0F5091BD0F5C -:103620002CAF3DAF4EAF5FAF8091451390914613E5 -:10363000A0914713B09148132C968CAF9DAFAEAFBD -:10364000BFAF2C972091491330914A1340914B13EF -:1036500050914C1328962CAF3DAF4EAF5FAF2897DB -:103660009C01AD0168AD79AD8AAD9BAD0F940C089E -:1036700081110FC028962CAD3DAD4EAD5FAD2897A2 -:103680006CAD7DAD8EAD9FAD0F940C08882309F411 -:1036900023C111E032E02316310409F010E020E0EC -:1036A00030E0A901C501B4010F940C08881F8827D8 -:1036B000881F181759F080E090E0A0E8BFEB6496EF -:1036C0008CAF9DAFAEAFBFAF64970AC020E030E0D3 -:1036D00040E85FE364962CAF3DAF4EAF5FAF6497B9 -:1036E00028AD39AD4AAD5BAD2C966CAD7DAD8EADE0 -:1036F0009FAD2C970F94570C60966CAF7DAF8EAF3B -:103700009FAF60972CAD3DAD4EAD5FAD28966CADD3 -:103710007DAD8EAD9FAD28970F94570C6B017C014A -:1037200060962CAD3DAD4EAD5FAD6097CA01B9015D -:103730000F9471082B013C01A7019601C701B60146 -:103740000F9471089B01AC01C301B2010F94580C96 -:103750000F94C30E24966CAF7DAF8EAF9FAF2497AE -:1037600020E030E040E05FE30F9471082B013C0162 -:10377000A5019401C501B4010F9471084B015C01CE -:10378000A3019201C301B2010F9471089B01AC0126 -:10379000C501B4010F94570C0F94C30E64962CAD61 -:1037A0003DAD4EAD5FAD64970F9471084B015C0168 -:1037B000C701B601905824962CAD3DAD4EAD5FAD1E -:1037C00024970F94340DA50194010F9471086B0197 -:1037D0007C012C962CAD3DAD4EAD5FAD2C9768AD08 -:1037E00079AD8AAD9BAD0F94580C20E030E040E0FD -:1037F0005FE30F9471089B01AC01C701B6010F9400 -:10380000580C28AD39AD4AAD5BAD0F94570C6B0128 -:103810007C0128962CAD3DAD4EAD5FAD28976CADCB -:103820007DAD8EAD9FAD0F94580C20E030E040E0B0 -:103830005FE30F9471082B013C0124962CAD3DAD44 -:103840004EAD5FAD249760966CAD7DAD8EAD9FADF6 -:1038500060970F94340DA50194010F9471089B019A -:10386000AC01C301B2010F94580C2CAD3DAD4EAD6F -:103870005FAD0F94570C14C089E40E94E838882388 -:1038800029F00E946C386B017C0103C0C12CD12C43 -:1038900076018AE40E94E838882309F10E946C3896 -:1038A0002C966CAF7DAF8EAF9FAF2C9720E030E0B1 -:1038B000A901C701B6010F940C0881111FC020E0B7 -:1038C00030E0A9012C966CAD7DAD8EAD9FAD2C97EF -:1038D0000F940C08811112C0E0E7F2E10DC420E062 -:1038E00030E0A901C701B6010F940C088823A1F3A9 -:1038F0002C961CAE1DAE1EAE1FAE2C97D701C60176 -:10390000B05888AF99AFAAAFBBAF2C962CAD3DADE8 -:103910004EAD5FAD2C9750582CAF3DAF4EAF5FAF63 -:103920009C01AD01BC01CD010F9471084B015C01FC -:103930002CAD3DAD4EAD5FADCA01B9010F9471081C -:103940009B01AC01C501B4010F94580C0F94C30E38 -:10395000A0966CAF7DAF8EAF9FAFA0978091B60F52 -:103960009091B70FA091B80FB091B90F28968CAF76 -:103970009DAFAEAFBFAF28979C01AD01C701B601A7 -:103980000F94580C64966CAF7DAF8EAF9FAF649769 -:103990002091BA0F3091BB0F4091BC0F5091BD0FD9 -:1039A00060962CAF3DAF4EAF5FAF60972C962CADBD -:1039B0003DAD4EAD5FAD2C9760966CAD7DAD8EADDF -:1039C0009FAD60970F94580CA4966CAF7DAF8EAFEF -:1039D0009FAFA4978091451390914613A0914713F0 -:1039E000B091481368968CAF9DAFAEAFBFAF6897EC -:1039F00064962CAD3DAD4EAD5FAD6497BC01CD017D -:103A00000F94570C6B017C012091491330914A139C -:103A100040914B1350914C136C962CAF3DAF4EAF71 -:103A20005FAF6C97A4962CAD3DAD4EAD5FADA49746 -:103A30006C966CAD7DAD8EAD9FAD6C970F94570CB1 -:103A40004B015C018091BE0F9091BF0FA091C00F00 -:103A5000B091C10FA8968CAF9DAFAEAFBFAFA89786 -:103A60009C01AD0160914D1370914E1380914F13E5 -:103A7000909150130F94570C24966CAF7DAF8EAF7E -:103A80009FAF2497A701960168AD79AD8AAD9BAD34 -:103A90000F9471082B013C01A50194016CAD7DAD23 -:103AA0008EAD9FAD0F9471089B01AC01C301B201B3 -:103AB0000F94580C2B013C01A501940168AD79AD20 -:103AC0008AAD9BAD0F9471084B015C01A701960173 -:103AD0006CAD7DAD8EAD9FAD0F9471089B01AC01B7 -:103AE000C501B4010F94570CA30192010F94CB0CA4 -:103AF0006B017C0120E030E0A9010F940C0887FFE6 -:103B00000AC02BED3FE049EC50E4C701B6010F9429 -:103B1000580C6B017C0192E02916310451F42BED15 -:103B20003FE049EC50E4C701B6010F94570C6B011C -:103B30007C0120E030E0A901C701B6010F940C0818 -:103B4000811128C068962CAD3DAD4EAD5FAD689734 -:103B500028966CAD7DAD8EAD9FAD28970F940C0867 -:103B6000811118C06C962CAD3DAD4EAD5FAD6C971C -:103B700060966CAD7DAD8EAD9FAD60970F940C08D7 -:103B8000811108C0FBEDCF2EFFE0DF2EF9ECEF2E08 -:103B9000F0E4FF2EA7019601A0966CAD7DAD8EAD31 -:103BA0009FADA0970F9471084B015C0120E030E0BD -:103BB000A90124966CAD7DAD8EAD9FAD24970F9479 -:103BC0000C088823E9F0A5019401C501B4010F9404 -:103BD00071084B015C0124962CAD3DAD4EAD5FAD3F -:103BE0002497CA01B9010F9471089B01AC01C5016A -:103BF000B4010F94580C0F94C30E4B015C010DC01F -:103C000020E030E0A901C501B4010F947E0E87FFCA -:103C100004C0B7FAB094B7F8B0942FE632E143E8A5 -:103C20005AE3C501B4010F940C0887FF02C00C943D -:103C30004331C501B4010F94CD0D0F94A10D2E9603 -:103C40007FAF6EAF2E97DB01AB2B31F4E1E0F0E0FC -:103C50002E96FFAFEEAF2E974090C20F5090C30F3D -:103C60006090C40F7090C50F2E962EAD3FAD2E976D -:103C7000B90180E090E00F9410084B015C019B01BA -:103C8000AC01C701B6010F94340D28966CAF7DAF1F -:103C90008EAF9FAF2897A501940124966CAD7DADA2 -:103CA0008EAD9FAD24970F94340DA0966CAF7DAF71 -:103CB0008EAF9FAFA097A3019201609151137091B5 -:103CC000521380915313909154130F94570CA501E4 -:103CD00094010F94340DAC966CAF7DAF8EAF9FAF57 -:103CE000AC9728962CAD3DAD4EAD5FAD2897CA017F -:103CF000B9010F94710820E030E040E05FE30F94D9 -:103D000071089B01AC0160E070E080E89FE30F94D4 -:103D1000570C68966CAF7DAF8EAF9FAF6897A89633 -:103D20008CAD9DADAEADBFADA89789879A87AB87A7 -:103D3000BC874D865E866F86788A60911A02709184 -:103D40001B02072E000C880B990B0F941208209170 -:103D50003F023091400240914102509142020F9443 -:103D600071082AE037ED43E25CE30F9471086CAB15 -:103D70007DAB8EAB9FAB0E94D7ED9B01AC0128536E -:103D80003F4F4F4F5F4F6C962CAF3DAF4EAF5FAF85 -:103D90006C9748AC59AC6AAC7BAC22242394312C90 -:103DA00039E121963FAF21972E964EAD5FAD2E970C -:103DB0004215530509F44CC10E94DE790E94D7EDEB -:103DC000DC01CB016C962CAD3DAD4EAD5FAD6C977B -:103DD000821B930BA40BB50BB7FD10C00E94D7ED4F -:103DE0009B01AC0128533F4F4F4F5F4F6C962CAF58 -:103DF0003DAF4EAF5FAF6C970E94B2BF21963FAD13 -:103E00002197315021963FAF2197332309F445C0C4 -:103E10002CAD3DAD4EAD5FAD68966CAD7DAD8EAD5C -:103E20009FAD68970F9471086B017C019201A3010B -:103E300028966CAD7DAD8EAD9FAD28970F9471081F -:103E4000A70196010F94580C7B018C019201A301EC -:103E500068966CAD7DAD8EAD9FAD68970F9471087F -:103E60004B015C012CAD3DAD4EAD5FAD28966CAD08 -:103E70007DAD8EAD9FAD28970F9471089B01AC016D -:103E8000C501B4010F94570C2B013C01C701D801A7 -:103E90008CAF9DAFAEAFBFAF55C0B10180E090E039 -:103EA0000F94100828962CAD3DAD4EAD5FAD289710 -:103EB0000F9471084B015C010F94310D6B017C0173 -:103EC000C501B4010F94B90E4B015C01A701960125 -:103ED00068AD79AD8AAD9BAD0F9471082B013C01A3 -:103EE0002C962CAD3DAD4EAD5FAD2C97C501B40108 -:103EF0000F947108A30192010F94580C2B013C01FF -:103F0000A501940168AD79AD8AAD9BAD0F947108A0 -:103F10004B015C012C962CAD3DAD4EAD5FAD2C97A9 -:103F2000C701B6010F9471089B01AC01C501B40132 -:103F30000F94570C6CAF7DAF8EAF9FAF49E12196C8 -:103F40004FAF21979201A30164966CAD7DAD8EAD0C -:103F50009FAD64970F94580C69837A838B839C83FD -:103F60002CAD3DAD4EAD5FADA4966CAD7DAD8EADCF -:103F70009FADA4970F94580C6D837E838F83988791 -:103F8000A0962CAD3DAD4EAD5FADA09769857A850D -:103F90008B859C850F94580C69877A878B879C87C3 -:103FA000AC962CAD3DAD4EAD5FADAC976D857E85CD -:103FB0008F8598890F94580C6D877E878F87988B93 -:103FC00080912802882321F0CE0101960E942BBE09 -:103FD000E09011141CA61DA61EA61FA689819A8119 -:103FE000AB81BC8188A399A3AAA3BBA38D819E8129 -:103FF000AF81B8858CA39DA3AEA3BFA389859A8505 -:10400000AB85BC8588A799A7AAA7BBA7AE01485DC9 -:104010005F4FBE016C5D7F4FCE0180960E94E487AA -:10402000CE018C966C018E010C5C1F4F9E01235FAC -:104030003F4FAE01485D5F4FBE016C5D7F4F0C97F7 -:104040000E94563F882321F09FEF291A390AACCEEF -:10405000E090111418AA19AA1AAA1BAA8091451354 -:1040600090914613A0914713B091481388A399A348 -:10407000AAA3BBA38091491390914A13A0914B131B -:10408000B0914C138CA39DA3AEA3BFA380914D13FD -:1040900090914E13A0914F13B091501388A799A7F8 -:1040A000AAA7BBA7AE01485D5F4FBE016C5D7F4F05 -:1040B000CE0180960E94E487DE01D0966D018E01CC -:1040C0000C5C1F4F21E533E1AE01485D5F4FBE013F -:1040D0006C5D7F4FCE0180960E94563F80E1E5E403 -:1040E000F3E1A6EBBFE001900D928A95E1F70C9405 -:1040F00043310E948339F80184918F010F5F1F4F74 -:104100008111F7CFE5E4F2E084918F010F5F1F4F3B -:10411000882311F40C9443310E948339F801F4CFC1 -:1041200080E50E94E838882329F00E942C386B0132 -:104130007C0103C0C12CD12C760183E50E94E838B4 -:10414000882361F00E946C3820E030E04AE754E4B4 -:104150000F9471080F94A10D6B017C010E942E4DEC -:1041600080919509811105C060E08BE592E00E9485 -:104170001B700E94D7EDC60ED71EE81EF91E0E94C6 -:10418000D7EDDC01CB018C199D09AE09BF09B7FD44 -:1041900002C00C9443310E94B2BFF1CF8091A50FB1 -:1041A0008770873011F00C944C318FE40E94E8380E -:1041B000882319F00E945D3803C08FE40E949F3865 -:1041C00081110C9443310C944C310E94D8640C94AE -:1041D0004331C090B60FD090B70FE090B80FF09079 -:1041E000B90F88E50E94E838811109C020E030E06D -:1041F0004CE052E4C701B6010F94580C02C00E9473 -:104200006C3868A379A38AA39BA3C090BA0FD090FF -:10421000BB0FE090BC0FF090BD0F89E50E94E8381D -:10422000811108C020E030E0A901C701B6010F9458 -:10423000580C02C00E946C389B01AC0169837A83E0 -:104240008B839C8368A179A18AA19BA10E94BDBE9A -:10425000882311F40C94433180E00E94EB360E94D5 -:10426000CC3385E40E94E838882321F00E945D3831 -:10427000182F04C085E40E949F3811E086E50E9453 -:10428000E838882321F00E943C38262F01C021E025 -:10429000412FBE016F5F7F4FCE0180960E94A69393 -:1042A0006B017C019B01AC010F94040F81115FC075 -:1042B00088A099A0AAA0BBA020E030E0A901C50178 -:1042C000B4010F940C0887FF05C027E137EB41E5E7 -:1042D00058EB04C027E137EB41E558E3C501B401D1 -:1042E0000F94580CAB01BC018EE692E00E9402587C -:1042F00089809A80AB80BC8020E030E0A901C501B4 -:10430000B4010F940C0887FF05C027E137EB41E5A6 -:1043100058EB04C027E137EB41E558E3C501B40190 -:104320000F94580CAB01BC0189E692E00E94025840 -:1043300020E030E0A901C701B6010F940C0887FF07 -:1043400005C027E137EB41E558EB04C027E137EB27 -:1043500041E558E3C701B6010F94580CAB01BC010D -:1043600084E692E00E9402588AE00E9483390E940B -:10437000B3330E94D55F0C944331809109028823A6 -:1043800011F40C94433189E40E94E838182F8823F3 -:1043900021F00E943C38E62E01C0E12C8AE40E9404 -:1043A000E838F82E882321F00E943C38062F01C0FF -:1043B00000E0112319F0B2E0BE1520F0FF2081F0DB -:1043C000033070F0E6E7F2E084918F010F5F1F4F3A -:1043D000882311F40C9443310E948339F801F4CFFF -:1043E0000E9479391123F1F020915C0F30915D0F1B -:1043F0004E2D4203B001439F700D11248091E013B4 -:104400009091E113680F791F072E000C880B990B10 -:104410000F941208609345137093461380934713CB -:1044200090934813FF20E9F020915E0F30915F0FC9 -:104430000203B001039F700D11248091E21390914B -:10444000E313680F791F072E000C880B990B0F944C -:1044500012086093491370934A1380934B139093FF -:104460004C1380E50E94E8388823E9F00E945D380B -:104470008823E9F01123D9F020E030E04CE052E449 -:1044800060914513709146138091471390914813A2 -:104490000F94570C60934513709346138093471302 -:1044A0009093481304C080E50E949F38E1CF86E4D2 -:1044B0000E94E8388823D9F00E946C386B017C0197 -:1044C00020E030E0A9010F947E0E181684F420E05D -:1044D00030E040E752E4C701B6010F94340D609319 -:1044E0003F027093400280934102909342020E94E7 -:1044F000C9C20C944331209392030C94433141E69A -:10450000242E42E0342E59E3E52E53E1F52E86EBBE -:104510009FE099AF88AF66EAC62E6FE0D62E00E026 -:1045200010E0D1018D911D010E94E838882309F423 -:104530004BC00E946C382B013C01133049F0F6014E -:1045400020813181428153810F94570C2B013C0112 -:10455000A8ADB9AD2D913D914D915C91C301B201D2 -:104560000F94570C4B015C012DEB37E346E855EBFC -:104570000F947E0E87FD0AC02DEB37E346E855E326 -:10458000C501B4010F940C081816F4F4133051F45B -:104590004092C20F5092C30F6092C40F7092C50F29 -:1045A00001E012C0A5019401F7016081718182814F -:1045B00093810F94580CD7016D937D938D939C93A9 -:1045C0001397812F0E9496351F5FB4E0EB0EF11C0C -:1045D000E8ADF9AD3496F9AFE8AFF4E0CF0ED11CF9 -:1045E000143009F09ECF002309F44EC020E030E0E3 -:1045F000A9016091C20F7091C30F8091C40F909177 -:10460000C50F0F94580C2091A3133091A41340911F -:10461000A5135091A6130F9471080F94890E6093FF -:10462000110A7093120A8093130A9093140A9091BE -:10463000EF098091F009981719F00E94D04C24C01E -:104640000E942E4D80916F00982F927081FF05C0BF -:1046500080916F008D7F80936F004091110A50917F -:10466000120A6091130A7091140A409340145093F7 -:1046700041146093421470934314992329F080915C -:104680006F00826080936F000E94D55F0C9443316D -:104690000E9414960C944331809165149091661495 -:1046A0008737910509F40BC20CF0F2C08D349105E7 -:1046B00009F4EDC40CF058C08931910509F4F3C236 -:1046C0001CF58431910509F400C27CF48131910517 -:1046D00009F475C22CF4029708F4FAC10C94F43072 -:1046E000429709F447C60C94F4308631910509F4D9 -:1046F000B3C20CF4ADC28731910509F4B3C2489737 -:1047000009F4C6C20C94F4308E31910509F481C3CA -:1047100084F48B31910509F4DAC20CF4CAC28C31ED -:10472000910509F46CC34D9711F40C9443310C942A -:10473000F4308A32910509F472C44CF48F3191053A -:1047400009F4B7C3809709F468C30C94F4308B3430 -:10475000910509F498C48C34910511F00C94F4304F -:104760000E940FF10C9443318B36910509F4E5C595 -:104770000CF054C08535910509F4FFC58CF58235E0 -:10478000910509F4F0C514F58135910511F00C94EB -:10479000F4300E947E760E94434E10920C141092C8 -:1047A0000B1410920E1410920D14109210141092FB -:1047B0000F1468EE73E080E090E00E942A6F60E0E2 -:1047C0008EE793E00E941B700C9443318335910572 -:1047D00009F4CCC58435910509F4CCC50C94F430AA -:1047E0008836910509F457C47CF48C35910511F095 -:1047F0000C94F43011E6C12E12E0D12E07E9E02E20 -:1048000003E1F02E10E0D2C58936910509F411C5F7 -:104810008A36910509F46CC50C94F4308037910503 -:1048200009F4D2C484F48D36910509F443C50CF41F -:10483000C7C48E36910509F45DC48F36910509F41D -:104840006CC40C94F4308337910509F43BC17CF4BB -:104850008137910509F4C0C48237910511F00C9499 -:10486000F4300E942E4D0E94D55F0C944331853761 -:10487000910509F475C68637910511F00C94F43052 -:10488000009163141091641483E0D12C40E07DC644 -:104890008F3231E0930711F40C94E12E0CF073C0C9 -:1048A0008C3C910511F40C94712C9CF58B3991057D -:1048B00009F4DAC484F48937910509F40DC70CF4BE -:1048C00005C78C38910509F4F8C48139910509F4BC -:1048D00008C70C94F430883C910509F47AC74CF46D -:1048E0008E3B910511F00C94F4300E941A610C94E7 -:1048F0004331893C910509F4BCC78B3C910511F00B -:104900000C94F43061E6E62E62E0F62E00ED13E141 -:10491000D9C78D3D910511F40C941E2DA4F48E3C45 -:10492000910511F40C94E92C14F40C94E62C833DBD -:10493000910511F40C940E2D8C3D910511F40C94FD -:10494000112D0C94F4308C3251E0950711F40C9435 -:10495000612E64F4823E910511F40C948D2D883102 -:10496000914011F40C94B62D0C94F4308D32E1E0AA -:104970009E0711F40C948A2E8E32914011F40C94FF -:104980008D2E0C94F4308C3A31E0930711F40C9492 -:104990000B2D0CF04BC0803951E0950711F40C94AD -:1049A0000030ECF48E35B1E09B0711F40C94612FCC -:1049B0003CF48033914011F40C94E42E0C94F430C8 -:1049C0008F3521E0920711F40C94962F8336914095 -:1049D00011F00C94F430E0E7F2E10C94ED2F8A39F9 -:1049E00041E0940709F4F4C394F48139A1E09A07F3 -:1049F00011F40C9403308239914011F00C94F4308E -:104A000080E00E94F9340E94D55F0C944331843ACF -:104A1000E1E09E0711F40C940830853A914011F0C2 -:104A20000C94F4300E9412A90C944331883F31E079 -:104A3000930711F40C941D30ECF4853F51E0950779 -:104A400011F40C940B304CF4843F914011F00C9411 -:104A5000F4300E949AB30C944331863FE1E09E0704 -:104A600011F40C940E30873F914011F40C941130E6 -:104A70000C94F4308C3823E0920711F40C94C93074 -:104A800094F4833543E0940711F40C9440308B3850 -:104A9000934011F00C94F43081E6E82E82E0F82E79 -:104AA00010E00C94A830803AA3E09A0709F4F4C10E -:104AB000873E934011F40C94E1300C94F430EFE411 -:104AC000F5E0A6C5EDE6F4E0F0C4E0ECF2E082C06B -:104AD000A0906314B090641480E50E94E8388823A5 -:104AE00059F00E942C386B017C0111E0672B682B78 -:104AF000692B31F410E004C010E0C12CD12C7601F8 -:104B000083E50E94E838882311F40C94CD310E948B -:104B10006C3820E030E04AE754E40F9471080F94B9 -:104B2000A10D6B017C0111110BC0672B682B692B48 -:104B300039F4A114B10421F0F5018081811102C082 -:104B400010E001C011E00E942E4D112329F061E018 -:104B5000C5010E94557005C060E085E992E00E94A1 -:104B60001B7083E080932B1381E08093390DC11477 -:104B7000D104E104F104B1F00E94D7EDC60ED71EB6 -:104B8000E81EF91E0E94D7EDDC01CB018C199D09AE -:104B9000AE09BF09B7FF0DC08091390D81110C948A -:104BA000D23107C08091390D882319F00E94B2BF1D -:104BB000F9CF0E9409F41092390D0C94433160E052 -:104BC00088EA92E00E941B7017981698159814981E -:104BD0000C94433184918F010F5F1F4F882321F084 -:104BE0000E948339F801F6CF1092220D8DED9AE0E4 -:104BF0000E9476D08BE1EDEDFAE0DE011596019092 -:104C00000D928A95E1F78091DB0A9091DC0A9C83F2 -:104C10008B838BE792E09A83898340E050E0BE016A -:104C20006F5F7F4F80E090E00E94635BCE01019652 -:104C30000E9436BFE1EBF2E084918F010F5F1F4FBE -:104C4000882311F40C9443310E948339F801F4CF86 -:104C50000E94EA900C9443311092A50A1092A60A81 -:104C60000C944331E0916314F091641480818823A3 -:104C700029F0803209F410823196F8CF40E061E0EB -:104C800080916314909164140E94255E0C944331CA -:104C90008091A60A882319F081E08093A50A0E94DA -:104CA000ECF00C9443311092A50A0E940FF10C9481 -:104CB00043318091A60A882311F40C94433183E593 -:104CC0000E94E83881110C94D6310C94433183E46E -:104CD0000E949F38882309F450C0EEEFF2E08491DF -:104CE0008F010F5F1F4F882321F00E948339F80145 -:104CF000F6CF8091780C811103C0E1EDF2E012C093 -:104D0000BE016F5F7F4F85E79CE00E943ECF8E0122 -:104D10000F5F1F4FD8018D918D01882349F10E94AB -:104D20008339F8CF84918F010F5F1F4F882301F1E2 -:104D30000E948339F801F6CF26E5C22E23E0D22E59 -:104D4000E12CF12C20E08091070490E00E2C02C0B1 -:104D5000959587950A94E2F780FD0FC2BFEFEB1A95 -:104D6000FB0AE2E0CE0ED11CF5E0EF16F10459F794 -:104D70008AE00E9483390C9443318091A60A8823EB -:104D800039F08091A50A882319F0EBEDF2E003C019 -:104D9000EDEEF2E028C084918F010F5F1F4F882352 -:104DA00021F00E948339F801F6CF6091D50A709105 -:104DB000D60A8091D70A9091D80A4AE00E94743DA1 -:104DC0008FE20E9483396091D10A7091D20A80915A -:104DD000D30A9091D40A4AE00E94743D8AE00E946E -:104DE00083390C94433184918F010F5F1F4F8823C7 -:104DF00011F40C9443310E948339F801F4CF40E060 -:104E000060E080916314909164140E94255E0C947C -:104E100043310E9454690C9443318091A50A811159 -:104E20000E942E4D8091A60A882311F40C944331E0 -:104E300080E50E94E838882319F00E945D3803C09D -:104E400080E50E949F38182F482F61E080916314FD -:104E5000909164140E94255E83E50E94E8388823BF -:104E600081F00E943C38AB01BC014093D50A5093BD -:104E7000D60A6093D70A7093D80A85E79CE00E940F -:104E80002FCE8091A60A882319F081E08093A50A8D -:104E900011110C94433103CF8091631490916414E9 -:104EA00021E02093A40A40E060E00E94255E0C947B -:104EB00043310E940E7D7B018C0120E831E541E009 -:104EC00050E00F94FA0BC9016DE671E00F942C0FBE -:104ED0004B015C01C801B70120E13EE040E050E039 -:104EE0000F94FA0BCA01B90128E130E040E050E02C -:104EF0000F94FA0B762E672EC62ED72E3CE3232E68 -:104F0000312C412C512CC801B701A20191010F9401 -:104F1000FA0BF62EE72ECA01B901A20191010F94F6 -:104F2000FA0BCB018E010F5F1F4F8114910499F092 -:104F3000EF92FF927F936F936F927F92BF92AF92A7 -:104F40009F928F9285E393E09F938F931F930F938C -:104F50000F94A60713C0A114B104B1F0EF92FF9211 -:104F60007F936F936F927F92BF92AF9285E293E0AF -:104F70009F938F931F930F930F94A6070FB6F894E8 -:104F8000DEBF0FBECDBF30C0CD2879F0EF92FF92CB -:104F90007F936F936F927F9289E193E09F938F93BA -:104FA0001F930F930F94A607E9CF892B69F0EF9217 -:104FB000FF927F936F9381E193E09F938F931F9371 -:104FC0000F930F94A607DACFEF92FF928DE093E054 -:104FD0009F938F931F930F930F94A6070F900F909B -:104FE0000F900F900F900F9060E0C8010E945570D5 -:104FF000EFE9F2E184917F019FEFE91AF90A882332 -:1050000021F00E948339F701F5CFB80189E493E0DC -:105010000E9438588AE00E9483390C94433183E51A -:105020000E94E838882311F40C9443310E944C38D4 -:10503000E82E80E50E94E838882339F00E944C3839 -:10504000182F87FF03C00C9443311DE089E40E94B0 -:10505000E838882341F00E945D3881110C941132A8 -:10506000E9EAF5E00BC089E40E949F38F6CF31965B -:10507000A5E0E63DFA0711F40C941132849118135F -:10508000F6CF0C94E6310E94ECF00C9443310E9470 -:1050900023F10C94433188E690E00E94DF3D8111BA -:1050A0000C9443318091070483FF02C00C94433178 -:1050B00083E50E94E8388823C9F00E946C380F9479 -:1050C0009C0D70930A146093091480E00E9432765C -:1050D0000E946C3820E030E04AEA52E40F940C0859 -:1050E000181624F00E9423F10E9409F40E945358DC -:1050F0000C9443318EE40E94E838882311F40C9418 -:1051000043310E943C3860939109709392098093D7 -:105110009309909394090C94433183E50E949F383E -:10512000882359F083E50E94E838882319F00E940B -:105130004C3801C080E080930704EFE9F2E18491EC -:105140008F010F5F1F4F811103C0E4E6F3E004C03D -:105150000E948339F801F3CF84918F010F5F1F4FB5 -:10516000882321F00E948339F801F6CF809107044B -:105170008111E2CDE0E6F3E018C0BB24B394B20E97 -:10518000222319F08CE20E948339F60185919491D3 -:10519000FC0184918F010F5F1F4F882321F00E9433 -:1051A0008339F801F6CF2B2DD9CD84918F010F5F74 -:1051B0001F4F882309F4DCCD0E948339F801F5CF15 -:1051C000109213020C9443318BE693E00E9452BF7D -:1051D0000E9470AB0C94433183E50E94E838811142 -:1051E00003C0EFE9F2E10DC00E944C388D3320F48A -:1051F000809344020C9443318CE3809344020C94DA -:10520000433184918F010F5F1F4F882321F00E944B -:105210008339F801F6CF4091440250E060E070E03D -:1052200084E793E00E94E5578AE00E9483390C945A -:10523000433189E690E00E94DF3D811111C0EBE728 -:10524000F3E084918F010F5F1F4F882321F00E94AC -:105250008339F801F6CF0E942C758AE00E948339C9 -:1052600010922B130C94343283E50E94E838882383 -:1052700011F40C9443310E944C38182F8D3308F0F0 -:105280001CE3109338130E94D7ED6B017C01212F92 -:1052900030E0A8EEB3E00F94480CC60ED71EE81E0F -:1052A000F91EC0923413D0923513E0923613F09267 -:1052B0003713E9C70E94F362E6C78091070483FFB2 -:1052C00001C0E1C783E50E94E838882309F4DBC701 -:1052D0000E946C380F949C0D6639710514F066E9D4 -:1052E00070E070930814609307140E94E675CBC7B2 -:1052F00080E50E94E838882339F00E944C38182F46 -:10530000833008F0C0C701C010E083E50E94E83890 -:10531000882319F00E943C3802C06FEF70E0E12F43 -:10532000F0E06F3F710510F06FEF70E0EE0FFF1FC0 -:10533000E55FFB4E71836083A6C780E50E94E83875 -:10534000882339F00E943C386330710508F09BC710 -:1053500002C060E070E0660F771FFB01E55FFB4E67 -:105360001182108290C7109291038DC781E08093C3 -:10537000910389C70E94C16086C783E50E949F3858 -:10538000882309F480C70E946C3820E030E04AE7A7 -:1053900054E40F9471080F94A10D6093301370932F -:1053A000311380933213909333136DC7D6018D91CF -:1053B0006D010E949F38882309F46DC0133009F0F5 -:1053C00063C00E946C384B015C0120E030E040EA91 -:1053D00051E40F940C0887FF4EC0A5019401609121 -:1053E000A3137091A4138091A5139091A6130F9409 -:1053F000340D2B013C019B01AC0160919313709122 -:10540000941380919513909196130F947108609363 -:105410009313709394138093951390939613A30111 -:1054200092016091DC137091DD138091DE139091F5 -:10543000DF130F9471086093DC137093DD13809376 -:10544000DE139093DF1360911D0470911E04809110 -:105450001F04909120040F941008A30192010F944F -:1054600071080F94A10D60931D0470931E04809326 -:105470001F04909320048092A3139092A413A092EF -:10548000A513B092A61307C00E946C38F701608381 -:105490007183828393831F5FF4E0EF0EF11C14305D -:1054A00009F084CF0E94DE58EEC684918F010F5F11 -:1054B0001F4F882321F00E948339F801F6CF60E066 -:1054C0008DE594E00E94CEB261E086E594E00E9412 -:1054D000CEB261E08BE494E00E94CEB261E08BE357 -:1054E00094E00E94CEB260E082E394E00E94CEB2EB -:1054F00061E088E294E00E94CEB261E08EE194E047 -:105500000E94CEB261E086E194E00E94CEB261E0FA -:1055100088E094E00E94CEB260E08AEF93E00E94BF -:10552000CEB260E08BEE93E00E94CEB260E08DEDF3 -:1055300093E00E94CEB260E087EC93E00E94CEB28E -:1055400060E086EB93E00E94CEB260E081EA93E0F7 -:105550000E94CEB261E08EE893E00E94CEB293C684 -:105560008091631490916414DC012C91222321F02A -:1055700060E00E94557087C60E9409F484C6F80155 -:105580009081292F2B7F213419F08150C1F716C04B -:1055900021812133D1F7913421F0953421F441E078 -:1055A00002C0DD24D39498012E5F3F4F89012F5F05 -:1055B0003F4FD8019C919032C9F3E7CF442369F063 -:1055C000EFE9F2E184917F01BFEFEB1AFB0A882338 -:1055D00021F00E948339F701F5CFDD2069F0E3E384 -:1055E000F5E084917F012FEFE21AF20A882321F07F -:1055F0000E948339F701F5CFD8018D918D01882361 -:1056000009F4B6CB0E948339F7CF0E948339F801A1 -:1056100084918F010F5F1F4F8111F7CFE7E4F5E011 -:1056200084918F010F5F1F4F882321F00E948339DF -:10563000F801F6CF1E9903C001E413E002C00CE3A9 -:1056400013E0F80181918F01882319F00E948339BA -:10565000F8CF8AE00E948339EFE3F5E084918F016F -:105660000F5F1F4F882321F00E948339F801F6CF86 -:105670001D9903C001E413E002C00CE313E0D8015C -:105680008D918D01882319F00E948339F8CF8AE02B -:105690000E948339E7E3F5E084918F010F5F1F4F8C -:1056A000882321F00E948339F801F6CF379B03C08D -:1056B00001E413E002C00CE313E0F80181918F01D3 -:1056C000882309F455CB0E948339F7CF81E080937A -:1056D000BF0D8093BE0DD7C51092BF0D1092BE0DA9 -:1056E000D2C583E50E94E838882319F00E943C382F -:1056F00002C060E070E08B01112702301105D4F088 -:10570000E0E7F2E184918F010F5F1F4F811103C029 -:10571000E9E6F5E004C00E948339F801F3CF8491F3 -:105720008F010F5F1F4F882309F4ADC50E94833995 -:10573000F801F5CF88E40E94E8388823A9F00E9498 -:105740003C386A3A71053CF06530F1E07F072CF097 -:1057500064E071E002C06AEA70E0F801EE0FFF1F3A -:10576000E054FC4E7183608386E40E94E83888230D -:10577000A9F00E943C38F801EE0FFF1FEC53FC4EDD -:10578000718360836F3F710519F014F06FEF70E063 -:1057900077FF02C060E070E07183608382E40E9462 -:1057A000E838882309F46FC50E943C3865307105DC -:1057B00034F0683871052CF067E870E002C065E0ED -:1057C00070E0000F111FF801E454FC4E71836083F8 -:1057D0005AC588EC90E00E94DF3D811154C584E4F5 -:1057E0000E949F38882309F441C00E946C386B01E5 -:1057F0007C0111E020E030E0A9010F940C08811138 -:1058000001C010E010931E1320E030E0A901C70191 -:10581000B6010F940C08882349F10E946C38E0917E -:105820006A0D24E0E29FF0011124E65EFC4E6083E5 -:1058300071838283938320E030E0A90160911A1381 -:1058400070911B1380911C1390911D130F940C08E1 -:1058500081110CC080E090E0A0EEBFE380931A13AA -:1058600090931B13A0931C13B0931D130E94A28648 -:105870000AC571E6E72E72E0F72E0BE613E1EBE7BF -:10588000CE2EE3E1DE2ED7018D917D010E949F385F -:10589000882349F00E946C380F94A10DF8016083B1 -:1058A0007183828393830C5F1F4FC016D10659F713 -:1058B0000E948358E8C40C5F1F4FF3E1003E1F07AE -:1058C00009F4E1C4D7018D917D010E949F3888239E -:1058D00091F30E946C38F801608371838283938313 -:1058E000EACF83E50E94E8388823A1F00E946C3853 -:1058F000609383137093841380938513909386131E -:1059000060937B1370937C1380937D1390937E132D -:1059100010E001C011E080E50E94E838882359F0CA -:105920000E946C3860938313709384138093851363 -:105930009093861310E082E50E94E838882359F09E -:105940000E946C3860937F1370938013809381134F -:105950009093821310E084E50E94E838882359F080 -:105960000E946C3860937B1370937C1380937D133B -:1059700090937E1388C4112309F485C44091831346 -:1059800050918413609185137091861381E995E09D -:105990000E94025840917F135091801360918113AF -:1059A000709182138EE895E00E94025840917B131B -:1059B00050917C1360917D1370917E138BE895E07C -:1059C0000E9402588AE00E9483395DC40E944DB251 -:1059D0005AC441E6C42E42E0D42E51ECE52E5DE0DF -:1059E000F52E10E0D6018D916D010E949F3888231D -:1059F00051F00E946C38F701608371838283938336 -:105A0000812F0E9496351F5FF4E0EF0EF11C1330DA -:105A100049F70C9444230E940CA835C40E946FB12E -:105A200032C483E50E94E838882309F42CC40E941C -:105A30003C3870931B0260931A0225C48DED90E0F0 -:105A40000E94DF3D81111FC483E50E94E838811167 -:105A500003C0EFE9F2E13BC000916A0D10E00E9443 -:105A60003C38000F111FF801E85EFD4F7183608321 -:105A700080916A0D90E08C01000F111F000F111F23 -:105A800098012C5E3D4F7901880F991FFC01E85E5B -:105A9000FD4F60817181072E000C880B990B0F94CC -:105AA00012082AE037ED43E25CE30F947108F80135 -:105AB000E85AF04F20813181428153810F9471085F -:105AC000D7016D937D938D939C931397DCC3849141 -:105AD0008F010F5F1F4F882321F00E948339F80147 -:105AE000F6CF85E40E94833980916A0D805D0E9423 -:105AF0008339E0916A0DF0E0EE0FFF1FE85EFD4F85 -:105B00006081718181EA95E00E941F5885E20E94C0 -:105B100083398AE00E948339B6C380E50E949F38AA -:105B2000882309F4B0C30E943C386B017C0183E5F3 -:105B30000E94E838882321F00E943C388B0102C083 -:105B40000FEF1FEFC8010196039708F09CC3D7FC25 -:105B50009AC38C2DE9EAF5E09491891709F436C4CB -:105B60003196B5E0E63DFB07B9F733C480E50E9406 -:105B70009F38882309F487C30E943C386B017C015D -:105B80008B01672B19F0E0E7F2E17FC083E50E940B -:105B90009F38811103C0EFE9F2E107C00E943C3851 -:105BA00082E89AE00E94AD566EC384917F012FEF88 -:105BB000E21AF20A882321F00E948339F701F5CF17 -:105BC00060E070E08FEE95E00E941F588091840A9B -:105BD00028E532E06901C81AD10887FDD394CC0CBE -:105BE000DD1CCC0CDD1C0D2C000CEE08FF08809198 -:105BF000830A28E830E04901881A910887FD9394C8 -:105C0000880C991C880C991C092C000CAA08BB084C -:105C10008091820A8F3FB9F090E0FC01EE0FFF1FE8 -:105C20008E0F9F1FFC01EB5EF54F0181128153E047 -:105C3000000F111F5A95E1F764E0169507956A95D4 -:105C4000E1F70E5F1F4F98012F5F3F4FC901330FE0 -:105C5000AA0BBB0B9C01AD01281939094A095B0944 -:105C6000A4EBB0E00F94380CA7019601281939096C -:105C70004A095B090F941C0CB9018CEE95E00E9457 -:105C80001F588AE00E948339FEC284918F010F5F02 -:105C90001F4F882321F00E948339F801F6CFB60107 -:105CA00085EE95E00E941F58E6EDF5E084918F01A6 -:105CB0000F5F1F4F882309F4E6C20E948339F80161 -:105CC000F5CF83E50E94E838882319F00E943C381C -:105CD00002C064E071E079A368A380E50E94E8381F -:105CE000882339F00E943C38693833E1730730F477 -:105CF00002C068EE73E07A83698304C088E893E1A8 -:105D00009A838983BE01605E7F4FCE0101960E9417 -:105D10002C92B9C20E94CCB0B6C283E50E949F38D3 -:105D2000182F882371F00E946C380F949C0D70938B -:105D300001026093000221E0672B09F020E020932C -:105D4000060480E50E949F38882359F020910002C4 -:105D500030910102232B11F00E945D3880930604DC -:105D600092C2111190C2EFE9F2E184918F010F5FAD -:105D70001F4F882321F00E948339F801F6CF8091CC -:105D80000604882319F06EE373E002C06BE473E04D -:105D90008CE096E00E9438586091000270910102F8 -:105DA0008BEF95E00E941F58E7EFF5E084918F019B -:105DB0000F5F1F4F882309F466C20E948339F801E0 -:105DC000F5CF0E94ADAB5FC280E50E949F3888236B -:105DD00051F00E946C386093610D7093620D809356 -:105DE000630D9093640D89E40E949F38882381F0AD -:105DF0000E946C382CEA35EC47E25EE30F947108A0 -:105E000060935D0D70935E0D80935F0D9093600DB8 -:105E100084E40E949F38882381F00E946C382CEA29 -:105E200035EC47E25EE30F94340D6093590D7093A7 -:105E30005A0D80935B0D90935C0DEFE9F2E1849134 -:105E40008F010F5F1F4F882321F00E948339F801D3 -:105E5000F6CF4091610D5091620D6091630D70918C -:105E6000640D87E296E00E9402582CEA35EC47E286 -:105E70005EE360915D0D70915E0D80915F0D90917C -:105E8000600D0F94340DAB01BC0183E296E00E94DB -:105E900002582CEA35EC47E25EE36091590D7091AF -:105EA0005A0D80915B0D90915C0D0F947108AB01C0 -:105EB000BC018FE196E00E9402588AE00E9483397B -:105EC000E2C183E50E949F38811106C031E6E32ECE -:105ED00032E0F32E10E00EC010E00E944C38682F24 -:105EE000812F0E945EF21F5F1530B9F7EFCF1F5F61 -:105EF000143071F0D7018D917D010E949F38882365 -:105F0000B1F30E944C38682F812F0E945EF2EFCFD0 -:105F100082E40E949F38882331F00E944C38682F19 -:105F200084E00E945EF20E9437F1ADC183E50E94D9 -:105F3000E838882309F44BC00E944C38813049F07E -:105F4000823009F044C091E6E92E92E0F92E10E08B -:105F500023C021E6E22E22E0F22E10E0F70181912B -:105F60007F010E94E838882339F00E944C384FEFB7 -:105F7000682F812F0E94EFF11F5F143079F782E4C0 -:105F80000E94E838882319F10E944C384FEF682F9F -:105F90001BC01F5F143079F0D7018D917D010E94E5 -:105FA000E8388823B1F30E944C38482F6FEF812FD7 -:105FB0000E94EFF1EECF82E40E94E838882339F0A6 -:105FC0000E944C38482F6FEF84E00E94EFF10E944E -:105FD00037F159C10E948339F80184918F010F5F15 -:105FE0001F4F8111F7CFEBE2F6E084918F010F5F35 -:105FF0001F4F882309F447C10E948339F801F5CF68 -:106000000E942E4D40C181E0F4D40E94D55F3BC177 -:106010000E94AAA938C10E941EE535C10E94F6DD82 -:1060200032C183E50E949F38882321F00E945D38A9 -:1060300091E089270E94AE8A26C12093E5130E9431 -:106040003DDF1092E513882309F41DC1EFE9F2E169 -:1060500084918F010F5F1F4F811103C0EAE3F6E0C7 -:1060600004C00E948339F801F3CF84918F010F5F40 -:106070001F4F882309F407C10E948339F801F5CF27 -:106080008AE50E94E838811103C0EFE9F2E13BC0E4 -:106090000E946C386B017C0120E030E040EA51EC5A -:1060A0000F947E0E87FD0AC020E030E040EA51E404 -:1060B000C701B6010F940C0818161CF4E0E7F2E1D2 -:1060C0000CC0C092B20FD092B30FE092B40FF09216 -:1060D000B50FD9C00E948339F80184918F010F5FF9 -:1060E0001F4F8111F7CFE5E4F6E084918F010F5F38 -:1060F0001F4F882309F4C7C00E948339F801F5CFE8 -:106100000E948339F80184918F010F5F1F4F811125 -:10611000F7CFE5E6F6E084918F010F5F1F4F8823EC -:1061200021F00E948339F801F6CF4091B20F5091CF -:10613000B30F6091B40F7091B50F82E696E00E94A4 -:1061400002588AE00E9483399EC01F5F143059F0C4 -:10615000F70181917F01F3D78823B9F38DD7812F80 -:106160000E94A0F2F2CF82E4EAD7882321F084D7FC -:1061700084E00E94A0F283E5E2D7882309F483C07B -:1061800010E07AD7812F0E94A0F21F5F1530C9F767 -:106190007AC083E50E94E838882319F06DD78B0117 -:1061A00002C000E010E080E50E94E838882319F082 -:1061B00063D7CB0102C080E090E0B8010E9491F269 -:1061C00062C081E0809309021092C70F83E50E94AC -:1061D000E838882331F071D7811155C00E94F2F759 -:1061E00052C083E5ACD7F8CF0E9414964CC0F09013 -:1061F00065140E942E4D1091640F80E0ECD5FF20B5 -:1062000029F1EFE9F2E184918F010F5F1F4F88239D -:1062100021F00E948339F801F6CF84E50E9483398A -:106220006F2D70E080E090E04AE00E94743D80E2D3 -:106230000E948339E6E8F6E084918F010F5F1F4FDB -:10624000882309F10E948339F801F6CF10921114C6 -:10625000812FC1D5EFE9F2E184918F010F5F1F4FCC -:10626000882321F00E948339F801F6CF6091111440 -:1062700070E084E796E00E941F588AE00E9483390C -:1062800002C00E94149610922B130E94D5F7ECC006 -:10629000ABD70E94C9C2F7CF0E942E4D80E09BD59C -:1062A00080EA90E055D280E00E948A3975D211E0F0 -:1062B0001093BF0D88E543D7B82E89E540D7082F46 -:1062C0008AE53DD7A82EB11004C0011104C01A25DB -:1062D00005C0011102C010E001C01A2D0E947939D9 -:1062E00082E576D7882359F0F7D66B017C0120E050 -:1062F00030E0A9010F940C08882369F106C0C12C75 -:10630000D12C70EAE72E70E4F72E111104C0B11001 -:1063100002C0002389F1C0924D13D0924E13E09237 -:106320004F13F0925013A70196016091BE0F709128 -:10633000BF0F8091C00F9091C10F0F940C0887FF81 -:106340000AC019821A821B821C82BE016F5F7F4FB6 -:106350008DE493E130D3111105C0B11003C00111D8 -:1063600006C00AC080E00E94D7BC1123C1F381E0BF -:106370000E94D7BC111102C0AA2019F082E00E942D -:10638000D7BC14D48091BE0D8093BF0DECD183E0B7 -:10639000809343020E94D55F76CF11110C94A02503 -:1063A0000C9499250E94B2BF0C94C22565D6AB010E -:1063B000BC014093D50A5093D60A6093D70A7093D4 -:1063C000D80A85E79CE00E942FCE5DCF0E94F9FBA2 -:1063D0005ACF0E942E4DBC2C60E08C2D0E949CEC6C -:1063E0000F3FFFEF1F0759F48C2D0E9446EC31E060 -:1063F00020E0892B09F030E0032F122F05C0013077 -:10640000110561F401E010E08B2D0E9446EC80172D -:10641000910709F438CF0E94B2BFF6CF00E010E038 -:10642000F3CF61E0812F0E949CEC6E2D812F0E94A2 -:106430006EECF12CB701812F0E94D8EC163029F4B4 -:10644000F0920E14E0920D141ECF183029F4F09241 -:106450000C14E0920B1417CF123009F014CFF09205 -:106460001014E0920F140FCFC559DF4F0FB6F894F8 -:10647000DEBF0FBECDBFDF91CF911F910F91FF9077 -:10648000EF90DF90CF90BF90AF909F908F907F90D4 -:106490006F905F904F903F902F9008959091D10D05 -:1064A000E92FF0E0E353F24F80839F5F943018F4BC -:1064B0009093D10D02C01092D10D8091540F8F5F37 -:1064C0008093540F0895089580E090E0089580919E -:1064D000E8149091E914981759F0E92FF0E0E85981 -:1064E000FB4E80819F5F9F779093E91490E0089521 -:1064F0008FEF9FEF0895CF92DF92EF920F931F934C -:10650000CF93DF93CDB7DEB760970FB6F894DEBFB9 -:106510000FBECDBFE0901114E6EBFFE080859185C2 -:10652000A285B3854481558166817781008111817F -:106530002281338109831A832B833C834D835E83BD -:106540006F83788789879A87AB87BC871D861E866D -:106550001F86188AAE01475F5F4FBE016B5F7F4F9A -:10656000CE0101960E94E487CE010D966C010FE3E7 -:1065700012E022EC3FE0AE01475F5F4FBE016B5F70 -:106580007F4F0C970E94563F60960FB6F894DEBF7F -:106590000FBECDBFDF91CF911F910F91EF90DF9094 -:1065A000CF900895CF93FC0120812B33A1F020914F -:1065B000540F243080F4C62FBC018091D10DF0E639 -:1065C0008F9FC00111248D52924F0F94B60F8C2FC4 -:1065D00065DF81E001C080E0CF9108950F931F93A4 -:1065E000CF93DF93EC010E94D7ED0E811F812885A8 -:1065F0003985011511052105310559F52C85222311 -:10660000A9F13A8521502C8721E0230F2A874D8557 -:10661000241301C01A86FE0124E0329FE00DF11D13 -:10662000112406851785208931890A831B832C83D1 -:106630003D83DC01CB01800F911FA11DB11D8E8315 -:106640009F83A887B9878C819D81892B79F0769A61 -:106650000DC0DC01CB01801B910BA20BB30BB7FD6E -:1066600005C076981E821F8218861986DF91CF9109 -:106670001F910F910895CF92DF92EF92FF92609158 -:106680005C0F70915D0F072E000C880B990B0F9417 -:1066900012086B017C012DEB37E346E855EB0F94B4 -:1066A0007E0E87FD0AC02DEB37E346E855E3C701B0 -:1066B000B6010F940C0818164CF4A701960160E07F -:1066C00070E080E89FE30F94340D03C060E070E059 -:1066D000CB016093EA147093EB148093EC149093C5 -:1066E000ED1460915E0F70915F0F072E000C880B08 -:1066F000990B0F9412086B017C012DEB37E346E8F0 -:1067000055EB0F947E0E87FD0AC02DEB37E346E86C -:1067100055E3C701B6010F940C0818164CF4A701F5 -:10672000960160E070E080E89FE30F94340D03C0B1 -:1067300060E070E0CB016093EE147093EF148093EF -:10674000F0149093F114FF90EF90DF90CF900895A4 -:10675000BC0182E89AE00E94AD5667E771E080E0F4 -:1067600090E00C942A6F8091FE039091FF03A0911A -:106770000004B091010480933F0290934002A093E3 -:106780004102B09342028091FC039091FD039093EB -:106790001B0280931A02089580913F02909140025B -:1067A000A0914102B09142028093FE039093FF03B7 -:1067B000A0930004B093010480911A0290911B02EF -:1067C0009093FD038093FC0384E690E090931B027A -:1067D00080931A0208952F923F924F925F926F9288 -:1067E0007F928F929F92AF92BF92CF92DF92EF9261 -:1067F000FF920F931F93CF93DF93CDB7DEB72A9706 -:106800000FB6F894DEBF0FBECDBF2B013C012D8328 -:106810003E834F83588747015801DA86C9868091A5 -:106820003F0290914002A0914102B09142028983BF -:106830009A83AB83BC83D6011C9111960C9111975E -:1068400012963C90129713962C9020E030E0A9010C -:10685000612F702F832D922D0F940C0881110AC087 -:10686000E9E2FCE285919591A591B491182F092F49 -:106870003A2E2B2EA50194016091BE0F7091BF0F8F -:106880008091C00F9091C10F0F940C0887FF15C025 -:10689000812F902FA32DB22D80933F029093400221 -:1068A000A0934102B09342028092BE0F9092BF0F1C -:1068B000A092C00FB092C10F1EDEE985FA85C0809C -:1068C000D180E280F38020E030E0A901C701B60169 -:1068D0000F940C08811108C0C0903B02D0903C027C -:1068E000E0903D02F0903E02C0923F02D092400202 -:1068F000E0924102F09242024092B60F5092B70FDE -:106900006092B80F7092B90F8D819E81AF81B8856A -:106910008093BA0F9093BB0FA093BC0FB093BD0FA1 -:10692000EADD2091BE0F3091BF0F4091C00F509112 -:10693000C10FC501B4010F940C0887FF15C0812F4A -:10694000902FA32DB22D80933F0290934002A093ED -:106950004102B09342028092BE0F9092BF0FA0926C -:10696000C00FB092C10FC7DD0E942E4D89819A8160 -:10697000AB81BC8180933F0290934002A09341027F -:10698000B09342022A960FB6F894DEBF0FBECDBF79 -:10699000DF91CF911F910F91FF90EF90DF90CF90FB -:1069A000BF90AF909F908F907F906F905F904F902F -:1069B0003F902F900895CF92DF92EF92FF920F9326 -:1069C0001F936B01FC01E080F18002811381E6EBF3 -:1069D000FFE0248135814681578160817181828108 -:1069E0009381F9DE1F910F91FF90EF90DF90CF9090 -:1069F0000895BF92CF92DF92EF92FF920F931F9371 -:106A0000CF93DF93CDB7DEB728970FB6F894DEBFEC -:106A10000FBECDBF9091C00D981709F476C0B82E67 -:106A200080E090E0A0E2B1E48D839E83AF83B887DD -:106A3000C090B20FD090B30FE090B40FF090B50FAC -:106A400020E030E0A901C701B6010F940C0887FFD0 -:106A50000CC0A701960160E070E080E291E40F9421 -:106A6000570C6D837E838F83988720E030E048EC5D -:106A700053E46D817E818F8198850F947E0E181668 -:106A800044F480E090E0A8ECB3E48D839E83AF8370 -:106A9000B8872D813E814F8158856091BE0F7091DE -:106AA000BF0F8091C00F9091C10F0F940C0887FF0A -:106AB0000AC019821A821B821C82BE016F5F7F4F3F -:106AC000CE01059678DF6091B60F7091B70F809177 -:106AD000B80F9091B90F2091BA0F3091BB0F409130 -:106AE000BC0F5091BD0F19821A821B821C82E0904C -:106AF000BE0FF090BF0F0091C00F1091C10FFE01AB -:106B000031966F0168DEB092C00D80E028960FB616 -:106B1000F894DEBF0FBECDBFDF91CF911F910F91D3 -:106B2000FF90EF90DF90CF90BF9008950F931F9349 -:106B3000CF93DF9394E0899FE00111248E010A55E1 -:106B4000104FFE01EF53F24FDE01A75CBC4E2D91BA -:106B50003D914D915C9160817181828193810F940F -:106B6000580CF8016083718382839383FE01E25E97 -:106B7000F74F85919591A591B491FE01EB59F04F96 -:106B800080839183A283B383FE01E65DF74F8591F5 -:106B90009591A591B491C45EDD4F88839983AA83B2 -:106BA000BB83DF91CF911F910F9108950F931F9396 -:106BB000CF93DF93CDB7DEB72C970FB6F894DEBF37 -:106BC0000FBECDBFE6EBFFE080859185A285B38542 -:106BD00044815581668177810081118122813381D1 -:106BE00009831A832B833C834D835E836F8378876D -:106BF00089879A87AB87BC87AE01475F5F4FBE012D -:106C00006B5F7F4FCE0101960E94E48722EC3FE04C -:106C1000AE01475F5F4FBE016B5F7F4FCE010196B4 -:106C20000E943E4D2C960FB6F894DEBF0FBECDBF2E -:106C3000DF91CF911F910F9108952F923F924F9224 -:106C40005F926F927F929F92AF92BF92CF92DF92AC -:106C5000EF92FF920F931F93CF93DF93CDB7DEB7E1 -:106C600064970FB6F894DEBF0FBECDBF1A012B019B -:106C7000922EF32EC82ED12CF601E259F34DE49159 -:106C8000AA24A3941E160CF4A12CBB24B39420E0D8 -:106C900030E0A901C201B1010F947E0E18160CF06C -:106CA000B12CCC0CDD1CCC0CDD1CC6018A54904FE1 -:106CB0003C01FC01108211821282138277DFF30102 -:106CC0002082318242825382E090111420E030E031 -:106CD000A901B801892D9F2D0F940C0881110AC0BC -:106CE000F601EF5DF34D85919591A591B4918C01DD -:106CF0009A2EFB2EC801A92DBF2D898B9A8BAB8BA9 -:106D0000BC8B8091BE0F9091BF0FA091C00FB0912E -:106D1000C10F4091BA0F5091BB0F6091BC0F7091A1 -:106D2000BD0F0091B60F1091B70F2091B80F3091A1 -:106D3000B90F09831A832B833C834D835E836F8352 -:106D4000788789879A87AB87BC871D861E861F86B2 -:106D5000188AAE01475F5F4FBE016B5F7F4FCE0168 -:106D600001960E94E487CE010D966C018E010F5EA4 -:106D70001F4F22EC3FE0AE01475F5F4FBE016B5FEC -:106D80007F4F0C970E94563F0E942E4DAB1459F036 -:106D90008091D20D882319F01092D20D04C08AE0A0 -:106DA00099E00E9452BF64960FB6F894DEBF0FBE02 -:106DB000CDBFDF91CF911F910F91FF90EF90DF90AA -:106DC000CF90BF90AF909F907F906F905F904F90CB -:106DD0003F902F9008951F93CF93DF93CDB7DEB7E9 -:106DE0002C970FB6F894DEBF0FBECDBF882331F0CD -:106DF00020915C0F30915D0F232BA1F19091640FD6 -:106E0000891781F1182F0E942E4D8CE0E5E6F2E003 -:106E1000DE01119601900D928A95E1F7CE0101965F -:106E20000E94B8F51093640F111117C00E94A7C6F5 -:106E30008FE193E10E94AE878091271390912813F0 -:106E4000A0912913B0912A138093BE0F9093BF0F86 -:106E5000A093C00FB093C10F04C086EB9FE00E94C7 -:106E6000AE87A4DE2C960FB6F894DEBF0FBECDBF62 -:106E7000DF91CF911F91089580E0ADDF10925F0FF9 -:106E800010925E0F10925D0F10925C0F1092E31340 -:106E90001092E2131092E1131092E013E1E7FFE089 -:106EA00025E93FE080E090E0A0ECBFE7808391839C -:106EB000A283B38384839583A683B78380879187D6 -:106EC000A287B3873C962E173F0781F70895CF928C -:106ED000DF92EF92FF920F931F93CF93DF93CDB783 -:106EE000DEB72C970FB6F894DEBF0FBECDBF7B0187 -:106EF0008C01D42E9B01AC016091D3127091D412FD -:106F00008091D5129091D6120F940C08882309F421 -:106F100094C0C090640F80E05EDF20E030E0A90103 -:106F2000B701C8010F947E0E181624F0E12CF12C45 -:106F300000E010E0C701D8018093D3129093D412DF -:106F4000A093D512B093D6122DEB37E346E855EB5C -:106F5000B701C8010F947E0E87FD0AC02DEB37E301 -:106F600046E855E3B701C8010F940C0818164CF415 -:106F70009701A80160E070E080E89FE30F94340D72 -:106F800003C060E070E0CB016093950F7093960FA3 -:106F90008093970F9093980F80EF9FEFA9E7B4EC41 -:106FA0008093990F90939A0FA0939B0FB0939C0F8F -:106FB000CC2009F442C08091B60F9091B70FA091F8 -:106FC000B80FB091B90F89839A83AB83BC8380914A -:106FD000BA0F9091BB0FA091BC0FB091BD0F8D83E4 -:106FE0009E83AF83B8878091BE0F9091BF0FA09111 -:106FF000C00FB091C10F89879A87AB87BC8781E0AA -:10700000EADEDD20D1F04CE050E066EB7FE0CE011F -:1070100001960F94670F892B81F02C960FB6F89488 -:10702000DEBF0FBECDBFDF91CF911F910F91FF90BB -:10703000EF90DF90CF900C94D55F2C960FB6F8941C -:10704000DEBF0FBECDBFDF91CF911F910F91FF909B -:10705000EF90DF90CF9008958091930390919403E7 -:10706000009731F04AE050E060E070E00D944A068D -:1070700060E070E0CB0108958091930390919403B8 -:10708000009731F04AE050E060E070E00D941F0599 -:1070900060E070E0CB010895EFDF97FD0AC0ECDF00 -:1070A0006F3F71058105910509F02CF4E5DF862F0E -:1070B000089580E008958FEF089580919303909153 -:1070C0009403892B31F0E8DF91E0811103C090E057 -:1070D00001C091E0892F08950F931F93CF93809162 -:1070E0009303909194030097F1F0FC018F01C191FB -:1070F0002C2F2F7D89F0C53411F0C536B9F7F80172 -:10710000108260E070E00F94CC03F801C083562F2A -:10711000472F382F292F0BC060E070E0CF911F91CF -:107120000F910D94CC0350E040E030E020E0652F5B -:10713000742F832F922FCF911F910F910895815417 -:107140008A3108F042C0E82FF0E040915F1450917E -:107150006014609161147091621404C07695679513 -:10716000579547958A95D2F7842F817040FF2FC09D -:10717000EB5BFB4E9081992309F1E091A30FF09115 -:10718000A40FE90FF11D908120ED290F2A3098F00E -:107190009E3211F491810CC09D3211F09B3271F43A -:1071A000918120ED290F2A3030F09E3239F49281FE -:1071B00090539A3018F42E2F9F2F02C020E090E0B9 -:1071C0002093930390939403089580E00895089585 -:1071D000B6DF882341F081E020919303309194033E -:1071E000232B09F480E008959F92AF92BF92CF9233 -:1071F000DF92EF92FF920F931F93CF93DF9381E67D -:10720000A82E82E0B82E05E413E1C6EBDFE096EA93 -:10721000C92E9FE0D92E2EE8E22E23E0F22E912CEB -:10722000F50181915F018BDF882301F155DFF701C3 -:107230002081211104C020919203222339F028815A -:1072400039814A815B810F94580C0AC0F3E09F1684 -:1072500039F0F60120813181428153810F94570C1E -:10726000F801608371838283938309C08881998147 -:10727000AA81BB81F80180839183A283B383939415 -:107280000C5F1F4F2496F4E0CF0ED11C2FEFE21AB3 -:10729000F20A84E09812C4CF86E49ADF8823B9F01A -:1072A0001BDF20E030E0A9010F947E0E18167CF45D -:1072B00013DF20E030E040E752E40F94340D609398 -:1072C0003F02709340028093410290934202DF910B -:1072D000CF911F910F91FF90EF90DF90CF90BF90D3 -:1072E000AF909F900895FC01238121110C9419CF38 -:1072F000089580E1E6EBFFE0A5E4B3E101900D9293 -:107300008A95E1F708959091C00095FFFCCF809396 -:10731000C60008951F93CF93DF93882329F03799F0 -:1073200008C08AE090E002C08AE590E011DA10E03F -:107330004EC080EA90E00CDA8AE090E009DA8AE553 -:1073400090E006DA6CED75E080E090E00E942A6F34 -:10735000379BE7CFE0E7F2E18491EF0121968823A4 -:1073600019F0D1DFFE01F8CFE7EBF8E08491EF01EF -:107370002196882319F0C7DFFE01F8CF0E947E76A0 -:1073800010910902112311F1E0E7F2E18491EF017C -:107390002196882319F0B7DFFE01F8CFE0E4F8E08A -:1073A0008491EF012196882319F0ADDFFE01F8CF1B -:1073B00060E086E398E00E941B706EE571E080E07B -:1073C00090E00E942A6F1092090201C011E0812F03 -:1073D000DF91CF911F9108951F93CF93DF93CDB786 -:1073E000DEB728970FB6F894DEBF0FBECDBF698316 -:1073F0007A838B839C832D833E834F83588781E0E0 -:1074000089DF882311F081E02CC0BE016B5F7F4FC4 -:10741000CE010196D0DA8091D20D182F147082FF20 -:1074200004C080E077DF8111EECF1092D20D0E9470 -:10743000A7C68FE193E10E94AE87809127139091B8 -:107440002813A0912913B0912A138093BE0F909313 -:10745000BF0FA093C00FB093C10FA8DB81E0111143 -:1074600080E028960FB6F894DEBF0FBECDBFDF9147 -:10747000CF911F910895EF92FF921F93CF93DF93C7 -:107480007C0160E08FD8182F882399F0EFE9F2E1B2 -:107490008491EF012196882319F035DFFE01F8CFA2 -:1074A000B70188E996E00E94385882E22CDF8AE032 -:1074B0002ADF812FDF91CF911F91FF90EF900895E8 -:1074C000DF92EF92FF920F931F93CF93DF93CDB78D -:1074D000DEB76E970FB6F894DEBF0FBECDBF6091DA -:1074E000A00F7091A10F6115710541F14DE150E0C0 -:1074F000CE0101967C010F947D071E8EF7018F014E -:107500000E191F09D190DD2019F09AE0D912F7CF9A -:10751000F701E00FF11F1082C701ADDF882371F082 -:10752000DD20A9F00F5F1F4F8091A00F9091A10F58 -:10753000080F191F1093A10F0093A00F81E0209155 -:10754000A00F3091A10F232B29F480E003C000E0AD -:1075500010E0F0CF6E960FB6F894DEBF0FBECDBF31 -:10756000DF91CF911F910F91FF90EF90DF900895E1 -:107570002F923F924F925F926F927F928F929F9243 -:10758000AF92BF92CF92DF92EF92FF920F931F9331 -:10759000CF93DF93CDB7DEB7C056D1090FB6F894BD -:1075A000DEBF0FBECDBF8CDF811184C28091540F2E -:1075B000843008F048C00E946732AC0197FF92C146 -:1075C00042C08E3409F0EFC10115110509F4EBC179 -:1075D00065ED77E0C8010F948C077C01892B09F4D5 -:1075E000A4C16EE470E0C80104960F94A20F009746 -:1075F00009F49BC14AE050E060E070E001960F940E -:107600001F0560939503709396038093970390935F -:1076100098038090910990909209A0909309B0905E -:1076200094092FEF821A920AA20AB20A6815790504 -:107630008A059B0509F47BC1EF2809F078C182EA2D -:1076400097E00E94315B8091A50A882309F432C239 -:107650008091540F811102C01092FB036624639441 -:107660004091D50A5091D60A6091D70A7091D80AF4 -:107670008091D10A9091D20AA091D30AB091D40AF4 -:10768000481759076A077B0708F4612C00E010E0EF -:10769000CE0101966C013324339480E6282E9EEDB2 -:1076A000492E97E0592E8091540F843008F002C281 -:1076B000611000C28091FB038111FCC180917D0C9F -:1076C00090917E0CA0917F0CB091800C8093D50A94 -:1076D0009093D60AA093D70AB093D80A41E050E01D -:1076E000B60185E79CE00E94A0D1019719F4898139 -:1076F00090E002C08FEF9FEF782E8090D50A909097 -:10770000D60AA090D70AB090D80A4091D10A5091D9 -:10771000D20A6091D30A7091D40A662463948416C5 -:107720009506A606B70608F4612C84169506A606EB -:10773000B706B0F4019609F472C08AE0781609F42D -:107740009FC09DE0791609F49BC023E2721619F0E0 -:107750008AE37812ADC08091FA038111A9C085C077 -:107760000E942E4D85E79CE00E9419CF5092A10FF8 -:107770004092A00FA5DE8091900C882361F181508A -:107780008093900C2DE8289FC001112441E061E016 -:107790008B56934F0E94255EE091900C84E0E89F09 -:1077A000F0011124EF56F34F4081518162817381C2 -:1077B0004093D50A5093D60A6093D70A7093D80A9B -:1077C00085E79CE00E942FCE8091A60A8823B9F01D -:1077D0003092A50A14C01092A50A0E94434E0E943E -:1077E00023F10E940E7D6D3371058105910538F0FE -:1077F0008AED97E09093A10F8093A00F61DE8091B6 -:10780000A50A811136C0E7EFF7E084917F019FEF71 -:10781000E91AF90A882349F176DDF701F6CFE0E7A6 -:10782000F2E184917F012FEFE21AF20A882319F026 -:107830006ADDF701F6CFE8EEF7E084917F019FEF74 -:10784000E91AF90A882319F05EDDF701F6CF84EE14 -:1078500097E09F938F93DF92CF920F94A607C60174 -:107860000ADE0F900F900F900F9083E2781208C0FD -:1078700005C023E272121BC100E010E03092FB034E -:107880001092FA030115110519F40E94DE790DC05A -:107890008091D10D289E000D111D1124F801ED528B -:1078A000F24F108280E00E944E3200E010E0FBCEEA -:1078B0000F35110508F0F7CE9BE3791202C0309224 -:1078C000FA038091FA038111EECE8091D10DF80177 -:1078D000289EE00DF11D1124ED52F24F70820F5FD2 -:1078E0001F4FE1CE982F20918F09309190098A3057 -:1078F00019F09D3009F0A9C01092F9032115310546 -:1079000019F40E94DE7952CEF901E756FC4F10823D -:107910001092900910928F0909E913E0F801819102 -:10792000803209F04ECE8F01F9CFC80163CE6AE2F2 -:1079300070E0C8010F94DA0F9C01009701F1982FB5 -:10794000901BF12C992339F09150F801E90FF11DAA -:107950008081F826F7CF4AE050E060E070E0C9018E -:1079600001960F941F05CF2CD12CE12CF12C6C1516 -:107970007D058E059F0531F083E897E062CE89E5AD -:1079800097E05FCE8091950390919603A091970325 -:10799000B09198038093910990939209A0939309D1 -:1079A000B093940907C08091A30A882319F08FE24D -:1079B00097E047CE80910902811122C067E470E010 -:1079C000C8010F94A20F0097D9F04AE050E060E0A0 -:1079D00070E001960F941F056430710588F4E8EBA0 -:1079E000F6E084917F019FEFE91AF90A882319F0E4 -:1079F0008ADCF701F6CF60E08EEA96E00E941B7009 -:107A00006FE473E0C8010F94AD0F892B21F410923D -:107A100013021092390D64E573E0C8010F94AD0FA5 -:107A2000892B21F485EA96E00E9452BF69E573E054 -:107A3000C8010F94AD0F892B11F40E9470AB61E067 -:107A400089E993E00E94D232B1CD2F3531050CF097 -:107A5000ADCD9C35C1F40E94673297FDA7CD209132 -:107A6000F9032111A3CD20918F0930919009A9012B -:107A70004F5F5F4F5093900940938F09F901E7568C -:107A8000FC4F808393CD9B3319F481E08093F903FD -:107A90008091F90381118ACDC901019690939009D3 -:107AA00080938F09F901E756FC4F40837FCD1092F8 -:107AB000FA03EBCEC05ADF4F0FB6F894DEBF0FBE0D -:107AC000CDBFDF91CF911F910F91FF90EF90DF908D -:107AD000CF90BF90AF909F908F907F906F905F906E -:107AE0004F903F902F9008958F929F92AF92BF92A8 -:107AF000EF92FF920F931F93CF93DF93CDB7DEB733 -:107B0000A0970FB6F894DEBF0FBECDBF611571050B -:107B10008105910589F100E0842E912CA12CB12CD6 -:107B2000102FEE24E394F12CEC0EFD1EE00EF11C60 -:107B300007FDFA94A50194010F94FA0BF7016083F5 -:107B4000B901CA010F5F611571058105910541F702 -:107B50001F3F21F1E1E0F0E0EC0FFD1FE10FF11D0F -:107B600017FDFA9580818A3010F097E301C090E309 -:107B7000890FC9DB1150ECCF80E3A0960FB6F894C3 -:107B8000DEBF0FBECDBFDF91CF911F910F91FF9050 -:107B9000EF90BF90AF909F908F90B5CBA0960FB60F -:107BA000F894DEBF0FBECDBFDF91CF911F910F9133 -:107BB000FF90EF90BF90AF909F908F900895EF92BD -:107BC000FF920F931F93CF93DF937C0184E500DB3B -:107BD000D82F882321F160DAC82F1816E4F4EFE9D2 -:107BE000F2E184918F010F5F1F4F882319F08BDB27 -:107BF000F801F7CF8DE487DBB70180E090E04AE041 -:107C000073DF6C2FCC0F770B8BE098E00E941F582E -:107C10008AE079DB08C080936A0DD0E004C08091CF -:107C2000111480936A0D8D2FDF91CF911F910F91C9 -:107C3000FF90EF900895CF92DF92EF92FF926B0149 -:107C40007C0197FF0AC08DE25EDBF094E094D09453 -:107C5000C094C11CD11CE11CF11C4AE0C701B60153 -:107C6000FF90EF90DF90CF903FCF8F929F92AF9297 -:107C7000BF92CF92DF92EF92FF92CF936B017C0184 -:107C8000B42E20E030E0A9010F940C0887FF06C055 -:107C90008DE239DBF7FAF094F7F8F094C0E060E099 -:107CA00070E080E09FE3CB1541F02DEC3CEC4CEC18 -:107CB0005DE30F947108CF5FF6CF9B01AC01C70164 -:107CC000B6010F94580C6B017C010F94A10D4B0170 -:107CD0005C014AE009DFCC2379F1C501B4010F94BE -:107CE00010089B01AC01C701B6010F94570C6B0142 -:107CF0007C018EE208DB20E030E040E251E4C70185 -:107D0000B6010F9471084B015C010F949C0D6B013F -:107D1000770FEE08FF08C701B6018DDFC701B60176 -:107D20000F9412089B01AC01C501B4010F94570CCC -:107D30006B017C01C150F9F6CF91FF90EF90DF907D -:107D4000CF90BF90AF909F908F9008958F929F9209 -:107D5000AF92BF92CF92DF92EF92FF920F931F9359 -:107D6000CF93DF93E1EFF8E08491EF012196882330 -:107D700019F0C9DAFE01F8CFC12CD12C7601C0E090 -:107D800080E2C1DACF5FC630D9F7C701B60153DF51 -:107D90008FEFC81AD80AE80AF80A93E0C916D10486 -:107DA000E104F10461F78AE0AEDA01E71FE0C12CDB -:107DB000D12C760180E2A7DAC701B6013CDFC0E032 -:107DC000D0E080E2A0DAF801EC0FFD1F8080918006 -:107DD000A280B380A5019401C501B4010F94040FE2 -:107DE000811110C020E030E0A901C501B4010F9459 -:107DF0007E0E87FD02C08BE286DA43E0C501B40146 -:107E000034DF08C0B12C80E27EDAB3948DE396E0D3 -:107E1000B912FACF2C96C432D10599F68AE073DAFA -:107E20008FEFC81AD80AE80AF80A0C5F1F4F93E0D0 -:107E3000C916D104E104F10409F0BCCF8AE0DF9156 -:107E4000CF911F910F91FF90EF90DF90CF90BF9057 -:107E5000AF909F908F9057CA1F920F920FB60F92BC -:107E600011240BB60F922F938F939F93EF93FF9351 -:107E70002091E914E091E81481E08E0F8F779091C2 -:107E8000C600281729F0F0E0E859FB4E9083E82F50 -:107E9000E093E814FF91EF919F918F912F910F90B4 -:107EA0000BBE0F900FBE0F901F9018952F923F9210 -:107EB0004F925F926F927F928F929F92AF92BF92FA -:107EC000CF92DF92EF92FF920F931F93CF93DF93A6 -:107ED000CDB7DEB7C956D1090FB6F894DEBF0FBED5 -:107EE000CDBFE091660DF091670DEF2B09F0FCC757 -:107EF000DEAECDAEE9AE79016A015B01FC012091F5 -:107F00009713309198134091991350919A1360816F -:107F10007181828193810F9471080F94890EA196CB -:107F20006CAF7DAF8EAF9FAFA19720919B13309127 -:107F30009C1340919D1350919E13D5016D917D919D -:107F40008D919C910F9471080F94890EA5966CAF3A -:107F50007DAF8EAF9FAFA59720919F133091A01357 -:107F60004091A1135091A213F60160817181828129 -:107F700093810F9471080F94890EA9966CAF7DAF11 -:107F80008EAF9FAFA9972091A3133091A413409176 -:107F9000A5135091A613D7016D917D918D919C9160 -:107FA0000F9471080F94890E2B966CAF7DAF8EAF36 -:107FB0009FAF2B978091070483FF0EC02B964CAC8C -:107FC0005DAC6EAC7FAC2B974092110A5092120AB6 -:107FD0006092130A7092140AD8013C9011964C904A -:107FE00011974DA612965C90129759AA13962C9051 -:107FF0008091EF099091F009891B8F708F3019F4EF -:108000000E94B2BFF5CF6090EF09AA966FAEAA9713 -:108010008091EF09082F10E01CA30BA38091050AA3 -:108020009091060AA091070AB091080AA1968CAC1B -:108030009DACAEACBFACA197881A990AAA0ABB0A3C -:108040008091090A90910A0AA0910B0AB0910C0A3A -:10805000A5964CAC5DAC6EAC7FACA597481A590A9E -:108060006A0A7B0A4DA25EA26FA278A680910D0AD1 -:1080700090910E0AA0910F0AB091100AA9964CACEB -:108080005DAC6EAC7FACA997481A590A6A0A7B0AA4 -:1080900049A65AA66BA67CA68091110A9091120A55 -:1080A000A091130AB091140A2B964CAC5DAC6EAC47 -:1080B0007FAC2B97481A590A6A0A7B0A09F499C0BF -:1080C00080910604811139C06091D7127091D81245 -:1080D0008091D9129091DA120F949C0D2091000298 -:1080E000309101026217730744F52B964CAC5DACDE -:1080F0006EAC7FAC2B974092110A5092120A60929C -:10810000130A7092140AEFE9F2E184918F010F5F74 -:108110001F4F811103C0E7E3F9E003C0F4D8F80171 -:10812000F4CF84918F010F5F1F4F882319F0EBD894 -:10813000F801F7CF412C512C320139AD24E0329FA8 -:10814000800111240C5E1D4FC301B2010F9412086F -:10815000D8012D913D914D915C910F9471086B0167 -:108160007C0120E030E0A9010F947E0E87FF04C05F -:10817000F7FAF094F7F8F0946091A3137091A413B8 -:108180008091A5139091A6130F949C0D9B01AC01B7 -:10819000A8ECB0E00F94380C0F941208A7019601D8 -:1081A0000F940C0887FF28C02B964CAC5DAC6EACCE -:1081B0007FAC2B974092110A5092120A6092130AD8 -:1081C0007092140AEFE9F2E184918F010F5F1F4F63 -:1081D000811103C0E8E1F9E003C095D8F801F4CFBC -:1081E00084918F010F5F1F4F882319F08CD8F801FD -:1081F000F7CF412C512C3201D501C4018827B7FD9E -:1082000083959927AA27BB27182F2DA13EA14FA1FF -:1082100058A557FD126089A59AA5ABA5BCA5B7FDC9 -:10822000146077FC186009ADA4E00A9FC001112416 -:108230009C012C5E3D4F7901C301B2010F941208DD -:10824000D7012D913D914D915C910F9471086B0177 -:108250007C0120E030E0A9010F947E0E87FF04C06E -:10826000C701B601905802C0C701B60120E030E056 -:1082700040E05FE30F94580C0F94A10D6DAB7EAB03 -:108280008FAB98AF81E54BA05CA0849DF001859DEC -:10829000F00D1124EF5CFB4F108216ABB501A40169 -:1082A000B7FE07C044275527BA01481959096A097A -:1082B0007B0981E56BA07CA0869DF001879DF00D78 -:1082C0001124EF5CFB4F458B568B678B708F8DA114 -:1082D0009EA1AFA1B8A5B7FF07C0B095A095909596 -:1082E00081959F4FAF4FBF4F21E50BA11CA1209F50 -:1082F000F001219FF00D1124EF5CFB4F818F928FD5 -:10830000A38FB48F09A51AA52BA53CA537FF07C0DD -:1083100030952095109501951F4F2F4F3F4FE1E568 -:108320007E2E4BA05CA0749CF001759CF00D112476 -:10833000EF5CFB4F058F168F278F30A34DA85EA8EB -:108340006FA878AC41A252A263A274A23A01F62FA0 -:10835000E72F481759076A077B0718F43C01FA2FE3 -:10836000EB2FC301AF2FBE2F80179107A207B307D2 -:1083700010F4D901C8014DA85EA86FA878AC841587 -:108380009505A605B70510F4D301C20121E56BA040 -:108390007CA0269DF001279DF00D1124EF5CFB4F82 -:1083A00085A396A3A7A3B0A70697A105B10508F4D6 -:1083B00094C5DF01A95BBF4F80910B1490910C1401 -:1083C00011969C938E93129680910D1490910E1499 -:1083D00011969C938E93129680910F149091101485 -:1083E0008D939C9379AC71A6452B462B472B09F0B6 -:1083F000179881E50BA11CA1809FF001819FF00DD2 -:108400001124EF5CFB4F818D928DA38DB48D892B50 -:108410008A2B8B2B09F0169881E54BA05CA0849DDC -:10842000F001859DF00D1124EF5CFB4F858D968D3D -:10843000A78DB0A1892B8A2B8B2B09F015984DA8FD -:108440005EA86FA878AC45284628472809F44EC591 -:1084500080910C04882319F0815080930C0459AC4E -:10846000511004C0149880E280930C046090CC13E7 -:108470007090CD130091CE131091CF139301A801EA -:10848000632D7DA589A9922D0F940C0887FF04C048 -:10849000362C7DA609AB212EC501B4010F9412081C -:1084A000209121043091220440912304509124040E -:1084B0000F94710869AF7AAF8BAF9CAF698B7A8BE1 -:1084C0008B8B9C8B6DA17EA18FA198A50F94120818 -:1084D00020912504309126044091270450912804CE -:1084E0000F9471082B013C016D8B7E8B8F8B988FC5 -:1084F00069A57AA58BA59CA50F9412082091290443 -:1085000030912A0440912B0450912C040F9471084F -:108510004B015C01698F7A8F8B8F9C8F20912D048A -:1085200030912E0440912F0450913004C701B601C0 -:108530000F9471086B017C016D8F7E8F8F8F98A3D4 -:1085400081E50BA11CA1809FF001819FF00D1124FA -:10855000EF5CFB4F85899689A789B08D0697A105A9 -:10856000B10508F4CCC4ADADBEADCD90DD90ED90BD -:10857000FC9020E030E0A901C701B6010F940C087F -:108580008111E5C429AD3AAD4BAD5CADCA01B9016D -:108590000F9471086B017C01A3019201C301B20128 -:1085A0000F9471089B01AC01C701B6010F94580CE0 -:1085B0006B017C01A5019401C501B4010F94710800 -:1085C0009B01AC01C701B6010F94580C0F94C30E68 -:1085D00021E54BA05CA0249DF001259DF00D112408 -:1085E000EF5CFB4F658776878787908B81E50BA1D2 -:1085F0001CA1809FF001819FF00D1124EF5CFB4FC7 -:10860000258536854785508960E070E080E89FE3E6 -:108610000F94340D23966CAF7DAF8EAF9FAF239731 -:10862000232D3DA549A9522D0F9471084B015C01E2 -:108630008091EF099091ED09891B8F708DAFA50195 -:10864000940160E074E284E799E40F94340D0F9490 -:10865000890E6B017C018DAD8250863008F486C492 -:1086600080916F00982F927081FF05C080916F00FC -:108670008D7F80936F0040912D0D50912E0D609154 -:108680002F0D7091300DC40ED51EE61EF71EC09240 -:108690002D0DD0922E0DE0922F0DF092300D9923DA -:1086A00029F080916F00826080936F0081E56BA05C -:1086B0007CA0869D8001879D100D11240F5C1B4FAF -:1086C000D8011D964D905D906D907C9050976B9663 -:1086D0004CAE5DAE6EAE7FAE6B97A5019401C3014B -:1086E000B2010F9471089B01AC010F9471082F9691 -:1086F0006CAF7DAF8EAF9FAF2F97F8016183728310 -:108700008383948345A056A067A070A44DA65EA65F -:108710006FA678AAC301B2010F94100869AB7AABB7 -:108720008BAB9CAB9B01AC01C501B4010F947108EC -:108730000F941E0D0F94A10D63966CAF7DAF8EAF9D -:108740009FAF6397F80167AB70AF81AF92AF8E01B7 -:108750000F5E1F4F25961FAF0EAF259700511109D1 -:108760001AAF09AF00ED13E16D961FAF0EAF6D9715 -:108770008E010F5D1F4F1AA309A349AC5AAC659631 -:108780005FAE4EAE6597212C312C00E80DA31FE3A0 -:1087900019A72596AEADBFAD25972D913D914D9171 -:1087A0005D912596BFAFAEAF2597C501B4010F947B -:1087B00071086B017C016596EEADFFAD6597619325 -:1087C0007193819391936596FFAFEEAF659720E02B -:1087D00030E0A9010F947E0E87FF04C0F7FAF094F1 -:1087E000F7F8F0946D96AEADBFAD6D974D905D907E -:1087F0006D907D906D96BFAFAEAF6D97A70196015E -:10880000C301B2010F940C0887FDEAC349A05AA026 -:1088100025966EAC7FAC25974614570409F0B9CF66 -:1088200020E030E040E85FE3B1018DA199A50F940D -:108830000C0887FF4EC07E0101E1E00EF11C09AD7E -:108840001AAD91014DA159A5D8016D917D918D91E0 -:108850009C910F947108F8016193719381939193A6 -:108860008F01EE16FF0669F781E54BA05CA0849DA1 -:108870008001859D100D11240F5C1B4F63966CAD1C -:108880007DAD8EAD9FAD63970F94100891014DA102 -:1088900059A50F9471080F94A10DD801D7966D9327 -:1088A0007D938D939C93DA9791014DA159A5B101C8 -:1088B0008DA199A50F9471082F962CAD3DAD4EADAD -:1088C0005FAD2F970F947108F801618372838383E2 -:1088D000948329A93AA94BA95CA923966CAD7DADD7 -:1088E0008EAD9FAD23970F9471086DA37EA38FA3C8 -:1088F00098A781E54BA05CA0849DF001859DF00DBB -:108900001124EF5CFB4F85889688A788B08C811472 -:108910009104A104B10409F479C34DA85EA86FA81D -:1089200078AC45284628472809F493C3209183133F -:108930003091841340918513509186136DA17EA1CF -:108940008FA198A50F9471080F941E0D0F94A10D7F -:108950006B017C0180910D0490910E04A0910F0495 -:10896000B09110044DA45EA46FA478A88415950559 -:10897000A605B70508F418C481149104A104B10434 -:1089800009F070C381E56BA07CA0869DF001879DF6 -:10899000F00D1124EF5CFB4F818C928CA38CB48C76 -:1089A00081149104A104B10409F083C381E50BA1F2 -:1089B0001CA1809FF001819FF00D1124EF5CFB4F03 -:1089C000858C968CA78CB0A081149104A104B1046D -:1089D00009F098C381E54BA05CA0849DF001859DC2 -:1089E000F00D1124EF5CFB4F81A092A0A3A0B4A0D6 -:1089F00081149104A104B10409F0ADC381E56BA019 -:108A00007CA0869D8001879D100D11240F5C1B4F5B -:108A1000F801ED5BFF4FC082D182E282F382C70191 -:108A2000B6010F9410086B017C012DA13EA14FA14E -:108A300058A50F94340D2F966CAF7DAF8EAF9FAFBE -:108A40002F97D80151966D937D938D939C93549756 -:108A50002DEB37E346E051E4C701B6010F947108EE -:108A60000F94A10DF80162AB73AB84AB95AB418061 -:108A700052806380748027964CAE5DAE6EAE7FAE42 -:108A80002797C301B2010F94C30E362E272E8C01F7 -:108A9000E7E8F3E16196FFAFEEAF61973E01F1E1E8 -:108AA0006F0E711C27E833E121963FAF2EAF21975F -:108AB00049AC5AAC6DA379A78DA719AB1DAAD201F9 -:108AC000CD90DD90ED90FD902D0120E030E0A901EA -:108AD000C701B6010F947E0E87FF04C0F7FAF09429 -:108AE000F7F8F0942196EEADFFAD2197819091902B -:108AF000A190B1902196FFAFEEAF2197A70196010B -:108B0000C501B4010F940C0887FD6BC4641475048F -:108B1000B1F64DAC442009F4DDC4C090F109D09009 -:108B2000F209E090F309F090F4092DEB37E346E801 -:108B300055E3C701B6010F940C0887FDCBC4C701EC -:108B4000B6010F94C30E6B017C019B01AC01632D38 -:108B5000722DC8010F940C0887FD03C03C2C2D2CEE -:108B600087019601A701632D722DC8010F94340D62 -:108B700067966CAF7DAF8EAF9FAF679725EF39E0FB -:108B800021963FAF2EAF2197412C512C30E8632E18 -:108B90003FE3732E4DAA5EAA6FAA78AE1DAE219652 -:108BA000AEADBFAD21972D913D914D915D91219637 -:108BB000BFAFAEAF219767966CAD7DAD8EAD9FAD6B -:108BC00067970F9471084B015C01E9ADFAADC19054 -:108BD000D190E190F190FAAFE9AF4DAC442091F023 -:108BE0002DA93EA94FA958AD0F9471084B015C0106 -:108BF0002DA93EA94FA958ADC701B6010F94710820 -:108C00006B017C01A7019601C501B4010F947E0E92 -:108C100020E030E0A90118160CF029C4C701B60104 -:108C20000F947E0E18160CF41DC420E030E0A9014C -:108C3000C501B4010F940C0887FD14C42601370147 -:108C400077FA709477F87094A3019201C501B4018A -:108C50000F947E0E181614F4240135016196AEAD02 -:108C6000BFAD6197CD90DD90ED90FD906196BFAF67 -:108C7000AEAF6197A3019201C701B6010F940C0832 -:108C800087FF15C0A3019201C701B6010F94340DEF -:108C90009B01AC016DA97EA98FA998AD0F947108B5 -:108CA0006DAB7EAB8FAB98AFBDADBF5FBDAFE5E049 -:108CB000FAE021964EAC5FAC2197E415F50509F07A -:108CC0006ECF5DAC552061F02DA93EA94FA958ADDE -:108CD000632D722DC8010F947108362E272E8C013A -:108CE00024EA30E74DE75FE3632D722DC8010F944E -:108CF00071086B017C0120910804309109044091B6 -:108D00000A0450910B040F940C0887FDD9C38DA160 -:108D100099A5ADA5B9A98093080490930904A093DF -:108D20000A04B0930B0421E56BA07CA0269DC00132 -:108D3000279D900D11249C012F5C3B4F7901232D21 -:108D4000322DA801632D722DC8010F947108D7012F -:108D500019966D937D938D939C931C978BE097ED63 -:108D6000A3E2BBE3F70185839683A783B0871081D5 -:108D70002F966CAD7DAD8EAD9FAD2F9790589B011A -:108D8000AC010F94580C6B962CAD3DAD4EAD5FAD64 -:108D90006B970F9471089B01AC016BE077ED83E258 -:108DA0009BE30F94570C9B01AC0127966CAD7DADF6 -:108DB0008EAD9FAD27970F940C0818160CF48FC337 -:108DC00083E0182B81E54BA05CA0849DF001859D7C -:108DD000F00D1124EF5CFB4F108380E1FE01319612 -:108DE000A5EFB9E001900D928A95E1F727964CAC7A -:108DF0005DAC6EAC7FAC27974092F1095092F209BE -:108E00006092F3097092F409A1964CAC5DAC6EAC23 -:108E10007FACA1974092050A5092060A6092070A19 -:108E20007092080AA5964CAC5DAC6EAC7FACA59771 -:108E30004092090A50920A0A60920B0A70920C0A38 -:108E4000A9964CAC5DAC6EAC7FACA99740920D0A74 -:108E500050920E0A60920F0A7092100A2B964CAC38 -:108E60005DAC6EAC7FAC2B974092110A5092120A07 -:108E70006092130A7092140A9091EF098091F009A0 -:108E8000981303C084E68093EC09AA968FADAA9745 -:108E90008F5F8F708093EF098091EF099091EE09B9 -:108EA00081508F7089131DC3D090F0098090EF0915 -:108EB00021E5D810A4C3212C312C412C512C1BA20C -:108EC0001DA2712C612C00E010E0E12CF12C8D1022 -:108ED000A3C30115110509F014C480916F008260CD -:108EE00080936F0081E042C580E040C56090C81368 -:108EF0007090C9130091CA131091CB13BFCA818D12 -:108F0000928DA38DB48D0697A105B10508F02BCBEA -:108F1000858D968DA78DB0A10697A105B10508F0A6 -:108F200022CB20E030E0A901C701B6010F947E0EEC -:108F300087FF04C0F7FAF094F7F8F09481E54BA0AE -:108F40005CA0849DF001859DF00D112408C081E591 -:108F50006BA07CA0869DF001879DF00D1124EF5C35 -:108F6000FB4FC586D686E786F08A40CB8091020407 -:108F700090910304A0910404B0910504C816D90689 -:108F8000EA06FB0608F06CCB8C199D09AE09BF09F7 -:108F9000BC01CD01660F771F881F991F4DAC042DB2 -:108FA00010E020E030E0A90198010F94FA0BCA010B -:108FB000B9010F9410080F94890EC60ED71EE81E33 -:108FC000F91EC701B6010F9410089B01AC0160E0C7 -:108FD00074E284E799E40F94340D4B015C0140CBBB -:108FE000A7019601C301B2010F94340D7B018C01DE -:108FF0009B01AC01B1018DA199A50F947E0E1816AD -:109000000CF004CC17010DA319A700CC818D928D13 -:10901000A38DB48D892B8A2B8B2B09F07ECC858D6B -:10902000968DA78DB0A1892B8A2B8B2B09F075CC3F -:1090300020917F13309180134091811350918213BE -:109040006DA17EA18FA198A50F9471080F941E0D9C -:10905000C3C120917B1330917C1340917D135091BB -:109060007E136CCC609111047091120480911304F2 -:10907000909114046C157D058E059F0508F082CC37 -:10908000A30192010F94EB0B2B013C01A50194016C -:10909000C701B6010F94EB0B461657066806790612 -:1090A00008F070CCC301B2010F94FA0B69017A0188 -:1090B00069CC609115047091160480911704909109 -:1090C00018046C157D058E059F0508F06FCC2DA545 -:1090D0003EA54FA558A90F94EB0B2B013C01A50110 -:1090E0009401C701B6010F94EB0B461657066806AC -:1090F000790608F05BCCC301B2010F94FA0B690149 -:109100007A0154CC6091190470911A0480911B0467 -:1091100090911C046C157D058E059F0508F05ACCB6 -:109120002DA53EA54FA558A90F94EB0B2B013C0193 -:10913000A5019401C701B6010F94EB0B4616570623 -:109140006806790608F046CCC301B2010F94FA0B09 -:1091500069017A013FCC60911D0470911E048091D9 -:109160001F04909120046C157D058E059F0508F065 -:1091700045CC2DA53EA54FA558A90F94EB0B2B016F -:109180003C01A5019401C701B6010F94EB0B4616F3 -:1091900057066806790608F031CCC301B2010F9476 -:1091A000FA0B69017A012ACC81149104A104B1045B -:1091B000B9F160911104709112048091130490919F -:1091C00014046C157D058E059F0550F50F9410084D -:1091D00029A93AA94BA95CA90F9471082B013C015C -:1091E000C501B4010F9410084B015C01C701B60121 -:1091F0000F941008A50194010F9471089B01AC0114 -:10920000C301B2010F940C0887FF0AC0A5019401A5 -:10921000C301B2010F94340D0F94A10D6B017C01B9 -:1092200081E56BA07CA0869DF001879DF00D112447 -:10923000EF5CFB4F418C528C638C748C4114510455 -:1092400061047104B9F16091150470911604809164 -:109250001704909118046C157D058E059F0550F537 -:109260000F94100829A93AA94BA95CA90F94710879 -:109270004B015C01C301B2010F9410082B013C01AA -:10928000C701B6010F941008A30192010F94710851 -:109290009B01AC01C501B4010F940C0887FF0AC003 -:1092A000A3019201C501B4010F94340D0F94A10DD7 -:1092B0006B017C0181E50BA11CA1809FF001819FC6 -:1092C000F00D1124EF5CFB4F458C568C678C70A021 -:1092D0004114510461047104B9F160911904709151 -:1092E0001A0480911B0490911C046C157D058E0559 -:1092F0009F0550F50F94100829A93AA94BA95CA91C -:109300000F9471084B015C01C301B2010F94100866 -:109310002B013C01C701B6010F941008A301920173 -:109320000F9471089B01AC01C501B4010F940C08A6 -:1093300087FF0AC0A3019201C501B4010F94340D47 -:109340000F94A10D6B017C0181E54BA05CA0849D75 -:10935000F001859DF00D1124EF5CFB4F81A092A0E0 -:10936000A3A0B4A081149104A104B10409F446CBD4 -:1093700060911D0470911E0480911F04909120043F -:109380006C157D058E059F0508F038CB0F941008ED -:1093900029A93AA94BA95CA90F9471082B013C019A -:1093A000C501B4010F9410084B015C01C701B6015F -:1093B0000F941008A50194010F9471089B01AC0152 -:1093C000C301B2010F940C0887FF18CBA5019401CB -:1093D000C301B2010F94340D0F94A10D6B017C01F8 -:1093E0000DCBFDA9FF2331F1A5019401632D722D51 -:1093F000C8010F9471084B015C012DA139A54DA541 -:1094000059A9C701B6010F9471089B01AC01C501B0 -:10941000B4010F940C0887FF22C0A7019601C50173 -:10942000B4010F94340D6DA379A78DA799AB21E0FA -:109430002DAB6CCBA7019601C501B4010F94340D7F -:109440009B01AC016DA179A58DA599A90F94710817 -:109450006DA379A78DA799AB31E03DAB57CB41E028 -:109460004DAB54CBA7019601C501B40113C0C70190 -:10947000B6010F940C0887FD09C020E030E0A90177 -:10948000C501B4010F947E0E18164CF4A501940189 -:10949000C701B6010F94570C2B013C01DFCB24010F -:1094A000350177FA709477F87094A3019201C7019F -:1094B000B6010F940C0887FDD1CB26013701CECB26 -:1094C0002DA139A54DA559A9C701B6010F940C08C6 -:1094D00087FF1DCC3DA029A40DA519A918CC81E0BA -:1094E00070CCF090EF098FEF8F0D8F708BA3B09041 -:1094F000EE098091EF09B81609F456C0C12CD12CA1 -:109500005BA05B1409F450C0652C712C21E5269DED -:109510008001279D100D11240F5C1B4FD8018C91E9 -:1095200083FD2DC00DAB19AF0115110551F1199631 -:109530004C9019974DA21A965C901A9759A61B96B3 -:109540004C901B974DA61C965C901C9759AA15969B -:109550002D903D904D905C901897A20191016DA1C6 -:1095600079A58DA599A90F940C08811108C1C11482 -:10957000D10439F0D6018C9180FD01C102C0CDAA81 -:10958000D9AE8BA181508F708BA38091EE098B1186 -:1095900003C0CDA8D9ACB4CF4BA04B1429F081E0C7 -:1095A0008B0D8F70B82EF1CF5090EE095BA2C12CBD -:1095B000D12C8091EF096BA0861509F475CC862C0F -:1095C000912C91E5792E789C8001799C100D1124C5 -:1095D0000F5C1B4FD8018C9183FD0AC05801C11448 -:1095E000D10439F0C6010E94E8F2811102C045C1E0 -:1095F00056018BA18F5F8F708BA36501DACF8FEF40 -:10960000880D8F70289FF0011124EF5CFB4F908133 -:1096100093FF51CC882E4DCC21E52D9D8001112446 -:109620000F5C1B4FD8018C9183FD19C015966D916D -:109630007D918D919C9118970F94C30EC62EB72ED5 -:10964000A82E992EE114F10409F44DC0F701808190 -:1096500080FD0AC0D8018C9180FD06C044C0CBA01B -:10966000BDA0A72C962C44C0F70180818160808327 -:10967000C7010E94E8F2811132C0F7016181728155 -:10968000838194810F94C30E9B01AC0160E070E074 -:1096900080E89FE30F94340D1B012C019B01AC016A -:1096A0006C2D7B2D8A2D992D0F94710869837A83F7 -:1096B0008B839C832BA13DA1472D562DC201B10167 -:1096C0000F947108698B7A8B8B8B9C8BAE014F5FEB -:1096D0005F4FBE016F5E7F4FC7010E945988D7015F -:1096E0008C918E7F8C932C2C3B2C4A2C592C7801FE -:1096F00081E08D0D8F70D82ECBA2BDA27A2C692C63 -:10970000E6CBF801808181608083C7010E94E8F286 -:10971000811130C0D80111966D917D918D919C91F0 -:1097200014970F94C30E9B01AC0160E070E080E8D9 -:109730009FE30F94340D6B017C012DEC3CEC4CE469 -:109740005DE30F94710869837A838B839C83910115 -:10975000A201C701B6010F947108698B7A8B8B8BBC -:109760009C8BAE014F5F5F4FBE016F5E7F4FC801A4 -:109770000E945988F80180818E7F8083AECB21E5DD -:10978000269DF001279DF00D1124EF5CFB4F808199 -:1097900081FD43C0C114D10431F0F601C580D680EB -:1097A000E780F08408C02BE0C22E27EDD22E23E202 -:1097B000E22E2BE3F22E21E5269DF001279DF00DF0 -:1097C0001124EF5CFB4F81899289A389B489BC0184 -:1097D000CD0190589B01AC010F94580CD8011D96F7 -:1097E0002D913D914D915C9150970F9471089B0183 -:1097F000AC01C701B6010F94570CE62E872E982EA8 -:10980000A92E262F372F482F592F6DA179A58DA569 -:1098100099A90F940C0887FF04C0EDA089A49DA40A -:10982000A9A82E2D382D492D5A2DC201B1010F9412 -:109830000C08882309F4A5CEB1E5B69DC001B79DFB -:10984000900D1124FC01EF5CFB4F6F018081816062 -:109850008083C8010E94E8F2882329F0D6018C9108 -:109860008E7F8C938ECE8E2D982DA92DBA2DF6013C -:1098700085839683A783B08784CED6018C9181FDA2 -:1098800052C0D60115964D905D906D907C901897C2 -:109890004DA25EA26FA278A61501B5E02B0E311C79 -:1098A000F8014580568067807084A30192016DA104 -:1098B0007EA18FA198A50F940C0887FF34C0F601F4 -:1098C00081899289A389B489BC01CD0190589B01FB -:1098D000AC010F94580CD6011D962D913D914D91E0 -:1098E0005C9150970F9471089B01AC016DA17EA112 -:1098F0008FA198A50F94570C6B017C019B01AC01C3 -:10990000C301B2010F947E0E18166CF4D8018C912D -:1099100081608C93C5010E94E8F28823E9F0F80188 -:1099200080818E7F808381E5582E589CF001599C60 -:10993000F00D1124EF5CFB4F218532854385548562 -:1099400065817681878190850F940C08811151CEB5 -:109950006BA06092EE094DCED101CD92DD92ED92D9 -:10996000FC9213974BA04092EE09DDCFC759DF4F11 -:109970000FB6F894DEBF0FBECDBFDF91CF911F9120 -:109980000F91FF90EF90DF90CF90BF90AF909F909E -:109990008F907F906F905F904F903F902F900895A1 -:1099A0008091EF099091F009891B8F708F3019F425 -:1099B0000E94B2BFF5CF8091EF098F5F8F70E09169 -:1099C000EF0991E59E9FF0011124EF5CFB4FDF0151 -:1099D0001D929A95E9F798E090834091050A50917D -:1099E000060A6091070A7091080A458B568B678BAF -:1099F000708F4091090A50910A0A60910B0A709188 -:109A00000C0A418F528F638F748F40910D0A5091D1 -:109A10000E0A60910F0A7091100A458F568F678F5A -:109A200070A34091110A5091120A6091130A70912B -:109A3000140A41A352A363A374A32091EF09909148 -:109A4000F009291303C094E69093EC098093EF0981 -:109A500080916F00826080936F0008959091EF096C -:109A60008091F009981306C08091660D9091670D62 -:109A7000892B19F00E94B2BFF1CF0895EF92FF92A7 -:109A80000F931F93CF93DF937B018A01E90120910C -:109A90009713309198134091991350919A13FC01A8 -:109AA00060817181828193810F9471080F94890E76 -:109AB0006093050A7093060A8093070A9093080A38 -:109AC00020919B1330919C1340919D1350919E13B4 -:109AD000F70160817181828193810F9471080F94E5 -:109AE000890E6093090A70930A0A80930B0A909377 -:109AF0000C0A20E030E0A901F801608171818281C7 -:109B000093810F94580C20919F133091A013409192 -:109B1000A1135091A2130F9471080F94890E6093B2 -:109B20000D0A70930E0A80930F0A9093100A2091E9 -:109B3000A3133091A4134091A5135091A6136881EB -:109B400079818A819B810F9471080F94890E6093AB -:109B5000110A7093120A8093130A9093140A909139 -:109B6000EF098091F009981739F0DF91CF911F919B -:109B70000F91FF90EF9014CF71DF80916F00982FBD -:109B8000927081FF05C080916F008D7F80936F0080 -:109B90004091050A5091060A6091070A7091080ADF -:109BA00040933414509335146093361470933714E3 -:109BB0004091090A50910A0A60910B0A70910C0AAF -:109BC000409338145093391460933A1470933B14B3 -:109BD00040910D0A50910E0A60910F0A7091100A7F -:109BE00040933C1450933D1460933E1470933F1483 -:109BF0004091110A5091120A6091130A7091140A4F -:109C00004093401450934114609342147093431452 -:109C1000992329F080916F00826080936F00DF911B -:109C2000CF911F910F91FF90EF900895CF93DF9305 -:109C300090916F00292F227091FF05C090916F00C5 -:109C40009D7F90936F0094E0899FA0011124FA01F9 -:109C5000EC5CFB4E6081718182819381222329F02B -:109C600020916F00226020936F00EA01CF5DDB4FEF -:109C70000F941208288139814A815B810F94710801 -:109C8000DF91CF9108959091EF098091F009981399 -:109C900006C08091660D9091670D892B19F00E9486 -:109CA000B2BFF1CF0C943EBFCF93DF938091EF0909 -:109CB0009091F009891B8F7009F445C09091EC09CF -:109CC000992351F0833030F48FEF890F19F080938E -:109CD000EC093BC01092EC09E091F00981E5E89FA6 -:109CE000F0011124EF5CFB4F808180FD2EC080913C -:109CF0002D0D90912E0DA0912F0DB091300DEF01F3 -:109D0000C35BDF4F488159816A817B81841B950B3E -:109D1000A60BB70B80932D0D90932E0DA0932F0DB6 -:109D2000B093300D8091F0098F5F8F708093ED09B3 -:109D30009091F0098091EE0998130AC08091ED0985 -:109D40008093EE0905C00E942E8A80E090E001C059 -:109D5000CF01DF91CF910895CF92DF92EF92FF92E2 -:109D60000F931F93CF93DF936C018B017A01EC016A -:109D7000CD5BD64F888187FF04C0FB011182108222 -:109D800024C02CE02C9DC0012D9D900D1124288114 -:109D9000AC01420F511D27FD5A952091810A30E0F8 -:109DA0004217530794F42881AC01420F511D27FD3F -:109DB0005A959A01FA01EE0FFF1F2E0F3F1FF9016E -:109DC000EB5EF54F208126FD19C088818F5F888367 -:109DD0002CE02C9DC0012D9D900D11242881AC01FB -:109DE000420F511D27FD5A952091810A30E04217FC -:109DF0005307BCF428812C3044F113C02881820F12 -:109E0000911D27FD9A95FC01EE0FFF1F8E0F9F1FDE -:109E1000FC01EB5EF54F808160E08F730E946EEC79 -:109E2000D4CFF80180819181049680349C4918F444 -:109E300080E49CE904C0F801808191810496F701D7 -:109E4000918380838FEF888345C0F80140815181E1 -:109E50002881BC01620F711D27FD7A959B01FB01D2 -:109E6000EE0FFF1F2E0F3F1FF901EB5EF54F218113 -:109E70003281240F351FF701318320832881AC0103 -:109E8000420F511D27FD5A959A01FA01EE0FFF1F4F -:109E90002E0F3F1FF901EB5EF54F208126FF1AC000 -:109EA0002881820F911D27FD9A95FC01EE0FFF1F5F -:109EB0008E0F9F1FFC01EB5EF54F808161E08F7379 -:109EC000DF91CF911F910F91FF90EF90DF90CF9096 -:109ED0000C946EECDF91CF911F910F91FF90EF905A -:109EE000DF90CF9008950F930FB70F9300916E00FE -:109EF0000F930B7F00936E0000916F000D7F009316 -:109F00006F000F930BB70F930CB70F921F922F9305 -:109F10003F934F935F936F937F938F939F93AF93F1 -:109F2000BF93EF93FF93112471D0FF91EF91BF91F5 -:109F3000AF919F918F917F916F915F914F913F91E1 -:109F40002F911F900F900CBF0F910BBF0F910260CC -:109F5000F89400936F000F9100936E000F910FBF64 -:109F60000F9118958091410980FF08C080910B01E5 -:109F700080958270809309018FEF06C080910B015C -:109F800082708093090181E08093460980914109A4 -:109F900081FF07C080910B018170809309018FEFD1 -:109FA00007C080910B01809581708093090181E049 -:109FB000809347098091410982FF07C080910B017E -:109FC0008470809309018FEF07C080910B01809509 -:109FD00084708093090181E0809348098091410950 -:109FE00083FF08C080910B018095807480930901E4 -:109FF0008FEF06C080910B0180748093090181E08E -:10A000008093490900000000000008952F923F92BC -:10A010004F925F926F927F928F929F92AF92BF9278 -:10A02000CF92DF92EF92FF921F93CF93DF93F8943A -:10A030008FEF9FEF90938900809388001AE0C0E033 -:10A04000D0E0BEE62B2EB1E13B2E789480918B09B7 -:10A0500090918C09A0918D09B0918E09892B8A2B42 -:10A060008B2B09F0CEC1809127148823D1F0109258 -:10A0700027148091251490912614892B91F0109229 -:10A08000420910922614109225149091EF098091A4 -:10A09000F009981731F08091F0098F5F8F708093ED -:10A0A000F0098091251490912614892B09F4A9C1F7 -:10A0B0008090870990908809A0908909B0908A09BA -:10A0C00040918309509184096091850970918609B6 -:10A0D000C0907609D12CE12CF12CDB01CA01881942 -:10A0E0009909AA09BB09C816D906EA06FB0610F4A5 -:10A0F000D701C601282F880D991DAA1DBB1D80936D -:10A10000870990938809A0938909B0938A0980915F -:10A110008400909185004E96C0905E09D0905F09B2 -:10A12000E0906009F090610940914E0950914F090B -:10A1300060915009709151094C0D5D1D6E1D7F1D80 -:10A1400040935E0950935F096093600970936109C1 -:10A1500077FD1CC0409AC0903414D0903514E09024 -:10A160003614F090371440914609042E000C550B1C -:10A17000660B770B4C0D5D1D6E1D7F1D40933414D7 -:10A18000509335146093361470933714C09062095D -:10A19000D0906309E0906409F090650940915209FC -:10A1A0005091530960915409709155094C0D5D1DF2 -:10A1B0006E1D7F1D4093620950936309609364098B -:10A1C0007093650977FD1CC0419AC0903814D090F7 -:10A1D0003914E0903A14F0903B1440914709042E52 -:10A1E000000C550B660B770B4C0D5D1D6E1D7F1D16 -:10A1F000409338145093391460933A1470933B147D -:10A20000C0906609D0906709E0906809F0906909EC -:10A210004091560950915709609158097091590918 -:10A220004C0D5D1D6E1D7F1D40936609509367099F -:10A23000609368097093690977FD1CC0429AC090C9 -:10A240003C14D0903D14E0903E14F0903F144091A7 -:10A250004809042E000C550B660B770B4C0D5D1D49 -:10A260006E1D7F1D40933C1450933D1460933E142B -:10A2700070933F14C0906A09D0906B09E0906C090C -:10A28000F0906D0940915A0950915B0960915C0909 -:10A2900070915D094C0D5D1D6E1D7F1D40936A0917 -:10A2A00050936B0960936C0970936D0977FD1CC026 -:10A2B000439AC0904014D0904114E0904214F09022 -:10A2C000431440914909042E000C550B660B770B83 -:10A2D0004C0D5D1D6E1D7F1D409340145093411425 -:10A2E0006093421470934314409184005091850010 -:10A2F00048175907C8F340915E0950915F09609172 -:10A3000060097091610977FD15C0C0904A09D0902D -:10A310004B09E0904C09F0904D094C195D096E090C -:10A320007F0940935E0950935F09609360097093C1 -:10A3300061094098409162095091630960916409F4 -:10A340007091650977FD15C0C0904A09D0904B09FE -:10A35000E0904C09F0904D094C195D096E097F0998 -:10A36000409362095093630960936409709365098F -:10A370004198409166095091670960916809709110 -:10A38000690977FD15C0C0904A09D0904B09E0904B -:10A390004C09F0904D094C195D096E097F094093F5 -:10A3A0006609509367096093680970936909429838 -:10A3B00040916A0950916B0960916C0970916D0927 -:10A3C00077FD15C0C0904A09D0904B09E0904C0928 -:10A3D000F0904D094C195D096E097F0940936A0997 -:10A3E00050936B0960936C0970936D0943982150E9 -:10A3F00041F0409184005091850048175907C8F3F7 -:10A400008ACE80918B0990918C09A0918D09B09191 -:10A410008E09892B8A2B8B2B09F01CC3E091251404 -:10A42000F0912614309709F491C480918709909196 -:10A430008809A0918909B0918A09409183095091B6 -:10A440008409609185097091860984179507A6078C -:10A45000B707D0F0109242091092261410922514DA -:10A460009091EF098091F009981709F46FC48091D9 -:10A47000F0098F5F8F708093F009A0EDCA2EA7E0DE -:10A48000DA2EE12CF12C4EC140917F0950918009C8 -:10A490006091810970918209481759076A077B0703 -:10A4A00008F467C040917B0950917C0960917D0957 -:10A4B00070917E0982A993A9A4A9B5A9FF24499FF7 -:10A4C000E12C5A9F90016A9F300D699F200D311D2C -:10A4D0004A9FE00C211D3F1D599FE00C211D3F1D8F -:10A4E000689FE00C211D3F1D589FE10C2F1D3F1D53 -:10A4F000E6942F1D3F1DB49F200D311DB59F300DDB -:10A50000112483AD94ADA5ADB6AD820F931FA11DEF -:10A51000B11D8093770990937809A0937909B0933E -:10A520007A09C7A8D0ACE1ACF2ACC816D906EA06E5 -:10A53000FB0640F4C0927709D0927809E09279093D -:10A54000F0927A098090770990907809A090790923 -:10A55000B0907A0982E591E121E0FC01C590D590A7 -:10A56000E590F490C814D904EA04FB0408F4B8C2D6 -:10A57000C2C240917209509173096091740970913F -:10A580007509481759076A077B0708F063C04091AF -:10A590006E0950916F09609170097091710982A9DB -:10A5A00093A9A4A9B5A9FF24499FE12C5A9F900122 -:10A5B0006A9F300D699F200D311D4A9FE00C211DBF -:10A5C0003F1D599FE00C211D3F1D689FE00C211D80 -:10A5D0003F1D589FE10C2F1D3F1DE6942F1D3F1D71 -:10A5E000B49F200D311DB59F300D1124C901A0E08D -:10A5F000B0E08090770990907809A0907909B090A8 -:10A600007A09FF9688159905AA05BB0580F4C080D4 -:10A61000D180E280F380881A990AAA0ABB0A8C14B6 -:10A620009D04AE04BF0438F44601570104C0808085 -:10A630009180A280B38082E591E121E0FC01C59088 -:10A64000D590E590F490C814D904EA04FB0408F40A -:10A65000BAC2C4C28091030290910402A091050283 -:10A66000B0910602B7FF56C087A990ADA1ADB2ADBB -:10A6700022E531E141E0F901C590D590E590F490F3 -:10A68000C816D906EA06FB0658F4B695A79597951D -:10A690008795440F2C5F3F4FF1E12E363F0759F766 -:10A6A0004093760980329105A105B10508F421C3D4 -:10A6B0008097A109B109811528E09207A105B1058C -:10A6C00008F4F4C244E0949F900111242E5A324FB2 -:10A6D000F901329645915491EE27859FB001849FF0 -:10A6E000610D7E1F06946E1F7E1F1124CB01A0E01A -:10A6F000B0E0F9014591549160E070E0481B590BBE -:10A700006A0B7B0B40930302509304026093050293 -:10A7100070930602C0900302D0900402E0900502FC -:10A72000F09006028091251490912614892B09F04F -:10A7300089C1BADA9093261480932514892B09F4E1 -:10A7400081C1E0912514F0912614808183FF3EC0E1 -:10A7500085899689A789B08D809334149093351498 -:10A76000A0933614B0933714818D928DA38DB48D40 -:10A770008093381490933914A0933A14B0933B14F7 -:10A78000858D968DA78DB0A180933C1490933D1438 -:10A79000A0933E14B0933F1481A192A1A3A1B4A1B0 -:10A7A0008093401490934114A0934214B0934314A7 -:10A7B0009091EF098091F009981709F4BACF809130 -:10A7C000F0098F5F8F708093F009B3CF85889688EA -:10A7D000A788B08C81E081149104A104B10409F42C -:10A7E00080E0C18CD28CE38CF48CC114D104E104E0 -:10A7F000F10409F08260458D568D678D70A1411579 -:10A8000051056105710509F0846080934209109239 -:10A810006E0910926F0910927009109271091092CE -:10A820007B0910927C0910927D0910927E0985A106 -:10A8300096A1A7A1B0A58093830990938409A093C2 -:10A840008509B0938609442455243201481A590ACF -:10A850006A0A7B0A40926A0950926B0960926C09FD -:10A8600070926D094092660950926709609268097A -:10A87000709269094092620950926309609264097A -:10A880007092650940925E0950925F09609260097A -:10A8900070926109880C991CAA1CBB1C80924E09FD -:10A8A00090924F09A0925009B0925109CC0CDD1C36 -:10A8B000EE1CFF1CC0925209D0925309E092540939 -:10A8C000F0925509440F551F661F771F4093560994 -:10A8D00050935709609358097093590941A152A1A7 -:10A8E00063A174A1440F551F661F771F40935A0937 -:10A8F00050935B0960935C0970935D09880F991F01 -:10A90000AA1FBB1F80934A0990934B09A0934C093F -:10A91000B0934D0910928709109288091092890905 -:10A9200010928A0982A593A5A4A5B5A580937F0955 -:10A9300090938009A0938109B093820986A597A579 -:10A94000A0A9B1A98093720990937309A093740987 -:10A95000B093750941A556A98091410958130AC0C1 -:10A960008091020290E0242F042E000C330B281754 -:10A97000390729F05093410940930202F3DA0E940B -:10A98000498A8FEF9FEFDC018093030290930402CA -:10A99000A0930502B0930602E0912514F0912614CD -:10A9A00083AD94ADA5ADB6AD80937709909378094A -:10A9B000A0937909B0937A0922E531E141E0F901E8 -:10A9C000C590D590E590F490C816D906EA06FB0626 -:10A9D00050F4B695A79597958795440F2C5F3F4FF8 -:10A9E0002216330661F74093760980329105A1055E -:10A9F000B10508F4A6C18097A109B1098115F8E055 -:10AA00009F07A105B10508F479C144E0949F900126 -:10AA100011242E5A324FF901329645915491EE2766 -:10AA2000859FB001849F610D7E1F06946E1F7E1F5F -:10AA30001124F901C590D490E12CF12CC61AD70A43 -:10AA4000E108F108C0928B09D0928C09E0928D093F -:10AA5000F0928E0980918B0990918C09A0918D09BB -:10AA6000B0918E09AC01BD010097F1E0AF07B105CF -:10AA700020F04FEF5FEF60E070E0841B950BA60BBA -:10AA8000B70B80938B0990938C09A0938D09B09399 -:10AA90008E09F89480918400909185004096115021 -:10AAA00039F0C40FD51FC817D90708F4CECA01C0A2 -:10AAB000EC01D0938900C09388007894DF91CF9106 -:10AAC0001F91FF90EF90DF90CF90BF90AF909F903D -:10AAD0008F907F906F905F904F903F902F90089550 -:10AAE000B694A79497948794220F049631E18E36FA -:10AAF000930709F032CD2093760980E288169104FD -:10AB0000A104B10408F459C020E2821A9108A108F6 -:10AB1000B108811438E09306A104B104F8F0A4E070 -:10AB20009A9EC00111248E5A924FFC0132962591B3 -:10AB30003491F82DEE27F39FD001F29FA10DBE1F97 -:10AB40000694AE1FBE1F1124FC01C590D490E12CC9 -:10AB5000F12CCA1ADB0AE108F10822C0D501C401B0 -:10AB6000B695A79597958795FC01EC7FCF018E5AF6 -:10AB7000964FFC01C590D490FC01329625913491FA -:10AB8000E82DE770E29FC001E39F900D1124F3E0F0 -:10AB900096958795FA95E1F7C81AD90AE12CF12C18 -:10ABA0004C0D5D1D6E1D7F1D40937B0950937C09EC -:10ABB00060937D0970937E09B5CDA0E28A2E912C19 -:10ABC000A12CB12CA1CFB694A79497948794220F6F -:10ABD0000496A1E18E369A0709F030CD20937609CC -:10ABE00090E289169104A104B10408F459C020E24E -:10ABF000821A9108A108B108811438E09306A104D3 -:10AC0000B104F8F0A4E09A9EC00111248E5A924F2C -:10AC1000FC01329625913491F82DEE27F39FD00157 -:10AC2000F29FA10DBE1F0694AE1FBE1F1124FC0192 -:10AC3000C590D490E12CF12CCA1ADB0AE108F10886 -:10AC400022C0D501C401B695A79597958795FC01BB -:10AC5000EC7FCF018E5A964FFC01C590D490FC0139 -:10AC6000329625913491E82DE770E29FC001E39F71 -:10AC7000900D112433E0969587953A95E1F7C81A1F -:10AC8000D90AE12CF12C4C0D5D1D6E1D7F1D4093EA -:10AC90006E0950936F09609370097093710942CDEA -:10ACA000F0E28F2E912CA12CB12CA1CFAC01BD01D3 -:10ACB0007695679557954795FA01EC7F9F012E5A37 -:10ACC000364FF90145915491F9013296659174918D -:10ACD0008770869F9001879F300D1124C901F3E092 -:10ACE00096958795FA95E1F7481B590B60E070E05F -:10ACF00009CD80E290E0A0E0B0E0DACCAC01BD018B -:10AD00007695679557954795FA01EC7F9F012E5AE6 -:10AD1000364FF901C590D490F9013296459154917E -:10AD20008770849F9001859F300D1124C90123E015 -:10AD3000969587952A95E1F7C81AD90AE12CF12C46 -:10AD400081CE80E290E0A0E0B0E055CE80EDC82E4C -:10AD500087E0D82EE12CF12CECCC8F929F92AF9211 -:10AD6000BF92CF92DF92EF92FF920F931F93CF93F8 -:10AD7000DF938C01EB0160E070E00E94609287FD40 -:10AD80008DC0C03282E0D8070CF042C0F801828149 -:10AD900028E532E0281B310987FD3395220F331F48 -:10ADA000220F331F4901330FAA08BB08818128E80D -:10ADB00030E06901C81AD10887FDD394CC0CDD1CA2 -:10ADC000CC0CDD1C0D2C000CEE08FF08D7FD0AC0D2 -:10ADD000C53BD10514F0C4EBD0E0BE01DD0F880BFC -:10ADE000990B03C060E070E0CB01A50194012C1920 -:10ADF0003D094E095F090F94EB0B24EB30E040E076 -:10AE000050E00F941C0CC20ED31EE41EF51EE6018A -:10AE1000F8013081343280F5218188E890E0821B8E -:10AE2000910927FD9395880F991F880F991FC817BF -:10AE3000D90784F0F801228188E592E0821B91090C -:10AE400027FD9395880F991F880F991FC817D90759 -:10AE50000CF4CE0102974FB7F894232F30E0F9019C -:10AE6000EE0FFF1F2E0F3F1FF901EB5EF54F880F0E -:10AE7000991F928381834FBF62E370E080E090E08E -:10AE8000DF91CF911F910F91FF90EF90DF90CF90C6 -:10AE9000BF90AF909F908F900C942A6FDF91CF91CD -:10AEA0001F910F91FF90EF90DF90CF90BF90AF90E8 -:10AEB0009F908F9008951F920F920FB60F921124BA -:10AEC0000BB60F922F933F934F935F936F937F93A4 -:10AED0008F939F93AF93BF93EF93FF9348E251E01B -:10AEE00064E271E082E090E00E94AC4EFF91EF914D -:10AEF000BF91AF919F918F917F916F915F914F9192 -:10AF00003F912F910F900BBE0F900FBE0F901F908F -:10AF100018951F920F920FB60F9211240BB60F9235 -:10AF20002F933F934F935F936F937F938F939F9351 -:10AF3000AF93BF93EF93FF9348EA50E064EA70E069 -:10AF400081E090E00E94AC4EFF91EF91BF91AF91F4 -:10AF50009F918F917F916F915F914F913F912F9131 -:10AF60000F900BBE0F900FBE0F901F9018951F9261 -:10AF70000F920FB60F9211240BB60F922F933F939F -:10AF80004F935F936F937F938F939F93AF93BF93F1 -:10AF9000EF93FF9348E950E064E970E080E090E0CF -:10AFA0000E94AC4EFF91EF91BF91AF919F918F9115 -:10AFB0007F916F915F914F913F912F910F900BBEB9 -:10AFC0000F900FBE0F901F901895CF92DF92EF92C7 -:10AFD000FF92CF93DF936A017B01FC018491EF0123 -:10AFE0002196882321F00E948339FE01F7CF4AE0A1 -:10AFF000C701B601DF91CF91FF90EF90DF90CF9026 -:10B000000C94743DCF92DF92EF92FF92CF93DF9337 -:10B010006A017B01FC018491EF012196882321F0D4 -:10B020000E948339FE01F7CF42E0C701B601DF91EC -:10B03000CF91FF90EF90DF90CF900C94353E0F931F -:10B040001F93CF93DF938B01FC018491EF01219635 -:10B05000882321F00E948339FE01F7CFB801110F38 -:10B06000880B990BDF91CF911F910F910C941B3E90 -:10B070000F931F93CF93DF938B01FC018491EF011A -:10B080002196882321F00E948339FE01F7CFE80141 -:10B090008991882319F00E948339FACFDF91CF91EB -:10B0A0001F910F91089586E40E949F388093BB13EF -:10B0B000882351F00E946C386093490270934A02D1 -:10B0C00080934B0290934C0283E50E949F38882323 -:10B0D00051F00E946C386093510270935202809339 -:10B0E00053029093540282E40E949F38882351F0C7 -:10B0F0000E946C3860934D0270934E0280934F0211 -:10B100009093500208954F925F926F927F928F9228 -:10B110009F92AF92BF92EF92FF920F931F93CF93A4 -:10B12000DF93CBE6D3E187E9E82E83E1F82E01E156 -:10B1300014E0412C512C3201439469917991899109 -:10B140009991F70181909190A190B1907F010F9416 -:10B150001008A50194010F9471080F94A10DF80136 -:10B1600061937193819391938F01461657066806F8 -:10B17000790610F42B013C01F3E1CB37DF07E9F648 -:10B180006FEF7FEFCB01A30192010F94FA0B209395 -:10B190000D0430930E0440930F0450931004DF917C -:10B1A000CF911F910F91FF90EF90BF90AF909F9024 -:10B1B0008F907F906F905F904F900895EF92FF92E5 -:10B1C0000F931F93CF93DF93CDB7DEB72C970FB6B6 -:10B1D000F894DEBF0FBECDBF07E913E181E2E82E90 -:10B1E00084E0F82EF80121913191419151918F0124 -:10B1F00060E070E080E89FE30F94340DF701619305 -:10B200007193819391937F01F3E1073A1F0751F7FF -:10B210008091B60F9091B70FA091B80FB091B90F70 -:10B2200089839A83AB83BC838091BA0F9091BB0FC3 -:10B23000A091BC0FB091BD0F8D839E83AF83B88763 -:10B240008091BE0F9091BF0FA091C00FB091C10F20 -:10B2500089879A87AB87BC87AE01475F5F4FBE0186 -:10B260006B5F7F4FCE0101960E94E48722EC3FE0A6 -:10B27000AE01475F5F4FBE016B5F7F4FCE0101960E -:10B280000E943E4D40DF2C960FB6F894DEBF0FBEF5 -:10B29000CDBFDF91CF911F910F91FF90EF90089557 -:10B2A0000F931F93CF93E091C009F091C10930979C -:10B2B00019F082EB99E019950091B4091091B50944 -:10B2C000E091E309F091E40982E01995E091E30946 -:10B2D000F091E40981E0199520E030E045E1B80102 -:10B2E00082EB99E00E94EB7DC82F882341F025EE88 -:10B2F00039E047E1B80182EB99E00E94EB7DE091F3 -:10B30000E309F091E40980E019958C2FCF911F910A -:10B310000F910895682F8EEA99E00C94AD730F9306 -:10B320001F93CF93DF93EC018C010A5E1F4FFE0148 -:10B330008491882329F0EEDF21960C171D07B9F7B9 -:10B34000DF91CF911F910F9108950F931F93CF938A -:10B35000DF93C5E9D9E00BEA19E08991882321F050 -:10B36000D9DF0C171D07C9F7DF91CF911F910F91FE -:10B3700008952091B6093091B7092817390709F4C3 -:10B3800044C09093B7098093B609009709F437C079 -:10B390002091C909FC01211107C03596E491E09381 -:10B3A000CA09FC013C960FC0213039F43F96E49164 -:10B3B000E093CA09FC01709606C03D96E491E093C3 -:10B3C000CA09FC013E9684918093CB098091CA09F9 -:10B3D000082E000C990B2091CB09821B910927FDA7 -:10B3E00093952091CC09203441F0829FC001112413 -:10B3F00026E0969587952A95E1F78093CD0985EB10 -:10B400009DE79093C8098093C70908950F931F93F0 -:10B41000CF93DF931F92CDB7DEB70091B40910919F -:10B42000B509E091E309F091E40982E0199520E083 -:10B4300030E04AE0B80182EB99E00E94EB7D182FE2 -:10B44000E091E309F091E40983E01995E091E309C3 -:10B45000F091E40980E019951123C1F16091B409DC -:10B460007091B5099E012F5F3F4F46E482EB99E052 -:10B470000E94EB7D89818093B2096091B40970913B -:10B48000B5099E012F5F3F4F47E482EB99E00E9490 -:10B49000EB7D89818093B3096091B4097091B509FE -:10B4A00020E030E048E482EB99E00E94EB7D80935D -:10B4B000BD096091B4097091B50925EE39E047E105 -:10B4C00082EB99E00E94EB7D81E001C080E00F906B -:10B4D000DF91CF911F910F910895CF93DF938091CA -:10B4E000EB09811104C081E08093EB098FDFC091EB -:10B4F000B409D091B509E091E309F091E40982E043 -:10B500001995E091E309F091E40981E0199520E0B3 -:10B5100030E044E1BE0182EB99E00E94EB7D25EE34 -:10B5200039E047E1BE0182EB99E00E94EB7DE091BA -:10B53000E309F091E40980E0DF91CF9119948F92B3 -:10B540009F92AF92BF92CF92DF92EF92FF920F93B2 -:10B550001F93CF93DF9300D01F92CDB7DEB7FC01CE -:10B560008381813079F5818181FF2CC08189928925 -:10B57000A389B489892B8A2B8B2B09F448C07F01BE -:10B5800040E050E0BA01CF010E942FCE8823D1F0D5 -:10B59000F70185889688A788B08CC18CD28C82E010 -:10B5A00090E0A0E0B0E0F60180839183A283B383B2 -:10B5B0009E012F5F3F4FB501A401C6010E94C1B992 -:10B5C000811102C080E03CC000E010E09801B501AC -:10B5D000A401C6010E9430B98823A1F389809A8012 -:10B5E000AB80BC80F6018789803141F4F8EF8F167B -:10B5F000FFEF9F06A104B10460F4DACF88EF88164C -:10B600008FEF9806A8068FE0B80618F4D1CF81E036 -:10B6100017C0F701158A168A178A108E118A128AA6 -:10B62000138A148A818180688183C7010E940FBBBD -:10B63000882341F240E050E0BA01C7010E942FCEBA -:10B640000F900F900F900F90DF91CF911F910F915E -:10B65000FF90EF90DF90CF90BF90AF909F908F9032 -:10B6600008950F931F93CF93DF938C01E0E7F2E1EE -:10B670008491EF012196882321F00E948339FE01F5 -:10B68000F7CFF8018491EF012196882321F00E94E1 -:10B690008339FE01F7CF60919109709192098091F1 -:10B6A0009309909194090E941B3E8AE00E9483397D -:10B6B0000E94F2F71092900910928F09DF91CF91BA -:10B6C0001F910F9108952F923F924F925F926F9228 -:10B6D0007F928F929F92AF92BF92CF92DF92EF9222 -:10B6E000FF920F931F93CF93DF93CDB7DEB7C2576F -:10B6F000D1090FB6F894DEBF0FBECDBF8C013B0160 -:10B700004A014DB75EB7E1965FAF4EAFE197AD9698 -:10B710001FAEAD971B0154E0250E311C7E018FE555 -:10B72000E80EF11C9BE7492E92E0592EE0E4F0E090 -:10B73000EC0FFD1F3496E396FFAFEEAFE397F301F6 -:10B740008781823008F462C184859585A685B78596 -:10B750008F719927AA27BB27892B8A2B8B2B09F05E -:10B7600055C11092B50A45EB5AE0BE016F5F7F4F9D -:10B77000C1010E94A7BA18160CF048C18C85982FF9 -:10B780009871903129F42091220D2150223078F4C3 -:10B790002981222309F43AC1253E89F22E3279F219 -:10B7A0002091B50A2E3259F28A7049F6B8C04DB7C9 -:10B7B0005EB7AF965FAF4EAFAF97BE016F5F7F4F83 -:10B7C000C7010E94A2B80115110521F0F80180817E -:10B7D00081119BC021E081E090E0F7010190002001 -:10B7E000E9F73197EE19FF098E0F9F1F02964DB7AB -:10B7F0005EB7481B590B0FB6F8945EBF0FBE4DBF26 -:10B800008DB79EB701965C01211102C0B80102C03C -:10B810006EE573E0C5010F94B60FB701C5010F9433 -:10B82000970F6EE573E0C5010F94970F25961FAE35 -:10B83000259728961FAE289724961FAE1EAE2497F4 -:10B8400022965FAE4EAE229721E0A701B101E396AA -:10B850008EAD9FADE3970E94ACD481112AC0809138 -:10B86000220D811126C0EFE9F2E184916F019FEF73 -:10B87000C91AD90A882321F00E948339F601F5CF2D -:10B88000EBE8F2E184916F012FEFC21AD20A88230C -:10B8900021F00E948339F601F5CF6701F60181910D -:10B8A0006F01882319F00E948339F8CF8AE00E9443 -:10B8B00083398BE1FE01EC5BFF4FDE019596019031 -:10B8C0000D928A95E1F724968EAD9FAD24979CA3A7 -:10B8D0008BA35AA249A240E050E0BE016F5D7F4FAA -:10B8E000C501F1DECE0181960E9436BFCE01805C9B -:10B8F0009F4F0E9436BFAF964EAD5FADAF970FB66C -:10B90000F8945EBF0FBE4DBF1ACFF8010190002022 -:10B91000E9F73197CF01801B910B20E05ECF81E0EA -:10B92000903109F080E08093A70A903141F0898539 -:10B93000873409F004CF8A858E3709F400CF8091CF -:10B94000220D813029F08230D9F18111F8CE0AC060 -:10B950008091230D9091240D01969093240D809356 -:10B96000230DEDCEBE016F5F7F4F88EA9AE00E9403 -:10B97000A2B80115110529F488EAC82E8AE0D82E4C -:10B9800009C06801F60181916F018823A9F30E9423 -:10B990008339F8CFF60181916F01882319F00E9455 -:10B9A0008339F8CF80E20E9483396D8D7E8D8F8D33 -:10B9B00098A14AE00E94743D8AE00E948339BFCE7C -:10B9C000BE016F5F7F4F88EA9AE00E94A2B881149F -:10B9D000910441F068EA7AE0C4010F94840F892B46 -:10B9E00069F414C0AD96FFADAD978F2F90E0209114 -:10B9F000270D3091280D8217930741F0AD962FAD9A -:10BA0000AD972F5FAD962FAFAD9799CEE1968EADE6 -:10BA10009FADE1970FB6F8949EBF0FBE8DBFCE5875 -:10BA2000DF4F0FB6F894DEBF0FBECDBFDF91CF91D1 -:10BA30001F910F91FF90EF90DF90CF90BF90AF904C -:10BA40009F908F907F906F905F904F903F902F903E -:10BA500008950F931F93CF93DF93CDB7DEB76F9702 -:10BA60000FB6F894DEBF0FBECDBF8B0122E020934E -:10BA7000220D9093280D8093270D8CEF9AE00E9461 -:10BA800076D08BE1ECEFFAE0DE01159601900D9295 -:10BA90008A95E1F78091FA0A9091FB0A9C838B8347 -:10BAA0008BE792E09A838983A801BE016F5F7F4F85 -:10BAB00080E090E008DECE0101960E9436BF6F96CE -:10BAC0000FB6F894DEBF0FBECDBFDF91CF911F91AF -:10BAD0000F9108952F923F924F925F926F927F92B3 -:10BAE0008F929F92AF92BF92CF92DF92EF92FF928E -:10BAF0000F931F93CF93DF93CDB7DEB76F970FB63A -:10BB0000F894DEBF0FBECDBF6C012DB63EB61D82D0 -:10BB100018861C821B828BE792E09A838983FB0143 -:10BB200080819E012F5F3F4F39018F3241F088EFB6 -:10BB30009AE0F60191838083F62E172F63C089ED7A -:10BB40009AE0F601918380838B010F5F1F4F0115EF -:10BB5000110509F455C04DB65EB66FE270E0C8013C -:10BB60000F94A20F4C010817190708F047C07C0179 -:10BB7000E01AF10AFF24C70101962DB73EB7281B32 -:10BB8000390B0FB6F8943EBF0FBE2DBF8DB79EB7D1 -:10BB900001965C01A701B8010F94CB0FF501EE0DE2 -:10BBA000FF1D1082F601608171816115710511F030 -:10BBB0006C5F7F4F21E0A501CE0105960E94ACD4B9 -:10BBC000811110C0B50187E792E152DA8EE20E943E -:10BBD00083398AE00E9483390FB6F8945EBE0FBEA7 -:10BBE0004DBE0EC0F6017182608284010F5F1F4F4F -:10BBF0000FB6F8945EBE0FBE4DBEA9CFF02E02C0A8 -:10BC0000F12C10E0C3010E9436BF8F2D912F0FB68B -:10BC1000F8943EBE0FBE2DBE6F960FB6F894DEBFF1 -:10BC20000FBECDBFDF91CF911F910F91FF90EF908D -:10BC3000DF90CF90BF90AF909F908F907F906F904C -:10BC40005F904F903F902F900895DF92EF92FF9278 -:10BC50000F931F93CF93DF9300D01F921F92CDB706 -:10BC6000DEB72091A60A222309F492C1D62E7C01C8 -:10BC70008091780C882309F4A2C0442309F45BC1A5 -:10BC80008091900C882329F1E0E7F2E184918F0103 -:10BC90000F5F1F4F882321F00E948339F801F6CFF0 -:10BCA000EDE2F2E184918F010F5F1F4F882321F0B5 -:10BCB0000E948339F801F6CF61E070E080E090E007 -:10BCC0000E941B3E8AE00E94833984E292E10E9436 -:10BCD00052BF86E99CE09A8389838FE28093950C1A -:10BCE00081E08B8310E00FE180914D0C181778F400 -:10BCF000019FC0011124AE014D5F5F4FBE016F5F18 -:10BD00007F4F895E944F0E9473B81F5FEDCF8B8188 -:10BD100087FD0FC0AE014D5F5F4FBE016F5F7F4F6C -:10BD200081E79CE00E9473B889819A8101979A8388 -:10BD30008983E981FA811082E091900C84E0E89F88 -:10BD4000F0011124EF56F34F8091D50A9091D60A55 -:10BD5000A091D70AB091D80A80839183A283B3833C -:10BD6000EFE9F2E184918F010F5F1F4F882321F0EB -:10BD70000E948339F801F6CFB7018BE092E178D9C0 -:10BD80006091900C9DE8699FB00111246B56734F30 -:10BD900080E092E16DD94091D50A5091D60A609128 -:10BDA000D70A7091D80A8AEF91E10FD98AE00E94F0 -:10BDB00083398091900C8F5F8093900C25C0442331 -:10BDC000C1F0EFE9F2E184918F010F5F1F4F8823EB -:10BDD00021F00E948339F801F6CFEAEEF1E1849177 -:10BDE0008F010F5F1F4F882379F00E948339F8017C -:10BDF000F6CF1092900C82E09FC0B70181ED91E1E7 -:10BE000037D98AE00E9483391092A50A8091780C74 -:10BE1000882321F085E79CE00E9419CFB701CE016D -:10BE2000039658DE8C01892B09F4B2C09B818C816A -:10BE3000692F782FDD2009F457C06115710511F0C5 -:10BE40006C5F7F4F21E0A80185E79CE00E94ACD4A5 -:10BE5000882309F445C08091860C9091870CA091AD -:10BE6000880CB091890C8093D10A9093D20AA09348 -:10BE7000D30AB093D40A1092D50A1092D60A10921F -:10BE8000D70A1092D80AB80183EC91E1F1D8409119 -:10BE9000D10A5091D20A6091D30A7091D40A8BEBE7 -:10BEA00091E193D88AE00E948339ECEAF1E1849130 -:10BEB0007F019FEFE91AF90A882321F00E94833954 -:10BEC000F701F5CFB80180E090E0C3DD8091B50ABD -:10BED000882319F085EB9AE001C0C80160E028C012 -:10BEE000B80188E991E110C06115710511F06C5F2E -:10BEF0007F4F26E5A80185E79CE00E94ACD4811124 -:10BF00000BC0B80184E891E1B3D88EE20E94833976 -:10BF10008AE00E9483393CC081E08093A30AB70184 -:10BF200082E791E1A5D88AE00E94833960E0C801E8 -:10BF30000E9455702DC081E08D83EFE9F2E184917C -:10BF40008F010F5F1F4F882321F00E948339F80172 -:10BF5000F6CFE5EEF1E184918F010F5F1F4F88234B -:10BF600021F00E948339F801F6CF9D81913019F0BC -:10BF7000EFEDF1E102C0E9EDF1E184918F010F5F96 -:10BF80001F4F882309F439CF0E948339F801F5CF78 -:10BF90000F900F900F900F900F90DF91CF911F9106 -:10BFA0000F91FF90EF90DF9008954F925F926F9204 -:10BFB0007F928F929F92AF92BF92CF92DF92EF9239 -:10BFC000FF92CF93DF93EBEBF3E18491EF012196A6 -:10BFD000882321F00E948339FE01F7CF2091A60F1C -:10BFE0003091A70F4091A80F5091A90F6091B60F03 -:10BFF0007091B70F8091B80F9091B90F0F94580CB2 -:10C0000042E00E94353EE7EBF3E18491EF01219697 -:10C01000882321F00E948339FE01F7CF2091AA0FD7 -:10C020003091AB0F4091AC0F5091AD0F6091BA0FB2 -:10C030007091BB0F8091BC0F9091BD0F0F94580C65 -:10C0400042E00E94353EE3EBF3E18491EF0121965B -:10C05000882321F00E948339FE01F7CF2091AE0F93 -:10C060003091AF0F4091B00F5091B10F6091BE0F62 -:10C070007091BF0F8091C00F9091C10F0F94580C19 -:10C0800042E00E94353EEFEAF3E18491EF01219610 -:10C09000882321F00E948339FE01F7CF6091C20FFF -:10C0A0007091C30F8091C40F9091C50F42E00E9420 -:10C0B000353E80916F00982F927081FF05C080916E -:10C0C0006F008D7F80936F00409034145090351432 -:10C0D0006090361470903714809038149090391412 -:10C0E000A0903A14B0903B14C0903C14D0903D14F2 -:10C0F000E0903E14F0903F14992329F080916F0056 -:10C10000826080936F00E5EAF3E18491EF0121966C -:10C11000882321F00E948339FE01F7CFC301B201C9 -:10C120000E941B3EE1EAF3E18491EF01219688230E -:10C1300021F00E948339FE01F7CFC501B4010E94AE -:10C140001B3EEDE9F3E18491EF012196882321F074 -:10C150000E948339FE01F7CFC701B6010E941B3E42 -:10C160008AE0DF91CF91FF90EF90DF90CF90BF906A -:10C17000AF909F908F907F906F905F904F900C94B6 -:10C18000833983E50E94E838882399F00E946C384F -:10C1900020E030E04AE754E40F9471080F94A10DB9 -:10C1A0006093450270934602809347029093480241 -:10C1B000089588E50E949F38811111C089E50E9489 -:10C1C0009F3881110CC08AE50E949F38811107C0F9 -:10C1D00085E40E949F38811102C00C94434E0E9456 -:10C1E0002E4D88E50E949F38882331F0179A809160 -:10C1F000A50F8E7F8093A50F89E50E949F38882325 -:10C2000031F0169A8091A50F8D7F8093A50F8AE556 -:10C210000E949F38882331F0159A8091A50F8B7F5B -:10C220008093A50F85E40E949F38882311F0149A0B -:10C23000089508952F923F924F925F926F927F924E -:10C240008F929F92AF92BF92CF92DF92EF92FF9226 -:10C250000F931F93CF93DF93CDB7DEB762970FB6DF -:10C26000F894DEBF0FBECDBF8091070483FDA2C14D -:10C2700083E50E94E8388C87811106C082E50E9420 -:10C28000E838882309F496C10E946C380F949C0DFD -:10C29000663971050CF08BC1709308146093071414 -:10C2A0000E94E6750E946C3820E030E040EA50E4DD -:10C2B0000F947E0E181614F40E94ECF0609107148F -:10C2C00070910814072E000C880B990B0F9412081C -:10C2D0002091DB123091DC124091DD125091DE1280 -:10C2E0000F947E0E18161CF08FE793E102C08EE8C3 -:10C2F00093E160E00E941B7081E0809313028091C3 -:10C30000111480936A0D1A821B821C821D8218866A -:10C3100019861A861B8619821D862CE32E873CE11E -:10C320003F8746E4488B312C212C50E8598B8FEB0A -:10C330008A8B812C912C5401609107147091081400 -:10C34000072E000C880B990B0F9412087B018C01AF -:10C350009B01AC01632D722D89899A890F940C0879 -:10C36000882309F442C02091DB123091DC12409105 -:10C37000DD125091DE129C85B701802F91110CC007 -:10C38000912F0F940C08881F8827881F89833E2CC3 -:10C390002F2C098B1A8B29C0912F0F940C0887FF23 -:10C3A0001FC080911302882309F404C162960FB65E -:10C3B000F894DEBF0FBECDBFDF91CF911F910F91DB -:10C3C000FF90EF90DF90CF90BF90AF909F908F90B5 -:10C3D0007F906F905F904F903F902F900C9409F456 -:10C3E0003E2C2F2C098B1A8B19820E94D7ED6B01E2 -:10C3F0007C01DC01CB01288539854A855B85821B60 -:10C40000930BA40BB50BB7FD3BC0D701C6018851F8 -:10C410009C4FAF4FBF4F88879987AA87BB870E94E1 -:10C420002C75EBE7F3E184913F019FEF691A790ADC -:10C43000882321F00E948339F301F5CF8114910400 -:10C44000A104B104B9F0D501C401805F984DAF4F8C -:10C45000BF4FBC01CD016C197D098E099F0928EEE3 -:10C4600033E040E050E00F94FA0BCA01B9010E949A -:10C470001B3E03C08FE30E9483398AE00E94833908 -:10C480000E94B2BF0E94D7ED60932C1370932D13BE -:10C4900080932E1390932F13A091DB12AE83B09153 -:10C4A000DC12BF830091DD121091DE129D01A80104 -:10C4B000632D722D89899A890F94570C2B013C01A9 -:10C4C00020E030E0A9010F947E0E87FF04C077FAC8 -:10C4D000709477F8709481149104A104B10459F414 -:10C4E00020E030E040E85FE3C301B2010F940C08A4 -:10C4F00087FF0DC00AC020E030E040E450E4C301F3 -:10C50000B2010F947E0E181614F4460157012981CA -:10C510002223A9F18A819B81AC81BD81892B8A2B41 -:10C520008B2B61F0D701C6012A813B814C815D8153 -:10C53000821B930BA40BB50BB7FD21C02E813F814D -:10C54000A8016D857E858F8598890F94570C20E012 -:10C5500030E040EC5FE30F940C0887FD22CFD70159 -:10C56000C601805A9541AF4FBF4F8A839B83AC83EE -:10C57000BD839E819D87AF81AE870F87188B809189 -:10C580001302882309F40DCF81149104A104B1048E -:10C5900009F4D2CEB0E1CB1AB7E2DB0AE108F10828 -:10C5A000C818D908EA08FB08F7FEFBCEC5CE66E935 -:10C5B00070E072CE62960FB6F894DEBF0FBECDBFAC -:10C5C000DF91CF911F910F91FF90EF90DF90CF906F -:10C5D000BF90AF909F908F907F906F905F904F90A3 -:10C5E0003F902F9008952F923F924F925F926F92BB -:10C5F0007F928F929F92AF92BF92CF92DF92EF92F3 -:10C60000FF920F931F93CF93DF93CDB7DEB762975F -:10C610000FB6F894DEBF0FBECDBF8DE690E00E944E -:10C62000DF3D8111ACC18091070483FDA8C183E582 -:10C630000E94E8388F83811106C082E50E94E838A5 -:10C64000882309F49CC10E946C380F949C0D709350 -:10C650000A146093091480E00E9432760E946C38BC -:10C6600020E030E04AEA52E40F940C0818162CF04F -:10C670000E9423F10E9409F402C00E94ECF0609134 -:10C68000091470910A14072E000C880B990B0F9453 -:10C6900012086B017C018090D7129090D812A09064 -:10C6A000D912B090DA12A50194010F947E0E1816DB -:10C6B00074F02F81211110C0A5019401C701B601AA -:10C6C0000F947E0E18161CF081E693E102C08EE6F0 -:10C6D00093E160E00E941B700E94535881E08093B8 -:10C6E00013021B821C821D821E8219861A861B86DB -:10C6F0001C861A821D863CE33E874CE14F8756E438 -:10C70000588B1A8A312C80E889839FEB998B812C76 -:10C71000912C54016091091470910A14072E000C99 -:10C72000880B990B0F9412087B018C019B01AC01C3 -:10C730006A89732D898199890F940C08882309F4DB -:10C7400040C02091D7123091D8124091D912509107 -:10C75000DA12AF81B701C801A1110BC00F940C0808 -:10C76000881F8827881F8A83EA8A3F2C0983198BB0 -:10C7700028C00F940C0887FF1FC0809113028823E4 -:10C7800009F4FDC062960FB6F894DEBF0FBECDBFB0 -:10C79000DF91CF911F910F91FF90EF90DF90CF909D -:10C7A000BF90AF909F908F907F906F905F904F90D1 -:10C7B0003F902F900C9409F4EA8A3F2C0983198B3F -:10C7C0001A820E94D7ED6B017C01DC01CB01298527 -:10C7D0003A854B855C85821B930BA40BB50BB7FD8B -:10C7E0003BC0D701C60188519C4FAF4FBF4F8987CF -:10C7F0009A87AB87BC870E942C75EDE5F3E18491A5 -:10C800003F019FEF691A790A882321F00E9483393A -:10C81000F301F5CF81149104A104B104B9F0D5015D -:10C82000C401805F984DAF4FBF4FBC01CD016C1963 -:10C830007D098E099F0928EE33E040E050E00F9417 -:10C84000FA0BCA01B9010E941B3E03C08FE30E948C -:10C8500083398AE00E9483390E94B2BF0E94D7EDDB -:10C8600060932C1370932D1380932E1390932F139A -:10C870002090D712A091D812A8870091D9121091B8 -:10C88000DA12222D3A2FA8016A89732D898199899C -:10C890000F94570C2B013C0120E030E0A9010F94CC -:10C8A0007E0E87FF04C077FA709477F87094811435 -:10C8B0009104A104B10459F420E030E040E85FE3C2 -:10C8C000C301B2010F940C0887FF0DC00AC020E01D -:10C8D00030E040E450E4C301B2010F947E0E18161C -:10C8E00014F446015701BA81BB2389F12B813C81A5 -:10C8F0004D815E81211531054105510541F0D7017A -:10C90000C601821B930BA40BB50BB7FD20C0222DD3 -:10C910003885A8016D857E858F8598890F94570C81 -:10C9200020E030E040EC5FE30F940C0887FD25CF5A -:10C93000D701C601805A9541AF4FBF4F8B839C836F -:10C94000AD83BE832D8698859E870F87188B809137 -:10C950001302882309F411CF81149104A104B104B6 -:10C9600009F4D8CEA0E1CA1AA7E2DA0AE108F10870 -:10C97000C818D908EA08FB08F7FEFFCECBCE6296AE -:10C980000FB6F894DEBF0FBECDBFDF91CF911F91E0 -:10C990000F91FF90EF90DF90CF90BF90AF909F905E -:10C9A0008F907F906F905F904F903F902F90089561 -:10C9B0002F923F924F925F926F927F928F929F92AF -:10C9C000AF92BF92CF92DF92EF92FF920F931F939D -:10C9D000CF93DF93CDB7DEB7A5970FB6F894DEBF40 -:10C9E0000FBECDBF0E94FD92811145C48091640F9E -:10C9F000882369F08FE40E94E838882319F00E94A8 -:10CA00005D3803C08FE40E949F38811134C41091B7 -:10CA1000640F87E50E949F38882309F42BC1809119 -:10CA20005C0F90915D0F892BD1F4E0E7F2E18491E6 -:10CA30008F010F5F1F4F811103C0E6E1F3E104C0D6 -:10CA40000E948339F801F3CF84918F010F5F1F4F4C -:10CA5000882309F410C40E948339F801F5CF8AE5D0 -:10CA60000E94E838882379F00E946C382091AE0F3C -:10CA70003091AF0F4091B00F5091B10F0F94570C00 -:10CA80006B017C0108C0C090BE0FD090BF0FE0903A -:10CA9000C00FF090C10F20E030E040E251ECC70140 -:10CAA000B6010F947E0E87FD0AC020E030E040E220 -:10CAB00051E4C701B6010F940C081816D4F4E0E74E -:10CAC000F2E184918F010F5F1F4F811103C0E9E0F4 -:10CAD000F3E104C00E948339F801F3CF84918F0100 -:10CAE0000F5F1F4F882309F4C6C30E948339F801E2 -:10CAF000F5CF88E50E94E838882319F00E946C3849 -:10CB000004C060E070E080EC9FE72091A60F3091B8 -:10CB1000A70F4091A80F5091A90F0F94570C4B01EC -:10CB20005C0189E50E94E838882319F00E946C387E -:10CB300004C060E070E080EC9FE72091AA0F309184 -:10CB4000AB0F4091AC0F5091AD0F0F94570C2B01D0 -:10CB50003C0189E40E94E838882319F00E944C388F -:10CB600001C08FEF082F8AE40E94E838882319F06B -:10CB70000E944C3801C08FEF382EA5019401C501E9 -:10CB8000B4010F94040F81114EC0A3019201C3019F -:10CB9000B2010F94040F811146C06091E0137091AF -:10CBA000E113072E000C880B990B0F9412089B01C0 -:10CBB000AC01C501B4010F94570C20E030E0A9018D -:10CBC0000F94580C20E030E0A9010F94340D0F941D -:10CBD0009C0D062F6091E2137091E313072E000C59 -:10CBE000880B990B0F9412089B01AC01C301B20191 -:10CBF0000F94570C20E030E0A9010F94580C20E06E -:10CC000030E0A9010F94340D0F949C0D202F0330B8 -:10CC10000CF022E0022F27FD00E063300CF062E010 -:10CC2000362E67FD312C033008F025C383E08315D1 -:10CC300008F421C380E00E94EB36202F000F330B55 -:10CC4000F901EE0FFF1FE20FF31FE30DF11D37FC9B -:10CC5000FA95EE0FFF1FEE0FFF1FEF58F04FC08247 -:10CC6000D182E282F382812F0E94EB36112309F4F4 -:10CC700002C3B2C08AE40E949F38882309F4AEC080 -:10CC80000E943C37F8C2E418F508F7FE03C0AFEF86 -:10CC9000EA1AFA0A5701B594A794B5010B2C000CB7 -:10CCA000880B990B0F9412086A8F7B8F8C8F9D8F46 -:10CCB000C618D708D7FE03C0BFEFCB1ADB0A460160 -:10CCC00095948794B401092C000C880B990B0F9450 -:10CCD00012086B017C010E94CC3360915C0F709153 -:10CCE0005D0F072E000C880B990B0F9412089B0107 -:10CCF000AC016A8D7B8D8C8D9D8D0F940C088111FC -:10CD00007BC160915E0F70915F0F072E000C880B46 -:10CD1000990B0F9412089B01AC01C701B6010F9447 -:10CD20000C08811169C18091E0139091E1134816BC -:10CD3000590609F061C18091E2139091E3136816DE -:10CD4000790609F059C185E40E94E838882309F47E -:10CD500067C10E945D38811120C2E2E0E98B1A862A -:10CD60001986F1E0F88B812C912C540181E08E879B -:10CD700093E09D87312CF88981E0F827F88B89852D -:10CD80009A85092E000CAA0BBB0B8AA39BA3ACA30C -:10CD9000BDA39D85931148C189859A85029749F065 -:10CDA000A5019401C501B4010F94040F882309F46F -:10CDB0004DC280E00E94F934882309F4F1C1812F2B -:10CDC0000E94EB360E94B33381E080932B13809155 -:10CDD000640F81110E94D635E8D84DC286E50E94C5 -:10CDE000E838882309F4F1C00E943C387C876B87BF -:10CDF000AB85BC85159768F0E1EEF2E184918F0177 -:10CE00000F5F1F4F882309F436C20E948339F8014F -:10CE1000F5CF84E40E94E838882319F00E945D3839 -:10CE200003C084E40E949F38282E8AE50E94E838D7 -:10CE3000882339F00E946C386E8F7F8F88A399A366 -:10CE400004C01E8E1F8E18A219A283E50E94E83826 -:10CE5000882319F00E946C3804C060E070E08AEF0B -:10CE600095E420E030E040E752E40F94340D609305 -:10CE70003B0270933C0280933D0290933E028CE40F -:10CE80000E94E838882381F00E946C382091A60F18 -:10CE90003091A70F4091A80F5091A90F0F94570CF4 -:10CEA0000F949C0D2B0103C0F3E24F2E512C82E511 -:10CEB0000E94E838882381F00E946C382091A60FE8 -:10CEC0003091A70F4091A80F5091A90F0F94570CC4 -:10CED0000F949C0D7B0104C0E2E2EE2EFF24F3943C -:10CEE00086E40E94E838882381F00E946C38209103 -:10CEF000AA0F3091AB0F4091AC0F5091AD0F0F9432 -:10CF0000570C0F949C0D3B0103C07AE0672E712CE7 -:10CF100082E40E94E838882381F00E946C382091D6 -:10CF2000AA0F3091AB0F4091AC0F5091AD0F0F9401 -:10CF3000570C0F949C0D6B0104C062E2C62EDD24D9 -:10CF4000D394B301072C000C880B990B0F94120893 -:10CF50006A8B7B8B8C8B9D8BB201052C000C880B14 -:10CF6000990B0F9412086E8B7F8B888F998F2A896B -:10CF70003B894C895D890E94BDBE811103C0E5ECEF -:10CF8000F2E118C0B6010D2C000C880B990B0F9420 -:10CF900012084B015C01B7010F2C000C880B990B98 -:10CFA0000F941208A50194010E94BDBE8F878111C4 -:10CFB0000FC0E5CF84918F010F5F1F4F882309F4C5 -:10CFC0005AC10E948339F801F5CF1C861B8610CF09 -:10CFD000EB85FC85EF2B09F0C0C00E942E4D80E050 -:10CFE0000E94EB3681E00E94F934882309F44BCE8D -:10CFF000812F0E94EB363FC10E943C37B0925D0FFB -:10D00000A0925C0F90925F0F80925E0F5092E1139E -:10D010004092E0137092E3136092E21310E093CE1B -:10D0200085E40E949F3897CE632D032C000C770B6C -:10D03000880B990B0F9412082A8D3B8D4C8D5D8DBA -:10D040000F9471082E893F89488D598D0F94580C83 -:10D050002B013C016AA17BA18CA19DA10F94120818 -:10D06000A70196010F9471082A893B894C895D8933 -:10D070000F94580C4B015C0120E030E0A901C30182 -:10D08000B2010F940C0887FF04C060E070E0CB0190 -:10D0900004C060E070E080E09FE3A30192010F9480 -:10D0A000580C0F94CD0D69837A838B839C8320E089 -:10D0B00030E0A901C501B4010F940C0887FF04C03A -:10D0C00060E070E0CB0104C060E070E080E09FE3CE -:10D0D000A50194010F94580C0F94CD0D6D837E83A0 -:10D0E0008F8398872B854989BE016B5F7F4FCE0167 -:10D0F00001960E94A6934B015C019B01AC010F9429 -:10D10000040F882321F0812F0E94EB3652CE832D0D -:10D11000032C000C990B8C01000F111F080F191F15 -:10D12000A985BA850A0F1B1F000F111F000F111FC1 -:10D130000F58104F2E8D3F8D48A159A1C501B40144 -:10D140000F94580CF80160837183828393830E944B -:10D15000B2BFFE853F0E10E01CCEEFEAF2E18491F3 -:10D160005F01BFEFAB1ABB0A882321F00E9483390D -:10D17000F501F5CF222069F0E5EAF2E184915F0143 -:10D180009FEFA91AB90A882321F00E948339F5017B -:10D19000F5CF8AE00E94833920CFF1E0F98BDFCD13 -:10D1A000A5019401C501B4010F94040F81110ACEA9 -:10D1B0002220F9F00E94A63E0E943B33211041C07C -:10D1C00086EB9FE00E94B8F59B01AC016091BE0F19 -:10D1D0007091BF0F8091C00F9091C10F0F94570CA9 -:10D1E0006093BE0F7093BF0F8093C00F9093C10FD9 -:10D1F00029C001E092E0E92EF12CDE2CD01AF39444 -:10D20000CE2CCF1821E041E06C2D802F0E949DF99B -:10D2100021E04FEF6C2D8D2D0E949DF92FEF41E005 -:10D220006F2D802F0E949DF92FEF4FEF6F2D8D2DC9 -:10D230000E949DF992E0F912E2CF015008F4BACFB2 -:10D24000DBCF1F87AF85A093640FBCCD888988236F -:10D2500059F0A1E0AE87B3E0BD87312CE985FA85AE -:10D260003196FA87E98787CD9FEF9E87AFEFAD872D -:10D2700082E0382EF3CFA5960FB6F894DEBF0FBE2E -:10D28000CDBFDF91CF911F910F91FF90EF90DF9075 -:10D29000CF90BF90AF909F908F907F906F905F9056 -:10D2A0004F903F902F900895EF92FF920F931F930E -:10D2B000CF93DF93CDB7DEB76D970FB6F894DEBF8F -:10D2C0000FBECDBF8091A60A882309F48EC085E7E2 -:10D2D0009CE00E940FBB85E79CE00E9419CF109252 -:10D2E000A40A1092A30A8091A60A882309F47DC09B -:10D2F00000916314109164141092A50A8091780C27 -:10D30000882321F085E79CE00E9419CFB801CE0167 -:10D310004C960E946A5D8C01892B09F466C06C8D65 -:10D320007D8D6115710511F06C5F7F4F19821C8234 -:10D3300022E0A801CE0101960E94ACD4811102C066 -:10D34000F12C14C0CE0101960E949F5A8823C1F38C -:10D3500061E0CE0101960E9422CF009789F325EE6D -:10D36000FC0120831C820E94B8B8F82ECE010196E1 -:10D370000E947339FF2009F1E8E2F3E184917F0113 -:10D380009FEFE91AF90A882321F00E948339F701F7 -:10D39000F5CFF80181918F01882319F00E9483391C -:10D3A000F8CF8AE00E9483391092D50A1092D60AEB -:10D3B0001092D70A1092D80A18C0E6E3F3E18491DC -:10D3C0007F019FEFE91AF90A882321F00E9483392F -:10D3D000F701F5CFF80181918F01882319F00E94A0 -:10D3E0008339F8CF8EE20E9483396D960FB6F89498 -:10D3F000DEBF0FBECDBFDF91CF911F910F91FF9088 -:10D40000EF9008950B96FC01849108950A96FC0113 -:10D4100084910895FC0184910895FCDF882321F014 -:10D42000823011F083E0089586E00895FC01E60F54 -:10D43000F11D849190E0982F88273196E4918E0F0A -:10D44000911D089568E0F2CF66E0F0CF81E0089585 -:10D450000F93FC010150040F84A996A9941718F0AA -:10D46000081728F402C0081750F0041740F42150A0 -:10D47000260F83A995A9961720F4281720F480E099 -:10D4800007C0281720F481E0261710F0F8CF81E0BC -:10D490000F9108955F926F927F928F929F92AF92B9 -:10D4A000BF92CF92DF92EF92FF920F931F93CF9391 -:10D4B000DF93EC01062F142FC22EEC80FD80C701F4 -:10D4C000A9DFD82E8C819D81A8DF982E21E0D21271 -:10D4D00003C02FE0A22E02C0AA24AA948C819D81B1 -:10D4E00095DFD82E8C819D818DDFB82E8C819D811A -:10D4F000A9DFE0E6EC1538F4009729F0E80EF91EF4 -:10D5000091E6D92E10C08C819D819EDFF0E4FC1540 -:10D5100038F4009729F0E80EF91E81E4D82E03C0F4 -:10D5200021E1E20EF11CBC1430F4188A1B8A1C8A1B -:10D53000198A1A8A97C0BD14C0F3892D90E0F701AB -:10D5400024912F3F21F4FFEFEF1AFF0A3FC0CD10C7 -:10D5500034C08C819D815EDF97012F5F3F4FF701C3 -:10D56000882311F0823091F484918B8BF9012491FE -:10D570002C8BF7013396E491E88BF7013496E49114 -:10D58000E98BF7013596E491EA8B25C08491982FB9 -:10D590009F7092509A8B82958F70898BF90124919C -:10D5A000822F8F708C8B22952F702B8BF7013296E8 -:10D5B000E491E295EF70E88B0EC0F7013296E491AA -:10D5C000EA219C012E0F311DE20EF31EBD1409F459 -:10D5D000ACCFD394B4CFE114F10409F443C08C81EF -:10D5E0009D811BDFA82EDB88BC88C988C00E8A8974 -:10D5F0008B0D181B0B2D2D2D412F6C2DCE0128DFEF -:10D60000882371F1EA0CF11C87E08D0DD82ED69499 -:10D61000D694D6945B2C510E4E01FCE18F0E911CDA -:10D620006D2C712C5116E1F00C2D57018A2D8E199D -:10D630008D1590F4F50184916A817B810C8F1D8F8B -:10D640001F8E8E8F94014BE3CE010E94EB7DFFEF86 -:10D65000AF1ABF0A085FEACFE60CF71C1F5FE2CFE4 -:10D66000888901C080E0DF91CF911F910F91FF90D9 -:10D67000EF90DF90CF90BF90AF909F908F907F9072 -:10D680006F905F9008958F929F92AF92BF92CF92CA -:10D69000DF92EF92FF92CF93FC01C080D180E280B5 -:10D6A000F38020E030E0A901C701B6010F940C0817 -:10D6B00087FF08C0C701B601905820E030E04AE774 -:10D6C00054E406C020E030E04AE754E4C701B60164 -:10D6D0000F94710820E030E040EA50E40F94580CB9 -:10D6E00020E030E040E251E40F94340D0F949C0DA3 -:10D6F0006B017C01603AF6E87F07F1E08F07910546 -:10D7000084F020EA36E841E050E00F941C0CCA0196 -:10D71000B9012AE030E040E050E00F941C0C605D5D -:10D7200001C060E26093F01380E1C81687E2D8067A -:10D73000E104F10494F0C701B60120E137E240E0D2 -:10D7400050E00F941C0CCA01B9012AE030E040E01F -:10D7500050E00F941C0C605D01C060E26093F11317 -:10D76000E8EECE16E3E0DE06E104F10494F0C70132 -:10D77000B60128EE33E040E050E00F941C0CCA01E3 -:10D78000B9012AE030E040E050E00F941C0C605DED -:10D7900001C060E26093F213C701B60124E630E0F5 -:10D7A00040E050E00F941C0C8AE0882E912CA12CB4 -:10D7B000B12CCA01B901A50194010F941C0C605D44 -:10D7C0006093F3138EE28093F413C701B601A501B1 -:10D7D00094010F941C0CC62FCA01B901A501940134 -:10D7E0000F941C0C605D6093F513C05DC093F6133D -:10D7F00080EF93E1CF91FF90EF90DF90CF90BF90BB -:10D80000AF909F908F9008958F929F92AF92BF920A -:10D81000CF92DF92EF92FF92CF93FC01C080D18034 -:10D82000E280F38020E030E04AE754E4C701B6012B -:10D830000F9471084B015C0120E030E0A901C701A1 -:10D84000B6010F940C0887FD05C060E070E080EA27 -:10D8500090E404C060E070E080EA90ECA5019401DF -:10D860000F94580C20E030E040E251E40F94340D66 -:10D870000F949C0D6B017C0197FF0AC0F094E0941B -:10D88000D094C094C11CD11CE11CF11C8DE201C0DC -:10D890008BE28093F013C701B60120E137E240E04C -:10D8A00050E00F941C0C8AE0882E912CA12CB12CF6 -:10D8B000CA01B901A50194010F941C0C605D60932D -:10D8C000F113C701B60128EE33E040E050E00F94B9 -:10D8D0001C0CCA01B901A50194010F941C0C605DD8 -:10D8E0006093F213C701B60124E630E040E050E057 -:10D8F0000F941C0CCA01B901A50194010F941C0CD2 -:10D90000605D6093F3138EE28093F413C701B60158 -:10D91000A50194010F941C0CC62FCA01B901A501E1 -:10D9200094010F941C0C605D6093F513C05DC0936F -:10D93000F61380EF93E1CF91FF90EF90DF90CF90BF -:10D94000BF90AF909F908F9008958F929F92AF92CB -:10D95000BF92CF92DF92EF92FF92FC01C080D18004 -:10D96000E280F38020E030E0A901C701B6010F9406 -:10D970000C0887FF08C0C701B601905820E030E0CE -:10D9800040E251E406C020E030E040E251E4C7014B -:10D99000B6010F94710820E030E040EA50E40F94A3 -:10D9A000580C20E030E040E251E40F94340D0F9425 -:10D9B0009C0D6B017C016031F7E27F0781059105C9 -:10D9C00084F020E137E240E050E00F941C0CCA01E3 -:10D9D000B9012AE030E040E050E00F941C0C605D9B -:10D9E00001C060E26093F21388EEC81683E0D806A7 -:10D9F000E104F10494F0C701B60128EE33E040E001 -:10DA000050E00F941C0CCA01B9012AE030E040E05C -:10DA100050E00F941C0C605D01C060E26093F31352 -:10DA2000E4E6CE16D104E104F10494F0C701B60196 -:10DA300024E630E040E050E00F941C0CCA01B9012C -:10DA40002AE030E040E050E00F941C0C605D01C023 -:10DA500060E26093F413FAE0CF16D104E104F1041C -:10DA60009CF08AE0882E912CA12CB12CC701B60124 -:10DA7000A50194010F941C0CCA01B901A5019401E0 -:10DA80000F941C0C605D01C060E26093F513C70148 -:10DA9000B6012AE030E040E050E00F941C0C605DDD -:10DAA0006093F61382EF93E1FF90EF90DF90CF90B9 -:10DAB000BF90AF909F908F9008958F929F92AF925A -:10DAC000BF92CF92DF92EF92FF92FC01C080D18093 -:10DAD000E280F38020E030E048EC52E4C701B60178 -:10DAE0000F9471084B015C0120E030E0A901C701EF -:10DAF000B6010F940C0887FD05C060E070E080EA75 -:10DB000090E404C060E070E080EA90ECA50194012C -:10DB10000F94580C20E030E040E251E40F94340DB3 -:10DB20000F949C0D9B0177FF06C022273327261BED -:10DB3000370B8DE201C08BE28093F113C90168EECF -:10DB400073E00F94400FCB01EAE0F0E0BF010F94C7 -:10DB5000400F805D8093F213C90164E670E00F947A -:10DB6000400FCB01BF010F94400F805D8093F313F2 -:10DB7000C901BF010F94400F282FCB01BF010F94A3 -:10DB8000400F805D8093F4138EE28093F513205D47 -:10DB90002093F61381EF93E1FF90EF90DF90CF9009 -:10DBA000BF90AF909F908F9008958F929F92AF9269 -:10DBB000BF92CF92DF92EF92FF92CF93FC01C08091 -:10DBC000D180E280F38020E030E04AE754E4C701EE -:10DBD000B6010F9471084B015C0120E030E0A9010F -:10DBE000C701B6010F940C0887FD05C060E070E026 -:10DBF00080EA90E404C060E070E080EA90ECA50167 -:10DC000094010F94580C20E030E040E251E40F946E -:10DC1000340D0F949C0D6B017C0197FD10C020E129 -:10DC200037E240E050E00F941C0CCA01B9012AE031 -:10DC300030E040E050E00F941C0C605D09C0F094AF -:10DC4000E094D094C094C11CD11CE11CF11C6DE285 -:10DC50006093F113C701B60128EE33E040E050E0D5 -:10DC60000F941C0C8AE0882E912CA12CB12CCA0197 -:10DC7000B901A50194010F941C0C605D6093F2132F -:10DC8000C701B60124E630E040E050E00F941C0CE0 -:10DC9000CA01B901A50194010F941C0C605D609349 -:10DCA000F3138EE28093F413C701B601A50194012A -:10DCB0000F941C0CC62FCA01B901A50194010F9441 -:10DCC0001C0C605D6093F513C05DC093F61381EF8B -:10DCD00093E1CF91FF90EF90DF90CF90BF90AF9006 -:10DCE0009F908F9008959C0197FF0AC0EE27FF2711 -:10DCF000E81BF90BE436F1050CF44CC08DE230C0A2 -:10DD0000283E83E038073CF1C90168EE73E00F94C8 -:10DD1000400FCB01EAE0F0E0BF010F94400F805DBF -:10DD20008093F313C90164E670E00F94400FCB01B8 -:10DD3000BF010F94400F805D8093F413C901BF01B0 -:10DD40000F94400FCB01BF010F94400F805D809373 -:10DD5000F513F9013EC0F90124363105DCF080E20B -:10DD60008093F313CF0164E670E00F94400FCB0172 -:10DD70002AE030E0B9010F94400F805D8093F413E6 -:10DD8000CF01B9010F94400FCB01B9010F94400F9F -:10DD9000805D1DC080E28093F3138093F413EA301A -:10DDA000F10584F037FF02C08DE201C080E280936C -:10DDB000F413CF016AE070E00F94400F605D609350 -:10DDC000F51307C037FF02C08DE201C080E28093E7 -:10DDD000F513CF016AE070E00F94400F805D8093EF -:10DDE000F61383EF93E108959C0197FD0EC08436EE -:10DDF000910584F064E670E00F94400FCB016AE077 -:10DE000070E00F94400F805D06C031952195310977 -:10DE10008DE201C080E28093F4132A30310564F072 -:10DE2000EAE0F0E0C901BF010F94400FCB01BF0150 -:10DE30000F94400F805D01C080E28093F513C9010B -:10DE40006AE070E00F94400F805D8093F61384EFDA -:10DE500093E10895CF92DF92EF92FF926B017C01E4 -:10DE600083E3C816D104E104F10470F082E3C81A18 -:10DE7000D108E108F10862E370E080E090E00E94E0 -:10DE80009FED0E94DE79ECCFC701B6010E949FEDA5 -:10DE9000FF90EF90DF90CF900C94DE790F931F935B -:10DEA000CF93DF9300D000D0CDB7DEB783E992E007 -:10DEB0009C838B8304E610E01A830983BE016D5FA7 -:10DEC0007F4FCE0101960E942C928AEB92E09E83B6 -:10DED0008D831A830983BE016B5F7F4FCE0101964C -:10DEE0000E942C9226960FB6F894DEBF0FBECDBFCF -:10DEF000DF91CF911F910F9108950F931F93CF93AF -:10DF0000DF93982F862F8A01D22F692F0E94EB97DB -:10DF10009091E60980919F0F891748F19091E80947 -:10DF200080919E0F981718F1C4E1F801849188231D -:10DF300031F00E945198C81B0F5F1F4FF6CFCC23C2 -:10DF400029F080E20E948A59C150F9CF80919F0F39 -:10DF50009AE79093E9098093EA098D2F0E946898C7 -:10DF600080E2DF91CF911F910F910C948A59DF913C -:10DF7000CF911F910F91089589ED93E10E94B959B6 -:10DF800081E080933B0D08950F931F930E94D7ED7E -:10DF90000091490D10914A0D20914B0D30914C0D7F -:10DFA000DC01CB01801B910BA20BB30BB7FD0FC0A3 -:10DFB0008091030185FB992790F981E08927909151 -:10DFC000030196FF8260629B84608093480D80917C -:10DFD000480D81709091480D91FD82609091470DA0 -:10DFE000891731F18130A9F028F0823041F0833077 -:10DFF00059F01CC0913089F0923099F017C09923E4 -:10E0000061F0933071F012C0913059F0923071F498 -:10E0100004C0992331F0933049F490913A0D9F5FF9 -:10E0200003C090913A0D915090933A0D8093470D13 -:10E030001F910F9108950F931F93CF93DF938C013E -:10E0400067FF03C01092C70F60E08091C70F90E098 -:10E05000262F062E000C330B281739070CF160937E -:10E06000C70FC8010F945C07800F911FEC01C01B04 -:10E07000D10BC731D1053CF00197FC012491207CE4 -:10E080002038D1F3F3CFDD27AE01B80185E999E05F -:10E090000F947D07CB56D64F188283E080934302BE -:10E0A000DF91CF911F910F910895CF93DF9320912E -:10E0B000C70F21111DC0FC0101900020E9F7319725 -:10E0C000EF01C81BD90BC731D1052CF02291207C60 -:10E0D0002038E1F3F5CFBC01DD27AE0185E999E0F9 -:10E0E0000F94CB0FCB56D64F188283E08093430218 -:10E0F000DF91CF9108954F925F926F927F928F92AE -:10E100009F92AF92BF92CF92DF92EF92FF920F93C6 -:10E110001F93CF93DF93CDB7DEB764970FB6F89414 -:10E12000DEBF0FBECDBF109107021F3F09F47BC0B9 -:10E130000E94D7EDC090290DD0902A0DE0902B0DB4 -:10E14000F0902C0DDC01CB018C199D09AE09BF09A3 -:10E15000B7FD69C08091EF099091F0098F5F8F70D2 -:10E16000891709F460C0133009F482C2E0901114D9 -:10E1700024E01202F0011124E157FD4F20E030E0CD -:10E1800040E752E460817181828193810F94340D64 -:10E190006D877E878F87988B198A1A8A1B8A1C8ABB -:10E1A0008091B60F9091B70FA091B80FB091B90FB1 -:10E1B00089839A83AB83BC838091BA0F9091BB0F04 -:10E1C000A091BC0FB091BD0F8D839E83AF83B887A4 -:10E1D0008091BE0F9091BF0FA091C00FB091C10F61 -:10E1E00089879A87AB87BC87AE01475F5F4FBE01C7 -:10E1F0006B5F7F4FCE0101960E94E487AE014F5EB8 -:10E200005F4F6A018E01035F1F4F22EC3FE04850D1 -:10E210005109BE016B5F7F4FCE0101960E94563FB0 -:10E220008FEF80930702B0DE8091480D82FF40C0DF -:10E230008091460D81113EC081E08093460D909102 -:10E24000390D89278093380D1092390D83E0809322 -:10E2500043021092480D0E94D7EDDC01CB018C5097 -:10E260009E4FAF4FBF4F8093490D90934A0DA0939F -:10E270004B0DB0934C0D88E893E19E878D8782E02B -:10E2800090E09A838983BE01635F7F4FCE01019640 -:10E290000E942C9216E0115069F085E89AE00E94E5 -:10E2A000EE3262E070E080E090E00E949FEDF3CFFC -:10E2B0001092460D99B181E0292F207194FD80E0E4 -:10E2C0001091370D811731F18093370D2111D6C18F -:10E2D00064EF71E080E090E0BDDD0E94EA901230D2 -:10E2E00009F0C8C11092D00A8BE1EDEDFAE0ACEF75 -:10E2F000BAE001900D928A95E1F78091DB0A909146 -:10E30000DC0A9093FB0A8093FA0A83E0809343022D -:10E310000E9418980E94D7ED6B017C018091420DFC -:10E320009091430DA091440DB091450DA701960128 -:10E33000281B390B4A0B5B0B57FF05C08091360D2C -:10E34000882309F4D7C1D701C6018C599F4FAF4F1D -:10E35000BF4F8093420D9093430DA093440DB09313 -:10E36000450D80913A0D082E000C990B97FF03C0C4 -:10E3700091958195910984302CF48091380D81110B -:10E3800094C0A4C080911B14882309F467C08091B5 -:10E390003A0D8090320D9090330DA090340DB090D6 -:10E3A000350D81149104A104B10409F44AC0082E6A -:10E3B000000C990B97FF03C0919581959109682FE7 -:10E3C00087FF02C063E0680F65956595062E000C17 -:10E3D000770B880B990B0F9412082B013C01C70196 -:10E3E000B601681979098A099B090F9410089B01E5 -:10E3F000AC01C301B2010F94340D20E030E04AE7D4 -:10E4000054E40F9471084B015C0120E030E040E2DD -:10E4100053E40F947E0E87FF0FC020E030E046E902 -:10E4200052E4C501B4010F947E0E87FD0AC02AE0B4 -:10E4300030E040E050E009C024E630E040E050E049 -:10E4400004C021E030E040E050E0C092320DD092B4 -:10E45000330DE092340DF092350D04C021E030E030 -:10E4600040E050E0A0913A0D0A2E000CBB0B0F9437 -:10E47000420C24E030E040E050E00F941C0C80910E -:10E48000171490911814A0911914B0911A14820FB6 -:10E49000931FA41FB51F8093171490931814A09373 -:10E4A0001914B0931A1410923A0DD701C601885668 -:10E4B000954CAF4FBF4F80933E0D90933F0DA0936F -:10E4C000400DB093410D81E080934302809155024D -:10E4D000909156028459984941F48091080288230A -:10E4E00009F4D8C081508093080280916F00282FD2 -:10E4F000227081FF05C080916F008D7F80936F0037 -:10E5000080912D0D90912E0DA0912F0DB091300D79 -:10E51000222329F020916F00226020936F003AE0BF -:10E52000B695A795979587953A95D1F7009741E0CD -:10E53000A407B10520F08FEF9FEFA0E0B0E0969523 -:10E54000879520914302211105C03091360D31117C -:10E55000CDC059C0009741F040913C0D50913D0D08 -:10E560004817590708F04FC08091360D811113C02C -:10E57000223050F0243028F0243031F4109243023D -:10E5800003C081E0809343020E946D5A81E0809332 -:10E5900016148093360D84E00E94379881E08093B2 -:10E5A000D209E0915502F091560219951092161475 -:10E5B0008091360D882351F00E94505991E08111CD -:10E5C00001C090E09093360D811174C01092380D07 -:10E5D00080903C0D90903D0DA12CB12C0E94D7ED68 -:10E5E000DC01CB018C199D09AE09BF09881699067B -:10E5F000AA06BB0640F40E94D7ED6C197D09709302 -:10E600003D0D60933C0D80915502909156028459C6 -:10E61000984921F08091310D882379F088E9C80E5E -:10E620008AE3D81EE11CF11CC0923E0DD0923F0D32 -:10E63000E092400DF092410D0FC080913E0D9091FF -:10E640003F0DA091400DB091410DC81AD90AEA0AB8 -:10E65000FB0AF7FE0E94D0978091360D81114AC0C7 -:10E6600080914302813009F045C01092430242C0BC -:10E67000E12C7ECD60E08BEC93E10AC01092A50AFC -:10E680001092A60A123009F440CE60E08EEB93E1BE -:10E69000D2DC3BCE8CE08093080280913C0D9091BF -:10E6A0003D0D019790933D0D80933C0D81E080934B -:10E6B00043021BCF80903C0D90903D0DA12CB12CBE -:10E6C0000E94D7EDDC01CB018C199D09AE09BF0971 -:10E6D00088169906AA06BB0668F40E94D7ED6C1945 -:10E6E0007D0970933D0D60933C0D04C0009709F4C3 -:10E6F00052CF32CF64960FB6F894DEBF0FBECDBFB7 -:10E70000DF91CF911F910F91FF90EF90DF90CF900D -:10E71000BF90AF909F908F907F906F905F904F9041 -:10E720000895FC0180E090E02491222339F02491A7 -:10E73000207C203809F001963196F6CF0895FC012F -:10E7400020E030E09191992331F0907C9038D1F322 -:10E750002F5F3F4FF7CFC9010895DF92EF92FF92ED -:10E760000F931F93CF93DF93EC01D62E1CAD0BAD0F -:10E770007C0184E0E80EF11CE98DFA8DC701199542 -:10E78000412F480F2D2D602FC7010E944A6A9BAD73 -:10E79000890F8BAF81E090E0DF91CF911F910F91B6 -:10E7A000FF90EF90DF900895FF920F931F93CF9308 -:10E7B000DF938C01EB01F42E80E20E9483398FEF0E -:10E7C000F81611F084E501C082E40E9483398AE3DF -:10E7D0000E948339F801608171818281938142E0D6 -:10E7E0000E94353E488159816A817B818FEC9AE194 -:10E7F0000E94025862E070E080E090E0DF91CF91EB -:10E800001F910F91FF900C949FED909105019470D2 -:10E810009093030187FD76C0A39890910501909590 -:10E82000947090930301909105019470909303016B -:10E83000982F990F86FD72C0A3988091050180954D -:10E84000847080930301809105018470809303019B -:10E85000292F220F96FD60C0A39880910501809515 -:10E86000847080930301809105018470809303017B -:10E87000922F990F26FD4EC0A39880910501809597 -:10E88000847080930301809105018470809303015B -:10E89000292F220F96FD3CC0A398809105018095F9 -:10E8A000847080930301809105018470809303013B -:10E8B000922F990F26FD2AC0A3988091050180957B -:10E8C000847080930301809105018470809303011B -:10E8D000292F220F96FD18C0A398809105018095DD -:10E8E00084708093030180910501847080930301FB -:10E8F00026FD16C0A39880910501809584708093B1 -:10E9000003010895A39A89CFA39AE7CFA39AD5CFFD -:10E91000A39AC3CFA39AB1CFA39A9FCFA39A8DCF27 -:10E92000A39A8091050180958470809303010895D6 -:10E930008F929F92AF92BF92CF92DF92EF92FF920F -:10E940000F931F93CF93DF93F7E1FF2EE12CAE2DB2 -:10E95000B0E0BD016F0D711D759567956E1511F0D5 -:10E96000F6120BC0EEEBF8E165917491072E000CE6 -:10E97000880B990B0F94120862C09B01215031093A -:10E98000220F331F220F331FF901EC59F74E059167 -:10E990001491AB01440F551F440F551FFA01EC5958 -:10E9A000F74EC591D4918017910714F4F62ED1CF6C -:10E9B000C817D90714F4E62ECACFF901EA59F74E61 -:10E9C000E590F490FA01EA59F74EC590D490BC0155 -:10E9D000601B710B072E000C880B990B0F9412080B -:10E9E0004B015C01B6016E197F09072E000C880BE4 -:10E9F000990B0F9412089B01AC01C501B4010F944F -:10EA000071084B015C01C01BD10BBE01DD0F880BEF -:10EA1000990B0F9412089B01AC01C501B4010F942E -:10EA2000340D4B015C01B701FF0C880B990B0F945F -:10EA300012089B01AC01C501B4010F94580CDF9181 -:10EA4000CF911F910F91FF90EF90DF90CF90BF90EB -:10EA5000AF909F908F9008950F931F93CF93DF9364 -:10EA6000CDB7DEB728970FB6F894DEBF0FBECDBF87 -:10EA70006091091470910A14072E000C880B990BF1 -:10EA80000F9412086D837E838F8398878091D712AD -:10EA90009091D812A091D912B091DA1289839A83F9 -:10EAA000AB83BC834DEFBE016B5F7F4FCE01019600 -:10EAB0007BDE6091071470910814072E000C880B00 -:10EAC000990B0F9412086D837E838F8398878091B2 -:10EAD000DB129091DC12A091DD12B091DE128983DD -:10EAE0009A83AB83BC834FEFBE016B5F7F4FCE0138 -:10EAF00001965ADEE7EDFAE184918F010F5F1F4F17 -:10EB0000882321F00E948339F801F6CFE0916A0D45 -:10EB1000F0E0E859F24F608170E080E090E00E9400 -:10EB20001B3EE2EDFAE184918F010F5F1F4F8823B6 -:10EB300021F00E948339F801F6CF6091690D70E0F1 -:10EB400080E090E00E941B3E28960FB6F894DEBF4E -:10EB50000FBECDBFDF91CF911F910F9108950F93FD -:10EB60000FB70F9300916E000B7F00936E007894A7 -:10EB70000F930BB70F930CB70F921F922F933F93E6 -:10EB80004F935F936F937F938F939F93AF93BF93B5 -:10EB9000EF93FF931124E6D1FF91EF91BF91AF91D5 -:10EBA0009F918F917F916F915F914F913F912F91A5 -:10EBB0001F900F900CBF0F910BBF0F910460F89442 -:10EBC00000936E000F910FBF0F911895CF92DF92B7 -:10EBD000EF92FF92C090DB12D090DC12E090DD1239 -:10EBE000F090DE126091071470910814665071095C -:10EBF000072E000C880B990B0F9412089B01AC0197 -:10EC0000C701B6010F940C0887FF1FC020E030E059 -:10EC100040E050E4C701B6010F94580C0F94A10DC9 -:10EC200070939A0D6093990D0E94D7EDDC01CB0192 -:10EC3000805A9541AF4FBF4F8093950D9093960D9D -:10EC4000A093970DB093980D08C01092950D109257 -:10EC5000960D1092970D1092980DFF90EF90DF9007 -:10EC6000CF900895CF92DF92EF92FF92C090D7128B -:10EC7000D090D812E090D912F090DA126091091475 -:10EC800070910A1466507109072E000C880B990BBD -:10EC90000F9412089B01AC01C701B6010F940C0838 -:10ECA00087FF1FC020E030E040E050E4C701B6011C -:10ECB0000F94580C0F94A10D7093940D6093930DC5 -:10ECC0000E94D7EDDC01CB01805C9346AF4FBF4F74 -:10ECD00080938F0D9093900DA093910DB093920D12 -:10ECE00008C010928F0D1092900D1092910D1092FD -:10ECF000920DFF90EF90DF90CF9008951092BB138C -:10ED000010920A141092091480E0ACDF10920814DB -:10ED1000109207145BDF0E9423F110920A141092E4 -:10ED2000091480E09FDF1092680D809102018074C9 -:10ED30008093000110920814109207141092690D2C -:10ED4000759808958F929F92AF92BF92CF92DF9263 -:10ED5000EF92FF920F931F93CF93DF93F0E4FF2E78 -:10ED6000E12CAE2DB0E0BD016F0D711D759567955D -:10ED70006E1511F0F6120BC0E4E2FAE165917491A0 -:10ED8000072E000C880B990B0F94120862C09B0190 -:10ED900021503109220F331F220F331FF901EA5D81 -:10EDA000F64E05911491AB01440F551F440F551FAA -:10EDB000FA01EA5DF64EC591D4918017910714F4DB -:10EDC000F62ED1CFC817D90714F4E62ECACFF90111 -:10EDD000E85DF64EE590F490FA01E85DF64EC590D8 -:10EDE000D490BC01601B710B072E000C880B990B93 -:10EDF0000F9412084B015C01B6016E197F09072EB2 -:10EE0000000C880B990B0F9412089B01AC01C501F3 -:10EE1000B4010F9471084B015C01C01BD10BBE0102 -:10EE2000DD0F880B990B0F9412089B01AC01C501F3 -:10EE3000B4010F94340D4B015C01B701FF0C880B3A -:10EE4000990B0F9412089B01AC01C501B4010F94FA -:10EE5000580CDF91CF911F910F91FF90EF90DF90B1 -:10EE6000CF90BF90AF909F908F90089560E0809179 -:10EE7000A50D9091A60D5CDD6093D7127093D8120A -:10EE80008093D9129093DA128091A30D9091A40DE2 -:10EE900059DF6093DB127093DC128093DD12909344 -:10EEA000DE12A8951092650D0895DF92EF92FF9201 -:10EEB0000F931F93CF93DF93F82ED62EE72E8A0160 -:10EEC00080910902882309F439C0E0E7F2E18491D6 -:10EED000EF012196882321F00E948339FE01F7CFAC -:10EEE000ED2DFE2D8491EF012196882321F00E94C3 -:10EEF0008339FE01F7CFE5ECF8E18491EF0121962B -:10EF0000882321F00E948339FE01F7CFF7FC0BC064 -:10EF10006F2DFF0C770B880B990B0E941B3E8AE02C -:10EF20000E9483390BC0E0ECF8E18491EF01219657 -:10EF3000882321F00E948339FE01F7CF80916B0D69 -:10EF4000811108C01092090281E080936B0DC80105 -:10EF50000E9452BFDF91CF911F910F91FF90EF90D0 -:10EF6000DF90CCCEEF92FF920F931F93CF938091BF -:10EF70000C028F37A0F08F572091680D2093B60DAB -:10EF800090910201211190959074909300019091BD -:10EF9000690D9093B50D992379F0759A0EC09091F3 -:10EFA000B60D891728F0909102019074909300019A -:10EFB0009091B50D891708F075988F5F80930C02BA -:10EFC0009091B40D81E089278093B40D81110E9446 -:10EFD000C46F80910B0285301CF4C1E0C80F01C0E2 -:10EFE000C0E0823009F4A0C04CF48823F9F08130ED -:10EFF00009F0CEC010927B0080E4ACC0843009F4EC -:10F00000B1C00CF4A4C0853009F0C2C09091B30D1A -:10F01000911102C08093B30D8091B30D8150809304 -:10F02000B30D882309F4B4C0C5E0B2C080910A02D0 -:10F030008F5F80311CF480930A02AAC010920A02EA -:10F040008091650D811113C08091A90D9091AA0D39 -:10F050009093A60D8093A50D8091A70D9091A80D7A -:10F060009093A40D8093A30D81E08093650D8AE0B9 -:10F07000E9EAFDE0DF011D928A95E9F71092A80DFB -:10F080001092A70D0091A50D1091A60D1195019557 -:10F090001109F090680D8091BA0D9091BB0D91957A -:10F0A000819591098017910744F4FF2031F04DE5D7 -:10F0B0005AE16EE77AE180E0F8DE80910F029091EC -:10F0C00010029195819591090817190744F4FF20C2 -:10F0D00031F040E95AE161EB7AE180E0E6DE10913F -:10F0E000690DE090A30DF090A40D8091B80D909162 -:10F0F000B90D8E159F0544F0112331F04DE65AE10C -:10F100006EE77AE18FEFD1DE80910D0290910E02D1 -:10F11000E816F906ECF11123D9F140EA5AE161EB66 -:10F120007AE18FEFC2DE34C080917A0086FD2DC077 -:10F1300080917800909179002091A90D3091AA0DCD -:10F14000820F931F9093AA0D8093A90D21C0109256 -:10F150007B0082E480937C0080917A0080648093BD -:10F160007A0016C080917A0086FD11C080917800E7 -:10F17000909179002091A70D3091A80D820F931FD7 -:10F180009093A80D8093A70D03C0C2E001C0C4E016 -:10F19000C0930B020E94498A8091660D9091670D81 -:10F1A0000097A1F001979093670D8093660D892BCE -:10F1B00069F483EC9AE19093A10F8093A00FCF9113 -:10F1C0001F910F91FF90EF900C94603ACF911F9197 -:10F1D0000F91FF90EF9008952F923F924F925F9280 -:10F1E0006F927F928F929F92AF92BF92CF92DF9257 -:10F1F000EF92FF920F931F93CF93DF9300D01F9254 -:10F20000CDB7DEB75C017A8369834A01170107FD38 -:10F2100007C0802F002E000C990B9C838B8304C0A9 -:10F22000E1E0F0E0FC83EB83F901408051806280F3 -:10F2300073808B819C81880F991F880F991F9C83F5 -:10F240008B838556924F7C01A3019201FC01608162 -:10F250007181828193810F940C08882391F0F701CA -:10F26000408251826282738211E020E030E0A90185 -:10F27000C301B2010F947E0E18160CF010E0F501D8 -:10F280001083F50180818230D1F0833009F45EC0B3 -:10F29000813009F07CC0EB81FC81E556F24F208182 -:10F2A000318142815381F401608171818281938136 -:10F2B0000F940C0887FD6BC082E0F50180838B8181 -:10F2C0009C818556924F9C838B83B60180E090E0B1 -:10F2D0000F9410089B01AC01EB81FC81608171816E -:10F2E000828193810F94570C9B01AC01F4016081E2 -:10F2F0007181828193810F947E0E87FD14C00E94DC -:10F30000D7ED6B017C019101A8EEB3E00F94480C9E -:10F31000C60ED71EE81EF91EE981FA81C082D1828D -:10F32000E282F38234C00E94D7EDE981FA81C08085 -:10F33000D180E280F380DC01CB018C199D09AE09FC -:10F34000BF09B7FD24C083E0F50180830F3F19F0AA -:10F3500046E25AE102C049E35AE16DE47AE1802FC6 -:10F360000F900F900F900F90DF91CF911F910F9101 -:10F37000FF90EF90DF90CF90BF90AF909F908F90D5 -:10F380007F906F905F904F903F902F908ECD0F9019 -:10F390000F900F900F90DF91CF911F910F91FF90E1 -:10F3A000EF90DF90CF90BF90AF909F908F907F9025 -:10F3B0006F905F904F903F902F9008954F925F9283 -:10F3C0006F927F928F929F92AF92BF92CF92DF9275 -:10F3D000EF92FF920F931F93CF93DF93CDB7DEB7DA -:10F3E00060970FB6F894DEBF0FBECDBF8091650D5C -:10F3F000811117C060960FB6F894DEBF0FBECDBF67 -:10F40000DF91CF911F910F91FF90EF90DF90CF9000 -:10F41000BF90AF909F908F907F906F905F904F9034 -:10F42000089524DD0E94D7ED4B015C016091091421 -:10F4300070910A14072E000C880B990B0F94120878 -:10F4400069837A838B839C8348E0C42ED12C58E255 -:10F45000E52EF12C00E09E012F5F3F4F47ED52E17A -:10F460006BE87DE08AE89DE0B7DEC090D712D090CF -:10F47000D812E090D912F090DA126091BC0D709120 -:10F48000BD0D072E000C880B990B0F9412089B01E1 -:10F49000AC01C701B6010F947E0E18160CF009C11D -:10F4A0006091110270911202072E000C880B990BCB -:10F4B0000F9412089B01AC01C701B6010F940C0810 -:10F4C00087FFF7C00091091410910A14B801012EAA -:10F4D000000C880B990B0F941208A70196010F944A -:10F4E000570C2B013C0120ED3CEC4CE45DE36091BA -:10F4F000AF137091B0138091B1139091B2130F9428 -:10F5000071086D837E838F8398872091810D309160 -:10F51000820D4091830D5091840DC701B6010F9467 -:10F52000570C9B01AC016D817E818F8198850F9472 -:10F5300071086D837E838F83988723E333E343E7EA -:10F540005FE360917D0D70917E0D80917F0D9091B4 -:10F55000800D0F9471089B01AC016D817E818F81BC -:10F5600098850F94580C6D837E838F839887609362 -:10F570007D0D70937E0D80937F0D9093800DC092D2 -:10F58000810DD092820DE092830DF092840D20E0E7 -:10F5900030E040E251E4C301B2010F947E0E181630 -:10F5A0000CF411C220E030E040E251ECC301B201A2 -:10F5B0000F940C0887FD0FC2012B09F40CC2809137 -:10F5C0007C0D81110CC22091780D3091790D409104 -:10F5D0007A0D50917B0D29873A874B875C87209164 -:10F5E000A7133091A8134091A9135091AA13C301F6 -:10F5F000B2010F9471086B017C01A301920169852E -:10F600007A858B859C850F94580C69877A878B87C0 -:10F610009C876093780D7093790D80937A0D909309 -:10F620007B0D2091B7133091B8134091B9135091CD -:10F63000BA130F947108A70196010F94580C2D81ED -:10F640003E814F8158850F94570C6B017C0120E05F -:10F6500030E04FE753E40F947E0E20E030E0A90144 -:10F6600018160CF4C3C1C701B6010F940C0887FD2E -:10F6700007C0C701B6010F949C0D759567951AC018 -:10F6800020E030E0A901C301B2010F940C0887FF0C -:10F6900010C0A301920169857A858B859C850F94A2 -:10F6A000570C6093780D7093790D80937A0D909339 -:10F6B0007B0D60E06093680D80918F0D9091900DAF -:10F6C000A091910DB091920D0097A105B10521F186 -:10F6D000A5019401281B390B4A0B5B0B57FD1CC07D -:10F6E0006091930D7091940D80E090E00F9410085C -:10F6F0009B01AC016091D7127091D8128091D91200 -:10F700009091DA120F940C0887FF62C145E059E12D -:10F7100067E179E180E0C9DB8091950D9091960DCC -:10F72000A091970DB091980D0097A105B10511F129 -:10F73000881A990AAA0ABB0AB7FC1CC06091990DE5 -:10F7400070919A0D80E090E00F9410089B01AC013D -:10F750006091DB127091DC128091DD129091DE12CB -:10F760000F940C0887FF20C143EE58E166EF78E163 -:10F770008FEF9BDB6091071470910814072E000C2B -:10F78000880B990B0F94120869837A838B839C836F -:10F7900092E0C92ED12C24E1E22EF12C0FEF9E0134 -:10F7A0002F5F3F4F4BED52E165E87DE089E89DE03A -:10F7B00013DDC090DB12D090DC12E090DD12F090EF -:10F7C000DE1220E030E040EA50E4C701B6010F94B9 -:10F7D0007E0E87FDE5C020E030E046E153E4C7013E -:10F7E000B6010F940C0818160CF4DAC060910714D7 -:10F7F00070910814072E000C880B990B0F941208B7 -:10F80000A70196010F94570C4B015C012091610DEB -:10F810003091620D4091630D5091640D0F94710809 -:10F8200069877A878B879C872091740D3091750D3D -:10F830004091760D5091770DC501B4010F94580C8D -:10F840006D837E838F8398876093740D7093750D9D -:10F850008093760D9093770D20915D0D30915E0D24 -:10F8600040915F0D5091600D0F9471086D877E87F8 -:10F870008F87988B20ED3CEC4CE45DE36091590D53 -:10F8800070915A0D80915B0D90915C0D0F947108F1 -:10F890002B013C012091700D3091710D4091720D42 -:10F8A0005091730DC701B6010F94570C9B01AC0129 -:10F8B000C301B2010F9471082B013C0123E333E330 -:10F8C00043E75FE360916C0D70916D0D80916E0D5B -:10F8D00090916F0D0F9471089B01AC01C301B201AF -:10F8E0000F94580C2B013C0160936C0D70936D0DBF -:10F8F00080936E0D90936F0DC092700DD092710D2C -:10F90000E092720DF092730D2D853E854F855889DA -:10F9100069857A858B859C850F94580CA30192018B -:10F920000F94570C6B017C0120E030E04FE753E46B -:10F930000F947E0E20E030E0A9011816BCF5C50139 -:10F94000B4010F947E0E181684F4A50194016D8104 -:10F950007E818F8198850F94570C6093740D7093FE -:10F96000750D8093760D9093770D6FE71AC020E0A8 -:10F9700030E0A901C501B4010F940C0887FF10C045 -:10F98000A50194016D817E818F8198850F94570C1C -:10F990006093740D7093750D8093760D9093770D31 -:10F9A00060E06093690D26CD11D9E4CEC701B601A0 -:10F9B0000F940C0887FDDBCFC701B6010F949C0D97 -:10F9C00075956795EECF81E080937C0D6FE772CEE1 -:10F9D00080E048D9A1CE81E080937C0D6ACE109260 -:10F9E0007C0D19861A861B861C86F9CDC301B201CF -:10F9F0000F947E0E181654F7A301920169857A853B -:10FA00008B859C850F94570C6093780D7093790DBE -:10FA100080937A0D90937B0D6FE74CCE0F931F93DD -:10FA200080914414813019F40E94D7ED08C0609190 -:10FA3000550D7091560D8091570D9091580D009174 -:10FA4000510D1091520D2091530D3091540D601BAA -:10FA5000710B820B930B28EE33E040E050E00F94E3 -:10FA6000FA0B80914D0D90914E0DA0914F0DB091DC -:10FA7000500DBC01CD01620F731F841F951F1F9194 -:10FA80000F910895109244141092510D1092520D3E -:10FA90001092530D1092540D1092550D1092560D58 -:10FAA0001092570D1092580D10924D0D10924E0D50 -:10FAB00010924F0D1092500D0895CF92DF92EF9259 -:10FAC000FF920F931F93CF93DF936C017A018B0109 -:10FAD000C0E0D0E0CE15DF0581F0D8016D918D0139 -:10FAE000D601ED91FC910190F081E02DC6011995B0 -:10FAF000892B11F02196EECF7E01C701DF91CF91C6 -:10FB00001F910F91FF90EF90DF90CF90089508958F -:10FB1000FC01A681B7818281481B8581483018F09D -:10FB2000A80FB11D4770382F369536953695562F4C -:10FB3000577080E890E002C0959587955A95E2F756 -:10FB4000439F402D1124669566956695E62FF0E05B -:10FB5000E40FF11DEA0FFB1F3081222311F0832BEC -:10FB600002C0809583238083089580E008950F94D8 -:10FB70005B0FFB014181DC0112962C911297421719 -:10FB800060F013962C911397241738F06081159626 -:10FB90002C91621710F42481BBCF0895FC013081B1 -:10FBA0009281930F92832181921760F494819F5FD9 -:10FBB00094838381830F821710F08FEF820F8383EA -:10FBC00081E0089580E00895FC01128280818150D7 -:10FBD000838314820895DB01ED91FC911994609167 -:10FBE000180270911902072E000C880B990B0F94C4 -:10FBF00012082AE037ED43E25CE30F94710820918C -:10FC0000580F3091590F40915A0F50915B0F0F943C -:10FC100071086093140270931502809316029093FA -:10FC2000170208952F923F924F925F926F927F92A8 -:10FC30008F929F92AF92BF92CF92DF92EF92FF92FC -:10FC40000F931F93CF93DF930E94A9EAC0911214E0 -:10FC5000D0E05EEB252E50E2352E4424439466E638 -:10FC6000A62E60E2B62E79E1872E70E2972EEAEF9B -:10FC70006E2EEFE17E2EC11120C0809115148823D5 -:10FC800031F080914302882309F47BC00DC080913C -:10FC9000380D8823B1F31092380D0E94D6978091C9 -:10FCA0001414882371F35DC281E0909115149111B1 -:10FCB00080E024E04EED50E261C0C13019F5809142 -:10FCC0001514813031F080914302882309F459C022 -:10FCD0000FC08091380D8823B1F31092380D87E55D -:10FCE00095EE0E9432A680911414882361F339C2E4 -:10FCF00081E090911514913009F080E023E044ED0B -:10FD000050E23CC0C23031F580911514823029F0A8 -:10FD1000809143028823A9F113C08091380D882374 -:10FD2000B9F31092380D80ED90E29093A10F80937B -:10FD3000A00F0E94603A80911414882349F311C2E5 -:10FD400081E090911514923009F080E020E246ECB9 -:10FD500050E214C0C330A9F480911514833009F423 -:10FD6000CDC180914302882361F081E09091151408 -:10FD7000933009F080E020E244EB50E26D2F0E94C6 -:10FD80007D6F80915C0F90915D0F892B91F1C43054 -:10FD900099F51091640F80911514843089F4809145 -:10FDA000380D882369F01092380D142583E0809374 -:10FDB0004302812F0E94EB36809114148111D1C12E -:10FDC00080914302882309F4ACC1111103C02FE9CB -:10FDD00030E202C023EA30E281E0909115149430C1 -:10FDE00009F080E001E047EA50E26D2F0E947B9E1F -:10FDF00098C144E0542E02C035E0532E5C1256C028 -:10FE000080911514851531F080914302882309F4FF -:10FE10004DC026C08091380D8823B1F31092380D63 -:10FE200040921B141092320D1092330D1092340D2B -:10FE30001092350D9EE6C92E97E9D92EE12CF12CB2 -:10FE400008EC12E420E030E0A90160E67FE083E9FD -:10FE500090E20E943DEB809114148823A9F281C1A5 -:10FE60008EE697E99F938F931F9294E69F931F923C -:10FE70001F9280E69FE09F938F938BE790E29F9382 -:10FE80008F9387E890E29F938F93DF9381E0909127 -:10FE900015149C1380E08F930E94DC9E8DB79EB753 -:10FEA0000E960FB6F8949EBF0FBE8DBF81E0850DF4 -:10FEB0008C1329C0809115148C1729F0809143026E -:10FEC000882309F115C08091380D8823B9F3109269 -:10FED000380D85EF9FE19093A10F8093A00F0E94B2 -:10FEE000603A0E94D09780911414882339F339C165 -:10FEF00081E0909115149C1380E020E24AE650E2E4 -:10FF00006D2F0E947D6F82E0850D8C1325C080913E -:10FF100015148C1729F0809143028823E9F011C051 -:10FF20008091380D8823B9F31092380DB092A10F4B -:10FF3000A092A00F0E94603A80911414882359F374 -:10FF400010C181E0909115149C1380E020E245E5FA -:10FF500050E26D2F0E947D6F13E0150D8091071404 -:10FF600090910814892B31F48091091490910A140E -:10FF7000892B99F11C132FC0809115148C1729F02F -:10FF800080914302882339F11BC08091380D88236A -:10FF9000B9F31092380D10920C1410920B141092A9 -:10FFA0000E1410920D141092101410920F140E943F -:10FFB0007E760E94D09780911414882309F3D1C0D3 -:10FFC00081E0909115149C1380E020E24EE350E212 -:10FFD0006D2F0E947D6F14E0150D1C1323C08091BE -:10FFE0001514811729F0809143028823D9F00FC09E -:10FFF0008091380D8823B9F31092380D80E891E88C -:020000021000EC -:100000000E9432A680911414882369F3AAC081E06B -:10001000909115149C1380E023E042E350E26D2F91 -:100020000E947D6F81E0810F8C1323C08091151495 -:100030008C1729F0809143028823D9F00FC080915A -:10004000380D8823B9F31092380D84EC90E80E94A3 -:1000500032A680911414882369F383C081E09091C3 -:1000600015149C1380E023E046E250E26D2F0E94BD -:100070007D6F82E0810F8C1325C0809115148C1741 -:1000800029F0809143028823E9F011C08091380D56 -:100090008823B9F31092380D9092A10F8092A00F8F -:1000A0000E94603A80911414882359F35AC081E069 -:1000B000909115149C1380E020E247E050E26D2FF0 -:1000C0000E947D6F83E0810F9091C00D91110EC051 -:1000D000379B0CC08C1308C0809115148C1721F12C -:1000E00080914302811131C084E0810FDF5FCF5FD7 -:1000F000D53009F0C0CD8093131433C08091380DF2 -:10010000882309F42ECE1092380D3092A10F209240 -:10011000A00F0E94603A80911414882309F421CE24 -:1001200020C085E0582EC2CE8091380D8823C1F2C0 -:100130001092380D7092A10F6092A00F0E94603A49 -:1001400080911414882361F20CC081E09091151401 -:100150009C1380E020E247E450E26D2F0E947D6F07 -:10016000C3CFDF91CF911F910F91FF90EF90DF9060 -:10017000CF90BF90AF909F908F907F906F905F9047 -:100180004F903F902F900895CF93DF930E94A9EA5C -:10019000D0911214C0E0D11120C080911514882391 -:1001A00031F080914302882309F488C00DC080910A -:1001B000380D8823B1F31092380D0E94D6978091A4 -:1001C0001414882371F399C081E090911514911152 -:1001D00080E024E04DEE5FE16EC0D13069F58091A2 -:1001E0001514813031F080914302882309F466C0F0 -:1001F00019C08091380D8823B1F31092380D4091C9 -:10020000C6135091C7136091BE137091BF138091B4 -:10021000C2139091C3130E9402EB8091141488239F -:1002200011F36BC081E090911514913009F080E0DA -:1002300020E241EE5FE13FC0D23051F580911514CC -:10024000823029F0809143028823C1F117C0809148 -:10025000380D8823B9F31092380D4091C613509190 -:10026000C7136FEF7FEF8091C2139091C3130E9469 -:1002700002EB80911414882329F33FC081E0909110 -:100280001514923009F080E020E241EC5FE113C0E8 -:10029000D330A1F4809115148330C9F080914302CA -:1002A000882361F081E090911514933009F080E08B -:1002B00020E241ED5FE16C2F0E947D6FCF5FDF5F39 -:1002C000C53009F068CF84E08093131416C0809184 -:1002D000380D882319F31092380D4091C6135091B0 -:1002E000C7136091BE137091BF1380E090E00E942D -:1002F00002EB80911414882389F2DF91CF91089545 -:10030000CF93DF930E94A9EAD0911214C0E0D111DB -:1003100020C080911514882331F0809143028823F6 -:1003200009F488C00DC08091380D8823B1F3109274 -:10033000380D0E94D69780911414882371F399C0C8 -:1003400081E090911514911180E024E049EB5FE188 -:100350006EC0D13069F580911514813031F08091F3 -:100360004302882309F466C019C08091380D8823A0 -:10037000B1F31092380D4091C4135091C5136091A0 -:10038000BC137091BD138091C0139091C1130E9452 -:1003900002EB80911414882311F36BC081E09091DB -:1003A0001514913009F080E020E24DEA5FE13FC092 -:1003B000D23051F580911514823029F0809143029A -:1003C0008823C1F117C08091380D8823B9F31092AA -:1003D000380D4091C4135091C5136FEF7FEF80919A -:1003E000C0139091C1130E9402EB809114148823D2 -:1003F00029F33FC081E090911514923009F080E01C -:1004000020E24DE85FE113C0D330A1F480911514D0 -:100410008330C9F080914302882361F081E090919C -:100420001514933009F080E020E24DE95FE16C2F74 -:100430000E947D6FCF5FDF5FC53009F068CF84E039 -:100440008093131416C08091380D882319F31092ED -:10045000380D4091C4135091C5136091BC13709135 -:10046000BD1380E090E00E9402EB80911414882379 -:1004700089F2DF91CF91089580E00C9432760C944C -:10048000E675CF92DF92EF92FF92CF93C82F0E9432 -:10049000D7ED6B017C0124EA30E74DE75FE3609123 -:1004A000EA137091EB138091EC139091ED130F947C -:1004B0000C0887FD05C08AEF90E0A0E0B0E003C023 -:1004C00080E090E0DC01C80ED91EEA1EFB1EC0923F -:1004D000290DD0922A0DE0922B0DF0922C0DC09395 -:1004E0000702CF91FF90EF90DF90CF9008953F9259 -:1004F0004F925F926F927F928F929F92AF92BF9234 -:10050000CF92DF92EF92FF920F931F93CF93DF93DF -:10051000CDB7DEB72A970FB6F894DEBF0FBECDBFBA -:100520009A878987362E8091380D1092380D88234E -:1005300029F01092310D0E94D697F6C080911714C1 -:1005400090911814A0911914B0911A148D839E8360 -:10055000AF83B887892B8A2B8B2B09F4A3C094E037 -:10056000699F80011124F801EA54F04F40805180C6 -:100570006280738020E030E04AE754E4C301B201B6 -:100580000F94570C4B015C0120E030E04AE754E443 -:10059000C301B2010F94580C6B017C0180912802B9 -:1005A0008823D1F1A1E03A1639F13A16A0F0B2E071 -:1005B0003B1232C080906D0F90906E0FA0906F0F25 -:1005C000B090700FC0902402D0902502E0902602D7 -:1005D000F090270221C08090650F9090660FA09048 -:1005E000670FB090680FC0901C02D0901D02E09081 -:1005F0001E02F0901F0210C08090690F90906A0F49 -:10060000A0906B0FB0906C0FC0902002D090210290 -:10061000E0902202F09023026D817E818F81988587 -:100620000F9412082091EA133091EB134091EC13D0 -:100630005091ED130F947108A30192010F94580C7F -:100640002B013C018D819E81AF81B885A301920170 -:10065000B7FF16C0C501B4010F947E0E181644F002 -:10066000F801EA54F04F408251826282738215C0D1 -:10067000F801EA54F04F80829182A282B3820DC0C9 -:10068000C701B6010F940C0887FFEACFF801EA54BE -:10069000F04FC082D182E282F382832DF2DE81E0CC -:1006A0008093430210921714109218141092191488 -:1006B00010921A14809143028823B1F1A4E03A9E6B -:1006C000C0011124FC01EA54F04FDC01AA55B04FDF -:1006D0002D913D914D915C916081718182819381D9 -:1006E0000F94580C69837A838B839C832DEC3CECAC -:1006F0004CEC5DE36091EA137091EB138091EC1385 -:100700009091ED130F947E0E87FD05C0CE010196EA -:100710000E945D6D04C0CE0101960E94B1EBBC0148 -:1007200089859A850E94FD9D2A960FB6F894DEBFB2 -:100730000FBECDBFDF91CF911F910F91FF90EF9032 -:10074000DF90CF90BF90AF909F908F907F906F90F1 -:100750005F904F903F9008953F924F925F926F92BB -:100760007F928F929F92AF92BF92CF92DF92EF9241 -:10077000FF920F931F93CF930E94A9EAC091121486 -:10078000312C21E3422E2FE1522E3DE3A32E3FE1F7 -:10079000B32E44E4842E4FE1942E52E5652E5FE1A2 -:1007A000752EC11123C080911514882331F08091DA -:1007B0004302882309F4C9C00DC08091380D8823F5 -:1007C000B1F31092380D0E94D697809114148823AB -:1007D00071F3A7C281E090911514911180E024E09B -:1007E00048E85FE1632D0E947D6FAFC0C13009F022 -:1007F00047C080911514813031F0809143028823E5 -:1008000009F4A3C017C08091380D8823B1F310926A -:10081000380D00E010E027EE33E04AE050E06AE1F6 -:1008200072E082E89FE10F94B7028091141488234C -:1008300021F377C283E08F9387EE8F931F928AE034 -:100840008F938AE192E09F938F9386E79FE19F9336 -:100850008F938CE79FE19F938F933F9281E09091DC -:100860001514913009F080E08F930F940B028DB72F -:100870009EB70C960FB6F8949EBF0FBE8DBF65C095 -:10088000C23009F057C080911514823031F0809148 -:100890004302882309F459C027C08091380D88236A -:1008A000B1F31092380D81E080931B141092320D39 -:1008B0001092330D1092340D1092350D8EE6C82E25 -:1008C00087E9D82EE12CF12C08EC12E420E030E08E -:1008D000A90160E67FE08AE69FE10E943DEB8091FE -:1008E00014148823A1F21DC28EE697E99F938F937B -:1008F0001F9284E68F931F921F9280E69FE09F9342 -:100900008F937F926F928EE59FE19F938F933F929B -:1009100081E090911514923009F080E08F930E944D -:10092000DC9E8DB79EB70E960FB6F8949EBF0FBE95 -:100930008DBF0BC0C33009F058C0809115148330AF -:1009400069F08091430281112BC03394CF5F95E011 -:10095000391227CF89E080931314E3C18091380DB9 -:10096000882379F31092380D81E080931B14109244 -:10097000320D1092330D1092340D1092350D0CE3A0 -:1009800012E824E031E040E050E069E074E18BE4FB -:100990009FE10F94B70280911414882391F2C1C192 -:1009A0008CE392E89F938F9381E08F9384E08F9301 -:1009B0001F921F9289E094E19F938F93BF92AF9211 -:1009C0009F928F923F9281E090911514933009F09D -:1009D00080E08F930F940B028DB79EB70E960FB6E3 -:1009E000F8949EBF0FBE8DBFB0CFC43009F052C087 -:1009F00080911514843031F080914302882309F4EA -:100A0000A4CF22C08091380D8823B1F31092380D05 -:100A100081E080931B141092320D1092330D1092CE -:100A2000340D1092350D0FE312E827E830E040E076 -:100A300050E067E074E189E39FE10F94B702809191 -:100A400014148823C9F26DC18FE392E89F938F93AA -:100A50001F9287E88F931F921F9287E094E19F93E4 -:100A60008F935F924F9285E39FE19F938F933F9285 -:100A700081E090911514943009F080E08F930F94E9 -:100A80000B028DB79EB70E960FB6F8949EBF0FBEA1 -:100A90008DBF5BCFC53009F050C0809115148530F3 -:100AA00031F080914302882309F44FCF22C0809116 -:100AB000380D8823B1F31092380D81E080931B1418 -:100AC0001092320D1092330D1092340D1092350D9C -:100AD00000E010E02FEF30E040E050E06BE074E128 -:100AE00085E29FE10F94B702809114148823C9F224 -:100AF00018C11F928FEF8F931F921F928BE094E18A -:100B00009F938F938DE09FE19F938F9389E19FE166 -:100B10009F938F933F9281E090911514953009F047 -:100B200080E08F930F940B028DB79EB70C960FB693 -:100B3000F8949EBF0FBE8DBF08CFC63009F050C0DD -:100B400080911514863031F080914302882309F496 -:100B5000FCCE22C08091380D8823B1F31092380D5D -:100B600081E080931B141092320D1092330D10927D -:100B7000340D1092350D00E010E02FEF30E040E032 -:100B800050E06DE074E181E09FE10F94B702809145 -:100B900014148823C9F2C5C01F928FEF8F931F9240 -:100BA0001F928DE094E19F938F9389EE9EE19F9336 -:100BB0008F9385EF9EE19F938F933F9281E0909179 -:100BC0001514963009F080E08F930F940B028DB7C7 -:100BD0009EB70C960FB6F8949EBF0FBE8DBFB5CED4 -:100BE000C73009F050C080911514873031F08091E2 -:100BF0004302882309F4A9CE22C08091380D8823AE -:100C0000B1F31092380D81E080931B141092320DD5 -:100C10001092330D1092340D1092350D00E010E05B -:100C20002FEF30E040E050E06FE074E18DED9EE1A9 -:100C30000F94B702809114148823C9F272C01F92D6 -:100C40008FEF8F931F921F928FE094E19F938F936A -:100C500085EC9EE19F938F9381ED9EE19F938F930F -:100C60003F9281E090911514973009F080E08F93C6 -:100C70000F940B028DB79EB70C960FB6F8949EBFDB -:100C80000FBE8DBF62CEC83009F05FCE80911514C3 -:100C9000883031F080914302882309F456CE17C082 -:100CA0008091380D8823B1F31092380D0FEE1DE7B7 -:100CB00027EE33E04AE050E068E172E080EC9EE12C -:100CC0000F94B70280911414882321F32AC08FEE69 -:100CD0009DE79F938F9383E08F9387EE8F931F926F -:100CE0008AE08F9388E192E09F938F9386EB9EE159 -:100CF0009F938F938BEB9EE19F938F933F9281E025 -:100D000090911514983009F080E08F930F940B02A6 -:100D10008DB79EB70E960FB6F8949EBF0FBE8DBFCF -:100D200014CECF911F910F91FF90EF90DF90CF9055 -:100D3000BF90AF909F908F907F906F905F904F90FB -:100D40003F900895CF92DF92EF92FF9280911E1311 -:100D5000882371F1C0901A13D0901B13E0901C13DC -:100D6000F0901D1320E030E0A901C701B6010F94F7 -:100D70000C088823E9F020E030E040E05FE3C701A1 -:100D8000B6010F9471089B01AC010F9471082BED13 -:100D90003FE049E450E40F9471089B01AC0160E02E -:100DA00070E080E89FE30F94340D6B017C0106C076 -:100DB000C12CD12C80E8E82E8FE3F82EC092580F7A -:100DC000D092590FE0925A0FF0925B0F6091180287 -:100DD00070911902072E000C880B990B0F941208C2 -:100DE0002AE037ED43E25CE30F947108A701960116 -:100DF0000F94710860931402709315028093160289 -:100E000090931702FF90EF90DF90CF9008958F920C -:100E10009F92AF92BF92CF92DF92EF92FF92CF93C9 -:100E2000DF93EC018090D3129090D412A090D51251 -:100E3000B090D61220E030E0A901C501B4010F94B2 -:100E40000C08882309F44AC0C880D980EA80FB8056 -:100E5000A7019601C501B4010F940C0818160CF0F7 -:100E600042C02091990F30919A0F40919B0F509161 -:100E70009C0FC701B6010F940C08882331F1C09272 -:100E8000990FD0929A0FE0929B0FF0929C0F2091B5 -:100E9000950F3091960F4091970F5091980F688160 -:100EA00079818A819B810F9471089B01AC0160E07C -:100EB00070E080E89FE30F94570C609329027093D1 -:100EC0002A0280932B0290932C0260912902709148 -:100ED0002A0280912B0290912C0208C060E070E001 -:100EE00080E89FE303C060E070E0CB01DF91CF9129 -:100EF000FF90EF90DF90CF90BF90AF909F908F903A -:100F00000895CF93DF9390916F00292F227091FF66 -:100F100005C090916F009D7F90936F0094E0899F32 -:100F2000A0011124FA01E85DFB4E6081718182818C -:100F30009381222329F020916F00226020936F007B -:100F4000EA01CF5DDB4F0F941208288139814A8175 -:100F50005B810F947108DF91CF910895CF92DF925A -:100F6000EF92FF92CF93DF932091640F222329F118 -:100F7000EC0108964CDF6B017C0120E030E0A90118 -:100F80000F940C08882361F0CE010E94B8F59B01F4 -:100F9000AC01C701B6010F9471089B01AC0103C0FD -:100FA00020E030E0A901688579858A859B850F94CA -:100FB000570C688779878A879B87DF91CF91FF904D -:100FC000EF90DF90CF9008954F925F926F927F9253 -:100FD000AF92BF92CF92DF92EF92FF920F931F9347 -:100FE000CF93DF93CDB7DEB72C970FB6F894DEBF63 -:100FF0000FBECDBF2091640F222309F445C08A01A2 -:101000007B016C01CA0103DF2B013C01CE0101967B -:101010005C018CE0F50111928A95E9F7F601808177 -:101020009181A281B38189839A83AB83BC83F701C9 -:1010300080819181A281B3818D839E83AF83B887A4 -:1010400020E030E0A901C301B2010F940C0888230D -:1010500061F0C5010E94B8F59B01AC01C301B2016A -:101060000F9471089B01AC0103C020E030E0A9019E -:10107000F80160817181828193810F94580CF8018D -:1010800060837183828393832C960FB6F894DEBFBE -:101090000FBECDBFDF91CF911F910F91FF90EF90C9 -:1010A000DF90CF90BF90AF907F906F905F904F9008 -:1010B00008954F925F926F927F928F929F92AF921C -:1010C000BF92CF92DF92EF92FF920F931F93CF9335 -:1010D000DF93CDB7DEB768970FB6F894DEBF0FBECB -:1010E000CDBF8C015B015A834983DC01D7966D919A -:1010F0007D918D919C91DA970F9410086B017C0182 -:10110000F50120813181428153810F9471080F9440 -:101110001E0D0F94A10D69877A878B879C87A98103 -:10112000BA812D913D914D915C91C701B6010F940B -:1011300071080F941E0D0F94A10D6D877E878F8708 -:10114000988B29853A854B855C8528373105410583 -:10115000510540F488E790E0A0E0B0E089879A87E5 -:10116000AB87BC872D853E854F855889283731054B -:101170004105510540F488E790E0A0E0B0E08D879C -:101180009E87AF87B88BF801ED5BFF4F20813181DF -:101190004281538129833A834B835C83CA01B9011D -:1011A0000F9412082B013C0169857A858B859C85FB -:1011B0000F941008698B7A8B8B8B9C8B20E030E02E -:1011C000A901C301B2010F940C08882329F1A701DA -:1011D0009601C701B6010F9471084B015C01298982 -:1011E0003A894B895C89CA01B9010F9471089B0146 -:1011F000AC01C501B4010F94570C4B015C01A30174 -:101200009201C301B2010F94580C9B01AC01C501BE -:10121000B4010F94340D03C060E070E0CB010F9473 -:101220001E0D0F94A10D6D837E838F839887698136 -:101230007A818B819C8190958095709561957F4F87 -:101240008F4F9F4F0F9412084B015C016D857E8577 -:101250008F8598890F94100869837A838B839C8388 -:1012600020E030E0A901C501B4010F940C088823E7 -:1012700049F129813A814B815C81CA01B9010F94FE -:1012800071086D8B7E8B8F8B988FA7019601C7019C -:10129000B6010F9471089B01AC016D897E898F891D -:1012A000988D0F94570C6B017C01A5019401C50129 -:1012B000B4010F94580C9B01AC01C701B6010F9407 -:1012C000340D03C060E070E0CB010F94CD0DD80168 -:1012D00095968D909D90AD90BC9098977501640106 -:1012E0002D813E814F815885C21AD30AE40AF50A3E -:1012F0000F94A10DC61AD70AE80AF90AF7FE75C0BD -:1013000020E030E0A901C301B2010F940C0888234A -:1013100009F443C0C501B4010F9410086B017C01AE -:10132000A3019201C301B2010F94580C9B01AC01BF -:10133000C701B6010F9471086B017C0129893A89B4 -:101340004B895C89CA01B9010F9471089B01AC01FA -:10135000C701B6010F94570C6B017C0129813A81BA -:101360004B815C81CA01B9010F9471089B01AC01EA -:10137000C701B6010F94580C6B017C0120E030E0EE -:1013800040E850E4C301B2010F9471089B01AC0125 -:10139000C701B6010F94340D03C060E070E0CB01CB -:1013A0000F941E0D7B018D83998320E030E0A9010D -:1013B0000F947E0E181624F0E12CF12C1D82198258 -:1013C000B7018D8199810F94A10D6D837E838F83E9 -:1013D000988786169706A806B90620F48D829E8205 -:1013E000AF82B886C12CD12C76018D819E81AF81D0 -:1013F000B885F80182A793A7A4A7B5A7C80ED91EE0 -:10140000EA1EFB1EC6A6D7A6E0AAF1AA29853A8540 -:101410004B855C8523AF34AF45AF56AFFF962D8526 -:101420003E854F8558892083318342835383689654 -:101430000FB6F894DEBF0FBECDBFDF91CF911F91E5 -:101440000F91FF90EF90DF90CF90BF90AF909F9063 -:101450008F907F906F905F904F90089580916F0074 -:10146000982F927081FF05C080916F008D7F8093CF -:101470006F0010922D0D10922E0D10922F0D1092C4 -:10148000300D992329F080916F00826080936F0066 -:1014900008958091BF0D811105C08091C00D81110B -:1014A00001C0089580919D0F1E9902C0816001C006 -:1014B0008E7F80939D0F80919D0F1D9902C0826049 -:1014C00001C08D7F80939D0F80919D0F379B02C03F -:1014D000846001C08B7F80939D0F8091420980FFC3 -:1014E00010C08091410980FF0CC080919D0F80FF4A -:1014F00008C08091D20D81608093D20D80E00E945F -:10150000C0F28091420981FF10C08091410981FFA2 -:101510000CC080919D0F81FF08C08091D20D826028 -:101520008093D20D81E00E94C0F28091420982FF37 -:1015300014C08091410982FF10C08091C00D8823A2 -:1015400061F080919D0F82FF08C08091D20D846070 -:101550008093D20D82E00C94C0F208958F929F92F6 -:10156000AF92BF92CF92DF92EF92FF920F931F93B1 -:10157000CF93C82F882319F0E8E7F3E20CC0EFE916 -:10158000F2E184918F010F5F1F4F8823A9F30E941E -:101590008339F801F6CF84918F010F5F1F4F8823A5 -:1015A00021F00E948339F801F6CFE6EEF0E2849153 -:1015B0008F010F5F1F4F882321F00E948339F801AC -:1015C000F6CF8AE00E948339CC2319F0EBE5F3E2F1 -:1015D0000CC0EFE9F2E184918F010F5F1F4F882368 -:1015E000A9F30E948339F801F6CF84918F010F5F30 -:1015F0001F4F882321F00E948339F801F6CF8AE03B -:101600000E948339C1112CC0EFE9F2E184918F016E -:101610000F5F1F4F882321F00E948339F801F6CF16 -:10162000E8E4F3E284918F010F5F1F4F882321F0DC -:101630000E948339F801F6CF80911E13882321F090 -:101640008AE00E9483393AC0EDE3F3E284918F018E -:101650000F5F1F4F882391F10E948339F801F6CF65 -:1016600040911A1350911B1360911C1370911D131C -:1016700084E393E20E9402588AE00E9483398091B9 -:101680001E13811127C0CC2319F0E9E2F3E20CC04C -:10169000EFE9F2E184918F010F5F1F4F8823A9F3D7 -:1016A0000E948339F801F6CF84918F010F5F1F4F9D -:1016B000882381F00E948339F801F6CFEFE9F2E147 -:1016C00084918F010F5F1F4F882351F20E9483394D -:1016D000F801F6CFC11124C0EFE9F2E184918F0146 -:1016E0000F5F1F4F882321F00E948339F801F6CF46 -:1016F000E8E1F3E284918F010F5F1F4F882321F00F -:101700000E948339F801F6CFEFE9F2E184918F016D -:101710000F5F1F4F882321F00E948339F801F6CF15 -:1017200040919713509198136091991370919A1367 -:1017300080E193E20E94025840919B1350919C13C8 -:1017400060919D1370919E138DE093E20E94025868 -:1017500040919F135091A0136091A1137091A21317 -:101760008AE093E20E9402584091A3135091A4137F -:101770006091A5137091A61387E093E20E9402582E -:101780008AE00E948339C11124C0EFE9F2E184911B -:101790008F010F5F1F4F882321F00E948339F801CA -:1017A000F6CFE9EEF2E284918F010F5F1F4F88239D -:1017B00021F00E948339F801F6CFEFE9F2E184913C -:1017C0008F010F5F1F4F882321F00E948339F8019A -:1017D000F6CF4091D0135091D1136091D2137091F4 -:1017E000D31380EE92E20E9402584091D41350919C -:1017F000D5136091D6137091D7138DED92E20E94AC -:1018000002584091D8135091D9136091DA13709116 -:10181000DB138AED92E20E9402584091DC13509152 -:10182000DD136091DE137091DF1387ED92E20E9469 -:1018300002588AE00E948339C11124C0EFE9F2E125 -:1018400084918F010F5F1F4F882321F00E948339FD -:10185000F801F6CFE5EBF2E284918F010F5F1F4FA5 -:10186000882321F00E948339F801F6CFEFE9F2E1F5 -:1018700084918F010F5F1F4F882321F00E948339CD -:10188000F801F6CF40916B1350916C1360916D137A -:1018900070916E138CEA92E20E94E55740916F13AB -:1018A00050917013609171137091721389EA92E2F2 -:1018B0000E94E55740917313509174136091751312 -:1018C0007091761386EA92E20E94E5574091771371 -:1018D000509178136091791370917A1383EA92E2B0 -:1018E0000E94E5578AE00E948339C11124C0EFE9C4 -:1018F000F2E184918F010F5F1F4F882321F00E9436 -:101900008339F801F6CFE9E5F2E284918F010F5FA8 -:101910001F4F882321F00E948339F801F6CFEFE9A9 -:10192000F2E184918F010F5F1F4F882321F00E9405 -:101930008339F801F6CF409183135091841360915D -:1019400085137091861380E592E20E9402584091BF -:101950007F135091801360918113709182138DE4F5 -:1019600092E20E94025840917B1350917C13609147 -:101970007D1370917E138AE492E20E9402588AE0FD -:101980000E948339C1113FC0EFE9F2E184918F01D8 -:101990000F5F1F4F882321F00E948339F801F6CF93 -:1019A000E2E0F2E284918F010F5F1F4F882321F064 -:1019B0000E948339F801F6CFE7EDF1E284918F01BF -:1019C0000F5F1F4F882321F00E948339F801F6CF63 -:1019D000E8ECF1E284918F010F5F1F4F882321F023 -:1019E0000E948339F801F6CF8AE00E948339EFE93B -:1019F000F2E184918F010F5F1F4F882321F00E9435 -:101A00008339F801F6CF40910204509103046091AC -:101A10000404709105048FEB91E20E94E557409118 -:101A2000CC135091CD136091CE137091CF138CEBEA -:101A300091E20E9402584091C8135091C9136091DD -:101A4000CA137091CB1389EB91E20E940258409126 -:101A50008713509188136091891370918A1386EBD4 -:101A600091E20E94025840918B1350918C13609127 -:101A70008D1370918E1383EB91E20E940258409176 -:101A80008F1350919013609191137091921380EB8A -:101A900091E20E94025840919313509194136091E7 -:101AA0009513709196138DEA91E20E9402588AE094 -:101AB0000E948339C11124C0EFE9F2E184918F01C2 -:101AC0000F5F1F4F882321F00E948339F801F6CF62 -:101AD000EFE9F1E284918F010F5F1F4F882321F01E -:101AE0000E948339F801F6CFEFE9F2E184918F018A -:101AF0000F5F1F4F882321F00E948339F801F6CF32 -:101B00004091C10D5091C20D6091C30D7091C40DF3 -:101B100086E991E20E9402584091C50D5091C60D90 -:101B20006091C70D7091C80D83E991E20E9402583F -:101B30004091C90D5091CA0D6091CB0D7091CC0DA3 -:101B400080E991E20E9402588AE00E948339C11123 -:101B500024C0EFE9F2E184918F010F5F1F4F8823CA -:101B600021F00E948339F801F6CFECE7F1E284918D -:101B70008F010F5F1F4F882321F00E948339F801E6 -:101B8000F6CFEFE9F2E184918F010F5F1F4F8823B9 -:101B900021F00E948339F801F6CF6091640F70E064 -:101BA00083E791E20E941F584091D3125091D412C2 -:101BB0006091D5127091D61280E791E20E9402588E -:101BC0008AE00E94833980915C0F90915D0F892B90 -:101BD00009F44EC031E7C32E3FE0D32E00E010E001 -:101BE0005601E12CF12CC1110DC0EFE9F2E1849115 -:101BF0004F019FEF891A990A882321F00E948339A7 -:101C0000F401F5CFB70186E691E20E941F58B801B2 -:101C100083E691E20E941F58E0E6F1E284914F01D1 -:101C20009FEF891A990A882321F00E948339F401D1 -:101C3000F5CFF501608171818281938145E00E9439 -:101C4000353E8AE00E948339FFEFEF1AFF0A8CE0ED -:101C5000A80EB11C93E0E916F10409F0C4CF0F5FA0 -:101C60001F4FE4E0CE0ED11C0330110509F0B8CFB0 -:101C7000C11114C0EFE9F2E184918F010F5F1F4F92 -:101C8000882321F00E948339F801F6CFE3E4F1E2E2 -:101C900084918F010F5F1F4F81110FC080ECA82E20 -:101CA00083E1B82E9CEBC92E93E1D92E24ECE22ED1 -:101CB00023E1F22E00E010E029C00E948339F801F0 -:101CC000E7CFB8018AE391E20E941F58F5016191C4 -:101CD00071915F0187E391E20E941F58F6016191C3 -:101CE00071916F0184E391E20E941F58F7016191A5 -:101CF00071917F0181E391E20E941F588AE00E9466 -:101D000083390F5F1F4F0230110579F0C111D9CF10 -:101D1000EFE9F2E184914F019FEF891A990A882334 -:101D200081F20E948339F401F5CFC11124C0EFE99B -:101D3000F2E184918F010F5F1F4F882321F00E94F1 -:101D40008339F801F6CFE2E2F1E284918F010F5F6F -:101D50001F4F882321F00E948339F801F6CFEFE965 -:101D6000F2E184918F010F5F1F4F882321F00E94C1 -:101D70008339F801F6CF4091A7135091A8136091D1 -:101D8000A9137091AA1389E191E20E9402582CEAEA -:101D900035EC47E25EE36091B7137091B813809120 -:101DA000B9139091BA130F94340DAB01BC0186E1C5 -:101DB00091E20E9402582CEA35EC47E25EE3609122 -:101DC000AF137091B0138091B1139091B2130F942F -:101DD0007108AB01BC0183E191E20E9402588AE0E4 -:101DE0000E948339C1110CC0EFE9F2E184918F01A7 -:101DF0000F5F1F4F882321F00E948339F801F6CF2F -:101E00004091610D5091620D6091630D7091640D70 -:101E10008AE091E20E9402582CEA35EC47E25EE348 -:101E200060915D0D70915E0D80915F0D9091600DE0 -:101E30000F94340DAB01BC0187E091E20E9402587F -:101E40002CEA35EC47E25EE36091590D70915A0D32 -:101E500080915B0D90915C0D0F947108AB01BC01FA -:101E600084E091E20E9402588AE00E948339C11105 -:101E70003CC0EFE9F2E184918F010F5F1F4F88238F -:101E800021F00E948339F801F6CFE5EFF0E284916A -:101E90008F010F5F1F4F882321F00E948339F801C3 -:101EA000F6CFE6EEF0E284918F010F5F1F4F88239B -:101EB00021F00E948339F801F6CFE3EEF0E284913D -:101EC0008F010F5F1F4F882321F00E948339F80193 -:101ED000F6CFEFE9F2E184918F010F5F1F4F882366 -:101EE00021F00E948339F801F6CF4091B20F509152 -:101EF000B30F6091B40F7091B50F8CEE90E20E9419 -:101F000002588AE0CF911F910F91FF90EF90DF90E0 -:101F1000CF90BF90AF909F908F900C9483398F9209 -:101F20009F92AF92BF92CF92DF92EF92FF921F9358 -:101F3000CF93DF93C82F8EE49CE09093D2118093CF -:101F4000D11110926A0C82E090E0A0E0B0E08093A2 -:101F5000530C9093540CA093550CB093560C1092C4 -:101F6000D0111092CC111092CD111092CE1110926E -:101F7000CF118FEF9FEFDC018093C8119093C911AF -:101F8000A093CA11B093CB11CC2379F1C53008F0DE -:101F9000F8C040E060E070E0CB010E94F8B8882310 -:101FA00009F4EFC020E1C29FC00111248854904F72 -:101FB000FC01E254FE4F20812F7709F0E2C03C96ED -:101FC00040815181628173814436510561057105FB -:101FD00008F4D7C03497C080D180E280F380C11468 -:101FE000D104E104F10421F4CCC0C12CD12C760140 -:101FF00040E0C701B6010E94F8B8182F882309F401 -:10200000C0C08091D30F9091D40F8115924009F0F8 -:10201000B8C0A091D80FAA2309F4B3C06091D60F1D -:102020007091D70F6115710509F4ABC02091D50FE0 -:10203000222309F4A6C0A093650C2093570C80E0DE -:1020400030E041E050E0C82FFA01082E02C0EE0F48 -:10205000FF1F0A94E2F72E173F0739F08F5FC83051 -:1020600091F789E08093600C8CC08093600C209184 -:10207000DE0F3091DF0F2115310519F040E050E0FF -:1020800008C02091EC0F3091ED0F4091EE0F509170 -:10209000EF0F2093580C3093590C40935A0C5093E7 -:1020A0005B0C46015701860E971EA11CB11C809245 -:1020B000660C9092670CA092680CB092690CE0914B -:1020C000D90FF091DA0FF0936C0CE0936B0CB0E049 -:1020D0000F94380C860E971EA81EB91E80926D0CA8 -:1020E00090926E0CA0926F0CB092700C85E0EE0F87 -:1020F000FF1F8A95E1F7E150FE4FEF2FFF27E6958E -:102100008E0E9F1EA11CB11C8092610C9092620CDD -:10211000A092630CB092640C2091DB0F3091DC0F25 -:102120002115310521F0A90160E070E008C040915F -:10213000E80F5091E90F6091EA0F7091EB0FD70112 -:10214000C60188199909AA09BB09840F951FA61F02 -:10215000B71F04C0B695A79597958795CA95D2F7EE -:1021600080935C0C90935D0CA0935E0CB0935F0C1D -:10217000853F2FE09207A105B10528F48CE08093FC -:102180006A0C10E01AC0853F9F4FA105B10510F4FD -:1021900080E111C08091F40F9091F50FA091F60F9E -:1021A000B091F70F80936D0C90936E0CA0936F0C11 -:1021B000B093700C80E280936A0C812FDF91CF91F5 -:1021C0001F91FF90EF90DF90CF90BF90AF909F90C6 -:1021D0008F900895CF92DF92EF92FF921F93CF934B -:1021E000DF931092A60A8091E00A882321F08DEDFA -:1021F0009AE00E9419CF1092520C10924F0C85E376 -:1022000080934E0C0E94D7EDEB01A89561E0809180 -:102210004E0C0E949CEC8EE49CE00E947AD02398A5 -:10222000229A219A209A289A85E08093500C82E580 -:102230008CBD1DBC1AE08FEF0E947FD01150D9F7E2 -:1022400020E030E0A90160E08EE49CE00E9484D0B0 -:10225000182F8093510C813049F00E94D7ED6C1BF0 -:102260007D0B613D774060F381E054C02AEA31E0A4 -:1022700040E050E068E08EE49CE00E9484D082FF61 -:1022800003C01093520C0EC014E00E94D0BC809387 -:10229000510C1150D1F78A3A11F082E03BC082E034 -:1022A0008093520C8091520C823021F0C12CD12CA1 -:1022B000760105C0C12CD12CE12C80E4F82E20E061 -:1022C00030E0A90167E38EE49CE00E9484D0A7017E -:1022D000960169E28EE49CE00E9484D08093510CC8 -:1022E000882349F00E94D7ED6C1B7D0B613D774040 -:1022F00030F38AE00FC08091520C823011F520E05B -:1023000030E0A9016AE38EE49CE00E9484D0882337 -:1023100051F088E080934F0C8EE49CE00E947AD0CC -:10232000EFE9F2E119C00E94D0BC807C803C19F436 -:1023300083E08093520C0E94D0BC0E94D0BC0E94CB -:10234000D0BC8EE49CE00E947AD01092500C81E0C8 -:10235000E6DD811131C015C08491EF0121968823FB -:1023600021F00E948339FE01F7CFE9E2F4E2849183 -:10237000EF012196882309F456C00E948339FE019B -:10238000F6CF80E0CCDD811117C0E0E7F2E1849167 -:10239000EF012196882321F00E948339FE01F7CFB7 -:1023A000E5E1F4E28491EF012196882309F43BC032 -:1023B0000E948339FE01F6CF63E57CE08DED9AE063 -:1023C0000E94C6CE811116C0E0E7F2E18491EF01D0 -:1023D0002196882321F00E948339FE01F7CFE4E0A3 -:1023E000F4E28491EF0121968823E9F00E94833979 -:1023F000FE01F7CF81E08093A60AEFE9F2E1849134 -:10240000EF012196882321F00E948339FE01F7CF46 -:10241000E8EFF3E28491EF012196882321F00E94F6 -:102420008339FE01F7CF8BE1EDEDFAE0ACEFBAE0D6 -:1024300001900D928A95E1F78091DB0A9091DC0A78 -:102440009093FB0A8093FA0ADF91CF911F91FF903E -:10245000EF90DF90CF9008950F931F93CF93DF936A -:102460008C01EB019091910A2091920A921307C07E -:1024700085E89AE00E94EE320E94DE79F3CFF801FF -:1024800060817181488159818091900A34E0839FF5 -:10249000F0011124E757F54F73876287558744870A -:1024A0009F5F9093910A8F5F281719F08093900A8D -:1024B00002C01092900ADF91CF911F910F91089561 -:1024C000CF93DF93EC012881243208F05BC030E029 -:1024D0001616170664F4F901EE0FFF1FE20FF31F43 -:1024E000EB5EF54F6F739081907C692B6083F901EF -:1024F000EE0FFF1F2E0F3F1FF901EB5EF54F80819E -:1025000061E08F730E949CEC19821A8288816CE0D2 -:102510000F94200F9CE0899FB001112440E050E00F -:102520009B01240F351FF901EE0FFF1F2E0F3F1FD8 -:10253000F901EB5EF54F908196FD16C04F5F5F4F3E -:102540004C30510569F781111FC01092900082E054 -:10255000809391001092950010929400C19A8091FE -:1025600071008260809371008881E82FF0E09F0104 -:10257000220F331FE20FF31FEB5EF54F9081906443 -:1025800090831FC08FEF1DC0813069F41092A000AE -:1025900082E08093A1001092A5001092A40089BB54 -:1025A00080937200E1CF8230F9F61092200180937F -:1025B000210110922501109224018ABB809373009F -:1025C000D3CFDF91CF910895CF93DF93CDB7DEB70F -:1025D0008091C70F81110EC09E01275F3F4F4F8131 -:1025E000588566E170E085E999E00F94D40783E0AF -:1025F00080934302DF91CF910895FF920F931F9331 -:10260000CF93DF938091C60F182F1270082F04709C -:10261000982F9170F92E80FF04C0112311F0011141 -:1026200076C0EFE9F2E18491EF012196811103C0B8 -:10263000E2EFF3E204C00E948339FE01F4CF8491FB -:10264000EF012196882321F00E948339FE01F7CF04 -:10265000F1100BC0E0EFF3E28491EF0121968823A3 -:1026600021F00E948339FE01F7CF11110BC0EEEE6D -:10267000F3E28491EF012196882321F00E948339AF -:10268000FE01F7CF011103C0ECEEF3E203C0E4EE6C -:10269000F3E209C08491EF0121968823C1F30E94DF -:1026A0008339FE01F7CF8491EF012196882321F031 -:1026B0000E948339FE01F7CF011103C048E753E0C0 -:1026C00002C041E853E0111103C02AE733E002C021 -:1026D00021E833E0F11003C08CE793E002C081E809 -:1026E00093E05F934F933F932F939F938F9382ED4C -:1026F00093E29F938F931F9267DF8DB79EB70996E2 -:102700000FB6F8949EBF0FBE8DBF81E001C080E080 -:10271000DF91CF911F910F91FF900895FC01DB0194 -:102720008C9120813181382798E0A901440F551FF1 -:1027300037FD06C09A019150C1F731832083089577 -:102740009A01B1E22B27B0E13B27F5CF2F923F92C0 -:102750004F925F926F927F928F929F92AF92BF92B1 -:10276000CF92DF92EF92FF920F931F93CF93DF935D -:10277000CDB7DEB760970FB6F894DEBF0FBECDBF02 -:102780001C017B876A8749872C87DC01CD90DD900F -:10279000ED90FC90FB0180809180A280B380A50128 -:1027A0009401C701B6010E94BDBE882309F49FC1F0 -:1027B0008091BE0F9091BF0FA091C00FB091C10F3B -:1027C0008D879E87AF87B88B40903F025090400224 -:1027D000609041027090420280913B0290913C02D5 -:1027E000A0913D02B0913E0280933F02909340023F -:1027F000A0934102B093420219821A821B821C826A -:1028000020E030E04CE052E4C701B6010F94570CD1 -:10281000DE0111966D01ED84FE840F851889A501F6 -:1028200094010E94EB3381E00E94F9348111D4C0FD -:102830008091A50F82FF11C02091B20F3091B30F8C -:102840004091B40F5091B50F60E070E080E090ECE3 -:102850000F94570C4B015C0106C0812C912C90E227 -:10286000A92E91ECB92EC090B20FD090B30FE0908A -:10287000B40FF090B50F20E030E0A901C701B60118 -:102880000F940C0887FF0BC0A701960160E070E071 -:1028900080E791E40F94570C6B017C0106C0C12CBA -:1028A000D12C80E7E82E81E4F82EA70196016091F3 -:1028B000BE0F7091BF0F8091C00F9091C10F0F9408 -:1028C0007E0E18165CF520E030E040E850E4C701C9 -:1028D000B6010E94EC39811121C080E090E0A0E8AF -:1028E000B0E489839A83AB83BC8320E030E040EA84 -:1028F00050E46091BE0F7091BF0F8091C00F909116 -:10290000C10F0F94580C6D837E838F839887BE010F -:102910006F5F7F4FCE0105960E94DB3420E030E0F0 -:1029200040E050E4C501B4010E94EC39811109C0B6 -:102930006091BE0F7091BF0F8091C00F9091C10F39 -:1029400004C060E070E080EC9FE72091B20F30910E -:10295000B30F4091B40F5091B50F0F94580C6B0109 -:102960008C0189858250823050F580E090E0A0E8AB -:10297000B0E489839A83AB83BC836091BE0F70916E -:10298000BF0F8091C00F9091C10FB985B33029F06E -:1029900020E030E040EA50E404C020E030E048ECC1 -:1029A00051E40F94580C6D837E838F839887BE010A -:1029B0006F5F7F4FCE0105960E94DB3408C0E9852A -:1029C000E13029F480E00E94F934811105C0FC85D2 -:1029D000F33008F45DC008C0AC85A33008F48CC0A7 -:1029E000C12CD12C00EC1FE7EAECF3E284917F01CB -:1029F0002FEFE21AF20A882321F00E948339F701AF -:102A0000F5CF2091A60F3091A70F4091A80F5091BC -:102A1000A90FD1016D917D918D919C910F94580CCE -:102A200043E00E94353EE5ECF3E284917F01BFEF85 -:102A3000EB1AFB0A882321F00E948339F701F5CFB6 -:102A40002091AA0F3091AB0F4091AC0F5091AD0F78 -:102A5000EA85FB8560817181828193810F94580C96 -:102A600043E00E94353EE0ECF3E284917F012FEFDA -:102A7000E21AF20A882321F00E948339F701F5CF88 -:102A800043E0B601C8010E94353E8AE00E948339C6 -:102A900040923F0250924002609241027092420284 -:102AA0009601A801B601C8010F94040F882389F18B -:102AB00060E081EB93E20E941B70E0E7F2E1849119 -:102AC0007F013FEFE31AF30A882321F00E94833944 -:102AD000F701F5CFE1EAF3E284917F019FEFE91A74 -:102AE000F90A8823B1F00E948339F701F5CFC12C90 -:102AF000D12C00EC1FE70DC040923F0250924002E3 -:102B00006092410270924202C12CD12C00EC1FE76E -:102B1000CFCFB601C80160960FB6F894DEBF0FBEE6 -:102B2000CDBFDF91CF911F910F91FF90EF90DF907C -:102B3000CF90BF90AF909F908F907F906F905F905D -:102B40004F903F902F900895EF92FF920F931F9315 -:102B5000CF93DF93F82E062FE42E152FE091C709AF -:102B6000F091C80982EB99E01995080FCE2DD12F6D -:102B700010E02991222349F0402F6F2D82EB99E03C -:102B80000E944A6AF80E180FF4CF812FDF91CF917F -:102B90001F910F91FF90EF9008958F929F92AF92A7 -:102BA000BF92CF92DF92EF92FF920F931F93CF933A -:102BB000DF93A82EC62FB42E6801062F020F842E95 -:102BC000912CC01721F176011B2DDA2D1123D9F09C -:102BD000F70184916091B4097091B509D093CE0941 -:102BE000C093CF091092D1098093D0092EEC39E01F -:102BF0004BE382EB99E00E94EB7DFFEFEF1AFF0AB7 -:102C00001150D85FE3CFC80CD91CCF5FDACFDF916A -:102C1000CF911F910F91FF90EF90DF90CF90BF90D9 -:102C2000AF909F908F900895CF93DF93EFE9F2E1FB -:102C30008491EF012196882321F00E948339FE01BF -:102C4000F7CF6091A30F7091A40F8EE893E20E94DA -:102C5000385882E20E9483398AE0DF91CF910C9448 -:102C60008339CF92DF92EF92FF920F931F93CF930E -:102C7000DF93CDB7DEB7EDB6FEB6DC010D900020D8 -:102C8000E9F79D01281B390B2C5F3F4F4DB75EB70D -:102C9000421B530B0FB6F8945EBF0FBE4DBF0DB76E -:102CA0001EB70F5F1F4F9F938F9387E893E29F9309 -:102CB0008F931F930F930F94A607680154E0C50EDE -:102CC000D11C0F900F900F900F900F900F90F60166 -:102CD0008081882349F0082E000C990B0F945F0F18 -:102CE000F60181936F01F3CFC8010E943B3A811135 -:102CF00003C00E94B2BFF8CF83E893E29093A10F84 -:102D00008093A00F0E94603A0FB6F894FEBE0FBEEB -:102D1000EDBEDF91CF911F910F91FF90EF90DF906B -:102D2000CF900895EF92FF920F931F93CF93DF936D -:102D3000D82F062FC42F142FF82EF40EEE24EA9469 -:102D40008F2D811B1830A8F06091B4097091B509DE -:102D50008093CE090093CF091092D109E092D00957 -:102D60002EEC39E04BE382EB99E00E94EB7D1850AA -:102D7000E7CF8C2F86958695869598E0899FD00D14 -:102D800011244C2F98EF899F400D1124442319F1F1 -:102D900097E049276091B4097091B509D093CE09A5 -:102DA0000093CF091092D1094F5F47708FEF90E0E9 -:102DB00001C0880F4A95EAF78093D0092EEC39E0DC -:102DC0004BE382EB99E0DF91CF911F910F91FF9040 -:102DD000EF900C94EB7DDF91CF911F910F91FF90BD -:102DE000EF9008950F93CF93C82F01E020E8482F6C -:102DF00060E082EB99E00E94286A882331F040E885 -:102E00006C2F80E0CF910F918DCFCF910F910895CE -:102E1000DF92EF92FF920F931F93CF93DF93082FD0 -:102E2000D62FC42F142FF62EF40EEE24E394DD24B7 -:102E3000DA948F2D811B1830A8F06091B40970913D -:102E4000B5090093CE098093CF09E092D109D092C1 -:102E5000D0092EEC39E04BE382EB99E00E94EB7D48 -:102E60001850E7CF8C2F86958695869598E0899F98 -:102E7000D00D11244C2F98EF899F400D112444232D -:102E800029F187E048276091B4097091B509009352 -:102E9000CE09D093CF0981E08093D1094F5F47706D -:102EA0008FEF90E001C0880F4A95EAF78093D00930 -:102EB0002EEC39E04BE382EB99E0DF91CF911F914B -:102EC0000F91FF90EF90DF900C94EB7DDF91CF910D -:102ED0001F910F91FF90EF90DF9008956091600F28 -:102EE0007091610F8091620F9091630F41E00C949B -:102EF0006737809103138630D8F496E0899FF001FC -:102F00001124E152FD4E2091550230915602318339 -:102F100020834091171450911814609119147091E6 -:102F20001A1442835383648375838F5F80930313E2 -:102F300008950F931F932091550230915602281740 -:102F4000390759F10091D3121091D4122091D51262 -:102F50003091D6120093600F1093610F2093620F8F -:102F60003093630F90935602809355024093171449 -:102F7000509318146093191470931A148459984933 -:102F800021F41092310D1092031382E080934302DA -:102F900081E0809314141092360D1F910F910895C3 -:102FA00040E050E0BA0184E998E9C3CFE09103130F -:102FB000EE2381F0E150E093031386E0E89FF001F7 -:102FC0001124E152FD4E42815381648175818081DB -:102FD0009181AFCFE5CF9CE0899F802D112491E0B6 -:102FE000980F90939E0F2CE0280F20939F0F4091F5 -:102FF000E60950E030E02E5F3F4F24173507BCF064 -:10300000292F30E04091E80950E0241735077CF47F -:10301000662331F08E5FE6DE80919F0F8E5FE2DEE9 -:1030200080919F0F1092E9098093EA09089508950D -:10303000CF93DF931F92CDB7DEB78091EB0981115B -:1030400005C081E08093EB090E94065A6091B409A3 -:103050007091B50919829E012F5F3F4F4FE082EBBF -:1030600099E00E94EB7D0F90DF91CF910895CF936F -:10307000C82F823059F02CF4813089F4CF910C9410 -:10308000BC6F833031F0843021F009C087E394E2D3 -:1030900002C089ED93E10E94B959C0933B0DCF91D5 -:1030A0000895CF93C82F8FEF8C0F893058F487E3A2 -:1030B00094E20E94B9598C2F0E948A5980913B0D4D -:1030C000D6DF03C08C2F0E948A5981E0CF910895EA -:1030D000CF939FEF980F993060F4C82F87E394E265 -:1030E0000E94B9598C2F0E948A5980913B0DCF9133 -:1030F000BECFCF910C948A59CF93DF93EC01FE01A0 -:103100008491882319F0E4DF2196F9CFDF91CF91E4 -:103110000895CF93DF93EC018991882311F0D8DFD4 -:10312000FBCFDF91CF9108953F924F925F926F92C4 -:103130007F928F929F92AF92BF92CF92DF92EF9247 -:10314000FF920F931F93CF93DF93CDB7DEB72A97EC -:103150000FB6F894DEBF0FBECDBF10921B14809146 -:10316000380D1092380D882341F062DF40E050E0C6 -:10317000BA018AE294EFDDDE28C540911714509120 -:1031800018146091191470911A1420911A02309138 -:103190001B02C901840F951F2436310524F485369E -:1031A00091053CF416C02436310531F08436910582 -:1031B00084F484E690E00DC0473051056105710547 -:1031C00014F0069706C04A3F5F4F6F4F7F4F6CF475 -:1031D000069690931B0280931A0210921714109275 -:1031E00018141092191410921A1480911A029091C6 -:1031F0001B028A3091053CF0883EE3E09E072CF0EC -:1032000087EE93E002C08AE090E090931B028093E7 -:103210001A020E94D7ED0091051310910613209118 -:103220000713309108136B017C01C01AD10AE20A1E -:10323000F30AF7FC13C02091041320952093041384 -:10324000DC01CB018A549C4FAF4FBF4F80930513D5 -:1032500090930613A0930713B093081330900413B0 -:103260000E94BC6F8091E609853108F5332059F042 -:1032700080910B1490910C14892B29F035E1E32EE9 -:1032800036E2F32E04C028EFE22E24E2F22E03E110 -:1032900028E741E068E082EB99E00E94286A8823F1 -:1032A00031F0870123E14FE061E088E076DC809136 -:1032B000E6098D3108F0F5C0883070F56091091489 -:1032C00070910A14072E000C880B990B0F941208AA -:1032D00020E030E040E05FE30F94580C0F949C0D29 -:1032E000CB010E94F46EFC018081803299F48181CF -:1032F000803271F093E085E0891B8093E90987E0D3 -:103300008093EA09CF0105DF85EF94E2F5DE04C082 -:1033100096E0F1CF90E0EFCF8091E6098D3190F506 -:103320008091E809853170F120E030E040E05FE312 -:103330006091D7127091D8128091D9129091DA12BF -:103340000F94580C0F949C0DCB010E94F46EFC015D -:103350008081803209F0CDC28181803209F4C7C2F8 -:1033600093E085E0891B8093E9098CE18093EA0969 -:10337000CF01CFDE85EF94E2BFDE8091E609853193 -:1033800008F4B0C28091E609883060F560910714B6 -:1033900070910814072E000C880B990B0F941208DB -:1033A00020E030E040E05FE30F94580C0F949C0D58 -:1033B000CB010E94F46EFC012081203229F421818E -:1033C000203221F436E003C030E001C033E021E5D3 -:1033D000231B2093E90927E02093EA099ADE85EF71 -:1033E00094E28ADE8091E6098D3190F58091E809BA -:1033F000853170F120E030E040E05FE36091DB1266 -:103400007091DC128091DD129091DE120F94580CB5 -:103410000F949C0DCB010E94F46EFC0180818032E0 -:1034200009F099C28181803209F08EC296E081E56F -:10343000891B8093E9098CE18093EA09CF0169DE59 -:1034400085EF94E259DE8091E609853108F47EC269 -:103450008091E6098C3128F58091E809843108F1E2 -:1034600080910B1490910C14019644E6489F9001B2 -:10347000499F300D112437FF02C021503F4F832F49 -:10348000932F990F990B009761F028E62093E90993 -:103490002BE12093EA090E94F46E3BDE85E20E9454 -:1034A0008A598091780C882349F08091E609843309 -:1034B00028F48091E8098A3208F078C28091E60900 -:1034C000853328F48091E809813308F093C2809114 -:1034D000780C882369F18091D10A9091D20AA09149 -:1034E000D30AB091D40A0097A105B10509F1BC0136 -:1034F000CD016D597F4F8F4F9F4F24E630E040E064 -:1035000050E00F94FA0B6091D50A7091D60A809121 -:10351000D70A9091D80A0F94FA0B223048F0809184 -:10352000E609843328F48091E809823308F069C2FF -:103530008091E609813308F063C08091E8098932FF -:1035400008F45EC00E940E7D2B013C0120E13EE0AC -:1035500040E050E00F94FA0B690179018CE3882E6A -:10356000912CA12CB12CC301B201A50194010F949F -:10357000FA0BCA01B901A50194010F94FA0BA62E0A -:10358000972E8E010F5F1F4F20E8421621E552064D -:1035900021E06206710408F44DC2C301B20120E8C3 -:1035A00031E541E050E00F94FA0B69019F92AF9230 -:1035B000C70168E170E00F942C0F9F938F933F93A6 -:1035C0002F9385ED94E29F938F931F930F930F9406 -:1035D000A6070FB6F894DEBF0FBECDBF9AE0C9169E -:1035E000D10408F051C288E0982F990F890F819576 -:1035F000855A8093E90980E38093EA09C80189DD4F -:10360000E091AC09F091AD09848181112DC1209127 -:10361000A60F3091A70F4091A80F5091A90F60916C -:10362000B60F7091B70F8091B80F9091B90F0F94AA -:10363000580C6B017C0120E030E0A9010F940C08CC -:1036400087FD05C020E030E040E05FE304C020E0FB -:1036500030E040E05FEBC701B6010F94580C0F94C7 -:103660009C0DCB010E94736EBC0185E193E10F9428 -:10367000B60F2091AA0F3091AB0F4091AC0F509133 -:10368000AD0F6091BA0F7091BB0F8091BC0F9091FC -:10369000BD0F0F94580C6B017C0120E030E0A901B4 -:1036A0000F940C0887FD05C020E030E040E05FE3A8 -:1036B00004C020E030E040E05FEBC701B6010F94AA -:1036C000580C0F949C0DCB010E94736EBC0180E1DD -:1036D00093E10F94B60F2091AE0F3091AF0F409150 -:1036E000B00F5091B10F6091BE0F7091BF0F8091DC -:1036F000C00F9091C10F0F94580C6B017C0120E01A -:1037000030E04AE754E40F9471082B013C0120E0BB -:1037100030E0A901C701B6010F940C0887FD05C070 -:1037200020E030E040EA50E404C020E030E040EA2D -:1037300050ECC301B2010F94580C20E030E040E29D -:1037400051E40F94340D0F949C0D6B017C0197FD97 -:1037500016C06031F7E27F0781059105D4F020E1C2 -:1037600037E240E050E00F941C0CCA01B9012AE096 -:1037700030E040E050E00F941C0C605D0BC0F09412 -:10378000E094D094C094C11CD11CE11CF11C6DE2EA -:1037900001C060E26093F11328EEC21623E0D20666 -:1037A000E104F10494F0C701B60128EE33E040E0F3 -:1037B00050E00F941C0CCA01B9012AE030E040E04F -:1037C00050E00F941C0C605D01C060E26093F21346 -:1037D000C701B60124E630E040E050E00F941C0C35 -:1037E0009AE0492E512C612C712CCA01B901A30118 -:1037F00092010F941C0C605D6093F313C701B60136 -:10380000A30192010F941C0C162F662381F08EE207 -:103810008093F413CA01B901A30192010F941C0C07 -:10382000605D6093F513105D1093F61317C0CA0125 -:10383000B901A30192010F941C0C662339F08EE2AA -:103840008093F413605D6093F51305C080E280936C -:10385000F5138093F41380E28093F61361EF73E124 -:1038600089E093E10F94B60F8091E609883298F4CD -:103870008091E8098D3178F02BE040E86DE180E03F -:103880000E9450EA8091E609873228F48091E80985 -:103890008F3108F0FBC08091E609823328F48091D3 -:1038A000E8098B3208F075C18091E609803408F090 -:1038B0008CC18091E809883308F487C11092E90926 -:1038C0008FE38093EA0985E999E00E949F73182F9E -:1038D0000E94A559163108F078C180E20E948A59E9 -:1038E0001F5FF8CF8091E809813128F44BCD96E035 -:1038F00038CD90E036CD6091091470910A14072EEE -:10390000000C880B990B0F9412082091D71230915C -:10391000D8124091D9125091DA120F947E0E1816D7 -:103920003CF022E042E061E18DE00E9486EA2ACD8F -:103930001092D20922E042E061E18DE00E9486EA25 -:1039400081E08093D2091ECD93E071CD8091E8098A -:10395000813118F47DCD90E06ACD609107147091AB -:103960000814072E000C880B990B0F941208209155 -:10397000DB123091DC124091DD125091DE120F9477 -:103980007E0E181664F41092D20922E042E062E141 -:1039900088E50E9486EA81E08093D20959CD22E031 -:1039A00042E062E188E50E9486EA52CD27E048E0E5 -:1039B0006AE28AE20E9486EA25E042E06CE282E363 -:1039C0000E9486EA24E04AE061E38AE20E9450EA2B -:1039D0006091B4097091B50982E38093CE098BE2BE -:1039E0008093CF092EEC39E042E382EB99E00E940C -:1039F000EB7D64CD24E04AE461E386E30E9450EA73 -:103A000066CDF8E42F9FB0011124072E000C880B1F -:103A1000990B0F9412082AE037ED43E25CE30F9410 -:103A200071080F94A10D462F22E062E387E30E9404 -:103A300086EA7ECDE4E6EE16F10498F49F92AF920A -:103A4000DF92CF928BEC94E29F938F931F930F930F -:103A50000F94A6070FB6F894DEBF0FBECDBF85E06A -:103A6000C3CD9F92AF92DF92CF9283EC94E29F936B -:103A70008F931F930F930F94A6070FB6F894DEBF92 -:103A80000FBECDBF86E0B0CD89E0AECD83E08093A0 -:103A9000E90916E21093EA0983EF94E22DDB8BE04B -:103AA0008093E9091093EA09332021F085E193E13D -:103AB00030DB17C08091C60F80FD0CC005E113E11B -:103AC000F80181918F01882361F08F320CF08FE330 -:103AD000FFDAF6CF8091A50F80FDE8CF8EEE94E25D -:103AE0000BDB8BE28093E90916E21093EA098CEE76 -:103AF00094E202DB83E38093E9091093EA0933201F -:103B000021F080E193E105DB17C08091C60F81FDB4 -:103B10000CC000E113E1F80181918F01882361F06D -:103B20008F320CF08FE3D4DAF6CF8091A50F81FDB0 -:103B3000E8CF8EEE94E2E0DA83E58093E90916E2BD -:103B40001093EA098AEE94E2D7DA8BE58093E909CB -:103B50001093EA09332021F089E093E1DADA9BCE71 -:103B60008091C60F82FD0DC009E013E1F80181913B -:103B70008F01882309F48FCE8F320CF08FE3A8DAFF -:103B8000F5CF8091A50F82FDE7CF83EE94E2B4DA02 -:103B900082CE84E06CDA83E08093E90912E310932B -:103BA000EA0986E095DA0E94BC6F8CE08093E9090F -:103BB0001093EA0980911A0290911B020E94F46E00 -:103BC000A8DA85E20E948A596FCE2A960FB6F89439 -:103BD000DEBF0FBECDBFDF91CF911F910F91FF9040 -:103BE000EF90DF90CF90BF90AF909F908F907F909D -:103BF0006F905F904F903F900895AF92BF92CF9299 -:103C0000DF92EF92FF920F931F93CF93DF935C01AC -:103C10007B010E949173EC01C7010E949F7304E134 -:103C200010E0081B1109DD270C171D071CF0DD240F -:103C3000D39402C082E0D82E8091B30990E06D2D1C -:103C400070E06F5F7F4F0F94400FC62EC6E0C60F27 -:103C50008091E609C81748F02091E80930E08C2FE0 -:103C600090E00B972817390794F5D0E0E114F104A0 -:103C7000B9F18AE30E948A5982E0D8120FC0CC0DB4 -:103C80008091E609C81760F12091E80930E08C2F97 -:103C900090E00B97281739071CF422C0DD2301F1AF -:103CA000802F880F080F000F0093E909C093EA09DD -:103CB00080E20E948A59C701DF91CF911F910F9135 -:103CC000FF90EF90DF90CF90BF90AF9022CA1092FC -:103CD000E909C093EA09C5010E948F59D1E0C6CF16 -:103CE000DF91CF911F910F91FF90EF90DF90CF90D8 -:103CF000BF90AF900895CF92DF92EF92FF920F9313 -:103D0000CF93DF93982F862F6A017901692F63D9AA -:103D10009091E60980919F0F891708F445C0909112 -:103D2000E80980919E0F981708F43EC0002321F007 -:103D3000C7010E94917303C0C7010E949F73D82FCF -:103D4000C4E1C81BF6018491882331F0AAD9C81BAD -:103D5000FFEFCF1ADF0AF6CF8AE30E948A59CC23FD -:103D600029F080E20E948A59C150F9CF80919F0FBB -:103D70009AEFD99FD02D1124D058D093E909809380 -:103D8000EA09C701002341F0DF91CF910F91FF9025 -:103D9000EF90DF90CF90B0C9DF91CF910F91FF905E -:103DA000EF90DF90CF90B5C9DF91CF910F91FF9049 -:103DB000EF90DF90CF900895CF92DF92EF92FF9235 -:103DC0000F93CF93DF93CDB7DEB7E989FA89C0802F -:103DD000D180E280F38020E030E0A901C701B60184 -:103DE0000F940C0887FD05C020E030E040E05FE361 -:103DF00004C020E030E040E05FEBC701B6010F9463 -:103E0000580C0F949C0DCB010E94F46E00E09C01B5 -:103E10004D855E856C858B856EDFDF91CF910F912F -:103E2000FF90EF90DF90CF900895CF92DF92EF92C6 -:103E3000FF920F931F93CF93DF9300D01F92CDB7C4 -:103E4000DEB78091171490911814A0911914B091B5 -:103E50001A14B7FF08C01092171410921814109279 -:103E6000191410921A148091F8139091F913A091DB -:103E7000FA13B091FB1340911714509118146091EC -:103E8000191470911A1484179507A607B70744F4FC -:103E90008093171490931814A0931914B0931A14C4 -:103EA00080914302882371F14091171450911814A6 -:103EB0006091191470911A148091FC139091FD1364 -:103EC000A091FE13B091FF136A017B01C80ED91EA9 -:103ED000EA1EFB1EC701B6010F94100820E030E077 -:103EE00048EC52E40F94710869837A838B839C8336 -:103EF000CE0101960E94A56CBC01809102149091A4 -:103F000003147BDE1091380D11110AC08091041446 -:103F1000882309F441C080914302882309F43CC0FE -:103F200040911714509118146091191470911A143B -:103F30008091FC139091FD13A091FE13B091FF139B -:103F40006A017B01C80ED91EEA1EFB1EC701B6011D -:103F50000F94100820E030E048EC52E40F94710810 -:103F60000F94A10DE0910014F0910114309721F00D -:103F70006083718382839383E0910514F09106142A -:103F8000309731F080910414811101C011111995FD -:103F90008091380D81110AD81092380D0F900F9032 -:103FA0000F900F90DF91CF911F910F91FF90EF90A5 -:103FB000DF90CF900895CF92DF92EF92FF920F9310 -:103FC0001F93CF93DF9300D01F92CDB7DEB78091C0 -:103FD000171490911814A0911914B0911A14B7FFE6 -:103FE00008C01092171410921814109219141092FD -:103FF0001A148091F8139091F913A091FA13B091CB -:10400000FB1340911714509118146091191470917A -:104010001A1484179507A607B70744F4809317145A -:1040200090931814A0931914B0931A14809143021A -:10403000882371F14091171450911814609119144C -:1040400070911A148091FC139091FD13A091FE13AE -:10405000B091FF136A017B01C80ED91EEA1EFB1E38 -:10406000C701B6010F94120820E030E048EC52E49A -:104070000F94710869837A838B839C83CE010196A8 -:104080000E94A56CBC018091021490910314B5DDCF -:104090001091380D111109C080910414882309F47E -:1040A0003FC0809143028823D9F140911714509169 -:1040B00018146091191470911A148091FC13909146 -:1040C000FD13A091FE13B091FF136A017B01C80E8E -:1040D000D91EEA1EFB1EC701B6010F94120820E08C -:1040E00030E048EC52E40F947108E0910014F09134 -:1040F0000114309721F06083718382839383E09170 -:104100000514F0910614309731F080910414811158 -:1041100001C0111119958091380D81110E94D69717 -:104120001092380D0F900F900F900F90DF91CF915C -:104130001F910F91FF90EF90DF90CF900895CF9255 -:10414000DF92EF92FF920F931F93CF93DF9300D0F4 -:104150001F92CDB7DEB78091171490911814A091DB -:104160001914B0911A14B7FF08C0109217141092C6 -:1041700018141092191410921A148091F813909137 -:10418000F913A091FA13B091FB13409117145091B9 -:1041900018146091191470911A1484179507A607C2 -:1041A000B70744F48093171490931814A09319142C -:1041B000B0931A1480914302882371F1409117142F -:1041C000509118146091191470911A148091FC1375 -:1041D0009091FD13A091FE13B091FF136A017B0132 -:1041E000C80ED91EEA1EFB1EC701B6010F941208A5 -:1041F0002AE037ED43E25CE30F94710869837A8328 -:104200008B839C83CE0101960E94436BBC018091FD -:10421000021490910314F1DC1091380D111109C0B2 -:1042200080910414882309F43FC0809143028823BD -:10423000D9F140911714509118146091191470918C -:104240001A148091FC139091FD13A091FE13B0916C -:10425000FF136A017B01C80ED91EEA1EFB1EC701AF -:10426000B6010F9412082AE037ED43E25CE30F94A5 -:104270007108E0910014F0910114309721F06083EF -:10428000718382839383E0910514F0910614309733 -:1042900031F080910414811101C0111119958091A0 -:1042A000380D81110E94D6971092380D0F900F9003 -:1042B0000F900F90DF91CF911F910F91FF90EF9092 -:1042C000DF90CF900895CF92DF92EF92FF920F93FD -:1042D0001F93CF93DF9300D01F92CDB7DEB78091AD -:1042E000171490911814A0911914B0911A14B7FFD3 -:1042F00008C01092171410921814109219141092EA -:104300001A148091F8139091F913A091FA13B091B7 -:10431000FB13409117145091181460911914709167 -:104320001A1484179507A607B70744F48093171447 -:1043300090931814A0931914B0931A148091430207 -:10434000882371F140911714509118146091191439 -:1043500070911A148091FC139091FD13A091FE139B -:10436000B091FF136A017B01C80ED91EEA1EFB1E25 -:10437000C701B6010F9412082AE037ED43E25CE36F -:104380000F94710869837A838B839C83CE01019695 -:104390000E94046CBC0180910214909103142DDCE6 -:1043A0001091380D111109C080910414882309F46B -:1043B0003FC0809143028823D9F140911714509156 -:1043C00018146091191470911A148091FC13909133 -:1043D000FD13A091FE13B091FF136A017B01C80E7B -:1043E000D91EEA1EFB1EC701B6010F9412082AE06F -:1043F00037ED43E25CE30F947108E0910014F09113 -:104400000114309721F06083718382839383E0915C -:104410000514F0910614309731F080910414811145 -:1044200001C0111119958091380D81110E94D69704 -:104430001092380D0F900F900F900F90DF91CF9149 -:104440001F910F91FF90EF90DF90CF900895CF9242 -:10445000DF92EF92FF920F931F93CF93DF9300D0E1 -:104460001F92CDB7DEB78091171490911814A091C8 -:104470001914B0911A14B7FF08C0109217141092B3 -:1044800018141092191410921A148091F813909124 -:10449000F913A091FA13B091FB13409117145091A6 -:1044A00018146091191470911A1484179507A607AF -:1044B000B70744F48093171490931814A093191419 -:1044C000B0931A1480914302882371F1409117141C -:1044D000509118146091191470911A148091FC1362 -:1044E0009091FD13A091FE13B091FF136A017B011F -:1044F000C80ED91EEA1EFB1EC701B6010F94120892 -:104500002FE632E143E85AE30F94710869837A8316 -:104510008B839C83CE0101960E94B1EBBC018091FC -:1045200002149091031469DB1091380D111109C028 -:1045300080910414882309F43FC0809143028823AA -:10454000D9F1409117145091181460911914709179 -:104550001A148091FC139091FD13A091FE13B09159 -:10456000FF136A017B01C80ED91EEA1EFB1EC7019C -:10457000B6010F9412082FE632E143E85AE30F9494 -:104580007108E0910014F0910114309721F06083DC -:10459000718382839383E0910514F0910614309720 -:1045A00031F080910414811101C01111199580918D -:1045B000380D81110E94D6971092380D0F900F90F0 -:1045C0000F900F90DF91CF911F910F91FF90EF907F -:1045D000DF90CF900895CF92DF92EF92FF920F93EA -:1045E0001F93CF93DF9300D01F92CDB7DEB780919A -:1045F000171490911814A0911914B0911A14B7FFC0 -:1046000008C01092171410921814109219141092D6 -:104610001A148091F8139091F913A091FA13B091A4 -:10462000FB13409117145091181460911914709154 -:104630001A1484179507A607B70744F48093171434 -:1046400090931814A0931914B0931A1480914302F4 -:10465000882371F140911714509118146091191426 -:1046600070911A148091FC139091FD13A091FE1388 -:10467000B091FF136A017B01C80ED91EEA1EFB1E12 -:10468000C701B6010F9412082AE037ED43E25CE35C -:104690000F94710869837A838B839C83CE01019682 -:1046A0000E94D56DBC018091021490910314A5DA8B -:1046B0001091380D111109C080910414882309F458 -:1046C0003FC0809143028823D9F140911714509143 -:1046D00018146091191470911A148091FC13909120 -:1046E000FD13A091FE13B091FF136A017B01C80E68 -:1046F000D91EEA1EFB1EC701B6010F9412082AE05C -:1047000037ED43E25CE30F947108E0910014F091FF -:104710000114309721F06083718382839383E09149 -:104720000514F0910614309731F080910414811132 -:1047300001C0111119958091380D81110E94D697F1 -:104740001092380D0F900F900F900F90DF91CF9136 -:104750001F910F91FF90EF90DF90CF900895CF922F -:10476000DF92EF92FF920F931F93CF9380911714D4 -:1047700090911814A0911914B0911A14B7FF08C0A1 -:1047800010921714109218141092191410921A14EF -:104790008091F8139091F913A091FA13B091FB1343 -:1047A00040911714509118146091191470911A14B3 -:1047B00084179507A607B70744F4809317149093BE -:1047C0001814A0931914B0931A14809143028823EB -:1047D000D9F14091171450911814609119147091E7 -:1047E0001A148091FC139091FD13A091FE13B091C7 -:1047F000FF138A019B01080F191F2A1F3B1FC901C4 -:10480000B8010F9412086B017C0120E030E0A9018F -:104810000F940C0887FD05C020E030E040E05FE326 -:1048200004C020E030E040E05FEBC701B6010F9428 -:10483000580C0F949C0DCB010E94F46EBC0180912A -:10484000021490910314D9D9C091380DC11108C038 -:10485000809104148823C9F1809143028823A9F12F -:1048600040911714509118146091191470911A14F2 -:104870008091FC139091FD13A091FE13B091FF1352 -:104880008A019B01080F191F2A1F3B1FC901B8018C -:104890000F941208E0910014F0910114309721F068 -:1048A0006083718382839383E0910514F0910614F1 -:1048B000309731F080910414811101C0C111199514 -:1048C0008091380D81110E94D6971092380DCF91AA -:1048D0001F910F91FF90EF90DF90CF9008958091FE -:1048E000171490911814A0911914B0911A14B7FFCD -:1048F00008C01092171410921814109219141092E4 -:104900001A148091F8139091F913A091FA13B091B1 -:10491000FB13409117145091181460911914709161 -:104920001A1484179507A607B70744F48093171441 -:1049300090931814A0931914B0931A148091430201 -:10494000882391F020911714309118148091FC1352 -:104950009091FD13820F931F0E94F46EBC01809111 -:1049600002149091031449D92091380D211108C0E7 -:1049700080910414882339F180914302882319F12E -:1049800040911714509118148091FC139091FD13CD -:10499000840F951FE0910014F0910114309711F0ED -:1049A00091838083E0910514F0910614309731F0E3 -:1049B00080910414811101C0211119958091380D45 -:1049C00081110E94D6971092380D08952F923F9230 -:1049D0004F925F926F927F928F929F92AF92BF920F -:1049E000CF92DF92EF92FF920F931F93CF93DF93BB -:1049F0000E94A9EAD0911214C0E08AE1282E83E136 -:104A0000382E9CED892E95E0992EA12CB12C26ED07 -:104A1000422E26E0522E612C712C37E2E32E32EA30 -:104A2000F32E42EAC42E46E8D42ED11123C0809141 -:104A30001514882331F080914302882309F44EC075 -:104A40000DC08091380D8823B1F31092380D0E946B -:104A5000D69780911414882371F3CBC081E0909194 -:104A60001514911180E024E047E557E26C2F0E9475 -:104A70007D6F34C0D13091F580911514813029F0CB -:104A800080914302811116C029C08091380D88237E -:104A9000B9F31092380D80911E138D2780931E1349 -:104AA00083E0809343020E94A2868091141488239D -:104AB00039F39FC080911E13811103C026E437E2B1 -:104AC00002C02AE437E281E090911514913009F098 -:104AD00080E001E04EE457E26C2F0DD980911E1367 -:104AE000882309F47EC0D23009F079C08091151472 -:104AF000823031F080914302882309F470C05EC097 -:104B00008091380D8823B1F31092380D91E0909385 -:104B10001B141092320D1092330D1092340D10921E -:104B2000350D0E94799783E0809343028CE397E2EE -:104B30009093031480930214309201142092001475 -:104B40008092FC139092FD13A092FE13B092FF137B -:104B50004092F8135092F9136092FA137092FB137B -:104B600020E030E04AE754E460911A1370911B137F -:104B700080911C1390911D130F94710820E030E870 -:104B80004BEB54E40F94570C0F94A10D6093171442 -:104B9000709318148093191490931A14F09256027B -:104BA000E0925502D0920614C0920514109204149B -:104BB00080911414882309F49DCF1BC011E08091CB -:104BC0001514823009F010E08AE193E10E94B1EB04 -:104BD00000E09C0142E357E26C2F812F8CD883E0E8 -:104BE00001C082E0CF5FDF5FC53009F01ECF809348 -:104BF0001314DF91CF911F910F91FF90EF90DF90F1 -:104C0000CF90BF90AF909F908F907F906F905F906C -:104C10004F903F902F900895CF93DF930E94189864 -:104C2000E4E0F1E080818F7D8083C5E0D1E0888180 -:104C300080958072A3E0B1E08C9380818F7B80832C -:104C40008881809580748C936A98729A54985C9A43 -:104C500082E08093370D0E94C46F10923A0DDF916D -:104C6000CF910895CF93DF93EC010E94799740E0B4 -:104C700050E0BA01CE01DF91CF910C949997AF9299 -:104C8000BF92CF92DF92EF92FF920F931F93CF9339 -:104C9000DF93CDB7DEB76F970FB6F894DEBF0FBEC8 -:104CA000CDBF81E08093220D1092240D1092230D30 -:104CB0008CEF9AE00E9476D08BE1ECEFFAE0DE0117 -:104CC000159601900D928A95E1F78091FA0A9091DC -:104CD000FB0A9C838B838BE792E09A83898340E075 -:104CE00050E0BE016F5F7F4F80E090E00E94635B09 -:104CF000CE0101960E9436BFA090230DB090240DE6 -:104D00000E94A9EAE0901214F12CE11021C08091D8 -:104D10001514882329F0809143028823C9F00DC01F -:104D20008091380D8823B9F31092380D0E94D697E0 -:104D300080911414882379F35EC181E09091151459 -:104D4000911180E024E049E757E26F2D0E947D6FCA -:104D500068EA7AE08CEF9AE00E943ECF8091A80A40 -:104D60008F3209F45EC041E0E4125DC090911514E9 -:104D7000913009F047C08091380D882309F442C072 -:104D80001092380D80914D0C882319F18150809339 -:104D90004D0C882361F090E001974FE1489F90010E -:104DA000499F300D1124C901895E944F02C089EDDD -:104DB0009AE02BE1FC013496ACEFBAE001900D9241 -:104DC0002A95E1F7FC01828193819093FB0A8093FD -:104DD000FA0A81E090E0A0E0B0E020914D0C2111B2 -:104DE00003C080E090E0DC018093171490931814C6 -:104DF000A0931914B0931A141092121481E08093A6 -:104E00001414C0C080914302882369F081E091307E -:104E100009F080E020E245E757E26F2D0E947D6FA8 -:104E200002C081E001C082E001E0080F6501F1E00D -:104E3000CF1AD1081FEF100F4FEFC416D40609F494 -:104E4000D3C01E11CFC060E070E0C6010E94295D92 -:104E50008091A70A90911514882309F4A0C09E118F -:104E600095C08091380D882309F490C01092380DB8 -:104E70001D8218861C821B828BE792E09A838983AD -:104E80008091FF0A811103C069ED7AE002C068EFEA -:104E90007AE06115710519F06C5F7F4F02C060E028 -:104EA00070E021E048EA5AE0CE0105960E94ACD4B9 -:104EB000882361F18BE1FE013596ACEFBAE00190F9 -:104EC0000D928A95E1F72B813C813093FB0A209368 -:104ED000FA0A80914D0C8A3008F03DC091E0980F9D -:104EE00090934D0CEFE18E9FC0011124DC01A55E73 -:104EF000B44F4BE1ECEFFAE001900D924A95E1F7E7 -:104F0000FC01E95EF44F3383228325C0EFE9F2E12F -:104F100084918F010F5F1F4F882321F00E948339F6 -:104F2000F801F6CFEFE5F7E284918F010F5F1F4F95 -:104F3000882321F00E948339F801F6CF08EA1AE0AD -:104F4000F80181918F01882319F00E948339F8CFED -:104F50008AE00E948339CE0101960E9436BF1092EA -:104F6000121482E090E0A0E0B0E0809317149093D8 -:104F70001814A0931914B0931A1481E08093141498 -:104F80001092360D83E08093430235C08091430236 -:104F9000882341F181E0911380E041E020C09E151B -:104FA00029F0809143028823E9F013C08091380DE5 -:104FB0008823B9F31092380D88EA9AE00E9431965E -:104FC0000E94D0970E9409F480911414882349F319 -:104FD00012C081E090911514911380E040E06F2D94 -:104FE0000F94D1010F5F23CFF394E39445E0F412C3 -:104FF0008CCE109313146F960FB6F894DEBF0FBECD -:10500000CDBFDF91CF911F910F91FF90EF90DF9077 -:10501000CF90BF90AF9008952F923F924F925F92A2 -:105020006F927F928F929F92AF92BF92CF92DF92B8 -:10503000EF92FF920F931F93CF93DF93CDB7DEB71D -:1050400062970FB6F894DEBF0FBECDBF0E94FD92EF -:105050008111CFC005E11CE286EB9FE09A8B898B22 -:10506000FE0131965F019EE6892E9CE2992E1F017A -:10507000F8016591759185919491E989FA89C190BA -:10508000D190E190F190FA8BE98BA70196010F94F2 -:10509000570C2B013C01F101608371838283938360 -:1050A00020E030E040EA51EC0F947E0E87FD0AC00C -:1050B00020E030E040EA51E4C301B2010F940C0853 -:1050C00018162CF4F401849118160CF488C0F10120 -:1050D000C190D190E190F1901F0120E030E040EAD2 -:1050E00051ECC701B6010F947E0E87FD0AC020E087 -:1050F00030E040EA51E4C701B6010F940C081816DD -:105100004CF5E0E7F2E184918F010F5F1F4F8111B1 -:1051100003C0E0E8FAE204C00E948339F801F3CF4B -:1051200084918F010F5F1F4F882321F00E948339E4 -:10513000F801F6CF61E082E79AE20E941B700E94BC -:10514000D09788E290E0988B8F8788EC90E09E87DC -:105150008D873DC00C5F1F4FFFEF8F1A9F0A8CE2B7 -:105160000132180709F084CF81ECE82E8DE0F82E8B -:1051700010E0F50181919191A191B1915F01F70149 -:1051800081939193A193B1937F01812F0E949635D2 -:105190001F5F133071F70E94D55F60E082E69AE2EC -:1051A0000E941B7083E992E0988B8F8704E610E0E1 -:1051B0001E870D87BE01615F7F4FCE010D960E9455 -:1051C0002C928AEB92E0988B8F871E870D87BE0109 -:1051D000615F7F4FCE010D960E942C920AC0F7FAB4 -:1051E000F094F7F8F094F101C082D182E282F38268 -:1051F0006ECF62960FB6F894DEBF0FBECDBFDF91C3 -:10520000CF911F910F91FF90EF90DF90CF90BF90C3 -:10521000AF909F908F907F906F905F904F903F9056 -:105220002F900895FF920F931F93CF93DF9389E4FC -:105230000E94E838882321F00E943C38062F01C0E4 -:105240000FEF8AE40E94E838882321F00E943C385E -:10525000C62F01C0CFEF8AE50E949F38D82F811159 -:1052600005C081E50E949F38F82E01C0F12C07FD92 -:1052700006C0C7FD04C0D1111AC0F11018C0E0E784 -:10528000F2E18491EF012196811103C0E2E4FAE298 -:1052900004C00E948339FE01F4CF8491EF0121966E -:1052A000882309F451C00E948339FE01F6CF0330F0 -:1052B00010F4C330B8F0E0E7F2E18491EF012196F9 -:1052C000811103C0E3E2FAE204C00E948339FE01C7 -:1052D000F4CF8491EF0121968823B1F10E948339A4 -:1052E000FE01F7CF002E000C110B0C2E000CDD0B75 -:1052F0000E946C389B01AC01D801AA0FBB1FFF2094 -:1053000081F0FD01E00FF11FEC0FFD1FEE0FFF1FFD -:10531000EE0FFF1FEF58F04F608171818281938102 -:1053200003C060E070E0CB010A0F1B1FC00FD11F4C -:10533000CC0FDD1FCC0FDD1FCF58D04F0F94580C72 -:10534000688379838A839B83DF91CF911F910F912B -:10535000FF9008952F923F924F925F926F927F92AB -:105360008F929F92AF92BF92CF92DF92EF92FF9275 -:105370000F931F93CF93DF93CDB7DEB761970FB62F -:10538000F894DEBF0FBECDBF83E50E949F3888230F -:1053900049F00E945D38182F811106C080E00E94FC -:1053A000EB3602C01091640F8091B60F9091B70F49 -:1053B000A091B80FB091B90F89839A83AB83BC8356 -:1053C0008091BA0F9091BB0FA091BC0FB091BD0F0F -:1053D0008D839E83AF83B8878091BE0F9091BF0F5E -:1053E000A091C00FB091C10F89879A87AB87BC8706 -:1053F00080915C0F90915D0F892B09F4A1C083E42B -:105400000E949F38882309F49BC00E946C381B01BE -:105410002C0103E0612C712CF8ECF88B22EC298B29 -:10542000A12CB12C38EC3E8782E48F870150A0F18B -:1054300023E02D87802F90E04C01880C991C880E6A -:10544000991E3D8531503D873F3F81F3F401E30FC5 -:10545000F11DEE0FFF1FEE0FFF1FEF58F04FC08042 -:10546000D180E280F3809601A701B5018E859F85EA -:105470000F947E0E18161CF45601EE86FF869601D8 -:10548000A701B301888999890F940C0887FFD9CFA8 -:105490003601E88AF98AD5CF930148895989B5013F -:1054A0008E859F850F94580C20E030E040E05FE34C -:1054B0000F947108A20191010F94580C2B013C012B -:1054C0002DEB37E346E855EB0F947E0E87FD0AC0BF -:1054D0002DEB37E346E855E3C301B2010F940C0806 -:1054E000181674F580E00E94EB3643E0B42EBA94AF -:1054F000EFEFBE1629F103E08B2D90E06C01CC0C90 -:10550000DD1CC80ED91E015090F37601E00EF11C8F -:10551000C701880F991F880F991F9C012F58304F82 -:105520007901A3019201F7016081718182819381E8 -:105530000F94570CF7016083718382839383E3CFC9 -:1055400086E50E949F38882341F080915C0F9091FE -:105550005D0F892B11F00E94A63E8AE50E949F38BC -:10556000882329F00E946C3840E00E946737812F21 -:105570000E94EB36111103C0EFE9F2E11CC08091EB -:10558000640F8111F9CFE0E7F2E184918F010F5FA1 -:105590001F4F882321F00E948339F801F6CFE4E001 -:1055A000FAE284918F010F5F1F4F882329F30E9435 -:1055B0008339F801F6CF84918F010F5F1F4F882345 -:1055C00021F00E948339F801F6CF8091640F811198 -:1055D00003C062E873E002C06EE773E086EF99E211 -:1055E0000E9438588AE00E948339EFE9F2E1849101 -:1055F0008F010F5F1F4F882321F00E948339F8012C -:10560000F6CFE9EEF9E284918F010F5F1F4F8823F7 -:1056100021F00E948339F801F6CFC090D312D090C8 -:10562000D412E090D512F090D61220E030E0A9011B -:10563000C701B6010F947E0E18164CF442E0C70164 -:10564000B6010E94353E8AE00E9483390CC0E4EE28 -:10565000F9E284918F010F5F1F4F882321F00E9490 -:105660008339F801F6CF4CE050E066EB7FE0CE01E5 -:1056700001960F94670F892BD1F061960FB6F894BD -:10568000DEBF0FBECDBFDF91CF911F910F91FF9075 -:10569000EF90DF90CF90BF90AF909F908F907F90D2 -:1056A0006F905F904F903F902F900C94D55F6196D4 -:1056B0000FB6F894DEBF0FBECDBFDF91CF911F9123 -:1056C0000F91FF90EF90DF90CF90BF90AF909F90A1 -:1056D0008F907F906F905F904F903F902F900895A4 -:1056E000CF9380916F00C82FC27081FF05C0809159 -:1056F0006F008D7F80936F008091F0098093EF0998 -:105700008093EE098093ED0984E68093EC090E9472 -:105710002E8A88EE93E09093670D8093660DCC23DC -:1057200029F080916F00826080936F0081E0809308 -:1057300027140E942E4D0E94A7C68FE193E10E947C -:10574000AE878CE0EFE1F3E1A6EBBFE001900D92B4 -:105750008A95E1F7CF910C94D6352F923F924F92D4 -:105760005F926F927F928F929F92AF92BF92CF92F1 -:10577000DF92EF92FF920F931F93CF93DF93CDB7FA -:10578000DEB7C554D1090FB6F894DEBF0FBECDBF4A -:1057900085E40E94E838882321F00E943C387B0190 -:1057A00002C0E12CF12C83E40E94E838882321F028 -:1057B0000E943C386AA302C005E00AA385E50E9466 -:1057C000E838882319F00E945D3803C085E50E94FF -:1057D0009F388CA7F7FC07C0812C912C16E1A12ED5 -:1057E00013E4B12E06C0812C912CBCE8AB2EB2E4A0 -:1057F000BB2E83E50E94E838882321F00E946C3894 -:105800004B015C01E114F10411F410926A0DE9827C -:105810000E94D7ED2B013C01198117FD03C008E25E -:1058200010E002C00CE310E061E06E0D623080F029 -:10583000E6EAF9E284918F010F5F1F4F1B830A8311 -:10584000882309F48FC40E948339EA81FB81F2CF57 -:10585000E0EDF9E284917F012FEFE21AF20A88234A -:1058600021F00E948339F701F5CF0E947E763981BD -:1058700037FF04C08FE78093690D08C04981E42F8A -:10588000440FFF0BE859F24F8FE78083C501B40145 -:105890000F949C0D072E000C880B990B0F94120887 -:1058A0006A877B878C879D879801A8EEB3E00F9469 -:1058B000480C6DA77EA78FA798ABDC01CB01840DA8 -:1058C000951DA61DB71D8AAF9BAFACAFBDAF81E0E4 -:1058D0008093130209810F3F39F400E119E21FAFF1 -:1058E0000EAF0AED18E206C00EEF18E21FAF0EAFC2 -:1058F00007EC18E222961FAF0EAF22974CA25DA2D2 -:105900006EA27FA249AA5AAA6BAA7CAA1DAA1EAAA5 -:105910001FAA18AE19AE188E10E4198F0CE10A8F69 -:1059200016E41B8F1C8E1D8E1E8E1F8E1C8A1D8AD8 -:105930001E8A1F8A188A198A1A8A1B8AC12CD12C9E -:1059400076012FE730E040E050E02E833F83488728 -:105950005987FFE78F2E912CA12CB12C18A619A6E0 -:105960001AA61BA611E01F861E8625961FAE259738 -:10597000212C312C26961FAE26970981802F000FEF -:10598000990B9C012859324F24963FAF2EAF249794 -:10599000880F991F880F991FAC0149525D4E59A37A -:1059A00048A38AA1082E000C990B9BA38AA380917F -:1059B0001302882309F46EC20E94D7ED6A837B83A9 -:1059C0008C839D838091650D882309F4BDC00E945E -:1059D0003677098107FD0CC0A8A1B9A1BC91259615 -:1059E000BFAF2597E8A1F9A12180328003810BC0C8 -:1059F0000091DB1225960FAF25972090DC12309096 -:105A0000DD120091DE1226960FAF269725962FAD58 -:105A10002597322D432D26965FAD26976C8D7D8D73 -:105A20008E8D9F8D0F940C0887FF0AC025960FADB1 -:105A300025970C8F2D8E3E8E26960FAD26970F8FB5 -:105A4000288D398D4A8D5B8D25966FAD2597722DEA -:105A5000832D26969FAD26970F940C0887FF0AC0CA -:105A600025960FAD2597088F298E3A8E26960FAD75 -:105A700026970B8F25962FAD2597322D432D2696F1 -:105A80005FAD26976A857B858C859D85112309F4FA -:105A900043C00F940C0887FF57C04A815B816C811B -:105AA0007D814419550966097709DB01CA018858C7 -:105AB0009341A109B109B7FD47C0D501C4010E81C9 -:105AC0001F8128853985801B910BA20BB30B19818F -:105AD000B595A7959795879517FF03C08093690D96 -:105AE00005C02496EEADFFAD2497808348A759A743 -:105AF0006AA77BA70A850C8F1B851D8F0C850E8FCF -:105B00001D851F8F2A813B814C815D812CA33DA384 -:105B10004EA35FA310E018C00F947E0E1816A4F4D5 -:105B20008A819B81AC81BD812CA13DA14EA15FA149 -:105B3000821B930BA40BB50BAC01BD01485853411C -:105B40006109710977FFC1C120E030E040EA51E40A -:105B50006A857B858C859D850F94580C25962FAD85 -:105B60002597322D432D26965FAD26970F940C086E -:105B700087FF10C0E2E3F9E284918F010F5F1F4FAE -:105B80001B830A83882309F485C10E948339EA8133 -:105B9000FB81F2CF8A819B81AC81BD8129A93AA981 -:105BA0004BA95CA9821B930BA40BB50BB7FD93C04B -:105BB0000E942C758AE00E9483398A819B81AC8186 -:105BC000BD818053984FAF4FBF4F89AB9AABABAB02 -:105BD000BCAB0DA901115EC02EA93FA948AD59ADBE -:105BE00025966FAD2597722D832D26969FAD26970E -:105BF0000F947E0E1816DCF520E030E040E050E413 -:105C000025966FAD2597722D832D26969FAD2697ED -:105C10000F94580C6EAB7FAB88AF99AF2DA53EA506 -:105C20004FA558A98A819B81AC81BD81280F391F5E -:105C30004A1F5B1F2AAF3BAF4CAF5DAF20E030E0A7 -:105C400040EC50E46A857B858C859D850F94570CCC -:105C500025962FAD2597322D432D26965FAD26979D -:105C60000F940C08881F8827881F8DAB34C08A8149 -:105C70009B81AC81BD812AAD3BAD4CAD5DAD821B3E -:105C8000930BA40BB50BB7FD26C04EAD5FAD63E221 -:105C900079E21EC020E030E040EA51E46A857B856D -:105CA0008C859D850F94570C9B01AC0125966FAD9B -:105CB0002597722D832D26969FAD26970F940C085D -:105CC00087FF09C022964EAD5FAD22976EEE78E257 -:105CD00089810E9455778A819B81AC81BD81880F23 -:105CE000991FAA1FBB1F2CA13DA14EA15FA1821B22 -:105CF000930BA40BB50B84199509A609B709813834 -:105D00009F44A241B10580F0E9EAF8E284918F0155 -:105D10000F5F1F4F1B830A83882309F4BBC00E94B7 -:105D20008339EA81FB81F2CF2AA13BA14E855F85B1 -:105D3000241735070CF0ABC0ECE4F8E284918F0136 -:105D40000F5F1F4F1B830A83882329F00E9483392A -:105D5000EA81FB81F3CF198117FD03C001E813E04D -:105D600002C006E813E01B830A836A817B818BE310 -:105D700098E20E943858B701A60187E398E20E9492 -:105D800002588AE00E9483396A817B8186E298E228 -:105D90000E943858488959896A897B8982E298E249 -:105DA0000E9402588AE00E9483396A817B8181E1E6 -:105DB00098E20E9438584C895D896E897F898DE010 -:105DC00098E20E9402588AE00E9483391CA51123A0 -:105DD00009F4C8C1098107FF2DC0C092610DD0929E -:105DE000620DE092630DF092640D2CEA35EC47E20F -:105DF0005EE3688979898A899B890F947108609329 -:105E00005D0D70935E0D80935F0D9093600D2CEA95 -:105E100035EC47E25EE36C897D898E899F890F941A -:105E2000340D6093590D70935A0D80935B0D9093D0 -:105E30005C0D98C1C092A713D092A813E092A91349 -:105E4000F092AA132CEA35EC47E25EE3688979897F -:105E50008A899B890F9471086093B7137093B81364 -:105E60008093B9139093BA132CEA35EC47E25EE3C2 -:105E70006C897D898E899F890F94340D6093AF134F -:105E80007093B0138093B1139093B2136BC10E94BF -:105E90007B708DCDCB5BDF4F0FB6F894DEBF0FBEAE -:105EA000CDBFDF91CF911F910F91FF90EF90DF90C9 -:105EB000CF90BF90AF909F908F907F906F905F90AA -:105EC0004F903F902F900C947E760E851F85012B6E -:105ED00009F41DC148A459A46AA47BA4480E591E04 -:105EE0006A1E7B1E28A539A54AA55BA5281B390B70 -:105EF0004A0B5B0B6E817F81888599850F94EB0B34 -:105F0000A30192010F941C0CDA01C901880D991D9F -:105F1000AA1DBB1D84319105A105B105FCF04C0102 -:105F20005D018C3E9105A105B1052CF05BEE852E3F -:105F3000912CA12CB12C20E882169104A104B1046B -:105F4000DCF08EEF90E0A0E0B0E088199909AA0992 -:105F5000BB098E839F83A887B98712C044E1842E32 -:105F6000912CA12CB12C04E110E020E030E00E8354 -:105F70001F832887398704C08E829F82A886B986AE -:105F8000EEE9F9E284918F010F5F1F4F882321F022 -:105F90000E948339F801F6CFC501B4010E941B3E6F -:105FA000E9E9F9E284918F010F5F1F4F882321F007 -:105FB0000E948339F801F6CF6E817F8188859985AB -:105FC0000E941B3E488D598D6A8D7B8D82E999E236 -:105FD0000E9402584C8D5D8D6E8D7F8D8BE899E20D -:105FE0000E9402580E851F85033011050CF48FC0E6 -:105FF0006E817F81888599850F94120820E030E0BA -:1060000040E850E40F9471086B017C01288D398DB4 -:106010004A8D5B8D6C8D7D8D8E8D9F8D0F94570C71 -:106020002BED3FE049E450E40F94710820E030E0AC -:1060300040E05FE30F9471089B01AC01C701B6011A -:106040000F94340D6B017C01C301B2010F9412084F -:106050002FE632E143E85AE30F9471082B013C012B -:10606000B701A60185E899E20E940258B301A20196 -:106070008FE799E20E9402582AE939E949E15FE392 -:10608000C701B6010F9471086B017C019B01AC0143 -:106090000F94580CA30192010F94340D688B798BE7 -:1060A0008A8B9B8BA7019601C301B2010F947108E3 -:1060B00020E030E040E05EE30F9471086C8B7D8B54 -:1060C0008E8B9F8BEFE6F9E284918F010F5F1F4F5C -:1060D000882321F00E948339F801F6CFB701A60189 -:1060E00089E699E20E940258488959896A897B8920 -:1060F00083E699E20E9402584C895D896E897F8906 -:106100008DE599E20E9402588AE00E9483398E81CF -:106110009F81A885B985880D991DAA1DBB1D198170 -:10612000B595A7959795879517FF03C08093690D3F -:1061300005C02496EEADFFAD249780830E851F85A4 -:106140000F5F1F4F1F870E871A85188F0B85098FCA -:106150001C851A8F0D850B8F4A805B806C807D803B -:1061600011E0F2CCCB5BDF4F0FB6F894DEBF0FBE71 -:10617000CDBFDF91CF911F910F91FF90EF90DF90F6 -:10618000CF90BF90AF909F908F907F906F905F90D7 -:106190004F903F902F900895CF93DF9385E40E9416 -:1061A000E838811110C080E50E949F38882391F063 -:1061B0000E946C386093A7137093A8138093A9135F -:1061C0009093AA1307C00E944C38882361F3E0E73C -:1061D000F2E16EC089E40E949F38882381F00E941A -:1061E0006C382CEA35EC47E25EE30F94710860935B -:1061F000B7137093B8138093B9139093BA1384E4D0 -:106200000E949F38882381F00E946C382CEA35EC7C -:1062100047E25EE30F94340D6093AF137093B013B5 -:106220008093B1139093B213EFE9F2E18491EF01FF -:106230002196882321F00E948339FE01F7CF4091F7 -:10624000A7135091A8136091A9137091AA1387EF17 -:1062500097E20E9402582CEA35EC47E25EE3609137 -:10626000B7137091B8138091B9139091BA130F942A -:10627000340DAB01BC0183EF97E20E9402582CEA77 -:1062800035EC47E25EE36091AF137091B0138091FB -:10629000B1139091B2130F947108AB01BC018FEE52 -:1062A00097E20E9402588AE0DF91CF910C948339E3 -:1062B0008491EF012196882321F00E948339FE0109 -:1062C000F7CFEBEFF7E28491EF012196882321F0DD -:1062D0000E948339FE01F7CFDF91CF910895CF93CC -:1062E000DF93EFE9F2E18491EF012196882321F019 -:1062F0000E948339FE01F7CF83E50E949F388823EF -:1063000021F00E945D3880932802EFEDF7E284913E -:10631000EF012196882321F00E948339FE01F7CFF7 -:1063200080912802811103C0EBEDF7E202C0E7ED96 -:10633000F7E28491EF012196882321F00E948339AE -:10634000FE01F7CFEFECF7E28491EF01219688236D -:1063500021F00E948339FE01F7CF2091A60F3091E2 -:10636000A70F4091A80F5091A90F6091650F7091F0 -:10637000660F8091670F9091680F0F94580CAB01D6 -:10638000BC018DEC97E20E9402582091AA0F309137 -:10639000AB0F4091AC0F5091AD0F6091690F7091B0 -:1063A0006A0F80916B0F90916C0F0F94580CAB019A -:1063B000BC018AEC97E20E9402582091AE0F309106 -:1063C000AF0F4091B00F5091B10F60916D0F709170 -:1063D0006E0F80916F0F9091700F0F94580CAB015E -:1063E000BC0187EC97E20E940258EFEBF7E2849140 -:1063F000EF012196882321F00E948339FE01F7CF17 -:106400002091A60F3091A70F4091A80F5091A90F8E -:1064100060911C0270911D0280911E0290911F02DA -:106420000F94580CAB01BC018DEB97E20E9402580F -:106430002091AA0F3091AB0F4091AC0F5091AD0F4E -:10644000609120027091210280912202909123029A -:106450000F94580CAB01BC018AEB97E20E940258E2 -:106460002091AE0F3091AF0F4091B00F5091B10F0E -:10647000609124027091250280912602909127025A -:106480000F94580CAB01BC0187EB97E20E940258B5 -:106490008AE0DF91CF910C948339CF93DF9382E42C -:1064A0000E949F38882351F00E942C386093020488 -:1064B00070930304809304049093050483E50E9481 -:1064C0009F38882351F00E946C386093CC137093EE -:1064D000CD138093CE139093CF1384E50E949F3801 -:1064E000882351F00E946C386093C8137093C913CD -:1064F0008093CA139093CB1388E50E949F3888231A -:1065000051F00E946C3860938713709388138093C6 -:10651000891390938A1389E50E949F38882351F04C -:106520000E946C3860938B1370938C1380938D133F -:1065300090938E138AE50E949F388823E9F00E9489 -:106540006C3860938F137093901380939113909392 -:1065500092132DEC3CEC4CEC5DE30F940C081816F8 -:106560005CF0E5E8F7E28491EF012196882321F0C1 -:106570000E948339FE01F7CF85E40E949F3888236B -:1065800051F00E946C38609393137093941380932E -:10659000951390939613DF91CF910895FF920F93E7 -:1065A0001F93CF93DF93F82E092F162FE0E8F7E221 -:1065B0008491EF012196882321F00E948339FE0106 -:1065C000F7CFEF2DF02F8491EF012196882321F052 -:1065D0000E948339FE01F7CFEEE7F7E28491EF01E5 -:1065E0002196882321F00E948339FE01F7CF612F85 -:1065F00070E080E090E00E941B3E8AE0DF91CF9146 -:106600001F910F91FF900C9483397F928F929F92EC -:10661000AF92BF92CF92DF92EF92FF920F931F93B0 -:10662000CF93DF931F92CDB7DEB7E091E413EE2353 -:1066300041F0FC0120813181420F531F518340837F -:1066400049C069017C015B018B01040F151FA01675 -:10665000B10609F43FC0F70180809180F501719087 -:106660005F017982C4010F94D50B781631F1672D43 -:10667000C4010F94DD0BC4010F94D50B99818917C8 -:10668000E1F0EFE9F2E184918F010F5F1F4F882362 -:1066900021F00E948339F801F6CFEEE9FAE2849105 -:1066A0008F010F5F1F4F882321F00E948339F8016B -:1066B000F6CF81E08093E4130DC0BE016F5F7F4F82 -:1066C000C6010E948E93F70180819181019691838A -:1066D0008083BDCF0F90DF91CF911F910F91FF90DD -:1066E000EF90DF90CF90BF90AF909F908F907F9072 -:1066F0000895CF93DF938F389240B1F0E0E7F2E155 -:106700008491EF012196882321F00E948339FE01B4 -:10671000F7CFE8EBFAE28491EF012196882331F07C -:106720000E948339FE01F7CF80E001C081E0DF9154 -:10673000CF9108958F929F92AF92BF92CF92DF92A6 -:10674000EF92FF920F931F93CF93DF93CDB7DEB7F6 -:10675000C259D1090FB6F894DEBF0FBECDBFE9967E -:106760001CAE1DAE1EAE1FAEE99780918A039091BC -:106770008B03A0918C03B0918D03ED968CAF9DAFF0 -:10678000AEAFBFAFED97CD57DF4F19821882C35818 -:10679000D04084E690E0CB57DF4F99838883C5587B -:1067A000D0401092E4139E012D573F4F44E050E03B -:1067B000BE0167587F4FCE018B579F4F26DFCB57C7 -:1067C000DF4F88819981C558D0400296CB57DF4F63 -:1067D00099838883C558D040CD57DF4F19821882DE -:1067E000C358D04081E0C557DF4F8883CB58D04095 -:1067F0009E012D573F4F41E050E0BE0165577F4F4E -:10680000CE018B579F4F01DF9E012D573F4F40E137 -:1068100050E06BE673E1CE018B579F4FF6DE9E0191 -:106820002D573F4F44E050E062E074E0CE018B57BB -:106830009F4FEBDE9E012D573F4F40E150E067E94F -:1068400073E1CE018B579F4FE0DE9E012D573F4FE6 -:1068500040E150E060ED73E1CE018B579F4FD5DEF4 -:106860009E012D573F4F44E050E063E873E1CE01B5 -:106870008B579F4FCADE9E012D573F4F44E050E09B -:106880006FE773E1CE018B579F4FBFDE9E012D57FF -:106890003F4F44E050E06BE773E1CE018B579F4FD1 -:1068A000B4DE9E012D573F4F44E050E06CEC73E1A5 -:1068B000CE018B579F4FA9DE9E012D573F4F44E0DD -:1068C00050E068EC73E1CE018B579F4F9EDE9E0136 -:1068D0002D573F4F40E150E067E873E1CE018B5701 -:1068E0009F4F93DE8AE097EDA3EABCE3E9968CAF75 -:1068F0009DAFAEAFBFAFE9979E012D573F4F44E02C -:1069000050E0BE016B587F4FCE018B579F4F7DDE0D -:106910009E012D573F4F4CE050E061EC7DE0CE01F1 -:106920008B579F4F72DE8091D3129091D412A09119 -:10693000D512B091D612C358DF4F88839983AA83AA -:10694000BB83CD57D0409E012D573F4F44E050E0D0 -:10695000BE0163587F4FCE018B579F4F56DEE9969D -:106960001CAE1DAE1EAE1FAEE99783E0C457DF4FCD -:106970008883CC58D040C357DF4F8883CD58D04050 -:106980009E012D573F4F44E050E0BE016B587F4FB2 -:10699000CE018B579F4F39DE9E012D573F4F41E06F -:1069A00050E0BE0164577F4FCE018B579F4F2DDEC5 -:1069B0009E012D573F4F41E050E0BE0163577F4F8E -:1069C000CE018B579F4F21DE1AE011509E012D57AB -:1069D0003F4F44E050E0112341F0BE016B587F4F20 -:1069E000CE018B579F4F11DEF0CF62EB7FE0CE01DF -:1069F0008B579F4F0ADEE9961CAE1DAE1EAE1FAE32 -:106A0000E9971AE0115069F09E012D573F4F44E07D -:106A100050E0BE016B587F4FCE018B579F4FF5DD85 -:106A2000F1CF83E0C257DF4F8883CE58D040C157A3 -:106A3000DF4F8883CF58D0409E012D573F4F41E014 -:106A400050E0BE0162577F4FCE018B579F4FDDDD77 -:106A50009E012D573F4F41E050E0BE0161577F4FEF -:106A6000CE018B579F4FD1DD9E012D573F4F44E004 -:106A700050E06CE57FE0CE018B579F4FC6DD9E0155 -:106A80002D573F4F44E050E060EE73E1CE018B574D -:106A90009F4FBBDD9E012D573F4F44E250E061E721 -:106AA0007FE0CE018B579F4FB0DDC057DF4F18827C -:106AB000C059D0408FEFCF56DF4F8883C159D040A7 -:106AC0009E012D573F4F41E050E0BE0160577F4F80 -:106AD000CE018B579F4F99DD9E012D573F4F41E0CF -:106AE00050E0BE016F567F4FCE018B579F4F8DDD1B -:106AF0009E012D573F4F44E050E060EC73E1CE0122 -:106B00008B579F4F82DD9E012D573F4F44E050E051 -:106B10006CEB73E1CE018B579F4F77DD9E012D57B4 -:106B20003F4F44E050E064EC73E1CE018B579F4F40 -:106B30006CDD10E0C12C80E8D82E8BE3E82E85E4D4 -:106B4000F82E812C912C90E8A92E9FE3B92E1111DB -:106B500034C09E012D573F4F44E050E067EA73E197 -:106B6000CE018B579F4F51DD9E012D573F4F44E083 -:106B700050E067EB73E1CE018B579F4F46DD9E01DE -:106B80002D573F4F44E050E06FEA73E1CE018B5741 -:106B90009F4F3BDDE9968CAE9DAEAEAEBFAEE997A2 -:106BA0009E012D573F4F44E050E0BE016B587F4F90 -:106BB000CE018B579F4F29DD28C0E996CCAEDDAEC4 -:106BC000EEAEFFAEE9979E012D573F4F44E050E0F7 -:106BD000BE016B587F4FCE018B579F4F16DDE99654 -:106BE0001CAE1DAE1EAE1FAEE99704E0015069F069 -:106BF0009E012D573F4F44E050E0BE016B587F4F40 -:106C0000CE018B579F4F01DDF1CF1F5F153009F08B -:106C10009ECF84E190E0C957DF4F99838883C7589E -:106C2000D0409E012D573F4F42E050E0BE016957D2 -:106C30007F4FCE018B579F4FE8DC9E012D573F4F72 -:106C400044E050E061E67DE0CE018B579F4FDDDCF4 -:106C50009E012D573F4F44E050E06DE57DE0CE01B1 -:106C60008B579F4FD2DC9E012D573F4F44E050E0A1 -:106C700069E57DE0CE018B579F4FC7DC80E290E055 -:106C8000C757DF4F99838883C958D0409E012D573D -:106C90003F4F42E050E0BE0167577F4FCE018B5718 -:106CA0009F4FB3DCCE56DF4F1882C259D04080E2EE -:106CB000E5EBF2E0DE019D9601900D928A95E1F7F9 -:106CC0009E012D573F4F41E050E0BE016E567F4F71 -:106CD000CE018B579F4F99DC9E012D573F4F40E2CD -:106CE00050E0BE01635D7F4FCE018B579F4F8DDC1F -:106CF0009E012D573F4F41E050E06EE173E1CE0120 -:106D00008B579F4F82DC10E011110EC080911A1337 -:106D100090911B13A0911C13B0911D13E9968CAF99 -:106D20009DAFAEAFBFAFE9979E012D573F4F44E0F7 -:106D300050E0BE016B587F4FCE018B579F4F65DCF3 -:106D40001F5F153009F7BE01635B7F4F86E1FB01D2 -:106D500011928A95E9F79E012D573F4F46E150E089 -:106D6000CE018B579F4F51DC8CE2E5EDF2E0DE0166 -:106D7000119601900D928A95E1F79E012D573F4F94 -:106D80004CE250E0BE016F5F7F4FCE018B579F4FAB -:106D90003CDCBE0161597F4F86E0FB0111928A9570 -:106DA000E9F79E012D573F4F46E050E0CE018B574B -:106DB0009F4F2BDCE9961CAE1DAE1EAE1FAEE997B1 -:106DC0009E012D573F4F44E050E0BE016B587F4F6E -:106DD000CE018B579F4F19DCBE016D597F4F8CE060 -:106DE000FB0111928A95E9F79E012D573F4F4CE028 -:106DF00050E0CE018B579F4F08DCE9961CAE1DAECC -:106E00001EAE1FAEE9971CE1115069F09E012D578F -:106E10003F4F44E050E0BE016B587F4FCE018B578F -:106E20009F4FF3DBF1CFE9961CAE1DAE1EAE1FAE39 -:106E3000E99714E0115069F09E012D573F4F44E04F -:106E400050E0BE016B587F4FCE018B579F4FDDDB6B -:106E5000F1CFE9961CAE1DAE1EAE1FAEE9971BE04A -:106E6000115069F09E012D573F4F44E050E0BE01A4 -:106E70006B587F4FCE018B579F4FC7DBF1CF80916F -:106E8000E413811164C0CB57DF4FE880F980C55807 -:106E9000D040F4E6EF1AF108CD57DF4F8881998191 -:106EA000C358D040CF57DF4F99838883C158D04013 -:106EB00084E690E0CB57DF4F99838883C558D04054 -:106EC0009E012D573F4F44E050E063E373E0CE0155 -:106ED0008B579F4F9ADB9E012D573F4F42E050E06A -:106EE000BE016F577F4FCE018B579F4F8EDBEFE96F -:106EF000F2E184918F010F5F1F4F882321F00E94E0 -:106F00008339F801F6CFB70180EE9AE20E941F584C -:106F1000CF57DF4F48815981C158D04060E070E0C1 -:106F200083ED9AE20E94E557E0EDFAE284918F0149 -:106F30000F5F1F4F882321F00E948339F801F6CF9D -:106F4000C701D7DB9091E413892B8093E4139091D0 -:106F5000E41381E08927CE56DF4F0FB6F894DEBFE9 -:106F60000FBECDBFDF91CF911F910F91FF90EF909A -:106F7000DF90CF90BF90AF909F908F9008958F92A9 -:106F80009F92AF92BF92CF92DF92EF92FF920F93B8 -:106F9000CF93DF931F92CDB7DEB77C015B016A010F -:106FA00049018091E4138823E9F0F7018081918100 -:106FB000C80ED91ED182C08222C001111DC0BE01DF -:106FC0006F5F7F4FC4010E948E93F7018081918192 -:106FD000019691838083FFEFAF1ABF0A81E0C81A40 -:106FE000D10869F0F701808191810F94D50B8983D5 -:106FF0009091E5139111E1CFF5018083E0CF0F90DF -:10700000DF91CF910F91FF90EF90DF90CF90BF90E5 -:10701000AF909F908F900895CF93DF93CDB7DEB759 -:107020002C970FB6F894DEBF0FBECDBF8091B60F80 -:107030009091B70FA091B80FB091B90F89839A833F -:10704000AB83BC838091BA0F9091BB0FA091BC0F12 -:10705000B091BD0F8D839E83AF83B8878091BE0FA3 -:107060009091BF0FA091C00FB091C10F89879A87EF -:10707000AB87BC870E9483580E94A28680E00E9452 -:10708000963581E00E94963582E00E9496356091A7 -:10709000E6137091E7138091E8139091E91340E0B3 -:1070A0000E9467370E943B330E94DE584CE050E05C -:1070B00066EB7FE0CE0101960F94670F892B51F0AC -:1070C0002C960FB6F894DEBF0FBECDBFDF91CF91E7 -:1070D0000C94D55F2C960FB6F894DEBF0FBECDBFD3 -:1070E000DF91CF9108950F931F93CF93DF938B017F -:1070F000EA01DB016D917C9104960E943ECFD8019C -:10710000ED91FC91119790818881992349F08D38F8 -:1071100038F43196ED93FC9388818F5F8883EFCFAD -:107120008D3858F48FE28083F80180819181019637 -:107130009183808388818F5F8883DF91CF911F91B6 -:107140000F910895FC0120E03EE2DB014C914032BA -:1071500041F0283011F430833196DB014C914083AB -:1071600031962F5F6F5F7F4F2B3079F71082089534 -:10717000CF938091D0118823B9F14091C8115091DB -:10718000C9116091CA117091CB1128EC3FE0809138 -:10719000D1119091D2110E94E1D0C82F811102C06B -:1071A000C0E023C04091CC115091CD116091CE111F -:1071B0007091CF11411551056105710591F028ECD1 -:1071C0003FE08091D1119091D2110E94E1D08823AB -:1071D00039F31092CC111092CD111092CE11109261 -:1071E000CF111092D01101C0C1E08C2FCF91089522 -:1071F000CF92DF92EF92FF92CF936B017C01C42F6D -:107200008091C8119091C911A091CA11B091CB1170 -:107210008C159D05AE05BF05C9F0AADF811102C01E -:1072200080E018C028EC3FE0B701A6018091D111A1 -:107230009091D2110E9442D1882391F3C092C8113B -:10724000D092C911E092CA11F092CB1181E0C11124 -:107250008093D011CF91FF90EF90DF90CF90089561 -:107260004F925F926F927F928F929F92AF92BF9256 -:10727000CF92DF92EF92FF920F931F93CF93DF9302 -:10728000EC01423051056105710510F480E068C0E1 -:1072900089859A85AB85BC850196A11DB11D841792 -:1072A0009507A607B70790F38F89803149F4852E9B -:1072B000962EA72EBB248B899C89AD89BE890FC0D1 -:1072C000803221F78B889C88AD88BE88DB01CA019B -:1072D000E7E0B695A79597958795EA95D1F7880E3B -:1072E000991EAA1EBB1E280139016A017B0141E0DB -:1072F000C501B4017DDF882349F29F89903161F493 -:10730000DD24EE24FF249601220F331FF901E853F8 -:10731000F04F5182408211C0E894C7F8DD24EE247A -:10732000FF249601220F331F220F331FF901E85368 -:10733000F04F40825182628273829A89923080F04B -:107340004D815E816F817885840E951EA61EB71EC5 -:107350008092CC119092CD11A092CE11B092CF110B -:10736000DF91CF911F910F91FF90EF90DF90CF9021 -:10737000BF90AF909F908F907F906F905F904F9055 -:107380000895CF92DF92EF92FF920F931F93CF93C6 -:10739000DF93FC0181859285A385B4850196A11DAB -:1073A000B11D84179507A607B70710F480E060C0E9 -:1073B0008789803149F4BB27A72F962F852FC38853 -:1073C000D488E588F6880FC0803281F78389948954 -:1073D000A589B6896A017B01C7E0F694E794D79442 -:1073E000C794CA95D1F78C0D9D1DAE1DBF1DE90137 -:1073F0006A017B018F014091C8115091C9116091C0 -:10740000CA117091CB1184179507A607B70731F001 -:1074100040E0BC01CD01ECDE882341F2F801878910 -:10742000803179F4B701A601552766277727440FE5 -:10743000551FFA01E853F04F80819181A0E0B0E040 -:1074400012C0B701A6014F77552766277727440F4B -:10745000551F440F551FFA01E853F04F8081918169 -:10746000A281B381BF7088839983AA83BB8381E0A3 -:10747000DF91CF911F910F91FF90EF90DF90CF9010 -:1074800008954F925F926F927F92AF92BF92CF9288 -:10749000DF92EF92FF920F931F93CF93DF9300D071 -:1074A0001F92CDB7DEB78C0149835A836B837C83EF -:1074B0005901C12CD12C7601412C82E0582E612C2F -:1074C000712C49815A816B817C819E012F5F3F4FD6 -:1074D000C80157DF882341F1D301C201F8010584B7 -:1074E00004C0880F991FAA1FBB1F0A94D2F7C80EA9 -:1074F000D91EEA1EFB1E49815A816B817C818789D6 -:10750000803139F481E0483F5F4F6105710538F4FF -:10751000D8CF81E0483F5F4F6F4F7F4090F2F50139 -:10752000C082D182E282F3820F900F900F900F9071 -:10753000DF91CF911F910F91FF90EF90DF90CF904F -:10754000BF90AF907F906F905F904F900895DF92C3 -:10755000EF92FF920F931F93CF93DF938C01EB0178 -:107560007A018DE0D82E40E250E0BE01C8010E94B1 -:10757000A0D18032910539F021E0892B09F420E077 -:10758000822F819544C028812223C9F1253E11F024 -:107590002E3231F4E114F10431F3F7011082E3CF1C -:1075A000E114F10441F13B853F733F3021F54A8DF1 -:1075B0005B8D452B01F52F713FEF320F3230D8F440 -:1075C00030E021503109D29EC001D39E900D11248C -:1075D000D701A80FB91FFE0120E0AD01253088F4C6 -:1075E00031813D932F5F32962D30C1F7288126FFE0 -:1075F00002C0FA0115862B8523FDB5CF08C080E0B7 -:1076000006C02B3010F43481ECCF3681EACFDF9105 -:10761000CF911F910F91FF90EF90DF900895CF933E -:10762000DF93EC018B81882331F1898187FF20C0B2 -:1076300061E0CE010E9422CFFC01892BE1F0808124 -:10764000853EC9F08B81823040F489899A89AB8963 -:10765000BC89848F958FA68FB78F8D899E89AF89BE -:10766000B88D938F828FB58BA48B89818F77898317 -:10767000DF91CF917DCD81E0888380E0DF91CF9154 -:1076800008952F923F924F925F926F927F928F92C6 -:107690009F92AF92BF92CF92DF92EF92FF920F93A1 -:1076A0001F93CF93DF9300D01F92CDB7DEB78C012D -:1076B0004B011A01DC0113968C9113978130C9F4A8 -:1076C00011968C9181FF15C082FF19C0F801418984 -:1076D00052896389748980859185A285B3858417D1 -:1076E0009507A607B70759F0C8010E942FCE811150 -:1076F00006C081E0D8018C938FEF9FEF29C1610113 -:1077000085C059968D919C915A97FC0174802FEFFA -:10771000270D2A013B0139E07694679457944794EA -:107720003A95D1F7722E74207A01F1E0FF2277208A -:1077300009F478C080E092E08E199F0956018C15FB -:107740009D0508F45C01D80159962D913C915A97FA -:1077500014968D919D910D90BC91A02D0297A10939 -:10776000B109F901058404C0880F991FAA1FBB1F26 -:107770000A94D2F74685578560897189840F951FD1 -:10778000A61FB71F9C01AD01270D311D411D511DC5 -:1077900029013A01A11432E0B30609F089C08091B1 -:1077A000C8119091C911A091CA11B091CB1148167E -:1077B00059066A067B0669F41092D0118FEF9FEF8D -:1077C000DC018093C8119093C911A093CA11B093A2 -:1077D000CB119401B301A2018091D1119091D211EA -:1077E0000E94E1D0882309F484CFF8018085918537 -:1077F000A285B3858A0D9B1DA11DB11D8087918730 -:10780000A287B3878A0C9B1CCA18DB08D80118967C -:107810004D915D916D917C911B97C114D10409F03C -:1078200070CF7AC0E114F10409F084CF14964D9121 -:107830005D916D917C911797411551056105710519 -:1078400059F455968D919D910D90BC91A02D009766 -:10785000A105B10539F520C09E012F5F3F4F91DD95 -:10786000882309F446CF89819A81AB81BC81F801D4 -:10787000218D328DF9012789203139F4883FFFEFBE -:107880009F07A105B10540F40DC0883F2FEF920777 -:10789000A2072FE0B20730F0C8010E9471CF81111A -:1078A00049CF27CFF80184839583A683B78342CF3E -:1078B000E114F10411F5D80118964D915D916D9187 -:1078C0007C911B9751968D919D910D90BC91A02D0F -:1078D000481759076A077B0780F04ADC882309F4B8 -:1078E00008CF81E08093D0114092C8115092C91105 -:1078F0006092CA117092CB1107C041E0C301B2017E -:1079000077DC882309F4F5CEA501B401C7018853BB -:10791000904F0F94740F69CFF80181899289A389E0 -:10792000B48984179507A607B70738F4418B528BA3 -:10793000638B748B818180688183F801818183FDF1 -:1079400002C0C10105C0C8016ADE8111FACFD1CEE3 -:107950000F900F900F900F90DF91CF911F910F918B -:10796000FF90EF90DF90CF90BF90AF909F908F905F -:107970007F906F905F904F903F902F900895CF939E -:10798000DF931F92CDB7DEB7698341E050E0BE01BF -:107990006F5F7F4F049675DE0F90DF91CF91089552 -:1079A0008FEF8EBD0DB407FEFDCF8EB508954F92BB -:1079B0005F926F927F928F929F92AF92BF92CF927F -:1079C000DF92EF92FF920F931F93CF93C82FE82E71 -:1079D000F12CF701E259F34DB490823051F481E07B -:1079E0000E94F934811127C181E00E948A398111F6 -:1079F00022C16701CC0CDD1CCC0CDD1CF601EE595C -:107A0000F34D45905590659074906B2DBB0C770BA2 -:107A1000880B990B0F9412084B015C0120E030E0B9 -:107A200040EC5FE3C301B2010F947108A50194011A -:107A30000F947108AB01BC0100E010E098018C2F9D -:107A40000E941D36C23009F0C9C080E00E948A3908 -:107A5000E0E070E060EA80E42E2F372F462F582FA9 -:107A6000C501B4010F9471084B015C0120E030E0C6 -:107A7000A9010F940C08882309F445C0C23021F0F5 -:107A800000E010E0980104C000E010E020E830E4DD -:107A9000B501A40170588C2F0E941D36C23009F028 -:107AA000A9C081E00E948A398111C5C0412C512CA6 -:107AB000612C90E4792E15C06AE0F601EF5DF34D7C -:107AC000459055906590749070E080E090E00F9440 -:107AD00012089B01AC01C301B2010F94340D2B01BC -:107AE0003C01A5019401C501B4010F94580CAB01F0 -:107AF000BC01930182018C2F0E941D36C23019F403 -:107B000080E00E948A3981E090E00C2E01C0880F4D -:107B10000A94EAF79091A50F982B9093A50F909156 -:107B2000C60F892B8093C60FF601E75CFC4E1082CE -:107B30001182128213828C2F0E949635F601EB5E21 -:107B4000F34D85919591A591B491F601EA54F04FCA -:107B500080839183A283B383C230D1F42091B20F8A -:107B60003091B30F4091B40F5091B50F6091BE0F9B -:107B70007091BF0F8091C00F9091C10F0F94570C5F -:107B80006093BE0F7093BF0F8093C00F9093C10F8F -:107B90000E94D635F601EB5BFC4ED601AA54B04FDD -:107BA0008D919D910D90BC91A02D80839183A28396 -:107BB000B383C23009F03FC080E0CF911F910F9195 -:107BC000FF90EF90DF90CF90BF90AF909F908F90FD -:107BD0007F906F905F904F900C94F934F601EA5AC1 -:107BE000F34D85919591A591B491E82F792F6A2F46 -:107BF0008B2F32CFF701ED5AF34D649161115DCFB8 -:107C0000EFE9F2E184917F019FEFE91AF90A8823F5 -:107C100021F00E948339F701F5CFE1E3FCE2849182 -:107C20007F019FEFE91AF90A882309F445CF0E94E2 -:107C30008339F701F4CFCF911F910F91FF90EF900F -:107C4000DF90CF90BF90AF909F908F907F906F907C -:107C50005F904F900895CF92DF92EF92FF92CF9373 -:107C6000DF93EC01C090650FD090660FE090670F36 -:107C7000F090680FA7019601688179818A819B81C4 -:107C80000F940C0887FF04C0C882D982EA82FB8265 -:107C9000C090690FD0906A0FE0906B0FF0906C0F5E -:107CA000A70196016C817D818E819F810F940C08C4 -:107CB00087FF04C0CC82DD82EE82FF82C0901C026E -:107CC000D0901D02E0901E02F0901F02A7019601C5 -:107CD000688179818A819B810F947E0E181624F425 -:107CE000C882D982EA82FB82C0902002D090210211 -:107CF000E0902202F0902302A70196016C817D8121 -:107D00008E819F810F947E0E181624F4CC82DD8222 -:107D1000EE82FF82C0906D0FD0906E0FE0906F0FDB -:107D2000F090700FA7019601688579858A859B85FB -:107D30000F940C0887FF04C0C886D986EA86FB86A4 -:107D4000C0902402D0902502E0902602F0902702F5 -:107D5000A7019601688579858A859B850F947E0E9B -:107D6000181624F4C886D986EA86FB86DF91CF915F -:107D7000FF90EF90DF90CF9008954F925F926F92B7 -:107D80007F928F929F92AF92BF92CF92DF92EF92AB -:107D9000FF92CF934B015C0169017A0120E030E052 -:107DA0004CE052E40F94570C2B013C012FE632E1DA -:107DB00043E85AEB0F947E0E87FD48C021E230E085 -:107DC00046E953E4C301B2010F940C0818160CF4F1 -:107DD0003DC02FE632E143E85AEBC701B6010F94EC -:107DE0007E0E87FD33C021E230E046E953E4C7014F -:107DF000B6010F940C0818164CF12AEF3EEF4BE039 -:107E000052E4C501B4010F947E0E87FD1FC021E22C -:107E100030E041E953E4C501B4010F940C08181691 -:107E2000ACF027EE3BEF4FE151E4C701B6010F94F0 -:107E30007E0E87FD0BC0C1E021E230E041E953E452 -:107E4000C701B6010F940C0818160CF4C0E08C2F73 -:107E5000CF91FF90EF90DF90CF90BF90AF909F9029 -:107E60008F907F906F905F904F9008952BE732E056 -:107E7000FC013183208304960C947339179A809106 -:107E8000A50F8E7F8093A50F169A8091A50F8D7FE9 -:107E90008093A50F159A8091A50F8B7F8093A50FD6 -:107EA000149A08958C01E0E7F2E18491EF012196A4 -:107EB000882321F00E948339FE01F7CFE5EFFBE232 -:107EC0008491EF012196882321F00E948339FE01DD -:107ED000F7CF0E947E76D2DF0E940CA661E0C80137 -:107EE0000E941B700E94D097C091B309C695C69599 -:107EF0000E946D5ADC2FDD0F1D2F1C0F84E00E94A5 -:107F000037981092E909C093EA090E94A559109286 -:107F1000E909D093EA0986EE9BE20E948F591092FC -:107F2000E9091093EA0989ED9BE20E948F590E94AA -:107F300050598111E3CF2FEF8BE49DE12150804018 -:107F40009040E1F700C00000F8942FEF84E39CE03C -:107F5000215080409040E1F700C000000E947E76F2 -:107F6000A895FECF2F923F924F925F926F927F9291 -:107F70008F929F92AF92BF92CF92DF92EF92FF9239 -:107F80000F931F93CF93DF9300D01F92CDB7DEB72F -:107F90000E947B700E94D7ED6B017C01109144021E -:107FA000112309F47BC080912B13882309F476C038 -:107FB0004091611350916213609163137091641347 -:107FC00046015701841A950AA60AB70AB7FC78C079 -:107FD000833051F134F481300CF460C0EFE9F2E108 -:107FE00006C0843009F05AC0EFE9F2E13BC0849149 -:107FF0009F012F5F3F4F3B832A83882329F00E94F4 -:108000008339EA81FB81F3CFEBE5FBE284919F01A9 -:108010002F5F3F4F3B832A83882309F43FC00E9490 -:108020008339EA81FB81F2CFEFE9F2E184919F018C -:108030002F5F3F4F3B832A83882329F00E94833997 -:10804000EA81FB81F3CFE4E4FBE284919F012F5F9F -:108050003F4F3B832A83882309F10E948339EA81B9 -:10806000FB81F3CF84919F012F5F3F4F3B832A8396 -:10807000882329F00E948339EA81FB81F3CFECE267 -:10808000FBE284919F012F5F3F4F3B832A8388232C -:1080900029F00E948339EA81FB81F3CF212F30E060 -:1080A000A8EEB3E00F94480CC60ED71EE81EF91ECA -:1080B000C0926113D0926213E0926313F092641342 -:1080C0008091540F843010F40E94B83A0E94D7ED8A -:1080D000C0903013D0903113E0903213F0903313EE -:1080E000C114D104E104F10489F100912C13109121 -:1080F0002D1320912E1330912F130C0D1D1D2E1DAD -:108100003F1D4B015C01801A910AA20AB30AB7FC19 -:108110001DC0E0E7F2E184919F012F5F3F4F3B8359 -:108120002A83882329F00E948339EA81FB81F3CFD7 -:108130006091A30F7091A40F8FE99BE20E943858C1 -:108140008AE00E94833986E99BE27AC0C0904502AA -:10815000D0904602E0904702F0904802C114D1044A -:10816000E104F104B1F13091EF092091F0093217E7 -:1081700049F060932C1370932D1380932E139093DA -:108180002F1327C000912C1310912D1320912E1323 -:1081900030912F130C0D1D1D2E1D3F1DDC01CB0139 -:1081A000801B910BA20BB30BB7FD13C0179A8091E4 -:1081B000A50F8E7F8093A50F169A8091A50F8D7FB6 -:1081C0008093A50F159A8091A50F8B7F8093A50FA3 -:1081D000149A8091691390916A13679902C001966D -:1081E00004C0181619062CF4019790936A13809313 -:1081F00069138091691390916A138E3E92400CF13D -:10820000E0E7F2E184919F012F5F3F4F3B832A8398 -:10821000882329F00E948339EA81FB81F3CFE6E7C6 -:10822000FBE284919F012F5F3F4F3B832A8388238A -:1082300029F00E948339EA81FB81F3CF8DE69BE22E -:1082400031DE9091EF098091F009981309C0609197 -:108250000B1480900D148A8290900F14998224C080 -:10826000E091F00981E58E9FF0011124E858FB4F61 -:108270006081E091F0098E9FF0011124E658FB4FD8 -:10828000A080AA82E091F0098E9FF0011124E458A9 -:10829000FB4FB080B9828091F0099091EF09981757 -:1082A00019F08F5F8F70F9CF70E088E00E94D8ECF2 -:1082B000CA806C2D70E086E00E94D8ECD9806D2DCC -:1082C00070E082E00E94D8EC8091BB13882309F40F -:1082D000FAC00091510210915202E0905302EC82D8 -:1082E000F0905402FA826091091470910A146E5F42 -:1082F0007F4F072E000C880B990B0F9412089801E2 -:10830000A7010F940C0887FDDEC0F090F009212C26 -:10831000312CE12C19828091EF098F1509F460C08E -:108320008F2D90E021E5289FF001299FF00D112469 -:10833000EF5CFB4F458956896789708D452B462B2D -:10834000472B81F4418D528D638D748D452B462BC7 -:10835000472B41F4458D568D678D70A1452B462BDB -:10836000472BC9F141E5489F9001499F300D1124E9 -:10837000C9018F5C9B4F6C01FC016181728183811B -:1083800094810F94C30E4B015C01F60161A172A1AF -:1083900083A194A10F9410082B013C01F60165A163 -:1083A00076A187A190A50F9410089B01AC01C30191 -:1083B000B2010F94340DA50194010F9471085B0173 -:1083C0006C0191014E2D59810F947E0E18161CF4EC -:1083D0001501EC2CD98281E08F0D8F70F82E9BCF88 -:1083E0002091490230914A0240914B0250914C0237 -:1083F000B1018E2D99810F94710898014C815A8199 -:108400000F94580C6B017C019B01AC01B8018C816D -:108410009A810F947E0E1816ACF000914D021091C7 -:108420004E0280904F028C82909050029A82980166 -:10843000A401B601C7010F947E0E18161CF0860128 -:10844000EC82FA82C0906513D0906613E0906713B7 -:10845000F090681398014C815A81C701B6010F94BE -:108460007E0E1816D4F420E037ED43EA5CE3B80141 -:108470008C819A810F9471084B015C0128E431EEE4 -:108480004AE75FE3C701B6010F947108A5019401A3 -:108490000F94580C8B018C839A83C801AC81BA81EC -:1084A0008093651390936613A0936713B09368133A -:1084B000B801CD010F949C0D70930A1460930914B8 -:1084C00080E00E9432760E94DE7985E89AE00E9480 -:1084D000EE32A0903813A982AA2009F443C00E946A -:1084E000D7ED00913413109135132091361330914C -:1084F0003713DC01CB01801B910BA20BB30BB7FD33 -:1085000031C00E94D7ED6B017C012A2D30E0A8EE2E -:10851000B3E00F94480CC60ED71EE81EF91EC09299 -:108520003413D0923513E0923613F09237130E9431 -:108530002C758AE00F900F900F900F90DF91CF91E4 -:108540001F910F91FF90EF90DF90CF90BF90AF9071 -:108550009F908F907F906F905F904F903F902F9063 -:108560000C9483390F900F900F900F90DF91CF9163 -:108570001F910F91FF90EF90DF90CF90BF90AF9041 -:108580009F908F907F906F905F904F903F902F9033 -:1085900008952F923F924F925F926F927F928F92A7 -:1085A0009F92AF92BF92CF92DF92EF92FF920F9382 -:1085B0001F93CF93DF93CDB7DEB7CC54D1090FB65D -:1085C000F894DEBF0FBECDBF80912802882319F03A -:1085D00085E493E140DB8091070483FDA9C0C0904E -:1085E0005113D0905213E0905313F09054132091F4 -:1085F000C20F3091C30F4091C40F5091C50FC701F6 -:10860000B6010F940C08882309F492C080910604E7 -:10861000811133C06091D7127091D8128091D91214 -:108620009091DA120F949C0D20910002309101027A -:108630006217730714F5C092C20FD092C30FE09275 -:10864000C40FF092C50FEFE9F2E184917F019FEF33 -:10865000E91AF90A882321F00E948339F701F5CF3E -:10866000E1E1FBE284917F01AFEFEA1AFA0A882385 -:1086700021F00E948339F701F5CF8090511390903B -:108680005213A0905313B09054132091C20F309105 -:10869000C30F4091C40F5091C50FC501B4010F9491 -:1086A000570C6B017C0120E030E0A9010F947E0E95 -:1086B00087FF04C0F7FAF094F7F8F094E0911114F2 -:1086C000B4E0EB9FF0011124EC5EFD4F208131817D -:1086D00042815381C701B6010F94710820E030E058 -:1086E00048E453E40F947E0E181614F58092C20FDE -:1086F0009092C30FA092C40FB092C50FEFE9F2E1C0 -:1087000084917F019FEFE91AF90A882321F00E94E2 -:108710008339F701F5CFE2EFFAE284917F01AFEF01 -:10872000EA1AFA0A882321F00E948339F701F5CF6B -:108730008091640F60901A0270901B02C0904513E4 -:10874000D0904613E0904713F0904813809049135F -:1087500090904A13A0904B13B0904C13882309F4C7 -:1087600082C22090D3123090D4124090D5125090F3 -:10877000D61220E030E0A901C201B1010F940C082B -:10878000882379F020914D1330914E1340914F136F -:1087900050915013C201B1010F947E0E18160CF0C7 -:1087A00062C2B301770C880B990B0F9412082091C9 -:1087B0003F023091400240914102509142020F9499 -:1087C00071082AE037ED43E25CE30F9471086DA76E -:1087D0007EA78FA798AB2091B60F3091B70F40912D -:1087E000B80F5091B90FC701B6010F94570C2B0168 -:1087F0003C012091BA0F3091BB0F4091BC0F5091BA -:10880000BD0FC501B4010F94570C25966CAF7DAF19 -:108810008EAF9FAF259720E030E0A901C301B201E0 -:108820000F940C08811141C020E030E0A901259689 -:108830006CAD7DAD8EAD9FAD25970F940C08811169 -:1088400034C07090111419AA1AAA1BAA1CAAC982B2 -:10885000DA82EB82FC828D829E82AF82B886809122 -:108860004D1390914E13A0914F13B09150138987DF -:108870009A87AB87BC87AE01475F5F4FBE016B5FD6 -:108880007F4FCE0101960E94E487FE01F1966F01B1 -:10889000E72C8E01035D1F4F21E533E1AE01475FF9 -:1088A0005F4FBE016B5F7F4F2BC22091BE0F309197 -:1088B000BF0F4091C00F5091C10F60914D13709147 -:1088C0004E1380914F13909150130F94570C29968B -:1088D0006CAF7DAF8EAF9FAF29972091C20F3091C3 -:1088E000C30F4091C40F5091C50F60915113709107 -:1088F000521380915313909154130F94570C219657 -:108900006CAF7DAF8EAF9FAF2197A3019201C301E2 -:10891000B2010F9471086B017C0125962CAD3DAD21 -:108920004EAD5FAD2597CA01B9010F9471089B0147 -:10893000AC01C701B6010F94580C6B017C0129965C -:108940002CAD3DAD4EAD5FAD2997CA01B9010F9475 -:1089500071089B01AC01C701B6010F94580C0F942C -:10896000C30E6B017C012DEB37E346E855E30F9412 -:108970000C0887FF17C020E030E0A90121966CADFC -:108980007DAD8EAD9FAD21970F947E0E2196CCAC20 -:10899000DDACEEACFFAC219787FF04C0F7FAF09492 -:1089A000F7F8F0942DEB37E346E855E3C701B6013D -:1089B0000F940C0887FDA8C120E030E040EA50E4A5 -:1089C000C701B6010F94340D0F94A10D1B01672B45 -:1089D00019F422242394312CB10180E090E00F940B -:1089E00010089B01AC0160E070E080E89FE30F9409 -:1089F000340D4B015C019B01AC01C701B6010F9422 -:108A000071082D966CAF7DAF8EAF9FAF2D97A501EE -:108A10009401C301B2010F947108698B7A8B8B8B1F -:108A20009C8BA501940125966CAD7DAD8EAD9FAD5F -:108A300025970F9471086D8B7E8B8F8B988FA50176 -:108A4000940129966CAD7DAD8EAD9FAD29970F94A5 -:108A50007108698F7A8F8B8F9C8FA5019401219665 -:108A60006CAD7DAD8EAD9FAD21970F9471086D8F6C -:108A70007E8F8F8F98A380E1E6EBFFE0DE011196F9 -:108A800001900D928A95E1F799249394F1E02F1AC1 -:108A9000310809F04BC0E09011142D968CAD9DADBE -:108AA000AEADBFAD2D9789AF9AAFABAFBCAF8091E4 -:108AB000451390914613A0914713B091481389A391 -:108AC0009AA3ABA3BCA38091491390914A13A091A0 -:108AD0004B13B0914C138DA39EA3AFA3B8A7809165 -:108AE0004D1390914E13A0914F13B091501389A73D -:108AF0009AA7ABA7BCA7AE01475D5F4FBE016B5DF8 -:108B00007F4FCE0181960E94E487DE01D9966D01E8 -:108B10008E01035D1F4F21E533E1AE01475D5F4FDD -:108B2000BE016B5D7F4FCE018196ECC080915913E1 -:108B3000811112C00E94D7EDDC01CB0188539F4FF9 -:108B4000AF4FBF4F8093551390935613A093571375 -:108B5000B0935813909259130E94DE790E94D7ED7A -:108B6000C0905513D0905613E0905713F0905813BF -:108B7000DC01CB018C199D09AE09BF09B7FD11C0FD -:108B80000E94D7EDDC01CB0188539F4FAF4FBF4F01 -:108B90008093551390935613A0935713B093581383 -:108BA000E1D96E01B1E1CB0ED11CFE0131967F01FE -:108BB0005601D6012D913D914D915D916D01F701C9 -:108BC00060817181828193810F94580CD7016D93DC -:108BD0007D938D939D937D01AA16BB0651F7E0907E -:108BE00011142D968CAD9DADAEADBFAD2D978DAB57 -:108BF0009EABAFABB8AF89819A81AB81BC8189A3B1 -:108C00009AA3ABA3BCA38D819E81AF81B8858DA3B0 -:108C10009EA3AFA3B8A789859A85AB85BC8589A794 -:108C20009AA7ABA7BCA7AE01475D5F4FBE016B5DC6 -:108C30007F4FCE0181960E94E487DE01D5966D01BB -:108C40008E01035D1F4F9E01235F3F4FAE01475DC5 -:108C50005F4FBE016B5D7F4FCE0181960E94563FF4 -:108C6000811114CF18CFB301770C880B990B0F9497 -:108C7000120820913F0230914002409141025091F0 -:108C800042020F9471082AE037ED43E25CE30F944F -:108C9000710869AB7AAB8BAB9CAB7090111480916F -:108CA0004D1390914E13A0914F13B0915013C98260 -:108CB000DA82EB82FC82898A9A8AAB8ABC8A89A38F -:108CC0009AA3ABA3BCA31DA61EA61FA618AAAE01FD -:108CD0004F5D5F4FBE016F5E7F4FCE0101960E94D8 -:108CE000E487FE01BD966F01E72C8E010F5C1F4FDC -:108CF00021E533E1AE014F5D5F4FBE016F5E7F4FF7 -:108D0000CE0101960E94563F80E1E5E4F3E1A6EB37 -:108D1000BFE001900D928A95E1F7C45BDF4F0FB67B -:108D2000F894DEBF0FBECDBFDF91CF911F910F91A1 -:108D3000FF90EF90DF90CF90BF90AF909F908F907B -:108D40007F906F905F904F903F902F900895CF93BA -:108D5000DF9380E00E94164ECFE1D3E168837983F0 -:108D60008A839B8381E00E94164E6C837D838E8371 -:108D70009F8382E00E94164E688779878A879B8747 -:108D8000DF91CF9108952F923F924F925F926F9211 -:108D90007F928F929F92AF92BF92CF92DF92EF928B -:108DA000FF920F931F93CF93DF9300D01F92CDB705 -:108DB000DEB70E94A9EA10911214F12CEE24E3947C -:108DC000812C912C540183949DED492E93E0592ED2 -:108DD000612C712C2BED222E2FE9322E33E0D32E75 -:108DE000111123C080911514882331F08091430222 -:108DF000882309F42CC10DC08091380D8823B1F36C -:108E00001092380D0E94D69780911414882371F324 -:108E1000ADC281E090911514911180E024E04BEDFA -:108E20005CE26F2D0E947D6F12C1113009F076C097 -:108E300080911514813031F080914302882309F428 -:108E400006C15CC08091380D8823B1F31092380DB3 -:108E500010931B141092320D1092330D1092340D9A -:108E60001092350D0E947997D092430285ED9CE2D5 -:108E70009093031480930214A3E8B3E1B093011418 -:108E8000A09300141092FC131092FD131092FE1385 -:108E90001092FF138EED93E0A0E0B0E08093F81302 -:108EA0009093F913A093FA13B093FB132AE037EDD4 -:108EB00043E25CE360918313709184138091851386 -:108EC000909186130F9471080F94A10D609317145D -:108ED000709318148093191490931A1430925602B8 -:108EE0002092550210920614109205141092041448 -:108EF00080911414882309F49FCF38C2CC24C394E2 -:108F000080911514813009F0C12C83E893E10E940F -:108F1000A56C00E09C014FEC5CE295C0123009F0BA -:108F200078C080911514823031F0809143028823FB -:108F300009F48DC05EC08091380D8823B1F3109282 -:108F4000380DE0921B141092320D1092330D1092D6 -:108F5000340D1092350D0E947997D0924302A5EC02 -:108F6000BCE2B0930314A09302148FE793E19093B3 -:108F70000114809300148092FC139092FD13A09230 -:108F8000FE13B092FF134092F8135092F9136092BF -:108F9000FA137092FB132AE037ED43E25CE3609131 -:108FA0007F137091801380918113909182130F949D -:108FB000710820E030E040E85FE30F94570C0F9415 -:108FC000A10D609317147093181480931914909343 -:108FD0001A143092560220925502109206141092E2 -:108FE00005141092041480911414882309F49DCF61 -:108FF000BDC1CC24C39480911514823009F0C12CDA -:109000008FE793E10E94A56C00E09C014BEB5CE2D2 -:109010001AC0133009F082C080911514833001F119 -:1090200080914302882399F0CC24C3948091151435 -:10903000833009F0C12C8BE793E10E94A56C00E01E -:109040009C0149EA5CE26F2D8C2D0E947B9EF3947B -:109050001F5F95E0F912C4CE88E08093131486C197 -:109060008091380D8823E1F21092380DE0921B14A4 -:109070001092320D1092330D1092340D1092350D66 -:109080000E94799710934302A2EBBCE2B0930314C1 -:10909000A09302148BE793E1909301148093001442 -:1090A0008092FC139092FD13A092FE13B092FF13D6 -:1090B0004092F8135092F9136092FA137092FB13D6 -:1090C0002AE037ED43E25CE360917B1370917C13FF -:1090D00080917D1390917E130F94710820E030E011 -:1090E00040E85FE30F94570C0F94A10D60931714A1 -:1090F000709318148093191490931A143092560296 -:109100002092550210920614109205141092041425 -:1091100080911414882309F483CF28C1143009F0F6 -:1091200047C080911514843031F080914302882328 -:1091300009F48DCF1FC08091380D8823B1F31092B0 -:10914000380DE0921B141092320D1092330D1092D4 -:10915000340D1092350D24E630E040E050E06BE62F -:1091600073E182EA9CE20F9418038091141488231F -:10917000E1F2FCC0CC24C39480911514843009F032 -:10918000C12C60916B1370916C1380916D13909151 -:109190006E130F94100869837A838B839C83CE01AE -:1091A00001960E94A56C00E09C014BE95CE24BCF6C -:1091B000153009F047C080911514853031F0809149 -:1091C0004302882309F443CF1FC08091380D8823C0 -:1091D000B1F31092380DE0921B141092320D1092E0 -:1091E000330D1092340D1092350D24E630E040E03E -:1091F00050E06FE673E184E99CE20F9418038091DC -:1092000014148823E1F2B2C0CC24C39480911514C5 -:10921000853009F0C12C60916F13709170138091AB -:109220007113909172130F94100869837A838B8362 -:109230009C83CE0101960E94A56C00E09C014DE844 -:109240005CE201CF163009F047C0809115148630DA -:1092500031F080914302882309F4F9CE1FC0809138 -:10926000380D8823B1F31092380DE0921B14109240 -:10927000320D1092330D1092340D1092350D2AE0FC -:1092800030E040E050E063E773E186E89CE20F9451 -:109290001803809114148823E1F268C0CC24C3948D -:1092A00080911514863009F0C12C60917313709170 -:1092B000741380917513909176130F94100869833D -:1092C0007A838B839C83CE0101960E94A56C00E07B -:1092D0009C014FE75CE2B7CE173009F0B8CE809121 -:1092E0001514873031F080914302882309F4AFCE02 -:1092F0001FC08091380D8823B1F31092380DE09291 -:109300001B141092320D1092330D1092340D1092E6 -:10931000350D24E630E040E050E067E773E188E790 -:109320009CE20F941803809114148823E1F21EC06C -:10933000CC24C39480911514873009F0C12C60911E -:109340007713709178138091791390917A130F9419 -:10935000100869837A838B839C83CE0101960E94D7 -:10936000A56C00E09C0141E75CE26DCE0F900F9090 -:109370000F900F90DF91CF911F910F91FF90EF9081 -:10938000DF90CF90BF90AF909F908F907F906F9025 -:109390005F904F903F902F9008959F92AF92BF9211 -:1093A000CF92DF92EF92FF920F931F93CF93DF93B1 -:1093B0000E94A9EAD0911214C0E0992493944FE935 -:1093C000C42E40EAD42E59E9A52E55EDB52ED11163 -:1093D00023C080911514882331F0809143028823A3 -:1093E00009F4CBC00DC08091380D8823B1F31092E1 -:1093F000380D0E94D69780911414882371F33DC1D3 -:1094000081E090911514911180E024E041E95DE242 -:109410006C2F0E947D6FB1C0D13009F047C08091A0 -:109420001514813031F080914302882309F4A5C0DE -:109430002EC08091380D8823B1F31092380DD0934F -:109440001B141092320D1092330D1092340D1092A5 -:10945000350DE12C1CE3F12E0CE116E420E030E0A8 -:1094600040EA50E467E973E187E89DE20F94220245 -:10947000D0925602C0925502B0920614A0920514E2 -:109480001092041480911414882369F2F6C011E03C -:1094900080911514813009F010E087E993E10E9472 -:1094A000436B00E09C014DE75DE263C0D23009F000 -:1094B00047C080911514823031F080914302882397 -:1094C00009F45BC02EC08091380D8823B1F310924F -:1094D000380D90921B141092320D1092330D109291 -:1094E000340D1092350DE12C1CE3F12E0CE116E445 -:1094F00020E030E040EA50E46BE973E183E79DE26D -:109500000F942202D0925602C0925502B0920614D5 -:10951000A09205141092041480911414882369F207 -:10952000ACC011E080911514823009F010E08BE995 -:1095300093E10E94436B00E09C0149E65DE219C0A3 -:10954000D33009F051C0809115148330F1F080912F -:109550004302882391F011E080911514833009F0C3 -:1095600010E08FE993E10E94436B00E09C0145E528 -:109570005DE26C2F812F0E947B9ECF5FDF5FC53045 -:1095800009F025CFC093131478C08091380D88233B -:10959000F1F21092380D90921B141092320D10922D -:1095A000330D1092340D1092350DE12C1CE3F12E89 -:1095B0000CE116E420E030E040EA50E46FE973E1AA -:1095C0008FE59DE20F942202D0925602C09255027E -:1095D000B0920614A09205141092041480911414F1 -:1095E000882309F4B4CF49C0D43039F680911514DA -:1095F000843031F080914302882309F4BECF2EC01D -:109600008091380D8823B1F31092380D90921B147D -:109610001092320D1092330D1092340D1092350DC0 -:10962000E12C1CE3F12E0CE116E420E030E040EAEE -:1096300050E463EA73E18BE49DE20F942202D0923E -:109640005602C0925502B0920614A09205141092D0 -:10965000041480911414882369F20FC011E08091E2 -:109660001514843009F010E083EA93E10E94436B03 -:1096700000E09C0141E45DE27CCFDF91CF911F913E -:109680000F91FF90EF90DF90CF90BF90AF909F90A1 -:109690000895CF92DF92EF92FF920F931F93CF9393 -:1096A000DF930E94A9EAD0911214C0E09BEEC92E6C -:1096B00092EAD92ED11120C080911514882331F05F -:1096C00080914302882309F494C00DC08091380D25 -:1096D0008823B1F31092380D0E94D697809114140C -:1096E000882371F3E7C081E090911514911180E017 -:1096F00024E04AED5DE27AC0D13009F040C08091AB -:109700001514813031F080914302882309F471C02F -:1097100023C08091380D8823B1F31092380DE12CCD -:10972000F12C00EA11E420E030E040EA51EC62EB79 -:109730007FE08BEC9DE20F942202D0925602C09201 -:109740005502109206141092051410920414809180 -:1097500014148823C1F2AEC011E080911514813039 -:1097600009F010E082EB9FE00E94D56D00E09C01C3 -:109770004CEB5DE26C2F812F0E947B9E3AC0D23071 -:1097800011F580911514823029F0809143028823CD -:1097900081F10FC08091380D8823B9F31092380DF4 -:1097A00084E097ED0E9432A680911414882369F317 -:1097B00081C081E090911514923009F080E023E09F -:1097C00043EB5DE213C0D33061F580911514833013 -:1097D000C9F080914302882361F081E090911514D3 -:1097E000933009F080E023E046EA5DE26C2F0E94AE -:1097F0007D6FCF5FDF5FC53009F05CCF86E080937F -:10980000131458C08091380D882319F31092380D25 -:1098100083EC96EC0E9432A6809114148823C9F23E -:1098200049C0D43011F580911514843029F080910D -:1098300043028823F1F20FC08091380D8823B9F3D9 -:109840001092380D83E69CEC0E9432A6809114148D -:10985000882369F32FC081E090911514943009F0AA -:1098600080E023E041EA5DE2C1CFD53011F680917E -:109870001514853031F080914302882309F4B9CF63 -:109880000FC08091380D8823B1F31092380D8DEC04 -:1098900099EC0E9432A680911414882361F30AC0C7 -:1098A00081E090911514953009F080E023E048E9BB -:1098B0005DE29CCFDF91CF911F910F91FF90EF90D0 -:1098C000DF90CF9008953F924F925F926F927F9278 -:1098D0008F929F92AF92BF92CF92DF92EF92FF92C0 -:1098E0000F931F93CF93DF930E94A9EAD091121494 -:1098F000C0E05524539443E0442E5EED352E62E1E2 -:10990000A62E6DE2B62E72E2872E7DE2972EEAE257 -:109910006E2EEDE27E2ED11123C080911514882386 -:1099200031F080914302882309F4CBC00DC08091AF -:10993000380D8823B1F31092380D0E94D69780918C -:109940001414882371F35EC181E090911514911174 -:1099500080E024E04AE35DE26C2F0E947D6FB1C09D -:10996000D13009F04FC080911514813031F08091D1 -:109970004302882309F4A5C026C08091380D8823AE -:10998000B1F31092380DD0931B141092320D109237 -:10999000330D1092340D1092350DC12CD12CE12CC9 -:1099A00010E8F12E07E714E420E030E040E85FE340 -:1099B00067E873E182E39DE20E943DEB809114141D -:1099C0008823A9F21FC14F923F921F925F9287E8AE -:1099D00093E19F938F939F928F927F926F92CF93F9 -:1099E00081E090911514913009F080E08F930E94EE -:1099F000DC9E8DB79EB70C960FB6F8949EBF0FBE37 -:109A00008DBF5FC0D23009F051C0809115148230F3 -:109A100031F080914302882309F453C026C080911D -:109A2000380D8823B1F31092380D50921B14109208 -:109A3000320D1092330D1092340D1092350DC12C51 -:109A4000D12CE12C10E8F12E07E714E420E030E0FF -:109A500040E85FE36BE873E18AE19DE20E943DEB41 -:109A6000809114148823A9F2CDC04F923F921F9287 -:109A70005F928BE893E19F938F938AE09DE29F939F -:109A80008F93BF92AF92CF9381E090911514923053 -:109A900009F080E08F930E94DC9E8DB79EB70C96F4 -:109AA0000FB6F8949EBF0FBE8DBF0BC0D33009F028 -:109AB00053C080911514833061F08091430281116D -:109AC00038C0CF5FDF5FC53009F025CFC0931314D6 -:109AD00099C08091380D882381F31092380D5092EF -:109AE0001B141092320D1092330D1092340D1092FF -:109AF000350DE12C10E8F12E07E714E42DEC3CECD9 -:109B00004CEC5DE36FE873E182E09DE20F9422028A -:109B100083E691EA909356028093550210920614C0 -:109B2000109205141092041480911414882329F2C1 -:109B300069C011E080911514833009F010E08FE8BE -:109B400093E10E94046C00E09C014AEF5CE26C2F00 -:109B5000812F0E947B9EB5CFD43009F0B2CF809187 -:109B60001514843031F080914302882309F4A9CF81 -:109B700026C08091380D8823B1F31092380D509291 -:109B80001B141092320D1092330D1092340D10925E -:109B9000350DC12CD12CE12C10E8F12E07E714E48F -:109BA00020E030E040E85FE363E973E182EF9CE2AC -:109BB0000E943DEB809114148823A9F223C04F9298 -:109BC0003F921F925F9283E993E19F938F9382EE7E -:109BD0009CE29F938F938AEE9CE29F938F93CF9307 -:109BE00081E090911514943009F080E08F930E94E9 -:109BF000DC9E8DB79EB70C960FB6F8949EBF0FBE35 -:109C00008DBF5FCFDF91CF911F910F91FF90EF90AC -:109C1000DF90CF90BF90AF909F908F907F906F908C -:109C20005F904F903F9008950F931F93CF93DF93D2 -:109C3000EB010E94D7ED8B010E94D0BC8F3F49F011 -:109C40000E94D7ED601B710B6C177D07A8F380E0B5 -:109C500001C081E0DF91CF911F910F9108958F9204 -:109C60009F92AF92BF92CF92DF92EF92FF920F93AB -:109C70001F93CF93DF93EC018B81811102C080E0B1 -:109C800078C009891A892B893C890417150726078A -:109C90003707A8F36A017B01823029F4C886D98688 -:109CA000EA86FB860DC0C114D104E104F10451F42D -:109CB000188619861A861B861C821D821E821F82A8 -:109CC00081E057C088849984AA84BB84E98DFA8D89 -:109CD000258530E0275F3F4FB501A4014150510970 -:109CE00061097109022E04C07695679557954795CD -:109CF0000A94D2F7D701C6010197A109B10904C09E -:109D0000B695A795979587952A95D2F784179507C5 -:109D1000A607B70720F089288A288B2871F44D8977 -:109D20005E896F89788D4C835D836E837F834C0160 -:109D30005D018E010C5F1F4F16C0841B950BA60B97 -:109D4000B70BF5CF4C815D816E817F819801898D44 -:109D50009A8D0E94C1B991E0891A9108A108B108B1 -:109D6000882309F48CCF81149104A104B10451F724 -:109D700095CFDF91CF911F910F91FF90EF90DF90E2 -:109D8000CF90BF90AF909F908F9008950F931F93A7 -:109D9000CF93DF93FC012381222311F080E044C0A4 -:109DA0008B01EC01FB018789803139F18032B1F7F9 -:109DB00083E08B83F801428D538D648D758D4D8BBF -:109DC0005E8B6F8B788F9E012F5E3F4FC8010E9484 -:109DD00041BA882319F31A8F098F81E08983188685 -:109DE00019861A861B861C821D821E821F82188A73 -:109DF0001C861D861E861F8617C082E08B831D8AE7 -:109E00001E8A1F8A188EFB01808D918DA0E0B0E024 -:109E100025E0880F991FAA1FBB1F2A95D1F7898BB0 -:109E20009A8BAB8BBC8BD7CFDF91CF911F910F91CA -:109E30000895CF93DF93EC010E940FBB1B82DF914B -:109E4000CF910895CF93DF93EC0141E0611101C000 -:109E500040E06C857D858E859F850E94F8B88823BB -:109E600041F0888920E2829FC00111248853904FDD -:109E700002C080E090E0DF91CF910895CF93DF930F -:109E8000EB01FC012381211102C080E027C0225098 -:109E9000223020F48FE2888319821FC060E0D2DF75 -:109EA000009799F3FC0190E080E02EE2308130329F -:109EB00069F0883029F4DE01A90FB11D2C939F5F52 -:109EC000DE01A90FB11D30813C939F5F8F5F3196FA -:109ED0008B3061F7C90FD11D188281E0DF91CF91DE -:109EE00008953F924F925F926F927F928F929F92CE -:109EF000AF92BF92CF92DF92EF92FF920F931F9398 -:109F0000CF93DF93CDB7DEB72C970FB6F894DEBFB3 -:109F10000FBECDBF5C01DC0159968D909C905A9785 -:109F2000F40181859285A385B4859C01AD012F5FE5 -:109F30003F4F4F4F5F4F29873A874B875C87D5014B -:109F40001496CD90DD90ED90FC901797C114D1043C -:109F5000E104F10439F0BFEFCB1ADB0AEB0AFB0A8C -:109F6000312C07C0F401C080D180E280F38033241B -:109F70003394260137011D821E821F821886F40148 -:109F800081859285A385B4852D813E814F81588539 -:109F9000281739074A075B0708F064C089859A8546 -:109FA000AB85BC858C159D05AE05BF0550F482E0E0 -:109FB000C82ED12CE12CF12C92E0492E512C612C91 -:109FC000712C9E012F5F3F4FB701A601C4010E9473 -:109FD000C1B9882309F446C089819A81AB81BC81CB -:109FE000892B8A2B8B2B41F0260137019FEF491AD1 -:109FF000590A690A790A05C0C414D504E604F704AD -:10A0000091F02D813E814F8158852F5F3F4F4F4FFB -:10A010005F4F2D833E834F8358873FEFC31AD30A88 -:10A02000E30AF30AACCF0FEF1FEF2FEF3FE0B301CE -:10A03000A201C4010E9430B9F82E882399F0D501FD -:10A0400014964D915D916D917C9117974115510535 -:10A050006105710549F093018201C4010E9430B984 -:10A06000811102C0F12C29C0D50114964D925D9248 -:10A070006D927C921797332051F0D301C201019663 -:10A08000A11DB11DF40180839183A283B383F501E7 -:10A0900085899689A789B08D892B8A2B8B2B69F4AA -:10A0A000D50155964D925D926D927C92589711967E -:10A0B0008C911197806811968C938F2D2C960FB6EA -:10A0C000F894DEBF0FBECDBFDF91CF911F910F91EE -:10A0D000FF90EF90DF90CF90BF90AF909F908F90C8 -:10A0E0007F906F905F904F903F90089540E050E0D8 -:10A0F000BA01B5CD61E0FC0180810C946EEC8EBD9F -:10A100000DB407FEFDCF08958F929F92AF92BF923C -:10A11000EF92FF921F93CF93DF93EC01162F49012B -:10A120005A019A81892F806A86958CBD90FD03C063 -:10A1300081E0963009F480E08DBD60E088810E9466 -:10A140006EEC6CE271E0CE016FDD812F8064D7DFB1 -:10A1500088E1E82EF12CD501C4010E2C04C0B6957F -:10A16000A795979587950A94D2F7C9DF88E0E81AF2 -:10A17000F10888EFE8168FEFF80669F71123A1F0D0 -:10A18000183011F487E801C08FEFB9DF1C3011F4EB -:10A190000E94D0BC10E00E94D0BC8B8387FF07C018 -:10A1A0001F3F29F01F5FF7CF85E9A9DFF3CFDF91CC -:10A1B000CF911F91FF90EF90BF90AF909F908F90A5 -:10A1C00008950F931F93CF93DF93EC0189018C8146 -:10A1D000833039F089E0440F551F661F771F8A9539 -:10A1E000D1F79A01AB0168E1CE018EDF882311F02F -:10A1F00086E02DC08EEF8EBDF801C8019E5F0DB4C4 -:10A2000007FEFDCF20812EBD0DB407FEFDCF2181BD -:10A210002EBD32968E179F0791F70DB407FEFDCF26 -:10A220008FEF6DDF8FEF6BDF0E94D0BC8B838F7160 -:10A23000853029F083E18983CE015CDF09C068E5C0 -:10A2400072E0CE01F1DC182F811106C087E189830D -:10A25000CE0150DF10E010C020E030E0A9016DE039 -:10A26000CE0152DF811104C00E94D0BC882311F0BE -:10A2700086E1EDCFCE013EDF812FDF91CF911F919F -:10A280000F910895EF92FF920F931F93CF93DF9357 -:10A29000EC0179018C81833039F089E0440F551F3E -:10A2A000661F771F8A95D1F79A01AB0161E1CE0154 -:10A2B0002BDF882329F084E08983CE011BDF38C09F -:10A2C0000E94D7ED8B010E94D0BC8B838F3F49F455 -:10A2D0000E94D7ED601B710B6D327140A0F381E1DC -:10A2E00003C08E3F39F08FE08983CE0103DF8FEF0B -:10A2F00006DF1EC08FEF8EBDF701D701A150BE4F04 -:10A300000DB407FEFDCF9EB591938EBDEA17FB07F6 -:10A31000B9F70DB407FEFDCF8EB58C930E94D0BC6B -:10A320000E94D0BCCE01E6DE8FEFE9DE81E001C005 -:10A3300080E0DF91CF911F910F91FF90EF900895F2 -:10A340002F923F924F925F926F927F928F929F9245 -:10A35000AF92BF92CF92DF92EF92FF920F931F9333 -:10A36000CF93DF9300D01F92CDB7DEB79C838B8352 -:10A370004B015A01DC0113968C91811103C08FEFC0 -:10A380009FEFEAC0EB81FC81818180FFF8CFAB8138 -:10A39000BC8151960D911D912D913C915497189629 -:10A3A0004D915D916D917C911B97C501A0E0B0E04E -:10A3B00068017901C41AD50AE60AF70AC816D9064F -:10A3C000EA06FB0618F45801A41AB50A75018B8138 -:10A3D0009C8104969A838983612C42E0742EE11457 -:10A3E000F10409F48BC0AB81BC8118964D915D914D -:10A3F0006D917C911B976A01B1E0DB22EB81FC81BE -:10A400002381818D928D1A012B0139E05694479456 -:10A41000379427943A95D1F7223061F4FC01828D6C -:10A42000938DA48DB58DBC01CD01620D731D841D6E -:10A43000951D4AC0DC0114961C9111501221C114C3 -:10A44000D10401F511111EC0452B462B472B59F4A1 -:10A45000EB81FC8185899689A789B08D848395835A -:10A46000A683B7830FC0AB81BC8114964D915D91DB -:10A470006D917C91179729813A810E94C1B98823F7 -:10A4800009F47DCFEB81FC81218D328D8481958112 -:10A49000A681B7810297A109B109F901058404C019 -:10A4A000880F991FAA1FBB1F0A94D2F746855785AC -:10A4B00060897189840F951FA61FB71FBC01CD014C -:10A4C000610F711D811D911D93012C193D0987019B -:10A4D0002E153F0508F489010115F2E01F0771F5FB -:10A4E0002091C8113091C9114091CA115091CB11DE -:10A4F000621773078407950719F420C0C5012CC0A3 -:10A500009401AB01BC018091D1119091D211BADEBE -:10A51000882309F434CF800E911EEB81FC81808565 -:10A520009185A285B385800F911FA11DB11D8087E4 -:10A530009187A287B387E01AF10A51CF40E00E94C9 -:10A54000F8B8882309F41BCFB6016853704FA801EF -:10A55000C4010F94740FDFCF0F900F900F900F90E6 -:10A56000DF91CF911F910F91FF90EF90DF90CF90EF -:10A57000BF90AF909F908F907F906F905F904F9023 -:10A580003F902F9008954F925F926F927F929F928B -:10A59000AF92BF92CF92DF92EF92FF920F931F93F1 -:10A5A000CF93DF931F92CDB7DEB78C017B015A01A9 -:10A5B000C22EDB0159968D919C915A97F801928F8A -:10A5C000818FCB0193DD912CF70180859185A28548 -:10A5D000B385418952896389748984179507A607D1 -:10A5E000B70708F05FC025E0B695A79597958795C2 -:10A5F0002A95D1F7F82FFF70DF2ED70113968C9193 -:10A60000823008F45EC041E050E0BE016F5F7F4FD2 -:10A61000C70196DE019719F4898190E002C08FEF9F -:10A620009FEF019609F44DC0F70180859185A285C1 -:10A63000B3854F96A11DB11D80879187A287B387EF -:10A64000F0E2DF9EB00111246853704F611571056F -:10A65000C1F1DB018C91882319F0853EC1F468C1FA -:10A6600091100EC08091C8119091C911A091CA118A -:10A67000B091CB11F80184879587A687B787D08AD8 -:10A68000DB018C91882361F0992493949DCF4BE05A -:10A6900050E0C5010F94670F892B09F095CF13C0C7 -:10A6A000992493948C2D8274823459F4992009F45E -:10A6B0008AC0F801D08861E0C801C4DB009709F0C6 -:10A6C0000BC180E038C1C7FCFCCFF0E2DF9EA001E7 -:10A6D00011249A012853304FD9011B968C91817116 -:10A6E00021F08C2D827109F06AC08091C81190917F -:10A6F000C911A091CA11B091CB11F8018487958737 -:10A70000A687B787D08ACA018853904F7C01DC01A5 -:10A7100054964D915C91559760E070E0DA0199276D -:10A720008827858B968BA78BB08FF701428D538D31 -:10A7300060E070E0482B592B6A2B7B2BD801559693 -:10A740004D935D936D937C935897F9018385887140 -:10A7500061F4F701848D958DA68DB78DF801818BFD -:10A76000928BA38BB48B81E010C0803141F59801AE -:10A770002F5E3F4FD80159968D919C915A970E9418 -:10A7800041BA8823E1F084E0F80183838C2D8F7037 -:10A79000D80111968C931197F801148215821682B4 -:10A7A000178218961D921D921D921C921B97C4FE33 -:10A7B000B3C0C8010E949F5A8111AEC082CFD80198 -:10A7C00013961C927ECFD70113968C9113978230EB -:10A7D00009F477CF51968D919D910D90BC91A02D4C -:10A7E000803E9F4FAF41B10508F06BCFC70179DBC9 -:10A7F000882309F466CF0E94B8B8882309F461CF92 -:10A80000D70159962D913C915A9714968D919D910F -:10A810000D90BC91A02D0297A109B109F901058401 -:10A8200004C0880F991FAA1FBB1F0A94D2F7468441 -:10A83000578460887188480E591E6A1E7B1E81E00D -:10A840008093D0114092C8115092C9116092CA11E0 -:10A850007092CB1180E092E0E8ECFFE0DF019C0118 -:10A860001D9221503040E1F7DD24D394D701599651 -:10A87000ED91FC915A978481D81690F428EC3FE032 -:10A88000B301A2014D0D511D611D711D8091D111AA -:10A890009091D21196DC882309F413CFD394E6CF9C -:10A8A00080E092E0A0E0B0E0058404C0880F991F2A -:10A8B000AA1FBB1F0A94D2F7F70141895289638905 -:10A8C0007489840F951FA61FB71F818B928BA38B52 -:10A8D000B48B88EC9FE0D12C20E2DC011D922A95FC -:10A8E000E9F72BE0F501DC0101900D922A95E1F7E3 -:10A8F00021E238E2FC01318B208B40E058E05787A1 -:10A900004687338B228B318F208F578B468B0E944B -:10A91000B8B88111DACED5CEC5FE08C0F80141899C -:10A92000528963897489C8019AD905C081E003C03E -:10A930009110AACE97CE0F90DF91CF911F910F91DA -:10A94000FF90EF90DF90CF90BF90AF909F907F905F -:10A950006F905F904F9008952F923F924F925F9229 -:10A960006F927F928F929F92AF92BF92CF92DF921F -:10A97000EF92FF920F931F93CF93DF93CDB7DEB784 -:10A98000C254D1090FB6F894DEBF0FBECDBF4C0143 -:10A990005B016A01322E19821C821C8E1F8E61158A -:10A9A000710511F410E0A2C0FC0183818111FACF7E -:10A9B000FA0180818F3209F097C0F50183818250BE -:10A9C000823010F485010BC0F501618D728DCE01CE -:10A9D0004C96DCD9882331F38E01045E1F4FC601EB -:10A9E0006C010196F60120812F32D1F3CE01019640 -:10A9F0007C013C012E019CE1490E511C2396EFAED7 -:10AA000023972F2C9BE09150E7E3F0E0EC0FFD1F24 -:10AA1000E90FF11D80E280839111F5CF960147E0A7 -:10AA2000D9018D91882369F18F3259F18E3239F431 -:10AA30004A3009F4B7CF98E04AE09D01F1CFE2EE49 -:10AA4000FDE22491222321F031968213FACFAACF7E -:10AA5000491708F4A7CF813208F4A4CF8F3709F43F -:10AA6000A1CF21E0290FE7E3F0E0EC0FFD1FE90F94 -:10AA7000F11D9FE9980F9A3108F480528083922F3C -:10AA8000DCCF8FA9803209F48DCF6901F901808173 -:10AA90002F5F3F4F8F32C9F38823E9F021E0AE01E9 -:10AAA000495C5F4FB801C7016EDD882309F47ACF96 -:10AAB0000A151B0511F0C801BCD96E147F0441F0C2 -:10AAC00023969FAD2397822D8701E92EF82E9ACFEA -:10AAD000942D852DF9CF232DAE01495C5F4FB80130 -:10AAE000C40151DD182F02C08B0180CFCE014C96DE -:10AAF0000E947339CE0101960E947339812FCE5B7B -:10AB0000DF4F0FB6F894DEBF0FBECDBFDF91CF9100 -:10AB10001F910F91FF90EF90DF90CF90BF90AF907B -:10AB20009F908F907F906F905F904F903F902F906D -:10AB300008950C94DE580C9483582F923F924F92B4 -:10AB40005F926F927F928F929F92AF92BF92CF92BD -:10AB5000DF92EF92FF920F931F93CF93DF93C82F53 -:10AB60000E94A9EA40901214512CD0E0CC0FDD1FB6 -:10AB7000CE0184549C4E7C0197E2292E9FE2392E0F -:10AB8000CE0180549C4E6C012AE3622E2FE2722E7D -:10AB9000CC53DC4E38E4A32E3FE2B32E42E5842EA4 -:10ABA0004FE2942E411020C080911514882331F07B -:10ABB00080914302882309F4B8C00DC08091380DFC -:10ABC0008823B1F31092380D0E94D6978091141407 -:10ABD000882371F302C181E090911514911180E0F6 -:10ABE00024E046E65FE29EC091E049123EC08091BB -:10ABF0001514813031F080914302882309F495C007 -:10AC000016C08091380D8823B1F31092380D00E002 -:10AC100010E02FEF30E040E050E0BE018CE59FE215 -:10AC20000F94B70280911414882329F3D6C01F9281 -:10AC30008FEF8F931F921F92DF93CF93BF92AF92AC -:10AC40009F928F925F9281E090911514913009F05C -:10AC500080E08F930F940B028DB79EB70C960FB6C2 -:10AC6000F8949EBF0FBE8DBF60C092E0491242C0F3 -:10AC700080911514823031F080914302882309F4C9 -:10AC800054C016C08091380D8823B1F31092380D4E -:10AC900000E010E024E031E045E050E0B60181E45E -:10ACA0009FE20F94B70280911414882329F395C072 -:10ACB00021E02F9384E08F931F9285E08F93DF92A2 -:10ACC000CF9283E39FE29F938F937F926F925F92E5 -:10ACD00081E090911514923009F080E08F930F94E9 -:10ACE0000B028DB79EB70C960FB6F8949EBF0FBEA1 -:10ACF0008DBF1BC023E0421601F184E0481215C04D -:10AD000080911514843009F458C08091430288233F -:10AD100061F081E090911514943009F080E020E218 -:10AD200048E15FE2652D0E947D6F5394439495E066 -:10AD3000591238CF5092131450C08091151483309B -:10AD400029F080914302882381F316C08091380D49 -:10AD50008823B9F31092380D00E010E027E830E0C6 -:10AD600045E050E0B7018FE29FE20F94B702809177 -:10AD70001414882331F331C01F9297E89F931F92D8 -:10AD800085E08F93FF92EF923F922F928BE29FE2AA -:10AD90009F938F935F9281E090911514933009F007 -:10ADA00080E08F930F940B028DB79EB70C960FB671 -:10ADB000F8949EBF0FBE8DBFB8CF8091380D882309 -:10ADC00009F4A3CF1092380D0E949AB30E94E8F3C1 -:10ADD00080911414882309F498CFDF91CF911F91AB -:10ADE0000F91FF90EF90DF90CF90BF90AF909F902A -:10ADF0008F907F906F905F904F903F902F9008952D -:10AE000081E09BCE80E099CE2F923F925F926F922D -:10AE10007F928F929F92AF92BF92CF92DF92EF92EA -:10AE2000FF920F931F93CF93DF930E94A9EAC091E3 -:10AE30001214512CD1E062E7262E6FE2362E70ED0F -:10AE4000A72E7FE2B72EEEED8E2EEFE29E2EF5EED0 -:10AE50006F2EFFE27F2EC11123C08091151488232D -:10AE600031F080914302882309F4CFC00DC0809156 -:10AE7000380D8823B1F31092380D0E94D697809137 -:10AE80001414882371F319C281E090911514911163 -:10AE900080E024E043EF5FE2652D0E947D6FB5C046 -:10AEA000C13009F051C080911514813031F080918A -:10AEB0004302882309F4A9C026C08091380D882355 -:10AEC000B1F31092380DC0931B141092320D1092F2 -:10AED000330D1092340D1092350DC12CD12CE12C74 -:10AEE00010ECF12E09E714E420E030E040E85FE3E5 -:10AEF00060ED73E18CEE9FE20E943DEB80911414B3 -:10AF00008823A9F2DAC183E08F9387EE8F931F9293 -:10AF1000DF9380ED93E19F938F939F928F927F9227 -:10AF20006F925F9281E090911514913009F080E06A -:10AF30008F930E94DC9E8DB79EB70C960FB6F89447 -:10AF40009EBF0FBE8DBF61C0C23009F053C080915B -:10AF50001514823031F080914302882309F455C0E2 -:10AF600026C08091380D8823B1F31092380DD0930C -:10AF70001B141092320D1092330D1092340D10925A -:10AF8000350DC12CD12CE12C10ECF12E09E714E485 -:10AF900020E030E040E85FE364ED73E187ED9FE29D -:10AFA0000E943DEB809114148823A9F286C183E0AE -:10AFB0008F9387EE8F931F92DF9384ED93E19F939E -:10AFC0008F9389EC9FE29F938F93BF92AF925F9292 -:10AFD00081E090911514923009F080E08F930E94E7 -:10AFE000DC9E8DB79EB70C960FB6F8949EBF0FBE31 -:10AFF0008DBF0BC0C33009F05CC080911514833045 -:10B0000069F08091430281112FC05394CF5F95E086 -:10B01000591221CF87E0809313144FC18091380DCE -:10B02000882379F31092380DD0931B141092320DAF -:10B030001092330D1092340D1092350DC12CD12C7D -:10B04000E12C10ECF12E09E714E420E030E040E8B8 -:10B050005FE368ED73E182EC9FE20E943DEB80913B -:10B060001414882371F229C183E08F9387EE8F93A4 -:10B070001F92DF9388ED93E19F938F9384EB9FE280 -:10B080009F938F938BEB9FE29F938F935F9281E0CF -:10B0900090911514933009F080E08F930E94DC9E0C -:10B0A0008DB79EB70C960FB6F8949EBF0FBE8DBF9E -:10B0B000ACCFC43009F055C080911514843031F004 -:10B0C00080914302882309F4A0CF26C08091380DD7 -:10B0D0008823B1F31092380DD0931B141092320DC7 -:10B0E0001092330D1092340D1092350DC12CD12CCD -:10B0F000E12C10ECF12E09E714E420E030E040E808 -:10B100005FE36CED73E18DEA9FE20E943DEB80917D -:10B1100014148823A9F2D1C083E08F9387EE8F9314 -:10B120001F92DF938CED93E19F938F938FE99FE2C2 -:10B130009F938F9386EA9FE29F938F935F9281E024 -:10B1400090911514943009F080E08F930E94DC9E5A -:10B150008DB79EB70C960FB6F8949EBF0FBE8DBFED -:10B1600054CFC53009F054C080911514853031F0AA -:10B1700080914302882309F448CF25C08091380D7F -:10B180008823B1F31092380DD0931B141092320D16 -:10B190001092330D1092340D1092350DC12CD12C1C -:10B1A000E12C10ECF12E09E714E420E030E0A901D5 -:10B1B0006CEC73E18AE99FE20E943DEB80911414EC -:10B1C0008823B1F27AC083E08F9387EE8F931F922A -:10B1D0001F928CEC93E19F938F9380E99FE29F9362 -:10B1E0008F9385E99FE29F938F935F9281E0909187 -:10B1F0001514953009F080E08F930E94DC9E8DB786 -:10B200009EB70C960FB6F8949EBF0FBE8DBFFDCEB5 -:10B21000C63009F0FACE80911514863031F0809155 -:10B220004302882309F4F1CE25C08091380D88238C -:10B23000B1F31092380DD0931B141092320D10926E -:10B24000330D1092340D1092350DC12CD12CE12C00 -:10B2500010ECF12E09E714E420E030E0A90168ECDD -:10B2600073E186E89FE20E943DEB809114148823ED -:10B27000B1F223C083E08F9387EE8F931F921F92CA -:10B2800088EC93E19F938F933F922F928CE79FE2FC -:10B290009F938F935F9281E090911514963009F0FF -:10B2A00080E08F930E94DC9E8DB79EB70C960FB600 -:10B2B000F8949EBF0FBE8DBFA8CEDF91CF911F9196 -:10B2C0000F91FF90EF90DF90CF90BF90AF909F9045 -:10B2D0008F907F906F905F903F902F9008953F9256 -:10B2E0004F925F926F927F928F929F92AF92BF9296 -:10B2F000CF92DF92EF92FF920F931F93CF930E9412 -:10B30000A9EAC0911214312C63E6A62E61EAB62E8A -:10B3100074E6472E7EE2572EEFE88E2EEEE29E2E4A -:10B32000F7EA6F2EFEE27F2EC11123C08091151423 -:10B33000882331F080914302882309F4D4C00DC0E2 -:10B340008091380D8823B1F31092380D0E94D69762 -:10B3500080911414882371F338C481E090911514FE -:10B36000911180E024E040E15FE2632D0E947D6F57 -:10B37000BAC0C13009F054C080911514813031F049 -:10B3800080914302882309F4AEC021C08091380D1A -:10B390008823B1F31092380DC0931B141092320D14 -:10B3A0001092330D1092340D1092350D0CE312E80B -:10B3B00024E031E040E050E069E074E189E09FE2A0 -:10B3C0000F94B702809114148823D1F2FEC38CE34A -:10B3D00092E89F938F9381E08F9384E08F931F92E5 -:10B3E0001F9289E094E19F938F938BEF9EE29F934E -:10B3F0008F9382E09FE29F938F933F9281E09091A1 -:10B400001514913009F080E08F930F940B028DB7E3 -:10B410009EB70E960FB6F8949EBF0FBE8DBF63C049 -:10B42000C23009F054C080911514823031F08091FF -:10B430004302882309F457C022C08091380D882325 -:10B44000B1F31092380D81E080931B141092320DED -:10B450001092330D1092340D1092350D0FE312E857 -:10B4600027E830E040E050E067E074E187EF9EE2DB -:10B470000F94B702809114148823C9F2A6C38FE3F6 -:10B4800092E89F938F931F9287E88F931F921F924A -:10B4900087E094E19F938F938FEE9EE29F938F932B -:10B4A00083EF9EE29F938F933F9281E090911514DA -:10B4B000923009F080E08F930F940B028DB79EB706 -:10B4C0000E960FB6F8949EBF0FBE8DBF0CC0C33052 -:10B4D00009F0FCC080911514833009F472C1809189 -:10B4E0004302811192C12CEA35EC47E25EE36091A0 -:10B4F000B7137091B8138091B9139091BA130F9448 -:10B50000340D6093B3137093B4138093B513909379 -:10B51000B6132CEA35EC47E25EE36091AF1370910D -:10B52000B0138091B1139091B2130F94710860938E -:10B53000AB137093AC138093AD139093AE13CA30DA -:10B54000E9F5809115148A3031F080914302882307 -:10B5500009F42EC124C08091380D8823B1F31092D4 -:10B56000380DE12C18E1F12E0CE116E420E030E07A -:10B5700040E85FE367EA73E182E39EE20F94220210 -:10B58000B0925602A0925502109206141092051421 -:10B5900010920414809114148823B9F216C311E098 -:10B5A000809115148A3009F010E087EA93E10E9437 -:10B5B000046C00E09C014CE25EE241C0CB3009F03B -:10B5C00043C0809115148B3031F080914302882361 -:10B5D00009F4EEC026C08091380D8823B1F3109293 -:10B5E000380DE12C18E1F12E0CE116E42AE037EDDC -:10B5F00043E25CE363EB73E186E29EE20F94220296 -:10B60000B0925602A092550280E495EE90930614F3 -:10B610008093051410920414809114148823A9F2C5 -:10B62000D4C211E0809115148B3009F010E083EB47 -:10B6300093E10E94046C00E09C0140E25EE2632D15 -:10B64000812F0E947B9EB4C0CC3009F0A5C08091B0 -:10B6500015148C3031F080914302882309F4A8C07E -:10B6600026C08091380D8823B1F31092380DE12C5B -:10B6700018E1F12E0CE116E420E030E040E85FE351 -:10B680006BEA73E18AE19EE20F942202B0925602C5 -:10B69000A092550289E295EE9093061480930514CA -:10B6A00010920414809114148823A9F28EC211E020 -:10B6B000809115148C3009F010E08BEA93E10E9420 -:10B6C000046C00E09C0144E15EE2B9CFC43009F4AF -:10B6D000C0C0C53009F40BC1C63009F456C1C7302B -:10B6E00009F082C180911514873009F49FC18091BF -:10B6F0004302882309F4F7CE83E48F9382E88F9383 -:10B700001F921F921F921F9281E592E09F938F9349 -:10B710008DE59EE29F938F935F924F923F9281E0DF -:10B7200090911514973009F080E08F930E94DC9E71 -:10B730008DB79EB70E960FB6F8949EBF0FBE8DBF05 -:10B740002CEA35EC47E25EE36091B7137091B813D1 -:10B750008091B9139091BA130F94340D6093B31381 -:10B760007093B4138093B5139093B6132CEA35EC11 -:10B7700047E25EE36091AF137091B0138091B11313 -:10B780009091B2130F9471086093AB137093AC1344 -:10B790008093AD139093AE13CD3009F0EFC180913B -:10B7A00015148D3009F4CFC1809143028111DCC1A1 -:10B7B0003394CF5F95E03912B7CD8FE080931314A7 -:10B7C00004C28091380D882309F489CE1092380D77 -:10B7D00081E080931B141092320D1092330D109261 -:10B7E000340D1092350D00E010E02FEF30E040E016 -:10B7F00050E06BE074E183EE9EE20F94B70280911B -:10B800001414882309F46BCEE0C11F928FEF8F933D -:10B810001F921F928BE094E19F938F938BEC9EE29B -:10B820009F938F9387ED9EE29F938F933F9281E04A -:10B8300090911514933009F080E08F930F940B02D0 -:10B840008DB79EB70C960FB6F8949EBF0FBE8DBFF6 -:10B850004ACE80911514843031F0809143028823C0 -:10B8600009F441CE22C08091380D8823B1F31092A3 -:10B87000380D81E080931B141092320D1092330D1D -:10B880001092340D1092350D00E010E02FEF30E0F3 -:10B8900040E050E06DE074E18FEB9EE20F94B70260 -:10B8A000809114148823C9F290C11F928FEF8F9357 -:10B8B0001F921F928DE094E19F938F937F926F92DE -:10B8C00083EB9EE29F938F933F9281E090911514BA -:10B8D000943009F080E08F930F940B028DB79EB7E0 -:10B8E0000C960FB6F8949EBF0FBE8DBFFCCD809115 -:10B8F0001514853031F080914302882309F4F3CD8B -:10B9000022C08091380D8823B1F31092380D81E068 -:10B9100080931B141092320D1092330D1092340D3F -:10B920001092350D00E010E02FEF30E040E050E0E5 -:10B930006FE074E18BE99EE20F94B70280911414DA -:10B940008823C9F242C11F928FEF8F931F921F92DB -:10B950008FE094E19F938F9383E89EE29F938F9370 -:10B960009F928F923F9281E090911514953009F04B -:10B9700080E08F930F940B028DB79EB70C960FB695 -:10B98000F8949EBF0FBE8DBFAECD9091151496302A -:10B9900029F080914302811115C0A5CD8091380D09 -:10B9A0008823B9F31092380D2091BB1381E08227D0 -:10B9B0008093BB1383E08093430280911414882307 -:10B9C00041F303C18091BB13811103C022E73EE222 -:10B9D00002C026E73EE281E0963009F080E001E017 -:10B9E0004AE75EE2632D1FC0C830E1F1C93009F0BB -:10B9F0007ACD80911514893009F47FC0809143027B -:10BA0000882309F49DCE11E080911514893009F046 -:10BA100010E089E492E00E94D56D00E09C0148E3CB -:10BA20005EE2632D812F0E947B9E5DCD8091380D5B -:10BA3000882309F45CCE1092380DC12CD12CE12C56 -:10BA4000F12C02E813E420E030E0A90161E572E0A6 -:10BA50008BE69EE20E943DEB80911414882309F44A -:10BA600046CEB3C080911514883031F080914302E6 -:10BA7000882309F438CD1AC08091380D8823B1F39A -:10BA80001092380DC12CD12CE12CF12C02E813E4DA -:10BA900020E030E0A9016DE472E086E59EE20E94BC -:10BAA0003DEB80911414882309F38FC083E48F93B6 -:10BAB00082E88F931F921F921F921F928DE492E053 -:10BAC0009F938F9388E49EE29F938F938FE49EE2EF -:10BAD0009F938F933F9281E090911514983009F0D5 -:10BAE00080E08F930E94DC9E8DB79EB70E960FB6B6 -:10BAF000F8949EBF0FBE8DBF23CE8091380D882352 -:10BB000009F47CCF1092380DE12CF12C00E81FE3F2 -:10BB100020E030E0A90169E472E080E49EE20F9445 -:10BB200022028BEE92EA9093560280935502109275 -:10BB30000614109205141092041480911414882392 -:10BB400009F45CCF42C08091380D882309F42CCED3 -:10BB50001092380D82E097ED0E9432A68091141465 -:10BB6000882309F421CE31C081E0909115149D30D5 -:10BB700009F080E023E043E05EE215C0CE3009F03A -:10BB800017CE809115148E3091F080914302882356 -:10BB900009F40ECE81E0909115149E3009F080E0FA -:10BBA00023E042EF5DE2632D0E947D6F01CE809124 -:10BBB000380D882351F31092380D80E097ED0E94E4 -:10BBC00032A680911414882301F3CF911F910F9115 -:10BBD000FF90EF90DF90CF90BF90AF909F908F90AD -:10BBE0007F906F905F904F903F900895CF93DF9339 -:10BBF00027E933E1C0EDD3E1ABE6B3E180E090E0CB -:10BC0000FC01E152FF4C4591559165917491F90108 -:10BC100041935193619371939F01FC01E153FF4C58 -:10BC2000459155916591749149935993699379938D -:10BC3000FC01E154FF4C45915591659174914D93F0 -:10BC40005D936D937D93049680319105C9F680E2F2 -:10BC50009EE4A0E0B0E08093020490930304A093DC -:10BC60000404B093050480E090E0AAE7B4E4809374 -:10BC7000831390938413A0938513B09386138093BA -:10BC80007F1390938013A0938113B09382138093BA -:10BC90007B1390937C13A0937D13B0937E1310922B -:10BCA000CC131092CD131092CE131092CF1310928A -:10BCB000C8131092C9131092CA131092CB1380E0CC -:10BCC00090E0A0EAB1E48093871390938813A09347 -:10BCD0008913B0938A1380938B1390938C13A09342 -:10BCE0008D13B0938E138DEC9CECACECBEE3809383 -:10BCF0008F1390939013A0939113B093921380E0BD -:10BD000090E0A0EAB0E48093931390939413A093EF -:10BD10009513B09396138CE0E1ECFDE0DF011D92EA -:10BD20008A95E9F71092E6131092E7131092E81340 -:10BD30001092E9130E943C3783E393E3A3E1B0EC54 -:10BD40008093B20F9093B30FA093B40FB093B50F3D -:10BD500084EB90E09093C1138093C01380EF90E048 -:10BD60009093C3138093C21386E490E09093BD1325 -:10BD70008093BC138EE690E09093BF138093BE1324 -:10BD80001092C5131092C4131092C7131092C613C9 -:10BD90008AE999E9A1EBB1E48093A7139093A813E2 -:10BDA000A093A913B093AA1386EA91E3A5E3BEE397 -:10BDB0008093B7139093B813A093B913B093BA13A9 -:10BDC00080E493EFADE2B4E48093AF139093B013AB -:10BDD000A093B113B093B21380E090E0A8ECB2E46A -:10BDE0008093610D9093620DA093630DB093640DE9 -:10BDF0008CE09EEAA2E5BFE380935D0D90935E0D1B -:10BE0000A0935F0DB093600D80E790E0A9EEB4E4DD -:10BE10008093590D90935A0DA0935B0DB0935C0DD8 -:10BE200010921E1380E090E0A0EEBFE380931A13FF -:10BE300090931B13A0931C13B0931D131092BF0D6E -:10BE40001092BE0D0E940CB8EFE9F2E18491EF016F -:10BE50002196882321F00E948339FE01F7CFECE977 -:10BE6000F0E38491EF012196882321F00E94833929 -:10BE7000FE01F7CFDF91CF9108952F923F924F921D -:10BE80005F926F927F928F929F92AF92BF92CF926A -:10BE9000DF92EF92FF920F931F93CF93DF93CDB773 -:10BEA000DEB7C656D1090FB6F894DEBF0FBECDBFC0 -:10BEB0002DB63EB667961FAE1EAE679784E690E03D -:10BEC00069969FAF8EAF699701E09E012B5A3F4F55 -:10BED00044E050E0BE01655B7F4FCE01895A9F4F21 -:10BEE0000E94BFB79E012B5A3F4F42E050E0BE0177 -:10BEF000675A7F4FCE01895A9F4F0E94BFB743E0D8 -:10BF000050E0BE01655B7F4F83E393E00F94BD0F6C -:10BF1000892B09F442C02F968FAD2F97882339F0D3 -:10BF20008FE32C968FAF2C972D961FAE2D97EFE9B0 -:10BF3000F2E184917F012FEFE21AF20A811103C02E -:10BF4000E3E8F0E304C00E948339F701F2CF849163 -:10BF50007F019FEFE91AF90A882321F00E948339B3 -:10BF6000F701F5CFBE01655B7F4F8AE790E30E9442 -:10BF70003858ECE6F0E384917F012FEFE21AF20AE1 -:10BF8000882321F00E948339F701F5CF81E0809367 -:10BF9000E4132CDE0E949AB328C58DB79EB7A596F0 -:10BFA0009FAF8EAFA5972B961CAE1DAE1EAE1FAEDB -:10BFB0002B9767961FAE1EAE679701E09E012B5A26 -:10BFC0003F4F41E050E0BE01605A7F4FCE01895A99 -:10BFD0009F4F0E94BFB780E1E3E0F3E0DE0191965E -:10BFE00001900D928A95E1F780E1E3E1F3E0DE0153 -:10BFF000519601900D928A95E1F780E1E3E2F3E03A -:10C00000DE01119601900D928A95E1F7A1964FAD50 -:10C01000A19750E04D5F5F4F440F551F440F551FD0 -:10C02000EDB7FEB7E41BF50B0FB6F894FEBF0FBEDD -:10C03000EDBF8DB79EB701967C0100E09E012B5AA3 -:10C040003F4FBC01CE01895A9F4F0E94BFB79E014E -:10C050002B5A3F4F44E050E062E074E0CE01895A31 -:10C060009F4F0E94BFB7A1968FACA197912C93E0F0 -:10C07000890E911C880C991C880C991CEDB7FEB791 -:10C08000E819F9090FB6F894FEBF0FBEEDBF8DB7E2 -:10C090009EB701966C01E819F9090FB6F894FEBF36 -:10C0A0000FBEEDBF8DB79EB701965C019E012B5A66 -:10C0B0003F4FA401B601CE01895A9F4F0E94BFB7DE -:10C0C0009E012B5A3F4FA401B501CE01895A9F4FC3 -:10C0D0000E94BFB79091E513A3969FAFA3979923B2 -:10C0E00009F4A2C000E09E012B5A3F4F44E050E00B -:10C0F00063E873E1CE01895A9F4F0E94BFB79E014A -:10C100002B5A3F4F44E050E06FE773E1CE01895A6C -:10C110009F4F0E94BFB79E012B5A3F4F44E050E013 -:10C120006BE773E1CE01895A9F4F0E94BFB79E0112 -:10C130002B5A3F4F44E050E06CEC73E1CE01895A3A -:10C140009F4F0E94BFB79E012B5A3F4F44E050E0E3 -:10C1500068EC73E1CE01895A9F4F0E94BFB79E01E0 -:10C160002B5A3F4F40E150E067E873E1CE01895A16 -:10C170009F4F0E94BFB79E012B5A3F4F44E050E0B3 -:10C18000BE01695B7F4FCE01895A9F4F0E94BFB7A6 -:10C190009E012B5A3F4F4CE050E061EC7DE0CE0118 -:10C1A000895A9F4F0E94BFB79E012B5A3F4F44E0D0 -:10C1B00050E066EE73E1CE01895A9F4F0E94BFB7EF -:10C1C0009E012B5A3F4F44E050E0BE01695B7F4F18 -:10C1D000CE01895A9F4F0E94BFB701E09E012B5AA2 -:10C1E0003F4F41E050E0BE01615A7F4FCE01895A76 -:10C1F0009F4F0E94BFB79E012B5A3F4F41E050E036 -:10C20000BE01625A7F4FCE01895A9F4F0E94BFB72D -:10C21000A0968FADA0976F96CFAC6F978C9D600165 -:10C220001124E12CF12C71C0A1968FADA19790E063 -:10C23000029600ED13E1B501DE011196E7E98E2EBD -:10C24000E3E19E2EAE014F5E5F4FFBE6AF2EF3E1C2 -:10C25000BF2EA796FFAEEEAEA7977E01E1E2EE0EEF -:10C26000F11C20E030E0821793072CF0A796EEAD8A -:10C27000FFADA79701C0F7014080518062807380B5 -:10C28000F50141925192619271925F018217930779 -:10C2900014F0F60101C0FA01408051806280738081 -:10C2A000F40141925192619271924F01821793076A -:10C2B00034F0FB01408051806280738005C04D9056 -:10C2C0005D906D907C901397F8014192519261922C -:10C2D00071928F012F5F3F4F6C5F7F4F1496F4E098 -:10C2E000CF0ED11C4C5F5F4FA796EEADFFADA79769 -:10C2F0003496A796FFAFEEAFA797F4E0EF0EF11CD0 -:10C300002430310509F0AFCFEDCE00E09E012B5A6D -:10C310003F4F44E050E0EC14FD0461F0BE01695B66 -:10C320007F4FCE01895A9F4F0E94BFB72FEFE21A6D -:10C33000F20AEBCF62EB7FE0CE01895A9F4F0E9459 -:10C34000BFB76AE0F62EFA94FF2079F000E09E0174 -:10C350002B5A3F4F44E050E0BE01695B7F4FCE0156 -:10C36000895A9F4F0E94BFB7EECF01E09E012B5A22 -:10C370003F4F41E050E0BE01635A7F4FCE01895AE2 -:10C380009F4F0E94BFB79E012B5A3F4F41E050E0A4 -:10C39000BE01645A7F4FCE01895A9F4F0E94BFB79A -:10C3A0006E968FAD6E97833091F56D968FAD6D97CC -:10C3B000833069F5A3968FADA397811102C00E94C7 -:10C3C000EB3600E09E012B5A3F4F44E050E06CE515 -:10C3D0007FE0CE01895A9F4F0E94BFB79E012B5A22 -:10C3E0003F4F44E050E060EE73E1CE01895A9F4F29 -:10C3F0000E94BFB79E012B5A3F4F44E250E061E7D5 -:10C400007FE0CE01895A9F4F0E94BFB73BC000E03A -:10C410009E012B5A3F4F44E050E0BE01635C7F4FCA -:10C42000CE01895A9F4F0E94BFB79E012B5A3F4FA2 -:10C4300044E050E0BE016F5C7F4FCE01895A9F4FB0 -:10C440000E94BFB76E968FAD6E976D96CFAC6D970D -:10C450008C9D60011124E12CF12CCE14DF0491F0AD -:10C4600000E09E012B5A3F4F44E050E0BE01695B63 -:10C470007F4FCE01895A9F4F0E94BFB79FEFE91AA5 -:10C48000F90AEBCF00E09E012B5A3F4F41E050E00C -:10C49000BE016F597F4FCE01895A9F4F0E94BFB78F -:10C4A0009E012B5A3F4F41E050E0BE01655A7F4F3D -:10C4B000CE01895A9F4F0E94BFB79E012B5A3F4F12 -:10C4C00044E050E060EC73E1CE01895A9F4F0E9436 -:10C4D000BFB79E012B5A3F4F44E050E06CEB73E135 -:10C4E000CE01895A9F4F0E94BFB79E012B5A3F4FE2 -:10C4F00044E050E064EC73E1CE01895A9F4F0E9402 -:10C50000BFB710E000E09E012B5A3F4F44E050E0DF -:10C51000BE01695B7F4FCE01895A9F4F0E94BFB712 -:10C52000111110C02B96CCACDDACEEACFFAC2B9750 -:10C5300020E030E84BE355E4C701B6010F940C0846 -:10C54000811103C054E0F52E33C08091E5138111B1 -:10C5500008C0C092A713D092A813E092A913F0923A -:10C56000AA1300E09E012B5A3F4F44E050E067EBD6 -:10C5700073E1CE01895A9F4F0E94BFB79E012B5A8B -:10C580003F4F44E050E06FEA73E1CE01895A9F4F7C -:10C590000E94BFB79E012B5A3F4F44E050E0BE01BE -:10C5A000695B7F4FCE01895A9F4F0E94BFB712C06F -:10C5B000FA94FF2079F000E09E012B5A3F4F44E0AF -:10C5C00050E0BE01695B7F4FCE01895A9F4F0E94A8 -:10C5D000BFB7EECF1F5F153009F094CF00E09E018A -:10C5E0002B5A3F4F42E050E0BE016D5A7F4FCE01C3 -:10C5F000895A9F4F0E94BFB79E012B5A3F4F44E07C -:10C6000050E0BE01695B7F4FCE01895A9F4F0E9467 -:10C61000BFB72B96CCACDDACEEACFFAC2B9720E0DB -:10C6200030E84BE355E4C701B6010F940C088823AA -:10C6300029F18091E513811108C0C092610DD0925B -:10C64000620DE092630DF092640D00E09E012B5AA2 -:10C650003F4F44E050E06DE57DE0CE01895A9F4FA9 -:10C660000E94BFB79E012B5A3F4F44E050E069E55E -:10C670007DE0CE01895A9F4F0E94BFB700E09E0126 -:10C680002B5A3F4F42E050E0BE016F5A7F4FCE0120 -:10C69000895A9F4F0E94BFB79E012B5A3F4F41E0DE -:10C6A00050E0BE016F597F4FCE01895A9F4F0E94C3 -:10C6B000BFB719E0115000E09E012B5A3F4F1123E4 -:10C6C00059F044E050E0BE01695B7F4FCE01895ACA -:10C6D0009F4F0E94BFB7EECF41E050E06EE173E1A3 -:10C6E000CE01895A9F4F0E94BFB7F12C00E09E01F6 -:10C6F0002B5A3F4F44E050E0BE01695B7F4FCE01B3 -:10C70000895A9F4F0E94BFB71091E513111110C0B5 -:10C71000F1100EC02B968CAD9DADAEADBFAD2B977D -:10C7200080931A1390931B13A0931C13B0931D13A3 -:10C73000F394E5E0FE12DACF4CE0F42EFA94F11017 -:10C7400003C03CE0F32E0FC000E09E012B5A3F4F88 -:10C7500042E050E0BE01615B7F4FCE01895A9F4F9E -:10C760000E94BFB7EBCFFA9400E09E012B5A3F4FD7 -:10C77000FF2059F044E050E0BE016D5B7F4FCE01D9 -:10C78000895A9F4F0E94BFB7EECF46E050E0BE01EE -:10C79000635C7F4FCE01895A9F4F0E94BFB79E01B5 -:10C7A0002B5A3F4F44E050E0BE01695B7F4FCE0102 -:10C7B000895A9F4F0E94BFB79E012B5A3F4F4CE0B2 -:10C7C00050E0BE016F5C7F4FCE01895A9F4F0E949F -:10C7D000BFB72CE1F22EFA94F11003C094E0F92EC9 -:10C7E0001DC000E09E012B5A3F4F44E050E0BE01C7 -:10C7F000695B7F4FCE01895A9F4F0E94BFB7EBCF35 -:10C8000000E09E012B5A3F4F44E050E0BE01695BBF -:10C810007F4FCE01895A9F4F0E94BFB7FA94F11003 -:10C82000EFCF8BE0F82EFA94FF2079F000E09E0124 -:10C830002B5A3F4F44E050E0BE01695B7F4FCE0171 -:10C84000895A9F4F0E94BFB7EECF69968EAD9FADBC -:10C850006997845691090E9479B38093E4138823E1 -:10C8600009F1EFE9F2E184917F012FEFE21AF20A78 -:10C87000882321F00E948339F701F5CF69966EADC8 -:10C880007FAD69976456710984E690E30E941F5852 -:10C890006FE872E08CE590E30E941F588AE00E94E6 -:10C8A00083399AC067962EAD3FAD67976B968EAD74 -:10C8B0009FAD6B972817390709F44BC081E080932F -:10C8C000E413E0E7F2E184917F019FEFE91AF90AAE -:10C8D000811103C0ECE3F0E304C00E948339F70147 -:10C8E000F2CF84917F012FEFE21AF20A882321F020 -:10C8F0000E948339F701F5CF6B966EAD7FAD6B97D4 -:10C9000080E090E04AE00E94743DE7E3F0E3849128 -:10C910007F019FEFE91AF90A882321F00E948339E9 -:10C92000F701F5CF67966EAD7FAD679780E090E039 -:10C930004AE00E94743DE7E2F0E384917F012FEF2B -:10C94000E21AF20A882309F43FC00E948339F701F2 -:10C95000F4CF111141C0EFE9F2E184917F019FEF23 -:10C96000E91AF90A811103C003E313E004C00E942D -:10C970008339F701F2CFF80181918F01882319F0F3 -:10C980000E948339F8CF69966EAD7FAD6997645682 -:10C9900071098AE090E30E941F5867964EAD5FAD23 -:10C9A000679760E070E08DEF9FE20E94E557EAEF45 -:10C9B000FFE284917F012FEFE21AF20A882331F01F -:10C9C0000E948339F701F5CF111106C08091E4135D -:10C9D000811102C00E940CB8A5968EAD9FADA5979F -:10C9E0000FB6F8949EBF0FBE8DBF8091E5138111E5 -:10C9F00002C00E94AE8A9091E41381E089270FB6AD -:10CA0000F8943EBE0FBE2DBECA59DF4F0FB6F89444 -:10CA1000DEBF0FBECDBFDF91CF911F910F91FF9071 -:10CA2000EF90DF90CF90BF90AF909F908F907F90CE -:10CA30006F905F904F903F902F90089581E080938A -:10CA4000E5131BDA1092E513811117CACFD881E0E4 -:10CA500008952CEA35EC47E25EE36091AB137091E8 -:10CA6000AC138091AD139091AE130F94340D60937D -:10CA7000AF137093B0138093B1139093B2130895D2 -:10CA80002CEA35EC47E25EE36091B3137091B41386 -:10CA90008091B5139091B6130F9471086093B713FA -:10CAA0007093B8138093B9139093BA130895CF93EA -:10CAB000DF934FD5D0911214C0E0D11120C08091E6 -:10CAC0001514882331F080914302882309F476C03D -:10CAD0000DC08091380D8823B1F31092380D0E945B -:10CAE000D69780911414882371F3A3C081E09091AC -:10CAF0001514911180E024E041E751E35CC0D1308E -:10CB000019F580911514813031F08091430288230A -:10CB100009F454C00FC08091380D8823B1F31092EE -:10CB2000380D8BE399EE0E9432A68091141488236D -:10CB300061F37FC081E090911514913009F080E09D -:10CB400023E04AE651E337C0D23011F58091151445 -:10CB5000823029F080914302882381F10FC08091B7 -:10CB6000380D8823B9F31092380D8FE399EE0E94A7 -:10CB700032A680911414882369F35BC081E0909100 -:10CB80001514923009F080E023E043E651E313C02E -:10CB9000D33059F5809115148330C1F08091430250 -:10CBA000882361F081E090911514933009F080E0C2 -:10CBB00023E04CE551E36C2F0E947D6FCF5FDF5F78 -:10CBC000C53009F07ACFC093131433C08091380D6B -:10CBD000882321F31092380D83E499EE0E9432A647 -:10CBE000809114148823D1F224C0D43039F7809175 -:10CBF0001514843029F0809143028823F9F20FC084 -:10CC00008091380D8823B9F31092380D87E499EE9E -:10CC10000E9432A680911414882369F30AC081E02F -:10CC200090911514943009F080E023E043E551E33E -:10CC3000C2CFDF91CF910895CF93DF938AD4D09163 -:10CC40001214C0E0D11120C080911514882331F056 -:10CC500080914302882309F476C00DC08091380D7D -:10CC60008823B1F31092380D0E94D6978091141446 -:10CC7000882371F338C181E090911514911180E0FF -:10CC800024E047EF51E35CC0D13019F580911514D1 -:10CC9000813031F080914302882309F454C00FC0E1 -:10CCA0008091380D8823B1F31092380D8FE699EDFD -:10CCB0000E9432A680911414882361F314C181E08C -:10CCC00090911514913009F080E023E04BEE51E390 -:10CCD00037C0D23011F580911514823029F080913F -:10CCE0004302882381F10FC08091380D8823B9F366 -:10CCF0001092380D89E49BEC0E9432A680911414A6 -:10CD0000882369F3F0C081E090911514923009F006 -:10CD100080E023E044EE51E313C0D33061F580910D -:10CD200015148330C9F080914302882361F081E0BB -:10CD300090911514933009F080E023E04BED51E31E -:10CD40006C2F0E947D6FCF5FDF5FC53009F07ACF17 -:10CD500089E080931314C7C08091380D882319F39C -:10CD60001092380D86EE94EA0E9432A68091141437 -:10CD70008823C9F2B8C0D43011F5809115148430DD -:10CD800029F0809143028823F1F20FC08091380D81 -:10CD90008823B9F31092380D8CEF92EF0E9432A6DF -:10CDA00080911414882369F39EC081E0909115143A -:10CDB000943009F080E023E043ED51E3C1CFD5305A -:10CDC00019F580911514853031F080914302882344 -:10CDD00009F4B9CF0FC08091380D8823B1F31092B8 -:10CDE000380D0E949AB30E94E8F3809114148823AE -:10CDF00061F379C081E090911514953009F080E0DD -:10CE000020E244EC51E39CCFD63011F5809115140B -:10CE1000863031F080914302882309F494CF0EC00C -:10CE20008091380D8823B1F31092380D07DE0E94EF -:10CE3000E8F380911414882369F355C081E0909140 -:10CE40001514963009F080E020E244EA51E378CFEF -:10CE5000D73019F580911514873031F08091430255 -:10CE6000882309F470CF0FC08091380D8823B1F367 -:10CE70001092380D0E94F6DD0E944E6F80911414BE -:10CE8000882361F330C081E090911514973009F048 -:10CE900080E020E243E951E353CFD83009F053CF8B -:10CEA00080911514883031F080914302882309F471 -:10CEB0004ACF0FC08091380D8823B1F31092380DFE -:10CEC00086E797EE0E9432A680911414882361F3BE -:10CED0000AC081E090911514983009F080E023E0B9 -:10CEE00042EB51E32DCFDF91CF9108951F93CF9364 -:10CEF000DF932FD310911214C0E0812F8C0F01F516 -:10CF000080911514882331F080914302882309F41D -:10CF100048C00DC08091380D8823B1F31092380DB0 -:10CF20000E94D69780911414882371F341C081E048 -:10CF300090911514911180E024E04BE851E32EC04C -:10CF4000813079F580911514813029F08091430268 -:10CF5000882339F11AC08091380D8823B9F31092D3 -:10CF6000380D0E94F6DD0E949AB3D82F882319F05D -:10CF700080E00E94AE8A8D2F0E94E8F30E94D6972F -:10CF800080911414882311F313C081E0909115143B -:10CF9000913009F080E020E249E751E36C2F0E94D4 -:10CFA0007D6FCF5FC53009F0A8CF82E08093131466 -:10CFB000DF91CF911F91089562E08DEF90E30C9483 -:10CFC000778261E086EF90E30C94778260E08FEEE9 -:10CFD00090E30C9477821F93CF93DF93182F709375 -:10CFE000EF136093EE13B5D2D0911214C0E081E03C -:10CFF000113061F120F0123009F44FC075C0D11129 -:10D000009DC08823D9F0809115141816BCF040916A -:10D010001714509118146091191470911A144F5FDD -:10D020005F4F6F4F7F4F40931714509318146093C6 -:10D03000191470931A148F5F809315148091430212 -:10D04000882309F4D8C06CE471E374C0D11176C0B0 -:10D050008823D9F0809115141816BCF0409117144C -:10D06000509118146091191470911A144F5F5F4F0A -:10D070006F4F7F4F409317145093181460931914F7 -:10D0800070931A148F5F8093151480914302882344 -:10D0900009F4B1C065E471E34DC0D1114FC08823DC -:10D0A000D9F0809115141816BCF0409117145091C6 -:10D0B00018146091191470911A144F5F5F4F6F4FDD -:10D0C0007F4F409317145093181460931914709362 -:10D0D0001A148F5F8093151480914302882309F4FA -:10D0E0008AC06EE371E326C0D11128C08823D9F02D -:10D0F000809115141816BCF0409117145091181413 -:10D100006091191470911A144F5F5F4F6F4F7F4FEA -:10D1100040931714509318146093191470931A14B1 -:10D120008F5F8093151480914302882309F463C0B4 -:10D1300065E371E38C2F0F9487035DC0D13009F54F -:10D1400080911514813031F080914302882309F4D5 -:10D1500052C00DC08091380D8823B1F31092380D64 -:10D160000E94D69780911414882371F380C081E0C7 -:10D1700090911514913009F080E024E04BE251E3E6 -:10D1800037C0D23011F580911514823029F080918A -:10D190004302882381F10FC08091380D8823B9F3B1 -:10D1A0001092380D8FE599EE0E9432A680911414EA -:10D1B000882369F35CC081E090911514923009F0E6 -:10D1C00080E023E041E251E313C0D33061F5809168 -:10D1D00015148330C9F080914302882361F081E007 -:10D1E00090911514933009F080E023E048E151E379 -:10D1F0006C2F0E947D6FCF5FDF5F80E0C53009F04C -:10D20000F7CEC093131433C08091380D882319F3DF -:10D210001092380D84E699EE0E9432A68091141483 -:10D220008823C9F224C0D43031F78091151484309A -:10D2300029F0809143028823F1F20FC08091380DCC -:10D240008823B9F31092380D89E699EE0E9432A630 -:10D2500080911414882369F30AC081E09091151419 -:10D26000943009F080E023E04DE051E3C1CFDF913D -:10D27000CF911F91089566EE77EE80E0ACCE61EE1F -:10D2800077EE81E0A8CE6CED77EE82E0A4CE6EE67C -:10D2900079EE83E0A0CE21E02093310D6093EA1374 -:10D2A0007093EB138093EC139093ED1340E050E0F8 -:10D2B000BA018091EE139091EF130C94999760E06E -:10D2C00070E080E291E4E7CF60E070E080E89FE307 -:10D2D000E2CF6DEC7CEC8CEC9DE3DDCF8091380DE2 -:10D2E0001092380D882321F01092310D0C94D697AE -:10D2F00060911714709118148091191490911A1458 -:10D30000611571058105910561F10F941208209155 -:10D31000EA133091EB134091EC135091ED130F94FD -:10D3200071082091C20F3091C30F4091C40F5091EA -:10D33000C50F0F94580C6093C20F7093C30F809366 -:10D34000C40F9093C50F83E00E94418281E08093D7 -:10D35000430210921714109218141092191410927C -:10D360001A1480914302882349F082EC9FE00E94C6 -:10D370005D6DBC0184E091E30C94FD9D089590E007 -:10D38000FC013197E231F10508F04EC08827EE58D4 -:10D39000FF4F8F4F0D94530F809180008F7703C004 -:10D3A000809180008F7D809380000895809180001F -:10D3B000877FF9CF84B58F7702C084B58F7D84BD18 -:10D3C00008958091B0008F7703C08091B0008F7D69 -:10D3D0008093B0000895809190008F7707C080916E -:10D3E00090008F7D03C080919000877F8093900094 -:10D3F00008958091A0008F7707C08091A0008F7D55 -:10D4000003C08091A000877F8093A0000895809141 -:10D4100020018F7707C0809120018F7D03C080910C -:10D420002001877F8093200108953FB7F894809171 -:10D43000211490912214A0912314B091241426B5A4 -:10D44000A89B05C02F3F19F00196A11DB11D3FBF3C -:10D45000BA2FA92F982F8827820F911DA11DB11DCA -:10D46000BC01CD0142E0660F771F881F991F4A95C6 -:10D47000D1F708950F931F93CF93DF93182F042FA5 -:10D48000C62FD62FD20F402F6C2F812F0E9492963D -:10D49000CF5FCD13F8CFDF91CF911F910F910895FA -:10D4A000FF920F931F93CF93DF93182FC62FF42E65 -:10D4B000D22F022F242F462F682F82EB99E00E9453 -:10D4C000286A8823E9F04F2D6C2F812F0E949296B5 -:10D4D0004D2F6C2F812F0E9408978FEF8F0D4D2FAE -:10D4E0006C2F810F0E9408976FEF6D0F6C0F4F2DFF -:10D4F000812FDF91CF911F910F91FF900C94929605 -:10D50000DF91CF911F910F91FF900895FF920F939C -:10D510001F93CF93DF93C82FD62F142FF22E022FF5 -:10D52000242F462F682F82EB99E00E94286A8823D7 -:10D5300051F02F2D412F6D2F8C2FDF91CF911F9107 -:10D540000F91FF9097CFDF91CF911F910F91FF9097 -:10D55000089510921B148091171490911814A091A3 -:10D560001914B0911A1481309048A105B10540F00A -:10D5700010921714109218141092191410921A1471 -:10D5800080911614882331F080911714809315141C -:10D5900010921414809113141816D4F4082E000C51 -:10D5A000990B019720911514022E000C330B2817AC -:10D5B000390774F080931514092E000CAA0BBB0BCD -:10D5C0008093171490931814A0931914B0931A14FD -:10D5D0008091151490911214891714F480931214E9 -:10D5E00020911214022E000C330B2C5F3F4F482F5A -:10D5F000082E000C550B241735071CF4845080931B -:10D60000121408950F931F93CF93DF938B01EA01B8 -:10D61000181619066CF4843121E0920714F083E1A6 -:10D6200091E090930A148093091480E00E9432766E -:10D6300017FD0EC0063911051CF096E980E002C006 -:10D64000902F812F90930714809308140E94E67501 -:10D6500080911114833010F490E002C080E090E0DB -:10D66000880F991FFC01E55FFB4ED183C083DF91DA -:10D67000CF911F910F910C94D0972F923F924F9280 -:10D680005F926F927F928F929F92AF92BF92CF9252 -:10D69000DF92EF92FF920F931F93CF93DF931C01C2 -:10D6A000EB0149015A010E94799783E0809343027C -:10D6B0003092031420920214D0930114C0930014EA -:10D6C000C501B4010F949C0D6093FC137093FD137E -:10D6D0008093FE139093FF130F9412084B015C018B -:10D6E0009B01AC01C801B7010F94570C0F949C0D1E -:10D6F0006093F8137093F9138093FA139093FB13CC -:10D70000A5019401688179818A819B810F94570CCE -:10D710000F94A10D6093171470931814809319142B -:10D7200090931A148FEA93EA9093560280935502CD -:10D73000D0920614C092051410920414DF91CF9178 -:10D740001F910F91FF90EF90DF90CF90BF90AF901F -:10D750009F908F907F906F905F904F903F902F9011 -:10D7600008958F929F92AF92BF92CF92DF92EF92E5 -:10D77000FF92CF93FC01C080D180E280F38020E053 -:10D7800030E44CE156E4C701B6010F9471084B0137 -:10D790005C0120E030E0A901C701B6010F940C083C -:10D7A00087FD05C020E030E040EA50E404C020E0FE -:10D7B00030E040EA50ECC501B4010F94580C20E071 -:10D7C00030E040E251E40F94340D0F949C0D6B0156 -:10D7D0007C01611571058105910561F097FF0AC013 -:10D7E000F094E094D094C094C11CD11CE11CF11CB5 -:10D7F0008DE201C080E28093F113C701B60128EEEB -:10D8000033E040E050E00F941C0C8AE0882E912C0D -:10D81000A12CB12CCA01B901A50194010F941C0CD3 -:10D82000605D6093F2138EE28093F313C701B6013B -:10D8300024E630E040E050E00F941C0CCA01B9012E -:10D84000A50194010F941C0C605D6093F413C70153 -:10D85000B601A50194010F941C0CC62FCA01B90191 -:10D86000A50194010F941C0C605D6093F513C05DDD -:10D87000C093F61381EF93E1CF91FF90EF90DF908B -:10D88000CF90BF90AF909F908F900895CF93DF93EC -:10D89000282F30E0F901EA52FD4C8491F901E0575C -:10D8A000FD4CD491F901E65BFD4CC491CC2389F089 -:10D8B000811165DDEC2FF0E0EE0FFF1FE05DFD4C08 -:10D8C000A591B491EC91ED2381E090E021F480E00A -:10D8D00002C080E090E0DF91CF9108951F93CF9335 -:10D8E000DF93282F30E0F901EA52FD4C8491F901D1 -:10D8F000E057FD4CD491F901E65BFD4CC491CC237B -:10D90000B9F0162F81113BDDEC2FF0E0EE0FFF1F79 -:10D91000EA5EFD4CA591B4919FB7F894111104C033 -:10D920008C91D095D82302C0EC91DE2BDC939FBF65 -:10D93000DF91CF911F910895CF93DF9390E0FC0189 -:10D94000E057FD4C2491FC01E65BFD4C849188235B -:10D9500061F190E0880F991FFC01E450FE4CC591E5 -:10D96000D491FC01EA5EFD4CA591B491611109C00E -:10D970009FB7F8948881209582238883EC912E2389 -:10D980000BC0623061F49FB7F8948881322F3095D4 -:10D9900083238883EC912E2B2C939FBF06C08FB7D7 -:10D9A000F894E8812E2B28838FBFDF91CF910895C3 -:10D9B0001F93CF93DF93182FEB0161E0BDDF20971A -:10D9C00011F460E004C0CF3FD10531F461E0812F54 -:10D9D000DF91CF911F9182CFE12FF0E0EA52FD4C11 -:10D9E000E4918E2F90E0FC013197E231F10508F0CF -:10D9F0009DC08827EC57FF4F8F4F0D94530F84B570 -:10DA0000806884BDC7BD97C084B5806284BDC8BD31 -:10DA100092C080918000806880938000D0938900BC -:10DA2000C093880088C080918000806280938000CD -:10DA3000D0938B00C0938A007EC080918000886064 -:10DA400080938000D0938D00C0938C0074C080912F -:10DA5000B00080688093B000C093B3006CC0809128 -:10DA6000B00080628093B000C093B40064C0809125 -:10DA70009000806880939000D0939900C0939800A4 -:10DA80005AC080919000806280939000D0939B0058 -:10DA9000C0939A0050C0809190008860809390005D -:10DAA000D0939D00C0939C0046C08091A0008068E8 -:10DAB0008093A0008091A0008F7B8093A000D093E2 -:10DAC000A900C093A80037C08091A0008062809315 -:10DAD000A000D093AB00C093AA002DC08091A000FD -:10DAE00088608093A000D093AD00C093AC0023C0A9 -:10DAF00080912001806880932001D0932901C093F8 -:10DB0000280119C080912001806280932001D09368 -:10DB10002B01C0932A010FC080912001886080935F -:10DB20002001D0932D01C0932C0105C0C038D10530 -:10DB30000CF04CCF46CFDF91CF911F9108958F927B -:10DB40009F92AF92BF92CF92DF92EF92FF926B01C2 -:10DB50007C016BDC4B015C01C114D104E104F104D4 -:10DB6000E9F063DCDC01CB0188199909AA09BB093A -:10DB7000883E9340A105B10578F321E0C21AD1088F -:10DB8000E108F10888EE880E83E0981EA11CB11C04 -:10DB9000C114D104E104F10421F7DECFFF90EF902E -:10DBA000DF90CF90BF90AF909F908F9008952FB748 -:10DBB000F89460911D1470911E1480911F1490911F -:10DBC00020142FBF08951F920F920FB60F921124A9 -:10DBD0002F933F938F939F93AF93BF9380911D1487 -:10DBE00090911E14A0911F14B091201430911C1418 -:10DBF00023E0230F2D3720F40196A11DB11D05C090 -:10DC000026E8230F0296A11DB11D20931C148093BA -:10DC10001D1490931E14A0931F14B0932014809190 -:10DC2000211490912214A0912314B09124140196F0 -:10DC3000A11DB11D8093211490932214A09323144D -:10DC4000B0932414BF91AF919F918F913F912F91E9 -:10DC50000F900FBE0F901F901895AF92BF92CF926A -:10DC6000DF92EF92FF920F931F93CF93DF935B01AD -:10DC700089014A3009F490C0453109F062C0DB01E6 -:10DC80001296ED91FC911397F280C681D781A49AE8 -:10DC900088E290E00197F1F720E1E22EEF0C38E204 -:10DCA000C32ED12C88EF0E940574C6010197F1F7AD -:10DCB000BFE1BF1508F457C08F2D807780680E94A0 -:10DCC00005748F2D8295807F0E940574C60101978F -:10DCD000F1F780E80E94057480E00E940574C60197 -:10DCE0000197F1F78AEF0E940574C6010197F1F7D9 -:10DCF0008E01005F1F4F8881807F0E94057489918B -:10DD00008295807F0E940574C017D107A1F7C601D4 -:10DD10000197F1F7F394FE10C5CFA498F501C281E5 -:10DD2000D381CE010E94CE7D8111FAC1DF91CF91C6 -:10DD30001F910F91FF90EF90DF90CF90BF90AF9029 -:10DD40000895DB011296CD91DC911397842F90E01A -:10DD5000FC017497E433F105E8F48827EA56FF4F95 -:10DD60008F4F0D94530F10EE1F0D1068812F807F81 -:10DD70000E940574812F8295807F0E940574C601E0 -:10DD80000197F1F780E80E94057480E8A6CF8981A9 -:10DD9000F901808381E0CACF9C9AA4989B9AA398AA -:10DDA0008091040184608093040180910501809535 -:10DDB000847080930301A49A88E290E00197F1F7C0 -:10DDC00088E790E02EE93FE0CEE9DFE0F901319706 -:10DDD000F1F70197C9F788EF0E94057408E210E097 -:10DDE000C8010197F1F780E20E94057480E00E946B -:10DDF0000574C8010197F1F780E00E94057480E87E -:10DE00000E940574C8010197F1F780E00E94057433 -:10DE100080E10E940574C8010197F1F7CE010197D6 -:10DE2000F1F7CE010197F1F7CE010197F1F7CE019D -:10DE30000197F1F7CE010197F1F7CE010197F1F7C4 -:10DE4000CE010197F1F7CE010197F1F7CE010197CD -:10DE5000F1F7CE010197F1F7CE010197F1F7CE016D -:10DE60000197F1F7CE010197F1F7CE010197F1F794 -:10DE70002197F1F780E20E94057480E40E94057406 -:10DE8000C8010197F1F780E20E94057480E60E94C4 -:10DE90000574C8010197F1F7F12CC8E2D0E08F2D8D -:10DEA000807780680E9405748F2D8295807F0E9404 -:10DEB0000574C8010197F1F780E80E94057480E0BD -:10DEC0000E940574C8010197F1F78AEF0E9405745A -:10DED000C8010197F1F790E2809105018470809369 -:10DEE0000301A398809105018095847080930301BC -:10DEF00080910501847080930301A39880910501AE -:10DF000080958470809303018091050184708093D3 -:10DF10000301A3988091050180958470809303018B -:10DF200080910501847080930301A398809105017D -:10DF300080958470809303018091050184708093A3 -:10DF40000301A3988091050180958470809303015B -:10DF500080910501847080930301A398809105014D -:10DF60008095847080930301809105018470809373 -:10DF70000301A3988091050180958470809303012B -:10DF800080910501847080930301A398809105011D -:10DF90008095847080930301809105018470809343 -:10DFA0000301A398809105018095847080930301FB -:10DFB00080910501847080930301A39880910501ED -:10DFC0008095847080930301809105018470809313 -:10DFD0000301A398809105018095847080930301CB -:10DFE00080910501847080930301A39880910501BD -:10DFF00080958470809303018091050184708093E3 -:10E000000301A3988091050180958470809303019A -:10E0100080910501847080930301A398809105018C -:10E0200080958470809303018091050184708093B2 -:10E030000301A3988091050180958470809303016A -:10E0400080910501847080930301A398809105015C -:10E050008095847080930301F8013197F1F7915016 -:10E0600009F03ACF88EF0E940574CE010197F1F7CD -:10E07000F39480E2F81213CF80E00E94057480ECE4 -:10E080000E94057488E290E00197F1F7A49881E07E -:10E090004DCE4D8150E0440F551F60E070E08E8101 -:10E0A0009F810F947D0FCE010E94E47D81E03ECEE2 -:10E0B000F90181819381913009F46EC0933009F0A8 -:10E0C00040C048EF480F91E02B81241708F490E0FE -:10E0D00021E03A81831708F420E031E0841708F04A -:10E0E00030E0492F432B242319F4932309F452CE13 -:10E0F000D8011296FC90EE24EA94D12C44C0B901C8 -:10E10000CE010E94B97D81E011CEF90110828A8191 -:10E1100081838D81815082838B81838381E006CED0 -:10E120004D8150E0440F551F60E070E08E819F816B -:10E130000F947D0F81E0FACD8D81D9018C9381E020 -:10E14000F5CD2B81281708F425CE2A81821708F4F3 -:10E1500021CEF2809130C9F1D8F19230B9F4E12C9E -:10E16000DD24DA9410C0B801CE010E94B97DF80117 -:10E170008181D8019C919D0D9C938E0D11968C935D -:10E18000FF0C09F407CEF7FEF4CFEDCF933009F47E -:10E19000B2CFE12CD12CF7CF38E0380F91E02B81B2 -:10E1A000281708F490E021E0381708F020E041E05B -:10E1B0005A81351708F440E0322F392B342319F4F3 -:10E1C000922309F4E7CDF801F280EE24E39495CF91 -:10E1D000E12CDD24D394D7CF809144148130E9F031 -:10E1E000823059F40E940E7D60934D0D70934E0D58 -:10E1F00080934F0D9093500D02C00E94427D81E0AC -:10E2000080934414D4DC6093510D7093520D80932D -:10E21000530D9093540D81E0089580E0089580910E -:10E220004414813071F482E080934414C0DC609324 -:10E23000550D7093560D8093570D9093580D81E0B6 -:10E24000089580E00895809144148150823010F048 -:10E2500080E0089510924414AADC6093550D7093E9 -:10E26000560D8093570D9093580D81E00895CF93EC -:10E27000DF93EAE4F3E38491EF012196882321F010 -:10E280000E948339FE01F7CFE6E4F3E38491EF01C6 -:10E290002196882321F00E948339FE01F7CF62B3D3 -:10E2A0006695617070E080E090E00E941B3E62B372 -:10E2B000617070E080E090E00E941B3E8AE00E9466 -:10E2C0008339E2E4F3E38491EF012196882321F07E -:10E2D0000E948339FE01F7CF60910601862F660FF9 -:10E2E000990BAA0BBB0BBC01CD01662797FD63956B -:10E2F0007727882799270E941B3E62B362FB662717 -:10E3000060F970E080E090E00E941B3E8AE00E948D -:10E310008339EEE3F3E38491EF012196882321F022 -:10E320000E948339FE01F7CF6091060166FB6627E4 -:10E3300060F970E080E090E00E941B3E6091060171 -:10E3400065FB662760F970E080E090E00E941B3E6C -:10E350008AE00E948339E9E3F3E38491EF01219697 -:10E36000882321F00E948339FE01F7CF60910601D6 -:10E3700063FB662760F970E080E090E00E941B3E3E -:10E38000609106016295617070E080E090E00E940B -:10E390001B3E8AE00E948339E4E3F3E38491EF01BA -:10E3A0002196882321F00E948339FE01F7CF6091E6 -:10E3B00006016695617070E080E090E00E941B3E6F -:10E3C0006091060162FB662760F970E080E090E0F2 -:10E3D0000E941B3E8AE0DF91CF910C94833967FD48 -:10E3E0003BC08230D9F028F4882341F0813061F0BD -:10E3F00033C08330E9F0843029F12EC0662311F058 -:10E40000A19A39C0A19837C0809108016111809507 -:10E4100080788093060147FF36C0089580910801F7 -:10E420006111809580748093060147FF32C0089582 -:10E43000809108016111809588708093060147FFE3 -:10E440002EC008958091080161118095827080939B -:10E45000060147FF2AC0089547FD2FC08230C9F04A -:10E4600028F4882351F0813041F50DC08330B9F094 -:10E47000843019F51AC047FD20C0442311F0A09A3A -:10E480000895A0980895442311F0A29A0895A2989F -:10E490000895809108014111809580720BC0809190 -:10E4A000080141118095807105C0809108014111DA -:10E4B000809584708093060108950895CF93DF932B -:10E4C000643021F128F46130E9F06230E9F004C0F1 -:10E4D0006830F9F06031E9F0E0E7F2E18491EF01B2 -:10E4E0002196882321F00E948339FE01F7CFECE1C9 -:10E4F000F3E38491EF012196882381F00E94833910 -:10E50000FE01F7CF40E003C040E004C041E060E01E -:10E5100002C041E061E0DF91CF9161CFDF91CF9107 -:10E5200008955F988EBD00000DB407FEFDCF8EB537 -:10E530006EBD00000DB407FEFDCF8EB55F9A089545 -:10E54000CF93DF9300D01F921F92CDB7DEB795E037 -:10E55000E7E3F3E0DE01119601900D929A95E1F761 -:10E56000E1E0F0E0EC0FFD1FE80FF11D808190E08D -:10E570000F900F900F900F900F90DF91CF91D1CF10 -:10E5800090916F00292F227091FF05C090916F002C -:10E590009D7F90936F0034E0839FC0011124FC01A4 -:10E5A000EC5CFB4E4081518162817381FC01E85D2E -:10E5B000FB4E408351836283738381E080932714F1 -:10E5C000222329F080916F00826080936F0008956C -:10E5D000BC012091251430912614409125145091AE -:10E5E00026142417350711F09A01F7CF81E026177A -:10E5F000370709F080E00895AF92BF92CF92DF9283 -:10E60000EF92FF920F931F93CF93DF930E94A9EA9B -:10E61000D0911214C0E000E913E38BEAE82E83E303 -:10E62000F82E99ECC92E93E3D92E24EEA22E23E3E3 -:10E63000B22ED11120C080911514882331F0809121 -:10E640004302882309F47AC00DC08091380D8823D5 -:10E65000B1F31092380D0E94D6978091141488233C -:10E6600071F3ABC081E090911514911180E024E02A -:10E6700041EF53E360C0D13029F58091151481300A -:10E6800031F080914302882309F458C011C0809171 -:10E69000380D8823B1F31092380DB092A10FA092DB -:10E6A000A00F0E94603A80911414882351F385C012 -:10E6B00081E090911514913009F080E020E246ED60 -:10E6C00053E339C0D23021F580911514823029F0FE -:10E6D00080914302882391F111C08091380D8823E5 -:10E6E000B9F31092380DD092A10FC092A00F0E94E2 -:10E6F000603A80911414882359F35FC081E09091AF -:10E700001514923009F080E020E247EB53E313C088 -:10E71000D33069F5809115148330C1F080914302A4 -:10E72000882361F081E090911514933009F080E026 -:10E7300020E24CE953E36C2F0E947D6FCF5FDF5FD7 -:10E74000C53009F076CFC093131437C08091380DCF -:10E75000882321F31092380DF092A10FE092A00FC0 -:10E760000E94603A809114148823C1F226C0D430EC -:10E7700029F780911514843029F080914302882371 -:10E78000E9F211C08091380D8823B9F31092380D49 -:10E790001093A10F0093A00F0E94603A809114146F -:10E7A000882359F30AC081E090911514943009F040 -:10E7B00080E020E243E853E3BECFDF91CF911F9189 -:10E7C0000F91FF90EF90DF90CF90BF90AF900895A2 -:10E7D000CF93DF9300D01F92CDB7DEB7882319F017 -:10E7E0000E944E6F0FC088EB91E09C838B8384E185 -:10E7F00090E09A838983BE016D5F7F4FCE010196C1 -:10E800000E942C920F900F900F900F90DF91CF915C -:10E810000895809144148230A9F09091A50A99231B -:10E8200061F08091B50A811103C088EA9AE002C0C4 -:10E8300085EB9AE061E00C945570813031F088E509 -:10E8400093E305C086E793E302C08AE693E36FEFA4 -:10E850000C941B701F93CF93DF930E94A9EAD09171 -:10E860001214C0E011E0D11121C080911514882349 -:10E8700029F0809143028823C9F00DC08091380DA2 -:10E880008823B9F31092380D0E94D6978091141402 -:10E89000882379F369C181E090911514911180E08A -:10E8A00024E046E554E36C2F0E947D6F8091EF09D0 -:10E8B0009091F009891B8F7021F48091A50A88231B -:10E8C00029F1D13031F580911514813031F08091EA -:10E8D0004302882309F443C00FC08091380D882378 -:10E8E000B1F31092380D8CEA93E80E9432A6809121 -:10E8F0001414882361F338C181E09091151491308C -:10E9000009F080E023E041E554E326C0D13009F46A -:10E9100006C1D23021F580911514823029F0809102 -:10E9200043028823E1F00FC08091380D8823B9F3AA -:10E930001092380D8CE196EE0E9432A6809114144C -:10E94000882369F311C181E090911514923009F088 -:10E9500080E023E041E454E36C2F0E947D6F8091BE -:10E96000A60A882309F4ACC08091780C882309F4A6 -:10E9700081C08091A50A882331F1D33009F04BC0C2 -:10E9800080911514833031F080914302882309F47B -:10E99000E9C00FC08091380D8823B1F31092380D73 -:10E9A0001092A50A3CDC35DF80911414882361F3B2 -:10E9B000DBC081E090911514933009F080E020E2F3 -:10E9C00045E354E324C0D33031F5809115148330EE -:10E9D00031F080914302882309F4C4C00FC08091B4 -:10E9E000380D8823B1F31092380D1093A50AF4DB8B -:10E9F00010DF80911414882361F3B6C081E09091F8 -:10EA00001514933009F080E020E24DE154E36C2FBF -:10EA10000E947D6FA7C0D43009F0A4C08091151466 -:10EA2000843031F080914302882309F49BC018C0E0 -:10EA30008091380D8823B1F31092380D1092390D62 -:10EA4000109213021093550F6FEF86EF93E30E941D -:10EA50001B700E94D09780911414882319F384C0EE -:10EA600081E090911514943009F080E020E242E1B9 -:10EA700054E3CDCFD33009F049C0809115148330D1 -:10EA800031F080914302882309F440C00FC0809187 -:10EA9000380D8823B1F31092380D8FE396EA0E9467 -:10EAA00032A680911414882361F35EC081E09091B6 -:10EAB0001514933009F080E023E044E054E323C0D0 -:10EAC000D33021F580911514833029F080914302D1 -:10EAD0008823E1F00FC08091380D8823B9F310929C -:10EAE000380D8FE396EA0E9432A680911414882391 -:10EAF00069F33AC081E090911514933009F080E0F9 -:10EB000023E04AE254E36C2F0E947D6F84E0CF5FE4 -:10EB1000DF5FC53009F0A7CE8093131425C0809124 -:10EB20001514813031F080914302882309F417CF06 -:10EB30000FC08091380D8823B1F31092380D82E117 -:10EB40009EE70E9432A680911414882361F30CC0C2 -:10EB500081E090911514913009F080E023E049E4C0 -:10EB600054E3FACE85E0D3CFDF91CF911F91089582 -:10EB70004F925F926F927F928F929F92AF92BF92CD -:10EB8000CF92DF92EF92FF920F931F93CF93DF9379 -:10EB9000EC016091E0137091E113072E000C880BDB -:10EBA000990B0F9412089B01AC01688179818A81CD -:10EBB0009B810F94570C6B017C016091E213709163 -:10EBC000E313072E000C880B990B0F9412089B017E -:10EBD000AC016C817D818E819F810F94570C4B011C -:10EBE0005C0120915D0230915E0240915F02509184 -:10EBF0006002C701B6010F940C08882309F466C0AF -:10EC0000C0925D02D0925E02E0925F02F0926002DA -:10EC10002091EA143091EB144091EC145091ED14D2 -:10EC2000C701B6010F9471082B013C010F94CD0D63 -:10EC30006B017C0120E030E0A9010F940C0887FDF6 -:10EC400010C020E030E040E050E4C701B6010F946E -:10EC50007E0E18164CF4C12CD12CE12C00E4F02EC1 -:10EC600003C0C12CD12C7601A7019601C301B201CA -:10EC70000F94570C2B013C0120E030E0A9010F94C8 -:10EC80000C0887FD09C0409212155092131560922E -:10EC900014157092151508C01092121510921315C4 -:10ECA0001092141510921515C701B6010F949C0D02 -:10ECB00060931115062E000C770B6F5F7F4F62304B -:10ECC000710514F062E070E0609310152091590214 -:10ECD00030915A0240915B0250915C02C501B4012F -:10ECE0000F940C08D0915802C0911115811103C0E6 -:10ECF000DC1367C02DC18092590290925A02A092F3 -:10ED00005B02B0925C022091EE143091EF144091BE -:10ED1000F0145091F114C501B4010F9471084B0126 -:10ED20005C010F94CD0D6B017C0120E030E0A90166 -:10ED30000F940C0887FD10C020E030E040E050E464 -:10ED4000C701B6010F947E0E18164CF4C12CD12CBD -:10ED5000E12C10E4F12E03C0C12CD12C7601A701C7 -:10ED60009601C501B4010F94570C4B015C0120E0E2 -:10ED700030E0A9010F940C0887FD09C080920C15A2 -:10ED800090920D15A0920E15B0920F1508C010921A -:10ED90000C1510920D1510920E1510920F15C7013B -:10EDA000B6010F949C0D60930B15062E000C770B8B -:10EDB0006F5F7F4F6230710514F062E070E0609326 -:10EDC0000A1520910B15DC1305C08091570282179C -:10EDD00009F474C0C0935802209357028C2FCC0FB3 -:10EDE000990BC22F220FDD0B9C01220F331F820FC4 -:10EDF000931FFC01EC0FFD1FEE0FFF1FEE0FFF1F17 -:10EE0000EF58F04F208131814281538120930615C4 -:10EE100030930715409308155093091500910A1572 -:10EE2000002E000C110BFC01E00FF11FEE0FFF1F75 -:10EE3000EE0FFF1FEF58F04F608171818281938147 -:10EE40000F94570C6093021570930315809304156B -:10EE500090930515E09110150E2E000CFF0BCF01BD -:10EE6000880F991FE80FF91FCE0FDF1FCC0FDD1F92 -:10EE7000CC0FDD1FCF58D04F288139814A815B816B -:10EE80002093FE143093FF14409300155093011506 -:10EE9000E00FF11FEE0FFF1FEE0FFF1FEF58F04FB7 -:10EEA00060817181828193810F94570C6093FA1471 -:10EEB0007093FB148093FC149093FD1480900C15B8 -:10EEC00090900D15A0900E15B0900F152091021581 -:10EED000309103154091041550910515C501B401F9 -:10EEE0000F9471082091061530910715409108156F -:10EEF000509109150F94580C6B017C016093F61426 -:10EF00007093F7148093F8149093F9142091FA14E5 -:10EF10003091FB144091FC145091FD14C501B401D3 -:10EF20000F9471082091FE143091FF144091001548 -:10EF3000509101150F94580CA70196010F94570C8E -:10EF40006093F2147093F3148093F4149093F51477 -:10EF50002091F2143091F3144091F4145091F5146F -:10EF600060911215709113158091141590911515DB -:10EF70000F9471082091F6143091F7144091F81411 -:10EF80005091F9140F94580CDF91CF911F910F916C -:10EF9000FF90EF90DF90CF90BF90AF909F908F90B9 -:10EFA0007F906F905F904F900895CF93DF93E091A3 -:10EFB000530FF0E0E353F24F8081882381F0EBE6BA -:10EFC000F4E38491EF012196882321F00E94833994 -:10EFD000FE01F7CF8AE0DF91CF910C948339DF9166 -:10EFE000CF910895CF93DF938091E8148093E91433 -:10EFF000E2E6F4E38491EF012196882321F00E9458 -:10F000008339FE01F7CF8091910990919209A091E7 -:10F010009309B0919409BC01CD016F5F7F4F8F4F71 -:10F020009F4F0E941B3E8AE00E948339DF91CF915F -:10F03000BCCF4F925F926F927F928F929F92AF92CE -:10F04000BF92CF92DF92EF92FF921F93CF93DF9305 -:10F05000C091530F20E6C29FE0011124CD52D24F40 -:10F060008091070480FF1AC0EFE9F2E184917F01EB -:10F070006FEFE61AF60A811102C07E0104C00E94F9 -:10F080008339F701F3CFF70181917F01882319F0CC -:10F090000E948339F8CF8AE00E9483391092641469 -:10F0A000109263148FE38093671410926614109289 -:10F0B000651410925F1410926014109261141092F3 -:10F0C0006214CE01EC01288101962032D9F32E344E -:10F0D000C9F4898190ED980F9A3020F08D3211F0AB -:10F0E0008B3281F4FE0132969F012F5F3F4F80816A -:10F0F00080538A3010F4F901F7CFEF0131968881FF -:10F100008032D9F3D093A40FC093A30F7E01FFEFF9 -:10F11000EF1AFF0A18816AE270E0C7010F94A20F8C -:10F12000009731F0FC01319780818032E1F3118248 -:10F130001D3429F0143519F0173409F0EAC0F7012D -:10F1400080812FEFE21AF20A8032C9F380538A30AD -:10F1500008F0DFC01093671480E090E06AE0319619 -:10F16000DF0111972C91022E000C330B2053310933 -:10F17000689FA001699F500D1124C901840F951F3C -:10F18000208120532A3058F390936614809365149D -:10F19000DF0131962C912032D9F31D34D1F48E3118 -:10F1A000910591F03CF48731910571F08C31910516 -:10F1B00081F40AC08537910564F08737910524F002 -:10F1C000803A63E0960729F4B0936414A093631423 -:10F1D000A0C0C12CD12C760140E050E0812C912CB4 -:10F1E00054018394FD0131967C9171110DC05093AF -:10F1F000641440936314C0925F14D0926014E09240 -:10F200006114F092621485C07132E1F41D34D1F4BE -:10F2100080329105B9F4C0925F14D0926014E092EC -:10F220006114F0926214F0936414E093631463E247 -:10F2300070E0CF010F94A20F009709F46AC0FC019F -:10F24000108267C071547A3108F040C09F01F90103 -:10F2500060812F5F3F4F6032D1F320ED260F2A30BF -:10F26000D8F06E3211F421810CC06D3211F06B3286 -:10F2700059F4218130ED320F3A3070F02E3221F402 -:10F28000228120532A3040F04115510509F052C027 -:10F29000AF01415051094EC09F01A72FB0E024019A -:10F2A000350104C0440C551C661C771C7A95D2F7B6 -:10F2B000C428D528E628F7282115310511F02C1B84 -:10F2C00001C020E0AB5BBB4E2C9304C0411551053F -:10F2D00009F4AD01208121542A3110F4DF0182CFDD -:10F2E0009F01F901D9016D916623C1F370ED760F8D -:10F2F0007A3010F49D01F5CF73ED760F7230D0F3B4 -:10F300006B32C1F3F9012F5F3F4F60816032D1F35F -:10F31000E5CFDF91CF911F91FF90EF90DF90CF90DD -:10F32000BF90AF909F908F907F906F905F904F9025 -:10F330000C946C1A20E030E0B0CF2F923F924F92A5 -:10F340005F926F927F928F929F92AF92BF92CF9275 -:10F35000DF92EF92FF920F931F93CF93DF93CDB77E -:10F36000DEB72E970FB6F894DEBF0FBECDBF182FB5 -:10F37000F62E042FA22E282F30E03A872987862FD9 -:10F3800090E09C878B87220F331FE985FA852E0F2B -:10F390003F1F3E872D87FC01E20FF31FEE0FFF1F7B -:10F3A000EE0FFF1FEF58F04F6081718182819381D2 -:10F3B0009B01AC010F94040F882309F43DC18AE03E -:10F3C0000E948339100F6F2D6A0D812F90E0DC01B0 -:10F3D000AA0FBB1FA80FB91FEB85FC85EA0FFB1F07 -:10F3E000EE0FFF1FEE0FFF1FEF58F04FB080C180F0 -:10F3F000D280E380100F812F90E0AC01440F551FA5 -:10F40000480F591FEB85FC85E40FF51FEE0FFF1F1A -:10F41000EE0FFF1FEF58F04FF080018112819380B3 -:10F42000862F90E0ED85FE85E80FF91FEE0FFF1F98 -:10F43000EE0FFF1FEF58F04F808071806280538085 -:10F440006A0D70E02D853E85260F371F220F331F72 -:10F45000220F331F2F58304F3E872D87F9014080F0 -:10F460003180A2802380A80FB91FAA0FBB1FAA0F4B -:10F47000BB1FAF58B04FFC91F98311962C91119797 -:10F480002A8312963C9112973B8313968C918C831E -:10F49000FA01E60FF71FEE0FFF1FEE0FFF1FEF58E9 -:10F4A000F04F90819D8321812E8332813F83838120 -:10F4B00088872F2D302F412F592D6F2D702F812FA1 -:10F4C000992D0F94040F882321F0F12C00E010E017 -:10F4D000912C2B2D3C2D4D2D5E2D6B2D7C2D8D2DAE -:10F4E0009E2D0F94040F882319F0BF2C6801E92C7E -:10F4F000242D332D4A2D522D642D732D8A2D922DBE -:10F500000F94040F882321F0412C312CA12C212CA5 -:10F51000282D372D462D552D682D772D862D952D8F -:10F520000F94040F882321F0842C732C6A2C522C06 -:10F530002D813E814F8158856D817E818F81988597 -:10F540000F94040F882321F01D821E821F821886CB -:10F5500029813A814B815C8169817A818B819C818F -:10F560000F94040F882341F09D819983EE81EA83F3 -:10F57000FF81FB8328852C8389859A85880F991FB5 -:10F58000E985FA858E0F9F1F2B853C85820F931F7F -:10F59000880F991F880F991F8F58904F9A878987D6 -:10F5A0002B2D3C2D4D2D5E2D6B2D7C2D8D2D9E2DCF -:10F5B0000F94580C2F2D302F412F592D0F94570C8D -:10F5C0006B017C01282D372D462D552D682D772D6B -:10F5D000862D952D0F94580C242D332D4A2D522D08 -:10F5E0000F94570C9B01AC01C701B6010F94580C46 -:10F5F0006B017C0129813A814B815C8169817A812F -:10F600008B819C810F94580C2D813E814F815885B0 -:10F610000F94570C9B01AC01C701B6010F94580C15 -:10F6200020E030E040E450E40F94340DE985FA85A1 -:10F6300060837183828393832E960FB6F894DEBF26 -:10F640000FBECDBFDF91CF911F910F91FF90EF9033 -:10F65000DF90CF90BF90AF909F908F907F906F90F2 -:10F660005F904F903F902F9008955DD6E091B40940 -:10F67000F091B509828193819093AD098093AC0993 -:10F6800080E1E5E0FAE0DF01282F1D922A95E9F7F5 -:10F69000E5EFF9E0DF011D928A95E9F71092F10993 -:10F6A0001092F2091092F3091092F4091092F009E5 -:10F6B0001092EF091092EE091092ED091092EC09E8 -:10F6C0001092DD0A1092E00A1092DC0A1092DB0A16 -:10F6D0008BE792E09093DA0A8093D90A1092FC0AA1 -:10F6E0001092FF0A1092FB0A1092FA0A9093F90AFC -:10F6F0008093F80AE7E1FBE01482178213821282FA -:10F70000918380837F96BCE0ED34FB07A9F789E104 -:10F7100080934F0C1092520C10926A0C1092750C40 -:10F720001092780C1092740C1092730C8BE792E08C -:10F730009093720C8093710C1092A40A1092A30AF9 -:10F740001092A60A1092A50A1092D10A1092D20A1B -:10F750001092D30A1092D40A1092D50A1092D60AA7 -:10F760001092D70A1092D80A1092900C10924D0C59 -:10F7700086E391E0E7E1FBE0DF019C011D9221506F -:10F780003040E1F79FEF9093D00A25E732E03093C5 -:10F79000860A2093850A84E08093920A1092900A48 -:10F7A00010928F0A1092910A6E9A769810928B0A94 -:10F7B00010928C0A10928D0A10928E0A8091810A02 -:10F7C000843218F09093820A089591E0980F9093F4 -:10F7D000810A8093820A90E0FC01EE0FFF1F8E0FDA -:10F7E0009F1FFC01EB5EF54F88EB9BE092838183CA -:10F7F0000895CF93DF93E0E7F2E18491EF01219642 -:10F80000882321F00E948339FE01F7CFEEE4F3E173 -:10F810008491EF012196882321F00E948339FE0113 -:10F82000F7CFDF91CF910895CF93DF93CDB7DEB7B8 -:10F83000AA970FB6F894DEBF0FBECDBF789484B5FB -:10F84000826084BD84B5816084BD85B5826085BDDC -:10F8500085B5816085BD80916E00816080936E006A -:10F86000109281008091810082608093810080915C -:10F87000810081608093810080918000816080930D -:10F8800080008091B10084608093B1008091B000CD -:10F8900081608093B000809191008260809391009C -:10F8A00080919100816080939100809190008160AF -:10F8B000809390008091A10082608093A10080914C -:10F8C000A10081608093A1008091A000816080935D -:10F8D000A00080912101826080932101809121010B -:10F8E00081608093210180912001816080932001BB -:10F8F00080917A00846080937A0080917A0082609F -:10F9000080937A0080917A00816080937A00809160 -:10F910007A00806880937A001092C1006F98779A7D -:10F9200082E08093C0001092C50087E08093C400FD -:10F930008091C10080618093C1008091C100886086 -:10F940008093C1008091C10080688093C100E8E489 -:10F95000FEE184918F010F5F1F4F882321F00E94E9 -:10F960008339F801F6CFEFE9F2E184918F010F5F5F -:10F970001F4F882321F00E948339F801F6CF14B776 -:10F9800010FF0DC0EFE3FEE184917F012FEFE21A3B -:10F99000F20A882321F00E948339F701F5CF11FF85 -:10F9A0000DC0EEE2FEE184917F013FEFE31AF30A1E -:10F9B000882321F00E948339F701F5CF12FF0DC093 -:10F9C000ECE1FEE184917F019FEFE91AF90A8823B7 -:10F9D00021F00E948339F701F5CF13FF0DC0EBE052 -:10F9E000FEE184917F012FEFE21AF20A882321F0D1 -:10F9F0000E948339F701F5CF15FF0CC0EAEFFDE156 -:10FA000084918F010F5F1F4F882321F00E9483395B -:10FA1000F801F6CF14BEE3EFFDE184918F010F5F93 -:10FA20001F4F882321F00E948339F801F6CF80E22E -:10FA30000E948339ECEEFDE184918F010F5F1F4F2F -:10FA4000882321F00E948339F801F6CF8AE00E94D2 -:10FA50008339EFE9F2E184918F010F5F1F4F882313 -:10FA600021F00E948339F801F6CFECEDFDE184919D -:10FA70008F010F5F1F4F882321F00E948339F80107 -:10FA8000F6CFE1EDFDE184918F010F5F1F4F8823D9 -:10FA900021F00E948339F801F6CFE8EAFDE1849174 -:10FAA0008F010F5F1F4F882321F00E948339F801D7 -:10FAB000F6CFEFE9F2E184918F010F5F1F4F8823AA -:10FAC00021F00E948339F801F6CFE1E9FDE184914C -:10FAD0008F010F5F1F4F882321F00E948339F801A7 -:10FAE000F6CFEFE9F2E184918F010F5F1F4F88237A -:10FAF00021F00E948339F801F6CF8091161590917C -:10FB00001715FE0131966F01BF01009719F0681BB0 -:10FB1000790B02C06C51754182E89DE10E941F582B -:10FB200060E175E08BE69DE10E941F588AE00E942B -:10FB3000833981E08093CD0D8093CE0D8093CF0DDE -:10FB40008093D00D0E941EE58CE0E1ECFDE0A6EB79 -:10FB5000BFE001900D928A95E1F70E94D635809121 -:10FB60000101806480930101809101018061809393 -:10FB70000101809101018860809301016D9A80915B -:10FB8000010180628093010180910101886080936E -:10FB900001016C9A87ED80937A0010927E0010929A -:10FBA0007D0080917E00816080937E0080917E0048 -:10FBB000846080937E0080E888BD80916E008460C0 -:10FBC00080936E006AEF70E080E090E00E949FED0D -:10FBD00085E090E09093BD0D8093BC0D00910F02E5 -:10FBE0001091100260E0C8010E94987420E030E09B -:10FBF00040EA50E40F940C0887FF07C00051110938 -:10FC00001093100200930F02E9CF83E191E09093EB -:10FC10001202809311020091BA0D1091BB0D60E0A9 -:10FC2000C8010E94987420E030E849E853E40F943A -:10FC30007E0E18163CF4005F1F4F1093BB0D00930F -:10FC4000BA0DE9CF00910D0210910E02C8010E9479 -:10FC5000A27620E030E040EA50E40F940C0887FFE1 -:10FC600007C00051110910930E0200930D02EACF54 -:10FC70000091B80D1091B90DC8010E94A27620E044 -:10FC800030E046E153E40F947E0E18163CF4005F1A -:10FC90001F4F1093B90D0093B80DEACF0E94427D1B -:10FCA00026982E9A25982D9A3F98479A1092BF0D24 -:10FCB0001092BE0D1FB7F8948091560F811127C086 -:10FCC000EFE7F2E38491E5ECF2E39491E82FF0E0C2 -:10FCD000EE0FFF1FE450FE4CA591B491EC91E92387 -:10FCE00021F461E085E30E946EEC61E085E30E940F -:10FCF0009CEC8CB580618CBD8CB580648CBD61E062 -:10FD000084E30E949CEC61E083E30E949CEC809180 -:10FD1000560F8F5F8093560F1FBF579A1FE9E12E32 -:10FD200012E0F12E10E0F70161917F0170E0812F68 -:10FD30000E94A0F21F5F1530B1F7999A989A8091AE -:10FD400007018068809307019A9A80910701806477 -:10FD50008093070180910701806280930701809161 -:10FD6000070188608093070180910701806180937B -:10FD7000070180910701826080930701809107014C -:10FD8000846080930701B4EAEB2EB2E0FB2E10E012 -:10FD9000F70161917F01812F0E945EF21F5F153094 -:10FDA000B9F780910A01826080930A0180910A016B -:10FDB000816080930A0180910A01846080930A0126 -:10FDC00080910A01806480930A0180910A01806811 -:10FDD00080930A010F9A179A0E9A169A0D9A159AFD -:10FDE0000C9A149A0B9A139A389A4098179A809101 -:10FDF000A50F8E7F8093A50F399A4198169A80910E -:10FE0000A50F8D7F8093A50F3A9A4298159A8091FD -:10FE1000A50F8B7F8093A50F3B9A4398149A8091EE -:10FE200080008C7F8093800080918100877E886035 -:10FE300080938100809180008F73809380008091F7 -:10FE40008100887F82608093810080E090E49093BD -:10FE50008900809388001092850010928400809120 -:10FE60006F00826080936F0081E08093BF0D789473 -:10FE70000E94B24F67E170E082E89AE00E946092CF -:10FE8000E091820AF0E0CF01880F991FE80FF91F77 -:10FE9000EB5EF54F80818F7B80836AE570E082E8BE -:10FEA0009AE00E94AD561092C00D0E940CA60E94CE -:10FEB00009F40091B209B090B30910E0C80180586C -:10FEC000910997FD019695958795E82E0E946D5AA8 -:10FED000C8014E9796958795A82E06561109169536 -:10FEE0000795F02EE4EF9E2E9B0CBA94BA9409E28B -:10FEF00020E840E06E2D82EB99E00E94286A88237A -:10FF000041F00BED1AE129E240E160E08E2D0E9404 -:10FF1000CD9584E00E94379840E653E0692D8A2D04 -:10FF20000E94A49546E653E06B2D8F2D0E94A49568 -:10FF30000E9450598111DBCF64EC79E080E090E0C1 -:10FF40000E942A6F80EA90E00E94A83380E00E941D -:10FF50008A3998E288E10FB6F894A89580936000FA -:10FF60000FBE909360004FE4642E4EE1742E5E014C -:10FF7000F1E2AF0EB11C2FE6222E2EE1322E30E040 -:10FF8000432E30E0532E8091D00A87FD3DC08091F2 -:10FF9000A50A811139C08091A60A811102C00E9470 -:10FFA000EA908091A60A882361F18091D00A282FD7 -:10FFB000082E000C330B3F938F937F926F92BF926A -:10FFC000AF92C4D78DED9AE00E9476D00F900F903B -:10FFD0000F900F900F900F908091E00A823088F080 -:10FFE0008091E50A9091E60AA091E70AB091E80AAB -:10FFF0008F719927AA27BB27892B8A2B8B2B09F472 -:020000022000DC -:1000000037C1FFEFF093D00A8091550F882331F16B -:100010001092550F1092A50A8091780C882321F038 -:1000200085E79CE00E9419CF1092540F1092D10DD9 -:100030001092530F0E9470AB0E9423F10E947E76B3 -:1000400010920C1410920B1410920E1410920D14A6 -:100050001092101410920F14109213028091540FEA -:10006000843010F40E94B83A8091540F882309F428 -:100070009CC08091A30A882309F484C00091530F87 -:1000800020E6029F800111240D52124F62EB7EE1A7 -:10009000C80142D7892BF9F085E79CE00E940FBB8D -:1000A00085E79CE00E9419CF1092A40A1092A30A3F -:1000B000EFE9FEE184918F010F5F1F4F882341F02C -:1000C0000E948339F801F6CF8091A40A81115AC0A9 -:1000D0000E94D5F759C0F80101900020E9F7319747 -:1000E0007F01E01AF10A1092750C6EE470E0C8010D -:1000F0000F94A20F4C01009739F431E0E31AF10894 -:10010000F801EE0DFF1D0EC060E270E00F94A20F2B -:100110008C010F5F1F4F6AE270E0C4010F94A20FC1 -:10012000FC0131978DE081838AE082831382F8019C -:1001300001900020E9F73197AF01401B510BB80146 -:1001400085E79CE00E9441BB8091750C882309F4EF -:10015000BBCFE0E7F2E184918F010F5F1F4F88234F -:1001600021F00E948339F801F6CFE8E5FEE18491A1 -:100170008F010F5F1F4F882309F4A6CF0E94833998 -:10018000F801F5CF0E9419F88091540F882369F087 -:1001900081508093540F8091530F8F5F843018F4F7 -:1001A0008093530F02C01092530F8091D20D882379 -:1001B00009F451C09091D20D8091570F981709F40E -:1001C0004AC0EFE9F2E184918F010F5F1F4F88234E -:1001D00021F00E948339F801F6CFE0E9FEE1849135 -:1001E0008F010F5F1F4F882321F00E948339F80190 -:1001F000F6CF8091D20D80FD74C08091D20D84FD28 -:1002000070C090E2F92E8091D20D81FD76C0809170 -:10021000D20D85FD72C000E28091D20D82FD78C0C2 -:100220008091D20D86FD74C010E28AE00E9483396D -:100230001F9280E28F931F921F931F920F931F9222 -:10024000FF923F922F921F920E94E4920FB6F89471 -:10025000DEBF0FBECDBF8091D20D8093570F0E949D -:10026000B2BF4114510409F48ECE0E94000083CE27 -:1002700040E050E0B6018DED9AE00E94A7BA181652 -:100280000CF0BFCEF60101900020E9F73197FE2E69 -:10029000FC18FA942FEFF21669F086010F0D111D6C -:1002A000F7FC1A95F801808190E00F945F0FF80138 -:1002B0008083EFCF8A858E3709F48ECE45E050E0FB -:1002C000B501CE0101960F94BD0F892B09F084CEA4 -:1002D000C5010E9431968091D00A8F5F8093D00A29 -:1002E00093CE80E00E948187AB01BC018CE89EE147 -:1002F0000E94025888E5F82E86CF81E00E9481870F -:10030000AB01BC0188E89EE10E94025809E584CF58 -:1003100082E00E948187AB01BC0184E89EE10E94DB -:1003200002581AE582CF1F93CF93DF93CEEAD9E02C -:100330001B821A828DEA92E0998388831BAE1CAEE1 -:100340001DAE198618861B861A861D8611E01C872D -:1003500082E28E871B8A1A8A4EE050E06FEF70E0CF -:1003600085ED99E00F947D0F1CA385EB9DE79A8F97 -:10037000898F1B8F1C8E1D8E80E48E8F1F8E87E8C9 -:100380009DE79EAB8DAB85E392E09F838E830E94B9 -:10039000065A8DEA92E099838883DF91CF911F916D -:1003A00008950F931F93CF93982F862FC42F692FF3 -:1003B0000E94EB979091E60980919F0F891738F181 -:1003C0009091E80980919E0F981708F18091B50AE5 -:1003D000811114C008EA1AE0CC2319F082E00E94CF -:1003E0006898C5E1F80181918F0181110CC0C1505D -:1003F00080E20E948A59C111FACF09C01092CA0A3C -:1004000005EB1AE0E9CF0E945198C81B59F7CF912C -:100410001F910F9108950F93CF93DF93CDB7DEB760 -:10042000ED85FE85808191810E94F46E00E09C0143 -:1004300049855A8568858F810E947B9EDF91CF9187 -:100440000F9108954F925F926F927F928F929F9239 -:10045000AF92BF92CF92DF92EF92FF920F931F93D2 -:10046000CF93DF936C01EB0129013A014701580159 -:100470000E94799783E080934302D0920314C09244 -:100480000214D0930114C093001420E030E048EC33 -:1004900052E4C301B20125D60F949C0D6093FC1366 -:1004A0007093FD138093FE139093FF13BBD56B01E4 -:1004B0007C0120E030E048EC52E4C501B40111D6E3 -:1004C000A70196010F94570C0F949C0D6093F8139D -:1004D0007093F9138093FA139093FB1320E030E0AC -:1004E00048EC52E4688179818A819B81FAD5A70121 -:1004F00096010F94570C0F94A10D609317147093ED -:1005000018148093191490931A14DF91CF911F91AE -:100510000F91FF90EF90DF90CF90BF90AF909F90A2 -:100520008F907F906F905F904F900895CF93DF935F -:1005300081E79CE00E9436BF87E19BE0892B51F464 -:1005400088EF9AE00E9436BF89ED9AE0DF91CF9163 -:100550000C9436BFC0E0D0E0CE01825D934F0E9484 -:1005600036BF6F97CA3C8EEFD807B1F7E9CFAF928D -:10057000BF92CF92DF92EF92FF920F931F93CF9390 -:10058000DF935C017B016A01E9010E94799783E0B6 -:1005900080934302B0920314A0920214F0920114CB -:1005A000E0920014A601DD0C660B770B4093FC1360 -:1005B0005093FD136093FE137093FF13CE01DD0F74 -:1005C000AA0BBB0B841B950BA60BB70B8093F813E0 -:1005D0009093F913A093FA13B093FB13F701808162 -:1005E0009181092E000CAA0BBB0B841B950BA60B4B -:1005F000B70B8093171490931814A0931914B09309 -:100600001A148FE694EA9093560280935502109341 -:1006100006140093051410920414DF91CF911F91DA -:100620000F91FF90EF90DF90CF90BF90AF90089523 -:10063000CF92DF92EF92FF920F931F93CF93DF93AE -:100640008C01EB0169017A010E94799783E0809324 -:1006500043021093031400930214D0930114C09327 -:100660000014C701B601DCD42AE037ED43E25CE3B5 -:1006700038D50F949C0D6093FC137093FD138093F9 -:10068000FE139093FF13CED46B017C019B01AC0150 -:1006900060E070E887E794E40F94570C0F949C0D8A -:1006A0006093F8137093F9138093FA139093FB13EC -:1006B000688179818A819B81B3D42AE037ED43E256 -:1006C0005CE30FD5A70196010F94570C0F94A10D71 -:1006D00060931714709318148093191490931A143C -:1006E00085E19FE990935602809355028BE995ED41 -:1006F000909306148093051410920414DF91CF9107 -:100700001F910F91FF90EF90DF90CF9008950F937E -:100710001F93CF93DF938B0161E00E94EB97909141 -:10072000E60980919F0F891790F19091E8098091D7 -:100730009E0F981760F1C8010E94917326E130E086 -:10074000A901481B590BCA0157FD0196959587953C -:10075000C6E1D9EED80F8D2F8C0F87FD0EC080E239 -:100760000E948A59C150F7CFF8018491882341F043 -:100770000E945198C81B0F5F1F4F1C16ACF307C097 -:10078000CC2329F080E20E948A59C150F9CFDF9131 -:10079000CF911F910F9108958F929F92AF92BF9228 -:1007A000CF92DF92EF92FF920F931F93CF93DF933D -:1007B000EC016B016115710519F0FB0191838083D8 -:1007C0007E01FFEFEF1AFF0A0881802F90E06CD3C3 -:1007D000892B11F0E701F4CF0D3239F47E0182E06C -:1007E000E80EF11C098111E008C00B3229F47E01EA -:1007F00092E0E90EF11C098110E0E701219743E046 -:1008000050E06CEE71E0CE0160D3892BB9F42396F1 -:1008100045E050E067EE71E0CE0157D3892B09F433 -:100820002596C114D10419F0F601D183C0831111AA -:10083000F0C060E070E080E89FE7F4C043E050E083 -:1008400064EE71E0CE0141D3892B59F4C114D10477 -:1008500009F4E4C0F2E0EF0EF11CF601F182E0824F -:10086000DDC020E030E0A901C0E0D0E0F70160ED9C -:10087000A62EA00E89E08A1528F1912F9260B92E3C -:10088000812F887012FF04C0811123C0219621C0DE -:1008900081112197A5E0B0E0EBD7DC01CB01880FF7 -:1008A000991FAA1FBB1F9C01AD012A0D311D411DBF -:1008B000511D283989E93807480789E1580748F068 -:1008C000166006C09EEFA9120AC013FD40C0186052 -:1008D000B12E8FEFE81AF80A00811B2DC7CF802FA9 -:1008E0008F7D8534A1F580818D3211F4106106C0B1 -:1008F0008B3221F0319661E070E004C08181329644 -:1009000062E070E080538A3018F0E61BF70B1FC0DE -:1009100060E070E060389CE079075CF4DB01AA0FCE -:10092000BB1FAA0FBB1F6A0F7B1F660F771F680FC5 -:10093000711D3196DF0111978C9180538A3050F3ED -:1009400014FF03C0719561957109C60FD71F11FF80 -:1009500008C0C114D10429F0CF010197F601918399 -:100960008083CA01B9015CD3212F2370233019F091 -:100970004B015C0106C04B015C01B7FAB094B7F8BB -:10098000B09420E030E0A901C501B40145D388232B -:1009900009F43CC0D7FF06C0D195C195D10903E049 -:1009A00012E002C00BE112E06801F8E1CF1AD108B1 -:1009B00090E2E92EF12CCE15DF056CF0F8012591BF -:1009C000359145915491C501B4018BD34B015C0124 -:1009D000CE19DF09F0CF04501109F594E7940C15F6 -:1009E0001D0549F78A2D880F8B2D881F8F3F41F0F9 -:1009F00020E030E0A901C501B4010ED3811106C089 -:100A000082E290E090931B1580931A15C501B40102 -:100A100009C060E070E080E89FEF04C060E070E033 -:100A200080EC9FE7DF91CF911F910F91FF90EF90A6 -:100A3000DF90CF90BF90AF909F908F9008953F929E -:100A40004F925F926F927F928F929F92AF92BF92DE -:100A5000CF92DF92EF92FF920F931F93CF93DF938A -:100A60005C016B017A016115710519F0FB0191833D -:100A70008083E114F10429F0C7010297839708F0FD -:100A8000E2C0E5012196F5011081812F90E00CD2A2 -:100A9000892B11F05E01F5CF1D3229F42196F50165 -:100AA000118101E007C01B3221F4E5012296F50116 -:100AB000118100E0E114F10409F1F0E1EF16F10415 -:100AC00029F43EC010E3E114F10421F128E0E2161C -:100AD000F10401F154F4E2E0EE16F10421F5812C69 -:100AE000912CA12CB0E4BB2E3DC0FAE0EF16F1042E -:100AF00039F020E1E216F104B1F42FC0103311F106 -:100B0000FAE0EF2EF12CACEC8A2E982CA82CACE05D -:100B1000BA2E28C078E0E72EF12C812C912CA12C44 -:100B2000E0E1BE2E1FC060E070E080E090E8970139 -:100B30000F2C000C440B550B5DD649015A0112C015 -:100B4000103359F488818F7D883509F0BBCF198126 -:100B50002296026080E1E82EF12C812C912CA12CB0 -:100B600068E0B62E40E060E070E0CB0127010F2C7A -:100B7000000C66087708FE0150ED352E310E29E095 -:100B8000231570F42FEB210F2A3118F439EC332E92 -:100B900006C02FE9210F2A3110F529EA322E310E35 -:100BA000232D30E02E153F05D4F447FD15C08616E1 -:100BB0009706A806B90668F0A30192010CD6630D4A -:100BC000711D811D911D61307105810520E892071D -:100BD00010F04FEF01C041E021961081CCCF202FC3 -:100BE0002170C114D10471F0442329F02197F6013A -:100BF000D183C08307C001FF19C02297F601D183BA -:100C0000C08314C047FF12C0222329F060E070E0C7 -:100C100080E090E804C06FEF7FEF8FEF9FE722E264 -:100C200030E030931B1520931A1509C0222381F060 -:100C300090958095709561957F4F8F4F9F4F462F70 -:100C4000372F282F12C040E030E020E090E00DC0A8 -:100C500097FFF5CF82E290E090931B1580931A15D1 -:100C60006FEF7FEF8FEF9FE7EACF642F732F822F15 -:100C7000DF91CF911F910F91FF90EF90DF90CF9078 -:100C8000BF90AF909F908F907F906F905F904F90AC -:100C90003F9008953F924F925F926F927F928F9212 -:100CA0009F92AF92BF92CF92DF92EF92FF920F93FB -:100CB0001F93CF93DF935C016B017A01611571057E -:100CC00019F0FB0191838083E114F10429F0C7013D -:100CD0000297839708F0C6C0E5012196F5011081BF -:100CE000812F90E0E1D0892B11F05E01F5CF1D320C -:100CF00029F42196F501118101E007C01B3221F48E -:100D0000E5012296F501118100E0E114F104B1F052 -:100D1000F0E1EF16F10429F4AEC010E3E114F104A0 -:100D200001F12AE0E216F104A9F180E1E816F104EC -:100D300071F0E8E0EE16F104F1F413C0103339F568 -:100D400088818F7D883549F7198122960260F0E10C -:100D5000EF2EF12C88248A94982CA82CAFE0BA2E80 -:100D60001FC078E0E72EF12C88248A94982CA82CB8 -:100D7000EFE1BE2E15C06FEF7FEFCB0197010F2C77 -:100D8000000C440B550B36D549015A0109C08AE0C5 -:100D9000E82EF12C69E9862E982CA82C69E1B62E54 -:100DA00040E060E070E0CB0127010F2C000C6608EA -:100DB0007708FE0150ED352E310E29E0231570F431 -:100DC0002FEB210F2A3118F439EC332E06C02FE90E -:100DD000210F2A3128F529EA322E310E232D30E059 -:100DE0002E153F05ECF44F3FC1F086169706A80676 -:100DF000B90680F0A3019201EED4232D30E040E04B -:100E000050E0620F731F841F951F621773078407DA -:100E1000950710F44FEF01C041E021961081C9CF32 -:100E2000C114D10451F0442311F0219703C001FFF4 -:100E300004C02297F601D183C08300FF07C09095BC -:100E40008095709561957F4F8F4F9F4F4F3F79F4FD -:100E500082E290E090931B1580931A153FEF2FEFDD -:100E60009FEF0DC040E030E020E090E008C0462F4A -:100E7000372F282F04C0103309F069CF61CF642FBA -:100E8000732F822FDF91CF911F910F91FF90EF90E1 -:100E9000DF90CF90BF90AF909F908F907F906F909A -:100EA0005F904F903F90089591117BC3803219F06D -:100EB00089508550D0F70895FC0105900020E9F78E -:100EC000809590958E0F9F1F0895FB01DC01415086 -:100ED000504088F08D9181341CF08B350CF4805E8D -:100EE000659161341CF06B350CF4605E861B6111FA -:100EF00071F3990B0895881BFCCFFB01DC01415075 -:100F0000504048F005900D920020C9F701C01D9295 -:100F100041505040E0F70895FB0155915523A9F049 -:100F2000BF01DC014D9145174111E1F759F4CD01A5 -:100F30000590002049F04D9140154111C9F3FB0186 -:100F40004111EFCF81E090E0019708950F931F9337 -:100F5000CF93DF93CDB7DEB72E970FB6F894DEBFF1 -:100F60000FBECDBF0E891F898EE08C831A83098343 -:100F70008FEF9FE79E838D83AE01465E5F4F688D46 -:100F8000798DCE01019610D1EF81F885E00FF11F28 -:100F900010822E960FB6F894DEBF0FBECDBFDF9144 -:100FA000CF911F910F9108950F931F93CF93DF93CC -:100FB000CDB7DEB72E970FB6F894DEBF0FBECDBF0C -:100FC0008C01FA018EE08C831A83098377FF02C0BB -:100FD00060E070E8CB0101979E838D83A901BF017A -:100FE000CE010196E1D04D815E8157FD0AC02F816F -:100FF0003885421753070CF49A01F801E20FF31FEA -:1010000010822E960FB6F894DEBF0FBECDBFDF91D3 -:10101000CF911F910F91089540D008F481E0089579 -:10102000E89409C097FB3EF4909580957095619582 -:101030007F4F8F4F9F4F9923A9F0F92F96E9BB2738 -:101040009395F695879577956795B795F111F8CFB4 -:10105000FAF4BB0F11F460FF1BC06F5F7F4F8F4F1F -:101060009F4F16C0882311F096E911C0772321F015 -:101070009EE8872F762F05C0662371F096E8862FAD -:1010800070E060E02AF09A95660F771F881FDAF704 -:10109000880F9695879597F90895990F0008550F31 -:1010A000AA0BE0E8FEEF16161706E807F907C0F0EE -:1010B00012161306E407F50798F0621B730B840BF6 -:1010C000950B39F40A2661F0232B242B252B21F4D0 -:1010D00008950A2609F4A140A6958FEF811D811D70 -:1010E00008950BD028C319D328F01ED318F09523E8 -:1010F00009F00AC30FC3112452C32ED3A0F3959F46 -:10110000D1F3950F50E0551F629FF001729FBB27EE -:10111000F00DB11D639FAA27F00DB11DAA1F649F9A -:101120006627B00DA11D661F829F2227B00DA11D4D -:10113000621F739FB00DA11D621F839FA00D611DD3 -:10114000221F749F3327A00D611D231F849F600DF4 -:10115000211D822F762F6A2F11249F5750408AF02D -:10116000E1F088234AF0EE0FFF1FBB1F661F771FB9 -:10117000881F91505040A9F79E3F510570F0C4C29E -:101180000EC35F3FECF3983EDCF386957795679549 -:10119000B795F795E7959F5FC1F7FE2B880F911DD7 -:1011A0009695879597F908952F923F924F925F9267 -:1011B0006F927F928F929F92AF92BF92CF92DF9267 -:1011C000EF92FF920F931F93CF93DF93CDB7DEB7CC -:1011D0002B970FB6F894DEBF0FBECDBF6C017B011D -:1011E0008A01FC0117821682838181FFBFC1CE0173 -:1011F00001963C01F6019381F70193FD859193FFE0 -:1012000081917F01882309F4ADC1853239F493FDC2 -:10121000859193FF81917F01853221F4B60190E0A1 -:10122000D9D1E8CF912C212C312CFFE1F315D8F046 -:101230008B3279F038F4803279F08332A1F4232DA7 -:1012400020611DC08D3261F0803369F4232D21604F -:1012500016C0832D8260382EE32DE4603E2E2AC016 -:10126000F32DF8601DC037FC2DC020ED280F2A306B -:1012700040F08E32B9F436FC75C1232D2064322E35 -:1012800019C036FE06C08AE0989E200D1124922EC9 -:1012900011C0EAE02E9E200D1124222EF32DF062C3 -:1012A0003F2E08C08C3621F4832D8068382E02C072 -:1012B000883641F4F70193FD859193FF81917F0179 -:1012C0008111B3CF982F9F7D9554933028F40C5FF4 -:1012D0001F4F9FE399830DC0833631F0833771F040 -:1012E000833509F055C020C0F801808189830E5FE5 -:1012F0001F4F88248394912C530112C02801F2E0DF -:101300004F0E511CF801A080B18036FE03C0692D3C -:1013100070E002C06FEF7FEFC50151D14C01820137 -:10132000F32DFF773F2E15C0280122E0420E511CFD -:10133000F801A080B18036FE03C0692D70E002C0C4 -:101340006FEF7FEFC50130D14C01F32DF0683F2ED8 -:10135000820133FC19C0822D90E088169906A0F412 -:10136000B60180E290E036D12A94F5CFF50137FC42 -:10137000859137FE81915F01B60190E02BD121105C -:101380002A9421E0821A91088114910479F7E1C02E -:10139000843611F0893639F5F80137FE07C06081CF -:1013A0007181828193810C5F1F4F08C060817181C0 -:1013B000072E000C880B990B0E5F1F4FF32DFF7645 -:1013C0003F2E97FF09C090958095709561957F4F4E -:1013D0008F4F9F4FF0683F2E2AE030E0A30136D1B7 -:1013E000882E861844C0853731F4232D2F7EB22EE7 -:1013F0002AE030E025C0932D997FB92E8F36C1F0B9 -:1014000018F4883579F0AEC0803719F0883721F0AC -:10141000A9C0E92FE061BE2EB4FE0DC0FB2DF46023 -:10142000BF2E09C034FE0AC0292F2660B22E06C086 -:1014300028E030E005C020E130E002C020E132E0E9 -:10144000F801B7FE07C060817181828193810C5FD2 -:101450001F4F06C06081718180E090E00E5F1F4FDA -:10146000A301F4D0882E8618FB2DFF773F2E36FE81 -:101470000DC0232D2E7FA22E891458F434FE0BC0EC -:1014800032FC09C0832D8E7EA82E05C0B82CA32C5B -:1014900003C0B82C01C0B92CA4FE0FC0FE01E80D9A -:1014A000F11D8081803321F49A2D997EA92E09C0E7 -:1014B000A2FE06C0B394B39404C08A2D867809F0C6 -:1014C000B394A3FC10C0A0FE06C0B21480F4280C94 -:1014D000922C9B180DC0B21458F4B60180E290E033 -:1014E00079D0B394F8CFB21418F42B1802C0982C0A -:1014F000212CA4FE0FC0B60180E390E06BD0A2FEC9 -:1015000016C0A1FC03C088E790E002C088E590E027 -:10151000B6010CC08A2D867851F0A1FE02C08BE284 -:1015200001C080E2A7FC8DE2B60190E053D089149F -:1015300030F4B60180E390E04DD09A94F8CF8A94CD -:10154000F301E80DF11D8081B60190E043D08110D8 -:10155000F6CF222009F44ECEB60180E290E03AD0D8 -:101560002A94F7CFF6018681978102C08FEF9FEF13 -:101570002B960FB6F894DEBF0FBECDBFDF91CF9193 -:101580001F910F91FF90EF90DF90CF90BF90AF90A1 -:101590009F908F907F906F905F904F903F902F9093 -:1015A0000895992788270895FC010590615070409F -:1015B0000110D8F7809590958E0F9F1F0895FC011C -:1015C0006150704001900110D8F7809590958E0F72 -:1015D0009F1F08950F931F93CF93DF93FB012381E8 -:1015E00021FD03C08FEF9FEF2CC022FF16C0468164 -:1015F0005781248135814217530744F4A081B1817A -:101600009D012F5F3F4F318320838C93268137814B -:101610002F5F3F4F3783268314C08B01EC01FB0102 -:101620000084F185E02D1995892BE1F6D8011696F5 -:101630008D919C911797019617969C938E93169770 -:10164000CE01DF91CF911F910F910895FA01AA2742 -:10165000283051F1203181F1E8946F936E7F6E5FF5 -:101660007F4F8F4F9F4FAF4FB1E03ED0B4E03CD0A3 -:10167000670F781F891F9A1FA11D680F791F8A1F86 -:10168000911DA11D6A0F711D811D911DA11D20D0ED -:1016900009F468943F912AE0269F11243019305DA7 -:1016A0003193DEF6CF010895462F4770405D419398 -:1016B000B3E00FD0C9F7F6CF462F4F70405D4A33E5 -:1016C00018F0495D31FD4052419302D0A9F7EACFAD -:1016D000B4E0A6959795879577956795BA95C9F7DC -:1016E00000976105710508959B01AC010A2E0694CF -:1016F0005795479537952795BA95C9F7620F731F88 -:10170000841F951FA01D089597F99F6780E870E0DA -:1017100060E008959FEF80EC089500240A94161667 -:10172000170618060906089500240A9412161306CF -:10173000140605060895092E0394000C11F488235D -:1017400052F0BB0F40F4BF2B11F460FF04C06F5F79 -:101750007F4F8F4F9F4F089557FD9058440F551F4F -:1017600059F05F3F71F04795880F97FB991F61F023 -:101770009F3F79F087950895121613061406551F9A -:10178000F2CF4695F1DF08C0161617061806991F06 -:10179000F1CF86957105610508940895E894BB27FB -:1017A00066277727CB0197F90895F999FECF92BD67 -:1017B00081BDF89A992780B50895262FF999FECF13 -:1017C0001FBA92BD81BD20BD0FB6F894FA9AF99A5E -:1017D0000FBE01960895DB018F939F9349D0BF916F -:1017E000AF91A29F800D911DA39F900DB29F900D70 -:1017F00011240895A1E21A2EAA1BBB1BFD010DC0E6 -:10180000AA1FBB1FEE1FFF1FA217B307E407F507B0 -:1018100020F0A21BB30BE40BF50B661F771F881F8C -:10182000991F1A9469F760957095809590959B0122 -:10183000AC01BD01CF010895052E97FB16F400946D -:101840000FD057FD05D0D6DF07FC02D046F408C004 -:1018500050954095309521953F4F4F4F5F4F0895DC -:1018600090958095709561957F4F8F4F9F4F08950C -:101870000FD0A59F900DB49F900DA49F800D911D3A -:1018800011240895B7FFF4CFF3DF821B930B089563 -:10189000A29FB001B39FC001A39F700D811D1124B1 -:1018A000911DB29F700D811D1124911D08955058F6 -:1018B000BB27AA270ED03FCF30DF30F035DF20F036 -:1018C00031F49F3F11F41EF425CF0EF4E095E7FBB1 -:1018D0001BCFE92F41DF80F3BA1762077307840734 -:1018E000950718F071F49EF559CF0EF4E0950B2E84 -:1018F000BA2FA02D0B01B90190010C01CA01A00162 -:101900001124FF27591B99F0593F50F4503E68F1BC -:101910001A16F040A22F232F342F4427585FF3CFFD -:10192000469537952795A795F0405395C9F77EF4CE -:101930001F16BA0B620B730B840BBAF09150A1F017 -:10194000FF0FBB1F661F771F881FC2F70EC0BA0F9D -:10195000621F731F841F48F4879577956795B79525 -:10196000F7959E3F08F0B3CF9395880F08F099271D -:10197000EE0F979587950895D0DE58F080E891E0B6 -:1019800009F49EEFD1DE28F040E851E059F45EEF13 -:1019900009C0C0CE03CFE92FE078DEDE68F3092E60 -:1019A000052AC1F3261737074807590738F00E2EC6 -:1019B00007F8E02569F0E025E0640AC0EF6307F866 -:1019C000009407FADB01B9019D01DC01CA01AD01F8 -:1019D000EF9359D0B0DE0AD05F91552331F02BED53 -:1019E0003FE049E450FD49EC63CF0895DF93DD27E4 -:1019F000B92FBF7740E85FE31616170648075B0765 -:101A000010F4D92F7FD19F938F937F936F93F9D148 -:101A1000E4E9F1E0FED08FDE2F913F914F915F918D -:101A20006CDBDD2349F09058A2EA2AED3FE049EC57 -:101A30005FE3D0785D274DDFDF917DCE48D180F028 -:101A40009F3740F491110EF4AACE60E070E080E878 -:101A50009FE3089526F01B16611D711D811DB0C006 -:101A6000CAC0FDD0E39522C10CD065CE5DDE40F04A -:101A700054DE30F021F45F3F19F046CE51118FCE85 -:101A800049CE6ADE98F39923C9F35523B1F3951B28 -:101A9000550BBB27AA2762177307840738F09F5F8F -:101AA0005F4F220F331F441FAA1FA9F333D00E2EFE -:101AB0003AF0E0E830D091505040E695001CCAF76B -:101AC00029D0FE2F27D0660F771F881FBB1F261730 -:101AD00037074807AB07B0E809F0BB0B802DBF0103 -:101AE000FF2793585F4F2AF09E3F510568F00CCEB8 -:101AF00056CE5F3FECF3983EDCF38695779567957D -:101B0000B795F7959F5FC9F7880F911D96958795B3 -:101B100097F90895E1E0660F771F881FBB1F6217D2 -:101B200073078407BA0720F0621B730B840BBA0B90 -:101B3000EE1F88F7E095089504D06894B1112FCE78 -:101B4000089512DE88F09F5790F0B92F9927B7516A -:101B5000A0F0D1F0660F771F881F991F1AF0BA9571 -:101B6000C9F712C0B13081F019DEB1E0089516CE88 -:101B7000672F782F8827B85F39F0B93FCCF3869567 -:101B800077956795B395D9F73EF4909580957095C4 -:101B900061957F4F8F4F9F4F089599D080F09F3769 -:101BA00040F491110EF0FBCD60E070E080E89FEB17 -:101BB000089526F41B16611D711D811D01C01BC0F7 -:101BC000882371F4772321F09850872B762F07C054 -:101BD000662311F499270DC09051862B70E060E0C8 -:101BE0002AF09A95660F771F881FDAF7880F969567 -:101BF000879597F908959F3F31F0915020F487958C -:101C000077956795B795880F911D9695879597F964 -:101C10000895DF93CF931F930F93FF92EF92DF927C -:101C20007B018C01689405C0DA2EEF0166DAFE01B3 -:101C3000E894A5912591359145915591AEF3EF0129 -:101C400048DEFE019701A801DA9479F7DF90EF9062 -:101C5000FF900F911F91CF91DF9108955BCD84DDAF -:101C6000E8F3E894E0E0BB279F57F0F02AED3FE06F -:101C700049EC06C0EE0FBB0F661F771F881F28F0C8 -:101C8000B23A62077307840728F0B25A620B730BEB -:101C9000840BE3959A9572F7803830F49A95BB0FD0 -:101CA000661F771F881FD2F79048A7CFEF93E0FFFA -:101CB00006C0A2EA2AED3FE049EC5FEB0ADE3BDD1D -:101CC0000F90039401FC9058E1ECF1E0A8C04CDDCA -:101CD000A0F0BEE7B91788F4BB279F3860F416164A -:101CE000B11D672F782F8827985FF7CF8695779556 -:101CF0006795B11D93959639C8F30895CED908F428 -:101D00008FEF08959B01AC0160E070E080E89FE3F5 -:101D1000ABCE2ADD58F19E5758F19851A0F0E9F06A -:101D2000983020F5092E9927660F771F881F991F75 -:101D30000A94D1F712C0062E672F782F8827985F54 -:101D400011F4000C07C0993FB4F386957795679519 -:101D50009395D9F7611D711D811D3EF49095809575 -:101D6000709561957F4F8F4F9F4F0895689417CD61 -:101D700015CD9F9374DF0F9007FCEE5F97CF11F4A2 -:101D80000EF4C8CC38CFF0DCD0F39923D9F3CEF3DE -:101D90009F57550B87FF3CD00024A0E640EA9001F6 -:101DA00080585695979528F4805C660F771F881F9A -:101DB00020F026173707480730F4621B730B840B9B -:101DC000202931294A2BA6951794079420253125DF -:101DD0004A2758F7660F771F881F20F02617370706 -:101DE000480730F4620B730B840B200D311D411D2D -:101DF000A09581F7B901842F9158880F9695879502 -:101E000008959B01AC016DC948D9880B990B0895C1 -:101E100091505040660F771F881FD2F708959F9307 -:101E20008F937F936F93FF93EF939B01AC0159D9ED -:101E3000EF91FF91EEDE2F913F914F915F9151C94C -:101E4000991B79E004C0991F961708F0961B881F0C -:101E50007A95C9F780950895AA1BBB1B51E107C06D -:101E6000AA1FBB1FA617B70710F0A61BB70B881F2A -:101E7000991F5A95A9F780959095BC01CD010895B9 -:101E800097FB072E16F4009406D077FD08D0E4DF08 -:101E900007FC05D03EF4909581959F4F089570956D -:101EA00061957F4F0895EE0FFF1F881F8BBF07902E -:101EB000F691E02D199481E090E0F89486C091119C -:101EC000089581548A5108F4805E855A0895FB0173 -:101ED000DC0104C08D910190801921F441505040E3 -:101EE000C8F7881B990B0895FB01DC0102C0019023 -:101EF0000D9241505040D8F70895DC0101C06D9318 -:101F000041505040E0F70895FB01DC018D91813490 -:101F10001CF08B350CF4805E619161341CF06B35E4 -:101F20000CF4605E861B611189F3990B0895FB0127 -:101F3000DC010D900020E9F7119701900D9200202F -:101F4000E1F70895FC018191861721F08823D9F7E4 -:101F5000992708953197CF010895FB01DC018D91F8 -:101F6000019080190110D9F3990B0895FB01DC0150 -:101F700001900D920020E1F70895FB01DC01415032 -:101F8000504030F08D910190801919F40020B9F77C -:101F9000881B990B0895FB01DC014150504048F02B -:101FA00001900D920020C9F701C01D924150504090 -:101FB000E0F70895FC0181E090E00190061609F435 -:101FC000CF010020D1F7019708951AE1C8E3DAE1C3 -:101FD00000E005C0802FFE0166DF2196011DC93398 -:0C1FE000D10780E00807B1F7F894FFCFAC -:101FEC00AA00FFFFFFFFFFFF0101FF0601FF3FFFFC -:101FFC003FFF3F010000803F6400640000009643F7 -:10200C00000096430000C843010000803F104000D0 -:10201C00000080D3112DEE2D02266A555505430084 -:10202C0000C8410302C0D40100CDCCCC3D00007AE5 -:10203C00430000524394989D9DF0FF79C4F0FF79C2 -:10204C00C458595A45FF3F1CC6FF3F1CC600000030 -:10205C000000000000EE3200000000BFBC5D7D649B -:10206C0032633200000000B77D5D7D643263320064 -:10207C00803B4500803B4500007043000070428768 -:10208C0087878787101010101000000000AD735D5B -:10209C007D64326332000040400000344200000096 -:1020AC000000000000000000000000504100000093 -:1020BC000000000041640000006400000003000008 -:1020CC00006400000064000000030000001E00001B -:1020DC00001E0000001E0000001E0000001E00007C -:1020EC00000000DC050000DC05000032000000DC14 -:1020FC000500000000A0420000A0420000C8430000 -:10210C0000BA4200009643000096430000A0400035 -:10211C0000C8415635350004050300016F70656E2B -:10212C000054524947474552454400646973004D79 -:10213C00313038004D313132004D343130002F0008 -:10214C00312E312E3900687474703A2F2F657279E4 -:10215C006F6E652E636F6D005A00590058004F6EFC -:0E216C0020004F666600626564004552520016 -:00000001FF